From: Andrea Amorese Date: Thu, 25 Nov 2021 15:49:02 +0000 (+0100) Subject: Built motion from commit 5ca20156.|2.5.38 X-Git-Url: http://repos.xcallymotion.com/base//%22api/fax/attachments/%7B%7BfaxAttachment.id%7D%7D/%22?a=commitdiff_plain;h=b167c394dc44800dddd0bd3cba7748c65381c859;p=motion2.git Built motion from commit 5ca20156.|2.5.38 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 03857bb..e6d6332 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-25T15:30:28.617Z", + "time": "2021-11-25T15:39:45.704Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index a0cb788..d70f152 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-25T15:30:28.617Z", + "time": "2021-11-25T15:39:45.704Z", "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 361ef9f..e092aed 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 _0x1b94=['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[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','sequelize','exports','VIRTUAL','getDataValue','STRING','contactManager','integration','jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x515afd,_0x1a1e91){var _0x536d53=function(_0x1d3a89){while(--_0x1d3a89){_0x515afd['push'](_0x515afd['shift']());}};_0x536d53(++_0x1a1e91);}(_0x1b94,0x1f2));var _0x41b9=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0x1b94[_0x8a969d];return _0x1d8dc7;};'use strict';var Sequelize=require(_0x41b9('0x0'));module[_0x41b9('0x1')]={'name':{'type':Sequelize[_0x41b9('0x2')],'get':function(_0x16a736){return this[_0x41b9('0x3')]('action');}},'action':{'type':Sequelize[_0x41b9('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x41b9('0x5'),_0x41b9('0x6'),'motionbar',_0x41b9('0x7'),_0x41b9('0x8'),_0x41b9('0x9'),'bot',_0x41b9('0xa')]],'msg':_0x41b9('0xb')}},'comment':_0x41b9('0xb')},'data1':{'type':Sequelize[_0x41b9('0x4')](0x1000),'comment':_0x41b9('0xc')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x41b9('0xd')},'data3':{'type':Sequelize[_0x41b9('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[_0x41b9('0x4')](0x1000),'comments':_0x41b9('0xe')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x41b9('0xf')},'data6':{'type':Sequelize[_0x41b9('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x41b9('0x10')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0xd70b=['exports','VIRTUAL','getDataValue','action','STRING','integration','motionbar','jscripty','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize'];(function(_0x136c2e,_0x251400){var _0x87085e=function(_0x4880ec){while(--_0x4880ec){_0x136c2e['push'](_0x136c2e['shift']());}};_0x87085e(++_0x251400);}(_0xd70b,0x17b));var _0xbd70=function(_0x131205,_0x57575c){_0x131205=_0x131205-0x0;var _0x305300=_0xd70b[_0x131205];return _0x305300;};'use strict';var Sequelize=require(_0xbd70('0x0'));module[_0xbd70('0x1')]={'name':{'type':Sequelize[_0xbd70('0x2')],'get':function(_0x220c28){return this[_0xbd70('0x3')](_0xbd70('0x4'));}},'action':{'type':Sequelize[_0xbd70('0x5')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xbd70('0x6'),_0xbd70('0x7'),_0xbd70('0x8'),_0xbd70('0x9'),_0xbd70('0xa'),_0xbd70('0xb'),'script']],'msg':_0xbd70('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xbd70('0x5')](0x1000),'comment':_0xbd70('0xd')},'data2':{'type':Sequelize[_0xbd70('0x5')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xbd70('0x5')](0x1000),'comment':_0xbd70('0xe')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xbd70('0x5')](0x1000),'comments':_0xbd70('0xf')},'data6':{'type':Sequelize[_0xbd70('0x5')],'comments':_0xbd70('0x10')},'data7':{'type':Sequelize[_0xbd70('0x11')],'comments':_0xbd70('0x12')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index f9479a3..e887a6a 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 _0xe63c=['then','destroy','name','send','update','body','Action','params','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','count','set','json','apply'];(function(_0x1e6598,_0x2897fd){var _0x23cb89=function(_0x2b9322){while(--_0x2b9322){_0x1e6598['push'](_0x1e6598['shift']());}};_0x23cb89(++_0x2897fd);}(_0xe63c,0xe6));var _0xce63=function(_0x2c684a,_0x1a8030){_0x2c684a=_0x2c684a-0x0;var _0xc553b7=_0xe63c[_0x2c684a];return _0xc553b7;};'use strict';var emlformat=require(_0xce63('0x0'));var rimraf=require(_0xce63('0x1'));var zipdir=require(_0xce63('0x2'));var jsonpatch=require(_0xce63('0x3'));var rp=require('request-promise');var moment=require(_0xce63('0x4'));var BPromise=require(_0xce63('0x5'));var Mustache=require(_0xce63('0x6'));var util=require(_0xce63('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xce63('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xce63('0x9'));var _=require(_0xce63('0xa'));var squel=require(_0xce63('0xb'));var crypto=require(_0xce63('0xc'));var jsforce=require(_0xce63('0xd'));var deskjs=require(_0xce63('0xe'));var toCsv=require('to-csv');var querystring=require(_0xce63('0xf'));var Papa=require(_0xce63('0x10'));var Redis=require(_0xce63('0x11'));var authService=require(_0xce63('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xce63('0x13'));var hardwareService=require(_0xce63('0x14'));var logger=require(_0xce63('0x15'))('api');var utils=require(_0xce63('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xce63('0x17'));var db=require(_0xce63('0x18'))['db'];function respondWithStatusCode(_0x38c71e,_0x5cb92f){_0x5cb92f=_0x5cb92f||0xcc;return function(_0x4c9fae){if(_0x4c9fae){return _0x38c71e[_0xce63('0x19')](_0x5cb92f);}return _0x38c71e['status'](_0x5cb92f)[_0xce63('0x1a')]();};}function respondWithResult(_0x369f02,_0x1be230){_0x1be230=_0x1be230||0xc8;return function(_0x1e7c20){if(_0x1e7c20){return _0x369f02[_0xce63('0x1b')](_0x1be230)['json'](_0x1e7c20);}};}function respondWithFilteredResult(_0x39da24,_0x20e793){return function(_0x17c26d){if(_0x17c26d){var _0x275183=typeof _0x20e793[_0xce63('0x1c')]==='undefined'&&typeof _0x20e793[_0xce63('0x1d')]==='undefined';var _0x44ecb8=_0x17c26d[_0xce63('0x1e')];var _0x530b2a=_0x275183?0x0:_0x20e793[_0xce63('0x1c')];var _0x29f22f=_0x275183?_0x17c26d[_0xce63('0x1e')]:_0x20e793[_0xce63('0x1c')]+_0x20e793[_0xce63('0x1d')];var _0x14c3b4;if(_0x29f22f>=_0x44ecb8){_0x29f22f=_0x44ecb8;_0x14c3b4=0xc8;}else{_0x14c3b4=0xce;}_0x39da24[_0xce63('0x1b')](_0x14c3b4);return _0x39da24[_0xce63('0x1f')]('Content-Range',_0x530b2a+'-'+_0x29f22f+'/'+_0x44ecb8)[_0xce63('0x20')](_0x17c26d);}return null;};}function patchUpdates(_0x1122f8){return function(_0x1e65dc){try{jsonpatch[_0xce63('0x21')](_0x1e65dc,_0x1122f8,!![]);}catch(_0x3b4ec7){return BPromise['reject'](_0x3b4ec7);}return _0x1e65dc['save']();};}function saveUpdates(_0x4ed589,_0xbd4e5b){return function(_0x53de06){if(_0x53de06){return _0x53de06['update'](_0x4ed589)[_0xce63('0x22')](function(_0x4a8740){return _0x4a8740;});}return null;};}function removeEntity(_0x40eefc,_0x191657){return function(_0x34cb0d){if(_0x34cb0d){return _0x34cb0d[_0xce63('0x23')]()[_0xce63('0x22')](function(){_0x40eefc[_0xce63('0x1b')](0xcc)[_0xce63('0x1a')]();});}};}function handleEntityNotFound(_0x50f680,_0x201707){return function(_0x270c27){if(!_0x270c27){_0x50f680[_0xce63('0x19')](0x194);}return _0x270c27;};}function handleError(_0x328e50,_0x56fd47){_0x56fd47=_0x56fd47||0x1f4;return function(_0x33df95){logger['error'](_0x33df95['stack']);if(_0x33df95[_0xce63('0x24')]){delete _0x33df95[_0xce63('0x24')];}_0x328e50[_0xce63('0x1b')](_0x56fd47)[_0xce63('0x25')](_0x33df95);};}exports[_0xce63('0x26')]=function(_0x2bd457,_0x43995a){if(_0x2bd457['body']['id']){delete _0x2bd457[_0xce63('0x27')]['id'];}return db[_0xce63('0x28')]['find']({'where':{'id':_0x2bd457[_0xce63('0x29')]['id']}})['then'](handleEntityNotFound(_0x43995a,null))[_0xce63('0x22')](saveUpdates(_0x2bd457[_0xce63('0x27')],null))[_0xce63('0x22')](respondWithResult(_0x43995a,null))[_0xce63('0x2a')](handleError(_0x43995a,null));};exports[_0xce63('0x23')]=function(_0x325f78,_0x2dcea1){return db[_0xce63('0x28')][_0xce63('0x2b')]({'where':{'id':_0x325f78[_0xce63('0x29')]['id']}})['then'](handleEntityNotFound(_0x2dcea1,null))[_0xce63('0x22')](removeEntity(_0x2dcea1,null))[_0xce63('0x2a')](handleError(_0x2dcea1,null));}; \ No newline at end of file +var _0x35fd=['update','destroy','then','error','name','send','body','params','catch','Action','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save'];(function(_0x23eda7,_0x17f41e){var _0x220be9=function(_0x298269){while(--_0x298269){_0x23eda7['push'](_0x23eda7['shift']());}};_0x220be9(++_0x17f41e);}(_0x35fd,0xd3));var _0xd35f=function(_0x37823d,_0x45e3f2){_0x37823d=_0x37823d-0x0;var _0x33ce00=_0x35fd[_0x37823d];return _0x33ce00;};'use strict';var emlformat=require(_0xd35f('0x0'));var rimraf=require(_0xd35f('0x1'));var zipdir=require(_0xd35f('0x2'));var jsonpatch=require(_0xd35f('0x3'));var rp=require(_0xd35f('0x4'));var moment=require(_0xd35f('0x5'));var BPromise=require(_0xd35f('0x6'));var Mustache=require(_0xd35f('0x7'));var util=require('util');var path=require(_0xd35f('0x8'));var sox=require(_0xd35f('0x9'));var csv=require('to-csv');var ejs=require(_0xd35f('0xa'));var fs=require('fs');var fs_extra=require(_0xd35f('0xb'));var _=require('lodash');var squel=require(_0xd35f('0xc'));var crypto=require(_0xd35f('0xd'));var jsforce=require(_0xd35f('0xe'));var deskjs=require(_0xd35f('0xf'));var toCsv=require(_0xd35f('0x10'));var querystring=require(_0xd35f('0x11'));var Papa=require('papaparse');var Redis=require(_0xd35f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd35f('0x13'));var as=require(_0xd35f('0x14'));var hardwareService=require(_0xd35f('0x15'));var logger=require(_0xd35f('0x16'))(_0xd35f('0x17'));var utils=require(_0xd35f('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xd35f('0x19'));var db=require(_0xd35f('0x1a'))['db'];function respondWithStatusCode(_0x212b70,_0x234800){_0x234800=_0x234800||0xcc;return function(_0x19ea1b){if(_0x19ea1b){return _0x212b70[_0xd35f('0x1b')](_0x234800);}return _0x212b70[_0xd35f('0x1c')](_0x234800)[_0xd35f('0x1d')]();};}function respondWithResult(_0x4d3a2b,_0x371d96){_0x371d96=_0x371d96||0xc8;return function(_0x38b802){if(_0x38b802){return _0x4d3a2b[_0xd35f('0x1c')](_0x371d96)[_0xd35f('0x1e')](_0x38b802);}};}function respondWithFilteredResult(_0x201e92,_0x5eae60){return function(_0x50b16d){if(_0x50b16d){var _0x2c1ad7=typeof _0x5eae60[_0xd35f('0x1f')]===_0xd35f('0x20')&&typeof _0x5eae60['limit']==='undefined';var _0x242612=_0x50b16d[_0xd35f('0x21')];var _0x473ece=_0x2c1ad7?0x0:_0x5eae60[_0xd35f('0x1f')];var _0x5c701b=_0x2c1ad7?_0x50b16d[_0xd35f('0x21')]:_0x5eae60[_0xd35f('0x1f')]+_0x5eae60[_0xd35f('0x22')];var _0x3c0d0e;if(_0x5c701b>=_0x242612){_0x5c701b=_0x242612;_0x3c0d0e=0xc8;}else{_0x3c0d0e=0xce;}_0x201e92[_0xd35f('0x1c')](_0x3c0d0e);return _0x201e92['set'](_0xd35f('0x23'),_0x473ece+'-'+_0x5c701b+'/'+_0x242612)[_0xd35f('0x1e')](_0x50b16d);}return null;};}function patchUpdates(_0x4a71de){return function(_0x220844){try{jsonpatch[_0xd35f('0x24')](_0x220844,_0x4a71de,!![]);}catch(_0x47653c){return BPromise[_0xd35f('0x25')](_0x47653c);}return _0x220844[_0xd35f('0x26')]();};}function saveUpdates(_0x5295a0,_0x59f26e){return function(_0x141e10){if(_0x141e10){return _0x141e10[_0xd35f('0x27')](_0x5295a0)['then'](function(_0x2c363e){return _0x2c363e;});}return null;};}function removeEntity(_0x961194,_0x4c0387){return function(_0x192a13){if(_0x192a13){return _0x192a13[_0xd35f('0x28')]()[_0xd35f('0x29')](function(){_0x961194[_0xd35f('0x1c')](0xcc)[_0xd35f('0x1d')]();});}};}function handleEntityNotFound(_0x30d723,_0x44789e){return function(_0xbb5143){if(!_0xbb5143){_0x30d723[_0xd35f('0x1b')](0x194);}return _0xbb5143;};}function handleError(_0x584182,_0x372e93){_0x372e93=_0x372e93||0x1f4;return function(_0x2ca197){logger[_0xd35f('0x2a')](_0x2ca197['stack']);if(_0x2ca197[_0xd35f('0x2b')]){delete _0x2ca197[_0xd35f('0x2b')];}_0x584182[_0xd35f('0x1c')](_0x372e93)[_0xd35f('0x2c')](_0x2ca197);};}exports[_0xd35f('0x27')]=function(_0x25207e,_0x52bcec){if(_0x25207e[_0xd35f('0x2d')]['id']){delete _0x25207e['body']['id'];}return db['Action']['find']({'where':{'id':_0x25207e[_0xd35f('0x2e')]['id']}})[_0xd35f('0x29')](handleEntityNotFound(_0x52bcec,null))[_0xd35f('0x29')](saveUpdates(_0x25207e['body'],null))[_0xd35f('0x29')](respondWithResult(_0x52bcec,null))[_0xd35f('0x2f')](handleError(_0x52bcec,null));};exports[_0xd35f('0x28')]=function(_0x27f014,_0x47c471){return db[_0xd35f('0x30')][_0xd35f('0x31')]({'where':{'id':_0x27f014[_0xd35f('0x2e')]['id']}})[_0xd35f('0x29')](handleEntityNotFound(_0x47c471,null))[_0xd35f('0x29')](removeEntity(_0x47c471,null))[_0xd35f('0x2f')](handleError(_0x47c471,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 79c15a1..fe9bee5 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 _0x2ea1=['../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x25df80,_0xa2aec5){var _0x17b6d0=function(_0x446155){while(--_0x446155){_0x25df80['push'](_0x25df80['shift']());}};_0x17b6d0(++_0xa2aec5);}(_0x2ea1,0xca));var _0x12ea=function(_0x512c4c,_0x1555ec){_0x512c4c=_0x512c4c-0x0;var _0x114d24=_0x2ea1[_0x512c4c];return _0x114d24;};'use strict';var _=require(_0x12ea('0x0'));var util=require(_0x12ea('0x1'));var logger=require(_0x12ea('0x2'))(_0x12ea('0x3'));var moment=require(_0x12ea('0x4'));var BPromise=require(_0x12ea('0x5'));var rp=require(_0x12ea('0x6'));var fs=require('fs');var path=require(_0x12ea('0x7'));var rimraf=require('rimraf');var config=require(_0x12ea('0x8'));var attributes=require(_0x12ea('0x9'));module[_0x12ea('0xa')]=function(_0x551f0b,_0x132217){return _0x551f0b[_0x12ea('0xb')](_0x12ea('0xc'),attributes,{'tableName':_0x12ea('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55c6=['request-promise','path','./action.attributes','exports','define','tools_actions','lodash','../../config/logger','moment','bluebird'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x55c6,0x7e));var _0x655c=function(_0x32f179,_0x556cd3){_0x32f179=_0x32f179-0x0;var _0x319d14=_0x55c6[_0x32f179];return _0x319d14;};'use strict';var _=require(_0x655c('0x0'));var util=require('util');var logger=require(_0x655c('0x1'))('api');var moment=require(_0x655c('0x2'));var BPromise=require(_0x655c('0x3'));var rp=require(_0x655c('0x4'));var fs=require('fs');var path=require(_0x655c('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x655c('0x6'));module[_0x655c('0x7')]=function(_0x9c665d,_0x576898){return _0x9c665d[_0x655c('0x8')]('Action',attributes,{'tableName':_0x655c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 0db0313..8579cfa 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x4975,0x86));var _0x5497=function(_0x500868,_0x4e2870){_0x500868=_0x500868-0x0;var _0x1668eb=_0x4975[_0x500868];return _0x1668eb;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Action,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file +var _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(_0x176b0,_0x62c004){var _0x4c16cb=function(_0x220f3c){while(--_0x220f3c){_0x176b0['push'](_0x176b0['shift']());}};_0x4c16cb(++_0x62c004);}(_0x1261,0x144));var _0x1126=function(_0x4d6624,_0x78b606){_0x4d6624=_0x4d6624-0x0;var _0x5dbb01=_0x1261[_0x4d6624];return _0x5dbb01;};'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 diff --git a/server/api/action/index.js b/server/api/action/index.js index 4dc292b..48e06bc 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 _0xdce8=['/:id','isAuthenticated','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','./action.controller','put'];(function(_0x46196a,_0x2aa09e){var _0x37ab64=function(_0x276a05){while(--_0x276a05){_0x46196a['push'](_0x46196a['shift']());}};_0x37ab64(++_0x2aa09e);}(_0xdce8,0xf4));var _0x8dce=function(_0x10c7fa,_0x2479b1){_0x10c7fa=_0x10c7fa-0x0;var _0x511fce=_0xdce8[_0x10c7fa];return _0x511fce;};'use strict';var multer=require('multer');var util=require(_0x8dce('0x0'));var path=require(_0x8dce('0x1'));var timeout=require(_0x8dce('0x2'));var express=require(_0x8dce('0x3'));var router=express[_0x8dce('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8dce('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8dce('0x6'));router[_0x8dce('0x7')](_0x8dce('0x8'),auth[_0x8dce('0x9')](),controller['update']);router[_0x8dce('0xa')](_0x8dce('0x8'),auth[_0x8dce('0x9')](),controller['destroy']);module[_0x8dce('0xb')]=router; \ No newline at end of file +var _0xb3d6=['../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x55e9e9,_0x1afc74){var _0x39cb0c=function(_0x4c02f3){while(--_0x4c02f3){_0x55e9e9['push'](_0x55e9e9['shift']());}};_0x39cb0c(++_0x1afc74);}(_0xb3d6,0x172));var _0x6b3d=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xb3d6[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x6b3d('0x0'));var util=require(_0x6b3d('0x1'));var path=require('path');var timeout=require(_0x6b3d('0x2'));var express=require(_0x6b3d('0x3'));var router=express['Router']();var fs_extra=require(_0x6b3d('0x4'));var auth=require(_0x6b3d('0x5'));var interaction=require(_0x6b3d('0x6'));var config=require(_0x6b3d('0x7'));var controller=require(_0x6b3d('0x8'));router[_0x6b3d('0x9')](_0x6b3d('0xa'),auth[_0x6b3d('0xb')](),controller['update']);router[_0x6b3d('0xc')](_0x6b3d('0xa'),auth['isAuthenticated'](),controller[_0x6b3d('0xd')]);module[_0x6b3d('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index cbd4ff2..213b212 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js +++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5d17=['sequelize','exports','STRING','TEXT'];(function(_0x5d8260,_0x1c4f33){var _0x26cf27=function(_0x209e3e){while(--_0x209e3e){_0x5d8260['push'](_0x5d8260['shift']());}};_0x26cf27(++_0x1c4f33);}(_0x5d17,0x114));var _0x75d1=function(_0x1edfd5,_0x4379a2){_0x1edfd5=_0x1edfd5-0x0;var _0x2cfe40=_0x5d17[_0x1edfd5];return _0x2cfe40;};'use strict';var Sequelize=require(_0x75d1('0x0'));module[_0x75d1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x75d1('0x2')]},'table':{'type':Sequelize[_0x75d1('0x2')]},'conditions':{'type':Sequelize[_0x75d1('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xee14=['STRING','TEXT'];(function(_0x32040c,_0x2cd542){var _0x10ad44=function(_0x437e75){while(--_0x437e75){_0x32040c['push'](_0x32040c['shift']());}};_0x10ad44(++_0x2cd542);}(_0xee14,0x13a));var _0x4ee1=function(_0x2ad578,_0x1f18ea){_0x2ad578=_0x2ad578-0x0;var _0x33b66e=_0xee14[_0x2ad578];return _0x33b66e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4ee1('0x0')]},'parent':{'type':Sequelize[_0x4ee1('0x0')]},'table':{'type':Sequelize[_0x4ee1('0x0')]},'conditions':{'type':Sequelize[_0x4ee1('0x1')]},'joins':{'type':Sequelize[_0x4ee1('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index e92af40..405df8d 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 _0x2723=['toString','sequelize','QueryTypes','MetricId','web','fullPath','randomstring','output','csv','custom','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','MAX(%s)','IS\x20NOT\x20EMPTY','select','clone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','CustomReports','UserProfileResource','destroy','error','name','send','index','map','AnalyticCustomReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','filter','merge','VIRTUAL','options','include','rows','catch','show','params','keys','includeAll','create','body','user','get','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','from','metric','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','type','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','Limited\x20Query:'];(function(_0x5e9a69,_0x40c0ec){var _0x5979c8=function(_0x293da2){while(--_0x293da2){_0x5e9a69['push'](_0x5e9a69['shift']());}};_0x5979c8(++_0x40c0ec);}(_0x2723,0xbc));var _0x3272=function(_0x19d637,_0x745d88){_0x19d637=_0x19d637-0x0;var _0x7dd229=_0x2723[_0x19d637];return _0x7dd229;};'use strict';var emlformat=require(_0x3272('0x0'));var rimraf=require(_0x3272('0x1'));var zipdir=require(_0x3272('0x2'));var jsonpatch=require(_0x3272('0x3'));var rp=require(_0x3272('0x4'));var moment=require(_0x3272('0x5'));var BPromise=require(_0x3272('0x6'));var Mustache=require(_0x3272('0x7'));var util=require(_0x3272('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x3272('0x9'));var ejs=require(_0x3272('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3272('0xb'));var squel=require(_0x3272('0xc'));var crypto=require(_0x3272('0xd'));var jsforce=require(_0x3272('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3272('0x9'));var querystring=require(_0x3272('0xf'));var Papa=require(_0x3272('0x10'));var Redis=require(_0x3272('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3272('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3272('0x13'));var logger=require('../../config/logger')(_0x3272('0x14'));var utils=require(_0x3272('0x15'));var config=require(_0x3272('0x16'));var licenseUtil=require(_0x3272('0x17'));var db=require(_0x3272('0x18'))['db'];var dbH=require('../../mysqldb')[_0x3272('0x19')];function respondWithStatusCode(_0x3025dc,_0x3fcb67){_0x3fcb67=_0x3fcb67||0xcc;return function(_0x388db4){if(_0x388db4){return _0x3025dc[_0x3272('0x1a')](_0x3fcb67);}return _0x3025dc[_0x3272('0x1b')](_0x3fcb67)[_0x3272('0x1c')]();};}function respondWithResult(_0x1d6205,_0x2a0fd3){_0x2a0fd3=_0x2a0fd3||0xc8;return function(_0x2ede1b){if(_0x2ede1b){return _0x1d6205['status'](_0x2a0fd3)[_0x3272('0x1d')](_0x2ede1b);}};}function respondWithFilteredResult(_0x420d53,_0x6666d9){return function(_0x403a2f){if(_0x403a2f){var _0x345f37=typeof _0x6666d9[_0x3272('0x1e')]==='undefined'&&typeof _0x6666d9[_0x3272('0x1f')]===_0x3272('0x20');var _0x451b70=_0x403a2f[_0x3272('0x21')];var _0x42abef=_0x345f37?0x0:_0x6666d9['offset'];var _0x5dcade=_0x345f37?_0x403a2f[_0x3272('0x21')]:_0x6666d9[_0x3272('0x1e')]+_0x6666d9['limit'];var _0xd97ba0;if(_0x5dcade>=_0x451b70){_0x5dcade=_0x451b70;_0xd97ba0=0xc8;}else{_0xd97ba0=0xce;}_0x420d53['status'](_0xd97ba0);return _0x420d53[_0x3272('0x22')](_0x3272('0x23'),_0x42abef+'-'+_0x5dcade+'/'+_0x451b70)[_0x3272('0x1d')](_0x403a2f);}return null;};}function patchUpdates(_0x2b570d){return function(_0x3295c1){try{jsonpatch['apply'](_0x3295c1,_0x2b570d,!![]);}catch(_0x3d4133){return BPromise[_0x3272('0x24')](_0x3d4133);}return _0x3295c1[_0x3272('0x25')]();};}function saveUpdates(_0x5e5cc2,_0x13c4de){return function(_0x10ffd1){if(_0x10ffd1){return _0x10ffd1[_0x3272('0x26')](_0x5e5cc2)[_0x3272('0x27')](function(_0x19c892){return _0x19c892;});}return null;};}function removeEntity(_0x25a6ba,_0x5cb322){return function(_0x3e38f9){if(_0x3e38f9){return _0x3e38f9['destroy']()[_0x3272('0x27')](function(){var _0x3254e5=_0x3e38f9['get']({'plain':!![]});var _0x3e76a6=_0x3272('0x28');return db[_0x3272('0x29')][_0x3272('0x2a')]({'where':{'type':_0x3e76a6,'resourceId':_0x3254e5['id']}})[_0x3272('0x27')](function(){return _0x3e38f9;});})['then'](function(){_0x25a6ba[_0x3272('0x1b')](0xcc)[_0x3272('0x1c')]();});}};}function handleEntityNotFound(_0x31d49d,_0x382161){return function(_0x516fc0){if(!_0x516fc0){_0x31d49d[_0x3272('0x1a')](0x194);}return _0x516fc0;};}function handleError(_0x3fc9f2,_0x34e5f2){_0x34e5f2=_0x34e5f2||0x1f4;return function(_0x1062b3){logger[_0x3272('0x2b')](_0x1062b3['stack']);if(_0x1062b3[_0x3272('0x2c')]){delete _0x1062b3[_0x3272('0x2c')];}_0x3fc9f2[_0x3272('0x1b')](_0x34e5f2)[_0x3272('0x2d')](_0x1062b3);};}exports[_0x3272('0x2e')]=function(_0x428fef,_0x37ecd9){var _0x31c3f7={},_0x102479={},_0x25e71c={'count':0x0,'rows':[]};var _0x1ce82a=_[_0x3272('0x2f')](db[_0x3272('0x30')][_0x3272('0x31')],function(_0x53251a){return{'name':_0x53251a['fieldName'],'type':_0x53251a['type'][_0x3272('0x32')]};});_0x102479[_0x3272('0x33')]=_['map'](_0x1ce82a,'name');_0x102479[_0x3272('0x34')]=_['keys'](_0x428fef[_0x3272('0x34')]);_0x102479[_0x3272('0x35')]=_[_0x3272('0x36')](_0x102479[_0x3272('0x33')],_0x102479[_0x3272('0x34')]);_0x31c3f7[_0x3272('0x37')]=_[_0x3272('0x36')](_0x102479[_0x3272('0x33')],qs[_0x3272('0x38')](_0x428fef[_0x3272('0x34')][_0x3272('0x38')]));_0x31c3f7[_0x3272('0x37')]=_0x31c3f7[_0x3272('0x37')][_0x3272('0x39')]?_0x31c3f7[_0x3272('0x37')]:_0x102479[_0x3272('0x33')];if(!_0x428fef[_0x3272('0x34')][_0x3272('0x3a')]('nolimit')){_0x31c3f7[_0x3272('0x1f')]=qs[_0x3272('0x1f')](_0x428fef[_0x3272('0x34')][_0x3272('0x1f')]);_0x31c3f7[_0x3272('0x1e')]=qs['offset'](_0x428fef[_0x3272('0x34')][_0x3272('0x1e')]);}_0x31c3f7[_0x3272('0x3b')]=qs['sort'](_0x428fef[_0x3272('0x34')]['sort']);_0x31c3f7[_0x3272('0x3c')]=qs[_0x3272('0x35')](_['pick'](_0x428fef[_0x3272('0x34')],_0x102479[_0x3272('0x35')]),_0x1ce82a);if(_0x428fef['query'][_0x3272('0x3d')]){_0x31c3f7[_0x3272('0x3c')]=_[_0x3272('0x3e')](_0x31c3f7['where'],{'$or':_[_0x3272('0x2f')](_0x1ce82a,function(_0x106004){if(_0x106004['type']!==_0x3272('0x3f')){var _0x5a20ab={};_0x5a20ab[_0x106004[_0x3272('0x2c')]]={'$like':'%'+_0x428fef[_0x3272('0x34')][_0x3272('0x3d')]+'%'};return _0x5a20ab;}})});}_0x31c3f7=_['merge']({},_0x31c3f7,_0x428fef[_0x3272('0x40')]);var _0x8f7b0c={'where':_0x31c3f7[_0x3272('0x3c')]};return db[_0x3272('0x30')][_0x3272('0x21')](_0x8f7b0c)[_0x3272('0x27')](function(_0xabc104){_0x25e71c[_0x3272('0x21')]=_0xabc104;if(_0x428fef[_0x3272('0x34')]['includeAll']){_0x31c3f7[_0x3272('0x41')]=[{'all':!![]}];}return db[_0x3272('0x30')]['findAll'](_0x31c3f7);})[_0x3272('0x27')](function(_0x4e34a3){_0x25e71c[_0x3272('0x42')]=_0x4e34a3;return _0x25e71c;})[_0x3272('0x27')](respondWithFilteredResult(_0x37ecd9,_0x31c3f7))[_0x3272('0x43')](handleError(_0x37ecd9,null));};exports[_0x3272('0x44')]=function(_0x351e3f,_0xd479e0){var _0x542448={'raw':![],'where':{'id':_0x351e3f[_0x3272('0x45')]['id']}},_0x105da1={};_0x105da1['model']=_['keys'](db[_0x3272('0x30')][_0x3272('0x31')]);_0x105da1[_0x3272('0x34')]=_[_0x3272('0x46')](_0x351e3f[_0x3272('0x34')]);_0x105da1[_0x3272('0x35')]=_['intersection'](_0x105da1[_0x3272('0x33')],_0x105da1[_0x3272('0x34')]);_0x542448[_0x3272('0x37')]=_[_0x3272('0x36')](_0x105da1[_0x3272('0x33')],qs[_0x3272('0x38')](_0x351e3f[_0x3272('0x34')][_0x3272('0x38')]));_0x542448[_0x3272('0x37')]=_0x542448[_0x3272('0x37')][_0x3272('0x39')]?_0x542448[_0x3272('0x37')]:_0x105da1[_0x3272('0x33')];if(_0x351e3f[_0x3272('0x34')][_0x3272('0x47')]){_0x542448[_0x3272('0x41')]=[{'all':!![]}];}_0x542448=_['merge']({},_0x542448,_0x351e3f[_0x3272('0x40')]);return db[_0x3272('0x30')]['find'](_0x542448)[_0x3272('0x27')](handleEntityNotFound(_0xd479e0,null))[_0x3272('0x27')](respondWithResult(_0xd479e0,null))[_0x3272('0x43')](handleError(_0xd479e0,null));};exports[_0x3272('0x48')]=function(_0xbe66d7,_0xa43188){return db[_0x3272('0x30')][_0x3272('0x48')](_0xbe66d7[_0x3272('0x49')],{})['then'](function(_0x12c063){var _0x5e3488=_0xbe66d7[_0x3272('0x4a')][_0x3272('0x4b')]({'plain':!![]});if(!_0x5e3488)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e3488['role']===_0x3272('0x4a')){var _0xb11c44=_0x12c063[_0x3272('0x4b')]({'plain':!![]});var _0x34036b=_0x3272('0x4c');return db[_0x3272('0x4d')]['find']({'where':{'name':_0x34036b,'userProfileId':_0x5e3488[_0x3272('0x4e')]},'raw':!![]})['then'](function(_0x5b7097){if(_0x5b7097&&_0x5b7097[_0x3272('0x4f')]===0x0){return db[_0x3272('0x29')][_0x3272('0x48')]({'name':_0xb11c44[_0x3272('0x2c')],'resourceId':_0xb11c44['id'],'type':_0x3272('0x28'),'sectionId':_0x5b7097['id']},{})[_0x3272('0x27')](function(){return _0x12c063;});}else{return _0x12c063;}})[_0x3272('0x43')](function(_0x22997d){logger[_0x3272('0x2b')](_0x3272('0x50'),_0x22997d);throw _0x22997d;});}return _0x12c063;})['then'](respondWithResult(_0xa43188,0xc9))[_0x3272('0x43')](handleError(_0xa43188,null));};exports[_0x3272('0x26')]=function(_0x176a86,_0x1b57b8){if(_0x176a86[_0x3272('0x49')]['id']){delete _0x176a86['body']['id'];}return db[_0x3272('0x30')]['find']({'where':{'id':_0x176a86[_0x3272('0x45')]['id']}})[_0x3272('0x27')](handleEntityNotFound(_0x1b57b8,null))[_0x3272('0x27')](saveUpdates(_0x176a86[_0x3272('0x49')],null))[_0x3272('0x27')](respondWithResult(_0x1b57b8,null))['catch'](handleError(_0x1b57b8,null));};exports[_0x3272('0x2a')]=function(_0x22e835,_0x9bf8a9){return db[_0x3272('0x30')][_0x3272('0x51')]({'where':{'id':_0x22e835['params']['id']}})['then'](handleEntityNotFound(_0x9bf8a9,null))['then'](removeEntity(_0x9bf8a9,null))[_0x3272('0x43')](handleError(_0x9bf8a9,null));};exports[_0x3272('0x52')]=function(_0x30b01c,_0x285afb){var _0x2373b9=0xa;var _0x3f540b=[_0x3272('0x53'),_0x3272('0x54'),_0x3272('0x55'),'cross_join'];var _0x57bb98={'SUM':_0x3272('0x56'),'COUNT':_0x3272('0x57'),'COUNT DISTINCT':_0x3272('0x58'),'MAX':'MAX(%s)','MIN':_0x3272('0x59'),'AVG':_0x3272('0x5a'),'GROUP_CONCAT':_0x3272('0x5b'),'GROUP_CONCAT ASC':_0x3272('0x5c'),'GROUP_CONCAT DESC':_0x3272('0x5d')};var _0x9e099b={'SEC_TO_TIME':_0x3272('0x5e'),'DATE':_0x3272('0x5f'),'HOUR':_0x3272('0x60'),'ROUND':_0x3272('0x61'),'UNIX_TIMESTAMP':_0x3272('0x62')};var _0x53f147=function(_0x30ba97){return!_['includes']([_0x3272('0x63'),_0x3272('0x64'),_0x3272('0x65'),'IS\x20NOT\x20EMPTY'],_0x30ba97);};var _0x30d807=function(_0x2b9a1d){if(!_0x2b9a1d||!_0x2b9a1d[_0x3272('0x66')][_0x3272('0x39')]){return'';}for(var _0x48f7fd='(',_0x174e3b=0x0;_0x174e3b<_0x2b9a1d['rules']['length'];_0x174e3b+=0x1){_0x174e3b>0x0&&(_0x48f7fd+='\x20'+_0x2b9a1d[_0x3272('0x67')]+'\x20');_0x48f7fd+=_0x2b9a1d[_0x3272('0x66')][_0x174e3b][_0x3272('0x68')]?_0x30d807(_0x2b9a1d[_0x3272('0x66')][_0x174e3b]['group']):_0x2b9a1d[_0x3272('0x66')][_0x174e3b]['field']+'\x20'+_0x2b9a1d[_0x3272('0x66')][_0x174e3b][_0x3272('0x69')]+(_0x53f147(_0x2b9a1d[_0x3272('0x66')][_0x174e3b]['condition'])?'\x20'+_0x2b9a1d[_0x3272('0x66')][_0x174e3b][_0x3272('0x6a')]:'');}return _0x48f7fd+')';};var _0x2f37d5={'where':{'id':_0x30b01c['params']['id']}},_0x2a5259,_0x43b208,_0x38a34c,_0x2e8cd1,_0x35cef2;_0x2f37d5=_[_0x3272('0x3e')]({},_0x2f37d5,_0x30b01c['options']);return db['AnalyticCustomReport'][_0x3272('0x51')](_0x2f37d5)[_0x3272('0x27')](function(_0x412473){if(_0x412473){_0x2a5259=_0x412473;return _0x412473[_0x3272('0x6b')]();}return null;})[_0x3272('0x27')](function(_0x5ad12e){if(_0x5ad12e){if(!_0x5ad12e[_0x3272('0x39')]){throw new db[(_0x3272('0x6c'))][(_0x3272('0x6d'))](_0x3272('0x6e'),0x193);}_0x43b208=_0x5ad12e;return db[_0x3272('0x6f')][_0x3272('0x70')]({'raw':!![]});}return null;})[_0x3272('0x27')](function(_0x2de7d3){if(_0x2de7d3){_0x38a34c=_[_0x3272('0x71')](_0x2de7d3,'id');var _0x88ca1f;var _0x20a362=squel['select']();_0x20a362[_0x3272('0x72')](_0x2a5259['table']);for(var _0x83f5dc=0x0;_0x83f5dc<_0x43b208[_0x3272('0x39')];_0x83f5dc+=0x1){_0x88ca1f=_0x43b208[_0x83f5dc]['MetricId']?_0x38a34c[_0x43b208[_0x83f5dc]['MetricId']][_0x3272('0x73')]:_0x43b208[_0x83f5dc][_0x3272('0x74')];_0x88ca1f=_0x43b208[_0x83f5dc][_0x3272('0x75')]?_[_0x3272('0x76')](_0x57bb98[_0x43b208[_0x83f5dc]['function']],'%s',_0x88ca1f):_0x88ca1f;_0x88ca1f=_0x43b208[_0x83f5dc][_0x3272('0x77')]?_['replace'](_0x9e099b[_0x43b208[_0x83f5dc]['format']],'%s',_0x88ca1f):_0x88ca1f;if(_0x43b208[_0x83f5dc][_0x3272('0x78')]){_0x20a362[_0x3272('0x68')](_0x88ca1f);}_0x43b208[_0x83f5dc][_0x3272('0x79')]&&_0x20a362[_0x3272('0x3b')](_0x88ca1f,_0x43b208[_0x83f5dc][_0x3272('0x79')]===_0x3272('0x7a')?![]:!![]);_0x20a362[_0x3272('0x74')](_0x88ca1f,_0x43b208[_0x83f5dc][_0x3272('0x7b')]||_0x88ca1f);}if(_0x2a5259[_0x3272('0x7c')]){_0x2a5259[_0x3272('0x7c')]=JSON[_0x3272('0x7d')](_0x2a5259[_0x3272('0x7c')]);for(var _0x49ae2d=0x0;_0x49ae2d<_0x2a5259[_0x3272('0x7c')][_0x3272('0x39')];_0x49ae2d+=0x1){if(_0x2a5259[_0x3272('0x7c')][_0x49ae2d][_0x3272('0x7e')]&&_[_0x3272('0x7f')](_0x3f540b,_0x2a5259[_0x3272('0x7c')][_0x49ae2d][_0x3272('0x7e')])&&_0x2a5259['joins'][_0x49ae2d][_0x3272('0x80')]&&_0x2a5259[_0x3272('0x7c')][_0x49ae2d][_0x3272('0x81')]&&_0x2a5259[_0x3272('0x7c')][_0x49ae2d][_0x3272('0x82')]){_0x20a362[_0x2a5259[_0x3272('0x7c')][_0x49ae2d][_0x3272('0x7e')]](_0x2a5259[_0x3272('0x7c')][_0x49ae2d][_0x3272('0x81')],null,util[_0x3272('0x77')](_0x3272('0x83'),_0x2a5259[_0x3272('0x84')],_0x2a5259[_0x3272('0x7c')][_0x49ae2d][_0x3272('0x80')],_0x2a5259['joins'][_0x49ae2d][_0x3272('0x81')],_0x2a5259[_0x3272('0x7c')][_0x49ae2d][_0x3272('0x82')]));}}}if(_0x2a5259[_0x3272('0x85')]){_0x2a5259[_0x3272('0x85')]=JSON[_0x3272('0x7d')](_0x2a5259['conditions']);_0x20a362[_0x3272('0x3c')](_0x30d807(_0x2a5259[_0x3272('0x85')]['group']));}_0x35cef2=_0x20a362['clone']();_0x20a362[_0x3272('0x1f')](_0x2373b9);_0x20a362['offset'](0x0);logger[_0x3272('0x86')](_0x3272('0x87'),_0x20a362[_0x3272('0x88')]());return dbH['sequelize']['query'](_0x20a362[_0x3272('0x88')](),{'type':dbH[_0x3272('0x89')][_0x3272('0x8a')]['SELECT']});}})[_0x3272('0x27')](respondWithResult(_0x285afb,null))[_0x3272('0x43')](handleError(_0x285afb,null));};function runReport(_0x5ccd11,_0x1cdc00,_0x50fe43){var _0x55b5dd=_0x1cdc00[_0x3272('0x2c')];var _0x413abd=0xa;var _0x4574f8=['join',_0x3272('0x54'),_0x3272('0x55'),'cross_join'];var _0x136dee={'SUM':_0x3272('0x56'),'COUNT':_0x3272('0x57'),'COUNT DISTINCT':_0x3272('0x58'),'MAX':'MAX(%s)','MIN':_0x3272('0x59'),'AVG':_0x3272('0x5a'),'GROUP_CONCAT':_0x3272('0x5b'),'GROUP_CONCAT ASC':_0x3272('0x5c'),'GROUP_CONCAT DESC':_0x3272('0x5d')};var _0x397b6c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x3272('0x5f'),'HOUR':_0x3272('0x60'),'ROUND':_0x3272('0x61'),'UNIX_TIMESTAMP':_0x3272('0x62')};var _0x45f0d0=function(_0x513d13){return!_[_0x3272('0x7f')](['IS\x20NULL',_0x3272('0x64'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x513d13);};var _0x9d9534=function(_0x8fca49){if(!_0x8fca49||!_0x8fca49[_0x3272('0x66')][_0x3272('0x39')]){return'';}for(var _0x8b6b19='(',_0x1ff914=0x0;_0x1ff914<_0x8fca49[_0x3272('0x66')]['length'];_0x1ff914+=0x1){_0x1ff914>0x0&&(_0x8b6b19+='\x20'+_0x8fca49['operator']+'\x20');_0x8b6b19+=_0x8fca49[_0x3272('0x66')][_0x1ff914][_0x3272('0x68')]?_0x9d9534(_0x8fca49[_0x3272('0x66')][_0x1ff914][_0x3272('0x68')]):_0x8fca49[_0x3272('0x66')][_0x1ff914][_0x3272('0x74')]+'\x20'+_0x8fca49[_0x3272('0x66')][_0x1ff914]['condition']+(_0x45f0d0(_0x8fca49[_0x3272('0x66')][_0x1ff914][_0x3272('0x69')])?'\x20'+_0x8fca49['rules'][_0x1ff914]['value']:'');}return _0x8b6b19+')';};var _0x59e029={'where':{'id':_0x5ccd11['id']}},_0xa2a6ae,_0x484899,_0x1aea71,_0x37bc93,_0x3ff4b3;_0x59e029=_[_0x3272('0x3e')]({},_0x59e029,_0x50fe43);return db[_0x3272('0x30')][_0x3272('0x51')](_0x59e029)['then'](function(_0x28db6e){if(_0x28db6e){_0xa2a6ae=_0x28db6e;return _0x28db6e[_0x3272('0x6b')]();}return null;})['then'](function(_0x169274){if(_0x169274){if(!_0x169274[_0x3272('0x39')]){throw new db[(_0x3272('0x6c'))]['ValidationErrorItem'](_0x3272('0x6e'),0x193);}_0x484899=_0x169274;return db['AnalyticMetric'][_0x3272('0x70')]({'raw':!![]});}return null;})[_0x3272('0x27')](function(_0x235bc3){if(_0x235bc3){_0x1aea71=_[_0x3272('0x71')](_0x235bc3,'id');var _0x532547;var _0x44dce9=squel['select']();_0x44dce9['from'](_0xa2a6ae[_0x3272('0x84')]);for(var _0x5bbabb=0x0;_0x5bbabb<_0x484899[_0x3272('0x39')];_0x5bbabb+=0x1){_0x532547=_0x484899[_0x5bbabb][_0x3272('0x8b')]?_0x1aea71[_0x484899[_0x5bbabb][_0x3272('0x8b')]]['metric']:_0x484899[_0x5bbabb]['field'];_0x532547=_0x484899[_0x5bbabb][_0x3272('0x75')]?_[_0x3272('0x76')](_0x136dee[_0x484899[_0x5bbabb][_0x3272('0x75')]],'%s',_0x532547):_0x532547;_0x532547=_0x484899[_0x5bbabb][_0x3272('0x77')]?_['replace'](_0x397b6c[_0x484899[_0x5bbabb]['format']],'%s',_0x532547):_0x532547;if(_0x484899[_0x5bbabb][_0x3272('0x78')]){_0x44dce9['group'](_0x532547);}_0x484899[_0x5bbabb][_0x3272('0x79')]&&_0x44dce9[_0x3272('0x3b')](_0x532547,_0x484899[_0x5bbabb][_0x3272('0x79')]===_0x3272('0x7a')?![]:!![]);_0x44dce9[_0x3272('0x74')](_0x532547,_0x484899[_0x5bbabb][_0x3272('0x7b')]||_0x532547);}if(_0xa2a6ae[_0x3272('0x7c')]){_0xa2a6ae[_0x3272('0x7c')]=JSON[_0x3272('0x7d')](_0xa2a6ae[_0x3272('0x7c')]);for(var _0x1d7f4b=0x0;_0x1d7f4b<_0xa2a6ae['joins'][_0x3272('0x39')];_0x1d7f4b+=0x1){if(_0xa2a6ae[_0x3272('0x7c')][_0x1d7f4b]['type']&&_[_0x3272('0x7f')](_0x4574f8,_0xa2a6ae[_0x3272('0x7c')][_0x1d7f4b][_0x3272('0x7e')])&&_0xa2a6ae[_0x3272('0x7c')][_0x1d7f4b][_0x3272('0x80')]&&_0xa2a6ae[_0x3272('0x7c')][_0x1d7f4b][_0x3272('0x81')]&&_0xa2a6ae[_0x3272('0x7c')][_0x1d7f4b]['foreignKey']){_0x44dce9[_0xa2a6ae[_0x3272('0x7c')][_0x1d7f4b][_0x3272('0x7e')]](_0xa2a6ae[_0x3272('0x7c')][_0x1d7f4b]['foreignTable'],null,util[_0x3272('0x77')](_0x3272('0x83'),_0xa2a6ae[_0x3272('0x84')],_0xa2a6ae[_0x3272('0x7c')][_0x1d7f4b][_0x3272('0x80')],_0xa2a6ae['joins'][_0x1d7f4b][_0x3272('0x81')],_0xa2a6ae[_0x3272('0x7c')][_0x1d7f4b][_0x3272('0x82')]));}}}if(_0xa2a6ae[_0x3272('0x85')]){_0xa2a6ae[_0x3272('0x85')]=JSON['parse'](_0xa2a6ae[_0x3272('0x85')]);_0x44dce9[_0x3272('0x3c')](_0x9d9534(_0xa2a6ae['conditions']['group']));}_0x3ff4b3=_0x44dce9['clone']();_0x44dce9[_0x3272('0x1f')](_0x413abd);_0x44dce9[_0x3272('0x1e')](0x0);return;}})[_0x3272('0x27')](function(){if(_0x1cdc00['output']===_0x3272('0x8c')){return null;}var _0x55a4e8=_['merge'](_0x1cdc00,{'name':_0x1cdc00[_0x3272('0x8d')]||_0x1cdc00[_0x3272('0x2c')]||_0xa2a6ae['name'],'basename':_0x55b5dd,'savename':util[_0x3272('0x77')]('%s-%s.%s',_0x1cdc00['name']||_0xa2a6ae[_0x3272('0x2c')],require(_0x3272('0x8e'))['generate'](0x4),_0x1cdc00[_0x3272('0x8f')]||_0x3272('0x90')),'reportId':_0xa2a6ae['id'],'reportType':_0x3272('0x91')});return db[_0x3272('0x92')]['create'](_0x55a4e8,{'raw':!![]});})[_0x3272('0x27')](function(_0x1953b3){if(_0xa2a6ae[_0x3272('0x84')]==='cdr'){_0x3ff4b3[_0x3272('0x3c')](_0xa2a6ae[_0x3272('0x84')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1cdc00[_0x3272('0x93')],_0x1cdc00[_0x3272('0x94')]);}else{_0x3ff4b3['where'](_0xa2a6ae[_0x3272('0x84')]+_0x3272('0x95'),_0x1cdc00[_0x3272('0x93')],_0x1cdc00['endDate']);}if(_0x1953b3){logger['info'](_0x3272('0x96'),_0x3ff4b3[_0x3272('0x88')]());require('child_process')[_0x3272('0x97')](path[_0x3272('0x53')](__dirname,'../../components/export/',_0x1953b3[_0x3272('0x8f')]),[_0x1953b3['id'],_0x3ff4b3['toString'](),path[_0x3272('0x53')](__dirname,_0x3272('0x98'),_0x1953b3[_0x3272('0x99')]),_0x55b5dd]);return _0x1953b3;}else{var _0x1b10a9=squel['select']();_0x1b10a9[_0x3272('0x72')]('('+_0x3ff4b3[_0x3272('0x88')]()+')',_0x3272('0x9a'));_0x1b10a9[_0x3272('0x74')](_0x3272('0x9b'),'count');_0x3ff4b3[_0x3272('0x1f')](_0x1cdc00['limit']||_0x413abd);_0x3ff4b3[_0x3272('0x1e')](_0x1cdc00[_0x3272('0x1e')]||0x0);return dbH[_0x3272('0x89')][_0x3272('0x34')](_0x1b10a9[_0x3272('0x88')](),{'type':dbH['sequelize'][_0x3272('0x8a')][_0x3272('0x9c')]})[_0x3272('0x27')](function(_0x6151c8){if(!_0x6151c8[_0x3272('0x39')]){_0x37bc93=0x0;}else{_0x37bc93=_0x6151c8[0x0]['count']||0x0;}return dbH[_0x3272('0x89')][_0x3272('0x34')](_0x3ff4b3[_0x3272('0x88')](),{'type':dbH[_0x3272('0x89')][_0x3272('0x8a')]['SELECT']});})[_0x3272('0x27')](function(_0x3ab35e){return{'rows':_0x3ab35e||[],'count':_0x37bc93};});}});}exports[_0x3272('0x9d')]=function(_0x3a6fed,_0x55cdf7){return runReport(_0x3a6fed[_0x3272('0x45')],_0x3a6fed['query'],_0x3a6fed['options'])[_0x3272('0x27')](respondWithResult(_0x55cdf7,null))[_0x3272('0x43')](handleError(_0x55cdf7,null));};exports['runReport']=runReport;exports[_0x3272('0x34')]=function(_0x3c325c,_0x30d52){var _0x46dede=0xa;var _0xb12a2e=[_0x3272('0x53'),_0x3272('0x54'),_0x3272('0x55'),'cross_join'];var _0x4deccd={'SUM':_0x3272('0x56'),'COUNT':_0x3272('0x57'),'COUNT DISTINCT':_0x3272('0x58'),'MAX':_0x3272('0x9e'),'MIN':_0x3272('0x59'),'AVG':_0x3272('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x3272('0x5c'),'GROUP_CONCAT DESC':_0x3272('0x5d')};var _0xf81fa6={'SEC_TO_TIME':_0x3272('0x5e'),'DATE':_0x3272('0x5f'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x3272('0x62')};var _0x1e1ed3=function(_0x321f79){return!_[_0x3272('0x7f')]([_0x3272('0x63'),_0x3272('0x64'),'IS\x20EMPTY',_0x3272('0x9f')],_0x321f79);};var _0x512fad=function(_0x29f781){if(!_0x29f781||!_0x29f781[_0x3272('0x66')][_0x3272('0x39')]){return'';}for(var _0x3464d6='(',_0x155927=0x0;_0x155927<_0x29f781[_0x3272('0x66')][_0x3272('0x39')];_0x155927+=0x1){_0x155927>0x0&&(_0x3464d6+='\x20'+_0x29f781['operator']+'\x20');_0x3464d6+=_0x29f781['rules'][_0x155927][_0x3272('0x68')]?_0x512fad(_0x29f781[_0x3272('0x66')][_0x155927][_0x3272('0x68')]):_0x29f781[_0x3272('0x66')][_0x155927][_0x3272('0x74')]+'\x20'+_0x29f781[_0x3272('0x66')][_0x155927]['condition']+(_0x1e1ed3(_0x29f781['rules'][_0x155927]['condition'])?'\x20'+_0x29f781['rules'][_0x155927][_0x3272('0x6a')]:'');}return _0x3464d6+')';};var _0x486592={'where':{'id':_0x3c325c['params']['id']}},_0x561903,_0x57d269,_0x3de91b,_0x51c152,_0x3ba4ba;_0x486592=_[_0x3272('0x3e')]({},_0x486592,_0x3c325c[_0x3272('0x40')]);return db[_0x3272('0x30')]['find'](_0x486592)[_0x3272('0x27')](function(_0x512c5a){if(_0x512c5a){_0x561903=_0x512c5a;return _0x512c5a['getFields']();}return null;})[_0x3272('0x27')](function(_0x11cb8b){if(_0x11cb8b){if(!_0x11cb8b[_0x3272('0x39')]){throw new db['Sequelize'][(_0x3272('0x6d'))](_0x3272('0x6e'),0x193);}_0x57d269=_0x11cb8b;return db[_0x3272('0x6f')][_0x3272('0x70')]({'raw':!![]});}return null;})[_0x3272('0x27')](function(_0x128d43){if(_0x128d43){_0x3de91b=_['keyBy'](_0x128d43,'id');var _0x4859c2;var _0x26c6da=squel[_0x3272('0xa0')]();_0x26c6da[_0x3272('0x72')](_0x561903[_0x3272('0x84')]);for(var _0x59cfbd=0x0;_0x59cfbd<_0x57d269[_0x3272('0x39')];_0x59cfbd+=0x1){_0x4859c2=_0x57d269[_0x59cfbd][_0x3272('0x8b')]?_0x3de91b[_0x57d269[_0x59cfbd][_0x3272('0x8b')]][_0x3272('0x73')]:_0x57d269[_0x59cfbd]['field'];_0x4859c2=_0x57d269[_0x59cfbd][_0x3272('0x75')]?_[_0x3272('0x76')](_0x4deccd[_0x57d269[_0x59cfbd]['function']],'%s',_0x4859c2):_0x4859c2;_0x4859c2=_0x57d269[_0x59cfbd]['format']?_[_0x3272('0x76')](_0xf81fa6[_0x57d269[_0x59cfbd][_0x3272('0x77')]],'%s',_0x4859c2):_0x4859c2;if(_0x57d269[_0x59cfbd][_0x3272('0x78')]){_0x26c6da['group'](_0x4859c2);}_0x57d269[_0x59cfbd]['orderBy']&&_0x26c6da[_0x3272('0x3b')](_0x4859c2,_0x57d269[_0x59cfbd][_0x3272('0x79')]===_0x3272('0x7a')?![]:!![]);_0x26c6da[_0x3272('0x74')](_0x4859c2,_0x57d269[_0x59cfbd][_0x3272('0x7b')]||_0x4859c2);}if(_0x561903[_0x3272('0x7c')]){_0x561903['joins']=JSON[_0x3272('0x7d')](_0x561903[_0x3272('0x7c')]);for(var _0x214988=0x0;_0x214988<_0x561903[_0x3272('0x7c')][_0x3272('0x39')];_0x214988+=0x1){if(_0x561903['joins'][_0x214988][_0x3272('0x7e')]&&_[_0x3272('0x7f')](_0xb12a2e,_0x561903[_0x3272('0x7c')][_0x214988][_0x3272('0x7e')])&&_0x561903[_0x3272('0x7c')][_0x214988][_0x3272('0x80')]&&_0x561903[_0x3272('0x7c')][_0x214988][_0x3272('0x81')]&&_0x561903[_0x3272('0x7c')][_0x214988][_0x3272('0x82')]){_0x26c6da[_0x561903[_0x3272('0x7c')][_0x214988][_0x3272('0x7e')]](_0x561903['joins'][_0x214988][_0x3272('0x81')],null,util[_0x3272('0x77')](_0x3272('0x83'),_0x561903[_0x3272('0x84')],_0x561903[_0x3272('0x7c')][_0x214988][_0x3272('0x80')],_0x561903[_0x3272('0x7c')][_0x214988]['foreignTable'],_0x561903['joins'][_0x214988][_0x3272('0x82')]));}}}if(_0x561903['conditions']){_0x561903[_0x3272('0x85')]=JSON['parse'](_0x561903[_0x3272('0x85')]);_0x26c6da['where'](_0x512fad(_0x561903['conditions'][_0x3272('0x68')]));}_0x3ba4ba=_0x26c6da[_0x3272('0xa1')]();_0x26c6da[_0x3272('0x1f')](_0x46dede);_0x26c6da[_0x3272('0x1e')](0x0);logger[_0x3272('0x86')](_0x3272('0x87'),_0x26c6da[_0x3272('0x88')]());return dbH['sequelize']['query'](_0x26c6da[_0x3272('0x88')](),{'type':dbH['sequelize'][_0x3272('0x8a')]['SELECT']});}})[_0x3272('0x27')](function(){return{'sql':_0x3ba4ba['toString']()};})[_0x3272('0x27')](respondWithResult(_0x30d52,null))[_0x3272('0x43')](handleError(_0x30d52,null));}; \ No newline at end of file +var _0x6f08=['SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','group','rules','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','IS\x20NULL','Please\x20insert\x20at\x20least\x20one\x20field','alias','clone','output','web','%s-%s.%s','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../files/reports','savename','select','countTable','run','runReport','SEC_TO_TIME(%s)','ROUND(%s)','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','save','update','then','destroy','get','CustomReports','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','rows','show','params','fields','include','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','autoAssociation','UserProfileResource','error','join','left_join','right_join','cross_join'];(function(_0x112ddb,_0x259b69){var _0x51fff1=function(_0x37f74a){while(--_0x37f74a){_0x112ddb['push'](_0x112ddb['shift']());}};_0x51fff1(++_0x259b69);}(_0x6f08,0x197));var _0x86f0=function(_0x56d727,_0x4d3a8d){_0x56d727=_0x56d727-0x0;var _0x349502=_0x6f08[_0x56d727];return _0x349502;};'use strict';var emlformat=require(_0x86f0('0x0'));var rimraf=require(_0x86f0('0x1'));var zipdir=require(_0x86f0('0x2'));var jsonpatch=require(_0x86f0('0x3'));var rp=require(_0x86f0('0x4'));var moment=require('moment');var BPromise=require(_0x86f0('0x5'));var Mustache=require(_0x86f0('0x6'));var util=require(_0x86f0('0x7'));var path=require(_0x86f0('0x8'));var sox=require(_0x86f0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x86f0('0xa'));var _=require(_0x86f0('0xb'));var squel=require(_0x86f0('0xc'));var crypto=require(_0x86f0('0xd'));var jsforce=require(_0x86f0('0xe'));var deskjs=require(_0x86f0('0xf'));var toCsv=require(_0x86f0('0x10'));var querystring=require(_0x86f0('0x11'));var Papa=require('papaparse');var Redis=require(_0x86f0('0x12'));var authService=require(_0x86f0('0x13'));var qs=require(_0x86f0('0x14'));var as=require(_0x86f0('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x86f0('0x16'))(_0x86f0('0x17'));var utils=require(_0x86f0('0x18'));var config=require(_0x86f0('0x19'));var licenseUtil=require(_0x86f0('0x1a'));var db=require(_0x86f0('0x1b'))['db'];var dbH=require(_0x86f0('0x1b'))[_0x86f0('0x1c')];function respondWithStatusCode(_0x464585,_0x46c8ff){_0x46c8ff=_0x46c8ff||0xcc;return function(_0x1a877d){if(_0x1a877d){return _0x464585[_0x86f0('0x1d')](_0x46c8ff);}return _0x464585[_0x86f0('0x1e')](_0x46c8ff)[_0x86f0('0x1f')]();};}function respondWithResult(_0x558cb3,_0x358f48){_0x358f48=_0x358f48||0xc8;return function(_0x98e512){if(_0x98e512){return _0x558cb3[_0x86f0('0x1e')](_0x358f48)['json'](_0x98e512);}};}function respondWithFilteredResult(_0x4923cb,_0x504c91){return function(_0x23952f){if(_0x23952f){var _0x3158e2=typeof _0x504c91['offset']===_0x86f0('0x20')&&typeof _0x504c91[_0x86f0('0x21')]===_0x86f0('0x20');var _0x213d6d=_0x23952f[_0x86f0('0x22')];var _0x49ad90=_0x3158e2?0x0:_0x504c91[_0x86f0('0x23')];var _0x37f2c2=_0x3158e2?_0x23952f[_0x86f0('0x22')]:_0x504c91[_0x86f0('0x23')]+_0x504c91[_0x86f0('0x21')];var _0x1036ad;if(_0x37f2c2>=_0x213d6d){_0x37f2c2=_0x213d6d;_0x1036ad=0xc8;}else{_0x1036ad=0xce;}_0x4923cb[_0x86f0('0x1e')](_0x1036ad);return _0x4923cb[_0x86f0('0x24')](_0x86f0('0x25'),_0x49ad90+'-'+_0x37f2c2+'/'+_0x213d6d)[_0x86f0('0x26')](_0x23952f);}return null;};}function patchUpdates(_0x122e24){return function(_0x50bba0){try{jsonpatch['apply'](_0x50bba0,_0x122e24,!![]);}catch(_0x5e6f2d){return BPromise['reject'](_0x5e6f2d);}return _0x50bba0[_0x86f0('0x27')]();};}function saveUpdates(_0x12f523,_0xd88e43){return function(_0xea52dd){if(_0xea52dd){return _0xea52dd[_0x86f0('0x28')](_0x12f523)[_0x86f0('0x29')](function(_0x17cc08){return _0x17cc08;});}return null;};}function removeEntity(_0x276e2f,_0x2e578d){return function(_0x17f90d){if(_0x17f90d){return _0x17f90d[_0x86f0('0x2a')]()[_0x86f0('0x29')](function(){var _0x4277c1=_0x17f90d[_0x86f0('0x2b')]({'plain':!![]});var _0x4bb37e=_0x86f0('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x4bb37e,'resourceId':_0x4277c1['id']}})['then'](function(){return _0x17f90d;});})[_0x86f0('0x29')](function(){_0x276e2f['status'](0xcc)[_0x86f0('0x1f')]();});}};}function handleEntityNotFound(_0x1d0479,_0x5520a4){return function(_0x40c8ce){if(!_0x40c8ce){_0x1d0479['sendStatus'](0x194);}return _0x40c8ce;};}function handleError(_0x1bfa64,_0xd26843){_0xd26843=_0xd26843||0x1f4;return function(_0x1943db){logger['error'](_0x1943db[_0x86f0('0x2d')]);if(_0x1943db[_0x86f0('0x2e')]){delete _0x1943db[_0x86f0('0x2e')];}_0x1bfa64[_0x86f0('0x1e')](_0xd26843)[_0x86f0('0x2f')](_0x1943db);};}exports[_0x86f0('0x30')]=function(_0x2dd93e,_0x2a3a0b){var _0x5e0061={},_0x53cd18={},_0x2430ff={'count':0x0,'rows':[]};var _0x2fe1cd=_[_0x86f0('0x31')](db[_0x86f0('0x32')][_0x86f0('0x33')],function(_0x126721){return{'name':_0x126721['fieldName'],'type':_0x126721[_0x86f0('0x34')]['key']};});_0x53cd18['model']=_[_0x86f0('0x31')](_0x2fe1cd,'name');_0x53cd18[_0x86f0('0x35')]=_[_0x86f0('0x36')](_0x2dd93e[_0x86f0('0x35')]);_0x53cd18[_0x86f0('0x37')]=_[_0x86f0('0x38')](_0x53cd18[_0x86f0('0x39')],_0x53cd18['query']);_0x5e0061[_0x86f0('0x3a')]=_[_0x86f0('0x38')](_0x53cd18[_0x86f0('0x39')],qs['fields'](_0x2dd93e[_0x86f0('0x35')]['fields']));_0x5e0061[_0x86f0('0x3a')]=_0x5e0061[_0x86f0('0x3a')][_0x86f0('0x3b')]?_0x5e0061[_0x86f0('0x3a')]:_0x53cd18[_0x86f0('0x39')];if(!_0x2dd93e[_0x86f0('0x35')][_0x86f0('0x3c')](_0x86f0('0x3d'))){_0x5e0061['limit']=qs[_0x86f0('0x21')](_0x2dd93e[_0x86f0('0x35')][_0x86f0('0x21')]);_0x5e0061[_0x86f0('0x23')]=qs[_0x86f0('0x23')](_0x2dd93e['query']['offset']);}_0x5e0061[_0x86f0('0x3e')]=qs[_0x86f0('0x3f')](_0x2dd93e[_0x86f0('0x35')][_0x86f0('0x3f')]);_0x5e0061[_0x86f0('0x40')]=qs[_0x86f0('0x37')](_['pick'](_0x2dd93e[_0x86f0('0x35')],_0x53cd18[_0x86f0('0x37')]),_0x2fe1cd);if(_0x2dd93e[_0x86f0('0x35')][_0x86f0('0x41')]){_0x5e0061[_0x86f0('0x40')]=_[_0x86f0('0x42')](_0x5e0061[_0x86f0('0x40')],{'$or':_['map'](_0x2fe1cd,function(_0xebb780){if(_0xebb780['type']!=='VIRTUAL'){var _0x1fe535={};_0x1fe535[_0xebb780[_0x86f0('0x2e')]]={'$like':'%'+_0x2dd93e[_0x86f0('0x35')][_0x86f0('0x41')]+'%'};return _0x1fe535;}})});}_0x5e0061=_[_0x86f0('0x42')]({},_0x5e0061,_0x2dd93e[_0x86f0('0x43')]);var _0x594ef4={'where':_0x5e0061[_0x86f0('0x40')]};return db[_0x86f0('0x32')]['count'](_0x594ef4)['then'](function(_0x4c57cd){_0x2430ff[_0x86f0('0x22')]=_0x4c57cd;if(_0x2dd93e['query'][_0x86f0('0x44')]){_0x5e0061['include']=[{'all':!![]}];}return db[_0x86f0('0x32')][_0x86f0('0x45')](_0x5e0061);})[_0x86f0('0x29')](function(_0x7a2da7){_0x2430ff[_0x86f0('0x46')]=_0x7a2da7;return _0x2430ff;})[_0x86f0('0x29')](respondWithFilteredResult(_0x2a3a0b,_0x5e0061))['catch'](handleError(_0x2a3a0b,null));};exports[_0x86f0('0x47')]=function(_0x3f1075,_0x3e780a){var _0x131513={'raw':![],'where':{'id':_0x3f1075[_0x86f0('0x48')]['id']}},_0x19e0d9={};_0x19e0d9[_0x86f0('0x39')]=_[_0x86f0('0x36')](db['AnalyticCustomReport']['rawAttributes']);_0x19e0d9[_0x86f0('0x35')]=_['keys'](_0x3f1075[_0x86f0('0x35')]);_0x19e0d9['filters']=_[_0x86f0('0x38')](_0x19e0d9[_0x86f0('0x39')],_0x19e0d9[_0x86f0('0x35')]);_0x131513[_0x86f0('0x3a')]=_[_0x86f0('0x38')](_0x19e0d9['model'],qs['fields'](_0x3f1075[_0x86f0('0x35')][_0x86f0('0x49')]));_0x131513[_0x86f0('0x3a')]=_0x131513[_0x86f0('0x3a')]['length']?_0x131513[_0x86f0('0x3a')]:_0x19e0d9[_0x86f0('0x39')];if(_0x3f1075[_0x86f0('0x35')][_0x86f0('0x44')]){_0x131513[_0x86f0('0x4a')]=[{'all':!![]}];}_0x131513=_[_0x86f0('0x42')]({},_0x131513,_0x3f1075['options']);return db[_0x86f0('0x32')][_0x86f0('0x4b')](_0x131513)[_0x86f0('0x29')](handleEntityNotFound(_0x3e780a,null))['then'](respondWithResult(_0x3e780a,null))[_0x86f0('0x4c')](handleError(_0x3e780a,null));};exports['create']=function(_0x4f527c,_0x36ba7b){return db[_0x86f0('0x32')][_0x86f0('0x4d')](_0x4f527c[_0x86f0('0x4e')],{})[_0x86f0('0x29')](function(_0x107274){var _0x51f48d=_0x4f527c['user'][_0x86f0('0x2b')]({'plain':!![]});if(!_0x51f48d)throw new Error(_0x86f0('0x4f'));if(_0x51f48d[_0x86f0('0x50')]===_0x86f0('0x51')){var _0x3e0637=_0x107274['get']({'plain':!![]});var _0x69542b=_0x86f0('0x52');return db[_0x86f0('0x53')][_0x86f0('0x4b')]({'where':{'name':_0x69542b,'userProfileId':_0x51f48d['userProfileId']},'raw':!![]})['then'](function(_0x47ee4){if(_0x47ee4&&_0x47ee4[_0x86f0('0x54')]===0x0){return db[_0x86f0('0x55')][_0x86f0('0x4d')]({'name':_0x3e0637[_0x86f0('0x2e')],'resourceId':_0x3e0637['id'],'type':_0x86f0('0x2c'),'sectionId':_0x47ee4['id']},{})[_0x86f0('0x29')](function(){return _0x107274;});}else{return _0x107274;}})[_0x86f0('0x4c')](function(_0x3fae23){logger[_0x86f0('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3fae23);throw _0x3fae23;});}return _0x107274;})[_0x86f0('0x29')](respondWithResult(_0x36ba7b,0xc9))['catch'](handleError(_0x36ba7b,null));};exports['update']=function(_0x24c416,_0x34b99c){if(_0x24c416['body']['id']){delete _0x24c416['body']['id'];}return db[_0x86f0('0x32')]['find']({'where':{'id':_0x24c416[_0x86f0('0x48')]['id']}})[_0x86f0('0x29')](handleEntityNotFound(_0x34b99c,null))[_0x86f0('0x29')](saveUpdates(_0x24c416[_0x86f0('0x4e')],null))[_0x86f0('0x29')](respondWithResult(_0x34b99c,null))['catch'](handleError(_0x34b99c,null));};exports[_0x86f0('0x2a')]=function(_0x44aedb,_0x310e9a){return db[_0x86f0('0x32')][_0x86f0('0x4b')]({'where':{'id':_0x44aedb[_0x86f0('0x48')]['id']}})[_0x86f0('0x29')](handleEntityNotFound(_0x310e9a,null))[_0x86f0('0x29')](removeEntity(_0x310e9a,null))['catch'](handleError(_0x310e9a,null));};exports['preview']=function(_0x2155bf,_0x45c79b){var _0x2f5882=0xa;var _0x5acc21=[_0x86f0('0x57'),_0x86f0('0x58'),_0x86f0('0x59'),_0x86f0('0x5a')];var _0x4b12f4={'SUM':_0x86f0('0x5b'),'COUNT':_0x86f0('0x5c'),'COUNT DISTINCT':_0x86f0('0x5d'),'MAX':_0x86f0('0x5e'),'MIN':_0x86f0('0x5f'),'AVG':_0x86f0('0x60'),'GROUP_CONCAT':_0x86f0('0x61'),'GROUP_CONCAT ASC':_0x86f0('0x62'),'GROUP_CONCAT DESC':_0x86f0('0x63')};var _0x34881f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x86f0('0x64'),'HOUR':_0x86f0('0x65'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x86f0('0x66')};var _0x30303f=function(_0x1f101b){return!_[_0x86f0('0x67')](['IS\x20NULL',_0x86f0('0x68'),_0x86f0('0x69'),_0x86f0('0x6a')],_0x1f101b);};var _0x3482d8=function(_0x58628b){if(!_0x58628b||!_0x58628b['rules']['length']){return'';}for(var _0x5483f3='(',_0x5108a2=0x0;_0x5108a2<_0x58628b['rules'][_0x86f0('0x3b')];_0x5108a2+=0x1){_0x5108a2>0x0&&(_0x5483f3+='\x20'+_0x58628b[_0x86f0('0x6b')]+'\x20');_0x5483f3+=_0x58628b['rules'][_0x5108a2][_0x86f0('0x6c')]?_0x3482d8(_0x58628b[_0x86f0('0x6d')][_0x5108a2]['group']):_0x58628b[_0x86f0('0x6d')][_0x5108a2][_0x86f0('0x6e')]+'\x20'+_0x58628b['rules'][_0x5108a2][_0x86f0('0x6f')]+(_0x30303f(_0x58628b['rules'][_0x5108a2][_0x86f0('0x6f')])?'\x20'+_0x58628b[_0x86f0('0x6d')][_0x5108a2][_0x86f0('0x70')]:'');}return _0x5483f3+')';};var _0x2b90af={'where':{'id':_0x2155bf[_0x86f0('0x48')]['id']}},_0x79ee5,_0x590469,_0x26c698,_0x42d85e,_0x56e6e4;_0x2b90af=_[_0x86f0('0x42')]({},_0x2b90af,_0x2155bf[_0x86f0('0x43')]);return db[_0x86f0('0x32')][_0x86f0('0x4b')](_0x2b90af)[_0x86f0('0x29')](function(_0x2bc23b){if(_0x2bc23b){_0x79ee5=_0x2bc23b;return _0x2bc23b[_0x86f0('0x71')]();}return null;})[_0x86f0('0x29')](function(_0x3d6172){if(_0x3d6172){if(!_0x3d6172[_0x86f0('0x3b')]){throw new db[(_0x86f0('0x72'))][(_0x86f0('0x73'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x590469=_0x3d6172;return db[_0x86f0('0x74')][_0x86f0('0x45')]({'raw':!![]});}return null;})[_0x86f0('0x29')](function(_0x5804a3){if(_0x5804a3){_0x26c698=_[_0x86f0('0x75')](_0x5804a3,'id');var _0x2bc203;var _0x3c1250=squel['select']();_0x3c1250[_0x86f0('0x76')](_0x79ee5['table']);for(var _0x2baa06=0x0;_0x2baa06<_0x590469[_0x86f0('0x3b')];_0x2baa06+=0x1){_0x2bc203=_0x590469[_0x2baa06][_0x86f0('0x77')]?_0x26c698[_0x590469[_0x2baa06][_0x86f0('0x77')]][_0x86f0('0x78')]:_0x590469[_0x2baa06][_0x86f0('0x6e')];_0x2bc203=_0x590469[_0x2baa06][_0x86f0('0x79')]?_[_0x86f0('0x7a')](_0x4b12f4[_0x590469[_0x2baa06][_0x86f0('0x79')]],'%s',_0x2bc203):_0x2bc203;_0x2bc203=_0x590469[_0x2baa06][_0x86f0('0x7b')]?_[_0x86f0('0x7a')](_0x34881f[_0x590469[_0x2baa06][_0x86f0('0x7b')]],'%s',_0x2bc203):_0x2bc203;if(_0x590469[_0x2baa06][_0x86f0('0x7c')]){_0x3c1250[_0x86f0('0x6c')](_0x2bc203);}_0x590469[_0x2baa06]['orderBy']&&_0x3c1250[_0x86f0('0x3e')](_0x2bc203,_0x590469[_0x2baa06][_0x86f0('0x7d')]===_0x86f0('0x7e')?![]:!![]);_0x3c1250[_0x86f0('0x6e')](_0x2bc203,_0x590469[_0x2baa06]['alias']||_0x2bc203);}if(_0x79ee5['joins']){_0x79ee5[_0x86f0('0x7f')]=JSON[_0x86f0('0x80')](_0x79ee5[_0x86f0('0x7f')]);for(var _0x5d0984=0x0;_0x5d0984<_0x79ee5[_0x86f0('0x7f')][_0x86f0('0x3b')];_0x5d0984+=0x1){if(_0x79ee5[_0x86f0('0x7f')][_0x5d0984][_0x86f0('0x34')]&&_[_0x86f0('0x67')](_0x5acc21,_0x79ee5['joins'][_0x5d0984][_0x86f0('0x34')])&&_0x79ee5[_0x86f0('0x7f')][_0x5d0984][_0x86f0('0x81')]&&_0x79ee5[_0x86f0('0x7f')][_0x5d0984][_0x86f0('0x82')]&&_0x79ee5[_0x86f0('0x7f')][_0x5d0984][_0x86f0('0x83')]){_0x3c1250[_0x79ee5[_0x86f0('0x7f')][_0x5d0984]['type']](_0x79ee5[_0x86f0('0x7f')][_0x5d0984][_0x86f0('0x82')],null,util[_0x86f0('0x7b')](_0x86f0('0x84'),_0x79ee5[_0x86f0('0x85')],_0x79ee5[_0x86f0('0x7f')][_0x5d0984][_0x86f0('0x81')],_0x79ee5[_0x86f0('0x7f')][_0x5d0984][_0x86f0('0x82')],_0x79ee5['joins'][_0x5d0984]['foreignKey']));}}}if(_0x79ee5[_0x86f0('0x86')]){_0x79ee5[_0x86f0('0x86')]=JSON[_0x86f0('0x80')](_0x79ee5[_0x86f0('0x86')]);_0x3c1250[_0x86f0('0x40')](_0x3482d8(_0x79ee5[_0x86f0('0x86')][_0x86f0('0x6c')]));}_0x56e6e4=_0x3c1250['clone']();_0x3c1250['limit'](_0x2f5882);_0x3c1250['offset'](0x0);logger['debug'](_0x86f0('0x87'),_0x3c1250[_0x86f0('0x88')]());return dbH[_0x86f0('0x89')][_0x86f0('0x35')](_0x3c1250[_0x86f0('0x88')](),{'type':dbH['sequelize'][_0x86f0('0x8a')][_0x86f0('0x8b')]});}})[_0x86f0('0x29')](respondWithResult(_0x45c79b,null))['catch'](handleError(_0x45c79b,null));};function runReport(_0x2bb1f2,_0x1b263a,_0x42c668){var _0x5bc651=_0x1b263a[_0x86f0('0x2e')];var _0x48c123=0xa;var _0x41c724=[_0x86f0('0x57'),'left_join',_0x86f0('0x59'),_0x86f0('0x5a')];var _0xbfacbd={'SUM':'SUM(%s)','COUNT':_0x86f0('0x5c'),'COUNT DISTINCT':_0x86f0('0x5d'),'MAX':_0x86f0('0x5e'),'MIN':'MIN(%s)','AVG':_0x86f0('0x60'),'GROUP_CONCAT':_0x86f0('0x61'),'GROUP_CONCAT ASC':_0x86f0('0x62'),'GROUP_CONCAT DESC':_0x86f0('0x63')};var _0x28d821={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x86f0('0x64'),'HOUR':_0x86f0('0x65'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x86f0('0x66')};var _0x5603b4=function(_0x3c6e27){return!_[_0x86f0('0x67')]([_0x86f0('0x8c'),_0x86f0('0x68'),_0x86f0('0x69'),_0x86f0('0x6a')],_0x3c6e27);};var _0x277e4d=function(_0x1a9e18){if(!_0x1a9e18||!_0x1a9e18[_0x86f0('0x6d')][_0x86f0('0x3b')]){return'';}for(var _0x428858='(',_0x52292a=0x0;_0x52292a<_0x1a9e18[_0x86f0('0x6d')][_0x86f0('0x3b')];_0x52292a+=0x1){_0x52292a>0x0&&(_0x428858+='\x20'+_0x1a9e18[_0x86f0('0x6b')]+'\x20');_0x428858+=_0x1a9e18[_0x86f0('0x6d')][_0x52292a]['group']?_0x277e4d(_0x1a9e18[_0x86f0('0x6d')][_0x52292a]['group']):_0x1a9e18['rules'][_0x52292a][_0x86f0('0x6e')]+'\x20'+_0x1a9e18[_0x86f0('0x6d')][_0x52292a][_0x86f0('0x6f')]+(_0x5603b4(_0x1a9e18[_0x86f0('0x6d')][_0x52292a][_0x86f0('0x6f')])?'\x20'+_0x1a9e18['rules'][_0x52292a][_0x86f0('0x70')]:'');}return _0x428858+')';};var _0x1975b0={'where':{'id':_0x2bb1f2['id']}},_0x42389c,_0x3c7c3b,_0x1c4052,_0x581f8d,_0xafb9ce;_0x1975b0=_[_0x86f0('0x42')]({},_0x1975b0,_0x42c668);return db[_0x86f0('0x32')][_0x86f0('0x4b')](_0x1975b0)[_0x86f0('0x29')](function(_0x5574f7){if(_0x5574f7){_0x42389c=_0x5574f7;return _0x5574f7[_0x86f0('0x71')]();}return null;})['then'](function(_0x120317){if(_0x120317){if(!_0x120317[_0x86f0('0x3b')]){throw new db[(_0x86f0('0x72'))][(_0x86f0('0x73'))](_0x86f0('0x8d'),0x193);}_0x3c7c3b=_0x120317;return db[_0x86f0('0x74')][_0x86f0('0x45')]({'raw':!![]});}return null;})[_0x86f0('0x29')](function(_0x576cd6){if(_0x576cd6){_0x1c4052=_['keyBy'](_0x576cd6,'id');var _0x52fb25;var _0x56f2fb=squel['select']();_0x56f2fb[_0x86f0('0x76')](_0x42389c[_0x86f0('0x85')]);for(var _0x1b891f=0x0;_0x1b891f<_0x3c7c3b[_0x86f0('0x3b')];_0x1b891f+=0x1){_0x52fb25=_0x3c7c3b[_0x1b891f][_0x86f0('0x77')]?_0x1c4052[_0x3c7c3b[_0x1b891f][_0x86f0('0x77')]][_0x86f0('0x78')]:_0x3c7c3b[_0x1b891f][_0x86f0('0x6e')];_0x52fb25=_0x3c7c3b[_0x1b891f][_0x86f0('0x79')]?_[_0x86f0('0x7a')](_0xbfacbd[_0x3c7c3b[_0x1b891f][_0x86f0('0x79')]],'%s',_0x52fb25):_0x52fb25;_0x52fb25=_0x3c7c3b[_0x1b891f][_0x86f0('0x7b')]?_['replace'](_0x28d821[_0x3c7c3b[_0x1b891f][_0x86f0('0x7b')]],'%s',_0x52fb25):_0x52fb25;if(_0x3c7c3b[_0x1b891f][_0x86f0('0x7c')]){_0x56f2fb[_0x86f0('0x6c')](_0x52fb25);}_0x3c7c3b[_0x1b891f][_0x86f0('0x7d')]&&_0x56f2fb[_0x86f0('0x3e')](_0x52fb25,_0x3c7c3b[_0x1b891f][_0x86f0('0x7d')]==='DESC'?![]:!![]);_0x56f2fb[_0x86f0('0x6e')](_0x52fb25,_0x3c7c3b[_0x1b891f][_0x86f0('0x8e')]||_0x52fb25);}if(_0x42389c['joins']){_0x42389c[_0x86f0('0x7f')]=JSON[_0x86f0('0x80')](_0x42389c[_0x86f0('0x7f')]);for(var _0x241dd4=0x0;_0x241dd4<_0x42389c[_0x86f0('0x7f')][_0x86f0('0x3b')];_0x241dd4+=0x1){if(_0x42389c[_0x86f0('0x7f')][_0x241dd4][_0x86f0('0x34')]&&_[_0x86f0('0x67')](_0x41c724,_0x42389c[_0x86f0('0x7f')][_0x241dd4][_0x86f0('0x34')])&&_0x42389c[_0x86f0('0x7f')][_0x241dd4]['parentKey']&&_0x42389c[_0x86f0('0x7f')][_0x241dd4][_0x86f0('0x82')]&&_0x42389c[_0x86f0('0x7f')][_0x241dd4][_0x86f0('0x83')]){_0x56f2fb[_0x42389c[_0x86f0('0x7f')][_0x241dd4]['type']](_0x42389c[_0x86f0('0x7f')][_0x241dd4][_0x86f0('0x82')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x42389c['table'],_0x42389c[_0x86f0('0x7f')][_0x241dd4][_0x86f0('0x81')],_0x42389c['joins'][_0x241dd4][_0x86f0('0x82')],_0x42389c['joins'][_0x241dd4]['foreignKey']));}}}if(_0x42389c[_0x86f0('0x86')]){_0x42389c[_0x86f0('0x86')]=JSON[_0x86f0('0x80')](_0x42389c[_0x86f0('0x86')]);_0x56f2fb[_0x86f0('0x40')](_0x277e4d(_0x42389c[_0x86f0('0x86')][_0x86f0('0x6c')]));}_0xafb9ce=_0x56f2fb[_0x86f0('0x8f')]();_0x56f2fb[_0x86f0('0x21')](_0x48c123);_0x56f2fb[_0x86f0('0x23')](0x0);return;}})[_0x86f0('0x29')](function(){if(_0x1b263a[_0x86f0('0x90')]===_0x86f0('0x91')){return null;}var _0x4f63ce=_[_0x86f0('0x42')](_0x1b263a,{'name':_0x1b263a['fullPath']||_0x1b263a[_0x86f0('0x2e')]||_0x42389c[_0x86f0('0x2e')],'basename':_0x5bc651,'savename':util[_0x86f0('0x7b')](_0x86f0('0x92'),_0x1b263a[_0x86f0('0x2e')]||_0x42389c[_0x86f0('0x2e')],require('randomstring')['generate'](0x4),_0x1b263a[_0x86f0('0x90')]||_0x86f0('0x93')),'reportId':_0x42389c['id'],'reportType':_0x86f0('0x94')});return db[_0x86f0('0x95')][_0x86f0('0x4d')](_0x4f63ce,{'raw':!![]});})['then'](function(_0x281f0c){if(_0x42389c['table']===_0x86f0('0x96')){_0xafb9ce[_0x86f0('0x40')](_0x42389c['table']+_0x86f0('0x97'),_0x1b263a[_0x86f0('0x98')],_0x1b263a[_0x86f0('0x99')]);}else{_0xafb9ce[_0x86f0('0x40')](_0x42389c['table']+_0x86f0('0x9a'),_0x1b263a['startDate'],_0x1b263a[_0x86f0('0x99')]);}if(_0x281f0c){logger['info'](_0x86f0('0x9b'),_0xafb9ce['toString']());require(_0x86f0('0x9c'))[_0x86f0('0x9d')](path[_0x86f0('0x57')](__dirname,'../../components/export/',_0x281f0c['output']),[_0x281f0c['id'],_0xafb9ce[_0x86f0('0x88')](),path[_0x86f0('0x57')](__dirname,_0x86f0('0x9e'),_0x281f0c[_0x86f0('0x9f')]),_0x5bc651]);return _0x281f0c;}else{var _0x169454=squel[_0x86f0('0xa0')]();_0x169454['from']('('+_0xafb9ce[_0x86f0('0x88')]()+')',_0x86f0('0xa1'));_0x169454[_0x86f0('0x6e')]('COUNT(*)',_0x86f0('0x22'));_0xafb9ce['limit'](_0x1b263a['limit']||_0x48c123);_0xafb9ce[_0x86f0('0x23')](_0x1b263a[_0x86f0('0x23')]||0x0);return dbH[_0x86f0('0x89')][_0x86f0('0x35')](_0x169454[_0x86f0('0x88')](),{'type':dbH[_0x86f0('0x89')][_0x86f0('0x8a')][_0x86f0('0x8b')]})[_0x86f0('0x29')](function(_0x4ba572){if(!_0x4ba572['length']){_0x581f8d=0x0;}else{_0x581f8d=_0x4ba572[0x0][_0x86f0('0x22')]||0x0;}return dbH[_0x86f0('0x89')][_0x86f0('0x35')](_0xafb9ce[_0x86f0('0x88')](),{'type':dbH[_0x86f0('0x89')][_0x86f0('0x8a')][_0x86f0('0x8b')]});})[_0x86f0('0x29')](function(_0x477562){return{'rows':_0x477562||[],'count':_0x581f8d};});}});}exports[_0x86f0('0xa2')]=function(_0x27340f,_0x5d4b96){return runReport(_0x27340f['params'],_0x27340f['query'],_0x27340f[_0x86f0('0x43')])[_0x86f0('0x29')](respondWithResult(_0x5d4b96,null))[_0x86f0('0x4c')](handleError(_0x5d4b96,null));};exports[_0x86f0('0xa3')]=runReport;exports[_0x86f0('0x35')]=function(_0x53a0f6,_0x418b01){var _0x45a7ee=0xa;var _0x4e5e45=[_0x86f0('0x57'),_0x86f0('0x58'),_0x86f0('0x59'),_0x86f0('0x5a')];var _0x3012cb={'SUM':_0x86f0('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x86f0('0x5d'),'MAX':_0x86f0('0x5e'),'MIN':_0x86f0('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x86f0('0x63')};var _0x505919={'SEC_TO_TIME':_0x86f0('0xa4'),'DATE':'DATE(%s)','HOUR':_0x86f0('0x65'),'ROUND':_0x86f0('0xa5'),'UNIX_TIMESTAMP':_0x86f0('0x66')};var _0x1e564c=function(_0x3a668e){return!_[_0x86f0('0x67')]([_0x86f0('0x8c'),_0x86f0('0x68'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x3a668e);};var _0xe1da51=function(_0x322484){if(!_0x322484||!_0x322484['rules'][_0x86f0('0x3b')]){return'';}for(var _0x46377f='(',_0x2db25b=0x0;_0x2db25b<_0x322484['rules']['length'];_0x2db25b+=0x1){_0x2db25b>0x0&&(_0x46377f+='\x20'+_0x322484['operator']+'\x20');_0x46377f+=_0x322484['rules'][_0x2db25b][_0x86f0('0x6c')]?_0xe1da51(_0x322484['rules'][_0x2db25b][_0x86f0('0x6c')]):_0x322484[_0x86f0('0x6d')][_0x2db25b][_0x86f0('0x6e')]+'\x20'+_0x322484[_0x86f0('0x6d')][_0x2db25b][_0x86f0('0x6f')]+(_0x1e564c(_0x322484[_0x86f0('0x6d')][_0x2db25b]['condition'])?'\x20'+_0x322484[_0x86f0('0x6d')][_0x2db25b][_0x86f0('0x70')]:'');}return _0x46377f+')';};var _0x47c5b2={'where':{'id':_0x53a0f6[_0x86f0('0x48')]['id']}},_0x189a2f,_0xd42392,_0x2956e2,_0x3836d3,_0x2c3b0c;_0x47c5b2=_[_0x86f0('0x42')]({},_0x47c5b2,_0x53a0f6['options']);return db['AnalyticCustomReport'][_0x86f0('0x4b')](_0x47c5b2)[_0x86f0('0x29')](function(_0x1cfcf8){if(_0x1cfcf8){_0x189a2f=_0x1cfcf8;return _0x1cfcf8[_0x86f0('0x71')]();}return null;})[_0x86f0('0x29')](function(_0x2b967c){if(_0x2b967c){if(!_0x2b967c[_0x86f0('0x3b')]){throw new db['Sequelize'][(_0x86f0('0x73'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xd42392=_0x2b967c;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x86f0('0x29')](function(_0x6168ed){if(_0x6168ed){_0x2956e2=_['keyBy'](_0x6168ed,'id');var _0xde6186;var _0x4abb51=squel['select']();_0x4abb51[_0x86f0('0x76')](_0x189a2f['table']);for(var _0x42998d=0x0;_0x42998d<_0xd42392[_0x86f0('0x3b')];_0x42998d+=0x1){_0xde6186=_0xd42392[_0x42998d][_0x86f0('0x77')]?_0x2956e2[_0xd42392[_0x42998d][_0x86f0('0x77')]][_0x86f0('0x78')]:_0xd42392[_0x42998d]['field'];_0xde6186=_0xd42392[_0x42998d][_0x86f0('0x79')]?_[_0x86f0('0x7a')](_0x3012cb[_0xd42392[_0x42998d][_0x86f0('0x79')]],'%s',_0xde6186):_0xde6186;_0xde6186=_0xd42392[_0x42998d]['format']?_['replace'](_0x505919[_0xd42392[_0x42998d][_0x86f0('0x7b')]],'%s',_0xde6186):_0xde6186;if(_0xd42392[_0x42998d]['groupBy']){_0x4abb51[_0x86f0('0x6c')](_0xde6186);}_0xd42392[_0x42998d][_0x86f0('0x7d')]&&_0x4abb51[_0x86f0('0x3e')](_0xde6186,_0xd42392[_0x42998d][_0x86f0('0x7d')]==='DESC'?![]:!![]);_0x4abb51[_0x86f0('0x6e')](_0xde6186,_0xd42392[_0x42998d]['alias']||_0xde6186);}if(_0x189a2f[_0x86f0('0x7f')]){_0x189a2f['joins']=JSON['parse'](_0x189a2f[_0x86f0('0x7f')]);for(var _0x6206a7=0x0;_0x6206a7<_0x189a2f[_0x86f0('0x7f')][_0x86f0('0x3b')];_0x6206a7+=0x1){if(_0x189a2f[_0x86f0('0x7f')][_0x6206a7][_0x86f0('0x34')]&&_['includes'](_0x4e5e45,_0x189a2f['joins'][_0x6206a7][_0x86f0('0x34')])&&_0x189a2f[_0x86f0('0x7f')][_0x6206a7][_0x86f0('0x81')]&&_0x189a2f[_0x86f0('0x7f')][_0x6206a7][_0x86f0('0x82')]&&_0x189a2f['joins'][_0x6206a7][_0x86f0('0x83')]){_0x4abb51[_0x189a2f[_0x86f0('0x7f')][_0x6206a7][_0x86f0('0x34')]](_0x189a2f[_0x86f0('0x7f')][_0x6206a7]['foreignTable'],null,util[_0x86f0('0x7b')](_0x86f0('0x84'),_0x189a2f['table'],_0x189a2f[_0x86f0('0x7f')][_0x6206a7][_0x86f0('0x81')],_0x189a2f['joins'][_0x6206a7][_0x86f0('0x82')],_0x189a2f[_0x86f0('0x7f')][_0x6206a7][_0x86f0('0x83')]));}}}if(_0x189a2f['conditions']){_0x189a2f['conditions']=JSON[_0x86f0('0x80')](_0x189a2f['conditions']);_0x4abb51[_0x86f0('0x40')](_0xe1da51(_0x189a2f[_0x86f0('0x86')][_0x86f0('0x6c')]));}_0x2c3b0c=_0x4abb51[_0x86f0('0x8f')]();_0x4abb51[_0x86f0('0x21')](_0x45a7ee);_0x4abb51[_0x86f0('0x23')](0x0);logger['debug'](_0x86f0('0x87'),_0x4abb51[_0x86f0('0x88')]());return dbH[_0x86f0('0x89')]['query'](_0x4abb51[_0x86f0('0x88')](),{'type':dbH[_0x86f0('0x89')][_0x86f0('0x8a')][_0x86f0('0x8b')]});}})[_0x86f0('0x29')](function(){return{'sql':_0x2c3b0c[_0x86f0('0x88')]()};})[_0x86f0('0x29')](respondWithResult(_0x418b01,null))[_0x86f0('0x4c')](handleError(_0x418b01,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 07e3180..041930b 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 _0xd270=['bluebird','request-promise','path','rimraf','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','util','../../config/logger','api','moment'];(function(_0x79d0d3,_0x5b118b){var _0x4973eb=function(_0x279e4a){while(--_0x279e4a){_0x79d0d3['push'](_0x79d0d3['shift']());}};_0x4973eb(++_0x5b118b);}(_0xd270,0x19b));var _0x0d27=function(_0x307bf7,_0x315dce){_0x307bf7=_0x307bf7-0x0;var _0x578e59=_0xd270[_0x307bf7];return _0x578e59;};'use strict';var _=require(_0x0d27('0x0'));var util=require(_0x0d27('0x1'));var logger=require(_0x0d27('0x2'))(_0x0d27('0x3'));var moment=require(_0x0d27('0x4'));var BPromise=require(_0x0d27('0x5'));var rp=require(_0x0d27('0x6'));var fs=require('fs');var path=require(_0x0d27('0x7'));var rimraf=require(_0x0d27('0x8'));var config=require('../../config/environment');var attributes=require(_0x0d27('0x9'));module[_0x0d27('0xa')]=function(_0x492df1,_0x3e4f97){return _0x492df1[_0x0d27('0xb')]('AnalyticCustomReport',attributes,{'tableName':_0x0d27('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f25=['rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x1b4c04,_0x8d961d){var _0x374f5d=function(_0x11dc31){while(--_0x11dc31){_0x1b4c04['push'](_0x1b4c04['shift']());}};_0x374f5d(++_0x8d961d);}(_0x4f25,0xb0));var _0x54f2=function(_0x20714a,_0x7de591){_0x20714a=_0x20714a-0x0;var _0x15e877=_0x4f25[_0x20714a];return _0x15e877;};'use strict';var _=require(_0x54f2('0x0'));var util=require(_0x54f2('0x1'));var logger=require(_0x54f2('0x2'))('api');var moment=require(_0x54f2('0x3'));var BPromise=require('bluebird');var rp=require(_0x54f2('0x4'));var fs=require('fs');var path=require(_0x54f2('0x5'));var rimraf=require(_0x54f2('0x6'));var config=require(_0x54f2('0x7'));var attributes=require(_0x54f2('0x8'));module[_0x54f2('0x9')]=function(_0x28c3bd,_0x1754ce){return _0x28c3bd[_0x54f2('0xa')](_0x54f2('0xb'),attributes,{'tableName':_0x54f2('0xc'),'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 d7f609d..26a1812 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 _0xa56e=['info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x59bcb1,_0x5a4b6c){var _0x4a737f=function(_0x546a49){while(--_0x546a49){_0x59bcb1['push'](_0x59bcb1['shift']());}};_0x4a737f(++_0x5a4b6c);}(_0xa56e,0xf9));var _0xea56=function(_0x1bb030,_0x27d05f){_0x1bb030=_0x1bb030-0x0;var _0x28ef4f=_0xa56e[_0x1bb030];return _0x28ef4f;};'use strict';var _=require(_0xea56('0x0'));var util=require('util');var moment=require(_0xea56('0x1'));var BPromise=require(_0xea56('0x2'));var rs=require(_0xea56('0x3'));var fs=require('fs');var Redis=require(_0xea56('0x4'));var db=require(_0xea56('0x5'))['db'];var utils=require(_0xea56('0x6'));var logger=require(_0xea56('0x7'))(_0xea56('0x8'));var config=require(_0xea56('0x9'));var jayson=require(_0xea56('0xa'));var client=jayson[_0xea56('0xb')][_0xea56('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x48f4d1,_0x4ffe12,_0x4cc64a){return new BPromise(function(_0x10e31c,_0x319684){return client[_0xea56('0xd')](_0x48f4d1,_0x4cc64a)[_0xea56('0xe')](function(_0x8a14e3){logger[_0xea56('0xf')](_0xea56('0x10'),_0x4ffe12,_0xea56('0x11'));logger[_0xea56('0x12')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x4ffe12,_0xea56('0x11'),JSON[_0xea56('0x13')](_0x8a14e3));if(_0x8a14e3['error']){if(_0x8a14e3['error']['code']===0x1f4){logger[_0xea56('0x14')](_0xea56('0x10'),_0x4ffe12,_0x8a14e3[_0xea56('0x14')][_0xea56('0x15')]);return _0x319684(_0x8a14e3['error'][_0xea56('0x15')]);}logger[_0xea56('0x14')](_0xea56('0x10'),_0x4ffe12,_0x8a14e3[_0xea56('0x14')][_0xea56('0x15')]);return _0x10e31c(_0x8a14e3['error'][_0xea56('0x15')]);}else{logger[_0xea56('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4ffe12,_0xea56('0x11'));_0x10e31c(_0x8a14e3[_0xea56('0x16')][_0xea56('0x15')]);}})[_0xea56('0x17')](function(_0xb5c16c){logger[_0xea56('0x14')](_0xea56('0x10'),_0x4ffe12,_0xb5c16c);_0x319684(_0xb5c16c);});});} \ No newline at end of file +var _0x1a1d=['AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x482841,_0x1c3732){var _0x88fe3d=function(_0x71454b){while(--_0x71454b){_0x482841['push'](_0x482841['shift']());}};_0x88fe3d(++_0x1c3732);}(_0x1a1d,0x112));var _0xd1a1=function(_0x377b1f,_0x1cc7fc){_0x377b1f=_0x377b1f-0x0;var _0x2db111=_0x1a1d[_0x377b1f];return _0x2db111;};'use strict';var _=require(_0xd1a1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd1a1('0x1'));var fs=require('fs');var Redis=require(_0xd1a1('0x2'));var db=require(_0xd1a1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd1a1('0x4'))(_0xd1a1('0x5'));var config=require(_0xd1a1('0x6'));var jayson=require(_0xd1a1('0x7'));var client=jayson[_0xd1a1('0x8')][_0xd1a1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bf9f2,_0x2e80a2,_0x3d8a2a){return new BPromise(function(_0x466a79,_0x2d4316){return client[_0xd1a1('0xa')](_0x2bf9f2,_0x3d8a2a)['then'](function(_0x355151){logger[_0xd1a1('0xb')](_0xd1a1('0xc'),_0x2e80a2,'request\x20sent');logger[_0xd1a1('0xd')](_0xd1a1('0xe'),_0x2e80a2,_0xd1a1('0xf'),JSON[_0xd1a1('0x10')](_0x355151));if(_0x355151[_0xd1a1('0x11')]){if(_0x355151[_0xd1a1('0x11')][_0xd1a1('0x12')]===0x1f4){logger[_0xd1a1('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2e80a2,_0x355151[_0xd1a1('0x11')]['message']);return _0x2d4316(_0x355151[_0xd1a1('0x11')][_0xd1a1('0x13')]);}logger[_0xd1a1('0x11')](_0xd1a1('0xc'),_0x2e80a2,_0x355151['error'][_0xd1a1('0x13')]);return _0x466a79(_0x355151[_0xd1a1('0x11')][_0xd1a1('0x13')]);}else{logger[_0xd1a1('0xb')](_0xd1a1('0xc'),_0x2e80a2,'request\x20sent');_0x466a79(_0x355151[_0xd1a1('0x14')][_0xd1a1('0x13')]);}})[_0xd1a1('0x15')](function(_0x35426c){logger[_0xd1a1('0x11')](_0xd1a1('0xc'),_0x2e80a2,_0x35426c);_0x2d4316(_0x35426c);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index f612948..dd550d9 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 _0xf4ff=['destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','put','update','delete'];(function(_0x960a7f,_0x49ba00){var _0x548553=function(_0x4ac55c){while(--_0x4ac55c){_0x960a7f['push'](_0x960a7f['shift']());}};_0x548553(++_0x49ba00);}(_0xf4ff,0x18e));var _0xff4f=function(_0x4be7f6,_0x87010d){_0x4be7f6=_0x4be7f6-0x0;var _0x19ba9a=_0xf4ff[_0x4be7f6];return _0x19ba9a;};'use strict';var multer=require('multer');var util=require(_0xff4f('0x0'));var path=require('path');var timeout=require(_0xff4f('0x1'));var express=require(_0xff4f('0x2'));var router=express['Router']();var fs_extra=require(_0xff4f('0x3'));var auth=require(_0xff4f('0x4'));var interaction=require(_0xff4f('0x5'));var config=require(_0xff4f('0x6'));var controller=require(_0xff4f('0x7'));router[_0xff4f('0x8')]('/',auth[_0xff4f('0x9')](),controller['index']);router['get'](_0xff4f('0xa'),auth[_0xff4f('0x9')](),controller[_0xff4f('0xb')]);router['get'](_0xff4f('0xc'),auth['isAuthenticated'](),controller[_0xff4f('0xd')]);router['get'](_0xff4f('0xe'),auth[_0xff4f('0x9')](),controller['run']);router['get'](_0xff4f('0xf'),auth[_0xff4f('0x9')](),controller[_0xff4f('0x10')]);router['post']('/',auth[_0xff4f('0x9')](),controller['create']);router[_0xff4f('0x11')](_0xff4f('0xa'),auth['isAuthenticated'](),controller[_0xff4f('0x12')]);router[_0xff4f('0x13')](_0xff4f('0xa'),auth[_0xff4f('0x9')](),controller[_0xff4f('0x14')]);module[_0xff4f('0x15')]=router; \ No newline at end of file +var _0x31ea=['create','put','destroy','exports','multer','util','connect-timeout','express','Router','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','query','post'];(function(_0x656ba8,_0xda4cc4){var _0x40dd55=function(_0x4e3a87){while(--_0x4e3a87){_0x656ba8['push'](_0x656ba8['shift']());}};_0x40dd55(++_0xda4cc4);}(_0x31ea,0x13f));var _0xa31e=function(_0x3d9d04,_0x5efc54){_0x3d9d04=_0x3d9d04-0x0;var _0x1aa9e9=_0x31ea[_0x3d9d04];return _0x1aa9e9;};'use strict';var multer=require(_0xa31e('0x0'));var util=require(_0xa31e('0x1'));var path=require('path');var timeout=require(_0xa31e('0x2'));var express=require(_0xa31e('0x3'));var router=express[_0xa31e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa31e('0x5'));var controller=require('./analyticCustomReport.controller');router[_0xa31e('0x6')]('/',auth['isAuthenticated'](),controller[_0xa31e('0x7')]);router['get'](_0xa31e('0x8'),auth[_0xa31e('0x9')](),controller[_0xa31e('0xa')]);router[_0xa31e('0x6')](_0xa31e('0xb'),auth[_0xa31e('0x9')](),controller[_0xa31e('0xc')]);router['get'](_0xa31e('0xd'),auth[_0xa31e('0x9')](),controller[_0xa31e('0xe')]);router[_0xa31e('0x6')]('/:id/query',auth[_0xa31e('0x9')](),controller[_0xa31e('0xf')]);router[_0xa31e('0x10')]('/',auth[_0xa31e('0x9')](),controller[_0xa31e('0x11')]);router[_0xa31e('0x12')](_0xa31e('0x8'),auth[_0xa31e('0x9')](),controller['update']);router['delete'](_0xa31e('0x8'),auth[_0xa31e('0x9')](),controller[_0xa31e('0x13')]);module[_0xa31e('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index fb05c24..9c8ee16 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 _0xeec6=['STRING','TEXT','sequelize','exports'];(function(_0x4bcc63,_0x492386){var _0x15b071=function(_0x4b2cc2){while(--_0x4b2cc2){_0x4bcc63['push'](_0x4bcc63['shift']());}};_0x15b071(++_0x492386);}(_0xeec6,0x1c2));var _0x6eec=function(_0x582d0b,_0x28f609){_0x582d0b=_0x582d0b-0x0;var _0x2e93e1=_0xeec6[_0x582d0b];return _0x2e93e1;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'name':{'type':Sequelize[_0x6eec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6eec('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x6eec('0x2')]},'conditions':{'type':Sequelize[_0x6eec('0x3')]},'joins':{'type':Sequelize[_0x6eec('0x3')]}}; \ No newline at end of file +var _0xda19=['exports','STRING','TEXT'];(function(_0x2b952c,_0x2301b5){var _0x2005ec=function(_0x210bcf){while(--_0x210bcf){_0x2b952c['push'](_0x2b952c['shift']());}};_0x2005ec(++_0x2301b5);}(_0xda19,0xd5));var _0x9da1=function(_0x279924,_0x30ff21){_0x279924=_0x279924-0x0;var _0x1ae1df=_0xda19[_0x279924];return _0x1ae1df;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9da1('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x9da1('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 01a8591..60735d0 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 _0x6d38=['Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','countTable','COUNT(*)','sequelize','run','SEC_TO_TIME(%s)','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','get','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','AnalyticDefaultReport','findAll','rows','show','keys','fields','find','catch','create','body','user','role','Reports','autoAssociation','UserProfileResource','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x6d38,0x1ef));var _0x86d3=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x6d38[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];var dbH=require(_0x86d3('0x13'))[_0x86d3('0x14')];function respondWithStatusCode(_0x26d64c,_0xe1b3d7){_0xe1b3d7=_0xe1b3d7||0xcc;return function(_0x1b8d0a){if(_0x1b8d0a){return _0x26d64c[_0x86d3('0x15')](_0xe1b3d7);}return _0x26d64c[_0x86d3('0x16')](_0xe1b3d7)['end']();};}function respondWithResult(_0x1c1ba8,_0x1f35cf){_0x1f35cf=_0x1f35cf||0xc8;return function(_0x356e7d){if(_0x356e7d){return _0x1c1ba8[_0x86d3('0x16')](_0x1f35cf)[_0x86d3('0x17')](_0x356e7d);}};}function respondWithFilteredResult(_0x34fb3b,_0x1ff008){return function(_0x44436d){if(_0x44436d){var _0x53b437=typeof _0x1ff008[_0x86d3('0x18')]===_0x86d3('0x19')&&typeof _0x1ff008[_0x86d3('0x1a')]===_0x86d3('0x19');var _0x46feec=_0x44436d[_0x86d3('0x1b')];var _0x33e459=_0x53b437?0x0:_0x1ff008[_0x86d3('0x18')];var _0x9b76f2=_0x53b437?_0x44436d['count']:_0x1ff008[_0x86d3('0x18')]+_0x1ff008['limit'];var _0x6ced9e;if(_0x9b76f2>=_0x46feec){_0x9b76f2=_0x46feec;_0x6ced9e=0xc8;}else{_0x6ced9e=0xce;}_0x34fb3b['status'](_0x6ced9e);return _0x34fb3b['set'](_0x86d3('0x1c'),_0x33e459+'-'+_0x9b76f2+'/'+_0x46feec)[_0x86d3('0x17')](_0x44436d);}return null;};}function patchUpdates(_0x988066){return function(_0x1720ae){try{jsonpatch['apply'](_0x1720ae,_0x988066,!![]);}catch(_0x2901de){return BPromise['reject'](_0x2901de);}return _0x1720ae[_0x86d3('0x1d')]();};}function saveUpdates(_0x3fdf67,_0x1ce849){return function(_0x5b990d){if(_0x5b990d){return _0x5b990d[_0x86d3('0x1e')](_0x3fdf67)[_0x86d3('0x1f')](function(_0x1fa4ac){return _0x1fa4ac;});}return null;};}function removeEntity(_0x4bf5b8,_0x58ba51){return function(_0x26262a){if(_0x26262a){return _0x26262a['destroy']()[_0x86d3('0x1f')](function(){var _0x1bea5e=_0x26262a[_0x86d3('0x20')]({'plain':!![]});var _0x3c5fe4='DefaultReports';return db['UserProfileResource'][_0x86d3('0x21')]({'where':{'type':_0x3c5fe4,'resourceId':_0x1bea5e['id']}})[_0x86d3('0x1f')](function(){return _0x26262a;});})['then'](function(){_0x4bf5b8[_0x86d3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42413c,_0x41e2f0){return function(_0x287b96){if(!_0x287b96){_0x42413c[_0x86d3('0x15')](0x194);}return _0x287b96;};}function handleError(_0x11a6fd,_0x14c9ff){_0x14c9ff=_0x14c9ff||0x1f4;return function(_0x1f203e){logger[_0x86d3('0x22')](_0x1f203e[_0x86d3('0x23')]);if(_0x1f203e[_0x86d3('0x24')]){delete _0x1f203e[_0x86d3('0x24')];}_0x11a6fd[_0x86d3('0x16')](_0x14c9ff)[_0x86d3('0x25')](_0x1f203e);};}exports[_0x86d3('0x26')]=function(_0x5b09f6,_0x120a0c){var _0x403be3={},_0x2bda35={},_0x31cefe={'count':0x0,'rows':[]};var _0x7709f0=_[_0x86d3('0x27')](db['AnalyticDefaultReport'][_0x86d3('0x28')],function(_0x5c71df){return{'name':_0x5c71df['fieldName'],'type':_0x5c71df[_0x86d3('0x29')][_0x86d3('0x2a')]};});_0x2bda35[_0x86d3('0x2b')]=_['map'](_0x7709f0,_0x86d3('0x24'));_0x2bda35[_0x86d3('0x2c')]=_['keys'](_0x5b09f6[_0x86d3('0x2c')]);_0x2bda35[_0x86d3('0x2d')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],_0x2bda35[_0x86d3('0x2c')]);_0x403be3[_0x86d3('0x2f')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],qs['fields'](_0x5b09f6['query']['fields']));_0x403be3[_0x86d3('0x2f')]=_0x403be3['attributes'][_0x86d3('0x30')]?_0x403be3['attributes']:_0x2bda35[_0x86d3('0x2b')];if(!_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x31')](_0x86d3('0x32'))){_0x403be3[_0x86d3('0x1a')]=qs[_0x86d3('0x1a')](_0x5b09f6[_0x86d3('0x2c')]['limit']);_0x403be3[_0x86d3('0x18')]=qs[_0x86d3('0x18')](_0x5b09f6['query'][_0x86d3('0x18')]);}_0x403be3[_0x86d3('0x33')]=qs[_0x86d3('0x34')](_0x5b09f6[_0x86d3('0x2c')]['sort']);_0x403be3[_0x86d3('0x35')]=qs[_0x86d3('0x2d')](_[_0x86d3('0x36')](_0x5b09f6['query'],_0x2bda35[_0x86d3('0x2d')]),_0x7709f0);if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x37')]){_0x403be3[_0x86d3('0x35')]=_[_0x86d3('0x38')](_0x403be3[_0x86d3('0x35')],{'$or':_[_0x86d3('0x27')](_0x7709f0,function(_0x436065){if(_0x436065['type']!==_0x86d3('0x39')){var _0x470978={};_0x470978[_0x436065[_0x86d3('0x24')]]={'$like':'%'+_0x5b09f6[_0x86d3('0x2c')]['filter']+'%'};return _0x470978;}})});}_0x403be3=_[_0x86d3('0x38')]({},_0x403be3,_0x5b09f6[_0x86d3('0x3a')]);var _0x6f72be={'where':_0x403be3[_0x86d3('0x35')]};return db['AnalyticDefaultReport']['count'](_0x6f72be)[_0x86d3('0x1f')](function(_0x4f422b){_0x31cefe['count']=_0x4f422b;if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x403be3[_0x86d3('0x3c')]=[{'all':!![]}];}return db[_0x86d3('0x3d')][_0x86d3('0x3e')](_0x403be3);})['then'](function(_0x2a5f6c){_0x31cefe[_0x86d3('0x3f')]=_0x2a5f6c;return _0x31cefe;})[_0x86d3('0x1f')](respondWithFilteredResult(_0x120a0c,_0x403be3))['catch'](handleError(_0x120a0c,null));};exports[_0x86d3('0x40')]=function(_0x810d10,_0x5dfae8){var _0x369f68={'raw':!![],'where':{'id':_0x810d10['params']['id']}},_0xcf6c9e={};_0xcf6c9e['model']=_['keys'](db[_0x86d3('0x3d')][_0x86d3('0x28')]);_0xcf6c9e[_0x86d3('0x2c')]=_[_0x86d3('0x41')](_0x810d10[_0x86d3('0x2c')]);_0xcf6c9e[_0x86d3('0x2d')]=_['intersection'](_0xcf6c9e[_0x86d3('0x2b')],_0xcf6c9e[_0x86d3('0x2c')]);_0x369f68['attributes']=_[_0x86d3('0x2e')](_0xcf6c9e[_0x86d3('0x2b')],qs[_0x86d3('0x42')](_0x810d10[_0x86d3('0x2c')][_0x86d3('0x42')]));_0x369f68[_0x86d3('0x2f')]=_0x369f68['attributes'][_0x86d3('0x30')]?_0x369f68[_0x86d3('0x2f')]:_0xcf6c9e['model'];if(_0x810d10[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x369f68[_0x86d3('0x3c')]=[{'all':!![]}];}_0x369f68=_[_0x86d3('0x38')]({},_0x369f68,_0x810d10[_0x86d3('0x3a')]);return db['AnalyticDefaultReport'][_0x86d3('0x43')](_0x369f68)[_0x86d3('0x1f')](handleEntityNotFound(_0x5dfae8,null))[_0x86d3('0x1f')](respondWithResult(_0x5dfae8,null))[_0x86d3('0x44')](handleError(_0x5dfae8,null));};exports[_0x86d3('0x45')]=function(_0x7af7b3,_0x1a4345){return db[_0x86d3('0x3d')][_0x86d3('0x45')](_0x7af7b3[_0x86d3('0x46')],{})[_0x86d3('0x1f')](function(_0x1236ea){var _0x4ea940=_0x7af7b3[_0x86d3('0x47')][_0x86d3('0x20')]({'plain':!![]});if(!_0x4ea940)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ea940[_0x86d3('0x48')]===_0x86d3('0x47')){var _0x197047=_0x1236ea[_0x86d3('0x20')]({'plain':!![]});var _0x1dcff0=_0x86d3('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x1dcff0,'userProfileId':_0x4ea940['userProfileId']},'raw':!![]})['then'](function(_0x159253){if(_0x159253&&_0x159253[_0x86d3('0x4a')]===0x0){return db[_0x86d3('0x4b')][_0x86d3('0x45')]({'name':_0x197047[_0x86d3('0x24')],'resourceId':_0x197047['id'],'type':_0x86d3('0x4c'),'sectionId':_0x159253['id']},{})[_0x86d3('0x1f')](function(){return _0x1236ea;});}else{return _0x1236ea;}})['catch'](function(_0x2afb07){logger[_0x86d3('0x22')](_0x86d3('0x4d'),_0x2afb07);throw _0x2afb07;});}return _0x1236ea;})[_0x86d3('0x1f')](respondWithResult(_0x1a4345,0xc9))[_0x86d3('0x44')](handleError(_0x1a4345,null));};exports[_0x86d3('0x1e')]=function(_0x34935f,_0x4c8828){if(_0x34935f[_0x86d3('0x46')]['id']){delete _0x34935f['body']['id'];}return db[_0x86d3('0x3d')][_0x86d3('0x43')]({'where':{'id':_0x34935f[_0x86d3('0x4e')]['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4c8828,null))[_0x86d3('0x1f')](saveUpdates(_0x34935f['body'],null))[_0x86d3('0x1f')](respondWithResult(_0x4c8828,null))[_0x86d3('0x44')](handleError(_0x4c8828,null));};exports[_0x86d3('0x21')]=function(_0x4e10d9,_0x4ad164){return db['AnalyticDefaultReport'][_0x86d3('0x43')]({'where':{'id':_0x4e10d9['params']['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4ad164,null))[_0x86d3('0x1f')](removeEntity(_0x4ad164,null))[_0x86d3('0x44')](handleError(_0x4ad164,null));};exports[_0x86d3('0x4f')]=function(_0x5963bb,_0x4cd835){var _0x551806=0xa;var _0x28655a=[_0x86d3('0x50'),'left_join',_0x86d3('0x51'),_0x86d3('0x52')];var _0xa085b2={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x86d3('0x59')};var _0x41fad7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x86d3('0x5a'),'HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':_0x86d3('0x5d')};var _0x4598d4=function(_0x4029a4){return!_[_0x86d3('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x86d3('0x5f'),'IS\x20NOT\x20EMPTY'],_0x4029a4);};var _0x528ca8=function(_0x58e4b6){if(!_0x58e4b6||!_0x58e4b6[_0x86d3('0x60')]['length']){return'';}for(var _0x254ac3='(',_0x5f2ed6=0x0;_0x5f2ed6<_0x58e4b6[_0x86d3('0x60')][_0x86d3('0x30')];_0x5f2ed6+=0x1){_0x5f2ed6>0x0&&(_0x254ac3+='\x20'+_0x58e4b6[_0x86d3('0x61')]+'\x20');_0x254ac3+=_0x58e4b6['rules'][_0x5f2ed6]['group']?_0x528ca8(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x62')]):_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x63')]+'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')]+(_0x4598d4(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')])?'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x65')]:'');}return _0x254ac3+')';};var _0x1e3479={'where':{'id':_0x5963bb[_0x86d3('0x4e')]['id']}},_0x265beb,_0xfaf168,_0xf0dbbb,_0x3f978c,_0x5e1835;_0x1e3479=_[_0x86d3('0x38')]({},_0x1e3479,_0x5963bb['options']);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x1e3479)[_0x86d3('0x1f')](function(_0x52dc99){if(_0x52dc99){_0x265beb=_0x52dc99;return _0x52dc99[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x45e8d9){if(_0x45e8d9){if(!_0x45e8d9[_0x86d3('0x30')]){throw new db['Sequelize'][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xfaf168=_0x45e8d9;return db[_0x86d3('0x68')][_0x86d3('0x3e')]({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2d4bc1){if(_0x2d4bc1){_0xf0dbbb=_[_0x86d3('0x69')](_0x2d4bc1,'id');var _0x56fd96;var _0x3cc1d8=squel['select']();_0x3cc1d8[_0x86d3('0x6a')](_0x265beb[_0x86d3('0x6b')]);for(var _0x5866fe=0x0;_0x5866fe<_0xfaf168[_0x86d3('0x30')];_0x5866fe+=0x1){_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6c')]?_0xf0dbbb[_0xfaf168[_0x5866fe][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0xfaf168[_0x5866fe][_0x86d3('0x63')];_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0xa085b2[_0xfaf168[_0x5866fe]['function']],'%s',_0x56fd96):_0x56fd96;_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x41fad7[_0xfaf168[_0x5866fe][_0x86d3('0x70')]],'%s',_0x56fd96):_0x56fd96;if(_0xfaf168[_0x5866fe][_0x86d3('0x71')]){_0x3cc1d8[_0x86d3('0x62')](_0x56fd96);}_0xfaf168[_0x5866fe]['orderBy']&&_0x3cc1d8[_0x86d3('0x33')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x72')]==='DESC'?![]:!![]);_0x3cc1d8[_0x86d3('0x63')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x73')]||_0x56fd96);}if(_0x265beb[_0x86d3('0x74')]){_0x265beb[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x265beb[_0x86d3('0x74')]);for(var _0x1bf5ba=0x0;_0x1bf5ba<_0x265beb[_0x86d3('0x74')][_0x86d3('0x30')];_0x1bf5ba+=0x1){if(_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x28655a,_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')])&&_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba]['foreignKey']){_0x3cc1d8[_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]](_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x265beb[_0x86d3('0x6b')],_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')],_0x265beb['joins'][_0x1bf5ba]['foreignTable'],_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x78')]));}}}if(_0x265beb[_0x86d3('0x79')]){_0x265beb[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x265beb['conditions']);_0x3cc1d8[_0x86d3('0x35')](_0x528ca8(_0x265beb[_0x86d3('0x79')]['group']));}_0x5e1835=_0x3cc1d8[_0x86d3('0x7a')]();_0x3cc1d8[_0x86d3('0x1a')](_0x551806);_0x3cc1d8['offset'](0x0);logger[_0x86d3('0x7b')]('Limited\x20Query:',_0x3cc1d8[_0x86d3('0x7c')]());return dbH['sequelize']['query'](_0x3cc1d8[_0x86d3('0x7c')](),{'type':dbH['sequelize'][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})[_0x86d3('0x1f')](respondWithResult(_0x4cd835,null))[_0x86d3('0x44')](handleError(_0x4cd835,null));};function runReport(_0x3193d5,_0x3a1acc,_0x268c93){var _0x3b989c=_0x3a1acc['name'];var _0x245b39=0xa;var _0x158f56=[_0x86d3('0x50'),_0x86d3('0x7f'),_0x86d3('0x51'),'cross_join'];var _0x3d8b35={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xca2e0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1b503a=function(_0x24410c){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x24410c);};var _0x5f4a38=function(_0x593b85){if(!_0x593b85||!_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x3fac94='(',_0x28d98e=0x0;_0x28d98e<_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')];_0x28d98e+=0x1){_0x28d98e>0x0&&(_0x3fac94+='\x20'+_0x593b85['operator']+'\x20');_0x3fac94+=_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]?_0x5f4a38(_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]):_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x63')]+'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x64')]+(_0x1b503a(_0x593b85[_0x86d3('0x60')][_0x28d98e]['condition'])?'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x65')]:'');}return _0x3fac94+')';};var _0x4b871b={'where':{'id':_0x3193d5['id']}},_0x584a57,_0x36ee46,_0x1cbc3a,_0x682a6d,_0x5004cd;_0x4b871b=_[_0x86d3('0x38')]({},_0x4b871b,_0x268c93);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x4b871b)[_0x86d3('0x1f')](function(_0x3d3e7f){if(_0x3d3e7f){_0x584a57=_0x3d3e7f;return _0x3d3e7f['getFields']();}return null;})[_0x86d3('0x1f')](function(_0x1aaf08){if(_0x1aaf08){if(!_0x1aaf08['length']){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))](_0x86d3('0x86'),0x193);}_0x36ee46=_0x1aaf08;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2896e1){if(_0x2896e1){_0x1cbc3a=_[_0x86d3('0x69')](_0x2896e1,'id');var _0x18295c;var _0x44af1c=squel['select']();_0x44af1c[_0x86d3('0x6a')](_0x584a57[_0x86d3('0x6b')]);for(var _0x3582a2=0x0;_0x3582a2<_0x36ee46[_0x86d3('0x30')];_0x3582a2+=0x1){_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6c')]?_0x1cbc3a[_0x36ee46[_0x3582a2][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x36ee46[_0x3582a2][_0x86d3('0x63')];_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0x3d8b35[_0x36ee46[_0x3582a2]['function']],'%s',_0x18295c):_0x18295c;_0x18295c=_0x36ee46[_0x3582a2]['format']?_[_0x86d3('0x6f')](_0xca2e0[_0x36ee46[_0x3582a2][_0x86d3('0x70')]],'%s',_0x18295c):_0x18295c;if(_0x36ee46[_0x3582a2]['groupBy']){_0x44af1c[_0x86d3('0x62')](_0x18295c);}_0x36ee46[_0x3582a2][_0x86d3('0x72')]&&_0x44af1c[_0x86d3('0x33')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x72')]===_0x86d3('0x87')?![]:!![]);_0x44af1c[_0x86d3('0x63')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x73')]||_0x18295c);}if(_0x584a57[_0x86d3('0x74')]){_0x584a57[_0x86d3('0x74')]=JSON['parse'](_0x584a57['joins']);for(var _0x48a6d7=0x0;_0x48a6d7<_0x584a57['joins'][_0x86d3('0x30')];_0x48a6d7+=0x1){if(_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x158f56,_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')])&&_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey']&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x77')]&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x78')]){_0x44af1c[_0x584a57['joins'][_0x48a6d7][_0x86d3('0x29')]](_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],null,util[_0x86d3('0x70')](_0x86d3('0x88'),_0x584a57[_0x86d3('0x6b')],_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey'],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x78')]));}}}if(_0x584a57['conditions']){_0x584a57[_0x86d3('0x79')]=JSON['parse'](_0x584a57['conditions']);_0x44af1c[_0x86d3('0x35')](_0x5f4a38(_0x584a57[_0x86d3('0x79')][_0x86d3('0x62')]));}_0x5004cd=_0x44af1c[_0x86d3('0x7a')]();_0x44af1c[_0x86d3('0x1a')](_0x245b39);_0x44af1c[_0x86d3('0x18')](0x0);return;}})[_0x86d3('0x1f')](function(){if(_0x3a1acc[_0x86d3('0x89')]===_0x86d3('0x8a')){return null;}var _0x120a85=_[_0x86d3('0x38')](_0x3a1acc,{'name':_0x3a1acc[_0x86d3('0x8b')]||_0x3a1acc[_0x86d3('0x24')]||_0x584a57[_0x86d3('0x24')],'basename':_0x3b989c,'savename':util[_0x86d3('0x70')]('%s-%s.%s',_0x3a1acc['name']||_0x584a57['name'],require(_0x86d3('0x8c'))[_0x86d3('0x8d')](0x4),_0x3a1acc[_0x86d3('0x89')]||_0x86d3('0x8e')),'reportId':_0x584a57['id'],'reportType':_0x86d3('0x8f')});return db[_0x86d3('0x90')][_0x86d3('0x45')](_0x120a85,{'raw':!![]});})[_0x86d3('0x1f')](function(_0x10e23d){if(_0x584a57[_0x86d3('0x6b')]===_0x86d3('0x91')){_0x5004cd['where'](_0x584a57[_0x86d3('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}else{_0x5004cd[_0x86d3('0x35')](_0x584a57[_0x86d3('0x6b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}if(_0x10e23d){logger[_0x86d3('0x94')](_0x86d3('0x95'),_0x5004cd[_0x86d3('0x7c')]());require(_0x86d3('0x96'))[_0x86d3('0x97')](path[_0x86d3('0x50')](__dirname,_0x86d3('0x98'),_0x10e23d[_0x86d3('0x89')]),[_0x10e23d['id'],_0x5004cd[_0x86d3('0x7c')](),path[_0x86d3('0x50')](__dirname,_0x86d3('0x99'),_0x10e23d[_0x86d3('0x9a')]),_0x3b989c]);return _0x10e23d;}else{var _0x428b11=squel[_0x86d3('0x9b')]();_0x428b11[_0x86d3('0x6a')]('('+_0x5004cd['toString']()+')',_0x86d3('0x9c'));_0x428b11[_0x86d3('0x63')](_0x86d3('0x9d'),_0x86d3('0x1b'));_0x5004cd['limit'](_0x3a1acc[_0x86d3('0x1a')]||_0x245b39);_0x5004cd['offset'](_0x3a1acc['offset']||0x0);return dbH[_0x86d3('0x9e')][_0x86d3('0x2c')](_0x428b11[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]})[_0x86d3('0x1f')](function(_0x4777f1){if(!_0x4777f1['length']){_0x682a6d=0x0;}else{_0x682a6d=_0x4777f1[0x0]['count']||0x0;}return dbH['sequelize'][_0x86d3('0x2c')](_0x5004cd[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')]['QueryTypes'][_0x86d3('0x7e')]});})['then'](function(_0x435b8e){return{'rows':_0x435b8e||[],'count':_0x682a6d};});}});}exports[_0x86d3('0x9f')]=function(_0x73b8e6,_0x2c98e1){return runReport(_0x73b8e6['params'],_0x73b8e6[_0x86d3('0x2c')],_0x73b8e6[_0x86d3('0x3a')])[_0x86d3('0x1f')](respondWithResult(_0x2c98e1,null))['catch'](handleError(_0x2c98e1,null));};exports['runReport']=runReport;exports['query']=function(_0x458997,_0x1e3559){var _0x49a101=0xa;var _0x38d724=['join',_0x86d3('0x7f'),_0x86d3('0x51'),_0x86d3('0x52')];var _0x56ff91={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f347e={'SEC_TO_TIME':_0x86d3('0xa0'),'DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x45b210=function(_0x144e43){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x144e43);};var _0xdc7c21=function(_0x2e0397){if(!_0x2e0397||!_0x2e0397[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x2cc617='(',_0x25339c=0x0;_0x25339c<_0x2e0397['rules'][_0x86d3('0x30')];_0x25339c+=0x1){_0x25339c>0x0&&(_0x2cc617+='\x20'+_0x2e0397[_0x86d3('0x61')]+'\x20');_0x2cc617+=_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]?_0xdc7c21(_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]):_0x2e0397['rules'][_0x25339c][_0x86d3('0x63')]+'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x64')]+(_0x45b210(_0x2e0397[_0x86d3('0x60')][_0x25339c]['condition'])?'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x65')]:'');}return _0x2cc617+')';};var _0x2c0070={'where':{'id':_0x458997[_0x86d3('0x4e')]['id']}},_0x31d436,_0x56e713,_0x525559,_0x3b9e1e,_0x1d8d7c;_0x2c0070=_['merge']({},_0x2c0070,_0x458997[_0x86d3('0x3a')]);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x2c0070)[_0x86d3('0x1f')](function(_0x1f80be){if(_0x1f80be){_0x31d436=_0x1f80be;return _0x1f80be[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x3dddbe){if(_0x3dddbe){if(!_0x3dddbe[_0x86d3('0x30')]){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x56e713=_0x3dddbe;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1d7e83){if(_0x1d7e83){_0x525559=_[_0x86d3('0x69')](_0x1d7e83,'id');var _0x5d9385;var _0x49a499=squel[_0x86d3('0x9b')]();_0x49a499[_0x86d3('0x6a')](_0x31d436[_0x86d3('0x6b')]);for(var _0x33e0a5=0x0;_0x33e0a5<_0x56e713['length'];_0x33e0a5+=0x1){_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6c')]?_0x525559[_0x56e713[_0x33e0a5][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x56e713[_0x33e0a5][_0x86d3('0x63')];_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6e')]?_['replace'](_0x56ff91[_0x56e713[_0x33e0a5][_0x86d3('0x6e')]],'%s',_0x5d9385):_0x5d9385;_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x1f347e[_0x56e713[_0x33e0a5]['format']],'%s',_0x5d9385):_0x5d9385;if(_0x56e713[_0x33e0a5][_0x86d3('0x71')]){_0x49a499['group'](_0x5d9385);}_0x56e713[_0x33e0a5][_0x86d3('0x72')]&&_0x49a499[_0x86d3('0x33')](_0x5d9385,_0x56e713[_0x33e0a5]['orderBy']===_0x86d3('0x87')?![]:!![]);_0x49a499[_0x86d3('0x63')](_0x5d9385,_0x56e713[_0x33e0a5][_0x86d3('0x73')]||_0x5d9385);}if(_0x31d436[_0x86d3('0x74')]){_0x31d436[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x31d436['joins']);for(var _0x10af91=0x0;_0x10af91<_0x31d436['joins'][_0x86d3('0x30')];_0x10af91+=0x1){if(_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x38d724,_0x31d436['joins'][_0x10af91][_0x86d3('0x29')])&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')]&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x77')]&&_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignKey']){_0x49a499[_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]](_0x31d436['joins'][_0x10af91]['foreignTable'],null,util[_0x86d3('0x70')]('%s.%s\x20=\x20%s.%s',_0x31d436['table'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')],_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignTable'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x78')]));}}}if(_0x31d436[_0x86d3('0x79')]){_0x31d436[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x31d436['conditions']);_0x49a499[_0x86d3('0x35')](_0xdc7c21(_0x31d436[_0x86d3('0x79')]['group']));}_0x1d8d7c=_0x49a499['clone']();_0x49a499['limit'](_0x49a101);_0x49a499[_0x86d3('0x18')](0x0);logger['debug']('Limited\x20Query:',_0x49a499[_0x86d3('0x7c')]());return dbH[_0x86d3('0x9e')]['query'](_0x49a499['toString'](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})['then'](function(){return{'sql':_0x1d8d7c[_0x86d3('0x7c')]()};})[_0x86d3('0x1f')](respondWithResult(_0x1e3559,null))[_0x86d3('0x44')](handleError(_0x1e3559,null));}; \ No newline at end of file +var _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0xffa654,_0x4c734){var _0x5dd847=function(_0x64173a){while(--_0x64173a){_0xffa654['push'](_0xffa654['shift']());}};_0x5dd847(++_0x4c734);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xc4aa[_0x51020b];return _0x371e47;};'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'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 693b5ab..4abd5da 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 _0x5012=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','lodash'];(function(_0x411d4b,_0x8ce248){var _0x3ef5c3=function(_0x2f48cc){while(--_0x2f48cc){_0x411d4b['push'](_0x411d4b['shift']());}};_0x3ef5c3(++_0x8ce248);}(_0x5012,0x1d5));var _0x2501=function(_0x58952f,_0xeed25f){_0x58952f=_0x58952f-0x0;var _0x3217ca=_0x5012[_0x58952f];return _0x3217ca;};'use strict';var _=require(_0x2501('0x0'));var util=require(_0x2501('0x1'));var logger=require(_0x2501('0x2'))(_0x2501('0x3'));var moment=require(_0x2501('0x4'));var BPromise=require(_0x2501('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2501('0x6'));var rimraf=require(_0x2501('0x7'));var config=require(_0x2501('0x8'));var attributes=require('./analyticDefaultReport.attributes');module[_0x2501('0x9')]=function(_0xbfd47e,_0x36d490){return _0xbfd47e['define']('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6867=['define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports'];(function(_0x158da6,_0x3cb06d){var _0x429c30=function(_0x2d5895){while(--_0x2d5895){_0x158da6['push'](_0x158da6['shift']());}};_0x429c30(++_0x3cb06d);}(_0x6867,0xd4));var _0x7686=function(_0x513405,_0x4278e0){_0x513405=_0x513405-0x0;var _0x2a0613=_0x6867[_0x513405];return _0x2a0613;};'use strict';var _=require('lodash');var util=require(_0x7686('0x0'));var logger=require(_0x7686('0x1'))(_0x7686('0x2'));var moment=require('moment');var BPromise=require(_0x7686('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7686('0x4'));var config=require(_0x7686('0x5'));var attributes=require(_0x7686('0x6'));module[_0x7686('0x7')]=function(_0x221c9d,_0x2510c1){return _0x221c9d[_0x7686('0x8')](_0x7686('0x9'),attributes,{'tableName':_0x7686('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 975077e..c2ce132 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 _0xfab0=['message','catch','lodash','util','moment','bluebird','rpc','jayson/promise','http','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x4b00e0,_0x47026d){var _0x51b813=function(_0x38dfad){while(--_0x38dfad){_0x4b00e0['push'](_0x4b00e0['shift']());}};_0x51b813(++_0x47026d);}(_0xfab0,0x146));var _0x0fab=function(_0x7b102d,_0x414b58){_0x7b102d=_0x7b102d-0x0;var _0x235e07=_0xfab0[_0x7b102d];return _0x235e07;};'use strict';var _=require(_0x0fab('0x0'));var util=require(_0x0fab('0x1'));var moment=require(_0x0fab('0x2'));var BPromise=require(_0x0fab('0x3'));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')(_0x0fab('0x4'));var config=require('../../config/environment');var jayson=require(_0x0fab('0x5'));var client=jayson['client'][_0x0fab('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2209a5,_0x44ee1a,_0xe7691c){return new BPromise(function(_0x17af88,_0x11ddde){return client['request'](_0x2209a5,_0xe7691c)[_0x0fab('0x7')](function(_0x35c465){logger[_0x0fab('0x8')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x44ee1a,_0x0fab('0x9'));logger[_0x0fab('0xa')](_0x0fab('0xb'),_0x44ee1a,_0x0fab('0x9'),JSON[_0x0fab('0xc')](_0x35c465));if(_0x35c465['error']){if(_0x35c465[_0x0fab('0xd')][_0x0fab('0xe')]===0x1f4){logger['error'](_0x0fab('0xf'),_0x44ee1a,_0x35c465[_0x0fab('0xd')][_0x0fab('0x10')]);return _0x11ddde(_0x35c465['error'][_0x0fab('0x10')]);}logger[_0x0fab('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x44ee1a,_0x35c465[_0x0fab('0xd')][_0x0fab('0x10')]);return _0x17af88(_0x35c465[_0x0fab('0xd')]['message']);}else{logger[_0x0fab('0x8')](_0x0fab('0xf'),_0x44ee1a,_0x0fab('0x9'));_0x17af88(_0x35c465['result'][_0x0fab('0x10')]);}})[_0x0fab('0x11')](function(_0x2e3bf0){logger[_0x0fab('0xd')](_0x0fab('0xf'),_0x44ee1a,_0x2e3bf0);_0x11ddde(_0x2e3bf0);});});} \ No newline at end of file +var _0x1d03=['rpc','../../config/environment','jayson/promise','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x2923b6,_0x25b8b4){var _0x22408b=function(_0x5ca58a){while(--_0x5ca58a){_0x2923b6['push'](_0x2923b6['shift']());}};_0x22408b(++_0x25b8b4);}(_0x1d03,0xbf));var _0x31d0=function(_0x44bd9e,_0x52179d){_0x44bd9e=_0x44bd9e-0x0;var _0x20d641=_0x1d03[_0x44bd9e];return _0x20d641;};'use strict';var _=require(_0x31d0('0x0'));var util=require(_0x31d0('0x1'));var moment=require('moment');var BPromise=require(_0x31d0('0x2'));var rs=require(_0x31d0('0x3'));var fs=require('fs');var Redis=require(_0x31d0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x31d0('0x5'));var logger=require(_0x31d0('0x6'))(_0x31d0('0x7'));var config=require(_0x31d0('0x8'));var jayson=require(_0x31d0('0x9'));var client=jayson['client'][_0x31d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17b251,_0x5ddfa6,_0x129e95){return new BPromise(function(_0x51be75,_0x45cc57){return client['request'](_0x17b251,_0x129e95)[_0x31d0('0xb')](function(_0x316c8d){logger[_0x31d0('0xc')](_0x31d0('0xd'),_0x5ddfa6,_0x31d0('0xe'));logger[_0x31d0('0xf')](_0x31d0('0x10'),_0x5ddfa6,_0x31d0('0xe'),JSON[_0x31d0('0x11')](_0x316c8d));if(_0x316c8d['error']){if(_0x316c8d[_0x31d0('0x12')]['code']===0x1f4){logger[_0x31d0('0x12')](_0x31d0('0xd'),_0x5ddfa6,_0x316c8d[_0x31d0('0x12')][_0x31d0('0x13')]);return _0x45cc57(_0x316c8d[_0x31d0('0x12')]['message']);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x5ddfa6,_0x316c8d['error']['message']);return _0x51be75(_0x316c8d[_0x31d0('0x12')][_0x31d0('0x13')]);}else{logger['info'](_0x31d0('0xd'),_0x5ddfa6,_0x31d0('0xe'));_0x51be75(_0x316c8d[_0x31d0('0x14')]['message']);}})[_0x31d0('0x15')](function(_0x1cc19c){logger['error'](_0x31d0('0xd'),_0x5ddfa6,_0x1cc19c);_0x45cc57(_0x1cc19c);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 7e02583..289a6fd 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 _0xf59d=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','run','post','put','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x575d7d,_0x323ffd){var _0x27c2b7=function(_0x4bd492){while(--_0x4bd492){_0x575d7d['push'](_0x575d7d['shift']());}};_0x27c2b7(++_0x323ffd);}(_0xf59d,0x95));var _0xdf59=function(_0x12aa98,_0x39916d){_0x12aa98=_0x12aa98-0x0;var _0x42935f=_0xf59d[_0x12aa98];return _0x42935f;};'use strict';var multer=require(_0xdf59('0x0'));var util=require(_0xdf59('0x1'));var path=require(_0xdf59('0x2'));var timeout=require(_0xdf59('0x3'));var express=require('express');var router=express[_0xdf59('0x4')]();var fs_extra=require(_0xdf59('0x5'));var auth=require(_0xdf59('0x6'));var interaction=require(_0xdf59('0x7'));var config=require(_0xdf59('0x8'));var controller=require(_0xdf59('0x9'));router['get']('/',auth[_0xdf59('0xa')](),controller[_0xdf59('0xb')]);router[_0xdf59('0xc')](_0xdf59('0xd'),auth[_0xdf59('0xa')](),controller[_0xdf59('0xe')]);router['get'](_0xdf59('0xf'),auth['isAuthenticated'](),controller[_0xdf59('0x10')]);router[_0xdf59('0xc')]('/:id/run',auth[_0xdf59('0xa')](),controller[_0xdf59('0x11')]);router['get']('/:id/query',auth[_0xdf59('0xa')](),controller['query']);router[_0xdf59('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdf59('0x13')](_0xdf59('0xd'),auth[_0xdf59('0xa')](),controller['update']);router['delete'](_0xdf59('0xd'),auth['isAuthenticated'](),controller[_0xdf59('0x14')]);module[_0xdf59('0x15')]=router; \ No newline at end of file +var _0x5958=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','query','post','create','put','delete','destroy','exports','multer','util'];(function(_0x5c0f69,_0x2d4746){var _0x1a18ff=function(_0x388477){while(--_0x388477){_0x5c0f69['push'](_0x5c0f69['shift']());}};_0x1a18ff(++_0x2d4746);}(_0x5958,0x14e));var _0x8595=function(_0x1e4f2d,_0x22e2bb){_0x1e4f2d=_0x1e4f2d-0x0;var _0xd05ce5=_0x5958[_0x1e4f2d];return _0xd05ce5;};'use strict';var multer=require(_0x8595('0x0'));var util=require(_0x8595('0x1'));var path=require(_0x8595('0x2'));var timeout=require(_0x8595('0x3'));var express=require(_0x8595('0x4'));var router=express[_0x8595('0x5')]();var fs_extra=require(_0x8595('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8595('0x7'));var config=require(_0x8595('0x8'));var controller=require('./analyticDefaultReport.controller');router[_0x8595('0x9')]('/',auth[_0x8595('0xa')](),controller[_0x8595('0xb')]);router[_0x8595('0x9')](_0x8595('0xc'),auth[_0x8595('0xa')](),controller[_0x8595('0xd')]);router[_0x8595('0x9')](_0x8595('0xe'),auth[_0x8595('0xa')](),controller[_0x8595('0xf')]);router[_0x8595('0x9')](_0x8595('0x10'),auth[_0x8595('0xa')](),controller['run']);router[_0x8595('0x9')]('/:id/query',auth[_0x8595('0xa')](),controller[_0x8595('0x11')]);router[_0x8595('0x12')]('/',auth['isAuthenticated'](),controller[_0x8595('0x13')]);router[_0x8595('0x14')]('/:id',auth[_0x8595('0xa')](),controller['update']);router[_0x8595('0x15')](_0x8595('0xc'),auth[_0x8595('0xa')](),controller[_0x8595('0x16')]);module[_0x8595('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index f08c863..694e174 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 _0x2515=['moment','exports','STRING','pdf','xlsx','DATE','Loading','scheduled','sequelize'];(function(_0x4ca288,_0x254dd8){var _0x2362c1=function(_0x5504d8){while(--_0x5504d8){_0x4ca288['push'](_0x4ca288['shift']());}};_0x2362c1(++_0x254dd8);}(_0x2515,0xbc));var _0x5251=function(_0x554a48,_0x3b0b29){_0x554a48=_0x554a48-0x0;var _0x4cd1dc=_0x2515[_0x554a48];return _0x4cd1dc;};'use strict';var Sequelize=require(_0x5251('0x0'));var moment=require(_0x5251('0x1'));module[_0x5251('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x5251('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0x5251('0x4'),_0x5251('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x5251('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x5251('0x6')]},'endDate':{'type':Sequelize[_0x5251('0x6')]},'status':{'type':Sequelize[_0x5251('0x3')],'defaultValue':_0x5251('0x7')},'type':{'type':Sequelize['ENUM']('manual',_0x5251('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x5251('0x3')]}}; \ No newline at end of file +var _0xabf9=['STRING','pdf','xlsx','csv','DATE','Loading','manual','INTEGER','moment','exports'];(function(_0x287f72,_0x4e37db){var _0x4ad9c9=function(_0x13e909){while(--_0x13e909){_0x287f72['push'](_0x287f72['shift']());}};_0x4ad9c9(++_0x4e37db);}(_0xabf9,0x94));var _0x9abf=function(_0x2666b7,_0x5e6e98){_0x2666b7=_0x2666b7-0x0;var _0x53ea7d=_0xabf9[_0x2666b7];return _0x53ea7d;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9abf('0x0'));module[_0x9abf('0x1')]={'name':{'type':Sequelize[_0x9abf('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x9abf('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0x9abf('0x3'),_0x9abf('0x4')),'allowNull':![],'defaultValue':_0x9abf('0x5')},'savename':{'type':Sequelize[_0x9abf('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x9abf('0x6')]},'endDate':{'type':Sequelize[_0x9abf('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x9abf('0x7')},'type':{'type':Sequelize['ENUM'](_0x9abf('0x8'),'scheduled'),'allowNull':![],'defaultValue':_0x9abf('0x8')},'reportId':{'type':Sequelize[_0x9abf('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x9abf('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index b0f6d3c..66484ef 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 _0x4b49=['rows','show','params','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','download','output','join','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','error','name','send','map','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','options','AnalyticExtractedReport','includeAll','include','findAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b49,0x7a));var _0x94b4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b49[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x94b4('0x0'));var rimraf=require(_0x94b4('0x1'));var zipdir=require(_0x94b4('0x2'));var jsonpatch=require(_0x94b4('0x3'));var rp=require('request-promise');var moment=require(_0x94b4('0x4'));var BPromise=require(_0x94b4('0x5'));var Mustache=require(_0x94b4('0x6'));var util=require('util');var path=require('path');var sox=require(_0x94b4('0x7'));var csv=require('to-csv');var ejs=require(_0x94b4('0x8'));var fs=require('fs');var fs_extra=require(_0x94b4('0x9'));var _=require(_0x94b4('0xa'));var squel=require(_0x94b4('0xb'));var crypto=require(_0x94b4('0xc'));var jsforce=require(_0x94b4('0xd'));var deskjs=require(_0x94b4('0xe'));var toCsv=require(_0x94b4('0xf'));var querystring=require(_0x94b4('0x10'));var Papa=require(_0x94b4('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x94b4('0x12'));var as=require(_0x94b4('0x13'));var hardwareService=require(_0x94b4('0x14'));var logger=require(_0x94b4('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x94b4('0x16'));var licenseUtil=require(_0x94b4('0x17'));var db=require(_0x94b4('0x18'))['db'];function respondWithStatusCode(_0x2cc60c,_0x2a4077){_0x2a4077=_0x2a4077||0xcc;return function(_0x15eb42){if(_0x15eb42){return _0x2cc60c[_0x94b4('0x19')](_0x2a4077);}return _0x2cc60c[_0x94b4('0x1a')](_0x2a4077)[_0x94b4('0x1b')]();};}function respondWithResult(_0x2bcba5,_0x5c1084){_0x5c1084=_0x5c1084||0xc8;return function(_0x1008bf){if(_0x1008bf){return _0x2bcba5[_0x94b4('0x1a')](_0x5c1084)[_0x94b4('0x1c')](_0x1008bf);}};}function respondWithFilteredResult(_0x2b132d,_0x59170c){return function(_0x12e07c){if(_0x12e07c){var _0x262ead=typeof _0x59170c['offset']===_0x94b4('0x1d')&&typeof _0x59170c['limit']===_0x94b4('0x1d');var _0x4fd8b8=_0x12e07c[_0x94b4('0x1e')];var _0x369256=_0x262ead?0x0:_0x59170c[_0x94b4('0x1f')];var _0x3606f1=_0x262ead?_0x12e07c[_0x94b4('0x1e')]:_0x59170c[_0x94b4('0x1f')]+_0x59170c['limit'];var _0x26036e;if(_0x3606f1>=_0x4fd8b8){_0x3606f1=_0x4fd8b8;_0x26036e=0xc8;}else{_0x26036e=0xce;}_0x2b132d[_0x94b4('0x1a')](_0x26036e);return _0x2b132d[_0x94b4('0x20')]('Content-Range',_0x369256+'-'+_0x3606f1+'/'+_0x4fd8b8)[_0x94b4('0x1c')](_0x12e07c);}return null;};}function patchUpdates(_0x193887){return function(_0x4ff2db){try{jsonpatch['apply'](_0x4ff2db,_0x193887,!![]);}catch(_0x527512){return BPromise[_0x94b4('0x21')](_0x527512);}return _0x4ff2db[_0x94b4('0x22')]();};}function saveUpdates(_0x10da32,_0x40acf1){return function(_0x42e578){if(_0x42e578){return _0x42e578['update'](_0x10da32)[_0x94b4('0x23')](function(_0x7ebdfc){return _0x7ebdfc;});}return null;};}function removeEntity(_0x591c34,_0x4ba7ca){return function(_0x5d2eea){if(_0x5d2eea){return _0x5d2eea[_0x94b4('0x24')]()['then'](function(){var _0x4436d0=_0x5d2eea[_0x94b4('0x25')]({'plain':!![]});var _0x2b2c12=_0x94b4('0x26');return db[_0x94b4('0x27')][_0x94b4('0x24')]({'where':{'type':_0x2b2c12,'resourceId':_0x4436d0['id']}})['then'](function(){return _0x5d2eea;});})[_0x94b4('0x23')](function(){_0x591c34[_0x94b4('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d22d1,_0x5d3d41){return function(_0x162ec1){if(!_0x162ec1){_0x1d22d1[_0x94b4('0x19')](0x194);}return _0x162ec1;};}function handleError(_0x343bf4,_0x11751c){_0x11751c=_0x11751c||0x1f4;return function(_0x11e7d3){logger[_0x94b4('0x28')](_0x11e7d3['stack']);if(_0x11e7d3[_0x94b4('0x29')]){delete _0x11e7d3[_0x94b4('0x29')];}_0x343bf4[_0x94b4('0x1a')](_0x11751c)[_0x94b4('0x2a')](_0x11e7d3);};}exports['index']=function(_0x30e580,_0x176f94){var _0x2688f5={},_0x14c0ff={},_0x3bd818={'count':0x0,'rows':[]};var _0x56ff5a=_[_0x94b4('0x2b')](db['AnalyticExtractedReport']['rawAttributes'],function(_0xecde76){return{'name':_0xecde76['fieldName'],'type':_0xecde76['type'][_0x94b4('0x2c')]};});_0x14c0ff[_0x94b4('0x2d')]=_['map'](_0x56ff5a,_0x94b4('0x29'));_0x14c0ff['query']=_[_0x94b4('0x2e')](_0x30e580[_0x94b4('0x2f')]);_0x14c0ff[_0x94b4('0x30')]=_[_0x94b4('0x31')](_0x14c0ff[_0x94b4('0x2d')],_0x14c0ff['query']);_0x2688f5[_0x94b4('0x32')]=_[_0x94b4('0x31')](_0x14c0ff[_0x94b4('0x2d')],qs[_0x94b4('0x33')](_0x30e580['query'][_0x94b4('0x33')]));_0x2688f5['attributes']=_0x2688f5['attributes'][_0x94b4('0x34')]?_0x2688f5[_0x94b4('0x32')]:_0x14c0ff['model'];if(!_0x30e580[_0x94b4('0x2f')]['hasOwnProperty'](_0x94b4('0x35'))){_0x2688f5[_0x94b4('0x36')]=qs[_0x94b4('0x36')](_0x30e580[_0x94b4('0x2f')][_0x94b4('0x36')]);_0x2688f5[_0x94b4('0x1f')]=qs[_0x94b4('0x1f')](_0x30e580[_0x94b4('0x2f')][_0x94b4('0x1f')]);}_0x2688f5[_0x94b4('0x37')]=qs[_0x94b4('0x38')](_0x30e580['query'][_0x94b4('0x38')]);_0x2688f5[_0x94b4('0x39')]=qs[_0x94b4('0x30')](_['pick'](_0x30e580[_0x94b4('0x2f')],_0x14c0ff[_0x94b4('0x30')]),_0x56ff5a);if(_0x30e580[_0x94b4('0x2f')]['filter']){_0x2688f5['where']=_[_0x94b4('0x3a')](_0x2688f5['where'],{'$or':_[_0x94b4('0x2b')](_0x56ff5a,function(_0x2203b5){if(_0x2203b5['type']!==_0x94b4('0x3b')){var _0x3edf35={};_0x3edf35[_0x2203b5[_0x94b4('0x29')]]={'$like':'%'+_0x30e580[_0x94b4('0x2f')][_0x94b4('0x3c')]+'%'};return _0x3edf35;}})});}_0x2688f5=_['merge']({},_0x2688f5,_0x30e580[_0x94b4('0x3d')]);var _0x30364d={'where':_0x2688f5[_0x94b4('0x39')]};return db[_0x94b4('0x3e')][_0x94b4('0x1e')](_0x30364d)['then'](function(_0xc314){_0x3bd818['count']=_0xc314;if(_0x30e580['query'][_0x94b4('0x3f')]){_0x2688f5[_0x94b4('0x40')]=[{'all':!![]}];}return db[_0x94b4('0x3e')][_0x94b4('0x41')](_0x2688f5);})[_0x94b4('0x23')](function(_0x1a5b60){_0x3bd818[_0x94b4('0x42')]=_0x1a5b60;return _0x3bd818;})[_0x94b4('0x23')](respondWithFilteredResult(_0x176f94,_0x2688f5))['catch'](handleError(_0x176f94,null));};exports[_0x94b4('0x43')]=function(_0x5dff6f,_0x451a96){var _0x28961e={'raw':!![],'where':{'id':_0x5dff6f[_0x94b4('0x44')]['id']}},_0x57d9bf={};_0x57d9bf[_0x94b4('0x2d')]=_['keys'](db[_0x94b4('0x3e')][_0x94b4('0x45')]);_0x57d9bf[_0x94b4('0x2f')]=_[_0x94b4('0x2e')](_0x5dff6f[_0x94b4('0x2f')]);_0x57d9bf[_0x94b4('0x30')]=_['intersection'](_0x57d9bf[_0x94b4('0x2d')],_0x57d9bf[_0x94b4('0x2f')]);_0x28961e[_0x94b4('0x32')]=_['intersection'](_0x57d9bf[_0x94b4('0x2d')],qs[_0x94b4('0x33')](_0x5dff6f[_0x94b4('0x2f')][_0x94b4('0x33')]));_0x28961e[_0x94b4('0x32')]=_0x28961e[_0x94b4('0x32')][_0x94b4('0x34')]?_0x28961e[_0x94b4('0x32')]:_0x57d9bf[_0x94b4('0x2d')];if(_0x5dff6f[_0x94b4('0x2f')]['includeAll']){_0x28961e[_0x94b4('0x40')]=[{'all':!![]}];}_0x28961e=_[_0x94b4('0x3a')]({},_0x28961e,_0x5dff6f[_0x94b4('0x3d')]);return db['AnalyticExtractedReport'][_0x94b4('0x46')](_0x28961e)[_0x94b4('0x23')](handleEntityNotFound(_0x451a96,null))[_0x94b4('0x23')](respondWithResult(_0x451a96,null))[_0x94b4('0x47')](handleError(_0x451a96,null));};exports['create']=function(_0xd9198,_0x242cb7){return db[_0x94b4('0x3e')][_0x94b4('0x48')](_0xd9198[_0x94b4('0x49')],{})[_0x94b4('0x23')](function(_0x4bf816){var _0x1f0426=_0xd9198[_0x94b4('0x4a')]['get']({'plain':!![]});if(!_0x1f0426)throw new Error(_0x94b4('0x4b'));if(_0x1f0426[_0x94b4('0x4c')]===_0x94b4('0x4a')){var _0x2a8976=_0x4bf816[_0x94b4('0x25')]({'plain':!![]});var _0x1e4c6e=_0x94b4('0x26');return db[_0x94b4('0x4d')][_0x94b4('0x46')]({'where':{'name':_0x1e4c6e,'userProfileId':_0x1f0426[_0x94b4('0x4e')]},'raw':!![]})[_0x94b4('0x23')](function(_0x44088c){if(_0x44088c&&_0x44088c[_0x94b4('0x4f')]===0x0){return db[_0x94b4('0x27')][_0x94b4('0x48')]({'name':_0x2a8976[_0x94b4('0x29')],'resourceId':_0x2a8976['id'],'type':_0x44088c[_0x94b4('0x29')],'sectionId':_0x44088c['id']},{})[_0x94b4('0x23')](function(){return _0x4bf816;});}else{return _0x4bf816;}})['catch'](function(_0x4627f3){logger[_0x94b4('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4627f3);throw _0x4627f3;});}return _0x4bf816;})[_0x94b4('0x23')](respondWithResult(_0x242cb7,0xc9))[_0x94b4('0x47')](handleError(_0x242cb7,null));};exports[_0x94b4('0x50')]=function(_0x1b2ffd,_0x30b597){if(_0x1b2ffd[_0x94b4('0x49')]['id']){delete _0x1b2ffd['body']['id'];}return db[_0x94b4('0x3e')][_0x94b4('0x46')]({'where':{'id':_0x1b2ffd[_0x94b4('0x44')]['id']}})[_0x94b4('0x23')](handleEntityNotFound(_0x30b597,null))[_0x94b4('0x23')](saveUpdates(_0x1b2ffd[_0x94b4('0x49')],null))[_0x94b4('0x23')](respondWithResult(_0x30b597,null))[_0x94b4('0x47')](handleError(_0x30b597,null));};exports[_0x94b4('0x24')]=function(_0x3d022b,_0x51dbf2){return db[_0x94b4('0x3e')][_0x94b4('0x46')]({'where':{'id':_0x3d022b[_0x94b4('0x44')]['id']}})[_0x94b4('0x23')](handleEntityNotFound(_0x51dbf2,null))[_0x94b4('0x23')](removeEntity(_0x51dbf2,null))[_0x94b4('0x47')](handleError(_0x51dbf2,null));};exports[_0x94b4('0x51')]=function(_0x41ebef,_0x4ca106,_0x395c76){return db[_0x94b4('0x3e')][_0x94b4('0x46')]({'where':{'id':_0x41ebef[_0x94b4('0x44')]['id']},'attributes':[_0x94b4('0x29'),'basename','savename',_0x94b4('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x4ca106,null))[_0x94b4('0x23')](function(_0x1bcd40){if(_0x1bcd40){if(!fs['existsSync'](path[_0x94b4('0x53')](config[_0x94b4('0x54')],_0x94b4('0x55'),_0x1bcd40[_0x94b4('0x56')]))){throw new db[(_0x94b4('0x57'))][(_0x94b4('0x58'))](_0x94b4('0x59'));}if(_0x41ebef[_0x94b4('0x2f')][_0x94b4('0x5a')]){return _0x4ca106[_0x94b4('0x19')](0xc8);}return _0x4ca106[_0x94b4('0x51')](path[_0x94b4('0x53')](config['root'],_0x94b4('0x55'),_0x1bcd40[_0x94b4('0x56')]),util[_0x94b4('0x5b')](_0x94b4('0x5c'),_0x1bcd40['basename']||_0x1bcd40[_0x94b4('0x29')],_0x1bcd40['output'][_0x94b4('0x5d')]()));}})[_0x94b4('0x47')](handleError(_0x4ca106,null));}; \ No newline at end of file +var _0x1bd6=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','ExtractedReports','UserProfileResource','then','error','stack','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','includeAll','findAll','rows','show','params','length','include','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','existsSync','join','root','server/files/reports','savename','Sequelize','ValidationError','exists','format','%s.%s','toLowerCase','rimraf','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x1bd6,0xac));var _0x61bd=function(_0x45c42a,_0x4f00d3){_0x45c42a=_0x45c42a-0x0;var _0x4b99a5=_0x1bd6[_0x45c42a];return _0x4b99a5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x61bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x61bd('0x1'));var rp=require(_0x61bd('0x2'));var moment=require(_0x61bd('0x3'));var BPromise=require(_0x61bd('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x61bd('0x5'));var ejs=require(_0x61bd('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x61bd('0x7'));var crypto=require('crypto');var jsforce=require(_0x61bd('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x61bd('0x9'));var Papa=require('papaparse');var Redis=require(_0x61bd('0xa'));var authService=require(_0x61bd('0xb'));var qs=require(_0x61bd('0xc'));var as=require(_0x61bd('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x61bd('0xe'))(_0x61bd('0xf'));var utils=require('../../config/utils');var config=require(_0x61bd('0x10'));var licenseUtil=require(_0x61bd('0x11'));var db=require(_0x61bd('0x12'))['db'];function respondWithStatusCode(_0x2cd3bd,_0x2fd310){_0x2fd310=_0x2fd310||0xcc;return function(_0x11bc09){if(_0x11bc09){return _0x2cd3bd[_0x61bd('0x13')](_0x2fd310);}return _0x2cd3bd[_0x61bd('0x14')](_0x2fd310)[_0x61bd('0x15')]();};}function respondWithResult(_0xc54cff,_0x471f5f){_0x471f5f=_0x471f5f||0xc8;return function(_0x2d0921){if(_0x2d0921){return _0xc54cff[_0x61bd('0x14')](_0x471f5f)[_0x61bd('0x16')](_0x2d0921);}};}function respondWithFilteredResult(_0x396821,_0x2534d5){return function(_0x36e7b7){if(_0x36e7b7){var _0x342afd=typeof _0x2534d5[_0x61bd('0x17')]===_0x61bd('0x18')&&typeof _0x2534d5[_0x61bd('0x19')]===_0x61bd('0x18');var _0x9f330e=_0x36e7b7[_0x61bd('0x1a')];var _0xc72fb9=_0x342afd?0x0:_0x2534d5[_0x61bd('0x17')];var _0x326c43=_0x342afd?_0x36e7b7['count']:_0x2534d5[_0x61bd('0x17')]+_0x2534d5[_0x61bd('0x19')];var _0x519d4c;if(_0x326c43>=_0x9f330e){_0x326c43=_0x9f330e;_0x519d4c=0xc8;}else{_0x519d4c=0xce;}_0x396821[_0x61bd('0x14')](_0x519d4c);return _0x396821[_0x61bd('0x1b')](_0x61bd('0x1c'),_0xc72fb9+'-'+_0x326c43+'/'+_0x9f330e)['json'](_0x36e7b7);}return null;};}function patchUpdates(_0x44ca76){return function(_0x77ddb8){try{jsonpatch[_0x61bd('0x1d')](_0x77ddb8,_0x44ca76,!![]);}catch(_0x1c4e0b){return BPromise[_0x61bd('0x1e')](_0x1c4e0b);}return _0x77ddb8[_0x61bd('0x1f')]();};}function saveUpdates(_0x1c39a0,_0x2a47cf){return function(_0x333ecc){if(_0x333ecc){return _0x333ecc[_0x61bd('0x20')](_0x1c39a0)['then'](function(_0x33b88b){return _0x33b88b;});}return null;};}function removeEntity(_0x4ab153,_0x2daa8a){return function(_0x2ead33){if(_0x2ead33){return _0x2ead33[_0x61bd('0x21')]()['then'](function(){var _0x1dc2f3=_0x2ead33[_0x61bd('0x22')]({'plain':!![]});var _0x307ac2=_0x61bd('0x23');return db[_0x61bd('0x24')][_0x61bd('0x21')]({'where':{'type':_0x307ac2,'resourceId':_0x1dc2f3['id']}})[_0x61bd('0x25')](function(){return _0x2ead33;});})['then'](function(){_0x4ab153[_0x61bd('0x14')](0xcc)[_0x61bd('0x15')]();});}};}function handleEntityNotFound(_0x12ec3b,_0x418ed6){return function(_0x24c541){if(!_0x24c541){_0x12ec3b[_0x61bd('0x13')](0x194);}return _0x24c541;};}function handleError(_0xf6bf08,_0x70d03f){_0x70d03f=_0x70d03f||0x1f4;return function(_0x31fca0){logger[_0x61bd('0x26')](_0x31fca0[_0x61bd('0x27')]);if(_0x31fca0[_0x61bd('0x28')]){delete _0x31fca0[_0x61bd('0x28')];}_0xf6bf08[_0x61bd('0x14')](_0x70d03f)[_0x61bd('0x29')](_0x31fca0);};}exports['index']=function(_0x4b6675,_0x23cf53){var _0x4157bb={},_0x530602={},_0x5b6cb9={'count':0x0,'rows':[]};var _0x57606c=_[_0x61bd('0x2a')](db[_0x61bd('0x2b')][_0x61bd('0x2c')],function(_0x317eb1){return{'name':_0x317eb1[_0x61bd('0x2d')],'type':_0x317eb1[_0x61bd('0x2e')]['key']};});_0x530602[_0x61bd('0x2f')]=_[_0x61bd('0x2a')](_0x57606c,_0x61bd('0x28'));_0x530602[_0x61bd('0x30')]=_[_0x61bd('0x31')](_0x4b6675['query']);_0x530602['filters']=_[_0x61bd('0x32')](_0x530602[_0x61bd('0x2f')],_0x530602[_0x61bd('0x30')]);_0x4157bb[_0x61bd('0x33')]=_['intersection'](_0x530602[_0x61bd('0x2f')],qs[_0x61bd('0x34')](_0x4b6675[_0x61bd('0x30')][_0x61bd('0x34')]));_0x4157bb[_0x61bd('0x33')]=_0x4157bb[_0x61bd('0x33')]['length']?_0x4157bb[_0x61bd('0x33')]:_0x530602[_0x61bd('0x2f')];if(!_0x4b6675[_0x61bd('0x30')]['hasOwnProperty'](_0x61bd('0x35'))){_0x4157bb[_0x61bd('0x19')]=qs['limit'](_0x4b6675[_0x61bd('0x30')][_0x61bd('0x19')]);_0x4157bb[_0x61bd('0x17')]=qs[_0x61bd('0x17')](_0x4b6675[_0x61bd('0x30')]['offset']);}_0x4157bb[_0x61bd('0x36')]=qs[_0x61bd('0x37')](_0x4b6675['query']['sort']);_0x4157bb['where']=qs['filters'](_[_0x61bd('0x38')](_0x4b6675[_0x61bd('0x30')],_0x530602[_0x61bd('0x39')]),_0x57606c);if(_0x4b6675[_0x61bd('0x30')][_0x61bd('0x3a')]){_0x4157bb[_0x61bd('0x3b')]=_[_0x61bd('0x3c')](_0x4157bb[_0x61bd('0x3b')],{'$or':_['map'](_0x57606c,function(_0x5a3129){if(_0x5a3129[_0x61bd('0x2e')]!==_0x61bd('0x3d')){var _0x358828={};_0x358828[_0x5a3129[_0x61bd('0x28')]]={'$like':'%'+_0x4b6675[_0x61bd('0x30')][_0x61bd('0x3a')]+'%'};return _0x358828;}})});}_0x4157bb=_[_0x61bd('0x3c')]({},_0x4157bb,_0x4b6675['options']);var _0x37f559={'where':_0x4157bb[_0x61bd('0x3b')]};return db['AnalyticExtractedReport']['count'](_0x37f559)[_0x61bd('0x25')](function(_0x251e76){_0x5b6cb9[_0x61bd('0x1a')]=_0x251e76;if(_0x4b6675[_0x61bd('0x30')][_0x61bd('0x3e')]){_0x4157bb['include']=[{'all':!![]}];}return db[_0x61bd('0x2b')][_0x61bd('0x3f')](_0x4157bb);})[_0x61bd('0x25')](function(_0xd640fe){_0x5b6cb9[_0x61bd('0x40')]=_0xd640fe;return _0x5b6cb9;})[_0x61bd('0x25')](respondWithFilteredResult(_0x23cf53,_0x4157bb))['catch'](handleError(_0x23cf53,null));};exports[_0x61bd('0x41')]=function(_0x2040f3,_0x221764){var _0x50c50d={'raw':!![],'where':{'id':_0x2040f3[_0x61bd('0x42')]['id']}},_0x14cb5d={};_0x14cb5d[_0x61bd('0x2f')]=_[_0x61bd('0x31')](db[_0x61bd('0x2b')]['rawAttributes']);_0x14cb5d['query']=_['keys'](_0x2040f3[_0x61bd('0x30')]);_0x14cb5d[_0x61bd('0x39')]=_[_0x61bd('0x32')](_0x14cb5d['model'],_0x14cb5d[_0x61bd('0x30')]);_0x50c50d[_0x61bd('0x33')]=_[_0x61bd('0x32')](_0x14cb5d[_0x61bd('0x2f')],qs[_0x61bd('0x34')](_0x2040f3[_0x61bd('0x30')][_0x61bd('0x34')]));_0x50c50d[_0x61bd('0x33')]=_0x50c50d[_0x61bd('0x33')][_0x61bd('0x43')]?_0x50c50d[_0x61bd('0x33')]:_0x14cb5d[_0x61bd('0x2f')];if(_0x2040f3[_0x61bd('0x30')]['includeAll']){_0x50c50d[_0x61bd('0x44')]=[{'all':!![]}];}_0x50c50d=_[_0x61bd('0x3c')]({},_0x50c50d,_0x2040f3[_0x61bd('0x45')]);return db['AnalyticExtractedReport'][_0x61bd('0x46')](_0x50c50d)['then'](handleEntityNotFound(_0x221764,null))[_0x61bd('0x25')](respondWithResult(_0x221764,null))[_0x61bd('0x47')](handleError(_0x221764,null));};exports[_0x61bd('0x48')]=function(_0x38a974,_0x1d1b27){return db[_0x61bd('0x2b')][_0x61bd('0x48')](_0x38a974[_0x61bd('0x49')],{})[_0x61bd('0x25')](function(_0x55e3e5){var _0x57e9d7=_0x38a974[_0x61bd('0x4a')][_0x61bd('0x22')]({'plain':!![]});if(!_0x57e9d7)throw new Error(_0x61bd('0x4b'));if(_0x57e9d7[_0x61bd('0x4c')]==='user'){var _0x16d46e=_0x55e3e5[_0x61bd('0x22')]({'plain':!![]});var _0x452b21=_0x61bd('0x23');return db[_0x61bd('0x4d')][_0x61bd('0x46')]({'where':{'name':_0x452b21,'userProfileId':_0x57e9d7[_0x61bd('0x4e')]},'raw':!![]})[_0x61bd('0x25')](function(_0x2ea40f){if(_0x2ea40f&&_0x2ea40f[_0x61bd('0x4f')]===0x0){return db[_0x61bd('0x24')][_0x61bd('0x48')]({'name':_0x16d46e[_0x61bd('0x28')],'resourceId':_0x16d46e['id'],'type':_0x2ea40f[_0x61bd('0x28')],'sectionId':_0x2ea40f['id']},{})[_0x61bd('0x25')](function(){return _0x55e3e5;});}else{return _0x55e3e5;}})[_0x61bd('0x47')](function(_0x5afa74){logger[_0x61bd('0x26')](_0x61bd('0x50'),_0x5afa74);throw _0x5afa74;});}return _0x55e3e5;})[_0x61bd('0x25')](respondWithResult(_0x1d1b27,0xc9))[_0x61bd('0x47')](handleError(_0x1d1b27,null));};exports[_0x61bd('0x20')]=function(_0x515d7e,_0x1a74c8){if(_0x515d7e[_0x61bd('0x49')]['id']){delete _0x515d7e[_0x61bd('0x49')]['id'];}return db[_0x61bd('0x2b')][_0x61bd('0x46')]({'where':{'id':_0x515d7e['params']['id']}})[_0x61bd('0x25')](handleEntityNotFound(_0x1a74c8,null))[_0x61bd('0x25')](saveUpdates(_0x515d7e['body'],null))[_0x61bd('0x25')](respondWithResult(_0x1a74c8,null))[_0x61bd('0x47')](handleError(_0x1a74c8,null));};exports[_0x61bd('0x21')]=function(_0x1660c0,_0x31e17e){return db[_0x61bd('0x2b')][_0x61bd('0x46')]({'where':{'id':_0x1660c0['params']['id']}})[_0x61bd('0x25')](handleEntityNotFound(_0x31e17e,null))['then'](removeEntity(_0x31e17e,null))[_0x61bd('0x47')](handleError(_0x31e17e,null));};exports[_0x61bd('0x51')]=function(_0x316c6a,_0x24071f,_0xf31164){return db[_0x61bd('0x2b')][_0x61bd('0x46')]({'where':{'id':_0x316c6a[_0x61bd('0x42')]['id']},'attributes':['name',_0x61bd('0x52'),'savename',_0x61bd('0x53')],'raw':!![]})[_0x61bd('0x25')](handleEntityNotFound(_0x24071f,null))[_0x61bd('0x25')](function(_0x33f828){if(_0x33f828){if(!fs[_0x61bd('0x54')](path[_0x61bd('0x55')](config[_0x61bd('0x56')],_0x61bd('0x57'),_0x33f828[_0x61bd('0x58')]))){throw new db[(_0x61bd('0x59'))][(_0x61bd('0x5a'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x316c6a['query'][_0x61bd('0x5b')]){return _0x24071f[_0x61bd('0x13')](0xc8);}return _0x24071f[_0x61bd('0x51')](path[_0x61bd('0x55')](config[_0x61bd('0x56')],_0x61bd('0x57'),_0x33f828[_0x61bd('0x58')]),util[_0x61bd('0x5c')](_0x61bd('0x5d'),_0x33f828[_0x61bd('0x52')]||_0x33f828[_0x61bd('0x28')],_0x33f828['output'][_0x61bd('0x5e')]()));}})[_0x61bd('0x47')](handleError(_0x24071f,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 5d79349..6ad1e84 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 _0x4d6e=['bluebird','request-promise','path','rimraf','exports','define','AnalyticExtractedReport','analytics_extracted_reports','moment'];(function(_0x284279,_0x3a075c){var _0x104feb=function(_0x36ec36){while(--_0x36ec36){_0x284279['push'](_0x284279['shift']());}};_0x104feb(++_0x3a075c);}(_0x4d6e,0x6b));var _0xe4d6=function(_0x4adff1,_0x4a8cbe){_0x4adff1=_0x4adff1-0x0;var _0x318759=_0x4d6e[_0x4adff1];return _0x318759;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xe4d6('0x0'));var BPromise=require(_0xe4d6('0x1'));var rp=require(_0xe4d6('0x2'));var fs=require('fs');var path=require(_0xe4d6('0x3'));var rimraf=require(_0xe4d6('0x4'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0xe4d6('0x5')]=function(_0x4c9cf4,_0x464396){return _0x4c9cf4[_0xe4d6('0x6')](_0xe4d6('0x7'),attributes,{'tableName':_0xe4d6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x150a=['request-promise','path','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash','util','../../config/logger','api'];(function(_0x24c0aa,_0x26c771){var _0x12ed2f=function(_0x1540b4){while(--_0x1540b4){_0x24c0aa['push'](_0x24c0aa['shift']());}};_0x12ed2f(++_0x26c771);}(_0x150a,0x1c8));var _0xa150=function(_0x3e509b,_0x31cbd1){_0x3e509b=_0x3e509b-0x0;var _0x13bc56=_0x150a[_0x3e509b];return _0x13bc56;};'use strict';var _=require(_0xa150('0x0'));var util=require(_0xa150('0x1'));var logger=require(_0xa150('0x2'))(_0xa150('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa150('0x4'));var fs=require('fs');var path=require(_0xa150('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa150('0x6'));module[_0xa150('0x7')]=function(_0x1ff768,_0x33a909){return _0x1ff768[_0xa150('0x8')]('AnalyticExtractedReport',attributes,{'tableName':_0xa150('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 50b8c2c..0704e4c 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 _0xee40=['jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x518e2f,_0x12f11f){var _0x2ae4d5=function(_0x2365be){while(--_0x2365be){_0x518e2f['push'](_0x518e2f['shift']());}};_0x2ae4d5(++_0x12f11f);}(_0xee40,0x85));var _0x0ee4=function(_0x2fb02d,_0xd65fdf){_0x2fb02d=_0x2fb02d-0x0;var _0x37d5f2=_0xee40[_0x2fb02d];return _0x37d5f2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0ee4('0x0'));var BPromise=require(_0x0ee4('0x1'));var rs=require(_0x0ee4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0ee4('0x3'))['db'];var utils=require(_0x0ee4('0x4'));var logger=require(_0x0ee4('0x5'))(_0x0ee4('0x6'));var config=require('../../config/environment');var jayson=require(_0x0ee4('0x7'));var client=jayson[_0x0ee4('0x8')][_0x0ee4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x462ab5,_0x3bbcb4,_0x3580d7){return new BPromise(function(_0x52b22c,_0x50be8b){return client[_0x0ee4('0xa')](_0x462ab5,_0x3580d7)[_0x0ee4('0xb')](function(_0x244f94){logger[_0x0ee4('0xc')](_0x0ee4('0xd'),_0x3bbcb4,_0x0ee4('0xe'));logger[_0x0ee4('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x3bbcb4,_0x0ee4('0xe'),JSON[_0x0ee4('0x10')](_0x244f94));if(_0x244f94[_0x0ee4('0x11')]){if(_0x244f94['error'][_0x0ee4('0x12')]===0x1f4){logger[_0x0ee4('0x11')](_0x0ee4('0xd'),_0x3bbcb4,_0x244f94['error']['message']);return _0x50be8b(_0x244f94[_0x0ee4('0x11')]['message']);}logger[_0x0ee4('0x11')](_0x0ee4('0xd'),_0x3bbcb4,_0x244f94[_0x0ee4('0x11')][_0x0ee4('0x13')]);return _0x52b22c(_0x244f94['error']['message']);}else{logger[_0x0ee4('0xc')](_0x0ee4('0xd'),_0x3bbcb4,'request\x20sent');_0x52b22c(_0x244f94['result'][_0x0ee4('0x13')]);}})['catch'](function(_0x41bfee){logger[_0x0ee4('0x11')](_0x0ee4('0xd'),_0x3bbcb4,_0x41bfee);_0x50be8b(_0x41bfee);});});} \ No newline at end of file +var _0x4408=['message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','request','then','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1d9cd5,_0x396067){var _0x491e92=function(_0x50b87a){while(--_0x50b87a){_0x1d9cd5['push'](_0x1d9cd5['shift']());}};_0x491e92(++_0x396067);}(_0x4408,0x1a6));var _0x8440=function(_0x347102,_0x18bdbd){_0x347102=_0x347102-0x0;var _0x907a8a=_0x4408[_0x347102];return _0x907a8a;};'use strict';var _=require(_0x8440('0x0'));var util=require(_0x8440('0x1'));var moment=require(_0x8440('0x2'));var BPromise=require(_0x8440('0x3'));var rs=require(_0x8440('0x4'));var fs=require('fs');var Redis=require(_0x8440('0x5'));var db=require(_0x8440('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x8440('0x7'));var jayson=require(_0x8440('0x8'));var client=jayson[_0x8440('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25d812,_0x1c6dfa,_0x6f78ea){return new BPromise(function(_0x4a5710,_0x5f1957){return client[_0x8440('0xa')](_0x25d812,_0x6f78ea)[_0x8440('0xb')](function(_0x4fc374){logger['info'](_0x8440('0xc'),_0x1c6dfa,'request\x20sent');logger[_0x8440('0xd')](_0x8440('0xe'),_0x1c6dfa,'request\x20sent',JSON[_0x8440('0xf')](_0x4fc374));if(_0x4fc374[_0x8440('0x10')]){if(_0x4fc374[_0x8440('0x10')][_0x8440('0x11')]===0x1f4){logger['error'](_0x8440('0xc'),_0x1c6dfa,_0x4fc374['error'][_0x8440('0x12')]);return _0x5f1957(_0x4fc374['error'][_0x8440('0x12')]);}logger[_0x8440('0x10')](_0x8440('0xc'),_0x1c6dfa,_0x4fc374[_0x8440('0x10')]['message']);return _0x4a5710(_0x4fc374[_0x8440('0x10')][_0x8440('0x12')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1c6dfa,_0x8440('0x13'));_0x4a5710(_0x4fc374[_0x8440('0x14')][_0x8440('0x12')]);}})[_0x8440('0x15')](function(_0x2ad60b){logger[_0x8440('0x10')](_0x8440('0xc'),_0x1c6dfa,_0x2ad60b);_0x5f1957(_0x2ad60b);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 3edd773..793337c 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 _0x7f43=['post','create','put','/:id','update','delete','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','isAuthenticated','index','get','show','/:id/download','download'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x7f43,0xe2));var _0x37f4=function(_0x1221e0,_0x46297b){_0x1221e0=_0x1221e0-0x0;var _0xb7cba2=_0x7f43[_0x1221e0];return _0xb7cba2;};'use strict';var multer=require(_0x37f4('0x0'));var util=require(_0x37f4('0x1'));var path=require(_0x37f4('0x2'));var timeout=require(_0x37f4('0x3'));var express=require(_0x37f4('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x37f4('0x5'));var interaction=require(_0x37f4('0x6'));var config=require('../../config/environment');var controller=require(_0x37f4('0x7'));router['get']('/',auth[_0x37f4('0x8')](),controller[_0x37f4('0x9')]);router[_0x37f4('0xa')]('/:id',auth[_0x37f4('0x8')](),controller[_0x37f4('0xb')]);router[_0x37f4('0xa')](_0x37f4('0xc'),auth[_0x37f4('0x8')](),controller[_0x37f4('0xd')]);router[_0x37f4('0xe')]('/',auth[_0x37f4('0x8')](),controller[_0x37f4('0xf')]);router[_0x37f4('0x10')](_0x37f4('0x11'),auth[_0x37f4('0x8')](),controller[_0x37f4('0x12')]);router[_0x37f4('0x13')](_0x37f4('0x11'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4411=['get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller'];(function(_0x3ad24f,_0x932305){var _0x2115a1=function(_0x213293){while(--_0x213293){_0x3ad24f['push'](_0x3ad24f['shift']());}};_0x2115a1(++_0x932305);}(_0x4411,0xe9));var _0x1441=function(_0x3b3508,_0x4e0b4e){_0x3b3508=_0x3b3508-0x0;var _0x185618=_0x4411[_0x3b3508];return _0x185618;};'use strict';var multer=require(_0x1441('0x0'));var util=require(_0x1441('0x1'));var path=require(_0x1441('0x2'));var timeout=require(_0x1441('0x3'));var express=require(_0x1441('0x4'));var router=express['Router']();var fs_extra=require(_0x1441('0x5'));var auth=require(_0x1441('0x6'));var interaction=require(_0x1441('0x7'));var config=require('../../config/environment');var controller=require(_0x1441('0x8'));router[_0x1441('0x9')]('/',auth[_0x1441('0xa')](),controller[_0x1441('0xb')]);router[_0x1441('0x9')](_0x1441('0xc'),auth[_0x1441('0xa')](),controller[_0x1441('0xd')]);router[_0x1441('0x9')](_0x1441('0xe'),auth[_0x1441('0xa')](),controller[_0x1441('0xf')]);router[_0x1441('0x10')]('/',auth[_0x1441('0xa')](),controller[_0x1441('0x11')]);router[_0x1441('0x12')](_0x1441('0xc'),auth[_0x1441('0xa')](),controller[_0x1441('0x13')]);router[_0x1441('0x14')](_0x1441('0xc'),auth[_0x1441('0xa')](),controller['destroy']);module[_0x1441('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index d0cf9d1..069d847 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 _0xebe7=['exports','STRING'];(function(_0x89a001,_0x3a9a8c){var _0x5f3ec2=function(_0x3e849b){while(--_0x3e849b){_0x89a001['push'](_0x89a001['shift']());}};_0x5f3ec2(++_0x3a9a8c);}(_0xebe7,0x19c));var _0x7ebe=function(_0x28fe6d,_0x48368a){_0x28fe6d=_0x28fe6d-0x0;var _0x191165=_0xebe7[_0x28fe6d];return _0x191165;};'use strict';var Sequelize=require('sequelize');module[_0x7ebe('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x7ebe('0x1')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x7ebe('0x1')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x7ebe('0x1')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x954a=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x4fbb2b,_0x2c866f){var _0xdc31ca=function(_0x2bdb8d){while(--_0x2bdb8d){_0x4fbb2b['push'](_0x4fbb2b['shift']());}};_0xdc31ca(++_0x2c866f);}(_0x954a,0x84));var _0xa954=function(_0x2a8459,_0xd62105){_0x2a8459=_0x2a8459-0x0;var _0x2e8f56=_0x954a[_0x2a8459];return _0x2e8f56;};'use strict';var Sequelize=require(_0xa954('0x0'));module[_0xa954('0x1')]={'field':{'type':Sequelize[_0xa954('0x2')]},'alias':{'type':Sequelize[_0xa954('0x3')]},'function':{'type':Sequelize[_0xa954('0x3')]},'format':{'type':Sequelize[_0xa954('0x3')]},'groupBy':{'type':Sequelize[_0xa954('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xa954('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 07b08f0..ff40819 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 _0x72d7=['count','set','apply','reject','update','then','destroy','end','sendStatus','name','send','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','AnalyticFieldReport','findAll','rows','catch','params','create','body','bulkCreate','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit'];(function(_0x17071d,_0x2b144c){var _0x49144c=function(_0x3081b3){while(--_0x3081b3){_0x17071d['push'](_0x17071d['shift']());}};_0x49144c(++_0x2b144c);}(_0x72d7,0x129));var _0x772d=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x72d7[_0x102e37];return _0x35a07c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x772d('0x0'));var jsonpatch=require(_0x772d('0x1'));var rp=require(_0x772d('0x2'));var moment=require('moment');var BPromise=require(_0x772d('0x3'));var Mustache=require(_0x772d('0x4'));var util=require(_0x772d('0x5'));var path=require(_0x772d('0x6'));var sox=require(_0x772d('0x7'));var csv=require(_0x772d('0x8'));var ejs=require(_0x772d('0x9'));var fs=require('fs');var fs_extra=require(_0x772d('0xa'));var _=require(_0x772d('0xb'));var squel=require(_0x772d('0xc'));var crypto=require(_0x772d('0xd'));var jsforce=require(_0x772d('0xe'));var deskjs=require(_0x772d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x772d('0x10'));var Papa=require(_0x772d('0x11'));var Redis=require(_0x772d('0x12'));var authService=require(_0x772d('0x13'));var qs=require(_0x772d('0x14'));var as=require(_0x772d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x772d('0x16'))('api');var utils=require(_0x772d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x772d('0x18'));var db=require(_0x772d('0x19'))['db'];function respondWithStatusCode(_0x565fef,_0x57021a){_0x57021a=_0x57021a||0xcc;return function(_0x135818){if(_0x135818){return _0x565fef['sendStatus'](_0x57021a);}return _0x565fef[_0x772d('0x1a')](_0x57021a)['end']();};}function respondWithResult(_0x34db05,_0x4e54ff){_0x4e54ff=_0x4e54ff||0xc8;return function(_0x2049c8){if(_0x2049c8){return _0x34db05['status'](_0x4e54ff)[_0x772d('0x1b')](_0x2049c8);}};}function respondWithFilteredResult(_0x523759,_0x32eeaa){return function(_0x5d7318){if(_0x5d7318){var _0x31d00=typeof _0x32eeaa[_0x772d('0x1c')]===_0x772d('0x1d')&&typeof _0x32eeaa[_0x772d('0x1e')]===_0x772d('0x1d');var _0x2753c4=_0x5d7318[_0x772d('0x1f')];var _0x45984c=_0x31d00?0x0:_0x32eeaa[_0x772d('0x1c')];var _0x65b713=_0x31d00?_0x5d7318[_0x772d('0x1f')]:_0x32eeaa[_0x772d('0x1c')]+_0x32eeaa[_0x772d('0x1e')];var _0x50d99b;if(_0x65b713>=_0x2753c4){_0x65b713=_0x2753c4;_0x50d99b=0xc8;}else{_0x50d99b=0xce;}_0x523759['status'](_0x50d99b);return _0x523759[_0x772d('0x20')]('Content-Range',_0x45984c+'-'+_0x65b713+'/'+_0x2753c4)[_0x772d('0x1b')](_0x5d7318);}return null;};}function patchUpdates(_0x29e8c9){return function(_0x4aea70){try{jsonpatch[_0x772d('0x21')](_0x4aea70,_0x29e8c9,!![]);}catch(_0x4a8bcc){return BPromise[_0x772d('0x22')](_0x4a8bcc);}return _0x4aea70['save']();};}function saveUpdates(_0x2bfa26,_0x1c9b67){return function(_0x67816c){if(_0x67816c){return _0x67816c[_0x772d('0x23')](_0x2bfa26)[_0x772d('0x24')](function(_0x4ad5de){return _0x4ad5de;});}return null;};}function removeEntity(_0x26a12b,_0x1386ad){return function(_0x218458){if(_0x218458){return _0x218458[_0x772d('0x25')]()[_0x772d('0x24')](function(){_0x26a12b[_0x772d('0x1a')](0xcc)[_0x772d('0x26')]();});}};}function handleEntityNotFound(_0x28f697,_0x16f710){return function(_0x34739e){if(!_0x34739e){_0x28f697[_0x772d('0x27')](0x194);}return _0x34739e;};}function handleError(_0x2d5991,_0x17b997){_0x17b997=_0x17b997||0x1f4;return function(_0x59e543){logger['error'](_0x59e543['stack']);if(_0x59e543[_0x772d('0x28')]){delete _0x59e543[_0x772d('0x28')];}_0x2d5991[_0x772d('0x1a')](_0x17b997)[_0x772d('0x29')](_0x59e543);};}exports['index']=function(_0x35bc77,_0x1a706b){var _0x54fe3b={},_0x8e93ff={},_0x14cb3f={'count':0x0,'rows':[]};var _0x485656=_[_0x772d('0x2a')](db['AnalyticFieldReport'][_0x772d('0x2b')],function(_0x2be1b0){return{'name':_0x2be1b0['fieldName'],'type':_0x2be1b0[_0x772d('0x2c')][_0x772d('0x2d')]};});_0x8e93ff[_0x772d('0x2e')]=_[_0x772d('0x2a')](_0x485656,'name');_0x8e93ff[_0x772d('0x2f')]=_[_0x772d('0x30')](_0x35bc77[_0x772d('0x2f')]);_0x8e93ff['filters']=_[_0x772d('0x31')](_0x8e93ff[_0x772d('0x2e')],_0x8e93ff[_0x772d('0x2f')]);_0x54fe3b[_0x772d('0x32')]=_[_0x772d('0x31')](_0x8e93ff[_0x772d('0x2e')],qs['fields'](_0x35bc77['query'][_0x772d('0x33')]));_0x54fe3b['attributes']=_0x54fe3b[_0x772d('0x32')][_0x772d('0x34')]?_0x54fe3b[_0x772d('0x32')]:_0x8e93ff[_0x772d('0x2e')];if(!_0x35bc77['query'][_0x772d('0x35')](_0x772d('0x36'))){_0x54fe3b[_0x772d('0x1e')]=qs[_0x772d('0x1e')](_0x35bc77[_0x772d('0x2f')][_0x772d('0x1e')]);_0x54fe3b[_0x772d('0x1c')]=qs[_0x772d('0x1c')](_0x35bc77[_0x772d('0x2f')][_0x772d('0x1c')]);}_0x54fe3b[_0x772d('0x37')]=qs['sort'](_0x35bc77[_0x772d('0x2f')][_0x772d('0x38')]);_0x54fe3b[_0x772d('0x39')]=qs[_0x772d('0x3a')](_[_0x772d('0x3b')](_0x35bc77['query'],_0x8e93ff[_0x772d('0x3a')]),_0x485656);if(_0x35bc77['query']['filter']){_0x54fe3b[_0x772d('0x39')]=_[_0x772d('0x3c')](_0x54fe3b[_0x772d('0x39')],{'$or':_[_0x772d('0x2a')](_0x485656,function(_0x3d6f48){if(_0x3d6f48['type']!==_0x772d('0x3d')){var _0x37f68c={};_0x37f68c[_0x3d6f48[_0x772d('0x28')]]={'$like':'%'+_0x35bc77['query'][_0x772d('0x3e')]+'%'};return _0x37f68c;}})});}_0x54fe3b=_[_0x772d('0x3c')]({},_0x54fe3b,_0x35bc77[_0x772d('0x3f')]);var _0x5db337={'where':_0x54fe3b[_0x772d('0x39')]};return db['AnalyticFieldReport'][_0x772d('0x1f')](_0x5db337)['then'](function(_0x11e27c){_0x14cb3f[_0x772d('0x1f')]=_0x11e27c;if(_0x35bc77[_0x772d('0x2f')][_0x772d('0x40')]){_0x54fe3b[_0x772d('0x41')]=[{'all':!![]}];}return db[_0x772d('0x42')][_0x772d('0x43')](_0x54fe3b);})[_0x772d('0x24')](function(_0x23b809){_0x14cb3f[_0x772d('0x44')]=_0x23b809;return _0x14cb3f;})[_0x772d('0x24')](respondWithFilteredResult(_0x1a706b,_0x54fe3b))[_0x772d('0x45')](handleError(_0x1a706b,null));};exports['show']=function(_0x5df00a,_0x421426){var _0x1a914d={'raw':![],'where':{'id':_0x5df00a[_0x772d('0x46')]['id']}},_0x5390ca={};_0x5390ca['model']=_[_0x772d('0x30')](db['AnalyticFieldReport']['rawAttributes']);_0x5390ca[_0x772d('0x2f')]=_['keys'](_0x5df00a[_0x772d('0x2f')]);_0x5390ca['filters']=_[_0x772d('0x31')](_0x5390ca[_0x772d('0x2e')],_0x5390ca[_0x772d('0x2f')]);_0x1a914d[_0x772d('0x32')]=_[_0x772d('0x31')](_0x5390ca[_0x772d('0x2e')],qs[_0x772d('0x33')](_0x5df00a[_0x772d('0x2f')][_0x772d('0x33')]));_0x1a914d[_0x772d('0x32')]=_0x1a914d[_0x772d('0x32')][_0x772d('0x34')]?_0x1a914d[_0x772d('0x32')]:_0x5390ca[_0x772d('0x2e')];if(_0x5df00a[_0x772d('0x2f')][_0x772d('0x40')]){_0x1a914d[_0x772d('0x41')]=[{'all':!![]}];}_0x1a914d=_[_0x772d('0x3c')]({},_0x1a914d,_0x5df00a[_0x772d('0x3f')]);return db[_0x772d('0x42')]['find'](_0x1a914d)['then'](handleEntityNotFound(_0x421426,null))[_0x772d('0x24')](respondWithResult(_0x421426,null))['catch'](handleError(_0x421426,null));};exports[_0x772d('0x47')]=function(_0x452944,_0x207a91){return db[_0x772d('0x42')][_0x772d('0x47')](_0x452944[_0x772d('0x48')],{})[_0x772d('0x24')](respondWithResult(_0x207a91,0xc9))[_0x772d('0x45')](handleError(_0x207a91,null));};exports[_0x772d('0x49')]=function(_0x2ff862,_0x137003){return db[_0x772d('0x42')][_0x772d('0x49')](_0x2ff862[_0x772d('0x48')],{'raw':![],'individualHooks':!![]})[_0x772d('0x24')](respondWithResult(_0x137003,0xc9))[_0x772d('0x45')](handleError(_0x137003,null));};exports['update']=function(_0x17763b,_0x534b6d){if(_0x17763b['body']['id']){delete _0x17763b[_0x772d('0x48')]['id'];}return db[_0x772d('0x42')][_0x772d('0x4a')]({'where':{'id':_0x17763b['params']['id']}})[_0x772d('0x24')](handleEntityNotFound(_0x534b6d,null))[_0x772d('0x24')](saveUpdates(_0x17763b[_0x772d('0x48')],null))['then'](respondWithResult(_0x534b6d,null))['catch'](handleError(_0x534b6d,null));};exports['destroy']=function(_0x2c4b83,_0x3fe2cf){return db[_0x772d('0x42')][_0x772d('0x4a')]({'where':{'id':_0x2c4b83['params']['id']}})[_0x772d('0x24')](handleEntityNotFound(_0x3fe2cf,null))[_0x772d('0x24')](removeEntity(_0x3fe2cf,null))[_0x772d('0x45')](handleError(_0x3fe2cf,null));};exports[_0x772d('0x4b')]=function(_0x343842,_0x5a375d){return db[_0x772d('0x42')][_0x772d('0x25')]({'where':{'id':_0x343842[_0x772d('0x2f')][_0x772d('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x772d('0x24')](respondWithResult(_0x5a375d,0xcc))['catch'](handleError(_0x5a375d,null));};exports[_0x772d('0x4d')]=function(_0x79c748,_0x544fd8,_0x5b1bd8){return db[_0x772d('0x4e')][_0x772d('0x4f')]({'where':{'id':_0x79c748[_0x772d('0x46')]['id']}})[_0x772d('0x24')](handleEntityNotFound(_0x544fd8,null))['then'](function(_0x49579){if(_0x49579){return db[_0x772d('0x50')][_0x772d('0x51')](function(_0x27241b){return db[_0x772d('0x42')]['destroy']({'where':{'CustomReportId':_0x79c748['params']['id']},'transaction':_0x27241b})[_0x772d('0x24')](function(_0x405872){var _0x31f058=_[_0x772d('0x2a')](_0x79c748['body'],function(_0x35a6c4){delete _0x35a6c4['id'];_0x35a6c4['CustomReportId']=_0x79c748[_0x772d('0x46')]['id'];return _0x35a6c4;});return db['AnalyticFieldReport'][_0x772d('0x49')](_0x31f058,{'transaction':_0x27241b});});})[_0x772d('0x24')](function(){return db['AnalyticFieldReport'][_0x772d('0x43')]({'where':{'CustomReportId':_0x79c748[_0x772d('0x46')]['id']}});});}})[_0x772d('0x24')](respondWithResult(_0x544fd8,null))[_0x772d('0x45')](handleError(_0x544fd8,null));}; \ No newline at end of file +var _0x7288=['key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','findAll','rows','catch','includeAll','include','find','create','body','bulkCreate','update','params','bulkDestroy','ids','AnalyticCustomReport','findOne','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','end','error','name','AnalyticFieldReport','rawAttributes'];(function(_0x3dde07,_0x2a4377){var _0x4de496=function(_0x5d5d69){while(--_0x5d5d69){_0x3dde07['push'](_0x3dde07['shift']());}};_0x4de496(++_0x2a4377);}(_0x7288,0x6e));var _0x8728=function(_0x577d6f,_0x47bf43){_0x577d6f=_0x577d6f-0x0;var _0x50cdac=_0x7288[_0x577d6f];return _0x50cdac;};'use strict';var emlformat=require(_0x8728('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8728('0x1'));var jsonpatch=require(_0x8728('0x2'));var rp=require(_0x8728('0x3'));var moment=require(_0x8728('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8728('0x5'));var util=require(_0x8728('0x6'));var path=require(_0x8728('0x7'));var sox=require(_0x8728('0x8'));var csv=require(_0x8728('0x9'));var ejs=require(_0x8728('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8728('0xb'));var squel=require(_0x8728('0xc'));var crypto=require(_0x8728('0xd'));var jsforce=require(_0x8728('0xe'));var deskjs=require(_0x8728('0xf'));var toCsv=require(_0x8728('0x9'));var querystring=require(_0x8728('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8728('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8728('0x12'));var config=require(_0x8728('0x13'));var licenseUtil=require(_0x8728('0x14'));var db=require(_0x8728('0x15'))['db'];function respondWithStatusCode(_0x5bef2f,_0x165cdc){_0x165cdc=_0x165cdc||0xcc;return function(_0x4a8fd0){if(_0x4a8fd0){return _0x5bef2f[_0x8728('0x16')](_0x165cdc);}return _0x5bef2f['status'](_0x165cdc)['end']();};}function respondWithResult(_0xc63bee,_0x39ebcb){_0x39ebcb=_0x39ebcb||0xc8;return function(_0x2e72c0){if(_0x2e72c0){return _0xc63bee[_0x8728('0x17')](_0x39ebcb)[_0x8728('0x18')](_0x2e72c0);}};}function respondWithFilteredResult(_0x561499,_0x1ad685){return function(_0x29abef){if(_0x29abef){var _0x46f268=typeof _0x1ad685[_0x8728('0x19')]===_0x8728('0x1a')&&typeof _0x1ad685[_0x8728('0x1b')]===_0x8728('0x1a');var _0x4ab85f=_0x29abef[_0x8728('0x1c')];var _0x36edeb=_0x46f268?0x0:_0x1ad685[_0x8728('0x19')];var _0x179fbb=_0x46f268?_0x29abef[_0x8728('0x1c')]:_0x1ad685[_0x8728('0x19')]+_0x1ad685[_0x8728('0x1b')];var _0x4ed220;if(_0x179fbb>=_0x4ab85f){_0x179fbb=_0x4ab85f;_0x4ed220=0xc8;}else{_0x4ed220=0xce;}_0x561499[_0x8728('0x17')](_0x4ed220);return _0x561499[_0x8728('0x1d')](_0x8728('0x1e'),_0x36edeb+'-'+_0x179fbb+'/'+_0x4ab85f)[_0x8728('0x18')](_0x29abef);}return null;};}function patchUpdates(_0x1210b2){return function(_0x316fdd){try{jsonpatch['apply'](_0x316fdd,_0x1210b2,!![]);}catch(_0x33cd02){return BPromise[_0x8728('0x1f')](_0x33cd02);}return _0x316fdd[_0x8728('0x20')]();};}function saveUpdates(_0x3e70ba,_0x4daf3d){return function(_0x372663){if(_0x372663){return _0x372663['update'](_0x3e70ba)[_0x8728('0x21')](function(_0x1716db){return _0x1716db;});}return null;};}function removeEntity(_0x4a1650,_0x111c8b){return function(_0x281b5a){if(_0x281b5a){return _0x281b5a[_0x8728('0x22')]()[_0x8728('0x21')](function(){_0x4a1650[_0x8728('0x17')](0xcc)[_0x8728('0x23')]();});}};}function handleEntityNotFound(_0x21ac76,_0x244e38){return function(_0x17113f){if(!_0x17113f){_0x21ac76[_0x8728('0x16')](0x194);}return _0x17113f;};}function handleError(_0x337155,_0x483900){_0x483900=_0x483900||0x1f4;return function(_0x3a44d9){logger[_0x8728('0x24')](_0x3a44d9['stack']);if(_0x3a44d9[_0x8728('0x25')]){delete _0x3a44d9[_0x8728('0x25')];}_0x337155[_0x8728('0x17')](_0x483900)['send'](_0x3a44d9);};}exports['index']=function(_0x3d30c2,_0x112ab9){var _0x5294d3={},_0x2e5138={},_0x48ab2a={'count':0x0,'rows':[]};var _0x19cfcf=_['map'](db[_0x8728('0x26')][_0x8728('0x27')],function(_0xe20adf){return{'name':_0xe20adf['fieldName'],'type':_0xe20adf['type'][_0x8728('0x28')]};});_0x2e5138[_0x8728('0x29')]=_['map'](_0x19cfcf,_0x8728('0x25'));_0x2e5138['query']=_[_0x8728('0x2a')](_0x3d30c2[_0x8728('0x2b')]);_0x2e5138[_0x8728('0x2c')]=_[_0x8728('0x2d')](_0x2e5138[_0x8728('0x29')],_0x2e5138[_0x8728('0x2b')]);_0x5294d3['attributes']=_[_0x8728('0x2d')](_0x2e5138['model'],qs[_0x8728('0x2e')](_0x3d30c2[_0x8728('0x2b')]['fields']));_0x5294d3[_0x8728('0x2f')]=_0x5294d3[_0x8728('0x2f')][_0x8728('0x30')]?_0x5294d3[_0x8728('0x2f')]:_0x2e5138['model'];if(!_0x3d30c2[_0x8728('0x2b')][_0x8728('0x31')](_0x8728('0x32'))){_0x5294d3[_0x8728('0x1b')]=qs[_0x8728('0x1b')](_0x3d30c2['query'][_0x8728('0x1b')]);_0x5294d3[_0x8728('0x19')]=qs[_0x8728('0x19')](_0x3d30c2['query'][_0x8728('0x19')]);}_0x5294d3[_0x8728('0x33')]=qs[_0x8728('0x34')](_0x3d30c2[_0x8728('0x2b')][_0x8728('0x34')]);_0x5294d3[_0x8728('0x35')]=qs[_0x8728('0x2c')](_['pick'](_0x3d30c2[_0x8728('0x2b')],_0x2e5138[_0x8728('0x2c')]),_0x19cfcf);if(_0x3d30c2[_0x8728('0x2b')][_0x8728('0x36')]){_0x5294d3['where']=_[_0x8728('0x37')](_0x5294d3[_0x8728('0x35')],{'$or':_[_0x8728('0x38')](_0x19cfcf,function(_0x5b1231){if(_0x5b1231['type']!==_0x8728('0x39')){var _0x3452ad={};_0x3452ad[_0x5b1231[_0x8728('0x25')]]={'$like':'%'+_0x3d30c2[_0x8728('0x2b')][_0x8728('0x36')]+'%'};return _0x3452ad;}})});}_0x5294d3=_['merge']({},_0x5294d3,_0x3d30c2[_0x8728('0x3a')]);var _0x227006={'where':_0x5294d3['where']};return db['AnalyticFieldReport'][_0x8728('0x1c')](_0x227006)['then'](function(_0x36344f){_0x48ab2a[_0x8728('0x1c')]=_0x36344f;if(_0x3d30c2[_0x8728('0x2b')]['includeAll']){_0x5294d3['include']=[{'all':!![]}];}return db[_0x8728('0x26')][_0x8728('0x3b')](_0x5294d3);})[_0x8728('0x21')](function(_0x2d16b9){_0x48ab2a[_0x8728('0x3c')]=_0x2d16b9;return _0x48ab2a;})['then'](respondWithFilteredResult(_0x112ab9,_0x5294d3))[_0x8728('0x3d')](handleError(_0x112ab9,null));};exports['show']=function(_0x36e6fa,_0x3704ec){var _0x55ade0={'raw':![],'where':{'id':_0x36e6fa['params']['id']}},_0x33991e={};_0x33991e[_0x8728('0x29')]=_['keys'](db[_0x8728('0x26')][_0x8728('0x27')]);_0x33991e[_0x8728('0x2b')]=_[_0x8728('0x2a')](_0x36e6fa[_0x8728('0x2b')]);_0x33991e[_0x8728('0x2c')]=_[_0x8728('0x2d')](_0x33991e['model'],_0x33991e[_0x8728('0x2b')]);_0x55ade0['attributes']=_[_0x8728('0x2d')](_0x33991e['model'],qs['fields'](_0x36e6fa[_0x8728('0x2b')][_0x8728('0x2e')]));_0x55ade0['attributes']=_0x55ade0[_0x8728('0x2f')]['length']?_0x55ade0[_0x8728('0x2f')]:_0x33991e['model'];if(_0x36e6fa[_0x8728('0x2b')][_0x8728('0x3e')]){_0x55ade0[_0x8728('0x3f')]=[{'all':!![]}];}_0x55ade0=_[_0x8728('0x37')]({},_0x55ade0,_0x36e6fa[_0x8728('0x3a')]);return db[_0x8728('0x26')][_0x8728('0x40')](_0x55ade0)['then'](handleEntityNotFound(_0x3704ec,null))[_0x8728('0x21')](respondWithResult(_0x3704ec,null))[_0x8728('0x3d')](handleError(_0x3704ec,null));};exports[_0x8728('0x41')]=function(_0x3a9886,_0x56e203){return db[_0x8728('0x26')]['create'](_0x3a9886[_0x8728('0x42')],{})['then'](respondWithResult(_0x56e203,0xc9))[_0x8728('0x3d')](handleError(_0x56e203,null));};exports[_0x8728('0x43')]=function(_0x850802,_0x3259d8){return db[_0x8728('0x26')]['bulkCreate'](_0x850802[_0x8728('0x42')],{'raw':![],'individualHooks':!![]})[_0x8728('0x21')](respondWithResult(_0x3259d8,0xc9))[_0x8728('0x3d')](handleError(_0x3259d8,null));};exports[_0x8728('0x44')]=function(_0x253af6,_0x2f24d7){if(_0x253af6['body']['id']){delete _0x253af6[_0x8728('0x42')]['id'];}return db['AnalyticFieldReport'][_0x8728('0x40')]({'where':{'id':_0x253af6[_0x8728('0x45')]['id']}})[_0x8728('0x21')](handleEntityNotFound(_0x2f24d7,null))[_0x8728('0x21')](saveUpdates(_0x253af6['body'],null))['then'](respondWithResult(_0x2f24d7,null))['catch'](handleError(_0x2f24d7,null));};exports['destroy']=function(_0x2f8d60,_0x50e4a0){return db['AnalyticFieldReport'][_0x8728('0x40')]({'where':{'id':_0x2f8d60[_0x8728('0x45')]['id']}})[_0x8728('0x21')](handleEntityNotFound(_0x50e4a0,null))[_0x8728('0x21')](removeEntity(_0x50e4a0,null))['catch'](handleError(_0x50e4a0,null));};exports[_0x8728('0x46')]=function(_0x3e9851,_0x511281){return db['AnalyticFieldReport'][_0x8728('0x22')]({'where':{'id':_0x3e9851['query'][_0x8728('0x47')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x511281,0xcc))[_0x8728('0x3d')](handleError(_0x511281,null));};exports['addFields']=function(_0x5baeea,_0x2af7ed,_0x3d41c9){return db[_0x8728('0x48')][_0x8728('0x49')]({'where':{'id':_0x5baeea[_0x8728('0x45')]['id']}})[_0x8728('0x21')](handleEntityNotFound(_0x2af7ed,null))[_0x8728('0x21')](function(_0xfb8eea){if(_0xfb8eea){return db['sequelize']['transaction'](function(_0x5082a8){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x5baeea['params']['id']},'transaction':_0x5082a8})[_0x8728('0x21')](function(_0x34bb77){var _0x5d1c00=_['map'](_0x5baeea[_0x8728('0x42')],function(_0x253ffa){delete _0x253ffa['id'];_0x253ffa[_0x8728('0x4a')]=_0x5baeea['params']['id'];return _0x253ffa;});return db[_0x8728('0x26')][_0x8728('0x43')](_0x5d1c00,{'transaction':_0x5082a8});});})[_0x8728('0x21')](function(){return db[_0x8728('0x26')][_0x8728('0x3b')]({'where':{'CustomReportId':_0x5baeea[_0x8728('0x45')]['id']}});});}})['then'](respondWithResult(_0x2af7ed,null))[_0x8728('0x3d')](handleError(_0x2af7ed,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 409fe6e..1099a35 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 _0x4f72=['exports','AnalyticFieldReport','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x1dfa46,_0x2223b3){var _0x33bdd8=function(_0x182c60){while(--_0x182c60){_0x1dfa46['push'](_0x1dfa46['shift']());}};_0x33bdd8(++_0x2223b3);}(_0x4f72,0x1ba));var _0x24f7=function(_0x1a0c37,_0x4d03dc){_0x1a0c37=_0x1a0c37-0x0;var _0x324283=_0x4f72[_0x1a0c37];return _0x324283;};'use strict';var _=require(_0x24f7('0x0'));var util=require(_0x24f7('0x1'));var logger=require(_0x24f7('0x2'))(_0x24f7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x24f7('0x4'));var rimraf=require(_0x24f7('0x5'));var config=require(_0x24f7('0x6'));var attributes=require(_0x24f7('0x7'));module[_0x24f7('0x8')]=function(_0x265094,_0x1a9a78){return _0x265094['define'](_0x24f7('0x9'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee9a=['exports','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x177fc7,_0x561e70){var _0x50cb2c=function(_0x34a9ad){while(--_0x34a9ad){_0x177fc7['push'](_0x177fc7['shift']());}};_0x50cb2c(++_0x561e70);}(_0xee9a,0x178));var _0xaee9=function(_0x4d19bc,_0x4df8b4){_0x4d19bc=_0x4d19bc-0x0;var _0x3c2206=_0xee9a[_0x4d19bc];return _0x3c2206;};'use strict';var _=require(_0xaee9('0x0'));var util=require('util');var logger=require(_0xaee9('0x1'))('api');var moment=require('moment');var BPromise=require(_0xaee9('0x2'));var rp=require(_0xaee9('0x3'));var fs=require('fs');var path=require(_0xaee9('0x4'));var rimraf=require(_0xaee9('0x5'));var config=require(_0xaee9('0x6'));var attributes=require(_0xaee9('0x7'));module[_0xaee9('0x8')]=function(_0x598d48,_0xf730e6){return _0x598d48[_0xaee9('0x9')](_0xaee9('0xa'),attributes,{'tableName':_0xaee9('0xb'),'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 31952f1..1ecf6a4 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 _0x2cb6=['error','code','message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1c4049,_0x2cf6ce){var _0x36e99a=function(_0x17809f){while(--_0x17809f){_0x1c4049['push'](_0x1c4049['shift']());}};_0x36e99a(++_0x2cf6ce);}(_0x2cb6,0x1b7));var _0x62cb=function(_0x58114f,_0x1a1397){_0x58114f=_0x58114f-0x0;var _0x51070e=_0x2cb6[_0x58114f];return _0x51070e;};'use strict';var _=require(_0x62cb('0x0'));var util=require(_0x62cb('0x1'));var moment=require(_0x62cb('0x2'));var BPromise=require(_0x62cb('0x3'));var rs=require(_0x62cb('0x4'));var fs=require('fs');var Redis=require(_0x62cb('0x5'));var db=require(_0x62cb('0x6'))['db'];var utils=require(_0x62cb('0x7'));var logger=require(_0x62cb('0x8'))(_0x62cb('0x9'));var config=require(_0x62cb('0xa'));var jayson=require(_0x62cb('0xb'));var client=jayson[_0x62cb('0xc')][_0x62cb('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x48334e,_0x47d311,_0x2dd61e){return new BPromise(function(_0x5b4b3c,_0x9415f8){return client[_0x62cb('0xe')](_0x48334e,_0x2dd61e)[_0x62cb('0xf')](function(_0x56a3cc){logger['info'](_0x62cb('0x10'),_0x47d311,'request\x20sent');logger[_0x62cb('0x11')](_0x62cb('0x12'),_0x47d311,'request\x20sent',JSON[_0x62cb('0x13')](_0x56a3cc));if(_0x56a3cc['error']){if(_0x56a3cc[_0x62cb('0x14')][_0x62cb('0x15')]===0x1f4){logger[_0x62cb('0x14')](_0x62cb('0x10'),_0x47d311,_0x56a3cc[_0x62cb('0x14')][_0x62cb('0x16')]);return _0x9415f8(_0x56a3cc[_0x62cb('0x14')][_0x62cb('0x16')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x47d311,_0x56a3cc[_0x62cb('0x14')][_0x62cb('0x16')]);return _0x5b4b3c(_0x56a3cc[_0x62cb('0x14')][_0x62cb('0x16')]);}else{logger[_0x62cb('0x17')](_0x62cb('0x10'),_0x47d311,_0x62cb('0x18'));_0x5b4b3c(_0x56a3cc[_0x62cb('0x19')]['message']);}})[_0x62cb('0x1a')](function(_0x554805){logger[_0x62cb('0x14')](_0x62cb('0x10'),_0x47d311,_0x554805);_0x9415f8(_0x554805);});});} \ No newline at end of file +var _0x12d1=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x3f4a31,_0x778ea8){var _0x3f62e3=function(_0x67e27a){while(--_0x67e27a){_0x3f4a31['push'](_0x3f4a31['shift']());}};_0x3f62e3(++_0x778ea8);}(_0x12d1,0x1f4));var _0x112d=function(_0x31d827,_0x4559d1){_0x31d827=_0x31d827-0x0;var _0x306565=_0x12d1[_0x31d827];return _0x306565;};'use strict';var _=require('lodash');var util=require(_0x112d('0x0'));var moment=require(_0x112d('0x1'));var BPromise=require(_0x112d('0x2'));var rs=require(_0x112d('0x3'));var fs=require('fs');var Redis=require(_0x112d('0x4'));var db=require(_0x112d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x112d('0x6'))(_0x112d('0x7'));var config=require(_0x112d('0x8'));var jayson=require(_0x112d('0x9'));var client=jayson[_0x112d('0xa')][_0x112d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x57f436,_0x35eb2d,_0xf6568a){return new BPromise(function(_0x4ffbdb,_0x5aee9d){return client[_0x112d('0xc')](_0x57f436,_0xf6568a)['then'](function(_0x5c755e){logger[_0x112d('0xd')](_0x112d('0xe'),_0x35eb2d,'request\x20sent');logger[_0x112d('0xf')](_0x112d('0x10'),_0x35eb2d,_0x112d('0x11'),JSON[_0x112d('0x12')](_0x5c755e));if(_0x5c755e[_0x112d('0x13')]){if(_0x5c755e[_0x112d('0x13')][_0x112d('0x14')]===0x1f4){logger['error'](_0x112d('0xe'),_0x35eb2d,_0x5c755e[_0x112d('0x13')]['message']);return _0x5aee9d(_0x5c755e[_0x112d('0x13')]['message']);}logger[_0x112d('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x35eb2d,_0x5c755e[_0x112d('0x13')][_0x112d('0x15')]);return _0x4ffbdb(_0x5c755e[_0x112d('0x13')]['message']);}else{logger[_0x112d('0xd')](_0x112d('0xe'),_0x35eb2d,'request\x20sent');_0x4ffbdb(_0x5c755e[_0x112d('0x16')][_0x112d('0x15')]);}})[_0x112d('0x17')](function(_0x3cfbbe){logger[_0x112d('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x35eb2d,_0x3cfbbe);_0x5aee9d(_0x3cfbbe);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index c2c12f3..43bca7d 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(_0x34048a,_0x1baddb){var _0x22e037=function(_0x54fbf8){while(--_0x54fbf8){_0x34048a['push'](_0x34048a['shift']());}};_0x22e037(++_0x1baddb);}(_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'));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(_0x2520bd,_0x3d3242){var _0x5c0855=function(_0x2b1313){while(--_0x2b1313){_0x2520bd['push'](_0x2520bd['shift']());}};_0x5c0855(++_0x3d3242);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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 a34c844..ac1cf39 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 _0x55ea=['TEXT','sequelize','exports','STRING'];(function(_0x2e5111,_0x5b8f9e){var _0x1174ec=function(_0xca9f23){while(--_0xca9f23){_0x2e5111['push'](_0x2e5111['shift']());}};_0x1174ec(++_0x5b8f9e);}(_0x55ea,0xc9));var _0xa55e=function(_0xf0a73d,_0x4bb71e){_0xf0a73d=_0xf0a73d-0x0;var _0x34ddbb=_0x55ea[_0xf0a73d];return _0x34ddbb;};'use strict';var Sequelize=require(_0xa55e('0x0'));module[_0xa55e('0x1')]={'name':{'type':Sequelize[_0xa55e('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xa55e('0x2')]},'metric':{'type':Sequelize[_0xa55e('0x3')]},'description':{'type':Sequelize[_0xa55e('0x2')]}}; \ No newline at end of file +var _0x77f1=['exports','STRING','name'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x77f1,0x1dd));var _0x177f=function(_0x38954b,_0x4a3682){_0x38954b=_0x38954b-0x0;var _0x2e26e6=_0x77f1[_0x38954b];return _0x2e26e6;};'use strict';var Sequelize=require('sequelize');module[_0x177f('0x0')]={'name':{'type':Sequelize[_0x177f('0x1')],'allowNull':![],'unique':_0x177f('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 0127aba..28e9b8d 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 _0x84ab=['UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Metrics','UserProfileResource','error','stack','name','map','AnalyticMetric','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','type','VIRTUAL','includeAll','include','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0x84ab,0x12f));var _0xb84a=function(_0x489b87,_0xd51c93){_0x489b87=_0x489b87-0x0;var _0x1823b6=_0x84ab[_0x489b87];return _0x1823b6;};'use strict';var emlformat=require(_0xb84a('0x0'));var rimraf=require(_0xb84a('0x1'));var zipdir=require(_0xb84a('0x2'));var jsonpatch=require(_0xb84a('0x3'));var rp=require(_0xb84a('0x4'));var moment=require('moment');var BPromise=require(_0xb84a('0x5'));var Mustache=require(_0xb84a('0x6'));var util=require('util');var path=require(_0xb84a('0x7'));var sox=require(_0xb84a('0x8'));var csv=require(_0xb84a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb84a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb84a('0xb'));var deskjs=require(_0xb84a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84a('0xe'));var authService=require(_0xb84a('0xf'));var qs=require(_0xb84a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb84a('0x11'));var utils=require(_0xb84a('0x12'));var config=require(_0xb84a('0x13'));var licenseUtil=require(_0xb84a('0x14'));var db=require(_0xb84a('0x15'))['db'];function respondWithStatusCode(_0x4d3758,_0x83444e){_0x83444e=_0x83444e||0xcc;return function(_0x4777dc){if(_0x4777dc){return _0x4d3758[_0xb84a('0x16')](_0x83444e);}return _0x4d3758[_0xb84a('0x17')](_0x83444e)[_0xb84a('0x18')]();};}function respondWithResult(_0x11dfe9,_0x12ccab){_0x12ccab=_0x12ccab||0xc8;return function(_0x475b){if(_0x475b){return _0x11dfe9[_0xb84a('0x17')](_0x12ccab)[_0xb84a('0x19')](_0x475b);}};}function respondWithFilteredResult(_0xc0b2e0,_0x1251ec){return function(_0x5716bd){if(_0x5716bd){var _0x11dd4d=typeof _0x1251ec[_0xb84a('0x1a')]===_0xb84a('0x1b')&&typeof _0x1251ec[_0xb84a('0x1c')]===_0xb84a('0x1b');var _0x1be87a=_0x5716bd[_0xb84a('0x1d')];var _0x34d82f=_0x11dd4d?0x0:_0x1251ec[_0xb84a('0x1a')];var _0x3f7437=_0x11dd4d?_0x5716bd[_0xb84a('0x1d')]:_0x1251ec[_0xb84a('0x1a')]+_0x1251ec[_0xb84a('0x1c')];var _0x200289;if(_0x3f7437>=_0x1be87a){_0x3f7437=_0x1be87a;_0x200289=0xc8;}else{_0x200289=0xce;}_0xc0b2e0['status'](_0x200289);return _0xc0b2e0[_0xb84a('0x1e')](_0xb84a('0x1f'),_0x34d82f+'-'+_0x3f7437+'/'+_0x1be87a)['json'](_0x5716bd);}return null;};}function patchUpdates(_0xac76d3){return function(_0x61ef03){try{jsonpatch[_0xb84a('0x20')](_0x61ef03,_0xac76d3,!![]);}catch(_0x19f637){return BPromise['reject'](_0x19f637);}return _0x61ef03['save']();};}function saveUpdates(_0x1466ae,_0x19097d){return function(_0x2d70fd){if(_0x2d70fd){return _0x2d70fd[_0xb84a('0x21')](_0x1466ae)[_0xb84a('0x22')](function(_0x3b8fb2){return _0x3b8fb2;});}return null;};}function removeEntity(_0x8b28cd,_0x21d0d3){return function(_0x3aa06f){if(_0x3aa06f){return _0x3aa06f[_0xb84a('0x23')]()[_0xb84a('0x22')](function(){var _0x1aab7d=_0x3aa06f[_0xb84a('0x24')]({'plain':!![]});var _0x409df0=_0xb84a('0x25');return db[_0xb84a('0x26')][_0xb84a('0x23')]({'where':{'type':_0x409df0,'resourceId':_0x1aab7d['id']}})[_0xb84a('0x22')](function(){return _0x3aa06f;});})[_0xb84a('0x22')](function(){_0x8b28cd[_0xb84a('0x17')](0xcc)[_0xb84a('0x18')]();});}};}function handleEntityNotFound(_0x1db72c,_0x2fe40d){return function(_0x35d1f7){if(!_0x35d1f7){_0x1db72c[_0xb84a('0x16')](0x194);}return _0x35d1f7;};}function handleError(_0x97d71b,_0x5349ea){_0x5349ea=_0x5349ea||0x1f4;return function(_0x582954){logger[_0xb84a('0x27')](_0x582954[_0xb84a('0x28')]);if(_0x582954['name']){delete _0x582954[_0xb84a('0x29')];}_0x97d71b[_0xb84a('0x17')](_0x5349ea)['send'](_0x582954);};}exports['index']=function(_0x28f2e7,_0x8e9319){var _0x49ba3d={},_0x251778={},_0xba1147={'count':0x0,'rows':[]};var _0x3abc22=_[_0xb84a('0x2a')](db[_0xb84a('0x2b')][_0xb84a('0x2c')],function(_0x34b212){return{'name':_0x34b212[_0xb84a('0x2d')],'type':_0x34b212['type'][_0xb84a('0x2e')]};});_0x251778['model']=_['map'](_0x3abc22,_0xb84a('0x29'));_0x251778[_0xb84a('0x2f')]=_['keys'](_0x28f2e7['query']);_0x251778[_0xb84a('0x30')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],_0x251778[_0xb84a('0x2f')]);_0x49ba3d[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x251778[_0xb84a('0x32')],qs[_0xb84a('0x34')](_0x28f2e7['query'][_0xb84a('0x34')]));_0x49ba3d[_0xb84a('0x33')]=_0x49ba3d[_0xb84a('0x33')][_0xb84a('0x35')]?_0x49ba3d[_0xb84a('0x33')]:_0x251778[_0xb84a('0x32')];if(!_0x28f2e7[_0xb84a('0x2f')]['hasOwnProperty'](_0xb84a('0x36'))){_0x49ba3d['limit']=qs[_0xb84a('0x1c')](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1c')]);_0x49ba3d['offset']=qs['offset'](_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x1a')]);}_0x49ba3d[_0xb84a('0x37')]=qs[_0xb84a('0x38')](_0x28f2e7[_0xb84a('0x2f')]['sort']);_0x49ba3d[_0xb84a('0x39')]=qs[_0xb84a('0x30')](_['pick'](_0x28f2e7[_0xb84a('0x2f')],_0x251778[_0xb84a('0x30')]),_0x3abc22);if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3a')]){_0x49ba3d['where']=_['merge'](_0x49ba3d['where'],{'$or':_[_0xb84a('0x2a')](_0x3abc22,function(_0x11e1ac){if(_0x11e1ac[_0xb84a('0x3b')]!==_0xb84a('0x3c')){var _0x55b0b8={};_0x55b0b8[_0x11e1ac[_0xb84a('0x29')]]={'$like':'%'+_0x28f2e7['query'][_0xb84a('0x3a')]+'%'};return _0x55b0b8;}})});}_0x49ba3d=_['merge']({},_0x49ba3d,_0x28f2e7['options']);var _0x59d7a1={'where':_0x49ba3d[_0xb84a('0x39')]};return db[_0xb84a('0x2b')][_0xb84a('0x1d')](_0x59d7a1)[_0xb84a('0x22')](function(_0x5e547e){_0xba1147[_0xb84a('0x1d')]=_0x5e547e;if(_0x28f2e7[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x49ba3d[_0xb84a('0x3e')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x49ba3d);})[_0xb84a('0x22')](function(_0x1f3e04){_0xba1147['rows']=_0x1f3e04;return _0xba1147;})[_0xb84a('0x22')](respondWithFilteredResult(_0x8e9319,_0x49ba3d))[_0xb84a('0x3f')](handleError(_0x8e9319,null));};exports[_0xb84a('0x40')]=function(_0x25280a,_0x3f005b){var _0x241536={'raw':!![],'where':{'id':_0x25280a[_0xb84a('0x41')]['id']}},_0x24d700={};_0x24d700[_0xb84a('0x32')]=_[_0xb84a('0x42')](db[_0xb84a('0x2b')][_0xb84a('0x2c')]);_0x24d700[_0xb84a('0x2f')]=_[_0xb84a('0x42')](_0x25280a[_0xb84a('0x2f')]);_0x24d700['filters']=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],_0x24d700[_0xb84a('0x2f')]);_0x241536[_0xb84a('0x33')]=_[_0xb84a('0x31')](_0x24d700[_0xb84a('0x32')],qs['fields'](_0x25280a[_0xb84a('0x2f')]['fields']));_0x241536[_0xb84a('0x33')]=_0x241536[_0xb84a('0x33')][_0xb84a('0x35')]?_0x241536[_0xb84a('0x33')]:_0x24d700['model'];if(_0x25280a[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x241536[_0xb84a('0x3e')]=[{'all':!![]}];}_0x241536=_['merge']({},_0x241536,_0x25280a['options']);return db[_0xb84a('0x2b')][_0xb84a('0x43')](_0x241536)[_0xb84a('0x22')](handleEntityNotFound(_0x3f005b,null))['then'](respondWithResult(_0x3f005b,null))['catch'](handleError(_0x3f005b,null));};exports['create']=function(_0x45630d,_0x384a0d){return db[_0xb84a('0x2b')][_0xb84a('0x44')](_0x45630d[_0xb84a('0x45')],{})['then'](function(_0x4b40fe){var _0x5b853a=_0x45630d['user'][_0xb84a('0x24')]({'plain':!![]});if(!_0x5b853a)throw new Error(_0xb84a('0x46'));if(_0x5b853a['role']===_0xb84a('0x47')){var _0xc8bac2=_0x4b40fe[_0xb84a('0x24')]({'plain':!![]});var _0x2f70f0=_0xb84a('0x25');return db[_0xb84a('0x48')]['find']({'where':{'name':_0x2f70f0,'userProfileId':_0x5b853a['userProfileId']},'raw':!![]})[_0xb84a('0x22')](function(_0x50172a){if(_0x50172a&&_0x50172a[_0xb84a('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0xc8bac2['name'],'resourceId':_0xc8bac2['id'],'type':_0x50172a[_0xb84a('0x29')],'sectionId':_0x50172a['id']},{})[_0xb84a('0x22')](function(){return _0x4b40fe;});}else{return _0x4b40fe;}})[_0xb84a('0x3f')](function(_0x25b6a0){logger[_0xb84a('0x27')](_0xb84a('0x4a'),_0x25b6a0);throw _0x25b6a0;});}return _0x4b40fe;})[_0xb84a('0x22')](respondWithResult(_0x384a0d,0xc9))[_0xb84a('0x3f')](handleError(_0x384a0d,null));};exports['update']=function(_0x5afdd0,_0x4c5bdf){if(_0x5afdd0[_0xb84a('0x45')]['id']){delete _0x5afdd0[_0xb84a('0x45')]['id'];}return db['AnalyticMetric'][_0xb84a('0x43')]({'where':{'id':_0x5afdd0['params']['id']}})['then'](handleEntityNotFound(_0x4c5bdf,null))['then'](saveUpdates(_0x5afdd0[_0xb84a('0x45')],null))[_0xb84a('0x22')](respondWithResult(_0x4c5bdf,null))[_0xb84a('0x3f')](handleError(_0x4c5bdf,null));};exports['destroy']=function(_0x5f757e,_0x2e98bf){return db[_0xb84a('0x2b')]['find']({'where':{'id':_0x5f757e[_0xb84a('0x41')]['id']}})['then'](handleEntityNotFound(_0x2e98bf,null))['then'](removeEntity(_0x2e98bf,null))[_0xb84a('0x3f')](handleError(_0x2e98bf,null));}; \ No newline at end of file +var _0x4b84=['status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','stack','name','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x32ac07,_0xb14a29){var _0x347b1f=function(_0x12a04f){while(--_0x12a04f){_0x32ac07['push'](_0x32ac07['shift']());}};_0x347b1f(++_0xb14a29);}(_0x4b84,0x1cc));var _0x44b8=function(_0xe5b349,_0x5f06e4){_0xe5b349=_0xe5b349-0x0;var _0x26b0ad=_0x4b84[_0xe5b349];return _0x26b0ad;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];function respondWithStatusCode(_0x4301a6,_0x4bcc43){_0x4bcc43=_0x4bcc43||0xcc;return function(_0x194230){if(_0x194230){return _0x4301a6['sendStatus'](_0x4bcc43);}return _0x4301a6[_0x44b8('0x14')](_0x4bcc43)[_0x44b8('0x15')]();};}function respondWithResult(_0x4df670,_0x63e8f6){_0x63e8f6=_0x63e8f6||0xc8;return function(_0x4be54c){if(_0x4be54c){return _0x4df670['status'](_0x63e8f6)[_0x44b8('0x16')](_0x4be54c);}};}function respondWithFilteredResult(_0x2af0ad,_0x1722da){return function(_0x41ab46){if(_0x41ab46){var _0x5e52f2=typeof _0x1722da['offset']==='undefined'&&typeof _0x1722da[_0x44b8('0x17')]==='undefined';var _0x28ef36=_0x41ab46[_0x44b8('0x18')];var _0x55e258=_0x5e52f2?0x0:_0x1722da[_0x44b8('0x19')];var _0xe3de8f=_0x5e52f2?_0x41ab46['count']:_0x1722da[_0x44b8('0x19')]+_0x1722da[_0x44b8('0x17')];var _0x4b600f;if(_0xe3de8f>=_0x28ef36){_0xe3de8f=_0x28ef36;_0x4b600f=0xc8;}else{_0x4b600f=0xce;}_0x2af0ad[_0x44b8('0x14')](_0x4b600f);return _0x2af0ad[_0x44b8('0x1a')](_0x44b8('0x1b'),_0x55e258+'-'+_0xe3de8f+'/'+_0x28ef36)[_0x44b8('0x16')](_0x41ab46);}return null;};}function patchUpdates(_0x102ef9){return function(_0x369c09){try{jsonpatch[_0x44b8('0x1c')](_0x369c09,_0x102ef9,!![]);}catch(_0x9b0536){return BPromise[_0x44b8('0x1d')](_0x9b0536);}return _0x369c09[_0x44b8('0x1e')]();};}function saveUpdates(_0x1d642b,_0x14996c){return function(_0x48327e){if(_0x48327e){return _0x48327e[_0x44b8('0x1f')](_0x1d642b)[_0x44b8('0x20')](function(_0x416b34){return _0x416b34;});}return null;};}function removeEntity(_0x1418db,_0x305a5c){return function(_0x51a34a){if(_0x51a34a){return _0x51a34a[_0x44b8('0x21')]()['then'](function(){var _0x41a922=_0x51a34a[_0x44b8('0x22')]({'plain':!![]});var _0x25a0c1=_0x44b8('0x23');return db[_0x44b8('0x24')]['destroy']({'where':{'type':_0x25a0c1,'resourceId':_0x41a922['id']}})[_0x44b8('0x20')](function(){return _0x51a34a;});})['then'](function(){_0x1418db[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();});}};}function handleEntityNotFound(_0x549a26,_0x17ac44){return function(_0x470f49){if(!_0x470f49){_0x549a26[_0x44b8('0x25')](0x194);}return _0x470f49;};}function handleError(_0x59c1bf,_0xb22107){_0xb22107=_0xb22107||0x1f4;return function(_0x242342){logger['error'](_0x242342[_0x44b8('0x26')]);if(_0x242342['name']){delete _0x242342[_0x44b8('0x27')];}_0x59c1bf['status'](_0xb22107)['send'](_0x242342);};}exports['index']=function(_0x387293,_0x29b18d){var _0x44ce5a={},_0x1bd1be={},_0x38cd17={'count':0x0,'rows':[]};var _0xc3f667=_[_0x44b8('0x28')](db[_0x44b8('0x29')][_0x44b8('0x2a')],function(_0x28f918){return{'name':_0x28f918[_0x44b8('0x2b')],'type':_0x28f918[_0x44b8('0x2c')][_0x44b8('0x2d')]};});_0x1bd1be['model']=_[_0x44b8('0x28')](_0xc3f667,'name');_0x1bd1be[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x387293[_0x44b8('0x2e')]);_0x1bd1be[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x1bd1be['model'],_0x1bd1be[_0x44b8('0x2e')]);_0x44ce5a[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x1bd1be[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x387293['query'][_0x44b8('0x34')]));_0x44ce5a[_0x44b8('0x32')]=_0x44ce5a[_0x44b8('0x32')][_0x44b8('0x35')]?_0x44ce5a[_0x44b8('0x32')]:_0x1bd1be[_0x44b8('0x33')];if(!_0x387293[_0x44b8('0x2e')][_0x44b8('0x36')](_0x44b8('0x37'))){_0x44ce5a[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x17')]);_0x44ce5a[_0x44b8('0x19')]=qs[_0x44b8('0x19')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x19')]);}_0x44ce5a[_0x44b8('0x38')]=qs[_0x44b8('0x39')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x39')]);_0x44ce5a[_0x44b8('0x3a')]=qs['filters'](_[_0x44b8('0x3b')](_0x387293[_0x44b8('0x2e')],_0x1bd1be['filters']),_0xc3f667);if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]){_0x44ce5a[_0x44b8('0x3a')]=_[_0x44b8('0x3d')](_0x44ce5a['where'],{'$or':_[_0x44b8('0x28')](_0xc3f667,function(_0x11e4e3){if(_0x11e4e3[_0x44b8('0x2c')]!==_0x44b8('0x3e')){var _0x9cb2a={};_0x9cb2a[_0x11e4e3[_0x44b8('0x27')]]={'$like':'%'+_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]+'%'};return _0x9cb2a;}})});}_0x44ce5a=_[_0x44b8('0x3d')]({},_0x44ce5a,_0x387293[_0x44b8('0x3f')]);var _0x1c9983={'where':_0x44ce5a[_0x44b8('0x3a')]};return db[_0x44b8('0x29')][_0x44b8('0x18')](_0x1c9983)[_0x44b8('0x20')](function(_0x29b43f){_0x38cd17['count']=_0x29b43f;if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x44ce5a[_0x44b8('0x41')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x44b8('0x42')](_0x44ce5a);})[_0x44b8('0x20')](function(_0x229cc9){_0x38cd17['rows']=_0x229cc9;return _0x38cd17;})[_0x44b8('0x20')](respondWithFilteredResult(_0x29b18d,_0x44ce5a))[_0x44b8('0x43')](handleError(_0x29b18d,null));};exports[_0x44b8('0x44')]=function(_0x334f86,_0xfd590a){var _0x499a3e={'raw':!![],'where':{'id':_0x334f86[_0x44b8('0x45')]['id']}},_0x5ae5f9={};_0x5ae5f9[_0x44b8('0x33')]=_[_0x44b8('0x2f')](db[_0x44b8('0x29')][_0x44b8('0x2a')]);_0x5ae5f9[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x334f86[_0x44b8('0x2e')]);_0x5ae5f9[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],_0x5ae5f9[_0x44b8('0x2e')]);_0x499a3e[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x334f86[_0x44b8('0x2e')][_0x44b8('0x34')]));_0x499a3e[_0x44b8('0x32')]=_0x499a3e['attributes']['length']?_0x499a3e[_0x44b8('0x32')]:_0x5ae5f9[_0x44b8('0x33')];if(_0x334f86[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x499a3e[_0x44b8('0x41')]=[{'all':!![]}];}_0x499a3e=_[_0x44b8('0x3d')]({},_0x499a3e,_0x334f86[_0x44b8('0x3f')]);return db['AnalyticMetric'][_0x44b8('0x46')](_0x499a3e)['then'](handleEntityNotFound(_0xfd590a,null))[_0x44b8('0x20')](respondWithResult(_0xfd590a,null))[_0x44b8('0x43')](handleError(_0xfd590a,null));};exports[_0x44b8('0x47')]=function(_0x9207bf,_0x103d57){return db[_0x44b8('0x29')]['create'](_0x9207bf[_0x44b8('0x48')],{})[_0x44b8('0x20')](function(_0x10602c){var _0x25d266=_0x9207bf['user'][_0x44b8('0x22')]({'plain':!![]});if(!_0x25d266)throw new Error(_0x44b8('0x49'));if(_0x25d266[_0x44b8('0x4a')]===_0x44b8('0x4b')){var _0x44ec23=_0x10602c[_0x44b8('0x22')]({'plain':!![]});var _0x500bad=_0x44b8('0x23');return db[_0x44b8('0x4c')][_0x44b8('0x46')]({'where':{'name':_0x500bad,'userProfileId':_0x25d266[_0x44b8('0x4d')]},'raw':!![]})[_0x44b8('0x20')](function(_0x57d0e2){if(_0x57d0e2&&_0x57d0e2['autoAssociation']===0x0){return db[_0x44b8('0x24')]['create']({'name':_0x44ec23[_0x44b8('0x27')],'resourceId':_0x44ec23['id'],'type':_0x57d0e2['name'],'sectionId':_0x57d0e2['id']},{})[_0x44b8('0x20')](function(){return _0x10602c;});}else{return _0x10602c;}})[_0x44b8('0x43')](function(_0x1a29f6){logger[_0x44b8('0x4e')](_0x44b8('0x4f'),_0x1a29f6);throw _0x1a29f6;});}return _0x10602c;})[_0x44b8('0x20')](respondWithResult(_0x103d57,0xc9))[_0x44b8('0x43')](handleError(_0x103d57,null));};exports['update']=function(_0x3ad278,_0x37b2c2){if(_0x3ad278[_0x44b8('0x48')]['id']){delete _0x3ad278['body']['id'];}return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x3ad278[_0x44b8('0x45')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0x37b2c2,null))['then'](saveUpdates(_0x3ad278[_0x44b8('0x48')],null))[_0x44b8('0x20')](respondWithResult(_0x37b2c2,null))['catch'](handleError(_0x37b2c2,null));};exports[_0x44b8('0x21')]=function(_0x19f22b,_0x35136e){return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x19f22b['params']['id']}})['then'](handleEntityNotFound(_0x35136e,null))[_0x44b8('0x20')](removeEntity(_0x35136e,null))[_0x44b8('0x43')](handleError(_0x35136e,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 78a1199..6e696bd 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 _0x9120=['exports','define','AnalyticMetric','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes'];(function(_0x2e78cb,_0x111663){var _0x10176a=function(_0x54a01c){while(--_0x54a01c){_0x2e78cb['push'](_0x2e78cb['shift']());}};_0x10176a(++_0x111663);}(_0x9120,0x1b3));var _0x0912=function(_0x41dfb2,_0x1828a6){_0x41dfb2=_0x41dfb2-0x0;var _0x31687d=_0x9120[_0x41dfb2];return _0x31687d;};'use strict';var _=require(_0x0912('0x0'));var util=require(_0x0912('0x1'));var logger=require(_0x0912('0x2'))(_0x0912('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0912('0x4'));var fs=require('fs');var path=require(_0x0912('0x5'));var rimraf=require(_0x0912('0x6'));var config=require(_0x0912('0x7'));var attributes=require(_0x0912('0x8'));module[_0x0912('0x9')]=function(_0x4e7ddb,_0x42cb02){return _0x4e7ddb[_0x0912('0xa')](_0x0912('0xb'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x624c=['../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','util'];(function(_0xb68ff2,_0x11aff9){var _0x240365=function(_0x4d653d){while(--_0x4d653d){_0xb68ff2['push'](_0xb68ff2['shift']());}};_0x240365(++_0x11aff9);}(_0x624c,0x1ee));var _0xc624=function(_0x598901,_0x205f15){_0x598901=_0x598901-0x0;var _0x45acca=_0x624c[_0x598901];return _0x45acca;};'use strict';var _=require('lodash');var util=require(_0xc624('0x0'));var logger=require(_0xc624('0x1'))(_0xc624('0x2'));var moment=require(_0xc624('0x3'));var BPromise=require(_0xc624('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc624('0x5'));var rimraf=require('rimraf');var config=require(_0xc624('0x6'));var attributes=require('./analyticMetric.attributes');module[_0xc624('0x7')]=function(_0x2d1db7,_0x39759e){return _0x2d1db7[_0xc624('0x8')](_0xc624('0x9'),attributes,{'tableName':_0xc624('0xa'),'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 9ebac9c..0c24ce1 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 _0x7207=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x43eba0,_0x523a37){var _0x30c5ef=function(_0x38da1a){while(--_0x38da1a){_0x43eba0['push'](_0x43eba0['shift']());}};_0x30c5ef(++_0x523a37);}(_0x7207,0xec));var _0x7720=function(_0x1f887a,_0xd574a2){_0x1f887a=_0x1f887a-0x0;var _0x1369ba=_0x7207[_0x1f887a];return _0x1369ba;};'use strict';var _=require(_0x7720('0x0'));var util=require(_0x7720('0x1'));var moment=require(_0x7720('0x2'));var BPromise=require(_0x7720('0x3'));var rs=require(_0x7720('0x4'));var fs=require('fs');var Redis=require(_0x7720('0x5'));var db=require(_0x7720('0x6'))['db'];var utils=require(_0x7720('0x7'));var logger=require(_0x7720('0x8'))(_0x7720('0x9'));var config=require(_0x7720('0xa'));var jayson=require(_0x7720('0xb'));var client=jayson[_0x7720('0xc')][_0x7720('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x33a3c6,_0x5b890f,_0x3a5edc){return new BPromise(function(_0x12dd4,_0x3f0412){return client[_0x7720('0xe')](_0x33a3c6,_0x3a5edc)[_0x7720('0xf')](function(_0x57ae79){logger[_0x7720('0x10')](_0x7720('0x11'),_0x5b890f,_0x7720('0x12'));logger[_0x7720('0x13')](_0x7720('0x14'),_0x5b890f,_0x7720('0x12'),JSON[_0x7720('0x15')](_0x57ae79));if(_0x57ae79[_0x7720('0x16')]){if(_0x57ae79['error']['code']===0x1f4){logger[_0x7720('0x16')](_0x7720('0x11'),_0x5b890f,_0x57ae79['error'][_0x7720('0x17')]);return _0x3f0412(_0x57ae79['error'][_0x7720('0x17')]);}logger[_0x7720('0x16')](_0x7720('0x11'),_0x5b890f,_0x57ae79['error'][_0x7720('0x17')]);return _0x12dd4(_0x57ae79[_0x7720('0x16')]['message']);}else{logger['info'](_0x7720('0x11'),_0x5b890f,'request\x20sent');_0x12dd4(_0x57ae79[_0x7720('0x18')]['message']);}})[_0x7720('0x19')](function(_0x3c2558){logger[_0x7720('0x16')]('AnalyticMetric,\x20%s,\x20%s',_0x5b890f,_0x3c2558);_0x3f0412(_0x3c2558);});});} \ No newline at end of file +var _0x4267=['AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0xe5975e,_0x506384){var _0x110e56=function(_0x2ca519){while(--_0x2ca519){_0xe5975e['push'](_0xe5975e['shift']());}};_0x110e56(++_0x506384);}(_0x4267,0x159));var _0x7426=function(_0x24b88f,_0x3d497d){_0x24b88f=_0x24b88f-0x0;var _0x4375cb=_0x4267[_0x24b88f];return _0x4375cb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7426('0x0'));var BPromise=require('bluebird');var rs=require(_0x7426('0x1'));var fs=require('fs');var Redis=require(_0x7426('0x2'));var db=require(_0x7426('0x3'))['db'];var utils=require(_0x7426('0x4'));var logger=require(_0x7426('0x5'))('rpc');var config=require(_0x7426('0x6'));var jayson=require(_0x7426('0x7'));var client=jayson[_0x7426('0x8')][_0x7426('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14bc40,_0x6ad0a0,_0x5cd436){return new BPromise(function(_0x160cea,_0x3cbbce){return client[_0x7426('0xa')](_0x14bc40,_0x5cd436)[_0x7426('0xb')](function(_0x108843){logger['info'](_0x7426('0xc'),_0x6ad0a0,_0x7426('0xd'));logger['debug'](_0x7426('0xe'),_0x6ad0a0,_0x7426('0xd'),JSON['stringify'](_0x108843));if(_0x108843['error']){if(_0x108843[_0x7426('0xf')][_0x7426('0x10')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x6ad0a0,_0x108843[_0x7426('0xf')][_0x7426('0x11')]);return _0x3cbbce(_0x108843[_0x7426('0xf')][_0x7426('0x11')]);}logger[_0x7426('0xf')](_0x7426('0xc'),_0x6ad0a0,_0x108843[_0x7426('0xf')]['message']);return _0x160cea(_0x108843['error'][_0x7426('0x11')]);}else{logger[_0x7426('0x12')](_0x7426('0xc'),_0x6ad0a0,_0x7426('0xd'));_0x160cea(_0x108843[_0x7426('0x13')]['message']);}})[_0x7426('0x14')](function(_0x5ec199){logger[_0x7426('0xf')](_0x7426('0xc'),_0x6ad0a0,_0x5ec199);_0x3cbbce(_0x5ec199);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 842b2d1..e9779fa 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 _0x56a6=['../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','/:id','post','put','update','destroy','exports','multer','util','path','connect-timeout','fs-extra'];(function(_0x386c3f,_0x1747b4){var _0x237a57=function(_0x4b147a){while(--_0x4b147a){_0x386c3f['push'](_0x386c3f['shift']());}};_0x237a57(++_0x1747b4);}(_0x56a6,0x17b));var _0x656a=function(_0x4e3d24,_0x3d935b){_0x4e3d24=_0x4e3d24-0x0;var _0x52b3e7=_0x56a6[_0x4e3d24];return _0x52b3e7;};'use strict';var multer=require(_0x656a('0x0'));var util=require(_0x656a('0x1'));var path=require(_0x656a('0x2'));var timeout=require(_0x656a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x656a('0x4'));var auth=require(_0x656a('0x5'));var interaction=require(_0x656a('0x6'));var config=require('../../config/environment');var controller=require(_0x656a('0x7'));router[_0x656a('0x8')]('/',auth[_0x656a('0x9')](),controller['index']);router[_0x656a('0x8')](_0x656a('0xa'),auth[_0x656a('0x9')](),controller['show']);router[_0x656a('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x656a('0xc')](_0x656a('0xa'),auth[_0x656a('0x9')](),controller[_0x656a('0xd')]);router['delete'](_0x656a('0xa'),auth[_0x656a('0x9')](),controller[_0x656a('0xe')]);module[_0x656a('0xf')]=router; \ No newline at end of file +var _0x11e5=['../../components/auth/service','../../config/environment','isAuthenticated','index','get','show','post','create','put','/:id','update','delete','exports','multer','path','connect-timeout','Router','fs-extra'];(function(_0x43aee1,_0x3abccd){var _0x222f45=function(_0x5e20dd){while(--_0x5e20dd){_0x43aee1['push'](_0x43aee1['shift']());}};_0x222f45(++_0x3abccd);}(_0x11e5,0x8b));var _0x511e=function(_0x34b709,_0x5dc8af){_0x34b709=_0x34b709-0x0;var _0x20dda4=_0x11e5[_0x34b709];return _0x20dda4;};'use strict';var multer=require(_0x511e('0x0'));var util=require('util');var path=require(_0x511e('0x1'));var timeout=require(_0x511e('0x2'));var express=require('express');var router=express[_0x511e('0x3')]();var fs_extra=require(_0x511e('0x4'));var auth=require(_0x511e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x511e('0x6'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0x511e('0x7')](),controller[_0x511e('0x8')]);router[_0x511e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x511e('0xa')]);router[_0x511e('0xb')]('/',auth[_0x511e('0x7')](),controller[_0x511e('0xc')]);router[_0x511e('0xd')](_0x511e('0xe'),auth[_0x511e('0x7')](),controller[_0x511e('0xf')]);router[_0x511e('0x10')](_0x511e('0xe'),auth[_0x511e('0x7')](),controller['destroy']);module[_0x511e('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 84bfead..98ade46 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 _0x21c2=['TEXT'];(function(_0xd03fff,_0x1c14ce){var _0x1ac5f8=function(_0xa69858){while(--_0xa69858){_0xd03fff['push'](_0xd03fff['shift']());}};_0x1ac5f8(++_0x1c14ce);}(_0x21c2,0x86));var _0x221c=function(_0x46055e,_0x22ea7c){_0x46055e=_0x46055e-0x0;var _0x1a7568=_0x21c2[_0x46055e];return _0x1a7568;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0x221c('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0xa0bd=['exports','TEXT'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0xa0bd,0x17e));var _0xda0b=function(_0x23e4f9,_0x59afed){_0x23e4f9=_0x23e4f9-0x0;var _0x58185c=_0xa0bd[_0x23e4f9];return _0x58185c;};'use strict';var Sequelize=require('sequelize');module[_0xda0b('0x0')]={'tree':{'type':Sequelize[_0xda0b('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 8c57447..5723988 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 _0x7d48=['request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','then','error','stack','name','send','index','map','AnalyticTreeReport','fieldName','type','key','query','filters','model','intersection','attributes','length','nolimit','sort','where','pick','filter','options','include','catch','keys','rawAttributes','fields','merge','create','body','update','find','params','destroy','zip-dir','fast-json-patch'];(function(_0x299f22,_0x3533dd){var _0x43c7c5=function(_0x16d406){while(--_0x16d406){_0x299f22['push'](_0x299f22['shift']());}};_0x43c7c5(++_0x3533dd);}(_0x7d48,0x1d3));var _0x87d4=function(_0x1a0fdd,_0x4eb894){_0x1a0fdd=_0x1a0fdd-0x0;var _0x43fc57=_0x7d48[_0x1a0fdd];return _0x43fc57;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x87d4('0x0'));var jsonpatch=require(_0x87d4('0x1'));var rp=require(_0x87d4('0x2'));var moment=require(_0x87d4('0x3'));var BPromise=require(_0x87d4('0x4'));var Mustache=require(_0x87d4('0x5'));var util=require(_0x87d4('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x87d4('0x7'));var ejs=require(_0x87d4('0x8'));var fs=require('fs');var fs_extra=require(_0x87d4('0x9'));var _=require(_0x87d4('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x87d4('0xb'));var toCsv=require('to-csv');var querystring=require(_0x87d4('0xc'));var Papa=require(_0x87d4('0xd'));var Redis=require(_0x87d4('0xe'));var authService=require(_0x87d4('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x87d4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x87d4('0x11'))('api');var utils=require(_0x87d4('0x12'));var config=require(_0x87d4('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x87d4('0x14'))['db'];function respondWithStatusCode(_0x1222ea,_0x2d2947){_0x2d2947=_0x2d2947||0xcc;return function(_0x2a8abb){if(_0x2a8abb){return _0x1222ea[_0x87d4('0x15')](_0x2d2947);}return _0x1222ea[_0x87d4('0x16')](_0x2d2947)[_0x87d4('0x17')]();};}function respondWithResult(_0x39e395,_0x3ac4a0){_0x3ac4a0=_0x3ac4a0||0xc8;return function(_0x5ccfb8){if(_0x5ccfb8){return _0x39e395[_0x87d4('0x16')](_0x3ac4a0)[_0x87d4('0x18')](_0x5ccfb8);}};}function respondWithFilteredResult(_0xd97fb3,_0x44434f){return function(_0x39aed7){if(_0x39aed7){var _0x4e49d5=typeof _0x44434f[_0x87d4('0x19')]==='undefined'&&typeof _0x44434f[_0x87d4('0x1a')]===_0x87d4('0x1b');var _0x26db0a=_0x39aed7[_0x87d4('0x1c')];var _0x2ad147=_0x4e49d5?0x0:_0x44434f[_0x87d4('0x19')];var _0x538682=_0x4e49d5?_0x39aed7[_0x87d4('0x1c')]:_0x44434f['offset']+_0x44434f[_0x87d4('0x1a')];var _0x266073;if(_0x538682>=_0x26db0a){_0x538682=_0x26db0a;_0x266073=0xc8;}else{_0x266073=0xce;}_0xd97fb3[_0x87d4('0x16')](_0x266073);return _0xd97fb3[_0x87d4('0x1d')]('Content-Range',_0x2ad147+'-'+_0x538682+'/'+_0x26db0a)['json'](_0x39aed7);}return null;};}function patchUpdates(_0x5af081){return function(_0x1f9763){try{jsonpatch[_0x87d4('0x1e')](_0x1f9763,_0x5af081,!![]);}catch(_0x2051ba){return BPromise[_0x87d4('0x1f')](_0x2051ba);}return _0x1f9763['save']();};}function saveUpdates(_0x3ea620,_0x1892f4){return function(_0x12c5df){if(_0x12c5df){return _0x12c5df['update'](_0x3ea620)[_0x87d4('0x20')](function(_0x2f51af){return _0x2f51af;});}return null;};}function removeEntity(_0x62f79f,_0x2c4fe0){return function(_0x9b98f3){if(_0x9b98f3){return _0x9b98f3['destroy']()[_0x87d4('0x20')](function(){_0x62f79f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x11cd93,_0x2ad551){return function(_0x2eaf45){if(!_0x2eaf45){_0x11cd93[_0x87d4('0x15')](0x194);}return _0x2eaf45;};}function handleError(_0x127be4,_0x4c5bc1){_0x4c5bc1=_0x4c5bc1||0x1f4;return function(_0x212ad3){logger[_0x87d4('0x21')](_0x212ad3[_0x87d4('0x22')]);if(_0x212ad3[_0x87d4('0x23')]){delete _0x212ad3[_0x87d4('0x23')];}_0x127be4[_0x87d4('0x16')](_0x4c5bc1)[_0x87d4('0x24')](_0x212ad3);};}exports[_0x87d4('0x25')]=function(_0x3d01b5,_0x3006cc){var _0x287685={},_0x33e82b={},_0x54c9aa={'count':0x0,'rows':[]};var _0x11013a=_[_0x87d4('0x26')](db[_0x87d4('0x27')]['rawAttributes'],function(_0x3a3f38){return{'name':_0x3a3f38[_0x87d4('0x28')],'type':_0x3a3f38[_0x87d4('0x29')][_0x87d4('0x2a')]};});_0x33e82b['model']=_[_0x87d4('0x26')](_0x11013a,_0x87d4('0x23'));_0x33e82b[_0x87d4('0x2b')]=_['keys'](_0x3d01b5[_0x87d4('0x2b')]);_0x33e82b[_0x87d4('0x2c')]=_['intersection'](_0x33e82b[_0x87d4('0x2d')],_0x33e82b[_0x87d4('0x2b')]);_0x287685['attributes']=_[_0x87d4('0x2e')](_0x33e82b[_0x87d4('0x2d')],qs['fields'](_0x3d01b5[_0x87d4('0x2b')]['fields']));_0x287685['attributes']=_0x287685[_0x87d4('0x2f')][_0x87d4('0x30')]?_0x287685[_0x87d4('0x2f')]:_0x33e82b[_0x87d4('0x2d')];if(!_0x3d01b5[_0x87d4('0x2b')]['hasOwnProperty'](_0x87d4('0x31'))){_0x287685['limit']=qs['limit'](_0x3d01b5[_0x87d4('0x2b')]['limit']);_0x287685[_0x87d4('0x19')]=qs[_0x87d4('0x19')](_0x3d01b5[_0x87d4('0x2b')][_0x87d4('0x19')]);}_0x287685['order']=qs[_0x87d4('0x32')](_0x3d01b5[_0x87d4('0x2b')]['sort']);_0x287685[_0x87d4('0x33')]=qs[_0x87d4('0x2c')](_[_0x87d4('0x34')](_0x3d01b5[_0x87d4('0x2b')],_0x33e82b[_0x87d4('0x2c')]),_0x11013a);if(_0x3d01b5['query']['filter']){_0x287685[_0x87d4('0x33')]=_['merge'](_0x287685[_0x87d4('0x33')],{'$or':_['map'](_0x11013a,function(_0x5ab973){if(_0x5ab973['type']!=='VIRTUAL'){var _0xb137cf={};_0xb137cf[_0x5ab973[_0x87d4('0x23')]]={'$like':'%'+_0x3d01b5[_0x87d4('0x2b')][_0x87d4('0x35')]+'%'};return _0xb137cf;}})});}_0x287685=_['merge']({},_0x287685,_0x3d01b5[_0x87d4('0x36')]);var _0x26a91c={'where':_0x287685['where']};return db[_0x87d4('0x27')][_0x87d4('0x1c')](_0x26a91c)[_0x87d4('0x20')](function(_0xc80b61){_0x54c9aa['count']=_0xc80b61;if(_0x3d01b5[_0x87d4('0x2b')]['includeAll']){_0x287685[_0x87d4('0x37')]=[{'all':!![]}];}return db[_0x87d4('0x27')]['findAll'](_0x287685);})['then'](function(_0x5539ac){_0x54c9aa['rows']=_0x5539ac;return _0x54c9aa;})[_0x87d4('0x20')](respondWithFilteredResult(_0x3006cc,_0x287685))[_0x87d4('0x38')](handleError(_0x3006cc,null));};exports['show']=function(_0xb7e28,_0x25f4bc){var _0x576132={'raw':!![],'where':{'id':_0xb7e28['params']['id']}},_0x53bbe7={};_0x53bbe7[_0x87d4('0x2d')]=_[_0x87d4('0x39')](db[_0x87d4('0x27')][_0x87d4('0x3a')]);_0x53bbe7['query']=_[_0x87d4('0x39')](_0xb7e28[_0x87d4('0x2b')]);_0x53bbe7['filters']=_['intersection'](_0x53bbe7[_0x87d4('0x2d')],_0x53bbe7[_0x87d4('0x2b')]);_0x576132['attributes']=_[_0x87d4('0x2e')](_0x53bbe7['model'],qs[_0x87d4('0x3b')](_0xb7e28['query'][_0x87d4('0x3b')]));_0x576132['attributes']=_0x576132[_0x87d4('0x2f')][_0x87d4('0x30')]?_0x576132['attributes']:_0x53bbe7['model'];if(_0xb7e28[_0x87d4('0x2b')]['includeAll']){_0x576132['include']=[{'all':!![]}];}_0x576132=_[_0x87d4('0x3c')]({},_0x576132,_0xb7e28[_0x87d4('0x36')]);return db[_0x87d4('0x27')]['find'](_0x576132)['then'](handleEntityNotFound(_0x25f4bc,null))[_0x87d4('0x20')](respondWithResult(_0x25f4bc,null))[_0x87d4('0x38')](handleError(_0x25f4bc,null));};exports[_0x87d4('0x3d')]=function(_0x300d45,_0x1b0320){return db[_0x87d4('0x27')][_0x87d4('0x3d')](_0x300d45[_0x87d4('0x3e')],{})[_0x87d4('0x20')](respondWithResult(_0x1b0320,0xc9))[_0x87d4('0x38')](handleError(_0x1b0320,null));};exports[_0x87d4('0x3f')]=function(_0x340f60,_0x14f938){if(_0x340f60[_0x87d4('0x3e')]['id']){delete _0x340f60['body']['id'];}return db[_0x87d4('0x27')][_0x87d4('0x40')]({'where':{'id':_0x340f60[_0x87d4('0x41')]['id']}})['then'](handleEntityNotFound(_0x14f938,null))[_0x87d4('0x20')](saveUpdates(_0x340f60[_0x87d4('0x3e')],null))[_0x87d4('0x20')](respondWithResult(_0x14f938,null))['catch'](handleError(_0x14f938,null));};exports[_0x87d4('0x42')]=function(_0x158d2e,_0x28767e){return db[_0x87d4('0x27')][_0x87d4('0x40')]({'where':{'id':_0x158d2e[_0x87d4('0x41')]['id']}})[_0x87d4('0x20')](handleEntityNotFound(_0x28767e,null))[_0x87d4('0x20')](removeEntity(_0x28767e,null))[_0x87d4('0x38')](handleError(_0x28767e,null));}; \ No newline at end of file +var _0xfe26=['path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','sendStatus','stack','name','send','map','AnalyticTreeReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','length','includeAll','find','create','body','params','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x621511,_0xc6e368){var _0x53c9f3=function(_0x704888){while(--_0x704888){_0x621511['push'](_0x621511['shift']());}};_0x53c9f3(++_0xc6e368);}(_0xfe26,0xc7));var _0x6fe2=function(_0x3fb871,_0x28468c){_0x3fb871=_0x3fb871-0x0;var _0xc8503=_0xfe26[_0x3fb871];return _0xc8503;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6fe2('0x0'));var rp=require(_0x6fe2('0x1'));var moment=require('moment');var BPromise=require(_0x6fe2('0x2'));var Mustache=require(_0x6fe2('0x3'));var util=require(_0x6fe2('0x4'));var path=require(_0x6fe2('0x5'));var sox=require(_0x6fe2('0x6'));var csv=require(_0x6fe2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6fe2('0x8'));var _=require(_0x6fe2('0x9'));var squel=require('squel');var crypto=require(_0x6fe2('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6fe2('0xb'));var toCsv=require(_0x6fe2('0x7'));var querystring=require(_0x6fe2('0xc'));var Papa=require(_0x6fe2('0xd'));var Redis=require(_0x6fe2('0xe'));var authService=require(_0x6fe2('0xf'));var qs=require(_0x6fe2('0x10'));var as=require(_0x6fe2('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6fe2('0x12'));var utils=require(_0x6fe2('0x13'));var config=require(_0x6fe2('0x14'));var licenseUtil=require(_0x6fe2('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c421d,_0x3d59de){_0x3d59de=_0x3d59de||0xcc;return function(_0xd7ed63){if(_0xd7ed63){return _0x2c421d['sendStatus'](_0x3d59de);}return _0x2c421d[_0x6fe2('0x16')](_0x3d59de)[_0x6fe2('0x17')]();};}function respondWithResult(_0xb0a1e6,_0x159a3e){_0x159a3e=_0x159a3e||0xc8;return function(_0x5783d6){if(_0x5783d6){return _0xb0a1e6[_0x6fe2('0x16')](_0x159a3e)[_0x6fe2('0x18')](_0x5783d6);}};}function respondWithFilteredResult(_0x17eca8,_0x2c219d){return function(_0x2dc0c6){if(_0x2dc0c6){var _0xd75e0d=typeof _0x2c219d[_0x6fe2('0x19')]===_0x6fe2('0x1a')&&typeof _0x2c219d[_0x6fe2('0x1b')]===_0x6fe2('0x1a');var _0x578324=_0x2dc0c6['count'];var _0x465331=_0xd75e0d?0x0:_0x2c219d[_0x6fe2('0x19')];var _0x4424a0=_0xd75e0d?_0x2dc0c6[_0x6fe2('0x1c')]:_0x2c219d[_0x6fe2('0x19')]+_0x2c219d[_0x6fe2('0x1b')];var _0x12b366;if(_0x4424a0>=_0x578324){_0x4424a0=_0x578324;_0x12b366=0xc8;}else{_0x12b366=0xce;}_0x17eca8['status'](_0x12b366);return _0x17eca8['set'](_0x6fe2('0x1d'),_0x465331+'-'+_0x4424a0+'/'+_0x578324)[_0x6fe2('0x18')](_0x2dc0c6);}return null;};}function patchUpdates(_0x5cef7b){return function(_0x6c9e1e){try{jsonpatch[_0x6fe2('0x1e')](_0x6c9e1e,_0x5cef7b,!![]);}catch(_0x1e418a){return BPromise['reject'](_0x1e418a);}return _0x6c9e1e[_0x6fe2('0x1f')]();};}function saveUpdates(_0x1b4683,_0xff1c27){return function(_0x46e4d4){if(_0x46e4d4){return _0x46e4d4[_0x6fe2('0x20')](_0x1b4683)[_0x6fe2('0x21')](function(_0x210488){return _0x210488;});}return null;};}function removeEntity(_0xbc787b,_0x31eb16){return function(_0x4dbb37){if(_0x4dbb37){return _0x4dbb37[_0x6fe2('0x22')]()[_0x6fe2('0x21')](function(){_0xbc787b[_0x6fe2('0x16')](0xcc)[_0x6fe2('0x17')]();});}};}function handleEntityNotFound(_0x212c31,_0x1bd91f){return function(_0x50343d){if(!_0x50343d){_0x212c31[_0x6fe2('0x23')](0x194);}return _0x50343d;};}function handleError(_0x1b77bb,_0x8e9b10){_0x8e9b10=_0x8e9b10||0x1f4;return function(_0x15628c){logger['error'](_0x15628c[_0x6fe2('0x24')]);if(_0x15628c[_0x6fe2('0x25')]){delete _0x15628c['name'];}_0x1b77bb['status'](_0x8e9b10)[_0x6fe2('0x26')](_0x15628c);};}exports['index']=function(_0x2b7a66,_0x5b466a){var _0x4d1dd4={},_0x50475b={},_0x25f1de={'count':0x0,'rows':[]};var _0x42c625=_[_0x6fe2('0x27')](db[_0x6fe2('0x28')][_0x6fe2('0x29')],function(_0x38b064){return{'name':_0x38b064['fieldName'],'type':_0x38b064[_0x6fe2('0x2a')][_0x6fe2('0x2b')]};});_0x50475b[_0x6fe2('0x2c')]=_['map'](_0x42c625,_0x6fe2('0x25'));_0x50475b[_0x6fe2('0x2d')]=_[_0x6fe2('0x2e')](_0x2b7a66['query']);_0x50475b[_0x6fe2('0x2f')]=_[_0x6fe2('0x30')](_0x50475b[_0x6fe2('0x2c')],_0x50475b[_0x6fe2('0x2d')]);_0x4d1dd4[_0x6fe2('0x31')]=_[_0x6fe2('0x30')](_0x50475b[_0x6fe2('0x2c')],qs[_0x6fe2('0x32')](_0x2b7a66[_0x6fe2('0x2d')]['fields']));_0x4d1dd4[_0x6fe2('0x31')]=_0x4d1dd4[_0x6fe2('0x31')]['length']?_0x4d1dd4[_0x6fe2('0x31')]:_0x50475b[_0x6fe2('0x2c')];if(!_0x2b7a66['query']['hasOwnProperty'](_0x6fe2('0x33'))){_0x4d1dd4[_0x6fe2('0x1b')]=qs[_0x6fe2('0x1b')](_0x2b7a66[_0x6fe2('0x2d')][_0x6fe2('0x1b')]);_0x4d1dd4[_0x6fe2('0x19')]=qs[_0x6fe2('0x19')](_0x2b7a66[_0x6fe2('0x2d')]['offset']);}_0x4d1dd4['order']=qs['sort'](_0x2b7a66[_0x6fe2('0x2d')][_0x6fe2('0x34')]);_0x4d1dd4[_0x6fe2('0x35')]=qs[_0x6fe2('0x2f')](_['pick'](_0x2b7a66[_0x6fe2('0x2d')],_0x50475b[_0x6fe2('0x2f')]),_0x42c625);if(_0x2b7a66[_0x6fe2('0x2d')][_0x6fe2('0x36')]){_0x4d1dd4[_0x6fe2('0x35')]=_[_0x6fe2('0x37')](_0x4d1dd4['where'],{'$or':_['map'](_0x42c625,function(_0x11cac1){if(_0x11cac1[_0x6fe2('0x2a')]!==_0x6fe2('0x38')){var _0x37ee59={};_0x37ee59[_0x11cac1['name']]={'$like':'%'+_0x2b7a66[_0x6fe2('0x2d')]['filter']+'%'};return _0x37ee59;}})});}_0x4d1dd4=_['merge']({},_0x4d1dd4,_0x2b7a66[_0x6fe2('0x39')]);var _0x3c7898={'where':_0x4d1dd4[_0x6fe2('0x35')]};return db[_0x6fe2('0x28')]['count'](_0x3c7898)[_0x6fe2('0x21')](function(_0x1705a3){_0x25f1de[_0x6fe2('0x1c')]=_0x1705a3;if(_0x2b7a66[_0x6fe2('0x2d')]['includeAll']){_0x4d1dd4[_0x6fe2('0x3a')]=[{'all':!![]}];}return db[_0x6fe2('0x28')][_0x6fe2('0x3b')](_0x4d1dd4);})[_0x6fe2('0x21')](function(_0x36a051){_0x25f1de[_0x6fe2('0x3c')]=_0x36a051;return _0x25f1de;})[_0x6fe2('0x21')](respondWithFilteredResult(_0x5b466a,_0x4d1dd4))[_0x6fe2('0x3d')](handleError(_0x5b466a,null));};exports['show']=function(_0xc3f112,_0x439b2b){var _0x12ea42={'raw':!![],'where':{'id':_0xc3f112['params']['id']}},_0x240a1e={};_0x240a1e[_0x6fe2('0x2c')]=_[_0x6fe2('0x2e')](db[_0x6fe2('0x28')][_0x6fe2('0x29')]);_0x240a1e[_0x6fe2('0x2d')]=_[_0x6fe2('0x2e')](_0xc3f112[_0x6fe2('0x2d')]);_0x240a1e['filters']=_['intersection'](_0x240a1e[_0x6fe2('0x2c')],_0x240a1e[_0x6fe2('0x2d')]);_0x12ea42[_0x6fe2('0x31')]=_[_0x6fe2('0x30')](_0x240a1e[_0x6fe2('0x2c')],qs['fields'](_0xc3f112['query']['fields']));_0x12ea42[_0x6fe2('0x31')]=_0x12ea42[_0x6fe2('0x31')][_0x6fe2('0x3e')]?_0x12ea42[_0x6fe2('0x31')]:_0x240a1e[_0x6fe2('0x2c')];if(_0xc3f112['query'][_0x6fe2('0x3f')]){_0x12ea42[_0x6fe2('0x3a')]=[{'all':!![]}];}_0x12ea42=_[_0x6fe2('0x37')]({},_0x12ea42,_0xc3f112['options']);return db[_0x6fe2('0x28')][_0x6fe2('0x40')](_0x12ea42)[_0x6fe2('0x21')](handleEntityNotFound(_0x439b2b,null))[_0x6fe2('0x21')](respondWithResult(_0x439b2b,null))[_0x6fe2('0x3d')](handleError(_0x439b2b,null));};exports[_0x6fe2('0x41')]=function(_0x32b412,_0x1a3809){return db[_0x6fe2('0x28')][_0x6fe2('0x41')](_0x32b412[_0x6fe2('0x42')],{})[_0x6fe2('0x21')](respondWithResult(_0x1a3809,0xc9))['catch'](handleError(_0x1a3809,null));};exports[_0x6fe2('0x20')]=function(_0x1203ed,_0xe29a06){if(_0x1203ed[_0x6fe2('0x42')]['id']){delete _0x1203ed[_0x6fe2('0x42')]['id'];}return db[_0x6fe2('0x28')]['find']({'where':{'id':_0x1203ed[_0x6fe2('0x43')]['id']}})[_0x6fe2('0x21')](handleEntityNotFound(_0xe29a06,null))[_0x6fe2('0x21')](saveUpdates(_0x1203ed[_0x6fe2('0x42')],null))[_0x6fe2('0x21')](respondWithResult(_0xe29a06,null))[_0x6fe2('0x3d')](handleError(_0xe29a06,null));};exports[_0x6fe2('0x22')]=function(_0x1538e8,_0xa7d239){return db[_0x6fe2('0x28')][_0x6fe2('0x40')]({'where':{'id':_0x1538e8[_0x6fe2('0x43')]['id']}})['then'](handleEntityNotFound(_0xa7d239,null))[_0x6fe2('0x21')](removeEntity(_0xa7d239,null))['catch'](handleError(_0xa7d239,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 5833100..0f18b99 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 _0x8378=['../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x3b9daf,_0x4eaec1){var _0x4dade4=function(_0x48be2c){while(--_0x48be2c){_0x3b9daf['push'](_0x3b9daf['shift']());}};_0x4dade4(++_0x4eaec1);}(_0x8378,0x16e));var _0x8837=function(_0xf9606f,_0x3a6977){_0xf9606f=_0xf9606f-0x0;var _0x342774=_0x8378[_0xf9606f];return _0x342774;};'use strict';var _=require(_0x8837('0x0'));var util=require('util');var logger=require(_0x8837('0x1'))(_0x8837('0x2'));var moment=require(_0x8837('0x3'));var BPromise=require(_0x8837('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8837('0x5'));var rimraf=require('rimraf');var config=require(_0x8837('0x6'));var attributes=require(_0x8837('0x7'));module[_0x8837('0x8')]=function(_0x57794e,_0x1f8481){return _0x57794e[_0x8837('0x9')](_0x8837('0xa'),attributes,{'tableName':_0x8837('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd867=['api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport'];(function(_0x2c1ea4,_0x344a6c){var _0x329ea9=function(_0xe07f99){while(--_0xe07f99){_0x2c1ea4['push'](_0x2c1ea4['shift']());}};_0x329ea9(++_0x344a6c);}(_0xd867,0x117));var _0x7d86=function(_0x5b613e,_0x41fb77){_0x5b613e=_0x5b613e-0x0;var _0x213075=_0xd867[_0x5b613e];return _0x213075;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7d86('0x0'));var moment=require('moment');var BPromise=require(_0x7d86('0x1'));var rp=require(_0x7d86('0x2'));var fs=require('fs');var path=require(_0x7d86('0x3'));var rimraf=require(_0x7d86('0x4'));var config=require(_0x7d86('0x5'));var attributes=require(_0x7d86('0x6'));module['exports']=function(_0x4a1ff7,_0x2610ee){return _0x4a1ff7[_0x7d86('0x7')](_0x7d86('0x8'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index ce6eff9..8340476 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x1c9b2d,_0x439f74){var _0x3b44e7=function(_0x39342b){while(--_0x39342b){_0x1c9b2d['push'](_0x1c9b2d['shift']());}};_0x3b44e7(++_0x439f74);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xc4aa[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x331bb8,_0x56e1dd){var _0x4767d9=function(_0xe2f5f7){while(--_0xe2f5f7){_0x331bb8['push'](_0x331bb8['shift']());}};_0x4767d9(++_0x56e1dd);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xc4aa[_0x346737];return _0x1ade2e;};'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')]('AnalyticTreeReport,\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/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index d235eb9..aa4067b 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 _0x0d0f=['put','/:id','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./analyticTreeReport.controller','get','index','isAuthenticated','show','post','create'];(function(_0x15ece6,_0x51a965){var _0x3dc05c=function(_0x43e0c1){while(--_0x43e0c1){_0x15ece6['push'](_0x15ece6['shift']());}};_0x3dc05c(++_0x51a965);}(_0x0d0f,0xef));var _0xf0d0=function(_0x4c2fd1,_0x3f5739){_0x4c2fd1=_0x4c2fd1-0x0;var _0x199669=_0x0d0f[_0x4c2fd1];return _0x199669;};'use strict';var multer=require('multer');var util=require(_0xf0d0('0x0'));var path=require('path');var timeout=require(_0xf0d0('0x1'));var express=require(_0xf0d0('0x2'));var router=express[_0xf0d0('0x3')]();var fs_extra=require(_0xf0d0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf0d0('0x5'));var config=require('../../config/environment');var controller=require(_0xf0d0('0x6'));router[_0xf0d0('0x7')]('/',auth['isAuthenticated'](),controller[_0xf0d0('0x8')]);router[_0xf0d0('0x7')]('/:id',auth[_0xf0d0('0x9')](),controller[_0xf0d0('0xa')]);router[_0xf0d0('0xb')]('/',auth['isAuthenticated'](),controller[_0xf0d0('0xc')]);router[_0xf0d0('0xd')](_0xf0d0('0xe'),auth[_0xf0d0('0x9')](),controller[_0xf0d0('0xf')]);router['delete'](_0xf0d0('0xe'),auth[_0xf0d0('0x9')](),controller[_0xf0d0('0x10')]);module[_0xf0d0('0x11')]=router; \ No newline at end of file +var _0xf325=['create','put','/:id','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','show','post'];(function(_0x34f545,_0x2bd2ee){var _0x1ff6b8=function(_0x582e3b){while(--_0x582e3b){_0x34f545['push'](_0x34f545['shift']());}};_0x1ff6b8(++_0x2bd2ee);}(_0xf325,0x1c9));var _0x5f32=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0xf325[_0x616290];return _0x453879;};'use strict';var multer=require(_0x5f32('0x0'));var util=require(_0x5f32('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5f32('0x2'));var router=express[_0x5f32('0x3')]();var fs_extra=require(_0x5f32('0x4'));var auth=require(_0x5f32('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5f32('0x6'));var controller=require(_0x5f32('0x7'));router['get']('/',auth[_0x5f32('0x8')](),controller['index']);router['get']('/:id',auth[_0x5f32('0x8')](),controller[_0x5f32('0x9')]);router[_0x5f32('0xa')]('/',auth[_0x5f32('0x8')](),controller[_0x5f32('0xb')]);router[_0x5f32('0xc')](_0x5f32('0xd'),auth[_0x5f32('0x8')](),controller[_0x5f32('0xe')]);router[_0x5f32('0xf')](_0x5f32('0xd'),auth[_0x5f32('0x8')](),controller[_0x5f32('0x10')]);module[_0x5f32('0x11')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index b3e2a4a..fa59f45 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 _0x9658=['STRING','sequelize'];(function(_0x55d83d,_0x3241d8){var _0x25df7f=function(_0x224f76){while(--_0x224f76){_0x55d83d['push'](_0x55d83d['shift']());}};_0x25df7f(++_0x3241d8);}(_0x9658,0x6f));var _0x8965=function(_0x3d2e4b,_0x1f6653){_0x3d2e4b=_0x3d2e4b-0x0;var _0x509e78=_0x9658[_0x3d2e4b];return _0x509e78;};'use strict';var Sequelize=require(_0x8965('0x0'));module['exports']={'name':{'type':Sequelize[_0x8965('0x1')]},'basename':{'type':Sequelize[_0x8965('0x1')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xaf80=['sequelize','exports','STRING'];(function(_0x1f1a0c,_0x179d1){var _0x5a974f=function(_0x5045a6){while(--_0x5045a6){_0x1f1a0c['push'](_0x1f1a0c['shift']());}};_0x5a974f(++_0x179d1);}(_0xaf80,0x1ef));var _0x0af8=function(_0x2d365c,_0x54c05d){_0x2d365c=_0x2d365c-0x0;var _0x49ce9f=_0xaf80[_0x2d365c];return _0x49ce9f;};'use strict';var Sequelize=require(_0x0af8('0x0'));module[_0x0af8('0x1')]={'name':{'type':Sequelize[_0x0af8('0x2')]},'basename':{'type':Sequelize[_0x0af8('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 7234593..5e6aa9b 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 _0xdf88=['destroy','stack','name','send','index','map','Attachment','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','merge','type','VIRTUAL','filter','options','include','findAll','rows','show','rawAttributes','includeAll','catch','clone','find','get','createdAt','updatedAt','omit','create','body','params','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then'];(function(_0x8a0c86,_0xfe68c1){var _0x4e2c86=function(_0xfa5fad){while(--_0xfa5fad){_0x8a0c86['push'](_0x8a0c86['shift']());}};_0x4e2c86(++_0xfe68c1);}(_0xdf88,0x90));var _0x8df8=function(_0x5375f1,_0x201334){_0x5375f1=_0x5375f1-0x0;var _0x4ad68d=_0xdf88[_0x5375f1];return _0x4ad68d;};'use strict';var emlformat=require(_0x8df8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8df8('0x1'));var moment=require(_0x8df8('0x2'));var BPromise=require(_0x8df8('0x3'));var Mustache=require(_0x8df8('0x4'));var util=require(_0x8df8('0x5'));var path=require(_0x8df8('0x6'));var sox=require(_0x8df8('0x7'));var csv=require(_0x8df8('0x8'));var ejs=require(_0x8df8('0x9'));var fs=require('fs');var fs_extra=require(_0x8df8('0xa'));var _=require(_0x8df8('0xb'));var squel=require(_0x8df8('0xc'));var crypto=require(_0x8df8('0xd'));var jsforce=require(_0x8df8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8df8('0x8'));var querystring=require(_0x8df8('0xf'));var Papa=require('papaparse');var Redis=require(_0x8df8('0x10'));var authService=require(_0x8df8('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8df8('0x12'));var hardwareService=require(_0x8df8('0x13'));var logger=require(_0x8df8('0x14'))(_0x8df8('0x15'));var utils=require(_0x8df8('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xebb07b,_0x1d5912){_0x1d5912=_0x1d5912||0xcc;return function(_0x472f07){if(_0x472f07){return _0xebb07b[_0x8df8('0x17')](_0x1d5912);}return _0xebb07b[_0x8df8('0x18')](_0x1d5912)[_0x8df8('0x19')]();};}function respondWithResult(_0x2d224f,_0x377051){_0x377051=_0x377051||0xc8;return function(_0x76e109){if(_0x76e109){return _0x2d224f['status'](_0x377051)[_0x8df8('0x1a')](_0x76e109);}};}function respondWithFilteredResult(_0x111675,_0x3cf668){return function(_0x49624a){if(_0x49624a){var _0x475954=typeof _0x3cf668[_0x8df8('0x1b')]===_0x8df8('0x1c')&&typeof _0x3cf668[_0x8df8('0x1d')]===_0x8df8('0x1c');var _0x4d0419=_0x49624a[_0x8df8('0x1e')];var _0x226597=_0x475954?0x0:_0x3cf668[_0x8df8('0x1b')];var _0x4d2ec7=_0x475954?_0x49624a[_0x8df8('0x1e')]:_0x3cf668[_0x8df8('0x1b')]+_0x3cf668[_0x8df8('0x1d')];var _0x39462c;if(_0x4d2ec7>=_0x4d0419){_0x4d2ec7=_0x4d0419;_0x39462c=0xc8;}else{_0x39462c=0xce;}_0x111675['status'](_0x39462c);return _0x111675[_0x8df8('0x1f')](_0x8df8('0x20'),_0x226597+'-'+_0x4d2ec7+'/'+_0x4d0419)[_0x8df8('0x1a')](_0x49624a);}return null;};}function patchUpdates(_0x4eeaec){return function(_0x227135){try{jsonpatch[_0x8df8('0x21')](_0x227135,_0x4eeaec,!![]);}catch(_0x31af78){return BPromise['reject'](_0x31af78);}return _0x227135['save']();};}function saveUpdates(_0x50f201,_0x257ac1){return function(_0x191959){if(_0x191959){return _0x191959[_0x8df8('0x22')](_0x50f201)[_0x8df8('0x23')](function(_0x315288){return _0x315288;});}return null;};}function removeEntity(_0x17ec28,_0x46d84e){return function(_0x1b0b59){if(_0x1b0b59){return _0x1b0b59[_0x8df8('0x24')]()[_0x8df8('0x23')](function(){_0x17ec28['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c1762,_0x52ad3f){return function(_0x49df68){if(!_0x49df68){_0x4c1762[_0x8df8('0x17')](0x194);}return _0x49df68;};}function handleError(_0x55517c,_0x2d266d){_0x2d266d=_0x2d266d||0x1f4;return function(_0xe09bb3){logger['error'](_0xe09bb3[_0x8df8('0x25')]);if(_0xe09bb3[_0x8df8('0x26')]){delete _0xe09bb3[_0x8df8('0x26')];}_0x55517c['status'](_0x2d266d)[_0x8df8('0x27')](_0xe09bb3);};}exports[_0x8df8('0x28')]=function(_0x1ad5e4,_0x462cca){var _0x56d91b={},_0x1322f3={},_0xb7ecf0={'count':0x0,'rows':[]};var _0x40b659=_[_0x8df8('0x29')](db[_0x8df8('0x2a')]['rawAttributes'],function(_0x5d3581){return{'name':_0x5d3581[_0x8df8('0x2b')],'type':_0x5d3581['type'][_0x8df8('0x2c')]};});_0x1322f3[_0x8df8('0x2d')]=_['map'](_0x40b659,'name');_0x1322f3[_0x8df8('0x2e')]=_[_0x8df8('0x2f')](_0x1ad5e4[_0x8df8('0x2e')]);_0x1322f3['filters']=_[_0x8df8('0x30')](_0x1322f3[_0x8df8('0x2d')],_0x1322f3[_0x8df8('0x2e')]);_0x56d91b[_0x8df8('0x31')]=_[_0x8df8('0x30')](_0x1322f3[_0x8df8('0x2d')],qs['fields'](_0x1ad5e4[_0x8df8('0x2e')][_0x8df8('0x32')]));_0x56d91b[_0x8df8('0x31')]=_0x56d91b[_0x8df8('0x31')][_0x8df8('0x33')]?_0x56d91b[_0x8df8('0x31')]:_0x1322f3[_0x8df8('0x2d')];if(!_0x1ad5e4['query'][_0x8df8('0x34')](_0x8df8('0x35'))){_0x56d91b[_0x8df8('0x1d')]=qs[_0x8df8('0x1d')](_0x1ad5e4[_0x8df8('0x2e')]['limit']);_0x56d91b[_0x8df8('0x1b')]=qs[_0x8df8('0x1b')](_0x1ad5e4[_0x8df8('0x2e')][_0x8df8('0x1b')]);}_0x56d91b['order']=qs[_0x8df8('0x36')](_0x1ad5e4['query'][_0x8df8('0x36')]);_0x56d91b[_0x8df8('0x37')]=qs[_0x8df8('0x38')](_['pick'](_0x1ad5e4[_0x8df8('0x2e')],_0x1322f3['filters']),_0x40b659);if(_0x1ad5e4['query']['filter']){_0x56d91b[_0x8df8('0x37')]=_[_0x8df8('0x39')](_0x56d91b[_0x8df8('0x37')],{'$or':_[_0x8df8('0x29')](_0x40b659,function(_0x139af6){if(_0x139af6[_0x8df8('0x3a')]!==_0x8df8('0x3b')){var _0x5cfeba={};_0x5cfeba[_0x139af6['name']]={'$like':'%'+_0x1ad5e4['query'][_0x8df8('0x3c')]+'%'};return _0x5cfeba;}})});}_0x56d91b=_[_0x8df8('0x39')]({},_0x56d91b,_0x1ad5e4[_0x8df8('0x3d')]);var _0x5250de={'where':_0x56d91b[_0x8df8('0x37')]};return db['Attachment'][_0x8df8('0x1e')](_0x5250de)[_0x8df8('0x23')](function(_0xa69448){_0xb7ecf0[_0x8df8('0x1e')]=_0xa69448;if(_0x1ad5e4[_0x8df8('0x2e')]['includeAll']){_0x56d91b[_0x8df8('0x3e')]=[{'all':!![]}];}return db['Attachment'][_0x8df8('0x3f')](_0x56d91b);})['then'](function(_0x27cfc4){_0xb7ecf0[_0x8df8('0x40')]=_0x27cfc4;return _0xb7ecf0;})[_0x8df8('0x23')](respondWithFilteredResult(_0x462cca,_0x56d91b))['catch'](handleError(_0x462cca,null));};exports[_0x8df8('0x41')]=function(_0x19933b,_0xf34846){var _0x6b1946={'raw':!![],'where':{'id':_0x19933b['params']['id']}},_0x4178df={};_0x4178df['model']=_[_0x8df8('0x2f')](db['Attachment'][_0x8df8('0x42')]);_0x4178df[_0x8df8('0x2e')]=_[_0x8df8('0x2f')](_0x19933b[_0x8df8('0x2e')]);_0x4178df[_0x8df8('0x38')]=_['intersection'](_0x4178df[_0x8df8('0x2d')],_0x4178df[_0x8df8('0x2e')]);_0x6b1946[_0x8df8('0x31')]=_[_0x8df8('0x30')](_0x4178df[_0x8df8('0x2d')],qs[_0x8df8('0x32')](_0x19933b[_0x8df8('0x2e')][_0x8df8('0x32')]));_0x6b1946[_0x8df8('0x31')]=_0x6b1946[_0x8df8('0x31')]['length']?_0x6b1946['attributes']:_0x4178df['model'];if(_0x19933b[_0x8df8('0x2e')][_0x8df8('0x43')]){_0x6b1946[_0x8df8('0x3e')]=[{'all':!![]}];}_0x6b1946=_['merge']({},_0x6b1946,_0x19933b[_0x8df8('0x3d')]);return db[_0x8df8('0x2a')]['find'](_0x6b1946)['then'](handleEntityNotFound(_0xf34846,null))['then'](respondWithResult(_0xf34846,null))[_0x8df8('0x44')](handleError(_0xf34846,null));};exports[_0x8df8('0x45')]=function(_0x541a84,_0x18e736){var _0x59dc99={'where':{'id':_0x541a84['params']['id']}},_0x54b589={};_0x54b589[_0x8df8('0x2d')]=_[_0x8df8('0x2f')](db[_0x8df8('0x2a')][_0x8df8('0x42')]);_0x59dc99[_0x8df8('0x31')]=_[_0x8df8('0x30')](_0x54b589[_0x8df8('0x2d')],qs[_0x8df8('0x32')](_0x541a84[_0x8df8('0x2e')][_0x8df8('0x32')]));_0x59dc99['attributes']=_0x59dc99[_0x8df8('0x31')][_0x8df8('0x33')]?_0x59dc99['attributes']:_0x54b589[_0x8df8('0x2d')];if(_0x541a84[_0x8df8('0x2e')]['includeAll']){_0x59dc99[_0x8df8('0x3e')]=[{'all':!![]}];}_0x59dc99=_[_0x8df8('0x39')]({},_0x59dc99,_0x541a84[_0x8df8('0x3d')]);return db[_0x8df8('0x2a')][_0x8df8('0x46')](_0x59dc99)[_0x8df8('0x23')](handleEntityNotFound(_0x18e736,null))['then'](function(_0x591ae4){if(_0x591ae4){var _0x59a8ce=_0x591ae4[_0x8df8('0x47')]({'plain':!![]});_0x59a8ce=qs['omit'](_0x59a8ce,['id',_0x8df8('0x48'),_0x8df8('0x49')]);_0x541a84['body']=_[_0x8df8('0x4a')](_0x541a84['body'],['id',_0x8df8('0x48'),_0x8df8('0x49')]);return db[_0x8df8('0x2a')][_0x8df8('0x4b')](_[_0x8df8('0x39')](_0x59a8ce,_0x541a84[_0x8df8('0x4c')]),{'include':_0x541a84[_0x8df8('0x2e')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x8df8('0x23')](respondWithResult(_0x18e736,0xc9))[_0x8df8('0x44')](handleError(_0x18e736,null));};exports[_0x8df8('0x22')]=function(_0x4695ba,_0x6f2a49){if(_0x4695ba[_0x8df8('0x4c')]['id']){delete _0x4695ba[_0x8df8('0x4c')]['id'];}return db['Attachment'][_0x8df8('0x46')]({'where':{'id':_0x4695ba['params']['id']}})[_0x8df8('0x23')](handleEntityNotFound(_0x6f2a49,null))[_0x8df8('0x23')](saveUpdates(_0x4695ba[_0x8df8('0x4c')],null))['then'](respondWithResult(_0x6f2a49,null))[_0x8df8('0x44')](handleError(_0x6f2a49,null));};exports['destroy']=function(_0xec4275,_0x597486){return db['Attachment'][_0x8df8('0x46')]({'where':{'id':_0xec4275[_0x8df8('0x4d')]['id']}})[_0x8df8('0x23')](handleEntityNotFound(_0x597486,null))[_0x8df8('0x23')](removeEntity(_0x597486,null))[_0x8df8('0x44')](handleError(_0x597486,null));};exports[_0x8df8('0x4b')]=function(_0x5efd50,_0x1fe636,_0x41bcc7){_0x5efd50[_0x8df8('0x4c')][_0x8df8('0x26')]=_0x5efd50[_0x8df8('0x4e')][_0x8df8('0x4f')];_0x5efd50['body'][_0x8df8('0x50')]=_0x5efd50[_0x8df8('0x4e')][_0x8df8('0x51')];_0x5efd50[_0x8df8('0x4c')][_0x8df8('0x3a')]=_0x5efd50[_0x8df8('0x4e')][_0x8df8('0x52')];return db[_0x8df8('0x2a')]['create'](_0x5efd50[_0x8df8('0x4c')])[_0x8df8('0x23')](respondWithResult(_0x1fe636,0xc9))['catch'](handleError(_0x1fe636,null));};exports[_0x8df8('0x53')]=function(_0x30a5be,_0x1a89a3,_0x27aca1){return db[_0x8df8('0x2a')][_0x8df8('0x54')]({'where':{'id':_0x30a5be[_0x8df8('0x4d')]['id']},'raw':!![]})[_0x8df8('0x23')](handleEntityNotFound(_0x1a89a3,null))[_0x8df8('0x23')](function(_0x2e7112){if(_0x2e7112){var _0x50c1b0=_0x2e7112[_0x8df8('0x55')]!==null;var _0x47e552=path[_0x8df8('0x56')](config[_0x8df8('0x57')],_0x8df8('0x58'));if(_0x50c1b0){_0x47e552=path['join'](_0x47e552,_0x8df8('0x59'));}var _0x1716f9=path['join'](_0x47e552,_0x2e7112[_0x8df8('0x50')]);return _0x1a89a3[_0x8df8('0x53')](_0x1716f9);}})['catch'](handleError(_0x1a89a3,null));}; \ No newline at end of file +var _0xdff7=['intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filters','merge','map','filter','options','includeAll','findAll','rows','params','include','find','catch','clone','get','omit','createdAt','updatedAt','create','body','originalname','file','filename','download','findOne','join','root','server/files/attachments/','offline-chat/','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','Attachment','fieldName','type','key','query','keys'];(function(_0x164df2,_0x4083ee){var _0x4abfa1=function(_0x226c9b){while(--_0x226c9b){_0x164df2['push'](_0x164df2['shift']());}};_0x4abfa1(++_0x4083ee);}(_0xdff7,0x128));var _0x7dff=function(_0x78cf2d,_0x1f6e15){_0x78cf2d=_0x78cf2d-0x0;var _0x338673=_0xdff7[_0x78cf2d];return _0x338673;};'use strict';var emlformat=require(_0x7dff('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7dff('0x1'));var rp=require(_0x7dff('0x2'));var moment=require('moment');var BPromise=require(_0x7dff('0x3'));var Mustache=require(_0x7dff('0x4'));var util=require('util');var path=require(_0x7dff('0x5'));var sox=require(_0x7dff('0x6'));var csv=require(_0x7dff('0x7'));var ejs=require(_0x7dff('0x8'));var fs=require('fs');var fs_extra=require(_0x7dff('0x9'));var _=require(_0x7dff('0xa'));var squel=require(_0x7dff('0xb'));var crypto=require(_0x7dff('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7dff('0xd'));var toCsv=require(_0x7dff('0x7'));var querystring=require(_0x7dff('0xe'));var Papa=require('papaparse');var Redis=require(_0x7dff('0xf'));var authService=require(_0x7dff('0x10'));var qs=require(_0x7dff('0x11'));var as=require(_0x7dff('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7dff('0x13'))(_0x7dff('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7dff('0x15'));var db=require(_0x7dff('0x16'))['db'];function respondWithStatusCode(_0xc2676,_0x3026eb){_0x3026eb=_0x3026eb||0xcc;return function(_0x552b7f){if(_0x552b7f){return _0xc2676[_0x7dff('0x17')](_0x3026eb);}return _0xc2676[_0x7dff('0x18')](_0x3026eb)['end']();};}function respondWithResult(_0x591f74,_0x365907){_0x365907=_0x365907||0xc8;return function(_0x54577e){if(_0x54577e){return _0x591f74[_0x7dff('0x18')](_0x365907)[_0x7dff('0x19')](_0x54577e);}};}function respondWithFilteredResult(_0x374019,_0x279b26){return function(_0x31c9bc){if(_0x31c9bc){var _0x478c6b=typeof _0x279b26[_0x7dff('0x1a')]===_0x7dff('0x1b')&&typeof _0x279b26[_0x7dff('0x1c')]===_0x7dff('0x1b');var _0x3dd68a=_0x31c9bc[_0x7dff('0x1d')];var _0x3803a0=_0x478c6b?0x0:_0x279b26['offset'];var _0x25edd1=_0x478c6b?_0x31c9bc['count']:_0x279b26[_0x7dff('0x1a')]+_0x279b26[_0x7dff('0x1c')];var _0x17dd46;if(_0x25edd1>=_0x3dd68a){_0x25edd1=_0x3dd68a;_0x17dd46=0xc8;}else{_0x17dd46=0xce;}_0x374019[_0x7dff('0x18')](_0x17dd46);return _0x374019[_0x7dff('0x1e')](_0x7dff('0x1f'),_0x3803a0+'-'+_0x25edd1+'/'+_0x3dd68a)['json'](_0x31c9bc);}return null;};}function patchUpdates(_0x54ee79){return function(_0x258ef5){try{jsonpatch[_0x7dff('0x20')](_0x258ef5,_0x54ee79,!![]);}catch(_0x36f95c){return BPromise[_0x7dff('0x21')](_0x36f95c);}return _0x258ef5[_0x7dff('0x22')]();};}function saveUpdates(_0x5534bd,_0x1bd341){return function(_0x5dd0ed){if(_0x5dd0ed){return _0x5dd0ed[_0x7dff('0x23')](_0x5534bd)[_0x7dff('0x24')](function(_0x4b5d78){return _0x4b5d78;});}return null;};}function removeEntity(_0x541086,_0x53c36d){return function(_0x3fd80f){if(_0x3fd80f){return _0x3fd80f[_0x7dff('0x25')]()[_0x7dff('0x24')](function(){_0x541086['status'](0xcc)[_0x7dff('0x26')]();});}};}function handleEntityNotFound(_0x476054,_0x13faff){return function(_0x14b2cc){if(!_0x14b2cc){_0x476054[_0x7dff('0x17')](0x194);}return _0x14b2cc;};}function handleError(_0x25a8ff,_0xd5af5){_0xd5af5=_0xd5af5||0x1f4;return function(_0x4171be){logger[_0x7dff('0x27')](_0x4171be[_0x7dff('0x28')]);if(_0x4171be['name']){delete _0x4171be[_0x7dff('0x29')];}_0x25a8ff[_0x7dff('0x18')](_0xd5af5)['send'](_0x4171be);};}exports['index']=function(_0x4ae4df,_0x15a9ed){var _0x7f0031={},_0x16b58f={},_0x4c60f8={'count':0x0,'rows':[]};var _0x55717e=_['map'](db[_0x7dff('0x2a')]['rawAttributes'],function(_0x384699){return{'name':_0x384699[_0x7dff('0x2b')],'type':_0x384699[_0x7dff('0x2c')][_0x7dff('0x2d')]};});_0x16b58f['model']=_['map'](_0x55717e,_0x7dff('0x29'));_0x16b58f[_0x7dff('0x2e')]=_[_0x7dff('0x2f')](_0x4ae4df[_0x7dff('0x2e')]);_0x16b58f['filters']=_[_0x7dff('0x30')](_0x16b58f['model'],_0x16b58f[_0x7dff('0x2e')]);_0x7f0031[_0x7dff('0x31')]=_[_0x7dff('0x30')](_0x16b58f[_0x7dff('0x32')],qs[_0x7dff('0x33')](_0x4ae4df['query'][_0x7dff('0x33')]));_0x7f0031[_0x7dff('0x31')]=_0x7f0031[_0x7dff('0x31')][_0x7dff('0x34')]?_0x7f0031[_0x7dff('0x31')]:_0x16b58f[_0x7dff('0x32')];if(!_0x4ae4df[_0x7dff('0x2e')]['hasOwnProperty'](_0x7dff('0x35'))){_0x7f0031[_0x7dff('0x1c')]=qs[_0x7dff('0x1c')](_0x4ae4df[_0x7dff('0x2e')]['limit']);_0x7f0031[_0x7dff('0x1a')]=qs['offset'](_0x4ae4df[_0x7dff('0x2e')][_0x7dff('0x1a')]);}_0x7f0031[_0x7dff('0x36')]=qs[_0x7dff('0x37')](_0x4ae4df[_0x7dff('0x2e')][_0x7dff('0x37')]);_0x7f0031[_0x7dff('0x38')]=qs['filters'](_[_0x7dff('0x39')](_0x4ae4df[_0x7dff('0x2e')],_0x16b58f[_0x7dff('0x3a')]),_0x55717e);if(_0x4ae4df[_0x7dff('0x2e')]['filter']){_0x7f0031[_0x7dff('0x38')]=_[_0x7dff('0x3b')](_0x7f0031['where'],{'$or':_[_0x7dff('0x3c')](_0x55717e,function(_0x330395){if(_0x330395[_0x7dff('0x2c')]!=='VIRTUAL'){var _0x2aaf6f={};_0x2aaf6f[_0x330395[_0x7dff('0x29')]]={'$like':'%'+_0x4ae4df[_0x7dff('0x2e')][_0x7dff('0x3d')]+'%'};return _0x2aaf6f;}})});}_0x7f0031=_[_0x7dff('0x3b')]({},_0x7f0031,_0x4ae4df[_0x7dff('0x3e')]);var _0x30af09={'where':_0x7f0031[_0x7dff('0x38')]};return db[_0x7dff('0x2a')][_0x7dff('0x1d')](_0x30af09)[_0x7dff('0x24')](function(_0x1cfb88){_0x4c60f8[_0x7dff('0x1d')]=_0x1cfb88;if(_0x4ae4df[_0x7dff('0x2e')][_0x7dff('0x3f')]){_0x7f0031['include']=[{'all':!![]}];}return db[_0x7dff('0x2a')][_0x7dff('0x40')](_0x7f0031);})[_0x7dff('0x24')](function(_0x3f7077){_0x4c60f8[_0x7dff('0x41')]=_0x3f7077;return _0x4c60f8;})[_0x7dff('0x24')](respondWithFilteredResult(_0x15a9ed,_0x7f0031))['catch'](handleError(_0x15a9ed,null));};exports['show']=function(_0x3f74bd,_0x324fce){var _0x549911={'raw':!![],'where':{'id':_0x3f74bd[_0x7dff('0x42')]['id']}},_0x3ed2cb={};_0x3ed2cb['model']=_[_0x7dff('0x2f')](db[_0x7dff('0x2a')]['rawAttributes']);_0x3ed2cb['query']=_[_0x7dff('0x2f')](_0x3f74bd['query']);_0x3ed2cb[_0x7dff('0x3a')]=_[_0x7dff('0x30')](_0x3ed2cb[_0x7dff('0x32')],_0x3ed2cb[_0x7dff('0x2e')]);_0x549911['attributes']=_['intersection'](_0x3ed2cb['model'],qs[_0x7dff('0x33')](_0x3f74bd[_0x7dff('0x2e')]['fields']));_0x549911[_0x7dff('0x31')]=_0x549911[_0x7dff('0x31')][_0x7dff('0x34')]?_0x549911[_0x7dff('0x31')]:_0x3ed2cb[_0x7dff('0x32')];if(_0x3f74bd[_0x7dff('0x2e')]['includeAll']){_0x549911[_0x7dff('0x43')]=[{'all':!![]}];}_0x549911=_['merge']({},_0x549911,_0x3f74bd['options']);return db[_0x7dff('0x2a')][_0x7dff('0x44')](_0x549911)['then'](handleEntityNotFound(_0x324fce,null))['then'](respondWithResult(_0x324fce,null))[_0x7dff('0x45')](handleError(_0x324fce,null));};exports[_0x7dff('0x46')]=function(_0x1f677d,_0x5a4547){var _0x387f24={'where':{'id':_0x1f677d[_0x7dff('0x42')]['id']}},_0x24ab9={};_0x24ab9['model']=_['keys'](db['Attachment']['rawAttributes']);_0x387f24[_0x7dff('0x31')]=_[_0x7dff('0x30')](_0x24ab9[_0x7dff('0x32')],qs[_0x7dff('0x33')](_0x1f677d['query'][_0x7dff('0x33')]));_0x387f24['attributes']=_0x387f24[_0x7dff('0x31')][_0x7dff('0x34')]?_0x387f24['attributes']:_0x24ab9[_0x7dff('0x32')];if(_0x1f677d[_0x7dff('0x2e')][_0x7dff('0x3f')]){_0x387f24[_0x7dff('0x43')]=[{'all':!![]}];}_0x387f24=_['merge']({},_0x387f24,_0x1f677d['options']);return db[_0x7dff('0x2a')][_0x7dff('0x44')](_0x387f24)['then'](handleEntityNotFound(_0x5a4547,null))[_0x7dff('0x24')](function(_0x4ff2db){if(_0x4ff2db){var _0x5cb9b8=_0x4ff2db[_0x7dff('0x47')]({'plain':!![]});_0x5cb9b8=qs[_0x7dff('0x48')](_0x5cb9b8,['id',_0x7dff('0x49'),_0x7dff('0x4a')]);_0x1f677d['body']=_['omit'](_0x1f677d['body'],['id',_0x7dff('0x49'),_0x7dff('0x4a')]);return db[_0x7dff('0x2a')][_0x7dff('0x4b')](_['merge'](_0x5cb9b8,_0x1f677d[_0x7dff('0x4c')]),{'include':_0x1f677d[_0x7dff('0x2e')][_0x7dff('0x3f')]?[{'all':!![]}]:undefined});}})[_0x7dff('0x24')](respondWithResult(_0x5a4547,0xc9))[_0x7dff('0x45')](handleError(_0x5a4547,null));};exports[_0x7dff('0x23')]=function(_0x418501,_0x3d2876){if(_0x418501[_0x7dff('0x4c')]['id']){delete _0x418501['body']['id'];}return db[_0x7dff('0x2a')][_0x7dff('0x44')]({'where':{'id':_0x418501[_0x7dff('0x42')]['id']}})[_0x7dff('0x24')](handleEntityNotFound(_0x3d2876,null))['then'](saveUpdates(_0x418501[_0x7dff('0x4c')],null))[_0x7dff('0x24')](respondWithResult(_0x3d2876,null))['catch'](handleError(_0x3d2876,null));};exports['destroy']=function(_0x45b104,_0x301a38){return db[_0x7dff('0x2a')][_0x7dff('0x44')]({'where':{'id':_0x45b104[_0x7dff('0x42')]['id']}})[_0x7dff('0x24')](handleEntityNotFound(_0x301a38,null))[_0x7dff('0x24')](removeEntity(_0x301a38,null))['catch'](handleError(_0x301a38,null));};exports[_0x7dff('0x4b')]=function(_0x1e247f,_0x4e2da3,_0x1f96f2){_0x1e247f['body'][_0x7dff('0x29')]=_0x1e247f['file'][_0x7dff('0x4d')];_0x1e247f[_0x7dff('0x4c')]['basename']=_0x1e247f[_0x7dff('0x4e')][_0x7dff('0x4f')];_0x1e247f['body'][_0x7dff('0x2c')]=_0x1e247f[_0x7dff('0x4e')]['mimetype'];return db[_0x7dff('0x2a')][_0x7dff('0x4b')](_0x1e247f[_0x7dff('0x4c')])[_0x7dff('0x24')](respondWithResult(_0x4e2da3,0xc9))['catch'](handleError(_0x4e2da3,null));};exports[_0x7dff('0x50')]=function(_0x2b4eaa,_0x8ce13e,_0x47bd0d){return db[_0x7dff('0x2a')][_0x7dff('0x51')]({'where':{'id':_0x2b4eaa['params']['id']},'raw':!![]})[_0x7dff('0x24')](handleEntityNotFound(_0x8ce13e,null))[_0x7dff('0x24')](function(_0x412655){if(_0x412655){var _0x1ec1ad=_0x412655['ChatOfflineMessageId']!==null;var _0x58a2a8=path[_0x7dff('0x52')](config[_0x7dff('0x53')],_0x7dff('0x54'));if(_0x1ec1ad){_0x58a2a8=path[_0x7dff('0x52')](_0x58a2a8,_0x7dff('0x55'));}var _0x3e9019=path[_0x7dff('0x52')](_0x58a2a8,_0x412655['basename']);return _0x8ce13e[_0x7dff('0x50')](_0x3e9019);}})[_0x7dff('0x45')](handleError(_0x8ce13e,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 797cbf7..09ef8dc 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 _0x0a1b=['bluebird','request-promise','path','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','moment'];(function(_0x4b9444,_0x42a378){var _0x3d878e=function(_0x1b0ef9){while(--_0x1b0ef9){_0x4b9444['push'](_0x4b9444['shift']());}};_0x3d878e(++_0x42a378);}(_0x0a1b,0x7e));var _0xb0a1=function(_0x47d90f,_0x5e601a){_0x47d90f=_0x47d90f-0x0;var _0x287a54=_0x0a1b[_0x47d90f];return _0x287a54;};'use strict';var _=require(_0xb0a1('0x0'));var util=require(_0xb0a1('0x1'));var logger=require(_0xb0a1('0x2'))('api');var moment=require(_0xb0a1('0x3'));var BPromise=require(_0xb0a1('0x4'));var rp=require(_0xb0a1('0x5'));var fs=require('fs');var path=require(_0xb0a1('0x6'));var rimraf=require('rimraf');var config=require(_0xb0a1('0x7'));var attributes=require(_0xb0a1('0x8'));module[_0xb0a1('0x9')]=function(_0xc26be9,_0x27dce9){return _0xc26be9[_0xb0a1('0xa')](_0xb0a1('0xb'),attributes,{'tableName':_0xb0a1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x542e=['bluebird','request-promise','rimraf','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','moment'];(function(_0xaeedca,_0x170237){var _0x562b76=function(_0x10cbbe){while(--_0x10cbbe){_0xaeedca['push'](_0xaeedca['shift']());}};_0x562b76(++_0x170237);}(_0x542e,0xec));var _0xe542=function(_0x253ac1,_0x1c524c){_0x253ac1=_0x253ac1-0x0;var _0x3729d1=_0x542e[_0x253ac1];return _0x3729d1;};'use strict';var _=require(_0xe542('0x0'));var util=require(_0xe542('0x1'));var logger=require(_0xe542('0x2'))('api');var moment=require(_0xe542('0x3'));var BPromise=require(_0xe542('0x4'));var rp=require(_0xe542('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe542('0x6'));var config=require('../../config/environment');var attributes=require(_0xe542('0x7'));module[_0xe542('0x8')]=function(_0x2ebfbc,_0xf97d76){return _0x2ebfbc[_0xe542('0x9')](_0xe542('0xa'),attributes,{'tableName':_0xe542('0xb'),'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 89868d0..7b1336b 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 _0x8b7c=['stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateAttachment','Attachment','options','raw'];(function(_0x5a123f,_0x14cb93){var _0x40f3e8=function(_0x19fb34){while(--_0x19fb34){_0x5a123f['push'](_0x5a123f['shift']());}};_0x40f3e8(++_0x14cb93);}(_0x8b7c,0x119));var _0xc8b7=function(_0x400b43,_0x55da4e){_0x400b43=_0x400b43-0x0;var _0x3c330f=_0x8b7c[_0x400b43];return _0x3c330f;};'use strict';var _=require(_0xc8b7('0x0'));var util=require(_0xc8b7('0x1'));var moment=require(_0xc8b7('0x2'));var BPromise=require(_0xc8b7('0x3'));var rs=require(_0xc8b7('0x4'));var fs=require('fs');var Redis=require(_0xc8b7('0x5'));var db=require(_0xc8b7('0x6'))['db'];var utils=require(_0xc8b7('0x7'));var logger=require('../../config/logger')(_0xc8b7('0x8'));var config=require(_0xc8b7('0x9'));var jayson=require(_0xc8b7('0xa'));var client=jayson['client'][_0xc8b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x90cb38,_0x42d65e,_0x2c7807){return new BPromise(function(_0x9e4763,_0x2f149d){return client['request'](_0x90cb38,_0x2c7807)[_0xc8b7('0xc')](function(_0x504550){logger[_0xc8b7('0xd')](_0xc8b7('0xe'),_0x42d65e,_0xc8b7('0xf'));logger[_0xc8b7('0x10')](_0xc8b7('0x11'),_0x42d65e,'request\x20sent',JSON['stringify'](_0x504550));if(_0x504550['error']){if(_0x504550[_0xc8b7('0x12')][_0xc8b7('0x13')]===0x1f4){logger[_0xc8b7('0x12')](_0xc8b7('0xe'),_0x42d65e,_0x504550['error']['message']);return _0x2f149d(_0x504550['error'][_0xc8b7('0x14')]);}logger[_0xc8b7('0x12')](_0xc8b7('0xe'),_0x42d65e,_0x504550['error'][_0xc8b7('0x14')]);return _0x9e4763(_0x504550[_0xc8b7('0x12')][_0xc8b7('0x14')]);}else{logger[_0xc8b7('0xd')](_0xc8b7('0xe'),_0x42d65e,'request\x20sent');_0x9e4763(_0x504550[_0xc8b7('0x15')][_0xc8b7('0x14')]);}})[_0xc8b7('0x16')](function(_0x3323de){logger[_0xc8b7('0x12')](_0xc8b7('0xe'),_0x42d65e,_0x3323de);_0x2f149d(_0x3323de);});});}exports[_0xc8b7('0x17')]=function(_0x485415){var _0x5ae36a=this;return new Promise(function(_0x1cf47c,_0x403659){return db[_0xc8b7('0x18')]['create'](_0x485415['body'],{'raw':_0x485415[_0xc8b7('0x19')]?_0x485415['options'][_0xc8b7('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x462cce){logger[_0xc8b7('0xd')]('CreateAttachment',_0x485415);logger[_0xc8b7('0x10')]('CreateAttachment',_0x485415,JSON[_0xc8b7('0x1b')](_0x462cce));_0x1cf47c(_0x462cce);})[_0xc8b7('0x16')](function(_0x456eea){logger['error'](_0xc8b7('0x17'),_0x456eea[_0xc8b7('0x14')],_0x485415);_0x403659(_0x5ae36a[_0xc8b7('0x12')](0x1f4,_0x456eea['message']));});});}; \ No newline at end of file +var _0x2121=['body','options','raw','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','stringify','error','message','CreateAttachment','Attachment'];(function(_0x28d7fc,_0x2bb3b9){var _0x2ca828=function(_0x3e2771){while(--_0x3e2771){_0x28d7fc['push'](_0x28d7fc['shift']());}};_0x2ca828(++_0x2bb3b9);}(_0x2121,0x1b4));var _0x1212=function(_0x145fe6,_0x4a5143){_0x145fe6=_0x145fe6-0x0;var _0x401ffa=_0x2121[_0x145fe6];return _0x401ffa;};'use strict';var _=require(_0x1212('0x0'));var util=require(_0x1212('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1212('0x2'));var fs=require('fs');var Redis=require(_0x1212('0x3'));var db=require(_0x1212('0x4'))['db'];var utils=require(_0x1212('0x5'));var logger=require(_0x1212('0x6'))('rpc');var config=require(_0x1212('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1212('0x8')][_0x1212('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20fadc,_0x1b1ef5,_0x233a53){return new BPromise(function(_0x642ed5,_0x4a3d2a){return client[_0x1212('0xa')](_0x20fadc,_0x233a53)[_0x1212('0xb')](function(_0x434d23){logger[_0x1212('0xc')](_0x1212('0xd'),_0x1b1ef5,_0x1212('0xe'));logger['debug']('Attachment,\x20%s,\x20%s,\x20%s',_0x1b1ef5,_0x1212('0xe'),JSON[_0x1212('0xf')](_0x434d23));if(_0x434d23[_0x1212('0x10')]){if(_0x434d23[_0x1212('0x10')]['code']===0x1f4){logger[_0x1212('0x10')](_0x1212('0xd'),_0x1b1ef5,_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);return _0x4a3d2a(_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);}logger[_0x1212('0x10')](_0x1212('0xd'),_0x1b1ef5,_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);return _0x642ed5(_0x434d23[_0x1212('0x10')][_0x1212('0x11')]);}else{logger[_0x1212('0xc')](_0x1212('0xd'),_0x1b1ef5,_0x1212('0xe'));_0x642ed5(_0x434d23['result']['message']);}})['catch'](function(_0x3cfe21){logger[_0x1212('0x10')](_0x1212('0xd'),_0x1b1ef5,_0x3cfe21);_0x4a3d2a(_0x3cfe21);});});}exports[_0x1212('0x12')]=function(_0x3cf284){var _0x3face0=this;return new Promise(function(_0xb0dc88,_0x22eefb){return db[_0x1212('0x13')]['create'](_0x3cf284[_0x1212('0x14')],{'raw':_0x3cf284[_0x1212('0x15')]?_0x3cf284[_0x1212('0x15')][_0x1212('0x16')]===undefined?!![]:![]:!![]})[_0x1212('0xb')](function(_0x2e656f){logger[_0x1212('0xc')](_0x1212('0x12'),_0x3cf284);logger['debug'](_0x1212('0x12'),_0x3cf284,JSON[_0x1212('0xf')](_0x2e656f));_0xb0dc88(_0x2e656f);})[_0x1212('0x17')](function(_0x5d15ca){logger[_0x1212('0x10')](_0x1212('0x12'),_0x5d15ca[_0x1212('0x11')],_0x3cf284);_0x22eefb(_0x3face0[_0x1212('0x10')](0x1f4,_0x5d15ca['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index d33a74b..924e8f7 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x5f66,0x1a0));var _0x65f6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5f66[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file +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(_0x2136c6,_0x649adf){var _0x364bbc=function(_0x3a9d0e){while(--_0x3a9d0e){_0x2136c6['push'](_0x2136c6['shift']());}};_0x364bbc(++_0x649adf);}(_0x2032,0xd9));var _0x2203=function(_0x6788a,_0x158e90){_0x6788a=_0x6788a-0x0;var _0x5eca3a=_0x2032[_0x6788a];return _0x5eca3a;};'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 diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 1ed5b63..432d33d 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(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 95cbb42..2f3e10e 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 _0x4fea=['post','login','express','Router'];(function(_0x2bda14,_0x4fab1b){var _0xb5dd49=function(_0x1da71e){while(--_0x1da71e){_0x2bda14['push'](_0x2bda14['shift']());}};_0xb5dd49(++_0x4fab1b);}(_0x4fea,0xe2));var _0xa4fe=function(_0x3c0acd,_0x33ea49){_0x3c0acd=_0x3c0acd-0x0;var _0x4a7abb=_0x4fea[_0x3c0acd];return _0x4a7abb;};'use strict';var express=require(_0xa4fe('0x0'));var router=express[_0xa4fe('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0xa4fe('0x2')]('/',controller[_0xa4fe('0x3')]);module['exports']=router; \ No newline at end of file +var _0x2c41=['login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x49a1a0,_0x48f776){var _0x518a4f=function(_0x313633){while(--_0x313633){_0x49a1a0['push'](_0x49a1a0['shift']());}};_0x518a4f(++_0x48f776);}(_0x2c41,0xed));var _0x12c4=function(_0x10e983,_0x2f4eda){_0x10e983=_0x10e983-0x0;var _0x324138=_0x2c41[_0x10e983];return _0x324138;};'use strict';var express=require(_0x12c4('0x0'));var router=express[_0x12c4('0x1')]();var controller=require(_0x12c4('0x2'));router['post']('/',controller[_0x12c4('0x3')]);module[_0x12c4('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index cdb049d..62020a2 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0xa2df58,_0x2215a5){var _0x535afe=function(_0x429df1){while(--_0x429df1){_0xa2df58['push'](_0xa2df58['shift']());}};_0x535afe(++_0x2215a5);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +var _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(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x7a54,0x106));var _0x47a5=function(_0x39085b,_0x6909fb){_0x39085b=_0x39085b-0x0;var _0x411d6b=_0x7a54[_0x39085b];return _0x411d6b;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 13f4e0b..4327bd9 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 _0x9588=['passport','./authGoogle.controller','../../components/auth/service','get','login','/callback','callback','setTokenCookie','exports','express'];(function(_0x7bdda5,_0x3358f5){var _0x45be29=function(_0x7b64ff){while(--_0x7b64ff){_0x7bdda5['push'](_0x7bdda5['shift']());}};_0x45be29(++_0x3358f5);}(_0x9588,0x1a3));var _0x8958=function(_0x11e857,_0x44d6cd){_0x11e857=_0x11e857-0x0;var _0x10508c=_0x9588[_0x11e857];return _0x10508c;};'use strict';var express=require(_0x8958('0x0'));var passport=require(_0x8958('0x1'));var router=express['Router']();var controller=require(_0x8958('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x8958('0x3'));router[_0x8958('0x4')]('/',controller[_0x8958('0x5')]);router[_0x8958('0x4')](_0x8958('0x6'),controller[_0x8958('0x7')],authService['isMiddleware'],userController[_0x8958('0x5')],authService[_0x8958('0x8')]);module[_0x8958('0x9')]=router; \ No newline at end of file +var _0x5b91=['passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','setTokenCookie','express'];(function(_0x267095,_0xd6b820){var _0x2c31be=function(_0xed99a8){while(--_0xed99a8){_0x267095['push'](_0x267095['shift']());}};_0x2c31be(++_0xd6b820);}(_0x5b91,0x128));var _0x15b9=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x5b91[_0xc0a3d3];return _0x3386e8;};'use strict';var express=require(_0x15b9('0x0'));var passport=require(_0x15b9('0x1'));var router=express[_0x15b9('0x2')]();var controller=require(_0x15b9('0x3'));var userController=require(_0x15b9('0x4'));var authService=require(_0x15b9('0x5'));router['get']('/',controller['login']);router[_0x15b9('0x6')](_0x15b9('0x7'),controller[_0x15b9('0x8')],authService[_0x15b9('0x9')],userController['login'],authService[_0x15b9('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 50baeae..f45b1bf 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 _0xb347=['token','securePassword','passwordHistoryLimit','enforcePasswordHistory','previousPasswords','resetPasswordToken','resetPasswordExpires','save','use','util','passport','passport-local','Strategy','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','then','name','password','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','minutes','clearBlockUser','add','getLicense','catch','email','MailServerOut','Smtp','service','host','port','secure','authentication','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','error','send','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','trim','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','now','xCally\x20Motion\x20Password\x20Reset','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','reset'];(function(_0x47be98,_0xa9a751){var _0xa766fe=function(_0x32b8c5){while(--_0x32b8c5){_0x47be98['push'](_0x47be98['shift']());}};_0xa766fe(++_0xa9a751);}(_0xb347,0x199));var _0x7b34=function(_0x241fa6,_0x316bf2){_0x241fa6=_0x241fa6-0x0;var _0x2a39e5=_0xb347[_0x241fa6];return _0x2a39e5;};'use strict';var util=require(_0x7b34('0x0'));var passport=require(_0x7b34('0x1'));var LocalStrategy=require(_0x7b34('0x2'))[_0x7b34('0x3')];var jayson=require('jayson/promise');var _=require(_0x7b34('0x4'));var rs=require(_0x7b34('0x5'));var moment=require(_0x7b34('0x6'));var db=require(_0x7b34('0x7'))['db'];var authService=require(_0x7b34('0x8'));var utils=require(_0x7b34('0x9'));var client=jayson['client'][_0x7b34('0xa')]({'port':0x232b});function localAuthenticate(_0xa8ece0,_0x3a5f18,_0x541938,_0x42e72f){var _0x246ea8,_0x351f0c;return db[_0x7b34('0xb')][_0x7b34('0xc')]({'where':{'id':0x1},'attributes':[_0x7b34('0xd'),'blockDuration'],'raw':!![]})[_0x7b34('0xe')](function(_0x55149d){_0x246ea8=_0x55149d;return _0xa8ece0[_0x7b34('0xc')]({'attributes':['id',_0x7b34('0xf'),_0x7b34('0x10'),'salt',_0x7b34('0x11'),_0x7b34('0x12'),_0x7b34('0x13'),_0x7b34('0x14'),_0x7b34('0x15')],'where':{'name':_0x3a5f18,'role':{'$or':[_0x7b34('0x16'),_0x7b34('0x17'),_0x7b34('0x18')]}}});})['then'](function(_0x367509){if(!_0x367509||_0x367509&&_0x367509[_0x7b34('0xf')]!==_0x3a5f18){throw new Error(_0x7b34('0x19'));}else{_0x351f0c=_0x367509;return _0x351f0c;}})[_0x7b34('0xe')](function(){_0x351f0c['authenticate'](_0x541938,function(_0x3ef9d9,_0x5c980f){var _0x3fce03=_0x351f0c[_0x7b34('0x15')]+0x1;if(_0x3ef9d9){return _0x42e72f(_0x3ef9d9);}else if(!_0x5c980f){if(_0x351f0c[_0x7b34('0x12')]){return _0x42e72f(null,![],{'message':_0x7b34('0x19')});}else if(_0x246ea8[_0x7b34('0xd')]>0x0){if(_0x351f0c[_0x7b34('0x13')]){if(_0x246ea8[_0x7b34('0x1a')]>0x0){if(moment(_0x351f0c['blockedAt'])['add'](_0x246ea8['blockDuration'],_0x7b34('0x1b'))>moment()){return _0x42e72f(null,![],{'message':_0x7b34('0x19')});}else{return utils[_0x7b34('0x1c')](_0x351f0c,_0x3fce03,![],null)[_0x7b34('0xe')](function(){return _0x42e72f(null,![],{'message':_0x7b34('0x19')});});}}else{return _0x42e72f(null,![],{'message':_0x7b34('0x19')});}}else{if(_0x3fce03>=_0x246ea8[_0x7b34('0xd')]){return utils[_0x7b34('0x1c')](_0x351f0c,0x0,!![],moment())[_0x7b34('0xe')](function(){return _0x42e72f(null,![],{'message':_0x7b34('0x19')});});}else{return utils[_0x7b34('0x1c')](_0x351f0c,_0x3fce03,![],null)[_0x7b34('0xe')](function(){return _0x42e72f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x42e72f(null,![],{'message':_0x7b34('0x19')});}}else{if(_0x351f0c[_0x7b34('0x12')]){return _0x42e72f(null,![],{'message':_0x7b34('0x19')});}else if(_0x246ea8['allowedLoginAttempts']>0x0){if(_0x351f0c[_0x7b34('0x13')]){if(_0x246ea8[_0x7b34('0x1a')]>0x0){if(moment(_0x351f0c['blockedAt'])[_0x7b34('0x1d')](_0x246ea8['blockDuration'],_0x7b34('0x1b'))>moment()){return _0x42e72f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x7b34('0x1c')](_0x351f0c,0x0,![],null)[_0x7b34('0xe')](function(){return utils[_0x7b34('0x1e')](_0x351f0c);})[_0x7b34('0xe')](function(){return _0x42e72f(null,_0x351f0c);});}}else{return _0x42e72f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x351f0c,0x0,![],null)[_0x7b34('0xe')](function(){return utils['getLicense'](_0x351f0c);})[_0x7b34('0xe')](function(){return _0x42e72f(null,_0x351f0c);})[_0x7b34('0x1f')](function(_0x278ce1){return _0x42e72f(null,![],_0x278ce1);});}}else{if(_0x351f0c['blocked']){return _0x42e72f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x7b34('0x1e')](_0x351f0c)['then'](function(){return _0x42e72f(null,_0x351f0c);});}}}});})[_0x7b34('0x1f')](function(_0x9abf71){return _0x42e72f(null,![],_0x9abf71);});}function sendServiceMail(_0x14b341){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0x7b34('0xf'),_0x7b34('0x20')],'include':[{'model':db[_0x7b34('0x21')],'as':_0x7b34('0x22')}]})[_0x7b34('0xe')](function(_0xf98f29){if(!_0xf98f29){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x58af11={'tls':{'rejectUnauthorized':![]}};if(_0xf98f29[_0x7b34('0x22')][_0x7b34('0x23')]){_0x58af11[_0x7b34('0x23')]=_0xf98f29[_0x7b34('0x22')][_0x7b34('0x23')];}else{_0x58af11[_0x7b34('0x24')]=_0xf98f29['Smtp'][_0x7b34('0x24')];_0x58af11[_0x7b34('0x25')]=_0xf98f29[_0x7b34('0x22')]['port'];_0x58af11[_0x7b34('0x26')]=_0xf98f29[_0x7b34('0x22')][_0x7b34('0x26')];}if(_0xf98f29[_0x7b34('0x22')][_0x7b34('0x27')]){_0x58af11['auth']={'user':_0xf98f29[_0x7b34('0x22')][_0x7b34('0x17')],'pass':_0xf98f29['Smtp'][_0x7b34('0x28')]};}var _0x2df84f={'account':_0x58af11,'message':_[_0x7b34('0x29')]({'from':util[_0x7b34('0x2a')](_0x7b34('0x2b'),_0xf98f29['name'],_0xf98f29[_0x7b34('0x20')]||_0xf98f29['Smtp'][_0x7b34('0x17')])},_0x14b341)};return client[_0x7b34('0x2c')]('SendMail',_0x2df84f);})[_0x7b34('0xe')](function(_0xf8730c){if(_0xf8730c['error']){throw new Error(util[_0x7b34('0x2a')](_0x7b34('0x2d'),_0xf8730c['error'][_0x7b34('0x2e')]||JSON['stringify'](_0xf8730c[_0x7b34('0x2f')])));}return!![];});}function handleError(_0x2be7be,_0x521030,_0x1115c6){return _0x2be7be['status'](_0x521030||0x1f4)[_0x7b34('0x30')]({'message':_0x1115c6?_0x1115c6[_0x7b34('0x2e')]||_0x1115c6:''});}exports['login']=function(_0x316ec8,_0x248f71,_0x39a58a){passport[_0x7b34('0x31')](_0x7b34('0x32'),function(_0x57271b,_0xdcad7a,_0x4c059b){var _0x361171=_0x57271b||_0x4c059b;if(_0x361171){return handleError(_0x248f71,0x191,_0x361171);}if(!_0xdcad7a){return handleError(_0x248f71,0x194,{'message':_0x7b34('0x33')});}else{var _0x21356f={'payload':{'id':_0xdcad7a['id'],'role':_0xdcad7a['role']},'options':{'expiresIn':0x15180}};return authService[_0x7b34('0x34')](_0x21356f)[_0x7b34('0xe')](function(_0x4a4348){_0x248f71[_0x7b34('0x35')]({'id':_0xdcad7a['id'],'token':_0x4a4348,'statusCall':'','isAlreadyLogged':_0xdcad7a[_0x7b34('0x36')]});});}})(_0x316ec8,_0x248f71,_0x39a58a);};exports[_0x7b34('0x37')]=function(_0x1d98fb,_0x4693a0,_0x3d602d){if(!_0x1d98fb[_0x7b34('0x38')][_0x7b34('0x20')]){return handleError(_0x4693a0,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x3fbe41=rs['generate']();_0x1d98fb['body'][_0x7b34('0x20')]=_0x1d98fb['body'][_0x7b34('0x20')][_0x7b34('0x39')]()['toLowerCase']();var _0x385425;return db['Setting'][_0x7b34('0xc')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x7b34('0xe')](function(_0x11dd69){_0x385425=_0x11dd69;return db[_0x7b34('0x3a')][_0x7b34('0x3b')]({'where':{'email':_0x1d98fb[_0x7b34('0x38')][_0x7b34('0x20')]}});})[_0x7b34('0xe')](function(_0x1c3b1a){if(!_0x1c3b1a){throw new Error(_0x7b34('0x3c'));}if(_0x1c3b1a[_0x7b34('0x12')]){throw new Error(_0x7b34('0x3d'));}if(_0x1c3b1a[_0x7b34('0x13')]){if(moment(_0x1c3b1a['blockedAt'])[_0x7b34('0x1d')](_0x385425[_0x7b34('0x1a')],_0x7b34('0x1b'))>moment()){throw new Error(_0x7b34('0x3e'));}else{_0x1c3b1a[_0x7b34('0x13')]=![];_0x1c3b1a[_0x7b34('0x14')]=null;}}_0x1c3b1a['resetPasswordToken']=_0x3fbe41;_0x1c3b1a['resetPasswordExpires']=Date[_0x7b34('0x3f')]()+0x36ee80;return _0x1c3b1a['save']();})['then'](function(){return sendServiceMail({'to':_0x1d98fb['body'][_0x7b34('0x20')],'subject':_0x7b34('0x40'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x7b34('0x41')+_0x1d98fb[_0x7b34('0x42')][_0x7b34('0x24')]+_0x7b34('0x43')+_0x3fbe41+'\x0a\x0a'+_0x7b34('0x44')});})['then'](function(){_0x4693a0[_0x7b34('0x45')](0xc8)[_0x7b34('0x30')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x1e20f2){return handleError(_0x4693a0,0x1f4,_0x1e20f2);});};exports[_0x7b34('0x46')]=function(_0x847176,_0x5778cd,_0x3f856d){return db[_0x7b34('0x3a')][_0x7b34('0x3b')]({'where':{'resetPasswordToken':_0x847176['params'][_0x7b34('0x47')],'resetPasswordExpires':{'$gt':Date[_0x7b34('0x3f')]()}}})[_0x7b34('0xe')](function(_0x49886d){if(!_0x49886d){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x7b34('0xb')]['findOne']({'attributes':['id',_0x7b34('0x48'),'enforcePasswordHistory',_0x7b34('0x49')]})[_0x7b34('0xe')](function(_0x282890){if(_0x282890[_0x7b34('0x48')])authService['validatePasswordPattern'](_0x847176[_0x7b34('0x38')]['password']);if(!_0x282890[_0x7b34('0x4a')]||!_0x49886d[_0x7b34('0x4b')])return _0x49886d;authService['validatePasswordHistory'](_0x847176['body'][_0x7b34('0x10')],_0x49886d[_0x7b34('0x4b')],_0x282890[_0x7b34('0x49')]);return _0x49886d;})['then'](function(){_0x49886d[_0x7b34('0x10')]=_0x847176['body']['password'];_0x49886d[_0x7b34('0x4c')]=null;_0x49886d[_0x7b34('0x4d')]=null;return _0x49886d[_0x7b34('0x4e')]();});})[_0x7b34('0xe')](function(){_0x5778cd[_0x7b34('0x45')](0xc8)[_0x7b34('0x30')]({'message':'Password\x20reset!'});})[_0x7b34('0x1f')](function(_0x4b1594){return handleError(_0x5778cd,0x1f4,_0x4b1594);});};passport[_0x7b34('0x4f')](_0x7b34('0x32'),new LocalStrategy({'usernameField':_0x7b34('0xf'),'passwordField':_0x7b34('0x10')},function(_0x48e09a,_0x10ecd8,_0x313722){return localAuthenticate(db['User'],_0x48e09a,_0x10ecd8,_0x313722);})); \ No newline at end of file +var _0xec54=['randomstring','../../mysqldb','../../config/utils','client','http','Setting','findOne','blockDuration','then','name','password','disabled','blocked','blockedAt','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','service','port','secure','authentication','auth','pass','merge','format','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','error','status','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport-local','Strategy','jayson/promise','lodash'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0xec54,0x157));var _0x4ec5=function(_0x5d96bc,_0x4dadee){_0x5d96bc=_0x5d96bc-0x0;var _0x167c6a=_0xec54[_0x5d96bc];return _0x167c6a;};'use strict';var util=require(_0x4ec5('0x0'));var passport=require('passport');var LocalStrategy=require(_0x4ec5('0x1'))[_0x4ec5('0x2')];var jayson=require(_0x4ec5('0x3'));var _=require(_0x4ec5('0x4'));var rs=require(_0x4ec5('0x5'));var moment=require('moment');var db=require(_0x4ec5('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x4ec5('0x7'));var client=jayson[_0x4ec5('0x8')][_0x4ec5('0x9')]({'port':0x232b});function localAuthenticate(_0x20e64e,_0x1c6c27,_0x310df7,_0x43be26){var _0x26f43a,_0x330788;return db[_0x4ec5('0xa')][_0x4ec5('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x4ec5('0xc')],'raw':!![]})[_0x4ec5('0xd')](function(_0x73d21){_0x26f43a=_0x73d21;return _0x20e64e[_0x4ec5('0xb')]({'attributes':['id',_0x4ec5('0xe'),_0x4ec5('0xf'),'salt','role',_0x4ec5('0x10'),_0x4ec5('0x11'),_0x4ec5('0x12'),'loginAttempts'],'where':{'name':_0x1c6c27,'role':{'$or':[_0x4ec5('0x13'),'user',_0x4ec5('0x14')]}}});})['then'](function(_0x29addf){if(!_0x29addf||_0x29addf&&_0x29addf['name']!==_0x1c6c27){throw new Error(_0x4ec5('0x15'));}else{_0x330788=_0x29addf;return _0x330788;}})[_0x4ec5('0xd')](function(){_0x330788[_0x4ec5('0x16')](_0x310df7,function(_0x44946c,_0x1fc608){var _0x113eda=_0x330788[_0x4ec5('0x17')]+0x1;if(_0x44946c){return _0x43be26(_0x44946c);}else if(!_0x1fc608){if(_0x330788[_0x4ec5('0x10')]){return _0x43be26(null,![],{'message':_0x4ec5('0x15')});}else if(_0x26f43a[_0x4ec5('0x18')]>0x0){if(_0x330788[_0x4ec5('0x11')]){if(_0x26f43a['blockDuration']>0x0){if(moment(_0x330788['blockedAt'])[_0x4ec5('0x19')](_0x26f43a[_0x4ec5('0xc')],_0x4ec5('0x1a'))>moment()){return _0x43be26(null,![],{'message':_0x4ec5('0x15')});}else{return utils[_0x4ec5('0x1b')](_0x330788,_0x113eda,![],null)[_0x4ec5('0xd')](function(){return _0x43be26(null,![],{'message':_0x4ec5('0x15')});});}}else{return _0x43be26(null,![],{'message':_0x4ec5('0x15')});}}else{if(_0x113eda>=_0x26f43a[_0x4ec5('0x18')]){return utils[_0x4ec5('0x1b')](_0x330788,0x0,!![],moment())[_0x4ec5('0xd')](function(){return _0x43be26(null,![],{'message':_0x4ec5('0x15')});});}else{return utils[_0x4ec5('0x1b')](_0x330788,_0x113eda,![],null)[_0x4ec5('0xd')](function(){return _0x43be26(null,![],{'message':_0x4ec5('0x15')});});}}}else{return _0x43be26(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x330788[_0x4ec5('0x10')]){return _0x43be26(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x26f43a[_0x4ec5('0x18')]>0x0){if(_0x330788[_0x4ec5('0x11')]){if(_0x26f43a[_0x4ec5('0xc')]>0x0){if(moment(_0x330788[_0x4ec5('0x12')])['add'](_0x26f43a[_0x4ec5('0xc')],'minutes')>moment()){return _0x43be26(null,![],{'message':_0x4ec5('0x15')});}else{return utils[_0x4ec5('0x1b')](_0x330788,0x0,![],null)[_0x4ec5('0xd')](function(){return utils[_0x4ec5('0x1c')](_0x330788);})['then'](function(){return _0x43be26(null,_0x330788);});}}else{return _0x43be26(null,![],{'message':_0x4ec5('0x15')});}}else{return utils[_0x4ec5('0x1b')](_0x330788,0x0,![],null)[_0x4ec5('0xd')](function(){return utils[_0x4ec5('0x1c')](_0x330788);})[_0x4ec5('0xd')](function(){return _0x43be26(null,_0x330788);})[_0x4ec5('0x1d')](function(_0x32d469){return _0x43be26(null,![],_0x32d469);});}}else{if(_0x330788['blocked']){return _0x43be26(null,![],{'message':_0x4ec5('0x15')});}else{return utils[_0x4ec5('0x1c')](_0x330788)[_0x4ec5('0xd')](function(){return _0x43be26(null,_0x330788);});}}}});})[_0x4ec5('0x1d')](function(_0x3d6513){return _0x43be26(null,![],_0x3d6513);});}function sendServiceMail(_0x1924e0){return db[_0x4ec5('0x1e')][_0x4ec5('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x4ec5('0xe'),_0x4ec5('0x20')],'include':[{'model':db[_0x4ec5('0x21')],'as':_0x4ec5('0x22')}]})[_0x4ec5('0xd')](function(_0x5bfe10){if(!_0x5bfe10){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0xdff4f={'tls':{'rejectUnauthorized':![]}};if(_0x5bfe10[_0x4ec5('0x22')][_0x4ec5('0x23')]){_0xdff4f['service']=_0x5bfe10['Smtp'][_0x4ec5('0x23')];}else{_0xdff4f['host']=_0x5bfe10['Smtp']['host'];_0xdff4f[_0x4ec5('0x24')]=_0x5bfe10[_0x4ec5('0x22')]['port'];_0xdff4f[_0x4ec5('0x25')]=_0x5bfe10[_0x4ec5('0x22')][_0x4ec5('0x25')];}if(_0x5bfe10[_0x4ec5('0x22')][_0x4ec5('0x26')]){_0xdff4f[_0x4ec5('0x27')]={'user':_0x5bfe10[_0x4ec5('0x22')]['user'],'pass':_0x5bfe10[_0x4ec5('0x22')][_0x4ec5('0x28')]};}var _0xb10a9c={'account':_0xdff4f,'message':_[_0x4ec5('0x29')]({'from':util[_0x4ec5('0x2a')]('\x22%s\x22\x20<%s>',_0x5bfe10[_0x4ec5('0xe')],_0x5bfe10[_0x4ec5('0x20')]||_0x5bfe10[_0x4ec5('0x22')]['user'])},_0x1924e0)};return client[_0x4ec5('0x2b')](_0x4ec5('0x2c'),_0xb10a9c);})[_0x4ec5('0xd')](function(_0x2e873e){if(_0x2e873e['error']){throw new Error(util[_0x4ec5('0x2a')](_0x4ec5('0x2d'),_0x2e873e['error'][_0x4ec5('0x2e')]||JSON[_0x4ec5('0x2f')](_0x2e873e[_0x4ec5('0x30')])));}return!![];});}function handleError(_0x1cf08f,_0x2814f1,_0x1958d7){return _0x1cf08f[_0x4ec5('0x31')](_0x2814f1||0x1f4)['send']({'message':_0x1958d7?_0x1958d7[_0x4ec5('0x2e')]||_0x1958d7:''});}exports[_0x4ec5('0x32')]=function(_0x5a5440,_0x3ca825,_0x507daa){passport['authenticate'](_0x4ec5('0x33'),function(_0x4b741e,_0x20470c,_0x56bd63){var _0x3e4da0=_0x4b741e||_0x56bd63;if(_0x3e4da0){return handleError(_0x3ca825,0x191,_0x3e4da0);}if(!_0x20470c){return handleError(_0x3ca825,0x194,{'message':_0x4ec5('0x34')});}else{var _0x21f23b={'payload':{'id':_0x20470c['id'],'role':_0x20470c['role']},'options':{'expiresIn':0x15180}};return authService[_0x4ec5('0x35')](_0x21f23b)['then'](function(_0x45f17f){_0x3ca825['json']({'id':_0x20470c['id'],'token':_0x45f17f,'statusCall':'','isAlreadyLogged':_0x20470c['online']});});}})(_0x5a5440,_0x3ca825,_0x507daa);};exports[_0x4ec5('0x36')]=function(_0x70610e,_0x1a3c49,_0x21a8a6){if(!_0x70610e[_0x4ec5('0x37')]['email']){return handleError(_0x1a3c49,0x1f4,{'message':_0x4ec5('0x38')});}var _0x4f3da3=rs[_0x4ec5('0x39')]();_0x70610e[_0x4ec5('0x37')]['email']=_0x70610e[_0x4ec5('0x37')][_0x4ec5('0x20')][_0x4ec5('0x3a')]()[_0x4ec5('0x3b')]();var _0x444c92;return db[_0x4ec5('0xa')][_0x4ec5('0xb')]({'where':{'id':0x1},'attributes':[_0x4ec5('0x18'),'blockDuration'],'raw':!![]})['then'](function(_0x396c14){_0x444c92=_0x396c14;return db[_0x4ec5('0x3c')]['find']({'where':{'email':_0x70610e[_0x4ec5('0x37')][_0x4ec5('0x20')]}});})['then'](function(_0x2b869d){if(!_0x2b869d){throw new Error(_0x4ec5('0x3d'));}if(_0x2b869d[_0x4ec5('0x10')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x2b869d[_0x4ec5('0x11')]){if(moment(_0x2b869d['blockedAt'])['add'](_0x444c92[_0x4ec5('0xc')],_0x4ec5('0x1a'))>moment()){throw new Error(_0x4ec5('0x3e'));}else{_0x2b869d[_0x4ec5('0x11')]=![];_0x2b869d['blockedAt']=null;}}_0x2b869d[_0x4ec5('0x3f')]=_0x4f3da3;_0x2b869d[_0x4ec5('0x40')]=Date[_0x4ec5('0x41')]()+0x36ee80;return _0x2b869d[_0x4ec5('0x42')]();})[_0x4ec5('0xd')](function(){return sendServiceMail({'to':_0x70610e[_0x4ec5('0x37')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x4ec5('0x43')+_0x4ec5('0x44')+'https://'+_0x70610e[_0x4ec5('0x45')][_0x4ec5('0x46')]+_0x4ec5('0x47')+_0x4f3da3+'\x0a\x0a'+_0x4ec5('0x48')});})[_0x4ec5('0xd')](function(){_0x1a3c49[_0x4ec5('0x31')](0xc8)[_0x4ec5('0x49')]({'message':_0x4ec5('0x4a')});})[_0x4ec5('0x1d')](function(_0xc858b8){return handleError(_0x1a3c49,0x1f4,_0xc858b8);});};exports[_0x4ec5('0x4b')]=function(_0x540dc0,_0x5b737f,_0xfdb6e5){return db[_0x4ec5('0x3c')]['find']({'where':{'resetPasswordToken':_0x540dc0[_0x4ec5('0x4c')][_0x4ec5('0x4d')],'resetPasswordExpires':{'$gt':Date[_0x4ec5('0x41')]()}}})[_0x4ec5('0xd')](function(_0x4dc06e){if(!_0x4dc06e){throw new Error(_0x4ec5('0x4e'));}return db[_0x4ec5('0xa')]['findOne']({'attributes':['id',_0x4ec5('0x4f'),_0x4ec5('0x50'),_0x4ec5('0x51')]})[_0x4ec5('0xd')](function(_0x2f7cc1){if(_0x2f7cc1['securePassword'])authService[_0x4ec5('0x52')](_0x540dc0['body']['password']);if(!_0x2f7cc1[_0x4ec5('0x50')]||!_0x4dc06e[_0x4ec5('0x53')])return _0x4dc06e;authService[_0x4ec5('0x54')](_0x540dc0[_0x4ec5('0x37')][_0x4ec5('0xf')],_0x4dc06e['previousPasswords'],_0x2f7cc1[_0x4ec5('0x51')]);return _0x4dc06e;})[_0x4ec5('0xd')](function(){_0x4dc06e[_0x4ec5('0xf')]=_0x540dc0[_0x4ec5('0x37')][_0x4ec5('0xf')];_0x4dc06e[_0x4ec5('0x3f')]=null;_0x4dc06e[_0x4ec5('0x40')]=null;return _0x4dc06e[_0x4ec5('0x42')]();});})['then'](function(){_0x5b737f[_0x4ec5('0x31')](0xc8)[_0x4ec5('0x49')]({'message':_0x4ec5('0x55')});})[_0x4ec5('0x1d')](function(_0x173e35){return handleError(_0x5b737f,0x1f4,_0x173e35);});};passport[_0x4ec5('0x56')](_0x4ec5('0x33'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0xb16a64,_0x546c3b,_0x4492b3){return localAuthenticate(db[_0x4ec5('0x3c')],_0xb16a64,_0x546c3b,_0x4492b3);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index dad14ff..731c92b 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 _0x09b4=['Router','./authLocal.controller','login','post','/forgot','reset','express'];(function(_0xcec0b7,_0x2561f8){var _0x46c945=function(_0x3ea289){while(--_0x3ea289){_0xcec0b7['push'](_0xcec0b7['shift']());}};_0x46c945(++_0x2561f8);}(_0x09b4,0x1c6));var _0x409b=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x09b4[_0x411017];return _0x2adeea;};'use strict';var express=require(_0x409b('0x0'));var router=express[_0x409b('0x1')]();var controller=require(_0x409b('0x2'));router['post']('/',controller[_0x409b('0x3')]);router[_0x409b('0x4')](_0x409b('0x5'),controller['forgot']);router[_0x409b('0x4')]('/reset/:token',controller[_0x409b('0x6')]);module['exports']=router; \ No newline at end of file +var _0x868f=['/forgot','forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller','login','post'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x868f,0xd7));var _0xf868=function(_0x1c96cf,_0x204c64){_0x1c96cf=_0x1c96cf-0x0;var _0x289030=_0x868f[_0x1c96cf];return _0x289030;};'use strict';var express=require(_0xf868('0x0'));var router=express[_0xf868('0x1')]();var controller=require(_0xf868('0x2'));router['post']('/',controller[_0xf868('0x3')]);router[_0xf868('0x4')](_0xf868('0x5'),controller[_0xf868('0x6')]);router[_0xf868('0x4')](_0xf868('0x7'),controller[_0xf868('0x8')]);module[_0xf868('0x9')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 3fe539c..162132d 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 _0xa906=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x20daf5,_0x821d3b){var _0x1dc9ff=function(_0x232310){while(--_0x232310){_0x20daf5['push'](_0x20daf5['shift']());}};_0x1dc9ff(++_0x821d3b);}(_0xa906,0x1f0));var _0x6a90=function(_0x2dea89,_0x7bb82){_0x2dea89=_0x2dea89-0x0;var _0x2c14fc=_0xa906[_0x2dea89];return _0x2c14fc;};'use strict';var Sequelize=require(_0x6a90('0x0'));module[_0x6a90('0x1')]={'name':{'type':Sequelize[_0x6a90('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x6a90('0x2')]},'description':{'type':Sequelize[_0x6a90('0x2')]},'status':{'type':Sequelize[_0x6a90('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x6a90('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0xda93=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x483edc,_0x5755ab){var _0x2c093f=function(_0x139f86){while(--_0x139f86){_0x483edc['push'](_0x483edc['shift']());}};_0x2c093f(++_0x5755ab);}(_0xda93,0x1b9));var _0x3da9=function(_0x68e13e,_0x581202){_0x68e13e=_0x68e13e-0x0;var _0x1e1ff0=_0xda93[_0x68e13e];return _0x1e1ff0;};'use strict';var Sequelize=require(_0x3da9('0x0'));module[_0x3da9('0x1')]={'name':{'type':Sequelize[_0x3da9('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3da9('0x2')]},'status':{'type':Sequelize[_0x3da9('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x3da9('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 ae7c6c9..84fc7a2 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 _0x8801=['apply','reject','save','update','then','destroy','stack','name','send','index','map','Automation','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','include','findAll','catch','params','rawAttributes','options','find','body','addConditions','Condition','omit','getConditions','pick','Action','addActions','ids','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','json'];(function(_0x20845e,_0x211e78){var _0x28cf2b=function(_0x31d613){while(--_0x31d613){_0x20845e['push'](_0x20845e['shift']());}};_0x28cf2b(++_0x211e78);}(_0x8801,0x7f));var _0x1880=function(_0x379bda,_0x4b4337){_0x379bda=_0x379bda-0x0;var _0xbde54b=_0x8801[_0x379bda];return _0xbde54b;};'use strict';var emlformat=require(_0x1880('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1880('0x1'));var jsonpatch=require(_0x1880('0x2'));var rp=require(_0x1880('0x3'));var moment=require(_0x1880('0x4'));var BPromise=require(_0x1880('0x5'));var Mustache=require(_0x1880('0x6'));var util=require(_0x1880('0x7'));var path=require('path');var sox=require(_0x1880('0x8'));var csv=require(_0x1880('0x9'));var ejs=require(_0x1880('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1880('0xb'));var squel=require(_0x1880('0xc'));var crypto=require(_0x1880('0xd'));var jsforce=require(_0x1880('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1880('0x9'));var querystring=require(_0x1880('0xf'));var Papa=require(_0x1880('0x10'));var Redis=require(_0x1880('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1880('0x12'));var as=require(_0x1880('0x13'));var hardwareService=require(_0x1880('0x14'));var logger=require('../../config/logger')(_0x1880('0x15'));var utils=require(_0x1880('0x16'));var config=require(_0x1880('0x17'));var licenseUtil=require(_0x1880('0x18'));var db=require(_0x1880('0x19'))['db'];function respondWithStatusCode(_0x224c01,_0x51e2bc){_0x51e2bc=_0x51e2bc||0xcc;return function(_0x5233cf){if(_0x5233cf){return _0x224c01[_0x1880('0x1a')](_0x51e2bc);}return _0x224c01['status'](_0x51e2bc)[_0x1880('0x1b')]();};}function respondWithResult(_0x1cc816,_0x337db6){_0x337db6=_0x337db6||0xc8;return function(_0x5cf3a9){if(_0x5cf3a9){return _0x1cc816[_0x1880('0x1c')](_0x337db6)['json'](_0x5cf3a9);}};}function respondWithFilteredResult(_0x28ef03,_0x37c7e6){return function(_0x232383){if(_0x232383){var _0x368f55=typeof _0x37c7e6['offset']===_0x1880('0x1d')&&typeof _0x37c7e6[_0x1880('0x1e')]===_0x1880('0x1d');var _0x3ab92c=_0x232383[_0x1880('0x1f')];var _0x1be33c=_0x368f55?0x0:_0x37c7e6[_0x1880('0x20')];var _0x1f2aeb=_0x368f55?_0x232383[_0x1880('0x1f')]:_0x37c7e6[_0x1880('0x20')]+_0x37c7e6[_0x1880('0x1e')];var _0x2c6ad3;if(_0x1f2aeb>=_0x3ab92c){_0x1f2aeb=_0x3ab92c;_0x2c6ad3=0xc8;}else{_0x2c6ad3=0xce;}_0x28ef03[_0x1880('0x1c')](_0x2c6ad3);return _0x28ef03[_0x1880('0x21')]('Content-Range',_0x1be33c+'-'+_0x1f2aeb+'/'+_0x3ab92c)[_0x1880('0x22')](_0x232383);}return null;};}function patchUpdates(_0x20c70d){return function(_0x4dc694){try{jsonpatch[_0x1880('0x23')](_0x4dc694,_0x20c70d,!![]);}catch(_0x593726){return BPromise[_0x1880('0x24')](_0x593726);}return _0x4dc694[_0x1880('0x25')]();};}function saveUpdates(_0x2a2338,_0x2f1a62){return function(_0x51ef27){if(_0x51ef27){return _0x51ef27[_0x1880('0x26')](_0x2a2338)[_0x1880('0x27')](function(_0x43d5a9){return _0x43d5a9;});}return null;};}function removeEntity(_0x27d190,_0x28802c){return function(_0x1b5de8){if(_0x1b5de8){return _0x1b5de8[_0x1880('0x28')]()[_0x1880('0x27')](function(){_0x27d190[_0x1880('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a17e0,_0x3d32f5){return function(_0x21d437){if(!_0x21d437){_0x1a17e0[_0x1880('0x1a')](0x194);}return _0x21d437;};}function handleError(_0x15b467,_0x464e78){_0x464e78=_0x464e78||0x1f4;return function(_0xfe2131){logger['error'](_0xfe2131[_0x1880('0x29')]);if(_0xfe2131[_0x1880('0x2a')]){delete _0xfe2131[_0x1880('0x2a')];}_0x15b467[_0x1880('0x1c')](_0x464e78)[_0x1880('0x2b')](_0xfe2131);};}exports[_0x1880('0x2c')]=function(_0x3431ea,_0x305b00){var _0x254056={},_0x307e8c={},_0x5d90bd={'count':0x0,'rows':[]};var _0xdd69ac=_[_0x1880('0x2d')](db[_0x1880('0x2e')]['rawAttributes'],function(_0x43a491){return{'name':_0x43a491[_0x1880('0x2f')],'type':_0x43a491[_0x1880('0x30')]['key']};});_0x307e8c[_0x1880('0x31')]=_['map'](_0xdd69ac,_0x1880('0x2a'));_0x307e8c[_0x1880('0x32')]=_[_0x1880('0x33')](_0x3431ea[_0x1880('0x32')]);_0x307e8c['filters']=_['intersection'](_0x307e8c[_0x1880('0x31')],_0x307e8c[_0x1880('0x32')]);_0x254056[_0x1880('0x34')]=_[_0x1880('0x35')](_0x307e8c[_0x1880('0x31')],qs[_0x1880('0x36')](_0x3431ea[_0x1880('0x32')][_0x1880('0x36')]));_0x254056[_0x1880('0x34')]=_0x254056[_0x1880('0x34')][_0x1880('0x37')]?_0x254056['attributes']:_0x307e8c[_0x1880('0x31')];if(!_0x3431ea[_0x1880('0x32')][_0x1880('0x38')](_0x1880('0x39'))){_0x254056['limit']=qs[_0x1880('0x1e')](_0x3431ea[_0x1880('0x32')][_0x1880('0x1e')]);_0x254056[_0x1880('0x20')]=qs[_0x1880('0x20')](_0x3431ea['query'][_0x1880('0x20')]);}_0x254056[_0x1880('0x3a')]=qs[_0x1880('0x3b')](_0x3431ea['query'][_0x1880('0x3b')]);_0x254056['where']=qs[_0x1880('0x3c')](_['pick'](_0x3431ea[_0x1880('0x32')],_0x307e8c['filters']),_0xdd69ac);if(_0x3431ea[_0x1880('0x32')][_0x1880('0x3d')]){_0x254056[_0x1880('0x3e')]=_[_0x1880('0x3f')](_0x254056[_0x1880('0x3e')],{'$or':_[_0x1880('0x2d')](_0xdd69ac,function(_0x1f33f0){if(_0x1f33f0[_0x1880('0x30')]!=='VIRTUAL'){var _0x5c7e75={};_0x5c7e75[_0x1f33f0['name']]={'$like':'%'+_0x3431ea[_0x1880('0x32')]['filter']+'%'};return _0x5c7e75;}})});}_0x254056=_[_0x1880('0x3f')]({},_0x254056,_0x3431ea['options']);var _0x44d1bc={'where':_0x254056[_0x1880('0x3e')]};return db[_0x1880('0x2e')]['count'](_0x44d1bc)[_0x1880('0x27')](function(_0x28cb24){_0x5d90bd['count']=_0x28cb24;if(_0x3431ea[_0x1880('0x32')]['includeAll']){_0x254056[_0x1880('0x40')]=[{'all':!![]}];}return db[_0x1880('0x2e')][_0x1880('0x41')](_0x254056);})[_0x1880('0x27')](function(_0x382e5d){_0x5d90bd['rows']=_0x382e5d;return _0x5d90bd;})[_0x1880('0x27')](respondWithFilteredResult(_0x305b00,_0x254056))[_0x1880('0x42')](handleError(_0x305b00,null));};exports['show']=function(_0x2a4479,_0x45722f){var _0x4d3350={'raw':![],'where':{'id':_0x2a4479[_0x1880('0x43')]['id']}},_0x1fedf3={};_0x1fedf3[_0x1880('0x31')]=_[_0x1880('0x33')](db[_0x1880('0x2e')][_0x1880('0x44')]);_0x1fedf3[_0x1880('0x32')]=_['keys'](_0x2a4479['query']);_0x1fedf3[_0x1880('0x3c')]=_[_0x1880('0x35')](_0x1fedf3[_0x1880('0x31')],_0x1fedf3['query']);_0x4d3350[_0x1880('0x34')]=_[_0x1880('0x35')](_0x1fedf3['model'],qs[_0x1880('0x36')](_0x2a4479[_0x1880('0x32')]['fields']));_0x4d3350[_0x1880('0x34')]=_0x4d3350[_0x1880('0x34')][_0x1880('0x37')]?_0x4d3350[_0x1880('0x34')]:_0x1fedf3[_0x1880('0x31')];if(_0x2a4479['query']['includeAll']){_0x4d3350['include']=[{'all':!![]}];}_0x4d3350=_[_0x1880('0x3f')]({},_0x4d3350,_0x2a4479[_0x1880('0x45')]);return db[_0x1880('0x2e')][_0x1880('0x46')](_0x4d3350)[_0x1880('0x27')](handleEntityNotFound(_0x45722f,null))[_0x1880('0x27')](respondWithResult(_0x45722f,null))['catch'](handleError(_0x45722f,null));};exports['create']=function(_0xf03bc3,_0x3bc20e){return db[_0x1880('0x2e')]['create'](_0xf03bc3[_0x1880('0x47')],{})['then'](respondWithResult(_0x3bc20e,0xc9))[_0x1880('0x42')](handleError(_0x3bc20e,null));};exports[_0x1880('0x26')]=function(_0x309b6f,_0x6f3c74){if(_0x309b6f[_0x1880('0x47')]['id']){delete _0x309b6f['body']['id'];}return db[_0x1880('0x2e')][_0x1880('0x46')]({'where':{'id':_0x309b6f[_0x1880('0x43')]['id']}})['then'](handleEntityNotFound(_0x6f3c74,null))[_0x1880('0x27')](saveUpdates(_0x309b6f[_0x1880('0x47')],null))['then'](respondWithResult(_0x6f3c74,null))[_0x1880('0x42')](handleError(_0x6f3c74,null));};exports[_0x1880('0x28')]=function(_0x29920,_0x39c338){return db[_0x1880('0x2e')][_0x1880('0x46')]({'where':{'id':_0x29920[_0x1880('0x43')]['id']}})[_0x1880('0x27')](handleEntityNotFound(_0x39c338,null))[_0x1880('0x27')](removeEntity(_0x39c338,null))[_0x1880('0x42')](handleError(_0x39c338,null));};exports[_0x1880('0x48')]=function(_0x4f9f75,_0x5ae390,_0x195288){return db[_0x1880('0x49')][_0x1880('0x46')]({'where':{'id':_0x4f9f75['params']['id']}})['then'](handleEntityNotFound(_0x5ae390,null))[_0x1880('0x27')](function(_0x362527){if(_0x362527){return _0x362527[_0x1880('0x48')](_0x4f9f75[_0x1880('0x47')]['ids'],_[_0x1880('0x4a')](_0x4f9f75[_0x1880('0x47')],['ids','id'])||{});}})[_0x1880('0x27')](respondWithResult(_0x5ae390,null))['catch'](handleError(_0x5ae390,null));};exports[_0x1880('0x4b')]=function(_0x320e8c,_0x9c3c06,_0x84fb19){var _0x15a985={};var _0x59cbb8={};var _0x150187;var _0x13a6e7;return db['Automation']['findOne']({'where':{'id':_0x320e8c['params']['id']}})['then'](handleEntityNotFound(_0x9c3c06,null))[_0x1880('0x27')](function(_0x5b1ebf){if(_0x5b1ebf){_0x150187=_0x5b1ebf;_0x59cbb8['model']=_['keys'](db[_0x1880('0x49')]['rawAttributes']);_0x59cbb8['query']=_[_0x1880('0x33')](_0x320e8c['query']);_0x59cbb8[_0x1880('0x3c')]=_['intersection'](_0x59cbb8[_0x1880('0x31')],_0x59cbb8[_0x1880('0x32')]);_0x15a985[_0x1880('0x34')]=_[_0x1880('0x35')](_0x59cbb8[_0x1880('0x31')],qs[_0x1880('0x36')](_0x320e8c[_0x1880('0x32')][_0x1880('0x36')]));_0x15a985[_0x1880('0x34')]=_0x15a985['attributes'][_0x1880('0x37')]?_0x15a985[_0x1880('0x34')]:_0x59cbb8[_0x1880('0x31')];_0x15a985[_0x1880('0x3a')]=qs[_0x1880('0x3b')](_0x320e8c[_0x1880('0x32')][_0x1880('0x3b')]);_0x15a985[_0x1880('0x3e')]=qs['filters'](_[_0x1880('0x4c')](_0x320e8c[_0x1880('0x32')],_0x59cbb8['filters']));if(_0x320e8c[_0x1880('0x32')][_0x1880('0x3d')]){_0x15a985[_0x1880('0x3e')]=_[_0x1880('0x3f')](_0x15a985['where'],{'$or':_['map'](_0x15a985[_0x1880('0x34')],function(_0x48f944){var _0x17a602={};_0x17a602[_0x48f944]={'$like':'%'+_0x320e8c[_0x1880('0x32')][_0x1880('0x3d')]+'%'};return _0x17a602;})});}_0x15a985=_[_0x1880('0x3f')]({},_0x15a985,_0x320e8c['options']);return _0x150187[_0x1880('0x4b')](_0x15a985);}})['then'](function(_0x3a99a3){if(_0x3a99a3){_0x13a6e7=_0x3a99a3['length'];if(!_0x320e8c['query'][_0x1880('0x38')](_0x1880('0x39'))){_0x15a985[_0x1880('0x1e')]=qs[_0x1880('0x1e')](_0x320e8c[_0x1880('0x32')][_0x1880('0x1e')]);_0x15a985['offset']=qs[_0x1880('0x20')](_0x320e8c['query'][_0x1880('0x20')]);}return _0x150187[_0x1880('0x4b')](_0x15a985);}})[_0x1880('0x27')](function(_0x2a939a){if(_0x2a939a){return _0x2a939a?{'count':_0x13a6e7,'rows':_0x2a939a}:null;}})[_0x1880('0x27')](respondWithResult(_0x9c3c06,null))['catch'](handleError(_0x9c3c06,null));};exports['addActions']=function(_0x32f1ed,_0x38ffc6,_0x2666a9){return db[_0x1880('0x4d')][_0x1880('0x46')]({'where':{'id':_0x32f1ed[_0x1880('0x43')]['id']}})[_0x1880('0x27')](handleEntityNotFound(_0x38ffc6,null))[_0x1880('0x27')](function(_0x4d6d14){if(_0x4d6d14){return _0x4d6d14[_0x1880('0x4e')](_0x32f1ed[_0x1880('0x47')][_0x1880('0x4f')],_[_0x1880('0x4a')](_0x32f1ed[_0x1880('0x47')],[_0x1880('0x4f'),'id'])||{});}})[_0x1880('0x27')](respondWithResult(_0x38ffc6,null))[_0x1880('0x42')](handleError(_0x38ffc6,null));};exports[_0x1880('0x50')]=function(_0x3dff32,_0x5193af,_0x2a7608){var _0x3027eb={};var _0x105daf={};var _0x66fa8b;var _0x32590c;return db[_0x1880('0x2e')]['findOne']({'where':{'id':_0x3dff32['params']['id']}})[_0x1880('0x27')](handleEntityNotFound(_0x5193af,null))[_0x1880('0x27')](function(_0x133746){if(_0x133746){_0x66fa8b=_0x133746;_0x105daf[_0x1880('0x31')]=_[_0x1880('0x33')](db[_0x1880('0x4d')][_0x1880('0x44')]);_0x105daf[_0x1880('0x32')]=_['keys'](_0x3dff32[_0x1880('0x32')]);_0x105daf[_0x1880('0x3c')]=_[_0x1880('0x35')](_0x105daf[_0x1880('0x31')],_0x105daf[_0x1880('0x32')]);_0x3027eb[_0x1880('0x34')]=_[_0x1880('0x35')](_0x105daf[_0x1880('0x31')],qs[_0x1880('0x36')](_0x3dff32[_0x1880('0x32')][_0x1880('0x36')]));_0x3027eb['attributes']=_0x3027eb[_0x1880('0x34')][_0x1880('0x37')]?_0x3027eb['attributes']:_0x105daf[_0x1880('0x31')];_0x3027eb[_0x1880('0x3a')]=qs['sort'](_0x3dff32[_0x1880('0x32')]['sort']);_0x3027eb[_0x1880('0x3e')]=qs['filters'](_['pick'](_0x3dff32[_0x1880('0x32')],_0x105daf[_0x1880('0x3c')]));if(_0x3dff32['query'][_0x1880('0x3d')]){_0x3027eb[_0x1880('0x3e')]=_['merge'](_0x3027eb['where'],{'$or':_['map'](_0x3027eb[_0x1880('0x34')],function(_0x3f77ce){var _0x343619={};_0x343619[_0x3f77ce]={'$like':'%'+_0x3dff32[_0x1880('0x32')]['filter']+'%'};return _0x343619;})});}_0x3027eb=_[_0x1880('0x3f')]({},_0x3027eb,_0x3dff32[_0x1880('0x45')]);return _0x66fa8b[_0x1880('0x50')](_0x3027eb);}})[_0x1880('0x27')](function(_0x2dd3c7){if(_0x2dd3c7){_0x32590c=_0x2dd3c7[_0x1880('0x37')];if(!_0x3dff32['query']['hasOwnProperty'](_0x1880('0x39'))){_0x3027eb[_0x1880('0x1e')]=qs['limit'](_0x3dff32[_0x1880('0x32')][_0x1880('0x1e')]);_0x3027eb['offset']=qs[_0x1880('0x20')](_0x3dff32[_0x1880('0x32')]['offset']);}return _0x66fa8b[_0x1880('0x50')](_0x3027eb);}})[_0x1880('0x27')](function(_0x565182){if(_0x565182){return _0x565182?{'count':_0x32590c,'rows':_0x565182}:null;}})[_0x1880('0x27')](respondWithResult(_0x5193af,null))[_0x1880('0x42')](handleError(_0x5193af,null));}; \ No newline at end of file +var _0xb489=['filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','options','Automation','findAll','rows','show','params','includeAll','include','find','body','catch','addConditions','ids','getConditions','findOne','Condition','order','hasOwnProperty','nolimit','addActions','omit','getActions','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys'];(function(_0x26b5cb,_0x15f879){var _0x3b2277=function(_0x12fe27){while(--_0x12fe27){_0x26b5cb['push'](_0x26b5cb['shift']());}};_0x3b2277(++_0x15f879);}(_0xb489,0x11c));var _0x9b48=function(_0x3d50e1,_0xf8ece9){_0x3d50e1=_0x3d50e1-0x0;var _0x3a62b1=_0xb489[_0x3d50e1];return _0x3a62b1;};'use strict';var emlformat=require(_0x9b48('0x0'));var rimraf=require(_0x9b48('0x1'));var zipdir=require(_0x9b48('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9b48('0x3'));var moment=require('moment');var BPromise=require(_0x9b48('0x4'));var Mustache=require(_0x9b48('0x5'));var util=require(_0x9b48('0x6'));var path=require(_0x9b48('0x7'));var sox=require(_0x9b48('0x8'));var csv=require(_0x9b48('0x9'));var ejs=require(_0x9b48('0xa'));var fs=require('fs');var fs_extra=require(_0x9b48('0xb'));var _=require(_0x9b48('0xc'));var squel=require(_0x9b48('0xd'));var crypto=require('crypto');var jsforce=require(_0x9b48('0xe'));var deskjs=require(_0x9b48('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9b48('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9b48('0x11'));var qs=require(_0x9b48('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b48('0x13'));var logger=require(_0x9b48('0x14'))(_0x9b48('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9b48('0x16'));var db=require(_0x9b48('0x17'))['db'];function respondWithStatusCode(_0x48266d,_0x2d8b80){_0x2d8b80=_0x2d8b80||0xcc;return function(_0x159927){if(_0x159927){return _0x48266d[_0x9b48('0x18')](_0x2d8b80);}return _0x48266d['status'](_0x2d8b80)[_0x9b48('0x19')]();};}function respondWithResult(_0x1752ca,_0x65f17f){_0x65f17f=_0x65f17f||0xc8;return function(_0x293a40){if(_0x293a40){return _0x1752ca[_0x9b48('0x1a')](_0x65f17f)[_0x9b48('0x1b')](_0x293a40);}};}function respondWithFilteredResult(_0x133bcd,_0x5a2d84){return function(_0x3bc7a5){if(_0x3bc7a5){var _0x4b22ca=typeof _0x5a2d84['offset']===_0x9b48('0x1c')&&typeof _0x5a2d84[_0x9b48('0x1d')]===_0x9b48('0x1c');var _0x2628a2=_0x3bc7a5[_0x9b48('0x1e')];var _0x42e2a9=_0x4b22ca?0x0:_0x5a2d84[_0x9b48('0x1f')];var _0x1e6d05=_0x4b22ca?_0x3bc7a5[_0x9b48('0x1e')]:_0x5a2d84[_0x9b48('0x1f')]+_0x5a2d84[_0x9b48('0x1d')];var _0x522783;if(_0x1e6d05>=_0x2628a2){_0x1e6d05=_0x2628a2;_0x522783=0xc8;}else{_0x522783=0xce;}_0x133bcd['status'](_0x522783);return _0x133bcd[_0x9b48('0x20')](_0x9b48('0x21'),_0x42e2a9+'-'+_0x1e6d05+'/'+_0x2628a2)['json'](_0x3bc7a5);}return null;};}function patchUpdates(_0x56de3a){return function(_0x2847f8){try{jsonpatch[_0x9b48('0x22')](_0x2847f8,_0x56de3a,!![]);}catch(_0x127a9b){return BPromise[_0x9b48('0x23')](_0x127a9b);}return _0x2847f8[_0x9b48('0x24')]();};}function saveUpdates(_0x5b3e7e,_0x160a6b){return function(_0x46f5d2){if(_0x46f5d2){return _0x46f5d2[_0x9b48('0x25')](_0x5b3e7e)[_0x9b48('0x26')](function(_0x28c38d){return _0x28c38d;});}return null;};}function removeEntity(_0x3f7d88,_0x2bf059){return function(_0x590ff4){if(_0x590ff4){return _0x590ff4[_0x9b48('0x27')]()[_0x9b48('0x26')](function(){_0x3f7d88[_0x9b48('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a15ab,_0x33cdb0){return function(_0x3b31be){if(!_0x3b31be){_0x4a15ab[_0x9b48('0x18')](0x194);}return _0x3b31be;};}function handleError(_0x5e1455,_0x513113){_0x513113=_0x513113||0x1f4;return function(_0xaef19f){logger[_0x9b48('0x28')](_0xaef19f[_0x9b48('0x29')]);if(_0xaef19f[_0x9b48('0x2a')]){delete _0xaef19f[_0x9b48('0x2a')];}_0x5e1455[_0x9b48('0x1a')](_0x513113)[_0x9b48('0x2b')](_0xaef19f);};}exports[_0x9b48('0x2c')]=function(_0x46c0e8,_0x7736e4){var _0x5c5648={},_0x2e0685={},_0x3a216d={'count':0x0,'rows':[]};var _0x539fbf=_[_0x9b48('0x2d')](db['Automation'][_0x9b48('0x2e')],function(_0x3c82d7){return{'name':_0x3c82d7['fieldName'],'type':_0x3c82d7[_0x9b48('0x2f')][_0x9b48('0x30')]};});_0x2e0685[_0x9b48('0x31')]=_[_0x9b48('0x2d')](_0x539fbf,_0x9b48('0x2a'));_0x2e0685[_0x9b48('0x32')]=_[_0x9b48('0x33')](_0x46c0e8[_0x9b48('0x32')]);_0x2e0685[_0x9b48('0x34')]=_[_0x9b48('0x35')](_0x2e0685[_0x9b48('0x31')],_0x2e0685[_0x9b48('0x32')]);_0x5c5648[_0x9b48('0x36')]=_[_0x9b48('0x35')](_0x2e0685[_0x9b48('0x31')],qs[_0x9b48('0x37')](_0x46c0e8[_0x9b48('0x32')][_0x9b48('0x37')]));_0x5c5648['attributes']=_0x5c5648['attributes'][_0x9b48('0x38')]?_0x5c5648[_0x9b48('0x36')]:_0x2e0685[_0x9b48('0x31')];if(!_0x46c0e8[_0x9b48('0x32')]['hasOwnProperty']('nolimit')){_0x5c5648[_0x9b48('0x1d')]=qs['limit'](_0x46c0e8[_0x9b48('0x32')][_0x9b48('0x1d')]);_0x5c5648[_0x9b48('0x1f')]=qs['offset'](_0x46c0e8['query'][_0x9b48('0x1f')]);}_0x5c5648['order']=qs[_0x9b48('0x39')](_0x46c0e8[_0x9b48('0x32')][_0x9b48('0x39')]);_0x5c5648[_0x9b48('0x3a')]=qs[_0x9b48('0x34')](_[_0x9b48('0x3b')](_0x46c0e8[_0x9b48('0x32')],_0x2e0685['filters']),_0x539fbf);if(_0x46c0e8[_0x9b48('0x32')][_0x9b48('0x3c')]){_0x5c5648[_0x9b48('0x3a')]=_['merge'](_0x5c5648[_0x9b48('0x3a')],{'$or':_['map'](_0x539fbf,function(_0x485abc){if(_0x485abc['type']!=='VIRTUAL'){var _0x15aaf8={};_0x15aaf8[_0x485abc['name']]={'$like':'%'+_0x46c0e8['query']['filter']+'%'};return _0x15aaf8;}})});}_0x5c5648=_[_0x9b48('0x3d')]({},_0x5c5648,_0x46c0e8[_0x9b48('0x3e')]);var _0x219bfb={'where':_0x5c5648['where']};return db[_0x9b48('0x3f')][_0x9b48('0x1e')](_0x219bfb)['then'](function(_0x54fd03){_0x3a216d[_0x9b48('0x1e')]=_0x54fd03;if(_0x46c0e8[_0x9b48('0x32')]['includeAll']){_0x5c5648['include']=[{'all':!![]}];}return db[_0x9b48('0x3f')][_0x9b48('0x40')](_0x5c5648);})[_0x9b48('0x26')](function(_0x2c60b5){_0x3a216d[_0x9b48('0x41')]=_0x2c60b5;return _0x3a216d;})['then'](respondWithFilteredResult(_0x7736e4,_0x5c5648))['catch'](handleError(_0x7736e4,null));};exports[_0x9b48('0x42')]=function(_0x1edfc7,_0xe2c424){var _0x53c040={'raw':![],'where':{'id':_0x1edfc7[_0x9b48('0x43')]['id']}},_0x2b0cb4={};_0x2b0cb4[_0x9b48('0x31')]=_[_0x9b48('0x33')](db['Automation']['rawAttributes']);_0x2b0cb4[_0x9b48('0x32')]=_[_0x9b48('0x33')](_0x1edfc7[_0x9b48('0x32')]);_0x2b0cb4[_0x9b48('0x34')]=_['intersection'](_0x2b0cb4[_0x9b48('0x31')],_0x2b0cb4['query']);_0x53c040[_0x9b48('0x36')]=_[_0x9b48('0x35')](_0x2b0cb4['model'],qs[_0x9b48('0x37')](_0x1edfc7['query']['fields']));_0x53c040[_0x9b48('0x36')]=_0x53c040[_0x9b48('0x36')]['length']?_0x53c040[_0x9b48('0x36')]:_0x2b0cb4[_0x9b48('0x31')];if(_0x1edfc7[_0x9b48('0x32')][_0x9b48('0x44')]){_0x53c040[_0x9b48('0x45')]=[{'all':!![]}];}_0x53c040=_[_0x9b48('0x3d')]({},_0x53c040,_0x1edfc7['options']);return db['Automation'][_0x9b48('0x46')](_0x53c040)[_0x9b48('0x26')](handleEntityNotFound(_0xe2c424,null))['then'](respondWithResult(_0xe2c424,null))['catch'](handleError(_0xe2c424,null));};exports['create']=function(_0x11d241,_0x48d0cb){return db[_0x9b48('0x3f')]['create'](_0x11d241['body'],{})[_0x9b48('0x26')](respondWithResult(_0x48d0cb,0xc9))['catch'](handleError(_0x48d0cb,null));};exports['update']=function(_0x22c74f,_0x154339){if(_0x22c74f[_0x9b48('0x47')]['id']){delete _0x22c74f[_0x9b48('0x47')]['id'];}return db[_0x9b48('0x3f')][_0x9b48('0x46')]({'where':{'id':_0x22c74f['params']['id']}})[_0x9b48('0x26')](handleEntityNotFound(_0x154339,null))[_0x9b48('0x26')](saveUpdates(_0x22c74f[_0x9b48('0x47')],null))[_0x9b48('0x26')](respondWithResult(_0x154339,null))[_0x9b48('0x48')](handleError(_0x154339,null));};exports[_0x9b48('0x27')]=function(_0x5f3181,_0x3d7048){return db[_0x9b48('0x3f')][_0x9b48('0x46')]({'where':{'id':_0x5f3181['params']['id']}})[_0x9b48('0x26')](handleEntityNotFound(_0x3d7048,null))[_0x9b48('0x26')](removeEntity(_0x3d7048,null))['catch'](handleError(_0x3d7048,null));};exports[_0x9b48('0x49')]=function(_0x56ce47,_0x284320,_0x170eaf){return db['Condition'][_0x9b48('0x46')]({'where':{'id':_0x56ce47[_0x9b48('0x43')]['id']}})['then'](handleEntityNotFound(_0x284320,null))[_0x9b48('0x26')](function(_0x3ee7dd){if(_0x3ee7dd){return _0x3ee7dd[_0x9b48('0x49')](_0x56ce47[_0x9b48('0x47')]['ids'],_['omit'](_0x56ce47[_0x9b48('0x47')],[_0x9b48('0x4a'),'id'])||{});}})[_0x9b48('0x26')](respondWithResult(_0x284320,null))['catch'](handleError(_0x284320,null));};exports[_0x9b48('0x4b')]=function(_0x2e7b0a,_0x5d2fc9,_0x699b69){var _0x352d6e={};var _0x4409f2={};var _0x347b94;var _0x3a91a1;return db[_0x9b48('0x3f')][_0x9b48('0x4c')]({'where':{'id':_0x2e7b0a[_0x9b48('0x43')]['id']}})[_0x9b48('0x26')](handleEntityNotFound(_0x5d2fc9,null))[_0x9b48('0x26')](function(_0x108c60){if(_0x108c60){_0x347b94=_0x108c60;_0x4409f2[_0x9b48('0x31')]=_[_0x9b48('0x33')](db[_0x9b48('0x4d')][_0x9b48('0x2e')]);_0x4409f2['query']=_[_0x9b48('0x33')](_0x2e7b0a['query']);_0x4409f2[_0x9b48('0x34')]=_[_0x9b48('0x35')](_0x4409f2[_0x9b48('0x31')],_0x4409f2[_0x9b48('0x32')]);_0x352d6e['attributes']=_[_0x9b48('0x35')](_0x4409f2['model'],qs['fields'](_0x2e7b0a[_0x9b48('0x32')][_0x9b48('0x37')]));_0x352d6e[_0x9b48('0x36')]=_0x352d6e[_0x9b48('0x36')][_0x9b48('0x38')]?_0x352d6e[_0x9b48('0x36')]:_0x4409f2[_0x9b48('0x31')];_0x352d6e[_0x9b48('0x4e')]=qs[_0x9b48('0x39')](_0x2e7b0a[_0x9b48('0x32')][_0x9b48('0x39')]);_0x352d6e[_0x9b48('0x3a')]=qs[_0x9b48('0x34')](_['pick'](_0x2e7b0a[_0x9b48('0x32')],_0x4409f2[_0x9b48('0x34')]));if(_0x2e7b0a[_0x9b48('0x32')]['filter']){_0x352d6e[_0x9b48('0x3a')]=_[_0x9b48('0x3d')](_0x352d6e[_0x9b48('0x3a')],{'$or':_[_0x9b48('0x2d')](_0x352d6e[_0x9b48('0x36')],function(_0x2ca85f){var _0x50f6b4={};_0x50f6b4[_0x2ca85f]={'$like':'%'+_0x2e7b0a[_0x9b48('0x32')][_0x9b48('0x3c')]+'%'};return _0x50f6b4;})});}_0x352d6e=_['merge']({},_0x352d6e,_0x2e7b0a[_0x9b48('0x3e')]);return _0x347b94[_0x9b48('0x4b')](_0x352d6e);}})['then'](function(_0x2e7e9b){if(_0x2e7e9b){_0x3a91a1=_0x2e7e9b[_0x9b48('0x38')];if(!_0x2e7b0a['query'][_0x9b48('0x4f')](_0x9b48('0x50'))){_0x352d6e[_0x9b48('0x1d')]=qs[_0x9b48('0x1d')](_0x2e7b0a['query'][_0x9b48('0x1d')]);_0x352d6e[_0x9b48('0x1f')]=qs[_0x9b48('0x1f')](_0x2e7b0a[_0x9b48('0x32')][_0x9b48('0x1f')]);}return _0x347b94[_0x9b48('0x4b')](_0x352d6e);}})['then'](function(_0xcb5fb3){if(_0xcb5fb3){return _0xcb5fb3?{'count':_0x3a91a1,'rows':_0xcb5fb3}:null;}})['then'](respondWithResult(_0x5d2fc9,null))[_0x9b48('0x48')](handleError(_0x5d2fc9,null));};exports[_0x9b48('0x51')]=function(_0x3c8d48,_0x15257a,_0x40d6cd){return db['Action']['find']({'where':{'id':_0x3c8d48[_0x9b48('0x43')]['id']}})['then'](handleEntityNotFound(_0x15257a,null))[_0x9b48('0x26')](function(_0x31c33b){if(_0x31c33b){return _0x31c33b['addActions'](_0x3c8d48[_0x9b48('0x47')][_0x9b48('0x4a')],_[_0x9b48('0x52')](_0x3c8d48[_0x9b48('0x47')],[_0x9b48('0x4a'),'id'])||{});}})[_0x9b48('0x26')](respondWithResult(_0x15257a,null))['catch'](handleError(_0x15257a,null));};exports['getActions']=function(_0x269d41,_0x42e432,_0x36c548){var _0x461995={};var _0x508d9f={};var _0x33fe22;var _0x207c2e;return db[_0x9b48('0x3f')][_0x9b48('0x4c')]({'where':{'id':_0x269d41['params']['id']}})[_0x9b48('0x26')](handleEntityNotFound(_0x42e432,null))[_0x9b48('0x26')](function(_0x94860b){if(_0x94860b){_0x33fe22=_0x94860b;_0x508d9f[_0x9b48('0x31')]=_[_0x9b48('0x33')](db['Action'][_0x9b48('0x2e')]);_0x508d9f['query']=_['keys'](_0x269d41['query']);_0x508d9f[_0x9b48('0x34')]=_[_0x9b48('0x35')](_0x508d9f[_0x9b48('0x31')],_0x508d9f[_0x9b48('0x32')]);_0x461995[_0x9b48('0x36')]=_[_0x9b48('0x35')](_0x508d9f[_0x9b48('0x31')],qs[_0x9b48('0x37')](_0x269d41[_0x9b48('0x32')][_0x9b48('0x37')]));_0x461995['attributes']=_0x461995['attributes'][_0x9b48('0x38')]?_0x461995[_0x9b48('0x36')]:_0x508d9f[_0x9b48('0x31')];_0x461995[_0x9b48('0x4e')]=qs['sort'](_0x269d41[_0x9b48('0x32')][_0x9b48('0x39')]);_0x461995[_0x9b48('0x3a')]=qs[_0x9b48('0x34')](_[_0x9b48('0x3b')](_0x269d41[_0x9b48('0x32')],_0x508d9f[_0x9b48('0x34')]));if(_0x269d41[_0x9b48('0x32')][_0x9b48('0x3c')]){_0x461995['where']=_[_0x9b48('0x3d')](_0x461995[_0x9b48('0x3a')],{'$or':_[_0x9b48('0x2d')](_0x461995['attributes'],function(_0x4c00e7){var _0x19f03d={};_0x19f03d[_0x4c00e7]={'$like':'%'+_0x269d41[_0x9b48('0x32')][_0x9b48('0x3c')]+'%'};return _0x19f03d;})});}_0x461995=_[_0x9b48('0x3d')]({},_0x461995,_0x269d41[_0x9b48('0x3e')]);return _0x33fe22[_0x9b48('0x53')](_0x461995);}})[_0x9b48('0x26')](function(_0x5ac352){if(_0x5ac352){_0x207c2e=_0x5ac352[_0x9b48('0x38')];if(!_0x269d41['query'][_0x9b48('0x4f')](_0x9b48('0x50'))){_0x461995[_0x9b48('0x1d')]=qs[_0x9b48('0x1d')](_0x269d41[_0x9b48('0x32')][_0x9b48('0x1d')]);_0x461995[_0x9b48('0x1f')]=qs[_0x9b48('0x1f')](_0x269d41[_0x9b48('0x32')][_0x9b48('0x1f')]);}return _0x33fe22[_0x9b48('0x53')](_0x461995);}})[_0x9b48('0x26')](function(_0x270702){if(_0x270702){return _0x270702?{'count':_0x207c2e,'rows':_0x270702}:null;}})[_0x9b48('0x26')](respondWithResult(_0x42e432,null))[_0x9b48('0x48')](handleError(_0x42e432,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 57101ca..6ec70aa 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 _0xf818=['moment','bluebird','path','rimraf','../../config/environment','./automation.attributes','exports','util','../../config/logger','api'];(function(_0xa28b1a,_0x384f4b){var _0x4c9b78=function(_0x3cf640){while(--_0x3cf640){_0xa28b1a['push'](_0xa28b1a['shift']());}};_0x4c9b78(++_0x384f4b);}(_0xf818,0x147));var _0x8f81=function(_0x51932d,_0x378826){_0x51932d=_0x51932d-0x0;var _0x44c0c0=_0xf818[_0x51932d];return _0x44c0c0;};'use strict';var _=require('lodash');var util=require(_0x8f81('0x0'));var logger=require(_0x8f81('0x1'))(_0x8f81('0x2'));var moment=require(_0x8f81('0x3'));var BPromise=require(_0x8f81('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8f81('0x5'));var rimraf=require(_0x8f81('0x6'));var config=require(_0x8f81('0x7'));var attributes=require(_0x8f81('0x8'));module[_0x8f81('0x9')]=function(_0x3911b7,_0x3aaa07){return _0x3911b7['define']('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5748=['tools_automations','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation'];(function(_0x4cc280,_0x3b77f3){var _0x16ed24=function(_0x473e10){while(--_0x473e10){_0x4cc280['push'](_0x4cc280['shift']());}};_0x16ed24(++_0x3b77f3);}(_0x5748,0x18d));var _0x8574=function(_0x52c60e,_0xb2bc2d){_0x52c60e=_0x52c60e-0x0;var _0x3f62e7=_0x5748[_0x52c60e];return _0x3f62e7;};'use strict';var _=require(_0x8574('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8574('0x1'));var moment=require(_0x8574('0x2'));var BPromise=require('bluebird');var rp=require(_0x8574('0x3'));var fs=require('fs');var path=require(_0x8574('0x4'));var rimraf=require(_0x8574('0x5'));var config=require(_0x8574('0x6'));var attributes=require(_0x8574('0x7'));module[_0x8574('0x8')]=function(_0x38ffee,_0x42faa8){return _0x38ffee[_0x8574('0x9')](_0x8574('0xa'),attributes,{'tableName':_0x8574('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 60f0688..b3e824c 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 _0xbb59=['request\x20sent','stringify','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s'];(function(_0x22f1fd,_0x11d9c3){var _0xfab9b0=function(_0x5af290){while(--_0x5af290){_0x22f1fd['push'](_0x22f1fd['shift']());}};_0xfab9b0(++_0x11d9c3);}(_0xbb59,0xec));var _0x9bb5=function(_0x3ad843,_0x5e238b){_0x3ad843=_0x3ad843-0x0;var _0x1c336a=_0xbb59[_0x3ad843];return _0x1c336a;};'use strict';var _=require(_0x9bb5('0x0'));var util=require(_0x9bb5('0x1'));var moment=require(_0x9bb5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9bb5('0x3'));var db=require(_0x9bb5('0x4'))['db'];var utils=require(_0x9bb5('0x5'));var logger=require(_0x9bb5('0x6'))(_0x9bb5('0x7'));var config=require('../../config/environment');var jayson=require(_0x9bb5('0x8'));var client=jayson[_0x9bb5('0x9')][_0x9bb5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2df722,_0xe362e0,_0x83fd10){return new BPromise(function(_0x2d6cce,_0x4e3857){return client[_0x9bb5('0xb')](_0x2df722,_0x83fd10)[_0x9bb5('0xc')](function(_0x2fdbcb){logger[_0x9bb5('0xd')](_0x9bb5('0xe'),_0xe362e0,'request\x20sent');logger[_0x9bb5('0xf')](_0x9bb5('0x10'),_0xe362e0,_0x9bb5('0x11'),JSON[_0x9bb5('0x12')](_0x2fdbcb));if(_0x2fdbcb[_0x9bb5('0x13')]){if(_0x2fdbcb[_0x9bb5('0x13')][_0x9bb5('0x14')]===0x1f4){logger[_0x9bb5('0x13')](_0x9bb5('0xe'),_0xe362e0,_0x2fdbcb[_0x9bb5('0x13')][_0x9bb5('0x15')]);return _0x4e3857(_0x2fdbcb[_0x9bb5('0x13')][_0x9bb5('0x15')]);}logger[_0x9bb5('0x13')]('Automation,\x20%s,\x20%s',_0xe362e0,_0x2fdbcb['error'][_0x9bb5('0x15')]);return _0x2d6cce(_0x2fdbcb['error']['message']);}else{logger[_0x9bb5('0xd')]('Automation,\x20%s,\x20%s',_0xe362e0,_0x9bb5('0x11'));_0x2d6cce(_0x2fdbcb[_0x9bb5('0x16')][_0x9bb5('0x15')]);}})['catch'](function(_0xb471e){logger[_0x9bb5('0x13')](_0x9bb5('0xe'),_0xe362e0,_0xb471e);_0x4e3857(_0xb471e);});});} \ No newline at end of file +var _0x0abf=['catch','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0abf,0xe8));var _0xf0ab=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x0abf[_0x465028];return _0xb783d4;};'use strict';var _=require(_0xf0ab('0x0'));var util=require('util');var moment=require(_0xf0ab('0x1'));var BPromise=require(_0xf0ab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0ab('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0ab('0x4'))(_0xf0ab('0x5'));var config=require(_0xf0ab('0x6'));var jayson=require(_0xf0ab('0x7'));var client=jayson[_0xf0ab('0x8')][_0xf0ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x233afe,_0x57ff3b,_0x2c4628){return new BPromise(function(_0x3f7e2b,_0x3ca099){return client[_0xf0ab('0xa')](_0x233afe,_0x2c4628)['then'](function(_0x472508){logger[_0xf0ab('0xb')](_0xf0ab('0xc'),_0x57ff3b,'request\x20sent');logger['debug'](_0xf0ab('0xd'),_0x57ff3b,'request\x20sent',JSON[_0xf0ab('0xe')](_0x472508));if(_0x472508[_0xf0ab('0xf')]){if(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x10')]===0x1f4){logger[_0xf0ab('0xf')](_0xf0ab('0xc'),_0x57ff3b,_0x472508[_0xf0ab('0xf')]['message']);return _0x3ca099(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);}logger[_0xf0ab('0xf')](_0xf0ab('0xc'),_0x57ff3b,_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);return _0x3f7e2b(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);}else{logger[_0xf0ab('0xb')](_0xf0ab('0xc'),_0x57ff3b,_0xf0ab('0x12'));_0x3f7e2b(_0x472508[_0xf0ab('0x13')][_0xf0ab('0x11')]);}})[_0xf0ab('0x14')](function(_0x230f40){logger['error'](_0xf0ab('0xc'),_0x57ff3b,_0x230f40);_0x3ca099(_0x230f40);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 0ff4062..0f30bc6 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 _0x36f1=['getActions','post','addConditions','/:id/actions','put','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions'];(function(_0x410a3a,_0x4fa028){var _0xa5275a=function(_0x9673cb){while(--_0x9673cb){_0x410a3a['push'](_0x410a3a['shift']());}};_0xa5275a(++_0x4fa028);}(_0x36f1,0xb0));var _0x136f=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x36f1[_0x46aff0];return _0x9d78cf;};'use strict';var multer=require(_0x136f('0x0'));var util=require('util');var path=require(_0x136f('0x1'));var timeout=require('connect-timeout');var express=require(_0x136f('0x2'));var router=express[_0x136f('0x3')]();var fs_extra=require(_0x136f('0x4'));var auth=require(_0x136f('0x5'));var interaction=require(_0x136f('0x6'));var config=require(_0x136f('0x7'));var controller=require(_0x136f('0x8'));router[_0x136f('0x9')]('/',auth[_0x136f('0xa')](),controller[_0x136f('0xb')]);router['get'](_0x136f('0xc'),auth[_0x136f('0xa')](),controller[_0x136f('0xd')]);router['get'](_0x136f('0xe'),auth[_0x136f('0xa')](),controller[_0x136f('0xf')]);router[_0x136f('0x9')]('/:id/actions',auth['isAuthenticated'](),controller[_0x136f('0x10')]);router[_0x136f('0x11')]('/',auth[_0x136f('0xa')](),controller['create']);router['post'](_0x136f('0xe'),auth[_0x136f('0xa')](),controller[_0x136f('0x12')]);router[_0x136f('0x11')](_0x136f('0x13'),auth['isAuthenticated'](),controller['addActions']);router[_0x136f('0x14')](_0x136f('0xc'),auth[_0x136f('0xa')](),controller['update']);router[_0x136f('0x15')](_0x136f('0xc'),auth[_0x136f('0xa')](),controller[_0x136f('0x16')]);module[_0x136f('0x17')]=router; \ No newline at end of file +var _0xdb4b=['addActions','put','/:id','update','destroy','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','getActions','post','addConditions'];(function(_0x28139e,_0x4d8e26){var _0x2ffae8=function(_0x43b7f2){while(--_0x43b7f2){_0x28139e['push'](_0x28139e['shift']());}};_0x2ffae8(++_0x4d8e26);}(_0xdb4b,0xd7));var _0xbdb4=function(_0x312428,_0x458f28){_0x312428=_0x312428-0x0;var _0x583514=_0xdb4b[_0x312428];return _0x583514;};'use strict';var multer=require('multer');var util=require(_0xbdb4('0x0'));var path=require('path');var timeout=require(_0xbdb4('0x1'));var express=require(_0xbdb4('0x2'));var router=express[_0xbdb4('0x3')]();var fs_extra=require(_0xbdb4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbdb4('0x5'));var config=require(_0xbdb4('0x6'));var controller=require(_0xbdb4('0x7'));router[_0xbdb4('0x8')]('/',auth[_0xbdb4('0x9')](),controller[_0xbdb4('0xa')]);router[_0xbdb4('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xbdb4('0xb')]);router[_0xbdb4('0x8')](_0xbdb4('0xc'),auth[_0xbdb4('0x9')](),controller['getConditions']);router[_0xbdb4('0x8')]('/:id/actions',auth[_0xbdb4('0x9')](),controller[_0xbdb4('0xd')]);router[_0xbdb4('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbdb4('0xe')](_0xbdb4('0xc'),auth[_0xbdb4('0x9')](),controller[_0xbdb4('0xf')]);router['post']('/:id/actions',auth[_0xbdb4('0x9')](),controller[_0xbdb4('0x10')]);router[_0xbdb4('0x11')](_0xbdb4('0x12'),auth[_0xbdb4('0x9')](),controller[_0xbdb4('0x13')]);router['delete']('/:id',auth[_0xbdb4('0x9')](),controller[_0xbdb4('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 89045cc..c5a3456 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 _0xe455=['#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\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)','exports','STRING','name','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','ENUM','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length'];(function(_0x10f68e,_0xf198ea){var _0x4c8372=function(_0x38517){while(--_0x38517){_0x10f68e['push'](_0x10f68e['shift']());}};_0x4c8372(++_0xf198ea);}(_0xe455,0x1ca));var _0x5e45=function(_0x48359b,_0x4c2197){_0x48359b=_0x48359b-0x0;var _0x4bd775=_0xe455[_0x48359b];return _0x4bd775;};'use strict';var Sequelize=require('sequelize');module[_0x5e45('0x0')]={'name':{'type':Sequelize[_0x5e45('0x1')],'unique':_0x5e45('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0x5e45('0x3')},'description':{'type':Sequelize[_0x5e45('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5e45('0x4')},'limitCalls':{'type':Sequelize[_0x5e45('0x5')](0x4)[_0x5e45('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x5e45('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x5e45('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5e45('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e45('0x7')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e45('0x8')},'dialBusyRetryFrequency':{'type':Sequelize[_0x5e45('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e45('0x9')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5e45('0x6')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5e45('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e45('0xa')},'dialGlobalMaxRetry':{'type':Sequelize[_0x5e45('0x5')](0x3)[_0x5e45('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5e45('0xb')},'dialTimezone':{'type':Sequelize[_0x5e45('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x5e45('0xc')](_0x5e45('0xd'),_0x5e45('0xe'),_0x5e45('0xf')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x5e45('0x10')],'defaultValue':0x0,'comment':_0x5e45('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x5e45('0x5')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5e45('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x5e45('0x5')](0x9)[_0x5e45('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5e45('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5e45('0x5')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x5e45('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5e45('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5e45('0x15')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x5e45('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5e45('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5e45('0x5')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5e45('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5e45('0x5')](0x9)[_0x5e45('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x5e45('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5e45('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5e45('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5e45('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x5e45('0xc')](_0x5e45('0x1a'),_0x5e45('0x1b')),'defaultValue':_0x5e45('0x1a')},'dialPrefix':{'type':Sequelize[_0x5e45('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5e45('0x5')](0x3)[_0x5e45('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5e45('0x1c')},'dialCutDigit':{'type':Sequelize[_0x5e45('0x5')](0x3)[_0x5e45('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5e45('0x5')](0x3)[_0x5e45('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5e45('0x5')](0x5)[_0x5e45('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e45('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x5e45('0x5')](0x3)[_0x5e45('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e45('0x1e')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5e45('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e45('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5e45('0x5')](0x3)[_0x5e45('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e45('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5e45('0x5')](0x5)[_0x5e45('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e45('0x21')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5e45('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e45('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x5e45('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e45('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5e45('0x5')](0x3)[_0x5e45('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e45('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x5e45('0x5')](0x5)[_0x5e45('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0x1a58=['Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','BOOLEAN'];(function(_0x5a1e6c,_0xedec2d){var _0x1836d8=function(_0x4c3ec0){while(--_0x4c3ec0){_0x5a1e6c['push'](_0x5a1e6c['shift']());}};_0x1836d8(++_0xedec2d);}(_0x1a58,0x17b));var _0x81a5=function(_0x32ef26,_0x3c3d7e){_0x32ef26=_0x32ef26-0x0;var _0x446c01=_0x1a58[_0x32ef26];return _0x446c01;};'use strict';var Sequelize=require(_0x81a5('0x0'));module['exports']={'name':{'type':Sequelize[_0x81a5('0x1')],'unique':_0x81a5('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x81a5('0x3')](_0x81a5('0x4')),'allowNull':![],'defaultValue':_0x81a5('0x4')},'description':{'type':Sequelize[_0x81a5('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x81a5('0x5')},'limitCalls':{'type':Sequelize[_0x81a5('0x6')](0x4)[_0x81a5('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x81a5('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x81a5('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x81a5('0x8')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x81a5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x81a5('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x81a5('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x81a5('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x81a5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x81a5('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x81a5('0x6')](0x5)[_0x81a5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x81a5('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x81a5('0x6')](0x3)[_0x81a5('0x7')],'defaultValue':0x3,'comment':_0x81a5('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x81a5('0x6')](0x5)[_0x81a5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x81a5('0x6')](0x3)[_0x81a5('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x81a5('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x81a5('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x81a5('0xf'),'never','onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x81a5('0x10')],'defaultValue':0x0,'comment':_0x81a5('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x81a5('0x6')](0x9)[_0x81a5('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x81a5('0x6')](0x9)[_0x81a5('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x81a5('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x81a5('0x6')](0x9)[_0x81a5('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x81a5('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x81a5('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0x81a5('0x6')](0x9)[_0x81a5('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x81a5('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x81a5('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x81a5('0x14')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x81a5('0x6')](0x5)[_0x81a5('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x81a5('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x81a5('0x6')](0x9)[_0x81a5('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x81a5('0x16')},'dialOrderByScheduledAt':{'type':Sequelize[_0x81a5('0x3')](_0x81a5('0x17'),'ASC'),'defaultValue':_0x81a5('0x17')},'dialPrefix':{'type':Sequelize[_0x81a5('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x81a5('0x6')](0x3)[_0x81a5('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x81a5('0x18')},'dialCutDigit':{'type':Sequelize[_0x81a5('0x6')](0x3)[_0x81a5('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x81a5('0x19')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x81a5('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x81a5('0x1a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x81a5('0x6')](0x5)[_0x81a5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x81a5('0x1b')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x81a5('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x81a5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x81a5('0x1c')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x81a5('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x81a5('0x6')](0x3)[_0x81a5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x81a5('0x1d')},'dialMachineRetryFrequency':{'type':Sequelize[_0x81a5('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x81a5('0x1e')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x81a5('0x6')](0x3)[_0x81a5('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x81a5('0x1f')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x81a5('0x6')](0x5)[_0x81a5('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x81a5('0x20')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index d85d666..e736659 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 _0x0d9f=['options','Campaign','includeAll','include','findAll','rows','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','find','omit','createdAt','updatedAt','CmHopper','CampaignId','getHopperHistories','findOne','order','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','insert','fromQuery','phone','scheduledAt','ContactId','ListId','field','CmListId','toString','NOW()','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','from','cm_hopper','onlyIfOpen','into','deletedAt\x20IS\x20NULL','push','sequelize','all','removeLists','getBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','end','status','json','offset','limit','undefined','count','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x194c58,_0x2ca80a){var _0xe931ef=function(_0x320e7a){while(--_0x320e7a){_0x194c58['push'](_0x194c58['shift']());}};_0xe931ef(++_0x2ca80a);}(_0x0d9f,0xc8));var _0xf0d9=function(_0x3b711c,_0x4b22dc){_0x3b711c=_0x3b711c-0x0;var _0x2685f0=_0x0d9f[_0x3b711c];return _0x2685f0;};'use strict';var emlformat=require(_0xf0d9('0x0'));var rimraf=require(_0xf0d9('0x1'));var zipdir=require(_0xf0d9('0x2'));var jsonpatch=require(_0xf0d9('0x3'));var rp=require(_0xf0d9('0x4'));var moment=require('moment');var BPromise=require(_0xf0d9('0x5'));var Mustache=require(_0xf0d9('0x6'));var util=require(_0xf0d9('0x7'));var path=require(_0xf0d9('0x8'));var sox=require(_0xf0d9('0x9'));var csv=require(_0xf0d9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf0d9('0xb'));var squel=require(_0xf0d9('0xc'));var crypto=require(_0xf0d9('0xd'));var jsforce=require(_0xf0d9('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf0d9('0xa'));var querystring=require('querystring');var Papa=require(_0xf0d9('0xf'));var Redis=require(_0xf0d9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf0d9('0x11'));var as=require(_0xf0d9('0x12'));var hardwareService=require(_0xf0d9('0x13'));var logger=require(_0xf0d9('0x14'))(_0xf0d9('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf0d9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d7846,_0x1c3d7c){_0x1c3d7c=_0x1c3d7c||0xcc;return function(_0x3fde69){if(_0x3fde69){return _0x1d7846['sendStatus'](_0x1c3d7c);}return _0x1d7846['status'](_0x1c3d7c)[_0xf0d9('0x17')]();};}function respondWithResult(_0x4f9b45,_0x27a0e7){_0x27a0e7=_0x27a0e7||0xc8;return function(_0x29aee5){if(_0x29aee5){return _0x4f9b45[_0xf0d9('0x18')](_0x27a0e7)[_0xf0d9('0x19')](_0x29aee5);}};}function respondWithFilteredResult(_0x452f28,_0x17cc7b){return function(_0x45c1d6){if(_0x45c1d6){var _0x5460af=typeof _0x17cc7b[_0xf0d9('0x1a')]==='undefined'&&typeof _0x17cc7b[_0xf0d9('0x1b')]===_0xf0d9('0x1c');var _0x5e6cf5=_0x45c1d6[_0xf0d9('0x1d')];var _0x1c7c1=_0x5460af?0x0:_0x17cc7b[_0xf0d9('0x1a')];var _0x2f87b7=_0x5460af?_0x45c1d6[_0xf0d9('0x1d')]:_0x17cc7b[_0xf0d9('0x1a')]+_0x17cc7b[_0xf0d9('0x1b')];var _0x53d215;if(_0x2f87b7>=_0x5e6cf5){_0x2f87b7=_0x5e6cf5;_0x53d215=0xc8;}else{_0x53d215=0xce;}_0x452f28['status'](_0x53d215);return _0x452f28['set']('Content-Range',_0x1c7c1+'-'+_0x2f87b7+'/'+_0x5e6cf5)['json'](_0x45c1d6);}return null;};}function patchUpdates(_0x3bc5fa){return function(_0x11fccd){try{jsonpatch[_0xf0d9('0x1e')](_0x11fccd,_0x3bc5fa,!![]);}catch(_0x2b5984){return BPromise[_0xf0d9('0x1f')](_0x2b5984);}return _0x11fccd[_0xf0d9('0x20')]();};}function saveUpdates(_0xedf393,_0x1b2afa){return function(_0x1e3ec8){if(_0x1e3ec8){return _0x1e3ec8[_0xf0d9('0x21')](_0xedf393)[_0xf0d9('0x22')](function(_0x4c07d5){return _0x4c07d5;});}return null;};}function removeEntity(_0x212bba,_0x584c3f){return function(_0x16f031){if(_0x16f031){return _0x16f031[_0xf0d9('0x23')]()['then'](function(){var _0x56294c=_0x16f031[_0xf0d9('0x24')]({'plain':!![]});var _0x31b412=_0xf0d9('0x25');return db[_0xf0d9('0x26')][_0xf0d9('0x23')]({'where':{'type':_0x31b412,'resourceId':_0x56294c['id']}})[_0xf0d9('0x22')](function(){return _0x16f031;});})[_0xf0d9('0x22')](function(){_0x212bba['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x283f72,_0x1abe71){return function(_0x4dba07){if(!_0x4dba07){_0x283f72[_0xf0d9('0x27')](0x194);}return _0x4dba07;};}function handleError(_0x3bea09,_0x1f761c){_0x1f761c=_0x1f761c||0x1f4;return function(_0x144428){logger[_0xf0d9('0x28')](_0x144428[_0xf0d9('0x29')]);if(_0x144428[_0xf0d9('0x2a')]){delete _0x144428[_0xf0d9('0x2a')];}_0x3bea09[_0xf0d9('0x18')](_0x1f761c)['send'](_0x144428);};}exports[_0xf0d9('0x2b')]=function(_0x543795,_0x15834e){var _0x11180a={},_0x216de3={},_0x594503={'count':0x0,'rows':[]};var _0x4162e1=_[_0xf0d9('0x2c')](db['Campaign'][_0xf0d9('0x2d')],function(_0x206663){return{'name':_0x206663[_0xf0d9('0x2e')],'type':_0x206663[_0xf0d9('0x2f')][_0xf0d9('0x30')]};});_0x216de3[_0xf0d9('0x31')]=_[_0xf0d9('0x2c')](_0x4162e1,_0xf0d9('0x2a'));_0x216de3['query']=_['keys'](_0x543795[_0xf0d9('0x32')]);_0x216de3[_0xf0d9('0x33')]=_[_0xf0d9('0x34')](_0x216de3['model'],_0x216de3['query']);_0x11180a[_0xf0d9('0x35')]=_[_0xf0d9('0x34')](_0x216de3[_0xf0d9('0x31')],qs[_0xf0d9('0x36')](_0x543795[_0xf0d9('0x32')][_0xf0d9('0x36')]));_0x11180a['attributes']=_0x11180a[_0xf0d9('0x35')][_0xf0d9('0x37')]?_0x11180a[_0xf0d9('0x35')]:_0x216de3[_0xf0d9('0x31')];if(!_0x543795[_0xf0d9('0x32')][_0xf0d9('0x38')](_0xf0d9('0x39'))){_0x11180a[_0xf0d9('0x1b')]=qs[_0xf0d9('0x1b')](_0x543795[_0xf0d9('0x32')][_0xf0d9('0x1b')]);_0x11180a['offset']=qs['offset'](_0x543795[_0xf0d9('0x32')][_0xf0d9('0x1a')]);}_0x11180a['order']=qs[_0xf0d9('0x3a')](_0x543795[_0xf0d9('0x32')][_0xf0d9('0x3a')]);_0x11180a[_0xf0d9('0x3b')]=qs[_0xf0d9('0x33')](_[_0xf0d9('0x3c')](_0x543795['query'],_0x216de3[_0xf0d9('0x33')]),_0x4162e1);if(_0x543795[_0xf0d9('0x32')][_0xf0d9('0x3d')]){_0x11180a[_0xf0d9('0x3b')]=_[_0xf0d9('0x3e')](_0x11180a[_0xf0d9('0x3b')],{'$or':_[_0xf0d9('0x2c')](_0x4162e1,function(_0x538966){if(_0x538966[_0xf0d9('0x2f')]!==_0xf0d9('0x3f')){var _0x25b27a={};_0x25b27a[_0x538966['name']]={'$like':'%'+_0x543795[_0xf0d9('0x32')][_0xf0d9('0x3d')]+'%'};return _0x25b27a;}})});}_0x11180a=_[_0xf0d9('0x3e')]({},_0x11180a,_0x543795[_0xf0d9('0x40')]);var _0x2fea35={'where':_0x11180a[_0xf0d9('0x3b')]};return db[_0xf0d9('0x41')][_0xf0d9('0x1d')](_0x2fea35)['then'](function(_0x194879){_0x594503[_0xf0d9('0x1d')]=_0x194879;if(_0x543795[_0xf0d9('0x32')][_0xf0d9('0x42')]){_0x11180a[_0xf0d9('0x43')]=[{'all':!![]}];}return db['Campaign'][_0xf0d9('0x44')](_0x11180a);})[_0xf0d9('0x22')](function(_0x4b5978){_0x594503[_0xf0d9('0x45')]=_0x4b5978;return _0x594503;})[_0xf0d9('0x22')](respondWithFilteredResult(_0x15834e,_0x11180a))[_0xf0d9('0x46')](handleError(_0x15834e,null));};exports[_0xf0d9('0x47')]=function(_0x2b39c6,_0x29c33a){var _0xe59216={'raw':![],'where':{'id':_0x2b39c6[_0xf0d9('0x48')]['id']}},_0x213a2e={};_0x213a2e[_0xf0d9('0x31')]=_[_0xf0d9('0x49')](db['Campaign']['rawAttributes']);_0x213a2e[_0xf0d9('0x32')]=_[_0xf0d9('0x49')](_0x2b39c6[_0xf0d9('0x32')]);_0x213a2e['filters']=_[_0xf0d9('0x34')](_0x213a2e['model'],_0x213a2e[_0xf0d9('0x32')]);_0xe59216[_0xf0d9('0x35')]=_[_0xf0d9('0x34')](_0x213a2e['model'],qs[_0xf0d9('0x36')](_0x2b39c6['query'][_0xf0d9('0x36')]));_0xe59216[_0xf0d9('0x35')]=_0xe59216[_0xf0d9('0x35')][_0xf0d9('0x37')]?_0xe59216['attributes']:_0x213a2e[_0xf0d9('0x31')];if(_0x2b39c6[_0xf0d9('0x32')][_0xf0d9('0x42')]){_0xe59216[_0xf0d9('0x43')]=[{'all':!![]}];}_0xe59216=_[_0xf0d9('0x3e')]({},_0xe59216,_0x2b39c6[_0xf0d9('0x40')]);return db[_0xf0d9('0x41')]['find'](_0xe59216)[_0xf0d9('0x22')](handleEntityNotFound(_0x29c33a,null))[_0xf0d9('0x22')](respondWithResult(_0x29c33a,null))['catch'](handleError(_0x29c33a,null));};exports[_0xf0d9('0x4a')]=function(_0x1771ff,_0x22cc13){return db[_0xf0d9('0x41')][_0xf0d9('0x4a')](_0x1771ff[_0xf0d9('0x4b')],{})['then'](function(_0xaabc33){var _0x59ee43=_0x1771ff[_0xf0d9('0x4c')]['get']({'plain':!![]});if(!_0x59ee43)throw new Error(_0xf0d9('0x4d'));if(_0x59ee43[_0xf0d9('0x4e')]===_0xf0d9('0x4c')){var _0x482112=_0xaabc33[_0xf0d9('0x24')]({'plain':!![]});var _0x21e4f0=_0xf0d9('0x25');return db[_0xf0d9('0x4f')]['find']({'where':{'name':_0x21e4f0,'userProfileId':_0x59ee43[_0xf0d9('0x50')]},'raw':!![]})['then'](function(_0x7de36d){if(_0x7de36d&&_0x7de36d[_0xf0d9('0x51')]===0x0){return db['UserProfileResource'][_0xf0d9('0x4a')]({'name':_0x482112[_0xf0d9('0x2a')],'resourceId':_0x482112['id'],'type':_0x7de36d[_0xf0d9('0x2a')],'sectionId':_0x7de36d['id']},{})[_0xf0d9('0x22')](function(){return _0xaabc33;});}else{return _0xaabc33;}})[_0xf0d9('0x46')](function(_0x4f83ed){logger[_0xf0d9('0x28')](_0xf0d9('0x52'),_0x4f83ed);throw _0x4f83ed;});}return _0xaabc33;})[_0xf0d9('0x22')](respondWithResult(_0x22cc13,0xc9))['catch'](handleError(_0x22cc13,null));};exports[_0xf0d9('0x53')]=function(_0x3a8992,_0x4c03f6){var _0x5afb49={'where':{'id':_0x3a8992[_0xf0d9('0x48')]['id']}},_0x5b384c={};_0x5b384c['model']=_[_0xf0d9('0x49')](db[_0xf0d9('0x41')][_0xf0d9('0x2d')]);_0x5afb49[_0xf0d9('0x35')]=_[_0xf0d9('0x34')](_0x5b384c[_0xf0d9('0x31')],qs[_0xf0d9('0x36')](_0x3a8992['query']['fields']));_0x5afb49[_0xf0d9('0x35')]=_0x5afb49['attributes']['length']?_0x5afb49[_0xf0d9('0x35')]:_0x5b384c['model'];if(_0x3a8992[_0xf0d9('0x32')][_0xf0d9('0x42')]){_0x5afb49[_0xf0d9('0x43')]=[{'all':!![]}];}_0x5afb49=_['merge']({},_0x5afb49,_0x3a8992['options']);return db[_0xf0d9('0x41')][_0xf0d9('0x54')](_0x5afb49)['then'](handleEntityNotFound(_0x4c03f6,null))['then'](function(_0x9ce9c2){if(_0x9ce9c2){var _0x5c2325=_0x9ce9c2[_0xf0d9('0x24')]({'plain':!![]});_0x5c2325=qs[_0xf0d9('0x55')](_0x5c2325,['id',_0xf0d9('0x56'),_0xf0d9('0x57')]);_0x3a8992[_0xf0d9('0x4b')]=_['omit'](_0x3a8992['body'],['id','createdAt',_0xf0d9('0x57')]);return db[_0xf0d9('0x41')][_0xf0d9('0x4a')](_[_0xf0d9('0x3e')](_0x5c2325,_0x3a8992[_0xf0d9('0x4b')]),{'include':_0x3a8992[_0xf0d9('0x32')][_0xf0d9('0x42')]?[{'all':!![]}]:undefined})[_0xf0d9('0x22')](function(_0x5f3706){var _0x5e1206=_0x3a8992[_0xf0d9('0x4c')][_0xf0d9('0x24')]({'plain':!![]});if(!_0x5e1206)throw new Error(_0xf0d9('0x4d'));if(_0x5e1206[_0xf0d9('0x4e')]==='user'){var _0x423b1c=_0x5f3706[_0xf0d9('0x24')]({'plain':!![]});var _0x2b62cf=_0xf0d9('0x25');return db[_0xf0d9('0x4f')][_0xf0d9('0x54')]({'where':{'name':_0x2b62cf,'userProfileId':_0x5e1206['userProfileId']},'raw':!![]})[_0xf0d9('0x22')](function(_0x1142bf){if(_0x1142bf&&_0x1142bf[_0xf0d9('0x51')]===0x0){return db[_0xf0d9('0x26')][_0xf0d9('0x4a')]({'name':_0x423b1c[_0xf0d9('0x2a')],'resourceId':_0x423b1c['id'],'type':_0x1142bf['name'],'sectionId':_0x1142bf['id']},{})['then'](function(){return _0x5f3706;});}else{return _0x5f3706;}})[_0xf0d9('0x46')](function(_0x2e6779){logger[_0xf0d9('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e6779);throw _0x2e6779;});}return _0x5f3706;});}})['then'](respondWithResult(_0x4c03f6,0xc9))['catch'](handleError(_0x4c03f6,null));};exports[_0xf0d9('0x21')]=function(_0x4592f6,_0x37215f){if(_0x4592f6[_0xf0d9('0x4b')]['id']){delete _0x4592f6[_0xf0d9('0x4b')]['id'];}return db[_0xf0d9('0x41')][_0xf0d9('0x54')]({'where':{'id':_0x4592f6[_0xf0d9('0x48')]['id']}})['then'](handleEntityNotFound(_0x37215f,null))['then'](saveUpdates(_0x4592f6[_0xf0d9('0x4b')],null))[_0xf0d9('0x22')](respondWithResult(_0x37215f,null))['catch'](handleError(_0x37215f,null));};exports[_0xf0d9('0x23')]=function(_0x5e9835,_0x54edfb){return db[_0xf0d9('0x41')][_0xf0d9('0x54')]({'where':{'id':_0x5e9835[_0xf0d9('0x48')]['id']}})['then'](handleEntityNotFound(_0x54edfb,null))[_0xf0d9('0x22')](removeEntity(_0x54edfb,null))[_0xf0d9('0x46')](handleError(_0x54edfb,null));};exports['getHoppers']=function(_0x38017c,_0x42d865,_0x40d794){var _0x1ae21a={'raw':!![],'where':{}};var _0x5ccb8d={};var _0x28796b={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x38017c[_0xf0d9('0x48')]['id']}})[_0xf0d9('0x22')](handleEntityNotFound(_0x42d865,null))['then'](function(_0x2422db){if(_0x2422db){_0x5ccb8d[_0xf0d9('0x31')]=_[_0xf0d9('0x49')](db[_0xf0d9('0x58')][_0xf0d9('0x2d')]);_0x5ccb8d['query']=_[_0xf0d9('0x49')](_0x38017c[_0xf0d9('0x32')]);_0x5ccb8d['filters']=_['intersection'](_0x5ccb8d[_0xf0d9('0x31')],_0x5ccb8d[_0xf0d9('0x32')]);_0x1ae21a['attributes']=_[_0xf0d9('0x34')](_0x5ccb8d['model'],qs[_0xf0d9('0x36')](_0x38017c['query'][_0xf0d9('0x36')]));_0x1ae21a[_0xf0d9('0x35')]=_0x1ae21a[_0xf0d9('0x35')]['length']?_0x1ae21a[_0xf0d9('0x35')]:_0x5ccb8d['model'];if(!_0x38017c[_0xf0d9('0x32')]['hasOwnProperty']('nolimit')){_0x1ae21a[_0xf0d9('0x1b')]=qs[_0xf0d9('0x1b')](_0x38017c[_0xf0d9('0x32')][_0xf0d9('0x1b')]);_0x1ae21a[_0xf0d9('0x1a')]=qs[_0xf0d9('0x1a')](_0x38017c[_0xf0d9('0x32')][_0xf0d9('0x1a')]);}_0x1ae21a['order']=qs[_0xf0d9('0x3a')](_0x38017c[_0xf0d9('0x32')][_0xf0d9('0x3a')]);_0x1ae21a['where']=qs[_0xf0d9('0x33')](_[_0xf0d9('0x3c')](_0x38017c['query'],_0x5ccb8d[_0xf0d9('0x33')]));_0x1ae21a[_0xf0d9('0x3b')][_0xf0d9('0x59')]=_0x2422db['id'];if(_0x38017c[_0xf0d9('0x32')]['filter']){_0x1ae21a[_0xf0d9('0x3b')]=_[_0xf0d9('0x3e')](_0x1ae21a['where'],{'$or':_[_0xf0d9('0x2c')](_0x1ae21a[_0xf0d9('0x35')],function(_0x3ece04){var _0x27a7b8={};_0x27a7b8[_0x3ece04]={'$like':'%'+_0x38017c[_0xf0d9('0x32')][_0xf0d9('0x3d')]+'%'};return _0x27a7b8;})});}_0x1ae21a=_[_0xf0d9('0x3e')]({},_0x1ae21a,_0x38017c['options']);return db[_0xf0d9('0x58')][_0xf0d9('0x1d')]({'where':_0x1ae21a[_0xf0d9('0x3b')]})[_0xf0d9('0x22')](function(_0x4c1ad2){_0x28796b[_0xf0d9('0x1d')]=_0x4c1ad2;if(_0x38017c[_0xf0d9('0x32')][_0xf0d9('0x42')]){_0x1ae21a[_0xf0d9('0x43')]=[{'all':!![]}];}return db[_0xf0d9('0x58')][_0xf0d9('0x44')](_0x1ae21a);})[_0xf0d9('0x22')](function(_0xa83cac){_0x28796b['rows']=_0xa83cac;return _0x28796b;});}})['then'](respondWithFilteredResult(_0x42d865,_0x1ae21a))[_0xf0d9('0x46')](handleError(_0x42d865,null));};exports[_0xf0d9('0x5a')]=function(_0x33aa89,_0x1cc042,_0x3ba822){var _0x3effdd={'raw':!![],'where':{}};var _0x5abfcf={};var _0x32e86b={'count':0x0,'rows':[]};return db[_0xf0d9('0x41')][_0xf0d9('0x5b')]({'where':{'id':_0x33aa89[_0xf0d9('0x48')]['id']}})[_0xf0d9('0x22')](handleEntityNotFound(_0x1cc042,null))[_0xf0d9('0x22')](function(_0x1ac5cc){if(_0x1ac5cc){_0x5abfcf[_0xf0d9('0x31')]=_[_0xf0d9('0x49')](db['CmHopperHistory'][_0xf0d9('0x2d')]);_0x5abfcf[_0xf0d9('0x32')]=_[_0xf0d9('0x49')](_0x33aa89[_0xf0d9('0x32')]);_0x5abfcf[_0xf0d9('0x33')]=_['intersection'](_0x5abfcf[_0xf0d9('0x31')],_0x5abfcf[_0xf0d9('0x32')]);_0x3effdd['attributes']=_['intersection'](_0x5abfcf[_0xf0d9('0x31')],qs['fields'](_0x33aa89[_0xf0d9('0x32')]['fields']));_0x3effdd[_0xf0d9('0x35')]=_0x3effdd[_0xf0d9('0x35')]['length']?_0x3effdd[_0xf0d9('0x35')]:_0x5abfcf[_0xf0d9('0x31')];if(!_0x33aa89[_0xf0d9('0x32')][_0xf0d9('0x38')]('nolimit')){_0x3effdd[_0xf0d9('0x1b')]=qs[_0xf0d9('0x1b')](_0x33aa89[_0xf0d9('0x32')][_0xf0d9('0x1b')]);_0x3effdd[_0xf0d9('0x1a')]=qs[_0xf0d9('0x1a')](_0x33aa89['query'][_0xf0d9('0x1a')]);}_0x3effdd[_0xf0d9('0x5c')]=qs['sort'](_0x33aa89[_0xf0d9('0x32')][_0xf0d9('0x3a')]);_0x3effdd[_0xf0d9('0x3b')]=qs[_0xf0d9('0x33')](_[_0xf0d9('0x3c')](_0x33aa89[_0xf0d9('0x32')],_0x5abfcf[_0xf0d9('0x33')]));_0x3effdd[_0xf0d9('0x3b')][_0xf0d9('0x59')]=_0x1ac5cc['id'];if(_0x33aa89[_0xf0d9('0x32')]['filter']){_0x3effdd[_0xf0d9('0x3b')]=_[_0xf0d9('0x3e')](_0x3effdd['where'],{'$or':_[_0xf0d9('0x2c')](_0x3effdd[_0xf0d9('0x35')],function(_0x3aa39b){var _0x484a4d={};_0x484a4d[_0x3aa39b]={'$like':'%'+_0x33aa89[_0xf0d9('0x32')][_0xf0d9('0x3d')]+'%'};return _0x484a4d;})});}_0x3effdd=_['merge']({},_0x3effdd,_0x33aa89[_0xf0d9('0x40')]);return db[_0xf0d9('0x5d')][_0xf0d9('0x1d')]({'where':_0x3effdd[_0xf0d9('0x3b')]})[_0xf0d9('0x22')](function(_0x5e54bb){_0x32e86b['count']=_0x5e54bb;if(_0x33aa89[_0xf0d9('0x32')][_0xf0d9('0x42')]){_0x3effdd[_0xf0d9('0x43')]=[{'all':!![]}];}return db[_0xf0d9('0x5d')][_0xf0d9('0x44')](_0x3effdd);})[_0xf0d9('0x22')](function(_0x3f553e){_0x32e86b['rows']=_0x3f553e;return _0x32e86b;});}})[_0xf0d9('0x22')](respondWithFilteredResult(_0x1cc042,_0x3effdd))[_0xf0d9('0x46')](handleError(_0x1cc042,null));};exports[_0xf0d9('0x5e')]=function(_0x11437a,_0x49c3cd,_0x34d847){var _0x4134c8={'raw':!![],'where':{}};var _0x14ff96={};var _0x11313f={'count':0x0,'rows':[]};return db['Campaign'][_0xf0d9('0x5b')]({'where':{'id':_0x11437a[_0xf0d9('0x48')]['id']}})[_0xf0d9('0x22')](handleEntityNotFound(_0x49c3cd,null))['then'](function(_0x535afa){if(_0x535afa){_0x14ff96[_0xf0d9('0x31')]=_[_0xf0d9('0x49')](db[_0xf0d9('0x5f')]['rawAttributes']);_0x14ff96[_0xf0d9('0x32')]=_['keys'](_0x11437a[_0xf0d9('0x32')]);_0x14ff96[_0xf0d9('0x33')]=_[_0xf0d9('0x34')](_0x14ff96[_0xf0d9('0x31')],_0x14ff96['query']);_0x4134c8[_0xf0d9('0x35')]=_[_0xf0d9('0x34')](_0x14ff96[_0xf0d9('0x31')],qs[_0xf0d9('0x36')](_0x11437a['query']['fields']));_0x4134c8[_0xf0d9('0x35')]=_0x4134c8[_0xf0d9('0x35')][_0xf0d9('0x37')]?_0x4134c8[_0xf0d9('0x35')]:_0x14ff96['model'];if(!_0x11437a[_0xf0d9('0x32')][_0xf0d9('0x38')](_0xf0d9('0x39'))){_0x4134c8[_0xf0d9('0x1b')]=qs[_0xf0d9('0x1b')](_0x11437a[_0xf0d9('0x32')]['limit']);_0x4134c8[_0xf0d9('0x1a')]=qs[_0xf0d9('0x1a')](_0x11437a[_0xf0d9('0x32')][_0xf0d9('0x1a')]);}_0x4134c8[_0xf0d9('0x5c')]=qs['sort'](_0x11437a['query'][_0xf0d9('0x3a')]);_0x4134c8['where']=qs['filters'](_[_0xf0d9('0x3c')](_0x11437a[_0xf0d9('0x32')],_0x14ff96[_0xf0d9('0x33')]));_0x4134c8[_0xf0d9('0x3b')][_0xf0d9('0x59')]=_0x535afa['id'];if(_0x11437a['query'][_0xf0d9('0x3d')]){_0x4134c8[_0xf0d9('0x3b')]=_[_0xf0d9('0x3e')](_0x4134c8[_0xf0d9('0x3b')],{'$or':_[_0xf0d9('0x2c')](_0x4134c8[_0xf0d9('0x35')],function(_0x47fe4b){var _0x4d47d4={};_0x4d47d4[_0x47fe4b]={'$like':'%'+_0x11437a[_0xf0d9('0x32')][_0xf0d9('0x3d')]+'%'};return _0x4d47d4;})});}_0x4134c8=_['merge']({},_0x4134c8,_0x11437a[_0xf0d9('0x40')]);return db[_0xf0d9('0x5f')][_0xf0d9('0x1d')]({'where':_0x4134c8[_0xf0d9('0x3b')]})[_0xf0d9('0x22')](function(_0x1f9fa8){_0x11313f[_0xf0d9('0x1d')]=_0x1f9fa8;if(_0x11437a[_0xf0d9('0x32')][_0xf0d9('0x42')]){_0x4134c8[_0xf0d9('0x43')]=[{'all':!![]}];}return db[_0xf0d9('0x5f')][_0xf0d9('0x44')](_0x4134c8);})[_0xf0d9('0x22')](function(_0x5993dd){_0x11313f['rows']=_0x5993dd;return _0x11313f;});}})['then'](respondWithFilteredResult(_0x49c3cd,_0x4134c8))[_0xf0d9('0x46')](handleError(_0x49c3cd,null));};exports[_0xf0d9('0x60')]=function(_0x303f67,_0x3bdca2,_0x562f61){var _0x464dbd={'raw':!![],'where':{}};var _0x45dde6={};var _0x1ddcf2={'count':0x0,'rows':[]};return db['Campaign'][_0xf0d9('0x5b')]({'where':{'id':_0x303f67[_0xf0d9('0x48')]['id']}})[_0xf0d9('0x22')](handleEntityNotFound(_0x3bdca2,null))['then'](function(_0x18b32d){if(_0x18b32d){_0x45dde6[_0xf0d9('0x31')]=_[_0xf0d9('0x49')](db[_0xf0d9('0x61')][_0xf0d9('0x2d')]);_0x45dde6[_0xf0d9('0x32')]=_['keys'](_0x303f67[_0xf0d9('0x32')]);_0x45dde6['filters']=_[_0xf0d9('0x34')](_0x45dde6[_0xf0d9('0x31')],_0x45dde6[_0xf0d9('0x32')]);_0x464dbd[_0xf0d9('0x35')]=_[_0xf0d9('0x34')](_0x45dde6[_0xf0d9('0x31')],qs['fields'](_0x303f67['query']['fields']));_0x464dbd[_0xf0d9('0x35')]=_0x464dbd['attributes']['length']?_0x464dbd[_0xf0d9('0x35')]:_0x45dde6[_0xf0d9('0x31')];if(!_0x303f67['query']['hasOwnProperty'](_0xf0d9('0x39'))){_0x464dbd[_0xf0d9('0x1b')]=qs[_0xf0d9('0x1b')](_0x303f67[_0xf0d9('0x32')][_0xf0d9('0x1b')]);_0x464dbd[_0xf0d9('0x1a')]=qs[_0xf0d9('0x1a')](_0x303f67[_0xf0d9('0x32')]['offset']);}_0x464dbd[_0xf0d9('0x5c')]=qs[_0xf0d9('0x3a')](_0x303f67[_0xf0d9('0x32')][_0xf0d9('0x3a')]);_0x464dbd[_0xf0d9('0x3b')]=qs['filters'](_[_0xf0d9('0x3c')](_0x303f67[_0xf0d9('0x32')],_0x45dde6[_0xf0d9('0x33')]));_0x464dbd[_0xf0d9('0x3b')][_0xf0d9('0x59')]=_0x18b32d['id'];if(_0x303f67[_0xf0d9('0x32')][_0xf0d9('0x3d')]){_0x464dbd[_0xf0d9('0x3b')]=_['merge'](_0x464dbd['where'],{'$or':_[_0xf0d9('0x2c')](_0x464dbd[_0xf0d9('0x35')],function(_0x52d578){var _0x2a1533={};_0x2a1533[_0x52d578]={'$like':'%'+_0x303f67[_0xf0d9('0x32')]['filter']+'%'};return _0x2a1533;})});}_0x464dbd=_[_0xf0d9('0x3e')]({},_0x464dbd,_0x303f67[_0xf0d9('0x40')]);return db[_0xf0d9('0x61')][_0xf0d9('0x1d')]({'where':_0x464dbd[_0xf0d9('0x3b')]})[_0xf0d9('0x22')](function(_0x2943d7){_0x1ddcf2[_0xf0d9('0x1d')]=_0x2943d7;if(_0x303f67[_0xf0d9('0x32')]['includeAll']){_0x464dbd[_0xf0d9('0x43')]=[{'all':!![]}];}return db[_0xf0d9('0x61')]['findAll'](_0x464dbd);})['then'](function(_0x433591){_0x1ddcf2[_0xf0d9('0x45')]=_0x433591;return _0x1ddcf2;});}})[_0xf0d9('0x22')](respondWithFilteredResult(_0x3bdca2,_0x464dbd))[_0xf0d9('0x46')](handleError(_0x3bdca2,null));};exports[_0xf0d9('0x62')]=function(_0x1414eb,_0x128c57,_0x439d8c){var _0x2f403b={};var _0x29197c={};var _0x5ca4d9;var _0x55aa39;return db[_0xf0d9('0x41')][_0xf0d9('0x5b')]({'where':{'id':_0x1414eb[_0xf0d9('0x48')]['id']}})[_0xf0d9('0x22')](handleEntityNotFound(_0x128c57,null))[_0xf0d9('0x22')](function(_0x4c2518){if(_0x4c2518){_0x5ca4d9=_0x4c2518;_0x29197c[_0xf0d9('0x31')]=_[_0xf0d9('0x49')](db[_0xf0d9('0x63')][_0xf0d9('0x2d')]);_0x29197c['query']=_['keys'](_0x1414eb[_0xf0d9('0x32')]);_0x29197c[_0xf0d9('0x33')]=_[_0xf0d9('0x34')](_0x29197c[_0xf0d9('0x31')],_0x29197c[_0xf0d9('0x32')]);_0x2f403b[_0xf0d9('0x35')]=_['intersection'](_0x29197c[_0xf0d9('0x31')],qs[_0xf0d9('0x36')](_0x1414eb[_0xf0d9('0x32')][_0xf0d9('0x36')]));_0x2f403b['attributes']=_0x2f403b['attributes'][_0xf0d9('0x37')]?_0x2f403b[_0xf0d9('0x35')]:_0x29197c[_0xf0d9('0x31')];_0x2f403b['order']=qs[_0xf0d9('0x3a')](_0x1414eb[_0xf0d9('0x32')][_0xf0d9('0x3a')]);_0x2f403b[_0xf0d9('0x3b')]=qs[_0xf0d9('0x33')](_[_0xf0d9('0x3c')](_0x1414eb[_0xf0d9('0x32')],_0x29197c[_0xf0d9('0x33')]));if(_0x1414eb[_0xf0d9('0x32')][_0xf0d9('0x3d')]){_0x2f403b[_0xf0d9('0x3b')]=_['merge'](_0x2f403b[_0xf0d9('0x3b')],{'$or':_[_0xf0d9('0x2c')](_0x2f403b['attributes'],function(_0xa13ce1){var _0x162522={};_0x162522[_0xa13ce1]={'$like':'%'+_0x1414eb[_0xf0d9('0x32')]['filter']+'%'};return _0x162522;})});}_0x2f403b=_[_0xf0d9('0x3e')]({},_0x2f403b,_0x1414eb[_0xf0d9('0x40')]);return _0x5ca4d9['getLists'](_0x2f403b);}})[_0xf0d9('0x22')](function(_0x100de4){if(_0x100de4){_0x55aa39=_0x100de4[_0xf0d9('0x37')];if(!_0x1414eb[_0xf0d9('0x32')][_0xf0d9('0x38')](_0xf0d9('0x39'))){_0x2f403b[_0xf0d9('0x1b')]=qs['limit'](_0x1414eb[_0xf0d9('0x32')][_0xf0d9('0x1b')]);_0x2f403b[_0xf0d9('0x1a')]=qs['offset'](_0x1414eb[_0xf0d9('0x32')][_0xf0d9('0x1a')]);}return _0x5ca4d9[_0xf0d9('0x62')](_0x2f403b);}})[_0xf0d9('0x22')](function(_0x3c7d62){if(_0x3c7d62){return _0x3c7d62?{'count':_0x55aa39,'rows':_0x3c7d62}:null;}})[_0xf0d9('0x22')](respondWithResult(_0x128c57,null))[_0xf0d9('0x46')](handleError(_0x128c57,null));};exports[_0xf0d9('0x64')]=function(_0xb94fac,_0xc58ddf,_0x41aeda){var _0x35857f,_0x43d757;return db[_0xf0d9('0x41')][_0xf0d9('0x54')]({'where':{'id':_0xb94fac[_0xf0d9('0x48')]['id']}})[_0xf0d9('0x22')](handleEntityNotFound(_0xc58ddf,null))['then'](function(_0x1db27f){if(_0x1db27f){_0x43d757=_0x1db27f;return _0x1db27f['addLists'](_0xb94fac[_0xf0d9('0x4b')]['ids'],_[_0xf0d9('0x55')](_0xb94fac[_0xf0d9('0x4b')],[_0xf0d9('0x65'),'id'])||{});}return null;})['spread'](function(_0x4289cc){var _0x134df0;_0x35857f=_0x4289cc||[];var _0xeb939e=[];if(_0x4289cc){for(var _0x3804d3=0x0;_0x3804d3<_0x4289cc[_0xf0d9('0x37')];_0x3804d3+=0x1){var _0x36a4c6=_0x4289cc[_0x3804d3][_0xf0d9('0x24')]({'plain':!![]});_0x43d757[_0xf0d9('0x66')]=_0xb94fac[_0xf0d9('0x4b')][_0xf0d9('0x66')]?_0xb94fac[_0xf0d9('0x4b')][_0xf0d9('0x66')]:_0x43d757['dialCheckDuplicateType'];switch(_0x43d757['dialCheckDuplicateType']){case _0xf0d9('0x67'):_0x134df0=squel[_0xf0d9('0x68')]()['into']('cm_hopper')[_0xf0d9('0x69')]([_0xf0d9('0x6a'),_0xf0d9('0x6b'),_0xf0d9('0x6c'),_0xf0d9('0x6d'),'CampaignId','createdAt',_0xf0d9('0x57')],squel['select']()['field'](_0xf0d9('0x6a'),_0xf0d9('0x6a'))[_0xf0d9('0x6e')]('NOW()',_0xf0d9('0x6b'))['field']('id','ContactId')[_0xf0d9('0x6e')](_0x36a4c6[_0xf0d9('0x6f')][_0xf0d9('0x70')](),_0xf0d9('0x6d'))[_0xf0d9('0x6e')](_0xb94fac[_0xf0d9('0x48')]['id'][_0xf0d9('0x70')](),_0xf0d9('0x59'))['field'](_0xf0d9('0x71'),_0xf0d9('0x56'))[_0xf0d9('0x6e')](_0xf0d9('0x71'),_0xf0d9('0x57'))['from'](_0xf0d9('0x72'))['where']('deletedAt\x20IS\x20NULL')[_0xf0d9('0x3b')](_0xf0d9('0x73'),_0x36a4c6[_0xf0d9('0x6f')][_0xf0d9('0x70')]())['where'](_0xf0d9('0x74'))[_0xf0d9('0x3b')](_0xf0d9('0x75'),squel[_0xf0d9('0x76')]()[_0xf0d9('0x6e')]('COALESCE(calleridnum,\x27\x27)')['from']('cm_hopper_final')[_0xf0d9('0x3b')](_0xf0d9('0x77'),_0xb94fac[_0xf0d9('0x48')]['id'][_0xf0d9('0x70')]()))[_0xf0d9('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf0d9('0x76')]()['field'](_0xf0d9('0x78'))[_0xf0d9('0x79')](_0xf0d9('0x7a'))['where']('CampaignId\x20=\x20?',_0xb94fac[_0xf0d9('0x48')]['id'][_0xf0d9('0x70')]())))[_0xf0d9('0x70')]();break;case _0xf0d9('0x7b'):_0x134df0=squel[_0xf0d9('0x68')]()[_0xf0d9('0x7c')](_0xf0d9('0x7a'))['fromQuery'](['phone',_0xf0d9('0x6b'),_0xf0d9('0x6c'),_0xf0d9('0x6d'),'CampaignId',_0xf0d9('0x56'),_0xf0d9('0x57')],squel[_0xf0d9('0x76')]()[_0xf0d9('0x6e')](_0xf0d9('0x6a'),_0xf0d9('0x6a'))[_0xf0d9('0x6e')](_0xf0d9('0x71'),'scheduledAt')[_0xf0d9('0x6e')]('id',_0xf0d9('0x6c'))[_0xf0d9('0x6e')](_0x36a4c6[_0xf0d9('0x6f')][_0xf0d9('0x70')](),_0xf0d9('0x6d'))['field'](_0xb94fac[_0xf0d9('0x48')]['id']['toString'](),_0xf0d9('0x59'))[_0xf0d9('0x6e')]('NOW()',_0xf0d9('0x56'))[_0xf0d9('0x6e')]('NOW()',_0xf0d9('0x57'))[_0xf0d9('0x79')](_0xf0d9('0x72'))[_0xf0d9('0x3b')](_0xf0d9('0x7d'))[_0xf0d9('0x3b')](_0xf0d9('0x73'),_0x36a4c6[_0xf0d9('0x6f')][_0xf0d9('0x70')]())[_0xf0d9('0x3b')](_0xf0d9('0x74'))[_0xf0d9('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf0d9('0x76')]()[_0xf0d9('0x6e')](_0xf0d9('0x78'))[_0xf0d9('0x79')]('cm_hopper')[_0xf0d9('0x3b')](_0xf0d9('0x77'),_0xb94fac[_0xf0d9('0x48')]['id']['toString']())))['toString']();break;default:_0x134df0=squel[_0xf0d9('0x68')]()[_0xf0d9('0x7c')](_0xf0d9('0x7a'))[_0xf0d9('0x69')](['phone',_0xf0d9('0x6b'),_0xf0d9('0x6c'),_0xf0d9('0x6d'),_0xf0d9('0x59'),_0xf0d9('0x56'),'updatedAt'],squel[_0xf0d9('0x76')]()[_0xf0d9('0x6e')]('phone',_0xf0d9('0x6a'))[_0xf0d9('0x6e')]('NOW()',_0xf0d9('0x6b'))[_0xf0d9('0x6e')]('id',_0xf0d9('0x6c'))[_0xf0d9('0x6e')](_0x36a4c6[_0xf0d9('0x6f')][_0xf0d9('0x70')](),_0xf0d9('0x6d'))[_0xf0d9('0x6e')](_0xb94fac['params']['id'][_0xf0d9('0x70')](),_0xf0d9('0x59'))[_0xf0d9('0x6e')](_0xf0d9('0x71'),_0xf0d9('0x56'))[_0xf0d9('0x6e')]('NOW()',_0xf0d9('0x57'))['from'](_0xf0d9('0x72'))[_0xf0d9('0x3b')](_0xf0d9('0x7d'))[_0xf0d9('0x3b')](_0xf0d9('0x73'),_0x36a4c6['CmListId'][_0xf0d9('0x70')]())[_0xf0d9('0x3b')](_0xf0d9('0x74')))['toString']();}_0xeb939e[_0xf0d9('0x7e')](db[_0xf0d9('0x7f')][_0xf0d9('0x32')](_0x134df0));}return BPromise[_0xf0d9('0x80')](_0xeb939e);}})[_0xf0d9('0x22')](function(){return _0x35857f;})[_0xf0d9('0x22')](respondWithResult(_0xc58ddf,null))[_0xf0d9('0x46')](handleError(_0xc58ddf,null));};exports[_0xf0d9('0x81')]=function(_0x5fae1a,_0x525423,_0x19a0d4){return db[_0xf0d9('0x41')]['find']({'where':{'id':_0x5fae1a[_0xf0d9('0x48')]['id']}})[_0xf0d9('0x22')](handleEntityNotFound(_0x525423,null))[_0xf0d9('0x22')](function(_0x4ae5e6){if(_0x4ae5e6){return _0x4ae5e6[_0xf0d9('0x81')](_0x5fae1a[_0xf0d9('0x32')][_0xf0d9('0x65')]);}})[_0xf0d9('0x22')](function(_0xdec9a1){if(_0xdec9a1){return db[_0xf0d9('0x58')][_0xf0d9('0x23')]({'where':{'ListId':_0x5fae1a[_0xf0d9('0x32')][_0xf0d9('0x65')],'CampaignId':_0x5fae1a[_0xf0d9('0x48')]['id']}})['then'](function(){return _0xdec9a1;});}})[_0xf0d9('0x22')](respondWithStatusCode(_0x525423,null))[_0xf0d9('0x46')](handleError(_0x525423,null));};exports[_0xf0d9('0x82')]=function(_0x359f70,_0x3e0c41,_0x5051bc){var _0x275bec={};var _0xdd31c4={};var _0x41f3d9;var _0x164c80;return db[_0xf0d9('0x41')][_0xf0d9('0x5b')]({'where':{'id':_0x359f70['params']['id']}})['then'](handleEntityNotFound(_0x3e0c41,null))['then'](function(_0x3a6811){if(_0x3a6811){_0x41f3d9=_0x3a6811;_0xdd31c4[_0xf0d9('0x31')]=_[_0xf0d9('0x49')](db[_0xf0d9('0x63')]['rawAttributes']);_0xdd31c4[_0xf0d9('0x32')]=_[_0xf0d9('0x49')](_0x359f70[_0xf0d9('0x32')]);_0xdd31c4['filters']=_[_0xf0d9('0x34')](_0xdd31c4[_0xf0d9('0x31')],_0xdd31c4[_0xf0d9('0x32')]);_0x275bec['attributes']=_[_0xf0d9('0x34')](_0xdd31c4[_0xf0d9('0x31')],qs['fields'](_0x359f70['query'][_0xf0d9('0x36')]));_0x275bec['attributes']=_0x275bec['attributes'][_0xf0d9('0x37')]?_0x275bec['attributes']:_0xdd31c4[_0xf0d9('0x31')];_0x275bec[_0xf0d9('0x5c')]=qs[_0xf0d9('0x3a')](_0x359f70[_0xf0d9('0x32')][_0xf0d9('0x3a')]);_0x275bec[_0xf0d9('0x3b')]=qs['filters'](_[_0xf0d9('0x3c')](_0x359f70[_0xf0d9('0x32')],_0xdd31c4[_0xf0d9('0x33')]));if(_0x359f70['query'][_0xf0d9('0x3d')]){_0x275bec[_0xf0d9('0x3b')]=_['merge'](_0x275bec[_0xf0d9('0x3b')],{'$or':_[_0xf0d9('0x2c')](_0x275bec[_0xf0d9('0x35')],function(_0x1ab6e6){var _0x149e04={};_0x149e04[_0x1ab6e6]={'$like':'%'+_0x359f70[_0xf0d9('0x32')][_0xf0d9('0x3d')]+'%'};return _0x149e04;})});}_0x275bec=_['merge']({},_0x275bec,_0x359f70[_0xf0d9('0x40')]);return _0x41f3d9[_0xf0d9('0x82')](_0x275bec);}})[_0xf0d9('0x22')](function(_0x4c91ca){if(_0x4c91ca){_0x164c80=_0x4c91ca[_0xf0d9('0x37')];if(!_0x359f70[_0xf0d9('0x32')]['hasOwnProperty']('nolimit')){_0x275bec[_0xf0d9('0x1b')]=qs[_0xf0d9('0x1b')](_0x359f70[_0xf0d9('0x32')][_0xf0d9('0x1b')]);_0x275bec[_0xf0d9('0x1a')]=qs[_0xf0d9('0x1a')](_0x359f70[_0xf0d9('0x32')][_0xf0d9('0x1a')]);}return _0x41f3d9[_0xf0d9('0x82')](_0x275bec);}})[_0xf0d9('0x22')](function(_0x3e80cf){if(_0x3e80cf){return _0x3e80cf?{'count':_0x164c80,'rows':_0x3e80cf}:null;}})[_0xf0d9('0x22')](respondWithResult(_0x3e0c41,null))[_0xf0d9('0x46')](handleError(_0x3e0c41,null));};exports['addBlackLists']=function(_0x220dd7,_0x4b0c4a,_0x24d111){var _0x174b1a,_0x56fe38;return db[_0xf0d9('0x41')][_0xf0d9('0x54')]({'where':{'id':_0x220dd7[_0xf0d9('0x48')]['id']}})[_0xf0d9('0x22')](handleEntityNotFound(_0x4b0c4a,null))['then'](function(_0x1aafa5){if(_0x1aafa5){_0x56fe38=_0x1aafa5;return _0x1aafa5['addBlackLists'](_0x220dd7['body'][_0xf0d9('0x65')],_[_0xf0d9('0x55')](_0x220dd7[_0xf0d9('0x4b')],[_0xf0d9('0x65'),'id'])||{});}return null;})['spread'](function(_0x5190f7){var _0x499f23;_0x174b1a=_0x5190f7||[];var _0x45015e=[];if(_0x5190f7){for(var _0x1a5c0c=0x0;_0x1a5c0c<_0x5190f7[_0xf0d9('0x37')];_0x1a5c0c+=0x1){var _0x774168=_0x5190f7[_0x1a5c0c][_0xf0d9('0x24')]({'plain':!![]});_0x499f23=squel[_0xf0d9('0x68')]()[_0xf0d9('0x7c')]('cm_hopper_black')['fromQuery']([_0xf0d9('0x6a'),_0xf0d9('0x6c'),'ListId','CampaignId',_0xf0d9('0x56'),_0xf0d9('0x57')],squel[_0xf0d9('0x76')]()[_0xf0d9('0x6e')]('phone',_0xf0d9('0x6a'))[_0xf0d9('0x6e')]('id',_0xf0d9('0x6c'))[_0xf0d9('0x6e')](_0x774168[_0xf0d9('0x6f')][_0xf0d9('0x70')](),'ListId')[_0xf0d9('0x6e')](_0x220dd7[_0xf0d9('0x48')]['id'][_0xf0d9('0x70')](),_0xf0d9('0x59'))[_0xf0d9('0x6e')](_0xf0d9('0x71'),_0xf0d9('0x56'))[_0xf0d9('0x6e')]('NOW()',_0xf0d9('0x57'))[_0xf0d9('0x79')](_0xf0d9('0x72'))['where'](_0xf0d9('0x7d'))['where'](_0xf0d9('0x73'),_0x774168['CmListId'][_0xf0d9('0x70')]())[_0xf0d9('0x3b')](_0xf0d9('0x74')))[_0xf0d9('0x70')]();_0x45015e['push'](db[_0xf0d9('0x7f')][_0xf0d9('0x32')](_0x499f23));}return BPromise[_0xf0d9('0x80')](_0x45015e);}})[_0xf0d9('0x22')](function(){return _0x174b1a;})['then'](respondWithResult(_0x4b0c4a,null))[_0xf0d9('0x46')](handleError(_0x4b0c4a,null));};exports['removeBlackLists']=function(_0x2d70fe,_0x1e8f1f,_0x47dbce){return db[_0xf0d9('0x41')][_0xf0d9('0x54')]({'where':{'id':_0x2d70fe[_0xf0d9('0x48')]['id']}})[_0xf0d9('0x22')](handleEntityNotFound(_0x1e8f1f,null))['then'](function(_0x3b32ff){if(_0x3b32ff){return _0x3b32ff[_0xf0d9('0x83')](_0x2d70fe[_0xf0d9('0x32')][_0xf0d9('0x65')]);}})[_0xf0d9('0x22')](function(_0x88de89){if(_0x88de89){return db[_0xf0d9('0x61')]['destroy']({'where':{'ListId':_0x2d70fe[_0xf0d9('0x32')][_0xf0d9('0x65')],'CampaignId':_0x2d70fe[_0xf0d9('0x48')]['id']}})[_0xf0d9('0x22')](function(){return _0x88de89;});}})[_0xf0d9('0x22')](respondWithStatusCode(_0x1e8f1f,null))['catch'](handleError(_0x1e8f1f,null));}; \ No newline at end of file +var _0x45aa=['error','stack','name','send','index','Campaign','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','length','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','merge','omit','createdAt','body','updatedAt','getHoppers','findOne','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CampaignId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','ContactId','select','phone','field','NOW()','CmListId','toString','ListId','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','CampaignId\x20=\x20?','onlyIfOpen','fromQuery','scheduledAt','deletedAt\x20IS\x20NULL','push','all','removeLists','getBlackLists','CmList','addBlackLists','sequelize','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','apply','save','update','then','destroy','get','IvrCampaigns','end'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x45aa,0xe9));var _0xa45a=function(_0x465845,_0x15007c){_0x465845=_0x465845-0x0;var _0x314825=_0x45aa[_0x465845];return _0x314825;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa45a('0x0'));var zipdir=require(_0xa45a('0x1'));var jsonpatch=require(_0xa45a('0x2'));var rp=require(_0xa45a('0x3'));var moment=require('moment');var BPromise=require(_0xa45a('0x4'));var Mustache=require(_0xa45a('0x5'));var util=require(_0xa45a('0x6'));var path=require(_0xa45a('0x7'));var sox=require('sox');var csv=require(_0xa45a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa45a('0x9'));var squel=require(_0xa45a('0xa'));var crypto=require(_0xa45a('0xb'));var jsforce=require(_0xa45a('0xc'));var deskjs=require(_0xa45a('0xd'));var toCsv=require(_0xa45a('0x8'));var querystring=require(_0xa45a('0xe'));var Papa=require(_0xa45a('0xf'));var Redis=require(_0xa45a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa45a('0x11'));var as=require(_0xa45a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa45a('0x13'))('api');var utils=require(_0xa45a('0x14'));var config=require(_0xa45a('0x15'));var licenseUtil=require(_0xa45a('0x16'));var db=require(_0xa45a('0x17'))['db'];function respondWithStatusCode(_0x42002,_0x232720){_0x232720=_0x232720||0xcc;return function(_0x19d248){if(_0x19d248){return _0x42002[_0xa45a('0x18')](_0x232720);}return _0x42002['status'](_0x232720)['end']();};}function respondWithResult(_0x290de6,_0xe5876b){_0xe5876b=_0xe5876b||0xc8;return function(_0x2e431f){if(_0x2e431f){return _0x290de6[_0xa45a('0x19')](_0xe5876b)[_0xa45a('0x1a')](_0x2e431f);}};}function respondWithFilteredResult(_0x116987,_0x32c9d4){return function(_0x513451){if(_0x513451){var _0x5e749d=typeof _0x32c9d4[_0xa45a('0x1b')]===_0xa45a('0x1c')&&typeof _0x32c9d4['limit']===_0xa45a('0x1c');var _0x5da5fc=_0x513451[_0xa45a('0x1d')];var _0x412aa6=_0x5e749d?0x0:_0x32c9d4[_0xa45a('0x1b')];var _0x6b447=_0x5e749d?_0x513451['count']:_0x32c9d4['offset']+_0x32c9d4[_0xa45a('0x1e')];var _0x1cd1fc;if(_0x6b447>=_0x5da5fc){_0x6b447=_0x5da5fc;_0x1cd1fc=0xc8;}else{_0x1cd1fc=0xce;}_0x116987['status'](_0x1cd1fc);return _0x116987['set']('Content-Range',_0x412aa6+'-'+_0x6b447+'/'+_0x5da5fc)[_0xa45a('0x1a')](_0x513451);}return null;};}function patchUpdates(_0x66426f){return function(_0x3edcff){try{jsonpatch[_0xa45a('0x1f')](_0x3edcff,_0x66426f,!![]);}catch(_0x39a4ed){return BPromise['reject'](_0x39a4ed);}return _0x3edcff[_0xa45a('0x20')]();};}function saveUpdates(_0x41b15f,_0x4cfa7e){return function(_0x44553e){if(_0x44553e){return _0x44553e[_0xa45a('0x21')](_0x41b15f)[_0xa45a('0x22')](function(_0x2c5ac4){return _0x2c5ac4;});}return null;};}function removeEntity(_0x3c51c0,_0x5429de){return function(_0x423c69){if(_0x423c69){return _0x423c69[_0xa45a('0x23')]()[_0xa45a('0x22')](function(){var _0x595250=_0x423c69[_0xa45a('0x24')]({'plain':!![]});var _0x8f29c6=_0xa45a('0x25');return db['UserProfileResource'][_0xa45a('0x23')]({'where':{'type':_0x8f29c6,'resourceId':_0x595250['id']}})['then'](function(){return _0x423c69;});})[_0xa45a('0x22')](function(){_0x3c51c0[_0xa45a('0x19')](0xcc)[_0xa45a('0x26')]();});}};}function handleEntityNotFound(_0x15f9b9,_0x16dbe){return function(_0x2d4481){if(!_0x2d4481){_0x15f9b9[_0xa45a('0x18')](0x194);}return _0x2d4481;};}function handleError(_0xffdd66,_0x1f81f1){_0x1f81f1=_0x1f81f1||0x1f4;return function(_0x257d48){logger[_0xa45a('0x27')](_0x257d48[_0xa45a('0x28')]);if(_0x257d48[_0xa45a('0x29')]){delete _0x257d48[_0xa45a('0x29')];}_0xffdd66['status'](_0x1f81f1)[_0xa45a('0x2a')](_0x257d48);};}exports[_0xa45a('0x2b')]=function(_0x1a45a1,_0x48fde2){var _0x3c0dd6={},_0x5d0cfc={},_0x557f20={'count':0x0,'rows':[]};var _0x2e0b5e=_['map'](db[_0xa45a('0x2c')][_0xa45a('0x2d')],function(_0x4cbb64){return{'name':_0x4cbb64['fieldName'],'type':_0x4cbb64[_0xa45a('0x2e')][_0xa45a('0x2f')]};});_0x5d0cfc[_0xa45a('0x30')]=_[_0xa45a('0x31')](_0x2e0b5e,'name');_0x5d0cfc[_0xa45a('0x32')]=_[_0xa45a('0x33')](_0x1a45a1['query']);_0x5d0cfc[_0xa45a('0x34')]=_[_0xa45a('0x35')](_0x5d0cfc[_0xa45a('0x30')],_0x5d0cfc[_0xa45a('0x32')]);_0x3c0dd6[_0xa45a('0x36')]=_[_0xa45a('0x35')](_0x5d0cfc[_0xa45a('0x30')],qs[_0xa45a('0x37')](_0x1a45a1[_0xa45a('0x32')]['fields']));_0x3c0dd6[_0xa45a('0x36')]=_0x3c0dd6[_0xa45a('0x36')]['length']?_0x3c0dd6[_0xa45a('0x36')]:_0x5d0cfc['model'];if(!_0x1a45a1[_0xa45a('0x32')][_0xa45a('0x38')](_0xa45a('0x39'))){_0x3c0dd6[_0xa45a('0x1e')]=qs['limit'](_0x1a45a1['query'][_0xa45a('0x1e')]);_0x3c0dd6[_0xa45a('0x1b')]=qs[_0xa45a('0x1b')](_0x1a45a1[_0xa45a('0x32')][_0xa45a('0x1b')]);}_0x3c0dd6[_0xa45a('0x3a')]=qs[_0xa45a('0x3b')](_0x1a45a1['query'][_0xa45a('0x3b')]);_0x3c0dd6[_0xa45a('0x3c')]=qs['filters'](_[_0xa45a('0x3d')](_0x1a45a1[_0xa45a('0x32')],_0x5d0cfc['filters']),_0x2e0b5e);if(_0x1a45a1['query'][_0xa45a('0x3e')]){_0x3c0dd6[_0xa45a('0x3c')]=_['merge'](_0x3c0dd6['where'],{'$or':_[_0xa45a('0x31')](_0x2e0b5e,function(_0x5f454c){if(_0x5f454c[_0xa45a('0x2e')]!==_0xa45a('0x3f')){var _0x3327dc={};_0x3327dc[_0x5f454c[_0xa45a('0x29')]]={'$like':'%'+_0x1a45a1['query'][_0xa45a('0x3e')]+'%'};return _0x3327dc;}})});}_0x3c0dd6=_['merge']({},_0x3c0dd6,_0x1a45a1[_0xa45a('0x40')]);var _0x25c76d={'where':_0x3c0dd6[_0xa45a('0x3c')]};return db[_0xa45a('0x2c')][_0xa45a('0x1d')](_0x25c76d)[_0xa45a('0x22')](function(_0x32915b){_0x557f20[_0xa45a('0x1d')]=_0x32915b;if(_0x1a45a1[_0xa45a('0x32')][_0xa45a('0x41')]){_0x3c0dd6[_0xa45a('0x42')]=[{'all':!![]}];}return db[_0xa45a('0x2c')][_0xa45a('0x43')](_0x3c0dd6);})['then'](function(_0x5781ff){_0x557f20[_0xa45a('0x44')]=_0x5781ff;return _0x557f20;})['then'](respondWithFilteredResult(_0x48fde2,_0x3c0dd6))['catch'](handleError(_0x48fde2,null));};exports[_0xa45a('0x45')]=function(_0x5ae930,_0x3c54a4){var _0x181701={'raw':![],'where':{'id':_0x5ae930['params']['id']}},_0x31d89a={};_0x31d89a[_0xa45a('0x30')]=_[_0xa45a('0x33')](db[_0xa45a('0x2c')][_0xa45a('0x2d')]);_0x31d89a['query']=_[_0xa45a('0x33')](_0x5ae930[_0xa45a('0x32')]);_0x31d89a[_0xa45a('0x34')]=_['intersection'](_0x31d89a[_0xa45a('0x30')],_0x31d89a['query']);_0x181701[_0xa45a('0x36')]=_[_0xa45a('0x35')](_0x31d89a[_0xa45a('0x30')],qs[_0xa45a('0x37')](_0x5ae930[_0xa45a('0x32')]['fields']));_0x181701[_0xa45a('0x36')]=_0x181701[_0xa45a('0x36')][_0xa45a('0x46')]?_0x181701[_0xa45a('0x36')]:_0x31d89a[_0xa45a('0x30')];if(_0x5ae930[_0xa45a('0x32')][_0xa45a('0x41')]){_0x181701[_0xa45a('0x42')]=[{'all':!![]}];}_0x181701=_['merge']({},_0x181701,_0x5ae930[_0xa45a('0x40')]);return db['Campaign'][_0xa45a('0x47')](_0x181701)[_0xa45a('0x22')](handleEntityNotFound(_0x3c54a4,null))[_0xa45a('0x22')](respondWithResult(_0x3c54a4,null))[_0xa45a('0x48')](handleError(_0x3c54a4,null));};exports[_0xa45a('0x49')]=function(_0x550fda,_0x25202e){return db[_0xa45a('0x2c')]['create'](_0x550fda['body'],{})[_0xa45a('0x22')](function(_0x26bf36){var _0x4fdc57=_0x550fda['user']['get']({'plain':!![]});if(!_0x4fdc57)throw new Error(_0xa45a('0x4a'));if(_0x4fdc57[_0xa45a('0x4b')]===_0xa45a('0x4c')){var _0x35af15=_0x26bf36[_0xa45a('0x24')]({'plain':!![]});var _0x46551e=_0xa45a('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x46551e,'userProfileId':_0x4fdc57[_0xa45a('0x4d')]},'raw':!![]})['then'](function(_0x5e3bad){if(_0x5e3bad&&_0x5e3bad[_0xa45a('0x4e')]===0x0){return db[_0xa45a('0x4f')][_0xa45a('0x49')]({'name':_0x35af15['name'],'resourceId':_0x35af15['id'],'type':_0x5e3bad[_0xa45a('0x29')],'sectionId':_0x5e3bad['id']},{})[_0xa45a('0x22')](function(){return _0x26bf36;});}else{return _0x26bf36;}})['catch'](function(_0x37e1cf){logger[_0xa45a('0x27')](_0xa45a('0x50'),_0x37e1cf);throw _0x37e1cf;});}return _0x26bf36;})['then'](respondWithResult(_0x25202e,0xc9))[_0xa45a('0x48')](handleError(_0x25202e,null));};exports[_0xa45a('0x51')]=function(_0x5b2a17,_0x2aa8bc){var _0x45da4c={'where':{'id':_0x5b2a17[_0xa45a('0x52')]['id']}},_0x3496c9={};_0x3496c9[_0xa45a('0x30')]=_['keys'](db[_0xa45a('0x2c')][_0xa45a('0x2d')]);_0x45da4c['attributes']=_['intersection'](_0x3496c9[_0xa45a('0x30')],qs[_0xa45a('0x37')](_0x5b2a17['query']['fields']));_0x45da4c[_0xa45a('0x36')]=_0x45da4c[_0xa45a('0x36')]['length']?_0x45da4c[_0xa45a('0x36')]:_0x3496c9[_0xa45a('0x30')];if(_0x5b2a17[_0xa45a('0x32')][_0xa45a('0x41')]){_0x45da4c['include']=[{'all':!![]}];}_0x45da4c=_[_0xa45a('0x53')]({},_0x45da4c,_0x5b2a17[_0xa45a('0x40')]);return db[_0xa45a('0x2c')][_0xa45a('0x47')](_0x45da4c)['then'](handleEntityNotFound(_0x2aa8bc,null))['then'](function(_0x5cc503){if(_0x5cc503){var _0x3b72de=_0x5cc503['get']({'plain':!![]});_0x3b72de=qs[_0xa45a('0x54')](_0x3b72de,['id',_0xa45a('0x55'),'updatedAt']);_0x5b2a17[_0xa45a('0x56')]=_[_0xa45a('0x54')](_0x5b2a17[_0xa45a('0x56')],['id','createdAt',_0xa45a('0x57')]);return db['Campaign'][_0xa45a('0x49')](_[_0xa45a('0x53')](_0x3b72de,_0x5b2a17[_0xa45a('0x56')]),{'include':_0x5b2a17[_0xa45a('0x32')][_0xa45a('0x41')]?[{'all':!![]}]:undefined})[_0xa45a('0x22')](function(_0xe37e28){var _0xb275a7=_0x5b2a17[_0xa45a('0x4c')][_0xa45a('0x24')]({'plain':!![]});if(!_0xb275a7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb275a7[_0xa45a('0x4b')]===_0xa45a('0x4c')){var _0x565fe3=_0xe37e28['get']({'plain':!![]});var _0x438a08=_0xa45a('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x438a08,'userProfileId':_0xb275a7[_0xa45a('0x4d')]},'raw':!![]})[_0xa45a('0x22')](function(_0x5a30eb){if(_0x5a30eb&&_0x5a30eb['autoAssociation']===0x0){return db['UserProfileResource'][_0xa45a('0x49')]({'name':_0x565fe3[_0xa45a('0x29')],'resourceId':_0x565fe3['id'],'type':_0x5a30eb[_0xa45a('0x29')],'sectionId':_0x5a30eb['id']},{})[_0xa45a('0x22')](function(){return _0xe37e28;});}else{return _0xe37e28;}})[_0xa45a('0x48')](function(_0x3bba97){logger[_0xa45a('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3bba97);throw _0x3bba97;});}return _0xe37e28;});}})[_0xa45a('0x22')](respondWithResult(_0x2aa8bc,0xc9))[_0xa45a('0x48')](handleError(_0x2aa8bc,null));};exports[_0xa45a('0x21')]=function(_0x5c16d9,_0x91053){if(_0x5c16d9[_0xa45a('0x56')]['id']){delete _0x5c16d9['body']['id'];}return db[_0xa45a('0x2c')][_0xa45a('0x47')]({'where':{'id':_0x5c16d9[_0xa45a('0x52')]['id']}})[_0xa45a('0x22')](handleEntityNotFound(_0x91053,null))[_0xa45a('0x22')](saveUpdates(_0x5c16d9['body'],null))[_0xa45a('0x22')](respondWithResult(_0x91053,null))[_0xa45a('0x48')](handleError(_0x91053,null));};exports['destroy']=function(_0x4813a3,_0xe3c6d1){return db[_0xa45a('0x2c')][_0xa45a('0x47')]({'where':{'id':_0x4813a3['params']['id']}})[_0xa45a('0x22')](handleEntityNotFound(_0xe3c6d1,null))[_0xa45a('0x22')](removeEntity(_0xe3c6d1,null))['catch'](handleError(_0xe3c6d1,null));};exports[_0xa45a('0x58')]=function(_0xdb29d1,_0x23c1f4,_0x4230dc){var _0x4ec986={'raw':!![],'where':{}};var _0x4b4c15={};var _0x1cba27={'count':0x0,'rows':[]};return db[_0xa45a('0x2c')][_0xa45a('0x59')]({'where':{'id':_0xdb29d1[_0xa45a('0x52')]['id']}})[_0xa45a('0x22')](handleEntityNotFound(_0x23c1f4,null))[_0xa45a('0x22')](function(_0x3e4711){if(_0x3e4711){_0x4b4c15[_0xa45a('0x30')]=_[_0xa45a('0x33')](db[_0xa45a('0x5a')][_0xa45a('0x2d')]);_0x4b4c15['query']=_['keys'](_0xdb29d1['query']);_0x4b4c15[_0xa45a('0x34')]=_[_0xa45a('0x35')](_0x4b4c15[_0xa45a('0x30')],_0x4b4c15[_0xa45a('0x32')]);_0x4ec986['attributes']=_[_0xa45a('0x35')](_0x4b4c15[_0xa45a('0x30')],qs[_0xa45a('0x37')](_0xdb29d1[_0xa45a('0x32')]['fields']));_0x4ec986[_0xa45a('0x36')]=_0x4ec986[_0xa45a('0x36')][_0xa45a('0x46')]?_0x4ec986[_0xa45a('0x36')]:_0x4b4c15[_0xa45a('0x30')];if(!_0xdb29d1[_0xa45a('0x32')]['hasOwnProperty'](_0xa45a('0x39'))){_0x4ec986[_0xa45a('0x1e')]=qs['limit'](_0xdb29d1[_0xa45a('0x32')][_0xa45a('0x1e')]);_0x4ec986[_0xa45a('0x1b')]=qs['offset'](_0xdb29d1['query']['offset']);}_0x4ec986['order']=qs['sort'](_0xdb29d1[_0xa45a('0x32')][_0xa45a('0x3b')]);_0x4ec986[_0xa45a('0x3c')]=qs['filters'](_[_0xa45a('0x3d')](_0xdb29d1[_0xa45a('0x32')],_0x4b4c15[_0xa45a('0x34')]));_0x4ec986['where']['CampaignId']=_0x3e4711['id'];if(_0xdb29d1['query'][_0xa45a('0x3e')]){_0x4ec986[_0xa45a('0x3c')]=_['merge'](_0x4ec986['where'],{'$or':_['map'](_0x4ec986[_0xa45a('0x36')],function(_0xdad22e){var _0x5f38d6={};_0x5f38d6[_0xdad22e]={'$like':'%'+_0xdb29d1[_0xa45a('0x32')][_0xa45a('0x3e')]+'%'};return _0x5f38d6;})});}_0x4ec986=_[_0xa45a('0x53')]({},_0x4ec986,_0xdb29d1[_0xa45a('0x40')]);return db[_0xa45a('0x5a')][_0xa45a('0x1d')]({'where':_0x4ec986[_0xa45a('0x3c')]})[_0xa45a('0x22')](function(_0x14d593){_0x1cba27[_0xa45a('0x1d')]=_0x14d593;if(_0xdb29d1[_0xa45a('0x32')][_0xa45a('0x41')]){_0x4ec986[_0xa45a('0x42')]=[{'all':!![]}];}return db[_0xa45a('0x5a')]['findAll'](_0x4ec986);})[_0xa45a('0x22')](function(_0x3f4891){_0x1cba27[_0xa45a('0x44')]=_0x3f4891;return _0x1cba27;});}})[_0xa45a('0x22')](respondWithFilteredResult(_0x23c1f4,_0x4ec986))[_0xa45a('0x48')](handleError(_0x23c1f4,null));};exports[_0xa45a('0x5b')]=function(_0x2ad1ff,_0x5a8811,_0xa5e058){var _0x442a8f={'raw':!![],'where':{}};var _0x4b62a9={};var _0x4e77d4={'count':0x0,'rows':[]};return db[_0xa45a('0x2c')][_0xa45a('0x59')]({'where':{'id':_0x2ad1ff[_0xa45a('0x52')]['id']}})[_0xa45a('0x22')](handleEntityNotFound(_0x5a8811,null))['then'](function(_0x4789f3){if(_0x4789f3){_0x4b62a9[_0xa45a('0x30')]=_['keys'](db['CmHopperHistory'][_0xa45a('0x2d')]);_0x4b62a9['query']=_[_0xa45a('0x33')](_0x2ad1ff[_0xa45a('0x32')]);_0x4b62a9[_0xa45a('0x34')]=_[_0xa45a('0x35')](_0x4b62a9[_0xa45a('0x30')],_0x4b62a9['query']);_0x442a8f[_0xa45a('0x36')]=_[_0xa45a('0x35')](_0x4b62a9[_0xa45a('0x30')],qs[_0xa45a('0x37')](_0x2ad1ff[_0xa45a('0x32')][_0xa45a('0x37')]));_0x442a8f[_0xa45a('0x36')]=_0x442a8f[_0xa45a('0x36')][_0xa45a('0x46')]?_0x442a8f['attributes']:_0x4b62a9[_0xa45a('0x30')];if(!_0x2ad1ff[_0xa45a('0x32')]['hasOwnProperty'](_0xa45a('0x39'))){_0x442a8f['limit']=qs[_0xa45a('0x1e')](_0x2ad1ff[_0xa45a('0x32')]['limit']);_0x442a8f[_0xa45a('0x1b')]=qs['offset'](_0x2ad1ff['query'][_0xa45a('0x1b')]);}_0x442a8f[_0xa45a('0x3a')]=qs[_0xa45a('0x3b')](_0x2ad1ff[_0xa45a('0x32')][_0xa45a('0x3b')]);_0x442a8f[_0xa45a('0x3c')]=qs[_0xa45a('0x34')](_[_0xa45a('0x3d')](_0x2ad1ff[_0xa45a('0x32')],_0x4b62a9['filters']));_0x442a8f[_0xa45a('0x3c')]['CampaignId']=_0x4789f3['id'];if(_0x2ad1ff['query'][_0xa45a('0x3e')]){_0x442a8f[_0xa45a('0x3c')]=_[_0xa45a('0x53')](_0x442a8f[_0xa45a('0x3c')],{'$or':_[_0xa45a('0x31')](_0x442a8f[_0xa45a('0x36')],function(_0x56e6a6){var _0x477509={};_0x477509[_0x56e6a6]={'$like':'%'+_0x2ad1ff[_0xa45a('0x32')][_0xa45a('0x3e')]+'%'};return _0x477509;})});}_0x442a8f=_[_0xa45a('0x53')]({},_0x442a8f,_0x2ad1ff[_0xa45a('0x40')]);return db['CmHopperHistory'][_0xa45a('0x1d')]({'where':_0x442a8f[_0xa45a('0x3c')]})[_0xa45a('0x22')](function(_0x513880){_0x4e77d4[_0xa45a('0x1d')]=_0x513880;if(_0x2ad1ff[_0xa45a('0x32')][_0xa45a('0x41')]){_0x442a8f['include']=[{'all':!![]}];}return db[_0xa45a('0x5c')]['findAll'](_0x442a8f);})[_0xa45a('0x22')](function(_0x1da85b){_0x4e77d4[_0xa45a('0x44')]=_0x1da85b;return _0x4e77d4;});}})['then'](respondWithFilteredResult(_0x5a8811,_0x442a8f))[_0xa45a('0x48')](handleError(_0x5a8811,null));};exports[_0xa45a('0x5d')]=function(_0x4708ed,_0x51fbd2,_0x4bea9e){var _0x15643f={'raw':!![],'where':{}};var _0x729d1f={};var _0x1ae91d={'count':0x0,'rows':[]};return db[_0xa45a('0x2c')]['findOne']({'where':{'id':_0x4708ed[_0xa45a('0x52')]['id']}})[_0xa45a('0x22')](handleEntityNotFound(_0x51fbd2,null))[_0xa45a('0x22')](function(_0x5ab15b){if(_0x5ab15b){_0x729d1f[_0xa45a('0x30')]=_[_0xa45a('0x33')](db['CmHopperFinal'][_0xa45a('0x2d')]);_0x729d1f[_0xa45a('0x32')]=_['keys'](_0x4708ed[_0xa45a('0x32')]);_0x729d1f[_0xa45a('0x34')]=_[_0xa45a('0x35')](_0x729d1f[_0xa45a('0x30')],_0x729d1f[_0xa45a('0x32')]);_0x15643f[_0xa45a('0x36')]=_[_0xa45a('0x35')](_0x729d1f[_0xa45a('0x30')],qs[_0xa45a('0x37')](_0x4708ed['query'][_0xa45a('0x37')]));_0x15643f[_0xa45a('0x36')]=_0x15643f[_0xa45a('0x36')][_0xa45a('0x46')]?_0x15643f['attributes']:_0x729d1f['model'];if(!_0x4708ed[_0xa45a('0x32')][_0xa45a('0x38')](_0xa45a('0x39'))){_0x15643f['limit']=qs['limit'](_0x4708ed[_0xa45a('0x32')]['limit']);_0x15643f[_0xa45a('0x1b')]=qs[_0xa45a('0x1b')](_0x4708ed[_0xa45a('0x32')][_0xa45a('0x1b')]);}_0x15643f[_0xa45a('0x3a')]=qs[_0xa45a('0x3b')](_0x4708ed['query'][_0xa45a('0x3b')]);_0x15643f[_0xa45a('0x3c')]=qs['filters'](_['pick'](_0x4708ed[_0xa45a('0x32')],_0x729d1f[_0xa45a('0x34')]));_0x15643f[_0xa45a('0x3c')][_0xa45a('0x5e')]=_0x5ab15b['id'];if(_0x4708ed['query'][_0xa45a('0x3e')]){_0x15643f[_0xa45a('0x3c')]=_[_0xa45a('0x53')](_0x15643f['where'],{'$or':_[_0xa45a('0x31')](_0x15643f[_0xa45a('0x36')],function(_0x280c72){var _0x572f26={};_0x572f26[_0x280c72]={'$like':'%'+_0x4708ed[_0xa45a('0x32')]['filter']+'%'};return _0x572f26;})});}_0x15643f=_['merge']({},_0x15643f,_0x4708ed[_0xa45a('0x40')]);return db['CmHopperFinal'][_0xa45a('0x1d')]({'where':_0x15643f[_0xa45a('0x3c')]})[_0xa45a('0x22')](function(_0x2ef87d){_0x1ae91d[_0xa45a('0x1d')]=_0x2ef87d;if(_0x4708ed[_0xa45a('0x32')]['includeAll']){_0x15643f[_0xa45a('0x42')]=[{'all':!![]}];}return db[_0xa45a('0x5f')][_0xa45a('0x43')](_0x15643f);})[_0xa45a('0x22')](function(_0x7af864){_0x1ae91d['rows']=_0x7af864;return _0x1ae91d;});}})[_0xa45a('0x22')](respondWithFilteredResult(_0x51fbd2,_0x15643f))[_0xa45a('0x48')](handleError(_0x51fbd2,null));};exports[_0xa45a('0x60')]=function(_0x4e02b0,_0x34bd05,_0x379da2){var _0x37ff94={'raw':!![],'where':{}};var _0x230534={};var _0x401257={'count':0x0,'rows':[]};return db[_0xa45a('0x2c')][_0xa45a('0x59')]({'where':{'id':_0x4e02b0[_0xa45a('0x52')]['id']}})[_0xa45a('0x22')](handleEntityNotFound(_0x34bd05,null))[_0xa45a('0x22')](function(_0x392bc6){if(_0x392bc6){_0x230534[_0xa45a('0x30')]=_[_0xa45a('0x33')](db[_0xa45a('0x61')][_0xa45a('0x2d')]);_0x230534[_0xa45a('0x32')]=_['keys'](_0x4e02b0['query']);_0x230534[_0xa45a('0x34')]=_['intersection'](_0x230534['model'],_0x230534[_0xa45a('0x32')]);_0x37ff94[_0xa45a('0x36')]=_[_0xa45a('0x35')](_0x230534[_0xa45a('0x30')],qs['fields'](_0x4e02b0['query'][_0xa45a('0x37')]));_0x37ff94[_0xa45a('0x36')]=_0x37ff94['attributes'][_0xa45a('0x46')]?_0x37ff94[_0xa45a('0x36')]:_0x230534[_0xa45a('0x30')];if(!_0x4e02b0[_0xa45a('0x32')][_0xa45a('0x38')]('nolimit')){_0x37ff94[_0xa45a('0x1e')]=qs['limit'](_0x4e02b0[_0xa45a('0x32')][_0xa45a('0x1e')]);_0x37ff94['offset']=qs['offset'](_0x4e02b0[_0xa45a('0x32')][_0xa45a('0x1b')]);}_0x37ff94[_0xa45a('0x3a')]=qs[_0xa45a('0x3b')](_0x4e02b0[_0xa45a('0x32')][_0xa45a('0x3b')]);_0x37ff94[_0xa45a('0x3c')]=qs[_0xa45a('0x34')](_[_0xa45a('0x3d')](_0x4e02b0[_0xa45a('0x32')],_0x230534['filters']));_0x37ff94[_0xa45a('0x3c')][_0xa45a('0x5e')]=_0x392bc6['id'];if(_0x4e02b0[_0xa45a('0x32')][_0xa45a('0x3e')]){_0x37ff94[_0xa45a('0x3c')]=_['merge'](_0x37ff94[_0xa45a('0x3c')],{'$or':_[_0xa45a('0x31')](_0x37ff94['attributes'],function(_0x88f3a1){var _0x125ff7={};_0x125ff7[_0x88f3a1]={'$like':'%'+_0x4e02b0[_0xa45a('0x32')]['filter']+'%'};return _0x125ff7;})});}_0x37ff94=_[_0xa45a('0x53')]({},_0x37ff94,_0x4e02b0[_0xa45a('0x40')]);return db[_0xa45a('0x61')]['count']({'where':_0x37ff94['where']})[_0xa45a('0x22')](function(_0x17d2cf){_0x401257[_0xa45a('0x1d')]=_0x17d2cf;if(_0x4e02b0['query']['includeAll']){_0x37ff94[_0xa45a('0x42')]=[{'all':!![]}];}return db[_0xa45a('0x61')]['findAll'](_0x37ff94);})[_0xa45a('0x22')](function(_0x478e91){_0x401257[_0xa45a('0x44')]=_0x478e91;return _0x401257;});}})[_0xa45a('0x22')](respondWithFilteredResult(_0x34bd05,_0x37ff94))[_0xa45a('0x48')](handleError(_0x34bd05,null));};exports['getLists']=function(_0x31fa14,_0xd60d88,_0x4a2685){var _0x1ab6dc={};var _0x50d563={};var _0x97a253;var _0x52c60e;return db[_0xa45a('0x2c')][_0xa45a('0x59')]({'where':{'id':_0x31fa14[_0xa45a('0x52')]['id']}})[_0xa45a('0x22')](handleEntityNotFound(_0xd60d88,null))[_0xa45a('0x22')](function(_0xf72cf){if(_0xf72cf){_0x97a253=_0xf72cf;_0x50d563[_0xa45a('0x30')]=_[_0xa45a('0x33')](db['CmList'][_0xa45a('0x2d')]);_0x50d563[_0xa45a('0x32')]=_[_0xa45a('0x33')](_0x31fa14[_0xa45a('0x32')]);_0x50d563['filters']=_[_0xa45a('0x35')](_0x50d563[_0xa45a('0x30')],_0x50d563[_0xa45a('0x32')]);_0x1ab6dc[_0xa45a('0x36')]=_[_0xa45a('0x35')](_0x50d563[_0xa45a('0x30')],qs[_0xa45a('0x37')](_0x31fa14[_0xa45a('0x32')][_0xa45a('0x37')]));_0x1ab6dc[_0xa45a('0x36')]=_0x1ab6dc[_0xa45a('0x36')][_0xa45a('0x46')]?_0x1ab6dc[_0xa45a('0x36')]:_0x50d563[_0xa45a('0x30')];_0x1ab6dc[_0xa45a('0x3a')]=qs[_0xa45a('0x3b')](_0x31fa14[_0xa45a('0x32')][_0xa45a('0x3b')]);_0x1ab6dc[_0xa45a('0x3c')]=qs['filters'](_[_0xa45a('0x3d')](_0x31fa14[_0xa45a('0x32')],_0x50d563[_0xa45a('0x34')]));if(_0x31fa14['query'][_0xa45a('0x3e')]){_0x1ab6dc['where']=_[_0xa45a('0x53')](_0x1ab6dc[_0xa45a('0x3c')],{'$or':_[_0xa45a('0x31')](_0x1ab6dc[_0xa45a('0x36')],function(_0x326c71){var _0x42bd5d={};_0x42bd5d[_0x326c71]={'$like':'%'+_0x31fa14[_0xa45a('0x32')][_0xa45a('0x3e')]+'%'};return _0x42bd5d;})});}_0x1ab6dc=_[_0xa45a('0x53')]({},_0x1ab6dc,_0x31fa14[_0xa45a('0x40')]);return _0x97a253[_0xa45a('0x62')](_0x1ab6dc);}})[_0xa45a('0x22')](function(_0x57b07b){if(_0x57b07b){_0x52c60e=_0x57b07b[_0xa45a('0x46')];if(!_0x31fa14[_0xa45a('0x32')]['hasOwnProperty']('nolimit')){_0x1ab6dc[_0xa45a('0x1e')]=qs[_0xa45a('0x1e')](_0x31fa14['query'][_0xa45a('0x1e')]);_0x1ab6dc['offset']=qs[_0xa45a('0x1b')](_0x31fa14[_0xa45a('0x32')]['offset']);}return _0x97a253[_0xa45a('0x62')](_0x1ab6dc);}})[_0xa45a('0x22')](function(_0x50ebbe){if(_0x50ebbe){return _0x50ebbe?{'count':_0x52c60e,'rows':_0x50ebbe}:null;}})['then'](respondWithResult(_0xd60d88,null))[_0xa45a('0x48')](handleError(_0xd60d88,null));};exports[_0xa45a('0x63')]=function(_0x59ce4a,_0x3a36a6,_0x2fae4b){var _0x23bdfe,_0x171187;return db[_0xa45a('0x2c')][_0xa45a('0x47')]({'where':{'id':_0x59ce4a[_0xa45a('0x52')]['id']}})[_0xa45a('0x22')](handleEntityNotFound(_0x3a36a6,null))['then'](function(_0x2ab766){if(_0x2ab766){_0x171187=_0x2ab766;return _0x2ab766[_0xa45a('0x63')](_0x59ce4a[_0xa45a('0x56')][_0xa45a('0x64')],_['omit'](_0x59ce4a[_0xa45a('0x56')],['ids','id'])||{});}return null;})[_0xa45a('0x65')](function(_0x2ea005){var _0x50ad52;_0x23bdfe=_0x2ea005||[];var _0x12c1d5=[];if(_0x2ea005){for(var _0x4d9238=0x0;_0x4d9238<_0x2ea005[_0xa45a('0x46')];_0x4d9238+=0x1){var _0x1bb8e0=_0x2ea005[_0x4d9238][_0xa45a('0x24')]({'plain':!![]});_0x171187[_0xa45a('0x66')]=_0x59ce4a[_0xa45a('0x56')]['dialCheckDuplicateType']?_0x59ce4a[_0xa45a('0x56')][_0xa45a('0x66')]:_0x171187[_0xa45a('0x66')];switch(_0x171187[_0xa45a('0x66')]){case _0xa45a('0x67'):_0x50ad52=squel[_0xa45a('0x68')]()[_0xa45a('0x69')]('cm_hopper')['fromQuery'](['phone','scheduledAt',_0xa45a('0x6a'),'ListId',_0xa45a('0x5e'),_0xa45a('0x55'),_0xa45a('0x57')],squel[_0xa45a('0x6b')]()['field'](_0xa45a('0x6c'),_0xa45a('0x6c'))[_0xa45a('0x6d')](_0xa45a('0x6e'),'scheduledAt')['field']('id',_0xa45a('0x6a'))['field'](_0x1bb8e0[_0xa45a('0x6f')][_0xa45a('0x70')](),_0xa45a('0x71'))[_0xa45a('0x6d')](_0x59ce4a[_0xa45a('0x52')]['id']['toString'](),'CampaignId')[_0xa45a('0x6d')]('NOW()',_0xa45a('0x55'))[_0xa45a('0x6d')](_0xa45a('0x6e'),_0xa45a('0x57'))[_0xa45a('0x72')](_0xa45a('0x73'))[_0xa45a('0x3c')]('deletedAt\x20IS\x20NULL')[_0xa45a('0x3c')](_0xa45a('0x74'),_0x1bb8e0[_0xa45a('0x6f')]['toString']())[_0xa45a('0x3c')](_0xa45a('0x75'))[_0xa45a('0x3c')](_0xa45a('0x76'),squel[_0xa45a('0x6b')]()[_0xa45a('0x6d')](_0xa45a('0x77'))[_0xa45a('0x72')](_0xa45a('0x78'))[_0xa45a('0x3c')]('CampaignId\x20=\x20?',_0x59ce4a[_0xa45a('0x52')]['id'][_0xa45a('0x70')]()))[_0xa45a('0x3c')](_0xa45a('0x76'),squel[_0xa45a('0x6b')]()[_0xa45a('0x6d')](_0xa45a('0x79'))[_0xa45a('0x72')](_0xa45a('0x7a'))[_0xa45a('0x3c')](_0xa45a('0x7b'),_0x59ce4a[_0xa45a('0x52')]['id'][_0xa45a('0x70')]())))[_0xa45a('0x70')]();break;case _0xa45a('0x7c'):_0x50ad52=squel[_0xa45a('0x68')]()[_0xa45a('0x69')]('cm_hopper')[_0xa45a('0x7d')](['phone',_0xa45a('0x7e'),_0xa45a('0x6a'),_0xa45a('0x71'),_0xa45a('0x5e'),_0xa45a('0x55'),_0xa45a('0x57')],squel[_0xa45a('0x6b')]()[_0xa45a('0x6d')](_0xa45a('0x6c'),_0xa45a('0x6c'))['field']('NOW()','scheduledAt')[_0xa45a('0x6d')]('id',_0xa45a('0x6a'))['field'](_0x1bb8e0['CmListId'][_0xa45a('0x70')](),_0xa45a('0x71'))['field'](_0x59ce4a[_0xa45a('0x52')]['id'][_0xa45a('0x70')](),_0xa45a('0x5e'))[_0xa45a('0x6d')](_0xa45a('0x6e'),_0xa45a('0x55'))[_0xa45a('0x6d')](_0xa45a('0x6e'),_0xa45a('0x57'))[_0xa45a('0x72')](_0xa45a('0x73'))[_0xa45a('0x3c')](_0xa45a('0x7f'))[_0xa45a('0x3c')]('ListId\x20=\x20?',_0x1bb8e0[_0xa45a('0x6f')][_0xa45a('0x70')]())[_0xa45a('0x3c')](_0xa45a('0x75'))[_0xa45a('0x3c')](_0xa45a('0x76'),squel[_0xa45a('0x6b')]()[_0xa45a('0x6d')]('COALESCE(phone,\x27\x27)')['from'](_0xa45a('0x7a'))[_0xa45a('0x3c')](_0xa45a('0x7b'),_0x59ce4a[_0xa45a('0x52')]['id'][_0xa45a('0x70')]())))['toString']();break;default:_0x50ad52=squel[_0xa45a('0x68')]()[_0xa45a('0x69')](_0xa45a('0x7a'))[_0xa45a('0x7d')]([_0xa45a('0x6c'),_0xa45a('0x7e'),_0xa45a('0x6a'),_0xa45a('0x71'),_0xa45a('0x5e'),_0xa45a('0x55'),_0xa45a('0x57')],squel[_0xa45a('0x6b')]()[_0xa45a('0x6d')](_0xa45a('0x6c'),_0xa45a('0x6c'))['field']('NOW()',_0xa45a('0x7e'))['field']('id',_0xa45a('0x6a'))[_0xa45a('0x6d')](_0x1bb8e0[_0xa45a('0x6f')][_0xa45a('0x70')](),_0xa45a('0x71'))[_0xa45a('0x6d')](_0x59ce4a[_0xa45a('0x52')]['id'][_0xa45a('0x70')](),'CampaignId')[_0xa45a('0x6d')]('NOW()',_0xa45a('0x55'))['field']('NOW()',_0xa45a('0x57'))[_0xa45a('0x72')]('cm_contacts')[_0xa45a('0x3c')](_0xa45a('0x7f'))['where']('ListId\x20=\x20?',_0x1bb8e0[_0xa45a('0x6f')]['toString']())[_0xa45a('0x3c')]('phone\x20IS\x20NOT\x20NULL'))[_0xa45a('0x70')]();}_0x12c1d5[_0xa45a('0x80')](db['sequelize'][_0xa45a('0x32')](_0x50ad52));}return BPromise[_0xa45a('0x81')](_0x12c1d5);}})[_0xa45a('0x22')](function(){return _0x23bdfe;})[_0xa45a('0x22')](respondWithResult(_0x3a36a6,null))[_0xa45a('0x48')](handleError(_0x3a36a6,null));};exports[_0xa45a('0x82')]=function(_0x4e8dc4,_0x1dd64e,_0x613d7a){return db[_0xa45a('0x2c')]['find']({'where':{'id':_0x4e8dc4[_0xa45a('0x52')]['id']}})[_0xa45a('0x22')](handleEntityNotFound(_0x1dd64e,null))[_0xa45a('0x22')](function(_0x4881dd){if(_0x4881dd){return _0x4881dd[_0xa45a('0x82')](_0x4e8dc4[_0xa45a('0x32')]['ids']);}})['then'](function(_0x22e760){if(_0x22e760){return db['CmHopper'][_0xa45a('0x23')]({'where':{'ListId':_0x4e8dc4[_0xa45a('0x32')][_0xa45a('0x64')],'CampaignId':_0x4e8dc4[_0xa45a('0x52')]['id']}})[_0xa45a('0x22')](function(){return _0x22e760;});}})[_0xa45a('0x22')](respondWithStatusCode(_0x1dd64e,null))[_0xa45a('0x48')](handleError(_0x1dd64e,null));};exports[_0xa45a('0x83')]=function(_0x16768b,_0x489668,_0xf6dba6){var _0x478422={};var _0x36dadb={};var _0xc3ac35;var _0x585f86;return db[_0xa45a('0x2c')][_0xa45a('0x59')]({'where':{'id':_0x16768b[_0xa45a('0x52')]['id']}})[_0xa45a('0x22')](handleEntityNotFound(_0x489668,null))[_0xa45a('0x22')](function(_0x2d76ab){if(_0x2d76ab){_0xc3ac35=_0x2d76ab;_0x36dadb[_0xa45a('0x30')]=_[_0xa45a('0x33')](db[_0xa45a('0x84')]['rawAttributes']);_0x36dadb[_0xa45a('0x32')]=_[_0xa45a('0x33')](_0x16768b['query']);_0x36dadb[_0xa45a('0x34')]=_[_0xa45a('0x35')](_0x36dadb[_0xa45a('0x30')],_0x36dadb[_0xa45a('0x32')]);_0x478422[_0xa45a('0x36')]=_['intersection'](_0x36dadb[_0xa45a('0x30')],qs[_0xa45a('0x37')](_0x16768b[_0xa45a('0x32')]['fields']));_0x478422[_0xa45a('0x36')]=_0x478422['attributes'][_0xa45a('0x46')]?_0x478422['attributes']:_0x36dadb[_0xa45a('0x30')];_0x478422[_0xa45a('0x3a')]=qs[_0xa45a('0x3b')](_0x16768b['query'][_0xa45a('0x3b')]);_0x478422[_0xa45a('0x3c')]=qs[_0xa45a('0x34')](_[_0xa45a('0x3d')](_0x16768b[_0xa45a('0x32')],_0x36dadb[_0xa45a('0x34')]));if(_0x16768b['query'][_0xa45a('0x3e')]){_0x478422[_0xa45a('0x3c')]=_['merge'](_0x478422[_0xa45a('0x3c')],{'$or':_[_0xa45a('0x31')](_0x478422[_0xa45a('0x36')],function(_0x2dda76){var _0x75f439={};_0x75f439[_0x2dda76]={'$like':'%'+_0x16768b[_0xa45a('0x32')][_0xa45a('0x3e')]+'%'};return _0x75f439;})});}_0x478422=_[_0xa45a('0x53')]({},_0x478422,_0x16768b[_0xa45a('0x40')]);return _0xc3ac35[_0xa45a('0x83')](_0x478422);}})[_0xa45a('0x22')](function(_0x20c733){if(_0x20c733){_0x585f86=_0x20c733[_0xa45a('0x46')];if(!_0x16768b['query'][_0xa45a('0x38')](_0xa45a('0x39'))){_0x478422['limit']=qs[_0xa45a('0x1e')](_0x16768b[_0xa45a('0x32')][_0xa45a('0x1e')]);_0x478422[_0xa45a('0x1b')]=qs[_0xa45a('0x1b')](_0x16768b[_0xa45a('0x32')][_0xa45a('0x1b')]);}return _0xc3ac35['getBlackLists'](_0x478422);}})[_0xa45a('0x22')](function(_0x101217){if(_0x101217){return _0x101217?{'count':_0x585f86,'rows':_0x101217}:null;}})[_0xa45a('0x22')](respondWithResult(_0x489668,null))[_0xa45a('0x48')](handleError(_0x489668,null));};exports[_0xa45a('0x85')]=function(_0x3b0b46,_0x5b8f8c,_0x2311d0){var _0x4dbdf9,_0x1d9b55;return db[_0xa45a('0x2c')][_0xa45a('0x47')]({'where':{'id':_0x3b0b46['params']['id']}})['then'](handleEntityNotFound(_0x5b8f8c,null))[_0xa45a('0x22')](function(_0x35331b){if(_0x35331b){_0x1d9b55=_0x35331b;return _0x35331b[_0xa45a('0x85')](_0x3b0b46[_0xa45a('0x56')][_0xa45a('0x64')],_[_0xa45a('0x54')](_0x3b0b46[_0xa45a('0x56')],[_0xa45a('0x64'),'id'])||{});}return null;})[_0xa45a('0x65')](function(_0x4b1fd6){var _0x168ffc;_0x4dbdf9=_0x4b1fd6||[];var _0x452361=[];if(_0x4b1fd6){for(var _0x4aaebe=0x0;_0x4aaebe<_0x4b1fd6['length'];_0x4aaebe+=0x1){var _0x4e6fcf=_0x4b1fd6[_0x4aaebe][_0xa45a('0x24')]({'plain':!![]});_0x168ffc=squel['insert']()[_0xa45a('0x69')]('cm_hopper_black')[_0xa45a('0x7d')]([_0xa45a('0x6c'),_0xa45a('0x6a'),_0xa45a('0x71'),_0xa45a('0x5e'),'createdAt',_0xa45a('0x57')],squel[_0xa45a('0x6b')]()[_0xa45a('0x6d')](_0xa45a('0x6c'),_0xa45a('0x6c'))[_0xa45a('0x6d')]('id',_0xa45a('0x6a'))[_0xa45a('0x6d')](_0x4e6fcf[_0xa45a('0x6f')][_0xa45a('0x70')](),_0xa45a('0x71'))['field'](_0x3b0b46[_0xa45a('0x52')]['id'][_0xa45a('0x70')](),_0xa45a('0x5e'))[_0xa45a('0x6d')](_0xa45a('0x6e'),_0xa45a('0x55'))[_0xa45a('0x6d')](_0xa45a('0x6e'),_0xa45a('0x57'))[_0xa45a('0x72')](_0xa45a('0x73'))['where'](_0xa45a('0x7f'))[_0xa45a('0x3c')](_0xa45a('0x74'),_0x4e6fcf[_0xa45a('0x6f')][_0xa45a('0x70')]())[_0xa45a('0x3c')](_0xa45a('0x75')))['toString']();_0x452361[_0xa45a('0x80')](db[_0xa45a('0x86')][_0xa45a('0x32')](_0x168ffc));}return BPromise[_0xa45a('0x81')](_0x452361);}})[_0xa45a('0x22')](function(){return _0x4dbdf9;})[_0xa45a('0x22')](respondWithResult(_0x5b8f8c,null))[_0xa45a('0x48')](handleError(_0x5b8f8c,null));};exports['removeBlackLists']=function(_0x38b7d0,_0x3a2fb9,_0x46ef82){return db['Campaign'][_0xa45a('0x47')]({'where':{'id':_0x38b7d0['params']['id']}})[_0xa45a('0x22')](handleEntityNotFound(_0x3a2fb9,null))[_0xa45a('0x22')](function(_0x2714ac){if(_0x2714ac){return _0x2714ac[_0xa45a('0x87')](_0x38b7d0['query'][_0xa45a('0x64')]);}})[_0xa45a('0x22')](function(_0x5a531a){if(_0x5a531a){return db['CmHopperBlack'][_0xa45a('0x23')]({'where':{'ListId':_0x38b7d0[_0xa45a('0x32')][_0xa45a('0x64')],'CampaignId':_0x38b7d0[_0xa45a('0x52')]['id']}})[_0xa45a('0x22')](function(){return _0x5a531a;});}})[_0xa45a('0x22')](respondWithStatusCode(_0x3a2fb9,null))[_0xa45a('0x48')](handleError(_0x3a2fb9,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 2f4a352..1f88322 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x189a66,_0x245d35){var _0x44fb31=function(_0x322e69){while(--_0x322e69){_0x189a66['push'](_0x189a66['shift']());}};_0x44fb31(++_0x245d35);}(_0x7a54,0x106));var _0x47a5=function(_0x457819,_0x5636bf){_0x457819=_0x457819-0x0;var _0x3f2fb0=_0x7a54[_0x457819];return _0x3f2fb0;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 48a2c3e..b9ab561 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 _0xb7fc=['include','map','model','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetCampaign','findAll','options','attributes','limit'];(function(_0x2a276d,_0x482b0c){var _0x2914cd=function(_0x452b8b){while(--_0x452b8b){_0x2a276d['push'](_0x2a276d['shift']());}};_0x2914cd(++_0x482b0c);}(_0xb7fc,0x1e3));var _0xcb7f=function(_0x4491d9,_0x5856ec){_0x4491d9=_0x4491d9-0x0;var _0x3e9dba=_0xb7fc[_0x4491d9];return _0x3e9dba;};'use strict';var _=require(_0xcb7f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcb7f('0x1'));var rs=require(_0xcb7f('0x2'));var fs=require('fs');var Redis=require(_0xcb7f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcb7f('0x4'))(_0xcb7f('0x5'));var config=require(_0xcb7f('0x6'));var jayson=require(_0xcb7f('0x7'));var client=jayson[_0xcb7f('0x8')][_0xcb7f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5059ca,_0x226ba8,_0x31de8e){return new BPromise(function(_0x1f8ba3,_0x4dde1f){return client[_0xcb7f('0xa')](_0x5059ca,_0x31de8e)[_0xcb7f('0xb')](function(_0x4d8d72){logger[_0xcb7f('0xc')](_0xcb7f('0xd'),_0x226ba8,'request\x20sent');logger[_0xcb7f('0xe')](_0xcb7f('0xf'),_0x226ba8,_0xcb7f('0x10'),JSON[_0xcb7f('0x11')](_0x4d8d72));if(_0x4d8d72[_0xcb7f('0x12')]){if(_0x4d8d72['error']['code']===0x1f4){logger[_0xcb7f('0x12')](_0xcb7f('0xd'),_0x226ba8,_0x4d8d72[_0xcb7f('0x12')][_0xcb7f('0x13')]);return _0x4dde1f(_0x4d8d72[_0xcb7f('0x12')][_0xcb7f('0x13')]);}logger[_0xcb7f('0x12')](_0xcb7f('0xd'),_0x226ba8,_0x4d8d72[_0xcb7f('0x12')][_0xcb7f('0x13')]);return _0x1f8ba3(_0x4d8d72[_0xcb7f('0x12')][_0xcb7f('0x13')]);}else{logger[_0xcb7f('0xc')](_0xcb7f('0xd'),_0x226ba8,_0xcb7f('0x10'));_0x1f8ba3(_0x4d8d72[_0xcb7f('0x14')][_0xcb7f('0x13')]);}})[_0xcb7f('0x15')](function(_0x2c2799){logger[_0xcb7f('0x12')](_0xcb7f('0xd'),_0x226ba8,_0x2c2799);_0x4dde1f(_0x2c2799);});});}exports[_0xcb7f('0x16')]=function(_0x5d43b6){var _0x2430b3=this;return new Promise(function(_0x1d1d4c,_0x57274b){return db['Campaign'][_0xcb7f('0x17')]({'raw':_0x5d43b6[_0xcb7f('0x18')]?_0x5d43b6[_0xcb7f('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5d43b6['options']?_0x5d43b6[_0xcb7f('0x18')]['where']||null:null,'attributes':_0x5d43b6['options']?_0x5d43b6['options'][_0xcb7f('0x19')]||null:null,'limit':_0x5d43b6[_0xcb7f('0x18')]?_0x5d43b6['options'][_0xcb7f('0x1a')]||null:null,'include':_0x5d43b6[_0xcb7f('0x18')]?_0x5d43b6[_0xcb7f('0x18')][_0xcb7f('0x1b')]?_[_0xcb7f('0x1c')](_0x5d43b6[_0xcb7f('0x18')]['include'],function(_0x588a4b){return{'model':db[_0x588a4b[_0xcb7f('0x1d')]],'as':_0x588a4b['as'],'attributes':_0x588a4b[_0xcb7f('0x19')],'include':_0x588a4b[_0xcb7f('0x1b')]?_[_0xcb7f('0x1c')](_0x588a4b[_0xcb7f('0x1b')],function(_0x2a1a8c){return{'model':db[_0x2a1a8c['model']],'as':_0x2a1a8c['as'],'attributes':_0x2a1a8c[_0xcb7f('0x19')],'include':_0x2a1a8c[_0xcb7f('0x1b')]?_[_0xcb7f('0x1c')](_0x2a1a8c['include'],function(_0x30ecb7){return{'model':db[_0x30ecb7[_0xcb7f('0x1d')]],'as':_0x30ecb7['as'],'attributes':_0x30ecb7[_0xcb7f('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8879a1){logger['info'](_0xcb7f('0x16'),_0x5d43b6);logger['debug'](_0xcb7f('0x16'),_0x5d43b6,JSON[_0xcb7f('0x11')](_0x8879a1));_0x1d1d4c(_0x8879a1);})['catch'](function(_0x597a82){logger['error'](_0xcb7f('0x16'),_0x597a82[_0xcb7f('0x13')],_0x5d43b6);_0x57274b(_0x2430b3['error'](0x1f4,_0x597a82[_0xcb7f('0x13')]));});});}; \ No newline at end of file +var _0x6ddd=['attributes','limit','include','map','model','GetCampaign','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options'];(function(_0x108b66,_0x37db88){var _0x3ed76=function(_0x2a22c5){while(--_0x2a22c5){_0x108b66['push'](_0x108b66['shift']());}};_0x3ed76(++_0x37db88);}(_0x6ddd,0xae));var _0xd6dd=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x6ddd[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd6dd('0x0'));var BPromise=require(_0xd6dd('0x1'));var rs=require(_0xd6dd('0x2'));var fs=require('fs');var Redis=require(_0xd6dd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd6dd('0x4'));var logger=require('../../config/logger')(_0xd6dd('0x5'));var config=require('../../config/environment');var jayson=require(_0xd6dd('0x6'));var client=jayson[_0xd6dd('0x7')][_0xd6dd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x49d412,_0x402dee,_0x1f0c46){return new BPromise(function(_0x12f605,_0x229a81){return client['request'](_0x49d412,_0x1f0c46)[_0xd6dd('0x9')](function(_0x1f5d7a){logger[_0xd6dd('0xa')](_0xd6dd('0xb'),_0x402dee,_0xd6dd('0xc'));logger[_0xd6dd('0xd')](_0xd6dd('0xe'),_0x402dee,_0xd6dd('0xc'),JSON[_0xd6dd('0xf')](_0x1f5d7a));if(_0x1f5d7a[_0xd6dd('0x10')]){if(_0x1f5d7a[_0xd6dd('0x10')][_0xd6dd('0x11')]===0x1f4){logger['error'](_0xd6dd('0xb'),_0x402dee,_0x1f5d7a[_0xd6dd('0x10')][_0xd6dd('0x12')]);return _0x229a81(_0x1f5d7a[_0xd6dd('0x10')][_0xd6dd('0x12')]);}logger[_0xd6dd('0x10')](_0xd6dd('0xb'),_0x402dee,_0x1f5d7a['error'][_0xd6dd('0x12')]);return _0x12f605(_0x1f5d7a[_0xd6dd('0x10')][_0xd6dd('0x12')]);}else{logger[_0xd6dd('0xa')](_0xd6dd('0xb'),_0x402dee,_0xd6dd('0xc'));_0x12f605(_0x1f5d7a[_0xd6dd('0x13')][_0xd6dd('0x12')]);}})[_0xd6dd('0x14')](function(_0xbce865){logger[_0xd6dd('0x10')](_0xd6dd('0xb'),_0x402dee,_0xbce865);_0x229a81(_0xbce865);});});}exports['GetCampaign']=function(_0x254fb9){var _0x365abc=this;return new Promise(function(_0x3941d3,_0xc65e92){return db['Campaign']['findAll']({'raw':_0x254fb9[_0xd6dd('0x15')]?_0x254fb9[_0xd6dd('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x254fb9[_0xd6dd('0x15')]?_0x254fb9[_0xd6dd('0x15')]['where']||null:null,'attributes':_0x254fb9[_0xd6dd('0x15')]?_0x254fb9[_0xd6dd('0x15')][_0xd6dd('0x16')]||null:null,'limit':_0x254fb9['options']?_0x254fb9[_0xd6dd('0x15')][_0xd6dd('0x17')]||null:null,'include':_0x254fb9[_0xd6dd('0x15')]?_0x254fb9['options'][_0xd6dd('0x18')]?_[_0xd6dd('0x19')](_0x254fb9[_0xd6dd('0x15')][_0xd6dd('0x18')],function(_0x23d5bc){return{'model':db[_0x23d5bc[_0xd6dd('0x1a')]],'as':_0x23d5bc['as'],'attributes':_0x23d5bc[_0xd6dd('0x16')],'include':_0x23d5bc['include']?_['map'](_0x23d5bc[_0xd6dd('0x18')],function(_0x48c31a){return{'model':db[_0x48c31a['model']],'as':_0x48c31a['as'],'attributes':_0x48c31a['attributes'],'include':_0x48c31a[_0xd6dd('0x18')]?_['map'](_0x48c31a['include'],function(_0x5b6424){return{'model':db[_0x5b6424[_0xd6dd('0x1a')]],'as':_0x5b6424['as'],'attributes':_0x5b6424[_0xd6dd('0x16')]};}):[]};}):[]};}):[]:[]})[_0xd6dd('0x9')](function(_0x86bab9){logger[_0xd6dd('0xa')](_0xd6dd('0x1b'),_0x254fb9);logger['debug'](_0xd6dd('0x1b'),_0x254fb9,JSON['stringify'](_0x86bab9));_0x3941d3(_0x86bab9);})[_0xd6dd('0x14')](function(_0x1e7b30){logger[_0xd6dd('0x10')](_0xd6dd('0x1b'),_0x1e7b30[_0xd6dd('0x12')],_0x254fb9);_0xc65e92(_0x365abc[_0xd6dd('0x10')](0x1f4,_0x1e7b30[_0xd6dd('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 39109c7..d67d6f6 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 _0xad53=['addLists','addBlackLists','put','/:id','update','delete','destroy','removeLists','removeBlackLists','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','create','post','/:id/clone','clone'];(function(_0x4420d0,_0x58cab7){var _0x1d37a4=function(_0x4a1e46){while(--_0x4a1e46){_0x4420d0['push'](_0x4420d0['shift']());}};_0x1d37a4(++_0x58cab7);}(_0xad53,0x1ea));var _0x3ad5=function(_0x57a59c,_0xcc773){_0x57a59c=_0x57a59c-0x0;var _0x31d37f=_0xad53[_0x57a59c];return _0x31d37f;};'use strict';var multer=require(_0x3ad5('0x0'));var util=require(_0x3ad5('0x1'));var path=require(_0x3ad5('0x2'));var timeout=require(_0x3ad5('0x3'));var express=require(_0x3ad5('0x4'));var router=express[_0x3ad5('0x5')]();var fs_extra=require(_0x3ad5('0x6'));var auth=require(_0x3ad5('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3ad5('0x8'));var controller=require(_0x3ad5('0x9'));router[_0x3ad5('0xa')]('/',auth[_0x3ad5('0xb')](),controller[_0x3ad5('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3ad5('0xd')]);router[_0x3ad5('0xa')](_0x3ad5('0xe'),auth[_0x3ad5('0xb')](),controller[_0x3ad5('0xf')]);router[_0x3ad5('0xa')](_0x3ad5('0x10'),auth[_0x3ad5('0xb')](),controller['getHopperHistories']);router[_0x3ad5('0xa')](_0x3ad5('0x11'),auth[_0x3ad5('0xb')](),controller[_0x3ad5('0x12')]);router['get'](_0x3ad5('0x13'),auth[_0x3ad5('0xb')](),controller[_0x3ad5('0x14')]);router['get'](_0x3ad5('0x15'),auth[_0x3ad5('0xb')](),controller[_0x3ad5('0x16')]);router[_0x3ad5('0xa')](_0x3ad5('0x17'),auth[_0x3ad5('0xb')](),controller['getBlackLists']);router['post']('/',auth[_0x3ad5('0xb')](),controller[_0x3ad5('0x18')]);router[_0x3ad5('0x19')](_0x3ad5('0x1a'),auth[_0x3ad5('0xb')](),controller[_0x3ad5('0x1b')]);router['post']('/:id/lists',auth[_0x3ad5('0xb')](),controller[_0x3ad5('0x1c')]);router['post']('/:id/blacklists',auth[_0x3ad5('0xb')](),controller[_0x3ad5('0x1d')]);router[_0x3ad5('0x1e')](_0x3ad5('0x1f'),auth['isAuthenticated'](),controller[_0x3ad5('0x20')]);router[_0x3ad5('0x21')](_0x3ad5('0x1f'),auth[_0x3ad5('0xb')](),controller[_0x3ad5('0x22')]);router[_0x3ad5('0x21')](_0x3ad5('0x15'),auth[_0x3ad5('0xb')](),controller[_0x3ad5('0x23')]);router['delete'](_0x3ad5('0x17'),auth['isAuthenticated'](),controller[_0x3ad5('0x24')]);module['exports']=router; \ No newline at end of file +var _0x07a5=['/:id/blacklists','addBlackLists','put','/:id','update','delete','removeBlackLists','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','create','post','clone'];(function(_0x41b62a,_0x13d23e){var _0x429f38=function(_0x1d9198){while(--_0x1d9198){_0x41b62a['push'](_0x41b62a['shift']());}};_0x429f38(++_0x13d23e);}(_0x07a5,0x1e8));var _0x507a=function(_0x1e48d3,_0x5d8c43){_0x1e48d3=_0x1e48d3-0x0;var _0x2852b1=_0x07a5[_0x1e48d3];return _0x2852b1;};'use strict';var multer=require(_0x507a('0x0'));var util=require(_0x507a('0x1'));var path=require(_0x507a('0x2'));var timeout=require('connect-timeout');var express=require(_0x507a('0x3'));var router=express[_0x507a('0x4')]();var fs_extra=require(_0x507a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x507a('0x6'));var config=require('../../config/environment');var controller=require(_0x507a('0x7'));router[_0x507a('0x8')]('/',auth[_0x507a('0x9')](),controller[_0x507a('0xa')]);router[_0x507a('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x507a('0xb')]);router[_0x507a('0x8')](_0x507a('0xc'),auth['isAuthenticated'](),controller['getHoppers']);router['get']('/:id/hopper_histories',auth[_0x507a('0x9')](),controller['getHopperHistories']);router[_0x507a('0x8')]('/:id/hopper_finals',auth[_0x507a('0x9')](),controller[_0x507a('0xd')]);router[_0x507a('0x8')](_0x507a('0xe'),auth[_0x507a('0x9')](),controller[_0x507a('0xf')]);router['get'](_0x507a('0x10'),auth['isAuthenticated'](),controller[_0x507a('0x11')]);router[_0x507a('0x8')]('/:id/blacklists',auth[_0x507a('0x9')](),controller[_0x507a('0x12')]);router['post']('/',auth[_0x507a('0x9')](),controller[_0x507a('0x13')]);router[_0x507a('0x14')]('/:id/clone',auth['isAuthenticated'](),controller[_0x507a('0x15')]);router[_0x507a('0x14')](_0x507a('0x10'),auth[_0x507a('0x9')](),controller['addLists']);router['post'](_0x507a('0x16'),auth[_0x507a('0x9')](),controller[_0x507a('0x17')]);router[_0x507a('0x18')](_0x507a('0x19'),auth[_0x507a('0x9')](),controller[_0x507a('0x1a')]);router['delete'](_0x507a('0x19'),auth[_0x507a('0x9')](),controller['destroy']);router[_0x507a('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller['removeLists']);router[_0x507a('0x1b')](_0x507a('0x16'),auth[_0x507a('0x9')](),controller[_0x507a('0x1c')]);module[_0x507a('0x1d')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index d6a5a1e..f9555ae 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 _0xdc6d=['STRING','getDataValue','sequelize','exports','TEXT'];(function(_0x1d02d0,_0x59840f){var _0x15a16c=function(_0x1a30e2){while(--_0x1a30e2){_0x1d02d0['push'](_0x1d02d0['shift']());}};_0x15a16c(++_0x59840f);}(_0xdc6d,0x133));var _0xddc6=function(_0x15f1c3,_0x18ec13){_0x15f1c3=_0x15f1c3-0x0;var _0x1f83b1=_0xdc6d[_0x15f1c3];return _0x1f83b1;};'use strict';var Sequelize=require(_0xddc6('0x0'));module[_0xddc6('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xddc6('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xddc6('0x3')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xddc6('0x4')]('key');}}}; \ No newline at end of file +var _0xb67d=['STRING','TEXT','VIRTUAL','getDataValue','key','sequelize','exports'];(function(_0x40a1fd,_0x177f8f){var _0x181a0a=function(_0x804478){while(--_0x804478){_0x40a1fd['push'](_0x40a1fd['shift']());}};_0x181a0a(++_0x177f8f);}(_0xb67d,0x171));var _0xdb67=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xb67d[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0xdb67('0x0'));module[_0xdb67('0x1')]={'key':{'type':Sequelize[_0xdb67('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xdb67('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xdb67('0x4')],'get':function(){return this[_0xdb67('0x5')](_0xdb67('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 81b5140..2e87b53 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 _0xf3e3=['pick','filter','merge','options','CannedAnswer','includeAll','include','findAll','rows','catch','show','params','keys','find','body','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','CannedAnswers','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x3a5f0f,_0x38a215){var _0x1f3310=function(_0x341318){while(--_0x341318){_0x3a5f0f['push'](_0x3a5f0f['shift']());}};_0x1f3310(++_0x38a215);}(_0xf3e3,0x17a));var _0x3f3e=function(_0x3e8fa9,_0x38e7a5){_0x3e8fa9=_0x3e8fa9-0x0;var _0xeab747=_0xf3e3[_0x3e8fa9];return _0xeab747;};'use strict';var emlformat=require(_0x3f3e('0x0'));var rimraf=require(_0x3f3e('0x1'));var zipdir=require(_0x3f3e('0x2'));var jsonpatch=require(_0x3f3e('0x3'));var rp=require(_0x3f3e('0x4'));var moment=require(_0x3f3e('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3f3e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x3f3e('0x7'));var ejs=require(_0x3f3e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3f3e('0x9'));var squel=require('squel');var crypto=require(_0x3f3e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3f3e('0xb'));var toCsv=require(_0x3f3e('0x7'));var querystring=require('querystring');var Papa=require(_0x3f3e('0xc'));var Redis=require(_0x3f3e('0xd'));var authService=require(_0x3f3e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x3f3e('0xf'));var hardwareService=require(_0x3f3e('0x10'));var logger=require('../../config/logger')(_0x3f3e('0x11'));var utils=require(_0x3f3e('0x12'));var config=require(_0x3f3e('0x13'));var licenseUtil=require(_0x3f3e('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x93772b,_0x5be677){_0x5be677=_0x5be677||0xcc;return function(_0x69342f){if(_0x69342f){return _0x93772b[_0x3f3e('0x15')](_0x5be677);}return _0x93772b[_0x3f3e('0x16')](_0x5be677)[_0x3f3e('0x17')]();};}function respondWithResult(_0x4ba1bc,_0x9737bc){_0x9737bc=_0x9737bc||0xc8;return function(_0x2c28df){if(_0x2c28df){return _0x4ba1bc['status'](_0x9737bc)['json'](_0x2c28df);}};}function respondWithFilteredResult(_0x2b0bf9,_0x3c0c53){return function(_0x4e5f74){if(_0x4e5f74){var _0x212130=typeof _0x3c0c53[_0x3f3e('0x18')]===_0x3f3e('0x19')&&typeof _0x3c0c53[_0x3f3e('0x1a')]===_0x3f3e('0x19');var _0x2c6849=_0x4e5f74[_0x3f3e('0x1b')];var _0x3e73d8=_0x212130?0x0:_0x3c0c53[_0x3f3e('0x18')];var _0x2f8326=_0x212130?_0x4e5f74[_0x3f3e('0x1b')]:_0x3c0c53[_0x3f3e('0x18')]+_0x3c0c53[_0x3f3e('0x1a')];var _0x4ed49c;if(_0x2f8326>=_0x2c6849){_0x2f8326=_0x2c6849;_0x4ed49c=0xc8;}else{_0x4ed49c=0xce;}_0x2b0bf9[_0x3f3e('0x16')](_0x4ed49c);return _0x2b0bf9[_0x3f3e('0x1c')](_0x3f3e('0x1d'),_0x3e73d8+'-'+_0x2f8326+'/'+_0x2c6849)[_0x3f3e('0x1e')](_0x4e5f74);}return null;};}function patchUpdates(_0x77b15d){return function(_0x567d39){try{jsonpatch[_0x3f3e('0x1f')](_0x567d39,_0x77b15d,!![]);}catch(_0xcb3f01){return BPromise['reject'](_0xcb3f01);}return _0x567d39[_0x3f3e('0x20')]();};}function saveUpdates(_0x547fbf,_0x5c31ad){return function(_0x137d7e){if(_0x137d7e){return _0x137d7e[_0x3f3e('0x21')](_0x547fbf)[_0x3f3e('0x22')](function(_0x4af770){return _0x4af770;});}return null;};}function removeEntity(_0x217ceb,_0x469bef){return function(_0x4019bd){if(_0x4019bd){return _0x4019bd[_0x3f3e('0x23')]()['then'](function(){var _0x374679=_0x4019bd['get']({'plain':!![]});var _0x34123e=_0x3f3e('0x24');return db['UserProfileResource'][_0x3f3e('0x23')]({'where':{'type':_0x34123e,'resourceId':_0x374679['id']}})[_0x3f3e('0x22')](function(){return _0x4019bd;});})[_0x3f3e('0x22')](function(){_0x217ceb[_0x3f3e('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x488e4e,_0x161be0){return function(_0x51760e){if(!_0x51760e){_0x488e4e[_0x3f3e('0x15')](0x194);}return _0x51760e;};}function handleError(_0x361064,_0x284b94){_0x284b94=_0x284b94||0x1f4;return function(_0x2714ac){logger[_0x3f3e('0x25')](_0x2714ac[_0x3f3e('0x26')]);if(_0x2714ac[_0x3f3e('0x27')]){delete _0x2714ac[_0x3f3e('0x27')];}_0x361064['status'](_0x284b94)[_0x3f3e('0x28')](_0x2714ac);};}exports[_0x3f3e('0x29')]=function(_0x270c53,_0x12f9e0){var _0x3b9d1a={},_0x41ce87={},_0xda6e99={'count':0x0,'rows':[]};var _0x500544=_[_0x3f3e('0x2a')](db['CannedAnswer'][_0x3f3e('0x2b')],function(_0x310400){return{'name':_0x310400[_0x3f3e('0x2c')],'type':_0x310400['type']['key']};});_0x41ce87[_0x3f3e('0x2d')]=_['map'](_0x500544,'name');_0x41ce87[_0x3f3e('0x2e')]=_['keys'](_0x270c53[_0x3f3e('0x2e')]);_0x41ce87[_0x3f3e('0x2f')]=_[_0x3f3e('0x30')](_0x41ce87[_0x3f3e('0x2d')],_0x41ce87[_0x3f3e('0x2e')]);_0x3b9d1a[_0x3f3e('0x31')]=_[_0x3f3e('0x30')](_0x41ce87['model'],qs[_0x3f3e('0x32')](_0x270c53['query'][_0x3f3e('0x32')]));_0x3b9d1a[_0x3f3e('0x31')]=_0x3b9d1a[_0x3f3e('0x31')][_0x3f3e('0x33')]?_0x3b9d1a[_0x3f3e('0x31')]:_0x41ce87[_0x3f3e('0x2d')];if(!_0x270c53[_0x3f3e('0x2e')][_0x3f3e('0x34')](_0x3f3e('0x35'))){_0x3b9d1a[_0x3f3e('0x1a')]=qs[_0x3f3e('0x1a')](_0x270c53['query'][_0x3f3e('0x1a')]);_0x3b9d1a[_0x3f3e('0x18')]=qs[_0x3f3e('0x18')](_0x270c53[_0x3f3e('0x2e')][_0x3f3e('0x18')]);}_0x3b9d1a[_0x3f3e('0x36')]=qs[_0x3f3e('0x37')](_0x270c53[_0x3f3e('0x2e')][_0x3f3e('0x37')]);_0x3b9d1a[_0x3f3e('0x38')]=qs[_0x3f3e('0x2f')](_[_0x3f3e('0x39')](_0x270c53[_0x3f3e('0x2e')],_0x41ce87[_0x3f3e('0x2f')]),_0x500544);if(_0x270c53[_0x3f3e('0x2e')][_0x3f3e('0x3a')]){_0x3b9d1a[_0x3f3e('0x38')]=_[_0x3f3e('0x3b')](_0x3b9d1a[_0x3f3e('0x38')],{'$or':[{'key':{'$like':'%'+_0x270c53[_0x3f3e('0x2e')][_0x3f3e('0x3a')]+'%'}},{'value':{'$like':'%'+_0x270c53[_0x3f3e('0x2e')][_0x3f3e('0x3a')]+'%'}}]});}_0x3b9d1a=_[_0x3f3e('0x3b')]({},_0x3b9d1a,_0x270c53[_0x3f3e('0x3c')]);var _0x4eafcd={'where':_0x3b9d1a[_0x3f3e('0x38')]};return db[_0x3f3e('0x3d')][_0x3f3e('0x1b')](_0x4eafcd)[_0x3f3e('0x22')](function(_0x4593f7){_0xda6e99[_0x3f3e('0x1b')]=_0x4593f7;if(_0x270c53[_0x3f3e('0x2e')][_0x3f3e('0x3e')]){_0x3b9d1a[_0x3f3e('0x3f')]=[{'all':!![]}];}return db[_0x3f3e('0x3d')][_0x3f3e('0x40')](_0x3b9d1a);})[_0x3f3e('0x22')](function(_0x3eeb26){_0xda6e99[_0x3f3e('0x41')]=_0x3eeb26;return _0xda6e99;})[_0x3f3e('0x22')](respondWithFilteredResult(_0x12f9e0,_0x3b9d1a))[_0x3f3e('0x42')](handleError(_0x12f9e0,null));};exports[_0x3f3e('0x43')]=function(_0x1e1a08,_0x355773){var _0x3d8683={'raw':!![],'where':{'id':_0x1e1a08[_0x3f3e('0x44')]['id']}},_0x3a6f1d={};_0x3a6f1d[_0x3f3e('0x2d')]=_[_0x3f3e('0x45')](db[_0x3f3e('0x3d')][_0x3f3e('0x2b')]);_0x3a6f1d[_0x3f3e('0x2e')]=_[_0x3f3e('0x45')](_0x1e1a08['query']);_0x3a6f1d[_0x3f3e('0x2f')]=_['intersection'](_0x3a6f1d[_0x3f3e('0x2d')],_0x3a6f1d[_0x3f3e('0x2e')]);_0x3d8683['attributes']=_[_0x3f3e('0x30')](_0x3a6f1d['model'],qs[_0x3f3e('0x32')](_0x1e1a08[_0x3f3e('0x2e')][_0x3f3e('0x32')]));_0x3d8683['attributes']=_0x3d8683[_0x3f3e('0x31')][_0x3f3e('0x33')]?_0x3d8683[_0x3f3e('0x31')]:_0x3a6f1d['model'];if(_0x1e1a08[_0x3f3e('0x2e')][_0x3f3e('0x3e')]){_0x3d8683[_0x3f3e('0x3f')]=[{'all':!![]}];}_0x3d8683=_[_0x3f3e('0x3b')]({},_0x3d8683,_0x1e1a08[_0x3f3e('0x3c')]);return db[_0x3f3e('0x3d')][_0x3f3e('0x46')](_0x3d8683)['then'](handleEntityNotFound(_0x355773,null))[_0x3f3e('0x22')](respondWithResult(_0x355773,null))[_0x3f3e('0x42')](handleError(_0x355773,null));};exports[_0x3f3e('0x21')]=function(_0x266dc2,_0x5ae7fc){if(_0x266dc2[_0x3f3e('0x47')]['id']){delete _0x266dc2['body']['id'];}return db['CannedAnswer'][_0x3f3e('0x46')]({'where':{'id':_0x266dc2[_0x3f3e('0x44')]['id']}})['then'](handleEntityNotFound(_0x5ae7fc,null))[_0x3f3e('0x22')](saveUpdates(_0x266dc2[_0x3f3e('0x47')],null))[_0x3f3e('0x22')](respondWithResult(_0x5ae7fc,null))['catch'](handleError(_0x5ae7fc,null));};exports[_0x3f3e('0x23')]=function(_0x21a619,_0x1d48e3){return db[_0x3f3e('0x3d')]['find']({'where':{'id':_0x21a619[_0x3f3e('0x44')]['id']}})[_0x3f3e('0x22')](handleEntityNotFound(_0x1d48e3,null))[_0x3f3e('0x22')](removeEntity(_0x1d48e3,null))[_0x3f3e('0x42')](handleError(_0x1d48e3,null));};exports['create']=function(_0x5549f7,_0x1627cb){var _0x105c9f={'key':_0x5549f7[_0x3f3e('0x47')][_0x3f3e('0x48')]};if(_0x5549f7[_0x3f3e('0x47')][_0x3f3e('0x49')]){_0x105c9f['MailAccountId']=_0x5549f7[_0x3f3e('0x47')]['MailAccountId'];}else if(_0x5549f7[_0x3f3e('0x47')][_0x3f3e('0x4a')]){_0x105c9f[_0x3f3e('0x4a')]=_0x5549f7['body']['SmsAccountId'];}else if(_0x5549f7['body'][_0x3f3e('0x4b')]){_0x105c9f[_0x3f3e('0x4b')]=_0x5549f7['body'][_0x3f3e('0x4b')];}else if(_0x5549f7[_0x3f3e('0x47')][_0x3f3e('0x4c')]){_0x105c9f[_0x3f3e('0x4c')]=_0x5549f7[_0x3f3e('0x47')][_0x3f3e('0x4c')];}return db[_0x3f3e('0x3d')][_0x3f3e('0x46')]({'where':_0x105c9f})['then'](function(_0x344246){if(_0x344246){throw new db[(_0x3f3e('0x4d'))][(_0x3f3e('0x4e'))](_0x3f3e('0x4f'));}return db[_0x3f3e('0x3d')][_0x3f3e('0x50')](_0x5549f7[_0x3f3e('0x47')]);})['then'](function(_0x1703ea){var _0x5af216=_0x5549f7[_0x3f3e('0x51')][_0x3f3e('0x52')]({'plain':!![]});if(!_0x5af216)throw new Error(_0x3f3e('0x53'));if(_0x5af216[_0x3f3e('0x54')]===_0x3f3e('0x51')){var _0x577385=_0x1703ea[_0x3f3e('0x52')]({'plain':!![]});return db[_0x3f3e('0x55')]['find']({'where':{'name':_0x3f3e('0x24'),'userProfileId':_0x5af216['userProfileId']},'raw':!![]})[_0x3f3e('0x22')](function(_0x58b3f3){if(_0x58b3f3&&_0x58b3f3['autoAssociation']===0x0){return db[_0x3f3e('0x56')][_0x3f3e('0x50')]({'name':_0x577385[_0x3f3e('0x27')],'resourceId':_0x577385['id'],'type':_0x58b3f3['name'],'sectionId':_0x58b3f3['id']},{})[_0x3f3e('0x22')](function(){return _0x1703ea;});}else{return _0x1703ea;}})[_0x3f3e('0x42')](function(_0x97f021){logger[_0x3f3e('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x97f021);throw _0x97f021;});}return _0x1703ea;})[_0x3f3e('0x22')](respondWithResult(_0x1627cb,0xc9))[_0x3f3e('0x42')](handleError(_0x1627cb,null));}; \ No newline at end of file +var _0x695e=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','count','includeAll','findAll','rows','catch','show','params','rawAttributes','include','body','find','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CannedAnswers','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','end','status','limit','undefined','offset','Content-Range','reject','save','update','then','destroy','get','error','stack','name','send','index','map','CannedAnswer','fieldName','type'];(function(_0x19938a,_0x13da30){var _0x146c5d=function(_0x477a72){while(--_0x477a72){_0x19938a['push'](_0x19938a['shift']());}};_0x146c5d(++_0x13da30);}(_0x695e,0x81));var _0xe695=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x695e[_0x18cd5b];return _0x5eaa52;};'use strict';var emlformat=require(_0xe695('0x0'));var rimraf=require(_0xe695('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe695('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe695('0x3'));var util=require(_0xe695('0x4'));var path=require(_0xe695('0x5'));var sox=require(_0xe695('0x6'));var csv=require('to-csv');var ejs=require(_0xe695('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe695('0x8'));var crypto=require(_0xe695('0x9'));var jsforce=require(_0xe695('0xa'));var deskjs=require(_0xe695('0xb'));var toCsv=require('to-csv');var querystring=require(_0xe695('0xc'));var Papa=require(_0xe695('0xd'));var Redis=require('ioredis');var authService=require(_0xe695('0xe'));var qs=require(_0xe695('0xf'));var as=require(_0xe695('0x10'));var hardwareService=require(_0xe695('0x11'));var logger=require('../../config/logger')(_0xe695('0x12'));var utils=require('../../config/utils');var config=require(_0xe695('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xe695('0x14'))['db'];function respondWithStatusCode(_0x28b085,_0x16c9e3){_0x16c9e3=_0x16c9e3||0xcc;return function(_0x324e04){if(_0x324e04){return _0x28b085[_0xe695('0x15')](_0x16c9e3);}return _0x28b085['status'](_0x16c9e3)[_0xe695('0x16')]();};}function respondWithResult(_0x4e61d9,_0x1ef436){_0x1ef436=_0x1ef436||0xc8;return function(_0x547611){if(_0x547611){return _0x4e61d9[_0xe695('0x17')](_0x1ef436)['json'](_0x547611);}};}function respondWithFilteredResult(_0x190a05,_0x46301f){return function(_0x481e02){if(_0x481e02){var _0x1a0cc0=typeof _0x46301f['offset']==='undefined'&&typeof _0x46301f[_0xe695('0x18')]===_0xe695('0x19');var _0x52e373=_0x481e02['count'];var _0x2f0b8e=_0x1a0cc0?0x0:_0x46301f[_0xe695('0x1a')];var _0xf05839=_0x1a0cc0?_0x481e02['count']:_0x46301f['offset']+_0x46301f[_0xe695('0x18')];var _0x2d8a40;if(_0xf05839>=_0x52e373){_0xf05839=_0x52e373;_0x2d8a40=0xc8;}else{_0x2d8a40=0xce;}_0x190a05[_0xe695('0x17')](_0x2d8a40);return _0x190a05['set'](_0xe695('0x1b'),_0x2f0b8e+'-'+_0xf05839+'/'+_0x52e373)['json'](_0x481e02);}return null;};}function patchUpdates(_0x4427ce){return function(_0x2b21c1){try{jsonpatch['apply'](_0x2b21c1,_0x4427ce,!![]);}catch(_0x3d5c40){return BPromise[_0xe695('0x1c')](_0x3d5c40);}return _0x2b21c1[_0xe695('0x1d')]();};}function saveUpdates(_0x2159f5,_0x1bdcf7){return function(_0x1b7caa){if(_0x1b7caa){return _0x1b7caa[_0xe695('0x1e')](_0x2159f5)[_0xe695('0x1f')](function(_0x5523b0){return _0x5523b0;});}return null;};}function removeEntity(_0x3336b9,_0x4f836d){return function(_0xef7bcc){if(_0xef7bcc){return _0xef7bcc[_0xe695('0x20')]()[_0xe695('0x1f')](function(){var _0x1a55e8=_0xef7bcc[_0xe695('0x21')]({'plain':!![]});var _0x5620d8='CannedAnswers';return db['UserProfileResource'][_0xe695('0x20')]({'where':{'type':_0x5620d8,'resourceId':_0x1a55e8['id']}})[_0xe695('0x1f')](function(){return _0xef7bcc;});})[_0xe695('0x1f')](function(){_0x3336b9[_0xe695('0x17')](0xcc)[_0xe695('0x16')]();});}};}function handleEntityNotFound(_0x1c759f,_0x310846){return function(_0x4167de){if(!_0x4167de){_0x1c759f[_0xe695('0x15')](0x194);}return _0x4167de;};}function handleError(_0xf53cd7,_0x5dcb1c){_0x5dcb1c=_0x5dcb1c||0x1f4;return function(_0x409593){logger[_0xe695('0x22')](_0x409593[_0xe695('0x23')]);if(_0x409593[_0xe695('0x24')]){delete _0x409593[_0xe695('0x24')];}_0xf53cd7['status'](_0x5dcb1c)[_0xe695('0x25')](_0x409593);};}exports[_0xe695('0x26')]=function(_0x21e384,_0x4c5c09){var _0x4b4511={},_0x5129b0={},_0x21508d={'count':0x0,'rows':[]};var _0x2d0293=_[_0xe695('0x27')](db[_0xe695('0x28')]['rawAttributes'],function(_0x2f8fe1){return{'name':_0x2f8fe1[_0xe695('0x29')],'type':_0x2f8fe1[_0xe695('0x2a')][_0xe695('0x2b')]};});_0x5129b0[_0xe695('0x2c')]=_['map'](_0x2d0293,_0xe695('0x24'));_0x5129b0[_0xe695('0x2d')]=_[_0xe695('0x2e')](_0x21e384[_0xe695('0x2d')]);_0x5129b0[_0xe695('0x2f')]=_[_0xe695('0x30')](_0x5129b0[_0xe695('0x2c')],_0x5129b0[_0xe695('0x2d')]);_0x4b4511[_0xe695('0x31')]=_['intersection'](_0x5129b0['model'],qs['fields'](_0x21e384[_0xe695('0x2d')][_0xe695('0x32')]));_0x4b4511[_0xe695('0x31')]=_0x4b4511[_0xe695('0x31')][_0xe695('0x33')]?_0x4b4511['attributes']:_0x5129b0[_0xe695('0x2c')];if(!_0x21e384[_0xe695('0x2d')][_0xe695('0x34')](_0xe695('0x35'))){_0x4b4511[_0xe695('0x18')]=qs[_0xe695('0x18')](_0x21e384[_0xe695('0x2d')][_0xe695('0x18')]);_0x4b4511['offset']=qs[_0xe695('0x1a')](_0x21e384[_0xe695('0x2d')]['offset']);}_0x4b4511[_0xe695('0x36')]=qs['sort'](_0x21e384[_0xe695('0x2d')]['sort']);_0x4b4511[_0xe695('0x37')]=qs[_0xe695('0x2f')](_[_0xe695('0x38')](_0x21e384[_0xe695('0x2d')],_0x5129b0[_0xe695('0x2f')]),_0x2d0293);if(_0x21e384['query'][_0xe695('0x39')]){_0x4b4511[_0xe695('0x37')]=_[_0xe695('0x3a')](_0x4b4511['where'],{'$or':[{'key':{'$like':'%'+_0x21e384[_0xe695('0x2d')][_0xe695('0x39')]+'%'}},{'value':{'$like':'%'+_0x21e384[_0xe695('0x2d')][_0xe695('0x39')]+'%'}}]});}_0x4b4511=_[_0xe695('0x3a')]({},_0x4b4511,_0x21e384[_0xe695('0x3b')]);var _0xc78095={'where':_0x4b4511[_0xe695('0x37')]};return db['CannedAnswer']['count'](_0xc78095)[_0xe695('0x1f')](function(_0x4eb56f){_0x21508d[_0xe695('0x3c')]=_0x4eb56f;if(_0x21e384['query'][_0xe695('0x3d')]){_0x4b4511['include']=[{'all':!![]}];}return db[_0xe695('0x28')][_0xe695('0x3e')](_0x4b4511);})[_0xe695('0x1f')](function(_0x4a5053){_0x21508d[_0xe695('0x3f')]=_0x4a5053;return _0x21508d;})[_0xe695('0x1f')](respondWithFilteredResult(_0x4c5c09,_0x4b4511))[_0xe695('0x40')](handleError(_0x4c5c09,null));};exports[_0xe695('0x41')]=function(_0x3e4bf1,_0xa44878){var _0x57f2d0={'raw':!![],'where':{'id':_0x3e4bf1[_0xe695('0x42')]['id']}},_0x35f7d2={};_0x35f7d2[_0xe695('0x2c')]=_[_0xe695('0x2e')](db[_0xe695('0x28')][_0xe695('0x43')]);_0x35f7d2[_0xe695('0x2d')]=_[_0xe695('0x2e')](_0x3e4bf1[_0xe695('0x2d')]);_0x35f7d2[_0xe695('0x2f')]=_['intersection'](_0x35f7d2[_0xe695('0x2c')],_0x35f7d2[_0xe695('0x2d')]);_0x57f2d0[_0xe695('0x31')]=_[_0xe695('0x30')](_0x35f7d2[_0xe695('0x2c')],qs['fields'](_0x3e4bf1[_0xe695('0x2d')][_0xe695('0x32')]));_0x57f2d0['attributes']=_0x57f2d0['attributes'][_0xe695('0x33')]?_0x57f2d0[_0xe695('0x31')]:_0x35f7d2['model'];if(_0x3e4bf1[_0xe695('0x2d')]['includeAll']){_0x57f2d0[_0xe695('0x44')]=[{'all':!![]}];}_0x57f2d0=_[_0xe695('0x3a')]({},_0x57f2d0,_0x3e4bf1[_0xe695('0x3b')]);return db[_0xe695('0x28')]['find'](_0x57f2d0)[_0xe695('0x1f')](handleEntityNotFound(_0xa44878,null))['then'](respondWithResult(_0xa44878,null))[_0xe695('0x40')](handleError(_0xa44878,null));};exports['update']=function(_0x2e5dff,_0x26739b){if(_0x2e5dff[_0xe695('0x45')]['id']){delete _0x2e5dff['body']['id'];}return db[_0xe695('0x28')][_0xe695('0x46')]({'where':{'id':_0x2e5dff[_0xe695('0x42')]['id']}})[_0xe695('0x1f')](handleEntityNotFound(_0x26739b,null))[_0xe695('0x1f')](saveUpdates(_0x2e5dff[_0xe695('0x45')],null))[_0xe695('0x1f')](respondWithResult(_0x26739b,null))['catch'](handleError(_0x26739b,null));};exports['destroy']=function(_0x991bd7,_0x3bf44c){return db['CannedAnswer']['find']({'where':{'id':_0x991bd7['params']['id']}})['then'](handleEntityNotFound(_0x3bf44c,null))[_0xe695('0x1f')](removeEntity(_0x3bf44c,null))[_0xe695('0x40')](handleError(_0x3bf44c,null));};exports['create']=function(_0xe5f896,_0x4fbbd0){var _0x21149d={'key':_0xe5f896[_0xe695('0x45')][_0xe695('0x2b')]};if(_0xe5f896[_0xe695('0x45')]['MailAccountId']){_0x21149d[_0xe695('0x47')]=_0xe5f896[_0xe695('0x45')][_0xe695('0x47')];}else if(_0xe5f896['body'][_0xe695('0x48')]){_0x21149d['SmsAccountId']=_0xe5f896[_0xe695('0x45')][_0xe695('0x48')];}else if(_0xe5f896[_0xe695('0x45')][_0xe695('0x49')]){_0x21149d[_0xe695('0x49')]=_0xe5f896[_0xe695('0x45')][_0xe695('0x49')];}else if(_0xe5f896[_0xe695('0x45')][_0xe695('0x4a')]){_0x21149d[_0xe695('0x4a')]=_0xe5f896[_0xe695('0x45')]['ChatWebsiteId'];}return db[_0xe695('0x28')][_0xe695('0x46')]({'where':_0x21149d})[_0xe695('0x1f')](function(_0x2ba407){if(_0x2ba407){throw new db[(_0xe695('0x4b'))][(_0xe695('0x4c'))](_0xe695('0x4d'));}return db['CannedAnswer'][_0xe695('0x4e')](_0xe5f896['body']);})[_0xe695('0x1f')](function(_0x4c2320){var _0x40f758=_0xe5f896[_0xe695('0x4f')][_0xe695('0x21')]({'plain':!![]});if(!_0x40f758)throw new Error(_0xe695('0x50'));if(_0x40f758[_0xe695('0x51')]==='user'){var _0x38e266=_0x4c2320[_0xe695('0x21')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xe695('0x52'),'userProfileId':_0x40f758[_0xe695('0x53')]},'raw':!![]})[_0xe695('0x1f')](function(_0x4d9a13){if(_0x4d9a13&&_0x4d9a13[_0xe695('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x38e266['name'],'resourceId':_0x38e266['id'],'type':_0x4d9a13[_0xe695('0x24')],'sectionId':_0x4d9a13['id']},{})[_0xe695('0x1f')](function(){return _0x4c2320;});}else{return _0x4c2320;}})[_0xe695('0x40')](function(_0x368216){logger['error'](_0xe695('0x55'),_0x368216);throw _0x368216;});}return _0x4c2320;})['then'](respondWithResult(_0x4fbbd0,0xc9))['catch'](handleError(_0x4fbbd0,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index da993e0..c0d2e77 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 _0xa8a1=['exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x3ae2b2,_0x2d936f){var _0x1dbf00=function(_0x4072e9){while(--_0x4072e9){_0x3ae2b2['push'](_0x3ae2b2['shift']());}};_0x1dbf00(++_0x2d936f);}(_0xa8a1,0x6d));var _0x1a8a=function(_0x282743,_0x273f66){_0x282743=_0x282743-0x0;var _0x4302d7=_0xa8a1[_0x282743];return _0x4302d7;};'use strict';var _=require('lodash');var util=require(_0x1a8a('0x0'));var logger=require(_0x1a8a('0x1'))(_0x1a8a('0x2'));var moment=require(_0x1a8a('0x3'));var BPromise=require(_0x1a8a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a8a('0x5'));var rimraf=require(_0x1a8a('0x6'));var config=require(_0x1a8a('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0x1a8a('0x8')]=function(_0x49bd28,_0x6c4f69){return _0x49bd28[_0x1a8a('0x9')](_0x1a8a('0xa'),attributes,{'tableName':_0x1a8a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1a8a('0xc')});}; \ No newline at end of file +var _0xe0dd=['define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x11a45,_0x1e40c3){var _0x48d1e6=function(_0x1bd617){while(--_0x1bd617){_0x11a45['push'](_0x11a45['shift']());}};_0x48d1e6(++_0x1e40c3);}(_0xe0dd,0x163));var _0xde0d=function(_0x5311a1,_0x304912){_0x5311a1=_0x5311a1-0x0;var _0x2acb9f=_0xe0dd[_0x5311a1];return _0x2acb9f;};'use strict';var _=require(_0xde0d('0x0'));var util=require(_0xde0d('0x1'));var logger=require('../../config/logger')(_0xde0d('0x2'));var moment=require(_0xde0d('0x3'));var BPromise=require(_0xde0d('0x4'));var rp=require(_0xde0d('0x5'));var fs=require('fs');var path=require(_0xde0d('0x6'));var rimraf=require(_0xde0d('0x7'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0xde0d('0x8')]=function(_0x1c7bda,_0x5c58e5){return _0x1c7bda[_0xde0d('0x9')](_0xde0d('0xa'),attributes,{'tableName':_0xde0d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xde0d('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index b951dc2..3ff17e4 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(_0x5b18a8,_0x21dedd){var _0x78b6cc=function(_0x234f8a){while(--_0x234f8a){_0x5b18a8['push'](_0x5b18a8['shift']());}};_0x78b6cc(++_0x21dedd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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(_0x371f16,_0x209200){var _0x21727f=function(_0x512158){while(--_0x512158){_0x371f16['push'](_0x371f16['shift']());}};_0x21727f(++_0x209200);}(_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);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 98429e5..9bcf9f2 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 _0xe555=['show','post','isAuthenticated','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','index','/:id'];(function(_0x2ccbf4,_0x230c9e){var _0x5782dc=function(_0x5bf726){while(--_0x5bf726){_0x2ccbf4['push'](_0x2ccbf4['shift']());}};_0x5782dc(++_0x230c9e);}(_0xe555,0xb3));var _0x5e55=function(_0x99ff94,_0x47a1b1){_0x99ff94=_0x99ff94-0x0;var _0x1b5bc0=_0xe555[_0x99ff94];return _0x1b5bc0;};'use strict';var multer=require(_0x5e55('0x0'));var util=require('util');var path=require(_0x5e55('0x1'));var timeout=require(_0x5e55('0x2'));var express=require(_0x5e55('0x3'));var router=express[_0x5e55('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5e55('0x5'));var config=require(_0x5e55('0x6'));var controller=require(_0x5e55('0x7'));router[_0x5e55('0x8')]('/',auth['isAuthenticated'](),controller[_0x5e55('0x9')]);router[_0x5e55('0x8')](_0x5e55('0xa'),auth['isAuthenticated'](),controller[_0x5e55('0xb')]);router[_0x5e55('0xc')]('/',auth[_0x5e55('0xd')](),controller['create']);router[_0x5e55('0xe')]('/:id',auth[_0x5e55('0xd')](),controller[_0x5e55('0xf')]);router[_0x5e55('0x10')](_0x5e55('0xa'),auth[_0x5e55('0xd')](),controller[_0x5e55('0x11')]);module[_0x5e55('0x12')]=router; \ No newline at end of file +var _0x54e3=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','post','create','put','update','delete'];(function(_0x568496,_0x565afd){var _0x26c5c1=function(_0x4d251e){while(--_0x4d251e){_0x568496['push'](_0x568496['shift']());}};_0x26c5c1(++_0x565afd);}(_0x54e3,0x106));var _0x354e=function(_0x28c9d9,_0x41f5b9){_0x28c9d9=_0x28c9d9-0x0;var _0x29eaa2=_0x54e3[_0x28c9d9];return _0x29eaa2;};'use strict';var multer=require(_0x354e('0x0'));var util=require(_0x354e('0x1'));var path=require(_0x354e('0x2'));var timeout=require(_0x354e('0x3'));var express=require(_0x354e('0x4'));var router=express[_0x354e('0x5')]();var fs_extra=require(_0x354e('0x6'));var auth=require(_0x354e('0x7'));var interaction=require(_0x354e('0x8'));var config=require(_0x354e('0x9'));var controller=require('./cannedAnswer.controller');router[_0x354e('0xa')]('/',auth[_0x354e('0xb')](),controller['index']);router[_0x354e('0xa')](_0x354e('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x354e('0xd')]('/',auth[_0x354e('0xb')](),controller[_0x354e('0xe')]);router[_0x354e('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x354e('0x10')]);router[_0x354e('0x11')](_0x354e('0xc'),auth[_0x354e('0xb')](),controller[_0x354e('0x12')]);module[_0x354e('0x13')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 1074d44..151ee78 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 _0x131e=['1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x421998,_0x387b45){var _0xa0fda4=function(_0x22da5d){while(--_0x22da5d){_0x421998['push'](_0x421998['shift']());}};_0xa0fda4(++_0x387b45);}(_0x131e,0x1ec));var _0xe131=function(_0x2f793a,_0x34460d){_0x2f793a=_0x2f793a-0x0;var _0x5a48ec=_0x131e[_0x2f793a];return _0x5a48ec;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xe131('0x0')},'clid':{'type':Sequelize[_0xe131('0x1')]},'src':{'type':Sequelize[_0xe131('0x1')]},'dst':{'type':Sequelize[_0xe131('0x1')]},'dcontext':{'type':Sequelize[_0xe131('0x1')]},'channel':{'type':Sequelize[_0xe131('0x1')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xe131('0x1')]},'lastdata':{'type':Sequelize[_0xe131('0x1')]},'duration':{'type':Sequelize[_0xe131('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xe131('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe131('0x1')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xe131('0x1')]},'sequence':{'type':Sequelize[_0xe131('0x1')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe131('0x1')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd820=['STRING','INTEGER','sequelize','exports','1970-01-01\x2000:00:01'];(function(_0x13d153,_0x3edda1){var _0x508a08=function(_0x465db7){while(--_0x465db7){_0x13d153['push'](_0x13d153['shift']());}};_0x508a08(++_0x3edda1);}(_0xd820,0x16f));var _0x0d82=function(_0x16ec06,_0x1513b5){_0x16ec06=_0x16ec06-0x0;var _0xee6d30=_0xd820[_0x16ec06];return _0xee6d30;};'use strict';var Sequelize=require(_0x0d82('0x0'));module[_0x0d82('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x0d82('0x2')},'clid':{'type':Sequelize[_0x0d82('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x0d82('0x3')]},'channel':{'type':Sequelize[_0x0d82('0x3')]},'dstchannel':{'type':Sequelize[_0x0d82('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x0d82('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0d82('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0d82('0x3')]},'amaflags':{'type':Sequelize[_0x0d82('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x0d82('0x3')]},'uniqueid':{'type':Sequelize[_0x0d82('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x0d82('0x3')]},'type':{'type':Sequelize[_0x0d82('0x3')]},'tag':{'type':Sequelize[_0x0d82('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 3535356..8aded76 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 _0xe107=['Cdr','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','include','rows','catch','show','params','includeAll','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index'];(function(_0x27c1fb,_0x5a124d){var _0x159eb0=function(_0x4b6877){while(--_0x4b6877){_0x27c1fb['push'](_0x27c1fb['shift']());}};_0x159eb0(++_0x5a124d);}(_0xe107,0xb3));var _0x7e10=function(_0xa81dcd,_0x440dcb){_0xa81dcd=_0xa81dcd-0x0;var _0x3f7437=_0xe107[_0xa81dcd];return _0x3f7437;};'use strict';var emlformat=require(_0x7e10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7e10('0x1'));var jsonpatch=require(_0x7e10('0x2'));var rp=require(_0x7e10('0x3'));var moment=require('moment');var BPromise=require(_0x7e10('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7e10('0x5'));var sox=require(_0x7e10('0x6'));var csv=require(_0x7e10('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e10('0x8'));var squel=require(_0x7e10('0x9'));var crypto=require(_0x7e10('0xa'));var jsforce=require(_0x7e10('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7e10('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7e10('0xd'));var qs=require(_0x7e10('0xe'));var as=require(_0x7e10('0xf'));var hardwareService=require(_0x7e10('0x10'));var logger=require(_0x7e10('0x11'))('api');var utils=require(_0x7e10('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x7e10('0x13'));var db=require(_0x7e10('0x14'))['db'];function respondWithStatusCode(_0x2f4d72,_0x5434dd){_0x5434dd=_0x5434dd||0xcc;return function(_0xc2e42b){if(_0xc2e42b){return _0x2f4d72[_0x7e10('0x15')](_0x5434dd);}return _0x2f4d72[_0x7e10('0x16')](_0x5434dd)[_0x7e10('0x17')]();};}function respondWithResult(_0x119ff5,_0x1b4d9d){_0x1b4d9d=_0x1b4d9d||0xc8;return function(_0x1c2b22){if(_0x1c2b22){return _0x119ff5[_0x7e10('0x16')](_0x1b4d9d)['json'](_0x1c2b22);}};}function respondWithFilteredResult(_0x15e9e5,_0x433221){return function(_0x4bd78a){if(_0x4bd78a){var _0x48339f=typeof _0x433221[_0x7e10('0x18')]==='undefined'&&typeof _0x433221[_0x7e10('0x19')]===_0x7e10('0x1a');var _0xdbda1a=_0x4bd78a[_0x7e10('0x1b')];var _0x4fd639=_0x48339f?0x0:_0x433221[_0x7e10('0x18')];var _0x2b4850=_0x48339f?_0x4bd78a[_0x7e10('0x1b')]:_0x433221['offset']+_0x433221[_0x7e10('0x19')];var _0x36149a;if(_0x2b4850>=_0xdbda1a){_0x2b4850=_0xdbda1a;_0x36149a=0xc8;}else{_0x36149a=0xce;}_0x15e9e5[_0x7e10('0x16')](_0x36149a);return _0x15e9e5[_0x7e10('0x1c')](_0x7e10('0x1d'),_0x4fd639+'-'+_0x2b4850+'/'+_0xdbda1a)['json'](_0x4bd78a);}return null;};}function patchUpdates(_0x45a0cb){return function(_0x2c6227){try{jsonpatch['apply'](_0x2c6227,_0x45a0cb,!![]);}catch(_0x3c5629){return BPromise[_0x7e10('0x1e')](_0x3c5629);}return _0x2c6227[_0x7e10('0x1f')]();};}function saveUpdates(_0x482faa,_0x4a667b){return function(_0x415cb7){if(_0x415cb7){return _0x415cb7[_0x7e10('0x20')](_0x482faa)[_0x7e10('0x21')](function(_0x1c72df){return _0x1c72df;});}return null;};}function removeEntity(_0x35e7c9,_0x105a55){return function(_0x12c36d){if(_0x12c36d){return _0x12c36d[_0x7e10('0x22')]()['then'](function(){_0x35e7c9['status'](0xcc)[_0x7e10('0x17')]();});}};}function handleEntityNotFound(_0xe34c1e,_0x1bfe8a){return function(_0x13eeb3){if(!_0x13eeb3){_0xe34c1e['sendStatus'](0x194);}return _0x13eeb3;};}function handleError(_0x537365,_0x116446){_0x116446=_0x116446||0x1f4;return function(_0x12ba1b){logger[_0x7e10('0x23')](_0x12ba1b[_0x7e10('0x24')]);if(_0x12ba1b[_0x7e10('0x25')]){delete _0x12ba1b[_0x7e10('0x25')];}_0x537365[_0x7e10('0x16')](_0x116446)[_0x7e10('0x26')](_0x12ba1b);};}exports[_0x7e10('0x27')]=function(_0x3b020c,_0x5691f8){var _0x4e225d={},_0xbc509={},_0x884343={'count':0x0,'rows':[]};var _0x560460=_['map'](db[_0x7e10('0x28')][_0x7e10('0x29')],function(_0x537587){return{'name':_0x537587[_0x7e10('0x2a')],'type':_0x537587['type'][_0x7e10('0x2b')]};});_0xbc509[_0x7e10('0x2c')]=_[_0x7e10('0x2d')](_0x560460,_0x7e10('0x25'));_0xbc509[_0x7e10('0x2e')]=_[_0x7e10('0x2f')](_0x3b020c['query']);_0xbc509[_0x7e10('0x30')]=_['intersection'](_0xbc509[_0x7e10('0x2c')],_0xbc509[_0x7e10('0x2e')]);_0x4e225d[_0x7e10('0x31')]=_[_0x7e10('0x32')](_0xbc509[_0x7e10('0x2c')],qs[_0x7e10('0x33')](_0x3b020c[_0x7e10('0x2e')][_0x7e10('0x33')]));_0x4e225d[_0x7e10('0x31')]=_0x4e225d['attributes'][_0x7e10('0x34')]?_0x4e225d[_0x7e10('0x31')]:_0xbc509[_0x7e10('0x2c')];if(!_0x3b020c[_0x7e10('0x2e')][_0x7e10('0x35')]('nolimit')){_0x4e225d[_0x7e10('0x19')]=qs[_0x7e10('0x19')](_0x3b020c[_0x7e10('0x2e')][_0x7e10('0x19')]);_0x4e225d['offset']=qs['offset'](_0x3b020c[_0x7e10('0x2e')][_0x7e10('0x18')]);}_0x4e225d[_0x7e10('0x36')]=qs[_0x7e10('0x37')](_0x3b020c['query'][_0x7e10('0x37')]);_0x4e225d[_0x7e10('0x38')]=qs['filters'](_[_0x7e10('0x39')](_0x3b020c[_0x7e10('0x2e')],_0xbc509['filters']),_0x560460);if(_0x3b020c['query']['filter']){_0x4e225d[_0x7e10('0x38')]=_[_0x7e10('0x3a')](_0x4e225d[_0x7e10('0x38')],{'$or':_[_0x7e10('0x2d')](_0x560460,function(_0xd696d2){if(_0xd696d2[_0x7e10('0x3b')]!==_0x7e10('0x3c')){var _0x419085={};_0x419085[_0xd696d2['name']]={'$like':'%'+_0x3b020c[_0x7e10('0x2e')][_0x7e10('0x3d')]+'%'};return _0x419085;}})});}_0x4e225d=_[_0x7e10('0x3a')]({},_0x4e225d,_0x3b020c[_0x7e10('0x3e')]);var _0x4ebf4a={'where':_0x4e225d[_0x7e10('0x38')]};return db[_0x7e10('0x28')][_0x7e10('0x1b')](_0x4ebf4a)[_0x7e10('0x21')](function(_0x3ad2f0){_0x884343[_0x7e10('0x1b')]=_0x3ad2f0;if(_0x3b020c[_0x7e10('0x2e')]['includeAll']){_0x4e225d[_0x7e10('0x3f')]=[{'all':!![]}];}return db[_0x7e10('0x28')]['findAll'](_0x4e225d);})[_0x7e10('0x21')](function(_0x5c62ac){_0x884343[_0x7e10('0x40')]=_0x5c62ac;return _0x884343;})['then'](respondWithFilteredResult(_0x5691f8,_0x4e225d))[_0x7e10('0x41')](handleError(_0x5691f8,null));};exports[_0x7e10('0x42')]=function(_0x1940ff,_0x18e9b2){var _0x3c6a01={'raw':!![],'where':{'id':_0x1940ff[_0x7e10('0x43')]['id']}},_0x4c2946={};_0x4c2946[_0x7e10('0x2c')]=_[_0x7e10('0x2f')](db[_0x7e10('0x28')][_0x7e10('0x29')]);_0x4c2946['query']=_[_0x7e10('0x2f')](_0x1940ff[_0x7e10('0x2e')]);_0x4c2946['filters']=_['intersection'](_0x4c2946[_0x7e10('0x2c')],_0x4c2946[_0x7e10('0x2e')]);_0x3c6a01['attributes']=_[_0x7e10('0x32')](_0x4c2946['model'],qs[_0x7e10('0x33')](_0x1940ff['query'][_0x7e10('0x33')]));_0x3c6a01[_0x7e10('0x31')]=_0x3c6a01['attributes']['length']?_0x3c6a01['attributes']:_0x4c2946['model'];if(_0x1940ff['query'][_0x7e10('0x44')]){_0x3c6a01[_0x7e10('0x3f')]=[{'all':!![]}];}_0x3c6a01=_[_0x7e10('0x3a')]({},_0x3c6a01,_0x1940ff[_0x7e10('0x3e')]);return db[_0x7e10('0x28')]['find'](_0x3c6a01)[_0x7e10('0x21')](handleEntityNotFound(_0x18e9b2,null))['then'](respondWithResult(_0x18e9b2,null))[_0x7e10('0x41')](handleError(_0x18e9b2,null));};exports[_0x7e10('0x45')]=function(_0x43745a,_0x290f9c){return db['Cdr']['create'](_0x43745a[_0x7e10('0x46')],{})[_0x7e10('0x21')](respondWithResult(_0x290f9c,0xc9))['catch'](handleError(_0x290f9c,null));};exports['update']=function(_0x2ceaec,_0x3f0a05){if(_0x2ceaec[_0x7e10('0x46')]['id']){delete _0x2ceaec[_0x7e10('0x46')]['id'];}return db[_0x7e10('0x28')][_0x7e10('0x47')]({'where':{'id':_0x2ceaec[_0x7e10('0x43')]['id']}})[_0x7e10('0x21')](handleEntityNotFound(_0x3f0a05,null))['then'](saveUpdates(_0x2ceaec[_0x7e10('0x46')],null))['then'](respondWithResult(_0x3f0a05,null))[_0x7e10('0x41')](handleError(_0x3f0a05,null));};exports[_0x7e10('0x22')]=function(_0x29bd0d,_0x4fec7f){return db['Cdr'][_0x7e10('0x47')]({'where':{'id':_0x29bd0d[_0x7e10('0x43')]['id']}})[_0x7e10('0x21')](handleEntityNotFound(_0x4fec7f,null))[_0x7e10('0x21')](removeEntity(_0x4fec7f,null))[_0x7e10('0x41')](handleError(_0x4fec7f,null));};exports['describe']=function(_0x39c23d,_0x498ebf){return db['Cdr'][_0x7e10('0x48')]()[_0x7e10('0x21')](respondWithResult(_0x498ebf,null))['catch'](handleError(_0x498ebf,null));}; \ No newline at end of file +var _0x106f=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','Content-Range','apply','save','update','then','destroy','end','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','Cdr','findAll','params','create','body','catch','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util'];(function(_0x1b33bc,_0x282af6){var _0x23b81c=function(_0x67994a){while(--_0x67994a){_0x1b33bc['push'](_0x1b33bc['shift']());}};_0x23b81c(++_0x282af6);}(_0x106f,0x162));var _0xf106=function(_0x1413d0,_0x2b0334){_0x1413d0=_0x1413d0-0x0;var _0x2a0fd6=_0x106f[_0x1413d0];return _0x2a0fd6;};'use strict';var emlformat=require(_0xf106('0x0'));var rimraf=require(_0xf106('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf106('0x2'));var rp=require(_0xf106('0x3'));var moment=require('moment');var BPromise=require(_0xf106('0x4'));var Mustache=require('mustache');var util=require(_0xf106('0x5'));var path=require(_0xf106('0x6'));var sox=require(_0xf106('0x7'));var csv=require(_0xf106('0x8'));var ejs=require(_0xf106('0x9'));var fs=require('fs');var fs_extra=require(_0xf106('0xa'));var _=require(_0xf106('0xb'));var squel=require('squel');var crypto=require(_0xf106('0xc'));var jsforce=require(_0xf106('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf106('0xe'));var qs=require(_0xf106('0xf'));var as=require(_0xf106('0x10'));var hardwareService=require(_0xf106('0x11'));var logger=require(_0xf106('0x12'))(_0xf106('0x13'));var utils=require(_0xf106('0x14'));var config=require(_0xf106('0x15'));var licenseUtil=require(_0xf106('0x16'));var db=require(_0xf106('0x17'))['db'];function respondWithStatusCode(_0x31eebf,_0x5e9da8){_0x5e9da8=_0x5e9da8||0xcc;return function(_0x2bd234){if(_0x2bd234){return _0x31eebf[_0xf106('0x18')](_0x5e9da8);}return _0x31eebf['status'](_0x5e9da8)['end']();};}function respondWithResult(_0x322351,_0x2cdbf6){_0x2cdbf6=_0x2cdbf6||0xc8;return function(_0x292a0d){if(_0x292a0d){return _0x322351['status'](_0x2cdbf6)[_0xf106('0x19')](_0x292a0d);}};}function respondWithFilteredResult(_0x26186f,_0xf05683){return function(_0x48bfdd){if(_0x48bfdd){var _0x1e17e6=typeof _0xf05683[_0xf106('0x1a')]==='undefined'&&typeof _0xf05683[_0xf106('0x1b')]===_0xf106('0x1c');var _0x62352=_0x48bfdd['count'];var _0x5d02c0=_0x1e17e6?0x0:_0xf05683[_0xf106('0x1a')];var _0x726d7c=_0x1e17e6?_0x48bfdd[_0xf106('0x1d')]:_0xf05683['offset']+_0xf05683[_0xf106('0x1b')];var _0x1a6816;if(_0x726d7c>=_0x62352){_0x726d7c=_0x62352;_0x1a6816=0xc8;}else{_0x1a6816=0xce;}_0x26186f[_0xf106('0x1e')](_0x1a6816);return _0x26186f[_0xf106('0x1f')](_0xf106('0x20'),_0x5d02c0+'-'+_0x726d7c+'/'+_0x62352)[_0xf106('0x19')](_0x48bfdd);}return null;};}function patchUpdates(_0x29ae70){return function(_0x232a54){try{jsonpatch[_0xf106('0x21')](_0x232a54,_0x29ae70,!![]);}catch(_0x4a9564){return BPromise['reject'](_0x4a9564);}return _0x232a54[_0xf106('0x22')]();};}function saveUpdates(_0x59abbc,_0x32ab30){return function(_0x3c729e){if(_0x3c729e){return _0x3c729e[_0xf106('0x23')](_0x59abbc)[_0xf106('0x24')](function(_0x450451){return _0x450451;});}return null;};}function removeEntity(_0x4f673f,_0x58febd){return function(_0x178890){if(_0x178890){return _0x178890[_0xf106('0x25')]()[_0xf106('0x24')](function(){_0x4f673f[_0xf106('0x1e')](0xcc)[_0xf106('0x26')]();});}};}function handleEntityNotFound(_0xf7de89,_0x9f99bb){return function(_0x118726){if(!_0x118726){_0xf7de89[_0xf106('0x18')](0x194);}return _0x118726;};}function handleError(_0x14b15e,_0x468fce){_0x468fce=_0x468fce||0x1f4;return function(_0x225c15){logger['error'](_0x225c15['stack']);if(_0x225c15['name']){delete _0x225c15[_0xf106('0x27')];}_0x14b15e[_0xf106('0x1e')](_0x468fce)[_0xf106('0x28')](_0x225c15);};}exports[_0xf106('0x29')]=function(_0x4265b3,_0x13b5d7){var _0x4f90d1={},_0x1394e8={},_0x269bff={'count':0x0,'rows':[]};var _0x1f8323=_[_0xf106('0x2a')](db['Cdr'][_0xf106('0x2b')],function(_0x444bde){return{'name':_0x444bde[_0xf106('0x2c')],'type':_0x444bde[_0xf106('0x2d')][_0xf106('0x2e')]};});_0x1394e8[_0xf106('0x2f')]=_['map'](_0x1f8323,_0xf106('0x27'));_0x1394e8[_0xf106('0x30')]=_[_0xf106('0x31')](_0x4265b3[_0xf106('0x30')]);_0x1394e8['filters']=_[_0xf106('0x32')](_0x1394e8[_0xf106('0x2f')],_0x1394e8['query']);_0x4f90d1[_0xf106('0x33')]=_[_0xf106('0x32')](_0x1394e8[_0xf106('0x2f')],qs[_0xf106('0x34')](_0x4265b3[_0xf106('0x30')][_0xf106('0x34')]));_0x4f90d1[_0xf106('0x33')]=_0x4f90d1[_0xf106('0x33')][_0xf106('0x35')]?_0x4f90d1[_0xf106('0x33')]:_0x1394e8[_0xf106('0x2f')];if(!_0x4265b3['query']['hasOwnProperty'](_0xf106('0x36'))){_0x4f90d1[_0xf106('0x1b')]=qs[_0xf106('0x1b')](_0x4265b3['query'][_0xf106('0x1b')]);_0x4f90d1[_0xf106('0x1a')]=qs[_0xf106('0x1a')](_0x4265b3[_0xf106('0x30')][_0xf106('0x1a')]);}_0x4f90d1['order']=qs[_0xf106('0x37')](_0x4265b3['query'][_0xf106('0x37')]);_0x4f90d1[_0xf106('0x38')]=qs[_0xf106('0x39')](_[_0xf106('0x3a')](_0x4265b3['query'],_0x1394e8[_0xf106('0x39')]),_0x1f8323);if(_0x4265b3[_0xf106('0x30')][_0xf106('0x3b')]){_0x4f90d1['where']=_['merge'](_0x4f90d1['where'],{'$or':_['map'](_0x1f8323,function(_0x58dba7){if(_0x58dba7[_0xf106('0x2d')]!=='VIRTUAL'){var _0x4beb79={};_0x4beb79[_0x58dba7[_0xf106('0x27')]]={'$like':'%'+_0x4265b3['query']['filter']+'%'};return _0x4beb79;}})});}_0x4f90d1=_[_0xf106('0x3c')]({},_0x4f90d1,_0x4265b3[_0xf106('0x3d')]);var _0x2d4c90={'where':_0x4f90d1[_0xf106('0x38')]};return db['Cdr'][_0xf106('0x1d')](_0x2d4c90)[_0xf106('0x24')](function(_0x583a72){_0x269bff[_0xf106('0x1d')]=_0x583a72;if(_0x4265b3[_0xf106('0x30')][_0xf106('0x3e')]){_0x4f90d1[_0xf106('0x3f')]=[{'all':!![]}];}return db[_0xf106('0x40')][_0xf106('0x41')](_0x4f90d1);})[_0xf106('0x24')](function(_0x57d61e){_0x269bff['rows']=_0x57d61e;return _0x269bff;})[_0xf106('0x24')](respondWithFilteredResult(_0x13b5d7,_0x4f90d1))['catch'](handleError(_0x13b5d7,null));};exports['show']=function(_0x37bb28,_0x390eee){var _0x5e6cb8={'raw':!![],'where':{'id':_0x37bb28[_0xf106('0x42')]['id']}},_0x47f4d3={};_0x47f4d3['model']=_[_0xf106('0x31')](db[_0xf106('0x40')][_0xf106('0x2b')]);_0x47f4d3[_0xf106('0x30')]=_[_0xf106('0x31')](_0x37bb28[_0xf106('0x30')]);_0x47f4d3[_0xf106('0x39')]=_[_0xf106('0x32')](_0x47f4d3[_0xf106('0x2f')],_0x47f4d3[_0xf106('0x30')]);_0x5e6cb8[_0xf106('0x33')]=_[_0xf106('0x32')](_0x47f4d3[_0xf106('0x2f')],qs[_0xf106('0x34')](_0x37bb28[_0xf106('0x30')][_0xf106('0x34')]));_0x5e6cb8[_0xf106('0x33')]=_0x5e6cb8[_0xf106('0x33')]['length']?_0x5e6cb8[_0xf106('0x33')]:_0x47f4d3[_0xf106('0x2f')];if(_0x37bb28[_0xf106('0x30')][_0xf106('0x3e')]){_0x5e6cb8[_0xf106('0x3f')]=[{'all':!![]}];}_0x5e6cb8=_['merge']({},_0x5e6cb8,_0x37bb28['options']);return db['Cdr']['find'](_0x5e6cb8)[_0xf106('0x24')](handleEntityNotFound(_0x390eee,null))['then'](respondWithResult(_0x390eee,null))['catch'](handleError(_0x390eee,null));};exports[_0xf106('0x43')]=function(_0x1a686d,_0xd50443){return db[_0xf106('0x40')]['create'](_0x1a686d[_0xf106('0x44')],{})[_0xf106('0x24')](respondWithResult(_0xd50443,0xc9))[_0xf106('0x45')](handleError(_0xd50443,null));};exports[_0xf106('0x23')]=function(_0x1bf065,_0x519192){if(_0x1bf065['body']['id']){delete _0x1bf065[_0xf106('0x44')]['id'];}return db[_0xf106('0x40')][_0xf106('0x46')]({'where':{'id':_0x1bf065['params']['id']}})[_0xf106('0x24')](handleEntityNotFound(_0x519192,null))[_0xf106('0x24')](saveUpdates(_0x1bf065[_0xf106('0x44')],null))[_0xf106('0x24')](respondWithResult(_0x519192,null))['catch'](handleError(_0x519192,null));};exports[_0xf106('0x25')]=function(_0x5b80a8,_0x50798d){return db[_0xf106('0x40')][_0xf106('0x46')]({'where':{'id':_0x5b80a8['params']['id']}})[_0xf106('0x24')](handleEntityNotFound(_0x50798d,null))[_0xf106('0x24')](removeEntity(_0x50798d,null))[_0xf106('0x45')](handleError(_0x50798d,null));};exports[_0xf106('0x47')]=function(_0x14375d,_0x391e3d){return db['Cdr']['describe']()[_0xf106('0x24')](respondWithResult(_0x391e3d,null))['catch'](handleError(_0x391e3d,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index c629441..ebd3061 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x465812,_0x2f56f6){var _0x4408c8=function(_0x2e3255){while(--_0x2e3255){_0x465812['push'](_0x465812['shift']());}};_0x4408c8(++_0x2f56f6);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x631475,_0x44f08d){var _0x1c569f=function(_0xbe196){while(--_0xbe196){_0x631475['push'](_0x631475['shift']());}};_0x1c569f(++_0x44f08d);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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 bca08bd..9880813 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 _0xba8b=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Cdr,\x20%s,\x20%s','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util'];(function(_0x3ff97b,_0x459934){var _0x43ab91=function(_0x771d6f){while(--_0x771d6f){_0x3ff97b['push'](_0x3ff97b['shift']());}};_0x43ab91(++_0x459934);}(_0xba8b,0x6c));var _0xbba8=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xba8b[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xbba8('0x0'));var util=require(_0xbba8('0x1'));var moment=require('moment');var BPromise=require(_0xbba8('0x2'));var rs=require(_0xbba8('0x3'));var fs=require('fs');var Redis=require(_0xbba8('0x4'));var db=require(_0xbba8('0x5'))['db'];var utils=require(_0xbba8('0x6'));var logger=require(_0xbba8('0x7'))(_0xbba8('0x8'));var config=require(_0xbba8('0x9'));var jayson=require(_0xbba8('0xa'));var client=jayson[_0xbba8('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x261783,_0x29bdfc,_0x3a183a){return new BPromise(function(_0x127e7b,_0x43a427){return client[_0xbba8('0xc')](_0x261783,_0x3a183a)['then'](function(_0x3afaaa){logger[_0xbba8('0xd')](_0xbba8('0xe'),_0x29bdfc,'request\x20sent');logger['debug'](_0xbba8('0xf'),_0x29bdfc,_0xbba8('0x10'),JSON[_0xbba8('0x11')](_0x3afaaa));if(_0x3afaaa[_0xbba8('0x12')]){if(_0x3afaaa[_0xbba8('0x12')][_0xbba8('0x13')]===0x1f4){logger['error'](_0xbba8('0xe'),_0x29bdfc,_0x3afaaa['error'][_0xbba8('0x14')]);return _0x43a427(_0x3afaaa[_0xbba8('0x12')][_0xbba8('0x14')]);}logger[_0xbba8('0x12')](_0xbba8('0xe'),_0x29bdfc,_0x3afaaa[_0xbba8('0x12')][_0xbba8('0x14')]);return _0x127e7b(_0x3afaaa['error'][_0xbba8('0x14')]);}else{logger['info'](_0xbba8('0xe'),_0x29bdfc,_0xbba8('0x10'));_0x127e7b(_0x3afaaa[_0xbba8('0x15')][_0xbba8('0x14')]);}})['catch'](function(_0x58f5fa){logger[_0xbba8('0x12')](_0xbba8('0xe'),_0x29bdfc,_0x58f5fa);_0x43a427(_0x58f5fa);});});} \ No newline at end of file +var _0x93e3=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','util','moment','randomstring'];(function(_0x464c48,_0xb5c970){var _0x4305f0=function(_0x1d9338){while(--_0x1d9338){_0x464c48['push'](_0x464c48['shift']());}};_0x4305f0(++_0xb5c970);}(_0x93e3,0xad));var _0x393e=function(_0x57eb2d,_0x5e4918){_0x57eb2d=_0x57eb2d-0x0;var _0xd8e18=_0x93e3[_0x57eb2d];return _0xd8e18;};'use strict';var _=require('lodash');var util=require(_0x393e('0x0'));var moment=require(_0x393e('0x1'));var BPromise=require('bluebird');var rs=require(_0x393e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x393e('0x3'))['db'];var utils=require(_0x393e('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x393e('0x5'));var jayson=require(_0x393e('0x6'));var client=jayson[_0x393e('0x7')][_0x393e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x44d4f9,_0x7b1ee2,_0x30b84c){return new BPromise(function(_0x357029,_0x4b5d21){return client[_0x393e('0x9')](_0x44d4f9,_0x30b84c)[_0x393e('0xa')](function(_0xcdb1a5){logger[_0x393e('0xb')](_0x393e('0xc'),_0x7b1ee2,'request\x20sent');logger[_0x393e('0xd')](_0x393e('0xe'),_0x7b1ee2,'request\x20sent',JSON[_0x393e('0xf')](_0xcdb1a5));if(_0xcdb1a5['error']){if(_0xcdb1a5['error'][_0x393e('0x10')]===0x1f4){logger[_0x393e('0x11')](_0x393e('0xc'),_0x7b1ee2,_0xcdb1a5['error'][_0x393e('0x12')]);return _0x4b5d21(_0xcdb1a5['error'][_0x393e('0x12')]);}logger[_0x393e('0x11')](_0x393e('0xc'),_0x7b1ee2,_0xcdb1a5[_0x393e('0x11')]['message']);return _0x357029(_0xcdb1a5[_0x393e('0x11')][_0x393e('0x12')]);}else{logger[_0x393e('0xb')](_0x393e('0xc'),_0x7b1ee2,_0x393e('0x13'));_0x357029(_0xcdb1a5[_0x393e('0x14')][_0x393e('0x12')]);}})[_0x393e('0x15')](function(_0x3b03c2){logger[_0x393e('0x11')]('Cdr,\x20%s,\x20%s',_0x7b1ee2,_0x3b03c2);_0x4b5d21(_0x3b03c2);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 803097e..5d3ec31 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x226038,_0x9baba7){var _0x44f573=function(_0x2f4749){while(--_0x2f4749){_0x226038['push'](_0x226038['shift']());}};_0x44f573(++_0x9baba7);}(_0xb10b,0x12a));var _0xbb10=function(_0x147686,_0x292c6a){_0x147686=_0x147686-0x0;var _0x4db1b8=_0xb10b[_0x147686];return _0x4db1b8;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file +var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 05f4968..0ee3072 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 _0x3843=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x16b1a5,_0x318267){var _0x475e25=function(_0x2e3bf6){while(--_0x2e3bf6){_0x16b1a5['push'](_0x16b1a5['shift']());}};_0x475e25(++_0x318267);}(_0x3843,0xd0));var _0x3384=function(_0x43d4ec,_0x4ceb2b){_0x43d4ec=_0x43d4ec-0x0;var _0x4d2d07=_0x3843[_0x43d4ec];return _0x4d2d07;};'use strict';var Sequelize=require(_0x3384('0x0'));module[_0x3384('0x1')]={'priority':{'type':Sequelize[_0x3384('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x3384('0x3')],'allowNull':![],'defaultValue':_0x3384('0x4')},'appdata':{'type':Sequelize[_0x3384('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x3384('0x6')}}; \ No newline at end of file +var _0x6cbb=['STRING','sequelize','exports','noop','TEXT'];(function(_0x7c3c27,_0x16c034){var _0x4a2c4b=function(_0x293b82){while(--_0x293b82){_0x7c3c27['push'](_0x7c3c27['shift']());}};_0x4a2c4b(++_0x16c034);}(_0x6cbb,0x119));var _0xb6cb=function(_0x1f9baf,_0x3332cc){_0x1f9baf=_0x1f9baf-0x0;var _0x2435ad=_0x6cbb[_0x1f9baf];return _0x2435ad;};'use strict';var Sequelize=require(_0xb6cb('0x0'));module[_0xb6cb('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb6cb('0x2')},'appdata':{'type':Sequelize[_0xb6cb('0x3')]()},'description':{'type':Sequelize[_0xb6cb('0x4')]},'interval':{'type':Sequelize[_0xb6cb('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 82712c1..37467b1 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 _0x3495=['options','ChatApplication','find','body','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','save','update','then','destroy','error','name','send','show','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','include','merge'];(function(_0x464565,_0x2b5d7c){var _0x5eef21=function(_0x26c60f){while(--_0x26c60f){_0x464565['push'](_0x464565['shift']());}};_0x5eef21(++_0x2b5d7c);}(_0x3495,0x1de));var _0x5349=function(_0x52216a,_0x52aa48){_0x52216a=_0x52216a-0x0;var _0x389249=_0x3495[_0x52216a];return _0x389249;};'use strict';var emlformat=require(_0x5349('0x0'));var rimraf=require(_0x5349('0x1'));var zipdir=require(_0x5349('0x2'));var jsonpatch=require(_0x5349('0x3'));var rp=require(_0x5349('0x4'));var moment=require(_0x5349('0x5'));var BPromise=require(_0x5349('0x6'));var Mustache=require(_0x5349('0x7'));var util=require(_0x5349('0x8'));var path=require('path');var sox=require(_0x5349('0x9'));var csv=require(_0x5349('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5349('0xb'));var _=require('lodash');var squel=require(_0x5349('0xc'));var crypto=require('crypto');var jsforce=require(_0x5349('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5349('0xa'));var querystring=require(_0x5349('0xe'));var Papa=require(_0x5349('0xf'));var Redis=require(_0x5349('0x10'));var authService=require(_0x5349('0x11'));var qs=require(_0x5349('0x12'));var as=require(_0x5349('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5349('0x14'))('api');var utils=require(_0x5349('0x15'));var config=require(_0x5349('0x16'));var licenseUtil=require(_0x5349('0x17'));var db=require(_0x5349('0x18'))['db'];function respondWithStatusCode(_0x2f5172,_0x3c592a){_0x3c592a=_0x3c592a||0xcc;return function(_0x642966){if(_0x642966){return _0x2f5172[_0x5349('0x19')](_0x3c592a);}return _0x2f5172[_0x5349('0x1a')](_0x3c592a)[_0x5349('0x1b')]();};}function respondWithResult(_0x534e31,_0x2fde66){_0x2fde66=_0x2fde66||0xc8;return function(_0x367c25){if(_0x367c25){return _0x534e31['status'](_0x2fde66)[_0x5349('0x1c')](_0x367c25);}};}function respondWithFilteredResult(_0x269f7f,_0x2fe611){return function(_0x49bbec){if(_0x49bbec){var _0x5bcb3a=typeof _0x2fe611['offset']===_0x5349('0x1d')&&typeof _0x2fe611['limit']===_0x5349('0x1d');var _0x5f3cfb=_0x49bbec[_0x5349('0x1e')];var _0x2c1f1=_0x5bcb3a?0x0:_0x2fe611[_0x5349('0x1f')];var _0x132639=_0x5bcb3a?_0x49bbec['count']:_0x2fe611[_0x5349('0x1f')]+_0x2fe611[_0x5349('0x20')];var _0x8abbe3;if(_0x132639>=_0x5f3cfb){_0x132639=_0x5f3cfb;_0x8abbe3=0xc8;}else{_0x8abbe3=0xce;}_0x269f7f[_0x5349('0x1a')](_0x8abbe3);return _0x269f7f['set'](_0x5349('0x21'),_0x2c1f1+'-'+_0x132639+'/'+_0x5f3cfb)[_0x5349('0x1c')](_0x49bbec);}return null;};}function patchUpdates(_0x4f2cb6){return function(_0x4c96dc){try{jsonpatch['apply'](_0x4c96dc,_0x4f2cb6,!![]);}catch(_0x423581){return BPromise['reject'](_0x423581);}return _0x4c96dc[_0x5349('0x22')]();};}function saveUpdates(_0x1ff911,_0x164978){return function(_0x6c80cd){if(_0x6c80cd){return _0x6c80cd[_0x5349('0x23')](_0x1ff911)[_0x5349('0x24')](function(_0x303250){return _0x303250;});}return null;};}function removeEntity(_0x43a0c2,_0x2a3258){return function(_0x34353f){if(_0x34353f){return _0x34353f[_0x5349('0x25')]()[_0x5349('0x24')](function(){_0x43a0c2['status'](0xcc)[_0x5349('0x1b')]();});}};}function handleEntityNotFound(_0x187b39,_0x41d67e){return function(_0x49435a){if(!_0x49435a){_0x187b39[_0x5349('0x19')](0x194);}return _0x49435a;};}function handleError(_0x5068fa,_0x1afba7){_0x1afba7=_0x1afba7||0x1f4;return function(_0x203896){logger[_0x5349('0x26')](_0x203896['stack']);if(_0x203896[_0x5349('0x27')]){delete _0x203896[_0x5349('0x27')];}_0x5068fa[_0x5349('0x1a')](_0x1afba7)[_0x5349('0x28')](_0x203896);};}exports[_0x5349('0x29')]=function(_0x16edcb,_0x3b6faa){var _0x463a42={'raw':!![],'where':{'id':_0x16edcb['params']['id']}},_0x39b3a9={};_0x39b3a9[_0x5349('0x2a')]=_[_0x5349('0x2b')](db['ChatApplication'][_0x5349('0x2c')]);_0x39b3a9['query']=_[_0x5349('0x2b')](_0x16edcb[_0x5349('0x2d')]);_0x39b3a9[_0x5349('0x2e')]=_[_0x5349('0x2f')](_0x39b3a9[_0x5349('0x2a')],_0x39b3a9[_0x5349('0x2d')]);_0x463a42['attributes']=_[_0x5349('0x2f')](_0x39b3a9[_0x5349('0x2a')],qs[_0x5349('0x30')](_0x16edcb[_0x5349('0x2d')]['fields']));_0x463a42['attributes']=_0x463a42[_0x5349('0x31')][_0x5349('0x32')]?_0x463a42[_0x5349('0x31')]:_0x39b3a9['model'];if(_0x16edcb[_0x5349('0x2d')]['includeAll']){_0x463a42[_0x5349('0x33')]=[{'all':!![]}];}_0x463a42=_[_0x5349('0x34')]({},_0x463a42,_0x16edcb[_0x5349('0x35')]);return db[_0x5349('0x36')][_0x5349('0x37')](_0x463a42)[_0x5349('0x24')](handleEntityNotFound(_0x3b6faa,null))['then'](respondWithResult(_0x3b6faa,null))['catch'](handleError(_0x3b6faa,null));};exports[_0x5349('0x23')]=function(_0x27280e,_0x1be201){if(_0x27280e[_0x5349('0x38')]['id']){delete _0x27280e[_0x5349('0x38')]['id'];}return db[_0x5349('0x36')][_0x5349('0x37')]({'where':{'id':_0x27280e['params']['id']}})['then'](handleEntityNotFound(_0x1be201,null))[_0x5349('0x24')](saveUpdates(_0x27280e['body'],null))['then'](respondWithResult(_0x1be201,null))[_0x5349('0x39')](handleError(_0x1be201,null));};exports['destroy']=function(_0x18f881,_0xa58d2a){return db[_0x5349('0x36')]['find']({'where':{'id':_0x18f881[_0x5349('0x3a')]['id']}})['then'](handleEntityNotFound(_0xa58d2a,null))[_0x5349('0x24')](removeEntity(_0xa58d2a,null))[_0x5349('0x39')](handleError(_0xa58d2a,null));}; \ No newline at end of file +var _0x2179=['then','destroy','name','send','show','model','keys','ChatApplication','rawAttributes','query','intersection','attributes','fields','includeAll','options','catch','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update'];(function(_0x6c6d75,_0xef7deb){var _0x48a161=function(_0xf0fba0){while(--_0xf0fba0){_0x6c6d75['push'](_0x6c6d75['shift']());}};_0x48a161(++_0xef7deb);}(_0x2179,0xc0));var _0x9217=function(_0x25e2bc,_0x27d1ef){_0x25e2bc=_0x25e2bc-0x0;var _0x5152d3=_0x2179[_0x25e2bc];return _0x5152d3;};'use strict';var emlformat=require(_0x9217('0x0'));var rimraf=require(_0x9217('0x1'));var zipdir=require(_0x9217('0x2'));var jsonpatch=require(_0x9217('0x3'));var rp=require(_0x9217('0x4'));var moment=require(_0x9217('0x5'));var BPromise=require(_0x9217('0x6'));var Mustache=require(_0x9217('0x7'));var util=require(_0x9217('0x8'));var path=require(_0x9217('0x9'));var sox=require(_0x9217('0xa'));var csv=require(_0x9217('0xb'));var ejs=require(_0x9217('0xc'));var fs=require('fs');var fs_extra=require(_0x9217('0xd'));var _=require(_0x9217('0xe'));var squel=require('squel');var crypto=require(_0x9217('0xf'));var jsforce=require(_0x9217('0x10'));var deskjs=require(_0x9217('0x11'));var toCsv=require(_0x9217('0xb'));var querystring=require(_0x9217('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9217('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9217('0x14'));var hardwareService=require(_0x9217('0x15'));var logger=require(_0x9217('0x16'))('api');var utils=require(_0x9217('0x17'));var config=require(_0x9217('0x18'));var licenseUtil=require(_0x9217('0x19'));var db=require(_0x9217('0x1a'))['db'];function respondWithStatusCode(_0x203aa8,_0xb21639){_0xb21639=_0xb21639||0xcc;return function(_0x11c99d){if(_0x11c99d){return _0x203aa8[_0x9217('0x1b')](_0xb21639);}return _0x203aa8['status'](_0xb21639)[_0x9217('0x1c')]();};}function respondWithResult(_0x482dbc,_0x3a4473){_0x3a4473=_0x3a4473||0xc8;return function(_0x21da75){if(_0x21da75){return _0x482dbc[_0x9217('0x1d')](_0x3a4473)[_0x9217('0x1e')](_0x21da75);}};}function respondWithFilteredResult(_0x2e27d8,_0x1e1a2e){return function(_0x3f6977){if(_0x3f6977){var _0x13c330=typeof _0x1e1a2e[_0x9217('0x1f')]===_0x9217('0x20')&&typeof _0x1e1a2e[_0x9217('0x21')]===_0x9217('0x20');var _0x179379=_0x3f6977[_0x9217('0x22')];var _0x1e29e4=_0x13c330?0x0:_0x1e1a2e[_0x9217('0x1f')];var _0x3168a3=_0x13c330?_0x3f6977[_0x9217('0x22')]:_0x1e1a2e[_0x9217('0x1f')]+_0x1e1a2e[_0x9217('0x21')];var _0x43e5bb;if(_0x3168a3>=_0x179379){_0x3168a3=_0x179379;_0x43e5bb=0xc8;}else{_0x43e5bb=0xce;}_0x2e27d8[_0x9217('0x1d')](_0x43e5bb);return _0x2e27d8[_0x9217('0x23')](_0x9217('0x24'),_0x1e29e4+'-'+_0x3168a3+'/'+_0x179379)[_0x9217('0x1e')](_0x3f6977);}return null;};}function patchUpdates(_0x3af8ab){return function(_0x32c877){try{jsonpatch[_0x9217('0x25')](_0x32c877,_0x3af8ab,!![]);}catch(_0x3f3814){return BPromise[_0x9217('0x26')](_0x3f3814);}return _0x32c877['save']();};}function saveUpdates(_0x78e5c,_0x1f9a22){return function(_0x15f107){if(_0x15f107){return _0x15f107[_0x9217('0x27')](_0x78e5c)[_0x9217('0x28')](function(_0x1d1bf5){return _0x1d1bf5;});}return null;};}function removeEntity(_0x53f2b8,_0x1205eb){return function(_0x362c5b){if(_0x362c5b){return _0x362c5b[_0x9217('0x29')]()['then'](function(){_0x53f2b8[_0x9217('0x1d')](0xcc)[_0x9217('0x1c')]();});}};}function handleEntityNotFound(_0x10a9c2,_0x3740fd){return function(_0x41b16c){if(!_0x41b16c){_0x10a9c2[_0x9217('0x1b')](0x194);}return _0x41b16c;};}function handleError(_0x5854b7,_0x28656d){_0x28656d=_0x28656d||0x1f4;return function(_0x1fb79c){logger['error'](_0x1fb79c['stack']);if(_0x1fb79c['name']){delete _0x1fb79c[_0x9217('0x2a')];}_0x5854b7[_0x9217('0x1d')](_0x28656d)[_0x9217('0x2b')](_0x1fb79c);};}exports[_0x9217('0x2c')]=function(_0x52fbf4,_0xc30fc9){var _0x3947b4={'raw':!![],'where':{'id':_0x52fbf4['params']['id']}},_0x5c0563={};_0x5c0563[_0x9217('0x2d')]=_[_0x9217('0x2e')](db[_0x9217('0x2f')][_0x9217('0x30')]);_0x5c0563['query']=_['keys'](_0x52fbf4[_0x9217('0x31')]);_0x5c0563['filters']=_[_0x9217('0x32')](_0x5c0563[_0x9217('0x2d')],_0x5c0563[_0x9217('0x31')]);_0x3947b4[_0x9217('0x33')]=_[_0x9217('0x32')](_0x5c0563[_0x9217('0x2d')],qs[_0x9217('0x34')](_0x52fbf4['query'][_0x9217('0x34')]));_0x3947b4[_0x9217('0x33')]=_0x3947b4[_0x9217('0x33')]['length']?_0x3947b4[_0x9217('0x33')]:_0x5c0563[_0x9217('0x2d')];if(_0x52fbf4['query'][_0x9217('0x35')]){_0x3947b4['include']=[{'all':!![]}];}_0x3947b4=_['merge']({},_0x3947b4,_0x52fbf4[_0x9217('0x36')]);return db['ChatApplication']['find'](_0x3947b4)[_0x9217('0x28')](handleEntityNotFound(_0xc30fc9,null))['then'](respondWithResult(_0xc30fc9,null))[_0x9217('0x37')](handleError(_0xc30fc9,null));};exports[_0x9217('0x27')]=function(_0x1ec5b4,_0x59ec08){if(_0x1ec5b4[_0x9217('0x38')]['id']){delete _0x1ec5b4[_0x9217('0x38')]['id'];}return db[_0x9217('0x2f')]['find']({'where':{'id':_0x1ec5b4[_0x9217('0x39')]['id']}})['then'](handleEntityNotFound(_0x59ec08,null))[_0x9217('0x28')](saveUpdates(_0x1ec5b4[_0x9217('0x38')],null))[_0x9217('0x28')](respondWithResult(_0x59ec08,null))['catch'](handleError(_0x59ec08,null));};exports['destroy']=function(_0x3336a0,_0x20d50a){return db[_0x9217('0x2f')]['find']({'where':{'id':_0x3336a0[_0x9217('0x39')]['id']}})['then'](handleEntityNotFound(_0x20d50a,null))[_0x9217('0x28')](removeEntity(_0x20d50a,null))[_0x9217('0x37')](handleError(_0x20d50a,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index d25ab05..8c4d1ff 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 _0x05ce=['../../config/environment','./chatApplication.attributes','exports','define','chat_applications','utf8mb4_unicode_ci','util','../../config/logger','rimraf'];(function(_0x50180c,_0x3fc232){var _0x5eaa41=function(_0x24fe64){while(--_0x24fe64){_0x50180c['push'](_0x50180c['shift']());}};_0x5eaa41(++_0x3fc232);}(_0x05ce,0xcc));var _0xe05c=function(_0x15a413,_0x292f89){_0x15a413=_0x15a413-0x0;var _0x3f09fc=_0x05ce[_0x15a413];return _0x3f09fc;};'use strict';var _=require('lodash');var util=require(_0xe05c('0x0'));var logger=require(_0xe05c('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe05c('0x2'));var config=require(_0xe05c('0x3'));var attributes=require(_0xe05c('0x4'));module[_0xe05c('0x5')]=function(_0x362f02,_0x4d9d17){return _0x362f02[_0xe05c('0x6')]('ChatApplication',attributes,{'tableName':_0xe05c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe05c('0x8')});}; \ No newline at end of file +var _0x782b=['bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x286731,_0x116916){var _0x50f5a5=function(_0x18ef71){while(--_0x18ef71){_0x286731['push'](_0x286731['shift']());}};_0x50f5a5(++_0x116916);}(_0x782b,0xa3));var _0xb782=function(_0x18ebd4,_0x318045){_0x18ebd4=_0x18ebd4-0x0;var _0x37960f=_0x782b[_0x18ebd4];return _0x37960f;};'use strict';var _=require(_0xb782('0x0'));var util=require(_0xb782('0x1'));var logger=require(_0xb782('0x2'))(_0xb782('0x3'));var moment=require(_0xb782('0x4'));var BPromise=require(_0xb782('0x5'));var rp=require(_0xb782('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb782('0x7'));var config=require(_0xb782('0x8'));var attributes=require(_0xb782('0x9'));module['exports']=function(_0x3491e4,_0x2a6c07){return _0x3491e4[_0xb782('0xa')]('ChatApplication',attributes,{'tableName':_0xb782('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb782('0xc'),'collate':_0xb782('0xd')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 6166648..207bb0f 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 _0x413b=['ChatApplication,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xffcbcb,_0x1e1b55){var _0x224156=function(_0x3ff336){while(--_0x3ff336){_0xffcbcb['push'](_0xffcbcb['shift']());}};_0x224156(++_0x1e1b55);}(_0x413b,0x1a5));var _0xb413=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x413b[_0x54d4a8];return _0x3b321b;};'use strict';var _=require(_0xb413('0x0'));var util=require(_0xb413('0x1'));var moment=require(_0xb413('0x2'));var BPromise=require(_0xb413('0x3'));var rs=require(_0xb413('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb413('0x5'))['db'];var utils=require(_0xb413('0x6'));var logger=require(_0xb413('0x7'))(_0xb413('0x8'));var config=require(_0xb413('0x9'));var jayson=require(_0xb413('0xa'));var client=jayson[_0xb413('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x352d37,_0x349bbf,_0x57c2c0){return new BPromise(function(_0x2ff059,_0xff33e){return client[_0xb413('0xc')](_0x352d37,_0x57c2c0)['then'](function(_0x5d2e07){logger[_0xb413('0xd')]('ChatApplication,\x20%s,\x20%s',_0x349bbf,_0xb413('0xe'));logger['debug'](_0xb413('0xf'),_0x349bbf,_0xb413('0xe'),JSON[_0xb413('0x10')](_0x5d2e07));if(_0x5d2e07[_0xb413('0x11')]){if(_0x5d2e07[_0xb413('0x11')][_0xb413('0x12')]===0x1f4){logger[_0xb413('0x11')](_0xb413('0x13'),_0x349bbf,_0x5d2e07['error']['message']);return _0xff33e(_0x5d2e07['error'][_0xb413('0x14')]);}logger[_0xb413('0x11')](_0xb413('0x13'),_0x349bbf,_0x5d2e07['error'][_0xb413('0x14')]);return _0x2ff059(_0x5d2e07[_0xb413('0x11')]['message']);}else{logger[_0xb413('0xd')](_0xb413('0x13'),_0x349bbf,'request\x20sent');_0x2ff059(_0x5d2e07[_0xb413('0x15')][_0xb413('0x14')]);}})['catch'](function(_0x547af6){logger[_0xb413('0x11')](_0xb413('0x13'),_0x349bbf,_0x547af6);_0xff33e(_0x547af6);});});} \ No newline at end of file +var _0x4167=['error','code','message','result','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x4167,0x13f));var _0x7416=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4167[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7416('0x0'));var moment=require('moment');var BPromise=require(_0x7416('0x1'));var rs=require(_0x7416('0x2'));var fs=require('fs');var Redis=require(_0x7416('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7416('0x4'))(_0x7416('0x5'));var config=require(_0x7416('0x6'));var jayson=require(_0x7416('0x7'));var client=jayson[_0x7416('0x8')][_0x7416('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe037f9,_0x1ae706,_0x48fc29){return new BPromise(function(_0x294750,_0x487b03){return client[_0x7416('0xa')](_0xe037f9,_0x48fc29)[_0x7416('0xb')](function(_0x3a9534){logger[_0x7416('0xc')](_0x7416('0xd'),_0x1ae706,_0x7416('0xe'));logger[_0x7416('0xf')](_0x7416('0x10'),_0x1ae706,_0x7416('0xe'),JSON['stringify'](_0x3a9534));if(_0x3a9534[_0x7416('0x11')]){if(_0x3a9534[_0x7416('0x11')][_0x7416('0x12')]===0x1f4){logger[_0x7416('0x11')](_0x7416('0xd'),_0x1ae706,_0x3a9534['error']['message']);return _0x487b03(_0x3a9534['error'][_0x7416('0x13')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x1ae706,_0x3a9534[_0x7416('0x11')][_0x7416('0x13')]);return _0x294750(_0x3a9534[_0x7416('0x11')]['message']);}else{logger[_0x7416('0xc')](_0x7416('0xd'),_0x1ae706,_0x7416('0xe'));_0x294750(_0x3a9534[_0x7416('0x14')][_0x7416('0x13')]);}})['catch'](function(_0x2f9787){logger['error']('ChatApplication,\x20%s,\x20%s',_0x1ae706,_0x2f9787);_0x487b03(_0x2f9787);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 387ec88..bb1edf5 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 _0x42b7=['get','/:id','isAuthenticated','show','put','update','destroy','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2e5a5f,_0x3bdb80){var _0xf94c46=function(_0x3d8698){while(--_0x3d8698){_0x2e5a5f['push'](_0x2e5a5f['shift']());}};_0xf94c46(++_0x3bdb80);}(_0x42b7,0x1d5));var _0x742b=function(_0x49cb02,_0x616e8a){_0x49cb02=_0x49cb02-0x0;var _0x945631=_0x42b7[_0x49cb02];return _0x945631;};'use strict';var multer=require(_0x742b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x742b('0x1'));var router=express[_0x742b('0x2')]();var fs_extra=require(_0x742b('0x3'));var auth=require(_0x742b('0x4'));var interaction=require(_0x742b('0x5'));var config=require(_0x742b('0x6'));var controller=require('./chatApplication.controller');router[_0x742b('0x7')](_0x742b('0x8'),auth[_0x742b('0x9')](),controller[_0x742b('0xa')]);router[_0x742b('0xb')](_0x742b('0x8'),auth[_0x742b('0x9')](),controller[_0x742b('0xc')]);router['delete'](_0x742b('0x8'),auth[_0x742b('0x9')](),controller[_0x742b('0xd')]);module['exports']=router; \ No newline at end of file +var _0xfbd9=['multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','show','put','isAuthenticated','update','delete','destroy','exports'];(function(_0x1efa5c,_0x4deafb){var _0x4f8376=function(_0x132a82){while(--_0x132a82){_0x1efa5c['push'](_0x1efa5c['shift']());}};_0x4f8376(++_0x4deafb);}(_0xfbd9,0x1b0));var _0x9fbd=function(_0x5c66d9,_0x1231c3){_0x5c66d9=_0x5c66d9-0x0;var _0x5a486d=_0xfbd9[_0x5c66d9];return _0x5a486d;};'use strict';var multer=require(_0x9fbd('0x0'));var util=require(_0x9fbd('0x1'));var path=require(_0x9fbd('0x2'));var timeout=require('connect-timeout');var express=require(_0x9fbd('0x3'));var router=express[_0x9fbd('0x4')]();var fs_extra=require(_0x9fbd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9fbd('0x6'));var config=require(_0x9fbd('0x7'));var controller=require(_0x9fbd('0x8'));router[_0x9fbd('0x9')](_0x9fbd('0xa'),auth['isAuthenticated'](),controller[_0x9fbd('0xb')]);router[_0x9fbd('0xc')](_0x9fbd('0xa'),auth[_0x9fbd('0xd')](),controller[_0x9fbd('0xe')]);router[_0x9fbd('0xf')](_0x9fbd('0xa'),auth['isAuthenticated'](),controller[_0x9fbd('0x10')]);module[_0x9fbd('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 026fe93..4bf1f7b 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 _0x363e=['BOOLEAN','sequelize','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x363e,0x179));var _0xe363=function(_0x3536a7,_0x38897a){_0x3536a7=_0x3536a7-0x0;var _0x32d1bb=_0x363e[_0x3536a7];return _0x32d1bb;};'use strict';var Sequelize=require(_0xe363('0x0'));module[_0xe363('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xe363('0x2')]},'write':{'type':Sequelize[_0xe363('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x2d2c=['exports','STRING','BOOLEAN','sequelize'];(function(_0x1fee0f,_0x49c9e6){var _0x23998e=function(_0x57d3d5){while(--_0x57d3d5){_0x1fee0f['push'](_0x1fee0f['shift']());}};_0x23998e(++_0x49c9e6);}(_0x2d2c,0x1d7));var _0xc2d2=function(_0x28b4cd,_0x573ff1){_0x28b4cd=_0x28b4cd-0x0;var _0x4229cc=_0x2d2c[_0x28b4cd];return _0x4229cc;};'use strict';var Sequelize=require(_0xc2d2('0x0'));module[_0xc2d2('0x1')]={'name':{'type':Sequelize[_0xc2d2('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc2d2('0x2')]},'write':{'type':Sequelize[_0xc2d2('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 4ff35c1..a2c217d 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 _0xe037=['offset','set','Content-Range','json','reject','save','then','destroy','stack','send','index','map','ChatGroup','rawAttributes','fieldName','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','findOne','User','order','getMembers','removeMembers','ChatGroupId','getMessages','$gte','split','format','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','end','status','limit','undefined','count'];(function(_0x47884e,_0x415d05){var _0x14c81e=function(_0x2810fd){while(--_0x2810fd){_0x47884e['push'](_0x47884e['shift']());}};_0x14c81e(++_0x415d05);}(_0xe037,0x164));var _0x7e03=function(_0x45c262,_0x2e3ce5){_0x45c262=_0x45c262-0x0;var _0x4f2ba6=_0xe037[_0x45c262];return _0x4f2ba6;};'use strict';var emlformat=require(_0x7e03('0x0'));var rimraf=require(_0x7e03('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7e03('0x2'));var rp=require(_0x7e03('0x3'));var moment=require('moment');var BPromise=require(_0x7e03('0x4'));var Mustache=require(_0x7e03('0x5'));var util=require(_0x7e03('0x6'));var path=require(_0x7e03('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7e03('0x8'));var fs=require('fs');var fs_extra=require(_0x7e03('0x9'));var _=require(_0x7e03('0xa'));var squel=require('squel');var crypto=require(_0x7e03('0xb'));var jsforce=require(_0x7e03('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7e03('0xd'));var querystring=require(_0x7e03('0xe'));var Papa=require(_0x7e03('0xf'));var Redis=require(_0x7e03('0x10'));var authService=require(_0x7e03('0x11'));var qs=require(_0x7e03('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7e03('0x13'))(_0x7e03('0x14'));var utils=require(_0x7e03('0x15'));var config=require(_0x7e03('0x16'));var licenseUtil=require(_0x7e03('0x17'));var db=require(_0x7e03('0x18'))['db'];config['redis']=_[_0x7e03('0x19')](config[_0x7e03('0x1a')],{'host':_0x7e03('0x1b'),'port':0x18eb});var socket=require(_0x7e03('0x1c'))(new Redis(config[_0x7e03('0x1a')]));require(_0x7e03('0x1d'))['register'](socket);function respondWithStatusCode(_0x30c5ed,_0x357d7a){_0x357d7a=_0x357d7a||0xcc;return function(_0x4dd934){if(_0x4dd934){return _0x30c5ed[_0x7e03('0x1e')](_0x357d7a);}return _0x30c5ed['status'](_0x357d7a)[_0x7e03('0x1f')]();};}function respondWithResult(_0x523986,_0x482429){_0x482429=_0x482429||0xc8;return function(_0x76c63e){if(_0x76c63e){return _0x523986[_0x7e03('0x20')](_0x482429)['json'](_0x76c63e);}};}function respondWithFilteredResult(_0x475113,_0xb11bbd){return function(_0x45861b){if(_0x45861b){var _0x23c418=typeof _0xb11bbd['offset']==='undefined'&&typeof _0xb11bbd[_0x7e03('0x21')]===_0x7e03('0x22');var _0x472f4f=_0x45861b[_0x7e03('0x23')];var _0x5b89bf=_0x23c418?0x0:_0xb11bbd[_0x7e03('0x24')];var _0x375435=_0x23c418?_0x45861b[_0x7e03('0x23')]:_0xb11bbd[_0x7e03('0x24')]+_0xb11bbd[_0x7e03('0x21')];var _0x11d55f;if(_0x375435>=_0x472f4f){_0x375435=_0x472f4f;_0x11d55f=0xc8;}else{_0x11d55f=0xce;}_0x475113[_0x7e03('0x20')](_0x11d55f);return _0x475113[_0x7e03('0x25')](_0x7e03('0x26'),_0x5b89bf+'-'+_0x375435+'/'+_0x472f4f)[_0x7e03('0x27')](_0x45861b);}return null;};}function patchUpdates(_0x596464){return function(_0xe61a6f){try{jsonpatch['apply'](_0xe61a6f,_0x596464,!![]);}catch(_0x23aa26){return BPromise[_0x7e03('0x28')](_0x23aa26);}return _0xe61a6f[_0x7e03('0x29')]();};}function saveUpdates(_0x25a0d8,_0x140f09){return function(_0xad344e){if(_0xad344e){return _0xad344e['update'](_0x25a0d8)[_0x7e03('0x2a')](function(_0x55432a){return _0x55432a;});}return null;};}function removeEntity(_0x4dc1f8,_0x24ed97){return function(_0x86698c){if(_0x86698c){return _0x86698c[_0x7e03('0x2b')]()[_0x7e03('0x2a')](function(){_0x4dc1f8[_0x7e03('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47b5b8,_0x3c7bd9){return function(_0x49c7c9){if(!_0x49c7c9){_0x47b5b8[_0x7e03('0x1e')](0x194);}return _0x49c7c9;};}function handleError(_0x36ec0e,_0x5bd4b7){_0x5bd4b7=_0x5bd4b7||0x1f4;return function(_0x30bc44){logger['error'](_0x30bc44[_0x7e03('0x2c')]);if(_0x30bc44['name']){delete _0x30bc44['name'];}_0x36ec0e[_0x7e03('0x20')](_0x5bd4b7)[_0x7e03('0x2d')](_0x30bc44);};}exports[_0x7e03('0x2e')]=function(_0x34e96e,_0x2ee286){var _0x279337={},_0x1ed4aa={},_0x7afb45={'count':0x0,'rows':[]};var _0x440e6d=_[_0x7e03('0x2f')](db[_0x7e03('0x30')][_0x7e03('0x31')],function(_0x575aa6){return{'name':_0x575aa6[_0x7e03('0x32')],'type':_0x575aa6['type']['key']};});_0x1ed4aa[_0x7e03('0x33')]=_[_0x7e03('0x2f')](_0x440e6d,_0x7e03('0x34'));_0x1ed4aa['query']=_[_0x7e03('0x35')](_0x34e96e[_0x7e03('0x36')]);_0x1ed4aa[_0x7e03('0x37')]=_[_0x7e03('0x38')](_0x1ed4aa[_0x7e03('0x33')],_0x1ed4aa['query']);_0x279337[_0x7e03('0x39')]=_[_0x7e03('0x38')](_0x1ed4aa[_0x7e03('0x33')],qs[_0x7e03('0x3a')](_0x34e96e[_0x7e03('0x36')][_0x7e03('0x3a')]));_0x279337[_0x7e03('0x39')]=_0x279337[_0x7e03('0x39')][_0x7e03('0x3b')]?_0x279337[_0x7e03('0x39')]:_0x1ed4aa[_0x7e03('0x33')];if(!_0x34e96e[_0x7e03('0x36')][_0x7e03('0x3c')](_0x7e03('0x3d'))){_0x279337[_0x7e03('0x21')]=qs[_0x7e03('0x21')](_0x34e96e[_0x7e03('0x36')]['limit']);_0x279337[_0x7e03('0x24')]=qs[_0x7e03('0x24')](_0x34e96e[_0x7e03('0x36')][_0x7e03('0x24')]);}_0x279337['order']=qs[_0x7e03('0x3e')](_0x34e96e[_0x7e03('0x36')][_0x7e03('0x3e')]);_0x279337[_0x7e03('0x3f')]=qs[_0x7e03('0x37')](_[_0x7e03('0x40')](_0x34e96e[_0x7e03('0x36')],_0x1ed4aa[_0x7e03('0x37')]),_0x440e6d);if(_0x34e96e[_0x7e03('0x36')][_0x7e03('0x41')]){_0x279337[_0x7e03('0x3f')]=_[_0x7e03('0x42')](_0x279337[_0x7e03('0x3f')],{'$or':_[_0x7e03('0x2f')](_0x440e6d,function(_0x1a9866){if(_0x1a9866[_0x7e03('0x43')]!==_0x7e03('0x44')){var _0x12d5c8={};_0x12d5c8[_0x1a9866[_0x7e03('0x34')]]={'$like':'%'+_0x34e96e[_0x7e03('0x36')][_0x7e03('0x41')]+'%'};return _0x12d5c8;}})});}_0x279337=_[_0x7e03('0x42')]({},_0x279337,_0x34e96e[_0x7e03('0x45')]);var _0x5c72cb={'where':_0x279337['where']};return db[_0x7e03('0x30')][_0x7e03('0x23')](_0x5c72cb)[_0x7e03('0x2a')](function(_0x51b7fd){_0x7afb45[_0x7e03('0x23')]=_0x51b7fd;if(_0x34e96e[_0x7e03('0x36')][_0x7e03('0x46')]){_0x279337[_0x7e03('0x47')]=[{'all':!![]}];}return db['ChatGroup'][_0x7e03('0x48')](_0x279337);})[_0x7e03('0x2a')](function(_0x3c958a){_0x7afb45[_0x7e03('0x49')]=_0x3c958a;return _0x7afb45;})[_0x7e03('0x2a')](respondWithFilteredResult(_0x2ee286,_0x279337))[_0x7e03('0x4a')](handleError(_0x2ee286,null));};exports[_0x7e03('0x4b')]=function(_0x44f636,_0x43d743){var _0x557340={'raw':!![],'where':{'id':_0x44f636['params']['id']}},_0x1b7256={};_0x1b7256[_0x7e03('0x33')]=_[_0x7e03('0x35')](db[_0x7e03('0x30')][_0x7e03('0x31')]);_0x1b7256['query']=_[_0x7e03('0x35')](_0x44f636[_0x7e03('0x36')]);_0x1b7256['filters']=_[_0x7e03('0x38')](_0x1b7256[_0x7e03('0x33')],_0x1b7256[_0x7e03('0x36')]);_0x557340[_0x7e03('0x39')]=_[_0x7e03('0x38')](_0x1b7256[_0x7e03('0x33')],qs[_0x7e03('0x3a')](_0x44f636['query'][_0x7e03('0x3a')]));_0x557340['attributes']=_0x557340[_0x7e03('0x39')][_0x7e03('0x3b')]?_0x557340['attributes']:_0x1b7256[_0x7e03('0x33')];if(_0x44f636['query'][_0x7e03('0x46')]){_0x557340[_0x7e03('0x47')]=[{'all':!![]}];}_0x557340=_[_0x7e03('0x42')]({},_0x557340,_0x44f636[_0x7e03('0x45')]);return db[_0x7e03('0x30')][_0x7e03('0x4c')](_0x557340)[_0x7e03('0x2a')](handleEntityNotFound(_0x43d743,null))[_0x7e03('0x2a')](respondWithResult(_0x43d743,null))['catch'](handleError(_0x43d743,null));};exports[_0x7e03('0x4d')]=function(_0x329280,_0x4332c6){return db[_0x7e03('0x30')][_0x7e03('0x4d')](_0x329280[_0x7e03('0x4e')],{})[_0x7e03('0x2a')](respondWithResult(_0x4332c6,0xc9))[_0x7e03('0x4a')](handleError(_0x4332c6,null));};exports['update']=function(_0x3bd5f,_0x4053e6){if(_0x3bd5f[_0x7e03('0x4e')]['id']){delete _0x3bd5f[_0x7e03('0x4e')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x3bd5f[_0x7e03('0x4f')]['id']}})[_0x7e03('0x2a')](handleEntityNotFound(_0x4053e6,null))['then'](saveUpdates(_0x3bd5f[_0x7e03('0x4e')],null))[_0x7e03('0x2a')](respondWithResult(_0x4053e6,null))['catch'](handleError(_0x4053e6,null));};exports[_0x7e03('0x2b')]=function(_0x4ca682,_0x58dc37){return db['ChatGroup'][_0x7e03('0x4c')]({'where':{'id':_0x4ca682[_0x7e03('0x4f')]['id']}})[_0x7e03('0x2a')](handleEntityNotFound(_0x58dc37,null))[_0x7e03('0x2a')](removeEntity(_0x58dc37,null))[_0x7e03('0x4a')](handleError(_0x58dc37,null));};exports['describe']=function(_0x4a8a56,_0x88828d){return db[_0x7e03('0x30')][_0x7e03('0x50')]()[_0x7e03('0x2a')](respondWithResult(_0x88828d,null))[_0x7e03('0x4a')](handleError(_0x88828d,null));};exports[_0x7e03('0x51')]=function(_0x481392,_0x434e16,_0x1c9e2a){return db[_0x7e03('0x52')][_0x7e03('0x23')]({'where':{'ChatGroupId':_0x481392['params']['id'],'ToId':_0x481392[_0x7e03('0x53')]['id'],'read':![]}})['then'](function(_0x2abbf1){return{'id':_[_0x7e03('0x54')](_0x481392['params']['id']),'count':_0x2abbf1};})[_0x7e03('0x2a')](respondWithResult(_0x434e16,null))[_0x7e03('0x4a')](handleError(_0x434e16,null));};exports[_0x7e03('0x55')]=function(_0x3ab7fe,_0x5666ed,_0x34517c){return db[_0x7e03('0x30')][_0x7e03('0x4c')]({'where':{'id':_0x3ab7fe['params']['id']}})['then'](handleEntityNotFound(_0x5666ed,null))[_0x7e03('0x2a')](function(_0x242f73){if(_0x242f73){return _0x242f73[_0x7e03('0x55')](_0x3ab7fe[_0x7e03('0x4e')][_0x7e03('0x56')],_[_0x7e03('0x57')](_0x3ab7fe[_0x7e03('0x4e')],['ids','id'])||{});}})[_0x7e03('0x2a')](respondWithResult(_0x5666ed,null))['catch'](handleError(_0x5666ed,null));};exports['getMembers']=function(_0x344445,_0x211cb4,_0x37a498){var _0x20b307={};var _0x36d6e7={};var _0x587115;var _0x368eac;return db[_0x7e03('0x30')][_0x7e03('0x58')]({'where':{'id':_0x344445[_0x7e03('0x4f')]['id']}})[_0x7e03('0x2a')](handleEntityNotFound(_0x211cb4,null))['then'](function(_0x5bc1fb){if(_0x5bc1fb){_0x587115=_0x5bc1fb;_0x36d6e7['model']=_[_0x7e03('0x35')](db[_0x7e03('0x59')][_0x7e03('0x31')]);_0x36d6e7[_0x7e03('0x36')]=_[_0x7e03('0x35')](_0x344445['query']);_0x36d6e7[_0x7e03('0x37')]=_[_0x7e03('0x38')](_0x36d6e7[_0x7e03('0x33')],_0x36d6e7[_0x7e03('0x36')]);_0x20b307[_0x7e03('0x39')]=_[_0x7e03('0x38')](_0x36d6e7[_0x7e03('0x33')],qs['fields'](_0x344445[_0x7e03('0x36')][_0x7e03('0x3a')]));_0x20b307[_0x7e03('0x39')]=_0x20b307['attributes'][_0x7e03('0x3b')]?_0x20b307['attributes']:_0x36d6e7[_0x7e03('0x33')];_0x20b307[_0x7e03('0x5a')]=qs[_0x7e03('0x3e')](_0x344445['query'][_0x7e03('0x3e')]);_0x20b307[_0x7e03('0x3f')]=qs[_0x7e03('0x37')](_['pick'](_0x344445[_0x7e03('0x36')],_0x36d6e7[_0x7e03('0x37')]));if(_0x344445[_0x7e03('0x36')]['filter']){_0x20b307[_0x7e03('0x3f')]=_['merge'](_0x20b307['where'],{'$or':_[_0x7e03('0x2f')](_0x20b307['attributes'],function(_0x29f8a2){var _0x1beffc={};_0x1beffc[_0x29f8a2]={'$like':'%'+_0x344445[_0x7e03('0x36')][_0x7e03('0x41')]+'%'};return _0x1beffc;})});}_0x20b307=_[_0x7e03('0x42')]({},_0x20b307,_0x344445[_0x7e03('0x45')]);return _0x587115[_0x7e03('0x5b')](_0x20b307);}})[_0x7e03('0x2a')](function(_0x5b1c7a){if(_0x5b1c7a){_0x368eac=_0x5b1c7a[_0x7e03('0x3b')];if(!_0x344445[_0x7e03('0x36')][_0x7e03('0x3c')](_0x7e03('0x3d'))){_0x20b307[_0x7e03('0x21')]=qs[_0x7e03('0x21')](_0x344445['query'][_0x7e03('0x21')]);_0x20b307['offset']=qs[_0x7e03('0x24')](_0x344445[_0x7e03('0x36')][_0x7e03('0x24')]);}return _0x587115[_0x7e03('0x5b')](_0x20b307);}})[_0x7e03('0x2a')](function(_0x5c40be){if(_0x5c40be){return _0x5c40be?{'count':_0x368eac,'rows':_0x5c40be}:null;}})['then'](respondWithResult(_0x211cb4,null))['catch'](handleError(_0x211cb4,null));};exports[_0x7e03('0x5c')]=function(_0x334e42,_0x1b6851,_0x15f1fd){return db[_0x7e03('0x30')][_0x7e03('0x4c')]({'where':{'id':_0x334e42[_0x7e03('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1b6851,null))[_0x7e03('0x2a')](function(_0x146d2){if(_0x146d2){return _0x146d2[_0x7e03('0x5c')](_0x334e42['query']['ids']);}})['then'](respondWithStatusCode(_0x1b6851,null))[_0x7e03('0x4a')](handleError(_0x1b6851,null));};exports['addMessage']=function(_0x36059e,_0x1db82f,_0x2c4a1b){if(_0x36059e[_0x7e03('0x4e')]['id']){delete _0x36059e[_0x7e03('0x4e')]['id'];}return db[_0x7e03('0x30')][_0x7e03('0x4c')]({'where':{'id':_0x36059e[_0x7e03('0x4f')]['id']}})[_0x7e03('0x2a')](handleEntityNotFound(_0x1db82f,null))[_0x7e03('0x2a')](function(_0x46ecfa){if(_0x46ecfa){_0x36059e['body'][_0x7e03('0x5d')]=_0x46ecfa['id'];return db[_0x7e03('0x52')][_0x7e03('0x4d')](_0x36059e[_0x7e03('0x4e')]);}})[_0x7e03('0x2a')](respondWithResult(_0x1db82f,null))[_0x7e03('0x4a')](handleError(_0x1db82f,null));};exports[_0x7e03('0x5e')]=function(_0x393205,_0x9fd440,_0x5d04fc){var _0x94b22d={};var _0x2ec987={};var _0x1b1a11;var _0x46d7f9;return db[_0x7e03('0x30')][_0x7e03('0x58')]({'where':{'id':_0x393205[_0x7e03('0x4f')]['id']}})['then'](handleEntityNotFound(_0x9fd440,null))['then'](function(_0x3cbdd3){if(_0x3cbdd3){_0x1b1a11=_0x3cbdd3;_0x2ec987['model']=_[_0x7e03('0x35')](db[_0x7e03('0x52')]['rawAttributes']);_0x2ec987[_0x7e03('0x36')]=_[_0x7e03('0x35')](_0x393205[_0x7e03('0x36')]);_0x2ec987[_0x7e03('0x37')]=_['intersection'](_0x2ec987[_0x7e03('0x33')],_0x2ec987[_0x7e03('0x36')]);_0x94b22d[_0x7e03('0x39')]=_['intersection'](_0x2ec987['model'],qs[_0x7e03('0x3a')](_0x393205[_0x7e03('0x36')][_0x7e03('0x3a')]));_0x94b22d[_0x7e03('0x39')]=_0x94b22d[_0x7e03('0x39')][_0x7e03('0x3b')]?_0x94b22d['attributes']:_0x2ec987['model'];_0x94b22d[_0x7e03('0x5a')]=qs['sort'](_0x393205['query'][_0x7e03('0x3e')]);_0x94b22d['where']=qs[_0x7e03('0x37')](_[_0x7e03('0x40')](_0x393205[_0x7e03('0x36')],_0x2ec987[_0x7e03('0x37')]));if(_0x393205[_0x7e03('0x36')][_0x7e03('0x41')]){_0x94b22d[_0x7e03('0x3f')]=_[_0x7e03('0x42')](_0x94b22d[_0x7e03('0x3f')],{'$or':_['map'](_0x94b22d[_0x7e03('0x39')],function(_0x2d6637){var _0x4b42b8={};_0x4b42b8[_0x2d6637]={'$like':'%'+_0x393205['query']['filter']+'%'};return _0x4b42b8;})});}if(_0x393205['query'][_0x7e03('0x5f')]){var _0x51d159=_0x393205[_0x7e03('0x36')][_0x7e03('0x5f')][_0x7e03('0x60')](',');var _0x4cc426={};_0x4cc426[_0x51d159[0x0]]={'$gte':moment(_0x51d159[0x1])[_0x7e03('0x61')]('YYYY-MM-DD\x20HH:mm:ss')};_0x94b22d[_0x7e03('0x3f')]=_[_0x7e03('0x42')](_0x94b22d['where'],_0x4cc426);}_0x94b22d=_[_0x7e03('0x42')]({},_0x94b22d,_0x393205[_0x7e03('0x45')]);return _0x1b1a11[_0x7e03('0x5e')](_0x94b22d);}})[_0x7e03('0x2a')](function(_0x5763ef){if(_0x5763ef){_0x46d7f9=_0x5763ef['length'];if(!_0x393205['query'][_0x7e03('0x3c')](_0x7e03('0x3d'))){_0x94b22d[_0x7e03('0x21')]=qs['limit'](_0x393205[_0x7e03('0x36')]['limit']);_0x94b22d['offset']=qs[_0x7e03('0x24')](_0x393205[_0x7e03('0x36')][_0x7e03('0x24')]);}return _0x1b1a11[_0x7e03('0x5e')](_0x94b22d);}})[_0x7e03('0x2a')](function(_0x5ab466){if(_0x5ab466){return _0x5ab466?{'count':_0x46d7f9,'rows':_0x5ab466}:null;}})[_0x7e03('0x2a')](respondWithResult(_0x9fd440,null))[_0x7e03('0x4a')](handleError(_0x9fd440,null));}; \ No newline at end of file +var _0x2d11=['../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','ChatGroup','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','options','find','create','body','destroy','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','User','merge','removeMembers','addMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','hasOwnProperty','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment'];(function(_0x1e4150,_0x55b02a){var _0x1ce3ee=function(_0x59324e){while(--_0x59324e){_0x1e4150['push'](_0x1e4150['shift']());}};_0x1ce3ee(++_0x55b02a);}(_0x2d11,0x10f));var _0x12d1=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2d11[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x12d1('0x0'));var zipdir=require(_0x12d1('0x1'));var jsonpatch=require(_0x12d1('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x12d1('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x12d1('0x4'));var sox=require(_0x12d1('0x5'));var csv=require(_0x12d1('0x6'));var ejs=require(_0x12d1('0x7'));var fs=require('fs');var fs_extra=require(_0x12d1('0x8'));var _=require('lodash');var squel=require(_0x12d1('0x9'));var crypto=require(_0x12d1('0xa'));var jsforce=require(_0x12d1('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x12d1('0x6'));var querystring=require('querystring');var Papa=require(_0x12d1('0xc'));var Redis=require(_0x12d1('0xd'));var authService=require(_0x12d1('0xe'));var qs=require(_0x12d1('0xf'));var as=require(_0x12d1('0x10'));var hardwareService=require(_0x12d1('0x11'));var logger=require(_0x12d1('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x12d1('0x13'));var licenseUtil=require(_0x12d1('0x14'));var db=require(_0x12d1('0x15'))['db'];config[_0x12d1('0x16')]=_[_0x12d1('0x17')](config[_0x12d1('0x16')],{'host':_0x12d1('0x18'),'port':0x18eb});var socket=require(_0x12d1('0x19'))(new Redis(config[_0x12d1('0x16')]));require('./chatGroup.socket')[_0x12d1('0x1a')](socket);function respondWithStatusCode(_0x53245f,_0x4ffc02){_0x4ffc02=_0x4ffc02||0xcc;return function(_0x37902e){if(_0x37902e){return _0x53245f[_0x12d1('0x1b')](_0x4ffc02);}return _0x53245f['status'](_0x4ffc02)[_0x12d1('0x1c')]();};}function respondWithResult(_0x1668c7,_0x36aed7){_0x36aed7=_0x36aed7||0xc8;return function(_0x2831da){if(_0x2831da){return _0x1668c7[_0x12d1('0x1d')](_0x36aed7)[_0x12d1('0x1e')](_0x2831da);}};}function respondWithFilteredResult(_0x40b57a,_0x466482){return function(_0x502e45){if(_0x502e45){var _0x481c5f=typeof _0x466482[_0x12d1('0x1f')]===_0x12d1('0x20')&&typeof _0x466482[_0x12d1('0x21')]===_0x12d1('0x20');var _0xf0f93f=_0x502e45[_0x12d1('0x22')];var _0x17702a=_0x481c5f?0x0:_0x466482[_0x12d1('0x1f')];var _0x236a73=_0x481c5f?_0x502e45['count']:_0x466482[_0x12d1('0x1f')]+_0x466482[_0x12d1('0x21')];var _0x2bbe67;if(_0x236a73>=_0xf0f93f){_0x236a73=_0xf0f93f;_0x2bbe67=0xc8;}else{_0x2bbe67=0xce;}_0x40b57a[_0x12d1('0x1d')](_0x2bbe67);return _0x40b57a['set'](_0x12d1('0x23'),_0x17702a+'-'+_0x236a73+'/'+_0xf0f93f)['json'](_0x502e45);}return null;};}function patchUpdates(_0x4fdc4c){return function(_0x4bcc33){try{jsonpatch[_0x12d1('0x24')](_0x4bcc33,_0x4fdc4c,!![]);}catch(_0x4dec5c){return BPromise[_0x12d1('0x25')](_0x4dec5c);}return _0x4bcc33[_0x12d1('0x26')]();};}function saveUpdates(_0x1c98af,_0x556c0e){return function(_0x28c96d){if(_0x28c96d){return _0x28c96d[_0x12d1('0x27')](_0x1c98af)['then'](function(_0x644c01){return _0x644c01;});}return null;};}function removeEntity(_0x15c267,_0x30db08){return function(_0x38b194){if(_0x38b194){return _0x38b194['destroy']()[_0x12d1('0x28')](function(){_0x15c267['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f50af,_0x42c4ac){return function(_0x2167d8){if(!_0x2167d8){_0x4f50af['sendStatus'](0x194);}return _0x2167d8;};}function handleError(_0x4ddd6e,_0x464631){_0x464631=_0x464631||0x1f4;return function(_0x196d3c){logger[_0x12d1('0x29')](_0x196d3c['stack']);if(_0x196d3c[_0x12d1('0x2a')]){delete _0x196d3c[_0x12d1('0x2a')];}_0x4ddd6e[_0x12d1('0x1d')](_0x464631)[_0x12d1('0x2b')](_0x196d3c);};}exports[_0x12d1('0x2c')]=function(_0x268a9a,_0x53168a){var _0x30c75e={},_0x21ade1={},_0x2878ac={'count':0x0,'rows':[]};var _0x2749ab=_[_0x12d1('0x2d')](db['ChatGroup']['rawAttributes'],function(_0x2c25ff){return{'name':_0x2c25ff[_0x12d1('0x2e')],'type':_0x2c25ff[_0x12d1('0x2f')][_0x12d1('0x30')]};});_0x21ade1[_0x12d1('0x31')]=_[_0x12d1('0x2d')](_0x2749ab,'name');_0x21ade1[_0x12d1('0x32')]=_['keys'](_0x268a9a[_0x12d1('0x32')]);_0x21ade1[_0x12d1('0x33')]=_[_0x12d1('0x34')](_0x21ade1[_0x12d1('0x31')],_0x21ade1[_0x12d1('0x32')]);_0x30c75e[_0x12d1('0x35')]=_[_0x12d1('0x34')](_0x21ade1[_0x12d1('0x31')],qs['fields'](_0x268a9a['query'][_0x12d1('0x36')]));_0x30c75e[_0x12d1('0x35')]=_0x30c75e[_0x12d1('0x35')][_0x12d1('0x37')]?_0x30c75e[_0x12d1('0x35')]:_0x21ade1['model'];if(!_0x268a9a[_0x12d1('0x32')]['hasOwnProperty'](_0x12d1('0x38'))){_0x30c75e[_0x12d1('0x21')]=qs['limit'](_0x268a9a[_0x12d1('0x32')][_0x12d1('0x21')]);_0x30c75e[_0x12d1('0x1f')]=qs[_0x12d1('0x1f')](_0x268a9a[_0x12d1('0x32')][_0x12d1('0x1f')]);}_0x30c75e[_0x12d1('0x39')]=qs[_0x12d1('0x3a')](_0x268a9a[_0x12d1('0x32')]['sort']);_0x30c75e[_0x12d1('0x3b')]=qs[_0x12d1('0x33')](_[_0x12d1('0x3c')](_0x268a9a[_0x12d1('0x32')],_0x21ade1[_0x12d1('0x33')]),_0x2749ab);if(_0x268a9a['query'][_0x12d1('0x3d')]){_0x30c75e['where']=_['merge'](_0x30c75e[_0x12d1('0x3b')],{'$or':_[_0x12d1('0x2d')](_0x2749ab,function(_0x52192e){if(_0x52192e[_0x12d1('0x2f')]!==_0x12d1('0x3e')){var _0x3e4487={};_0x3e4487[_0x52192e[_0x12d1('0x2a')]]={'$like':'%'+_0x268a9a[_0x12d1('0x32')]['filter']+'%'};return _0x3e4487;}})});}_0x30c75e=_['merge']({},_0x30c75e,_0x268a9a['options']);var _0x6bf0b3={'where':_0x30c75e[_0x12d1('0x3b')]};return db[_0x12d1('0x3f')][_0x12d1('0x22')](_0x6bf0b3)[_0x12d1('0x28')](function(_0x5128e7){_0x2878ac['count']=_0x5128e7;if(_0x268a9a[_0x12d1('0x32')][_0x12d1('0x40')]){_0x30c75e[_0x12d1('0x41')]=[{'all':!![]}];}return db[_0x12d1('0x3f')][_0x12d1('0x42')](_0x30c75e);})[_0x12d1('0x28')](function(_0x2a79e1){_0x2878ac[_0x12d1('0x43')]=_0x2a79e1;return _0x2878ac;})[_0x12d1('0x28')](respondWithFilteredResult(_0x53168a,_0x30c75e))[_0x12d1('0x44')](handleError(_0x53168a,null));};exports[_0x12d1('0x45')]=function(_0x25563e,_0x5e7d06){var _0xa5bb={'raw':!![],'where':{'id':_0x25563e['params']['id']}},_0x400681={};_0x400681[_0x12d1('0x31')]=_[_0x12d1('0x46')](db[_0x12d1('0x3f')][_0x12d1('0x47')]);_0x400681['query']=_[_0x12d1('0x46')](_0x25563e['query']);_0x400681[_0x12d1('0x33')]=_[_0x12d1('0x34')](_0x400681['model'],_0x400681['query']);_0xa5bb[_0x12d1('0x35')]=_[_0x12d1('0x34')](_0x400681['model'],qs['fields'](_0x25563e[_0x12d1('0x32')]['fields']));_0xa5bb['attributes']=_0xa5bb[_0x12d1('0x35')]['length']?_0xa5bb['attributes']:_0x400681[_0x12d1('0x31')];if(_0x25563e['query'][_0x12d1('0x40')]){_0xa5bb[_0x12d1('0x41')]=[{'all':!![]}];}_0xa5bb=_['merge']({},_0xa5bb,_0x25563e[_0x12d1('0x48')]);return db[_0x12d1('0x3f')][_0x12d1('0x49')](_0xa5bb)[_0x12d1('0x28')](handleEntityNotFound(_0x5e7d06,null))[_0x12d1('0x28')](respondWithResult(_0x5e7d06,null))['catch'](handleError(_0x5e7d06,null));};exports[_0x12d1('0x4a')]=function(_0x3bbd86,_0x350e3a){return db[_0x12d1('0x3f')]['create'](_0x3bbd86[_0x12d1('0x4b')],{})[_0x12d1('0x28')](respondWithResult(_0x350e3a,0xc9))[_0x12d1('0x44')](handleError(_0x350e3a,null));};exports[_0x12d1('0x27')]=function(_0xf4e36b,_0x4b829f){if(_0xf4e36b['body']['id']){delete _0xf4e36b[_0x12d1('0x4b')]['id'];}return db[_0x12d1('0x3f')]['find']({'where':{'id':_0xf4e36b['params']['id']}})['then'](handleEntityNotFound(_0x4b829f,null))['then'](saveUpdates(_0xf4e36b['body'],null))['then'](respondWithResult(_0x4b829f,null))[_0x12d1('0x44')](handleError(_0x4b829f,null));};exports[_0x12d1('0x4c')]=function(_0x2df436,_0x4973d8){return db[_0x12d1('0x3f')][_0x12d1('0x49')]({'where':{'id':_0x2df436[_0x12d1('0x4d')]['id']}})[_0x12d1('0x28')](handleEntityNotFound(_0x4973d8,null))[_0x12d1('0x28')](removeEntity(_0x4973d8,null))[_0x12d1('0x44')](handleError(_0x4973d8,null));};exports[_0x12d1('0x4e')]=function(_0x33ac24,_0x1e1526){return db[_0x12d1('0x3f')][_0x12d1('0x4e')]()[_0x12d1('0x28')](respondWithResult(_0x1e1526,null))[_0x12d1('0x44')](handleError(_0x1e1526,null));};exports[_0x12d1('0x4f')]=function(_0xb29bef,_0x47e6cc,_0x469ecc){return db[_0x12d1('0x50')][_0x12d1('0x22')]({'where':{'ChatGroupId':_0xb29bef[_0x12d1('0x4d')]['id'],'ToId':_0xb29bef[_0x12d1('0x51')]['id'],'read':![]}})[_0x12d1('0x28')](function(_0x24c9b0){return{'id':_[_0x12d1('0x52')](_0xb29bef[_0x12d1('0x4d')]['id']),'count':_0x24c9b0};})['then'](respondWithResult(_0x47e6cc,null))['catch'](handleError(_0x47e6cc,null));};exports[_0x12d1('0x53')]=function(_0x2d6228,_0x586637,_0x3e42af){return db[_0x12d1('0x3f')]['find']({'where':{'id':_0x2d6228[_0x12d1('0x4d')]['id']}})[_0x12d1('0x28')](handleEntityNotFound(_0x586637,null))['then'](function(_0x3251f0){if(_0x3251f0){return _0x3251f0['addMembers'](_0x2d6228[_0x12d1('0x4b')][_0x12d1('0x54')],_['omit'](_0x2d6228['body'],[_0x12d1('0x54'),'id'])||{});}})[_0x12d1('0x28')](respondWithResult(_0x586637,null))['catch'](handleError(_0x586637,null));};exports[_0x12d1('0x55')]=function(_0x52a221,_0x564013,_0x3033e5){var _0x548ea3={};var _0xf54f84={};var _0x416465;var _0x14f0ae;return db[_0x12d1('0x3f')][_0x12d1('0x56')]({'where':{'id':_0x52a221[_0x12d1('0x4d')]['id']}})[_0x12d1('0x28')](handleEntityNotFound(_0x564013,null))[_0x12d1('0x28')](function(_0x415c6a){if(_0x415c6a){_0x416465=_0x415c6a;_0xf54f84[_0x12d1('0x31')]=_[_0x12d1('0x46')](db[_0x12d1('0x57')][_0x12d1('0x47')]);_0xf54f84[_0x12d1('0x32')]=_[_0x12d1('0x46')](_0x52a221['query']);_0xf54f84[_0x12d1('0x33')]=_[_0x12d1('0x34')](_0xf54f84[_0x12d1('0x31')],_0xf54f84['query']);_0x548ea3['attributes']=_[_0x12d1('0x34')](_0xf54f84[_0x12d1('0x31')],qs[_0x12d1('0x36')](_0x52a221['query'][_0x12d1('0x36')]));_0x548ea3[_0x12d1('0x35')]=_0x548ea3[_0x12d1('0x35')][_0x12d1('0x37')]?_0x548ea3[_0x12d1('0x35')]:_0xf54f84[_0x12d1('0x31')];_0x548ea3[_0x12d1('0x39')]=qs[_0x12d1('0x3a')](_0x52a221[_0x12d1('0x32')]['sort']);_0x548ea3[_0x12d1('0x3b')]=qs['filters'](_[_0x12d1('0x3c')](_0x52a221[_0x12d1('0x32')],_0xf54f84['filters']));if(_0x52a221[_0x12d1('0x32')]['filter']){_0x548ea3[_0x12d1('0x3b')]=_[_0x12d1('0x58')](_0x548ea3['where'],{'$or':_['map'](_0x548ea3[_0x12d1('0x35')],function(_0x26ac58){var _0x428ef9={};_0x428ef9[_0x26ac58]={'$like':'%'+_0x52a221['query'][_0x12d1('0x3d')]+'%'};return _0x428ef9;})});}_0x548ea3=_[_0x12d1('0x58')]({},_0x548ea3,_0x52a221['options']);return _0x416465[_0x12d1('0x55')](_0x548ea3);}})[_0x12d1('0x28')](function(_0x438d09){if(_0x438d09){_0x14f0ae=_0x438d09['length'];if(!_0x52a221[_0x12d1('0x32')]['hasOwnProperty']('nolimit')){_0x548ea3['limit']=qs['limit'](_0x52a221[_0x12d1('0x32')][_0x12d1('0x21')]);_0x548ea3['offset']=qs[_0x12d1('0x1f')](_0x52a221[_0x12d1('0x32')][_0x12d1('0x1f')]);}return _0x416465[_0x12d1('0x55')](_0x548ea3);}})[_0x12d1('0x28')](function(_0x32a187){if(_0x32a187){return _0x32a187?{'count':_0x14f0ae,'rows':_0x32a187}:null;}})[_0x12d1('0x28')](respondWithResult(_0x564013,null))[_0x12d1('0x44')](handleError(_0x564013,null));};exports[_0x12d1('0x59')]=function(_0x17e719,_0x35e702,_0x5b4f2f){return db[_0x12d1('0x3f')][_0x12d1('0x49')]({'where':{'id':_0x17e719[_0x12d1('0x4d')]['id']}})[_0x12d1('0x28')](handleEntityNotFound(_0x35e702,null))[_0x12d1('0x28')](function(_0x11e5b2){if(_0x11e5b2){return _0x11e5b2[_0x12d1('0x59')](_0x17e719[_0x12d1('0x32')][_0x12d1('0x54')]);}})['then'](respondWithStatusCode(_0x35e702,null))['catch'](handleError(_0x35e702,null));};exports[_0x12d1('0x5a')]=function(_0x4ec1d0,_0x435974,_0x3b7bb1){if(_0x4ec1d0[_0x12d1('0x4b')]['id']){delete _0x4ec1d0['body']['id'];}return db[_0x12d1('0x3f')][_0x12d1('0x49')]({'where':{'id':_0x4ec1d0[_0x12d1('0x4d')]['id']}})[_0x12d1('0x28')](handleEntityNotFound(_0x435974,null))['then'](function(_0xd9aee9){if(_0xd9aee9){_0x4ec1d0['body']['ChatGroupId']=_0xd9aee9['id'];return db['ChatInternalMessage'][_0x12d1('0x4a')](_0x4ec1d0[_0x12d1('0x4b')]);}})['then'](respondWithResult(_0x435974,null))[_0x12d1('0x44')](handleError(_0x435974,null));};exports[_0x12d1('0x5b')]=function(_0x28a9e8,_0x325bb2,_0x6de82){var _0x1fb1ce={};var _0x2b3190={};var _0x486803;var _0x486dba;return db['ChatGroup'][_0x12d1('0x56')]({'where':{'id':_0x28a9e8['params']['id']}})['then'](handleEntityNotFound(_0x325bb2,null))[_0x12d1('0x28')](function(_0x30e91b){if(_0x30e91b){_0x486803=_0x30e91b;_0x2b3190[_0x12d1('0x31')]=_[_0x12d1('0x46')](db[_0x12d1('0x50')][_0x12d1('0x47')]);_0x2b3190[_0x12d1('0x32')]=_[_0x12d1('0x46')](_0x28a9e8['query']);_0x2b3190['filters']=_[_0x12d1('0x34')](_0x2b3190[_0x12d1('0x31')],_0x2b3190[_0x12d1('0x32')]);_0x1fb1ce[_0x12d1('0x35')]=_[_0x12d1('0x34')](_0x2b3190[_0x12d1('0x31')],qs[_0x12d1('0x36')](_0x28a9e8[_0x12d1('0x32')][_0x12d1('0x36')]));_0x1fb1ce['attributes']=_0x1fb1ce[_0x12d1('0x35')][_0x12d1('0x37')]?_0x1fb1ce['attributes']:_0x2b3190[_0x12d1('0x31')];_0x1fb1ce['order']=qs[_0x12d1('0x3a')](_0x28a9e8[_0x12d1('0x32')]['sort']);_0x1fb1ce[_0x12d1('0x3b')]=qs[_0x12d1('0x33')](_['pick'](_0x28a9e8[_0x12d1('0x32')],_0x2b3190[_0x12d1('0x33')]));if(_0x28a9e8['query'][_0x12d1('0x3d')]){_0x1fb1ce[_0x12d1('0x3b')]=_[_0x12d1('0x58')](_0x1fb1ce[_0x12d1('0x3b')],{'$or':_[_0x12d1('0x2d')](_0x1fb1ce['attributes'],function(_0x14d3ea){var _0xace0d4={};_0xace0d4[_0x14d3ea]={'$like':'%'+_0x28a9e8[_0x12d1('0x32')][_0x12d1('0x3d')]+'%'};return _0xace0d4;})});}if(_0x28a9e8[_0x12d1('0x32')][_0x12d1('0x5c')]){var _0x4d06af=_0x28a9e8['query'][_0x12d1('0x5c')][_0x12d1('0x5d')](',');var _0x16317a={};_0x16317a[_0x4d06af[0x0]]={'$gte':moment(_0x4d06af[0x1])[_0x12d1('0x5e')](_0x12d1('0x5f'))};_0x1fb1ce[_0x12d1('0x3b')]=_['merge'](_0x1fb1ce[_0x12d1('0x3b')],_0x16317a);}_0x1fb1ce=_[_0x12d1('0x58')]({},_0x1fb1ce,_0x28a9e8[_0x12d1('0x48')]);return _0x486803[_0x12d1('0x5b')](_0x1fb1ce);}})[_0x12d1('0x28')](function(_0xa54878){if(_0xa54878){_0x486dba=_0xa54878[_0x12d1('0x37')];if(!_0x28a9e8[_0x12d1('0x32')][_0x12d1('0x60')](_0x12d1('0x38'))){_0x1fb1ce[_0x12d1('0x21')]=qs[_0x12d1('0x21')](_0x28a9e8['query'][_0x12d1('0x21')]);_0x1fb1ce[_0x12d1('0x1f')]=qs[_0x12d1('0x1f')](_0x28a9e8[_0x12d1('0x32')]['offset']);}return _0x486803[_0x12d1('0x5b')](_0x1fb1ce);}})[_0x12d1('0x28')](function(_0x4a4a1a){if(_0x4a4a1a){return _0x4a4a1a?{'count':_0x486dba,'rows':_0x4a4a1a}:null;}})['then'](respondWithResult(_0x325bb2,null))[_0x12d1('0x44')](handleError(_0x325bb2,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 3d50786..a201603 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 _0x8e08=['update','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners','save'];(function(_0x2e0a18,_0x1b8d36){var _0x9f9c68=function(_0x3f70c2){while(--_0x3f70c2){_0x2e0a18['push'](_0x2e0a18['shift']());}};_0x9f9c68(++_0x1b8d36);}(_0x8e08,0xf9));var _0x88e0=function(_0x9b6985,_0x12e29e){_0x9b6985=_0x9b6985-0x0;var _0x1d0514=_0x8e08[_0x9b6985];return _0x1d0514;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x88e0('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x88e0('0x1')](0x0);var events={'afterCreate':_0x88e0('0x2'),'afterUpdate':_0x88e0('0x3'),'afterDestroy':'remove'};function emitEvent(_0x402087){return function(_0x1a2af9,_0x492263,_0x49d228){ChatGroupEvents['emit'](_0x402087+':'+_0x1a2af9['id'],_0x1a2af9);ChatGroupEvents[_0x88e0('0x4')](_0x402087,_0x1a2af9);_0x49d228(null);};}for(var e in events){if(events[_0x88e0('0x5')](e)){var event=events[e];ChatGroup[_0x88e0('0x6')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x59ee=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x59ee,0x165));var _0xe59e=function(_0x4d121d,_0x3fe733){_0x4d121d=_0x4d121d-0x0;var _0xffa031=_0x59ee[_0x4d121d];return _0xffa031;};'use strict';var EventEmitter=require(_0xe59e('0x0'));var ChatGroup=require(_0xe59e('0x1'))['db'][_0xe59e('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xe59e('0x3')](0x0);var events={'afterCreate':_0xe59e('0x4'),'afterUpdate':'update','afterDestroy':_0xe59e('0x5')};function emitEvent(_0x55a7e4){return function(_0x1384a9,_0x167b61,_0x1008a4){ChatGroupEvents[_0xe59e('0x6')](_0x55a7e4+':'+_0x1384a9['id'],_0x1384a9);ChatGroupEvents[_0xe59e('0x6')](_0x55a7e4,_0x1384a9);_0x1008a4(null);};}for(var e in events){if(events[_0xe59e('0x7')](e)){var event=events[e];ChatGroup[_0xe59e('0x8')](e,emitEvent(event));}}module[_0xe59e('0x9')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 824ec1b..1cd23a2 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 _0x8e15=['path','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','lodash','util','moment','bluebird'];(function(_0x1dd532,_0x36e81c){var _0x3732aa=function(_0x19d50a){while(--_0x19d50a){_0x1dd532['push'](_0x1dd532['shift']());}};_0x3732aa(++_0x36e81c);}(_0x8e15,0xba));var _0x58e1=function(_0x536866,_0x54e594){_0x536866=_0x536866-0x0;var _0x3f8cee=_0x8e15[_0x536866];return _0x3f8cee;};'use strict';var _=require(_0x58e1('0x0'));var util=require(_0x58e1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x58e1('0x2'));var BPromise=require(_0x58e1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x58e1('0x4'));var rimraf=require('rimraf');var config=require(_0x58e1('0x5'));var attributes=require(_0x58e1('0x6'));module[_0x58e1('0x7')]=function(_0x245285,_0x351523){return _0x245285[_0x58e1('0x8')]('ChatGroup',attributes,{'tableName':_0x58e1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b54=['ChatGroup','chat_groups','lodash','util','../../config/logger','bluebird','path','rimraf','./chatGroup.attributes'];(function(_0x99c089,_0x250420){var _0x4b688c=function(_0x61f51b){while(--_0x61f51b){_0x99c089['push'](_0x99c089['shift']());}};_0x4b688c(++_0x250420);}(_0x6b54,0xb6));var _0x46b5=function(_0x27f4e9,_0x2f2f75){_0x27f4e9=_0x27f4e9-0x0;var _0x7226e=_0x6b54[_0x27f4e9];return _0x7226e;};'use strict';var _=require(_0x46b5('0x0'));var util=require(_0x46b5('0x1'));var logger=require(_0x46b5('0x2'))('api');var moment=require('moment');var BPromise=require(_0x46b5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x46b5('0x4'));var rimraf=require(_0x46b5('0x5'));var config=require('../../config/environment');var attributes=require(_0x46b5('0x6'));module['exports']=function(_0x4a0294,_0x339643){return _0x4a0294['define'](_0x46b5('0x7'),attributes,{'tableName':_0x46b5('0x8'),'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 09611c4..14ed095 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 _0xd0ee=['../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','ChatGroup,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','lodash','util','moment','randomstring'];(function(_0x4c4037,_0x15054b){var _0x357862=function(_0x480015){while(--_0x480015){_0x4c4037['push'](_0x4c4037['shift']());}};_0x357862(++_0x15054b);}(_0xd0ee,0x18c));var _0xed0e=function(_0x9adc4c,_0x5de74d){_0x9adc4c=_0x9adc4c-0x0;var _0x5df970=_0xd0ee[_0x9adc4c];return _0x5df970;};'use strict';var _=require(_0xed0e('0x0'));var util=require(_0xed0e('0x1'));var moment=require(_0xed0e('0x2'));var BPromise=require('bluebird');var rs=require(_0xed0e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xed0e('0x4'))['db'];var utils=require(_0xed0e('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xed0e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xed0e('0x7')][_0xed0e('0x8')]({'port':0x232a});config[_0xed0e('0x9')]=_[_0xed0e('0xa')](config['redis'],{'host':_0xed0e('0xb'),'port':0x18eb});var socket=require(_0xed0e('0xc'))(new Redis(config[_0xed0e('0x9')]));require(_0xed0e('0xd'))[_0xed0e('0xe')](socket);function respondWithRpcPromise(_0x4414a3,_0x3f15b9,_0x573347){return new BPromise(function(_0x48c11f,_0x575dce){return client[_0xed0e('0xf')](_0x4414a3,_0x573347)[_0xed0e('0x10')](function(_0x319288){logger['info'](_0xed0e('0x11'),_0x3f15b9,'request\x20sent');logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x3f15b9,'request\x20sent',JSON[_0xed0e('0x12')](_0x319288));if(_0x319288[_0xed0e('0x13')]){if(_0x319288['error'][_0xed0e('0x14')]===0x1f4){logger['error'](_0xed0e('0x11'),_0x3f15b9,_0x319288[_0xed0e('0x13')][_0xed0e('0x15')]);return _0x575dce(_0x319288[_0xed0e('0x13')]['message']);}logger[_0xed0e('0x13')](_0xed0e('0x11'),_0x3f15b9,_0x319288[_0xed0e('0x13')]['message']);return _0x48c11f(_0x319288[_0xed0e('0x13')][_0xed0e('0x15')]);}else{logger[_0xed0e('0x16')](_0xed0e('0x11'),_0x3f15b9,_0xed0e('0x17'));_0x48c11f(_0x319288['result']['message']);}})[_0xed0e('0x18')](function(_0x5f2b7c){logger[_0xed0e('0x13')](_0xed0e('0x11'),_0x3f15b9,_0x5f2b7c);_0x575dce(_0x5f2b7c);});});} \ No newline at end of file +var _0x2fb5=['code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error'];(function(_0x273bba,_0x183961){var _0x59e63d=function(_0x1a1612){while(--_0x1a1612){_0x273bba['push'](_0x273bba['shift']());}};_0x59e63d(++_0x183961);}(_0x2fb5,0xff));var _0x52fb=function(_0x21f931,_0x598b2d){_0x21f931=_0x21f931-0x0;var _0x3f083c=_0x2fb5[_0x21f931];return _0x3f083c;};'use strict';var _=require(_0x52fb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x52fb('0x1'));var rs=require(_0x52fb('0x2'));var fs=require('fs');var Redis=require(_0x52fb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x52fb('0x4'));var logger=require(_0x52fb('0x5'))(_0x52fb('0x6'));var config=require(_0x52fb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x52fb('0x8')]['http']({'port':0x232a});config[_0x52fb('0x9')]=_[_0x52fb('0xa')](config[_0x52fb('0x9')],{'host':_0x52fb('0xb'),'port':0x18eb});var socket=require(_0x52fb('0xc'))(new Redis(config[_0x52fb('0x9')]));require('./chatGroup.socket')[_0x52fb('0xd')](socket);function respondWithRpcPromise(_0x564f94,_0x3a8849,_0x138b87){return new BPromise(function(_0x435584,_0x48b701){return client['request'](_0x564f94,_0x138b87)[_0x52fb('0xe')](function(_0x5cb608){logger[_0x52fb('0xf')]('ChatGroup,\x20%s,\x20%s',_0x3a8849,_0x52fb('0x10'));logger[_0x52fb('0x11')](_0x52fb('0x12'),_0x3a8849,_0x52fb('0x10'),JSON['stringify'](_0x5cb608));if(_0x5cb608[_0x52fb('0x13')]){if(_0x5cb608[_0x52fb('0x13')][_0x52fb('0x14')]===0x1f4){logger[_0x52fb('0x13')]('ChatGroup,\x20%s,\x20%s',_0x3a8849,_0x5cb608[_0x52fb('0x13')]['message']);return _0x48b701(_0x5cb608['error']['message']);}logger[_0x52fb('0x13')](_0x52fb('0x15'),_0x3a8849,_0x5cb608[_0x52fb('0x13')][_0x52fb('0x16')]);return _0x435584(_0x5cb608['error'][_0x52fb('0x16')]);}else{logger['info'](_0x52fb('0x15'),_0x3a8849,_0x52fb('0x10'));_0x435584(_0x5cb608[_0x52fb('0x17')]['message']);}})[_0x52fb('0x18')](function(_0x36b43f){logger[_0x52fb('0x13')]('ChatGroup,\x20%s,\x20%s',_0x3a8849,_0x36b43f);_0x48b701(_0x36b43f);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 24528b6..70e772c 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 _0x6233=['register','length','./chatGroup.events','save','remove','update','emit'];(function(_0x193256,_0xd66f1d){var _0x49ae2a=function(_0x11b12f){while(--_0x11b12f){_0x193256['push'](_0x193256['shift']());}};_0x49ae2a(++_0xd66f1d);}(_0x6233,0x160));var _0x3623=function(_0x2c35a3,_0x48401d){_0x2c35a3=_0x2c35a3-0x0;var _0x341141=_0x6233[_0x2c35a3];return _0x341141;};'use strict';var ChatGroupEvents=require(_0x3623('0x0'));var events=[_0x3623('0x1'),_0x3623('0x2'),_0x3623('0x3')];function createListener(_0x59935f,_0x1fc947){return function(_0x2cd9b5){_0x1fc947[_0x3623('0x4')](_0x59935f,_0x2cd9b5);};}function removeListener(_0x44ce72,_0x215c21){return function(){ChatGroupEvents['removeListener'](_0x44ce72,_0x215c21);};}exports[_0x3623('0x5')]=function(_0x33a645){for(var _0x4f86c0=0x0,_0x1c5231=events[_0x3623('0x6')];_0x4f86c0<_0x1c5231;_0x4f86c0++){var _0x55e9f5=events[_0x4f86c0];var _0x22eb54=createListener('chatGroup:'+_0x55e9f5,_0x33a645);ChatGroupEvents['on'](_0x55e9f5,_0x22eb54);}}; \ No newline at end of file +var _0xc133=['./chatGroup.events','save','remove','emit','register','length','chatGroup:'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xc133,0x142));var _0x3c13=function(_0x3fbc4c,_0x190f82){_0x3fbc4c=_0x3fbc4c-0x0;var _0x265789=_0xc133[_0x3fbc4c];return _0x265789;};'use strict';var ChatGroupEvents=require(_0x3c13('0x0'));var events=[_0x3c13('0x1'),_0x3c13('0x2'),'update'];function createListener(_0x2cde30,_0x342a67){return function(_0x5817df){_0x342a67[_0x3c13('0x3')](_0x2cde30,_0x5817df);};}function removeListener(_0x1d6dab,_0xf398c9){return function(){ChatGroupEvents['removeListener'](_0x1d6dab,_0xf398c9);};}exports[_0x3c13('0x4')]=function(_0x34b2a5){for(var _0x2da12f=0x0,_0x4b4d94=events[_0x3c13('0x5')];_0x2da12f<_0x4b4d94;_0x2da12f++){var _0x1ab472=events[_0x2da12f];var _0x3d0556=createListener(_0x3c13('0x6')+_0x1ab472,_0x34b2a5);ChatGroupEvents['on'](_0x1ab472,_0x3d0556);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 48554f5..a45d8c2 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 _0xd10f=['addMessage','put','update','removeMembers','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/describe','describe','/:id','isAuthenticated','show','/:id/unread','getUnread','getMembers','/:id/messages','getMessages','post','create','/:id/members'];(function(_0x396086,_0x37deca){var _0x48b38e=function(_0x470249){while(--_0x470249){_0x396086['push'](_0x396086['shift']());}};_0x48b38e(++_0x37deca);}(_0xd10f,0x1f3));var _0xfd10=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xd10f[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xfd10('0x0'));var util=require('util');var path=require(_0xfd10('0x1'));var timeout=require('connect-timeout');var express=require(_0xfd10('0x2'));var router=express[_0xfd10('0x3')]();var fs_extra=require(_0xfd10('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfd10('0x5'));var config=require(_0xfd10('0x6'));var controller=require('./chatGroup.controller');router[_0xfd10('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfd10('0x7')](_0xfd10('0x8'),auth['isAuthenticated'](),controller[_0xfd10('0x9')]);router[_0xfd10('0x7')](_0xfd10('0xa'),auth[_0xfd10('0xb')](),controller[_0xfd10('0xc')]);router['get'](_0xfd10('0xd'),auth[_0xfd10('0xb')](),controller[_0xfd10('0xe')]);router[_0xfd10('0x7')]('/:id/members',auth[_0xfd10('0xb')](),controller[_0xfd10('0xf')]);router[_0xfd10('0x7')](_0xfd10('0x10'),auth[_0xfd10('0xb')](),controller[_0xfd10('0x11')]);router[_0xfd10('0x12')]('/',auth[_0xfd10('0xb')](),controller[_0xfd10('0x13')]);router[_0xfd10('0x12')](_0xfd10('0x14'),auth[_0xfd10('0xb')](),controller['addMembers']);router[_0xfd10('0x12')]('/:id/messages',auth[_0xfd10('0xb')](),controller[_0xfd10('0x15')]);router[_0xfd10('0x16')](_0xfd10('0xa'),auth['isAuthenticated'](),controller[_0xfd10('0x17')]);router['delete']('/:id',auth[_0xfd10('0xb')](),controller['destroy']);router['delete'](_0xfd10('0x14'),auth['isAuthenticated'](),controller[_0xfd10('0x18')]);module[_0xfd10('0x19')]=router; \ No newline at end of file +var _0xb691=['isAuthenticated','/describe','describe','show','/:id/unread','/:id/members','getMembers','getMessages','create','post','addMessage','put','/:id','update','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get'];(function(_0x5c9274,_0x4e849b){var _0x1ef7d3=function(_0x1afe19){while(--_0x1afe19){_0x5c9274['push'](_0x5c9274['shift']());}};_0x1ef7d3(++_0x4e849b);}(_0xb691,0x1c4));var _0x1b69=function(_0x477c0c,_0x48b400){_0x477c0c=_0x477c0c-0x0;var _0x37d540=_0xb691[_0x477c0c];return _0x37d540;};'use strict';var multer=require(_0x1b69('0x0'));var util=require('util');var path=require(_0x1b69('0x1'));var timeout=require(_0x1b69('0x2'));var express=require(_0x1b69('0x3'));var router=express[_0x1b69('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1b69('0x5'));var interaction=require(_0x1b69('0x6'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router[_0x1b69('0x7')]('/',auth[_0x1b69('0x8')](),controller['index']);router['get'](_0x1b69('0x9'),auth[_0x1b69('0x8')](),controller[_0x1b69('0xa')]);router[_0x1b69('0x7')]('/:id',auth[_0x1b69('0x8')](),controller[_0x1b69('0xb')]);router['get'](_0x1b69('0xc'),auth['isAuthenticated'](),controller['getUnread']);router[_0x1b69('0x7')](_0x1b69('0xd'),auth[_0x1b69('0x8')](),controller[_0x1b69('0xe')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x1b69('0xf')]);router['post']('/',auth[_0x1b69('0x8')](),controller[_0x1b69('0x10')]);router['post'](_0x1b69('0xd'),auth[_0x1b69('0x8')](),controller['addMembers']);router[_0x1b69('0x11')]('/:id/messages',auth[_0x1b69('0x8')](),controller[_0x1b69('0x12')]);router[_0x1b69('0x13')](_0x1b69('0x14'),auth[_0x1b69('0x8')](),controller[_0x1b69('0x15')]);router[_0x1b69('0x16')]('/:id',auth[_0x1b69('0x8')](),controller['destroy']);router[_0x1b69('0x16')](_0x1b69('0xd'),auth['isAuthenticated'](),controller['removeMembers']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index f188da3..11f1f2a 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 _0x6947=['DATE','long','out','BOOLEAN','exports','INTEGER','ENUM','star','thumb','TEXT','STRING'];(function(_0x51dcf3,_0x32dec3){var _0x4228c1=function(_0x5dfc0d){while(--_0x5dfc0d){_0x51dcf3['push'](_0x51dcf3['shift']());}};_0x4228c1(++_0x32dec3);}(_0x6947,0x72));var _0x7694=function(_0x2b40df,_0x54ec36){_0x2b40df=_0x2b40df-0x0;var _0x4dcfb5=_0x6947[_0x2b40df];return _0x4dcfb5;};'use strict';var Sequelize=require('sequelize');module[_0x7694('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x7694('0x1')]},'ratingType':{'type':Sequelize[_0x7694('0x2')](_0x7694('0x3'),_0x7694('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x7694('0x5')]},'mailTranscript':{'type':Sequelize[_0x7694('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x7694('0x7')]},'disposition':{'type':Sequelize[_0x7694('0x6')]},'secondDisposition':{'type':Sequelize[_0x7694('0x6')]},'thirdDisposition':{'type':Sequelize[_0x7694('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x7694('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x7694('0x6')]},'osVersion':{'type':Sequelize[_0x7694('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x7694('0x6')]},'deviceType':{'type':Sequelize[_0x7694('0x6')]},'referer':{'type':Sequelize[_0x7694('0x5')]},'customerIp':{'type':Sequelize[_0x7694('0x6')]},'formData':{'type':Sequelize[_0x7694('0x5')](_0x7694('0x8'))},'read1stAt':{'type':Sequelize[_0x7694('0x7')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x7694('0x2')]('in',_0x7694('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x7694('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x7694('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x7694('0xa')],'defaultValue':![]}}; \ No newline at end of file +var _0x6c50=['STRING','DATE','long','out','sequelize','exports','BOOLEAN','INTEGER','star','TEXT'];(function(_0x3878c5,_0x26c98b){var _0x5a1ada=function(_0x85cf0f){while(--_0x85cf0f){_0x3878c5['push'](_0x3878c5['shift']());}};_0x5a1ada(++_0x26c98b);}(_0x6c50,0xa4));var _0x06c5=function(_0x3d2911,_0x1a93ed){_0x3d2911=_0x3d2911-0x0;var _0x22f997=_0x6c50[_0x3d2911];return _0x22f997;};'use strict';var Sequelize=require(_0x06c5('0x0'));module[_0x06c5('0x1')]={'closed':{'type':Sequelize[_0x06c5('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x06c5('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0x06c5('0x4'),'thumb'),'defaultValue':_0x06c5('0x4')},'ratingMessage':{'type':Sequelize[_0x06c5('0x5')]},'pathTranscript':{'type':Sequelize[_0x06c5('0x5')]},'mailTranscript':{'type':Sequelize[_0x06c5('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x06c5('0x7')]},'disposition':{'type':Sequelize[_0x06c5('0x6')]},'secondDisposition':{'type':Sequelize[_0x06c5('0x6')]},'thirdDisposition':{'type':Sequelize[_0x06c5('0x6')]},'note':{'type':Sequelize[_0x06c5('0x6')]},'browserName':{'type':Sequelize[_0x06c5('0x6')]},'browserVersion':{'type':Sequelize[_0x06c5('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x06c5('0x6')]},'deviceModel':{'type':Sequelize[_0x06c5('0x6')]},'deviceVendor':{'type':Sequelize[_0x06c5('0x6')]},'deviceType':{'type':Sequelize[_0x06c5('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x06c5('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x06c5('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x06c5('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x06c5('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x06c5('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 2ae1314..908255e 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 _0x1fc0=['limit','count','Content-Range','apply','reject','then','end','stack','name','send','render','merge','contact','agent','interaction','account','Users','map','fullname','TagIds','Tags','forEach','push','talking','answered','unmanaged','abandoned','total','closed','UserId','waiting','disposition','index','ChatInteraction','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','select','field','color','from','tools_tags','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','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','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','value','having','`\x20=\x200','`\x20>\x200','operator','split','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','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','body','compact','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','Sequelize','QueryTypes','clone','unreadMessages','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','ChatWebsiteId','toString','sequelize','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','groupBy','ChatInteractionId','rows','show','params','include','create','destroy','describe','ChatWebsite','findOne','vidaooApiKey','vidaooTopic','vidaooNote','vidaooMetadata','vidaooEscalation','email','POST','isNull','metadata','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','ChatMessage','updateAttributes','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','agent_alias','agent_fullname','direction','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','auth','pass','SendMail','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','pick','$gte','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','getMyMessages','secret','includeAgent','alias','addTags','setTags','spread','emit','removeTags','server','files','tmp','root','attachments','lastName','Account','Owner','mkdirSync','Chat','closedAt','browserName','osName','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','out','firstName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','http','client','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','error','code','message','catch','sendStatus','status','json','offset','undefined'];(function(_0x35007a,_0x58a0d4){var _0x574f68=function(_0xd1c129){while(--_0xd1c129){_0x35007a['push'](_0x35007a['shift']());}};_0x574f68(++_0x58a0d4);}(_0x1fc0,0x10f));var _0x01fc=function(_0x51f90c,_0x1a61fa){_0x51f90c=_0x51f90c-0x0;var _0x5be98d=_0x1fc0[_0x51f90c];return _0x5be98d;};'use strict';var emlformat=require(_0x01fc('0x0'));var rimraf=require(_0x01fc('0x1'));var zipdir=require(_0x01fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x01fc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x01fc('0x4'));var sox=require(_0x01fc('0x5'));var csv=require('to-csv');var ejs=require(_0x01fc('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x01fc('0x7'));var squel=require(_0x01fc('0x8'));var crypto=require('crypto');var jsforce=require(_0x01fc('0x9'));var deskjs=require(_0x01fc('0xa'));var toCsv=require(_0x01fc('0xb'));var querystring=require(_0x01fc('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x01fc('0xd'));var as=require(_0x01fc('0xe'));var pdf=require(_0x01fc('0xf'));var hardwareService=require(_0x01fc('0x10'));var logger=require('../../config/logger')(_0x01fc('0x11'));var utils=require('../../config/utils');var config=require(_0x01fc('0x12'));var licenseUtil=require(_0x01fc('0x13'));var db=require(_0x01fc('0x14'))['db'];config[_0x01fc('0x15')]=_[_0x01fc('0x16')](config[_0x01fc('0x15')],{'host':_0x01fc('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x01fc('0x15')]));require(_0x01fc('0x18'))[_0x01fc('0x19')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x01fc('0x1a')]({'port':0x232b});var client9004=jayson[_0x01fc('0x1b')][_0x01fc('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0x39a2c5,_0xb75cf9,_0x102b6a,_0x44cfa2){return new BPromise(function(_0x5530aa,_0x1401e6){var _0x3e4e5b=_0x44cfa2||client;return _0x3e4e5b[_0x01fc('0x1c')](_0x39a2c5,_0x102b6a)['then'](function(_0x7f844){logger[_0x01fc('0x1d')](_0x01fc('0x1e'),_0xb75cf9,_0x01fc('0x1f'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xb75cf9,'request\x20sent',JSON['stringify'](_0x7f844));if(_0x7f844[_0x01fc('0x20')]){if(_0x7f844[_0x01fc('0x20')][_0x01fc('0x21')]===0x1f4){logger['error'](_0x01fc('0x1e'),_0xb75cf9,_0x7f844['error']['message']);return _0x1401e6(_0x7f844['error']['message']);}logger[_0x01fc('0x20')]('ChatInteraction,\x20%s,\x20%s',_0xb75cf9,_0x7f844['error'][_0x01fc('0x22')]);return _0x5530aa(_0x7f844[_0x01fc('0x20')][_0x01fc('0x22')]);}else{logger[_0x01fc('0x1d')](_0x01fc('0x1e'),_0xb75cf9,'request\x20sent');_0x5530aa(_0x7f844['result'][_0x01fc('0x22')]);}})[_0x01fc('0x23')](function(_0xf7b54e){logger['error'](_0x01fc('0x1e'),_0xb75cf9,_0xf7b54e);_0x1401e6(_0xf7b54e);});});}function respondWithStatusCode(_0x4f4f77,_0x350bfa){_0x350bfa=_0x350bfa||0xcc;return function(_0x32e676){if(_0x32e676){return _0x4f4f77[_0x01fc('0x24')](_0x350bfa);}return _0x4f4f77[_0x01fc('0x25')](_0x350bfa)['end']();};}function respondWithResult(_0x5a9a74,_0x98590e){_0x98590e=_0x98590e||0xc8;return function(_0x296a89){if(_0x296a89){return _0x5a9a74[_0x01fc('0x25')](_0x98590e)[_0x01fc('0x26')](_0x296a89);}};}function respondWithFilteredResult(_0x57ca00,_0x96bb96){return function(_0x1234f8){if(_0x1234f8){var _0x44d204=typeof _0x96bb96[_0x01fc('0x27')]===_0x01fc('0x28')&&typeof _0x96bb96[_0x01fc('0x29')]==='undefined';var _0x3c447c=_0x1234f8[_0x01fc('0x2a')];var _0x26931c=_0x44d204?0x0:_0x96bb96[_0x01fc('0x27')];var _0x259dff=_0x44d204?_0x1234f8['count']:_0x96bb96[_0x01fc('0x27')]+_0x96bb96[_0x01fc('0x29')];var _0x101d00;if(_0x259dff>=_0x3c447c){_0x259dff=_0x3c447c;_0x101d00=0xc8;}else{_0x101d00=0xce;}_0x57ca00['status'](_0x101d00);return _0x57ca00['set'](_0x01fc('0x2b'),_0x26931c+'-'+_0x259dff+'/'+_0x3c447c)[_0x01fc('0x26')](_0x1234f8);}return null;};}function patchUpdates(_0x335948){return function(_0x369ef0){try{jsonpatch[_0x01fc('0x2c')](_0x369ef0,_0x335948,!![]);}catch(_0x515261){return BPromise[_0x01fc('0x2d')](_0x515261);}return _0x369ef0['save']();};}function saveUpdates(_0x7d93b0,_0x18bdb0){return function(_0x1f2fb6){if(_0x1f2fb6){return _0x1f2fb6['update'](_0x7d93b0)[_0x01fc('0x2e')](function(_0x2bd2fb){return _0x2bd2fb;});}return null;};}function removeEntity(_0x559a9c,_0xb78267){return function(_0x195ed5){if(_0x195ed5){return _0x195ed5['destroy']()[_0x01fc('0x2e')](function(){_0x559a9c[_0x01fc('0x25')](0xcc)[_0x01fc('0x2f')]();});}};}function handleEntityNotFound(_0x501a45,_0x7609d){return function(_0x574e55){if(!_0x574e55){_0x501a45[_0x01fc('0x24')](0x194);}return _0x574e55;};}function handleError(_0x4eafa8,_0x264cb1){_0x264cb1=_0x264cb1||0x1f4;return function(_0x5d4f39){logger[_0x01fc('0x20')](_0x5d4f39[_0x01fc('0x30')]);if(_0x5d4f39[_0x01fc('0x31')]){delete _0x5d4f39['name'];}_0x4eafa8[_0x01fc('0x25')](_0x264cb1)[_0x01fc('0x32')](_0x5d4f39);};}function getMustacheRender(_0xe36570,_0x1efc77){return Mustache[_0x01fc('0x33')](_0xe36570,_[_0x01fc('0x34')](_0x1efc77['body'],{'contact':_0x1efc77[_0x01fc('0x35')],'message':_0x1efc77[_0x01fc('0x22')],'agent':_0x1efc77[_0x01fc('0x36')],'interaction':_0x1efc77[_0x01fc('0x37')],'account':_0x1efc77[_0x01fc('0x38')]}))||'';}function getInteractionUsers(_0x42dbd6,_0x25ec9f){return new BPromise(function(_0x2dfae5,_0x45cbfe){try{if(_0x25ec9f[_0x42dbd6['id']]){_0x42dbd6[_0x01fc('0x39')]=_[_0x01fc('0x3a')](_0x25ec9f[_0x42dbd6['id']],function(_0x179685){return{'id':_0x179685['id'],'fullname':_0x179685[_0x01fc('0x3b')]};});}}catch(_0x1bab94){_0x45cbfe(_0x1bab94);}_0x2dfae5(_0x42dbd6);});}function getInteractionTags(_0x6af798,_0xeadf2e){return new BPromise(function(_0x458a8b,_0x1ab336){try{if(_0x6af798[_0x01fc('0x3c')]){_0x6af798[_0x01fc('0x3d')]=[];_0x6af798[_0x01fc('0x3c')]['split'](',')[_0x01fc('0x3e')](function(_0x5b5406){_0x6af798[_0x01fc('0x3d')][_0x01fc('0x3f')](_0xeadf2e[_0x5b5406]);});}delete _0x6af798[_0x01fc('0x3c')];}catch(_0x4ac97a){_0x1ab336(_0x4ac97a);}_0x458a8b(_0x6af798);});}function updateChatInteraction(_0x777c77,_0x5571e8,_0x164455){return new BPromise(function(_0x57fa03,_0x59372a){return getInteractionUsers(_0x777c77,_0x164455)[_0x01fc('0x2e')](function(_0x74c3f5){return getInteractionTags(_0x74c3f5,_0x5571e8);})['then'](function(_0x1ae49d){return getStateInteraction(_0x1ae49d);})[_0x01fc('0x2e')](function(_0x152dce){_0x57fa03(_0x152dce);})[_0x01fc('0x23')](function(_0x1bb843){_0x59372a(_0x1bb843);});});}function getStateInteraction(_0x35fb05){return new BPromise(function(_0x5b9325){_0x35fb05['waiting']=0x0;_0x35fb05[_0x01fc('0x40')]=0x0;_0x35fb05[_0x01fc('0x41')]=0x0;_0x35fb05[_0x01fc('0x42')]=0x0;_0x35fb05[_0x01fc('0x43')]=0x0;_0x35fb05[_0x01fc('0x44')]=0x0;if(!_0x35fb05[_0x01fc('0x45')]&&!_0x35fb05[_0x01fc('0x46')]){_0x35fb05['waiting']+=0x1;}if(!_0x35fb05[_0x01fc('0x45')]&&_0x35fb05[_0x01fc('0x46')]){_0x35fb05[_0x01fc('0x40')]+=0x1;if(_0x35fb05[_0x01fc('0x47')]){_0x35fb05[_0x01fc('0x47')]-=0x1;}}if(_0x35fb05[_0x01fc('0x45')]&&_0x35fb05[_0x01fc('0x48')]===_0x01fc('0x43')){_0x35fb05[_0x01fc('0x43')]+=0x1;if(_0x35fb05[_0x01fc('0x47')]){_0x35fb05[_0x01fc('0x47')]-=0x1;}}else if(_0x35fb05[_0x01fc('0x45')]&&!_0x35fb05[_0x01fc('0x46')]&&_0x35fb05[_0x01fc('0x48')]){_0x35fb05['unmanaged']+=0x1;if(_0x35fb05[_0x01fc('0x47')]){_0x35fb05[_0x01fc('0x47')]-=0x1;}}else if(_0x35fb05[_0x01fc('0x45')]&&_0x35fb05[_0x01fc('0x46')]){_0x35fb05[_0x01fc('0x41')]+=0x1;if(_0x35fb05['talking']){_0x35fb05['talking']-=0x1;}}_0x35fb05[_0x01fc('0x44')]+=0x1;_0x5b9325(_0x35fb05);});}exports[_0x01fc('0x49')]=function(_0x52fa24,_0x9f3581){var _0x1bb01d={},_0x3e9091={},_0x3b332b={'count':0x0,'rows':[]};var _0x2a2eea=_[_0x01fc('0x3a')](db[_0x01fc('0x4a')][_0x01fc('0x4b')],function(_0x2fb317){return{'name':_0x2fb317['fieldName'],'type':_0x2fb317[_0x01fc('0x4c')][_0x01fc('0x4d')]};});_0x3e9091[_0x01fc('0x4e')]=_[_0x01fc('0x3a')](_0x2a2eea,_0x01fc('0x31'));_0x3e9091[_0x01fc('0x4f')]=_[_0x01fc('0x50')](_0x52fa24[_0x01fc('0x4f')]);_0x3e9091[_0x01fc('0x51')]=_['intersection'](_0x3e9091[_0x01fc('0x4e')],_0x3e9091['query']);_0x1bb01d[_0x01fc('0x52')]=_[_0x01fc('0x53')](_0x3e9091[_0x01fc('0x4e')],qs[_0x01fc('0x54')](_0x52fa24[_0x01fc('0x4f')][_0x01fc('0x54')]));_0x1bb01d[_0x01fc('0x52')]=_0x1bb01d[_0x01fc('0x52')][_0x01fc('0x55')]?_0x1bb01d[_0x01fc('0x52')]:_0x3e9091[_0x01fc('0x4e')];if(!_0x52fa24[_0x01fc('0x4f')]['hasOwnProperty'](_0x01fc('0x56'))){_0x1bb01d[_0x01fc('0x29')]=qs[_0x01fc('0x29')](_0x52fa24['query']['limit']);_0x1bb01d[_0x01fc('0x27')]=qs[_0x01fc('0x27')](_0x52fa24[_0x01fc('0x4f')][_0x01fc('0x27')]);}_0x1bb01d[_0x01fc('0x57')]=qs['sort'](_0x52fa24[_0x01fc('0x4f')][_0x01fc('0x58')]);_0x1bb01d[_0x01fc('0x59')]=qs[_0x01fc('0x51')](_['pick'](_0x52fa24['query'],_0x3e9091[_0x01fc('0x51')]),_0x2a2eea);var _0x570053=[];var _0x3bda39=squel[_0x01fc('0x5a')]()[_0x01fc('0x5b')]('id')['field']('name')[_0x01fc('0x5b')](_0x01fc('0x5c'))[_0x01fc('0x5d')](_0x01fc('0x5e'));var _0x44f197=squel[_0x01fc('0x5a')]()[_0x01fc('0x5b')]('u.id')[_0x01fc('0x5b')](_0x01fc('0x5f'))['field'](_0x01fc('0x60'))[_0x01fc('0x5d')](_0x01fc('0x61'),'ui')[_0x01fc('0x62')](_0x01fc('0x63'),'u',_0x01fc('0x64'));var _0x15741d=squel['select']()[_0x01fc('0x5d')](_0x01fc('0x65'),'i')['left_join'](_0x01fc('0x66'),'c',_0x01fc('0x67'))['left_join']('users','o',_0x01fc('0x68'))['left_join'](_0x01fc('0x69'),'a',_0x01fc('0x6a'))['left_join'](_0x01fc('0x6b'),'me','me.ChatInteractionId\x20=\x20i.id')[_0x01fc('0x62')](_0x01fc('0x6c'),'it',_0x01fc('0x6d'))['left_join'](_0x01fc('0x5e'),'t',_0x01fc('0x6e'));var _0x109822=squel[_0x01fc('0x6f')]();var _0x3a3406=[];var _0xce3369=squel[_0x01fc('0x6f')]();var _0x333001;if(_0x52fa24[_0x01fc('0x4f')]['search']){_0x333001=as[_0x01fc('0x70')](_0x52fa24[_0x01fc('0x4f')][_0x01fc('0x71')]);var _0x36c9ed=_0x333001[_0x01fc('0x72')];for(var _0x17e72e=0x0;_0x17e72e<_0x333001['conditions']['length'];_0x17e72e++){var _0x319830=_0x333001['conditions'][_0x17e72e];var _0x145c3e='i';var _0x242a3b=_['find'](_0x2a2eea,[_0x01fc('0x31'),_0x319830['field']]);if(!_0x242a3b){switch(_0x319830['field']){case'unreadMessages':if(_0x319830[_0x01fc('0x73')]==0x1){_0x15741d[_0x01fc('0x74')]('`'+_0x319830[_0x01fc('0x5b')]+_0x01fc('0x75'));}else{_0x15741d['having']('`'+_0x319830[_0x01fc('0x5b')]+_0x01fc('0x76'));}break;case'Contact':if(_0x319830[_0x01fc('0x77')]==='$substring'){if(_0x319830[_0x01fc('0x73')][_0x01fc('0x78')]('\x20')['length']>0x1){_0x109822[_0x36c9ed](_0x01fc('0x79'),qs['getFullTextValue'](_0x319830['value']),null);}else{var _0x426c90='%'+_0x319830['value']+'%';_0x109822[_0x36c9ed](_0x01fc('0x7a'),_0x426c90,_0x426c90,_0x426c90);}}else{_0x242a3b=_['find'](_0x2a2eea,[_0x01fc('0x31'),_0x01fc('0x7b')]);_0x319830['field']='ContactId';_0x185aed=as[_0x01fc('0x7c')](_0x145c3e,_0x242a3b[_0x01fc('0x4c')],_0x319830);_0x109822[_0x36c9ed](_0x185aed[_0x01fc('0x7d')],_0x185aed[_0x01fc('0x73')][_0x01fc('0x7e')],_0x185aed[_0x01fc('0x73')][_0x01fc('0x2f')]);}break;case _0x01fc('0x7f'):var _0x1ad69b=_0x319830['value'][_0x01fc('0x78')](',')[_0x01fc('0x3a')](function(_0x1b8bef){return Number(_0x1b8bef);});_0x1ad69b[_0x01fc('0x3e')](function(_0x4cd4d0){_0xce3369['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4cd4d0+',%');});_0x3a3406=_['union'](_0x3a3406,_0x1ad69b);break;case _0x01fc('0x80'):if(_0x319830[_0x01fc('0x77')]===_0x01fc('0x81')){_0x109822[_0x36c9ed](_0x01fc('0x82'),'%'+_0x319830[_0x01fc('0x73')]+'%',null);}else{_0x242a3b=_[_0x01fc('0x83')](_0x2a2eea,[_0x01fc('0x31'),_0x01fc('0x46')]);_0x319830[_0x01fc('0x5b')]=_0x01fc('0x46');_0x185aed=as[_0x01fc('0x7c')](_0x145c3e,_0x242a3b[_0x01fc('0x4c')],_0x319830);_0x109822[_0x36c9ed](_0x185aed['text'],_0x185aed['value'][_0x01fc('0x7e')],_0x185aed['value']['end']);}break;case _0x01fc('0x84'):_0x185aed=as[_0x01fc('0x7c')]('me',null,_0x319830);_0x109822[_0x36c9ed](_0x185aed[_0x01fc('0x7d')],_0x185aed[_0x01fc('0x73')][_0x01fc('0x7e')],_0x185aed[_0x01fc('0x73')][_0x01fc('0x2f')]);break;}}else{var _0x185aed=as[_0x01fc('0x7c')](_0x145c3e,_0x242a3b[_0x01fc('0x4c')],_0x319830);_0x109822[_0x36c9ed](_0x185aed[_0x01fc('0x7d')],_0x185aed[_0x01fc('0x73')][_0x01fc('0x7e')],_0x185aed[_0x01fc('0x73')][_0x01fc('0x2f')]);}}}else{var _0x56394c=_(_0x52fa24[_0x01fc('0x4f')])[_0x01fc('0x50')]()[_0x01fc('0x3a')](function(_0x4ca5a3){return _['some'](_0x2a2eea,[_0x01fc('0x31'),_0x4ca5a3])?_0x4ca5a3:undefined;})[_0x01fc('0x85')]()[_0x01fc('0x73')]();if(!_['isEmpty'](_0x56394c)){_0x56394c[_0x01fc('0x3e')](function(_0x35085f){if(_0x35085f==='ChatWebsiteId'){_0x15741d['where']('i.ChatWebsiteId\x20IN\x20?',[][_0x01fc('0x86')](_0x52fa24[_0x01fc('0x4f')][_0x35085f]));}else if(_0x35085f===_0x01fc('0x87')){var _0x13c83b=JSON[_0x01fc('0x88')](_0x52fa24['query'][_0x35085f])['$gte'];var _0x513974=JSON['parse'](_0x52fa24[_0x01fc('0x4f')][_0x35085f])[_0x01fc('0x89')];_0x15741d[_0x01fc('0x59')](_0x01fc('0x8a'),_0x13c83b,_0x513974);}else{if(_0x52fa24['query'][_0x35085f]===_0x01fc('0x8b')){_0x15741d[_0x01fc('0x59')]('i.'+_0x35085f+_0x01fc('0x8c'));}else{_0x15741d[_0x01fc('0x59')]('i.'+_0x35085f+_0x01fc('0x8d'),_0x52fa24[_0x01fc('0x4f')][_0x35085f]);}}});}if(_0x52fa24['query'][_0x01fc('0x8e')]){if(_0x52fa24['query'][_0x01fc('0x8e')]==0x1){_0x15741d[_0x01fc('0x74')](_0x01fc('0x8f'));}else{_0x15741d[_0x01fc('0x74')](_0x01fc('0x90'));}}if(_0x52fa24[_0x01fc('0x4f')][_0x01fc('0x91')]){_0x3a3406=_[_0x01fc('0x92')](_0x52fa24[_0x01fc('0x4f')][_0x01fc('0x91')])?_0x52fa24[_0x01fc('0x4f')][_0x01fc('0x91')]:new Array(_0x52fa24['query'][_0x01fc('0x91')]);_0x3a3406['forEach'](function(_0x1700ec){_0xce3369['or'](_0x01fc('0x93'),'%,'+_0x1700ec+',%');});}if(_0x52fa24[_0x01fc('0x4f')][_0x01fc('0x94')]){var _0x218075=_0x52fa24[_0x01fc('0x4f')][_0x01fc('0x94')][_0x01fc('0x95')]('\x5c','\x5c\x5c')[_0x01fc('0x95')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x218075)){_0x109822['or']('i.id\x20LIKE\x20?',_0x218075+'%');}else{_0x109822['or'](_0x01fc('0x96'),qs[_0x01fc('0x97')](_0x218075))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x218075+'%');}}}_0x15741d[_0x01fc('0x59')](_0x109822);_0x15741d['group']('i.id');var _0x805c2b={'type':db[_0x01fc('0x98')][_0x01fc('0x99')]['SELECT'],'raw':!![]};var _0x1068da=_0x15741d[_0x01fc('0x9a')]();_0x1068da['field']('i.id');_0x1068da[_0x01fc('0x5b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x01fc('0x9b'));if(_0x1bb01d[_0x01fc('0x57')]){_0x1bb01d[_0x01fc('0x57')]['forEach'](function(_0x277406){var _0x5609a3=_0x277406[0x0]===_0x01fc('0x9c')?_0x277406[0x0]:'i.'+_0x277406[0x0];_0x15741d[_0x01fc('0x57')](_0x5609a3,_0x277406[0x1]===_0x01fc('0x9d')?![]:!![]);});}if(!_[_0x01fc('0x9e')](_0x3a3406)){_0x15741d['having'](_0xce3369);_0x1068da[_0x01fc('0x59')](_0x01fc('0x9f'),_0x3a3406);}BPromise[_0x01fc('0xa0')]()[_0x01fc('0x2e')](function(){if(!_0x333001){if(_0x52fa24[_0x01fc('0x4f')]['ChatWebsiteId'])return;_0x1068da['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x15741d[_0x01fc('0x59')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x52fa24[_0x01fc('0xa1')][_0x01fc('0xa2')]!==_0x01fc('0x36'))return;return _0x52fa24[_0x01fc('0xa1')][_0x01fc('0xa3')]({'attributes':['id'],'raw':!![]})[_0x01fc('0x2e')](function(_0x51c818){if(_[_0x01fc('0x9e')](_0x51c818)){_0x1068da['where'](_0x01fc('0xa4'));_0x15741d[_0x01fc('0x59')](_0x01fc('0xa4'));}else{_0x1068da[_0x01fc('0x59')](_0x01fc('0xa5'),_[_0x01fc('0x3a')](_0x51c818,'id'));_0x15741d[_0x01fc('0x59')](_0x01fc('0xa5'),_[_0x01fc('0x3a')](_0x51c818,'id'));}});})[_0x01fc('0x2e')](function(){if(_0x52fa24['user']['role']===_0x01fc('0x36')&&!_0x333001&&!_0x52fa24[_0x01fc('0x4f')][_0x01fc('0xa6')])return[];return db['sequelize'][_0x01fc('0x4f')](_0x1068da[_0x01fc('0xa7')](),_0x805c2b);})[_0x01fc('0x2e')](function(_0x3b0e49){_0x3b332b['count']=_0x3b0e49['length'];if(_0x3b332b[_0x01fc('0x2a')]===0x0)return[];return db[_0x01fc('0xa8')]['query'](_0x3bda39[_0x01fc('0xa7')](),_0x805c2b)[_0x01fc('0x2e')](function(_0x346a6d){_0x570053=_[_0x01fc('0xa9')](_0x346a6d,'id');_0x805c2b=_['merge'](_0x805c2b,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x52fa24[_0x01fc('0x4f')][_0x01fc('0x54')]){_0x1bb01d[_0x01fc('0x52')][_0x01fc('0x3e')](function(_0x5c19b1){_0x15741d['field']('i.'+_0x5c19b1);});}else{_0x15741d[_0x01fc('0x5b')](_0x01fc('0xaa'),_0x01fc('0x9b'));_0x15741d[_0x01fc('0x5b')]('a.key','Account.key');_0x15741d[_0x01fc('0x5b')](_0x01fc('0xab'),_0x01fc('0xac'));_0x15741d[_0x01fc('0x5b')](_0x01fc('0xad'),'contactName');_0x15741d[_0x01fc('0x5b')](_0x01fc('0xae'));_0x15741d['field']('c.firstName','Contact.firstName');_0x15741d[_0x01fc('0x5b')](_0x01fc('0xaf'),'Contact.lastName');_0x15741d[_0x01fc('0x5b')]('c.email','Contact.email');_0x15741d['field'](_0x01fc('0xb0'),_0x01fc('0xb1'));_0x15741d[_0x01fc('0x5b')](_0x01fc('0xb2'),_0x01fc('0xb3'));_0x15741d[_0x01fc('0x5b')](_0x01fc('0xb4'),_0x01fc('0xb5'));_0x15741d['field']('o.fullname',_0x01fc('0xb6'));_0x15741d[_0x01fc('0x5b')](_0x01fc('0xb7'),_0x01fc('0xb8'));_0x15741d['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x01fc('0x3c'));}if(_0x1bb01d[_0x01fc('0x29')])_0x15741d[_0x01fc('0x29')](_0x1bb01d[_0x01fc('0x29')]);if(_0x1bb01d[_0x01fc('0x27')])_0x15741d[_0x01fc('0x27')](_0x1bb01d[_0x01fc('0x27')]);return db['sequelize'][_0x01fc('0x4f')](_0x15741d[_0x01fc('0xa7')](),_0x805c2b);})['then'](function(_0x32cf8e){if(_0x32cf8e[_0x01fc('0x55')]>0x0)_0x44f197[_0x01fc('0x59')]('ui.ChatInteractionId\x20IN\x20?',_['map'](_0x32cf8e,'id'));return db[_0x01fc('0xa8')][_0x01fc('0x4f')](_0x44f197[_0x01fc('0xa7')](),_0x805c2b)[_0x01fc('0x2e')](function(_0x4fe3a1){var _0x2eeb31=_[_0x01fc('0xb9')](_0x4fe3a1,_0x01fc('0xba'));var _0xde5375=[];_0x32cf8e[_0x01fc('0x3e')](function(_0x37254b){_0xde5375['push'](updateChatInteraction(_0x37254b,_0x570053,_0x2eeb31));});return BPromise['all'](_0xde5375);});});})[_0x01fc('0x2e')](function(_0x10f657){_0x3b332b[_0x01fc('0xbb')]=_0x10f657;return _0x3b332b;})['then'](respondWithFilteredResult(_0x9f3581,_0x1bb01d))[_0x01fc('0x23')](handleError(_0x9f3581,null));};exports[_0x01fc('0xbc')]=function(_0x47415d,_0x146c41){var _0x2136b9={'raw':![],'where':{'id':_0x47415d[_0x01fc('0xbd')]['id']}},_0x2116c9={};_0x2116c9[_0x01fc('0x4e')]=_[_0x01fc('0x50')](db[_0x01fc('0x4a')][_0x01fc('0x4b')]);_0x2116c9['query']=_[_0x01fc('0x50')](_0x47415d[_0x01fc('0x4f')]);_0x2116c9[_0x01fc('0x51')]=_[_0x01fc('0x53')](_0x2116c9[_0x01fc('0x4e')],_0x2116c9['query']);_0x2136b9['attributes']=_[_0x01fc('0x53')](_0x2116c9['model'],qs[_0x01fc('0x54')](_0x47415d[_0x01fc('0x4f')][_0x01fc('0x54')]));_0x2136b9[_0x01fc('0x52')]=_0x2136b9[_0x01fc('0x52')][_0x01fc('0x55')]?_0x2136b9[_0x01fc('0x52')]:_0x2116c9['model'];if(_0x47415d['query']['includeAll']){_0x2136b9[_0x01fc('0xbe')]=[{'all':!![]}];}_0x2136b9=_[_0x01fc('0x34')]({},_0x2136b9,_0x47415d['options']);return db[_0x01fc('0x4a')][_0x01fc('0x83')](_0x2136b9)[_0x01fc('0x2e')](handleEntityNotFound(_0x146c41,null))['then'](respondWithResult(_0x146c41,null))[_0x01fc('0x23')](handleError(_0x146c41,null));};exports['create']=function(_0x586f0e,_0x4d43ac){return db[_0x01fc('0x4a')][_0x01fc('0xbf')](_0x586f0e[_0x01fc('0x84')],{})[_0x01fc('0x2e')](respondWithResult(_0x4d43ac,0xc9))[_0x01fc('0x23')](handleError(_0x4d43ac,null));};exports['update']=function(_0x466c76,_0x463351){if(_0x466c76['body']['id']){delete _0x466c76[_0x01fc('0x84')]['id'];}return db[_0x01fc('0x4a')][_0x01fc('0x83')]({'where':{'id':_0x466c76[_0x01fc('0xbd')]['id']}})[_0x01fc('0x2e')](handleEntityNotFound(_0x463351,null))[_0x01fc('0x2e')](saveUpdates(_0x466c76[_0x01fc('0x84')],null))[_0x01fc('0x2e')](respondWithResult(_0x463351,null))[_0x01fc('0x23')](handleError(_0x463351,null));};exports[_0x01fc('0xc0')]=function(_0x3a7d0b,_0x22b0a5){return db[_0x01fc('0x4a')][_0x01fc('0x83')]({'where':{'id':_0x3a7d0b['params']['id']}})[_0x01fc('0x2e')](handleEntityNotFound(_0x22b0a5,null))[_0x01fc('0x2e')](removeEntity(_0x22b0a5,null))[_0x01fc('0x23')](handleError(_0x22b0a5,null));};exports[_0x01fc('0xc1')]=function(_0x20f319,_0x1639b8){return db[_0x01fc('0x4a')]['describe']()[_0x01fc('0x2e')](respondWithResult(_0x1639b8,null))['catch'](handleError(_0x1639b8,null));};exports['createVidaooSession']=function(_0x5568c7,_0x221709){var _0x2372fc=_0x5568c7['params']['id'];var _0x29a729;var _0x3bc43d;var _0x46642c;return db['ChatInteraction']['findOne']({'where':{'id':_0x2372fc}})['then'](function(_0x2faadc){_0x29a729=_0x2faadc;return db[_0x01fc('0xc2')][_0x01fc('0xc3')]({'where':{'id':_0x2faadc[_0x01fc('0xa6')]},'attributes':['id',_0x01fc('0xc4'),'vidaooEscalation',_0x01fc('0xc5'),_0x01fc('0xc6'),_0x01fc('0xc7')],'raw':!![]});})[_0x01fc('0x2e')](function(_0x4db85a){if(_0x4db85a&&_0x4db85a['vidaooApiKey']&&_0x4db85a[_0x01fc('0xc8')]){_0x3bc43d=_0x4db85a;var _0x5f0cc3={'interaction':{'id':_0x2372fc},'agent':{'id':_0x5568c7['user']['id'],'name':_0x5568c7['user'][_0x01fc('0x31')],'fullname':_0x5568c7['user']['fullname'],'email':_0x5568c7[_0x01fc('0xa1')][_0x01fc('0xc9')]},'contact':_0x5568c7[_0x01fc('0x84')][_0x01fc('0x35')],'account':_0x5568c7['body'][_0x01fc('0x38')]};var _0x3dc2eb={'rejectUnauthorized':![],'method':_0x01fc('0xca'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x4db85a[_0x01fc('0xc4')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5568c7[_0x01fc('0xa1')][_0x01fc('0xc9')]],'buttons':null,'topic':_0x3bc43d[_0x01fc('0xc5')],'note':_[_0x01fc('0xcb')](_0x3bc43d[_0x01fc('0xc6')])?null:getMustacheRender(_0x3bc43d[_0x01fc('0xc6')],_0x5f0cc3),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x01fc('0xcb')](_0x3bc43d[_0x01fc('0xc7')])){var _0x58e410=getMustacheRender(_0x3bc43d[_0x01fc('0xc7')],_0x5f0cc3);var _0x4daa93=JSON[_0x01fc('0x88')](_0x58e410);_0x3dc2eb[_0x01fc('0x84')][_0x01fc('0xcc')]=_0x4daa93;}}catch(_0x524af0){throw new db['Sequelize']['ValidationError'](_0x01fc('0xcd'));}return rp(_0x3dc2eb);}else{throw new db['Sequelize'][(_0x01fc('0xce'))](_0x01fc('0xcf'));}})[_0x01fc('0x2e')](function(_0x21321c){_0x46642c=_0x21321c;if(_0x46642c['id']){var _0x5e6c9b={'body':_0x46642c['join_url'],'ChatWebsiteId':_0x3bc43d['id'],'ChatInteractionId':_0x29a729['id'],'direction':'out','UserId':_0x5568c7[_0x01fc('0xa1')]['id']};return db[_0x01fc('0xd0')][_0x01fc('0xbf')](_0x5e6c9b,{});}else{throw new db[(_0x01fc('0x98'))][(_0x01fc('0xce'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x01fc('0x2e')](function(){return _0x29a729[_0x01fc('0xd1')]({'vidaooSessionId':_0x46642c['id']});})[_0x01fc('0x2e')](respondWithResult(_0x221709,null))[_0x01fc('0x23')](handleError(_0x221709,null));};exports[_0x01fc('0xd2')]=function(_0x59a1ff,_0x3d7c32){if(_0x59a1ff[_0x01fc('0x84')]['id']){delete _0x59a1ff[_0x01fc('0x84')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x59a1ff['params']['id']},'include':[{'model':db[_0x01fc('0xd3')],'as':_0x01fc('0xd4')}]})[_0x01fc('0x2e')](handleEntityNotFound(_0x3d7c32,null))['then'](saveUpdates(_0x59a1ff[_0x01fc('0x84')],null))[_0x01fc('0x2e')](respondWithResult(_0x3d7c32,null))['catch'](handleError(_0x3d7c32,null));};exports['abandon']=function(_0x3366f0,_0x353424,_0x95de65){if(_0x3366f0[_0x01fc('0x84')]['id']){delete _0x3366f0[_0x01fc('0x84')]['id'];}return db[_0x01fc('0x4a')][_0x01fc('0x83')]({'where':{'id':_0x3366f0['params']['id']}})['then'](function(_0x502ba9){if(!_0x502ba9){logger[_0x01fc('0x20')](_0x01fc('0xd5'),_0x01fc('0xd6'),0x194,_0x01fc('0xd7'));_0x353424[_0x01fc('0x24')](0x194);}else{if(_0x502ba9[_0x01fc('0x46')]){throw new db[(_0x01fc('0x98'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x502ba9;})[_0x01fc('0x2e')](function(_0x555d65){if(_0x555d65){return _0x555d65['update']({'closed':_0x3366f0[_0x01fc('0x84')][_0x01fc('0x45')],'disposition':_0x3366f0['body']['disposition']})[_0x01fc('0x2e')](function(_0x28f5b6){return _0x28f5b6;});}})[_0x01fc('0x2e')](function(_0x4b50ba){return respondWithRpcPromise(_0x01fc('0xd8'),_0x01fc('0xd6'),_0x3366f0[_0x01fc('0x84')],client9004);})['then'](respondWithResult(_0x353424,null))[_0x01fc('0x23')](handleError(_0x353424,null));};exports[_0x01fc('0xd9')]=function(_0x55522e,_0x393dea,_0xe24a48){_0x55522e['body'][_0x01fc('0x31')]=_0x55522e['file'][_0x01fc('0xda')];_0x55522e[_0x01fc('0x84')][_0x01fc('0xdb')]=_0x55522e[_0x01fc('0xdc')][_0x01fc('0xdd')];_0x55522e[_0x01fc('0x84')][_0x01fc('0x4c')]=_0x55522e[_0x01fc('0xdc')][_0x01fc('0xde')];return db[_0x01fc('0xdf')][_0x01fc('0xbf')](_0x55522e[_0x01fc('0x84')])[_0x01fc('0x2e')](respondWithResult(_0x393dea,0xc9))[_0x01fc('0x23')](handleError(_0x393dea,null));};exports[_0x01fc('0xe0')]=function(_0xcead6a,_0x56abf4,_0x31df3){return db[_0x01fc('0x4a')][_0x01fc('0xc3')]({'where':{'id':_0xcead6a['params']['id']},'raw':!![]})[_0x01fc('0x2e')](handleEntityNotFound(_0x56abf4,null))['then'](function(_0x5118a3){if(_0x5118a3){if(_0x5118a3[_0x01fc('0x45')]){return _0x56abf4[_0x01fc('0x25')](0x193)[_0x01fc('0x26')]({'status':0x193,'message':_0x01fc('0xe1')});}return db[_0x01fc('0xdf')][_0x01fc('0xc3')]({'where':{'id':_0xcead6a[_0x01fc('0x4f')][_0x01fc('0xe2')]},'raw':!![]})[_0x01fc('0x2e')](handleEntityNotFound(_0x56abf4,null));}})[_0x01fc('0x2e')](function(_0x436681){if(_0x436681){var _0x1961ec=_0x436681[_0x01fc('0xe3')]!==null;var _0x152986=path[_0x01fc('0xe4')](config['root'],'server/files/attachments/');if(_0x1961ec){_0x152986=path[_0x01fc('0xe4')](_0x152986,'offline-chat/');}var _0x3bd6cc=path[_0x01fc('0xe4')](_0x152986,_0x436681[_0x01fc('0xdb')]);return _0x56abf4[_0x01fc('0xe5')](_0x3bd6cc);}})['catch'](handleError(_0x56abf4,null));};exports[_0x01fc('0xe6')]=function(_0x37f1e9,_0x39ad97){var _0x3409e9=null;var _0x4ca7ea=null;var _0x2a0735=null;var _0x3b1607=null;if(_0x37f1e9['body']['id']){delete _0x37f1e9[_0x01fc('0x84')]['id'];}if(_0x37f1e9[_0x01fc('0x84')][_0x01fc('0xe7')]){_0x3b1607=path['join'](config['root'],_0x01fc('0xe8'),util[_0x01fc('0xe9')](_0x01fc('0xea'),Date[_0x01fc('0xeb')]()));_0x37f1e9[_0x01fc('0x84')][_0x01fc('0xec')]=_0x3b1607;}return db[_0x01fc('0x4a')]['find']({'where':{'id':_0x37f1e9[_0x01fc('0xbd')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x01fc('0xed'),'include':[{'model':db['User'],'as':'User'}]}]})[_0x01fc('0x2e')](handleEntityNotFound(_0x39ad97,null))['then'](saveUpdates(_0x37f1e9['body'],null))[_0x01fc('0x2e')](function(_0x382d26){if(_0x382d26){_0x3409e9=_0x382d26;return db['ChatWebsite']['find']({'where':{'id':_0x3409e9[_0x01fc('0xa6')]}});}})['then'](function(_0x465176){if(_0x465176){_0x2a0735=_0x465176;return db['CmContact']['find']({'where':{'id':_0x3409e9[_0x01fc('0x7b')]}});}})[_0x01fc('0x2e')](function(_0x4e5a91){if(_0x4e5a91){_0x4ca7ea=_0x4e5a91;if(_0x3b1607){var _0x37413e=null;for(var _0x3476f7=0x1;_0x3476f7<_0x3409e9[_0x01fc('0xed')][_0x01fc('0x55')];++_0x3476f7){_0x37413e=_0x3409e9[_0x01fc('0xed')][_0x3476f7];var _0x5488a1=_0x37413e['UserId']?util['format'](_0x01fc('0xee'),_0x2a0735[_0x01fc('0xef')],_0x37413e[_0x01fc('0x46')]):_0x01fc('0xf0');var _0x45f593=_0x37f1e9[_0x01fc('0x84')][_0x01fc('0xf1')]||util[_0x01fc('0xe9')]('%s%d',_0x01fc('0xf2'),_0x37413e[_0x01fc('0x7b')]);switch(_0x2a0735[_0x01fc('0xf3')]){case'website_alias':_0x5488a1=_0x37413e[_0x01fc('0x46')]?util[_0x01fc('0xe9')](_0x01fc('0xee'),_0x2a0735['agentAlias'],_0x37413e['UserId']):_0x01fc('0xf0');break;case _0x01fc('0xf4'):_0x5488a1=_0x37413e[_0x01fc('0x46')]?_0x37413e[_0x01fc('0x80')]['alias']||_0x37413e['User'][_0x01fc('0x3b')]:_0x01fc('0xf0');break;case _0x01fc('0xf5'):_0x5488a1=_0x37413e[_0x01fc('0x46')]?_0x37413e['User'][_0x01fc('0x3b')]:_0x01fc('0xf0');break;default:_0x5488a1=_0x37413e[_0x01fc('0x46')]?util[_0x01fc('0xe9')](_0x01fc('0xee'),_0x2a0735[_0x01fc('0xef')],_0x37413e[_0x01fc('0x46')]):_0x01fc('0xf0');}var _0x1a886f=util[_0x01fc('0xe9')]('[%s]\x20%s:\x20%s\x0a',moment(_0x37413e[_0x01fc('0x87')])[_0x01fc('0xe9')]('MM/DD/YYYY\x20HH:mm:ss'),_0x37413e[_0x01fc('0xf6')]==='in'?_0x45f593:_0x5488a1,_0x37413e[_0x01fc('0x84')]);if(!_0x37413e['secret']){fs[_0x01fc('0xf7')](_0x3b1607,_0x1a886f);}}return db[_0x01fc('0xf8')][_0x01fc('0xc3')]({'where':{'service':!![]},'include':[{'model':db[_0x01fc('0xf9')],'as':_0x01fc('0xfa'),'raw':!![]}]});}}})[_0x01fc('0x2e')](function(_0x142184){if(_0x142184&&_0x142184[_0x01fc('0xfa')]&&_0x37f1e9[_0x01fc('0x84')]){var _0x6fdbcc={'tls':{'rejectUnauthorized':![]}};if(_0x142184[_0x01fc('0xfa')]['service']){_0x6fdbcc['service']=_0x142184[_0x01fc('0xfa')][_0x01fc('0xfb')];}else{_0x6fdbcc[_0x01fc('0xfc')]=_0x142184[_0x01fc('0xfa')][_0x01fc('0xfc')];_0x6fdbcc[_0x01fc('0xfd')]=_0x142184[_0x01fc('0xfa')][_0x01fc('0xfd')];_0x6fdbcc[_0x01fc('0xfe')]=_0x142184[_0x01fc('0xfa')][_0x01fc('0xfe')];}if(_0x142184[_0x01fc('0xfa')]['authentication']){_0x6fdbcc[_0x01fc('0xff')]={'user':_0x142184['Smtp']['user'],'pass':_0x142184['Smtp'][_0x01fc('0x100')]};}return respondWithRpcPromise(_0x01fc('0x101'),_0x01fc('0x102'),{'account':_0x6fdbcc,'message':{'from':util[_0x01fc('0xe9')]('\x22%s\x22\x20<%s>',_0x142184[_0x01fc('0x31')],_0x142184[_0x01fc('0xc9')]||_0x142184[_0x01fc('0xfa')]['user']),'to':_0x37f1e9['body'][_0x01fc('0xe7')],'subject':_0x01fc('0x103'),'text':util[_0x01fc('0xe9')](_0x01fc('0x104'),_0x37f1e9['body']['mailTranscript']),'attachments':[{'path':_0x3b1607}]}})[_0x01fc('0x2e')](function(){return _0x3409e9;})['catch'](function(_0x3af125){console[_0x01fc('0x20')](_0x3af125);});}else{return _0x3409e9;}})[_0x01fc('0x2e')](respondWithStatusCode(_0x39ad97,0xc8))['catch'](handleError(_0x39ad97,null));};exports['addMessage']=function(_0xd8d163,_0x43e3af,_0x55d2aa){return db[_0x01fc('0xd0')][_0x01fc('0x83')]({'where':{'id':_0xd8d163[_0x01fc('0xbd')]['id']}})[_0x01fc('0x2e')](handleEntityNotFound(_0x43e3af,null))[_0x01fc('0x2e')](function(_0x28c914){if(_0x28c914){return _0x28c914[_0x01fc('0x105')](_0xd8d163[_0x01fc('0x84')][_0x01fc('0x106')],_[_0x01fc('0x107')](_0xd8d163['body'],[_0x01fc('0x106'),'id'])||{});}})[_0x01fc('0x2e')](respondWithResult(_0x43e3af,null))[_0x01fc('0x23')](handleError(_0x43e3af,null));};exports[_0x01fc('0x108')]=function(_0x9c1532,_0x49803e,_0x971b08){var _0x410675={'raw':![],'where':{}};var _0x274a02={};var _0x333131={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x01fc('0xc3')]({'where':{'id':_0x9c1532[_0x01fc('0xbd')]['id']}})[_0x01fc('0x2e')](handleEntityNotFound(_0x49803e,null))[_0x01fc('0x2e')](function(_0x166c67){if(_0x166c67){_0x274a02[_0x01fc('0x4e')]=_[_0x01fc('0x50')](db[_0x01fc('0xd0')][_0x01fc('0x4b')]);_0x274a02['query']=_['keys'](_0x9c1532[_0x01fc('0x4f')]);_0x274a02[_0x01fc('0x51')]=_['intersection'](_0x274a02[_0x01fc('0x4e')],_0x274a02['query']);_0x410675[_0x01fc('0x52')]=_[_0x01fc('0x53')](_0x274a02[_0x01fc('0x4e')],qs['fields'](_0x9c1532[_0x01fc('0x4f')]['fields']));_0x410675[_0x01fc('0x52')]=_0x410675[_0x01fc('0x52')][_0x01fc('0x55')]?_0x410675[_0x01fc('0x52')]:_0x274a02[_0x01fc('0x4e')];if(!_0x9c1532[_0x01fc('0x4f')][_0x01fc('0x109')]('nolimit')){_0x410675['limit']=qs[_0x01fc('0x29')](_0x9c1532[_0x01fc('0x4f')]['limit']);_0x410675[_0x01fc('0x27')]=qs[_0x01fc('0x27')](_0x9c1532[_0x01fc('0x4f')][_0x01fc('0x27')]);}_0x410675[_0x01fc('0x57')]=qs[_0x01fc('0x58')](_0x9c1532[_0x01fc('0x4f')][_0x01fc('0x58')]);_0x410675[_0x01fc('0x59')]=qs[_0x01fc('0x51')](_[_0x01fc('0x10a')](_0x9c1532['query'],_0x274a02[_0x01fc('0x51')]));_0x410675['where'][_0x01fc('0xba')]=_0x166c67['id'];if(_0x9c1532['query'][_0x01fc('0x94')]){_0x410675[_0x01fc('0x59')]=_['merge'](_0x410675[_0x01fc('0x59')],{'$or':_[_0x01fc('0x3a')](_0x410675[_0x01fc('0x52')],function(_0x799e38){var _0x3d6fd9={};_0x3d6fd9[_0x799e38]={'$like':'%'+_0x9c1532[_0x01fc('0x4f')][_0x01fc('0x94')]+'%'};return _0x3d6fd9;})});}if(_0x9c1532['query'][_0x01fc('0x10b')]){var _0x386a1b=_0x9c1532[_0x01fc('0x4f')]['$gte']['split'](',');var _0x55c158={};_0x55c158[_0x386a1b[0x0]]={'$gte':moment(_0x386a1b[0x1])[_0x01fc('0xe9')](_0x01fc('0x10c'))};_0x410675['where']=_[_0x01fc('0x34')](_0x410675[_0x01fc('0x59')],_0x55c158);}_0x410675=_[_0x01fc('0x34')]({},_0x410675,_0x9c1532[_0x01fc('0x10d')]);return db[_0x01fc('0xd0')][_0x01fc('0x2a')]({'where':_0x410675[_0x01fc('0x59')]})[_0x01fc('0x2e')](function(_0x300aa6){_0x333131[_0x01fc('0x2a')]=_0x300aa6;if(_0x9c1532['query'][_0x01fc('0x10e')]){_0x410675[_0x01fc('0xbe')]=[{'all':!![]}];}return db[_0x01fc('0xd0')][_0x01fc('0x10f')](_0x410675);})[_0x01fc('0x2e')](function(_0x5b67a5){_0x333131['rows']=_0x5b67a5;return _0x333131;});}})['then'](respondWithFilteredResult(_0x49803e,_0x410675))[_0x01fc('0x23')](handleError(_0x49803e,null));};exports[_0x01fc('0x110')]=function(_0x5abfec,_0x16b401,_0x3d71ad){var _0x1aafff={'where':{}},_0x22f7ad={},_0x471b1={'count':0x0,'rows':[]};return db[_0x01fc('0x4a')][_0x01fc('0xc3')]({'where':{'id':_0x5abfec[_0x01fc('0xbd')]['id']}})[_0x01fc('0x2e')](handleEntityNotFound(_0x16b401,null))[_0x01fc('0x2e')](function(_0x520b1a){if(_0x520b1a){_0x22f7ad[_0x01fc('0x4e')]=_[_0x01fc('0x50')](db[_0x01fc('0xd0')][_0x01fc('0x4b')]);_0x22f7ad[_0x01fc('0x4f')]=_[_0x01fc('0x50')](_0x5abfec[_0x01fc('0x4f')]);_0x22f7ad[_0x01fc('0x51')]=_[_0x01fc('0x53')](_0x22f7ad[_0x01fc('0x4e')],_0x22f7ad['query']);_0x1aafff[_0x01fc('0x52')]=_['intersection'](_0x22f7ad[_0x01fc('0x4e')],qs[_0x01fc('0x54')](_0x5abfec['query'][_0x01fc('0x54')]));_0x1aafff[_0x01fc('0x52')]=_0x1aafff[_0x01fc('0x52')][_0x01fc('0x55')]?_0x1aafff[_0x01fc('0x52')]:_0x22f7ad[_0x01fc('0x4e')];if(!_0x5abfec['query']['hasOwnProperty'](_0x01fc('0x56'))){_0x1aafff[_0x01fc('0x29')]=qs[_0x01fc('0x29')](_0x5abfec[_0x01fc('0x4f')]['limit']);_0x1aafff[_0x01fc('0x27')]=qs[_0x01fc('0x27')](_0x5abfec[_0x01fc('0x4f')][_0x01fc('0x27')]);}_0x1aafff[_0x01fc('0x57')]=qs['sort'](_0x5abfec[_0x01fc('0x4f')][_0x01fc('0x58')]);_0x1aafff['where']=qs[_0x01fc('0x51')](_[_0x01fc('0x10a')](_0x5abfec[_0x01fc('0x4f')],_0x22f7ad[_0x01fc('0x51')]));_0x1aafff['where'][_0x01fc('0xba')]=_0x520b1a['id'];if(_0x5abfec[_0x01fc('0x4f')][_0x01fc('0x94')]){_0x1aafff[_0x01fc('0x59')]=_[_0x01fc('0x34')](_0x1aafff[_0x01fc('0x59')],{'$or':_[_0x01fc('0x3a')](_0x1aafff[_0x01fc('0x52')],function(_0x2b25f5){var _0x14d9c1={};_0x14d9c1[_0x2b25f5]={'$like':'%'+_0x5abfec['query'][_0x01fc('0x94')]+'%'};return _0x14d9c1;})});}_0x1aafff[_0x01fc('0x59')][_0x01fc('0x111')]=![];if(_0x5abfec[_0x01fc('0x4f')]['id']){_0x1aafff[_0x01fc('0x59')]['id']={'$gt':_0x5abfec['query']['id']};}_0x1aafff=_[_0x01fc('0x34')]({},_0x1aafff,_0x5abfec[_0x01fc('0x10d')]);return db[_0x01fc('0xd0')][_0x01fc('0x2a')]({'where':_0x1aafff['where']})[_0x01fc('0x2e')](function(_0xca43a9){_0x471b1[_0x01fc('0x2a')]=_0xca43a9;_0x1aafff[_0x01fc('0xbe')]=[];if(_0x5abfec[_0x01fc('0x4f')][_0x01fc('0x112')]){_0x1aafff[_0x01fc('0xbe')][_0x01fc('0x3f')]({'model':db['User'],'as':_0x01fc('0x80'),'attributes':['id',_0x01fc('0x3b'),_0x01fc('0x113')]});}if(_0x5abfec[_0x01fc('0x4f')][_0x01fc('0x10e')]){_0x1aafff['include']=[{'all':!![]}];}return db[_0x01fc('0xd0')]['findAll'](_0x1aafff);})['then'](function(_0x3d465f){_0x471b1[_0x01fc('0xbb')]=_0x3d465f;return _0x471b1;});}})[_0x01fc('0x2e')](respondWithFilteredResult(_0x16b401,_0x1aafff))[_0x01fc('0x23')](handleError(_0x16b401,null));};exports[_0x01fc('0x114')]=function(_0x13859a,_0x4aed16,_0x273311){return db[_0x01fc('0x4a')][_0x01fc('0x83')]({'where':{'id':_0x13859a['params']['id']}})['then'](handleEntityNotFound(_0x4aed16,null))['then'](function(_0x4a4866){if(_0x4a4866){return _0x4a4866[_0x01fc('0x115')](_0x13859a[_0x01fc('0x84')][_0x01fc('0x106')],_[_0x01fc('0x107')](_0x13859a[_0x01fc('0x84')],[_0x01fc('0x106'),'id'])||{})[_0x01fc('0x116')](function(){return db[_0x01fc('0x7f')][_0x01fc('0x10f')]({'attributes':['id',_0x01fc('0x31'),_0x01fc('0x5c')],'where':{'id':_0x13859a[_0x01fc('0x84')][_0x01fc('0x106')]}});})['then'](function(_0xf0f4ad){socket[_0x01fc('0x117')]('chatInteractionTags:save',{'id':Number(_0x13859a[_0x01fc('0xbd')]['id']),'tags':_0xf0f4ad||[]});return{'id':Number(_0x13859a[_0x01fc('0xbd')]['id']),'tags':_0xf0f4ad||[]};});}})['then'](respondWithResult(_0x4aed16,null))[_0x01fc('0x23')](handleError(_0x4aed16,null));};exports['removeTags']=function(_0x226141,_0x57e979,_0x12d4c7){return db[_0x01fc('0x4a')][_0x01fc('0x83')]({'where':{'id':_0x226141[_0x01fc('0xbd')]['id']}})[_0x01fc('0x2e')](handleEntityNotFound(_0x57e979,null))[_0x01fc('0x2e')](function(_0x564f78){if(_0x564f78){return _0x564f78[_0x01fc('0x118')](_0x226141[_0x01fc('0x4f')][_0x01fc('0x106')]);}})['then'](respondWithStatusCode(_0x57e979,null))[_0x01fc('0x23')](handleError(_0x57e979,null));};exports[_0x01fc('0xe5')]=function(_0x53ed0f,_0x391c61){var _0xc28393=moment()['unix']()[_0x01fc('0xa7')]();var _0x303605=path['join'](config['root'],_0x01fc('0x119'),_0x01fc('0x11a'),_0x01fc('0x11b'));var _0x51203e=path[_0x01fc('0xe4')](config[_0x01fc('0x11c')],_0x01fc('0x119'),'files',_0x01fc('0x11d'));var _0x3e5526=path[_0x01fc('0xe4')](_0x303605,_0xc28393);var _0x1e44fd=util[_0x01fc('0xe9')]('transcript-%d-%s.zip',_0x53ed0f[_0x01fc('0xbd')]['id'],_0xc28393);var _0x1ffc1b=path[_0x01fc('0xe4')](_0x303605,_0x1e44fd);var _0x26f14e=[];_0x26f14e['push']({'model':db[_0x01fc('0x80')],'as':_0x01fc('0x80'),'attributes':['id','fullname'],'raw':!![]});_0x26f14e[_0x01fc('0x3f')]({'model':db[_0x01fc('0xd3')],'as':_0x01fc('0xd4'),'attributes':['id','firstName',_0x01fc('0x11e')],'raw':!![]});if(_0x53ed0f[_0x01fc('0x4f')][_0x01fc('0x11d')]){_0x26f14e[_0x01fc('0x3f')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0xd2e9c6=[{'model':db['ChatMessage'],'as':'Messages','attributes':['id',_0x01fc('0x84'),_0x01fc('0x87'),_0x01fc('0xf6'),_0x01fc('0x111'),_0x01fc('0x8e')],'include':_0x26f14e}];_0xd2e9c6[_0x01fc('0x3f')]({'model':db[_0x01fc('0xc2')],'as':_0x01fc('0x11f'),'attributes':['id','name']});_0xd2e9c6[_0x01fc('0x3f')]({'model':db['User'],'as':_0x01fc('0x120'),'attributes':['id',_0x01fc('0x3b')]});return db[_0x01fc('0x4a')][_0x01fc('0x83')]({'where':{'id':_0x53ed0f[_0x01fc('0xbd')]['id']},'include':_0xd2e9c6})[_0x01fc('0x2e')](handleEntityNotFound(_0x391c61,null))[_0x01fc('0x2e')](function(_0x25e31e){if(_0x25e31e){var _0x23f8ce=_0x25e31e['get']({'plain':!![]});fs[_0x01fc('0x121')](_0x3e5526);var _0x538c0c={'channel':_0x01fc('0x122'),'account':_0x23f8ce[_0x01fc('0x11f')][_0x01fc('0x31')],'agent':_0x23f8ce[_0x01fc('0x120')]?_0x23f8ce['Owner'][_0x01fc('0x3b')]:'N.A.','createdAt':moment(_0x23f8ce[_0x01fc('0x87')])['format'](_0x01fc('0x10c'))[_0x01fc('0xa7')](),'closedAt':_0x23f8ce[_0x01fc('0x45')]?moment(_0x23f8ce[_0x01fc('0x123')])[_0x01fc('0xe9')](_0x01fc('0x10c'))[_0x01fc('0xa7')]():'','disposition':_0x23f8ce['disposition'],'chatInfo':{'browser':_0x23f8ce[_0x01fc('0x124')],'os':_0x23f8ce[_0x01fc('0x125')],'referer':_0x23f8ce['referer'],'customerIp':_0x23f8ce[_0x01fc('0x126')],'customerPort':_0x23f8ce[_0x01fc('0x127')]?_0x23f8ce[_0x01fc('0x127')]:_0x01fc('0x128')},'messages':_(_0x23f8ce[_0x01fc('0xed')])[_0x01fc('0x129')]()[_0x01fc('0x94')]({'secret':![]})[_0x01fc('0x3a')](function(_0x4b2145){if(_0x4b2145[_0x01fc('0xdf')]){var _0x5a5f66=path['join'](_0x51203e,_0x4b2145[_0x01fc('0xdf')]['basename']);if(fs[_0x01fc('0x12a')](_0x5a5f66)){fs[_0x01fc('0x12b')](_0x5a5f66)[_0x01fc('0x12c')](fs['createWriteStream'](path[_0x01fc('0xe4')](_0x3e5526,_0x4b2145[_0x01fc('0xdf')]['basename'])));}}return{'date':moment(_0x4b2145[_0x01fc('0x87')])[_0x01fc('0xe9')]('YYYY-MM-DD\x20HH:mm:ss')[_0x01fc('0xa7')](),'sender':_0x4b2145[_0x01fc('0xf6')]===_0x01fc('0x12d')?_0x4b2145['User']?_0x4b2145[_0x01fc('0x80')][_0x01fc('0x3b')]:_0x01fc('0xf0'):_0x4b2145[_0x01fc('0xd4')][_0x01fc('0x12e')]+(_0x4b2145[_0x01fc('0xd4')][_0x01fc('0x11e')]?'\x20'+_0x4b2145[_0x01fc('0xd4')][_0x01fc('0x11e')]:''),'body':_0x4b2145['Attachment']?_0x4b2145['Attachment'][_0x01fc('0xdb')]:_0x4b2145[_0x01fc('0x84')],'direction':_0x4b2145['direction']===_0x01fc('0x12d')?'A':'C','secret':_0x4b2145[_0x01fc('0x111')],'read':_0x4b2145[_0x01fc('0x8e')],'attachment':_0x4b2145[_0x01fc('0xdf')]};})[_0x01fc('0x73')]()};return ejs[_0x01fc('0x12f')](path[_0x01fc('0xe4')](config[_0x01fc('0x11c')],_0x01fc('0x119'),_0x01fc('0x130'),_0x01fc('0x131')),{'interaction':_0x538c0c})[_0x01fc('0x2e')](function(_0x4a45db){var _0x32fc45=path[_0x01fc('0xe4')](_0x3e5526,_0x01fc('0x132')+_0x23f8ce['id']+'-'+_0xc28393+_0x01fc('0x133'));var _0x926417={'path':_0x32fc45,'channel':'Chat','interactionId':_0x23f8ce['id']};return pdf[_0x01fc('0x134')](_0x4a45db,_0x926417);})[_0x01fc('0x2e')](function(){return new BPromise(function(_0x5a8520,_0x1b45e0){zipdir(_0x3e5526,{'saveTo':_0x1ffc1b},function(_0x494212,_0xb20412){if(_0x494212)return _0x1b45e0(_0x494212);return _0x5a8520(_0xb20412);});})[_0x01fc('0x2e')](function(){return new BPromise(function(_0x2b9a6e,_0x285d33){rimraf(_0x3e5526,function(_0x5b2051){if(_0x5b2051)_0x285d33(_0x5b2051);return _0x2b9a6e();});});})[_0x01fc('0x2e')](function(){return _0x391c61['download'](_0x1ffc1b,_0x1e44fd,function(_0x2a2dee){if(_0x2a2dee){console[_0x01fc('0x135')](_0x01fc('0x136'),_0x2a2dee);}else{fs[_0x01fc('0x137')](_0x1ffc1b);}});});});}else{return _0x391c61[_0x01fc('0x24')](0xc8);}})[_0x01fc('0x23')](handleError(_0x391c61,null));}; \ No newline at end of file +var _0x21cd=['ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','pick','options','includeAgent','addTags','setTags','spread','chatInteractionTags:save','removeTags','unix','server','files','attachments','firstName','lastName','read','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','request\x20sent','catch','sendStatus','status','json','undefined','limit','count','set','Content-Range','apply','save','update','destroy','end','name','send','render','body','agent','interaction','account','Users','map','TagIds','Tags','split','forEach','waiting','talking','answered','unmanaged','abandoned','total','closed','UserId','disposition','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','chat_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','having','`\x20>\x200','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','$lte','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','isEmpty','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','ChatInteraction','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','rows','show','params','includeAll','include','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','POST','email','isNull','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','originalname','basename','file','mimetype','attachmentDownload','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','download','close','mailTranscript','root','now','ChatMessage','Messages','format','%s%d','agentAlias','System','customer','agentIdentifier','agent_alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage'];(function(_0xbfad10,_0x2282f8){var _0x5d7d94=function(_0x9b0a9f){while(--_0x9b0a9f){_0xbfad10['push'](_0xbfad10['shift']());}};_0x5d7d94(++_0x2282f8);}(_0x21cd,0x170));var _0xd21c=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x21cd[_0x9c2427];return _0x51984f;};'use strict';var emlformat=require(_0xd21c('0x0'));var rimraf=require(_0xd21c('0x1'));var zipdir=require(_0xd21c('0x2'));var jsonpatch=require(_0xd21c('0x3'));var rp=require('request-promise');var moment=require(_0xd21c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd21c('0x5'));var util=require(_0xd21c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd21c('0x7'));var ejs=require(_0xd21c('0x8'));var fs=require('fs');var fs_extra=require(_0xd21c('0x9'));var _=require(_0xd21c('0xa'));var squel=require(_0xd21c('0xb'));var crypto=require(_0xd21c('0xc'));var jsforce=require(_0xd21c('0xd'));var deskjs=require(_0xd21c('0xe'));var toCsv=require(_0xd21c('0x7'));var querystring=require(_0xd21c('0xf'));var Papa=require(_0xd21c('0x10'));var Redis=require(_0xd21c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd21c('0x12'));var as=require(_0xd21c('0x13'));var pdf=require(_0xd21c('0x14'));var hardwareService=require(_0xd21c('0x15'));var logger=require(_0xd21c('0x16'))(_0xd21c('0x17'));var utils=require(_0xd21c('0x18'));var config=require(_0xd21c('0x19'));var licenseUtil=require(_0xd21c('0x1a'));var db=require(_0xd21c('0x1b'))['db'];config[_0xd21c('0x1c')]=_[_0xd21c('0x1d')](config[_0xd21c('0x1c')],{'host':_0xd21c('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd21c('0x1c')]));require(_0xd21c('0x1f'))[_0xd21c('0x20')](socket);var jayson=require(_0xd21c('0x21'));var client=jayson[_0xd21c('0x22')][_0xd21c('0x23')]({'port':0x232b});var client9004=jayson[_0xd21c('0x22')][_0xd21c('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x3b3e37,_0x3557e6,_0x4222a7,_0x1b8d1d){return new BPromise(function(_0x3a7d3b,_0x185783){var _0x406aef=_0x1b8d1d||client;return _0x406aef[_0xd21c('0x24')](_0x3b3e37,_0x4222a7)[_0xd21c('0x25')](function(_0x399de2){logger[_0xd21c('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x3557e6,'request\x20sent');logger[_0xd21c('0x27')](_0xd21c('0x28'),_0x3557e6,'request\x20sent',JSON[_0xd21c('0x29')](_0x399de2));if(_0x399de2[_0xd21c('0x2a')]){if(_0x399de2[_0xd21c('0x2a')][_0xd21c('0x2b')]===0x1f4){logger[_0xd21c('0x2a')](_0xd21c('0x2c'),_0x3557e6,_0x399de2['error'][_0xd21c('0x2d')]);return _0x185783(_0x399de2[_0xd21c('0x2a')][_0xd21c('0x2d')]);}logger[_0xd21c('0x2a')](_0xd21c('0x2c'),_0x3557e6,_0x399de2['error'][_0xd21c('0x2d')]);return _0x3a7d3b(_0x399de2[_0xd21c('0x2a')]['message']);}else{logger['info'](_0xd21c('0x2c'),_0x3557e6,_0xd21c('0x2e'));_0x3a7d3b(_0x399de2['result'][_0xd21c('0x2d')]);}})[_0xd21c('0x2f')](function(_0x537dd2){logger[_0xd21c('0x2a')](_0xd21c('0x2c'),_0x3557e6,_0x537dd2);_0x185783(_0x537dd2);});});}function respondWithStatusCode(_0x89398c,_0x37cb6e){_0x37cb6e=_0x37cb6e||0xcc;return function(_0x1e429c){if(_0x1e429c){return _0x89398c[_0xd21c('0x30')](_0x37cb6e);}return _0x89398c['status'](_0x37cb6e)['end']();};}function respondWithResult(_0xf54aec,_0x411ab5){_0x411ab5=_0x411ab5||0xc8;return function(_0x19eec3){if(_0x19eec3){return _0xf54aec[_0xd21c('0x31')](_0x411ab5)[_0xd21c('0x32')](_0x19eec3);}};}function respondWithFilteredResult(_0x2b57ec,_0x1f8778){return function(_0x1e736c){if(_0x1e736c){var _0x283ec5=typeof _0x1f8778['offset']===_0xd21c('0x33')&&typeof _0x1f8778[_0xd21c('0x34')]===_0xd21c('0x33');var _0x50031b=_0x1e736c[_0xd21c('0x35')];var _0x34c4c4=_0x283ec5?0x0:_0x1f8778['offset'];var _0x3cb398=_0x283ec5?_0x1e736c[_0xd21c('0x35')]:_0x1f8778['offset']+_0x1f8778['limit'];var _0x1f78e5;if(_0x3cb398>=_0x50031b){_0x3cb398=_0x50031b;_0x1f78e5=0xc8;}else{_0x1f78e5=0xce;}_0x2b57ec[_0xd21c('0x31')](_0x1f78e5);return _0x2b57ec[_0xd21c('0x36')](_0xd21c('0x37'),_0x34c4c4+'-'+_0x3cb398+'/'+_0x50031b)[_0xd21c('0x32')](_0x1e736c);}return null;};}function patchUpdates(_0x56ccb0){return function(_0x5c8949){try{jsonpatch[_0xd21c('0x38')](_0x5c8949,_0x56ccb0,!![]);}catch(_0x9ff0d8){return BPromise['reject'](_0x9ff0d8);}return _0x5c8949[_0xd21c('0x39')]();};}function saveUpdates(_0x4c4e7a,_0x2f50f8){return function(_0x2ac00d){if(_0x2ac00d){return _0x2ac00d[_0xd21c('0x3a')](_0x4c4e7a)[_0xd21c('0x25')](function(_0x39ab70){return _0x39ab70;});}return null;};}function removeEntity(_0x414322,_0x35556c){return function(_0xedd4a5){if(_0xedd4a5){return _0xedd4a5[_0xd21c('0x3b')]()[_0xd21c('0x25')](function(){_0x414322[_0xd21c('0x31')](0xcc)[_0xd21c('0x3c')]();});}};}function handleEntityNotFound(_0x51ae5f,_0x4cfb77){return function(_0x5e9f91){if(!_0x5e9f91){_0x51ae5f[_0xd21c('0x30')](0x194);}return _0x5e9f91;};}function handleError(_0x5df5ae,_0x1d0b30){_0x1d0b30=_0x1d0b30||0x1f4;return function(_0x2f6fce){logger[_0xd21c('0x2a')](_0x2f6fce['stack']);if(_0x2f6fce[_0xd21c('0x3d')]){delete _0x2f6fce['name'];}_0x5df5ae[_0xd21c('0x31')](_0x1d0b30)[_0xd21c('0x3e')](_0x2f6fce);};}function getMustacheRender(_0x499cf8,_0xa0cc11){return Mustache[_0xd21c('0x3f')](_0x499cf8,_['merge'](_0xa0cc11[_0xd21c('0x40')],{'contact':_0xa0cc11['contact'],'message':_0xa0cc11[_0xd21c('0x2d')],'agent':_0xa0cc11[_0xd21c('0x41')],'interaction':_0xa0cc11[_0xd21c('0x42')],'account':_0xa0cc11[_0xd21c('0x43')]}))||'';}function getInteractionUsers(_0x31d3b0,_0x1df93c){return new BPromise(function(_0x50d911,_0x5e43a4){try{if(_0x1df93c[_0x31d3b0['id']]){_0x31d3b0[_0xd21c('0x44')]=_[_0xd21c('0x45')](_0x1df93c[_0x31d3b0['id']],function(_0x18387f){return{'id':_0x18387f['id'],'fullname':_0x18387f['fullname']};});}}catch(_0x532f17){_0x5e43a4(_0x532f17);}_0x50d911(_0x31d3b0);});}function getInteractionTags(_0x258d80,_0x323c83){return new BPromise(function(_0x1093fc,_0x14e23b){try{if(_0x258d80[_0xd21c('0x46')]){_0x258d80[_0xd21c('0x47')]=[];_0x258d80[_0xd21c('0x46')][_0xd21c('0x48')](',')[_0xd21c('0x49')](function(_0x24b240){_0x258d80[_0xd21c('0x47')]['push'](_0x323c83[_0x24b240]);});}delete _0x258d80[_0xd21c('0x46')];}catch(_0x521280){_0x14e23b(_0x521280);}_0x1093fc(_0x258d80);});}function updateChatInteraction(_0x2e87de,_0x30627b,_0x23a5db){return new BPromise(function(_0x45670a,_0x59f295){return getInteractionUsers(_0x2e87de,_0x23a5db)[_0xd21c('0x25')](function(_0x2ed7a1){return getInteractionTags(_0x2ed7a1,_0x30627b);})[_0xd21c('0x25')](function(_0x3fceb7){return getStateInteraction(_0x3fceb7);})[_0xd21c('0x25')](function(_0x3c1b51){_0x45670a(_0x3c1b51);})['catch'](function(_0x394ffb){_0x59f295(_0x394ffb);});});}function getStateInteraction(_0x277e8f){return new BPromise(function(_0x55b21a){_0x277e8f[_0xd21c('0x4a')]=0x0;_0x277e8f[_0xd21c('0x4b')]=0x0;_0x277e8f[_0xd21c('0x4c')]=0x0;_0x277e8f[_0xd21c('0x4d')]=0x0;_0x277e8f[_0xd21c('0x4e')]=0x0;_0x277e8f[_0xd21c('0x4f')]=0x0;if(!_0x277e8f[_0xd21c('0x50')]&&!_0x277e8f[_0xd21c('0x51')]){_0x277e8f['waiting']+=0x1;}if(!_0x277e8f[_0xd21c('0x50')]&&_0x277e8f[_0xd21c('0x51')]){_0x277e8f['talking']+=0x1;if(_0x277e8f[_0xd21c('0x4a')]){_0x277e8f[_0xd21c('0x4a')]-=0x1;}}if(_0x277e8f[_0xd21c('0x50')]&&_0x277e8f[_0xd21c('0x52')]===_0xd21c('0x4e')){_0x277e8f['abandoned']+=0x1;if(_0x277e8f['waiting']){_0x277e8f[_0xd21c('0x4a')]-=0x1;}}else if(_0x277e8f['closed']&&!_0x277e8f[_0xd21c('0x51')]&&_0x277e8f[_0xd21c('0x52')]){_0x277e8f['unmanaged']+=0x1;if(_0x277e8f[_0xd21c('0x4a')]){_0x277e8f[_0xd21c('0x4a')]-=0x1;}}else if(_0x277e8f[_0xd21c('0x50')]&&_0x277e8f['UserId']){_0x277e8f[_0xd21c('0x4c')]+=0x1;if(_0x277e8f[_0xd21c('0x4b')]){_0x277e8f[_0xd21c('0x4b')]-=0x1;}}_0x277e8f[_0xd21c('0x4f')]+=0x1;_0x55b21a(_0x277e8f);});}exports['index']=function(_0x3470bc,_0x7eb9a1){var _0x1294de={},_0x4a55ca={},_0x1991da={'count':0x0,'rows':[]};var _0x282e54=_[_0xd21c('0x45')](db['ChatInteraction'][_0xd21c('0x53')],function(_0x5e5d5a){return{'name':_0x5e5d5a['fieldName'],'type':_0x5e5d5a['type'][_0xd21c('0x54')]};});_0x4a55ca[_0xd21c('0x55')]=_['map'](_0x282e54,_0xd21c('0x3d'));_0x4a55ca[_0xd21c('0x56')]=_[_0xd21c('0x57')](_0x3470bc[_0xd21c('0x56')]);_0x4a55ca[_0xd21c('0x58')]=_[_0xd21c('0x59')](_0x4a55ca[_0xd21c('0x55')],_0x4a55ca[_0xd21c('0x56')]);_0x1294de[_0xd21c('0x5a')]=_[_0xd21c('0x59')](_0x4a55ca['model'],qs[_0xd21c('0x5b')](_0x3470bc[_0xd21c('0x56')][_0xd21c('0x5b')]));_0x1294de['attributes']=_0x1294de['attributes']['length']?_0x1294de[_0xd21c('0x5a')]:_0x4a55ca[_0xd21c('0x55')];if(!_0x3470bc[_0xd21c('0x56')][_0xd21c('0x5c')](_0xd21c('0x5d'))){_0x1294de['limit']=qs['limit'](_0x3470bc[_0xd21c('0x56')][_0xd21c('0x34')]);_0x1294de[_0xd21c('0x5e')]=qs[_0xd21c('0x5e')](_0x3470bc[_0xd21c('0x56')][_0xd21c('0x5e')]);}_0x1294de[_0xd21c('0x5f')]=qs[_0xd21c('0x60')](_0x3470bc[_0xd21c('0x56')][_0xd21c('0x60')]);_0x1294de[_0xd21c('0x61')]=qs[_0xd21c('0x58')](_['pick'](_0x3470bc[_0xd21c('0x56')],_0x4a55ca[_0xd21c('0x58')]),_0x282e54);var _0x162337=[];var _0x50905b=squel[_0xd21c('0x62')]()[_0xd21c('0x63')]('id')[_0xd21c('0x63')](_0xd21c('0x3d'))[_0xd21c('0x63')](_0xd21c('0x64'))[_0xd21c('0x65')](_0xd21c('0x66'));var _0x2f961f=squel['select']()['field'](_0xd21c('0x67'))[_0xd21c('0x63')](_0xd21c('0x68'))[_0xd21c('0x63')](_0xd21c('0x69'))[_0xd21c('0x65')](_0xd21c('0x6a'),'ui')['left_join']('users','u','u.id\x20=\x20ui.UserId');var _0x3296fd=squel['select']()[_0xd21c('0x65')](_0xd21c('0x6b'),'i')[_0xd21c('0x6c')](_0xd21c('0x6d'),'c',_0xd21c('0x6e'))[_0xd21c('0x6c')](_0xd21c('0x6f'),'o','o.id\x20=\x20i.UserId')[_0xd21c('0x6c')](_0xd21c('0x70'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0xd21c('0x6c')](_0xd21c('0x71'),'me',_0xd21c('0x72'))[_0xd21c('0x6c')](_0xd21c('0x73'),'it',_0xd21c('0x74'))[_0xd21c('0x6c')](_0xd21c('0x66'),'t',_0xd21c('0x75'));var _0x5efd1a=squel[_0xd21c('0x76')]();var _0x349ba7=[];var _0x5e7cc4=squel[_0xd21c('0x76')]();var _0x517580;if(_0x3470bc[_0xd21c('0x56')][_0xd21c('0x77')]){_0x517580=as[_0xd21c('0x78')](_0x3470bc[_0xd21c('0x56')]['search']);var _0x3b4378=_0x517580[_0xd21c('0x79')];for(var _0x11fce5=0x0;_0x11fce5<_0x517580[_0xd21c('0x7a')][_0xd21c('0x7b')];_0x11fce5++){var _0x1ec70a=_0x517580[_0xd21c('0x7a')][_0x11fce5];var _0x5d23ed='i';var _0x3f4f84=_[_0xd21c('0x7c')](_0x282e54,[_0xd21c('0x3d'),_0x1ec70a[_0xd21c('0x63')]]);if(!_0x3f4f84){switch(_0x1ec70a[_0xd21c('0x63')]){case'unreadMessages':if(_0x1ec70a['value']==0x1){_0x3296fd['having']('`'+_0x1ec70a[_0xd21c('0x63')]+'`\x20=\x200');}else{_0x3296fd[_0xd21c('0x7d')]('`'+_0x1ec70a[_0xd21c('0x63')]+_0xd21c('0x7e'));}break;case _0xd21c('0x7f'):if(_0x1ec70a[_0xd21c('0x80')]===_0xd21c('0x81')){if(_0x1ec70a[_0xd21c('0x82')]['split']('\x20')[_0xd21c('0x7b')]>0x1){_0x5efd1a[_0x3b4378](_0xd21c('0x83'),qs[_0xd21c('0x84')](_0x1ec70a[_0xd21c('0x82')]),null);}else{var _0x551de9='%'+_0x1ec70a[_0xd21c('0x82')]+'%';_0x5efd1a[_0x3b4378](_0xd21c('0x85'),_0x551de9,_0x551de9,_0x551de9);}}else{_0x3f4f84=_[_0xd21c('0x7c')](_0x282e54,[_0xd21c('0x3d'),_0xd21c('0x86')]);_0x1ec70a[_0xd21c('0x63')]='ContactId';_0x4c7fe=as[_0xd21c('0x87')](_0x5d23ed,_0x3f4f84[_0xd21c('0x88')],_0x1ec70a);_0x5efd1a[_0x3b4378](_0x4c7fe[_0xd21c('0x89')],_0x4c7fe[_0xd21c('0x82')][_0xd21c('0x8a')],_0x4c7fe[_0xd21c('0x82')][_0xd21c('0x3c')]);}break;case _0xd21c('0x8b'):var _0x579fbc=_0x1ec70a[_0xd21c('0x82')][_0xd21c('0x48')](',')[_0xd21c('0x45')](function(_0x476266){return Number(_0x476266);});_0x579fbc[_0xd21c('0x49')](function(_0x595a82){_0x5e7cc4['or'](_0xd21c('0x8c'),'%,'+_0x595a82+',%');});_0x349ba7=_[_0xd21c('0x8d')](_0x349ba7,_0x579fbc);break;case _0xd21c('0x8e'):if(_0x1ec70a['operator']==='$substring'){_0x5efd1a[_0x3b4378]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x1ec70a[_0xd21c('0x82')]+'%',null);}else{_0x3f4f84=_['find'](_0x282e54,[_0xd21c('0x3d'),_0xd21c('0x51')]);_0x1ec70a[_0xd21c('0x63')]=_0xd21c('0x51');_0x4c7fe=as['buildExpression'](_0x5d23ed,_0x3f4f84[_0xd21c('0x88')],_0x1ec70a);_0x5efd1a[_0x3b4378](_0x4c7fe['text'],_0x4c7fe[_0xd21c('0x82')][_0xd21c('0x8a')],_0x4c7fe[_0xd21c('0x82')][_0xd21c('0x3c')]);}break;case'body':_0x4c7fe=as[_0xd21c('0x87')]('me',null,_0x1ec70a);_0x5efd1a[_0x3b4378](_0x4c7fe[_0xd21c('0x89')],_0x4c7fe[_0xd21c('0x82')][_0xd21c('0x8a')],_0x4c7fe[_0xd21c('0x82')][_0xd21c('0x3c')]);break;}}else{var _0x4c7fe=as[_0xd21c('0x87')](_0x5d23ed,_0x3f4f84[_0xd21c('0x88')],_0x1ec70a);_0x5efd1a[_0x3b4378](_0x4c7fe[_0xd21c('0x89')],_0x4c7fe[_0xd21c('0x82')][_0xd21c('0x8a')],_0x4c7fe[_0xd21c('0x82')][_0xd21c('0x3c')]);}}}else{var _0x92ad83=_(_0x3470bc['query'])['keys']()['map'](function(_0x5cb0b3){return _[_0xd21c('0x8f')](_0x282e54,['name',_0x5cb0b3])?_0x5cb0b3:undefined;})[_0xd21c('0x90')]()[_0xd21c('0x82')]();if(!_['isEmpty'](_0x92ad83)){_0x92ad83[_0xd21c('0x49')](function(_0x5ce90d){if(_0x5ce90d===_0xd21c('0x91')){_0x3296fd['where'](_0xd21c('0x92'),[][_0xd21c('0x93')](_0x3470bc[_0xd21c('0x56')][_0x5ce90d]));}else if(_0x5ce90d===_0xd21c('0x94')){var _0x584c27=JSON['parse'](_0x3470bc[_0xd21c('0x56')][_0x5ce90d])[_0xd21c('0x95')];var _0x5e4550=JSON['parse'](_0x3470bc[_0xd21c('0x56')][_0x5ce90d])[_0xd21c('0x96')];_0x3296fd['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x584c27,_0x5e4550);}else{if(_0x3470bc[_0xd21c('0x56')][_0x5ce90d]==='null'){_0x3296fd[_0xd21c('0x61')]('i.'+_0x5ce90d+_0xd21c('0x97'));}else{_0x3296fd[_0xd21c('0x61')]('i.'+_0x5ce90d+_0xd21c('0x98'),_0x3470bc[_0xd21c('0x56')][_0x5ce90d]);}}});}if(_0x3470bc[_0xd21c('0x56')]['read']){if(_0x3470bc[_0xd21c('0x56')]['read']==0x1){_0x3296fd[_0xd21c('0x7d')](_0xd21c('0x99'));}else{_0x3296fd[_0xd21c('0x7d')](_0xd21c('0x9a'));}}if(_0x3470bc[_0xd21c('0x56')][_0xd21c('0x9b')]){_0x349ba7=_[_0xd21c('0x9c')](_0x3470bc[_0xd21c('0x56')][_0xd21c('0x9b')])?_0x3470bc[_0xd21c('0x56')][_0xd21c('0x9b')]:new Array(_0x3470bc[_0xd21c('0x56')][_0xd21c('0x9b')]);_0x349ba7['forEach'](function(_0x3948b4){_0x5e7cc4['or'](_0xd21c('0x8c'),'%,'+_0x3948b4+',%');});}if(_0x3470bc[_0xd21c('0x56')][_0xd21c('0x9d')]){var _0x394b39=_0x3470bc[_0xd21c('0x56')]['filter'][_0xd21c('0x9e')]('\x5c','\x5c\x5c')[_0xd21c('0x9e')](/'/g,'\x27\x27');if(qs[_0xd21c('0x9f')](_0x394b39)){_0x5efd1a['or']('i.id\x20LIKE\x20?',_0x394b39+'%');}else{_0x5efd1a['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd21c('0x84')](_0x394b39))['or'](_0xd21c('0xa0'),_0x394b39+'%');}}}_0x3296fd[_0xd21c('0x61')](_0x5efd1a);_0x3296fd[_0xd21c('0xa1')](_0xd21c('0xa2'));var _0x59c068={'type':db[_0xd21c('0xa3')]['QueryTypes'][_0xd21c('0xa4')],'raw':!![]};var _0x10540a=_0x3296fd['clone']();_0x10540a[_0xd21c('0x63')](_0xd21c('0xa2'));_0x10540a[_0xd21c('0x63')](_0xd21c('0xa5'),_0xd21c('0xa6'));if(_0x1294de[_0xd21c('0x5f')]){_0x1294de[_0xd21c('0x5f')][_0xd21c('0x49')](function(_0x143362){var _0x4e10b2=_0x143362[0x0]===_0xd21c('0xa7')?_0x143362[0x0]:'i.'+_0x143362[0x0];_0x3296fd[_0xd21c('0x5f')](_0x4e10b2,_0x143362[0x1]===_0xd21c('0xa8')?![]:!![]);});}if(!_[_0xd21c('0xa9')](_0x349ba7)){_0x3296fd[_0xd21c('0x7d')](_0x5e7cc4);_0x10540a[_0xd21c('0x61')]('t.id\x20IN\x20?',_0x349ba7);}BPromise[_0xd21c('0xaa')]()['then'](function(){if(!_0x517580){if(_0x3470bc[_0xd21c('0x56')]['ChatWebsiteId'])return;_0x10540a[_0xd21c('0x61')](_0xd21c('0xab'));_0x3296fd[_0xd21c('0x61')](_0xd21c('0xab'));return;}if(_0x3470bc[_0xd21c('0xac')][_0xd21c('0xad')]!==_0xd21c('0x41'))return;return _0x3470bc[_0xd21c('0xac')][_0xd21c('0xae')]({'attributes':['id'],'raw':!![]})[_0xd21c('0x25')](function(_0x310310){if(_['isEmpty'](_0x310310)){_0x10540a[_0xd21c('0x61')](_0xd21c('0xaf'));_0x3296fd[_0xd21c('0x61')](_0xd21c('0xaf'));}else{_0x10540a[_0xd21c('0x61')](_0xd21c('0x92'),_[_0xd21c('0x45')](_0x310310,'id'));_0x3296fd[_0xd21c('0x61')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x310310,'id'));}});})[_0xd21c('0x25')](function(){if(_0x3470bc[_0xd21c('0xac')][_0xd21c('0xad')]===_0xd21c('0x41')&&!_0x517580&&!_0x3470bc[_0xd21c('0x56')][_0xd21c('0x91')])return[];return db[_0xd21c('0xb0')][_0xd21c('0x56')](_0x10540a[_0xd21c('0xb1')](),_0x59c068);})['then'](function(_0x52bf26){_0x1991da[_0xd21c('0x35')]=_0x52bf26[_0xd21c('0x7b')];if(_0x1991da[_0xd21c('0x35')]===0x0)return[];return db[_0xd21c('0xb0')]['query'](_0x50905b[_0xd21c('0xb1')](),_0x59c068)[_0xd21c('0x25')](function(_0x52d56c){_0x162337=_[_0xd21c('0xb2')](_0x52d56c,'id');_0x59c068=_[_0xd21c('0xb3')](_0x59c068,{'model':db[_0xd21c('0xb4')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3470bc[_0xd21c('0x56')][_0xd21c('0x5b')]){_0x1294de[_0xd21c('0x5a')][_0xd21c('0x49')](function(_0x56417f){_0x3296fd[_0xd21c('0x63')]('i.'+_0x56417f);});}else{_0x3296fd['field'](_0xd21c('0xa5'),_0xd21c('0xa6'));_0x3296fd[_0xd21c('0x63')]('a.key',_0xd21c('0xb5'));_0x3296fd[_0xd21c('0x63')](_0xd21c('0xb6'),_0xd21c('0xb7'));_0x3296fd[_0xd21c('0x63')](_0xd21c('0xb8'),_0xd21c('0xa7'));_0x3296fd[_0xd21c('0x63')](_0xd21c('0xb9'));_0x3296fd[_0xd21c('0x63')]('c.firstName','Contact.firstName');_0x3296fd[_0xd21c('0x63')](_0xd21c('0xba'),_0xd21c('0xbb'));_0x3296fd['field'](_0xd21c('0xbc'),'Contact.email');_0x3296fd[_0xd21c('0x63')](_0xd21c('0xbd'),_0xd21c('0xbe'));_0x3296fd[_0xd21c('0x63')](_0xd21c('0xbf'),'Contact.mobile');_0x3296fd[_0xd21c('0x63')]('c.fax',_0xd21c('0xc0'));_0x3296fd[_0xd21c('0x63')](_0xd21c('0xc1'),_0xd21c('0xc2'));_0x3296fd[_0xd21c('0x63')](_0xd21c('0xc3'),_0xd21c('0xc4'));_0x3296fd[_0xd21c('0x63')](_0xd21c('0xc5'),'TagIds');}if(_0x1294de['limit'])_0x3296fd[_0xd21c('0x34')](_0x1294de[_0xd21c('0x34')]);if(_0x1294de['offset'])_0x3296fd[_0xd21c('0x5e')](_0x1294de[_0xd21c('0x5e')]);return db['sequelize'][_0xd21c('0x56')](_0x3296fd[_0xd21c('0xb1')](),_0x59c068);})[_0xd21c('0x25')](function(_0x199ae7){if(_0x199ae7[_0xd21c('0x7b')]>0x0)_0x2f961f[_0xd21c('0x61')](_0xd21c('0xc6'),_[_0xd21c('0x45')](_0x199ae7,'id'));return db[_0xd21c('0xb0')][_0xd21c('0x56')](_0x2f961f[_0xd21c('0xb1')](),_0x59c068)[_0xd21c('0x25')](function(_0x273cae){var _0x2db78d=_[_0xd21c('0xc7')](_0x273cae,_0xd21c('0xc8'));var _0xcc253d=[];_0x199ae7[_0xd21c('0x49')](function(_0x5aa557){_0xcc253d[_0xd21c('0xc9')](updateChatInteraction(_0x5aa557,_0x162337,_0x2db78d));});return BPromise[_0xd21c('0xca')](_0xcc253d);});});})['then'](function(_0x22f0c2){_0x1991da[_0xd21c('0xcb')]=_0x22f0c2;return _0x1991da;})['then'](respondWithFilteredResult(_0x7eb9a1,_0x1294de))[_0xd21c('0x2f')](handleError(_0x7eb9a1,null));};exports[_0xd21c('0xcc')]=function(_0xb8bf05,_0x35d4c4){var _0xf6e713={'raw':![],'where':{'id':_0xb8bf05[_0xd21c('0xcd')]['id']}},_0x2fd9ce={};_0x2fd9ce[_0xd21c('0x55')]=_['keys'](db['ChatInteraction'][_0xd21c('0x53')]);_0x2fd9ce[_0xd21c('0x56')]=_[_0xd21c('0x57')](_0xb8bf05[_0xd21c('0x56')]);_0x2fd9ce[_0xd21c('0x58')]=_['intersection'](_0x2fd9ce[_0xd21c('0x55')],_0x2fd9ce[_0xd21c('0x56')]);_0xf6e713[_0xd21c('0x5a')]=_[_0xd21c('0x59')](_0x2fd9ce['model'],qs['fields'](_0xb8bf05[_0xd21c('0x56')][_0xd21c('0x5b')]));_0xf6e713[_0xd21c('0x5a')]=_0xf6e713['attributes'][_0xd21c('0x7b')]?_0xf6e713[_0xd21c('0x5a')]:_0x2fd9ce[_0xd21c('0x55')];if(_0xb8bf05[_0xd21c('0x56')][_0xd21c('0xce')]){_0xf6e713[_0xd21c('0xcf')]=[{'all':!![]}];}_0xf6e713=_[_0xd21c('0xb3')]({},_0xf6e713,_0xb8bf05['options']);return db[_0xd21c('0xb4')]['find'](_0xf6e713)[_0xd21c('0x25')](handleEntityNotFound(_0x35d4c4,null))[_0xd21c('0x25')](respondWithResult(_0x35d4c4,null))[_0xd21c('0x2f')](handleError(_0x35d4c4,null));};exports[_0xd21c('0xd0')]=function(_0x484de7,_0x4bf544){return db['ChatInteraction']['create'](_0x484de7['body'],{})[_0xd21c('0x25')](respondWithResult(_0x4bf544,0xc9))[_0xd21c('0x2f')](handleError(_0x4bf544,null));};exports[_0xd21c('0x3a')]=function(_0x595567,_0x4e948e){if(_0x595567['body']['id']){delete _0x595567[_0xd21c('0x40')]['id'];}return db['ChatInteraction'][_0xd21c('0x7c')]({'where':{'id':_0x595567[_0xd21c('0xcd')]['id']}})['then'](handleEntityNotFound(_0x4e948e,null))['then'](saveUpdates(_0x595567[_0xd21c('0x40')],null))[_0xd21c('0x25')](respondWithResult(_0x4e948e,null))[_0xd21c('0x2f')](handleError(_0x4e948e,null));};exports[_0xd21c('0x3b')]=function(_0x247e61,_0x4e02e2){return db['ChatInteraction'][_0xd21c('0x7c')]({'where':{'id':_0x247e61[_0xd21c('0xcd')]['id']}})[_0xd21c('0x25')](handleEntityNotFound(_0x4e02e2,null))[_0xd21c('0x25')](removeEntity(_0x4e02e2,null))[_0xd21c('0x2f')](handleError(_0x4e02e2,null));};exports[_0xd21c('0xd1')]=function(_0x1bf14a,_0x2087c2){return db[_0xd21c('0xb4')][_0xd21c('0xd1')]()[_0xd21c('0x25')](respondWithResult(_0x2087c2,null))[_0xd21c('0x2f')](handleError(_0x2087c2,null));};exports[_0xd21c('0xd2')]=function(_0x40bc34,_0x467a35){var _0x4d97bb=_0x40bc34['params']['id'];var _0x3e83b4;var _0x2c4981;var _0x4a1164;return db['ChatInteraction'][_0xd21c('0xd3')]({'where':{'id':_0x4d97bb}})['then'](function(_0xa91000){_0x3e83b4=_0xa91000;return db[_0xd21c('0xd4')][_0xd21c('0xd3')]({'where':{'id':_0xa91000[_0xd21c('0x91')]},'attributes':['id',_0xd21c('0xd5'),_0xd21c('0xd6'),_0xd21c('0xd7'),_0xd21c('0xd8'),_0xd21c('0xd9')],'raw':!![]});})['then'](function(_0x5e82fd){if(_0x5e82fd&&_0x5e82fd[_0xd21c('0xd5')]&&_0x5e82fd[_0xd21c('0xd6')]){_0x2c4981=_0x5e82fd;var _0x149f5f={'interaction':{'id':_0x4d97bb},'agent':{'id':_0x40bc34['user']['id'],'name':_0x40bc34['user'][_0xd21c('0x3d')],'fullname':_0x40bc34[_0xd21c('0xac')][_0xd21c('0xda')],'email':_0x40bc34[_0xd21c('0xac')]['email']},'contact':_0x40bc34[_0xd21c('0x40')]['contact'],'account':_0x40bc34[_0xd21c('0x40')][_0xd21c('0x43')]};var _0x5a82fd={'rejectUnauthorized':![],'method':_0xd21c('0xdb'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x5e82fd[_0xd21c('0xd5')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x40bc34['user'][_0xd21c('0xdc')]],'buttons':null,'topic':_0x2c4981[_0xd21c('0xd7')],'note':_[_0xd21c('0xdd')](_0x2c4981[_0xd21c('0xd8')])?null:getMustacheRender(_0x2c4981[_0xd21c('0xd8')],_0x149f5f),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xd21c('0xdd')](_0x2c4981[_0xd21c('0xd9')])){var _0x46f7b0=getMustacheRender(_0x2c4981[_0xd21c('0xd9')],_0x149f5f);var _0x5a2a5e=JSON['parse'](_0x46f7b0);_0x5a82fd[_0xd21c('0x40')][_0xd21c('0xde')]=_0x5a2a5e;}}catch(_0x59cc3f){throw new db['Sequelize'][(_0xd21c('0xdf'))](_0xd21c('0xe0'));}return rp(_0x5a82fd);}else{throw new db['Sequelize'][(_0xd21c('0xdf'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xd21c('0x25')](function(_0x4ff964){_0x4a1164=_0x4ff964;if(_0x4a1164['id']){var _0x19df0a={'body':_0x4a1164[_0xd21c('0xe1')],'ChatWebsiteId':_0x2c4981['id'],'ChatInteractionId':_0x3e83b4['id'],'direction':_0xd21c('0xe2'),'UserId':_0x40bc34[_0xd21c('0xac')]['id']};return db['ChatMessage'][_0xd21c('0xd0')](_0x19df0a,{});}else{throw new db['Sequelize'][(_0xd21c('0xdf'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xd21c('0x25')](function(){return _0x3e83b4[_0xd21c('0xe3')]({'vidaooSessionId':_0x4a1164['id']});})[_0xd21c('0x25')](respondWithResult(_0x467a35,null))[_0xd21c('0x2f')](handleError(_0x467a35,null));};exports[_0xd21c('0xe4')]=function(_0x5d3787,_0x4f0dc1){if(_0x5d3787[_0xd21c('0x40')]['id']){delete _0x5d3787[_0xd21c('0x40')]['id'];}return db[_0xd21c('0xb4')][_0xd21c('0x7c')]({'where':{'id':_0x5d3787['params']['id']},'include':[{'model':db[_0xd21c('0xe5')],'as':_0xd21c('0x7f')}]})[_0xd21c('0x25')](handleEntityNotFound(_0x4f0dc1,null))[_0xd21c('0x25')](saveUpdates(_0x5d3787[_0xd21c('0x40')],null))['then'](respondWithResult(_0x4f0dc1,null))[_0xd21c('0x2f')](handleError(_0x4f0dc1,null));};exports[_0xd21c('0xe6')]=function(_0xbbb04,_0xcebe77,_0x21c4a5){if(_0xbbb04[_0xd21c('0x40')]['id']){delete _0xbbb04[_0xd21c('0x40')]['id'];}return db[_0xd21c('0xb4')]['find']({'where':{'id':_0xbbb04[_0xd21c('0xcd')]['id']}})[_0xd21c('0x25')](function(_0x35338c){if(!_0x35338c){logger[_0xd21c('0x2a')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xd21c('0xe6'),0x194,_0xd21c('0xe7'));_0xcebe77[_0xd21c('0x30')](0x194);}else{if(_0x35338c['UserId']){throw new db[(_0xd21c('0xa3'))]['ValidationError'](_0xd21c('0xe8'));}}return _0x35338c;})[_0xd21c('0x25')](function(_0x4a0dd6){if(_0x4a0dd6){return _0x4a0dd6['update']({'closed':_0xbbb04['body']['closed'],'disposition':_0xbbb04[_0xd21c('0x40')][_0xd21c('0x52')]})[_0xd21c('0x25')](function(_0xb59ecb){return _0xb59ecb;});}})[_0xd21c('0x25')](function(_0x25d4eb){return respondWithRpcPromise(_0xd21c('0xe9'),_0xd21c('0xe6'),_0xbbb04[_0xd21c('0x40')],client9004);})[_0xd21c('0x25')](respondWithResult(_0xcebe77,null))[_0xd21c('0x2f')](handleError(_0xcebe77,null));};exports[_0xd21c('0xea')]=function(_0xa34b94,_0x1fa616,_0x1792fe){_0xa34b94['body'][_0xd21c('0x3d')]=_0xa34b94['file'][_0xd21c('0xeb')];_0xa34b94[_0xd21c('0x40')][_0xd21c('0xec')]=_0xa34b94[_0xd21c('0xed')]['filename'];_0xa34b94['body']['type']=_0xa34b94[_0xd21c('0xed')][_0xd21c('0xee')];return db['Attachment'][_0xd21c('0xd0')](_0xa34b94[_0xd21c('0x40')])[_0xd21c('0x25')](respondWithResult(_0x1fa616,0xc9))['catch'](handleError(_0x1fa616,null));};exports[_0xd21c('0xef')]=function(_0x7aa6cb,_0x142596,_0x138132){return db[_0xd21c('0xb4')]['findOne']({'where':{'id':_0x7aa6cb[_0xd21c('0xcd')]['id']},'raw':!![]})[_0xd21c('0x25')](handleEntityNotFound(_0x142596,null))[_0xd21c('0x25')](function(_0x3150d1){if(_0x3150d1){if(_0x3150d1['closed']){return _0x142596['status'](0x193)[_0xd21c('0x32')]({'status':0x193,'message':_0xd21c('0xf0')});}return db[_0xd21c('0xf1')][_0xd21c('0xd3')]({'where':{'id':_0x7aa6cb[_0xd21c('0x56')][_0xd21c('0xf2')]},'raw':!![]})[_0xd21c('0x25')](handleEntityNotFound(_0x142596,null));}})[_0xd21c('0x25')](function(_0x2fed82){if(_0x2fed82){var _0x5a9608=_0x2fed82[_0xd21c('0xf3')]!==null;var _0x2e9fbd=path[_0xd21c('0xf4')](config['root'],_0xd21c('0xf5'));if(_0x5a9608){_0x2e9fbd=path[_0xd21c('0xf4')](_0x2e9fbd,_0xd21c('0xf6'));}var _0x2bea70=path[_0xd21c('0xf4')](_0x2e9fbd,_0x2fed82[_0xd21c('0xec')]);return _0x142596[_0xd21c('0xf7')](_0x2bea70);}})[_0xd21c('0x2f')](handleError(_0x142596,null));};exports[_0xd21c('0xf8')]=function(_0x2ec1df,_0x2533c0){var _0x597800=null;var _0x1052b3=null;var _0x10bc8e=null;var _0x146b38=null;if(_0x2ec1df[_0xd21c('0x40')]['id']){delete _0x2ec1df['body']['id'];}if(_0x2ec1df[_0xd21c('0x40')][_0xd21c('0xf9')]){_0x146b38=path[_0xd21c('0xf4')](config[_0xd21c('0xfa')],'server/files/chat/upload/',util['format']('transcript-%s.txt',Date[_0xd21c('0xfb')]()));_0x2ec1df[_0xd21c('0x40')]['pathTranscript']=_0x146b38;}return db['ChatInteraction'][_0xd21c('0x7c')]({'where':{'id':_0x2ec1df[_0xd21c('0xcd')]['id']},'include':[{'model':db[_0xd21c('0xfc')],'as':_0xd21c('0xfd'),'include':[{'model':db[_0xd21c('0x8e')],'as':_0xd21c('0x8e')}]}]})[_0xd21c('0x25')](handleEntityNotFound(_0x2533c0,null))['then'](saveUpdates(_0x2ec1df[_0xd21c('0x40')],null))[_0xd21c('0x25')](function(_0x7884ca){if(_0x7884ca){_0x597800=_0x7884ca;return db[_0xd21c('0xd4')]['find']({'where':{'id':_0x597800[_0xd21c('0x91')]}});}})['then'](function(_0x2e793c){if(_0x2e793c){_0x10bc8e=_0x2e793c;return db[_0xd21c('0xe5')]['find']({'where':{'id':_0x597800[_0xd21c('0x86')]}});}})[_0xd21c('0x25')](function(_0x44261a){if(_0x44261a){_0x1052b3=_0x44261a;if(_0x146b38){var _0x44124b=null;for(var _0x585f3a=0x1;_0x585f3a<_0x597800[_0xd21c('0xfd')][_0xd21c('0x7b')];++_0x585f3a){_0x44124b=_0x597800[_0xd21c('0xfd')][_0x585f3a];var _0x3345c3=_0x44124b[_0xd21c('0x51')]?util[_0xd21c('0xfe')](_0xd21c('0xff'),_0x10bc8e[_0xd21c('0x100')],_0x44124b[_0xd21c('0x51')]):_0xd21c('0x101');var _0x4a1a0a=_0x2ec1df[_0xd21c('0x40')][_0xd21c('0x102')]||util[_0xd21c('0xfe')](_0xd21c('0xff'),'Visitor',_0x44124b[_0xd21c('0x86')]);switch(_0x10bc8e[_0xd21c('0x103')]){case'website_alias':_0x3345c3=_0x44124b[_0xd21c('0x51')]?util[_0xd21c('0xfe')](_0xd21c('0xff'),_0x10bc8e[_0xd21c('0x100')],_0x44124b[_0xd21c('0x51')]):_0xd21c('0x101');break;case _0xd21c('0x104'):_0x3345c3=_0x44124b[_0xd21c('0x51')]?_0x44124b[_0xd21c('0x8e')]['alias']||_0x44124b[_0xd21c('0x8e')][_0xd21c('0xda')]:_0xd21c('0x101');break;case _0xd21c('0x105'):_0x3345c3=_0x44124b[_0xd21c('0x51')]?_0x44124b[_0xd21c('0x8e')][_0xd21c('0xda')]:_0xd21c('0x101');break;default:_0x3345c3=_0x44124b['UserId']?util[_0xd21c('0xfe')]('%s%d',_0x10bc8e[_0xd21c('0x100')],_0x44124b[_0xd21c('0x51')]):'System';}var _0x5e7652=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x44124b[_0xd21c('0x94')])[_0xd21c('0xfe')](_0xd21c('0x106')),_0x44124b[_0xd21c('0x107')]==='in'?_0x4a1a0a:_0x3345c3,_0x44124b[_0xd21c('0x40')]);if(!_0x44124b[_0xd21c('0x108')]){fs['appendFileSync'](_0x146b38,_0x5e7652);}}return db['MailAccount'][_0xd21c('0xd3')]({'where':{'service':!![]},'include':[{'model':db[_0xd21c('0x109')],'as':_0xd21c('0x10a'),'raw':!![]}]});}}})['then'](function(_0x4b8b51){if(_0x4b8b51&&_0x4b8b51[_0xd21c('0x10a')]&&_0x2ec1df[_0xd21c('0x40')]){var _0x46755e={'tls':{'rejectUnauthorized':![]}};if(_0x4b8b51[_0xd21c('0x10a')]['service']){_0x46755e[_0xd21c('0x10b')]=_0x4b8b51[_0xd21c('0x10a')][_0xd21c('0x10b')];}else{_0x46755e[_0xd21c('0x10c')]=_0x4b8b51['Smtp'][_0xd21c('0x10c')];_0x46755e[_0xd21c('0x10d')]=_0x4b8b51[_0xd21c('0x10a')][_0xd21c('0x10d')];_0x46755e['secure']=_0x4b8b51[_0xd21c('0x10a')][_0xd21c('0x10e')];}if(_0x4b8b51[_0xd21c('0x10a')][_0xd21c('0x10f')]){_0x46755e[_0xd21c('0x110')]={'user':_0x4b8b51[_0xd21c('0x10a')][_0xd21c('0xac')],'pass':_0x4b8b51[_0xd21c('0x10a')][_0xd21c('0x111')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x46755e,'message':{'from':util[_0xd21c('0xfe')](_0xd21c('0x112'),_0x4b8b51[_0xd21c('0x3d')],_0x4b8b51['email']||_0x4b8b51[_0xd21c('0x10a')][_0xd21c('0xac')]),'to':_0x2ec1df[_0xd21c('0x40')][_0xd21c('0xf9')],'subject':_0xd21c('0x113'),'text':util[_0xd21c('0xfe')](_0xd21c('0x114'),_0x2ec1df[_0xd21c('0x40')][_0xd21c('0xf9')]),'attachments':[{'path':_0x146b38}]}})[_0xd21c('0x25')](function(){return _0x597800;})['catch'](function(_0x298264){console[_0xd21c('0x2a')](_0x298264);});}else{return _0x597800;}})[_0xd21c('0x25')](respondWithStatusCode(_0x2533c0,0xc8))[_0xd21c('0x2f')](handleError(_0x2533c0,null));};exports[_0xd21c('0x115')]=function(_0x295250,_0x148a14,_0x5d4da5){return db['ChatMessage'][_0xd21c('0x7c')]({'where':{'id':_0x295250[_0xd21c('0xcd')]['id']}})[_0xd21c('0x25')](handleEntityNotFound(_0x148a14,null))[_0xd21c('0x25')](function(_0x40b431){if(_0x40b431){return _0x40b431['addMessage'](_0x295250[_0xd21c('0x40')][_0xd21c('0x116')],_[_0xd21c('0x117')](_0x295250[_0xd21c('0x40')],[_0xd21c('0x116'),'id'])||{});}})['then'](respondWithResult(_0x148a14,null))[_0xd21c('0x2f')](handleError(_0x148a14,null));};exports[_0xd21c('0x118')]=function(_0xec067a,_0x144771,_0x2fcda9){var _0x2ed5a5={'raw':![],'where':{}};var _0x1370ad={};var _0x5d6acb={'count':0x0,'rows':[]};return db[_0xd21c('0xb4')]['findOne']({'where':{'id':_0xec067a[_0xd21c('0xcd')]['id']}})[_0xd21c('0x25')](handleEntityNotFound(_0x144771,null))[_0xd21c('0x25')](function(_0x373459){if(_0x373459){_0x1370ad[_0xd21c('0x55')]=_[_0xd21c('0x57')](db['ChatMessage'][_0xd21c('0x53')]);_0x1370ad[_0xd21c('0x56')]=_[_0xd21c('0x57')](_0xec067a[_0xd21c('0x56')]);_0x1370ad[_0xd21c('0x58')]=_[_0xd21c('0x59')](_0x1370ad[_0xd21c('0x55')],_0x1370ad[_0xd21c('0x56')]);_0x2ed5a5['attributes']=_['intersection'](_0x1370ad[_0xd21c('0x55')],qs[_0xd21c('0x5b')](_0xec067a['query'][_0xd21c('0x5b')]));_0x2ed5a5[_0xd21c('0x5a')]=_0x2ed5a5[_0xd21c('0x5a')]['length']?_0x2ed5a5[_0xd21c('0x5a')]:_0x1370ad[_0xd21c('0x55')];if(!_0xec067a['query'][_0xd21c('0x5c')](_0xd21c('0x5d'))){_0x2ed5a5[_0xd21c('0x34')]=qs[_0xd21c('0x34')](_0xec067a[_0xd21c('0x56')]['limit']);_0x2ed5a5[_0xd21c('0x5e')]=qs[_0xd21c('0x5e')](_0xec067a[_0xd21c('0x56')][_0xd21c('0x5e')]);}_0x2ed5a5[_0xd21c('0x5f')]=qs['sort'](_0xec067a[_0xd21c('0x56')][_0xd21c('0x60')]);_0x2ed5a5['where']=qs[_0xd21c('0x58')](_['pick'](_0xec067a[_0xd21c('0x56')],_0x1370ad['filters']));_0x2ed5a5[_0xd21c('0x61')]['ChatInteractionId']=_0x373459['id'];if(_0xec067a[_0xd21c('0x56')][_0xd21c('0x9d')]){_0x2ed5a5[_0xd21c('0x61')]=_['merge'](_0x2ed5a5['where'],{'$or':_['map'](_0x2ed5a5[_0xd21c('0x5a')],function(_0x289d36){var _0x290b20={};_0x290b20[_0x289d36]={'$like':'%'+_0xec067a[_0xd21c('0x56')]['filter']+'%'};return _0x290b20;})});}if(_0xec067a[_0xd21c('0x56')]['$gte']){var _0x47e998=_0xec067a[_0xd21c('0x56')]['$gte'][_0xd21c('0x48')](',');var _0x2900d1={};_0x2900d1[_0x47e998[0x0]]={'$gte':moment(_0x47e998[0x1])['format'](_0xd21c('0x119'))};_0x2ed5a5[_0xd21c('0x61')]=_[_0xd21c('0xb3')](_0x2ed5a5[_0xd21c('0x61')],_0x2900d1);}_0x2ed5a5=_[_0xd21c('0xb3')]({},_0x2ed5a5,_0xec067a['options']);return db['ChatMessage'][_0xd21c('0x35')]({'where':_0x2ed5a5['where']})[_0xd21c('0x25')](function(_0x1ae268){_0x5d6acb[_0xd21c('0x35')]=_0x1ae268;if(_0xec067a[_0xd21c('0x56')]['includeAll']){_0x2ed5a5[_0xd21c('0xcf')]=[{'all':!![]}];}return db['ChatMessage'][_0xd21c('0x11a')](_0x2ed5a5);})[_0xd21c('0x25')](function(_0x2c2245){_0x5d6acb[_0xd21c('0xcb')]=_0x2c2245;return _0x5d6acb;});}})[_0xd21c('0x25')](respondWithFilteredResult(_0x144771,_0x2ed5a5))['catch'](handleError(_0x144771,null));};exports[_0xd21c('0x11b')]=function(_0x4efe8b,_0x1f88ac,_0x57b700){var _0x27f35f={'where':{}},_0x4eae70={},_0x1161b6={'count':0x0,'rows':[]};return db[_0xd21c('0xb4')][_0xd21c('0xd3')]({'where':{'id':_0x4efe8b[_0xd21c('0xcd')]['id']}})[_0xd21c('0x25')](handleEntityNotFound(_0x1f88ac,null))[_0xd21c('0x25')](function(_0x5d8091){if(_0x5d8091){_0x4eae70[_0xd21c('0x55')]=_['keys'](db['ChatMessage'][_0xd21c('0x53')]);_0x4eae70[_0xd21c('0x56')]=_['keys'](_0x4efe8b[_0xd21c('0x56')]);_0x4eae70[_0xd21c('0x58')]=_[_0xd21c('0x59')](_0x4eae70[_0xd21c('0x55')],_0x4eae70[_0xd21c('0x56')]);_0x27f35f[_0xd21c('0x5a')]=_[_0xd21c('0x59')](_0x4eae70[_0xd21c('0x55')],qs[_0xd21c('0x5b')](_0x4efe8b[_0xd21c('0x56')][_0xd21c('0x5b')]));_0x27f35f[_0xd21c('0x5a')]=_0x27f35f[_0xd21c('0x5a')][_0xd21c('0x7b')]?_0x27f35f[_0xd21c('0x5a')]:_0x4eae70[_0xd21c('0x55')];if(!_0x4efe8b['query'][_0xd21c('0x5c')](_0xd21c('0x5d'))){_0x27f35f[_0xd21c('0x34')]=qs['limit'](_0x4efe8b[_0xd21c('0x56')][_0xd21c('0x34')]);_0x27f35f[_0xd21c('0x5e')]=qs['offset'](_0x4efe8b[_0xd21c('0x56')][_0xd21c('0x5e')]);}_0x27f35f[_0xd21c('0x5f')]=qs[_0xd21c('0x60')](_0x4efe8b[_0xd21c('0x56')][_0xd21c('0x60')]);_0x27f35f[_0xd21c('0x61')]=qs[_0xd21c('0x58')](_[_0xd21c('0x11c')](_0x4efe8b[_0xd21c('0x56')],_0x4eae70['filters']));_0x27f35f[_0xd21c('0x61')][_0xd21c('0xc8')]=_0x5d8091['id'];if(_0x4efe8b[_0xd21c('0x56')][_0xd21c('0x9d')]){_0x27f35f[_0xd21c('0x61')]=_[_0xd21c('0xb3')](_0x27f35f['where'],{'$or':_['map'](_0x27f35f[_0xd21c('0x5a')],function(_0x340ba5){var _0x2c2c64={};_0x2c2c64[_0x340ba5]={'$like':'%'+_0x4efe8b[_0xd21c('0x56')][_0xd21c('0x9d')]+'%'};return _0x2c2c64;})});}_0x27f35f[_0xd21c('0x61')]['secret']=![];if(_0x4efe8b[_0xd21c('0x56')]['id']){_0x27f35f[_0xd21c('0x61')]['id']={'$gt':_0x4efe8b['query']['id']};}_0x27f35f=_[_0xd21c('0xb3')]({},_0x27f35f,_0x4efe8b[_0xd21c('0x11d')]);return db['ChatMessage']['count']({'where':_0x27f35f[_0xd21c('0x61')]})[_0xd21c('0x25')](function(_0x40132f){_0x1161b6[_0xd21c('0x35')]=_0x40132f;_0x27f35f[_0xd21c('0xcf')]=[];if(_0x4efe8b[_0xd21c('0x56')][_0xd21c('0x11e')]){_0x27f35f[_0xd21c('0xcf')][_0xd21c('0xc9')]({'model':db[_0xd21c('0x8e')],'as':_0xd21c('0x8e'),'attributes':['id',_0xd21c('0xda'),'alias']});}if(_0x4efe8b[_0xd21c('0x56')][_0xd21c('0xce')]){_0x27f35f[_0xd21c('0xcf')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x27f35f);})[_0xd21c('0x25')](function(_0x5b2ebe){_0x1161b6[_0xd21c('0xcb')]=_0x5b2ebe;return _0x1161b6;});}})[_0xd21c('0x25')](respondWithFilteredResult(_0x1f88ac,_0x27f35f))[_0xd21c('0x2f')](handleError(_0x1f88ac,null));};exports[_0xd21c('0x11f')]=function(_0x3bd272,_0x422f35,_0x40add4){return db['ChatInteraction'][_0xd21c('0x7c')]({'where':{'id':_0x3bd272['params']['id']}})[_0xd21c('0x25')](handleEntityNotFound(_0x422f35,null))['then'](function(_0x169d9b){if(_0x169d9b){return _0x169d9b[_0xd21c('0x120')](_0x3bd272[_0xd21c('0x40')][_0xd21c('0x116')],_[_0xd21c('0x117')](_0x3bd272[_0xd21c('0x40')],[_0xd21c('0x116'),'id'])||{})[_0xd21c('0x121')](function(){return db[_0xd21c('0x8b')][_0xd21c('0x11a')]({'attributes':['id',_0xd21c('0x3d'),'color'],'where':{'id':_0x3bd272[_0xd21c('0x40')][_0xd21c('0x116')]}});})['then'](function(_0x4fcb9a){socket['emit'](_0xd21c('0x122'),{'id':Number(_0x3bd272[_0xd21c('0xcd')]['id']),'tags':_0x4fcb9a||[]});return{'id':Number(_0x3bd272[_0xd21c('0xcd')]['id']),'tags':_0x4fcb9a||[]};});}})[_0xd21c('0x25')](respondWithResult(_0x422f35,null))[_0xd21c('0x2f')](handleError(_0x422f35,null));};exports[_0xd21c('0x123')]=function(_0x16c668,_0x39091f,_0x59a7c2){return db[_0xd21c('0xb4')]['find']({'where':{'id':_0x16c668[_0xd21c('0xcd')]['id']}})['then'](handleEntityNotFound(_0x39091f,null))[_0xd21c('0x25')](function(_0x337d80){if(_0x337d80){return _0x337d80[_0xd21c('0x123')](_0x16c668['query']['ids']);}})[_0xd21c('0x25')](respondWithStatusCode(_0x39091f,null))[_0xd21c('0x2f')](handleError(_0x39091f,null));};exports[_0xd21c('0xf7')]=function(_0x11dd8f,_0x40613b){var _0x3141d3=moment()[_0xd21c('0x124')]()[_0xd21c('0xb1')]();var _0x1f550e=path[_0xd21c('0xf4')](config[_0xd21c('0xfa')],_0xd21c('0x125'),'files','tmp');var _0x52abe9=path[_0xd21c('0xf4')](config[_0xd21c('0xfa')],_0xd21c('0x125'),_0xd21c('0x126'),_0xd21c('0x127'));var _0x38c127=path['join'](_0x1f550e,_0x3141d3);var _0x29acde=util[_0xd21c('0xfe')]('transcript-%d-%s.zip',_0x11dd8f[_0xd21c('0xcd')]['id'],_0x3141d3);var _0x489de2=path['join'](_0x1f550e,_0x29acde);var _0x2bfce4=[];_0x2bfce4[_0xd21c('0xc9')]({'model':db[_0xd21c('0x8e')],'as':'User','attributes':['id',_0xd21c('0xda')],'raw':!![]});_0x2bfce4[_0xd21c('0xc9')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0xd21c('0x128'),_0xd21c('0x129')],'raw':!![]});if(_0x11dd8f[_0xd21c('0x56')][_0xd21c('0x127')]){_0x2bfce4[_0xd21c('0xc9')]({'model':db[_0xd21c('0xf1')],'as':_0xd21c('0xf1'),'raw':!![]});}var _0x4fad3=[{'model':db[_0xd21c('0xfc')],'as':_0xd21c('0xfd'),'attributes':['id',_0xd21c('0x40'),_0xd21c('0x94'),'direction',_0xd21c('0x108'),_0xd21c('0x12a')],'include':_0x2bfce4}];_0x4fad3[_0xd21c('0xc9')]({'model':db[_0xd21c('0xd4')],'as':_0xd21c('0x12b'),'attributes':['id','name']});_0x4fad3[_0xd21c('0xc9')]({'model':db[_0xd21c('0x8e')],'as':_0xd21c('0x12c'),'attributes':['id',_0xd21c('0xda')]});return db['ChatInteraction'][_0xd21c('0x7c')]({'where':{'id':_0x11dd8f[_0xd21c('0xcd')]['id']},'include':_0x4fad3})[_0xd21c('0x25')](handleEntityNotFound(_0x40613b,null))[_0xd21c('0x25')](function(_0x3ac2f1){if(_0x3ac2f1){var _0x228a0b=_0x3ac2f1[_0xd21c('0x12d')]({'plain':!![]});fs[_0xd21c('0x12e')](_0x38c127);var _0x15709e={'channel':_0xd21c('0x12f'),'account':_0x228a0b[_0xd21c('0x12b')]['name'],'agent':_0x228a0b[_0xd21c('0x12c')]?_0x228a0b[_0xd21c('0x12c')][_0xd21c('0xda')]:_0xd21c('0x130'),'createdAt':moment(_0x228a0b[_0xd21c('0x94')])['format'](_0xd21c('0x119'))[_0xd21c('0xb1')](),'closedAt':_0x228a0b[_0xd21c('0x50')]?moment(_0x228a0b[_0xd21c('0x131')])['format'](_0xd21c('0x119'))[_0xd21c('0xb1')]():'','disposition':_0x228a0b[_0xd21c('0x52')],'chatInfo':{'browser':_0x228a0b[_0xd21c('0x132')],'os':_0x228a0b[_0xd21c('0x133')],'referer':_0x228a0b[_0xd21c('0x134')],'customerIp':_0x228a0b[_0xd21c('0x135')],'customerPort':_0x228a0b[_0xd21c('0x136')]?_0x228a0b['customerPort']:_0xd21c('0x130')},'messages':_(_0x228a0b[_0xd21c('0xfd')])[_0xd21c('0x137')]()['filter']({'secret':![]})[_0xd21c('0x45')](function(_0x2f996f){if(_0x2f996f[_0xd21c('0xf1')]){var _0x58cd10=path['join'](_0x52abe9,_0x2f996f['Attachment'][_0xd21c('0xec')]);if(fs[_0xd21c('0x138')](_0x58cd10)){fs[_0xd21c('0x139')](_0x58cd10)[_0xd21c('0x13a')](fs[_0xd21c('0x13b')](path[_0xd21c('0xf4')](_0x38c127,_0x2f996f['Attachment'][_0xd21c('0xec')])));}}return{'date':moment(_0x2f996f[_0xd21c('0x94')])[_0xd21c('0xfe')](_0xd21c('0x119'))[_0xd21c('0xb1')](),'sender':_0x2f996f[_0xd21c('0x107')]===_0xd21c('0xe2')?_0x2f996f[_0xd21c('0x8e')]?_0x2f996f['User']['fullname']:_0xd21c('0x101'):_0x2f996f[_0xd21c('0x7f')][_0xd21c('0x128')]+(_0x2f996f[_0xd21c('0x7f')][_0xd21c('0x129')]?'\x20'+_0x2f996f[_0xd21c('0x7f')][_0xd21c('0x129')]:''),'body':_0x2f996f[_0xd21c('0xf1')]?_0x2f996f[_0xd21c('0xf1')]['basename']:_0x2f996f[_0xd21c('0x40')],'direction':_0x2f996f[_0xd21c('0x107')]===_0xd21c('0xe2')?'A':'C','secret':_0x2f996f[_0xd21c('0x108')],'read':_0x2f996f[_0xd21c('0x12a')],'attachment':_0x2f996f[_0xd21c('0xf1')]};})['value']()};return ejs[_0xd21c('0x13c')](path[_0xd21c('0xf4')](config[_0xd21c('0xfa')],_0xd21c('0x125'),_0xd21c('0x13d'),'downloadInteraction.ejs'),{'interaction':_0x15709e})['then'](function(_0x4c575a){var _0x3ab495=path[_0xd21c('0xf4')](_0x38c127,'transcript-'+_0x228a0b['id']+'-'+_0x3141d3+_0xd21c('0x13e'));var _0x4c05ac={'path':_0x3ab495,'channel':_0xd21c('0x12f'),'interactionId':_0x228a0b['id']};return pdf[_0xd21c('0x13f')](_0x4c575a,_0x4c05ac);})['then'](function(){return new BPromise(function(_0x339893,_0x237936){zipdir(_0x38c127,{'saveTo':_0x489de2},function(_0x96ceaf,_0x555c78){if(_0x96ceaf)return _0x237936(_0x96ceaf);return _0x339893(_0x555c78);});})['then'](function(){return new BPromise(function(_0x24d050,_0x35ed0f){rimraf(_0x38c127,function(_0x13509d){if(_0x13509d)_0x35ed0f(_0x13509d);return _0x24d050();});});})[_0xd21c('0x25')](function(){return _0x40613b['download'](_0x489de2,_0x29acde,function(_0x5861a0){if(_0x5861a0){console[_0xd21c('0x140')](_0xd21c('0x141'),_0x5861a0);}else{fs[_0xd21c('0x142')](_0x489de2);}});});});}else{return _0x40613b[_0xd21c('0x30')](0xc8);}})[_0xd21c('0x2f')](handleError(_0x40613b,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index c3e076e..ea10532 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 _0x81a5=['setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll'];(function(_0x484b01,_0x172571){var _0x655f8e=function(_0x174446){while(--_0x174446){_0x484b01['push'](_0x484b01['shift']());}};_0x655f8e(++_0x172571);}(_0x81a5,0x1eb));var _0x581a=function(_0x4ad859,_0x27a7b9){_0x4ad859=_0x4ad859-0x0;var _0x6cccf2=_0x81a5[_0x4ad859];return _0x6cccf2;};'use strict';var EventEmitter=require(_0x581a('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x581a('0x1')];var ChatMessage=require(_0x581a('0x2'))['db'][_0x581a('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x581a('0x4')](0x0);var events={'afterCreate':_0x581a('0x5'),'afterUpdate':_0x581a('0x6'),'afterDestroy':_0x581a('0x7')};function emitEvent(_0x4337b0){return function(_0x166cde,_0x1a8209,_0x3a1760){_0x166cde[_0x581a('0x8')]({'attributes':['id'],'raw':!![]})[_0x581a('0x9')](function(_0x44c3c6){_0x166cde['setDataValue'](_0x581a('0xa'),_0x44c3c6[_0x581a('0xb')](function(_0x519430){return{'id':_0x519430['id']};}));return ChatMessage[_0x581a('0xc')]({'where':{'ChatInteractionId':_0x166cde['id'],'direction':'in','read':![]},'raw':!![]});})[_0x581a('0x9')](function(_0x1c418f){_0x166cde[_0x581a('0xd')](_0x581a('0xe'),_0x1c418f[_0x581a('0xf')]);ChatInteractionEvents[_0x581a('0x10')](_0x4337b0+':'+_0x166cde['id'],_0x166cde);ChatInteractionEvents[_0x581a('0x10')](_0x4337b0,_0x166cde);_0x3a1760(null);})[_0x581a('0x11')](_0x3a1760(null));};}for(var e in events){if(events[_0x581a('0x12')](e)){var event=events[e];ChatInteraction[_0x581a('0x13')](e,emitEvent(event));}}module[_0x581a('0x14')]=ChatInteractionEvents; \ No newline at end of file +var _0x546b=['then','setDataValue','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','remove','getUsers'];(function(_0x5d637c,_0x49efb8){var _0x5c6f58=function(_0x1c19f6){while(--_0x1c19f6){_0x5d637c['push'](_0x5d637c['shift']());}};_0x5c6f58(++_0x49efb8);}(_0x546b,0x14a));var _0xb546=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x546b[_0x4bb66f];return _0xf2772f;};'use strict';var EventEmitter=require(_0xb546('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require(_0xb546('0x1'))['db'][_0xb546('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xb546('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb546('0x4')};function emitEvent(_0x172850){return function(_0x2b9f19,_0x1e7244,_0x16b07c){_0x2b9f19[_0xb546('0x5')]({'attributes':['id'],'raw':!![]})[_0xb546('0x6')](function(_0x1fafa6){_0x2b9f19[_0xb546('0x7')]('Users',_0x1fafa6[_0xb546('0x8')](function(_0x161304){return{'id':_0x161304['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x2b9f19['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb546('0x6')](function(_0x5305c7){_0x2b9f19[_0xb546('0x7')](_0xb546('0x9'),_0x5305c7[_0xb546('0xa')]);ChatInteractionEvents[_0xb546('0xb')](_0x172850+':'+_0x2b9f19['id'],_0x2b9f19);ChatInteractionEvents[_0xb546('0xb')](_0x172850,_0x2b9f19);_0x16b07c(null);})[_0xb546('0xc')](_0x16b07c(null));};}for(var e in events){if(events[_0xb546('0xd')](e)){var event=events[e];ChatInteraction[_0xb546('0xe')](e,emitEvent(event));}}module[_0xb546('0xf')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index b54c06c..7bc0b29 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 _0xc15e=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','format','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3ed8b3,_0x452074){var _0x3c925e=function(_0x67ad4c){while(--_0x67ad4c){_0x3ed8b3['push'](_0x3ed8b3['shift']());}};_0x3c925e(++_0x452074);}(_0xc15e,0x1b0));var _0xec15=function(_0x524211,_0x3ff380){_0x524211=_0x524211-0x0;var _0x2968ff=_0xc15e[_0x524211];return _0x2968ff;};'use strict';var _=require(_0xec15('0x0'));var util=require(_0xec15('0x1'));var logger=require('../../config/logger')(_0xec15('0x2'));var moment=require(_0xec15('0x3'));var BPromise=require(_0xec15('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xec15('0x5'));var rimraf=require(_0xec15('0x6'));var config=require(_0xec15('0x7'));var attributes=require(_0xec15('0x8'));module[_0xec15('0x9')]=function(_0x38b8e4,_0x427802){return _0x38b8e4[_0xec15('0xa')](_0xec15('0xb'),attributes,{'tableName':_0xec15('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3990a0,_0x3d0039,_0x396704){if(_0x3990a0[_0xec15('0xd')](_0xec15('0xe'))){_0x3990a0['closedAt']=moment()[_0xec15('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x396704(null,_0x3990a0);}},'charset':_0xec15('0x10'),'collate':_0xec15('0x11')});}; \ No newline at end of file +var _0xcfdf=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','ChatInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4b9b9b,_0x3a165){var _0x4669f2=function(_0x1f3b2b){while(--_0x1f3b2b){_0x4b9b9b['push'](_0x4b9b9b['shift']());}};_0x4669f2(++_0x3a165);}(_0xcfdf,0xc8));var _0xfcfd=function(_0x3cc8d6,_0x1fcaf){_0x3cc8d6=_0x3cc8d6-0x0;var _0x33f70b=_0xcfdf[_0x3cc8d6];return _0x33f70b;};'use strict';var _=require(_0xfcfd('0x0'));var util=require(_0xfcfd('0x1'));var logger=require(_0xfcfd('0x2'))('api');var moment=require(_0xfcfd('0x3'));var BPromise=require(_0xfcfd('0x4'));var rp=require(_0xfcfd('0x5'));var fs=require('fs');var path=require(_0xfcfd('0x6'));var rimraf=require(_0xfcfd('0x7'));var config=require(_0xfcfd('0x8'));var attributes=require(_0xfcfd('0x9'));module['exports']=function(_0xe8d53f,_0x3b1521){return _0xe8d53f['define'](_0xfcfd('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x48f374,_0x57a7c8,_0x53f7d8){if(_0x48f374[_0xfcfd('0xb')](_0xfcfd('0xc'))){_0x48f374[_0xfcfd('0xd')]=moment()[_0xfcfd('0xe')](_0xfcfd('0xf'));}_0x53f7d8(null,_0x48f374);}},'charset':_0xfcfd('0x10'),'collate':_0xfcfd('0x11')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 6183db5..c3080ee 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 _0xe628=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','info','result','UpdateChatInteraction','ChatInteraction','update','body','options','limit','catch','AddTagsToChatInteraction','where','ids','omit','spread','stringify','AddTags','lodash','util'];(function(_0x4e1386,_0xea1286){var _0x199c8e=function(_0x1017de){while(--_0x1017de){_0x4e1386['push'](_0x4e1386['shift']());}};_0x199c8e(++_0xea1286);}(_0xe628,0x7f));var _0x8e62=function(_0x141782,_0x20a5de){_0x141782=_0x141782-0x0;var _0x504c01=_0xe628[_0x141782];return _0x504c01;};'use strict';var _=require(_0x8e62('0x0'));var util=require(_0x8e62('0x1'));var moment=require(_0x8e62('0x2'));var BPromise=require(_0x8e62('0x3'));var rs=require(_0x8e62('0x4'));var fs=require('fs');var Redis=require(_0x8e62('0x5'));var db=require(_0x8e62('0x6'))['db'];var utils=require(_0x8e62('0x7'));var logger=require(_0x8e62('0x8'))(_0x8e62('0x9'));var config=require('../../config/environment');var jayson=require(_0x8e62('0xa'));var client=jayson[_0x8e62('0xb')][_0x8e62('0xc')]({'port':0x232a});config[_0x8e62('0xd')]=_[_0x8e62('0xe')](config[_0x8e62('0xd')],{'host':_0x8e62('0xf'),'port':0x18eb});var socket=require(_0x8e62('0x10'))(new Redis(config['redis']));require(_0x8e62('0x11'))[_0x8e62('0x12')](socket);function respondWithRpcPromise(_0x3feb24,_0x1a5e32,_0x525570){return new BPromise(function(_0x1e7ae0,_0x5d6ee7){return client[_0x8e62('0x13')](_0x3feb24,_0x525570)[_0x8e62('0x14')](function(_0x16e1dd){logger['info'](_0x8e62('0x15'),_0x1a5e32,_0x8e62('0x16'));logger[_0x8e62('0x17')](_0x8e62('0x18'),_0x1a5e32,'request\x20sent',JSON['stringify'](_0x16e1dd));if(_0x16e1dd[_0x8e62('0x19')]){if(_0x16e1dd['error']['code']===0x1f4){logger[_0x8e62('0x19')](_0x8e62('0x15'),_0x1a5e32,_0x16e1dd[_0x8e62('0x19')]['message']);return _0x5d6ee7(_0x16e1dd['error'][_0x8e62('0x1a')]);}logger['error'](_0x8e62('0x15'),_0x1a5e32,_0x16e1dd[_0x8e62('0x19')][_0x8e62('0x1a')]);return _0x1e7ae0(_0x16e1dd['error']['message']);}else{logger[_0x8e62('0x1b')](_0x8e62('0x15'),_0x1a5e32,'request\x20sent');_0x1e7ae0(_0x16e1dd[_0x8e62('0x1c')][_0x8e62('0x1a')]);}})['catch'](function(_0x56a912){logger[_0x8e62('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x1a5e32,_0x56a912);_0x5d6ee7(_0x56a912);});});}exports[_0x8e62('0x1d')]=function(_0xa1b13a){var _0x3bec27=this;return new Promise(function(_0x163906,_0x429a73){return db[_0x8e62('0x1e')][_0x8e62('0x1f')](_0xa1b13a[_0x8e62('0x20')],{'raw':_0xa1b13a[_0x8e62('0x21')]?_0xa1b13a[_0x8e62('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa1b13a['options']?_0xa1b13a[_0x8e62('0x21')]['where']||null:null,'attributes':_0xa1b13a[_0x8e62('0x21')]?_0xa1b13a[_0x8e62('0x21')]['attributes']||null:null,'limit':_0xa1b13a['options']?_0xa1b13a[_0x8e62('0x21')][_0x8e62('0x22')]||null:null})[_0x8e62('0x14')](function(_0x48004f){logger[_0x8e62('0x1b')](_0x8e62('0x1d'),_0xa1b13a);logger[_0x8e62('0x17')](_0x8e62('0x1d'),_0xa1b13a,JSON['stringify'](_0x48004f));_0x163906(_0x48004f);})[_0x8e62('0x23')](function(_0x9eb301){logger[_0x8e62('0x19')](_0x8e62('0x1d'),_0x9eb301[_0x8e62('0x1a')],_0xa1b13a);_0x429a73(_0x3bec27['error'](0x1f4,_0x9eb301[_0x8e62('0x1a')]));});});};exports[_0x8e62('0x24')]=function(_0x4fc70f){return new Promise(function(_0xa440f1,_0xc36dc7){return db[_0x8e62('0x1e')]['find']({'where':_0x4fc70f['options']?_0x4fc70f[_0x8e62('0x21')][_0x8e62('0x25')]||null:null})['then'](function(_0x3561ba){if(_0x3561ba){return _0x3561ba['addTags'](_0x4fc70f[_0x8e62('0x20')][_0x8e62('0x26')],_[_0x8e62('0x27')](_0x4fc70f[_0x8e62('0x20')],[_0x8e62('0x26'),'id'])||{});}})[_0x8e62('0x28')](function(_0x536319){logger[_0x8e62('0x1b')]('AddTags',_0x4fc70f);logger[_0x8e62('0x17')]('AddTags',_0x4fc70f,JSON[_0x8e62('0x29')](_0x536319));_0xa440f1(_0x536319);})['catch'](function(_0x35fca9){logger[_0x8e62('0x19')](_0x8e62('0x2a'),_0x35fca9[_0x8e62('0x1a')],_0x4fc70f);_0xc36dc7(_this[_0x8e62('0x19')](0x1f4,_0x35fca9['message']));});});}; \ No newline at end of file +var _0x12f6=['UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','stringify','catch','AddTagsToChatInteraction','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','localhost','./chatInteraction.socket','register','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','ChatInteraction,\x20%s,\x20%s','message'];(function(_0x2609d3,_0x130e0b){var _0x3ff5a0=function(_0x440e3f){while(--_0x440e3f){_0x2609d3['push'](_0x2609d3['shift']());}};_0x3ff5a0(++_0x130e0b);}(_0x12f6,0x106));var _0x612f=function(_0x49e6ca,_0x3fb558){_0x49e6ca=_0x49e6ca-0x0;var _0x362189=_0x12f6[_0x49e6ca];return _0x362189;};'use strict';var _=require(_0x612f('0x0'));var util=require(_0x612f('0x1'));var moment=require(_0x612f('0x2'));var BPromise=require(_0x612f('0x3'));var rs=require(_0x612f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x612f('0x5'))['db'];var utils=require(_0x612f('0x6'));var logger=require(_0x612f('0x7'))('rpc');var config=require(_0x612f('0x8'));var jayson=require(_0x612f('0x9'));var client=jayson[_0x612f('0xa')]['http']({'port':0x232a});config['redis']=_[_0x612f('0xb')](config[_0x612f('0xc')],{'host':_0x612f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x612f('0xe'))[_0x612f('0xf')](socket);function respondWithRpcPromise(_0x39c60f,_0x2f6d97,_0x4533cf){return new BPromise(function(_0x1f6488,_0x3baf99){return client[_0x612f('0x10')](_0x39c60f,_0x4533cf)[_0x612f('0x11')](function(_0x133177){logger[_0x612f('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x2f6d97,_0x612f('0x13'));logger[_0x612f('0x14')](_0x612f('0x15'),_0x2f6d97,_0x612f('0x13'),JSON['stringify'](_0x133177));if(_0x133177[_0x612f('0x16')]){if(_0x133177[_0x612f('0x16')]['code']===0x1f4){logger['error'](_0x612f('0x17'),_0x2f6d97,_0x133177[_0x612f('0x16')][_0x612f('0x18')]);return _0x3baf99(_0x133177[_0x612f('0x16')][_0x612f('0x18')]);}logger[_0x612f('0x16')](_0x612f('0x17'),_0x2f6d97,_0x133177[_0x612f('0x16')][_0x612f('0x18')]);return _0x1f6488(_0x133177[_0x612f('0x16')]['message']);}else{logger[_0x612f('0x12')](_0x612f('0x17'),_0x2f6d97,_0x612f('0x13'));_0x1f6488(_0x133177['result'][_0x612f('0x18')]);}})['catch'](function(_0x106b46){logger[_0x612f('0x16')](_0x612f('0x17'),_0x2f6d97,_0x106b46);_0x3baf99(_0x106b46);});});}exports[_0x612f('0x19')]=function(_0x99b2ec){var _0x4c03b3=this;return new Promise(function(_0x1aa5e8,_0x23feaf){return db[_0x612f('0x1a')][_0x612f('0x1b')](_0x99b2ec[_0x612f('0x1c')],{'raw':_0x99b2ec[_0x612f('0x1d')]?_0x99b2ec[_0x612f('0x1d')][_0x612f('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x99b2ec['options']?_0x99b2ec[_0x612f('0x1d')][_0x612f('0x1f')]||null:null,'attributes':_0x99b2ec['options']?_0x99b2ec[_0x612f('0x1d')][_0x612f('0x20')]||null:null,'limit':_0x99b2ec[_0x612f('0x1d')]?_0x99b2ec[_0x612f('0x1d')][_0x612f('0x21')]||null:null})['then'](function(_0x164d0d){logger[_0x612f('0x12')](_0x612f('0x19'),_0x99b2ec);logger[_0x612f('0x14')]('UpdateChatInteraction',_0x99b2ec,JSON[_0x612f('0x22')](_0x164d0d));_0x1aa5e8(_0x164d0d);})[_0x612f('0x23')](function(_0x188644){logger[_0x612f('0x16')](_0x612f('0x19'),_0x188644[_0x612f('0x18')],_0x99b2ec);_0x23feaf(_0x4c03b3[_0x612f('0x16')](0x1f4,_0x188644[_0x612f('0x18')]));});});};exports[_0x612f('0x24')]=function(_0x1a6957){return new Promise(function(_0x2c8b7c,_0x135b9f){return db['ChatInteraction']['find']({'where':_0x1a6957[_0x612f('0x1d')]?_0x1a6957['options'][_0x612f('0x1f')]||null:null})[_0x612f('0x11')](function(_0x3f8ffa){if(_0x3f8ffa){return _0x3f8ffa['addTags'](_0x1a6957[_0x612f('0x1c')][_0x612f('0x25')],_[_0x612f('0x26')](_0x1a6957[_0x612f('0x1c')],[_0x612f('0x25'),'id'])||{});}})[_0x612f('0x27')](function(_0x26efdb){logger[_0x612f('0x12')]('AddTags',_0x1a6957);logger[_0x612f('0x14')]('AddTags',_0x1a6957,JSON[_0x612f('0x22')](_0x26efdb));_0x2c8b7c(_0x26efdb);})['catch'](function(_0x483773){logger[_0x612f('0x16')](_0x612f('0x28'),_0x483773[_0x612f('0x18')],_0x1a6957);_0x135b9f(_this[_0x612f('0x16')](0x1f4,_0x483773['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 953bef1..179dad8 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 _0x40b9=['register','emit','removeListener'];(function(_0x1c7338,_0x165aa2){var _0x1e17d8=function(_0x229502){while(--_0x229502){_0x1c7338['push'](_0x1c7338['shift']());}};_0x1e17d8(++_0x165aa2);}(_0x40b9,0x1de));var _0x940b=function(_0x2767ce,_0x8af12a){_0x2767ce=_0x2767ce-0x0;var _0x417a41=_0x40b9[_0x2767ce];return _0x417a41;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save','remove','update'];function createListener(_0x416bf0,_0x5490d5){return function(_0x33df9c){_0x5490d5[_0x940b('0x0')](_0x416bf0,_0x33df9c);};}function removeListener(_0x19cfa7,_0xd5a24f){return function(){ChatInteractionEvents[_0x940b('0x1')](_0x19cfa7,_0xd5a24f);};}exports[_0x940b('0x2')]=function(_0x32b555){for(var _0x138eae=0x0,_0xbe9eed=events['length'];_0x138eae<_0xbe9eed;_0x138eae++){var _0x5d2222=events[_0x138eae];var _0x5d3135=createListener('chatInteraction:'+_0x5d2222,_0x32b555);ChatInteractionEvents['on'](_0x5d2222,_0x5d3135);}}; \ No newline at end of file +var _0x4b36=['save','update','emit','removeListener','chatInteraction:','./chatInteraction.events'];(function(_0x2b94b4,_0x562746){var _0x600865=function(_0x134853){while(--_0x134853){_0x2b94b4['push'](_0x2b94b4['shift']());}};_0x600865(++_0x562746);}(_0x4b36,0x14f));var _0x64b3=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x4b36[_0xc4001c];return _0x49f7bc;};'use strict';var ChatInteractionEvents=require(_0x64b3('0x0'));var events=[_0x64b3('0x1'),'remove',_0x64b3('0x2')];function createListener(_0x39b28d,_0x4ab95f){return function(_0xc73f87){_0x4ab95f[_0x64b3('0x3')](_0x39b28d,_0xc73f87);};}function removeListener(_0x559b60,_0x209a6a){return function(){ChatInteractionEvents[_0x64b3('0x4')](_0x559b60,_0x209a6a);};}exports['register']=function(_0x3bed09){for(var _0x16eb2f=0x0,_0x417a36=events['length'];_0x16eb2f<_0x417a36;_0x16eb2f++){var _0x2663bd=events[_0x16eb2f];var _0x879604=createListener(_0x64b3('0x5')+_0x2663bd,_0x3bed09);ChatInteractionEvents['on'](_0x2663bd,_0x879604);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 917681d..79985e1 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 _0x5574=['/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','/describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','diskStorage','join','root','server/files/attachments/','format','originalname','/:id/attachment_upload','single','file','addMessage','tracked','chat','addTags','update','customUpdate','put','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy'];(function(_0x134827,_0x21f6ed){var _0x366671=function(_0x4dc8d4){while(--_0x4dc8d4){_0x134827['push'](_0x134827['shift']());}};_0x366671(++_0x21f6ed);}(_0x5574,0xc3));var _0x4557=function(_0x5cfc5c,_0x4df360){_0x5cfc5c=_0x5cfc5c-0x0;var _0x285286=_0x5574[_0x5cfc5c];return _0x285286;};'use strict';var multer=require(_0x4557('0x0'));var util=require(_0x4557('0x1'));var path=require(_0x4557('0x2'));var timeout=require(_0x4557('0x3'));var express=require(_0x4557('0x4'));var router=express[_0x4557('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4557('0x6'));var interaction=require(_0x4557('0x7'));var config=require('../../config/environment');var controller=require(_0x4557('0x8'));router[_0x4557('0x9')]('/',auth[_0x4557('0xa')](),controller['index']);router[_0x4557('0x9')](_0x4557('0xb'),auth[_0x4557('0xa')](),controller['describe']);router['get'](_0x4557('0xc'),auth[_0x4557('0xd')](),controller[_0x4557('0xe')]);router[_0x4557('0x9')](_0x4557('0xf'),auth[_0x4557('0xd')](),controller['attachmentDownload']);router['get'](_0x4557('0x10'),auth[_0x4557('0xa')](),controller[_0x4557('0x11')]);router[_0x4557('0x9')](_0x4557('0x12'),auth['isChatInteractionAuthorized'](),controller[_0x4557('0x13')]);router['get'](_0x4557('0x14'),auth['isAuthenticated'](),controller[_0x4557('0x15')]);router[_0x4557('0x16')]('/',auth[_0x4557('0xa')](),controller['create']);router[_0x4557('0x16')]('/:id/vidaoo',auth[_0x4557('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x4557('0x17')]({'destination':function(_0x421841,_0x4135a0,_0x89f332){_0x89f332(null,path[_0x4557('0x18')](config[_0x4557('0x19')],_0x4557('0x1a')));},'filename':function(_0x493fe5,_0x49b71b,_0x442d38){_0x442d38(null,util[_0x4557('0x1b')]('%s-%s',Date['now'](),_0x49b71b[_0x4557('0x1c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x4557('0x1d'),upload[_0x4557('0x1e')](_0x4557('0x1f')),controller['attachmentUpload']);router['post']('/:id/messages',auth[_0x4557('0xd')](),controller[_0x4557('0x20')]);router[_0x4557('0x16')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x4557('0x21')](_0x4557('0x22'),'chatinteraction:addtags'),controller[_0x4557('0x23')]);router['put']('/:id',auth[_0x4557('0xa')](),interaction['tracked'](_0x4557('0x22'),'chatinteraction:update'),controller[_0x4557('0x24')]);router['put']('/:id/custom_update',controller[_0x4557('0x25')]);router[_0x4557('0x26')]('/:id/abandon',auth[_0x4557('0xd')](),controller[_0x4557('0x27')]);router[_0x4557('0x26')](_0x4557('0x28'),controller[_0x4557('0x29')]);router[_0x4557('0x2a')](_0x4557('0xc'),auth[_0x4557('0xa')](),interaction[_0x4557('0x21')]('chat',_0x4557('0x2b')),controller[_0x4557('0x2c')]);router[_0x4557('0x2a')](_0x4557('0x2d'),auth[_0x4557('0xa')](),controller[_0x4557('0x2e')]);module[_0x4557('0x2f')]=router; \ No newline at end of file +var _0x83a5=['./chatInteraction.controller','get','index','isAuthenticated','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','create','post','createVidaooSession','diskStorage','root','format','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','/:id/custom_update','/:id/abandon','abandon','close','chatinteraction:destroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../config/environment'];(function(_0x18040d,_0x234dfa){var _0x323a3c=function(_0x2703d6){while(--_0x2703d6){_0x18040d['push'](_0x18040d['shift']());}};_0x323a3c(++_0x234dfa);}(_0x83a5,0x87));var _0x583a=function(_0x53d242,_0x10fbe7){_0x53d242=_0x53d242-0x0;var _0x1347d5=_0x83a5[_0x53d242];return _0x1347d5;};'use strict';var multer=require(_0x583a('0x0'));var util=require(_0x583a('0x1'));var path=require(_0x583a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x583a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x583a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x583a('0x5'));var controller=require(_0x583a('0x6'));router[_0x583a('0x7')]('/',auth['isAuthenticated'](),controller[_0x583a('0x8')]);router[_0x583a('0x7')]('/describe',auth[_0x583a('0x9')](),controller[_0x583a('0xa')]);router[_0x583a('0x7')]('/:id',auth[_0x583a('0xb')](),controller[_0x583a('0xc')]);router[_0x583a('0x7')](_0x583a('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x583a('0xe')]);router[_0x583a('0x7')](_0x583a('0xf'),auth['isAuthenticated'](),controller[_0x583a('0x10')]);router['get'](_0x583a('0x11'),auth[_0x583a('0xb')](),controller['getMyMessages']);router[_0x583a('0x7')](_0x583a('0x12'),auth[_0x583a('0x9')](),controller[_0x583a('0x13')]);router['post']('/',auth[_0x583a('0x9')](),controller[_0x583a('0x14')]);router[_0x583a('0x15')]('/:id/vidaoo',auth[_0x583a('0x9')](),controller[_0x583a('0x16')]);var upload=multer({'storage':multer[_0x583a('0x17')]({'destination':function(_0x18e35b,_0x3a8f5d,_0x3bc3ba){_0x3bc3ba(null,path['join'](config[_0x583a('0x18')],'server/files/attachments/'));},'filename':function(_0x3ca796,_0x24a453,_0x55a37a){_0x55a37a(null,util[_0x583a('0x19')]('%s-%s',Date['now'](),_0x24a453[_0x583a('0x1a')][_0x583a('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x583a('0x1c'),upload[_0x583a('0x1d')](_0x583a('0x1e')),controller[_0x583a('0x1f')]);router[_0x583a('0x15')](_0x583a('0xf'),auth[_0x583a('0xb')](),controller['addMessage']);router[_0x583a('0x15')](_0x583a('0x20'),auth[_0x583a('0x9')](),interaction[_0x583a('0x21')](_0x583a('0x22'),_0x583a('0x23')),controller[_0x583a('0x24')]);router[_0x583a('0x25')](_0x583a('0x26'),auth['isAuthenticated'](),interaction[_0x583a('0x21')](_0x583a('0x22'),_0x583a('0x27')),controller['update']);router[_0x583a('0x25')](_0x583a('0x28'),controller['customUpdate']);router[_0x583a('0x25')](_0x583a('0x29'),auth[_0x583a('0xb')](),controller[_0x583a('0x2a')]);router['put']('/:id/close',controller[_0x583a('0x2b')]);router['delete'](_0x583a('0x26'),auth[_0x583a('0x9')](),interaction['tracked'](_0x583a('0x22'),_0x583a('0x2c')),controller[_0x583a('0x2d')]);router['delete'](_0x583a('0x20'),auth[_0x583a('0x9')](),controller['removeTags']);module[_0x583a('0x2e')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 1997f13..067c939 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 _0x584d=['medium','BOOLEAN','exports','TEXT'];(function(_0x277107,_0x3420dc){var _0x1da046=function(_0x47122d){while(--_0x47122d){_0x277107['push'](_0x277107['shift']());}};_0x1da046(++_0x3420dc);}(_0x584d,0x16e));var _0xd584=function(_0x242182,_0x4b18df){_0x242182=_0x242182-0x0;var _0x21d63b=_0x584d[_0x242182];return _0x21d63b;};'use strict';var Sequelize=require('sequelize');module[_0xd584('0x0')]={'body':{'type':Sequelize[_0xd584('0x1')](_0xd584('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd584('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x09ae=['BOOLEAN','sequelize','exports','TEXT','medium'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x09ae,0x1cd));var _0xe09a=function(_0x5e8a97,_0x2f7ac2){_0x5e8a97=_0x5e8a97-0x0;var _0x403d0a=_0x09ae[_0x5e8a97];return _0x403d0a;};'use strict';var Sequelize=require(_0xe09a('0x0'));module[_0xe09a('0x1')]={'body':{'type':Sequelize[_0xe09a('0x2')](_0xe09a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xe09a('0x4')],'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 2ea2916..40744b5 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 _0x987f=['fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','undefined','limit','count','offset','Content-Range','save','then','destroy','end','error','stack','name','send','index','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','ChatInternalMessage','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','update','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','getUsers','User','agent','admin','user','fullname','role','userpic','internal','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','all','rimraf','zip-dir'];(function(_0x287ecf,_0x30c492){var _0x171b62=function(_0x19e1d3){while(--_0x19e1d3){_0x287ecf['push'](_0x287ecf['shift']());}};_0x171b62(++_0x30c492);}(_0x987f,0x6e));var _0xf987=function(_0x5f3905,_0x43a651){_0x5f3905=_0x5f3905-0x0;var _0x2923b1=_0x987f[_0x5f3905];return _0x2923b1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf987('0x0'));var zipdir=require(_0xf987('0x1'));var jsonpatch=require(_0xf987('0x2'));var rp=require('request-promise');var moment=require(_0xf987('0x3'));var BPromise=require(_0xf987('0x4'));var Mustache=require(_0xf987('0x5'));var util=require(_0xf987('0x6'));var path=require(_0xf987('0x7'));var sox=require('sox');var csv=require(_0xf987('0x8'));var ejs=require(_0xf987('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf987('0xa'));var squel=require(_0xf987('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf987('0xc'));var toCsv=require(_0xf987('0x8'));var querystring=require('querystring');var Papa=require(_0xf987('0xd'));var Redis=require(_0xf987('0xe'));var authService=require(_0xf987('0xf'));var qs=require(_0xf987('0x10'));var as=require(_0xf987('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf987('0x12'))(_0xf987('0x13'));var utils=require(_0xf987('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf987('0x15'));var db=require(_0xf987('0x16'))['db'];config[_0xf987('0x17')]=_[_0xf987('0x18')](config['redis'],{'host':_0xf987('0x19'),'port':0x18eb});var socket=require(_0xf987('0x1a'))(new Redis(config['redis']));require(_0xf987('0x1b'))[_0xf987('0x1c')](socket);function respondWithStatusCode(_0x5d9e8c,_0x21231a){_0x21231a=_0x21231a||0xcc;return function(_0x3559f1){if(_0x3559f1){return _0x5d9e8c[_0xf987('0x1d')](_0x21231a);}return _0x5d9e8c[_0xf987('0x1e')](_0x21231a)['end']();};}function respondWithResult(_0x57157a,_0x2ae69b){_0x2ae69b=_0x2ae69b||0xc8;return function(_0xff146a){if(_0xff146a){return _0x57157a[_0xf987('0x1e')](_0x2ae69b)[_0xf987('0x1f')](_0xff146a);}};}function respondWithFilteredResult(_0x32da2b,_0xa48f3d){return function(_0x1e7a80){if(_0x1e7a80){var _0x27ab6a=typeof _0xa48f3d['offset']===_0xf987('0x20')&&typeof _0xa48f3d[_0xf987('0x21')]===_0xf987('0x20');var _0xe6e5fc=_0x1e7a80[_0xf987('0x22')];var _0x4bed3a=_0x27ab6a?0x0:_0xa48f3d[_0xf987('0x23')];var _0x1b5b0c=_0x27ab6a?_0x1e7a80[_0xf987('0x22')]:_0xa48f3d[_0xf987('0x23')]+_0xa48f3d[_0xf987('0x21')];var _0x35e2e6;if(_0x1b5b0c>=_0xe6e5fc){_0x1b5b0c=_0xe6e5fc;_0x35e2e6=0xc8;}else{_0x35e2e6=0xce;}_0x32da2b['status'](_0x35e2e6);return _0x32da2b['set'](_0xf987('0x24'),_0x4bed3a+'-'+_0x1b5b0c+'/'+_0xe6e5fc)[_0xf987('0x1f')](_0x1e7a80);}return null;};}function patchUpdates(_0x1c5863){return function(_0x46a977){try{jsonpatch['apply'](_0x46a977,_0x1c5863,!![]);}catch(_0x13e0ef){return BPromise['reject'](_0x13e0ef);}return _0x46a977[_0xf987('0x25')]();};}function saveUpdates(_0x3203bd,_0x1f3aa3){return function(_0x19fc65){if(_0x19fc65){return _0x19fc65['update'](_0x3203bd)[_0xf987('0x26')](function(_0x2c7520){return _0x2c7520;});}return null;};}function removeEntity(_0x4db168,_0x382424){return function(_0x22fe6){if(_0x22fe6){return _0x22fe6[_0xf987('0x27')]()[_0xf987('0x26')](function(){_0x4db168[_0xf987('0x1e')](0xcc)[_0xf987('0x28')]();});}};}function handleEntityNotFound(_0x1b79e4,_0x42399a){return function(_0x5adab5){if(!_0x5adab5){_0x1b79e4[_0xf987('0x1d')](0x194);}return _0x5adab5;};}function handleError(_0xfc1482,_0x4b862c){_0x4b862c=_0x4b862c||0x1f4;return function(_0x17f36f){logger[_0xf987('0x29')](_0x17f36f[_0xf987('0x2a')]);if(_0x17f36f[_0xf987('0x2b')]){delete _0x17f36f[_0xf987('0x2b')];}_0xfc1482[_0xf987('0x1e')](_0x4b862c)[_0xf987('0x2c')](_0x17f36f);};}exports[_0xf987('0x2d')]=function(_0x46653e,_0x28493b){var _0x29e730={},_0x402200={},_0x4e8b23={'count':0x0,'rows':[]};var _0x6c6864=_['map'](db['ChatInternalMessage']['rawAttributes'],function(_0x1a9a3c){return{'name':_0x1a9a3c[_0xf987('0x2e')],'type':_0x1a9a3c[_0xf987('0x2f')]['key']};});_0x402200[_0xf987('0x30')]=_[_0xf987('0x31')](_0x6c6864,'name');_0x402200[_0xf987('0x32')]=_[_0xf987('0x33')](_0x46653e[_0xf987('0x32')]);_0x402200[_0xf987('0x34')]=_['intersection'](_0x402200[_0xf987('0x30')],_0x402200[_0xf987('0x32')]);_0x29e730[_0xf987('0x35')]=_[_0xf987('0x36')](_0x402200[_0xf987('0x30')],qs[_0xf987('0x37')](_0x46653e[_0xf987('0x32')][_0xf987('0x37')]));_0x29e730[_0xf987('0x35')]=_0x29e730[_0xf987('0x35')][_0xf987('0x38')]?_0x29e730[_0xf987('0x35')]:_0x402200[_0xf987('0x30')];if(!_0x46653e[_0xf987('0x32')][_0xf987('0x39')](_0xf987('0x3a'))){_0x29e730[_0xf987('0x21')]=qs['limit'](_0x46653e[_0xf987('0x32')][_0xf987('0x21')]);_0x29e730[_0xf987('0x23')]=qs[_0xf987('0x23')](_0x46653e[_0xf987('0x32')][_0xf987('0x23')]);}_0x29e730[_0xf987('0x3b')]=qs[_0xf987('0x3c')](_0x46653e[_0xf987('0x32')]['sort']);_0x29e730[_0xf987('0x3d')]=qs[_0xf987('0x34')](_['pick'](_0x46653e[_0xf987('0x32')],_0x402200['filters']),_0x6c6864);if(_0x46653e['query'][_0xf987('0x3e')]){_0x29e730[_0xf987('0x3d')]=_['merge'](_0x29e730[_0xf987('0x3d')],{'$or':_[_0xf987('0x31')](_0x6c6864,function(_0x39c522){if(_0x39c522[_0xf987('0x2f')]!==_0xf987('0x3f')){var _0x15af4b={};_0x15af4b[_0x39c522[_0xf987('0x2b')]]={'$like':'%'+_0x46653e['query']['filter']+'%'};return _0x15af4b;}})});}_0x29e730=_[_0xf987('0x40')]({},_0x29e730,_0x46653e[_0xf987('0x41')]);var _0x529ccd={'where':_0x29e730['where']};return db[_0xf987('0x42')][_0xf987('0x22')](_0x529ccd)[_0xf987('0x26')](function(_0x22f17a){_0x4e8b23['count']=_0x22f17a;if(_0x46653e[_0xf987('0x32')][_0xf987('0x43')]){_0x29e730[_0xf987('0x44')]=[{'all':!![]}];}return db[_0xf987('0x42')][_0xf987('0x45')](_0x29e730);})['then'](function(_0x3a8c17){_0x4e8b23[_0xf987('0x46')]=_0x3a8c17;return _0x4e8b23;})[_0xf987('0x26')](respondWithFilteredResult(_0x28493b,_0x29e730))[_0xf987('0x47')](handleError(_0x28493b,null));};exports[_0xf987('0x48')]=function(_0x2a9637,_0x38ec4c){var _0x411c6f={'raw':!![],'where':{'id':_0x2a9637[_0xf987('0x49')]['id']}},_0x55a0a6={};_0x55a0a6[_0xf987('0x30')]=_[_0xf987('0x33')](db[_0xf987('0x42')][_0xf987('0x4a')]);_0x55a0a6[_0xf987('0x32')]=_['keys'](_0x2a9637[_0xf987('0x32')]);_0x55a0a6[_0xf987('0x34')]=_['intersection'](_0x55a0a6[_0xf987('0x30')],_0x55a0a6[_0xf987('0x32')]);_0x411c6f[_0xf987('0x35')]=_['intersection'](_0x55a0a6[_0xf987('0x30')],qs[_0xf987('0x37')](_0x2a9637[_0xf987('0x32')][_0xf987('0x37')]));_0x411c6f['attributes']=_0x411c6f[_0xf987('0x35')]['length']?_0x411c6f['attributes']:_0x55a0a6['model'];if(_0x2a9637[_0xf987('0x32')][_0xf987('0x43')]){_0x411c6f[_0xf987('0x44')]=[{'all':!![]}];}_0x411c6f=_['merge']({},_0x411c6f,_0x2a9637[_0xf987('0x41')]);return db[_0xf987('0x42')][_0xf987('0x4b')](_0x411c6f)[_0xf987('0x26')](handleEntityNotFound(_0x38ec4c,null))['then'](respondWithResult(_0x38ec4c,null))[_0xf987('0x47')](handleError(_0x38ec4c,null));};exports['create']=function(_0x143289,_0x4e20f3){return db[_0xf987('0x42')]['create'](_0x143289['body'],{})[_0xf987('0x26')](respondWithResult(_0x4e20f3,0xc9))[_0xf987('0x47')](handleError(_0x4e20f3,null));};exports[_0xf987('0x4c')]=function(_0x587da0,_0x5c7ff5){if(_0x587da0[_0xf987('0x4d')]['id']){delete _0x587da0[_0xf987('0x4d')]['id'];}return db[_0xf987('0x42')]['find']({'where':{'id':_0x587da0[_0xf987('0x49')]['id']}})['then'](handleEntityNotFound(_0x5c7ff5,null))[_0xf987('0x26')](saveUpdates(_0x587da0[_0xf987('0x4d')],null))['then'](respondWithResult(_0x5c7ff5,null))[_0xf987('0x47')](handleError(_0x5c7ff5,null));};exports[_0xf987('0x27')]=function(_0x442064,_0x1520a2){return db[_0xf987('0x42')]['find']({'where':{'id':_0x442064[_0xf987('0x49')]['id']}})[_0xf987('0x26')](handleEntityNotFound(_0x1520a2,null))[_0xf987('0x26')](removeEntity(_0x1520a2,null))[_0xf987('0x47')](handleError(_0x1520a2,null));};exports[_0xf987('0x4e')]=function(_0x422231,_0x2686a1){return db['ChatInternalMessage'][_0xf987('0x4e')]()[_0xf987('0x26')](respondWithResult(_0x2686a1,null))['catch'](handleError(_0x2686a1,null));};function wrapUser(_0x52f905){return function(_0x31fd27){var _0x18b995=_0x52f905[_0xf987('0x4f')]({'plain':!![]});_0x18b995[_0xf987('0x50')]=[];if(_0x31fd27){_0x18b995[_0xf987('0x51')]=_0x31fd27[_0xf987('0x52')];_0x18b995[_0xf987('0x53')]=_0x31fd27;}else{_0x18b995[_0xf987('0x51')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x18b995['lastMessage']={};}return _0x18b995;};}exports[_0xf987('0x54')]=function(_0x27bf15,_0x41ad21,_0x32b0d2){var _0x480ca9=[];return db[_0xf987('0x55')][_0xf987('0x45')]({'where':{'role':[_0xf987('0x56'),_0xf987('0x57'),_0xf987('0x58')]},'attributes':['id',_0xf987('0x59'),_0xf987('0x2b'),_0xf987('0x5a'),_0xf987('0x5b'),_0xf987('0x5c'),'online',_0xf987('0x5d'),_0xf987('0x5e'),_0xf987('0x5f')],'order':qs[_0xf987('0x3c')](_0xf987('0x60')),'include':[{'model':db[_0xf987('0x61')],'as':_0xf987('0x62'),'attributes':['id',_0xf987('0x2b'),'type'],'through':{'attributes':[]}}]})[_0xf987('0x26')](function(_0x5601b0){if(_0x5601b0){var _0x3b672d=_0x27bf15['user'][_0xf987('0x4f')]({'plain':!![]});if(!_0x3b672d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b672d['role']==='user'){return db[_0xf987('0x63')][_0xf987('0x4b')]({'where':{'name':_0xf987('0x64'),'userProfileId':_0x3b672d[_0xf987('0x65')]},'raw':!![]})[_0xf987('0x26')](function(_0x576fca){if(_0x576fca){if(_0x576fca[_0xf987('0x66')]===0x0){return db[_0xf987('0x67')][_0xf987('0x45')]({'where':{'sectionId':_0x576fca['id']},'raw':!![]})[_0xf987('0x26')](function(_0x3a559c){var _0x4fcd5d=[];if(_[_0xf987('0x68')](_0x3a559c)){_0x4fcd5d=_[_0xf987('0x3e')](_0x5601b0,function(_0x260ab4){if(_0x260ab4[_0xf987('0x5a')]!=='agent'){return _0x260ab4;}});return _0x4fcd5d;}else{for(var _0x313039=0x0;_0x313039<_0x5601b0[_0xf987('0x38')];_0x313039++){var _0x708527=_0x5601b0[_0x313039];if(_0x708527[_0xf987('0x5a')]===_0xf987('0x56')){var _0x300fbe=_[_0xf987('0x4b')](_0x3a559c,function(_0x4a5aaf){return _0x4a5aaf[_0xf987('0x69')]===_0x708527['id'];});if(_0x300fbe)_0x4fcd5d[_0xf987('0x6a')](_0x708527);}else{_0x4fcd5d[_0xf987('0x6a')](_0x708527);}}return _0x4fcd5d;}});}else{return _0x5601b0;}}else{var _0x568c61=_[_0xf987('0x3e')](_0x5601b0,function(_0x1a6199){if(_0x1a6199['role']!==_0xf987('0x56')){return _0x1a6199;}});return _0x568c61;}});}else{return _0x5601b0;}}})['then'](function(_0x1db946){var _0x4c2652=[];if(_0x1db946){_0x480ca9=_0x1db946;for(var _0x381340=0x0;_0x381340<_0x1db946[_0xf987('0x38')];_0x381340+=0x1){_0x480ca9[_0x381340][_0xf987('0x50')]=[];_0x4c2652['push'](db[_0xf987('0x42')]['find']({'where':{'FromId':[_0x27bf15['user']['id'],_0x1db946[_0x381340]['id']],'ToId':[_0x27bf15['user']['id'],_0x1db946[_0x381340]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xf987('0x6b'),_0xf987('0x6c'),_0xf987('0x6d'),_0xf987('0x4d')],'order':qs[_0xf987('0x3c')](_0xf987('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x1db946[_0x381340])));}return BPromise[_0xf987('0x6f')](_0x4c2652);}return[];})[_0xf987('0x26')](function(_0x1463a2){return{'rows':_0x1463a2,'count':_0x1463a2['length']};})[_0xf987('0x26')](respondWithResult(_0x41ad21,null))['catch'](handleError(_0x41ad21,null));}; \ No newline at end of file +var _0x9eba=['lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','register','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','sendStatus','send','index','map','ChatInternalMessage','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','params','length','find','catch','body','describe','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','findAll','agent','admin','user','role','userpic','internal','online','showWebBar','VoiceQueue','Agents','isEmpty','resourceId','push','messages','ToId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra'];(function(_0x5a555c,_0x27ea9d){var _0x4f2cd3=function(_0x1a263d){while(--_0x1a263d){_0x5a555c['push'](_0x5a555c['shift']());}};_0x4f2cd3(++_0x27ea9d);}(_0x9eba,0x133));var _0xa9eb=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9eba[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xa9eb('0x0'));var rimraf=require(_0xa9eb('0x1'));var zipdir=require(_0xa9eb('0x2'));var jsonpatch=require(_0xa9eb('0x3'));var rp=require(_0xa9eb('0x4'));var moment=require(_0xa9eb('0x5'));var BPromise=require(_0xa9eb('0x6'));var Mustache=require(_0xa9eb('0x7'));var util=require(_0xa9eb('0x8'));var path=require('path');var sox=require(_0xa9eb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9eb('0xa'));var _=require(_0xa9eb('0xb'));var squel=require(_0xa9eb('0xc'));var crypto=require(_0xa9eb('0xd'));var jsforce=require(_0xa9eb('0xe'));var deskjs=require(_0xa9eb('0xf'));var toCsv=require(_0xa9eb('0x10'));var querystring=require(_0xa9eb('0x11'));var Papa=require(_0xa9eb('0x12'));var Redis=require(_0xa9eb('0x13'));var authService=require(_0xa9eb('0x14'));var qs=require(_0xa9eb('0x15'));var as=require(_0xa9eb('0x16'));var hardwareService=require(_0xa9eb('0x17'));var logger=require(_0xa9eb('0x18'))(_0xa9eb('0x19'));var utils=require(_0xa9eb('0x1a'));var config=require(_0xa9eb('0x1b'));var licenseUtil=require(_0xa9eb('0x1c'));var db=require(_0xa9eb('0x1d'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xa9eb('0x1e'),'port':0x18eb});var socket=require(_0xa9eb('0x1f'))(new Redis(config[_0xa9eb('0x20')]));require('./chatInternalMessage.socket')[_0xa9eb('0x21')](socket);function respondWithStatusCode(_0x2ed97d,_0x5038be){_0x5038be=_0x5038be||0xcc;return function(_0x42110c){if(_0x42110c){return _0x2ed97d['sendStatus'](_0x5038be);}return _0x2ed97d[_0xa9eb('0x22')](_0x5038be)[_0xa9eb('0x23')]();};}function respondWithResult(_0x87e2a1,_0x3d5f53){_0x3d5f53=_0x3d5f53||0xc8;return function(_0x393d82){if(_0x393d82){return _0x87e2a1[_0xa9eb('0x22')](_0x3d5f53)[_0xa9eb('0x24')](_0x393d82);}};}function respondWithFilteredResult(_0x4973d9,_0x5add59){return function(_0x3b3ed4){if(_0x3b3ed4){var _0x46c2ba=typeof _0x5add59['offset']===_0xa9eb('0x25')&&typeof _0x5add59[_0xa9eb('0x26')]===_0xa9eb('0x25');var _0xf48731=_0x3b3ed4[_0xa9eb('0x27')];var _0x439334=_0x46c2ba?0x0:_0x5add59[_0xa9eb('0x28')];var _0x23e900=_0x46c2ba?_0x3b3ed4[_0xa9eb('0x27')]:_0x5add59['offset']+_0x5add59[_0xa9eb('0x26')];var _0x347336;if(_0x23e900>=_0xf48731){_0x23e900=_0xf48731;_0x347336=0xc8;}else{_0x347336=0xce;}_0x4973d9[_0xa9eb('0x22')](_0x347336);return _0x4973d9[_0xa9eb('0x29')](_0xa9eb('0x2a'),_0x439334+'-'+_0x23e900+'/'+_0xf48731)['json'](_0x3b3ed4);}return null;};}function patchUpdates(_0x57bfcc){return function(_0x236abb){try{jsonpatch['apply'](_0x236abb,_0x57bfcc,!![]);}catch(_0x33b1d4){return BPromise[_0xa9eb('0x2b')](_0x33b1d4);}return _0x236abb['save']();};}function saveUpdates(_0x5b1918,_0x5eb528){return function(_0x19d85c){if(_0x19d85c){return _0x19d85c[_0xa9eb('0x2c')](_0x5b1918)[_0xa9eb('0x2d')](function(_0x25e574){return _0x25e574;});}return null;};}function removeEntity(_0x2f7f12,_0x448055){return function(_0x430f68){if(_0x430f68){return _0x430f68[_0xa9eb('0x2e')]()[_0xa9eb('0x2d')](function(){_0x2f7f12['status'](0xcc)[_0xa9eb('0x23')]();});}};}function handleEntityNotFound(_0x79e07e,_0x2eaa3b){return function(_0x3a84cf){if(!_0x3a84cf){_0x79e07e[_0xa9eb('0x2f')](0x194);}return _0x3a84cf;};}function handleError(_0x2a4f93,_0x2876e4){_0x2876e4=_0x2876e4||0x1f4;return function(_0x508536){logger['error'](_0x508536['stack']);if(_0x508536['name']){delete _0x508536['name'];}_0x2a4f93['status'](_0x2876e4)[_0xa9eb('0x30')](_0x508536);};}exports[_0xa9eb('0x31')]=function(_0x2dfaaa,_0x48c3f4){var _0x44cb42={},_0x4529dd={},_0x2800a7={'count':0x0,'rows':[]};var _0x568935=_[_0xa9eb('0x32')](db[_0xa9eb('0x33')][_0xa9eb('0x34')],function(_0x10ed87){return{'name':_0x10ed87[_0xa9eb('0x35')],'type':_0x10ed87['type'][_0xa9eb('0x36')]};});_0x4529dd[_0xa9eb('0x37')]=_[_0xa9eb('0x32')](_0x568935,_0xa9eb('0x38'));_0x4529dd[_0xa9eb('0x39')]=_[_0xa9eb('0x3a')](_0x2dfaaa[_0xa9eb('0x39')]);_0x4529dd[_0xa9eb('0x3b')]=_['intersection'](_0x4529dd[_0xa9eb('0x37')],_0x4529dd[_0xa9eb('0x39')]);_0x44cb42['attributes']=_[_0xa9eb('0x3c')](_0x4529dd[_0xa9eb('0x37')],qs[_0xa9eb('0x3d')](_0x2dfaaa[_0xa9eb('0x39')]['fields']));_0x44cb42[_0xa9eb('0x3e')]=_0x44cb42[_0xa9eb('0x3e')]['length']?_0x44cb42['attributes']:_0x4529dd['model'];if(!_0x2dfaaa[_0xa9eb('0x39')][_0xa9eb('0x3f')](_0xa9eb('0x40'))){_0x44cb42[_0xa9eb('0x26')]=qs['limit'](_0x2dfaaa[_0xa9eb('0x39')][_0xa9eb('0x26')]);_0x44cb42[_0xa9eb('0x28')]=qs['offset'](_0x2dfaaa['query']['offset']);}_0x44cb42['order']=qs[_0xa9eb('0x41')](_0x2dfaaa[_0xa9eb('0x39')]['sort']);_0x44cb42[_0xa9eb('0x42')]=qs[_0xa9eb('0x3b')](_[_0xa9eb('0x43')](_0x2dfaaa['query'],_0x4529dd['filters']),_0x568935);if(_0x2dfaaa[_0xa9eb('0x39')][_0xa9eb('0x44')]){_0x44cb42[_0xa9eb('0x42')]=_[_0xa9eb('0x45')](_0x44cb42['where'],{'$or':_['map'](_0x568935,function(_0x183cee){if(_0x183cee['type']!==_0xa9eb('0x46')){var _0x402184={};_0x402184[_0x183cee['name']]={'$like':'%'+_0x2dfaaa['query']['filter']+'%'};return _0x402184;}})});}_0x44cb42=_[_0xa9eb('0x45')]({},_0x44cb42,_0x2dfaaa[_0xa9eb('0x47')]);var _0x525e83={'where':_0x44cb42[_0xa9eb('0x42')]};return db[_0xa9eb('0x33')]['count'](_0x525e83)[_0xa9eb('0x2d')](function(_0xa5d481){_0x2800a7[_0xa9eb('0x27')]=_0xa5d481;if(_0x2dfaaa[_0xa9eb('0x39')][_0xa9eb('0x48')]){_0x44cb42[_0xa9eb('0x49')]=[{'all':!![]}];}return db[_0xa9eb('0x33')]['findAll'](_0x44cb42);})['then'](function(_0x3dc400){_0x2800a7[_0xa9eb('0x4a')]=_0x3dc400;return _0x2800a7;})['then'](respondWithFilteredResult(_0x48c3f4,_0x44cb42))['catch'](handleError(_0x48c3f4,null));};exports['show']=function(_0x3505fa,_0x411d6c){var _0x1401a8={'raw':!![],'where':{'id':_0x3505fa[_0xa9eb('0x4b')]['id']}},_0x49054c={};_0x49054c[_0xa9eb('0x37')]=_[_0xa9eb('0x3a')](db['ChatInternalMessage']['rawAttributes']);_0x49054c[_0xa9eb('0x39')]=_[_0xa9eb('0x3a')](_0x3505fa[_0xa9eb('0x39')]);_0x49054c[_0xa9eb('0x3b')]=_['intersection'](_0x49054c[_0xa9eb('0x37')],_0x49054c[_0xa9eb('0x39')]);_0x1401a8['attributes']=_[_0xa9eb('0x3c')](_0x49054c[_0xa9eb('0x37')],qs[_0xa9eb('0x3d')](_0x3505fa[_0xa9eb('0x39')]['fields']));_0x1401a8[_0xa9eb('0x3e')]=_0x1401a8[_0xa9eb('0x3e')][_0xa9eb('0x4c')]?_0x1401a8[_0xa9eb('0x3e')]:_0x49054c[_0xa9eb('0x37')];if(_0x3505fa[_0xa9eb('0x39')][_0xa9eb('0x48')]){_0x1401a8[_0xa9eb('0x49')]=[{'all':!![]}];}_0x1401a8=_['merge']({},_0x1401a8,_0x3505fa[_0xa9eb('0x47')]);return db[_0xa9eb('0x33')][_0xa9eb('0x4d')](_0x1401a8)[_0xa9eb('0x2d')](handleEntityNotFound(_0x411d6c,null))['then'](respondWithResult(_0x411d6c,null))[_0xa9eb('0x4e')](handleError(_0x411d6c,null));};exports['create']=function(_0x1f729f,_0x1e27d8){return db[_0xa9eb('0x33')]['create'](_0x1f729f[_0xa9eb('0x4f')],{})[_0xa9eb('0x2d')](respondWithResult(_0x1e27d8,0xc9))[_0xa9eb('0x4e')](handleError(_0x1e27d8,null));};exports[_0xa9eb('0x2c')]=function(_0x2b8faf,_0x2e7410){if(_0x2b8faf[_0xa9eb('0x4f')]['id']){delete _0x2b8faf[_0xa9eb('0x4f')]['id'];}return db[_0xa9eb('0x33')][_0xa9eb('0x4d')]({'where':{'id':_0x2b8faf[_0xa9eb('0x4b')]['id']}})[_0xa9eb('0x2d')](handleEntityNotFound(_0x2e7410,null))[_0xa9eb('0x2d')](saveUpdates(_0x2b8faf[_0xa9eb('0x4f')],null))[_0xa9eb('0x2d')](respondWithResult(_0x2e7410,null))[_0xa9eb('0x4e')](handleError(_0x2e7410,null));};exports[_0xa9eb('0x2e')]=function(_0xc123b0,_0x290888){return db[_0xa9eb('0x33')][_0xa9eb('0x4d')]({'where':{'id':_0xc123b0[_0xa9eb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x290888,null))['then'](removeEntity(_0x290888,null))[_0xa9eb('0x4e')](handleError(_0x290888,null));};exports[_0xa9eb('0x50')]=function(_0x3fa322,_0x5e8581){return db[_0xa9eb('0x33')][_0xa9eb('0x50')]()[_0xa9eb('0x2d')](respondWithResult(_0x5e8581,null))[_0xa9eb('0x4e')](handleError(_0x5e8581,null));};function wrapUser(_0x548e98){return function(_0x1cd48b){var _0x508038=_0x548e98[_0xa9eb('0x51')]({'plain':!![]});_0x508038['messages']=[];if(_0x1cd48b){_0x508038[_0xa9eb('0x52')]=_0x1cd48b[_0xa9eb('0x53')];_0x508038[_0xa9eb('0x54')]=_0x1cd48b;}else{_0x508038[_0xa9eb('0x52')]=moment(0x0)[_0xa9eb('0x55')](_0xa9eb('0x56'));_0x508038[_0xa9eb('0x54')]={};}return _0x508038;};}exports['getUsers']=function(_0x487420,_0x2b836a,_0x1fda9e){var _0x2447ae=[];return db[_0xa9eb('0x57')][_0xa9eb('0x58')]({'where':{'role':[_0xa9eb('0x59'),_0xa9eb('0x5a'),_0xa9eb('0x5b')]},'attributes':['id','fullname',_0xa9eb('0x38'),_0xa9eb('0x5c'),_0xa9eb('0x5d'),_0xa9eb('0x5e'),_0xa9eb('0x5f'),'lastLoginAt','allowmessenger',_0xa9eb('0x60')],'order':qs[_0xa9eb('0x41')]('-online'),'include':[{'model':db[_0xa9eb('0x61')],'as':'VoiceQueues','attributes':['id',_0xa9eb('0x38'),'type'],'through':{'attributes':[]}}]})[_0xa9eb('0x2d')](function(_0x18eae8){if(_0x18eae8){var _0x12ea53=_0x487420[_0xa9eb('0x5b')][_0xa9eb('0x51')]({'plain':!![]});if(!_0x12ea53)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12ea53[_0xa9eb('0x5c')]===_0xa9eb('0x5b')){return db['UserProfileSection']['find']({'where':{'name':_0xa9eb('0x62'),'userProfileId':_0x12ea53['userProfileId']},'raw':!![]})[_0xa9eb('0x2d')](function(_0x4df551){if(_0x4df551){if(_0x4df551['autoAssociation']===0x0){return db['UserProfileResource'][_0xa9eb('0x58')]({'where':{'sectionId':_0x4df551['id']},'raw':!![]})['then'](function(_0x614fea){var _0x5de2fe=[];if(_[_0xa9eb('0x63')](_0x614fea)){_0x5de2fe=_[_0xa9eb('0x44')](_0x18eae8,function(_0x469dba){if(_0x469dba[_0xa9eb('0x5c')]!=='agent'){return _0x469dba;}});return _0x5de2fe;}else{for(var _0x44438b=0x0;_0x44438b<_0x18eae8[_0xa9eb('0x4c')];_0x44438b++){var _0x58b372=_0x18eae8[_0x44438b];if(_0x58b372[_0xa9eb('0x5c')]===_0xa9eb('0x59')){var _0x2d0567=_[_0xa9eb('0x4d')](_0x614fea,function(_0x347839){return _0x347839[_0xa9eb('0x64')]===_0x58b372['id'];});if(_0x2d0567)_0x5de2fe['push'](_0x58b372);}else{_0x5de2fe[_0xa9eb('0x65')](_0x58b372);}}return _0x5de2fe;}});}else{return _0x18eae8;}}else{var _0x57853d=_['filter'](_0x18eae8,function(_0x59ea99){if(_0x59ea99[_0xa9eb('0x5c')]!==_0xa9eb('0x59')){return _0x59ea99;}});return _0x57853d;}});}else{return _0x18eae8;}}})[_0xa9eb('0x2d')](function(_0x4cf3f7){var _0x34892c=[];if(_0x4cf3f7){_0x2447ae=_0x4cf3f7;for(var _0x3582c0=0x0;_0x3582c0<_0x4cf3f7[_0xa9eb('0x4c')];_0x3582c0+=0x1){_0x2447ae[_0x3582c0][_0xa9eb('0x66')]=[];_0x34892c[_0xa9eb('0x65')](db[_0xa9eb('0x33')][_0xa9eb('0x4d')]({'where':{'FromId':[_0x487420[_0xa9eb('0x5b')]['id'],_0x4cf3f7[_0x3582c0]['id']],'ToId':[_0x487420[_0xa9eb('0x5b')]['id'],_0x4cf3f7[_0x3582c0]['id']],'ChatGroupId':null},'attributes':['id',_0xa9eb('0x53'),'FromId',_0xa9eb('0x67'),_0xa9eb('0x68'),_0xa9eb('0x4f')],'order':qs[_0xa9eb('0x41')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x4cf3f7[_0x3582c0])));}return BPromise[_0xa9eb('0x69')](_0x34892c);}return[];})[_0xa9eb('0x2d')](function(_0x1b2e0f){return{'rows':_0x1b2e0f,'count':_0x1b2e0f[_0xa9eb('0x4c')]};})[_0xa9eb('0x2d')](respondWithResult(_0x2b836a,null))['catch'](handleError(_0x2b836a,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 569a1c7..644d375 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 _0x31cc=['emit','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','remove'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0x31cc,0x10b));var _0xc31c=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x31cc[_0x1da04e];return _0xdd8c41;};'use strict';var EventEmitter=require(_0xc31c('0x0'));var ChatInternalMessage=require(_0xc31c('0x1'))['db'][_0xc31c('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xc31c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc31c('0x4')};function emitEvent(_0xb4771){return function(_0x4d10b4,_0x5b30fb,_0x52d96e){ChatInternalMessageEvents[_0xc31c('0x5')](_0xb4771+':'+_0x4d10b4['id'],_0x4d10b4);ChatInternalMessageEvents[_0xc31c('0x5')](_0xb4771,_0x4d10b4);_0x52d96e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xc31c('0x6')](e,emitEvent(event));}}module[_0xc31c('0x7')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x4c4c=['save','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x4c4c,0xad));var _0xc4c4=function(_0x3b2cdb,_0x2cfc5f){_0x3b2cdb=_0x3b2cdb-0x0;var _0x5dd212=_0x4c4c[_0x3b2cdb];return _0x5dd212;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xc4c4('0x0'))['db'][_0xc4c4('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xc4c4('0x2')](0x0);var events={'afterCreate':_0xc4c4('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x104746){return function(_0x3abfc6,_0x18980a,_0x4240c7){ChatInternalMessageEvents['emit'](_0x104746+':'+_0x3abfc6['id'],_0x3abfc6);ChatInternalMessageEvents[_0xc4c4('0x4')](_0x104746,_0x3abfc6);_0x4240c7(null);};}for(var e in events){if(events[_0xc4c4('0x5')](e)){var event=events[e];ChatInternalMessage[_0xc4c4('0x6')](e,emitEvent(event));}}module[_0xc4c4('0x7')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index bae6d64..c5b87d5 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 _0xcc7c=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4'];(function(_0x152091,_0x1f7c4f){var _0x254a67=function(_0x5972e7){while(--_0x5972e7){_0x152091['push'](_0x152091['shift']());}};_0x254a67(++_0x1f7c4f);}(_0xcc7c,0x1ce));var _0xccc7=function(_0xc4e570,_0x5a9ba1){_0xc4e570=_0xc4e570-0x0;var _0x4880f9=_0xcc7c[_0xc4e570];return _0x4880f9;};'use strict';var _=require(_0xccc7('0x0'));var util=require(_0xccc7('0x1'));var logger=require(_0xccc7('0x2'))('api');var moment=require(_0xccc7('0x3'));var BPromise=require(_0xccc7('0x4'));var rp=require(_0xccc7('0x5'));var fs=require('fs');var path=require(_0xccc7('0x6'));var rimraf=require(_0xccc7('0x7'));var config=require(_0xccc7('0x8'));var attributes=require(_0xccc7('0x9'));module[_0xccc7('0xa')]=function(_0x3d7f0e,_0x303f7c){return _0x3d7f0e[_0xccc7('0xb')](_0xccc7('0xc'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xccc7('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb8ea=['path','rimraf','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xdc356f,_0x3003d0){var _0x339eaa=function(_0xc2283e){while(--_0xc2283e){_0xdc356f['push'](_0xdc356f['shift']());}};_0x339eaa(++_0x3003d0);}(_0xb8ea,0x166));var _0xab8e=function(_0x1dd9e8,_0xec7c43){_0x1dd9e8=_0x1dd9e8-0x0;var _0x4d1525=_0xb8ea[_0x1dd9e8];return _0x4d1525;};'use strict';var _=require(_0xab8e('0x0'));var util=require('util');var logger=require(_0xab8e('0x1'))(_0xab8e('0x2'));var moment=require(_0xab8e('0x3'));var BPromise=require(_0xab8e('0x4'));var rp=require(_0xab8e('0x5'));var fs=require('fs');var path=require(_0xab8e('0x6'));var rimraf=require(_0xab8e('0x7'));var config=require(_0xab8e('0x8'));var attributes=require('./chatInternalMessage.attributes');module[_0xab8e('0x9')]=function(_0x374a35,_0x397420){return _0x374a35[_0xab8e('0xa')](_0xab8e('0xb'),attributes,{'tableName':_0xab8e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xab8e('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 5b8483b..cf62097 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 _0x6709=['jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x1f65c8,_0x316733){var _0x2b3deb=function(_0x8ba84){while(--_0x8ba84){_0x1f65c8['push'](_0x1f65c8['shift']());}};_0x2b3deb(++_0x316733);}(_0x6709,0x12f));var _0x9670=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x6709[_0x550d12];return _0x12103d;};'use strict';var _=require('lodash');var util=require(_0x9670('0x0'));var moment=require(_0x9670('0x1'));var BPromise=require(_0x9670('0x2'));var rs=require(_0x9670('0x3'));var fs=require('fs');var Redis=require(_0x9670('0x4'));var db=require(_0x9670('0x5'))['db'];var utils=require(_0x9670('0x6'));var logger=require('../../config/logger')(_0x9670('0x7'));var config=require(_0x9670('0x8'));var jayson=require(_0x9670('0x9'));var client=jayson[_0x9670('0xa')][_0x9670('0xb')]({'port':0x232a});config[_0x9670('0xc')]=_[_0x9670('0xd')](config[_0x9670('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x9670('0xe'))(new Redis(config[_0x9670('0xc')]));require(_0x9670('0xf'))['register'](socket);function respondWithRpcPromise(_0x41fe9a,_0x4ebd4c,_0x214c9a){return new BPromise(function(_0x535739,_0x14acce){return client['request'](_0x41fe9a,_0x214c9a)['then'](function(_0x2cda6a){logger[_0x9670('0x10')](_0x9670('0x11'),_0x4ebd4c,_0x9670('0x12'));logger[_0x9670('0x13')](_0x9670('0x14'),_0x4ebd4c,'request\x20sent',JSON['stringify'](_0x2cda6a));if(_0x2cda6a[_0x9670('0x15')]){if(_0x2cda6a[_0x9670('0x15')][_0x9670('0x16')]===0x1f4){logger[_0x9670('0x15')](_0x9670('0x11'),_0x4ebd4c,_0x2cda6a[_0x9670('0x15')][_0x9670('0x17')]);return _0x14acce(_0x2cda6a['error']['message']);}logger[_0x9670('0x15')](_0x9670('0x11'),_0x4ebd4c,_0x2cda6a[_0x9670('0x15')][_0x9670('0x17')]);return _0x535739(_0x2cda6a[_0x9670('0x15')][_0x9670('0x17')]);}else{logger[_0x9670('0x10')](_0x9670('0x11'),_0x4ebd4c,_0x9670('0x12'));_0x535739(_0x2cda6a[_0x9670('0x18')]['message']);}})[_0x9670('0x19')](function(_0x484325){logger['error'](_0x9670('0x11'),_0x4ebd4c,_0x484325);_0x14acce(_0x484325);});});} \ No newline at end of file +var _0x4049=['code','message','ChatInternalMessage,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','then','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4049,0x17c));var _0x9404=function(_0xc4f70e,_0x368b9a){_0xc4f70e=_0xc4f70e-0x0;var _0x2d5c55=_0x4049[_0xc4f70e];return _0x2d5c55;};'use strict';var _=require(_0x9404('0x0'));var util=require(_0x9404('0x1'));var moment=require(_0x9404('0x2'));var BPromise=require('bluebird');var rs=require(_0x9404('0x3'));var fs=require('fs');var Redis=require(_0x9404('0x4'));var db=require(_0x9404('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9404('0x6'));var config=require(_0x9404('0x7'));var jayson=require(_0x9404('0x8'));var client=jayson[_0x9404('0x9')][_0x9404('0xa')]({'port':0x232a});config[_0x9404('0xb')]=_['defaults'](config[_0x9404('0xb')],{'host':_0x9404('0xc'),'port':0x18eb});var socket=require(_0x9404('0xd'))(new Redis(config['redis']));require(_0x9404('0xe'))['register'](socket);function respondWithRpcPromise(_0x4fbc72,_0xbf797d,_0xdf79d0){return new BPromise(function(_0xf26a7,_0x1a73a4){return client['request'](_0x4fbc72,_0xdf79d0)[_0x9404('0xf')](function(_0xbcd03f){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0xbf797d,_0x9404('0x10'));logger['debug'](_0x9404('0x11'),_0xbf797d,_0x9404('0x10'),JSON[_0x9404('0x12')](_0xbcd03f));if(_0xbcd03f[_0x9404('0x13')]){if(_0xbcd03f[_0x9404('0x13')][_0x9404('0x14')]===0x1f4){logger[_0x9404('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0xbf797d,_0xbcd03f[_0x9404('0x13')][_0x9404('0x15')]);return _0x1a73a4(_0xbcd03f['error'][_0x9404('0x15')]);}logger['error'](_0x9404('0x16'),_0xbf797d,_0xbcd03f[_0x9404('0x13')][_0x9404('0x15')]);return _0xf26a7(_0xbcd03f[_0x9404('0x13')]['message']);}else{logger[_0x9404('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0xbf797d,'request\x20sent');_0xf26a7(_0xbcd03f['result'][_0x9404('0x15')]);}})[_0x9404('0x18')](function(_0x30185){logger['error'](_0x9404('0x16'),_0xbf797d,_0x30185);_0x1a73a4(_0x30185);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 5911db8..40f51fb 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 _0x4049=['register','length','./chatInternalMessage.events','save','remove','update','emit','removeListener'];(function(_0x5d8018,_0x588592){var _0x151ac4=function(_0x548679){while(--_0x548679){_0x5d8018['push'](_0x5d8018['shift']());}};_0x151ac4(++_0x588592);}(_0x4049,0xb2));var _0x9404=function(_0x3146ca,_0x1b2d0b){_0x3146ca=_0x3146ca-0x0;var _0x2efb5d=_0x4049[_0x3146ca];return _0x2efb5d;};'use strict';var ChatInternalMessageEvents=require(_0x9404('0x0'));var events=[_0x9404('0x1'),_0x9404('0x2'),_0x9404('0x3')];function createListener(_0xe382f1,_0x6ddcb5){return function(_0x1470a1){_0x6ddcb5[_0x9404('0x4')](_0xe382f1,_0x1470a1);};}function removeListener(_0x5bae98,_0x4b1e71){return function(){ChatInternalMessageEvents[_0x9404('0x5')](_0x5bae98,_0x4b1e71);};}exports[_0x9404('0x6')]=function(_0x5b8d0b){for(var _0x54354b=0x0,_0x478c59=events[_0x9404('0x7')];_0x54354b<_0x478c59;_0x54354b++){var _0x3a6805=events[_0x54354b];var _0x3aa8a9=createListener('chatInternalMessage:'+_0x3a6805,_0x5b8d0b);ChatInternalMessageEvents['on'](_0x3a6805,_0x3aa8a9);}}; \ No newline at end of file +var _0x1672=['remove','update','emit','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x13e080,_0x30a7e7){var _0x1efcb7=function(_0x2be3f4){while(--_0x2be3f4){_0x13e080['push'](_0x13e080['shift']());}};_0x1efcb7(++_0x30a7e7);}(_0x1672,0x1c6));var _0x2167=function(_0xd1788c,_0x4830a2){_0xd1788c=_0xd1788c-0x0;var _0x9ce47f=_0x1672[_0xd1788c];return _0x9ce47f;};'use strict';var ChatInternalMessageEvents=require(_0x2167('0x0'));var events=[_0x2167('0x1'),_0x2167('0x2'),_0x2167('0x3')];function createListener(_0xa1d2b2,_0x5ed839){return function(_0x879977){_0x5ed839[_0x2167('0x4')](_0xa1d2b2,_0x879977);};}function removeListener(_0x49042a,_0x16946d){return function(){ChatInternalMessageEvents['removeListener'](_0x49042a,_0x16946d);};}exports[_0x2167('0x5')]=function(_0x37ca80){for(var _0x31ce03=0x0,_0xe3e5ee=events[_0x2167('0x6')];_0x31ce03<_0xe3e5ee;_0x31ce03++){var _0x32ba54=events[_0x31ce03];var _0x2ce68f=createListener(_0x2167('0x7')+_0x32ba54,_0x37ca80);ChatInternalMessageEvents['on'](_0x32ba54,_0x2ce68f);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 2fd9d3b..c49a7c9 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 _0x1581=['Router','fs-extra','../../components/interaction/service','get','isAuthenticated','/describe','describe','/users','getUsers','/:id','show','post','create','update','delete','destroy','exports','multer','util','express'];(function(_0x3b390b,_0x25a1ae){var _0x34d785=function(_0xa64dcf){while(--_0xa64dcf){_0x3b390b['push'](_0x3b390b['shift']());}};_0x34d785(++_0x25a1ae);}(_0x1581,0x89));var _0x1158=function(_0x33d09a,_0x1930bf){_0x33d09a=_0x33d09a-0x0;var _0x2e458c=_0x1581[_0x33d09a];return _0x2e458c;};'use strict';var multer=require(_0x1158('0x0'));var util=require(_0x1158('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1158('0x2'));var router=express[_0x1158('0x3')]();var fs_extra=require(_0x1158('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1158('0x5'));var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0x1158('0x6')]('/',auth[_0x1158('0x7')](),controller['index']);router[_0x1158('0x6')](_0x1158('0x8'),auth[_0x1158('0x7')](),controller[_0x1158('0x9')]);router[_0x1158('0x6')](_0x1158('0xa'),auth[_0x1158('0x7')](),controller[_0x1158('0xb')]);router[_0x1158('0x6')](_0x1158('0xc'),auth['isAuthenticated'](),controller[_0x1158('0xd')]);router[_0x1158('0xe')]('/',auth[_0x1158('0x7')](),controller[_0x1158('0xf')]);router['put'](_0x1158('0xc'),controller[_0x1158('0x10')]);router[_0x1158('0x11')](_0x1158('0xc'),auth['isAuthenticated'](),controller[_0x1158('0x12')]);module[_0x1158('0x13')]=router; \ No newline at end of file +var _0xf03a=['/describe','describe','getUsers','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xf03a,0x16a));var _0xaf03=function(_0x4a15d1,_0x3c4eb7){_0x4a15d1=_0x4a15d1-0x0;var _0x10264e=_0xf03a[_0x4a15d1];return _0x10264e;};'use strict';var multer=require(_0xaf03('0x0'));var util=require(_0xaf03('0x1'));var path=require(_0xaf03('0x2'));var timeout=require(_0xaf03('0x3'));var express=require(_0xaf03('0x4'));var router=express[_0xaf03('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xaf03('0x6'));var interaction=require(_0xaf03('0x7'));var config=require(_0xaf03('0x8'));var controller=require(_0xaf03('0x9'));router[_0xaf03('0xa')]('/',auth[_0xaf03('0xb')](),controller['index']);router[_0xaf03('0xa')](_0xaf03('0xc'),auth['isAuthenticated'](),controller[_0xaf03('0xd')]);router[_0xaf03('0xa')]('/users',auth[_0xaf03('0xb')](),controller[_0xaf03('0xe')]);router['get'](_0xaf03('0xf'),auth[_0xaf03('0xb')](),controller[_0xaf03('0x10')]);router[_0xaf03('0x11')]('/',auth[_0xaf03('0xb')](),controller[_0xaf03('0x12')]);router[_0xaf03('0x13')](_0xaf03('0xf'),controller['update']);router[_0xaf03('0x14')](_0xaf03('0xf'),auth[_0xaf03('0xb')](),controller['destroy']);module[_0xaf03('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index bc8e836..cdf12f2 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 _0xce3a=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize'];(function(_0x4cf2a2,_0x9f14f9){var _0x5483c0=function(_0x187064){while(--_0x187064){_0x4cf2a2['push'](_0x4cf2a2['shift']());}};_0x5483c0(++_0x9f14f9);}(_0xce3a,0x194));var _0xace3=function(_0x12cca1,_0x228441){_0x12cca1=_0x12cca1-0x0;var _0x341598=_0xce3a[_0x12cca1];return _0x341598;};'use strict';var Sequelize=require(_0xace3('0x0'));module[_0xace3('0x1')]={'body':{'type':Sequelize[_0xace3('0x2')](_0xace3('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xace3('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xace3('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xace3('0x5')]('in',_0xace3('0x6')),'defaultValue':_0xace3('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xace3('0x7')]},'providerName':{'type':Sequelize[_0xace3('0x8')]},'providerResponse':{'type':Sequelize[_0xace3('0x2')]}}; \ No newline at end of file +var _0xdc9b=['TEXT','BOOLEAN','out','DATE','sequelize','exports'];(function(_0x449dc6,_0x2882f2){var _0x297b1a=function(_0x181bc9){while(--_0x181bc9){_0x449dc6['push'](_0x449dc6['shift']());}};_0x297b1a(++_0x2882f2);}(_0xdc9b,0x70));var _0xbdc9=function(_0x32d144,_0x5e99e6){_0x32d144=_0x32d144-0x0;var _0x104efc=_0xdc9b[_0x32d144];return _0x104efc;};'use strict';var Sequelize=require(_0xbdc9('0x0'));module[_0xbdc9('0x1')]={'body':{'type':Sequelize[_0xbdc9('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xbdc9('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbdc9('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xbdc9('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbdc9('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xbdc9('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index d4ac768..e5a53e4 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 _0xeb51=['[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','User','channel','reject','rejectmessage','parse','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','client','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','destroy','stack','name','index','map','ChatMessage','fieldName','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','options','includeAll','include','findAll','show','rawAttributes','merge','find','create','body','params','describe','readAt','format','UserId','user','agent','get','ChatInteraction','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','motionChannel','accept','EventManager','acceptmessage','formData','chat-interactions','chat','ChatInteractionId'];(function(_0x38193f,_0x2c6649){var _0x283b66=function(_0x1da004){while(--_0x1da004){_0x38193f['push'](_0x38193f['shift']());}};_0x283b66(++_0x2c6649);}(_0xeb51,0x1a5));var _0x1eb5=function(_0x2bab88,_0x29d47e){_0x2bab88=_0x2bab88-0x0;var _0x1ea031=_0xeb51[_0x2bab88];return _0x1ea031;};'use strict';var emlformat=require(_0x1eb5('0x0'));var rimraf=require(_0x1eb5('0x1'));var zipdir=require(_0x1eb5('0x2'));var jsonpatch=require(_0x1eb5('0x3'));var rp=require(_0x1eb5('0x4'));var moment=require(_0x1eb5('0x5'));var BPromise=require(_0x1eb5('0x6'));var Mustache=require('mustache');var util=require(_0x1eb5('0x7'));var path=require(_0x1eb5('0x8'));var sox=require(_0x1eb5('0x9'));var csv=require(_0x1eb5('0xa'));var ejs=require(_0x1eb5('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1eb5('0xc'));var squel=require(_0x1eb5('0xd'));var crypto=require(_0x1eb5('0xe'));var jsforce=require(_0x1eb5('0xf'));var deskjs=require(_0x1eb5('0x10'));var toCsv=require('to-csv');var querystring=require(_0x1eb5('0x11'));var Papa=require(_0x1eb5('0x12'));var Redis=require(_0x1eb5('0x13'));var authService=require(_0x1eb5('0x14'));var qs=require(_0x1eb5('0x15'));var as=require(_0x1eb5('0x16'));var hardwareService=require(_0x1eb5('0x17'));var logger=require(_0x1eb5('0x18'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1eb5('0x19'));var db=require(_0x1eb5('0x1a'))['db'];config[_0x1eb5('0x1b')]=_[_0x1eb5('0x1c')](config['redis'],{'host':_0x1eb5('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1eb5('0x1b')]));require(_0x1eb5('0x1e'))[_0x1eb5('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x1eb5('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x1eb5('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26256d,_0x3df611,_0x584510,_0x4ee84b){return new BPromise(function(_0xe20a2e,_0x2bcd95){var _0x34c7c8=_0x4ee84b||client;return _0x34c7c8['request'](_0x26256d,_0x584510)[_0x1eb5('0x21')](function(_0x4ec376){logger[_0x1eb5('0x22')](_0x1eb5('0x23'),_0x3df611,_0x1eb5('0x24'));logger[_0x1eb5('0x25')](_0x1eb5('0x26'),_0x3df611,_0x1eb5('0x24'),JSON[_0x1eb5('0x27')](_0x4ec376));if(_0x4ec376['error']){if(_0x4ec376[_0x1eb5('0x28')][_0x1eb5('0x29')]===0x1f4){logger[_0x1eb5('0x28')](_0x1eb5('0x23'),_0x3df611,_0x4ec376['error'][_0x1eb5('0x2a')]);return _0x2bcd95(_0x4ec376[_0x1eb5('0x28')][_0x1eb5('0x2a')]);}logger[_0x1eb5('0x28')]('ChatMessage,\x20%s,\x20%s',_0x3df611,_0x4ec376[_0x1eb5('0x28')]['message']);return _0xe20a2e(_0x4ec376[_0x1eb5('0x28')][_0x1eb5('0x2a')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x3df611,'request\x20sent');_0xe20a2e(_0x4ec376[_0x1eb5('0x2b')]['message']);}})[_0x1eb5('0x2c')](function(_0x2bd675){logger[_0x1eb5('0x28')]('ChatMessage,\x20%s,\x20%s',_0x3df611,_0x2bd675);_0x2bcd95(_0x2bd675);});});}function respondWithStatusCode(_0x21c46d,_0x90a2b9){_0x90a2b9=_0x90a2b9||0xcc;return function(_0x35420f){if(_0x35420f){return _0x21c46d[_0x1eb5('0x2d')](_0x90a2b9);}return _0x21c46d['status'](_0x90a2b9)[_0x1eb5('0x2e')]();};}function respondWithResult(_0x3713a8,_0x511cec){_0x511cec=_0x511cec||0xc8;return function(_0x43652d){if(_0x43652d){return _0x3713a8[_0x1eb5('0x2f')](_0x511cec)[_0x1eb5('0x30')](_0x43652d);}};}function respondWithFilteredResult(_0x16514f,_0x293f10){return function(_0x44264e){if(_0x44264e){var _0x6c3a3e=typeof _0x293f10['offset']===_0x1eb5('0x31')&&typeof _0x293f10[_0x1eb5('0x32')]===_0x1eb5('0x31');var _0x5b56a0=_0x44264e['count'];var _0x475794=_0x6c3a3e?0x0:_0x293f10['offset'];var _0x2844a2=_0x6c3a3e?_0x44264e[_0x1eb5('0x33')]:_0x293f10[_0x1eb5('0x34')]+_0x293f10['limit'];var _0x1fa064;if(_0x2844a2>=_0x5b56a0){_0x2844a2=_0x5b56a0;_0x1fa064=0xc8;}else{_0x1fa064=0xce;}_0x16514f[_0x1eb5('0x2f')](_0x1fa064);return _0x16514f[_0x1eb5('0x35')](_0x1eb5('0x36'),_0x475794+'-'+_0x2844a2+'/'+_0x5b56a0)[_0x1eb5('0x30')](_0x44264e);}return null;};}function patchUpdates(_0x3b368d){return function(_0x4d22cb){try{jsonpatch[_0x1eb5('0x37')](_0x4d22cb,_0x3b368d,!![]);}catch(_0x5e2664){return BPromise['reject'](_0x5e2664);}return _0x4d22cb['save']();};}function saveUpdates(_0x37d63d,_0xec2d3){return function(_0x100691){if(_0x100691){return _0x100691[_0x1eb5('0x38')](_0x37d63d)['then'](function(_0x27ea7a){return _0x27ea7a;});}return null;};}function removeEntity(_0x1d6a05,_0x294b2c){return function(_0x179af1){if(_0x179af1){return _0x179af1[_0x1eb5('0x39')]()[_0x1eb5('0x21')](function(){_0x1d6a05[_0x1eb5('0x2f')](0xcc)[_0x1eb5('0x2e')]();});}};}function handleEntityNotFound(_0x54dc4b,_0x1e816e){return function(_0x38646f){if(!_0x38646f){_0x54dc4b[_0x1eb5('0x2d')](0x194);}return _0x38646f;};}function handleError(_0x4fa75c,_0xab3627){_0xab3627=_0xab3627||0x1f4;return function(_0x265258){logger[_0x1eb5('0x28')](_0x265258[_0x1eb5('0x3a')]);if(_0x265258[_0x1eb5('0x3b')]){delete _0x265258[_0x1eb5('0x3b')];}_0x4fa75c[_0x1eb5('0x2f')](_0xab3627)['send'](_0x265258);};}exports[_0x1eb5('0x3c')]=function(_0x377b54,_0x39c450){var _0x1cd4d6={},_0x8f2234={},_0x5d2f7f={'count':0x0,'rows':[]};var _0x46db33=_[_0x1eb5('0x3d')](db[_0x1eb5('0x3e')]['rawAttributes'],function(_0x45262b){return{'name':_0x45262b[_0x1eb5('0x3f')],'type':_0x45262b['type']['key']};});_0x8f2234['model']=_[_0x1eb5('0x3d')](_0x46db33,_0x1eb5('0x3b'));_0x8f2234[_0x1eb5('0x40')]=_[_0x1eb5('0x41')](_0x377b54['query']);_0x8f2234[_0x1eb5('0x42')]=_[_0x1eb5('0x43')](_0x8f2234[_0x1eb5('0x44')],_0x8f2234[_0x1eb5('0x40')]);_0x1cd4d6['attributes']=_[_0x1eb5('0x43')](_0x8f2234[_0x1eb5('0x44')],qs[_0x1eb5('0x45')](_0x377b54['query'][_0x1eb5('0x45')]));_0x1cd4d6['attributes']=_0x1cd4d6[_0x1eb5('0x46')][_0x1eb5('0x47')]?_0x1cd4d6[_0x1eb5('0x46')]:_0x8f2234[_0x1eb5('0x44')];if(!_0x377b54[_0x1eb5('0x40')][_0x1eb5('0x48')](_0x1eb5('0x49'))){_0x1cd4d6[_0x1eb5('0x32')]=qs[_0x1eb5('0x32')](_0x377b54[_0x1eb5('0x40')][_0x1eb5('0x32')]);_0x1cd4d6[_0x1eb5('0x34')]=qs['offset'](_0x377b54['query']['offset']);}_0x1cd4d6[_0x1eb5('0x4a')]=qs[_0x1eb5('0x4b')](_0x377b54[_0x1eb5('0x40')][_0x1eb5('0x4b')]);_0x1cd4d6[_0x1eb5('0x4c')]=qs[_0x1eb5('0x42')](_['pick'](_0x377b54[_0x1eb5('0x40')],_0x8f2234[_0x1eb5('0x42')]),_0x46db33);if(_0x377b54[_0x1eb5('0x40')][_0x1eb5('0x4d')]){_0x1cd4d6[_0x1eb5('0x4c')]=_['merge'](_0x1cd4d6[_0x1eb5('0x4c')],{'$or':_[_0x1eb5('0x3d')](_0x46db33,function(_0x48f4e8){if(_0x48f4e8[_0x1eb5('0x4e')]!==_0x1eb5('0x4f')){var _0x454660={};_0x454660[_0x48f4e8[_0x1eb5('0x3b')]]={'$like':'%'+_0x377b54['query'][_0x1eb5('0x4d')]+'%'};return _0x454660;}})});}_0x1cd4d6=_['merge']({},_0x1cd4d6,_0x377b54[_0x1eb5('0x50')]);var _0x36f5b0={'where':_0x1cd4d6[_0x1eb5('0x4c')]};return db[_0x1eb5('0x3e')][_0x1eb5('0x33')](_0x36f5b0)[_0x1eb5('0x21')](function(_0x3fd200){_0x5d2f7f[_0x1eb5('0x33')]=_0x3fd200;if(_0x377b54[_0x1eb5('0x40')][_0x1eb5('0x51')]){_0x1cd4d6[_0x1eb5('0x52')]=[{'all':!![]}];}return db[_0x1eb5('0x3e')][_0x1eb5('0x53')](_0x1cd4d6);})[_0x1eb5('0x21')](function(_0x8af9e6){_0x5d2f7f['rows']=_0x8af9e6;return _0x5d2f7f;})['then'](respondWithFilteredResult(_0x39c450,_0x1cd4d6))['catch'](handleError(_0x39c450,null));};exports[_0x1eb5('0x54')]=function(_0x3960f4,_0x5a6daf){var _0x34b979={'raw':!![],'where':{'id':_0x3960f4['params']['id']}},_0x3f0326={};_0x3f0326['model']=_[_0x1eb5('0x41')](db[_0x1eb5('0x3e')][_0x1eb5('0x55')]);_0x3f0326[_0x1eb5('0x40')]=_['keys'](_0x3960f4[_0x1eb5('0x40')]);_0x3f0326[_0x1eb5('0x42')]=_[_0x1eb5('0x43')](_0x3f0326[_0x1eb5('0x44')],_0x3f0326[_0x1eb5('0x40')]);_0x34b979[_0x1eb5('0x46')]=_[_0x1eb5('0x43')](_0x3f0326['model'],qs[_0x1eb5('0x45')](_0x3960f4['query'][_0x1eb5('0x45')]));_0x34b979['attributes']=_0x34b979['attributes']['length']?_0x34b979[_0x1eb5('0x46')]:_0x3f0326[_0x1eb5('0x44')];if(_0x3960f4[_0x1eb5('0x40')][_0x1eb5('0x51')]){_0x34b979[_0x1eb5('0x52')]=[{'all':!![]}];}_0x34b979=_[_0x1eb5('0x56')]({},_0x34b979,_0x3960f4[_0x1eb5('0x50')]);return db['ChatMessage'][_0x1eb5('0x57')](_0x34b979)[_0x1eb5('0x21')](handleEntityNotFound(_0x5a6daf,null))['then'](respondWithResult(_0x5a6daf,null))[_0x1eb5('0x2c')](handleError(_0x5a6daf,null));};exports[_0x1eb5('0x58')]=function(_0x1cb16f,_0x183387){return db[_0x1eb5('0x3e')][_0x1eb5('0x58')](_0x1cb16f[_0x1eb5('0x59')],{})[_0x1eb5('0x21')](respondWithResult(_0x183387,0xc9))[_0x1eb5('0x2c')](handleError(_0x183387,null));};exports[_0x1eb5('0x38')]=function(_0x4f227f,_0xdce2c3){if(_0x4f227f[_0x1eb5('0x59')]['id']){delete _0x4f227f[_0x1eb5('0x59')]['id'];}return db['ChatMessage'][_0x1eb5('0x57')]({'where':{'id':_0x4f227f[_0x1eb5('0x5a')]['id']}})[_0x1eb5('0x21')](handleEntityNotFound(_0xdce2c3,null))[_0x1eb5('0x21')](saveUpdates(_0x4f227f[_0x1eb5('0x59')],null))[_0x1eb5('0x21')](respondWithResult(_0xdce2c3,null))[_0x1eb5('0x2c')](handleError(_0xdce2c3,null));};exports[_0x1eb5('0x39')]=function(_0xfb96a2,_0x502c80){return db[_0x1eb5('0x3e')][_0x1eb5('0x57')]({'where':{'id':_0xfb96a2['params']['id']}})[_0x1eb5('0x21')](handleEntityNotFound(_0x502c80,null))[_0x1eb5('0x21')](removeEntity(_0x502c80,null))[_0x1eb5('0x2c')](handleError(_0x502c80,null));};exports[_0x1eb5('0x5b')]=function(_0x4d4af6,_0x127685){return db[_0x1eb5('0x3e')][_0x1eb5('0x5b')]()[_0x1eb5('0x21')](respondWithResult(_0x127685,null))['catch'](handleError(_0x127685,null));};var interaction_log=require(_0x1eb5('0x18'))('chat-interactions');exports['accept']=function(_0x19a215,_0x44cc25,_0x2a5789){var _0x2f01f7={'agent':{},'channel':'chat'};if(_0x19a215['body']['id']){delete _0x19a215['body']['id'];}_0x19a215[_0x1eb5('0x59')]['read']=!![];_0x19a215[_0x1eb5('0x59')][_0x1eb5('0x5c')]=moment()[_0x1eb5('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x19a215['body'][_0x1eb5('0x5e')]=_0x19a215['body'][_0x1eb5('0x5e')]||_0x19a215[_0x1eb5('0x5f')]['id'];_0x2f01f7[_0x1eb5('0x60')]['id']=_0x19a215[_0x1eb5('0x59')][_0x1eb5('0x5e')];return db['ChatMessage'][_0x1eb5('0x57')]({'where':{'id':_0x19a215['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x44cc25,null))[_0x1eb5('0x21')](saveUpdates(_0x19a215['body'],null))['then'](function(_0x212ee4){if(_0x212ee4){_0x2f01f7[_0x1eb5('0x2a')]=_0x212ee4[_0x1eb5('0x61')]({'plain':!![]});return db[_0x1eb5('0x62')]['find']({'where':{'id':_0x212ee4['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x44cc25,null))[_0x1eb5('0x21')](function(_0x3de0be){if(_0x3de0be){return _0x3de0be['update']({'UserId':_0x19a215[_0x1eb5('0x59')][_0x1eb5('0x5e')],'read1stAt':_[_0x1eb5('0x63')](_0x3de0be[_0x1eb5('0x64')])?moment()[_0x1eb5('0x5d')](_0x1eb5('0x65')):undefined});}return null;})[_0x1eb5('0x21')](function(_0x544f45){if(_0x544f45){_0x2f01f7[_0x1eb5('0x66')]=_0x544f45[_0x1eb5('0x61')]({'plain':!![]});interaction_log[_0x1eb5('0x22')](_0x1eb5('0x67'),_0x19a215[_0x1eb5('0x5f')]['id'],_0x19a215[_0x1eb5('0x5f')][_0x1eb5('0x3b')],_0x19a215[_0x1eb5('0x5f')][_0x1eb5('0x68')],_0x2f01f7[_0x1eb5('0x66')]['id'],_0x19a215[_0x1eb5('0x59')]?JSON[_0x1eb5('0x27')](_0x19a215['body']):_0x1eb5('0x69'));return respondWithRpcPromise(_0x1eb5('0x6a'),_0x1eb5('0x6b'),_0x2f01f7);}return null;})[_0x1eb5('0x21')](function(_0x50704e){var _0x20be10='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x50704e[_0x1eb5('0x2a')][_0x1eb5('0x6c')];return db['sequelize'][_0x1eb5('0x40')](_0x20be10,{'type':db[_0x1eb5('0x6d')][_0x1eb5('0x6e')][_0x1eb5('0x6f')],'raw':!![]})[_0x1eb5('0x21')](function(_0x488a17){return _0x488a17;});})[_0x1eb5('0x21')](function(_0x328f91){if(_0x328f91){_0x2f01f7[_0x1eb5('0x2a')][_0x1eb5('0x70')]=_0x328f91[0x0];if(!_0x19a215['body']['UserId'])return;return db['User'][_0x1eb5('0x57')]({'where':{'id':_0x19a215[_0x1eb5('0x59')][_0x1eb5('0x5e')],'role':_0x1eb5('0x60')},'attributes':['id',_0x1eb5('0x3b'),_0x1eb5('0x71'),_0x1eb5('0x72'),_0x1eb5('0x73')],'raw':!![]});}return null;})[_0x1eb5('0x21')](function(_0x5d0ee7){if(!_0x5d0ee7)return null;_0x2f01f7[_0x1eb5('0x2a')][_0x1eb5('0x60')]=_0x5d0ee7;return _0x2f01f7;})['then'](function(_0x4e1034){if(_0x4e1034){if(_0x19a215[_0x1eb5('0x59')][_0x1eb5('0x74')]){_0x2f01f7[_0x1eb5('0x2a')][_0x1eb5('0x75')]=util[_0x1eb5('0x5d')](_0x1eb5('0x76'),_0x19a215[_0x1eb5('0x5f')][_0x1eb5('0x3b')]);_0x2f01f7[_0x1eb5('0x2a')]['channel']=_0x2f01f7['channel'];_0x2f01f7[_0x1eb5('0x2a')][_0x1eb5('0x77')]=_0x2f01f7['channel'];_0x2f01f7[_0x1eb5('0x2a')]['event']=_0x1eb5('0x78');return respondWithRpcPromise(_0x1eb5('0x79'),_0x1eb5('0x79'),{'event':_0x1eb5('0x7a'),'message':_[_0x1eb5('0x56')](_0x2f01f7['message'],JSON['parse'](_0x2f01f7[_0x1eb5('0x66')][_0x1eb5('0x7b')]))},client9002)['then'](function(){return _0x2f01f7;});}return _0x2f01f7;}return null;})[_0x1eb5('0x21')](respondWithResult(_0x44cc25,null))[_0x1eb5('0x2c')](handleError(_0x44cc25,null));};var interaction_log=require(_0x1eb5('0x18'))(_0x1eb5('0x7c'));exports['reject']=function(_0x31babc,_0x31dd19,_0x308c52){var _0x5ec158={'agent':{},'channel':_0x1eb5('0x7d')};if(_0x31babc['body']['id']){delete _0x31babc['body']['id'];}_0x31babc[_0x1eb5('0x59')][_0x1eb5('0x5e')]=_0x31babc['body'][_0x1eb5('0x5e')]||_0x31babc[_0x1eb5('0x5f')]['id'];_0x5ec158[_0x1eb5('0x60')]['id']=_0x31babc['body'][_0x1eb5('0x5e')];return db[_0x1eb5('0x3e')][_0x1eb5('0x57')]({'where':{'id':_0x31babc[_0x1eb5('0x5a')]['id'],'UserId':null}})[_0x1eb5('0x21')](handleEntityNotFound(_0x31dd19,null))[_0x1eb5('0x21')](function(_0x582b59){if(_0x582b59){_0x5ec158[_0x1eb5('0x2a')]=_0x582b59[_0x1eb5('0x61')]({'plain':!![]});return db[_0x1eb5('0x62')][_0x1eb5('0x57')]({'where':{'id':_0x582b59[_0x1eb5('0x7e')]}});}return null;})[_0x1eb5('0x21')](handleEntityNotFound(_0x31dd19,null))[_0x1eb5('0x21')](function(_0x2c033c){if(_0x2c033c){_0x5ec158['interaction']=_0x2c033c['get']({'plain':!![]});interaction_log['info'](_0x1eb5('0x7f'),_0x31babc[_0x1eb5('0x5f')]['id'],_0x31babc[_0x1eb5('0x5f')][_0x1eb5('0x3b')],_0x31babc[_0x1eb5('0x5f')][_0x1eb5('0x68')],_0x5ec158[_0x1eb5('0x66')]['id'],_0x31babc[_0x1eb5('0x59')]?JSON[_0x1eb5('0x27')](_0x31babc[_0x1eb5('0x59')]):_0x1eb5('0x69'));return respondWithRpcPromise(_0x1eb5('0x80'),_0x1eb5('0x81'),_0x5ec158);}return null;})[_0x1eb5('0x21')](function(_0x7d85bd){var _0xb9ec7c=_0x1eb5('0x82')+_0x7d85bd[_0x1eb5('0x2a')][_0x1eb5('0x6c')];return db[_0x1eb5('0x83')][_0x1eb5('0x40')](_0xb9ec7c,{'type':db['Sequelize'][_0x1eb5('0x6e')][_0x1eb5('0x6f')],'raw':!![]})[_0x1eb5('0x21')](function(_0x343ba3){return _0x343ba3;});})[_0x1eb5('0x21')](function(_0x1cdc45){if(_0x1cdc45){_0x5ec158[_0x1eb5('0x2a')][_0x1eb5('0x70')]=_0x1cdc45[0x0];if(!_0x31babc[_0x1eb5('0x59')]['UserId'])return;return db[_0x1eb5('0x84')]['find']({'where':{'id':_0x31babc['body'][_0x1eb5('0x5e')],'role':_0x1eb5('0x60')},'attributes':['id','name',_0x1eb5('0x71'),'email',_0x1eb5('0x73')],'raw':!![]});}return null;})['then'](function(_0x53a924){if(!_0x53a924)return null;_0x5ec158[_0x1eb5('0x2a')]['agent']=_0x53a924;return _0x5ec158;})[_0x1eb5('0x21')](function(_0x22716b){if(_0x22716b){_0x22716b[_0x1eb5('0x2a')]['interface']=util[_0x1eb5('0x5d')](_0x1eb5('0x76'),_0x31babc[_0x1eb5('0x5f')]['name']);_0x22716b[_0x1eb5('0x2a')][_0x1eb5('0x85')]=_0x5ec158[_0x1eb5('0x85')];_0x22716b[_0x1eb5('0x2a')][_0x1eb5('0x77')]=_0x5ec158[_0x1eb5('0x85')];_0x22716b['message']['event']=_0x1eb5('0x86');respondWithRpcPromise('EventManager','EventManager',{'event':_0x1eb5('0x87'),'message':_[_0x1eb5('0x56')](_0x5ec158[_0x1eb5('0x2a')],JSON[_0x1eb5('0x88')](_0x5ec158[_0x1eb5('0x66')][_0x1eb5('0x7b')]))},client9002);return _0x5ec158;}return null;})['then'](respondWithResult(_0x31dd19,null))[_0x1eb5('0x2c')](handleError(_0x31dd19,null));}; \ No newline at end of file +var _0x2554=['type','VIRTUAL','options','ChatMessage','includeAll','include','findAll','rows','show','params','merge','find','create','body','describe','../../config/logger','chat-interactions','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','isNil','read1stAt','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','User','fullname','email','internal','interface','channel','event','accept','EventManager','acceptmessage','parse','formData','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','SIP/%s','motionChannel','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x4a7e20,_0x2dada2){var _0x4338e7=function(_0x236196){while(--_0x236196){_0x4a7e20['push'](_0x4a7e20['shift']());}};_0x4338e7(++_0x2dada2);}(_0x2554,0x158));var _0x4255=function(_0x1ffc52,_0x5f05cc){_0x1ffc52=_0x1ffc52-0x0;var _0x40f4f7=_0x2554[_0x1ffc52];return _0x40f4f7;};'use strict';var emlformat=require(_0x4255('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4255('0x1'));var jsonpatch=require(_0x4255('0x2'));var rp=require(_0x4255('0x3'));var moment=require(_0x4255('0x4'));var BPromise=require(_0x4255('0x5'));var Mustache=require(_0x4255('0x6'));var util=require(_0x4255('0x7'));var path=require(_0x4255('0x8'));var sox=require(_0x4255('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4255('0xa'));var _=require(_0x4255('0xb'));var squel=require(_0x4255('0xc'));var crypto=require(_0x4255('0xd'));var jsforce=require(_0x4255('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4255('0xf'));var querystring=require(_0x4255('0x10'));var Papa=require(_0x4255('0x11'));var Redis=require(_0x4255('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4255('0x13'));var as=require(_0x4255('0x14'));var hardwareService=require(_0x4255('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x4255('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4255('0x17'));var db=require(_0x4255('0x18'))['db'];config[_0x4255('0x19')]=_['defaults'](config[_0x4255('0x19')],{'host':_0x4255('0x1a'),'port':0x18eb});var socket=require(_0x4255('0x1b'))(new Redis(config[_0x4255('0x19')]));require(_0x4255('0x1c'))['register'](socket);var jayson=require(_0x4255('0x1d'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x4255('0x1e')][_0x4255('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2f46ce,_0xdf2a6f,_0x39a772,_0x30f966){return new BPromise(function(_0xd32448,_0x45e023){var _0x135908=_0x30f966||client;return _0x135908[_0x4255('0x20')](_0x2f46ce,_0x39a772)[_0x4255('0x21')](function(_0x84313f){logger[_0x4255('0x22')](_0x4255('0x23'),_0xdf2a6f,'request\x20sent');logger[_0x4255('0x24')](_0x4255('0x25'),_0xdf2a6f,_0x4255('0x26'),JSON[_0x4255('0x27')](_0x84313f));if(_0x84313f[_0x4255('0x28')]){if(_0x84313f[_0x4255('0x28')][_0x4255('0x29')]===0x1f4){logger[_0x4255('0x28')](_0x4255('0x23'),_0xdf2a6f,_0x84313f[_0x4255('0x28')][_0x4255('0x2a')]);return _0x45e023(_0x84313f[_0x4255('0x28')]['message']);}logger[_0x4255('0x28')](_0x4255('0x23'),_0xdf2a6f,_0x84313f['error'][_0x4255('0x2a')]);return _0xd32448(_0x84313f[_0x4255('0x28')][_0x4255('0x2a')]);}else{logger[_0x4255('0x22')](_0x4255('0x23'),_0xdf2a6f,_0x4255('0x26'));_0xd32448(_0x84313f[_0x4255('0x2b')][_0x4255('0x2a')]);}})[_0x4255('0x2c')](function(_0x4200b7){logger['error'](_0x4255('0x23'),_0xdf2a6f,_0x4200b7);_0x45e023(_0x4200b7);});});}function respondWithStatusCode(_0xea0eb4,_0x3923b3){_0x3923b3=_0x3923b3||0xcc;return function(_0x37a58b){if(_0x37a58b){return _0xea0eb4['sendStatus'](_0x3923b3);}return _0xea0eb4['status'](_0x3923b3)[_0x4255('0x2d')]();};}function respondWithResult(_0x1803ca,_0x469fac){_0x469fac=_0x469fac||0xc8;return function(_0x31c404){if(_0x31c404){return _0x1803ca[_0x4255('0x2e')](_0x469fac)['json'](_0x31c404);}};}function respondWithFilteredResult(_0x2226fa,_0x43856d){return function(_0x4d4c5f){if(_0x4d4c5f){var _0x26ca0=typeof _0x43856d[_0x4255('0x2f')]===_0x4255('0x30')&&typeof _0x43856d[_0x4255('0x31')]==='undefined';var _0x3e97ac=_0x4d4c5f[_0x4255('0x32')];var _0x2e2ef9=_0x26ca0?0x0:_0x43856d[_0x4255('0x2f')];var _0x552006=_0x26ca0?_0x4d4c5f[_0x4255('0x32')]:_0x43856d['offset']+_0x43856d[_0x4255('0x31')];var _0x100d84;if(_0x552006>=_0x3e97ac){_0x552006=_0x3e97ac;_0x100d84=0xc8;}else{_0x100d84=0xce;}_0x2226fa[_0x4255('0x2e')](_0x100d84);return _0x2226fa['set'](_0x4255('0x33'),_0x2e2ef9+'-'+_0x552006+'/'+_0x3e97ac)[_0x4255('0x34')](_0x4d4c5f);}return null;};}function patchUpdates(_0x38fdf9){return function(_0x307a69){try{jsonpatch[_0x4255('0x35')](_0x307a69,_0x38fdf9,!![]);}catch(_0x4edaf9){return BPromise[_0x4255('0x36')](_0x4edaf9);}return _0x307a69[_0x4255('0x37')]();};}function saveUpdates(_0xd6b856,_0x1b5daf){return function(_0x132f6f){if(_0x132f6f){return _0x132f6f[_0x4255('0x38')](_0xd6b856)[_0x4255('0x21')](function(_0x1ba9b6){return _0x1ba9b6;});}return null;};}function removeEntity(_0x50717e,_0x2f764e){return function(_0x4d583a){if(_0x4d583a){return _0x4d583a[_0x4255('0x39')]()[_0x4255('0x21')](function(){_0x50717e[_0x4255('0x2e')](0xcc)[_0x4255('0x2d')]();});}};}function handleEntityNotFound(_0x1be3c8,_0x20b073){return function(_0x10875d){if(!_0x10875d){_0x1be3c8[_0x4255('0x3a')](0x194);}return _0x10875d;};}function handleError(_0x187fca,_0x2b5b6d){_0x2b5b6d=_0x2b5b6d||0x1f4;return function(_0x484a3a){logger[_0x4255('0x28')](_0x484a3a[_0x4255('0x3b')]);if(_0x484a3a[_0x4255('0x3c')]){delete _0x484a3a[_0x4255('0x3c')];}_0x187fca['status'](_0x2b5b6d)[_0x4255('0x3d')](_0x484a3a);};}exports[_0x4255('0x3e')]=function(_0x3c77c8,_0x95961){var _0x14b1bc={},_0x5040c4={},_0x9c85c6={'count':0x0,'rows':[]};var _0xf2297=_[_0x4255('0x3f')](db['ChatMessage'][_0x4255('0x40')],function(_0xcb2109){return{'name':_0xcb2109[_0x4255('0x41')],'type':_0xcb2109['type'][_0x4255('0x42')]};});_0x5040c4['model']=_[_0x4255('0x3f')](_0xf2297,_0x4255('0x3c'));_0x5040c4[_0x4255('0x43')]=_[_0x4255('0x44')](_0x3c77c8['query']);_0x5040c4[_0x4255('0x45')]=_[_0x4255('0x46')](_0x5040c4[_0x4255('0x47')],_0x5040c4[_0x4255('0x43')]);_0x14b1bc[_0x4255('0x48')]=_[_0x4255('0x46')](_0x5040c4[_0x4255('0x47')],qs[_0x4255('0x49')](_0x3c77c8[_0x4255('0x43')][_0x4255('0x49')]));_0x14b1bc[_0x4255('0x48')]=_0x14b1bc['attributes'][_0x4255('0x4a')]?_0x14b1bc[_0x4255('0x48')]:_0x5040c4['model'];if(!_0x3c77c8['query'][_0x4255('0x4b')](_0x4255('0x4c'))){_0x14b1bc[_0x4255('0x31')]=qs['limit'](_0x3c77c8[_0x4255('0x43')][_0x4255('0x31')]);_0x14b1bc[_0x4255('0x2f')]=qs[_0x4255('0x2f')](_0x3c77c8[_0x4255('0x43')][_0x4255('0x2f')]);}_0x14b1bc[_0x4255('0x4d')]=qs[_0x4255('0x4e')](_0x3c77c8['query'][_0x4255('0x4e')]);_0x14b1bc[_0x4255('0x4f')]=qs[_0x4255('0x45')](_[_0x4255('0x50')](_0x3c77c8[_0x4255('0x43')],_0x5040c4[_0x4255('0x45')]),_0xf2297);if(_0x3c77c8[_0x4255('0x43')][_0x4255('0x51')]){_0x14b1bc['where']=_['merge'](_0x14b1bc['where'],{'$or':_['map'](_0xf2297,function(_0x2874a3){if(_0x2874a3[_0x4255('0x52')]!==_0x4255('0x53')){var _0x525082={};_0x525082[_0x2874a3['name']]={'$like':'%'+_0x3c77c8[_0x4255('0x43')][_0x4255('0x51')]+'%'};return _0x525082;}})});}_0x14b1bc=_['merge']({},_0x14b1bc,_0x3c77c8[_0x4255('0x54')]);var _0x1f98c8={'where':_0x14b1bc[_0x4255('0x4f')]};return db[_0x4255('0x55')][_0x4255('0x32')](_0x1f98c8)[_0x4255('0x21')](function(_0x289694){_0x9c85c6[_0x4255('0x32')]=_0x289694;if(_0x3c77c8[_0x4255('0x43')][_0x4255('0x56')]){_0x14b1bc[_0x4255('0x57')]=[{'all':!![]}];}return db[_0x4255('0x55')][_0x4255('0x58')](_0x14b1bc);})['then'](function(_0xe51e51){_0x9c85c6[_0x4255('0x59')]=_0xe51e51;return _0x9c85c6;})[_0x4255('0x21')](respondWithFilteredResult(_0x95961,_0x14b1bc))[_0x4255('0x2c')](handleError(_0x95961,null));};exports[_0x4255('0x5a')]=function(_0x575967,_0x355688){var _0x5b55a4={'raw':!![],'where':{'id':_0x575967[_0x4255('0x5b')]['id']}},_0x158eb4={};_0x158eb4[_0x4255('0x47')]=_[_0x4255('0x44')](db[_0x4255('0x55')][_0x4255('0x40')]);_0x158eb4[_0x4255('0x43')]=_[_0x4255('0x44')](_0x575967[_0x4255('0x43')]);_0x158eb4[_0x4255('0x45')]=_[_0x4255('0x46')](_0x158eb4['model'],_0x158eb4[_0x4255('0x43')]);_0x5b55a4[_0x4255('0x48')]=_['intersection'](_0x158eb4[_0x4255('0x47')],qs[_0x4255('0x49')](_0x575967['query'][_0x4255('0x49')]));_0x5b55a4[_0x4255('0x48')]=_0x5b55a4['attributes'][_0x4255('0x4a')]?_0x5b55a4[_0x4255('0x48')]:_0x158eb4[_0x4255('0x47')];if(_0x575967[_0x4255('0x43')][_0x4255('0x56')]){_0x5b55a4[_0x4255('0x57')]=[{'all':!![]}];}_0x5b55a4=_[_0x4255('0x5c')]({},_0x5b55a4,_0x575967[_0x4255('0x54')]);return db[_0x4255('0x55')][_0x4255('0x5d')](_0x5b55a4)[_0x4255('0x21')](handleEntityNotFound(_0x355688,null))['then'](respondWithResult(_0x355688,null))[_0x4255('0x2c')](handleError(_0x355688,null));};exports['create']=function(_0x320c9b,_0x43f6d3){return db[_0x4255('0x55')][_0x4255('0x5e')](_0x320c9b[_0x4255('0x5f')],{})['then'](respondWithResult(_0x43f6d3,0xc9))[_0x4255('0x2c')](handleError(_0x43f6d3,null));};exports[_0x4255('0x38')]=function(_0x1ca87d,_0xac9f29){if(_0x1ca87d[_0x4255('0x5f')]['id']){delete _0x1ca87d[_0x4255('0x5f')]['id'];}return db[_0x4255('0x55')][_0x4255('0x5d')]({'where':{'id':_0x1ca87d[_0x4255('0x5b')]['id']}})[_0x4255('0x21')](handleEntityNotFound(_0xac9f29,null))[_0x4255('0x21')](saveUpdates(_0x1ca87d[_0x4255('0x5f')],null))[_0x4255('0x21')](respondWithResult(_0xac9f29,null))[_0x4255('0x2c')](handleError(_0xac9f29,null));};exports[_0x4255('0x39')]=function(_0x235885,_0x3d648f){return db['ChatMessage'][_0x4255('0x5d')]({'where':{'id':_0x235885[_0x4255('0x5b')]['id']}})[_0x4255('0x21')](handleEntityNotFound(_0x3d648f,null))[_0x4255('0x21')](removeEntity(_0x3d648f,null))[_0x4255('0x2c')](handleError(_0x3d648f,null));};exports[_0x4255('0x60')]=function(_0x225bdf,_0x503462){return db[_0x4255('0x55')][_0x4255('0x60')]()[_0x4255('0x21')](respondWithResult(_0x503462,null))['catch'](handleError(_0x503462,null));};var interaction_log=require(_0x4255('0x61'))(_0x4255('0x62'));exports['accept']=function(_0x4ddbff,_0x591bd7,_0x536562){var _0x3b977e={'agent':{},'channel':_0x4255('0x63')};if(_0x4ddbff[_0x4255('0x5f')]['id']){delete _0x4ddbff[_0x4255('0x5f')]['id'];}_0x4ddbff[_0x4255('0x5f')][_0x4255('0x64')]=!![];_0x4ddbff[_0x4255('0x5f')][_0x4255('0x65')]=moment()['format'](_0x4255('0x66'));_0x4ddbff[_0x4255('0x5f')]['UserId']=_0x4ddbff[_0x4255('0x5f')][_0x4255('0x67')]||_0x4ddbff[_0x4255('0x68')]['id'];_0x3b977e[_0x4255('0x69')]['id']=_0x4ddbff[_0x4255('0x5f')][_0x4255('0x67')];return db[_0x4255('0x55')]['find']({'where':{'id':_0x4ddbff[_0x4255('0x5b')]['id'],'UserId':null}})[_0x4255('0x21')](handleEntityNotFound(_0x591bd7,null))[_0x4255('0x21')](saveUpdates(_0x4ddbff[_0x4255('0x5f')],null))[_0x4255('0x21')](function(_0x2b85ee){if(_0x2b85ee){_0x3b977e['message']=_0x2b85ee[_0x4255('0x6a')]({'plain':!![]});return db['ChatInteraction'][_0x4255('0x5d')]({'where':{'id':_0x2b85ee[_0x4255('0x6b')]}});}return null;})[_0x4255('0x21')](handleEntityNotFound(_0x591bd7,null))[_0x4255('0x21')](function(_0xbf5820){if(_0xbf5820){return _0xbf5820[_0x4255('0x38')]({'UserId':_0x4ddbff[_0x4255('0x5f')][_0x4255('0x67')],'read1stAt':_[_0x4255('0x6c')](_0xbf5820[_0x4255('0x6d')])?moment()[_0x4255('0x6e')](_0x4255('0x66')):undefined});}return null;})[_0x4255('0x21')](function(_0x4db02e){if(_0x4db02e){_0x3b977e[_0x4255('0x6f')]=_0x4db02e[_0x4255('0x6a')]({'plain':!![]});interaction_log['info'](_0x4255('0x70'),_0x4ddbff['user']['id'],_0x4ddbff['user']['name'],_0x4ddbff[_0x4255('0x68')][_0x4255('0x71')],_0x3b977e[_0x4255('0x6f')]['id'],_0x4ddbff[_0x4255('0x5f')]?JSON['stringify'](_0x4ddbff['body']):_0x4255('0x72'));return respondWithRpcPromise(_0x4255('0x73'),_0x4255('0x74'),_0x3b977e);}return null;})[_0x4255('0x21')](function(_0x5ec987){var _0x2bb793=_0x4255('0x75')+_0x5ec987[_0x4255('0x2a')][_0x4255('0x76')];return db[_0x4255('0x77')][_0x4255('0x43')](_0x2bb793,{'type':db['Sequelize'][_0x4255('0x78')][_0x4255('0x79')],'raw':!![]})[_0x4255('0x21')](function(_0x5dbefd){return _0x5dbefd;});})['then'](function(_0xdbab0d){if(_0xdbab0d){_0x3b977e['message']['contact']=_0xdbab0d[0x0];if(!_0x4ddbff[_0x4255('0x5f')][_0x4255('0x67')])return;return db[_0x4255('0x7a')]['find']({'where':{'id':_0x4ddbff[_0x4255('0x5f')][_0x4255('0x67')],'role':_0x4255('0x69')},'attributes':['id',_0x4255('0x3c'),_0x4255('0x7b'),_0x4255('0x7c'),_0x4255('0x7d')],'raw':!![]});}return null;})[_0x4255('0x21')](function(_0x49ae91){if(!_0x49ae91)return null;_0x3b977e[_0x4255('0x2a')][_0x4255('0x69')]=_0x49ae91;return _0x3b977e;})[_0x4255('0x21')](function(_0x192380){if(_0x192380){if(_0x4ddbff[_0x4255('0x5f')]['manual']){_0x3b977e[_0x4255('0x2a')][_0x4255('0x7e')]=util[_0x4255('0x6e')]('SIP/%s',_0x4ddbff[_0x4255('0x68')][_0x4255('0x3c')]);_0x3b977e[_0x4255('0x2a')][_0x4255('0x7f')]=_0x3b977e[_0x4255('0x7f')];_0x3b977e['message']['motionChannel']=_0x3b977e[_0x4255('0x7f')];_0x3b977e[_0x4255('0x2a')][_0x4255('0x80')]=_0x4255('0x81');return respondWithRpcPromise(_0x4255('0x82'),_0x4255('0x82'),{'event':_0x4255('0x83'),'message':_[_0x4255('0x5c')](_0x3b977e[_0x4255('0x2a')],JSON[_0x4255('0x84')](_0x3b977e[_0x4255('0x6f')][_0x4255('0x85')]))},client9002)['then'](function(){return _0x3b977e;});}return _0x3b977e;}return null;})[_0x4255('0x21')](respondWithResult(_0x591bd7,null))[_0x4255('0x2c')](handleError(_0x591bd7,null));};var interaction_log=require('../../config/logger')(_0x4255('0x62'));exports[_0x4255('0x36')]=function(_0x5681a6,_0x4370eb,_0x4bad6a){var _0x460863={'agent':{},'channel':_0x4255('0x63')};if(_0x5681a6[_0x4255('0x5f')]['id']){delete _0x5681a6[_0x4255('0x5f')]['id'];}_0x5681a6['body'][_0x4255('0x67')]=_0x5681a6[_0x4255('0x5f')][_0x4255('0x67')]||_0x5681a6['user']['id'];_0x460863[_0x4255('0x69')]['id']=_0x5681a6[_0x4255('0x5f')][_0x4255('0x67')];return db[_0x4255('0x55')][_0x4255('0x5d')]({'where':{'id':_0x5681a6[_0x4255('0x5b')]['id'],'UserId':null}})[_0x4255('0x21')](handleEntityNotFound(_0x4370eb,null))[_0x4255('0x21')](function(_0x443d09){if(_0x443d09){_0x460863[_0x4255('0x2a')]=_0x443d09['get']({'plain':!![]});return db[_0x4255('0x86')][_0x4255('0x5d')]({'where':{'id':_0x443d09[_0x4255('0x6b')]}});}return null;})[_0x4255('0x21')](handleEntityNotFound(_0x4370eb,null))[_0x4255('0x21')](function(_0x357fc7){if(_0x357fc7){_0x460863[_0x4255('0x6f')]=_0x357fc7[_0x4255('0x6a')]({'plain':!![]});interaction_log[_0x4255('0x22')](_0x4255('0x87'),_0x5681a6['user']['id'],_0x5681a6[_0x4255('0x68')]['name'],_0x5681a6['user'][_0x4255('0x71')],_0x460863[_0x4255('0x6f')]['id'],_0x5681a6[_0x4255('0x5f')]?JSON[_0x4255('0x27')](_0x5681a6[_0x4255('0x5f')]):'null');return respondWithRpcPromise(_0x4255('0x88'),_0x4255('0x89'),_0x460863);}return null;})['then'](function(_0x30378d){var _0x3a82b1=_0x4255('0x75')+_0x30378d[_0x4255('0x2a')][_0x4255('0x76')];return db[_0x4255('0x77')][_0x4255('0x43')](_0x3a82b1,{'type':db[_0x4255('0x8a')][_0x4255('0x78')][_0x4255('0x79')],'raw':!![]})[_0x4255('0x21')](function(_0x4dd687){return _0x4dd687;});})['then'](function(_0x9d7729){if(_0x9d7729){_0x460863['message']['contact']=_0x9d7729[0x0];if(!_0x5681a6[_0x4255('0x5f')][_0x4255('0x67')])return;return db['User'][_0x4255('0x5d')]({'where':{'id':_0x5681a6[_0x4255('0x5f')][_0x4255('0x67')],'role':'agent'},'attributes':['id',_0x4255('0x3c'),_0x4255('0x7b'),_0x4255('0x7c'),_0x4255('0x7d')],'raw':!![]});}return null;})[_0x4255('0x21')](function(_0x5130eb){if(!_0x5130eb)return null;_0x460863[_0x4255('0x2a')][_0x4255('0x69')]=_0x5130eb;return _0x460863;})[_0x4255('0x21')](function(_0xac80e5){if(_0xac80e5){_0xac80e5[_0x4255('0x2a')][_0x4255('0x7e')]=util[_0x4255('0x6e')](_0x4255('0x8b'),_0x5681a6[_0x4255('0x68')][_0x4255('0x3c')]);_0xac80e5[_0x4255('0x2a')][_0x4255('0x7f')]=_0x460863['channel'];_0xac80e5[_0x4255('0x2a')][_0x4255('0x8c')]=_0x460863[_0x4255('0x7f')];_0xac80e5[_0x4255('0x2a')][_0x4255('0x80')]=_0x4255('0x36');respondWithRpcPromise('EventManager',_0x4255('0x82'),{'event':_0x4255('0x8d'),'message':_[_0x4255('0x5c')](_0x460863[_0x4255('0x2a')],JSON['parse'](_0x460863['interaction'][_0x4255('0x85')]))},client9002);return _0x460863;}return null;})[_0x4255('0x21')](respondWithResult(_0x4370eb,null))[_0x4255('0x2c')](handleError(_0x4370eb,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 3768798..396b026 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 _0x1541=['hook','exports','../../mysqldb','ChatMessage','save','emit','hasOwnProperty'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0x1541,0xf7));var _0x1154=function(_0x4dab14,_0x164ea0){_0x4dab14=_0x4dab14-0x0;var _0xf41aa=_0x1541[_0x4dab14];return _0xf41aa;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x1154('0x0'))['db'][_0x1154('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1154('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1a1d44){return function(_0x3ac275,_0xf9c644,_0x4bc6fc){ChatMessageEvents[_0x1154('0x3')](_0x1a1d44+':'+_0x3ac275['id'],_0x3ac275);ChatMessageEvents['emit'](_0x1a1d44,_0x3ac275);_0x4bc6fc(null);};}for(var e in events){if(events[_0x1154('0x4')](e)){var event=events[e];ChatMessage[_0x1154('0x5')](e,emitEvent(event));}}module[_0x1154('0x6')]=ChatMessageEvents; \ No newline at end of file +var _0x1d92=['../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x1d92,0x14d));var _0x21d9=function(_0x3feec6,_0x4db012){_0x3feec6=_0x3feec6-0x0;var _0x56d5e2=_0x1d92[_0x3feec6];return _0x56d5e2;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x21d9('0x0'))['db'][_0x21d9('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x21d9('0x2')](0x0);var events={'afterCreate':_0x21d9('0x3'),'afterUpdate':_0x21d9('0x4'),'afterDestroy':_0x21d9('0x5')};function emitEvent(_0x1ce534){return function(_0x40b132,_0x113a6e,_0xf2db7b){ChatMessageEvents[_0x21d9('0x6')](_0x1ce534+':'+_0x40b132['id'],_0x40b132);ChatMessageEvents[_0x21d9('0x6')](_0x1ce534,_0x40b132);_0xf2db7b(null);};}for(var e in events){if(events[_0x21d9('0x7')](e)){var event=events[e];ChatMessage[_0x21d9('0x8')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 6310d5e..cf6e6ea 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 _0x0095=['createdAt','catch','error','utf8mb4_unicode_ci','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','then'];(function(_0x1ff7ef,_0xfeb3fa){var _0x15ad57=function(_0x1c3b58){while(--_0x1c3b58){_0x1ff7ef['push'](_0x1ff7ef['shift']());}};_0x15ad57(++_0xfeb3fa);}(_0x0095,0x170));var _0x5009=function(_0xef8699,_0x4c486c){_0xef8699=_0xef8699-0x0;var _0x10fed3=_0x0095[_0xef8699];return _0x10fed3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5009('0x0'))('api');var moment=require('moment');var BPromise=require(_0x5009('0x1'));var rp=require(_0x5009('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5009('0x3'));var config=require(_0x5009('0x4'));var attributes=require(_0x5009('0x5'));module[_0x5009('0x6')]=function(_0x44abf0,_0x39a303){return _0x44abf0['define'](_0x5009('0x7'),attributes,{'tableName':_0x5009('0x8'),'paranoid':![],'indexes':[{'name':_0x5009('0x9'),'fields':[_0x5009('0xa')],'type':_0x5009('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x29fa61,_0xd5d777,_0x34ead7){var _0x220179=_0x44abf0[_0x5009('0xc')];var _0x48332b=_0x29fa61[_0x5009('0xd')]({'plain':!![]});if(_0x48332b[_0x5009('0xe')]['toLowerCase']()==='in'||_0x48332b[_0x5009('0xe')][_0x5009('0xf')]()===_0x5009('0x10')&&!_0x48332b[_0x5009('0x11')]&&!_['isNil'](_0x48332b[_0x5009('0x12')])){_0x220179[_0x5009('0x13')][_0x5009('0x14')]({'where':{'id':_0x48332b['ChatInteractionId']}})[_0x5009('0x15')](function(_0x32bd9c){if(_0x32bd9c){_0x32bd9c['update']({'lastMsgAt':_0x48332b[_0x5009('0x16')],'lastMsgDirection':_0x48332b[_0x5009('0xe')][_0x5009('0xf')]()});}})[_0x5009('0x17')](function(_0x598e42){console[_0x5009('0x18')](_0x598e42);});}_0x34ead7();}},'charset':'utf8mb4','collate':_0x5009('0x19')});}; \ No newline at end of file +var _0xddae=['request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x1387b1,_0x58398a){var _0x4442d9=function(_0x23ddf6){while(--_0x23ddf6){_0x1387b1['push'](_0x1387b1['shift']());}};_0x4442d9(++_0x58398a);}(_0xddae,0x1dc));var _0xedda=function(_0x38de15,_0x1c0125){_0x38de15=_0x38de15-0x0;var _0x4db04b=_0xddae[_0x38de15];return _0x4db04b;};'use strict';var _=require(_0xedda('0x0'));var util=require(_0xedda('0x1'));var logger=require(_0xedda('0x2'))(_0xedda('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xedda('0x4'));var fs=require('fs');var path=require(_0xedda('0x5'));var rimraf=require(_0xedda('0x6'));var config=require(_0xedda('0x7'));var attributes=require(_0xedda('0x8'));module[_0xedda('0x9')]=function(_0x464f7a,_0x4e817f){return _0x464f7a[_0xedda('0xa')](_0xedda('0xb'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xedda('0xc'),'fields':[_0xedda('0xd')],'type':_0xedda('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x505eec,_0x18fd65,_0xa98ba4){var _0x3f384e=_0x464f7a[_0xedda('0xf')];var _0x39c273=_0x505eec[_0xedda('0x10')]({'plain':!![]});if(_0x39c273[_0xedda('0x11')]['toLowerCase']()==='in'||_0x39c273[_0xedda('0x11')][_0xedda('0x12')]()===_0xedda('0x13')&&!_0x39c273[_0xedda('0x14')]&&!_[_0xedda('0x15')](_0x39c273[_0xedda('0x16')])){_0x3f384e[_0xedda('0x17')][_0xedda('0x18')]({'where':{'id':_0x39c273[_0xedda('0x19')]}})[_0xedda('0x1a')](function(_0x1b9ea1){if(_0x1b9ea1){_0x1b9ea1['update']({'lastMsgAt':_0x39c273[_0xedda('0x1b')],'lastMsgDirection':_0x39c273['direction']['toLowerCase']()});}})[_0xedda('0x1c')](function(_0x4fdf48){console['error'](_0x4fdf48);});}_0xa98ba4();}},'charset':_0xedda('0x1d'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index b807ea5..cc72ba9 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 _0x963e=['request\x20sent','debug','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','request','info','ChatMessage,\x20%s,\x20%s'];(function(_0x91cc04,_0x48e6a6){var _0x26b085=function(_0x2720bf){while(--_0x2720bf){_0x91cc04['push'](_0x91cc04['shift']());}};_0x26b085(++_0x48e6a6);}(_0x963e,0x1e0));var _0xe963=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x963e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xe963('0x0'));var moment=require(_0xe963('0x1'));var BPromise=require(_0xe963('0x2'));var rs=require(_0xe963('0x3'));var fs=require('fs');var Redis=require(_0xe963('0x4'));var db=require(_0xe963('0x5'))['db'];var utils=require(_0xe963('0x6'));var logger=require(_0xe963('0x7'))(_0xe963('0x8'));var config=require('../../config/environment');var jayson=require(_0xe963('0x9'));var client=jayson['client'][_0xe963('0xa')]({'port':0x232a});config[_0xe963('0xb')]=_[_0xe963('0xc')](config[_0xe963('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe963('0xb')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x4ec9cc,_0x109e51,_0x40f7c5){return new BPromise(function(_0x5a4470,_0x55b97d){return client[_0xe963('0xd')](_0x4ec9cc,_0x40f7c5)['then'](function(_0x2a2a0a){logger[_0xe963('0xe')](_0xe963('0xf'),_0x109e51,_0xe963('0x10'));logger[_0xe963('0x11')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x109e51,'request\x20sent',JSON[_0xe963('0x12')](_0x2a2a0a));if(_0x2a2a0a['error']){if(_0x2a2a0a[_0xe963('0x13')][_0xe963('0x14')]===0x1f4){logger[_0xe963('0x13')](_0xe963('0xf'),_0x109e51,_0x2a2a0a[_0xe963('0x13')][_0xe963('0x15')]);return _0x55b97d(_0x2a2a0a[_0xe963('0x13')][_0xe963('0x15')]);}logger[_0xe963('0x13')](_0xe963('0xf'),_0x109e51,_0x2a2a0a['error'][_0xe963('0x15')]);return _0x5a4470(_0x2a2a0a[_0xe963('0x13')][_0xe963('0x15')]);}else{logger[_0xe963('0xe')](_0xe963('0xf'),_0x109e51,_0xe963('0x10'));_0x5a4470(_0x2a2a0a[_0xe963('0x16')]['message']);}})[_0xe963('0x17')](function(_0xc27a68){logger[_0xe963('0x13')](_0xe963('0xf'),_0x109e51,_0xc27a68);_0x55b97d(_0xc27a68);});});}exports[_0xe963('0x18')]=function(_0x5242ad){var _0x25d784=this;return new Promise(function(_0x1df9ad,_0x2ca51a){return db[_0xe963('0x19')][_0xe963('0x1a')](_0x5242ad[_0xe963('0x1b')],{'raw':_0x5242ad[_0xe963('0x1c')]?_0x5242ad[_0xe963('0x1c')][_0xe963('0x1d')]===undefined?!![]:![]:!![]})[_0xe963('0x1e')](function(_0xa97cad){logger[_0xe963('0xe')](_0xe963('0x18'),_0x5242ad);logger['debug'](_0xe963('0x18'),_0x5242ad,JSON[_0xe963('0x12')](_0xa97cad));_0x1df9ad(_0xa97cad);})['catch'](function(_0x15a52c){logger[_0xe963('0x13')](_0xe963('0x18'),_0x15a52c[_0xe963('0x15')],_0x5242ad);_0x2ca51a(_0x25d784['error'](0x1f4,_0x15a52c[_0xe963('0x15')]));});});}; \ No newline at end of file +var _0xbd42=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','request\x20sent','debug','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','ChatMessage','body','options','CreateChatMessage','util','moment','bluebird','ioredis'];(function(_0x467abe,_0x327e4e){var _0x53a5fd=function(_0x305fff){while(--_0x305fff){_0x467abe['push'](_0x467abe['shift']());}};_0x53a5fd(++_0x327e4e);}(_0xbd42,0xaa));var _0x2bd4=function(_0x43d952,_0x453ec9){_0x43d952=_0x43d952-0x0;var _0x1c53b5=_0xbd42[_0x43d952];return _0x1c53b5;};'use strict';var _=require('lodash');var util=require(_0x2bd4('0x0'));var moment=require(_0x2bd4('0x1'));var BPromise=require(_0x2bd4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2bd4('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2bd4('0x4'));var jayson=require(_0x2bd4('0x5'));var client=jayson[_0x2bd4('0x6')][_0x2bd4('0x7')]({'port':0x232a});config[_0x2bd4('0x8')]=_[_0x2bd4('0x9')](config[_0x2bd4('0x8')],{'host':_0x2bd4('0xa'),'port':0x18eb});var socket=require(_0x2bd4('0xb'))(new Redis(config[_0x2bd4('0x8')]));require(_0x2bd4('0xc'))[_0x2bd4('0xd')](socket);function respondWithRpcPromise(_0x5c0d6c,_0x47f4bc,_0x3fe302){return new BPromise(function(_0x17e02e,_0x558e6c){return client[_0x2bd4('0xe')](_0x5c0d6c,_0x3fe302)[_0x2bd4('0xf')](function(_0xe909fd){logger[_0x2bd4('0x10')]('ChatMessage,\x20%s,\x20%s',_0x47f4bc,_0x2bd4('0x11'));logger[_0x2bd4('0x12')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x47f4bc,_0x2bd4('0x11'),JSON['stringify'](_0xe909fd));if(_0xe909fd[_0x2bd4('0x13')]){if(_0xe909fd['error'][_0x2bd4('0x14')]===0x1f4){logger[_0x2bd4('0x13')](_0x2bd4('0x15'),_0x47f4bc,_0xe909fd[_0x2bd4('0x13')][_0x2bd4('0x16')]);return _0x558e6c(_0xe909fd[_0x2bd4('0x13')][_0x2bd4('0x16')]);}logger[_0x2bd4('0x13')](_0x2bd4('0x15'),_0x47f4bc,_0xe909fd[_0x2bd4('0x13')][_0x2bd4('0x16')]);return _0x17e02e(_0xe909fd[_0x2bd4('0x13')][_0x2bd4('0x16')]);}else{logger[_0x2bd4('0x10')](_0x2bd4('0x15'),_0x47f4bc,'request\x20sent');_0x17e02e(_0xe909fd[_0x2bd4('0x17')][_0x2bd4('0x16')]);}})[_0x2bd4('0x18')](function(_0x9a7e12){logger['error'](_0x2bd4('0x15'),_0x47f4bc,_0x9a7e12);_0x558e6c(_0x9a7e12);});});}exports['CreateChatMessage']=function(_0x476146){var _0x1d0764=this;return new Promise(function(_0xf5d265,_0x57c0f7){return db[_0x2bd4('0x19')]['create'](_0x476146[_0x2bd4('0x1a')],{'raw':_0x476146[_0x2bd4('0x1b')]?_0x476146['options']['raw']===undefined?!![]:![]:!![]})[_0x2bd4('0xf')](function(_0x2919ea){logger[_0x2bd4('0x10')](_0x2bd4('0x1c'),_0x476146);logger['debug']('CreateChatMessage',_0x476146,JSON['stringify'](_0x2919ea));_0xf5d265(_0x2919ea);})[_0x2bd4('0x18')](function(_0x4d4b27){logger[_0x2bd4('0x13')](_0x2bd4('0x1c'),_0x4d4b27[_0x2bd4('0x16')],_0x476146);_0x57c0f7(_0x1d0764[_0x2bd4('0x13')](0x1f4,_0x4d4b27[_0x2bd4('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 947200f..036995f 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 _0x28e3=['remove','update','emit','removeListener','register','chatMessage:','./chatMessage.events','save'];(function(_0xece574,_0x51fbb5){var _0x4b38cd=function(_0x275183){while(--_0x275183){_0xece574['push'](_0xece574['shift']());}};_0x4b38cd(++_0x51fbb5);}(_0x28e3,0x106));var _0x328e=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x28e3[_0xc0a3d3];return _0x3386e8;};'use strict';var ChatMessageEvents=require(_0x328e('0x0'));var events=[_0x328e('0x1'),_0x328e('0x2'),_0x328e('0x3')];function createListener(_0x499442,_0x5f1520){return function(_0x392b85){_0x5f1520[_0x328e('0x4')](_0x499442,_0x392b85);};}function removeListener(_0x168893,_0x8cdc14){return function(){ChatMessageEvents[_0x328e('0x5')](_0x168893,_0x8cdc14);};}exports[_0x328e('0x6')]=function(_0x439182){for(var _0x5e5bcf=0x0,_0x4b5c91=events['length'];_0x5e5bcf<_0x4b5c91;_0x5e5bcf++){var _0x2bddaa=events[_0x5e5bcf];var _0x3696b6=createListener(_0x328e('0x7')+_0x2bddaa,_0x439182);ChatMessageEvents['on'](_0x2bddaa,_0x3696b6);}}; \ No newline at end of file +var _0xb458=['length','./chatMessage.events','save','remove','emit','removeListener'];(function(_0x76472f,_0x57bba3){var _0x34225c=function(_0x52fe66){while(--_0x52fe66){_0x76472f['push'](_0x76472f['shift']());}};_0x34225c(++_0x57bba3);}(_0xb458,0x103));var _0x8b45=function(_0x4fe328,_0x5e456d){_0x4fe328=_0x4fe328-0x0;var _0x11a53b=_0xb458[_0x4fe328];return _0x11a53b;};'use strict';var ChatMessageEvents=require(_0x8b45('0x0'));var events=[_0x8b45('0x1'),_0x8b45('0x2'),'update'];function createListener(_0x58a508,_0xdf89d4){return function(_0x93d9cd){_0xdf89d4[_0x8b45('0x3')](_0x58a508,_0x93d9cd);};}function removeListener(_0x13a8c6,_0x5d51e4){return function(){ChatMessageEvents[_0x8b45('0x4')](_0x13a8c6,_0x5d51e4);};}exports['register']=function(_0x5cc2d5){for(var _0xe8d774=0x0,_0x12bd05=events[_0x8b45('0x5')];_0xe8d774<_0x12bd05;_0xe8d774++){var _0x3a8ccb=events[_0xe8d774];var _0x32342f=createListener('chatMessage:'+_0x3a8ccb,_0x5cc2d5);ChatMessageEvents['on'](_0x3a8ccb,_0x32342f);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index a1d1fe4..770fd96 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 _0x8293=['/describe','describe','/:id','show','post','tracked','chat','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated'];(function(_0x813cc2,_0x2ef8c2){var _0x5a0552=function(_0x2de57d){while(--_0x2de57d){_0x813cc2['push'](_0x813cc2['shift']());}};_0x5a0552(++_0x2ef8c2);}(_0x8293,0x114));var _0x3829=function(_0x24022c,_0x10f0a8){_0x24022c=_0x24022c-0x0;var _0x275016=_0x8293[_0x24022c];return _0x275016;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3829('0x0'));var timeout=require(_0x3829('0x1'));var express=require(_0x3829('0x2'));var router=express[_0x3829('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3829('0x4'));var interaction=require(_0x3829('0x5'));var config=require(_0x3829('0x6'));var controller=require(_0x3829('0x7'));router[_0x3829('0x8')]('/',auth[_0x3829('0x9')](),controller['index']);router[_0x3829('0x8')](_0x3829('0xa'),auth['isAuthenticated'](),controller[_0x3829('0xb')]);router[_0x3829('0x8')](_0x3829('0xc'),auth['isAuthenticated'](),controller[_0x3829('0xd')]);router[_0x3829('0xe')]('/',auth[_0x3829('0x9')](),interaction[_0x3829('0xf')](_0x3829('0x10'),'chatmessage:create'),controller[_0x3829('0x11')]);router[_0x3829('0x12')](_0x3829('0xc'),controller[_0x3829('0x13')]);router['put'](_0x3829('0x14'),auth['isAuthenticated'](),controller['accept']);router[_0x3829('0x12')](_0x3829('0x15'),auth['isAuthenticated'](),controller[_0x3829('0x16')]);router[_0x3829('0x17')](_0x3829('0xc'),auth[_0x3829('0x9')](),controller[_0x3829('0x18')]);module[_0x3829('0x19')]=router; \ No newline at end of file +var _0x86ae=['reject','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x86ae,0x1e3));var _0xe86a=function(_0x125c55,_0x45e0ae){_0x125c55=_0x125c55-0x0;var _0x1134f5=_0x86ae[_0x125c55];return _0x1134f5;};'use strict';var multer=require(_0xe86a('0x0'));var util=require(_0xe86a('0x1'));var path=require(_0xe86a('0x2'));var timeout=require(_0xe86a('0x3'));var express=require(_0xe86a('0x4'));var router=express['Router']();var fs_extra=require(_0xe86a('0x5'));var auth=require(_0xe86a('0x6'));var interaction=require(_0xe86a('0x7'));var config=require(_0xe86a('0x8'));var controller=require(_0xe86a('0x9'));router[_0xe86a('0xa')]('/',auth['isAuthenticated'](),controller[_0xe86a('0xb')]);router[_0xe86a('0xa')](_0xe86a('0xc'),auth[_0xe86a('0xd')](),controller[_0xe86a('0xe')]);router[_0xe86a('0xa')](_0xe86a('0xf'),auth[_0xe86a('0xd')](),controller[_0xe86a('0x10')]);router[_0xe86a('0x11')]('/',auth['isAuthenticated'](),interaction[_0xe86a('0x12')](_0xe86a('0x13'),_0xe86a('0x14')),controller[_0xe86a('0x15')]);router[_0xe86a('0x16')](_0xe86a('0xf'),controller[_0xe86a('0x17')]);router[_0xe86a('0x16')](_0xe86a('0x18'),auth[_0xe86a('0xd')](),controller[_0xe86a('0x19')]);router['put'](_0xe86a('0x1a'),auth[_0xe86a('0xd')](),controller[_0xe86a('0x1b')]);router[_0xe86a('0x1c')](_0xe86a('0xf'),auth[_0xe86a('0xd')](),controller['destroy']);module[_0xe86a('0x1d')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 5f15cc8..6049e63 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 _0x9bec=['TEXT','medium','sequelize','exports'];(function(_0x581d39,_0x1ce50f){var _0x152048=function(_0x55e8aa){while(--_0x55e8aa){_0x581d39['push'](_0x581d39['shift']());}};_0x152048(++_0x1ce50f);}(_0x9bec,0x162));var _0xc9be=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x9bec[_0x413feb];return _0x40ee88;};'use strict';var Sequelize=require(_0xc9be('0x0'));module[_0xc9be('0x1')]={'body':{'type':Sequelize[_0xc9be('0x2')](_0xc9be('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0x8602=['medium','sequelize','exports','TEXT'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x8602,0x1dd));var _0x2860=function(_0x59eefb,_0x2151ce){_0x59eefb=_0x59eefb-0x0;var _0x1a49e8=_0x8602[_0x59eefb];return _0x1a49e8;};'use strict';var Sequelize=require(_0x2860('0x0'));module[_0x2860('0x1')]={'body':{'type':Sequelize[_0x2860('0x2')](_0x2860('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 173377f..9b42976 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x7a54,0x106));var _0x47a5=function(_0x99d7b,_0x1753f9){_0x99d7b=_0x99d7b-0x0;var _0x14087d=_0x7a54[_0x99d7b];return _0x14087d;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _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(_0x544e0a,_0x304b66){var _0x520a4a=function(_0x419dcf){while(--_0x419dcf){_0x544e0a['push'](_0x544e0a['shift']());}};_0x520a4a(++_0x304b66);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 38d199d..f1d5dee 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 _0xd110=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','ChatOfflineMessage','chat_offline_messages','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x238955,_0x342d1b){var _0x354d58=function(_0x391f85){while(--_0x391f85){_0x238955['push'](_0x238955['shift']());}};_0x354d58(++_0x342d1b);}(_0xd110,0x128));var _0x0d11=function(_0x329657,_0x598770){_0x329657=_0x329657-0x0;var _0x6a61b6=_0xd110[_0x329657];return _0x6a61b6;};'use strict';var _=require(_0x0d11('0x0'));var util=require(_0x0d11('0x1'));var logger=require(_0x0d11('0x2'))(_0x0d11('0x3'));var moment=require(_0x0d11('0x4'));var BPromise=require(_0x0d11('0x5'));var rp=require(_0x0d11('0x6'));var fs=require('fs');var path=require(_0x0d11('0x7'));var rimraf=require(_0x0d11('0x8'));var config=require(_0x0d11('0x9'));var attributes=require(_0x0d11('0xa'));module[_0x0d11('0xb')]=function(_0x180afd,_0x11fe81){return _0x180afd['define'](_0x0d11('0xc'),attributes,{'tableName':_0x0d11('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0d11('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x45b5=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x2020f7,_0x159d8a){var _0x18c465=function(_0x3b6d20){while(--_0x3b6d20){_0x2020f7['push'](_0x2020f7['shift']());}};_0x18c465(++_0x159d8a);}(_0x45b5,0x159));var _0x545b=function(_0x524d19,_0x57aec2){_0x524d19=_0x524d19-0x0;var _0x56b17f=_0x45b5[_0x524d19];return _0x56b17f;};'use strict';var _=require(_0x545b('0x0'));var util=require(_0x545b('0x1'));var logger=require(_0x545b('0x2'))(_0x545b('0x3'));var moment=require('moment');var BPromise=require(_0x545b('0x4'));var rp=require(_0x545b('0x5'));var fs=require('fs');var path=require(_0x545b('0x6'));var rimraf=require(_0x545b('0x7'));var config=require(_0x545b('0x8'));var attributes=require('./chatOfflineMessage.attributes');module[_0x545b('0x9')]=function(_0x5d3ef0,_0x3532e0){return _0x5d3ef0[_0x545b('0xa')](_0x545b('0xb'),attributes,{'tableName':_0x545b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x545b('0xd'),'collate':_0x545b('0xe')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 3f56fd5..9132dcf 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 _0xb3db=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xbd34a4,_0x2be90f){var _0x26b933=function(_0x2d7978){while(--_0x2d7978){_0xbd34a4['push'](_0xbd34a4['shift']());}};_0x26b933(++_0x2be90f);}(_0xb3db,0x159));var _0xbb3d=function(_0x10c51f,_0x11270f){_0x10c51f=_0x10c51f-0x0;var _0x56a0cd=_0xb3db[_0x10c51f];return _0x56a0cd;};'use strict';var _=require('lodash');var util=require(_0xbb3d('0x0'));var moment=require(_0xbb3d('0x1'));var BPromise=require(_0xbb3d('0x2'));var rs=require(_0xbb3d('0x3'));var fs=require('fs');var Redis=require(_0xbb3d('0x4'));var db=require(_0xbb3d('0x5'))['db'];var utils=require(_0xbb3d('0x6'));var logger=require('../../config/logger')(_0xbb3d('0x7'));var config=require(_0xbb3d('0x8'));var jayson=require(_0xbb3d('0x9'));var client=jayson[_0xbb3d('0xa')][_0xbb3d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f4758,_0x23a9ee,_0x42ee65){return new BPromise(function(_0x13e399,_0x1211ce){return client[_0xbb3d('0xc')](_0x3f4758,_0x42ee65)[_0xbb3d('0xd')](function(_0x54221b){logger[_0xbb3d('0xe')](_0xbb3d('0xf'),_0x23a9ee,'request\x20sent');logger['debug'](_0xbb3d('0x10'),_0x23a9ee,'request\x20sent',JSON[_0xbb3d('0x11')](_0x54221b));if(_0x54221b[_0xbb3d('0x12')]){if(_0x54221b['error']['code']===0x1f4){logger[_0xbb3d('0x12')](_0xbb3d('0xf'),_0x23a9ee,_0x54221b[_0xbb3d('0x12')][_0xbb3d('0x13')]);return _0x1211ce(_0x54221b[_0xbb3d('0x12')][_0xbb3d('0x13')]);}logger[_0xbb3d('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x23a9ee,_0x54221b[_0xbb3d('0x12')][_0xbb3d('0x13')]);return _0x13e399(_0x54221b['error']['message']);}else{logger[_0xbb3d('0xe')](_0xbb3d('0xf'),_0x23a9ee,_0xbb3d('0x14'));_0x13e399(_0x54221b[_0xbb3d('0x15')][_0xbb3d('0x13')]);}})['catch'](function(_0x346908){logger[_0xbb3d('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x23a9ee,_0x346908);_0x1211ce(_0x346908);});});} \ No newline at end of file +var _0x3893=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird','randomstring'];(function(_0x502c83,_0x1db15d){var _0x40dd62=function(_0x405dfa){while(--_0x405dfa){_0x502c83['push'](_0x502c83['shift']());}};_0x40dd62(++_0x1db15d);}(_0x3893,0x1a1));var _0x3389=function(_0x4d3a9b,_0x20b47d){_0x4d3a9b=_0x4d3a9b-0x0;var _0x1b5471=_0x3893[_0x4d3a9b];return _0x1b5471;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3389('0x0'));var BPromise=require(_0x3389('0x1'));var rs=require(_0x3389('0x2'));var fs=require('fs');var Redis=require(_0x3389('0x3'));var db=require(_0x3389('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3389('0x5'));var config=require(_0x3389('0x6'));var jayson=require(_0x3389('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x459ba0,_0x34ec6b,_0x34a221){return new BPromise(function(_0x51e1d8,_0x1ffafa){return client[_0x3389('0x8')](_0x459ba0,_0x34a221)[_0x3389('0x9')](function(_0x5a7bac){logger[_0x3389('0xa')](_0x3389('0xb'),_0x34ec6b,_0x3389('0xc'));logger[_0x3389('0xd')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x34ec6b,_0x3389('0xc'),JSON[_0x3389('0xe')](_0x5a7bac));if(_0x5a7bac[_0x3389('0xf')]){if(_0x5a7bac[_0x3389('0xf')][_0x3389('0x10')]===0x1f4){logger[_0x3389('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x34ec6b,_0x5a7bac[_0x3389('0xf')][_0x3389('0x11')]);return _0x1ffafa(_0x5a7bac[_0x3389('0xf')][_0x3389('0x11')]);}logger[_0x3389('0xf')](_0x3389('0xb'),_0x34ec6b,_0x5a7bac[_0x3389('0xf')][_0x3389('0x11')]);return _0x51e1d8(_0x5a7bac[_0x3389('0xf')][_0x3389('0x11')]);}else{logger['info'](_0x3389('0xb'),_0x34ec6b,'request\x20sent');_0x51e1d8(_0x5a7bac[_0x3389('0x12')][_0x3389('0x11')]);}})[_0x3389('0x13')](function(_0x1b0a70){logger[_0x3389('0xf')](_0x3389('0xb'),_0x34ec6b,_0x1b0a70);_0x1ffafa(_0x1b0a70);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 0257b11..9a84714 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 _0x45f6=['destroy','exports','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x280923,_0x26c0b6){var _0x461e4a=function(_0x49c978){while(--_0x49c978){_0x280923['push'](_0x280923['shift']());}};_0x461e4a(++_0x26c0b6);}(_0x45f6,0x1b2));var _0x645f=function(_0x5cdacf,_0x7c82b1){_0x5cdacf=_0x5cdacf-0x0;var _0xa68a8b=_0x45f6[_0x5cdacf];return _0xa68a8b;};'use strict';var multer=require('multer');var util=require(_0x645f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x645f('0x1'));var router=express['Router']();var fs_extra=require(_0x645f('0x2'));var auth=require(_0x645f('0x3'));var interaction=require(_0x645f('0x4'));var config=require(_0x645f('0x5'));var controller=require(_0x645f('0x6'));router[_0x645f('0x7')]('/',auth[_0x645f('0x8')](),controller[_0x645f('0x9')]);router[_0x645f('0x7')]('/describe',auth[_0x645f('0x8')](),controller['describe']);router['get']('/:id',auth[_0x645f('0x8')](),controller[_0x645f('0xa')]);router[_0x645f('0xb')]('/',auth[_0x645f('0x8')](),controller[_0x645f('0xc')]);router[_0x645f('0xd')](_0x645f('0xe'),auth[_0x645f('0x8')](),controller[_0x645f('0xf')]);router['delete'](_0x645f('0xe'),auth[_0x645f('0x8')](),controller[_0x645f('0x10')]);module[_0x645f('0x11')]=router; \ No newline at end of file +var _0xf7db=['path','express','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','/describe','describe','/:id','isAuthenticated','show','post','put','update','delete','exports','multer','util'];(function(_0x25b4a4,_0x2e081b){var _0x707267=function(_0x440123){while(--_0x440123){_0x25b4a4['push'](_0x25b4a4['shift']());}};_0x707267(++_0x2e081b);}(_0xf7db,0xf5));var _0xbf7d=function(_0xb4c879,_0x1ec96e){_0xb4c879=_0xb4c879-0x0;var _0x440cb5=_0xf7db[_0xb4c879];return _0x440cb5;};'use strict';var multer=require(_0xbf7d('0x0'));var util=require(_0xbf7d('0x1'));var path=require(_0xbf7d('0x2'));var timeout=require('connect-timeout');var express=require(_0xbf7d('0x3'));var router=express['Router']();var fs_extra=require(_0xbf7d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbf7d('0x5'));var config=require(_0xbf7d('0x6'));var controller=require(_0xbf7d('0x7'));router[_0xbf7d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbf7d('0x8')](_0xbf7d('0x9'),auth['isAuthenticated'](),controller[_0xbf7d('0xa')]);router[_0xbf7d('0x8')](_0xbf7d('0xb'),auth[_0xbf7d('0xc')](),controller[_0xbf7d('0xd')]);router[_0xbf7d('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbf7d('0xf')](_0xbf7d('0xb'),auth[_0xbf7d('0xc')](),controller[_0xbf7d('0x10')]);router[_0xbf7d('0x11')](_0xbf7d('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xbf7d('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index dec2ccd..4086b75 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 _0x00ef=['timeout','STRING','sequelize','exports','ENUM','mouseOver'];(function(_0x59eca8,_0x110189){var _0x52e652=function(_0x3d2c21){while(--_0x3d2c21){_0x59eca8['push'](_0x59eca8['shift']());}};_0x52e652(++_0x110189);}(_0x00ef,0xc2));var _0xf00e=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x00ef[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0xf00e('0x0'));module[_0xf00e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf00e('0x2')](_0xf00e('0x3'),_0xf00e('0x4')),'defaultValue':_0xf00e('0x3')},'selector':{'type':Sequelize[_0xf00e('0x5')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xe0b3=['ENUM','mouseOver','timeout','INTEGER','sequelize','exports','STRING'];(function(_0x17a069,_0x41bf27){var _0x3f5de9=function(_0x544b35){while(--_0x544b35){_0x17a069['push'](_0x17a069['shift']());}};_0x3f5de9(++_0x41bf27);}(_0xe0b3,0x115));var _0x3e0b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe0b3[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x3e0b('0x0'));module[_0x3e0b('0x1')]={'name':{'type':Sequelize[_0x3e0b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3e0b('0x3')](_0x3e0b('0x4'),_0x3e0b('0x5')),'defaultValue':_0x3e0b('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x3e0b('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index aa3981a..b8cb1ea 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.controller.js +++ b/server/api/chatProactiveAction/chatProactiveAction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3351=['attributes','length','include','options','find','create','body','catch','params','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','json','reject','save','then','destroy','error','stack','name','send','show','model','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','fields'];(function(_0x259910,_0x4ad519){var _0x57b809=function(_0x2fefb8){while(--_0x2fefb8){_0x259910['push'](_0x259910['shift']());}};_0x57b809(++_0x4ad519);}(_0x3351,0x1b4));var _0x1335=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x3351[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x1335('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1335('0x1'));var rp=require(_0x1335('0x2'));var moment=require(_0x1335('0x3'));var BPromise=require(_0x1335('0x4'));var Mustache=require(_0x1335('0x5'));var util=require(_0x1335('0x6'));var path=require(_0x1335('0x7'));var sox=require('sox');var csv=require(_0x1335('0x8'));var ejs=require(_0x1335('0x9'));var fs=require('fs');var fs_extra=require(_0x1335('0xa'));var _=require(_0x1335('0xb'));var squel=require(_0x1335('0xc'));var crypto=require(_0x1335('0xd'));var jsforce=require(_0x1335('0xe'));var deskjs=require(_0x1335('0xf'));var toCsv=require(_0x1335('0x8'));var querystring=require(_0x1335('0x10'));var Papa=require(_0x1335('0x11'));var Redis=require('ioredis');var authService=require(_0x1335('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1335('0x13'));var hardwareService=require(_0x1335('0x14'));var logger=require(_0x1335('0x15'))(_0x1335('0x16'));var utils=require(_0x1335('0x17'));var config=require(_0x1335('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1335('0x19'))['db'];function respondWithStatusCode(_0x55a85e,_0x425cd8){_0x425cd8=_0x425cd8||0xcc;return function(_0x5699f4){if(_0x5699f4){return _0x55a85e[_0x1335('0x1a')](_0x425cd8);}return _0x55a85e['status'](_0x425cd8)[_0x1335('0x1b')]();};}function respondWithResult(_0x4c8964,_0x4f9625){_0x4f9625=_0x4f9625||0xc8;return function(_0xc333ce){if(_0xc333ce){return _0x4c8964[_0x1335('0x1c')](_0x4f9625)['json'](_0xc333ce);}};}function respondWithFilteredResult(_0x5ee59d,_0x3bd6b0){return function(_0x565686){if(_0x565686){var _0x431433=typeof _0x3bd6b0[_0x1335('0x1d')]===_0x1335('0x1e')&&typeof _0x3bd6b0['limit']===_0x1335('0x1e');var _0x4da3b8=_0x565686[_0x1335('0x1f')];var _0x4d5b17=_0x431433?0x0:_0x3bd6b0[_0x1335('0x1d')];var _0x36123c=_0x431433?_0x565686[_0x1335('0x1f')]:_0x3bd6b0['offset']+_0x3bd6b0[_0x1335('0x20')];var _0xbebdea;if(_0x36123c>=_0x4da3b8){_0x36123c=_0x4da3b8;_0xbebdea=0xc8;}else{_0xbebdea=0xce;}_0x5ee59d[_0x1335('0x1c')](_0xbebdea);return _0x5ee59d[_0x1335('0x21')]('Content-Range',_0x4d5b17+'-'+_0x36123c+'/'+_0x4da3b8)[_0x1335('0x22')](_0x565686);}return null;};}function patchUpdates(_0x4ae091){return function(_0x5c10d3){try{jsonpatch['apply'](_0x5c10d3,_0x4ae091,!![]);}catch(_0x12e01b){return BPromise[_0x1335('0x23')](_0x12e01b);}return _0x5c10d3[_0x1335('0x24')]();};}function saveUpdates(_0x5c4c24,_0x4c01c9){return function(_0x25aacb){if(_0x25aacb){return _0x25aacb['update'](_0x5c4c24)[_0x1335('0x25')](function(_0x47eaa7){return _0x47eaa7;});}return null;};}function removeEntity(_0x35432b,_0x1c13a8){return function(_0x383d19){if(_0x383d19){return _0x383d19[_0x1335('0x26')]()[_0x1335('0x25')](function(){_0x35432b[_0x1335('0x1c')](0xcc)[_0x1335('0x1b')]();});}};}function handleEntityNotFound(_0x48a0f9,_0x37efee){return function(_0x26ba20){if(!_0x26ba20){_0x48a0f9[_0x1335('0x1a')](0x194);}return _0x26ba20;};}function handleError(_0x1e0019,_0x4cf375){_0x4cf375=_0x4cf375||0x1f4;return function(_0x1498e6){logger[_0x1335('0x27')](_0x1498e6[_0x1335('0x28')]);if(_0x1498e6[_0x1335('0x29')]){delete _0x1498e6[_0x1335('0x29')];}_0x1e0019[_0x1335('0x1c')](_0x4cf375)[_0x1335('0x2a')](_0x1498e6);};}exports[_0x1335('0x2b')]=function(_0x23b5cc,_0xdc07ab){var _0x233298={'raw':!![],'where':{'id':_0x23b5cc['params']['id']}},_0x19950c={};_0x19950c[_0x1335('0x2c')]=_['keys'](db[_0x1335('0x2d')][_0x1335('0x2e')]);_0x19950c[_0x1335('0x2f')]=_[_0x1335('0x30')](_0x23b5cc['query']);_0x19950c[_0x1335('0x31')]=_[_0x1335('0x32')](_0x19950c[_0x1335('0x2c')],_0x19950c[_0x1335('0x2f')]);_0x233298['attributes']=_[_0x1335('0x32')](_0x19950c[_0x1335('0x2c')],qs[_0x1335('0x33')](_0x23b5cc[_0x1335('0x2f')][_0x1335('0x33')]));_0x233298[_0x1335('0x34')]=_0x233298['attributes'][_0x1335('0x35')]?_0x233298[_0x1335('0x34')]:_0x19950c[_0x1335('0x2c')];if(_0x23b5cc[_0x1335('0x2f')]['includeAll']){_0x233298[_0x1335('0x36')]=[{'all':!![]}];}_0x233298=_['merge']({},_0x233298,_0x23b5cc[_0x1335('0x37')]);return db['ChatProactiveAction'][_0x1335('0x38')](_0x233298)[_0x1335('0x25')](handleEntityNotFound(_0xdc07ab,null))[_0x1335('0x25')](respondWithResult(_0xdc07ab,null))['catch'](handleError(_0xdc07ab,null));};exports[_0x1335('0x39')]=function(_0x5f311e,_0x3b82be){return db[_0x1335('0x2d')][_0x1335('0x39')](_0x5f311e[_0x1335('0x3a')],{})[_0x1335('0x25')](respondWithResult(_0x3b82be,0xc9))[_0x1335('0x3b')](handleError(_0x3b82be,null));};exports['update']=function(_0x31be79,_0x213815){if(_0x31be79[_0x1335('0x3a')]['id']){delete _0x31be79['body']['id'];}return db[_0x1335('0x2d')]['find']({'where':{'id':_0x31be79[_0x1335('0x3c')]['id']}})['then'](handleEntityNotFound(_0x213815,null))[_0x1335('0x25')](saveUpdates(_0x31be79[_0x1335('0x3a')],null))['then'](respondWithResult(_0x213815,null))[_0x1335('0x3b')](handleError(_0x213815,null));};exports[_0x1335('0x26')]=function(_0x524252,_0x21f5bb){return db[_0x1335('0x2d')][_0x1335('0x38')]({'where':{'id':_0x524252[_0x1335('0x3c')]['id']}})['then'](handleEntityNotFound(_0x21f5bb,null))[_0x1335('0x25')](removeEntity(_0x21f5bb,null))[_0x1335('0x3b')](handleError(_0x21f5bb,null));}; \ No newline at end of file +var _0x9fc5=['create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','params','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','model','attributes','fields','merge','options','find','catch'];(function(_0x2685e8,_0x29b835){var _0x4d4b5c=function(_0x33b891){while(--_0x33b891){_0x2685e8['push'](_0x2685e8['shift']());}};_0x4d4b5c(++_0x29b835);}(_0x9fc5,0xb6));var _0x59fc=function(_0x2d2258,_0x2ce510){_0x2d2258=_0x2d2258-0x0;var _0x18e155=_0x9fc5[_0x2d2258];return _0x18e155;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x59fc('0x0'));var zipdir=require(_0x59fc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x59fc('0x2'));var moment=require(_0x59fc('0x3'));var BPromise=require(_0x59fc('0x4'));var Mustache=require(_0x59fc('0x5'));var util=require(_0x59fc('0x6'));var path=require(_0x59fc('0x7'));var sox=require(_0x59fc('0x8'));var csv=require(_0x59fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x59fc('0xa'));var _=require(_0x59fc('0xb'));var squel=require(_0x59fc('0xc'));var crypto=require('crypto');var jsforce=require(_0x59fc('0xd'));var deskjs=require(_0x59fc('0xe'));var toCsv=require(_0x59fc('0x9'));var querystring=require(_0x59fc('0xf'));var Papa=require(_0x59fc('0x10'));var Redis=require(_0x59fc('0x11'));var authService=require(_0x59fc('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x59fc('0x13'));var hardwareService=require(_0x59fc('0x14'));var logger=require(_0x59fc('0x15'))(_0x59fc('0x16'));var utils=require(_0x59fc('0x17'));var config=require(_0x59fc('0x18'));var licenseUtil=require(_0x59fc('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29ffcc,_0x39b60e){_0x39b60e=_0x39b60e||0xcc;return function(_0x42982d){if(_0x42982d){return _0x29ffcc[_0x59fc('0x1a')](_0x39b60e);}return _0x29ffcc[_0x59fc('0x1b')](_0x39b60e)[_0x59fc('0x1c')]();};}function respondWithResult(_0x1d02d0,_0x19cb0c){_0x19cb0c=_0x19cb0c||0xc8;return function(_0x462fe9){if(_0x462fe9){return _0x1d02d0[_0x59fc('0x1b')](_0x19cb0c)[_0x59fc('0x1d')](_0x462fe9);}};}function respondWithFilteredResult(_0x50365f,_0x386d87){return function(_0x362c6b){if(_0x362c6b){var _0x4e01f6=typeof _0x386d87[_0x59fc('0x1e')]===_0x59fc('0x1f')&&typeof _0x386d87[_0x59fc('0x20')]===_0x59fc('0x1f');var _0x175718=_0x362c6b['count'];var _0x4d72f8=_0x4e01f6?0x0:_0x386d87[_0x59fc('0x1e')];var _0x1ab367=_0x4e01f6?_0x362c6b[_0x59fc('0x21')]:_0x386d87[_0x59fc('0x1e')]+_0x386d87[_0x59fc('0x20')];var _0x2157b3;if(_0x1ab367>=_0x175718){_0x1ab367=_0x175718;_0x2157b3=0xc8;}else{_0x2157b3=0xce;}_0x50365f[_0x59fc('0x1b')](_0x2157b3);return _0x50365f['set'](_0x59fc('0x22'),_0x4d72f8+'-'+_0x1ab367+'/'+_0x175718)['json'](_0x362c6b);}return null;};}function patchUpdates(_0xdcfddb){return function(_0x57a964){try{jsonpatch[_0x59fc('0x23')](_0x57a964,_0xdcfddb,!![]);}catch(_0x25cbdc){return BPromise[_0x59fc('0x24')](_0x25cbdc);}return _0x57a964[_0x59fc('0x25')]();};}function saveUpdates(_0x327b1c,_0x3849bc){return function(_0x4913ff){if(_0x4913ff){return _0x4913ff[_0x59fc('0x26')](_0x327b1c)[_0x59fc('0x27')](function(_0x4b6964){return _0x4b6964;});}return null;};}function removeEntity(_0x4cd81e,_0x3ccb60){return function(_0xa7d026){if(_0xa7d026){return _0xa7d026[_0x59fc('0x28')]()[_0x59fc('0x27')](function(){_0x4cd81e[_0x59fc('0x1b')](0xcc)[_0x59fc('0x1c')]();});}};}function handleEntityNotFound(_0x11e92e,_0x38bd58){return function(_0x1bfbe0){if(!_0x1bfbe0){_0x11e92e['sendStatus'](0x194);}return _0x1bfbe0;};}function handleError(_0x3145be,_0x5e8669){_0x5e8669=_0x5e8669||0x1f4;return function(_0x1975a1){logger['error'](_0x1975a1[_0x59fc('0x29')]);if(_0x1975a1[_0x59fc('0x2a')]){delete _0x1975a1['name'];}_0x3145be[_0x59fc('0x1b')](_0x5e8669)[_0x59fc('0x2b')](_0x1975a1);};}exports['show']=function(_0x1304ae,_0x3c6453){var _0x554cf8={'raw':!![],'where':{'id':_0x1304ae[_0x59fc('0x2c')]['id']}},_0x222fe6={};_0x222fe6['model']=_[_0x59fc('0x2d')](db[_0x59fc('0x2e')][_0x59fc('0x2f')]);_0x222fe6['query']=_[_0x59fc('0x2d')](_0x1304ae[_0x59fc('0x30')]);_0x222fe6[_0x59fc('0x31')]=_[_0x59fc('0x32')](_0x222fe6[_0x59fc('0x33')],_0x222fe6[_0x59fc('0x30')]);_0x554cf8[_0x59fc('0x34')]=_[_0x59fc('0x32')](_0x222fe6['model'],qs[_0x59fc('0x35')](_0x1304ae[_0x59fc('0x30')][_0x59fc('0x35')]));_0x554cf8['attributes']=_0x554cf8[_0x59fc('0x34')]['length']?_0x554cf8[_0x59fc('0x34')]:_0x222fe6[_0x59fc('0x33')];if(_0x1304ae[_0x59fc('0x30')]['includeAll']){_0x554cf8['include']=[{'all':!![]}];}_0x554cf8=_[_0x59fc('0x36')]({},_0x554cf8,_0x1304ae[_0x59fc('0x37')]);return db[_0x59fc('0x2e')][_0x59fc('0x38')](_0x554cf8)[_0x59fc('0x27')](handleEntityNotFound(_0x3c6453,null))[_0x59fc('0x27')](respondWithResult(_0x3c6453,null))[_0x59fc('0x39')](handleError(_0x3c6453,null));};exports[_0x59fc('0x3a')]=function(_0x28d941,_0x212d73){return db[_0x59fc('0x2e')][_0x59fc('0x3a')](_0x28d941[_0x59fc('0x3b')],{})[_0x59fc('0x27')](respondWithResult(_0x212d73,0xc9))[_0x59fc('0x39')](handleError(_0x212d73,null));};exports[_0x59fc('0x26')]=function(_0x38eda6,_0x49d494){if(_0x38eda6[_0x59fc('0x3b')]['id']){delete _0x38eda6[_0x59fc('0x3b')]['id'];}return db[_0x59fc('0x2e')]['find']({'where':{'id':_0x38eda6['params']['id']}})['then'](handleEntityNotFound(_0x49d494,null))['then'](saveUpdates(_0x38eda6[_0x59fc('0x3b')],null))[_0x59fc('0x27')](respondWithResult(_0x49d494,null))['catch'](handleError(_0x49d494,null));};exports[_0x59fc('0x28')]=function(_0x2040c2,_0x39ef31){return db[_0x59fc('0x2e')][_0x59fc('0x38')]({'where':{'id':_0x2040c2[_0x59fc('0x2c')]['id']}})['then'](handleEntityNotFound(_0x39ef31,null))['then'](removeEntity(_0x39ef31,null))[_0x59fc('0x39')](handleError(_0x39ef31,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index b7592bb..a07d942 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 _0x0d49=['bluebird','request-promise','path','../../config/environment','define','lodash','util','../../config/logger','api','moment'];(function(_0x446a0f,_0x140767){var _0x22b3de=function(_0x21efaf){while(--_0x21efaf){_0x446a0f['push'](_0x446a0f['shift']());}};_0x22b3de(++_0x140767);}(_0x0d49,0xf5));var _0x90d4=function(_0x5af5ce,_0x350f6e){_0x5af5ce=_0x5af5ce-0x0;var _0x5c1e23=_0x0d49[_0x5af5ce];return _0x5c1e23;};'use strict';var _=require(_0x90d4('0x0'));var util=require(_0x90d4('0x1'));var logger=require(_0x90d4('0x2'))(_0x90d4('0x3'));var moment=require(_0x90d4('0x4'));var BPromise=require(_0x90d4('0x5'));var rp=require(_0x90d4('0x6'));var fs=require('fs');var path=require(_0x90d4('0x7'));var rimraf=require('rimraf');var config=require(_0x90d4('0x8'));var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x4e2950,_0x5daddb){return _0x4e2950[_0x90d4('0x9')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x40d1=['../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','bluebird','request-promise','path','rimraf'];(function(_0x26de85,_0xf8166f){var _0x331382=function(_0x583430){while(--_0x583430){_0x26de85['push'](_0x26de85['shift']());}};_0x331382(++_0xf8166f);}(_0x40d1,0xaa));var _0x140d=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x40d1[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x140d('0x0'));var util=require(_0x140d('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x140d('0x2'));var rp=require(_0x140d('0x3'));var fs=require('fs');var path=require(_0x140d('0x4'));var rimraf=require(_0x140d('0x5'));var config=require(_0x140d('0x6'));var attributes=require(_0x140d('0x7'));module['exports']=function(_0x34bb9c,_0x4b9845){return _0x34bb9c[_0x140d('0x8')](_0x140d('0x9'),attributes,{'tableName':_0x140d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index cb9f79b..f6db5d6 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 _0x7025=['ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug'];(function(_0x47888a,_0x7d2f3a){var _0x2b15a4=function(_0x12a3e9){while(--_0x12a3e9){_0x47888a['push'](_0x47888a['shift']());}};_0x2b15a4(++_0x7d2f3a);}(_0x7025,0xe3));var _0x5702=function(_0x526d98,_0x5d4f42){_0x526d98=_0x526d98-0x0;var _0x201298=_0x7025[_0x526d98];return _0x201298;};'use strict';var _=require(_0x5702('0x0'));var util=require('util');var moment=require(_0x5702('0x1'));var BPromise=require('bluebird');var rs=require(_0x5702('0x2'));var fs=require('fs');var Redis=require(_0x5702('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5702('0x4'));var logger=require(_0x5702('0x5'))('rpc');var config=require(_0x5702('0x6'));var jayson=require(_0x5702('0x7'));var client=jayson['client'][_0x5702('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b16f5,_0x5afe1b,_0x197f4c){return new BPromise(function(_0x1c29ac,_0x4b6b0d){return client['request'](_0x4b16f5,_0x197f4c)[_0x5702('0x9')](function(_0x4ed4e3){logger[_0x5702('0xa')]('ChatProactiveAction,\x20%s,\x20%s',_0x5afe1b,_0x5702('0xb'));logger[_0x5702('0xc')](_0x5702('0xd'),_0x5afe1b,_0x5702('0xb'),JSON[_0x5702('0xe')](_0x4ed4e3));if(_0x4ed4e3[_0x5702('0xf')]){if(_0x4ed4e3['error'][_0x5702('0x10')]===0x1f4){logger['error'](_0x5702('0x11'),_0x5afe1b,_0x4ed4e3[_0x5702('0xf')]['message']);return _0x4b6b0d(_0x4ed4e3[_0x5702('0xf')][_0x5702('0x12')]);}logger[_0x5702('0xf')](_0x5702('0x11'),_0x5afe1b,_0x4ed4e3['error'][_0x5702('0x12')]);return _0x1c29ac(_0x4ed4e3[_0x5702('0xf')]['message']);}else{logger[_0x5702('0xa')](_0x5702('0x11'),_0x5afe1b,_0x5702('0xb'));_0x1c29ac(_0x4ed4e3[_0x5702('0x13')][_0x5702('0x12')]);}})['catch'](function(_0x2a740f){logger[_0x5702('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x5afe1b,_0x2a740f);_0x4b6b0d(_0x2a740f);});});} \ No newline at end of file +var _0x3e7a=['request\x20sent','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s'];(function(_0x38b14f,_0xd08fa8){var _0x22a324=function(_0x4bbb05){while(--_0x4bbb05){_0x38b14f['push'](_0x38b14f['shift']());}};_0x22a324(++_0xd08fa8);}(_0x3e7a,0xae));var _0xa3e7=function(_0x1a2d96,_0x3ad110){_0x1a2d96=_0x1a2d96-0x0;var _0x5b7ea5=_0x3e7a[_0x1a2d96];return _0x5b7ea5;};'use strict';var _=require(_0xa3e7('0x0'));var util=require('util');var moment=require(_0xa3e7('0x1'));var BPromise=require('bluebird');var rs=require(_0xa3e7('0x2'));var fs=require('fs');var Redis=require(_0xa3e7('0x3'));var db=require(_0xa3e7('0x4'))['db'];var utils=require(_0xa3e7('0x5'));var logger=require(_0xa3e7('0x6'))(_0xa3e7('0x7'));var config=require('../../config/environment');var jayson=require(_0xa3e7('0x8'));var client=jayson['client'][_0xa3e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e7d2c,_0x2be4ac,_0x5d7aff){return new BPromise(function(_0x23bf25,_0x4a07ac){return client['request'](_0x2e7d2c,_0x5d7aff)[_0xa3e7('0xa')](function(_0x5e6ac9){logger[_0xa3e7('0xb')](_0xa3e7('0xc'),_0x2be4ac,'request\x20sent');logger[_0xa3e7('0xd')](_0xa3e7('0xe'),_0x2be4ac,_0xa3e7('0xf'),JSON['stringify'](_0x5e6ac9));if(_0x5e6ac9[_0xa3e7('0x10')]){if(_0x5e6ac9['error'][_0xa3e7('0x11')]===0x1f4){logger[_0xa3e7('0x10')](_0xa3e7('0xc'),_0x2be4ac,_0x5e6ac9[_0xa3e7('0x10')][_0xa3e7('0x12')]);return _0x4a07ac(_0x5e6ac9[_0xa3e7('0x10')][_0xa3e7('0x12')]);}logger[_0xa3e7('0x10')](_0xa3e7('0xc'),_0x2be4ac,_0x5e6ac9[_0xa3e7('0x10')][_0xa3e7('0x12')]);return _0x23bf25(_0x5e6ac9['error'][_0xa3e7('0x12')]);}else{logger[_0xa3e7('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x2be4ac,_0xa3e7('0xf'));_0x23bf25(_0x5e6ac9[_0xa3e7('0x13')]['message']);}})[_0xa3e7('0x14')](function(_0x1da239){logger[_0xa3e7('0x10')](_0xa3e7('0xc'),_0x2be4ac,_0x1da239);_0x4a07ac(_0x1da239);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index ecef7a1..d0db5d1 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 _0xae24=['destroy','exports','multer','path','express','Router','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','update','delete'];(function(_0x573c9e,_0xd4ab71){var _0x5d0714=function(_0x127a2a){while(--_0x127a2a){_0x573c9e['push'](_0x573c9e['shift']());}};_0x5d0714(++_0xd4ab71);}(_0xae24,0x182));var _0x4ae2=function(_0x430162,_0x50d4f8){_0x430162=_0x430162-0x0;var _0x400e6c=_0xae24[_0x430162];return _0x400e6c;};'use strict';var multer=require(_0x4ae2('0x0'));var util=require('util');var path=require(_0x4ae2('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ae2('0x2'));var router=express[_0x4ae2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ae2('0x4'));var config=require('../../config/environment');var controller=require(_0x4ae2('0x5'));router[_0x4ae2('0x6')](_0x4ae2('0x7'),auth[_0x4ae2('0x8')](),controller[_0x4ae2('0x9')]);router[_0x4ae2('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4ae2('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x4ae2('0xc')]);router[_0x4ae2('0xd')]('/:id',auth[_0x4ae2('0x8')](),controller[_0x4ae2('0xe')]);module[_0x4ae2('0xf')]=router; \ No newline at end of file +var _0x71ab=['get','/:id','isAuthenticated','show','post','create','put','update','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x71ab,0x64));var _0xb71a=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x71ab[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require('multer');var util=require(_0xb71a('0x0'));var path=require('path');var timeout=require(_0xb71a('0x1'));var express=require('express');var router=express[_0xb71a('0x2')]();var fs_extra=require(_0xb71a('0x3'));var auth=require(_0xb71a('0x4'));var interaction=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var controller=require(_0xb71a('0x7'));router[_0xb71a('0x8')](_0xb71a('0x9'),auth[_0xb71a('0xa')](),controller[_0xb71a('0xb')]);router[_0xb71a('0xc')]('/',auth[_0xb71a('0xa')](),controller[_0xb71a('0xd')]);router[_0xb71a('0xe')](_0xb71a('0x9'),auth[_0xb71a('0xa')](),controller[_0xb71a('0xf')]);router[_0xb71a('0x10')]('/:id',auth[_0xb71a('0xa')](),controller['destroy']);module[_0xb71a('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 479cf4d..4d0615f 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 _0x88eb=['INTEGER','ENUM','beepall','sequelize','exports','STRING','name'];(function(_0x407dcc,_0x25342e){var _0x451f63=function(_0x1f42d1){while(--_0x1f42d1){_0x407dcc['push'](_0x407dcc['shift']());}};_0x451f63(++_0x25342e);}(_0x88eb,0x1a7));var _0xb88e=function(_0x2bf63e,_0xf0b53c){_0x2bf63e=_0x2bf63e-0x0;var _0x306138=_0x88eb[_0x2bf63e];return _0x306138;};'use strict';var Sequelize=require(_0xb88e('0x0'));module[_0xb88e('0x1')]={'name':{'type':Sequelize[_0xb88e('0x2')],'unique':_0xb88e('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb88e('0x2')]},'timeout':{'type':Sequelize[_0xb88e('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb88e('0x5')]('rrmemory',_0xb88e('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x18b9=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','STRING'];(function(_0x4ea0f8,_0x4191cf){var _0x39a8dc=function(_0x384028){while(--_0x384028){_0x4ea0f8['push'](_0x4ea0f8['shift']());}};_0x39a8dc(++_0x4191cf);}(_0x18b9,0x1a9));var _0x918b=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x18b9[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x918b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x918b('0x1')]},'timeout':{'type':Sequelize[_0x918b('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x918b('0x3')](_0x918b('0x4'),_0x918b('0x5'),_0x918b('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 6223919..c06c512 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 _0xcaa4=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','keys','length','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','params','UserChatQueue','ChatQueueId','options','User','findAndCountAll','UserId','updatedAt','createdAt','rows','format','%s/%s','SIP','chatPause','getTeams','Team','addTeams','ids','Agents','online','flatMap','transaction','each','emit','removeTeams','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','sequelize','SELECT','TeamId','includes','union','compact','value','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','order','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','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/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatQueue.socket','jayson/promise','client','http','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','get','ChatQueues','UserProfileResource','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xcaa4,0x183));var _0x4caa=function(_0x9c9142,_0x7a02d6){_0x9c9142=_0x9c9142-0x0;var _0x5bfaf8=_0xcaa4[_0x9c9142];return _0x5bfaf8;};'use strict';var emlformat=require(_0x4caa('0x0'));var rimraf=require(_0x4caa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4caa('0x2'));var rp=require(_0x4caa('0x3'));var moment=require(_0x4caa('0x4'));var BPromise=require(_0x4caa('0x5'));var Mustache=require(_0x4caa('0x6'));var util=require(_0x4caa('0x7'));var path=require(_0x4caa('0x8'));var sox=require(_0x4caa('0x9'));var csv=require('to-csv');var ejs=require(_0x4caa('0xa'));var fs=require('fs');var fs_extra=require(_0x4caa('0xb'));var _=require('lodash');var squel=require(_0x4caa('0xc'));var crypto=require(_0x4caa('0xd'));var jsforce=require(_0x4caa('0xe'));var deskjs=require(_0x4caa('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4caa('0x10'));var Redis=require(_0x4caa('0x11'));var authService=require(_0x4caa('0x12'));var qs=require(_0x4caa('0x13'));var as=require(_0x4caa('0x14'));var hardwareService=require(_0x4caa('0x15'));var logger=require(_0x4caa('0x16'))(_0x4caa('0x17'));var utils=require(_0x4caa('0x18'));var config=require(_0x4caa('0x19'));var licenseUtil=require(_0x4caa('0x1a'));var db=require(_0x4caa('0x1b'))['db'];config['redis']=_['defaults'](config[_0x4caa('0x1c')],{'host':_0x4caa('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4caa('0x1c')]));require(_0x4caa('0x1e'))['register'](socket);var jayson=require(_0x4caa('0x1f'));var client=jayson[_0x4caa('0x20')][_0x4caa('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x4fb658,_0x4c1580,_0x292c0f,_0x4dad42){return new BPromise(function(_0x2466ac,_0x292171){var _0x1f9549=_0x4dad42||client;return _0x1f9549[_0x4caa('0x22')](_0x4fb658,_0x292c0f)['then'](function(_0x64f58a){logger[_0x4caa('0x23')](_0x4caa('0x24'),_0x4c1580,_0x4caa('0x25'));logger['debug'](_0x4caa('0x26'),_0x4c1580,_0x4caa('0x25'),JSON[_0x4caa('0x27')](_0x64f58a));if(_0x64f58a['error']){if(_0x64f58a['error'][_0x4caa('0x28')]===0x1f4){logger[_0x4caa('0x29')](_0x4caa('0x24'),_0x4c1580,_0x64f58a[_0x4caa('0x29')][_0x4caa('0x2a')]);return _0x292171(_0x64f58a[_0x4caa('0x29')][_0x4caa('0x2a')]);}logger[_0x4caa('0x29')](_0x4caa('0x24'),_0x4c1580,_0x64f58a['error']['message']);return _0x2466ac(_0x64f58a['error'][_0x4caa('0x2a')]);}else{logger[_0x4caa('0x23')](_0x4caa('0x24'),_0x4c1580,'request\x20sent');_0x2466ac(_0x64f58a[_0x4caa('0x2b')][_0x4caa('0x2a')]);}})['catch'](function(_0x4adf80){logger[_0x4caa('0x29')]('ChatQueue,\x20%s,\x20%s',_0x4c1580,_0x4adf80);_0x292171(_0x4adf80);});});}function respondWithStatusCode(_0x4b1447,_0xbca669){_0xbca669=_0xbca669||0xcc;return function(_0x207547){if(_0x207547){return _0x4b1447[_0x4caa('0x2c')](_0xbca669);}return _0x4b1447[_0x4caa('0x2d')](_0xbca669)[_0x4caa('0x2e')]();};}function respondWithResult(_0x463ed1,_0x4f8204){_0x4f8204=_0x4f8204||0xc8;return function(_0x318136){if(_0x318136){return _0x463ed1['status'](_0x4f8204)[_0x4caa('0x2f')](_0x318136);}};}function respondWithFilteredResult(_0x4d3a40,_0x23cfa4){return function(_0x28b7cc){if(_0x28b7cc){var _0x2509b2=typeof _0x23cfa4[_0x4caa('0x30')]===_0x4caa('0x31')&&typeof _0x23cfa4[_0x4caa('0x32')]===_0x4caa('0x31');var _0xfe704b=_0x28b7cc[_0x4caa('0x33')];var _0xe66d81=_0x2509b2?0x0:_0x23cfa4['offset'];var _0x1bfbe1=_0x2509b2?_0x28b7cc[_0x4caa('0x33')]:_0x23cfa4[_0x4caa('0x30')]+_0x23cfa4[_0x4caa('0x32')];var _0x19fc58;if(_0x1bfbe1>=_0xfe704b){_0x1bfbe1=_0xfe704b;_0x19fc58=0xc8;}else{_0x19fc58=0xce;}_0x4d3a40['status'](_0x19fc58);return _0x4d3a40['set'](_0x4caa('0x34'),_0xe66d81+'-'+_0x1bfbe1+'/'+_0xfe704b)[_0x4caa('0x2f')](_0x28b7cc);}return null;};}function patchUpdates(_0x3ff956){return function(_0x4c250f){try{jsonpatch['apply'](_0x4c250f,_0x3ff956,!![]);}catch(_0x48e23a){return BPromise['reject'](_0x48e23a);}return _0x4c250f[_0x4caa('0x35')]();};}function saveUpdates(_0xb1bcf5,_0x4de4b2){return function(_0x2c74b2){if(_0x2c74b2){return _0x2c74b2[_0x4caa('0x36')](_0xb1bcf5)[_0x4caa('0x37')](function(_0x579d90){return _0x579d90;});}return null;};}function removeEntity(_0x56bbde,_0x1af3c8){return function(_0xbe4a8){if(_0xbe4a8){return _0xbe4a8[_0x4caa('0x38')]()[_0x4caa('0x37')](function(){var _0x552738=_0xbe4a8[_0x4caa('0x39')]({'plain':!![]});var _0x57aee6=_0x4caa('0x3a');return db[_0x4caa('0x3b')][_0x4caa('0x38')]({'where':{'type':_0x57aee6,'resourceId':_0x552738['id']}})['then'](function(){return _0xbe4a8;});})[_0x4caa('0x37')](function(){_0x56bbde[_0x4caa('0x2d')](0xcc)[_0x4caa('0x2e')]();});}};}function handleEntityNotFound(_0x573c71,_0x59e46a){return function(_0x5a60ea){if(!_0x5a60ea){_0x573c71['sendStatus'](0x194);}return _0x5a60ea;};}function handleError(_0x3c3d9a,_0x4d8c70){_0x4d8c70=_0x4d8c70||0x1f4;return function(_0x108524){logger[_0x4caa('0x29')](_0x108524['stack']);if(_0x108524[_0x4caa('0x3c')]){delete _0x108524[_0x4caa('0x3c')];}_0x3c3d9a[_0x4caa('0x2d')](_0x4d8c70)[_0x4caa('0x3d')](_0x108524);};}exports[_0x4caa('0x3e')]=function(_0x169e29,_0x59d628){var _0x126bea={},_0x39a9fa={},_0x20910d={'count':0x0,'rows':[]};var _0x5028de=_[_0x4caa('0x3f')](db[_0x4caa('0x40')][_0x4caa('0x41')],function(_0x304b93){return{'name':_0x304b93[_0x4caa('0x42')],'type':_0x304b93[_0x4caa('0x43')][_0x4caa('0x44')]};});_0x39a9fa[_0x4caa('0x45')]=_[_0x4caa('0x3f')](_0x5028de,_0x4caa('0x3c'));_0x39a9fa[_0x4caa('0x46')]=_['keys'](_0x169e29[_0x4caa('0x46')]);_0x39a9fa[_0x4caa('0x47')]=_[_0x4caa('0x48')](_0x39a9fa[_0x4caa('0x45')],_0x39a9fa['query']);_0x126bea[_0x4caa('0x49')]=_[_0x4caa('0x48')](_0x39a9fa[_0x4caa('0x45')],qs[_0x4caa('0x4a')](_0x169e29[_0x4caa('0x46')][_0x4caa('0x4a')]));_0x126bea[_0x4caa('0x49')]=_0x126bea[_0x4caa('0x49')]['length']?_0x126bea[_0x4caa('0x49')]:_0x39a9fa[_0x4caa('0x45')];if(!_0x169e29[_0x4caa('0x46')][_0x4caa('0x4b')](_0x4caa('0x4c'))){_0x126bea[_0x4caa('0x32')]=qs['limit'](_0x169e29[_0x4caa('0x46')][_0x4caa('0x32')]);_0x126bea[_0x4caa('0x30')]=qs[_0x4caa('0x30')](_0x169e29[_0x4caa('0x46')][_0x4caa('0x30')]);}_0x126bea['order']=qs[_0x4caa('0x4d')](_0x169e29[_0x4caa('0x46')]['sort']);_0x126bea[_0x4caa('0x4e')]=qs[_0x4caa('0x47')](_[_0x4caa('0x4f')](_0x169e29[_0x4caa('0x46')],_0x39a9fa['filters']),_0x5028de);if(_0x169e29[_0x4caa('0x46')][_0x4caa('0x50')]){_0x126bea['where']=_[_0x4caa('0x51')](_0x126bea['where'],{'$or':_[_0x4caa('0x3f')](_0x5028de,function(_0x4908f7){if(_0x4908f7[_0x4caa('0x43')]!==_0x4caa('0x52')){var _0x2f4ace={};_0x2f4ace[_0x4908f7[_0x4caa('0x3c')]]={'$like':'%'+_0x169e29[_0x4caa('0x46')][_0x4caa('0x50')]+'%'};return _0x2f4ace;}})});}_0x126bea=_[_0x4caa('0x51')]({},_0x126bea,_0x169e29['options']);var _0x45c072={'where':_0x126bea[_0x4caa('0x4e')]};return db['ChatQueue'][_0x4caa('0x33')](_0x45c072)[_0x4caa('0x37')](function(_0x574dc){_0x20910d[_0x4caa('0x33')]=_0x574dc;if(_0x169e29[_0x4caa('0x46')][_0x4caa('0x53')]){_0x126bea[_0x4caa('0x54')]=[{'all':!![]}];}return db[_0x4caa('0x40')][_0x4caa('0x55')](_0x126bea);})['then'](function(_0x3e42e1){_0x20910d['rows']=_0x3e42e1;return _0x20910d;})[_0x4caa('0x37')](respondWithFilteredResult(_0x59d628,_0x126bea))['catch'](handleError(_0x59d628,null));};exports[_0x4caa('0x56')]=function(_0x33911d,_0x32d85e){var _0x4eb77e={'raw':!![],'where':{'id':_0x33911d['params']['id']}},_0x4341e0={};_0x4341e0[_0x4caa('0x45')]=_[_0x4caa('0x57')](db[_0x4caa('0x40')]['rawAttributes']);_0x4341e0[_0x4caa('0x46')]=_['keys'](_0x33911d[_0x4caa('0x46')]);_0x4341e0[_0x4caa('0x47')]=_['intersection'](_0x4341e0[_0x4caa('0x45')],_0x4341e0['query']);_0x4eb77e[_0x4caa('0x49')]=_[_0x4caa('0x48')](_0x4341e0[_0x4caa('0x45')],qs['fields'](_0x33911d[_0x4caa('0x46')]['fields']));_0x4eb77e[_0x4caa('0x49')]=_0x4eb77e[_0x4caa('0x49')][_0x4caa('0x58')]?_0x4eb77e[_0x4caa('0x49')]:_0x4341e0[_0x4caa('0x45')];if(_0x33911d['query'][_0x4caa('0x53')]){_0x4eb77e[_0x4caa('0x54')]=[{'all':!![]}];}_0x4eb77e=_[_0x4caa('0x51')]({},_0x4eb77e,_0x33911d['options']);return db[_0x4caa('0x40')][_0x4caa('0x59')](_0x4eb77e)[_0x4caa('0x37')](handleEntityNotFound(_0x32d85e,null))[_0x4caa('0x37')](respondWithResult(_0x32d85e,null))[_0x4caa('0x5a')](handleError(_0x32d85e,null));};exports[_0x4caa('0x5b')]=function(_0x3e8f66,_0x473205){return db[_0x4caa('0x40')][_0x4caa('0x5b')](_0x3e8f66[_0x4caa('0x5c')],{})[_0x4caa('0x37')](function(_0x61cee0){var _0x52f951=_0x3e8f66[_0x4caa('0x5d')][_0x4caa('0x39')]({'plain':!![]});if(!_0x52f951)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52f951[_0x4caa('0x5e')]===_0x4caa('0x5d')){var _0x2828d2=_0x61cee0[_0x4caa('0x39')]({'plain':!![]});var _0xae9998=_0x4caa('0x3a');return db[_0x4caa('0x5f')][_0x4caa('0x59')]({'where':{'name':_0xae9998,'userProfileId':_0x52f951[_0x4caa('0x60')]},'raw':!![]})[_0x4caa('0x37')](function(_0x51229b){if(_0x51229b&&_0x51229b[_0x4caa('0x61')]===0x0){return db['UserProfileResource']['create']({'name':_0x2828d2[_0x4caa('0x3c')],'resourceId':_0x2828d2['id'],'type':_0x51229b[_0x4caa('0x3c')],'sectionId':_0x51229b['id']},{})[_0x4caa('0x37')](function(){return _0x61cee0;});}else{return _0x61cee0;}})['catch'](function(_0x593f1c){logger['error'](_0x4caa('0x62'),_0x593f1c);throw _0x593f1c;});}return _0x61cee0;})[_0x4caa('0x37')](respondWithResult(_0x473205,0xc9))['catch'](handleError(_0x473205,null));};exports[_0x4caa('0x36')]=function(_0x137994,_0x33812a){if(_0x137994[_0x4caa('0x5c')]['id']){delete _0x137994['body']['id'];}return db['ChatQueue'][_0x4caa('0x59')]({'where':{'id':_0x137994['params']['id']}})[_0x4caa('0x37')](handleEntityNotFound(_0x33812a,null))['then'](saveUpdates(_0x137994[_0x4caa('0x5c')],null))[_0x4caa('0x37')](respondWithResult(_0x33812a,null))[_0x4caa('0x5a')](handleError(_0x33812a,null));};exports[_0x4caa('0x38')]=function(_0x59e812,_0xb756f6){return db[_0x4caa('0x40')]['find']({'where':{'id':_0x59e812['params']['id']}})['then'](handleEntityNotFound(_0xb756f6,null))['then'](removeEntity(_0xb756f6,null))[_0x4caa('0x5a')](handleError(_0xb756f6,null));};exports['describe']=function(_0x26fa17,_0x4d3cc6){return db['ChatQueue'][_0x4caa('0x63')]()[_0x4caa('0x37')](respondWithResult(_0x4d3cc6,null))[_0x4caa('0x5a')](handleError(_0x4d3cc6,null));};exports[_0x4caa('0x64')]=function(_0x4b65e0,_0x1c109c,_0x237fbc){var _0x2b792a={'raw':!![],'where':{}},_0x580281={},_0x50bfbe;return db['ChatQueue'][_0x4caa('0x65')]({'where':{'id':_0x4b65e0[_0x4caa('0x66')]['id']}})[_0x4caa('0x37')](handleEntityNotFound(_0x1c109c,null))[_0x4caa('0x37')](function(_0x32fe34){if(_0x32fe34){_0x50bfbe=_0x32fe34[_0x4caa('0x39')]({'plain':!![]});_0x580281[_0x4caa('0x45')]=_[_0x4caa('0x57')](db[_0x4caa('0x67')]['rawAttributes']);_0x580281[_0x4caa('0x46')]=_[_0x4caa('0x57')](_0x4b65e0[_0x4caa('0x46')]);_0x580281[_0x4caa('0x47')]=_[_0x4caa('0x48')](_0x580281[_0x4caa('0x45')],_0x580281['query']);_0x2b792a[_0x4caa('0x49')]=_['intersection'](_0x580281[_0x4caa('0x45')],qs[_0x4caa('0x4a')](_0x4b65e0[_0x4caa('0x46')][_0x4caa('0x4a')]));_0x2b792a['attributes']=_0x2b792a[_0x4caa('0x49')]['length']?_0x2b792a[_0x4caa('0x49')]:_0x580281[_0x4caa('0x45')];if(!_0x4b65e0[_0x4caa('0x46')]['hasOwnProperty'](_0x4caa('0x4c'))){_0x2b792a[_0x4caa('0x32')]=qs[_0x4caa('0x32')](_0x4b65e0[_0x4caa('0x46')]['limit']);_0x2b792a[_0x4caa('0x30')]=qs[_0x4caa('0x30')](_0x4b65e0[_0x4caa('0x46')][_0x4caa('0x30')]);}_0x2b792a['order']=qs[_0x4caa('0x4d')](_0x4b65e0[_0x4caa('0x46')][_0x4caa('0x4d')]);_0x2b792a[_0x4caa('0x4e')]=qs[_0x4caa('0x47')](_[_0x4caa('0x4f')](_0x4b65e0[_0x4caa('0x46')],_0x580281[_0x4caa('0x47')]));_0x2b792a[_0x4caa('0x4e')][_0x4caa('0x68')]=_0x32fe34['id'];if(_0x4b65e0[_0x4caa('0x46')][_0x4caa('0x50')]){_0x2b792a[_0x4caa('0x4e')]=_[_0x4caa('0x51')](_0x2b792a[_0x4caa('0x4e')],{'$or':_[_0x4caa('0x3f')](_0x2b792a['attributes'],function(_0x291aef){var _0x1fe8ae={};_0x1fe8ae[_0x291aef]={'$like':'%'+_0x4b65e0['query'][_0x4caa('0x50')]+'%'};return _0x1fe8ae;})});}_0x2b792a=_['merge']({},_0x2b792a,_0x4b65e0[_0x4caa('0x69')]);return db[_0x4caa('0x67')][_0x4caa('0x55')](_0x2b792a);}})[_0x4caa('0x37')](function(_0x144cda){if(_0x144cda){return db[_0x4caa('0x6a')][_0x4caa('0x6b')]({'where':{'id':_[_0x4caa('0x3f')](_0x144cda,_0x4caa('0x6c')),'role':'agent'},'attributes':['id',_0x4caa('0x3c'),'chatPause',_0x4caa('0x6d'),_0x4caa('0x6e')]});}})[_0x4caa('0x37')](function(_0x3b9d7b){if(_0x3b9d7b){return{'count':_0x3b9d7b[_0x4caa('0x33')],'rows':_[_0x4caa('0x3f')](_0x3b9d7b[_0x4caa('0x6f')],function(_0x18df9a){return{'membername':_0x18df9a[_0x4caa('0x3c')],'UserId':_0x18df9a['id'],'queue_name':_0x50bfbe[_0x4caa('0x3c')],'ChatQueueId':_0x50bfbe['id'],'interface':util[_0x4caa('0x70')](_0x4caa('0x71'),_0x4caa('0x72'),_0x18df9a['name']),'penalty':0x0,'paused':_0x18df9a[_0x4caa('0x73')],'createdAt':_0x18df9a[_0x4caa('0x6e')],'updatedAt':_0x18df9a[_0x4caa('0x6d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4caa('0x37')](respondWithFilteredResult(_0x1c109c,_0x2b792a))['catch'](handleError(_0x1c109c,null));};exports[_0x4caa('0x74')]=function(_0x7e4b45,_0x203150,_0xe3ea20){var _0xa8c446={};var _0x547f6f={};var _0x23503e;var _0x35365d;return db[_0x4caa('0x40')][_0x4caa('0x65')]({'where':{'id':_0x7e4b45['params']['id']}})[_0x4caa('0x37')](handleEntityNotFound(_0x203150,null))[_0x4caa('0x37')](function(_0x33bb99){if(_0x33bb99){_0x23503e=_0x33bb99;_0x547f6f[_0x4caa('0x45')]=_[_0x4caa('0x57')](db[_0x4caa('0x75')][_0x4caa('0x41')]);_0x547f6f[_0x4caa('0x46')]=_[_0x4caa('0x57')](_0x7e4b45[_0x4caa('0x46')]);_0x547f6f['filters']=_[_0x4caa('0x48')](_0x547f6f[_0x4caa('0x45')],_0x547f6f[_0x4caa('0x46')]);_0xa8c446[_0x4caa('0x49')]=_[_0x4caa('0x48')](_0x547f6f['model'],qs[_0x4caa('0x4a')](_0x7e4b45[_0x4caa('0x46')][_0x4caa('0x4a')]));_0xa8c446[_0x4caa('0x49')]=_0xa8c446[_0x4caa('0x49')][_0x4caa('0x58')]?_0xa8c446[_0x4caa('0x49')]:_0x547f6f[_0x4caa('0x45')];_0xa8c446['order']=qs[_0x4caa('0x4d')](_0x7e4b45[_0x4caa('0x46')]['sort']);_0xa8c446['where']=qs[_0x4caa('0x47')](_[_0x4caa('0x4f')](_0x7e4b45[_0x4caa('0x46')],_0x547f6f[_0x4caa('0x47')]));if(_0x7e4b45[_0x4caa('0x46')][_0x4caa('0x50')]){_0xa8c446['where']=_[_0x4caa('0x51')](_0xa8c446[_0x4caa('0x4e')],{'$or':_[_0x4caa('0x3f')](_0xa8c446[_0x4caa('0x49')],function(_0x423c94){var _0x5fae24={};_0x5fae24[_0x423c94]={'$like':'%'+_0x7e4b45[_0x4caa('0x46')][_0x4caa('0x50')]+'%'};return _0x5fae24;})});}_0xa8c446=_[_0x4caa('0x51')]({},_0xa8c446,_0x7e4b45[_0x4caa('0x69')]);return _0x23503e[_0x4caa('0x74')](_0xa8c446);}})[_0x4caa('0x37')](function(_0x3df7b7){if(_0x3df7b7){_0x35365d=_0x3df7b7[_0x4caa('0x58')];if(!_0x7e4b45[_0x4caa('0x46')]['hasOwnProperty'](_0x4caa('0x4c'))){_0xa8c446['limit']=qs['limit'](_0x7e4b45[_0x4caa('0x46')]['limit']);_0xa8c446[_0x4caa('0x30')]=qs[_0x4caa('0x30')](_0x7e4b45[_0x4caa('0x46')][_0x4caa('0x30')]);}return _0x23503e[_0x4caa('0x74')](_0xa8c446);}})[_0x4caa('0x37')](function(_0x257806){if(_0x257806){return _0x257806?{'count':_0x35365d,'rows':_0x257806}:null;}})[_0x4caa('0x37')](respondWithResult(_0x203150,null))[_0x4caa('0x5a')](handleError(_0x203150,null));};exports[_0x4caa('0x76')]=function(_0x570548,_0x1b45eb,_0x273651){var _0xa84ccd=_0x570548[_0x4caa('0x5c')][_0x4caa('0x77')];return db[_0x4caa('0x75')][_0x4caa('0x55')]({'where':{'id':_0xa84ccd},'attributes':['id'],'include':[{'model':db[_0x4caa('0x6a')],'as':_0x4caa('0x78'),'attributes':['id',_0x4caa('0x3c'),_0x4caa('0x79'),'voicePause','interface'],'raw':!![]}]})[_0x4caa('0x37')](function(_0x54eb31){if(_0x54eb31){var _0x346e69=_[_0x4caa('0x7a')](_0x54eb31,function(_0x2ce514){var _0x4e3045=_0x2ce514[_0x4caa('0x39')]({'plain':!![]});return _0x4e3045[_0x4caa('0x78')];});return db[_0x4caa('0x40')][_0x4caa('0x59')]({'where':{'id':_0x570548[_0x4caa('0x66')]['id']}})[_0x4caa('0x37')](function(_0x19b66a){return db['sequelize'][_0x4caa('0x7b')](function(_0x54e6d5){return _0x19b66a[_0x4caa('0x76')](_0xa84ccd,{'transaction':_0x54e6d5})['then'](function(){return BPromise[_0x4caa('0x7c')](_0x346e69,function(_0xb6b3d9){return db[_0x4caa('0x67')]['findOrCreate']({'where':{'UserId':_0xb6b3d9['id'],'ChatQueueId':_0x570548[_0x4caa('0x66')]['id']},'transaction':_0x54e6d5});});})[_0x4caa('0x37')](function(){_0x346e69['forEach'](function(_0x249420){socket[_0x4caa('0x7d')]('userChatQueue:save',{'UserId':_0x249420['id'],'ChatQueueId':_0x19b66a['id']});});});});});}})[_0x4caa('0x37')](respondWithStatusCode(_0x1b45eb,null))['catch'](handleError(_0x1b45eb,null));};exports[_0x4caa('0x7e')]=function(_0x223c03,_0x2827c6,_0x2db648){return db[_0x4caa('0x75')][_0x4caa('0x55')]({'where':{'id':_0x223c03['query'][_0x4caa('0x77')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x4caa('0x37')](handleEntityNotFound(_0x2827c6,null))[_0x4caa('0x37')](function(_0x5cedf0){var _0x1540f6=_[_0x4caa('0x3f')](_0x5cedf0,'id');var _0x250794=[];var _0x3b5c14=[];var _0x1f27f7=squel['select']();_0x1f27f7[_0x4caa('0x7f')](_0x4caa('0x80'))[_0x4caa('0x81')](_0x4caa('0x82'),'tq')[_0x4caa('0x83')]('user_has_teams','ut',_0x4caa('0x84'))[_0x4caa('0x4e')](_0x4caa('0x85'),_0x223c03[_0x4caa('0x66')]['id']);for(var _0x4e59b6=0x0;_0x4e59b6<_0x5cedf0[_0x4caa('0x58')];_0x4e59b6+=0x1){let _0x3c817a=_0x5cedf0[_0x4e59b6];for(var _0x2ef139=0x0;_0x2ef139<_0x3c817a[_0x4caa('0x78')][_0x4caa('0x58')];_0x2ef139+=0x1){let _0x4b8fd4=_0x3c817a[_0x4caa('0x78')][_0x2ef139];var _0x42f0cf=_0x1f27f7[_0x4caa('0x86')]();_0x42f0cf['where'](_0x4caa('0x87'),_0x4b8fd4['id']);_0x3b5c14['push'](db['sequelize'][_0x4caa('0x46')](_0x42f0cf[_0x4caa('0x88')](),{'type':db[_0x4caa('0x89')]['QueryTypes'][_0x4caa('0x8a')]})[_0x4caa('0x37')](function(_0x41807d){if(_0x41807d['length']===0x1){return _0x4b8fd4['id'];}else{var _0x5bd415=_['every'](_[_0x4caa('0x3f')](_0x41807d,_0x4caa('0x8b')),function(_0x48c79a){return _[_0x4caa('0x8c')](_0x1540f6,_0x48c79a);});if(_0x5bd415){return _0x4b8fd4['id'];}}}));}}return BPromise['all'](_0x3b5c14)[_0x4caa('0x37')](function(_0x5a7535){_0x250794=_(_0x250794)[_0x4caa('0x8d')](_0x5a7535)[_0x4caa('0x8e')]()[_0x4caa('0x8f')]();return db['ChatQueue'][_0x4caa('0x59')]({'where':{'id':_0x223c03['params']['id']}})[_0x4caa('0x37')](function(_0xc5cebf){return db['sequelize']['transaction'](function(_0x4de65f){return _0xc5cebf[_0x4caa('0x7e')](_0x223c03[_0x4caa('0x46')][_0x4caa('0x77')],{'transaction':_0x4de65f})['then'](function(){if(!_[_0x4caa('0x90')](_0x250794)){return _0xc5cebf[_0x4caa('0x91')](_0x250794,{'transaction':_0x4de65f});}})['then'](function(){_0x250794[_0x4caa('0x92')](function(_0x15893d){socket[_0x4caa('0x7d')](_0x4caa('0x93'),{'UserId':_0x15893d,'ChatQueueId':_0xc5cebf['id']});});});});});});})[_0x4caa('0x37')](respondWithStatusCode(_0x2827c6,null))[_0x4caa('0x5a')](handleError(_0x2827c6,null));};exports[_0x4caa('0x94')]=function(_0x25ed9a,_0x320d58,_0x34ae54){return db[_0x4caa('0x40')][_0x4caa('0x59')]({'where':{'id':_0x25ed9a[_0x4caa('0x66')]['id']}})[_0x4caa('0x37')](handleEntityNotFound(_0x320d58,null))[_0x4caa('0x37')](function(_0x4ae32e){if(_0x4ae32e){return _0x4ae32e[_0x4caa('0x94')](_0x25ed9a[_0x4caa('0x5c')]['ids'],_[_0x4caa('0x95')](_0x25ed9a[_0x4caa('0x5c')],[_0x4caa('0x77'),'id'])||{})[_0x4caa('0x96')](function(_0x2c0bd7){for(var _0xf7b83e=0x0;_0xf7b83e<_0x25ed9a[_0x4caa('0x5c')]['ids'][_0x4caa('0x58')];_0xf7b83e+=0x1){socket['emit'](_0x4caa('0x97'),{'UserId':Number(_0x25ed9a[_0x4caa('0x5c')][_0x4caa('0x77')][_0xf7b83e]),'ChatQueueId':Number(_0x25ed9a[_0x4caa('0x66')]['id'])});}return _0x2c0bd7;});}})[_0x4caa('0x37')](respondWithResult(_0x320d58,null))['catch'](handleError(_0x320d58,null));};exports[_0x4caa('0x91')]=function(_0x103606,_0x231c4e,_0x4d9c3a){return db[_0x4caa('0x40')][_0x4caa('0x59')]({'where':{'id':_0x103606[_0x4caa('0x66')]['id']}})[_0x4caa('0x37')](handleEntityNotFound(_0x231c4e,null))[_0x4caa('0x37')](function(_0x517c54){if(_0x517c54){return _0x517c54[_0x4caa('0x91')](_0x103606[_0x4caa('0x46')][_0x4caa('0x77')])[_0x4caa('0x37')](function(){if(_['isArray'](_0x103606['query'][_0x4caa('0x77')])){for(var _0x28f989=0x0;_0x28f989<_0x103606[_0x4caa('0x46')][_0x4caa('0x77')][_0x4caa('0x58')];_0x28f989+=0x1){socket[_0x4caa('0x7d')](_0x4caa('0x93'),{'UserId':Number(_0x103606[_0x4caa('0x46')][_0x4caa('0x77')][_0x28f989]),'ChatQueueId':Number(_0x103606[_0x4caa('0x66')]['id'])});}}else{socket['emit'](_0x4caa('0x93'),{'UserId':Number(_0x103606['query'][_0x4caa('0x77')]),'ChatQueueId':Number(_0x103606[_0x4caa('0x66')]['id'])});}});}})[_0x4caa('0x37')](respondWithStatusCode(_0x231c4e,null))[_0x4caa('0x5a')](handleError(_0x231c4e,null));};exports['getAgents']=function(_0x2c3279,_0x20c059,_0x597322){var _0x30b2a1={};var _0x4a8cb8={};var _0xcb0314;var _0x2018fb;return db[_0x4caa('0x40')]['findOne']({'where':{'id':_0x2c3279['params']['id']}})[_0x4caa('0x37')](handleEntityNotFound(_0x20c059,null))['then'](function(_0x3182d9){if(_0x3182d9){_0xcb0314=_0x3182d9;_0x4a8cb8['model']=_[_0x4caa('0x57')](db[_0x4caa('0x6a')]['rawAttributes']);_0x4a8cb8['query']=_['keys'](_0x2c3279[_0x4caa('0x46')]);_0x4a8cb8[_0x4caa('0x47')]=_[_0x4caa('0x48')](_0x4a8cb8[_0x4caa('0x45')],_0x4a8cb8[_0x4caa('0x46')]);_0x30b2a1[_0x4caa('0x49')]=_[_0x4caa('0x48')](_0x4a8cb8[_0x4caa('0x45')],qs[_0x4caa('0x4a')](_0x2c3279[_0x4caa('0x46')]['fields']));_0x30b2a1[_0x4caa('0x49')]=_0x30b2a1[_0x4caa('0x49')][_0x4caa('0x58')]?_0x30b2a1[_0x4caa('0x49')]:_0x4a8cb8['model'];_0x30b2a1[_0x4caa('0x98')]=qs['sort'](_0x2c3279[_0x4caa('0x46')][_0x4caa('0x4d')]);_0x30b2a1[_0x4caa('0x4e')]=qs[_0x4caa('0x47')](_[_0x4caa('0x4f')](_0x2c3279[_0x4caa('0x46')],_0x4a8cb8[_0x4caa('0x47')]));if(_0x2c3279[_0x4caa('0x46')][_0x4caa('0x50')]){_0x30b2a1[_0x4caa('0x4e')]=_[_0x4caa('0x51')](_0x30b2a1[_0x4caa('0x4e')],{'$or':_[_0x4caa('0x3f')](_0x30b2a1[_0x4caa('0x49')],function(_0x3d1b0b){var _0x8f85d5={};_0x8f85d5[_0x3d1b0b]={'$like':'%'+_0x2c3279[_0x4caa('0x46')][_0x4caa('0x50')]+'%'};return _0x8f85d5;})});}_0x30b2a1=_[_0x4caa('0x51')]({},_0x30b2a1,_0x2c3279[_0x4caa('0x69')]);return _0xcb0314[_0x4caa('0x99')](_0x30b2a1);}})[_0x4caa('0x37')](function(_0x53fb26){if(_0x53fb26){_0x2018fb=_0x53fb26[_0x4caa('0x58')];if(!_0x2c3279[_0x4caa('0x46')][_0x4caa('0x4b')](_0x4caa('0x4c'))){_0x30b2a1[_0x4caa('0x32')]=qs[_0x4caa('0x32')](_0x2c3279[_0x4caa('0x46')]['limit']);_0x30b2a1[_0x4caa('0x30')]=qs[_0x4caa('0x30')](_0x2c3279[_0x4caa('0x46')]['offset']);}return _0xcb0314[_0x4caa('0x99')](_0x30b2a1);}})[_0x4caa('0x37')](function(_0x2bb3e9){if(_0x2bb3e9){return _0x2bb3e9?{'count':_0x2018fb,'rows':_0x2bb3e9}:null;}})['then'](respondWithResult(_0x20c059,null))[_0x4caa('0x5a')](handleError(_0x20c059,null));}; \ No newline at end of file +var _0xdd9b=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','http','request','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','info','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','ChatQueues','UserProfileResource','end','stack','name','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','merge','create','body','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','from','team_has_chat_queues','user_has_teams','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','removeAgents','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce'];(function(_0x5c3282,_0x2116ff){var _0x50ea97=function(_0x11ca03){while(--_0x11ca03){_0x5c3282['push'](_0x5c3282['shift']());}};_0x50ea97(++_0x2116ff);}(_0xdd9b,0x1c0));var _0xbdd9=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xdd9b[_0x9df060];return _0x338dfe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbdd9('0x0'));var zipdir=require(_0xbdd9('0x1'));var jsonpatch=require(_0xbdd9('0x2'));var rp=require(_0xbdd9('0x3'));var moment=require(_0xbdd9('0x4'));var BPromise=require(_0xbdd9('0x5'));var Mustache=require('mustache');var util=require(_0xbdd9('0x6'));var path=require(_0xbdd9('0x7'));var sox=require(_0xbdd9('0x8'));var csv=require(_0xbdd9('0x9'));var ejs=require(_0xbdd9('0xa'));var fs=require('fs');var fs_extra=require(_0xbdd9('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbdd9('0xc'));var jsforce=require(_0xbdd9('0xd'));var deskjs=require(_0xbdd9('0xe'));var toCsv=require(_0xbdd9('0x9'));var querystring=require(_0xbdd9('0xf'));var Papa=require(_0xbdd9('0x10'));var Redis=require(_0xbdd9('0x11'));var authService=require(_0xbdd9('0x12'));var qs=require(_0xbdd9('0x13'));var as=require(_0xbdd9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbdd9('0x15'));var utils=require(_0xbdd9('0x16'));var config=require(_0xbdd9('0x17'));var licenseUtil=require(_0xbdd9('0x18'));var db=require(_0xbdd9('0x19'))['db'];config[_0xbdd9('0x1a')]=_[_0xbdd9('0x1b')](config[_0xbdd9('0x1a')],{'host':_0xbdd9('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbdd9('0x1a')]));require(_0xbdd9('0x1d'))[_0xbdd9('0x1e')](socket);var jayson=require(_0xbdd9('0x1f'));var client=jayson['client'][_0xbdd9('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x2f4694,_0x3f8009,_0x579671,_0x43bf58){return new BPromise(function(_0x102e35,_0x48601e){var _0x2d7692=_0x43bf58||client;return _0x2d7692[_0xbdd9('0x21')](_0x2f4694,_0x579671)['then'](function(_0x15e450){logger['info']('ChatQueue,\x20%s,\x20%s',_0x3f8009,_0xbdd9('0x22'));logger['debug'](_0xbdd9('0x23'),_0x3f8009,'request\x20sent',JSON[_0xbdd9('0x24')](_0x15e450));if(_0x15e450[_0xbdd9('0x25')]){if(_0x15e450['error'][_0xbdd9('0x26')]===0x1f4){logger[_0xbdd9('0x25')](_0xbdd9('0x27'),_0x3f8009,_0x15e450['error'][_0xbdd9('0x28')]);return _0x48601e(_0x15e450[_0xbdd9('0x25')][_0xbdd9('0x28')]);}logger[_0xbdd9('0x25')](_0xbdd9('0x27'),_0x3f8009,_0x15e450[_0xbdd9('0x25')]['message']);return _0x102e35(_0x15e450[_0xbdd9('0x25')][_0xbdd9('0x28')]);}else{logger[_0xbdd9('0x29')]('ChatQueue,\x20%s,\x20%s',_0x3f8009,_0xbdd9('0x22'));_0x102e35(_0x15e450[_0xbdd9('0x2a')]['message']);}})['catch'](function(_0x1bd6c3){logger[_0xbdd9('0x25')](_0xbdd9('0x27'),_0x3f8009,_0x1bd6c3);_0x48601e(_0x1bd6c3);});});}function respondWithStatusCode(_0x4dc9e9,_0x317ae1){_0x317ae1=_0x317ae1||0xcc;return function(_0x13b9c5){if(_0x13b9c5){return _0x4dc9e9[_0xbdd9('0x2b')](_0x317ae1);}return _0x4dc9e9[_0xbdd9('0x2c')](_0x317ae1)['end']();};}function respondWithResult(_0x19b02e,_0x1813c7){_0x1813c7=_0x1813c7||0xc8;return function(_0x12264a){if(_0x12264a){return _0x19b02e[_0xbdd9('0x2c')](_0x1813c7)[_0xbdd9('0x2d')](_0x12264a);}};}function respondWithFilteredResult(_0x5e9019,_0x2df708){return function(_0x3fe749){if(_0x3fe749){var _0xf1fdb4=typeof _0x2df708[_0xbdd9('0x2e')]===_0xbdd9('0x2f')&&typeof _0x2df708[_0xbdd9('0x30')]===_0xbdd9('0x2f');var _0x4843c7=_0x3fe749[_0xbdd9('0x31')];var _0x18c7fd=_0xf1fdb4?0x0:_0x2df708['offset'];var _0x9dfefd=_0xf1fdb4?_0x3fe749[_0xbdd9('0x31')]:_0x2df708['offset']+_0x2df708['limit'];var _0xe3be99;if(_0x9dfefd>=_0x4843c7){_0x9dfefd=_0x4843c7;_0xe3be99=0xc8;}else{_0xe3be99=0xce;}_0x5e9019[_0xbdd9('0x2c')](_0xe3be99);return _0x5e9019[_0xbdd9('0x32')](_0xbdd9('0x33'),_0x18c7fd+'-'+_0x9dfefd+'/'+_0x4843c7)[_0xbdd9('0x2d')](_0x3fe749);}return null;};}function patchUpdates(_0x25c216){return function(_0x2a709e){try{jsonpatch[_0xbdd9('0x34')](_0x2a709e,_0x25c216,!![]);}catch(_0x55f4a6){return BPromise[_0xbdd9('0x35')](_0x55f4a6);}return _0x2a709e['save']();};}function saveUpdates(_0x156ed0,_0x266670){return function(_0x40d2e3){if(_0x40d2e3){return _0x40d2e3[_0xbdd9('0x36')](_0x156ed0)[_0xbdd9('0x37')](function(_0x1c9c04){return _0x1c9c04;});}return null;};}function removeEntity(_0x4b5d5b,_0x413de1){return function(_0x40a452){if(_0x40a452){return _0x40a452[_0xbdd9('0x38')]()[_0xbdd9('0x37')](function(){var _0x2948f6=_0x40a452[_0xbdd9('0x39')]({'plain':!![]});var _0x1c5f2e=_0xbdd9('0x3a');return db[_0xbdd9('0x3b')]['destroy']({'where':{'type':_0x1c5f2e,'resourceId':_0x2948f6['id']}})[_0xbdd9('0x37')](function(){return _0x40a452;});})[_0xbdd9('0x37')](function(){_0x4b5d5b[_0xbdd9('0x2c')](0xcc)[_0xbdd9('0x3c')]();});}};}function handleEntityNotFound(_0x421e40,_0x18d77e){return function(_0x43debb){if(!_0x43debb){_0x421e40[_0xbdd9('0x2b')](0x194);}return _0x43debb;};}function handleError(_0x5e95f2,_0x51c219){_0x51c219=_0x51c219||0x1f4;return function(_0x54d914){logger[_0xbdd9('0x25')](_0x54d914[_0xbdd9('0x3d')]);if(_0x54d914[_0xbdd9('0x3e')]){delete _0x54d914[_0xbdd9('0x3e')];}_0x5e95f2[_0xbdd9('0x2c')](_0x51c219)['send'](_0x54d914);};}exports[_0xbdd9('0x3f')]=function(_0x42a36f,_0x4abe5d){var _0x11e374={},_0xb5c8a4={},_0x2dad9a={'count':0x0,'rows':[]};var _0x5180d3=_[_0xbdd9('0x40')](db[_0xbdd9('0x41')][_0xbdd9('0x42')],function(_0x3f68f3){return{'name':_0x3f68f3[_0xbdd9('0x43')],'type':_0x3f68f3[_0xbdd9('0x44')][_0xbdd9('0x45')]};});_0xb5c8a4[_0xbdd9('0x46')]=_[_0xbdd9('0x40')](_0x5180d3,_0xbdd9('0x3e'));_0xb5c8a4['query']=_[_0xbdd9('0x47')](_0x42a36f[_0xbdd9('0x48')]);_0xb5c8a4[_0xbdd9('0x49')]=_[_0xbdd9('0x4a')](_0xb5c8a4[_0xbdd9('0x46')],_0xb5c8a4[_0xbdd9('0x48')]);_0x11e374[_0xbdd9('0x4b')]=_[_0xbdd9('0x4a')](_0xb5c8a4[_0xbdd9('0x46')],qs[_0xbdd9('0x4c')](_0x42a36f[_0xbdd9('0x48')][_0xbdd9('0x4c')]));_0x11e374['attributes']=_0x11e374[_0xbdd9('0x4b')]['length']?_0x11e374[_0xbdd9('0x4b')]:_0xb5c8a4['model'];if(!_0x42a36f[_0xbdd9('0x48')][_0xbdd9('0x4d')](_0xbdd9('0x4e'))){_0x11e374['limit']=qs[_0xbdd9('0x30')](_0x42a36f[_0xbdd9('0x48')][_0xbdd9('0x30')]);_0x11e374[_0xbdd9('0x2e')]=qs[_0xbdd9('0x2e')](_0x42a36f[_0xbdd9('0x48')][_0xbdd9('0x2e')]);}_0x11e374[_0xbdd9('0x4f')]=qs['sort'](_0x42a36f[_0xbdd9('0x48')][_0xbdd9('0x50')]);_0x11e374[_0xbdd9('0x51')]=qs[_0xbdd9('0x49')](_[_0xbdd9('0x52')](_0x42a36f[_0xbdd9('0x48')],_0xb5c8a4[_0xbdd9('0x49')]),_0x5180d3);if(_0x42a36f[_0xbdd9('0x48')][_0xbdd9('0x53')]){_0x11e374[_0xbdd9('0x51')]=_['merge'](_0x11e374[_0xbdd9('0x51')],{'$or':_[_0xbdd9('0x40')](_0x5180d3,function(_0x3fa8f4){if(_0x3fa8f4['type']!==_0xbdd9('0x54')){var _0x206695={};_0x206695[_0x3fa8f4['name']]={'$like':'%'+_0x42a36f[_0xbdd9('0x48')][_0xbdd9('0x53')]+'%'};return _0x206695;}})});}_0x11e374=_['merge']({},_0x11e374,_0x42a36f[_0xbdd9('0x55')]);var _0x5b1125={'where':_0x11e374['where']};return db[_0xbdd9('0x41')]['count'](_0x5b1125)['then'](function(_0x4fc6a8){_0x2dad9a[_0xbdd9('0x31')]=_0x4fc6a8;if(_0x42a36f[_0xbdd9('0x48')][_0xbdd9('0x56')]){_0x11e374[_0xbdd9('0x57')]=[{'all':!![]}];}return db[_0xbdd9('0x41')][_0xbdd9('0x58')](_0x11e374);})[_0xbdd9('0x37')](function(_0x3ca114){_0x2dad9a[_0xbdd9('0x59')]=_0x3ca114;return _0x2dad9a;})[_0xbdd9('0x37')](respondWithFilteredResult(_0x4abe5d,_0x11e374))[_0xbdd9('0x5a')](handleError(_0x4abe5d,null));};exports[_0xbdd9('0x5b')]=function(_0x2944c2,_0x5d3023){var _0x58027d={'raw':!![],'where':{'id':_0x2944c2[_0xbdd9('0x5c')]['id']}},_0xfa0d00={};_0xfa0d00[_0xbdd9('0x46')]=_[_0xbdd9('0x47')](db[_0xbdd9('0x41')]['rawAttributes']);_0xfa0d00[_0xbdd9('0x48')]=_[_0xbdd9('0x47')](_0x2944c2[_0xbdd9('0x48')]);_0xfa0d00[_0xbdd9('0x49')]=_[_0xbdd9('0x4a')](_0xfa0d00[_0xbdd9('0x46')],_0xfa0d00['query']);_0x58027d['attributes']=_[_0xbdd9('0x4a')](_0xfa0d00[_0xbdd9('0x46')],qs[_0xbdd9('0x4c')](_0x2944c2[_0xbdd9('0x48')][_0xbdd9('0x4c')]));_0x58027d[_0xbdd9('0x4b')]=_0x58027d[_0xbdd9('0x4b')][_0xbdd9('0x5d')]?_0x58027d['attributes']:_0xfa0d00['model'];if(_0x2944c2[_0xbdd9('0x48')][_0xbdd9('0x56')]){_0x58027d['include']=[{'all':!![]}];}_0x58027d=_[_0xbdd9('0x5e')]({},_0x58027d,_0x2944c2['options']);return db[_0xbdd9('0x41')]['find'](_0x58027d)[_0xbdd9('0x37')](handleEntityNotFound(_0x5d3023,null))['then'](respondWithResult(_0x5d3023,null))['catch'](handleError(_0x5d3023,null));};exports[_0xbdd9('0x5f')]=function(_0x362a52,_0x2bb936){return db['ChatQueue'][_0xbdd9('0x5f')](_0x362a52[_0xbdd9('0x60')],{})[_0xbdd9('0x37')](function(_0x51d5db){var _0x165989=_0x362a52['user'][_0xbdd9('0x39')]({'plain':!![]});if(!_0x165989)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x165989[_0xbdd9('0x61')]===_0xbdd9('0x62')){var _0xc19d18=_0x51d5db[_0xbdd9('0x39')]({'plain':!![]});var _0x8150c5='ChatQueues';return db[_0xbdd9('0x63')][_0xbdd9('0x64')]({'where':{'name':_0x8150c5,'userProfileId':_0x165989[_0xbdd9('0x65')]},'raw':!![]})[_0xbdd9('0x37')](function(_0x2537fa){if(_0x2537fa&&_0x2537fa[_0xbdd9('0x66')]===0x0){return db[_0xbdd9('0x3b')][_0xbdd9('0x5f')]({'name':_0xc19d18[_0xbdd9('0x3e')],'resourceId':_0xc19d18['id'],'type':_0x2537fa[_0xbdd9('0x3e')],'sectionId':_0x2537fa['id']},{})[_0xbdd9('0x37')](function(){return _0x51d5db;});}else{return _0x51d5db;}})[_0xbdd9('0x5a')](function(_0x35397c){logger[_0xbdd9('0x25')](_0xbdd9('0x67'),_0x35397c);throw _0x35397c;});}return _0x51d5db;})[_0xbdd9('0x37')](respondWithResult(_0x2bb936,0xc9))['catch'](handleError(_0x2bb936,null));};exports['update']=function(_0x576b33,_0x590988){if(_0x576b33['body']['id']){delete _0x576b33[_0xbdd9('0x60')]['id'];}return db[_0xbdd9('0x41')][_0xbdd9('0x64')]({'where':{'id':_0x576b33[_0xbdd9('0x5c')]['id']}})[_0xbdd9('0x37')](handleEntityNotFound(_0x590988,null))[_0xbdd9('0x37')](saveUpdates(_0x576b33['body'],null))[_0xbdd9('0x37')](respondWithResult(_0x590988,null))['catch'](handleError(_0x590988,null));};exports[_0xbdd9('0x38')]=function(_0x210a01,_0x37d367){return db[_0xbdd9('0x41')][_0xbdd9('0x64')]({'where':{'id':_0x210a01[_0xbdd9('0x5c')]['id']}})['then'](handleEntityNotFound(_0x37d367,null))[_0xbdd9('0x37')](removeEntity(_0x37d367,null))['catch'](handleError(_0x37d367,null));};exports['describe']=function(_0x485614,_0x3bd89e){return db[_0xbdd9('0x41')][_0xbdd9('0x68')]()[_0xbdd9('0x37')](respondWithResult(_0x3bd89e,null))[_0xbdd9('0x5a')](handleError(_0x3bd89e,null));};exports[_0xbdd9('0x69')]=function(_0x55b1a7,_0x4f90a9,_0x433562){var _0x51432c={'raw':!![],'where':{}},_0x190265={},_0x1a7d49;return db[_0xbdd9('0x41')]['findOne']({'where':{'id':_0x55b1a7[_0xbdd9('0x5c')]['id']}})[_0xbdd9('0x37')](handleEntityNotFound(_0x4f90a9,null))['then'](function(_0x274812){if(_0x274812){_0x1a7d49=_0x274812[_0xbdd9('0x39')]({'plain':!![]});_0x190265['model']=_[_0xbdd9('0x47')](db[_0xbdd9('0x6a')][_0xbdd9('0x42')]);_0x190265[_0xbdd9('0x48')]=_[_0xbdd9('0x47')](_0x55b1a7[_0xbdd9('0x48')]);_0x190265[_0xbdd9('0x49')]=_['intersection'](_0x190265[_0xbdd9('0x46')],_0x190265[_0xbdd9('0x48')]);_0x51432c['attributes']=_['intersection'](_0x190265[_0xbdd9('0x46')],qs[_0xbdd9('0x4c')](_0x55b1a7[_0xbdd9('0x48')][_0xbdd9('0x4c')]));_0x51432c['attributes']=_0x51432c['attributes'][_0xbdd9('0x5d')]?_0x51432c['attributes']:_0x190265[_0xbdd9('0x46')];if(!_0x55b1a7[_0xbdd9('0x48')][_0xbdd9('0x4d')](_0xbdd9('0x4e'))){_0x51432c['limit']=qs['limit'](_0x55b1a7['query'][_0xbdd9('0x30')]);_0x51432c[_0xbdd9('0x2e')]=qs['offset'](_0x55b1a7[_0xbdd9('0x48')][_0xbdd9('0x2e')]);}_0x51432c[_0xbdd9('0x4f')]=qs[_0xbdd9('0x50')](_0x55b1a7[_0xbdd9('0x48')][_0xbdd9('0x50')]);_0x51432c[_0xbdd9('0x51')]=qs[_0xbdd9('0x49')](_[_0xbdd9('0x52')](_0x55b1a7['query'],_0x190265[_0xbdd9('0x49')]));_0x51432c['where'][_0xbdd9('0x6b')]=_0x274812['id'];if(_0x55b1a7[_0xbdd9('0x48')][_0xbdd9('0x53')]){_0x51432c[_0xbdd9('0x51')]=_['merge'](_0x51432c[_0xbdd9('0x51')],{'$or':_[_0xbdd9('0x40')](_0x51432c['attributes'],function(_0xa79340){var _0x2fdcea={};_0x2fdcea[_0xa79340]={'$like':'%'+_0x55b1a7[_0xbdd9('0x48')][_0xbdd9('0x53')]+'%'};return _0x2fdcea;})});}_0x51432c=_[_0xbdd9('0x5e')]({},_0x51432c,_0x55b1a7[_0xbdd9('0x55')]);return db[_0xbdd9('0x6a')]['findAll'](_0x51432c);}})[_0xbdd9('0x37')](function(_0xef4523){if(_0xef4523){return db[_0xbdd9('0x6c')][_0xbdd9('0x6d')]({'where':{'id':_[_0xbdd9('0x40')](_0xef4523,_0xbdd9('0x6e')),'role':_0xbdd9('0x6f')},'attributes':['id',_0xbdd9('0x3e'),_0xbdd9('0x70'),_0xbdd9('0x71'),'createdAt']});}})[_0xbdd9('0x37')](function(_0x40c16d){if(_0x40c16d){return{'count':_0x40c16d['count'],'rows':_['map'](_0x40c16d[_0xbdd9('0x59')],function(_0x3c3d89){return{'membername':_0x3c3d89[_0xbdd9('0x3e')],'UserId':_0x3c3d89['id'],'queue_name':_0x1a7d49[_0xbdd9('0x3e')],'ChatQueueId':_0x1a7d49['id'],'interface':util['format'](_0xbdd9('0x72'),_0xbdd9('0x73'),_0x3c3d89[_0xbdd9('0x3e')]),'penalty':0x0,'paused':_0x3c3d89[_0xbdd9('0x70')],'createdAt':_0x3c3d89['createdAt'],'updatedAt':_0x3c3d89[_0xbdd9('0x71')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbdd9('0x37')](respondWithFilteredResult(_0x4f90a9,_0x51432c))[_0xbdd9('0x5a')](handleError(_0x4f90a9,null));};exports[_0xbdd9('0x74')]=function(_0x3e2aef,_0x5b6aec,_0x572c5a){var _0x37cc64={};var _0x445d46={};var _0x2643e9;var _0x48d226;return db['ChatQueue'][_0xbdd9('0x75')]({'where':{'id':_0x3e2aef['params']['id']}})[_0xbdd9('0x37')](handleEntityNotFound(_0x5b6aec,null))[_0xbdd9('0x37')](function(_0x134468){if(_0x134468){_0x2643e9=_0x134468;_0x445d46[_0xbdd9('0x46')]=_['keys'](db[_0xbdd9('0x76')]['rawAttributes']);_0x445d46['query']=_[_0xbdd9('0x47')](_0x3e2aef[_0xbdd9('0x48')]);_0x445d46[_0xbdd9('0x49')]=_['intersection'](_0x445d46[_0xbdd9('0x46')],_0x445d46[_0xbdd9('0x48')]);_0x37cc64[_0xbdd9('0x4b')]=_[_0xbdd9('0x4a')](_0x445d46[_0xbdd9('0x46')],qs[_0xbdd9('0x4c')](_0x3e2aef[_0xbdd9('0x48')][_0xbdd9('0x4c')]));_0x37cc64[_0xbdd9('0x4b')]=_0x37cc64['attributes'][_0xbdd9('0x5d')]?_0x37cc64[_0xbdd9('0x4b')]:_0x445d46[_0xbdd9('0x46')];_0x37cc64[_0xbdd9('0x4f')]=qs['sort'](_0x3e2aef['query'][_0xbdd9('0x50')]);_0x37cc64[_0xbdd9('0x51')]=qs['filters'](_[_0xbdd9('0x52')](_0x3e2aef[_0xbdd9('0x48')],_0x445d46[_0xbdd9('0x49')]));if(_0x3e2aef['query'][_0xbdd9('0x53')]){_0x37cc64[_0xbdd9('0x51')]=_[_0xbdd9('0x5e')](_0x37cc64[_0xbdd9('0x51')],{'$or':_['map'](_0x37cc64['attributes'],function(_0x5d27cb){var _0x5ab707={};_0x5ab707[_0x5d27cb]={'$like':'%'+_0x3e2aef[_0xbdd9('0x48')][_0xbdd9('0x53')]+'%'};return _0x5ab707;})});}_0x37cc64=_['merge']({},_0x37cc64,_0x3e2aef[_0xbdd9('0x55')]);return _0x2643e9[_0xbdd9('0x74')](_0x37cc64);}})['then'](function(_0xad4be5){if(_0xad4be5){_0x48d226=_0xad4be5[_0xbdd9('0x5d')];if(!_0x3e2aef[_0xbdd9('0x48')][_0xbdd9('0x4d')](_0xbdd9('0x4e'))){_0x37cc64[_0xbdd9('0x30')]=qs['limit'](_0x3e2aef[_0xbdd9('0x48')]['limit']);_0x37cc64[_0xbdd9('0x2e')]=qs[_0xbdd9('0x2e')](_0x3e2aef['query']['offset']);}return _0x2643e9[_0xbdd9('0x74')](_0x37cc64);}})[_0xbdd9('0x37')](function(_0x7de571){if(_0x7de571){return _0x7de571?{'count':_0x48d226,'rows':_0x7de571}:null;}})[_0xbdd9('0x37')](respondWithResult(_0x5b6aec,null))[_0xbdd9('0x5a')](handleError(_0x5b6aec,null));};exports[_0xbdd9('0x77')]=function(_0xa3680c,_0x7645c5,_0x19c161){var _0x23b039=_0xa3680c[_0xbdd9('0x60')][_0xbdd9('0x78')];return db[_0xbdd9('0x76')][_0xbdd9('0x58')]({'where':{'id':_0x23b039},'attributes':['id'],'include':[{'model':db[_0xbdd9('0x6c')],'as':_0xbdd9('0x79'),'attributes':['id',_0xbdd9('0x3e'),_0xbdd9('0x7a'),_0xbdd9('0x7b'),'interface'],'raw':!![]}]})[_0xbdd9('0x37')](function(_0x2bc681){if(_0x2bc681){var _0x3dc1c8=_['flatMap'](_0x2bc681,function(_0x4b3f4f){var _0x13320d=_0x4b3f4f[_0xbdd9('0x39')]({'plain':!![]});return _0x13320d['Agents'];});return db[_0xbdd9('0x41')]['find']({'where':{'id':_0xa3680c['params']['id']}})[_0xbdd9('0x37')](function(_0x29d60b){return db['sequelize'][_0xbdd9('0x7c')](function(_0x596813){return _0x29d60b[_0xbdd9('0x77')](_0x23b039,{'transaction':_0x596813})['then'](function(){return BPromise[_0xbdd9('0x7d')](_0x3dc1c8,function(_0x34a302){return db[_0xbdd9('0x6a')][_0xbdd9('0x7e')]({'where':{'UserId':_0x34a302['id'],'ChatQueueId':_0xa3680c[_0xbdd9('0x5c')]['id']},'transaction':_0x596813});});})[_0xbdd9('0x37')](function(){_0x3dc1c8[_0xbdd9('0x7f')](function(_0x1cabdf){socket[_0xbdd9('0x80')]('userChatQueue:save',{'UserId':_0x1cabdf['id'],'ChatQueueId':_0x29d60b['id']});});});});});}})[_0xbdd9('0x37')](respondWithStatusCode(_0x7645c5,null))[_0xbdd9('0x5a')](handleError(_0x7645c5,null));};exports[_0xbdd9('0x81')]=function(_0x2b4170,_0x585e3d,_0x131382){return db['Team']['findAll']({'where':{'id':_0x2b4170[_0xbdd9('0x48')][_0xbdd9('0x78')]},'attributes':['id'],'include':[{'model':db[_0xbdd9('0x6c')],'as':_0xbdd9('0x79'),'attributes':['id'],'raw':!![]}]})[_0xbdd9('0x37')](handleEntityNotFound(_0x585e3d,null))['then'](function(_0x5e24fb){var _0x118d29=_['map'](_0x5e24fb,'id');var _0x4e9083=[];var _0xb640de=[];var _0x1f548e=squel[_0xbdd9('0x82')]();_0x1f548e[_0xbdd9('0x83')]('tq.TeamId')[_0xbdd9('0x84')](_0xbdd9('0x85'),'tq')['join'](_0xbdd9('0x86'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xbdd9('0x51')]('ChatQueueId\x20=\x20?',_0x2b4170[_0xbdd9('0x5c')]['id']);for(var _0x236b09=0x0;_0x236b09<_0x5e24fb[_0xbdd9('0x5d')];_0x236b09+=0x1){let _0x5ade5c=_0x5e24fb[_0x236b09];for(var _0x209746=0x0;_0x209746<_0x5ade5c['Agents'][_0xbdd9('0x5d')];_0x209746+=0x1){let _0xa7befb=_0x5ade5c[_0xbdd9('0x79')][_0x209746];var _0x49d52d=_0x1f548e['clone']();_0x49d52d[_0xbdd9('0x51')](_0xbdd9('0x87'),_0xa7befb['id']);_0xb640de[_0xbdd9('0x88')](db[_0xbdd9('0x89')][_0xbdd9('0x48')](_0x49d52d[_0xbdd9('0x8a')](),{'type':db[_0xbdd9('0x89')][_0xbdd9('0x8b')][_0xbdd9('0x8c')]})[_0xbdd9('0x37')](function(_0x29485c){if(_0x29485c[_0xbdd9('0x5d')]===0x1){return _0xa7befb['id'];}else{var _0xcb50d7=_[_0xbdd9('0x8d')](_[_0xbdd9('0x40')](_0x29485c,_0xbdd9('0x8e')),function(_0x6642bc){return _[_0xbdd9('0x8f')](_0x118d29,_0x6642bc);});if(_0xcb50d7){return _0xa7befb['id'];}}}));}}return BPromise['all'](_0xb640de)['then'](function(_0x1f01d5){_0x4e9083=_(_0x4e9083)[_0xbdd9('0x90')](_0x1f01d5)[_0xbdd9('0x91')]()[_0xbdd9('0x92')]();return db['ChatQueue'][_0xbdd9('0x64')]({'where':{'id':_0x2b4170[_0xbdd9('0x5c')]['id']}})[_0xbdd9('0x37')](function(_0x4bc0d6){return db[_0xbdd9('0x89')][_0xbdd9('0x7c')](function(_0x1d1a70){return _0x4bc0d6[_0xbdd9('0x81')](_0x2b4170['query'][_0xbdd9('0x78')],{'transaction':_0x1d1a70})['then'](function(){if(!_['isEmpty'](_0x4e9083)){return _0x4bc0d6[_0xbdd9('0x93')](_0x4e9083,{'transaction':_0x1d1a70});}})[_0xbdd9('0x37')](function(){_0x4e9083['forEach'](function(_0x4f69f2){socket['emit'](_0xbdd9('0x94'),{'UserId':_0x4f69f2,'ChatQueueId':_0x4bc0d6['id']});});});});});});})[_0xbdd9('0x37')](respondWithStatusCode(_0x585e3d,null))[_0xbdd9('0x5a')](handleError(_0x585e3d,null));};exports['addAgents']=function(_0x26d5e5,_0xc0a246,_0x3bca4c){return db[_0xbdd9('0x41')][_0xbdd9('0x64')]({'where':{'id':_0x26d5e5[_0xbdd9('0x5c')]['id']}})[_0xbdd9('0x37')](handleEntityNotFound(_0xc0a246,null))[_0xbdd9('0x37')](function(_0x3321bd){if(_0x3321bd){return _0x3321bd[_0xbdd9('0x95')](_0x26d5e5[_0xbdd9('0x60')][_0xbdd9('0x78')],_[_0xbdd9('0x96')](_0x26d5e5[_0xbdd9('0x60')],[_0xbdd9('0x78'),'id'])||{})[_0xbdd9('0x97')](function(_0x8f1998){for(var _0x2be2fc=0x0;_0x2be2fc<_0x26d5e5[_0xbdd9('0x60')]['ids'][_0xbdd9('0x5d')];_0x2be2fc+=0x1){socket['emit'](_0xbdd9('0x98'),{'UserId':Number(_0x26d5e5[_0xbdd9('0x60')][_0xbdd9('0x78')][_0x2be2fc]),'ChatQueueId':Number(_0x26d5e5['params']['id'])});}return _0x8f1998;});}})[_0xbdd9('0x37')](respondWithResult(_0xc0a246,null))[_0xbdd9('0x5a')](handleError(_0xc0a246,null));};exports['removeAgents']=function(_0x4d4d46,_0x5c5b72,_0x33696d){return db[_0xbdd9('0x41')][_0xbdd9('0x64')]({'where':{'id':_0x4d4d46[_0xbdd9('0x5c')]['id']}})[_0xbdd9('0x37')](handleEntityNotFound(_0x5c5b72,null))['then'](function(_0x99613b){if(_0x99613b){return _0x99613b[_0xbdd9('0x93')](_0x4d4d46[_0xbdd9('0x48')]['ids'])[_0xbdd9('0x37')](function(){if(_['isArray'](_0x4d4d46[_0xbdd9('0x48')][_0xbdd9('0x78')])){for(var _0x48ce8f=0x0;_0x48ce8f<_0x4d4d46[_0xbdd9('0x48')][_0xbdd9('0x78')][_0xbdd9('0x5d')];_0x48ce8f+=0x1){socket[_0xbdd9('0x80')](_0xbdd9('0x94'),{'UserId':Number(_0x4d4d46['query']['ids'][_0x48ce8f]),'ChatQueueId':Number(_0x4d4d46[_0xbdd9('0x5c')]['id'])});}}else{socket[_0xbdd9('0x80')](_0xbdd9('0x94'),{'UserId':Number(_0x4d4d46['query']['ids']),'ChatQueueId':Number(_0x4d4d46[_0xbdd9('0x5c')]['id'])});}});}})[_0xbdd9('0x37')](respondWithStatusCode(_0x5c5b72,null))[_0xbdd9('0x5a')](handleError(_0x5c5b72,null));};exports[_0xbdd9('0x99')]=function(_0x2c8c2e,_0x125149,_0x1285f3){var _0x8f787d={};var _0x2484d4={};var _0x55ec5b;var _0x314e66;return db[_0xbdd9('0x41')][_0xbdd9('0x75')]({'where':{'id':_0x2c8c2e[_0xbdd9('0x5c')]['id']}})[_0xbdd9('0x37')](handleEntityNotFound(_0x125149,null))[_0xbdd9('0x37')](function(_0x51b4d0){if(_0x51b4d0){_0x55ec5b=_0x51b4d0;_0x2484d4[_0xbdd9('0x46')]=_[_0xbdd9('0x47')](db[_0xbdd9('0x6c')][_0xbdd9('0x42')]);_0x2484d4[_0xbdd9('0x48')]=_[_0xbdd9('0x47')](_0x2c8c2e[_0xbdd9('0x48')]);_0x2484d4['filters']=_[_0xbdd9('0x4a')](_0x2484d4[_0xbdd9('0x46')],_0x2484d4[_0xbdd9('0x48')]);_0x8f787d[_0xbdd9('0x4b')]=_[_0xbdd9('0x4a')](_0x2484d4[_0xbdd9('0x46')],qs[_0xbdd9('0x4c')](_0x2c8c2e['query'][_0xbdd9('0x4c')]));_0x8f787d[_0xbdd9('0x4b')]=_0x8f787d[_0xbdd9('0x4b')]['length']?_0x8f787d[_0xbdd9('0x4b')]:_0x2484d4[_0xbdd9('0x46')];_0x8f787d[_0xbdd9('0x4f')]=qs[_0xbdd9('0x50')](_0x2c8c2e['query']['sort']);_0x8f787d['where']=qs[_0xbdd9('0x49')](_[_0xbdd9('0x52')](_0x2c8c2e[_0xbdd9('0x48')],_0x2484d4[_0xbdd9('0x49')]));if(_0x2c8c2e[_0xbdd9('0x48')][_0xbdd9('0x53')]){_0x8f787d[_0xbdd9('0x51')]=_[_0xbdd9('0x5e')](_0x8f787d[_0xbdd9('0x51')],{'$or':_['map'](_0x8f787d[_0xbdd9('0x4b')],function(_0x5d2ebb){var _0x4d0d99={};_0x4d0d99[_0x5d2ebb]={'$like':'%'+_0x2c8c2e['query']['filter']+'%'};return _0x4d0d99;})});}_0x8f787d=_[_0xbdd9('0x5e')]({},_0x8f787d,_0x2c8c2e['options']);return _0x55ec5b[_0xbdd9('0x99')](_0x8f787d);}})[_0xbdd9('0x37')](function(_0x446d3a){if(_0x446d3a){_0x314e66=_0x446d3a[_0xbdd9('0x5d')];if(!_0x2c8c2e[_0xbdd9('0x48')][_0xbdd9('0x4d')](_0xbdd9('0x4e'))){_0x8f787d[_0xbdd9('0x30')]=qs['limit'](_0x2c8c2e[_0xbdd9('0x48')][_0xbdd9('0x30')]);_0x8f787d[_0xbdd9('0x2e')]=qs[_0xbdd9('0x2e')](_0x2c8c2e['query']['offset']);}return _0x55ec5b['getAgents'](_0x8f787d);}})[_0xbdd9('0x37')](function(_0x2b7c06){if(_0x2b7c06){return _0x2b7c06?{'count':_0x314e66,'rows':_0x2b7c06}:null;}})[_0xbdd9('0x37')](respondWithResult(_0x125149,null))['catch'](handleError(_0x125149,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 27e7661..fccdd81 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 _0xffaf=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','save','update'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0xffaf,0x1c6));var _0xfffa=function(_0x151381,_0x97b314){_0x151381=_0x151381-0x0;var _0x2afab6=_0xffaf[_0x151381];return _0x2afab6;};'use strict';var EventEmitter=require(_0xfffa('0x0'));var ChatQueue=require(_0xfffa('0x1'))['db'][_0xfffa('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfffa('0x3'),'afterUpdate':_0xfffa('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2e5951){return function(_0x449a83,_0x110505,_0x5b9a5b){ChatQueueEvents['emit'](_0x2e5951+':'+_0x449a83['id'],_0x449a83);ChatQueueEvents[_0xfffa('0x5')](_0x2e5951,_0x449a83);_0x5b9a5b(null);};}for(var e in events){if(events[_0xfffa('0x6')](e)){var event=events[e];ChatQueue[_0xfffa('0x7')](e,emitEvent(event));}}module[_0xfffa('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0x3b58=['events','../../mysqldb','ChatQueue','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4b4434,_0x405997){var _0x4cf8f2=function(_0x197055){while(--_0x197055){_0x4b4434['push'](_0x4b4434['shift']());}};_0x4cf8f2(++_0x405997);}(_0x3b58,0x1c0));var _0x83b5=function(_0x197bec,_0x46730b){_0x197bec=_0x197bec-0x0;var _0x112e77=_0x3b58[_0x197bec];return _0x112e77;};'use strict';var EventEmitter=require(_0x83b5('0x0'));var ChatQueue=require(_0x83b5('0x1'))['db'][_0x83b5('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x83b5('0x3')};function emitEvent(_0x189eb8){return function(_0x4154b6,_0x4d16ce,_0x29e2bc){ChatQueueEvents[_0x83b5('0x4')](_0x189eb8+':'+_0x4154b6['id'],_0x4154b6);ChatQueueEvents[_0x83b5('0x4')](_0x189eb8,_0x4154b6);_0x29e2bc(null);};}for(var e in events){if(events[_0x83b5('0x5')](e)){var event=events[e];ChatQueue[_0x83b5('0x6')](e,emitEvent(event));}}module[_0x83b5('0x7')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index e34b378..48e1d5d 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 _0xaba7=['chat_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue'];(function(_0x1f8f48,_0x64b486){var _0x54e786=function(_0x1db500){while(--_0x1db500){_0x1f8f48['push'](_0x1f8f48['shift']());}};_0x54e786(++_0x64b486);}(_0xaba7,0x7f));var _0x7aba=function(_0x3eb671,_0x1f2c1d){_0x3eb671=_0x3eb671-0x0;var _0x41eac5=_0xaba7[_0x3eb671];return _0x41eac5;};'use strict';var _=require(_0x7aba('0x0'));var util=require(_0x7aba('0x1'));var logger=require(_0x7aba('0x2'))(_0x7aba('0x3'));var moment=require(_0x7aba('0x4'));var BPromise=require('bluebird');var rp=require(_0x7aba('0x5'));var fs=require('fs');var path=require(_0x7aba('0x6'));var rimraf=require(_0x7aba('0x7'));var config=require(_0x7aba('0x8'));var attributes=require(_0x7aba('0x9'));module[_0x7aba('0xa')]=function(_0x454306,_0x20e812){return _0x454306[_0x7aba('0xb')](_0x7aba('0xc'),attributes,{'tableName':_0x7aba('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x980d=['../../config/environment','./chatQueue.attributes','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x25f8f7,_0x54f3a0){var _0x304db2=function(_0x510337){while(--_0x510337){_0x25f8f7['push'](_0x25f8f7['shift']());}};_0x304db2(++_0x54f3a0);}(_0x980d,0x118));var _0xd980=function(_0x420d8d,_0x78b67f){_0x420d8d=_0x420d8d-0x0;var _0x4865d7=_0x980d[_0x420d8d];return _0x4865d7;};'use strict';var _=require(_0xd980('0x0'));var util=require(_0xd980('0x1'));var logger=require(_0xd980('0x2'))(_0xd980('0x3'));var moment=require(_0xd980('0x4'));var BPromise=require(_0xd980('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd980('0x6'));var rimraf=require(_0xd980('0x7'));var config=require(_0xd980('0x8'));var attributes=require(_0xd980('0x9'));module['exports']=function(_0x4b1113,_0x4e813a){return _0x4b1113['define'](_0xd980('0xa'),attributes,{'tableName':_0xd980('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index db664d2..fffb9a6 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 _0xcc1b=['where','attributes','limit','include','map','model','stringify','ShowChatQueue','raw','then','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','redis','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options'];(function(_0x634cd,_0x5b70ba){var _0x1d0f39=function(_0x7a804){while(--_0x7a804){_0x634cd['push'](_0x634cd['shift']());}};_0x1d0f39(++_0x5b70ba);}(_0xcc1b,0x100));var _0xbcc1=function(_0x5c4e2f,_0x56b4be){_0x5c4e2f=_0x5c4e2f-0x0;var _0x416c5d=_0xcc1b[_0x5c4e2f];return _0x416c5d;};'use strict';var _=require(_0xbcc1('0x0'));var util=require('util');var moment=require(_0xbcc1('0x1'));var BPromise=require(_0xbcc1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbcc1('0x3'));var db=require(_0xbcc1('0x4'))['db'];var utils=require(_0xbcc1('0x5'));var logger=require(_0xbcc1('0x6'))(_0xbcc1('0x7'));var config=require(_0xbcc1('0x8'));var jayson=require(_0xbcc1('0x9'));var client=jayson[_0xbcc1('0xa')][_0xbcc1('0xb')]({'port':0x232a});config['redis']=_[_0xbcc1('0xc')](config['redis'],{'host':_0xbcc1('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbcc1('0xe')]));require(_0xbcc1('0xf'))[_0xbcc1('0x10')](socket);function respondWithRpcPromise(_0x5246a6,_0x140097,_0x51df1a){return new BPromise(function(_0x539124,_0x566fb1){return client[_0xbcc1('0x11')](_0x5246a6,_0x51df1a)['then'](function(_0x3a6d31){logger[_0xbcc1('0x12')](_0xbcc1('0x13'),_0x140097,_0xbcc1('0x14'));logger[_0xbcc1('0x15')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x140097,_0xbcc1('0x14'),JSON['stringify'](_0x3a6d31));if(_0x3a6d31[_0xbcc1('0x16')]){if(_0x3a6d31[_0xbcc1('0x16')][_0xbcc1('0x17')]===0x1f4){logger[_0xbcc1('0x16')](_0xbcc1('0x13'),_0x140097,_0x3a6d31[_0xbcc1('0x16')][_0xbcc1('0x18')]);return _0x566fb1(_0x3a6d31['error'][_0xbcc1('0x18')]);}logger[_0xbcc1('0x16')](_0xbcc1('0x13'),_0x140097,_0x3a6d31[_0xbcc1('0x16')][_0xbcc1('0x18')]);return _0x539124(_0x3a6d31[_0xbcc1('0x16')][_0xbcc1('0x18')]);}else{logger['info'](_0xbcc1('0x13'),_0x140097,'request\x20sent');_0x539124(_0x3a6d31[_0xbcc1('0x19')][_0xbcc1('0x18')]);}})[_0xbcc1('0x1a')](function(_0x3d0e2b){logger[_0xbcc1('0x16')](_0xbcc1('0x13'),_0x140097,_0x3d0e2b);_0x566fb1(_0x3d0e2b);});});}exports[_0xbcc1('0x1b')]=function(_0x1e4372){var _0x1511ec=this;return new Promise(function(_0x27df99,_0x1717c8){return db[_0xbcc1('0x1c')][_0xbcc1('0x1d')]({'raw':_0x1e4372[_0xbcc1('0x1e')]?_0x1e4372['options']['raw']===undefined?!![]:![]:!![],'where':_0x1e4372[_0xbcc1('0x1e')]?_0x1e4372[_0xbcc1('0x1e')][_0xbcc1('0x1f')]||null:null,'attributes':_0x1e4372[_0xbcc1('0x1e')]?_0x1e4372[_0xbcc1('0x1e')][_0xbcc1('0x20')]||null:null,'limit':_0x1e4372['options']?_0x1e4372[_0xbcc1('0x1e')][_0xbcc1('0x21')]||null:null,'include':_0x1e4372[_0xbcc1('0x1e')]?_0x1e4372[_0xbcc1('0x1e')][_0xbcc1('0x22')]?_[_0xbcc1('0x23')](_0x1e4372[_0xbcc1('0x1e')][_0xbcc1('0x22')],function(_0x2f6325){return{'model':db[_0x2f6325[_0xbcc1('0x24')]],'as':_0x2f6325['as'],'attributes':_0x2f6325[_0xbcc1('0x20')],'include':_0x2f6325[_0xbcc1('0x22')]?_['map'](_0x2f6325[_0xbcc1('0x22')],function(_0x576054){return{'model':db[_0x576054[_0xbcc1('0x24')]],'as':_0x576054['as'],'attributes':_0x576054[_0xbcc1('0x20')],'include':_0x576054[_0xbcc1('0x22')]?_[_0xbcc1('0x23')](_0x576054[_0xbcc1('0x22')],function(_0x21dc90){return{'model':db[_0x21dc90[_0xbcc1('0x24')]],'as':_0x21dc90['as'],'attributes':_0x21dc90['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b3f06){logger[_0xbcc1('0x12')](_0xbcc1('0x1b'),_0x1e4372);logger[_0xbcc1('0x15')](_0xbcc1('0x1b'),_0x1e4372,JSON[_0xbcc1('0x25')](_0x2b3f06));_0x27df99(_0x2b3f06);})[_0xbcc1('0x1a')](function(_0x12e884){logger[_0xbcc1('0x16')](_0xbcc1('0x1b'),_0x12e884[_0xbcc1('0x18')],_0x1e4372);_0x1717c8(_0x1511ec[_0xbcc1('0x16')](0x1f4,_0x12e884[_0xbcc1('0x18')]));});});};exports[_0xbcc1('0x26')]=function(_0x54022f){var _0x122966=this;return new Promise(function(_0x2325e5,_0x1934ed){return db[_0xbcc1('0x1c')]['find']({'raw':_0x54022f[_0xbcc1('0x1e')]?_0x54022f[_0xbcc1('0x1e')][_0xbcc1('0x27')]===undefined?!![]:![]:!![],'where':_0x54022f[_0xbcc1('0x1e')]?_0x54022f[_0xbcc1('0x1e')][_0xbcc1('0x1f')]||null:null,'attributes':_0x54022f[_0xbcc1('0x1e')]?_0x54022f[_0xbcc1('0x1e')][_0xbcc1('0x20')]||null:null,'include':_0x54022f[_0xbcc1('0x1e')]?_0x54022f['options'][_0xbcc1('0x22')]?_['map'](_0x54022f['options'][_0xbcc1('0x22')],function(_0x4c7206){return{'model':db[_0x4c7206[_0xbcc1('0x24')]],'as':_0x4c7206['as'],'attributes':_0x4c7206[_0xbcc1('0x20')],'include':_0x4c7206['include']?_[_0xbcc1('0x23')](_0x4c7206[_0xbcc1('0x22')],function(_0x326345){return{'model':db[_0x326345[_0xbcc1('0x24')]],'as':_0x326345['as'],'attributes':_0x326345[_0xbcc1('0x20')],'include':_0x326345['include']?_[_0xbcc1('0x23')](_0x326345[_0xbcc1('0x22')],function(_0x10af56){return{'model':db[_0x10af56[_0xbcc1('0x24')]],'as':_0x10af56['as'],'attributes':_0x10af56[_0xbcc1('0x20')]};}):[]};}):[]};}):[]:[]})[_0xbcc1('0x28')](function(_0x522f6a){logger['info'](_0xbcc1('0x26'),_0x54022f);logger['debug'](_0xbcc1('0x26'),_0x54022f,JSON[_0xbcc1('0x25')](_0x522f6a));_0x2325e5(_0x522f6a);})[_0xbcc1('0x1a')](function(_0x13fe9c){logger[_0xbcc1('0x16')]('ShowChatQueue',_0x13fe9c[_0xbcc1('0x18')],_0x54022f);_0x1934ed(_0x122966[_0xbcc1('0x16')](0x1f4,_0x13fe9c[_0xbcc1('0x18')]));});});}; \ No newline at end of file +var _0x62ba=['stringify','ShowChatQueue','ChatQueue','find','model','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','info','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','GetChatQueue','findAll','raw','where','options','attributes','limit','include','map','then'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x62ba,0x1cd));var _0xa62b=function(_0x3c1d68,_0x44cce2){_0x3c1d68=_0x3c1d68-0x0;var _0x19c5aa=_0x62ba[_0x3c1d68];return _0x19c5aa;};'use strict';var _=require(_0xa62b('0x0'));var util=require('util');var moment=require(_0xa62b('0x1'));var BPromise=require(_0xa62b('0x2'));var rs=require(_0xa62b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa62b('0x4'));var logger=require(_0xa62b('0x5'))('rpc');var config=require(_0xa62b('0x6'));var jayson=require(_0xa62b('0x7'));var client=jayson[_0xa62b('0x8')]['http']({'port':0x232a});config[_0xa62b('0x9')]=_[_0xa62b('0xa')](config[_0xa62b('0x9')],{'host':_0xa62b('0xb'),'port':0x18eb});var socket=require(_0xa62b('0xc'))(new Redis(config[_0xa62b('0x9')]));require(_0xa62b('0xd'))['register'](socket);function respondWithRpcPromise(_0x46d9f8,_0x2805b8,_0xea0432){return new BPromise(function(_0xac6758,_0x498938){return client[_0xa62b('0xe')](_0x46d9f8,_0xea0432)['then'](function(_0x27afaf){logger[_0xa62b('0xf')](_0xa62b('0x10'),_0x2805b8,'request\x20sent');logger[_0xa62b('0x11')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2805b8,_0xa62b('0x12'),JSON['stringify'](_0x27afaf));if(_0x27afaf[_0xa62b('0x13')]){if(_0x27afaf['error']['code']===0x1f4){logger[_0xa62b('0x13')]('ChatQueue,\x20%s,\x20%s',_0x2805b8,_0x27afaf[_0xa62b('0x13')][_0xa62b('0x14')]);return _0x498938(_0x27afaf['error'][_0xa62b('0x14')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x2805b8,_0x27afaf[_0xa62b('0x13')]['message']);return _0xac6758(_0x27afaf[_0xa62b('0x13')][_0xa62b('0x14')]);}else{logger[_0xa62b('0xf')]('ChatQueue,\x20%s,\x20%s',_0x2805b8,_0xa62b('0x12'));_0xac6758(_0x27afaf[_0xa62b('0x15')][_0xa62b('0x14')]);}})[_0xa62b('0x16')](function(_0x18b769){logger[_0xa62b('0x13')](_0xa62b('0x10'),_0x2805b8,_0x18b769);_0x498938(_0x18b769);});});}exports[_0xa62b('0x17')]=function(_0x5cc198){var _0xbb6e0e=this;return new Promise(function(_0x1ee83c,_0x3c1405){return db['ChatQueue'][_0xa62b('0x18')]({'raw':_0x5cc198['options']?_0x5cc198['options'][_0xa62b('0x19')]===undefined?!![]:![]:!![],'where':_0x5cc198['options']?_0x5cc198['options'][_0xa62b('0x1a')]||null:null,'attributes':_0x5cc198[_0xa62b('0x1b')]?_0x5cc198[_0xa62b('0x1b')][_0xa62b('0x1c')]||null:null,'limit':_0x5cc198[_0xa62b('0x1b')]?_0x5cc198[_0xa62b('0x1b')][_0xa62b('0x1d')]||null:null,'include':_0x5cc198[_0xa62b('0x1b')]?_0x5cc198[_0xa62b('0x1b')][_0xa62b('0x1e')]?_['map'](_0x5cc198['options'][_0xa62b('0x1e')],function(_0x20a323){return{'model':db[_0x20a323['model']],'as':_0x20a323['as'],'attributes':_0x20a323[_0xa62b('0x1c')],'include':_0x20a323['include']?_[_0xa62b('0x1f')](_0x20a323[_0xa62b('0x1e')],function(_0x1c3f0e){return{'model':db[_0x1c3f0e['model']],'as':_0x1c3f0e['as'],'attributes':_0x1c3f0e[_0xa62b('0x1c')],'include':_0x1c3f0e[_0xa62b('0x1e')]?_[_0xa62b('0x1f')](_0x1c3f0e[_0xa62b('0x1e')],function(_0x5c6b2c){return{'model':db[_0x5c6b2c['model']],'as':_0x5c6b2c['as'],'attributes':_0x5c6b2c[_0xa62b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa62b('0x20')](function(_0x5089a2){logger[_0xa62b('0xf')](_0xa62b('0x17'),_0x5cc198);logger[_0xa62b('0x11')](_0xa62b('0x17'),_0x5cc198,JSON[_0xa62b('0x21')](_0x5089a2));_0x1ee83c(_0x5089a2);})[_0xa62b('0x16')](function(_0x1b5753){logger['error'](_0xa62b('0x17'),_0x1b5753[_0xa62b('0x14')],_0x5cc198);_0x3c1405(_0xbb6e0e['error'](0x1f4,_0x1b5753[_0xa62b('0x14')]));});});};exports[_0xa62b('0x22')]=function(_0x2b07c5){var _0x39ee64=this;return new Promise(function(_0x1db5f1,_0x157e66){return db[_0xa62b('0x23')][_0xa62b('0x24')]({'raw':_0x2b07c5[_0xa62b('0x1b')]?_0x2b07c5['options']['raw']===undefined?!![]:![]:!![],'where':_0x2b07c5[_0xa62b('0x1b')]?_0x2b07c5['options'][_0xa62b('0x1a')]||null:null,'attributes':_0x2b07c5[_0xa62b('0x1b')]?_0x2b07c5[_0xa62b('0x1b')][_0xa62b('0x1c')]||null:null,'include':_0x2b07c5[_0xa62b('0x1b')]?_0x2b07c5[_0xa62b('0x1b')][_0xa62b('0x1e')]?_['map'](_0x2b07c5[_0xa62b('0x1b')]['include'],function(_0x360a2f){return{'model':db[_0x360a2f['model']],'as':_0x360a2f['as'],'attributes':_0x360a2f[_0xa62b('0x1c')],'include':_0x360a2f[_0xa62b('0x1e')]?_[_0xa62b('0x1f')](_0x360a2f[_0xa62b('0x1e')],function(_0x4a9405){return{'model':db[_0x4a9405[_0xa62b('0x25')]],'as':_0x4a9405['as'],'attributes':_0x4a9405['attributes'],'include':_0x4a9405[_0xa62b('0x1e')]?_[_0xa62b('0x1f')](_0x4a9405['include'],function(_0x17b292){return{'model':db[_0x17b292[_0xa62b('0x25')]],'as':_0x17b292['as'],'attributes':_0x17b292[_0xa62b('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa62b('0x20')](function(_0x286f2){logger[_0xa62b('0xf')](_0xa62b('0x22'),_0x2b07c5);logger['debug']('ShowChatQueue',_0x2b07c5,JSON[_0xa62b('0x21')](_0x286f2));_0x1db5f1(_0x286f2);})[_0xa62b('0x16')](function(_0x4127cd){logger[_0xa62b('0x13')](_0xa62b('0x22'),_0x4127cd['message'],_0x2b07c5);_0x157e66(_0x39ee64[_0xa62b('0x13')](0x1f4,_0x4127cd[_0xa62b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index d334146..5e46b03 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 _0x3e74=['emit','removeListener','register','length','chatQueue:','./chatQueue.events','remove','update'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x3e74,0x175));var _0x43e7=function(_0x1a48e0,_0x2ad452){_0x1a48e0=_0x1a48e0-0x0;var _0x1fc80a=_0x3e74[_0x1a48e0];return _0x1fc80a;};'use strict';var ChatQueueEvents=require(_0x43e7('0x0'));var events=['save',_0x43e7('0x1'),_0x43e7('0x2')];function createListener(_0x151ad2,_0x494e45){return function(_0x490ced){_0x494e45[_0x43e7('0x3')](_0x151ad2,_0x490ced);};}function removeListener(_0x4f9bbe,_0x128b0f){return function(){ChatQueueEvents[_0x43e7('0x4')](_0x4f9bbe,_0x128b0f);};}exports[_0x43e7('0x5')]=function(_0x1c503b){for(var _0xc98b9c=0x0,_0x503698=events[_0x43e7('0x6')];_0xc98b9c<_0x503698;_0xc98b9c++){var _0x3491d6=events[_0xc98b9c];var _0x2ede2d=createListener(_0x43e7('0x7')+_0x3491d6,_0x1c503b);ChatQueueEvents['on'](_0x3491d6,_0x2ede2d);}}; \ No newline at end of file +var _0x826a=['update','emit','removeListener','register','length','chatQueue:','save'];(function(_0x1c4267,_0x3a92f1){var _0x271da1=function(_0x190f70){while(--_0x190f70){_0x1c4267['push'](_0x1c4267['shift']());}};_0x271da1(++_0x3a92f1);}(_0x826a,0x1aa));var _0xa826=function(_0x45f7fa,_0x35a27c){_0x45f7fa=_0x45f7fa-0x0;var _0x332a43=_0x826a[_0x45f7fa];return _0x332a43;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xa826('0x0'),'remove',_0xa826('0x1')];function createListener(_0x50c70e,_0x376d53){return function(_0x19ba11){_0x376d53[_0xa826('0x2')](_0x50c70e,_0x19ba11);};}function removeListener(_0x34e1ad,_0x5372ab){return function(){ChatQueueEvents[_0xa826('0x3')](_0x34e1ad,_0x5372ab);};}exports[_0xa826('0x4')]=function(_0x3929d4){for(var _0x34327b=0x0,_0x45154f=events[_0xa826('0x5')];_0x34327b<_0x45154f;_0x34327b++){var _0x4339f9=events[_0x34327b];var _0x14c2ba=createListener(_0xa826('0x6')+_0x4339f9,_0x3929d4);ChatQueueEvents['on'](_0x4339f9,_0x14c2ba);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index f4d731d..8aea4b9 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 _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x44ca73,_0x4436dd){var _0x4d73c8=function(_0x386ada){while(--_0x386ada){_0x44ca73['push'](_0x44ca73['shift']());}};_0x4d73c8(++_0x4436dd);}(_0x55ca,0x126));var _0xa55c=function(_0x19af51,_0x3834ac){_0x19af51=_0x19af51-0x0;var _0x997581=_0x55ca[_0x19af51];return _0x997581;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router; \ No newline at end of file +var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x3a8623,_0x520bb7){var _0x457428=function(_0x38ce56){while(--_0x38ce56){_0x3a8623['push'](_0x3a8623['shift']());}};_0x457428(++_0x520bb7);}(_0xe14b,0x93));var _0xbe14=function(_0x28d5b3,_0x137c89){_0x28d5b3=_0x28d5b3-0x0;var _0x55bbaf=_0xe14b[_0x28d5b3];return _0x55bbaf;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index f0c84a7..ddd8b91 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 _0x2b38=['DATE','moment','sequelize','exports','STRING'];(function(_0x628eee,_0x3f3fba){var _0x447718=function(_0x38112b){while(--_0x38112b){_0x628eee['push'](_0x628eee['shift']());}};_0x447718(++_0x3f3fba);}(_0x2b38,0xdd));var _0x82b3=function(_0x4275c8,_0xd1fcc2){_0x4275c8=_0x4275c8-0x0;var _0x3bf8f=_0x2b38[_0x4275c8];return _0x3bf8f;};'use strict';var moment=require(_0x82b3('0x0'));var Sequelize=require(_0x82b3('0x1'));module[_0x82b3('0x2')]={'uniqueid':{'type':Sequelize[_0x82b3('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x82b3('0x3')]},'joinAt':{'type':Sequelize[_0x82b3('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x82b3('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x71a9=['STRING','DATE','moment','exports'];(function(_0x2d90e9,_0x314d9d){var _0xe8acb0=function(_0x5a6139){while(--_0x5a6139){_0x2d90e9['push'](_0x2d90e9['shift']());}};_0xe8acb0(++_0x314d9d);}(_0x71a9,0x192));var _0x971a=function(_0x206fd0,_0x4e33a4){_0x206fd0=_0x206fd0-0x0;var _0x2457be=_0x71a9[_0x206fd0];return _0x2457be;};'use strict';var moment=require(_0x971a('0x0'));var Sequelize=require('sequelize');module[_0x971a('0x1')]={'uniqueid':{'type':Sequelize[_0x971a('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x971a('0x2')]},'joinAt':{'type':Sequelize[_0x971a('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x971a('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 99adfbc..0068ab5 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 _0xcd05=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','limit','undefined','count','status','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','ChatQueueReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','offset','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','rawAttributes','find','create','body','params','describe','eml-format','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x128dfe,_0xfed45a){var _0x1b40f8=function(_0x760471){while(--_0x760471){_0x128dfe['push'](_0x128dfe['shift']());}};_0x1b40f8(++_0xfed45a);}(_0xcd05,0x163));var _0x5cd0=function(_0x512f81,_0x4a7986){_0x512f81=_0x512f81-0x0;var _0xa15099=_0xcd05[_0x512f81];return _0xa15099;};'use strict';var emlformat=require(_0x5cd0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5cd0('0x1'));var moment=require(_0x5cd0('0x2'));var BPromise=require(_0x5cd0('0x3'));var Mustache=require(_0x5cd0('0x4'));var util=require('util');var path=require(_0x5cd0('0x5'));var sox=require(_0x5cd0('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5cd0('0x7'));var squel=require(_0x5cd0('0x8'));var crypto=require(_0x5cd0('0x9'));var jsforce=require(_0x5cd0('0xa'));var deskjs=require(_0x5cd0('0xb'));var toCsv=require(_0x5cd0('0xc'));var querystring=require(_0x5cd0('0xd'));var Papa=require('papaparse');var Redis=require(_0x5cd0('0xe'));var authService=require(_0x5cd0('0xf'));var qs=require(_0x5cd0('0x10'));var as=require(_0x5cd0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5cd0('0x12'))(_0x5cd0('0x13'));var utils=require(_0x5cd0('0x14'));var config=require(_0x5cd0('0x15'));var licenseUtil=require(_0x5cd0('0x16'));var db=require(_0x5cd0('0x17'))['db'];function respondWithStatusCode(_0x11577c,_0x3f6bb6){_0x3f6bb6=_0x3f6bb6||0xcc;return function(_0x435d4b){if(_0x435d4b){return _0x11577c[_0x5cd0('0x18')](_0x3f6bb6);}return _0x11577c['status'](_0x3f6bb6)['end']();};}function respondWithResult(_0x51ec30,_0xe9f736){_0xe9f736=_0xe9f736||0xc8;return function(_0x426a68){if(_0x426a68){return _0x51ec30['status'](_0xe9f736)[_0x5cd0('0x19')](_0x426a68);}};}function respondWithFilteredResult(_0x5b1d94,_0x2991d2){return function(_0xd1d12b){if(_0xd1d12b){var _0xf54ddb=typeof _0x2991d2['offset']==='undefined'&&typeof _0x2991d2[_0x5cd0('0x1a')]===_0x5cd0('0x1b');var _0x156947=_0xd1d12b['count'];var _0x57d81d=_0xf54ddb?0x0:_0x2991d2['offset'];var _0x1847dd=_0xf54ddb?_0xd1d12b[_0x5cd0('0x1c')]:_0x2991d2['offset']+_0x2991d2[_0x5cd0('0x1a')];var _0x19554c;if(_0x1847dd>=_0x156947){_0x1847dd=_0x156947;_0x19554c=0xc8;}else{_0x19554c=0xce;}_0x5b1d94[_0x5cd0('0x1d')](_0x19554c);return _0x5b1d94[_0x5cd0('0x1e')](_0x5cd0('0x1f'),_0x57d81d+'-'+_0x1847dd+'/'+_0x156947)[_0x5cd0('0x19')](_0xd1d12b);}return null;};}function patchUpdates(_0x18b907){return function(_0xc5c11c){try{jsonpatch[_0x5cd0('0x20')](_0xc5c11c,_0x18b907,!![]);}catch(_0xd270d8){return BPromise[_0x5cd0('0x21')](_0xd270d8);}return _0xc5c11c[_0x5cd0('0x22')]();};}function saveUpdates(_0x1828ac,_0x1fe052){return function(_0x5c2bd9){if(_0x5c2bd9){return _0x5c2bd9['update'](_0x1828ac)[_0x5cd0('0x23')](function(_0x5bd14d){return _0x5bd14d;});}return null;};}function removeEntity(_0x236fb3,_0x2e01b6){return function(_0x1e8960){if(_0x1e8960){return _0x1e8960[_0x5cd0('0x24')]()[_0x5cd0('0x23')](function(){_0x236fb3[_0x5cd0('0x1d')](0xcc)[_0x5cd0('0x25')]();});}};}function handleEntityNotFound(_0x5385db,_0x4a1fa4){return function(_0x2cd387){if(!_0x2cd387){_0x5385db[_0x5cd0('0x18')](0x194);}return _0x2cd387;};}function handleError(_0x28fcaa,_0x189fa8){_0x189fa8=_0x189fa8||0x1f4;return function(_0x5bff8a){logger[_0x5cd0('0x26')](_0x5bff8a[_0x5cd0('0x27')]);if(_0x5bff8a[_0x5cd0('0x28')]){delete _0x5bff8a['name'];}_0x28fcaa['status'](_0x189fa8)[_0x5cd0('0x29')](_0x5bff8a);};}exports[_0x5cd0('0x2a')]=function(_0x5a2123,_0x246525){var _0x4020d1={},_0x2dfb5d={},_0x1c73e1={'count':0x0,'rows':[]};var _0x3c80d1=_[_0x5cd0('0x2b')](db[_0x5cd0('0x2c')]['rawAttributes'],function(_0x412f1e){return{'name':_0x412f1e[_0x5cd0('0x2d')],'type':_0x412f1e[_0x5cd0('0x2e')][_0x5cd0('0x2f')]};});_0x2dfb5d[_0x5cd0('0x30')]=_[_0x5cd0('0x2b')](_0x3c80d1,_0x5cd0('0x28'));_0x2dfb5d[_0x5cd0('0x31')]=_[_0x5cd0('0x32')](_0x5a2123[_0x5cd0('0x31')]);_0x2dfb5d['filters']=_[_0x5cd0('0x33')](_0x2dfb5d[_0x5cd0('0x30')],_0x2dfb5d['query']);_0x4020d1[_0x5cd0('0x34')]=_['intersection'](_0x2dfb5d[_0x5cd0('0x30')],qs[_0x5cd0('0x35')](_0x5a2123['query'][_0x5cd0('0x35')]));_0x4020d1['attributes']=_0x4020d1[_0x5cd0('0x34')][_0x5cd0('0x36')]?_0x4020d1[_0x5cd0('0x34')]:_0x2dfb5d['model'];if(!_0x5a2123[_0x5cd0('0x31')]['hasOwnProperty'](_0x5cd0('0x37'))){_0x4020d1[_0x5cd0('0x1a')]=qs['limit'](_0x5a2123[_0x5cd0('0x31')][_0x5cd0('0x1a')]);_0x4020d1[_0x5cd0('0x38')]=qs[_0x5cd0('0x38')](_0x5a2123[_0x5cd0('0x31')]['offset']);}_0x4020d1['order']=qs[_0x5cd0('0x39')](_0x5a2123[_0x5cd0('0x31')]['sort']);_0x4020d1[_0x5cd0('0x3a')]=qs[_0x5cd0('0x3b')](_[_0x5cd0('0x3c')](_0x5a2123[_0x5cd0('0x31')],_0x2dfb5d[_0x5cd0('0x3b')]),_0x3c80d1);if(_0x5a2123['query'][_0x5cd0('0x3d')]){_0x4020d1[_0x5cd0('0x3a')]=_[_0x5cd0('0x3e')](_0x4020d1[_0x5cd0('0x3a')],{'$or':_[_0x5cd0('0x2b')](_0x3c80d1,function(_0x144101){if(_0x144101[_0x5cd0('0x2e')]!==_0x5cd0('0x3f')){var _0xd12dfa={};_0xd12dfa[_0x144101[_0x5cd0('0x28')]]={'$like':'%'+_0x5a2123[_0x5cd0('0x31')][_0x5cd0('0x3d')]+'%'};return _0xd12dfa;}})});}_0x4020d1=_[_0x5cd0('0x3e')]({},_0x4020d1,_0x5a2123[_0x5cd0('0x40')]);var _0x49f4b5={'where':_0x4020d1['where']};return db[_0x5cd0('0x2c')]['count'](_0x49f4b5)[_0x5cd0('0x23')](function(_0x55d99a){_0x1c73e1[_0x5cd0('0x1c')]=_0x55d99a;if(_0x5a2123[_0x5cd0('0x31')][_0x5cd0('0x41')]){_0x4020d1[_0x5cd0('0x42')]=[{'all':!![]}];}return db[_0x5cd0('0x2c')]['findAll'](_0x4020d1);})[_0x5cd0('0x23')](function(_0x5c7468){_0x1c73e1['rows']=_0x5c7468;return _0x1c73e1;})[_0x5cd0('0x23')](respondWithFilteredResult(_0x246525,_0x4020d1))[_0x5cd0('0x43')](handleError(_0x246525,null));};exports[_0x5cd0('0x44')]=function(_0x4bcb6d,_0x31ca10){var _0x5920c3={'raw':!![],'where':{'id':_0x4bcb6d['params']['id']}},_0xe5a6ee={};_0xe5a6ee['model']=_[_0x5cd0('0x32')](db[_0x5cd0('0x2c')][_0x5cd0('0x45')]);_0xe5a6ee[_0x5cd0('0x31')]=_[_0x5cd0('0x32')](_0x4bcb6d['query']);_0xe5a6ee[_0x5cd0('0x3b')]=_[_0x5cd0('0x33')](_0xe5a6ee[_0x5cd0('0x30')],_0xe5a6ee[_0x5cd0('0x31')]);_0x5920c3['attributes']=_[_0x5cd0('0x33')](_0xe5a6ee[_0x5cd0('0x30')],qs[_0x5cd0('0x35')](_0x4bcb6d[_0x5cd0('0x31')][_0x5cd0('0x35')]));_0x5920c3['attributes']=_0x5920c3[_0x5cd0('0x34')][_0x5cd0('0x36')]?_0x5920c3[_0x5cd0('0x34')]:_0xe5a6ee[_0x5cd0('0x30')];if(_0x4bcb6d[_0x5cd0('0x31')]['includeAll']){_0x5920c3[_0x5cd0('0x42')]=[{'all':!![]}];}_0x5920c3=_[_0x5cd0('0x3e')]({},_0x5920c3,_0x4bcb6d['options']);return db['ChatQueueReport'][_0x5cd0('0x46')](_0x5920c3)[_0x5cd0('0x23')](handleEntityNotFound(_0x31ca10,null))[_0x5cd0('0x23')](respondWithResult(_0x31ca10,null))[_0x5cd0('0x43')](handleError(_0x31ca10,null));};exports[_0x5cd0('0x47')]=function(_0x48d5e8,_0x5ca7a3){return db[_0x5cd0('0x2c')][_0x5cd0('0x47')](_0x48d5e8[_0x5cd0('0x48')],{})['then'](respondWithResult(_0x5ca7a3,0xc9))[_0x5cd0('0x43')](handleError(_0x5ca7a3,null));};exports['update']=function(_0x589157,_0x37d394){if(_0x589157[_0x5cd0('0x48')]['id']){delete _0x589157['body']['id'];}return db[_0x5cd0('0x2c')]['find']({'where':{'id':_0x589157[_0x5cd0('0x49')]['id']}})[_0x5cd0('0x23')](handleEntityNotFound(_0x37d394,null))[_0x5cd0('0x23')](saveUpdates(_0x589157[_0x5cd0('0x48')],null))['then'](respondWithResult(_0x37d394,null))[_0x5cd0('0x43')](handleError(_0x37d394,null));};exports['destroy']=function(_0x3e2015,_0x25b86b){return db[_0x5cd0('0x2c')][_0x5cd0('0x46')]({'where':{'id':_0x3e2015['params']['id']}})[_0x5cd0('0x23')](handleEntityNotFound(_0x25b86b,null))[_0x5cd0('0x23')](removeEntity(_0x25b86b,null))['catch'](handleError(_0x25b86b,null));};exports['describe']=function(_0x4015b4,_0x2e363e){return db[_0x5cd0('0x2c')][_0x5cd0('0x4a')]()['then'](respondWithResult(_0x2e363e,null))[_0x5cd0('0x43')](handleError(_0x2e363e,null));}; \ No newline at end of file +var _0x90ec=['hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','findAll','rows','catch','show','include','options','find','create','body','params','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','sendStatus','status','json','undefined','offset','set','Content-Range','reject','update','then','end','error','stack','name','send','map','ChatQueueReport','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length'];(function(_0x5585f5,_0x167771){var _0x3439c9=function(_0x207c3f){while(--_0x207c3f){_0x5585f5['push'](_0x5585f5['shift']());}};_0x3439c9(++_0x167771);}(_0x90ec,0x1d4));var _0xc90e=function(_0x18d143,_0x47a1a0){_0x18d143=_0x18d143-0x0;var _0x622498=_0x90ec[_0x18d143];return _0x622498;};'use strict';var emlformat=require(_0xc90e('0x0'));var rimraf=require(_0xc90e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc90e('0x2'));var rp=require(_0xc90e('0x3'));var moment=require(_0xc90e('0x4'));var BPromise=require(_0xc90e('0x5'));var Mustache=require(_0xc90e('0x6'));var util=require('util');var path=require(_0xc90e('0x7'));var sox=require(_0xc90e('0x8'));var csv=require(_0xc90e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc90e('0xa'));var _=require('lodash');var squel=require(_0xc90e('0xb'));var crypto=require(_0xc90e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc90e('0xd'));var toCsv=require(_0xc90e('0x9'));var querystring=require(_0xc90e('0xe'));var Papa=require(_0xc90e('0xf'));var Redis=require(_0xc90e('0x10'));var authService=require(_0xc90e('0x11'));var qs=require(_0xc90e('0x12'));var as=require(_0xc90e('0x13'));var hardwareService=require(_0xc90e('0x14'));var logger=require('../../config/logger')(_0xc90e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30b4bd,_0x41d560){_0x41d560=_0x41d560||0xcc;return function(_0x5cef50){if(_0x5cef50){return _0x30b4bd[_0xc90e('0x16')](_0x41d560);}return _0x30b4bd[_0xc90e('0x17')](_0x41d560)['end']();};}function respondWithResult(_0x1ab6fb,_0x40e989){_0x40e989=_0x40e989||0xc8;return function(_0x274876){if(_0x274876){return _0x1ab6fb[_0xc90e('0x17')](_0x40e989)[_0xc90e('0x18')](_0x274876);}};}function respondWithFilteredResult(_0x13334c,_0x53e2e1){return function(_0x16050f){if(_0x16050f){var _0x2ada5a=typeof _0x53e2e1['offset']===_0xc90e('0x19')&&typeof _0x53e2e1['limit']===_0xc90e('0x19');var _0x153415=_0x16050f['count'];var _0x934f8b=_0x2ada5a?0x0:_0x53e2e1[_0xc90e('0x1a')];var _0x17ec6b=_0x2ada5a?_0x16050f['count']:_0x53e2e1['offset']+_0x53e2e1['limit'];var _0x161a3a;if(_0x17ec6b>=_0x153415){_0x17ec6b=_0x153415;_0x161a3a=0xc8;}else{_0x161a3a=0xce;}_0x13334c[_0xc90e('0x17')](_0x161a3a);return _0x13334c[_0xc90e('0x1b')](_0xc90e('0x1c'),_0x934f8b+'-'+_0x17ec6b+'/'+_0x153415)[_0xc90e('0x18')](_0x16050f);}return null;};}function patchUpdates(_0x50d0a2){return function(_0x469f0d){try{jsonpatch['apply'](_0x469f0d,_0x50d0a2,!![]);}catch(_0x3ae806){return BPromise[_0xc90e('0x1d')](_0x3ae806);}return _0x469f0d['save']();};}function saveUpdates(_0x20b839,_0x134760){return function(_0x957d1e){if(_0x957d1e){return _0x957d1e[_0xc90e('0x1e')](_0x20b839)[_0xc90e('0x1f')](function(_0x282c53){return _0x282c53;});}return null;};}function removeEntity(_0x1a25bc,_0x136187){return function(_0x1cff73){if(_0x1cff73){return _0x1cff73['destroy']()[_0xc90e('0x1f')](function(){_0x1a25bc[_0xc90e('0x17')](0xcc)[_0xc90e('0x20')]();});}};}function handleEntityNotFound(_0x380f3f,_0x3371aa){return function(_0x59d731){if(!_0x59d731){_0x380f3f[_0xc90e('0x16')](0x194);}return _0x59d731;};}function handleError(_0x1c6e1c,_0x2ba549){_0x2ba549=_0x2ba549||0x1f4;return function(_0x4fde04){logger[_0xc90e('0x21')](_0x4fde04[_0xc90e('0x22')]);if(_0x4fde04[_0xc90e('0x23')]){delete _0x4fde04[_0xc90e('0x23')];}_0x1c6e1c[_0xc90e('0x17')](_0x2ba549)[_0xc90e('0x24')](_0x4fde04);};}exports['index']=function(_0x481b4b,_0x31e405){var _0x550e8f={},_0xe8bae9={},_0xae20be={'count':0x0,'rows':[]};var _0x1baedc=_[_0xc90e('0x25')](db[_0xc90e('0x26')][_0xc90e('0x27')],function(_0x42b79b){return{'name':_0x42b79b['fieldName'],'type':_0x42b79b[_0xc90e('0x28')][_0xc90e('0x29')]};});_0xe8bae9['model']=_[_0xc90e('0x25')](_0x1baedc,'name');_0xe8bae9[_0xc90e('0x2a')]=_[_0xc90e('0x2b')](_0x481b4b[_0xc90e('0x2a')]);_0xe8bae9[_0xc90e('0x2c')]=_[_0xc90e('0x2d')](_0xe8bae9[_0xc90e('0x2e')],_0xe8bae9[_0xc90e('0x2a')]);_0x550e8f[_0xc90e('0x2f')]=_[_0xc90e('0x2d')](_0xe8bae9['model'],qs['fields'](_0x481b4b[_0xc90e('0x2a')][_0xc90e('0x30')]));_0x550e8f[_0xc90e('0x2f')]=_0x550e8f[_0xc90e('0x2f')][_0xc90e('0x31')]?_0x550e8f[_0xc90e('0x2f')]:_0xe8bae9[_0xc90e('0x2e')];if(!_0x481b4b[_0xc90e('0x2a')][_0xc90e('0x32')](_0xc90e('0x33'))){_0x550e8f['limit']=qs[_0xc90e('0x34')](_0x481b4b[_0xc90e('0x2a')][_0xc90e('0x34')]);_0x550e8f[_0xc90e('0x1a')]=qs['offset'](_0x481b4b['query']['offset']);}_0x550e8f[_0xc90e('0x35')]=qs[_0xc90e('0x36')](_0x481b4b[_0xc90e('0x2a')][_0xc90e('0x36')]);_0x550e8f[_0xc90e('0x37')]=qs['filters'](_[_0xc90e('0x38')](_0x481b4b[_0xc90e('0x2a')],_0xe8bae9[_0xc90e('0x2c')]),_0x1baedc);if(_0x481b4b[_0xc90e('0x2a')][_0xc90e('0x39')]){_0x550e8f[_0xc90e('0x37')]=_[_0xc90e('0x3a')](_0x550e8f[_0xc90e('0x37')],{'$or':_[_0xc90e('0x25')](_0x1baedc,function(_0x2ce110){if(_0x2ce110[_0xc90e('0x28')]!==_0xc90e('0x3b')){var _0x1c49c9={};_0x1c49c9[_0x2ce110['name']]={'$like':'%'+_0x481b4b[_0xc90e('0x2a')][_0xc90e('0x39')]+'%'};return _0x1c49c9;}})});}_0x550e8f=_['merge']({},_0x550e8f,_0x481b4b['options']);var _0x179c48={'where':_0x550e8f['where']};return db[_0xc90e('0x26')][_0xc90e('0x3c')](_0x179c48)['then'](function(_0xca9e25){_0xae20be['count']=_0xca9e25;if(_0x481b4b['query'][_0xc90e('0x3d')]){_0x550e8f['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0xc90e('0x3e')](_0x550e8f);})[_0xc90e('0x1f')](function(_0x584647){_0xae20be[_0xc90e('0x3f')]=_0x584647;return _0xae20be;})[_0xc90e('0x1f')](respondWithFilteredResult(_0x31e405,_0x550e8f))[_0xc90e('0x40')](handleError(_0x31e405,null));};exports[_0xc90e('0x41')]=function(_0x10d90b,_0x25b5da){var _0x3f194a={'raw':!![],'where':{'id':_0x10d90b['params']['id']}},_0x25a7d6={};_0x25a7d6[_0xc90e('0x2e')]=_['keys'](db['ChatQueueReport'][_0xc90e('0x27')]);_0x25a7d6['query']=_[_0xc90e('0x2b')](_0x10d90b['query']);_0x25a7d6[_0xc90e('0x2c')]=_[_0xc90e('0x2d')](_0x25a7d6[_0xc90e('0x2e')],_0x25a7d6[_0xc90e('0x2a')]);_0x3f194a[_0xc90e('0x2f')]=_[_0xc90e('0x2d')](_0x25a7d6[_0xc90e('0x2e')],qs[_0xc90e('0x30')](_0x10d90b[_0xc90e('0x2a')]['fields']));_0x3f194a[_0xc90e('0x2f')]=_0x3f194a[_0xc90e('0x2f')][_0xc90e('0x31')]?_0x3f194a[_0xc90e('0x2f')]:_0x25a7d6['model'];if(_0x10d90b[_0xc90e('0x2a')][_0xc90e('0x3d')]){_0x3f194a[_0xc90e('0x42')]=[{'all':!![]}];}_0x3f194a=_['merge']({},_0x3f194a,_0x10d90b[_0xc90e('0x43')]);return db['ChatQueueReport'][_0xc90e('0x44')](_0x3f194a)['then'](handleEntityNotFound(_0x25b5da,null))[_0xc90e('0x1f')](respondWithResult(_0x25b5da,null))['catch'](handleError(_0x25b5da,null));};exports[_0xc90e('0x45')]=function(_0x45c1e0,_0x3812ed){return db[_0xc90e('0x26')][_0xc90e('0x45')](_0x45c1e0[_0xc90e('0x46')],{})[_0xc90e('0x1f')](respondWithResult(_0x3812ed,0xc9))[_0xc90e('0x40')](handleError(_0x3812ed,null));};exports['update']=function(_0x8a1e2,_0x3de64f){if(_0x8a1e2['body']['id']){delete _0x8a1e2['body']['id'];}return db[_0xc90e('0x26')]['find']({'where':{'id':_0x8a1e2[_0xc90e('0x47')]['id']}})[_0xc90e('0x1f')](handleEntityNotFound(_0x3de64f,null))[_0xc90e('0x1f')](saveUpdates(_0x8a1e2[_0xc90e('0x46')],null))[_0xc90e('0x1f')](respondWithResult(_0x3de64f,null))['catch'](handleError(_0x3de64f,null));};exports[_0xc90e('0x48')]=function(_0x377c06,_0x496b00){return db[_0xc90e('0x26')]['find']({'where':{'id':_0x377c06[_0xc90e('0x47')]['id']}})['then'](handleEntityNotFound(_0x496b00,null))[_0xc90e('0x1f')](removeEntity(_0x496b00,null))[_0xc90e('0x40')](handleError(_0x496b00,null));};exports[_0xc90e('0x49')]=function(_0x3658d2,_0xc7d60f){return db[_0xc90e('0x26')][_0xc90e('0x49')]()[_0xc90e('0x1f')](respondWithResult(_0xc7d60f,null))[_0xc90e('0x40')](handleError(_0xc7d60f,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 1721943..7f7ae3b 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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x527c44,_0xbaa125){var _0x59693a=function(_0x5e3c29){while(--_0x5e3c29){_0x527c44['push'](_0x527c44['shift']());}};_0x59693a(++_0xbaa125);}(_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('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x56bde8,_0x3e34f1){var _0x521fd3=function(_0x54b5e7){while(--_0x54b5e7){_0x56bde8['push'](_0x56bde8['shift']());}};_0x521fd3(++_0x3e34f1);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 9dc4063..913a4f6 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 _0xa3e8=['debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','UpdateChatQueueReport','body','where','attributes','then'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa3e8,0x1f0));var _0x8a3e=function(_0x141506,_0x297108){_0x141506=_0x141506-0x0;var _0xcf067a=_0xa3e8[_0x141506];return _0xcf067a;};'use strict';var _=require(_0x8a3e('0x0'));var util=require(_0x8a3e('0x1'));var moment=require(_0x8a3e('0x2'));var BPromise=require(_0x8a3e('0x3'));var rs=require(_0x8a3e('0x4'));var fs=require('fs');var Redis=require(_0x8a3e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8a3e('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x8a3e('0x7'));var jayson=require(_0x8a3e('0x8'));var client=jayson[_0x8a3e('0x9')][_0x8a3e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x495398,_0x50a037,_0x5d5046){return new BPromise(function(_0x1bdc1c,_0x4590a5){return client[_0x8a3e('0xb')](_0x495398,_0x5d5046)['then'](function(_0x260c65){logger[_0x8a3e('0xc')](_0x8a3e('0xd'),_0x50a037,'request\x20sent');logger['debug'](_0x8a3e('0xe'),_0x50a037,'request\x20sent',JSON[_0x8a3e('0xf')](_0x260c65));if(_0x260c65[_0x8a3e('0x10')]){if(_0x260c65[_0x8a3e('0x10')][_0x8a3e('0x11')]===0x1f4){logger[_0x8a3e('0x10')](_0x8a3e('0xd'),_0x50a037,_0x260c65['error']['message']);return _0x4590a5(_0x260c65[_0x8a3e('0x10')][_0x8a3e('0x12')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x50a037,_0x260c65[_0x8a3e('0x10')][_0x8a3e('0x12')]);return _0x1bdc1c(_0x260c65[_0x8a3e('0x10')][_0x8a3e('0x12')]);}else{logger['info'](_0x8a3e('0xd'),_0x50a037,_0x8a3e('0x13'));_0x1bdc1c(_0x260c65[_0x8a3e('0x14')][_0x8a3e('0x12')]);}})[_0x8a3e('0x15')](function(_0x17c28f){logger[_0x8a3e('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x50a037,_0x17c28f);_0x4590a5(_0x17c28f);});});}exports[_0x8a3e('0x16')]=function(_0x4b3329){var _0x587577=this;return new Promise(function(_0x23ed2c,_0x5815de){return db[_0x8a3e('0x17')][_0x8a3e('0x18')](_0x4b3329['body'],{'raw':_0x4b3329[_0x8a3e('0x19')]?_0x4b3329[_0x8a3e('0x19')][_0x8a3e('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3942ef){logger[_0x8a3e('0xc')](_0x8a3e('0x16'),_0x4b3329);logger['debug'](_0x8a3e('0x16'),_0x4b3329,JSON['stringify'](_0x3942ef));_0x23ed2c(_0x3942ef);})[_0x8a3e('0x15')](function(_0x33a029){logger[_0x8a3e('0x10')](_0x8a3e('0x16'),_0x33a029['message'],_0x4b3329);_0x5815de(_0x587577[_0x8a3e('0x10')](0x1f4,_0x33a029[_0x8a3e('0x12')]));});});};exports[_0x8a3e('0x1b')]=function(_0x57cb4d){var _0x4a294a=this;return new Promise(function(_0x3fdf8b,_0x210fc8){return db[_0x8a3e('0x17')]['update'](_0x57cb4d[_0x8a3e('0x1c')],{'raw':_0x57cb4d[_0x8a3e('0x19')]?_0x57cb4d['options'][_0x8a3e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57cb4d['options']?_0x57cb4d[_0x8a3e('0x19')][_0x8a3e('0x1d')]||null:null,'attributes':_0x57cb4d[_0x8a3e('0x19')]?_0x57cb4d[_0x8a3e('0x19')][_0x8a3e('0x1e')]||null:null,'limit':_0x57cb4d[_0x8a3e('0x19')]?_0x57cb4d[_0x8a3e('0x19')]['limit']||null:null})[_0x8a3e('0x1f')](function(_0x15d884){logger['info']('UpdateChatQueueReport',_0x57cb4d);logger[_0x8a3e('0x20')](_0x8a3e('0x1b'),_0x57cb4d,JSON[_0x8a3e('0xf')](_0x15d884));_0x3fdf8b(_0x15d884);})[_0x8a3e('0x15')](function(_0x4a9fab){logger[_0x8a3e('0x10')](_0x8a3e('0x1b'),_0x4a9fab[_0x8a3e('0x12')],_0x57cb4d);_0x210fc8(_0x4a294a[_0x8a3e('0x10')](0x1f4,_0x4a9fab['message']));});});}; \ No newline at end of file +var _0xc9cd=['info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport','create','options','raw','catch','UpdateChatQueueReport','update','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then'];(function(_0x3ecbe9,_0x31d037){var _0x5afb80=function(_0x26218d){while(--_0x26218d){_0x3ecbe9['push'](_0x3ecbe9['shift']());}};_0x5afb80(++_0x31d037);}(_0xc9cd,0x17e));var _0xdc9c=function(_0x54e6f5,_0x4f4e99){_0x54e6f5=_0x54e6f5-0x0;var _0x5e8794=_0xc9cd[_0x54e6f5];return _0x5e8794;};'use strict';var _=require(_0xdc9c('0x0'));var util=require(_0xdc9c('0x1'));var moment=require(_0xdc9c('0x2'));var BPromise=require(_0xdc9c('0x3'));var rs=require(_0xdc9c('0x4'));var fs=require('fs');var Redis=require(_0xdc9c('0x5'));var db=require(_0xdc9c('0x6'))['db'];var utils=require(_0xdc9c('0x7'));var logger=require(_0xdc9c('0x8'))(_0xdc9c('0x9'));var config=require('../../config/environment');var jayson=require(_0xdc9c('0xa'));var client=jayson[_0xdc9c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc08169,_0x31ef2b,_0x3a0d52){return new BPromise(function(_0x11abcd,_0x2ff9d8){return client[_0xdc9c('0xc')](_0xc08169,_0x3a0d52)[_0xdc9c('0xd')](function(_0x333551){logger[_0xdc9c('0xe')](_0xdc9c('0xf'),_0x31ef2b,_0xdc9c('0x10'));logger[_0xdc9c('0x11')](_0xdc9c('0x12'),_0x31ef2b,_0xdc9c('0x10'),JSON[_0xdc9c('0x13')](_0x333551));if(_0x333551['error']){if(_0x333551[_0xdc9c('0x14')][_0xdc9c('0x15')]===0x1f4){logger['error'](_0xdc9c('0xf'),_0x31ef2b,_0x333551[_0xdc9c('0x14')]['message']);return _0x2ff9d8(_0x333551[_0xdc9c('0x14')][_0xdc9c('0x16')]);}logger['error'](_0xdc9c('0xf'),_0x31ef2b,_0x333551[_0xdc9c('0x14')][_0xdc9c('0x16')]);return _0x11abcd(_0x333551[_0xdc9c('0x14')][_0xdc9c('0x16')]);}else{logger[_0xdc9c('0xe')](_0xdc9c('0xf'),_0x31ef2b,_0xdc9c('0x10'));_0x11abcd(_0x333551[_0xdc9c('0x17')][_0xdc9c('0x16')]);}})['catch'](function(_0x52fb51){logger[_0xdc9c('0x14')](_0xdc9c('0xf'),_0x31ef2b,_0x52fb51);_0x2ff9d8(_0x52fb51);});});}exports[_0xdc9c('0x18')]=function(_0xd0487){var _0x142ba7=this;return new Promise(function(_0x2b7aac,_0x551f6e){return db['ChatQueueReport'][_0xdc9c('0x19')](_0xd0487['body'],{'raw':_0xd0487[_0xdc9c('0x1a')]?_0xd0487['options'][_0xdc9c('0x1b')]===undefined?!![]:![]:!![]})[_0xdc9c('0xd')](function(_0x4c03ae){logger['info']('CreateChatQueueReport',_0xd0487);logger['debug']('CreateChatQueueReport',_0xd0487,JSON['stringify'](_0x4c03ae));_0x2b7aac(_0x4c03ae);})[_0xdc9c('0x1c')](function(_0x1de24b){logger[_0xdc9c('0x14')](_0xdc9c('0x18'),_0x1de24b[_0xdc9c('0x16')],_0xd0487);_0x551f6e(_0x142ba7[_0xdc9c('0x14')](0x1f4,_0x1de24b[_0xdc9c('0x16')]));});});};exports[_0xdc9c('0x1d')]=function(_0x2595e1){var _0x584fda=this;return new Promise(function(_0x22f1f6,_0x22d90f){return db['ChatQueueReport'][_0xdc9c('0x1e')](_0x2595e1['body'],{'raw':_0x2595e1[_0xdc9c('0x1a')]?_0x2595e1[_0xdc9c('0x1a')][_0xdc9c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2595e1[_0xdc9c('0x1a')]?_0x2595e1[_0xdc9c('0x1a')][_0xdc9c('0x1f')]||null:null,'attributes':_0x2595e1[_0xdc9c('0x1a')]?_0x2595e1[_0xdc9c('0x1a')]['attributes']||null:null,'limit':_0x2595e1[_0xdc9c('0x1a')]?_0x2595e1['options'][_0xdc9c('0x20')]||null:null})[_0xdc9c('0xd')](function(_0x5ead14){logger[_0xdc9c('0xe')](_0xdc9c('0x1d'),_0x2595e1);logger[_0xdc9c('0x11')](_0xdc9c('0x1d'),_0x2595e1,JSON[_0xdc9c('0x13')](_0x5ead14));_0x22f1f6(_0x5ead14);})[_0xdc9c('0x1c')](function(_0x2770e1){logger[_0xdc9c('0x14')](_0xdc9c('0x1d'),_0x2770e1['message'],_0x2595e1);_0x22d90f(_0x584fda[_0xdc9c('0x14')](0x1f4,_0x2770e1['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 5b7f234..3338185 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 _0x9cae=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get'];(function(_0x42a9b1,_0x1341e8){var _0x4eef08=function(_0x327e1b){while(--_0x327e1b){_0x42a9b1['push'](_0x42a9b1['shift']());}};_0x4eef08(++_0x1341e8);}(_0x9cae,0xc5));var _0xe9ca=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9cae[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0xe9ca('0x0'));var path=require(_0xe9ca('0x1'));var timeout=require(_0xe9ca('0x2'));var express=require(_0xe9ca('0x3'));var router=express[_0xe9ca('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe9ca('0x5'));var interaction=require(_0xe9ca('0x6'));var config=require(_0xe9ca('0x7'));var controller=require(_0xe9ca('0x8'));router[_0xe9ca('0x9')]('/',auth[_0xe9ca('0xa')](),controller[_0xe9ca('0xb')]);router[_0xe9ca('0x9')](_0xe9ca('0xc'),auth[_0xe9ca('0xa')](),controller[_0xe9ca('0xd')]);router[_0xe9ca('0x9')](_0xe9ca('0xe'),auth[_0xe9ca('0xa')](),controller[_0xe9ca('0xf')]);router[_0xe9ca('0x10')]('/',auth['isAuthenticated'](),controller[_0xe9ca('0x11')]);router[_0xe9ca('0x12')]('/:id',auth[_0xe9ca('0xa')](),controller[_0xe9ca('0x13')]);router[_0xe9ca('0x14')](_0xe9ca('0xe'),auth[_0xe9ca('0xa')](),controller[_0xe9ca('0x15')]);module[_0xe9ca('0x16')]=router; \ No newline at end of file +var _0x3208=['../../config/environment','./chatQueueReport.controller','index','get','/describe','describe','/:id','isAuthenticated','show','create','update','delete','destroy','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x51e52f,_0x19124a){var _0x4249ea=function(_0x55ddc6){while(--_0x55ddc6){_0x51e52f['push'](_0x51e52f['shift']());}};_0x4249ea(++_0x19124a);}(_0x3208,0x1e9));var _0x8320=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x3208[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8320('0x0'));var express=require(_0x8320('0x1'));var router=express[_0x8320('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8320('0x3'));var config=require(_0x8320('0x4'));var controller=require(_0x8320('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x8320('0x6')]);router[_0x8320('0x7')](_0x8320('0x8'),auth['isAuthenticated'](),controller[_0x8320('0x9')]);router['get'](_0x8320('0xa'),auth[_0x8320('0xb')](),controller[_0x8320('0xc')]);router['post']('/',auth[_0x8320('0xb')](),controller[_0x8320('0xd')]);router['put'](_0x8320('0xa'),auth[_0x8320('0xb')](),controller[_0x8320('0xe')]);router[_0x8320('0xf')](_0x8320('0xa'),auth[_0x8320('0xb')](),controller[_0x8320('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 3e3f25a..6696c9c 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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x26d4da,_0x3fda6b){var _0x2df13c=function(_0x4b98c4){while(--_0x4b98c4){_0x26d4da['push'](_0x26d4da['shift']());}};_0x2df13c(++_0x3fda6b);}(_0xe706,0xa3));var _0x6e70=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xe706[_0x5608a3];return _0x1ed50a;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0xa3c131,_0x4ee118){var _0x392567=function(_0xa0bbc){while(--_0xa0bbc){_0xa3c131['push'](_0xa3c131['shift']());}};_0x392567(++_0x4ee118);}(_0xaa88,0x137));var _0x8aa8=function(_0x4ec520,_0x15fee2){_0x4ec520=_0x4ec520-0x0;var _0xed49d7=_0xaa88[_0x4ec520];return _0xed49d7;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index e38ee4c..3d7c709 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 _0x537f=['destroy','error','stack','name','send','index','rawAttributes','fieldName','type','map','keys','filters','intersection','model','attributes','fields','query','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','ChatTransferReport','count','includeAll','include','findAll','then','catch','show','params','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','offset','limit','set','Content-Range','apply','save','update'];(function(_0x202902,_0x1d2743){var _0x58c31b=function(_0x3c2890){while(--_0x3c2890){_0x202902['push'](_0x202902['shift']());}};_0x58c31b(++_0x1d2743);}(_0x537f,0x106));var _0xf537=function(_0x348181,_0x405f32){_0x348181=_0x348181-0x0;var _0x5a8456=_0x537f[_0x348181];return _0x5a8456;};'use strict';var emlformat=require(_0xf537('0x0'));var rimraf=require(_0xf537('0x1'));var zipdir=require(_0xf537('0x2'));var jsonpatch=require(_0xf537('0x3'));var rp=require(_0xf537('0x4'));var moment=require(_0xf537('0x5'));var BPromise=require(_0xf537('0x6'));var Mustache=require('mustache');var util=require(_0xf537('0x7'));var path=require(_0xf537('0x8'));var sox=require(_0xf537('0x9'));var csv=require('to-csv');var ejs=require(_0xf537('0xa'));var fs=require('fs');var fs_extra=require(_0xf537('0xb'));var _=require(_0xf537('0xc'));var squel=require(_0xf537('0xd'));var crypto=require(_0xf537('0xe'));var jsforce=require(_0xf537('0xf'));var deskjs=require(_0xf537('0x10'));var toCsv=require(_0xf537('0x11'));var querystring=require(_0xf537('0x12'));var Papa=require(_0xf537('0x13'));var Redis=require(_0xf537('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf537('0x15'));var hardwareService=require(_0xf537('0x16'));var logger=require(_0xf537('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xf537('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf537('0x19'))['db'];function respondWithStatusCode(_0x44f24a,_0x372d01){_0x372d01=_0x372d01||0xcc;return function(_0x1f35c3){if(_0x1f35c3){return _0x44f24a[_0xf537('0x1a')](_0x372d01);}return _0x44f24a['status'](_0x372d01)[_0xf537('0x1b')]();};}function respondWithResult(_0x4986ec,_0x3fcde4){_0x3fcde4=_0x3fcde4||0xc8;return function(_0x29b645){if(_0x29b645){return _0x4986ec[_0xf537('0x1c')](_0x3fcde4)[_0xf537('0x1d')](_0x29b645);}};}function respondWithFilteredResult(_0x3d8bd2,_0x21e786){return function(_0x2dfd19){if(_0x2dfd19){var _0x2fff5f=typeof _0x21e786['offset']==='undefined'&&typeof _0x21e786['limit']===_0xf537('0x1e');var _0x57a948=_0x2dfd19['count'];var _0x7e942d=_0x2fff5f?0x0:_0x21e786[_0xf537('0x1f')];var _0x1626cd=_0x2fff5f?_0x2dfd19['count']:_0x21e786[_0xf537('0x1f')]+_0x21e786[_0xf537('0x20')];var _0x438420;if(_0x1626cd>=_0x57a948){_0x1626cd=_0x57a948;_0x438420=0xc8;}else{_0x438420=0xce;}_0x3d8bd2['status'](_0x438420);return _0x3d8bd2[_0xf537('0x21')](_0xf537('0x22'),_0x7e942d+'-'+_0x1626cd+'/'+_0x57a948)[_0xf537('0x1d')](_0x2dfd19);}return null;};}function patchUpdates(_0x12ad66){return function(_0x277b69){try{jsonpatch[_0xf537('0x23')](_0x277b69,_0x12ad66,!![]);}catch(_0x46d6e1){return BPromise['reject'](_0x46d6e1);}return _0x277b69[_0xf537('0x24')]();};}function saveUpdates(_0x3f135f,_0x5952b9){return function(_0x4bf2d2){if(_0x4bf2d2){return _0x4bf2d2[_0xf537('0x25')](_0x3f135f)['then'](function(_0x7671f7){return _0x7671f7;});}return null;};}function removeEntity(_0x3521bc,_0x1c5793){return function(_0xf24e97){if(_0xf24e97){return _0xf24e97[_0xf537('0x26')]()['then'](function(){_0x3521bc['status'](0xcc)[_0xf537('0x1b')]();});}};}function handleEntityNotFound(_0x19f490,_0x1e0b3e){return function(_0x5b310a){if(!_0x5b310a){_0x19f490['sendStatus'](0x194);}return _0x5b310a;};}function handleError(_0x13ca1c,_0x5427ba){_0x5427ba=_0x5427ba||0x1f4;return function(_0x47c2bd){logger[_0xf537('0x27')](_0x47c2bd[_0xf537('0x28')]);if(_0x47c2bd['name']){delete _0x47c2bd[_0xf537('0x29')];}_0x13ca1c['status'](_0x5427ba)[_0xf537('0x2a')](_0x47c2bd);};}exports[_0xf537('0x2b')]=function(_0x115a30,_0x397170){var _0x181d16={},_0x2b3f46={},_0x2d4ed8={'count':0x0,'rows':[]};var _0x5a2de7=_['map'](db['ChatTransferReport'][_0xf537('0x2c')],function(_0x1805c3){return{'name':_0x1805c3[_0xf537('0x2d')],'type':_0x1805c3[_0xf537('0x2e')]['key']};});_0x2b3f46['model']=_[_0xf537('0x2f')](_0x5a2de7,_0xf537('0x29'));_0x2b3f46['query']=_[_0xf537('0x30')](_0x115a30['query']);_0x2b3f46[_0xf537('0x31')]=_[_0xf537('0x32')](_0x2b3f46[_0xf537('0x33')],_0x2b3f46['query']);_0x181d16[_0xf537('0x34')]=_[_0xf537('0x32')](_0x2b3f46['model'],qs[_0xf537('0x35')](_0x115a30[_0xf537('0x36')]['fields']));_0x181d16[_0xf537('0x34')]=_0x181d16[_0xf537('0x34')][_0xf537('0x37')]?_0x181d16[_0xf537('0x34')]:_0x2b3f46[_0xf537('0x33')];if(!_0x115a30['query']['hasOwnProperty'](_0xf537('0x38'))){_0x181d16['limit']=qs[_0xf537('0x20')](_0x115a30[_0xf537('0x36')][_0xf537('0x20')]);_0x181d16['offset']=qs[_0xf537('0x1f')](_0x115a30['query'][_0xf537('0x1f')]);}_0x181d16['order']=qs[_0xf537('0x39')](_0x115a30[_0xf537('0x36')][_0xf537('0x39')]);_0x181d16[_0xf537('0x3a')]=qs[_0xf537('0x31')](_[_0xf537('0x3b')](_0x115a30['query'],_0x2b3f46[_0xf537('0x31')]),_0x5a2de7);if(_0x115a30[_0xf537('0x36')][_0xf537('0x3c')]){_0x181d16[_0xf537('0x3a')]=_[_0xf537('0x3d')](_0x181d16[_0xf537('0x3a')],{'$or':_[_0xf537('0x2f')](_0x5a2de7,function(_0x1e4f38){if(_0x1e4f38[_0xf537('0x2e')]!==_0xf537('0x3e')){var _0x3f5cef={};_0x3f5cef[_0x1e4f38[_0xf537('0x29')]]={'$like':'%'+_0x115a30[_0xf537('0x36')][_0xf537('0x3c')]+'%'};return _0x3f5cef;}})});}_0x181d16=_[_0xf537('0x3d')]({},_0x181d16,_0x115a30[_0xf537('0x3f')]);var _0x4f0219={'where':_0x181d16['where']};return db[_0xf537('0x40')][_0xf537('0x41')](_0x4f0219)['then'](function(_0x4b0b18){_0x2d4ed8['count']=_0x4b0b18;if(_0x115a30['query'][_0xf537('0x42')]){_0x181d16[_0xf537('0x43')]=[{'all':!![]}];}return db[_0xf537('0x40')][_0xf537('0x44')](_0x181d16);})[_0xf537('0x45')](function(_0x340072){_0x2d4ed8['rows']=_0x340072;return _0x2d4ed8;})['then'](respondWithFilteredResult(_0x397170,_0x181d16))[_0xf537('0x46')](handleError(_0x397170,null));};exports[_0xf537('0x47')]=function(_0x391ee0,_0x42ac37){var _0x3357c1={'raw':!![],'where':{'id':_0x391ee0[_0xf537('0x48')]['id']}},_0x361e87={};_0x361e87[_0xf537('0x33')]=_[_0xf537('0x30')](db[_0xf537('0x40')]['rawAttributes']);_0x361e87[_0xf537('0x36')]=_['keys'](_0x391ee0[_0xf537('0x36')]);_0x361e87[_0xf537('0x31')]=_[_0xf537('0x32')](_0x361e87['model'],_0x361e87[_0xf537('0x36')]);_0x3357c1[_0xf537('0x34')]=_[_0xf537('0x32')](_0x361e87[_0xf537('0x33')],qs[_0xf537('0x35')](_0x391ee0['query'][_0xf537('0x35')]));_0x3357c1[_0xf537('0x34')]=_0x3357c1[_0xf537('0x34')]['length']?_0x3357c1[_0xf537('0x34')]:_0x361e87[_0xf537('0x33')];if(_0x391ee0['query'][_0xf537('0x42')]){_0x3357c1[_0xf537('0x43')]=[{'all':!![]}];}_0x3357c1=_[_0xf537('0x3d')]({},_0x3357c1,_0x391ee0[_0xf537('0x3f')]);return db[_0xf537('0x40')]['find'](_0x3357c1)[_0xf537('0x45')](handleEntityNotFound(_0x42ac37,null))[_0xf537('0x45')](respondWithResult(_0x42ac37,null))[_0xf537('0x46')](handleError(_0x42ac37,null));};exports['create']=function(_0x122f8a,_0x52e338){return db['ChatTransferReport']['create'](_0x122f8a['body'],{})[_0xf537('0x45')](respondWithResult(_0x52e338,0xc9))[_0xf537('0x46')](handleError(_0x52e338,null));};exports[_0xf537('0x25')]=function(_0x5a2f6e,_0x5ede77){if(_0x5a2f6e[_0xf537('0x49')]['id']){delete _0x5a2f6e[_0xf537('0x49')]['id'];}return db[_0xf537('0x40')]['find']({'where':{'id':_0x5a2f6e['params']['id']}})[_0xf537('0x45')](handleEntityNotFound(_0x5ede77,null))[_0xf537('0x45')](saveUpdates(_0x5a2f6e[_0xf537('0x49')],null))[_0xf537('0x45')](respondWithResult(_0x5ede77,null))[_0xf537('0x46')](handleError(_0x5ede77,null));};exports[_0xf537('0x26')]=function(_0x4afecd,_0x510009){return db['ChatTransferReport']['find']({'where':{'id':_0x4afecd['params']['id']}})[_0xf537('0x45')](handleEntityNotFound(_0x510009,null))[_0xf537('0x45')](removeEntity(_0x510009,null))['catch'](handleError(_0x510009,null));};exports[_0xf537('0x4a')]=function(_0x5566ae,_0x1fd270){return db['ChatTransferReport'][_0xf537('0x4a')]()[_0xf537('0x45')](respondWithResult(_0x1fd270,null))[_0xf537('0x46')](handleError(_0x1fd270,null));}; \ No newline at end of file +var _0x1d27=['intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','then','catch','show','includeAll','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','error','name','index','ChatTransferReport','rawAttributes','fieldName','key','map','query','keys','filters'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1d27,0x140));var _0x71d2=function(_0xb68721,_0x3359f7){_0xb68721=_0xb68721-0x0;var _0xa54960=_0x1d27[_0xb68721];return _0xa54960;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x71d2('0x0'));var zipdir=require(_0x71d2('0x1'));var jsonpatch=require(_0x71d2('0x2'));var rp=require(_0x71d2('0x3'));var moment=require('moment');var BPromise=require(_0x71d2('0x4'));var Mustache=require(_0x71d2('0x5'));var util=require(_0x71d2('0x6'));var path=require(_0x71d2('0x7'));var sox=require(_0x71d2('0x8'));var csv=require(_0x71d2('0x9'));var ejs=require(_0x71d2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x71d2('0xb'));var squel=require(_0x71d2('0xc'));var crypto=require('crypto');var jsforce=require(_0x71d2('0xd'));var deskjs=require(_0x71d2('0xe'));var toCsv=require(_0x71d2('0x9'));var querystring=require(_0x71d2('0xf'));var Papa=require(_0x71d2('0x10'));var Redis=require(_0x71d2('0x11'));var authService=require(_0x71d2('0x12'));var qs=require(_0x71d2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x71d2('0x14'));var logger=require('../../config/logger')(_0x71d2('0x15'));var utils=require(_0x71d2('0x16'));var config=require(_0x71d2('0x17'));var licenseUtil=require(_0x71d2('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a46b2,_0x299da7){_0x299da7=_0x299da7||0xcc;return function(_0x3bd635){if(_0x3bd635){return _0x3a46b2[_0x71d2('0x19')](_0x299da7);}return _0x3a46b2[_0x71d2('0x1a')](_0x299da7)[_0x71d2('0x1b')]();};}function respondWithResult(_0xa71605,_0x216c1b){_0x216c1b=_0x216c1b||0xc8;return function(_0x2ca202){if(_0x2ca202){return _0xa71605['status'](_0x216c1b)[_0x71d2('0x1c')](_0x2ca202);}};}function respondWithFilteredResult(_0x22504d,_0x551b88){return function(_0x42decc){if(_0x42decc){var _0x39daf6=typeof _0x551b88[_0x71d2('0x1d')]===_0x71d2('0x1e')&&typeof _0x551b88[_0x71d2('0x1f')]===_0x71d2('0x1e');var _0x91ea89=_0x42decc[_0x71d2('0x20')];var _0x3e9b0a=_0x39daf6?0x0:_0x551b88[_0x71d2('0x1d')];var _0x42c2c2=_0x39daf6?_0x42decc[_0x71d2('0x20')]:_0x551b88['offset']+_0x551b88[_0x71d2('0x1f')];var _0x4758b4;if(_0x42c2c2>=_0x91ea89){_0x42c2c2=_0x91ea89;_0x4758b4=0xc8;}else{_0x4758b4=0xce;}_0x22504d[_0x71d2('0x1a')](_0x4758b4);return _0x22504d[_0x71d2('0x21')](_0x71d2('0x22'),_0x3e9b0a+'-'+_0x42c2c2+'/'+_0x91ea89)['json'](_0x42decc);}return null;};}function patchUpdates(_0x53b685){return function(_0x230350){try{jsonpatch[_0x71d2('0x23')](_0x230350,_0x53b685,!![]);}catch(_0x57c5b1){return BPromise[_0x71d2('0x24')](_0x57c5b1);}return _0x230350['save']();};}function saveUpdates(_0x5e45ed,_0x546afc){return function(_0x5056f9){if(_0x5056f9){return _0x5056f9[_0x71d2('0x25')](_0x5e45ed)['then'](function(_0x4635cc){return _0x4635cc;});}return null;};}function removeEntity(_0x1b69d3,_0x6ce1b){return function(_0x531c4d){if(_0x531c4d){return _0x531c4d[_0x71d2('0x26')]()['then'](function(){_0x1b69d3[_0x71d2('0x1a')](0xcc)[_0x71d2('0x1b')]();});}};}function handleEntityNotFound(_0x9114fb,_0x1e21e9){return function(_0x215fea){if(!_0x215fea){_0x9114fb['sendStatus'](0x194);}return _0x215fea;};}function handleError(_0x579bd5,_0x2fc04c){_0x2fc04c=_0x2fc04c||0x1f4;return function(_0x48403b){logger[_0x71d2('0x27')](_0x48403b['stack']);if(_0x48403b[_0x71d2('0x28')]){delete _0x48403b[_0x71d2('0x28')];}_0x579bd5['status'](_0x2fc04c)['send'](_0x48403b);};}exports[_0x71d2('0x29')]=function(_0x2e1fb5,_0x442365){var _0x6836df={},_0x5c8a01={},_0x57c15f={'count':0x0,'rows':[]};var _0x376afc=_['map'](db[_0x71d2('0x2a')][_0x71d2('0x2b')],function(_0x19b649){return{'name':_0x19b649[_0x71d2('0x2c')],'type':_0x19b649['type'][_0x71d2('0x2d')]};});_0x5c8a01['model']=_[_0x71d2('0x2e')](_0x376afc,_0x71d2('0x28'));_0x5c8a01[_0x71d2('0x2f')]=_[_0x71d2('0x30')](_0x2e1fb5[_0x71d2('0x2f')]);_0x5c8a01[_0x71d2('0x31')]=_[_0x71d2('0x32')](_0x5c8a01[_0x71d2('0x33')],_0x5c8a01[_0x71d2('0x2f')]);_0x6836df[_0x71d2('0x34')]=_[_0x71d2('0x32')](_0x5c8a01['model'],qs[_0x71d2('0x35')](_0x2e1fb5['query']['fields']));_0x6836df[_0x71d2('0x34')]=_0x6836df['attributes'][_0x71d2('0x36')]?_0x6836df[_0x71d2('0x34')]:_0x5c8a01[_0x71d2('0x33')];if(!_0x2e1fb5[_0x71d2('0x2f')]['hasOwnProperty'](_0x71d2('0x37'))){_0x6836df[_0x71d2('0x1f')]=qs[_0x71d2('0x1f')](_0x2e1fb5[_0x71d2('0x2f')]['limit']);_0x6836df[_0x71d2('0x1d')]=qs[_0x71d2('0x1d')](_0x2e1fb5[_0x71d2('0x2f')][_0x71d2('0x1d')]);}_0x6836df['order']=qs[_0x71d2('0x38')](_0x2e1fb5[_0x71d2('0x2f')][_0x71d2('0x38')]);_0x6836df[_0x71d2('0x39')]=qs[_0x71d2('0x31')](_[_0x71d2('0x3a')](_0x2e1fb5[_0x71d2('0x2f')],_0x5c8a01[_0x71d2('0x31')]),_0x376afc);if(_0x2e1fb5['query'][_0x71d2('0x3b')]){_0x6836df['where']=_[_0x71d2('0x3c')](_0x6836df[_0x71d2('0x39')],{'$or':_[_0x71d2('0x2e')](_0x376afc,function(_0x1a856a){if(_0x1a856a['type']!==_0x71d2('0x3d')){var _0xac6a0d={};_0xac6a0d[_0x1a856a[_0x71d2('0x28')]]={'$like':'%'+_0x2e1fb5['query'][_0x71d2('0x3b')]+'%'};return _0xac6a0d;}})});}_0x6836df=_[_0x71d2('0x3c')]({},_0x6836df,_0x2e1fb5[_0x71d2('0x3e')]);var _0xd43128={'where':_0x6836df[_0x71d2('0x39')]};return db[_0x71d2('0x2a')][_0x71d2('0x20')](_0xd43128)['then'](function(_0x5e8669){_0x57c15f[_0x71d2('0x20')]=_0x5e8669;if(_0x2e1fb5[_0x71d2('0x2f')]['includeAll']){_0x6836df[_0x71d2('0x3f')]=[{'all':!![]}];}return db[_0x71d2('0x2a')]['findAll'](_0x6836df);})['then'](function(_0x59e694){_0x57c15f[_0x71d2('0x40')]=_0x59e694;return _0x57c15f;})[_0x71d2('0x41')](respondWithFilteredResult(_0x442365,_0x6836df))[_0x71d2('0x42')](handleError(_0x442365,null));};exports[_0x71d2('0x43')]=function(_0x3137e1,_0xdafef6){var _0x5dfdc8={'raw':!![],'where':{'id':_0x3137e1['params']['id']}},_0x44a461={};_0x44a461[_0x71d2('0x33')]=_[_0x71d2('0x30')](db[_0x71d2('0x2a')][_0x71d2('0x2b')]);_0x44a461[_0x71d2('0x2f')]=_['keys'](_0x3137e1[_0x71d2('0x2f')]);_0x44a461['filters']=_[_0x71d2('0x32')](_0x44a461[_0x71d2('0x33')],_0x44a461[_0x71d2('0x2f')]);_0x5dfdc8['attributes']=_[_0x71d2('0x32')](_0x44a461[_0x71d2('0x33')],qs[_0x71d2('0x35')](_0x3137e1[_0x71d2('0x2f')][_0x71d2('0x35')]));_0x5dfdc8['attributes']=_0x5dfdc8[_0x71d2('0x34')][_0x71d2('0x36')]?_0x5dfdc8['attributes']:_0x44a461[_0x71d2('0x33')];if(_0x3137e1[_0x71d2('0x2f')][_0x71d2('0x44')]){_0x5dfdc8[_0x71d2('0x3f')]=[{'all':!![]}];}_0x5dfdc8=_[_0x71d2('0x3c')]({},_0x5dfdc8,_0x3137e1[_0x71d2('0x3e')]);return db['ChatTransferReport'][_0x71d2('0x45')](_0x5dfdc8)[_0x71d2('0x41')](handleEntityNotFound(_0xdafef6,null))['then'](respondWithResult(_0xdafef6,null))[_0x71d2('0x42')](handleError(_0xdafef6,null));};exports['create']=function(_0x1787f0,_0x1f9c1d){return db['ChatTransferReport'][_0x71d2('0x46')](_0x1787f0[_0x71d2('0x47')],{})[_0x71d2('0x41')](respondWithResult(_0x1f9c1d,0xc9))[_0x71d2('0x42')](handleError(_0x1f9c1d,null));};exports['update']=function(_0x2c3803,_0x54b354){if(_0x2c3803[_0x71d2('0x47')]['id']){delete _0x2c3803['body']['id'];}return db['ChatTransferReport'][_0x71d2('0x45')]({'where':{'id':_0x2c3803[_0x71d2('0x48')]['id']}})[_0x71d2('0x41')](handleEntityNotFound(_0x54b354,null))['then'](saveUpdates(_0x2c3803[_0x71d2('0x47')],null))[_0x71d2('0x41')](respondWithResult(_0x54b354,null))['catch'](handleError(_0x54b354,null));};exports[_0x71d2('0x26')]=function(_0x31a3ed,_0x355c57){return db['ChatTransferReport']['find']({'where':{'id':_0x31a3ed[_0x71d2('0x48')]['id']}})[_0x71d2('0x41')](handleEntityNotFound(_0x355c57,null))[_0x71d2('0x41')](removeEntity(_0x355c57,null))[_0x71d2('0x42')](handleError(_0x355c57,null));};exports[_0x71d2('0x49')]=function(_0x4de082,_0x5d43fb){return db['ChatTransferReport']['describe']()['then'](respondWithResult(_0x5d43fb,null))[_0x71d2('0x42')](handleError(_0x5d43fb,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 92dda3d..6ca6ade 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 _0x6012=['../../config/logger','api','request-promise','path','../../config/environment','./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid','util'];(function(_0xfc7744,_0x1905fa){var _0x4dcf61=function(_0x293985){while(--_0x293985){_0xfc7744['push'](_0xfc7744['shift']());}};_0x4dcf61(++_0x1905fa);}(_0x6012,0x83));var _0x2601=function(_0x2d61ac,_0x18ff36){_0x2d61ac=_0x2d61ac-0x0;var _0x3f7d3c=_0x6012[_0x2d61ac];return _0x3f7d3c;};'use strict';var _=require('lodash');var util=require(_0x2601('0x0'));var logger=require(_0x2601('0x1'))(_0x2601('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2601('0x3'));var fs=require('fs');var path=require(_0x2601('0x4'));var rimraf=require('rimraf');var config=require(_0x2601('0x5'));var attributes=require(_0x2601('0x6'));module[_0x2601('0x7')]=function(_0x380efc,_0x3efc8a){return _0x380efc[_0x2601('0x8')]('ChatTransferReport',attributes,{'tableName':_0x2601('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2601('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x49c1=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','uniqueid'];(function(_0x2c0c66,_0x400cb4){var _0x26a228=function(_0x1c1f79){while(--_0x1c1f79){_0x2c0c66['push'](_0x2c0c66['shift']());}};_0x26a228(++_0x400cb4);}(_0x49c1,0x9c));var _0x149c=function(_0x1f3f42,_0x3ca015){_0x1f3f42=_0x1f3f42-0x0;var _0x34e5a2=_0x49c1[_0x1f3f42];return _0x34e5a2;};'use strict';var _=require(_0x149c('0x0'));var util=require(_0x149c('0x1'));var logger=require(_0x149c('0x2'))('api');var moment=require(_0x149c('0x3'));var BPromise=require(_0x149c('0x4'));var rp=require(_0x149c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x149c('0x6'));var config=require(_0x149c('0x7'));var attributes=require(_0x149c('0x8'));module[_0x149c('0x9')]=function(_0x2c05d8,_0x5d322a){return _0x2c05d8['define'](_0x149c('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x149c('0xb'),'fields':[_0x149c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 156a309..d0ff9e5 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 _0x7b41=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x2cb4f1,_0x4e2e87){var _0xb311a3=function(_0x170efc){while(--_0x170efc){_0x2cb4f1['push'](_0x2cb4f1['shift']());}};_0xb311a3(++_0x4e2e87);}(_0x7b41,0xff));var _0x17b4=function(_0xe2306,_0x1241a8){_0xe2306=_0xe2306-0x0;var _0x1d6a96=_0x7b41[_0xe2306];return _0x1d6a96;};'use strict';var _=require(_0x17b4('0x0'));var util=require(_0x17b4('0x1'));var moment=require('moment');var BPromise=require(_0x17b4('0x2'));var rs=require(_0x17b4('0x3'));var fs=require('fs');var Redis=require(_0x17b4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x17b4('0x5'));var logger=require(_0x17b4('0x6'))(_0x17b4('0x7'));var config=require(_0x17b4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x17b4('0x9')][_0x17b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2063fa,_0x23a170,_0x627fe4){return new BPromise(function(_0x2d5054,_0xa397c3){return client[_0x17b4('0xb')](_0x2063fa,_0x627fe4)[_0x17b4('0xc')](function(_0x52105f){logger[_0x17b4('0xd')](_0x17b4('0xe'),_0x23a170,_0x17b4('0xf'));logger[_0x17b4('0x10')](_0x17b4('0x11'),_0x23a170,_0x17b4('0xf'),JSON['stringify'](_0x52105f));if(_0x52105f[_0x17b4('0x12')]){if(_0x52105f[_0x17b4('0x12')][_0x17b4('0x13')]===0x1f4){logger[_0x17b4('0x12')](_0x17b4('0xe'),_0x23a170,_0x52105f[_0x17b4('0x12')][_0x17b4('0x14')]);return _0xa397c3(_0x52105f[_0x17b4('0x12')]['message']);}logger[_0x17b4('0x12')](_0x17b4('0xe'),_0x23a170,_0x52105f['error']['message']);return _0x2d5054(_0x52105f['error'][_0x17b4('0x14')]);}else{logger[_0x17b4('0xd')](_0x17b4('0xe'),_0x23a170,_0x17b4('0xf'));_0x2d5054(_0x52105f[_0x17b4('0x15')][_0x17b4('0x14')]);}})[_0x17b4('0x16')](function(_0x15b903){logger[_0x17b4('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x23a170,_0x15b903);_0xa397c3(_0x15b903);});});} \ No newline at end of file +var _0x4de8=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','catch'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x4de8,0x159));var _0x84de=function(_0x440e3d,_0x41466f){_0x440e3d=_0x440e3d-0x0;var _0x2c2a6e=_0x4de8[_0x440e3d];return _0x2c2a6e;};'use strict';var _=require(_0x84de('0x0'));var util=require(_0x84de('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x84de('0x2'));var fs=require('fs');var Redis=require(_0x84de('0x3'));var db=require(_0x84de('0x4'))['db'];var utils=require(_0x84de('0x5'));var logger=require(_0x84de('0x6'))(_0x84de('0x7'));var config=require(_0x84de('0x8'));var jayson=require(_0x84de('0x9'));var client=jayson[_0x84de('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38ce8f,_0x1d9b16,_0x58c0b){return new BPromise(function(_0x460cd9,_0x364009){return client[_0x84de('0xb')](_0x38ce8f,_0x58c0b)[_0x84de('0xc')](function(_0x3983da){logger[_0x84de('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x1d9b16,_0x84de('0xe'));logger['debug'](_0x84de('0xf'),_0x1d9b16,'request\x20sent',JSON[_0x84de('0x10')](_0x3983da));if(_0x3983da[_0x84de('0x11')]){if(_0x3983da[_0x84de('0x11')][_0x84de('0x12')]===0x1f4){logger[_0x84de('0x11')](_0x84de('0x13'),_0x1d9b16,_0x3983da['error'][_0x84de('0x14')]);return _0x364009(_0x3983da[_0x84de('0x11')][_0x84de('0x14')]);}logger[_0x84de('0x11')](_0x84de('0x13'),_0x1d9b16,_0x3983da[_0x84de('0x11')]['message']);return _0x460cd9(_0x3983da[_0x84de('0x11')][_0x84de('0x14')]);}else{logger['info'](_0x84de('0x13'),_0x1d9b16,_0x84de('0xe'));_0x460cd9(_0x3983da[_0x84de('0x15')]['message']);}})[_0x84de('0x16')](function(_0x39a82f){logger[_0x84de('0x11')](_0x84de('0x13'),_0x1d9b16,_0x39a82f);_0x364009(_0x39a82f);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 01ee479..17f5538 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 _0xe6ef=['exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xe6ef,0x131));var _0xfe6e=function(_0x19aca1,_0x4d76ee){_0x19aca1=_0x19aca1-0x0;var _0x78143=_0xe6ef[_0x19aca1];return _0x78143;};'use strict';var multer=require(_0xfe6e('0x0'));var util=require(_0xfe6e('0x1'));var path=require('path');var timeout=require(_0xfe6e('0x2'));var express=require('express');var router=express[_0xfe6e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfe6e('0x4'));var interaction=require(_0xfe6e('0x5'));var config=require(_0xfe6e('0x6'));var controller=require('./chatTransferReport.controller');router[_0xfe6e('0x7')]('/',auth[_0xfe6e('0x8')](),controller['index']);router['get'](_0xfe6e('0x9'),auth[_0xfe6e('0x8')](),controller['describe']);router['get'](_0xfe6e('0xa'),auth[_0xfe6e('0x8')](),controller[_0xfe6e('0xb')]);router[_0xfe6e('0xc')]('/',auth[_0xfe6e('0x8')](),controller[_0xfe6e('0xd')]);router[_0xfe6e('0xe')](_0xfe6e('0xa'),auth[_0xfe6e('0x8')](),controller[_0xfe6e('0xf')]);router[_0xfe6e('0x10')]('/:id',auth[_0xfe6e('0x8')](),controller[_0xfe6e('0x11')]);module[_0xfe6e('0x12')]=router; \ No newline at end of file +var _0x00f3=['index','/describe','/:id','show','create','put','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x00f3,0x8e));var _0x300f=function(_0x10f5ee,_0x5894ff){_0x10f5ee=_0x10f5ee-0x0;var _0x1cb7d8=_0x00f3[_0x10f5ee];return _0x1cb7d8;};'use strict';var multer=require(_0x300f('0x0'));var util=require('util');var path=require(_0x300f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x300f('0x2')]();var fs_extra=require(_0x300f('0x3'));var auth=require(_0x300f('0x4'));var interaction=require(_0x300f('0x5'));var config=require(_0x300f('0x6'));var controller=require(_0x300f('0x7'));router[_0x300f('0x8')]('/',auth[_0x300f('0x9')](),controller[_0x300f('0xa')]);router[_0x300f('0x8')](_0x300f('0xb'),auth[_0x300f('0x9')](),controller['describe']);router[_0x300f('0x8')](_0x300f('0xc'),auth[_0x300f('0x9')](),controller[_0x300f('0xd')]);router['post']('/',auth[_0x300f('0x9')](),controller[_0x300f('0xe')]);router[_0x300f('0xf')](_0x300f('0xc'),auth[_0x300f('0x9')](),controller['update']);router[_0x300f('0x10')](_0x300f('0xc'),auth['isAuthenticated'](),controller[_0x300f('0x11')]);module[_0x300f('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index c28fc1b..233b8af 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 _0x63da=['STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','star','thumb','TEXT','stringify','input','name','text','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','website_alias','bottom_right','CHAT','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize'];(function(_0x7b173,_0x539d7f){var _0x1c598c=function(_0xe1e1e0){while(--_0xe1e1e0){_0x7b173['push'](_0x7b173['shift']());}};_0x1c598c(++_0x539d7f);}(_0x63da,0xf9));var _0xa63d=function(_0x388e27,_0x276fd5){_0x388e27=_0x388e27-0x0;var _0x19613d=_0x63da[_0x388e27];return _0x19613d;};'use strict';var Sequelize=require(_0xa63d('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xa63d('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0xa63d('0x1')],'allowNull':![],'unique':_0xa63d('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xa63d('0x1')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xa63d('0x1')],'defaultValue':_0xa63d('0x3')},'key':{'type':Sequelize[_0xa63d('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xa63d('0x4')},'customerAlias':{'type':Sequelize[_0xa63d('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xa63d('0x1')],'allowNull':![],'defaultValue':_0xa63d('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xa63d('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xa63d('0x1')],'allowNull':![],'defaultValue':_0xa63d('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xa63d('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xa63d('0x1')]},'animation':{'type':Sequelize[_0xa63d('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xa63d('0x9')](_0xa63d('0xa'),_0xa63d('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xa63d('0x1')],'defaultValue':_0xa63d('0xc')},'start_chat_button':{'type':Sequelize[_0xa63d('0x1')],'defaultValue':_0xa63d('0xd')},'offline_chat_button':{'type':Sequelize[_0xa63d('0x1')],'defaultValue':_0xa63d('0xe')},'header_offline':{'type':Sequelize[_0xa63d('0x1')],'defaultValue':_0xa63d('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xa63d('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xa63d('0x1')],'defaultValue':_0xa63d('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xa63d('0x1')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xa63d('0x1')],'defaultValue':_0xa63d('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xa63d('0x1')],'defaultValue':_0xa63d('0x12')},'noteTitle':{'type':Sequelize[_0xa63d('0x1')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xa63d('0x1')],'defaultValue':_0xa63d('0x13')},'closingMessage':{'type':Sequelize[_0xa63d('0x1')],'defaultValue':_0xa63d('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xa63d('0xe')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xa63d('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa63d('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xa63d('0x1')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xa63d('0x9')](_0xa63d('0x15'),_0xa63d('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xa63d('0x17')],'defaultValue':function(){return JSON[_0xa63d('0x18')]({'items':[{'type':_0xa63d('0x19'),'variable':null,'config':{'placeholder':_0xa63d('0x1a'),'type':_0xa63d('0x1b'),'required':!![]},'props':{'title':_0xa63d('0x1a'),'helpText':''}},{'type':_0xa63d('0x19'),'props':{'title':_0xa63d('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xa63d('0x1c')](_0xa63d('0x1d'))?JSON['parse'](this['getDataValue']('onlineForm')):{};},'set':function(_0x5a206a){return this[_0xa63d('0x1e')](_0xa63d('0x1d'),JSON[_0xa63d('0x18')](_0x5a206a));}},'offlineForm':{'type':Sequelize[_0xa63d('0x17')],'defaultValue':function(){return JSON[_0xa63d('0x18')]({'items':[{'type':_0xa63d('0x19'),'props':{'title':_0xa63d('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null},{'type':_0xa63d('0x1f'),'config':{'placeholder':'Comments'},'props':{'title':_0xa63d('0x20'),'helpText':_0xa63d('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0xa63d('0x1c')](_0xa63d('0x22'))?JSON[_0xa63d('0x23')](this[_0xa63d('0x1c')]('offlineForm')):{};},'set':function(_0x343b79){return this[_0xa63d('0x1e')](_0xa63d('0x22'),JSON['stringify'](_0x343b79));}},'token':{'type':Sequelize[_0xa63d('0x1')],'defaultValue':function(){return rs[_0xa63d('0x24')]();}},'autoclose':{'type':Sequelize[_0xa63d('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xa63d('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xa63d('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xa63d('0x1')]},'waitingTitle':{'type':Sequelize[_0xa63d('0x1')],'defaultValue':_0xa63d('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa63d('0x26')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xa63d('0x1')],'defaultValue':_0xa63d('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0xa63d('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa63d('0x28')},'skipUnmanaged':{'type':Sequelize[_0xa63d('0x1')],'defaultValue':_0xa63d('0x29')},'sendUnmanaged':{'type':Sequelize[_0xa63d('0x1')],'defaultValue':_0xa63d('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0xa63d('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xa63d('0x17')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xa63d('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xa63d('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa63d('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xa63d('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xa63d('0x1')],'defaultValue':_0xa63d('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0xa63d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xa63d('0x2b')},'verticalAlignment':{'type':Sequelize[_0xa63d('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0xa63d('0x2c')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xa63d('0x1')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xa63d('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xa63d('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xa63d('0x1')],'allowNull':![],'defaultValue':_0xa63d('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xa63d('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa63d('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa63d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xa63d('0x1')],'defaultValue':_0xa63d('0x2e')},'systemAvatar':{'type':Sequelize[_0xa63d('0x17')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa63d('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xa63d('0x8')],'defaultValue':![],'comment':_0xa63d('0x2f'),'set':function(_0x7baa41){if(!_0x7baa41)this[_0xa63d('0x1e')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xa63d('0x30'),_0x7baa41);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xa63d('0x1')]},'vidaooTopic':{'type':Sequelize[_0xa63d('0x1')],'allowNull':![],'defaultValue':_0xa63d('0x31')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xa63d('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xa63d('0x17')]}}; \ No newline at end of file +var _0x9e00=['#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','star','thumb','stringify','input','name','getDataValue','parse','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A'];(function(_0x33c8db,_0x5d6316){var _0x1746a6=function(_0x5d815e){while(--_0x5d815e){_0x33c8db['push'](_0x33c8db['shift']());}};_0x1746a6(++_0x5d6316);}(_0x9e00,0x164));var _0x09e0=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x9e00[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x09e0('0x0'));var rs=require(_0x09e0('0x1'));module[_0x09e0('0x2')]={'name':{'type':Sequelize[_0x09e0('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x09e0('0x3')],'allowNull':![],'unique':_0x09e0('0x4')},'description':{'type':Sequelize[_0x09e0('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x09e0('0x5')},'mapKeyOffline':{'type':Sequelize[_0x09e0('0x3')],'defaultValue':_0x09e0('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x09e0('0x3')],'defaultValue':_0x09e0('0x6')},'customerAlias':{'type':Sequelize[_0x09e0('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x09e0('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x09e0('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x09e0('0x3')],'allowNull':![],'defaultValue':_0x09e0('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x09e0('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x09e0('0x3')]},'animation':{'type':Sequelize[_0x09e0('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x09e0('0xb')](_0x09e0('0xc'),_0x09e0('0xd')),'defaultValue':_0x09e0('0xc')},'header_online':{'type':Sequelize[_0x09e0('0x3')],'defaultValue':_0x09e0('0xe')},'start_chat_button':{'type':Sequelize[_0x09e0('0x3')],'defaultValue':_0x09e0('0xf')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x09e0('0x10')},'header_offline':{'type':Sequelize[_0x09e0('0x3')],'defaultValue':_0x09e0('0x11')},'download_transcript':{'type':Sequelize[_0x09e0('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x09e0('0x3')],'defaultValue':_0x09e0('0x12')},'defaultWhiteLabel':{'type':Sequelize[_0x09e0('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x09e0('0x13')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x09e0('0x3')],'defaultValue':_0x09e0('0x14')},'formSubmitFailureMessage':{'type':Sequelize[_0x09e0('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x09e0('0x3')],'defaultValue':_0x09e0('0x15')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x09e0('0x16')},'closingMessage':{'type':Sequelize[_0x09e0('0x3')],'defaultValue':_0x09e0('0x17')},'closingMessageButton':{'type':Sequelize[_0x09e0('0x3')],'defaultValue':_0x09e0('0x10')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x09e0('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x09e0('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x09e0('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x09e0('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x09e0('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x09e0('0xb')](_0x09e0('0x18'),_0x09e0('0x19')),'defaultValue':_0x09e0('0x18')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x09e0('0x13')],'defaultValue':function(){return JSON[_0x09e0('0x1a')]({'items':[{'type':_0x09e0('0x1b'),'variable':null,'config':{'placeholder':_0x09e0('0x1c'),'type':'text','required':!![]},'props':{'title':_0x09e0('0x1c'),'helpText':''}},{'type':'input','props':{'title':_0x09e0('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x09e0('0x5'),'type':_0x09e0('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x09e0('0x1d')]('onlineForm')?JSON[_0x09e0('0x1e')](this['getDataValue'](_0x09e0('0x1f'))):{};},'set':function(_0x5ae253){return this[_0x09e0('0x20')](_0x09e0('0x1f'),JSON[_0x09e0('0x1a')](_0x5ae253));}},'offlineForm':{'type':Sequelize[_0x09e0('0x13')],'defaultValue':function(){return JSON[_0x09e0('0x1a')]({'items':[{'type':_0x09e0('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x09e0('0x5'),'type':_0x09e0('0x5')},'variable':null},{'type':_0x09e0('0x21'),'config':{'placeholder':'Comments'},'props':{'title':_0x09e0('0x22'),'helpText':_0x09e0('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0x09e0('0x1d')](_0x09e0('0x24'))?JSON[_0x09e0('0x1e')](this[_0x09e0('0x1d')](_0x09e0('0x24'))):{};},'set':function(_0x4b3207){return this[_0x09e0('0x20')](_0x09e0('0x24'),JSON[_0x09e0('0x1a')](_0x4b3207));}},'token':{'type':Sequelize[_0x09e0('0x3')],'defaultValue':function(){return rs[_0x09e0('0x25')]();}},'autoclose':{'type':Sequelize[_0x09e0('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x09e0('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x09e0('0x3')]},'forwardOffline':{'type':Sequelize[_0x09e0('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x09e0('0x3')]},'waitingTitle':{'type':Sequelize[_0x09e0('0x3')],'defaultValue':_0x09e0('0x26')},'waitingMessage':{'type':Sequelize[_0x09e0('0x3')],'defaultValue':_0x09e0('0x27')},'offlineMessageSubject':{'type':Sequelize[_0x09e0('0x3')],'defaultValue':_0x09e0('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x09e0('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x09e0('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x09e0('0x3')],'defaultValue':_0x09e0('0x2a')},'skipUnmanaged':{'type':Sequelize[_0x09e0('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x09e0('0x3')],'defaultValue':_0x09e0('0x10')},'enableCustomerAttachment':{'type':Sequelize[_0x09e0('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x09e0('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x09e0('0x13')],'defaultValue':function(){return _0x09e0('0x2b');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x09e0('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x09e0('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x09e0('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x09e0('0x2c')},'verticalAlignment':{'type':Sequelize[_0x09e0('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x09e0('0x3')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x09e0('0x3')],'defaultValue':_0x09e0('0x2d')},'defaultTitle':{'type':Sequelize[_0x09e0('0x3')]},'customerAvatar':{'type':Sequelize[_0x09e0('0x13')]},'showCustomerAvatar':{'type':Sequelize[_0x09e0('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x09e0('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x09e0('0x3')],'allowNull':![],'defaultValue':_0x09e0('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x09e0('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x09e0('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x09e0('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x09e0('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x09e0('0x3')],'defaultValue':_0x09e0('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x09e0('0x9')],'comment':_0x09e0('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x09e0('0xa')],'defaultValue':![],'comment':_0x09e0('0x31'),'set':function(_0x3830e2){if(!_0x3830e2)this[_0x09e0('0x20')]('mandatoryDispositionPauseId',null);this[_0x09e0('0x20')](_0x09e0('0x32'),_0x3830e2);}},'vidaooEscalation':{'type':Sequelize[_0x09e0('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x09e0('0x3')]},'vidaooTopic':{'type':Sequelize[_0x09e0('0x3')],'allowNull':![],'defaultValue':_0x09e0('0x33')},'vidaooNote':{'type':Sequelize[_0x09e0('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x09e0('0x13')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x09e0('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x09e0('0x13')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 7bb9804..7f642b2 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 _0xc805=['SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','MailAccountId','toPairsIn','subjectOffline','Chat','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','fullname','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','timezone','iftime\x20%s','interval','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','all','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','alignment','color_button','backgroundColor','addApplications','transaction','Transaction','READ_COMMITTED','findOne','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','Contact','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','bluebird','util','path','ejs','fs-extra','lodash','ioredis','../../components/parsers/qs','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','client','http','request','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result','catch','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','ChatWebsites','sendStatus','stack','name','send','index','Pause','map','ChatWebsite','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','include','rows','params','mandatoryDispositionPause','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatWebsiteId','Disposition','fields','hasOwnProperty','findAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','List','Contacts','DESC','ChatApplication','Applications','applications','list','orderBy','priority','asc','account','ListId','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','vendor','%s\x20%s\x20%s','type','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','contact','lastName','messageId','created','autoclose','push','close','ChatMessage','AttachmentId','UserId','User','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','files','createdAt','CompanyId','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','attachments','offline-chat','sequelize','Attachment','bulkCreate','Smtp','forwardOfflineAddress','service','host','port','secure','auth','pass'];(function(_0x16eb11,_0x1a2251){var _0x3ae7ef=function(_0x575a01){while(--_0x575a01){_0x16eb11['push'](_0x16eb11['shift']());}};_0x3ae7ef(++_0x1a2251);}(_0xc805,0x171));var _0x5c80=function(_0x35c300,_0x284351){_0x35c300=_0x35c300-0x0;var _0x59e44b=_0xc805[_0x35c300];return _0x59e44b;};'use strict';var BPromise=require(_0x5c80('0x0'));var Mustache=require('mustache');var util=require(_0x5c80('0x1'));var path=require(_0x5c80('0x2'));var ejs=require(_0x5c80('0x3'));var fs=require('fs');var fs_extra=require(_0x5c80('0x4'));var _=require(_0x5c80('0x5'));var querystring=require('querystring');var Redis=require(_0x5c80('0x6'));var qs=require(_0x5c80('0x7'));var logger=require('../../config/logger')(_0x5c80('0x8'));var config=require('../../config/environment');var db=require(_0x5c80('0x9'))['db'];config[_0x5c80('0xa')]=_[_0x5c80('0xb')](config['redis'],{'host':_0x5c80('0xc'),'port':0x18eb});var socket=require(_0x5c80('0xd'))(new Redis(config[_0x5c80('0xa')]));require(_0x5c80('0xe'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x5c80('0xf')][_0x5c80('0x10')]({'port':0x232c});var client9002=jayson['client'][_0x5c80('0x10')]({'port':0x232a});var client9003=jayson[_0x5c80('0xf')][_0x5c80('0x10')]({'port':0x232b});var client9001=jayson[_0x5c80('0xf')]['http']({'port':0x2329});function respondWithRpcPromise(_0x2b036b,_0x2e77c4,_0x4d0598,_0x264cd9){return new BPromise(function(_0x242888,_0x36fe36){var _0xc08a5d=_0x264cd9||client;return _0xc08a5d[_0x5c80('0x11')](_0x2b036b,_0x4d0598)[_0x5c80('0x12')](function(_0x331954){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x2e77c4,_0x5c80('0x13'));logger[_0x5c80('0x14')](_0x5c80('0x15'),_0x2e77c4,_0x5c80('0x13'),JSON[_0x5c80('0x16')](_0x331954));if(_0x331954['error']){if(_0x331954[_0x5c80('0x17')][_0x5c80('0x18')]===0x1f4){logger[_0x5c80('0x17')](_0x5c80('0x19'),_0x2e77c4,_0x331954[_0x5c80('0x17')][_0x5c80('0x1a')]);return _0x36fe36(_0x331954[_0x5c80('0x17')][_0x5c80('0x1a')]);}logger[_0x5c80('0x17')](_0x5c80('0x19'),_0x2e77c4,_0x331954[_0x5c80('0x17')][_0x5c80('0x1a')]);return _0x242888(_0x331954[_0x5c80('0x17')]['message']);}else{logger[_0x5c80('0x1b')](_0x5c80('0x19'),_0x2e77c4,_0x5c80('0x13'));_0x242888(_0x331954[_0x5c80('0x1c')][_0x5c80('0x1a')]);}})[_0x5c80('0x1d')](function(_0x4c1147){logger[_0x5c80('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x2e77c4,_0x4c1147);_0x36fe36(_0x4c1147);});});}function respondWithStatusCode(_0x2d3b9a,_0x3b1585){_0x3b1585=_0x3b1585||0xcc;return function(_0x1a9fdb){if(_0x1a9fdb){return _0x2d3b9a['sendStatus'](_0x3b1585);}return _0x2d3b9a['status'](_0x3b1585)[_0x5c80('0x1e')]();};}function respondWithResult(_0x2b5530,_0x4474a7){_0x4474a7=_0x4474a7||0xc8;return function(_0x33f83c){if(_0x33f83c){return _0x2b5530[_0x5c80('0x1f')](_0x4474a7)[_0x5c80('0x20')](_0x33f83c);}};}function respondWithFilteredResult(_0x489dd6,_0x5ae145){return function(_0x2355c6){if(_0x2355c6){var _0x3b5c7a=typeof _0x5ae145[_0x5c80('0x21')]===_0x5c80('0x22')&&typeof _0x5ae145[_0x5c80('0x23')]==='undefined';var _0x4e0fb3=_0x2355c6[_0x5c80('0x24')];var _0x3778da=_0x3b5c7a?0x0:_0x5ae145['offset'];var _0x393244=_0x3b5c7a?_0x2355c6[_0x5c80('0x24')]:_0x5ae145[_0x5c80('0x21')]+_0x5ae145[_0x5c80('0x23')];var _0x1a64d0;if(_0x393244>=_0x4e0fb3){_0x393244=_0x4e0fb3;_0x1a64d0=0xc8;}else{_0x1a64d0=0xce;}_0x489dd6[_0x5c80('0x1f')](_0x1a64d0);return _0x489dd6[_0x5c80('0x25')](_0x5c80('0x26'),_0x3778da+'-'+_0x393244+'/'+_0x4e0fb3)[_0x5c80('0x20')](_0x2355c6);}return null;};}function saveUpdates(_0x446527){return function(_0x2c6380){if(_0x2c6380){return _0x2c6380[_0x5c80('0x27')](_0x446527)[_0x5c80('0x12')](function(_0x54ae40){return _0x54ae40;});}return null;};}function removeEntity(_0x5cd5a5){return function(_0x35f51b){if(_0x35f51b){return _0x35f51b[_0x5c80('0x28')]()['then'](function(){var _0x34a246=_0x35f51b[_0x5c80('0x29')]({'plain':!![]});var _0x410772=_0x5c80('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x410772,'resourceId':_0x34a246['id']}})[_0x5c80('0x12')](function(){return _0x35f51b;});})[_0x5c80('0x12')](function(){_0x5cd5a5['status'](0xcc)[_0x5c80('0x1e')]();});}};}function handleEntityNotFound(_0xef11bb){return function(_0x3f48e1){if(!_0x3f48e1){_0xef11bb[_0x5c80('0x2b')](0x194);}return _0x3f48e1;};}function handleError(_0x771015,_0x2deee7){_0x2deee7=_0x2deee7||0x1f4;return function(_0x595c2b){logger[_0x5c80('0x17')](_0x595c2b[_0x5c80('0x2c')]);if(_0x595c2b['name']){delete _0x595c2b[_0x5c80('0x2d')];}_0x771015[_0x5c80('0x1f')](_0x2deee7)[_0x5c80('0x2e')](_0x595c2b);};}exports[_0x5c80('0x2f')]=function(_0x1f2889,_0x1bf20c){var _0x125d6f={'include':[{'model':db[_0x5c80('0x30')],'as':'mandatoryDispositionPause'}]},_0x4c40b6={},_0x4fa050={'count':0x0,'rows':[]};var _0x2a4f76=_[_0x5c80('0x31')](db[_0x5c80('0x32')][_0x5c80('0x33')],function(_0x5b6e33){return{'name':_0x5b6e33[_0x5c80('0x34')],'type':_0x5b6e33['type'][_0x5c80('0x35')]};});_0x4c40b6[_0x5c80('0x36')]=_[_0x5c80('0x31')](_0x2a4f76,'name');_0x4c40b6[_0x5c80('0x37')]=_[_0x5c80('0x38')](_0x1f2889[_0x5c80('0x37')]);_0x4c40b6[_0x5c80('0x39')]=_[_0x5c80('0x3a')](_0x4c40b6[_0x5c80('0x36')],_0x4c40b6['query']);_0x125d6f[_0x5c80('0x3b')]=_[_0x5c80('0x3a')](_0x4c40b6[_0x5c80('0x36')],qs['fields'](_0x1f2889[_0x5c80('0x37')]['fields']));_0x125d6f[_0x5c80('0x3b')]=_0x125d6f[_0x5c80('0x3b')][_0x5c80('0x3c')]?_0x125d6f['attributes']:_0x4c40b6['model'];if(!_0x1f2889[_0x5c80('0x37')]['hasOwnProperty'](_0x5c80('0x3d'))){_0x125d6f[_0x5c80('0x23')]=qs[_0x5c80('0x23')](_0x1f2889[_0x5c80('0x37')][_0x5c80('0x23')]);_0x125d6f['offset']=qs[_0x5c80('0x21')](_0x1f2889[_0x5c80('0x37')]['offset']);}_0x125d6f[_0x5c80('0x3e')]=qs[_0x5c80('0x3f')](_0x1f2889['query'][_0x5c80('0x3f')]);_0x125d6f[_0x5c80('0x40')]=qs[_0x5c80('0x39')](_[_0x5c80('0x41')](_0x1f2889[_0x5c80('0x37')],_0x4c40b6[_0x5c80('0x39')]),_0x2a4f76);if(_0x1f2889['query'][_0x5c80('0x42')]){_0x125d6f[_0x5c80('0x40')]=_['merge'](_0x125d6f['where'],{'$or':_[_0x5c80('0x31')](_0x2a4f76,function(_0x438164){if(_0x438164['type']!=='VIRTUAL'){var _0x218011={};_0x218011[_0x438164[_0x5c80('0x2d')]]={'$like':'%'+_0x1f2889[_0x5c80('0x37')]['filter']+'%'};return _0x218011;}})});}_0x125d6f=_[_0x5c80('0x43')]({},_0x125d6f,_0x1f2889[_0x5c80('0x44')]);var _0x409240={'where':_0x125d6f[_0x5c80('0x40')]};return db[_0x5c80('0x32')]['count'](_0x409240)[_0x5c80('0x12')](function(_0x524e30){_0x4fa050[_0x5c80('0x24')]=_0x524e30;if(_0x1f2889[_0x5c80('0x37')]['includeAll']){_0x125d6f[_0x5c80('0x45')]=[{'all':!![]}];}return db[_0x5c80('0x32')]['findAll'](_0x125d6f);})[_0x5c80('0x12')](function(_0x1d770a){_0x4fa050[_0x5c80('0x46')]=_0x1d770a;return _0x4fa050;})[_0x5c80('0x12')](respondWithFilteredResult(_0x1bf20c,_0x125d6f))[_0x5c80('0x1d')](handleError(_0x1bf20c,null));};exports['show']=function(_0x13fb5b,_0x14e747){var _0x53996c={'raw':![],'where':{'id':_0x13fb5b[_0x5c80('0x47')]['id']},'include':[{'model':db[_0x5c80('0x30')],'as':_0x5c80('0x48')}]},_0x4ec946={};_0x4ec946['model']=_[_0x5c80('0x38')](db[_0x5c80('0x32')]['rawAttributes']);_0x4ec946[_0x5c80('0x37')]=_[_0x5c80('0x38')](_0x13fb5b[_0x5c80('0x37')]);_0x4ec946['filters']=_[_0x5c80('0x3a')](_0x4ec946[_0x5c80('0x36')],_0x4ec946['query']);_0x53996c['attributes']=_[_0x5c80('0x3a')](_0x4ec946[_0x5c80('0x36')],qs['fields'](_0x13fb5b[_0x5c80('0x37')]['fields']));_0x53996c[_0x5c80('0x3b')]=_0x53996c[_0x5c80('0x3b')][_0x5c80('0x3c')]?_0x53996c['attributes']:_0x4ec946[_0x5c80('0x36')];if(_0x13fb5b[_0x5c80('0x37')][_0x5c80('0x49')]){_0x53996c[_0x5c80('0x45')]=[{'all':!![]}];}_0x53996c=_['merge']({},_0x53996c,_0x13fb5b[_0x5c80('0x44')]);return db[_0x5c80('0x32')]['find'](_0x53996c)[_0x5c80('0x12')](handleEntityNotFound(_0x14e747,null))[_0x5c80('0x12')](respondWithResult(_0x14e747,null))[_0x5c80('0x1d')](handleError(_0x14e747,null));};exports[_0x5c80('0x4a')]=function(_0x322d35,_0x270eab){return db[_0x5c80('0x32')][_0x5c80('0x4a')](_0x322d35[_0x5c80('0x4b')],{})[_0x5c80('0x12')](function(_0x1ba3f1){var _0x1303d3=_0x322d35[_0x5c80('0x4c')][_0x5c80('0x29')]({'plain':!![]});if(!_0x1303d3)throw new Error(_0x5c80('0x4d'));if(_0x1303d3[_0x5c80('0x4e')]===_0x5c80('0x4c')){var _0x502f68=_0x1ba3f1[_0x5c80('0x29')]({'plain':!![]});var _0x40bec3='ChatWebsites';return db[_0x5c80('0x4f')][_0x5c80('0x50')]({'where':{'name':_0x40bec3,'userProfileId':_0x1303d3[_0x5c80('0x51')]},'raw':!![]})[_0x5c80('0x12')](function(_0x4f2de7){if(_0x4f2de7&&_0x4f2de7[_0x5c80('0x52')]===0x0){return db[_0x5c80('0x53')][_0x5c80('0x4a')]({'name':_0x502f68[_0x5c80('0x2d')],'resourceId':_0x502f68['id'],'type':_0x4f2de7[_0x5c80('0x2d')],'sectionId':_0x4f2de7['id']},{})[_0x5c80('0x12')](function(){return _0x1ba3f1;});}else{return _0x1ba3f1;}})[_0x5c80('0x1d')](function(_0x106674){logger[_0x5c80('0x17')](_0x5c80('0x54'),_0x106674);throw _0x106674;});}return _0x1ba3f1;})[_0x5c80('0x12')](respondWithResult(_0x270eab,0xc9))[_0x5c80('0x1d')](handleError(_0x270eab,null));};exports[_0x5c80('0x27')]=function(_0x58e729,_0x4e8d90){if(_0x58e729[_0x5c80('0x4b')]['id']){delete _0x58e729[_0x5c80('0x4b')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x58e729['params']['id']},'include':[{'model':db['Pause'],'as':_0x5c80('0x48')}]})['then'](handleEntityNotFound(_0x4e8d90,null))[_0x5c80('0x12')](saveUpdates(_0x58e729[_0x5c80('0x4b')],null))['then'](respondWithResult(_0x4e8d90,null))[_0x5c80('0x1d')](handleError(_0x4e8d90,null));};exports[_0x5c80('0x28')]=function(_0x32a0e3,_0x14ef0d){return db[_0x5c80('0x32')][_0x5c80('0x50')]({'where':{'id':_0x32a0e3[_0x5c80('0x47')]['id']}})[_0x5c80('0x12')](handleEntityNotFound(_0x14ef0d,null))[_0x5c80('0x12')](removeEntity(_0x14ef0d,null))[_0x5c80('0x1d')](handleError(_0x14ef0d,null));};exports['describe']=function(_0x3c987e,_0x12bc9a){return db['ChatWebsite'][_0x5c80('0x55')]()[_0x5c80('0x12')](respondWithResult(_0x12bc9a,null))[_0x5c80('0x1d')](handleError(_0x12bc9a,null));};exports['addDisposition']=function(_0x1fd2a2,_0x5dfd11){if(_0x1fd2a2[_0x5c80('0x4b')]['id']){delete _0x1fd2a2[_0x5c80('0x4b')]['id'];}return db['ChatWebsite'][_0x5c80('0x50')]({'where':{'id':_0x1fd2a2['params']['id']}})[_0x5c80('0x12')](handleEntityNotFound(_0x5dfd11,null))[_0x5c80('0x12')](function(_0x3e66e9){if(_0x3e66e9){_0x1fd2a2[_0x5c80('0x4b')][_0x5c80('0x56')]=_0x3e66e9['id'];return db[_0x5c80('0x57')][_0x5c80('0x4a')](_0x1fd2a2[_0x5c80('0x4b')]);}})[_0x5c80('0x12')](respondWithResult(_0x5dfd11,null))[_0x5c80('0x1d')](handleError(_0x5dfd11,null));};exports['getDispositions']=function(_0x582c8d,_0x21d1a7){var _0x1ea0d0={'raw':![],'where':{}};var _0x3d3f11={};var _0xe6901b={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x582c8d[_0x5c80('0x47')]['id']}})[_0x5c80('0x12')](handleEntityNotFound(_0x21d1a7,null))['then'](function(_0x50fcee){if(_0x50fcee){_0x3d3f11[_0x5c80('0x36')]=_[_0x5c80('0x38')](db[_0x5c80('0x57')][_0x5c80('0x33')]);_0x3d3f11[_0x5c80('0x37')]=_[_0x5c80('0x38')](_0x582c8d[_0x5c80('0x37')]);_0x3d3f11['filters']=_[_0x5c80('0x3a')](_0x3d3f11['model'],_0x3d3f11['query']);_0x1ea0d0['attributes']=_[_0x5c80('0x3a')](_0x3d3f11[_0x5c80('0x36')],qs[_0x5c80('0x58')](_0x582c8d[_0x5c80('0x37')]['fields']));_0x1ea0d0[_0x5c80('0x3b')]=_0x1ea0d0[_0x5c80('0x3b')][_0x5c80('0x3c')]?_0x1ea0d0[_0x5c80('0x3b')]:_0x3d3f11[_0x5c80('0x36')];if(!_0x582c8d[_0x5c80('0x37')][_0x5c80('0x59')](_0x5c80('0x3d'))){_0x1ea0d0[_0x5c80('0x23')]=qs[_0x5c80('0x23')](_0x582c8d[_0x5c80('0x37')][_0x5c80('0x23')]);_0x1ea0d0['offset']=qs[_0x5c80('0x21')](_0x582c8d['query'][_0x5c80('0x21')]);}_0x1ea0d0[_0x5c80('0x3e')]=qs['sort'](_0x582c8d[_0x5c80('0x37')][_0x5c80('0x3f')]);_0x1ea0d0[_0x5c80('0x40')]=qs['filters'](_[_0x5c80('0x41')](_0x582c8d[_0x5c80('0x37')],_0x3d3f11['filters']));_0x1ea0d0[_0x5c80('0x40')]['ChatWebsiteId']=_0x50fcee['id'];if(_0x582c8d['query']['filter']){_0x1ea0d0[_0x5c80('0x40')]=_[_0x5c80('0x43')](_0x1ea0d0[_0x5c80('0x40')],{'$or':_[_0x5c80('0x31')](_0x1ea0d0[_0x5c80('0x3b')],function(_0x1c2f9f){var _0x5f2910={};_0x5f2910[_0x1c2f9f]={'$like':'%'+_0x582c8d[_0x5c80('0x37')][_0x5c80('0x42')]+'%'};return _0x5f2910;})});}_0x1ea0d0=_[_0x5c80('0x43')]({},_0x1ea0d0,_0x582c8d['options']);return db[_0x5c80('0x57')][_0x5c80('0x24')]({'where':_0x1ea0d0[_0x5c80('0x40')]})['then'](function(_0xbcd980){_0xe6901b[_0x5c80('0x24')]=_0xbcd980;if(_0x582c8d[_0x5c80('0x37')][_0x5c80('0x49')]){_0x1ea0d0[_0x5c80('0x45')]=[{'all':!![]}];}return db[_0x5c80('0x57')][_0x5c80('0x5a')](_0x1ea0d0);})['then'](function(_0x247797){_0xe6901b[_0x5c80('0x46')]=_0x247797;return _0xe6901b;});}})[_0x5c80('0x12')](respondWithFilteredResult(_0x21d1a7,_0x1ea0d0))[_0x5c80('0x1d')](handleError(_0x21d1a7,null));};exports['removeDispositions']=function(_0xea62c0,_0x515a59){return db[_0x5c80('0x32')]['find']({'where':{'id':_0xea62c0[_0x5c80('0x47')]['id']}})[_0x5c80('0x12')](handleEntityNotFound(_0x515a59,null))[_0x5c80('0x12')](function(_0x572b8e){if(_0x572b8e){return _0x572b8e[_0x5c80('0x5b')](_0xea62c0[_0x5c80('0x37')][_0x5c80('0x5c')]);}})[_0x5c80('0x12')](respondWithStatusCode(_0x515a59,null))['catch'](handleError(_0x515a59,null));};exports[_0x5c80('0x5d')]=function(_0x459f51,_0x21b8e3){if(_0x459f51[_0x5c80('0x4b')]['id']){delete _0x459f51[_0x5c80('0x4b')]['id'];}return db[_0x5c80('0x32')]['find']({'where':{'id':_0x459f51['params']['id']}})['then'](handleEntityNotFound(_0x21b8e3,null))[_0x5c80('0x12')](function(_0x272e79){if(_0x272e79){_0x459f51[_0x5c80('0x4b')][_0x5c80('0x56')]=_0x272e79['id'];return db['CannedAnswer'][_0x5c80('0x4a')](_0x459f51[_0x5c80('0x4b')]);}})['then'](respondWithResult(_0x21b8e3,null))[_0x5c80('0x1d')](handleError(_0x21b8e3,null));};exports[_0x5c80('0x5e')]=function(_0x28a47a,_0x2d836d){var _0x18faaf={'raw':![],'where':{}};var _0x254ad2={};var _0x302af1={'count':0x0,'rows':[]};return db[_0x5c80('0x32')]['findOne']({'where':{'id':_0x28a47a[_0x5c80('0x47')]['id']}})[_0x5c80('0x12')](handleEntityNotFound(_0x2d836d,null))[_0x5c80('0x12')](function(_0x5f9d2d){if(_0x5f9d2d){_0x254ad2['model']=_[_0x5c80('0x38')](db['CannedAnswer'][_0x5c80('0x33')]);_0x254ad2[_0x5c80('0x37')]=_['keys'](_0x28a47a[_0x5c80('0x37')]);_0x254ad2[_0x5c80('0x39')]=_[_0x5c80('0x3a')](_0x254ad2[_0x5c80('0x36')],_0x254ad2[_0x5c80('0x37')]);_0x18faaf[_0x5c80('0x3b')]=_[_0x5c80('0x3a')](_0x254ad2[_0x5c80('0x36')],qs[_0x5c80('0x58')](_0x28a47a['query'][_0x5c80('0x58')]));_0x18faaf[_0x5c80('0x3b')]=_0x18faaf['attributes'][_0x5c80('0x3c')]?_0x18faaf['attributes']:_0x254ad2[_0x5c80('0x36')];if(!_0x28a47a[_0x5c80('0x37')][_0x5c80('0x59')](_0x5c80('0x3d'))){_0x18faaf[_0x5c80('0x23')]=qs[_0x5c80('0x23')](_0x28a47a[_0x5c80('0x37')][_0x5c80('0x23')]);_0x18faaf['offset']=qs[_0x5c80('0x21')](_0x28a47a[_0x5c80('0x37')][_0x5c80('0x21')]);}_0x18faaf['order']=qs[_0x5c80('0x3f')](_0x28a47a[_0x5c80('0x37')][_0x5c80('0x3f')]);_0x18faaf[_0x5c80('0x40')]=qs[_0x5c80('0x39')](_['pick'](_0x28a47a['query'],_0x254ad2[_0x5c80('0x39')]));_0x18faaf['where'][_0x5c80('0x56')]=_0x5f9d2d['id'];if(_0x28a47a[_0x5c80('0x37')][_0x5c80('0x42')]){_0x18faaf['where']=_[_0x5c80('0x43')](_0x18faaf['where'],{'$or':_['map'](_0x18faaf[_0x5c80('0x3b')],function(_0x413883){var _0x500b4d={};_0x500b4d[_0x413883]={'$like':'%'+_0x28a47a[_0x5c80('0x37')][_0x5c80('0x42')]+'%'};return _0x500b4d;})});}_0x18faaf=_[_0x5c80('0x43')]({},_0x18faaf,_0x28a47a['options']);return db[_0x5c80('0x5f')][_0x5c80('0x24')]({'where':_0x18faaf[_0x5c80('0x40')]})[_0x5c80('0x12')](function(_0x55233e){_0x302af1[_0x5c80('0x24')]=_0x55233e;if(_0x28a47a[_0x5c80('0x37')]['includeAll']){_0x18faaf[_0x5c80('0x45')]=[{'all':!![]}];}return db[_0x5c80('0x5f')][_0x5c80('0x5a')](_0x18faaf);})[_0x5c80('0x12')](function(_0x2cbe43){_0x302af1[_0x5c80('0x46')]=_0x2cbe43;return _0x302af1;});}})['then'](respondWithFilteredResult(_0x2d836d,_0x18faaf))[_0x5c80('0x1d')](handleError(_0x2d836d,null));};exports['removeAnswers']=function(_0x212688,_0x427d86){return db['ChatWebsite'][_0x5c80('0x50')]({'where':{'id':_0x212688['params']['id']}})['then'](handleEntityNotFound(_0x427d86,null))[_0x5c80('0x12')](function(_0x348a3c){if(_0x348a3c){return _0x348a3c['removeAnswers'](_0x212688['query'][_0x5c80('0x5c')]);}})[_0x5c80('0x12')](respondWithStatusCode(_0x427d86,null))[_0x5c80('0x1d')](handleError(_0x427d86,null));};exports[_0x5c80('0x60')]=function(_0xc206e9,_0x160134){_0xc206e9[_0x5c80('0x4b')][_0x5c80('0x61')]=_0xc206e9[_0x5c80('0x62')][_0x5c80('0x63')];return db['ChatWebsite'][_0x5c80('0x50')]({'where':{'id':_0xc206e9[_0x5c80('0x47')]['id']}})[_0x5c80('0x12')](handleEntityNotFound(_0x160134,null))[_0x5c80('0x12')](saveUpdates(_0xc206e9[_0x5c80('0x4b')],null))[_0x5c80('0x12')](respondWithResult(_0x160134,null))[_0x5c80('0x1d')](handleError(_0x160134,null));};exports['addAvatar']=function(_0x1334af,_0xf2da91){_0x1334af[_0x5c80('0x4b')][_0x5c80('0x64')]=_0x1334af['file'][_0x5c80('0x63')];return db[_0x5c80('0x32')][_0x5c80('0x50')]({'where':{'id':_0x1334af[_0x5c80('0x47')]['id']}})['then'](handleEntityNotFound(_0xf2da91,null))[_0x5c80('0x12')](saveUpdates(_0x1334af[_0x5c80('0x4b')],null))[_0x5c80('0x12')](respondWithResult(_0xf2da91,null))[_0x5c80('0x1d')](handleError(_0xf2da91,null));};exports[_0x5c80('0x65')]=function(_0x5dc21b,_0xb665f4){_0x5dc21b[_0x5c80('0x4b')][_0x5c80('0x66')]=_0x5dc21b[_0x5c80('0x62')][_0x5c80('0x63')];return db[_0x5c80('0x32')][_0x5c80('0x50')]({'where':{'id':_0x5dc21b[_0x5c80('0x47')]['id']}})[_0x5c80('0x12')](handleEntityNotFound(_0xb665f4,null))['then'](saveUpdates(_0x5dc21b[_0x5c80('0x4b')],null))['then'](respondWithResult(_0xb665f4,null))[_0x5c80('0x1d')](handleError(_0xb665f4,null));};exports[_0x5c80('0x67')]=function(_0x38851e,_0x3685f5){_0x38851e[_0x5c80('0x4b')][_0x5c80('0x68')]=_0x38851e[_0x5c80('0x62')][_0x5c80('0x63')];return db[_0x5c80('0x32')]['find']({'where':{'id':_0x38851e['params']['id']}})[_0x5c80('0x12')](handleEntityNotFound(_0x3685f5,null))['then'](saveUpdates(_0x38851e[_0x5c80('0x4b')],null))['then'](respondWithResult(_0x3685f5,null))['catch'](handleError(_0x3685f5,null));};exports[_0x5c80('0x69')]=function(_0x408f18,_0x5692f7){var _0x3afbdb=path[_0x5c80('0x6a')](config['root'],_0x5c80('0x6b'));var _0x1347d5={'where':{'id':_0x408f18[_0x5c80('0x47')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x5f14e7=![];return require(_0x5c80('0x6c'))[_0x5c80('0x6d')]()['then'](function(_0xad577f){if(_0xad577f){_0x5f14e7=_0xad577f[_0x5c80('0x6e')];}})[_0x5c80('0x12')](function(){return db[_0x5c80('0x32')][_0x5c80('0x50')](_0x1347d5);})[_0x5c80('0x12')](handleEntityNotFound(_0x5692f7,null))[_0x5c80('0x12')](function(_0x1173e1){if(_0x1173e1){if(!_['isNil'](_0x1173e1[_0x5c80('0x61')])){if(fs[_0x5c80('0x6f')](path[_0x5c80('0x6a')](config[_0x5c80('0x70')],'server/files/images/logos/',_0x1173e1[_0x5c80('0x61')]))&&_0x5f14e7){_0x3afbdb=path['join'](config[_0x5c80('0x70')],_0x5c80('0x71'),_0x1173e1['sitepic']);}}return _0x5692f7[_0x5c80('0x72')](_0x3afbdb);}})['catch'](handleError(_0x5692f7,null));};exports[_0x5c80('0x73')]=function(_0x833eda,_0x2eef37){var _0x246ba5=path['join'](config[_0x5c80('0x70')],_0x5c80('0x74'));var _0x1459c8={'where':{'id':_0x833eda[_0x5c80('0x47')]['id']},'attributes':['id',_0x5c80('0x64')],'raw':!![]};return db[_0x5c80('0x32')]['find'](_0x1459c8)[_0x5c80('0x12')](handleEntityNotFound(_0x2eef37,null))[_0x5c80('0x12')](function(_0x4014c5){if(_0x4014c5){if(!_[_0x5c80('0x75')](_0x4014c5[_0x5c80('0x64')])){if(fs[_0x5c80('0x6f')](path[_0x5c80('0x6a')](config[_0x5c80('0x70')],_0x5c80('0x76'),_0x4014c5[_0x5c80('0x64')]))){_0x246ba5=path[_0x5c80('0x6a')](config[_0x5c80('0x70')],_0x5c80('0x76'),_0x4014c5['agentAvatar']);}}return _0x2eef37[_0x5c80('0x72')](_0x246ba5);}})[_0x5c80('0x1d')](handleError(_0x2eef37,null));};exports[_0x5c80('0x77')]=function(_0x38053d,_0x5d74b9){var _0x87eb2c=path['join'](config[_0x5c80('0x70')],_0x5c80('0x78'));var _0x153be4={'where':{'id':_0x38053d[_0x5c80('0x47')]['id']},'attributes':['id',_0x5c80('0x66'),_0x5c80('0x79')],'raw':!![]};return db[_0x5c80('0x32')]['find'](_0x153be4)[_0x5c80('0x12')](handleEntityNotFound(_0x5d74b9,null))['then'](function(_0x3f7d25){if(_0x3f7d25){if(!_['isNil'](_0x3f7d25['customerAvatar'])){if(fs[_0x5c80('0x6f')](path['join'](config[_0x5c80('0x70')],'server/files/images/avatars/',_0x3f7d25[_0x5c80('0x66')]))&&_0x3f7d25['showCustomerAvatar']){_0x87eb2c=path[_0x5c80('0x6a')](config[_0x5c80('0x70')],'server/files/images/avatars/',_0x3f7d25['customerAvatar']);}}return _0x5d74b9[_0x5c80('0x72')](_0x87eb2c);}})['catch'](handleError(_0x5d74b9,null));};exports[_0x5c80('0x7a')]=function(_0x258876,_0x2684f4){var _0x270855=path[_0x5c80('0x6a')](config['root'],_0x5c80('0x7b'));var _0x416f08={'where':{'id':_0x258876[_0x5c80('0x47')]['id']},'attributes':['id',_0x5c80('0x68')],'raw':!![]};return db[_0x5c80('0x32')][_0x5c80('0x50')](_0x416f08)[_0x5c80('0x12')](handleEntityNotFound(_0x2684f4,null))[_0x5c80('0x12')](function(_0xf5a687){if(_0xf5a687){if(!_[_0x5c80('0x75')](_0xf5a687['systemAvatar'])){if(fs[_0x5c80('0x6f')](path[_0x5c80('0x6a')](config[_0x5c80('0x70')],'server/files/images/avatars/',_0xf5a687[_0x5c80('0x68')]))){_0x270855=path[_0x5c80('0x6a')](config['root'],_0x5c80('0x76'),_0xf5a687[_0x5c80('0x68')]);}}return _0x2684f4['download'](_0x270855);}})[_0x5c80('0x1d')](handleError(_0x2684f4,null));};exports[_0x5c80('0x7c')]=function(_0x31ea23,_0x3b5bf2){var _0x256f9b=require('user-agent-parser');var _0x221980=new _0x256f9b();var _0x20024c=_0x221980['setUA'](_0x31ea23[_0x5c80('0x7d')][_0x5c80('0x7e')])['getResult']();var _0x1e2fef={'body':_0x31ea23[_0x5c80('0x4b')],'channel':_0x5c80('0x7f')};var _0x16b223=[];var _0x20c44a=[];var _0x2f9516={};var _0x5e5e38=![];return db[_0x5c80('0x80')][_0x5c80('0x55')]()['then'](function(_0x2cbf75){if(!_0x2cbf75){throw new db[(_0x5c80('0x81'))][(_0x5c80('0x82'))](_0x5c80('0x83'));}_0x16b223=_[_0x5c80('0x84')](_[_0x5c80('0x38')](_0x2cbf75),['createdAt','updatedAt']);_0x20c44a=_[_0x5c80('0x84')](_[_0x5c80('0x38')](_0x2cbf75),['createdAt',_0x5c80('0x85'),'CompanyId','ListId']);if(_0x31ea23[_0x5c80('0x4b')]['id']){delete _0x31ea23['body']['id'];}if(_['isNil'](_0x31ea23['body'][_0x5c80('0x86')])){throw new db[(_0x5c80('0x81'))][(_0x5c80('0x82'))](_0x5c80('0x87'));}if(_[_0x5c80('0x75')](_0x31ea23['body']['body'])||_0x31ea23[_0x5c80('0x4b')][_0x5c80('0x4b')]===''){throw new db['Sequelize'][(_0x5c80('0x82'))](_0x5c80('0x88'));}if(_['isNil'](_0x31ea23[_0x5c80('0x4b')]['mapKey'])){throw new db[(_0x5c80('0x81'))][(_0x5c80('0x82'))](_0x5c80('0x89')+_0x20c44a);}if(!_[_0x5c80('0x8a')](_0x20c44a,_0x31ea23['body'][_0x5c80('0x8b')])){throw new db[(_0x5c80('0x81'))][(_0x5c80('0x82'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x20c44a);}_0x2f9516[_0x31ea23[_0x5c80('0x4b')][_0x5c80('0x8b')]]=_0x31ea23[_0x5c80('0x4b')][_0x5c80('0x86')];})[_0x5c80('0x12')](function(){return db['ChatWebsite'][_0x5c80('0x50')]({'where':{'id':_0x31ea23[_0x5c80('0x47')]['id']},'include':[{'model':db['CmList'],'as':_0x5c80('0x8c'),'include':[{'model':db[_0x5c80('0x80')],'as':_0x5c80('0x8d'),'where':_0x2f9516,'limit':0x1,'order':[[_0x5c80('0x85'),_0x5c80('0x8e')]]}]},{'model':db[_0x5c80('0x8f')],'as':_0x5c80('0x90')}]});})['then'](handleEntityNotFound(_0x3b5bf2,null))[_0x5c80('0x12')](function(_0x432591){if(_0x432591&&_0x432591[_0x5c80('0x8c')]){_0x1e2fef['account']=_0x432591;_0x1e2fef[_0x5c80('0x91')]=_0x432591['Applications'];_0x1e2fef[_0x5c80('0x92')]=_0x432591[_0x5c80('0x8c')];_0x1e2fef[_0x5c80('0x91')]=_[_0x5c80('0x93')](_0x1e2fef['applications'],[_0x5c80('0x94')],[_0x5c80('0x95')]);if(_0x1e2fef[_0x5c80('0x96')]['Applications']){delete _0x1e2fef[_0x5c80('0x96')]['Applications'];}if(_0x1e2fef[_0x5c80('0x96')][_0x5c80('0x8c')]&&_0x1e2fef['account'][_0x5c80('0x8c')]['Contacts'][_0x5c80('0x3c')]){return _0x1e2fef['account'][_0x5c80('0x8c')][_0x5c80('0x8d')][0x0];}var _0x33f17a=_[_0x5c80('0xb')](_0x31ea23['body'],{'firstName':_0x31ea23['body'][_0x5c80('0x86')],'ListId':_0x432591[_0x5c80('0x97')]});_0x33f17a[_0x31ea23[_0x5c80('0x4b')][_0x5c80('0x8b')]]=_0x31ea23[_0x5c80('0x4b')][_0x5c80('0x86')];return db[_0x5c80('0x80')][_0x5c80('0x4a')](_0x33f17a,{'fields':_0x16b223,'raw':!![]});}})[_0x5c80('0x12')](handleEntityNotFound(_0x3b5bf2,null))[_0x5c80('0x12')](function(_0x29df8e){_0x1e2fef['contact']=_0x29df8e;var _0x590ed7=_0x31ea23[_0x5c80('0x4b')][_0x5c80('0x98')];if(_0x31ea23[_0x5c80('0x7d')][_0x5c80('0x99')]){_0x590ed7=_0x31ea23['headers'][_0x5c80('0x99')];}else if(_0x31ea23[_0x5c80('0x7d')][_0x5c80('0x9a')]){_0x590ed7=_[_0x5c80('0x9b')](_0x31ea23[_0x5c80('0x7d')][_0x5c80('0x9a')]['split'](','));}if(_0x29df8e){var _0xe8b780={'ContactId':_0x29df8e['id'],'ChatWebsiteId':_0x31ea23[_0x5c80('0x47')]['id'],'from':(_0x29df8e[_0x5c80('0x9c')]||'')+'\x20'+(_0x29df8e['lastName']||''),'customerIp':_0x590ed7,'customerPort':_0x31ea23[_0x5c80('0x7d')][_0x5c80('0x9d')]?_0x31ea23[_0x5c80('0x7d')][_0x5c80('0x9d')]:null,'referer':_0x31ea23[_0x5c80('0x4b')][_0x5c80('0x9e')],'browserName':_0x20024c[_0x5c80('0x9f')][_0x5c80('0x2d')]&&_0x20024c[_0x5c80('0x9f')]['version']?util[_0x5c80('0xa0')](_0x5c80('0xa1'),_0x20024c['browser'][_0x5c80('0x2d')],_0x20024c[_0x5c80('0x9f')][_0x5c80('0xa2')]):_0x5c80('0xa3'),'browserVersion':_0x20024c[_0x5c80('0x9f')][_0x5c80('0xa2')]||_0x5c80('0xa3'),'osName':util[_0x5c80('0xa0')](_0x5c80('0xa1'),_0x20024c['os']['name'],_0x20024c['os'][_0x5c80('0xa2')]),'osVersion':_0x20024c['os'][_0x5c80('0xa2')],'deviceModel':_0x20024c[_0x5c80('0xa4')][_0x5c80('0x36')]&&_0x20024c[_0x5c80('0xa4')][_0x5c80('0xa5')]?util[_0x5c80('0xa0')](_0x5c80('0xa6'),_0x20024c[_0x5c80('0xa4')][_0x5c80('0x36')],_0x20024c[_0x5c80('0xa4')]['vendor'],_0x20024c['device'][_0x5c80('0xa7')]):null,'deviceVendor':_0x20024c[_0x5c80('0xa4')][_0x5c80('0xa5')],'deviceType':_0x20024c['device'][_0x5c80('0xa7')],'formData':JSON['stringify'](_0x31ea23[_0x5c80('0x4b')])};var _0x4123a9={'ChatWebsiteId':_0x31ea23[_0x5c80('0x47')]['id'],'closed':![]};if(_0x31ea23['body'][_0x5c80('0xa8')]){_0x4123a9['threadId']=_0x31ea23[_0x5c80('0x4b')][_0x5c80('0xa8')];return db['ChatInteraction'][_0x5c80('0x50')]({'where':_0x4123a9})[_0x5c80('0x12')](function(_0x34ff9b){if(_0x34ff9b){return[_0x34ff9b,![]];}_0xe8b780[_0x5c80('0xa8')]=_0x31ea23[_0x5c80('0x4b')][_0x5c80('0xa8')];_0xe8b780[_0x5c80('0xa9')]=_0x31ea23[_0x5c80('0x4b')][_0x5c80('0xa9')];return db[_0x5c80('0xaa')]['create'](_0xe8b780)[_0x5c80('0x12')](function(_0x1fd366){return[_0x1fd366,!![]];});});}_0x4123a9[_0x5c80('0xab')]=_0x29df8e['id'];if(_0x31ea23[_0x5c80('0x4b')][_0x5c80('0xac')]&&_0x31ea23[_0x5c80('0x4b')][_0x5c80('0xac')]['id']){_0x4123a9['id']=_0x31ea23[_0x5c80('0x4b')][_0x5c80('0xac')]['id'];return db['ChatInteraction'][_0x5c80('0x50')]({'where':_0x4123a9})['then'](function(_0x22db62){if(_0x22db62){return[_0x22db62,![]];}return db[_0x5c80('0xaa')][_0x5c80('0x4a')](_0xe8b780)['then'](function(_0x4352ee){return[_0x4352ee,!![]];});});}return db[_0x5c80('0xaa')][_0x5c80('0x4a')](_0xe8b780)['then'](function(_0x1054da){return[_0x1054da,!![]];});}})[_0x5c80('0xad')](function(_0x591f0a,_0xba74a6){if(_0x591f0a){_0x5e5e38=_0xba74a6;if(!_0xba74a6){var _0x55405d={'from':(_0x1e2fef[_0x5c80('0xae')][_0x5c80('0x9c')]||'')+'\x20'+(_0x1e2fef[_0x5c80('0xae')][_0x5c80('0xaf')]||'')};if(_0x31ea23['body'][_0x5c80('0xa8')]&&_0x31ea23[_0x5c80('0x4b')][_0x5c80('0xb0')]&&_0x31ea23[_0x5c80('0x4b')][_0x5c80('0xa8')]!=_0x31ea23[_0x5c80('0x4b')][_0x5c80('0xb0')]){_0x55405d[_0x5c80('0xa8')]=_0x31ea23[_0x5c80('0x4b')][_0x5c80('0xb0')];}return _0x591f0a[_0x5c80('0x27')](_0x55405d);}else{return _0x591f0a;}}})[_0x5c80('0x12')](function(_0x4c62f3){_0x1e2fef[_0x5c80('0xac')]=_0x4c62f3[_0x5c80('0x29')]({'plain':!![]});_0x1e2fef[_0x5c80('0xac')][_0x5c80('0xb1')]=_0x5e5e38;if(_0x1e2fef[_0x5c80('0xac')]['created']){if(_0x1e2fef['account'][_0x5c80('0xb2')]){_0x1e2fef[_0x5c80('0x91')][_0x5c80('0xb3')]({'id':0x0,'priority':_0x1e2fef[_0x5c80('0x91')][_0x5c80('0x3c')]+0x1,'app':_0x5c80('0xb4'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x5c80('0xb5')][_0x5c80('0x4a')]({'body':_0x31ea23[_0x5c80('0x4b')]['body'],'ChatWebsiteId':_0x31ea23[_0x5c80('0x47')]['id'],'ChatInteractionId':_0x4c62f3['id'],'direction':'in','ContactId':_0x1e2fef[_0x5c80('0xae')]['id'],'AttachmentId':_0x31ea23[_0x5c80('0x4b')][_0x5c80('0xb6')]});})[_0x5c80('0x12')](function(_0x384b87){_0x1e2fef[_0x5c80('0x1a')]=_0x384b87;if(_0x1e2fef[_0x5c80('0xac')][_0x5c80('0xb7')]){return db[_0x5c80('0xb8')][_0x5c80('0x50')]({'attributes':['id','name'],'where':{'id':_0x1e2fef[_0x5c80('0xac')][_0x5c80('0xb7')]}})['then'](function(_0x5e0f71){if(_0x5e0f71){_0x1e2fef['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5e0f71[_0x5c80('0x2d')]+','+(_0x1e2fef[_0x5c80('0x96')]['waitForTheAssignedAgent']||0xa),'interval':_0x5c80('0xb9')});_0x1e2fef[_0x5c80('0xba')]=!![];}return respondWithRpcPromise(_0x5c80('0xbb'),_0x5c80('0xbc'),_0x1e2fef);});}return respondWithRpcPromise(_0x5c80('0xbb'),_0x5c80('0xbc'),_0x1e2fef);})['then'](function(_0x98a548){respondWithRpcPromise(_0x5c80('0xbd'),_0x5c80('0xbd'),{'event':_0x5c80('0x7c'),'message':_0x98a548},client9002);return _0x98a548;})['then'](respondWithResult(_0x3b5bf2,null))[_0x5c80('0x1d')](handleError(_0x3b5bf2,null));};exports['offline']=function(_0x4e3b1f,_0x18b07c){var _0x1c27c3,_0x4b171d,_0x1b348d;var _0x3693fe=[];var _0xfea6bc={};var _0x48f6f7=_0x4e3b1f[_0x5c80('0xbe')]||[];var _0x29f525=[];var _0x360c40;return db[_0x5c80('0x80')][_0x5c80('0x55')]()['then'](function(_0x3f4d42){if(!_0x3f4d42){throw new db[(_0x5c80('0x81'))][(_0x5c80('0x82'))](_0x5c80('0x83'));}_0x3693fe=_[_0x5c80('0x84')](_[_0x5c80('0x38')](_0x3f4d42),[_0x5c80('0xbf'),_0x5c80('0x85'),_0x5c80('0xc0'),_0x5c80('0x97')]);if(_0x4e3b1f[_0x5c80('0x4b')]['id']){delete _0x4e3b1f[_0x5c80('0x4b')]['id'];}if(_[_0x5c80('0x75')](_0x4e3b1f[_0x5c80('0x4b')][_0x5c80('0x86')])){throw _0x18b07c[_0x5c80('0x1f')](0x1f4)[_0x5c80('0x2e')](new db[(_0x5c80('0x81'))]['ValidationError'](_0x5c80('0x87')));}if(_[_0x5c80('0x75')](_0x4e3b1f['body'][_0x5c80('0x4b')])||_0x4e3b1f[_0x5c80('0x4b')][_0x5c80('0x4b')]===''){throw _0x18b07c[_0x5c80('0x1f')](0x1f4)[_0x5c80('0x2e')](new db[(_0x5c80('0x81'))][(_0x5c80('0x82'))](_0x5c80('0x88')));}if(_['isNil'](_0x4e3b1f[_0x5c80('0x4b')]['mapKeyOffline'])){throw _0x18b07c[_0x5c80('0x1f')](0x1f4)[_0x5c80('0x2e')](new db[(_0x5c80('0x81'))][(_0x5c80('0x82'))](_0x5c80('0xc1')+_0x3693fe));}if(!_[_0x5c80('0x8a')](_0x3693fe,_0x4e3b1f[_0x5c80('0x4b')]['mapKeyOffline'])){throw _0x18b07c['status'](0x1f4)[_0x5c80('0x2e')](new db[(_0x5c80('0x81'))][(_0x5c80('0x82'))](_0x5c80('0xc2')+_0x3693fe));}_0xfea6bc[_0x4e3b1f[_0x5c80('0x4b')]['mapKeyOffline']]=_0x4e3b1f['body'][_0x5c80('0x86')];})[_0x5c80('0x12')](function(){return db[_0x5c80('0x32')][_0x5c80('0x50')]({'where':{'id':_0x4e3b1f[_0x5c80('0x47')]['id']},'include':[{'model':db[_0x5c80('0xc3')],'as':_0x5c80('0x8c')},{'model':db[_0x5c80('0xc4')],'as':_0x5c80('0xc4')}]});})['then'](handleEntityNotFound(_0x18b07c,null))[_0x5c80('0x12')](function(_0x1ba3b1){if(_0x1ba3b1&&_0x1ba3b1[_0x5c80('0x8c')]){_0x4b171d=_0x1ba3b1;var _0x34056e=_[_0x5c80('0xb')](_0x4e3b1f[_0x5c80('0x4b')],{'firstName':_0x4e3b1f[_0x5c80('0x4b')][_0x5c80('0x86')],'phone':_0x4e3b1f[_0x5c80('0x4b')][_0x5c80('0x86')],'ListId':_0x1ba3b1[_0x5c80('0x97')]});_0x34056e[_0x4e3b1f[_0x5c80('0x4b')]['mapKeyOffline']]=_0x4e3b1f[_0x5c80('0x4b')][_0x5c80('0x86')];return db[_0x5c80('0x80')][_0x5c80('0xc5')]({'where':_0xfea6bc,'defaults':_0x34056e});}})[_0x5c80('0xad')](function(_0x5d59e7){if(_0x5d59e7){_0x1b348d=_0x5d59e7;var _0x4fc8bc=fs[_0x5c80('0xc6')](path['join'](config[_0x5c80('0x70')],_0x5c80('0xc7')),_0x5c80('0xc8'));var _0x3ea715=ejs[_0x5c80('0xc9')](_0x4fc8bc,{'body':_['toPairs'](_0x4e3b1f['body'][_0x5c80('0x4b')]),'bodyTitle':_0x4b171d[_0x5c80('0xca')]});return db[_0x5c80('0xcb')][_0x5c80('0x4a')]({'body':_0x3ea715,'ContactId':_0x5d59e7['id'],'ChatWebsiteId':_0x4b171d['id']});}})[_0x5c80('0x12')](function(_0x346919){_0x360c40=_0x346919;if(_0x48f6f7[_0x5c80('0x3c')]){var _0x5ddf61=_0x48f6f7[_0x5c80('0x31')](function(_0x5ab1af){return{'name':_0x5ab1af[_0x5c80('0xcc')],'basename':_0x5ab1af[_0x5c80('0x63')],'type':_0x5ab1af[_0x5c80('0xcd')],'ChatOfflineMessageId':_0x346919['id']};});_0x29f525=_0x5ddf61[_0x5c80('0x31')](_0x3108a8=>{var _0x3c29f1={'filename':_0x3108a8[_0x5c80('0x2d')],'path':path['join'](config[_0x5c80('0x70')],'server',_0x5c80('0xbe'),_0x5c80('0xce'),_0x5c80('0xcf'),_0x3108a8['basename'])};return _0x3c29f1;});if(!_0x4b171d['openNewInteraction']){return db[_0x5c80('0xd0')]['transaction'](function(_0x3a2120){return db[_0x5c80('0xd1')][_0x5c80('0xd2')](_0x5ddf61,{'transaction':_0x3a2120});});}}})[_0x5c80('0x12')](function(){if(_0x360c40){_0x1c27c3=_0x360c40;return db[_0x5c80('0xc4')]['findOne']({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x5c80('0xd3'),'raw':!![]}]});}})['then'](function(_0x5cf891){if(_0x5cf891&&_0x5cf891[_0x5c80('0xd3')]&&_0x4b171d['forwardOffline']&&_0x4b171d[_0x5c80('0xd4')]){var _0x134f7d={'tls':{'rejectUnauthorized':![]}};if(_0x5cf891['Smtp'][_0x5c80('0xd5')]){_0x134f7d[_0x5c80('0xd5')]=_0x5cf891['Smtp'][_0x5c80('0xd5')];}else{_0x134f7d[_0x5c80('0xd6')]=_0x5cf891['Smtp'][_0x5c80('0xd6')];_0x134f7d['port']=_0x5cf891['Smtp'][_0x5c80('0xd7')];_0x134f7d[_0x5c80('0xd8')]=_0x5cf891[_0x5c80('0xd3')]['secure'];}if(_0x5cf891['Smtp']['authentication']){_0x134f7d[_0x5c80('0xd9')]={'user':_0x5cf891['Smtp'][_0x5c80('0x4c')],'pass':_0x5cf891[_0x5c80('0xd3')][_0x5c80('0xda')]};}return respondWithRpcPromise(_0x5c80('0xdb'),_0x5c80('0xdc'),{'account':_0x134f7d,'message':{'from':util[_0x5c80('0xa0')](_0x5c80('0xdd'),_0x5cf891[_0x5c80('0x2d')],_0x5cf891[_0x5c80('0xde')]||_0x5cf891['Smtp'][_0x5c80('0x4c')]),'to':_0x4b171d[_0x5c80('0xd4')],'subject':_0x4b171d[_0x5c80('0xdf')],'html':_0x1c27c3[_0x5c80('0x4b')],'attachments':_0x29f525}},client9003)[_0x5c80('0x12')](function(){return _0x1c27c3;})[_0x5c80('0x1d')](function(_0x4225f9){console[_0x5c80('0x17')](_0x4225f9);});}})[_0x5c80('0x12')](function(){if(_0x4b171d&&_0x4b171d[_0x5c80('0xe0')]&&_0x4b171d[_0x5c80('0xe1')]){var _0x30b6c4=[];if(_0x48f6f7[_0x5c80('0x3c')]){_0x30b6c4=_0x48f6f7[_0x5c80('0x31')](function(_0x42fcba){return{'name':_0x42fcba[_0x5c80('0xcc')],'basename':_0x42fcba[_0x5c80('0x63')],'type':_0x42fcba[_0x5c80('0xcd')],'ChatOfflineMessageId':_0x360c40['id']};});}var _0x5c185c;if(!_[_0x5c80('0x75')](_0x4b171d['subjectOffline'])){var _0x2b9f1b=_[_0x5c80('0x31')](_0x4e3b1f[_0x5c80('0x4b')],function(_0x32cfb5){return _0x32cfb5;});var _0x257ad5=_[_0x5c80('0xe2')](_0x2b9f1b)[0x0];var _0xaaa793=_['mapValues'](_0x257ad5,function(_0x12ee3e){return _0x12ee3e;});_0x5c185c=_0xaaa793[0x1][_0x4b171d[_0x5c80('0xe3')]];}var _0x1e2ed4={'from':_0x1b348d[_0x5c80('0xde')],'firstName':_0x1b348d[_0x5c80('0x9c')],'lastName':_0x1b348d['lastName'],'mapKey':_0x5c80('0xde'),'message':{'from':_0x1b348d['email'],'to':_0x4b171d['MailAccount'][_0x5c80('0xde')],'cc':'','subject':_[_0x5c80('0x75')](_0x5c185c)?_0x4b171d['offlineMessageSubject']:_0x5c185c,'messageId':'','sentAt':new Date(),'attach':_0x30b6c4[_0x5c80('0x3c')],'attachments':_0x30b6c4,'originChannel':_0x5c80('0xe4'),'ChatWebsiteId':_0x4b171d['id'],'ChatOfflineMessageId':_0x1c27c3['id'],'originTo':_0x4b171d['MailAccount']['email']},'body':_0x1c27c3['body']};var _0x18d8ac={'account':{'id':_0x4b171d[_0x5c80('0xe1')]},'body':_0x1e2ed4,'log':_0x5c80('0xe5')};return respondWithRpcPromise(_0x5c80('0xe5'),_0x5c80('0xe6'),_0x18d8ac,client9001)[_0x5c80('0x12')](function(){return _0x1c27c3;})['catch'](function(_0x51655b){console[_0x5c80('0x17')](_0x51655b);});}return;})[_0x5c80('0x12')](function(){if(_0x1c27c3){return _0x1c27c3;}})['then'](respondWithResult(_0x18b07c,null))[_0x5c80('0x1d')](function(_0x4e5f08){console[_0x5c80('0x17')](_0x5c80('0x1d'),_0x4e5f08);for(var _0x3f1bb3 of _0x48f6f7){var _0x5db061=path[_0x5c80('0x6a')](config[_0x5c80('0x70')],_0x5c80('0xe7'),_0x5c80('0xbe'),_0x5c80('0xce'),_0x5c80('0xcf'),_0x3f1bb3['filename']);fs_extra[_0x5c80('0xe8')](_0x5db061)['catch'](function(_0x336b51){console[_0x5c80('0x17')](_0x5c80('0xe9'),_0x5db061,_0x336b51);});}});};exports[_0x5c80('0xea')]=function(_0x3f8ff3,_0x2a95f2){return db['ChatInteraction']['find']({'where':{'id':_0x3f8ff3[_0x5c80('0x47')]['id']}})[_0x5c80('0x12')](handleEntityNotFound(_0x2a95f2,null))[_0x5c80('0x12')](function(_0xda77c5){if(_0xda77c5){return _0xda77c5['addInteraction'](_0x3f8ff3['body'][_0x5c80('0x5c')],_[_0x5c80('0xeb')](_0x3f8ff3[_0x5c80('0x4b')],[_0x5c80('0x5c'),'id'])||{});}})[_0x5c80('0x12')](respondWithResult(_0x2a95f2,null))[_0x5c80('0x1d')](handleError(_0x2a95f2,null));};exports[_0x5c80('0xec')]=function(_0x245d4d,_0x260d36){var _0x334f6e={'raw':![],'where':{}};var _0x1eea7e={};var _0x19d7dc={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x245d4d[_0x5c80('0x47')]['id']}})[_0x5c80('0x12')](handleEntityNotFound(_0x260d36,null))[_0x5c80('0x12')](function(_0x5d03fc){if(_0x5d03fc){_0x1eea7e[_0x5c80('0x36')]=_[_0x5c80('0x38')](db[_0x5c80('0xaa')]['rawAttributes']);_0x1eea7e[_0x5c80('0x37')]=_[_0x5c80('0x38')](_0x245d4d[_0x5c80('0x37')]);_0x1eea7e[_0x5c80('0x39')]=_['intersection'](_0x1eea7e['model'],_0x1eea7e[_0x5c80('0x37')]);_0x334f6e[_0x5c80('0x3b')]=_[_0x5c80('0x3a')](_0x1eea7e[_0x5c80('0x36')],qs[_0x5c80('0x58')](_0x245d4d['query'][_0x5c80('0x58')]));_0x334f6e[_0x5c80('0x3b')]=_0x334f6e[_0x5c80('0x3b')][_0x5c80('0x3c')]?_0x334f6e[_0x5c80('0x3b')]:_0x1eea7e['model'];if(!_0x245d4d['query'][_0x5c80('0x59')](_0x5c80('0x3d'))){_0x334f6e[_0x5c80('0x23')]=qs[_0x5c80('0x23')](_0x245d4d[_0x5c80('0x37')][_0x5c80('0x23')]);_0x334f6e[_0x5c80('0x21')]=qs[_0x5c80('0x21')](_0x245d4d[_0x5c80('0x37')][_0x5c80('0x21')]);}_0x334f6e[_0x5c80('0x3e')]=qs['sort'](_0x245d4d[_0x5c80('0x37')]['sort']);_0x334f6e[_0x5c80('0x40')]=qs[_0x5c80('0x39')](_[_0x5c80('0x41')](_0x245d4d['query'],_0x1eea7e['filters']));_0x334f6e[_0x5c80('0x40')][_0x5c80('0x56')]=_0x5d03fc['id'];if(_0x245d4d['query'][_0x5c80('0x42')]){_0x334f6e[_0x5c80('0x40')]=_[_0x5c80('0x43')](_0x334f6e['where'],{'$or':_['map'](_0x334f6e[_0x5c80('0x3b')],function(_0x27c045){var _0x255975={};_0x255975[_0x27c045]={'$like':'%'+_0x245d4d['query'][_0x5c80('0x42')]+'%'};return _0x255975;})});}_0x334f6e=_['merge']({},_0x334f6e,_0x245d4d['options']);return db[_0x5c80('0xaa')]['count']({'where':_0x334f6e[_0x5c80('0x40')]})[_0x5c80('0x12')](function(_0x4a9cdb){_0x19d7dc[_0x5c80('0x24')]=_0x4a9cdb;if(_0x245d4d['query'][_0x5c80('0x49')]){_0x334f6e['include']=[{'model':db[_0x5c80('0x80')],'as':'Contact','required':![]},{'model':db[_0x5c80('0xb8')],'as':_0x5c80('0xed'),'attributes':[_0x5c80('0x2d'),_0x5c80('0xee'),'internal'],'required':![]},{'model':db[_0x5c80('0xef')],'as':_0x5c80('0xf0'),'attributes':['id',_0x5c80('0x2d'),_0x5c80('0xf1')],'where':_0x245d4d['query'][_0x5c80('0xf2')]?{'id':_0x245d4d[_0x5c80('0x37')][_0x5c80('0xf2')]}:undefined,'required':_0x245d4d['query'][_0x5c80('0xf2')]?!![]:![]}];}return db['ChatInteraction'][_0x5c80('0x5a')](_0x334f6e);})['then'](function(_0xfd6eab){_0x19d7dc[_0x5c80('0x46')]=_0xfd6eab;return _0x19d7dc;});}})[_0x5c80('0x12')](respondWithFilteredResult(_0x260d36,_0x334f6e))[_0x5c80('0x1d')](handleError(_0x260d36,null));};function iftimePromise(_0x51f66e,_0x578d98){return respondWithRpcPromise(_0x5c80('0xf3'),_0x5c80('0xf4'),{'command':_0x578d98['timezone']?util[_0x5c80('0xa0')](_0x5c80('0xf5'),_0x51f66e['interval'],_0x578d98[_0x5c80('0xf6')]):util[_0x5c80('0xa0')](_0x5c80('0xf7'),_0x51f66e[_0x5c80('0xf8')])},client9002)['then'](function(_0x6d3a2c){var _0x398311=_0x6d3a2c&&_0x6d3a2c['indexOf'](_0x5c80('0xf9'))>=0x0?!![]:![];logger[_0x5c80('0x1b')](_0x5c80('0xfa'),_0x578d98['id'],_0x51f66e['id'],_0x51f66e[_0x5c80('0xf8')],_0x398311?'ONLINE':_0x5c80('0xfb'),_0x578d98[_0x5c80('0xf6')]?_0x578d98[_0x5c80('0xf6')]:_0x5c80('0xfc'));return _0x398311;})[_0x5c80('0x1d')](function(_0x1fe413){logger[_0x5c80('0x17')](_0x5c80('0xfa'),_0x578d98['id'],_0x51f66e['id'],_0x51f66e[_0x5c80('0xf8')],util['inspect'](_0x1fe413,{'showHidden':![],'depth':null}),_0x578d98['timezone']?_0x578d98['timezone']:_0x5c80('0xfc'));return![];});}exports['getSnippet']=function(_0xe10d73,_0x1d92c7){var _0x24b5a9=0x0;var _0x1b36e9=0x0;var _0xb08332=![];var _0x3452f3;var _0x469935;return db[_0x5c80('0x32')][_0x5c80('0x50')]({'where':{'id':_0xe10d73[_0x5c80('0x47')]['id']},'include':[{'model':db['Interval'],'as':_0x5c80('0xfd'),'include':[{'model':db[_0x5c80('0xfd')],'as':_0x5c80('0xfe'),'attributes':['id',_0x5c80('0xf8')],'raw':!![]}]}]})[_0x5c80('0x12')](handleEntityNotFound(_0x1d92c7,null))[_0x5c80('0x12')](function(_0x15e261){if(_0x15e261){_0x3452f3=_0x15e261;return _0x15e261[_0x5c80('0xff')]({'raw':!![]});}})[_0x5c80('0x12')](function(_0x2af13f){if(_0x3452f3){if(_0x2af13f){_0x469935=_0x2af13f;}}return require('../../config/license/util')[_0x5c80('0x6d')]();})['then'](function(_0x1eeb5f){if(_0x1eeb5f){_0x1b36e9=_0x1eeb5f[_0x5c80('0x100')];_0xb08332=_0x1eeb5f[_0x5c80('0x6e')];}})[_0x5c80('0x12')](function(){return db[_0x5c80('0xaa')][_0x5c80('0x24')]({'where':{'closed':![]}});})['then'](function(_0x5e67dd){_0x24b5a9=_0x5e67dd;if(_0x1b36e9&&_0x5e67dd>_0x1b36e9){return db[_0x5c80('0x101')]['findOne']({'where':{'id':0x1}})[_0x5c80('0x12')](function(_0x1e5a68){if(_0x1e5a68){_0x1e5a68[_0x5c80('0x102')](_0x5c80('0x103'));}});}})[_0x5c80('0x12')](function(){if(_0x3452f3[_0x5c80('0xfd')]&&_0x3452f3[_0x5c80('0xfd')][_0x5c80('0xfe')]){var _0x47d096=[];for(var _0x1aecda=0x0;_0x1aecda<_0x3452f3[_0x5c80('0xfd')]['Intervals'][_0x5c80('0x3c')];_0x1aecda++){var _0x4edcc5=_0x3452f3['Interval'][_0x5c80('0xfe')][_0x1aecda][_0x5c80('0x29')]({'plain':!![]});_0x47d096[_0x5c80('0xb3')](iftimePromise(_0x4edcc5,_0x3452f3));}return BPromise[_0x5c80('0x104')](_0x47d096)['then'](function(_0x4f1481){return _['some'](_0x4f1481);});}else{return!![];}})[_0x5c80('0x12')](function(_0x2ab3fa){var _0x59cbd3=fs[_0x5c80('0xc6')](path[_0x5c80('0x6a')](config[_0x5c80('0x70')],_0x5c80('0x105')),_0x5c80('0xc8'));var _0x22ef14={'remote':_0x3452f3[_0x5c80('0x106')],'query':querystring['stringify'](_[_0x5c80('0x43')](_0x3452f3[_0x5c80('0x29')]({'plain':!![]}),{'customerIp':_0xe10d73['headers'][_0x5c80('0x9a')]||_0xe10d73[_0x5c80('0x7d')][_0x5c80('0x107')]||_0xe10d73[_0x5c80('0x108')][_0x5c80('0x109')]||_0xe10d73['ip'],'referer':_0xe10d73[_0x5c80('0x7d')][_0x5c80('0x9e')],'openedInteractions':_0x24b5a9,'maxInteractions':_0x1b36e9,'virtual':_0xb08332[_0x5c80('0x100')],'online':_0x2ab3fa,'custom':_0xb08332}))[_0x5c80('0x10a')](/'/g,'\x5c\x27')};_0x1d92c7['send'](ejs[_0x5c80('0xc9')](Mustache[_0x5c80('0xc9')](_0x59cbd3,_0x22ef14),{'proactiveActions':_0x469935,'alignment':_0x3452f3[_0x5c80('0x10b')],'verticalAlignment':_0x3452f3['verticalAlignment'],'div_color':_0x3452f3[_0x5c80('0xf1')],'labelText':_0x3452f3['labelText'],'text_color':_0x3452f3['textColor'],'button_color':_0x3452f3[_0x5c80('0x10c')],'background_color':_0x3452f3[_0x5c80('0x10d')]}));})['catch'](handleError(_0x1d92c7,null));};exports[_0x5c80('0x10e')]=function(_0xeca2fd,_0x3bab98){var _0x8e3c29=_0xeca2fd['params']['id'];var _0x117d09=_0xeca2fd['body'];var _0x3fe791=0xc8;var _0x3156ed=null;return db[_0x5c80('0xd0')][_0x5c80('0x10f')]({'isolationLevel':db[_0x5c80('0xd0')][_0x5c80('0x110')]['ISOLATION_LEVELS'][_0x5c80('0x111')]},function(_0x32bca0){return db['ChatWebsite'][_0x5c80('0x112')]({'where':{'id':_0x8e3c29},'transaction':_0x32bca0})[_0x5c80('0x12')](function(_0x5381ca){if(_0x5381ca){return db[_0x5c80('0x8f')]['destroy']({'where':{'ChatWebsiteId':_0x8e3c29},'transaction':_0x32bca0})[_0x5c80('0x12')](function(){var _0x37b16f=_[_0x5c80('0x31')](_0x117d09,function(_0xebc5c){_0xebc5c['ChatWebsiteId']=_0x8e3c29;return _0xebc5c;});return db[_0x5c80('0x8f')]['bulkCreate'](_0x37b16f,{'transaction':_0x32bca0});});}else{_0x3fe791=0x194;_0x3156ed=[];}});})[_0x5c80('0x12')](function(){if(_0x3fe791!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x8e3c29},'order':_0x5c80('0x94')})[_0x5c80('0x12')](function(_0x3b81f0){_0x3156ed=_0x3b81f0;});}})[_0x5c80('0x1d')](function(_0x3da3f3){_0x3fe791=0x1f4;logger[_0x5c80('0x17')](_0x3da3f3[_0x5c80('0x2c')]);if(_0x3da3f3['name']){delete _0x3da3f3['name'];}_0x3156ed=_0x3da3f3;})['finally'](function(){if(_0x3156ed===null){_0x3bab98[_0x5c80('0x2b')](_0x3fe791);}else{if(_0x3fe791===0x1f4){_0x3bab98[_0x5c80('0x1f')](_0x3fe791)[_0x5c80('0x2e')](_0x3156ed);}else{_0x3bab98['status'](_0x3fe791)[_0x5c80('0x20')](_0x3156ed);}}});};exports['getApplications']=function(_0x2ca87f,_0x3fafe1){var _0x12d2bf={};var _0x484242={};var _0xb908d0;var _0x4d0de2;return db['ChatWebsite'][_0x5c80('0x112')]({'where':{'id':_0x2ca87f[_0x5c80('0x47')]['id']}})[_0x5c80('0x12')](handleEntityNotFound(_0x3fafe1,null))[_0x5c80('0x12')](function(_0x33fd5a){if(_0x33fd5a){_0xb908d0=_0x33fd5a;_0x484242[_0x5c80('0x36')]=_[_0x5c80('0x38')](db[_0x5c80('0x8f')][_0x5c80('0x33')]);_0x484242[_0x5c80('0x37')]=_[_0x5c80('0x38')](_0x2ca87f[_0x5c80('0x37')]);_0x484242[_0x5c80('0x39')]=_[_0x5c80('0x3a')](_0x484242['model'],_0x484242['query']);_0x12d2bf[_0x5c80('0x3b')]=_[_0x5c80('0x3a')](_0x484242[_0x5c80('0x36')],qs['fields'](_0x2ca87f[_0x5c80('0x37')][_0x5c80('0x58')]));_0x12d2bf[_0x5c80('0x3b')]=_0x12d2bf['attributes'][_0x5c80('0x3c')]?_0x12d2bf[_0x5c80('0x3b')]:_0x484242[_0x5c80('0x36')];_0x12d2bf['order']=qs[_0x5c80('0x3f')](_0x2ca87f[_0x5c80('0x37')]['sort']);_0x12d2bf[_0x5c80('0x40')]=qs[_0x5c80('0x39')](_[_0x5c80('0x41')](_0x2ca87f['query'],_0x484242[_0x5c80('0x39')]));if(_0x2ca87f[_0x5c80('0x37')][_0x5c80('0x42')]){_0x12d2bf[_0x5c80('0x40')]=_[_0x5c80('0x43')](_0x12d2bf[_0x5c80('0x40')],{'$or':_['map'](_0x12d2bf['attributes'],function(_0x115212){var _0xabbc5f={};_0xabbc5f[_0x115212]={'$like':'%'+_0x2ca87f['query'][_0x5c80('0x42')]+'%'};return _0xabbc5f;})});}_0x12d2bf=_['merge']({},_0x12d2bf,_0x2ca87f['options']);return _0xb908d0['getApplications'](_0x12d2bf);}})[_0x5c80('0x12')](function(_0x2be7d4){if(_0x2be7d4){_0x4d0de2=_0x2be7d4['length'];if(!_0x2ca87f[_0x5c80('0x37')]['hasOwnProperty'](_0x5c80('0x3d'))){_0x12d2bf[_0x5c80('0x23')]=qs['limit'](_0x2ca87f[_0x5c80('0x37')]['limit']);_0x12d2bf[_0x5c80('0x21')]=qs[_0x5c80('0x21')](_0x2ca87f['query'][_0x5c80('0x21')]);}return _0xb908d0[_0x5c80('0x113')](_0x12d2bf);}})['then'](function(_0x2777a8){if(_0x2777a8){return _0x2777a8?{'count':_0x4d0de2,'rows':_0x2777a8}:null;}})[_0x5c80('0x12')](respondWithResult(_0x3fafe1,null))[_0x5c80('0x1d')](handleError(_0x3fafe1,null));};exports['addProactiveActions']=function(_0x13ff5a,_0x3a7982){return db[_0x5c80('0x114')]['find']({'where':{'id':_0x13ff5a[_0x5c80('0x47')]['id']}})[_0x5c80('0x12')](handleEntityNotFound(_0x3a7982,null))[_0x5c80('0x12')](function(_0x4bc44e){if(_0x4bc44e){return _0x4bc44e[_0x5c80('0x115')](_0x13ff5a['body'][_0x5c80('0x5c')],_['omit'](_0x13ff5a[_0x5c80('0x4b')],['ids','id'])||{});}})[_0x5c80('0x12')](respondWithResult(_0x3a7982,null))[_0x5c80('0x1d')](handleError(_0x3a7982,null));};exports[_0x5c80('0xff')]=function(_0x19dc26,_0x165d5c){var _0x2d2b18={};var _0x3d24ad={};var _0x479987;var _0x3f4f8c;return db['ChatWebsite'][_0x5c80('0x112')]({'where':{'id':_0x19dc26[_0x5c80('0x47')]['id']}})['then'](handleEntityNotFound(_0x165d5c,null))[_0x5c80('0x12')](function(_0x5cb1fd){if(_0x5cb1fd){_0x479987=_0x5cb1fd;_0x3d24ad[_0x5c80('0x36')]=_[_0x5c80('0x38')](db[_0x5c80('0x116')][_0x5c80('0x33')]);_0x3d24ad[_0x5c80('0x37')]=_[_0x5c80('0x38')](_0x19dc26['query']);_0x3d24ad[_0x5c80('0x39')]=_['intersection'](_0x3d24ad[_0x5c80('0x36')],_0x3d24ad[_0x5c80('0x37')]);_0x2d2b18[_0x5c80('0x3b')]=_[_0x5c80('0x3a')](_0x3d24ad['model'],qs[_0x5c80('0x58')](_0x19dc26['query'][_0x5c80('0x58')]));_0x2d2b18[_0x5c80('0x3b')]=_0x2d2b18[_0x5c80('0x3b')][_0x5c80('0x3c')]?_0x2d2b18[_0x5c80('0x3b')]:_0x3d24ad[_0x5c80('0x36')];_0x2d2b18[_0x5c80('0x3e')]=qs[_0x5c80('0x3f')](_0x19dc26[_0x5c80('0x37')][_0x5c80('0x3f')]);_0x2d2b18[_0x5c80('0x40')]=qs[_0x5c80('0x39')](_['pick'](_0x19dc26[_0x5c80('0x37')],_0x3d24ad[_0x5c80('0x39')]));if(_0x19dc26[_0x5c80('0x37')][_0x5c80('0x42')]){_0x2d2b18[_0x5c80('0x40')]=_[_0x5c80('0x43')](_0x2d2b18['where'],{'$or':_[_0x5c80('0x31')](_0x2d2b18[_0x5c80('0x3b')],function(_0x48ac98){var _0x1b59a4={};_0x1b59a4[_0x48ac98]={'$like':'%'+_0x19dc26[_0x5c80('0x37')]['filter']+'%'};return _0x1b59a4;})});}_0x2d2b18=_['merge']({},_0x2d2b18,_0x19dc26[_0x5c80('0x44')]);return _0x479987[_0x5c80('0xff')](_0x2d2b18);}})[_0x5c80('0x12')](function(_0x42c066){if(_0x42c066){_0x3f4f8c=_0x42c066[_0x5c80('0x3c')];if(!_0x19dc26['query'][_0x5c80('0x59')](_0x5c80('0x3d'))){_0x2d2b18[_0x5c80('0x23')]=qs['limit'](_0x19dc26[_0x5c80('0x37')][_0x5c80('0x23')]);_0x2d2b18[_0x5c80('0x21')]=qs[_0x5c80('0x21')](_0x19dc26['query'][_0x5c80('0x21')]);}return _0x479987['getProactiveActions'](_0x2d2b18);}})[_0x5c80('0x12')](function(_0x31b291){if(_0x31b291){return _0x31b291?{'count':_0x3f4f8c,'rows':_0x31b291}:null;}})[_0x5c80('0x12')](respondWithResult(_0x165d5c,null))[_0x5c80('0x1d')](handleError(_0x165d5c,null));};exports[_0x5c80('0x117')]=function(_0x3e27ba,_0x38bab5){var _0x57c24e=_0x3e27ba[_0x5c80('0x37')][_0x5c80('0x118')]===_0x5c80('0x119')?'offlineForm':_0x5c80('0x11a');return db['ChatWebsite'][_0x5c80('0x50')]({'attributes':['id',_0x57c24e],'where':{'id':_0x3e27ba[_0x5c80('0x47')]['id']}})[_0x5c80('0x12')](handleEntityNotFound(_0x38bab5,null))['then'](function(_0x3f2517){if(_0x3f2517){var _0x33b7ff=_0x3f2517[_0x57c24e];var _0x4f216a=_0x33b7ff&&_0x33b7ff[_0x5c80('0x11b')]?_0x33b7ff[_0x5c80('0x11b')]:[];_0x38bab5[_0x5c80('0x2e')]({'fromKey':_[_0x5c80('0x75')](_0x33b7ff[_0x5c80('0x11c')])?undefined:_0x33b7ff[_0x5c80('0x11c')],'count':_0x4f216a[_0x5c80('0x3c')],'rows':_0x4f216a});}})['catch'](handleError(_0x38bab5,null));};exports[_0x5c80('0x11d')]=function(_0x5c0f80,_0x5a2d93){var _0x2667c3={'raw':![],'where':{}};var _0xec3362={};var _0x5af47d={'count':0x0,'rows':[]};return db[_0x5c80('0x32')][_0x5c80('0x112')]({'where':{'id':_0x5c0f80['params']['id']}})['then'](handleEntityNotFound(_0x5a2d93,null))[_0x5c80('0x12')](function(_0x4c9be2){if(_0x4c9be2){_0xec3362[_0x5c80('0x36')]=_['keys'](db[_0x5c80('0xcb')][_0x5c80('0x33')]);_0xec3362[_0x5c80('0x37')]=_['keys'](_0x5c0f80[_0x5c80('0x37')]);_0xec3362['filters']=_['intersection'](_0xec3362[_0x5c80('0x36')],_0xec3362[_0x5c80('0x37')]);_0x2667c3['attributes']=_[_0x5c80('0x3a')](_0xec3362['model'],qs[_0x5c80('0x58')](_0x5c0f80[_0x5c80('0x37')]['fields']));_0x2667c3[_0x5c80('0x3b')]=_0x2667c3[_0x5c80('0x3b')][_0x5c80('0x3c')]?_0x2667c3[_0x5c80('0x3b')]:_0xec3362[_0x5c80('0x36')];if(!_0x5c0f80[_0x5c80('0x37')][_0x5c80('0x59')](_0x5c80('0x3d'))){_0x2667c3[_0x5c80('0x23')]=qs[_0x5c80('0x23')](_0x5c0f80['query'][_0x5c80('0x23')]);_0x2667c3[_0x5c80('0x21')]=qs['offset'](_0x5c0f80[_0x5c80('0x37')][_0x5c80('0x21')]);}_0x2667c3[_0x5c80('0x3e')]=qs[_0x5c80('0x3f')](_0x5c0f80[_0x5c80('0x37')][_0x5c80('0x3f')]);_0x2667c3[_0x5c80('0x40')]=qs[_0x5c80('0x39')](_[_0x5c80('0x41')](_0x5c0f80['query'],_0xec3362[_0x5c80('0x39')]));_0x2667c3['where']['ChatWebsiteId']=_0x4c9be2['id'];if(_0x5c0f80[_0x5c80('0x37')]['filter']){_0x2667c3['where']=_[_0x5c80('0x43')](_0x2667c3[_0x5c80('0x40')],{'$or':_['map'](_0x2667c3[_0x5c80('0x3b')],function(_0x25b2a6){var _0x2f3d75={};_0x2f3d75[_0x25b2a6]={'$like':'%'+_0x5c0f80[_0x5c80('0x37')][_0x5c80('0x42')]+'%'};return _0x2f3d75;})});}_0x2667c3=_[_0x5c80('0x43')]({},_0x2667c3,_0x5c0f80['options']);return db[_0x5c80('0xcb')]['count']({'where':_0x2667c3[_0x5c80('0x40')]})['then'](function(_0x190068){_0x5af47d['count']=_0x190068;if(_0x5c0f80[_0x5c80('0x37')][_0x5c80('0x49')]){_0x2667c3['include']=[{'all':!![]}];}else{_0x2667c3[_0x5c80('0x45')]=[{'model':db[_0x5c80('0x80')],'as':_0x5c80('0x11e'),'required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0x5c80('0xcb')][_0x5c80('0x5a')](_0x2667c3);})[_0x5c80('0x12')](function(_0x1ef629){_0x5af47d[_0x5c80('0x46')]=_0x1ef629;return _0x5af47d;});}})[_0x5c80('0x12')](respondWithFilteredResult(_0x5a2d93,_0x2667c3))['catch'](handleError(_0x5a2d93,null));};exports['addAgents']=function(_0x4ac1a7,_0x2e4338){return db[_0x5c80('0x32')][_0x5c80('0x50')]({'where':{'id':_0x4ac1a7[_0x5c80('0x47')]['id']}})[_0x5c80('0x12')](handleEntityNotFound(_0x2e4338,null))[_0x5c80('0x12')](function(_0x2bc908){if(_0x2bc908){return _0x2bc908[_0x5c80('0x11f')](_0x4ac1a7[_0x5c80('0x4b')][_0x5c80('0x5c')],_[_0x5c80('0xeb')](_0x4ac1a7[_0x5c80('0x4b')],[_0x5c80('0x5c'),'id'])||{})['spread'](function(_0x11f125){for(var _0x291e0a=0x0;_0x291e0a<_0x4ac1a7[_0x5c80('0x4b')][_0x5c80('0x5c')][_0x5c80('0x3c')];_0x291e0a+=0x1){socket['emit'](_0x5c80('0x120'),{'UserId':Number(_0x4ac1a7[_0x5c80('0x4b')][_0x5c80('0x5c')][_0x291e0a]),'ChatWebsiteId':Number(_0x4ac1a7['params']['id'])});}return _0x11f125;});}})[_0x5c80('0x12')](respondWithResult(_0x2e4338,null))['catch'](handleError(_0x2e4338,null));};exports[_0x5c80('0x121')]=function(_0x5959ec,_0x2649c9){return db[_0x5c80('0x32')][_0x5c80('0x50')]({'where':{'id':_0x5959ec[_0x5c80('0x47')]['id']}})[_0x5c80('0x12')](handleEntityNotFound(_0x2649c9,null))[_0x5c80('0x12')](function(_0x4c3000){if(_0x4c3000){return _0x4c3000[_0x5c80('0x121')](_0x5959ec[_0x5c80('0x37')][_0x5c80('0x5c')])[_0x5c80('0x12')](function(){if(_[_0x5c80('0x122')](_0x5959ec['query'][_0x5c80('0x5c')])){for(var _0x2313e3=0x0;_0x2313e3<_0x5959ec[_0x5c80('0x37')]['ids'][_0x5c80('0x3c')];_0x2313e3+=0x1){socket[_0x5c80('0x123')](_0x5c80('0x124'),{'UserId':Number(_0x5959ec['query'][_0x5c80('0x5c')][_0x2313e3]),'ChatWebsiteId':Number(_0x5959ec[_0x5c80('0x47')]['id'])});}}else{socket[_0x5c80('0x123')](_0x5c80('0x124'),{'UserId':Number(_0x5959ec[_0x5c80('0x37')][_0x5c80('0x5c')]),'ChatWebsiteId':Number(_0x5959ec[_0x5c80('0x47')]['id'])});}});}})[_0x5c80('0x12')](respondWithStatusCode(_0x2649c9,null))[_0x5c80('0x1d')](handleError(_0x2649c9,null));};exports[_0x5c80('0x125')]=function(_0x1082a8,_0x3b92da){var _0x29d863={};var _0x5e2ae2={};var _0x267638;var _0x48b022;return db[_0x5c80('0x32')][_0x5c80('0x112')]({'where':{'id':_0x1082a8[_0x5c80('0x47')]['id']}})[_0x5c80('0x12')](handleEntityNotFound(_0x3b92da,null))[_0x5c80('0x12')](function(_0x206092){if(_0x206092){_0x267638=_0x206092;_0x5e2ae2[_0x5c80('0x36')]=_[_0x5c80('0x38')](db['User'][_0x5c80('0x33')]);_0x5e2ae2['query']=_[_0x5c80('0x38')](_0x1082a8[_0x5c80('0x37')]);_0x5e2ae2[_0x5c80('0x39')]=_['intersection'](_0x5e2ae2[_0x5c80('0x36')],_0x5e2ae2[_0x5c80('0x37')]);_0x29d863[_0x5c80('0x3b')]=_[_0x5c80('0x3a')](_0x5e2ae2[_0x5c80('0x36')],qs[_0x5c80('0x58')](_0x1082a8['query'][_0x5c80('0x58')]));_0x29d863[_0x5c80('0x3b')]=_0x29d863['attributes'][_0x5c80('0x3c')]?_0x29d863[_0x5c80('0x3b')]:_0x5e2ae2['model'];_0x29d863[_0x5c80('0x3e')]=qs['sort'](_0x1082a8[_0x5c80('0x37')][_0x5c80('0x3f')]);_0x29d863[_0x5c80('0x40')]=qs[_0x5c80('0x39')](_['pick'](_0x1082a8[_0x5c80('0x37')],_0x5e2ae2[_0x5c80('0x39')]));if(_0x1082a8[_0x5c80('0x37')]['filter']){_0x29d863[_0x5c80('0x40')]=_['merge'](_0x29d863[_0x5c80('0x40')],{'$or':_[_0x5c80('0x31')](_0x29d863[_0x5c80('0x3b')],function(_0x4c4bce){var _0x1510f8={};_0x1510f8[_0x4c4bce]={'$like':'%'+_0x1082a8[_0x5c80('0x37')]['filter']+'%'};return _0x1510f8;})});}_0x29d863=_[_0x5c80('0x43')]({},_0x29d863,_0x1082a8[_0x5c80('0x44')]);return _0x267638[_0x5c80('0x125')](_0x29d863);}})['then'](function(_0x5eba32){if(_0x5eba32){_0x48b022=_0x5eba32[_0x5c80('0x3c')];if(!_0x1082a8[_0x5c80('0x37')][_0x5c80('0x59')]('nolimit')){_0x29d863[_0x5c80('0x23')]=qs[_0x5c80('0x23')](_0x1082a8[_0x5c80('0x37')][_0x5c80('0x23')]);_0x29d863[_0x5c80('0x21')]=qs[_0x5c80('0x21')](_0x1082a8['query'][_0x5c80('0x21')]);}return _0x267638['getAgents'](_0x29d863);}})[_0x5c80('0x12')](function(_0x2ee2dc){if(_0x2ee2dc){return _0x2ee2dc?{'count':_0x48b022,'rows':_0x2ee2dc}:null;}})[_0x5c80('0x12')](respondWithResult(_0x3b92da,null))[_0x5c80('0x1d')](handleError(_0x3b92da,null));}; \ No newline at end of file +var _0xee81=['ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','getSnippet','Interval','getProactiveActions','virtual','custom','License','increment','chatLicenseExceeded','Intervals','all','server/files/chat/iframe.ejs','remote','stringify','connection','remoteAddress','referer','alignment','verticalAlignment','labelText','textColor','color_button','addApplications','sequelize','Transaction','finally','json','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','User','bluebird','mustache','util','fs-extra','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','error','code','message','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','then','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','map','ChatWebsite','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','findAll','show','params','Pause','mandatoryDispositionPause','include','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','hasOwnProperty','rows','removeAnswers','ids','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','getLicense','isNil','existsSync','server/files/images/logos/','join','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','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','List','DESC','ChatApplication','account','applications','Applications','list','orderBy','priority','asc','Contacts','contact','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','format','%s\x20%s','version','unknown','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','startRouting','Start','EventManager','notify','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','originalname','mimetype','server','attachments','basename','openNewInteraction','transaction','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','Tag','color','tag','Command','timezone','interval','true'];(function(_0x2d5b7b,_0x3fb6e1){var _0x9ce983=function(_0x346f20){while(--_0x346f20){_0x2d5b7b['push'](_0x2d5b7b['shift']());}};_0x9ce983(++_0x3fb6e1);}(_0xee81,0x15e));var _0x1ee8=function(_0x181728,_0x471cc4){_0x181728=_0x181728-0x0;var _0x3525db=_0xee81[_0x181728];return _0x3525db;};'use strict';var BPromise=require(_0x1ee8('0x0'));var Mustache=require(_0x1ee8('0x1'));var util=require(_0x1ee8('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ee8('0x3'));var _=require(_0x1ee8('0x4'));var querystring=require('querystring');var Redis=require(_0x1ee8('0x5'));var qs=require(_0x1ee8('0x6'));var logger=require('../../config/logger')(_0x1ee8('0x7'));var config=require(_0x1ee8('0x8'));var db=require(_0x1ee8('0x9'))['db'];config[_0x1ee8('0xa')]=_[_0x1ee8('0xb')](config[_0x1ee8('0xa')],{'host':_0x1ee8('0xc'),'port':0x18eb});var socket=require(_0x1ee8('0xd'))(new Redis(config['redis']));require(_0x1ee8('0xe'))[_0x1ee8('0xf')](socket);var jayson=require(_0x1ee8('0x10'));var client=jayson[_0x1ee8('0x11')][_0x1ee8('0x12')]({'port':0x232c});var client9002=jayson[_0x1ee8('0x11')]['http']({'port':0x232a});var client9003=jayson[_0x1ee8('0x11')]['http']({'port':0x232b});var client9001=jayson[_0x1ee8('0x11')][_0x1ee8('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x24b43e,_0x1c89c3,_0x23853c,_0x316ab9){return new BPromise(function(_0x2f79ce,_0x40110a){var _0x1ca389=_0x316ab9||client;return _0x1ca389[_0x1ee8('0x13')](_0x24b43e,_0x23853c)['then'](function(_0x57427a){logger[_0x1ee8('0x14')](_0x1ee8('0x15'),_0x1c89c3,_0x1ee8('0x16'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1c89c3,'request\x20sent',JSON['stringify'](_0x57427a));if(_0x57427a[_0x1ee8('0x17')]){if(_0x57427a[_0x1ee8('0x17')][_0x1ee8('0x18')]===0x1f4){logger[_0x1ee8('0x17')](_0x1ee8('0x15'),_0x1c89c3,_0x57427a[_0x1ee8('0x17')]['message']);return _0x40110a(_0x57427a[_0x1ee8('0x17')]['message']);}logger[_0x1ee8('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x1c89c3,_0x57427a[_0x1ee8('0x17')][_0x1ee8('0x19')]);return _0x2f79ce(_0x57427a[_0x1ee8('0x17')][_0x1ee8('0x19')]);}else{logger[_0x1ee8('0x14')](_0x1ee8('0x15'),_0x1c89c3,_0x1ee8('0x16'));_0x2f79ce(_0x57427a[_0x1ee8('0x1a')][_0x1ee8('0x19')]);}})['catch'](function(_0x11b638){logger[_0x1ee8('0x17')](_0x1ee8('0x15'),_0x1c89c3,_0x11b638);_0x40110a(_0x11b638);});});}function respondWithStatusCode(_0x50d357,_0x2796e5){_0x2796e5=_0x2796e5||0xcc;return function(_0x8371bb){if(_0x8371bb){return _0x50d357[_0x1ee8('0x1b')](_0x2796e5);}return _0x50d357[_0x1ee8('0x1c')](_0x2796e5)[_0x1ee8('0x1d')]();};}function respondWithResult(_0x224d4a,_0x55b042){_0x55b042=_0x55b042||0xc8;return function(_0x24c172){if(_0x24c172){return _0x224d4a[_0x1ee8('0x1c')](_0x55b042)['json'](_0x24c172);}};}function respondWithFilteredResult(_0x26c5d4,_0x70e2e1){return function(_0x11888c){if(_0x11888c){var _0x5e08aa=typeof _0x70e2e1[_0x1ee8('0x1e')]===_0x1ee8('0x1f')&&typeof _0x70e2e1[_0x1ee8('0x20')]===_0x1ee8('0x1f');var _0x85b1d1=_0x11888c[_0x1ee8('0x21')];var _0x3b95b9=_0x5e08aa?0x0:_0x70e2e1[_0x1ee8('0x1e')];var _0x413b2d=_0x5e08aa?_0x11888c[_0x1ee8('0x21')]:_0x70e2e1[_0x1ee8('0x1e')]+_0x70e2e1[_0x1ee8('0x20')];var _0xeefa18;if(_0x413b2d>=_0x85b1d1){_0x413b2d=_0x85b1d1;_0xeefa18=0xc8;}else{_0xeefa18=0xce;}_0x26c5d4[_0x1ee8('0x1c')](_0xeefa18);return _0x26c5d4[_0x1ee8('0x22')](_0x1ee8('0x23'),_0x3b95b9+'-'+_0x413b2d+'/'+_0x85b1d1)['json'](_0x11888c);}return null;};}function saveUpdates(_0x4d0398){return function(_0x16c839){if(_0x16c839){return _0x16c839['update'](_0x4d0398)[_0x1ee8('0x24')](function(_0x550f27){return _0x550f27;});}return null;};}function removeEntity(_0x5f2aa1){return function(_0x71b1e8){if(_0x71b1e8){return _0x71b1e8[_0x1ee8('0x25')]()[_0x1ee8('0x24')](function(){var _0x30c1bb=_0x71b1e8[_0x1ee8('0x26')]({'plain':!![]});var _0x4a7d3c=_0x1ee8('0x27');return db[_0x1ee8('0x28')][_0x1ee8('0x25')]({'where':{'type':_0x4a7d3c,'resourceId':_0x30c1bb['id']}})['then'](function(){return _0x71b1e8;});})['then'](function(){_0x5f2aa1[_0x1ee8('0x1c')](0xcc)[_0x1ee8('0x1d')]();});}};}function handleEntityNotFound(_0x61bf69){return function(_0x7f73ac){if(!_0x7f73ac){_0x61bf69['sendStatus'](0x194);}return _0x7f73ac;};}function handleError(_0x1657fb,_0x579c81){_0x579c81=_0x579c81||0x1f4;return function(_0x5431bb){logger[_0x1ee8('0x17')](_0x5431bb[_0x1ee8('0x29')]);if(_0x5431bb[_0x1ee8('0x2a')]){delete _0x5431bb['name'];}_0x1657fb[_0x1ee8('0x1c')](_0x579c81)[_0x1ee8('0x2b')](_0x5431bb);};}exports[_0x1ee8('0x2c')]=function(_0x2e3c1e,_0x4f856b){var _0x439d85={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2722fa={},_0x3f2670={'count':0x0,'rows':[]};var _0x30047f=_[_0x1ee8('0x2d')](db[_0x1ee8('0x2e')][_0x1ee8('0x2f')],function(_0x41a1c4){return{'name':_0x41a1c4[_0x1ee8('0x30')],'type':_0x41a1c4[_0x1ee8('0x31')][_0x1ee8('0x32')]};});_0x2722fa['model']=_[_0x1ee8('0x2d')](_0x30047f,_0x1ee8('0x2a'));_0x2722fa[_0x1ee8('0x33')]=_[_0x1ee8('0x34')](_0x2e3c1e[_0x1ee8('0x33')]);_0x2722fa[_0x1ee8('0x35')]=_['intersection'](_0x2722fa['model'],_0x2722fa[_0x1ee8('0x33')]);_0x439d85[_0x1ee8('0x36')]=_[_0x1ee8('0x37')](_0x2722fa[_0x1ee8('0x38')],qs[_0x1ee8('0x39')](_0x2e3c1e[_0x1ee8('0x33')][_0x1ee8('0x39')]));_0x439d85[_0x1ee8('0x36')]=_0x439d85[_0x1ee8('0x36')][_0x1ee8('0x3a')]?_0x439d85[_0x1ee8('0x36')]:_0x2722fa[_0x1ee8('0x38')];if(!_0x2e3c1e['query']['hasOwnProperty'](_0x1ee8('0x3b'))){_0x439d85['limit']=qs['limit'](_0x2e3c1e['query'][_0x1ee8('0x20')]);_0x439d85['offset']=qs['offset'](_0x2e3c1e[_0x1ee8('0x33')]['offset']);}_0x439d85[_0x1ee8('0x3c')]=qs[_0x1ee8('0x3d')](_0x2e3c1e[_0x1ee8('0x33')]['sort']);_0x439d85[_0x1ee8('0x3e')]=qs[_0x1ee8('0x35')](_[_0x1ee8('0x3f')](_0x2e3c1e[_0x1ee8('0x33')],_0x2722fa[_0x1ee8('0x35')]),_0x30047f);if(_0x2e3c1e[_0x1ee8('0x33')][_0x1ee8('0x40')]){_0x439d85[_0x1ee8('0x3e')]=_['merge'](_0x439d85[_0x1ee8('0x3e')],{'$or':_[_0x1ee8('0x2d')](_0x30047f,function(_0x2dfe50){if(_0x2dfe50[_0x1ee8('0x31')]!==_0x1ee8('0x41')){var _0x1225fc={};_0x1225fc[_0x2dfe50[_0x1ee8('0x2a')]]={'$like':'%'+_0x2e3c1e[_0x1ee8('0x33')][_0x1ee8('0x40')]+'%'};return _0x1225fc;}})});}_0x439d85=_[_0x1ee8('0x42')]({},_0x439d85,_0x2e3c1e['options']);var _0x763a74={'where':_0x439d85[_0x1ee8('0x3e')]};return db['ChatWebsite'][_0x1ee8('0x21')](_0x763a74)['then'](function(_0x1df1d8){_0x3f2670[_0x1ee8('0x21')]=_0x1df1d8;if(_0x2e3c1e[_0x1ee8('0x33')][_0x1ee8('0x43')]){_0x439d85['include']=[{'all':!![]}];}return db['ChatWebsite'][_0x1ee8('0x44')](_0x439d85);})[_0x1ee8('0x24')](function(_0x5084f0){_0x3f2670['rows']=_0x5084f0;return _0x3f2670;})['then'](respondWithFilteredResult(_0x4f856b,_0x439d85))['catch'](handleError(_0x4f856b,null));};exports[_0x1ee8('0x45')]=function(_0x16e76e,_0x3f79b3){var _0x26bf31={'raw':![],'where':{'id':_0x16e76e[_0x1ee8('0x46')]['id']},'include':[{'model':db[_0x1ee8('0x47')],'as':_0x1ee8('0x48')}]},_0x469f85={};_0x469f85[_0x1ee8('0x38')]=_[_0x1ee8('0x34')](db[_0x1ee8('0x2e')][_0x1ee8('0x2f')]);_0x469f85[_0x1ee8('0x33')]=_[_0x1ee8('0x34')](_0x16e76e['query']);_0x469f85[_0x1ee8('0x35')]=_[_0x1ee8('0x37')](_0x469f85[_0x1ee8('0x38')],_0x469f85[_0x1ee8('0x33')]);_0x26bf31[_0x1ee8('0x36')]=_[_0x1ee8('0x37')](_0x469f85[_0x1ee8('0x38')],qs[_0x1ee8('0x39')](_0x16e76e[_0x1ee8('0x33')][_0x1ee8('0x39')]));_0x26bf31['attributes']=_0x26bf31[_0x1ee8('0x36')][_0x1ee8('0x3a')]?_0x26bf31[_0x1ee8('0x36')]:_0x469f85[_0x1ee8('0x38')];if(_0x16e76e[_0x1ee8('0x33')][_0x1ee8('0x43')]){_0x26bf31[_0x1ee8('0x49')]=[{'all':!![]}];}_0x26bf31=_[_0x1ee8('0x42')]({},_0x26bf31,_0x16e76e[_0x1ee8('0x4a')]);return db['ChatWebsite'][_0x1ee8('0x4b')](_0x26bf31)['then'](handleEntityNotFound(_0x3f79b3,null))[_0x1ee8('0x24')](respondWithResult(_0x3f79b3,null))['catch'](handleError(_0x3f79b3,null));};exports[_0x1ee8('0x4c')]=function(_0x332698,_0x43340f){return db[_0x1ee8('0x2e')][_0x1ee8('0x4c')](_0x332698[_0x1ee8('0x4d')],{})[_0x1ee8('0x24')](function(_0x23af4a){var _0x55b36f=_0x332698[_0x1ee8('0x4e')][_0x1ee8('0x26')]({'plain':!![]});if(!_0x55b36f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55b36f[_0x1ee8('0x4f')]===_0x1ee8('0x4e')){var _0x46c8f4=_0x23af4a[_0x1ee8('0x26')]({'plain':!![]});var _0x6c5e3d=_0x1ee8('0x27');return db[_0x1ee8('0x50')][_0x1ee8('0x4b')]({'where':{'name':_0x6c5e3d,'userProfileId':_0x55b36f[_0x1ee8('0x51')]},'raw':!![]})[_0x1ee8('0x24')](function(_0x3cea8e){if(_0x3cea8e&&_0x3cea8e[_0x1ee8('0x52')]===0x0){return db['UserProfileResource'][_0x1ee8('0x4c')]({'name':_0x46c8f4[_0x1ee8('0x2a')],'resourceId':_0x46c8f4['id'],'type':_0x3cea8e[_0x1ee8('0x2a')],'sectionId':_0x3cea8e['id']},{})['then'](function(){return _0x23af4a;});}else{return _0x23af4a;}})[_0x1ee8('0x53')](function(_0xcaeeda){logger['error'](_0x1ee8('0x54'),_0xcaeeda);throw _0xcaeeda;});}return _0x23af4a;})[_0x1ee8('0x24')](respondWithResult(_0x43340f,0xc9))['catch'](handleError(_0x43340f,null));};exports[_0x1ee8('0x55')]=function(_0x3e7a26,_0x2e7612){if(_0x3e7a26[_0x1ee8('0x4d')]['id']){delete _0x3e7a26[_0x1ee8('0x4d')]['id'];}return db[_0x1ee8('0x2e')][_0x1ee8('0x4b')]({'where':{'id':_0x3e7a26[_0x1ee8('0x46')]['id']},'include':[{'model':db[_0x1ee8('0x47')],'as':_0x1ee8('0x48')}]})[_0x1ee8('0x24')](handleEntityNotFound(_0x2e7612,null))[_0x1ee8('0x24')](saveUpdates(_0x3e7a26['body'],null))[_0x1ee8('0x24')](respondWithResult(_0x2e7612,null))[_0x1ee8('0x53')](handleError(_0x2e7612,null));};exports[_0x1ee8('0x25')]=function(_0x294bf5,_0x3ad105){return db[_0x1ee8('0x2e')]['find']({'where':{'id':_0x294bf5[_0x1ee8('0x46')]['id']}})[_0x1ee8('0x24')](handleEntityNotFound(_0x3ad105,null))[_0x1ee8('0x24')](removeEntity(_0x3ad105,null))[_0x1ee8('0x53')](handleError(_0x3ad105,null));};exports[_0x1ee8('0x56')]=function(_0xb5a62d,_0x293670){return db[_0x1ee8('0x2e')][_0x1ee8('0x56')]()['then'](respondWithResult(_0x293670,null))[_0x1ee8('0x53')](handleError(_0x293670,null));};exports['addDisposition']=function(_0x184169,_0x11ec11){if(_0x184169[_0x1ee8('0x4d')]['id']){delete _0x184169[_0x1ee8('0x4d')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x184169['params']['id']}})[_0x1ee8('0x24')](handleEntityNotFound(_0x11ec11,null))[_0x1ee8('0x24')](function(_0x202290){if(_0x202290){_0x184169[_0x1ee8('0x4d')][_0x1ee8('0x57')]=_0x202290['id'];return db[_0x1ee8('0x58')]['create'](_0x184169[_0x1ee8('0x4d')]);}})['then'](respondWithResult(_0x11ec11,null))[_0x1ee8('0x53')](handleError(_0x11ec11,null));};exports[_0x1ee8('0x59')]=function(_0x1a1f8f,_0x3bfdeb){var _0x11df9b={'raw':![],'where':{}};var _0x21f161={};var _0x3570c4={'count':0x0,'rows':[]};return db[_0x1ee8('0x2e')][_0x1ee8('0x5a')]({'where':{'id':_0x1a1f8f['params']['id']}})[_0x1ee8('0x24')](handleEntityNotFound(_0x3bfdeb,null))[_0x1ee8('0x24')](function(_0x56ddb8){if(_0x56ddb8){_0x21f161[_0x1ee8('0x38')]=_[_0x1ee8('0x34')](db[_0x1ee8('0x58')][_0x1ee8('0x2f')]);_0x21f161['query']=_[_0x1ee8('0x34')](_0x1a1f8f['query']);_0x21f161[_0x1ee8('0x35')]=_['intersection'](_0x21f161[_0x1ee8('0x38')],_0x21f161[_0x1ee8('0x33')]);_0x11df9b[_0x1ee8('0x36')]=_[_0x1ee8('0x37')](_0x21f161[_0x1ee8('0x38')],qs[_0x1ee8('0x39')](_0x1a1f8f['query']['fields']));_0x11df9b[_0x1ee8('0x36')]=_0x11df9b['attributes'][_0x1ee8('0x3a')]?_0x11df9b[_0x1ee8('0x36')]:_0x21f161['model'];if(!_0x1a1f8f[_0x1ee8('0x33')]['hasOwnProperty']('nolimit')){_0x11df9b[_0x1ee8('0x20')]=qs[_0x1ee8('0x20')](_0x1a1f8f[_0x1ee8('0x33')][_0x1ee8('0x20')]);_0x11df9b[_0x1ee8('0x1e')]=qs[_0x1ee8('0x1e')](_0x1a1f8f[_0x1ee8('0x33')][_0x1ee8('0x1e')]);}_0x11df9b['order']=qs[_0x1ee8('0x3d')](_0x1a1f8f[_0x1ee8('0x33')][_0x1ee8('0x3d')]);_0x11df9b[_0x1ee8('0x3e')]=qs[_0x1ee8('0x35')](_['pick'](_0x1a1f8f[_0x1ee8('0x33')],_0x21f161[_0x1ee8('0x35')]));_0x11df9b[_0x1ee8('0x3e')][_0x1ee8('0x57')]=_0x56ddb8['id'];if(_0x1a1f8f[_0x1ee8('0x33')][_0x1ee8('0x40')]){_0x11df9b[_0x1ee8('0x3e')]=_['merge'](_0x11df9b[_0x1ee8('0x3e')],{'$or':_['map'](_0x11df9b[_0x1ee8('0x36')],function(_0x394377){var _0x1686fb={};_0x1686fb[_0x394377]={'$like':'%'+_0x1a1f8f['query'][_0x1ee8('0x40')]+'%'};return _0x1686fb;})});}_0x11df9b=_[_0x1ee8('0x42')]({},_0x11df9b,_0x1a1f8f[_0x1ee8('0x4a')]);return db[_0x1ee8('0x58')][_0x1ee8('0x21')]({'where':_0x11df9b['where']})[_0x1ee8('0x24')](function(_0x5499ea){_0x3570c4[_0x1ee8('0x21')]=_0x5499ea;if(_0x1a1f8f[_0x1ee8('0x33')][_0x1ee8('0x43')]){_0x11df9b[_0x1ee8('0x49')]=[{'all':!![]}];}return db[_0x1ee8('0x58')][_0x1ee8('0x44')](_0x11df9b);})[_0x1ee8('0x24')](function(_0x171e0b){_0x3570c4['rows']=_0x171e0b;return _0x3570c4;});}})[_0x1ee8('0x24')](respondWithFilteredResult(_0x3bfdeb,_0x11df9b))['catch'](handleError(_0x3bfdeb,null));};exports[_0x1ee8('0x5b')]=function(_0x74af1f,_0x353b18){return db['ChatWebsite'][_0x1ee8('0x4b')]({'where':{'id':_0x74af1f['params']['id']}})[_0x1ee8('0x24')](handleEntityNotFound(_0x353b18,null))['then'](function(_0xf71d8f){if(_0xf71d8f){return _0xf71d8f[_0x1ee8('0x5b')](_0x74af1f[_0x1ee8('0x33')]['ids']);}})[_0x1ee8('0x24')](respondWithStatusCode(_0x353b18,null))[_0x1ee8('0x53')](handleError(_0x353b18,null));};exports[_0x1ee8('0x5c')]=function(_0x2ed4db,_0xadb0bf){if(_0x2ed4db[_0x1ee8('0x4d')]['id']){delete _0x2ed4db[_0x1ee8('0x4d')]['id'];}return db[_0x1ee8('0x2e')][_0x1ee8('0x4b')]({'where':{'id':_0x2ed4db['params']['id']}})['then'](handleEntityNotFound(_0xadb0bf,null))['then'](function(_0x375685){if(_0x375685){_0x2ed4db['body'][_0x1ee8('0x57')]=_0x375685['id'];return db[_0x1ee8('0x5d')][_0x1ee8('0x4c')](_0x2ed4db['body']);}})['then'](respondWithResult(_0xadb0bf,null))['catch'](handleError(_0xadb0bf,null));};exports['getAnswers']=function(_0x10079b,_0x3a9f1e){var _0xfe8b92={'raw':![],'where':{}};var _0x1056f3={};var _0x2b048d={'count':0x0,'rows':[]};return db[_0x1ee8('0x2e')][_0x1ee8('0x5a')]({'where':{'id':_0x10079b[_0x1ee8('0x46')]['id']}})[_0x1ee8('0x24')](handleEntityNotFound(_0x3a9f1e,null))[_0x1ee8('0x24')](function(_0x284972){if(_0x284972){_0x1056f3['model']=_[_0x1ee8('0x34')](db[_0x1ee8('0x5d')]['rawAttributes']);_0x1056f3[_0x1ee8('0x33')]=_[_0x1ee8('0x34')](_0x10079b['query']);_0x1056f3[_0x1ee8('0x35')]=_['intersection'](_0x1056f3[_0x1ee8('0x38')],_0x1056f3[_0x1ee8('0x33')]);_0xfe8b92[_0x1ee8('0x36')]=_[_0x1ee8('0x37')](_0x1056f3[_0x1ee8('0x38')],qs['fields'](_0x10079b['query'][_0x1ee8('0x39')]));_0xfe8b92['attributes']=_0xfe8b92[_0x1ee8('0x36')]['length']?_0xfe8b92['attributes']:_0x1056f3[_0x1ee8('0x38')];if(!_0x10079b['query'][_0x1ee8('0x5e')]('nolimit')){_0xfe8b92[_0x1ee8('0x20')]=qs[_0x1ee8('0x20')](_0x10079b[_0x1ee8('0x33')]['limit']);_0xfe8b92[_0x1ee8('0x1e')]=qs[_0x1ee8('0x1e')](_0x10079b['query'][_0x1ee8('0x1e')]);}_0xfe8b92[_0x1ee8('0x3c')]=qs[_0x1ee8('0x3d')](_0x10079b[_0x1ee8('0x33')][_0x1ee8('0x3d')]);_0xfe8b92[_0x1ee8('0x3e')]=qs[_0x1ee8('0x35')](_[_0x1ee8('0x3f')](_0x10079b[_0x1ee8('0x33')],_0x1056f3['filters']));_0xfe8b92['where']['ChatWebsiteId']=_0x284972['id'];if(_0x10079b['query']['filter']){_0xfe8b92[_0x1ee8('0x3e')]=_['merge'](_0xfe8b92['where'],{'$or':_[_0x1ee8('0x2d')](_0xfe8b92[_0x1ee8('0x36')],function(_0x5d84c5){var _0xaedc4e={};_0xaedc4e[_0x5d84c5]={'$like':'%'+_0x10079b[_0x1ee8('0x33')][_0x1ee8('0x40')]+'%'};return _0xaedc4e;})});}_0xfe8b92=_[_0x1ee8('0x42')]({},_0xfe8b92,_0x10079b[_0x1ee8('0x4a')]);return db[_0x1ee8('0x5d')]['count']({'where':_0xfe8b92['where']})[_0x1ee8('0x24')](function(_0x279c90){_0x2b048d['count']=_0x279c90;if(_0x10079b[_0x1ee8('0x33')][_0x1ee8('0x43')]){_0xfe8b92[_0x1ee8('0x49')]=[{'all':!![]}];}return db['CannedAnswer'][_0x1ee8('0x44')](_0xfe8b92);})[_0x1ee8('0x24')](function(_0x24ba36){_0x2b048d[_0x1ee8('0x5f')]=_0x24ba36;return _0x2b048d;});}})[_0x1ee8('0x24')](respondWithFilteredResult(_0x3a9f1e,_0xfe8b92))[_0x1ee8('0x53')](handleError(_0x3a9f1e,null));};exports['removeAnswers']=function(_0x5e3177,_0x576cb7){return db[_0x1ee8('0x2e')][_0x1ee8('0x4b')]({'where':{'id':_0x5e3177[_0x1ee8('0x46')]['id']}})[_0x1ee8('0x24')](handleEntityNotFound(_0x576cb7,null))[_0x1ee8('0x24')](function(_0x1b6e02){if(_0x1b6e02){return _0x1b6e02[_0x1ee8('0x60')](_0x5e3177[_0x1ee8('0x33')][_0x1ee8('0x61')]);}})[_0x1ee8('0x24')](respondWithStatusCode(_0x576cb7,null))['catch'](handleError(_0x576cb7,null));};exports[_0x1ee8('0x62')]=function(_0x34b593,_0x2c1bd2){_0x34b593[_0x1ee8('0x4d')][_0x1ee8('0x63')]=_0x34b593[_0x1ee8('0x64')][_0x1ee8('0x65')];return db[_0x1ee8('0x2e')][_0x1ee8('0x4b')]({'where':{'id':_0x34b593['params']['id']}})[_0x1ee8('0x24')](handleEntityNotFound(_0x2c1bd2,null))[_0x1ee8('0x24')](saveUpdates(_0x34b593[_0x1ee8('0x4d')],null))[_0x1ee8('0x24')](respondWithResult(_0x2c1bd2,null))[_0x1ee8('0x53')](handleError(_0x2c1bd2,null));};exports[_0x1ee8('0x66')]=function(_0x45c65c,_0x5f090c){_0x45c65c['body'][_0x1ee8('0x67')]=_0x45c65c[_0x1ee8('0x64')][_0x1ee8('0x65')];return db[_0x1ee8('0x2e')][_0x1ee8('0x4b')]({'where':{'id':_0x45c65c[_0x1ee8('0x46')]['id']}})[_0x1ee8('0x24')](handleEntityNotFound(_0x5f090c,null))[_0x1ee8('0x24')](saveUpdates(_0x45c65c['body'],null))[_0x1ee8('0x24')](respondWithResult(_0x5f090c,null))[_0x1ee8('0x53')](handleError(_0x5f090c,null));};exports[_0x1ee8('0x68')]=function(_0x481945,_0x389c96){_0x481945[_0x1ee8('0x4d')]['customerAvatar']=_0x481945[_0x1ee8('0x64')][_0x1ee8('0x65')];return db['ChatWebsite'][_0x1ee8('0x4b')]({'where':{'id':_0x481945[_0x1ee8('0x46')]['id']}})['then'](handleEntityNotFound(_0x389c96,null))['then'](saveUpdates(_0x481945['body'],null))[_0x1ee8('0x24')](respondWithResult(_0x389c96,null))[_0x1ee8('0x53')](handleError(_0x389c96,null));};exports[_0x1ee8('0x69')]=function(_0x2a642c,_0x49f247){_0x2a642c[_0x1ee8('0x4d')][_0x1ee8('0x6a')]=_0x2a642c['file'][_0x1ee8('0x65')];return db[_0x1ee8('0x2e')][_0x1ee8('0x4b')]({'where':{'id':_0x2a642c[_0x1ee8('0x46')]['id']}})['then'](handleEntityNotFound(_0x49f247,null))['then'](saveUpdates(_0x2a642c[_0x1ee8('0x4d')],null))['then'](respondWithResult(_0x49f247,null))[_0x1ee8('0x53')](handleError(_0x49f247,null));};exports[_0x1ee8('0x6b')]=function(_0x51a613,_0x48810e){var _0x58d2b8=path['join'](config[_0x1ee8('0x6c')],_0x1ee8('0x6d'));var _0xbd8407={'where':{'id':_0x51a613[_0x1ee8('0x46')]['id']},'attributes':['id',_0x1ee8('0x63')],'raw':!![]};var _0x169928=![];return require('../../config/license/util')[_0x1ee8('0x6e')]()[_0x1ee8('0x24')](function(_0x325b7e){if(_0x325b7e){_0x169928=_0x325b7e['custom'];}})[_0x1ee8('0x24')](function(){return db[_0x1ee8('0x2e')][_0x1ee8('0x4b')](_0xbd8407);})['then'](handleEntityNotFound(_0x48810e,null))[_0x1ee8('0x24')](function(_0x2d5fa4){if(_0x2d5fa4){if(!_[_0x1ee8('0x6f')](_0x2d5fa4[_0x1ee8('0x63')])){if(fs[_0x1ee8('0x70')](path['join'](config[_0x1ee8('0x6c')],_0x1ee8('0x71'),_0x2d5fa4[_0x1ee8('0x63')]))&&_0x169928){_0x58d2b8=path['join'](config[_0x1ee8('0x6c')],_0x1ee8('0x71'),_0x2d5fa4[_0x1ee8('0x63')]);}}return _0x48810e['download'](_0x58d2b8);}})[_0x1ee8('0x53')](handleError(_0x48810e,null));};exports['getAvatar']=function(_0xe21ee2,_0x7eb13c){var _0x4cc980=path[_0x1ee8('0x72')](config['root'],_0x1ee8('0x73'));var _0x167b98={'where':{'id':_0xe21ee2[_0x1ee8('0x46')]['id']},'attributes':['id',_0x1ee8('0x67')],'raw':!![]};return db[_0x1ee8('0x2e')][_0x1ee8('0x4b')](_0x167b98)[_0x1ee8('0x24')](handleEntityNotFound(_0x7eb13c,null))[_0x1ee8('0x24')](function(_0x571d68){if(_0x571d68){if(!_[_0x1ee8('0x6f')](_0x571d68[_0x1ee8('0x67')])){if(fs[_0x1ee8('0x70')](path['join'](config['root'],_0x1ee8('0x74'),_0x571d68['agentAvatar']))){_0x4cc980=path[_0x1ee8('0x72')](config[_0x1ee8('0x6c')],_0x1ee8('0x74'),_0x571d68[_0x1ee8('0x67')]);}}return _0x7eb13c[_0x1ee8('0x75')](_0x4cc980);}})[_0x1ee8('0x53')](handleError(_0x7eb13c,null));};exports[_0x1ee8('0x76')]=function(_0xd7dec8,_0xc9a665){var _0x51a169=path['join'](config['root'],_0x1ee8('0x77'));var _0x40940e={'where':{'id':_0xd7dec8[_0x1ee8('0x46')]['id']},'attributes':['id',_0x1ee8('0x78'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite'][_0x1ee8('0x4b')](_0x40940e)[_0x1ee8('0x24')](handleEntityNotFound(_0xc9a665,null))[_0x1ee8('0x24')](function(_0x2e275e){if(_0x2e275e){if(!_[_0x1ee8('0x6f')](_0x2e275e[_0x1ee8('0x78')])){if(fs[_0x1ee8('0x70')](path['join'](config[_0x1ee8('0x6c')],_0x1ee8('0x74'),_0x2e275e[_0x1ee8('0x78')]))&&_0x2e275e[_0x1ee8('0x79')]){_0x51a169=path['join'](config[_0x1ee8('0x6c')],_0x1ee8('0x74'),_0x2e275e['customerAvatar']);}}return _0xc9a665[_0x1ee8('0x75')](_0x51a169);}})[_0x1ee8('0x53')](handleError(_0xc9a665,null));};exports[_0x1ee8('0x7a')]=function(_0x21b07c,_0x51f61d){var _0x13442c=path['join'](config[_0x1ee8('0x6c')],_0x1ee8('0x7b'));var _0x59560f={'where':{'id':_0x21b07c[_0x1ee8('0x46')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite'][_0x1ee8('0x4b')](_0x59560f)[_0x1ee8('0x24')](handleEntityNotFound(_0x51f61d,null))[_0x1ee8('0x24')](function(_0x53d6b3){if(_0x53d6b3){if(!_[_0x1ee8('0x6f')](_0x53d6b3[_0x1ee8('0x6a')])){if(fs[_0x1ee8('0x70')](path[_0x1ee8('0x72')](config[_0x1ee8('0x6c')],_0x1ee8('0x74'),_0x53d6b3[_0x1ee8('0x6a')]))){_0x13442c=path[_0x1ee8('0x72')](config[_0x1ee8('0x6c')],_0x1ee8('0x74'),_0x53d6b3['systemAvatar']);}}return _0x51f61d['download'](_0x13442c);}})['catch'](handleError(_0x51f61d,null));};exports['notify']=function(_0x32eae6,_0x183087){var _0x5540a3=require(_0x1ee8('0x7c'));var _0x272e18=new _0x5540a3();var _0x5e3b8c=_0x272e18['setUA'](_0x32eae6[_0x1ee8('0x7d')][_0x1ee8('0x7e')])[_0x1ee8('0x7f')]();var _0x578d04={'body':_0x32eae6[_0x1ee8('0x4d')],'channel':_0x1ee8('0x80')};var _0x2ef50b=[];var _0x13d9d3=[];var _0xb71d72={};var _0xb76f42=![];return db[_0x1ee8('0x81')]['describe']()[_0x1ee8('0x24')](function(_0x264e93){if(!_0x264e93){throw new db[(_0x1ee8('0x82'))][(_0x1ee8('0x83'))](_0x1ee8('0x84'));}_0x2ef50b=_[_0x1ee8('0x85')](_[_0x1ee8('0x34')](_0x264e93),[_0x1ee8('0x86'),_0x1ee8('0x87')]);_0x13d9d3=_[_0x1ee8('0x85')](_[_0x1ee8('0x34')](_0x264e93),[_0x1ee8('0x86'),'updatedAt',_0x1ee8('0x88'),_0x1ee8('0x89')]);if(_0x32eae6[_0x1ee8('0x4d')]['id']){delete _0x32eae6['body']['id'];}if(_['isNil'](_0x32eae6[_0x1ee8('0x4d')][_0x1ee8('0x8a')])){throw new db[(_0x1ee8('0x82'))][(_0x1ee8('0x83'))](_0x1ee8('0x8b'));}if(_[_0x1ee8('0x6f')](_0x32eae6[_0x1ee8('0x4d')][_0x1ee8('0x4d')])||_0x32eae6[_0x1ee8('0x4d')][_0x1ee8('0x4d')]===''){throw new db[(_0x1ee8('0x82'))][(_0x1ee8('0x83'))](_0x1ee8('0x8c'));}if(_[_0x1ee8('0x6f')](_0x32eae6[_0x1ee8('0x4d')]['mapKey'])){throw new db[(_0x1ee8('0x82'))][(_0x1ee8('0x83'))](_0x1ee8('0x8d')+_0x13d9d3);}if(!_[_0x1ee8('0x8e')](_0x13d9d3,_0x32eae6[_0x1ee8('0x4d')][_0x1ee8('0x8f')])){throw new db['Sequelize'][(_0x1ee8('0x83'))](_0x1ee8('0x90')+_0x13d9d3);}_0xb71d72[_0x32eae6['body'][_0x1ee8('0x8f')]]=_0x32eae6[_0x1ee8('0x4d')][_0x1ee8('0x8a')];})[_0x1ee8('0x24')](function(){return db[_0x1ee8('0x2e')][_0x1ee8('0x4b')]({'where':{'id':_0x32eae6[_0x1ee8('0x46')]['id']},'include':[{'model':db[_0x1ee8('0x91')],'as':_0x1ee8('0x92'),'include':[{'model':db[_0x1ee8('0x81')],'as':'Contacts','where':_0xb71d72,'limit':0x1,'order':[[_0x1ee8('0x87'),_0x1ee8('0x93')]]}]},{'model':db[_0x1ee8('0x94')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x183087,null))[_0x1ee8('0x24')](function(_0x498744){if(_0x498744&&_0x498744['List']){_0x578d04[_0x1ee8('0x95')]=_0x498744;_0x578d04[_0x1ee8('0x96')]=_0x498744[_0x1ee8('0x97')];_0x578d04[_0x1ee8('0x98')]=_0x498744[_0x1ee8('0x92')];_0x578d04[_0x1ee8('0x96')]=_[_0x1ee8('0x99')](_0x578d04[_0x1ee8('0x96')],[_0x1ee8('0x9a')],[_0x1ee8('0x9b')]);if(_0x578d04[_0x1ee8('0x95')][_0x1ee8('0x97')]){delete _0x578d04[_0x1ee8('0x95')]['Applications'];}if(_0x578d04[_0x1ee8('0x95')][_0x1ee8('0x92')]&&_0x578d04[_0x1ee8('0x95')][_0x1ee8('0x92')][_0x1ee8('0x9c')][_0x1ee8('0x3a')]){return _0x578d04[_0x1ee8('0x95')][_0x1ee8('0x92')][_0x1ee8('0x9c')][0x0];}var _0x146927=_['defaults'](_0x32eae6['body'],{'firstName':_0x32eae6[_0x1ee8('0x4d')][_0x1ee8('0x8a')],'ListId':_0x498744['ListId']});_0x146927[_0x32eae6[_0x1ee8('0x4d')][_0x1ee8('0x8f')]]=_0x32eae6[_0x1ee8('0x4d')][_0x1ee8('0x8a')];return db['CmContact'][_0x1ee8('0x4c')](_0x146927,{'fields':_0x2ef50b,'raw':!![]});}})[_0x1ee8('0x24')](handleEntityNotFound(_0x183087,null))[_0x1ee8('0x24')](function(_0x23b496){_0x578d04[_0x1ee8('0x9d')]=_0x23b496;var _0x4dd37d=_0x32eae6[_0x1ee8('0x4d')]['customerIp'];if(_0x32eae6[_0x1ee8('0x7d')][_0x1ee8('0x9e')]){_0x4dd37d=_0x32eae6[_0x1ee8('0x7d')][_0x1ee8('0x9e')];}else if(_0x32eae6[_0x1ee8('0x7d')][_0x1ee8('0x9f')]){_0x4dd37d=_[_0x1ee8('0xa0')](_0x32eae6['headers'][_0x1ee8('0x9f')][_0x1ee8('0xa1')](','));}if(_0x23b496){var _0x317505={'ContactId':_0x23b496['id'],'ChatWebsiteId':_0x32eae6['params']['id'],'from':(_0x23b496[_0x1ee8('0xa2')]||'')+'\x20'+(_0x23b496[_0x1ee8('0xa3')]||''),'customerIp':_0x4dd37d,'customerPort':_0x32eae6[_0x1ee8('0x7d')][_0x1ee8('0xa4')]?_0x32eae6[_0x1ee8('0x7d')][_0x1ee8('0xa4')]:null,'referer':_0x32eae6[_0x1ee8('0x4d')]['referer'],'browserName':_0x5e3b8c[_0x1ee8('0xa5')][_0x1ee8('0x2a')]&&_0x5e3b8c[_0x1ee8('0xa5')]['version']?util[_0x1ee8('0xa6')](_0x1ee8('0xa7'),_0x5e3b8c['browser']['name'],_0x5e3b8c[_0x1ee8('0xa5')]['version']):'unknown','browserVersion':_0x5e3b8c[_0x1ee8('0xa5')][_0x1ee8('0xa8')]||_0x1ee8('0xa9'),'osName':util['format']('%s\x20%s',_0x5e3b8c['os']['name'],_0x5e3b8c['os'][_0x1ee8('0xa8')]),'osVersion':_0x5e3b8c['os'][_0x1ee8('0xa8')],'deviceModel':_0x5e3b8c[_0x1ee8('0xaa')][_0x1ee8('0x38')]&&_0x5e3b8c['device'][_0x1ee8('0xab')]?util[_0x1ee8('0xa6')](_0x1ee8('0xac'),_0x5e3b8c['device'][_0x1ee8('0x38')],_0x5e3b8c[_0x1ee8('0xaa')][_0x1ee8('0xab')],_0x5e3b8c['device']['type']):null,'deviceVendor':_0x5e3b8c[_0x1ee8('0xaa')][_0x1ee8('0xab')],'deviceType':_0x5e3b8c[_0x1ee8('0xaa')][_0x1ee8('0x31')],'formData':JSON['stringify'](_0x32eae6[_0x1ee8('0x4d')])};var _0x42716a={'ChatWebsiteId':_0x32eae6[_0x1ee8('0x46')]['id'],'closed':![]};if(_0x32eae6[_0x1ee8('0x4d')][_0x1ee8('0xad')]){_0x42716a[_0x1ee8('0xad')]=_0x32eae6[_0x1ee8('0x4d')][_0x1ee8('0xad')];return db['ChatInteraction'][_0x1ee8('0x4b')]({'where':_0x42716a})[_0x1ee8('0x24')](function(_0x240008){if(_0x240008){return[_0x240008,![]];}_0x317505[_0x1ee8('0xad')]=_0x32eae6[_0x1ee8('0x4d')]['threadId'];_0x317505[_0x1ee8('0xae')]=_0x32eae6[_0x1ee8('0x4d')][_0x1ee8('0xae')];return db[_0x1ee8('0xaf')][_0x1ee8('0x4c')](_0x317505)[_0x1ee8('0x24')](function(_0x50b136){return[_0x50b136,!![]];});});}_0x42716a[_0x1ee8('0xb0')]=_0x23b496['id'];if(_0x32eae6[_0x1ee8('0x4d')]['interaction']&&_0x32eae6[_0x1ee8('0x4d')][_0x1ee8('0xb1')]['id']){_0x42716a['id']=_0x32eae6[_0x1ee8('0x4d')][_0x1ee8('0xb1')]['id'];return db[_0x1ee8('0xaf')]['find']({'where':_0x42716a})[_0x1ee8('0x24')](function(_0x86108e){if(_0x86108e){return[_0x86108e,![]];}return db['ChatInteraction']['create'](_0x317505)['then'](function(_0x31e4e3){return[_0x31e4e3,!![]];});});}return db[_0x1ee8('0xaf')][_0x1ee8('0x4c')](_0x317505)['then'](function(_0x597446){return[_0x597446,!![]];});}})['spread'](function(_0x3b01a2,_0x3e5460){if(_0x3b01a2){_0xb76f42=_0x3e5460;if(!_0x3e5460){var _0x4df80a={'from':(_0x578d04[_0x1ee8('0x9d')][_0x1ee8('0xa2')]||'')+'\x20'+(_0x578d04[_0x1ee8('0x9d')][_0x1ee8('0xa3')]||'')};if(_0x32eae6[_0x1ee8('0x4d')][_0x1ee8('0xad')]&&_0x32eae6[_0x1ee8('0x4d')][_0x1ee8('0xb2')]&&_0x32eae6['body'][_0x1ee8('0xad')]!=_0x32eae6[_0x1ee8('0x4d')]['messageId']){_0x4df80a[_0x1ee8('0xad')]=_0x32eae6[_0x1ee8('0x4d')][_0x1ee8('0xb2')];}return _0x3b01a2[_0x1ee8('0x55')](_0x4df80a);}else{return _0x3b01a2;}}})[_0x1ee8('0x24')](function(_0x40fcc4){_0x578d04[_0x1ee8('0xb1')]=_0x40fcc4[_0x1ee8('0x26')]({'plain':!![]});_0x578d04[_0x1ee8('0xb1')]['created']=_0xb76f42;if(_0x578d04[_0x1ee8('0xb1')][_0x1ee8('0xb3')]){if(_0x578d04[_0x1ee8('0x95')][_0x1ee8('0xb4')]){_0x578d04['applications'][_0x1ee8('0xb5')]({'id':0x0,'priority':_0x578d04[_0x1ee8('0x96')][_0x1ee8('0x3a')]+0x1,'app':_0x1ee8('0xb6'),'appdata':_0x1ee8('0xb7'),'interval':'*,*,*,*'});}}return db[_0x1ee8('0xb8')]['create']({'body':_0x32eae6['body'][_0x1ee8('0x4d')],'ChatWebsiteId':_0x32eae6[_0x1ee8('0x46')]['id'],'ChatInteractionId':_0x40fcc4['id'],'direction':'in','ContactId':_0x578d04[_0x1ee8('0x9d')]['id'],'AttachmentId':_0x32eae6[_0x1ee8('0x4d')][_0x1ee8('0xb9')]});})[_0x1ee8('0x24')](function(_0x32e696){_0x578d04[_0x1ee8('0x19')]=_0x32e696;if(_0x578d04[_0x1ee8('0xb1')][_0x1ee8('0xba')]){return db['User'][_0x1ee8('0x4b')]({'attributes':['id',_0x1ee8('0x2a')],'where':{'id':_0x578d04['interaction']['UserId']}})[_0x1ee8('0x24')](function(_0x27eee6){if(_0x27eee6){_0x578d04[_0x1ee8('0x96')][_0x1ee8('0xbb')]({'id':0x0,'priority':0x0,'app':_0x1ee8('0xbc'),'appdata':_0x27eee6[_0x1ee8('0x2a')]+','+(_0x578d04['account'][_0x1ee8('0xbd')]||0xa),'interval':_0x1ee8('0xbe')});_0x578d04[_0x1ee8('0xbf')]=!![];}return respondWithRpcPromise('Start',_0x1ee8('0xc0'),_0x578d04);});}return respondWithRpcPromise(_0x1ee8('0xc1'),_0x1ee8('0xc0'),_0x578d04);})[_0x1ee8('0x24')](function(_0x2e17a8){respondWithRpcPromise(_0x1ee8('0xc2'),'EventManager',{'event':_0x1ee8('0xc3'),'message':_0x2e17a8},client9002);return _0x2e17a8;})[_0x1ee8('0x24')](respondWithResult(_0x183087,null))[_0x1ee8('0x53')](handleError(_0x183087,null));};exports[_0x1ee8('0xc4')]=function(_0x25d452,_0x1f1c6e){var _0x5420c9,_0x31840a,_0x859364;var _0x24d673=[];var _0x48355a={};var _0x1ee838=_0x25d452[_0x1ee8('0xc5')]||[];var _0x515a1a=[];var _0x30c561;return db['CmContact'][_0x1ee8('0x56')]()[_0x1ee8('0x24')](function(_0xc31787){if(!_0xc31787){throw new db['Sequelize'][(_0x1ee8('0x83'))](_0x1ee8('0x84'));}_0x24d673=_[_0x1ee8('0x85')](_['keys'](_0xc31787),[_0x1ee8('0x86'),_0x1ee8('0x87'),_0x1ee8('0x88'),'ListId']);if(_0x25d452[_0x1ee8('0x4d')]['id']){delete _0x25d452['body']['id'];}if(_[_0x1ee8('0x6f')](_0x25d452['body']['from'])){throw _0x1f1c6e['status'](0x1f4)['send'](new db['Sequelize']['ValidationError']('from\x20is\x20mandatory'));}if(_['isNil'](_0x25d452['body'][_0x1ee8('0x4d')])||_0x25d452[_0x1ee8('0x4d')][_0x1ee8('0x4d')]===''){throw _0x1f1c6e[_0x1ee8('0x1c')](0x1f4)['send'](new db['Sequelize'][(_0x1ee8('0x83'))](_0x1ee8('0x8c')));}if(_[_0x1ee8('0x6f')](_0x25d452[_0x1ee8('0x4d')][_0x1ee8('0xc6')])){throw _0x1f1c6e[_0x1ee8('0x1c')](0x1f4)[_0x1ee8('0x2b')](new db['Sequelize'][(_0x1ee8('0x83'))](_0x1ee8('0xc7')+_0x24d673));}if(!_[_0x1ee8('0x8e')](_0x24d673,_0x25d452[_0x1ee8('0x4d')][_0x1ee8('0xc6')])){throw _0x1f1c6e[_0x1ee8('0x1c')](0x1f4)[_0x1ee8('0x2b')](new db[(_0x1ee8('0x82'))]['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x24d673));}_0x48355a[_0x25d452['body'][_0x1ee8('0xc6')]]=_0x25d452[_0x1ee8('0x4d')][_0x1ee8('0x8a')];})['then'](function(){return db['ChatWebsite'][_0x1ee8('0x4b')]({'where':{'id':_0x25d452['params']['id']},'include':[{'model':db['CmList'],'as':_0x1ee8('0x92')},{'model':db[_0x1ee8('0xc8')],'as':_0x1ee8('0xc8')}]});})[_0x1ee8('0x24')](handleEntityNotFound(_0x1f1c6e,null))[_0x1ee8('0x24')](function(_0x158cbe){if(_0x158cbe&&_0x158cbe[_0x1ee8('0x92')]){_0x31840a=_0x158cbe;var _0x4058fb=_[_0x1ee8('0xb')](_0x25d452[_0x1ee8('0x4d')],{'firstName':_0x25d452[_0x1ee8('0x4d')]['from'],'phone':_0x25d452['body'][_0x1ee8('0x8a')],'ListId':_0x158cbe['ListId']});_0x4058fb[_0x25d452['body'][_0x1ee8('0xc6')]]=_0x25d452[_0x1ee8('0x4d')][_0x1ee8('0x8a')];return db[_0x1ee8('0x81')]['findOrCreate']({'where':_0x48355a,'defaults':_0x4058fb});}})[_0x1ee8('0xc9')](function(_0x2fb0e1){if(_0x2fb0e1){_0x859364=_0x2fb0e1;var _0x14579e=fs[_0x1ee8('0xca')](path[_0x1ee8('0x72')](config[_0x1ee8('0x6c')],_0x1ee8('0xcb')),_0x1ee8('0xcc'));var _0x53ddc1=ejs[_0x1ee8('0xcd')](_0x14579e,{'body':_['toPairs'](_0x25d452[_0x1ee8('0x4d')][_0x1ee8('0x4d')]),'bodyTitle':_0x31840a['offlineMessageBody']});return db['ChatOfflineMessage']['create']({'body':_0x53ddc1,'ContactId':_0x2fb0e1['id'],'ChatWebsiteId':_0x31840a['id']});}})[_0x1ee8('0x24')](function(_0x20e51d){_0x30c561=_0x20e51d;if(_0x1ee838[_0x1ee8('0x3a')]){var _0xd20ac0=_0x1ee838[_0x1ee8('0x2d')](function(_0x46a921){return{'name':_0x46a921[_0x1ee8('0xce')],'basename':_0x46a921['filename'],'type':_0x46a921[_0x1ee8('0xcf')],'ChatOfflineMessageId':_0x20e51d['id']};});_0x515a1a=_0xd20ac0['map'](_0x2aaa32=>{var _0x221422={'filename':_0x2aaa32[_0x1ee8('0x2a')],'path':path['join'](config[_0x1ee8('0x6c')],_0x1ee8('0xd0'),_0x1ee8('0xc5'),_0x1ee8('0xd1'),'offline-chat',_0x2aaa32[_0x1ee8('0xd2')])};return _0x221422;});if(!_0x31840a[_0x1ee8('0xd3')]){return db['sequelize'][_0x1ee8('0xd4')](function(_0x3077f6){return db['Attachment'][_0x1ee8('0xd5')](_0xd20ac0,{'transaction':_0x3077f6});});}}})[_0x1ee8('0x24')](function(){if(_0x30c561){_0x5420c9=_0x30c561;return db[_0x1ee8('0xc8')][_0x1ee8('0x5a')]({'where':{'active':!![]},'include':[{'model':db[_0x1ee8('0xd6')],'as':_0x1ee8('0xd7'),'raw':!![]}]});}})[_0x1ee8('0x24')](function(_0x56adfb){if(_0x56adfb&&_0x56adfb['Smtp']&&_0x31840a[_0x1ee8('0xd8')]&&_0x31840a[_0x1ee8('0xd9')]){var _0x43ddf7={'tls':{'rejectUnauthorized':![]}};if(_0x56adfb[_0x1ee8('0xd7')][_0x1ee8('0xda')]){_0x43ddf7['service']=_0x56adfb[_0x1ee8('0xd7')][_0x1ee8('0xda')];}else{_0x43ddf7[_0x1ee8('0xdb')]=_0x56adfb[_0x1ee8('0xd7')][_0x1ee8('0xdb')];_0x43ddf7['port']=_0x56adfb[_0x1ee8('0xd7')][_0x1ee8('0xdc')];_0x43ddf7[_0x1ee8('0xdd')]=_0x56adfb[_0x1ee8('0xd7')]['secure'];}if(_0x56adfb[_0x1ee8('0xd7')][_0x1ee8('0xde')]){_0x43ddf7[_0x1ee8('0xdf')]={'user':_0x56adfb[_0x1ee8('0xd7')][_0x1ee8('0x4e')],'pass':_0x56adfb[_0x1ee8('0xd7')][_0x1ee8('0xe0')]};}return respondWithRpcPromise(_0x1ee8('0xe1'),'sendMail',{'account':_0x43ddf7,'message':{'from':util[_0x1ee8('0xa6')](_0x1ee8('0xe2'),_0x56adfb[_0x1ee8('0x2a')],_0x56adfb[_0x1ee8('0xe3')]||_0x56adfb[_0x1ee8('0xd7')][_0x1ee8('0x4e')]),'to':_0x31840a[_0x1ee8('0xd9')],'subject':_0x31840a[_0x1ee8('0xe4')],'html':_0x5420c9[_0x1ee8('0x4d')],'attachments':_0x515a1a}},client9003)[_0x1ee8('0x24')](function(){return _0x5420c9;})[_0x1ee8('0x53')](function(_0x5399e5){console[_0x1ee8('0x17')](_0x5399e5);});}})[_0x1ee8('0x24')](function(){if(_0x31840a&&_0x31840a[_0x1ee8('0xd3')]&&_0x31840a[_0x1ee8('0xe5')]){var _0x15fd14=[];if(_0x1ee838[_0x1ee8('0x3a')]){_0x15fd14=_0x1ee838[_0x1ee8('0x2d')](function(_0x275380){return{'name':_0x275380[_0x1ee8('0xce')],'basename':_0x275380['filename'],'type':_0x275380[_0x1ee8('0xcf')],'ChatOfflineMessageId':_0x30c561['id']};});}var _0x2904b9;if(!_[_0x1ee8('0x6f')](_0x31840a[_0x1ee8('0xe6')])){var _0x400997=_[_0x1ee8('0x2d')](_0x25d452['body'],function(_0x547c0e){return _0x547c0e;});var _0x24a43b=_[_0x1ee8('0xe7')](_0x400997)[0x0];var _0xd7c694=_[_0x1ee8('0xe8')](_0x24a43b,function(_0x1f304a){return _0x1f304a;});_0x2904b9=_0xd7c694[0x1][_0x31840a['subjectOffline']];}var _0x1e119e={'from':_0x859364[_0x1ee8('0xe3')],'firstName':_0x859364[_0x1ee8('0xa2')],'lastName':_0x859364[_0x1ee8('0xa3')],'mapKey':_0x1ee8('0xe3'),'message':{'from':_0x859364[_0x1ee8('0xe3')],'to':_0x31840a['MailAccount'][_0x1ee8('0xe3')],'cc':'','subject':_[_0x1ee8('0x6f')](_0x2904b9)?_0x31840a[_0x1ee8('0xe4')]:_0x2904b9,'messageId':'','sentAt':new Date(),'attach':_0x15fd14[_0x1ee8('0x3a')],'attachments':_0x15fd14,'originChannel':_0x1ee8('0xe9'),'ChatWebsiteId':_0x31840a['id'],'ChatOfflineMessageId':_0x5420c9['id'],'originTo':_0x31840a[_0x1ee8('0xc8')][_0x1ee8('0xe3')]},'body':_0x5420c9[_0x1ee8('0x4d')]};var _0x58d86b={'account':{'id':_0x31840a['MailAccountId']},'body':_0x1e119e,'log':_0x1ee8('0xea')};return respondWithRpcPromise(_0x1ee8('0xea'),'notifyMail',_0x58d86b,client9001)[_0x1ee8('0x24')](function(){return _0x5420c9;})[_0x1ee8('0x53')](function(_0x115a3a){console[_0x1ee8('0x17')](_0x115a3a);});}return;})[_0x1ee8('0x24')](function(){if(_0x5420c9){return _0x5420c9;}})[_0x1ee8('0x24')](respondWithResult(_0x1f1c6e,null))[_0x1ee8('0x53')](function(_0x473379){console['error']('catch',_0x473379);for(var _0x1fdc10 of _0x1ee838){var _0xce1270=path['join'](config[_0x1ee8('0x6c')],_0x1ee8('0xd0'),_0x1ee8('0xc5'),_0x1ee8('0xd1'),'offline-chat',_0x1fdc10['filename']);fs_extra['remove'](_0xce1270)[_0x1ee8('0x53')](function(_0x47c20c){console[_0x1ee8('0x17')](_0x1ee8('0xeb'),_0xce1270,_0x47c20c);});}});};exports[_0x1ee8('0xec')]=function(_0x3eda2d,_0x1b5f40){return db[_0x1ee8('0xaf')][_0x1ee8('0x4b')]({'where':{'id':_0x3eda2d[_0x1ee8('0x46')]['id']}})[_0x1ee8('0x24')](handleEntityNotFound(_0x1b5f40,null))['then'](function(_0x1fb283){if(_0x1fb283){return _0x1fb283['addInteraction'](_0x3eda2d[_0x1ee8('0x4d')][_0x1ee8('0x61')],_['omit'](_0x3eda2d[_0x1ee8('0x4d')],[_0x1ee8('0x61'),'id'])||{});}})['then'](respondWithResult(_0x1b5f40,null))[_0x1ee8('0x53')](handleError(_0x1b5f40,null));};exports[_0x1ee8('0xed')]=function(_0x58c80b,_0x15dd41){var _0x15f55a={'raw':![],'where':{}};var _0xe5a3ef={};var _0xd70ee7={'count':0x0,'rows':[]};return db[_0x1ee8('0x2e')][_0x1ee8('0x5a')]({'where':{'id':_0x58c80b[_0x1ee8('0x46')]['id']}})[_0x1ee8('0x24')](handleEntityNotFound(_0x15dd41,null))['then'](function(_0x503c3e){if(_0x503c3e){_0xe5a3ef[_0x1ee8('0x38')]=_[_0x1ee8('0x34')](db[_0x1ee8('0xaf')][_0x1ee8('0x2f')]);_0xe5a3ef[_0x1ee8('0x33')]=_[_0x1ee8('0x34')](_0x58c80b[_0x1ee8('0x33')]);_0xe5a3ef[_0x1ee8('0x35')]=_['intersection'](_0xe5a3ef[_0x1ee8('0x38')],_0xe5a3ef[_0x1ee8('0x33')]);_0x15f55a[_0x1ee8('0x36')]=_[_0x1ee8('0x37')](_0xe5a3ef[_0x1ee8('0x38')],qs[_0x1ee8('0x39')](_0x58c80b[_0x1ee8('0x33')][_0x1ee8('0x39')]));_0x15f55a[_0x1ee8('0x36')]=_0x15f55a[_0x1ee8('0x36')]['length']?_0x15f55a[_0x1ee8('0x36')]:_0xe5a3ef[_0x1ee8('0x38')];if(!_0x58c80b['query']['hasOwnProperty'](_0x1ee8('0x3b'))){_0x15f55a[_0x1ee8('0x20')]=qs[_0x1ee8('0x20')](_0x58c80b[_0x1ee8('0x33')]['limit']);_0x15f55a[_0x1ee8('0x1e')]=qs['offset'](_0x58c80b[_0x1ee8('0x33')]['offset']);}_0x15f55a['order']=qs[_0x1ee8('0x3d')](_0x58c80b[_0x1ee8('0x33')]['sort']);_0x15f55a['where']=qs[_0x1ee8('0x35')](_[_0x1ee8('0x3f')](_0x58c80b[_0x1ee8('0x33')],_0xe5a3ef['filters']));_0x15f55a['where'][_0x1ee8('0x57')]=_0x503c3e['id'];if(_0x58c80b[_0x1ee8('0x33')][_0x1ee8('0x40')]){_0x15f55a['where']=_[_0x1ee8('0x42')](_0x15f55a[_0x1ee8('0x3e')],{'$or':_[_0x1ee8('0x2d')](_0x15f55a['attributes'],function(_0x2abe68){var _0x1dc6c2={};_0x1dc6c2[_0x2abe68]={'$like':'%'+_0x58c80b[_0x1ee8('0x33')][_0x1ee8('0x40')]+'%'};return _0x1dc6c2;})});}_0x15f55a=_[_0x1ee8('0x42')]({},_0x15f55a,_0x58c80b['options']);return db[_0x1ee8('0xaf')][_0x1ee8('0x21')]({'where':_0x15f55a['where']})[_0x1ee8('0x24')](function(_0x17e03a){_0xd70ee7[_0x1ee8('0x21')]=_0x17e03a;if(_0x58c80b[_0x1ee8('0x33')][_0x1ee8('0x43')]){_0x15f55a[_0x1ee8('0x49')]=[{'model':db[_0x1ee8('0x81')],'as':_0x1ee8('0xee'),'required':![]},{'model':db['User'],'as':_0x1ee8('0xef'),'attributes':[_0x1ee8('0x2a'),_0x1ee8('0xf0'),'internal'],'required':![]},{'model':db[_0x1ee8('0xf1')],'as':'Tags','attributes':['id',_0x1ee8('0x2a'),_0x1ee8('0xf2')],'where':_0x58c80b[_0x1ee8('0x33')]['tag']?{'id':_0x58c80b[_0x1ee8('0x33')][_0x1ee8('0xf3')]}:undefined,'required':_0x58c80b[_0x1ee8('0x33')][_0x1ee8('0xf3')]?!![]:![]}];}return db[_0x1ee8('0xaf')][_0x1ee8('0x44')](_0x15f55a);})[_0x1ee8('0x24')](function(_0x381b11){_0xd70ee7[_0x1ee8('0x5f')]=_0x381b11;return _0xd70ee7;});}})[_0x1ee8('0x24')](respondWithFilteredResult(_0x15dd41,_0x15f55a))[_0x1ee8('0x53')](handleError(_0x15dd41,null));};function iftimePromise(_0x372fbe,_0x9272ed){return respondWithRpcPromise(_0x1ee8('0xf4'),'getSnippet',{'command':_0x9272ed[_0x1ee8('0xf5')]?util['format']('iftime\x20%s,%s',_0x372fbe[_0x1ee8('0xf6')],_0x9272ed[_0x1ee8('0xf5')]):util[_0x1ee8('0xa6')]('iftime\x20%s',_0x372fbe[_0x1ee8('0xf6')])},client9002)[_0x1ee8('0x24')](function(_0x3ba805){var _0x177133=_0x3ba805&&_0x3ba805['indexOf'](_0x1ee8('0xf7'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x9272ed['id'],_0x372fbe['id'],_0x372fbe[_0x1ee8('0xf6')],_0x177133?_0x1ee8('0xf8'):_0x1ee8('0xf9'),_0x9272ed['timezone']?_0x9272ed[_0x1ee8('0xf5')]:_0x1ee8('0xfa'));return _0x177133;})['catch'](function(_0x17219d){logger[_0x1ee8('0x17')](_0x1ee8('0xfb'),_0x9272ed['id'],_0x372fbe['id'],_0x372fbe[_0x1ee8('0xf6')],util['inspect'](_0x17219d,{'showHidden':![],'depth':null}),_0x9272ed[_0x1ee8('0xf5')]?_0x9272ed[_0x1ee8('0xf5')]:_0x1ee8('0xfa'));return![];});}exports[_0x1ee8('0xfc')]=function(_0x2e5fbe,_0x12b40a){var _0x837070=0x0;var _0xdca186=0x0;var _0x2c77a7=![];var _0x3c4c3c;var _0x2b7235;return db[_0x1ee8('0x2e')][_0x1ee8('0x4b')]({'where':{'id':_0x2e5fbe['params']['id']},'include':[{'model':db[_0x1ee8('0xfd')],'as':'Interval','include':[{'model':db[_0x1ee8('0xfd')],'as':'Intervals','attributes':['id',_0x1ee8('0xf6')],'raw':!![]}]}]})[_0x1ee8('0x24')](handleEntityNotFound(_0x12b40a,null))[_0x1ee8('0x24')](function(_0x1ff4f7){if(_0x1ff4f7){_0x3c4c3c=_0x1ff4f7;return _0x1ff4f7[_0x1ee8('0xfe')]({'raw':!![]});}})[_0x1ee8('0x24')](function(_0x1db386){if(_0x3c4c3c){if(_0x1db386){_0x2b7235=_0x1db386;}}return require('../../config/license/util')['getLicense']();})[_0x1ee8('0x24')](function(_0x268f7e){if(_0x268f7e){_0xdca186=_0x268f7e[_0x1ee8('0xff')];_0x2c77a7=_0x268f7e[_0x1ee8('0x100')];}})[_0x1ee8('0x24')](function(){return db['ChatInteraction'][_0x1ee8('0x21')]({'where':{'closed':![]}});})[_0x1ee8('0x24')](function(_0x5e899a){_0x837070=_0x5e899a;if(_0xdca186&&_0x5e899a>_0xdca186){return db[_0x1ee8('0x101')][_0x1ee8('0x5a')]({'where':{'id':0x1}})[_0x1ee8('0x24')](function(_0x5f4596){if(_0x5f4596){_0x5f4596[_0x1ee8('0x102')](_0x1ee8('0x103'));}});}})[_0x1ee8('0x24')](function(){if(_0x3c4c3c[_0x1ee8('0xfd')]&&_0x3c4c3c[_0x1ee8('0xfd')]['Intervals']){var _0x54f008=[];for(var _0x17dd71=0x0;_0x17dd71<_0x3c4c3c[_0x1ee8('0xfd')][_0x1ee8('0x104')][_0x1ee8('0x3a')];_0x17dd71++){var _0x520a57=_0x3c4c3c[_0x1ee8('0xfd')]['Intervals'][_0x17dd71][_0x1ee8('0x26')]({'plain':!![]});_0x54f008['push'](iftimePromise(_0x520a57,_0x3c4c3c));}return BPromise[_0x1ee8('0x105')](_0x54f008)['then'](function(_0x2776f0){return _['some'](_0x2776f0);});}else{return!![];}})['then'](function(_0x37841a){var _0x56151f=fs[_0x1ee8('0xca')](path[_0x1ee8('0x72')](config[_0x1ee8('0x6c')],_0x1ee8('0x106')),_0x1ee8('0xcc'));var _0x13be3e={'remote':_0x3c4c3c[_0x1ee8('0x107')],'query':querystring[_0x1ee8('0x108')](_[_0x1ee8('0x42')](_0x3c4c3c[_0x1ee8('0x26')]({'plain':!![]}),{'customerIp':_0x2e5fbe[_0x1ee8('0x7d')][_0x1ee8('0x9f')]||_0x2e5fbe[_0x1ee8('0x7d')]['x-real-ip']||_0x2e5fbe[_0x1ee8('0x109')][_0x1ee8('0x10a')]||_0x2e5fbe['ip'],'referer':_0x2e5fbe[_0x1ee8('0x7d')][_0x1ee8('0x10b')],'openedInteractions':_0x837070,'maxInteractions':_0xdca186,'virtual':_0x2c77a7[_0x1ee8('0xff')],'online':_0x37841a,'custom':_0x2c77a7}))['replace'](/'/g,'\x5c\x27')};_0x12b40a['send'](ejs['render'](Mustache[_0x1ee8('0xcd')](_0x56151f,_0x13be3e),{'proactiveActions':_0x2b7235,'alignment':_0x3c4c3c[_0x1ee8('0x10c')],'verticalAlignment':_0x3c4c3c[_0x1ee8('0x10d')],'div_color':_0x3c4c3c[_0x1ee8('0xf2')],'labelText':_0x3c4c3c[_0x1ee8('0x10e')],'text_color':_0x3c4c3c[_0x1ee8('0x10f')],'button_color':_0x3c4c3c[_0x1ee8('0x110')],'background_color':_0x3c4c3c['backgroundColor']}));})[_0x1ee8('0x53')](handleError(_0x12b40a,null));};exports[_0x1ee8('0x111')]=function(_0x38163c,_0xeea08f){var _0x26f728=_0x38163c[_0x1ee8('0x46')]['id'];var _0x16c097=_0x38163c['body'];var _0x3e1b23=0xc8;var _0x16340d=null;return db[_0x1ee8('0x112')][_0x1ee8('0xd4')]({'isolationLevel':db[_0x1ee8('0x112')][_0x1ee8('0x113')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x47b27a){return db['ChatWebsite']['findOne']({'where':{'id':_0x26f728},'transaction':_0x47b27a})[_0x1ee8('0x24')](function(_0x53a2b0){if(_0x53a2b0){return db[_0x1ee8('0x94')][_0x1ee8('0x25')]({'where':{'ChatWebsiteId':_0x26f728},'transaction':_0x47b27a})[_0x1ee8('0x24')](function(){var _0x12c9c3=_[_0x1ee8('0x2d')](_0x16c097,function(_0x7ce1c){_0x7ce1c[_0x1ee8('0x57')]=_0x26f728;return _0x7ce1c;});return db[_0x1ee8('0x94')][_0x1ee8('0xd5')](_0x12c9c3,{'transaction':_0x47b27a});});}else{_0x3e1b23=0x194;_0x16340d=[];}});})[_0x1ee8('0x24')](function(){if(_0x3e1b23!==0x194){return db[_0x1ee8('0x94')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x26f728},'order':_0x1ee8('0x9a')})[_0x1ee8('0x24')](function(_0x19c452){_0x16340d=_0x19c452;});}})['catch'](function(_0x493a1c){_0x3e1b23=0x1f4;logger[_0x1ee8('0x17')](_0x493a1c[_0x1ee8('0x29')]);if(_0x493a1c[_0x1ee8('0x2a')]){delete _0x493a1c[_0x1ee8('0x2a')];}_0x16340d=_0x493a1c;})[_0x1ee8('0x114')](function(){if(_0x16340d===null){_0xeea08f[_0x1ee8('0x1b')](_0x3e1b23);}else{if(_0x3e1b23===0x1f4){_0xeea08f[_0x1ee8('0x1c')](_0x3e1b23)[_0x1ee8('0x2b')](_0x16340d);}else{_0xeea08f[_0x1ee8('0x1c')](_0x3e1b23)[_0x1ee8('0x115')](_0x16340d);}}});};exports[_0x1ee8('0x116')]=function(_0x4d0037,_0x596eb4){var _0x53f0b9={};var _0x562561={};var _0x2d687c;var _0x20a2fe;return db[_0x1ee8('0x2e')]['findOne']({'where':{'id':_0x4d0037[_0x1ee8('0x46')]['id']}})[_0x1ee8('0x24')](handleEntityNotFound(_0x596eb4,null))[_0x1ee8('0x24')](function(_0xbde4cf){if(_0xbde4cf){_0x2d687c=_0xbde4cf;_0x562561[_0x1ee8('0x38')]=_['keys'](db[_0x1ee8('0x94')]['rawAttributes']);_0x562561[_0x1ee8('0x33')]=_[_0x1ee8('0x34')](_0x4d0037[_0x1ee8('0x33')]);_0x562561[_0x1ee8('0x35')]=_[_0x1ee8('0x37')](_0x562561[_0x1ee8('0x38')],_0x562561[_0x1ee8('0x33')]);_0x53f0b9[_0x1ee8('0x36')]=_[_0x1ee8('0x37')](_0x562561[_0x1ee8('0x38')],qs['fields'](_0x4d0037['query'][_0x1ee8('0x39')]));_0x53f0b9[_0x1ee8('0x36')]=_0x53f0b9[_0x1ee8('0x36')][_0x1ee8('0x3a')]?_0x53f0b9[_0x1ee8('0x36')]:_0x562561[_0x1ee8('0x38')];_0x53f0b9[_0x1ee8('0x3c')]=qs['sort'](_0x4d0037[_0x1ee8('0x33')][_0x1ee8('0x3d')]);_0x53f0b9[_0x1ee8('0x3e')]=qs[_0x1ee8('0x35')](_[_0x1ee8('0x3f')](_0x4d0037['query'],_0x562561[_0x1ee8('0x35')]));if(_0x4d0037[_0x1ee8('0x33')][_0x1ee8('0x40')]){_0x53f0b9['where']=_[_0x1ee8('0x42')](_0x53f0b9[_0x1ee8('0x3e')],{'$or':_[_0x1ee8('0x2d')](_0x53f0b9[_0x1ee8('0x36')],function(_0x110975){var _0x4ea220={};_0x4ea220[_0x110975]={'$like':'%'+_0x4d0037[_0x1ee8('0x33')]['filter']+'%'};return _0x4ea220;})});}_0x53f0b9=_[_0x1ee8('0x42')]({},_0x53f0b9,_0x4d0037['options']);return _0x2d687c[_0x1ee8('0x116')](_0x53f0b9);}})[_0x1ee8('0x24')](function(_0x5e305d){if(_0x5e305d){_0x20a2fe=_0x5e305d[_0x1ee8('0x3a')];if(!_0x4d0037['query'][_0x1ee8('0x5e')](_0x1ee8('0x3b'))){_0x53f0b9[_0x1ee8('0x20')]=qs[_0x1ee8('0x20')](_0x4d0037[_0x1ee8('0x33')][_0x1ee8('0x20')]);_0x53f0b9[_0x1ee8('0x1e')]=qs[_0x1ee8('0x1e')](_0x4d0037[_0x1ee8('0x33')]['offset']);}return _0x2d687c[_0x1ee8('0x116')](_0x53f0b9);}})['then'](function(_0x5d4610){if(_0x5d4610){return _0x5d4610?{'count':_0x20a2fe,'rows':_0x5d4610}:null;}})['then'](respondWithResult(_0x596eb4,null))[_0x1ee8('0x53')](handleError(_0x596eb4,null));};exports[_0x1ee8('0x117')]=function(_0x26e0fe,_0x22e658){return db['chatProactiveAction'][_0x1ee8('0x4b')]({'where':{'id':_0x26e0fe[_0x1ee8('0x46')]['id']}})[_0x1ee8('0x24')](handleEntityNotFound(_0x22e658,null))[_0x1ee8('0x24')](function(_0x12fb59){if(_0x12fb59){return _0x12fb59[_0x1ee8('0x117')](_0x26e0fe['body'][_0x1ee8('0x61')],_['omit'](_0x26e0fe['body'],['ids','id'])||{});}})[_0x1ee8('0x24')](respondWithResult(_0x22e658,null))['catch'](handleError(_0x22e658,null));};exports[_0x1ee8('0xfe')]=function(_0x5bc6e9,_0x4e4540){var _0x4ba18a={};var _0x4c9ef5={};var _0x20bc52;var _0x15fbe5;return db['ChatWebsite'][_0x1ee8('0x5a')]({'where':{'id':_0x5bc6e9[_0x1ee8('0x46')]['id']}})[_0x1ee8('0x24')](handleEntityNotFound(_0x4e4540,null))[_0x1ee8('0x24')](function(_0x5d2250){if(_0x5d2250){_0x20bc52=_0x5d2250;_0x4c9ef5['model']=_[_0x1ee8('0x34')](db[_0x1ee8('0x118')][_0x1ee8('0x2f')]);_0x4c9ef5[_0x1ee8('0x33')]=_[_0x1ee8('0x34')](_0x5bc6e9[_0x1ee8('0x33')]);_0x4c9ef5[_0x1ee8('0x35')]=_[_0x1ee8('0x37')](_0x4c9ef5[_0x1ee8('0x38')],_0x4c9ef5[_0x1ee8('0x33')]);_0x4ba18a[_0x1ee8('0x36')]=_[_0x1ee8('0x37')](_0x4c9ef5[_0x1ee8('0x38')],qs[_0x1ee8('0x39')](_0x5bc6e9[_0x1ee8('0x33')][_0x1ee8('0x39')]));_0x4ba18a[_0x1ee8('0x36')]=_0x4ba18a[_0x1ee8('0x36')][_0x1ee8('0x3a')]?_0x4ba18a['attributes']:_0x4c9ef5[_0x1ee8('0x38')];_0x4ba18a['order']=qs[_0x1ee8('0x3d')](_0x5bc6e9[_0x1ee8('0x33')]['sort']);_0x4ba18a[_0x1ee8('0x3e')]=qs['filters'](_[_0x1ee8('0x3f')](_0x5bc6e9[_0x1ee8('0x33')],_0x4c9ef5[_0x1ee8('0x35')]));if(_0x5bc6e9[_0x1ee8('0x33')][_0x1ee8('0x40')]){_0x4ba18a[_0x1ee8('0x3e')]=_[_0x1ee8('0x42')](_0x4ba18a[_0x1ee8('0x3e')],{'$or':_[_0x1ee8('0x2d')](_0x4ba18a[_0x1ee8('0x36')],function(_0xb93449){var _0x5e26a8={};_0x5e26a8[_0xb93449]={'$like':'%'+_0x5bc6e9['query'][_0x1ee8('0x40')]+'%'};return _0x5e26a8;})});}_0x4ba18a=_[_0x1ee8('0x42')]({},_0x4ba18a,_0x5bc6e9['options']);return _0x20bc52[_0x1ee8('0xfe')](_0x4ba18a);}})[_0x1ee8('0x24')](function(_0x4e412b){if(_0x4e412b){_0x15fbe5=_0x4e412b['length'];if(!_0x5bc6e9[_0x1ee8('0x33')]['hasOwnProperty']('nolimit')){_0x4ba18a[_0x1ee8('0x20')]=qs[_0x1ee8('0x20')](_0x5bc6e9[_0x1ee8('0x33')][_0x1ee8('0x20')]);_0x4ba18a['offset']=qs['offset'](_0x5bc6e9[_0x1ee8('0x33')][_0x1ee8('0x1e')]);}return _0x20bc52[_0x1ee8('0xfe')](_0x4ba18a);}})[_0x1ee8('0x24')](function(_0x5abdb8){if(_0x5abdb8){return _0x5abdb8?{'count':_0x15fbe5,'rows':_0x5abdb8}:null;}})[_0x1ee8('0x24')](respondWithResult(_0x4e4540,null))[_0x1ee8('0x53')](handleError(_0x4e4540,null));};exports[_0x1ee8('0x119')]=function(_0x11dc31,_0x531c82){var _0x38c2f4=_0x11dc31[_0x1ee8('0x33')][_0x1ee8('0x11a')]===_0x1ee8('0x11b')?_0x1ee8('0x11c'):_0x1ee8('0x11d');return db[_0x1ee8('0x2e')][_0x1ee8('0x4b')]({'attributes':['id',_0x38c2f4],'where':{'id':_0x11dc31[_0x1ee8('0x46')]['id']}})['then'](handleEntityNotFound(_0x531c82,null))[_0x1ee8('0x24')](function(_0x2862ba){if(_0x2862ba){var _0x14de08=_0x2862ba[_0x38c2f4];var _0x1c02d8=_0x14de08&&_0x14de08[_0x1ee8('0x11e')]?_0x14de08[_0x1ee8('0x11e')]:[];_0x531c82[_0x1ee8('0x2b')]({'fromKey':_[_0x1ee8('0x6f')](_0x14de08[_0x1ee8('0x11f')])?undefined:_0x14de08[_0x1ee8('0x11f')],'count':_0x1c02d8[_0x1ee8('0x3a')],'rows':_0x1c02d8});}})[_0x1ee8('0x53')](handleError(_0x531c82,null));};exports[_0x1ee8('0x120')]=function(_0x5305c7,_0x11fe8d){var _0x1c2e1e={'raw':![],'where':{}};var _0x25387c={};var _0x5838e8={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x1ee8('0x5a')]({'where':{'id':_0x5305c7[_0x1ee8('0x46')]['id']}})[_0x1ee8('0x24')](handleEntityNotFound(_0x11fe8d,null))[_0x1ee8('0x24')](function(_0x3a4101){if(_0x3a4101){_0x25387c[_0x1ee8('0x38')]=_[_0x1ee8('0x34')](db[_0x1ee8('0x121')][_0x1ee8('0x2f')]);_0x25387c[_0x1ee8('0x33')]=_['keys'](_0x5305c7[_0x1ee8('0x33')]);_0x25387c[_0x1ee8('0x35')]=_[_0x1ee8('0x37')](_0x25387c[_0x1ee8('0x38')],_0x25387c['query']);_0x1c2e1e['attributes']=_[_0x1ee8('0x37')](_0x25387c[_0x1ee8('0x38')],qs[_0x1ee8('0x39')](_0x5305c7[_0x1ee8('0x33')]['fields']));_0x1c2e1e['attributes']=_0x1c2e1e[_0x1ee8('0x36')][_0x1ee8('0x3a')]?_0x1c2e1e[_0x1ee8('0x36')]:_0x25387c[_0x1ee8('0x38')];if(!_0x5305c7['query']['hasOwnProperty'](_0x1ee8('0x3b'))){_0x1c2e1e[_0x1ee8('0x20')]=qs['limit'](_0x5305c7[_0x1ee8('0x33')][_0x1ee8('0x20')]);_0x1c2e1e[_0x1ee8('0x1e')]=qs[_0x1ee8('0x1e')](_0x5305c7[_0x1ee8('0x33')][_0x1ee8('0x1e')]);}_0x1c2e1e['order']=qs['sort'](_0x5305c7[_0x1ee8('0x33')][_0x1ee8('0x3d')]);_0x1c2e1e[_0x1ee8('0x3e')]=qs[_0x1ee8('0x35')](_['pick'](_0x5305c7[_0x1ee8('0x33')],_0x25387c[_0x1ee8('0x35')]));_0x1c2e1e[_0x1ee8('0x3e')][_0x1ee8('0x57')]=_0x3a4101['id'];if(_0x5305c7[_0x1ee8('0x33')][_0x1ee8('0x40')]){_0x1c2e1e[_0x1ee8('0x3e')]=_[_0x1ee8('0x42')](_0x1c2e1e[_0x1ee8('0x3e')],{'$or':_['map'](_0x1c2e1e[_0x1ee8('0x36')],function(_0x45ecac){var _0xe83094={};_0xe83094[_0x45ecac]={'$like':'%'+_0x5305c7[_0x1ee8('0x33')]['filter']+'%'};return _0xe83094;})});}_0x1c2e1e=_[_0x1ee8('0x42')]({},_0x1c2e1e,_0x5305c7['options']);return db[_0x1ee8('0x121')][_0x1ee8('0x21')]({'where':_0x1c2e1e[_0x1ee8('0x3e')]})['then'](function(_0x349786){_0x5838e8[_0x1ee8('0x21')]=_0x349786;if(_0x5305c7[_0x1ee8('0x33')][_0x1ee8('0x43')]){_0x1c2e1e['include']=[{'all':!![]}];}else{_0x1c2e1e['include']=[{'model':db['CmContact'],'as':_0x1ee8('0xee'),'required':![]},{'model':db['Attachment'],'as':_0x1ee8('0x122'),'required':![]}];}return db[_0x1ee8('0x121')][_0x1ee8('0x44')](_0x1c2e1e);})[_0x1ee8('0x24')](function(_0x1d745c){_0x5838e8[_0x1ee8('0x5f')]=_0x1d745c;return _0x5838e8;});}})['then'](respondWithFilteredResult(_0x11fe8d,_0x1c2e1e))['catch'](handleError(_0x11fe8d,null));};exports[_0x1ee8('0x123')]=function(_0x1306db,_0x924b4e){return db['ChatWebsite'][_0x1ee8('0x4b')]({'where':{'id':_0x1306db[_0x1ee8('0x46')]['id']}})[_0x1ee8('0x24')](handleEntityNotFound(_0x924b4e,null))[_0x1ee8('0x24')](function(_0x3678d1){if(_0x3678d1){return _0x3678d1[_0x1ee8('0x123')](_0x1306db[_0x1ee8('0x4d')]['ids'],_['omit'](_0x1306db[_0x1ee8('0x4d')],[_0x1ee8('0x61'),'id'])||{})[_0x1ee8('0xc9')](function(_0x2e3cfe){for(var _0x2b27b2=0x0;_0x2b27b2<_0x1306db[_0x1ee8('0x4d')]['ids'][_0x1ee8('0x3a')];_0x2b27b2+=0x1){socket[_0x1ee8('0x124')](_0x1ee8('0x125'),{'UserId':Number(_0x1306db[_0x1ee8('0x4d')][_0x1ee8('0x61')][_0x2b27b2]),'ChatWebsiteId':Number(_0x1306db['params']['id'])});}return _0x2e3cfe;});}})['then'](respondWithResult(_0x924b4e,null))['catch'](handleError(_0x924b4e,null));};exports[_0x1ee8('0x126')]=function(_0x431480,_0x417b79){return db[_0x1ee8('0x2e')][_0x1ee8('0x4b')]({'where':{'id':_0x431480[_0x1ee8('0x46')]['id']}})[_0x1ee8('0x24')](handleEntityNotFound(_0x417b79,null))[_0x1ee8('0x24')](function(_0x1b3bf6){if(_0x1b3bf6){return _0x1b3bf6['removeAgents'](_0x431480[_0x1ee8('0x33')][_0x1ee8('0x61')])[_0x1ee8('0x24')](function(){if(_[_0x1ee8('0x127')](_0x431480['query'][_0x1ee8('0x61')])){for(var _0x55136a=0x0;_0x55136a<_0x431480[_0x1ee8('0x33')][_0x1ee8('0x61')]['length'];_0x55136a+=0x1){socket[_0x1ee8('0x124')](_0x1ee8('0x128'),{'UserId':Number(_0x431480[_0x1ee8('0x33')][_0x1ee8('0x61')][_0x55136a]),'ChatWebsiteId':Number(_0x431480[_0x1ee8('0x46')]['id'])});}}else{socket[_0x1ee8('0x124')](_0x1ee8('0x128'),{'UserId':Number(_0x431480['query'][_0x1ee8('0x61')]),'ChatWebsiteId':Number(_0x431480['params']['id'])});}});}})[_0x1ee8('0x24')](respondWithStatusCode(_0x417b79,null))['catch'](handleError(_0x417b79,null));};exports[_0x1ee8('0x129')]=function(_0x5c03f9,_0x67d831){var _0x41b094={};var _0x708794={};var _0x2c6acf;var _0x451b15;return db[_0x1ee8('0x2e')][_0x1ee8('0x5a')]({'where':{'id':_0x5c03f9['params']['id']}})[_0x1ee8('0x24')](handleEntityNotFound(_0x67d831,null))[_0x1ee8('0x24')](function(_0x23b5e4){if(_0x23b5e4){_0x2c6acf=_0x23b5e4;_0x708794[_0x1ee8('0x38')]=_[_0x1ee8('0x34')](db[_0x1ee8('0x12a')]['rawAttributes']);_0x708794[_0x1ee8('0x33')]=_[_0x1ee8('0x34')](_0x5c03f9[_0x1ee8('0x33')]);_0x708794[_0x1ee8('0x35')]=_['intersection'](_0x708794[_0x1ee8('0x38')],_0x708794['query']);_0x41b094['attributes']=_[_0x1ee8('0x37')](_0x708794['model'],qs[_0x1ee8('0x39')](_0x5c03f9[_0x1ee8('0x33')][_0x1ee8('0x39')]));_0x41b094[_0x1ee8('0x36')]=_0x41b094[_0x1ee8('0x36')][_0x1ee8('0x3a')]?_0x41b094[_0x1ee8('0x36')]:_0x708794['model'];_0x41b094[_0x1ee8('0x3c')]=qs[_0x1ee8('0x3d')](_0x5c03f9[_0x1ee8('0x33')][_0x1ee8('0x3d')]);_0x41b094[_0x1ee8('0x3e')]=qs[_0x1ee8('0x35')](_[_0x1ee8('0x3f')](_0x5c03f9[_0x1ee8('0x33')],_0x708794[_0x1ee8('0x35')]));if(_0x5c03f9[_0x1ee8('0x33')][_0x1ee8('0x40')]){_0x41b094['where']=_[_0x1ee8('0x42')](_0x41b094[_0x1ee8('0x3e')],{'$or':_[_0x1ee8('0x2d')](_0x41b094[_0x1ee8('0x36')],function(_0x12ed93){var _0x138eca={};_0x138eca[_0x12ed93]={'$like':'%'+_0x5c03f9[_0x1ee8('0x33')][_0x1ee8('0x40')]+'%'};return _0x138eca;})});}_0x41b094=_['merge']({},_0x41b094,_0x5c03f9[_0x1ee8('0x4a')]);return _0x2c6acf['getAgents'](_0x41b094);}})[_0x1ee8('0x24')](function(_0x53f2b5){if(_0x53f2b5){_0x451b15=_0x53f2b5[_0x1ee8('0x3a')];if(!_0x5c03f9[_0x1ee8('0x33')][_0x1ee8('0x5e')](_0x1ee8('0x3b'))){_0x41b094[_0x1ee8('0x20')]=qs[_0x1ee8('0x20')](_0x5c03f9['query'][_0x1ee8('0x20')]);_0x41b094[_0x1ee8('0x1e')]=qs[_0x1ee8('0x1e')](_0x5c03f9[_0x1ee8('0x33')][_0x1ee8('0x1e')]);}return _0x2c6acf[_0x1ee8('0x129')](_0x41b094);}})[_0x1ee8('0x24')](function(_0x502705){if(_0x502705){return _0x502705?{'count':_0x451b15,'rows':_0x502705}:null;}})[_0x1ee8('0x24')](respondWithResult(_0x67d831,null))[_0x1ee8('0x53')](handleError(_0x67d831,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index e3aa78e..e38713e 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 _0xbe02=['emit','hasOwnProperty','hook','exports','../../mysqldb','ChatWebsite','setMaxListeners','remove'];(function(_0x371f55,_0x5077a8){var _0x1286a0=function(_0xa01b00){while(--_0xa01b00){_0x371f55['push'](_0x371f55['shift']());}};_0x1286a0(++_0x5077a8);}(_0xbe02,0x124));var _0x2be0=function(_0x50e47d,_0xc972c0){_0x50e47d=_0x50e47d-0x0;var _0x1ca8ec=_0xbe02[_0x50e47d];return _0x1ca8ec;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x2be0('0x0'))['db'][_0x2be0('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x2be0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2be0('0x3')};function emitEvent(_0x248e93){return function(_0x506aad,_0x1ec170,_0x10bd08){ChatWebsiteEvents[_0x2be0('0x4')](_0x248e93+':'+_0x506aad['id'],_0x506aad);ChatWebsiteEvents[_0x2be0('0x4')](_0x248e93,_0x506aad);_0x10bd08(null);};}for(var e in events){if(events[_0x2be0('0x5')](e)){var event=events[e];ChatWebsite[_0x2be0('0x6')](e,emitEvent(event));}}module[_0x2be0('0x7')]=ChatWebsiteEvents; \ No newline at end of file +var _0xfafd=['emit','hasOwnProperty','hook','exports','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove'];(function(_0x33dde6,_0x30fcd8){var _0x4584d6=function(_0x3e763b){while(--_0x3e763b){_0x33dde6['push'](_0x33dde6['shift']());}};_0x4584d6(++_0x30fcd8);}(_0xfafd,0xcc));var _0xdfaf=function(_0x53d2b1,_0x17f446){_0x53d2b1=_0x53d2b1-0x0;var _0x295e84=_0xfafd[_0x53d2b1];return _0x295e84;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xdfaf('0x0'))['db'][_0xdfaf('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xdfaf('0x2')](0x0);var events={'afterCreate':_0xdfaf('0x3'),'afterUpdate':_0xdfaf('0x4'),'afterDestroy':_0xdfaf('0x5')};function emitEvent(_0x2fd070){return function(_0x2ca36c,_0x7e3bc7,_0x2a28e9){ChatWebsiteEvents[_0xdfaf('0x6')](_0x2fd070+':'+_0x2ca36c['id'],_0x2ca36c);ChatWebsiteEvents[_0xdfaf('0x6')](_0x2fd070,_0x2ca36c);_0x2a28e9(null);};}for(var e in events){if(events[_0xdfaf('0x7')](e)){var event=events[e];ChatWebsite[_0xdfaf('0x8')](e,emitEvent(event));}}module[_0xdfaf('0x9')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 0e2a5d7..076e985 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 _0x7a65=['request-promise','path','../../config/environment','./chatWebsite.attributes','define','ChatWebsite','chat_websites','../../config/logger','api','bluebird'];(function(_0xba7f89,_0x1191eb){var _0x171888=function(_0x1f9c9d){while(--_0x1f9c9d){_0xba7f89['push'](_0xba7f89['shift']());}};_0x171888(++_0x1191eb);}(_0x7a65,0xed));var _0x57a6=function(_0x25e875,_0x3a0383){_0x25e875=_0x25e875-0x0;var _0x324357=_0x7a65[_0x25e875];return _0x324357;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x57a6('0x0'))(_0x57a6('0x1'));var moment=require('moment');var BPromise=require(_0x57a6('0x2'));var rp=require(_0x57a6('0x3'));var fs=require('fs');var path=require(_0x57a6('0x4'));var rimraf=require('rimraf');var config=require(_0x57a6('0x5'));var attributes=require(_0x57a6('0x6'));module['exports']=function(_0x56e070,_0x2e1803){return _0x56e070[_0x57a6('0x7')](_0x57a6('0x8'),attributes,{'tableName':_0x57a6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f53=['request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','define','ChatWebsite','chat_websites','lodash','../../config/logger','api','moment','bluebird'];(function(_0x308f79,_0x121c42){var _0x71490e=function(_0x311a5f){while(--_0x311a5f){_0x308f79['push'](_0x308f79['shift']());}};_0x71490e(++_0x121c42);}(_0x3f53,0x119));var _0x33f5=function(_0x3d673d,_0x1c86d3){_0x3d673d=_0x3d673d-0x0;var _0xc8e009=_0x3f53[_0x3d673d];return _0xc8e009;};'use strict';var _=require(_0x33f5('0x0'));var util=require('util');var logger=require(_0x33f5('0x1'))(_0x33f5('0x2'));var moment=require(_0x33f5('0x3'));var BPromise=require(_0x33f5('0x4'));var rp=require(_0x33f5('0x5'));var fs=require('fs');var path=require(_0x33f5('0x6'));var rimraf=require(_0x33f5('0x7'));var config=require(_0x33f5('0x8'));var attributes=require(_0x33f5('0x9'));module['exports']=function(_0x597264,_0x2807f6){return _0x597264[_0x33f5('0xa')](_0x33f5('0xb'),attributes,{'tableName':_0x33f5('0xc'),'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 8131575..ed2497e 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 _0x33ff=['then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x33ff,0x192));var _0xf33f=function(_0x44216d,_0x4938a7){_0x44216d=_0x44216d-0x0;var _0xeca523=_0x33ff[_0x44216d];return _0xeca523;};'use strict';var _=require(_0xf33f('0x0'));var util=require(_0xf33f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf33f('0x2'));var fs=require('fs');var Redis=require(_0xf33f('0x3'));var db=require(_0xf33f('0x4'))['db'];var utils=require(_0xf33f('0x5'));var logger=require(_0xf33f('0x6'))(_0xf33f('0x7'));var config=require(_0xf33f('0x8'));var jayson=require(_0xf33f('0x9'));var client=jayson[_0xf33f('0xa')][_0xf33f('0xb')]({'port':0x232a});config[_0xf33f('0xc')]=_[_0xf33f('0xd')](config[_0xf33f('0xc')],{'host':_0xf33f('0xe'),'port':0x18eb});var socket=require(_0xf33f('0xf'))(new Redis(config[_0xf33f('0xc')]));require(_0xf33f('0x10'))[_0xf33f('0x11')](socket);function respondWithRpcPromise(_0x26801a,_0x395922,_0x2b91f0){return new BPromise(function(_0x182146,_0x802b34){return client['request'](_0x26801a,_0x2b91f0)[_0xf33f('0x12')](function(_0x459b48){logger[_0xf33f('0x13')](_0xf33f('0x14'),_0x395922,_0xf33f('0x15'));logger['debug'](_0xf33f('0x16'),_0x395922,_0xf33f('0x15'),JSON[_0xf33f('0x17')](_0x459b48));if(_0x459b48[_0xf33f('0x18')]){if(_0x459b48[_0xf33f('0x18')]['code']===0x1f4){logger['error'](_0xf33f('0x14'),_0x395922,_0x459b48[_0xf33f('0x18')]['message']);return _0x802b34(_0x459b48[_0xf33f('0x18')]['message']);}logger[_0xf33f('0x18')](_0xf33f('0x14'),_0x395922,_0x459b48[_0xf33f('0x18')][_0xf33f('0x19')]);return _0x182146(_0x459b48['error'][_0xf33f('0x19')]);}else{logger[_0xf33f('0x13')](_0xf33f('0x14'),_0x395922,'request\x20sent');_0x182146(_0x459b48[_0xf33f('0x1a')]['message']);}})[_0xf33f('0x1b')](function(_0x325571){logger[_0xf33f('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x395922,_0x325571);_0x802b34(_0x325571);});});} \ No newline at end of file +var _0xe936=['localhost','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults'];(function(_0x559115,_0x4874fe){var _0x1a45d2=function(_0x144387){while(--_0x144387){_0x559115['push'](_0x559115['shift']());}};_0x1a45d2(++_0x4874fe);}(_0xe936,0x90));var _0x6e93=function(_0x2bbe51,_0x58c3df){_0x2bbe51=_0x2bbe51-0x0;var _0xaf3f42=_0xe936[_0x2bbe51];return _0xaf3f42;};'use strict';var _=require(_0x6e93('0x0'));var util=require(_0x6e93('0x1'));var moment=require(_0x6e93('0x2'));var BPromise=require(_0x6e93('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e93('0x4'));var db=require(_0x6e93('0x5'))['db'];var utils=require(_0x6e93('0x6'));var logger=require(_0x6e93('0x7'))(_0x6e93('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6e93('0x9')]['http']({'port':0x232a});config[_0x6e93('0xa')]=_[_0x6e93('0xb')](config[_0x6e93('0xa')],{'host':_0x6e93('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6e93('0xa')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x5ed711,_0x2ecf7b,_0x1da406){return new BPromise(function(_0x11d220,_0x52c515){return client[_0x6e93('0xd')](_0x5ed711,_0x1da406)[_0x6e93('0xe')](function(_0x16fa43){logger['info'](_0x6e93('0xf'),_0x2ecf7b,_0x6e93('0x10'));logger[_0x6e93('0x11')](_0x6e93('0x12'),_0x2ecf7b,_0x6e93('0x10'),JSON[_0x6e93('0x13')](_0x16fa43));if(_0x16fa43['error']){if(_0x16fa43['error'][_0x6e93('0x14')]===0x1f4){logger[_0x6e93('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x2ecf7b,_0x16fa43['error'][_0x6e93('0x16')]);return _0x52c515(_0x16fa43['error'][_0x6e93('0x16')]);}logger['error'](_0x6e93('0xf'),_0x2ecf7b,_0x16fa43[_0x6e93('0x15')]['message']);return _0x11d220(_0x16fa43['error']['message']);}else{logger[_0x6e93('0x17')](_0x6e93('0xf'),_0x2ecf7b,_0x6e93('0x10'));_0x11d220(_0x16fa43[_0x6e93('0x18')]['message']);}})[_0x6e93('0x19')](function(_0x4a4269){logger['error'](_0x6e93('0xf'),_0x2ecf7b,_0x4a4269);_0x52c515(_0x4a4269);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index f50bb10..c578476 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 _0x8e2e=['length','./chatWebsite.events','save','remove','emit','removeListener','register'];(function(_0x41ecb2,_0x306e02){var _0x1137d9=function(_0x4be3ef){while(--_0x4be3ef){_0x41ecb2['push'](_0x41ecb2['shift']());}};_0x1137d9(++_0x306e02);}(_0x8e2e,0x1e4));var _0xe8e2=function(_0x452bed,_0x128e55){_0x452bed=_0x452bed-0x0;var _0x4bb2cf=_0x8e2e[_0x452bed];return _0x4bb2cf;};'use strict';var ChatWebsiteEvents=require(_0xe8e2('0x0'));var events=[_0xe8e2('0x1'),_0xe8e2('0x2'),'update'];function createListener(_0x5e12ed,_0x62fcb1){return function(_0x54ed6e){_0x62fcb1[_0xe8e2('0x3')](_0x5e12ed,_0x54ed6e);};}function removeListener(_0x5d171c,_0x5efc01){return function(){ChatWebsiteEvents[_0xe8e2('0x4')](_0x5d171c,_0x5efc01);};}exports[_0xe8e2('0x5')]=function(_0x519032){for(var _0x17449c=0x0,_0x450aa8=events[_0xe8e2('0x6')];_0x17449c<_0x450aa8;_0x17449c++){var _0x2ee1ea=events[_0x17449c];var _0x59a023=createListener('chatWebsite:'+_0x2ee1ea,_0x519032);ChatWebsiteEvents['on'](_0x2ee1ea,_0x59a023);}}; \ No newline at end of file +var _0x8560=['save','remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events'];(function(_0x2e42d4,_0x1a5d96){var _0x29d477=function(_0x43b9b5){while(--_0x43b9b5){_0x2e42d4['push'](_0x2e42d4['shift']());}};_0x29d477(++_0x1a5d96);}(_0x8560,0xb3));var _0x0856=function(_0x158f01,_0x12af3e){_0x158f01=_0x158f01-0x0;var _0x5ef74e=_0x8560[_0x158f01];return _0x5ef74e;};'use strict';var ChatWebsiteEvents=require(_0x0856('0x0'));var events=[_0x0856('0x1'),_0x0856('0x2'),_0x0856('0x3')];function createListener(_0x2d6d5f,_0x37e9f2){return function(_0x31eddd){_0x37e9f2[_0x0856('0x4')](_0x2d6d5f,_0x31eddd);};}function removeListener(_0x5e0656,_0x147add){return function(){ChatWebsiteEvents[_0x0856('0x5')](_0x5e0656,_0x147add);};}exports[_0x0856('0x6')]=function(_0x3ef2e6){for(var _0x8ef1df=0x0,_0x57c5ca=events[_0x0856('0x7')];_0x8ef1df<_0x57c5ca;_0x8ef1df++){var _0x14dfae=events[_0x8ef1df];var _0x426401=createListener(_0x0856('0x8')+_0x14dfae,_0x3ef2e6);ChatWebsiteEvents['on'](_0x14dfae,_0x426401);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 0061d9e..74b2f91 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 _0xe269=['/:id/dispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition','/:id/canned_answers','addAnswer','join','root','format','now','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','%s-%s','/:id/customer_avatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','offline','addInteraction','addApplications','addProactiveActions','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0xe269,0x1f1));var _0x9e26=function(_0x14f2e5,_0x33847b){_0x14f2e5=_0x14f2e5-0x0;var _0x568b87=_0xe269[_0x14f2e5];return _0x568b87;};'use strict';var multer=require(_0x9e26('0x0'));var util=require(_0x9e26('0x1'));var path=require('path');var timeout=require(_0x9e26('0x2'));var express=require(_0x9e26('0x3'));var router=express[_0x9e26('0x4')]();var fs_extra=require(_0x9e26('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9e26('0x6'));var config=require(_0x9e26('0x7'));var controller=require('./chatWebsite.controller');router[_0x9e26('0x8')]('/',auth[_0x9e26('0x9')](),controller[_0x9e26('0xa')]);router[_0x9e26('0x8')]('/describe',auth[_0x9e26('0x9')](),controller[_0x9e26('0xb')]);router['get'](_0x9e26('0xc'),auth['isAuthenticated'](),controller[_0x9e26('0xd')]);router['get'](_0x9e26('0xe'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x9e26('0x8')]('/:id/canned_answers',auth[_0x9e26('0x9')](),controller[_0x9e26('0xf')]);router[_0x9e26('0x8')](_0x9e26('0x10'),controller[_0x9e26('0x11')]);router['get'](_0x9e26('0x12'),controller[_0x9e26('0x13')]);router[_0x9e26('0x8')]('/:id/customer_avatar',controller[_0x9e26('0x14')]);router[_0x9e26('0x8')](_0x9e26('0x15'),controller['getSystemAvatar']);router[_0x9e26('0x8')](_0x9e26('0x16'),auth[_0x9e26('0x9')](),controller[_0x9e26('0x17')]);router[_0x9e26('0x8')](_0x9e26('0x18'),controller[_0x9e26('0x19')]);router[_0x9e26('0x8')](_0x9e26('0x1a'),auth[_0x9e26('0x9')](),controller[_0x9e26('0x1b')]);router['get'](_0x9e26('0x1c'),auth[_0x9e26('0x9')](),controller['getProactiveActions']);router[_0x9e26('0x8')](_0x9e26('0x1d'),controller[_0x9e26('0x1e')]);router[_0x9e26('0x8')](_0x9e26('0x1f'),auth[_0x9e26('0x9')](),controller[_0x9e26('0x20')]);router[_0x9e26('0x8')](_0x9e26('0x21'),auth[_0x9e26('0x9')](),controller[_0x9e26('0x22')]);router['post']('/',auth[_0x9e26('0x9')](),controller[_0x9e26('0x23')]);router[_0x9e26('0x24')](_0x9e26('0xe'),auth[_0x9e26('0x9')](),controller[_0x9e26('0x25')]);router[_0x9e26('0x24')](_0x9e26('0x26'),auth[_0x9e26('0x9')](),controller[_0x9e26('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3daf0d,_0x5e3e5f,_0x43f888){_0x43f888(null,path[_0x9e26('0x28')](config[_0x9e26('0x29')],'server/files/images/logos/'));},'filename':function(_0x2bb743,_0x279e54,_0xb90583){_0xb90583(null,util[_0x9e26('0x2a')]('%s-%s',Date[_0x9e26('0x2b')](),_0x279e54[_0x9e26('0x2c')]));}})});router[_0x9e26('0x24')](_0x9e26('0x10'),upload[_0x9e26('0x2d')](_0x9e26('0x2e')),controller[_0x9e26('0x2f')]);var upload=multer({'storage':multer[_0x9e26('0x30')]({'destination':function(_0x49c56f,_0x5e55b3,_0x44adb0){_0x44adb0(null,path['join'](config[_0x9e26('0x29')],_0x9e26('0x31')));},'filename':function(_0x4522f0,_0xa46be7,_0x26b99f){_0x26b99f(null,util[_0x9e26('0x2a')]('%s-%s',Date[_0x9e26('0x2b')](),_0xa46be7[_0x9e26('0x2c')]));}})});router['post']('/:id/avatar',upload[_0x9e26('0x2d')](_0x9e26('0x2e')),controller['addAvatar']);var upload=multer({'storage':multer[_0x9e26('0x30')]({'destination':function(_0x29a9e7,_0x2a896d,_0x1e446f){_0x1e446f(null,path[_0x9e26('0x28')](config[_0x9e26('0x29')],'server/files/images/avatars/'));},'filename':function(_0x118e25,_0x3e7a31,_0x3ae8c9){_0x3ae8c9(null,util[_0x9e26('0x2a')](_0x9e26('0x32'),Date['now'](),_0x3e7a31[_0x9e26('0x2c')]));}})});router[_0x9e26('0x24')](_0x9e26('0x33'),upload[_0x9e26('0x2d')](_0x9e26('0x2e')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x9e26('0x30')]({'destination':function(_0x49f608,_0x1deb94,_0x396ad7){_0x396ad7(null,path['join'](config[_0x9e26('0x29')],_0x9e26('0x31')));},'filename':function(_0x3897e2,_0x7bd3d4,_0x59657e){_0x59657e(null,util[_0x9e26('0x2a')]('%s-%s',Date['now'](),_0x7bd3d4['originalname']));}})});router[_0x9e26('0x24')](_0x9e26('0x15'),upload[_0x9e26('0x2d')](_0x9e26('0x2e')),controller[_0x9e26('0x34')]);router['post'](_0x9e26('0x35'),controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x53c286,_0x39c096,_0x3e8ce2){const _0x169418=path[_0x9e26('0x28')](config[_0x9e26('0x29')],_0x9e26('0x36'),_0x9e26('0x37'),_0x9e26('0x38'));fs_extra[_0x9e26('0x39')](_0x169418,function(){_0x3e8ce2(null,_0x169418);});},'filename':function(_0x300101,_0x3887fd,_0x4b12c2){const _0x3ef4bd=_0x3887fd['originalname'][_0x9e26('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x50f0c5=path[_0x9e26('0x3b')](_0x3ef4bd);const _0x34a5b9=Date[_0x9e26('0x2b')]()+'-'+_0x3ef4bd['replace'](_0x50f0c5,'')+_0x50f0c5;_0x4b12c2(null,_0x34a5b9);}})});router[_0x9e26('0x24')](_0x9e26('0x3c'),offlineUploadMulter['any'](),controller[_0x9e26('0x3d')]);router[_0x9e26('0x24')]('/:id/interactions',auth[_0x9e26('0x9')](),controller[_0x9e26('0x3e')]);router[_0x9e26('0x24')](_0x9e26('0x1a'),auth[_0x9e26('0x9')](),controller[_0x9e26('0x3f')]);router[_0x9e26('0x24')](_0x9e26('0x1c'),auth[_0x9e26('0x9')](),controller[_0x9e26('0x40')]);router[_0x9e26('0x24')](_0x9e26('0x21'),auth[_0x9e26('0x9')](),controller['addAgents']);router[_0x9e26('0x41')]('/:id',auth['isAuthenticated'](),controller[_0x9e26('0x42')]);router[_0x9e26('0x43')](_0x9e26('0xc'),auth[_0x9e26('0x9')](),controller[_0x9e26('0x44')]);router[_0x9e26('0x43')](_0x9e26('0xe'),auth[_0x9e26('0x9')](),controller[_0x9e26('0x45')]);router[_0x9e26('0x43')](_0x9e26('0x26'),auth['isAuthenticated'](),controller[_0x9e26('0x46')]);router['delete'](_0x9e26('0x21'),auth[_0x9e26('0x9')](),controller[_0x9e26('0x47')]);module[_0x9e26('0x48')]=router; \ No newline at end of file +var _0xea0e=['single','addCustomerAvatar','/:id/notify','notify','server/files','offline-chat','replace','extname','/:id/offline','offline','/:id/applications','addProactiveActions','addAgents','put','update','delete','removeDispositions','removeAnswers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents','post','create','addAnswer','join','root','server/files/images/logos/','format','%s-%s','now','file','addLogo','server/files/images/avatars/','originalname','addAvatar','diskStorage'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xea0e,0xee));var _0xeea0=function(_0x41b385,_0x4a8262){_0x41b385=_0x41b385-0x0;var _0x27c6ea=_0xea0e[_0x41b385];return _0x27c6ea;};'use strict';var multer=require('multer');var util=require(_0xeea0('0x0'));var path=require(_0xeea0('0x1'));var timeout=require(_0xeea0('0x2'));var express=require(_0xeea0('0x3'));var router=express[_0xeea0('0x4')]();var fs_extra=require(_0xeea0('0x5'));var auth=require(_0xeea0('0x6'));var interaction=require(_0xeea0('0x7'));var config=require(_0xeea0('0x8'));var controller=require(_0xeea0('0x9'));router[_0xeea0('0xa')]('/',auth[_0xeea0('0xb')](),controller[_0xeea0('0xc')]);router[_0xeea0('0xa')](_0xeea0('0xd'),auth[_0xeea0('0xb')](),controller[_0xeea0('0xe')]);router['get'](_0xeea0('0xf'),auth[_0xeea0('0xb')](),controller[_0xeea0('0x10')]);router['get'](_0xeea0('0x11'),auth[_0xeea0('0xb')](),controller[_0xeea0('0x12')]);router[_0xeea0('0xa')](_0xeea0('0x13'),auth[_0xeea0('0xb')](),controller[_0xeea0('0x14')]);router[_0xeea0('0xa')](_0xeea0('0x15'),controller[_0xeea0('0x16')]);router[_0xeea0('0xa')](_0xeea0('0x17'),controller[_0xeea0('0x18')]);router[_0xeea0('0xa')](_0xeea0('0x19'),controller[_0xeea0('0x1a')]);router[_0xeea0('0xa')](_0xeea0('0x1b'),controller['getSystemAvatar']);router[_0xeea0('0xa')](_0xeea0('0x1c'),auth[_0xeea0('0xb')](),controller[_0xeea0('0x1d')]);router[_0xeea0('0xa')]('/:id/snippet',controller[_0xeea0('0x1e')]);router[_0xeea0('0xa')]('/:id/applications',auth[_0xeea0('0xb')](),controller[_0xeea0('0x1f')]);router[_0xeea0('0xa')](_0xeea0('0x20'),auth[_0xeea0('0xb')](),controller[_0xeea0('0x21')]);router['get'](_0xeea0('0x22'),controller[_0xeea0('0x23')]);router[_0xeea0('0xa')](_0xeea0('0x24'),auth[_0xeea0('0xb')](),controller['getOfflineMessages']);router[_0xeea0('0xa')](_0xeea0('0x25'),auth['isAuthenticated'](),controller[_0xeea0('0x26')]);router[_0xeea0('0x27')]('/',auth[_0xeea0('0xb')](),controller[_0xeea0('0x28')]);router[_0xeea0('0x27')](_0xeea0('0x11'),auth[_0xeea0('0xb')](),controller['addDisposition']);router[_0xeea0('0x27')]('/:id/canned_answers',auth[_0xeea0('0xb')](),controller[_0xeea0('0x29')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x46723e,_0x14c06e,_0x126c28){_0x126c28(null,path[_0xeea0('0x2a')](config[_0xeea0('0x2b')],_0xeea0('0x2c')));},'filename':function(_0x131a9c,_0x533adb,_0x1346b4){_0x1346b4(null,util[_0xeea0('0x2d')](_0xeea0('0x2e'),Date[_0xeea0('0x2f')](),_0x533adb['originalname']));}})});router[_0xeea0('0x27')]('/:id/logo',upload['single'](_0xeea0('0x30')),controller[_0xeea0('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x48f8c4,_0x84e592,_0x5f2001){_0x5f2001(null,path[_0xeea0('0x2a')](config[_0xeea0('0x2b')],_0xeea0('0x32')));},'filename':function(_0x2e4a2a,_0x1ab996,_0x9fb730){_0x9fb730(null,util[_0xeea0('0x2d')](_0xeea0('0x2e'),Date[_0xeea0('0x2f')](),_0x1ab996[_0xeea0('0x33')]));}})});router[_0xeea0('0x27')](_0xeea0('0x17'),upload['single'](_0xeea0('0x30')),controller[_0xeea0('0x34')]);var upload=multer({'storage':multer[_0xeea0('0x35')]({'destination':function(_0x4aee2d,_0x563f91,_0x5e5539){_0x5e5539(null,path[_0xeea0('0x2a')](config['root'],_0xeea0('0x32')));},'filename':function(_0x20e9e9,_0x350690,_0x41da3f){_0x41da3f(null,util[_0xeea0('0x2d')](_0xeea0('0x2e'),Date[_0xeea0('0x2f')](),_0x350690[_0xeea0('0x33')]));}})});router[_0xeea0('0x27')](_0xeea0('0x19'),upload[_0xeea0('0x36')]('file'),controller[_0xeea0('0x37')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3ec81d,_0x340b82,_0x5bc3f9){_0x5bc3f9(null,path[_0xeea0('0x2a')](config[_0xeea0('0x2b')],_0xeea0('0x32')));},'filename':function(_0x1f50ec,_0x3c8f56,_0x449918){_0x449918(null,util[_0xeea0('0x2d')]('%s-%s',Date['now'](),_0x3c8f56['originalname']));}})});router[_0xeea0('0x27')](_0xeea0('0x1b'),upload[_0xeea0('0x36')](_0xeea0('0x30')),controller['addSystemAvatar']);router[_0xeea0('0x27')](_0xeea0('0x38'),controller[_0xeea0('0x39')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x2db83c,_0xa98141,_0x5e6c48){const _0x267561=path['join'](config[_0xeea0('0x2b')],_0xeea0('0x3a'),'attachments',_0xeea0('0x3b'));fs_extra['ensureDir'](_0x267561,function(){_0x5e6c48(null,_0x267561);});},'filename':function(_0x4a3128,_0x2188d8,_0x132a93){const _0x18254e=_0x2188d8['originalname'][_0xeea0('0x3c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xfc5fb7=path[_0xeea0('0x3d')](_0x18254e);const _0x3a94fc=Date[_0xeea0('0x2f')]()+'-'+_0x18254e[_0xeea0('0x3c')](_0xfc5fb7,'')+_0xfc5fb7;_0x132a93(null,_0x3a94fc);}})});router['post'](_0xeea0('0x3e'),offlineUploadMulter['any'](),controller[_0xeea0('0x3f')]);router[_0xeea0('0x27')]('/:id/interactions',auth[_0xeea0('0xb')](),controller['addInteraction']);router[_0xeea0('0x27')](_0xeea0('0x40'),auth['isAuthenticated'](),controller['addApplications']);router[_0xeea0('0x27')](_0xeea0('0x20'),auth[_0xeea0('0xb')](),controller[_0xeea0('0x41')]);router[_0xeea0('0x27')](_0xeea0('0x25'),auth[_0xeea0('0xb')](),controller[_0xeea0('0x42')]);router[_0xeea0('0x43')](_0xeea0('0xf'),auth[_0xeea0('0xb')](),controller[_0xeea0('0x44')]);router[_0xeea0('0x45')]('/:id',auth[_0xeea0('0xb')](),controller['destroy']);router['delete'](_0xeea0('0x11'),auth[_0xeea0('0xb')](),controller[_0xeea0('0x46')]);router[_0xeea0('0x45')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xeea0('0x47')]);router['delete']('/:id/users',auth[_0xeea0('0xb')](),controller['removeAgents']);module[_0xeea0('0x48')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 406dd06..328730c 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 _0x5a43=['Google','sequelize','exports','STRING','ENUM','AmazonAWS'];(function(_0x318602,_0x28d810){var _0x447750=function(_0x4fcb95){while(--_0x4fcb95){_0x318602['push'](_0x318602['shift']());}};_0x447750(++_0x28d810);}(_0x5a43,0xf1));var _0x35a4=function(_0x25f281,_0xc970ef){_0x25f281=_0x25f281-0x0;var _0x31483f=_0x5a43[_0x25f281];return _0x31483f;};'use strict';var Sequelize=require(_0x35a4('0x0'));module[_0x35a4('0x1')]={'name':{'type':Sequelize[_0x35a4('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x35a4('0x3')](_0x35a4('0x4'),_0x35a4('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x35a4('0x2')]},'data2':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9d76=['ENUM','AmazonAWS','Google','sequelize','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9d76,0x76));var _0x69d7=function(_0x501246,_0xafe184){_0x501246=_0x501246-0x0;var _0xe28cea=_0x9d76[_0x501246];return _0xe28cea;};'use strict';var Sequelize=require(_0x69d7('0x0'));module['exports']={'name':{'type':Sequelize[_0x69d7('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x69d7('0x2')](_0x69d7('0x3'),_0x69d7('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x69d7('0x1')]},'data2':{'type':Sequelize[_0x69d7('0x1')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 7026555..327d152 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 _0xdb28=['error','stack','name','send','index','CloudProvider','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','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'];(function(_0x3425ec,_0x154bcb){var _0x4d8fdf=function(_0x390855){while(--_0x390855){_0x3425ec['push'](_0x3425ec['shift']());}};_0x4d8fdf(++_0x154bcb);}(_0xdb28,0x106));var _0x8db2=function(_0x59f788,_0x311bc4){_0x59f788=_0x59f788-0x0;var _0x3375c2=_0xdb28[_0x59f788];return _0x3375c2;};'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));}; \ No newline at end of file +var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x35c50,_0x2cfa35){var _0x2720a8=function(_0x45f3b6){while(--_0x45f3b6){_0x35c50['push'](_0x35c50['shift']());}};_0x2720a8(++_0x2cfa35);}(_0x7a54,0x106));var _0x47a5=function(_0x4928bd,_0x1a57fb){_0x4928bd=_0x4928bd-0x0;var _0x26fdc3=_0x7a54[_0x4928bd];return _0x26fdc3;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['CloudProvider'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['CloudProvider']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['CloudProvider']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 97efc6e..c2e02a5 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 _0x6a72=['rimraf','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1c461e,_0x1b98ff){var _0x1dce4f=function(_0x5cbdf0){while(--_0x5cbdf0){_0x1c461e['push'](_0x1c461e['shift']());}};_0x1dce4f(++_0x1b98ff);}(_0x6a72,0x165));var _0x26a7=function(_0x55a41c,_0x2ced02){_0x55a41c=_0x55a41c-0x0;var _0x278b73=_0x6a72[_0x55a41c];return _0x278b73;};'use strict';var _=require('lodash');var util=require(_0x26a7('0x0'));var logger=require(_0x26a7('0x1'))(_0x26a7('0x2'));var moment=require(_0x26a7('0x3'));var BPromise=require(_0x26a7('0x4'));var rp=require(_0x26a7('0x5'));var fs=require('fs');var path=require(_0x26a7('0x6'));var rimraf=require(_0x26a7('0x7'));var config=require('../../config/environment');var attributes=require(_0x26a7('0x8'));module[_0x26a7('0x9')]=function(_0x4af5d2,_0x42a211){return _0x4af5d2[_0x26a7('0xa')](_0x26a7('0xb'),attributes,{'tableName':_0x26a7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70d1=['lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','CloudProvider'];(function(_0x226f2a,_0x3f17b5){var _0x3ec31d=function(_0x5b3993){while(--_0x5b3993){_0x226f2a['push'](_0x226f2a['shift']());}};_0x3ec31d(++_0x3f17b5);}(_0x70d1,0x14a));var _0x170d=function(_0x3fc5d8,_0x3eb153){_0x3fc5d8=_0x3fc5d8-0x0;var _0x25307a=_0x70d1[_0x3fc5d8];return _0x25307a;};'use strict';var _=require(_0x170d('0x0'));var util=require(_0x170d('0x1'));var logger=require('../../config/logger')(_0x170d('0x2'));var moment=require(_0x170d('0x3'));var BPromise=require('bluebird');var rp=require(_0x170d('0x4'));var fs=require('fs');var path=require(_0x170d('0x5'));var rimraf=require(_0x170d('0x6'));var config=require(_0x170d('0x7'));var attributes=require(_0x170d('0x8'));module[_0x170d('0x9')]=function(_0x9a642f,_0x5ade19){return _0x9a642f['define'](_0x170d('0xa'),attributes,{'tableName':'cloud_providers','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 d905f8b..b91f011 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 _0xc00b=['error','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20f2c9,_0x378e9b){var _0xc56eb4=function(_0x402555){while(--_0x402555){_0x20f2c9['push'](_0x20f2c9['shift']());}};_0xc56eb4(++_0x378e9b);}(_0xc00b,0x1e5));var _0xbc00=function(_0x59c86e,_0x38ce57){_0x59c86e=_0x59c86e-0x0;var _0x48a50e=_0xc00b[_0x59c86e];return _0x48a50e;};'use strict';var _=require(_0xbc00('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbc00('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbc00('0x2'))['db'];var utils=require(_0xbc00('0x3'));var logger=require(_0xbc00('0x4'))(_0xbc00('0x5'));var config=require('../../config/environment');var jayson=require(_0xbc00('0x6'));var client=jayson['client'][_0xbc00('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5362c6,_0x378982,_0x3a4edb){return new BPromise(function(_0x284270,_0x221909){return client[_0xbc00('0x8')](_0x5362c6,_0x3a4edb)[_0xbc00('0x9')](function(_0x51a669){logger[_0xbc00('0xa')]('CloudProvider,\x20%s,\x20%s',_0x378982,_0xbc00('0xb'));logger[_0xbc00('0xc')](_0xbc00('0xd'),_0x378982,'request\x20sent',JSON[_0xbc00('0xe')](_0x51a669));if(_0x51a669['error']){if(_0x51a669[_0xbc00('0xf')]['code']===0x1f4){logger[_0xbc00('0xf')](_0xbc00('0x10'),_0x378982,_0x51a669[_0xbc00('0xf')]['message']);return _0x221909(_0x51a669[_0xbc00('0xf')][_0xbc00('0x11')]);}logger[_0xbc00('0xf')]('CloudProvider,\x20%s,\x20%s',_0x378982,_0x51a669[_0xbc00('0xf')][_0xbc00('0x11')]);return _0x284270(_0x51a669['error'][_0xbc00('0x11')]);}else{logger[_0xbc00('0xa')](_0xbc00('0x10'),_0x378982,_0xbc00('0xb'));_0x284270(_0x51a669[_0xbc00('0x12')][_0xbc00('0x11')]);}})[_0xbc00('0x13')](function(_0x544764){logger['error']('CloudProvider,\x20%s,\x20%s',_0x378982,_0x544764);_0x221909(_0x544764);});});} \ No newline at end of file +var _0x4910=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x51bd84,_0x33f69e){var _0x4a63d1=function(_0x5d6b36){while(--_0x5d6b36){_0x51bd84['push'](_0x51bd84['shift']());}};_0x4a63d1(++_0x33f69e);}(_0x4910,0x1d9));var _0x0491=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4910[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0491('0x0'));var util=require(_0x0491('0x1'));var moment=require(_0x0491('0x2'));var BPromise=require('bluebird');var rs=require(_0x0491('0x3'));var fs=require('fs');var Redis=require(_0x0491('0x4'));var db=require(_0x0491('0x5'))['db'];var utils=require(_0x0491('0x6'));var logger=require(_0x0491('0x7'))('rpc');var config=require(_0x0491('0x8'));var jayson=require(_0x0491('0x9'));var client=jayson[_0x0491('0xa')][_0x0491('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27e7d5,_0x4ba9e5,_0x3b7b10){return new BPromise(function(_0x29c0d0,_0xf50a53){return client[_0x0491('0xc')](_0x27e7d5,_0x3b7b10)[_0x0491('0xd')](function(_0x4822d5){logger[_0x0491('0xe')]('CloudProvider,\x20%s,\x20%s',_0x4ba9e5,_0x0491('0xf'));logger[_0x0491('0x10')](_0x0491('0x11'),_0x4ba9e5,_0x0491('0xf'),JSON[_0x0491('0x12')](_0x4822d5));if(_0x4822d5[_0x0491('0x13')]){if(_0x4822d5[_0x0491('0x13')][_0x0491('0x14')]===0x1f4){logger[_0x0491('0x13')](_0x0491('0x15'),_0x4ba9e5,_0x4822d5['error'][_0x0491('0x16')]);return _0xf50a53(_0x4822d5['error'][_0x0491('0x16')]);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x4ba9e5,_0x4822d5[_0x0491('0x13')][_0x0491('0x16')]);return _0x29c0d0(_0x4822d5[_0x0491('0x13')][_0x0491('0x16')]);}else{logger[_0x0491('0xe')](_0x0491('0x15'),_0x4ba9e5,_0x0491('0xf'));_0x29c0d0(_0x4822d5[_0x0491('0x17')][_0x0491('0x16')]);}})[_0x0491('0x18')](function(_0x527415){logger[_0x0491('0x13')](_0x0491('0x15'),_0x4ba9e5,_0x527415);_0xf50a53(_0x527415);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 771b125..f567a95 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 _0x5184=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','isAuthenticated','index','get','post','create','put','/:id','update','destroy','exports'];(function(_0x4c9ad2,_0x3bb687){var _0x507886=function(_0x3dd28d){while(--_0x3dd28d){_0x4c9ad2['push'](_0x4c9ad2['shift']());}};_0x507886(++_0x3bb687);}(_0x5184,0x1b5));var _0x4518=function(_0x10afab,_0x272ea4){_0x10afab=_0x10afab-0x0;var _0x548d8d=_0x5184[_0x10afab];return _0x548d8d;};'use strict';var multer=require('multer');var util=require(_0x4518('0x0'));var path=require('path');var timeout=require(_0x4518('0x1'));var express=require(_0x4518('0x2'));var router=express[_0x4518('0x3')]();var fs_extra=require(_0x4518('0x4'));var auth=require(_0x4518('0x5'));var interaction=require(_0x4518('0x6'));var config=require(_0x4518('0x7'));var controller=require(_0x4518('0x8'));router['get']('/',auth[_0x4518('0x9')](),controller[_0x4518('0xa')]);router[_0x4518('0xb')]('/:id',auth[_0x4518('0x9')](),controller['show']);router[_0x4518('0xc')]('/',auth[_0x4518('0x9')](),controller[_0x4518('0xd')]);router[_0x4518('0xe')](_0x4518('0xf'),auth[_0x4518('0x9')](),controller[_0x4518('0x10')]);router['delete'](_0x4518('0xf'),auth[_0x4518('0x9')](),controller[_0x4518('0x11')]);module[_0x4518('0x12')]=router; \ No newline at end of file +var _0x2d85=['fs-extra','../../components/interaction/service','../../config/environment','index','get','/:id','post','put','isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x2d604b,_0x4f1748){var _0x504857=function(_0x3c4990){while(--_0x3c4990){_0x2d604b['push'](_0x2d604b['shift']());}};_0x504857(++_0x4f1748);}(_0x2d85,0xd8));var _0x52d8=function(_0xf4e429,_0x3c417a){_0xf4e429=_0xf4e429-0x0;var _0x22117a=_0x2d85[_0xf4e429];return _0x22117a;};'use strict';var multer=require(_0x52d8('0x0'));var util=require(_0x52d8('0x1'));var path=require(_0x52d8('0x2'));var timeout=require(_0x52d8('0x3'));var express=require(_0x52d8('0x4'));var router=express['Router']();var fs_extra=require(_0x52d8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x52d8('0x6'));var config=require(_0x52d8('0x7'));var controller=require('./cloudProvider.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x52d8('0x8')]);router[_0x52d8('0x9')](_0x52d8('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x52d8('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x52d8('0xc')](_0x52d8('0xa'),auth[_0x52d8('0xd')](),controller[_0x52d8('0xe')]);router['delete'](_0x52d8('0xa'),auth[_0x52d8('0xd')](),controller[_0x52d8('0xf')]);module[_0x52d8('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 8c07b9e..1301c48 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 _0xe29f=['exports','STRING','name','sequelize'];(function(_0x3ff64e,_0x4651ce){var _0x4c0ea3=function(_0x23f85d){while(--_0x23f85d){_0x3ff64e['push'](_0x3ff64e['shift']());}};_0x4c0ea3(++_0x4651ce);}(_0xe29f,0x1eb));var _0xfe29=function(_0x16fdeb,_0x46d28e){_0x16fdeb=_0x16fdeb-0x0;var _0x1ea06f=_0xe29f[_0x16fdeb];return _0x1ea06f;};'use strict';var Sequelize=require(_0xfe29('0x0'));module[_0xfe29('0x1')]={'name':{'type':Sequelize[_0xfe29('0x2')],'unique':_0xfe29('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xfe29('0x2')]},'companyId':{'type':Sequelize[_0xfe29('0x2')]},'website':{'type':Sequelize[_0xfe29('0x2')]},'phone':{'type':Sequelize[_0xfe29('0x2')]},'fax':{'type':Sequelize[_0xfe29('0x2')]},'type':{'type':Sequelize[_0xfe29('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xfe29('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xfe29('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xfe29('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xfe29('0x2')]},'sCountry':{'type':Sequelize[_0xfe29('0x2')]},'description':{'type':Sequelize[_0xfe29('0x2')]}}; \ No newline at end of file +var _0x6422=['exports','STRING','name','sequelize'];(function(_0x4600c2,_0x4ebf56){var _0x46064a=function(_0x42ac9d){while(--_0x42ac9d){_0x4600c2['push'](_0x4600c2['shift']());}};_0x46064a(++_0x4ebf56);}(_0x6422,0x163));var _0x2642=function(_0xd66600,_0x1ff0dd){_0xd66600=_0xd66600-0x0;var _0x2543e5=_0x6422[_0xd66600];return _0x2543e5;};'use strict';var Sequelize=require(_0x2642('0x0'));module[_0x2642('0x1')]={'name':{'type':Sequelize[_0x2642('0x2')],'unique':_0x2642('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x2642('0x2')]},'companyId':{'type':Sequelize[_0x2642('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x2642('0x2')]},'type':{'type':Sequelize[_0x2642('0x2')]},'street':{'type':Sequelize[_0x2642('0x2')]},'postalCode':{'type':Sequelize[_0x2642('0x2')]},'city':{'type':Sequelize[_0x2642('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x2642('0x2')]},'sPostalCode':{'type':Sequelize[_0x2642('0x2')]},'sCity':{'type':Sequelize[_0x2642('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index bb41786..08796db 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 _0x0b9d=['findAll','rows','catch','show','rawAttributes','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','addContacts','ids','omit','findOne','CmContact','order','sort','getContacts','hasOwnProperty','eml-format','rimraf','fast-json-patch','moment','path','sox','ejs','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','get','Companies','error','stack','name','send','index','CmCompany','describe','model','query','keys','intersection','fields','attributes','length','nolimit','where','filters','pick','filter','merge'];(function(_0x2cbfa0,_0x438886){var _0x160feb=function(_0x7b2562){while(--_0x7b2562){_0x2cbfa0['push'](_0x2cbfa0['shift']());}};_0x160feb(++_0x438886);}(_0x0b9d,0x73));var _0xd0b9=function(_0x11446f,_0x2499a5){_0x11446f=_0x11446f-0x0;var _0x217691=_0x0b9d[_0x11446f];return _0x217691;};'use strict';var emlformat=require(_0xd0b9('0x0'));var rimraf=require(_0xd0b9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd0b9('0x2'));var rp=require('request-promise');var moment=require(_0xd0b9('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd0b9('0x4'));var sox=require(_0xd0b9('0x5'));var csv=require('to-csv');var ejs=require(_0xd0b9('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd0b9('0x7'));var deskjs=require(_0xd0b9('0x8'));var toCsv=require(_0xd0b9('0x9'));var querystring=require(_0xd0b9('0xa'));var Papa=require(_0xd0b9('0xb'));var Redis=require('ioredis');var authService=require(_0xd0b9('0xc'));var qs=require(_0xd0b9('0xd'));var as=require(_0xd0b9('0xe'));var hardwareService=require(_0xd0b9('0xf'));var logger=require(_0xd0b9('0x10'))(_0xd0b9('0x11'));var utils=require(_0xd0b9('0x12'));var config=require(_0xd0b9('0x13'));var licenseUtil=require(_0xd0b9('0x14'));var db=require(_0xd0b9('0x15'))['db'];function respondWithStatusCode(_0xa9af92,_0x9c679a){_0x9c679a=_0x9c679a||0xcc;return function(_0x515050){if(_0x515050){return _0xa9af92[_0xd0b9('0x16')](_0x9c679a);}return _0xa9af92[_0xd0b9('0x17')](_0x9c679a)[_0xd0b9('0x18')]();};}function respondWithResult(_0x32cf13,_0x2c7164){_0x2c7164=_0x2c7164||0xc8;return function(_0xd52358){if(_0xd52358){return _0x32cf13[_0xd0b9('0x17')](_0x2c7164)[_0xd0b9('0x19')](_0xd52358);}};}function respondWithFilteredResult(_0x2e1ba8,_0x41c277){return function(_0xcbe7da){if(_0xcbe7da){var _0x235b0b=typeof _0x41c277[_0xd0b9('0x1a')]===_0xd0b9('0x1b')&&typeof _0x41c277[_0xd0b9('0x1c')]==='undefined';var _0x148102=_0xcbe7da[_0xd0b9('0x1d')];var _0x4bcd11=_0x235b0b?0x0:_0x41c277[_0xd0b9('0x1a')];var _0x5d3796=_0x235b0b?_0xcbe7da[_0xd0b9('0x1d')]:_0x41c277['offset']+_0x41c277[_0xd0b9('0x1c')];var _0x513566;if(_0x5d3796>=_0x148102){_0x5d3796=_0x148102;_0x513566=0xc8;}else{_0x513566=0xce;}_0x2e1ba8['status'](_0x513566);return _0x2e1ba8[_0xd0b9('0x1e')](_0xd0b9('0x1f'),_0x4bcd11+'-'+_0x5d3796+'/'+_0x148102)[_0xd0b9('0x19')](_0xcbe7da);}return null;};}function patchUpdates(_0x3644c0){return function(_0x3ce030){try{jsonpatch['apply'](_0x3ce030,_0x3644c0,!![]);}catch(_0x462977){return BPromise['reject'](_0x462977);}return _0x3ce030[_0xd0b9('0x20')]();};}function saveUpdates(_0x5e9a3b,_0x19737d){return function(_0x277c30){if(_0x277c30){return _0x277c30[_0xd0b9('0x21')](_0x5e9a3b)[_0xd0b9('0x22')](function(_0x1eb6bc){return _0x1eb6bc;});}return null;};}function removeEntity(_0x1db4bf,_0x392464){return function(_0x463835){if(_0x463835){return _0x463835['destroy']()[_0xd0b9('0x22')](function(){var _0x423733=_0x463835[_0xd0b9('0x23')]({'plain':!![]});var _0x477906=_0xd0b9('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x477906,'resourceId':_0x423733['id']}})[_0xd0b9('0x22')](function(){return _0x463835;});})['then'](function(){_0x1db4bf[_0xd0b9('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d138f,_0x3bf313){return function(_0x258bc7){if(!_0x258bc7){_0x1d138f[_0xd0b9('0x16')](0x194);}return _0x258bc7;};}function handleError(_0xd89605,_0x31e9ac){_0x31e9ac=_0x31e9ac||0x1f4;return function(_0x58795f){logger[_0xd0b9('0x25')](_0x58795f[_0xd0b9('0x26')]);if(_0x58795f['name']){delete _0x58795f[_0xd0b9('0x27')];}_0xd89605[_0xd0b9('0x17')](_0x31e9ac)[_0xd0b9('0x28')](_0x58795f);};}exports[_0xd0b9('0x29')]=function(_0x27ec0a,_0x1ee31d){var _0x41a2f3={},_0x4f76dc={},_0x30f8ee={'count':0x0,'rows':[]};return db[_0xd0b9('0x2a')][_0xd0b9('0x2b')]()[_0xd0b9('0x22')](function(_0x45fd3c){_0x4f76dc[_0xd0b9('0x2c')]=_['keys'](_0x45fd3c);_0x4f76dc[_0xd0b9('0x2d')]=_[_0xd0b9('0x2e')](_0x27ec0a[_0xd0b9('0x2d')]);_0x4f76dc['filters']=_['intersection'](_0x4f76dc[_0xd0b9('0x2c')],_0x4f76dc['query']);_0x41a2f3['attributes']=_[_0xd0b9('0x2f')](_0x4f76dc[_0xd0b9('0x2c')],qs[_0xd0b9('0x30')](_0x27ec0a[_0xd0b9('0x2d')][_0xd0b9('0x30')]));_0x41a2f3['attributes']=_0x41a2f3[_0xd0b9('0x31')][_0xd0b9('0x32')]?_0x41a2f3['attributes']:_0x4f76dc['model'];if(!_0x27ec0a[_0xd0b9('0x2d')]['hasOwnProperty'](_0xd0b9('0x33'))){_0x41a2f3[_0xd0b9('0x1c')]=qs[_0xd0b9('0x1c')](_0x27ec0a[_0xd0b9('0x2d')][_0xd0b9('0x1c')]);_0x41a2f3[_0xd0b9('0x1a')]=qs['offset'](_0x27ec0a[_0xd0b9('0x2d')][_0xd0b9('0x1a')]);}_0x41a2f3['order']=qs['sort'](_0x27ec0a[_0xd0b9('0x2d')]['sort']);_0x41a2f3[_0xd0b9('0x34')]=qs[_0xd0b9('0x35')](_[_0xd0b9('0x36')](_0x27ec0a[_0xd0b9('0x2d')],_0x4f76dc[_0xd0b9('0x35')]),_0x45fd3c);if(_0x27ec0a['query'][_0xd0b9('0x37')]){_0x41a2f3['where']=_[_0xd0b9('0x38')](_0x41a2f3[_0xd0b9('0x34')],{'$or':_['map'](_0x41a2f3[_0xd0b9('0x31')],function(_0x36af88){var _0x522f03={};_0x522f03[_0x36af88]={'$like':'%'+_0x27ec0a[_0xd0b9('0x2d')][_0xd0b9('0x37')]+'%'};return _0x522f03;})});}_0x41a2f3=_[_0xd0b9('0x38')]({},_0x41a2f3,_0x27ec0a['options']);var _0x42ea17={'where':_0x41a2f3['where']};return db[_0xd0b9('0x2a')][_0xd0b9('0x1d')](_0x42ea17)[_0xd0b9('0x22')](function(_0x32f660){_0x30f8ee[_0xd0b9('0x1d')]=_0x32f660;if(_0x27ec0a[_0xd0b9('0x2d')]['includeAll']){_0x41a2f3['include']=[{'all':!![]}];}return db['CmCompany'][_0xd0b9('0x39')](_0x41a2f3);})[_0xd0b9('0x22')](function(_0x269802){_0x30f8ee[_0xd0b9('0x3a')]=_0x269802;return _0x30f8ee;})[_0xd0b9('0x22')](respondWithFilteredResult(_0x1ee31d,_0x41a2f3))[_0xd0b9('0x3b')](handleError(_0x1ee31d,null));})['catch'](handleError(_0x1ee31d,null));};exports[_0xd0b9('0x3c')]=function(_0x1db28e,_0x5a3aca){var _0xb6ef3e={'raw':![],'where':{'id':_0x1db28e['params']['id']}},_0xe5b64b={};_0xe5b64b[_0xd0b9('0x2c')]=_[_0xd0b9('0x2e')](db[_0xd0b9('0x2a')][_0xd0b9('0x3d')]);_0xe5b64b[_0xd0b9('0x2d')]=_['keys'](_0x1db28e[_0xd0b9('0x2d')]);_0xe5b64b['filters']=_[_0xd0b9('0x2f')](_0xe5b64b[_0xd0b9('0x2c')],_0xe5b64b['query']);_0xb6ef3e[_0xd0b9('0x31')]=_[_0xd0b9('0x2f')](_0xe5b64b[_0xd0b9('0x2c')],qs[_0xd0b9('0x30')](_0x1db28e[_0xd0b9('0x2d')]['fields']));_0xb6ef3e[_0xd0b9('0x31')]=_0xb6ef3e[_0xd0b9('0x31')]['length']?_0xb6ef3e['attributes']:_0xe5b64b[_0xd0b9('0x2c')];if(_0x1db28e['query']['includeAll']){_0xb6ef3e[_0xd0b9('0x3e')]=[{'all':!![]}];}_0xb6ef3e=_['merge']({},_0xb6ef3e,_0x1db28e[_0xd0b9('0x3f')]);return db[_0xd0b9('0x2a')][_0xd0b9('0x40')](_0xb6ef3e)[_0xd0b9('0x22')](handleEntityNotFound(_0x5a3aca,null))[_0xd0b9('0x22')](respondWithResult(_0x5a3aca,null))[_0xd0b9('0x3b')](handleError(_0x5a3aca,null));};exports[_0xd0b9('0x41')]=function(_0x229903,_0x3bd25b){return db['CmCompany'][_0xd0b9('0x41')](_0x229903[_0xd0b9('0x42')],{})[_0xd0b9('0x22')](function(_0x1b8992){var _0x4dc3b1=_0x229903['user'][_0xd0b9('0x23')]({'plain':!![]});if(!_0x4dc3b1)throw new Error(_0xd0b9('0x43'));if(_0x4dc3b1[_0xd0b9('0x44')]===_0xd0b9('0x45')){var _0x591f18=_0x1b8992['get']({'plain':!![]});var _0x4bc5fb='Companies';return db[_0xd0b9('0x46')]['find']({'where':{'name':_0x4bc5fb,'userProfileId':_0x4dc3b1[_0xd0b9('0x47')]},'raw':!![]})[_0xd0b9('0x22')](function(_0x28751b){if(_0x28751b&&_0x28751b[_0xd0b9('0x48')]===0x0){return db[_0xd0b9('0x49')][_0xd0b9('0x41')]({'name':_0x591f18[_0xd0b9('0x27')],'resourceId':_0x591f18['id'],'type':_0x28751b[_0xd0b9('0x27')],'sectionId':_0x28751b['id']},{})[_0xd0b9('0x22')](function(){return _0x1b8992;});}else{return _0x1b8992;}})[_0xd0b9('0x3b')](function(_0xb74c81){logger[_0xd0b9('0x25')](_0xd0b9('0x4a'),_0xb74c81);throw _0xb74c81;});}return _0x1b8992;})[_0xd0b9('0x22')](respondWithResult(_0x3bd25b,0xc9))[_0xd0b9('0x3b')](handleError(_0x3bd25b,null));};exports['update']=function(_0x3832dd,_0x2c33c1){if(_0x3832dd['body']['id']){delete _0x3832dd['body']['id'];}return db['CmCompany'][_0xd0b9('0x40')]({'where':{'id':_0x3832dd[_0xd0b9('0x4b')]['id']}})[_0xd0b9('0x22')](handleEntityNotFound(_0x2c33c1,null))[_0xd0b9('0x22')](saveUpdates(_0x3832dd[_0xd0b9('0x42')],null))['then'](respondWithResult(_0x2c33c1,null))[_0xd0b9('0x3b')](handleError(_0x2c33c1,null));};exports[_0xd0b9('0x4c')]=function(_0x33418b,_0x30fb47){return db[_0xd0b9('0x2a')][_0xd0b9('0x40')]({'where':{'id':_0x33418b[_0xd0b9('0x4b')]['id']}})[_0xd0b9('0x22')](handleEntityNotFound(_0x30fb47,null))[_0xd0b9('0x22')](removeEntity(_0x30fb47,null))[_0xd0b9('0x3b')](handleError(_0x30fb47,null));};exports[_0xd0b9('0x2b')]=function(_0x4f84d3,_0x1e61b8){return db['CmCompany'][_0xd0b9('0x2b')]()['then'](respondWithResult(_0x1e61b8,null))[_0xd0b9('0x3b')](handleError(_0x1e61b8,null));};exports[_0xd0b9('0x4d')]=function(_0x449026,_0x524d05,_0x2e127f){return db['CmContact'][_0xd0b9('0x40')]({'where':{'id':_0x449026[_0xd0b9('0x4b')]['id']}})[_0xd0b9('0x22')](handleEntityNotFound(_0x524d05,null))[_0xd0b9('0x22')](function(_0x1bb223){if(_0x1bb223){return _0x1bb223[_0xd0b9('0x4d')](_0x449026[_0xd0b9('0x42')][_0xd0b9('0x4e')],_[_0xd0b9('0x4f')](_0x449026[_0xd0b9('0x42')],[_0xd0b9('0x4e'),'id'])||{});}})[_0xd0b9('0x22')](respondWithResult(_0x524d05,null))[_0xd0b9('0x3b')](handleError(_0x524d05,null));};exports['getContacts']=function(_0x50afe2,_0x49ed77,_0x3ee328){var _0x36f3c2={};var _0x1ebea1={};var _0x325a90;var _0x2d0eaa;return db['CmCompany'][_0xd0b9('0x50')]({'where':{'id':_0x50afe2[_0xd0b9('0x4b')]['id']}})[_0xd0b9('0x22')](handleEntityNotFound(_0x49ed77,null))[_0xd0b9('0x22')](function(_0x441b50){if(_0x441b50){_0x325a90=_0x441b50;_0x1ebea1[_0xd0b9('0x2c')]=_[_0xd0b9('0x2e')](db[_0xd0b9('0x51')][_0xd0b9('0x3d')]);_0x1ebea1['query']=_[_0xd0b9('0x2e')](_0x50afe2['query']);_0x1ebea1['filters']=_[_0xd0b9('0x2f')](_0x1ebea1[_0xd0b9('0x2c')],_0x1ebea1['query']);_0x36f3c2['attributes']=_[_0xd0b9('0x2f')](_0x1ebea1['model'],qs[_0xd0b9('0x30')](_0x50afe2['query'][_0xd0b9('0x30')]));_0x36f3c2[_0xd0b9('0x31')]=_0x36f3c2['attributes'][_0xd0b9('0x32')]?_0x36f3c2['attributes']:_0x1ebea1[_0xd0b9('0x2c')];_0x36f3c2[_0xd0b9('0x52')]=qs[_0xd0b9('0x53')](_0x50afe2[_0xd0b9('0x2d')]['sort']);_0x36f3c2['where']=qs[_0xd0b9('0x35')](_[_0xd0b9('0x36')](_0x50afe2['query'],_0x1ebea1[_0xd0b9('0x35')]));if(_0x50afe2[_0xd0b9('0x2d')][_0xd0b9('0x37')]){_0x36f3c2[_0xd0b9('0x34')]=_[_0xd0b9('0x38')](_0x36f3c2[_0xd0b9('0x34')],{'$or':_['map'](_0x36f3c2[_0xd0b9('0x31')],function(_0x5319a8){var _0x1e017f={};_0x1e017f[_0x5319a8]={'$like':'%'+_0x50afe2['query'][_0xd0b9('0x37')]+'%'};return _0x1e017f;})});}_0x36f3c2=_[_0xd0b9('0x38')]({},_0x36f3c2,_0x50afe2[_0xd0b9('0x3f')]);return _0x325a90[_0xd0b9('0x54')](_0x36f3c2);}})['then'](function(_0x3cf7e7){if(_0x3cf7e7){_0x2d0eaa=_0x3cf7e7['length'];if(!_0x50afe2['query'][_0xd0b9('0x55')](_0xd0b9('0x33'))){_0x36f3c2[_0xd0b9('0x1c')]=qs[_0xd0b9('0x1c')](_0x50afe2['query'][_0xd0b9('0x1c')]);_0x36f3c2['offset']=qs['offset'](_0x50afe2[_0xd0b9('0x2d')][_0xd0b9('0x1a')]);}return _0x325a90[_0xd0b9('0x54')](_0x36f3c2);}})[_0xd0b9('0x22')](function(_0x34e514){if(_0x34e514){return _0x34e514?{'count':_0x2d0eaa,'rows':_0x34e514}:null;}})['then'](respondWithResult(_0x49ed77,null))[_0xd0b9('0x3b')](handleError(_0x49ed77,null));}; \ No newline at end of file +var _0xe943=['UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','ids','omit','findOne','getContacts','eml-format','zip-dir','fast-json-patch','request-promise','mustache','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','end','stack','name','CmCompany','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','includeAll','include','rows','params','rawAttributes','filters','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x239263,_0x11b35f){var _0x4668fa=function(_0x51d999){while(--_0x51d999){_0x239263['push'](_0x239263['shift']());}};_0x4668fa(++_0x11b35f);}(_0xe943,0xf8));var _0x3e94=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xe943[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require(_0x3e94('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3e94('0x1'));var jsonpatch=require(_0x3e94('0x2'));var rp=require(_0x3e94('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3e94('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3e94('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e94('0x6'));var _=require('lodash');var squel=require(_0x3e94('0x7'));var crypto=require(_0x3e94('0x8'));var jsforce=require(_0x3e94('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x3e94('0x5'));var querystring=require('querystring');var Papa=require(_0x3e94('0xa'));var Redis=require(_0x3e94('0xb'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3e94('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3e94('0xd'))(_0x3e94('0xe'));var utils=require(_0x3e94('0xf'));var config=require(_0x3e94('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x3e94('0x11'))['db'];function respondWithStatusCode(_0x1b87f0,_0xef3c86){_0xef3c86=_0xef3c86||0xcc;return function(_0x49e622){if(_0x49e622){return _0x1b87f0[_0x3e94('0x12')](_0xef3c86);}return _0x1b87f0['status'](_0xef3c86)['end']();};}function respondWithResult(_0x236cf6,_0x5e36ff){_0x5e36ff=_0x5e36ff||0xc8;return function(_0x1086fd){if(_0x1086fd){return _0x236cf6[_0x3e94('0x13')](_0x5e36ff)[_0x3e94('0x14')](_0x1086fd);}};}function respondWithFilteredResult(_0x364fec,_0xbe2127){return function(_0x1ebed6){if(_0x1ebed6){var _0x15da11=typeof _0xbe2127['offset']===_0x3e94('0x15')&&typeof _0xbe2127[_0x3e94('0x16')]===_0x3e94('0x15');var _0x8a278f=_0x1ebed6[_0x3e94('0x17')];var _0x1fcba1=_0x15da11?0x0:_0xbe2127['offset'];var _0x984ebf=_0x15da11?_0x1ebed6[_0x3e94('0x17')]:_0xbe2127[_0x3e94('0x18')]+_0xbe2127[_0x3e94('0x16')];var _0x1ebbc0;if(_0x984ebf>=_0x8a278f){_0x984ebf=_0x8a278f;_0x1ebbc0=0xc8;}else{_0x1ebbc0=0xce;}_0x364fec[_0x3e94('0x13')](_0x1ebbc0);return _0x364fec[_0x3e94('0x19')](_0x3e94('0x1a'),_0x1fcba1+'-'+_0x984ebf+'/'+_0x8a278f)[_0x3e94('0x14')](_0x1ebed6);}return null;};}function patchUpdates(_0x4c25e9){return function(_0x1da113){try{jsonpatch[_0x3e94('0x1b')](_0x1da113,_0x4c25e9,!![]);}catch(_0x21c12f){return BPromise[_0x3e94('0x1c')](_0x21c12f);}return _0x1da113['save']();};}function saveUpdates(_0x476e31,_0x27dfe9){return function(_0x5ec046){if(_0x5ec046){return _0x5ec046[_0x3e94('0x1d')](_0x476e31)[_0x3e94('0x1e')](function(_0x345d96){return _0x345d96;});}return null;};}function removeEntity(_0xe702f2,_0x278b0b){return function(_0x5a101f){if(_0x5a101f){return _0x5a101f[_0x3e94('0x1f')]()[_0x3e94('0x1e')](function(){var _0x3c40c7=_0x5a101f[_0x3e94('0x20')]({'plain':!![]});var _0x571408='Companies';return db[_0x3e94('0x21')][_0x3e94('0x1f')]({'where':{'type':_0x571408,'resourceId':_0x3c40c7['id']}})[_0x3e94('0x1e')](function(){return _0x5a101f;});})[_0x3e94('0x1e')](function(){_0xe702f2[_0x3e94('0x13')](0xcc)[_0x3e94('0x22')]();});}};}function handleEntityNotFound(_0x3456d8,_0xc2c0cb){return function(_0x3375d5){if(!_0x3375d5){_0x3456d8[_0x3e94('0x12')](0x194);}return _0x3375d5;};}function handleError(_0x4c9b5e,_0x490369){_0x490369=_0x490369||0x1f4;return function(_0x181229){logger['error'](_0x181229[_0x3e94('0x23')]);if(_0x181229[_0x3e94('0x24')]){delete _0x181229['name'];}_0x4c9b5e['status'](_0x490369)['send'](_0x181229);};}exports['index']=function(_0x3270ae,_0x103a22){var _0x1c0c48={},_0x4c5bf5={},_0x33e8f7={'count':0x0,'rows':[]};return db[_0x3e94('0x25')]['describe']()[_0x3e94('0x1e')](function(_0x80ebd8){_0x4c5bf5[_0x3e94('0x26')]=_['keys'](_0x80ebd8);_0x4c5bf5[_0x3e94('0x27')]=_[_0x3e94('0x28')](_0x3270ae[_0x3e94('0x27')]);_0x4c5bf5['filters']=_[_0x3e94('0x29')](_0x4c5bf5[_0x3e94('0x26')],_0x4c5bf5[_0x3e94('0x27')]);_0x1c0c48['attributes']=_[_0x3e94('0x29')](_0x4c5bf5[_0x3e94('0x26')],qs[_0x3e94('0x2a')](_0x3270ae['query'][_0x3e94('0x2a')]));_0x1c0c48[_0x3e94('0x2b')]=_0x1c0c48[_0x3e94('0x2b')][_0x3e94('0x2c')]?_0x1c0c48[_0x3e94('0x2b')]:_0x4c5bf5['model'];if(!_0x3270ae[_0x3e94('0x27')][_0x3e94('0x2d')](_0x3e94('0x2e'))){_0x1c0c48['limit']=qs[_0x3e94('0x16')](_0x3270ae[_0x3e94('0x27')]['limit']);_0x1c0c48[_0x3e94('0x18')]=qs[_0x3e94('0x18')](_0x3270ae[_0x3e94('0x27')][_0x3e94('0x18')]);}_0x1c0c48[_0x3e94('0x2f')]=qs[_0x3e94('0x30')](_0x3270ae[_0x3e94('0x27')][_0x3e94('0x30')]);_0x1c0c48[_0x3e94('0x31')]=qs['filters'](_[_0x3e94('0x32')](_0x3270ae[_0x3e94('0x27')],_0x4c5bf5['filters']),_0x80ebd8);if(_0x3270ae[_0x3e94('0x27')][_0x3e94('0x33')]){_0x1c0c48[_0x3e94('0x31')]=_[_0x3e94('0x34')](_0x1c0c48['where'],{'$or':_[_0x3e94('0x35')](_0x1c0c48[_0x3e94('0x2b')],function(_0x227119){var _0x57afba={};_0x57afba[_0x227119]={'$like':'%'+_0x3270ae['query'][_0x3e94('0x33')]+'%'};return _0x57afba;})});}_0x1c0c48=_[_0x3e94('0x34')]({},_0x1c0c48,_0x3270ae['options']);var _0x458f4b={'where':_0x1c0c48[_0x3e94('0x31')]};return db[_0x3e94('0x25')][_0x3e94('0x17')](_0x458f4b)[_0x3e94('0x1e')](function(_0x34ed5c){_0x33e8f7[_0x3e94('0x17')]=_0x34ed5c;if(_0x3270ae[_0x3e94('0x27')][_0x3e94('0x36')]){_0x1c0c48[_0x3e94('0x37')]=[{'all':!![]}];}return db[_0x3e94('0x25')]['findAll'](_0x1c0c48);})[_0x3e94('0x1e')](function(_0x5921b7){_0x33e8f7[_0x3e94('0x38')]=_0x5921b7;return _0x33e8f7;})['then'](respondWithFilteredResult(_0x103a22,_0x1c0c48))['catch'](handleError(_0x103a22,null));})['catch'](handleError(_0x103a22,null));};exports['show']=function(_0x530280,_0x57c9ce){var _0x44a0d2={'raw':![],'where':{'id':_0x530280[_0x3e94('0x39')]['id']}},_0x46b3b3={};_0x46b3b3[_0x3e94('0x26')]=_[_0x3e94('0x28')](db[_0x3e94('0x25')][_0x3e94('0x3a')]);_0x46b3b3[_0x3e94('0x27')]=_[_0x3e94('0x28')](_0x530280[_0x3e94('0x27')]);_0x46b3b3[_0x3e94('0x3b')]=_[_0x3e94('0x29')](_0x46b3b3[_0x3e94('0x26')],_0x46b3b3['query']);_0x44a0d2[_0x3e94('0x2b')]=_['intersection'](_0x46b3b3[_0x3e94('0x26')],qs['fields'](_0x530280['query'][_0x3e94('0x2a')]));_0x44a0d2[_0x3e94('0x2b')]=_0x44a0d2['attributes'][_0x3e94('0x2c')]?_0x44a0d2['attributes']:_0x46b3b3['model'];if(_0x530280['query'][_0x3e94('0x36')]){_0x44a0d2['include']=[{'all':!![]}];}_0x44a0d2=_['merge']({},_0x44a0d2,_0x530280[_0x3e94('0x3c')]);return db[_0x3e94('0x25')][_0x3e94('0x3d')](_0x44a0d2)[_0x3e94('0x1e')](handleEntityNotFound(_0x57c9ce,null))[_0x3e94('0x1e')](respondWithResult(_0x57c9ce,null))[_0x3e94('0x3e')](handleError(_0x57c9ce,null));};exports[_0x3e94('0x3f')]=function(_0x37857c,_0x3b8419){return db[_0x3e94('0x25')][_0x3e94('0x3f')](_0x37857c[_0x3e94('0x40')],{})[_0x3e94('0x1e')](function(_0x28afbd){var _0xa5896=_0x37857c[_0x3e94('0x41')][_0x3e94('0x20')]({'plain':!![]});if(!_0xa5896)throw new Error(_0x3e94('0x42'));if(_0xa5896[_0x3e94('0x43')]===_0x3e94('0x41')){var _0xdbb7f6=_0x28afbd[_0x3e94('0x20')]({'plain':!![]});var _0x3e2f3e='Companies';return db[_0x3e94('0x44')]['find']({'where':{'name':_0x3e2f3e,'userProfileId':_0xa5896[_0x3e94('0x45')]},'raw':!![]})[_0x3e94('0x1e')](function(_0x51eb7b){if(_0x51eb7b&&_0x51eb7b[_0x3e94('0x46')]===0x0){return db[_0x3e94('0x21')][_0x3e94('0x3f')]({'name':_0xdbb7f6[_0x3e94('0x24')],'resourceId':_0xdbb7f6['id'],'type':_0x51eb7b[_0x3e94('0x24')],'sectionId':_0x51eb7b['id']},{})[_0x3e94('0x1e')](function(){return _0x28afbd;});}else{return _0x28afbd;}})[_0x3e94('0x3e')](function(_0x1ef88c){logger[_0x3e94('0x47')](_0x3e94('0x48'),_0x1ef88c);throw _0x1ef88c;});}return _0x28afbd;})[_0x3e94('0x1e')](respondWithResult(_0x3b8419,0xc9))[_0x3e94('0x3e')](handleError(_0x3b8419,null));};exports[_0x3e94('0x1d')]=function(_0x5b1ad2,_0x41f871){if(_0x5b1ad2[_0x3e94('0x40')]['id']){delete _0x5b1ad2[_0x3e94('0x40')]['id'];}return db['CmCompany'][_0x3e94('0x3d')]({'where':{'id':_0x5b1ad2['params']['id']}})[_0x3e94('0x1e')](handleEntityNotFound(_0x41f871,null))['then'](saveUpdates(_0x5b1ad2['body'],null))[_0x3e94('0x1e')](respondWithResult(_0x41f871,null))[_0x3e94('0x3e')](handleError(_0x41f871,null));};exports['destroy']=function(_0xf04aae,_0x158b90){return db[_0x3e94('0x25')]['find']({'where':{'id':_0xf04aae[_0x3e94('0x39')]['id']}})[_0x3e94('0x1e')](handleEntityNotFound(_0x158b90,null))['then'](removeEntity(_0x158b90,null))[_0x3e94('0x3e')](handleError(_0x158b90,null));};exports[_0x3e94('0x49')]=function(_0x71db38,_0x5811ac){return db[_0x3e94('0x25')][_0x3e94('0x49')]()[_0x3e94('0x1e')](respondWithResult(_0x5811ac,null))[_0x3e94('0x3e')](handleError(_0x5811ac,null));};exports[_0x3e94('0x4a')]=function(_0x336adb,_0x2d92b8,_0x517e1c){return db['CmContact'][_0x3e94('0x3d')]({'where':{'id':_0x336adb[_0x3e94('0x39')]['id']}})[_0x3e94('0x1e')](handleEntityNotFound(_0x2d92b8,null))[_0x3e94('0x1e')](function(_0x1f324b){if(_0x1f324b){return _0x1f324b[_0x3e94('0x4a')](_0x336adb[_0x3e94('0x40')][_0x3e94('0x4b')],_[_0x3e94('0x4c')](_0x336adb[_0x3e94('0x40')],[_0x3e94('0x4b'),'id'])||{});}})[_0x3e94('0x1e')](respondWithResult(_0x2d92b8,null))['catch'](handleError(_0x2d92b8,null));};exports['getContacts']=function(_0x2ff485,_0x3ed0d3,_0x299e57){var _0x52c4eb={};var _0x1f75a8={};var _0x3188ce;var _0xc78af8;return db[_0x3e94('0x25')][_0x3e94('0x4d')]({'where':{'id':_0x2ff485[_0x3e94('0x39')]['id']}})[_0x3e94('0x1e')](handleEntityNotFound(_0x3ed0d3,null))['then'](function(_0x58409e){if(_0x58409e){_0x3188ce=_0x58409e;_0x1f75a8[_0x3e94('0x26')]=_[_0x3e94('0x28')](db['CmContact']['rawAttributes']);_0x1f75a8[_0x3e94('0x27')]=_[_0x3e94('0x28')](_0x2ff485[_0x3e94('0x27')]);_0x1f75a8[_0x3e94('0x3b')]=_[_0x3e94('0x29')](_0x1f75a8['model'],_0x1f75a8[_0x3e94('0x27')]);_0x52c4eb[_0x3e94('0x2b')]=_[_0x3e94('0x29')](_0x1f75a8['model'],qs[_0x3e94('0x2a')](_0x2ff485[_0x3e94('0x27')][_0x3e94('0x2a')]));_0x52c4eb['attributes']=_0x52c4eb[_0x3e94('0x2b')][_0x3e94('0x2c')]?_0x52c4eb[_0x3e94('0x2b')]:_0x1f75a8[_0x3e94('0x26')];_0x52c4eb[_0x3e94('0x2f')]=qs['sort'](_0x2ff485['query'][_0x3e94('0x30')]);_0x52c4eb['where']=qs[_0x3e94('0x3b')](_[_0x3e94('0x32')](_0x2ff485[_0x3e94('0x27')],_0x1f75a8[_0x3e94('0x3b')]));if(_0x2ff485[_0x3e94('0x27')][_0x3e94('0x33')]){_0x52c4eb[_0x3e94('0x31')]=_[_0x3e94('0x34')](_0x52c4eb[_0x3e94('0x31')],{'$or':_[_0x3e94('0x35')](_0x52c4eb['attributes'],function(_0x2e45c0){var _0x293fb9={};_0x293fb9[_0x2e45c0]={'$like':'%'+_0x2ff485[_0x3e94('0x27')][_0x3e94('0x33')]+'%'};return _0x293fb9;})});}_0x52c4eb=_['merge']({},_0x52c4eb,_0x2ff485['options']);return _0x3188ce['getContacts'](_0x52c4eb);}})[_0x3e94('0x1e')](function(_0x3ebc8b){if(_0x3ebc8b){_0xc78af8=_0x3ebc8b[_0x3e94('0x2c')];if(!_0x2ff485[_0x3e94('0x27')][_0x3e94('0x2d')](_0x3e94('0x2e'))){_0x52c4eb[_0x3e94('0x16')]=qs[_0x3e94('0x16')](_0x2ff485[_0x3e94('0x27')][_0x3e94('0x16')]);_0x52c4eb['offset']=qs[_0x3e94('0x18')](_0x2ff485[_0x3e94('0x27')][_0x3e94('0x18')]);}return _0x3188ce[_0x3e94('0x4e')](_0x52c4eb);}})['then'](function(_0x3e44f1){if(_0x3e44f1){return _0x3e44f1?{'count':_0xc78af8,'rows':_0x3e44f1}:null;}})[_0x3e94('0x1e')](respondWithResult(_0x3ed0d3,null))[_0x3e94('0x3e')](handleError(_0x3ed0d3,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 315b548..5d26f90 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 _0x0d14=['exports','define','CmCompany','cm_companies','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x28f729,_0x5dbd61){var _0x264ce0=function(_0x4a7bb3){while(--_0x4a7bb3){_0x28f729['push'](_0x28f729['shift']());}};_0x264ce0(++_0x5dbd61);}(_0x0d14,0x1ee));var _0x40d1=function(_0x44f1ca,_0x1ef7dd){_0x44f1ca=_0x44f1ca-0x0;var _0x1929a4=_0x0d14[_0x44f1ca];return _0x1929a4;};'use strict';var _=require(_0x40d1('0x0'));var util=require(_0x40d1('0x1'));var logger=require('../../config/logger')(_0x40d1('0x2'));var moment=require(_0x40d1('0x3'));var BPromise=require(_0x40d1('0x4'));var rp=require(_0x40d1('0x5'));var fs=require('fs');var path=require(_0x40d1('0x6'));var rimraf=require(_0x40d1('0x7'));var config=require(_0x40d1('0x8'));var attributes=require(_0x40d1('0x9'));module[_0x40d1('0xa')]=function(_0x226aa9,_0x3f8995){return _0x226aa9[_0x40d1('0xb')](_0x40d1('0xc'),attributes,{'tableName':_0x40d1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3280=['rimraf','../../config/environment','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x37656f,_0x350ac6){var _0x5cd9d8=function(_0x12e27e){while(--_0x12e27e){_0x37656f['push'](_0x37656f['shift']());}};_0x5cd9d8(++_0x350ac6);}(_0x3280,0x119));var _0x0328=function(_0x46f0ba,_0x4e893c){_0x46f0ba=_0x46f0ba-0x0;var _0x580548=_0x3280[_0x46f0ba];return _0x580548;};'use strict';var _=require(_0x0328('0x0'));var util=require(_0x0328('0x1'));var logger=require(_0x0328('0x2'))(_0x0328('0x3'));var moment=require('moment');var BPromise=require(_0x0328('0x4'));var rp=require(_0x0328('0x5'));var fs=require('fs');var path=require(_0x0328('0x6'));var rimraf=require(_0x0328('0x7'));var config=require(_0x0328('0x8'));var attributes=require('./cmCompany.attributes');module['exports']=function(_0x438f34,_0x521a2f){return _0x438f34[_0x0328('0x9')](_0x0328('0xa'),attributes,{'tableName':_0x0328('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 f169873..5fd5ba3 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 _0x70e5=['util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','catch','lodash'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x70e5,0x7d));var _0x570e=function(_0x343182,_0x550093){_0x343182=_0x343182-0x0;var _0x18ae91=_0x70e5[_0x343182];return _0x18ae91;};'use strict';var _=require(_0x570e('0x0'));var util=require(_0x570e('0x1'));var moment=require('moment');var BPromise=require(_0x570e('0x2'));var rs=require(_0x570e('0x3'));var fs=require('fs');var Redis=require(_0x570e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x570e('0x5'))(_0x570e('0x6'));var config=require(_0x570e('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x570e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4db0af,_0x393e62,_0x5ef327){return new BPromise(function(_0x20dfbf,_0x10c609){return client[_0x570e('0x9')](_0x4db0af,_0x5ef327)[_0x570e('0xa')](function(_0x4dfd99){logger[_0x570e('0xb')]('CmCompany,\x20%s,\x20%s',_0x393e62,_0x570e('0xc'));logger[_0x570e('0xd')](_0x570e('0xe'),_0x393e62,_0x570e('0xc'),JSON[_0x570e('0xf')](_0x4dfd99));if(_0x4dfd99[_0x570e('0x10')]){if(_0x4dfd99[_0x570e('0x10')][_0x570e('0x11')]===0x1f4){logger[_0x570e('0x10')](_0x570e('0x12'),_0x393e62,_0x4dfd99[_0x570e('0x10')][_0x570e('0x13')]);return _0x10c609(_0x4dfd99[_0x570e('0x10')][_0x570e('0x13')]);}logger[_0x570e('0x10')](_0x570e('0x12'),_0x393e62,_0x4dfd99[_0x570e('0x10')][_0x570e('0x13')]);return _0x20dfbf(_0x4dfd99[_0x570e('0x10')][_0x570e('0x13')]);}else{logger['info'](_0x570e('0x12'),_0x393e62,'request\x20sent');_0x20dfbf(_0x4dfd99['result'][_0x570e('0x13')]);}})[_0x570e('0x14')](function(_0x1638b9){logger[_0x570e('0x10')]('CmCompany,\x20%s,\x20%s',_0x393e62,_0x1638b9);_0x10c609(_0x1638b9);});});} \ No newline at end of file +var _0x01c9=['request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','CmCompany,\x20%s,\x20%s'];(function(_0x1098db,_0x39ba6b){var _0x14f090=function(_0x473ffe){while(--_0x473ffe){_0x1098db['push'](_0x1098db['shift']());}};_0x14f090(++_0x39ba6b);}(_0x01c9,0x1aa));var _0x901c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x01c9[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x901c('0x0'));var util=require(_0x901c('0x1'));var moment=require(_0x901c('0x2'));var BPromise=require(_0x901c('0x3'));var rs=require(_0x901c('0x4'));var fs=require('fs');var Redis=require(_0x901c('0x5'));var db=require(_0x901c('0x6'))['db'];var utils=require(_0x901c('0x7'));var logger=require('../../config/logger')(_0x901c('0x8'));var config=require(_0x901c('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x901c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10c59c,_0x334631,_0x43aa20){return new BPromise(function(_0x38ab21,_0x531708){return client[_0x901c('0xb')](_0x10c59c,_0x43aa20)[_0x901c('0xc')](function(_0x10a200){logger['info'](_0x901c('0xd'),_0x334631,_0x901c('0xe'));logger[_0x901c('0xf')](_0x901c('0x10'),_0x334631,'request\x20sent',JSON[_0x901c('0x11')](_0x10a200));if(_0x10a200[_0x901c('0x12')]){if(_0x10a200[_0x901c('0x12')][_0x901c('0x13')]===0x1f4){logger[_0x901c('0x12')]('CmCompany,\x20%s,\x20%s',_0x334631,_0x10a200[_0x901c('0x12')][_0x901c('0x14')]);return _0x531708(_0x10a200[_0x901c('0x12')][_0x901c('0x14')]);}logger[_0x901c('0x12')](_0x901c('0xd'),_0x334631,_0x10a200[_0x901c('0x12')]['message']);return _0x38ab21(_0x10a200[_0x901c('0x12')][_0x901c('0x14')]);}else{logger['info'](_0x901c('0xd'),_0x334631,_0x901c('0xe'));_0x38ab21(_0x10a200['result'][_0x901c('0x14')]);}})[_0x901c('0x15')](function(_0x1d8125){logger[_0x901c('0x12')](_0x901c('0xd'),_0x334631,_0x1d8125);_0x531708(_0x1d8125);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 5edfebf..6a856d4 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 _0x5cf0=['getContacts','create','post','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','show','/:id/contacts'];(function(_0x314a10,_0x24bdfe){var _0x2efe09=function(_0x2d9295){while(--_0x2d9295){_0x314a10['push'](_0x314a10['shift']());}};_0x2efe09(++_0x24bdfe);}(_0x5cf0,0x1d5));var _0x05cf=function(_0x185991,_0xa158c){_0x185991=_0x185991-0x0;var _0x5a5719=_0x5cf0[_0x185991];return _0x5a5719;};'use strict';var multer=require(_0x05cf('0x0'));var util=require(_0x05cf('0x1'));var path=require('path');var timeout=require(_0x05cf('0x2'));var express=require(_0x05cf('0x3'));var router=express[_0x05cf('0x4')]();var fs_extra=require(_0x05cf('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x05cf('0x6'));var controller=require(_0x05cf('0x7'));router[_0x05cf('0x8')]('/',auth[_0x05cf('0x9')](),controller[_0x05cf('0xa')]);router['get']('/describe',auth[_0x05cf('0x9')](),controller[_0x05cf('0xb')]);router['get']('/:id',auth[_0x05cf('0x9')](),controller[_0x05cf('0xc')]);router['get'](_0x05cf('0xd'),auth[_0x05cf('0x9')](),controller[_0x05cf('0xe')]);router['post']('/',auth[_0x05cf('0x9')](),controller[_0x05cf('0xf')]);router[_0x05cf('0x10')](_0x05cf('0xd'),auth[_0x05cf('0x9')](),controller['addContacts']);router[_0x05cf('0x11')](_0x05cf('0x12'),auth[_0x05cf('0x9')](),controller[_0x05cf('0x13')]);router[_0x05cf('0x14')](_0x05cf('0x12'),auth[_0x05cf('0x9')](),controller[_0x05cf('0x15')]);module[_0x05cf('0x16')]=router; \ No newline at end of file +var _0x1323=['../../components/interaction/service','../../config/environment','./cmCompany.controller','get','/:id','isAuthenticated','/:id/contacts','getContacts','post','create','addContacts','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x1323,0x189));var _0x3132=function(_0x28c5c2,_0x1de732){_0x28c5c2=_0x28c5c2-0x0;var _0x5337a0=_0x1323[_0x28c5c2];return _0x5337a0;};'use strict';var multer=require(_0x3132('0x0'));var util=require(_0x3132('0x1'));var path=require(_0x3132('0x2'));var timeout=require(_0x3132('0x3'));var express=require(_0x3132('0x4'));var router=express[_0x3132('0x5')]();var fs_extra=require(_0x3132('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3132('0x7'));var config=require(_0x3132('0x8'));var controller=require(_0x3132('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x3132('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x3132('0xa')](_0x3132('0xb'),auth[_0x3132('0xc')](),controller['show']);router[_0x3132('0xa')](_0x3132('0xd'),auth[_0x3132('0xc')](),controller[_0x3132('0xe')]);router[_0x3132('0xf')]('/',auth[_0x3132('0xc')](),controller[_0x3132('0x10')]);router[_0x3132('0xf')](_0x3132('0xd'),auth[_0x3132('0xc')](),controller[_0x3132('0x11')]);router['put'](_0x3132('0xb'),auth[_0x3132('0xc')](),controller['update']);router['delete'](_0x3132('0xb'),auth[_0x3132('0xc')](),controller[_0x3132('0x12')]);module[_0x3132('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 2756516..8d2611a 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 _0x1856=['sequelize','exports','STRING','INTEGER','UNSIGNED','lodash'];(function(_0x35268e,_0x4acfd1){var _0x28ba11=function(_0x34f637){while(--_0x34f637){_0x35268e['push'](_0x35268e['shift']());}};_0x28ba11(++_0x4acfd1);}(_0x1856,0x95));var _0x6185=function(_0x550488,_0x34c6ea){_0x550488=_0x550488-0x0;var _0x6a177a=_0x1856[_0x550488];return _0x6a177a;};'use strict';var _=require(_0x6185('0x0'));var Sequelize=require(_0x6185('0x1'));module[_0x6185('0x2')]={'firstName':{'type':Sequelize[_0x6185('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x6185('0x3')]},'street':{'type':Sequelize[_0x6185('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x6185('0x3')]},'country':{'type':Sequelize[_0x6185('0x3')]},'dateOfBirth':{'type':Sequelize[_0x6185('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x6185('0x3')]},'mobile':{'type':Sequelize[_0x6185('0x3')]},'fax':{'type':Sequelize[_0x6185('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x6185('0x3')]},'facebook':{'type':Sequelize[_0x6185('0x3')]},'fb_data':{'type':Sequelize[_0x6185('0x3')]},'twitter':{'type':Sequelize[_0x6185('0x3')]},'skype':{'type':Sequelize[_0x6185('0x3')]},'teams':{'type':Sequelize[_0x6185('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x6185('0x3')]},'wechat':{'type':Sequelize[_0x6185('0x3')]},'telegram':{'type':Sequelize[_0x6185('0x3')]},'UserId':{'type':Sequelize[_0x6185('0x4')]},'priority':{'type':Sequelize[_0x6185('0x4')](0x2)[_0x6185('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x8be4=['STRING','TEXT','INTEGER','DATE','NOW','exports'];(function(_0x285111,_0x252c97){var _0x5055fd=function(_0x306f0b){while(--_0x306f0b){_0x285111['push'](_0x285111['shift']());}};_0x5055fd(++_0x252c97);}(_0x8be4,0x1eb));var _0x48be=function(_0x527c39,_0x3ea2a6){_0x527c39=_0x527c39-0x0;var _0x3f4dd6=_0x8be4[_0x527c39];return _0x3f4dd6;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0x48be('0x0')]={'firstName':{'type':Sequelize[_0x48be('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0x48be('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x48be('0x1')]},'city':{'type':Sequelize[_0x48be('0x1')]},'country':{'type':Sequelize[_0x48be('0x1')]},'dateOfBirth':{'type':Sequelize[_0x48be('0x1')]},'description':{'type':Sequelize[_0x48be('0x2')]},'phone':{'type':Sequelize[_0x48be('0x1')]},'mobile':{'type':Sequelize[_0x48be('0x1')]},'fax':{'type':Sequelize[_0x48be('0x1')]},'email':{'type':Sequelize[_0x48be('0x1')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x48be('0x1')]},'fb_data':{'type':Sequelize[_0x48be('0x1')]},'twitter':{'type':Sequelize[_0x48be('0x1')]},'skype':{'type':Sequelize[_0x48be('0x1')]},'teams':{'type':Sequelize[_0x48be('0x1')]},'viber':{'type':Sequelize[_0x48be('0x1')]},'line':{'type':Sequelize[_0x48be('0x1')]},'wechat':{'type':Sequelize[_0x48be('0x1')]},'telegram':{'type':Sequelize[_0x48be('0x1')]},'UserId':{'type':Sequelize[_0x48be('0x3')]},'priority':{'type':Sequelize[_0x48be('0x3')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x48be('0x4')],'defaultValue':Sequelize[_0x48be('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index ffa1db5..c00d809 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 _0x85ce=['QueryTypes','clone','order','having','t.id\x20IN\x20?','role','agent','some','user','getLists','c.ListId\x20IS\x20NULL','ListId','sequelize','keyBy','merge','fields','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','toString','Tags','push','rows','catch','tags','columnName','displayName','analytics','findAll','alias','values','body','get','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatMessage','ChatOfflineMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','create','bulkCreate','each','duplicates','$or','findOrCreate','spread','show','params','Tag','$and','omit','cf_%d','pickBy','format','cm_contacts','setFields','id\x20=\x20?','toParam','phone','model','options','getTags','setTags','getHoppers','rawAttributes','nolimit','ContactId','includeAll','include','getHopperHistories','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','join','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','createReadStream','meta','import','binding','../../components/import/cm/csv2','stringify','error\x20child\x20process','mail','chat','sms','openchannel','whatsapp','voice','-createdAt','resolve','channel','toLowerCase','Invalid\x20channel','range','parse','Invalid\x20date\x20for\x20range\x20from\x20filter','uniqueid','source','destination','callerid','duration','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','fullname','findAndCountAll','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','key','Owner','DESC','browserName','customerPort','deviceModel','osName','ratingMessage','ratingValue','referer','subject','substatus','externalUrl','threadId','Interaction','flatten','sortBy','moment','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','./cmContact.socket','status','offset','limit','undefined','count','set','Content-Range','json','update','then','destroy','end','stack','name','index','CmContact','describe','keys','startsWith','cf_','CmCustomField','findOne','trimStart','length','fieldType','type','query','filters','intersection','attributes','sort','where','pick','select','field','color','from','tools_tags','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','left_join','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','map','forEach','union','User','and','uc.UserId\x20=\x20?','value','dateOfBirth','datetime','text','start','hasOwnProperty','filter','isNil','Contact','isEmpty','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','Sequelize'];(function(_0x2cfd2e,_0x3ed803){var _0x371885=function(_0x102bd1){while(--_0x102bd1){_0x2cfd2e['push'](_0x2cfd2e['shift']());}};_0x371885(++_0x3ed803);}(_0x85ce,0x1c3));var _0xe85c=function(_0x1262c9,_0xd89179){_0x1262c9=_0x1262c9-0x0;var _0x58c9cc=_0x85ce[_0x1262c9];return _0x58c9cc;};'use strict';var moment=require(_0xe85c('0x0'));var BPromise=require(_0xe85c('0x1'));var util=require(_0xe85c('0x2'));var path=require(_0xe85c('0x3'));var fs=require('fs');var _=require(_0xe85c('0x4'));var squel=require(_0xe85c('0x5'));var Papa=require(_0xe85c('0x6'));var Redis=require(_0xe85c('0x7'));var qs=require(_0xe85c('0x8'));var as=require(_0xe85c('0x9'));var logger=require(_0xe85c('0xa'))('api');var config=require(_0xe85c('0xb'));var db=require(_0xe85c('0xc'))['db'];config['redis']=_[_0xe85c('0xd')](config[_0xe85c('0xe')],{'host':_0xe85c('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe85c('0x10'))['register'](socket);function respondWithResult(_0x2f4541,_0x4863e8){_0x4863e8=_0x4863e8||0xc8;return function(_0x13fe66){if(_0x13fe66){return _0x2f4541[_0xe85c('0x11')](_0x4863e8)['json'](_0x13fe66);}};}function respondWithFilteredResult(_0x396d9d,_0x588f14){return function(_0x57b7ec){if(_0x57b7ec){var _0xad8b5f=typeof _0x588f14[_0xe85c('0x12')]==='undefined'&&typeof _0x588f14[_0xe85c('0x13')]===_0xe85c('0x14');var _0x232ea5=_0x57b7ec['count'];var _0x4193c6=_0xad8b5f?0x0:_0x588f14[_0xe85c('0x12')];var _0x58917f=_0xad8b5f?_0x57b7ec[_0xe85c('0x15')]:_0x588f14[_0xe85c('0x12')]+_0x588f14[_0xe85c('0x13')];var _0x5dcb5b;if(_0x58917f>=_0x232ea5){_0x58917f=_0x232ea5;_0x5dcb5b=0xc8;}else{_0x5dcb5b=0xce;}_0x396d9d[_0xe85c('0x11')](_0x5dcb5b);return _0x396d9d[_0xe85c('0x16')](_0xe85c('0x17'),_0x4193c6+'-'+_0x58917f+'/'+_0x232ea5)[_0xe85c('0x18')](_0x57b7ec);}return null;};}function saveUpdates(_0xbe353b){return function(_0xabc7d){if(_0xabc7d){return _0xabc7d[_0xe85c('0x19')](_0xbe353b)[_0xe85c('0x1a')](function(_0x3f6596){return _0x3f6596;});}return null;};}function removeEntity(_0x10d1e1){return function(_0x245385){if(_0x245385){return _0x245385[_0xe85c('0x1b')]()[_0xe85c('0x1a')](function(){_0x10d1e1[_0xe85c('0x11')](0xcc)[_0xe85c('0x1c')]();});}};}function handleEntityNotFound(_0xaf9fc){return function(_0xe65715){if(!_0xe65715){_0xaf9fc['sendStatus'](0x194);}return _0xe65715;};}function handleError(_0x23a19f,_0x424800){_0x424800=_0x424800||0x1f4;return function(_0x58ae46){logger['error'](_0x58ae46[_0xe85c('0x1d')]);if(_0x58ae46[_0xe85c('0x1e')]){delete _0x58ae46['name'];}_0x23a19f[_0xe85c('0x11')](_0x424800)['send'](_0x58ae46);};}exports[_0xe85c('0x1f')]=function(_0x5acdf6,_0x37b01d){var _0x2969a1={},_0x4ef1aa={},_0x54239e={'count':0x0,'rows':[]};return db[_0xe85c('0x20')][_0xe85c('0x21')]()[_0xe85c('0x1a')](function(_0x5a42e8){var _0x59cd6c=[];for(var _0x3c6127=0x0;_0x3c61270x1){_0x20d7bf['or'](_0xe85c('0x5c'),qs[_0xe85c('0x5d')](_0x14505f),null);}else{if(qs[_0xe85c('0x5e')](_0x14505f)){_0x20d7bf['or'](_0xe85c('0x5f'),_0x14505f+'%');_0x20d7bf['or'](_0xe85c('0x60'),_0x14505f+'%');_0x20d7bf['or'](_0xe85c('0x61'),_0x14505f+'%');_0x20d7bf['or'](_0xe85c('0x62'),_0x14505f+'%');}else if(qs[_0xe85c('0x63')](_0x14505f)){_0x20d7bf['or'](_0xe85c('0x64'),_0x14505f+'%');}else{_0x20d7bf['or'](_0xe85c('0x65'),'%'+_0x14505f+'%');_0x20d7bf['or'](_0xe85c('0x66'),'%'+_0x14505f+'%');_0x20d7bf['or']('c.email\x20LIKE\x20?','%'+_0x14505f+'%');}}}}_0x39df4f[_0xe85c('0x30')](_0x20d7bf);_0x39df4f['group'](_0xe85c('0x67'));var _0x3c5885={'type':db[_0xe85c('0x68')][_0xe85c('0x69')]['SELECT'],'raw':!![]};var _0x4d384e=_0x39df4f[_0xe85c('0x6a')]()[_0xe85c('0x33')](_0xe85c('0x67'));if(_0x2969a1[_0xe85c('0x6b')]){_0x2969a1[_0xe85c('0x6b')][_0xe85c('0x45')](function(_0x1b731a){_0x39df4f[_0xe85c('0x6b')]('c.'+_0x1b731a[0x0],_0x1b731a[0x1]==='DESC'?![]:!![]);});}if(!_[_0xe85c('0x53')](_0x29f80a)){_0x39df4f[_0xe85c('0x6c')](_0xd2e7ea);_0x4d384e[_0xe85c('0x30')](_0xe85c('0x6d'),_0x29f80a);}BPromise['resolve']()[_0xe85c('0x1a')](function(){if(!_0x1000ea)return;if(_0x5acdf6['user'][_0xe85c('0x6e')]!==_0xe85c('0x6f'))return;if(!_[_0xe85c('0x70')](_0x1000ea[_0xe85c('0x42')],[_0xe85c('0x33'),_0xe85c('0x47')])){return _0x5acdf6[_0xe85c('0x71')][_0xe85c('0x72')]({'attributes':['id'],'raw':!![]})[_0xe85c('0x1a')](function(_0x53244d){if(_[_0xe85c('0x53')](_0x53244d)){_0x4d384e[_0xe85c('0x30')](_0xe85c('0x73'));_0x39df4f[_0xe85c('0x30')]('c.ListId\x20IS\x20NULL');}else{_0x4d384e[_0xe85c('0x30')](_0xe85c('0x54'),_[_0xe85c('0x44')](_0x53244d,'id'));_0x39df4f[_0xe85c('0x30')](_0xe85c('0x54'),_[_0xe85c('0x44')](_0x53244d,'id'));}});}})[_0xe85c('0x1a')](function(){if(_0x5acdf6[_0xe85c('0x71')][_0xe85c('0x6e')]===_0xe85c('0x6f')&&!_0x1000ea&&!_0x5acdf6[_0xe85c('0x2b')][_0xe85c('0x74')])return[];return db[_0xe85c('0x75')]['query'](_0x4d384e['toString'](),_0x3c5885);})[_0xe85c('0x1a')](function(_0xeacef0){_0x54239e[_0xe85c('0x15')]=_0xeacef0[_0xe85c('0x28')];if(_0x54239e[_0xe85c('0x15')]===0x0)return[];return db[_0xe85c('0x75')][_0xe85c('0x2b')](_0x2462ca['toString'](),_0x3c5885)['then'](function(_0x260657){_0x34dcc9=_[_0xe85c('0x76')](_0x260657,'id');_0x3c5885=_[_0xe85c('0x77')](_0x3c5885,{'model':db[_0xe85c('0x20')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5acdf6['query'][_0xe85c('0x78')]){_0x2969a1['attributes']['forEach'](function(_0xeceee5){_0x39df4f[_0xe85c('0x33')]('c.'+_0xeceee5);});}else{_0x39df4f[_0xe85c('0x33')]('c.id');_0x39df4f['field']('c.firstName');_0x39df4f['field']('c.lastName');_0x39df4f[_0xe85c('0x33')](_0xe85c('0x79'));_0x39df4f[_0xe85c('0x33')](_0xe85c('0x7a'));_0x39df4f[_0xe85c('0x33')](_0xe85c('0x7b'));_0x39df4f[_0xe85c('0x33')](_0xe85c('0x7c'));_0x39df4f[_0xe85c('0x33')](_0xe85c('0x7d'));_0x39df4f[_0xe85c('0x33')](_0xe85c('0x7e'));_0x39df4f[_0xe85c('0x33')]('c.deletedAt');_0x39df4f[_0xe85c('0x33')](_0xe85c('0x7f'));_0x39df4f['field'](_0xe85c('0x80'),_0xe85c('0x81'));}if(_0x2969a1[_0xe85c('0x13')])_0x39df4f[_0xe85c('0x13')](_0x2969a1[_0xe85c('0x13')]);if(_0x2969a1['offset'])_0x39df4f[_0xe85c('0x12')](_0x2969a1['offset']);return db[_0xe85c('0x75')][_0xe85c('0x2b')](_0x39df4f[_0xe85c('0x82')](),_0x3c5885);});})[_0xe85c('0x1a')](function(_0x59e3da){_0x59e3da[_0xe85c('0x45')](function(_0x25f334){if(_0x25f334[_0xe85c('0x81')]){_0x25f334[_0xe85c('0x83')]=[];_0x25f334['TagIds'][_0xe85c('0x5b')](',')[_0xe85c('0x45')](function(_0x37dce0){_0x25f334[_0xe85c('0x83')][_0xe85c('0x84')](_0x34dcc9[_0x37dce0]);});}delete _0x25f334[_0xe85c('0x81')];});_0x54239e[_0xe85c('0x85')]=_0x59e3da;return _0x54239e;})[_0xe85c('0x1a')](respondWithFilteredResult(_0x37b01d,_0x2969a1));})[_0xe85c('0x86')](handleError(_0x37b01d,null));};exports[_0xe85c('0x1b')]=function(_0x447736,_0x495053){return db[_0xe85c('0x20')][_0xe85c('0x43')]({'where':{'id':_0x447736['params']['id']}})[_0xe85c('0x1a')](handleEntityNotFound(_0x495053,null))['then'](removeEntity(_0x495053,null))['catch'](handleError(_0x495053,null));};exports[_0xe85c('0x21')]=function(_0x83a22f,_0x2ebe8a){return db[_0xe85c('0x20')]['describe']()[_0xe85c('0x1a')](function(_0xa871f7){delete _0xa871f7[_0xe85c('0x87')];for(var _0x598e1b=0x0;_0x598e1b=_0x4d3310){_0x15868c=_0x4d3310;_0x1b8353=0xc8;}else{_0x1b8353=0xce;}_0x505ddc[_0xe075('0x12')](_0x1b8353);return _0x505ddc[_0xe075('0x13')]('Content-Range',_0x45e723+'-'+_0x15868c+'/'+_0x4d3310)[_0xe075('0xd')](_0x1c3ac8);}return null;};}function saveUpdates(_0x40caca){return function(_0x4f6a8a){if(_0x4f6a8a){return _0x4f6a8a[_0xe075('0x14')](_0x40caca)[_0xe075('0x15')](function(_0x6d242b){return _0x6d242b;});}return null;};}function removeEntity(_0x2be2f3){return function(_0x5151bc){if(_0x5151bc){return _0x5151bc[_0xe075('0x16')]()[_0xe075('0x15')](function(){_0x2be2f3['status'](0xcc)[_0xe075('0x17')]();});}};}function handleEntityNotFound(_0x300709){return function(_0x2c645c){if(!_0x2c645c){_0x300709[_0xe075('0x18')](0x194);}return _0x2c645c;};}function handleError(_0x29b5dd,_0x9b78cf){_0x9b78cf=_0x9b78cf||0x1f4;return function(_0x14228a){logger[_0xe075('0x19')](_0x14228a[_0xe075('0x1a')]);if(_0x14228a[_0xe075('0x1b')]){delete _0x14228a[_0xe075('0x1b')];}_0x29b5dd[_0xe075('0x12')](_0x9b78cf)['send'](_0x14228a);};}exports[_0xe075('0x1c')]=function(_0x2e3f7f,_0x551c0c){var _0x4e313e={},_0x447c82={},_0xfca406={'count':0x0,'rows':[]};return db[_0xe075('0x1d')][_0xe075('0x1e')]()['then'](function(_0x40b655){var _0x3f4701=[];for(var _0x1272cb=0x0;_0x1272cb0x1){_0x11ede2['or'](_0xe075('0x5a'),qs['getFullTextValue'](_0x84eca0),null);}else{if(qs['isNumeric'](_0x84eca0)){_0x11ede2['or'](_0xe075('0x5b'),_0x84eca0+'%');_0x11ede2['or'](_0xe075('0x5c'),_0x84eca0+'%');_0x11ede2['or'](_0xe075('0x5d'),_0x84eca0+'%');_0x11ede2['or'](_0xe075('0x5e'),_0x84eca0+'%');}else if(qs['isEmail'](_0x84eca0)){_0x11ede2['or'](_0xe075('0x5f'),_0x84eca0+'%');}else{_0x11ede2['or'](_0xe075('0x60'),'%'+_0x84eca0+'%');_0x11ede2['or'](_0xe075('0x61'),'%'+_0x84eca0+'%');_0x11ede2['or'](_0xe075('0x5f'),'%'+_0x84eca0+'%');}}}}_0x3809b2[_0xe075('0x31')](_0x11ede2);_0x3809b2[_0xe075('0x62')]('c.id');var _0x4009b5={'type':db[_0xe075('0x63')][_0xe075('0x64')][_0xe075('0x65')],'raw':!![]};var _0x1b51e7=_0x3809b2[_0xe075('0x66')]()['field'](_0xe075('0x67'));if(_0x4e313e[_0xe075('0x2f')]){_0x4e313e[_0xe075('0x2f')][_0xe075('0x50')](function(_0x584237){_0x3809b2[_0xe075('0x2f')]('c.'+_0x584237[0x0],_0x584237[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x2d090b)){_0x3809b2[_0xe075('0x68')](_0x47d7d3);_0x1b51e7['where'](_0xe075('0x69'),_0x2d090b);}BPromise['resolve']()[_0xe075('0x15')](function(){if(!_0x399982)return;if(_0x2e3f7f['user'][_0xe075('0x6a')]!==_0xe075('0x6b'))return;if(!_[_0xe075('0x6c')](_0x399982[_0xe075('0x40')],['field','User'])){return _0x2e3f7f[_0xe075('0x6d')]['getLists']({'attributes':['id'],'raw':!![]})[_0xe075('0x15')](function(_0x3d4e90){if(_[_0xe075('0x4f')](_0x3d4e90)){_0x1b51e7[_0xe075('0x31')](_0xe075('0x6e'));_0x3809b2['where']('c.ListId\x20IS\x20NULL');}else{_0x1b51e7[_0xe075('0x31')]('c.ListId\x20IN\x20?',_[_0xe075('0x43')](_0x3d4e90,'id'));_0x3809b2[_0xe075('0x31')](_0xe075('0x52'),_[_0xe075('0x43')](_0x3d4e90,'id'));}});}})[_0xe075('0x15')](function(){if(_0x2e3f7f[_0xe075('0x6d')]['role']===_0xe075('0x6b')&&!_0x399982&&!_0x2e3f7f[_0xe075('0x28')][_0xe075('0x51')])return[];return db[_0xe075('0x6f')][_0xe075('0x28')](_0x1b51e7[_0xe075('0x70')](),_0x4009b5);})['then'](function(_0x4a55eb){_0xfca406[_0xe075('0x10')]=_0x4a55eb[_0xe075('0x27')];if(_0xfca406[_0xe075('0x10')]===0x0)return[];return db[_0xe075('0x6f')][_0xe075('0x28')](_0x439eae['toString'](),_0x4009b5)[_0xe075('0x15')](function(_0x36f6ab){_0x54aea4=_[_0xe075('0x71')](_0x36f6ab,'id');_0x4009b5=_[_0xe075('0x72')](_0x4009b5,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2e3f7f[_0xe075('0x28')][_0xe075('0x2b')]){_0x4e313e['attributes'][_0xe075('0x50')](function(_0x16020c){_0x3809b2[_0xe075('0x34')]('c.'+_0x16020c);});}else{_0x3809b2[_0xe075('0x34')](_0xe075('0x67'));_0x3809b2['field']('c.firstName');_0x3809b2[_0xe075('0x34')](_0xe075('0x73'));_0x3809b2[_0xe075('0x34')](_0xe075('0x74'));_0x3809b2['field'](_0xe075('0x75'));_0x3809b2['field'](_0xe075('0x76'));_0x3809b2[_0xe075('0x34')](_0xe075('0x77'));_0x3809b2[_0xe075('0x34')](_0xe075('0x78'));_0x3809b2[_0xe075('0x34')](_0xe075('0x79'));_0x3809b2[_0xe075('0x34')](_0xe075('0x7a'));_0x3809b2[_0xe075('0x34')]('c.CompanyId');_0x3809b2[_0xe075('0x34')](_0xe075('0x7b'),_0xe075('0x7c'));}if(_0x4e313e[_0xe075('0xf')])_0x3809b2['limit'](_0x4e313e[_0xe075('0xf')]);if(_0x4e313e[_0xe075('0x11')])_0x3809b2['offset'](_0x4e313e[_0xe075('0x11')]);return db[_0xe075('0x6f')][_0xe075('0x28')](_0x3809b2[_0xe075('0x70')](),_0x4009b5);});})[_0xe075('0x15')](function(_0x4c4451){_0x4c4451[_0xe075('0x50')](function(_0x1aa03a){if(_0x1aa03a[_0xe075('0x7c')]){_0x1aa03a['Tags']=[];_0x1aa03a[_0xe075('0x7c')][_0xe075('0x59')](',')[_0xe075('0x50')](function(_0x559d81){_0x1aa03a[_0xe075('0x7d')][_0xe075('0x22')](_0x54aea4[_0x559d81]);});}delete _0x1aa03a[_0xe075('0x7c')];});_0xfca406[_0xe075('0x7e')]=_0x4c4451;return _0xfca406;})[_0xe075('0x15')](respondWithFilteredResult(_0x551c0c,_0x4e313e));})[_0xe075('0x7f')](handleError(_0x551c0c,null));};exports['destroy']=function(_0x57e871,_0x2bcf2d){return db[_0xe075('0x1d')][_0xe075('0x41')]({'where':{'id':_0x57e871[_0xe075('0x80')]['id']}})[_0xe075('0x15')](handleEntityNotFound(_0x2bcf2d,null))[_0xe075('0x15')](removeEntity(_0x2bcf2d,null))[_0xe075('0x7f')](handleError(_0x2bcf2d,null));};exports[_0xe075('0x1e')]=function(_0x5d9d53,_0x3b6da5){return db[_0xe075('0x1d')][_0xe075('0x1e')]()['then'](function(_0x17d95b){delete _0x17d95b[_0xe075('0x81')];for(var _0x6fe55a=0x0;_0x6fe55a{}\s\\|]/g,'-');_0x2ebf02(null,util[_0x4032('0x21')](_0x4032('0x22'),path[_0x4032('0x23')](_0x27cf0a['originalname'],path[_0x4032('0x24')](_0x27cf0a[_0x4032('0x1f')])),Date[_0x4032('0x25')](),path[_0x4032('0x24')](_0x27cf0a[_0x4032('0x1f')])));}})});router['post'](_0x4032('0x26'),upload[_0x4032('0x27')](_0x4032('0x28')),controller[_0x4032('0x29')]);var upload=multer({'storage':multer[_0x4032('0x1c')]({'destination':function(_0x472107,_0x2a5860,_0x162c6c){_0x162c6c(null,path[_0x4032('0x2a')](config['root'],_0x4032('0x1e')));},'filename':function(_0xc61802,_0x25acad,_0xb518b0){_0x25acad[_0x4032('0x1f')]=_0x25acad[_0x4032('0x1f')][_0x4032('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xb518b0(null,util[_0x4032('0x21')](_0x4032('0x22'),path[_0x4032('0x23')](_0x25acad['originalname'],path[_0x4032('0x24')](_0x25acad[_0x4032('0x1f')])),Date[_0x4032('0x25')](),path['extname'](_0x25acad[_0x4032('0x1f')])));}})});router['post'](_0x4032('0x2b'),upload[_0x4032('0x27')](_0x4032('0x28')),controller[_0x4032('0x2c')]);router[_0x4032('0x17')](_0x4032('0x2d'),auth[_0x4032('0xb')](),controller['import']);router[_0x4032('0x2e')](_0x4032('0xa'),auth[_0x4032('0xb')](),controller[_0x4032('0x2f')]);router[_0x4032('0x30')](_0x4032('0xa'),auth[_0x4032('0xb')](),controller[_0x4032('0x31')]);module['exports']=router; \ No newline at end of file +var _0x1d53=['/merge','create','/:id/tags','setTags','diskStorage','root','server/files/tmp','originalname','format','%s-%s%s','extname','now','single','replace','basename','/upload','upload','/upload/:id','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post'];(function(_0x4af5d9,_0x1198c8){var _0xf6a1fd=function(_0x4db7a7){while(--_0x4db7a7){_0x4af5d9['push'](_0x4af5d9['shift']());}};_0xf6a1fd(++_0x1198c8);}(_0x1d53,0x18e));var _0x31d5=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x1d53[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0x31d5('0x0'));var util=require(_0x31d5('0x1'));var path=require(_0x31d5('0x2'));var timeout=require(_0x31d5('0x3'));var express=require(_0x31d5('0x4'));var router=express[_0x31d5('0x5')]();var fs_extra=require(_0x31d5('0x6'));var auth=require(_0x31d5('0x7'));var interaction=require(_0x31d5('0x8'));var config=require(_0x31d5('0x9'));var controller=require('./cmContact.controller');router[_0x31d5('0xa')]('/',auth[_0x31d5('0xb')](),controller['index']);router['get'](_0x31d5('0xc'),auth[_0x31d5('0xb')](),controller[_0x31d5('0xd')]);router[_0x31d5('0xa')](_0x31d5('0xe'),auth[_0x31d5('0xb')](),controller[_0x31d5('0xf')]);router['get']('/:id/tags',auth['isAuthenticated'](),controller['getTags']);router[_0x31d5('0xa')](_0x31d5('0x10'),auth['isAuthenticated'](),controller['getHoppers']);router['get'](_0x31d5('0x11'),auth['isAuthenticated'](),controller[_0x31d5('0x12')]);router[_0x31d5('0xa')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x31d5('0x13')]);router[_0x31d5('0xa')](_0x31d5('0x14'),auth['isAuthenticated'](),controller[_0x31d5('0x15')]);router[_0x31d5('0xa')](_0x31d5('0x16'),auth[_0x31d5('0xb')](),controller[_0x31d5('0x17')]);router[_0x31d5('0x18')](_0x31d5('0x19'),auth[_0x31d5('0xb')](),controller['merge']);router[_0x31d5('0x18')]('/',auth[_0x31d5('0xb')](),controller[_0x31d5('0x1a')]);router['post']('/create_many',auth[_0x31d5('0xb')](),controller['bulkCreate']);router[_0x31d5('0x18')](_0x31d5('0x1b'),auth['isAuthenticated'](),controller[_0x31d5('0x1c')]);var upload=multer({'storage':multer[_0x31d5('0x1d')]({'destination':function(_0x4e56a6,_0x4c371d,_0x3ce822){_0x3ce822(null,path['join'](config[_0x31d5('0x1e')],_0x31d5('0x1f')));},'filename':function(_0x47e88b,_0x25ff11,_0x515dbd){_0x25ff11[_0x31d5('0x20')]=_0x25ff11[_0x31d5('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x515dbd(null,util[_0x31d5('0x21')](_0x31d5('0x22'),path['basename'](_0x25ff11[_0x31d5('0x20')],path[_0x31d5('0x23')](_0x25ff11['originalname'])),Date[_0x31d5('0x24')](),path[_0x31d5('0x23')](_0x25ff11[_0x31d5('0x20')])));}})});router['post']('/csv',upload[_0x31d5('0x25')]('file'),controller['uploadCsv']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2c0c3a,_0x2915ce,_0x28ae00){_0x28ae00(null,path['join'](config[_0x31d5('0x1e')],_0x31d5('0x1f')));},'filename':function(_0x117084,_0x59e776,_0x32acca){_0x59e776['originalname']=_0x59e776[_0x31d5('0x20')][_0x31d5('0x26')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x32acca(null,util[_0x31d5('0x21')](_0x31d5('0x22'),path[_0x31d5('0x27')](_0x59e776[_0x31d5('0x20')],path['extname'](_0x59e776['originalname'])),Date[_0x31d5('0x24')](),path['extname'](_0x59e776[_0x31d5('0x20')])));}})});router[_0x31d5('0x18')](_0x31d5('0x28'),upload[_0x31d5('0x25')]('file'),controller[_0x31d5('0x29')]);router['post'](_0x31d5('0x2a'),auth[_0x31d5('0xb')](),controller['import']);router[_0x31d5('0x2b')](_0x31d5('0xe'),auth[_0x31d5('0xb')](),controller['update']);router[_0x31d5('0x2c')](_0x31d5('0xe'),auth[_0x31d5('0xb')](),controller[_0x31d5('0x2d')]);module[_0x31d5('0x2e')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 2f9323f..377f464 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 _0x8d1b=['getDataValue','alias','STRING','name','TEXT','type','select','values','isArray','setDataValue','stringify','BOOLEAN','ENUM','voice','lodash'];(function(_0x43982c,_0x24b7b4){var _0x531ee0=function(_0x4ff803){while(--_0x4ff803){_0x43982c['push'](_0x43982c['shift']());}};_0x531ee0(++_0x24b7b4);}(_0x8d1b,0x149));var _0xb8d1=function(_0x3cd4fd,_0x3df44a){_0x3cd4fd=_0x3cd4fd-0x0;var _0x28c0d1=_0x8d1b[_0x3cd4fd];return _0x28c0d1;};'use strict';var Sequelize=require('sequelize');var _=require(_0xb8d1('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x315b05){return this[_0xb8d1('0x1')](_0xb8d1('0x2'));}},'alias':{'type':Sequelize[_0xb8d1('0x3')],'allowNull':![],'set':function(_0x211014){this['setDataValue']('alias',_0x211014?_0x211014:this['getDataValue'](_0xb8d1('0x4')));}},'type':{'type':Sequelize[_0xb8d1('0x3')],'allowNull':![]},'values':{'type':Sequelize[_0xb8d1('0x5')]('long'),'get':function(){if(this[_0xb8d1('0x1')](_0xb8d1('0x6'))===_0xb8d1('0x7')){return JSON['parse'](this['getDataValue'](_0xb8d1('0x8')));}else{return this[_0xb8d1('0x1')](_0xb8d1('0x8'));}},'set':function(_0x2b9eb5){if(Array[_0xb8d1('0x9')](_0x2b9eb5)){this[_0xb8d1('0xa')](_0xb8d1('0x8'),JSON[_0xb8d1('0xb')](_0x2b9eb5));}else{this['setDataValue'](_0xb8d1('0x8'),_0x2b9eb5);}}},'required':{'type':Sequelize[_0xb8d1('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0xb8d1('0xd')](_0xb8d1('0xe'))}}; \ No newline at end of file +var _0xdb55=['VIRTUAL','getDataValue','alias','STRING','setDataValue','name','long','type','select','parse','values','stringify','BOOLEAN','ENUM','voice','sequelize','lodash'];(function(_0x37568d,_0x5b028e){var _0x29d103=function(_0x263aa0){while(--_0x263aa0){_0x37568d['push'](_0x37568d['shift']());}};_0x29d103(++_0x5b028e);}(_0xdb55,0x11f));var _0x5db5=function(_0x5a0c2e,_0x3b817c){_0x5a0c2e=_0x5a0c2e-0x0;var _0x5b73d7=_0xdb55[_0x5a0c2e];return _0x5b73d7;};'use strict';var Sequelize=require(_0x5db5('0x0'));var _=require(_0x5db5('0x1'));module['exports']={'name':{'type':Sequelize[_0x5db5('0x2')],'get':function(_0x5e584d){return this[_0x5db5('0x3')](_0x5db5('0x4'));}},'alias':{'type':Sequelize[_0x5db5('0x5')],'allowNull':![],'set':function(_0x1c2a36){this[_0x5db5('0x6')](_0x5db5('0x4'),_0x1c2a36?_0x1c2a36:this['getDataValue'](_0x5db5('0x7')));}},'type':{'type':Sequelize[_0x5db5('0x5')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x5db5('0x8')),'get':function(){if(this['getDataValue'](_0x5db5('0x9'))===_0x5db5('0xa')){return JSON[_0x5db5('0xb')](this[_0x5db5('0x3')](_0x5db5('0xc')));}else{return this['getDataValue'](_0x5db5('0xc'));}},'set':function(_0x285a0d){if(Array['isArray'](_0x285a0d)){this[_0x5db5('0x6')](_0x5db5('0xc'),JSON[_0x5db5('0xd')](_0x285a0d));}else{this[_0x5db5('0x6')](_0x5db5('0xc'),_0x285a0d);}}},'required':{'type':Sequelize[_0x5db5('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x5db5('0xf')](_0x5db5('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 7eddb88..74bac41 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 _0xe174=['sequelize','transaction','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cm_contacts','format','cf_%d','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','destroy','then','stack','name','index','map','rawAttributes','fieldName','type','key','differenceBy','query','filters','intersection','model','attributes','fields','length','nolimit','sort','pick','filter','where','merge','options','CmCustomField','includeAll','include','findAll','rows','catch','show','params','keys','update','body','find'];(function(_0x4640ef,_0x2d46d2){var _0xb6c471=function(_0x4db81e){while(--_0x4db81e){_0x4640ef['push'](_0x4640ef['shift']());}};_0xb6c471(++_0x2d46d2);}(_0xe174,0x64));var _0x4e17=function(_0x2ccde5,_0x475c21){_0x2ccde5=_0x2ccde5-0x0;var _0x29561d=_0xe174[_0x2ccde5];return _0x29561d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4e17('0x0'));var zipdir=require(_0x4e17('0x1'));var jsonpatch=require(_0x4e17('0x2'));var rp=require(_0x4e17('0x3'));var moment=require(_0x4e17('0x4'));var BPromise=require(_0x4e17('0x5'));var Mustache=require('mustache');var util=require(_0x4e17('0x6'));var path=require(_0x4e17('0x7'));var sox=require(_0x4e17('0x8'));var csv=require(_0x4e17('0x9'));var ejs=require(_0x4e17('0xa'));var fs=require('fs');var fs_extra=require(_0x4e17('0xb'));var _=require('lodash');var squel=require(_0x4e17('0xc'));var crypto=require(_0x4e17('0xd'));var jsforce=require(_0x4e17('0xe'));var deskjs=require(_0x4e17('0xf'));var toCsv=require(_0x4e17('0x9'));var querystring=require(_0x4e17('0x10'));var Papa=require(_0x4e17('0x11'));var Redis=require(_0x4e17('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4e17('0x13'));var hardwareService=require(_0x4e17('0x14'));var logger=require(_0x4e17('0x15'))(_0x4e17('0x16'));var utils=require(_0x4e17('0x17'));var config=require(_0x4e17('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4e17('0x19'))['db'];function respondWithStatusCode(_0x171359,_0x46862d){_0x46862d=_0x46862d||0xcc;return function(_0xa6783c){if(_0xa6783c){return _0x171359[_0x4e17('0x1a')](_0x46862d);}return _0x171359['status'](_0x46862d)[_0x4e17('0x1b')]();};}function respondWithResult(_0x146d69,_0x205f73){_0x205f73=_0x205f73||0xc8;return function(_0xc9103){if(_0xc9103){return _0x146d69[_0x4e17('0x1c')](_0x205f73)['json'](_0xc9103);}};}function respondWithFilteredResult(_0x196b04,_0x25b334){return function(_0x157d01){if(_0x157d01){var _0x4c7827=typeof _0x25b334['offset']===_0x4e17('0x1d')&&typeof _0x25b334[_0x4e17('0x1e')]===_0x4e17('0x1d');var _0x1a8930=_0x157d01[_0x4e17('0x1f')];var _0x1a9944=_0x4c7827?0x0:_0x25b334[_0x4e17('0x20')];var _0x57c537=_0x4c7827?_0x157d01['count']:_0x25b334[_0x4e17('0x20')]+_0x25b334['limit'];var _0x3f0cca;if(_0x57c537>=_0x1a8930){_0x57c537=_0x1a8930;_0x3f0cca=0xc8;}else{_0x3f0cca=0xce;}_0x196b04[_0x4e17('0x1c')](_0x3f0cca);return _0x196b04[_0x4e17('0x21')](_0x4e17('0x22'),_0x1a9944+'-'+_0x57c537+'/'+_0x1a8930)[_0x4e17('0x23')](_0x157d01);}return null;};}function patchUpdates(_0x529e4d){return function(_0x1847ec){try{jsonpatch[_0x4e17('0x24')](_0x1847ec,_0x529e4d,!![]);}catch(_0x2c238a){return BPromise['reject'](_0x2c238a);}return _0x1847ec['save']();};}function saveUpdates(_0xfa3de8,_0x754fcd){return function(_0xc10348){if(_0xc10348){return _0xc10348['update'](_0xfa3de8)['then'](function(_0x25ef28){return _0x25ef28;});}return null;};}function removeEntity(_0x162b60,_0x3a9e4f){return function(_0x3b5f10){if(_0x3b5f10){return _0x3b5f10[_0x4e17('0x25')]()[_0x4e17('0x26')](function(){_0x162b60[_0x4e17('0x1c')](0xcc)[_0x4e17('0x1b')]();});}};}function handleEntityNotFound(_0x4ba2c3,_0x476a6a){return function(_0x4baae0){if(!_0x4baae0){_0x4ba2c3[_0x4e17('0x1a')](0x194);}return _0x4baae0;};}function handleError(_0x3eb7fe,_0x20204d){_0x20204d=_0x20204d||0x1f4;return function(_0x3aa862){logger['error'](_0x3aa862[_0x4e17('0x27')]);if(_0x3aa862[_0x4e17('0x28')]){delete _0x3aa862[_0x4e17('0x28')];}_0x3eb7fe[_0x4e17('0x1c')](_0x20204d)['send'](_0x3aa862);};}exports[_0x4e17('0x29')]=function(_0xe3ecf8,_0x5ebdeb){var _0x41b295={},_0x499b1b={},_0x5a5c5a={'count':0x0,'rows':[]};var _0x5a55b3=_[_0x4e17('0x2a')](db['CmCustomField'][_0x4e17('0x2b')],function(_0x2a1633){return{'name':_0x2a1633[_0x4e17('0x2c')],'type':_0x2a1633[_0x4e17('0x2d')][_0x4e17('0x2e')]};});_0x499b1b['model']=_[_0x4e17('0x2f')](_[_0x4e17('0x2a')](_0x5a55b3,_0x4e17('0x28')),[_0x4e17('0x28')]);_0x499b1b[_0x4e17('0x30')]=_['keys'](_0xe3ecf8[_0x4e17('0x30')]);_0x499b1b[_0x4e17('0x31')]=_[_0x4e17('0x32')](_0x499b1b[_0x4e17('0x33')],_0x499b1b[_0x4e17('0x30')]);_0x41b295[_0x4e17('0x34')]=_[_0x4e17('0x32')](_0x499b1b[_0x4e17('0x33')],qs['fields'](_0xe3ecf8['query'][_0x4e17('0x35')]));_0x41b295[_0x4e17('0x34')]=_0x41b295[_0x4e17('0x34')][_0x4e17('0x36')]?_0x41b295[_0x4e17('0x34')]:_0x499b1b['model'];if(!_0xe3ecf8[_0x4e17('0x30')]['hasOwnProperty'](_0x4e17('0x37'))){_0x41b295[_0x4e17('0x1e')]=qs[_0x4e17('0x1e')](_0xe3ecf8[_0x4e17('0x30')][_0x4e17('0x1e')]);_0x41b295[_0x4e17('0x20')]=qs['offset'](_0xe3ecf8[_0x4e17('0x30')][_0x4e17('0x20')]);}_0x41b295['order']=qs[_0x4e17('0x38')](_0xe3ecf8[_0x4e17('0x30')]['sort']);_0x41b295['where']=qs[_0x4e17('0x31')](_[_0x4e17('0x39')](_0xe3ecf8[_0x4e17('0x30')],_0x499b1b[_0x4e17('0x31')]),_0x5a55b3);if(_0xe3ecf8[_0x4e17('0x30')][_0x4e17('0x3a')]){_0x41b295[_0x4e17('0x3b')]=_[_0x4e17('0x3c')](_0x41b295[_0x4e17('0x3b')],{'$or':_[_0x4e17('0x2a')](_0x5a55b3,function(_0x273e08){if(_0x273e08[_0x4e17('0x2d')]!=='VIRTUAL'){var _0x200813={};_0x200813[_0x273e08[_0x4e17('0x28')]]={'$like':'%'+_0xe3ecf8[_0x4e17('0x30')][_0x4e17('0x3a')]+'%'};return _0x200813;}})});}_0x41b295=_[_0x4e17('0x3c')]({},_0x41b295,_0xe3ecf8[_0x4e17('0x3d')]);var _0x3d9897={'where':_0x41b295[_0x4e17('0x3b')]};return db[_0x4e17('0x3e')][_0x4e17('0x1f')](_0x3d9897)['then'](function(_0x2fd242){_0x5a5c5a[_0x4e17('0x1f')]=_0x2fd242;if(_0xe3ecf8[_0x4e17('0x30')][_0x4e17('0x3f')]){_0x41b295[_0x4e17('0x40')]=[{'all':!![]}];}return db[_0x4e17('0x3e')][_0x4e17('0x41')](_0x41b295);})[_0x4e17('0x26')](function(_0x6f369){_0x5a5c5a[_0x4e17('0x42')]=_0x6f369;return _0x5a5c5a;})[_0x4e17('0x26')](respondWithFilteredResult(_0x5ebdeb,_0x41b295))[_0x4e17('0x43')](handleError(_0x5ebdeb,null));};exports[_0x4e17('0x44')]=function(_0xc96994,_0x552d99){var _0x41b047={'raw':!![],'where':{'id':_0xc96994[_0x4e17('0x45')]['id']}},_0x5bc864={};_0x5bc864[_0x4e17('0x33')]=_[_0x4e17('0x46')](db[_0x4e17('0x3e')]['rawAttributes']);_0x5bc864['query']=_[_0x4e17('0x46')](_0xc96994[_0x4e17('0x30')]);_0x5bc864['filters']=_[_0x4e17('0x32')](_0x5bc864['model'],_0x5bc864[_0x4e17('0x30')]);_0x41b047[_0x4e17('0x34')]=_['intersection'](_0x5bc864[_0x4e17('0x33')],qs[_0x4e17('0x35')](_0xc96994[_0x4e17('0x30')][_0x4e17('0x35')]));_0x41b047[_0x4e17('0x34')]=_0x41b047[_0x4e17('0x34')]['length']?_0x41b047[_0x4e17('0x34')]:_0x5bc864[_0x4e17('0x33')];if(_0xc96994[_0x4e17('0x30')][_0x4e17('0x3f')]){_0x41b047[_0x4e17('0x40')]=[{'all':!![]}];}_0x41b047=_[_0x4e17('0x3c')]({},_0x41b047,_0xc96994[_0x4e17('0x3d')]);return db[_0x4e17('0x3e')]['find'](_0x41b047)['then'](handleEntityNotFound(_0x552d99,null))[_0x4e17('0x26')](respondWithResult(_0x552d99,null))[_0x4e17('0x43')](handleError(_0x552d99,null));};exports[_0x4e17('0x47')]=function(_0x23feef,_0xc01251){if(_0x23feef[_0x4e17('0x48')]['id']){delete _0x23feef[_0x4e17('0x48')]['id'];}return db[_0x4e17('0x3e')][_0x4e17('0x49')]({'where':{'id':_0x23feef['params']['id']}})[_0x4e17('0x26')](handleEntityNotFound(_0xc01251,null))['then'](saveUpdates(_0x23feef[_0x4e17('0x48')],null))[_0x4e17('0x26')](respondWithResult(_0xc01251,null))['catch'](handleError(_0xc01251,null));};exports['destroy']=function(_0x476c99,_0x1860ff){return db[_0x4e17('0x3e')][_0x4e17('0x49')]({'where':{'id':_0x476c99[_0x4e17('0x45')]['id']}})[_0x4e17('0x26')](handleEntityNotFound(_0x1860ff,null))[_0x4e17('0x26')](removeEntity(_0x1860ff,null))[_0x4e17('0x43')](handleError(_0x1860ff,null));};exports['create']=function(_0x1df1ae,_0x5da83f){var _0x219f54;return db[_0x4e17('0x4a')][_0x4e17('0x4b')](function(_0x377fb3){return db['CmCustomField']['create'](_0x1df1ae[_0x4e17('0x48')],{'transaction':_0x377fb3})['then'](function(_0x51aacc){_0x219f54=_0x51aacc;var _0x47c574={'type':db[_0x4e17('0x4c')][_0x4e17('0x4d')],'transaction':_0x377fb3};switch(_0x1df1ae[_0x4e17('0x48')][_0x4e17('0x2d')]){case _0x4e17('0x4e'):_0x47c574[_0x4e17('0x2d')]=db[_0x4e17('0x4c')][_0x4e17('0x4d')];break;case'number':_0x47c574['type']=db['Sequelize'][_0x4e17('0x4f')];break;case _0x4e17('0x50'):_0x47c574[_0x4e17('0x2d')]=db[_0x4e17('0x4c')][_0x4e17('0x51')];_0x47c574[_0x4e17('0x52')]=![];break;default:}return db[_0x4e17('0x4a')][_0x4e17('0x53')]['addColumn'](_0x4e17('0x54'),util[_0x4e17('0x55')](_0x4e17('0x56'),_0x219f54['id']),_0x47c574);})['then'](function(){return _0x219f54;});})['then'](respondWithResult(_0x5da83f,0xc9))['catch'](handleError(_0x5da83f,null));}; \ No newline at end of file +var _0xf1f6=['differenceBy','query','keys','filters','intersection','model','fields','attributes','nolimit','where','filter','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','merge','find','body','create','sequelize','transaction','Sequelize','TEXT','text','number','switch','BOOLEAN','addColumn','cm_contacts','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','index','CmCustomField','rawAttributes','fieldName','key'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0xf1f6,0x7a));var _0x6f1f=function(_0x5d5ba8,_0x41db3d){_0x5d5ba8=_0x5d5ba8-0x0;var _0x56602b=_0xf1f6[_0x5d5ba8];return _0x56602b;};'use strict';var emlformat=require(_0x6f1f('0x0'));var rimraf=require(_0x6f1f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f1f('0x2'));var rp=require(_0x6f1f('0x3'));var moment=require(_0x6f1f('0x4'));var BPromise=require(_0x6f1f('0x5'));var Mustache=require(_0x6f1f('0x6'));var util=require(_0x6f1f('0x7'));var path=require(_0x6f1f('0x8'));var sox=require(_0x6f1f('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6f1f('0xa'));var _=require(_0x6f1f('0xb'));var squel=require(_0x6f1f('0xc'));var crypto=require(_0x6f1f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6f1f('0xe'));var toCsv=require(_0x6f1f('0xf'));var querystring=require(_0x6f1f('0x10'));var Papa=require(_0x6f1f('0x11'));var Redis=require(_0x6f1f('0x12'));var authService=require(_0x6f1f('0x13'));var qs=require(_0x6f1f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6f1f('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x6f1f('0x16'));var config=require(_0x6f1f('0x17'));var licenseUtil=require(_0x6f1f('0x18'));var db=require(_0x6f1f('0x19'))['db'];function respondWithStatusCode(_0x47da3d,_0xc987ee){_0xc987ee=_0xc987ee||0xcc;return function(_0xfd6d23){if(_0xfd6d23){return _0x47da3d['sendStatus'](_0xc987ee);}return _0x47da3d[_0x6f1f('0x1a')](_0xc987ee)['end']();};}function respondWithResult(_0x1d90c2,_0x440883){_0x440883=_0x440883||0xc8;return function(_0x192f05){if(_0x192f05){return _0x1d90c2['status'](_0x440883)[_0x6f1f('0x1b')](_0x192f05);}};}function respondWithFilteredResult(_0x418e5f,_0x57d9b7){return function(_0x31efcd){if(_0x31efcd){var _0x2f5a44=typeof _0x57d9b7[_0x6f1f('0x1c')]==='undefined'&&typeof _0x57d9b7[_0x6f1f('0x1d')]===_0x6f1f('0x1e');var _0x24c72f=_0x31efcd[_0x6f1f('0x1f')];var _0x52c7fe=_0x2f5a44?0x0:_0x57d9b7[_0x6f1f('0x1c')];var _0x1b4e4b=_0x2f5a44?_0x31efcd['count']:_0x57d9b7[_0x6f1f('0x1c')]+_0x57d9b7[_0x6f1f('0x1d')];var _0x246ad2;if(_0x1b4e4b>=_0x24c72f){_0x1b4e4b=_0x24c72f;_0x246ad2=0xc8;}else{_0x246ad2=0xce;}_0x418e5f[_0x6f1f('0x1a')](_0x246ad2);return _0x418e5f[_0x6f1f('0x20')](_0x6f1f('0x21'),_0x52c7fe+'-'+_0x1b4e4b+'/'+_0x24c72f)[_0x6f1f('0x1b')](_0x31efcd);}return null;};}function patchUpdates(_0x54ca35){return function(_0x40f4ca){try{jsonpatch[_0x6f1f('0x22')](_0x40f4ca,_0x54ca35,!![]);}catch(_0x27a08a){return BPromise[_0x6f1f('0x23')](_0x27a08a);}return _0x40f4ca['save']();};}function saveUpdates(_0x44b243,_0xce7e63){return function(_0x90e67c){if(_0x90e67c){return _0x90e67c[_0x6f1f('0x24')](_0x44b243)[_0x6f1f('0x25')](function(_0x3b0e24){return _0x3b0e24;});}return null;};}function removeEntity(_0x1b64f2,_0xb4bc09){return function(_0xabec5c){if(_0xabec5c){return _0xabec5c[_0x6f1f('0x26')]()['then'](function(){_0x1b64f2[_0x6f1f('0x1a')](0xcc)[_0x6f1f('0x27')]();});}};}function handleEntityNotFound(_0x108441,_0xa0f39){return function(_0x5478d3){if(!_0x5478d3){_0x108441[_0x6f1f('0x28')](0x194);}return _0x5478d3;};}function handleError(_0x65ed92,_0x5a0157){_0x5a0157=_0x5a0157||0x1f4;return function(_0x3c9bd6){logger[_0x6f1f('0x29')](_0x3c9bd6[_0x6f1f('0x2a')]);if(_0x3c9bd6[_0x6f1f('0x2b')]){delete _0x3c9bd6['name'];}_0x65ed92[_0x6f1f('0x1a')](_0x5a0157)[_0x6f1f('0x2c')](_0x3c9bd6);};}exports[_0x6f1f('0x2d')]=function(_0xd4d03,_0x22fca5){var _0x31f66e={},_0x4cf185={},_0x52b6a0={'count':0x0,'rows':[]};var _0x4ed822=_['map'](db[_0x6f1f('0x2e')][_0x6f1f('0x2f')],function(_0x8c6738){return{'name':_0x8c6738[_0x6f1f('0x30')],'type':_0x8c6738['type'][_0x6f1f('0x31')]};});_0x4cf185['model']=_[_0x6f1f('0x32')](_['map'](_0x4ed822,_0x6f1f('0x2b')),[_0x6f1f('0x2b')]);_0x4cf185[_0x6f1f('0x33')]=_[_0x6f1f('0x34')](_0xd4d03[_0x6f1f('0x33')]);_0x4cf185[_0x6f1f('0x35')]=_[_0x6f1f('0x36')](_0x4cf185[_0x6f1f('0x37')],_0x4cf185[_0x6f1f('0x33')]);_0x31f66e['attributes']=_[_0x6f1f('0x36')](_0x4cf185['model'],qs[_0x6f1f('0x38')](_0xd4d03[_0x6f1f('0x33')]['fields']));_0x31f66e[_0x6f1f('0x39')]=_0x31f66e['attributes']['length']?_0x31f66e['attributes']:_0x4cf185[_0x6f1f('0x37')];if(!_0xd4d03['query']['hasOwnProperty'](_0x6f1f('0x3a'))){_0x31f66e[_0x6f1f('0x1d')]=qs[_0x6f1f('0x1d')](_0xd4d03[_0x6f1f('0x33')]['limit']);_0x31f66e[_0x6f1f('0x1c')]=qs[_0x6f1f('0x1c')](_0xd4d03['query'][_0x6f1f('0x1c')]);}_0x31f66e['order']=qs['sort'](_0xd4d03[_0x6f1f('0x33')]['sort']);_0x31f66e[_0x6f1f('0x3b')]=qs[_0x6f1f('0x35')](_['pick'](_0xd4d03['query'],_0x4cf185[_0x6f1f('0x35')]),_0x4ed822);if(_0xd4d03[_0x6f1f('0x33')][_0x6f1f('0x3c')]){_0x31f66e[_0x6f1f('0x3b')]=_['merge'](_0x31f66e[_0x6f1f('0x3b')],{'$or':_['map'](_0x4ed822,function(_0x5a0f48){if(_0x5a0f48[_0x6f1f('0x3d')]!==_0x6f1f('0x3e')){var _0x3b3e74={};_0x3b3e74[_0x5a0f48[_0x6f1f('0x2b')]]={'$like':'%'+_0xd4d03[_0x6f1f('0x33')][_0x6f1f('0x3c')]+'%'};return _0x3b3e74;}})});}_0x31f66e=_['merge']({},_0x31f66e,_0xd4d03[_0x6f1f('0x3f')]);var _0x4a29ff={'where':_0x31f66e[_0x6f1f('0x3b')]};return db[_0x6f1f('0x2e')][_0x6f1f('0x1f')](_0x4a29ff)['then'](function(_0x18aacc){_0x52b6a0['count']=_0x18aacc;if(_0xd4d03[_0x6f1f('0x33')][_0x6f1f('0x40')]){_0x31f66e['include']=[{'all':!![]}];}return db[_0x6f1f('0x2e')][_0x6f1f('0x41')](_0x31f66e);})[_0x6f1f('0x25')](function(_0x168263){_0x52b6a0[_0x6f1f('0x42')]=_0x168263;return _0x52b6a0;})[_0x6f1f('0x25')](respondWithFilteredResult(_0x22fca5,_0x31f66e))[_0x6f1f('0x43')](handleError(_0x22fca5,null));};exports[_0x6f1f('0x44')]=function(_0x490405,_0x43a690){var _0x2bff58={'raw':!![],'where':{'id':_0x490405[_0x6f1f('0x45')]['id']}},_0x1919fe={};_0x1919fe[_0x6f1f('0x37')]=_['keys'](db['CmCustomField'][_0x6f1f('0x2f')]);_0x1919fe[_0x6f1f('0x33')]=_['keys'](_0x490405[_0x6f1f('0x33')]);_0x1919fe[_0x6f1f('0x35')]=_[_0x6f1f('0x36')](_0x1919fe[_0x6f1f('0x37')],_0x1919fe[_0x6f1f('0x33')]);_0x2bff58['attributes']=_['intersection'](_0x1919fe[_0x6f1f('0x37')],qs[_0x6f1f('0x38')](_0x490405[_0x6f1f('0x33')][_0x6f1f('0x38')]));_0x2bff58['attributes']=_0x2bff58[_0x6f1f('0x39')][_0x6f1f('0x46')]?_0x2bff58[_0x6f1f('0x39')]:_0x1919fe[_0x6f1f('0x37')];if(_0x490405[_0x6f1f('0x33')][_0x6f1f('0x40')]){_0x2bff58[_0x6f1f('0x47')]=[{'all':!![]}];}_0x2bff58=_[_0x6f1f('0x48')]({},_0x2bff58,_0x490405['options']);return db[_0x6f1f('0x2e')][_0x6f1f('0x49')](_0x2bff58)[_0x6f1f('0x25')](handleEntityNotFound(_0x43a690,null))[_0x6f1f('0x25')](respondWithResult(_0x43a690,null))[_0x6f1f('0x43')](handleError(_0x43a690,null));};exports[_0x6f1f('0x24')]=function(_0x26e732,_0x385e7e){if(_0x26e732[_0x6f1f('0x4a')]['id']){delete _0x26e732[_0x6f1f('0x4a')]['id'];}return db[_0x6f1f('0x2e')][_0x6f1f('0x49')]({'where':{'id':_0x26e732[_0x6f1f('0x45')]['id']}})[_0x6f1f('0x25')](handleEntityNotFound(_0x385e7e,null))[_0x6f1f('0x25')](saveUpdates(_0x26e732[_0x6f1f('0x4a')],null))[_0x6f1f('0x25')](respondWithResult(_0x385e7e,null))[_0x6f1f('0x43')](handleError(_0x385e7e,null));};exports[_0x6f1f('0x26')]=function(_0x847eb3,_0x38e56d){return db[_0x6f1f('0x2e')][_0x6f1f('0x49')]({'where':{'id':_0x847eb3['params']['id']}})['then'](handleEntityNotFound(_0x38e56d,null))[_0x6f1f('0x25')](removeEntity(_0x38e56d,null))[_0x6f1f('0x43')](handleError(_0x38e56d,null));};exports[_0x6f1f('0x4b')]=function(_0x7747fc,_0x1a4d37){var _0x236420;return db[_0x6f1f('0x4c')][_0x6f1f('0x4d')](function(_0x4cdfe0){return db[_0x6f1f('0x2e')][_0x6f1f('0x4b')](_0x7747fc[_0x6f1f('0x4a')],{'transaction':_0x4cdfe0})['then'](function(_0x469a1b){_0x236420=_0x469a1b;var _0x16708c={'type':db[_0x6f1f('0x4e')][_0x6f1f('0x4f')],'transaction':_0x4cdfe0};switch(_0x7747fc[_0x6f1f('0x4a')]['type']){case _0x6f1f('0x50'):_0x16708c[_0x6f1f('0x3d')]=db[_0x6f1f('0x4e')][_0x6f1f('0x4f')];break;case _0x6f1f('0x51'):_0x16708c[_0x6f1f('0x3d')]=db['Sequelize']['INTEGER'];break;case _0x6f1f('0x52'):_0x16708c[_0x6f1f('0x3d')]=db[_0x6f1f('0x4e')][_0x6f1f('0x53')];_0x16708c['defaultValue']=![];break;default:}return db['sequelize']['queryInterface'][_0x6f1f('0x54')](_0x6f1f('0x55'),util['format']('cf_%d',_0x236420['id']),_0x16708c);})[_0x6f1f('0x25')](function(){return _0x236420;});})[_0x6f1f('0x25')](respondWithResult(_0x1a4d37,0xc9))[_0x6f1f('0x43')](handleError(_0x1a4d37,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 267c9e4..6293792 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 _0x627b=['../../config/environment','exports','define','CmCustomField','cm_custom_fields','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x2307fa,_0x266e5e){var _0x496486=function(_0x53466e){while(--_0x53466e){_0x2307fa['push'](_0x2307fa['shift']());}};_0x496486(++_0x266e5e);}(_0x627b,0xad));var _0xb627=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x627b[_0x8de54f];return _0x14cba4;};'use strict';var _=require(_0xb627('0x0'));var util=require(_0xb627('0x1'));var logger=require('../../config/logger')(_0xb627('0x2'));var moment=require('moment');var BPromise=require(_0xb627('0x3'));var rp=require(_0xb627('0x4'));var fs=require('fs');var path=require(_0xb627('0x5'));var rimraf=require(_0xb627('0x6'));var config=require(_0xb627('0x7'));var attributes=require('./cmCustomField.attributes');module[_0xb627('0x8')]=function(_0x172c51,_0xbca87){return _0x172c51[_0xb627('0x9')](_0xb627('0xa'),attributes,{'tableName':_0xb627('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb9f=['request-promise','path','define','cm_custom_fields','lodash','moment','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdb9f,0xd6));var _0xfdb9=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xdb9f[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0xfdb9('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xfdb9('0x1'));var BPromise=require(_0xfdb9('0x2'));var rp=require(_0xfdb9('0x3'));var fs=require('fs');var path=require(_0xfdb9('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module['exports']=function(_0x31fdb1,_0x3d90d9){return _0x31fdb1[_0xfdb9('0x5')]('CmCustomField',attributes,{'tableName':_0xfdb9('0x6'),'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 566a0b3..a176072 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 _0x2605=['../../config/environment','client','request','then','info','CmCustomField,\x20%s,\x20%s','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x334599,_0x4b1cfa){var _0x4cdff2=function(_0x297be7){while(--_0x297be7){_0x334599['push'](_0x334599['shift']());}};_0x4cdff2(++_0x4b1cfa);}(_0x2605,0xe8));var _0x5260=function(_0x8bb4c1,_0x2d6e53){_0x8bb4c1=_0x8bb4c1-0x0;var _0x67a6e1=_0x2605[_0x8bb4c1];return _0x67a6e1;};'use strict';var _=require('lodash');var util=require(_0x5260('0x0'));var moment=require(_0x5260('0x1'));var BPromise=require(_0x5260('0x2'));var rs=require(_0x5260('0x3'));var fs=require('fs');var Redis=require(_0x5260('0x4'));var db=require(_0x5260('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5260('0x6'))(_0x5260('0x7'));var config=require(_0x5260('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5260('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f0caf,_0x2b42fe,_0x34f117){return new BPromise(function(_0x9159d1,_0x1bd93e){return client[_0x5260('0xa')](_0x1f0caf,_0x34f117)[_0x5260('0xb')](function(_0x511dd8){logger[_0x5260('0xc')](_0x5260('0xd'),_0x2b42fe,'request\x20sent');logger['debug'](_0x5260('0xe'),_0x2b42fe,_0x5260('0xf'),JSON[_0x5260('0x10')](_0x511dd8));if(_0x511dd8[_0x5260('0x11')]){if(_0x511dd8[_0x5260('0x11')]['code']===0x1f4){logger[_0x5260('0x11')](_0x5260('0xd'),_0x2b42fe,_0x511dd8[_0x5260('0x11')]['message']);return _0x1bd93e(_0x511dd8['error'][_0x5260('0x12')]);}logger[_0x5260('0x11')](_0x5260('0xd'),_0x2b42fe,_0x511dd8[_0x5260('0x11')]['message']);return _0x9159d1(_0x511dd8['error'][_0x5260('0x12')]);}else{logger[_0x5260('0xc')](_0x5260('0xd'),_0x2b42fe,_0x5260('0xf'));_0x9159d1(_0x511dd8['result']['message']);}})[_0x5260('0x13')](function(_0x237713){logger[_0x5260('0x11')](_0x5260('0xd'),_0x2b42fe,_0x237713);_0x1bd93e(_0x237713);});});} \ No newline at end of file +var _0xe586=['catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x28b307,_0x31af52){var _0x6c737e=function(_0x276e9f){while(--_0x276e9f){_0x28b307['push'](_0x28b307['shift']());}};_0x6c737e(++_0x31af52);}(_0xe586,0x151));var _0x6e58=function(_0x7fba35,_0x53f667){_0x7fba35=_0x7fba35-0x0;var _0x11e5a4=_0xe586[_0x7fba35];return _0x11e5a4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6e58('0x0'));var BPromise=require(_0x6e58('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e58('0x2'));var db=require(_0x6e58('0x3'))['db'];var utils=require(_0x6e58('0x4'));var logger=require(_0x6e58('0x5'))(_0x6e58('0x6'));var config=require(_0x6e58('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6e58('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xdf019b,_0x27355e,_0x512a3b){return new BPromise(function(_0xac70b8,_0x4b43fb){return client[_0x6e58('0x9')](_0xdf019b,_0x512a3b)[_0x6e58('0xa')](function(_0x577c5e){logger['info'](_0x6e58('0xb'),_0x27355e,'request\x20sent');logger[_0x6e58('0xc')](_0x6e58('0xd'),_0x27355e,'request\x20sent',JSON[_0x6e58('0xe')](_0x577c5e));if(_0x577c5e['error']){if(_0x577c5e[_0x6e58('0xf')][_0x6e58('0x10')]===0x1f4){logger[_0x6e58('0xf')](_0x6e58('0xb'),_0x27355e,_0x577c5e[_0x6e58('0xf')][_0x6e58('0x11')]);return _0x4b43fb(_0x577c5e[_0x6e58('0xf')][_0x6e58('0x11')]);}logger['error']('CmCustomField,\x20%s,\x20%s',_0x27355e,_0x577c5e['error'][_0x6e58('0x11')]);return _0xac70b8(_0x577c5e[_0x6e58('0xf')][_0x6e58('0x11')]);}else{logger[_0x6e58('0x12')](_0x6e58('0xb'),_0x27355e,'request\x20sent');_0xac70b8(_0x577c5e[_0x6e58('0x13')][_0x6e58('0x11')]);}})[_0x6e58('0x14')](function(_0x326723){logger['error'](_0x6e58('0xb'),_0x27355e,_0x326723);_0x4b43fb(_0x326723);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 72d0c9c..fc72679 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 _0x72d2=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x212573,_0xb439b0){var _0x2dbb83=function(_0x5ebe85){while(--_0x5ebe85){_0x212573['push'](_0x212573['shift']());}};_0x2dbb83(++_0xb439b0);}(_0x72d2,0xb9));var _0x272d=function(_0xefb33e,_0x11bbb5){_0xefb33e=_0xefb33e-0x0;var _0x529db6=_0x72d2[_0xefb33e];return _0x529db6;};'use strict';var multer=require(_0x272d('0x0'));var util=require(_0x272d('0x1'));var path=require(_0x272d('0x2'));var timeout=require(_0x272d('0x3'));var express=require(_0x272d('0x4'));var router=express[_0x272d('0x5')]();var fs_extra=require(_0x272d('0x6'));var auth=require(_0x272d('0x7'));var interaction=require(_0x272d('0x8'));var config=require(_0x272d('0x9'));var controller=require(_0x272d('0xa'));router[_0x272d('0xb')]('/',auth[_0x272d('0xc')](),controller[_0x272d('0xd')]);router[_0x272d('0xb')](_0x272d('0xe'),auth[_0x272d('0xc')](),controller[_0x272d('0xf')]);router[_0x272d('0x10')]('/',auth[_0x272d('0xc')](),controller[_0x272d('0x11')]);router['put'](_0x272d('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x272d('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x272d('0x13')]);module[_0x272d('0x14')]=router; \ No newline at end of file +var _0x5e0c=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x4e84ee,_0x33504f){var _0x241920=function(_0x116b40){while(--_0x116b40){_0x4e84ee['push'](_0x4e84ee['shift']());}};_0x241920(++_0x33504f);}(_0x5e0c,0x19f));var _0xc5e0=function(_0x35863f,_0x4f3a04){_0x35863f=_0x35863f-0x0;var _0x35a567=_0x5e0c[_0x35863f];return _0x35a567;};'use strict';var multer=require('multer');var util=require(_0xc5e0('0x0'));var path=require(_0xc5e0('0x1'));var timeout=require(_0xc5e0('0x2'));var express=require(_0xc5e0('0x3'));var router=express[_0xc5e0('0x4')]();var fs_extra=require(_0xc5e0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc5e0('0x6'));var config=require(_0xc5e0('0x7'));var controller=require(_0xc5e0('0x8'));router[_0xc5e0('0x9')]('/',auth[_0xc5e0('0xa')](),controller['index']);router['get'](_0xc5e0('0xb'),auth['isAuthenticated'](),controller[_0xc5e0('0xc')]);router[_0xc5e0('0xd')]('/',auth[_0xc5e0('0xa')](),controller[_0xc5e0('0xe')]);router['put'](_0xc5e0('0xb'),auth['isAuthenticated'](),controller[_0xc5e0('0xf')]);router[_0xc5e0('0x10')](_0xc5e0('0xb'),auth[_0xc5e0('0xa')](),controller[_0xc5e0('0x11')]);module[_0xc5e0('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 7299a11..9318933 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 _0xb3dd=['BOOLEAN','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','sequelize','STRING'];(function(_0x5596b6,_0x52812e){var _0x4e6c56=function(_0x2ed9cf){while(--_0x2ed9cf){_0x5596b6['push'](_0x5596b6['shift']());}};_0x4e6c56(++_0x52812e);}(_0xb3dd,0xe6));var _0xdb3d=function(_0x358eb7,_0x1c89fc){_0x358eb7=_0x358eb7-0x0;var _0x498194=_0xb3dd[_0x358eb7];return _0x498194;};'use strict';var moment=require('moment');var Sequelize=require(_0xdb3d('0x0'));module['exports']={'phone':{'type':Sequelize[_0xdb3d('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0xdb3d('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xdb3d('0x3')],'defaultValue':moment()['format'](_0xdb3d('0x4'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xdb3d('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xdb3d('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xdb3d('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xdb3d('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xdb3d('0x7')},'UserId':{'type':Sequelize[_0xdb3d('0x5')]},'VoiceQueueId':{'type':Sequelize[_0xdb3d('0x5')],'unique':_0xdb3d('0x7')},'CampaignId':{'type':Sequelize[_0xdb3d('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xdb3d('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xdb3d('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xdb3d('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xdb3d('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0xefeb=['BOOLEAN','contactListQueue','sequelize','exports','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','UNSIGNED'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xefeb,0x110));var _0xbefe=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xefeb[_0x14add3];return _0x4a174f;};'use strict';var moment=require('moment');var Sequelize=require(_0xbefe('0x0'));module[_0xbefe('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xbefe('0x2')],'defaultValue':moment()['format'](_0xbefe('0x3'))},'countbusyretry':{'type':Sequelize[_0xbefe('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xbefe('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xbefe('0x4')](0x2)[_0xbefe('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xbefe('0x7')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xbefe('0x4')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xbefe('0x4')]},'VoiceQueueId':{'type':Sequelize[_0xbefe('0x4')],'unique':_0xbefe('0x8')},'CampaignId':{'type':Sequelize[_0xbefe('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xbefe('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xbefe('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xbefe('0x4')],'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 8827527..b044632 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 _0x049e=['where','filter','merge','name','options','includeAll','include','rows','catch','show','params','intersection','find','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','dataValues','updatedAt','statedesc','deleted','campaign','membername','UserId','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','queue','CmContact','ContactId','firstName','isNil','calleridname','lastName','CmHopperFinal','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','literal','DESC','scheduledAt','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmList','List','dialActive','getOpenContacts','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','json','reject','save','update','then','error','stack','index','map','CmHopper','rawAttributes','fieldName','type','key','model','query','keys','filters','concat','$and','$gt','$gte','$lt','$lte','$ne','$not','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x4d3dab,_0x37aff6){var _0x4bfe63=function(_0x1e10a7){while(--_0x1e10a7){_0x4d3dab['push'](_0x4d3dab['shift']());}};_0x4bfe63(++_0x37aff6);}(_0x049e,0x16a));var _0xe049=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0x049e[_0x38eb23];return _0x48506a;};'use strict';var emlformat=require(_0xe049('0x0'));var rimraf=require(_0xe049('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe049('0x2'));var rp=require('request-promise');var moment=require(_0xe049('0x3'));var BPromise=require(_0xe049('0x4'));var Mustache=require(_0xe049('0x5'));var util=require(_0xe049('0x6'));var path=require(_0xe049('0x7'));var sox=require('sox');var csv=require(_0xe049('0x8'));var ejs=require(_0xe049('0x9'));var fs=require('fs');var fs_extra=require(_0xe049('0xa'));var _=require(_0xe049('0xb'));var squel=require(_0xe049('0xc'));var crypto=require(_0xe049('0xd'));var jsforce=require(_0xe049('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe049('0x8'));var querystring=require(_0xe049('0xf'));var Papa=require(_0xe049('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe049('0x11'));var as=require(_0xe049('0x12'));var hardwareService=require(_0xe049('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe049('0x14'));var licenseUtil=require(_0xe049('0x15'));var db=require(_0xe049('0x16'))['db'];function respondWithStatusCode(_0x359931,_0x301c7e){_0x301c7e=_0x301c7e||0xcc;return function(_0x1021e7){if(_0x1021e7){return _0x359931[_0xe049('0x17')](_0x301c7e);}return _0x359931[_0xe049('0x18')](_0x301c7e)['end']();};}function respondWithResult(_0x20c286,_0x3f4a57){_0x3f4a57=_0x3f4a57||0xc8;return function(_0x3924a4){if(_0x3924a4){return _0x20c286[_0xe049('0x18')](_0x3f4a57)['json'](_0x3924a4);}};}function respondWithFilteredResult(_0x3a539b,_0xcc35b6){return function(_0x5c90fd){if(_0x5c90fd){var _0x388be0=typeof _0xcc35b6[_0xe049('0x19')]==='undefined'&&typeof _0xcc35b6[_0xe049('0x1a')]===_0xe049('0x1b');var _0x5d435b=_0x5c90fd[_0xe049('0x1c')];var _0x54c303=_0x388be0?0x0:_0xcc35b6['offset'];var _0x3cbbeb=_0x388be0?_0x5c90fd['count']:_0xcc35b6['offset']+_0xcc35b6[_0xe049('0x1a')];var _0x1092ec;if(_0x3cbbeb>=_0x5d435b){_0x3cbbeb=_0x5d435b;_0x1092ec=0xc8;}else{_0x1092ec=0xce;}_0x3a539b['status'](_0x1092ec);return _0x3a539b['set'](_0xe049('0x1d'),_0x54c303+'-'+_0x3cbbeb+'/'+_0x5d435b)[_0xe049('0x1e')](_0x5c90fd);}return null;};}function patchUpdates(_0x1d2f5b){return function(_0x430421){try{jsonpatch['apply'](_0x430421,_0x1d2f5b,!![]);}catch(_0x572f29){return BPromise[_0xe049('0x1f')](_0x572f29);}return _0x430421[_0xe049('0x20')]();};}function saveUpdates(_0x572a80,_0x36a03b){return function(_0x3f14eb){if(_0x3f14eb){return _0x3f14eb[_0xe049('0x21')](_0x572a80)['then'](function(_0x197358){return _0x197358;});}return null;};}function removeEntity(_0x3b0f54,_0x4c7492){return function(_0x4848c9){if(_0x4848c9){return _0x4848c9['destroy']()[_0xe049('0x22')](function(){_0x3b0f54['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1aafd1,_0x1efbbe){return function(_0x53620b){if(!_0x53620b){_0x1aafd1[_0xe049('0x17')](0x194);}return _0x53620b;};}function handleError(_0x181432,_0x3e5c7f){_0x3e5c7f=_0x3e5c7f||0x1f4;return function(_0x423ba4){logger[_0xe049('0x23')](_0x423ba4[_0xe049('0x24')]);if(_0x423ba4['name']){delete _0x423ba4['name'];}_0x181432[_0xe049('0x18')](_0x3e5c7f)['send'](_0x423ba4);};}exports[_0xe049('0x25')]=function(_0x495d33,_0x3c50c3){var _0x2b79dc={},_0x5adcd6={},_0x432a6e={'count':0x0,'rows':[]};var _0x364630=_[_0xe049('0x26')](db[_0xe049('0x27')][_0xe049('0x28')],function(_0x4055fc){return{'name':_0x4055fc[_0xe049('0x29')],'type':_0x4055fc[_0xe049('0x2a')][_0xe049('0x2b')]};});_0x5adcd6[_0xe049('0x2c')]=_[_0xe049('0x26')](_0x364630,'name');_0x5adcd6[_0xe049('0x2d')]=_[_0xe049('0x2e')](_0x495d33['query']);_0x5adcd6['filters']=_['intersection'](_0x5adcd6['model'],_0x5adcd6[_0xe049('0x2d')]);_0x5adcd6[_0xe049('0x2f')]=_[_0xe049('0x30')](_0x5adcd6[_0xe049('0x2f')],[_0xe049('0x31'),'$or',_0xe049('0x32'),_0xe049('0x33'),_0xe049('0x34'),_0xe049('0x35'),_0xe049('0x36'),'$eq',_0xe049('0x37'),'$between',_0xe049('0x38'),'$in',_0xe049('0x39'),_0xe049('0x3a'),_0xe049('0x3b'),_0xe049('0x3c'),_0xe049('0x3d'),_0xe049('0x3a'),_0xe049('0x3e'),_0xe049('0x3f'),_0xe049('0x40'),_0xe049('0x41')]);_0x2b79dc[_0xe049('0x42')]=_['intersection'](_0x5adcd6[_0xe049('0x2c')],qs[_0xe049('0x43')](_0x495d33[_0xe049('0x2d')][_0xe049('0x43')]));_0x2b79dc[_0xe049('0x42')]=_0x2b79dc[_0xe049('0x42')][_0xe049('0x44')]?_0x2b79dc[_0xe049('0x42')]:_0x5adcd6['model'];if(!_0x495d33[_0xe049('0x2d')][_0xe049('0x45')](_0xe049('0x46'))){_0x2b79dc[_0xe049('0x1a')]=qs[_0xe049('0x1a')](_0x495d33[_0xe049('0x2d')][_0xe049('0x1a')]);_0x2b79dc[_0xe049('0x19')]=qs[_0xe049('0x19')](_0x495d33[_0xe049('0x2d')]['offset']);}_0x2b79dc[_0xe049('0x47')]=qs[_0xe049('0x48')](_0x495d33[_0xe049('0x2d')]['sort']);_0x2b79dc[_0xe049('0x49')]=qs['filters'](_['pick'](_0x495d33[_0xe049('0x2d')],_0x5adcd6['filters']),_0x364630);if(_0x495d33[_0xe049('0x2d')][_0xe049('0x4a')]){_0x2b79dc[_0xe049('0x49')]=_[_0xe049('0x4b')](_0x2b79dc[_0xe049('0x49')],{'$or':_['map'](_0x364630,function(_0x4261da){if(_0x4261da[_0xe049('0x2a')]!=='VIRTUAL'){var _0x546137={};_0x546137[_0x4261da[_0xe049('0x4c')]]={'$like':'%'+_0x495d33[_0xe049('0x2d')][_0xe049('0x4a')]+'%'};return _0x546137;}})});}_0x2b79dc=_[_0xe049('0x4b')]({},_0x2b79dc,_0x495d33[_0xe049('0x4d')]);var _0x1d5da2={'where':_0x2b79dc['where']};return db[_0xe049('0x27')][_0xe049('0x1c')](_0x1d5da2)['then'](function(_0xf09c61){_0x432a6e[_0xe049('0x1c')]=_0xf09c61;if(_0x495d33[_0xe049('0x2d')][_0xe049('0x4e')]){_0x2b79dc[_0xe049('0x4f')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x2b79dc);})[_0xe049('0x22')](function(_0x3fcc2b){_0x432a6e[_0xe049('0x50')]=_0x3fcc2b;return _0x432a6e;})[_0xe049('0x22')](respondWithFilteredResult(_0x3c50c3,_0x2b79dc))[_0xe049('0x51')](handleError(_0x3c50c3,null));};exports[_0xe049('0x52')]=function(_0x4c7d34,_0x2bba8e){var _0xf260f0={'raw':!![],'where':{'id':_0x4c7d34[_0xe049('0x53')]['id']}},_0x5dadbf={};_0x5dadbf['model']=_[_0xe049('0x2e')](db['CmHopper'][_0xe049('0x28')]);_0x5dadbf['query']=_[_0xe049('0x2e')](_0x4c7d34[_0xe049('0x2d')]);_0x5dadbf[_0xe049('0x2f')]=_[_0xe049('0x54')](_0x5dadbf[_0xe049('0x2c')],_0x5dadbf['query']);_0xf260f0[_0xe049('0x42')]=_[_0xe049('0x54')](_0x5dadbf[_0xe049('0x2c')],qs[_0xe049('0x43')](_0x4c7d34[_0xe049('0x2d')][_0xe049('0x43')]));_0xf260f0[_0xe049('0x42')]=_0xf260f0[_0xe049('0x42')][_0xe049('0x44')]?_0xf260f0['attributes']:_0x5dadbf['model'];if(_0x4c7d34[_0xe049('0x2d')][_0xe049('0x4e')]){_0xf260f0[_0xe049('0x4f')]=[{'all':!![]}];}_0xf260f0=_[_0xe049('0x4b')]({},_0xf260f0,_0x4c7d34[_0xe049('0x4d')]);return db[_0xe049('0x27')][_0xe049('0x55')](_0xf260f0)[_0xe049('0x22')](handleEntityNotFound(_0x2bba8e,null))[_0xe049('0x22')](respondWithResult(_0x2bba8e,null))[_0xe049('0x51')](handleError(_0x2bba8e,null));};exports[_0xe049('0x56')]=function(_0x5f2c2b,_0x36346a){return db[_0xe049('0x27')][_0xe049('0x56')](_0x5f2c2b[_0xe049('0x57')],{})[_0xe049('0x22')](respondWithResult(_0x36346a,0xc9))[_0xe049('0x51')](handleError(_0x36346a,null));};exports[_0xe049('0x21')]=function(_0x4e5293,_0x4e34da){if(_0x4e5293['body']['id']){delete _0x4e5293[_0xe049('0x57')]['id'];}return db[_0xe049('0x27')]['find']({'where':{'id':_0x4e5293[_0xe049('0x53')]['id']}})[_0xe049('0x22')](handleEntityNotFound(_0x4e34da,null))[_0xe049('0x22')](saveUpdates(_0x4e5293[_0xe049('0x57')],null))['then'](respondWithResult(_0x4e34da,null))['catch'](handleError(_0x4e34da,null));};exports[_0xe049('0x58')]=function(_0x132a20,_0x4b3947){return db['CmHopper'][_0xe049('0x58')]()['then'](respondWithResult(_0x4b3947,null))[_0xe049('0x51')](handleError(_0x4b3947,null));};exports[_0xe049('0x59')]=function(_0x567c52,_0x6b2cf6){var _0x56b9d9;return db[_0xe049('0x27')][_0xe049('0x55')]({'where':{'id':_0x567c52['params']['id']}})[_0xe049('0x22')](handleEntityNotFound(_0x6b2cf6,null))[_0xe049('0x22')](function(_0x21c0dc){if(_0x21c0dc){return _0x21c0dc[_0xe049('0x59')]()[_0xe049('0x22')](function(_0x28beed){return _0x28beed;});}})[_0xe049('0x22')](function(_0x1be891){_0x56b9d9=_0x1be891;if(_0x1be891){if(_0x1be891[_0xe049('0x5a')]||_0x1be891[_0xe049('0x5b')]){return db[_0x1be891['VoiceQueueId']?_0xe049('0x5c'):_0xe049('0x5d')][_0xe049('0x55')]({'where':{'id':_0x1be891['VoiceQueueId']?_0x1be891[_0xe049('0x5a')]:_0x1be891[_0xe049('0x5b')]},'attributes':['id',_0xe049('0x4c')],'raw':!![]});}}})[_0xe049('0x22')](function(_0x1840b6){var _0x3609ad={};if(_0x1840b6){_[_0xe049('0x4b')](_0x3609ad,_['omit'](_0x56b9d9[_0xe049('0x5e')],['createdAt',_0xe049('0x5f'),'id']));_0x3609ad['state']=0x15;_0x3609ad[_0xe049('0x60')]=_0xe049('0x61');_0x3609ad[_0xe049('0x62')]=_0x1840b6[_0xe049('0x4c')];_0x3609ad[_0xe049('0x63')]=_0x567c52['user'][_0xe049('0x4c')];_0x3609ad[_0xe049('0x64')]=_0x567c52[_0xe049('0x65')]['id'];_0x3609ad[_0xe049('0x61')]=!![];_0x3609ad[_0xe049('0x66')]=moment()[_0xe049('0x67')](_0xe049('0x68'));_0x3609ad[_0xe049('0x69')]=_0x56b9d9['phone'];_0x3609ad['campaigntype']=_0x56b9d9[_0xe049('0x5a')]?_0xe049('0x6a'):'ivr';return db[_0xe049('0x6b')][_0xe049('0x55')]({'where':{'id':_0x3609ad[_0xe049('0x6c')]},'attributes':[_0xe049('0x6d'),'lastName']})['then'](function(_0x191b60){if(!_['isNil'](_0x6b2cf6)&&!_[_0xe049('0x6e')](_0x191b60[_0xe049('0x6d')])){_0x3609ad[_0xe049('0x6f')]=_0x191b60[_0xe049('0x6d')];if(!_[_0xe049('0x6e')](_0x191b60[_0xe049('0x70')])){_0x3609ad[_0xe049('0x6f')]+='\x20'+_0x191b60[_0xe049('0x70')];}}})['finally'](function(){return db[_0xe049('0x71')][_0xe049('0x56')](_0x3609ad);});}})[_0xe049('0x22')](function(){return _0x6b2cf6[_0xe049('0x18')](0xcc)[_0xe049('0x72')]();})['catch'](handleError(_0x6b2cf6,null));};exports[_0xe049('0x73')]=function(_0x236f0b,_0x41a01f,_0x257683){var _0x5a1431=[];return db['CmContact'][_0xe049('0x58')]()[_0xe049('0x22')](function(_0x1896eb){_0x5a1431=_[_0xe049('0x2e')](_0x1896eb);return _0x236f0b[_0xe049('0x65')][_0xe049('0x74')]({'where':{'type':_0xe049('0x75'),'dialActive':!![],'dialMethod':_0xe049('0x76')},'attributes':['id',_0xe049('0x77'),_0xe049('0x78')],'raw':!![]});})[_0xe049('0x22')](function(_0x3fee79){if(_0x3fee79&&_0x3fee79[_0xe049('0x44')]){return db[_0xe049('0x79')][_0xe049('0x7a')](function(_0x73c789){var _0x5f0262={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xe049('0x68'))},'VoiceQueueId':{'$in':_[_0xe049('0x26')](_0x3fee79,'id')},'$or':[{'UserId':null},{'UserId':_0x236f0b[_0xe049('0x65')]['id']}]};var _0x5e32db={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x3fee79)[_0xe049('0x4a')]([_0xe049('0x78'),0x0])['map']('id')[_0xe049('0x7b')]()},'$or':[{'UserId':null},{'UserId':_0x236f0b[_0xe049('0x65')]['id']}]};var _0x505ac2={'$or':[_0x5f0262,_0x5e32db]};var _0x7cba12=[];if(_0x236f0b[_0xe049('0x57')][_0xe049('0x7c')]&&_0x236f0b[_0xe049('0x57')][_0xe049('0x7c')]===_0xe049('0x7d')){if(!_[_0xe049('0x7e')](_0x236f0b[_0xe049('0x57')][_0xe049('0x7f')])){_0x505ac2['id']={'$in':_0x236f0b[_0xe049('0x57')][_0xe049('0x7f')]};}_0x7cba12=[[_0xe049('0x80'),_0xe049('0x81')],['scheduledAt',_0x3fee79[0x0][_0xe049('0x77')]==='ASC'?'DESC':_0xe049('0x81')],db[_0xe049('0x79')][_0xe049('0x82')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xe049('0x83')]];}else{if(!_['isEmpty'](_0x236f0b[_0xe049('0x57')]['hopperIds'])){_0x505ac2['id']={'$notIn':_0x236f0b[_0xe049('0x57')][_0xe049('0x7f')]};}_0x7cba12=[[_0xe049('0x80'),_0xe049('0x83')],[_0xe049('0x84'),_0x3fee79[0x0][_0xe049('0x77')]],db[_0xe049('0x79')][_0xe049('0x82')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0xe049('0x27')][_0xe049('0x85')]({'attributes':['id',_0xe049('0x86'),_0xe049('0x87')],'where':_0x505ac2,'order':_0x7cba12,'transaction':_0x73c789,'lock':_0x73c789[_0xe049('0x88')][_0xe049('0x89')],'include':[{'model':db['CmContact'],'as':_0xe049('0x8a'),'attributes':_0x5a1431,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0xe049('0x4c')]}]},{'model':db[_0xe049('0x8b')],'as':_0xe049('0x8c'),'attributes':['id','name']},{'model':db[_0xe049('0x5c')],'as':'Queue','attributes':['id','name',_0xe049('0x8d')]}]})[_0xe049('0x22')](function(_0x3f11a7){if(_0x3f11a7){return _0x3f11a7['update']({'UserId':_0x236f0b['user']['id']},{'transaction':_0x73c789});}});});}})[_0xe049('0x22')](handleEntityNotFound(_0x41a01f,null))[_0xe049('0x22')](respondWithResult(_0x41a01f,null))['catch'](handleError(_0x41a01f,null));};exports[_0xe049('0x8e')]=function(_0x436270,_0x3edd1c,_0x328c13){return _0x436270['user'][_0xe049('0x74')]({'where':{'type':_0xe049('0x75'),'dialActive':!![],'dialMethod':_0xe049('0x76')},'attributes':['id'],'raw':!![]})['then'](function(_0x271514){if(_0x271514&&_0x271514[_0xe049('0x44')]){return db[_0xe049('0x27')][_0xe049('0x1c')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xe049('0x68'))},'VoiceQueueId':{'$in':_[_0xe049('0x26')](_0x271514,'id')},'$or':[{'UserId':null},{'UserId':_0x436270[_0xe049('0x65')]['id']}]}});}return 0x0;})['then'](function(_0x24e26b){if(!_[_0xe049('0x6e')](_0x24e26b)&&_['isNumber'](_0x24e26b)){return _0x3edd1c[_0xe049('0x18')](0xc8)[_0xe049('0x1e')]({'contacts':_0x24e26b});}else{logger['error'](_0xe049('0x8f'),_0xe049('0x8e'),0x194,_0xe049('0x90'));_0x3edd1c[_0xe049('0x17')](0x194);}})[_0xe049('0x51')](handleError(_0x3edd1c,null));}; \ No newline at end of file +var _0x05ba=['../../config/license/util','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','query','keys','intersection','model','filters','$and','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$contains','$contained','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','show','params','CmHopper','fields','length','find','catch','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','omit','dataValues','createdAt','updatedAt','deleted','campaign','membername','user','UserId','deletedat','calleridnum','phone','campaigntype','queue','ivr','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getPreview','CmContact','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','format','map','direction','isEmpty','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','hopperIds','findOne','scheduledat','recallme','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getOpenContacts','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x263908,_0x134d8f){var _0x2bed68=function(_0x103ec8){while(--_0x103ec8){_0x263908['push'](_0x263908['shift']());}};_0x2bed68(++_0x134d8f);}(_0x05ba,0x116));var _0xa05b=function(_0x1ad926,_0x3e1fed){_0x1ad926=_0x1ad926-0x0;var _0x1b81dc=_0x05ba[_0x1ad926];return _0x1b81dc;};'use strict';var emlformat=require(_0xa05b('0x0'));var rimraf=require(_0xa05b('0x1'));var zipdir=require(_0xa05b('0x2'));var jsonpatch=require(_0xa05b('0x3'));var rp=require(_0xa05b('0x4'));var moment=require(_0xa05b('0x5'));var BPromise=require(_0xa05b('0x6'));var Mustache=require(_0xa05b('0x7'));var util=require(_0xa05b('0x8'));var path=require(_0xa05b('0x9'));var sox=require(_0xa05b('0xa'));var csv=require(_0xa05b('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa05b('0xc'));var _=require('lodash');var squel=require(_0xa05b('0xd'));var crypto=require(_0xa05b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa05b('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa05b('0x10'));var Papa=require('papaparse');var Redis=require(_0xa05b('0x11'));var authService=require(_0xa05b('0x12'));var qs=require(_0xa05b('0x13'));var as=require(_0xa05b('0x14'));var hardwareService=require(_0xa05b('0x15'));var logger=require(_0xa05b('0x16'))(_0xa05b('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa05b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32eedf,_0x53780c){_0x53780c=_0x53780c||0xcc;return function(_0x85bc2f){if(_0x85bc2f){return _0x32eedf['sendStatus'](_0x53780c);}return _0x32eedf[_0xa05b('0x19')](_0x53780c)[_0xa05b('0x1a')]();};}function respondWithResult(_0x2adad3,_0x26dc2b){_0x26dc2b=_0x26dc2b||0xc8;return function(_0x5e7209){if(_0x5e7209){return _0x2adad3[_0xa05b('0x19')](_0x26dc2b)['json'](_0x5e7209);}};}function respondWithFilteredResult(_0x3dd108,_0x4b7a4d){return function(_0x4e25a2){if(_0x4e25a2){var _0x96f37=typeof _0x4b7a4d[_0xa05b('0x1b')]===_0xa05b('0x1c')&&typeof _0x4b7a4d[_0xa05b('0x1d')]===_0xa05b('0x1c');var _0x431adb=_0x4e25a2[_0xa05b('0x1e')];var _0x350620=_0x96f37?0x0:_0x4b7a4d[_0xa05b('0x1b')];var _0x45c19d=_0x96f37?_0x4e25a2[_0xa05b('0x1e')]:_0x4b7a4d['offset']+_0x4b7a4d[_0xa05b('0x1d')];var _0x1b7a1f;if(_0x45c19d>=_0x431adb){_0x45c19d=_0x431adb;_0x1b7a1f=0xc8;}else{_0x1b7a1f=0xce;}_0x3dd108['status'](_0x1b7a1f);return _0x3dd108['set'](_0xa05b('0x1f'),_0x350620+'-'+_0x45c19d+'/'+_0x431adb)[_0xa05b('0x20')](_0x4e25a2);}return null;};}function patchUpdates(_0x1680e9){return function(_0x56b775){try{jsonpatch[_0xa05b('0x21')](_0x56b775,_0x1680e9,!![]);}catch(_0x18b998){return BPromise[_0xa05b('0x22')](_0x18b998);}return _0x56b775['save']();};}function saveUpdates(_0x259710,_0x41335c){return function(_0x4fc9b7){if(_0x4fc9b7){return _0x4fc9b7[_0xa05b('0x23')](_0x259710)[_0xa05b('0x24')](function(_0x34f519){return _0x34f519;});}return null;};}function removeEntity(_0x1f1613,_0x36915f){return function(_0x11e26d){if(_0x11e26d){return _0x11e26d[_0xa05b('0x25')]()[_0xa05b('0x24')](function(){_0x1f1613[_0xa05b('0x19')](0xcc)[_0xa05b('0x1a')]();});}};}function handleEntityNotFound(_0x52003f,_0xf42218){return function(_0x43e41c){if(!_0x43e41c){_0x52003f[_0xa05b('0x26')](0x194);}return _0x43e41c;};}function handleError(_0x3ec93c,_0x30d7b2){_0x30d7b2=_0x30d7b2||0x1f4;return function(_0x49fb1d){logger[_0xa05b('0x27')](_0x49fb1d[_0xa05b('0x28')]);if(_0x49fb1d[_0xa05b('0x29')]){delete _0x49fb1d['name'];}_0x3ec93c[_0xa05b('0x19')](_0x30d7b2)[_0xa05b('0x2a')](_0x49fb1d);};}exports[_0xa05b('0x2b')]=function(_0x29f1e3,_0x54a9a8){var _0x431d61={},_0x39cb2d={},_0x49b355={'count':0x0,'rows':[]};var _0x5eec8c=_['map'](db['CmHopper'][_0xa05b('0x2c')],function(_0x37fd28){return{'name':_0x37fd28[_0xa05b('0x2d')],'type':_0x37fd28[_0xa05b('0x2e')][_0xa05b('0x2f')]};});_0x39cb2d['model']=_['map'](_0x5eec8c,'name');_0x39cb2d[_0xa05b('0x30')]=_[_0xa05b('0x31')](_0x29f1e3['query']);_0x39cb2d['filters']=_[_0xa05b('0x32')](_0x39cb2d[_0xa05b('0x33')],_0x39cb2d['query']);_0x39cb2d[_0xa05b('0x34')]=_['concat'](_0x39cb2d[_0xa05b('0x34')],[_0xa05b('0x35'),'$or','$gt',_0xa05b('0x36'),_0xa05b('0x37'),_0xa05b('0x38'),_0xa05b('0x39'),_0xa05b('0x3a'),_0xa05b('0x3b'),_0xa05b('0x3c'),_0xa05b('0x3d'),_0xa05b('0x3e'),_0xa05b('0x3f'),'$like',_0xa05b('0x40'),_0xa05b('0x41'),_0xa05b('0x42'),_0xa05b('0x43'),_0xa05b('0x44'),_0xa05b('0x45'),_0xa05b('0x46'),'$any']);_0x431d61[_0xa05b('0x47')]=_[_0xa05b('0x32')](_0x39cb2d[_0xa05b('0x33')],qs['fields'](_0x29f1e3[_0xa05b('0x30')]['fields']));_0x431d61[_0xa05b('0x47')]=_0x431d61['attributes']['length']?_0x431d61[_0xa05b('0x47')]:_0x39cb2d[_0xa05b('0x33')];if(!_0x29f1e3[_0xa05b('0x30')][_0xa05b('0x48')](_0xa05b('0x49'))){_0x431d61[_0xa05b('0x1d')]=qs[_0xa05b('0x1d')](_0x29f1e3[_0xa05b('0x30')][_0xa05b('0x1d')]);_0x431d61[_0xa05b('0x1b')]=qs[_0xa05b('0x1b')](_0x29f1e3['query'][_0xa05b('0x1b')]);}_0x431d61[_0xa05b('0x4a')]=qs[_0xa05b('0x4b')](_0x29f1e3[_0xa05b('0x30')][_0xa05b('0x4b')]);_0x431d61[_0xa05b('0x4c')]=qs[_0xa05b('0x34')](_['pick'](_0x29f1e3[_0xa05b('0x30')],_0x39cb2d[_0xa05b('0x34')]),_0x5eec8c);if(_0x29f1e3[_0xa05b('0x30')][_0xa05b('0x4d')]){_0x431d61['where']=_[_0xa05b('0x4e')](_0x431d61['where'],{'$or':_['map'](_0x5eec8c,function(_0x591a42){if(_0x591a42['type']!==_0xa05b('0x4f')){var _0x45e442={};_0x45e442[_0x591a42[_0xa05b('0x29')]]={'$like':'%'+_0x29f1e3[_0xa05b('0x30')][_0xa05b('0x4d')]+'%'};return _0x45e442;}})});}_0x431d61=_[_0xa05b('0x4e')]({},_0x431d61,_0x29f1e3[_0xa05b('0x50')]);var _0x164b9={'where':_0x431d61[_0xa05b('0x4c')]};return db['CmHopper']['count'](_0x164b9)[_0xa05b('0x24')](function(_0xd38b1e){_0x49b355[_0xa05b('0x1e')]=_0xd38b1e;if(_0x29f1e3[_0xa05b('0x30')]['includeAll']){_0x431d61[_0xa05b('0x51')]=[{'all':!![]}];}return db['CmHopper'][_0xa05b('0x52')](_0x431d61);})[_0xa05b('0x24')](function(_0x49feb8){_0x49b355['rows']=_0x49feb8;return _0x49b355;})[_0xa05b('0x24')](respondWithFilteredResult(_0x54a9a8,_0x431d61))['catch'](handleError(_0x54a9a8,null));};exports[_0xa05b('0x53')]=function(_0x176774,_0x1ba95e){var _0x13412b={'raw':!![],'where':{'id':_0x176774[_0xa05b('0x54')]['id']}},_0x1fc1c8={};_0x1fc1c8[_0xa05b('0x33')]=_[_0xa05b('0x31')](db[_0xa05b('0x55')][_0xa05b('0x2c')]);_0x1fc1c8[_0xa05b('0x30')]=_[_0xa05b('0x31')](_0x176774['query']);_0x1fc1c8[_0xa05b('0x34')]=_[_0xa05b('0x32')](_0x1fc1c8[_0xa05b('0x33')],_0x1fc1c8[_0xa05b('0x30')]);_0x13412b['attributes']=_[_0xa05b('0x32')](_0x1fc1c8['model'],qs[_0xa05b('0x56')](_0x176774['query'][_0xa05b('0x56')]));_0x13412b['attributes']=_0x13412b[_0xa05b('0x47')][_0xa05b('0x57')]?_0x13412b[_0xa05b('0x47')]:_0x1fc1c8[_0xa05b('0x33')];if(_0x176774[_0xa05b('0x30')]['includeAll']){_0x13412b[_0xa05b('0x51')]=[{'all':!![]}];}_0x13412b=_[_0xa05b('0x4e')]({},_0x13412b,_0x176774[_0xa05b('0x50')]);return db[_0xa05b('0x55')][_0xa05b('0x58')](_0x13412b)[_0xa05b('0x24')](handleEntityNotFound(_0x1ba95e,null))['then'](respondWithResult(_0x1ba95e,null))[_0xa05b('0x59')](handleError(_0x1ba95e,null));};exports[_0xa05b('0x5a')]=function(_0x315c91,_0x49aead){return db[_0xa05b('0x55')][_0xa05b('0x5a')](_0x315c91[_0xa05b('0x5b')],{})[_0xa05b('0x24')](respondWithResult(_0x49aead,0xc9))[_0xa05b('0x59')](handleError(_0x49aead,null));};exports[_0xa05b('0x23')]=function(_0x46e78,_0x2c9d62){if(_0x46e78[_0xa05b('0x5b')]['id']){delete _0x46e78[_0xa05b('0x5b')]['id'];}return db[_0xa05b('0x55')][_0xa05b('0x58')]({'where':{'id':_0x46e78[_0xa05b('0x54')]['id']}})['then'](handleEntityNotFound(_0x2c9d62,null))[_0xa05b('0x24')](saveUpdates(_0x46e78['body'],null))[_0xa05b('0x24')](respondWithResult(_0x2c9d62,null))[_0xa05b('0x59')](handleError(_0x2c9d62,null));};exports[_0xa05b('0x5c')]=function(_0x421491,_0x56a98f){return db[_0xa05b('0x55')]['describe']()[_0xa05b('0x24')](respondWithResult(_0x56a98f,null))[_0xa05b('0x59')](handleError(_0x56a98f,null));};exports['destroy']=function(_0x1a342d,_0x539edf){var _0x120f1d;return db[_0xa05b('0x55')][_0xa05b('0x58')]({'where':{'id':_0x1a342d[_0xa05b('0x54')]['id']}})[_0xa05b('0x24')](handleEntityNotFound(_0x539edf,null))['then'](function(_0x66ca93){if(_0x66ca93){return _0x66ca93['destroy']()[_0xa05b('0x24')](function(_0x1183b1){return _0x1183b1;});}})['then'](function(_0x3319de){_0x120f1d=_0x3319de;if(_0x3319de){if(_0x3319de[_0xa05b('0x5d')]||_0x3319de[_0xa05b('0x5e')]){return db[_0x3319de[_0xa05b('0x5d')]?_0xa05b('0x5f'):'Campaign'][_0xa05b('0x58')]({'where':{'id':_0x3319de[_0xa05b('0x5d')]?_0x3319de[_0xa05b('0x5d')]:_0x3319de[_0xa05b('0x5e')]},'attributes':['id','name'],'raw':!![]});}}})['then'](function(_0x43208e){var _0x15ab89={};if(_0x43208e){_[_0xa05b('0x4e')](_0x15ab89,_[_0xa05b('0x60')](_0x120f1d[_0xa05b('0x61')],[_0xa05b('0x62'),_0xa05b('0x63'),'id']));_0x15ab89['state']=0x15;_0x15ab89['statedesc']=_0xa05b('0x64');_0x15ab89[_0xa05b('0x65')]=_0x43208e[_0xa05b('0x29')];_0x15ab89[_0xa05b('0x66')]=_0x1a342d[_0xa05b('0x67')][_0xa05b('0x29')];_0x15ab89[_0xa05b('0x68')]=_0x1a342d['user']['id'];_0x15ab89['deleted']=!![];_0x15ab89[_0xa05b('0x69')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x15ab89[_0xa05b('0x6a')]=_0x120f1d[_0xa05b('0x6b')];_0x15ab89[_0xa05b('0x6c')]=_0x120f1d[_0xa05b('0x5d')]?_0xa05b('0x6d'):_0xa05b('0x6e');return db['CmContact']['find']({'where':{'id':_0x15ab89[_0xa05b('0x6f')]},'attributes':[_0xa05b('0x70'),_0xa05b('0x71')]})['then'](function(_0x598530){if(!_[_0xa05b('0x72')](_0x539edf)&&!_[_0xa05b('0x72')](_0x598530[_0xa05b('0x70')])){_0x15ab89['calleridname']=_0x598530[_0xa05b('0x70')];if(!_[_0xa05b('0x72')](_0x598530[_0xa05b('0x71')])){_0x15ab89[_0xa05b('0x73')]+='\x20'+_0x598530[_0xa05b('0x71')];}}})[_0xa05b('0x74')](function(){return db[_0xa05b('0x75')][_0xa05b('0x5a')](_0x15ab89);});}})[_0xa05b('0x24')](function(){return _0x539edf[_0xa05b('0x19')](0xcc)[_0xa05b('0x1a')]();})[_0xa05b('0x59')](handleError(_0x539edf,null));};exports[_0xa05b('0x76')]=function(_0x3afba7,_0x4c717f,_0x2a4a51){var _0x499ded=[];return db[_0xa05b('0x77')][_0xa05b('0x5c')]()[_0xa05b('0x24')](function(_0x3c665b){_0x499ded=_[_0xa05b('0x31')](_0x3c665b);return _0x3afba7[_0xa05b('0x67')][_0xa05b('0x78')]({'where':{'type':_0xa05b('0x79'),'dialActive':!![],'dialMethod':_0xa05b('0x7a')},'attributes':['id',_0xa05b('0x7b'),_0xa05b('0x7c')],'raw':!![]});})[_0xa05b('0x24')](function(_0x1de25e){if(_0x1de25e&&_0x1de25e[_0xa05b('0x57')]){return db[_0xa05b('0x7d')][_0xa05b('0x7e')](function(_0x5c227b){var _0x2dc7f5={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xa05b('0x7f')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xa05b('0x80')](_0x1de25e,'id')},'$or':[{'UserId':null},{'UserId':_0x3afba7[_0xa05b('0x67')]['id']}]};var _0x1928a2={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x1de25e)['filter']([_0xa05b('0x7c'),0x0])[_0xa05b('0x80')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x3afba7['user']['id']}]};var _0x4e5148={'$or':[_0x2dc7f5,_0x1928a2]};var _0x434c12=[];if(_0x3afba7[_0xa05b('0x5b')]['direction']&&_0x3afba7[_0xa05b('0x5b')][_0xa05b('0x81')]==='prev'){if(!_[_0xa05b('0x82')](_0x3afba7['body']['hopperIds'])){_0x4e5148['id']={'$in':_0x3afba7[_0xa05b('0x5b')]['hopperIds']};}_0x434c12=[[_0xa05b('0x83'),_0xa05b('0x84')],[_0xa05b('0x85'),_0x1de25e[0x0][_0xa05b('0x7b')]===_0xa05b('0x84')?_0xa05b('0x86'):_0xa05b('0x84')],db['sequelize'][_0xa05b('0x87')](_0xa05b('0x88')),['id',_0xa05b('0x86')]];}else{if(!_[_0xa05b('0x82')](_0x3afba7['body'][_0xa05b('0x89')])){_0x4e5148['id']={'$notIn':_0x3afba7[_0xa05b('0x5b')][_0xa05b('0x89')]};}_0x434c12=[[_0xa05b('0x83'),_0xa05b('0x86')],[_0xa05b('0x85'),_0x1de25e[0x0]['dialOrderByScheduledAt']],db[_0xa05b('0x7d')][_0xa05b('0x87')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0xa05b('0x84')]];}return db['CmHopper'][_0xa05b('0x8a')]({'attributes':['id',_0xa05b('0x8b'),_0xa05b('0x8c')],'where':_0x4e5148,'order':_0x434c12,'transaction':_0x5c227b,'lock':_0x5c227b['LOCK'][_0xa05b('0x8d')],'include':[{'model':db[_0xa05b('0x77')],'as':_0xa05b('0x8e'),'attributes':_0x499ded,'include':[{'model':db[_0xa05b('0x8f')],'as':_0xa05b('0x90'),'attributes':['id',_0xa05b('0x29')]}]},{'model':db[_0xa05b('0x91')],'as':_0xa05b('0x92'),'attributes':['id',_0xa05b('0x29')]},{'model':db[_0xa05b('0x5f')],'as':_0xa05b('0x93'),'attributes':['id',_0xa05b('0x29'),_0xa05b('0x94')]}]})['then'](function(_0x3543fd){if(_0x3543fd){return _0x3543fd[_0xa05b('0x23')]({'UserId':_0x3afba7[_0xa05b('0x67')]['id']},{'transaction':_0x5c227b});}});});}})['then'](handleEntityNotFound(_0x4c717f,null))['then'](respondWithResult(_0x4c717f,null))[_0xa05b('0x59')](handleError(_0x4c717f,null));};exports[_0xa05b('0x95')]=function(_0x37bb08,_0x49af35,_0x22e091){return _0x37bb08[_0xa05b('0x67')][_0xa05b('0x78')]({'where':{'type':_0xa05b('0x79'),'dialActive':!![],'dialMethod':_0xa05b('0x7a')},'attributes':['id'],'raw':!![]})[_0xa05b('0x24')](function(_0x3934c5){if(_0x3934c5&&_0x3934c5[_0xa05b('0x57')]){return db[_0xa05b('0x55')][_0xa05b('0x1e')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xa05b('0x7f')](_0xa05b('0x96'))},'VoiceQueueId':{'$in':_[_0xa05b('0x80')](_0x3934c5,'id')},'$or':[{'UserId':null},{'UserId':_0x37bb08[_0xa05b('0x67')]['id']}]}});}return 0x0;})[_0xa05b('0x24')](function(_0xf6a845){if(!_[_0xa05b('0x72')](_0xf6a845)&&_['isNumber'](_0xf6a845)){return _0x49af35[_0xa05b('0x19')](0xc8)['json']({'contacts':_0xf6a845});}else{logger[_0xa05b('0x27')]('CmHopper,\x20%s,\x20%s,\x20%s',_0xa05b('0x95'),0x194,'entity\x20not\x20found');_0x49af35[_0xa05b('0x26')](0x194);}})[_0xa05b('0x59')](handleError(_0x49af35,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index bc0b8c5..e0cf9ad 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 _0x2a07=['api','moment','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger'];(function(_0x492e33,_0x111910){var _0x51be0d=function(_0x4a2ac8){while(--_0x4a2ac8){_0x492e33['push'](_0x492e33['shift']());}};_0x51be0d(++_0x111910);}(_0x2a07,0x74));var _0x72a0=function(_0x553150,_0x589ff3){_0x553150=_0x553150-0x0;var _0x18193d=_0x2a07[_0x553150];return _0x18193d;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var logger=require(_0x72a0('0x2'))(_0x72a0('0x3'));var moment=require(_0x72a0('0x4'));var BPromise=require('bluebird');var rp=require(_0x72a0('0x5'));var fs=require('fs');var path=require(_0x72a0('0x6'));var rimraf=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var attributes=require(_0x72a0('0x9'));module[_0x72a0('0xa')]=function(_0x3ccf6d,_0x20dab9){return _0x3ccf6d[_0x72a0('0xb')](_0x72a0('0xc'),attributes,{'tableName':_0x72a0('0xd'),'paranoid':![],'indexes':[{'name':_0x72a0('0xe'),'fields':[_0x72a0('0xe')]},{'name':_0x72a0('0xf'),'fields':[_0x72a0('0xf')]},{'name':_0x72a0('0x10'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1623=['scheduledat','phone','priority','lodash','api','moment','bluebird','request-promise','path','./cmHopper.attributes','CmHopper','cm_hopper'];(function(_0x371005,_0x570a18){var _0x15a16f=function(_0x2f81db){while(--_0x2f81db){_0x371005['push'](_0x371005['shift']());}};_0x15a16f(++_0x570a18);}(_0x1623,0xab));var _0x3162=function(_0x227aad,_0x4c4cf2){_0x227aad=_0x227aad-0x0;var _0xd20217=_0x1623[_0x227aad];return _0xd20217;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3162('0x1'));var moment=require(_0x3162('0x2'));var BPromise=require(_0x3162('0x3'));var rp=require(_0x3162('0x4'));var fs=require('fs');var path=require(_0x3162('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3162('0x6'));module['exports']=function(_0x1b55f2,_0x428de6){return _0x1b55f2['define'](_0x3162('0x7'),attributes,{'tableName':_0x3162('0x8'),'paranoid':![],'indexes':[{'name':_0x3162('0x9'),'fields':[_0x3162('0x9')]},{'name':_0x3162('0xa'),'fields':[_0x3162('0xa')]},{'name':_0x3162('0xb'),'fields':[_0x3162('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 25719a2..2f2c5d7 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 _0x5c22=['contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','ResetActiveCalls','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','error','message','CmHopper,\x20%s,\x20%s','catch','GetCmHopper','findAll','options','raw','where','limit','include','model','attributes','then','stringify','ShowCmHopper','map','CreateCmHopper','create','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','body','active','DestroyCmHopper','CmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','User','Agent','voicePause','length','UserId','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x465b26,_0xbb7172){var _0x43dab2=function(_0x1a79b0){while(--_0x1a79b0){_0x465b26['push'](_0x465b26['shift']());}};_0x43dab2(++_0xbb7172);}(_0x5c22,0x9a));var _0x25c2=function(_0x150ffc,_0x605550){_0x150ffc=_0x150ffc-0x0;var _0x494d5f=_0x5c22[_0x150ffc];return _0x494d5f;};'use strict';var _=require(_0x25c2('0x0'));var util=require(_0x25c2('0x1'));var moment=require(_0x25c2('0x2'));var BPromise=require(_0x25c2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x25c2('0x4'));var db=require(_0x25c2('0x5'))['db'];var utils=require(_0x25c2('0x6'));var logger=require(_0x25c2('0x7'))(_0x25c2('0x8'));var config=require(_0x25c2('0x9'));var jayson=require(_0x25c2('0xa'));var client=jayson[_0x25c2('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x588997,_0x221257,_0x367955){return new BPromise(function(_0x23557b,_0x57c534){return client[_0x25c2('0xc')](_0x588997,_0x367955)['then'](function(_0x50ba24){logger[_0x25c2('0xd')]('CmHopper,\x20%s,\x20%s',_0x221257,_0x25c2('0xe'));logger[_0x25c2('0xf')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x221257,'request\x20sent',JSON['stringify'](_0x50ba24));if(_0x50ba24['error']){if(_0x50ba24[_0x25c2('0x10')]['code']===0x1f4){logger[_0x25c2('0x10')]('CmHopper,\x20%s,\x20%s',_0x221257,_0x50ba24['error'][_0x25c2('0x11')]);return _0x57c534(_0x50ba24['error'][_0x25c2('0x11')]);}logger['error'](_0x25c2('0x12'),_0x221257,_0x50ba24['error'][_0x25c2('0x11')]);return _0x23557b(_0x50ba24[_0x25c2('0x10')][_0x25c2('0x11')]);}else{logger[_0x25c2('0xd')]('CmHopper,\x20%s,\x20%s',_0x221257,_0x25c2('0xe'));_0x23557b(_0x50ba24['result'][_0x25c2('0x11')]);}})[_0x25c2('0x13')](function(_0x1fa1ae){logger[_0x25c2('0x10')](_0x25c2('0x12'),_0x221257,_0x1fa1ae);_0x57c534(_0x1fa1ae);});});}exports[_0x25c2('0x14')]=function(_0x4eb9f8){var _0x22bfba=this;return new Promise(function(_0x262113,_0x38a4e8){return db['CmHopper'][_0x25c2('0x15')]({'raw':_0x4eb9f8[_0x25c2('0x16')]?_0x4eb9f8[_0x25c2('0x16')][_0x25c2('0x17')]===undefined?!![]:![]:!![],'where':_0x4eb9f8[_0x25c2('0x16')]?_0x4eb9f8['options'][_0x25c2('0x18')]||null:null,'attributes':_0x4eb9f8[_0x25c2('0x16')]?_0x4eb9f8[_0x25c2('0x16')]['attributes']||null:null,'limit':_0x4eb9f8[_0x25c2('0x16')]?_0x4eb9f8[_0x25c2('0x16')][_0x25c2('0x19')]||null:null,'include':_0x4eb9f8[_0x25c2('0x16')]?_0x4eb9f8[_0x25c2('0x16')][_0x25c2('0x1a')]?_['map'](_0x4eb9f8[_0x25c2('0x16')][_0x25c2('0x1a')],function(_0x12d7e9){return{'model':db[_0x12d7e9[_0x25c2('0x1b')]],'as':_0x12d7e9['as'],'attributes':_0x12d7e9[_0x25c2('0x1c')],'include':_0x12d7e9['include']?_['map'](_0x12d7e9[_0x25c2('0x1a')],function(_0x1ac9d6){return{'model':db[_0x1ac9d6[_0x25c2('0x1b')]],'as':_0x1ac9d6['as'],'attributes':_0x1ac9d6[_0x25c2('0x1c')],'include':_0x1ac9d6['include']?_['map'](_0x1ac9d6[_0x25c2('0x1a')],function(_0x3bac82){return{'model':db[_0x3bac82[_0x25c2('0x1b')]],'as':_0x3bac82['as'],'attributes':_0x3bac82[_0x25c2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x25c2('0x1d')](function(_0x413587){logger['info'](_0x25c2('0x14'),_0x4eb9f8);logger[_0x25c2('0xf')](_0x25c2('0x14'),_0x4eb9f8,JSON[_0x25c2('0x1e')](_0x413587));_0x262113(_0x413587);})['catch'](function(_0x2c0d03){logger['error'](_0x25c2('0x14'),_0x2c0d03[_0x25c2('0x11')],_0x4eb9f8);_0x38a4e8(_0x22bfba[_0x25c2('0x10')](0x1f4,_0x2c0d03['message']));});});};exports[_0x25c2('0x1f')]=function(_0x2b631d){var _0x5804bd=this;return new Promise(function(_0x22bb0c,_0x95fd98){return db['CmHopper']['find']({'raw':_0x2b631d[_0x25c2('0x16')]?_0x2b631d[_0x25c2('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2b631d[_0x25c2('0x16')]?_0x2b631d[_0x25c2('0x16')][_0x25c2('0x18')]||null:null,'attributes':_0x2b631d[_0x25c2('0x16')]?_0x2b631d[_0x25c2('0x16')][_0x25c2('0x1c')]||null:null,'include':_0x2b631d[_0x25c2('0x16')]?_0x2b631d[_0x25c2('0x16')][_0x25c2('0x1a')]?_[_0x25c2('0x20')](_0x2b631d[_0x25c2('0x16')][_0x25c2('0x1a')],function(_0x41d84f){return{'model':db[_0x41d84f['model']],'as':_0x41d84f['as'],'attributes':_0x41d84f[_0x25c2('0x1c')],'include':_0x41d84f[_0x25c2('0x1a')]?_['map'](_0x41d84f[_0x25c2('0x1a')],function(_0x23377e){return{'model':db[_0x23377e['model']],'as':_0x23377e['as'],'attributes':_0x23377e[_0x25c2('0x1c')],'include':_0x23377e[_0x25c2('0x1a')]?_[_0x25c2('0x20')](_0x23377e[_0x25c2('0x1a')],function(_0x33f1f0){return{'model':db[_0x33f1f0[_0x25c2('0x1b')]],'as':_0x33f1f0['as'],'attributes':_0x33f1f0['attributes']};}):[]};}):[]};}):[]:[]})[_0x25c2('0x1d')](function(_0x26d65b){logger[_0x25c2('0xd')](_0x25c2('0x1f'),_0x2b631d);logger['debug']('ShowCmHopper',_0x2b631d,JSON[_0x25c2('0x1e')](_0x26d65b));_0x22bb0c(_0x26d65b);})['catch'](function(_0x166081){logger[_0x25c2('0x10')](_0x25c2('0x1f'),_0x166081[_0x25c2('0x11')],_0x2b631d);_0x95fd98(_0x5804bd[_0x25c2('0x10')](0x1f4,_0x166081[_0x25c2('0x11')]));});});};exports[_0x25c2('0x21')]=function(_0x3384c9){var _0x288611=this;return new Promise(function(_0x39d0ae,_0x577e8d){return db['CmHopper'][_0x25c2('0x22')](_0x3384c9['body'],{'raw':_0x3384c9[_0x25c2('0x16')]?_0x3384c9['options'][_0x25c2('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x239ae2){logger[_0x25c2('0xd')](_0x25c2('0x21'),_0x3384c9);logger[_0x25c2('0xf')](_0x25c2('0x21'),_0x3384c9,JSON['stringify'](_0x239ae2));_0x39d0ae(_0x239ae2);})[_0x25c2('0x13')](function(_0x23a078){logger[_0x25c2('0x10')](_0x25c2('0x21'),_0x23a078[_0x25c2('0x11')],_0x3384c9);_0x577e8d(_0x288611[_0x25c2('0x10')](0x1f4,_0x23a078[_0x25c2('0x11')]));});});};exports[_0x25c2('0x23')]=function(_0x469fa0){var _0x72d977=this;return new Promise(function(_0x47b3a4,_0x370747){return db['CmHopper'][_0x25c2('0x24')](_0x469fa0['body'],{'raw':_0x469fa0['options']?_0x469fa0[_0x25c2('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x469fa0['options']?_0x469fa0[_0x25c2('0x16')][_0x25c2('0x18')]||null:null,'attributes':_0x469fa0[_0x25c2('0x16')]?_0x469fa0[_0x25c2('0x16')]['attributes']||null:null,'limit':_0x469fa0[_0x25c2('0x16')]?_0x469fa0['options']['limit']||null:null})[_0x25c2('0x1d')](function(_0x93b4fc){logger[_0x25c2('0xd')](_0x25c2('0x23'),_0x469fa0);logger['info'](_0x25c2('0x25'),JSON[_0x25c2('0x1e')](_0x469fa0[_0x25c2('0x16')][_0x25c2('0x18')]),_0x469fa0[_0x25c2('0x26')][_0x25c2('0x27')]);logger['debug'](_0x25c2('0x23'),_0x469fa0,JSON[_0x25c2('0x1e')](_0x93b4fc));_0x47b3a4(_0x93b4fc);})[_0x25c2('0x13')](function(_0x5bde52){logger['error'](_0x25c2('0x23'),_0x5bde52[_0x25c2('0x11')],_0x469fa0);_0x370747(_0x72d977['error'](0x1f4,_0x5bde52[_0x25c2('0x11')]));});});};exports[_0x25c2('0x28')]=function(_0x14b2b0){var _0xc9a2c7=this;return new Promise(function(_0x3dce92,_0x1f5ee3){return db[_0x25c2('0x29')][_0x25c2('0x2a')]({'where':_0x14b2b0[_0x25c2('0x16')]?_0x14b2b0[_0x25c2('0x16')][_0x25c2('0x18')]||null:null})['then'](function(_0x4cc231){logger[_0x25c2('0xd')](_0x25c2('0x28'),_0x14b2b0);logger[_0x25c2('0xf')](_0x25c2('0x28'),_0x14b2b0,JSON[_0x25c2('0x1e')](_0x4cc231));_0x3dce92(_0x4cc231);})[_0x25c2('0x13')](function(_0x5127f5){logger['error'](_0x25c2('0x28'),_0x5127f5[_0x25c2('0x11')],_0x14b2b0);_0x1f5ee3(_0xc9a2c7[_0x25c2('0x10')](0x1f4,_0x5127f5[_0x25c2('0x11')]));});});};exports[_0x25c2('0x2b')]=function(_0x56750a){var _0x2d4774=this;return new Promise(function(_0x131f9f,_0x58e8db){return db[_0x25c2('0x2c')][_0x25c2('0x2d')]()[_0x25c2('0x1d')](function(_0x505bd1){return db[_0x25c2('0x2e')][_0x25c2('0x2f')](function(_0x455989){return db[_0x25c2('0x29')][_0x25c2('0x15')]({'where':_0x56750a[_0x25c2('0x16')]?_0x56750a[_0x25c2('0x16')][_0x25c2('0x18')]||null:null,'attributes':_0x56750a[_0x25c2('0x16')]?_0x56750a['options'][_0x25c2('0x1c')]||null:null,'limit':_0x56750a[_0x25c2('0x16')]?_0x56750a[_0x25c2('0x16')][_0x25c2('0x19')]||null:null,'order':_0x56750a[_0x25c2('0x16')]?_0x56750a[_0x25c2('0x16')][_0x25c2('0x30')]||null:null,'transaction':_0x455989,'lock':_0x455989[_0x25c2('0x31')][_0x25c2('0x32')],'include':[{'model':db[_0x25c2('0x2c')],'as':_0x25c2('0x33'),'attributes':_[_0x25c2('0x34')](_0x505bd1)},{'model':db[_0x25c2('0x35')],'as':_0x25c2('0x36'),'attributes':['id','name',_0x25c2('0x37')]}]})[_0x25c2('0x1d')](function(_0x423c63){var _0x57b907=[];var _0x35fcba=[];for(var _0x18c5e7=0x0;_0x18c5e7<_0x423c63[_0x25c2('0x38')];_0x18c5e7+=0x1){var _0x261c1b=_0x423c63[_0x18c5e7][_0x25c2('0x39')];if(_0x261c1b===null){_0x57b907[_0x25c2('0x3a')](_0x423c63[_0x18c5e7][_0x25c2('0x24')](_0x56750a[_0x25c2('0x26')],{'transaction':_0x455989}));}else if(!_0x35fcba['includes'](_0x261c1b)){_0x35fcba['push'](_0x261c1b);_0x57b907['push'](_0x423c63[_0x18c5e7][_0x25c2('0x24')](_0x56750a[_0x25c2('0x26')],{'transaction':_0x455989}));}}return BPromise[_0x25c2('0x3b')](_0x57b907);});})[_0x25c2('0x1d')](function(_0x4ed57b){logger[_0x25c2('0xd')]('GetContactDialer',_0x56750a);if(_0x4ed57b[_0x25c2('0x38')]>0x0){logger['info'](_0x25c2('0x3c'),_0x4ed57b[0x0][_0x25c2('0x3d')]['id'],_0x4ed57b[0x0][_0x25c2('0x3d')]['ContactId'],_0x4ed57b[0x0][_0x25c2('0x3d')]['active']);}logger[_0x25c2('0xf')](_0x25c2('0x2b'),_0x56750a,JSON[_0x25c2('0x1e')](_0x4ed57b));_0x131f9f(_0x4ed57b);})[_0x25c2('0x13')](function(_0x99031){logger[_0x25c2('0x10')](_0x25c2('0x2b'),_0x99031[_0x25c2('0x11')],_0x56750a);_0x58e8db(_0x2d4774[_0x25c2('0x10')](0x1f4,_0x99031['message']));});});});};exports[_0x25c2('0x3e')]=function(_0xd07df){var _0x4d4482=this;return new Promise(function(_0x485022,_0x2a1377){return db[_0x25c2('0x2e')]['transaction'](function(_0x1f71c1){return db[_0x25c2('0x3f')][_0x25c2('0x22')](_0xd07df['body'],{'raw':_0xd07df[_0x25c2('0x16')]?_0xd07df['options'][_0x25c2('0x17')]===undefined?!![]:![]:!![],'transaction':_0x1f71c1})[_0x25c2('0x1d')](function(){logger[_0x25c2('0xd')](_0x25c2('0x40'),JSON[_0x25c2('0x1e')](_0xd07df[_0x25c2('0x16')][_0x25c2('0x18')]),_0xd07df[_0x25c2('0x16')][_0x25c2('0x18')][_0x25c2('0x27')]);return db[_0x25c2('0x29')]['destroy']({'where':_0xd07df[_0x25c2('0x16')]?_0xd07df[_0x25c2('0x16')][_0x25c2('0x18')]||null:null,'transaction':_0x1f71c1});});})[_0x25c2('0x1d')](function(_0x5ce304){logger[_0x25c2('0xd')](_0x25c2('0x3e'),_0xd07df);logger['debug'](_0x25c2('0x3e'),_0xd07df,JSON[_0x25c2('0x1e')](_0x5ce304));_0x485022(_0x5ce304);})['catch'](function(_0x1dfde9){logger[_0x25c2('0x10')](_0x25c2('0x3e'),_0x1dfde9['message'],_0xd07df);_0x2a1377(_0x4d4482[_0x25c2('0x10')](0x1f4,_0x1dfde9[_0x25c2('0x11')]));});});};exports[_0x25c2('0x41')]=function(_0x537be3){var _0x2618ea=this;return new Promise(function(_0x3c594a,_0x1d5930){return db['CmHopper']['findAll']({'raw':_0x537be3[_0x25c2('0x16')]?_0x537be3[_0x25c2('0x16')][_0x25c2('0x17')]===undefined?!![]:![]:!![],'where':_0x537be3['options']?_0x537be3[_0x25c2('0x16')][_0x25c2('0x18')]||null:null,'attributes':[[db[_0x25c2('0x2e')]['fn']('COUNT',db[_0x25c2('0x2e')]['fn']('IF',db[_0x25c2('0x2e')][_0x25c2('0x42')](_0x25c2('0x43')+util['format'](_0x25c2('0x44'),moment()[_0x25c2('0x45')](_0x25c2('0x46')))+'\x20,\x201,\x20null'))),_0x25c2('0x47')]]})[_0x25c2('0x1d')](function(_0x13efb7){logger[_0x25c2('0xd')]('CountReScheduled',_0x537be3);logger[_0x25c2('0xf')](_0x25c2('0x41'),_0x537be3,JSON[_0x25c2('0x1e')](_0x13efb7));_0x3c594a(_0x13efb7);})[_0x25c2('0x13')](function(_0x4fbb48){logger[_0x25c2('0x10')](_0x25c2('0x41'),_0x4fbb48[_0x25c2('0x11')],_0x537be3);_0x1d5930(_0x2618ea[_0x25c2('0x10')](0x1f4,_0x4fbb48['message']));});});};exports[_0x25c2('0x48')]=function(_0x46ae45){var _0x278ce9=this;return new Promise(function(_0x22574d,_0x75c57){return db[_0x25c2('0x2c')][_0x25c2('0x2d')]()[_0x25c2('0x1d')](function(_0x41a9d7){return db[_0x25c2('0x2e')][_0x25c2('0x2f')](function(_0x4dbe94){return db['CmHopper']['findAll']({'where':_0x46ae45[_0x25c2('0x16')]?_0x46ae45[_0x25c2('0x16')][_0x25c2('0x18')]||null:null,'attributes':_0x46ae45[_0x25c2('0x16')]?_0x46ae45[_0x25c2('0x16')]['attributes']||null:null,'limit':0x1,'order':_0x46ae45['options']?_0x46ae45['options'][_0x25c2('0x30')]||null:null,'group':db[_0x25c2('0x29')][_0x25c2('0x39')],'transaction':_0x4dbe94,'lock':_0x4dbe94[_0x25c2('0x31')][_0x25c2('0x32')],'include':_0x46ae45['options']?_0x46ae45[_0x25c2('0x16')][_0x25c2('0x1a')]?_[_0x25c2('0x20')](_0x46ae45[_0x25c2('0x16')][_0x25c2('0x1a')],function(_0x27b0dd){return{'model':db[_0x27b0dd[_0x25c2('0x1b')]],'as':_0x27b0dd['as'],'attributes':_0x27b0dd[_0x25c2('0x1c')],'include':_0x27b0dd[_0x25c2('0x1a')]?_['map'](_0x27b0dd['include'],function(_0x15ca9a){return{'model':db[_0x15ca9a[_0x25c2('0x1b')]],'as':_0x15ca9a['as'],'attributes':_0x15ca9a[_0x25c2('0x1c')],'include':_0x15ca9a[_0x25c2('0x1a')]?_[_0x25c2('0x20')](_0x15ca9a[_0x25c2('0x1a')],function(_0x5b18b1){return{'model':db[_0x5b18b1['model']],'as':_0x5b18b1['as'],'attributes':_0x5b18b1[_0x25c2('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x40ac21){var _0x424038=[];for(var _0xb72c57=0x0;_0xb72c57<_0x40ac21[_0x25c2('0x38')];_0xb72c57+=0x1){_0x424038[_0x25c2('0x3a')](_0x40ac21[_0xb72c57][_0x25c2('0x24')](_0x46ae45[_0x25c2('0x26')],{'transaction':_0x4dbe94}));}return BPromise[_0x25c2('0x3b')](_0x424038);});})[_0x25c2('0x1d')](function(_0x2e71e6){logger[_0x25c2('0xd')]('GetContactRecallMe',_0x46ae45);logger[_0x25c2('0xf')](_0x25c2('0x48'),_0x46ae45,JSON['stringify'](_0x2e71e6));_0x22574d(_0x2e71e6);})[_0x25c2('0x13')](function(_0x1603fb){logger[_0x25c2('0x10')]('GetContactRecallMe',_0x1603fb[_0x25c2('0x11')],_0x46ae45);_0x75c57(_0x278ce9[_0x25c2('0x10')](0x1f4,_0x1603fb[_0x25c2('0x11')]));});});});};exports[_0x25c2('0x49')]=function(_0x5290b1){var _0x16ee26=this;return new Promise(function(_0x525ead,_0xbeb55a){db[_0x25c2('0x2c')]['describe']()[_0x25c2('0x1d')](function(_0x5934e1){return db['CmHopper']['findAll']({'raw':_0x5290b1['options']?_0x5290b1[_0x25c2('0x16')][_0x25c2('0x17')]===undefined?!![]:![]:!![],'where':_0x5290b1[_0x25c2('0x16')]?_0x5290b1['options']['where']||null:null,'attributes':_0x5290b1[_0x25c2('0x16')]?_0x5290b1[_0x25c2('0x16')]['attributes']||null:null,'limit':_0x5290b1[_0x25c2('0x16')]?_0x5290b1[_0x25c2('0x16')][_0x25c2('0x19')]||null:null,'include':_0x5290b1['options']?_0x5290b1['options'][_0x25c2('0x1a')]?_['map'](_0x5290b1[_0x25c2('0x16')][_0x25c2('0x1a')],function(_0x57b276){return{'model':db[_0x57b276['model']],'as':_0x57b276['as'],'attributes':_0x57b276['as']==='Contact'?_[_0x25c2('0x34')](_0x5934e1):_0x57b276['attributes'],'include':_0x57b276[_0x25c2('0x1a')]?_[_0x25c2('0x20')](_0x57b276['include'],function(_0x220238){return{'model':db[_0x220238[_0x25c2('0x1b')]],'as':_0x220238['as'],'attributes':_0x220238[_0x25c2('0x1c')],'include':_0x220238[_0x25c2('0x1a')]?_[_0x25c2('0x20')](_0x220238['include'],function(_0x16bf16){return{'model':db[_0x16bf16[_0x25c2('0x1b')]],'as':_0x16bf16['as'],'attributes':_0x16bf16[_0x25c2('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c3969){logger[_0x25c2('0xd')](_0x25c2('0x14'),_0x5290b1);logger[_0x25c2('0xf')](_0x25c2('0x14'),_0x5290b1,JSON[_0x25c2('0x1e')](_0x3c3969));_0x525ead(_0x3c3969);})[_0x25c2('0x13')](function(_0x39c415){logger[_0x25c2('0x10')](_0x25c2('0x14'),_0x39c415['message'],_0x5290b1);_0xbeb55a(_0x16ee26['error'](0x1f4,_0x39c415[_0x25c2('0x11')]));});});});};exports[_0x25c2('0x4a')]=function(_0x52a9a8){var _0x16ecbd=this;return new Promise(function(_0x137340,_0x50d464){return db[_0x25c2('0x2e')][_0x25c2('0x2f')](function(_0x560838){return db[_0x25c2('0x29')][_0x25c2('0x24')]({'active':![]},{'where':{},'transaction':_0x560838})['then'](function(_0x20f67e){logger[_0x25c2('0xd')](_0x25c2('0x4a'),_0x52a9a8);logger[_0x25c2('0xf')](_0x25c2('0x4a'),_0x52a9a8,JSON[_0x25c2('0x1e')](_0x20f67e));_0x137340(_0x20f67e);})['catch'](function(_0x4d34d3){logger['error'](_0x25c2('0x4a'),_0x4d34d3[_0x25c2('0x11')],_0x52a9a8);_0x50d464(_0x16ecbd[_0x25c2('0x10')](0x1f4,_0x4d34d3[_0x25c2('0x11')]));});});});}; \ No newline at end of file +var _0xa0bd=['info','GetCmHopper','find','ShowCmHopper','catch','CreateCmHopper','create','UpdateCmHopper','body','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','limit','order','UPDATE','User','Agent','name','voicePause','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','literal','format','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','LOCK','update','GetCmHopperPreview','Contact','keys','ResetActiveCalls','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','request','then','CmHopper,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','CmHopper','findAll','options','raw','where','attributes','include','map','model'];(function(_0x2e599f,_0x19baa9){var _0x58b195=function(_0x3ad9d9){while(--_0x3ad9d9){_0x2e599f['push'](_0x2e599f['shift']());}};_0x58b195(++_0x19baa9);}(_0xa0bd,0x1eb));var _0xda0b=function(_0x521b9e,_0x346fb7){_0x521b9e=_0x521b9e-0x0;var _0x4b58d9=_0xa0bd[_0x521b9e];return _0x4b58d9;};'use strict';var _=require(_0xda0b('0x0'));var util=require(_0xda0b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xda0b('0x2'));var fs=require('fs');var Redis=require(_0xda0b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xda0b('0x4'));var logger=require(_0xda0b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xda0b('0x6'));var client=jayson['client'][_0xda0b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3e4345,_0x4a1f03,_0x4aa08d){return new BPromise(function(_0xa08332,_0x3c8b8e){return client[_0xda0b('0x8')](_0x3e4345,_0x4aa08d)[_0xda0b('0x9')](function(_0x2d1515){logger['info'](_0xda0b('0xa'),_0x4a1f03,'request\x20sent');logger[_0xda0b('0xb')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x4a1f03,_0xda0b('0xc'),JSON[_0xda0b('0xd')](_0x2d1515));if(_0x2d1515[_0xda0b('0xe')]){if(_0x2d1515[_0xda0b('0xe')][_0xda0b('0xf')]===0x1f4){logger['error'](_0xda0b('0xa'),_0x4a1f03,_0x2d1515['error'][_0xda0b('0x10')]);return _0x3c8b8e(_0x2d1515[_0xda0b('0xe')][_0xda0b('0x10')]);}logger[_0xda0b('0xe')](_0xda0b('0xa'),_0x4a1f03,_0x2d1515[_0xda0b('0xe')][_0xda0b('0x10')]);return _0xa08332(_0x2d1515[_0xda0b('0xe')]['message']);}else{logger['info']('CmHopper,\x20%s,\x20%s',_0x4a1f03,_0xda0b('0xc'));_0xa08332(_0x2d1515[_0xda0b('0x11')]['message']);}})['catch'](function(_0x18e676){logger['error'](_0xda0b('0xa'),_0x4a1f03,_0x18e676);_0x3c8b8e(_0x18e676);});});}exports['GetCmHopper']=function(_0x46dec7){var _0x75173c=this;return new Promise(function(_0x1a23b0,_0x2ad3a7){return db[_0xda0b('0x12')][_0xda0b('0x13')]({'raw':_0x46dec7[_0xda0b('0x14')]?_0x46dec7[_0xda0b('0x14')][_0xda0b('0x15')]===undefined?!![]:![]:!![],'where':_0x46dec7[_0xda0b('0x14')]?_0x46dec7[_0xda0b('0x14')][_0xda0b('0x16')]||null:null,'attributes':_0x46dec7[_0xda0b('0x14')]?_0x46dec7[_0xda0b('0x14')][_0xda0b('0x17')]||null:null,'limit':_0x46dec7['options']?_0x46dec7['options']['limit']||null:null,'include':_0x46dec7[_0xda0b('0x14')]?_0x46dec7[_0xda0b('0x14')][_0xda0b('0x18')]?_[_0xda0b('0x19')](_0x46dec7[_0xda0b('0x14')][_0xda0b('0x18')],function(_0x297d5e){return{'model':db[_0x297d5e[_0xda0b('0x1a')]],'as':_0x297d5e['as'],'attributes':_0x297d5e[_0xda0b('0x17')],'include':_0x297d5e[_0xda0b('0x18')]?_[_0xda0b('0x19')](_0x297d5e[_0xda0b('0x18')],function(_0x1b7ba3){return{'model':db[_0x1b7ba3[_0xda0b('0x1a')]],'as':_0x1b7ba3['as'],'attributes':_0x1b7ba3[_0xda0b('0x17')],'include':_0x1b7ba3[_0xda0b('0x18')]?_['map'](_0x1b7ba3[_0xda0b('0x18')],function(_0x343c9b){return{'model':db[_0x343c9b[_0xda0b('0x1a')]],'as':_0x343c9b['as'],'attributes':_0x343c9b[_0xda0b('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x27c10f){logger[_0xda0b('0x1b')](_0xda0b('0x1c'),_0x46dec7);logger[_0xda0b('0xb')]('GetCmHopper',_0x46dec7,JSON[_0xda0b('0xd')](_0x27c10f));_0x1a23b0(_0x27c10f);})['catch'](function(_0x2e258d){logger[_0xda0b('0xe')](_0xda0b('0x1c'),_0x2e258d[_0xda0b('0x10')],_0x46dec7);_0x2ad3a7(_0x75173c['error'](0x1f4,_0x2e258d[_0xda0b('0x10')]));});});};exports['ShowCmHopper']=function(_0x3ebbb0){var _0x1adaa9=this;return new Promise(function(_0x385d40,_0x1f98b5){return db[_0xda0b('0x12')][_0xda0b('0x1d')]({'raw':_0x3ebbb0[_0xda0b('0x14')]?_0x3ebbb0[_0xda0b('0x14')][_0xda0b('0x15')]===undefined?!![]:![]:!![],'where':_0x3ebbb0[_0xda0b('0x14')]?_0x3ebbb0['options'][_0xda0b('0x16')]||null:null,'attributes':_0x3ebbb0[_0xda0b('0x14')]?_0x3ebbb0[_0xda0b('0x14')][_0xda0b('0x17')]||null:null,'include':_0x3ebbb0['options']?_0x3ebbb0[_0xda0b('0x14')][_0xda0b('0x18')]?_[_0xda0b('0x19')](_0x3ebbb0['options']['include'],function(_0x408fc2){return{'model':db[_0x408fc2[_0xda0b('0x1a')]],'as':_0x408fc2['as'],'attributes':_0x408fc2[_0xda0b('0x17')],'include':_0x408fc2['include']?_[_0xda0b('0x19')](_0x408fc2['include'],function(_0x1c6304){return{'model':db[_0x1c6304[_0xda0b('0x1a')]],'as':_0x1c6304['as'],'attributes':_0x1c6304[_0xda0b('0x17')],'include':_0x1c6304[_0xda0b('0x18')]?_['map'](_0x1c6304[_0xda0b('0x18')],function(_0x33ad8f){return{'model':db[_0x33ad8f[_0xda0b('0x1a')]],'as':_0x33ad8f['as'],'attributes':_0x33ad8f[_0xda0b('0x17')]};}):[]};}):[]};}):[]:[]})[_0xda0b('0x9')](function(_0x390ad3){logger['info'](_0xda0b('0x1e'),_0x3ebbb0);logger[_0xda0b('0xb')](_0xda0b('0x1e'),_0x3ebbb0,JSON[_0xda0b('0xd')](_0x390ad3));_0x385d40(_0x390ad3);})[_0xda0b('0x1f')](function(_0x4bd23f){logger[_0xda0b('0xe')]('ShowCmHopper',_0x4bd23f[_0xda0b('0x10')],_0x3ebbb0);_0x1f98b5(_0x1adaa9['error'](0x1f4,_0x4bd23f[_0xda0b('0x10')]));});});};exports[_0xda0b('0x20')]=function(_0x3e2022){var _0x43467f=this;return new Promise(function(_0x1240ba,_0x2c4f65){return db[_0xda0b('0x12')][_0xda0b('0x21')](_0x3e2022['body'],{'raw':_0x3e2022[_0xda0b('0x14')]?_0x3e2022[_0xda0b('0x14')][_0xda0b('0x15')]===undefined?!![]:![]:!![]})[_0xda0b('0x9')](function(_0x5d2eb6){logger[_0xda0b('0x1b')]('CreateCmHopper',_0x3e2022);logger[_0xda0b('0xb')](_0xda0b('0x20'),_0x3e2022,JSON[_0xda0b('0xd')](_0x5d2eb6));_0x1240ba(_0x5d2eb6);})[_0xda0b('0x1f')](function(_0x3de21f){logger[_0xda0b('0xe')](_0xda0b('0x20'),_0x3de21f[_0xda0b('0x10')],_0x3e2022);_0x2c4f65(_0x43467f[_0xda0b('0xe')](0x1f4,_0x3de21f[_0xda0b('0x10')]));});});};exports[_0xda0b('0x22')]=function(_0x296255){var _0x1a2094=this;return new Promise(function(_0x42d3ec,_0x2543cc){return db['CmHopper']['update'](_0x296255[_0xda0b('0x23')],{'raw':_0x296255['options']?_0x296255[_0xda0b('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x296255['options']?_0x296255['options'][_0xda0b('0x16')]||null:null,'attributes':_0x296255[_0xda0b('0x14')]?_0x296255[_0xda0b('0x14')][_0xda0b('0x17')]||null:null,'limit':_0x296255[_0xda0b('0x14')]?_0x296255[_0xda0b('0x14')]['limit']||null:null})['then'](function(_0x431e3c){logger[_0xda0b('0x1b')](_0xda0b('0x22'),_0x296255);logger[_0xda0b('0x1b')](_0xda0b('0x24'),JSON[_0xda0b('0xd')](_0x296255[_0xda0b('0x14')][_0xda0b('0x16')]),_0x296255['body'][_0xda0b('0x25')]);logger['debug'](_0xda0b('0x22'),_0x296255,JSON['stringify'](_0x431e3c));_0x42d3ec(_0x431e3c);})[_0xda0b('0x1f')](function(_0x45950a){logger['error']('UpdateCmHopper',_0x45950a[_0xda0b('0x10')],_0x296255);_0x2543cc(_0x1a2094['error'](0x1f4,_0x45950a[_0xda0b('0x10')]));});});};exports[_0xda0b('0x26')]=function(_0x5272eb){var _0x4dabd5=this;return new Promise(function(_0x489eb2,_0x19839a){return db[_0xda0b('0x12')][_0xda0b('0x27')]({'where':_0x5272eb[_0xda0b('0x14')]?_0x5272eb[_0xda0b('0x14')][_0xda0b('0x16')]||null:null})[_0xda0b('0x9')](function(_0x59847e){logger[_0xda0b('0x1b')](_0xda0b('0x26'),_0x5272eb);logger['debug'](_0xda0b('0x26'),_0x5272eb,JSON[_0xda0b('0xd')](_0x59847e));_0x489eb2(_0x59847e);})[_0xda0b('0x1f')](function(_0x21bcb7){logger[_0xda0b('0xe')]('DestroyCmHopper',_0x21bcb7[_0xda0b('0x10')],_0x5272eb);_0x19839a(_0x4dabd5[_0xda0b('0xe')](0x1f4,_0x21bcb7[_0xda0b('0x10')]));});});};exports[_0xda0b('0x28')]=function(_0x55c439){var _0x41cfce=this;return new Promise(function(_0x5ecfbd,_0x1b6bc9){return db[_0xda0b('0x29')][_0xda0b('0x2a')]()['then'](function(_0x5a16e6){return db[_0xda0b('0x2b')][_0xda0b('0x2c')](function(_0x15bf75){return db[_0xda0b('0x12')][_0xda0b('0x13')]({'where':_0x55c439[_0xda0b('0x14')]?_0x55c439[_0xda0b('0x14')][_0xda0b('0x16')]||null:null,'attributes':_0x55c439[_0xda0b('0x14')]?_0x55c439[_0xda0b('0x14')]['attributes']||null:null,'limit':_0x55c439[_0xda0b('0x14')]?_0x55c439[_0xda0b('0x14')][_0xda0b('0x2d')]||null:null,'order':_0x55c439[_0xda0b('0x14')]?_0x55c439[_0xda0b('0x14')][_0xda0b('0x2e')]||null:null,'transaction':_0x15bf75,'lock':_0x15bf75['LOCK'][_0xda0b('0x2f')],'include':[{'model':db[_0xda0b('0x29')],'as':'Contact','attributes':_['keys'](_0x5a16e6)},{'model':db[_0xda0b('0x30')],'as':_0xda0b('0x31'),'attributes':['id',_0xda0b('0x32'),_0xda0b('0x33')]}]})[_0xda0b('0x9')](function(_0x3f023d){var _0x571009=[];var _0x3b7c6f=[];for(var _0x3404c4=0x0;_0x3404c4<_0x3f023d[_0xda0b('0x34')];_0x3404c4+=0x1){var _0x1279a4=_0x3f023d[_0x3404c4][_0xda0b('0x35')];if(_0x1279a4===null){_0x571009[_0xda0b('0x36')](_0x3f023d[_0x3404c4]['update'](_0x55c439['body'],{'transaction':_0x15bf75}));}else if(!_0x3b7c6f[_0xda0b('0x37')](_0x1279a4)){_0x3b7c6f['push'](_0x1279a4);_0x571009['push'](_0x3f023d[_0x3404c4]['update'](_0x55c439[_0xda0b('0x23')],{'transaction':_0x15bf75}));}}return BPromise[_0xda0b('0x38')](_0x571009);});})[_0xda0b('0x9')](function(_0x15f34a){logger[_0xda0b('0x1b')]('GetContactDialer',_0x55c439);if(_0x15f34a[_0xda0b('0x34')]>0x0){logger[_0xda0b('0x1b')](_0xda0b('0x39'),_0x15f34a[0x0][_0xda0b('0x3a')]['id'],_0x15f34a[0x0][_0xda0b('0x3a')][_0xda0b('0x3b')],_0x15f34a[0x0]['dataValues'][_0xda0b('0x25')]);}logger[_0xda0b('0xb')](_0xda0b('0x28'),_0x55c439,JSON[_0xda0b('0xd')](_0x15f34a));_0x5ecfbd(_0x15f34a);})[_0xda0b('0x1f')](function(_0x1337c5){logger['error'](_0xda0b('0x28'),_0x1337c5[_0xda0b('0x10')],_0x55c439);_0x1b6bc9(_0x41cfce[_0xda0b('0xe')](0x1f4,_0x1337c5[_0xda0b('0x10')]));});});});};exports[_0xda0b('0x3c')]=function(_0x4c6419){var _0x197450=this;return new Promise(function(_0x4bb948,_0x1f9236){return db[_0xda0b('0x2b')][_0xda0b('0x2c')](function(_0x1d972a){return db[_0xda0b('0x3d')][_0xda0b('0x21')](_0x4c6419[_0xda0b('0x23')],{'raw':_0x4c6419[_0xda0b('0x14')]?_0x4c6419[_0xda0b('0x14')][_0xda0b('0x15')]===undefined?!![]:![]:!![],'transaction':_0x1d972a})[_0xda0b('0x9')](function(){logger['info']('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xda0b('0xd')](_0x4c6419[_0xda0b('0x14')]['where']),_0x4c6419[_0xda0b('0x14')]['where']['active']);return db[_0xda0b('0x12')][_0xda0b('0x27')]({'where':_0x4c6419[_0xda0b('0x14')]?_0x4c6419['options']['where']||null:null,'transaction':_0x1d972a});});})[_0xda0b('0x9')](function(_0xdd503){logger[_0xda0b('0x1b')](_0xda0b('0x3c'),_0x4c6419);logger[_0xda0b('0xb')](_0xda0b('0x3c'),_0x4c6419,JSON['stringify'](_0xdd503));_0x4bb948(_0xdd503);})[_0xda0b('0x1f')](function(_0x26d605){logger['error'](_0xda0b('0x3c'),_0x26d605[_0xda0b('0x10')],_0x4c6419);_0x1f9236(_0x197450['error'](0x1f4,_0x26d605[_0xda0b('0x10')]));});});};exports[_0xda0b('0x3e')]=function(_0x29feac){var _0x11de75=this;return new Promise(function(_0x508767,_0x283db9){return db['CmHopper'][_0xda0b('0x13')]({'raw':_0x29feac[_0xda0b('0x14')]?_0x29feac[_0xda0b('0x14')][_0xda0b('0x15')]===undefined?!![]:![]:!![],'where':_0x29feac['options']?_0x29feac['options'][_0xda0b('0x16')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xda0b('0x2b')][_0xda0b('0x3f')]('`scheduledat`\x20>=\x20'+util[_0xda0b('0x40')]('\x22%s\x22',moment()[_0xda0b('0x40')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xda0b('0x41')))),_0xda0b('0x42')]]})[_0xda0b('0x9')](function(_0x27c76a){logger[_0xda0b('0x1b')](_0xda0b('0x3e'),_0x29feac);logger[_0xda0b('0xb')](_0xda0b('0x3e'),_0x29feac,JSON[_0xda0b('0xd')](_0x27c76a));_0x508767(_0x27c76a);})[_0xda0b('0x1f')](function(_0x219cb1){logger['error'](_0xda0b('0x3e'),_0x219cb1['message'],_0x29feac);_0x283db9(_0x11de75['error'](0x1f4,_0x219cb1[_0xda0b('0x10')]));});});};exports[_0xda0b('0x43')]=function(_0x4ce8ad){var _0x5a94ec=this;return new Promise(function(_0x8bf7d6,_0x4f5916){return db[_0xda0b('0x29')][_0xda0b('0x2a')]()['then'](function(_0x17159f){return db[_0xda0b('0x2b')]['transaction'](function(_0x113553){return db[_0xda0b('0x12')][_0xda0b('0x13')]({'where':_0x4ce8ad[_0xda0b('0x14')]?_0x4ce8ad['options'][_0xda0b('0x16')]||null:null,'attributes':_0x4ce8ad[_0xda0b('0x14')]?_0x4ce8ad[_0xda0b('0x14')]['attributes']||null:null,'limit':0x1,'order':_0x4ce8ad[_0xda0b('0x14')]?_0x4ce8ad['options'][_0xda0b('0x2e')]||null:null,'group':db[_0xda0b('0x12')][_0xda0b('0x35')],'transaction':_0x113553,'lock':_0x113553[_0xda0b('0x44')][_0xda0b('0x2f')],'include':_0x4ce8ad[_0xda0b('0x14')]?_0x4ce8ad[_0xda0b('0x14')]['include']?_[_0xda0b('0x19')](_0x4ce8ad[_0xda0b('0x14')]['include'],function(_0x5a920b){return{'model':db[_0x5a920b[_0xda0b('0x1a')]],'as':_0x5a920b['as'],'attributes':_0x5a920b['attributes'],'include':_0x5a920b['include']?_[_0xda0b('0x19')](_0x5a920b[_0xda0b('0x18')],function(_0x41cf3b){return{'model':db[_0x41cf3b[_0xda0b('0x1a')]],'as':_0x41cf3b['as'],'attributes':_0x41cf3b[_0xda0b('0x17')],'include':_0x41cf3b[_0xda0b('0x18')]?_[_0xda0b('0x19')](_0x41cf3b['include'],function(_0x42229a){return{'model':db[_0x42229a[_0xda0b('0x1a')]],'as':_0x42229a['as'],'attributes':_0x42229a[_0xda0b('0x17')]};}):[]};}):[]};}):[]:[]})[_0xda0b('0x9')](function(_0x2d7354){var _0x17ac1e=[];for(var _0x3cb877=0x0;_0x3cb877<_0x2d7354[_0xda0b('0x34')];_0x3cb877+=0x1){_0x17ac1e[_0xda0b('0x36')](_0x2d7354[_0x3cb877][_0xda0b('0x45')](_0x4ce8ad[_0xda0b('0x23')],{'transaction':_0x113553}));}return BPromise[_0xda0b('0x38')](_0x17ac1e);});})[_0xda0b('0x9')](function(_0x40c646){logger[_0xda0b('0x1b')](_0xda0b('0x43'),_0x4ce8ad);logger[_0xda0b('0xb')](_0xda0b('0x43'),_0x4ce8ad,JSON[_0xda0b('0xd')](_0x40c646));_0x8bf7d6(_0x40c646);})[_0xda0b('0x1f')](function(_0x18363a){logger['error']('GetContactRecallMe',_0x18363a['message'],_0x4ce8ad);_0x4f5916(_0x5a94ec['error'](0x1f4,_0x18363a[_0xda0b('0x10')]));});});});};exports[_0xda0b('0x46')]=function(_0x3c0e51){var _0x19f055=this;return new Promise(function(_0x5dacc3,_0x5a8746){db[_0xda0b('0x29')][_0xda0b('0x2a')]()[_0xda0b('0x9')](function(_0x2058db){return db[_0xda0b('0x12')][_0xda0b('0x13')]({'raw':_0x3c0e51[_0xda0b('0x14')]?_0x3c0e51['options'][_0xda0b('0x15')]===undefined?!![]:![]:!![],'where':_0x3c0e51['options']?_0x3c0e51[_0xda0b('0x14')][_0xda0b('0x16')]||null:null,'attributes':_0x3c0e51[_0xda0b('0x14')]?_0x3c0e51[_0xda0b('0x14')][_0xda0b('0x17')]||null:null,'limit':_0x3c0e51[_0xda0b('0x14')]?_0x3c0e51[_0xda0b('0x14')][_0xda0b('0x2d')]||null:null,'include':_0x3c0e51[_0xda0b('0x14')]?_0x3c0e51['options']['include']?_[_0xda0b('0x19')](_0x3c0e51[_0xda0b('0x14')][_0xda0b('0x18')],function(_0x2ad588){return{'model':db[_0x2ad588[_0xda0b('0x1a')]],'as':_0x2ad588['as'],'attributes':_0x2ad588['as']===_0xda0b('0x47')?_[_0xda0b('0x48')](_0x2058db):_0x2ad588[_0xda0b('0x17')],'include':_0x2ad588['include']?_[_0xda0b('0x19')](_0x2ad588[_0xda0b('0x18')],function(_0x3bd97d){return{'model':db[_0x3bd97d[_0xda0b('0x1a')]],'as':_0x3bd97d['as'],'attributes':_0x3bd97d[_0xda0b('0x17')],'include':_0x3bd97d[_0xda0b('0x18')]?_[_0xda0b('0x19')](_0x3bd97d[_0xda0b('0x18')],function(_0x48b05b){return{'model':db[_0x48b05b[_0xda0b('0x1a')]],'as':_0x48b05b['as'],'attributes':_0x48b05b[_0xda0b('0x17')]};}):[]};}):[]};}):[]:[]})[_0xda0b('0x9')](function(_0x558323){logger[_0xda0b('0x1b')](_0xda0b('0x1c'),_0x3c0e51);logger[_0xda0b('0xb')](_0xda0b('0x1c'),_0x3c0e51,JSON[_0xda0b('0xd')](_0x558323));_0x5dacc3(_0x558323);})[_0xda0b('0x1f')](function(_0x3e2b78){logger[_0xda0b('0xe')](_0xda0b('0x1c'),_0x3e2b78[_0xda0b('0x10')],_0x3c0e51);_0x5a8746(_0x19f055[_0xda0b('0xe')](0x1f4,_0x3e2b78[_0xda0b('0x10')]));});});});};exports['ResetActiveCalls']=function(_0x20f661){var _0x5e9ed2=this;return new Promise(function(_0x4c8454,_0x4f409f){return db[_0xda0b('0x2b')][_0xda0b('0x2c')](function(_0x397732){return db['CmHopper']['update']({'active':![]},{'where':{},'transaction':_0x397732})[_0xda0b('0x9')](function(_0x2c24c6){logger[_0xda0b('0x1b')](_0xda0b('0x49'),_0x20f661);logger[_0xda0b('0xb')]('ResetActiveCalls',_0x20f661,JSON[_0xda0b('0xd')](_0x2c24c6));_0x4c8454(_0x2c24c6);})['catch'](function(_0x59e754){logger['error'](_0xda0b('0x49'),_0x59e754[_0xda0b('0x10')],_0x20f661);_0x4f409f(_0x5e9ed2[_0xda0b('0xe')](0x1f4,_0x59e754[_0xda0b('0x10')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 8fbfd58..39c762b 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 _0xdc86=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','post','/preview','getPreview','delete','exports'];(function(_0x366da5,_0x1f2101){var _0x4a7086=function(_0x8c5878){while(--_0x8c5878){_0x366da5['push'](_0x366da5['shift']());}};_0x4a7086(++_0x1f2101);}(_0xdc86,0x118));var _0x6dc8=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xdc86[_0x2235bf];return _0x4c3a64;};'use strict';var multer=require('multer');var util=require(_0x6dc8('0x0'));var path=require('path');var timeout=require(_0x6dc8('0x1'));var express=require('express');var router=express[_0x6dc8('0x2')]();var fs_extra=require(_0x6dc8('0x3'));var auth=require(_0x6dc8('0x4'));var interaction=require(_0x6dc8('0x5'));var config=require(_0x6dc8('0x6'));var controller=require('./cmHopper.controller');router[_0x6dc8('0x7')]('/',auth[_0x6dc8('0x8')](),controller[_0x6dc8('0x9')]);router[_0x6dc8('0x7')](_0x6dc8('0xa'),auth[_0x6dc8('0x8')](),controller[_0x6dc8('0xb')]);router[_0x6dc8('0x7')]('/opencontacts',auth[_0x6dc8('0x8')](),controller['getOpenContacts']);router[_0x6dc8('0x7')](_0x6dc8('0xc'),auth[_0x6dc8('0x8')](),controller[_0x6dc8('0xd')]);router['post']('/',auth[_0x6dc8('0x8')](),controller[_0x6dc8('0xe')]);router[_0x6dc8('0xf')](_0x6dc8('0x10'),auth[_0x6dc8('0x8')](),controller[_0x6dc8('0x11')]);router['put'](_0x6dc8('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x6dc8('0x12')](_0x6dc8('0xc'),auth[_0x6dc8('0x8')](),controller['destroy']);module[_0x6dc8('0x13')]=router; \ No newline at end of file +var _0x1848=['put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe','/opencontacts','/:id','show','post','create','/preview','getPreview'];(function(_0x3b231a,_0x53a00d){var _0x18d67a=function(_0x5e14c6){while(--_0x5e14c6){_0x3b231a['push'](_0x3b231a['shift']());}};_0x18d67a(++_0x53a00d);}(_0x1848,0x117));var _0x8184=function(_0x40aff1,_0x5ac322){_0x40aff1=_0x40aff1-0x0;var _0x49f265=_0x1848[_0x40aff1];return _0x49f265;};'use strict';var multer=require(_0x8184('0x0'));var util=require(_0x8184('0x1'));var path=require('path');var timeout=require(_0x8184('0x2'));var express=require(_0x8184('0x3'));var router=express[_0x8184('0x4')]();var fs_extra=require(_0x8184('0x5'));var auth=require(_0x8184('0x6'));var interaction=require(_0x8184('0x7'));var config=require(_0x8184('0x8'));var controller=require(_0x8184('0x9'));router[_0x8184('0xa')]('/',auth[_0x8184('0xb')](),controller[_0x8184('0xc')]);router[_0x8184('0xa')](_0x8184('0xd'),auth[_0x8184('0xb')](),controller['describe']);router[_0x8184('0xa')](_0x8184('0xe'),auth[_0x8184('0xb')](),controller['getOpenContacts']);router[_0x8184('0xa')](_0x8184('0xf'),auth['isAuthenticated'](),controller[_0x8184('0x10')]);router[_0x8184('0x11')]('/',auth[_0x8184('0xb')](),controller[_0x8184('0x12')]);router[_0x8184('0x11')](_0x8184('0x13'),auth[_0x8184('0xb')](),controller[_0x8184('0x14')]);router[_0x8184('0x15')](_0x8184('0xf'),auth[_0x8184('0xb')](),controller[_0x8184('0x16')]);router[_0x8184('0x17')](_0x8184('0xf'),auth['isAuthenticated'](),controller[_0x8184('0x18')]);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 fe20df7..dd02206 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 _0xc812=['exports','INTEGER','contactListQueue','moment','sequelize'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0xc812,0xbc));var _0x2c81=function(_0x39b710,_0x413b97){_0x39b710=_0x39b710-0x0;var _0x172811=_0xc812[_0x39b710];return _0x172811;};'use strict';var moment=require(_0x2c81('0x0'));var Sequelize=require(_0x2c81('0x1'));module[_0x2c81('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x2c81('0x3')],'unique':_0x2c81('0x4')},'ListId':{'type':Sequelize[_0x2c81('0x3')],'unique':_0x2c81('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x2c81('0x4')}}; \ No newline at end of file +var _0xfd2e=['INTEGER','contactListQueue','moment','exports'];(function(_0x1c0a4e,_0xf6a625){var _0x58b8eb=function(_0x153249){while(--_0x153249){_0x1c0a4e['push'](_0x1c0a4e['shift']());}};_0x58b8eb(++_0xf6a625);}(_0xfd2e,0x6e));var _0xefd2=function(_0x477a69,_0x2c7212){_0x477a69=_0x477a69-0x0;var _0x79ab6f=_0xfd2e[_0x477a69];return _0x79ab6f;};'use strict';var moment=require(_0xefd2('0x0'));var Sequelize=require('sequelize');module[_0xefd2('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xefd2('0x2')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xefd2('0x2')],'unique':_0xefd2('0x3')},'VoiceQueueId':{'type':Sequelize[_0xefd2('0x2')],'unique':_0xefd2('0x3')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index dfe7a66..beef199 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 _0xaa76=['error','name','send','index','map','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','CmHopperBlack','includeAll','include','findAll','rows','catch','show','rawAttributes','body','params','find','describe','eml-format','rimraf','zip-dir','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','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','limit','count','set','Content-Range','apply','reject','update','then','destroy','end'];(function(_0x2e267b,_0x5461ac){var _0x1907d9=function(_0x26cdfc){while(--_0x26cdfc){_0x2e267b['push'](_0x2e267b['shift']());}};_0x1907d9(++_0x5461ac);}(_0xaa76,0xbb));var _0x6aa7=function(_0x132a87,_0x5ee3fb){_0x132a87=_0x132a87-0x0;var _0x1ef144=_0xaa76[_0x132a87];return _0x1ef144;};'use strict';var emlformat=require(_0x6aa7('0x0'));var rimraf=require(_0x6aa7('0x1'));var zipdir=require(_0x6aa7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6aa7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6aa7('0x4'));var util=require(_0x6aa7('0x5'));var path=require('path');var sox=require(_0x6aa7('0x6'));var csv=require(_0x6aa7('0x7'));var ejs=require(_0x6aa7('0x8'));var fs=require('fs');var fs_extra=require(_0x6aa7('0x9'));var _=require(_0x6aa7('0xa'));var squel=require(_0x6aa7('0xb'));var crypto=require(_0x6aa7('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6aa7('0x7'));var querystring=require('querystring');var Papa=require(_0x6aa7('0xd'));var Redis=require('ioredis');var authService=require(_0x6aa7('0xe'));var qs=require(_0x6aa7('0xf'));var as=require(_0x6aa7('0x10'));var hardwareService=require(_0x6aa7('0x11'));var logger=require(_0x6aa7('0x12'))(_0x6aa7('0x13'));var utils=require(_0x6aa7('0x14'));var config=require(_0x6aa7('0x15'));var licenseUtil=require(_0x6aa7('0x16'));var db=require(_0x6aa7('0x17'))['db'];function respondWithStatusCode(_0x4c9566,_0x5a122d){_0x5a122d=_0x5a122d||0xcc;return function(_0x1eb672){if(_0x1eb672){return _0x4c9566[_0x6aa7('0x18')](_0x5a122d);}return _0x4c9566[_0x6aa7('0x19')](_0x5a122d)['end']();};}function respondWithResult(_0x5d135d,_0x1bd415){_0x1bd415=_0x1bd415||0xc8;return function(_0x50ba79){if(_0x50ba79){return _0x5d135d[_0x6aa7('0x19')](_0x1bd415)[_0x6aa7('0x1a')](_0x50ba79);}};}function respondWithFilteredResult(_0x811189,_0x528bb2){return function(_0x24b4ea){if(_0x24b4ea){var _0x1a888c=typeof _0x528bb2[_0x6aa7('0x1b')]==='undefined'&&typeof _0x528bb2[_0x6aa7('0x1c')]==='undefined';var _0x207495=_0x24b4ea[_0x6aa7('0x1d')];var _0x5a9d06=_0x1a888c?0x0:_0x528bb2['offset'];var _0x2e4c87=_0x1a888c?_0x24b4ea[_0x6aa7('0x1d')]:_0x528bb2[_0x6aa7('0x1b')]+_0x528bb2[_0x6aa7('0x1c')];var _0x4d8132;if(_0x2e4c87>=_0x207495){_0x2e4c87=_0x207495;_0x4d8132=0xc8;}else{_0x4d8132=0xce;}_0x811189[_0x6aa7('0x19')](_0x4d8132);return _0x811189[_0x6aa7('0x1e')](_0x6aa7('0x1f'),_0x5a9d06+'-'+_0x2e4c87+'/'+_0x207495)[_0x6aa7('0x1a')](_0x24b4ea);}return null;};}function patchUpdates(_0x5d9af3){return function(_0x5a1091){try{jsonpatch[_0x6aa7('0x20')](_0x5a1091,_0x5d9af3,!![]);}catch(_0x36dac8){return BPromise[_0x6aa7('0x21')](_0x36dac8);}return _0x5a1091['save']();};}function saveUpdates(_0x198645,_0x2f4611){return function(_0x4c7bf3){if(_0x4c7bf3){return _0x4c7bf3[_0x6aa7('0x22')](_0x198645)[_0x6aa7('0x23')](function(_0x4d25a9){return _0x4d25a9;});}return null;};}function removeEntity(_0x58e027,_0xc27181){return function(_0x75b5e1){if(_0x75b5e1){return _0x75b5e1[_0x6aa7('0x24')]()[_0x6aa7('0x23')](function(){_0x58e027['status'](0xcc)[_0x6aa7('0x25')]();});}};}function handleEntityNotFound(_0x33d58d,_0x2f5c23){return function(_0x530bc8){if(!_0x530bc8){_0x33d58d[_0x6aa7('0x18')](0x194);}return _0x530bc8;};}function handleError(_0x265609,_0x45b706){_0x45b706=_0x45b706||0x1f4;return function(_0x510743){logger[_0x6aa7('0x26')](_0x510743['stack']);if(_0x510743[_0x6aa7('0x27')]){delete _0x510743['name'];}_0x265609[_0x6aa7('0x19')](_0x45b706)[_0x6aa7('0x28')](_0x510743);};}exports[_0x6aa7('0x29')]=function(_0x1f0984,_0x57781c){var _0x467c33={},_0x1f090b={},_0x40390a={'count':0x0,'rows':[]};var _0x4b1a8c=_[_0x6aa7('0x2a')](db['CmHopperBlack']['rawAttributes'],function(_0x539726){return{'name':_0x539726[_0x6aa7('0x2b')],'type':_0x539726['type'][_0x6aa7('0x2c')]};});_0x1f090b['model']=_[_0x6aa7('0x2a')](_0x4b1a8c,_0x6aa7('0x27'));_0x1f090b[_0x6aa7('0x2d')]=_[_0x6aa7('0x2e')](_0x1f0984[_0x6aa7('0x2d')]);_0x1f090b[_0x6aa7('0x2f')]=_[_0x6aa7('0x30')](_0x1f090b[_0x6aa7('0x31')],_0x1f090b[_0x6aa7('0x2d')]);_0x467c33[_0x6aa7('0x32')]=_[_0x6aa7('0x30')](_0x1f090b[_0x6aa7('0x31')],qs['fields'](_0x1f0984[_0x6aa7('0x2d')][_0x6aa7('0x33')]));_0x467c33[_0x6aa7('0x32')]=_0x467c33['attributes'][_0x6aa7('0x34')]?_0x467c33[_0x6aa7('0x32')]:_0x1f090b[_0x6aa7('0x31')];if(!_0x1f0984[_0x6aa7('0x2d')][_0x6aa7('0x35')](_0x6aa7('0x36'))){_0x467c33[_0x6aa7('0x1c')]=qs[_0x6aa7('0x1c')](_0x1f0984[_0x6aa7('0x2d')][_0x6aa7('0x1c')]);_0x467c33[_0x6aa7('0x1b')]=qs[_0x6aa7('0x1b')](_0x1f0984[_0x6aa7('0x2d')]['offset']);}_0x467c33[_0x6aa7('0x37')]=qs[_0x6aa7('0x38')](_0x1f0984[_0x6aa7('0x2d')][_0x6aa7('0x38')]);_0x467c33['where']=qs[_0x6aa7('0x2f')](_[_0x6aa7('0x39')](_0x1f0984[_0x6aa7('0x2d')],_0x1f090b[_0x6aa7('0x2f')]),_0x4b1a8c);if(_0x1f0984[_0x6aa7('0x2d')][_0x6aa7('0x3a')]){_0x467c33[_0x6aa7('0x3b')]=_[_0x6aa7('0x3c')](_0x467c33[_0x6aa7('0x3b')],{'$or':_[_0x6aa7('0x2a')](_0x4b1a8c,function(_0x15c2a9){if(_0x15c2a9[_0x6aa7('0x3d')]!==_0x6aa7('0x3e')){var _0x23d046={};_0x23d046[_0x15c2a9[_0x6aa7('0x27')]]={'$like':'%'+_0x1f0984[_0x6aa7('0x2d')][_0x6aa7('0x3a')]+'%'};return _0x23d046;}})});}_0x467c33=_[_0x6aa7('0x3c')]({},_0x467c33,_0x1f0984['options']);var _0x428d08={'where':_0x467c33[_0x6aa7('0x3b')]};return db[_0x6aa7('0x3f')][_0x6aa7('0x1d')](_0x428d08)[_0x6aa7('0x23')](function(_0x46812b){_0x40390a[_0x6aa7('0x1d')]=_0x46812b;if(_0x1f0984[_0x6aa7('0x2d')][_0x6aa7('0x40')]){_0x467c33[_0x6aa7('0x41')]=[{'all':!![]}];}return db[_0x6aa7('0x3f')][_0x6aa7('0x42')](_0x467c33);})[_0x6aa7('0x23')](function(_0xc409a1){_0x40390a[_0x6aa7('0x43')]=_0xc409a1;return _0x40390a;})['then'](respondWithFilteredResult(_0x57781c,_0x467c33))[_0x6aa7('0x44')](handleError(_0x57781c,null));};exports[_0x6aa7('0x45')]=function(_0x2ed8b8,_0x56d5ee){var _0x2e58f2={'raw':!![],'where':{'id':_0x2ed8b8['params']['id']}},_0x4717db={};_0x4717db[_0x6aa7('0x31')]=_[_0x6aa7('0x2e')](db[_0x6aa7('0x3f')][_0x6aa7('0x46')]);_0x4717db[_0x6aa7('0x2d')]=_['keys'](_0x2ed8b8[_0x6aa7('0x2d')]);_0x4717db[_0x6aa7('0x2f')]=_[_0x6aa7('0x30')](_0x4717db[_0x6aa7('0x31')],_0x4717db[_0x6aa7('0x2d')]);_0x2e58f2[_0x6aa7('0x32')]=_['intersection'](_0x4717db['model'],qs['fields'](_0x2ed8b8['query'][_0x6aa7('0x33')]));_0x2e58f2['attributes']=_0x2e58f2['attributes'][_0x6aa7('0x34')]?_0x2e58f2['attributes']:_0x4717db[_0x6aa7('0x31')];if(_0x2ed8b8[_0x6aa7('0x2d')][_0x6aa7('0x40')]){_0x2e58f2[_0x6aa7('0x41')]=[{'all':!![]}];}_0x2e58f2=_['merge']({},_0x2e58f2,_0x2ed8b8['options']);return db[_0x6aa7('0x3f')]['find'](_0x2e58f2)[_0x6aa7('0x23')](handleEntityNotFound(_0x56d5ee,null))[_0x6aa7('0x23')](respondWithResult(_0x56d5ee,null))[_0x6aa7('0x44')](handleError(_0x56d5ee,null));};exports[_0x6aa7('0x22')]=function(_0x257b8f,_0x3d8de6){if(_0x257b8f[_0x6aa7('0x47')]['id']){delete _0x257b8f[_0x6aa7('0x47')]['id'];}return db[_0x6aa7('0x3f')]['find']({'where':{'id':_0x257b8f[_0x6aa7('0x48')]['id']}})[_0x6aa7('0x23')](handleEntityNotFound(_0x3d8de6,null))['then'](saveUpdates(_0x257b8f['body'],null))[_0x6aa7('0x23')](respondWithResult(_0x3d8de6,null))[_0x6aa7('0x44')](handleError(_0x3d8de6,null));};exports[_0x6aa7('0x24')]=function(_0x160a6a,_0x2d8c51){return db['CmHopperBlack'][_0x6aa7('0x49')]({'where':{'id':_0x160a6a[_0x6aa7('0x48')]['id']}})['then'](handleEntityNotFound(_0x2d8c51,null))[_0x6aa7('0x23')](removeEntity(_0x2d8c51,null))[_0x6aa7('0x44')](handleError(_0x2d8c51,null));};exports[_0x6aa7('0x4a')]=function(_0x3335b3,_0x5e7248){return db[_0x6aa7('0x3f')][_0x6aa7('0x4a')]()[_0x6aa7('0x23')](respondWithResult(_0x5e7248,null))[_0x6aa7('0x44')](handleError(_0x5e7248,null));}; \ No newline at end of file +var _0x31da=['end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','CmHopperBlack','type','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','options','catch','body','find','describe','eml-format','zip-dir','request-promise','moment','mustache','util','sox','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/license/util','../../mysqldb','status'];(function(_0x2e5f9c,_0x134a52){var _0x538b44=function(_0x38ef13){while(--_0x38ef13){_0x2e5f9c['push'](_0x2e5f9c['shift']());}};_0x538b44(++_0x134a52);}(_0x31da,0xc2));var _0xa31d=function(_0x17a15e,_0x2f8664){_0x17a15e=_0x17a15e-0x0;var _0x1c3dc5=_0x31da[_0x17a15e];return _0x1c3dc5;};'use strict';var emlformat=require(_0xa31d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa31d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa31d('0x2'));var moment=require(_0xa31d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa31d('0x4'));var util=require(_0xa31d('0x5'));var path=require('path');var sox=require(_0xa31d('0x6'));var csv=require('to-csv');var ejs=require(_0xa31d('0x7'));var fs=require('fs');var fs_extra=require(_0xa31d('0x8'));var _=require(_0xa31d('0x9'));var squel=require(_0xa31d('0xa'));var crypto=require(_0xa31d('0xb'));var jsforce=require(_0xa31d('0xc'));var deskjs=require(_0xa31d('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa31d('0xe'));var Papa=require(_0xa31d('0xf'));var Redis=require(_0xa31d('0x10'));var authService=require(_0xa31d('0x11'));var qs=require(_0xa31d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa31d('0x13'));var logger=require(_0xa31d('0x14'))(_0xa31d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa31d('0x16'));var db=require(_0xa31d('0x17'))['db'];function respondWithStatusCode(_0x21219f,_0x37c080){_0x37c080=_0x37c080||0xcc;return function(_0x60d479){if(_0x60d479){return _0x21219f['sendStatus'](_0x37c080);}return _0x21219f[_0xa31d('0x18')](_0x37c080)[_0xa31d('0x19')]();};}function respondWithResult(_0x5f3fa0,_0x3730d8){_0x3730d8=_0x3730d8||0xc8;return function(_0x1b2c3d){if(_0x1b2c3d){return _0x5f3fa0[_0xa31d('0x18')](_0x3730d8)[_0xa31d('0x1a')](_0x1b2c3d);}};}function respondWithFilteredResult(_0x24a4da,_0x23b416){return function(_0x11218b){if(_0x11218b){var _0x42bfe9=typeof _0x23b416[_0xa31d('0x1b')]==='undefined'&&typeof _0x23b416[_0xa31d('0x1c')]===_0xa31d('0x1d');var _0x5aa86a=_0x11218b[_0xa31d('0x1e')];var _0xe7255b=_0x42bfe9?0x0:_0x23b416['offset'];var _0x2c014a=_0x42bfe9?_0x11218b['count']:_0x23b416[_0xa31d('0x1b')]+_0x23b416[_0xa31d('0x1c')];var _0xd2e90f;if(_0x2c014a>=_0x5aa86a){_0x2c014a=_0x5aa86a;_0xd2e90f=0xc8;}else{_0xd2e90f=0xce;}_0x24a4da['status'](_0xd2e90f);return _0x24a4da[_0xa31d('0x1f')](_0xa31d('0x20'),_0xe7255b+'-'+_0x2c014a+'/'+_0x5aa86a)['json'](_0x11218b);}return null;};}function patchUpdates(_0x5c025d){return function(_0x3f6765){try{jsonpatch['apply'](_0x3f6765,_0x5c025d,!![]);}catch(_0x1f9e46){return BPromise[_0xa31d('0x21')](_0x1f9e46);}return _0x3f6765[_0xa31d('0x22')]();};}function saveUpdates(_0xfaca1e,_0x4aa3d8){return function(_0x4868fd){if(_0x4868fd){return _0x4868fd[_0xa31d('0x23')](_0xfaca1e)[_0xa31d('0x24')](function(_0x5257c7){return _0x5257c7;});}return null;};}function removeEntity(_0x50d12f,_0x594ab1){return function(_0x589222){if(_0x589222){return _0x589222[_0xa31d('0x25')]()[_0xa31d('0x24')](function(){_0x50d12f[_0xa31d('0x18')](0xcc)[_0xa31d('0x19')]();});}};}function handleEntityNotFound(_0x4a3531,_0x12e2d3){return function(_0x5a17d4){if(!_0x5a17d4){_0x4a3531[_0xa31d('0x26')](0x194);}return _0x5a17d4;};}function handleError(_0x506b9c,_0x48a7b6){_0x48a7b6=_0x48a7b6||0x1f4;return function(_0x160086){logger[_0xa31d('0x27')](_0x160086[_0xa31d('0x28')]);if(_0x160086['name']){delete _0x160086[_0xa31d('0x29')];}_0x506b9c[_0xa31d('0x18')](_0x48a7b6)[_0xa31d('0x2a')](_0x160086);};}exports[_0xa31d('0x2b')]=function(_0x10ec34,_0x13f41c){var _0x10b572={},_0x3de0d7={},_0x2cc2ea={'count':0x0,'rows':[]};var _0x16d6be=_[_0xa31d('0x2c')](db[_0xa31d('0x2d')]['rawAttributes'],function(_0x27efa3){return{'name':_0x27efa3['fieldName'],'type':_0x27efa3[_0xa31d('0x2e')]['key']};});_0x3de0d7[_0xa31d('0x2f')]=_['map'](_0x16d6be,_0xa31d('0x29'));_0x3de0d7[_0xa31d('0x30')]=_['keys'](_0x10ec34[_0xa31d('0x30')]);_0x3de0d7['filters']=_[_0xa31d('0x31')](_0x3de0d7['model'],_0x3de0d7['query']);_0x10b572[_0xa31d('0x32')]=_[_0xa31d('0x31')](_0x3de0d7['model'],qs[_0xa31d('0x33')](_0x10ec34[_0xa31d('0x30')][_0xa31d('0x33')]));_0x10b572['attributes']=_0x10b572[_0xa31d('0x32')][_0xa31d('0x34')]?_0x10b572[_0xa31d('0x32')]:_0x3de0d7[_0xa31d('0x2f')];if(!_0x10ec34[_0xa31d('0x30')][_0xa31d('0x35')]('nolimit')){_0x10b572[_0xa31d('0x1c')]=qs['limit'](_0x10ec34[_0xa31d('0x30')]['limit']);_0x10b572['offset']=qs['offset'](_0x10ec34[_0xa31d('0x30')][_0xa31d('0x1b')]);}_0x10b572['order']=qs[_0xa31d('0x36')](_0x10ec34['query'][_0xa31d('0x36')]);_0x10b572[_0xa31d('0x37')]=qs[_0xa31d('0x38')](_[_0xa31d('0x39')](_0x10ec34[_0xa31d('0x30')],_0x3de0d7[_0xa31d('0x38')]),_0x16d6be);if(_0x10ec34[_0xa31d('0x30')][_0xa31d('0x3a')]){_0x10b572[_0xa31d('0x37')]=_[_0xa31d('0x3b')](_0x10b572[_0xa31d('0x37')],{'$or':_[_0xa31d('0x2c')](_0x16d6be,function(_0xc9c880){if(_0xc9c880['type']!==_0xa31d('0x3c')){var _0x1cfca3={};_0x1cfca3[_0xc9c880[_0xa31d('0x29')]]={'$like':'%'+_0x10ec34[_0xa31d('0x30')][_0xa31d('0x3a')]+'%'};return _0x1cfca3;}})});}_0x10b572=_[_0xa31d('0x3b')]({},_0x10b572,_0x10ec34['options']);var _0x2d94f6={'where':_0x10b572[_0xa31d('0x37')]};return db[_0xa31d('0x2d')][_0xa31d('0x1e')](_0x2d94f6)[_0xa31d('0x24')](function(_0x363ebe){_0x2cc2ea[_0xa31d('0x1e')]=_0x363ebe;if(_0x10ec34[_0xa31d('0x30')][_0xa31d('0x3d')]){_0x10b572[_0xa31d('0x3e')]=[{'all':!![]}];}return db[_0xa31d('0x2d')][_0xa31d('0x3f')](_0x10b572);})[_0xa31d('0x24')](function(_0x7b96b2){_0x2cc2ea[_0xa31d('0x40')]=_0x7b96b2;return _0x2cc2ea;})[_0xa31d('0x24')](respondWithFilteredResult(_0x13f41c,_0x10b572))['catch'](handleError(_0x13f41c,null));};exports[_0xa31d('0x41')]=function(_0xf3f2b8,_0xa0f034){var _0x1685e8={'raw':!![],'where':{'id':_0xf3f2b8[_0xa31d('0x42')]['id']}},_0x5f2f2d={};_0x5f2f2d['model']=_['keys'](db[_0xa31d('0x2d')]['rawAttributes']);_0x5f2f2d[_0xa31d('0x30')]=_[_0xa31d('0x43')](_0xf3f2b8[_0xa31d('0x30')]);_0x5f2f2d[_0xa31d('0x38')]=_[_0xa31d('0x31')](_0x5f2f2d[_0xa31d('0x2f')],_0x5f2f2d['query']);_0x1685e8[_0xa31d('0x32')]=_[_0xa31d('0x31')](_0x5f2f2d[_0xa31d('0x2f')],qs['fields'](_0xf3f2b8[_0xa31d('0x30')]['fields']));_0x1685e8[_0xa31d('0x32')]=_0x1685e8[_0xa31d('0x32')][_0xa31d('0x34')]?_0x1685e8[_0xa31d('0x32')]:_0x5f2f2d[_0xa31d('0x2f')];if(_0xf3f2b8[_0xa31d('0x30')][_0xa31d('0x3d')]){_0x1685e8[_0xa31d('0x3e')]=[{'all':!![]}];}_0x1685e8=_[_0xa31d('0x3b')]({},_0x1685e8,_0xf3f2b8[_0xa31d('0x44')]);return db[_0xa31d('0x2d')]['find'](_0x1685e8)[_0xa31d('0x24')](handleEntityNotFound(_0xa0f034,null))[_0xa31d('0x24')](respondWithResult(_0xa0f034,null))[_0xa31d('0x45')](handleError(_0xa0f034,null));};exports['update']=function(_0x67e5bf,_0x211ff0){if(_0x67e5bf[_0xa31d('0x46')]['id']){delete _0x67e5bf[_0xa31d('0x46')]['id'];}return db['CmHopperBlack'][_0xa31d('0x47')]({'where':{'id':_0x67e5bf['params']['id']}})[_0xa31d('0x24')](handleEntityNotFound(_0x211ff0,null))[_0xa31d('0x24')](saveUpdates(_0x67e5bf[_0xa31d('0x46')],null))['then'](respondWithResult(_0x211ff0,null))[_0xa31d('0x45')](handleError(_0x211ff0,null));};exports[_0xa31d('0x25')]=function(_0x5b3416,_0x613b0c){return db[_0xa31d('0x2d')]['find']({'where':{'id':_0x5b3416[_0xa31d('0x42')]['id']}})[_0xa31d('0x24')](handleEntityNotFound(_0x613b0c,null))[_0xa31d('0x24')](removeEntity(_0x613b0c,null))['catch'](handleError(_0x613b0c,null));};exports[_0xa31d('0x48')]=function(_0x2fc60c,_0x3e931d){return db['CmHopperBlack'][_0xa31d('0x48')]()['then'](respondWithResult(_0x3e931d,null))[_0xa31d('0x45')](handleError(_0x3e931d,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 2fadeb5..42ff4cc 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 _0xb6f5=['request-promise','rimraf','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb6f5,0x7e));var _0x5b6f=function(_0xd1f854,_0x532346){_0xd1f854=_0xd1f854-0x0;var _0x548294=_0xb6f5[_0xd1f854];return _0x548294;};'use strict';var _=require(_0x5b6f('0x0'));var util=require(_0x5b6f('0x1'));var logger=require(_0x5b6f('0x2'))(_0x5b6f('0x3'));var moment=require(_0x5b6f('0x4'));var BPromise=require(_0x5b6f('0x5'));var rp=require(_0x5b6f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5b6f('0x7'));var config=require('../../config/environment');var attributes=require('./cmHopperBlack.attributes');module[_0x5b6f('0x8')]=function(_0x1220ed,_0x20728){return _0x1220ed[_0x5b6f('0x9')](_0x5b6f('0xa'),attributes,{'tableName':_0x5b6f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8302=['../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x211fef,_0x4ab716){var _0x5447bf=function(_0x306ea3){while(--_0x306ea3){_0x211fef['push'](_0x211fef['shift']());}};_0x5447bf(++_0x4ab716);}(_0x8302,0xf4));var _0x2830=function(_0x51666b,_0x48e537){_0x51666b=_0x51666b-0x0;var _0x1858fa=_0x8302[_0x51666b];return _0x1858fa;};'use strict';var _=require(_0x2830('0x0'));var util=require(_0x2830('0x1'));var logger=require(_0x2830('0x2'))(_0x2830('0x3'));var moment=require('moment');var BPromise=require(_0x2830('0x4'));var rp=require(_0x2830('0x5'));var fs=require('fs');var path=require(_0x2830('0x6'));var rimraf=require(_0x2830('0x7'));var config=require(_0x2830('0x8'));var attributes=require(_0x2830('0x9'));module[_0x2830('0xa')]=function(_0x4b2bc7,_0x367626){return _0x4b2bc7[_0x2830('0xb')](_0x2830('0xc'),attributes,{'tableName':_0x2830('0xd'),'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 1a23d76..7d8d43a 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 _0x57e0=['jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','include','map','model','attributes','UpdateCmHopperBlack','update','body','limit','destroy','DestroyCmHopperBlack','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3b6735,_0x1c6cd4){var _0x364538=function(_0x26d0da){while(--_0x26d0da){_0x3b6735['push'](_0x3b6735['shift']());}};_0x364538(++_0x1c6cd4);}(_0x57e0,0x175));var _0x057e=function(_0x581048,_0x2f8a53){_0x581048=_0x581048-0x0;var _0x2bd590=_0x57e0[_0x581048];return _0x2bd590;};'use strict';var _=require(_0x057e('0x0'));var util=require('util');var moment=require(_0x057e('0x1'));var BPromise=require(_0x057e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x057e('0x3'));var logger=require(_0x057e('0x4'))(_0x057e('0x5'));var config=require(_0x057e('0x6'));var jayson=require(_0x057e('0x7'));var client=jayson[_0x057e('0x8')][_0x057e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30d6af,_0x1ef42b,_0x23e7b1){return new BPromise(function(_0x20e558,_0x260d49){return client[_0x057e('0xa')](_0x30d6af,_0x23e7b1)[_0x057e('0xb')](function(_0x5a4b2f){logger[_0x057e('0xc')](_0x057e('0xd'),_0x1ef42b,_0x057e('0xe'));logger[_0x057e('0xf')](_0x057e('0x10'),_0x1ef42b,_0x057e('0xe'),JSON[_0x057e('0x11')](_0x5a4b2f));if(_0x5a4b2f[_0x057e('0x12')]){if(_0x5a4b2f['error'][_0x057e('0x13')]===0x1f4){logger['error'](_0x057e('0xd'),_0x1ef42b,_0x5a4b2f[_0x057e('0x12')][_0x057e('0x14')]);return _0x260d49(_0x5a4b2f[_0x057e('0x12')][_0x057e('0x14')]);}logger[_0x057e('0x12')](_0x057e('0xd'),_0x1ef42b,_0x5a4b2f[_0x057e('0x12')][_0x057e('0x14')]);return _0x20e558(_0x5a4b2f[_0x057e('0x12')]['message']);}else{logger[_0x057e('0xc')]('CmHopperBlack,\x20%s,\x20%s',_0x1ef42b,_0x057e('0xe'));_0x20e558(_0x5a4b2f['result']['message']);}})[_0x057e('0x15')](function(_0x5deec1){logger[_0x057e('0x12')](_0x057e('0xd'),_0x1ef42b,_0x5deec1);_0x260d49(_0x5deec1);});});}exports[_0x057e('0x16')]=function(_0x173212){var _0x1708f2=this;return new Promise(function(_0x13e807,_0x4d2e47){return db[_0x057e('0x17')][_0x057e('0x18')]({'raw':_0x173212[_0x057e('0x19')]?_0x173212[_0x057e('0x19')][_0x057e('0x1a')]===undefined?!![]:![]:!![],'where':_0x173212[_0x057e('0x19')]?_0x173212[_0x057e('0x19')][_0x057e('0x1b')]||null:null,'attributes':_0x173212[_0x057e('0x19')]?_0x173212[_0x057e('0x19')]['attributes']||null:null,'limit':_0x173212[_0x057e('0x19')]?_0x173212[_0x057e('0x19')]['limit']||null:null,'include':_0x173212['options']?_0x173212[_0x057e('0x19')][_0x057e('0x1c')]?_[_0x057e('0x1d')](_0x173212[_0x057e('0x19')][_0x057e('0x1c')],function(_0x2ac3d3){return{'model':db[_0x2ac3d3[_0x057e('0x1e')]],'as':_0x2ac3d3['as'],'attributes':_0x2ac3d3[_0x057e('0x1f')],'include':_0x2ac3d3[_0x057e('0x1c')]?_[_0x057e('0x1d')](_0x2ac3d3[_0x057e('0x1c')],function(_0x42ce73){return{'model':db[_0x42ce73[_0x057e('0x1e')]],'as':_0x42ce73['as'],'attributes':_0x42ce73[_0x057e('0x1f')],'include':_0x42ce73[_0x057e('0x1c')]?_[_0x057e('0x1d')](_0x42ce73[_0x057e('0x1c')],function(_0x46c70c){return{'model':db[_0x46c70c['model']],'as':_0x46c70c['as'],'attributes':_0x46c70c[_0x057e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x057e('0xb')](function(_0xad84f8){logger['info'](_0x057e('0x16'),_0x173212);logger[_0x057e('0xf')]('GetCmHopperBlack',_0x173212,JSON[_0x057e('0x11')](_0xad84f8));_0x13e807(_0xad84f8);})[_0x057e('0x15')](function(_0x586069){logger['error'](_0x057e('0x16'),_0x586069[_0x057e('0x14')],_0x173212);_0x4d2e47(_0x1708f2[_0x057e('0x12')](0x1f4,_0x586069[_0x057e('0x14')]));});});};exports[_0x057e('0x20')]=function(_0x1ab298){var _0xe36b4b=this;return new Promise(function(_0x2f7eaf,_0x850a81){return db[_0x057e('0x17')][_0x057e('0x21')](_0x1ab298[_0x057e('0x22')],{'raw':_0x1ab298['options']?_0x1ab298[_0x057e('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ab298['options']?_0x1ab298[_0x057e('0x19')][_0x057e('0x1b')]||null:null,'attributes':_0x1ab298[_0x057e('0x19')]?_0x1ab298[_0x057e('0x19')][_0x057e('0x1f')]||null:null,'limit':_0x1ab298['options']?_0x1ab298[_0x057e('0x19')][_0x057e('0x23')]||null:null})[_0x057e('0xb')](function(_0x521b31){logger['info'](_0x057e('0x20'),_0x1ab298);logger[_0x057e('0xf')](_0x057e('0x20'),_0x1ab298,JSON[_0x057e('0x11')](_0x521b31));_0x2f7eaf(_0x521b31);})[_0x057e('0x15')](function(_0x3f86e4){logger[_0x057e('0x12')](_0x057e('0x20'),_0x3f86e4[_0x057e('0x14')],_0x1ab298);_0x850a81(_0xe36b4b[_0x057e('0x12')](0x1f4,_0x3f86e4[_0x057e('0x14')]));});});};exports['DestroyCmHopperBlack']=function(_0x11804c){var _0x3db110=this;return new Promise(function(_0x635f04,_0x365bea){return db[_0x057e('0x17')][_0x057e('0x24')]({'where':_0x11804c[_0x057e('0x19')]?_0x11804c[_0x057e('0x19')][_0x057e('0x1b')]||null:null})['then'](function(_0x1dc98f){logger[_0x057e('0xc')]('DestroyCmHopperBlack',_0x11804c);logger[_0x057e('0xf')]('DestroyCmHopperBlack',_0x11804c,JSON[_0x057e('0x11')](_0x1dc98f));_0x635f04(_0x1dc98f);})[_0x057e('0x15')](function(_0x1d7f65){logger['error'](_0x057e('0x25'),_0x1d7f65['message'],_0x11804c);_0x365bea(_0x3db110[_0x057e('0x12')](0x1f4,_0x1d7f65[_0x057e('0x14')]));});});}; \ No newline at end of file +var _0x99f6=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','CmHopperBlack','options','raw','where','attributes','limit','include','map','model','GetCmHopperBlack','catch','body','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','lodash','util','bluebird'];(function(_0x19e57f,_0x4ae750){var _0x469556=function(_0xf6968b){while(--_0xf6968b){_0x19e57f['push'](_0x19e57f['shift']());}};_0x469556(++_0x4ae750);}(_0x99f6,0xdb));var _0x699f=function(_0x34a237,_0x4bf95d){_0x34a237=_0x34a237-0x0;var _0x6f2721=_0x99f6[_0x34a237];return _0x6f2721;};'use strict';var _=require(_0x699f('0x0'));var util=require(_0x699f('0x1'));var moment=require('moment');var BPromise=require(_0x699f('0x2'));var rs=require(_0x699f('0x3'));var fs=require('fs');var Redis=require(_0x699f('0x4'));var db=require(_0x699f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x699f('0x6'))(_0x699f('0x7'));var config=require('../../config/environment');var jayson=require(_0x699f('0x8'));var client=jayson[_0x699f('0x9')][_0x699f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e2972,_0x58fd0d,_0x5a05b3){return new BPromise(function(_0x4309c8,_0x3208ff){return client[_0x699f('0xb')](_0x4e2972,_0x5a05b3)[_0x699f('0xc')](function(_0x288dba){logger['info'](_0x699f('0xd'),_0x58fd0d,'request\x20sent');logger[_0x699f('0xe')](_0x699f('0xf'),_0x58fd0d,_0x699f('0x10'),JSON[_0x699f('0x11')](_0x288dba));if(_0x288dba[_0x699f('0x12')]){if(_0x288dba['error']['code']===0x1f4){logger[_0x699f('0x12')](_0x699f('0xd'),_0x58fd0d,_0x288dba['error']['message']);return _0x3208ff(_0x288dba[_0x699f('0x12')][_0x699f('0x13')]);}logger[_0x699f('0x12')](_0x699f('0xd'),_0x58fd0d,_0x288dba[_0x699f('0x12')]['message']);return _0x4309c8(_0x288dba[_0x699f('0x12')][_0x699f('0x13')]);}else{logger[_0x699f('0x14')]('CmHopperBlack,\x20%s,\x20%s',_0x58fd0d,_0x699f('0x10'));_0x4309c8(_0x288dba[_0x699f('0x15')][_0x699f('0x13')]);}})['catch'](function(_0x177a0f){logger[_0x699f('0x12')](_0x699f('0xd'),_0x58fd0d,_0x177a0f);_0x3208ff(_0x177a0f);});});}exports['GetCmHopperBlack']=function(_0x3b2532){var _0x19484b=this;return new Promise(function(_0x599bd4,_0x2ba58b){return db[_0x699f('0x16')]['findAll']({'raw':_0x3b2532[_0x699f('0x17')]?_0x3b2532[_0x699f('0x17')][_0x699f('0x18')]===undefined?!![]:![]:!![],'where':_0x3b2532[_0x699f('0x17')]?_0x3b2532[_0x699f('0x17')][_0x699f('0x19')]||null:null,'attributes':_0x3b2532[_0x699f('0x17')]?_0x3b2532['options'][_0x699f('0x1a')]||null:null,'limit':_0x3b2532[_0x699f('0x17')]?_0x3b2532[_0x699f('0x17')][_0x699f('0x1b')]||null:null,'include':_0x3b2532[_0x699f('0x17')]?_0x3b2532['options'][_0x699f('0x1c')]?_[_0x699f('0x1d')](_0x3b2532[_0x699f('0x17')][_0x699f('0x1c')],function(_0x38d479){return{'model':db[_0x38d479[_0x699f('0x1e')]],'as':_0x38d479['as'],'attributes':_0x38d479[_0x699f('0x1a')],'include':_0x38d479['include']?_[_0x699f('0x1d')](_0x38d479[_0x699f('0x1c')],function(_0x55a6c9){return{'model':db[_0x55a6c9[_0x699f('0x1e')]],'as':_0x55a6c9['as'],'attributes':_0x55a6c9[_0x699f('0x1a')],'include':_0x55a6c9[_0x699f('0x1c')]?_[_0x699f('0x1d')](_0x55a6c9[_0x699f('0x1c')],function(_0x41827a){return{'model':db[_0x41827a['model']],'as':_0x41827a['as'],'attributes':_0x41827a[_0x699f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x699f('0xc')](function(_0x1d2d89){logger[_0x699f('0x14')](_0x699f('0x1f'),_0x3b2532);logger[_0x699f('0xe')](_0x699f('0x1f'),_0x3b2532,JSON[_0x699f('0x11')](_0x1d2d89));_0x599bd4(_0x1d2d89);})[_0x699f('0x20')](function(_0x5d6c00){logger[_0x699f('0x12')](_0x699f('0x1f'),_0x5d6c00[_0x699f('0x13')],_0x3b2532);_0x2ba58b(_0x19484b[_0x699f('0x12')](0x1f4,_0x5d6c00[_0x699f('0x13')]));});});};exports['UpdateCmHopperBlack']=function(_0x4ea44a){var _0x5edda6=this;return new Promise(function(_0x4a8edd,_0x4a7bcf){return db['CmHopperBlack']['update'](_0x4ea44a[_0x699f('0x21')],{'raw':_0x4ea44a[_0x699f('0x17')]?_0x4ea44a[_0x699f('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ea44a[_0x699f('0x17')]?_0x4ea44a[_0x699f('0x17')][_0x699f('0x19')]||null:null,'attributes':_0x4ea44a['options']?_0x4ea44a[_0x699f('0x17')][_0x699f('0x1a')]||null:null,'limit':_0x4ea44a[_0x699f('0x17')]?_0x4ea44a[_0x699f('0x17')][_0x699f('0x1b')]||null:null})['then'](function(_0x30322b){logger[_0x699f('0x14')]('UpdateCmHopperBlack',_0x4ea44a);logger[_0x699f('0xe')](_0x699f('0x22'),_0x4ea44a,JSON[_0x699f('0x11')](_0x30322b));_0x4a8edd(_0x30322b);})[_0x699f('0x20')](function(_0x1e957a){logger[_0x699f('0x12')](_0x699f('0x22'),_0x1e957a[_0x699f('0x13')],_0x4ea44a);_0x4a7bcf(_0x5edda6[_0x699f('0x12')](0x1f4,_0x1e957a[_0x699f('0x13')]));});});};exports[_0x699f('0x23')]=function(_0x1fb1e7){var _0x2c4615=this;return new Promise(function(_0xd3db83,_0xd5d084){return db['CmHopperBlack'][_0x699f('0x24')]({'where':_0x1fb1e7[_0x699f('0x17')]?_0x1fb1e7[_0x699f('0x17')][_0x699f('0x19')]||null:null})[_0x699f('0xc')](function(_0x19cde8){logger[_0x699f('0x14')](_0x699f('0x23'),_0x1fb1e7);logger[_0x699f('0xe')]('DestroyCmHopperBlack',_0x1fb1e7,JSON[_0x699f('0x11')](_0x19cde8));_0xd3db83(_0x19cde8);})[_0x699f('0x20')](function(_0x46eb80){logger[_0x699f('0x12')](_0x699f('0x23'),_0x46eb80[_0x699f('0x13')],_0x1fb1e7);_0xd5d084(_0x2c4615[_0x699f('0x12')](0x1f4,_0x46eb80[_0x699f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 457f8e9..6bfceed 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 _0xb145=['update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put'];(function(_0x3ddd97,_0x5882cf){var _0x1bd9f0=function(_0xa39500){while(--_0xa39500){_0x3ddd97['push'](_0x3ddd97['shift']());}};_0x1bd9f0(++_0x5882cf);}(_0xb145,0xa3));var _0x5b14=function(_0x55b102,_0x1aab0c){_0x55b102=_0x55b102-0x0;var _0x2c9c77=_0xb145[_0x55b102];return _0x2c9c77;};'use strict';var multer=require('multer');var util=require(_0x5b14('0x0'));var path=require(_0x5b14('0x1'));var timeout=require(_0x5b14('0x2'));var express=require(_0x5b14('0x3'));var router=express[_0x5b14('0x4')]();var fs_extra=require(_0x5b14('0x5'));var auth=require(_0x5b14('0x6'));var interaction=require(_0x5b14('0x7'));var config=require('../../config/environment');var controller=require(_0x5b14('0x8'));router[_0x5b14('0x9')]('/',auth[_0x5b14('0xa')](),controller[_0x5b14('0xb')]);router['get'](_0x5b14('0xc'),auth[_0x5b14('0xa')](),controller[_0x5b14('0xd')]);router[_0x5b14('0x9')](_0x5b14('0xe'),auth['isAuthenticated'](),controller[_0x5b14('0xf')]);router[_0x5b14('0x10')]('/:id',auth[_0x5b14('0xa')](),controller[_0x5b14('0x11')]);router[_0x5b14('0x12')](_0x5b14('0xe'),auth[_0x5b14('0xa')](),controller['destroy']);module[_0x5b14('0x13')]=router; \ No newline at end of file +var _0x1623=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./cmHopperBlack.controller','isAuthenticated','index','/describe','describe','get','/:id','show','put','update','delete','destroy','exports'];(function(_0x2bae27,_0x5abf2f){var _0x3d52f6=function(_0x165826){while(--_0x165826){_0x2bae27['push'](_0x2bae27['shift']());}};_0x3d52f6(++_0x5abf2f);}(_0x1623,0xab));var _0x3162=function(_0x42cab0,_0xefe7f4){_0x42cab0=_0x42cab0-0x0;var _0x5e40b1=_0x1623[_0x42cab0];return _0x5e40b1;};'use strict';var multer=require(_0x3162('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3162('0x1'));var express=require(_0x3162('0x2'));var router=express[_0x3162('0x3')]();var fs_extra=require(_0x3162('0x4'));var auth=require(_0x3162('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3162('0x6'));router['get']('/',auth[_0x3162('0x7')](),controller[_0x3162('0x8')]);router['get'](_0x3162('0x9'),auth[_0x3162('0x7')](),controller[_0x3162('0xa')]);router[_0x3162('0xb')](_0x3162('0xc'),auth[_0x3162('0x7')](),controller[_0x3162('0xd')]);router[_0x3162('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x3162('0xf')]);router[_0x3162('0x10')](_0x3162('0xc'),auth[_0x3162('0x7')](),controller[_0x3162('0x11')]);module[_0x3162('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 2a7cd04..c5d459e 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 _0x1658=['dispositionat','BOOLEAN','sequelize','moment','exports','STRING','DATE','INTEGER','getDataValue','endtime','setDataValue','followuptime','diff'];(function(_0x418cf1,_0x13cc3d){var _0x2fd5f5=function(_0x4ae95f){while(--_0x4ae95f){_0x418cf1['push'](_0x418cf1['shift']());}};_0x2fd5f5(++_0x13cc3d);}(_0x1658,0x1c9));var _0x8165=function(_0x34ab4f,_0x4cce3c){_0x34ab4f=_0x34ab4f-0x0;var _0x1c9ca6=_0x1658[_0x34ab4f];return _0x1c9ca6;};'use strict';var Sequelize=require(_0x8165('0x0'));var moment=require(_0x8165('0x1'));module[_0x8165('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x8165('0x3')]},'scheduledat':{'type':Sequelize[_0x8165('0x4')]},'countbusyretry':{'type':Sequelize[_0x8165('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8165('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8165('0x5')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x8165('0x5')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x8165('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x8165('0x3')]},'originatecalleridname':{'type':Sequelize[_0x8165('0x3')]},'calleridnum':{'type':Sequelize[_0x8165('0x3')]},'calleridname':{'type':Sequelize[_0x8165('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x8165('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x8165('0x5')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x8165('0x5')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x8165('0x5')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x8165('0x5')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x8165('0x3')]},'campaign':{'type':Sequelize[_0x8165('0x3')]},'campaigntype':{'type':Sequelize[_0x8165('0x3')]},'membername':{'type':Sequelize[_0x8165('0x3')]},'reason':{'type':Sequelize[_0x8165('0x3')]},'disposition':{'type':Sequelize[_0x8165('0x3')]},'secondDisposition':{'type':Sequelize[_0x8165('0x3')]},'thirdDisposition':{'type':Sequelize[_0x8165('0x3')]},'dispositionat':{'type':Sequelize[_0x8165('0x4')],'set':function(_0x356706){var _0x56998d=this[_0x8165('0x6')](_0x8165('0x7'));if(_0x56998d&&_0x356706){this[_0x8165('0x8')](_0x8165('0x9'),moment(_0x356706)[_0x8165('0xa')](moment(_0x56998d),'seconds'));}return this[_0x8165('0x8')](_0x8165('0xb'),_0x356706);}},'amd':{'type':Sequelize[_0x8165('0xc')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x8165('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x8165('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x8165('0x4')]},'callback':{'type':Sequelize[_0x8165('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8165('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8165('0x4')]},'deleted':{'type':Sequelize[_0x8165('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x8165('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x8165('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x8165('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8165('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8165('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0x82f8=['dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','DATE','STRING','getDataValue','endtime','setDataValue','followuptime','diff','seconds'];(function(_0x5b7d91,_0x371ea1){var _0x546e82=function(_0x8e9f4b){while(--_0x8e9f4b){_0x5b7d91['push'](_0x5b7d91['shift']());}};_0x546e82(++_0x371ea1);}(_0x82f8,0x11a));var _0x882f=function(_0x4173f6,_0x58cc3c){_0x4173f6=_0x4173f6-0x0;var _0x368ee1=_0x82f8[_0x4173f6];return _0x368ee1;};'use strict';var Sequelize=require(_0x882f('0x0'));var moment=require(_0x882f('0x1'));module[_0x882f('0x2')]={'state':{'type':Sequelize[_0x882f('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x882f('0x4')]},'countbusyretry':{'type':Sequelize[_0x882f('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x882f('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x882f('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x882f('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x882f('0x5')]},'originatecalleridnum':{'type':Sequelize[_0x882f('0x5')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x882f('0x5')]},'starttime':{'type':Sequelize[_0x882f('0x4')]},'responsetime':{'type':Sequelize[_0x882f('0x4')]},'answertime':{'type':Sequelize[_0x882f('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x882f('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x882f('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x882f('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x882f('0x5')]},'campaign':{'type':Sequelize[_0x882f('0x5')]},'campaigntype':{'type':Sequelize[_0x882f('0x5')]},'membername':{'type':Sequelize[_0x882f('0x5')]},'reason':{'type':Sequelize[_0x882f('0x5')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x882f('0x5')]},'thirdDisposition':{'type':Sequelize[_0x882f('0x5')]},'dispositionat':{'type':Sequelize[_0x882f('0x4')],'set':function(_0x3d02ad){var _0x4e4ea7=this[_0x882f('0x6')](_0x882f('0x7'));if(_0x4e4ea7&&_0x3d02ad){this[_0x882f('0x8')](_0x882f('0x9'),moment(_0x3d02ad)[_0x882f('0xa')](moment(_0x4e4ea7),_0x882f('0xb')));}return this[_0x882f('0x8')](_0x882f('0xc'),_0x3d02ad);}},'amd':{'type':Sequelize[_0x882f('0xd')],'defaultValue':![]},'fax':{'type':Sequelize[_0x882f('0xd')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x882f('0xd')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x882f('0x4')]},'callback':{'type':Sequelize[_0x882f('0xd')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x882f('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x882f('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x882f('0x4')]},'recallme':{'type':Sequelize[_0x882f('0xd')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x882f('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x882f('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x882f('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x882f('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x882f('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x882f('0x3')],'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 0ae4401..47a0a53 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 _0x90b1=['uniqueid','countContactsQueueCampaignHopperFinal','findAll','params','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','VoiceQueue','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20NOT\x20IN\x20(?)','select','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','into','ListId','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','CmHopper','findOne','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','type','options','CmHopperFinal','includeAll','rows','include','find','catch','update','body'];(function(_0x34f456,_0x271849){var _0x589f55=function(_0x32e03d){while(--_0x32e03d){_0x34f456['push'](_0x34f456['shift']());}};_0x589f55(++_0x271849);}(_0x90b1,0x1bb));var _0x190b=function(_0x466b80,_0x49fb2b){_0x466b80=_0x466b80-0x0;var _0x3804bd=_0x90b1[_0x466b80];return _0x3804bd;};'use strict';var emlformat=require(_0x190b('0x0'));var rimraf=require(_0x190b('0x1'));var zipdir=require(_0x190b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x190b('0x3'));var BPromise=require(_0x190b('0x4'));var Mustache=require(_0x190b('0x5'));var util=require(_0x190b('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x190b('0x7'));var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var Redis=require(_0x190b('0xf'));var authService=require(_0x190b('0x10'));var qs=require(_0x190b('0x11'));var as=require(_0x190b('0x12'));var hardwareService=require(_0x190b('0x13'));var logger=require(_0x190b('0x14'))(_0x190b('0x15'));var utils=require('../../config/utils');var config=require(_0x190b('0x16'));var licenseUtil=require(_0x190b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d63ac,_0x596c48){_0x596c48=_0x596c48||0xcc;return function(_0x286c81){if(_0x286c81){return _0x4d63ac[_0x190b('0x18')](_0x596c48);}return _0x4d63ac[_0x190b('0x19')](_0x596c48)[_0x190b('0x1a')]();};}function respondWithResult(_0x2e12d4,_0x13544c){_0x13544c=_0x13544c||0xc8;return function(_0x1ff180){if(_0x1ff180){return _0x2e12d4[_0x190b('0x19')](_0x13544c)[_0x190b('0x1b')](_0x1ff180);}};}function respondWithFilteredResult(_0x1a046f,_0xab346){return function(_0x3e8781){if(_0x3e8781){var _0x3fbfc3=typeof _0xab346[_0x190b('0x1c')]===_0x190b('0x1d')&&typeof _0xab346['limit']===_0x190b('0x1d');var _0x5efbed=_0x3e8781[_0x190b('0x1e')];var _0x21e458=_0x3fbfc3?0x0:_0xab346[_0x190b('0x1c')];var _0x16c009=_0x3fbfc3?_0x3e8781['count']:_0xab346[_0x190b('0x1c')]+_0xab346[_0x190b('0x1f')];var _0x441a2b;if(_0x16c009>=_0x5efbed){_0x16c009=_0x5efbed;_0x441a2b=0xc8;}else{_0x441a2b=0xce;}_0x1a046f[_0x190b('0x19')](_0x441a2b);return _0x1a046f[_0x190b('0x20')](_0x190b('0x21'),_0x21e458+'-'+_0x16c009+'/'+_0x5efbed)['json'](_0x3e8781);}return null;};}function patchUpdates(_0x3ed24c){return function(_0x14f0a5){try{jsonpatch['apply'](_0x14f0a5,_0x3ed24c,!![]);}catch(_0xb4c32b){return BPromise['reject'](_0xb4c32b);}return _0x14f0a5['save']();};}function saveUpdates(_0xcd15e5,_0x42e7f2){return function(_0x332006){if(_0x332006){return _0x332006['update'](_0xcd15e5)[_0x190b('0x22')](function(_0x2e633e){return _0x2e633e;});}return null;};}function removeEntity(_0x16e989,_0x292ce3){return function(_0x3b8c74){if(_0x3b8c74){return _0x3b8c74[_0x190b('0x23')]()[_0x190b('0x22')](function(){_0x16e989['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262a63,_0x1a5f86){return function(_0x50605b){if(!_0x50605b){_0x262a63['sendStatus'](0x194);}return _0x50605b;};}function handleError(_0x3260d5,_0x4e2a93){_0x4e2a93=_0x4e2a93||0x1f4;return function(_0x328e5e){logger[_0x190b('0x24')](_0x328e5e['stack']);if(_0x328e5e[_0x190b('0x25')]){delete _0x328e5e[_0x190b('0x25')];}_0x3260d5['status'](_0x4e2a93)[_0x190b('0x26')](_0x328e5e);};}exports[_0x190b('0x27')]=function(_0x359b4a,_0x494f3f){var _0x536d7b={},_0x3730cc={},_0x4d5f3f={'count':0x0,'rows':[]};var _0x14be2c=_[_0x190b('0x28')](db['CmHopperFinal'][_0x190b('0x29')],function(_0x580b92){return{'name':_0x580b92[_0x190b('0x2a')],'type':_0x580b92['type'][_0x190b('0x2b')]};});_0x3730cc['model']=_[_0x190b('0x28')](_0x14be2c,_0x190b('0x25'));_0x3730cc['query']=_[_0x190b('0x2c')](_0x359b4a[_0x190b('0x2d')]);_0x3730cc[_0x190b('0x2e')]=_[_0x190b('0x2f')](_0x3730cc[_0x190b('0x30')],_0x3730cc[_0x190b('0x2d')]);_0x536d7b[_0x190b('0x31')]=_[_0x190b('0x2f')](_0x3730cc['model'],qs['fields'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x32')]));_0x536d7b['attributes']=_0x536d7b[_0x190b('0x31')][_0x190b('0x33')]?_0x536d7b[_0x190b('0x31')]:_0x3730cc[_0x190b('0x30')];if(!_0x359b4a[_0x190b('0x2d')][_0x190b('0x34')](_0x190b('0x35'))){_0x536d7b['limit']=qs['limit'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1f')]);_0x536d7b[_0x190b('0x1c')]=qs['offset'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1c')]);}_0x536d7b[_0x190b('0x36')]=qs['sort'](_0x359b4a[_0x190b('0x2d')]['sort']);_0x536d7b['where']=qs[_0x190b('0x2e')](_[_0x190b('0x37')](_0x359b4a['query'],_0x3730cc[_0x190b('0x2e')]),_0x14be2c);if(_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]){_0x536d7b['where']=_[_0x190b('0x39')](_0x536d7b[_0x190b('0x3a')],{'$or':_['map'](_0x14be2c,function(_0x5d006d){if(_0x5d006d[_0x190b('0x3b')]!=='VIRTUAL'){var _0x46bdba={};_0x46bdba[_0x5d006d[_0x190b('0x25')]]={'$like':'%'+_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]+'%'};return _0x46bdba;}})});}_0x536d7b=_['merge']({},_0x536d7b,_0x359b4a[_0x190b('0x3c')]);var _0x5f118c={'where':_0x536d7b[_0x190b('0x3a')]};return db[_0x190b('0x3d')]['count'](_0x5f118c)[_0x190b('0x22')](function(_0x2a75d2){_0x4d5f3f[_0x190b('0x1e')]=_0x2a75d2;if(_0x359b4a['query'][_0x190b('0x3e')]){_0x536d7b['include']=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x536d7b);})[_0x190b('0x22')](function(_0x3aef1d){_0x4d5f3f[_0x190b('0x3f')]=_0x3aef1d;return _0x4d5f3f;})[_0x190b('0x22')](respondWithFilteredResult(_0x494f3f,_0x536d7b))['catch'](handleError(_0x494f3f,null));};exports['show']=function(_0x4045b7,_0x492240){var _0x110891={'raw':!![],'where':{'id':_0x4045b7['params']['id']}},_0x3d67f0={};_0x3d67f0[_0x190b('0x30')]=_[_0x190b('0x2c')](db[_0x190b('0x3d')]['rawAttributes']);_0x3d67f0[_0x190b('0x2d')]=_[_0x190b('0x2c')](_0x4045b7['query']);_0x3d67f0[_0x190b('0x2e')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],_0x3d67f0[_0x190b('0x2d')]);_0x110891[_0x190b('0x31')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],qs['fields'](_0x4045b7[_0x190b('0x2d')][_0x190b('0x32')]));_0x110891[_0x190b('0x31')]=_0x110891[_0x190b('0x31')][_0x190b('0x33')]?_0x110891[_0x190b('0x31')]:_0x3d67f0[_0x190b('0x30')];if(_0x4045b7['query'][_0x190b('0x3e')]){_0x110891[_0x190b('0x40')]=[{'all':!![]}];}_0x110891=_[_0x190b('0x39')]({},_0x110891,_0x4045b7['options']);return db[_0x190b('0x3d')][_0x190b('0x41')](_0x110891)[_0x190b('0x22')](handleEntityNotFound(_0x492240,null))[_0x190b('0x22')](respondWithResult(_0x492240,null))[_0x190b('0x42')](handleError(_0x492240,null));};exports['describe']=function(_0x1f2262,_0xadc789){return db[_0x190b('0x3d')]['describe']()[_0x190b('0x22')](respondWithResult(_0xadc789,null))[_0x190b('0x42')](handleError(_0xadc789,null));};exports[_0x190b('0x43')]=function(_0x505e52,_0x4cb561){if(_0x505e52[_0x190b('0x44')][_0x190b('0x45')]){delete _0x505e52[_0x190b('0x44')][_0x190b('0x45')];}return db[_0x190b('0x3d')][_0x190b('0x41')]({'where':{'uniqueid':_0x505e52['params']['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x4cb561,null))[_0x190b('0x22')](saveUpdates(_0x505e52[_0x190b('0x44')],null))['then'](respondWithResult(_0x4cb561,null))[_0x190b('0x42')](handleError(_0x4cb561,null));};exports[_0x190b('0x46')]=function(_0x215ab6,_0x503700,_0xbc6757){return db[_0x190b('0x3d')][_0x190b('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x215ab6[_0x190b('0x48')]['id']},'attributes':[[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x4c')))),_0x190b('0x4d')],[db['sequelize']['fn'](_0x190b('0x4a'),db['sequelize']['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')]('`state`\x20=\x203,\x201,\x20null'))),_0x190b('0x4e')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x4f')))),_0x190b('0x50')],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')]['literal'](_0x190b('0x51')))),'congestionContacts'],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x52')))),_0x190b('0x53')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x54')))),_0x190b('0x55')],[db[_0x190b('0x49')]['fn']('COUNT',db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x56')))),'reCallContacts'],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db['sequelize'][_0x190b('0x4b')]('`state`\x20=\x2019,\x201,\x20null'))),_0x190b('0x57')]]})[_0x190b('0x22')](handleEntityNotFound(_0x503700,null))[_0x190b('0x22')](respondWithResult(_0x503700,null))['catch'](handleError(_0x503700,null));};exports[_0x190b('0x58')]=function(_0x270b59,_0xffe7cb,_0x405e04){return db[_0x190b('0x3d')][_0x190b('0x47')]({'raw':![],'where':{'CampaignId':_0x270b59[_0x190b('0x48')]['id']},'attributes':[[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db['sequelize']['fn']('IF',db['sequelize'][_0x190b('0x4b')](_0x190b('0x4c')))),_0x190b('0x4d')],[db[_0x190b('0x49')]['fn']('COUNT',db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')]['literal'](_0x190b('0x59')))),_0x190b('0x4e')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x4f')))),'busyContacts'],[db[_0x190b('0x49')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x51')))),'congestionContacts'],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x52')))),_0x190b('0x53')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db['sequelize']['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x54')))),_0x190b('0x55')],[db[_0x190b('0x49')]['fn']('COUNT',db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')]('`state`\x20=\x2022,\x201,\x20null'))),_0x190b('0x5a')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db['sequelize'][_0x190b('0x4b')](_0x190b('0x5b')))),_0x190b('0x57')]]})[_0x190b('0x22')](handleEntityNotFound(_0xffe7cb,null))['then'](respondWithResult(_0xffe7cb,null))[_0x190b('0x42')](handleError(_0xffe7cb,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x2495c9,_0x348beb,_0x360d39){return db[_0x190b('0x5c')]['find']({'where':{'id':_0x2495c9[_0x190b('0x48')]['id']}})['then'](handleEntityNotFound(_0x348beb,null))[_0x190b('0x22')](function(_0x5073d2){var _0x49b60c;if(_0x5073d2){_0x49b60c=squel[_0x190b('0x5d')]()['into'](_0x190b('0x5e'))[_0x190b('0x5f')]([_0x190b('0x60'),_0x190b('0x61'),_0x190b('0x62'),'ListId',_0x190b('0x63'),_0x190b('0x64'),_0x190b('0x65')],squel['select']()[_0x190b('0x66')](_0x190b('0x67'),'phone')[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x61'))['field'](_0x190b('0x69'),_0x190b('0x62'))[_0x190b('0x66')](_0x190b('0x6a'),'ListId')[_0x190b('0x66')](_0x190b('0x6b'),_0x190b('0x63'))['field'](_0x190b('0x68'),_0x190b('0x64'))[_0x190b('0x66')]('NOW()',_0x190b('0x65'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x6e'),_0x2495c9['params']['id']['toString']())[_0x190b('0x3a')](_0x190b('0x6f'),_0x2495c9['body'][_0x190b('0x70')][_0x190b('0x71')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0x190b('0x3a')](_0x190b('0x72'),squel['select']()['field'](_0x190b('0x60'))[_0x190b('0x6c')](_0x190b('0x5e'))[_0x190b('0x3a')](_0x190b('0x6e'),_0x2495c9['params']['id']['toString']()))[_0x190b('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x190b('0x73')]()[_0x190b('0x66')](_0x190b('0x74'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x6e'),_0x2495c9[_0x190b('0x48')]['id'][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x75')))['group'](_0x190b('0x62')))[_0x190b('0x71')]();return db[_0x190b('0x49')]['query'](_0x49b60c);}return[];})['then'](respondWithResult(_0x348beb,null))[_0x190b('0x42')](handleError(_0x348beb,null));};exports[_0x190b('0x76')]=function(_0x4b988d,_0x40ac95,_0x18c5f4){return db[_0x190b('0x77')]['find']({'where':{'id':_0x4b988d[_0x190b('0x48')]['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x40ac95,null))['then'](function(_0x23298e){var _0x2ba27b;if(_0x23298e){_0x2ba27b=squel['insert']()[_0x190b('0x78')]('cm_hopper')['fromQuery'](['phone','scheduledAt',_0x190b('0x62'),_0x190b('0x79'),'CampaignId',_0x190b('0x64'),_0x190b('0x65')],squel['select']()[_0x190b('0x66')](_0x190b('0x67'),_0x190b('0x60'))[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x61'))[_0x190b('0x66')](_0x190b('0x69'),_0x190b('0x62'))['field'](_0x190b('0x6a'),'ListId')['field'](_0x190b('0x7a'),_0x190b('0x7b'))[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x64'))[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x65'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x7c'),_0x4b988d['params']['id'][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x6f'),_0x4b988d[_0x190b('0x44')][_0x190b('0x70')][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x7d'))[_0x190b('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x190b('0x73')]()[_0x190b('0x66')](_0x190b('0x60'))['from'](_0x190b('0x5e'))[_0x190b('0x3a')]('CampaignId\x20=\x20?',_0x4b988d['params']['id'][_0x190b('0x71')]()))[_0x190b('0x3a')](_0x190b('0x72'),squel[_0x190b('0x73')]()[_0x190b('0x66')](_0x190b('0x74'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x7c'),_0x4b988d['params']['id'][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x75')))['group'](_0x190b('0x62')))[_0x190b('0x71')]();return db[_0x190b('0x49')][_0x190b('0x2d')](_0x2ba27b);}return[];})[_0x190b('0x22')](respondWithResult(_0x40ac95,null))[_0x190b('0x42')](handleError(_0x40ac95,null));};exports['checkContactHopper']=function(_0x476c86,_0x298824,_0x5e7c76){return db[_0x190b('0x7e')][_0x190b('0x7f')]({'where':{'VoiceQueueId':_0x476c86[_0x190b('0x44')][_0x190b('0x63')],'CampaignId':_0x476c86[_0x190b('0x44')][_0x190b('0x7b')],'ContactId':_0x476c86[_0x190b('0x44')][_0x190b('0x62')]}})['then'](handleEntityNotFound(_0x298824,null))[_0x190b('0x22')](function(_0x1b3168){if(_0x1b3168){return _0x1b3168;}return null;})[_0x190b('0x22')](respondWithResult(_0x298824,null))[_0x190b('0x42')](handleError(_0x298824,null));}; \ No newline at end of file +var _0x5d58=['calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','fromQuery','CampaignId','ANY_VALUE(CampaignId)','cm_hopper_final','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','then','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','CmHopperFinal','include','findAll','rows','show','params','rawAttributes','keys','length','includeAll','merge','describe','catch','body','find','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)'];(function(_0x2a9e6f,_0x216211){var _0x1159d1=function(_0x86dcc0){while(--_0x86dcc0){_0x2a9e6f['push'](_0x2a9e6f['shift']());}};_0x1159d1(++_0x216211);}(_0x5d58,0x187));var _0x85d5=function(_0x61cda2,_0x110f71){_0x61cda2=_0x61cda2-0x0;var _0x14552c=_0x5d58[_0x61cda2];return _0x14552c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x85d5('0x0'));var BPromise=require(_0x85d5('0x1'));var Mustache=require('mustache');var util=require(_0x85d5('0x2'));var path=require(_0x85d5('0x3'));var sox=require('sox');var csv=require(_0x85d5('0x4'));var ejs=require(_0x85d5('0x5'));var fs=require('fs');var fs_extra=require(_0x85d5('0x6'));var _=require(_0x85d5('0x7'));var squel=require('squel');var crypto=require(_0x85d5('0x8'));var jsforce=require(_0x85d5('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x85d5('0x4'));var querystring=require('querystring');var Papa=require(_0x85d5('0xa'));var Redis=require(_0x85d5('0xb'));var authService=require(_0x85d5('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x85d5('0xd'))(_0x85d5('0xe'));var utils=require(_0x85d5('0xf'));var config=require(_0x85d5('0x10'));var licenseUtil=require(_0x85d5('0x11'));var db=require(_0x85d5('0x12'))['db'];function respondWithStatusCode(_0x31409d,_0x5897af){_0x5897af=_0x5897af||0xcc;return function(_0x4bbf2a){if(_0x4bbf2a){return _0x31409d['sendStatus'](_0x5897af);}return _0x31409d[_0x85d5('0x13')](_0x5897af)[_0x85d5('0x14')]();};}function respondWithResult(_0x339d4f,_0x1704f0){_0x1704f0=_0x1704f0||0xc8;return function(_0x18a20c){if(_0x18a20c){return _0x339d4f[_0x85d5('0x13')](_0x1704f0)[_0x85d5('0x15')](_0x18a20c);}};}function respondWithFilteredResult(_0x586382,_0x18e977){return function(_0x2d7c95){if(_0x2d7c95){var _0x1621ed=typeof _0x18e977[_0x85d5('0x16')]===_0x85d5('0x17')&&typeof _0x18e977[_0x85d5('0x18')]===_0x85d5('0x17');var _0x12bef9=_0x2d7c95[_0x85d5('0x19')];var _0x17acb0=_0x1621ed?0x0:_0x18e977[_0x85d5('0x16')];var _0x432bd6=_0x1621ed?_0x2d7c95[_0x85d5('0x19')]:_0x18e977[_0x85d5('0x16')]+_0x18e977[_0x85d5('0x18')];var _0x26981b;if(_0x432bd6>=_0x12bef9){_0x432bd6=_0x12bef9;_0x26981b=0xc8;}else{_0x26981b=0xce;}_0x586382[_0x85d5('0x13')](_0x26981b);return _0x586382[_0x85d5('0x1a')]('Content-Range',_0x17acb0+'-'+_0x432bd6+'/'+_0x12bef9)[_0x85d5('0x15')](_0x2d7c95);}return null;};}function patchUpdates(_0x133fa9){return function(_0x5f5755){try{jsonpatch[_0x85d5('0x1b')](_0x5f5755,_0x133fa9,!![]);}catch(_0x1264ca){return BPromise['reject'](_0x1264ca);}return _0x5f5755['save']();};}function saveUpdates(_0x347337,_0x5a1b9a){return function(_0x2f2bae){if(_0x2f2bae){return _0x2f2bae['update'](_0x347337)[_0x85d5('0x1c')](function(_0x1f8d27){return _0x1f8d27;});}return null;};}function removeEntity(_0x560b3a,_0x4e11c4){return function(_0x4da71b){if(_0x4da71b){return _0x4da71b['destroy']()[_0x85d5('0x1c')](function(){_0x560b3a[_0x85d5('0x13')](0xcc)[_0x85d5('0x14')]();});}};}function handleEntityNotFound(_0x466bbd,_0x12fea3){return function(_0xef2405){if(!_0xef2405){_0x466bbd['sendStatus'](0x194);}return _0xef2405;};}function handleError(_0x7e9a11,_0x4f8c66){_0x4f8c66=_0x4f8c66||0x1f4;return function(_0x1b3fae){logger[_0x85d5('0x1d')](_0x1b3fae[_0x85d5('0x1e')]);if(_0x1b3fae['name']){delete _0x1b3fae[_0x85d5('0x1f')];}_0x7e9a11[_0x85d5('0x13')](_0x4f8c66)[_0x85d5('0x20')](_0x1b3fae);};}exports[_0x85d5('0x21')]=function(_0x4605c5,_0x56031f){var _0x1cbef1={},_0x476c8b={},_0x330f8a={'count':0x0,'rows':[]};var _0x22a961=_[_0x85d5('0x22')](db['CmHopperFinal']['rawAttributes'],function(_0x2ce7a9){return{'name':_0x2ce7a9[_0x85d5('0x23')],'type':_0x2ce7a9[_0x85d5('0x24')][_0x85d5('0x25')]};});_0x476c8b[_0x85d5('0x26')]=_['map'](_0x22a961,_0x85d5('0x1f'));_0x476c8b[_0x85d5('0x27')]=_['keys'](_0x4605c5['query']);_0x476c8b[_0x85d5('0x28')]=_[_0x85d5('0x29')](_0x476c8b['model'],_0x476c8b[_0x85d5('0x27')]);_0x1cbef1['attributes']=_[_0x85d5('0x29')](_0x476c8b[_0x85d5('0x26')],qs['fields'](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2a')]));_0x1cbef1[_0x85d5('0x2b')]=_0x1cbef1[_0x85d5('0x2b')]['length']?_0x1cbef1['attributes']:_0x476c8b[_0x85d5('0x26')];if(!_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2c')](_0x85d5('0x2d'))){_0x1cbef1[_0x85d5('0x18')]=qs[_0x85d5('0x18')](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x18')]);_0x1cbef1[_0x85d5('0x16')]=qs['offset'](_0x4605c5['query'][_0x85d5('0x16')]);}_0x1cbef1[_0x85d5('0x2e')]=qs[_0x85d5('0x2f')](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2f')]);_0x1cbef1[_0x85d5('0x30')]=qs[_0x85d5('0x28')](_[_0x85d5('0x31')](_0x4605c5['query'],_0x476c8b[_0x85d5('0x28')]),_0x22a961);if(_0x4605c5[_0x85d5('0x27')][_0x85d5('0x32')]){_0x1cbef1[_0x85d5('0x30')]=_['merge'](_0x1cbef1[_0x85d5('0x30')],{'$or':_[_0x85d5('0x22')](_0x22a961,function(_0x3282d3){if(_0x3282d3[_0x85d5('0x24')]!=='VIRTUAL'){var _0x34caed={};_0x34caed[_0x3282d3['name']]={'$like':'%'+_0x4605c5['query'][_0x85d5('0x32')]+'%'};return _0x34caed;}})});}_0x1cbef1=_['merge']({},_0x1cbef1,_0x4605c5[_0x85d5('0x33')]);var _0x5ddba7={'where':_0x1cbef1['where']};return db[_0x85d5('0x34')][_0x85d5('0x19')](_0x5ddba7)[_0x85d5('0x1c')](function(_0x1beffc){_0x330f8a[_0x85d5('0x19')]=_0x1beffc;if(_0x4605c5['query']['includeAll']){_0x1cbef1[_0x85d5('0x35')]=[{'all':!![]}];}return db[_0x85d5('0x34')][_0x85d5('0x36')](_0x1cbef1);})[_0x85d5('0x1c')](function(_0xdd8b3e){_0x330f8a[_0x85d5('0x37')]=_0xdd8b3e;return _0x330f8a;})['then'](respondWithFilteredResult(_0x56031f,_0x1cbef1))['catch'](handleError(_0x56031f,null));};exports[_0x85d5('0x38')]=function(_0x52c99b,_0xfbf466){var _0x18e94d={'raw':!![],'where':{'id':_0x52c99b[_0x85d5('0x39')]['id']}},_0x7dd430={};_0x7dd430[_0x85d5('0x26')]=_['keys'](db['CmHopperFinal'][_0x85d5('0x3a')]);_0x7dd430[_0x85d5('0x27')]=_[_0x85d5('0x3b')](_0x52c99b[_0x85d5('0x27')]);_0x7dd430[_0x85d5('0x28')]=_[_0x85d5('0x29')](_0x7dd430[_0x85d5('0x26')],_0x7dd430[_0x85d5('0x27')]);_0x18e94d[_0x85d5('0x2b')]=_[_0x85d5('0x29')](_0x7dd430[_0x85d5('0x26')],qs[_0x85d5('0x2a')](_0x52c99b[_0x85d5('0x27')][_0x85d5('0x2a')]));_0x18e94d[_0x85d5('0x2b')]=_0x18e94d[_0x85d5('0x2b')][_0x85d5('0x3c')]?_0x18e94d['attributes']:_0x7dd430['model'];if(_0x52c99b[_0x85d5('0x27')][_0x85d5('0x3d')]){_0x18e94d[_0x85d5('0x35')]=[{'all':!![]}];}_0x18e94d=_[_0x85d5('0x3e')]({},_0x18e94d,_0x52c99b[_0x85d5('0x33')]);return db[_0x85d5('0x34')]['find'](_0x18e94d)[_0x85d5('0x1c')](handleEntityNotFound(_0xfbf466,null))['then'](respondWithResult(_0xfbf466,null))['catch'](handleError(_0xfbf466,null));};exports[_0x85d5('0x3f')]=function(_0x13ab32,_0x12a03){return db[_0x85d5('0x34')][_0x85d5('0x3f')]()['then'](respondWithResult(_0x12a03,null))[_0x85d5('0x40')](handleError(_0x12a03,null));};exports['update']=function(_0x1f2ef9,_0xd8db57){if(_0x1f2ef9[_0x85d5('0x41')]['uniqueid']){delete _0x1f2ef9['body']['uniqueid'];}return db[_0x85d5('0x34')][_0x85d5('0x42')]({'where':{'uniqueid':_0x1f2ef9[_0x85d5('0x39')]['id']}})['then'](handleEntityNotFound(_0xd8db57,null))['then'](saveUpdates(_0x1f2ef9[_0x85d5('0x41')],null))[_0x85d5('0x1c')](respondWithResult(_0xd8db57,null))[_0x85d5('0x40')](handleError(_0xd8db57,null));};exports[_0x85d5('0x43')]=function(_0x4b2dce,_0x3f69ea,_0x29442a){return db[_0x85d5('0x34')][_0x85d5('0x36')]({'raw':![],'where':{'VoiceQueueId':_0x4b2dce[_0x85d5('0x39')]['id']},'attributes':[[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x47')))),_0x85d5('0x48')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x49')))),_0x85d5('0x4a')],[db[_0x85d5('0x44')]['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x4b')))),_0x85d5('0x4c')],[db[_0x85d5('0x44')]['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x85d5('0x4d')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x85d5('0x4e')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x4f')))),_0x85d5('0x50')],[db['sequelize']['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')]('`state`\x20=\x2022,\x201,\x20null'))),_0x85d5('0x51')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x52')))),_0x85d5('0x53')]]})['then'](handleEntityNotFound(_0x3f69ea,null))[_0x85d5('0x1c')](respondWithResult(_0x3f69ea,null))[_0x85d5('0x40')](handleError(_0x3f69ea,null));};exports[_0x85d5('0x54')]=function(_0x561bde,_0x34aa42,_0x1c3e2c){return db['CmHopperFinal'][_0x85d5('0x36')]({'raw':![],'where':{'CampaignId':_0x561bde['params']['id']},'attributes':[[db[_0x85d5('0x44')]['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x47')))),'noSuchContacts'],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x49')))),_0x85d5('0x4a')],[db[_0x85d5('0x44')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x85d5('0x44')]['literal'](_0x85d5('0x4b')))),_0x85d5('0x4c')],[db['sequelize']['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')]('`state`\x20=\x208,\x201,\x20null'))),_0x85d5('0x4d')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize']['literal'](_0x85d5('0x55')))),'dropContacts'],[db['sequelize']['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x85d5('0x50')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db['sequelize']['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x56')))),_0x85d5('0x51')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),_0x85d5('0x53')]]})[_0x85d5('0x1c')](handleEntityNotFound(_0x34aa42,null))[_0x85d5('0x1c')](respondWithResult(_0x34aa42,null))['catch'](handleError(_0x34aa42,null));};exports[_0x85d5('0x57')]=function(_0x1fdefb,_0x496586,_0x2dbd18){return db[_0x85d5('0x58')][_0x85d5('0x42')]({'where':{'id':_0x1fdefb[_0x85d5('0x39')]['id']}})[_0x85d5('0x1c')](handleEntityNotFound(_0x496586,null))['then'](function(_0x35ba15){var _0x1b96eb;if(_0x35ba15){_0x1b96eb=squel[_0x85d5('0x59')]()[_0x85d5('0x5a')](_0x85d5('0x5b'))['fromQuery']([_0x85d5('0x5c'),_0x85d5('0x5d'),_0x85d5('0x5e'),_0x85d5('0x5f'),_0x85d5('0x60'),_0x85d5('0x61'),_0x85d5('0x62')],squel[_0x85d5('0x63')]()[_0x85d5('0x64')](_0x85d5('0x65'),'phone')[_0x85d5('0x64')](_0x85d5('0x66'),_0x85d5('0x5d'))[_0x85d5('0x64')](_0x85d5('0x67'),_0x85d5('0x5e'))['field'](_0x85d5('0x68'),'ListId')['field'](_0x85d5('0x69'),_0x85d5('0x60'))[_0x85d5('0x64')](_0x85d5('0x66'),_0x85d5('0x61'))[_0x85d5('0x64')](_0x85d5('0x66'),_0x85d5('0x62'))[_0x85d5('0x6a')]('cm_hopper_final')[_0x85d5('0x30')](_0x85d5('0x6b'),_0x1fdefb[_0x85d5('0x39')]['id'][_0x85d5('0x6c')]())[_0x85d5('0x30')](_0x85d5('0x6d'),_0x1fdefb[_0x85d5('0x41')][_0x85d5('0x6e')][_0x85d5('0x6c')]())[_0x85d5('0x30')](_0x85d5('0x6f'))[_0x85d5('0x30')](_0x85d5('0x70'),squel[_0x85d5('0x63')]()[_0x85d5('0x64')]('phone')['from'](_0x85d5('0x5b'))['where'](_0x85d5('0x6b'),_0x1fdefb[_0x85d5('0x39')]['id'][_0x85d5('0x6c')]()))[_0x85d5('0x30')](_0x85d5('0x70'),squel[_0x85d5('0x63')]()[_0x85d5('0x64')](_0x85d5('0x71'))[_0x85d5('0x6a')]('cm_hopper_final')[_0x85d5('0x30')](_0x85d5('0x6b'),_0x1fdefb['params']['id'][_0x85d5('0x6c')]())['where'](_0x85d5('0x72')))[_0x85d5('0x73')](_0x85d5('0x5e')))[_0x85d5('0x6c')]();return db['sequelize'][_0x85d5('0x27')](_0x1b96eb);}return[];})[_0x85d5('0x1c')](respondWithResult(_0x496586,null))['catch'](handleError(_0x496586,null));};exports[_0x85d5('0x74')]=function(_0x14e4e8,_0x57f26b,_0x45b1e2){return db[_0x85d5('0x75')][_0x85d5('0x42')]({'where':{'id':_0x14e4e8['params']['id']}})[_0x85d5('0x1c')](handleEntityNotFound(_0x57f26b,null))[_0x85d5('0x1c')](function(_0x2dacf7){var _0x387a3b;if(_0x2dacf7){_0x387a3b=squel[_0x85d5('0x59')]()[_0x85d5('0x5a')]('cm_hopper')[_0x85d5('0x76')]([_0x85d5('0x5c'),'scheduledAt',_0x85d5('0x5e'),'ListId',_0x85d5('0x77'),_0x85d5('0x61'),_0x85d5('0x62')],squel['select']()[_0x85d5('0x64')](_0x85d5('0x65'),_0x85d5('0x5c'))[_0x85d5('0x64')](_0x85d5('0x66'),'scheduledAt')[_0x85d5('0x64')](_0x85d5('0x67'),_0x85d5('0x5e'))[_0x85d5('0x64')]('ANY_VALUE(ListId)',_0x85d5('0x5f'))[_0x85d5('0x64')](_0x85d5('0x78'),'CampaignId')[_0x85d5('0x64')]('NOW()',_0x85d5('0x61'))[_0x85d5('0x64')]('NOW()','updatedAt')[_0x85d5('0x6a')](_0x85d5('0x79'))[_0x85d5('0x30')](_0x85d5('0x7a'),_0x14e4e8[_0x85d5('0x39')]['id'][_0x85d5('0x6c')]())[_0x85d5('0x30')](_0x85d5('0x6d'),_0x14e4e8['body'][_0x85d5('0x6e')][_0x85d5('0x6c')]())[_0x85d5('0x30')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x85d5('0x30')](_0x85d5('0x70'),squel['select']()[_0x85d5('0x64')](_0x85d5('0x5c'))[_0x85d5('0x6a')](_0x85d5('0x5b'))[_0x85d5('0x30')](_0x85d5('0x7a'),_0x14e4e8[_0x85d5('0x39')]['id']['toString']()))[_0x85d5('0x30')](_0x85d5('0x70'),squel[_0x85d5('0x63')]()[_0x85d5('0x64')]('calleridnum')[_0x85d5('0x6a')](_0x85d5('0x79'))[_0x85d5('0x30')](_0x85d5('0x7a'),_0x14e4e8[_0x85d5('0x39')]['id']['toString']())['where'](_0x85d5('0x72')))['group'](_0x85d5('0x5e')))[_0x85d5('0x6c')]();return db[_0x85d5('0x44')][_0x85d5('0x27')](_0x387a3b);}return[];})[_0x85d5('0x1c')](respondWithResult(_0x57f26b,null))[_0x85d5('0x40')](handleError(_0x57f26b,null));};exports[_0x85d5('0x7b')]=function(_0x48553d,_0xedb32d,_0x5366bc){return db[_0x85d5('0x7c')][_0x85d5('0x7d')]({'where':{'VoiceQueueId':_0x48553d[_0x85d5('0x41')]['VoiceQueueId'],'CampaignId':_0x48553d[_0x85d5('0x41')][_0x85d5('0x77')],'ContactId':_0x48553d[_0x85d5('0x41')]['ContactId']}})['then'](handleEntityNotFound(_0xedb32d,null))[_0x85d5('0x1c')](function(_0x428fd4){if(_0x428fd4){return _0x428fd4;}return null;})['then'](respondWithResult(_0xedb32d,null))[_0x85d5('0x40')](handleError(_0xedb32d,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index b91c002..1523e16 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 _0x9252=['CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x9252,0x1c4));var _0x2925=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0x9252[_0x3826ad];return _0x17b900;};'use strict';var _=require(_0x2925('0x0'));var util=require(_0x2925('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2925('0x2'));var BPromise=require(_0x2925('0x3'));var rp=require(_0x2925('0x4'));var fs=require('fs');var path=require(_0x2925('0x5'));var rimraf=require(_0x2925('0x6'));var config=require(_0x2925('0x7'));var attributes=require(_0x2925('0x8'));module[_0x2925('0x9')]=function(_0x2325af,_0xe0ba5){return _0x2325af['define'](_0x2925('0xa'),attributes,{'tableName':_0x2925('0xb'),'paranoid':![],'indexes':[{'name':_0x2925('0xc'),'fields':['calleridnum']},{'name':_0x2925('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf6cb=['request-promise','rimraf','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger','bluebird'];(function(_0x4c7c25,_0x1e16a8){var _0x297619=function(_0x453f76){while(--_0x453f76){_0x4c7c25['push'](_0x4c7c25['shift']());}};_0x297619(++_0x1e16a8);}(_0xf6cb,0x14d));var _0xbf6c=function(_0x6f3e55,_0x18b394){_0x6f3e55=_0x6f3e55-0x0;var _0x13dbc5=_0xf6cb[_0x6f3e55];return _0x13dbc5;};'use strict';var _=require(_0xbf6c('0x0'));var util=require('util');var logger=require(_0xbf6c('0x1'))('api');var moment=require('moment');var BPromise=require(_0xbf6c('0x2'));var rp=require(_0xbf6c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf6c('0x4'));var config=require('../../config/environment');var attributes=require(_0xbf6c('0x5'));module[_0xbf6c('0x6')]=function(_0x4b8b79,_0x347217){return _0x4b8b79[_0xbf6c('0x7')](_0xbf6c('0x8'),attributes,{'tableName':_0xbf6c('0x9'),'paranoid':![],'indexes':[{'name':_0xbf6c('0xa'),'fields':[_0xbf6c('0xa')]},{'name':_0xbf6c('0xb'),'fields':[_0xbf6c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 9834608..aea0dbc 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(_0xdbf959,_0x2eaa3f){var _0x819d7b=function(_0x223533){while(--_0x223533){_0xdbf959['push'](_0xdbf959['shift']());}};_0x819d7b(++_0x2eaa3f);}(_0xb10b,0x12a));var _0xbb10=function(_0x294747,_0x379ea7){_0x294747=_0x294747-0x0;var _0x1a4b30=_0xb10b[_0x294747];return _0x1a4b30;};'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 _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0xc6b3d,_0x561ab1){var _0x59e872=function(_0x942553){while(--_0x942553){_0xc6b3d['push'](_0xc6b3d['shift']());}};_0x59e872(++_0x561ab1);}(_0x7a54,0x106));var _0x47a5=function(_0x4df9d9,_0x5b7bac){_0x4df9d9=_0x4df9d9-0x0;var _0x28cc3d=_0x7a54[_0x4df9d9];return _0x28cc3d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index ea34bc1..58c84b9 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 _0x76a7=['./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','put','update','exports','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4452dc,_0x479149){var _0x52b892=function(_0x4a0098){while(--_0x4a0098){_0x4452dc['push'](_0x4452dc['shift']());}};_0x52b892(++_0x479149);}(_0x76a7,0x14b));var _0x776a=function(_0x3e258d,_0x4bd982){_0x3e258d=_0x3e258d-0x0;var _0x12a382=_0x76a7[_0x3e258d];return _0x12a382;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x776a('0x0'));var timeout=require('connect-timeout');var express=require(_0x776a('0x1'));var router=express[_0x776a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x776a('0x3'));var interaction=require(_0x776a('0x4'));var config=require('../../config/environment');var controller=require(_0x776a('0x5'));router[_0x776a('0x6')]('/',auth[_0x776a('0x7')](),controller[_0x776a('0x8')]);router[_0x776a('0x6')](_0x776a('0x9'),auth[_0x776a('0x7')](),controller[_0x776a('0xa')]);router['get'](_0x776a('0xb'),auth[_0x776a('0x7')](),controller[_0x776a('0xc')]);router['get'](_0x776a('0xd'),auth[_0x776a('0x7')](),controller[_0x776a('0xe')]);router[_0x776a('0x6')](_0x776a('0xf'),auth[_0x776a('0x7')](),controller[_0x776a('0x10')]);router[_0x776a('0x11')]('/voice/queue/moveContacts/:id',auth[_0x776a('0x7')](),controller[_0x776a('0x12')]);router[_0x776a('0x11')](_0x776a('0x13'),auth[_0x776a('0x7')](),controller[_0x776a('0x14')]);router['post']('/checkContactHopper',auth[_0x776a('0x7')](),controller['checkContactHopper']);router[_0x776a('0x15')](_0x776a('0xb'),auth[_0x776a('0x7')](),controller[_0x776a('0x16')]);module[_0x776a('0x17')]=router; \ No newline at end of file +var _0x22d8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','index','/describe','isAuthenticated','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','connect-timeout','express','Router'];(function(_0x5b9458,_0x184cc5){var _0x1134d4=function(_0x1dae3d){while(--_0x1dae3d){_0x5b9458['push'](_0x5b9458['shift']());}};_0x1134d4(++_0x184cc5);}(_0x22d8,0x19c));var _0x822d=function(_0x1df784,_0x131771){_0x1df784=_0x1df784-0x0;var _0x7abef0=_0x22d8[_0x1df784];return _0x7abef0;};'use strict';var multer=require(_0x822d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x822d('0x1'));var express=require(_0x822d('0x2'));var router=express[_0x822d('0x3')]();var fs_extra=require(_0x822d('0x4'));var auth=require(_0x822d('0x5'));var interaction=require(_0x822d('0x6'));var config=require(_0x822d('0x7'));var controller=require(_0x822d('0x8'));router[_0x822d('0x9')]('/',auth['isAuthenticated'](),controller[_0x822d('0xa')]);router[_0x822d('0x9')](_0x822d('0xb'),auth[_0x822d('0xc')](),controller['describe']);router[_0x822d('0x9')](_0x822d('0xd'),auth[_0x822d('0xc')](),controller[_0x822d('0xe')]);router['get'](_0x822d('0xf'),auth[_0x822d('0xc')](),controller[_0x822d('0x10')]);router[_0x822d('0x9')](_0x822d('0x11'),auth[_0x822d('0xc')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x822d('0x12')](_0x822d('0x13'),auth[_0x822d('0xc')](),controller['moveContactsQueueCampaignHopperFinal']);router['post']('/voice/campaign/moveContacts/:id',auth[_0x822d('0xc')](),controller[_0x822d('0x14')]);router['post'](_0x822d('0x15'),auth['isAuthenticated'](),controller[_0x822d('0x16')]);router[_0x822d('0x17')]('/:id',auth[_0x822d('0xc')](),controller[_0x822d('0x18')]);module[_0x822d('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 1bb7558..58a378d 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 _0xf57f=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x43295f,_0x1d0553){var _0x414c08=function(_0x21bb7c){while(--_0x21bb7c){_0x43295f['push'](_0x43295f['shift']());}};_0x414c08(++_0x1d0553);}(_0xf57f,0x152));var _0xff57=function(_0x1cf7e8,_0x3cea71){_0x1cf7e8=_0x1cf7e8-0x0;var _0x3a9a74=_0xf57f[_0x1cf7e8];return _0x3a9a74;};'use strict';var Sequelize=require(_0xff57('0x0'));module[_0xff57('0x1')]={'state':{'type':Sequelize[_0xff57('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xff57('0x3')]},'scheduledat':{'type':Sequelize[_0xff57('0x4')]},'countbusyretry':{'type':Sequelize[_0xff57('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xff57('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xff57('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xff57('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xff57('0x3')]},'starttime':{'type':Sequelize[_0xff57('0x4')]},'responsetime':{'type':Sequelize[_0xff57('0x4')]},'answertime':{'type':Sequelize[_0xff57('0x4')]},'droptime':{'type':Sequelize[_0xff57('0x4')]},'endtime':{'type':Sequelize[_0xff57('0x4')]},'ringtime':{'type':Sequelize[_0xff57('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xff57('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xff57('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xff57('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xff57('0x3')]},'campaign':{'type':Sequelize[_0xff57('0x3')]},'campaigntype':{'type':Sequelize[_0xff57('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xff57('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xff57('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xff57('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0xff57('0x4')]},'edited':{'type':Sequelize[_0xff57('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xff57('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xff57('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xff57('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf8df=['exports','STRING','INTEGER','DATE','BOOLEAN','sequelize'];(function(_0x2679b0,_0x2a1a6f){var _0x192302=function(_0x258202){while(--_0x258202){_0x2679b0['push'](_0x2679b0['shift']());}};_0x192302(++_0x2a1a6f);}(_0xf8df,0xa1));var _0xff8d=function(_0x2f02da,_0xfac53d){_0x2f02da=_0x2f02da-0x0;var _0x2a0ede=_0xf8df[_0x2f02da];return _0x2a0ede;};'use strict';var Sequelize=require(_0xff8d('0x0'));module[_0xff8d('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xff8d('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xff8d('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xff8d('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xff8d('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xff8d('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xff8d('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xff8d('0x2')]},'starttime':{'type':Sequelize[_0xff8d('0x4')]},'responsetime':{'type':Sequelize[_0xff8d('0x4')]},'answertime':{'type':Sequelize[_0xff8d('0x4')]},'droptime':{'type':Sequelize[_0xff8d('0x4')]},'endtime':{'type':Sequelize[_0xff8d('0x4')]},'ringtime':{'type':Sequelize[_0xff8d('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xff8d('0x2')]},'campaign':{'type':Sequelize[_0xff8d('0x2')]},'campaigntype':{'type':Sequelize[_0xff8d('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xff8d('0x2')]},'amd':{'type':Sequelize[_0xff8d('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xff8d('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xff8d('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xff8d('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xff8d('0x4')]},'recallme':{'type':Sequelize[_0xff8d('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xff8d('0x4')]},'edited':{'type':Sequelize[_0xff8d('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xff8d('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xff8d('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'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 2ff12e4..672b853 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 _0x5107=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','CmHopperHistory','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x32939c,_0x5da407){var _0x1fd0a8=function(_0x4ef308){while(--_0x4ef308){_0x32939c['push'](_0x32939c['shift']());}};_0x1fd0a8(++_0x5da407);}(_0x5107,0x1cb));var _0x7510=function(_0xd8f2e0,_0x4d4847){_0xd8f2e0=_0xd8f2e0-0x0;var _0x15a788=_0x5107[_0xd8f2e0];return _0x15a788;};'use strict';var emlformat=require(_0x7510('0x0'));var rimraf=require(_0x7510('0x1'));var zipdir=require(_0x7510('0x2'));var jsonpatch=require(_0x7510('0x3'));var rp=require(_0x7510('0x4'));var moment=require('moment');var BPromise=require(_0x7510('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x7510('0x6'));var csv=require('to-csv');var ejs=require(_0x7510('0x7'));var fs=require('fs');var fs_extra=require(_0x7510('0x8'));var _=require('lodash');var squel=require(_0x7510('0x9'));var crypto=require(_0x7510('0xa'));var jsforce=require(_0x7510('0xb'));var deskjs=require(_0x7510('0xc'));var toCsv=require(_0x7510('0xd'));var querystring=require(_0x7510('0xe'));var Papa=require(_0x7510('0xf'));var Redis=require(_0x7510('0x10'));var authService=require(_0x7510('0x11'));var qs=require(_0x7510('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7510('0x13'));var logger=require(_0x7510('0x14'))(_0x7510('0x15'));var utils=require(_0x7510('0x16'));var config=require(_0x7510('0x17'));var licenseUtil=require(_0x7510('0x18'));var db=require(_0x7510('0x19'))['db'];function respondWithStatusCode(_0x72edd7,_0x2fa352){_0x2fa352=_0x2fa352||0xcc;return function(_0x93adaa){if(_0x93adaa){return _0x72edd7[_0x7510('0x1a')](_0x2fa352);}return _0x72edd7[_0x7510('0x1b')](_0x2fa352)[_0x7510('0x1c')]();};}function respondWithResult(_0x46f47f,_0x5d253f){_0x5d253f=_0x5d253f||0xc8;return function(_0x1befa0){if(_0x1befa0){return _0x46f47f[_0x7510('0x1b')](_0x5d253f)['json'](_0x1befa0);}};}function respondWithFilteredResult(_0x4924f,_0x43d3a8){return function(_0x339d4a){if(_0x339d4a){var _0x5b6625=typeof _0x43d3a8[_0x7510('0x1d')]===_0x7510('0x1e')&&typeof _0x43d3a8[_0x7510('0x1f')]===_0x7510('0x1e');var _0x4d6461=_0x339d4a[_0x7510('0x20')];var _0x1c4a85=_0x5b6625?0x0:_0x43d3a8[_0x7510('0x1d')];var _0x5d6c75=_0x5b6625?_0x339d4a[_0x7510('0x20')]:_0x43d3a8[_0x7510('0x1d')]+_0x43d3a8[_0x7510('0x1f')];var _0xd4b5b9;if(_0x5d6c75>=_0x4d6461){_0x5d6c75=_0x4d6461;_0xd4b5b9=0xc8;}else{_0xd4b5b9=0xce;}_0x4924f[_0x7510('0x1b')](_0xd4b5b9);return _0x4924f['set']('Content-Range',_0x1c4a85+'-'+_0x5d6c75+'/'+_0x4d6461)[_0x7510('0x21')](_0x339d4a);}return null;};}function patchUpdates(_0xcf29f9){return function(_0x37c582){try{jsonpatch[_0x7510('0x22')](_0x37c582,_0xcf29f9,!![]);}catch(_0x5d231e){return BPromise[_0x7510('0x23')](_0x5d231e);}return _0x37c582[_0x7510('0x24')]();};}function saveUpdates(_0x8428e8,_0x2cdb47){return function(_0x4bbd01){if(_0x4bbd01){return _0x4bbd01[_0x7510('0x25')](_0x8428e8)[_0x7510('0x26')](function(_0x24db20){return _0x24db20;});}return null;};}function removeEntity(_0x4b2dd7,_0x4acd0a){return function(_0x282cbf){if(_0x282cbf){return _0x282cbf[_0x7510('0x27')]()[_0x7510('0x26')](function(){_0x4b2dd7[_0x7510('0x1b')](0xcc)[_0x7510('0x1c')]();});}};}function handleEntityNotFound(_0x446655,_0xc8c379){return function(_0x2b1cca){if(!_0x2b1cca){_0x446655[_0x7510('0x1a')](0x194);}return _0x2b1cca;};}function handleError(_0x110191,_0x5ae309){_0x5ae309=_0x5ae309||0x1f4;return function(_0x4384df){logger[_0x7510('0x28')](_0x4384df[_0x7510('0x29')]);if(_0x4384df[_0x7510('0x2a')]){delete _0x4384df['name'];}_0x110191[_0x7510('0x1b')](_0x5ae309)[_0x7510('0x2b')](_0x4384df);};}exports[_0x7510('0x2c')]=function(_0x18c1d0,_0x4687a6){var _0x1c468e={},_0x1dd9b7={},_0x1b4625={'count':0x0,'rows':[]};var _0x33b362=_[_0x7510('0x2d')](db['CmHopperHistory'][_0x7510('0x2e')],function(_0x2d0ee7){return{'name':_0x2d0ee7[_0x7510('0x2f')],'type':_0x2d0ee7[_0x7510('0x30')][_0x7510('0x31')]};});_0x1dd9b7[_0x7510('0x32')]=_[_0x7510('0x2d')](_0x33b362,_0x7510('0x2a'));_0x1dd9b7[_0x7510('0x33')]=_[_0x7510('0x34')](_0x18c1d0[_0x7510('0x33')]);_0x1dd9b7['filters']=_[_0x7510('0x35')](_0x1dd9b7[_0x7510('0x32')],_0x1dd9b7[_0x7510('0x33')]);_0x1c468e[_0x7510('0x36')]=_['intersection'](_0x1dd9b7[_0x7510('0x32')],qs[_0x7510('0x37')](_0x18c1d0[_0x7510('0x33')][_0x7510('0x37')]));_0x1c468e[_0x7510('0x36')]=_0x1c468e['attributes'][_0x7510('0x38')]?_0x1c468e[_0x7510('0x36')]:_0x1dd9b7[_0x7510('0x32')];if(!_0x18c1d0['query'][_0x7510('0x39')](_0x7510('0x3a'))){_0x1c468e['limit']=qs[_0x7510('0x1f')](_0x18c1d0[_0x7510('0x33')]['limit']);_0x1c468e[_0x7510('0x1d')]=qs['offset'](_0x18c1d0[_0x7510('0x33')][_0x7510('0x1d')]);}_0x1c468e[_0x7510('0x3b')]=qs['sort'](_0x18c1d0[_0x7510('0x33')][_0x7510('0x3c')]);_0x1c468e[_0x7510('0x3d')]=qs[_0x7510('0x3e')](_[_0x7510('0x3f')](_0x18c1d0[_0x7510('0x33')],_0x1dd9b7[_0x7510('0x3e')]),_0x33b362);if(_0x18c1d0[_0x7510('0x33')][_0x7510('0x40')]){_0x1c468e[_0x7510('0x3d')]=_[_0x7510('0x41')](_0x1c468e['where'],{'$or':_[_0x7510('0x2d')](_0x33b362,function(_0x3b1d81){if(_0x3b1d81[_0x7510('0x30')]!==_0x7510('0x42')){var _0x16b34d={};_0x16b34d[_0x3b1d81[_0x7510('0x2a')]]={'$like':'%'+_0x18c1d0['query'][_0x7510('0x40')]+'%'};return _0x16b34d;}})});}_0x1c468e=_[_0x7510('0x41')]({},_0x1c468e,_0x18c1d0['options']);var _0xadaf08={'where':_0x1c468e[_0x7510('0x3d')]};return db[_0x7510('0x43')][_0x7510('0x20')](_0xadaf08)['then'](function(_0x1881dc){_0x1b4625[_0x7510('0x20')]=_0x1881dc;if(_0x18c1d0['query'][_0x7510('0x44')]){_0x1c468e['include']=[{'all':!![]}];}return db[_0x7510('0x43')][_0x7510('0x45')](_0x1c468e);})['then'](function(_0x4c2f2f){_0x1b4625[_0x7510('0x46')]=_0x4c2f2f;return _0x1b4625;})[_0x7510('0x26')](respondWithFilteredResult(_0x4687a6,_0x1c468e))[_0x7510('0x47')](handleError(_0x4687a6,null));};exports[_0x7510('0x48')]=function(_0x3307a8,_0xf1012f){var _0x299477={'raw':!![],'where':{'id':_0x3307a8[_0x7510('0x49')]['id']}},_0x3d4816={};_0x3d4816[_0x7510('0x32')]=_[_0x7510('0x34')](db[_0x7510('0x43')]['rawAttributes']);_0x3d4816[_0x7510('0x33')]=_['keys'](_0x3307a8[_0x7510('0x33')]);_0x3d4816[_0x7510('0x3e')]=_[_0x7510('0x35')](_0x3d4816[_0x7510('0x32')],_0x3d4816[_0x7510('0x33')]);_0x299477['attributes']=_[_0x7510('0x35')](_0x3d4816[_0x7510('0x32')],qs[_0x7510('0x37')](_0x3307a8[_0x7510('0x33')][_0x7510('0x37')]));_0x299477[_0x7510('0x36')]=_0x299477['attributes'][_0x7510('0x38')]?_0x299477[_0x7510('0x36')]:_0x3d4816[_0x7510('0x32')];if(_0x3307a8[_0x7510('0x33')]['includeAll']){_0x299477[_0x7510('0x4a')]=[{'all':!![]}];}_0x299477=_[_0x7510('0x41')]({},_0x299477,_0x3307a8[_0x7510('0x4b')]);return db[_0x7510('0x43')][_0x7510('0x4c')](_0x299477)[_0x7510('0x26')](handleEntityNotFound(_0xf1012f,null))[_0x7510('0x26')](respondWithResult(_0xf1012f,null))[_0x7510('0x47')](handleError(_0xf1012f,null));};exports['create']=function(_0x59291a,_0x8c9cdc){return db[_0x7510('0x43')][_0x7510('0x4d')](_0x59291a[_0x7510('0x4e')],{})[_0x7510('0x26')](respondWithResult(_0x8c9cdc,0xc9))[_0x7510('0x47')](handleError(_0x8c9cdc,null));};exports['describe']=function(_0x20cf5c,_0x3a9f65){return db['CmHopperHistory']['describe']()['then'](respondWithResult(_0x3a9f65,null))[_0x7510('0x47')](handleError(_0x3a9f65,null));};exports[_0x7510('0x25')]=function(_0x2c7c1d,_0x1d1e23){if(_0x2c7c1d[_0x7510('0x4e')][_0x7510('0x4f')]){delete _0x2c7c1d[_0x7510('0x4e')][_0x7510('0x4f')];}return db[_0x7510('0x43')][_0x7510('0x4c')]({'where':{'uniqueid':_0x2c7c1d[_0x7510('0x49')]['id']}})[_0x7510('0x26')](handleEntityNotFound(_0x1d1e23,null))[_0x7510('0x26')](saveUpdates(_0x2c7c1d[_0x7510('0x4e')],null))['then'](respondWithResult(_0x1d1e23,null))[_0x7510('0x47')](handleError(_0x1d1e23,null));}; \ No newline at end of file +var _0x680f=['undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','CmHopperHistory','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','describe','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x680f,0x15a));var _0xf680=function(_0x254691,_0x7e529){_0x254691=_0x254691-0x0;var _0xc0de85=_0x680f[_0x254691];return _0xc0de85;};'use strict';var emlformat=require(_0xf680('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf680('0x1'));var jsonpatch=require(_0xf680('0x2'));var rp=require(_0xf680('0x3'));var moment=require(_0xf680('0x4'));var BPromise=require(_0xf680('0x5'));var Mustache=require(_0xf680('0x6'));var util=require(_0xf680('0x7'));var path=require(_0xf680('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf680('0x9'));var squel=require(_0xf680('0xa'));var crypto=require('crypto');var jsforce=require(_0xf680('0xb'));var deskjs=require(_0xf680('0xc'));var toCsv=require(_0xf680('0xd'));var querystring=require(_0xf680('0xe'));var Papa=require(_0xf680('0xf'));var Redis=require(_0xf680('0x10'));var authService=require(_0xf680('0x11'));var qs=require(_0xf680('0x12'));var as=require(_0xf680('0x13'));var hardwareService=require(_0xf680('0x14'));var logger=require('../../config/logger')(_0xf680('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf680('0x16'));var db=require(_0xf680('0x17'))['db'];function respondWithStatusCode(_0x32c300,_0x3d50f4){_0x3d50f4=_0x3d50f4||0xcc;return function(_0x31836d){if(_0x31836d){return _0x32c300[_0xf680('0x18')](_0x3d50f4);}return _0x32c300[_0xf680('0x19')](_0x3d50f4)[_0xf680('0x1a')]();};}function respondWithResult(_0x3e0cc7,_0x223d0){_0x223d0=_0x223d0||0xc8;return function(_0x1eacac){if(_0x1eacac){return _0x3e0cc7['status'](_0x223d0)[_0xf680('0x1b')](_0x1eacac);}};}function respondWithFilteredResult(_0x592def,_0x524101){return function(_0x414d2a){if(_0x414d2a){var _0x1459d3=typeof _0x524101[_0xf680('0x1c')]===_0xf680('0x1d')&&typeof _0x524101[_0xf680('0x1e')]==='undefined';var _0x2c7a3b=_0x414d2a[_0xf680('0x1f')];var _0x455756=_0x1459d3?0x0:_0x524101[_0xf680('0x1c')];var _0x6fb99=_0x1459d3?_0x414d2a[_0xf680('0x1f')]:_0x524101[_0xf680('0x1c')]+_0x524101['limit'];var _0x3cab90;if(_0x6fb99>=_0x2c7a3b){_0x6fb99=_0x2c7a3b;_0x3cab90=0xc8;}else{_0x3cab90=0xce;}_0x592def[_0xf680('0x19')](_0x3cab90);return _0x592def['set'](_0xf680('0x20'),_0x455756+'-'+_0x6fb99+'/'+_0x2c7a3b)[_0xf680('0x1b')](_0x414d2a);}return null;};}function patchUpdates(_0x35766c){return function(_0x3e3314){try{jsonpatch[_0xf680('0x21')](_0x3e3314,_0x35766c,!![]);}catch(_0x3cc83b){return BPromise[_0xf680('0x22')](_0x3cc83b);}return _0x3e3314[_0xf680('0x23')]();};}function saveUpdates(_0x178df4,_0x56210c){return function(_0x260247){if(_0x260247){return _0x260247[_0xf680('0x24')](_0x178df4)[_0xf680('0x25')](function(_0x223b3c){return _0x223b3c;});}return null;};}function removeEntity(_0x195940,_0x138672){return function(_0x5c21bd){if(_0x5c21bd){return _0x5c21bd[_0xf680('0x26')]()[_0xf680('0x25')](function(){_0x195940['status'](0xcc)[_0xf680('0x1a')]();});}};}function handleEntityNotFound(_0x400e8e,_0x55c119){return function(_0x55c4fb){if(!_0x55c4fb){_0x400e8e[_0xf680('0x18')](0x194);}return _0x55c4fb;};}function handleError(_0x3d0db6,_0x2dbb42){_0x2dbb42=_0x2dbb42||0x1f4;return function(_0x3ce7e1){logger['error'](_0x3ce7e1[_0xf680('0x27')]);if(_0x3ce7e1[_0xf680('0x28')]){delete _0x3ce7e1[_0xf680('0x28')];}_0x3d0db6[_0xf680('0x19')](_0x2dbb42)[_0xf680('0x29')](_0x3ce7e1);};}exports['index']=function(_0x12210b,_0x5be3ec){var _0x4055f6={},_0x232474={},_0x8e7b13={'count':0x0,'rows':[]};var _0x515337=_[_0xf680('0x2a')](db[_0xf680('0x2b')][_0xf680('0x2c')],function(_0x574cbd){return{'name':_0x574cbd[_0xf680('0x2d')],'type':_0x574cbd['type'][_0xf680('0x2e')]};});_0x232474[_0xf680('0x2f')]=_[_0xf680('0x2a')](_0x515337,_0xf680('0x28'));_0x232474[_0xf680('0x30')]=_['keys'](_0x12210b['query']);_0x232474['filters']=_[_0xf680('0x31')](_0x232474[_0xf680('0x2f')],_0x232474[_0xf680('0x30')]);_0x4055f6[_0xf680('0x32')]=_[_0xf680('0x31')](_0x232474[_0xf680('0x2f')],qs['fields'](_0x12210b['query'][_0xf680('0x33')]));_0x4055f6[_0xf680('0x32')]=_0x4055f6[_0xf680('0x32')][_0xf680('0x34')]?_0x4055f6['attributes']:_0x232474[_0xf680('0x2f')];if(!_0x12210b[_0xf680('0x30')][_0xf680('0x35')](_0xf680('0x36'))){_0x4055f6[_0xf680('0x1e')]=qs['limit'](_0x12210b[_0xf680('0x30')]['limit']);_0x4055f6[_0xf680('0x1c')]=qs['offset'](_0x12210b[_0xf680('0x30')][_0xf680('0x1c')]);}_0x4055f6[_0xf680('0x37')]=qs[_0xf680('0x38')](_0x12210b['query']['sort']);_0x4055f6[_0xf680('0x39')]=qs[_0xf680('0x3a')](_[_0xf680('0x3b')](_0x12210b[_0xf680('0x30')],_0x232474[_0xf680('0x3a')]),_0x515337);if(_0x12210b['query'][_0xf680('0x3c')]){_0x4055f6['where']=_[_0xf680('0x3d')](_0x4055f6['where'],{'$or':_[_0xf680('0x2a')](_0x515337,function(_0x31ac14){if(_0x31ac14['type']!==_0xf680('0x3e')){var _0x487037={};_0x487037[_0x31ac14['name']]={'$like':'%'+_0x12210b[_0xf680('0x30')][_0xf680('0x3c')]+'%'};return _0x487037;}})});}_0x4055f6=_[_0xf680('0x3d')]({},_0x4055f6,_0x12210b[_0xf680('0x3f')]);var _0x1c8135={'where':_0x4055f6[_0xf680('0x39')]};return db[_0xf680('0x2b')][_0xf680('0x1f')](_0x1c8135)[_0xf680('0x25')](function(_0x1b685f){_0x8e7b13[_0xf680('0x1f')]=_0x1b685f;if(_0x12210b[_0xf680('0x30')][_0xf680('0x40')]){_0x4055f6[_0xf680('0x41')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xf680('0x42')](_0x4055f6);})['then'](function(_0x5bda45){_0x8e7b13['rows']=_0x5bda45;return _0x8e7b13;})[_0xf680('0x25')](respondWithFilteredResult(_0x5be3ec,_0x4055f6))[_0xf680('0x43')](handleError(_0x5be3ec,null));};exports[_0xf680('0x44')]=function(_0x548034,_0xada022){var _0x37a5ff={'raw':!![],'where':{'id':_0x548034[_0xf680('0x45')]['id']}},_0x14b5c6={};_0x14b5c6[_0xf680('0x2f')]=_[_0xf680('0x46')](db[_0xf680('0x2b')][_0xf680('0x2c')]);_0x14b5c6[_0xf680('0x30')]=_['keys'](_0x548034[_0xf680('0x30')]);_0x14b5c6[_0xf680('0x3a')]=_[_0xf680('0x31')](_0x14b5c6[_0xf680('0x2f')],_0x14b5c6['query']);_0x37a5ff[_0xf680('0x32')]=_[_0xf680('0x31')](_0x14b5c6[_0xf680('0x2f')],qs['fields'](_0x548034[_0xf680('0x30')][_0xf680('0x33')]));_0x37a5ff[_0xf680('0x32')]=_0x37a5ff[_0xf680('0x32')]['length']?_0x37a5ff[_0xf680('0x32')]:_0x14b5c6[_0xf680('0x2f')];if(_0x548034['query'][_0xf680('0x40')]){_0x37a5ff[_0xf680('0x41')]=[{'all':!![]}];}_0x37a5ff=_[_0xf680('0x3d')]({},_0x37a5ff,_0x548034['options']);return db['CmHopperHistory'][_0xf680('0x47')](_0x37a5ff)[_0xf680('0x25')](handleEntityNotFound(_0xada022,null))[_0xf680('0x25')](respondWithResult(_0xada022,null))[_0xf680('0x43')](handleError(_0xada022,null));};exports[_0xf680('0x48')]=function(_0xe95b6f,_0x5c932b){return db[_0xf680('0x2b')][_0xf680('0x48')](_0xe95b6f['body'],{})[_0xf680('0x25')](respondWithResult(_0x5c932b,0xc9))[_0xf680('0x43')](handleError(_0x5c932b,null));};exports[_0xf680('0x49')]=function(_0x114b67,_0x50996d){return db[_0xf680('0x2b')]['describe']()[_0xf680('0x25')](respondWithResult(_0x50996d,null))[_0xf680('0x43')](handleError(_0x50996d,null));};exports[_0xf680('0x24')]=function(_0x1afb43,_0x315b2d){if(_0x1afb43[_0xf680('0x4a')]['uniqueid']){delete _0x1afb43[_0xf680('0x4a')]['uniqueid'];}return db[_0xf680('0x2b')]['find']({'where':{'uniqueid':_0x1afb43[_0xf680('0x45')]['id']}})['then'](handleEntityNotFound(_0x315b2d,null))[_0xf680('0x25')](saveUpdates(_0x1afb43[_0xf680('0x4a')],null))[_0xf680('0x25')](respondWithResult(_0x315b2d,null))[_0xf680('0x43')](handleError(_0x315b2d,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 4e24870..feb8d99 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 _0x3fc6=['define','CmHopperHistory','endtime','uniqueid','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x5c334c,_0x1b8c03){var _0x32a26d=function(_0x27418e){while(--_0x27418e){_0x5c334c['push'](_0x5c334c['shift']());}};_0x32a26d(++_0x1b8c03);}(_0x3fc6,0x115));var _0x63fc=function(_0x488b82,_0x4e1485){_0x488b82=_0x488b82-0x0;var _0x31a4b1=_0x3fc6[_0x488b82];return _0x31a4b1;};'use strict';var _=require(_0x63fc('0x0'));var util=require('util');var logger=require(_0x63fc('0x1'))(_0x63fc('0x2'));var moment=require(_0x63fc('0x3'));var BPromise=require(_0x63fc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x63fc('0x5'));var rimraf=require(_0x63fc('0x6'));var config=require(_0x63fc('0x7'));var attributes=require('./cmHopperHistory.attributes');module[_0x63fc('0x8')]=function(_0x4ed9a1,_0x2c9b0b){return _0x4ed9a1[_0x63fc('0x9')](_0x63fc('0xa'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x63fc('0xb'),'fields':[_0x63fc('0xb')]},{'name':_0x63fc('0xc'),'fields':[_0x63fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5c96=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','cm_hopper_history','endtime','uniqueid','lodash'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x5c96,0x133));var _0x65c9=function(_0x5de2c2,_0x2fe690){_0x5de2c2=_0x5de2c2-0x0;var _0xb929b4=_0x5c96[_0x5de2c2];return _0xb929b4;};'use strict';var _=require(_0x65c9('0x0'));var util=require(_0x65c9('0x1'));var logger=require(_0x65c9('0x2'))(_0x65c9('0x3'));var moment=require('moment');var BPromise=require(_0x65c9('0x4'));var rp=require(_0x65c9('0x5'));var fs=require('fs');var path=require(_0x65c9('0x6'));var rimraf=require(_0x65c9('0x7'));var config=require(_0x65c9('0x8'));var attributes=require(_0x65c9('0x9'));module[_0x65c9('0xa')]=function(_0x5144b3,_0x5de640){return _0x5144b3['define']('CmHopperHistory',attributes,{'tableName':_0x65c9('0xb'),'paranoid':![],'indexes':[{'name':_0x65c9('0xc'),'fields':[_0x65c9('0xc')]},{'name':'uniqueid','fields':[_0x65c9('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 9c9496b..fe4bd0f 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 _0x1bd1=['outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','`state`\x20=\x204,\x201,\x20null','ivrAnswerCallsDay','lodash','util','moment','randomstring','rpc','../../config/environment','jayson/promise','client','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CmHopperHistory','create','body','options','info','CreateCmHopperHistory','AvgHandleTime','findAll','where','col','predictiveIntervalTotalCalls','sequelize','COUNT','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','raw','campaign','name','`state`\x20=\x200,\x201,\x20null'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1bd1,0x123));var _0x11bd=function(_0x10a985,_0x2c5252){_0x10a985=_0x10a985-0x0;var _0x46f374=_0x1bd1[_0x10a985];return _0x46f374;};'use strict';var _=require(_0x11bd('0x0'));var util=require(_0x11bd('0x1'));var moment=require(_0x11bd('0x2'));var BPromise=require('bluebird');var rs=require(_0x11bd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x11bd('0x4'));var config=require(_0x11bd('0x5'));var jayson=require(_0x11bd('0x6'));var client=jayson[_0x11bd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x336255,_0x1f813c,_0x359f21){return new BPromise(function(_0x3940cf,_0x361ecf){return client['request'](_0x336255,_0x359f21)[_0x11bd('0x8')](function(_0x553727){logger['info'](_0x11bd('0x9'),_0x1f813c,_0x11bd('0xa'));logger[_0x11bd('0xb')](_0x11bd('0xc'),_0x1f813c,_0x11bd('0xa'),JSON[_0x11bd('0xd')](_0x553727));if(_0x553727[_0x11bd('0xe')]){if(_0x553727[_0x11bd('0xe')]['code']===0x1f4){logger[_0x11bd('0xe')](_0x11bd('0x9'),_0x1f813c,_0x553727[_0x11bd('0xe')][_0x11bd('0xf')]);return _0x361ecf(_0x553727[_0x11bd('0xe')][_0x11bd('0xf')]);}logger[_0x11bd('0xe')]('CmHopperHistory,\x20%s,\x20%s',_0x1f813c,_0x553727['error'][_0x11bd('0xf')]);return _0x3940cf(_0x553727[_0x11bd('0xe')][_0x11bd('0xf')]);}else{logger['info'](_0x11bd('0x9'),_0x1f813c,'request\x20sent');_0x3940cf(_0x553727['result'][_0x11bd('0xf')]);}})[_0x11bd('0x10')](function(_0xab4cde){logger[_0x11bd('0xe')](_0x11bd('0x9'),_0x1f813c,_0xab4cde);_0x361ecf(_0xab4cde);});});}exports['CreateCmHopperHistory']=function(_0x904980){var _0x279a36=this;return new Promise(function(_0x39de22,_0x23719a){return db[_0x11bd('0x11')][_0x11bd('0x12')](_0x904980[_0x11bd('0x13')],{'raw':_0x904980[_0x11bd('0x14')]?_0x904980['options']['raw']===undefined?!![]:![]:!![]})[_0x11bd('0x8')](function(_0x232811){logger[_0x11bd('0x15')](_0x11bd('0x16'),_0x904980);logger['debug'](_0x11bd('0x16'),_0x904980,JSON['stringify'](_0x232811));_0x39de22(_0x232811);})[_0x11bd('0x10')](function(_0x104357){logger[_0x11bd('0xe')]('CreateCmHopperHistory',_0x104357[_0x11bd('0xf')],_0x904980);_0x23719a(_0x279a36[_0x11bd('0xe')](0x1f4,_0x104357[_0x11bd('0xf')]));});});};exports[_0x11bd('0x17')]=function(_0x3343da){var _0x443d2c=this;return new Promise(function(_0x3dafec,_0x2ac9f0){return db[_0x11bd('0x11')][_0x11bd('0x18')]({'raw':_0x3343da[_0x11bd('0x14')]?_0x3343da[_0x11bd('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x3343da[_0x11bd('0x14')]?_0x3343da[_0x11bd('0x14')][_0x11bd('0x19')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db['sequelize'][_0x11bd('0x1a')]('id')),_0x11bd('0x1b')],[db[_0x11bd('0x1c')]['fn'](_0x11bd('0x1d'),db[_0x11bd('0x1c')]['fn']('IF',db[_0x11bd('0x1c')][_0x11bd('0x1e')]('`state`\x20=\x204,\x201,\x20null'))),_0x11bd('0x1f')],[db['sequelize']['fn'](_0x11bd('0x1d'),db[_0x11bd('0x1c')]['fn']('IF',db['sequelize'][_0x11bd('0x1e')](_0x11bd('0x20')))),_0x11bd('0x21')],[db[_0x11bd('0x1c')]['fn'](_0x11bd('0x1d'),db[_0x11bd('0x1c')]['fn']('IF',db[_0x11bd('0x1c')][_0x11bd('0x1e')]('`state`\x20=\x2011,\x201,\x20null'))),_0x11bd('0x22')],[db[_0x11bd('0x1c')]['fn'](_0x11bd('0x23'),db[_0x11bd('0x1c')]['fn']('IF',db[_0x11bd('0x1c')][_0x11bd('0x1e')](_0x11bd('0x24')))),_0x11bd('0x25')],[db[_0x11bd('0x1c')]['fn'](_0x11bd('0x23'),db['sequelize']['fn']('IF',db[_0x11bd('0x1c')][_0x11bd('0x1e')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x11bd('0x26')]]})[_0x11bd('0x8')](function(_0x4768fc){logger[_0x11bd('0x15')]('AvgHandleTime',_0x3343da);logger[_0x11bd('0xb')]('AvgHandleTime',_0x3343da,JSON[_0x11bd('0xd')](_0x4768fc));_0x3dafec(_0x4768fc);})[_0x11bd('0x10')](function(_0x1a5610){logger[_0x11bd('0xe')](_0x11bd('0x17'),_0x1a5610[_0x11bd('0xf')],_0x3343da);_0x2ac9f0(_0x443d2c[_0x11bd('0xe')](0x1f4,_0x1a5610[_0x11bd('0xf')]));});});};exports[_0x11bd('0x27')]=function(_0x12a5d6){var _0xbec55e=this;return new Promise(function(_0x1c4b40,_0x12c1f4){return db[_0x11bd('0x11')]['findAll']({'raw':_0x12a5d6['options']?_0x12a5d6['options'][_0x11bd('0x28')]===undefined?!![]:![]:!![],'where':_0x12a5d6[_0x11bd('0x14')]?_0x12a5d6['options'][_0x11bd('0x19')]||null:null,'attributes':[[_0x11bd('0x29'),_0x11bd('0x2a')],[db['sequelize']['fn'](_0x11bd('0x1d'),db[_0x11bd('0x1c')]['fn']('IF',db[_0x11bd('0x1c')][_0x11bd('0x1e')](_0x11bd('0x2b')))),_0x11bd('0x2c')],[db['sequelize']['fn'](_0x11bd('0x1d'),db['sequelize']['fn']('IF',db[_0x11bd('0x1c')]['literal'](_0x11bd('0x2d')))),_0x11bd('0x2e')],[db[_0x11bd('0x1c')]['fn'](_0x11bd('0x1d'),db[_0x11bd('0x1c')]['fn']('IF',db[_0x11bd('0x1c')][_0x11bd('0x1e')]('`state`\x20=\x204,\x201,\x20null'))),'outboundAnswerCallsDay'],[db[_0x11bd('0x1c')]['fn'](_0x11bd('0x1d'),db['sequelize']['fn']('IF',db[_0x11bd('0x1c')]['literal'](_0x11bd('0x2f')))),_0x11bd('0x30')],[db[_0x11bd('0x1c')]['fn'](_0x11bd('0x1d'),db[_0x11bd('0x1c')]['fn']('IF',db[_0x11bd('0x1c')]['literal'](_0x11bd('0x31')))),_0x11bd('0x32')],[db[_0x11bd('0x1c')]['fn'](_0x11bd('0x1d'),db[_0x11bd('0x1c')]['fn']('IF',db['sequelize'][_0x11bd('0x1e')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x11bd('0x33')],[db[_0x11bd('0x1c')]['fn'](_0x11bd('0x1d'),db['sequelize']['fn']('IF',db[_0x11bd('0x1c')][_0x11bd('0x1e')](_0x11bd('0x34')))),_0x11bd('0x35')],[db['sequelize']['fn'](_0x11bd('0x1d'),db[_0x11bd('0x1c')]['fn']('IF',db[_0x11bd('0x1c')][_0x11bd('0x1e')](_0x11bd('0x36')))),_0x11bd('0x37')],[db[_0x11bd('0x1c')]['fn'](_0x11bd('0x1d'),db[_0x11bd('0x1c')]['fn']('IF',db['sequelize'][_0x11bd('0x1e')](_0x11bd('0x38')))),'outboundBlacklistCallsDay'],[db[_0x11bd('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x11bd('0x1e')](_0x11bd('0x39')))),_0x11bd('0x3a')],[db[_0x11bd('0x1c')]['fn'](_0x11bd('0x1d'),db[_0x11bd('0x1c')]['fn']('IF',db[_0x11bd('0x1c')][_0x11bd('0x1e')]('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0x11bd('0x1c')]['fn'](_0x11bd('0x1d'),db[_0x11bd('0x1c')]['fn']('IF',db[_0x11bd('0x1c')][_0x11bd('0x1e')](_0x11bd('0x3b')))),'outboundAnswerAgiCallsDay'],[db[_0x11bd('0x1c')]['fn'](_0x11bd('0x1d'),db[_0x11bd('0x1c')]['fn']('IF',db['sequelize'][_0x11bd('0x1e')](_0x11bd('0x3c')))),_0x11bd('0x3d')],[db[_0x11bd('0x1c')]['fn'](_0x11bd('0x1d'),db[_0x11bd('0x1c')]['fn']('IF',db[_0x11bd('0x1c')][_0x11bd('0x1e')](_0x11bd('0x3e')))),_0x11bd('0x3f')]],'group':[_0x11bd('0x29')]})[_0x11bd('0x8')](function(_0x32fc2a){logger['info'](_0x11bd('0x27'),_0x12a5d6);logger[_0x11bd('0xb')](_0x11bd('0x27'),_0x12a5d6,JSON['stringify'](_0x32fc2a));_0x1c4b40(_0x32fc2a);})[_0x11bd('0x10')](function(_0x168e3f){logger[_0x11bd('0xe')]('GetVoiceQueueHopperHistory',_0x168e3f[_0x11bd('0xf')],_0x12a5d6);_0x12c1f4(_0xbec55e[_0x11bd('0xe')](0x1f4,_0x168e3f[_0x11bd('0xf')]));});});};exports[_0x11bd('0x40')]=function(_0x12e41e){var _0x2d5a60=this;return new Promise(function(_0x34bc2e,_0x1fe763){return db[_0x11bd('0x11')][_0x11bd('0x18')]({'raw':_0x12e41e[_0x11bd('0x14')]?_0x12e41e['options'][_0x11bd('0x28')]===undefined?!![]:![]:!![],'where':_0x12e41e[_0x11bd('0x14')]?_0x12e41e[_0x11bd('0x14')][_0x11bd('0x19')]||null:null,'attributes':[['campaign','name'],[db[_0x11bd('0x1c')]['fn'](_0x11bd('0x1d'),db[_0x11bd('0x1c')][_0x11bd('0x1a')]('id')),'ivrTotalCallsDays'],[db[_0x11bd('0x1c')]['fn'](_0x11bd('0x1d'),db['sequelize']['fn']('IF',db[_0x11bd('0x1c')][_0x11bd('0x1e')](_0x11bd('0x41')))),_0x11bd('0x42')]],'group':[_0x11bd('0x29')]})['then'](function(_0x39b7b8){logger[_0x11bd('0x15')](_0x11bd('0x40'),_0x12e41e);logger[_0x11bd('0xb')](_0x11bd('0x40'),_0x12e41e,JSON[_0x11bd('0xd')](_0x39b7b8));_0x34bc2e(_0x39b7b8);})[_0x11bd('0x10')](function(_0x32b56b){logger[_0x11bd('0xe')](_0x11bd('0x40'),_0x32b56b[_0x11bd('0xf')],_0x12e41e);_0x1fe763(_0x2d5a60[_0x11bd('0xe')](0x1f4,_0x32b56b[_0x11bd('0xf')]));});});}; \ No newline at end of file +var _0xb49a=['stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','body','options','raw','AvgHandleTime','CmHopperHistory','where','sequelize','col','COUNT','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xb49a,0xfb));var _0xab49=function(_0x57fda8,_0x5e80a0){_0x57fda8=_0x57fda8-0x0;var _0x11c895=_0xb49a[_0x57fda8];return _0x11c895;};'use strict';var _=require(_0xab49('0x0'));var util=require(_0xab49('0x1'));var moment=require(_0xab49('0x2'));var BPromise=require(_0xab49('0x3'));var rs=require(_0xab49('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab49('0x5'))['db'];var utils=require(_0xab49('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xab49('0x7'));var jayson=require(_0xab49('0x8'));var client=jayson[_0xab49('0x9')][_0xab49('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57ea72,_0x26a98a,_0xd86a5){return new BPromise(function(_0x4d4d00,_0x15f259){return client[_0xab49('0xb')](_0x57ea72,_0xd86a5)[_0xab49('0xc')](function(_0x79f764){logger[_0xab49('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x26a98a,'request\x20sent');logger[_0xab49('0xe')](_0xab49('0xf'),_0x26a98a,_0xab49('0x10'),JSON[_0xab49('0x11')](_0x79f764));if(_0x79f764[_0xab49('0x12')]){if(_0x79f764['error'][_0xab49('0x13')]===0x1f4){logger[_0xab49('0x12')](_0xab49('0x14'),_0x26a98a,_0x79f764[_0xab49('0x12')][_0xab49('0x15')]);return _0x15f259(_0x79f764[_0xab49('0x12')][_0xab49('0x15')]);}logger[_0xab49('0x12')](_0xab49('0x14'),_0x26a98a,_0x79f764[_0xab49('0x12')][_0xab49('0x15')]);return _0x4d4d00(_0x79f764['error'][_0xab49('0x15')]);}else{logger[_0xab49('0xd')](_0xab49('0x14'),_0x26a98a,_0xab49('0x10'));_0x4d4d00(_0x79f764[_0xab49('0x16')]['message']);}})[_0xab49('0x17')](function(_0x2cbcff){logger[_0xab49('0x12')](_0xab49('0x14'),_0x26a98a,_0x2cbcff);_0x15f259(_0x2cbcff);});});}exports[_0xab49('0x18')]=function(_0x47f977){var _0x167a2a=this;return new Promise(function(_0x24cb8f,_0x28449b){return db['CmHopperHistory']['create'](_0x47f977[_0xab49('0x19')],{'raw':_0x47f977[_0xab49('0x1a')]?_0x47f977['options'][_0xab49('0x1b')]===undefined?!![]:![]:!![]})[_0xab49('0xc')](function(_0x49b716){logger[_0xab49('0xd')]('CreateCmHopperHistory',_0x47f977);logger[_0xab49('0xe')](_0xab49('0x18'),_0x47f977,JSON['stringify'](_0x49b716));_0x24cb8f(_0x49b716);})['catch'](function(_0x333506){logger['error'](_0xab49('0x18'),_0x333506['message'],_0x47f977);_0x28449b(_0x167a2a[_0xab49('0x12')](0x1f4,_0x333506[_0xab49('0x15')]));});});};exports[_0xab49('0x1c')]=function(_0x579039){var _0x2bf8e0=this;return new Promise(function(_0x49c047,_0x322153){return db[_0xab49('0x1d')]['findAll']({'raw':_0x579039[_0xab49('0x1a')]?_0x579039[_0xab49('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x579039['options']?_0x579039[_0xab49('0x1a')][_0xab49('0x1e')]||null:null,'attributes':[[db[_0xab49('0x1f')]['fn']('COUNT',db[_0xab49('0x1f')][_0xab49('0x20')]('id')),'predictiveIntervalTotalCalls'],[db[_0xab49('0x1f')]['fn'](_0xab49('0x21'),db[_0xab49('0x1f')]['fn']('IF',db['sequelize'][_0xab49('0x22')]('`state`\x20=\x204,\x201,\x20null'))),_0xab49('0x23')],[db['sequelize']['fn'](_0xab49('0x21'),db['sequelize']['fn']('IF',db[_0xab49('0x1f')][_0xab49('0x22')](_0xab49('0x24')))),_0xab49('0x25')],[db['sequelize']['fn'](_0xab49('0x21'),db[_0xab49('0x1f')]['fn']('IF',db[_0xab49('0x1f')]['literal'](_0xab49('0x26')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0xab49('0x1f')]['fn']('AVG',db['sequelize']['fn']('IF',db['sequelize'][_0xab49('0x22')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xab49('0x27')],[db[_0xab49('0x1f')]['fn'](_0xab49('0x28'),db['sequelize']['fn']('IF',db[_0xab49('0x1f')][_0xab49('0x22')](_0xab49('0x29')))),_0xab49('0x2a')]]})[_0xab49('0xc')](function(_0x56b768){logger[_0xab49('0xd')](_0xab49('0x1c'),_0x579039);logger['debug']('AvgHandleTime',_0x579039,JSON[_0xab49('0x11')](_0x56b768));_0x49c047(_0x56b768);})[_0xab49('0x17')](function(_0x30ee5e){logger[_0xab49('0x12')](_0xab49('0x1c'),_0x30ee5e[_0xab49('0x15')],_0x579039);_0x322153(_0x2bf8e0[_0xab49('0x12')](0x1f4,_0x30ee5e[_0xab49('0x15')]));});});};exports[_0xab49('0x2b')]=function(_0x43027f){var _0x2b3ea5=this;return new Promise(function(_0x3769ce,_0x2599ac){return db['CmHopperHistory'][_0xab49('0x2c')]({'raw':_0x43027f[_0xab49('0x1a')]?_0x43027f[_0xab49('0x1a')][_0xab49('0x1b')]===undefined?!![]:![]:!![],'where':_0x43027f[_0xab49('0x1a')]?_0x43027f['options'][_0xab49('0x1e')]||null:null,'attributes':[['campaign','name'],[db[_0xab49('0x1f')]['fn'](_0xab49('0x21'),db[_0xab49('0x1f')]['fn']('IF',db[_0xab49('0x1f')][_0xab49('0x22')]('`state`\x20=\x200,\x201,\x20null'))),_0xab49('0x2d')],[db[_0xab49('0x1f')]['fn'](_0xab49('0x21'),db[_0xab49('0x1f')]['fn']('IF',db[_0xab49('0x1f')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0xab49('0x2e')],[db[_0xab49('0x1f')]['fn'](_0xab49('0x21'),db['sequelize']['fn']('IF',db[_0xab49('0x1f')]['literal']('`state`\x20=\x204,\x201,\x20null'))),'outboundAnswerCallsDay'],[db['sequelize']['fn'](_0xab49('0x21'),db[_0xab49('0x1f')]['fn']('IF',db[_0xab49('0x1f')][_0xab49('0x22')](_0xab49('0x2f')))),_0xab49('0x30')],[db[_0xab49('0x1f')]['fn'](_0xab49('0x21'),db[_0xab49('0x1f')]['fn']('IF',db[_0xab49('0x1f')]['literal'](_0xab49('0x31')))),_0xab49('0x32')],[db['sequelize']['fn'](_0xab49('0x21'),db[_0xab49('0x1f')]['fn']('IF',db[_0xab49('0x1f')][_0xab49('0x22')](_0xab49('0x33')))),_0xab49('0x34')],[db[_0xab49('0x1f')]['fn'](_0xab49('0x21'),db['sequelize']['fn']('IF',db[_0xab49('0x1f')][_0xab49('0x22')](_0xab49('0x35')))),'outboundDropCallsDayCallersExit'],[db[_0xab49('0x1f')]['fn'](_0xab49('0x21'),db[_0xab49('0x1f')]['fn']('IF',db[_0xab49('0x1f')][_0xab49('0x22')](_0xab49('0x36')))),'outboundUnknownCallsDay'],[db[_0xab49('0x1f')]['fn'](_0xab49('0x21'),db[_0xab49('0x1f')]['fn']('IF',db[_0xab49('0x1f')][_0xab49('0x22')](_0xab49('0x37')))),'outboundBlacklistCallsDay'],[db[_0xab49('0x1f')]['fn'](_0xab49('0x21'),db[_0xab49('0x1f')]['fn']('IF',db[_0xab49('0x1f')][_0xab49('0x22')](_0xab49('0x38')))),_0xab49('0x39')],[db[_0xab49('0x1f')]['fn'](_0xab49('0x21'),db[_0xab49('0x1f')]['fn']('IF',db[_0xab49('0x1f')][_0xab49('0x22')]('`state`\x20=\x2018,\x201,\x20null'))),_0xab49('0x3a')],[db[_0xab49('0x1f')]['fn'](_0xab49('0x21'),db[_0xab49('0x1f')]['fn']('IF',db[_0xab49('0x1f')][_0xab49('0x22')](_0xab49('0x3b')))),'outboundAnswerAgiCallsDay'],[db[_0xab49('0x1f')]['fn']('COUNT',db[_0xab49('0x1f')]['fn']('IF',db['sequelize'][_0xab49('0x22')](_0xab49('0x3c')))),'outboundRejectCallsDay'],[db[_0xab49('0x1f')]['fn'](_0xab49('0x21'),db[_0xab49('0x1f')]['fn']('IF',db[_0xab49('0x1f')][_0xab49('0x22')](_0xab49('0x3d')))),_0xab49('0x3e')]],'group':[_0xab49('0x3f')]})[_0xab49('0xc')](function(_0x24c03c){logger[_0xab49('0xd')](_0xab49('0x2b'),_0x43027f);logger[_0xab49('0xe')](_0xab49('0x2b'),_0x43027f,JSON[_0xab49('0x11')](_0x24c03c));_0x3769ce(_0x24c03c);})[_0xab49('0x17')](function(_0x487e52){logger['error'](_0xab49('0x2b'),_0x487e52[_0xab49('0x15')],_0x43027f);_0x2599ac(_0x2b3ea5[_0xab49('0x12')](0x1f4,_0x487e52[_0xab49('0x15')]));});});};exports[_0xab49('0x40')]=function(_0x55c6f7){var _0x4dde74=this;return new Promise(function(_0x2e5745,_0x35896a){return db[_0xab49('0x1d')][_0xab49('0x2c')]({'raw':_0x55c6f7[_0xab49('0x1a')]?_0x55c6f7['options'][_0xab49('0x1b')]===undefined?!![]:![]:!![],'where':_0x55c6f7[_0xab49('0x1a')]?_0x55c6f7[_0xab49('0x1a')][_0xab49('0x1e')]||null:null,'attributes':[['campaign','name'],[db[_0xab49('0x1f')]['fn']('COUNT',db[_0xab49('0x1f')][_0xab49('0x20')]('id')),_0xab49('0x41')],[db[_0xab49('0x1f')]['fn'](_0xab49('0x21'),db[_0xab49('0x1f')]['fn']('IF',db[_0xab49('0x1f')][_0xab49('0x22')]('`state`\x20=\x204,\x201,\x20null'))),_0xab49('0x42')]],'group':[_0xab49('0x3f')]})[_0xab49('0xc')](function(_0x7b5ce8){logger[_0xab49('0xd')]('GetCampaignHopperHistory',_0x55c6f7);logger[_0xab49('0xe')](_0xab49('0x40'),_0x55c6f7,JSON[_0xab49('0x11')](_0x7b5ce8));_0x2e5745(_0x7b5ce8);})[_0xab49('0x17')](function(_0x32cdf2){logger[_0xab49('0x12')](_0xab49('0x40'),_0x32cdf2[_0xab49('0x15')],_0x55c6f7);_0x35896a(_0x4dde74[_0xab49('0x12')](0x1f4,_0x32cdf2[_0xab49('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 64325f3..c10ab75 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 _0xd54f=['fs-extra','../../components/interaction/service','./cmHopperHistory.controller','get','isAuthenticated','index','describe','/:id','show','create','put','update','exports','util','connect-timeout','express','Router'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xd54f,0xd9));var _0xfd54=function(_0x91ff52,_0x2cde3c){_0x91ff52=_0x91ff52-0x0;var _0x37d193=_0xd54f[_0x91ff52];return _0x37d193;};'use strict';var multer=require('multer');var util=require(_0xfd54('0x0'));var path=require('path');var timeout=require(_0xfd54('0x1'));var express=require(_0xfd54('0x2'));var router=express[_0xfd54('0x3')]();var fs_extra=require(_0xfd54('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfd54('0x5'));var config=require('../../config/environment');var controller=require(_0xfd54('0x6'));router[_0xfd54('0x7')]('/',auth[_0xfd54('0x8')](),controller[_0xfd54('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xfd54('0xa')]);router[_0xfd54('0x7')](_0xfd54('0xb'),auth['isAuthenticated'](),controller[_0xfd54('0xc')]);router['post']('/',auth[_0xfd54('0x8')](),controller[_0xfd54('0xd')]);router[_0xfd54('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xfd54('0xf')]);module[_0xfd54('0x10')]=router; \ No newline at end of file +var _0x9e1a=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','exports','multer'];(function(_0x41c99a,_0x12414d){var _0x303bf9=function(_0x219646){while(--_0x219646){_0x41c99a['push'](_0x41c99a['shift']());}};_0x303bf9(++_0x12414d);}(_0x9e1a,0x149));var _0xa9e1=function(_0x2577ba,_0x291c45){_0x2577ba=_0x2577ba-0x0;var _0x128549=_0x9e1a[_0x2577ba];return _0x128549;};'use strict';var multer=require(_0xa9e1('0x0'));var util=require(_0xa9e1('0x1'));var path=require(_0xa9e1('0x2'));var timeout=require(_0xa9e1('0x3'));var express=require(_0xa9e1('0x4'));var router=express['Router']();var fs_extra=require(_0xa9e1('0x5'));var auth=require(_0xa9e1('0x6'));var interaction=require(_0xa9e1('0x7'));var config=require(_0xa9e1('0x8'));var controller=require(_0xa9e1('0x9'));router[_0xa9e1('0xa')]('/',auth['isAuthenticated'](),controller[_0xa9e1('0xb')]);router['get'](_0xa9e1('0xc'),auth[_0xa9e1('0xd')](),controller[_0xa9e1('0xe')]);router['get'](_0xa9e1('0xf'),auth[_0xa9e1('0xd')](),controller[_0xa9e1('0x10')]);router[_0xa9e1('0x11')]('/',auth[_0xa9e1('0xd')](),controller[_0xa9e1('0x12')]);router[_0xa9e1('0x13')](_0xa9e1('0xf'),auth[_0xa9e1('0xd')](),controller[_0xa9e1('0x14')]);module[_0xa9e1('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index c288e2c..b585a40 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 _0xd737=['STRING','sequelize'];(function(_0x4d6459,_0x1370f6){var _0x2d26ab=function(_0x4f13e0){while(--_0x4f13e0){_0x4d6459['push'](_0x4d6459['shift']());}};_0x2d26ab(++_0x1370f6);}(_0xd737,0x85));var _0x7d73=function(_0x1ae31c,_0x8dcd2d){_0x1ae31c=_0x1ae31c-0x0;var _0x19519d=_0xd737[_0x1ae31c];return _0x19519d;};'use strict';var Sequelize=require(_0x7d73('0x0'));module['exports']={'name':{'type':Sequelize[_0x7d73('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7d73('0x1')]},'dialPrefix':{'type':Sequelize[_0x7d73('0x1')]}}; \ No newline at end of file +var _0xb7cf=['STRING','name','sequelize','exports'];(function(_0x1165b7,_0x115fa1){var _0x661c48=function(_0x100111){while(--_0x100111){_0x1165b7['push'](_0x1165b7['shift']());}};_0x661c48(++_0x115fa1);}(_0xb7cf,0xca));var _0xfb7c=function(_0x2201e1,_0x50ba88){_0x2201e1=_0x2201e1-0x0;var _0x5a063f=_0xb7cf[_0x2201e1];return _0x5a063f;};'use strict';var Sequelize=require(_0xfb7c('0x0'));module[_0xfb7c('0x1')]={'name':{'type':Sequelize[_0xfb7c('0x2')],'unique':_0xfb7c('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xfb7c('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 0199811..481d3f3 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 _0x5278=['type','key','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','getDispositions','findOne','Disposition','keys','include','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','format','cf_%d','raw','getContactsCsv','isEmpty','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','sequelize','transaction','CmCustomField','addCustomFields','TEXT','text','Sequelize','BOOLEAN','queryInterface','getCustomFields','findAndCountAll','addAgents','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','Lists','UserProfileResource','error','stack','name','send','index','map','CmList','rawAttributes','fieldName'];(function(_0x45c833,_0x51f713){var _0x3327a4=function(_0x2cdd37){while(--_0x2cdd37){_0x45c833['push'](_0x45c833['shift']());}};_0x3327a4(++_0x51f713);}(_0x5278,0x173));var _0x8527=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x5278[_0x45bf86];return _0x1f02b7;};'use strict';var emlformat=require(_0x8527('0x0'));var rimraf=require(_0x8527('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8527('0x2'));var BPromise=require(_0x8527('0x3'));var Mustache=require(_0x8527('0x4'));var util=require(_0x8527('0x5'));var path=require(_0x8527('0x6'));var sox=require(_0x8527('0x7'));var csv=require(_0x8527('0x8'));var ejs=require(_0x8527('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8527('0xa'));var squel=require('squel');var crypto=require(_0x8527('0xb'));var jsforce=require(_0x8527('0xc'));var deskjs=require(_0x8527('0xd'));var toCsv=require(_0x8527('0x8'));var querystring=require('querystring');var Papa=require(_0x8527('0xe'));var Redis=require(_0x8527('0xf'));var authService=require(_0x8527('0x10'));var qs=require(_0x8527('0x11'));var as=require(_0x8527('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8527('0x13'))('api');var utils=require(_0x8527('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8527('0x15'));var db=require(_0x8527('0x16'))['db'];config['redis']=_['defaults'](config[_0x8527('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8527('0x18'))[_0x8527('0x19')](socket);function respondWithStatusCode(_0x538fb8,_0x270846){_0x270846=_0x270846||0xcc;return function(_0x492df8){if(_0x492df8){return _0x538fb8[_0x8527('0x1a')](_0x270846);}return _0x538fb8[_0x8527('0x1b')](_0x270846)[_0x8527('0x1c')]();};}function respondWithResult(_0xb16887,_0x30a82d){_0x30a82d=_0x30a82d||0xc8;return function(_0x4252c5){if(_0x4252c5){return _0xb16887[_0x8527('0x1b')](_0x30a82d)[_0x8527('0x1d')](_0x4252c5);}};}function respondWithFilteredResult(_0x4dede3,_0x3b65b3){return function(_0x18eb10){if(_0x18eb10){var _0x3b3bc9=typeof _0x3b65b3[_0x8527('0x1e')]===_0x8527('0x1f')&&typeof _0x3b65b3[_0x8527('0x20')]===_0x8527('0x1f');var _0x2a1092=_0x18eb10['count'];var _0x4c0701=_0x3b3bc9?0x0:_0x3b65b3['offset'];var _0x3cd95f=_0x3b3bc9?_0x18eb10[_0x8527('0x21')]:_0x3b65b3[_0x8527('0x1e')]+_0x3b65b3[_0x8527('0x20')];var _0x544b4f;if(_0x3cd95f>=_0x2a1092){_0x3cd95f=_0x2a1092;_0x544b4f=0xc8;}else{_0x544b4f=0xce;}_0x4dede3[_0x8527('0x1b')](_0x544b4f);return _0x4dede3[_0x8527('0x22')](_0x8527('0x23'),_0x4c0701+'-'+_0x3cd95f+'/'+_0x2a1092)[_0x8527('0x1d')](_0x18eb10);}return null;};}function patchUpdates(_0x57280b){return function(_0x49b2de){try{jsonpatch[_0x8527('0x24')](_0x49b2de,_0x57280b,!![]);}catch(_0x15ec42){return BPromise[_0x8527('0x25')](_0x15ec42);}return _0x49b2de['save']();};}function saveUpdates(_0x5488e6,_0x6a7b60){return function(_0x21a185){if(_0x21a185){return _0x21a185[_0x8527('0x26')](_0x5488e6)[_0x8527('0x27')](function(_0x2b2f24){return _0x2b2f24;});}return null;};}function removeEntity(_0x2a311a,_0x4c5090){return function(_0x1b7e9a){if(_0x1b7e9a){return _0x1b7e9a[_0x8527('0x28')]()[_0x8527('0x27')](function(){var _0x28bb08=_0x1b7e9a['get']({'plain':!![]});var _0x1431c2=_0x8527('0x29');return db[_0x8527('0x2a')]['destroy']({'where':{'type':_0x1431c2,'resourceId':_0x28bb08['id']}})[_0x8527('0x27')](function(){return _0x1b7e9a;});})[_0x8527('0x27')](function(){_0x2a311a[_0x8527('0x1b')](0xcc)[_0x8527('0x1c')]();});}};}function handleEntityNotFound(_0x3feecb,_0xfd924e){return function(_0x4d50a3){if(!_0x4d50a3){_0x3feecb[_0x8527('0x1a')](0x194);}return _0x4d50a3;};}function handleError(_0x57689a,_0x53bfbe){_0x53bfbe=_0x53bfbe||0x1f4;return function(_0x1fbe57){logger[_0x8527('0x2b')](_0x1fbe57[_0x8527('0x2c')]);if(_0x1fbe57[_0x8527('0x2d')]){delete _0x1fbe57[_0x8527('0x2d')];}_0x57689a[_0x8527('0x1b')](_0x53bfbe)[_0x8527('0x2e')](_0x1fbe57);};}exports[_0x8527('0x2f')]=function(_0x36b4bb,_0x253968){var _0x5e5aea={},_0x47e9e9={},_0x58ec4e={'count':0x0,'rows':[]};var _0xfe5410=_[_0x8527('0x30')](db[_0x8527('0x31')][_0x8527('0x32')],function(_0x5deee1){return{'name':_0x5deee1[_0x8527('0x33')],'type':_0x5deee1[_0x8527('0x34')][_0x8527('0x35')]};});_0x47e9e9[_0x8527('0x36')]=_[_0x8527('0x30')](_0xfe5410,'name');_0x47e9e9['query']=_['keys'](_0x36b4bb[_0x8527('0x37')]);_0x47e9e9[_0x8527('0x38')]=_[_0x8527('0x39')](_0x47e9e9[_0x8527('0x36')],_0x47e9e9[_0x8527('0x37')]);_0x5e5aea['attributes']=_[_0x8527('0x39')](_0x47e9e9['model'],qs[_0x8527('0x3a')](_0x36b4bb[_0x8527('0x37')][_0x8527('0x3a')]));_0x5e5aea['attributes']=_0x5e5aea['attributes'][_0x8527('0x3b')]?_0x5e5aea[_0x8527('0x3c')]:_0x47e9e9[_0x8527('0x36')];if(!_0x36b4bb[_0x8527('0x37')][_0x8527('0x3d')](_0x8527('0x3e'))){_0x5e5aea[_0x8527('0x20')]=qs[_0x8527('0x20')](_0x36b4bb[_0x8527('0x37')][_0x8527('0x20')]);_0x5e5aea[_0x8527('0x1e')]=qs[_0x8527('0x1e')](_0x36b4bb['query'][_0x8527('0x1e')]);}_0x5e5aea[_0x8527('0x3f')]=qs[_0x8527('0x40')](_0x36b4bb['query'][_0x8527('0x40')]);_0x5e5aea[_0x8527('0x41')]=qs[_0x8527('0x38')](_[_0x8527('0x42')](_0x36b4bb[_0x8527('0x37')],_0x47e9e9[_0x8527('0x38')]),_0xfe5410);if(_0x36b4bb[_0x8527('0x37')][_0x8527('0x43')]){_0x5e5aea[_0x8527('0x41')]=_[_0x8527('0x44')](_0x5e5aea[_0x8527('0x41')],{'$or':_[_0x8527('0x30')](_0xfe5410,function(_0x1318ae){if(_0x1318ae[_0x8527('0x34')]!==_0x8527('0x45')){var _0x4d0d78={};_0x4d0d78[_0x1318ae[_0x8527('0x2d')]]={'$like':'%'+_0x36b4bb[_0x8527('0x37')][_0x8527('0x43')]+'%'};return _0x4d0d78;}})});}_0x5e5aea=_[_0x8527('0x44')]({},_0x5e5aea,_0x36b4bb[_0x8527('0x46')]);var _0x3619ae={'where':_0x5e5aea['where']};return db[_0x8527('0x31')][_0x8527('0x21')](_0x3619ae)[_0x8527('0x27')](function(_0xc9b07a){_0x58ec4e['count']=_0xc9b07a;if(_0x36b4bb[_0x8527('0x37')][_0x8527('0x47')]){_0x5e5aea['include']=[{'all':!![]}];}return db[_0x8527('0x31')][_0x8527('0x48')](_0x5e5aea);})[_0x8527('0x27')](function(_0xc13278){_0x58ec4e['rows']=_0xc13278;return _0x58ec4e;})[_0x8527('0x27')](respondWithFilteredResult(_0x253968,_0x5e5aea))['catch'](handleError(_0x253968,null));};exports[_0x8527('0x49')]=function(_0x3a3cb4,_0x44617f){var _0x3327b9={'raw':![],'where':{'id':_0x3a3cb4[_0x8527('0x4a')]['id']}},_0x39b19d={};_0x39b19d[_0x8527('0x36')]=_['keys'](db[_0x8527('0x31')][_0x8527('0x32')]);_0x39b19d[_0x8527('0x37')]=_['keys'](_0x3a3cb4[_0x8527('0x37')]);_0x39b19d['filters']=_[_0x8527('0x39')](_0x39b19d['model'],_0x39b19d[_0x8527('0x37')]);_0x3327b9['attributes']=_[_0x8527('0x39')](_0x39b19d[_0x8527('0x36')],qs[_0x8527('0x3a')](_0x3a3cb4[_0x8527('0x37')][_0x8527('0x3a')]));_0x3327b9['attributes']=_0x3327b9[_0x8527('0x3c')][_0x8527('0x3b')]?_0x3327b9['attributes']:_0x39b19d[_0x8527('0x36')];if(_0x3a3cb4[_0x8527('0x37')][_0x8527('0x47')]){_0x3327b9['include']=[{'all':!![]}];}_0x3327b9=_[_0x8527('0x44')]({},_0x3327b9,_0x3a3cb4['options']);return db['CmList'][_0x8527('0x4b')](_0x3327b9)['then'](handleEntityNotFound(_0x44617f,null))[_0x8527('0x27')](respondWithResult(_0x44617f,null))[_0x8527('0x4c')](handleError(_0x44617f,null));};exports[_0x8527('0x4d')]=function(_0x459be4,_0x4f3478){return db['CmList']['create'](_0x459be4[_0x8527('0x4e')],{})[_0x8527('0x27')](function(_0x9e1298){var _0x53c5db=_0x459be4[_0x8527('0x4f')]['get']({'plain':!![]});if(!_0x53c5db)throw new Error(_0x8527('0x50'));if(_0x53c5db[_0x8527('0x51')]===_0x8527('0x4f')){var _0x38a599=_0x9e1298[_0x8527('0x52')]({'plain':!![]});var _0x253da5=_0x8527('0x29');return db[_0x8527('0x53')]['find']({'where':{'name':_0x253da5,'userProfileId':_0x53c5db[_0x8527('0x54')]},'raw':!![]})[_0x8527('0x27')](function(_0x5b88c4){if(_0x5b88c4&&_0x5b88c4[_0x8527('0x55')]===0x0){return db[_0x8527('0x2a')][_0x8527('0x4d')]({'name':_0x38a599[_0x8527('0x2d')],'resourceId':_0x38a599['id'],'type':_0x5b88c4['name'],'sectionId':_0x5b88c4['id']},{})[_0x8527('0x27')](function(){return _0x9e1298;});}else{return _0x9e1298;}})[_0x8527('0x4c')](function(_0x5eea22){logger[_0x8527('0x2b')](_0x8527('0x56'),_0x5eea22);throw _0x5eea22;});}return _0x9e1298;})[_0x8527('0x27')](respondWithResult(_0x4f3478,0xc9))[_0x8527('0x4c')](handleError(_0x4f3478,null));};exports[_0x8527('0x26')]=function(_0x1c914a,_0x228da1){if(_0x1c914a[_0x8527('0x4e')]['id']){delete _0x1c914a['body']['id'];}return db[_0x8527('0x31')]['find']({'where':{'id':_0x1c914a[_0x8527('0x4a')]['id']}})[_0x8527('0x27')](handleEntityNotFound(_0x228da1,null))[_0x8527('0x27')](saveUpdates(_0x1c914a[_0x8527('0x4e')],null))['then'](respondWithResult(_0x228da1,null))[_0x8527('0x4c')](handleError(_0x228da1,null));};exports[_0x8527('0x28')]=function(_0x1de675,_0x14f2af){return db[_0x8527('0x31')][_0x8527('0x4b')]({'where':{'id':_0x1de675[_0x8527('0x4a')]['id']}})['then'](handleEntityNotFound(_0x14f2af,null))[_0x8527('0x27')](removeEntity(_0x14f2af,null))['catch'](handleError(_0x14f2af,null));};exports[_0x8527('0x57')]=function(_0x4faf22,_0x482ad4){return db['CmList']['describe']()[_0x8527('0x27')](respondWithResult(_0x482ad4,null))[_0x8527('0x4c')](handleError(_0x482ad4,null));};exports[_0x8527('0x58')]=function(_0x5f3619,_0x18acc1,_0x481610){if(_0x5f3619[_0x8527('0x4e')]['id']){delete _0x5f3619[_0x8527('0x4e')]['id'];}return db['CmList'][_0x8527('0x4b')]({'where':{'id':_0x5f3619['params']['id']}})[_0x8527('0x27')](handleEntityNotFound(_0x18acc1,null))[_0x8527('0x27')](function(_0xe735d3){if(_0xe735d3){_0x5f3619[_0x8527('0x4e')][_0x8527('0x59')]=_0xe735d3['id'];return db['Disposition'][_0x8527('0x4d')](_0x5f3619[_0x8527('0x4e')]);}})[_0x8527('0x27')](respondWithResult(_0x18acc1,null))[_0x8527('0x4c')](handleError(_0x18acc1,null));};exports[_0x8527('0x5a')]=function(_0xdb3522,_0x3269a2,_0x404e7a){var _0x535b6d={'raw':![],'where':{}};var _0x52c52c={};var _0x368b0c={'count':0x0,'rows':[]};return db[_0x8527('0x31')][_0x8527('0x5b')]({'where':{'id':_0xdb3522[_0x8527('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3269a2,null))['then'](function(_0x22f679){if(_0x22f679){_0x52c52c[_0x8527('0x36')]=_['keys'](db[_0x8527('0x5c')][_0x8527('0x32')]);_0x52c52c[_0x8527('0x37')]=_[_0x8527('0x5d')](_0xdb3522[_0x8527('0x37')]);_0x52c52c[_0x8527('0x38')]=_[_0x8527('0x39')](_0x52c52c[_0x8527('0x36')],_0x52c52c[_0x8527('0x37')]);_0x535b6d['attributes']=_['intersection'](_0x52c52c[_0x8527('0x36')],qs[_0x8527('0x3a')](_0xdb3522['query'][_0x8527('0x3a')]));_0x535b6d[_0x8527('0x3c')]=_0x535b6d['attributes'][_0x8527('0x3b')]?_0x535b6d['attributes']:_0x52c52c['model'];if(!_0xdb3522[_0x8527('0x37')][_0x8527('0x3d')](_0x8527('0x3e'))){_0x535b6d[_0x8527('0x20')]=qs[_0x8527('0x20')](_0xdb3522['query'][_0x8527('0x20')]);_0x535b6d[_0x8527('0x1e')]=qs[_0x8527('0x1e')](_0xdb3522['query'][_0x8527('0x1e')]);}_0x535b6d['order']=qs[_0x8527('0x40')](_0xdb3522[_0x8527('0x37')][_0x8527('0x40')]);_0x535b6d['where']=qs[_0x8527('0x38')](_['pick'](_0xdb3522[_0x8527('0x37')],_0x52c52c[_0x8527('0x38')]));_0x535b6d[_0x8527('0x41')][_0x8527('0x59')]=_0x22f679['id'];if(_0xdb3522[_0x8527('0x37')][_0x8527('0x43')]){_0x535b6d[_0x8527('0x41')]=_[_0x8527('0x44')](_0x535b6d[_0x8527('0x41')],{'$or':_[_0x8527('0x30')](_0x535b6d[_0x8527('0x3c')],function(_0x4f5565){var _0x354b70={};_0x354b70[_0x4f5565]={'$like':'%'+_0xdb3522[_0x8527('0x37')]['filter']+'%'};return _0x354b70;})});}_0x535b6d=_[_0x8527('0x44')]({},_0x535b6d,_0xdb3522[_0x8527('0x46')]);return db['Disposition'][_0x8527('0x21')]({'where':_0x535b6d[_0x8527('0x41')]})[_0x8527('0x27')](function(_0x442689){_0x368b0c[_0x8527('0x21')]=_0x442689;if(_0xdb3522[_0x8527('0x37')][_0x8527('0x47')]){_0x535b6d[_0x8527('0x5e')]=[{'all':!![]}];}return db[_0x8527('0x5c')][_0x8527('0x48')](_0x535b6d);})[_0x8527('0x27')](function(_0x4d9e1a){_0x368b0c['rows']=_0x4d9e1a;return _0x368b0c;});}})['then'](respondWithFilteredResult(_0x3269a2,_0x535b6d))['catch'](handleError(_0x3269a2,null));};exports[_0x8527('0x5f')]=function(_0x3d5fe5,_0x1a26db,_0xc68035){return db[_0x8527('0x31')][_0x8527('0x4b')]({'where':{'id':_0x3d5fe5[_0x8527('0x4a')]['id']}})[_0x8527('0x27')](handleEntityNotFound(_0x1a26db,null))['then'](function(_0x11ebd4){if(_0x11ebd4){return _0x11ebd4[_0x8527('0x5f')](_0x3d5fe5[_0x8527('0x37')][_0x8527('0x60')]);}})[_0x8527('0x27')](respondWithStatusCode(_0x1a26db,null))[_0x8527('0x4c')](handleError(_0x1a26db,null));};exports[_0x8527('0x61')]=function(_0x71cf93,_0x594cf7,_0xb00df9){return db['CmList'][_0x8527('0x4b')]({'where':{'id':_0x71cf93[_0x8527('0x4a')]['id']}})[_0x8527('0x27')](handleEntityNotFound(_0x594cf7,null))['then'](function(_0x233c44){if(_0x233c44){var _0x317b25=[];var _0x2f5acc={'success':[],'errors':[]};return db[_0x8527('0x62')][_0x8527('0x57')]()[_0x8527('0x27')](function(_0x385bc6){if(_0x71cf93['body'][_0x8527('0x63')]&&_[_0x8527('0x64')](_0x71cf93['body']['tags'])){if(_0x71cf93[_0x8527('0x4e')][_0x8527('0x63')]['length']){_0x71cf93[_0x8527('0x4e')][_0x8527('0x63')]=_0x71cf93[_0x8527('0x4e')][_0x8527('0x63')][_0x8527('0x65')](';')+';';}else{_0x71cf93[_0x8527('0x4e')][_0x8527('0x63')]=null;}}else{_0x71cf93[_0x8527('0x4e')][_0x8527('0x63')]=null;}if(_0x71cf93[_0x8527('0x4e')]&&_['isArray'](_0x71cf93['body'])){for(var _0x79a747=0x0;_0x79a747<_0x71cf93['body']['length'];_0x79a747+=0x1){_0x71cf93[_0x8527('0x4e')][_0x79a747][_0x8527('0x59')]=_0x71cf93['params']['id'];_0x317b25[_0x8527('0x66')](_0x71cf93[_0x8527('0x4e')][_0x79a747]);}return BPromise['each'](_0x317b25,function(_0x3dfdf7){return db[_0x8527('0x62')][_0x8527('0x4d')](_[_0x8527('0x67')](_0x3dfdf7,['ids','id'])||{},{'fields':_['keys'](_0x385bc6),'raw':!![]})[_0x8527('0x27')](function(_0x2f3304){_0x2f5acc[_0x8527('0x68')]['push'](_0x2f3304[_0x8527('0x69')]);})[_0x8527('0x4c')](function(_0x198759){_0x2f5acc[_0x8527('0x6a')][_0x8527('0x66')]({'data':_0x3dfdf7,'error':_0x198759[_0x8527('0x6b')]});});})['then'](function(_0x4a93d5){return _0x2f5acc;})[_0x8527('0x4c')](function(_0x18ab3a){return _0x18ab3a;});}else{_0x594cf7[_0x8527('0x1b')](0x190)[_0x8527('0x1d')]({'message':_0x8527('0x6c')});}});}})['then'](respondWithResult(_0x594cf7,null))[_0x8527('0x4c')](handleError(_0x594cf7,null));};exports[_0x8527('0x6d')]=function(_0x575b53,_0x374779,_0x17837b){var _0x4be493;return db[_0x8527('0x31')]['find']({'where':{'id':_0x575b53[_0x8527('0x4a')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x8527('0x6e')}]})[_0x8527('0x27')](handleEntityNotFound(_0x374779,null))['then'](function(_0x6bc8fe){if(_0x6bc8fe){_0x4be493=_0x6bc8fe;return db[_0x8527('0x62')][_0x8527('0x32')];}})[_0x8527('0x27')](function(_0x51731f){if(_0x51731f){var _0x46a6cf={};var _0x30141c={};_0x30141c['model']=_[_0x8527('0x6f')](_[_0x8527('0x5d')](_0x51731f),_['map'](_0x4be493[_0x8527('0x6e')],function(_0x28cdb5){return util[_0x8527('0x70')](_0x8527('0x71'),_0x28cdb5['id']);}));_0x30141c[_0x8527('0x37')]=_[_0x8527('0x5d')](_0x575b53[_0x8527('0x37')]);_0x30141c[_0x8527('0x38')]=_[_0x8527('0x39')](_0x30141c[_0x8527('0x36')],_0x30141c[_0x8527('0x37')]);_0x46a6cf['attributes']=_['intersection'](_0x30141c[_0x8527('0x36')],qs[_0x8527('0x3a')](_0x575b53[_0x8527('0x37')][_0x8527('0x3a')]));_0x46a6cf[_0x8527('0x3c')]=_0x46a6cf[_0x8527('0x3c')][_0x8527('0x3b')]?_0x46a6cf[_0x8527('0x3c')]:_0x30141c['model'];if(!_0x575b53['query'][_0x8527('0x3d')](_0x8527('0x3e'))){_0x46a6cf['limit']=qs['limit'](_0x575b53[_0x8527('0x37')][_0x8527('0x20')]);_0x46a6cf['offset']=qs['offset'](_0x575b53[_0x8527('0x37')][_0x8527('0x1e')]);}_0x46a6cf[_0x8527('0x3f')]=qs[_0x8527('0x40')](_0x575b53[_0x8527('0x37')]['sort']);_0x46a6cf[_0x8527('0x41')]=qs[_0x8527('0x38')](_[_0x8527('0x42')](_0x575b53[_0x8527('0x37')],_0x30141c[_0x8527('0x38')]));_0x46a6cf[_0x8527('0x72')]=!![];if(_0x575b53[_0x8527('0x37')][_0x8527('0x43')]){_0x46a6cf[_0x8527('0x41')]=_[_0x8527('0x44')](_0x46a6cf['where'],{'$or':_['map'](_0x46a6cf['attributes'],function(_0x5360aa){var _0x47b13e={};_0x47b13e[_0x5360aa]={'$like':'%'+_0x575b53[_0x8527('0x37')][_0x8527('0x43')]+'%'};return _0x47b13e;})});}_0x46a6cf=_['merge']({},_0x46a6cf,_0x575b53[_0x8527('0x46')]);return _0x4be493[_0x8527('0x6d')](_0x46a6cf);}})[_0x8527('0x27')](respondWithResult(_0x374779,null))[_0x8527('0x4c')](handleError(_0x374779,null));};exports[_0x8527('0x73')]=function(_0x532f45,_0xd65b45,_0x29fff9){var _0x2bee0a;return db[_0x8527('0x31')][_0x8527('0x4b')]({'where':{'id':_0x532f45['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0x8527('0x6e')}]})[_0x8527('0x27')](handleEntityNotFound(_0xd65b45,null))[_0x8527('0x27')](function(_0x342a9f){if(_0x342a9f){_0x2bee0a=_0x342a9f;return db[_0x8527('0x62')][_0x8527('0x32')];}})[_0x8527('0x27')](function(_0x229a97){if(_0x229a97){var _0x5b20b6={};var _0xb20720={};_0xb20720[_0x8527('0x36')]=_['concat'](_['keys'](_0x229a97),_['map'](_0x2bee0a[_0x8527('0x6e')],function(_0x31d884){return util[_0x8527('0x70')]('cf_%d',_0x31d884['id']);}));_0xb20720[_0x8527('0x37')]=_[_0x8527('0x5d')](_0x532f45['query']);_0xb20720['filters']=_[_0x8527('0x39')](_0xb20720[_0x8527('0x36')],_0xb20720['query']);_0x5b20b6[_0x8527('0x3c')]=_['intersection'](_0xb20720[_0x8527('0x36')],qs[_0x8527('0x3a')](_0x532f45['query']['fields']));_0x5b20b6[_0x8527('0x3c')]=_0x5b20b6[_0x8527('0x3c')][_0x8527('0x3b')]?_0x5b20b6[_0x8527('0x3c')]:_0xb20720[_0x8527('0x36')];if(!_0x532f45[_0x8527('0x37')][_0x8527('0x3d')]('nolimit')){_0x5b20b6[_0x8527('0x20')]=qs[_0x8527('0x20')](_0x532f45['query']['limit']);_0x5b20b6[_0x8527('0x1e')]=qs['offset'](_0x532f45[_0x8527('0x37')][_0x8527('0x1e')]);}_0x5b20b6[_0x8527('0x3f')]=qs[_0x8527('0x40')](_0x532f45[_0x8527('0x37')][_0x8527('0x40')]);_0x5b20b6[_0x8527('0x41')]=qs[_0x8527('0x38')](_[_0x8527('0x42')](_0x532f45['query'],_0xb20720[_0x8527('0x38')]));_0x5b20b6[_0x8527('0x72')]=!![];if(_0x532f45[_0x8527('0x37')][_0x8527('0x43')]){_0x5b20b6[_0x8527('0x41')]=_[_0x8527('0x44')](_0x5b20b6[_0x8527('0x41')],{'$or':_['map'](_0x5b20b6[_0x8527('0x3c')],function(_0x30e246){var _0xe55ab9={};_0xe55ab9[_0x30e246]={'$like':'%'+_0x532f45[_0x8527('0x37')][_0x8527('0x43')]+'%'};return _0xe55ab9;})});}_0x5b20b6=_[_0x8527('0x44')]({},_0x5b20b6,_0x532f45[_0x8527('0x46')]);return _0x2bee0a[_0x8527('0x6d')](_0x5b20b6);}})[_0x8527('0x27')](function(_0x41dae8){if(!_[_0x8527('0x74')](_0x41dae8)){var _0x40c6b1=toCsv(_0x41dae8);var _0x271d93=Date['now']();fs['writeFileSync'](util[_0x8527('0x70')]('/tmp/list_%d_%s.csv',_0x2bee0a['id'],_0x271d93),_0x40c6b1);_0xd65b45[_0x8527('0x75')]('Content-disposition',_0x8527('0x76')+util[_0x8527('0x70')](_0x8527('0x77'),_0x2bee0a['id'],_0x271d93));_0xd65b45[_0x8527('0x75')](_0x8527('0x78'),_0x8527('0x79'));return _0xd65b45['download'](util['format']('/tmp/list_%d_%s.csv',_0x2bee0a['id'],_0x271d93));}else{return _0xd65b45[_0x8527('0x1a')](0xcc);}})['catch'](handleError(_0xd65b45,null));};exports['addCustomField']=function(_0x257421,_0xc9aa1b,_0x27ad82){var _0x24534c;delete _0x257421[_0x8527('0x4e')]['id'];return db[_0x8527('0x31')][_0x8527('0x5b')]({'where':{'id':_0x257421[_0x8527('0x4a')]['id']}})[_0x8527('0x27')](handleEntityNotFound(_0xc9aa1b,null))[_0x8527('0x27')](function(_0x3202ad){if(_0x3202ad){return db[_0x8527('0x7a')][_0x8527('0x7b')](function(_0x31d429){return db[_0x8527('0x7c')]['create'](_0x257421['body'],{'transaction':_0x31d429})['then'](function(_0x471680){_0x24534c=_0x471680;return _0x3202ad[_0x8527('0x7d')](_0x471680,{'transaction':_0x31d429});})[_0x8527('0x27')](function(){var _0x1cca41={'type':db['Sequelize'][_0x8527('0x7e')],'transaction':_0x31d429};switch(_0x257421[_0x8527('0x4e')]['type']){case _0x8527('0x7f'):_0x1cca41[_0x8527('0x34')]=db[_0x8527('0x80')][_0x8527('0x7e')];break;case'number':_0x1cca41[_0x8527('0x34')]=db[_0x8527('0x80')]['INTEGER'];break;case'switch':_0x1cca41[_0x8527('0x34')]=db[_0x8527('0x80')][_0x8527('0x81')];_0x1cca41['defaultValue']=![];break;default:}return db[_0x8527('0x7a')][_0x8527('0x82')]['addColumn']('cm_contacts',util[_0x8527('0x70')]('cf_%s',_0x24534c['id']),_0x1cca41);})['then'](function(){return _0x24534c;});});}})[_0x8527('0x27')](respondWithResult(_0xc9aa1b,null))[_0x8527('0x4c')](handleError(_0xc9aa1b,null));};exports[_0x8527('0x83')]=function(_0xe1d1a9,_0x16b492,_0x419e71){var _0x2a90b1={};var _0x56a48f={};var _0x421ec6;var _0x166428;return db['CmList'][_0x8527('0x5b')]({'where':{'id':_0xe1d1a9[_0x8527('0x4a')]['id']}})[_0x8527('0x27')](handleEntityNotFound(_0x16b492,null))['then'](function(_0x5004e3){if(_0x5004e3){_0x421ec6=_0x5004e3;_0x56a48f[_0x8527('0x36')]=_[_0x8527('0x5d')](db[_0x8527('0x7c')][_0x8527('0x32')]);_0x56a48f['query']=_[_0x8527('0x5d')](_0xe1d1a9[_0x8527('0x37')]);_0x56a48f[_0x8527('0x38')]=_[_0x8527('0x39')](_0x56a48f[_0x8527('0x36')],_0x56a48f[_0x8527('0x37')]);_0x2a90b1[_0x8527('0x3c')]=_[_0x8527('0x39')](_0x56a48f[_0x8527('0x36')],qs[_0x8527('0x3a')](_0xe1d1a9[_0x8527('0x37')][_0x8527('0x3a')]));_0x2a90b1['attributes']=_0x2a90b1['attributes'][_0x8527('0x3b')]?_0x2a90b1[_0x8527('0x3c')]:_0x56a48f[_0x8527('0x36')];_0x2a90b1[_0x8527('0x3f')]=qs['sort'](_0xe1d1a9['query'][_0x8527('0x40')]);_0x2a90b1[_0x8527('0x41')]=qs[_0x8527('0x38')](_[_0x8527('0x42')](_0xe1d1a9['query'],_0x56a48f['filters']));_0x2a90b1[_0x8527('0x41')]=_[_0x8527('0x44')](_0x2a90b1['where'],{'$or':[{'ListId':_0x5004e3['id']},{'ListId':null}]});if(_0xe1d1a9[_0x8527('0x37')][_0x8527('0x43')]){_0x2a90b1['where']=_[_0x8527('0x44')](_0x2a90b1[_0x8527('0x41')],{'$or':_[_0x8527('0x30')](_0x2a90b1['attributes'],function(_0x3ca88f){var _0x183ab3={};_0x183ab3[_0x3ca88f]={'$like':'%'+_0xe1d1a9[_0x8527('0x37')]['filter']+'%'};return _0x183ab3;})});}_0x2a90b1=_[_0x8527('0x44')]({},_0x2a90b1,_0xe1d1a9[_0x8527('0x46')]);return db[_0x8527('0x7c')][_0x8527('0x84')](_0x2a90b1);}})[_0x8527('0x27')](respondWithResult(_0x16b492,null))[_0x8527('0x4c')](handleError(_0x16b492,null));};exports[_0x8527('0x85')]=function(_0x142d99,_0x2acfa4,_0x567c26){return db[_0x8527('0x31')]['find']({'where':{'id':_0x142d99[_0x8527('0x4a')]['id']}})[_0x8527('0x27')](handleEntityNotFound(_0x2acfa4,null))[_0x8527('0x27')](function(_0x289614){if(_0x289614){return _0x289614[_0x8527('0x85')](_0x142d99[_0x8527('0x4e')][_0x8527('0x60')],_['omit'](_0x142d99[_0x8527('0x4e')],[_0x8527('0x60'),'id'])||{})[_0x8527('0x86')](function(_0x3f64dc){for(var _0x243505=0x0;_0x243505<_0x142d99[_0x8527('0x4e')][_0x8527('0x60')][_0x8527('0x3b')];_0x243505+=0x1){socket['emit'](_0x8527('0x87'),{'UserId':Number(_0x142d99[_0x8527('0x4e')][_0x8527('0x60')][_0x243505]),'CmListId':Number(_0x142d99[_0x8527('0x4a')]['id'])});}return _0x3f64dc;});}})[_0x8527('0x27')](respondWithResult(_0x2acfa4,null))[_0x8527('0x4c')](handleError(_0x2acfa4,null));};exports[_0x8527('0x88')]=function(_0x29df02,_0x589bf0,_0x372924){return db[_0x8527('0x31')][_0x8527('0x4b')]({'where':{'id':_0x29df02[_0x8527('0x4a')]['id']}})[_0x8527('0x27')](handleEntityNotFound(_0x589bf0,null))[_0x8527('0x27')](function(_0x29dd0d){if(_0x29dd0d){return _0x29dd0d['removeAgents'](_0x29df02[_0x8527('0x37')]['ids'])[_0x8527('0x27')](function(){if(_[_0x8527('0x64')](_0x29df02['query'][_0x8527('0x60')])){for(var _0x41dd9a=0x0;_0x41dd9a<_0x29df02['query'][_0x8527('0x60')][_0x8527('0x3b')];_0x41dd9a+=0x1){socket[_0x8527('0x89')](_0x8527('0x8a'),{'UserId':Number(_0x29df02[_0x8527('0x37')][_0x8527('0x60')][_0x41dd9a]),'CmListId':Number(_0x29df02['params']['id'])});}}else{socket[_0x8527('0x89')](_0x8527('0x8a'),{'UserId':Number(_0x29df02[_0x8527('0x37')]['ids']),'CmListId':Number(_0x29df02['params']['id'])});}});}})[_0x8527('0x27')](respondWithStatusCode(_0x589bf0,null))[_0x8527('0x4c')](handleError(_0x589bf0,null));};exports[_0x8527('0x8b')]=function(_0x2a631b,_0x3d9730,_0x5ccd2b){var _0x4bd0f6={};var _0x33d81a={};var _0x58a85f;var _0x5c9838;return db['CmList'][_0x8527('0x5b')]({'where':{'id':_0x2a631b[_0x8527('0x4a')]['id']}})[_0x8527('0x27')](handleEntityNotFound(_0x3d9730,null))[_0x8527('0x27')](function(_0x1a7094){if(_0x1a7094){_0x58a85f=_0x1a7094;_0x33d81a['model']=_[_0x8527('0x5d')](db[_0x8527('0x8c')]['rawAttributes']);_0x33d81a[_0x8527('0x37')]=_[_0x8527('0x5d')](_0x2a631b[_0x8527('0x37')]);_0x33d81a[_0x8527('0x38')]=_['intersection'](_0x33d81a[_0x8527('0x36')],_0x33d81a[_0x8527('0x37')]);_0x4bd0f6[_0x8527('0x3c')]=_[_0x8527('0x39')](_0x33d81a[_0x8527('0x36')],qs[_0x8527('0x3a')](_0x2a631b['query'][_0x8527('0x3a')]));_0x4bd0f6['attributes']=_0x4bd0f6[_0x8527('0x3c')][_0x8527('0x3b')]?_0x4bd0f6[_0x8527('0x3c')]:_0x33d81a['model'];_0x4bd0f6[_0x8527('0x3f')]=qs[_0x8527('0x40')](_0x2a631b[_0x8527('0x37')]['sort']);_0x4bd0f6[_0x8527('0x41')]=qs[_0x8527('0x38')](_[_0x8527('0x42')](_0x2a631b[_0x8527('0x37')],_0x33d81a[_0x8527('0x38')]));if(_0x2a631b[_0x8527('0x37')][_0x8527('0x43')]){_0x4bd0f6[_0x8527('0x41')]=_[_0x8527('0x44')](_0x4bd0f6[_0x8527('0x41')],{'$or':_[_0x8527('0x30')](_0x4bd0f6['attributes'],function(_0x42abd6){var _0x315d7d={};_0x315d7d[_0x42abd6]={'$like':'%'+_0x2a631b['query'][_0x8527('0x43')]+'%'};return _0x315d7d;})});}_0x4bd0f6=_['merge']({},_0x4bd0f6,_0x2a631b[_0x8527('0x46')]);return _0x58a85f[_0x8527('0x8b')](_0x4bd0f6);}})[_0x8527('0x27')](function(_0x3207ed){if(_0x3207ed){_0x5c9838=_0x3207ed[_0x8527('0x3b')];if(!_0x2a631b['query']['hasOwnProperty']('nolimit')){_0x4bd0f6[_0x8527('0x20')]=qs[_0x8527('0x20')](_0x2a631b[_0x8527('0x37')][_0x8527('0x20')]);_0x4bd0f6[_0x8527('0x1e')]=qs[_0x8527('0x1e')](_0x2a631b[_0x8527('0x37')][_0x8527('0x1e')]);}return _0x58a85f[_0x8527('0x8b')](_0x4bd0f6);}})[_0x8527('0x27')](function(_0x82f639){if(_0x82f639){return _0x82f639?{'count':_0x5c9838,'rows':_0x82f639}:null;}})['then'](respondWithResult(_0x3d9730,null))['catch'](handleError(_0x3d9730,null));}; \ No newline at end of file +var _0x9622=['getContactsCsv','concat','format','raw','isEmpty','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','addCustomField','findOne','sequelize','transaction','addCustomFields','Sequelize','text','number','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','userCmList:save','removeAgents','userCmList:remove','emit','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','filter','options','include','findAll','rows','catch','show','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ListId','Disposition','getDispositions','order','pick','removeDispositions','ids','addContacts','CmContact','isArray','tags','push','each','omit','success','dataValues','errors','message','getContacts','CmCustomField','CustomFields','cf_%d'];(function(_0x18b7b2,_0x5bfa38){var _0x4636bd=function(_0x2f7773){while(--_0x2f7773){_0x18b7b2['push'](_0x18b7b2['shift']());}};_0x4636bd(++_0x5bfa38);}(_0x9622,0x150));var _0x2962=function(_0x3a8567,_0x122ef9){_0x3a8567=_0x3a8567-0x0;var _0x302a4c=_0x9622[_0x3a8567];return _0x302a4c;};'use strict';var emlformat=require(_0x2962('0x0'));var rimraf=require(_0x2962('0x1'));var zipdir=require(_0x2962('0x2'));var jsonpatch=require(_0x2962('0x3'));var rp=require('request-promise');var moment=require(_0x2962('0x4'));var BPromise=require(_0x2962('0x5'));var Mustache=require(_0x2962('0x6'));var util=require('util');var path=require('path');var sox=require(_0x2962('0x7'));var csv=require('to-csv');var ejs=require(_0x2962('0x8'));var fs=require('fs');var fs_extra=require(_0x2962('0x9'));var _=require(_0x2962('0xa'));var squel=require(_0x2962('0xb'));var crypto=require(_0x2962('0xc'));var jsforce=require(_0x2962('0xd'));var deskjs=require(_0x2962('0xe'));var toCsv=require(_0x2962('0xf'));var querystring=require(_0x2962('0x10'));var Papa=require(_0x2962('0x11'));var Redis=require(_0x2962('0x12'));var authService=require(_0x2962('0x13'));var qs=require(_0x2962('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2962('0x15'));var logger=require(_0x2962('0x16'))(_0x2962('0x17'));var utils=require(_0x2962('0x18'));var config=require(_0x2962('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x2962('0x1a')]=_[_0x2962('0x1b')](config[_0x2962('0x1a')],{'host':_0x2962('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2962('0x1d'))[_0x2962('0x1e')](socket);function respondWithStatusCode(_0x14ce93,_0x2553cd){_0x2553cd=_0x2553cd||0xcc;return function(_0x271ee5){if(_0x271ee5){return _0x14ce93[_0x2962('0x1f')](_0x2553cd);}return _0x14ce93[_0x2962('0x20')](_0x2553cd)[_0x2962('0x21')]();};}function respondWithResult(_0xe2336e,_0x592129){_0x592129=_0x592129||0xc8;return function(_0x54b763){if(_0x54b763){return _0xe2336e[_0x2962('0x20')](_0x592129)[_0x2962('0x22')](_0x54b763);}};}function respondWithFilteredResult(_0x20457e,_0x315a06){return function(_0x14b255){if(_0x14b255){var _0x24ed6f=typeof _0x315a06[_0x2962('0x23')]===_0x2962('0x24')&&typeof _0x315a06['limit']==='undefined';var _0x4e2a6b=_0x14b255[_0x2962('0x25')];var _0x497ae1=_0x24ed6f?0x0:_0x315a06[_0x2962('0x23')];var _0x2d2c0a=_0x24ed6f?_0x14b255[_0x2962('0x25')]:_0x315a06[_0x2962('0x23')]+_0x315a06[_0x2962('0x26')];var _0xe51823;if(_0x2d2c0a>=_0x4e2a6b){_0x2d2c0a=_0x4e2a6b;_0xe51823=0xc8;}else{_0xe51823=0xce;}_0x20457e['status'](_0xe51823);return _0x20457e[_0x2962('0x27')](_0x2962('0x28'),_0x497ae1+'-'+_0x2d2c0a+'/'+_0x4e2a6b)[_0x2962('0x22')](_0x14b255);}return null;};}function patchUpdates(_0x5ed106){return function(_0xe3d801){try{jsonpatch[_0x2962('0x29')](_0xe3d801,_0x5ed106,!![]);}catch(_0x15dab3){return BPromise['reject'](_0x15dab3);}return _0xe3d801[_0x2962('0x2a')]();};}function saveUpdates(_0x34a8ce,_0x2fa0c2){return function(_0x3d7fe1){if(_0x3d7fe1){return _0x3d7fe1[_0x2962('0x2b')](_0x34a8ce)['then'](function(_0x5b471e){return _0x5b471e;});}return null;};}function removeEntity(_0xaa51ce,_0x24ebd8){return function(_0x5a7e59){if(_0x5a7e59){return _0x5a7e59['destroy']()[_0x2962('0x2c')](function(){var _0x5c35a6=_0x5a7e59[_0x2962('0x2d')]({'plain':!![]});var _0x2b1095='Lists';return db[_0x2962('0x2e')][_0x2962('0x2f')]({'where':{'type':_0x2b1095,'resourceId':_0x5c35a6['id']}})[_0x2962('0x2c')](function(){return _0x5a7e59;});})[_0x2962('0x2c')](function(){_0xaa51ce[_0x2962('0x20')](0xcc)[_0x2962('0x21')]();});}};}function handleEntityNotFound(_0x2db790,_0x20cb80){return function(_0x55ae25){if(!_0x55ae25){_0x2db790['sendStatus'](0x194);}return _0x55ae25;};}function handleError(_0x1aa1f7,_0x3e0887){_0x3e0887=_0x3e0887||0x1f4;return function(_0x2b2bd5){logger['error'](_0x2b2bd5[_0x2962('0x30')]);if(_0x2b2bd5[_0x2962('0x31')]){delete _0x2b2bd5[_0x2962('0x31')];}_0x1aa1f7['status'](_0x3e0887)[_0x2962('0x32')](_0x2b2bd5);};}exports[_0x2962('0x33')]=function(_0x1c4370,_0xab41a9){var _0x26edfb={},_0xb43020={},_0x33bb5a={'count':0x0,'rows':[]};var _0x23330e=_[_0x2962('0x34')](db[_0x2962('0x35')][_0x2962('0x36')],function(_0x466870){return{'name':_0x466870[_0x2962('0x37')],'type':_0x466870[_0x2962('0x38')]['key']};});_0xb43020[_0x2962('0x39')]=_[_0x2962('0x34')](_0x23330e,'name');_0xb43020['query']=_['keys'](_0x1c4370[_0x2962('0x3a')]);_0xb43020[_0x2962('0x3b')]=_[_0x2962('0x3c')](_0xb43020[_0x2962('0x39')],_0xb43020[_0x2962('0x3a')]);_0x26edfb[_0x2962('0x3d')]=_[_0x2962('0x3c')](_0xb43020['model'],qs[_0x2962('0x3e')](_0x1c4370[_0x2962('0x3a')]['fields']));_0x26edfb[_0x2962('0x3d')]=_0x26edfb['attributes'][_0x2962('0x3f')]?_0x26edfb[_0x2962('0x3d')]:_0xb43020[_0x2962('0x39')];if(!_0x1c4370[_0x2962('0x3a')][_0x2962('0x40')](_0x2962('0x41'))){_0x26edfb[_0x2962('0x26')]=qs[_0x2962('0x26')](_0x1c4370[_0x2962('0x3a')]['limit']);_0x26edfb[_0x2962('0x23')]=qs[_0x2962('0x23')](_0x1c4370[_0x2962('0x3a')]['offset']);}_0x26edfb['order']=qs[_0x2962('0x42')](_0x1c4370[_0x2962('0x3a')][_0x2962('0x42')]);_0x26edfb[_0x2962('0x43')]=qs['filters'](_['pick'](_0x1c4370['query'],_0xb43020['filters']),_0x23330e);if(_0x1c4370[_0x2962('0x3a')]['filter']){_0x26edfb[_0x2962('0x43')]=_[_0x2962('0x44')](_0x26edfb['where'],{'$or':_[_0x2962('0x34')](_0x23330e,function(_0xa5c14e){if(_0xa5c14e[_0x2962('0x38')]!=='VIRTUAL'){var _0x1874cf={};_0x1874cf[_0xa5c14e[_0x2962('0x31')]]={'$like':'%'+_0x1c4370[_0x2962('0x3a')][_0x2962('0x45')]+'%'};return _0x1874cf;}})});}_0x26edfb=_[_0x2962('0x44')]({},_0x26edfb,_0x1c4370[_0x2962('0x46')]);var _0x2ebb4a={'where':_0x26edfb[_0x2962('0x43')]};return db[_0x2962('0x35')]['count'](_0x2ebb4a)[_0x2962('0x2c')](function(_0x3c46d3){_0x33bb5a[_0x2962('0x25')]=_0x3c46d3;if(_0x1c4370[_0x2962('0x3a')]['includeAll']){_0x26edfb[_0x2962('0x47')]=[{'all':!![]}];}return db[_0x2962('0x35')][_0x2962('0x48')](_0x26edfb);})[_0x2962('0x2c')](function(_0x205bc0){_0x33bb5a[_0x2962('0x49')]=_0x205bc0;return _0x33bb5a;})['then'](respondWithFilteredResult(_0xab41a9,_0x26edfb))[_0x2962('0x4a')](handleError(_0xab41a9,null));};exports[_0x2962('0x4b')]=function(_0x56ec05,_0x44d5ca){var _0xd8c00e={'raw':![],'where':{'id':_0x56ec05['params']['id']}},_0x40b0b1={};_0x40b0b1['model']=_[_0x2962('0x4c')](db[_0x2962('0x35')][_0x2962('0x36')]);_0x40b0b1[_0x2962('0x3a')]=_[_0x2962('0x4c')](_0x56ec05[_0x2962('0x3a')]);_0x40b0b1[_0x2962('0x3b')]=_[_0x2962('0x3c')](_0x40b0b1['model'],_0x40b0b1['query']);_0xd8c00e[_0x2962('0x3d')]=_[_0x2962('0x3c')](_0x40b0b1[_0x2962('0x39')],qs['fields'](_0x56ec05['query'][_0x2962('0x3e')]));_0xd8c00e[_0x2962('0x3d')]=_0xd8c00e[_0x2962('0x3d')]['length']?_0xd8c00e[_0x2962('0x3d')]:_0x40b0b1[_0x2962('0x39')];if(_0x56ec05[_0x2962('0x3a')][_0x2962('0x4d')]){_0xd8c00e['include']=[{'all':!![]}];}_0xd8c00e=_[_0x2962('0x44')]({},_0xd8c00e,_0x56ec05[_0x2962('0x46')]);return db[_0x2962('0x35')][_0x2962('0x4e')](_0xd8c00e)['then'](handleEntityNotFound(_0x44d5ca,null))[_0x2962('0x2c')](respondWithResult(_0x44d5ca,null))['catch'](handleError(_0x44d5ca,null));};exports[_0x2962('0x4f')]=function(_0x57b288,_0xcb3709){return db[_0x2962('0x35')][_0x2962('0x4f')](_0x57b288[_0x2962('0x50')],{})['then'](function(_0x305b7d){var _0x5d5f8a=_0x57b288[_0x2962('0x51')][_0x2962('0x2d')]({'plain':!![]});if(!_0x5d5f8a)throw new Error(_0x2962('0x52'));if(_0x5d5f8a[_0x2962('0x53')]==='user'){var _0x193d3f=_0x305b7d['get']({'plain':!![]});var _0x1f4b5f=_0x2962('0x54');return db[_0x2962('0x55')][_0x2962('0x4e')]({'where':{'name':_0x1f4b5f,'userProfileId':_0x5d5f8a[_0x2962('0x56')]},'raw':!![]})['then'](function(_0x36f226){if(_0x36f226&&_0x36f226['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x193d3f[_0x2962('0x31')],'resourceId':_0x193d3f['id'],'type':_0x36f226[_0x2962('0x31')],'sectionId':_0x36f226['id']},{})[_0x2962('0x2c')](function(){return _0x305b7d;});}else{return _0x305b7d;}})[_0x2962('0x4a')](function(_0x976a6b){logger[_0x2962('0x57')](_0x2962('0x58'),_0x976a6b);throw _0x976a6b;});}return _0x305b7d;})[_0x2962('0x2c')](respondWithResult(_0xcb3709,0xc9))[_0x2962('0x4a')](handleError(_0xcb3709,null));};exports[_0x2962('0x2b')]=function(_0x295f78,_0x4fdcf3){if(_0x295f78[_0x2962('0x50')]['id']){delete _0x295f78['body']['id'];}return db[_0x2962('0x35')][_0x2962('0x4e')]({'where':{'id':_0x295f78['params']['id']}})[_0x2962('0x2c')](handleEntityNotFound(_0x4fdcf3,null))['then'](saveUpdates(_0x295f78[_0x2962('0x50')],null))[_0x2962('0x2c')](respondWithResult(_0x4fdcf3,null))[_0x2962('0x4a')](handleError(_0x4fdcf3,null));};exports['destroy']=function(_0x42c6fe,_0x37f1b3){return db[_0x2962('0x35')][_0x2962('0x4e')]({'where':{'id':_0x42c6fe[_0x2962('0x59')]['id']}})[_0x2962('0x2c')](handleEntityNotFound(_0x37f1b3,null))[_0x2962('0x2c')](removeEntity(_0x37f1b3,null))['catch'](handleError(_0x37f1b3,null));};exports['describe']=function(_0x204dc7,_0x273e14){return db[_0x2962('0x35')][_0x2962('0x5a')]()['then'](respondWithResult(_0x273e14,null))[_0x2962('0x4a')](handleError(_0x273e14,null));};exports[_0x2962('0x5b')]=function(_0x50f9f6,_0x5b2766,_0x39ff7b){if(_0x50f9f6[_0x2962('0x50')]['id']){delete _0x50f9f6[_0x2962('0x50')]['id'];}return db[_0x2962('0x35')][_0x2962('0x4e')]({'where':{'id':_0x50f9f6[_0x2962('0x59')]['id']}})['then'](handleEntityNotFound(_0x5b2766,null))['then'](function(_0x364365){if(_0x364365){_0x50f9f6['body'][_0x2962('0x5c')]=_0x364365['id'];return db[_0x2962('0x5d')][_0x2962('0x4f')](_0x50f9f6[_0x2962('0x50')]);}})[_0x2962('0x2c')](respondWithResult(_0x5b2766,null))[_0x2962('0x4a')](handleError(_0x5b2766,null));};exports[_0x2962('0x5e')]=function(_0x5e8448,_0x44d78a,_0x26d0fa){var _0x26c72d={'raw':![],'where':{}};var _0x323e74={};var _0x589ab7={'count':0x0,'rows':[]};return db[_0x2962('0x35')]['findOne']({'where':{'id':_0x5e8448['params']['id']}})[_0x2962('0x2c')](handleEntityNotFound(_0x44d78a,null))['then'](function(_0x4f4769){if(_0x4f4769){_0x323e74[_0x2962('0x39')]=_[_0x2962('0x4c')](db[_0x2962('0x5d')][_0x2962('0x36')]);_0x323e74[_0x2962('0x3a')]=_[_0x2962('0x4c')](_0x5e8448['query']);_0x323e74[_0x2962('0x3b')]=_['intersection'](_0x323e74[_0x2962('0x39')],_0x323e74[_0x2962('0x3a')]);_0x26c72d[_0x2962('0x3d')]=_['intersection'](_0x323e74[_0x2962('0x39')],qs[_0x2962('0x3e')](_0x5e8448[_0x2962('0x3a')][_0x2962('0x3e')]));_0x26c72d[_0x2962('0x3d')]=_0x26c72d[_0x2962('0x3d')][_0x2962('0x3f')]?_0x26c72d[_0x2962('0x3d')]:_0x323e74['model'];if(!_0x5e8448['query'][_0x2962('0x40')](_0x2962('0x41'))){_0x26c72d[_0x2962('0x26')]=qs['limit'](_0x5e8448['query'][_0x2962('0x26')]);_0x26c72d[_0x2962('0x23')]=qs[_0x2962('0x23')](_0x5e8448[_0x2962('0x3a')]['offset']);}_0x26c72d[_0x2962('0x5f')]=qs[_0x2962('0x42')](_0x5e8448[_0x2962('0x3a')][_0x2962('0x42')]);_0x26c72d[_0x2962('0x43')]=qs[_0x2962('0x3b')](_[_0x2962('0x60')](_0x5e8448[_0x2962('0x3a')],_0x323e74[_0x2962('0x3b')]));_0x26c72d['where'][_0x2962('0x5c')]=_0x4f4769['id'];if(_0x5e8448[_0x2962('0x3a')][_0x2962('0x45')]){_0x26c72d['where']=_[_0x2962('0x44')](_0x26c72d[_0x2962('0x43')],{'$or':_[_0x2962('0x34')](_0x26c72d[_0x2962('0x3d')],function(_0x400a42){var _0x1e5fa7={};_0x1e5fa7[_0x400a42]={'$like':'%'+_0x5e8448['query'][_0x2962('0x45')]+'%'};return _0x1e5fa7;})});}_0x26c72d=_['merge']({},_0x26c72d,_0x5e8448[_0x2962('0x46')]);return db[_0x2962('0x5d')]['count']({'where':_0x26c72d['where']})[_0x2962('0x2c')](function(_0x36f8c5){_0x589ab7[_0x2962('0x25')]=_0x36f8c5;if(_0x5e8448[_0x2962('0x3a')][_0x2962('0x4d')]){_0x26c72d['include']=[{'all':!![]}];}return db[_0x2962('0x5d')]['findAll'](_0x26c72d);})[_0x2962('0x2c')](function(_0x38020a){_0x589ab7[_0x2962('0x49')]=_0x38020a;return _0x589ab7;});}})[_0x2962('0x2c')](respondWithFilteredResult(_0x44d78a,_0x26c72d))['catch'](handleError(_0x44d78a,null));};exports[_0x2962('0x61')]=function(_0x4128f,_0x50553e,_0x538082){return db[_0x2962('0x35')][_0x2962('0x4e')]({'where':{'id':_0x4128f[_0x2962('0x59')]['id']}})['then'](handleEntityNotFound(_0x50553e,null))[_0x2962('0x2c')](function(_0x596f63){if(_0x596f63){return _0x596f63[_0x2962('0x61')](_0x4128f[_0x2962('0x3a')][_0x2962('0x62')]);}})[_0x2962('0x2c')](respondWithStatusCode(_0x50553e,null))[_0x2962('0x4a')](handleError(_0x50553e,null));};exports[_0x2962('0x63')]=function(_0x2ca01e,_0x1a102f,_0x1bf728){return db['CmList'][_0x2962('0x4e')]({'where':{'id':_0x2ca01e['params']['id']}})[_0x2962('0x2c')](handleEntityNotFound(_0x1a102f,null))[_0x2962('0x2c')](function(_0x3f7367){if(_0x3f7367){var _0xc12ce=[];var _0x1dec4f={'success':[],'errors':[]};return db[_0x2962('0x64')][_0x2962('0x5a')]()[_0x2962('0x2c')](function(_0x1c98f4){if(_0x2ca01e[_0x2962('0x50')]['tags']&&_[_0x2962('0x65')](_0x2ca01e['body'][_0x2962('0x66')])){if(_0x2ca01e[_0x2962('0x50')][_0x2962('0x66')][_0x2962('0x3f')]){_0x2ca01e[_0x2962('0x50')]['tags']=_0x2ca01e[_0x2962('0x50')][_0x2962('0x66')]['join'](';')+';';}else{_0x2ca01e[_0x2962('0x50')][_0x2962('0x66')]=null;}}else{_0x2ca01e[_0x2962('0x50')][_0x2962('0x66')]=null;}if(_0x2ca01e[_0x2962('0x50')]&&_[_0x2962('0x65')](_0x2ca01e[_0x2962('0x50')])){for(var _0x30dce9=0x0;_0x30dce9<_0x2ca01e[_0x2962('0x50')][_0x2962('0x3f')];_0x30dce9+=0x1){_0x2ca01e[_0x2962('0x50')][_0x30dce9][_0x2962('0x5c')]=_0x2ca01e[_0x2962('0x59')]['id'];_0xc12ce[_0x2962('0x67')](_0x2ca01e[_0x2962('0x50')][_0x30dce9]);}return BPromise[_0x2962('0x68')](_0xc12ce,function(_0x202d2b){return db['CmContact'][_0x2962('0x4f')](_[_0x2962('0x69')](_0x202d2b,[_0x2962('0x62'),'id'])||{},{'fields':_[_0x2962('0x4c')](_0x1c98f4),'raw':!![]})[_0x2962('0x2c')](function(_0x4812ed){_0x1dec4f[_0x2962('0x6a')][_0x2962('0x67')](_0x4812ed[_0x2962('0x6b')]);})[_0x2962('0x4a')](function(_0x561874){_0x1dec4f[_0x2962('0x6c')][_0x2962('0x67')]({'data':_0x202d2b,'error':_0x561874[_0x2962('0x6d')]});});})[_0x2962('0x2c')](function(_0x3a7350){return _0x1dec4f;})[_0x2962('0x4a')](function(_0x367546){return _0x367546;});}else{_0x1a102f[_0x2962('0x20')](0x190)[_0x2962('0x22')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x2962('0x2c')](respondWithResult(_0x1a102f,null))[_0x2962('0x4a')](handleError(_0x1a102f,null));};exports[_0x2962('0x6e')]=function(_0x365a01,_0x2cc542,_0x26c5b5){var _0x328ba9;return db['CmList'][_0x2962('0x4e')]({'where':{'id':_0x365a01['params']['id']},'include':[{'model':db[_0x2962('0x6f')],'as':_0x2962('0x70')}]})[_0x2962('0x2c')](handleEntityNotFound(_0x2cc542,null))[_0x2962('0x2c')](function(_0x5e3c5a){if(_0x5e3c5a){_0x328ba9=_0x5e3c5a;return db[_0x2962('0x64')][_0x2962('0x36')];}})['then'](function(_0xe37669){if(_0xe37669){var _0x46ce90={};var _0x2aec6e={};_0x2aec6e[_0x2962('0x39')]=_['concat'](_['keys'](_0xe37669),_['map'](_0x328ba9[_0x2962('0x70')],function(_0x4cb1ca){return util['format'](_0x2962('0x71'),_0x4cb1ca['id']);}));_0x2aec6e[_0x2962('0x3a')]=_[_0x2962('0x4c')](_0x365a01[_0x2962('0x3a')]);_0x2aec6e['filters']=_[_0x2962('0x3c')](_0x2aec6e['model'],_0x2aec6e[_0x2962('0x3a')]);_0x46ce90[_0x2962('0x3d')]=_[_0x2962('0x3c')](_0x2aec6e[_0x2962('0x39')],qs['fields'](_0x365a01[_0x2962('0x3a')][_0x2962('0x3e')]));_0x46ce90[_0x2962('0x3d')]=_0x46ce90[_0x2962('0x3d')][_0x2962('0x3f')]?_0x46ce90[_0x2962('0x3d')]:_0x2aec6e[_0x2962('0x39')];if(!_0x365a01[_0x2962('0x3a')][_0x2962('0x40')](_0x2962('0x41'))){_0x46ce90['limit']=qs['limit'](_0x365a01['query'][_0x2962('0x26')]);_0x46ce90[_0x2962('0x23')]=qs[_0x2962('0x23')](_0x365a01[_0x2962('0x3a')][_0x2962('0x23')]);}_0x46ce90[_0x2962('0x5f')]=qs[_0x2962('0x42')](_0x365a01[_0x2962('0x3a')][_0x2962('0x42')]);_0x46ce90[_0x2962('0x43')]=qs[_0x2962('0x3b')](_['pick'](_0x365a01['query'],_0x2aec6e[_0x2962('0x3b')]));_0x46ce90['raw']=!![];if(_0x365a01[_0x2962('0x3a')][_0x2962('0x45')]){_0x46ce90[_0x2962('0x43')]=_[_0x2962('0x44')](_0x46ce90[_0x2962('0x43')],{'$or':_[_0x2962('0x34')](_0x46ce90['attributes'],function(_0x1e4ca2){var _0x435365={};_0x435365[_0x1e4ca2]={'$like':'%'+_0x365a01['query'][_0x2962('0x45')]+'%'};return _0x435365;})});}_0x46ce90=_[_0x2962('0x44')]({},_0x46ce90,_0x365a01['options']);return _0x328ba9[_0x2962('0x6e')](_0x46ce90);}})[_0x2962('0x2c')](respondWithResult(_0x2cc542,null))['catch'](handleError(_0x2cc542,null));};exports[_0x2962('0x72')]=function(_0x183038,_0x3da4fc,_0x4116ed){var _0x47e2ca;return db[_0x2962('0x35')]['find']({'where':{'id':_0x183038[_0x2962('0x59')]['id']},'include':[{'model':db[_0x2962('0x6f')],'as':'CustomFields'}]})['then'](handleEntityNotFound(_0x3da4fc,null))['then'](function(_0x374f47){if(_0x374f47){_0x47e2ca=_0x374f47;return db[_0x2962('0x64')][_0x2962('0x36')];}})[_0x2962('0x2c')](function(_0x3140e9){if(_0x3140e9){var _0x3d38c3={};var _0x3f3fee={};_0x3f3fee['model']=_[_0x2962('0x73')](_['keys'](_0x3140e9),_[_0x2962('0x34')](_0x47e2ca[_0x2962('0x70')],function(_0x53bc5a){return util[_0x2962('0x74')](_0x2962('0x71'),_0x53bc5a['id']);}));_0x3f3fee[_0x2962('0x3a')]=_[_0x2962('0x4c')](_0x183038[_0x2962('0x3a')]);_0x3f3fee[_0x2962('0x3b')]=_[_0x2962('0x3c')](_0x3f3fee[_0x2962('0x39')],_0x3f3fee[_0x2962('0x3a')]);_0x3d38c3[_0x2962('0x3d')]=_[_0x2962('0x3c')](_0x3f3fee[_0x2962('0x39')],qs[_0x2962('0x3e')](_0x183038[_0x2962('0x3a')]['fields']));_0x3d38c3[_0x2962('0x3d')]=_0x3d38c3[_0x2962('0x3d')][_0x2962('0x3f')]?_0x3d38c3['attributes']:_0x3f3fee[_0x2962('0x39')];if(!_0x183038[_0x2962('0x3a')][_0x2962('0x40')](_0x2962('0x41'))){_0x3d38c3['limit']=qs[_0x2962('0x26')](_0x183038[_0x2962('0x3a')][_0x2962('0x26')]);_0x3d38c3[_0x2962('0x23')]=qs[_0x2962('0x23')](_0x183038[_0x2962('0x3a')]['offset']);}_0x3d38c3[_0x2962('0x5f')]=qs['sort'](_0x183038[_0x2962('0x3a')]['sort']);_0x3d38c3[_0x2962('0x43')]=qs[_0x2962('0x3b')](_[_0x2962('0x60')](_0x183038['query'],_0x3f3fee['filters']));_0x3d38c3[_0x2962('0x75')]=!![];if(_0x183038[_0x2962('0x3a')][_0x2962('0x45')]){_0x3d38c3[_0x2962('0x43')]=_[_0x2962('0x44')](_0x3d38c3[_0x2962('0x43')],{'$or':_[_0x2962('0x34')](_0x3d38c3['attributes'],function(_0x590824){var _0x4e473d={};_0x4e473d[_0x590824]={'$like':'%'+_0x183038['query'][_0x2962('0x45')]+'%'};return _0x4e473d;})});}_0x3d38c3=_[_0x2962('0x44')]({},_0x3d38c3,_0x183038[_0x2962('0x46')]);return _0x47e2ca[_0x2962('0x6e')](_0x3d38c3);}})['then'](function(_0x381cb5){if(!_[_0x2962('0x76')](_0x381cb5)){var _0x13afc5=toCsv(_0x381cb5);var _0x4da03b=Date['now']();fs[_0x2962('0x77')](util[_0x2962('0x74')]('/tmp/list_%d_%s.csv',_0x47e2ca['id'],_0x4da03b),_0x13afc5);_0x3da4fc[_0x2962('0x78')](_0x2962('0x79'),_0x2962('0x7a')+util['format'](_0x2962('0x7b'),_0x47e2ca['id'],_0x4da03b));_0x3da4fc[_0x2962('0x78')](_0x2962('0x7c'),_0x2962('0x7d'));return _0x3da4fc['download'](util[_0x2962('0x74')]('/tmp/list_%d_%s.csv',_0x47e2ca['id'],_0x4da03b));}else{return _0x3da4fc[_0x2962('0x1f')](0xcc);}})['catch'](handleError(_0x3da4fc,null));};exports[_0x2962('0x7e')]=function(_0x347fdb,_0xdba8fc,_0x4ad76c){var _0x219c22;delete _0x347fdb['body']['id'];return db[_0x2962('0x35')][_0x2962('0x7f')]({'where':{'id':_0x347fdb[_0x2962('0x59')]['id']}})[_0x2962('0x2c')](handleEntityNotFound(_0xdba8fc,null))['then'](function(_0x5b4f5b){if(_0x5b4f5b){return db[_0x2962('0x80')][_0x2962('0x81')](function(_0x1f320e){return db[_0x2962('0x6f')][_0x2962('0x4f')](_0x347fdb[_0x2962('0x50')],{'transaction':_0x1f320e})[_0x2962('0x2c')](function(_0x2882a9){_0x219c22=_0x2882a9;return _0x5b4f5b[_0x2962('0x82')](_0x2882a9,{'transaction':_0x1f320e});})[_0x2962('0x2c')](function(){var _0x443969={'type':db[_0x2962('0x83')]['TEXT'],'transaction':_0x1f320e};switch(_0x347fdb[_0x2962('0x50')][_0x2962('0x38')]){case _0x2962('0x84'):_0x443969[_0x2962('0x38')]=db[_0x2962('0x83')]['TEXT'];break;case _0x2962('0x85'):_0x443969['type']=db['Sequelize']['INTEGER'];break;case'switch':_0x443969['type']=db[_0x2962('0x83')][_0x2962('0x86')];_0x443969[_0x2962('0x87')]=![];break;default:}return db['sequelize'][_0x2962('0x88')][_0x2962('0x89')](_0x2962('0x8a'),util[_0x2962('0x74')](_0x2962('0x8b'),_0x219c22['id']),_0x443969);})[_0x2962('0x2c')](function(){return _0x219c22;});});}})[_0x2962('0x2c')](respondWithResult(_0xdba8fc,null))[_0x2962('0x4a')](handleError(_0xdba8fc,null));};exports[_0x2962('0x8c')]=function(_0x914f80,_0x2d6916,_0x9cf9e5){var _0x50cb74={};var _0x3ec86e={};var _0x36e2d4;var _0x4ef81c;return db['CmList']['findOne']({'where':{'id':_0x914f80[_0x2962('0x59')]['id']}})[_0x2962('0x2c')](handleEntityNotFound(_0x2d6916,null))[_0x2962('0x2c')](function(_0x272d7d){if(_0x272d7d){_0x36e2d4=_0x272d7d;_0x3ec86e[_0x2962('0x39')]=_[_0x2962('0x4c')](db[_0x2962('0x6f')]['rawAttributes']);_0x3ec86e[_0x2962('0x3a')]=_[_0x2962('0x4c')](_0x914f80[_0x2962('0x3a')]);_0x3ec86e[_0x2962('0x3b')]=_['intersection'](_0x3ec86e[_0x2962('0x39')],_0x3ec86e[_0x2962('0x3a')]);_0x50cb74[_0x2962('0x3d')]=_[_0x2962('0x3c')](_0x3ec86e[_0x2962('0x39')],qs[_0x2962('0x3e')](_0x914f80['query'][_0x2962('0x3e')]));_0x50cb74[_0x2962('0x3d')]=_0x50cb74[_0x2962('0x3d')]['length']?_0x50cb74[_0x2962('0x3d')]:_0x3ec86e[_0x2962('0x39')];_0x50cb74[_0x2962('0x5f')]=qs[_0x2962('0x42')](_0x914f80[_0x2962('0x3a')]['sort']);_0x50cb74[_0x2962('0x43')]=qs['filters'](_[_0x2962('0x60')](_0x914f80[_0x2962('0x3a')],_0x3ec86e['filters']));_0x50cb74['where']=_['merge'](_0x50cb74[_0x2962('0x43')],{'$or':[{'ListId':_0x272d7d['id']},{'ListId':null}]});if(_0x914f80['query'][_0x2962('0x45')]){_0x50cb74[_0x2962('0x43')]=_[_0x2962('0x44')](_0x50cb74[_0x2962('0x43')],{'$or':_[_0x2962('0x34')](_0x50cb74[_0x2962('0x3d')],function(_0x451448){var _0x2abd28={};_0x2abd28[_0x451448]={'$like':'%'+_0x914f80['query']['filter']+'%'};return _0x2abd28;})});}_0x50cb74=_[_0x2962('0x44')]({},_0x50cb74,_0x914f80[_0x2962('0x46')]);return db[_0x2962('0x6f')][_0x2962('0x8d')](_0x50cb74);}})['then'](respondWithResult(_0x2d6916,null))['catch'](handleError(_0x2d6916,null));};exports['addAgents']=function(_0x11384b,_0x29760c,_0x434b0a){return db['CmList'][_0x2962('0x4e')]({'where':{'id':_0x11384b['params']['id']}})[_0x2962('0x2c')](handleEntityNotFound(_0x29760c,null))['then'](function(_0x192cd0){if(_0x192cd0){return _0x192cd0[_0x2962('0x8e')](_0x11384b[_0x2962('0x50')][_0x2962('0x62')],_['omit'](_0x11384b[_0x2962('0x50')],['ids','id'])||{})[_0x2962('0x8f')](function(_0x73e827){for(var _0x660285=0x0;_0x660285<_0x11384b[_0x2962('0x50')]['ids'][_0x2962('0x3f')];_0x660285+=0x1){socket['emit'](_0x2962('0x90'),{'UserId':Number(_0x11384b[_0x2962('0x50')][_0x2962('0x62')][_0x660285]),'CmListId':Number(_0x11384b[_0x2962('0x59')]['id'])});}return _0x73e827;});}})[_0x2962('0x2c')](respondWithResult(_0x29760c,null))[_0x2962('0x4a')](handleError(_0x29760c,null));};exports['removeAgents']=function(_0x274130,_0x1d4c2f,_0x1cba02){return db[_0x2962('0x35')][_0x2962('0x4e')]({'where':{'id':_0x274130[_0x2962('0x59')]['id']}})['then'](handleEntityNotFound(_0x1d4c2f,null))[_0x2962('0x2c')](function(_0x37bfbc){if(_0x37bfbc){return _0x37bfbc[_0x2962('0x91')](_0x274130[_0x2962('0x3a')]['ids'])['then'](function(){if(_[_0x2962('0x65')](_0x274130[_0x2962('0x3a')][_0x2962('0x62')])){for(var _0x3708d1=0x0;_0x3708d1<_0x274130['query'][_0x2962('0x62')][_0x2962('0x3f')];_0x3708d1+=0x1){socket['emit'](_0x2962('0x92'),{'UserId':Number(_0x274130[_0x2962('0x3a')][_0x2962('0x62')][_0x3708d1]),'CmListId':Number(_0x274130[_0x2962('0x59')]['id'])});}}else{socket[_0x2962('0x93')](_0x2962('0x92'),{'UserId':Number(_0x274130[_0x2962('0x3a')]['ids']),'CmListId':Number(_0x274130[_0x2962('0x59')]['id'])});}});}})[_0x2962('0x2c')](respondWithStatusCode(_0x1d4c2f,null))[_0x2962('0x4a')](handleError(_0x1d4c2f,null));};exports[_0x2962('0x94')]=function(_0x4bd3cc,_0xaf968,_0x4bb44b){var _0x17cf4e={};var _0x4f3f95={};var _0x295220;var _0x37a711;return db['CmList']['findOne']({'where':{'id':_0x4bd3cc[_0x2962('0x59')]['id']}})[_0x2962('0x2c')](handleEntityNotFound(_0xaf968,null))[_0x2962('0x2c')](function(_0x3a7312){if(_0x3a7312){_0x295220=_0x3a7312;_0x4f3f95['model']=_['keys'](db[_0x2962('0x95')][_0x2962('0x36')]);_0x4f3f95[_0x2962('0x3a')]=_[_0x2962('0x4c')](_0x4bd3cc[_0x2962('0x3a')]);_0x4f3f95['filters']=_[_0x2962('0x3c')](_0x4f3f95[_0x2962('0x39')],_0x4f3f95[_0x2962('0x3a')]);_0x17cf4e[_0x2962('0x3d')]=_[_0x2962('0x3c')](_0x4f3f95[_0x2962('0x39')],qs['fields'](_0x4bd3cc[_0x2962('0x3a')][_0x2962('0x3e')]));_0x17cf4e[_0x2962('0x3d')]=_0x17cf4e[_0x2962('0x3d')][_0x2962('0x3f')]?_0x17cf4e[_0x2962('0x3d')]:_0x4f3f95['model'];_0x17cf4e[_0x2962('0x5f')]=qs[_0x2962('0x42')](_0x4bd3cc['query'][_0x2962('0x42')]);_0x17cf4e[_0x2962('0x43')]=qs['filters'](_[_0x2962('0x60')](_0x4bd3cc[_0x2962('0x3a')],_0x4f3f95[_0x2962('0x3b')]));if(_0x4bd3cc['query'][_0x2962('0x45')]){_0x17cf4e['where']=_[_0x2962('0x44')](_0x17cf4e['where'],{'$or':_['map'](_0x17cf4e['attributes'],function(_0x2015d7){var _0x40f553={};_0x40f553[_0x2015d7]={'$like':'%'+_0x4bd3cc[_0x2962('0x3a')][_0x2962('0x45')]+'%'};return _0x40f553;})});}_0x17cf4e=_[_0x2962('0x44')]({},_0x17cf4e,_0x4bd3cc[_0x2962('0x46')]);return _0x295220['getAgents'](_0x17cf4e);}})[_0x2962('0x2c')](function(_0x4f31f1){if(_0x4f31f1){_0x37a711=_0x4f31f1['length'];if(!_0x4bd3cc[_0x2962('0x3a')]['hasOwnProperty'](_0x2962('0x41'))){_0x17cf4e['limit']=qs[_0x2962('0x26')](_0x4bd3cc[_0x2962('0x3a')]['limit']);_0x17cf4e[_0x2962('0x23')]=qs[_0x2962('0x23')](_0x4bd3cc[_0x2962('0x3a')][_0x2962('0x23')]);}return _0x295220[_0x2962('0x94')](_0x17cf4e);}})['then'](function(_0x2c3be3){if(_0x2c3be3){return _0x2c3be3?{'count':_0x37a711,'rows':_0x2c3be3}:null;}})[_0x2962('0x2c')](respondWithResult(_0xaf968,null))[_0x2962('0x4a')](handleError(_0xaf968,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index e54f23a..00b12b0 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 _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5fc3,0xa8));var _0x35fc=function(_0xcf4569,_0x1ce755){_0xcf4569=_0xcf4569-0x0;var _0x7fef=_0x5fc3[_0xcf4569];return _0x7fef;};'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 +var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x25510b,_0x46fc92){var _0x5a07e9=function(_0x25860d){while(--_0x25860d){_0x25510b['push'](_0x25510b['shift']());}};_0x5a07e9(++_0x46fc92);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index ce2cae3..ef2b154 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 _0xf109=['CmList','cm_lists','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define'];(function(_0x414ff9,_0x5d92eb){var _0x57da17=function(_0x437ed8){while(--_0x437ed8){_0x414ff9['push'](_0x414ff9['shift']());}};_0x57da17(++_0x5d92eb);}(_0xf109,0xce));var _0x9f10=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xf109[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var logger=require(_0x9f10('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f10('0x3'));var fs=require('fs');var path=require(_0x9f10('0x4'));var rimraf=require(_0x9f10('0x5'));var config=require(_0x9f10('0x6'));var attributes=require(_0x9f10('0x7'));module[_0x9f10('0x8')]=function(_0x408fe8,_0xd3137b){return _0x408fe8[_0x9f10('0x9')](_0x9f10('0xa'),attributes,{'tableName':_0x9f10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash','util','../../config/logger','moment','bluebird'];(function(_0x11a286,_0x23849b){var _0x3484b3=function(_0x3edabe){while(--_0x3edabe){_0x11a286['push'](_0x11a286['shift']());}};_0x3484b3(++_0x23849b);}(_0xe706,0xa3));var _0x6e70=function(_0x1b79f5,_0x1cf93a){_0x1b79f5=_0x1b79f5-0x0;var _0x26a6f1=_0xe706[_0x1b79f5];return _0x26a6f1;};'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':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index d28396d..2179a3e 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 _0x4c48=['then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./cmList.socket','register'];(function(_0x4da626,_0x543a44){var _0x3061e5=function(_0x5df300){while(--_0x5df300){_0x4da626['push'](_0x4da626['shift']());}};_0x3061e5(++_0x543a44);}(_0x4c48,0x80));var _0x84c4=function(_0x424501,_0x42096d){_0x424501=_0x424501-0x0;var _0xb719af=_0x4c48[_0x424501];return _0xb719af;};'use strict';var _=require(_0x84c4('0x0'));var util=require(_0x84c4('0x1'));var moment=require(_0x84c4('0x2'));var BPromise=require(_0x84c4('0x3'));var rs=require(_0x84c4('0x4'));var fs=require('fs');var Redis=require(_0x84c4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x84c4('0x6'));var logger=require(_0x84c4('0x7'))('rpc');var config=require(_0x84c4('0x8'));var jayson=require(_0x84c4('0x9'));var client=jayson[_0x84c4('0xa')][_0x84c4('0xb')]({'port':0x232a});config['redis']=_[_0x84c4('0xc')](config[_0x84c4('0xd')],{'host':_0x84c4('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x84c4('0xd')]));require(_0x84c4('0xf'))[_0x84c4('0x10')](socket);function respondWithRpcPromise(_0x5dd4ad,_0x8b1197,_0x26cc08){return new BPromise(function(_0x208908,_0x50d803){return client['request'](_0x5dd4ad,_0x26cc08)[_0x84c4('0x11')](function(_0x384b13){logger[_0x84c4('0x12')](_0x84c4('0x13'),_0x8b1197,_0x84c4('0x14'));logger[_0x84c4('0x15')](_0x84c4('0x16'),_0x8b1197,'request\x20sent',JSON[_0x84c4('0x17')](_0x384b13));if(_0x384b13[_0x84c4('0x18')]){if(_0x384b13[_0x84c4('0x18')][_0x84c4('0x19')]===0x1f4){logger[_0x84c4('0x18')](_0x84c4('0x13'),_0x8b1197,_0x384b13[_0x84c4('0x18')][_0x84c4('0x1a')]);return _0x50d803(_0x384b13['error'][_0x84c4('0x1a')]);}logger[_0x84c4('0x18')](_0x84c4('0x13'),_0x8b1197,_0x384b13[_0x84c4('0x18')][_0x84c4('0x1a')]);return _0x208908(_0x384b13[_0x84c4('0x18')][_0x84c4('0x1a')]);}else{logger['info'](_0x84c4('0x13'),_0x8b1197,_0x84c4('0x14'));_0x208908(_0x384b13[_0x84c4('0x1b')][_0x84c4('0x1a')]);}})[_0x84c4('0x1c')](function(_0x47c23d){logger[_0x84c4('0x18')](_0x84c4('0x13'),_0x8b1197,_0x47c23d);_0x50d803(_0x47c23d);});});} \ No newline at end of file +var _0xc750=['moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util'];(function(_0x4d1865,_0x31c446){var _0xc38fd5=function(_0x17be29){while(--_0x17be29){_0x4d1865['push'](_0x4d1865['shift']());}};_0xc38fd5(++_0x31c446);}(_0xc750,0x194));var _0x0c75=function(_0x20314f,_0x3c4493){_0x20314f=_0x20314f-0x0;var _0xa4b2b5=_0xc750[_0x20314f];return _0xa4b2b5;};'use strict';var _=require('lodash');var util=require(_0x0c75('0x0'));var moment=require(_0x0c75('0x1'));var BPromise=require('bluebird');var rs=require(_0x0c75('0x2'));var fs=require('fs');var Redis=require(_0x0c75('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0c75('0x4'))(_0x0c75('0x5'));var config=require(_0x0c75('0x6'));var jayson=require(_0x0c75('0x7'));var client=jayson[_0x0c75('0x8')][_0x0c75('0x9')]({'port':0x232a});config[_0x0c75('0xa')]=_['defaults'](config[_0x0c75('0xa')],{'host':_0x0c75('0xb'),'port':0x18eb});var socket=require(_0x0c75('0xc'))(new Redis(config['redis']));require(_0x0c75('0xd'))[_0x0c75('0xe')](socket);function respondWithRpcPromise(_0x9be9ee,_0x71f33b,_0x2847b3){return new BPromise(function(_0x4fe6c3,_0x276154){return client[_0x0c75('0xf')](_0x9be9ee,_0x2847b3)[_0x0c75('0x10')](function(_0x3135dd){logger[_0x0c75('0x11')](_0x0c75('0x12'),_0x71f33b,_0x0c75('0x13'));logger[_0x0c75('0x14')](_0x0c75('0x15'),_0x71f33b,_0x0c75('0x13'),JSON['stringify'](_0x3135dd));if(_0x3135dd[_0x0c75('0x16')]){if(_0x3135dd[_0x0c75('0x16')][_0x0c75('0x17')]===0x1f4){logger[_0x0c75('0x16')](_0x0c75('0x12'),_0x71f33b,_0x3135dd['error'][_0x0c75('0x18')]);return _0x276154(_0x3135dd[_0x0c75('0x16')][_0x0c75('0x18')]);}logger['error']('CmList,\x20%s,\x20%s',_0x71f33b,_0x3135dd[_0x0c75('0x16')]['message']);return _0x4fe6c3(_0x3135dd[_0x0c75('0x16')]['message']);}else{logger[_0x0c75('0x11')]('CmList,\x20%s,\x20%s',_0x71f33b,_0x0c75('0x13'));_0x4fe6c3(_0x3135dd[_0x0c75('0x19')]['message']);}})[_0x0c75('0x1a')](function(_0x11d45a){logger[_0x0c75('0x16')](_0x0c75('0x12'),_0x71f33b,_0x11d45a);_0x276154(_0x11d45a);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index f7e3d8b..24dee60 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 _0x822f=['./cmList.events','update','removeListener','register','length','cmList:'];(function(_0x3f948b,_0x2b309d){var _0x5933ae=function(_0x48549d){while(--_0x48549d){_0x3f948b['push'](_0x3f948b['shift']());}};_0x5933ae(++_0x2b309d);}(_0x822f,0x150));var _0xf822=function(_0x29e41d,_0x4d37d8){_0x29e41d=_0x29e41d-0x0;var _0x251081=_0x822f[_0x29e41d];return _0x251081;};'use strict';var CmListEvents=require(_0xf822('0x0'));var events=['save','remove',_0xf822('0x1')];function createListener(_0x11ede9,_0x31e6a5){return function(_0x28d5e7){_0x31e6a5['emit'](_0x11ede9,_0x28d5e7);};}function removeListener(_0x30b5b1,_0x18d836){return function(){CmListEvents[_0xf822('0x2')](_0x30b5b1,_0x18d836);};}exports[_0xf822('0x3')]=function(_0x5cb9bc){for(var _0x4e4cde=0x0,_0x5cfe05=events[_0xf822('0x4')];_0x4e4cde<_0x5cfe05;_0x4e4cde++){var _0x247004=events[_0x4e4cde];var _0x570175=createListener(_0xf822('0x5')+_0x247004,_0x5cb9bc);CmListEvents['on'](_0x247004,_0x570175);}}; \ No newline at end of file +var _0xd98a=['save','remove','update','removeListener','register','length'];(function(_0x4aedb1,_0x5c112b){var _0x1e58a5=function(_0xe4e9d7){while(--_0xe4e9d7){_0x4aedb1['push'](_0x4aedb1['shift']());}};_0x1e58a5(++_0x5c112b);}(_0xd98a,0xf6));var _0xad98=function(_0x3cb3c1,_0x4f4054){_0x3cb3c1=_0x3cb3c1-0x0;var _0x2dd468=_0xd98a[_0x3cb3c1];return _0x2dd468;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xad98('0x0'),_0xad98('0x1'),_0xad98('0x2')];function createListener(_0x2d3582,_0x493539){return function(_0x12ac30){_0x493539['emit'](_0x2d3582,_0x12ac30);};}function removeListener(_0x1339e1,_0x4f8ed5){return function(){CmListEvents[_0xad98('0x3')](_0x1339e1,_0x4f8ed5);};}exports[_0xad98('0x4')]=function(_0x5de12c){for(var _0x518e62=0x0,_0x47d062=events[_0xad98('0x5')];_0x518e62<_0x47d062;_0x518e62++){var _0xe95134=events[_0x518e62];var _0x3d60d7=createListener('cmList:'+_0xe95134,_0x5de12c);CmListEvents['on'](_0xe95134,_0x3d60d7);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 612f434..b922580 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 _0x6953=['/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addCustomField','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts'];(function(_0x388a11,_0x10b6d6){var _0x40803a=function(_0x1de6cc){while(--_0x1de6cc){_0x388a11['push'](_0x388a11['shift']());}};_0x40803a(++_0x10b6d6);}(_0x6953,0x91));var _0x3695=function(_0x38e7de,_0x478a05){_0x38e7de=_0x38e7de-0x0;var _0x57e519=_0x6953[_0x38e7de];return _0x57e519;};'use strict';var multer=require(_0x3695('0x0'));var util=require(_0x3695('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3695('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x3695('0x3'));var interaction=require(_0x3695('0x4'));var config=require(_0x3695('0x5'));var controller=require('./cmList.controller');router[_0x3695('0x6')]('/',auth['isAuthenticated'](),controller[_0x3695('0x7')]);router[_0x3695('0x6')](_0x3695('0x8'),auth[_0x3695('0x9')](),controller[_0x3695('0xa')]);router['get'](_0x3695('0xb'),auth['isAuthenticated'](),controller[_0x3695('0xc')]);router['get']('/:id/dispositions',auth[_0x3695('0x9')](),controller['getDispositions']);router[_0x3695('0x6')](_0x3695('0xd'),auth[_0x3695('0x9')](),controller[_0x3695('0xe')]);router[_0x3695('0x6')](_0x3695('0xf'),auth['isAuthenticated'](),controller[_0x3695('0x10')]);router[_0x3695('0x6')](_0x3695('0x11'),auth[_0x3695('0x9')](),controller[_0x3695('0x12')]);router[_0x3695('0x6')](_0x3695('0x13'),auth[_0x3695('0x9')](),controller[_0x3695('0x14')]);router[_0x3695('0x15')]('/',auth[_0x3695('0x9')](),controller['create']);router[_0x3695('0x15')](_0x3695('0x16'),auth[_0x3695('0x9')](),controller[_0x3695('0x17')]);router[_0x3695('0x15')](_0x3695('0xd'),auth[_0x3695('0x9')](),controller['addContacts']);router[_0x3695('0x15')]('/:id/fields',auth[_0x3695('0x9')](),controller[_0x3695('0x18')]);router[_0x3695('0x15')](_0x3695('0x13'),auth[_0x3695('0x9')](),controller['addAgents']);router[_0x3695('0x19')](_0x3695('0xb'),auth[_0x3695('0x9')](),controller[_0x3695('0x1a')]);router[_0x3695('0x1b')](_0x3695('0xb'),auth[_0x3695('0x9')](),controller[_0x3695('0x1c')]);router[_0x3695('0x1b')](_0x3695('0x16'),auth[_0x3695('0x9')](),controller[_0x3695('0x1d')]);router[_0x3695('0x1b')](_0x3695('0x13'),auth['isAuthenticated'](),controller[_0x3695('0x1e')]);module[_0x3695('0x1f')]=router; \ No newline at end of file +var _0x18e8=['/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getAgents','create','post','addDisposition','addCustomField','/:id/users','addAgents','update','delete','destroy','removeDispositions','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x1cc62f,_0x5acdc2){var _0x3f2c90=function(_0x44d21f){while(--_0x44d21f){_0x1cc62f['push'](_0x1cc62f['shift']());}};_0x3f2c90(++_0x5acdc2);}(_0x18e8,0x17b));var _0x818e=function(_0xf43f34,_0x544dff){_0xf43f34=_0xf43f34-0x0;var _0x17d3a6=_0x18e8[_0xf43f34];return _0x17d3a6;};'use strict';var multer=require(_0x818e('0x0'));var util=require(_0x818e('0x1'));var path=require('path');var timeout=require(_0x818e('0x2'));var express=require(_0x818e('0x3'));var router=express[_0x818e('0x4')]();var fs_extra=require(_0x818e('0x5'));var auth=require(_0x818e('0x6'));var interaction=require(_0x818e('0x7'));var config=require(_0x818e('0x8'));var controller=require('./cmList.controller');router[_0x818e('0x9')]('/',auth[_0x818e('0xa')](),controller['index']);router[_0x818e('0x9')](_0x818e('0xb'),auth[_0x818e('0xa')](),controller[_0x818e('0xc')]);router[_0x818e('0x9')](_0x818e('0xd'),auth[_0x818e('0xa')](),controller[_0x818e('0xe')]);router['get'](_0x818e('0xf'),auth[_0x818e('0xa')](),controller[_0x818e('0x10')]);router['get'](_0x818e('0x11'),auth[_0x818e('0xa')](),controller['getContacts']);router[_0x818e('0x9')](_0x818e('0x12'),auth[_0x818e('0xa')](),controller[_0x818e('0x13')]);router['get'](_0x818e('0x14'),auth[_0x818e('0xa')](),controller['getCustomFields']);router[_0x818e('0x9')]('/:id/users',auth[_0x818e('0xa')](),controller[_0x818e('0x15')]);router['post']('/',auth[_0x818e('0xa')](),controller[_0x818e('0x16')]);router[_0x818e('0x17')](_0x818e('0xf'),auth[_0x818e('0xa')](),controller[_0x818e('0x18')]);router['post']('/:id/contacts',auth[_0x818e('0xa')](),controller['addContacts']);router['post']('/:id/fields',auth[_0x818e('0xa')](),controller[_0x818e('0x19')]);router[_0x818e('0x17')](_0x818e('0x1a'),auth['isAuthenticated'](),controller[_0x818e('0x1b')]);router['put'](_0x818e('0xd'),auth['isAuthenticated'](),controller[_0x818e('0x1c')]);router[_0x818e('0x1d')]('/:id',auth[_0x818e('0xa')](),controller[_0x818e('0x1e')]);router[_0x818e('0x1d')](_0x818e('0xf'),auth['isAuthenticated'](),controller[_0x818e('0x1f')]);router['delete'](_0x818e('0x1a'),auth[_0x818e('0xa')](),controller[_0x818e('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 27a1e21..7732b9d 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 _0x3170=['STRING','sequelize','exports','getDataValue','field'];(function(_0x9e21ed,_0x476b4f){var _0x1b7d09=function(_0xf0589){while(--_0xf0589){_0x9e21ed['push'](_0x9e21ed['shift']());}};_0x1b7d09(++_0x476b4f);}(_0x3170,0x1b9));var _0x0317=function(_0x4b241a,_0x3267c4){_0x4b241a=_0x4b241a-0x0;var _0x16e18f=_0x3170[_0x4b241a];return _0x16e18f;};'use strict';var Sequelize=require(_0x0317('0x0'));module[_0x0317('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x362893){return this[_0x0317('0x2')](_0x0317('0x3'));}},'field':{'type':Sequelize[_0x0317('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x0317('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x0317('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xebbb=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x3b08a9,_0x180729){var _0x171433=function(_0x54155){while(--_0x54155){_0x3b08a9['push'](_0x3b08a9['shift']());}};_0x171433(++_0x180729);}(_0xebbb,0x182));var _0xbebb=function(_0xf658b3,_0x571856){_0xf658b3=_0xf658b3-0x0;var _0x58679b=_0xebbb[_0xf658b3];return _0x58679b;};'use strict';var Sequelize=require(_0xbebb('0x0'));module[_0xbebb('0x1')]={'name':{'type':Sequelize[_0xbebb('0x2')],'get':function(_0x5138b3){return this['getDataValue'](_0xbebb('0x3'));}},'field':{'type':Sequelize[_0xbebb('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xbebb('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 5b339a5..c5199a8 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x5b7948,_0x1985ac){var _0x2a9630=function(_0x4fa45a){while(--_0x4fa45a){_0x5b7948['push'](_0x5b7948['shift']());}};_0x2a9630(++_0x1985ac);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x334967,_0x3f1fb5){var _0xc2b28e=function(_0xd58717){while(--_0xd58717){_0x334967['push'](_0x334967['shift']());}};_0xc2b28e(++_0x3f1fb5);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 18ea779..08714da 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 _0x397e=['./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x390733,_0x1e3d32){var _0x33beb9=function(_0x4491a3){while(--_0x4491a3){_0x390733['push'](_0x390733['shift']());}};_0x33beb9(++_0x1e3d32);}(_0x397e,0xbb));var _0xe397=function(_0x42ca15,_0x193ccb){_0x42ca15=_0x42ca15-0x0;var _0x1c6ded=_0x397e[_0x42ca15];return _0x1c6ded;};'use strict';var _=require(_0xe397('0x0'));var util=require(_0xe397('0x1'));var logger=require(_0xe397('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe397('0x3'));var rp=require(_0xe397('0x4'));var fs=require('fs');var path=require(_0xe397('0x5'));var rimraf=require(_0xe397('0x6'));var config=require(_0xe397('0x7'));var attributes=require(_0xe397('0x8'));module[_0xe397('0x9')]=function(_0x2d3ae7,_0x26a46d){return _0x2d3ae7[_0xe397('0xa')](_0xe397('0xb'),attributes,{'tableName':_0xe397('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x36a2=['exports','Condition','lodash','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4ba105,_0xf97073){var _0x5eee7b=function(_0x242611){while(--_0x242611){_0x4ba105['push'](_0x4ba105['shift']());}};_0x5eee7b(++_0xf97073);}(_0x36a2,0x14a));var _0x236a=function(_0x699200,_0x39c101){_0x699200=_0x699200-0x0;var _0x266fd1=_0x36a2[_0x699200];return _0x266fd1;};'use strict';var _=require(_0x236a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x236a('0x1'));var rp=require(_0x236a('0x2'));var fs=require('fs');var path=require(_0x236a('0x3'));var rimraf=require(_0x236a('0x4'));var config=require(_0x236a('0x5'));var attributes=require('./condition.attributes');module[_0x236a('0x6')]=function(_0x5b9b72,_0x4016ce){return _0x5b9b72['define'](_0x236a('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 59caf17..50b7ffd 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 _0x4ff3=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4ff3,0x167));var _0x34ff=function(_0x573d35,_0x1620f1){_0x573d35=_0x573d35-0x0;var _0x1eee5b=_0x4ff3[_0x573d35];return _0x1eee5b;};'use strict';var _=require(_0x34ff('0x0'));var util=require(_0x34ff('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x34ff('0x2'));var fs=require('fs');var Redis=require(_0x34ff('0x3'));var db=require(_0x34ff('0x4'))['db'];var utils=require(_0x34ff('0x5'));var logger=require(_0x34ff('0x6'))(_0x34ff('0x7'));var config=require('../../config/environment');var jayson=require(_0x34ff('0x8'));var client=jayson[_0x34ff('0x9')][_0x34ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11f321,_0x43290d,_0x35e3e6){return new BPromise(function(_0x1f4e0c,_0x3ce275){return client[_0x34ff('0xb')](_0x11f321,_0x35e3e6)[_0x34ff('0xc')](function(_0xabc02d){logger[_0x34ff('0xd')](_0x34ff('0xe'),_0x43290d,_0x34ff('0xf'));logger['debug']('Condition,\x20%s,\x20%s,\x20%s',_0x43290d,_0x34ff('0xf'),JSON[_0x34ff('0x10')](_0xabc02d));if(_0xabc02d[_0x34ff('0x11')]){if(_0xabc02d[_0x34ff('0x11')]['code']===0x1f4){logger['error'](_0x34ff('0xe'),_0x43290d,_0xabc02d['error'][_0x34ff('0x12')]);return _0x3ce275(_0xabc02d[_0x34ff('0x11')][_0x34ff('0x12')]);}logger['error']('Condition,\x20%s,\x20%s',_0x43290d,_0xabc02d['error'][_0x34ff('0x12')]);return _0x1f4e0c(_0xabc02d[_0x34ff('0x11')][_0x34ff('0x12')]);}else{logger[_0x34ff('0xd')]('Condition,\x20%s,\x20%s',_0x43290d,'request\x20sent');_0x1f4e0c(_0xabc02d['result'][_0x34ff('0x12')]);}})[_0x34ff('0x13')](function(_0x10e62f){logger['error'](_0x34ff('0xe'),_0x43290d,_0x10e62f);_0x3ce275(_0x10e62f);});});} \ No newline at end of file +var _0x32be=['stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s'];(function(_0x3ba77e,_0x5b768f){var _0x20544e=function(_0x268dbc){while(--_0x268dbc){_0x3ba77e['push'](_0x3ba77e['shift']());}};_0x20544e(++_0x5b768f);}(_0x32be,0x159));var _0xe32b=function(_0x1b79f5,_0x1cf93a){_0x1b79f5=_0x1b79f5-0x0;var _0x26a6f1=_0x32be[_0x1b79f5];return _0x26a6f1;};'use strict';var _=require(_0xe32b('0x0'));var util=require('util');var moment=require(_0xe32b('0x1'));var BPromise=require(_0xe32b('0x2'));var rs=require(_0xe32b('0x3'));var fs=require('fs');var Redis=require(_0xe32b('0x4'));var db=require(_0xe32b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe32b('0x6'))(_0xe32b('0x7'));var config=require('../../config/environment');var jayson=require(_0xe32b('0x8'));var client=jayson[_0xe32b('0x9')][_0xe32b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e7239,_0x27e811,_0xb59ca6){return new BPromise(function(_0x2c8f48,_0x494507){return client['request'](_0x5e7239,_0xb59ca6)['then'](function(_0x4a08d2){logger['info'](_0xe32b('0xb'),_0x27e811,_0xe32b('0xc'));logger[_0xe32b('0xd')](_0xe32b('0xe'),_0x27e811,_0xe32b('0xc'),JSON[_0xe32b('0xf')](_0x4a08d2));if(_0x4a08d2[_0xe32b('0x10')]){if(_0x4a08d2['error'][_0xe32b('0x11')]===0x1f4){logger['error']('Condition,\x20%s,\x20%s',_0x27e811,_0x4a08d2[_0xe32b('0x10')][_0xe32b('0x12')]);return _0x494507(_0x4a08d2['error'][_0xe32b('0x12')]);}logger['error'](_0xe32b('0xb'),_0x27e811,_0x4a08d2[_0xe32b('0x10')][_0xe32b('0x12')]);return _0x2c8f48(_0x4a08d2[_0xe32b('0x10')][_0xe32b('0x12')]);}else{logger['info'](_0xe32b('0xb'),_0x27e811,_0xe32b('0xc'));_0x2c8f48(_0x4a08d2[_0xe32b('0x13')]['message']);}})['catch'](function(_0x5907b6){logger[_0xe32b('0x10')](_0xe32b('0xb'),_0x27e811,_0x5907b6);_0x494507(_0x5907b6);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 0529e83..9a17e4d 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 _0x8059=['isAuthenticated','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put'];(function(_0x290a52,_0x565824){var _0x2b50f5=function(_0x2f461d){while(--_0x2f461d){_0x290a52['push'](_0x290a52['shift']());}};_0x2b50f5(++_0x565824);}(_0x8059,0x178));var _0x9805=function(_0x10dc64,_0x11bb29){_0x10dc64=_0x10dc64-0x0;var _0x9cf98d=_0x8059[_0x10dc64];return _0x9cf98d;};'use strict';var multer=require(_0x9805('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9805('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9805('0x2'));var auth=require(_0x9805('0x3'));var interaction=require(_0x9805('0x4'));var config=require(_0x9805('0x5'));var controller=require(_0x9805('0x6'));router[_0x9805('0x7')]('/:id',auth[_0x9805('0x8')](),controller['update']);router[_0x9805('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x9805('0xa')]);module[_0x9805('0xb')]=router; \ No newline at end of file +var _0x7363=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','update','exports'];(function(_0x3c5f8d,_0x39891f){var _0x3b7beb=function(_0x44d6c9){while(--_0x44d6c9){_0x3c5f8d['push'](_0x3c5f8d['shift']());}};_0x3b7beb(++_0x39891f);}(_0x7363,0x1c8));var _0x3736=function(_0x53b752,_0x4ffc3b){_0x53b752=_0x53b752-0x0;var _0x31ed81=_0x7363[_0x53b752];return _0x31ed81;};'use strict';var multer=require(_0x3736('0x0'));var util=require(_0x3736('0x1'));var path=require(_0x3736('0x2'));var timeout=require(_0x3736('0x3'));var express=require(_0x3736('0x4'));var router=express['Router']();var fs_extra=require(_0x3736('0x5'));var auth=require(_0x3736('0x6'));var interaction=require(_0x3736('0x7'));var config=require(_0x3736('0x8'));var controller=require('./condition.controller');router['put'](_0x3736('0x9'),auth['isAuthenticated'](),controller[_0x3736('0xa')]);router['delete'](_0x3736('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x3736('0xb')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 12f7a43..7f05d13 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 _0xe706=['STRING','sequelize','exports'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xe706,0xa3));var _0x6e70=function(_0xdb27ce,_0x21e4f6){_0xdb27ce=_0xdb27ce-0x0;var _0x2a9fcb=_0xe706[_0xdb27ce];return _0x2a9fcb;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'name':{'type':Sequelize[_0x6e70('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x6e70('0x2')]}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x5a4a24,_0x2e5a58){var _0x473ff7=function(_0x5d489f){while(--_0x5d489f){_0x5a4a24['push'](_0x5a4a24['shift']());}};_0x473ff7(++_0x2e5a58);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index f959b18..b711b71 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 _0x9cb5=['attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','getItems','pick','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','./dashboard.socket','register','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','get','CustomDashboards','UserProfileResource','destroy','end','error','name','index','fieldName','key','map','query','filters','intersection','model','attributes','fields','nolimit','order','sort','filter','where','merge','options','Dashboard','includeAll','include','rows','catch','show','params','rawAttributes','keys','length','find','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','omit','updatedAt','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','type','iframe','attrUrl','attrs','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts'];(function(_0x5966ac,_0xa982e8){var _0x18d288=function(_0x3d52d7){while(--_0x3d52d7){_0x5966ac['push'](_0x5966ac['shift']());}};_0x18d288(++_0xa982e8);}(_0x9cb5,0x94));var _0x59cb=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9cb5[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x59cb('0x0'));var rimraf=require(_0x59cb('0x1'));var zipdir=require(_0x59cb('0x2'));var jsonpatch=require(_0x59cb('0x3'));var rp=require(_0x59cb('0x4'));var moment=require(_0x59cb('0x5'));var BPromise=require(_0x59cb('0x6'));var Mustache=require('mustache');var util=require(_0x59cb('0x7'));var path=require(_0x59cb('0x8'));var sox=require('sox');var csv=require(_0x59cb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x59cb('0xa'));var _=require('lodash');var squel=require(_0x59cb('0xb'));var crypto=require(_0x59cb('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x59cb('0xd'));var toCsv=require('to-csv');var querystring=require(_0x59cb('0xe'));var Papa=require(_0x59cb('0xf'));var Redis=require(_0x59cb('0x10'));var authService=require(_0x59cb('0x11'));var qs=require(_0x59cb('0x12'));var as=require(_0x59cb('0x13'));var hardwareService=require(_0x59cb('0x14'));var logger=require(_0x59cb('0x15'))(_0x59cb('0x16'));var utils=require(_0x59cb('0x17'));var config=require(_0x59cb('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x59cb('0x19'))['db'];config[_0x59cb('0x1a')]=_['defaults'](config[_0x59cb('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x59cb('0x1b'))[_0x59cb('0x1c')](socket);function respondWithStatusCode(_0x5cd00e,_0x4d7c35){_0x4d7c35=_0x4d7c35||0xcc;return function(_0x2a2b6e){if(_0x2a2b6e){return _0x5cd00e[_0x59cb('0x1d')](_0x4d7c35);}return _0x5cd00e[_0x59cb('0x1e')](_0x4d7c35)['end']();};}function respondWithResult(_0x4facba,_0x37d64d){_0x37d64d=_0x37d64d||0xc8;return function(_0x11fccc){if(_0x11fccc){return _0x4facba[_0x59cb('0x1e')](_0x37d64d)['json'](_0x11fccc);}};}function respondWithFilteredResult(_0x1d7a98,_0x1410bd){return function(_0x32f800){if(_0x32f800){var _0x84fe47=typeof _0x1410bd[_0x59cb('0x1f')]==='undefined'&&typeof _0x1410bd[_0x59cb('0x20')]===_0x59cb('0x21');var _0x2f311b=_0x32f800[_0x59cb('0x22')];var _0x5bbb15=_0x84fe47?0x0:_0x1410bd[_0x59cb('0x1f')];var _0x430363=_0x84fe47?_0x32f800[_0x59cb('0x22')]:_0x1410bd['offset']+_0x1410bd[_0x59cb('0x20')];var _0x1a5197;if(_0x430363>=_0x2f311b){_0x430363=_0x2f311b;_0x1a5197=0xc8;}else{_0x1a5197=0xce;}_0x1d7a98[_0x59cb('0x1e')](_0x1a5197);return _0x1d7a98[_0x59cb('0x23')](_0x59cb('0x24'),_0x5bbb15+'-'+_0x430363+'/'+_0x2f311b)[_0x59cb('0x25')](_0x32f800);}return null;};}function patchUpdates(_0x4be469){return function(_0x31b8a5){try{jsonpatch[_0x59cb('0x26')](_0x31b8a5,_0x4be469,!![]);}catch(_0x4635ea){return BPromise[_0x59cb('0x27')](_0x4635ea);}return _0x31b8a5[_0x59cb('0x28')]();};}function saveUpdates(_0x38575b,_0x3d9fb0){return function(_0x102876){if(_0x102876){return _0x102876[_0x59cb('0x29')](_0x38575b)[_0x59cb('0x2a')](function(_0x58bab9){return _0x58bab9;});}return null;};}function removeEntity(_0x209cda,_0x5e7521){return function(_0x253c38){if(_0x253c38){return _0x253c38['destroy']()['then'](function(){var _0x48ab5e=_0x253c38[_0x59cb('0x2b')]({'plain':!![]});var _0x59ed6d=_0x59cb('0x2c');return db[_0x59cb('0x2d')][_0x59cb('0x2e')]({'where':{'type':_0x59ed6d,'resourceId':_0x48ab5e['id']}})['then'](function(){return _0x253c38;});})[_0x59cb('0x2a')](function(){_0x209cda[_0x59cb('0x1e')](0xcc)[_0x59cb('0x2f')]();});}};}function handleEntityNotFound(_0x1fddb1,_0x1a1704){return function(_0x4b3b24){if(!_0x4b3b24){_0x1fddb1['sendStatus'](0x194);}return _0x4b3b24;};}function handleError(_0xc6291,_0x291eb8){_0x291eb8=_0x291eb8||0x1f4;return function(_0x115f56){logger[_0x59cb('0x30')](_0x115f56['stack']);if(_0x115f56[_0x59cb('0x31')]){delete _0x115f56[_0x59cb('0x31')];}_0xc6291['status'](_0x291eb8)['send'](_0x115f56);};}exports[_0x59cb('0x32')]=function(_0x126135,_0x24022c){var _0x1b3ec2={},_0x4cb8ca={},_0x53d1ed={'count':0x0,'rows':[]};var _0x146bee=_['map'](db['Dashboard']['rawAttributes'],function(_0x2438e4){return{'name':_0x2438e4[_0x59cb('0x33')],'type':_0x2438e4['type'][_0x59cb('0x34')]};});_0x4cb8ca['model']=_[_0x59cb('0x35')](_0x146bee,_0x59cb('0x31'));_0x4cb8ca[_0x59cb('0x36')]=_['keys'](_0x126135[_0x59cb('0x36')]);_0x4cb8ca[_0x59cb('0x37')]=_[_0x59cb('0x38')](_0x4cb8ca[_0x59cb('0x39')],_0x4cb8ca[_0x59cb('0x36')]);_0x1b3ec2[_0x59cb('0x3a')]=_[_0x59cb('0x38')](_0x4cb8ca[_0x59cb('0x39')],qs[_0x59cb('0x3b')](_0x126135[_0x59cb('0x36')][_0x59cb('0x3b')]));_0x1b3ec2['attributes']=_0x1b3ec2[_0x59cb('0x3a')]['length']?_0x1b3ec2[_0x59cb('0x3a')]:_0x4cb8ca['model'];if(!_0x126135['query']['hasOwnProperty'](_0x59cb('0x3c'))){_0x1b3ec2[_0x59cb('0x20')]=qs[_0x59cb('0x20')](_0x126135[_0x59cb('0x36')][_0x59cb('0x20')]);_0x1b3ec2[_0x59cb('0x1f')]=qs[_0x59cb('0x1f')](_0x126135[_0x59cb('0x36')][_0x59cb('0x1f')]);}_0x1b3ec2[_0x59cb('0x3d')]=qs[_0x59cb('0x3e')](_0x126135[_0x59cb('0x36')]['sort']);_0x1b3ec2['where']=qs[_0x59cb('0x37')](_['pick'](_0x126135[_0x59cb('0x36')],_0x4cb8ca[_0x59cb('0x37')]),_0x146bee);if(_0x126135['query'][_0x59cb('0x3f')]){_0x1b3ec2[_0x59cb('0x40')]=_['merge'](_0x1b3ec2[_0x59cb('0x40')],{'$or':_[_0x59cb('0x35')](_0x146bee,function(_0x511b24){if(_0x511b24['type']!=='VIRTUAL'){var _0x5b1fd8={};_0x5b1fd8[_0x511b24[_0x59cb('0x31')]]={'$like':'%'+_0x126135[_0x59cb('0x36')][_0x59cb('0x3f')]+'%'};return _0x5b1fd8;}})});}_0x1b3ec2=_[_0x59cb('0x41')]({},_0x1b3ec2,_0x126135[_0x59cb('0x42')]);var _0xeadb7b={'where':_0x1b3ec2[_0x59cb('0x40')]};return db[_0x59cb('0x43')][_0x59cb('0x22')](_0xeadb7b)['then'](function(_0x5cc04f){_0x53d1ed[_0x59cb('0x22')]=_0x5cc04f;if(_0x126135[_0x59cb('0x36')][_0x59cb('0x44')]){_0x1b3ec2[_0x59cb('0x45')]=[{'all':!![]}];}return db[_0x59cb('0x43')]['findAll'](_0x1b3ec2);})[_0x59cb('0x2a')](function(_0x36a266){_0x53d1ed[_0x59cb('0x46')]=_0x36a266;return _0x53d1ed;})[_0x59cb('0x2a')](respondWithFilteredResult(_0x24022c,_0x1b3ec2))[_0x59cb('0x47')](handleError(_0x24022c,null));};exports[_0x59cb('0x48')]=function(_0x223909,_0x4de485){var _0xc253dd={'raw':![],'where':{'id':_0x223909[_0x59cb('0x49')]['id']}},_0xa65485={};_0xa65485[_0x59cb('0x39')]=_['keys'](db['Dashboard'][_0x59cb('0x4a')]);_0xa65485[_0x59cb('0x36')]=_[_0x59cb('0x4b')](_0x223909['query']);_0xa65485[_0x59cb('0x37')]=_['intersection'](_0xa65485[_0x59cb('0x39')],_0xa65485[_0x59cb('0x36')]);_0xc253dd['attributes']=_[_0x59cb('0x38')](_0xa65485[_0x59cb('0x39')],qs[_0x59cb('0x3b')](_0x223909[_0x59cb('0x36')][_0x59cb('0x3b')]));_0xc253dd[_0x59cb('0x3a')]=_0xc253dd['attributes'][_0x59cb('0x4c')]?_0xc253dd[_0x59cb('0x3a')]:_0xa65485[_0x59cb('0x39')];if(_0x223909[_0x59cb('0x36')][_0x59cb('0x44')]){_0xc253dd[_0x59cb('0x45')]=[{'all':!![]}];}_0xc253dd=_[_0x59cb('0x41')]({},_0xc253dd,_0x223909['options']);return db['Dashboard'][_0x59cb('0x4d')](_0xc253dd)[_0x59cb('0x2a')](handleEntityNotFound(_0x4de485,null))[_0x59cb('0x2a')](respondWithResult(_0x4de485,null))['catch'](handleError(_0x4de485,null));};exports['create']=function(_0x3477c6,_0x324a8f){return db[_0x59cb('0x43')]['create'](_0x3477c6[_0x59cb('0x4e')],{})[_0x59cb('0x2a')](function(_0x1a9299){var _0xf0220=_0x3477c6[_0x59cb('0x4f')][_0x59cb('0x2b')]({'plain':!![]});if(!_0xf0220)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf0220[_0x59cb('0x50')]===_0x59cb('0x4f')){var _0x1b6d69=_0x1a9299[_0x59cb('0x2b')]({'plain':!![]});var _0x236ea0=_0x59cb('0x2c');return db[_0x59cb('0x51')]['find']({'where':{'name':_0x236ea0,'userProfileId':_0xf0220['userProfileId']},'raw':!![]})[_0x59cb('0x2a')](function(_0x4edb04){if(_0x4edb04&&_0x4edb04[_0x59cb('0x52')]===0x0){return db[_0x59cb('0x2d')]['create']({'name':_0x1b6d69[_0x59cb('0x31')],'resourceId':_0x1b6d69['id'],'type':_0x4edb04[_0x59cb('0x31')],'sectionId':_0x4edb04['id']},{})[_0x59cb('0x2a')](function(){return _0x1a9299;});}else{return _0x1a9299;}})[_0x59cb('0x47')](function(_0x1866a1){logger['error'](_0x59cb('0x53'),_0x1866a1);throw _0x1866a1;});}return _0x1a9299;})[_0x59cb('0x2a')](respondWithResult(_0x324a8f,0xc9))[_0x59cb('0x47')](handleError(_0x324a8f,null));};exports[_0x59cb('0x54')]=function(_0x45bc71,_0x2e574c){var _0x15820b={'where':{'id':_0x45bc71[_0x59cb('0x49')]['id']}},_0x235c91={};_0x235c91[_0x59cb('0x39')]=_[_0x59cb('0x4b')](db[_0x59cb('0x43')][_0x59cb('0x4a')]);_0x15820b['attributes']=_[_0x59cb('0x38')](_0x235c91['model'],qs[_0x59cb('0x3b')](_0x45bc71[_0x59cb('0x36')][_0x59cb('0x3b')]));_0x15820b['attributes']=_0x15820b[_0x59cb('0x3a')][_0x59cb('0x4c')]?_0x15820b[_0x59cb('0x3a')]:_0x235c91[_0x59cb('0x39')];if(_0x45bc71['query'][_0x59cb('0x44')]){_0x15820b['include']=[{'all':!![]}];}_0x15820b=_[_0x59cb('0x41')]({},_0x15820b,_0x45bc71[_0x59cb('0x42')]);return db[_0x59cb('0x43')][_0x59cb('0x4d')](_0x15820b)[_0x59cb('0x2a')](handleEntityNotFound(_0x2e574c,null))[_0x59cb('0x2a')](function(_0x199fcb){if(_0x199fcb){var _0x5f232a=_0x199fcb[_0x59cb('0x2b')]({'plain':!![]});_0x5f232a=qs['omit'](_0x5f232a,['id',_0x59cb('0x55'),'updatedAt']);_0x45bc71[_0x59cb('0x4e')]=_[_0x59cb('0x56')](_0x45bc71[_0x59cb('0x4e')],['id','createdAt',_0x59cb('0x57')]);return db[_0x59cb('0x43')][_0x59cb('0x58')](_['merge'](_0x5f232a,_0x45bc71['body']),{'include':_0x45bc71[_0x59cb('0x36')]['includeAll']?[{'all':!![]}]:undefined})[_0x59cb('0x2a')](function(_0x45611b){var _0x51db0b=_0x45bc71[_0x59cb('0x4f')][_0x59cb('0x2b')]({'plain':!![]});if(!_0x51db0b)throw new Error(_0x59cb('0x59'));if(_0x51db0b[_0x59cb('0x50')]===_0x59cb('0x4f')){var _0x4687bf=_0x45611b[_0x59cb('0x2b')]({'plain':!![]});var _0x20307e=_0x59cb('0x2c');return db[_0x59cb('0x51')][_0x59cb('0x4d')]({'where':{'name':_0x20307e,'userProfileId':_0x51db0b[_0x59cb('0x5a')]},'raw':!![]})[_0x59cb('0x2a')](function(_0x247c18){if(_0x247c18&&_0x247c18[_0x59cb('0x52')]===0x0){return db[_0x59cb('0x2d')][_0x59cb('0x58')]({'name':_0x4687bf['name'],'resourceId':_0x4687bf['id'],'type':_0x247c18[_0x59cb('0x31')],'sectionId':_0x247c18['id']},{})['then'](function(){return _0x45611b;});}else{return _0x45611b;}})['catch'](function(_0x5b66fc){logger['error'](_0x59cb('0x53'),_0x5b66fc);throw _0x5b66fc;});}return _0x45611b;});}})[_0x59cb('0x2a')](respondWithResult(_0x2e574c,0xc9))[_0x59cb('0x47')](handleError(_0x2e574c,null));};exports[_0x59cb('0x29')]=function(_0x72e783,_0x3ba667){if(_0x72e783[_0x59cb('0x4e')]['id']){delete _0x72e783[_0x59cb('0x4e')]['id'];}return db[_0x59cb('0x43')][_0x59cb('0x4d')]({'where':{'id':_0x72e783[_0x59cb('0x49')]['id']}})[_0x59cb('0x2a')](handleEntityNotFound(_0x3ba667,null))[_0x59cb('0x2a')](saveUpdates(_0x72e783[_0x59cb('0x4e')],null))[_0x59cb('0x2a')](respondWithResult(_0x3ba667,null))[_0x59cb('0x47')](handleError(_0x3ba667,null));};exports[_0x59cb('0x2e')]=function(_0x4ae924,_0x6138fd){return db[_0x59cb('0x43')]['find']({'where':{'id':_0x4ae924[_0x59cb('0x49')]['id']}})[_0x59cb('0x2a')](handleEntityNotFound(_0x6138fd,null))[_0x59cb('0x2a')](removeEntity(_0x6138fd,null))[_0x59cb('0x47')](handleError(_0x6138fd,null));};function widgetAttributes(_0x4f2cbd){try{switch(_0x4f2cbd[_0x59cb('0x5b')]){case _0x59cb('0x5c'):return[{'name':_0x59cb('0x5d'),'value':_0x4f2cbd[_0x59cb('0x5d')]||(_0x4f2cbd[_0x59cb('0x5e')]&&_0x4f2cbd[_0x59cb('0x5e')][0x0]?_0x4f2cbd[_0x59cb('0x5e')][0x0]['value']:undefined)||'https://'}];case _0x59cb('0x5f'):return[{'name':_0x59cb('0x60'),'value':_0x4f2cbd[_0x59cb('0x60')]||(_0x4f2cbd['attrs']&&_0x4f2cbd[_0x59cb('0x5e')][0x0]?_0x4f2cbd[_0x59cb('0x5e')][0x0][_0x59cb('0x61')]:undefined)||''}];case _0x59cb('0x62'):return[{'name':_0x59cb('0x63'),'value':_0x4f2cbd[_0x59cb('0x63')]||(_0x4f2cbd[_0x59cb('0x5e')]&&_0x4f2cbd['attrs'][0x0]?_0x4f2cbd['attrs'][0x0][_0x59cb('0x61')]:undefined)||_0x59cb('0x64')},{'name':'attrTimezone','value':_0x4f2cbd[_0x59cb('0x65')]||(_0x4f2cbd[_0x59cb('0x5e')]&&_0x4f2cbd[_0x59cb('0x5e')][0x1]?_0x4f2cbd[_0x59cb('0x5e')][0x1][_0x59cb('0x61')]:undefined)||_0x59cb('0x66')},{'name':_0x59cb('0x67'),'value':_0x4f2cbd['attrFontSize']||(_0x4f2cbd[_0x59cb('0x5e')]&&_0x4f2cbd[_0x59cb('0x5e')][0x2]?_0x4f2cbd[_0x59cb('0x5e')][0x2][_0x59cb('0x61')]:undefined)||0xc}];case _0x59cb('0x68'):return[{'name':_0x59cb('0x69'),'value':_0x4f2cbd[_0x59cb('0x69')]||(_0x4f2cbd['attrs']&&_0x4f2cbd[_0x59cb('0x5e')][0x0]?_0x4f2cbd['attrs'][0x0]['value']:undefined)||_0x59cb('0x6a')},{'name':'attrVoiceQueues','value':_0x4f2cbd[_0x59cb('0x6b')]||(_0x4f2cbd[_0x59cb('0x5e')]&&_0x4f2cbd[_0x59cb('0x5e')][0x1]?_0x4f2cbd[_0x59cb('0x5e')][0x1][_0x59cb('0x61')]:undefined)||[]},{'name':_0x59cb('0x67'),'value':_0x4f2cbd['attrFontSize']||(_0x4f2cbd['attrs']&&_0x4f2cbd['attrs'][0x2]?_0x4f2cbd[_0x59cb('0x5e')][0x2][_0x59cb('0x61')]:undefined)||0x14},{'name':_0x59cb('0x6c'),'value':_0x4f2cbd[_0x59cb('0x6c')]||(_0x4f2cbd[_0x59cb('0x5e')]&&_0x4f2cbd[_0x59cb('0x5e')][0x3]?_0x4f2cbd[_0x59cb('0x5e')][0x3][_0x59cb('0x61')]:undefined)||_0x59cb('0x6d')},{'name':_0x59cb('0x6e'),'value':_0x4f2cbd[_0x59cb('0x6e')]||(_0x4f2cbd[_0x59cb('0x5e')]&&_0x4f2cbd['attrs'][0x4]?_0x4f2cbd[_0x59cb('0x5e')][0x4][_0x59cb('0x61')]:undefined)||''},{'name':_0x59cb('0x6f'),'value':_0x4f2cbd[_0x59cb('0x6f')]||(_0x4f2cbd[_0x59cb('0x5e')]&&_0x4f2cbd[_0x59cb('0x5e')][0x5]?_0x4f2cbd[_0x59cb('0x5e')][0x5]['value']:undefined)||''},{'name':_0x59cb('0x70'),'value':_0x4f2cbd[_0x59cb('0x70')]||(_0x4f2cbd[_0x59cb('0x5e')]&&_0x4f2cbd[_0x59cb('0x5e')][0x6]?_0x4f2cbd[_0x59cb('0x5e')][0x6][_0x59cb('0x61')]:undefined)||''},{'name':_0x59cb('0x71'),'value':_0x4f2cbd[_0x59cb('0x71')]||(_0x4f2cbd[_0x59cb('0x5e')]&&_0x4f2cbd[_0x59cb('0x5e')][0x7]?_0x4f2cbd[_0x59cb('0x5e')][0x7][_0x59cb('0x61')]:undefined)||''},{'name':_0x59cb('0x72'),'value':_0x4f2cbd[_0x59cb('0x72')]||(_0x4f2cbd[_0x59cb('0x5e')]&&_0x4f2cbd['attrs'][0x8]?_0x4f2cbd[_0x59cb('0x5e')][0x8][_0x59cb('0x61')]:undefined)||''},{'name':_0x59cb('0x73'),'value':_0x4f2cbd[_0x59cb('0x73')]||(_0x4f2cbd[_0x59cb('0x5e')]&&_0x4f2cbd[_0x59cb('0x5e')][0x9]?_0x4f2cbd['attrs'][0x9]['value']:undefined)||''}];case _0x59cb('0x74'):case'pie-chart':return[{'name':_0x59cb('0x75'),'value':_0x4f2cbd[_0x59cb('0x75')]||(_0x4f2cbd[_0x59cb('0x5e')]&&_0x4f2cbd[_0x59cb('0x5e')][0x0]?_0x4f2cbd[_0x59cb('0x5e')][0x0]['value']:undefined)||_0x59cb('0x6a')},{'name':_0x59cb('0x76'),'value':_0x4f2cbd['attrSerie2']||(_0x4f2cbd[_0x59cb('0x5e')]&&_0x4f2cbd['attrs'][0x1]?_0x4f2cbd[_0x59cb('0x5e')][0x1]['value']:undefined)||null},{'name':_0x59cb('0x77'),'value':_0x4f2cbd[_0x59cb('0x77')]||(_0x4f2cbd['attrs']&&_0x4f2cbd['attrs'][0x2]?_0x4f2cbd['attrs'][0x2][_0x59cb('0x61')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x4f2cbd[_0x59cb('0x6b')]||(_0x4f2cbd[_0x59cb('0x5e')]&&_0x4f2cbd[_0x59cb('0x5e')][0x3]?_0x4f2cbd[_0x59cb('0x5e')][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x4f2cbd[_0x59cb('0x6c')]||(_0x4f2cbd[_0x59cb('0x5e')]&&_0x4f2cbd[_0x59cb('0x5e')][0x4]?_0x4f2cbd[_0x59cb('0x5e')][0x4][_0x59cb('0x61')]:undefined)||_0x59cb('0x6d')},{'name':'attrEmailAccounts','value':_0x4f2cbd[_0x59cb('0x6e')]||(_0x4f2cbd['attrs']&&_0x4f2cbd[_0x59cb('0x5e')][0x5]?_0x4f2cbd[_0x59cb('0x5e')][0x5][_0x59cb('0x61')]:undefined)||''},{'name':_0x59cb('0x6f'),'value':_0x4f2cbd[_0x59cb('0x6f')]||(_0x4f2cbd['attrs']&&_0x4f2cbd[_0x59cb('0x5e')][0x6]?_0x4f2cbd[_0x59cb('0x5e')][0x6][_0x59cb('0x61')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x4f2cbd[_0x59cb('0x70')]||(_0x4f2cbd[_0x59cb('0x5e')]&&_0x4f2cbd[_0x59cb('0x5e')][0x7]?_0x4f2cbd['attrs'][0x7][_0x59cb('0x61')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x4f2cbd[_0x59cb('0x71')]||(_0x4f2cbd[_0x59cb('0x5e')]&&_0x4f2cbd['attrs'][0x8]?_0x4f2cbd[_0x59cb('0x5e')][0x8]['value']:undefined)||''},{'name':_0x59cb('0x72'),'value':_0x4f2cbd[_0x59cb('0x72')]||(_0x4f2cbd[_0x59cb('0x5e')]&&_0x4f2cbd['attrs'][0x9]?_0x4f2cbd[_0x59cb('0x5e')][0x9][_0x59cb('0x61')]:undefined)||''},{'name':_0x59cb('0x73'),'value':_0x4f2cbd[_0x59cb('0x73')]||(_0x4f2cbd[_0x59cb('0x5e')]&&_0x4f2cbd[_0x59cb('0x5e')][0xa]?_0x4f2cbd['attrs'][0xa][_0x59cb('0x61')]:undefined)||''}];case'web-report':return[{'name':_0x59cb('0x78'),'type':_0x4f2cbd[_0x59cb('0x79')]||(_0x4f2cbd[_0x59cb('0x5e')]&&_0x4f2cbd[_0x59cb('0x5e')][0x0]?_0x4f2cbd['attrs'][0x0][_0x59cb('0x5b')]:undefined)||null,'value':_0x4f2cbd[_0x59cb('0x78')]||(_0x4f2cbd[_0x59cb('0x5e')]&&_0x4f2cbd['attrs'][0x0]?_0x4f2cbd['attrs'][0x0][_0x59cb('0x61')]:undefined)||null},{'name':_0x59cb('0x7a'),'value':_0x4f2cbd[_0x59cb('0x7a')]||(_0x4f2cbd[_0x59cb('0x5e')]&&_0x4f2cbd['attrs'][0x1]?_0x4f2cbd[_0x59cb('0x5e')][0x1][_0x59cb('0x61')]:undefined)||0x0}];default:return[];}}catch(_0x198c76){logger[_0x59cb('0x30')](_0x59cb('0x7b'),JSON[_0x59cb('0x7c')](_0x198c76));return[];}}exports[_0x59cb('0x7d')]=function(_0x1e1ae8,_0x2026bc,_0x34a041){if(_0x1e1ae8[_0x59cb('0x4e')]['id']){delete _0x1e1ae8['body']['id'];}return db['Dashboard'][_0x59cb('0x4d')]({'where':{'id':_0x1e1ae8[_0x59cb('0x49')]['id']}})[_0x59cb('0x2a')](handleEntityNotFound(_0x2026bc,null))[_0x59cb('0x2a')](function(_0x51484a){if(_0x51484a){_0x1e1ae8[_0x59cb('0x4e')]['DashboardId']=_0x51484a['id'];_0x1e1ae8[_0x59cb('0x4e')][_0x59cb('0x5e')]=widgetAttributes(_0x1e1ae8[_0x59cb('0x4e')]);return db[_0x59cb('0x7e')][_0x59cb('0x58')](_0x1e1ae8[_0x59cb('0x4e')]);}})['then'](respondWithResult(_0x2026bc,null))['catch'](handleError(_0x2026bc,null));};exports[_0x59cb('0x7f')]=function(_0x386028,_0xd7bb8e,_0x24a5e0){var _0x272b2d={};var _0x7020e7={};var _0x211e65;var _0x5c4eff;return db[_0x59cb('0x43')]['findOne']({'where':{'id':_0x386028['params']['id']}})[_0x59cb('0x2a')](handleEntityNotFound(_0xd7bb8e,null))[_0x59cb('0x2a')](function(_0x415136){if(_0x415136){_0x211e65=_0x415136;_0x7020e7[_0x59cb('0x39')]=_[_0x59cb('0x4b')](db['DashboardItem'][_0x59cb('0x4a')]);_0x7020e7[_0x59cb('0x36')]=_[_0x59cb('0x4b')](_0x386028[_0x59cb('0x36')]);_0x7020e7[_0x59cb('0x37')]=_[_0x59cb('0x38')](_0x7020e7[_0x59cb('0x39')],_0x7020e7['query']);_0x272b2d[_0x59cb('0x3a')]=_[_0x59cb('0x38')](_0x7020e7[_0x59cb('0x39')],qs['fields'](_0x386028[_0x59cb('0x36')][_0x59cb('0x3b')]));_0x272b2d[_0x59cb('0x3a')]=_0x272b2d[_0x59cb('0x3a')]['length']?_0x272b2d[_0x59cb('0x3a')]:_0x7020e7[_0x59cb('0x39')];_0x272b2d['order']=qs[_0x59cb('0x3e')](_0x386028['query'][_0x59cb('0x3e')]);_0x272b2d[_0x59cb('0x40')]=qs[_0x59cb('0x37')](_[_0x59cb('0x80')](_0x386028[_0x59cb('0x36')],_0x7020e7[_0x59cb('0x37')]));if(_0x386028['query']['filter']){_0x272b2d['where']=_[_0x59cb('0x41')](_0x272b2d['where'],{'$or':_[_0x59cb('0x35')](_0x272b2d[_0x59cb('0x3a')],function(_0x27dd84){var _0x2c09df={};_0x2c09df[_0x27dd84]={'$like':'%'+_0x386028['query'][_0x59cb('0x3f')]+'%'};return _0x2c09df;})});}_0x272b2d=_[_0x59cb('0x41')]({},_0x272b2d,_0x386028[_0x59cb('0x42')]);return _0x211e65['getItems'](_0x272b2d);}})[_0x59cb('0x2a')](function(_0x114b75){if(_0x114b75){_0x5c4eff=_0x114b75[_0x59cb('0x4c')];if(!_0x386028['query'][_0x59cb('0x81')](_0x59cb('0x3c'))){_0x272b2d['limit']=qs[_0x59cb('0x20')](_0x386028[_0x59cb('0x36')]['limit']);_0x272b2d[_0x59cb('0x1f')]=qs['offset'](_0x386028['query'][_0x59cb('0x1f')]);}return _0x211e65[_0x59cb('0x7f')](_0x272b2d);}})[_0x59cb('0x2a')](function(_0x29d3d2){if(_0x29d3d2){return _0x29d3d2?{'count':_0x5c4eff,'rows':_0x29d3d2}:null;}})[_0x59cb('0x2a')](respondWithResult(_0xd7bb8e,null))[_0x59cb('0x47')](handleError(_0xd7bb8e,null));}; \ No newline at end of file +var _0xb847=['intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','params','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','getItems','findOne','order','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','get','error','stack','name','send','index','map','Dashboard','rawAttributes','type','key','model','query','keys','filters'];(function(_0x15715c,_0x313aa5){var _0x1c3906=function(_0x235727){while(--_0x235727){_0x15715c['push'](_0x15715c['shift']());}};_0x1c3906(++_0x313aa5);}(_0xb847,0x1cb));var _0x7b84=function(_0x54501d,_0x42e8a6){_0x54501d=_0x54501d-0x0;var _0x2b9b2c=_0xb847[_0x54501d];return _0x2b9b2c;};'use strict';var emlformat=require(_0x7b84('0x0'));var rimraf=require(_0x7b84('0x1'));var zipdir=require(_0x7b84('0x2'));var jsonpatch=require(_0x7b84('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7b84('0x4'));var Mustache=require(_0x7b84('0x5'));var util=require('util');var path=require(_0x7b84('0x6'));var sox=require(_0x7b84('0x7'));var csv=require(_0x7b84('0x8'));var ejs=require(_0x7b84('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b84('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7b84('0xb'));var deskjs=require(_0x7b84('0xc'));var toCsv=require(_0x7b84('0x8'));var querystring=require(_0x7b84('0xd'));var Papa=require(_0x7b84('0xe'));var Redis=require('ioredis');var authService=require(_0x7b84('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7b84('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b84('0x11'))(_0x7b84('0x12'));var utils=require('../../config/utils');var config=require(_0x7b84('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x7b84('0x14')]=_[_0x7b84('0x15')](config[_0x7b84('0x14')],{'host':_0x7b84('0x16'),'port':0x18eb});var socket=require(_0x7b84('0x17'))(new Redis(config[_0x7b84('0x14')]));require('./dashboard.socket')[_0x7b84('0x18')](socket);function respondWithStatusCode(_0x27ea10,_0x28364a){_0x28364a=_0x28364a||0xcc;return function(_0x213953){if(_0x213953){return _0x27ea10[_0x7b84('0x19')](_0x28364a);}return _0x27ea10[_0x7b84('0x1a')](_0x28364a)[_0x7b84('0x1b')]();};}function respondWithResult(_0x2d0348,_0x3a7ab9){_0x3a7ab9=_0x3a7ab9||0xc8;return function(_0x19b239){if(_0x19b239){return _0x2d0348['status'](_0x3a7ab9)[_0x7b84('0x1c')](_0x19b239);}};}function respondWithFilteredResult(_0x4a19da,_0x59b31d){return function(_0x5d70ea){if(_0x5d70ea){var _0x463703=typeof _0x59b31d[_0x7b84('0x1d')]===_0x7b84('0x1e')&&typeof _0x59b31d[_0x7b84('0x1f')]===_0x7b84('0x1e');var _0x39cae9=_0x5d70ea[_0x7b84('0x20')];var _0x14c5f8=_0x463703?0x0:_0x59b31d[_0x7b84('0x1d')];var _0x425d40=_0x463703?_0x5d70ea[_0x7b84('0x20')]:_0x59b31d[_0x7b84('0x1d')]+_0x59b31d[_0x7b84('0x1f')];var _0x45ebc8;if(_0x425d40>=_0x39cae9){_0x425d40=_0x39cae9;_0x45ebc8=0xc8;}else{_0x45ebc8=0xce;}_0x4a19da[_0x7b84('0x1a')](_0x45ebc8);return _0x4a19da[_0x7b84('0x21')]('Content-Range',_0x14c5f8+'-'+_0x425d40+'/'+_0x39cae9)[_0x7b84('0x1c')](_0x5d70ea);}return null;};}function patchUpdates(_0x2aa9f0){return function(_0x5f5c53){try{jsonpatch['apply'](_0x5f5c53,_0x2aa9f0,!![]);}catch(_0x3889ce){return BPromise[_0x7b84('0x22')](_0x3889ce);}return _0x5f5c53['save']();};}function saveUpdates(_0x1417a7,_0x94ed73){return function(_0x2a6a1c){if(_0x2a6a1c){return _0x2a6a1c[_0x7b84('0x23')](_0x1417a7)[_0x7b84('0x24')](function(_0x283a7e){return _0x283a7e;});}return null;};}function removeEntity(_0x48b775,_0x1f60c6){return function(_0x12719a){if(_0x12719a){return _0x12719a[_0x7b84('0x25')]()['then'](function(){var _0x1d835c=_0x12719a[_0x7b84('0x26')]({'plain':!![]});var _0x418c8d='CustomDashboards';return db['UserProfileResource'][_0x7b84('0x25')]({'where':{'type':_0x418c8d,'resourceId':_0x1d835c['id']}})[_0x7b84('0x24')](function(){return _0x12719a;});})[_0x7b84('0x24')](function(){_0x48b775[_0x7b84('0x1a')](0xcc)[_0x7b84('0x1b')]();});}};}function handleEntityNotFound(_0x86df1f,_0x5b5752){return function(_0x2c21ad){if(!_0x2c21ad){_0x86df1f[_0x7b84('0x19')](0x194);}return _0x2c21ad;};}function handleError(_0xaf9671,_0x2c0f32){_0x2c0f32=_0x2c0f32||0x1f4;return function(_0x223eb7){logger[_0x7b84('0x27')](_0x223eb7[_0x7b84('0x28')]);if(_0x223eb7[_0x7b84('0x29')]){delete _0x223eb7[_0x7b84('0x29')];}_0xaf9671[_0x7b84('0x1a')](_0x2c0f32)[_0x7b84('0x2a')](_0x223eb7);};}exports[_0x7b84('0x2b')]=function(_0x329cf3,_0x249db6){var _0x11f92b={},_0x43dcd4={},_0x763232={'count':0x0,'rows':[]};var _0x107ed1=_[_0x7b84('0x2c')](db[_0x7b84('0x2d')][_0x7b84('0x2e')],function(_0x3c824a){return{'name':_0x3c824a['fieldName'],'type':_0x3c824a[_0x7b84('0x2f')][_0x7b84('0x30')]};});_0x43dcd4[_0x7b84('0x31')]=_[_0x7b84('0x2c')](_0x107ed1,_0x7b84('0x29'));_0x43dcd4[_0x7b84('0x32')]=_[_0x7b84('0x33')](_0x329cf3[_0x7b84('0x32')]);_0x43dcd4[_0x7b84('0x34')]=_[_0x7b84('0x35')](_0x43dcd4[_0x7b84('0x31')],_0x43dcd4['query']);_0x11f92b[_0x7b84('0x36')]=_['intersection'](_0x43dcd4[_0x7b84('0x31')],qs[_0x7b84('0x37')](_0x329cf3[_0x7b84('0x32')]['fields']));_0x11f92b['attributes']=_0x11f92b[_0x7b84('0x36')][_0x7b84('0x38')]?_0x11f92b[_0x7b84('0x36')]:_0x43dcd4[_0x7b84('0x31')];if(!_0x329cf3['query'][_0x7b84('0x39')](_0x7b84('0x3a'))){_0x11f92b[_0x7b84('0x1f')]=qs[_0x7b84('0x1f')](_0x329cf3['query'][_0x7b84('0x1f')]);_0x11f92b['offset']=qs[_0x7b84('0x1d')](_0x329cf3[_0x7b84('0x32')][_0x7b84('0x1d')]);}_0x11f92b['order']=qs[_0x7b84('0x3b')](_0x329cf3['query'][_0x7b84('0x3b')]);_0x11f92b[_0x7b84('0x3c')]=qs[_0x7b84('0x34')](_[_0x7b84('0x3d')](_0x329cf3[_0x7b84('0x32')],_0x43dcd4[_0x7b84('0x34')]),_0x107ed1);if(_0x329cf3[_0x7b84('0x32')][_0x7b84('0x3e')]){_0x11f92b[_0x7b84('0x3c')]=_[_0x7b84('0x3f')](_0x11f92b[_0x7b84('0x3c')],{'$or':_[_0x7b84('0x2c')](_0x107ed1,function(_0x16a340){if(_0x16a340['type']!==_0x7b84('0x40')){var _0x318b9a={};_0x318b9a[_0x16a340[_0x7b84('0x29')]]={'$like':'%'+_0x329cf3[_0x7b84('0x32')]['filter']+'%'};return _0x318b9a;}})});}_0x11f92b=_[_0x7b84('0x3f')]({},_0x11f92b,_0x329cf3[_0x7b84('0x41')]);var _0x1a71a6={'where':_0x11f92b['where']};return db[_0x7b84('0x2d')][_0x7b84('0x20')](_0x1a71a6)['then'](function(_0xf61f50){_0x763232['count']=_0xf61f50;if(_0x329cf3[_0x7b84('0x32')][_0x7b84('0x42')]){_0x11f92b['include']=[{'all':!![]}];}return db['Dashboard'][_0x7b84('0x43')](_0x11f92b);})[_0x7b84('0x24')](function(_0x344def){_0x763232['rows']=_0x344def;return _0x763232;})[_0x7b84('0x24')](respondWithFilteredResult(_0x249db6,_0x11f92b))[_0x7b84('0x44')](handleError(_0x249db6,null));};exports[_0x7b84('0x45')]=function(_0x321ffb,_0x290ee7){var _0x3988d1={'raw':![],'where':{'id':_0x321ffb['params']['id']}},_0x34589b={};_0x34589b[_0x7b84('0x31')]=_[_0x7b84('0x33')](db[_0x7b84('0x2d')][_0x7b84('0x2e')]);_0x34589b[_0x7b84('0x32')]=_['keys'](_0x321ffb[_0x7b84('0x32')]);_0x34589b['filters']=_[_0x7b84('0x35')](_0x34589b[_0x7b84('0x31')],_0x34589b[_0x7b84('0x32')]);_0x3988d1['attributes']=_[_0x7b84('0x35')](_0x34589b['model'],qs[_0x7b84('0x37')](_0x321ffb['query'][_0x7b84('0x37')]));_0x3988d1[_0x7b84('0x36')]=_0x3988d1[_0x7b84('0x36')][_0x7b84('0x38')]?_0x3988d1['attributes']:_0x34589b['model'];if(_0x321ffb[_0x7b84('0x32')][_0x7b84('0x42')]){_0x3988d1[_0x7b84('0x46')]=[{'all':!![]}];}_0x3988d1=_[_0x7b84('0x3f')]({},_0x3988d1,_0x321ffb[_0x7b84('0x41')]);return db[_0x7b84('0x2d')][_0x7b84('0x47')](_0x3988d1)[_0x7b84('0x24')](handleEntityNotFound(_0x290ee7,null))[_0x7b84('0x24')](respondWithResult(_0x290ee7,null))[_0x7b84('0x44')](handleError(_0x290ee7,null));};exports[_0x7b84('0x48')]=function(_0x2c1316,_0xf3015e){return db[_0x7b84('0x2d')][_0x7b84('0x48')](_0x2c1316[_0x7b84('0x49')],{})[_0x7b84('0x24')](function(_0x2dd0c0){var _0x1c021f=_0x2c1316[_0x7b84('0x4a')][_0x7b84('0x26')]({'plain':!![]});if(!_0x1c021f)throw new Error(_0x7b84('0x4b'));if(_0x1c021f[_0x7b84('0x4c')]===_0x7b84('0x4a')){var _0x2a811a=_0x2dd0c0[_0x7b84('0x26')]({'plain':!![]});var _0x19c5ed=_0x7b84('0x4d');return db[_0x7b84('0x4e')][_0x7b84('0x47')]({'where':{'name':_0x19c5ed,'userProfileId':_0x1c021f[_0x7b84('0x4f')]},'raw':!![]})[_0x7b84('0x24')](function(_0x5e48cf){if(_0x5e48cf&&_0x5e48cf[_0x7b84('0x50')]===0x0){return db[_0x7b84('0x51')][_0x7b84('0x48')]({'name':_0x2a811a[_0x7b84('0x29')],'resourceId':_0x2a811a['id'],'type':_0x5e48cf[_0x7b84('0x29')],'sectionId':_0x5e48cf['id']},{})[_0x7b84('0x24')](function(){return _0x2dd0c0;});}else{return _0x2dd0c0;}})[_0x7b84('0x44')](function(_0x49c48c){logger[_0x7b84('0x27')](_0x7b84('0x52'),_0x49c48c);throw _0x49c48c;});}return _0x2dd0c0;})[_0x7b84('0x24')](respondWithResult(_0xf3015e,0xc9))[_0x7b84('0x44')](handleError(_0xf3015e,null));};exports[_0x7b84('0x53')]=function(_0x34f4ad,_0x56c4ad){var _0x2067b0={'where':{'id':_0x34f4ad['params']['id']}},_0x5affaf={};_0x5affaf['model']=_['keys'](db['Dashboard']['rawAttributes']);_0x2067b0['attributes']=_[_0x7b84('0x35')](_0x5affaf[_0x7b84('0x31')],qs['fields'](_0x34f4ad['query'][_0x7b84('0x37')]));_0x2067b0['attributes']=_0x2067b0['attributes']['length']?_0x2067b0[_0x7b84('0x36')]:_0x5affaf[_0x7b84('0x31')];if(_0x34f4ad[_0x7b84('0x32')][_0x7b84('0x42')]){_0x2067b0['include']=[{'all':!![]}];}_0x2067b0=_[_0x7b84('0x3f')]({},_0x2067b0,_0x34f4ad['options']);return db['Dashboard'][_0x7b84('0x47')](_0x2067b0)['then'](handleEntityNotFound(_0x56c4ad,null))[_0x7b84('0x24')](function(_0x552b7b){if(_0x552b7b){var _0x43dc41=_0x552b7b[_0x7b84('0x26')]({'plain':!![]});_0x43dc41=qs[_0x7b84('0x54')](_0x43dc41,['id','createdAt',_0x7b84('0x55')]);_0x34f4ad[_0x7b84('0x49')]=_[_0x7b84('0x54')](_0x34f4ad[_0x7b84('0x49')],['id',_0x7b84('0x56'),_0x7b84('0x55')]);return db[_0x7b84('0x2d')][_0x7b84('0x48')](_[_0x7b84('0x3f')](_0x43dc41,_0x34f4ad[_0x7b84('0x49')]),{'include':_0x34f4ad['query']['includeAll']?[{'all':!![]}]:undefined})[_0x7b84('0x24')](function(_0x530e8f){var _0x477ccd=_0x34f4ad[_0x7b84('0x4a')]['get']({'plain':!![]});if(!_0x477ccd)throw new Error(_0x7b84('0x4b'));if(_0x477ccd[_0x7b84('0x4c')]==='user'){var _0x2cb1df=_0x530e8f['get']({'plain':!![]});var _0x359024=_0x7b84('0x4d');return db[_0x7b84('0x4e')][_0x7b84('0x47')]({'where':{'name':_0x359024,'userProfileId':_0x477ccd[_0x7b84('0x4f')]},'raw':!![]})[_0x7b84('0x24')](function(_0x2fa76e){if(_0x2fa76e&&_0x2fa76e[_0x7b84('0x50')]===0x0){return db[_0x7b84('0x51')][_0x7b84('0x48')]({'name':_0x2cb1df[_0x7b84('0x29')],'resourceId':_0x2cb1df['id'],'type':_0x2fa76e[_0x7b84('0x29')],'sectionId':_0x2fa76e['id']},{})[_0x7b84('0x24')](function(){return _0x530e8f;});}else{return _0x530e8f;}})[_0x7b84('0x44')](function(_0x5b10e1){logger[_0x7b84('0x27')](_0x7b84('0x52'),_0x5b10e1);throw _0x5b10e1;});}return _0x530e8f;});}})['then'](respondWithResult(_0x56c4ad,0xc9))[_0x7b84('0x44')](handleError(_0x56c4ad,null));};exports[_0x7b84('0x23')]=function(_0x2f9cdd,_0x5a583e){if(_0x2f9cdd[_0x7b84('0x49')]['id']){delete _0x2f9cdd[_0x7b84('0x49')]['id'];}return db['Dashboard'][_0x7b84('0x47')]({'where':{'id':_0x2f9cdd[_0x7b84('0x57')]['id']}})[_0x7b84('0x24')](handleEntityNotFound(_0x5a583e,null))[_0x7b84('0x24')](saveUpdates(_0x2f9cdd['body'],null))[_0x7b84('0x24')](respondWithResult(_0x5a583e,null))[_0x7b84('0x44')](handleError(_0x5a583e,null));};exports[_0x7b84('0x25')]=function(_0x2d704d,_0x2e36be){return db[_0x7b84('0x2d')]['find']({'where':{'id':_0x2d704d['params']['id']}})[_0x7b84('0x24')](handleEntityNotFound(_0x2e36be,null))[_0x7b84('0x24')](removeEntity(_0x2e36be,null))['catch'](handleError(_0x2e36be,null));};function widgetAttributes(_0x378675){try{switch(_0x378675[_0x7b84('0x2f')]){case _0x7b84('0x58'):return[{'name':_0x7b84('0x59'),'value':_0x378675[_0x7b84('0x59')]||(_0x378675[_0x7b84('0x5a')]&&_0x378675['attrs'][0x0]?_0x378675[_0x7b84('0x5a')][0x0][_0x7b84('0x5b')]:undefined)||'https://'}];case _0x7b84('0x5c'):return[{'name':_0x7b84('0x5d'),'value':_0x378675[_0x7b84('0x5d')]||(_0x378675[_0x7b84('0x5a')]&&_0x378675[_0x7b84('0x5a')][0x0]?_0x378675[_0x7b84('0x5a')][0x0][_0x7b84('0x5b')]:undefined)||''}];case _0x7b84('0x5e'):return[{'name':_0x7b84('0x5f'),'value':_0x378675[_0x7b84('0x5f')]||(_0x378675[_0x7b84('0x5a')]&&_0x378675[_0x7b84('0x5a')][0x0]?_0x378675[_0x7b84('0x5a')][0x0][_0x7b84('0x5b')]:undefined)||_0x7b84('0x60')},{'name':_0x7b84('0x61'),'value':_0x378675[_0x7b84('0x61')]||(_0x378675[_0x7b84('0x5a')]&&_0x378675['attrs'][0x1]?_0x378675[_0x7b84('0x5a')][0x1][_0x7b84('0x5b')]:undefined)||_0x7b84('0x62')},{'name':_0x7b84('0x63'),'value':_0x378675['attrFontSize']||(_0x378675[_0x7b84('0x5a')]&&_0x378675[_0x7b84('0x5a')][0x2]?_0x378675[_0x7b84('0x5a')][0x2][_0x7b84('0x5b')]:undefined)||0xc}];case _0x7b84('0x64'):return[{'name':_0x7b84('0x65'),'value':_0x378675[_0x7b84('0x65')]||(_0x378675[_0x7b84('0x5a')]&&_0x378675[_0x7b84('0x5a')][0x0]?_0x378675['attrs'][0x0][_0x7b84('0x5b')]:undefined)||_0x7b84('0x66')},{'name':_0x7b84('0x67'),'value':_0x378675[_0x7b84('0x67')]||(_0x378675[_0x7b84('0x5a')]&&_0x378675[_0x7b84('0x5a')][0x1]?_0x378675[_0x7b84('0x5a')][0x1][_0x7b84('0x5b')]:undefined)||[]},{'name':_0x7b84('0x63'),'value':_0x378675[_0x7b84('0x63')]||(_0x378675[_0x7b84('0x5a')]&&_0x378675[_0x7b84('0x5a')][0x2]?_0x378675['attrs'][0x2][_0x7b84('0x5b')]:undefined)||0x14},{'name':'attrChannel','value':_0x378675[_0x7b84('0x68')]||(_0x378675[_0x7b84('0x5a')]&&_0x378675[_0x7b84('0x5a')][0x3]?_0x378675[_0x7b84('0x5a')][0x3]['value']:undefined)||_0x7b84('0x69')},{'name':'attrEmailAccounts','value':_0x378675[_0x7b84('0x6a')]||(_0x378675[_0x7b84('0x5a')]&&_0x378675[_0x7b84('0x5a')][0x4]?_0x378675[_0x7b84('0x5a')][0x4][_0x7b84('0x5b')]:undefined)||''},{'name':_0x7b84('0x6b'),'value':_0x378675[_0x7b84('0x6b')]||(_0x378675[_0x7b84('0x5a')]&&_0x378675[_0x7b84('0x5a')][0x5]?_0x378675[_0x7b84('0x5a')][0x5][_0x7b84('0x5b')]:undefined)||''},{'name':_0x7b84('0x6c'),'value':_0x378675[_0x7b84('0x6c')]||(_0x378675[_0x7b84('0x5a')]&&_0x378675['attrs'][0x6]?_0x378675[_0x7b84('0x5a')][0x6][_0x7b84('0x5b')]:undefined)||''},{'name':_0x7b84('0x6d'),'value':_0x378675[_0x7b84('0x6d')]||(_0x378675[_0x7b84('0x5a')]&&_0x378675[_0x7b84('0x5a')][0x7]?_0x378675[_0x7b84('0x5a')][0x7][_0x7b84('0x5b')]:undefined)||''},{'name':_0x7b84('0x6e'),'value':_0x378675[_0x7b84('0x6e')]||(_0x378675[_0x7b84('0x5a')]&&_0x378675[_0x7b84('0x5a')][0x8]?_0x378675[_0x7b84('0x5a')][0x8][_0x7b84('0x5b')]:undefined)||''},{'name':_0x7b84('0x6f'),'value':_0x378675[_0x7b84('0x6f')]||(_0x378675['attrs']&&_0x378675[_0x7b84('0x5a')][0x9]?_0x378675['attrs'][0x9][_0x7b84('0x5b')]:undefined)||''}];case _0x7b84('0x70'):case _0x7b84('0x71'):return[{'name':_0x7b84('0x72'),'value':_0x378675['attrSerie1']||(_0x378675[_0x7b84('0x5a')]&&_0x378675['attrs'][0x0]?_0x378675['attrs'][0x0][_0x7b84('0x5b')]:undefined)||_0x7b84('0x66')},{'name':_0x7b84('0x73'),'value':_0x378675['attrSerie2']||(_0x378675['attrs']&&_0x378675[_0x7b84('0x5a')][0x1]?_0x378675[_0x7b84('0x5a')][0x1][_0x7b84('0x5b')]:undefined)||null},{'name':_0x7b84('0x74'),'value':_0x378675[_0x7b84('0x74')]||(_0x378675[_0x7b84('0x5a')]&&_0x378675[_0x7b84('0x5a')][0x2]?_0x378675[_0x7b84('0x5a')][0x2]['value']:undefined)||null},{'name':_0x7b84('0x67'),'value':_0x378675[_0x7b84('0x67')]||(_0x378675['attrs']&&_0x378675[_0x7b84('0x5a')][0x3]?_0x378675['attrs'][0x3][_0x7b84('0x5b')]:undefined)||[]},{'name':_0x7b84('0x68'),'value':_0x378675[_0x7b84('0x68')]||(_0x378675[_0x7b84('0x5a')]&&_0x378675[_0x7b84('0x5a')][0x4]?_0x378675[_0x7b84('0x5a')][0x4][_0x7b84('0x5b')]:undefined)||_0x7b84('0x69')},{'name':'attrEmailAccounts','value':_0x378675['attrEmailAccounts']||(_0x378675[_0x7b84('0x5a')]&&_0x378675['attrs'][0x5]?_0x378675[_0x7b84('0x5a')][0x5][_0x7b84('0x5b')]:undefined)||''},{'name':_0x7b84('0x6b'),'value':_0x378675[_0x7b84('0x6b')]||(_0x378675[_0x7b84('0x5a')]&&_0x378675['attrs'][0x6]?_0x378675[_0x7b84('0x5a')][0x6][_0x7b84('0x5b')]:undefined)||''},{'name':_0x7b84('0x6c'),'value':_0x378675[_0x7b84('0x6c')]||(_0x378675[_0x7b84('0x5a')]&&_0x378675[_0x7b84('0x5a')][0x7]?_0x378675[_0x7b84('0x5a')][0x7][_0x7b84('0x5b')]:undefined)||''},{'name':_0x7b84('0x6d'),'value':_0x378675['attrOpenchannelAccounts']||(_0x378675[_0x7b84('0x5a')]&&_0x378675[_0x7b84('0x5a')][0x8]?_0x378675['attrs'][0x8][_0x7b84('0x5b')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x378675[_0x7b84('0x6e')]||(_0x378675['attrs']&&_0x378675['attrs'][0x9]?_0x378675['attrs'][0x9][_0x7b84('0x5b')]:undefined)||''},{'name':_0x7b84('0x6f'),'value':_0x378675['attrChatWebsites']||(_0x378675[_0x7b84('0x5a')]&&_0x378675[_0x7b84('0x5a')][0xa]?_0x378675[_0x7b84('0x5a')][0xa][_0x7b84('0x5b')]:undefined)||''}];case _0x7b84('0x75'):return[{'name':_0x7b84('0x76'),'type':_0x378675[_0x7b84('0x77')]||(_0x378675['attrs']&&_0x378675['attrs'][0x0]?_0x378675[_0x7b84('0x5a')][0x0]['type']:undefined)||null,'value':_0x378675['attrReport']||(_0x378675['attrs']&&_0x378675[_0x7b84('0x5a')][0x0]?_0x378675[_0x7b84('0x5a')][0x0][_0x7b84('0x5b')]:undefined)||null},{'name':_0x7b84('0x78'),'value':_0x378675[_0x7b84('0x78')]||(_0x378675[_0x7b84('0x5a')]&&_0x378675['attrs'][0x1]?_0x378675['attrs'][0x1][_0x7b84('0x5b')]:undefined)||0x0}];default:return[];}}catch(_0xf0fd7c){logger[_0x7b84('0x27')](_0x7b84('0x79'),JSON[_0x7b84('0x7a')](_0xf0fd7c));return[];}}exports['addItem']=function(_0x24aea4,_0xd96842,_0x45c418){if(_0x24aea4['body']['id']){delete _0x24aea4[_0x7b84('0x49')]['id'];}return db[_0x7b84('0x2d')][_0x7b84('0x47')]({'where':{'id':_0x24aea4[_0x7b84('0x57')]['id']}})[_0x7b84('0x24')](handleEntityNotFound(_0xd96842,null))[_0x7b84('0x24')](function(_0x3970f2){if(_0x3970f2){_0x24aea4[_0x7b84('0x49')][_0x7b84('0x7b')]=_0x3970f2['id'];_0x24aea4[_0x7b84('0x49')]['attrs']=widgetAttributes(_0x24aea4[_0x7b84('0x49')]);return db[_0x7b84('0x7c')][_0x7b84('0x48')](_0x24aea4[_0x7b84('0x49')]);}})[_0x7b84('0x24')](respondWithResult(_0xd96842,null))[_0x7b84('0x44')](handleError(_0xd96842,null));};exports[_0x7b84('0x7d')]=function(_0x58ebbb,_0x444a73,_0x81487){var _0xc2603e={};var _0x55b4c1={};var _0x23cc6f;var _0x3f15ea;return db['Dashboard'][_0x7b84('0x7e')]({'where':{'id':_0x58ebbb[_0x7b84('0x57')]['id']}})[_0x7b84('0x24')](handleEntityNotFound(_0x444a73,null))[_0x7b84('0x24')](function(_0x233d41){if(_0x233d41){_0x23cc6f=_0x233d41;_0x55b4c1[_0x7b84('0x31')]=_[_0x7b84('0x33')](db[_0x7b84('0x7c')][_0x7b84('0x2e')]);_0x55b4c1[_0x7b84('0x32')]=_[_0x7b84('0x33')](_0x58ebbb[_0x7b84('0x32')]);_0x55b4c1['filters']=_[_0x7b84('0x35')](_0x55b4c1[_0x7b84('0x31')],_0x55b4c1[_0x7b84('0x32')]);_0xc2603e[_0x7b84('0x36')]=_['intersection'](_0x55b4c1[_0x7b84('0x31')],qs[_0x7b84('0x37')](_0x58ebbb['query'][_0x7b84('0x37')]));_0xc2603e[_0x7b84('0x36')]=_0xc2603e['attributes'][_0x7b84('0x38')]?_0xc2603e['attributes']:_0x55b4c1[_0x7b84('0x31')];_0xc2603e[_0x7b84('0x7f')]=qs['sort'](_0x58ebbb[_0x7b84('0x32')][_0x7b84('0x3b')]);_0xc2603e[_0x7b84('0x3c')]=qs[_0x7b84('0x34')](_['pick'](_0x58ebbb[_0x7b84('0x32')],_0x55b4c1[_0x7b84('0x34')]));if(_0x58ebbb[_0x7b84('0x32')][_0x7b84('0x3e')]){_0xc2603e[_0x7b84('0x3c')]=_[_0x7b84('0x3f')](_0xc2603e[_0x7b84('0x3c')],{'$or':_[_0x7b84('0x2c')](_0xc2603e[_0x7b84('0x36')],function(_0x29b948){var _0x3033d4={};_0x3033d4[_0x29b948]={'$like':'%'+_0x58ebbb[_0x7b84('0x32')][_0x7b84('0x3e')]+'%'};return _0x3033d4;})});}_0xc2603e=_['merge']({},_0xc2603e,_0x58ebbb[_0x7b84('0x41')]);return _0x23cc6f[_0x7b84('0x7d')](_0xc2603e);}})[_0x7b84('0x24')](function(_0x4630a6){if(_0x4630a6){_0x3f15ea=_0x4630a6[_0x7b84('0x38')];if(!_0x58ebbb[_0x7b84('0x32')][_0x7b84('0x39')](_0x7b84('0x3a'))){_0xc2603e[_0x7b84('0x1f')]=qs[_0x7b84('0x1f')](_0x58ebbb[_0x7b84('0x32')][_0x7b84('0x1f')]);_0xc2603e['offset']=qs[_0x7b84('0x1d')](_0x58ebbb[_0x7b84('0x32')][_0x7b84('0x1d')]);}return _0x23cc6f[_0x7b84('0x7d')](_0xc2603e);}})[_0x7b84('0x24')](function(_0xa5aa71){if(_0xa5aa71){return _0xa5aa71?{'count':_0x3f15ea,'rows':_0xa5aa71}:null;}})[_0x7b84('0x24')](respondWithResult(_0x444a73,null))[_0x7b84('0x44')](handleError(_0x444a73,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 88c401b..7a54e65 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 _0xbaee=['events','../../mysqldb','Dashboard','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0xd816e2,_0x5edac2){var _0x1f5924=function(_0x1bcbf0){while(--_0x1bcbf0){_0xd816e2['push'](_0xd816e2['shift']());}};_0x1f5924(++_0x5edac2);}(_0xbaee,0x186));var _0xebae=function(_0x2b3a0f,_0x3c248d){_0x2b3a0f=_0x2b3a0f-0x0;var _0x2972f0=_0xbaee[_0x2b3a0f];return _0x2972f0;};'use strict';var EventEmitter=require(_0xebae('0x0'));var Dashboard=require(_0xebae('0x1'))['db'][_0xebae('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xebae('0x3')](0x0);var events={'afterCreate':_0xebae('0x4'),'afterUpdate':_0xebae('0x5'),'afterDestroy':'remove'};function emitEvent(_0x852542){return function(_0x3d84af,_0x5475b7,_0x548d4c){DashboardEvents[_0xebae('0x6')](_0x852542+':'+_0x3d84af['id'],_0x3d84af);DashboardEvents['emit'](_0x852542,_0x3d84af);_0x548d4c(null);};}for(var e in events){if(events[_0xebae('0x7')](e)){var event=events[e];Dashboard[_0xebae('0x8')](e,emitEvent(event));}}module[_0xebae('0x9')]=DashboardEvents; \ No newline at end of file +var _0x27fa=['exports','events','../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit','hook'];(function(_0x4c1b4e,_0x378bd9){var _0x5e91a5=function(_0x2bf887){while(--_0x2bf887){_0x4c1b4e['push'](_0x4c1b4e['shift']());}};_0x5e91a5(++_0x378bd9);}(_0x27fa,0x1c3));var _0xa27f=function(_0x14c005,_0x26bdf8){_0x14c005=_0x14c005-0x0;var _0x36ab21=_0x27fa[_0x14c005];return _0x36ab21;};'use strict';var EventEmitter=require(_0xa27f('0x0'));var Dashboard=require(_0xa27f('0x1'))['db'][_0xa27f('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xa27f('0x3')](0x0);var events={'afterCreate':_0xa27f('0x4'),'afterUpdate':_0xa27f('0x5'),'afterDestroy':_0xa27f('0x6')};function emitEvent(_0x4dcaed){return function(_0x23a534,_0x2e7969,_0x67e744){DashboardEvents[_0xa27f('0x7')](_0x4dcaed+':'+_0x23a534['id'],_0x23a534);DashboardEvents[_0xa27f('0x7')](_0x4dcaed,_0x23a534);_0x67e744(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xa27f('0x8')](e,emitEvent(event));}}module[_0xa27f('0x9')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 94e0b6f..c425795 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 _0x3834=['define','Dashboard','dashboards','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes'];(function(_0x5cf125,_0x510d90){var _0x1448e5=function(_0x5957fa){while(--_0x5957fa){_0x5cf125['push'](_0x5cf125['shift']());}};_0x1448e5(++_0x510d90);}(_0x3834,0x71));var _0x4383=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3834[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x4383('0x0'));var moment=require(_0x4383('0x1'));var BPromise=require(_0x4383('0x2'));var rp=require(_0x4383('0x3'));var fs=require('fs');var path=require(_0x4383('0x4'));var rimraf=require(_0x4383('0x5'));var config=require(_0x4383('0x6'));var attributes=require(_0x4383('0x7'));module['exports']=function(_0x30eee5,_0x46fcb7){return _0x30eee5[_0x4383('0x8')](_0x4383('0x9'),attributes,{'tableName':_0x4383('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcdde=['request-promise','path','rimraf','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util','api','moment','bluebird'];(function(_0x538ef3,_0x13a572){var _0x4414c4=function(_0x2a3d2a){while(--_0x2a3d2a){_0x538ef3['push'](_0x538ef3['shift']());}};_0x4414c4(++_0x13a572);}(_0xcdde,0xd8));var _0xecdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdde[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xecdd('0x0'));var util=require(_0xecdd('0x1'));var logger=require('../../config/logger')(_0xecdd('0x2'));var moment=require(_0xecdd('0x3'));var BPromise=require(_0xecdd('0x4'));var rp=require(_0xecdd('0x5'));var fs=require('fs');var path=require(_0xecdd('0x6'));var rimraf=require(_0xecdd('0x7'));var config=require('../../config/environment');var attributes=require(_0xecdd('0x8'));module[_0xecdd('0x9')]=function(_0x4563c0,_0x2c4f43){return _0x4563c0[_0xecdd('0xa')](_0xecdd('0xb'),attributes,{'tableName':_0xecdd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 02c150a..93556f6 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 _0xb481=['http','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','request','then','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client'];(function(_0x3f3f36,_0x15c47e){var _0x549bda=function(_0xb25b45){while(--_0xb25b45){_0x3f3f36['push'](_0x3f3f36['shift']());}};_0x549bda(++_0x15c47e);}(_0xb481,0x197));var _0x1b48=function(_0x15667d,_0x17a7f7){_0x15667d=_0x15667d-0x0;var _0x3a61bc=_0xb481[_0x15667d];return _0x3a61bc;};'use strict';var _=require(_0x1b48('0x0'));var util=require(_0x1b48('0x1'));var moment=require(_0x1b48('0x2'));var BPromise=require(_0x1b48('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b48('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1b48('0x5'));var config=require(_0x1b48('0x6'));var jayson=require(_0x1b48('0x7'));var client=jayson[_0x1b48('0x8')][_0x1b48('0x9')]({'port':0x232a});config['redis']=_[_0x1b48('0xa')](config[_0x1b48('0xb')],{'host':_0x1b48('0xc'),'port':0x18eb});var socket=require(_0x1b48('0xd'))(new Redis(config[_0x1b48('0xb')]));require(_0x1b48('0xe'))['register'](socket);function respondWithRpcPromise(_0x134125,_0x38bf52,_0x42ab1e){return new BPromise(function(_0x2bf820,_0x2dc26c){return client[_0x1b48('0xf')](_0x134125,_0x42ab1e)[_0x1b48('0x10')](function(_0x4766a0){logger['info'](_0x1b48('0x11'),_0x38bf52,'request\x20sent');logger[_0x1b48('0x12')](_0x1b48('0x13'),_0x38bf52,_0x1b48('0x14'),JSON['stringify'](_0x4766a0));if(_0x4766a0[_0x1b48('0x15')]){if(_0x4766a0[_0x1b48('0x15')]['code']===0x1f4){logger['error'](_0x1b48('0x11'),_0x38bf52,_0x4766a0[_0x1b48('0x15')][_0x1b48('0x16')]);return _0x2dc26c(_0x4766a0[_0x1b48('0x15')]['message']);}logger['error'](_0x1b48('0x11'),_0x38bf52,_0x4766a0[_0x1b48('0x15')][_0x1b48('0x16')]);return _0x2bf820(_0x4766a0[_0x1b48('0x15')][_0x1b48('0x16')]);}else{logger[_0x1b48('0x17')]('Dashboard,\x20%s,\x20%s',_0x38bf52,_0x1b48('0x14'));_0x2bf820(_0x4766a0[_0x1b48('0x18')]['message']);}})[_0x1b48('0x19')](function(_0x1714cf){logger[_0x1b48('0x15')]('Dashboard,\x20%s,\x20%s',_0x38bf52,_0x1714cf);_0x2dc26c(_0x1714cf);});});} \ No newline at end of file +var _0x90d2=['stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','Dashboard,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x90d2,0x18c));var _0x290d=function(_0x4d50a1,_0x188247){_0x4d50a1=_0x4d50a1-0x0;var _0x2d733f=_0x90d2[_0x4d50a1];return _0x2d733f;};'use strict';var _=require(_0x290d('0x0'));var util=require(_0x290d('0x1'));var moment=require(_0x290d('0x2'));var BPromise=require(_0x290d('0x3'));var rs=require(_0x290d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x290d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x290d('0x6'))(_0x290d('0x7'));var config=require(_0x290d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x290d('0x9')]({'port':0x232a});config[_0x290d('0xa')]=_[_0x290d('0xb')](config[_0x290d('0xa')],{'host':_0x290d('0xc'),'port':0x18eb});var socket=require(_0x290d('0xd'))(new Redis(config[_0x290d('0xa')]));require(_0x290d('0xe'))[_0x290d('0xf')](socket);function respondWithRpcPromise(_0x1a60b9,_0x1b2589,_0x182b82){return new BPromise(function(_0x56054c,_0x16a191){return client[_0x290d('0x10')](_0x1a60b9,_0x182b82)[_0x290d('0x11')](function(_0xc7734f){logger['info'](_0x290d('0x12'),_0x1b2589,'request\x20sent');logger['debug']('Dashboard,\x20%s,\x20%s,\x20%s',_0x1b2589,_0x290d('0x13'),JSON[_0x290d('0x14')](_0xc7734f));if(_0xc7734f['error']){if(_0xc7734f[_0x290d('0x15')]['code']===0x1f4){logger[_0x290d('0x15')]('Dashboard,\x20%s,\x20%s',_0x1b2589,_0xc7734f[_0x290d('0x15')][_0x290d('0x16')]);return _0x16a191(_0xc7734f[_0x290d('0x15')]['message']);}logger[_0x290d('0x15')](_0x290d('0x12'),_0x1b2589,_0xc7734f[_0x290d('0x15')][_0x290d('0x16')]);return _0x56054c(_0xc7734f[_0x290d('0x15')]['message']);}else{logger[_0x290d('0x17')](_0x290d('0x12'),_0x1b2589,_0x290d('0x13'));_0x56054c(_0xc7734f[_0x290d('0x18')]['message']);}})[_0x290d('0x19')](function(_0x4667fa){logger[_0x290d('0x15')](_0x290d('0x12'),_0x1b2589,_0x4667fa);_0x16a191(_0x4667fa);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 05fd666..6126e69 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 _0x9ea9=['./dashboard.events','update','emit','removeListener','dashboard:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ea9,0xc8));var _0x99ea=function(_0x1a622c,_0x517477){_0x1a622c=_0x1a622c-0x0;var _0x251ef5=_0x9ea9[_0x1a622c];return _0x251ef5;};'use strict';var DashboardEvents=require(_0x99ea('0x0'));var events=['save','remove',_0x99ea('0x1')];function createListener(_0x12be36,_0x1bf332){return function(_0x1e4447){_0x1bf332[_0x99ea('0x2')](_0x12be36,_0x1e4447);};}function removeListener(_0x447104,_0x2e4a17){return function(){DashboardEvents[_0x99ea('0x3')](_0x447104,_0x2e4a17);};}exports['register']=function(_0x388778){for(var _0x47f7e1=0x0,_0x128665=events['length'];_0x47f7e1<_0x128665;_0x47f7e1++){var _0x11e128=events[_0x47f7e1];var _0x31ee8a=createListener(_0x99ea('0x4')+_0x11e128,_0x388778);DashboardEvents['on'](_0x11e128,_0x31ee8a);}}; \ No newline at end of file +var _0x06fd=['./dashboard.events','update','emit','removeListener'];(function(_0x45cbf5,_0x1d5858){var _0x1af9c2=function(_0x29cf63){while(--_0x29cf63){_0x45cbf5['push'](_0x45cbf5['shift']());}};_0x1af9c2(++_0x1d5858);}(_0x06fd,0x17c));var _0xd06f=function(_0xab2622,_0x582313){_0xab2622=_0xab2622-0x0;var _0x3ab544=_0x06fd[_0xab2622];return _0x3ab544;};'use strict';var DashboardEvents=require(_0xd06f('0x0'));var events=['save','remove',_0xd06f('0x1')];function createListener(_0x1e8bab,_0x1dfd77){return function(_0x4f79a0){_0x1dfd77[_0xd06f('0x2')](_0x1e8bab,_0x4f79a0);};}function removeListener(_0x41647f,_0x5ab8a5){return function(){DashboardEvents[_0xd06f('0x3')](_0x41647f,_0x5ab8a5);};}exports['register']=function(_0x2e53e0){for(var _0x506a09=0x0,_0x2539de=events['length'];_0x506a09<_0x2539de;_0x506a09++){var _0x5cf7fd=events[_0x506a09];var _0x3193e7=createListener('dashboard:'+_0x5cf7fd,_0x2e53e0);DashboardEvents['on'](_0x5cf7fd,_0x3193e7);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 1c634b9..7f8be17 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 _0xe3fc=['put','update','delete','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','index','/:id','show','/:id/items','isAuthenticated','getItems','post'];(function(_0x5e5d8a,_0x328493){var _0xaed698=function(_0xd9b93f){while(--_0xd9b93f){_0x5e5d8a['push'](_0x5e5d8a['shift']());}};_0xaed698(++_0x328493);}(_0xe3fc,0x1be));var _0xce3f=function(_0x3d9557,_0x5d09d2){_0x3d9557=_0x3d9557-0x0;var _0x359ff8=_0xe3fc[_0x3d9557];return _0x359ff8;};'use strict';var multer=require('multer');var util=require(_0xce3f('0x0'));var path=require(_0xce3f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xce3f('0x2')]();var fs_extra=require(_0xce3f('0x3'));var auth=require(_0xce3f('0x4'));var interaction=require(_0xce3f('0x5'));var config=require(_0xce3f('0x6'));var controller=require(_0xce3f('0x7'));router[_0xce3f('0x8')]('/',auth['isAuthenticated'](),controller[_0xce3f('0x9')]);router[_0xce3f('0x8')](_0xce3f('0xa'),auth['isAuthenticated'](),controller[_0xce3f('0xb')]);router[_0xce3f('0x8')](_0xce3f('0xc'),auth[_0xce3f('0xd')](),controller[_0xce3f('0xe')]);router[_0xce3f('0xf')]('/',auth[_0xce3f('0xd')](),controller['create']);router[_0xce3f('0xf')]('/:id/clone',auth[_0xce3f('0xd')](),controller['clone']);router['post'](_0xce3f('0xc'),auth[_0xce3f('0xd')](),controller['addItem']);router[_0xce3f('0x10')](_0xce3f('0xa'),auth[_0xce3f('0xd')](),controller[_0xce3f('0x11')]);router[_0xce3f('0x12')](_0xce3f('0xa'),auth[_0xce3f('0xd')](),controller[_0xce3f('0x13')]);module[_0xce3f('0x14')]=router; \ No newline at end of file +var _0x47bd=['show','getItems','post','/:id/clone','clone','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id'];(function(_0x27b483,_0x1581d3){var _0x3af0e7=function(_0x159579){while(--_0x159579){_0x27b483['push'](_0x27b483['shift']());}};_0x3af0e7(++_0x1581d3);}(_0x47bd,0xbb));var _0xd47b=function(_0x391c96,_0x3bcfb5){_0x391c96=_0x391c96-0x0;var _0xeea0bd=_0x47bd[_0x391c96];return _0xeea0bd;};'use strict';var multer=require('multer');var util=require(_0xd47b('0x0'));var path=require(_0xd47b('0x1'));var timeout=require(_0xd47b('0x2'));var express=require(_0xd47b('0x3'));var router=express[_0xd47b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd47b('0x5'));var interaction=require(_0xd47b('0x6'));var config=require(_0xd47b('0x7'));var controller=require(_0xd47b('0x8'));router[_0xd47b('0x9')]('/',auth[_0xd47b('0xa')](),controller[_0xd47b('0xb')]);router['get'](_0xd47b('0xc'),auth[_0xd47b('0xa')](),controller[_0xd47b('0xd')]);router[_0xd47b('0x9')]('/:id/items',auth[_0xd47b('0xa')](),controller[_0xd47b('0xe')]);router[_0xd47b('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd47b('0xf')](_0xd47b('0x10'),auth[_0xd47b('0xa')](),controller[_0xd47b('0x11')]);router[_0xd47b('0xf')]('/:id/items',auth[_0xd47b('0xa')](),controller['addItem']);router['put'](_0xd47b('0xc'),auth[_0xd47b('0xa')](),controller['update']);router[_0xd47b('0x12')](_0xd47b('0xc'),auth[_0xd47b('0xa')](),controller['destroy']);module[_0xd47b('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 1dcc78a..b59c8d8 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 _0x1883=['stringify','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue'];(function(_0x4aa4e6,_0x278c45){var _0x322588=function(_0x19279d){while(--_0x19279d){_0x4aa4e6['push'](_0x4aa4e6['shift']());}};_0x322588(++_0x278c45);}(_0x1883,0xab));var _0x3188=function(_0xfbf519,_0x18803d){_0xfbf519=_0xfbf519-0x0;var _0x4ccfa9=_0x1883[_0xfbf519];return _0x4ccfa9;};'use strict';var Sequelize=require(_0x3188('0x0'));var squel=require(_0x3188('0x1'));var _=require(_0x3188('0x2'));module[_0x3188('0x3')]={'title':{'type':Sequelize[_0x3188('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x3188('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x3188('0x5')](_0x3188('0x6')),'get':function(){try{return JSON[_0x3188('0x7')](this[_0x3188('0x8')](_0x3188('0x9')));}catch(_0x345612){return[];}},'set':function(_0x408ae0){try{this[_0x3188('0xa')](_0x3188('0x9'),JSON[_0x3188('0xb')](_0x408ae0));}catch(_0x3e3afb){this['setDataValue'](_0x3188('0x9'),JSON[_0x3188('0xb')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x3188('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x3188('0xc')]},'background':{'type':Sequelize[_0x3188('0x4')],'allowNull':![],'defaultValue':_0x3188('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x3188('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x3188('0x4')]},'titleFontSize':{'type':Sequelize[_0x3188('0xc')],'defaultValue':0xc}}; \ No newline at end of file +var _0x3f8a=['parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','TEXT','long'];(function(_0x1a0ef3,_0x535bbf){var _0x2b86da=function(_0x5d30f9){while(--_0x5d30f9){_0x1a0ef3['push'](_0x1a0ef3['shift']());}};_0x2b86da(++_0x535bbf);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x989e8f,_0x50239f){_0x989e8f=_0x989e8f-0x0;var _0x5d57a9=_0x3f8a[_0x989e8f];return _0x5d57a9;};'use strict';var Sequelize=require(_0xa3f8('0x0'));var squel=require(_0xa3f8('0x1'));var _=require(_0xa3f8('0x2'));module[_0xa3f8('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xa3f8('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xa3f8('0x5')](_0xa3f8('0x6')),'get':function(){try{return JSON[_0xa3f8('0x7')](this[_0xa3f8('0x8')](_0xa3f8('0x9')));}catch(_0x39d2e4){return[];}},'set':function(_0x471464){try{this[_0xa3f8('0xa')](_0xa3f8('0x9'),JSON[_0xa3f8('0xb')](_0x471464));}catch(_0x268332){this[_0xa3f8('0xa')](_0xa3f8('0x9'),JSON[_0xa3f8('0xb')]([]));}}},'sizeX':{'type':Sequelize[_0xa3f8('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xa3f8('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0xa3f8('0xc')]},'background':{'type':Sequelize[_0xa3f8('0x4')],'allowNull':![],'defaultValue':_0xa3f8('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xa3f8('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xa3f8('0x4')]},'titleFontSize':{'type':Sequelize[_0xa3f8('0xc')],'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 fef071e..dbeb56b 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 _0xbcc7=['show','params','model','keys','DashboardItem','query','intersection','attributes','fields','merge','options','find','catch','type','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','fast-json-patch','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','reject','update','then','error','stack','name','send'];(function(_0x74c6c6,_0x54d54e){var _0x56ba8b=function(_0x2c885f){while(--_0x2c885f){_0x74c6c6['push'](_0x74c6c6['shift']());}};_0x56ba8b(++_0x54d54e);}(_0xbcc7,0x19a));var _0x7bcc=function(_0x86ca42,_0x501a75){_0x86ca42=_0x86ca42-0x0;var _0x5bb8f1=_0xbcc7[_0x86ca42];return _0x5bb8f1;};'use strict';var emlformat=require(_0x7bcc('0x0'));var rimraf=require(_0x7bcc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7bcc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7bcc('0x3'));var Mustache=require('mustache');var util=require(_0x7bcc('0x4'));var path=require(_0x7bcc('0x5'));var sox=require('sox');var csv=require(_0x7bcc('0x6'));var ejs=require(_0x7bcc('0x7'));var fs=require('fs');var fs_extra=require(_0x7bcc('0x8'));var _=require(_0x7bcc('0x9'));var squel=require(_0x7bcc('0xa'));var crypto=require(_0x7bcc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7bcc('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7bcc('0xd'));var Papa=require(_0x7bcc('0xe'));var Redis=require('ioredis');var authService=require(_0x7bcc('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bcc('0x10'))(_0x7bcc('0x11'));var utils=require(_0x7bcc('0x12'));var config=require(_0x7bcc('0x13'));var licenseUtil=require(_0x7bcc('0x14'));var db=require(_0x7bcc('0x15'))['db'];config[_0x7bcc('0x16')]=_['defaults'](config[_0x7bcc('0x16')],{'host':_0x7bcc('0x17'),'port':0x18eb});var socket=require(_0x7bcc('0x18'))(new Redis(config[_0x7bcc('0x16')]));require(_0x7bcc('0x19'))[_0x7bcc('0x1a')](socket);function respondWithStatusCode(_0x4a2539,_0x3998c5){_0x3998c5=_0x3998c5||0xcc;return function(_0x16f0a8){if(_0x16f0a8){return _0x4a2539[_0x7bcc('0x1b')](_0x3998c5);}return _0x4a2539[_0x7bcc('0x1c')](_0x3998c5)[_0x7bcc('0x1d')]();};}function respondWithResult(_0x134d55,_0x432960){_0x432960=_0x432960||0xc8;return function(_0x49adcd){if(_0x49adcd){return _0x134d55[_0x7bcc('0x1c')](_0x432960)['json'](_0x49adcd);}};}function respondWithFilteredResult(_0x3156f3,_0x43dfc4){return function(_0x340bd6){if(_0x340bd6){var _0x323525=typeof _0x43dfc4['offset']==='undefined'&&typeof _0x43dfc4[_0x7bcc('0x1e')]===_0x7bcc('0x1f');var _0x1a1b7f=_0x340bd6[_0x7bcc('0x20')];var _0x1df8ad=_0x323525?0x0:_0x43dfc4[_0x7bcc('0x21')];var _0x3e8d47=_0x323525?_0x340bd6[_0x7bcc('0x20')]:_0x43dfc4[_0x7bcc('0x21')]+_0x43dfc4['limit'];var _0x553865;if(_0x3e8d47>=_0x1a1b7f){_0x3e8d47=_0x1a1b7f;_0x553865=0xc8;}else{_0x553865=0xce;}_0x3156f3[_0x7bcc('0x1c')](_0x553865);return _0x3156f3[_0x7bcc('0x22')](_0x7bcc('0x23'),_0x1df8ad+'-'+_0x3e8d47+'/'+_0x1a1b7f)[_0x7bcc('0x24')](_0x340bd6);}return null;};}function patchUpdates(_0x201f40){return function(_0x2ba4bf){try{jsonpatch[_0x7bcc('0x25')](_0x2ba4bf,_0x201f40,!![]);}catch(_0x345671){return BPromise[_0x7bcc('0x26')](_0x345671);}return _0x2ba4bf['save']();};}function saveUpdates(_0x2d25b8,_0x2b3d01){return function(_0x226fb9){if(_0x226fb9){return _0x226fb9[_0x7bcc('0x27')](_0x2d25b8)[_0x7bcc('0x28')](function(_0x1d085c){return _0x1d085c;});}return null;};}function removeEntity(_0x4f8562,_0x48b296){return function(_0x345dd8){if(_0x345dd8){return _0x345dd8['destroy']()['then'](function(){_0x4f8562[_0x7bcc('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f79a0,_0xe594c6){return function(_0x1725e5){if(!_0x1725e5){_0x3f79a0['sendStatus'](0x194);}return _0x1725e5;};}function handleError(_0x17c3ce,_0x1dea55){_0x1dea55=_0x1dea55||0x1f4;return function(_0x2e92e1){logger[_0x7bcc('0x29')](_0x2e92e1[_0x7bcc('0x2a')]);if(_0x2e92e1[_0x7bcc('0x2b')]){delete _0x2e92e1[_0x7bcc('0x2b')];}_0x17c3ce['status'](_0x1dea55)[_0x7bcc('0x2c')](_0x2e92e1);};}exports[_0x7bcc('0x2d')]=function(_0x51105b,_0x5d4131){var _0x472b73={'raw':![],'where':{'id':_0x51105b[_0x7bcc('0x2e')]['id']}},_0x5010ab={};_0x5010ab[_0x7bcc('0x2f')]=_[_0x7bcc('0x30')](db[_0x7bcc('0x31')]['rawAttributes']);_0x5010ab[_0x7bcc('0x32')]=_[_0x7bcc('0x30')](_0x51105b[_0x7bcc('0x32')]);_0x5010ab['filters']=_[_0x7bcc('0x33')](_0x5010ab[_0x7bcc('0x2f')],_0x5010ab[_0x7bcc('0x32')]);_0x472b73[_0x7bcc('0x34')]=_[_0x7bcc('0x33')](_0x5010ab[_0x7bcc('0x2f')],qs[_0x7bcc('0x35')](_0x51105b[_0x7bcc('0x32')][_0x7bcc('0x35')]));_0x472b73[_0x7bcc('0x34')]=_0x472b73[_0x7bcc('0x34')]['length']?_0x472b73[_0x7bcc('0x34')]:_0x5010ab[_0x7bcc('0x2f')];if(_0x51105b[_0x7bcc('0x32')]['includeAll']){_0x472b73['include']=[{'all':!![]}];}_0x472b73=_[_0x7bcc('0x36')]({},_0x472b73,_0x51105b[_0x7bcc('0x37')]);return db[_0x7bcc('0x31')][_0x7bcc('0x38')](_0x472b73)[_0x7bcc('0x28')](handleEntityNotFound(_0x5d4131,null))[_0x7bcc('0x28')](respondWithResult(_0x5d4131,null))[_0x7bcc('0x39')](handleError(_0x5d4131,null));};exports['destroy']=function(_0x5bbb4b,_0x5584f6){return db['DashboardItem'][_0x7bcc('0x38')]({'where':{'id':_0x5bbb4b[_0x7bcc('0x2e')]['id']}})[_0x7bcc('0x28')](handleEntityNotFound(_0x5584f6,null))['then'](removeEntity(_0x5584f6,null))[_0x7bcc('0x39')](handleError(_0x5584f6,null));};function widgetAttributes(_0x1a7ba2){try{switch(_0x1a7ba2[_0x7bcc('0x3a')]){case'iframe':return[{'name':'attrUrl','value':_0x1a7ba2[_0x7bcc('0x3b')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x0]?_0x1a7ba2['attrs'][0x0]['value']:undefined)||_0x7bcc('0x3d')}];case _0x7bcc('0x3e'):return[{'name':_0x7bcc('0x3f'),'value':_0x1a7ba2['attrPath']||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x0]?_0x1a7ba2[_0x7bcc('0x3c')][0x0][_0x7bcc('0x40')]:undefined)||''}];case _0x7bcc('0x41'):return[{'name':_0x7bcc('0x42'),'value':_0x1a7ba2['attrHourFormat']||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x0]?_0x1a7ba2['attrs'][0x0][_0x7bcc('0x40')]:undefined)||_0x7bcc('0x43')},{'name':_0x7bcc('0x44'),'value':_0x1a7ba2[_0x7bcc('0x44')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x1]?_0x1a7ba2[_0x7bcc('0x3c')][0x1][_0x7bcc('0x40')]:undefined)||'0.00'},{'name':_0x7bcc('0x45'),'value':_0x1a7ba2[_0x7bcc('0x45')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x2]?_0x1a7ba2[_0x7bcc('0x3c')][0x2][_0x7bcc('0x40')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x1a7ba2[_0x7bcc('0x46')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2['attrs'][0x0]?_0x1a7ba2[_0x7bcc('0x3c')][0x0][_0x7bcc('0x40')]:undefined)||_0x7bcc('0x47')},{'name':_0x7bcc('0x48'),'value':_0x1a7ba2[_0x7bcc('0x48')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x1]?_0x1a7ba2['attrs'][0x1][_0x7bcc('0x40')]:undefined)||[]},{'name':_0x7bcc('0x45'),'value':_0x1a7ba2[_0x7bcc('0x45')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x2]?_0x1a7ba2['attrs'][0x2][_0x7bcc('0x40')]:undefined)||0x14},{'name':_0x7bcc('0x49'),'value':_0x1a7ba2['attrChannel']||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x3]?_0x1a7ba2[_0x7bcc('0x3c')][0x3]['value']:undefined)||_0x7bcc('0x4a')},{'name':_0x7bcc('0x4b'),'value':_0x1a7ba2['attrEmailAccounts']||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x4]?_0x1a7ba2[_0x7bcc('0x3c')][0x4][_0x7bcc('0x40')]:undefined)||''},{'name':_0x7bcc('0x4c'),'value':_0x1a7ba2['attrFaxAccounts']||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x5]?_0x1a7ba2['attrs'][0x5][_0x7bcc('0x40')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x1a7ba2[_0x7bcc('0x4d')]||(_0x1a7ba2['attrs']&&_0x1a7ba2[_0x7bcc('0x3c')][0x6]?_0x1a7ba2['attrs'][0x6]['value']:undefined)||''},{'name':_0x7bcc('0x4e'),'value':_0x1a7ba2[_0x7bcc('0x4e')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x7]?_0x1a7ba2[_0x7bcc('0x3c')][0x7][_0x7bcc('0x40')]:undefined)||''},{'name':_0x7bcc('0x4f'),'value':_0x1a7ba2[_0x7bcc('0x4f')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x8]?_0x1a7ba2[_0x7bcc('0x3c')][0x8][_0x7bcc('0x40')]:undefined)||''},{'name':_0x7bcc('0x50'),'value':_0x1a7ba2[_0x7bcc('0x50')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2['attrs'][0x9]?_0x1a7ba2[_0x7bcc('0x3c')][0x9][_0x7bcc('0x40')]:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':_0x7bcc('0x51'),'value':_0x1a7ba2[_0x7bcc('0x51')]||(_0x1a7ba2['attrs']&&_0x1a7ba2['attrs'][0x0]?_0x1a7ba2['attrs'][0x0]['value']:undefined)||'total'},{'name':_0x7bcc('0x52'),'value':_0x1a7ba2[_0x7bcc('0x52')]||(_0x1a7ba2['attrs']&&_0x1a7ba2['attrs'][0x1]?_0x1a7ba2[_0x7bcc('0x3c')][0x1][_0x7bcc('0x40')]:undefined)||null},{'name':_0x7bcc('0x53'),'value':_0x1a7ba2[_0x7bcc('0x53')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x2]?_0x1a7ba2['attrs'][0x2]['value']:undefined)||null},{'name':_0x7bcc('0x48'),'value':_0x1a7ba2[_0x7bcc('0x48')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x3]?_0x1a7ba2['attrs'][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x1a7ba2[_0x7bcc('0x49')]||(_0x1a7ba2['attrs']&&_0x1a7ba2[_0x7bcc('0x3c')][0x4]?_0x1a7ba2[_0x7bcc('0x3c')][0x4][_0x7bcc('0x40')]:undefined)||'voice'},{'name':_0x7bcc('0x4b'),'value':_0x1a7ba2['attrEmailAccounts']||(_0x1a7ba2['attrs']&&_0x1a7ba2[_0x7bcc('0x3c')][0x5]?_0x1a7ba2[_0x7bcc('0x3c')][0x5][_0x7bcc('0x40')]:undefined)||''},{'name':_0x7bcc('0x4c'),'value':_0x1a7ba2[_0x7bcc('0x4c')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x6]?_0x1a7ba2[_0x7bcc('0x3c')][0x6][_0x7bcc('0x40')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x1a7ba2[_0x7bcc('0x4d')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x7]?_0x1a7ba2['attrs'][0x7][_0x7bcc('0x40')]:undefined)||''},{'name':_0x7bcc('0x4e'),'value':_0x1a7ba2[_0x7bcc('0x4e')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x8]?_0x1a7ba2[_0x7bcc('0x3c')][0x8][_0x7bcc('0x40')]:undefined)||''},{'name':_0x7bcc('0x4f'),'value':_0x1a7ba2[_0x7bcc('0x4f')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2['attrs'][0x9]?_0x1a7ba2[_0x7bcc('0x3c')][0x9][_0x7bcc('0x40')]:undefined)||''},{'name':'attrChatWebsites','value':_0x1a7ba2[_0x7bcc('0x50')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0xa]?_0x1a7ba2['attrs'][0xa][_0x7bcc('0x40')]:undefined)||''}];case'web-report':return[{'name':_0x7bcc('0x54'),'type':_0x1a7ba2[_0x7bcc('0x55')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x0]?_0x1a7ba2[_0x7bcc('0x3c')][0x0][_0x7bcc('0x3a')]:undefined)||null,'value':_0x1a7ba2[_0x7bcc('0x54')]||(_0x1a7ba2['attrs']&&_0x1a7ba2['attrs'][0x0]?_0x1a7ba2[_0x7bcc('0x3c')][0x0]['value']:undefined)||null},{'name':_0x7bcc('0x56'),'value':_0x1a7ba2[_0x7bcc('0x56')]||(_0x1a7ba2[_0x7bcc('0x3c')]&&_0x1a7ba2[_0x7bcc('0x3c')][0x1]?_0x1a7ba2['attrs'][0x1][_0x7bcc('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x3c8242){logger[_0x7bcc('0x29')](_0x7bcc('0x57'),JSON[_0x7bcc('0x58')](_0x3c8242));return[];}}exports[_0x7bcc('0x59')]=function(_0x35d559,_0x25e9d6){if(_0x35d559[_0x7bcc('0x5a')]){_0x35d559[_0x7bcc('0x5a')][_0x7bcc('0x3c')]=widgetAttributes(_0x35d559['body']);}return db['DashboardItem']['create'](_0x35d559[_0x7bcc('0x5a')],{})['then'](respondWithResult(_0x25e9d6,0xc9))[_0x7bcc('0x39')](handleError(_0x25e9d6,null));};exports['update']=function(_0x38ed53,_0x41a669){if(_0x38ed53[_0x7bcc('0x5a')]['id']){delete _0x38ed53[_0x7bcc('0x5a')]['id'];}_0x38ed53[_0x7bcc('0x5a')][_0x7bcc('0x3c')]=widgetAttributes(_0x38ed53[_0x7bcc('0x5a')]);return db['DashboardItem'][_0x7bcc('0x38')]({'where':{'id':_0x38ed53[_0x7bcc('0x2e')]['id']}})['then'](handleEntityNotFound(_0x41a669,null))[_0x7bcc('0x28')](saveUpdates(_0x38ed53['body'],null))[_0x7bcc('0x28')](respondWithResult(_0x41a669,null))['catch'](handleError(_0x41a669,null));}; \ No newline at end of file +var _0xaf11=['attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie2','attrSerie3','web-report','reportType','type','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','status','end','json','limit','count','offset','Content-Range','apply','save','then','destroy','sendStatus','error','name','show','params','model','DashboardItem','query','keys','filters','attributes','fields','includeAll','include','merge','catch','find','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xaf11,0x12f));var _0x1af1=function(_0x3e0554,_0x1de543){_0x3e0554=_0x3e0554-0x0;var _0x3656fb=_0xaf11[_0x3e0554];return _0x3656fb;};'use strict';var emlformat=require(_0x1af1('0x0'));var rimraf=require(_0x1af1('0x1'));var zipdir=require(_0x1af1('0x2'));var jsonpatch=require(_0x1af1('0x3'));var rp=require('request-promise');var moment=require(_0x1af1('0x4'));var BPromise=require(_0x1af1('0x5'));var Mustache=require(_0x1af1('0x6'));var util=require('util');var path=require(_0x1af1('0x7'));var sox=require(_0x1af1('0x8'));var csv=require(_0x1af1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1af1('0xa'));var _=require('lodash');var squel=require(_0x1af1('0xb'));var crypto=require(_0x1af1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1af1('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1af1('0xe'));var Redis=require(_0x1af1('0xf'));var authService=require(_0x1af1('0x10'));var qs=require(_0x1af1('0x11'));var as=require(_0x1af1('0x12'));var hardwareService=require(_0x1af1('0x13'));var logger=require('../../config/logger')(_0x1af1('0x14'));var utils=require(_0x1af1('0x15'));var config=require(_0x1af1('0x16'));var licenseUtil=require(_0x1af1('0x17'));var db=require(_0x1af1('0x18'))['db'];config[_0x1af1('0x19')]=_[_0x1af1('0x1a')](config['redis'],{'host':_0x1af1('0x1b'),'port':0x18eb});var socket=require(_0x1af1('0x1c'))(new Redis(config[_0x1af1('0x19')]));require(_0x1af1('0x1d'))['register'](socket);function respondWithStatusCode(_0x19f4e3,_0x1a7eb8){_0x1a7eb8=_0x1a7eb8||0xcc;return function(_0x1af575){if(_0x1af575){return _0x19f4e3['sendStatus'](_0x1a7eb8);}return _0x19f4e3[_0x1af1('0x1e')](_0x1a7eb8)[_0x1af1('0x1f')]();};}function respondWithResult(_0x38df6f,_0x39f691){_0x39f691=_0x39f691||0xc8;return function(_0x1692aa){if(_0x1692aa){return _0x38df6f[_0x1af1('0x1e')](_0x39f691)[_0x1af1('0x20')](_0x1692aa);}};}function respondWithFilteredResult(_0x45dd76,_0x163a06){return function(_0x20c17b){if(_0x20c17b){var _0x52c11b=typeof _0x163a06['offset']==='undefined'&&typeof _0x163a06[_0x1af1('0x21')]==='undefined';var _0xf1c8ae=_0x20c17b[_0x1af1('0x22')];var _0x19aa3a=_0x52c11b?0x0:_0x163a06[_0x1af1('0x23')];var _0x2866d1=_0x52c11b?_0x20c17b[_0x1af1('0x22')]:_0x163a06['offset']+_0x163a06[_0x1af1('0x21')];var _0x2ef81a;if(_0x2866d1>=_0xf1c8ae){_0x2866d1=_0xf1c8ae;_0x2ef81a=0xc8;}else{_0x2ef81a=0xce;}_0x45dd76[_0x1af1('0x1e')](_0x2ef81a);return _0x45dd76['set'](_0x1af1('0x24'),_0x19aa3a+'-'+_0x2866d1+'/'+_0xf1c8ae)[_0x1af1('0x20')](_0x20c17b);}return null;};}function patchUpdates(_0x535a8e){return function(_0x455052){try{jsonpatch[_0x1af1('0x25')](_0x455052,_0x535a8e,!![]);}catch(_0x187dd4){return BPromise['reject'](_0x187dd4);}return _0x455052[_0x1af1('0x26')]();};}function saveUpdates(_0x4003db,_0x5d3b72){return function(_0x57d9f0){if(_0x57d9f0){return _0x57d9f0['update'](_0x4003db)[_0x1af1('0x27')](function(_0x5df091){return _0x5df091;});}return null;};}function removeEntity(_0x50c0e0,_0x21c60c){return function(_0x461f54){if(_0x461f54){return _0x461f54[_0x1af1('0x28')]()[_0x1af1('0x27')](function(){_0x50c0e0[_0x1af1('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x371931,_0x3c6a55){return function(_0xe4d724){if(!_0xe4d724){_0x371931[_0x1af1('0x29')](0x194);}return _0xe4d724;};}function handleError(_0x2a4d33,_0x3ddf21){_0x3ddf21=_0x3ddf21||0x1f4;return function(_0x4b655b){logger[_0x1af1('0x2a')](_0x4b655b['stack']);if(_0x4b655b[_0x1af1('0x2b')]){delete _0x4b655b[_0x1af1('0x2b')];}_0x2a4d33['status'](_0x3ddf21)['send'](_0x4b655b);};}exports[_0x1af1('0x2c')]=function(_0x2ec5e0,_0x2c1494){var _0x10d49b={'raw':![],'where':{'id':_0x2ec5e0[_0x1af1('0x2d')]['id']}},_0x537abe={};_0x537abe[_0x1af1('0x2e')]=_['keys'](db[_0x1af1('0x2f')]['rawAttributes']);_0x537abe[_0x1af1('0x30')]=_[_0x1af1('0x31')](_0x2ec5e0[_0x1af1('0x30')]);_0x537abe[_0x1af1('0x32')]=_['intersection'](_0x537abe[_0x1af1('0x2e')],_0x537abe[_0x1af1('0x30')]);_0x10d49b[_0x1af1('0x33')]=_['intersection'](_0x537abe['model'],qs[_0x1af1('0x34')](_0x2ec5e0['query'][_0x1af1('0x34')]));_0x10d49b[_0x1af1('0x33')]=_0x10d49b['attributes']['length']?_0x10d49b[_0x1af1('0x33')]:_0x537abe['model'];if(_0x2ec5e0[_0x1af1('0x30')][_0x1af1('0x35')]){_0x10d49b[_0x1af1('0x36')]=[{'all':!![]}];}_0x10d49b=_[_0x1af1('0x37')]({},_0x10d49b,_0x2ec5e0['options']);return db[_0x1af1('0x2f')]['find'](_0x10d49b)[_0x1af1('0x27')](handleEntityNotFound(_0x2c1494,null))['then'](respondWithResult(_0x2c1494,null))[_0x1af1('0x38')](handleError(_0x2c1494,null));};exports[_0x1af1('0x28')]=function(_0x25280f,_0x4722f8){return db['DashboardItem'][_0x1af1('0x39')]({'where':{'id':_0x25280f[_0x1af1('0x2d')]['id']}})[_0x1af1('0x27')](handleEntityNotFound(_0x4722f8,null))[_0x1af1('0x27')](removeEntity(_0x4722f8,null))[_0x1af1('0x38')](handleError(_0x4722f8,null));};function widgetAttributes(_0x39fc2a){try{switch(_0x39fc2a['type']){case _0x1af1('0x3a'):return[{'name':_0x1af1('0x3b'),'value':_0x39fc2a['attrUrl']||(_0x39fc2a[_0x1af1('0x3c')]&&_0x39fc2a['attrs'][0x0]?_0x39fc2a[_0x1af1('0x3c')][0x0][_0x1af1('0x3d')]:undefined)||_0x1af1('0x3e')}];case _0x1af1('0x3f'):return[{'name':_0x1af1('0x40'),'value':_0x39fc2a['attrPath']||(_0x39fc2a['attrs']&&_0x39fc2a[_0x1af1('0x3c')][0x0]?_0x39fc2a[_0x1af1('0x3c')][0x0][_0x1af1('0x3d')]:undefined)||''}];case _0x1af1('0x41'):return[{'name':_0x1af1('0x42'),'value':_0x39fc2a['attrHourFormat']||(_0x39fc2a[_0x1af1('0x3c')]&&_0x39fc2a['attrs'][0x0]?_0x39fc2a[_0x1af1('0x3c')][0x0][_0x1af1('0x3d')]:undefined)||_0x1af1('0x43')},{'name':'attrTimezone','value':_0x39fc2a[_0x1af1('0x44')]||(_0x39fc2a[_0x1af1('0x3c')]&&_0x39fc2a[_0x1af1('0x3c')][0x1]?_0x39fc2a[_0x1af1('0x3c')][0x1][_0x1af1('0x3d')]:undefined)||'0.00'},{'name':_0x1af1('0x45'),'value':_0x39fc2a[_0x1af1('0x45')]||(_0x39fc2a['attrs']&&_0x39fc2a['attrs'][0x2]?_0x39fc2a['attrs'][0x2]['value']:undefined)||0xc}];case _0x1af1('0x46'):return[{'name':_0x1af1('0x47'),'value':_0x39fc2a[_0x1af1('0x47')]||(_0x39fc2a['attrs']&&_0x39fc2a[_0x1af1('0x3c')][0x0]?_0x39fc2a[_0x1af1('0x3c')][0x0][_0x1af1('0x3d')]:undefined)||_0x1af1('0x48')},{'name':_0x1af1('0x49'),'value':_0x39fc2a[_0x1af1('0x49')]||(_0x39fc2a['attrs']&&_0x39fc2a[_0x1af1('0x3c')][0x1]?_0x39fc2a[_0x1af1('0x3c')][0x1][_0x1af1('0x3d')]:undefined)||[]},{'name':_0x1af1('0x45'),'value':_0x39fc2a['attrFontSize']||(_0x39fc2a[_0x1af1('0x3c')]&&_0x39fc2a[_0x1af1('0x3c')][0x2]?_0x39fc2a['attrs'][0x2]['value']:undefined)||0x14},{'name':_0x1af1('0x4a'),'value':_0x39fc2a[_0x1af1('0x4a')]||(_0x39fc2a['attrs']&&_0x39fc2a[_0x1af1('0x3c')][0x3]?_0x39fc2a[_0x1af1('0x3c')][0x3]['value']:undefined)||_0x1af1('0x4b')},{'name':'attrEmailAccounts','value':_0x39fc2a[_0x1af1('0x4c')]||(_0x39fc2a['attrs']&&_0x39fc2a[_0x1af1('0x3c')][0x4]?_0x39fc2a[_0x1af1('0x3c')][0x4]['value']:undefined)||''},{'name':_0x1af1('0x4d'),'value':_0x39fc2a[_0x1af1('0x4d')]||(_0x39fc2a[_0x1af1('0x3c')]&&_0x39fc2a[_0x1af1('0x3c')][0x5]?_0x39fc2a[_0x1af1('0x3c')][0x5]['value']:undefined)||''},{'name':_0x1af1('0x4e'),'value':_0x39fc2a['attrSmsAccounts']||(_0x39fc2a[_0x1af1('0x3c')]&&_0x39fc2a[_0x1af1('0x3c')][0x6]?_0x39fc2a['attrs'][0x6][_0x1af1('0x3d')]:undefined)||''},{'name':_0x1af1('0x4f'),'value':_0x39fc2a[_0x1af1('0x4f')]||(_0x39fc2a['attrs']&&_0x39fc2a[_0x1af1('0x3c')][0x7]?_0x39fc2a[_0x1af1('0x3c')][0x7][_0x1af1('0x3d')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x39fc2a[_0x1af1('0x50')]||(_0x39fc2a[_0x1af1('0x3c')]&&_0x39fc2a['attrs'][0x8]?_0x39fc2a[_0x1af1('0x3c')][0x8][_0x1af1('0x3d')]:undefined)||''},{'name':_0x1af1('0x51'),'value':_0x39fc2a['attrChatWebsites']||(_0x39fc2a[_0x1af1('0x3c')]&&_0x39fc2a[_0x1af1('0x3c')][0x9]?_0x39fc2a[_0x1af1('0x3c')][0x9]['value']:undefined)||''}];case'multibar-chart':case _0x1af1('0x52'):return[{'name':'attrSerie1','value':_0x39fc2a['attrSerie1']||(_0x39fc2a['attrs']&&_0x39fc2a[_0x1af1('0x3c')][0x0]?_0x39fc2a[_0x1af1('0x3c')][0x0][_0x1af1('0x3d')]:undefined)||_0x1af1('0x48')},{'name':'attrSerie2','value':_0x39fc2a[_0x1af1('0x53')]||(_0x39fc2a['attrs']&&_0x39fc2a['attrs'][0x1]?_0x39fc2a[_0x1af1('0x3c')][0x1]['value']:undefined)||null},{'name':_0x1af1('0x54'),'value':_0x39fc2a[_0x1af1('0x54')]||(_0x39fc2a[_0x1af1('0x3c')]&&_0x39fc2a[_0x1af1('0x3c')][0x2]?_0x39fc2a[_0x1af1('0x3c')][0x2][_0x1af1('0x3d')]:undefined)||null},{'name':_0x1af1('0x49'),'value':_0x39fc2a['attrVoiceQueues']||(_0x39fc2a[_0x1af1('0x3c')]&&_0x39fc2a[_0x1af1('0x3c')][0x3]?_0x39fc2a[_0x1af1('0x3c')][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x39fc2a[_0x1af1('0x4a')]||(_0x39fc2a[_0x1af1('0x3c')]&&_0x39fc2a[_0x1af1('0x3c')][0x4]?_0x39fc2a['attrs'][0x4][_0x1af1('0x3d')]:undefined)||_0x1af1('0x4b')},{'name':_0x1af1('0x4c'),'value':_0x39fc2a['attrEmailAccounts']||(_0x39fc2a[_0x1af1('0x3c')]&&_0x39fc2a[_0x1af1('0x3c')][0x5]?_0x39fc2a[_0x1af1('0x3c')][0x5]['value']:undefined)||''},{'name':_0x1af1('0x4d'),'value':_0x39fc2a['attrFaxAccounts']||(_0x39fc2a[_0x1af1('0x3c')]&&_0x39fc2a[_0x1af1('0x3c')][0x6]?_0x39fc2a['attrs'][0x6][_0x1af1('0x3d')]:undefined)||''},{'name':_0x1af1('0x4e'),'value':_0x39fc2a['attrSmsAccounts']||(_0x39fc2a[_0x1af1('0x3c')]&&_0x39fc2a['attrs'][0x7]?_0x39fc2a['attrs'][0x7]['value']:undefined)||''},{'name':_0x1af1('0x4f'),'value':_0x39fc2a[_0x1af1('0x4f')]||(_0x39fc2a[_0x1af1('0x3c')]&&_0x39fc2a[_0x1af1('0x3c')][0x8]?_0x39fc2a[_0x1af1('0x3c')][0x8][_0x1af1('0x3d')]:undefined)||''},{'name':_0x1af1('0x50'),'value':_0x39fc2a['attrWhatsappAccounts']||(_0x39fc2a[_0x1af1('0x3c')]&&_0x39fc2a[_0x1af1('0x3c')][0x9]?_0x39fc2a[_0x1af1('0x3c')][0x9]['value']:undefined)||''},{'name':_0x1af1('0x51'),'value':_0x39fc2a[_0x1af1('0x51')]||(_0x39fc2a[_0x1af1('0x3c')]&&_0x39fc2a[_0x1af1('0x3c')][0xa]?_0x39fc2a[_0x1af1('0x3c')][0xa]['value']:undefined)||''}];case _0x1af1('0x55'):return[{'name':'attrReport','type':_0x39fc2a[_0x1af1('0x56')]||(_0x39fc2a[_0x1af1('0x3c')]&&_0x39fc2a[_0x1af1('0x3c')][0x0]?_0x39fc2a[_0x1af1('0x3c')][0x0][_0x1af1('0x57')]:undefined)||null,'value':_0x39fc2a[_0x1af1('0x58')]||(_0x39fc2a['attrs']&&_0x39fc2a['attrs'][0x0]?_0x39fc2a[_0x1af1('0x3c')][0x0][_0x1af1('0x3d')]:undefined)||null},{'name':_0x1af1('0x59'),'value':_0x39fc2a[_0x1af1('0x59')]||(_0x39fc2a['attrs']&&_0x39fc2a[_0x1af1('0x3c')][0x1]?_0x39fc2a[_0x1af1('0x3c')][0x1][_0x1af1('0x3d')]:undefined)||0x0}];default:return[];}}catch(_0x3f9d72){logger['error'](_0x1af1('0x5a'),JSON[_0x1af1('0x5b')](_0x3f9d72));return[];}}exports[_0x1af1('0x5c')]=function(_0x59a5b2,_0x209eb3){if(_0x59a5b2[_0x1af1('0x5d')]){_0x59a5b2[_0x1af1('0x5d')][_0x1af1('0x3c')]=widgetAttributes(_0x59a5b2[_0x1af1('0x5d')]);}return db[_0x1af1('0x2f')][_0x1af1('0x5c')](_0x59a5b2[_0x1af1('0x5d')],{})['then'](respondWithResult(_0x209eb3,0xc9))[_0x1af1('0x38')](handleError(_0x209eb3,null));};exports[_0x1af1('0x5e')]=function(_0x310ae0,_0x214a82){if(_0x310ae0[_0x1af1('0x5d')]['id']){delete _0x310ae0[_0x1af1('0x5d')]['id'];}_0x310ae0[_0x1af1('0x5d')][_0x1af1('0x3c')]=widgetAttributes(_0x310ae0[_0x1af1('0x5d')]);return db[_0x1af1('0x2f')][_0x1af1('0x39')]({'where':{'id':_0x310ae0[_0x1af1('0x2d')]['id']}})['then'](handleEntityNotFound(_0x214a82,null))[_0x1af1('0x27')](saveUpdates(_0x310ae0[_0x1af1('0x5d')],null))[_0x1af1('0x27')](respondWithResult(_0x214a82,null))[_0x1af1('0x38')](handleError(_0x214a82,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index f009bcb..6c607cd 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 _0xae4c=['hook','save','update','remove','emit','hasOwnProperty'];(function(_0x3a06b7,_0x5a949a){var _0x42afad=function(_0x36dd4e){while(--_0x36dd4e){_0x3a06b7['push'](_0x3a06b7['shift']());}};_0x42afad(++_0x5a949a);}(_0xae4c,0x97));var _0xcae4=function(_0x4c4136,_0x1e74ae){_0x4c4136=_0x4c4136-0x0;var _0x11fa28=_0xae4c[_0x4c4136];return _0x11fa28;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcae4('0x0'),'afterUpdate':_0xcae4('0x1'),'afterDestroy':_0xcae4('0x2')};function emitEvent(_0x3cf402){return function(_0x5dab79,_0x3ebdef,_0x446221){DashboardItemEvents['emit'](_0x3cf402+':'+_0x5dab79['id'],_0x5dab79);DashboardItemEvents[_0xcae4('0x3')](_0x3cf402,_0x5dab79);_0x446221(null);};}for(var e in events){if(events[_0xcae4('0x4')](e)){var event=events[e];DashboardItem[_0xcae4('0x5')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x9d22=['setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb','DashboardItem'];(function(_0xeab75f,_0x4bcb37){var _0x34fdb2=function(_0x38b09b){while(--_0x38b09b){_0xeab75f['push'](_0xeab75f['shift']());}};_0x34fdb2(++_0x4bcb37);}(_0x9d22,0x192));var _0x29d2=function(_0x5f50b5,_0xa8db83){_0x5f50b5=_0x5f50b5-0x0;var _0x54c383=_0x9d22[_0x5f50b5];return _0x54c383;};'use strict';var EventEmitter=require(_0x29d2('0x0'));var DashboardItem=require(_0x29d2('0x1'))['db'][_0x29d2('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x29d2('0x3')](0x0);var events={'afterCreate':_0x29d2('0x4'),'afterUpdate':_0x29d2('0x5'),'afterDestroy':_0x29d2('0x6')};function emitEvent(_0x11565e){return function(_0x36f7aa,_0x3da0dd,_0x4f9df8){DashboardItemEvents[_0x29d2('0x7')](_0x11565e+':'+_0x36f7aa['id'],_0x36f7aa);DashboardItemEvents['emit'](_0x11565e,_0x36f7aa);_0x4f9df8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x29d2('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index f532da8..98b5c03 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 _0xc800=['bluebird','path','rimraf','../../config/environment','./dashboardItem.attributes','define','DashboardItem','lodash','util','api','moment'];(function(_0x21d36e,_0x5dc096){var _0x4cc307=function(_0x4ae995){while(--_0x4ae995){_0x21d36e['push'](_0x21d36e['shift']());}};_0x4cc307(++_0x5dc096);}(_0xc800,0x1b4));var _0x0c80=function(_0x3816c2,_0xb221e1){_0x3816c2=_0x3816c2-0x0;var _0x144669=_0xc800[_0x3816c2];return _0x144669;};'use strict';var _=require(_0x0c80('0x0'));var util=require(_0x0c80('0x1'));var logger=require('../../config/logger')(_0x0c80('0x2'));var moment=require(_0x0c80('0x3'));var BPromise=require(_0x0c80('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c80('0x5'));var rimraf=require(_0x0c80('0x6'));var config=require(_0x0c80('0x7'));var attributes=require(_0x0c80('0x8'));module['exports']=function(_0x299f3b,_0x55ba02){return _0x299f3b[_0x0c80('0x9')](_0x0c80('0xa'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1f63=['DashboardItem','dashboard_items','lodash','util','api','moment','bluebird','path','rimraf','exports'];(function(_0x521f7a,_0x5ba1c2){var _0x350737=function(_0x1c7149){while(--_0x1c7149){_0x521f7a['push'](_0x521f7a['shift']());}};_0x350737(++_0x5ba1c2);}(_0x1f63,0x7a));var _0x31f6=function(_0x320d31,_0xf39ae4){_0x320d31=_0x320d31-0x0;var _0x1a605f=_0x1f63[_0x320d31];return _0x1a605f;};'use strict';var _=require(_0x31f6('0x0'));var util=require(_0x31f6('0x1'));var logger=require('../../config/logger')(_0x31f6('0x2'));var moment=require(_0x31f6('0x3'));var BPromise=require(_0x31f6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x31f6('0x5'));var rimraf=require(_0x31f6('0x6'));var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0x31f6('0x7')]=function(_0x11250b,_0xe8437e){return _0x11250b['define'](_0x31f6('0x8'),attributes,{'tableName':_0x31f6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 9caac5b..5de2423 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 _0xf7a4=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xf7a4,0x1d8));var _0x4f7a=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0xf7a4[_0x12f688];return _0x59c3de;};'use strict';var _=require(_0x4f7a('0x0'));var util=require(_0x4f7a('0x1'));var moment=require(_0x4f7a('0x2'));var BPromise=require(_0x4f7a('0x3'));var rs=require(_0x4f7a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4f7a('0x5'))['db'];var utils=require(_0x4f7a('0x6'));var logger=require(_0x4f7a('0x7'))(_0x4f7a('0x8'));var config=require('../../config/environment');var jayson=require(_0x4f7a('0x9'));var client=jayson[_0x4f7a('0xa')][_0x4f7a('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4f7a('0xc')],{'host':_0x4f7a('0xd'),'port':0x18eb});var socket=require(_0x4f7a('0xe'))(new Redis(config[_0x4f7a('0xc')]));require('./dashboardItem.socket')[_0x4f7a('0xf')](socket);function respondWithRpcPromise(_0x36b144,_0x54d858,_0x3c6a2a){return new BPromise(function(_0x55e6ad,_0x2b2f90){return client[_0x4f7a('0x10')](_0x36b144,_0x3c6a2a)[_0x4f7a('0x11')](function(_0x48ee07){logger[_0x4f7a('0x12')](_0x4f7a('0x13'),_0x54d858,_0x4f7a('0x14'));logger[_0x4f7a('0x15')](_0x4f7a('0x16'),_0x54d858,_0x4f7a('0x14'),JSON[_0x4f7a('0x17')](_0x48ee07));if(_0x48ee07[_0x4f7a('0x18')]){if(_0x48ee07['error']['code']===0x1f4){logger[_0x4f7a('0x18')](_0x4f7a('0x13'),_0x54d858,_0x48ee07[_0x4f7a('0x18')]['message']);return _0x2b2f90(_0x48ee07[_0x4f7a('0x18')][_0x4f7a('0x19')]);}logger[_0x4f7a('0x18')]('DashboardItem,\x20%s,\x20%s',_0x54d858,_0x48ee07[_0x4f7a('0x18')]['message']);return _0x55e6ad(_0x48ee07[_0x4f7a('0x18')]['message']);}else{logger[_0x4f7a('0x12')](_0x4f7a('0x13'),_0x54d858,_0x4f7a('0x14'));_0x55e6ad(_0x48ee07[_0x4f7a('0x1a')]['message']);}})[_0x4f7a('0x1b')](function(_0x2c9f66){logger[_0x4f7a('0x18')]('DashboardItem,\x20%s,\x20%s',_0x54d858,_0x2c9f66);_0x2b2f90(_0x2c9f66);});});} \ No newline at end of file +var _0xcfd6=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x2cdd4e,_0x4559aa){var _0x10a96b=function(_0x8890bd){while(--_0x8890bd){_0x2cdd4e['push'](_0x2cdd4e['shift']());}};_0x10a96b(++_0x4559aa);}(_0xcfd6,0x1d1));var _0x6cfd=function(_0x30fc78,_0x3aba56){_0x30fc78=_0x30fc78-0x0;var _0x3e1d01=_0xcfd6[_0x30fc78];return _0x3e1d01;};'use strict';var _=require(_0x6cfd('0x0'));var util=require(_0x6cfd('0x1'));var moment=require(_0x6cfd('0x2'));var BPromise=require(_0x6cfd('0x3'));var rs=require(_0x6cfd('0x4'));var fs=require('fs');var Redis=require(_0x6cfd('0x5'));var db=require(_0x6cfd('0x6'))['db'];var utils=require(_0x6cfd('0x7'));var logger=require(_0x6cfd('0x8'))(_0x6cfd('0x9'));var config=require(_0x6cfd('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x6cfd('0xb')][_0x6cfd('0xc')]({'port':0x232a});config[_0x6cfd('0xd')]=_[_0x6cfd('0xe')](config[_0x6cfd('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6cfd('0xf'))[_0x6cfd('0x10')](socket);function respondWithRpcPromise(_0x243c3f,_0x5b8210,_0x3f4e46){return new BPromise(function(_0x151809,_0x356cfe){return client[_0x6cfd('0x11')](_0x243c3f,_0x3f4e46)[_0x6cfd('0x12')](function(_0x21a549){logger[_0x6cfd('0x13')](_0x6cfd('0x14'),_0x5b8210,_0x6cfd('0x15'));logger[_0x6cfd('0x16')](_0x6cfd('0x17'),_0x5b8210,_0x6cfd('0x15'),JSON[_0x6cfd('0x18')](_0x21a549));if(_0x21a549[_0x6cfd('0x19')]){if(_0x21a549[_0x6cfd('0x19')]['code']===0x1f4){logger['error'](_0x6cfd('0x14'),_0x5b8210,_0x21a549[_0x6cfd('0x19')][_0x6cfd('0x1a')]);return _0x356cfe(_0x21a549[_0x6cfd('0x19')]['message']);}logger[_0x6cfd('0x19')](_0x6cfd('0x14'),_0x5b8210,_0x21a549[_0x6cfd('0x19')][_0x6cfd('0x1a')]);return _0x151809(_0x21a549[_0x6cfd('0x19')][_0x6cfd('0x1a')]);}else{logger[_0x6cfd('0x13')](_0x6cfd('0x14'),_0x5b8210,_0x6cfd('0x15'));_0x151809(_0x21a549[_0x6cfd('0x1b')][_0x6cfd('0x1a')]);}})[_0x6cfd('0x1c')](function(_0x4a563b){logger[_0x6cfd('0x19')]('DashboardItem,\x20%s,\x20%s',_0x5b8210,_0x4a563b);_0x356cfe(_0x4a563b);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index ddd4371..e1c51d1 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 _0x8d25=['update','removeListener','length','dashboardItem:','./dashboardItem.events','save','remove'];(function(_0x4428d5,_0x203b67){var _0x5e33b6=function(_0x13c862){while(--_0x13c862){_0x4428d5['push'](_0x4428d5['shift']());}};_0x5e33b6(++_0x203b67);}(_0x8d25,0x1cb));var _0x58d2=function(_0x48a8ce,_0x442a5e){_0x48a8ce=_0x48a8ce-0x0;var _0x52285f=_0x8d25[_0x48a8ce];return _0x52285f;};'use strict';var DashboardItemEvents=require(_0x58d2('0x0'));var events=[_0x58d2('0x1'),_0x58d2('0x2'),_0x58d2('0x3')];function createListener(_0x2fac38,_0xb52278){return function(_0x814b15){_0xb52278['emit'](_0x2fac38,_0x814b15);};}function removeListener(_0x48e8cf,_0x5bf0b9){return function(){DashboardItemEvents[_0x58d2('0x4')](_0x48e8cf,_0x5bf0b9);};}exports['register']=function(_0x105666){for(var _0x5675c3=0x0,_0xb04855=events[_0x58d2('0x5')];_0x5675c3<_0xb04855;_0x5675c3++){var _0x330bfe=events[_0x5675c3];var _0x271e83=createListener(_0x58d2('0x6')+_0x330bfe,_0x105666);DashboardItemEvents['on'](_0x330bfe,_0x271e83);}}; \ No newline at end of file +var _0x6357=['update','removeListener','register','length','save'];(function(_0xf2682d,_0x48f012){var _0x53dea0=function(_0x47235e){while(--_0x47235e){_0xf2682d['push'](_0xf2682d['shift']());}};_0x53dea0(++_0x48f012);}(_0x6357,0x14e));var _0x7635=function(_0x481015,_0x5b3e2e){_0x481015=_0x481015-0x0;var _0x24a6c5=_0x6357[_0x481015];return _0x24a6c5;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x7635('0x0'),'remove',_0x7635('0x1')];function createListener(_0x35efcf,_0x550d9d){return function(_0x28d0f0){_0x550d9d['emit'](_0x35efcf,_0x28d0f0);};}function removeListener(_0x36234c,_0x50cbba){return function(){DashboardItemEvents[_0x7635('0x2')](_0x36234c,_0x50cbba);};}exports[_0x7635('0x3')]=function(_0x40d05e){for(var _0x194917=0x0,_0x53c45d=events[_0x7635('0x4')];_0x194917<_0x53c45d;_0x194917++){var _0x3774a9=events[_0x194917];var _0x25d5fb=createListener('dashboardItem:'+_0x3774a9,_0x40d05e);DashboardItemEvents['on'](_0x3774a9,_0x25d5fb);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 73d623d..c2c2c05 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 _0xc22a=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./dashboardItem.controller','get','isAuthenticated','show','post','create','put','/:id','update'];(function(_0x267716,_0x29b70c){var _0x276aff=function(_0x558091){while(--_0x558091){_0x267716['push'](_0x267716['shift']());}};_0x276aff(++_0x29b70c);}(_0xc22a,0x100));var _0xac22=function(_0x3b53db,_0x29aae1){_0x3b53db=_0x3b53db-0x0;var _0x434acf=_0xc22a[_0x3b53db];return _0x434acf;};'use strict';var multer=require(_0xac22('0x0'));var util=require(_0xac22('0x1'));var path=require(_0xac22('0x2'));var timeout=require(_0xac22('0x3'));var express=require(_0xac22('0x4'));var router=express['Router']();var fs_extra=require(_0xac22('0x5'));var auth=require(_0xac22('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xac22('0x7'));router[_0xac22('0x8')]('/:id',auth[_0xac22('0x9')](),controller[_0xac22('0xa')]);router[_0xac22('0xb')]('/',auth['isAuthenticated'](),controller[_0xac22('0xc')]);router[_0xac22('0xd')](_0xac22('0xe'),auth[_0xac22('0x9')](),controller[_0xac22('0xf')]);router['delete'](_0xac22('0xe'),auth[_0xac22('0x9')](),controller['destroy']);module[_0xac22('0x10')]=router; \ No newline at end of file +var _0x465c=['create','put','update','delete','destroy','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','post'];(function(_0xda8d0b,_0x1fe50e){var _0x5d5d42=function(_0x3530b9){while(--_0x3530b9){_0xda8d0b['push'](_0xda8d0b['shift']());}};_0x5d5d42(++_0x1fe50e);}(_0x465c,0x6b));var _0xc465=function(_0xa4dbda,_0x518506){_0xa4dbda=_0xa4dbda-0x0;var _0x5ecb4d=_0x465c[_0xa4dbda];return _0x5ecb4d;};'use strict';var multer=require('multer');var util=require(_0xc465('0x0'));var path=require(_0xc465('0x1'));var timeout=require('connect-timeout');var express=require(_0xc465('0x2'));var router=express[_0xc465('0x3')]();var fs_extra=require(_0xc465('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc465('0x5'));var config=require(_0xc465('0x6'));var controller=require(_0xc465('0x7'));router[_0xc465('0x8')](_0xc465('0x9'),auth[_0xc465('0xa')](),controller['show']);router[_0xc465('0xb')]('/',auth[_0xc465('0xa')](),controller[_0xc465('0xc')]);router[_0xc465('0xd')](_0xc465('0x9'),auth[_0xc465('0xa')](),controller[_0xc465('0xe')]);router[_0xc465('0xf')](_0xc465('0x9'),auth[_0xc465('0xa')](),controller[_0xc465('0x10')]);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 9deb7e5..39e5a26 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 _0x7b8b=['third','sequelize','STRING','first'];(function(_0x274247,_0x32b42d){var _0x48accf=function(_0x51f4cb){while(--_0x51f4cb){_0x274247['push'](_0x274247['shift']());}};_0x48accf(++_0x32b42d);}(_0x7b8b,0x175));var _0xb7b8=function(_0x1196b0,_0x36c47a){_0x1196b0=_0x1196b0-0x0;var _0x111c52=_0x7b8b[_0x1196b0];return _0x111c52;};'use strict';var Sequelize=require(_0xb7b8('0x0'));module['exports']={'name':{'type':Sequelize[_0xb7b8('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xb7b8('0x2'),'second',_0xb7b8('0x3')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0xb7b8('0x1')]}}; \ No newline at end of file +var _0x39c0=['STRING','ENUM','first','second','third'];(function(_0x294048,_0x47755b){var _0x9f75af=function(_0x23ad7e){while(--_0x23ad7e){_0x294048['push'](_0x294048['shift']());}};_0x9f75af(++_0x47755b);}(_0x39c0,0x12c));var _0x039c=function(_0x1f0c78,_0x13a822){_0x1f0c78=_0x1f0c78-0x0;var _0x438560=_0x39c0[_0x1f0c78];return _0x438560;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x039c('0x0')],'allowNull':![]},'level':{'type':Sequelize[_0x039c('0x1')](_0x039c('0x2'),_0x039c('0x3'),_0x039c('0x4')),'allowNull':![],'defaultValue':_0x039c('0x2')},'description':{'type':Sequelize[_0x039c('0x0')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index d03285b..f012917 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 _0x713a=['eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','findAll','catch','show','params','length','includeAll','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body'];(function(_0x4f1a1f,_0x23a5f8){var _0x344c71=function(_0x584104){while(--_0x584104){_0x4f1a1f['push'](_0x4f1a1f['shift']());}};_0x344c71(++_0x23a5f8);}(_0x713a,0x14c));var _0xa713=function(_0x559003,_0x10b1af){_0x559003=_0x559003-0x0;var _0x3cccf5=_0x713a[_0x559003];return _0x3cccf5;};'use strict';var emlformat=require(_0xa713('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa713('0x1'));var rp=require(_0xa713('0x2'));var moment=require(_0xa713('0x3'));var BPromise=require(_0xa713('0x4'));var Mustache=require(_0xa713('0x5'));var util=require(_0xa713('0x6'));var path=require(_0xa713('0x7'));var sox=require(_0xa713('0x8'));var csv=require('to-csv');var ejs=require(_0xa713('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa713('0xa'));var jsforce=require(_0xa713('0xb'));var deskjs=require(_0xa713('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa713('0xd'));var Redis=require(_0xa713('0xe'));var authService=require(_0xa713('0xf'));var qs=require(_0xa713('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa713('0x11'));var logger=require('../../config/logger')(_0xa713('0x12'));var utils=require(_0xa713('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa713('0x14'))['db'];function respondWithStatusCode(_0x530e41,_0x141692){_0x141692=_0x141692||0xcc;return function(_0x18b239){if(_0x18b239){return _0x530e41[_0xa713('0x15')](_0x141692);}return _0x530e41[_0xa713('0x16')](_0x141692)[_0xa713('0x17')]();};}function respondWithResult(_0x46889b,_0x577b2f){_0x577b2f=_0x577b2f||0xc8;return function(_0xfd8b51){if(_0xfd8b51){return _0x46889b[_0xa713('0x16')](_0x577b2f)['json'](_0xfd8b51);}};}function respondWithFilteredResult(_0x358451,_0x12f37d){return function(_0x22785e){if(_0x22785e){var _0xc79d92=typeof _0x12f37d['offset']===_0xa713('0x18')&&typeof _0x12f37d[_0xa713('0x19')]===_0xa713('0x18');var _0x3981f3=_0x22785e[_0xa713('0x1a')];var _0x4953dc=_0xc79d92?0x0:_0x12f37d[_0xa713('0x1b')];var _0x8371d3=_0xc79d92?_0x22785e['count']:_0x12f37d[_0xa713('0x1b')]+_0x12f37d[_0xa713('0x19')];var _0x2f3ef5;if(_0x8371d3>=_0x3981f3){_0x8371d3=_0x3981f3;_0x2f3ef5=0xc8;}else{_0x2f3ef5=0xce;}_0x358451[_0xa713('0x16')](_0x2f3ef5);return _0x358451[_0xa713('0x1c')](_0xa713('0x1d'),_0x4953dc+'-'+_0x8371d3+'/'+_0x3981f3)[_0xa713('0x1e')](_0x22785e);}return null;};}function patchUpdates(_0x47986b){return function(_0x1f98b8){try{jsonpatch[_0xa713('0x1f')](_0x1f98b8,_0x47986b,!![]);}catch(_0x3f8773){return BPromise[_0xa713('0x20')](_0x3f8773);}return _0x1f98b8[_0xa713('0x21')]();};}function saveUpdates(_0x3066e3,_0x6e8f74){return function(_0x1f010f){if(_0x1f010f){return _0x1f010f[_0xa713('0x22')](_0x3066e3)[_0xa713('0x23')](function(_0x3a988e){return _0x3a988e;});}return null;};}function removeEntity(_0x1e3a69,_0x13919d){return function(_0x4f4cbc){if(_0x4f4cbc){return _0x4f4cbc[_0xa713('0x24')]()[_0xa713('0x23')](function(){var _0x423166=_0x4f4cbc[_0xa713('0x25')]({'plain':!![]});var _0x492db5=_0xa713('0x26');return db[_0xa713('0x27')]['destroy']({'where':{'type':_0x492db5,'resourceId':_0x423166['id']}})[_0xa713('0x23')](function(){return _0x4f4cbc;});})[_0xa713('0x23')](function(){_0x1e3a69[_0xa713('0x16')](0xcc)[_0xa713('0x17')]();});}};}function handleEntityNotFound(_0xabdea2,_0x4beae9){return function(_0x3f61dc){if(!_0x3f61dc){_0xabdea2[_0xa713('0x15')](0x194);}return _0x3f61dc;};}function handleError(_0x10c36a,_0x2ad3d7){_0x2ad3d7=_0x2ad3d7||0x1f4;return function(_0x311064){logger[_0xa713('0x28')](_0x311064[_0xa713('0x29')]);if(_0x311064[_0xa713('0x2a')]){delete _0x311064['name'];}_0x10c36a[_0xa713('0x16')](_0x2ad3d7)[_0xa713('0x2b')](_0x311064);};}exports[_0xa713('0x2c')]=function(_0x384424,_0x17c818){var _0x5288ed={},_0x1a66df={},_0x2109a4={'count':0x0,'rows':[]};var _0x544cbd=_[_0xa713('0x2d')](db[_0xa713('0x2e')][_0xa713('0x2f')],function(_0x159db0){return{'name':_0x159db0[_0xa713('0x30')],'type':_0x159db0[_0xa713('0x31')][_0xa713('0x32')]};});_0x1a66df[_0xa713('0x33')]=_[_0xa713('0x2d')](_0x544cbd,_0xa713('0x2a'));_0x1a66df[_0xa713('0x34')]=_[_0xa713('0x35')](_0x384424[_0xa713('0x34')]);_0x1a66df[_0xa713('0x36')]=_['intersection'](_0x1a66df['model'],_0x1a66df[_0xa713('0x34')]);_0x5288ed[_0xa713('0x37')]=_[_0xa713('0x38')](_0x1a66df[_0xa713('0x33')],qs[_0xa713('0x39')](_0x384424[_0xa713('0x34')]['fields']));_0x5288ed[_0xa713('0x37')]=_0x5288ed[_0xa713('0x37')]['length']?_0x5288ed[_0xa713('0x37')]:_0x1a66df[_0xa713('0x33')];if(!_0x384424[_0xa713('0x34')][_0xa713('0x3a')](_0xa713('0x3b'))){_0x5288ed[_0xa713('0x19')]=qs[_0xa713('0x19')](_0x384424[_0xa713('0x34')][_0xa713('0x19')]);_0x5288ed[_0xa713('0x1b')]=qs[_0xa713('0x1b')](_0x384424['query'][_0xa713('0x1b')]);}_0x5288ed['order']=qs[_0xa713('0x3c')](_0x384424[_0xa713('0x34')][_0xa713('0x3c')]);_0x5288ed[_0xa713('0x3d')]=qs[_0xa713('0x36')](_[_0xa713('0x3e')](_0x384424[_0xa713('0x34')],_0x1a66df[_0xa713('0x36')]),_0x544cbd);if(_0x384424['query']['filter']){_0x5288ed[_0xa713('0x3d')]=_[_0xa713('0x3f')](_0x5288ed[_0xa713('0x3d')],{'$or':_[_0xa713('0x2d')](_0x544cbd,function(_0xe41503){if(_0xe41503[_0xa713('0x31')]!==_0xa713('0x40')){var _0x2e45a3={};_0x2e45a3[_0xe41503[_0xa713('0x2a')]]={'$like':'%'+_0x384424[_0xa713('0x34')][_0xa713('0x41')]+'%'};return _0x2e45a3;}})});}_0x5288ed=_[_0xa713('0x3f')]({},_0x5288ed,_0x384424[_0xa713('0x42')]);var _0x2220ce={'where':_0x5288ed[_0xa713('0x3d')]};return db[_0xa713('0x2e')][_0xa713('0x1a')](_0x2220ce)[_0xa713('0x23')](function(_0x307f53){_0x2109a4[_0xa713('0x1a')]=_0x307f53;if(_0x384424[_0xa713('0x34')]['includeAll']){_0x5288ed['include']=[{'all':!![]}];}return db[_0xa713('0x2e')][_0xa713('0x43')](_0x5288ed);})['then'](function(_0x22dea5){_0x2109a4['rows']=_0x22dea5;return _0x2109a4;})[_0xa713('0x23')](respondWithFilteredResult(_0x17c818,_0x5288ed))[_0xa713('0x44')](handleError(_0x17c818,null));};exports[_0xa713('0x45')]=function(_0x42b4e8,_0x5a3988){var _0x31b20b={'raw':!![],'where':{'id':_0x42b4e8[_0xa713('0x46')]['id']}},_0x4039ea={};_0x4039ea[_0xa713('0x33')]=_[_0xa713('0x35')](db[_0xa713('0x2e')]['rawAttributes']);_0x4039ea[_0xa713('0x34')]=_[_0xa713('0x35')](_0x42b4e8['query']);_0x4039ea[_0xa713('0x36')]=_[_0xa713('0x38')](_0x4039ea[_0xa713('0x33')],_0x4039ea['query']);_0x31b20b['attributes']=_[_0xa713('0x38')](_0x4039ea[_0xa713('0x33')],qs[_0xa713('0x39')](_0x42b4e8['query']['fields']));_0x31b20b[_0xa713('0x37')]=_0x31b20b[_0xa713('0x37')][_0xa713('0x47')]?_0x31b20b[_0xa713('0x37')]:_0x4039ea[_0xa713('0x33')];if(_0x42b4e8[_0xa713('0x34')][_0xa713('0x48')]){_0x31b20b[_0xa713('0x49')]=[{'all':!![]}];}_0x31b20b=_['merge']({},_0x31b20b,_0x42b4e8['options']);return db['Disposition'][_0xa713('0x4a')](_0x31b20b)[_0xa713('0x23')](handleEntityNotFound(_0x5a3988,null))[_0xa713('0x23')](respondWithResult(_0x5a3988,null))[_0xa713('0x44')](handleError(_0x5a3988,null));};exports[_0xa713('0x4b')]=function(_0x1e8f13,_0x12d029){return db['Disposition']['create'](_0x1e8f13['body'],{})['then'](function(_0x2634dc){var _0x2133bb=_0x1e8f13[_0xa713('0x4c')]['get']({'plain':!![]});if(!_0x2133bb)throw new Error(_0xa713('0x4d'));if(_0x2133bb[_0xa713('0x4e')]===_0xa713('0x4c')){var _0x5180dc=_0x2634dc[_0xa713('0x25')]({'plain':!![]});var _0x185d52=_0xa713('0x26');return db[_0xa713('0x4f')][_0xa713('0x4a')]({'where':{'name':_0x185d52,'userProfileId':_0x2133bb['userProfileId']},'raw':!![]})[_0xa713('0x23')](function(_0x3127a4){if(_0x3127a4&&_0x3127a4[_0xa713('0x50')]===0x0){return db[_0xa713('0x27')][_0xa713('0x4b')]({'name':_0x5180dc[_0xa713('0x2a')],'resourceId':_0x5180dc['id'],'type':_0x3127a4[_0xa713('0x2a')],'sectionId':_0x3127a4['id']},{})[_0xa713('0x23')](function(){return _0x2634dc;});}else{return _0x2634dc;}})[_0xa713('0x44')](function(_0x3721da){logger[_0xa713('0x28')](_0xa713('0x51'),_0x3721da);throw _0x3721da;});}return _0x2634dc;})['then'](respondWithResult(_0x12d029,0xc9))['catch'](handleError(_0x12d029,null));};exports[_0xa713('0x22')]=function(_0x3c23f2,_0x461ac1){if(_0x3c23f2['body']['id']){delete _0x3c23f2[_0xa713('0x52')]['id'];}return db[_0xa713('0x2e')][_0xa713('0x4a')]({'where':{'id':_0x3c23f2['params']['id']}})[_0xa713('0x23')](handleEntityNotFound(_0x461ac1,null))[_0xa713('0x23')](saveUpdates(_0x3c23f2[_0xa713('0x52')],null))[_0xa713('0x23')](respondWithResult(_0x461ac1,null))[_0xa713('0x44')](handleError(_0x461ac1,null));};exports[_0xa713('0x24')]=function(_0x52de63,_0x3e1a4a){return db[_0xa713('0x2e')][_0xa713('0x4a')]({'where':{'id':_0x52de63[_0xa713('0x46')]['id']}})['then'](handleEntityNotFound(_0x3e1a4a,null))['then'](removeEntity(_0x3e1a4a,null))[_0xa713('0x44')](handleError(_0x3e1a4a,null));}; \ No newline at end of file +var _0x0002=['model','query','keys','intersection','attributes','fields','length','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','show','params','rawAttributes','filters','find','catch','create','body','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','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','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','error','stack','name','send','map','Disposition','fieldName','key'];(function(_0x5e8a9b,_0x439e33){var _0xf9fe32=function(_0x1509d2){while(--_0x1509d2){_0x5e8a9b['push'](_0x5e8a9b['shift']());}};_0xf9fe32(++_0x439e33);}(_0x0002,0x1a9));var _0x2000=function(_0x4280bb,_0x50098f){_0x4280bb=_0x4280bb-0x0;var _0x36d1c8=_0x0002[_0x4280bb];return _0x36d1c8;};'use strict';var emlformat=require(_0x2000('0x0'));var rimraf=require(_0x2000('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2000('0x2'));var moment=require('moment');var BPromise=require(_0x2000('0x3'));var Mustache=require(_0x2000('0x4'));var util=require('util');var path=require(_0x2000('0x5'));var sox=require(_0x2000('0x6'));var csv=require(_0x2000('0x7'));var ejs=require(_0x2000('0x8'));var fs=require('fs');var fs_extra=require(_0x2000('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2000('0xa'));var jsforce=require(_0x2000('0xb'));var deskjs=require(_0x2000('0xc'));var toCsv=require(_0x2000('0x7'));var querystring=require(_0x2000('0xd'));var Papa=require(_0x2000('0xe'));var Redis=require(_0x2000('0xf'));var authService=require(_0x2000('0x10'));var qs=require(_0x2000('0x11'));var as=require(_0x2000('0x12'));var hardwareService=require(_0x2000('0x13'));var logger=require(_0x2000('0x14'))(_0x2000('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2000('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x307859,_0x59bfb6){_0x59bfb6=_0x59bfb6||0xcc;return function(_0x19d8fa){if(_0x19d8fa){return _0x307859[_0x2000('0x17')](_0x59bfb6);}return _0x307859[_0x2000('0x18')](_0x59bfb6)[_0x2000('0x19')]();};}function respondWithResult(_0x16ad37,_0x113b2f){_0x113b2f=_0x113b2f||0xc8;return function(_0x141e41){if(_0x141e41){return _0x16ad37[_0x2000('0x18')](_0x113b2f)[_0x2000('0x1a')](_0x141e41);}};}function respondWithFilteredResult(_0x230243,_0x1cf845){return function(_0x18a644){if(_0x18a644){var _0x1eecaf=typeof _0x1cf845['offset']===_0x2000('0x1b')&&typeof _0x1cf845[_0x2000('0x1c')]===_0x2000('0x1b');var _0x56420b=_0x18a644[_0x2000('0x1d')];var _0x2e3933=_0x1eecaf?0x0:_0x1cf845[_0x2000('0x1e')];var _0x458130=_0x1eecaf?_0x18a644[_0x2000('0x1d')]:_0x1cf845[_0x2000('0x1e')]+_0x1cf845['limit'];var _0x1245e9;if(_0x458130>=_0x56420b){_0x458130=_0x56420b;_0x1245e9=0xc8;}else{_0x1245e9=0xce;}_0x230243[_0x2000('0x18')](_0x1245e9);return _0x230243[_0x2000('0x1f')](_0x2000('0x20'),_0x2e3933+'-'+_0x458130+'/'+_0x56420b)['json'](_0x18a644);}return null;};}function patchUpdates(_0xac71a2){return function(_0x19467b){try{jsonpatch[_0x2000('0x21')](_0x19467b,_0xac71a2,!![]);}catch(_0x58cbac){return BPromise[_0x2000('0x22')](_0x58cbac);}return _0x19467b[_0x2000('0x23')]();};}function saveUpdates(_0x32b600,_0x45c5be){return function(_0x577ba8){if(_0x577ba8){return _0x577ba8[_0x2000('0x24')](_0x32b600)[_0x2000('0x25')](function(_0x26e420){return _0x26e420;});}return null;};}function removeEntity(_0x1a7bda,_0xb9055a){return function(_0x42f381){if(_0x42f381){return _0x42f381[_0x2000('0x26')]()['then'](function(){var _0x1437fd=_0x42f381[_0x2000('0x27')]({'plain':!![]});var _0x20e2a2=_0x2000('0x28');return db['UserProfileResource'][_0x2000('0x26')]({'where':{'type':_0x20e2a2,'resourceId':_0x1437fd['id']}})[_0x2000('0x25')](function(){return _0x42f381;});})['then'](function(){_0x1a7bda[_0x2000('0x18')](0xcc)[_0x2000('0x19')]();});}};}function handleEntityNotFound(_0x43faa1,_0x4fc282){return function(_0xee9c02){if(!_0xee9c02){_0x43faa1[_0x2000('0x17')](0x194);}return _0xee9c02;};}function handleError(_0x58ad02,_0x1352b5){_0x1352b5=_0x1352b5||0x1f4;return function(_0x4a673a){logger[_0x2000('0x29')](_0x4a673a[_0x2000('0x2a')]);if(_0x4a673a[_0x2000('0x2b')]){delete _0x4a673a[_0x2000('0x2b')];}_0x58ad02[_0x2000('0x18')](_0x1352b5)[_0x2000('0x2c')](_0x4a673a);};}exports['index']=function(_0x58400a,_0x1d0ae9){var _0x388bf6={},_0x1d45e9={},_0x2da53f={'count':0x0,'rows':[]};var _0x59ac52=_[_0x2000('0x2d')](db[_0x2000('0x2e')]['rawAttributes'],function(_0xdf5fae){return{'name':_0xdf5fae[_0x2000('0x2f')],'type':_0xdf5fae['type'][_0x2000('0x30')]};});_0x1d45e9[_0x2000('0x31')]=_[_0x2000('0x2d')](_0x59ac52,_0x2000('0x2b'));_0x1d45e9[_0x2000('0x32')]=_[_0x2000('0x33')](_0x58400a[_0x2000('0x32')]);_0x1d45e9['filters']=_[_0x2000('0x34')](_0x1d45e9[_0x2000('0x31')],_0x1d45e9[_0x2000('0x32')]);_0x388bf6[_0x2000('0x35')]=_['intersection'](_0x1d45e9['model'],qs[_0x2000('0x36')](_0x58400a[_0x2000('0x32')][_0x2000('0x36')]));_0x388bf6[_0x2000('0x35')]=_0x388bf6['attributes'][_0x2000('0x37')]?_0x388bf6[_0x2000('0x35')]:_0x1d45e9[_0x2000('0x31')];if(!_0x58400a[_0x2000('0x32')]['hasOwnProperty']('nolimit')){_0x388bf6[_0x2000('0x1c')]=qs[_0x2000('0x1c')](_0x58400a[_0x2000('0x32')]['limit']);_0x388bf6[_0x2000('0x1e')]=qs[_0x2000('0x1e')](_0x58400a[_0x2000('0x32')][_0x2000('0x1e')]);}_0x388bf6[_0x2000('0x38')]=qs['sort'](_0x58400a['query'][_0x2000('0x39')]);_0x388bf6[_0x2000('0x3a')]=qs['filters'](_[_0x2000('0x3b')](_0x58400a['query'],_0x1d45e9['filters']),_0x59ac52);if(_0x58400a[_0x2000('0x32')]['filter']){_0x388bf6[_0x2000('0x3a')]=_[_0x2000('0x3c')](_0x388bf6['where'],{'$or':_[_0x2000('0x2d')](_0x59ac52,function(_0x5ca95b){if(_0x5ca95b[_0x2000('0x3d')]!==_0x2000('0x3e')){var _0x33e6bb={};_0x33e6bb[_0x5ca95b[_0x2000('0x2b')]]={'$like':'%'+_0x58400a[_0x2000('0x32')]['filter']+'%'};return _0x33e6bb;}})});}_0x388bf6=_[_0x2000('0x3c')]({},_0x388bf6,_0x58400a[_0x2000('0x3f')]);var _0xc55685={'where':_0x388bf6['where']};return db['Disposition'][_0x2000('0x1d')](_0xc55685)[_0x2000('0x25')](function(_0x445423){_0x2da53f['count']=_0x445423;if(_0x58400a['query'][_0x2000('0x40')]){_0x388bf6[_0x2000('0x41')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x388bf6);})['then'](function(_0x1396eb){_0x2da53f['rows']=_0x1396eb;return _0x2da53f;})['then'](respondWithFilteredResult(_0x1d0ae9,_0x388bf6))['catch'](handleError(_0x1d0ae9,null));};exports[_0x2000('0x42')]=function(_0xd6463a,_0xf2dcb5){var _0x225427={'raw':!![],'where':{'id':_0xd6463a[_0x2000('0x43')]['id']}},_0xb0abff={};_0xb0abff[_0x2000('0x31')]=_[_0x2000('0x33')](db['Disposition'][_0x2000('0x44')]);_0xb0abff[_0x2000('0x32')]=_[_0x2000('0x33')](_0xd6463a[_0x2000('0x32')]);_0xb0abff[_0x2000('0x45')]=_['intersection'](_0xb0abff[_0x2000('0x31')],_0xb0abff[_0x2000('0x32')]);_0x225427[_0x2000('0x35')]=_['intersection'](_0xb0abff[_0x2000('0x31')],qs[_0x2000('0x36')](_0xd6463a['query'][_0x2000('0x36')]));_0x225427['attributes']=_0x225427[_0x2000('0x35')][_0x2000('0x37')]?_0x225427[_0x2000('0x35')]:_0xb0abff[_0x2000('0x31')];if(_0xd6463a['query']['includeAll']){_0x225427[_0x2000('0x41')]=[{'all':!![]}];}_0x225427=_[_0x2000('0x3c')]({},_0x225427,_0xd6463a['options']);return db[_0x2000('0x2e')][_0x2000('0x46')](_0x225427)['then'](handleEntityNotFound(_0xf2dcb5,null))[_0x2000('0x25')](respondWithResult(_0xf2dcb5,null))[_0x2000('0x47')](handleError(_0xf2dcb5,null));};exports[_0x2000('0x48')]=function(_0x4d70f9,_0x31d773){return db[_0x2000('0x2e')]['create'](_0x4d70f9[_0x2000('0x49')],{})[_0x2000('0x25')](function(_0x1e2be8){var _0xfcd9ba=_0x4d70f9[_0x2000('0x4a')]['get']({'plain':!![]});if(!_0xfcd9ba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfcd9ba['role']===_0x2000('0x4a')){var _0x327fd8=_0x1e2be8[_0x2000('0x27')]({'plain':!![]});var _0xcbd24a=_0x2000('0x28');return db[_0x2000('0x4b')][_0x2000('0x46')]({'where':{'name':_0xcbd24a,'userProfileId':_0xfcd9ba[_0x2000('0x4c')]},'raw':!![]})[_0x2000('0x25')](function(_0x9cf530){if(_0x9cf530&&_0x9cf530['autoAssociation']===0x0){return db[_0x2000('0x4d')]['create']({'name':_0x327fd8['name'],'resourceId':_0x327fd8['id'],'type':_0x9cf530[_0x2000('0x2b')],'sectionId':_0x9cf530['id']},{})['then'](function(){return _0x1e2be8;});}else{return _0x1e2be8;}})[_0x2000('0x47')](function(_0x308fe4){logger[_0x2000('0x29')](_0x2000('0x4e'),_0x308fe4);throw _0x308fe4;});}return _0x1e2be8;})[_0x2000('0x25')](respondWithResult(_0x31d773,0xc9))[_0x2000('0x47')](handleError(_0x31d773,null));};exports[_0x2000('0x24')]=function(_0x541728,_0x40ea54){if(_0x541728[_0x2000('0x49')]['id']){delete _0x541728[_0x2000('0x49')]['id'];}return db['Disposition'][_0x2000('0x46')]({'where':{'id':_0x541728['params']['id']}})[_0x2000('0x25')](handleEntityNotFound(_0x40ea54,null))[_0x2000('0x25')](saveUpdates(_0x541728[_0x2000('0x49')],null))['then'](respondWithResult(_0x40ea54,null))[_0x2000('0x47')](handleError(_0x40ea54,null));};exports[_0x2000('0x26')]=function(_0x5ce110,_0x26ffc2){return db['Disposition']['find']({'where':{'id':_0x5ce110[_0x2000('0x43')]['id']}})['then'](handleEntityNotFound(_0x26ffc2,null))[_0x2000('0x25')](removeEntity(_0x26ffc2,null))[_0x2000('0x47')](handleError(_0x26ffc2,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 0bb2b39..a6c979d 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 _0x94a1=['FaxAccountId','name_openchannel','name_whatsapp','WhatsappAccountId','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','SmsAccountId','name_fax'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x94a1,0x101));var _0x194a=function(_0x40f3c9,_0x44c131){_0x40f3c9=_0x40f3c9-0x0;var _0xd1e54c=_0x94a1[_0x40f3c9];return _0xd1e54c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x194a('0x0'))(_0x194a('0x1'));var moment=require(_0x194a('0x2'));var BPromise=require(_0x194a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x194a('0x4'));var config=require(_0x194a('0x5'));var attributes=require('./disposition.attributes');module[_0x194a('0x6')]=function(_0x13d353,_0x35c701){return _0x13d353[_0x194a('0x7')](_0x194a('0x8'),attributes,{'tableName':_0x194a('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x194a('0xa'),'fields':[_0x194a('0xb'),_0x194a('0xc')]},{'unique':!![],'name':_0x194a('0xd'),'fields':[_0x194a('0xb'),_0x194a('0xe')]},{'unique':!![],'name':_0x194a('0xf'),'fields':[_0x194a('0xb'),_0x194a('0x10')]},{'unique':!![],'name':'name_sms','fields':[_0x194a('0xb'),_0x194a('0x11')]},{'unique':!![],'name':_0x194a('0x12'),'fields':['name',_0x194a('0x13')]},{'unique':!![],'name':_0x194a('0x14'),'fields':[_0x194a('0xb'),'OpenchannelAccountId']},{'unique':!![],'name':_0x194a('0x15'),'fields':[_0x194a('0xb'),_0x194a('0x16')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb0b0=['name','name_chat','ChatWebsiteId','name_mail','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','WhatsappAccountId','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','Disposition','tools_dispositions','name_voice'];(function(_0x1f69a0,_0x561598){var _0x14ce9e=function(_0x5b8e20){while(--_0x5b8e20){_0x1f69a0['push'](_0x1f69a0['shift']());}};_0x14ce9e(++_0x561598);}(_0xb0b0,0x196));var _0x0b0b=function(_0x4fb433,_0xa28b4f){_0x4fb433=_0x4fb433-0x0;var _0x163d5c=_0xb0b0[_0x4fb433];return _0x163d5c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0b0b('0x0'))(_0x0b0b('0x1'));var moment=require(_0x0b0b('0x2'));var BPromise=require(_0x0b0b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b0b('0x4'));var rimraf=require(_0x0b0b('0x5'));var config=require(_0x0b0b('0x6'));var attributes=require('./disposition.attributes');module[_0x0b0b('0x7')]=function(_0x582186,_0xa784cc){return _0x582186[_0x0b0b('0x8')](_0x0b0b('0x9'),attributes,{'tableName':_0x0b0b('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x0b0b('0xb'),'fields':[_0x0b0b('0xc'),'ListId']},{'unique':!![],'name':_0x0b0b('0xd'),'fields':[_0x0b0b('0xc'),_0x0b0b('0xe')]},{'unique':!![],'name':_0x0b0b('0xf'),'fields':[_0x0b0b('0xc'),'MailAccountId']},{'unique':!![],'name':'name_sms','fields':[_0x0b0b('0xc'),_0x0b0b('0x10')]},{'unique':!![],'name':_0x0b0b('0x11'),'fields':[_0x0b0b('0xc'),_0x0b0b('0x12')]},{'unique':!![],'name':_0x0b0b('0x13'),'fields':[_0x0b0b('0xc'),_0x0b0b('0x14')]},{'unique':!![],'name':'name_whatsapp','fields':['name',_0x0b0b('0x15')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index ac534e9..a0d1815 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(_0x4d5516,_0x5cb9ee){var _0x5ca81d=function(_0x7056eb){while(--_0x7056eb){_0x4d5516['push'](_0x4d5516['shift']());}};_0x5ca81d(++_0x5cb9ee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x3f4554,_0x4b142a){var _0x5911bb=function(_0x142ca0){while(--_0x142ca0){_0x3f4554['push'](_0x3f4554['shift']());}};_0x5911bb(++_0x4b142a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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 af7cc44..cf297e0 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 _0x6e74=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x437294,_0x1f96ed){var _0x15b595=function(_0x20f6e3){while(--_0x20f6e3){_0x437294['push'](_0x437294['shift']());}};_0x15b595(++_0x1f96ed);}(_0x6e74,0xe0));var _0x46e7=function(_0x33d6ed,_0x170890){_0x33d6ed=_0x33d6ed-0x0;var _0x47b25d=_0x6e74[_0x33d6ed];return _0x47b25d;};'use strict';var multer=require(_0x46e7('0x0'));var util=require(_0x46e7('0x1'));var path=require(_0x46e7('0x2'));var timeout=require(_0x46e7('0x3'));var express=require(_0x46e7('0x4'));var router=express[_0x46e7('0x5')]();var fs_extra=require(_0x46e7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x46e7('0x7'));var config=require(_0x46e7('0x8'));var controller=require('./disposition.controller');router['get']('/',auth[_0x46e7('0x9')](),controller[_0x46e7('0xa')]);router[_0x46e7('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x46e7('0xc')]);router[_0x46e7('0xd')]('/',auth[_0x46e7('0x9')](),controller[_0x46e7('0xe')]);router[_0x46e7('0xf')](_0x46e7('0x10'),auth['isAuthenticated'](),controller[_0x46e7('0x11')]);router[_0x46e7('0x12')](_0x46e7('0x10'),auth[_0x46e7('0x9')](),controller[_0x46e7('0x13')]);module[_0x46e7('0x14')]=router; \ No newline at end of file +var _0xa635=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','/:id','isAuthenticated','show','create','update','delete','destroy','exports','multer','util','path','Router'];(function(_0x55157b,_0x4f2765){var _0xd1c936=function(_0xde9443){while(--_0xde9443){_0x55157b['push'](_0x55157b['shift']());}};_0xd1c936(++_0x4f2765);}(_0xa635,0xd4));var _0x5a63=function(_0x40ed4a,_0x41489f){_0x40ed4a=_0x40ed4a-0x0;var _0x22a743=_0xa635[_0x40ed4a];return _0x22a743;};'use strict';var multer=require(_0x5a63('0x0'));var util=require(_0x5a63('0x1'));var path=require(_0x5a63('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5a63('0x3')]();var fs_extra=require(_0x5a63('0x4'));var auth=require(_0x5a63('0x5'));var interaction=require(_0x5a63('0x6'));var config=require(_0x5a63('0x7'));var controller=require(_0x5a63('0x8'));router[_0x5a63('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5a63('0x9')](_0x5a63('0xa'),auth[_0x5a63('0xb')](),controller[_0x5a63('0xc')]);router['post']('/',auth[_0x5a63('0xb')](),controller[_0x5a63('0xd')]);router['put'](_0x5a63('0xa'),auth['isAuthenticated'](),controller[_0x5a63('0xe')]);router[_0x5a63('0xf')](_0x5a63('0xa'),auth['isAuthenticated'](),controller[_0x5a63('0x10')]);module[_0x5a63('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 2beffff..a8d0859 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 _0xdce6=['v17,v27,v29','INTEGER','SIP','IAX','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','sequelize','STRING','ENUM','yes','localstationid','2400','4800','7200','9600','14400'];(function(_0x27f81e,_0x51aca1){var _0x49199f=function(_0x1f7080){while(--_0x1f7080){_0x27f81e['push'](_0x27f81e['shift']());}};_0x49199f(++_0x51aca1);}(_0xdce6,0x146));var _0x6dce=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xdce6[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x6dce('0x0'));module['exports']={'name':{'type':Sequelize[_0x6dce('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x6dce('0x1')]},'ecm':{'type':Sequelize[_0x6dce('0x2')](_0x6dce('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x6dce('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x6dce('0x1')],'unique':_0x6dce('0x4')},'minrate':{'type':Sequelize[_0x6dce('0x2')](_0x6dce('0x5'),_0x6dce('0x6'),_0x6dce('0x7'),'9600','12000','14400'),'defaultValue':_0x6dce('0x6')},'maxrate':{'type':Sequelize[_0x6dce('0x2')]('2400',_0x6dce('0x6'),_0x6dce('0x7'),_0x6dce('0x8'),'12000','14400'),'defaultValue':_0x6dce('0x9')},'modem':{'type':Sequelize[_0x6dce('0x1')],'defaultValue':_0x6dce('0xa')},'gateway':{'type':Sequelize[_0x6dce('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x6dce('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x6dce('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x6dce('0x2')](_0x6dce('0xc'),_0x6dce('0xd'),'DADHI',_0x6dce('0xe')),'defaultValue':_0x6dce('0xc')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x6dce('0xf')],'defaultValue':function(){return _0x6dce('0x10');}},'notificationSound':{'type':Sequelize[_0x6dce('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6dce('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6dce('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6dce('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6dce('0xb')],'allowNull':!![],'defaultValue':null,'comment':_0x6dce('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x6dce('0x11')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5a42eb){if(!_0x5a42eb)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x6dce('0x13')](_0x6dce('0x14'),_0x5a42eb);}}}; \ No newline at end of file +var _0xd7a5=['14400','v17,v27,v29','IAX','KHOMP','SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','STRING','yes','localstationid','ENUM','4800','7200','9600','12000'];(function(_0x4acab4,_0x4c03a4){var _0xeec79b=function(_0x4b87ce){while(--_0x4b87ce){_0x4acab4['push'](_0x4acab4['shift']());}};_0xeec79b(++_0x4c03a4);}(_0xd7a5,0xb4));var _0x5d7a=function(_0x13606d,_0x30f265){_0x13606d=_0x13606d-0x0;var _0x1b85b0=_0xd7a5[_0x13606d];return _0x1b85b0;};'use strict';var Sequelize=require(_0x5d7a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5d7a('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0x5d7a('0x2'),'no'),'defaultValue':_0x5d7a('0x2')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x5d7a('0x1')],'unique':_0x5d7a('0x3')},'minrate':{'type':Sequelize[_0x5d7a('0x4')]('2400',_0x5d7a('0x5'),_0x5d7a('0x6'),_0x5d7a('0x7'),_0x5d7a('0x8'),_0x5d7a('0x9')),'defaultValue':_0x5d7a('0x5')},'maxrate':{'type':Sequelize[_0x5d7a('0x4')]('2400',_0x5d7a('0x5'),_0x5d7a('0x6'),'9600','12000',_0x5d7a('0x9')),'defaultValue':_0x5d7a('0x9')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x5d7a('0xa')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x5d7a('0x4')]('SIP',_0x5d7a('0xb'),'DADHI',_0x5d7a('0xc')),'defaultValue':_0x5d7a('0xd')},'key':{'type':Sequelize[_0x5d7a('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x5d7a('0xe')],'defaultValue':function(){return _0x5d7a('0xf');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5d7a('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5d7a('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5d7a('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x5d7a('0x10')],'defaultValue':![],'comment':_0x5d7a('0x12'),'set':function(_0x512c38){if(!_0x512c38)this[_0x5d7a('0x13')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x5d7a('0x14'),_0x512c38);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index e9b212d..13d3365 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 _0x2a82=['mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','http','client','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','sendStatus','end','status','offset','limit','undefined','set','Content-Range','json','apply','reject','save','update','destroy','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','FaxAccounts','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','sort','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','fullname','internal','Tags','color','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','context','from-voip-provider','exten','localstationid','app','system','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','minrate','modem','t38timeout','FAXOPT(','Wait','ReceiveFax','addAccountApplications','VoiceExtension','createdAt','updatedAt','ListId','findById','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x30bd4d,_0x50eb60){var _0x306915=function(_0x5ae782){while(--_0x5ae782){_0x30bd4d['push'](_0x30bd4d['shift']());}};_0x306915(++_0x50eb60);}(_0x2a82,0xc5));var _0x22a8=function(_0x1a7e3e,_0x37b092){_0x1a7e3e=_0x1a7e3e-0x0;var _0x1138ca=_0x2a82[_0x1a7e3e];return _0x1138ca;};'use strict';var emlformat=require(_0x22a8('0x0'));var rimraf=require(_0x22a8('0x1'));var zipdir=require(_0x22a8('0x2'));var jsonpatch=require(_0x22a8('0x3'));var rp=require(_0x22a8('0x4'));var moment=require(_0x22a8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x22a8('0x6'));var util=require(_0x22a8('0x7'));var path=require(_0x22a8('0x8'));var sox=require(_0x22a8('0x9'));var csv=require(_0x22a8('0xa'));var ejs=require(_0x22a8('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x22a8('0xc'));var squel=require(_0x22a8('0xd'));var crypto=require('crypto');var jsforce=require(_0x22a8('0xe'));var deskjs=require(_0x22a8('0xf'));var toCsv=require('to-csv');var querystring=require(_0x22a8('0x10'));var Papa=require('papaparse');var Redis=require(_0x22a8('0x11'));var authService=require(_0x22a8('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x22a8('0x13'));var hardwareService=require(_0x22a8('0x14'));var logger=require(_0x22a8('0x15'))('api');var utils=require(_0x22a8('0x16'));var config=require(_0x22a8('0x17'));var licenseUtil=require(_0x22a8('0x18'));var db=require(_0x22a8('0x19'))['db'];config[_0x22a8('0x1a')]=_[_0x22a8('0x1b')](config[_0x22a8('0x1a')],{'host':_0x22a8('0x1c'),'port':0x18eb});var socket=require(_0x22a8('0x1d'))(new Redis(config[_0x22a8('0x1a')]));require(_0x22a8('0x1e'))[_0x22a8('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x22a8('0x20')]({'port':0x232c});var client9002=jayson[_0x22a8('0x21')][_0x22a8('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x27c0b1,_0x56cae1,_0x3e4a23,_0x4ecd26){return new BPromise(function(_0x163891,_0x4f0a3e){var _0x3ca42f=_0x4ecd26||client;return _0x3ca42f[_0x22a8('0x22')](_0x27c0b1,_0x3e4a23)[_0x22a8('0x23')](function(_0xdee1a3){logger['info'](_0x22a8('0x24'),_0x56cae1,_0x22a8('0x25'));logger['debug'](_0x22a8('0x26'),_0x56cae1,_0x22a8('0x25'),JSON[_0x22a8('0x27')](_0xdee1a3));if(_0xdee1a3[_0x22a8('0x28')]){if(_0xdee1a3[_0x22a8('0x28')]['code']===0x1f4){logger[_0x22a8('0x28')](_0x22a8('0x24'),_0x56cae1,_0xdee1a3[_0x22a8('0x28')][_0x22a8('0x29')]);return _0x4f0a3e(_0xdee1a3[_0x22a8('0x28')][_0x22a8('0x29')]);}logger['error'](_0x22a8('0x24'),_0x56cae1,_0xdee1a3[_0x22a8('0x28')][_0x22a8('0x29')]);return _0x163891(_0xdee1a3[_0x22a8('0x28')][_0x22a8('0x29')]);}else{logger[_0x22a8('0x2a')](_0x22a8('0x24'),_0x56cae1,'request\x20sent');_0x163891(_0xdee1a3['result']['message']);}})['catch'](function(_0xa8d91e){logger[_0x22a8('0x28')](_0x22a8('0x24'),_0x56cae1,_0xa8d91e);_0x4f0a3e(_0xa8d91e);});});}function respondWithStatusCode(_0x1b0d42,_0x4a795c){_0x4a795c=_0x4a795c||0xcc;return function(_0x5cc2a3){if(_0x5cc2a3){return _0x1b0d42[_0x22a8('0x2b')](_0x4a795c);}return _0x1b0d42['status'](_0x4a795c)[_0x22a8('0x2c')]();};}function respondWithResult(_0xf660ae,_0xa7a235){_0xa7a235=_0xa7a235||0xc8;return function(_0x1a4a71){if(_0x1a4a71){return _0xf660ae[_0x22a8('0x2d')](_0xa7a235)['json'](_0x1a4a71);}};}function respondWithFilteredResult(_0x2d6d34,_0x435a34){return function(_0x3720fd){if(_0x3720fd){var _0x5eef31=typeof _0x435a34[_0x22a8('0x2e')]==='undefined'&&typeof _0x435a34[_0x22a8('0x2f')]===_0x22a8('0x30');var _0x57fde0=_0x3720fd['count'];var _0x5634e9=_0x5eef31?0x0:_0x435a34[_0x22a8('0x2e')];var _0x18db21=_0x5eef31?_0x3720fd['count']:_0x435a34['offset']+_0x435a34[_0x22a8('0x2f')];var _0x27f690;if(_0x18db21>=_0x57fde0){_0x18db21=_0x57fde0;_0x27f690=0xc8;}else{_0x27f690=0xce;}_0x2d6d34[_0x22a8('0x2d')](_0x27f690);return _0x2d6d34[_0x22a8('0x31')](_0x22a8('0x32'),_0x5634e9+'-'+_0x18db21+'/'+_0x57fde0)[_0x22a8('0x33')](_0x3720fd);}return null;};}function patchUpdates(_0x5ceb8e){return function(_0x10fbb6){try{jsonpatch[_0x22a8('0x34')](_0x10fbb6,_0x5ceb8e,!![]);}catch(_0x33519d){return BPromise[_0x22a8('0x35')](_0x33519d);}return _0x10fbb6[_0x22a8('0x36')]();};}function saveUpdates(_0x21641a,_0xdfef7b){return function(_0x52b5e4){if(_0x52b5e4){return _0x52b5e4[_0x22a8('0x37')](_0x21641a)[_0x22a8('0x23')](function(_0x338352){return _0x338352;});}return null;};}function removeEntity(_0x522d78,_0x51ecd4){return function(_0x46cfc2){if(_0x46cfc2){return _0x46cfc2[_0x22a8('0x38')]()[_0x22a8('0x23')](function(){var _0x5863d5=_0x46cfc2['get']({'plain':!![]});var _0x129bba='FaxAccounts';return db[_0x22a8('0x39')][_0x22a8('0x38')]({'where':{'type':_0x129bba,'resourceId':_0x5863d5['id']}})[_0x22a8('0x23')](function(){return _0x46cfc2;});})[_0x22a8('0x23')](function(){_0x522d78[_0x22a8('0x2d')](0xcc)[_0x22a8('0x2c')]();});}};}function handleEntityNotFound(_0x4919e4,_0x389beb){return function(_0x1acb00){if(!_0x1acb00){_0x4919e4[_0x22a8('0x2b')](0x194);}return _0x1acb00;};}function handleError(_0x225404,_0x1a2731){_0x1a2731=_0x1a2731||0x1f4;return function(_0xa0545c){logger[_0x22a8('0x28')](_0xa0545c['stack']);if(_0xa0545c[_0x22a8('0x3a')]){delete _0xa0545c[_0x22a8('0x3a')];}_0x225404[_0x22a8('0x2d')](_0x1a2731)[_0x22a8('0x3b')](_0xa0545c);};}exports[_0x22a8('0x3c')]=function(_0x31ec95,_0x7ba93d){var _0x3cd8a4={'include':[{'model':db[_0x22a8('0x3d')],'as':_0x22a8('0x3e')}]},_0x2e6fce={},_0x5036c9={'count':0x0,'rows':[]};var _0x495d88=_[_0x22a8('0x3f')](db[_0x22a8('0x40')][_0x22a8('0x41')],function(_0x7a86f0){return{'name':_0x7a86f0[_0x22a8('0x42')],'type':_0x7a86f0[_0x22a8('0x43')][_0x22a8('0x44')]};});_0x2e6fce[_0x22a8('0x45')]=_['map'](_0x495d88,'name');_0x2e6fce[_0x22a8('0x46')]=_[_0x22a8('0x47')](_0x31ec95[_0x22a8('0x46')]);_0x2e6fce['filters']=_[_0x22a8('0x48')](_0x2e6fce[_0x22a8('0x45')],_0x2e6fce['query']);_0x3cd8a4['attributes']=_[_0x22a8('0x48')](_0x2e6fce[_0x22a8('0x45')],qs[_0x22a8('0x49')](_0x31ec95[_0x22a8('0x46')][_0x22a8('0x49')]));_0x3cd8a4['attributes']=_0x3cd8a4[_0x22a8('0x4a')][_0x22a8('0x4b')]?_0x3cd8a4['attributes']:_0x2e6fce[_0x22a8('0x45')];if(!_0x31ec95[_0x22a8('0x46')][_0x22a8('0x4c')](_0x22a8('0x4d'))){_0x3cd8a4['limit']=qs['limit'](_0x31ec95[_0x22a8('0x46')][_0x22a8('0x2f')]);_0x3cd8a4[_0x22a8('0x2e')]=qs[_0x22a8('0x2e')](_0x31ec95['query'][_0x22a8('0x2e')]);}_0x3cd8a4[_0x22a8('0x4e')]=qs['sort'](_0x31ec95[_0x22a8('0x46')]['sort']);_0x3cd8a4[_0x22a8('0x4f')]=qs[_0x22a8('0x50')](_[_0x22a8('0x51')](_0x31ec95[_0x22a8('0x46')],_0x2e6fce['filters']),_0x495d88);if(_0x31ec95[_0x22a8('0x46')][_0x22a8('0x52')]){_0x3cd8a4[_0x22a8('0x4f')]=_[_0x22a8('0x53')](_0x3cd8a4[_0x22a8('0x4f')],{'$or':_['map'](_0x495d88,function(_0x292c86){if(_0x292c86[_0x22a8('0x43')]!==_0x22a8('0x54')){var _0x273150={};_0x273150[_0x292c86[_0x22a8('0x3a')]]={'$like':'%'+_0x31ec95[_0x22a8('0x46')][_0x22a8('0x52')]+'%'};return _0x273150;}})});}_0x3cd8a4=_[_0x22a8('0x53')]({},_0x3cd8a4,_0x31ec95[_0x22a8('0x55')]);var _0x20bf18={'where':_0x3cd8a4[_0x22a8('0x4f')]};return db[_0x22a8('0x40')][_0x22a8('0x56')](_0x20bf18)[_0x22a8('0x23')](function(_0x4db936){_0x5036c9[_0x22a8('0x56')]=_0x4db936;if(_0x31ec95[_0x22a8('0x46')][_0x22a8('0x57')]){_0x3cd8a4[_0x22a8('0x58')]=[{'all':!![]}];}return db['FaxAccount'][_0x22a8('0x59')](_0x3cd8a4);})[_0x22a8('0x23')](function(_0x41a828){_0x5036c9[_0x22a8('0x5a')]=_0x41a828;return _0x5036c9;})[_0x22a8('0x23')](respondWithFilteredResult(_0x7ba93d,_0x3cd8a4))[_0x22a8('0x5b')](handleError(_0x7ba93d,null));};exports['show']=function(_0x39253d,_0x1f9a1e){var _0x5a32c8={'raw':![],'where':{'id':_0x39253d['params']['id']},'include':[{'model':db[_0x22a8('0x3d')],'as':_0x22a8('0x3e')}]},_0x4c88a7={};_0x4c88a7['model']=_[_0x22a8('0x47')](db[_0x22a8('0x40')]['rawAttributes']);_0x4c88a7[_0x22a8('0x46')]=_[_0x22a8('0x47')](_0x39253d[_0x22a8('0x46')]);_0x4c88a7['filters']=_[_0x22a8('0x48')](_0x4c88a7[_0x22a8('0x45')],_0x4c88a7[_0x22a8('0x46')]);_0x5a32c8['attributes']=_[_0x22a8('0x48')](_0x4c88a7[_0x22a8('0x45')],qs[_0x22a8('0x49')](_0x39253d[_0x22a8('0x46')][_0x22a8('0x49')]));_0x5a32c8[_0x22a8('0x4a')]=_0x5a32c8['attributes'][_0x22a8('0x4b')]?_0x5a32c8[_0x22a8('0x4a')]:_0x4c88a7[_0x22a8('0x45')];if(_0x39253d['query'][_0x22a8('0x57')]){_0x5a32c8[_0x22a8('0x58')]=[{'all':!![]}];}_0x5a32c8=_['merge']({},_0x5a32c8,_0x39253d[_0x22a8('0x55')]);return db[_0x22a8('0x40')][_0x22a8('0x5c')](_0x5a32c8)[_0x22a8('0x23')](handleEntityNotFound(_0x1f9a1e,null))[_0x22a8('0x23')](respondWithResult(_0x1f9a1e,null))[_0x22a8('0x5b')](handleError(_0x1f9a1e,null));};exports[_0x22a8('0x5d')]=function(_0x14df14,_0x41d513){return db[_0x22a8('0x40')][_0x22a8('0x5d')](_0x14df14[_0x22a8('0x5e')],{})[_0x22a8('0x23')](function(_0x28d9ca){var _0x3b56e1=_0x14df14[_0x22a8('0x5f')]['get']({'plain':!![]});if(!_0x3b56e1)throw new Error(_0x22a8('0x60'));if(_0x3b56e1[_0x22a8('0x61')]==='user'){var _0x5711d7=_0x28d9ca[_0x22a8('0x62')]({'plain':!![]});var _0x4d2089=_0x22a8('0x63');return db[_0x22a8('0x64')]['find']({'where':{'name':_0x4d2089,'userProfileId':_0x3b56e1[_0x22a8('0x65')]},'raw':!![]})[_0x22a8('0x23')](function(_0xf4d089){if(_0xf4d089&&_0xf4d089['autoAssociation']===0x0){return db[_0x22a8('0x39')][_0x22a8('0x5d')]({'name':_0x5711d7[_0x22a8('0x3a')],'resourceId':_0x5711d7['id'],'type':_0xf4d089[_0x22a8('0x3a')],'sectionId':_0xf4d089['id']},{})['then'](function(){return _0x28d9ca;});}else{return _0x28d9ca;}})[_0x22a8('0x5b')](function(_0x3b0483){logger[_0x22a8('0x28')](_0x22a8('0x66'),_0x3b0483);throw _0x3b0483;});}return _0x28d9ca;})['then'](respondWithResult(_0x41d513,0xc9))[_0x22a8('0x5b')](handleError(_0x41d513,null));};exports[_0x22a8('0x37')]=function(_0x413a65,_0x418d76){if(_0x413a65['body']['id']){delete _0x413a65[_0x22a8('0x5e')]['id'];}return db[_0x22a8('0x40')][_0x22a8('0x5c')]({'where':{'id':_0x413a65[_0x22a8('0x67')]['id']},'include':[{'model':db[_0x22a8('0x3d')],'as':_0x22a8('0x3e')}]})[_0x22a8('0x23')](handleEntityNotFound(_0x418d76,null))[_0x22a8('0x23')](saveUpdates(_0x413a65['body'],null))['then'](respondWithResult(_0x418d76,null))['catch'](handleError(_0x418d76,null));};exports[_0x22a8('0x38')]=function(_0x1edac6,_0x4e88ec){return db[_0x22a8('0x40')]['find']({'where':{'id':_0x1edac6[_0x22a8('0x67')]['id']}})[_0x22a8('0x23')](handleEntityNotFound(_0x4e88ec,null))[_0x22a8('0x23')](removeEntity(_0x4e88ec,null))[_0x22a8('0x5b')](handleError(_0x4e88ec,null));};exports['describe']=function(_0xd93ab3,_0x3a343d){return db[_0x22a8('0x40')][_0x22a8('0x68')]()[_0x22a8('0x23')](respondWithResult(_0x3a343d,null))[_0x22a8('0x5b')](handleError(_0x3a343d,null));};exports[_0x22a8('0x69')]=function(_0x5ddfdc,_0x47c40c,_0x46d041){if(_0x5ddfdc[_0x22a8('0x5e')]['id']){delete _0x5ddfdc[_0x22a8('0x5e')]['id'];}return db['FaxAccount'][_0x22a8('0x5c')]({'where':{'id':_0x5ddfdc['params']['id']}})[_0x22a8('0x23')](handleEntityNotFound(_0x47c40c,null))[_0x22a8('0x23')](function(_0x3c14eb){if(_0x3c14eb){_0x5ddfdc[_0x22a8('0x5e')][_0x22a8('0x6a')]=_0x3c14eb['id'];return db[_0x22a8('0x6b')][_0x22a8('0x5d')](_0x5ddfdc['body']);}})['then'](respondWithResult(_0x47c40c,null))[_0x22a8('0x5b')](handleError(_0x47c40c,null));};exports[_0x22a8('0x6c')]=function(_0x5724fc,_0x41518a,_0x29609f){var _0x12a692={'raw':![],'where':{}};var _0x4454a2={};var _0x2f5d10={'count':0x0,'rows':[]};return db[_0x22a8('0x40')][_0x22a8('0x6d')]({'where':{'id':_0x5724fc['params']['id']}})[_0x22a8('0x23')](handleEntityNotFound(_0x41518a,null))[_0x22a8('0x23')](function(_0x2a5bc6){if(_0x2a5bc6){_0x4454a2[_0x22a8('0x45')]=_['keys'](db[_0x22a8('0x6b')][_0x22a8('0x41')]);_0x4454a2[_0x22a8('0x46')]=_[_0x22a8('0x47')](_0x5724fc[_0x22a8('0x46')]);_0x4454a2[_0x22a8('0x50')]=_['intersection'](_0x4454a2['model'],_0x4454a2[_0x22a8('0x46')]);_0x12a692[_0x22a8('0x4a')]=_[_0x22a8('0x48')](_0x4454a2[_0x22a8('0x45')],qs['fields'](_0x5724fc['query'][_0x22a8('0x49')]));_0x12a692['attributes']=_0x12a692[_0x22a8('0x4a')][_0x22a8('0x4b')]?_0x12a692[_0x22a8('0x4a')]:_0x4454a2['model'];if(!_0x5724fc[_0x22a8('0x46')]['hasOwnProperty']('nolimit')){_0x12a692[_0x22a8('0x2f')]=qs[_0x22a8('0x2f')](_0x5724fc[_0x22a8('0x46')][_0x22a8('0x2f')]);_0x12a692[_0x22a8('0x2e')]=qs[_0x22a8('0x2e')](_0x5724fc[_0x22a8('0x46')][_0x22a8('0x2e')]);}_0x12a692['order']=qs[_0x22a8('0x6e')](_0x5724fc[_0x22a8('0x46')]['sort']);_0x12a692[_0x22a8('0x4f')]=qs[_0x22a8('0x50')](_[_0x22a8('0x51')](_0x5724fc[_0x22a8('0x46')],_0x4454a2[_0x22a8('0x50')]));_0x12a692[_0x22a8('0x4f')][_0x22a8('0x6a')]=_0x2a5bc6['id'];if(_0x5724fc[_0x22a8('0x46')][_0x22a8('0x52')]){_0x12a692[_0x22a8('0x4f')]=_[_0x22a8('0x53')](_0x12a692['where'],{'$or':_['map'](_0x12a692[_0x22a8('0x4a')],function(_0x2734d6){var _0x269cbe={};_0x269cbe[_0x2734d6]={'$like':'%'+_0x5724fc[_0x22a8('0x46')][_0x22a8('0x52')]+'%'};return _0x269cbe;})});}_0x12a692=_['merge']({},_0x12a692,_0x5724fc[_0x22a8('0x55')]);return db[_0x22a8('0x6b')][_0x22a8('0x56')]({'where':_0x12a692[_0x22a8('0x4f')]})['then'](function(_0x2e172c){_0x2f5d10[_0x22a8('0x56')]=_0x2e172c;if(_0x5724fc[_0x22a8('0x46')][_0x22a8('0x57')]){_0x12a692[_0x22a8('0x58')]=[{'all':!![]}];}return db[_0x22a8('0x6b')][_0x22a8('0x59')](_0x12a692);})[_0x22a8('0x23')](function(_0x566ad1){_0x2f5d10[_0x22a8('0x5a')]=_0x566ad1;return _0x2f5d10;});}})[_0x22a8('0x23')](respondWithFilteredResult(_0x41518a,_0x12a692))['catch'](handleError(_0x41518a,null));};exports[_0x22a8('0x6f')]=function(_0x2a83ad,_0x351260,_0x191472){return db[_0x22a8('0x40')][_0x22a8('0x5c')]({'where':{'id':_0x2a83ad[_0x22a8('0x67')]['id']}})[_0x22a8('0x23')](handleEntityNotFound(_0x351260,null))[_0x22a8('0x23')](function(_0x5115ca){if(_0x5115ca){return _0x5115ca[_0x22a8('0x6f')](_0x2a83ad[_0x22a8('0x46')][_0x22a8('0x70')]);}})['then'](respondWithStatusCode(_0x351260,null))[_0x22a8('0x5b')](handleError(_0x351260,null));};exports[_0x22a8('0x71')]=function(_0x5c22aa,_0x18891e,_0x4634cd){if(_0x5c22aa['body']['id']){delete _0x5c22aa[_0x22a8('0x5e')]['id'];}return db[_0x22a8('0x40')]['find']({'where':{'id':_0x5c22aa[_0x22a8('0x67')]['id']}})['then'](handleEntityNotFound(_0x18891e,null))[_0x22a8('0x23')](function(_0xa44fe3){if(_0xa44fe3){_0x5c22aa[_0x22a8('0x5e')][_0x22a8('0x6a')]=_0xa44fe3['id'];return db[_0x22a8('0x72')][_0x22a8('0x5d')](_0x5c22aa[_0x22a8('0x5e')]);}})['then'](respondWithResult(_0x18891e,null))['catch'](handleError(_0x18891e,null));};exports[_0x22a8('0x73')]=function(_0x264e82,_0x361256,_0x106b28){var _0x263194={'raw':![],'where':{}};var _0x16bb09={};var _0x2db94d={'count':0x0,'rows':[]};return db[_0x22a8('0x40')]['findOne']({'where':{'id':_0x264e82[_0x22a8('0x67')]['id']}})['then'](handleEntityNotFound(_0x361256,null))['then'](function(_0x55a7da){if(_0x55a7da){_0x16bb09[_0x22a8('0x45')]=_[_0x22a8('0x47')](db[_0x22a8('0x72')]['rawAttributes']);_0x16bb09[_0x22a8('0x46')]=_['keys'](_0x264e82[_0x22a8('0x46')]);_0x16bb09[_0x22a8('0x50')]=_[_0x22a8('0x48')](_0x16bb09[_0x22a8('0x45')],_0x16bb09[_0x22a8('0x46')]);_0x263194['attributes']=_['intersection'](_0x16bb09['model'],qs[_0x22a8('0x49')](_0x264e82[_0x22a8('0x46')]['fields']));_0x263194[_0x22a8('0x4a')]=_0x263194[_0x22a8('0x4a')][_0x22a8('0x4b')]?_0x263194['attributes']:_0x16bb09['model'];if(!_0x264e82[_0x22a8('0x46')][_0x22a8('0x4c')](_0x22a8('0x4d'))){_0x263194['limit']=qs['limit'](_0x264e82[_0x22a8('0x46')][_0x22a8('0x2f')]);_0x263194[_0x22a8('0x2e')]=qs[_0x22a8('0x2e')](_0x264e82[_0x22a8('0x46')][_0x22a8('0x2e')]);}_0x263194[_0x22a8('0x4e')]=qs[_0x22a8('0x6e')](_0x264e82[_0x22a8('0x46')][_0x22a8('0x6e')]);_0x263194[_0x22a8('0x4f')]=qs[_0x22a8('0x50')](_[_0x22a8('0x51')](_0x264e82[_0x22a8('0x46')],_0x16bb09['filters']));_0x263194[_0x22a8('0x4f')]['FaxAccountId']=_0x55a7da['id'];if(_0x264e82['query'][_0x22a8('0x52')]){_0x263194[_0x22a8('0x4f')]=_['merge'](_0x263194['where'],{'$or':_[_0x22a8('0x3f')](_0x263194['attributes'],function(_0x2f73e1){var _0x1eb945={};_0x1eb945[_0x2f73e1]={'$like':'%'+_0x264e82['query'][_0x22a8('0x52')]+'%'};return _0x1eb945;})});}_0x263194=_[_0x22a8('0x53')]({},_0x263194,_0x264e82[_0x22a8('0x55')]);return db['CannedAnswer'][_0x22a8('0x56')]({'where':_0x263194[_0x22a8('0x4f')]})[_0x22a8('0x23')](function(_0x57e23f){_0x2db94d[_0x22a8('0x56')]=_0x57e23f;if(_0x264e82[_0x22a8('0x46')][_0x22a8('0x57')]){_0x263194[_0x22a8('0x58')]=[{'all':!![]}];}return db[_0x22a8('0x72')][_0x22a8('0x59')](_0x263194);})[_0x22a8('0x23')](function(_0x318a2f){_0x2db94d[_0x22a8('0x5a')]=_0x318a2f;return _0x2db94d;});}})[_0x22a8('0x23')](respondWithFilteredResult(_0x361256,_0x263194))[_0x22a8('0x5b')](handleError(_0x361256,null));};exports[_0x22a8('0x74')]=function(_0x5a2050,_0x149b12,_0x1808fc){return db['FaxAccount']['find']({'where':{'id':_0x5a2050[_0x22a8('0x67')]['id']}})['then'](handleEntityNotFound(_0x149b12,null))[_0x22a8('0x23')](function(_0x26a6fa){if(_0x26a6fa){return _0x26a6fa[_0x22a8('0x74')](_0x5a2050[_0x22a8('0x46')][_0x22a8('0x70')]);}})[_0x22a8('0x23')](respondWithStatusCode(_0x149b12,null))[_0x22a8('0x5b')](handleError(_0x149b12,null));};exports[_0x22a8('0x75')]=function(_0x4f11d3,_0x2eac4b,_0x3c616f){return db[_0x22a8('0x76')]['find']({'where':{'id':_0x4f11d3[_0x22a8('0x67')]['id']}})[_0x22a8('0x23')](handleEntityNotFound(_0x2eac4b,null))[_0x22a8('0x23')](function(_0x235199){if(_0x235199){return _0x235199['addInteraction'](_0x4f11d3[_0x22a8('0x5e')][_0x22a8('0x70')],_[_0x22a8('0x77')](_0x4f11d3[_0x22a8('0x5e')],[_0x22a8('0x70'),'id'])||{});}})[_0x22a8('0x23')](respondWithResult(_0x2eac4b,null))[_0x22a8('0x5b')](handleError(_0x2eac4b,null));};exports[_0x22a8('0x78')]=function(_0x5185e0,_0x3527a3,_0x42711b){var _0x2bcc8c={'raw':![],'where':{}};var _0x4f39ab={};var _0xda1aa4={'count':0x0,'rows':[]};return db['FaxAccount'][_0x22a8('0x6d')]({'where':{'id':_0x5185e0[_0x22a8('0x67')]['id']}})[_0x22a8('0x23')](handleEntityNotFound(_0x3527a3,null))[_0x22a8('0x23')](function(_0x3b75de){if(_0x3b75de){_0x4f39ab[_0x22a8('0x45')]=_[_0x22a8('0x47')](db[_0x22a8('0x76')][_0x22a8('0x41')]);_0x4f39ab[_0x22a8('0x46')]=_[_0x22a8('0x47')](_0x5185e0[_0x22a8('0x46')]);_0x4f39ab[_0x22a8('0x50')]=_[_0x22a8('0x48')](_0x4f39ab[_0x22a8('0x45')],_0x4f39ab['query']);_0x2bcc8c[_0x22a8('0x4a')]=_[_0x22a8('0x48')](_0x4f39ab[_0x22a8('0x45')],qs['fields'](_0x5185e0[_0x22a8('0x46')][_0x22a8('0x49')]));_0x2bcc8c['attributes']=_0x2bcc8c[_0x22a8('0x4a')][_0x22a8('0x4b')]?_0x2bcc8c[_0x22a8('0x4a')]:_0x4f39ab[_0x22a8('0x45')];if(!_0x5185e0[_0x22a8('0x46')][_0x22a8('0x4c')]('nolimit')){_0x2bcc8c['limit']=qs[_0x22a8('0x2f')](_0x5185e0['query']['limit']);_0x2bcc8c[_0x22a8('0x2e')]=qs['offset'](_0x5185e0['query']['offset']);}_0x2bcc8c['order']=qs[_0x22a8('0x6e')](_0x5185e0['query'][_0x22a8('0x6e')]);_0x2bcc8c['where']=qs[_0x22a8('0x50')](_[_0x22a8('0x51')](_0x5185e0[_0x22a8('0x46')],_0x4f39ab[_0x22a8('0x50')]));_0x2bcc8c[_0x22a8('0x4f')][_0x22a8('0x6a')]=_0x3b75de['id'];if(_0x5185e0['query'][_0x22a8('0x52')]){_0x2bcc8c['where']=_[_0x22a8('0x53')](_0x2bcc8c[_0x22a8('0x4f')],{'$or':_[_0x22a8('0x3f')](_0x2bcc8c['attributes'],function(_0x33c7a5){var _0x22e9c8={};_0x22e9c8[_0x33c7a5]={'$like':'%'+_0x5185e0[_0x22a8('0x46')][_0x22a8('0x52')]+'%'};return _0x22e9c8;})});}_0x2bcc8c=_['merge']({},_0x2bcc8c,_0x5185e0[_0x22a8('0x55')]);return db['FaxInteraction']['count']({'where':_0x2bcc8c[_0x22a8('0x4f')]})[_0x22a8('0x23')](function(_0x242bef){_0xda1aa4[_0x22a8('0x56')]=_0x242bef;if(_0x5185e0[_0x22a8('0x46')][_0x22a8('0x57')]){_0x2bcc8c['include']=[{'model':db[_0x22a8('0x79')],'as':_0x22a8('0x7a'),'required':![]},{'model':db[_0x22a8('0x7b')],'as':'Owner','attributes':[_0x22a8('0x3a'),_0x22a8('0x7c'),_0x22a8('0x7d')],'required':![]},{'model':db['Tag'],'as':_0x22a8('0x7e'),'attributes':['id',_0x22a8('0x3a'),_0x22a8('0x7f')],'where':_0x5185e0[_0x22a8('0x46')][_0x22a8('0x80')]?{'id':_0x5185e0['query']['tag']}:undefined,'required':_0x5185e0[_0x22a8('0x46')]['tag']?!![]:![]}];}return db[_0x22a8('0x76')][_0x22a8('0x59')](_0x2bcc8c);})['then'](function(_0x7dcfe7){_0xda1aa4[_0x22a8('0x5a')]=_0x7dcfe7;return _0xda1aa4;});}})[_0x22a8('0x23')](respondWithFilteredResult(_0x3527a3,_0x2bcc8c))[_0x22a8('0x5b')](handleError(_0x3527a3,null));};exports[_0x22a8('0x81')]=function(_0x29754d,_0x8e104e){var _0x8255f2=_0x29754d[_0x22a8('0x67')]['id'];var _0x549e1f=_0x29754d[_0x22a8('0x5e')];var _0x772f97=0xc8;var _0x4075a4=null;return db[_0x22a8('0x82')][_0x22a8('0x83')]({'isolationLevel':db[_0x22a8('0x82')]['Transaction'][_0x22a8('0x84')][_0x22a8('0x85')]},function(_0xcea7ce){return db[_0x22a8('0x40')][_0x22a8('0x6d')]({'where':{'id':_0x8255f2},'transaction':_0xcea7ce})[_0x22a8('0x23')](function(_0x2c6746){if(_0x2c6746){return db[_0x22a8('0x86')]['destroy']({'where':{'FaxAccountId':_0x8255f2},'transaction':_0xcea7ce})[_0x22a8('0x23')](function(){var _0xc6f435=_[_0x22a8('0x3f')](_0x549e1f,function(_0x284663){_0x284663[_0x22a8('0x6a')]=_0x8255f2;return _0x284663;});return db['FaxApplication'][_0x22a8('0x87')](_0xc6f435,{'transaction':_0xcea7ce});});}else{_0x772f97=0x194;_0x4075a4=[];}});})['then'](function(){if(_0x772f97!==0x194){return db[_0x22a8('0x86')][_0x22a8('0x88')]({'where':{'FaxAccountId':_0x8255f2},'order':_0x22a8('0x89')})['then'](function(_0x20c3c2){_0x4075a4=_0x20c3c2;});}})[_0x22a8('0x5b')](function(_0x2b48c0){_0x772f97=0x1f4;logger[_0x22a8('0x28')](_0x2b48c0[_0x22a8('0x8a')]);if(_0x2b48c0['name']){delete _0x2b48c0[_0x22a8('0x3a')];}_0x4075a4=_0x2b48c0;})[_0x22a8('0x8b')](function(){if(_0x4075a4===null){_0x8e104e['sendStatus'](_0x772f97);}else{if(_0x772f97===0x1f4){_0x8e104e[_0x22a8('0x2d')](_0x772f97)[_0x22a8('0x3b')](_0x4075a4);}else{_0x8e104e['status'](_0x772f97)['json'](_0x4075a4);}}});};exports[_0x22a8('0x8c')]=function(_0x50186b,_0x35f209,_0x41c332){var _0x44e084={};var _0x4847ed={};var _0x103f06;var _0x273802;return db[_0x22a8('0x40')]['findOne']({'where':{'id':_0x50186b['params']['id']}})[_0x22a8('0x23')](handleEntityNotFound(_0x35f209,null))[_0x22a8('0x23')](function(_0x5742d7){if(_0x5742d7){_0x103f06=_0x5742d7;_0x4847ed['model']=_[_0x22a8('0x47')](db[_0x22a8('0x86')][_0x22a8('0x41')]);_0x4847ed[_0x22a8('0x46')]=_[_0x22a8('0x47')](_0x50186b[_0x22a8('0x46')]);_0x4847ed[_0x22a8('0x50')]=_[_0x22a8('0x48')](_0x4847ed['model'],_0x4847ed['query']);_0x44e084[_0x22a8('0x4a')]=_[_0x22a8('0x48')](_0x4847ed[_0x22a8('0x45')],qs[_0x22a8('0x49')](_0x50186b[_0x22a8('0x46')]['fields']));_0x44e084['attributes']=_0x44e084[_0x22a8('0x4a')]['length']?_0x44e084[_0x22a8('0x4a')]:_0x4847ed[_0x22a8('0x45')];_0x44e084[_0x22a8('0x4e')]=qs['sort'](_0x50186b['query'][_0x22a8('0x6e')]);_0x44e084[_0x22a8('0x4f')]=qs[_0x22a8('0x50')](_['pick'](_0x50186b['query'],_0x4847ed['filters']));if(_0x50186b['query'][_0x22a8('0x52')]){_0x44e084[_0x22a8('0x4f')]=_[_0x22a8('0x53')](_0x44e084[_0x22a8('0x4f')],{'$or':_['map'](_0x44e084['attributes'],function(_0x1b1a7f){var _0x3bd3be={};_0x3bd3be[_0x1b1a7f]={'$like':'%'+_0x50186b[_0x22a8('0x46')][_0x22a8('0x52')]+'%'};return _0x3bd3be;})});}_0x44e084=_[_0x22a8('0x53')]({},_0x44e084,_0x50186b[_0x22a8('0x55')]);return _0x103f06[_0x22a8('0x8c')](_0x44e084);}})['then'](function(_0x4eaf18){if(_0x4eaf18){_0x273802=_0x4eaf18[_0x22a8('0x4b')];if(!_0x50186b[_0x22a8('0x46')][_0x22a8('0x4c')](_0x22a8('0x4d'))){_0x44e084[_0x22a8('0x2f')]=qs[_0x22a8('0x2f')](_0x50186b[_0x22a8('0x46')][_0x22a8('0x2f')]);_0x44e084[_0x22a8('0x2e')]=qs[_0x22a8('0x2e')](_0x50186b[_0x22a8('0x46')][_0x22a8('0x2e')]);}return _0x103f06['getApplications'](_0x44e084);}})[_0x22a8('0x23')](function(_0xedbec2){if(_0xedbec2){return _0xedbec2?{'count':_0x273802,'rows':_0xedbec2}:null;}})[_0x22a8('0x23')](respondWithResult(_0x35f209,null))['catch'](handleError(_0x35f209,null));};function Extension(_0xbbf0a9,_0x293b88,_0x35d9af,_0x3f5aa5){this[_0x22a8('0x8d')]=_0x22a8('0x8e');this[_0x22a8('0x8f')]=_0xbbf0a9[_0x22a8('0x90')];this[_0x22a8('0x91')]=_0x3f5aa5;this[_0x22a8('0x43')]=_0x22a8('0x92');this['description']=_0x22a8('0x93');this['FaxAccountId']=_0xbbf0a9['id'];this[_0x22a8('0x89')]=_0x293b88;this[_0x22a8('0x94')]=_0x35d9af;}function createExtensionsReciveFax(_0x26f97c){var _0x4fc7e4=0x1;var _0x4a5073=[];_0x4a5073[_0x22a8('0x95')](new Extension(_0x26f97c,_0x4fc7e4,'',_0x22a8('0x96')));_0x4fc7e4+=0x1;_0x4a5073[_0x22a8('0x95')](new Extension(_0x26f97c,_0x4fc7e4,_0x22a8('0x97'),_0x22a8('0x98')));_0x4fc7e4+=0x1;for(var _0x27b1f6 in _0x26f97c){if(_0x26f97c[_0x22a8('0x4c')](_0x27b1f6)&&(_0x27b1f6===_0x22a8('0x99')||_0x27b1f6===_0x22a8('0x90')||_0x27b1f6===_0x22a8('0x9a')||_0x27b1f6===_0x22a8('0x9b')||_0x27b1f6==='headerinfo'||_0x27b1f6==='maxrate'||_0x27b1f6===_0x22a8('0x9c')||_0x27b1f6===_0x22a8('0x9d')||_0x27b1f6===_0x22a8('0x9e'))){_0x4a5073[_0x22a8('0x95')](new Extension(_0x26f97c,_0x4fc7e4,_0x22a8('0x9f')+_0x27b1f6+')='+_0x26f97c[_0x27b1f6],_0x22a8('0x98')));_0x4fc7e4+=0x1;}}_0x4a5073[_0x22a8('0x95')](new Extension(_0x26f97c,_0x4fc7e4,'6',_0x22a8('0xa0')));_0x4fc7e4+=0x1;_0x4a5073[_0x22a8('0x95')](new Extension(_0x26f97c,_0x4fc7e4,'/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',_0x22a8('0xa1')));_0x4fc7e4=0x0;return _0x4a5073;}exports[_0x22a8('0xa2')]=function(_0x54e384,_0x226f78,_0x35925f){var _0x4ea8b3;return db['sequelize'][_0x22a8('0x83')](function(_0x14fae0){return db['FaxAccount'][_0x22a8('0x5d')](_0x54e384[_0x22a8('0x5e')],{'transaction':_0x14fae0})[_0x22a8('0x23')](function(_0x337830){_0x4ea8b3=_0x337830[_0x22a8('0x62')]({'plain':!![]});return db[_0x22a8('0xa3')][_0x22a8('0x87')](createExtensionsReciveFax(_0x4ea8b3),{'transaction':_0x14fae0});});})['then'](function(){return _0x4ea8b3;})['then'](respondWithResult(_0x226f78,null))[_0x22a8('0x5b')](handleError(_0x226f78,null));};exports['updateAccountApplications']=function(_0x127575,_0x343195,_0x2c9284){var _0x5458ad;return db[_0x22a8('0x82')]['transaction'](function(_0x39c12a){return db[_0x22a8('0x40')][_0x22a8('0x37')](_0x127575[_0x22a8('0x5e')],{'where':{'id':_0x127575['body']['id']},'transaction':_0x39c12a})[_0x22a8('0x23')](function(_0x591cb2){return db[_0x22a8('0xa3')][_0x22a8('0x38')]({'where':{'FaxAccountId':_0x127575[_0x22a8('0x5e')]['id']},'transaction':_0x39c12a})[_0x22a8('0x23')](function(_0x1d5c0f){return db[_0x22a8('0xa3')]['bulkCreate'](createExtensionsReciveFax(_['omit'](_0x127575[_0x22a8('0x5e')],['tech',_0x22a8('0x44'),_0x22a8('0xa4'),_0x22a8('0xa5'),'TrunkId',_0x22a8('0xa6')])),{'transaction':_0x39c12a});});});})['then'](function(){return db[_0x22a8('0x40')][_0x22a8('0xa7')](_0x127575[_0x22a8('0x5e')]['id']);})['then'](respondWithResult(_0x343195,null))[_0x22a8('0x5b')](handleError(_0x343195,null));};exports['getMessages']=function(_0x513ac8,_0x5e512b,_0x598281){var _0x30a3b7={'raw':!![],'where':{}};var _0x29b76b={};var _0x89994a={'count':0x0,'rows':[]};return db['FaxAccount'][_0x22a8('0x6d')]({'where':{'id':_0x513ac8[_0x22a8('0x67')]['id']}})[_0x22a8('0x23')](handleEntityNotFound(_0x5e512b,null))[_0x22a8('0x23')](function(_0x34132e){if(_0x34132e){_0x29b76b['model']=_[_0x22a8('0x47')](db[_0x22a8('0xa8')][_0x22a8('0x41')]);_0x29b76b[_0x22a8('0x46')]=_[_0x22a8('0x47')](_0x513ac8[_0x22a8('0x46')]);_0x29b76b[_0x22a8('0x50')]=_[_0x22a8('0x48')](_0x29b76b['model'],_0x29b76b['query']);_0x30a3b7[_0x22a8('0x4a')]=_['intersection'](_0x29b76b[_0x22a8('0x45')],qs[_0x22a8('0x49')](_0x513ac8[_0x22a8('0x46')]['fields']));_0x30a3b7[_0x22a8('0x4a')]=_0x30a3b7['attributes']['length']?_0x30a3b7[_0x22a8('0x4a')]:_0x29b76b[_0x22a8('0x45')];if(!_0x513ac8['query'][_0x22a8('0x4c')]('nolimit')){_0x30a3b7[_0x22a8('0x2f')]=qs[_0x22a8('0x2f')](_0x513ac8[_0x22a8('0x46')][_0x22a8('0x2f')]);_0x30a3b7['offset']=qs[_0x22a8('0x2e')](_0x513ac8[_0x22a8('0x46')]['offset']);}_0x30a3b7[_0x22a8('0x4e')]=qs['sort'](_0x513ac8[_0x22a8('0x46')][_0x22a8('0x6e')]);_0x30a3b7[_0x22a8('0x4f')]=qs[_0x22a8('0x50')](_[_0x22a8('0x51')](_0x513ac8[_0x22a8('0x46')],_0x29b76b['filters']));_0x30a3b7[_0x22a8('0x4f')][_0x22a8('0x6a')]=_0x34132e['id'];if(_0x513ac8[_0x22a8('0x46')][_0x22a8('0x52')]){_0x30a3b7['where']=_[_0x22a8('0x53')](_0x30a3b7['where'],{'$or':_[_0x22a8('0x3f')](_0x30a3b7['attributes'],function(_0x3519e4){var _0x5df06e={};_0x5df06e[_0x3519e4]={'$like':'%'+_0x513ac8[_0x22a8('0x46')]['filter']+'%'};return _0x5df06e;})});}if(_0x513ac8[_0x22a8('0x46')]['$gte']){var _0x2521fe=_0x513ac8[_0x22a8('0x46')][_0x22a8('0xa9')][_0x22a8('0xaa')](',');var _0x16607b={};_0x16607b[_0x2521fe[0x0]]={'$gte':moment(_0x2521fe[0x1])['format'](_0x22a8('0xab'))};_0x30a3b7[_0x22a8('0x4f')]=_['merge'](_0x30a3b7[_0x22a8('0x4f')],_0x16607b);}_0x30a3b7=_['merge']({},_0x30a3b7,_0x513ac8[_0x22a8('0x55')]);return db['FaxMessage']['count']({'where':_0x30a3b7[_0x22a8('0x4f')]})[_0x22a8('0x23')](function(_0xb9ec58){_0x89994a['count']=_0xb9ec58;if(_0x513ac8['query'][_0x22a8('0x57')]){_0x30a3b7[_0x22a8('0x58')]=[{'all':!![]}];}return db[_0x22a8('0xa8')][_0x22a8('0x59')](_0x30a3b7);})[_0x22a8('0x23')](function(_0x47a8d3){_0x89994a[_0x22a8('0x5a')]=_0x47a8d3;return _0x89994a;});}})[_0x22a8('0x23')](respondWithFilteredResult(_0x5e512b,_0x30a3b7))[_0x22a8('0x5b')](handleError(_0x5e512b,null));};exports[_0x22a8('0x3b')]=function(_0x4f9825,_0x12d14b,_0x2337eb){var _0x57303f,_0x1317e6={},_0x343372;if(_0x4f9825[_0x22a8('0x5e')]['to']){_0x343372=_0x4f9825[_0x22a8('0x5e')]['to'][0x0];}return db[_0x22a8('0x40')][_0x22a8('0x5c')]({'where':{'id':_0x4f9825[_0x22a8('0x67')]['id']},'include':[{'model':db[_0x22a8('0xac')],'as':_0x22a8('0xad'),'include':[{'model':db[_0x22a8('0x79')],'as':'Contacts','where':{'fax':_0x343372},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x22a8('0x23')](handleEntityNotFound(_0x12d14b,null))[_0x22a8('0x23')](function(_0x14e7f9){_0x57303f=_0x14e7f9;if(_0x4f9825[_0x22a8('0x5e')]['attachments']&&_0x4f9825[_0x22a8('0x5e')][_0x22a8('0xae')][_0x22a8('0x4b')]){for(var _0x546a4f=0x0;_0x546a4f<_0x4f9825['body'][_0x22a8('0xae')][_0x22a8('0x4b')];_0x546a4f+=0x1){_0x4f9825['body']['attachments'][_0x546a4f]={'filename':_0x4f9825[_0x22a8('0x5e')][_0x22a8('0xae')][_0x546a4f][_0x22a8('0x3a')],'id':_0x4f9825[_0x22a8('0x5e')][_0x22a8('0xae')][_0x546a4f]['id'],'path':path[_0x22a8('0xaf')](config[_0x22a8('0xb0')],_0x22a8('0xb1'),_0x4f9825['body']['attachments'][_0x546a4f][_0x22a8('0xb2')])};}}return respondWithRpcPromise(_0x22a8('0xb3'),_0x22a8('0xb3'),{'FaxAccountId':_[_0x22a8('0xb4')](_0x4f9825[_0x22a8('0x67')]['id'])?undefined:_0x4f9825[_0x22a8('0x67')]['id'],'path':_[_0x22a8('0xb4')](_0x4f9825[_0x22a8('0x5e')][_0x22a8('0xae')][0x0]['path'])?undefined:_0x4f9825[_0x22a8('0x5e')][_0x22a8('0xae')][0x0][_0x22a8('0x8')],'fax':_['isNil'](_0x4f9825['body']['to'][0x0])?undefined:_0x4f9825[_0x22a8('0x5e')]['to'][0x0]},client9002);})[_0x22a8('0x23')](function(){if(_0x57303f){if(_['isNil'](_0x4f9825[_0x22a8('0x5e')][_0x22a8('0xb5')])){_0x4f9825[_0x22a8('0x5e')]['from']=util[_0x22a8('0xb6')](_0x22a8('0xb7'),_0x57303f[_0x22a8('0x3a')],_0x57303f[_0x22a8('0xb8')]);}if(_0x57303f[_0x22a8('0xad')]){if(_0x57303f[_0x22a8('0xad')][_0x22a8('0xb9')]['length']){return _0x57303f[_0x22a8('0xad')]['Contacts'][0x0];}else{return db['CmContact'][_0x22a8('0x5d')](_[_0x22a8('0x1b')](_0x4f9825[_0x22a8('0x5e')],{'firstName':_0x4f9825[_0x22a8('0x5e')]['to'][0x0],'phone':_0x4f9825[_0x22a8('0x5e')]['to'][0x0],'fax':_0x4f9825[_0x22a8('0x5e')]['to'][0x0],'ListId':_0x57303f[_0x22a8('0xa6')]}));}}else{throw new Error(_0x22a8('0xba'));}}else{throw new Error(_0x22a8('0xbb'));}})['then'](function(_0x35f1c1){if(_0x35f1c1){return db[_0x22a8('0x76')][_0x22a8('0x5c')]({'where':{'ContactId':_0x35f1c1['id'],'closed':![],'FaxAccountId':_0x57303f['id']}})[_0x22a8('0x23')](function(_0x1ff691){if(_0x1ff691){return[_0x1ff691,![]];}return db[_0x22a8('0x76')][_0x22a8('0x5d')]({'UserId':_0x4f9825[_0x22a8('0x5f')]['id'],'ContactId':_0x35f1c1['id'],'FaxAccountId':_0x57303f['id'],'fax':_0x4f9825[_0x22a8('0x5e')]['to'][0x0],'firstMsgDirection':_0x22a8('0xbc'),'Messages':[_[_0x22a8('0x53')](_0x4f9825[_0x22a8('0x5e')],{'read':![],'body':_0x4f9825[_0x22a8('0x5e')][_0x22a8('0xae')][0x0][_0x22a8('0xbd')],'FaxAccountId':_0x57303f['id'],'UserId':_0x4f9825[_0x22a8('0x5f')]['id'],'ContactId':_0x35f1c1['id'],'AttachmentId':_0x4f9825['body'][_0x22a8('0xae')][0x0]['id']})]},{'include':[{'model':db[_0x22a8('0xa8')],'as':_0x22a8('0xbe')}]})[_0x22a8('0x23')](function(_0x154ab9){return[_0x154ab9,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x22a8('0xbf')](function(_0x4592f7,_0x5328ba){if(_0x5328ba){return _0x4592f7;}return db[_0x22a8('0xa8')][_0x22a8('0x5d')]({'direction':_0x22a8('0xbc'),'read':![],'body':_0x4f9825['body'][_0x22a8('0xae')][0x0][_0x22a8('0xbd')],'FaxAccountId':_0x57303f['id'],'FaxInteractionId':_0x4592f7['id'],'UserId':_0x4f9825[_0x22a8('0x5f')]['id'],'ContactId':_0x4592f7[_0x22a8('0xc0')],'AttachmentId':_0x4f9825[_0x22a8('0x5e')]['attachments'][0x0]['id']})[_0x22a8('0x23')](function(_0x22f31a){_0x4592f7[_0x22a8('0xc1')]['Messages']=[];_0x4592f7[_0x22a8('0xc1')][_0x22a8('0xbe')][_0x22a8('0x95')](_0x22f31a['dataValues']);return _0x4592f7;});})['then'](function(_0x106c9f){respondWithRpcPromise(_0x22a8('0xc2'),_0x22a8('0xc2'),{'FaxAccountId':_['isNil'](_0x4f9825[_0x22a8('0x67')]['id'])?undefined:_0x4f9825[_0x22a8('0x67')]['id'],'path':_[_0x22a8('0xb4')](_0x4f9825['body']['attachments'][0x0]['path'])?undefined:_0x4f9825[_0x22a8('0x5e')][_0x22a8('0xae')][0x0]['path'],'fax':_[_0x22a8('0xb4')](_0x4f9825[_0x22a8('0x5e')]['to'][0x0])?undefined:_0x4f9825[_0x22a8('0x5e')]['to'][0x0],'AttachmentId':_0x4f9825[_0x22a8('0x5e')][_0x22a8('0xae')][0x0]['id']},client9002)[_0x22a8('0x23')](function(_0x19e1e0){logger[_0x22a8('0x2a')](_0x22a8('0xc3'),_0x19e1e0);})['catch'](function(_0x18412e){logger['info'](_0x22a8('0xc3'),_0x18412e);});return _0x106c9f;})[_0x22a8('0x23')](respondWithResult(_0x12d14b,null))['catch'](handleError(_0x12d14b,null));};exports[_0x22a8('0xc4')]=function(_0x556f9a,_0x303058,_0x58f8a5){return db[_0x22a8('0x40')][_0x22a8('0x5c')]({'where':{'id':_0x556f9a[_0x22a8('0x67')]['id']}})[_0x22a8('0x23')](handleEntityNotFound(_0x303058,null))[_0x22a8('0x23')](function(_0x4b26e8){if(_0x4b26e8){return _0x4b26e8[_0x22a8('0xc4')](_0x556f9a[_0x22a8('0x5e')][_0x22a8('0x70')],_['omit'](_0x556f9a[_0x22a8('0x5e')],[_0x22a8('0x70'),'id'])||{})[_0x22a8('0xbf')](function(_0x1c776d){for(var _0x2297e9=0x0;_0x2297e9<_0x556f9a['body'][_0x22a8('0x70')][_0x22a8('0x4b')];_0x2297e9+=0x1){socket['emit'](_0x22a8('0xc5'),{'UserId':Number(_0x556f9a[_0x22a8('0x5e')][_0x22a8('0x70')][_0x2297e9]),'FaxAccountId':Number(_0x556f9a[_0x22a8('0x67')]['id'])});}return _0x1c776d;});}})[_0x22a8('0x23')](respondWithResult(_0x303058,null))[_0x22a8('0x5b')](handleError(_0x303058,null));};exports[_0x22a8('0xc6')]=function(_0x3a23dc,_0x5f5b46,_0x2d97ec){return db[_0x22a8('0x40')][_0x22a8('0x5c')]({'where':{'id':_0x3a23dc['params']['id']}})[_0x22a8('0x23')](handleEntityNotFound(_0x5f5b46,null))['then'](function(_0x43ec41){if(_0x43ec41){return _0x43ec41['removeAgents'](_0x3a23dc[_0x22a8('0x46')][_0x22a8('0x70')])['then'](function(){if(_[_0x22a8('0xc7')](_0x3a23dc[_0x22a8('0x46')][_0x22a8('0x70')])){for(var _0x285adb=0x0;_0x285adb<_0x3a23dc[_0x22a8('0x46')][_0x22a8('0x70')][_0x22a8('0x4b')];_0x285adb+=0x1){socket[_0x22a8('0xc8')](_0x22a8('0xc9'),{'UserId':Number(_0x3a23dc[_0x22a8('0x46')][_0x22a8('0x70')][_0x285adb]),'FaxAccountId':Number(_0x3a23dc['params']['id'])});}}else{socket['emit'](_0x22a8('0xc9'),{'UserId':Number(_0x3a23dc[_0x22a8('0x46')][_0x22a8('0x70')]),'FaxAccountId':Number(_0x3a23dc[_0x22a8('0x67')]['id'])});}});}})[_0x22a8('0x23')](respondWithStatusCode(_0x5f5b46,null))[_0x22a8('0x5b')](handleError(_0x5f5b46,null));};exports[_0x22a8('0xca')]=function(_0x1a7474,_0x3a0baf,_0x105f62){var _0x266387={};var _0x298b9b={};var _0x5301e3;var _0x5c1ae5;return db['FaxAccount'][_0x22a8('0x6d')]({'where':{'id':_0x1a7474[_0x22a8('0x67')]['id']}})[_0x22a8('0x23')](handleEntityNotFound(_0x3a0baf,null))[_0x22a8('0x23')](function(_0x1299f8){if(_0x1299f8){_0x5301e3=_0x1299f8;_0x298b9b[_0x22a8('0x45')]=_[_0x22a8('0x47')](db[_0x22a8('0x7b')][_0x22a8('0x41')]);_0x298b9b[_0x22a8('0x46')]=_[_0x22a8('0x47')](_0x1a7474[_0x22a8('0x46')]);_0x298b9b[_0x22a8('0x50')]=_['intersection'](_0x298b9b[_0x22a8('0x45')],_0x298b9b['query']);_0x266387['attributes']=_[_0x22a8('0x48')](_0x298b9b[_0x22a8('0x45')],qs[_0x22a8('0x49')](_0x1a7474[_0x22a8('0x46')][_0x22a8('0x49')]));_0x266387[_0x22a8('0x4a')]=_0x266387['attributes'][_0x22a8('0x4b')]?_0x266387[_0x22a8('0x4a')]:_0x298b9b[_0x22a8('0x45')];_0x266387[_0x22a8('0x4e')]=qs[_0x22a8('0x6e')](_0x1a7474[_0x22a8('0x46')][_0x22a8('0x6e')]);_0x266387[_0x22a8('0x4f')]=qs[_0x22a8('0x50')](_['pick'](_0x1a7474['query'],_0x298b9b[_0x22a8('0x50')]));if(_0x1a7474[_0x22a8('0x46')][_0x22a8('0x52')]){_0x266387['where']=_[_0x22a8('0x53')](_0x266387['where'],{'$or':_['map'](_0x266387['attributes'],function(_0x1bc4fc){var _0x55fe3c={};_0x55fe3c[_0x1bc4fc]={'$like':'%'+_0x1a7474[_0x22a8('0x46')][_0x22a8('0x52')]+'%'};return _0x55fe3c;})});}_0x266387=_[_0x22a8('0x53')]({},_0x266387,_0x1a7474[_0x22a8('0x55')]);return _0x5301e3[_0x22a8('0xca')](_0x266387);}})[_0x22a8('0x23')](function(_0x1d13b1){if(_0x1d13b1){_0x5c1ae5=_0x1d13b1[_0x22a8('0x4b')];if(!_0x1a7474[_0x22a8('0x46')][_0x22a8('0x4c')](_0x22a8('0x4d'))){_0x266387[_0x22a8('0x2f')]=qs[_0x22a8('0x2f')](_0x1a7474[_0x22a8('0x46')]['limit']);_0x266387[_0x22a8('0x2e')]=qs['offset'](_0x1a7474[_0x22a8('0x46')]['offset']);}return _0x5301e3[_0x22a8('0xca')](_0x266387);}})[_0x22a8('0x23')](function(_0x22af13){if(_0x22af13){return _0x22af13?{'count':_0x5c1ae5,'rows':_0x22af13}:null;}})[_0x22a8('0x23')](respondWithResult(_0x3a0baf,null))[_0x22a8('0x5b')](handleError(_0x3a0baf,null));}; \ No newline at end of file +var _0x5d58=['\x22%s\x22\x20<%s>','fax','ListId','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','isArray','userFaxAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','jayson/promise','client','http','request','then','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxAccount,\x20%s,\x20%s','result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','destroy','FaxAccounts','UserProfileResource','sendStatus','stack','name','Pause','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','FaxAccount','includeAll','include','findAll','rows','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','mandatoryDispositionPause','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','getInteractions','CmContact','Contact','User','internal','Tags','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','finally','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','priority','appdata','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','minrate','modem','t38timeout','push','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','transaction','omit','tech','createdAt','updatedAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','format','send','List','Contacts','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from'];(function(_0x189821,_0x6c625c){var _0x1fc94a=function(_0x5eb655){while(--_0x5eb655){_0x189821['push'](_0x189821['shift']());}};_0x1fc94a(++_0x6c625c);}(_0x5d58,0xdc));var _0x85d5=function(_0x42fe8b,_0x2a5e05){_0x42fe8b=_0x42fe8b-0x0;var _0x5fbb4=_0x5d58[_0x42fe8b];return _0x5fbb4;};'use strict';var emlformat=require(_0x85d5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x85d5('0x1'));var jsonpatch=require(_0x85d5('0x2'));var rp=require('request-promise');var moment=require(_0x85d5('0x3'));var BPromise=require(_0x85d5('0x4'));var Mustache=require('mustache');var util=require(_0x85d5('0x5'));var path=require(_0x85d5('0x6'));var sox=require(_0x85d5('0x7'));var csv=require(_0x85d5('0x8'));var ejs=require(_0x85d5('0x9'));var fs=require('fs');var fs_extra=require(_0x85d5('0xa'));var _=require(_0x85d5('0xb'));var squel=require(_0x85d5('0xc'));var crypto=require('crypto');var jsforce=require(_0x85d5('0xd'));var deskjs=require(_0x85d5('0xe'));var toCsv=require(_0x85d5('0x8'));var querystring=require(_0x85d5('0xf'));var Papa=require('papaparse');var Redis=require(_0x85d5('0x10'));var authService=require(_0x85d5('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x85d5('0x12'));var hardwareService=require(_0x85d5('0x13'));var logger=require(_0x85d5('0x14'))(_0x85d5('0x15'));var utils=require(_0x85d5('0x16'));var config=require(_0x85d5('0x17'));var licenseUtil=require(_0x85d5('0x18'));var db=require(_0x85d5('0x19'))['db'];config[_0x85d5('0x1a')]=_[_0x85d5('0x1b')](config[_0x85d5('0x1a')],{'host':_0x85d5('0x1c'),'port':0x18eb});var socket=require(_0x85d5('0x1d'))(new Redis(config[_0x85d5('0x1a')]));require(_0x85d5('0x1e'))['register'](socket);var jayson=require(_0x85d5('0x1f'));var client=jayson[_0x85d5('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x85d5('0x20')][_0x85d5('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x53a688,_0x8a4220,_0x971605,_0x2ba8a9){return new BPromise(function(_0x52ab52,_0x53cfbb){var _0x5f3592=_0x2ba8a9||client;return _0x5f3592[_0x85d5('0x22')](_0x53a688,_0x971605)[_0x85d5('0x23')](function(_0x484a7e){logger['info']('FaxAccount,\x20%s,\x20%s',_0x8a4220,_0x85d5('0x24'));logger[_0x85d5('0x25')](_0x85d5('0x26'),_0x8a4220,_0x85d5('0x24'),JSON[_0x85d5('0x27')](_0x484a7e));if(_0x484a7e[_0x85d5('0x28')]){if(_0x484a7e[_0x85d5('0x28')][_0x85d5('0x29')]===0x1f4){logger[_0x85d5('0x28')]('FaxAccount,\x20%s,\x20%s',_0x8a4220,_0x484a7e['error'][_0x85d5('0x2a')]);return _0x53cfbb(_0x484a7e['error'][_0x85d5('0x2a')]);}logger[_0x85d5('0x28')](_0x85d5('0x2b'),_0x8a4220,_0x484a7e[_0x85d5('0x28')][_0x85d5('0x2a')]);return _0x52ab52(_0x484a7e[_0x85d5('0x28')]['message']);}else{logger['info'](_0x85d5('0x2b'),_0x8a4220,_0x85d5('0x24'));_0x52ab52(_0x484a7e[_0x85d5('0x2c')]['message']);}})[_0x85d5('0x2d')](function(_0x31a25c){logger[_0x85d5('0x28')](_0x85d5('0x2b'),_0x8a4220,_0x31a25c);_0x53cfbb(_0x31a25c);});});}function respondWithStatusCode(_0x55aa7d,_0x477f60){_0x477f60=_0x477f60||0xcc;return function(_0x2086e8){if(_0x2086e8){return _0x55aa7d['sendStatus'](_0x477f60);}return _0x55aa7d[_0x85d5('0x2e')](_0x477f60)[_0x85d5('0x2f')]();};}function respondWithResult(_0x17b3d4,_0x1348c2){_0x1348c2=_0x1348c2||0xc8;return function(_0x1943dc){if(_0x1943dc){return _0x17b3d4['status'](_0x1348c2)[_0x85d5('0x30')](_0x1943dc);}};}function respondWithFilteredResult(_0x633fa4,_0x47fc15){return function(_0x3f9e6c){if(_0x3f9e6c){var _0x6c9e1d=typeof _0x47fc15['offset']===_0x85d5('0x31')&&typeof _0x47fc15[_0x85d5('0x32')]===_0x85d5('0x31');var _0x38ddfb=_0x3f9e6c[_0x85d5('0x33')];var _0xdd2c=_0x6c9e1d?0x0:_0x47fc15[_0x85d5('0x34')];var _0x273889=_0x6c9e1d?_0x3f9e6c['count']:_0x47fc15[_0x85d5('0x34')]+_0x47fc15[_0x85d5('0x32')];var _0x5d4556;if(_0x273889>=_0x38ddfb){_0x273889=_0x38ddfb;_0x5d4556=0xc8;}else{_0x5d4556=0xce;}_0x633fa4[_0x85d5('0x2e')](_0x5d4556);return _0x633fa4[_0x85d5('0x35')](_0x85d5('0x36'),_0xdd2c+'-'+_0x273889+'/'+_0x38ddfb)[_0x85d5('0x30')](_0x3f9e6c);}return null;};}function patchUpdates(_0xbecdaf){return function(_0x4e073b){try{jsonpatch[_0x85d5('0x37')](_0x4e073b,_0xbecdaf,!![]);}catch(_0x41f5e7){return BPromise[_0x85d5('0x38')](_0x41f5e7);}return _0x4e073b['save']();};}function saveUpdates(_0x425f54,_0x1d9f8e){return function(_0x51bd59){if(_0x51bd59){return _0x51bd59['update'](_0x425f54)[_0x85d5('0x23')](function(_0x3620ac){return _0x3620ac;});}return null;};}function removeEntity(_0xad6772,_0x7ae42b){return function(_0xf211b){if(_0xf211b){return _0xf211b[_0x85d5('0x39')]()['then'](function(){var _0xb43dc7=_0xf211b['get']({'plain':!![]});var _0x711807=_0x85d5('0x3a');return db[_0x85d5('0x3b')][_0x85d5('0x39')]({'where':{'type':_0x711807,'resourceId':_0xb43dc7['id']}})[_0x85d5('0x23')](function(){return _0xf211b;});})[_0x85d5('0x23')](function(){_0xad6772[_0x85d5('0x2e')](0xcc)[_0x85d5('0x2f')]();});}};}function handleEntityNotFound(_0x18a436,_0x35f906){return function(_0x37cdc8){if(!_0x37cdc8){_0x18a436[_0x85d5('0x3c')](0x194);}return _0x37cdc8;};}function handleError(_0x249459,_0x43f627){_0x43f627=_0x43f627||0x1f4;return function(_0x4db15f){logger['error'](_0x4db15f[_0x85d5('0x3d')]);if(_0x4db15f[_0x85d5('0x3e')]){delete _0x4db15f[_0x85d5('0x3e')];}_0x249459['status'](_0x43f627)['send'](_0x4db15f);};}exports['index']=function(_0x50ec27,_0x257df2){var _0x59d663={'include':[{'model':db[_0x85d5('0x3f')],'as':'mandatoryDispositionPause'}]},_0x131634={},_0x4e5ef5={'count':0x0,'rows':[]};var _0x35cf49=_[_0x85d5('0x40')](db['FaxAccount'][_0x85d5('0x41')],function(_0x4a093b){return{'name':_0x4a093b[_0x85d5('0x42')],'type':_0x4a093b[_0x85d5('0x43')][_0x85d5('0x44')]};});_0x131634['model']=_[_0x85d5('0x40')](_0x35cf49,_0x85d5('0x3e'));_0x131634[_0x85d5('0x45')]=_[_0x85d5('0x46')](_0x50ec27[_0x85d5('0x45')]);_0x131634[_0x85d5('0x47')]=_[_0x85d5('0x48')](_0x131634['model'],_0x131634[_0x85d5('0x45')]);_0x59d663[_0x85d5('0x49')]=_[_0x85d5('0x48')](_0x131634[_0x85d5('0x4a')],qs[_0x85d5('0x4b')](_0x50ec27['query']['fields']));_0x59d663['attributes']=_0x59d663[_0x85d5('0x49')][_0x85d5('0x4c')]?_0x59d663[_0x85d5('0x49')]:_0x131634[_0x85d5('0x4a')];if(!_0x50ec27['query'][_0x85d5('0x4d')]('nolimit')){_0x59d663['limit']=qs[_0x85d5('0x32')](_0x50ec27[_0x85d5('0x45')][_0x85d5('0x32')]);_0x59d663[_0x85d5('0x34')]=qs[_0x85d5('0x34')](_0x50ec27[_0x85d5('0x45')][_0x85d5('0x34')]);}_0x59d663[_0x85d5('0x4e')]=qs['sort'](_0x50ec27[_0x85d5('0x45')][_0x85d5('0x4f')]);_0x59d663[_0x85d5('0x50')]=qs[_0x85d5('0x47')](_[_0x85d5('0x51')](_0x50ec27[_0x85d5('0x45')],_0x131634[_0x85d5('0x47')]),_0x35cf49);if(_0x50ec27['query']['filter']){_0x59d663[_0x85d5('0x50')]=_['merge'](_0x59d663['where'],{'$or':_['map'](_0x35cf49,function(_0x105a67){if(_0x105a67[_0x85d5('0x43')]!==_0x85d5('0x52')){var _0x3b0f72={};_0x3b0f72[_0x105a67[_0x85d5('0x3e')]]={'$like':'%'+_0x50ec27[_0x85d5('0x45')][_0x85d5('0x53')]+'%'};return _0x3b0f72;}})});}_0x59d663=_[_0x85d5('0x54')]({},_0x59d663,_0x50ec27[_0x85d5('0x55')]);var _0x52773a={'where':_0x59d663[_0x85d5('0x50')]};return db[_0x85d5('0x56')][_0x85d5('0x33')](_0x52773a)[_0x85d5('0x23')](function(_0x101f24){_0x4e5ef5[_0x85d5('0x33')]=_0x101f24;if(_0x50ec27[_0x85d5('0x45')][_0x85d5('0x57')]){_0x59d663[_0x85d5('0x58')]=[{'all':!![]}];}return db[_0x85d5('0x56')][_0x85d5('0x59')](_0x59d663);})[_0x85d5('0x23')](function(_0x3bd4cd){_0x4e5ef5[_0x85d5('0x5a')]=_0x3bd4cd;return _0x4e5ef5;})[_0x85d5('0x23')](respondWithFilteredResult(_0x257df2,_0x59d663))[_0x85d5('0x2d')](handleError(_0x257df2,null));};exports['show']=function(_0x1f49c4,_0x39336b){var _0x510cf4={'raw':![],'where':{'id':_0x1f49c4[_0x85d5('0x5b')]['id']},'include':[{'model':db[_0x85d5('0x3f')],'as':'mandatoryDispositionPause'}]},_0x56734c={};_0x56734c['model']=_['keys'](db['FaxAccount'][_0x85d5('0x41')]);_0x56734c[_0x85d5('0x45')]=_[_0x85d5('0x46')](_0x1f49c4[_0x85d5('0x45')]);_0x56734c[_0x85d5('0x47')]=_[_0x85d5('0x48')](_0x56734c[_0x85d5('0x4a')],_0x56734c['query']);_0x510cf4['attributes']=_[_0x85d5('0x48')](_0x56734c[_0x85d5('0x4a')],qs[_0x85d5('0x4b')](_0x1f49c4['query']['fields']));_0x510cf4[_0x85d5('0x49')]=_0x510cf4['attributes'][_0x85d5('0x4c')]?_0x510cf4[_0x85d5('0x49')]:_0x56734c[_0x85d5('0x4a')];if(_0x1f49c4[_0x85d5('0x45')][_0x85d5('0x57')]){_0x510cf4[_0x85d5('0x58')]=[{'all':!![]}];}_0x510cf4=_['merge']({},_0x510cf4,_0x1f49c4[_0x85d5('0x55')]);return db[_0x85d5('0x56')][_0x85d5('0x5c')](_0x510cf4)['then'](handleEntityNotFound(_0x39336b,null))[_0x85d5('0x23')](respondWithResult(_0x39336b,null))[_0x85d5('0x2d')](handleError(_0x39336b,null));};exports[_0x85d5('0x5d')]=function(_0x468e03,_0x596676){return db['FaxAccount'][_0x85d5('0x5d')](_0x468e03[_0x85d5('0x5e')],{})[_0x85d5('0x23')](function(_0x560f35){var _0x1faf9f=_0x468e03[_0x85d5('0x5f')][_0x85d5('0x60')]({'plain':!![]});if(!_0x1faf9f)throw new Error(_0x85d5('0x61'));if(_0x1faf9f[_0x85d5('0x62')]===_0x85d5('0x5f')){var _0x48da3e=_0x560f35[_0x85d5('0x60')]({'plain':!![]});var _0x3bf9af='FaxAccounts';return db['UserProfileSection']['find']({'where':{'name':_0x3bf9af,'userProfileId':_0x1faf9f[_0x85d5('0x63')]},'raw':!![]})[_0x85d5('0x23')](function(_0x1d7a99){if(_0x1d7a99&&_0x1d7a99[_0x85d5('0x64')]===0x0){return db['UserProfileResource'][_0x85d5('0x5d')]({'name':_0x48da3e['name'],'resourceId':_0x48da3e['id'],'type':_0x1d7a99[_0x85d5('0x3e')],'sectionId':_0x1d7a99['id']},{})[_0x85d5('0x23')](function(){return _0x560f35;});}else{return _0x560f35;}})[_0x85d5('0x2d')](function(_0x5cdea1){logger[_0x85d5('0x28')](_0x85d5('0x65'),_0x5cdea1);throw _0x5cdea1;});}return _0x560f35;})[_0x85d5('0x23')](respondWithResult(_0x596676,0xc9))['catch'](handleError(_0x596676,null));};exports[_0x85d5('0x66')]=function(_0x9ce67c,_0x4a397e){if(_0x9ce67c['body']['id']){delete _0x9ce67c['body']['id'];}return db[_0x85d5('0x56')][_0x85d5('0x5c')]({'where':{'id':_0x9ce67c[_0x85d5('0x5b')]['id']},'include':[{'model':db[_0x85d5('0x3f')],'as':_0x85d5('0x67')}]})[_0x85d5('0x23')](handleEntityNotFound(_0x4a397e,null))[_0x85d5('0x23')](saveUpdates(_0x9ce67c[_0x85d5('0x5e')],null))[_0x85d5('0x23')](respondWithResult(_0x4a397e,null))[_0x85d5('0x2d')](handleError(_0x4a397e,null));};exports[_0x85d5('0x39')]=function(_0x1d4c28,_0x4e836c){return db[_0x85d5('0x56')][_0x85d5('0x5c')]({'where':{'id':_0x1d4c28[_0x85d5('0x5b')]['id']}})[_0x85d5('0x23')](handleEntityNotFound(_0x4e836c,null))[_0x85d5('0x23')](removeEntity(_0x4e836c,null))[_0x85d5('0x2d')](handleError(_0x4e836c,null));};exports['describe']=function(_0x527e05,_0x4d7c5c){return db[_0x85d5('0x56')][_0x85d5('0x68')]()[_0x85d5('0x23')](respondWithResult(_0x4d7c5c,null))['catch'](handleError(_0x4d7c5c,null));};exports[_0x85d5('0x69')]=function(_0x45463e,_0x2fcf40,_0x4e12c5){if(_0x45463e[_0x85d5('0x5e')]['id']){delete _0x45463e[_0x85d5('0x5e')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x45463e[_0x85d5('0x5b')]['id']}})[_0x85d5('0x23')](handleEntityNotFound(_0x2fcf40,null))[_0x85d5('0x23')](function(_0x25dd28){if(_0x25dd28){_0x45463e['body'][_0x85d5('0x6a')]=_0x25dd28['id'];return db[_0x85d5('0x6b')][_0x85d5('0x5d')](_0x45463e[_0x85d5('0x5e')]);}})['then'](respondWithResult(_0x2fcf40,null))[_0x85d5('0x2d')](handleError(_0x2fcf40,null));};exports[_0x85d5('0x6c')]=function(_0x519e1a,_0x294393,_0x229be8){var _0x6eda82={'raw':![],'where':{}};var _0x259dbf={};var _0x1ece82={'count':0x0,'rows':[]};return db[_0x85d5('0x56')][_0x85d5('0x6d')]({'where':{'id':_0x519e1a[_0x85d5('0x5b')]['id']}})['then'](handleEntityNotFound(_0x294393,null))['then'](function(_0xe892bb){if(_0xe892bb){_0x259dbf[_0x85d5('0x4a')]=_[_0x85d5('0x46')](db[_0x85d5('0x6b')]['rawAttributes']);_0x259dbf[_0x85d5('0x45')]=_[_0x85d5('0x46')](_0x519e1a[_0x85d5('0x45')]);_0x259dbf[_0x85d5('0x47')]=_[_0x85d5('0x48')](_0x259dbf[_0x85d5('0x4a')],_0x259dbf['query']);_0x6eda82[_0x85d5('0x49')]=_[_0x85d5('0x48')](_0x259dbf['model'],qs[_0x85d5('0x4b')](_0x519e1a[_0x85d5('0x45')][_0x85d5('0x4b')]));_0x6eda82['attributes']=_0x6eda82[_0x85d5('0x49')][_0x85d5('0x4c')]?_0x6eda82[_0x85d5('0x49')]:_0x259dbf[_0x85d5('0x4a')];if(!_0x519e1a[_0x85d5('0x45')][_0x85d5('0x4d')](_0x85d5('0x6e'))){_0x6eda82[_0x85d5('0x32')]=qs['limit'](_0x519e1a[_0x85d5('0x45')]['limit']);_0x6eda82[_0x85d5('0x34')]=qs[_0x85d5('0x34')](_0x519e1a[_0x85d5('0x45')]['offset']);}_0x6eda82[_0x85d5('0x4e')]=qs['sort'](_0x519e1a[_0x85d5('0x45')]['sort']);_0x6eda82[_0x85d5('0x50')]=qs['filters'](_[_0x85d5('0x51')](_0x519e1a[_0x85d5('0x45')],_0x259dbf[_0x85d5('0x47')]));_0x6eda82[_0x85d5('0x50')]['FaxAccountId']=_0xe892bb['id'];if(_0x519e1a['query']['filter']){_0x6eda82[_0x85d5('0x50')]=_[_0x85d5('0x54')](_0x6eda82[_0x85d5('0x50')],{'$or':_[_0x85d5('0x40')](_0x6eda82[_0x85d5('0x49')],function(_0xa2e0d4){var _0x146d92={};_0x146d92[_0xa2e0d4]={'$like':'%'+_0x519e1a[_0x85d5('0x45')][_0x85d5('0x53')]+'%'};return _0x146d92;})});}_0x6eda82=_[_0x85d5('0x54')]({},_0x6eda82,_0x519e1a[_0x85d5('0x55')]);return db[_0x85d5('0x6b')][_0x85d5('0x33')]({'where':_0x6eda82[_0x85d5('0x50')]})[_0x85d5('0x23')](function(_0x47641e){_0x1ece82[_0x85d5('0x33')]=_0x47641e;if(_0x519e1a[_0x85d5('0x45')][_0x85d5('0x57')]){_0x6eda82[_0x85d5('0x58')]=[{'all':!![]}];}return db[_0x85d5('0x6b')][_0x85d5('0x59')](_0x6eda82);})[_0x85d5('0x23')](function(_0x135824){_0x1ece82[_0x85d5('0x5a')]=_0x135824;return _0x1ece82;});}})[_0x85d5('0x23')](respondWithFilteredResult(_0x294393,_0x6eda82))['catch'](handleError(_0x294393,null));};exports[_0x85d5('0x6f')]=function(_0x4aa40f,_0xa2e65d,_0x193155){return db[_0x85d5('0x56')][_0x85d5('0x5c')]({'where':{'id':_0x4aa40f[_0x85d5('0x5b')]['id']}})[_0x85d5('0x23')](handleEntityNotFound(_0xa2e65d,null))[_0x85d5('0x23')](function(_0x40f3e2){if(_0x40f3e2){return _0x40f3e2[_0x85d5('0x6f')](_0x4aa40f['query'][_0x85d5('0x70')]);}})[_0x85d5('0x23')](respondWithStatusCode(_0xa2e65d,null))['catch'](handleError(_0xa2e65d,null));};exports[_0x85d5('0x71')]=function(_0x232dd1,_0x5c8b3a,_0x511b12){if(_0x232dd1[_0x85d5('0x5e')]['id']){delete _0x232dd1['body']['id'];}return db[_0x85d5('0x56')][_0x85d5('0x5c')]({'where':{'id':_0x232dd1[_0x85d5('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5c8b3a,null))[_0x85d5('0x23')](function(_0x2626b6){if(_0x2626b6){_0x232dd1[_0x85d5('0x5e')][_0x85d5('0x6a')]=_0x2626b6['id'];return db['CannedAnswer']['create'](_0x232dd1[_0x85d5('0x5e')]);}})['then'](respondWithResult(_0x5c8b3a,null))['catch'](handleError(_0x5c8b3a,null));};exports[_0x85d5('0x72')]=function(_0x4b736b,_0x3fb580,_0xf663c1){var _0x264a87={'raw':![],'where':{}};var _0x3ababf={};var _0x58b715={'count':0x0,'rows':[]};return db['FaxAccount'][_0x85d5('0x6d')]({'where':{'id':_0x4b736b[_0x85d5('0x5b')]['id']}})[_0x85d5('0x23')](handleEntityNotFound(_0x3fb580,null))['then'](function(_0x7c337){if(_0x7c337){_0x3ababf[_0x85d5('0x4a')]=_[_0x85d5('0x46')](db[_0x85d5('0x73')][_0x85d5('0x41')]);_0x3ababf[_0x85d5('0x45')]=_[_0x85d5('0x46')](_0x4b736b[_0x85d5('0x45')]);_0x3ababf[_0x85d5('0x47')]=_[_0x85d5('0x48')](_0x3ababf['model'],_0x3ababf[_0x85d5('0x45')]);_0x264a87[_0x85d5('0x49')]=_['intersection'](_0x3ababf[_0x85d5('0x4a')],qs['fields'](_0x4b736b['query'][_0x85d5('0x4b')]));_0x264a87['attributes']=_0x264a87[_0x85d5('0x49')][_0x85d5('0x4c')]?_0x264a87[_0x85d5('0x49')]:_0x3ababf[_0x85d5('0x4a')];if(!_0x4b736b['query'][_0x85d5('0x4d')](_0x85d5('0x6e'))){_0x264a87['limit']=qs[_0x85d5('0x32')](_0x4b736b['query'][_0x85d5('0x32')]);_0x264a87[_0x85d5('0x34')]=qs[_0x85d5('0x34')](_0x4b736b[_0x85d5('0x45')][_0x85d5('0x34')]);}_0x264a87['order']=qs['sort'](_0x4b736b[_0x85d5('0x45')][_0x85d5('0x4f')]);_0x264a87[_0x85d5('0x50')]=qs['filters'](_['pick'](_0x4b736b[_0x85d5('0x45')],_0x3ababf[_0x85d5('0x47')]));_0x264a87[_0x85d5('0x50')][_0x85d5('0x6a')]=_0x7c337['id'];if(_0x4b736b[_0x85d5('0x45')][_0x85d5('0x53')]){_0x264a87[_0x85d5('0x50')]=_[_0x85d5('0x54')](_0x264a87['where'],{'$or':_[_0x85d5('0x40')](_0x264a87['attributes'],function(_0x169536){var _0x3d7ade={};_0x3d7ade[_0x169536]={'$like':'%'+_0x4b736b[_0x85d5('0x45')]['filter']+'%'};return _0x3d7ade;})});}_0x264a87=_[_0x85d5('0x54')]({},_0x264a87,_0x4b736b[_0x85d5('0x55')]);return db[_0x85d5('0x73')]['count']({'where':_0x264a87[_0x85d5('0x50')]})[_0x85d5('0x23')](function(_0x319796){_0x58b715[_0x85d5('0x33')]=_0x319796;if(_0x4b736b[_0x85d5('0x45')][_0x85d5('0x57')]){_0x264a87['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x85d5('0x59')](_0x264a87);})[_0x85d5('0x23')](function(_0x476147){_0x58b715[_0x85d5('0x5a')]=_0x476147;return _0x58b715;});}})[_0x85d5('0x23')](respondWithFilteredResult(_0x3fb580,_0x264a87))['catch'](handleError(_0x3fb580,null));};exports['removeAnswers']=function(_0x3e8b58,_0x50b5a9,_0x1a5dcb){return db[_0x85d5('0x56')][_0x85d5('0x5c')]({'where':{'id':_0x3e8b58[_0x85d5('0x5b')]['id']}})[_0x85d5('0x23')](handleEntityNotFound(_0x50b5a9,null))[_0x85d5('0x23')](function(_0x4fe22c){if(_0x4fe22c){return _0x4fe22c[_0x85d5('0x74')](_0x3e8b58[_0x85d5('0x45')][_0x85d5('0x70')]);}})['then'](respondWithStatusCode(_0x50b5a9,null))[_0x85d5('0x2d')](handleError(_0x50b5a9,null));};exports[_0x85d5('0x75')]=function(_0x1d270a,_0x1f8bb9,_0x1b826d){return db[_0x85d5('0x76')][_0x85d5('0x5c')]({'where':{'id':_0x1d270a[_0x85d5('0x5b')]['id']}})[_0x85d5('0x23')](handleEntityNotFound(_0x1f8bb9,null))[_0x85d5('0x23')](function(_0x2ff25d){if(_0x2ff25d){return _0x2ff25d['addInteraction'](_0x1d270a[_0x85d5('0x5e')][_0x85d5('0x70')],_['omit'](_0x1d270a[_0x85d5('0x5e')],[_0x85d5('0x70'),'id'])||{});}})[_0x85d5('0x23')](respondWithResult(_0x1f8bb9,null))['catch'](handleError(_0x1f8bb9,null));};exports[_0x85d5('0x77')]=function(_0x439be0,_0x2b15f4,_0x179405){var _0x4331cd={'raw':![],'where':{}};var _0x436d50={};var _0x5199f7={'count':0x0,'rows':[]};return db[_0x85d5('0x56')][_0x85d5('0x6d')]({'where':{'id':_0x439be0[_0x85d5('0x5b')]['id']}})[_0x85d5('0x23')](handleEntityNotFound(_0x2b15f4,null))['then'](function(_0x27df4f){if(_0x27df4f){_0x436d50[_0x85d5('0x4a')]=_[_0x85d5('0x46')](db['FaxInteraction']['rawAttributes']);_0x436d50[_0x85d5('0x45')]=_['keys'](_0x439be0[_0x85d5('0x45')]);_0x436d50[_0x85d5('0x47')]=_[_0x85d5('0x48')](_0x436d50['model'],_0x436d50[_0x85d5('0x45')]);_0x4331cd[_0x85d5('0x49')]=_[_0x85d5('0x48')](_0x436d50['model'],qs[_0x85d5('0x4b')](_0x439be0[_0x85d5('0x45')][_0x85d5('0x4b')]));_0x4331cd[_0x85d5('0x49')]=_0x4331cd[_0x85d5('0x49')]['length']?_0x4331cd[_0x85d5('0x49')]:_0x436d50['model'];if(!_0x439be0['query'][_0x85d5('0x4d')](_0x85d5('0x6e'))){_0x4331cd[_0x85d5('0x32')]=qs[_0x85d5('0x32')](_0x439be0[_0x85d5('0x45')]['limit']);_0x4331cd[_0x85d5('0x34')]=qs[_0x85d5('0x34')](_0x439be0[_0x85d5('0x45')][_0x85d5('0x34')]);}_0x4331cd[_0x85d5('0x4e')]=qs[_0x85d5('0x4f')](_0x439be0['query'][_0x85d5('0x4f')]);_0x4331cd[_0x85d5('0x50')]=qs[_0x85d5('0x47')](_[_0x85d5('0x51')](_0x439be0[_0x85d5('0x45')],_0x436d50[_0x85d5('0x47')]));_0x4331cd[_0x85d5('0x50')][_0x85d5('0x6a')]=_0x27df4f['id'];if(_0x439be0[_0x85d5('0x45')][_0x85d5('0x53')]){_0x4331cd[_0x85d5('0x50')]=_[_0x85d5('0x54')](_0x4331cd['where'],{'$or':_[_0x85d5('0x40')](_0x4331cd[_0x85d5('0x49')],function(_0x385a92){var _0x30dd93={};_0x30dd93[_0x385a92]={'$like':'%'+_0x439be0[_0x85d5('0x45')][_0x85d5('0x53')]+'%'};return _0x30dd93;})});}_0x4331cd=_[_0x85d5('0x54')]({},_0x4331cd,_0x439be0[_0x85d5('0x55')]);return db[_0x85d5('0x76')][_0x85d5('0x33')]({'where':_0x4331cd[_0x85d5('0x50')]})[_0x85d5('0x23')](function(_0x13dc1b){_0x5199f7['count']=_0x13dc1b;if(_0x439be0[_0x85d5('0x45')][_0x85d5('0x57')]){_0x4331cd['include']=[{'model':db[_0x85d5('0x78')],'as':_0x85d5('0x79'),'required':![]},{'model':db[_0x85d5('0x7a')],'as':'Owner','attributes':[_0x85d5('0x3e'),'fullname',_0x85d5('0x7b')],'required':![]},{'model':db['Tag'],'as':_0x85d5('0x7c'),'attributes':['id',_0x85d5('0x3e'),_0x85d5('0x7d')],'where':_0x439be0[_0x85d5('0x45')]['tag']?{'id':_0x439be0[_0x85d5('0x45')][_0x85d5('0x7e')]}:undefined,'required':_0x439be0['query'][_0x85d5('0x7e')]?!![]:![]}];}return db['FaxInteraction'][_0x85d5('0x59')](_0x4331cd);})['then'](function(_0xdf13d){_0x5199f7[_0x85d5('0x5a')]=_0xdf13d;return _0x5199f7;});}})[_0x85d5('0x23')](respondWithFilteredResult(_0x2b15f4,_0x4331cd))[_0x85d5('0x2d')](handleError(_0x2b15f4,null));};exports[_0x85d5('0x7f')]=function(_0x2404f7,_0x4a991f){var _0x3c9daf=_0x2404f7[_0x85d5('0x5b')]['id'];var _0x465861=_0x2404f7[_0x85d5('0x5e')];var _0x5f170d=0xc8;var _0x38ce8b=null;return db[_0x85d5('0x80')]['transaction']({'isolationLevel':db[_0x85d5('0x80')][_0x85d5('0x81')][_0x85d5('0x82')][_0x85d5('0x83')]},function(_0x3e9548){return db[_0x85d5('0x56')][_0x85d5('0x6d')]({'where':{'id':_0x3c9daf},'transaction':_0x3e9548})['then'](function(_0x3dc34e){if(_0x3dc34e){return db[_0x85d5('0x84')][_0x85d5('0x39')]({'where':{'FaxAccountId':_0x3c9daf},'transaction':_0x3e9548})['then'](function(){var _0x18e901=_[_0x85d5('0x40')](_0x465861,function(_0x5964f9){_0x5964f9[_0x85d5('0x6a')]=_0x3c9daf;return _0x5964f9;});return db[_0x85d5('0x84')][_0x85d5('0x85')](_0x18e901,{'transaction':_0x3e9548});});}else{_0x5f170d=0x194;_0x38ce8b=[];}});})['then'](function(){if(_0x5f170d!==0x194){return db[_0x85d5('0x84')]['findAndCountAll']({'where':{'FaxAccountId':_0x3c9daf},'order':'priority'})[_0x85d5('0x23')](function(_0x39a19b){_0x38ce8b=_0x39a19b;});}})['catch'](function(_0x317af5){_0x5f170d=0x1f4;logger[_0x85d5('0x28')](_0x317af5[_0x85d5('0x3d')]);if(_0x317af5[_0x85d5('0x3e')]){delete _0x317af5[_0x85d5('0x3e')];}_0x38ce8b=_0x317af5;})[_0x85d5('0x86')](function(){if(_0x38ce8b===null){_0x4a991f['sendStatus'](_0x5f170d);}else{if(_0x5f170d===0x1f4){_0x4a991f['status'](_0x5f170d)['send'](_0x38ce8b);}else{_0x4a991f[_0x85d5('0x2e')](_0x5f170d)[_0x85d5('0x30')](_0x38ce8b);}}});};exports['getApplications']=function(_0x511eb0,_0x1eb595,_0xf65055){var _0x5dd1ba={};var _0x73710={};var _0x35074b;var _0x4df88c;return db[_0x85d5('0x56')][_0x85d5('0x6d')]({'where':{'id':_0x511eb0['params']['id']}})[_0x85d5('0x23')](handleEntityNotFound(_0x1eb595,null))['then'](function(_0x5dcfef){if(_0x5dcfef){_0x35074b=_0x5dcfef;_0x73710[_0x85d5('0x4a')]=_[_0x85d5('0x46')](db[_0x85d5('0x84')][_0x85d5('0x41')]);_0x73710[_0x85d5('0x45')]=_[_0x85d5('0x46')](_0x511eb0[_0x85d5('0x45')]);_0x73710[_0x85d5('0x47')]=_['intersection'](_0x73710['model'],_0x73710[_0x85d5('0x45')]);_0x5dd1ba[_0x85d5('0x49')]=_[_0x85d5('0x48')](_0x73710['model'],qs[_0x85d5('0x4b')](_0x511eb0[_0x85d5('0x45')]['fields']));_0x5dd1ba[_0x85d5('0x49')]=_0x5dd1ba[_0x85d5('0x49')][_0x85d5('0x4c')]?_0x5dd1ba[_0x85d5('0x49')]:_0x73710[_0x85d5('0x4a')];_0x5dd1ba[_0x85d5('0x4e')]=qs[_0x85d5('0x4f')](_0x511eb0[_0x85d5('0x45')]['sort']);_0x5dd1ba['where']=qs['filters'](_[_0x85d5('0x51')](_0x511eb0[_0x85d5('0x45')],_0x73710[_0x85d5('0x47')]));if(_0x511eb0['query'][_0x85d5('0x53')]){_0x5dd1ba['where']=_[_0x85d5('0x54')](_0x5dd1ba['where'],{'$or':_[_0x85d5('0x40')](_0x5dd1ba[_0x85d5('0x49')],function(_0x3c3c29){var _0x5ecfe2={};_0x5ecfe2[_0x3c3c29]={'$like':'%'+_0x511eb0['query'][_0x85d5('0x53')]+'%'};return _0x5ecfe2;})});}_0x5dd1ba=_[_0x85d5('0x54')]({},_0x5dd1ba,_0x511eb0[_0x85d5('0x55')]);return _0x35074b['getApplications'](_0x5dd1ba);}})[_0x85d5('0x23')](function(_0x31c9cf){if(_0x31c9cf){_0x4df88c=_0x31c9cf[_0x85d5('0x4c')];if(!_0x511eb0[_0x85d5('0x45')]['hasOwnProperty']('nolimit')){_0x5dd1ba[_0x85d5('0x32')]=qs[_0x85d5('0x32')](_0x511eb0['query'][_0x85d5('0x32')]);_0x5dd1ba[_0x85d5('0x34')]=qs[_0x85d5('0x34')](_0x511eb0[_0x85d5('0x45')][_0x85d5('0x34')]);}return _0x35074b['getApplications'](_0x5dd1ba);}})[_0x85d5('0x23')](function(_0x103664){if(_0x103664){return _0x103664?{'count':_0x4df88c,'rows':_0x103664}:null;}})[_0x85d5('0x23')](respondWithResult(_0x1eb595,null))['catch'](handleError(_0x1eb595,null));};function Extension(_0x20e24f,_0x433a64,_0x13b88e,_0x59f04d){this[_0x85d5('0x87')]=_0x85d5('0x88');this[_0x85d5('0x89')]=_0x20e24f[_0x85d5('0x8a')];this[_0x85d5('0x8b')]=_0x59f04d;this[_0x85d5('0x43')]=_0x85d5('0x8c');this[_0x85d5('0x8d')]=_0x85d5('0x8e');this['FaxAccountId']=_0x20e24f['id'];this[_0x85d5('0x8f')]=_0x433a64;this[_0x85d5('0x90')]=_0x13b88e;}function createExtensionsReciveFax(_0x2724da){var _0x2c568b=0x1;var _0x346656=[];_0x346656['push'](new Extension(_0x2724da,_0x2c568b,'',_0x85d5('0x91')));_0x2c568b+=0x1;_0x346656['push'](new Extension(_0x2724da,_0x2c568b,_0x85d5('0x92'),_0x85d5('0x93')));_0x2c568b+=0x1;for(var _0x2b6f5b in _0x2724da){if(_0x2724da[_0x85d5('0x4d')](_0x2b6f5b)&&(_0x2b6f5b===_0x85d5('0x94')||_0x2b6f5b===_0x85d5('0x8a')||_0x2b6f5b===_0x85d5('0x95')||_0x2b6f5b===_0x85d5('0x96')||_0x2b6f5b===_0x85d5('0x97')||_0x2b6f5b==='maxrate'||_0x2b6f5b===_0x85d5('0x98')||_0x2b6f5b===_0x85d5('0x99')||_0x2b6f5b===_0x85d5('0x9a'))){_0x346656['push'](new Extension(_0x2724da,_0x2c568b,'FAXOPT('+_0x2b6f5b+')='+_0x2724da[_0x2b6f5b],_0x85d5('0x93')));_0x2c568b+=0x1;}}_0x346656[_0x85d5('0x9b')](new Extension(_0x2724da,_0x2c568b,'6','Wait'));_0x2c568b+=0x1;_0x346656[_0x85d5('0x9b')](new Extension(_0x2724da,_0x2c568b,_0x85d5('0x9c'),_0x85d5('0x9d')));_0x2c568b=0x0;return _0x346656;}exports[_0x85d5('0x9e')]=function(_0x16ba4f,_0x33b47f,_0x5f41ea){var _0xafd2a1;return db[_0x85d5('0x80')]['transaction'](function(_0x154263){return db[_0x85d5('0x56')]['create'](_0x16ba4f[_0x85d5('0x5e')],{'transaction':_0x154263})[_0x85d5('0x23')](function(_0x11c419){_0xafd2a1=_0x11c419[_0x85d5('0x60')]({'plain':!![]});return db[_0x85d5('0x9f')]['bulkCreate'](createExtensionsReciveFax(_0xafd2a1),{'transaction':_0x154263});});})[_0x85d5('0x23')](function(){return _0xafd2a1;})[_0x85d5('0x23')](respondWithResult(_0x33b47f,null))[_0x85d5('0x2d')](handleError(_0x33b47f,null));};exports[_0x85d5('0xa0')]=function(_0x117d64,_0x14d270,_0x912507){var _0x5aa0c7;return db[_0x85d5('0x80')][_0x85d5('0xa1')](function(_0x295326){return db['FaxAccount'][_0x85d5('0x66')](_0x117d64[_0x85d5('0x5e')],{'where':{'id':_0x117d64[_0x85d5('0x5e')]['id']},'transaction':_0x295326})['then'](function(_0x506e18){return db[_0x85d5('0x9f')][_0x85d5('0x39')]({'where':{'FaxAccountId':_0x117d64[_0x85d5('0x5e')]['id']},'transaction':_0x295326})[_0x85d5('0x23')](function(_0x9faaaa){return db[_0x85d5('0x9f')][_0x85d5('0x85')](createExtensionsReciveFax(_[_0x85d5('0xa2')](_0x117d64[_0x85d5('0x5e')],[_0x85d5('0xa3'),_0x85d5('0x44'),_0x85d5('0xa4'),_0x85d5('0xa5'),_0x85d5('0xa6'),'ListId'])),{'transaction':_0x295326});});});})['then'](function(){return db[_0x85d5('0x56')][_0x85d5('0xa7')](_0x117d64['body']['id']);})[_0x85d5('0x23')](respondWithResult(_0x14d270,null))[_0x85d5('0x2d')](handleError(_0x14d270,null));};exports[_0x85d5('0xa8')]=function(_0x3b1413,_0x54ab81,_0x542d85){var _0xf9f5df={'raw':!![],'where':{}};var _0x411a8c={};var _0x113c03={'count':0x0,'rows':[]};return db[_0x85d5('0x56')]['findOne']({'where':{'id':_0x3b1413['params']['id']}})[_0x85d5('0x23')](handleEntityNotFound(_0x54ab81,null))['then'](function(_0x478c32){if(_0x478c32){_0x411a8c['model']=_['keys'](db[_0x85d5('0xa9')][_0x85d5('0x41')]);_0x411a8c['query']=_[_0x85d5('0x46')](_0x3b1413[_0x85d5('0x45')]);_0x411a8c[_0x85d5('0x47')]=_[_0x85d5('0x48')](_0x411a8c[_0x85d5('0x4a')],_0x411a8c['query']);_0xf9f5df[_0x85d5('0x49')]=_['intersection'](_0x411a8c['model'],qs['fields'](_0x3b1413[_0x85d5('0x45')][_0x85d5('0x4b')]));_0xf9f5df[_0x85d5('0x49')]=_0xf9f5df[_0x85d5('0x49')][_0x85d5('0x4c')]?_0xf9f5df[_0x85d5('0x49')]:_0x411a8c['model'];if(!_0x3b1413[_0x85d5('0x45')][_0x85d5('0x4d')](_0x85d5('0x6e'))){_0xf9f5df[_0x85d5('0x32')]=qs['limit'](_0x3b1413[_0x85d5('0x45')][_0x85d5('0x32')]);_0xf9f5df[_0x85d5('0x34')]=qs[_0x85d5('0x34')](_0x3b1413[_0x85d5('0x45')][_0x85d5('0x34')]);}_0xf9f5df[_0x85d5('0x4e')]=qs[_0x85d5('0x4f')](_0x3b1413[_0x85d5('0x45')][_0x85d5('0x4f')]);_0xf9f5df[_0x85d5('0x50')]=qs[_0x85d5('0x47')](_[_0x85d5('0x51')](_0x3b1413[_0x85d5('0x45')],_0x411a8c['filters']));_0xf9f5df[_0x85d5('0x50')]['FaxAccountId']=_0x478c32['id'];if(_0x3b1413[_0x85d5('0x45')][_0x85d5('0x53')]){_0xf9f5df[_0x85d5('0x50')]=_['merge'](_0xf9f5df[_0x85d5('0x50')],{'$or':_[_0x85d5('0x40')](_0xf9f5df[_0x85d5('0x49')],function(_0x47d556){var _0x3c497f={};_0x3c497f[_0x47d556]={'$like':'%'+_0x3b1413[_0x85d5('0x45')]['filter']+'%'};return _0x3c497f;})});}if(_0x3b1413['query'][_0x85d5('0xaa')]){var _0xdf61bf=_0x3b1413[_0x85d5('0x45')]['$gte'][_0x85d5('0xab')](',');var _0x3b7e01={};_0x3b7e01[_0xdf61bf[0x0]]={'$gte':moment(_0xdf61bf[0x1])[_0x85d5('0xac')]('YYYY-MM-DD\x20HH:mm:ss')};_0xf9f5df[_0x85d5('0x50')]=_[_0x85d5('0x54')](_0xf9f5df[_0x85d5('0x50')],_0x3b7e01);}_0xf9f5df=_[_0x85d5('0x54')]({},_0xf9f5df,_0x3b1413[_0x85d5('0x55')]);return db['FaxMessage'][_0x85d5('0x33')]({'where':_0xf9f5df[_0x85d5('0x50')]})[_0x85d5('0x23')](function(_0x408732){_0x113c03[_0x85d5('0x33')]=_0x408732;if(_0x3b1413['query']['includeAll']){_0xf9f5df['include']=[{'all':!![]}];}return db[_0x85d5('0xa9')][_0x85d5('0x59')](_0xf9f5df);})[_0x85d5('0x23')](function(_0x21541e){_0x113c03[_0x85d5('0x5a')]=_0x21541e;return _0x113c03;});}})[_0x85d5('0x23')](respondWithFilteredResult(_0x54ab81,_0xf9f5df))[_0x85d5('0x2d')](handleError(_0x54ab81,null));};exports[_0x85d5('0xad')]=function(_0x545c74,_0x453c90,_0x134c30){var _0x3c06f2,_0x5ee1c6={},_0x409e42;if(_0x545c74[_0x85d5('0x5e')]['to']){_0x409e42=_0x545c74[_0x85d5('0x5e')]['to'][0x0];}return db[_0x85d5('0x56')]['find']({'where':{'id':_0x545c74[_0x85d5('0x5b')]['id']},'include':[{'model':db['CmList'],'as':_0x85d5('0xae'),'include':[{'model':db[_0x85d5('0x78')],'as':_0x85d5('0xaf'),'where':{'fax':_0x409e42},'limit':0x1,'order':[[_0x85d5('0xa5'),'DESC']]}]}]})[_0x85d5('0x23')](handleEntityNotFound(_0x453c90,null))[_0x85d5('0x23')](function(_0x4bd325){_0x3c06f2=_0x4bd325;if(_0x545c74['body'][_0x85d5('0xb0')]&&_0x545c74['body']['attachments']['length']){for(var _0x52c0f9=0x0;_0x52c0f9<_0x545c74['body'][_0x85d5('0xb0')][_0x85d5('0x4c')];_0x52c0f9+=0x1){_0x545c74[_0x85d5('0x5e')][_0x85d5('0xb0')][_0x52c0f9]={'filename':_0x545c74[_0x85d5('0x5e')][_0x85d5('0xb0')][_0x52c0f9]['name'],'id':_0x545c74[_0x85d5('0x5e')][_0x85d5('0xb0')][_0x52c0f9]['id'],'path':path[_0x85d5('0xb1')](config[_0x85d5('0xb2')],_0x85d5('0xb3'),_0x545c74[_0x85d5('0x5e')]['attachments'][_0x52c0f9][_0x85d5('0xb4')])};}}return respondWithRpcPromise(_0x85d5('0xb5'),_0x85d5('0xb5'),{'FaxAccountId':_[_0x85d5('0xb6')](_0x545c74[_0x85d5('0x5b')]['id'])?undefined:_0x545c74['params']['id'],'path':_[_0x85d5('0xb6')](_0x545c74[_0x85d5('0x5e')][_0x85d5('0xb0')][0x0][_0x85d5('0x6')])?undefined:_0x545c74[_0x85d5('0x5e')][_0x85d5('0xb0')][0x0][_0x85d5('0x6')],'fax':_[_0x85d5('0xb6')](_0x545c74[_0x85d5('0x5e')]['to'][0x0])?undefined:_0x545c74[_0x85d5('0x5e')]['to'][0x0]},client9002);})[_0x85d5('0x23')](function(){if(_0x3c06f2){if(_['isNil'](_0x545c74['body']['from'])){_0x545c74[_0x85d5('0x5e')][_0x85d5('0xb7')]=util[_0x85d5('0xac')](_0x85d5('0xb8'),_0x3c06f2[_0x85d5('0x3e')],_0x3c06f2[_0x85d5('0xb9')]);}if(_0x3c06f2[_0x85d5('0xae')]){if(_0x3c06f2[_0x85d5('0xae')]['Contacts']['length']){return _0x3c06f2['List']['Contacts'][0x0];}else{return db['CmContact'][_0x85d5('0x5d')](_[_0x85d5('0x1b')](_0x545c74[_0x85d5('0x5e')],{'firstName':_0x545c74['body']['to'][0x0],'phone':_0x545c74[_0x85d5('0x5e')]['to'][0x0],'fax':_0x545c74['body']['to'][0x0],'ListId':_0x3c06f2[_0x85d5('0xba')]}));}}else{throw new Error(_0x85d5('0xbb'));}}else{throw new Error(_0x85d5('0xbc'));}})[_0x85d5('0x23')](function(_0x403c3c){if(_0x403c3c){return db[_0x85d5('0x76')][_0x85d5('0x5c')]({'where':{'ContactId':_0x403c3c['id'],'closed':![],'FaxAccountId':_0x3c06f2['id']}})[_0x85d5('0x23')](function(_0x4ef91a){if(_0x4ef91a){return[_0x4ef91a,![]];}return db['FaxInteraction'][_0x85d5('0x5d')]({'UserId':_0x545c74[_0x85d5('0x5f')]['id'],'ContactId':_0x403c3c['id'],'FaxAccountId':_0x3c06f2['id'],'fax':_0x545c74[_0x85d5('0x5e')]['to'][0x0],'firstMsgDirection':_0x85d5('0xbd'),'Messages':[_[_0x85d5('0x54')](_0x545c74[_0x85d5('0x5e')],{'read':![],'body':_0x545c74[_0x85d5('0x5e')][_0x85d5('0xb0')][0x0][_0x85d5('0xbe')],'FaxAccountId':_0x3c06f2['id'],'UserId':_0x545c74['user']['id'],'ContactId':_0x403c3c['id'],'AttachmentId':_0x545c74[_0x85d5('0x5e')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x85d5('0xa9')],'as':_0x85d5('0xbf')}]})[_0x85d5('0x23')](function(_0x3e8426){return[_0x3e8426,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x85d5('0xc0')](function(_0x3ecb2b,_0x1e7053){if(_0x1e7053){return _0x3ecb2b;}return db['FaxMessage'][_0x85d5('0x5d')]({'direction':'out','read':![],'body':_0x545c74[_0x85d5('0x5e')][_0x85d5('0xb0')][0x0][_0x85d5('0xbe')],'FaxAccountId':_0x3c06f2['id'],'FaxInteractionId':_0x3ecb2b['id'],'UserId':_0x545c74['user']['id'],'ContactId':_0x3ecb2b[_0x85d5('0xc1')],'AttachmentId':_0x545c74[_0x85d5('0x5e')][_0x85d5('0xb0')][0x0]['id']})['then'](function(_0x5ac7d1){_0x3ecb2b['dataValues'][_0x85d5('0xbf')]=[];_0x3ecb2b[_0x85d5('0xc2')][_0x85d5('0xbf')][_0x85d5('0x9b')](_0x5ac7d1[_0x85d5('0xc2')]);return _0x3ecb2b;});})[_0x85d5('0x23')](function(_0x99878e){respondWithRpcPromise('SendFax',_0x85d5('0xc3'),{'FaxAccountId':_['isNil'](_0x545c74[_0x85d5('0x5b')]['id'])?undefined:_0x545c74[_0x85d5('0x5b')]['id'],'path':_[_0x85d5('0xb6')](_0x545c74[_0x85d5('0x5e')][_0x85d5('0xb0')][0x0][_0x85d5('0x6')])?undefined:_0x545c74[_0x85d5('0x5e')][_0x85d5('0xb0')][0x0][_0x85d5('0x6')],'fax':_['isNil'](_0x545c74[_0x85d5('0x5e')]['to'][0x0])?undefined:_0x545c74[_0x85d5('0x5e')]['to'][0x0],'AttachmentId':_0x545c74[_0x85d5('0x5e')][_0x85d5('0xb0')][0x0]['id']},client9002)['then'](function(_0xcfb3d1){logger['info'](_0x85d5('0xc4'),_0xcfb3d1);})['catch'](function(_0x2525f1){logger['info'](_0x85d5('0xc4'),_0x2525f1);});return _0x99878e;})[_0x85d5('0x23')](respondWithResult(_0x453c90,null))['catch'](handleError(_0x453c90,null));};exports[_0x85d5('0xc5')]=function(_0xf8a3c3,_0xbc2e69,_0x4e94c3){return db['FaxAccount']['find']({'where':{'id':_0xf8a3c3[_0x85d5('0x5b')]['id']}})[_0x85d5('0x23')](handleEntityNotFound(_0xbc2e69,null))[_0x85d5('0x23')](function(_0x10ca23){if(_0x10ca23){return _0x10ca23[_0x85d5('0xc5')](_0xf8a3c3['body']['ids'],_[_0x85d5('0xa2')](_0xf8a3c3[_0x85d5('0x5e')],[_0x85d5('0x70'),'id'])||{})[_0x85d5('0xc0')](function(_0x289721){for(var _0x41489d=0x0;_0x41489d<_0xf8a3c3[_0x85d5('0x5e')][_0x85d5('0x70')]['length'];_0x41489d+=0x1){socket[_0x85d5('0xc6')]('userFaxAccount:save',{'UserId':Number(_0xf8a3c3['body'][_0x85d5('0x70')][_0x41489d]),'FaxAccountId':Number(_0xf8a3c3[_0x85d5('0x5b')]['id'])});}return _0x289721;});}})['then'](respondWithResult(_0xbc2e69,null))[_0x85d5('0x2d')](handleError(_0xbc2e69,null));};exports['removeAgents']=function(_0x159229,_0x541890,_0x9be1f9){return db[_0x85d5('0x56')][_0x85d5('0x5c')]({'where':{'id':_0x159229[_0x85d5('0x5b')]['id']}})['then'](handleEntityNotFound(_0x541890,null))[_0x85d5('0x23')](function(_0x3bf8c7){if(_0x3bf8c7){return _0x3bf8c7['removeAgents'](_0x159229[_0x85d5('0x45')][_0x85d5('0x70')])[_0x85d5('0x23')](function(){if(_[_0x85d5('0xc7')](_0x159229[_0x85d5('0x45')][_0x85d5('0x70')])){for(var _0x4d81c7=0x0;_0x4d81c7<_0x159229[_0x85d5('0x45')]['ids'][_0x85d5('0x4c')];_0x4d81c7+=0x1){socket[_0x85d5('0xc6')](_0x85d5('0xc8'),{'UserId':Number(_0x159229[_0x85d5('0x45')][_0x85d5('0x70')][_0x4d81c7]),'FaxAccountId':Number(_0x159229[_0x85d5('0x5b')]['id'])});}}else{socket[_0x85d5('0xc6')]('userFaxAccount:remove',{'UserId':Number(_0x159229[_0x85d5('0x45')][_0x85d5('0x70')]),'FaxAccountId':Number(_0x159229[_0x85d5('0x5b')]['id'])});}});}})[_0x85d5('0x23')](respondWithStatusCode(_0x541890,null))[_0x85d5('0x2d')](handleError(_0x541890,null));};exports['getAgents']=function(_0x22d9d2,_0x1047ea,_0x4120e7){var _0x393f7b={};var _0x13494f={};var _0x5a553a;var _0x402b9f;return db[_0x85d5('0x56')][_0x85d5('0x6d')]({'where':{'id':_0x22d9d2[_0x85d5('0x5b')]['id']}})[_0x85d5('0x23')](handleEntityNotFound(_0x1047ea,null))[_0x85d5('0x23')](function(_0xff695){if(_0xff695){_0x5a553a=_0xff695;_0x13494f[_0x85d5('0x4a')]=_[_0x85d5('0x46')](db[_0x85d5('0x7a')]['rawAttributes']);_0x13494f[_0x85d5('0x45')]=_['keys'](_0x22d9d2[_0x85d5('0x45')]);_0x13494f['filters']=_[_0x85d5('0x48')](_0x13494f['model'],_0x13494f[_0x85d5('0x45')]);_0x393f7b[_0x85d5('0x49')]=_['intersection'](_0x13494f['model'],qs[_0x85d5('0x4b')](_0x22d9d2['query']['fields']));_0x393f7b[_0x85d5('0x49')]=_0x393f7b[_0x85d5('0x49')][_0x85d5('0x4c')]?_0x393f7b[_0x85d5('0x49')]:_0x13494f['model'];_0x393f7b[_0x85d5('0x4e')]=qs[_0x85d5('0x4f')](_0x22d9d2['query'][_0x85d5('0x4f')]);_0x393f7b['where']=qs[_0x85d5('0x47')](_[_0x85d5('0x51')](_0x22d9d2[_0x85d5('0x45')],_0x13494f['filters']));if(_0x22d9d2[_0x85d5('0x45')][_0x85d5('0x53')]){_0x393f7b[_0x85d5('0x50')]=_[_0x85d5('0x54')](_0x393f7b[_0x85d5('0x50')],{'$or':_[_0x85d5('0x40')](_0x393f7b['attributes'],function(_0x20a69c){var _0x515280={};_0x515280[_0x20a69c]={'$like':'%'+_0x22d9d2['query']['filter']+'%'};return _0x515280;})});}_0x393f7b=_['merge']({},_0x393f7b,_0x22d9d2[_0x85d5('0x55')]);return _0x5a553a[_0x85d5('0xc9')](_0x393f7b);}})['then'](function(_0x2cfeff){if(_0x2cfeff){_0x402b9f=_0x2cfeff[_0x85d5('0x4c')];if(!_0x22d9d2[_0x85d5('0x45')][_0x85d5('0x4d')](_0x85d5('0x6e'))){_0x393f7b[_0x85d5('0x32')]=qs[_0x85d5('0x32')](_0x22d9d2['query']['limit']);_0x393f7b[_0x85d5('0x34')]=qs[_0x85d5('0x34')](_0x22d9d2[_0x85d5('0x45')][_0x85d5('0x34')]);}return _0x5a553a[_0x85d5('0xc9')](_0x393f7b);}})[_0x85d5('0x23')](function(_0x515085){if(_0x515085){return _0x515085?{'count':_0x402b9f,'rows':_0x515085}:null;}})[_0x85d5('0x23')](respondWithResult(_0x1047ea,null))['catch'](handleError(_0x1047ea,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 43fa3db..11757b8 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 _0x1255=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x31e82f,_0x57a94f){var _0x67dd6f=function(_0x94ac55){while(--_0x94ac55){_0x31e82f['push'](_0x31e82f['shift']());}};_0x67dd6f(++_0x57a94f);}(_0x1255,0x127));var _0x5125=function(_0x31b48a,_0x1eb939){_0x31b48a=_0x31b48a-0x0;var _0x3ec38d=_0x1255[_0x31b48a];return _0x3ec38d;};'use strict';var EventEmitter=require(_0x5125('0x0'));var FaxAccount=require(_0x5125('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x5125('0x2')](0x0);var events={'afterCreate':_0x5125('0x3'),'afterUpdate':_0x5125('0x4'),'afterDestroy':_0x5125('0x5')};function emitEvent(_0x294dab){return function(_0x47a79a,_0x1d9748,_0x4dd46e){FaxAccountEvents[_0x5125('0x6')](_0x294dab+':'+_0x47a79a['id'],_0x47a79a);FaxAccountEvents[_0x5125('0x6')](_0x294dab,_0x47a79a);_0x4dd46e(null);};}for(var e in events){if(events[_0x5125('0x7')](e)){var event=events[e];FaxAccount[_0x5125('0x8')](e,emitEvent(event));}}module[_0x5125('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0x2cf5=['../../mysqldb','update','remove','emit','hook','exports','events'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2cf5,0xa0));var _0x52cf=function(_0x2ed46e,_0x3aa51b){_0x2ed46e=_0x2ed46e-0x0;var _0x3c13c8=_0x2cf5[_0x2ed46e];return _0x3c13c8;};'use strict';var EventEmitter=require(_0x52cf('0x0'));var FaxAccount=require(_0x52cf('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x52cf('0x2'),'afterDestroy':_0x52cf('0x3')};function emitEvent(_0x21f23a){return function(_0x26f1e0,_0x5175f6,_0x1541f5){FaxAccountEvents[_0x52cf('0x4')](_0x21f23a+':'+_0x26f1e0['id'],_0x26f1e0);FaxAccountEvents[_0x52cf('0x4')](_0x21f23a,_0x26f1e0);_0x1541f5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x52cf('0x5')](e,emitEvent(event));}}module[_0x52cf('0x6')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 3a994c2..f6cb88c 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 _0xdd3e=['../../config/environment','./faxAccount.attributes','exports','define','bluebird','path','rimraf'];(function(_0x4eb139,_0x27a964){var _0x3781c9=function(_0x1e5251){while(--_0x1e5251){_0x4eb139['push'](_0x4eb139['shift']());}};_0x3781c9(++_0x27a964);}(_0xdd3e,0x66));var _0xedd3=function(_0x4156c0,_0x5214b0){_0x4156c0=_0x4156c0-0x0;var _0x5a8246=_0xdd3e[_0x4156c0];return _0x5a8246;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xedd3('0x0'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xedd3('0x1'));var rimraf=require(_0xedd3('0x2'));var config=require(_0xedd3('0x3'));var attributes=require(_0xedd3('0x4'));module[_0xedd3('0x5')]=function(_0x26a165,_0x184b8b){return _0x26a165[_0xedd3('0x6')]('FaxAccount',attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7cce=['define','FaxAccount','fax_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./faxAccount.attributes','exports'];(function(_0x2cd89d,_0x5e774d){var _0x1d05b5=function(_0x2889cf){while(--_0x2889cf){_0x2cd89d['push'](_0x2cd89d['shift']());}};_0x1d05b5(++_0x5e774d);}(_0x7cce,0xff));var _0xe7cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cce[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe7cc('0x0'));var util=require('util');var logger=require(_0xe7cc('0x1'))(_0xe7cc('0x2'));var moment=require(_0xe7cc('0x3'));var BPromise=require(_0xe7cc('0x4'));var rp=require(_0xe7cc('0x5'));var fs=require('fs');var path=require(_0xe7cc('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe7cc('0x7'));module[_0xe7cc('0x8')]=function(_0x344be9,_0x2dc733){return _0x344be9[_0xe7cc('0x9')](_0xe7cc('0xa'),attributes,{'tableName':_0xe7cc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index a635a18..63cc928 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 _0xff07=['priority','length','defaults','create','contact','find','FaxInteraction','spread','get','applications','push','close','unmanaged','*,*,*,*','interaction','FaxMessage','AttachmentId','UserId','name','Start','startRouting','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','FaxAccount,\x20%s,\x20%s','message','info','result','catch','GetFaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','keys','createdAt','updatedAt','difference','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','account','CmList','List','Contacts','DESC','FaxApplication','Applications','list','orderBy'];(function(_0x4d3e9b,_0x4cd14b){var _0xe7d866=function(_0x28275e){while(--_0x28275e){_0x4d3e9b['push'](_0x4d3e9b['shift']());}};_0xe7d866(++_0x4cd14b);}(_0xff07,0x6c));var _0x7ff0=function(_0x233d57,_0x284678){_0x233d57=_0x233d57-0x0;var _0x3eec8c=_0xff07[_0x233d57];return _0x3eec8c;};'use strict';var _=require(_0x7ff0('0x0'));var util=require(_0x7ff0('0x1'));var moment=require('moment');var BPromise=require(_0x7ff0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7ff0('0x3'))['db'];var utils=require(_0x7ff0('0x4'));var logger=require(_0x7ff0('0x5'))('rpc');var config=require(_0x7ff0('0x6'));var jayson=require(_0x7ff0('0x7'));var client=jayson[_0x7ff0('0x8')][_0x7ff0('0x9')]({'port':0x232c});config['redis']=_['defaults'](config[_0x7ff0('0xa')],{'host':_0x7ff0('0xb'),'port':0x18eb});var socket=require(_0x7ff0('0xc'))(new Redis(config[_0x7ff0('0xa')]));require(_0x7ff0('0xd'))[_0x7ff0('0xe')](socket);function respondWithRpcPromise(_0x40bef8,_0x587dd2,_0x40adeb){return new BPromise(function(_0x1aac4b,_0x4fbe9b){return client[_0x7ff0('0xf')](_0x40bef8,_0x40adeb)[_0x7ff0('0x10')](function(_0x2626b5){logger['info']('FaxAccount,\x20%s,\x20%s',_0x587dd2,_0x7ff0('0x11'));logger[_0x7ff0('0x12')](_0x7ff0('0x13'),_0x587dd2,'request\x20sent',JSON[_0x7ff0('0x14')](_0x2626b5));if(_0x2626b5['error']){if(_0x2626b5['error'][_0x7ff0('0x15')]===0x1f4){logger[_0x7ff0('0x16')](_0x7ff0('0x17'),_0x587dd2,_0x2626b5[_0x7ff0('0x16')][_0x7ff0('0x18')]);return _0x4fbe9b(_0x2626b5[_0x7ff0('0x16')][_0x7ff0('0x18')]);}logger['error'](_0x7ff0('0x17'),_0x587dd2,_0x2626b5['error']['message']);return _0x1aac4b(_0x2626b5[_0x7ff0('0x16')][_0x7ff0('0x18')]);}else{logger[_0x7ff0('0x19')]('FaxAccount,\x20%s,\x20%s',_0x587dd2,'request\x20sent');_0x1aac4b(_0x2626b5[_0x7ff0('0x1a')][_0x7ff0('0x18')]);}})[_0x7ff0('0x1b')](function(_0x3c40fd){logger[_0x7ff0('0x16')](_0x7ff0('0x17'),_0x587dd2,_0x3c40fd);_0x4fbe9b(_0x3c40fd);});});}exports[_0x7ff0('0x1c')]=function(_0x349c5f){var _0x1a3be5=this;return new Promise(function(_0x29dd05,_0x236473){return db['FaxAccount'][_0x7ff0('0x1d')]({'raw':_0x349c5f['options']?_0x349c5f[_0x7ff0('0x1e')][_0x7ff0('0x1f')]===undefined?!![]:![]:!![],'where':_0x349c5f['options']?_0x349c5f[_0x7ff0('0x1e')][_0x7ff0('0x20')]||null:null,'attributes':_0x349c5f[_0x7ff0('0x1e')]?_0x349c5f['options'][_0x7ff0('0x21')]||null:null,'limit':_0x349c5f[_0x7ff0('0x1e')]?_0x349c5f['options'][_0x7ff0('0x22')]||null:null,'include':_0x349c5f[_0x7ff0('0x1e')]?_0x349c5f[_0x7ff0('0x1e')][_0x7ff0('0x23')]?_[_0x7ff0('0x24')](_0x349c5f[_0x7ff0('0x1e')][_0x7ff0('0x23')],function(_0x57bc96){return{'model':db[_0x57bc96[_0x7ff0('0x25')]],'as':_0x57bc96['as'],'attributes':_0x57bc96[_0x7ff0('0x21')],'include':_0x57bc96[_0x7ff0('0x23')]?_[_0x7ff0('0x24')](_0x57bc96['include'],function(_0x42c77f){return{'model':db[_0x42c77f[_0x7ff0('0x25')]],'as':_0x42c77f['as'],'attributes':_0x42c77f[_0x7ff0('0x21')],'include':_0x42c77f[_0x7ff0('0x23')]?_['map'](_0x42c77f['include'],function(_0x157b9e){return{'model':db[_0x157b9e[_0x7ff0('0x25')]],'as':_0x157b9e['as'],'attributes':_0x157b9e[_0x7ff0('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xdb6124){logger[_0x7ff0('0x19')](_0x7ff0('0x1c'),_0x349c5f);logger[_0x7ff0('0x12')]('GetFaxAccount',_0x349c5f,JSON[_0x7ff0('0x14')](_0xdb6124));_0x29dd05(_0xdb6124);})['catch'](function(_0x359336){logger['error'](_0x7ff0('0x1c'),_0x359336[_0x7ff0('0x18')],_0x349c5f);_0x236473(_0x1a3be5['error'](0x1f4,_0x359336[_0x7ff0('0x18')]));});});};exports[_0x7ff0('0x26')]=function(_0x5e0835,_0x30b985,_0x31b057){var _0x3e43d6=this;return new Promise(function(_0x33ba13,_0x5f2c57){var _0x1dc9ad={'body':_0x5e0835[_0x7ff0('0x27')],'channel':_0x7ff0('0x28')};var _0x465dc2=[];var _0x16795b=[];var _0x4e7010={};return db[_0x7ff0('0x29')][_0x7ff0('0x2a')]()[_0x7ff0('0x10')](function(_0x3995f4){if(!_0x3995f4){throw new db[(_0x7ff0('0x2b'))][(_0x7ff0('0x2c'))]('no\x20available\x20attributes');}_0x465dc2=_['difference'](_[_0x7ff0('0x2d')](_0x3995f4),[_0x7ff0('0x2e'),_0x7ff0('0x2f')]);_0x16795b=_[_0x7ff0('0x30')](_[_0x7ff0('0x2d')](_0x3995f4),[_0x7ff0('0x2e'),_0x7ff0('0x2f'),'CompanyId',_0x7ff0('0x31')]);if(_0x5e0835['body']['id']){delete _0x5e0835[_0x7ff0('0x27')]['id'];}if(_[_0x7ff0('0x32')](_0x5e0835['body'][_0x7ff0('0x33')])){throw new db[(_0x7ff0('0x2b'))][(_0x7ff0('0x2c'))](_0x7ff0('0x34'));}if(_[_0x7ff0('0x32')](_0x5e0835[_0x7ff0('0x27')][_0x7ff0('0x27')])||_0x5e0835[_0x7ff0('0x27')][_0x7ff0('0x27')]===''){throw new db[(_0x7ff0('0x2b'))][(_0x7ff0('0x2c'))](_0x7ff0('0x35'));}if(_[_0x7ff0('0x32')](_0x5e0835[_0x7ff0('0x27')][_0x7ff0('0x36')])){throw new db[(_0x7ff0('0x2b'))][(_0x7ff0('0x2c'))](_0x7ff0('0x37')+_0x16795b);}if(!_[_0x7ff0('0x38')](_0x16795b,_0x5e0835[_0x7ff0('0x27')]['mapKey'])){throw new db[(_0x7ff0('0x2b'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x16795b);}_0x4e7010[_0x5e0835[_0x7ff0('0x27')][_0x7ff0('0x36')]]=_0x5e0835[_0x7ff0('0x27')][_0x7ff0('0x33')];})[_0x7ff0('0x10')](function(){return db['FaxAccount']['find']({'where':{'id':_0x5e0835[_0x7ff0('0x39')]['id']},'include':[{'model':db[_0x7ff0('0x3a')],'as':_0x7ff0('0x3b'),'include':[{'model':db['CmContact'],'as':_0x7ff0('0x3c'),'where':_0x4e7010,'limit':0x1,'order':[['updatedAt',_0x7ff0('0x3d')]]}]},{'model':db[_0x7ff0('0x3e')],'as':_0x7ff0('0x3f')}]});})[_0x7ff0('0x10')](function(_0x3b5f79){if(_0x3b5f79&&_0x3b5f79[_0x7ff0('0x3b')]){var _0x286e3d=_0x3b5f79['get']({'plain':!![]});_0x1dc9ad['account']=_0x286e3d;_0x1dc9ad['applications']=_0x286e3d['Applications'];_0x1dc9ad[_0x7ff0('0x40')]=_0x286e3d[_0x7ff0('0x3b')];_0x1dc9ad['applications']=_[_0x7ff0('0x41')](_0x1dc9ad['applications'],[_0x7ff0('0x42')],['asc']);if(_0x1dc9ad['account'][_0x7ff0('0x3f')]){delete _0x1dc9ad[_0x7ff0('0x39')][_0x7ff0('0x3f')];}if(_0x1dc9ad[_0x7ff0('0x39')][_0x7ff0('0x3b')]&&_0x1dc9ad[_0x7ff0('0x39')][_0x7ff0('0x3b')]['Contacts'][_0x7ff0('0x43')]){return _0x1dc9ad['account'][_0x7ff0('0x3b')][_0x7ff0('0x3c')][0x0];}var _0x4fad7d=_[_0x7ff0('0x44')](_0x5e0835[_0x7ff0('0x27')],{'firstName':_0x5e0835[_0x7ff0('0x27')][_0x7ff0('0x33')],'ListId':_0x286e3d[_0x7ff0('0x31')]});_0x4fad7d[_0x5e0835[_0x7ff0('0x27')]['mapKey']]=_0x5e0835[_0x7ff0('0x27')][_0x7ff0('0x33')];return db[_0x7ff0('0x29')][_0x7ff0('0x45')](_0x4fad7d,{'fields':_0x465dc2,'raw':!![]});}})[_0x7ff0('0x10')](function(_0x144217){_0x1dc9ad[_0x7ff0('0x46')]=_0x144217;if(_0x144217){var _0x42e193={'ContactId':_0x144217['id'],'FaxAccountId':_0x5e0835['account']['id'],'fax':_0x144217[_0x7ff0('0x28')]};return db['FaxInteraction'][_0x7ff0('0x47')]({'where':{'ContactId':_0x144217['id'],'closed':![],'FaxAccountId':_0x5e0835[_0x7ff0('0x39')]['id']}})['then'](function(_0x4790ec){if(_0x4790ec){return[_0x4790ec,![]];}return db[_0x7ff0('0x48')][_0x7ff0('0x45')](_0x42e193)['then'](function(_0x5bd2b0){return[_0x5bd2b0,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x7ff0('0x49')](function(_0x13a38e,_0x1e041a){var _0x27a825=_0x13a38e[_0x7ff0('0x4a')]({'plain':!![]});if(_0x1e041a){if(_0x1dc9ad['account']['autoclose']){_0x1dc9ad[_0x7ff0('0x4b')][_0x7ff0('0x4c')]({'id':0x0,'priority':_0x1dc9ad[_0x7ff0('0x4b')][_0x7ff0('0x43')]+0x1,'app':_0x7ff0('0x4d'),'appdata':_0x7ff0('0x4e'),'interval':_0x7ff0('0x4f')});}_0x27a825['created']=!![];}else{_0x27a825['created']=![];}_0x1dc9ad[_0x7ff0('0x50')]=_0x27a825;return db[_0x7ff0('0x51')]['create']({'body':_0x5e0835['body'][_0x7ff0('0x27')],'FaxAccountId':_0x5e0835[_0x7ff0('0x39')]['id'],'FaxInteractionId':_0x13a38e['id'],'direction':'in','ContactId':_0x13a38e['ContactId'],'AttachmentId':_0x5e0835[_0x7ff0('0x27')][_0x7ff0('0x52')]});})[_0x7ff0('0x10')](function(_0x4653d2){_0x1dc9ad[_0x7ff0('0x18')]=_0x4653d2;if(_0x1dc9ad[_0x7ff0('0x50')][_0x7ff0('0x53')]){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x1dc9ad[_0x7ff0('0x50')]['UserId']}})[_0x7ff0('0x10')](function(_0x16bfc5){if(_0x16bfc5){_0x1dc9ad[_0x7ff0('0x4b')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x16bfc5[_0x7ff0('0x54')]+','+(_0x1dc9ad[_0x7ff0('0x39')]['waitForTheAssignedAgent']||0xa),'interval':_0x7ff0('0x4f')});}return respondWithRpcPromise(_0x7ff0('0x55'),_0x7ff0('0x56'),_0x1dc9ad);});}return respondWithRpcPromise(_0x7ff0('0x55'),_0x7ff0('0x56'),_0x1dc9ad);})[_0x7ff0('0x10')](function(_0x5de9da){_0x33ba13(_0x5de9da);})[_0x7ff0('0x1b')](function(_0x55a1c8){_0x5f2c57(_0x3e43d6[_0x7ff0('0x16')](0x1f4,_0x55a1c8[_0x7ff0('0x18')]));});});}; \ No newline at end of file +var _0xf773=['socket.io-emitter','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxAccount,\x20%s,\x20%s','result','catch','GetFaxAccount','findAll','options','raw','where','attributes','include','map','model','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','difference','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','account','Contacts','DESC','FaxApplication','Applications','List','get','applications','list','orderBy','asc','find','FaxInteraction','create','Contact\x20not\x20found','length','close','unmanaged','*,*,*,*','created','ContactId','AttachmentId','interaction','UserId','name','agent','Start','startRouting','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','localhost'];(function(_0x3f8cc4,_0x16bea3){var _0x1f6a09=function(_0xf28daf){while(--_0xf28daf){_0x3f8cc4['push'](_0x3f8cc4['shift']());}};_0x1f6a09(++_0x16bea3);}(_0xf773,0xf3));var _0x3f77=function(_0x1fb125,_0x218278){_0x1fb125=_0x1fb125-0x0;var _0x54d750=_0xf773[_0x1fb125];return _0x54d750;};'use strict';var _=require(_0x3f77('0x0'));var util=require(_0x3f77('0x1'));var moment=require('moment');var BPromise=require(_0x3f77('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f77('0x3'));var db=require(_0x3f77('0x4'))['db'];var utils=require(_0x3f77('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3f77('0x6'));var jayson=require(_0x3f77('0x7'));var client=jayson['client'][_0x3f77('0x8')]({'port':0x232c});config[_0x3f77('0x9')]=_[_0x3f77('0xa')](config[_0x3f77('0x9')],{'host':_0x3f77('0xb'),'port':0x18eb});var socket=require(_0x3f77('0xc'))(new Redis(config[_0x3f77('0x9')]));require('./faxAccount.socket')['register'](socket);function respondWithRpcPromise(_0x2724f8,_0x14e656,_0x3be3c9){return new BPromise(function(_0x54b2bc,_0x2eb28){return client[_0x3f77('0xd')](_0x2724f8,_0x3be3c9)[_0x3f77('0xe')](function(_0x4f11dd){logger[_0x3f77('0xf')]('FaxAccount,\x20%s,\x20%s',_0x14e656,_0x3f77('0x10'));logger[_0x3f77('0x11')](_0x3f77('0x12'),_0x14e656,_0x3f77('0x10'),JSON[_0x3f77('0x13')](_0x4f11dd));if(_0x4f11dd[_0x3f77('0x14')]){if(_0x4f11dd['error'][_0x3f77('0x15')]===0x1f4){logger[_0x3f77('0x14')]('FaxAccount,\x20%s,\x20%s',_0x14e656,_0x4f11dd['error'][_0x3f77('0x16')]);return _0x2eb28(_0x4f11dd['error'][_0x3f77('0x16')]);}logger[_0x3f77('0x14')]('FaxAccount,\x20%s,\x20%s',_0x14e656,_0x4f11dd[_0x3f77('0x14')][_0x3f77('0x16')]);return _0x54b2bc(_0x4f11dd[_0x3f77('0x14')]['message']);}else{logger[_0x3f77('0xf')](_0x3f77('0x17'),_0x14e656,_0x3f77('0x10'));_0x54b2bc(_0x4f11dd[_0x3f77('0x18')]['message']);}})[_0x3f77('0x19')](function(_0x2fbea7){logger[_0x3f77('0x14')](_0x3f77('0x17'),_0x14e656,_0x2fbea7);_0x2eb28(_0x2fbea7);});});}exports[_0x3f77('0x1a')]=function(_0x1702c3){var _0x4f150c=this;return new Promise(function(_0x162983,_0x3d84f0){return db['FaxAccount'][_0x3f77('0x1b')]({'raw':_0x1702c3[_0x3f77('0x1c')]?_0x1702c3['options'][_0x3f77('0x1d')]===undefined?!![]:![]:!![],'where':_0x1702c3[_0x3f77('0x1c')]?_0x1702c3['options'][_0x3f77('0x1e')]||null:null,'attributes':_0x1702c3['options']?_0x1702c3['options'][_0x3f77('0x1f')]||null:null,'limit':_0x1702c3['options']?_0x1702c3[_0x3f77('0x1c')]['limit']||null:null,'include':_0x1702c3[_0x3f77('0x1c')]?_0x1702c3['options'][_0x3f77('0x20')]?_[_0x3f77('0x21')](_0x1702c3[_0x3f77('0x1c')][_0x3f77('0x20')],function(_0x1bf46b){return{'model':db[_0x1bf46b[_0x3f77('0x22')]],'as':_0x1bf46b['as'],'attributes':_0x1bf46b[_0x3f77('0x1f')],'include':_0x1bf46b['include']?_[_0x3f77('0x21')](_0x1bf46b[_0x3f77('0x20')],function(_0x41ef65){return{'model':db[_0x41ef65['model']],'as':_0x41ef65['as'],'attributes':_0x41ef65[_0x3f77('0x1f')],'include':_0x41ef65[_0x3f77('0x20')]?_['map'](_0x41ef65[_0x3f77('0x20')],function(_0x4b835b){return{'model':db[_0x4b835b[_0x3f77('0x22')]],'as':_0x4b835b['as'],'attributes':_0x4b835b[_0x3f77('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3f77('0xe')](function(_0x2f57f9){logger[_0x3f77('0xf')](_0x3f77('0x1a'),_0x1702c3);logger[_0x3f77('0x11')](_0x3f77('0x1a'),_0x1702c3,JSON['stringify'](_0x2f57f9));_0x162983(_0x2f57f9);})[_0x3f77('0x19')](function(_0x277e9a){logger[_0x3f77('0x14')](_0x3f77('0x1a'),_0x277e9a['message'],_0x1702c3);_0x3d84f0(_0x4f150c[_0x3f77('0x14')](0x1f4,_0x277e9a[_0x3f77('0x16')]));});});};exports[_0x3f77('0x23')]=function(_0x357094,_0x434d44,_0x501209){var _0x2b3c19=this;return new Promise(function(_0x21a6a3,_0x244c15){var _0x122e13={'body':_0x357094[_0x3f77('0x24')],'channel':_0x3f77('0x25')};var _0x86a979=[];var _0x33481a=[];var _0x30d02={};return db[_0x3f77('0x26')][_0x3f77('0x27')]()[_0x3f77('0xe')](function(_0x278b9c){if(!_0x278b9c){throw new db[(_0x3f77('0x28'))][(_0x3f77('0x29'))](_0x3f77('0x2a'));}_0x86a979=_['difference'](_['keys'](_0x278b9c),[_0x3f77('0x2b'),'updatedAt']);_0x33481a=_[_0x3f77('0x2c')](_['keys'](_0x278b9c),['createdAt',_0x3f77('0x2d'),_0x3f77('0x2e'),_0x3f77('0x2f')]);if(_0x357094[_0x3f77('0x24')]['id']){delete _0x357094[_0x3f77('0x24')]['id'];}if(_[_0x3f77('0x30')](_0x357094[_0x3f77('0x24')][_0x3f77('0x31')])){throw new db[(_0x3f77('0x28'))]['ValidationError'](_0x3f77('0x32'));}if(_['isNil'](_0x357094[_0x3f77('0x24')]['body'])||_0x357094[_0x3f77('0x24')][_0x3f77('0x24')]===''){throw new db['Sequelize'][(_0x3f77('0x29'))](_0x3f77('0x33'));}if(_[_0x3f77('0x30')](_0x357094['body'][_0x3f77('0x34')])){throw new db[(_0x3f77('0x28'))][(_0x3f77('0x29'))](_0x3f77('0x35')+_0x33481a);}if(!_[_0x3f77('0x36')](_0x33481a,_0x357094[_0x3f77('0x24')][_0x3f77('0x34')])){throw new db[(_0x3f77('0x28'))][(_0x3f77('0x29'))](_0x3f77('0x37')+_0x33481a);}_0x30d02[_0x357094['body'][_0x3f77('0x34')]]=_0x357094['body'][_0x3f77('0x31')];})[_0x3f77('0xe')](function(){return db[_0x3f77('0x38')]['find']({'where':{'id':_0x357094[_0x3f77('0x39')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x3f77('0x26')],'as':_0x3f77('0x3a'),'where':_0x30d02,'limit':0x1,'order':[['updatedAt',_0x3f77('0x3b')]]}]},{'model':db[_0x3f77('0x3c')],'as':_0x3f77('0x3d')}]});})[_0x3f77('0xe')](function(_0x5f4324){if(_0x5f4324&&_0x5f4324[_0x3f77('0x3e')]){var _0x14f18f=_0x5f4324[_0x3f77('0x3f')]({'plain':!![]});_0x122e13[_0x3f77('0x39')]=_0x14f18f;_0x122e13[_0x3f77('0x40')]=_0x14f18f[_0x3f77('0x3d')];_0x122e13[_0x3f77('0x41')]=_0x14f18f['List'];_0x122e13[_0x3f77('0x40')]=_[_0x3f77('0x42')](_0x122e13['applications'],['priority'],[_0x3f77('0x43')]);if(_0x122e13[_0x3f77('0x39')]['Applications']){delete _0x122e13[_0x3f77('0x39')][_0x3f77('0x3d')];}if(_0x122e13[_0x3f77('0x39')][_0x3f77('0x3e')]&&_0x122e13[_0x3f77('0x39')][_0x3f77('0x3e')]['Contacts']['length']){return _0x122e13[_0x3f77('0x39')][_0x3f77('0x3e')][_0x3f77('0x3a')][0x0];}var _0x3ee092=_[_0x3f77('0xa')](_0x357094[_0x3f77('0x24')],{'firstName':_0x357094[_0x3f77('0x24')][_0x3f77('0x31')],'ListId':_0x14f18f[_0x3f77('0x2f')]});_0x3ee092[_0x357094[_0x3f77('0x24')][_0x3f77('0x34')]]=_0x357094['body']['from'];return db[_0x3f77('0x26')]['create'](_0x3ee092,{'fields':_0x86a979,'raw':!![]});}})[_0x3f77('0xe')](function(_0x57aebc){_0x122e13['contact']=_0x57aebc;if(_0x57aebc){var _0x147f96={'ContactId':_0x57aebc['id'],'FaxAccountId':_0x357094[_0x3f77('0x39')]['id'],'fax':_0x57aebc[_0x3f77('0x25')]};return db['FaxInteraction'][_0x3f77('0x44')]({'where':{'ContactId':_0x57aebc['id'],'closed':![],'FaxAccountId':_0x357094[_0x3f77('0x39')]['id']}})['then'](function(_0x78152c){if(_0x78152c){return[_0x78152c,![]];}return db[_0x3f77('0x45')][_0x3f77('0x46')](_0x147f96)[_0x3f77('0xe')](function(_0x5df6ac){return[_0x5df6ac,!![]];});});}else{throw new Error(_0x3f77('0x47'));}})['spread'](function(_0x3bd491,_0x330175){var _0x1bddc9=_0x3bd491[_0x3f77('0x3f')]({'plain':!![]});if(_0x330175){if(_0x122e13['account']['autoclose']){_0x122e13[_0x3f77('0x40')]['push']({'id':0x0,'priority':_0x122e13[_0x3f77('0x40')][_0x3f77('0x48')]+0x1,'app':_0x3f77('0x49'),'appdata':_0x3f77('0x4a'),'interval':_0x3f77('0x4b')});}_0x1bddc9[_0x3f77('0x4c')]=!![];}else{_0x1bddc9[_0x3f77('0x4c')]=![];}_0x122e13['interaction']=_0x1bddc9;return db['FaxMessage'][_0x3f77('0x46')]({'body':_0x357094[_0x3f77('0x24')][_0x3f77('0x24')],'FaxAccountId':_0x357094[_0x3f77('0x39')]['id'],'FaxInteractionId':_0x3bd491['id'],'direction':'in','ContactId':_0x3bd491[_0x3f77('0x4d')],'AttachmentId':_0x357094[_0x3f77('0x24')][_0x3f77('0x4e')]});})[_0x3f77('0xe')](function(_0x4ac3db){_0x122e13[_0x3f77('0x16')]=_0x4ac3db;if(_0x122e13[_0x3f77('0x4f')][_0x3f77('0x50')]){return db['User'][_0x3f77('0x44')]({'attributes':['id',_0x3f77('0x51')],'where':{'id':_0x122e13['interaction'][_0x3f77('0x50')]}})[_0x3f77('0xe')](function(_0x13b343){if(_0x13b343){_0x122e13[_0x3f77('0x40')]['unshift']({'id':0x0,'priority':0x0,'app':_0x3f77('0x52'),'appdata':_0x13b343[_0x3f77('0x51')]+','+(_0x122e13[_0x3f77('0x39')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x3f77('0x53'),_0x3f77('0x54'),_0x122e13);});}return respondWithRpcPromise(_0x3f77('0x53'),'startRouting',_0x122e13);})[_0x3f77('0xe')](function(_0xf1dda9){_0x21a6a3(_0xf1dda9);})['catch'](function(_0x17a5c4){_0x244c15(_0x2b3c19['error'](0x1f4,_0x17a5c4[_0x3f77('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index f33b9b3..6a21b1a 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 _0xcd31=['./faxAccount.events','save','remove','update','emit','removeListener','register','length'];(function(_0x7590ca,_0x486b4c){var _0x2e5b5f=function(_0x8e51d2){while(--_0x8e51d2){_0x7590ca['push'](_0x7590ca['shift']());}};_0x2e5b5f(++_0x486b4c);}(_0xcd31,0xc0));var _0x1cd3=function(_0x337e7d,_0x1618df){_0x337e7d=_0x337e7d-0x0;var _0x21e2d6=_0xcd31[_0x337e7d];return _0x21e2d6;};'use strict';var FaxAccountEvents=require(_0x1cd3('0x0'));var events=[_0x1cd3('0x1'),_0x1cd3('0x2'),_0x1cd3('0x3')];function createListener(_0x34f52f,_0x1af921){return function(_0x35af3d){_0x1af921[_0x1cd3('0x4')](_0x34f52f,_0x35af3d);};}function removeListener(_0x1a35ed,_0x57c2c9){return function(){FaxAccountEvents[_0x1cd3('0x5')](_0x1a35ed,_0x57c2c9);};}exports[_0x1cd3('0x6')]=function(_0x4d51e5){for(var _0x525242=0x0,_0x32e4d5=events[_0x1cd3('0x7')];_0x525242<_0x32e4d5;_0x525242++){var _0x28137e=events[_0x525242];var _0x22bc1a=createListener('faxAccount:'+_0x28137e,_0x4d51e5);FaxAccountEvents['on'](_0x28137e,_0x22bc1a);}}; \ No newline at end of file +var _0x56dc=['length','faxAccount:','./faxAccount.events','save','remove','update','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x56dc,0x1a6));var _0xc56d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56dc[_0x3dd15e];return _0x231fd0;};'use strict';var FaxAccountEvents=require(_0xc56d('0x0'));var events=[_0xc56d('0x1'),_0xc56d('0x2'),_0xc56d('0x3')];function createListener(_0x3d2a5b,_0x492fef){return function(_0x36cc79){_0x492fef['emit'](_0x3d2a5b,_0x36cc79);};}function removeListener(_0x2527a8,_0x52acc8){return function(){FaxAccountEvents['removeListener'](_0x2527a8,_0x52acc8);};}exports[_0xc56d('0x4')]=function(_0xd6e898){for(var _0x45ed4e=0x0,_0x1c086b=events[_0xc56d('0x5')];_0x45ed4e<_0x1c086b;_0x45ed4e++){var _0x433974=events[_0x45ed4e];var _0x35a381=createListener(_0xc56d('0x6')+_0x433974,_0xd6e898);FaxAccountEvents['on'](_0x433974,_0x35a381);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index fe46af4..299bcf1 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(_0x2ddc9c,_0x19de3a){var _0xeea716=function(_0x410523){while(--_0x410523){_0x2ddc9c['push'](_0x2ddc9c['shift']());}};_0xeea716(++_0x19de3a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/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(_0x3a0a70,_0x586139){var _0x3501b8=function(_0x32a123){while(--_0x32a123){_0x3a0a70['push'](_0x3a0a70['shift']());}};_0x3501b8(++_0x586139);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 9f6fbb4..d378ba5 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 _0x0eff=['INTEGER','noop','TEXT','STRING','*,*,*,*','exports'];(function(_0x5da95c,_0x6d10f3){var _0x5e136a=function(_0x557627){while(--_0x557627){_0x5da95c['push'](_0x5da95c['shift']());}};_0x5e136a(++_0x6d10f3);}(_0x0eff,0x89));var _0xf0ef=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x0eff[_0x54d4fe];return _0x1ab5bb;};'use strict';var Sequelize=require('sequelize');module[_0xf0ef('0x0')]={'priority':{'type':Sequelize[_0xf0ef('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf0ef('0x2')},'appdata':{'type':Sequelize[_0xf0ef('0x3')]()},'description':{'type':Sequelize[_0xf0ef('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf0ef('0x5')}}; \ No newline at end of file +var _0x8fc1=['noop','TEXT','STRING','*,*,*,*','exports','INTEGER'];(function(_0x1f4f0b,_0xc6db05){var _0x1be5c2=function(_0xc1a719){while(--_0xc1a719){_0x1f4f0b['push'](_0x1f4f0b['shift']());}};_0x1be5c2(++_0xc6db05);}(_0x8fc1,0xb8));var _0x18fc=function(_0x7487ba,_0x33f787){_0x7487ba=_0x7487ba-0x0;var _0x176628=_0x8fc1[_0x7487ba];return _0x176628;};'use strict';var Sequelize=require('sequelize');module[_0x18fc('0x0')]={'priority':{'type':Sequelize[_0x18fc('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x18fc('0x2')},'appdata':{'type':Sequelize[_0x18fc('0x3')]()},'description':{'type':Sequelize[_0x18fc('0x4')]},'interval':{'type':Sequelize[_0x18fc('0x4')],'defaultValue':_0x18fc('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 2e1ef48..25e1a9c 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 _0x842f=['params','find','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','FaxApplication','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show'];(function(_0x3a0204,_0x3bf5b5){var _0x100267=function(_0x8e31b4){while(--_0x8e31b4){_0x3a0204['push'](_0x3a0204['shift']());}};_0x100267(++_0x3bf5b5);}(_0x842f,0x1c1));var _0xf842=function(_0x81e59e,_0x5f082d){_0x81e59e=_0x81e59e-0x0;var _0x221350=_0x842f[_0x81e59e];return _0x221350;};'use strict';var emlformat=require(_0xf842('0x0'));var rimraf=require(_0xf842('0x1'));var zipdir=require(_0xf842('0x2'));var jsonpatch=require(_0xf842('0x3'));var rp=require(_0xf842('0x4'));var moment=require(_0xf842('0x5'));var BPromise=require(_0xf842('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf842('0x7'));var sox=require(_0xf842('0x8'));var csv=require(_0xf842('0x9'));var ejs=require(_0xf842('0xa'));var fs=require('fs');var fs_extra=require(_0xf842('0xb'));var _=require(_0xf842('0xc'));var squel=require(_0xf842('0xd'));var crypto=require(_0xf842('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf842('0xf'));var Papa=require('papaparse');var Redis=require(_0xf842('0x10'));var authService=require(_0xf842('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf842('0x12'));var hardwareService=require(_0xf842('0x13'));var logger=require('../../config/logger')(_0xf842('0x14'));var utils=require(_0xf842('0x15'));var config=require(_0xf842('0x16'));var licenseUtil=require(_0xf842('0x17'));var db=require(_0xf842('0x18'))['db'];function respondWithStatusCode(_0x44129f,_0x481b7f){_0x481b7f=_0x481b7f||0xcc;return function(_0x2c7e19){if(_0x2c7e19){return _0x44129f[_0xf842('0x19')](_0x481b7f);}return _0x44129f['status'](_0x481b7f)[_0xf842('0x1a')]();};}function respondWithResult(_0x277ede,_0x110af1){_0x110af1=_0x110af1||0xc8;return function(_0x22cee0){if(_0x22cee0){return _0x277ede[_0xf842('0x1b')](_0x110af1)[_0xf842('0x1c')](_0x22cee0);}};}function respondWithFilteredResult(_0x24c82c,_0x513035){return function(_0x24f400){if(_0x24f400){var _0x4cfa87=typeof _0x513035[_0xf842('0x1d')]===_0xf842('0x1e')&&typeof _0x513035['limit']==='undefined';var _0x301a89=_0x24f400[_0xf842('0x1f')];var _0x2c4e4e=_0x4cfa87?0x0:_0x513035[_0xf842('0x1d')];var _0x4d795d=_0x4cfa87?_0x24f400['count']:_0x513035[_0xf842('0x1d')]+_0x513035[_0xf842('0x20')];var _0x1565dd;if(_0x4d795d>=_0x301a89){_0x4d795d=_0x301a89;_0x1565dd=0xc8;}else{_0x1565dd=0xce;}_0x24c82c[_0xf842('0x1b')](_0x1565dd);return _0x24c82c[_0xf842('0x21')](_0xf842('0x22'),_0x2c4e4e+'-'+_0x4d795d+'/'+_0x301a89)['json'](_0x24f400);}return null;};}function patchUpdates(_0x4ced2e){return function(_0xef6011){try{jsonpatch[_0xf842('0x23')](_0xef6011,_0x4ced2e,!![]);}catch(_0x6644d4){return BPromise[_0xf842('0x24')](_0x6644d4);}return _0xef6011[_0xf842('0x25')]();};}function saveUpdates(_0x1294a2,_0x149ce8){return function(_0x44bb6e){if(_0x44bb6e){return _0x44bb6e['update'](_0x1294a2)[_0xf842('0x26')](function(_0x3ea5ae){return _0x3ea5ae;});}return null;};}function removeEntity(_0x48d2bf,_0x1e8109){return function(_0x1593b2){if(_0x1593b2){return _0x1593b2[_0xf842('0x27')]()[_0xf842('0x26')](function(){_0x48d2bf[_0xf842('0x1b')](0xcc)[_0xf842('0x1a')]();});}};}function handleEntityNotFound(_0x580f1e,_0x3feb3d){return function(_0x230d8a){if(!_0x230d8a){_0x580f1e[_0xf842('0x19')](0x194);}return _0x230d8a;};}function handleError(_0x2912cb,_0x44210f){_0x44210f=_0x44210f||0x1f4;return function(_0x30f50c){logger[_0xf842('0x28')](_0x30f50c['stack']);if(_0x30f50c['name']){delete _0x30f50c[_0xf842('0x29')];}_0x2912cb[_0xf842('0x1b')](_0x44210f)[_0xf842('0x2a')](_0x30f50c);};}exports[_0xf842('0x2b')]=function(_0x21d8e6,_0x2ec10d){var _0x1a2c8b={},_0x29ed09={},_0x20d33f={'count':0x0,'rows':[]};var _0x231303=_['map'](db[_0xf842('0x2c')]['rawAttributes'],function(_0x3b0076){return{'name':_0x3b0076['fieldName'],'type':_0x3b0076[_0xf842('0x2d')][_0xf842('0x2e')]};});_0x29ed09[_0xf842('0x2f')]=_[_0xf842('0x30')](_0x231303,'name');_0x29ed09['query']=_[_0xf842('0x31')](_0x21d8e6['query']);_0x29ed09[_0xf842('0x32')]=_[_0xf842('0x33')](_0x29ed09[_0xf842('0x2f')],_0x29ed09[_0xf842('0x34')]);_0x1a2c8b[_0xf842('0x35')]=_['intersection'](_0x29ed09[_0xf842('0x2f')],qs[_0xf842('0x36')](_0x21d8e6[_0xf842('0x34')][_0xf842('0x36')]));_0x1a2c8b[_0xf842('0x35')]=_0x1a2c8b[_0xf842('0x35')][_0xf842('0x37')]?_0x1a2c8b[_0xf842('0x35')]:_0x29ed09['model'];if(!_0x21d8e6['query'][_0xf842('0x38')]('nolimit')){_0x1a2c8b[_0xf842('0x20')]=qs[_0xf842('0x20')](_0x21d8e6[_0xf842('0x34')][_0xf842('0x20')]);_0x1a2c8b[_0xf842('0x1d')]=qs[_0xf842('0x1d')](_0x21d8e6[_0xf842('0x34')][_0xf842('0x1d')]);}_0x1a2c8b[_0xf842('0x39')]=qs[_0xf842('0x3a')](_0x21d8e6[_0xf842('0x34')][_0xf842('0x3a')]);_0x1a2c8b[_0xf842('0x3b')]=qs[_0xf842('0x32')](_['pick'](_0x21d8e6[_0xf842('0x34')],_0x29ed09[_0xf842('0x32')]),_0x231303);if(_0x21d8e6[_0xf842('0x34')][_0xf842('0x3c')]){_0x1a2c8b[_0xf842('0x3b')]=_[_0xf842('0x3d')](_0x1a2c8b[_0xf842('0x3b')],{'$or':_[_0xf842('0x30')](_0x231303,function(_0x5422ae){if(_0x5422ae[_0xf842('0x2d')]!==_0xf842('0x3e')){var _0x320c18={};_0x320c18[_0x5422ae[_0xf842('0x29')]]={'$like':'%'+_0x21d8e6[_0xf842('0x34')][_0xf842('0x3c')]+'%'};return _0x320c18;}})});}_0x1a2c8b=_[_0xf842('0x3d')]({},_0x1a2c8b,_0x21d8e6['options']);var _0x49177b={'where':_0x1a2c8b[_0xf842('0x3b')]};return db['FaxApplication']['count'](_0x49177b)[_0xf842('0x26')](function(_0x1b0e54){_0x20d33f['count']=_0x1b0e54;if(_0x21d8e6[_0xf842('0x34')][_0xf842('0x3f')]){_0x1a2c8b[_0xf842('0x40')]=[{'all':!![]}];}return db['FaxApplication'][_0xf842('0x41')](_0x1a2c8b);})[_0xf842('0x26')](function(_0x3532fe){_0x20d33f[_0xf842('0x42')]=_0x3532fe;return _0x20d33f;})[_0xf842('0x26')](respondWithFilteredResult(_0x2ec10d,_0x1a2c8b))[_0xf842('0x43')](handleError(_0x2ec10d,null));};exports[_0xf842('0x44')]=function(_0xfafa29,_0x433b11){var _0x453d39={'raw':!![],'where':{'id':_0xfafa29[_0xf842('0x45')]['id']}},_0x4c8b04={};_0x4c8b04[_0xf842('0x2f')]=_['keys'](db[_0xf842('0x2c')]['rawAttributes']);_0x4c8b04[_0xf842('0x34')]=_['keys'](_0xfafa29[_0xf842('0x34')]);_0x4c8b04[_0xf842('0x32')]=_['intersection'](_0x4c8b04['model'],_0x4c8b04['query']);_0x453d39[_0xf842('0x35')]=_[_0xf842('0x33')](_0x4c8b04[_0xf842('0x2f')],qs[_0xf842('0x36')](_0xfafa29[_0xf842('0x34')][_0xf842('0x36')]));_0x453d39[_0xf842('0x35')]=_0x453d39['attributes']['length']?_0x453d39[_0xf842('0x35')]:_0x4c8b04['model'];if(_0xfafa29['query'][_0xf842('0x3f')]){_0x453d39[_0xf842('0x40')]=[{'all':!![]}];}_0x453d39=_[_0xf842('0x3d')]({},_0x453d39,_0xfafa29['options']);return db[_0xf842('0x2c')][_0xf842('0x46')](_0x453d39)[_0xf842('0x26')](handleEntityNotFound(_0x433b11,null))[_0xf842('0x26')](respondWithResult(_0x433b11,null))[_0xf842('0x43')](handleError(_0x433b11,null));};exports[_0xf842('0x47')]=function(_0x4cacad,_0x1931cb){return db[_0xf842('0x2c')][_0xf842('0x47')](_0x4cacad['body'],{})['then'](respondWithResult(_0x1931cb,0xc9))['catch'](handleError(_0x1931cb,null));};exports[_0xf842('0x48')]=function(_0x485443,_0xf04f45){if(_0x485443[_0xf842('0x49')]['id']){delete _0x485443[_0xf842('0x49')]['id'];}return db[_0xf842('0x2c')]['find']({'where':{'id':_0x485443['params']['id']}})[_0xf842('0x26')](handleEntityNotFound(_0xf04f45,null))['then'](saveUpdates(_0x485443[_0xf842('0x49')],null))[_0xf842('0x26')](respondWithResult(_0xf04f45,null))[_0xf842('0x43')](handleError(_0xf04f45,null));};exports['destroy']=function(_0x49a7b1,_0x5ef580){return db[_0xf842('0x2c')][_0xf842('0x46')]({'where':{'id':_0x49a7b1['params']['id']}})[_0xf842('0x26')](handleEntityNotFound(_0x5ef580,null))[_0xf842('0x26')](removeEntity(_0x5ef580,null))['catch'](handleError(_0x5ef580,null));}; \ No newline at end of file +var _0x4c22=['send','index','map','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','FaxApplication','rows','show','params','keys','rawAttributes','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name'];(function(_0xd24b43,_0x11caa4){var _0x2b1b44=function(_0x5b84af){while(--_0x5b84af){_0xd24b43['push'](_0xd24b43['shift']());}};_0x2b1b44(++_0x11caa4);}(_0x4c22,0x189));var _0x24c2=function(_0x463c29,_0x33769a){_0x463c29=_0x463c29-0x0;var _0x8db4f3=_0x4c22[_0x463c29];return _0x8db4f3;};'use strict';var emlformat=require(_0x24c2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x24c2('0x1'));var jsonpatch=require(_0x24c2('0x2'));var rp=require(_0x24c2('0x3'));var moment=require(_0x24c2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x24c2('0x5'));var util=require(_0x24c2('0x6'));var path=require(_0x24c2('0x7'));var sox=require(_0x24c2('0x8'));var csv=require('to-csv');var ejs=require(_0x24c2('0x9'));var fs=require('fs');var fs_extra=require(_0x24c2('0xa'));var _=require(_0x24c2('0xb'));var squel=require('squel');var crypto=require(_0x24c2('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x24c2('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x24c2('0xe'));var hardwareService=require(_0x24c2('0xf'));var logger=require('../../config/logger')(_0x24c2('0x10'));var utils=require(_0x24c2('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x24c2('0x12'));var db=require(_0x24c2('0x13'))['db'];function respondWithStatusCode(_0x4b073a,_0x1702a7){_0x1702a7=_0x1702a7||0xcc;return function(_0x35897a){if(_0x35897a){return _0x4b073a[_0x24c2('0x14')](_0x1702a7);}return _0x4b073a[_0x24c2('0x15')](_0x1702a7)['end']();};}function respondWithResult(_0x66c9a1,_0x4e908c){_0x4e908c=_0x4e908c||0xc8;return function(_0x3f011a){if(_0x3f011a){return _0x66c9a1[_0x24c2('0x15')](_0x4e908c)[_0x24c2('0x16')](_0x3f011a);}};}function respondWithFilteredResult(_0x4f67e8,_0x2a9409){return function(_0x4cd449){if(_0x4cd449){var _0x17808f=typeof _0x2a9409['offset']===_0x24c2('0x17')&&typeof _0x2a9409['limit']===_0x24c2('0x17');var _0x4eb2fa=_0x4cd449[_0x24c2('0x18')];var _0x5c8329=_0x17808f?0x0:_0x2a9409[_0x24c2('0x19')];var _0x501cb1=_0x17808f?_0x4cd449[_0x24c2('0x18')]:_0x2a9409['offset']+_0x2a9409[_0x24c2('0x1a')];var _0x5f0fa6;if(_0x501cb1>=_0x4eb2fa){_0x501cb1=_0x4eb2fa;_0x5f0fa6=0xc8;}else{_0x5f0fa6=0xce;}_0x4f67e8[_0x24c2('0x15')](_0x5f0fa6);return _0x4f67e8[_0x24c2('0x1b')](_0x24c2('0x1c'),_0x5c8329+'-'+_0x501cb1+'/'+_0x4eb2fa)['json'](_0x4cd449);}return null;};}function patchUpdates(_0x47e73b){return function(_0x1a4c43){try{jsonpatch[_0x24c2('0x1d')](_0x1a4c43,_0x47e73b,!![]);}catch(_0x2ae49d){return BPromise[_0x24c2('0x1e')](_0x2ae49d);}return _0x1a4c43[_0x24c2('0x1f')]();};}function saveUpdates(_0x5d5c50,_0x2d11b4){return function(_0x2c2d04){if(_0x2c2d04){return _0x2c2d04[_0x24c2('0x20')](_0x5d5c50)[_0x24c2('0x21')](function(_0x50bc1d){return _0x50bc1d;});}return null;};}function removeEntity(_0x26ef39,_0x388e46){return function(_0x1eff44){if(_0x1eff44){return _0x1eff44[_0x24c2('0x22')]()[_0x24c2('0x21')](function(){_0x26ef39[_0x24c2('0x15')](0xcc)[_0x24c2('0x23')]();});}};}function handleEntityNotFound(_0x3bfd00,_0x3f0a21){return function(_0x3df988){if(!_0x3df988){_0x3bfd00['sendStatus'](0x194);}return _0x3df988;};}function handleError(_0x585cb1,_0x167139){_0x167139=_0x167139||0x1f4;return function(_0x5b73e2){logger[_0x24c2('0x24')](_0x5b73e2[_0x24c2('0x25')]);if(_0x5b73e2[_0x24c2('0x26')]){delete _0x5b73e2[_0x24c2('0x26')];}_0x585cb1[_0x24c2('0x15')](_0x167139)[_0x24c2('0x27')](_0x5b73e2);};}exports[_0x24c2('0x28')]=function(_0x569cb4,_0x51c283){var _0x19f530={},_0x25f4b5={},_0x48c87e={'count':0x0,'rows':[]};var _0x17e9b9=_[_0x24c2('0x29')](db['FaxApplication']['rawAttributes'],function(_0x40b920){return{'name':_0x40b920[_0x24c2('0x2a')],'type':_0x40b920['type'][_0x24c2('0x2b')]};});_0x25f4b5[_0x24c2('0x2c')]=_[_0x24c2('0x29')](_0x17e9b9,_0x24c2('0x26'));_0x25f4b5['query']=_['keys'](_0x569cb4[_0x24c2('0x2d')]);_0x25f4b5['filters']=_['intersection'](_0x25f4b5[_0x24c2('0x2c')],_0x25f4b5[_0x24c2('0x2d')]);_0x19f530['attributes']=_[_0x24c2('0x2e')](_0x25f4b5[_0x24c2('0x2c')],qs[_0x24c2('0x2f')](_0x569cb4[_0x24c2('0x2d')][_0x24c2('0x2f')]));_0x19f530[_0x24c2('0x30')]=_0x19f530[_0x24c2('0x30')][_0x24c2('0x31')]?_0x19f530['attributes']:_0x25f4b5[_0x24c2('0x2c')];if(!_0x569cb4['query'][_0x24c2('0x32')]('nolimit')){_0x19f530[_0x24c2('0x1a')]=qs[_0x24c2('0x1a')](_0x569cb4[_0x24c2('0x2d')][_0x24c2('0x1a')]);_0x19f530[_0x24c2('0x19')]=qs['offset'](_0x569cb4['query'][_0x24c2('0x19')]);}_0x19f530[_0x24c2('0x33')]=qs[_0x24c2('0x34')](_0x569cb4[_0x24c2('0x2d')][_0x24c2('0x34')]);_0x19f530['where']=qs[_0x24c2('0x35')](_[_0x24c2('0x36')](_0x569cb4[_0x24c2('0x2d')],_0x25f4b5[_0x24c2('0x35')]),_0x17e9b9);if(_0x569cb4[_0x24c2('0x2d')][_0x24c2('0x37')]){_0x19f530[_0x24c2('0x38')]=_[_0x24c2('0x39')](_0x19f530[_0x24c2('0x38')],{'$or':_[_0x24c2('0x29')](_0x17e9b9,function(_0x228414){if(_0x228414['type']!==_0x24c2('0x3a')){var _0x1430be={};_0x1430be[_0x228414[_0x24c2('0x26')]]={'$like':'%'+_0x569cb4[_0x24c2('0x2d')]['filter']+'%'};return _0x1430be;}})});}_0x19f530=_[_0x24c2('0x39')]({},_0x19f530,_0x569cb4[_0x24c2('0x3b')]);var _0x8a2869={'where':_0x19f530[_0x24c2('0x38')]};return db['FaxApplication']['count'](_0x8a2869)[_0x24c2('0x21')](function(_0xec0b6b){_0x48c87e[_0x24c2('0x18')]=_0xec0b6b;if(_0x569cb4['query'][_0x24c2('0x3c')]){_0x19f530[_0x24c2('0x3d')]=[{'all':!![]}];}return db[_0x24c2('0x3e')]['findAll'](_0x19f530);})[_0x24c2('0x21')](function(_0x12c8ca){_0x48c87e[_0x24c2('0x3f')]=_0x12c8ca;return _0x48c87e;})[_0x24c2('0x21')](respondWithFilteredResult(_0x51c283,_0x19f530))['catch'](handleError(_0x51c283,null));};exports[_0x24c2('0x40')]=function(_0x2daaa8,_0x363e1c){var _0x3fb2ff={'raw':!![],'where':{'id':_0x2daaa8[_0x24c2('0x41')]['id']}},_0x488a57={};_0x488a57[_0x24c2('0x2c')]=_[_0x24c2('0x42')](db[_0x24c2('0x3e')][_0x24c2('0x43')]);_0x488a57[_0x24c2('0x2d')]=_[_0x24c2('0x42')](_0x2daaa8[_0x24c2('0x2d')]);_0x488a57[_0x24c2('0x35')]=_[_0x24c2('0x2e')](_0x488a57[_0x24c2('0x2c')],_0x488a57[_0x24c2('0x2d')]);_0x3fb2ff[_0x24c2('0x30')]=_['intersection'](_0x488a57[_0x24c2('0x2c')],qs['fields'](_0x2daaa8['query'][_0x24c2('0x2f')]));_0x3fb2ff[_0x24c2('0x30')]=_0x3fb2ff[_0x24c2('0x30')][_0x24c2('0x31')]?_0x3fb2ff['attributes']:_0x488a57[_0x24c2('0x2c')];if(_0x2daaa8[_0x24c2('0x2d')]['includeAll']){_0x3fb2ff[_0x24c2('0x3d')]=[{'all':!![]}];}_0x3fb2ff=_[_0x24c2('0x39')]({},_0x3fb2ff,_0x2daaa8['options']);return db[_0x24c2('0x3e')][_0x24c2('0x44')](_0x3fb2ff)[_0x24c2('0x21')](handleEntityNotFound(_0x363e1c,null))['then'](respondWithResult(_0x363e1c,null))[_0x24c2('0x45')](handleError(_0x363e1c,null));};exports['create']=function(_0x1e8bf5,_0x3418fa){return db['FaxApplication'][_0x24c2('0x46')](_0x1e8bf5[_0x24c2('0x47')],{})[_0x24c2('0x21')](respondWithResult(_0x3418fa,0xc9))[_0x24c2('0x45')](handleError(_0x3418fa,null));};exports[_0x24c2('0x20')]=function(_0x1da967,_0xcab7ee){if(_0x1da967[_0x24c2('0x47')]['id']){delete _0x1da967[_0x24c2('0x47')]['id'];}return db[_0x24c2('0x3e')]['find']({'where':{'id':_0x1da967[_0x24c2('0x41')]['id']}})['then'](handleEntityNotFound(_0xcab7ee,null))[_0x24c2('0x21')](saveUpdates(_0x1da967['body'],null))['then'](respondWithResult(_0xcab7ee,null))[_0x24c2('0x45')](handleError(_0xcab7ee,null));};exports[_0x24c2('0x22')]=function(_0x341321,_0x427677){return db[_0x24c2('0x3e')][_0x24c2('0x44')]({'where':{'id':_0x341321[_0x24c2('0x41')]['id']}})[_0x24c2('0x21')](handleEntityNotFound(_0x427677,null))['then'](removeEntity(_0x427677,null))[_0x24c2('0x45')](handleError(_0x427677,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index eeff337..006f9ec 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 _0x5999=['utf8mb4','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','FaxApplication','fax_applications'];(function(_0x3721a5,_0x339454){var _0x12b292=function(_0x2a08a1){while(--_0x2a08a1){_0x3721a5['push'](_0x3721a5['shift']());}};_0x12b292(++_0x339454);}(_0x5999,0xb1));var _0x9599=function(_0x42b551,_0x469d15){_0x42b551=_0x42b551-0x0;var _0x5797d0=_0x5999[_0x42b551];return _0x5797d0;};'use strict';var _=require(_0x9599('0x0'));var util=require('util');var logger=require(_0x9599('0x1'))(_0x9599('0x2'));var moment=require(_0x9599('0x3'));var BPromise=require(_0x9599('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9599('0x5'));var rimraf=require(_0x9599('0x6'));var config=require(_0x9599('0x7'));var attributes=require('./faxApplication.attributes');module['exports']=function(_0x263259,_0x5d6ae5){return _0x263259['define'](_0x9599('0x8'),attributes,{'tableName':_0x9599('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9599('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xe7ae=['lodash','api','bluebird','request-promise','path','../../config/environment','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x5c7e9e,_0x5084c9){var _0x55fe39=function(_0x2b1215){while(--_0x2b1215){_0x5c7e9e['push'](_0x5c7e9e['shift']());}};_0x55fe39(++_0x5084c9);}(_0xe7ae,0xc0));var _0xee7a=function(_0x5e8fc,_0x1ccc06){_0x5e8fc=_0x5e8fc-0x0;var _0x41c58c=_0xe7ae[_0x5e8fc];return _0x41c58c;};'use strict';var _=require(_0xee7a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee7a('0x1'));var moment=require('moment');var BPromise=require(_0xee7a('0x2'));var rp=require(_0xee7a('0x3'));var fs=require('fs');var path=require(_0xee7a('0x4'));var rimraf=require('rimraf');var config=require(_0xee7a('0x5'));var attributes=require('./faxApplication.attributes');module[_0xee7a('0x6')]=function(_0x6b70f8,_0x5162f1){return _0x6b70f8[_0xee7a('0x7')](_0xee7a('0x8'),attributes,{'tableName':_0xee7a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xee7a('0xa'),'collate':_0xee7a('0xb')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 7122ebc..63e9354 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 _0xbb91=['http','request','then','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','FaxApplication,\x20%s,\x20%s','info','result','UpdateFaxApplication','FaxApplication','update','body','options','attributes','limit','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xbb91,0xce));var _0x1bb9=function(_0x4d6bfd,_0x8d79ff){_0x4d6bfd=_0x4d6bfd-0x0;var _0x243a46=_0xbb91[_0x4d6bfd];return _0x243a46;};'use strict';var _=require(_0x1bb9('0x0'));var util=require(_0x1bb9('0x1'));var moment=require(_0x1bb9('0x2'));var BPromise=require('bluebird');var rs=require(_0x1bb9('0x3'));var fs=require('fs');var Redis=require(_0x1bb9('0x4'));var db=require(_0x1bb9('0x5'))['db'];var utils=require(_0x1bb9('0x6'));var logger=require(_0x1bb9('0x7'))(_0x1bb9('0x8'));var config=require(_0x1bb9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1bb9('0xa')][_0x1bb9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x76a888,_0x45bf38,_0x257cae){return new BPromise(function(_0x5becd3,_0x5a45f0){return client[_0x1bb9('0xc')](_0x76a888,_0x257cae)[_0x1bb9('0xd')](function(_0x3217ab){logger['info']('FaxApplication,\x20%s,\x20%s',_0x45bf38,_0x1bb9('0xe'));logger[_0x1bb9('0xf')](_0x1bb9('0x10'),_0x45bf38,_0x1bb9('0xe'),JSON[_0x1bb9('0x11')](_0x3217ab));if(_0x3217ab[_0x1bb9('0x12')]){if(_0x3217ab['error']['code']===0x1f4){logger[_0x1bb9('0x12')]('FaxApplication,\x20%s,\x20%s',_0x45bf38,_0x3217ab['error']['message']);return _0x5a45f0(_0x3217ab[_0x1bb9('0x12')][_0x1bb9('0x13')]);}logger[_0x1bb9('0x12')](_0x1bb9('0x14'),_0x45bf38,_0x3217ab[_0x1bb9('0x12')][_0x1bb9('0x13')]);return _0x5becd3(_0x3217ab[_0x1bb9('0x12')][_0x1bb9('0x13')]);}else{logger[_0x1bb9('0x15')](_0x1bb9('0x14'),_0x45bf38,_0x1bb9('0xe'));_0x5becd3(_0x3217ab[_0x1bb9('0x16')][_0x1bb9('0x13')]);}})['catch'](function(_0x3788a0){logger[_0x1bb9('0x12')](_0x1bb9('0x14'),_0x45bf38,_0x3788a0);_0x5a45f0(_0x3788a0);});});}exports[_0x1bb9('0x17')]=function(_0x5f1592){var _0x5314db=this;return new Promise(function(_0x5c11c6,_0x280026){return db[_0x1bb9('0x18')][_0x1bb9('0x19')](_0x5f1592[_0x1bb9('0x1a')],{'raw':_0x5f1592[_0x1bb9('0x1b')]?_0x5f1592[_0x1bb9('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f1592[_0x1bb9('0x1b')]?_0x5f1592[_0x1bb9('0x1b')]['where']||null:null,'attributes':_0x5f1592['options']?_0x5f1592[_0x1bb9('0x1b')][_0x1bb9('0x1c')]||null:null,'limit':_0x5f1592[_0x1bb9('0x1b')]?_0x5f1592[_0x1bb9('0x1b')][_0x1bb9('0x1d')]||null:null})[_0x1bb9('0xd')](function(_0x5df1fa){logger[_0x1bb9('0x15')](_0x1bb9('0x17'),_0x5f1592);logger[_0x1bb9('0xf')](_0x1bb9('0x17'),_0x5f1592,JSON[_0x1bb9('0x11')](_0x5df1fa));_0x5c11c6(_0x5df1fa);})[_0x1bb9('0x1e')](function(_0x5933b9){logger[_0x1bb9('0x12')](_0x1bb9('0x17'),_0x5933b9[_0x1bb9('0x13')],_0x5f1592);_0x280026(_0x5314db[_0x1bb9('0x12')](0x1f4,_0x5933b9[_0x1bb9('0x13')]));});});}; \ No newline at end of file +var _0x75cf=['limit','catch','lodash','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','info','result','UpdateFaxApplication','FaxApplication','update','body','options','attributes'];(function(_0x5b663,_0x333146){var _0x5f89fc=function(_0x5e7c21){while(--_0x5e7c21){_0x5b663['push'](_0x5b663['shift']());}};_0x5f89fc(++_0x333146);}(_0x75cf,0x18a));var _0xf75c=function(_0x27d121,_0x47506a){_0x27d121=_0x27d121-0x0;var _0x10c0ff=_0x75cf[_0x27d121];return _0x10c0ff;};'use strict';var _=require(_0xf75c('0x0'));var util=require(_0xf75c('0x1'));var moment=require('moment');var BPromise=require(_0xf75c('0x2'));var rs=require(_0xf75c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf75c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf75c('0x5'));var config=require(_0xf75c('0x6'));var jayson=require(_0xf75c('0x7'));var client=jayson['client'][_0xf75c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42726c,_0x17a78c,_0x3f76ae){return new BPromise(function(_0x4e010b,_0xe1b8c4){return client[_0xf75c('0x9')](_0x42726c,_0x3f76ae)[_0xf75c('0xa')](function(_0x29571b){logger['info']('FaxApplication,\x20%s,\x20%s',_0x17a78c,_0xf75c('0xb'));logger[_0xf75c('0xc')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x17a78c,'request\x20sent',JSON[_0xf75c('0xd')](_0x29571b));if(_0x29571b[_0xf75c('0xe')]){if(_0x29571b['error'][_0xf75c('0xf')]===0x1f4){logger[_0xf75c('0xe')](_0xf75c('0x10'),_0x17a78c,_0x29571b['error'][_0xf75c('0x11')]);return _0xe1b8c4(_0x29571b[_0xf75c('0xe')]['message']);}logger[_0xf75c('0xe')]('FaxApplication,\x20%s,\x20%s',_0x17a78c,_0x29571b[_0xf75c('0xe')][_0xf75c('0x11')]);return _0x4e010b(_0x29571b[_0xf75c('0xe')][_0xf75c('0x11')]);}else{logger[_0xf75c('0x12')](_0xf75c('0x10'),_0x17a78c,_0xf75c('0xb'));_0x4e010b(_0x29571b[_0xf75c('0x13')][_0xf75c('0x11')]);}})['catch'](function(_0x671055){logger[_0xf75c('0xe')](_0xf75c('0x10'),_0x17a78c,_0x671055);_0xe1b8c4(_0x671055);});});}exports[_0xf75c('0x14')]=function(_0x4e9f76){var _0x2ee5ea=this;return new Promise(function(_0x56c975,_0x38968a){return db[_0xf75c('0x15')][_0xf75c('0x16')](_0x4e9f76[_0xf75c('0x17')],{'raw':_0x4e9f76[_0xf75c('0x18')]?_0x4e9f76[_0xf75c('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e9f76[_0xf75c('0x18')]?_0x4e9f76[_0xf75c('0x18')]['where']||null:null,'attributes':_0x4e9f76[_0xf75c('0x18')]?_0x4e9f76[_0xf75c('0x18')][_0xf75c('0x19')]||null:null,'limit':_0x4e9f76['options']?_0x4e9f76[_0xf75c('0x18')][_0xf75c('0x1a')]||null:null})[_0xf75c('0xa')](function(_0xcfbb3c){logger[_0xf75c('0x12')](_0xf75c('0x14'),_0x4e9f76);logger['debug'](_0xf75c('0x14'),_0x4e9f76,JSON[_0xf75c('0xd')](_0xcfbb3c));_0x56c975(_0xcfbb3c);})[_0xf75c('0x1b')](function(_0x251a2b){logger[_0xf75c('0xe')](_0xf75c('0x14'),_0x251a2b[_0xf75c('0x11')],_0x4e9f76);_0x38968a(_0x2ee5ea[_0xf75c('0xe')](0x1f4,_0x251a2b[_0xf75c('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 449210a..087d635 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 _0x13f6=['delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','isAuthenticated','index','post','create','put','update'];(function(_0x3b0910,_0x224a2d){var _0x4df3fd=function(_0x5c4835){while(--_0x5c4835){_0x3b0910['push'](_0x3b0910['shift']());}};_0x4df3fd(++_0x224a2d);}(_0x13f6,0x124));var _0x613f=function(_0x5aef7d,_0x4b7468){_0x5aef7d=_0x5aef7d-0x0;var _0x320893=_0x13f6[_0x5aef7d];return _0x320893;};'use strict';var multer=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x613f('0x2'));var router=express[_0x613f('0x3')]();var fs_extra=require(_0x613f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x613f('0x5'));var config=require(_0x613f('0x6'));var controller=require(_0x613f('0x7'));router['get']('/',auth[_0x613f('0x8')](),controller[_0x613f('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x613f('0xa')]('/',auth[_0x613f('0x8')](),controller[_0x613f('0xb')]);router[_0x613f('0xc')]('/:id',auth[_0x613f('0x8')](),controller[_0x613f('0xd')]);router[_0x613f('0xe')]('/:id',auth[_0x613f('0x8')](),controller[_0x613f('0xf')]);module[_0x613f('0x10')]=router; \ No newline at end of file +var _0x4213=['post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./faxApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x3fcb8a,_0xf07210){var _0x357da6=function(_0x26deac){while(--_0x26deac){_0x3fcb8a['push'](_0x3fcb8a['shift']());}};_0x357da6(++_0xf07210);}(_0x4213,0x77));var _0x3421=function(_0x1ea21f,_0x2378d0){_0x1ea21f=_0x1ea21f-0x0;var _0x305f7c=_0x4213[_0x1ea21f];return _0x305f7c;};'use strict';var multer=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var path=require(_0x3421('0x2'));var timeout=require(_0x3421('0x3'));var express=require(_0x3421('0x4'));var router=express[_0x3421('0x5')]();var fs_extra=require(_0x3421('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3421('0x7'));var config=require('../../config/environment');var controller=require(_0x3421('0x8'));router[_0x3421('0x9')]('/',auth[_0x3421('0xa')](),controller[_0x3421('0xb')]);router['get'](_0x3421('0xc'),auth[_0x3421('0xa')](),controller[_0x3421('0xd')]);router[_0x3421('0xe')]('/',auth[_0x3421('0xa')](),controller['create']);router[_0x3421('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3421('0x10')]);router['delete'](_0x3421('0xc'),auth[_0x3421('0xa')](),controller[_0x3421('0x11')]);module[_0x3421('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 267f3b3..13d8281 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 _0x31c8=['BOOLEAN','DATE','STRING','out','ENUM','sequelize','exports'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0x31c8,0xf3));var _0x831c=function(_0x128887,_0x3c5e0e){_0x128887=_0x128887-0x0;var _0x1a4305=_0x31c8[_0x128887];return _0x1a4305;};'use strict';var Sequelize=require(_0x831c('0x0'));module[_0x831c('0x1')]={'closed':{'type':Sequelize[_0x831c('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x831c('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x831c('0x4')]},'thirdDisposition':{'type':Sequelize[_0x831c('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x831c('0x3')]},'fax':{'type':Sequelize[_0x831c('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x831c('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x831c('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x831c('0x6')]('in',_0x831c('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x8518=['DATE','ENUM','out','exports','BOOLEAN','STRING'];(function(_0x2d9535,_0x4bc592){var _0xb4e710=function(_0x50b9a9){while(--_0x50b9a9){_0x2d9535['push'](_0x2d9535['shift']());}};_0xb4e710(++_0x4bc592);}(_0x8518,0x18f));var _0x8851=function(_0x3ab0f7,_0x421925){_0x3ab0f7=_0x3ab0f7-0x0;var _0x55ab91=_0x8518[_0x3ab0f7];return _0x55ab91;};'use strict';var Sequelize=require('sequelize');module[_0x8851('0x0')]={'closed':{'type':Sequelize[_0x8851('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x8851('0x2')]},'secondDisposition':{'type':Sequelize[_0x8851('0x2')]},'thirdDisposition':{'type':Sequelize[_0x8851('0x2')]},'note':{'type':Sequelize[_0x8851('0x2')]},'read1stAt':{'type':Sequelize[_0x8851('0x3')]},'fax':{'type':Sequelize[_0x8851('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x8851('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8851('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x8851('0x4')]('in',_0x8851('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 ee5627b..a0770dd 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 _0xeb2d=['apply','reject','update','then','error','name','map','fullname','TagIds','split','forEach','Tags','push','waiting','talking','answered','unmanaged','total','closed','UserId','index','FaxInteraction','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','order','sort','select','field','from','tools_tags','ui.FaxInteractionId','user_has_fax_interactions','users','fax_interactions','o.id\x20=\x20i.UserId','left_join','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','unreadMessages','value','having','`\x20=\x200','Contact','$substring','length','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','start','Tag','union','User','operator','body','text','keys','some','compact','isEmpty','FaxAccountId','where','i.FaxAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','rows','catch','params','includeAll','include','options','destroy','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','hasOwnProperty','pick','YYYY-MM-DD\x20HH:mm:ss','setTags','color','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','format','transcript-%d-%s.zip','Attachment','Messages','basename','existsSync','createReadStream','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x2caead,_0x577c1f){var _0x4c709a=function(_0x44b594){while(--_0x44b594){_0x2caead['push'](_0x2caead['shift']());}};_0x4c709a(++_0x577c1f);}(_0xeb2d,0x183));var _0xdeb2=function(_0x1bc5d0,_0x339733){_0x1bc5d0=_0x1bc5d0-0x0;var _0x1b0927=_0xeb2d[_0x1bc5d0];return _0x1b0927;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdeb2('0x0'));var zipdir=require(_0xdeb2('0x1'));var jsonpatch=require(_0xdeb2('0x2'));var rp=require(_0xdeb2('0x3'));var moment=require('moment');var BPromise=require(_0xdeb2('0x4'));var Mustache=require('mustache');var util=require(_0xdeb2('0x5'));var path=require(_0xdeb2('0x6'));var sox=require('sox');var csv=require(_0xdeb2('0x7'));var ejs=require(_0xdeb2('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdeb2('0x9'));var crypto=require(_0xdeb2('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdeb2('0x7'));var querystring=require(_0xdeb2('0xb'));var Papa=require(_0xdeb2('0xc'));var Redis=require(_0xdeb2('0xd'));var authService=require(_0xdeb2('0xe'));var qs=require(_0xdeb2('0xf'));var as=require(_0xdeb2('0x10'));var hardwareService=require(_0xdeb2('0x11'));var logger=require('../../config/logger')(_0xdeb2('0x12'));var utils=require(_0xdeb2('0x13'));var config=require(_0xdeb2('0x14'));var licenseUtil=require(_0xdeb2('0x15'));var db=require(_0xdeb2('0x16'))['db'];config[_0xdeb2('0x17')]=_[_0xdeb2('0x18')](config[_0xdeb2('0x17')],{'host':_0xdeb2('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdeb2('0x17')]));require('./faxInteraction.socket')[_0xdeb2('0x1a')](socket);function respondWithStatusCode(_0x3b205c,_0xbb0072){_0xbb0072=_0xbb0072||0xcc;return function(_0x1f229f){if(_0x1f229f){return _0x3b205c[_0xdeb2('0x1b')](_0xbb0072);}return _0x3b205c[_0xdeb2('0x1c')](_0xbb0072)[_0xdeb2('0x1d')]();};}function respondWithResult(_0x58913e,_0x4f5fb9){_0x4f5fb9=_0x4f5fb9||0xc8;return function(_0x58189c){if(_0x58189c){return _0x58913e[_0xdeb2('0x1c')](_0x4f5fb9)[_0xdeb2('0x1e')](_0x58189c);}};}function respondWithFilteredResult(_0x30146a,_0x434695){return function(_0x357b6c){if(_0x357b6c){var _0x24278a=typeof _0x434695[_0xdeb2('0x1f')]===_0xdeb2('0x20')&&typeof _0x434695[_0xdeb2('0x21')]===_0xdeb2('0x20');var _0x23918=_0x357b6c[_0xdeb2('0x22')];var _0x2b5665=_0x24278a?0x0:_0x434695[_0xdeb2('0x1f')];var _0x5af3dc=_0x24278a?_0x357b6c[_0xdeb2('0x22')]:_0x434695['offset']+_0x434695[_0xdeb2('0x21')];var _0x670510;if(_0x5af3dc>=_0x23918){_0x5af3dc=_0x23918;_0x670510=0xc8;}else{_0x670510=0xce;}_0x30146a['status'](_0x670510);return _0x30146a[_0xdeb2('0x23')](_0xdeb2('0x24'),_0x2b5665+'-'+_0x5af3dc+'/'+_0x23918)['json'](_0x357b6c);}return null;};}function patchUpdates(_0x307677){return function(_0x547427){try{jsonpatch[_0xdeb2('0x25')](_0x547427,_0x307677,!![]);}catch(_0x3f0dd6){return BPromise[_0xdeb2('0x26')](_0x3f0dd6);}return _0x547427['save']();};}function saveUpdates(_0x363d8a,_0x59491a){return function(_0x5ab9af){if(_0x5ab9af){return _0x5ab9af[_0xdeb2('0x27')](_0x363d8a)[_0xdeb2('0x28')](function(_0x80adde){return _0x80adde;});}return null;};}function removeEntity(_0x42143a,_0x2f0617){return function(_0x5e7854){if(_0x5e7854){return _0x5e7854['destroy']()[_0xdeb2('0x28')](function(){_0x42143a[_0xdeb2('0x1c')](0xcc)[_0xdeb2('0x1d')]();});}};}function handleEntityNotFound(_0x5490d2,_0x37dce3){return function(_0x26d5b8){if(!_0x26d5b8){_0x5490d2['sendStatus'](0x194);}return _0x26d5b8;};}function handleError(_0x19e29d,_0x376c5f){_0x376c5f=_0x376c5f||0x1f4;return function(_0x6993ef){logger[_0xdeb2('0x29')](_0x6993ef['stack']);if(_0x6993ef[_0xdeb2('0x2a')]){delete _0x6993ef[_0xdeb2('0x2a')];}_0x19e29d[_0xdeb2('0x1c')](_0x376c5f)['send'](_0x6993ef);};}function getInteractionUsers(_0x2cdb7c,_0x58cd4e){return new BPromise(function(_0x326ec0,_0x558802){try{if(_0x58cd4e[_0x2cdb7c['id']]){_0x2cdb7c['Users']=_[_0xdeb2('0x2b')](_0x58cd4e[_0x2cdb7c['id']],function(_0x139083){return{'id':_0x139083['id'],'fullname':_0x139083[_0xdeb2('0x2c')]};});}}catch(_0x284b55){_0x558802(_0x284b55);}_0x326ec0(_0x2cdb7c);});}function getInteractionTags(_0x611ea3,_0x1c1832){return new BPromise(function(_0x2b5791,_0x442eee){try{if(_0x611ea3[_0xdeb2('0x2d')]){_0x611ea3['Tags']=[];_0x611ea3['TagIds'][_0xdeb2('0x2e')](',')[_0xdeb2('0x2f')](function(_0x1471ac){_0x611ea3[_0xdeb2('0x30')][_0xdeb2('0x31')](_0x1c1832[_0x1471ac]);});}delete _0x611ea3['TagIds'];}catch(_0x2b32b4){_0x442eee(_0x2b32b4);}_0x2b5791(_0x611ea3);});}function updateFaxInteraction(_0x30364b,_0x25ffc7,_0x3631ef){return new BPromise(function(_0x2ea201,_0x43a2db){return getInteractionUsers(_0x30364b,_0x3631ef)['then'](function(_0x12946b){return getInteractionTags(_0x12946b,_0x25ffc7);})[_0xdeb2('0x28')](function(_0x4f232e){return getStateInteraction(_0x4f232e);})[_0xdeb2('0x28')](function(_0x34d086){_0x2ea201(_0x34d086);})['catch'](function(_0x26c46b){_0x43a2db(_0x26c46b);});});}function getStateInteraction(_0x423d97){return new BPromise(function(_0x3a38a5){_0x423d97[_0xdeb2('0x32')]=0x0;_0x423d97[_0xdeb2('0x33')]=0x0;_0x423d97[_0xdeb2('0x34')]=0x0;_0x423d97[_0xdeb2('0x35')]=0x0;_0x423d97[_0xdeb2('0x36')]=0x0;if(!_0x423d97[_0xdeb2('0x37')]&&!_0x423d97[_0xdeb2('0x38')]){_0x423d97[_0xdeb2('0x32')]+=0x1;}if(!_0x423d97[_0xdeb2('0x37')]&&_0x423d97[_0xdeb2('0x38')]){_0x423d97[_0xdeb2('0x33')]+=0x1;if(_0x423d97[_0xdeb2('0x32')]){_0x423d97[_0xdeb2('0x32')]-=0x1;}}if(_0x423d97[_0xdeb2('0x37')]&&_0x423d97[_0xdeb2('0x38')]){_0x423d97[_0xdeb2('0x34')]+=0x1;if(_0x423d97[_0xdeb2('0x33')]){_0x423d97['talking']-=0x1;}}if(_0x423d97['closed']&&!_0x423d97[_0xdeb2('0x38')]){_0x423d97[_0xdeb2('0x35')]+=0x1;if(_0x423d97['waiting']){_0x423d97[_0xdeb2('0x32')]-=0x1;}}_0x423d97[_0xdeb2('0x36')]+=0x1;_0x3a38a5(_0x423d97);});}exports[_0xdeb2('0x39')]=function(_0x4bbc11,_0x4ab222){var _0x37da5a={},_0x2bb570={},_0x399d93={'count':0x0,'rows':[]};var _0x4f78ca=_[_0xdeb2('0x2b')](db[_0xdeb2('0x3a')][_0xdeb2('0x3b')],function(_0x14799f){return{'name':_0x14799f[_0xdeb2('0x3c')],'type':_0x14799f[_0xdeb2('0x3d')][_0xdeb2('0x3e')]};});_0x2bb570['model']=_[_0xdeb2('0x2b')](_0x4f78ca,'name');_0x2bb570[_0xdeb2('0x3f')]=_['keys'](_0x4bbc11['query']);_0x2bb570[_0xdeb2('0x40')]=_[_0xdeb2('0x41')](_0x2bb570['model'],_0x2bb570['query']);_0x37da5a[_0xdeb2('0x42')]=_['intersection'](_0x2bb570[_0xdeb2('0x43')],qs[_0xdeb2('0x44')](_0x4bbc11[_0xdeb2('0x3f')][_0xdeb2('0x44')]));_0x37da5a['attributes']=_0x37da5a[_0xdeb2('0x42')]['length']?_0x37da5a[_0xdeb2('0x42')]:_0x2bb570[_0xdeb2('0x43')];if(!_0x4bbc11[_0xdeb2('0x3f')]['hasOwnProperty']('nolimit')){_0x37da5a[_0xdeb2('0x21')]=qs[_0xdeb2('0x21')](_0x4bbc11[_0xdeb2('0x3f')][_0xdeb2('0x21')]);_0x37da5a[_0xdeb2('0x1f')]=qs[_0xdeb2('0x1f')](_0x4bbc11[_0xdeb2('0x3f')]['offset']);}_0x37da5a[_0xdeb2('0x45')]=qs[_0xdeb2('0x46')](_0x4bbc11['query'][_0xdeb2('0x46')]);_0x37da5a['where']=qs[_0xdeb2('0x40')](_['pick'](_0x4bbc11['query'],_0x2bb570[_0xdeb2('0x40')]),_0x4f78ca);var _0x1292c3=[];var _0xf5a369=squel[_0xdeb2('0x47')]()['field']('id')[_0xdeb2('0x48')](_0xdeb2('0x2a'))[_0xdeb2('0x48')]('color')[_0xdeb2('0x49')](_0xdeb2('0x4a'));var _0x448437=squel[_0xdeb2('0x47')]()[_0xdeb2('0x48')]('u.id')[_0xdeb2('0x48')]('u.fullname')[_0xdeb2('0x48')](_0xdeb2('0x4b'))['from'](_0xdeb2('0x4c'),'ui')['left_join'](_0xdeb2('0x4d'),'u','u.id\x20=\x20ui.UserId');var _0x5954bf=squel['select']()[_0xdeb2('0x49')](_0xdeb2('0x4e'),'i')['left_join']('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0xdeb2('0x4f'))[_0xdeb2('0x50')]('fax_accounts','a',_0xdeb2('0x51'))[_0xdeb2('0x50')](_0xdeb2('0x52'),'me',_0xdeb2('0x53'))[_0xdeb2('0x50')](_0xdeb2('0x54'),'it','it.FaxInteractionId\x20=\x20i.id')[_0xdeb2('0x50')]('tools_tags','t',_0xdeb2('0x55'));var _0x2294ba=squel[_0xdeb2('0x56')]();var _0x59d83c=[];var _0x344d83=squel['expr']();var _0x5d4f9c;if(_0x4bbc11['query'][_0xdeb2('0x57')]){_0x5d4f9c=as[_0xdeb2('0x58')](_0x4bbc11[_0xdeb2('0x3f')][_0xdeb2('0x57')]);var _0x58ee99=_0x5d4f9c['sqlOperator'];for(var _0x5975a8=0x0;_0x5975a8<_0x5d4f9c[_0xdeb2('0x59')]['length'];_0x5975a8++){var _0x5515ac=_0x5d4f9c['conditions'][_0x5975a8];var _0x4d5ef1='i';var _0x408e77=_['find'](_0x4f78ca,['name',_0x5515ac['field']]);if(!_0x408e77){switch(_0x5515ac[_0xdeb2('0x48')]){case _0xdeb2('0x5a'):if(_0x5515ac[_0xdeb2('0x5b')]==0x1){_0x5954bf[_0xdeb2('0x5c')]('`'+_0x5515ac[_0xdeb2('0x48')]+_0xdeb2('0x5d'));}else{_0x5954bf[_0xdeb2('0x5c')]('`'+_0x5515ac['field']+'`\x20>\x200');}break;case _0xdeb2('0x5e'):if(_0x5515ac['operator']===_0xdeb2('0x5f')){if(_0x5515ac['value'][_0xdeb2('0x2e')]('\x20')[_0xdeb2('0x60')]>0x1){_0x2294ba[_0x58ee99]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xdeb2('0x61')](_0x5515ac[_0xdeb2('0x5b')]),null);}else{var _0x21ef81='%'+_0x5515ac[_0xdeb2('0x5b')]+'%';_0x2294ba[_0x58ee99](_0xdeb2('0x62'),_0x21ef81,_0x21ef81,_0x21ef81);}}else{_0x408e77=_[_0xdeb2('0x63')](_0x4f78ca,[_0xdeb2('0x2a'),'ContactId']);_0x5515ac['field']=_0xdeb2('0x64');_0x130ab1=as[_0xdeb2('0x65')](_0x4d5ef1,_0x408e77[_0xdeb2('0x3d')],_0x5515ac);_0x2294ba[_0x58ee99](_0x130ab1['text'],_0x130ab1[_0xdeb2('0x5b')][_0xdeb2('0x66')],_0x130ab1['value'][_0xdeb2('0x1d')]);}break;case _0xdeb2('0x67'):var _0x3e1b5e=_0x5515ac[_0xdeb2('0x5b')][_0xdeb2('0x2e')](',')[_0xdeb2('0x2b')](function(_0x43783c){return Number(_0x43783c);});_0x3e1b5e[_0xdeb2('0x2f')](function(_0x533596){_0x344d83['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x533596+',%');});_0x59d83c=_[_0xdeb2('0x68')](_0x59d83c,_0x3e1b5e);break;case _0xdeb2('0x69'):if(_0x5515ac[_0xdeb2('0x6a')]===_0xdeb2('0x5f')){_0x2294ba[_0x58ee99]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x5515ac[_0xdeb2('0x5b')]+'%',null);}else{_0x408e77=_[_0xdeb2('0x63')](_0x4f78ca,['name',_0xdeb2('0x38')]);_0x5515ac[_0xdeb2('0x48')]=_0xdeb2('0x38');_0x130ab1=as[_0xdeb2('0x65')](_0x4d5ef1,_0x408e77[_0xdeb2('0x3d')],_0x5515ac);_0x2294ba[_0x58ee99](_0x130ab1['text'],_0x130ab1[_0xdeb2('0x5b')][_0xdeb2('0x66')],_0x130ab1[_0xdeb2('0x5b')][_0xdeb2('0x1d')]);}break;case _0xdeb2('0x6b'):_0x130ab1=as['buildExpression']('me',null,_0x5515ac);_0x2294ba[_0x58ee99](_0x130ab1['text'],_0x130ab1[_0xdeb2('0x5b')]['start'],_0x130ab1[_0xdeb2('0x5b')]['end']);break;}}else{var _0x130ab1=as['buildExpression'](_0x4d5ef1,_0x408e77['type'],_0x5515ac);_0x2294ba[_0x58ee99](_0x130ab1[_0xdeb2('0x6c')],_0x130ab1[_0xdeb2('0x5b')][_0xdeb2('0x66')],_0x130ab1[_0xdeb2('0x5b')][_0xdeb2('0x1d')]);}}}else{var _0x2a0a11=_(_0x4bbc11[_0xdeb2('0x3f')])[_0xdeb2('0x6d')]()['map'](function(_0x43d39b){return _[_0xdeb2('0x6e')](_0x4f78ca,[_0xdeb2('0x2a'),_0x43d39b])?_0x43d39b:undefined;})[_0xdeb2('0x6f')]()[_0xdeb2('0x5b')]();if(!_[_0xdeb2('0x70')](_0x2a0a11)){_0x2a0a11[_0xdeb2('0x2f')](function(_0x209c13){if(_0x209c13===_0xdeb2('0x71')){_0x5954bf[_0xdeb2('0x72')](_0xdeb2('0x73'),[]['concat'](_0x4bbc11['query'][_0x209c13]));}else if(_0x209c13===_0xdeb2('0x74')){var _0x219d86=JSON[_0xdeb2('0x75')](_0x4bbc11[_0xdeb2('0x3f')][_0x209c13])[_0xdeb2('0x76')];var _0x20c82d=JSON[_0xdeb2('0x75')](_0x4bbc11[_0xdeb2('0x3f')][_0x209c13])[_0xdeb2('0x77')];_0x5954bf['where'](_0xdeb2('0x78'),_0x219d86,_0x20c82d);}else{if(_0x4bbc11[_0xdeb2('0x3f')][_0x209c13]===_0xdeb2('0x79')){_0x5954bf['where']('i.'+_0x209c13+_0xdeb2('0x7a'));}else{_0x5954bf[_0xdeb2('0x72')]('i.'+_0x209c13+_0xdeb2('0x7b'),_0x4bbc11['query'][_0x209c13]);}}});}if(_0x4bbc11['query']['read']){if(_0x4bbc11[_0xdeb2('0x3f')][_0xdeb2('0x7c')]==0x1){_0x5954bf[_0xdeb2('0x5c')](_0xdeb2('0x7d'));}else{_0x5954bf['having']('`unreadMessages`\x20>\x200');}}if(_0x4bbc11[_0xdeb2('0x3f')][_0xdeb2('0x7e')]){_0x59d83c=_['isArray'](_0x4bbc11[_0xdeb2('0x3f')][_0xdeb2('0x7e')])?_0x4bbc11[_0xdeb2('0x3f')][_0xdeb2('0x7e')]:new Array(_0x4bbc11[_0xdeb2('0x3f')]['tag']);_0x59d83c[_0xdeb2('0x2f')](function(_0x498f51){_0x344d83['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x498f51+',%');});}if(_0x4bbc11[_0xdeb2('0x3f')][_0xdeb2('0x7f')]){var _0x42afe3=_0x4bbc11[_0xdeb2('0x3f')][_0xdeb2('0x7f')]['replace']('\x5c','\x5c\x5c')[_0xdeb2('0x80')](/'/g,'\x27\x27');if(qs[_0xdeb2('0x81')](_0x42afe3)){_0x2294ba['or'](_0xdeb2('0x82'),_0x42afe3+'%')['or'](_0xdeb2('0x83'),_0x42afe3+'%');}_0x2294ba['or'](_0xdeb2('0x84'),_0x42afe3+'%');}}_0x5954bf[_0xdeb2('0x72')](_0x2294ba);_0x5954bf[_0xdeb2('0x85')](_0xdeb2('0x86'));var _0x11f811={'type':db[_0xdeb2('0x87')]['QueryTypes'][_0xdeb2('0x88')],'raw':!![]};var _0x4902e1=_0x5954bf[_0xdeb2('0x89')]();_0x4902e1[_0xdeb2('0x48')](_0xdeb2('0x86'));_0x4902e1[_0xdeb2('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x37da5a[_0xdeb2('0x45')]){_0x37da5a['order'][_0xdeb2('0x2f')](function(_0x2412eb){var _0x326558=_0x2412eb[0x0]==='contactName'?_0x2412eb[0x0]:'i.'+_0x2412eb[0x0];_0x5954bf[_0xdeb2('0x45')](_0x326558,_0x2412eb[0x1]===_0xdeb2('0x8a')?![]:!![]);});}if(!_[_0xdeb2('0x70')](_0x59d83c)){_0x5954bf[_0xdeb2('0x5c')](_0x344d83);_0x4902e1[_0xdeb2('0x72')](_0xdeb2('0x8b'),_0x59d83c);}BPromise[_0xdeb2('0x8c')]()['then'](function(){if(!_0x5d4f9c){if(_0x4bbc11[_0xdeb2('0x3f')][_0xdeb2('0x71')])return;_0x4902e1[_0xdeb2('0x72')](_0xdeb2('0x8d'));_0x5954bf[_0xdeb2('0x72')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x4bbc11[_0xdeb2('0x8e')][_0xdeb2('0x8f')]!==_0xdeb2('0x90'))return;return _0x4bbc11[_0xdeb2('0x8e')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0xdeb2('0x28')](function(_0x32c5a3){if(_[_0xdeb2('0x70')](_0x32c5a3)){_0x4902e1[_0xdeb2('0x72')](_0xdeb2('0x91'));_0x5954bf[_0xdeb2('0x72')](_0xdeb2('0x91'));}else{_0x4902e1[_0xdeb2('0x72')]('i.FaxAccountId\x20IN\x20?',_['map'](_0x32c5a3,'id'));_0x5954bf[_0xdeb2('0x72')](_0xdeb2('0x73'),_[_0xdeb2('0x2b')](_0x32c5a3,'id'));}});})['then'](function(){if(_0x4bbc11[_0xdeb2('0x8e')][_0xdeb2('0x8f')]===_0xdeb2('0x90')&&!_0x5d4f9c&&!_0x4bbc11[_0xdeb2('0x3f')][_0xdeb2('0x71')])return[];return db[_0xdeb2('0x92')]['query'](_0x4902e1[_0xdeb2('0x93')](),_0x11f811);})[_0xdeb2('0x28')](function(_0x505e78){_0x399d93['count']=_0x505e78[_0xdeb2('0x60')];if(_0x399d93['count']===0x0)return[];return db[_0xdeb2('0x92')][_0xdeb2('0x3f')](_0xf5a369[_0xdeb2('0x93')](),_0x11f811)[_0xdeb2('0x28')](function(_0x1e4fbd){_0x1292c3=_[_0xdeb2('0x94')](_0x1e4fbd,'id');_0x11f811=_[_0xdeb2('0x95')](_0x11f811,{'model':db[_0xdeb2('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4bbc11['query'][_0xdeb2('0x44')]){_0x37da5a['attributes'][_0xdeb2('0x2f')](function(_0x52c3cb){_0x5954bf[_0xdeb2('0x48')]('i.'+_0x52c3cb);});}else{_0x5954bf['field'](_0xdeb2('0x96'),'unreadMessages');_0x5954bf['field'](_0xdeb2('0x97'),_0xdeb2('0x98'));_0x5954bf[_0xdeb2('0x48')]('a.mandatoryDisposition',_0xdeb2('0x99'));_0x5954bf[_0xdeb2('0x48')](_0xdeb2('0x9a'),_0xdeb2('0x9b'));_0x5954bf[_0xdeb2('0x48')](_0xdeb2('0x9c'));_0x5954bf['field'](_0xdeb2('0x9d'),_0xdeb2('0x9e'));_0x5954bf[_0xdeb2('0x48')](_0xdeb2('0x9f'),'Contact.lastName');_0x5954bf[_0xdeb2('0x48')](_0xdeb2('0xa0'),_0xdeb2('0xa1'));_0x5954bf[_0xdeb2('0x48')]('c.phone',_0xdeb2('0xa2'));_0x5954bf[_0xdeb2('0x48')](_0xdeb2('0xa3'),_0xdeb2('0xa4'));_0x5954bf['field'](_0xdeb2('0xa5'),_0xdeb2('0xa6'));_0x5954bf[_0xdeb2('0x48')]('o.fullname',_0xdeb2('0xa7'));_0x5954bf['field'](_0xdeb2('0xa8'),_0xdeb2('0xa9'));_0x5954bf['field'](_0xdeb2('0xaa'),_0xdeb2('0x2d'));}if(_0x37da5a[_0xdeb2('0x21')])_0x5954bf[_0xdeb2('0x21')](_0x37da5a['limit']);if(_0x37da5a[_0xdeb2('0x1f')])_0x5954bf[_0xdeb2('0x1f')](_0x37da5a[_0xdeb2('0x1f')]);return db[_0xdeb2('0x92')][_0xdeb2('0x3f')](_0x5954bf[_0xdeb2('0x93')](),_0x11f811);})[_0xdeb2('0x28')](function(_0x482dc1){if(_0x482dc1['length']>0x0)_0x448437[_0xdeb2('0x72')](_0xdeb2('0xab'),_['map'](_0x482dc1,'id'));return db['sequelize'][_0xdeb2('0x3f')](_0x448437['toString'](),_0x11f811)['then'](function(_0x3e46c6){var _0xc98ca0=_['groupBy'](_0x3e46c6,_0xdeb2('0xac'));var _0x13af43=[];_0x482dc1['forEach'](function(_0x542bef){_0x13af43[_0xdeb2('0x31')](updateFaxInteraction(_0x542bef,_0x1292c3,_0xc98ca0));});return BPromise['all'](_0x13af43);});});})[_0xdeb2('0x28')](function(_0x48edf1){_0x399d93[_0xdeb2('0xad')]=_0x48edf1;return _0x399d93;})[_0xdeb2('0x28')](respondWithFilteredResult(_0x4ab222,_0x37da5a))[_0xdeb2('0xae')](handleError(_0x4ab222,null));};exports['show']=function(_0x44ed4d,_0x34d098){var _0x184cfc={'raw':![],'where':{'id':_0x44ed4d[_0xdeb2('0xaf')]['id']}},_0xdeb7f2={};_0xdeb7f2[_0xdeb2('0x43')]=_['keys'](db[_0xdeb2('0x3a')][_0xdeb2('0x3b')]);_0xdeb7f2['query']=_[_0xdeb2('0x6d')](_0x44ed4d[_0xdeb2('0x3f')]);_0xdeb7f2[_0xdeb2('0x40')]=_[_0xdeb2('0x41')](_0xdeb7f2[_0xdeb2('0x43')],_0xdeb7f2['query']);_0x184cfc[_0xdeb2('0x42')]=_[_0xdeb2('0x41')](_0xdeb7f2[_0xdeb2('0x43')],qs[_0xdeb2('0x44')](_0x44ed4d[_0xdeb2('0x3f')][_0xdeb2('0x44')]));_0x184cfc[_0xdeb2('0x42')]=_0x184cfc['attributes'][_0xdeb2('0x60')]?_0x184cfc[_0xdeb2('0x42')]:_0xdeb7f2[_0xdeb2('0x43')];if(_0x44ed4d[_0xdeb2('0x3f')][_0xdeb2('0xb0')]){_0x184cfc[_0xdeb2('0xb1')]=[{'all':!![]}];}_0x184cfc=_['merge']({},_0x184cfc,_0x44ed4d[_0xdeb2('0xb2')]);return db[_0xdeb2('0x3a')][_0xdeb2('0x63')](_0x184cfc)['then'](handleEntityNotFound(_0x34d098,null))[_0xdeb2('0x28')](respondWithResult(_0x34d098,null))[_0xdeb2('0xae')](handleError(_0x34d098,null));};exports['create']=function(_0x10bb29,_0x4a9fb7){return db['FaxInteraction']['create'](_0x10bb29[_0xdeb2('0x6b')],{})[_0xdeb2('0x28')](respondWithResult(_0x4a9fb7,0xc9))[_0xdeb2('0xae')](handleError(_0x4a9fb7,null));};exports['update']=function(_0x5723d4,_0x41d7e7){if(_0x5723d4['body']['id']){delete _0x5723d4[_0xdeb2('0x6b')]['id'];}return db[_0xdeb2('0x3a')][_0xdeb2('0x63')]({'where':{'id':_0x5723d4[_0xdeb2('0xaf')]['id']}})[_0xdeb2('0x28')](handleEntityNotFound(_0x41d7e7,null))[_0xdeb2('0x28')](saveUpdates(_0x5723d4[_0xdeb2('0x6b')],null))['then'](respondWithResult(_0x41d7e7,null))['catch'](handleError(_0x41d7e7,null));};exports[_0xdeb2('0xb3')]=function(_0x4a7ede,_0x1754b3){return db['FaxInteraction'][_0xdeb2('0x63')]({'where':{'id':_0x4a7ede[_0xdeb2('0xaf')]['id']}})[_0xdeb2('0x28')](handleEntityNotFound(_0x1754b3,null))[_0xdeb2('0x28')](removeEntity(_0x1754b3,null))['catch'](handleError(_0x1754b3,null));};exports[_0xdeb2('0xb4')]=function(_0x1bb0c5,_0x18cca7){return db[_0xdeb2('0x3a')][_0xdeb2('0xb4')]()['then'](respondWithResult(_0x18cca7,null))[_0xdeb2('0xae')](handleError(_0x18cca7,null));};exports[_0xdeb2('0xb5')]=function(_0x40dba9,_0x6bac15,_0x50ae6f){return db[_0xdeb2('0xb6')][_0xdeb2('0x63')]({'where':{'id':_0x40dba9[_0xdeb2('0xaf')]['id']}})['then'](handleEntityNotFound(_0x6bac15,null))[_0xdeb2('0x28')](function(_0x45db37){if(_0x45db37){return _0x45db37['addMessage'](_0x40dba9['body'][_0xdeb2('0xb7')],_[_0xdeb2('0xb8')](_0x40dba9[_0xdeb2('0x6b')],[_0xdeb2('0xb7'),'id'])||{});}})[_0xdeb2('0x28')](respondWithResult(_0x6bac15,null))[_0xdeb2('0xae')](handleError(_0x6bac15,null));};exports[_0xdeb2('0xb9')]=function(_0x499be4,_0x5bfcb3,_0x1daa61){var _0x56fe5a={'raw':![],'where':{}};var _0x53f962={};var _0x11dcbd={'count':0x0,'rows':[]};return db[_0xdeb2('0x3a')][_0xdeb2('0xba')]({'where':{'id':_0x499be4[_0xdeb2('0xaf')]['id']}})['then'](handleEntityNotFound(_0x5bfcb3,null))[_0xdeb2('0x28')](function(_0x4592a6){if(_0x4592a6){_0x53f962[_0xdeb2('0x43')]=_[_0xdeb2('0x6d')](db[_0xdeb2('0xb6')][_0xdeb2('0x3b')]);_0x53f962['query']=_[_0xdeb2('0x6d')](_0x499be4['query']);_0x53f962['filters']=_[_0xdeb2('0x41')](_0x53f962[_0xdeb2('0x43')],_0x53f962[_0xdeb2('0x3f')]);_0x56fe5a['attributes']=_['intersection'](_0x53f962['model'],qs[_0xdeb2('0x44')](_0x499be4[_0xdeb2('0x3f')]['fields']));_0x56fe5a[_0xdeb2('0x42')]=_0x56fe5a[_0xdeb2('0x42')][_0xdeb2('0x60')]?_0x56fe5a[_0xdeb2('0x42')]:_0x53f962[_0xdeb2('0x43')];if(!_0x499be4['query'][_0xdeb2('0xbb')]('nolimit')){_0x56fe5a[_0xdeb2('0x21')]=qs[_0xdeb2('0x21')](_0x499be4[_0xdeb2('0x3f')][_0xdeb2('0x21')]);_0x56fe5a[_0xdeb2('0x1f')]=qs['offset'](_0x499be4[_0xdeb2('0x3f')][_0xdeb2('0x1f')]);}_0x56fe5a[_0xdeb2('0x45')]=qs[_0xdeb2('0x46')](_0x499be4[_0xdeb2('0x3f')][_0xdeb2('0x46')]);_0x56fe5a[_0xdeb2('0x72')]=qs['filters'](_[_0xdeb2('0xbc')](_0x499be4[_0xdeb2('0x3f')],_0x53f962['filters']));_0x56fe5a[_0xdeb2('0x72')][_0xdeb2('0xac')]=_0x4592a6['id'];if(_0x499be4['query'][_0xdeb2('0x7f')]){_0x56fe5a[_0xdeb2('0x72')]=_[_0xdeb2('0x95')](_0x56fe5a[_0xdeb2('0x72')],{'$or':_['map'](_0x56fe5a[_0xdeb2('0x42')],function(_0x2c02eb){var _0x4e9c78={};_0x4e9c78[_0x2c02eb]={'$like':'%'+_0x499be4[_0xdeb2('0x3f')][_0xdeb2('0x7f')]+'%'};return _0x4e9c78;})});}if(_0x499be4[_0xdeb2('0x3f')][_0xdeb2('0x76')]){var _0x4c9313=_0x499be4[_0xdeb2('0x3f')][_0xdeb2('0x76')][_0xdeb2('0x2e')](',');var _0x5b11af={};_0x5b11af[_0x4c9313[0x0]]={'$gte':moment(_0x4c9313[0x1])['format'](_0xdeb2('0xbd'))};_0x56fe5a['where']=_[_0xdeb2('0x95')](_0x56fe5a[_0xdeb2('0x72')],_0x5b11af);}_0x56fe5a=_[_0xdeb2('0x95')]({},_0x56fe5a,_0x499be4[_0xdeb2('0xb2')]);return db[_0xdeb2('0xb6')][_0xdeb2('0x22')]({'where':_0x56fe5a[_0xdeb2('0x72')]})[_0xdeb2('0x28')](function(_0x4d1f88){_0x11dcbd[_0xdeb2('0x22')]=_0x4d1f88;if(_0x499be4[_0xdeb2('0x3f')][_0xdeb2('0xb0')]){_0x56fe5a[_0xdeb2('0xb1')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x56fe5a);})[_0xdeb2('0x28')](function(_0x390433){_0x11dcbd[_0xdeb2('0xad')]=_0x390433;return _0x11dcbd;});}})['then'](respondWithFilteredResult(_0x5bfcb3,_0x56fe5a))[_0xdeb2('0xae')](handleError(_0x5bfcb3,null));};exports['addTags']=function(_0x1a2364,_0x3c70be,_0x53325a){return db[_0xdeb2('0x3a')][_0xdeb2('0x63')]({'where':{'id':_0x1a2364[_0xdeb2('0xaf')]['id']}})['then'](handleEntityNotFound(_0x3c70be,null))[_0xdeb2('0x28')](function(_0x4f78e5){if(_0x4f78e5){return _0x4f78e5[_0xdeb2('0xbe')](_0x1a2364[_0xdeb2('0x6b')]['ids'],_[_0xdeb2('0xb8')](_0x1a2364[_0xdeb2('0x6b')],[_0xdeb2('0xb7'),'id'])||{})['spread'](function(){return db[_0xdeb2('0x67')]['findAll']({'attributes':['id',_0xdeb2('0x2a'),_0xdeb2('0xbf')],'where':{'id':_0x1a2364['body'][_0xdeb2('0xb7')]}});})[_0xdeb2('0x28')](function(_0x35379d){socket[_0xdeb2('0xc0')](_0xdeb2('0xc1'),{'id':Number(_0x1a2364['params']['id']),'tags':_0x35379d||[]});return{'id':Number(_0x1a2364[_0xdeb2('0xaf')]['id']),'tags':_0x35379d||[]};});}})[_0xdeb2('0x28')](respondWithResult(_0x3c70be,null))[_0xdeb2('0xae')](handleError(_0x3c70be,null));};exports[_0xdeb2('0xc2')]=function(_0x58b477,_0x246e17,_0x3f2c71){return db['FaxInteraction'][_0xdeb2('0x63')]({'where':{'id':_0x58b477['params']['id']}})[_0xdeb2('0x28')](handleEntityNotFound(_0x246e17,null))[_0xdeb2('0x28')](function(_0x3a338f){if(_0x3a338f){return _0x3a338f[_0xdeb2('0xc2')](_0x58b477['query'][_0xdeb2('0xb7')]);}})[_0xdeb2('0x28')](respondWithStatusCode(_0x246e17,null))[_0xdeb2('0xae')](handleError(_0x246e17,null));};exports[_0xdeb2('0xc3')]=function(_0x1e729a,_0x51a6a6){var _0x295ec7=moment()[_0xdeb2('0xc4')]()[_0xdeb2('0x93')]();var _0x2b6a7c=path[_0xdeb2('0xc5')](config[_0xdeb2('0xc6')],_0xdeb2('0xc7'),_0xdeb2('0xc8'),_0xdeb2('0xc9'));var _0x2792f2=path[_0xdeb2('0xc5')](config['root'],_0xdeb2('0xc7'),'files','attachments');var _0x3629cd=path[_0xdeb2('0xc5')](_0x2b6a7c,_0x295ec7);var _0xef1233=util[_0xdeb2('0xca')](_0xdeb2('0xcb'),_0x1e729a['params']['id'],_0x295ec7);var _0xc11ca0=path[_0xdeb2('0xc5')](_0x2b6a7c,_0xef1233);var _0x2d19ec=[];_0x2d19ec[_0xdeb2('0x31')]({'model':db[_0xdeb2('0xcc')],'as':_0xdeb2('0xcc'),'raw':!![]});var _0x5273bd=[{'model':db[_0xdeb2('0xb6')],'as':_0xdeb2('0xcd'),'attributes':['id',_0xdeb2('0x6b'),'createdAt'],'include':_0x2d19ec}];return db[_0xdeb2('0x3a')]['find']({'where':{'id':_0x1e729a[_0xdeb2('0xaf')]['id']},'include':_0x5273bd})[_0xdeb2('0x28')](handleEntityNotFound(_0x51a6a6,null))['then'](function(_0x5318ce){if(_0x5318ce&&_0x5318ce[_0xdeb2('0xcd')]){var _0x2ce009=_0x5318ce['get']({'plain':!![]});fs['mkdirSync'](_0x3629cd);for(var _0x3ef48b=0x0;_0x3ef48b<_0x2ce009[_0xdeb2('0xcd')][_0xdeb2('0x60')];_0x3ef48b++){var _0x63571a=_0x2ce009[_0xdeb2('0xcd')][_0x3ef48b][_0xdeb2('0xcc')];if(_0x63571a){var _0x31133d=path[_0xdeb2('0xc5')](_0x2792f2,_0x63571a[_0xdeb2('0xce')]);if(fs[_0xdeb2('0xcf')](_0x31133d)){fs[_0xdeb2('0xd0')](_0x31133d)['pipe'](fs['createWriteStream'](path[_0xdeb2('0xc5')](_0x3629cd,_0x63571a[_0xdeb2('0xce')])));}}}return BPromise[_0xdeb2('0x8c')]()[_0xdeb2('0x28')](function(){return new BPromise(function(_0xf54af1,_0x4309d9){zipdir(_0x3629cd,{'saveTo':_0xc11ca0},function(_0x3d29eb,_0x293646){if(_0x3d29eb)return _0x4309d9(_0x3d29eb);return _0xf54af1(_0x293646);});})[_0xdeb2('0x28')](function(){return new BPromise(function(_0xe292a5,_0x2b0ac5){rimraf(_0x3629cd,function(_0x50821b){if(_0x50821b)_0x2b0ac5(_0x50821b);return _0xe292a5();});});})[_0xdeb2('0x28')](function(){return _0x51a6a6[_0xdeb2('0xc3')](_0xc11ca0,_0xef1233,function(_0x283447){if(_0x283447){console[_0xdeb2('0xd1')](_0xdeb2('0xd2'),_0x283447);}else{fs[_0xdeb2('0xd3')](_0xc11ca0);}});});});}else{return _0x51a6a6[_0xdeb2('0x1b')](0xc8);}})[_0xdeb2('0xae')](handleError(_0x51a6a6,null));}; \ No newline at end of file +var _0xf7e2=['getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','body','some','compact','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','$gte','parse','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','i.id','clone','contactName','DESC','isEmpty','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','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','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','Owner.internal','groupBy','FaxInteractionId','rows','show','params','includeAll','include','options','create','describe','addMessage','FaxMessage','ids','omit','getMessages','format','findAll','spread','emit','removeTags','download','unix','join','root','server','files','tmp','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','basename','pipe','createWriteStream','log','err','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','Users','map','fullname','TagIds','Tags','forEach','catch','waiting','talking','answered','total','UserId','closed','unmanaged','index','FaxInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','select','field','color','tools_tags','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','from','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','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)'];(function(_0x260f28,_0x4e9b30){var _0x3aefcc=function(_0x223b18){while(--_0x223b18){_0x260f28['push'](_0x260f28['shift']());}};_0x3aefcc(++_0x4e9b30);}(_0xf7e2,0x138));var _0x2f7e=function(_0x5aaf20,_0x38dc01){_0x5aaf20=_0x5aaf20-0x0;var _0x5a8c39=_0xf7e2[_0x5aaf20];return _0x5a8c39;};'use strict';var emlformat=require(_0x2f7e('0x0'));var rimraf=require(_0x2f7e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2f7e('0x2'));var rp=require(_0x2f7e('0x3'));var moment=require(_0x2f7e('0x4'));var BPromise=require(_0x2f7e('0x5'));var Mustache=require(_0x2f7e('0x6'));var util=require('util');var path=require(_0x2f7e('0x7'));var sox=require(_0x2f7e('0x8'));var csv=require('to-csv');var ejs=require(_0x2f7e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f7e('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2f7e('0xb'));var deskjs=require(_0x2f7e('0xc'));var toCsv=require(_0x2f7e('0xd'));var querystring=require(_0x2f7e('0xe'));var Papa=require(_0x2f7e('0xf'));var Redis=require('ioredis');var authService=require(_0x2f7e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2f7e('0x11'));var hardwareService=require(_0x2f7e('0x12'));var logger=require(_0x2f7e('0x13'))(_0x2f7e('0x14'));var utils=require('../../config/utils');var config=require(_0x2f7e('0x15'));var licenseUtil=require(_0x2f7e('0x16'));var db=require('../../mysqldb')['db'];config[_0x2f7e('0x17')]=_[_0x2f7e('0x18')](config[_0x2f7e('0x17')],{'host':_0x2f7e('0x19'),'port':0x18eb});var socket=require(_0x2f7e('0x1a'))(new Redis(config[_0x2f7e('0x17')]));require('./faxInteraction.socket')[_0x2f7e('0x1b')](socket);function respondWithStatusCode(_0x2461d6,_0x325cbb){_0x325cbb=_0x325cbb||0xcc;return function(_0x20b8f0){if(_0x20b8f0){return _0x2461d6[_0x2f7e('0x1c')](_0x325cbb);}return _0x2461d6[_0x2f7e('0x1d')](_0x325cbb)[_0x2f7e('0x1e')]();};}function respondWithResult(_0x2a6d0d,_0x5ea368){_0x5ea368=_0x5ea368||0xc8;return function(_0x589ba4){if(_0x589ba4){return _0x2a6d0d[_0x2f7e('0x1d')](_0x5ea368)[_0x2f7e('0x1f')](_0x589ba4);}};}function respondWithFilteredResult(_0xc47012,_0x58a17c){return function(_0x3bd6eb){if(_0x3bd6eb){var _0x48aecf=typeof _0x58a17c[_0x2f7e('0x20')]==='undefined'&&typeof _0x58a17c[_0x2f7e('0x21')]==='undefined';var _0x3c78b4=_0x3bd6eb['count'];var _0x2334ae=_0x48aecf?0x0:_0x58a17c[_0x2f7e('0x20')];var _0xf0e362=_0x48aecf?_0x3bd6eb[_0x2f7e('0x22')]:_0x58a17c[_0x2f7e('0x20')]+_0x58a17c[_0x2f7e('0x21')];var _0xf35e10;if(_0xf0e362>=_0x3c78b4){_0xf0e362=_0x3c78b4;_0xf35e10=0xc8;}else{_0xf35e10=0xce;}_0xc47012[_0x2f7e('0x1d')](_0xf35e10);return _0xc47012[_0x2f7e('0x23')](_0x2f7e('0x24'),_0x2334ae+'-'+_0xf0e362+'/'+_0x3c78b4)['json'](_0x3bd6eb);}return null;};}function patchUpdates(_0x517897){return function(_0x3e95ab){try{jsonpatch['apply'](_0x3e95ab,_0x517897,!![]);}catch(_0x3da72e){return BPromise[_0x2f7e('0x25')](_0x3da72e);}return _0x3e95ab[_0x2f7e('0x26')]();};}function saveUpdates(_0xfeae27,_0x598343){return function(_0x1d7e8f){if(_0x1d7e8f){return _0x1d7e8f[_0x2f7e('0x27')](_0xfeae27)[_0x2f7e('0x28')](function(_0x3b5541){return _0x3b5541;});}return null;};}function removeEntity(_0x495b17,_0x3aabee){return function(_0x1bc1c1){if(_0x1bc1c1){return _0x1bc1c1[_0x2f7e('0x29')]()[_0x2f7e('0x28')](function(){_0x495b17[_0x2f7e('0x1d')](0xcc)[_0x2f7e('0x1e')]();});}};}function handleEntityNotFound(_0x4c772e,_0x44b2cc){return function(_0x22108e){if(!_0x22108e){_0x4c772e[_0x2f7e('0x1c')](0x194);}return _0x22108e;};}function handleError(_0x281014,_0x16904f){_0x16904f=_0x16904f||0x1f4;return function(_0x4e743f){logger[_0x2f7e('0x2a')](_0x4e743f[_0x2f7e('0x2b')]);if(_0x4e743f[_0x2f7e('0x2c')]){delete _0x4e743f['name'];}_0x281014[_0x2f7e('0x1d')](_0x16904f)['send'](_0x4e743f);};}function getInteractionUsers(_0x161875,_0x3a1081){return new BPromise(function(_0x2f98f4,_0x57d8f4){try{if(_0x3a1081[_0x161875['id']]){_0x161875[_0x2f7e('0x2d')]=_[_0x2f7e('0x2e')](_0x3a1081[_0x161875['id']],function(_0xc9b339){return{'id':_0xc9b339['id'],'fullname':_0xc9b339[_0x2f7e('0x2f')]};});}}catch(_0xbdb735){_0x57d8f4(_0xbdb735);}_0x2f98f4(_0x161875);});}function getInteractionTags(_0x4af804,_0x34e539){return new BPromise(function(_0x5941d3,_0x488a66){try{if(_0x4af804[_0x2f7e('0x30')]){_0x4af804[_0x2f7e('0x31')]=[];_0x4af804[_0x2f7e('0x30')]['split'](',')[_0x2f7e('0x32')](function(_0x48af88){_0x4af804[_0x2f7e('0x31')]['push'](_0x34e539[_0x48af88]);});}delete _0x4af804[_0x2f7e('0x30')];}catch(_0x14a8e9){_0x488a66(_0x14a8e9);}_0x5941d3(_0x4af804);});}function updateFaxInteraction(_0x3ff343,_0x51dac6,_0x4a2a13){return new BPromise(function(_0x596371,_0x3832cb){return getInteractionUsers(_0x3ff343,_0x4a2a13)[_0x2f7e('0x28')](function(_0x518e85){return getInteractionTags(_0x518e85,_0x51dac6);})[_0x2f7e('0x28')](function(_0x386902){return getStateInteraction(_0x386902);})[_0x2f7e('0x28')](function(_0x239b12){_0x596371(_0x239b12);})[_0x2f7e('0x33')](function(_0x3dc71c){_0x3832cb(_0x3dc71c);});});}function getStateInteraction(_0x2ad5ee){return new BPromise(function(_0x1e0333){_0x2ad5ee[_0x2f7e('0x34')]=0x0;_0x2ad5ee[_0x2f7e('0x35')]=0x0;_0x2ad5ee[_0x2f7e('0x36')]=0x0;_0x2ad5ee['unmanaged']=0x0;_0x2ad5ee[_0x2f7e('0x37')]=0x0;if(!_0x2ad5ee['closed']&&!_0x2ad5ee[_0x2f7e('0x38')]){_0x2ad5ee['waiting']+=0x1;}if(!_0x2ad5ee[_0x2f7e('0x39')]&&_0x2ad5ee['UserId']){_0x2ad5ee['talking']+=0x1;if(_0x2ad5ee['waiting']){_0x2ad5ee['waiting']-=0x1;}}if(_0x2ad5ee[_0x2f7e('0x39')]&&_0x2ad5ee[_0x2f7e('0x38')]){_0x2ad5ee[_0x2f7e('0x36')]+=0x1;if(_0x2ad5ee[_0x2f7e('0x35')]){_0x2ad5ee['talking']-=0x1;}}if(_0x2ad5ee[_0x2f7e('0x39')]&&!_0x2ad5ee[_0x2f7e('0x38')]){_0x2ad5ee[_0x2f7e('0x3a')]+=0x1;if(_0x2ad5ee['waiting']){_0x2ad5ee['waiting']-=0x1;}}_0x2ad5ee[_0x2f7e('0x37')]+=0x1;_0x1e0333(_0x2ad5ee);});}exports[_0x2f7e('0x3b')]=function(_0x2c4541,_0x3e55de){var _0x219625={},_0x57f05c={},_0x31087f={'count':0x0,'rows':[]};var _0x220170=_[_0x2f7e('0x2e')](db[_0x2f7e('0x3c')][_0x2f7e('0x3d')],function(_0x2d7e50){return{'name':_0x2d7e50[_0x2f7e('0x3e')],'type':_0x2d7e50[_0x2f7e('0x3f')][_0x2f7e('0x40')]};});_0x57f05c[_0x2f7e('0x41')]=_[_0x2f7e('0x2e')](_0x220170,_0x2f7e('0x2c'));_0x57f05c[_0x2f7e('0x42')]=_[_0x2f7e('0x43')](_0x2c4541['query']);_0x57f05c['filters']=_[_0x2f7e('0x44')](_0x57f05c[_0x2f7e('0x41')],_0x57f05c['query']);_0x219625[_0x2f7e('0x45')]=_[_0x2f7e('0x44')](_0x57f05c[_0x2f7e('0x41')],qs['fields'](_0x2c4541[_0x2f7e('0x42')][_0x2f7e('0x46')]));_0x219625['attributes']=_0x219625[_0x2f7e('0x45')][_0x2f7e('0x47')]?_0x219625[_0x2f7e('0x45')]:_0x57f05c[_0x2f7e('0x41')];if(!_0x2c4541['query'][_0x2f7e('0x48')](_0x2f7e('0x49'))){_0x219625[_0x2f7e('0x21')]=qs['limit'](_0x2c4541['query'][_0x2f7e('0x21')]);_0x219625[_0x2f7e('0x20')]=qs[_0x2f7e('0x20')](_0x2c4541['query'][_0x2f7e('0x20')]);}_0x219625[_0x2f7e('0x4a')]=qs[_0x2f7e('0x4b')](_0x2c4541['query'][_0x2f7e('0x4b')]);_0x219625[_0x2f7e('0x4c')]=qs['filters'](_[_0x2f7e('0x4d')](_0x2c4541[_0x2f7e('0x42')],_0x57f05c[_0x2f7e('0x4e')]),_0x220170);var _0x2c070d=[];var _0x3b3030=squel[_0x2f7e('0x4f')]()['field']('id')[_0x2f7e('0x50')]('name')['field'](_0x2f7e('0x51'))['from'](_0x2f7e('0x52'));var _0xf28b47=squel[_0x2f7e('0x4f')]()['field']('u.id')['field'](_0x2f7e('0x53'))['field'](_0x2f7e('0x54'))['from'](_0x2f7e('0x55'),'ui')[_0x2f7e('0x56')](_0x2f7e('0x57'),'u',_0x2f7e('0x58'));var _0x926522=squel[_0x2f7e('0x4f')]()[_0x2f7e('0x59')]('fax_interactions','i')[_0x2f7e('0x56')](_0x2f7e('0x5a'),'c',_0x2f7e('0x5b'))['left_join'](_0x2f7e('0x57'),'o',_0x2f7e('0x5c'))[_0x2f7e('0x56')](_0x2f7e('0x5d'),'a',_0x2f7e('0x5e'))['left_join']('fax_messages','me','me.FaxInteractionId\x20=\x20i.id')['left_join']('fax_interaction_has_tags','it',_0x2f7e('0x5f'))[_0x2f7e('0x56')](_0x2f7e('0x52'),'t',_0x2f7e('0x60'));var _0x348e3b=squel[_0x2f7e('0x61')]();var _0x1e60c6=[];var _0xbe035d=squel['expr']();var _0x132801;if(_0x2c4541[_0x2f7e('0x42')][_0x2f7e('0x62')]){_0x132801=as[_0x2f7e('0x63')](_0x2c4541['query']['search']);var _0x1dc49f=_0x132801['sqlOperator'];for(var _0x1d950f=0x0;_0x1d950f<_0x132801[_0x2f7e('0x64')][_0x2f7e('0x47')];_0x1d950f++){var _0x243468=_0x132801[_0x2f7e('0x64')][_0x1d950f];var _0x1615fd='i';var _0x2c90d3=_[_0x2f7e('0x65')](_0x220170,[_0x2f7e('0x2c'),_0x243468['field']]);if(!_0x2c90d3){switch(_0x243468[_0x2f7e('0x50')]){case'unreadMessages':if(_0x243468[_0x2f7e('0x66')]==0x1){_0x926522[_0x2f7e('0x67')]('`'+_0x243468['field']+_0x2f7e('0x68'));}else{_0x926522['having']('`'+_0x243468[_0x2f7e('0x50')]+_0x2f7e('0x69'));}break;case'Contact':if(_0x243468[_0x2f7e('0x6a')]===_0x2f7e('0x6b')){if(_0x243468[_0x2f7e('0x66')][_0x2f7e('0x6c')]('\x20')[_0x2f7e('0x47')]>0x1){_0x348e3b[_0x1dc49f](_0x2f7e('0x6d'),qs[_0x2f7e('0x6e')](_0x243468[_0x2f7e('0x66')]),null);}else{var _0x2598d8='%'+_0x243468[_0x2f7e('0x66')]+'%';_0x348e3b[_0x1dc49f](_0x2f7e('0x6f'),_0x2598d8,_0x2598d8,_0x2598d8);}}else{_0x2c90d3=_[_0x2f7e('0x65')](_0x220170,[_0x2f7e('0x2c'),_0x2f7e('0x70')]);_0x243468[_0x2f7e('0x50')]=_0x2f7e('0x70');_0x56ed65=as[_0x2f7e('0x71')](_0x1615fd,_0x2c90d3['type'],_0x243468);_0x348e3b[_0x1dc49f](_0x56ed65[_0x2f7e('0x72')],_0x56ed65['value']['start'],_0x56ed65[_0x2f7e('0x66')][_0x2f7e('0x1e')]);}break;case _0x2f7e('0x73'):var _0x32e1db=_0x243468[_0x2f7e('0x66')][_0x2f7e('0x6c')](',')[_0x2f7e('0x2e')](function(_0x4fd3a4){return Number(_0x4fd3a4);});_0x32e1db[_0x2f7e('0x32')](function(_0xe05c08){_0xbe035d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xe05c08+',%');});_0x1e60c6=_['union'](_0x1e60c6,_0x32e1db);break;case _0x2f7e('0x74'):if(_0x243468[_0x2f7e('0x6a')]===_0x2f7e('0x6b')){_0x348e3b[_0x1dc49f](_0x2f7e('0x75'),'%'+_0x243468[_0x2f7e('0x66')]+'%',null);}else{_0x2c90d3=_['find'](_0x220170,['name',_0x2f7e('0x38')]);_0x243468[_0x2f7e('0x50')]=_0x2f7e('0x38');_0x56ed65=as[_0x2f7e('0x71')](_0x1615fd,_0x2c90d3[_0x2f7e('0x3f')],_0x243468);_0x348e3b[_0x1dc49f](_0x56ed65[_0x2f7e('0x72')],_0x56ed65[_0x2f7e('0x66')][_0x2f7e('0x76')],_0x56ed65[_0x2f7e('0x66')][_0x2f7e('0x1e')]);}break;case _0x2f7e('0x77'):_0x56ed65=as[_0x2f7e('0x71')]('me',null,_0x243468);_0x348e3b[_0x1dc49f](_0x56ed65[_0x2f7e('0x72')],_0x56ed65[_0x2f7e('0x66')][_0x2f7e('0x76')],_0x56ed65[_0x2f7e('0x66')][_0x2f7e('0x1e')]);break;}}else{var _0x56ed65=as['buildExpression'](_0x1615fd,_0x2c90d3[_0x2f7e('0x3f')],_0x243468);_0x348e3b[_0x1dc49f](_0x56ed65[_0x2f7e('0x72')],_0x56ed65[_0x2f7e('0x66')][_0x2f7e('0x76')],_0x56ed65[_0x2f7e('0x66')][_0x2f7e('0x1e')]);}}}else{var _0x2b81bc=_(_0x2c4541[_0x2f7e('0x42')])[_0x2f7e('0x43')]()['map'](function(_0x2e6e8a){return _[_0x2f7e('0x78')](_0x220170,[_0x2f7e('0x2c'),_0x2e6e8a])?_0x2e6e8a:undefined;})[_0x2f7e('0x79')]()['value']();if(!_['isEmpty'](_0x2b81bc)){_0x2b81bc['forEach'](function(_0x1fed9b){if(_0x1fed9b===_0x2f7e('0x7a')){_0x926522[_0x2f7e('0x4c')](_0x2f7e('0x7b'),[][_0x2f7e('0x7c')](_0x2c4541[_0x2f7e('0x42')][_0x1fed9b]));}else if(_0x1fed9b==='createdAt'){var _0x15c568=JSON['parse'](_0x2c4541[_0x2f7e('0x42')][_0x1fed9b])[_0x2f7e('0x7d')];var _0x33347b=JSON[_0x2f7e('0x7e')](_0x2c4541[_0x2f7e('0x42')][_0x1fed9b])['$lte'];_0x926522[_0x2f7e('0x4c')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x15c568,_0x33347b);}else{if(_0x2c4541[_0x2f7e('0x42')][_0x1fed9b]===_0x2f7e('0x7f')){_0x926522['where']('i.'+_0x1fed9b+'\x20IS\x20NULL');}else{_0x926522[_0x2f7e('0x4c')]('i.'+_0x1fed9b+_0x2f7e('0x80'),_0x2c4541[_0x2f7e('0x42')][_0x1fed9b]);}}});}if(_0x2c4541['query'][_0x2f7e('0x81')]){if(_0x2c4541[_0x2f7e('0x42')][_0x2f7e('0x81')]==0x1){_0x926522['having'](_0x2f7e('0x82'));}else{_0x926522['having'](_0x2f7e('0x83'));}}if(_0x2c4541['query'][_0x2f7e('0x84')]){_0x1e60c6=_[_0x2f7e('0x85')](_0x2c4541[_0x2f7e('0x42')][_0x2f7e('0x84')])?_0x2c4541[_0x2f7e('0x42')][_0x2f7e('0x84')]:new Array(_0x2c4541['query'][_0x2f7e('0x84')]);_0x1e60c6[_0x2f7e('0x32')](function(_0x20ce38){_0xbe035d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x20ce38+',%');});}if(_0x2c4541['query'][_0x2f7e('0x86')]){var _0x50786b=_0x2c4541['query'][_0x2f7e('0x86')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x2f7e('0x87')](_0x50786b)){_0x348e3b['or'](_0x2f7e('0x88'),_0x50786b+'%')['or'](_0x2f7e('0x89'),_0x50786b+'%');}_0x348e3b['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x50786b+'%');}}_0x926522['where'](_0x348e3b);_0x926522[_0x2f7e('0x8a')](_0x2f7e('0x8b'));var _0x50d0a2={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0x62e604=_0x926522[_0x2f7e('0x8c')]();_0x62e604[_0x2f7e('0x50')](_0x2f7e('0x8b'));_0x62e604['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x219625[_0x2f7e('0x4a')]){_0x219625[_0x2f7e('0x4a')][_0x2f7e('0x32')](function(_0x30694c){var _0x108a0b=_0x30694c[0x0]===_0x2f7e('0x8d')?_0x30694c[0x0]:'i.'+_0x30694c[0x0];_0x926522[_0x2f7e('0x4a')](_0x108a0b,_0x30694c[0x1]===_0x2f7e('0x8e')?![]:!![]);});}if(!_[_0x2f7e('0x8f')](_0x1e60c6)){_0x926522[_0x2f7e('0x67')](_0xbe035d);_0x62e604[_0x2f7e('0x4c')]('t.id\x20IN\x20?',_0x1e60c6);}BPromise[_0x2f7e('0x90')]()[_0x2f7e('0x28')](function(){if(!_0x132801){if(_0x2c4541[_0x2f7e('0x42')][_0x2f7e('0x7a')])return;_0x62e604[_0x2f7e('0x4c')](_0x2f7e('0x91'));_0x926522['where'](_0x2f7e('0x91'));return;}if(_0x2c4541[_0x2f7e('0x92')][_0x2f7e('0x93')]!==_0x2f7e('0x94'))return;return _0x2c4541[_0x2f7e('0x92')][_0x2f7e('0x95')]({'attributes':['id'],'raw':!![]})[_0x2f7e('0x28')](function(_0x362f00){if(_[_0x2f7e('0x8f')](_0x362f00)){_0x62e604[_0x2f7e('0x4c')](_0x2f7e('0x96'));_0x926522['where'](_0x2f7e('0x96'));}else{_0x62e604[_0x2f7e('0x4c')](_0x2f7e('0x7b'),_[_0x2f7e('0x2e')](_0x362f00,'id'));_0x926522[_0x2f7e('0x4c')](_0x2f7e('0x7b'),_['map'](_0x362f00,'id'));}});})[_0x2f7e('0x28')](function(){if(_0x2c4541[_0x2f7e('0x92')][_0x2f7e('0x93')]===_0x2f7e('0x94')&&!_0x132801&&!_0x2c4541[_0x2f7e('0x42')][_0x2f7e('0x7a')])return[];return db[_0x2f7e('0x97')][_0x2f7e('0x42')](_0x62e604[_0x2f7e('0x98')](),_0x50d0a2);})[_0x2f7e('0x28')](function(_0x2c34fc){_0x31087f['count']=_0x2c34fc[_0x2f7e('0x47')];if(_0x31087f[_0x2f7e('0x22')]===0x0)return[];return db[_0x2f7e('0x97')][_0x2f7e('0x42')](_0x3b3030[_0x2f7e('0x98')](),_0x50d0a2)['then'](function(_0x5a8673){_0x2c070d=_[_0x2f7e('0x99')](_0x5a8673,'id');_0x50d0a2=_[_0x2f7e('0x9a')](_0x50d0a2,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2c4541[_0x2f7e('0x42')][_0x2f7e('0x46')]){_0x219625[_0x2f7e('0x45')]['forEach'](function(_0x569aa5){_0x926522[_0x2f7e('0x50')]('i.'+_0x569aa5);});}else{_0x926522['field'](_0x2f7e('0x9b'),_0x2f7e('0x9c'));_0x926522[_0x2f7e('0x50')]('a.key',_0x2f7e('0x9d'));_0x926522['field'](_0x2f7e('0x9e'),_0x2f7e('0x9f'));_0x926522[_0x2f7e('0x50')](_0x2f7e('0xa0'),'contactName');_0x926522[_0x2f7e('0x50')]('i.*');_0x926522[_0x2f7e('0x50')]('c.firstName',_0x2f7e('0xa1'));_0x926522[_0x2f7e('0x50')]('c.lastName',_0x2f7e('0xa2'));_0x926522[_0x2f7e('0x50')](_0x2f7e('0xa3'),_0x2f7e('0xa4'));_0x926522[_0x2f7e('0x50')](_0x2f7e('0xa5'),_0x2f7e('0xa6'));_0x926522[_0x2f7e('0x50')](_0x2f7e('0xa7'),_0x2f7e('0xa8'));_0x926522[_0x2f7e('0x50')](_0x2f7e('0xa9'),'Contact.fax');_0x926522[_0x2f7e('0x50')](_0x2f7e('0xaa'),_0x2f7e('0xab'));_0x926522[_0x2f7e('0x50')]('o.internal',_0x2f7e('0xac'));_0x926522[_0x2f7e('0x50')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x2f7e('0x30'));}if(_0x219625[_0x2f7e('0x21')])_0x926522[_0x2f7e('0x21')](_0x219625[_0x2f7e('0x21')]);if(_0x219625['offset'])_0x926522[_0x2f7e('0x20')](_0x219625['offset']);return db['sequelize'][_0x2f7e('0x42')](_0x926522[_0x2f7e('0x98')](),_0x50d0a2);})[_0x2f7e('0x28')](function(_0x1a9275){if(_0x1a9275[_0x2f7e('0x47')]>0x0)_0xf28b47[_0x2f7e('0x4c')]('ui.FaxInteractionId\x20IN\x20?',_['map'](_0x1a9275,'id'));return db[_0x2f7e('0x97')][_0x2f7e('0x42')](_0xf28b47[_0x2f7e('0x98')](),_0x50d0a2)['then'](function(_0x9d534d){var _0x2094bf=_[_0x2f7e('0xad')](_0x9d534d,_0x2f7e('0xae'));var _0x5c5074=[];_0x1a9275[_0x2f7e('0x32')](function(_0x2d594e){_0x5c5074['push'](updateFaxInteraction(_0x2d594e,_0x2c070d,_0x2094bf));});return BPromise['all'](_0x5c5074);});});})[_0x2f7e('0x28')](function(_0xa3e2f){_0x31087f[_0x2f7e('0xaf')]=_0xa3e2f;return _0x31087f;})[_0x2f7e('0x28')](respondWithFilteredResult(_0x3e55de,_0x219625))[_0x2f7e('0x33')](handleError(_0x3e55de,null));};exports[_0x2f7e('0xb0')]=function(_0x5f10aa,_0x3542bd){var _0x42dafb={'raw':![],'where':{'id':_0x5f10aa[_0x2f7e('0xb1')]['id']}},_0x591663={};_0x591663['model']=_['keys'](db[_0x2f7e('0x3c')][_0x2f7e('0x3d')]);_0x591663[_0x2f7e('0x42')]=_['keys'](_0x5f10aa[_0x2f7e('0x42')]);_0x591663['filters']=_[_0x2f7e('0x44')](_0x591663['model'],_0x591663[_0x2f7e('0x42')]);_0x42dafb['attributes']=_[_0x2f7e('0x44')](_0x591663['model'],qs[_0x2f7e('0x46')](_0x5f10aa[_0x2f7e('0x42')][_0x2f7e('0x46')]));_0x42dafb[_0x2f7e('0x45')]=_0x42dafb[_0x2f7e('0x45')][_0x2f7e('0x47')]?_0x42dafb[_0x2f7e('0x45')]:_0x591663[_0x2f7e('0x41')];if(_0x5f10aa[_0x2f7e('0x42')][_0x2f7e('0xb2')]){_0x42dafb[_0x2f7e('0xb3')]=[{'all':!![]}];}_0x42dafb=_[_0x2f7e('0x9a')]({},_0x42dafb,_0x5f10aa[_0x2f7e('0xb4')]);return db[_0x2f7e('0x3c')][_0x2f7e('0x65')](_0x42dafb)[_0x2f7e('0x28')](handleEntityNotFound(_0x3542bd,null))[_0x2f7e('0x28')](respondWithResult(_0x3542bd,null))['catch'](handleError(_0x3542bd,null));};exports[_0x2f7e('0xb5')]=function(_0x418e65,_0x5e98d6){return db[_0x2f7e('0x3c')][_0x2f7e('0xb5')](_0x418e65[_0x2f7e('0x77')],{})[_0x2f7e('0x28')](respondWithResult(_0x5e98d6,0xc9))[_0x2f7e('0x33')](handleError(_0x5e98d6,null));};exports[_0x2f7e('0x27')]=function(_0x59c43b,_0x16fa6c){if(_0x59c43b[_0x2f7e('0x77')]['id']){delete _0x59c43b['body']['id'];}return db[_0x2f7e('0x3c')][_0x2f7e('0x65')]({'where':{'id':_0x59c43b[_0x2f7e('0xb1')]['id']}})[_0x2f7e('0x28')](handleEntityNotFound(_0x16fa6c,null))[_0x2f7e('0x28')](saveUpdates(_0x59c43b[_0x2f7e('0x77')],null))['then'](respondWithResult(_0x16fa6c,null))[_0x2f7e('0x33')](handleError(_0x16fa6c,null));};exports[_0x2f7e('0x29')]=function(_0x4e29ae,_0x20f75b){return db[_0x2f7e('0x3c')][_0x2f7e('0x65')]({'where':{'id':_0x4e29ae[_0x2f7e('0xb1')]['id']}})[_0x2f7e('0x28')](handleEntityNotFound(_0x20f75b,null))[_0x2f7e('0x28')](removeEntity(_0x20f75b,null))['catch'](handleError(_0x20f75b,null));};exports[_0x2f7e('0xb6')]=function(_0x54bb01,_0x3906fe){return db[_0x2f7e('0x3c')]['describe']()[_0x2f7e('0x28')](respondWithResult(_0x3906fe,null))['catch'](handleError(_0x3906fe,null));};exports[_0x2f7e('0xb7')]=function(_0x7ae4b7,_0x52bc56,_0x42636d){return db[_0x2f7e('0xb8')][_0x2f7e('0x65')]({'where':{'id':_0x7ae4b7[_0x2f7e('0xb1')]['id']}})[_0x2f7e('0x28')](handleEntityNotFound(_0x52bc56,null))[_0x2f7e('0x28')](function(_0x1c5f8a){if(_0x1c5f8a){return _0x1c5f8a[_0x2f7e('0xb7')](_0x7ae4b7[_0x2f7e('0x77')][_0x2f7e('0xb9')],_[_0x2f7e('0xba')](_0x7ae4b7[_0x2f7e('0x77')],[_0x2f7e('0xb9'),'id'])||{});}})[_0x2f7e('0x28')](respondWithResult(_0x52bc56,null))[_0x2f7e('0x33')](handleError(_0x52bc56,null));};exports[_0x2f7e('0xbb')]=function(_0x8a246b,_0x1738aa,_0x3d73d4){var _0x352d3b={'raw':![],'where':{}};var _0x55e2fd={};var _0x2eaf32={'count':0x0,'rows':[]};return db['FaxInteraction']['findOne']({'where':{'id':_0x8a246b[_0x2f7e('0xb1')]['id']}})[_0x2f7e('0x28')](handleEntityNotFound(_0x1738aa,null))['then'](function(_0x1f64af){if(_0x1f64af){_0x55e2fd[_0x2f7e('0x41')]=_[_0x2f7e('0x43')](db[_0x2f7e('0xb8')][_0x2f7e('0x3d')]);_0x55e2fd[_0x2f7e('0x42')]=_[_0x2f7e('0x43')](_0x8a246b[_0x2f7e('0x42')]);_0x55e2fd[_0x2f7e('0x4e')]=_[_0x2f7e('0x44')](_0x55e2fd[_0x2f7e('0x41')],_0x55e2fd[_0x2f7e('0x42')]);_0x352d3b[_0x2f7e('0x45')]=_[_0x2f7e('0x44')](_0x55e2fd[_0x2f7e('0x41')],qs[_0x2f7e('0x46')](_0x8a246b[_0x2f7e('0x42')][_0x2f7e('0x46')]));_0x352d3b[_0x2f7e('0x45')]=_0x352d3b['attributes']['length']?_0x352d3b[_0x2f7e('0x45')]:_0x55e2fd['model'];if(!_0x8a246b['query'][_0x2f7e('0x48')](_0x2f7e('0x49'))){_0x352d3b[_0x2f7e('0x21')]=qs[_0x2f7e('0x21')](_0x8a246b[_0x2f7e('0x42')][_0x2f7e('0x21')]);_0x352d3b[_0x2f7e('0x20')]=qs['offset'](_0x8a246b[_0x2f7e('0x42')]['offset']);}_0x352d3b[_0x2f7e('0x4a')]=qs[_0x2f7e('0x4b')](_0x8a246b[_0x2f7e('0x42')]['sort']);_0x352d3b[_0x2f7e('0x4c')]=qs[_0x2f7e('0x4e')](_[_0x2f7e('0x4d')](_0x8a246b[_0x2f7e('0x42')],_0x55e2fd[_0x2f7e('0x4e')]));_0x352d3b[_0x2f7e('0x4c')]['FaxInteractionId']=_0x1f64af['id'];if(_0x8a246b['query'][_0x2f7e('0x86')]){_0x352d3b[_0x2f7e('0x4c')]=_[_0x2f7e('0x9a')](_0x352d3b[_0x2f7e('0x4c')],{'$or':_[_0x2f7e('0x2e')](_0x352d3b['attributes'],function(_0x4fa153){var _0x5c23ea={};_0x5c23ea[_0x4fa153]={'$like':'%'+_0x8a246b[_0x2f7e('0x42')][_0x2f7e('0x86')]+'%'};return _0x5c23ea;})});}if(_0x8a246b[_0x2f7e('0x42')][_0x2f7e('0x7d')]){var _0x1a3742=_0x8a246b[_0x2f7e('0x42')][_0x2f7e('0x7d')][_0x2f7e('0x6c')](',');var _0x35b8d0={};_0x35b8d0[_0x1a3742[0x0]]={'$gte':moment(_0x1a3742[0x1])[_0x2f7e('0xbc')]('YYYY-MM-DD\x20HH:mm:ss')};_0x352d3b[_0x2f7e('0x4c')]=_['merge'](_0x352d3b[_0x2f7e('0x4c')],_0x35b8d0);}_0x352d3b=_[_0x2f7e('0x9a')]({},_0x352d3b,_0x8a246b['options']);return db[_0x2f7e('0xb8')][_0x2f7e('0x22')]({'where':_0x352d3b[_0x2f7e('0x4c')]})[_0x2f7e('0x28')](function(_0x46315d){_0x2eaf32[_0x2f7e('0x22')]=_0x46315d;if(_0x8a246b[_0x2f7e('0x42')]['includeAll']){_0x352d3b[_0x2f7e('0xb3')]=[{'all':!![]}];}return db[_0x2f7e('0xb8')][_0x2f7e('0xbd')](_0x352d3b);})[_0x2f7e('0x28')](function(_0x4b9abb){_0x2eaf32[_0x2f7e('0xaf')]=_0x4b9abb;return _0x2eaf32;});}})[_0x2f7e('0x28')](respondWithFilteredResult(_0x1738aa,_0x352d3b))['catch'](handleError(_0x1738aa,null));};exports['addTags']=function(_0x32b62e,_0x253341,_0x525338){return db[_0x2f7e('0x3c')][_0x2f7e('0x65')]({'where':{'id':_0x32b62e[_0x2f7e('0xb1')]['id']}})[_0x2f7e('0x28')](handleEntityNotFound(_0x253341,null))[_0x2f7e('0x28')](function(_0x854f27){if(_0x854f27){return _0x854f27['setTags'](_0x32b62e[_0x2f7e('0x77')][_0x2f7e('0xb9')],_[_0x2f7e('0xba')](_0x32b62e[_0x2f7e('0x77')],[_0x2f7e('0xb9'),'id'])||{})[_0x2f7e('0xbe')](function(){return db['Tag'][_0x2f7e('0xbd')]({'attributes':['id','name','color'],'where':{'id':_0x32b62e['body']['ids']}});})['then'](function(_0x5604bf){socket[_0x2f7e('0xbf')]('faxInteractionTags:save',{'id':Number(_0x32b62e['params']['id']),'tags':_0x5604bf||[]});return{'id':Number(_0x32b62e[_0x2f7e('0xb1')]['id']),'tags':_0x5604bf||[]};});}})[_0x2f7e('0x28')](respondWithResult(_0x253341,null))['catch'](handleError(_0x253341,null));};exports[_0x2f7e('0xc0')]=function(_0x466a3f,_0x458de4,_0x1f9e0d){return db[_0x2f7e('0x3c')][_0x2f7e('0x65')]({'where':{'id':_0x466a3f[_0x2f7e('0xb1')]['id']}})[_0x2f7e('0x28')](handleEntityNotFound(_0x458de4,null))['then'](function(_0x377d57){if(_0x377d57){return _0x377d57[_0x2f7e('0xc0')](_0x466a3f[_0x2f7e('0x42')][_0x2f7e('0xb9')]);}})[_0x2f7e('0x28')](respondWithStatusCode(_0x458de4,null))[_0x2f7e('0x33')](handleError(_0x458de4,null));};exports[_0x2f7e('0xc1')]=function(_0x144f7c,_0x51d314){var _0x4cf948=moment()[_0x2f7e('0xc2')]()[_0x2f7e('0x98')]();var _0x2870a9=path[_0x2f7e('0xc3')](config[_0x2f7e('0xc4')],_0x2f7e('0xc5'),_0x2f7e('0xc6'),_0x2f7e('0xc7'));var _0x4ebc1c=path[_0x2f7e('0xc3')](config[_0x2f7e('0xc4')],_0x2f7e('0xc5'),_0x2f7e('0xc6'),'attachments');var _0x254b66=path['join'](_0x2870a9,_0x4cf948);var _0x8eb321=util[_0x2f7e('0xbc')](_0x2f7e('0xc8'),_0x144f7c[_0x2f7e('0xb1')]['id'],_0x4cf948);var _0x41012b=path[_0x2f7e('0xc3')](_0x2870a9,_0x8eb321);var _0x1e3a44=[];_0x1e3a44[_0x2f7e('0xc9')]({'model':db[_0x2f7e('0xca')],'as':_0x2f7e('0xca'),'raw':!![]});var _0x2c21c9=[{'model':db[_0x2f7e('0xb8')],'as':_0x2f7e('0xcb'),'attributes':['id',_0x2f7e('0x77'),_0x2f7e('0xcc')],'include':_0x1e3a44}];return db[_0x2f7e('0x3c')]['find']({'where':{'id':_0x144f7c['params']['id']},'include':_0x2c21c9})[_0x2f7e('0x28')](handleEntityNotFound(_0x51d314,null))['then'](function(_0x4e66a9){if(_0x4e66a9&&_0x4e66a9[_0x2f7e('0xcb')]){var _0x34dfa1=_0x4e66a9[_0x2f7e('0xcd')]({'plain':!![]});fs['mkdirSync'](_0x254b66);for(var _0x45f2bd=0x0;_0x45f2bd<_0x34dfa1[_0x2f7e('0xcb')][_0x2f7e('0x47')];_0x45f2bd++){var _0x21f591=_0x34dfa1[_0x2f7e('0xcb')][_0x45f2bd][_0x2f7e('0xca')];if(_0x21f591){var _0x2b2596=path[_0x2f7e('0xc3')](_0x4ebc1c,_0x21f591[_0x2f7e('0xce')]);if(fs['existsSync'](_0x2b2596)){fs['createReadStream'](_0x2b2596)[_0x2f7e('0xcf')](fs[_0x2f7e('0xd0')](path[_0x2f7e('0xc3')](_0x254b66,_0x21f591[_0x2f7e('0xce')])));}}}return BPromise['resolve']()[_0x2f7e('0x28')](function(){return new BPromise(function(_0x1570b4,_0x2800f9){zipdir(_0x254b66,{'saveTo':_0x41012b},function(_0x3d1ee5,_0x320e2f){if(_0x3d1ee5)return _0x2800f9(_0x3d1ee5);return _0x1570b4(_0x320e2f);});})[_0x2f7e('0x28')](function(){return new BPromise(function(_0x57c2b4,_0x2b3718){rimraf(_0x254b66,function(_0x1b56e7){if(_0x1b56e7)_0x2b3718(_0x1b56e7);return _0x57c2b4();});});})['then'](function(){return _0x51d314['download'](_0x41012b,_0x8eb321,function(_0x418674){if(_0x418674){console[_0x2f7e('0xd1')](_0x2f7e('0xd2'),_0x418674);}else{fs['unlinkSync'](_0x41012b);}});});});}else{return _0x51d314[_0x2f7e('0x1c')](0xc8);}})['catch'](handleError(_0x51d314,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index e6af381..c5052d3 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 _0xcaf7=['save','update','then','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x585a5d,_0x5a0d78){var _0x4a9430=function(_0x4b6542){while(--_0x4b6542){_0x585a5d['push'](_0x585a5d['shift']());}};_0x4a9430(++_0x5a0d78);}(_0xcaf7,0x14d));var _0x7caf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcaf7[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x7caf('0x0'))['db']['FaxInteraction'];var FaxMessage=require(_0x7caf('0x0'))['db'][_0x7caf('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x7caf('0x2')](0x0);var events={'afterCreate':_0x7caf('0x3'),'afterUpdate':_0x7caf('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3d1ea7){return function(_0x45e95d,_0x2b1bc5,_0x5a4701){_0x45e95d['getUsers']({'attributes':['id'],'raw':!![]})[_0x7caf('0x5')](function(_0x1746c3){_0x45e95d['setDataValue'](_0x7caf('0x6'),_0x1746c3[_0x7caf('0x7')](function(_0x3e83ec){return{'id':_0x3e83ec['id']};}));return FaxMessage[_0x7caf('0x8')]({'where':{'FaxInteractionId':_0x45e95d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7caf('0x5')](function(_0x2ebc6a){_0x45e95d['setDataValue'](_0x7caf('0x9'),_0x2ebc6a[_0x7caf('0xa')]);FaxInteractionEvents[_0x7caf('0xb')](_0x3d1ea7+':'+_0x45e95d['id'],_0x45e95d);FaxInteractionEvents[_0x7caf('0xb')](_0x3d1ea7,_0x45e95d);_0x5a4701(null);})[_0x7caf('0xc')](_0x5a4701(null));};}for(var e in events){if(events[_0x7caf('0xd')](e)){var event=events[e];FaxInteraction[_0x7caf('0xe')](e,emitEvent(event));}}module[_0x7caf('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0x03e7=['../../mysqldb','FaxInteraction','save','remove','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x236e4c,_0x169856){var _0x427946=function(_0x124186){while(--_0x124186){_0x236e4c['push'](_0x236e4c['shift']());}};_0x427946(++_0x169856);}(_0x03e7,0x1cf));var _0x703e=function(_0x2bb892,_0x159e03){_0x2bb892=_0x2bb892-0x0;var _0x524190=_0x03e7[_0x2bb892];return _0x524190;};'use strict';var EventEmitter=require(_0x703e('0x0'));var FaxInteraction=require(_0x703e('0x1'))['db'][_0x703e('0x2')];var FaxMessage=require(_0x703e('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x703e('0x3'),'afterUpdate':'update','afterDestroy':_0x703e('0x4')};function emitEvent(_0x1e4d53){return function(_0x453945,_0x32be3f,_0x3f15b8){_0x453945['getUsers']({'attributes':['id'],'raw':!![]})[_0x703e('0x5')](function(_0x34fe73){_0x453945[_0x703e('0x6')]('Users',_0x34fe73[_0x703e('0x7')](function(_0x11f7c4){return{'id':_0x11f7c4['id']};}));return FaxMessage[_0x703e('0x8')]({'where':{'FaxInteractionId':_0x453945['id'],'direction':'in','read':![]},'raw':!![]});})[_0x703e('0x5')](function(_0x47d4c9){_0x453945[_0x703e('0x6')](_0x703e('0x9'),_0x47d4c9[_0x703e('0xa')]);FaxInteractionEvents[_0x703e('0xb')](_0x1e4d53+':'+_0x453945['id'],_0x453945);FaxInteractionEvents['emit'](_0x1e4d53,_0x453945);_0x3f15b8(null);})[_0x703e('0xc')](_0x3f15b8(null));};}for(var e in events){if(events[_0x703e('0xd')](e)){var event=events[e];FaxInteraction[_0x703e('0xe')](e,emitEvent(event));}}module[_0x703e('0xf')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index ee1e151..21c5823 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 _0xd668=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','fax_interactions','changed','closed','format'];(function(_0x2e16c0,_0x51bb07){var _0xdaa765=function(_0x1a01ea){while(--_0x1a01ea){_0x2e16c0['push'](_0x2e16c0['shift']());}};_0xdaa765(++_0x51bb07);}(_0xd668,0x15e));var _0x8d66=function(_0x39b7d8,_0xa44989){_0x39b7d8=_0x39b7d8-0x0;var _0x42d6dd=_0xd668[_0x39b7d8];return _0x42d6dd;};'use strict';var _=require(_0x8d66('0x0'));var util=require(_0x8d66('0x1'));var logger=require(_0x8d66('0x2'))(_0x8d66('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8d66('0x4'));var fs=require('fs');var path=require(_0x8d66('0x5'));var rimraf=require(_0x8d66('0x6'));var config=require(_0x8d66('0x7'));var attributes=require(_0x8d66('0x8'));module[_0x8d66('0x9')]=function(_0x1ad994,_0x104821){return _0x1ad994['define']('FaxInteraction',attributes,{'tableName':_0x8d66('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xb83e19,_0x89e9c5,_0x130b4c){if(_0xb83e19[_0x8d66('0xb')](_0x8d66('0xc'))){_0xb83e19['closedAt']=moment()[_0x8d66('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x130b4c(null,_0xb83e19);}}});}; \ No newline at end of file +var _0xeb82=['../../config/logger','api','bluebird','request-promise','path','rimraf','define','FaxInteraction','closed','format','lodash','util'];(function(_0x5305d3,_0x33f9e4){var _0x53c5a5=function(_0x2188ff){while(--_0x2188ff){_0x5305d3['push'](_0x5305d3['shift']());}};_0x53c5a5(++_0x33f9e4);}(_0xeb82,0x8e));var _0x2eb8=function(_0x44a53e,_0xc76beb){_0x44a53e=_0x44a53e-0x0;var _0x129a34=_0xeb82[_0x44a53e];return _0x129a34;};'use strict';var _=require(_0x2eb8('0x0'));var util=require(_0x2eb8('0x1'));var logger=require(_0x2eb8('0x2'))(_0x2eb8('0x3'));var moment=require('moment');var BPromise=require(_0x2eb8('0x4'));var rp=require(_0x2eb8('0x5'));var fs=require('fs');var path=require(_0x2eb8('0x6'));var rimraf=require(_0x2eb8('0x7'));var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module['exports']=function(_0x3a1004,_0x5477cd){return _0x3a1004[_0x2eb8('0x8')](_0x2eb8('0x9'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3eb643,_0x23c0ad,_0x54791b){if(_0x3eb643['changed'](_0x2eb8('0xa'))){_0x3eb643['closedAt']=moment()[_0x2eb8('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x54791b(null,_0x3eb643);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 7669267..50ebf54 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 _0xec84=['defaults','socket.io-emitter','redis','register','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','options','raw','where','attributes','then','AddTagsToFaxInteraction','find','addTags','body','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x56f1c4,_0x37fe7f){var _0xa30a8f=function(_0x5e38ab){while(--_0x5e38ab){_0x56f1c4['push'](_0x56f1c4['shift']());}};_0xa30a8f(++_0x37fe7f);}(_0xec84,0x1b4));var _0x4ec8=function(_0x238202,_0x10da07){_0x238202=_0x238202-0x0;var _0x217367=_0xec84[_0x238202];return _0x217367;};'use strict';var _=require(_0x4ec8('0x0'));var util=require(_0x4ec8('0x1'));var moment=require(_0x4ec8('0x2'));var BPromise=require(_0x4ec8('0x3'));var rs=require(_0x4ec8('0x4'));var fs=require('fs');var Redis=require(_0x4ec8('0x5'));var db=require(_0x4ec8('0x6'))['db'];var utils=require(_0x4ec8('0x7'));var logger=require(_0x4ec8('0x8'))(_0x4ec8('0x9'));var config=require(_0x4ec8('0xa'));var jayson=require(_0x4ec8('0xb'));var client=jayson[_0x4ec8('0xc')][_0x4ec8('0xd')]({'port':0x232a});config['redis']=_[_0x4ec8('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4ec8('0xf'))(new Redis(config[_0x4ec8('0x10')]));require('./faxInteraction.socket')[_0x4ec8('0x11')](socket);function respondWithRpcPromise(_0xc8c0c8,_0x126153,_0x1a5298){return new BPromise(function(_0x377a82,_0x55c7d7){return client[_0x4ec8('0x12')](_0xc8c0c8,_0x1a5298)['then'](function(_0xa2e51d){logger[_0x4ec8('0x13')](_0x4ec8('0x14'),_0x126153,_0x4ec8('0x15'));logger[_0x4ec8('0x16')](_0x4ec8('0x17'),_0x126153,'request\x20sent',JSON[_0x4ec8('0x18')](_0xa2e51d));if(_0xa2e51d[_0x4ec8('0x19')]){if(_0xa2e51d['error'][_0x4ec8('0x1a')]===0x1f4){logger[_0x4ec8('0x19')](_0x4ec8('0x14'),_0x126153,_0xa2e51d[_0x4ec8('0x19')][_0x4ec8('0x1b')]);return _0x55c7d7(_0xa2e51d[_0x4ec8('0x19')][_0x4ec8('0x1b')]);}logger[_0x4ec8('0x19')](_0x4ec8('0x14'),_0x126153,_0xa2e51d[_0x4ec8('0x19')][_0x4ec8('0x1b')]);return _0x377a82(_0xa2e51d['error'][_0x4ec8('0x1b')]);}else{logger[_0x4ec8('0x13')](_0x4ec8('0x14'),_0x126153,_0x4ec8('0x15'));_0x377a82(_0xa2e51d[_0x4ec8('0x1c')][_0x4ec8('0x1b')]);}})[_0x4ec8('0x1d')](function(_0x17916b){logger['error'](_0x4ec8('0x14'),_0x126153,_0x17916b);_0x55c7d7(_0x17916b);});});}exports[_0x4ec8('0x1e')]=function(_0x1993a4){var _0x548fc2=this;return new Promise(function(_0x5b9778,_0x345a22){return db[_0x4ec8('0x1f')][_0x4ec8('0x20')](_0x1993a4['body'],{'raw':_0x1993a4[_0x4ec8('0x21')]?_0x1993a4[_0x4ec8('0x21')][_0x4ec8('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1993a4[_0x4ec8('0x21')]?_0x1993a4[_0x4ec8('0x21')][_0x4ec8('0x23')]||null:null,'attributes':_0x1993a4[_0x4ec8('0x21')]?_0x1993a4[_0x4ec8('0x21')][_0x4ec8('0x24')]||null:null,'limit':_0x1993a4[_0x4ec8('0x21')]?_0x1993a4[_0x4ec8('0x21')]['limit']||null:null})[_0x4ec8('0x25')](function(_0x363ee9){logger[_0x4ec8('0x13')]('UpdateFaxInteraction',_0x1993a4);logger['debug'](_0x4ec8('0x1e'),_0x1993a4,JSON[_0x4ec8('0x18')](_0x363ee9));_0x5b9778(_0x363ee9);})[_0x4ec8('0x1d')](function(_0x629d92){logger[_0x4ec8('0x19')](_0x4ec8('0x1e'),_0x629d92['message'],_0x1993a4);_0x345a22(_0x548fc2['error'](0x1f4,_0x629d92[_0x4ec8('0x1b')]));});});};exports[_0x4ec8('0x26')]=function(_0x1325e6){return new Promise(function(_0x1b53c3,_0x18d911){return db[_0x4ec8('0x1f')][_0x4ec8('0x27')]({'where':_0x1325e6[_0x4ec8('0x21')]?_0x1325e6[_0x4ec8('0x21')][_0x4ec8('0x23')]||null:null})[_0x4ec8('0x25')](function(_0x2fda2b){if(_0x2fda2b){return _0x2fda2b[_0x4ec8('0x28')](_0x1325e6[_0x4ec8('0x29')][_0x4ec8('0x2a')],_['omit'](_0x1325e6['body'],[_0x4ec8('0x2a'),'id'])||{});}})[_0x4ec8('0x2b')](function(_0x232970){logger[_0x4ec8('0x13')](_0x4ec8('0x2c'),_0x1325e6);logger['debug'](_0x4ec8('0x2c'),_0x1325e6,JSON[_0x4ec8('0x18')](_0x232970));_0x1b53c3(_0x232970);})['catch'](function(_0x49b3e0){logger[_0x4ec8('0x19')](_0x4ec8('0x2c'),_0x49b3e0['message'],_0x1325e6);_0x18d911(_this[_0x4ec8('0x19')](0x1f4,_0x49b3e0['message']));});});}; \ No newline at end of file +var _0x31d7=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','register','request','then','info','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','FaxInteraction,\x20%s,\x20%s','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','attributes','limit','debug','AddTagsToFaxInteraction','find','where','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring'];(function(_0x2e5e53,_0x5c0de0){var _0x18a7bd=function(_0x145d07){while(--_0x145d07){_0x2e5e53['push'](_0x2e5e53['shift']());}};_0x18a7bd(++_0x5c0de0);}(_0x31d7,0xf7));var _0x731d=function(_0x367958,_0x5a1776){_0x367958=_0x367958-0x0;var _0x335fae=_0x31d7[_0x367958];return _0x335fae;};'use strict';var _=require(_0x731d('0x0'));var util=require(_0x731d('0x1'));var moment=require(_0x731d('0x2'));var BPromise=require(_0x731d('0x3'));var rs=require(_0x731d('0x4'));var fs=require('fs');var Redis=require(_0x731d('0x5'));var db=require(_0x731d('0x6'))['db'];var utils=require(_0x731d('0x7'));var logger=require(_0x731d('0x8'))(_0x731d('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x731d('0xa')]({'port':0x232a});config[_0x731d('0xb')]=_[_0x731d('0xc')](config['redis'],{'host':_0x731d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x731d('0xb')]));require('./faxInteraction.socket')[_0x731d('0xe')](socket);function respondWithRpcPromise(_0x32a2cd,_0x26b440,_0x277aa3){return new BPromise(function(_0x516291,_0x1809d6){return client[_0x731d('0xf')](_0x32a2cd,_0x277aa3)[_0x731d('0x10')](function(_0x52be4b){logger[_0x731d('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x26b440,_0x731d('0x12'));logger['debug'](_0x731d('0x13'),_0x26b440,_0x731d('0x12'),JSON[_0x731d('0x14')](_0x52be4b));if(_0x52be4b[_0x731d('0x15')]){if(_0x52be4b[_0x731d('0x15')]['code']===0x1f4){logger[_0x731d('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x26b440,_0x52be4b[_0x731d('0x15')][_0x731d('0x16')]);return _0x1809d6(_0x52be4b[_0x731d('0x15')][_0x731d('0x16')]);}logger[_0x731d('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x26b440,_0x52be4b[_0x731d('0x15')]['message']);return _0x516291(_0x52be4b[_0x731d('0x15')]['message']);}else{logger[_0x731d('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x26b440,_0x731d('0x12'));_0x516291(_0x52be4b[_0x731d('0x17')][_0x731d('0x16')]);}})[_0x731d('0x18')](function(_0x20c893){logger[_0x731d('0x15')](_0x731d('0x19'),_0x26b440,_0x20c893);_0x1809d6(_0x20c893);});});}exports[_0x731d('0x1a')]=function(_0x4d4c7e){var _0x140cff=this;return new Promise(function(_0x5a8e17,_0x194f7c){return db[_0x731d('0x1b')][_0x731d('0x1c')](_0x4d4c7e[_0x731d('0x1d')],{'raw':_0x4d4c7e[_0x731d('0x1e')]?_0x4d4c7e[_0x731d('0x1e')][_0x731d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d4c7e[_0x731d('0x1e')]?_0x4d4c7e[_0x731d('0x1e')]['where']||null:null,'attributes':_0x4d4c7e[_0x731d('0x1e')]?_0x4d4c7e[_0x731d('0x1e')][_0x731d('0x20')]||null:null,'limit':_0x4d4c7e[_0x731d('0x1e')]?_0x4d4c7e[_0x731d('0x1e')][_0x731d('0x21')]||null:null})[_0x731d('0x10')](function(_0x173c4c){logger[_0x731d('0x11')](_0x731d('0x1a'),_0x4d4c7e);logger[_0x731d('0x22')](_0x731d('0x1a'),_0x4d4c7e,JSON[_0x731d('0x14')](_0x173c4c));_0x5a8e17(_0x173c4c);})[_0x731d('0x18')](function(_0x761c4e){logger[_0x731d('0x15')]('UpdateFaxInteraction',_0x761c4e['message'],_0x4d4c7e);_0x194f7c(_0x140cff[_0x731d('0x15')](0x1f4,_0x761c4e[_0x731d('0x16')]));});});};exports[_0x731d('0x23')]=function(_0x2a727d){return new Promise(function(_0xe3ccb0,_0x110a7c){return db[_0x731d('0x1b')][_0x731d('0x24')]({'where':_0x2a727d[_0x731d('0x1e')]?_0x2a727d[_0x731d('0x1e')][_0x731d('0x25')]||null:null})[_0x731d('0x10')](function(_0x3eafc0){if(_0x3eafc0){return _0x3eafc0[_0x731d('0x26')](_0x2a727d[_0x731d('0x1d')][_0x731d('0x27')],_['omit'](_0x2a727d[_0x731d('0x1d')],[_0x731d('0x27'),'id'])||{});}})[_0x731d('0x28')](function(_0x456868){logger[_0x731d('0x11')](_0x731d('0x29'),_0x2a727d);logger[_0x731d('0x22')](_0x731d('0x29'),_0x2a727d,JSON['stringify'](_0x456868));_0xe3ccb0(_0x456868);})[_0x731d('0x18')](function(_0x399a48){logger['error'](_0x731d('0x29'),_0x399a48[_0x731d('0x16')],_0x2a727d);_0x110a7c(_this['error'](0x1f4,_0x399a48[_0x731d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 4e2f466..db82829 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 _0x0a8f=['update','emit','removeListener','length','faxInteraction:','./faxInteraction.events'];(function(_0x1fd7c5,_0x4e7f1f){var _0x55a8a5=function(_0x2d7459){while(--_0x2d7459){_0x1fd7c5['push'](_0x1fd7c5['shift']());}};_0x55a8a5(++_0x4e7f1f);}(_0x0a8f,0x1d3));var _0xf0a8=function(_0x4558bc,_0xa0377b){_0x4558bc=_0x4558bc-0x0;var _0x1c8bfe=_0x0a8f[_0x4558bc];return _0x1c8bfe;};'use strict';var FaxInteractionEvents=require(_0xf0a8('0x0'));var events=['save','remove',_0xf0a8('0x1')];function createListener(_0x41275f,_0x8793e6){return function(_0x1b2bee){_0x8793e6[_0xf0a8('0x2')](_0x41275f,_0x1b2bee);};}function removeListener(_0x138c79,_0x4cced2){return function(){FaxInteractionEvents[_0xf0a8('0x3')](_0x138c79,_0x4cced2);};}exports['register']=function(_0x1742db){for(var _0x3f7550=0x0,_0x5e10ad=events[_0xf0a8('0x4')];_0x3f7550<_0x5e10ad;_0x3f7550++){var _0xcf28de=events[_0x3f7550];var _0x58cdfd=createListener(_0xf0a8('0x5')+_0xcf28de,_0x1742db);FaxInteractionEvents['on'](_0xcf28de,_0x58cdfd);}}; \ No newline at end of file +var _0xa625=['remove','update','emit','removeListener','register','faxInteraction:','save'];(function(_0xcbe618,_0x3235fb){var _0x438435=function(_0x366d05){while(--_0x366d05){_0xcbe618['push'](_0xcbe618['shift']());}};_0x438435(++_0x3235fb);}(_0xa625,0x117));var _0x5a62=function(_0x5cbf0e,_0x4cd140){_0x5cbf0e=_0x5cbf0e-0x0;var _0x1c76f8=_0xa625[_0x5cbf0e];return _0x1c76f8;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x5a62('0x0'),_0x5a62('0x1'),_0x5a62('0x2')];function createListener(_0x847884,_0x3af6dd){return function(_0x3d13bf){_0x3af6dd[_0x5a62('0x3')](_0x847884,_0x3d13bf);};}function removeListener(_0x349b55,_0x3c3d6e){return function(){FaxInteractionEvents[_0x5a62('0x4')](_0x349b55,_0x3c3d6e);};}exports[_0x5a62('0x5')]=function(_0x1e91fe){for(var _0x341907=0x0,_0x190f8c=events['length'];_0x341907<_0x190f8c;_0x341907++){var _0x344b5f=events[_0x341907];var _0x6e93a1=createListener(_0x5a62('0x6')+_0x344b5f,_0x1e91fe);FaxInteractionEvents['on'](_0x344b5f,_0x6e93a1);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 14a5dca..ffa0931 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 _0x00d8=['/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags','tracked','faxinteraction:addtags','addTags','put','fax','faxinteraction:destroy','destroy','delete','removeTags','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show'];(function(_0x5b7788,_0x309ae5){var _0x573871=function(_0x5c79fd){while(--_0x5c79fd){_0x5b7788['push'](_0x5b7788['shift']());}};_0x573871(++_0x309ae5);}(_0x00d8,0xe2));var _0x800d=function(_0x5f23f3,_0x38c35a){_0x5f23f3=_0x5f23f3-0x0;var _0x3d0593=_0x00d8[_0x5f23f3];return _0x3d0593;};'use strict';var multer=require(_0x800d('0x0'));var util=require(_0x800d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x800d('0x2'));var router=express[_0x800d('0x3')]();var fs_extra=require(_0x800d('0x4'));var auth=require(_0x800d('0x5'));var interaction=require(_0x800d('0x6'));var config=require(_0x800d('0x7'));var controller=require('./faxInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x800d('0x8')](_0x800d('0x9'),auth[_0x800d('0xa')](),controller[_0x800d('0xb')]);router['get'](_0x800d('0xc'),auth[_0x800d('0xa')](),controller[_0x800d('0xd')]);router[_0x800d('0x8')](_0x800d('0xe'),auth[_0x800d('0xa')](),controller[_0x800d('0xf')]);router[_0x800d('0x8')](_0x800d('0x10'),auth[_0x800d('0xa')](),controller['download']);router[_0x800d('0x11')]('/',auth[_0x800d('0xa')](),controller['create']);router[_0x800d('0x11')]('/:id/messages',auth[_0x800d('0xa')](),controller[_0x800d('0x12')]);router['post'](_0x800d('0x13'),auth[_0x800d('0xa')](),interaction[_0x800d('0x14')]('fax',_0x800d('0x15')),controller[_0x800d('0x16')]);router[_0x800d('0x17')](_0x800d('0xc'),auth[_0x800d('0xa')](),interaction[_0x800d('0x14')](_0x800d('0x18'),'faxinteraction:update'),controller['update']);router['delete']('/:id',auth[_0x800d('0xa')](),interaction[_0x800d('0x14')]('fax',_0x800d('0x19')),controller[_0x800d('0x1a')]);router[_0x800d('0x1b')](_0x800d('0x13'),auth['isAuthenticated'](),controller[_0x800d('0x1c')]);module[_0x800d('0x1d')]=router; \ No newline at end of file +var _0x0cc9=['fax','addTags','put','faxinteraction:update','update','faxinteraction:destroy','destroy','delete','removeTags','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','/:id/tags','tracked'];(function(_0x4e3d23,_0xb8b664){var _0xb09bdf=function(_0x3a75eb){while(--_0x3a75eb){_0x4e3d23['push'](_0x4e3d23['shift']());}};_0xb09bdf(++_0xb8b664);}(_0x0cc9,0x121));var _0x90cc=function(_0xf738ad,_0x5e1d7f){_0xf738ad=_0xf738ad-0x0;var _0x598570=_0x0cc9[_0xf738ad];return _0x598570;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x90cc('0x0'));var timeout=require(_0x90cc('0x1'));var express=require(_0x90cc('0x2'));var router=express[_0x90cc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x90cc('0x4'));var interaction=require(_0x90cc('0x5'));var config=require(_0x90cc('0x6'));var controller=require('./faxInteraction.controller');router[_0x90cc('0x7')]('/',auth[_0x90cc('0x8')](),controller[_0x90cc('0x9')]);router['get'](_0x90cc('0xa'),auth[_0x90cc('0x8')](),controller[_0x90cc('0xb')]);router['get'](_0x90cc('0xc'),auth[_0x90cc('0x8')](),controller[_0x90cc('0xd')]);router['get'](_0x90cc('0xe'),auth[_0x90cc('0x8')](),controller[_0x90cc('0xf')]);router[_0x90cc('0x7')](_0x90cc('0x10'),auth[_0x90cc('0x8')](),controller['download']);router[_0x90cc('0x11')]('/',auth[_0x90cc('0x8')](),controller[_0x90cc('0x12')]);router[_0x90cc('0x11')](_0x90cc('0xe'),auth[_0x90cc('0x8')](),controller['addMessage']);router['post'](_0x90cc('0x13'),auth[_0x90cc('0x8')](),interaction[_0x90cc('0x14')](_0x90cc('0x15'),'faxinteraction:addtags'),controller[_0x90cc('0x16')]);router[_0x90cc('0x17')]('/:id',auth[_0x90cc('0x8')](),interaction[_0x90cc('0x14')](_0x90cc('0x15'),_0x90cc('0x18')),controller[_0x90cc('0x19')]);router['delete'](_0x90cc('0xc'),auth[_0x90cc('0x8')](),interaction[_0x90cc('0x14')](_0x90cc('0x15'),_0x90cc('0x1a')),controller[_0x90cc('0x1b')]);router[_0x90cc('0x1c')](_0x90cc('0x13'),auth[_0x90cc('0x8')](),controller[_0x90cc('0x1d')]);module[_0x90cc('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 6ae7e05..9cd5e0c 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 _0xc3b5=['ENUM','out','DATE','TEXT','medium','BOOLEAN'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x295ae2,_0x570e04){_0x295ae2=_0x295ae2-0x0;var _0x48f7a2=_0xc3b5[_0x295ae2];return _0x48f7a2;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x5c3b('0x0')](_0x5c3b('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x5c3b('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5c3b('0x3')]('in',_0x5c3b('0x4')),'defaultValue':_0x5c3b('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x5c3b('0x0')],'defaultValue':null},'readAt':{'type':Sequelize[_0x5c3b('0x5')]}}; \ No newline at end of file +var _0x028d=['ENUM','out','DATE','exports','TEXT','BOOLEAN'];(function(_0x1fd496,_0x2880a3){var _0x15eaa5=function(_0x429686){while(--_0x429686){_0x1fd496['push'](_0x1fd496['shift']());}};_0x15eaa5(++_0x2880a3);}(_0x028d,0xff));var _0xd028=function(_0x44fdfb,_0x3ca531){_0x44fdfb=_0x44fdfb-0x0;var _0x3b3afc=_0x028d[_0x44fdfb];return _0x3b3afc;};'use strict';var Sequelize=require('sequelize');module[_0xd028('0x0')]={'body':{'type':Sequelize[_0xd028('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd028('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd028('0x3')]('in',_0xd028('0x4')),'defaultValue':_0xd028('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xd028('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xd028('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index a808846..06e4aca 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 _0xc175=['nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','show','keys','find','params','describe','fax-interactions','accept','fax','body','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','FaxInteraction','isNil','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','agent','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','FaxInteractionId','info','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','fullname','email','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','client','http','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','destroy','name','send','index','FaxMessage','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty'];(function(_0xa4c7cb,_0x5c796f){var _0x20fc4d=function(_0x4fa2b3){while(--_0x4fa2b3){_0xa4c7cb['push'](_0xa4c7cb['shift']());}};_0x20fc4d(++_0x5c796f);}(_0xc175,0x1f3));var _0x5c17=function(_0x25cacf,_0xaeee38){_0x25cacf=_0x25cacf-0x0;var _0x373ea3=_0xc175[_0x25cacf];return _0x373ea3;};'use strict';var emlformat=require(_0x5c17('0x0'));var rimraf=require(_0x5c17('0x1'));var zipdir=require(_0x5c17('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c17('0x3'));var moment=require(_0x5c17('0x4'));var BPromise=require(_0x5c17('0x5'));var Mustache=require(_0x5c17('0x6'));var util=require(_0x5c17('0x7'));var path=require(_0x5c17('0x8'));var sox=require(_0x5c17('0x9'));var csv=require(_0x5c17('0xa'));var ejs=require(_0x5c17('0xb'));var fs=require('fs');var fs_extra=require(_0x5c17('0xc'));var _=require(_0x5c17('0xd'));var squel=require('squel');var crypto=require(_0x5c17('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5c17('0xa'));var querystring=require(_0x5c17('0xf'));var Papa=require(_0x5c17('0x10'));var Redis=require(_0x5c17('0x11'));var authService=require(_0x5c17('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5c17('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c17('0x14'))(_0x5c17('0x15'));var utils=require(_0x5c17('0x16'));var config=require(_0x5c17('0x17'));var licenseUtil=require(_0x5c17('0x18'));var db=require(_0x5c17('0x19'))['db'];config[_0x5c17('0x1a')]=_['defaults'](config[_0x5c17('0x1a')],{'host':_0x5c17('0x1b'),'port':0x18eb});var socket=require(_0x5c17('0x1c'))(new Redis(config['redis']));require(_0x5c17('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x5c17('0x1e')][_0x5c17('0x1f')]({'port':0x232c});var client9002=jayson[_0x5c17('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x598e79,_0x8ac2e3,_0x4f5af5,_0x2a7545){return new BPromise(function(_0x2b9539,_0x46737b){var _0x547945=_0x2a7545||client;return _0x547945[_0x5c17('0x20')](_0x598e79,_0x4f5af5)[_0x5c17('0x21')](function(_0x43a1b6){logger['info'](_0x5c17('0x22'),_0x8ac2e3,_0x5c17('0x23'));logger[_0x5c17('0x24')](_0x5c17('0x25'),_0x8ac2e3,_0x5c17('0x23'),JSON[_0x5c17('0x26')](_0x43a1b6));if(_0x43a1b6[_0x5c17('0x27')]){if(_0x43a1b6[_0x5c17('0x27')][_0x5c17('0x28')]===0x1f4){logger[_0x5c17('0x27')](_0x5c17('0x22'),_0x8ac2e3,_0x43a1b6['error'][_0x5c17('0x29')]);return _0x46737b(_0x43a1b6[_0x5c17('0x27')][_0x5c17('0x29')]);}logger[_0x5c17('0x27')]('FaxMessage,\x20%s,\x20%s',_0x8ac2e3,_0x43a1b6[_0x5c17('0x27')][_0x5c17('0x29')]);return _0x2b9539(_0x43a1b6[_0x5c17('0x27')][_0x5c17('0x29')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x8ac2e3,_0x5c17('0x23'));_0x2b9539(_0x43a1b6[_0x5c17('0x2a')][_0x5c17('0x29')]);}})[_0x5c17('0x2b')](function(_0x124219){logger[_0x5c17('0x27')]('FaxMessage,\x20%s,\x20%s',_0x8ac2e3,_0x124219);_0x46737b(_0x124219);});});}function respondWithStatusCode(_0x2b7232,_0x4c3585){_0x4c3585=_0x4c3585||0xcc;return function(_0x489c20){if(_0x489c20){return _0x2b7232[_0x5c17('0x2c')](_0x4c3585);}return _0x2b7232[_0x5c17('0x2d')](_0x4c3585)[_0x5c17('0x2e')]();};}function respondWithResult(_0x4bf43f,_0x15f6ce){_0x15f6ce=_0x15f6ce||0xc8;return function(_0x130d59){if(_0x130d59){return _0x4bf43f[_0x5c17('0x2d')](_0x15f6ce)['json'](_0x130d59);}};}function respondWithFilteredResult(_0x464b19,_0x4e53af){return function(_0x52e00b){if(_0x52e00b){var _0xff2398=typeof _0x4e53af['offset']===_0x5c17('0x2f')&&typeof _0x4e53af[_0x5c17('0x30')]===_0x5c17('0x2f');var _0x50b53e=_0x52e00b['count'];var _0x4578e0=_0xff2398?0x0:_0x4e53af['offset'];var _0x40247b=_0xff2398?_0x52e00b[_0x5c17('0x31')]:_0x4e53af[_0x5c17('0x32')]+_0x4e53af[_0x5c17('0x30')];var _0x438acc;if(_0x40247b>=_0x50b53e){_0x40247b=_0x50b53e;_0x438acc=0xc8;}else{_0x438acc=0xce;}_0x464b19[_0x5c17('0x2d')](_0x438acc);return _0x464b19['set'](_0x5c17('0x33'),_0x4578e0+'-'+_0x40247b+'/'+_0x50b53e)[_0x5c17('0x34')](_0x52e00b);}return null;};}function patchUpdates(_0x709585){return function(_0x515426){try{jsonpatch['apply'](_0x515426,_0x709585,!![]);}catch(_0x535736){return BPromise[_0x5c17('0x35')](_0x535736);}return _0x515426[_0x5c17('0x36')]();};}function saveUpdates(_0x57ae6e,_0x14987c){return function(_0x583782){if(_0x583782){return _0x583782[_0x5c17('0x37')](_0x57ae6e)['then'](function(_0x5a9248){return _0x5a9248;});}return null;};}function removeEntity(_0x3dba99,_0x9dc95e){return function(_0x9a37fa){if(_0x9a37fa){return _0x9a37fa[_0x5c17('0x38')]()[_0x5c17('0x21')](function(){_0x3dba99[_0x5c17('0x2d')](0xcc)[_0x5c17('0x2e')]();});}};}function handleEntityNotFound(_0x5ab325,_0x281110){return function(_0x4b0435){if(!_0x4b0435){_0x5ab325['sendStatus'](0x194);}return _0x4b0435;};}function handleError(_0xe4f90a,_0x2f1b2b){_0x2f1b2b=_0x2f1b2b||0x1f4;return function(_0x587930){logger[_0x5c17('0x27')](_0x587930['stack']);if(_0x587930[_0x5c17('0x39')]){delete _0x587930[_0x5c17('0x39')];}_0xe4f90a[_0x5c17('0x2d')](_0x2f1b2b)[_0x5c17('0x3a')](_0x587930);};}exports[_0x5c17('0x3b')]=function(_0x4340f5,_0x5307e8){var _0x21e619={},_0x43e891={},_0x494b85={'count':0x0,'rows':[]};var _0x15082d=_['map'](db[_0x5c17('0x3c')][_0x5c17('0x3d')],function(_0x4f829){return{'name':_0x4f829[_0x5c17('0x3e')],'type':_0x4f829[_0x5c17('0x3f')][_0x5c17('0x40')]};});_0x43e891[_0x5c17('0x41')]=_[_0x5c17('0x42')](_0x15082d,'name');_0x43e891[_0x5c17('0x43')]=_['keys'](_0x4340f5[_0x5c17('0x43')]);_0x43e891['filters']=_[_0x5c17('0x44')](_0x43e891[_0x5c17('0x41')],_0x43e891[_0x5c17('0x43')]);_0x21e619[_0x5c17('0x45')]=_[_0x5c17('0x44')](_0x43e891[_0x5c17('0x41')],qs[_0x5c17('0x46')](_0x4340f5[_0x5c17('0x43')][_0x5c17('0x46')]));_0x21e619[_0x5c17('0x45')]=_0x21e619['attributes'][_0x5c17('0x47')]?_0x21e619[_0x5c17('0x45')]:_0x43e891[_0x5c17('0x41')];if(!_0x4340f5[_0x5c17('0x43')][_0x5c17('0x48')](_0x5c17('0x49'))){_0x21e619[_0x5c17('0x30')]=qs[_0x5c17('0x30')](_0x4340f5[_0x5c17('0x43')][_0x5c17('0x30')]);_0x21e619[_0x5c17('0x32')]=qs[_0x5c17('0x32')](_0x4340f5[_0x5c17('0x43')][_0x5c17('0x32')]);}_0x21e619[_0x5c17('0x4a')]=qs[_0x5c17('0x4b')](_0x4340f5[_0x5c17('0x43')][_0x5c17('0x4b')]);_0x21e619[_0x5c17('0x4c')]=qs[_0x5c17('0x4d')](_['pick'](_0x4340f5['query'],_0x43e891['filters']),_0x15082d);if(_0x4340f5[_0x5c17('0x43')][_0x5c17('0x4e')]){_0x21e619[_0x5c17('0x4c')]=_[_0x5c17('0x4f')](_0x21e619[_0x5c17('0x4c')],{'$or':_['map'](_0x15082d,function(_0x2325ce){if(_0x2325ce[_0x5c17('0x3f')]!==_0x5c17('0x50')){var _0xc776fe={};_0xc776fe[_0x2325ce['name']]={'$like':'%'+_0x4340f5[_0x5c17('0x43')]['filter']+'%'};return _0xc776fe;}})});}_0x21e619=_[_0x5c17('0x4f')]({},_0x21e619,_0x4340f5[_0x5c17('0x51')]);var _0xc44b73={'where':_0x21e619[_0x5c17('0x4c')]};return db[_0x5c17('0x3c')][_0x5c17('0x31')](_0xc44b73)[_0x5c17('0x21')](function(_0x220baf){_0x494b85[_0x5c17('0x31')]=_0x220baf;if(_0x4340f5[_0x5c17('0x43')][_0x5c17('0x52')]){_0x21e619[_0x5c17('0x53')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x21e619);})[_0x5c17('0x21')](function(_0x56b294){_0x494b85['rows']=_0x56b294;return _0x494b85;})['then'](respondWithFilteredResult(_0x5307e8,_0x21e619))['catch'](handleError(_0x5307e8,null));};exports[_0x5c17('0x54')]=function(_0x2777d0,_0x4e76fd){var _0x1f727a={'raw':!![],'where':{'id':_0x2777d0['params']['id']}},_0x2f07c1={};_0x2f07c1[_0x5c17('0x41')]=_[_0x5c17('0x55')](db[_0x5c17('0x3c')][_0x5c17('0x3d')]);_0x2f07c1['query']=_['keys'](_0x2777d0[_0x5c17('0x43')]);_0x2f07c1[_0x5c17('0x4d')]=_[_0x5c17('0x44')](_0x2f07c1[_0x5c17('0x41')],_0x2f07c1['query']);_0x1f727a['attributes']=_[_0x5c17('0x44')](_0x2f07c1[_0x5c17('0x41')],qs[_0x5c17('0x46')](_0x2777d0[_0x5c17('0x43')][_0x5c17('0x46')]));_0x1f727a[_0x5c17('0x45')]=_0x1f727a[_0x5c17('0x45')]['length']?_0x1f727a[_0x5c17('0x45')]:_0x2f07c1[_0x5c17('0x41')];if(_0x2777d0[_0x5c17('0x43')]['includeAll']){_0x1f727a[_0x5c17('0x53')]=[{'all':!![]}];}_0x1f727a=_[_0x5c17('0x4f')]({},_0x1f727a,_0x2777d0[_0x5c17('0x51')]);return db[_0x5c17('0x3c')][_0x5c17('0x56')](_0x1f727a)[_0x5c17('0x21')](handleEntityNotFound(_0x4e76fd,null))[_0x5c17('0x21')](respondWithResult(_0x4e76fd,null))['catch'](handleError(_0x4e76fd,null));};exports['update']=function(_0x30a9df,_0x452749){if(_0x30a9df['body']['id']){delete _0x30a9df['body']['id'];}return db[_0x5c17('0x3c')][_0x5c17('0x56')]({'where':{'id':_0x30a9df[_0x5c17('0x57')]['id']}})[_0x5c17('0x21')](handleEntityNotFound(_0x452749,null))[_0x5c17('0x21')](saveUpdates(_0x30a9df['body'],null))[_0x5c17('0x21')](respondWithResult(_0x452749,null))['catch'](handleError(_0x452749,null));};exports[_0x5c17('0x38')]=function(_0x52bd5a,_0x5ac5d5){return db['FaxMessage'][_0x5c17('0x56')]({'where':{'id':_0x52bd5a[_0x5c17('0x57')]['id']}})[_0x5c17('0x21')](handleEntityNotFound(_0x5ac5d5,null))[_0x5c17('0x21')](removeEntity(_0x5ac5d5,null))[_0x5c17('0x2b')](handleError(_0x5ac5d5,null));};exports[_0x5c17('0x58')]=function(_0x349fb1,_0x5565d9){return db[_0x5c17('0x3c')][_0x5c17('0x58')]()[_0x5c17('0x21')](respondWithResult(_0x5565d9,null))[_0x5c17('0x2b')](handleError(_0x5565d9,null));};var interaction_log=require(_0x5c17('0x14'))(_0x5c17('0x59'));exports[_0x5c17('0x5a')]=function(_0x3b9396,_0x48fb8e,_0x218605){var _0x9d65dd={'agent':{},'channel':_0x5c17('0x5b')};if(_0x3b9396['body']['id']){delete _0x3b9396[_0x5c17('0x5c')]['id'];}_0x3b9396['body']['read']=!![];_0x3b9396['body'][_0x5c17('0x5d')]=moment()[_0x5c17('0x5e')](_0x5c17('0x5f'));_0x3b9396[_0x5c17('0x5c')][_0x5c17('0x60')]=_0x3b9396[_0x5c17('0x5c')][_0x5c17('0x60')]||_0x3b9396['user']['id'];_0x9d65dd['agent']['id']=_0x3b9396['body']['UserId'];return db[_0x5c17('0x3c')][_0x5c17('0x56')]({'where':{'id':_0x3b9396[_0x5c17('0x57')]['id'],'UserId':null}})[_0x5c17('0x21')](handleEntityNotFound(_0x48fb8e,null))['then'](saveUpdates(_0x3b9396[_0x5c17('0x5c')],null))['then'](function(_0x2ec4c9){if(_0x2ec4c9){_0x9d65dd[_0x5c17('0x29')]=_0x2ec4c9[_0x5c17('0x61')]({'plain':!![]});return db[_0x5c17('0x62')][_0x5c17('0x56')]({'where':{'id':_0x2ec4c9['FaxInteractionId']}});}return null;})[_0x5c17('0x21')](handleEntityNotFound(_0x48fb8e,null))[_0x5c17('0x21')](function(_0x27ca99){if(_0x27ca99){return _0x27ca99[_0x5c17('0x37')]({'UserId':_0x3b9396[_0x5c17('0x5c')]['UserId'],'read1stAt':_[_0x5c17('0x63')](_0x27ca99['read1stAt'])?moment()[_0x5c17('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5c17('0x21')](function(_0x27977e){if(_0x27977e){_0x9d65dd['interaction']=_0x27977e[_0x5c17('0x61')]({'plain':!![]});interaction_log['info'](_0x5c17('0x64'),_0x3b9396['user']['id'],_0x3b9396['user'][_0x5c17('0x39')],_0x3b9396[_0x5c17('0x65')]['role'],_0x9d65dd[_0x5c17('0x66')]['id'],_0x3b9396[_0x5c17('0x5c')]?JSON[_0x5c17('0x26')](_0x3b9396[_0x5c17('0x5c')]):_0x5c17('0x67'));return respondWithRpcPromise('AcceptMessage',_0x5c17('0x68'),_0x9d65dd);}return null;})['then'](function(_0x4939d0){var _0x4540b4=_0x5c17('0x69')+_0x4939d0[_0x5c17('0x29')][_0x5c17('0x6a')];return db['sequelize'][_0x5c17('0x43')](_0x4540b4,{'type':db[_0x5c17('0x6b')][_0x5c17('0x6c')][_0x5c17('0x6d')],'raw':!![]})[_0x5c17('0x21')](function(_0x4b638c){return _0x4b638c;});})[_0x5c17('0x21')](function(_0x2385f5){if(_0x2385f5){_0x9d65dd[_0x5c17('0x29')][_0x5c17('0x6e')]=_0x2385f5[0x0];if(!_0x3b9396[_0x5c17('0x5c')][_0x5c17('0x60')])return;return db[_0x5c17('0x6f')]['find']({'where':{'id':_0x3b9396[_0x5c17('0x5c')][_0x5c17('0x60')],'role':_0x5c17('0x70')},'attributes':['id',_0x5c17('0x39'),'fullname','email',_0x5c17('0x71')],'raw':!![]});}return null;})[_0x5c17('0x21')](function(_0x220d01){if(!_0x220d01)return null;_0x9d65dd[_0x5c17('0x29')][_0x5c17('0x70')]=_0x220d01;return _0x9d65dd;})['then'](function(_0x36af33){if(_0x36af33){if(_0x3b9396[_0x5c17('0x5c')][_0x5c17('0x72')]){_0x9d65dd['message'][_0x5c17('0x73')]=util[_0x5c17('0x5e')](_0x5c17('0x74'),_0x3b9396[_0x5c17('0x65')]['name']);_0x9d65dd[_0x5c17('0x29')][_0x5c17('0x75')]=_0x9d65dd[_0x5c17('0x75')];_0x9d65dd['message'][_0x5c17('0x76')]=_0x9d65dd[_0x5c17('0x75')];_0x9d65dd[_0x5c17('0x29')][_0x5c17('0x77')]=_0x5c17('0x5a');return respondWithRpcPromise(_0x5c17('0x78'),'EventManager',{'event':_0x5c17('0x79'),'message':_0x9d65dd[_0x5c17('0x29')]},client9002)[_0x5c17('0x21')](function(){return _0x9d65dd;});}return _0x9d65dd;}return null;})[_0x5c17('0x21')](respondWithResult(_0x48fb8e,null))[_0x5c17('0x2b')](handleError(_0x48fb8e,null));};var interaction_log=require(_0x5c17('0x14'))(_0x5c17('0x59'));exports[_0x5c17('0x35')]=function(_0x4f4a62,_0x55c6f0,_0x5ba6b5){var _0x233005={'agent':{},'channel':_0x5c17('0x5b')};if(_0x4f4a62[_0x5c17('0x5c')]['id']){delete _0x4f4a62['body']['id'];}_0x4f4a62[_0x5c17('0x5c')][_0x5c17('0x60')]=_0x4f4a62['body'][_0x5c17('0x60')]||_0x4f4a62['user']['id'];_0x233005[_0x5c17('0x70')]['id']=_0x4f4a62[_0x5c17('0x5c')][_0x5c17('0x60')];return db[_0x5c17('0x3c')]['find']({'where':{'id':_0x4f4a62[_0x5c17('0x57')]['id'],'UserId':null}})[_0x5c17('0x21')](handleEntityNotFound(_0x55c6f0,null))[_0x5c17('0x21')](function(_0x2531c8){if(_0x2531c8){_0x233005[_0x5c17('0x29')]=_0x2531c8[_0x5c17('0x61')]({'plain':!![]});return db[_0x5c17('0x62')]['find']({'where':{'id':_0x2531c8[_0x5c17('0x7a')]}});}return null;})[_0x5c17('0x21')](handleEntityNotFound(_0x55c6f0,null))[_0x5c17('0x21')](function(_0x48ef54){if(_0x48ef54){_0x233005['interaction']=_0x48ef54[_0x5c17('0x61')]({'plain':!![]});interaction_log[_0x5c17('0x7b')](_0x5c17('0x7c'),_0x4f4a62['user']['id'],_0x4f4a62[_0x5c17('0x65')]['name'],_0x4f4a62[_0x5c17('0x65')]['role'],_0x233005['interaction']['id'],_0x4f4a62[_0x5c17('0x5c')]?JSON[_0x5c17('0x26')](_0x4f4a62[_0x5c17('0x5c')]):_0x5c17('0x67'));return respondWithRpcPromise(_0x5c17('0x7d'),_0x5c17('0x7e'),_0x233005);}return null;})[_0x5c17('0x21')](function(_0x21645b){var _0x1eadca=_0x5c17('0x69')+_0x21645b['message'][_0x5c17('0x6a')];return db[_0x5c17('0x7f')][_0x5c17('0x43')](_0x1eadca,{'type':db['Sequelize'][_0x5c17('0x6c')][_0x5c17('0x6d')],'raw':!![]})[_0x5c17('0x21')](function(_0x1bc8df){return _0x1bc8df;});})[_0x5c17('0x21')](function(_0x50bf6c){if(_0x50bf6c){_0x233005['message'][_0x5c17('0x6e')]=_0x50bf6c[0x0];if(!_0x4f4a62[_0x5c17('0x5c')]['UserId'])return;return db[_0x5c17('0x6f')]['find']({'where':{'id':_0x4f4a62[_0x5c17('0x5c')][_0x5c17('0x60')],'role':_0x5c17('0x70')},'attributes':['id',_0x5c17('0x39'),_0x5c17('0x80'),_0x5c17('0x81'),'internal'],'raw':!![]});}return null;})[_0x5c17('0x21')](function(_0x32da2e){if(!_0x32da2e)return null;_0x233005['message'][_0x5c17('0x70')]=_0x32da2e;return _0x233005;})[_0x5c17('0x21')](function(_0x4d0915){if(_0x4d0915){_0x4d0915[_0x5c17('0x29')][_0x5c17('0x73')]=util[_0x5c17('0x5e')](_0x5c17('0x74'),_0x4f4a62['user'][_0x5c17('0x39')]);_0x4d0915[_0x5c17('0x29')]['channel']=_0x233005[_0x5c17('0x75')];_0x4d0915[_0x5c17('0x29')][_0x5c17('0x76')]=_0x233005[_0x5c17('0x75')];_0x4d0915['message'][_0x5c17('0x77')]=_0x5c17('0x35');respondWithRpcPromise('EventManager',_0x5c17('0x78'),{'event':'rejectmessage','message':_0x4d0915[_0x5c17('0x29')]},client9002);return _0x233005;}return null;})['then'](respondWithResult(_0x55c6f0,null))[_0x5c17('0x2b')](handleError(_0x55c6f0,null));};exports['create']=function(_0x4a4042,_0x17cac7){var _0x48ea48;return db[_0x5c17('0x3c')]['create'](_0x4a4042[_0x5c17('0x5c')],{})['then'](function(_0x2d7a1c){_0x48ea48=_0x2d7a1c;return db[_0x5c17('0x82')][_0x5c17('0x83')]({'where':{'id':_0x48ea48[_0x5c17('0x6a')]}});})['then'](function(_0x273091){if(_[_0x5c17('0x63')](_0x273091)){return;}else{_0x48ea48[_0x5c17('0x5b')]=_0x273091[_0x5c17('0x5b')];return db[_0x5c17('0x84')][_0x5c17('0x83')]({'where':{'id':_0x48ea48[_0x5c17('0x85')]}});}})[_0x5c17('0x21')](function(_0x3a84e3){return respondWithRpcPromise(_0x5c17('0x86'),'SendFax',{'FaxAccountId':_[_0x5c17('0x63')](_0x4a4042[_0x5c17('0x5c')])?undefined:_0x4a4042[_0x5c17('0x5c')][_0x5c17('0x87')],'path':_['isNil'](_0x3a84e3)?undefined:util[_0x5c17('0x5e')](_0x5c17('0x88'),_0x3a84e3[_0x5c17('0x89')]),'fax':_[_0x5c17('0x63')](_0x48ea48[_0x5c17('0x5b')])?undefined:_0x48ea48[_0x5c17('0x5b')],'AttachmentId':_0x48ea48[_0x5c17('0x85')]},client9002);})['then'](respondWithResult(_0x17cac7,0xc9))[_0x5c17('0x2b')](handleError(_0x17cac7,null));};exports[_0x5c17('0x8a')]=function(_0x3a79ef,_0x22765d){var _0x28e106=path[_0x5c17('0x8b')](config[_0x5c17('0x8c')],_0x5c17('0x8d'),_0x5c17('0x8e'),'attachments');return db[_0x5c17('0x3c')]['find']({'where':{'id':_0x3a79ef[_0x5c17('0x57')]['id']},'include':[{'model':db[_0x5c17('0x84')],'as':_0x5c17('0x84')}]})[_0x5c17('0x21')](handleEntityNotFound(_0x22765d,null))['then'](function(_0x332a1a){if(_0x332a1a){return _0x22765d[_0x5c17('0x8a')](path[_0x5c17('0x8b')](_0x28e106,_0x332a1a[_0x5c17('0x84')][_0x5c17('0x89')]));}})[_0x5c17('0x2b')](handleError(_0x22765d,null));}; \ No newline at end of file +var _0x1f12=['describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','update','isNil','read1stAt','interaction','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','message','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','interface','SIP/%s','channel','event','EventManager','fax-interactions','fax','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','internal','rejectmessage','create','CmContact','findOne','Attachment','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','join','server','files','attachments','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','FaxMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','stack','name','send','rawAttributes','fieldName','type','key','map','query','keys','filters','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','FaxMessage','include','findAll','show','params','includeAll','find','body'];(function(_0x569fef,_0x49c37a){var _0x11f20b=function(_0x3721d8){while(--_0x3721d8){_0x569fef['push'](_0x569fef['shift']());}};_0x11f20b(++_0x49c37a);}(_0x1f12,0x156));var _0x21f1=function(_0x3b4fb4,_0x5526ad){_0x3b4fb4=_0x3b4fb4-0x0;var _0x35325d=_0x1f12[_0x3b4fb4];return _0x35325d;};'use strict';var emlformat=require(_0x21f1('0x0'));var rimraf=require(_0x21f1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x21f1('0x2'));var rp=require(_0x21f1('0x3'));var moment=require(_0x21f1('0x4'));var BPromise=require(_0x21f1('0x5'));var Mustache=require('mustache');var util=require(_0x21f1('0x6'));var path=require(_0x21f1('0x7'));var sox=require(_0x21f1('0x8'));var csv=require(_0x21f1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x21f1('0xa'));var _=require(_0x21f1('0xb'));var squel=require(_0x21f1('0xc'));var crypto=require(_0x21f1('0xd'));var jsforce=require(_0x21f1('0xe'));var deskjs=require(_0x21f1('0xf'));var toCsv=require(_0x21f1('0x9'));var querystring=require(_0x21f1('0x10'));var Papa=require('papaparse');var Redis=require(_0x21f1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x21f1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x21f1('0x13'));var logger=require(_0x21f1('0x14'))(_0x21f1('0x15'));var utils=require('../../config/utils');var config=require(_0x21f1('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x21f1('0x17')]=_[_0x21f1('0x18')](config[_0x21f1('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x21f1('0x19'))(new Redis(config[_0x21f1('0x17')]));require('./faxMessage.socket')[_0x21f1('0x1a')](socket);var jayson=require(_0x21f1('0x1b'));var client=jayson[_0x21f1('0x1c')][_0x21f1('0x1d')]({'port':0x232c});var client9002=jayson[_0x21f1('0x1c')][_0x21f1('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x3f335b,_0x4405e5,_0x2dac7e,_0x35baa9){return new BPromise(function(_0x44c4e0,_0x3d17ff){var _0x5054b3=_0x35baa9||client;return _0x5054b3[_0x21f1('0x1e')](_0x3f335b,_0x2dac7e)[_0x21f1('0x1f')](function(_0x3cc634){logger[_0x21f1('0x20')]('FaxMessage,\x20%s,\x20%s',_0x4405e5,_0x21f1('0x21'));logger[_0x21f1('0x22')](_0x21f1('0x23'),_0x4405e5,_0x21f1('0x21'),JSON['stringify'](_0x3cc634));if(_0x3cc634[_0x21f1('0x24')]){if(_0x3cc634['error'][_0x21f1('0x25')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x4405e5,_0x3cc634[_0x21f1('0x24')]['message']);return _0x3d17ff(_0x3cc634[_0x21f1('0x24')]['message']);}logger[_0x21f1('0x24')](_0x21f1('0x26'),_0x4405e5,_0x3cc634[_0x21f1('0x24')]['message']);return _0x44c4e0(_0x3cc634[_0x21f1('0x24')]['message']);}else{logger[_0x21f1('0x20')](_0x21f1('0x26'),_0x4405e5,_0x21f1('0x21'));_0x44c4e0(_0x3cc634[_0x21f1('0x27')]['message']);}})[_0x21f1('0x28')](function(_0x3ef86d){logger[_0x21f1('0x24')](_0x21f1('0x26'),_0x4405e5,_0x3ef86d);_0x3d17ff(_0x3ef86d);});});}function respondWithStatusCode(_0x111f8f,_0x4dbe5b){_0x4dbe5b=_0x4dbe5b||0xcc;return function(_0x5738f5){if(_0x5738f5){return _0x111f8f[_0x21f1('0x29')](_0x4dbe5b);}return _0x111f8f[_0x21f1('0x2a')](_0x4dbe5b)[_0x21f1('0x2b')]();};}function respondWithResult(_0x3ce40f,_0x4a48c0){_0x4a48c0=_0x4a48c0||0xc8;return function(_0x36d148){if(_0x36d148){return _0x3ce40f[_0x21f1('0x2a')](_0x4a48c0)[_0x21f1('0x2c')](_0x36d148);}};}function respondWithFilteredResult(_0x27fbc9,_0x42f4c8){return function(_0x2103fc){if(_0x2103fc){var _0x1da177=typeof _0x42f4c8[_0x21f1('0x2d')]===_0x21f1('0x2e')&&typeof _0x42f4c8[_0x21f1('0x2f')]===_0x21f1('0x2e');var _0x51f2ec=_0x2103fc['count'];var _0x1dccf1=_0x1da177?0x0:_0x42f4c8[_0x21f1('0x2d')];var _0x1ff87c=_0x1da177?_0x2103fc[_0x21f1('0x30')]:_0x42f4c8[_0x21f1('0x2d')]+_0x42f4c8[_0x21f1('0x2f')];var _0x31b0ee;if(_0x1ff87c>=_0x51f2ec){_0x1ff87c=_0x51f2ec;_0x31b0ee=0xc8;}else{_0x31b0ee=0xce;}_0x27fbc9[_0x21f1('0x2a')](_0x31b0ee);return _0x27fbc9[_0x21f1('0x31')](_0x21f1('0x32'),_0x1dccf1+'-'+_0x1ff87c+'/'+_0x51f2ec)[_0x21f1('0x2c')](_0x2103fc);}return null;};}function patchUpdates(_0x58697a){return function(_0x3d38f3){try{jsonpatch[_0x21f1('0x33')](_0x3d38f3,_0x58697a,!![]);}catch(_0x475ef1){return BPromise[_0x21f1('0x34')](_0x475ef1);}return _0x3d38f3[_0x21f1('0x35')]();};}function saveUpdates(_0x389804,_0x47569d){return function(_0x3edfa0){if(_0x3edfa0){return _0x3edfa0['update'](_0x389804)['then'](function(_0x3e422e){return _0x3e422e;});}return null;};}function removeEntity(_0x18c9f6,_0x1a7cbb){return function(_0x25226a){if(_0x25226a){return _0x25226a[_0x21f1('0x36')]()[_0x21f1('0x1f')](function(){_0x18c9f6[_0x21f1('0x2a')](0xcc)[_0x21f1('0x2b')]();});}};}function handleEntityNotFound(_0x450af8,_0x40cfda){return function(_0x939283){if(!_0x939283){_0x450af8['sendStatus'](0x194);}return _0x939283;};}function handleError(_0x14dbc2,_0x3275fd){_0x3275fd=_0x3275fd||0x1f4;return function(_0x5d2bbf){logger['error'](_0x5d2bbf[_0x21f1('0x37')]);if(_0x5d2bbf['name']){delete _0x5d2bbf[_0x21f1('0x38')];}_0x14dbc2[_0x21f1('0x2a')](_0x3275fd)[_0x21f1('0x39')](_0x5d2bbf);};}exports['index']=function(_0x17a7e3,_0x1568c){var _0x34b5a5={},_0x1b6d47={},_0x440cb6={'count':0x0,'rows':[]};var _0x404277=_['map'](db['FaxMessage'][_0x21f1('0x3a')],function(_0x3d9570){return{'name':_0x3d9570[_0x21f1('0x3b')],'type':_0x3d9570[_0x21f1('0x3c')][_0x21f1('0x3d')]};});_0x1b6d47['model']=_[_0x21f1('0x3e')](_0x404277,'name');_0x1b6d47[_0x21f1('0x3f')]=_[_0x21f1('0x40')](_0x17a7e3['query']);_0x1b6d47[_0x21f1('0x41')]=_['intersection'](_0x1b6d47['model'],_0x1b6d47['query']);_0x34b5a5[_0x21f1('0x42')]=_[_0x21f1('0x43')](_0x1b6d47['model'],qs[_0x21f1('0x44')](_0x17a7e3['query'][_0x21f1('0x44')]));_0x34b5a5['attributes']=_0x34b5a5[_0x21f1('0x42')][_0x21f1('0x45')]?_0x34b5a5[_0x21f1('0x42')]:_0x1b6d47[_0x21f1('0x46')];if(!_0x17a7e3[_0x21f1('0x3f')][_0x21f1('0x47')](_0x21f1('0x48'))){_0x34b5a5[_0x21f1('0x2f')]=qs[_0x21f1('0x2f')](_0x17a7e3[_0x21f1('0x3f')]['limit']);_0x34b5a5['offset']=qs[_0x21f1('0x2d')](_0x17a7e3[_0x21f1('0x3f')]['offset']);}_0x34b5a5[_0x21f1('0x49')]=qs[_0x21f1('0x4a')](_0x17a7e3[_0x21f1('0x3f')][_0x21f1('0x4a')]);_0x34b5a5[_0x21f1('0x4b')]=qs[_0x21f1('0x41')](_['pick'](_0x17a7e3[_0x21f1('0x3f')],_0x1b6d47[_0x21f1('0x41')]),_0x404277);if(_0x17a7e3['query'][_0x21f1('0x4c')]){_0x34b5a5[_0x21f1('0x4b')]=_[_0x21f1('0x4d')](_0x34b5a5[_0x21f1('0x4b')],{'$or':_['map'](_0x404277,function(_0x111399){if(_0x111399['type']!=='VIRTUAL'){var _0x57ff83={};_0x57ff83[_0x111399[_0x21f1('0x38')]]={'$like':'%'+_0x17a7e3[_0x21f1('0x3f')][_0x21f1('0x4c')]+'%'};return _0x57ff83;}})});}_0x34b5a5=_[_0x21f1('0x4d')]({},_0x34b5a5,_0x17a7e3[_0x21f1('0x4e')]);var _0x40475a={'where':_0x34b5a5['where']};return db[_0x21f1('0x4f')][_0x21f1('0x30')](_0x40475a)[_0x21f1('0x1f')](function(_0x7be7a2){_0x440cb6[_0x21f1('0x30')]=_0x7be7a2;if(_0x17a7e3['query']['includeAll']){_0x34b5a5[_0x21f1('0x50')]=[{'all':!![]}];}return db['FaxMessage'][_0x21f1('0x51')](_0x34b5a5);})[_0x21f1('0x1f')](function(_0x50af44){_0x440cb6['rows']=_0x50af44;return _0x440cb6;})['then'](respondWithFilteredResult(_0x1568c,_0x34b5a5))['catch'](handleError(_0x1568c,null));};exports[_0x21f1('0x52')]=function(_0x317430,_0x5baff0){var _0xa8d5ef={'raw':!![],'where':{'id':_0x317430[_0x21f1('0x53')]['id']}},_0x1ea652={};_0x1ea652['model']=_[_0x21f1('0x40')](db['FaxMessage'][_0x21f1('0x3a')]);_0x1ea652[_0x21f1('0x3f')]=_[_0x21f1('0x40')](_0x317430[_0x21f1('0x3f')]);_0x1ea652[_0x21f1('0x41')]=_[_0x21f1('0x43')](_0x1ea652[_0x21f1('0x46')],_0x1ea652[_0x21f1('0x3f')]);_0xa8d5ef[_0x21f1('0x42')]=_['intersection'](_0x1ea652['model'],qs[_0x21f1('0x44')](_0x317430[_0x21f1('0x3f')][_0x21f1('0x44')]));_0xa8d5ef['attributes']=_0xa8d5ef[_0x21f1('0x42')][_0x21f1('0x45')]?_0xa8d5ef['attributes']:_0x1ea652[_0x21f1('0x46')];if(_0x317430[_0x21f1('0x3f')][_0x21f1('0x54')]){_0xa8d5ef[_0x21f1('0x50')]=[{'all':!![]}];}_0xa8d5ef=_[_0x21f1('0x4d')]({},_0xa8d5ef,_0x317430[_0x21f1('0x4e')]);return db[_0x21f1('0x4f')][_0x21f1('0x55')](_0xa8d5ef)['then'](handleEntityNotFound(_0x5baff0,null))[_0x21f1('0x1f')](respondWithResult(_0x5baff0,null))['catch'](handleError(_0x5baff0,null));};exports['update']=function(_0x10083a,_0x4366b3){if(_0x10083a[_0x21f1('0x56')]['id']){delete _0x10083a['body']['id'];}return db[_0x21f1('0x4f')][_0x21f1('0x55')]({'where':{'id':_0x10083a['params']['id']}})[_0x21f1('0x1f')](handleEntityNotFound(_0x4366b3,null))[_0x21f1('0x1f')](saveUpdates(_0x10083a['body'],null))['then'](respondWithResult(_0x4366b3,null))['catch'](handleError(_0x4366b3,null));};exports[_0x21f1('0x36')]=function(_0x33f40d,_0x5963db){return db[_0x21f1('0x4f')][_0x21f1('0x55')]({'where':{'id':_0x33f40d[_0x21f1('0x53')]['id']}})[_0x21f1('0x1f')](handleEntityNotFound(_0x5963db,null))['then'](removeEntity(_0x5963db,null))[_0x21f1('0x28')](handleError(_0x5963db,null));};exports[_0x21f1('0x57')]=function(_0x75469d,_0x361544){return db['FaxMessage'][_0x21f1('0x57')]()['then'](respondWithResult(_0x361544,null))['catch'](handleError(_0x361544,null));};var interaction_log=require(_0x21f1('0x14'))('fax-interactions');exports[_0x21f1('0x58')]=function(_0x28feb5,_0x5bb505,_0x8ddbc5){var _0x34726a={'agent':{},'channel':'fax'};if(_0x28feb5[_0x21f1('0x56')]['id']){delete _0x28feb5['body']['id'];}_0x28feb5[_0x21f1('0x56')][_0x21f1('0x59')]=!![];_0x28feb5[_0x21f1('0x56')][_0x21f1('0x5a')]=moment()[_0x21f1('0x5b')](_0x21f1('0x5c'));_0x28feb5['body']['UserId']=_0x28feb5[_0x21f1('0x56')][_0x21f1('0x5d')]||_0x28feb5[_0x21f1('0x5e')]['id'];_0x34726a[_0x21f1('0x5f')]['id']=_0x28feb5[_0x21f1('0x56')][_0x21f1('0x5d')];return db[_0x21f1('0x4f')][_0x21f1('0x55')]({'where':{'id':_0x28feb5[_0x21f1('0x53')]['id'],'UserId':null}})[_0x21f1('0x1f')](handleEntityNotFound(_0x5bb505,null))['then'](saveUpdates(_0x28feb5[_0x21f1('0x56')],null))[_0x21f1('0x1f')](function(_0x27f06d){if(_0x27f06d){_0x34726a['message']=_0x27f06d[_0x21f1('0x60')]({'plain':!![]});return db[_0x21f1('0x61')][_0x21f1('0x55')]({'where':{'id':_0x27f06d[_0x21f1('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x5bb505,null))[_0x21f1('0x1f')](function(_0x59233b){if(_0x59233b){return _0x59233b[_0x21f1('0x63')]({'UserId':_0x28feb5[_0x21f1('0x56')][_0x21f1('0x5d')],'read1stAt':_[_0x21f1('0x64')](_0x59233b[_0x21f1('0x65')])?moment()[_0x21f1('0x5b')](_0x21f1('0x5c')):undefined});}return null;})[_0x21f1('0x1f')](function(_0x109fbf){if(_0x109fbf){_0x34726a[_0x21f1('0x66')]=_0x109fbf[_0x21f1('0x60')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x28feb5['user']['id'],_0x28feb5['user'][_0x21f1('0x38')],_0x28feb5[_0x21f1('0x5e')][_0x21f1('0x67')],_0x34726a[_0x21f1('0x66')]['id'],_0x28feb5['body']?JSON[_0x21f1('0x68')](_0x28feb5['body']):_0x21f1('0x69'));return respondWithRpcPromise(_0x21f1('0x6a'),_0x21f1('0x6b'),_0x34726a);}return null;})[_0x21f1('0x1f')](function(_0x422c97){var _0x533827=_0x21f1('0x6c')+_0x422c97[_0x21f1('0x6d')][_0x21f1('0x6e')];return db[_0x21f1('0x6f')][_0x21f1('0x3f')](_0x533827,{'type':db[_0x21f1('0x70')][_0x21f1('0x71')][_0x21f1('0x72')],'raw':!![]})[_0x21f1('0x1f')](function(_0xfd8355){return _0xfd8355;});})[_0x21f1('0x1f')](function(_0x29d2bd){if(_0x29d2bd){_0x34726a[_0x21f1('0x6d')]['contact']=_0x29d2bd[0x0];if(!_0x28feb5[_0x21f1('0x56')][_0x21f1('0x5d')])return;return db[_0x21f1('0x73')]['find']({'where':{'id':_0x28feb5[_0x21f1('0x56')]['UserId'],'role':'agent'},'attributes':['id',_0x21f1('0x38'),_0x21f1('0x74'),_0x21f1('0x75'),'internal'],'raw':!![]});}return null;})['then'](function(_0x2d6abc){if(!_0x2d6abc)return null;_0x34726a[_0x21f1('0x6d')]['agent']=_0x2d6abc;return _0x34726a;})[_0x21f1('0x1f')](function(_0x456069){if(_0x456069){if(_0x28feb5[_0x21f1('0x56')]['manual']){_0x34726a[_0x21f1('0x6d')][_0x21f1('0x76')]=util[_0x21f1('0x5b')](_0x21f1('0x77'),_0x28feb5[_0x21f1('0x5e')][_0x21f1('0x38')]);_0x34726a[_0x21f1('0x6d')]['channel']=_0x34726a[_0x21f1('0x78')];_0x34726a['message']['motionChannel']=_0x34726a['channel'];_0x34726a['message'][_0x21f1('0x79')]=_0x21f1('0x58');return respondWithRpcPromise(_0x21f1('0x7a'),_0x21f1('0x7a'),{'event':'acceptmessage','message':_0x34726a['message']},client9002)['then'](function(){return _0x34726a;});}return _0x34726a;}return null;})[_0x21f1('0x1f')](respondWithResult(_0x5bb505,null))[_0x21f1('0x28')](handleError(_0x5bb505,null));};var interaction_log=require(_0x21f1('0x14'))(_0x21f1('0x7b'));exports[_0x21f1('0x34')]=function(_0x590d0e,_0x995a17,_0x110a54){var _0x4179a8={'agent':{},'channel':_0x21f1('0x7c')};if(_0x590d0e[_0x21f1('0x56')]['id']){delete _0x590d0e['body']['id'];}_0x590d0e[_0x21f1('0x56')][_0x21f1('0x5d')]=_0x590d0e[_0x21f1('0x56')][_0x21f1('0x5d')]||_0x590d0e[_0x21f1('0x5e')]['id'];_0x4179a8[_0x21f1('0x5f')]['id']=_0x590d0e['body']['UserId'];return db[_0x21f1('0x4f')][_0x21f1('0x55')]({'where':{'id':_0x590d0e[_0x21f1('0x53')]['id'],'UserId':null}})[_0x21f1('0x1f')](handleEntityNotFound(_0x995a17,null))['then'](function(_0x590990){if(_0x590990){_0x4179a8[_0x21f1('0x6d')]=_0x590990['get']({'plain':!![]});return db['FaxInteraction'][_0x21f1('0x55')]({'where':{'id':_0x590990[_0x21f1('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x995a17,null))['then'](function(_0x45903f){if(_0x45903f){_0x4179a8[_0x21f1('0x66')]=_0x45903f['get']({'plain':!![]});interaction_log[_0x21f1('0x20')](_0x21f1('0x7d'),_0x590d0e['user']['id'],_0x590d0e[_0x21f1('0x5e')][_0x21f1('0x38')],_0x590d0e[_0x21f1('0x5e')]['role'],_0x4179a8[_0x21f1('0x66')]['id'],_0x590d0e['body']?JSON['stringify'](_0x590d0e['body']):_0x21f1('0x69'));return respondWithRpcPromise(_0x21f1('0x7e'),_0x21f1('0x7f'),_0x4179a8);}return null;})[_0x21f1('0x1f')](function(_0xfdcf09){var _0x82f7f=_0x21f1('0x6c')+_0xfdcf09['message']['ContactId'];return db[_0x21f1('0x6f')]['query'](_0x82f7f,{'type':db[_0x21f1('0x70')][_0x21f1('0x71')]['SELECT'],'raw':!![]})['then'](function(_0x2206dc){return _0x2206dc;});})[_0x21f1('0x1f')](function(_0x7fca3c){if(_0x7fca3c){_0x4179a8[_0x21f1('0x6d')]['contact']=_0x7fca3c[0x0];if(!_0x590d0e[_0x21f1('0x56')][_0x21f1('0x5d')])return;return db['User'][_0x21f1('0x55')]({'where':{'id':_0x590d0e[_0x21f1('0x56')]['UserId'],'role':_0x21f1('0x5f')},'attributes':['id','name',_0x21f1('0x74'),_0x21f1('0x75'),_0x21f1('0x80')],'raw':!![]});}return null;})['then'](function(_0x54d6cf){if(!_0x54d6cf)return null;_0x4179a8[_0x21f1('0x6d')][_0x21f1('0x5f')]=_0x54d6cf;return _0x4179a8;})[_0x21f1('0x1f')](function(_0x4585a4){if(_0x4585a4){_0x4585a4['message'][_0x21f1('0x76')]=util[_0x21f1('0x5b')](_0x21f1('0x77'),_0x590d0e[_0x21f1('0x5e')][_0x21f1('0x38')]);_0x4585a4['message'][_0x21f1('0x78')]=_0x4179a8[_0x21f1('0x78')];_0x4585a4[_0x21f1('0x6d')]['motionChannel']=_0x4179a8['channel'];_0x4585a4[_0x21f1('0x6d')][_0x21f1('0x79')]=_0x21f1('0x34');respondWithRpcPromise(_0x21f1('0x7a'),_0x21f1('0x7a'),{'event':_0x21f1('0x81'),'message':_0x4585a4[_0x21f1('0x6d')]},client9002);return _0x4179a8;}return null;})[_0x21f1('0x1f')](respondWithResult(_0x995a17,null))[_0x21f1('0x28')](handleError(_0x995a17,null));};exports[_0x21f1('0x82')]=function(_0xdbeb79,_0x8ac9df){var _0xbdb8d9;return db[_0x21f1('0x4f')][_0x21f1('0x82')](_0xdbeb79[_0x21f1('0x56')],{})[_0x21f1('0x1f')](function(_0x539c46){_0xbdb8d9=_0x539c46;return db[_0x21f1('0x83')][_0x21f1('0x84')]({'where':{'id':_0xbdb8d9[_0x21f1('0x6e')]}});})[_0x21f1('0x1f')](function(_0x11928a){if(_['isNil'](_0x11928a)){return;}else{_0xbdb8d9['fax']=_0x11928a[_0x21f1('0x7c')];return db[_0x21f1('0x85')][_0x21f1('0x84')]({'where':{'id':_0xbdb8d9['AttachmentId']}});}})['then'](function(_0x31d207){return respondWithRpcPromise(_0x21f1('0x86'),_0x21f1('0x86'),{'FaxAccountId':_[_0x21f1('0x64')](_0xdbeb79[_0x21f1('0x56')])?undefined:_0xdbeb79[_0x21f1('0x56')]['FaxAccountId'],'path':_[_0x21f1('0x64')](_0x31d207)?undefined:util[_0x21f1('0x5b')](_0x21f1('0x87'),_0x31d207[_0x21f1('0x88')]),'fax':_[_0x21f1('0x64')](_0xbdb8d9[_0x21f1('0x7c')])?undefined:_0xbdb8d9[_0x21f1('0x7c')],'AttachmentId':_0xbdb8d9[_0x21f1('0x89')]},client9002);})[_0x21f1('0x1f')](respondWithResult(_0x8ac9df,0xc9))['catch'](handleError(_0x8ac9df,null));};exports[_0x21f1('0x8a')]=function(_0x46dc59,_0x181eef){var _0x506134=path[_0x21f1('0x8b')](config['root'],_0x21f1('0x8c'),_0x21f1('0x8d'),_0x21f1('0x8e'));return db['FaxMessage'][_0x21f1('0x55')]({'where':{'id':_0x46dc59['params']['id']},'include':[{'model':db[_0x21f1('0x85')],'as':_0x21f1('0x85')}]})[_0x21f1('0x1f')](handleEntityNotFound(_0x181eef,null))['then'](function(_0x4fdfa7){if(_0x4fdfa7){return _0x181eef['download'](path[_0x21f1('0x8b')](_0x506134,_0x4fdfa7[_0x21f1('0x85')]['basename']));}})[_0x21f1('0x28')](handleError(_0x181eef,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 41c1653..f1d611d 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 _0x524e=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','FaxMessage'];(function(_0x22146c,_0x2d0f99){var _0x1f2c2f=function(_0xe9a696){while(--_0xe9a696){_0x22146c['push'](_0x22146c['shift']());}};_0x1f2c2f(++_0x2d0f99);}(_0x524e,0x15e));var _0xe524=function(_0x46befd,_0x2b5678){_0x46befd=_0x46befd-0x0;var _0x5ad049=_0x524e[_0x46befd];return _0x5ad049;};'use strict';var EventEmitter=require('events');var FaxMessage=require('../../mysqldb')['db'][_0xe524('0x0')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xe524('0x1')](0x0);var events={'afterCreate':_0xe524('0x2'),'afterUpdate':_0xe524('0x3'),'afterDestroy':_0xe524('0x4')};function emitEvent(_0x379eb1){return function(_0xabd694,_0x32c90b,_0x10d37a){FaxMessageEvents[_0xe524('0x5')](_0x379eb1+':'+_0xabd694['id'],_0xabd694);FaxMessageEvents['emit'](_0x379eb1,_0xabd694);_0x10d37a(null);};}for(var e in events){if(events[_0xe524('0x6')](e)){var event=events[e];FaxMessage[_0xe524('0x7')](e,emitEvent(event));}}module[_0xe524('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0xf970=['hasOwnProperty','hook','exports','events','FaxMessage','setMaxListeners','save','update','remove','emit'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0xf970,0x1d9));var _0x0f97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf970[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x0f97('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x0f97('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x0f97('0x2')](0x0);var events={'afterCreate':_0x0f97('0x3'),'afterUpdate':_0x0f97('0x4'),'afterDestroy':_0x0f97('0x5')};function emitEvent(_0x25e484){return function(_0x439149,_0x4ab74d,_0xc822e8){FaxMessageEvents[_0x0f97('0x6')](_0x25e484+':'+_0x439149['id'],_0x439149);FaxMessageEvents[_0x0f97('0x6')](_0x25e484,_0x439149);_0xc822e8(null);};}for(var e in events){if(events[_0x0f97('0x7')](e)){var event=events[e];FaxMessage[_0x0f97('0x8')](e,emitEvent(event));}}module[_0x0f97('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 84c5d09..8f5ab0d 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 _0x9424=['out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','createdAt','catch','utf8mb4','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','direction','toLowerCase'];(function(_0x4f6c0a,_0x15ac48){var _0x4c2b0c=function(_0x1264ef){while(--_0x1264ef){_0x4f6c0a['push'](_0x4f6c0a['shift']());}};_0x4c2b0c(++_0x15ac48);}(_0x9424,0xa1));var _0x4942=function(_0x227271,_0x526d24){_0x227271=_0x227271-0x0;var _0x953ad1=_0x9424[_0x227271];return _0x953ad1;};'use strict';var _=require(_0x4942('0x0'));var util=require(_0x4942('0x1'));var logger=require('../../config/logger')(_0x4942('0x2'));var moment=require(_0x4942('0x3'));var BPromise=require(_0x4942('0x4'));var rp=require(_0x4942('0x5'));var fs=require('fs');var path=require(_0x4942('0x6'));var rimraf=require(_0x4942('0x7'));var config=require(_0x4942('0x8'));var attributes=require(_0x4942('0x9'));module['exports']=function(_0x29dfa8,_0x2cc239){return _0x29dfa8[_0x4942('0xa')](_0x4942('0xb'),attributes,{'tableName':_0x4942('0xc'),'paranoid':![],'indexes':[{'name':_0x4942('0xd'),'fields':[_0x4942('0xe')],'type':_0x4942('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4ced73,_0x47ef81,_0x34fde9){var _0x3f42fc=_0x29dfa8[_0x4942('0x10')];var _0x557049=_0x4ced73['get']({'plain':!![]});if(_0x557049[_0x4942('0x11')][_0x4942('0x12')]()==='in'||_0x557049['direction']['toLowerCase']()===_0x4942('0x13')&&!_0x557049[_0x4942('0x14')]&&!_[_0x4942('0x15')](_0x557049[_0x4942('0x16')])){_0x3f42fc[_0x4942('0x17')][_0x4942('0x18')]({'where':{'id':_0x557049[_0x4942('0x19')]}})[_0x4942('0x1a')](function(_0x11df6e){if(_0x11df6e){_0x11df6e['update']({'lastMsgAt':_0x557049[_0x4942('0x1b')],'lastMsgDirection':_0x557049[_0x4942('0x11')]['toLowerCase']()});}})[_0x4942('0x1c')](function(_0x11c484){console['error'](_0x11c484);});}_0x34fde9();}},'charset':_0x4942('0x1d'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x27f2=['rimraf','../../config/environment','./faxMessage.attributes','exports','define','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','moment','bluebird','request-promise'];(function(_0x1a6ba4,_0x5f5c58){var _0x58a47d=function(_0x265e08){while(--_0x265e08){_0x1a6ba4['push'](_0x1a6ba4['shift']());}};_0x58a47d(++_0x5f5c58);}(_0x27f2,0x89));var _0x227f=function(_0x25cc6d,_0x3359d5){_0x25cc6d=_0x25cc6d-0x0;var _0x5188dd=_0x27f2[_0x25cc6d];return _0x5188dd;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x227f('0x0'));var BPromise=require(_0x227f('0x1'));var rp=require(_0x227f('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x227f('0x3'));var config=require(_0x227f('0x4'));var attributes=require(_0x227f('0x5'));module[_0x227f('0x6')]=function(_0x2be477,_0x3a0afc){return _0x2be477[_0x227f('0x7')]('FaxMessage',attributes,{'tableName':_0x227f('0x8'),'paranoid':![],'indexes':[{'name':_0x227f('0x9'),'fields':[_0x227f('0xa')],'type':_0x227f('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x497099,_0x137bf2,_0x2c787a){var _0x4474dc=_0x2be477[_0x227f('0xc')];var _0x2f3ea4=_0x497099[_0x227f('0xd')]({'plain':!![]});if(_0x2f3ea4[_0x227f('0xe')][_0x227f('0xf')]()==='in'||_0x2f3ea4['direction'][_0x227f('0xf')]()===_0x227f('0x10')&&!_0x2f3ea4[_0x227f('0x11')]&&!_[_0x227f('0x12')](_0x2f3ea4['UserId'])){_0x4474dc[_0x227f('0x13')][_0x227f('0x14')]({'where':{'id':_0x2f3ea4[_0x227f('0x15')]}})[_0x227f('0x16')](function(_0x58d610){if(_0x58d610){_0x58d610[_0x227f('0x17')]({'lastMsgAt':_0x2f3ea4[_0x227f('0x18')],'lastMsgDirection':_0x2f3ea4[_0x227f('0xe')][_0x227f('0xf')]()});}})[_0x227f('0x19')](function(_0x2f36aa){console[_0x227f('0x1a')](_0x2f36aa);});}_0x2c787a();}},'charset':'utf8mb4','collate':_0x227f('0x1b')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index ed87302..9c0bf12 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 _0xa41a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./faxMessage.socket','register','request','info','debug','request\x20sent','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','CreateFaxMessage','body','options','raw','then','FaxMessage','update','where','attributes','UpdateFaxMessage','lodash','util','bluebird','randomstring'];(function(_0xe4184f,_0x115ca2){var _0x219343=function(_0x4cd895){while(--_0x4cd895){_0xe4184f['push'](_0xe4184f['shift']());}};_0x219343(++_0x115ca2);}(_0xa41a,0x6b));var _0xaa41=function(_0xf1accd,_0xa3cc3d){_0xf1accd=_0xf1accd-0x0;var _0x512d6f=_0xa41a[_0xf1accd];return _0x512d6f;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xaa41('0xc')],{'host':_0xaa41('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaa41('0xc')]));require(_0xaa41('0xe'))[_0xaa41('0xf')](socket);function respondWithRpcPromise(_0x1cc344,_0x4263d6,_0x38d930){return new BPromise(function(_0x806f08,_0x423a19){return client[_0xaa41('0x10')](_0x1cc344,_0x38d930)['then'](function(_0x1d3aac){logger[_0xaa41('0x11')]('FaxMessage,\x20%s,\x20%s',_0x4263d6,'request\x20sent');logger[_0xaa41('0x12')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x4263d6,_0xaa41('0x13'),JSON[_0xaa41('0x14')](_0x1d3aac));if(_0x1d3aac[_0xaa41('0x15')]){if(_0x1d3aac[_0xaa41('0x15')][_0xaa41('0x16')]===0x1f4){logger['error'](_0xaa41('0x17'),_0x4263d6,_0x1d3aac[_0xaa41('0x15')][_0xaa41('0x18')]);return _0x423a19(_0x1d3aac[_0xaa41('0x15')][_0xaa41('0x18')]);}logger[_0xaa41('0x15')](_0xaa41('0x17'),_0x4263d6,_0x1d3aac['error'][_0xaa41('0x18')]);return _0x806f08(_0x1d3aac[_0xaa41('0x15')][_0xaa41('0x18')]);}else{logger[_0xaa41('0x11')](_0xaa41('0x17'),_0x4263d6,_0xaa41('0x13'));_0x806f08(_0x1d3aac[_0xaa41('0x19')][_0xaa41('0x18')]);}})[_0xaa41('0x1a')](function(_0x4fe1a4){logger['error'](_0xaa41('0x17'),_0x4263d6,_0x4fe1a4);_0x423a19(_0x4fe1a4);});});}exports[_0xaa41('0x1b')]=function(_0x35c753){var _0x54c488=this;return new Promise(function(_0x2bf794,_0x1f692b){return db['FaxMessage']['create'](_0x35c753[_0xaa41('0x1c')],{'raw':_0x35c753['options']?_0x35c753[_0xaa41('0x1d')][_0xaa41('0x1e')]===undefined?!![]:![]:!![]})[_0xaa41('0x1f')](function(_0x1f27f3){logger[_0xaa41('0x11')]('CreateFaxMessage',_0x35c753);logger[_0xaa41('0x12')](_0xaa41('0x1b'),_0x35c753,JSON[_0xaa41('0x14')](_0x1f27f3));_0x2bf794(_0x1f27f3);})[_0xaa41('0x1a')](function(_0x274630){logger[_0xaa41('0x15')]('CreateFaxMessage',_0x274630['message'],_0x35c753);_0x1f692b(_0x54c488[_0xaa41('0x15')](0x1f4,_0x274630['message']));});});};exports['UpdateFaxMessage']=function(_0x12e362){var _0x59707f=this;return new Promise(function(_0x536bed,_0x2d0ac0){return db[_0xaa41('0x20')][_0xaa41('0x21')](_0x12e362[_0xaa41('0x1c')],{'raw':_0x12e362[_0xaa41('0x1d')]?_0x12e362[_0xaa41('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12e362[_0xaa41('0x1d')]?_0x12e362[_0xaa41('0x1d')][_0xaa41('0x22')]||null:null,'attributes':_0x12e362[_0xaa41('0x1d')]?_0x12e362[_0xaa41('0x1d')][_0xaa41('0x23')]||null:null,'limit':_0x12e362[_0xaa41('0x1d')]?_0x12e362[_0xaa41('0x1d')]['limit']||null:null})[_0xaa41('0x1f')](function(_0x48b48b){logger['info'](_0xaa41('0x24'),_0x12e362);logger[_0xaa41('0x12')]('UpdateFaxMessage',_0x12e362,JSON[_0xaa41('0x14')](_0x48b48b));_0x536bed(_0x48b48b);})[_0xaa41('0x1a')](function(_0x4e3b44){logger['error']('UpdateFaxMessage',_0x4e3b44[_0xaa41('0x18')],_0x12e362);_0x2d0ac0(_0x59707f[_0xaa41('0x15')](0x1f4,_0x4e3b44[_0xaa41('0x18')]));});});}; \ No newline at end of file +var _0x00bb=['redis','defaults','localhost','socket.io-emitter','then','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','FaxMessage,\x20%s,\x20%s','CreateFaxMessage','FaxMessage','create','body','options','raw','catch','update','attributes','UpdateFaxMessage','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x5d2e75,_0x4d7fa9){var _0x3df4aa=function(_0x196f05){while(--_0x196f05){_0x5d2e75['push'](_0x5d2e75['shift']());}};_0x3df4aa(++_0x4d7fa9);}(_0x00bb,0x1d8));var _0xb00b=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x00bb[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xb00b('0x8')]=_[_0xb00b('0x9')](config[_0xb00b('0x8')],{'host':_0xb00b('0xa'),'port':0x18eb});var socket=require(_0xb00b('0xb'))(new Redis(config[_0xb00b('0x8')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x5154d9,_0x1e9b7b,_0x5851d4){return new BPromise(function(_0x46a25c,_0x28d3cc){return client['request'](_0x5154d9,_0x5851d4)[_0xb00b('0xc')](function(_0x5a63ed){logger['info']('FaxMessage,\x20%s,\x20%s',_0x1e9b7b,_0xb00b('0xd'));logger[_0xb00b('0xe')](_0xb00b('0xf'),_0x1e9b7b,_0xb00b('0xd'),JSON[_0xb00b('0x10')](_0x5a63ed));if(_0x5a63ed[_0xb00b('0x11')]){if(_0x5a63ed['error'][_0xb00b('0x12')]===0x1f4){logger[_0xb00b('0x11')]('FaxMessage,\x20%s,\x20%s',_0x1e9b7b,_0x5a63ed[_0xb00b('0x11')][_0xb00b('0x13')]);return _0x28d3cc(_0x5a63ed['error']['message']);}logger[_0xb00b('0x11')]('FaxMessage,\x20%s,\x20%s',_0x1e9b7b,_0x5a63ed['error'][_0xb00b('0x13')]);return _0x46a25c(_0x5a63ed[_0xb00b('0x11')][_0xb00b('0x13')]);}else{logger[_0xb00b('0x14')]('FaxMessage,\x20%s,\x20%s',_0x1e9b7b,_0xb00b('0xd'));_0x46a25c(_0x5a63ed['result'][_0xb00b('0x13')]);}})['catch'](function(_0x25d7a0){logger['error'](_0xb00b('0x15'),_0x1e9b7b,_0x25d7a0);_0x28d3cc(_0x25d7a0);});});}exports[_0xb00b('0x16')]=function(_0x53ee68){var _0x55770c=this;return new Promise(function(_0x2b0da1,_0x4a334b){return db[_0xb00b('0x17')][_0xb00b('0x18')](_0x53ee68[_0xb00b('0x19')],{'raw':_0x53ee68[_0xb00b('0x1a')]?_0x53ee68['options'][_0xb00b('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x25a973){logger[_0xb00b('0x14')]('CreateFaxMessage',_0x53ee68);logger[_0xb00b('0xe')](_0xb00b('0x16'),_0x53ee68,JSON['stringify'](_0x25a973));_0x2b0da1(_0x25a973);})[_0xb00b('0x1c')](function(_0x1f04d3){logger['error'](_0xb00b('0x16'),_0x1f04d3[_0xb00b('0x13')],_0x53ee68);_0x4a334b(_0x55770c[_0xb00b('0x11')](0x1f4,_0x1f04d3[_0xb00b('0x13')]));});});};exports['UpdateFaxMessage']=function(_0x50be6c){var _0x3785e9=this;return new Promise(function(_0x490380,_0x550587){return db['FaxMessage'][_0xb00b('0x1d')](_0x50be6c[_0xb00b('0x19')],{'raw':_0x50be6c[_0xb00b('0x1a')]?_0x50be6c[_0xb00b('0x1a')][_0xb00b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50be6c[_0xb00b('0x1a')]?_0x50be6c[_0xb00b('0x1a')]['where']||null:null,'attributes':_0x50be6c[_0xb00b('0x1a')]?_0x50be6c['options'][_0xb00b('0x1e')]||null:null,'limit':_0x50be6c[_0xb00b('0x1a')]?_0x50be6c[_0xb00b('0x1a')]['limit']||null:null})[_0xb00b('0xc')](function(_0x280ed3){logger[_0xb00b('0x14')](_0xb00b('0x1f'),_0x50be6c);logger[_0xb00b('0xe')](_0xb00b('0x1f'),_0x50be6c,JSON[_0xb00b('0x10')](_0x280ed3));_0x490380(_0x280ed3);})[_0xb00b('0x1c')](function(_0x149c1a){logger['error'](_0xb00b('0x1f'),_0x149c1a[_0xb00b('0x13')],_0x50be6c);_0x550587(_0x3785e9['error'](0x1f4,_0x149c1a[_0xb00b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 5ec6ca3..a75517d 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 _0x1ac5=['update','emit','removeListener','register','faxMessage:','save'];(function(_0x321763,_0x6dd463){var _0x26fdb3=function(_0x573e40){while(--_0x573e40){_0x321763['push'](_0x321763['shift']());}};_0x26fdb3(++_0x6dd463);}(_0x1ac5,0xd1));var _0x51ac=function(_0x512e5b,_0x4b9009){_0x512e5b=_0x512e5b-0x0;var _0x2d627c=_0x1ac5[_0x512e5b];return _0x2d627c;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x51ac('0x0'),'remove',_0x51ac('0x1')];function createListener(_0x541d35,_0x263a5d){return function(_0x41991f){_0x263a5d[_0x51ac('0x2')](_0x541d35,_0x41991f);};}function removeListener(_0x50ebda,_0x55d86e){return function(){FaxMessageEvents[_0x51ac('0x3')](_0x50ebda,_0x55d86e);};}exports[_0x51ac('0x4')]=function(_0x8fa7bc){for(var _0x3818df=0x0,_0x26e39e=events['length'];_0x3818df<_0x26e39e;_0x3818df++){var _0x40ba15=events[_0x3818df];var _0x23533b=createListener(_0x51ac('0x5')+_0x40ba15,_0x8fa7bc);FaxMessageEvents['on'](_0x40ba15,_0x23533b);}}; \ No newline at end of file +var _0x6d16=['save','remove','emit','removeListener','register','length','faxMessage:','./faxMessage.events'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x6d16,0xef));var _0x66d1=function(_0x2616a0,_0x51bd99){_0x2616a0=_0x2616a0-0x0;var _0x2ac7f6=_0x6d16[_0x2616a0];return _0x2ac7f6;};'use strict';var FaxMessageEvents=require(_0x66d1('0x0'));var events=[_0x66d1('0x1'),_0x66d1('0x2'),'update'];function createListener(_0x55528f,_0x2c50d3){return function(_0x14aa3a){_0x2c50d3[_0x66d1('0x3')](_0x55528f,_0x14aa3a);};}function removeListener(_0x2982fd,_0x4a06d3){return function(){FaxMessageEvents[_0x66d1('0x4')](_0x2982fd,_0x4a06d3);};}exports[_0x66d1('0x5')]=function(_0xc1506){for(var _0x8ad0fb=0x0,_0x4cd92d=events[_0x66d1('0x6')];_0x8ad0fb<_0x4cd92d;_0x8ad0fb++){var _0x36ba7b=events[_0x8ad0fb];var _0x2e1589=createListener(_0x66d1('0x7')+_0x36ba7b,_0xc1506);FaxMessageEvents['on'](_0x36ba7b,_0x2e1589);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 4977d9f..9141d04 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 _0x0fd9=['../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','/describe','/:id','show','/:id/download','download','post','tracked','fax','create','put','update','/:id/reject','reject','delete','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x60fc9b,_0x1be0bc){var _0x5a31f6=function(_0x4f47b6){while(--_0x4f47b6){_0x60fc9b['push'](_0x60fc9b['shift']());}};_0x5a31f6(++_0x1be0bc);}(_0x0fd9,0xa3));var _0x90fd=function(_0x5ef55a,_0x2a03b1){_0x5ef55a=_0x5ef55a-0x0;var _0x20ae40=_0x0fd9[_0x5ef55a];return _0x20ae40;};'use strict';var multer=require('multer');var util=require(_0x90fd('0x0'));var path=require(_0x90fd('0x1'));var timeout=require(_0x90fd('0x2'));var express=require(_0x90fd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x90fd('0x4'));var interaction=require(_0x90fd('0x5'));var config=require(_0x90fd('0x6'));var controller=require(_0x90fd('0x7'));router[_0x90fd('0x8')]('/',auth[_0x90fd('0x9')](),controller['index']);router['get'](_0x90fd('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x90fd('0x8')](_0x90fd('0xb'),auth['isAuthenticated'](),controller[_0x90fd('0xc')]);router[_0x90fd('0x8')](_0x90fd('0xd'),auth[_0x90fd('0x9')](),controller[_0x90fd('0xe')]);router[_0x90fd('0xf')]('/',auth[_0x90fd('0x9')](),interaction[_0x90fd('0x10')](_0x90fd('0x11'),'faxmessage:create'),controller[_0x90fd('0x12')]);router[_0x90fd('0x13')]('/:id',auth[_0x90fd('0x9')](),controller[_0x90fd('0x14')]);router[_0x90fd('0x13')]('/:id/accept',auth[_0x90fd('0x9')](),controller['accept']);router[_0x90fd('0x13')](_0x90fd('0x15'),auth[_0x90fd('0x9')](),controller[_0x90fd('0x16')]);router[_0x90fd('0x17')](_0x90fd('0xb'),auth[_0x90fd('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1d2d=['/:id','show','/:id/download','download','post','tracked','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','describe'];(function(_0xc694ff,_0x1498ad){var _0x59dba2=function(_0x4c3ccd){while(--_0x4c3ccd){_0xc694ff['push'](_0xc694ff['shift']());}};_0x59dba2(++_0x1498ad);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x50ba91,_0x2f7111){_0x50ba91=_0x50ba91-0x0;var _0x2976c7=_0x1d2d[_0x50ba91];return _0x2976c7;};'use strict';var multer=require(_0xd1d2('0x0'));var util=require(_0xd1d2('0x1'));var path=require(_0xd1d2('0x2'));var timeout=require(_0xd1d2('0x3'));var express=require(_0xd1d2('0x4'));var router=express['Router']();var fs_extra=require(_0xd1d2('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd1d2('0x6'));var controller=require(_0xd1d2('0x7'));router[_0xd1d2('0x8')]('/',auth[_0xd1d2('0x9')](),controller[_0xd1d2('0xa')]);router[_0xd1d2('0x8')]('/describe',auth[_0xd1d2('0x9')](),controller[_0xd1d2('0xb')]);router[_0xd1d2('0x8')](_0xd1d2('0xc'),auth[_0xd1d2('0x9')](),controller[_0xd1d2('0xd')]);router[_0xd1d2('0x8')](_0xd1d2('0xe'),auth[_0xd1d2('0x9')](),controller[_0xd1d2('0xf')]);router[_0xd1d2('0x10')]('/',auth[_0xd1d2('0x9')](),interaction[_0xd1d2('0x11')]('fax',_0xd1d2('0x12')),controller[_0xd1d2('0x13')]);router[_0xd1d2('0x14')](_0xd1d2('0xc'),auth[_0xd1d2('0x9')](),controller[_0xd1d2('0x15')]);router[_0xd1d2('0x14')](_0xd1d2('0x16'),auth[_0xd1d2('0x9')](),controller[_0xd1d2('0x17')]);router['put'](_0xd1d2('0x18'),auth[_0xd1d2('0x9')](),controller[_0xd1d2('0x19')]);router['delete'](_0xd1d2('0xc'),auth[_0xd1d2('0x9')](),controller[_0xd1d2('0x1a')]);module[_0xd1d2('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 5ca9090..3ee4fa1 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 _0x2d85=['exports','STRING','name','ENUM','beepall','roundrobin','sequelize'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x2d85,0xd8));var _0x52d8=function(_0x3b8d05,_0x607c9c){_0x3b8d05=_0x3b8d05-0x0;var _0x26ea09=_0x2d85[_0x3b8d05];return _0x26ea09;};'use strict';var Sequelize=require(_0x52d8('0x0'));module[_0x52d8('0x1')]={'name':{'type':Sequelize[_0x52d8('0x2')],'unique':_0x52d8('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x52d8('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x52d8('0x4')]('rrmemory',_0x52d8('0x5'),_0x52d8('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xdda4=['INTEGER','ENUM','roundrobin','sequelize','exports','STRING','name'];(function(_0xb08424,_0x167de3){var _0x281b0c=function(_0xf1562e){while(--_0xf1562e){_0xb08424['push'](_0xb08424['shift']());}};_0x281b0c(++_0x167de3);}(_0xdda4,0xce));var _0x4dda=function(_0x30faee,_0x1c3794){_0x30faee=_0x30faee-0x0;var _0x3a90ab=_0xdda4[_0x30faee];return _0x3a90ab;};'use strict';var Sequelize=require(_0x4dda('0x0'));module[_0x4dda('0x1')]={'name':{'type':Sequelize[_0x4dda('0x2')],'unique':_0x4dda('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4dda('0x2')]},'timeout':{'type':Sequelize[_0x4dda('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4dda('0x5')]('rrmemory','beepall',_0x4dda('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x4dda('0x4')],'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 7b34992..2e12026 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 _0xb52e=['user_has_teams','FaxQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','transaction','removeTeams','isEmpty','userFaxQueue:remove','addAgents','omit','spread','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','then','destroy','get','FaxQueues','UserProfileResource','error','stack','name','send','index','FaxQueue','rawAttributes','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','params','getMembers','UserFaxQueue','pick','findAndCountAll','UserId','agent','updatedAt','createdAt','rows','format','SIP','faxPause','getTeams','findOne','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','each','forEach','emit','userFaxQueue:save','select','tq.TeamId','team_has_fax_queues','join'];(function(_0x1a8bbc,_0x17a086){var _0x212fc2=function(_0x55c718){while(--_0x55c718){_0x1a8bbc['push'](_0x1a8bbc['shift']());}};_0x212fc2(++_0x17a086);}(_0xb52e,0xa2));var _0xeb52=function(_0x265056,_0x3aa6c9){_0x265056=_0x265056-0x0;var _0x15fd59=_0xb52e[_0x265056];return _0x15fd59;};'use strict';var emlformat=require(_0xeb52('0x0'));var rimraf=require(_0xeb52('0x1'));var zipdir=require(_0xeb52('0x2'));var jsonpatch=require(_0xeb52('0x3'));var rp=require(_0xeb52('0x4'));var moment=require(_0xeb52('0x5'));var BPromise=require(_0xeb52('0x6'));var Mustache=require('mustache');var util=require(_0xeb52('0x7'));var path=require(_0xeb52('0x8'));var sox=require(_0xeb52('0x9'));var csv=require(_0xeb52('0xa'));var ejs=require(_0xeb52('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb52('0xc'));var squel=require(_0xeb52('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xeb52('0xe'));var toCsv=require(_0xeb52('0xa'));var querystring=require(_0xeb52('0xf'));var Papa=require('papaparse');var Redis=require(_0xeb52('0x10'));var authService=require(_0xeb52('0x11'));var qs=require(_0xeb52('0x12'));var as=require(_0xeb52('0x13'));var hardwareService=require(_0xeb52('0x14'));var logger=require(_0xeb52('0x15'))(_0xeb52('0x16'));var utils=require('../../config/utils');var config=require(_0xeb52('0x17'));var licenseUtil=require(_0xeb52('0x18'));var db=require(_0xeb52('0x19'))['db'];config[_0xeb52('0x1a')]=_['defaults'](config[_0xeb52('0x1a')],{'host':_0xeb52('0x1b'),'port':0x18eb});var socket=require(_0xeb52('0x1c'))(new Redis(config['redis']));require(_0xeb52('0x1d'))['register'](socket);function respondWithStatusCode(_0x4a63ec,_0x439e78){_0x439e78=_0x439e78||0xcc;return function(_0x33ea77){if(_0x33ea77){return _0x4a63ec[_0xeb52('0x1e')](_0x439e78);}return _0x4a63ec[_0xeb52('0x1f')](_0x439e78)[_0xeb52('0x20')]();};}function respondWithResult(_0x28f366,_0x19c22c){_0x19c22c=_0x19c22c||0xc8;return function(_0x4f9829){if(_0x4f9829){return _0x28f366[_0xeb52('0x1f')](_0x19c22c)[_0xeb52('0x21')](_0x4f9829);}};}function respondWithFilteredResult(_0x20e8df,_0x1ae4d4){return function(_0x3d971f){if(_0x3d971f){var _0x1ca059=typeof _0x1ae4d4['offset']===_0xeb52('0x22')&&typeof _0x1ae4d4['limit']===_0xeb52('0x22');var _0x419de6=_0x3d971f[_0xeb52('0x23')];var _0x2e21ad=_0x1ca059?0x0:_0x1ae4d4[_0xeb52('0x24')];var _0x17c37e=_0x1ca059?_0x3d971f['count']:_0x1ae4d4[_0xeb52('0x24')]+_0x1ae4d4[_0xeb52('0x25')];var _0x3c24cd;if(_0x17c37e>=_0x419de6){_0x17c37e=_0x419de6;_0x3c24cd=0xc8;}else{_0x3c24cd=0xce;}_0x20e8df[_0xeb52('0x1f')](_0x3c24cd);return _0x20e8df[_0xeb52('0x26')](_0xeb52('0x27'),_0x2e21ad+'-'+_0x17c37e+'/'+_0x419de6)[_0xeb52('0x21')](_0x3d971f);}return null;};}function patchUpdates(_0x2fa24c){return function(_0x38a8f5){try{jsonpatch[_0xeb52('0x28')](_0x38a8f5,_0x2fa24c,!![]);}catch(_0x531930){return BPromise['reject'](_0x531930);}return _0x38a8f5[_0xeb52('0x29')]();};}function saveUpdates(_0x103786,_0x51702e){return function(_0x257bd3){if(_0x257bd3){return _0x257bd3['update'](_0x103786)[_0xeb52('0x2a')](function(_0x4aa3b0){return _0x4aa3b0;});}return null;};}function removeEntity(_0xfc56ba,_0x307cda){return function(_0x5dd3a6){if(_0x5dd3a6){return _0x5dd3a6[_0xeb52('0x2b')]()[_0xeb52('0x2a')](function(){var _0x270023=_0x5dd3a6[_0xeb52('0x2c')]({'plain':!![]});var _0x1f65e2=_0xeb52('0x2d');return db[_0xeb52('0x2e')][_0xeb52('0x2b')]({'where':{'type':_0x1f65e2,'resourceId':_0x270023['id']}})[_0xeb52('0x2a')](function(){return _0x5dd3a6;});})[_0xeb52('0x2a')](function(){_0xfc56ba[_0xeb52('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f4b3b,_0x6c449){return function(_0x4bc38f){if(!_0x4bc38f){_0x3f4b3b[_0xeb52('0x1e')](0x194);}return _0x4bc38f;};}function handleError(_0x159b46,_0x2fed5f){_0x2fed5f=_0x2fed5f||0x1f4;return function(_0x4f77bf){logger[_0xeb52('0x2f')](_0x4f77bf[_0xeb52('0x30')]);if(_0x4f77bf['name']){delete _0x4f77bf[_0xeb52('0x31')];}_0x159b46[_0xeb52('0x1f')](_0x2fed5f)[_0xeb52('0x32')](_0x4f77bf);};}exports[_0xeb52('0x33')]=function(_0x58ecb6,_0x41d633){var _0x3f208c={},_0x4ff8c2={},_0xbd9b5b={'count':0x0,'rows':[]};var _0x1ced27=_['map'](db[_0xeb52('0x34')][_0xeb52('0x35')],function(_0x479587){return{'name':_0x479587['fieldName'],'type':_0x479587['type'][_0xeb52('0x36')]};});_0x4ff8c2[_0xeb52('0x37')]=_[_0xeb52('0x38')](_0x1ced27,_0xeb52('0x31'));_0x4ff8c2[_0xeb52('0x39')]=_[_0xeb52('0x3a')](_0x58ecb6[_0xeb52('0x39')]);_0x4ff8c2[_0xeb52('0x3b')]=_['intersection'](_0x4ff8c2['model'],_0x4ff8c2[_0xeb52('0x39')]);_0x3f208c['attributes']=_[_0xeb52('0x3c')](_0x4ff8c2[_0xeb52('0x37')],qs[_0xeb52('0x3d')](_0x58ecb6[_0xeb52('0x39')][_0xeb52('0x3d')]));_0x3f208c['attributes']=_0x3f208c[_0xeb52('0x3e')][_0xeb52('0x3f')]?_0x3f208c[_0xeb52('0x3e')]:_0x4ff8c2[_0xeb52('0x37')];if(!_0x58ecb6[_0xeb52('0x39')][_0xeb52('0x40')](_0xeb52('0x41'))){_0x3f208c[_0xeb52('0x25')]=qs[_0xeb52('0x25')](_0x58ecb6[_0xeb52('0x39')][_0xeb52('0x25')]);_0x3f208c[_0xeb52('0x24')]=qs[_0xeb52('0x24')](_0x58ecb6[_0xeb52('0x39')][_0xeb52('0x24')]);}_0x3f208c[_0xeb52('0x42')]=qs[_0xeb52('0x43')](_0x58ecb6[_0xeb52('0x39')][_0xeb52('0x43')]);_0x3f208c['where']=qs['filters'](_['pick'](_0x58ecb6['query'],_0x4ff8c2[_0xeb52('0x3b')]),_0x1ced27);if(_0x58ecb6[_0xeb52('0x39')][_0xeb52('0x44')]){_0x3f208c[_0xeb52('0x45')]=_[_0xeb52('0x46')](_0x3f208c[_0xeb52('0x45')],{'$or':_[_0xeb52('0x38')](_0x1ced27,function(_0x41ddd0){if(_0x41ddd0['type']!==_0xeb52('0x47')){var _0x46da3e={};_0x46da3e[_0x41ddd0[_0xeb52('0x31')]]={'$like':'%'+_0x58ecb6['query'][_0xeb52('0x44')]+'%'};return _0x46da3e;}})});}_0x3f208c=_[_0xeb52('0x46')]({},_0x3f208c,_0x58ecb6[_0xeb52('0x48')]);var _0x3f43cf={'where':_0x3f208c['where']};return db[_0xeb52('0x34')]['count'](_0x3f43cf)[_0xeb52('0x2a')](function(_0xc2807b){_0xbd9b5b[_0xeb52('0x23')]=_0xc2807b;if(_0x58ecb6[_0xeb52('0x39')][_0xeb52('0x49')]){_0x3f208c['include']=[{'all':!![]}];}return db[_0xeb52('0x34')][_0xeb52('0x4a')](_0x3f208c);})[_0xeb52('0x2a')](function(_0x15e5d8){_0xbd9b5b['rows']=_0x15e5d8;return _0xbd9b5b;})[_0xeb52('0x2a')](respondWithFilteredResult(_0x41d633,_0x3f208c))[_0xeb52('0x4b')](handleError(_0x41d633,null));};exports['show']=function(_0x4cfc00,_0x48c121){var _0x2dd297={'raw':!![],'where':{'id':_0x4cfc00['params']['id']}},_0x49e348={};_0x49e348['model']=_[_0xeb52('0x3a')](db['FaxQueue'][_0xeb52('0x35')]);_0x49e348[_0xeb52('0x39')]=_[_0xeb52('0x3a')](_0x4cfc00[_0xeb52('0x39')]);_0x49e348[_0xeb52('0x3b')]=_['intersection'](_0x49e348[_0xeb52('0x37')],_0x49e348['query']);_0x2dd297['attributes']=_[_0xeb52('0x3c')](_0x49e348['model'],qs[_0xeb52('0x3d')](_0x4cfc00[_0xeb52('0x39')][_0xeb52('0x3d')]));_0x2dd297[_0xeb52('0x3e')]=_0x2dd297[_0xeb52('0x3e')][_0xeb52('0x3f')]?_0x2dd297['attributes']:_0x49e348[_0xeb52('0x37')];if(_0x4cfc00['query'][_0xeb52('0x49')]){_0x2dd297[_0xeb52('0x4c')]=[{'all':!![]}];}_0x2dd297=_[_0xeb52('0x46')]({},_0x2dd297,_0x4cfc00[_0xeb52('0x48')]);return db[_0xeb52('0x34')][_0xeb52('0x4d')](_0x2dd297)[_0xeb52('0x2a')](handleEntityNotFound(_0x48c121,null))[_0xeb52('0x2a')](respondWithResult(_0x48c121,null))[_0xeb52('0x4b')](handleError(_0x48c121,null));};exports[_0xeb52('0x4e')]=function(_0x311ed7,_0x563c64){return db[_0xeb52('0x34')]['create'](_0x311ed7[_0xeb52('0x4f')],{})[_0xeb52('0x2a')](function(_0x49b823){var _0x3038b3=_0x311ed7[_0xeb52('0x50')][_0xeb52('0x2c')]({'plain':!![]});if(!_0x3038b3)throw new Error(_0xeb52('0x51'));if(_0x3038b3['role']===_0xeb52('0x50')){var _0x1ddfa3=_0x49b823['get']({'plain':!![]});var _0x2861e7=_0xeb52('0x2d');return db[_0xeb52('0x52')][_0xeb52('0x4d')]({'where':{'name':_0x2861e7,'userProfileId':_0x3038b3[_0xeb52('0x53')]},'raw':!![]})[_0xeb52('0x2a')](function(_0x5d1a24){if(_0x5d1a24&&_0x5d1a24[_0xeb52('0x54')]===0x0){return db[_0xeb52('0x2e')][_0xeb52('0x4e')]({'name':_0x1ddfa3[_0xeb52('0x31')],'resourceId':_0x1ddfa3['id'],'type':_0x5d1a24[_0xeb52('0x31')],'sectionId':_0x5d1a24['id']},{})[_0xeb52('0x2a')](function(){return _0x49b823;});}else{return _0x49b823;}})[_0xeb52('0x4b')](function(_0x3fbea3){logger[_0xeb52('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3fbea3);throw _0x3fbea3;});}return _0x49b823;})[_0xeb52('0x2a')](respondWithResult(_0x563c64,0xc9))[_0xeb52('0x4b')](handleError(_0x563c64,null));};exports['update']=function(_0x28b302,_0x14de98){if(_0x28b302[_0xeb52('0x4f')]['id']){delete _0x28b302[_0xeb52('0x4f')]['id'];}return db[_0xeb52('0x34')]['find']({'where':{'id':_0x28b302[_0xeb52('0x55')]['id']}})[_0xeb52('0x2a')](handleEntityNotFound(_0x14de98,null))[_0xeb52('0x2a')](saveUpdates(_0x28b302[_0xeb52('0x4f')],null))['then'](respondWithResult(_0x14de98,null))['catch'](handleError(_0x14de98,null));};exports[_0xeb52('0x2b')]=function(_0x5eab69,_0x67489f){return db[_0xeb52('0x34')]['find']({'where':{'id':_0x5eab69['params']['id']}})[_0xeb52('0x2a')](handleEntityNotFound(_0x67489f,null))[_0xeb52('0x2a')](removeEntity(_0x67489f,null))[_0xeb52('0x4b')](handleError(_0x67489f,null));};exports['describe']=function(_0x3330e3,_0x4ee42d){return db[_0xeb52('0x34')]['describe']()[_0xeb52('0x2a')](respondWithResult(_0x4ee42d,null))[_0xeb52('0x4b')](handleError(_0x4ee42d,null));};exports[_0xeb52('0x56')]=function(_0x39f424,_0x514912,_0x422756){var _0x4bd8d8={'raw':!![],'where':{}},_0x5d67cd={},_0x5e75da;return db[_0xeb52('0x34')]['findOne']({'where':{'id':_0x39f424[_0xeb52('0x55')]['id']}})[_0xeb52('0x2a')](handleEntityNotFound(_0x514912,null))[_0xeb52('0x2a')](function(_0x1d4606){if(_0x1d4606){_0x5e75da=_0x1d4606[_0xeb52('0x2c')]({'plain':!![]});_0x5d67cd['model']=_[_0xeb52('0x3a')](db[_0xeb52('0x57')][_0xeb52('0x35')]);_0x5d67cd['query']=_[_0xeb52('0x3a')](_0x39f424[_0xeb52('0x39')]);_0x5d67cd[_0xeb52('0x3b')]=_[_0xeb52('0x3c')](_0x5d67cd['model'],_0x5d67cd[_0xeb52('0x39')]);_0x4bd8d8[_0xeb52('0x3e')]=_['intersection'](_0x5d67cd[_0xeb52('0x37')],qs['fields'](_0x39f424[_0xeb52('0x39')][_0xeb52('0x3d')]));_0x4bd8d8[_0xeb52('0x3e')]=_0x4bd8d8[_0xeb52('0x3e')][_0xeb52('0x3f')]?_0x4bd8d8['attributes']:_0x5d67cd['model'];if(!_0x39f424[_0xeb52('0x39')][_0xeb52('0x40')](_0xeb52('0x41'))){_0x4bd8d8[_0xeb52('0x25')]=qs[_0xeb52('0x25')](_0x39f424['query'][_0xeb52('0x25')]);_0x4bd8d8[_0xeb52('0x24')]=qs['offset'](_0x39f424[_0xeb52('0x39')]['offset']);}_0x4bd8d8[_0xeb52('0x42')]=qs[_0xeb52('0x43')](_0x39f424[_0xeb52('0x39')][_0xeb52('0x43')]);_0x4bd8d8['where']=qs[_0xeb52('0x3b')](_[_0xeb52('0x58')](_0x39f424[_0xeb52('0x39')],_0x5d67cd[_0xeb52('0x3b')]));_0x4bd8d8['where']['FaxQueueId']=_0x1d4606['id'];if(_0x39f424['query'][_0xeb52('0x44')]){_0x4bd8d8[_0xeb52('0x45')]=_[_0xeb52('0x46')](_0x4bd8d8[_0xeb52('0x45')],{'$or':_[_0xeb52('0x38')](_0x4bd8d8[_0xeb52('0x3e')],function(_0xc83eb){var _0x127f5b={};_0x127f5b[_0xc83eb]={'$like':'%'+_0x39f424[_0xeb52('0x39')][_0xeb52('0x44')]+'%'};return _0x127f5b;})});}_0x4bd8d8=_[_0xeb52('0x46')]({},_0x4bd8d8,_0x39f424[_0xeb52('0x48')]);return db[_0xeb52('0x57')][_0xeb52('0x4a')](_0x4bd8d8);}})[_0xeb52('0x2a')](function(_0x3177a7){if(_0x3177a7){return db['User'][_0xeb52('0x59')]({'where':{'id':_['map'](_0x3177a7,_0xeb52('0x5a')),'role':_0xeb52('0x5b')},'attributes':['id',_0xeb52('0x31'),'faxPause',_0xeb52('0x5c'),_0xeb52('0x5d')]});}})[_0xeb52('0x2a')](function(_0x219c31){if(_0x219c31){return{'count':_0x219c31[_0xeb52('0x23')],'rows':_[_0xeb52('0x38')](_0x219c31[_0xeb52('0x5e')],function(_0x3985d7){return{'membername':_0x3985d7[_0xeb52('0x31')],'UserId':_0x3985d7['id'],'queue_name':_0x5e75da['name'],'FaxQueueId':_0x5e75da['id'],'interface':util[_0xeb52('0x5f')]('%s/%s',_0xeb52('0x60'),_0x3985d7[_0xeb52('0x31')]),'penalty':0x0,'paused':_0x3985d7[_0xeb52('0x61')],'createdAt':_0x3985d7[_0xeb52('0x5d')],'updatedAt':_0x3985d7['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xeb52('0x2a')](respondWithFilteredResult(_0x514912,_0x4bd8d8))[_0xeb52('0x4b')](handleError(_0x514912,null));};exports[_0xeb52('0x62')]=function(_0x303245,_0x3ea3a2,_0x1713bd){var _0x743e70={};var _0x582cc4={};var _0x218cac;var _0x2cb47b;return db[_0xeb52('0x34')][_0xeb52('0x63')]({'where':{'id':_0x303245[_0xeb52('0x55')]['id']}})[_0xeb52('0x2a')](handleEntityNotFound(_0x3ea3a2,null))['then'](function(_0x4db688){if(_0x4db688){_0x218cac=_0x4db688;_0x582cc4['model']=_[_0xeb52('0x3a')](db[_0xeb52('0x64')][_0xeb52('0x35')]);_0x582cc4['query']=_['keys'](_0x303245[_0xeb52('0x39')]);_0x582cc4[_0xeb52('0x3b')]=_['intersection'](_0x582cc4[_0xeb52('0x37')],_0x582cc4[_0xeb52('0x39')]);_0x743e70['attributes']=_[_0xeb52('0x3c')](_0x582cc4[_0xeb52('0x37')],qs[_0xeb52('0x3d')](_0x303245[_0xeb52('0x39')][_0xeb52('0x3d')]));_0x743e70['attributes']=_0x743e70[_0xeb52('0x3e')][_0xeb52('0x3f')]?_0x743e70[_0xeb52('0x3e')]:_0x582cc4['model'];_0x743e70[_0xeb52('0x42')]=qs[_0xeb52('0x43')](_0x303245[_0xeb52('0x39')]['sort']);_0x743e70[_0xeb52('0x45')]=qs[_0xeb52('0x3b')](_[_0xeb52('0x58')](_0x303245[_0xeb52('0x39')],_0x582cc4[_0xeb52('0x3b')]));if(_0x303245['query'][_0xeb52('0x44')]){_0x743e70[_0xeb52('0x45')]=_['merge'](_0x743e70[_0xeb52('0x45')],{'$or':_[_0xeb52('0x38')](_0x743e70[_0xeb52('0x3e')],function(_0x2c0ef8){var _0x2b55cc={};_0x2b55cc[_0x2c0ef8]={'$like':'%'+_0x303245[_0xeb52('0x39')][_0xeb52('0x44')]+'%'};return _0x2b55cc;})});}_0x743e70=_[_0xeb52('0x46')]({},_0x743e70,_0x303245['options']);return _0x218cac[_0xeb52('0x62')](_0x743e70);}})[_0xeb52('0x2a')](function(_0xc9d4e){if(_0xc9d4e){_0x2cb47b=_0xc9d4e[_0xeb52('0x3f')];if(!_0x303245[_0xeb52('0x39')][_0xeb52('0x40')](_0xeb52('0x41'))){_0x743e70[_0xeb52('0x25')]=qs[_0xeb52('0x25')](_0x303245['query']['limit']);_0x743e70[_0xeb52('0x24')]=qs['offset'](_0x303245[_0xeb52('0x39')][_0xeb52('0x24')]);}return _0x218cac[_0xeb52('0x62')](_0x743e70);}})[_0xeb52('0x2a')](function(_0x185c5e){if(_0x185c5e){return _0x185c5e?{'count':_0x2cb47b,'rows':_0x185c5e}:null;}})['then'](respondWithResult(_0x3ea3a2,null))[_0xeb52('0x4b')](handleError(_0x3ea3a2,null));};exports[_0xeb52('0x65')]=function(_0x2bf69f,_0x1fc3d1,_0x401221){var _0x190080=_0x2bf69f[_0xeb52('0x4f')][_0xeb52('0x66')];return db[_0xeb52('0x64')]['findAll']({'where':{'id':_0x190080},'attributes':['id'],'include':[{'model':db[_0xeb52('0x67')],'as':_0xeb52('0x68'),'attributes':['id',_0xeb52('0x31'),_0xeb52('0x69'),_0xeb52('0x6a'),_0xeb52('0x6b')],'raw':!![]}]})[_0xeb52('0x2a')](function(_0x47ddc5){if(_0x47ddc5){var _0x3e5b17=_[_0xeb52('0x6c')](_0x47ddc5,function(_0x3507c1){var _0x5f3fdd=_0x3507c1[_0xeb52('0x2c')]({'plain':!![]});return _0x5f3fdd[_0xeb52('0x68')];});return db[_0xeb52('0x34')]['find']({'where':{'id':_0x2bf69f['params']['id']}})[_0xeb52('0x2a')](function(_0x2e2372){return db[_0xeb52('0x6d')]['transaction'](function(_0x451447){return _0x2e2372[_0xeb52('0x65')](_0x190080,{'transaction':_0x451447})[_0xeb52('0x2a')](function(){return BPromise[_0xeb52('0x6e')](_0x3e5b17,function(_0x196580){return db['UserFaxQueue']['findOrCreate']({'where':{'UserId':_0x196580['id'],'FaxQueueId':_0x2bf69f['params']['id']},'transaction':_0x451447});});})[_0xeb52('0x2a')](function(){_0x3e5b17[_0xeb52('0x6f')](function(_0x37fdd5){socket[_0xeb52('0x70')](_0xeb52('0x71'),{'UserId':_0x37fdd5['id'],'FaxQueueId':_0x2e2372['id']});});});});});}})[_0xeb52('0x2a')](respondWithStatusCode(_0x1fc3d1,null))[_0xeb52('0x4b')](handleError(_0x1fc3d1,null));};exports['removeTeams']=function(_0x699c7e,_0x33ac3d,_0x5b558a){return db['Team'][_0xeb52('0x4a')]({'where':{'id':_0x699c7e[_0xeb52('0x39')][_0xeb52('0x66')]},'attributes':['id'],'include':[{'model':db[_0xeb52('0x67')],'as':_0xeb52('0x68'),'attributes':['id'],'raw':!![]}]})[_0xeb52('0x2a')](handleEntityNotFound(_0x33ac3d,null))[_0xeb52('0x2a')](function(_0x2ca554){var _0x2a93ce=_[_0xeb52('0x38')](_0x2ca554,'id');var _0x1f898a=[];var _0x151951=[];var _0x8cf598=squel[_0xeb52('0x72')]();_0x8cf598['field'](_0xeb52('0x73'))['from'](_0xeb52('0x74'),'tq')[_0xeb52('0x75')](_0xeb52('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xeb52('0x45')](_0xeb52('0x77'),_0x699c7e[_0xeb52('0x55')]['id']);for(var _0x5a5f9f=0x0;_0x5a5f9f<_0x2ca554[_0xeb52('0x3f')];_0x5a5f9f+=0x1){let _0xc0752f=_0x2ca554[_0x5a5f9f];for(var _0x1ca6b9=0x0;_0x1ca6b9<_0xc0752f[_0xeb52('0x68')]['length'];_0x1ca6b9+=0x1){let _0x599f71=_0xc0752f['Agents'][_0x1ca6b9];var _0x3a3559=_0x8cf598[_0xeb52('0x78')]();_0x3a3559[_0xeb52('0x45')]('ut.UserId\x20=\x20?',_0x599f71['id']);_0x151951[_0xeb52('0x79')](db[_0xeb52('0x6d')][_0xeb52('0x39')](_0x3a3559[_0xeb52('0x7a')](),{'type':db[_0xeb52('0x6d')][_0xeb52('0x7b')][_0xeb52('0x7c')]})[_0xeb52('0x2a')](function(_0x11fd20){if(_0x11fd20[_0xeb52('0x3f')]===0x1){return _0x599f71['id'];}else{var _0xba7ea7=_[_0xeb52('0x7d')](_[_0xeb52('0x38')](_0x11fd20,_0xeb52('0x7e')),function(_0x15c052){return _[_0xeb52('0x7f')](_0x2a93ce,_0x15c052);});if(_0xba7ea7){return _0x599f71['id'];}}}));}}return BPromise[_0xeb52('0x80')](_0x151951)[_0xeb52('0x2a')](function(_0x457e08){_0x1f898a=_(_0x1f898a)['union'](_0x457e08)[_0xeb52('0x81')]()[_0xeb52('0x82')]();return db['FaxQueue'][_0xeb52('0x4d')]({'where':{'id':_0x699c7e[_0xeb52('0x55')]['id']}})['then'](function(_0x22df0b){return db['sequelize'][_0xeb52('0x83')](function(_0x1d3ac5){return _0x22df0b[_0xeb52('0x84')](_0x699c7e[_0xeb52('0x39')][_0xeb52('0x66')],{'transaction':_0x1d3ac5})[_0xeb52('0x2a')](function(){if(!_[_0xeb52('0x85')](_0x1f898a)){return _0x22df0b['removeAgents'](_0x1f898a,{'transaction':_0x1d3ac5});}})['then'](function(){_0x1f898a[_0xeb52('0x6f')](function(_0x4277c8){socket[_0xeb52('0x70')](_0xeb52('0x86'),{'UserId':_0x4277c8,'FaxQueueId':_0x22df0b['id']});});});});});});})[_0xeb52('0x2a')](respondWithStatusCode(_0x33ac3d,null))[_0xeb52('0x4b')](handleError(_0x33ac3d,null));};exports[_0xeb52('0x87')]=function(_0x12b336,_0x5af203,_0x95d0ed){return db['FaxQueue'][_0xeb52('0x4d')]({'where':{'id':_0x12b336[_0xeb52('0x55')]['id']}})[_0xeb52('0x2a')](handleEntityNotFound(_0x5af203,null))['then'](function(_0x4944bd){if(_0x4944bd){return _0x4944bd[_0xeb52('0x87')](_0x12b336[_0xeb52('0x4f')][_0xeb52('0x66')],_[_0xeb52('0x88')](_0x12b336[_0xeb52('0x4f')],[_0xeb52('0x66'),'id'])||{})[_0xeb52('0x89')](function(_0x3b0fc0){for(var _0x38b29b=0x0;_0x38b29b<_0x12b336['body']['ids']['length'];_0x38b29b+=0x1){socket[_0xeb52('0x70')]('userFaxQueue:save',{'UserId':Number(_0x12b336[_0xeb52('0x4f')]['ids'][_0x38b29b]),'FaxQueueId':Number(_0x12b336['params']['id'])});}return _0x3b0fc0;});}})[_0xeb52('0x2a')](respondWithResult(_0x5af203,null))[_0xeb52('0x4b')](handleError(_0x5af203,null));};exports[_0xeb52('0x8a')]=function(_0x3cfb74,_0x6846ad,_0x1815b7){return db[_0xeb52('0x34')]['find']({'where':{'id':_0x3cfb74[_0xeb52('0x55')]['id']}})[_0xeb52('0x2a')](handleEntityNotFound(_0x6846ad,null))['then'](function(_0x45a92c){if(_0x45a92c){return _0x45a92c[_0xeb52('0x8a')](_0x3cfb74['query'][_0xeb52('0x66')])['then'](function(){if(_['isArray'](_0x3cfb74[_0xeb52('0x39')]['ids'])){for(var _0x2f712d=0x0;_0x2f712d<_0x3cfb74[_0xeb52('0x39')][_0xeb52('0x66')][_0xeb52('0x3f')];_0x2f712d+=0x1){socket[_0xeb52('0x70')](_0xeb52('0x86'),{'UserId':Number(_0x3cfb74[_0xeb52('0x39')]['ids'][_0x2f712d]),'FaxQueueId':Number(_0x3cfb74[_0xeb52('0x55')]['id'])});}}else{socket[_0xeb52('0x70')](_0xeb52('0x86'),{'UserId':Number(_0x3cfb74[_0xeb52('0x39')]['ids']),'FaxQueueId':Number(_0x3cfb74['params']['id'])});}});}})[_0xeb52('0x2a')](respondWithStatusCode(_0x6846ad,null))['catch'](handleError(_0x6846ad,null));};exports[_0xeb52('0x8b')]=function(_0x1222cc,_0x50dc68,_0xfc3154){var _0x2c0001={};var _0x5792f5={};var _0x59b832;var _0x236b35;return db['FaxQueue'][_0xeb52('0x63')]({'where':{'id':_0x1222cc[_0xeb52('0x55')]['id']}})[_0xeb52('0x2a')](handleEntityNotFound(_0x50dc68,null))[_0xeb52('0x2a')](function(_0x984367){if(_0x984367){_0x59b832=_0x984367;_0x5792f5[_0xeb52('0x37')]=_[_0xeb52('0x3a')](db[_0xeb52('0x67')][_0xeb52('0x35')]);_0x5792f5[_0xeb52('0x39')]=_[_0xeb52('0x3a')](_0x1222cc['query']);_0x5792f5[_0xeb52('0x3b')]=_['intersection'](_0x5792f5[_0xeb52('0x37')],_0x5792f5[_0xeb52('0x39')]);_0x2c0001[_0xeb52('0x3e')]=_[_0xeb52('0x3c')](_0x5792f5[_0xeb52('0x37')],qs[_0xeb52('0x3d')](_0x1222cc[_0xeb52('0x39')][_0xeb52('0x3d')]));_0x2c0001[_0xeb52('0x3e')]=_0x2c0001[_0xeb52('0x3e')][_0xeb52('0x3f')]?_0x2c0001[_0xeb52('0x3e')]:_0x5792f5[_0xeb52('0x37')];_0x2c0001['order']=qs[_0xeb52('0x43')](_0x1222cc['query']['sort']);_0x2c0001[_0xeb52('0x45')]=qs[_0xeb52('0x3b')](_[_0xeb52('0x58')](_0x1222cc[_0xeb52('0x39')],_0x5792f5[_0xeb52('0x3b')]));if(_0x1222cc['query'][_0xeb52('0x44')]){_0x2c0001['where']=_['merge'](_0x2c0001[_0xeb52('0x45')],{'$or':_[_0xeb52('0x38')](_0x2c0001[_0xeb52('0x3e')],function(_0x3dc9d6){var _0x4271ee={};_0x4271ee[_0x3dc9d6]={'$like':'%'+_0x1222cc[_0xeb52('0x39')][_0xeb52('0x44')]+'%'};return _0x4271ee;})});}_0x2c0001=_['merge']({},_0x2c0001,_0x1222cc[_0xeb52('0x48')]);return _0x59b832[_0xeb52('0x8b')](_0x2c0001);}})[_0xeb52('0x2a')](function(_0x37fd4b){if(_0x37fd4b){_0x236b35=_0x37fd4b[_0xeb52('0x3f')];if(!_0x1222cc[_0xeb52('0x39')]['hasOwnProperty'](_0xeb52('0x41'))){_0x2c0001[_0xeb52('0x25')]=qs[_0xeb52('0x25')](_0x1222cc[_0xeb52('0x39')][_0xeb52('0x25')]);_0x2c0001['offset']=qs[_0xeb52('0x24')](_0x1222cc['query'][_0xeb52('0x24')]);}return _0x59b832['getAgents'](_0x2c0001);}})[_0xeb52('0x2a')](function(_0x40ff35){if(_0x40ff35){return _0x40ff35?{'count':_0x236b35,'rows':_0x40ff35}:null;}})[_0xeb52('0x2a')](respondWithResult(_0x50dc68,null))[_0xeb52('0x4b')](handleError(_0x50dc68,null));}; \ No newline at end of file +var _0xb473=['findAll','tq.TeamId','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','isEmpty','addAgents','omit','spread','removeAgents','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./faxQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','get','UserProfileResource','error','stack','name','map','FaxQueue','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','destroy','describe','findOne','UserFaxQueue','length','order','User','findAndCountAll','agent','faxPause','format','SIP','createdAt','updatedAt','getTeams','Team','sort','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userFaxQueue:save'];(function(_0x82fab6,_0x1fbe18){var _0x58df9a=function(_0x3a2805){while(--_0x3a2805){_0x82fab6['push'](_0x82fab6['shift']());}};_0x58df9a(++_0x1fbe18);}(_0xb473,0x1b7));var _0x3b47=function(_0x20cf8a,_0x44cd6b){_0x20cf8a=_0x20cf8a-0x0;var _0x54e165=_0xb473[_0x20cf8a];return _0x54e165;};'use strict';var emlformat=require(_0x3b47('0x0'));var rimraf=require(_0x3b47('0x1'));var zipdir=require(_0x3b47('0x2'));var jsonpatch=require(_0x3b47('0x3'));var rp=require(_0x3b47('0x4'));var moment=require(_0x3b47('0x5'));var BPromise=require(_0x3b47('0x6'));var Mustache=require(_0x3b47('0x7'));var util=require(_0x3b47('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x3b47('0x9'));var ejs=require(_0x3b47('0xa'));var fs=require('fs');var fs_extra=require(_0x3b47('0xb'));var _=require(_0x3b47('0xc'));var squel=require('squel');var crypto=require(_0x3b47('0xd'));var jsforce=require(_0x3b47('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3b47('0x9'));var querystring=require(_0x3b47('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3b47('0x10'));var qs=require(_0x3b47('0x11'));var as=require(_0x3b47('0x12'));var hardwareService=require(_0x3b47('0x13'));var logger=require(_0x3b47('0x14'))(_0x3b47('0x15'));var utils=require(_0x3b47('0x16'));var config=require(_0x3b47('0x17'));var licenseUtil=require(_0x3b47('0x18'));var db=require(_0x3b47('0x19'))['db'];config['redis']=_[_0x3b47('0x1a')](config[_0x3b47('0x1b')],{'host':_0x3b47('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3b47('0x1b')]));require(_0x3b47('0x1d'))[_0x3b47('0x1e')](socket);function respondWithStatusCode(_0x46e6f8,_0x294845){_0x294845=_0x294845||0xcc;return function(_0x3e41bc){if(_0x3e41bc){return _0x46e6f8[_0x3b47('0x1f')](_0x294845);}return _0x46e6f8['status'](_0x294845)[_0x3b47('0x20')]();};}function respondWithResult(_0xd0d1bc,_0x4d469f){_0x4d469f=_0x4d469f||0xc8;return function(_0x57b6e1){if(_0x57b6e1){return _0xd0d1bc[_0x3b47('0x21')](_0x4d469f)[_0x3b47('0x22')](_0x57b6e1);}};}function respondWithFilteredResult(_0x46d789,_0x23b83e){return function(_0x47cc11){if(_0x47cc11){var _0x5ef38c=typeof _0x23b83e[_0x3b47('0x23')]===_0x3b47('0x24')&&typeof _0x23b83e[_0x3b47('0x25')]==='undefined';var _0x45192f=_0x47cc11[_0x3b47('0x26')];var _0x746c5a=_0x5ef38c?0x0:_0x23b83e[_0x3b47('0x23')];var _0x37af9d=_0x5ef38c?_0x47cc11[_0x3b47('0x26')]:_0x23b83e['offset']+_0x23b83e[_0x3b47('0x25')];var _0x4039a7;if(_0x37af9d>=_0x45192f){_0x37af9d=_0x45192f;_0x4039a7=0xc8;}else{_0x4039a7=0xce;}_0x46d789[_0x3b47('0x21')](_0x4039a7);return _0x46d789['set'](_0x3b47('0x27'),_0x746c5a+'-'+_0x37af9d+'/'+_0x45192f)[_0x3b47('0x22')](_0x47cc11);}return null;};}function patchUpdates(_0x11d572){return function(_0x31143d){try{jsonpatch['apply'](_0x31143d,_0x11d572,!![]);}catch(_0x37f61e){return BPromise[_0x3b47('0x28')](_0x37f61e);}return _0x31143d[_0x3b47('0x29')]();};}function saveUpdates(_0x4bbf2d,_0x25727a){return function(_0x2cf4db){if(_0x2cf4db){return _0x2cf4db[_0x3b47('0x2a')](_0x4bbf2d)[_0x3b47('0x2b')](function(_0x4372e0){return _0x4372e0;});}return null;};}function removeEntity(_0x431793,_0x5b068c){return function(_0x1f69a0){if(_0x1f69a0){return _0x1f69a0['destroy']()[_0x3b47('0x2b')](function(){var _0x1a42d6=_0x1f69a0[_0x3b47('0x2c')]({'plain':!![]});var _0x22667d='FaxQueues';return db[_0x3b47('0x2d')]['destroy']({'where':{'type':_0x22667d,'resourceId':_0x1a42d6['id']}})[_0x3b47('0x2b')](function(){return _0x1f69a0;});})['then'](function(){_0x431793[_0x3b47('0x21')](0xcc)[_0x3b47('0x20')]();});}};}function handleEntityNotFound(_0x31c9ed,_0x5d3848){return function(_0x4533b2){if(!_0x4533b2){_0x31c9ed[_0x3b47('0x1f')](0x194);}return _0x4533b2;};}function handleError(_0x53c61f,_0x1867b4){_0x1867b4=_0x1867b4||0x1f4;return function(_0x4e85a9){logger[_0x3b47('0x2e')](_0x4e85a9[_0x3b47('0x2f')]);if(_0x4e85a9[_0x3b47('0x30')]){delete _0x4e85a9[_0x3b47('0x30')];}_0x53c61f[_0x3b47('0x21')](_0x1867b4)['send'](_0x4e85a9);};}exports['index']=function(_0x574b0d,_0x1a54c7){var _0x6bf99d={},_0x3f230e={},_0x165bd9={'count':0x0,'rows':[]};var _0x34fa55=_[_0x3b47('0x31')](db[_0x3b47('0x32')]['rawAttributes'],function(_0x3b06d5){return{'name':_0x3b06d5['fieldName'],'type':_0x3b06d5[_0x3b47('0x33')][_0x3b47('0x34')]};});_0x3f230e[_0x3b47('0x35')]=_[_0x3b47('0x31')](_0x34fa55,_0x3b47('0x30'));_0x3f230e[_0x3b47('0x36')]=_[_0x3b47('0x37')](_0x574b0d[_0x3b47('0x36')]);_0x3f230e['filters']=_[_0x3b47('0x38')](_0x3f230e[_0x3b47('0x35')],_0x3f230e[_0x3b47('0x36')]);_0x6bf99d['attributes']=_['intersection'](_0x3f230e[_0x3b47('0x35')],qs[_0x3b47('0x39')](_0x574b0d[_0x3b47('0x36')][_0x3b47('0x39')]));_0x6bf99d[_0x3b47('0x3a')]=_0x6bf99d[_0x3b47('0x3a')]['length']?_0x6bf99d['attributes']:_0x3f230e[_0x3b47('0x35')];if(!_0x574b0d['query'][_0x3b47('0x3b')](_0x3b47('0x3c'))){_0x6bf99d[_0x3b47('0x25')]=qs[_0x3b47('0x25')](_0x574b0d[_0x3b47('0x36')][_0x3b47('0x25')]);_0x6bf99d[_0x3b47('0x23')]=qs[_0x3b47('0x23')](_0x574b0d[_0x3b47('0x36')][_0x3b47('0x23')]);}_0x6bf99d['order']=qs['sort'](_0x574b0d[_0x3b47('0x36')]['sort']);_0x6bf99d[_0x3b47('0x3d')]=qs[_0x3b47('0x3e')](_[_0x3b47('0x3f')](_0x574b0d['query'],_0x3f230e[_0x3b47('0x3e')]),_0x34fa55);if(_0x574b0d[_0x3b47('0x36')][_0x3b47('0x40')]){_0x6bf99d[_0x3b47('0x3d')]=_[_0x3b47('0x41')](_0x6bf99d[_0x3b47('0x3d')],{'$or':_[_0x3b47('0x31')](_0x34fa55,function(_0x329c08){if(_0x329c08[_0x3b47('0x33')]!==_0x3b47('0x42')){var _0x2122eb={};_0x2122eb[_0x329c08[_0x3b47('0x30')]]={'$like':'%'+_0x574b0d[_0x3b47('0x36')]['filter']+'%'};return _0x2122eb;}})});}_0x6bf99d=_[_0x3b47('0x41')]({},_0x6bf99d,_0x574b0d[_0x3b47('0x43')]);var _0x2e939c={'where':_0x6bf99d[_0x3b47('0x3d')]};return db[_0x3b47('0x32')][_0x3b47('0x26')](_0x2e939c)[_0x3b47('0x2b')](function(_0x450437){_0x165bd9['count']=_0x450437;if(_0x574b0d[_0x3b47('0x36')][_0x3b47('0x44')]){_0x6bf99d[_0x3b47('0x45')]=[{'all':!![]}];}return db[_0x3b47('0x32')]['findAll'](_0x6bf99d);})[_0x3b47('0x2b')](function(_0xd774a9){_0x165bd9[_0x3b47('0x46')]=_0xd774a9;return _0x165bd9;})[_0x3b47('0x2b')](respondWithFilteredResult(_0x1a54c7,_0x6bf99d))[_0x3b47('0x47')](handleError(_0x1a54c7,null));};exports[_0x3b47('0x48')]=function(_0x22d2f6,_0x5248ab){var _0x4e7979={'raw':!![],'where':{'id':_0x22d2f6['params']['id']}},_0x26e902={};_0x26e902[_0x3b47('0x35')]=_['keys'](db['FaxQueue'][_0x3b47('0x49')]);_0x26e902[_0x3b47('0x36')]=_[_0x3b47('0x37')](_0x22d2f6[_0x3b47('0x36')]);_0x26e902[_0x3b47('0x3e')]=_[_0x3b47('0x38')](_0x26e902[_0x3b47('0x35')],_0x26e902[_0x3b47('0x36')]);_0x4e7979['attributes']=_['intersection'](_0x26e902[_0x3b47('0x35')],qs[_0x3b47('0x39')](_0x22d2f6['query'][_0x3b47('0x39')]));_0x4e7979[_0x3b47('0x3a')]=_0x4e7979[_0x3b47('0x3a')]['length']?_0x4e7979[_0x3b47('0x3a')]:_0x26e902[_0x3b47('0x35')];if(_0x22d2f6['query'][_0x3b47('0x44')]){_0x4e7979['include']=[{'all':!![]}];}_0x4e7979=_[_0x3b47('0x41')]({},_0x4e7979,_0x22d2f6['options']);return db[_0x3b47('0x32')][_0x3b47('0x4a')](_0x4e7979)[_0x3b47('0x2b')](handleEntityNotFound(_0x5248ab,null))[_0x3b47('0x2b')](respondWithResult(_0x5248ab,null))[_0x3b47('0x47')](handleError(_0x5248ab,null));};exports['create']=function(_0xec1ac8,_0x3aea56){return db[_0x3b47('0x32')][_0x3b47('0x4b')](_0xec1ac8['body'],{})[_0x3b47('0x2b')](function(_0x42d526){var _0x507403=_0xec1ac8[_0x3b47('0x4c')][_0x3b47('0x2c')]({'plain':!![]});if(!_0x507403)throw new Error(_0x3b47('0x4d'));if(_0x507403[_0x3b47('0x4e')]===_0x3b47('0x4c')){var _0x4b5ea0=_0x42d526[_0x3b47('0x2c')]({'plain':!![]});var _0x5d8dc6='FaxQueues';return db['UserProfileSection']['find']({'where':{'name':_0x5d8dc6,'userProfileId':_0x507403[_0x3b47('0x4f')]},'raw':!![]})[_0x3b47('0x2b')](function(_0x34d2db){if(_0x34d2db&&_0x34d2db[_0x3b47('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x4b5ea0['name'],'resourceId':_0x4b5ea0['id'],'type':_0x34d2db['name'],'sectionId':_0x34d2db['id']},{})['then'](function(){return _0x42d526;});}else{return _0x42d526;}})['catch'](function(_0x57ba61){logger[_0x3b47('0x2e')](_0x3b47('0x51'),_0x57ba61);throw _0x57ba61;});}return _0x42d526;})[_0x3b47('0x2b')](respondWithResult(_0x3aea56,0xc9))[_0x3b47('0x47')](handleError(_0x3aea56,null));};exports['update']=function(_0x848222,_0x306a8f){if(_0x848222[_0x3b47('0x52')]['id']){delete _0x848222[_0x3b47('0x52')]['id'];}return db['FaxQueue'][_0x3b47('0x4a')]({'where':{'id':_0x848222[_0x3b47('0x53')]['id']}})[_0x3b47('0x2b')](handleEntityNotFound(_0x306a8f,null))[_0x3b47('0x2b')](saveUpdates(_0x848222['body'],null))[_0x3b47('0x2b')](respondWithResult(_0x306a8f,null))['catch'](handleError(_0x306a8f,null));};exports[_0x3b47('0x54')]=function(_0x47e964,_0x175c5a){return db[_0x3b47('0x32')][_0x3b47('0x4a')]({'where':{'id':_0x47e964[_0x3b47('0x53')]['id']}})[_0x3b47('0x2b')](handleEntityNotFound(_0x175c5a,null))[_0x3b47('0x2b')](removeEntity(_0x175c5a,null))['catch'](handleError(_0x175c5a,null));};exports[_0x3b47('0x55')]=function(_0x4b9a2e,_0x121fd2){return db[_0x3b47('0x32')][_0x3b47('0x55')]()[_0x3b47('0x2b')](respondWithResult(_0x121fd2,null))[_0x3b47('0x47')](handleError(_0x121fd2,null));};exports['getMembers']=function(_0x42c4d0,_0x19f939,_0x251f43){var _0x2266a1={'raw':!![],'where':{}},_0x15f11f={},_0x31ce53;return db[_0x3b47('0x32')][_0x3b47('0x56')]({'where':{'id':_0x42c4d0['params']['id']}})[_0x3b47('0x2b')](handleEntityNotFound(_0x19f939,null))[_0x3b47('0x2b')](function(_0x2c1d33){if(_0x2c1d33){_0x31ce53=_0x2c1d33['get']({'plain':!![]});_0x15f11f[_0x3b47('0x35')]=_[_0x3b47('0x37')](db[_0x3b47('0x57')][_0x3b47('0x49')]);_0x15f11f[_0x3b47('0x36')]=_[_0x3b47('0x37')](_0x42c4d0[_0x3b47('0x36')]);_0x15f11f['filters']=_[_0x3b47('0x38')](_0x15f11f['model'],_0x15f11f['query']);_0x2266a1[_0x3b47('0x3a')]=_['intersection'](_0x15f11f[_0x3b47('0x35')],qs['fields'](_0x42c4d0[_0x3b47('0x36')][_0x3b47('0x39')]));_0x2266a1[_0x3b47('0x3a')]=_0x2266a1['attributes'][_0x3b47('0x58')]?_0x2266a1[_0x3b47('0x3a')]:_0x15f11f[_0x3b47('0x35')];if(!_0x42c4d0[_0x3b47('0x36')]['hasOwnProperty'](_0x3b47('0x3c'))){_0x2266a1[_0x3b47('0x25')]=qs[_0x3b47('0x25')](_0x42c4d0[_0x3b47('0x36')][_0x3b47('0x25')]);_0x2266a1['offset']=qs[_0x3b47('0x23')](_0x42c4d0[_0x3b47('0x36')][_0x3b47('0x23')]);}_0x2266a1[_0x3b47('0x59')]=qs['sort'](_0x42c4d0['query']['sort']);_0x2266a1[_0x3b47('0x3d')]=qs[_0x3b47('0x3e')](_[_0x3b47('0x3f')](_0x42c4d0['query'],_0x15f11f['filters']));_0x2266a1[_0x3b47('0x3d')]['FaxQueueId']=_0x2c1d33['id'];if(_0x42c4d0[_0x3b47('0x36')][_0x3b47('0x40')]){_0x2266a1['where']=_[_0x3b47('0x41')](_0x2266a1[_0x3b47('0x3d')],{'$or':_[_0x3b47('0x31')](_0x2266a1['attributes'],function(_0x30f6a0){var _0x455865={};_0x455865[_0x30f6a0]={'$like':'%'+_0x42c4d0[_0x3b47('0x36')][_0x3b47('0x40')]+'%'};return _0x455865;})});}_0x2266a1=_[_0x3b47('0x41')]({},_0x2266a1,_0x42c4d0['options']);return db[_0x3b47('0x57')]['findAll'](_0x2266a1);}})[_0x3b47('0x2b')](function(_0x219db1){if(_0x219db1){return db[_0x3b47('0x5a')][_0x3b47('0x5b')]({'where':{'id':_[_0x3b47('0x31')](_0x219db1,'UserId'),'role':_0x3b47('0x5c')},'attributes':['id',_0x3b47('0x30'),_0x3b47('0x5d'),'updatedAt','createdAt']});}})[_0x3b47('0x2b')](function(_0x32ee90){if(_0x32ee90){return{'count':_0x32ee90['count'],'rows':_[_0x3b47('0x31')](_0x32ee90[_0x3b47('0x46')],function(_0x4b4fef){return{'membername':_0x4b4fef[_0x3b47('0x30')],'UserId':_0x4b4fef['id'],'queue_name':_0x31ce53[_0x3b47('0x30')],'FaxQueueId':_0x31ce53['id'],'interface':util[_0x3b47('0x5e')]('%s/%s',_0x3b47('0x5f'),_0x4b4fef['name']),'penalty':0x0,'paused':_0x4b4fef[_0x3b47('0x5d')],'createdAt':_0x4b4fef[_0x3b47('0x60')],'updatedAt':_0x4b4fef[_0x3b47('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3b47('0x2b')](respondWithFilteredResult(_0x19f939,_0x2266a1))[_0x3b47('0x47')](handleError(_0x19f939,null));};exports[_0x3b47('0x62')]=function(_0x575c0e,_0x129cf6,_0x44fb53){var _0x431105={};var _0x5d16ba={};var _0x4a4b4d;var _0x28d174;return db[_0x3b47('0x32')][_0x3b47('0x56')]({'where':{'id':_0x575c0e[_0x3b47('0x53')]['id']}})[_0x3b47('0x2b')](handleEntityNotFound(_0x129cf6,null))[_0x3b47('0x2b')](function(_0x1c689f){if(_0x1c689f){_0x4a4b4d=_0x1c689f;_0x5d16ba[_0x3b47('0x35')]=_[_0x3b47('0x37')](db[_0x3b47('0x63')][_0x3b47('0x49')]);_0x5d16ba[_0x3b47('0x36')]=_[_0x3b47('0x37')](_0x575c0e[_0x3b47('0x36')]);_0x5d16ba[_0x3b47('0x3e')]=_[_0x3b47('0x38')](_0x5d16ba['model'],_0x5d16ba[_0x3b47('0x36')]);_0x431105[_0x3b47('0x3a')]=_[_0x3b47('0x38')](_0x5d16ba[_0x3b47('0x35')],qs['fields'](_0x575c0e[_0x3b47('0x36')][_0x3b47('0x39')]));_0x431105[_0x3b47('0x3a')]=_0x431105[_0x3b47('0x3a')]['length']?_0x431105['attributes']:_0x5d16ba[_0x3b47('0x35')];_0x431105[_0x3b47('0x59')]=qs['sort'](_0x575c0e[_0x3b47('0x36')][_0x3b47('0x64')]);_0x431105[_0x3b47('0x3d')]=qs[_0x3b47('0x3e')](_[_0x3b47('0x3f')](_0x575c0e[_0x3b47('0x36')],_0x5d16ba['filters']));if(_0x575c0e[_0x3b47('0x36')][_0x3b47('0x40')]){_0x431105[_0x3b47('0x3d')]=_['merge'](_0x431105[_0x3b47('0x3d')],{'$or':_[_0x3b47('0x31')](_0x431105[_0x3b47('0x3a')],function(_0x1ff0c3){var _0x597665={};_0x597665[_0x1ff0c3]={'$like':'%'+_0x575c0e['query'][_0x3b47('0x40')]+'%'};return _0x597665;})});}_0x431105=_['merge']({},_0x431105,_0x575c0e[_0x3b47('0x43')]);return _0x4a4b4d[_0x3b47('0x62')](_0x431105);}})[_0x3b47('0x2b')](function(_0x159631){if(_0x159631){_0x28d174=_0x159631['length'];if(!_0x575c0e['query']['hasOwnProperty'](_0x3b47('0x3c'))){_0x431105['limit']=qs[_0x3b47('0x25')](_0x575c0e['query'][_0x3b47('0x25')]);_0x431105[_0x3b47('0x23')]=qs['offset'](_0x575c0e['query'][_0x3b47('0x23')]);}return _0x4a4b4d[_0x3b47('0x62')](_0x431105);}})[_0x3b47('0x2b')](function(_0x455a69){if(_0x455a69){return _0x455a69?{'count':_0x28d174,'rows':_0x455a69}:null;}})[_0x3b47('0x2b')](respondWithResult(_0x129cf6,null))[_0x3b47('0x47')](handleError(_0x129cf6,null));};exports[_0x3b47('0x65')]=function(_0x109282,_0x49a877,_0x44e35e){var _0x535857=_0x109282['body'][_0x3b47('0x66')];return db[_0x3b47('0x63')]['findAll']({'where':{'id':_0x535857},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3b47('0x67'),'attributes':['id',_0x3b47('0x30'),_0x3b47('0x68'),'voicePause',_0x3b47('0x69')],'raw':!![]}]})[_0x3b47('0x2b')](function(_0x50c677){if(_0x50c677){var _0x160a5c=_[_0x3b47('0x6a')](_0x50c677,function(_0x1de89c){var _0x92a9f3=_0x1de89c[_0x3b47('0x2c')]({'plain':!![]});return _0x92a9f3[_0x3b47('0x67')];});return db['FaxQueue']['find']({'where':{'id':_0x109282[_0x3b47('0x53')]['id']}})[_0x3b47('0x2b')](function(_0x6cfcc4){return db[_0x3b47('0x6b')][_0x3b47('0x6c')](function(_0x1db1bb){return _0x6cfcc4[_0x3b47('0x65')](_0x535857,{'transaction':_0x1db1bb})[_0x3b47('0x2b')](function(){return BPromise[_0x3b47('0x6d')](_0x160a5c,function(_0x3dc891){return db['UserFaxQueue'][_0x3b47('0x6e')]({'where':{'UserId':_0x3dc891['id'],'FaxQueueId':_0x109282[_0x3b47('0x53')]['id']},'transaction':_0x1db1bb});});})[_0x3b47('0x2b')](function(){_0x160a5c['forEach'](function(_0x4f3e49){socket[_0x3b47('0x6f')](_0x3b47('0x70'),{'UserId':_0x4f3e49['id'],'FaxQueueId':_0x6cfcc4['id']});});});});});}})[_0x3b47('0x2b')](respondWithStatusCode(_0x49a877,null))[_0x3b47('0x47')](handleError(_0x49a877,null));};exports['removeTeams']=function(_0x504d9d,_0x539c0c,_0x4bf3f2){return db[_0x3b47('0x63')][_0x3b47('0x71')]({'where':{'id':_0x504d9d['query'][_0x3b47('0x66')]},'attributes':['id'],'include':[{'model':db[_0x3b47('0x5a')],'as':_0x3b47('0x67'),'attributes':['id'],'raw':!![]}]})[_0x3b47('0x2b')](handleEntityNotFound(_0x539c0c,null))[_0x3b47('0x2b')](function(_0x4fb665){var _0x351873=_['map'](_0x4fb665,'id');var _0x1519e2=[];var _0x420a47=[];var _0x4efa9b=squel['select']();_0x4efa9b['field'](_0x3b47('0x72'))['from'](_0x3b47('0x73'),'tq')[_0x3b47('0x74')]('user_has_teams','ut',_0x3b47('0x75'))['where']('FaxQueueId\x20=\x20?',_0x504d9d[_0x3b47('0x53')]['id']);for(var _0x15a1e2=0x0;_0x15a1e2<_0x4fb665[_0x3b47('0x58')];_0x15a1e2+=0x1){let _0x5ecbf9=_0x4fb665[_0x15a1e2];for(var _0xdda341=0x0;_0xdda341<_0x5ecbf9[_0x3b47('0x67')][_0x3b47('0x58')];_0xdda341+=0x1){let _0x464c37=_0x5ecbf9[_0x3b47('0x67')][_0xdda341];var _0x5c0803=_0x4efa9b[_0x3b47('0x76')]();_0x5c0803[_0x3b47('0x3d')](_0x3b47('0x77'),_0x464c37['id']);_0x420a47[_0x3b47('0x78')](db['sequelize'][_0x3b47('0x36')](_0x5c0803[_0x3b47('0x79')](),{'type':db[_0x3b47('0x6b')][_0x3b47('0x7a')][_0x3b47('0x7b')]})[_0x3b47('0x2b')](function(_0xc7dabf){if(_0xc7dabf[_0x3b47('0x58')]===0x1){return _0x464c37['id'];}else{var _0x44fc16=_[_0x3b47('0x7c')](_[_0x3b47('0x31')](_0xc7dabf,_0x3b47('0x7d')),function(_0x3ea246){return _[_0x3b47('0x7e')](_0x351873,_0x3ea246);});if(_0x44fc16){return _0x464c37['id'];}}}));}}return BPromise[_0x3b47('0x7f')](_0x420a47)['then'](function(_0x21c5b0){_0x1519e2=_(_0x1519e2)[_0x3b47('0x80')](_0x21c5b0)['compact']()[_0x3b47('0x81')]();return db[_0x3b47('0x32')][_0x3b47('0x4a')]({'where':{'id':_0x504d9d[_0x3b47('0x53')]['id']}})['then'](function(_0x16660c){return db[_0x3b47('0x6b')]['transaction'](function(_0x48d9c4){return _0x16660c['removeTeams'](_0x504d9d['query']['ids'],{'transaction':_0x48d9c4})[_0x3b47('0x2b')](function(){if(!_[_0x3b47('0x82')](_0x1519e2)){return _0x16660c['removeAgents'](_0x1519e2,{'transaction':_0x48d9c4});}})[_0x3b47('0x2b')](function(){_0x1519e2['forEach'](function(_0x2a15f1){socket[_0x3b47('0x6f')]('userFaxQueue:remove',{'UserId':_0x2a15f1,'FaxQueueId':_0x16660c['id']});});});});});});})['then'](respondWithStatusCode(_0x539c0c,null))[_0x3b47('0x47')](handleError(_0x539c0c,null));};exports[_0x3b47('0x83')]=function(_0x1c8323,_0x305aa7,_0x20f469){return db[_0x3b47('0x32')]['find']({'where':{'id':_0x1c8323[_0x3b47('0x53')]['id']}})['then'](handleEntityNotFound(_0x305aa7,null))[_0x3b47('0x2b')](function(_0x382cc6){if(_0x382cc6){return _0x382cc6['addAgents'](_0x1c8323[_0x3b47('0x52')][_0x3b47('0x66')],_[_0x3b47('0x84')](_0x1c8323[_0x3b47('0x52')],[_0x3b47('0x66'),'id'])||{})[_0x3b47('0x85')](function(_0x1b52c6){for(var _0x21627d=0x0;_0x21627d<_0x1c8323[_0x3b47('0x52')][_0x3b47('0x66')][_0x3b47('0x58')];_0x21627d+=0x1){socket[_0x3b47('0x6f')](_0x3b47('0x70'),{'UserId':Number(_0x1c8323[_0x3b47('0x52')][_0x3b47('0x66')][_0x21627d]),'FaxQueueId':Number(_0x1c8323[_0x3b47('0x53')]['id'])});}return _0x1b52c6;});}})[_0x3b47('0x2b')](respondWithResult(_0x305aa7,null))[_0x3b47('0x47')](handleError(_0x305aa7,null));};exports[_0x3b47('0x86')]=function(_0x2d47bb,_0x96fd28,_0x352bee){return db[_0x3b47('0x32')][_0x3b47('0x4a')]({'where':{'id':_0x2d47bb[_0x3b47('0x53')]['id']}})[_0x3b47('0x2b')](handleEntityNotFound(_0x96fd28,null))[_0x3b47('0x2b')](function(_0x2aeefb){if(_0x2aeefb){return _0x2aeefb[_0x3b47('0x86')](_0x2d47bb[_0x3b47('0x36')]['ids'])[_0x3b47('0x2b')](function(){if(_[_0x3b47('0x87')](_0x2d47bb[_0x3b47('0x36')][_0x3b47('0x66')])){for(var _0x58c5ba=0x0;_0x58c5ba<_0x2d47bb[_0x3b47('0x36')][_0x3b47('0x66')][_0x3b47('0x58')];_0x58c5ba+=0x1){socket[_0x3b47('0x6f')](_0x3b47('0x88'),{'UserId':Number(_0x2d47bb[_0x3b47('0x36')][_0x3b47('0x66')][_0x58c5ba]),'FaxQueueId':Number(_0x2d47bb[_0x3b47('0x53')]['id'])});}}else{socket[_0x3b47('0x6f')](_0x3b47('0x88'),{'UserId':Number(_0x2d47bb['query']['ids']),'FaxQueueId':Number(_0x2d47bb['params']['id'])});}});}})[_0x3b47('0x2b')](respondWithStatusCode(_0x96fd28,null))[_0x3b47('0x47')](handleError(_0x96fd28,null));};exports['getAgents']=function(_0x4777ae,_0x1226c4,_0x2f987b){var _0x226168={};var _0x281f93={};var _0x6bf4ce;var _0x6bbad8;return db['FaxQueue'][_0x3b47('0x56')]({'where':{'id':_0x4777ae[_0x3b47('0x53')]['id']}})['then'](handleEntityNotFound(_0x1226c4,null))['then'](function(_0x34bef6){if(_0x34bef6){_0x6bf4ce=_0x34bef6;_0x281f93['model']=_[_0x3b47('0x37')](db[_0x3b47('0x5a')][_0x3b47('0x49')]);_0x281f93[_0x3b47('0x36')]=_['keys'](_0x4777ae[_0x3b47('0x36')]);_0x281f93[_0x3b47('0x3e')]=_[_0x3b47('0x38')](_0x281f93[_0x3b47('0x35')],_0x281f93['query']);_0x226168['attributes']=_[_0x3b47('0x38')](_0x281f93[_0x3b47('0x35')],qs[_0x3b47('0x39')](_0x4777ae[_0x3b47('0x36')][_0x3b47('0x39')]));_0x226168[_0x3b47('0x3a')]=_0x226168[_0x3b47('0x3a')][_0x3b47('0x58')]?_0x226168['attributes']:_0x281f93['model'];_0x226168['order']=qs[_0x3b47('0x64')](_0x4777ae[_0x3b47('0x36')]['sort']);_0x226168[_0x3b47('0x3d')]=qs['filters'](_['pick'](_0x4777ae['query'],_0x281f93[_0x3b47('0x3e')]));if(_0x4777ae[_0x3b47('0x36')]['filter']){_0x226168[_0x3b47('0x3d')]=_[_0x3b47('0x41')](_0x226168[_0x3b47('0x3d')],{'$or':_['map'](_0x226168[_0x3b47('0x3a')],function(_0x2b985f){var _0x46a553={};_0x46a553[_0x2b985f]={'$like':'%'+_0x4777ae[_0x3b47('0x36')]['filter']+'%'};return _0x46a553;})});}_0x226168=_['merge']({},_0x226168,_0x4777ae[_0x3b47('0x43')]);return _0x6bf4ce[_0x3b47('0x89')](_0x226168);}})[_0x3b47('0x2b')](function(_0x5845a4){if(_0x5845a4){_0x6bbad8=_0x5845a4[_0x3b47('0x58')];if(!_0x4777ae[_0x3b47('0x36')][_0x3b47('0x3b')](_0x3b47('0x3c'))){_0x226168[_0x3b47('0x25')]=qs[_0x3b47('0x25')](_0x4777ae['query'][_0x3b47('0x25')]);_0x226168[_0x3b47('0x23')]=qs['offset'](_0x4777ae[_0x3b47('0x36')][_0x3b47('0x23')]);}return _0x6bf4ce['getAgents'](_0x226168);}})[_0x3b47('0x2b')](function(_0x1d757d){if(_0x1d757d){return _0x1d757d?{'count':_0x6bbad8,'rows':_0x1d757d}:null;}})[_0x3b47('0x2b')](respondWithResult(_0x1226c4,null))[_0x3b47('0x47')](handleError(_0x1226c4,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 79f07f5..8641de0 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 _0x3a70=['events','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x305d69,_0x3bbf4c){var _0x3fcfc4=function(_0x4bef35){while(--_0x4bef35){_0x305d69['push'](_0x305d69['shift']());}};_0x3fcfc4(++_0x3bbf4c);}(_0x3a70,0x1f1));var _0x03a7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3a70[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x03a7('0x0'));var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x03a7('0x1')](0x0);var events={'afterCreate':_0x03a7('0x2'),'afterUpdate':'update','afterDestroy':_0x03a7('0x3')};function emitEvent(_0x1a90f7){return function(_0x23a234,_0xc7ce05,_0x386974){FaxQueueEvents[_0x03a7('0x4')](_0x1a90f7+':'+_0x23a234['id'],_0x23a234);FaxQueueEvents[_0x03a7('0x4')](_0x1a90f7,_0x23a234);_0x386974(null);};}for(var e in events){if(events[_0x03a7('0x5')](e)){var event=events[e];FaxQueue[_0x03a7('0x6')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0xaa08=['hook','exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xaa08,0xda));var _0x8aa0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xaa08[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0x8aa0('0x0'));var FaxQueue=require(_0x8aa0('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8aa0('0x2'),'afterUpdate':_0x8aa0('0x3'),'afterDestroy':_0x8aa0('0x4')};function emitEvent(_0x27cbf8){return function(_0x4ec7af,_0x5759b2,_0x428b07){FaxQueueEvents['emit'](_0x27cbf8+':'+_0x4ec7af['id'],_0x4ec7af);FaxQueueEvents[_0x8aa0('0x5')](_0x27cbf8,_0x4ec7af);_0x428b07(null);};}for(var e in events){if(events[_0x8aa0('0x6')](e)){var event=events[e];FaxQueue[_0x8aa0('0x7')](e,emitEvent(event));}}module[_0x8aa0('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 97602a2..f45aefc 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 _0x5f28=['util','../../config/logger','api','moment','../../config/environment','exports','define','FaxQueue'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5f28,0x1a8));var _0x85f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f28[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x85f2('0x0'));var logger=require(_0x85f2('0x1'))(_0x85f2('0x2'));var moment=require(_0x85f2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x85f2('0x4'));var attributes=require('./faxQueue.attributes');module[_0x85f2('0x5')]=function(_0x53f00b,_0x24ff3d){return _0x53f00b[_0x85f2('0x6')](_0x85f2('0x7'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x64e1=['bluebird','request-promise','rimraf','./faxQueue.attributes','define','FaxQueue','fax_queues','lodash','util','api'];(function(_0x5bd8a6,_0x14faf5){var _0x5223a5=function(_0x3372df){while(--_0x3372df){_0x5bd8a6['push'](_0x5bd8a6['shift']());}};_0x5223a5(++_0x14faf5);}(_0x64e1,0x1a1));var _0x164e=function(_0x317b11,_0x598f5a){_0x317b11=_0x317b11-0x0;var _0x44e5b8=_0x64e1[_0x317b11];return _0x44e5b8;};'use strict';var _=require(_0x164e('0x0'));var util=require(_0x164e('0x1'));var logger=require('../../config/logger')(_0x164e('0x2'));var moment=require('moment');var BPromise=require(_0x164e('0x3'));var rp=require(_0x164e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x164e('0x5'));var config=require('../../config/environment');var attributes=require(_0x164e('0x6'));module['exports']=function(_0x2fe4bf,_0x148b2e){return _0x2fe4bf[_0x164e('0x7')](_0x164e('0x8'),attributes,{'tableName':_0x164e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 7e768ad..46e9cc8 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 _0x7363=['debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','FaxQueue','findAll','options','where','attributes','include','map','model','GetFaxQueue','raw','ShowFaxQueue','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x18bebd,_0x32f07a){var _0x42524b=function(_0x2db8d2){while(--_0x2db8d2){_0x18bebd['push'](_0x18bebd['shift']());}};_0x42524b(++_0x32f07a);}(_0x7363,0x1a3));var _0x3736=function(_0x5ac8c4,_0x19da6c){_0x5ac8c4=_0x5ac8c4-0x0;var _0xad5e43=_0x7363[_0x5ac8c4];return _0xad5e43;};'use strict';var _=require(_0x3736('0x0'));var util=require(_0x3736('0x1'));var moment=require(_0x3736('0x2'));var BPromise=require('bluebird');var rs=require(_0x3736('0x3'));var fs=require('fs');var Redis=require(_0x3736('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3736('0x5'));var logger=require(_0x3736('0x6'))(_0x3736('0x7'));var config=require(_0x3736('0x8'));var jayson=require(_0x3736('0x9'));var client=jayson['client'][_0x3736('0xa')]({'port':0x232a});config[_0x3736('0xb')]=_['defaults'](config[_0x3736('0xb')],{'host':_0x3736('0xc'),'port':0x18eb});var socket=require(_0x3736('0xd'))(new Redis(config[_0x3736('0xb')]));require(_0x3736('0xe'))[_0x3736('0xf')](socket);function respondWithRpcPromise(_0x5dfe5e,_0x2ab90f,_0x1874b8){return new BPromise(function(_0x4e41e4,_0x3a1ca8){return client[_0x3736('0x10')](_0x5dfe5e,_0x1874b8)[_0x3736('0x11')](function(_0x2f46ac){logger[_0x3736('0x12')](_0x3736('0x13'),_0x2ab90f,_0x3736('0x14'));logger[_0x3736('0x15')](_0x3736('0x16'),_0x2ab90f,_0x3736('0x14'),JSON[_0x3736('0x17')](_0x2f46ac));if(_0x2f46ac['error']){if(_0x2f46ac['error'][_0x3736('0x18')]===0x1f4){logger['error']('FaxQueue,\x20%s,\x20%s',_0x2ab90f,_0x2f46ac[_0x3736('0x19')][_0x3736('0x1a')]);return _0x3a1ca8(_0x2f46ac[_0x3736('0x19')][_0x3736('0x1a')]);}logger[_0x3736('0x19')](_0x3736('0x13'),_0x2ab90f,_0x2f46ac[_0x3736('0x19')]['message']);return _0x4e41e4(_0x2f46ac[_0x3736('0x19')][_0x3736('0x1a')]);}else{logger[_0x3736('0x12')](_0x3736('0x13'),_0x2ab90f,_0x3736('0x14'));_0x4e41e4(_0x2f46ac[_0x3736('0x1b')][_0x3736('0x1a')]);}})[_0x3736('0x1c')](function(_0x4a4a8a){logger[_0x3736('0x19')](_0x3736('0x13'),_0x2ab90f,_0x4a4a8a);_0x3a1ca8(_0x4a4a8a);});});}exports['GetFaxQueue']=function(_0x57a605){var _0x1f647d=this;return new Promise(function(_0x5ad2eb,_0x1a5ddf){return db[_0x3736('0x1d')][_0x3736('0x1e')]({'raw':_0x57a605[_0x3736('0x1f')]?_0x57a605['options']['raw']===undefined?!![]:![]:!![],'where':_0x57a605[_0x3736('0x1f')]?_0x57a605[_0x3736('0x1f')][_0x3736('0x20')]||null:null,'attributes':_0x57a605[_0x3736('0x1f')]?_0x57a605[_0x3736('0x1f')][_0x3736('0x21')]||null:null,'limit':_0x57a605[_0x3736('0x1f')]?_0x57a605[_0x3736('0x1f')]['limit']||null:null,'include':_0x57a605[_0x3736('0x1f')]?_0x57a605[_0x3736('0x1f')][_0x3736('0x22')]?_[_0x3736('0x23')](_0x57a605[_0x3736('0x1f')]['include'],function(_0x4c020f){return{'model':db[_0x4c020f[_0x3736('0x24')]],'as':_0x4c020f['as'],'attributes':_0x4c020f[_0x3736('0x21')],'include':_0x4c020f[_0x3736('0x22')]?_[_0x3736('0x23')](_0x4c020f[_0x3736('0x22')],function(_0x950630){return{'model':db[_0x950630[_0x3736('0x24')]],'as':_0x950630['as'],'attributes':_0x950630[_0x3736('0x21')],'include':_0x950630[_0x3736('0x22')]?_[_0x3736('0x23')](_0x950630['include'],function(_0x52c578){return{'model':db[_0x52c578[_0x3736('0x24')]],'as':_0x52c578['as'],'attributes':_0x52c578[_0x3736('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3736('0x11')](function(_0x4b51af){logger[_0x3736('0x12')](_0x3736('0x25'),_0x57a605);logger[_0x3736('0x15')](_0x3736('0x25'),_0x57a605,JSON[_0x3736('0x17')](_0x4b51af));_0x5ad2eb(_0x4b51af);})[_0x3736('0x1c')](function(_0x21c8e3){logger[_0x3736('0x19')](_0x3736('0x25'),_0x21c8e3[_0x3736('0x1a')],_0x57a605);_0x1a5ddf(_0x1f647d[_0x3736('0x19')](0x1f4,_0x21c8e3[_0x3736('0x1a')]));});});};exports['ShowFaxQueue']=function(_0x550303){var _0x58abbc=this;return new Promise(function(_0x2e4179,_0x209079){return db[_0x3736('0x1d')]['find']({'raw':_0x550303[_0x3736('0x1f')]?_0x550303[_0x3736('0x1f')][_0x3736('0x26')]===undefined?!![]:![]:!![],'where':_0x550303[_0x3736('0x1f')]?_0x550303[_0x3736('0x1f')]['where']||null:null,'attributes':_0x550303['options']?_0x550303['options']['attributes']||null:null,'include':_0x550303[_0x3736('0x1f')]?_0x550303[_0x3736('0x1f')][_0x3736('0x22')]?_[_0x3736('0x23')](_0x550303[_0x3736('0x1f')][_0x3736('0x22')],function(_0xa657a3){return{'model':db[_0xa657a3['model']],'as':_0xa657a3['as'],'attributes':_0xa657a3[_0x3736('0x21')],'include':_0xa657a3[_0x3736('0x22')]?_[_0x3736('0x23')](_0xa657a3['include'],function(_0x2b2732){return{'model':db[_0x2b2732[_0x3736('0x24')]],'as':_0x2b2732['as'],'attributes':_0x2b2732[_0x3736('0x21')],'include':_0x2b2732['include']?_[_0x3736('0x23')](_0x2b2732[_0x3736('0x22')],function(_0x2bede2){return{'model':db[_0x2bede2[_0x3736('0x24')]],'as':_0x2bede2['as'],'attributes':_0x2bede2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x518e17){logger['info'](_0x3736('0x27'),_0x550303);logger['debug'](_0x3736('0x27'),_0x550303,JSON[_0x3736('0x17')](_0x518e17));_0x2e4179(_0x518e17);})[_0x3736('0x1c')](function(_0x82d03){logger['error']('ShowFaxQueue',_0x82d03[_0x3736('0x1a')],_0x550303);_0x209079(_0x58abbc[_0x3736('0x19')](0x1f4,_0x82d03[_0x3736('0x1a')]));});});}; \ No newline at end of file +var _0x6809=['map','then','debug','stringify','ShowFaxQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','error','message','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','model'];(function(_0x3c12b5,_0x25bcd5){var _0x26c72c=function(_0x3eabfc){while(--_0x3eabfc){_0x3c12b5['push'](_0x3c12b5['shift']());}};_0x26c72c(++_0x25bcd5);}(_0x6809,0x84));var _0x9680=function(_0x15e6fe,_0x1a5c39){_0x15e6fe=_0x15e6fe-0x0;var _0x34894d=_0x6809[_0x15e6fe];return _0x34894d;};'use strict';var _=require(_0x9680('0x0'));var util=require(_0x9680('0x1'));var moment=require(_0x9680('0x2'));var BPromise=require(_0x9680('0x3'));var rs=require(_0x9680('0x4'));var fs=require('fs');var Redis=require(_0x9680('0x5'));var db=require(_0x9680('0x6'))['db'];var utils=require(_0x9680('0x7'));var logger=require(_0x9680('0x8'))(_0x9680('0x9'));var config=require('../../config/environment');var jayson=require(_0x9680('0xa'));var client=jayson[_0x9680('0xb')][_0x9680('0xc')]({'port':0x232a});config[_0x9680('0xd')]=_[_0x9680('0xe')](config[_0x9680('0xd')],{'host':_0x9680('0xf'),'port':0x18eb});var socket=require(_0x9680('0x10'))(new Redis(config['redis']));require(_0x9680('0x11'))[_0x9680('0x12')](socket);function respondWithRpcPromise(_0x79ef53,_0x3344be,_0x3e1bb2){return new BPromise(function(_0x1fb0f5,_0x1a3396){return client['request'](_0x79ef53,_0x3e1bb2)['then'](function(_0x116b1a){logger[_0x9680('0x13')](_0x9680('0x14'),_0x3344be,_0x9680('0x15'));logger['debug'](_0x9680('0x16'),_0x3344be,_0x9680('0x15'),JSON['stringify'](_0x116b1a));if(_0x116b1a[_0x9680('0x17')]){if(_0x116b1a['error']['code']===0x1f4){logger['error'](_0x9680('0x14'),_0x3344be,_0x116b1a[_0x9680('0x17')]['message']);return _0x1a3396(_0x116b1a[_0x9680('0x17')][_0x9680('0x18')]);}logger[_0x9680('0x17')]('FaxQueue,\x20%s,\x20%s',_0x3344be,_0x116b1a[_0x9680('0x17')]['message']);return _0x1fb0f5(_0x116b1a['error'][_0x9680('0x18')]);}else{logger[_0x9680('0x13')](_0x9680('0x14'),_0x3344be,_0x9680('0x15'));_0x1fb0f5(_0x116b1a['result'][_0x9680('0x18')]);}})[_0x9680('0x19')](function(_0x40945c){logger['error'](_0x9680('0x14'),_0x3344be,_0x40945c);_0x1a3396(_0x40945c);});});}exports[_0x9680('0x1a')]=function(_0x5db8d1){var _0x3a7837=this;return new Promise(function(_0x1422a9,_0x27f653){return db[_0x9680('0x1b')][_0x9680('0x1c')]({'raw':_0x5db8d1[_0x9680('0x1d')]?_0x5db8d1[_0x9680('0x1d')][_0x9680('0x1e')]===undefined?!![]:![]:!![],'where':_0x5db8d1[_0x9680('0x1d')]?_0x5db8d1['options'][_0x9680('0x1f')]||null:null,'attributes':_0x5db8d1[_0x9680('0x1d')]?_0x5db8d1['options'][_0x9680('0x20')]||null:null,'limit':_0x5db8d1[_0x9680('0x1d')]?_0x5db8d1['options'][_0x9680('0x21')]||null:null,'include':_0x5db8d1[_0x9680('0x1d')]?_0x5db8d1[_0x9680('0x1d')][_0x9680('0x22')]?_['map'](_0x5db8d1['options']['include'],function(_0x3da69d){return{'model':db[_0x3da69d[_0x9680('0x23')]],'as':_0x3da69d['as'],'attributes':_0x3da69d[_0x9680('0x20')],'include':_0x3da69d['include']?_['map'](_0x3da69d['include'],function(_0x280caf){return{'model':db[_0x280caf['model']],'as':_0x280caf['as'],'attributes':_0x280caf['attributes'],'include':_0x280caf[_0x9680('0x22')]?_[_0x9680('0x24')](_0x280caf[_0x9680('0x22')],function(_0x4b0fae){return{'model':db[_0x4b0fae['model']],'as':_0x4b0fae['as'],'attributes':_0x4b0fae[_0x9680('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9680('0x25')](function(_0x46df6c){logger[_0x9680('0x13')](_0x9680('0x1a'),_0x5db8d1);logger[_0x9680('0x26')](_0x9680('0x1a'),_0x5db8d1,JSON[_0x9680('0x27')](_0x46df6c));_0x1422a9(_0x46df6c);})[_0x9680('0x19')](function(_0x4f59f2){logger['error'](_0x9680('0x1a'),_0x4f59f2['message'],_0x5db8d1);_0x27f653(_0x3a7837[_0x9680('0x17')](0x1f4,_0x4f59f2[_0x9680('0x18')]));});});};exports[_0x9680('0x28')]=function(_0x1b544d){var _0x350ab6=this;return new Promise(function(_0x400a69,_0x57a1d1){return db['FaxQueue'][_0x9680('0x29')]({'raw':_0x1b544d[_0x9680('0x1d')]?_0x1b544d[_0x9680('0x1d')][_0x9680('0x1e')]===undefined?!![]:![]:!![],'where':_0x1b544d['options']?_0x1b544d['options'][_0x9680('0x1f')]||null:null,'attributes':_0x1b544d['options']?_0x1b544d[_0x9680('0x1d')]['attributes']||null:null,'include':_0x1b544d[_0x9680('0x1d')]?_0x1b544d[_0x9680('0x1d')][_0x9680('0x22')]?_[_0x9680('0x24')](_0x1b544d[_0x9680('0x1d')][_0x9680('0x22')],function(_0x5caab4){return{'model':db[_0x5caab4[_0x9680('0x23')]],'as':_0x5caab4['as'],'attributes':_0x5caab4[_0x9680('0x20')],'include':_0x5caab4['include']?_['map'](_0x5caab4[_0x9680('0x22')],function(_0x165625){return{'model':db[_0x165625[_0x9680('0x23')]],'as':_0x165625['as'],'attributes':_0x165625['attributes'],'include':_0x165625['include']?_[_0x9680('0x24')](_0x165625[_0x9680('0x22')],function(_0xa4672a){return{'model':db[_0xa4672a[_0x9680('0x23')]],'as':_0xa4672a['as'],'attributes':_0xa4672a[_0x9680('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9680('0x25')](function(_0x28c37d){logger[_0x9680('0x13')]('ShowFaxQueue',_0x1b544d);logger[_0x9680('0x26')](_0x9680('0x28'),_0x1b544d,JSON[_0x9680('0x27')](_0x28c37d));_0x400a69(_0x28c37d);})['catch'](function(_0x56d01a){logger[_0x9680('0x17')](_0x9680('0x28'),_0x56d01a[_0x9680('0x18')],_0x1b544d);_0x57a1d1(_0x350ab6[_0x9680('0x17')](0x1f4,_0x56d01a[_0x9680('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 6379511..71daf34 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 _0xaa5b=['removeListener','register','length','./faxQueue.events','save','update','emit'];(function(_0x4af5ee,_0x22ae26){var _0x37169e=function(_0x3e1c81){while(--_0x3e1c81){_0x4af5ee['push'](_0x4af5ee['shift']());}};_0x37169e(++_0x22ae26);}(_0xaa5b,0x129));var _0xbaa5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaa5b[_0x14add3];return _0x4a174f;};'use strict';var FaxQueueEvents=require(_0xbaa5('0x0'));var events=[_0xbaa5('0x1'),'remove',_0xbaa5('0x2')];function createListener(_0x5a8dc4,_0x21f0d3){return function(_0x3c4924){_0x21f0d3[_0xbaa5('0x3')](_0x5a8dc4,_0x3c4924);};}function removeListener(_0x3092de,_0x2226d6){return function(){FaxQueueEvents[_0xbaa5('0x4')](_0x3092de,_0x2226d6);};}exports[_0xbaa5('0x5')]=function(_0x2e6550){for(var _0x410d8e=0x0,_0x94b95d=events[_0xbaa5('0x6')];_0x410d8e<_0x94b95d;_0x410d8e++){var _0x4ab7ef=events[_0x410d8e];var _0x3cb9e4=createListener('faxQueue:'+_0x4ab7ef,_0x2e6550);FaxQueueEvents['on'](_0x4ab7ef,_0x3cb9e4);}}; \ No newline at end of file +var _0x4512=['save','remove','emit','removeListener','register','length'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x4512,0xa2));var _0x2451=function(_0x2ff739,_0x1c8e0f){_0x2ff739=_0x2ff739-0x0;var _0x12dc13=_0x4512[_0x2ff739];return _0x12dc13;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x2451('0x0'),_0x2451('0x1'),'update'];function createListener(_0xdd3d79,_0x55ac23){return function(_0xf244ef){_0x55ac23[_0x2451('0x2')](_0xdd3d79,_0xf244ef);};}function removeListener(_0x32624e,_0x1dd890){return function(){FaxQueueEvents[_0x2451('0x3')](_0x32624e,_0x1dd890);};}exports[_0x2451('0x4')]=function(_0x5afc2a){for(var _0x581d00=0x0,_0x5d64af=events[_0x2451('0x5')];_0x581d00<_0x5d64af;_0x581d00++){var _0x56fce1=events[_0x581d00];var _0x48a666=createListener('faxQueue:'+_0x56fce1,_0x5afc2a);FaxQueueEvents['on'](_0x56fce1,_0x48a666);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 13217b8..109dd1e 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 _0x6d11=['destroy','removeTeams','multer','util','path','express','fs-extra','../../components/auth/service','./faxQueue.controller','get','isAuthenticated','index','/describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','/:id','update','delete'];(function(_0x947885,_0x10abe1){var _0x1152db=function(_0xca83f2){while(--_0xca83f2){_0x947885['push'](_0x947885['shift']());}};_0x1152db(++_0x10abe1);}(_0x6d11,0xbf));var _0x16d1=function(_0x28c945,_0x1ffc89){_0x28c945=_0x28c945-0x0;var _0x4bd240=_0x6d11[_0x28c945];return _0x4bd240;};'use strict';var multer=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var path=require(_0x16d1('0x2'));var timeout=require('connect-timeout');var express=require(_0x16d1('0x3'));var router=express['Router']();var fs_extra=require(_0x16d1('0x4'));var auth=require(_0x16d1('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x16d1('0x6'));router[_0x16d1('0x7')]('/',auth[_0x16d1('0x8')](),controller[_0x16d1('0x9')]);router[_0x16d1('0x7')](_0x16d1('0xa'),auth[_0x16d1('0x8')](),controller['describe']);router['get']('/:id',auth[_0x16d1('0x8')](),controller[_0x16d1('0xb')]);router[_0x16d1('0x7')](_0x16d1('0xc'),auth['isAuthenticated'](),controller[_0x16d1('0xd')]);router[_0x16d1('0x7')](_0x16d1('0xe'),auth[_0x16d1('0x8')](),controller[_0x16d1('0xf')]);router[_0x16d1('0x7')](_0x16d1('0x10'),auth[_0x16d1('0x8')](),controller['getAgents']);router[_0x16d1('0x11')]('/',auth[_0x16d1('0x8')](),controller[_0x16d1('0x12')]);router[_0x16d1('0x11')](_0x16d1('0xe'),auth['isAuthenticated'](),controller[_0x16d1('0x13')]);router[_0x16d1('0x11')](_0x16d1('0x10'),auth[_0x16d1('0x8')](),controller[_0x16d1('0x14')]);router[_0x16d1('0x15')](_0x16d1('0x16'),auth['isAuthenticated'](),controller[_0x16d1('0x17')]);router[_0x16d1('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x16d1('0x19')]);router['delete'](_0x16d1('0xe'),auth['isAuthenticated'](),controller[_0x16d1('0x1a')]);router['delete'](_0x16d1('0x10'),auth[_0x16d1('0x8')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x326f=['getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','/:id','update','delete','removeTeams','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','/describe','describe','show','/:id/members'];(function(_0x517694,_0x3faf70){var _0x595e09=function(_0x23c296){while(--_0x23c296){_0x517694['push'](_0x517694['shift']());}};_0x595e09(++_0x3faf70);}(_0x326f,0xd1));var _0xf326=function(_0x164da9,_0x447d3f){_0x164da9=_0x164da9-0x0;var _0x12c9ab=_0x326f[_0x164da9];return _0x12c9ab;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0x9')](_0xf326('0xe'),auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router['get'](_0xf326('0x10'),auth['isAuthenticated'](),controller[_0xf326('0x11')]);router['get'](_0xf326('0x12'),auth['isAuthenticated'](),controller[_0xf326('0x13')]);router[_0xf326('0x14')]('/',auth['isAuthenticated'](),controller[_0xf326('0x15')]);router[_0xf326('0x14')](_0xf326('0x10'),auth[_0xf326('0xa')](),controller['addTeams']);router[_0xf326('0x14')]('/:id/users',auth['isAuthenticated'](),controller[_0xf326('0x16')]);router[_0xf326('0x17')](_0xf326('0x18'),auth[_0xf326('0xa')](),controller[_0xf326('0x19')]);router[_0xf326('0x1a')](_0xf326('0x18'),auth[_0xf326('0xa')](),controller['destroy']);router[_0xf326('0x1a')](_0xf326('0x10'),auth[_0xf326('0xa')](),controller[_0xf326('0x1b')]);router[_0xf326('0x1a')](_0xf326('0x12'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 90adbfa..584cb64 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 _0x1cb9=['STRING','DATE','moment','exports'];(function(_0x24656b,_0x493eda){var _0x3072ba=function(_0x242358){while(--_0x242358){_0x24656b['push'](_0x24656b['shift']());}};_0x3072ba(++_0x493eda);}(_0x1cb9,0x14e));var _0x91cb=function(_0x170dfd,_0x30c047){_0x170dfd=_0x170dfd-0x0;var _0x343dba=_0x1cb9[_0x170dfd];return _0x343dba;};'use strict';var moment=require(_0x91cb('0x0'));var Sequelize=require('sequelize');module[_0x91cb('0x1')]={'uniqueid':{'type':Sequelize[_0x91cb('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x91cb('0x2')]},'joinAt':{'type':Sequelize[_0x91cb('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x91cb('0x3')]},'exitAt':{'type':Sequelize[_0x91cb('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0739=['sequelize','STRING','DATE','moment'];(function(_0x49f856,_0x26dc54){var _0x1bacb6=function(_0xd115b3){while(--_0xd115b3){_0x49f856['push'](_0x49f856['shift']());}};_0x1bacb6(++_0x26dc54);}(_0x0739,0x15f));var _0x9073=function(_0xd1d075,_0x2fa397){_0xd1d075=_0xd1d075-0x0;var _0x862a86=_0x0739[_0xd1d075];return _0x862a86;};'use strict';var moment=require(_0x9073('0x0'));var Sequelize=require(_0x9073('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x9073('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x9073('0x3')]},'leaveAt':{'type':Sequelize[_0x9073('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x9073('0x3')]},'reason':{'type':Sequelize[_0x9073('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 5567927..5e756be 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 _0x8b2b=['path','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','FaxQueueReport','findAll','catch','show','params','keys','length','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x2fba2b,_0x4977bf){var _0x438896=function(_0x3c73ca){while(--_0x3c73ca){_0x2fba2b['push'](_0x2fba2b['shift']());}};_0x438896(++_0x4977bf);}(_0x8b2b,0x1c0));var _0xb8b2=function(_0x187447,_0x229298){_0x187447=_0x187447-0x0;var _0x3cfd6a=_0x8b2b[_0x187447];return _0x3cfd6a;};'use strict';var emlformat=require(_0xb8b2('0x0'));var rimraf=require(_0xb8b2('0x1'));var zipdir=require(_0xb8b2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb8b2('0x3'));var moment=require(_0xb8b2('0x4'));var BPromise=require(_0xb8b2('0x5'));var Mustache=require(_0xb8b2('0x6'));var util=require(_0xb8b2('0x7'));var path=require(_0xb8b2('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb8b2('0x9'));var fs=require('fs');var fs_extra=require(_0xb8b2('0xa'));var _=require(_0xb8b2('0xb'));var squel=require(_0xb8b2('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb8b2('0xd'));var toCsv=require(_0xb8b2('0xe'));var querystring=require(_0xb8b2('0xf'));var Papa=require(_0xb8b2('0x10'));var Redis=require(_0xb8b2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb8b2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb8b2('0x13'))(_0xb8b2('0x14'));var utils=require(_0xb8b2('0x15'));var config=require(_0xb8b2('0x16'));var licenseUtil=require(_0xb8b2('0x17'));var db=require(_0xb8b2('0x18'))['db'];function respondWithStatusCode(_0x584d41,_0x3440bf){_0x3440bf=_0x3440bf||0xcc;return function(_0x5bd724){if(_0x5bd724){return _0x584d41['sendStatus'](_0x3440bf);}return _0x584d41['status'](_0x3440bf)[_0xb8b2('0x19')]();};}function respondWithResult(_0xdc1d1d,_0x48b9df){_0x48b9df=_0x48b9df||0xc8;return function(_0x175885){if(_0x175885){return _0xdc1d1d[_0xb8b2('0x1a')](_0x48b9df)[_0xb8b2('0x1b')](_0x175885);}};}function respondWithFilteredResult(_0x142fb0,_0x46a592){return function(_0x5b614d){if(_0x5b614d){var _0x4b5a28=typeof _0x46a592[_0xb8b2('0x1c')]===_0xb8b2('0x1d')&&typeof _0x46a592[_0xb8b2('0x1e')]===_0xb8b2('0x1d');var _0xf04672=_0x5b614d['count'];var _0x47b94f=_0x4b5a28?0x0:_0x46a592[_0xb8b2('0x1c')];var _0x153b69=_0x4b5a28?_0x5b614d[_0xb8b2('0x1f')]:_0x46a592[_0xb8b2('0x1c')]+_0x46a592['limit'];var _0x23af66;if(_0x153b69>=_0xf04672){_0x153b69=_0xf04672;_0x23af66=0xc8;}else{_0x23af66=0xce;}_0x142fb0[_0xb8b2('0x1a')](_0x23af66);return _0x142fb0[_0xb8b2('0x20')](_0xb8b2('0x21'),_0x47b94f+'-'+_0x153b69+'/'+_0xf04672)[_0xb8b2('0x1b')](_0x5b614d);}return null;};}function patchUpdates(_0x1cbc65){return function(_0x34ca46){try{jsonpatch['apply'](_0x34ca46,_0x1cbc65,!![]);}catch(_0x382bbf){return BPromise[_0xb8b2('0x22')](_0x382bbf);}return _0x34ca46[_0xb8b2('0x23')]();};}function saveUpdates(_0x162d41,_0x316d3c){return function(_0x5a0a43){if(_0x5a0a43){return _0x5a0a43[_0xb8b2('0x24')](_0x162d41)['then'](function(_0xe3b28){return _0xe3b28;});}return null;};}function removeEntity(_0x8239a7,_0x2b40f8){return function(_0x20082f){if(_0x20082f){return _0x20082f['destroy']()[_0xb8b2('0x25')](function(){_0x8239a7[_0xb8b2('0x1a')](0xcc)[_0xb8b2('0x19')]();});}};}function handleEntityNotFound(_0x5a2afe,_0x49c5b1){return function(_0x517c2a){if(!_0x517c2a){_0x5a2afe['sendStatus'](0x194);}return _0x517c2a;};}function handleError(_0x36ae2d,_0x10d8f3){_0x10d8f3=_0x10d8f3||0x1f4;return function(_0x3bdb27){logger[_0xb8b2('0x26')](_0x3bdb27[_0xb8b2('0x27')]);if(_0x3bdb27[_0xb8b2('0x28')]){delete _0x3bdb27[_0xb8b2('0x28')];}_0x36ae2d[_0xb8b2('0x1a')](_0x10d8f3)[_0xb8b2('0x29')](_0x3bdb27);};}exports[_0xb8b2('0x2a')]=function(_0x2a236d,_0x6ae308){var _0x140b18={},_0xeb28c8={},_0x396fb3={'count':0x0,'rows':[]};var _0x234a63=_[_0xb8b2('0x2b')](db['FaxQueueReport'][_0xb8b2('0x2c')],function(_0x1899d9){return{'name':_0x1899d9[_0xb8b2('0x2d')],'type':_0x1899d9[_0xb8b2('0x2e')][_0xb8b2('0x2f')]};});_0xeb28c8['model']=_[_0xb8b2('0x2b')](_0x234a63,_0xb8b2('0x28'));_0xeb28c8[_0xb8b2('0x30')]=_['keys'](_0x2a236d[_0xb8b2('0x30')]);_0xeb28c8[_0xb8b2('0x31')]=_['intersection'](_0xeb28c8[_0xb8b2('0x32')],_0xeb28c8[_0xb8b2('0x30')]);_0x140b18[_0xb8b2('0x33')]=_[_0xb8b2('0x34')](_0xeb28c8[_0xb8b2('0x32')],qs[_0xb8b2('0x35')](_0x2a236d[_0xb8b2('0x30')][_0xb8b2('0x35')]));_0x140b18[_0xb8b2('0x33')]=_0x140b18[_0xb8b2('0x33')]['length']?_0x140b18[_0xb8b2('0x33')]:_0xeb28c8[_0xb8b2('0x32')];if(!_0x2a236d['query'][_0xb8b2('0x36')](_0xb8b2('0x37'))){_0x140b18[_0xb8b2('0x1e')]=qs[_0xb8b2('0x1e')](_0x2a236d[_0xb8b2('0x30')][_0xb8b2('0x1e')]);_0x140b18[_0xb8b2('0x1c')]=qs[_0xb8b2('0x1c')](_0x2a236d[_0xb8b2('0x30')][_0xb8b2('0x1c')]);}_0x140b18[_0xb8b2('0x38')]=qs[_0xb8b2('0x39')](_0x2a236d[_0xb8b2('0x30')][_0xb8b2('0x39')]);_0x140b18[_0xb8b2('0x3a')]=qs[_0xb8b2('0x31')](_[_0xb8b2('0x3b')](_0x2a236d[_0xb8b2('0x30')],_0xeb28c8[_0xb8b2('0x31')]),_0x234a63);if(_0x2a236d[_0xb8b2('0x30')][_0xb8b2('0x3c')]){_0x140b18[_0xb8b2('0x3a')]=_[_0xb8b2('0x3d')](_0x140b18[_0xb8b2('0x3a')],{'$or':_[_0xb8b2('0x2b')](_0x234a63,function(_0x3de2e0){if(_0x3de2e0[_0xb8b2('0x2e')]!=='VIRTUAL'){var _0x482d64={};_0x482d64[_0x3de2e0[_0xb8b2('0x28')]]={'$like':'%'+_0x2a236d['query'][_0xb8b2('0x3c')]+'%'};return _0x482d64;}})});}_0x140b18=_[_0xb8b2('0x3d')]({},_0x140b18,_0x2a236d[_0xb8b2('0x3e')]);var _0x3cd89e={'where':_0x140b18['where']};return db['FaxQueueReport'][_0xb8b2('0x1f')](_0x3cd89e)[_0xb8b2('0x25')](function(_0x1c72e9){_0x396fb3[_0xb8b2('0x1f')]=_0x1c72e9;if(_0x2a236d[_0xb8b2('0x30')]['includeAll']){_0x140b18[_0xb8b2('0x3f')]=[{'all':!![]}];}return db[_0xb8b2('0x40')][_0xb8b2('0x41')](_0x140b18);})[_0xb8b2('0x25')](function(_0x283eb5){_0x396fb3['rows']=_0x283eb5;return _0x396fb3;})[_0xb8b2('0x25')](respondWithFilteredResult(_0x6ae308,_0x140b18))[_0xb8b2('0x42')](handleError(_0x6ae308,null));};exports[_0xb8b2('0x43')]=function(_0x13d356,_0x1890fc){var _0x1f0ed2={'raw':!![],'where':{'id':_0x13d356[_0xb8b2('0x44')]['id']}},_0x37370a={};_0x37370a[_0xb8b2('0x32')]=_[_0xb8b2('0x45')](db['FaxQueueReport']['rawAttributes']);_0x37370a[_0xb8b2('0x30')]=_['keys'](_0x13d356[_0xb8b2('0x30')]);_0x37370a[_0xb8b2('0x31')]=_[_0xb8b2('0x34')](_0x37370a[_0xb8b2('0x32')],_0x37370a[_0xb8b2('0x30')]);_0x1f0ed2['attributes']=_[_0xb8b2('0x34')](_0x37370a[_0xb8b2('0x32')],qs[_0xb8b2('0x35')](_0x13d356[_0xb8b2('0x30')][_0xb8b2('0x35')]));_0x1f0ed2[_0xb8b2('0x33')]=_0x1f0ed2[_0xb8b2('0x33')][_0xb8b2('0x46')]?_0x1f0ed2[_0xb8b2('0x33')]:_0x37370a[_0xb8b2('0x32')];if(_0x13d356[_0xb8b2('0x30')]['includeAll']){_0x1f0ed2[_0xb8b2('0x3f')]=[{'all':!![]}];}_0x1f0ed2=_[_0xb8b2('0x3d')]({},_0x1f0ed2,_0x13d356[_0xb8b2('0x3e')]);return db[_0xb8b2('0x40')][_0xb8b2('0x47')](_0x1f0ed2)[_0xb8b2('0x25')](handleEntityNotFound(_0x1890fc,null))[_0xb8b2('0x25')](respondWithResult(_0x1890fc,null))[_0xb8b2('0x42')](handleError(_0x1890fc,null));};exports[_0xb8b2('0x48')]=function(_0xe88b4f,_0x2f6795){return db[_0xb8b2('0x40')][_0xb8b2('0x48')](_0xe88b4f['body'],{})[_0xb8b2('0x25')](respondWithResult(_0x2f6795,0xc9))[_0xb8b2('0x42')](handleError(_0x2f6795,null));};exports['update']=function(_0x35b691,_0x2b9c9a){if(_0x35b691[_0xb8b2('0x49')]['id']){delete _0x35b691['body']['id'];}return db[_0xb8b2('0x40')][_0xb8b2('0x47')]({'where':{'id':_0x35b691[_0xb8b2('0x44')]['id']}})[_0xb8b2('0x25')](handleEntityNotFound(_0x2b9c9a,null))[_0xb8b2('0x25')](saveUpdates(_0x35b691[_0xb8b2('0x49')],null))[_0xb8b2('0x25')](respondWithResult(_0x2b9c9a,null))[_0xb8b2('0x42')](handleError(_0x2b9c9a,null));};exports[_0xb8b2('0x4a')]=function(_0x3397b0,_0x79ae95){return db[_0xb8b2('0x40')][_0xb8b2('0x47')]({'where':{'id':_0x3397b0[_0xb8b2('0x44')]['id']}})[_0xb8b2('0x25')](handleEntityNotFound(_0x79ae95,null))['then'](removeEntity(_0x79ae95,null))['catch'](handleError(_0x79ae95,null));};exports[_0xb8b2('0x4b')]=function(_0x10bb91,_0x5d8cbd){return db[_0xb8b2('0x40')][_0xb8b2('0x4b')]()[_0xb8b2('0x25')](respondWithResult(_0x5d8cbd,null))['catch'](handleError(_0x5d8cbd,null));}; \ No newline at end of file +var _0x0434=['api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','then','end','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','catch','show','params','length','include','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x0434,0x1ad));var _0x4043=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0x0434[_0x35da42];return _0x370035;};'use strict';var emlformat=require(_0x4043('0x0'));var rimraf=require(_0x4043('0x1'));var zipdir=require(_0x4043('0x2'));var jsonpatch=require(_0x4043('0x3'));var rp=require(_0x4043('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4043('0x5'));var util=require(_0x4043('0x6'));var path=require(_0x4043('0x7'));var sox=require(_0x4043('0x8'));var csv=require(_0x4043('0x9'));var ejs=require(_0x4043('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4043('0xb'));var squel=require(_0x4043('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4043('0xd'));var toCsv=require(_0x4043('0x9'));var querystring=require(_0x4043('0xe'));var Papa=require(_0x4043('0xf'));var Redis=require(_0x4043('0x10'));var authService=require(_0x4043('0x11'));var qs=require(_0x4043('0x12'));var as=require(_0x4043('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4043('0x14'))(_0x4043('0x15'));var utils=require(_0x4043('0x16'));var config=require(_0x4043('0x17'));var licenseUtil=require(_0x4043('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x302ec9,_0x378baa){_0x378baa=_0x378baa||0xcc;return function(_0x1cb816){if(_0x1cb816){return _0x302ec9[_0x4043('0x19')](_0x378baa);}return _0x302ec9[_0x4043('0x1a')](_0x378baa)['end']();};}function respondWithResult(_0xff9c36,_0x2c91ae){_0x2c91ae=_0x2c91ae||0xc8;return function(_0x3d91ee){if(_0x3d91ee){return _0xff9c36[_0x4043('0x1a')](_0x2c91ae)[_0x4043('0x1b')](_0x3d91ee);}};}function respondWithFilteredResult(_0x4b1b2a,_0x234819){return function(_0x3d6440){if(_0x3d6440){var _0x1051db=typeof _0x234819[_0x4043('0x1c')]===_0x4043('0x1d')&&typeof _0x234819[_0x4043('0x1e')]==='undefined';var _0xb07abf=_0x3d6440[_0x4043('0x1f')];var _0x7c7b2e=_0x1051db?0x0:_0x234819['offset'];var _0x3767ed=_0x1051db?_0x3d6440[_0x4043('0x1f')]:_0x234819[_0x4043('0x1c')]+_0x234819[_0x4043('0x1e')];var _0x20a284;if(_0x3767ed>=_0xb07abf){_0x3767ed=_0xb07abf;_0x20a284=0xc8;}else{_0x20a284=0xce;}_0x4b1b2a['status'](_0x20a284);return _0x4b1b2a[_0x4043('0x20')]('Content-Range',_0x7c7b2e+'-'+_0x3767ed+'/'+_0xb07abf)[_0x4043('0x1b')](_0x3d6440);}return null;};}function patchUpdates(_0x2bc032){return function(_0x274b19){try{jsonpatch[_0x4043('0x21')](_0x274b19,_0x2bc032,!![]);}catch(_0x1114b5){return BPromise[_0x4043('0x22')](_0x1114b5);}return _0x274b19['save']();};}function saveUpdates(_0x1a3357,_0x3339dd){return function(_0x5028cf){if(_0x5028cf){return _0x5028cf['update'](_0x1a3357)[_0x4043('0x23')](function(_0x4e7c5d){return _0x4e7c5d;});}return null;};}function removeEntity(_0x5360e4,_0x1eecc2){return function(_0x42a207){if(_0x42a207){return _0x42a207['destroy']()[_0x4043('0x23')](function(){_0x5360e4[_0x4043('0x1a')](0xcc)[_0x4043('0x24')]();});}};}function handleEntityNotFound(_0x3bbaf6,_0x2fefc2){return function(_0x32db92){if(!_0x32db92){_0x3bbaf6[_0x4043('0x19')](0x194);}return _0x32db92;};}function handleError(_0x3f180f,_0x4bb472){_0x4bb472=_0x4bb472||0x1f4;return function(_0x4a7872){logger[_0x4043('0x25')](_0x4a7872[_0x4043('0x26')]);if(_0x4a7872[_0x4043('0x27')]){delete _0x4a7872['name'];}_0x3f180f['status'](_0x4bb472)[_0x4043('0x28')](_0x4a7872);};}exports[_0x4043('0x29')]=function(_0x58100c,_0x3cbbf1){var _0x400c94={},_0x4b1b7f={},_0xd9fa57={'count':0x0,'rows':[]};var _0x48c207=_[_0x4043('0x2a')](db[_0x4043('0x2b')][_0x4043('0x2c')],function(_0x1eb0f0){return{'name':_0x1eb0f0[_0x4043('0x2d')],'type':_0x1eb0f0[_0x4043('0x2e')]['key']};});_0x4b1b7f[_0x4043('0x2f')]=_[_0x4043('0x2a')](_0x48c207,'name');_0x4b1b7f[_0x4043('0x30')]=_[_0x4043('0x31')](_0x58100c[_0x4043('0x30')]);_0x4b1b7f[_0x4043('0x32')]=_[_0x4043('0x33')](_0x4b1b7f[_0x4043('0x2f')],_0x4b1b7f[_0x4043('0x30')]);_0x400c94[_0x4043('0x34')]=_['intersection'](_0x4b1b7f['model'],qs['fields'](_0x58100c['query'][_0x4043('0x35')]));_0x400c94[_0x4043('0x34')]=_0x400c94[_0x4043('0x34')]['length']?_0x400c94[_0x4043('0x34')]:_0x4b1b7f['model'];if(!_0x58100c['query']['hasOwnProperty'](_0x4043('0x36'))){_0x400c94[_0x4043('0x1e')]=qs[_0x4043('0x1e')](_0x58100c[_0x4043('0x30')][_0x4043('0x1e')]);_0x400c94[_0x4043('0x1c')]=qs[_0x4043('0x1c')](_0x58100c[_0x4043('0x30')][_0x4043('0x1c')]);}_0x400c94[_0x4043('0x37')]=qs[_0x4043('0x38')](_0x58100c[_0x4043('0x30')][_0x4043('0x38')]);_0x400c94['where']=qs['filters'](_[_0x4043('0x39')](_0x58100c[_0x4043('0x30')],_0x4b1b7f[_0x4043('0x32')]),_0x48c207);if(_0x58100c['query'][_0x4043('0x3a')]){_0x400c94[_0x4043('0x3b')]=_[_0x4043('0x3c')](_0x400c94[_0x4043('0x3b')],{'$or':_[_0x4043('0x2a')](_0x48c207,function(_0x49604d){if(_0x49604d[_0x4043('0x2e')]!=='VIRTUAL'){var _0x4c1986={};_0x4c1986[_0x49604d[_0x4043('0x27')]]={'$like':'%'+_0x58100c['query'][_0x4043('0x3a')]+'%'};return _0x4c1986;}})});}_0x400c94=_[_0x4043('0x3c')]({},_0x400c94,_0x58100c[_0x4043('0x3d')]);var _0x45ec00={'where':_0x400c94[_0x4043('0x3b')]};return db[_0x4043('0x2b')][_0x4043('0x1f')](_0x45ec00)['then'](function(_0x3ce172){_0xd9fa57[_0x4043('0x1f')]=_0x3ce172;if(_0x58100c['query'][_0x4043('0x3e')]){_0x400c94['include']=[{'all':!![]}];}return db['FaxQueueReport'][_0x4043('0x3f')](_0x400c94);})['then'](function(_0x236f2f){_0xd9fa57['rows']=_0x236f2f;return _0xd9fa57;})['then'](respondWithFilteredResult(_0x3cbbf1,_0x400c94))[_0x4043('0x40')](handleError(_0x3cbbf1,null));};exports[_0x4043('0x41')]=function(_0x203b93,_0x2867cc){var _0x2a9212={'raw':!![],'where':{'id':_0x203b93[_0x4043('0x42')]['id']}},_0x4dd0c0={};_0x4dd0c0[_0x4043('0x2f')]=_[_0x4043('0x31')](db[_0x4043('0x2b')][_0x4043('0x2c')]);_0x4dd0c0[_0x4043('0x30')]=_[_0x4043('0x31')](_0x203b93[_0x4043('0x30')]);_0x4dd0c0[_0x4043('0x32')]=_[_0x4043('0x33')](_0x4dd0c0['model'],_0x4dd0c0[_0x4043('0x30')]);_0x2a9212[_0x4043('0x34')]=_['intersection'](_0x4dd0c0[_0x4043('0x2f')],qs[_0x4043('0x35')](_0x203b93['query']['fields']));_0x2a9212['attributes']=_0x2a9212[_0x4043('0x34')][_0x4043('0x43')]?_0x2a9212[_0x4043('0x34')]:_0x4dd0c0[_0x4043('0x2f')];if(_0x203b93[_0x4043('0x30')][_0x4043('0x3e')]){_0x2a9212[_0x4043('0x44')]=[{'all':!![]}];}_0x2a9212=_['merge']({},_0x2a9212,_0x203b93[_0x4043('0x3d')]);return db[_0x4043('0x2b')][_0x4043('0x45')](_0x2a9212)[_0x4043('0x23')](handleEntityNotFound(_0x2867cc,null))[_0x4043('0x23')](respondWithResult(_0x2867cc,null))[_0x4043('0x40')](handleError(_0x2867cc,null));};exports['create']=function(_0x1cde38,_0x1a8436){return db[_0x4043('0x2b')][_0x4043('0x46')](_0x1cde38[_0x4043('0x47')],{})['then'](respondWithResult(_0x1a8436,0xc9))[_0x4043('0x40')](handleError(_0x1a8436,null));};exports[_0x4043('0x48')]=function(_0x3ee4e4,_0x295a41){if(_0x3ee4e4[_0x4043('0x47')]['id']){delete _0x3ee4e4['body']['id'];}return db[_0x4043('0x2b')][_0x4043('0x45')]({'where':{'id':_0x3ee4e4[_0x4043('0x42')]['id']}})[_0x4043('0x23')](handleEntityNotFound(_0x295a41,null))[_0x4043('0x23')](saveUpdates(_0x3ee4e4[_0x4043('0x47')],null))[_0x4043('0x23')](respondWithResult(_0x295a41,null))['catch'](handleError(_0x295a41,null));};exports[_0x4043('0x49')]=function(_0x6e41d4,_0x2f1462){return db['FaxQueueReport'][_0x4043('0x45')]({'where':{'id':_0x6e41d4[_0x4043('0x42')]['id']}})['then'](handleEntityNotFound(_0x2f1462,null))[_0x4043('0x23')](removeEntity(_0x2f1462,null))[_0x4043('0x40')](handleError(_0x2f1462,null));};exports[_0x4043('0x4a')]=function(_0x152a26,_0xb9d378){return db[_0x4043('0x2b')][_0x4043('0x4a')]()[_0x4043('0x23')](respondWithResult(_0xb9d378,null))[_0x4043('0x40')](handleError(_0xb9d378,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 2383e35..5786f2a 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabce=['path','rimraf','../../config/environment','define','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x2e88c7,_0x2be075){var _0x1fa350=function(_0x15a805){while(--_0x15a805){_0x2e88c7['push'](_0x2e88c7['shift']());}};_0x1fa350(++_0x2be075);}(_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 logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./faxQueueReport.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('FaxQueueReport',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[{'name':_0xeabc('0xa'),'fields':[_0xeabc('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['path','../../config/environment','./faxQueueReport.attributes','define','FaxQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2c5e0a,_0xcee699){var _0x533178=function(_0x4aec05){while(--_0x4aec05){_0x2c5e0a['push'](_0x2c5e0a['shift']());}};_0x533178(++_0xcee699);}(_0x53ec,0x192));var _0xc53e=function(_0x3ab164,_0x2fa5e9){_0x3ab164=_0x3ab164-0x0;var _0x39565e=_0x53ec[_0x3ab164];return _0x39565e;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index ec915fd..78f649b 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 _0xad52=['../../config/logger','client','http','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateFaxQueueReport','FaxQueueReport','options','catch','UpdateFaxQueueReport','update','body','raw','where','limit','lodash','util','moment','ioredis'];(function(_0x4a1441,_0x2e8440){var _0x3d647e=function(_0x23e49a){while(--_0x23e49a){_0x4a1441['push'](_0x4a1441['shift']());}};_0x3d647e(++_0x2e8440);}(_0xad52,0x7e));var _0x2ad5=function(_0xb177f4,_0x472d4c){_0xb177f4=_0xb177f4-0x0;var _0x2d74bc=_0xad52[_0xb177f4];return _0x2d74bc;};'use strict';var _=require(_0x2ad5('0x0'));var util=require(_0x2ad5('0x1'));var moment=require(_0x2ad5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ad5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2ad5('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2ad5('0x5')][_0x2ad5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x34506e,_0xb0b899,_0x4254bd){return new BPromise(function(_0x2657ca,_0x1ecf5e){return client['request'](_0x34506e,_0x4254bd)[_0x2ad5('0x7')](function(_0x3d0258){logger[_0x2ad5('0x8')](_0x2ad5('0x9'),_0xb0b899,_0x2ad5('0xa'));logger['debug']('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0xb0b899,_0x2ad5('0xa'),JSON[_0x2ad5('0xb')](_0x3d0258));if(_0x3d0258[_0x2ad5('0xc')]){if(_0x3d0258[_0x2ad5('0xc')][_0x2ad5('0xd')]===0x1f4){logger[_0x2ad5('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0xb0b899,_0x3d0258[_0x2ad5('0xc')][_0x2ad5('0xe')]);return _0x1ecf5e(_0x3d0258[_0x2ad5('0xc')]['message']);}logger[_0x2ad5('0xc')](_0x2ad5('0x9'),_0xb0b899,_0x3d0258[_0x2ad5('0xc')]['message']);return _0x2657ca(_0x3d0258[_0x2ad5('0xc')]['message']);}else{logger['info'](_0x2ad5('0x9'),_0xb0b899,'request\x20sent');_0x2657ca(_0x3d0258[_0x2ad5('0xf')][_0x2ad5('0xe')]);}})['catch'](function(_0x4f4a24){logger['error'](_0x2ad5('0x9'),_0xb0b899,_0x4f4a24);_0x1ecf5e(_0x4f4a24);});});}exports[_0x2ad5('0x10')]=function(_0x32a026){var _0x470178=this;return new Promise(function(_0x4b57ed,_0x2c1adf){return db[_0x2ad5('0x11')]['create'](_0x32a026['body'],{'raw':_0x32a026[_0x2ad5('0x12')]?_0x32a026[_0x2ad5('0x12')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0xba3d5b){logger['info'](_0x2ad5('0x10'),_0x32a026);logger['debug'](_0x2ad5('0x10'),_0x32a026,JSON['stringify'](_0xba3d5b));_0x4b57ed(_0xba3d5b);})[_0x2ad5('0x13')](function(_0x2d3351){logger[_0x2ad5('0xc')](_0x2ad5('0x10'),_0x2d3351[_0x2ad5('0xe')],_0x32a026);_0x2c1adf(_0x470178[_0x2ad5('0xc')](0x1f4,_0x2d3351['message']));});});};exports[_0x2ad5('0x14')]=function(_0x228a5f){var _0x5d8668=this;return new Promise(function(_0x2b2e2f,_0xf20d24){return db[_0x2ad5('0x11')][_0x2ad5('0x15')](_0x228a5f[_0x2ad5('0x16')],{'raw':_0x228a5f[_0x2ad5('0x12')]?_0x228a5f[_0x2ad5('0x12')][_0x2ad5('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x228a5f['options']?_0x228a5f['options'][_0x2ad5('0x18')]||null:null,'attributes':_0x228a5f[_0x2ad5('0x12')]?_0x228a5f[_0x2ad5('0x12')]['attributes']||null:null,'limit':_0x228a5f[_0x2ad5('0x12')]?_0x228a5f['options'][_0x2ad5('0x19')]||null:null})[_0x2ad5('0x7')](function(_0x40bacd){logger['info'](_0x2ad5('0x14'),_0x228a5f);logger['debug'](_0x2ad5('0x14'),_0x228a5f,JSON[_0x2ad5('0xb')](_0x40bacd));_0x2b2e2f(_0x40bacd);})[_0x2ad5('0x13')](function(_0xcd25e9){logger['error'](_0x2ad5('0x14'),_0xcd25e9[_0x2ad5('0xe')],_0x228a5f);_0xf20d24(_0x5d8668[_0x2ad5('0xc')](0x1f4,_0xcd25e9[_0x2ad5('0xe')]));});});}; \ No newline at end of file +var _0xf2e9=['client','request','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','FaxQueueReport','create','body','options','raw','then','CreateFaxQueueReport','UpdateFaxQueueReport','update','where','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xf2e9,0x143));var _0x9f2e=function(_0x8faa55,_0x163c0a){_0x8faa55=_0x8faa55-0x0;var _0x5f4b6c=_0xf2e9[_0x8faa55];return _0x5f4b6c;};'use strict';var _=require(_0x9f2e('0x0'));var util=require('util');var moment=require(_0x9f2e('0x1'));var BPromise=require('bluebird');var rs=require(_0x9f2e('0x2'));var fs=require('fs');var Redis=require(_0x9f2e('0x3'));var db=require(_0x9f2e('0x4'))['db'];var utils=require(_0x9f2e('0x5'));var logger=require('../../config/logger')(_0x9f2e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9f2e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a6ce7,_0x14c18e,_0x1a1a93){return new BPromise(function(_0x4beac2,_0x583685){return client[_0x9f2e('0x8')](_0x1a6ce7,_0x1a1a93)['then'](function(_0x494014){logger[_0x9f2e('0x9')](_0x9f2e('0xa'),_0x14c18e,'request\x20sent');logger[_0x9f2e('0xb')](_0x9f2e('0xc'),_0x14c18e,_0x9f2e('0xd'),JSON['stringify'](_0x494014));if(_0x494014[_0x9f2e('0xe')]){if(_0x494014[_0x9f2e('0xe')][_0x9f2e('0xf')]===0x1f4){logger[_0x9f2e('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x14c18e,_0x494014['error'][_0x9f2e('0x10')]);return _0x583685(_0x494014[_0x9f2e('0xe')]['message']);}logger[_0x9f2e('0xe')](_0x9f2e('0xa'),_0x14c18e,_0x494014[_0x9f2e('0xe')][_0x9f2e('0x10')]);return _0x4beac2(_0x494014[_0x9f2e('0xe')]['message']);}else{logger[_0x9f2e('0x9')](_0x9f2e('0xa'),_0x14c18e,_0x9f2e('0xd'));_0x4beac2(_0x494014[_0x9f2e('0x11')][_0x9f2e('0x10')]);}})[_0x9f2e('0x12')](function(_0x2fe46c){logger[_0x9f2e('0xe')](_0x9f2e('0xa'),_0x14c18e,_0x2fe46c);_0x583685(_0x2fe46c);});});}exports['CreateFaxQueueReport']=function(_0x45c69e){var _0x18e6c1=this;return new Promise(function(_0x5b9906,_0x4fbacd){return db[_0x9f2e('0x13')][_0x9f2e('0x14')](_0x45c69e[_0x9f2e('0x15')],{'raw':_0x45c69e[_0x9f2e('0x16')]?_0x45c69e[_0x9f2e('0x16')][_0x9f2e('0x17')]===undefined?!![]:![]:!![]})[_0x9f2e('0x18')](function(_0x183b8a){logger['info'](_0x9f2e('0x19'),_0x45c69e);logger[_0x9f2e('0xb')](_0x9f2e('0x19'),_0x45c69e,JSON['stringify'](_0x183b8a));_0x5b9906(_0x183b8a);})[_0x9f2e('0x12')](function(_0x1489ba){logger[_0x9f2e('0xe')](_0x9f2e('0x19'),_0x1489ba[_0x9f2e('0x10')],_0x45c69e);_0x4fbacd(_0x18e6c1[_0x9f2e('0xe')](0x1f4,_0x1489ba[_0x9f2e('0x10')]));});});};exports[_0x9f2e('0x1a')]=function(_0x128b65){var _0x163141=this;return new Promise(function(_0x5d98ba,_0x4da7bc){return db[_0x9f2e('0x13')][_0x9f2e('0x1b')](_0x128b65['body'],{'raw':_0x128b65[_0x9f2e('0x16')]?_0x128b65[_0x9f2e('0x16')][_0x9f2e('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x128b65[_0x9f2e('0x16')]?_0x128b65[_0x9f2e('0x16')][_0x9f2e('0x1c')]||null:null,'attributes':_0x128b65['options']?_0x128b65[_0x9f2e('0x16')]['attributes']||null:null,'limit':_0x128b65[_0x9f2e('0x16')]?_0x128b65[_0x9f2e('0x16')]['limit']||null:null})['then'](function(_0xf929cd){logger['info'](_0x9f2e('0x1a'),_0x128b65);logger['debug'](_0x9f2e('0x1a'),_0x128b65,JSON[_0x9f2e('0x1d')](_0xf929cd));_0x5d98ba(_0xf929cd);})[_0x9f2e('0x12')](function(_0x55f788){logger[_0x9f2e('0xe')](_0x9f2e('0x1a'),_0x55f788['message'],_0x128b65);_0x4da7bc(_0x163141[_0x9f2e('0xe')](0x1f4,_0x55f788[_0x9f2e('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index fdea82a..520056b 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 _0x83ad=['post','create','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','isAuthenticated','/describe','describe','get'];(function(_0x4f51f9,_0x5d5613){var _0x533984=function(_0x578319){while(--_0x578319){_0x4f51f9['push'](_0x4f51f9['shift']());}};_0x533984(++_0x5d5613);}(_0x83ad,0x1a9));var _0xd83a=function(_0x5eb874,_0x3d849f){_0x5eb874=_0x5eb874-0x0;var _0x5bbbd0=_0x83ad[_0x5eb874];return _0x5bbbd0;};'use strict';var multer=require(_0xd83a('0x0'));var util=require(_0xd83a('0x1'));var path=require('path');var timeout=require(_0xd83a('0x2'));var express=require(_0xd83a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd83a('0x4'));var interaction=require(_0xd83a('0x5'));var config=require(_0xd83a('0x6'));var controller=require(_0xd83a('0x7'));router['get']('/',auth[_0xd83a('0x8')](),controller['index']);router['get'](_0xd83a('0x9'),auth['isAuthenticated'](),controller[_0xd83a('0xa')]);router[_0xd83a('0xb')]('/:id',auth[_0xd83a('0x8')](),controller['show']);router[_0xd83a('0xc')]('/',auth['isAuthenticated'](),controller[_0xd83a('0xd')]);router['put'](_0xd83a('0xe'),auth[_0xd83a('0x8')](),controller[_0xd83a('0xf')]);router[_0xd83a('0x10')](_0xd83a('0xe'),auth[_0xd83a('0x8')](),controller[_0xd83a('0x11')]);module[_0xd83a('0x12')]=router; \ No newline at end of file +var _0xef76=['put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create'];(function(_0x4d6298,_0x502f6b){var _0x57ccf0=function(_0x3cef94){while(--_0x3cef94){_0x4d6298['push'](_0x4d6298['shift']());}};_0x57ccf0(++_0x502f6b);}(_0xef76,0x108));var _0x6ef7=function(_0x1db2b2,_0x506115){_0x1db2b2=_0x1db2b2-0x0;var _0x41080b=_0xef76[_0x1db2b2];return _0x41080b;};'use strict';var multer=require(_0x6ef7('0x0'));var util=require('util');var path=require(_0x6ef7('0x1'));var timeout=require(_0x6ef7('0x2'));var express=require(_0x6ef7('0x3'));var router=express[_0x6ef7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6ef7('0x5'));var interaction=require(_0x6ef7('0x6'));var config=require('../../config/environment');var controller=require(_0x6ef7('0x7'));router[_0x6ef7('0x8')]('/',auth[_0x6ef7('0x9')](),controller[_0x6ef7('0xa')]);router[_0x6ef7('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x6ef7('0xb')]);router[_0x6ef7('0x8')](_0x6ef7('0xc'),auth['isAuthenticated'](),controller[_0x6ef7('0xd')]);router[_0x6ef7('0xe')]('/',auth[_0x6ef7('0x9')](),controller[_0x6ef7('0xf')]);router[_0x6ef7('0x10')](_0x6ef7('0xc'),auth[_0x6ef7('0x9')](),controller[_0x6ef7('0x11')]);router[_0x6ef7('0x12')](_0x6ef7('0xc'),auth[_0x6ef7('0x9')](),controller['destroy']);module[_0x6ef7('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 4529240..98b7cc7 100644 --- a/server/api/faxTransferReport/faxTransferReport.attributes.js +++ b/server/api/faxTransferReport/faxTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x13e391,_0x50a9f0){var _0xf3770e=function(_0x1e2fe8){while(--_0x1e2fe8){_0x13e391['push'](_0x13e391['shift']());}};_0xf3770e(++_0x50a9f0);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x2a0a38,_0x4a6de5){_0x2a0a38=_0x2a0a38-0x0;var _0x4a200e=_0xf3cd[_0x2a0a38];return _0x4a200e;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x2265da,_0xfbbd2e){var _0x430c2b=function(_0x20d671){while(--_0x20d671){_0x2265da['push'](_0x2265da['shift']());}};_0x430c2b(++_0xfbbd2e);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4104c0,_0x14d88e){_0x4104c0=_0x4104c0-0x0;var _0x2fecc0=_0xb43b[_0x4104c0];return _0x2fecc0;};'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/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index acaa61f..192fafa 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 _0x1916=['include','create','body','find','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','then','destroy','end','stack','name','send','index','map','FaxTransferReport','fieldName','type','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','catch','show','rawAttributes','filters','includeAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1916,0x17c));var _0x6191=function(_0x5a6268,_0x567f0f){_0x5a6268=_0x5a6268-0x0;var _0x709b18=_0x1916[_0x5a6268];return _0x709b18;};'use strict';var emlformat=require(_0x6191('0x0'));var rimraf=require(_0x6191('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6191('0x2'));var rp=require('request-promise');var moment=require(_0x6191('0x3'));var BPromise=require(_0x6191('0x4'));var Mustache=require(_0x6191('0x5'));var util=require(_0x6191('0x6'));var path=require(_0x6191('0x7'));var sox=require(_0x6191('0x8'));var csv=require(_0x6191('0x9'));var ejs=require(_0x6191('0xa'));var fs=require('fs');var fs_extra=require(_0x6191('0xb'));var _=require(_0x6191('0xc'));var squel=require(_0x6191('0xd'));var crypto=require(_0x6191('0xe'));var jsforce=require(_0x6191('0xf'));var deskjs=require(_0x6191('0x10'));var toCsv=require(_0x6191('0x9'));var querystring=require(_0x6191('0x11'));var Papa=require(_0x6191('0x12'));var Redis=require('ioredis');var authService=require(_0x6191('0x13'));var qs=require(_0x6191('0x14'));var as=require(_0x6191('0x15'));var hardwareService=require(_0x6191('0x16'));var logger=require(_0x6191('0x17'))('api');var utils=require(_0x6191('0x18'));var config=require(_0x6191('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a7dfa,_0x5e3e88){_0x5e3e88=_0x5e3e88||0xcc;return function(_0x29f13c){if(_0x29f13c){return _0x2a7dfa[_0x6191('0x1a')](_0x5e3e88);}return _0x2a7dfa['status'](_0x5e3e88)['end']();};}function respondWithResult(_0x12dc8b,_0x224295){_0x224295=_0x224295||0xc8;return function(_0x233b60){if(_0x233b60){return _0x12dc8b[_0x6191('0x1b')](_0x224295)['json'](_0x233b60);}};}function respondWithFilteredResult(_0x18e8df,_0x54ac6f){return function(_0x189a96){if(_0x189a96){var _0x3e8429=typeof _0x54ac6f[_0x6191('0x1c')]===_0x6191('0x1d')&&typeof _0x54ac6f[_0x6191('0x1e')]==='undefined';var _0x4fc071=_0x189a96[_0x6191('0x1f')];var _0x281fc7=_0x3e8429?0x0:_0x54ac6f[_0x6191('0x1c')];var _0x5593dc=_0x3e8429?_0x189a96[_0x6191('0x1f')]:_0x54ac6f[_0x6191('0x1c')]+_0x54ac6f[_0x6191('0x1e')];var _0x39df11;if(_0x5593dc>=_0x4fc071){_0x5593dc=_0x4fc071;_0x39df11=0xc8;}else{_0x39df11=0xce;}_0x18e8df[_0x6191('0x1b')](_0x39df11);return _0x18e8df[_0x6191('0x20')]('Content-Range',_0x281fc7+'-'+_0x5593dc+'/'+_0x4fc071)[_0x6191('0x21')](_0x189a96);}return null;};}function patchUpdates(_0x54384f){return function(_0x2cf0b8){try{jsonpatch['apply'](_0x2cf0b8,_0x54384f,!![]);}catch(_0x1bc911){return BPromise[_0x6191('0x22')](_0x1bc911);}return _0x2cf0b8[_0x6191('0x23')]();};}function saveUpdates(_0x9ef107,_0x236626){return function(_0xf06b3){if(_0xf06b3){return _0xf06b3['update'](_0x9ef107)[_0x6191('0x24')](function(_0x1bb820){return _0x1bb820;});}return null;};}function removeEntity(_0x30cde9,_0x719549){return function(_0x4293cb){if(_0x4293cb){return _0x4293cb[_0x6191('0x25')]()['then'](function(){_0x30cde9[_0x6191('0x1b')](0xcc)[_0x6191('0x26')]();});}};}function handleEntityNotFound(_0x16ac7f,_0x35374d){return function(_0x5d89df){if(!_0x5d89df){_0x16ac7f[_0x6191('0x1a')](0x194);}return _0x5d89df;};}function handleError(_0x5c9b9f,_0x5a005b){_0x5a005b=_0x5a005b||0x1f4;return function(_0x4bafde){logger['error'](_0x4bafde[_0x6191('0x27')]);if(_0x4bafde['name']){delete _0x4bafde[_0x6191('0x28')];}_0x5c9b9f[_0x6191('0x1b')](_0x5a005b)[_0x6191('0x29')](_0x4bafde);};}exports[_0x6191('0x2a')]=function(_0x19f073,_0x1ba059){var _0x50ba5b={},_0x220752={},_0x5169f4={'count':0x0,'rows':[]};var _0x5c161d=_[_0x6191('0x2b')](db[_0x6191('0x2c')]['rawAttributes'],function(_0x5dd5ef){return{'name':_0x5dd5ef[_0x6191('0x2d')],'type':_0x5dd5ef[_0x6191('0x2e')]['key']};});_0x220752['model']=_[_0x6191('0x2b')](_0x5c161d,_0x6191('0x28'));_0x220752['query']=_[_0x6191('0x2f')](_0x19f073[_0x6191('0x30')]);_0x220752['filters']=_[_0x6191('0x31')](_0x220752[_0x6191('0x32')],_0x220752[_0x6191('0x30')]);_0x50ba5b['attributes']=_[_0x6191('0x31')](_0x220752[_0x6191('0x32')],qs[_0x6191('0x33')](_0x19f073[_0x6191('0x30')]['fields']));_0x50ba5b[_0x6191('0x34')]=_0x50ba5b[_0x6191('0x34')][_0x6191('0x35')]?_0x50ba5b['attributes']:_0x220752[_0x6191('0x32')];if(!_0x19f073[_0x6191('0x30')][_0x6191('0x36')](_0x6191('0x37'))){_0x50ba5b[_0x6191('0x1e')]=qs[_0x6191('0x1e')](_0x19f073[_0x6191('0x30')]['limit']);_0x50ba5b['offset']=qs[_0x6191('0x1c')](_0x19f073[_0x6191('0x30')][_0x6191('0x1c')]);}_0x50ba5b[_0x6191('0x38')]=qs[_0x6191('0x39')](_0x19f073['query']['sort']);_0x50ba5b[_0x6191('0x3a')]=qs['filters'](_[_0x6191('0x3b')](_0x19f073['query'],_0x220752['filters']),_0x5c161d);if(_0x19f073[_0x6191('0x30')][_0x6191('0x3c')]){_0x50ba5b[_0x6191('0x3a')]=_['merge'](_0x50ba5b[_0x6191('0x3a')],{'$or':_['map'](_0x5c161d,function(_0x34d4af){if(_0x34d4af[_0x6191('0x2e')]!==_0x6191('0x3d')){var _0x16d22e={};_0x16d22e[_0x34d4af['name']]={'$like':'%'+_0x19f073[_0x6191('0x30')][_0x6191('0x3c')]+'%'};return _0x16d22e;}})});}_0x50ba5b=_[_0x6191('0x3e')]({},_0x50ba5b,_0x19f073[_0x6191('0x3f')]);var _0x5d6f91={'where':_0x50ba5b[_0x6191('0x3a')]};return db[_0x6191('0x2c')][_0x6191('0x1f')](_0x5d6f91)[_0x6191('0x24')](function(_0x45c456){_0x5169f4[_0x6191('0x1f')]=_0x45c456;if(_0x19f073['query']['includeAll']){_0x50ba5b['include']=[{'all':!![]}];}return db[_0x6191('0x2c')][_0x6191('0x40')](_0x50ba5b);})['then'](function(_0x4ce592){_0x5169f4['rows']=_0x4ce592;return _0x5169f4;})[_0x6191('0x24')](respondWithFilteredResult(_0x1ba059,_0x50ba5b))[_0x6191('0x41')](handleError(_0x1ba059,null));};exports[_0x6191('0x42')]=function(_0x15f524,_0x2bf134){var _0x12e750={'raw':!![],'where':{'id':_0x15f524['params']['id']}},_0x22f1c1={};_0x22f1c1['model']=_[_0x6191('0x2f')](db['FaxTransferReport'][_0x6191('0x43')]);_0x22f1c1[_0x6191('0x30')]=_[_0x6191('0x2f')](_0x15f524[_0x6191('0x30')]);_0x22f1c1[_0x6191('0x44')]=_[_0x6191('0x31')](_0x22f1c1['model'],_0x22f1c1[_0x6191('0x30')]);_0x12e750['attributes']=_[_0x6191('0x31')](_0x22f1c1[_0x6191('0x32')],qs[_0x6191('0x33')](_0x15f524[_0x6191('0x30')][_0x6191('0x33')]));_0x12e750[_0x6191('0x34')]=_0x12e750[_0x6191('0x34')][_0x6191('0x35')]?_0x12e750[_0x6191('0x34')]:_0x22f1c1[_0x6191('0x32')];if(_0x15f524[_0x6191('0x30')][_0x6191('0x45')]){_0x12e750[_0x6191('0x46')]=[{'all':!![]}];}_0x12e750=_[_0x6191('0x3e')]({},_0x12e750,_0x15f524[_0x6191('0x3f')]);return db[_0x6191('0x2c')]['find'](_0x12e750)[_0x6191('0x24')](handleEntityNotFound(_0x2bf134,null))['then'](respondWithResult(_0x2bf134,null))['catch'](handleError(_0x2bf134,null));};exports['create']=function(_0x54703d,_0x3f6964){return db['FaxTransferReport'][_0x6191('0x47')](_0x54703d['body'],{})[_0x6191('0x24')](respondWithResult(_0x3f6964,0xc9))[_0x6191('0x41')](handleError(_0x3f6964,null));};exports['update']=function(_0x40a509,_0x4d37d6){if(_0x40a509[_0x6191('0x48')]['id']){delete _0x40a509[_0x6191('0x48')]['id'];}return db['FaxTransferReport'][_0x6191('0x49')]({'where':{'id':_0x40a509['params']['id']}})['then'](handleEntityNotFound(_0x4d37d6,null))[_0x6191('0x24')](saveUpdates(_0x40a509[_0x6191('0x48')],null))[_0x6191('0x24')](respondWithResult(_0x4d37d6,null))['catch'](handleError(_0x4d37d6,null));};exports['destroy']=function(_0x4a2398,_0x4084a9){return db['FaxTransferReport'][_0x6191('0x49')]({'where':{'id':_0x4a2398['params']['id']}})[_0x6191('0x24')](handleEntityNotFound(_0x4084a9,null))['then'](removeEntity(_0x4084a9,null))['catch'](handleError(_0x4084a9,null));};exports['describe']=function(_0x571ad5,_0x38ea0b){return db[_0x6191('0x2c')][_0x6191('0x4a')]()[_0x6191('0x24')](respondWithResult(_0x38ea0b,null))[_0x6191('0x41')](handleError(_0x38ea0b,null));}; \ No newline at end of file +var _0x96a0=['moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxTransferReport','includeAll','include','findAll','catch','params','keys','rawAttributes','find','create','body','describe','eml-format','request-promise'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x96a0,0x1c6));var _0x096a=function(_0x45f4db,_0xfdc476){_0x45f4db=_0x45f4db-0x0;var _0x53b2fb=_0x96a0[_0x45f4db];return _0x53b2fb;};'use strict';var emlformat=require(_0x096a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x096a('0x1'));var moment=require(_0x096a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x096a('0x3'));var util=require(_0x096a('0x4'));var path=require(_0x096a('0x5'));var sox=require(_0x096a('0x6'));var csv=require(_0x096a('0x7'));var ejs=require(_0x096a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x096a('0x9'));var squel=require(_0x096a('0xa'));var crypto=require('crypto');var jsforce=require(_0x096a('0xb'));var deskjs=require(_0x096a('0xc'));var toCsv=require(_0x096a('0x7'));var querystring=require(_0x096a('0xd'));var Papa=require(_0x096a('0xe'));var Redis=require(_0x096a('0xf'));var authService=require(_0x096a('0x10'));var qs=require(_0x096a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x096a('0x12'));var logger=require(_0x096a('0x13'))(_0x096a('0x14'));var utils=require(_0x096a('0x15'));var config=require(_0x096a('0x16'));var licenseUtil=require(_0x096a('0x17'));var db=require(_0x096a('0x18'))['db'];function respondWithStatusCode(_0x5a262c,_0xc32b93){_0xc32b93=_0xc32b93||0xcc;return function(_0x418f38){if(_0x418f38){return _0x5a262c['sendStatus'](_0xc32b93);}return _0x5a262c[_0x096a('0x19')](_0xc32b93)[_0x096a('0x1a')]();};}function respondWithResult(_0x5965a7,_0x25f004){_0x25f004=_0x25f004||0xc8;return function(_0x2d366e){if(_0x2d366e){return _0x5965a7[_0x096a('0x19')](_0x25f004)[_0x096a('0x1b')](_0x2d366e);}};}function respondWithFilteredResult(_0x186b69,_0x1c1741){return function(_0x5301fd){if(_0x5301fd){var _0x5b3427=typeof _0x1c1741[_0x096a('0x1c')]===_0x096a('0x1d')&&typeof _0x1c1741['limit']===_0x096a('0x1d');var _0x442ce6=_0x5301fd[_0x096a('0x1e')];var _0xc057b3=_0x5b3427?0x0:_0x1c1741['offset'];var _0x432f0c=_0x5b3427?_0x5301fd['count']:_0x1c1741[_0x096a('0x1c')]+_0x1c1741[_0x096a('0x1f')];var _0x58ca14;if(_0x432f0c>=_0x442ce6){_0x432f0c=_0x442ce6;_0x58ca14=0xc8;}else{_0x58ca14=0xce;}_0x186b69[_0x096a('0x19')](_0x58ca14);return _0x186b69[_0x096a('0x20')](_0x096a('0x21'),_0xc057b3+'-'+_0x432f0c+'/'+_0x442ce6)[_0x096a('0x1b')](_0x5301fd);}return null;};}function patchUpdates(_0x5463e4){return function(_0x2f31a0){try{jsonpatch[_0x096a('0x22')](_0x2f31a0,_0x5463e4,!![]);}catch(_0x4aba46){return BPromise['reject'](_0x4aba46);}return _0x2f31a0[_0x096a('0x23')]();};}function saveUpdates(_0x453533,_0x521058){return function(_0x1f9985){if(_0x1f9985){return _0x1f9985[_0x096a('0x24')](_0x453533)[_0x096a('0x25')](function(_0x4d48f5){return _0x4d48f5;});}return null;};}function removeEntity(_0x56ce72,_0x465357){return function(_0x2dd417){if(_0x2dd417){return _0x2dd417[_0x096a('0x26')]()[_0x096a('0x25')](function(){_0x56ce72[_0x096a('0x19')](0xcc)[_0x096a('0x1a')]();});}};}function handleEntityNotFound(_0x16d129,_0x3ca14b){return function(_0x4ce609){if(!_0x4ce609){_0x16d129['sendStatus'](0x194);}return _0x4ce609;};}function handleError(_0x13ed26,_0x207f10){_0x207f10=_0x207f10||0x1f4;return function(_0x1a7e43){logger['error'](_0x1a7e43[_0x096a('0x27')]);if(_0x1a7e43[_0x096a('0x28')]){delete _0x1a7e43[_0x096a('0x28')];}_0x13ed26[_0x096a('0x19')](_0x207f10)[_0x096a('0x29')](_0x1a7e43);};}exports[_0x096a('0x2a')]=function(_0x34402d,_0x100273){var _0x334bdd={},_0x4d13dc={},_0x13509d={'count':0x0,'rows':[]};var _0x47941b=_['map'](db['FaxTransferReport']['rawAttributes'],function(_0x5e7465){return{'name':_0x5e7465[_0x096a('0x2b')],'type':_0x5e7465[_0x096a('0x2c')][_0x096a('0x2d')]};});_0x4d13dc[_0x096a('0x2e')]=_[_0x096a('0x2f')](_0x47941b,_0x096a('0x28'));_0x4d13dc[_0x096a('0x30')]=_['keys'](_0x34402d['query']);_0x4d13dc[_0x096a('0x31')]=_[_0x096a('0x32')](_0x4d13dc[_0x096a('0x2e')],_0x4d13dc[_0x096a('0x30')]);_0x334bdd[_0x096a('0x33')]=_[_0x096a('0x32')](_0x4d13dc[_0x096a('0x2e')],qs[_0x096a('0x34')](_0x34402d[_0x096a('0x30')][_0x096a('0x34')]));_0x334bdd[_0x096a('0x33')]=_0x334bdd[_0x096a('0x33')][_0x096a('0x35')]?_0x334bdd[_0x096a('0x33')]:_0x4d13dc['model'];if(!_0x34402d['query'][_0x096a('0x36')](_0x096a('0x37'))){_0x334bdd[_0x096a('0x1f')]=qs[_0x096a('0x1f')](_0x34402d['query']['limit']);_0x334bdd[_0x096a('0x1c')]=qs[_0x096a('0x1c')](_0x34402d['query'][_0x096a('0x1c')]);}_0x334bdd[_0x096a('0x38')]=qs[_0x096a('0x39')](_0x34402d[_0x096a('0x30')][_0x096a('0x39')]);_0x334bdd[_0x096a('0x3a')]=qs[_0x096a('0x31')](_[_0x096a('0x3b')](_0x34402d[_0x096a('0x30')],_0x4d13dc[_0x096a('0x31')]),_0x47941b);if(_0x34402d[_0x096a('0x30')][_0x096a('0x3c')]){_0x334bdd[_0x096a('0x3a')]=_[_0x096a('0x3d')](_0x334bdd[_0x096a('0x3a')],{'$or':_[_0x096a('0x2f')](_0x47941b,function(_0x11df81){if(_0x11df81[_0x096a('0x2c')]!==_0x096a('0x3e')){var _0x579fba={};_0x579fba[_0x11df81[_0x096a('0x28')]]={'$like':'%'+_0x34402d[_0x096a('0x30')][_0x096a('0x3c')]+'%'};return _0x579fba;}})});}_0x334bdd=_['merge']({},_0x334bdd,_0x34402d[_0x096a('0x3f')]);var _0x13b2c6={'where':_0x334bdd[_0x096a('0x3a')]};return db[_0x096a('0x40')][_0x096a('0x1e')](_0x13b2c6)[_0x096a('0x25')](function(_0x11c823){_0x13509d[_0x096a('0x1e')]=_0x11c823;if(_0x34402d[_0x096a('0x30')][_0x096a('0x41')]){_0x334bdd[_0x096a('0x42')]=[{'all':!![]}];}return db[_0x096a('0x40')][_0x096a('0x43')](_0x334bdd);})[_0x096a('0x25')](function(_0x2c84cf){_0x13509d['rows']=_0x2c84cf;return _0x13509d;})['then'](respondWithFilteredResult(_0x100273,_0x334bdd))[_0x096a('0x44')](handleError(_0x100273,null));};exports['show']=function(_0x3108d3,_0x1081ad){var _0x52f995={'raw':!![],'where':{'id':_0x3108d3[_0x096a('0x45')]['id']}},_0x3baa87={};_0x3baa87['model']=_[_0x096a('0x46')](db[_0x096a('0x40')][_0x096a('0x47')]);_0x3baa87[_0x096a('0x30')]=_['keys'](_0x3108d3['query']);_0x3baa87['filters']=_[_0x096a('0x32')](_0x3baa87[_0x096a('0x2e')],_0x3baa87[_0x096a('0x30')]);_0x52f995[_0x096a('0x33')]=_[_0x096a('0x32')](_0x3baa87[_0x096a('0x2e')],qs[_0x096a('0x34')](_0x3108d3[_0x096a('0x30')]['fields']));_0x52f995[_0x096a('0x33')]=_0x52f995[_0x096a('0x33')][_0x096a('0x35')]?_0x52f995['attributes']:_0x3baa87[_0x096a('0x2e')];if(_0x3108d3['query'][_0x096a('0x41')]){_0x52f995[_0x096a('0x42')]=[{'all':!![]}];}_0x52f995=_[_0x096a('0x3d')]({},_0x52f995,_0x3108d3[_0x096a('0x3f')]);return db[_0x096a('0x40')][_0x096a('0x48')](_0x52f995)[_0x096a('0x25')](handleEntityNotFound(_0x1081ad,null))[_0x096a('0x25')](respondWithResult(_0x1081ad,null))['catch'](handleError(_0x1081ad,null));};exports[_0x096a('0x49')]=function(_0x57015f,_0x4b23a7){return db[_0x096a('0x40')][_0x096a('0x49')](_0x57015f[_0x096a('0x4a')],{})[_0x096a('0x25')](respondWithResult(_0x4b23a7,0xc9))[_0x096a('0x44')](handleError(_0x4b23a7,null));};exports['update']=function(_0xcd174d,_0x45053c){if(_0xcd174d[_0x096a('0x4a')]['id']){delete _0xcd174d[_0x096a('0x4a')]['id'];}return db[_0x096a('0x40')][_0x096a('0x48')]({'where':{'id':_0xcd174d['params']['id']}})[_0x096a('0x25')](handleEntityNotFound(_0x45053c,null))[_0x096a('0x25')](saveUpdates(_0xcd174d['body'],null))[_0x096a('0x25')](respondWithResult(_0x45053c,null))['catch'](handleError(_0x45053c,null));};exports[_0x096a('0x26')]=function(_0x1717be,_0x37c9e4){return db[_0x096a('0x40')][_0x096a('0x48')]({'where':{'id':_0x1717be[_0x096a('0x45')]['id']}})[_0x096a('0x25')](handleEntityNotFound(_0x37c9e4,null))['then'](removeEntity(_0x37c9e4,null))[_0x096a('0x44')](handleError(_0x37c9e4,null));};exports['describe']=function(_0x4179be,_0x34f640){return db[_0x096a('0x40')][_0x096a('0x4b')]()['then'](respondWithResult(_0x34f640,null))[_0x096a('0x44')](handleError(_0x34f640,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 30e3d9e..93c44b4 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 _0x7b22=['report_fax_transfer','uniqueid','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x2046dd,_0x40a9ab){var _0x2eb055=function(_0x1c65e8){while(--_0x1c65e8){_0x2046dd['push'](_0x2046dd['shift']());}};_0x2eb055(++_0x40a9ab);}(_0x7b22,0x1e6));var _0x27b2=function(_0x54f3e8,_0x3ed493){_0x54f3e8=_0x54f3e8-0x0;var _0x267b37=_0x7b22[_0x54f3e8];return _0x267b37;};'use strict';var _=require('lodash');var util=require(_0x27b2('0x0'));var logger=require(_0x27b2('0x1'))(_0x27b2('0x2'));var moment=require('moment');var BPromise=require(_0x27b2('0x3'));var rp=require(_0x27b2('0x4'));var fs=require('fs');var path=require(_0x27b2('0x5'));var rimraf=require(_0x27b2('0x6'));var config=require(_0x27b2('0x7'));var attributes=require('./faxTransferReport.attributes');module[_0x27b2('0x8')]=function(_0x59358b,_0x10205b){return _0x59358b['define']('FaxTransferReport',attributes,{'tableName':_0x27b2('0x9'),'paranoid':![],'indexes':[{'name':_0x27b2('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb1a5=['rimraf','exports','define','report_fax_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0xb1a5,0x1cd));var _0x5b1a=function(_0x371af4,_0x2df3d1){_0x371af4=_0x371af4-0x0;var _0x243ca6=_0xb1a5[_0x371af4];return _0x243ca6;};'use strict';var _=require(_0x5b1a('0x0'));var util=require('util');var logger=require(_0x5b1a('0x1'))(_0x5b1a('0x2'));var moment=require(_0x5b1a('0x3'));var BPromise=require(_0x5b1a('0x4'));var rp=require(_0x5b1a('0x5'));var fs=require('fs');var path=require(_0x5b1a('0x6'));var rimraf=require(_0x5b1a('0x7'));var config=require('../../config/environment');var attributes=require('./faxTransferReport.attributes');module[_0x5b1a('0x8')]=function(_0x3e5529,_0x2e27ad){return _0x3e5529[_0x5b1a('0x9')]('FaxTransferReport',attributes,{'tableName':_0x5b1a('0xa'),'paranoid':![],'indexes':[{'name':_0x5b1a('0xb'),'fields':[_0x5b1a('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 0ad0910..9eea4c0 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 _0xdf44=['jayson/promise','client','http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1fe863,_0x5baa37){var _0x45f56b=function(_0x486277){while(--_0x486277){_0x1fe863['push'](_0x1fe863['shift']());}};_0x45f56b(++_0x5baa37);}(_0xdf44,0xb7));var _0x4df4=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xdf44[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x4df4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4df4('0x1'));var rs=require(_0x4df4('0x2'));var fs=require('fs');var Redis=require(_0x4df4('0x3'));var db=require(_0x4df4('0x4'))['db'];var utils=require(_0x4df4('0x5'));var logger=require(_0x4df4('0x6'))(_0x4df4('0x7'));var config=require(_0x4df4('0x8'));var jayson=require(_0x4df4('0x9'));var client=jayson[_0x4df4('0xa')][_0x4df4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e3851,_0x4823d,_0x1cb337){return new BPromise(function(_0x14f789,_0x14d056){return client[_0x4df4('0xc')](_0x2e3851,_0x1cb337)[_0x4df4('0xd')](function(_0x9cbab6){logger['info'](_0x4df4('0xe'),_0x4823d,_0x4df4('0xf'));logger[_0x4df4('0x10')](_0x4df4('0x11'),_0x4823d,_0x4df4('0xf'),JSON[_0x4df4('0x12')](_0x9cbab6));if(_0x9cbab6[_0x4df4('0x13')]){if(_0x9cbab6[_0x4df4('0x13')][_0x4df4('0x14')]===0x1f4){logger[_0x4df4('0x13')](_0x4df4('0xe'),_0x4823d,_0x9cbab6[_0x4df4('0x13')][_0x4df4('0x15')]);return _0x14d056(_0x9cbab6['error'][_0x4df4('0x15')]);}logger[_0x4df4('0x13')](_0x4df4('0xe'),_0x4823d,_0x9cbab6[_0x4df4('0x13')][_0x4df4('0x15')]);return _0x14f789(_0x9cbab6[_0x4df4('0x13')][_0x4df4('0x15')]);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x4823d,_0x4df4('0xf'));_0x14f789(_0x9cbab6[_0x4df4('0x16')]['message']);}})[_0x4df4('0x17')](function(_0x58e3de){logger[_0x4df4('0x13')](_0x4df4('0xe'),_0x4823d,_0x58e3de);_0x14d056(_0x58e3de);});});} \ No newline at end of file +var _0x9911=['jayson/promise','client','request','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxTransferReport,\x20%s,\x20%s','message','info','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x3959ff,_0x5460f8){var _0x459823=function(_0x2686f8){while(--_0x2686f8){_0x3959ff['push'](_0x3959ff['shift']());}};_0x459823(++_0x5460f8);}(_0x9911,0x164));var _0x1991=function(_0xa365e3,_0x695438){_0xa365e3=_0xa365e3-0x0;var _0x318a0b=_0x9911[_0xa365e3];return _0x318a0b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1991('0x0'))['db'];var utils=require(_0x1991('0x1'));var logger=require('../../config/logger')(_0x1991('0x2'));var config=require(_0x1991('0x3'));var jayson=require(_0x1991('0x4'));var client=jayson[_0x1991('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2eeebf,_0x3ffa69,_0x41e6f7){return new BPromise(function(_0x23d07e,_0x14be6f){return client[_0x1991('0x6')](_0x2eeebf,_0x41e6f7)['then'](function(_0x309b64){logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x3ffa69,_0x1991('0x7'));logger['debug'](_0x1991('0x8'),_0x3ffa69,_0x1991('0x7'),JSON[_0x1991('0x9')](_0x309b64));if(_0x309b64['error']){if(_0x309b64[_0x1991('0xa')][_0x1991('0xb')]===0x1f4){logger['error'](_0x1991('0xc'),_0x3ffa69,_0x309b64[_0x1991('0xa')][_0x1991('0xd')]);return _0x14be6f(_0x309b64[_0x1991('0xa')][_0x1991('0xd')]);}logger[_0x1991('0xa')](_0x1991('0xc'),_0x3ffa69,_0x309b64[_0x1991('0xa')][_0x1991('0xd')]);return _0x23d07e(_0x309b64[_0x1991('0xa')][_0x1991('0xd')]);}else{logger[_0x1991('0xe')](_0x1991('0xc'),_0x3ffa69,_0x1991('0x7'));_0x23d07e(_0x309b64['result'][_0x1991('0xd')]);}})['catch'](function(_0x4fe4dd){logger[_0x1991('0xa')](_0x1991('0xc'),_0x3ffa69,_0x4fe4dd);_0x14be6f(_0x4fe4dd);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index aa07b5c..fad74f6 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 _0x9a2a=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','post'];(function(_0x3b8622,_0x534704){var _0x39db20=function(_0x499789){while(--_0x499789){_0x3b8622['push'](_0x3b8622['shift']());}};_0x39db20(++_0x534704);}(_0x9a2a,0x1bf));var _0xa9a2=function(_0x358c86,_0x38a8a2){_0x358c86=_0x358c86-0x0;var _0x52edc5=_0x9a2a[_0x358c86];return _0x52edc5;};'use strict';var multer=require(_0xa9a2('0x0'));var util=require(_0xa9a2('0x1'));var path=require(_0xa9a2('0x2'));var timeout=require(_0xa9a2('0x3'));var express=require(_0xa9a2('0x4'));var router=express[_0xa9a2('0x5')]();var fs_extra=require(_0xa9a2('0x6'));var auth=require(_0xa9a2('0x7'));var interaction=require(_0xa9a2('0x8'));var config=require('../../config/environment');var controller=require('./faxTransferReport.controller');router[_0xa9a2('0x9')]('/',auth[_0xa9a2('0xa')](),controller[_0xa9a2('0xb')]);router[_0xa9a2('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xa9a2('0xc')]);router[_0xa9a2('0x9')](_0xa9a2('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xa9a2('0xe')]('/',auth['isAuthenticated'](),controller[_0xa9a2('0xf')]);router[_0xa9a2('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa9a2('0x11')]);router[_0xa9a2('0x12')](_0xa9a2('0xd'),auth[_0xa9a2('0xa')](),controller[_0xa9a2('0x13')]);module[_0xa9a2('0x14')]=router; \ No newline at end of file +var _0xd468=['../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router'];(function(_0x4836cb,_0x2101c9){var _0x1f7c70=function(_0x46defc){while(--_0x46defc){_0x4836cb['push'](_0x4836cb['shift']());}};_0x1f7c70(++_0x2101c9);}(_0xd468,0x175));var _0x8d46=function(_0x61f3a4,_0x3f1985){_0x61f3a4=_0x61f3a4-0x0;var _0x3a8133=_0xd468[_0x61f3a4];return _0x3a8133;};'use strict';var multer=require(_0x8d46('0x0'));var util=require(_0x8d46('0x1'));var path=require(_0x8d46('0x2'));var timeout=require(_0x8d46('0x3'));var express=require('express');var router=express[_0x8d46('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8d46('0x5'));var config=require(_0x8d46('0x6'));var controller=require(_0x8d46('0x7'));router[_0x8d46('0x8')]('/',auth[_0x8d46('0x9')](),controller[_0x8d46('0xa')]);router[_0x8d46('0x8')](_0x8d46('0xb'),auth['isAuthenticated'](),controller[_0x8d46('0xc')]);router[_0x8d46('0x8')](_0x8d46('0xd'),auth[_0x8d46('0x9')](),controller[_0x8d46('0xe')]);router[_0x8d46('0xf')]('/',auth['isAuthenticated'](),controller[_0x8d46('0x10')]);router[_0x8d46('0x11')](_0x8d46('0xd'),auth[_0x8d46('0x9')](),controller[_0x8d46('0x12')]);router[_0x8d46('0x13')]('/:id',auth[_0x8d46('0x9')](),controller['destroy']);module[_0x8d46('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 7e73185..c28f0ac 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 _0x7471=['show','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x406123,_0x48abbb){var _0x376320=function(_0xc330c6){while(--_0xc330c6){_0x406123['push'](_0x406123['shift']());}};_0x376320(++_0x48abbb);}(_0x7471,0x16f));var _0x1747=function(_0x33dc3b,_0x26e43b){_0x33dc3b=_0x33dc3b-0x0;var _0x3a4c6b=_0x7471[_0x33dc3b];return _0x3a4c6b;};'use strict';var multer=require(_0x1747('0x0'));var util=require(_0x1747('0x1'));var path=require('path');var timeout=require(_0x1747('0x2'));var express=require('express');var router=express[_0x1747('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1747('0x4'));var interaction=require(_0x1747('0x5'));var config=require(_0x1747('0x6'));var controller=require('./intDeskAccount.controller');router[_0x1747('0x7')]('/',auth[_0x1747('0x8')](),controller[_0x1747('0x9')]);router[_0x1747('0x7')](_0x1747('0xa'),auth[_0x1747('0x8')](),controller[_0x1747('0xb')]);router['get']('/:id/configurations',auth[_0x1747('0x8')](),controller[_0x1747('0xc')]);router['get'](_0x1747('0xd'),auth[_0x1747('0x8')](),controller['getFields']);router[_0x1747('0xe')]('/',auth[_0x1747('0x8')](),controller[_0x1747('0xf')]);router['post']('/:id/configurations',auth[_0x1747('0x8')](),controller[_0x1747('0x10')]);router[_0x1747('0x11')](_0x1747('0xa'),auth[_0x1747('0x8')](),controller[_0x1747('0x12')]);router[_0x1747('0x13')](_0x1747('0xa'),auth[_0x1747('0x8')](),controller[_0x1747('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa574=['express','Router','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x502844,_0x3a9b73){var _0x443889=function(_0x2ae980){while(--_0x2ae980){_0x502844['push'](_0x502844['shift']());}};_0x443889(++_0x3a9b73);}(_0xa574,0x128));var _0x4a57=function(_0x4fc403,_0x55d41f){_0x4fc403=_0x4fc403-0x0;var _0x1a9387=_0xa574[_0x4fc403];return _0x1a9387;};'use strict';var multer=require(_0x4a57('0x0'));var util=require(_0x4a57('0x1'));var path=require(_0x4a57('0x2'));var timeout=require(_0x4a57('0x3'));var express=require(_0x4a57('0x4'));var router=express[_0x4a57('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4a57('0x6'));var config=require(_0x4a57('0x7'));var controller=require(_0x4a57('0x8'));router[_0x4a57('0x9')]('/',auth[_0x4a57('0xa')](),controller[_0x4a57('0xb')]);router[_0x4a57('0x9')](_0x4a57('0xc'),auth[_0x4a57('0xa')](),controller[_0x4a57('0xd')]);router[_0x4a57('0x9')](_0x4a57('0xe'),auth[_0x4a57('0xa')](),controller[_0x4a57('0xf')]);router[_0x4a57('0x9')](_0x4a57('0x10'),auth[_0x4a57('0xa')](),controller[_0x4a57('0x11')]);router[_0x4a57('0x12')]('/',auth['isAuthenticated'](),controller[_0x4a57('0x13')]);router[_0x4a57('0x12')](_0x4a57('0xe'),auth[_0x4a57('0xa')](),controller['addConfiguration']);router[_0x4a57('0x14')]('/:id',auth[_0x4a57('0xa')](),controller[_0x4a57('0x15')]);router[_0x4a57('0x16')](_0x4a57('0xc'),auth[_0x4a57('0xa')](),controller[_0x4a57('0x17')]);module[_0x4a57('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 28e04b2..2462735 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 _0x1a76=['sequelize','exports','STRING','ENUM','basic','newTab','integrationTab'];(function(_0x2f3aa4,_0x18f404){var _0x548321=function(_0x5b30b4){while(--_0x5b30b4){_0x2f3aa4['push'](_0x2f3aa4['shift']());}};_0x548321(++_0x18f404);}(_0x1a76,0x93));var _0x61a7=function(_0x208c54,_0x120a70){_0x208c54=_0x208c54-0x0;var _0x4b0116=_0x1a76[_0x208c54];return _0x4b0116;};'use strict';var Sequelize=require(_0x61a7('0x0'));module[_0x61a7('0x1')]={'name':{'type':Sequelize[_0x61a7('0x2')]},'description':{'type':Sequelize[_0x61a7('0x2')]},'username':{'type':Sequelize[_0x61a7('0x2')]},'remoteUri':{'type':Sequelize[_0x61a7('0x2')]},'authType':{'type':Sequelize[_0x61a7('0x3')](_0x61a7('0x4')),'defaultValue':_0x61a7('0x4')},'password':{'type':Sequelize[_0x61a7('0x2')]},'consumerKey':{'type':Sequelize[_0x61a7('0x2')]},'consumerSecret':{'type':Sequelize[_0x61a7('0x2')]},'token':{'type':Sequelize[_0x61a7('0x2')]},'tokenSecret':{'type':Sequelize[_0x61a7('0x2')]},'serverUrl':{'type':Sequelize[_0x61a7('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x61a7('0x3')]('integrationTab',_0x61a7('0x5')),'defaultValue':_0x61a7('0x6')}}; \ No newline at end of file +var _0x34d1=['basic','integrationTab','newTab','sequelize','exports','STRING','ENUM'];(function(_0x2fcb9e,_0x310036){var _0x80c402=function(_0x33ed2b){while(--_0x33ed2b){_0x2fcb9e['push'](_0x2fcb9e['shift']());}};_0x80c402(++_0x310036);}(_0x34d1,0x14c));var _0x134d=function(_0x403eb1,_0x1dbdaa){_0x403eb1=_0x403eb1-0x0;var _0x401e6e=_0x34d1[_0x403eb1];return _0x401e6e;};'use strict';var Sequelize=require(_0x134d('0x0'));module[_0x134d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x134d('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x134d('0x3')](_0x134d('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x134d('0x2')]},'consumerKey':{'type':Sequelize[_0x134d('0x2')]},'consumerSecret':{'type':Sequelize[_0x134d('0x2')]},'token':{'type':Sequelize[_0x134d('0x2')]},'tokenSecret':{'type':Sequelize[_0x134d('0x2')]},'serverUrl':{'type':Sequelize[_0x134d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x134d('0x3')](_0x134d('0x5'),_0x134d('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 68f4064..c9cb0c5 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 _0xf3ed=['DeskConfiguration','addConfiguration','Subjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','Authorization','Basic\x20%s','%s:%s','toString','concat','_embedded','entries','active','label','test','statusCode','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','error','stack','name','send','map','DeskAccount','rawAttributes','fieldName','key','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','getConfigurations','findOne'];(function(_0x26d36f,_0x1b28c1){var _0x498ebd=function(_0x831832){while(--_0x831832){_0x26d36f['push'](_0x26d36f['shift']());}};_0x498ebd(++_0x1b28c1);}(_0xf3ed,0x17f));var _0xdf3e=function(_0x16588b,_0x529646){_0x16588b=_0x16588b-0x0;var _0x4c96c8=_0xf3ed[_0x16588b];return _0x4c96c8;};'use strict';var emlformat=require(_0xdf3e('0x0'));var rimraf=require(_0xdf3e('0x1'));var zipdir=require(_0xdf3e('0x2'));var jsonpatch=require(_0xdf3e('0x3'));var rp=require(_0xdf3e('0x4'));var moment=require(_0xdf3e('0x5'));var BPromise=require(_0xdf3e('0x6'));var Mustache=require('mustache');var util=require(_0xdf3e('0x7'));var path=require(_0xdf3e('0x8'));var sox=require(_0xdf3e('0x9'));var csv=require('to-csv');var ejs=require(_0xdf3e('0xa'));var fs=require('fs');var fs_extra=require(_0xdf3e('0xb'));var _=require('lodash');var squel=require(_0xdf3e('0xc'));var crypto=require(_0xdf3e('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdf3e('0xe'));var querystring=require(_0xdf3e('0xf'));var Papa=require(_0xdf3e('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdf3e('0x11'));var as=require(_0xdf3e('0x12'));var hardwareService=require(_0xdf3e('0x13'));var logger=require(_0xdf3e('0x14'))(_0xdf3e('0x15'));var utils=require(_0xdf3e('0x16'));var config=require(_0xdf3e('0x17'));var licenseUtil=require(_0xdf3e('0x18'));var db=require(_0xdf3e('0x19'))['db'];var integrations=require(_0xdf3e('0x1a'));function respondWithStatusCode(_0xbc04e4,_0x3a5f86){_0x3a5f86=_0x3a5f86||0xcc;return function(_0x21705e){if(_0x21705e){return _0xbc04e4[_0xdf3e('0x1b')](_0x3a5f86);}return _0xbc04e4[_0xdf3e('0x1c')](_0x3a5f86)[_0xdf3e('0x1d')]();};}function respondWithResult(_0x20c5ad,_0x1a58f8){_0x1a58f8=_0x1a58f8||0xc8;return function(_0x4713bd){if(_0x4713bd){return _0x20c5ad['status'](_0x1a58f8)[_0xdf3e('0x1e')](_0x4713bd);}};}function respondWithFilteredResult(_0x591de2,_0x4220bc){return function(_0x4f8231){if(_0x4f8231){var _0x526d29=typeof _0x4220bc[_0xdf3e('0x1f')]===_0xdf3e('0x20')&&typeof _0x4220bc[_0xdf3e('0x21')]===_0xdf3e('0x20');var _0x3d81b6=_0x4f8231[_0xdf3e('0x22')];var _0x394281=_0x526d29?0x0:_0x4220bc['offset'];var _0x512be8=_0x526d29?_0x4f8231['count']:_0x4220bc[_0xdf3e('0x1f')]+_0x4220bc[_0xdf3e('0x21')];var _0x4efa42;if(_0x512be8>=_0x3d81b6){_0x512be8=_0x3d81b6;_0x4efa42=0xc8;}else{_0x4efa42=0xce;}_0x591de2[_0xdf3e('0x1c')](_0x4efa42);return _0x591de2[_0xdf3e('0x23')](_0xdf3e('0x24'),_0x394281+'-'+_0x512be8+'/'+_0x3d81b6)[_0xdf3e('0x1e')](_0x4f8231);}return null;};}function patchUpdates(_0xb8b190){return function(_0x3fd246){try{jsonpatch['apply'](_0x3fd246,_0xb8b190,!![]);}catch(_0x5d3e67){return BPromise[_0xdf3e('0x25')](_0x5d3e67);}return _0x3fd246['save']();};}function saveUpdates(_0x4bfb01,_0x4c0bee){return function(_0x3b656c){if(_0x3b656c){return _0x3b656c['update'](_0x4bfb01)[_0xdf3e('0x26')](function(_0x4be063){return _0x4be063;});}return null;};}function removeEntity(_0x296472,_0x38d5c1){return function(_0x4c8adc){if(_0x4c8adc){return _0x4c8adc[_0xdf3e('0x27')]()[_0xdf3e('0x26')](function(){_0x296472['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e1789,_0xba9d4b){return function(_0x2d332b){if(!_0x2d332b){_0x5e1789[_0xdf3e('0x1b')](0x194);}return _0x2d332b;};}function handleError(_0x1f76a0,_0x4653ef){_0x4653ef=_0x4653ef||0x1f4;return function(_0x5e9778){logger[_0xdf3e('0x28')](_0x5e9778[_0xdf3e('0x29')]);if(_0x5e9778[_0xdf3e('0x2a')]){delete _0x5e9778[_0xdf3e('0x2a')];}_0x1f76a0['status'](_0x4653ef)[_0xdf3e('0x2b')](_0x5e9778);};}exports['index']=function(_0x573d67,_0x8da08c){var _0x2166ee={},_0x566d8e={},_0x1ac157={'count':0x0,'rows':[]};var _0x415147=_[_0xdf3e('0x2c')](db[_0xdf3e('0x2d')][_0xdf3e('0x2e')],function(_0x3d4bd8){return{'name':_0x3d4bd8[_0xdf3e('0x2f')],'type':_0x3d4bd8['type'][_0xdf3e('0x30')]};});_0x566d8e['model']=_[_0xdf3e('0x2c')](_0x415147,_0xdf3e('0x2a'));_0x566d8e['query']=_[_0xdf3e('0x31')](_0x573d67[_0xdf3e('0x32')]);_0x566d8e[_0xdf3e('0x33')]=_['intersection'](_0x566d8e[_0xdf3e('0x34')],_0x566d8e[_0xdf3e('0x32')]);_0x2166ee[_0xdf3e('0x35')]=_[_0xdf3e('0x36')](_0x566d8e[_0xdf3e('0x34')],qs[_0xdf3e('0x37')](_0x573d67['query'][_0xdf3e('0x37')]));_0x2166ee[_0xdf3e('0x35')]=_0x2166ee[_0xdf3e('0x35')]['length']?_0x2166ee[_0xdf3e('0x35')]:_0x566d8e[_0xdf3e('0x34')];if(!_0x573d67[_0xdf3e('0x32')][_0xdf3e('0x38')](_0xdf3e('0x39'))){_0x2166ee[_0xdf3e('0x21')]=qs['limit'](_0x573d67['query'][_0xdf3e('0x21')]);_0x2166ee['offset']=qs[_0xdf3e('0x1f')](_0x573d67[_0xdf3e('0x32')][_0xdf3e('0x1f')]);}_0x2166ee[_0xdf3e('0x3a')]=qs[_0xdf3e('0x3b')](_0x573d67['query'][_0xdf3e('0x3b')]);_0x2166ee[_0xdf3e('0x3c')]=qs[_0xdf3e('0x33')](_[_0xdf3e('0x3d')](_0x573d67['query'],_0x566d8e[_0xdf3e('0x33')]),_0x415147);if(_0x573d67['query']['filter']){_0x2166ee['where']=_[_0xdf3e('0x3e')](_0x2166ee['where'],{'$or':_[_0xdf3e('0x2c')](_0x415147,function(_0x33929d){if(_0x33929d[_0xdf3e('0x3f')]!==_0xdf3e('0x40')){var _0x26f438={};_0x26f438[_0x33929d[_0xdf3e('0x2a')]]={'$like':'%'+_0x573d67[_0xdf3e('0x32')][_0xdf3e('0x41')]+'%'};return _0x26f438;}})});}_0x2166ee=_[_0xdf3e('0x3e')]({},_0x2166ee,_0x573d67[_0xdf3e('0x42')]);var _0x59ee20={'where':_0x2166ee[_0xdf3e('0x3c')]};return db[_0xdf3e('0x2d')][_0xdf3e('0x22')](_0x59ee20)['then'](function(_0x66e670){_0x1ac157[_0xdf3e('0x22')]=_0x66e670;if(_0x573d67[_0xdf3e('0x32')][_0xdf3e('0x43')]){_0x2166ee[_0xdf3e('0x44')]=[{'all':!![]}];}return db[_0xdf3e('0x2d')][_0xdf3e('0x45')](_0x2166ee);})[_0xdf3e('0x26')](function(_0x210f01){_0x1ac157[_0xdf3e('0x46')]=_0x210f01;return _0x1ac157;})[_0xdf3e('0x26')](respondWithFilteredResult(_0x8da08c,_0x2166ee))[_0xdf3e('0x47')](handleError(_0x8da08c,null));};exports[_0xdf3e('0x48')]=function(_0x5c1954,_0x102fed){var _0x21b3a={'raw':![],'where':{'id':_0x5c1954[_0xdf3e('0x49')]['id']}},_0x19f555={};_0x19f555[_0xdf3e('0x34')]=_['keys'](db[_0xdf3e('0x2d')][_0xdf3e('0x2e')]);_0x19f555[_0xdf3e('0x32')]=_['keys'](_0x5c1954[_0xdf3e('0x32')]);_0x19f555[_0xdf3e('0x33')]=_[_0xdf3e('0x36')](_0x19f555[_0xdf3e('0x34')],_0x19f555[_0xdf3e('0x32')]);_0x21b3a[_0xdf3e('0x35')]=_['intersection'](_0x19f555['model'],qs[_0xdf3e('0x37')](_0x5c1954['query']['fields']));_0x21b3a['attributes']=_0x21b3a[_0xdf3e('0x35')][_0xdf3e('0x4a')]?_0x21b3a[_0xdf3e('0x35')]:_0x19f555[_0xdf3e('0x34')];if(_0x5c1954[_0xdf3e('0x32')][_0xdf3e('0x43')]){_0x21b3a[_0xdf3e('0x44')]=[{'all':!![]}];}_0x21b3a=_[_0xdf3e('0x3e')]({},_0x21b3a,_0x5c1954[_0xdf3e('0x42')]);return db[_0xdf3e('0x2d')][_0xdf3e('0x4b')](_0x21b3a)[_0xdf3e('0x26')](handleEntityNotFound(_0x102fed,null))[_0xdf3e('0x26')](respondWithResult(_0x102fed,null))[_0xdf3e('0x47')](handleError(_0x102fed,null));};exports[_0xdf3e('0x4c')]=function(_0x5b5e77,_0xfeccdb){return db[_0xdf3e('0x2d')]['create'](_0x5b5e77[_0xdf3e('0x4d')],{})[_0xdf3e('0x26')](respondWithResult(_0xfeccdb,0xc9))['catch'](handleError(_0xfeccdb,null));};exports[_0xdf3e('0x4e')]=function(_0x401f80,_0x583a57){if(_0x401f80['body']['id']){delete _0x401f80[_0xdf3e('0x4d')]['id'];}return db[_0xdf3e('0x2d')][_0xdf3e('0x4b')]({'where':{'id':_0x401f80[_0xdf3e('0x49')]['id']}})['then'](handleEntityNotFound(_0x583a57,null))[_0xdf3e('0x26')](saveUpdates(_0x401f80[_0xdf3e('0x4d')],null))[_0xdf3e('0x26')](respondWithResult(_0x583a57,null))[_0xdf3e('0x47')](handleError(_0x583a57,null));};exports['destroy']=function(_0x95adee,_0x1ddd01){return db[_0xdf3e('0x2d')][_0xdf3e('0x4b')]({'where':{'id':_0x95adee[_0xdf3e('0x49')]['id']}})['then'](handleEntityNotFound(_0x1ddd01,null))[_0xdf3e('0x26')](removeEntity(_0x1ddd01,null))[_0xdf3e('0x47')](handleError(_0x1ddd01,null));};exports[_0xdf3e('0x4f')]=function(_0x216c1a,_0x4f7122,_0x241589){var _0xb18a9d={};var _0x1e5205={};var _0x1d6601;var _0xea66ea;return db['DeskAccount'][_0xdf3e('0x50')]({'where':{'id':_0x216c1a[_0xdf3e('0x49')]['id']}})[_0xdf3e('0x26')](handleEntityNotFound(_0x4f7122,null))['then'](function(_0x5de9e4){if(_0x5de9e4){_0x1d6601=_0x5de9e4;_0x1e5205[_0xdf3e('0x34')]=_[_0xdf3e('0x31')](db[_0xdf3e('0x51')][_0xdf3e('0x2e')]);_0x1e5205[_0xdf3e('0x32')]=_['keys'](_0x216c1a[_0xdf3e('0x32')]);_0x1e5205[_0xdf3e('0x33')]=_['intersection'](_0x1e5205[_0xdf3e('0x34')],_0x1e5205['query']);_0xb18a9d[_0xdf3e('0x35')]=_['intersection'](_0x1e5205[_0xdf3e('0x34')],qs[_0xdf3e('0x37')](_0x216c1a[_0xdf3e('0x32')][_0xdf3e('0x37')]));_0xb18a9d['attributes']=_0xb18a9d[_0xdf3e('0x35')]['length']?_0xb18a9d[_0xdf3e('0x35')]:_0x1e5205[_0xdf3e('0x34')];_0xb18a9d[_0xdf3e('0x3a')]=qs[_0xdf3e('0x3b')](_0x216c1a['query'][_0xdf3e('0x3b')]);_0xb18a9d['where']=qs[_0xdf3e('0x33')](_['pick'](_0x216c1a['query'],_0x1e5205[_0xdf3e('0x33')]));if(_0x216c1a['query'][_0xdf3e('0x41')]){_0xb18a9d[_0xdf3e('0x3c')]=_['merge'](_0xb18a9d[_0xdf3e('0x3c')],{'$or':_[_0xdf3e('0x2c')](_0xb18a9d[_0xdf3e('0x35')],function(_0x232b57){var _0x1f967b={};_0x1f967b[_0x232b57]={'$like':'%'+_0x216c1a[_0xdf3e('0x32')]['filter']+'%'};return _0x1f967b;})});}_0xb18a9d=_[_0xdf3e('0x3e')]({},_0xb18a9d,_0x216c1a['options']);return _0x1d6601[_0xdf3e('0x4f')](_0xb18a9d);}})['then'](function(_0x150bdd){if(_0x150bdd){_0xea66ea=_0x150bdd[_0xdf3e('0x4a')];if(!_0x216c1a[_0xdf3e('0x32')]['hasOwnProperty'](_0xdf3e('0x39'))){_0xb18a9d[_0xdf3e('0x21')]=qs[_0xdf3e('0x21')](_0x216c1a[_0xdf3e('0x32')][_0xdf3e('0x21')]);_0xb18a9d['offset']=qs[_0xdf3e('0x1f')](_0x216c1a[_0xdf3e('0x32')]['offset']);}return _0x1d6601['getConfigurations'](_0xb18a9d);}})[_0xdf3e('0x26')](function(_0x9d8e96){if(_0x9d8e96){return _0x9d8e96?{'count':_0xea66ea,'rows':_0x9d8e96}:null;}})['then'](respondWithResult(_0x4f7122,null))[_0xdf3e('0x47')](handleError(_0x4f7122,null));};exports[_0xdf3e('0x52')]=function(_0x35a68f,_0x48e8c7,_0x1f4078){if(_0x35a68f[_0xdf3e('0x4d')]['id']){delete _0x35a68f[_0xdf3e('0x4d')]['id'];}return db['DeskAccount'][_0xdf3e('0x50')]({'where':{'id':_0x35a68f[_0xdf3e('0x49')]['id']}})['then'](handleEntityNotFound(_0x48e8c7,null))[_0xdf3e('0x26')](function(_0xc0d173){if(_0xc0d173){_0x35a68f[_0xdf3e('0x4d')]['AccountId']=_0xc0d173['id'];_0x35a68f[_0xdf3e('0x4d')][_0xdf3e('0x53')]=integrations['getSubjects'](_0x35a68f[_0xdf3e('0x4d')][_0xdf3e('0x54')],_0x35a68f[_0xdf3e('0x4d')][_0xdf3e('0x3f')]);_0x35a68f[_0xdf3e('0x4d')][_0xdf3e('0x55')]=integrations[_0xdf3e('0x56')](_0x35a68f[_0xdf3e('0x4d')]['channel'],_0x35a68f[_0xdf3e('0x4d')]['type']);return db[_0xdf3e('0x51')][_0xdf3e('0x4c')](_0x35a68f[_0xdf3e('0x4d')],{'include':[{'model':db[_0xdf3e('0x57')],'as':_0xdf3e('0x53')},{'model':db[_0xdf3e('0x57')],'as':_0xdf3e('0x55')}]});}return null;})[_0xdf3e('0x26')](respondWithResult(_0x48e8c7,null))[_0xdf3e('0x47')](handleError(_0x48e8c7,null));};exports[_0xdf3e('0x58')]=function(_0x277ecc,_0x38a732,_0x52a69e){var _0xdcb54b=[{'name':_0xdf3e('0x59'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x2d2201='';return db[_0xdf3e('0x2d')]['findOne']({'where':{'id':_0x277ecc['params']['id']},'attributes':['id',_0xdf3e('0x5a'),_0xdf3e('0x5b'),_0xdf3e('0x5c'),_0xdf3e('0x5d'),_0xdf3e('0x5e'),_0xdf3e('0x5f'),'token',_0xdf3e('0x60')]})[_0xdf3e('0x26')](handleEntityNotFound(_0x38a732,null))['then'](function(_0x335f10){if(_0x335f10){_0x2d2201=_0x335f10[_0xdf3e('0x5a')];var _0xebc2ef=_0x2d2201[_0xdf3e('0x61')](-0x1);if(_0xebc2ef==='/'){_0x2d2201=_0x2d2201[_0xdf3e('0x62')](0x0,_0x2d2201[_0xdf3e('0x63')](_0xebc2ef));}var _0x432b62={'method':_0xdf3e('0x64'),'uri':util[_0xdf3e('0x65')](_0xdf3e('0x66'),_0x2d2201),'headers':{'Content-Type':_0xdf3e('0x67'),'Accept':_0xdf3e('0x67')},'json':!![]};if(_0x335f10['authType']==='basic'){_0x432b62['headers'][_0xdf3e('0x68')]=util[_0xdf3e('0x65')](_0xdf3e('0x69'),new Buffer(util['format'](_0xdf3e('0x6a'),_0x335f10[_0xdf3e('0x5c')],_0x335f10[_0xdf3e('0x5d')]))[_0xdf3e('0x6b')]('base64'));}return rp(_0x432b62)[_0xdf3e('0x26')](function(_0x24a313){return _0xdcb54b[_0xdf3e('0x6c')](_[_0xdf3e('0x2c')](_0x24a313[_0xdf3e('0x6d')][_0xdf3e('0x6e')],function(_0x2d5719){return{'id':_0x2d5719[_0xdf3e('0x2a')],'name':_0x2d5719[_0xdf3e('0x2a')],'type':_0x2d5719[_0xdf3e('0x3f')],'active':_0x2d5719[_0xdf3e('0x6f')],'label':_0x2d5719[_0xdf3e('0x70')],'custom':!![]};}));});}})[_0xdf3e('0x26')](function(_0xc21304){return{'count':_0xc21304[_0xdf3e('0x4a')],'rows':_0xc21304};})[_0xdf3e('0x26')](respondWithResult(_0x38a732,null))[_0xdf3e('0x47')](function(_0x244fd1){var _0x141e2e=_0x277ecc[_0xdf3e('0x32')][_0xdf3e('0x71')]?0x1f4:_0x244fd1[_0xdf3e('0x72')]||0x1f4;logger[_0xdf3e('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0xdf3e('0x58'),_0x141e2e,JSON[_0xdf3e('0x73')](_0x244fd1));delete _0x244fd1['name'];if(_0x141e2e===0x191){_0x141e2e=0x190;}_0x38a732[_0xdf3e('0x1c')](_0x141e2e)[_0xdf3e('0x2b')](_0x277ecc[_0xdf3e('0x32')][_0xdf3e('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x244fd1[_0xdf3e('0x72')]}:_0x244fd1);});}; \ No newline at end of file +var _0x30e0=['basic','headers','Authorization','Basic\x20%s','password','toString','base64','_embedded','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','update','then','error','stack','name','send','map','DeskAccount','rawAttributes','key','query','keys','filters','model','attributes','intersection','fields','length','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','params','find','catch','create','body','destroy','getConfigurations','hasOwnProperty','nolimit','AccountId','Subjects','type','getDescriptions','DeskField','Descriptions','getFields','priority','findOne','remoteUri','username','consumerKey','consumerSecret','token','slice','substring','lastIndexOf','GET','format','%s/custom_fields','authType'];(function(_0x516739,_0x8cf625){var _0x2eac88=function(_0x2e52e2){while(--_0x2e52e2){_0x516739['push'](_0x516739['shift']());}};_0x2eac88(++_0x8cf625);}(_0x30e0,0x76));var _0x030e=function(_0x303310,_0x3d6211){_0x303310=_0x303310-0x0;var _0x1e4370=_0x30e0[_0x303310];return _0x1e4370;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x030e('0x0'));var jsonpatch=require(_0x030e('0x1'));var rp=require(_0x030e('0x2'));var moment=require(_0x030e('0x3'));var BPromise=require(_0x030e('0x4'));var Mustache=require(_0x030e('0x5'));var util=require(_0x030e('0x6'));var path=require(_0x030e('0x7'));var sox=require(_0x030e('0x8'));var csv=require(_0x030e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x030e('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x030e('0xb'));var Papa=require('papaparse');var Redis=require(_0x030e('0xc'));var authService=require(_0x030e('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x030e('0xe'));var hardwareService=require(_0x030e('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x030e('0x10'));var config=require(_0x030e('0x11'));var licenseUtil=require(_0x030e('0x12'));var db=require(_0x030e('0x13'))['db'];var integrations=require(_0x030e('0x14'));function respondWithStatusCode(_0x1bc08e,_0xab05ee){_0xab05ee=_0xab05ee||0xcc;return function(_0x451a3a){if(_0x451a3a){return _0x1bc08e[_0x030e('0x15')](_0xab05ee);}return _0x1bc08e['status'](_0xab05ee)[_0x030e('0x16')]();};}function respondWithResult(_0x5cd376,_0x213be4){_0x213be4=_0x213be4||0xc8;return function(_0x2b0878){if(_0x2b0878){return _0x5cd376[_0x030e('0x17')](_0x213be4)[_0x030e('0x18')](_0x2b0878);}};}function respondWithFilteredResult(_0x21589d,_0x52962b){return function(_0x52dad5){if(_0x52dad5){var _0x129175=typeof _0x52962b[_0x030e('0x19')]===_0x030e('0x1a')&&typeof _0x52962b['limit']===_0x030e('0x1a');var _0x1d6fcb=_0x52dad5[_0x030e('0x1b')];var _0x570ae6=_0x129175?0x0:_0x52962b[_0x030e('0x19')];var _0x13dca5=_0x129175?_0x52dad5[_0x030e('0x1b')]:_0x52962b[_0x030e('0x19')]+_0x52962b[_0x030e('0x1c')];var _0x330c45;if(_0x13dca5>=_0x1d6fcb){_0x13dca5=_0x1d6fcb;_0x330c45=0xc8;}else{_0x330c45=0xce;}_0x21589d[_0x030e('0x17')](_0x330c45);return _0x21589d[_0x030e('0x1d')]('Content-Range',_0x570ae6+'-'+_0x13dca5+'/'+_0x1d6fcb)[_0x030e('0x18')](_0x52dad5);}return null;};}function patchUpdates(_0x4a30ab){return function(_0x3d48d1){try{jsonpatch[_0x030e('0x1e')](_0x3d48d1,_0x4a30ab,!![]);}catch(_0xf11b6c){return BPromise[_0x030e('0x1f')](_0xf11b6c);}return _0x3d48d1['save']();};}function saveUpdates(_0x39d212,_0x237d54){return function(_0x1debda){if(_0x1debda){return _0x1debda[_0x030e('0x20')](_0x39d212)[_0x030e('0x21')](function(_0x3d170f){return _0x3d170f;});}return null;};}function removeEntity(_0xded1e,_0x41677b){return function(_0x3a37c9){if(_0x3a37c9){return _0x3a37c9['destroy']()[_0x030e('0x21')](function(){_0xded1e[_0x030e('0x17')](0xcc)[_0x030e('0x16')]();});}};}function handleEntityNotFound(_0x4ded5f,_0x2d3d5f){return function(_0x49662f){if(!_0x49662f){_0x4ded5f[_0x030e('0x15')](0x194);}return _0x49662f;};}function handleError(_0x58daef,_0x2cdc1a){_0x2cdc1a=_0x2cdc1a||0x1f4;return function(_0x187e01){logger[_0x030e('0x22')](_0x187e01[_0x030e('0x23')]);if(_0x187e01[_0x030e('0x24')]){delete _0x187e01[_0x030e('0x24')];}_0x58daef[_0x030e('0x17')](_0x2cdc1a)[_0x030e('0x25')](_0x187e01);};}exports['index']=function(_0x5ec9d1,_0x3a3402){var _0x35e5ca={},_0x508af6={},_0x22b701={'count':0x0,'rows':[]};var _0x5ca7e6=_[_0x030e('0x26')](db[_0x030e('0x27')][_0x030e('0x28')],function(_0x4170d3){return{'name':_0x4170d3['fieldName'],'type':_0x4170d3['type'][_0x030e('0x29')]};});_0x508af6['model']=_[_0x030e('0x26')](_0x5ca7e6,_0x030e('0x24'));_0x508af6[_0x030e('0x2a')]=_[_0x030e('0x2b')](_0x5ec9d1['query']);_0x508af6[_0x030e('0x2c')]=_['intersection'](_0x508af6[_0x030e('0x2d')],_0x508af6['query']);_0x35e5ca[_0x030e('0x2e')]=_[_0x030e('0x2f')](_0x508af6[_0x030e('0x2d')],qs[_0x030e('0x30')](_0x5ec9d1[_0x030e('0x2a')]['fields']));_0x35e5ca[_0x030e('0x2e')]=_0x35e5ca[_0x030e('0x2e')][_0x030e('0x31')]?_0x35e5ca[_0x030e('0x2e')]:_0x508af6[_0x030e('0x2d')];if(!_0x5ec9d1[_0x030e('0x2a')]['hasOwnProperty']('nolimit')){_0x35e5ca['limit']=qs[_0x030e('0x1c')](_0x5ec9d1[_0x030e('0x2a')][_0x030e('0x1c')]);_0x35e5ca['offset']=qs[_0x030e('0x19')](_0x5ec9d1[_0x030e('0x2a')][_0x030e('0x19')]);}_0x35e5ca[_0x030e('0x32')]=qs[_0x030e('0x33')](_0x5ec9d1[_0x030e('0x2a')]['sort']);_0x35e5ca[_0x030e('0x34')]=qs[_0x030e('0x2c')](_[_0x030e('0x35')](_0x5ec9d1[_0x030e('0x2a')],_0x508af6[_0x030e('0x2c')]),_0x5ca7e6);if(_0x5ec9d1[_0x030e('0x2a')]['filter']){_0x35e5ca['where']=_['merge'](_0x35e5ca[_0x030e('0x34')],{'$or':_[_0x030e('0x26')](_0x5ca7e6,function(_0x36b6f5){if(_0x36b6f5['type']!==_0x030e('0x36')){var _0x184511={};_0x184511[_0x36b6f5[_0x030e('0x24')]]={'$like':'%'+_0x5ec9d1['query'][_0x030e('0x37')]+'%'};return _0x184511;}})});}_0x35e5ca=_[_0x030e('0x38')]({},_0x35e5ca,_0x5ec9d1[_0x030e('0x39')]);var _0x358cf3={'where':_0x35e5ca['where']};return db[_0x030e('0x27')][_0x030e('0x1b')](_0x358cf3)['then'](function(_0x7e5838){_0x22b701[_0x030e('0x1b')]=_0x7e5838;if(_0x5ec9d1[_0x030e('0x2a')][_0x030e('0x3a')]){_0x35e5ca[_0x030e('0x3b')]=[{'all':!![]}];}return db[_0x030e('0x27')][_0x030e('0x3c')](_0x35e5ca);})[_0x030e('0x21')](function(_0x5f3833){_0x22b701[_0x030e('0x3d')]=_0x5f3833;return _0x22b701;})[_0x030e('0x21')](respondWithFilteredResult(_0x3a3402,_0x35e5ca))['catch'](handleError(_0x3a3402,null));};exports['show']=function(_0x4342b7,_0x93c50){var _0x3f90d1={'raw':![],'where':{'id':_0x4342b7[_0x030e('0x3e')]['id']}},_0x48f058={};_0x48f058[_0x030e('0x2d')]=_[_0x030e('0x2b')](db[_0x030e('0x27')][_0x030e('0x28')]);_0x48f058['query']=_['keys'](_0x4342b7[_0x030e('0x2a')]);_0x48f058[_0x030e('0x2c')]=_[_0x030e('0x2f')](_0x48f058[_0x030e('0x2d')],_0x48f058[_0x030e('0x2a')]);_0x3f90d1[_0x030e('0x2e')]=_[_0x030e('0x2f')](_0x48f058[_0x030e('0x2d')],qs[_0x030e('0x30')](_0x4342b7['query'][_0x030e('0x30')]));_0x3f90d1[_0x030e('0x2e')]=_0x3f90d1[_0x030e('0x2e')]['length']?_0x3f90d1[_0x030e('0x2e')]:_0x48f058['model'];if(_0x4342b7[_0x030e('0x2a')][_0x030e('0x3a')]){_0x3f90d1['include']=[{'all':!![]}];}_0x3f90d1=_[_0x030e('0x38')]({},_0x3f90d1,_0x4342b7[_0x030e('0x39')]);return db[_0x030e('0x27')][_0x030e('0x3f')](_0x3f90d1)[_0x030e('0x21')](handleEntityNotFound(_0x93c50,null))['then'](respondWithResult(_0x93c50,null))[_0x030e('0x40')](handleError(_0x93c50,null));};exports['create']=function(_0x3307ea,_0x4af1be){return db[_0x030e('0x27')][_0x030e('0x41')](_0x3307ea[_0x030e('0x42')],{})[_0x030e('0x21')](respondWithResult(_0x4af1be,0xc9))[_0x030e('0x40')](handleError(_0x4af1be,null));};exports[_0x030e('0x20')]=function(_0xf6774c,_0x5824e7){if(_0xf6774c['body']['id']){delete _0xf6774c[_0x030e('0x42')]['id'];}return db[_0x030e('0x27')][_0x030e('0x3f')]({'where':{'id':_0xf6774c[_0x030e('0x3e')]['id']}})[_0x030e('0x21')](handleEntityNotFound(_0x5824e7,null))[_0x030e('0x21')](saveUpdates(_0xf6774c['body'],null))[_0x030e('0x21')](respondWithResult(_0x5824e7,null))['catch'](handleError(_0x5824e7,null));};exports[_0x030e('0x43')]=function(_0x41361d,_0x411d74){return db[_0x030e('0x27')][_0x030e('0x3f')]({'where':{'id':_0x41361d[_0x030e('0x3e')]['id']}})[_0x030e('0x21')](handleEntityNotFound(_0x411d74,null))[_0x030e('0x21')](removeEntity(_0x411d74,null))[_0x030e('0x40')](handleError(_0x411d74,null));};exports[_0x030e('0x44')]=function(_0xf9e29a,_0xc2bd2,_0x1f1e21){var _0x3ba608={};var _0x594f6c={};var _0x11e8ad;var _0x59fa08;return db[_0x030e('0x27')]['findOne']({'where':{'id':_0xf9e29a['params']['id']}})[_0x030e('0x21')](handleEntityNotFound(_0xc2bd2,null))[_0x030e('0x21')](function(_0x11fd0f){if(_0x11fd0f){_0x11e8ad=_0x11fd0f;_0x594f6c[_0x030e('0x2d')]=_[_0x030e('0x2b')](db['DeskConfiguration'][_0x030e('0x28')]);_0x594f6c[_0x030e('0x2a')]=_[_0x030e('0x2b')](_0xf9e29a['query']);_0x594f6c[_0x030e('0x2c')]=_[_0x030e('0x2f')](_0x594f6c[_0x030e('0x2d')],_0x594f6c[_0x030e('0x2a')]);_0x3ba608['attributes']=_[_0x030e('0x2f')](_0x594f6c[_0x030e('0x2d')],qs[_0x030e('0x30')](_0xf9e29a[_0x030e('0x2a')][_0x030e('0x30')]));_0x3ba608[_0x030e('0x2e')]=_0x3ba608[_0x030e('0x2e')][_0x030e('0x31')]?_0x3ba608['attributes']:_0x594f6c[_0x030e('0x2d')];_0x3ba608[_0x030e('0x32')]=qs[_0x030e('0x33')](_0xf9e29a['query'][_0x030e('0x33')]);_0x3ba608['where']=qs[_0x030e('0x2c')](_[_0x030e('0x35')](_0xf9e29a['query'],_0x594f6c[_0x030e('0x2c')]));if(_0xf9e29a[_0x030e('0x2a')]['filter']){_0x3ba608[_0x030e('0x34')]=_[_0x030e('0x38')](_0x3ba608[_0x030e('0x34')],{'$or':_[_0x030e('0x26')](_0x3ba608[_0x030e('0x2e')],function(_0x3f6e9a){var _0x2e8ff1={};_0x2e8ff1[_0x3f6e9a]={'$like':'%'+_0xf9e29a[_0x030e('0x2a')]['filter']+'%'};return _0x2e8ff1;})});}_0x3ba608=_['merge']({},_0x3ba608,_0xf9e29a[_0x030e('0x39')]);return _0x11e8ad[_0x030e('0x44')](_0x3ba608);}})['then'](function(_0x524ebe){if(_0x524ebe){_0x59fa08=_0x524ebe[_0x030e('0x31')];if(!_0xf9e29a['query'][_0x030e('0x45')](_0x030e('0x46'))){_0x3ba608[_0x030e('0x1c')]=qs[_0x030e('0x1c')](_0xf9e29a[_0x030e('0x2a')][_0x030e('0x1c')]);_0x3ba608[_0x030e('0x19')]=qs[_0x030e('0x19')](_0xf9e29a[_0x030e('0x2a')][_0x030e('0x19')]);}return _0x11e8ad[_0x030e('0x44')](_0x3ba608);}})['then'](function(_0x47127e){if(_0x47127e){return _0x47127e?{'count':_0x59fa08,'rows':_0x47127e}:null;}})[_0x030e('0x21')](respondWithResult(_0xc2bd2,null))['catch'](handleError(_0xc2bd2,null));};exports['addConfiguration']=function(_0x23c2ad,_0x283a9f,_0x1c884f){if(_0x23c2ad['body']['id']){delete _0x23c2ad['body']['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x23c2ad['params']['id']}})[_0x030e('0x21')](handleEntityNotFound(_0x283a9f,null))[_0x030e('0x21')](function(_0x12c922){if(_0x12c922){_0x23c2ad[_0x030e('0x42')][_0x030e('0x47')]=_0x12c922['id'];_0x23c2ad[_0x030e('0x42')][_0x030e('0x48')]=integrations['getSubjects'](_0x23c2ad['body']['channel'],_0x23c2ad['body'][_0x030e('0x49')]);_0x23c2ad[_0x030e('0x42')]['Descriptions']=integrations[_0x030e('0x4a')](_0x23c2ad[_0x030e('0x42')]['channel'],_0x23c2ad[_0x030e('0x42')][_0x030e('0x49')]);return db['DeskConfiguration'][_0x030e('0x41')](_0x23c2ad[_0x030e('0x42')],{'include':[{'model':db[_0x030e('0x4b')],'as':'Subjects'},{'model':db[_0x030e('0x4b')],'as':_0x030e('0x4c')}]});}return null;})[_0x030e('0x21')](respondWithResult(_0x283a9f,null))[_0x030e('0x40')](handleError(_0x283a9f,null));};exports[_0x030e('0x4d')]=function(_0x4aa088,_0x1d6d6,_0x571888){var _0x389779=[{'name':_0x030e('0x4e'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x4bd1f5='';return db[_0x030e('0x27')][_0x030e('0x4f')]({'where':{'id':_0x4aa088[_0x030e('0x3e')]['id']},'attributes':['id',_0x030e('0x50'),'authType',_0x030e('0x51'),'password',_0x030e('0x52'),_0x030e('0x53'),_0x030e('0x54'),'tokenSecret']})[_0x030e('0x21')](handleEntityNotFound(_0x1d6d6,null))[_0x030e('0x21')](function(_0x4f75ff){if(_0x4f75ff){_0x4bd1f5=_0x4f75ff[_0x030e('0x50')];var _0x54e8fc=_0x4bd1f5[_0x030e('0x55')](-0x1);if(_0x54e8fc==='/'){_0x4bd1f5=_0x4bd1f5[_0x030e('0x56')](0x0,_0x4bd1f5[_0x030e('0x57')](_0x54e8fc));}var _0x5706c5={'method':_0x030e('0x58'),'uri':util[_0x030e('0x59')](_0x030e('0x5a'),_0x4bd1f5),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x4f75ff[_0x030e('0x5b')]===_0x030e('0x5c')){_0x5706c5[_0x030e('0x5d')][_0x030e('0x5e')]=util[_0x030e('0x59')](_0x030e('0x5f'),new Buffer(util[_0x030e('0x59')]('%s:%s',_0x4f75ff['username'],_0x4f75ff[_0x030e('0x60')]))[_0x030e('0x61')](_0x030e('0x62')));}return rp(_0x5706c5)[_0x030e('0x21')](function(_0x2a2838){return _0x389779['concat'](_[_0x030e('0x26')](_0x2a2838[_0x030e('0x63')]['entries'],function(_0x5680d2){return{'id':_0x5680d2[_0x030e('0x24')],'name':_0x5680d2['name'],'type':_0x5680d2[_0x030e('0x49')],'active':_0x5680d2[_0x030e('0x64')],'label':_0x5680d2[_0x030e('0x65')],'custom':!![]};}));});}})['then'](function(_0x524717){return{'count':_0x524717[_0x030e('0x31')],'rows':_0x524717};})[_0x030e('0x21')](respondWithResult(_0x1d6d6,null))[_0x030e('0x40')](function(_0x3263e9){var _0x16d73c=_0x4aa088[_0x030e('0x2a')][_0x030e('0x66')]?0x1f4:_0x3263e9[_0x030e('0x67')]||0x1f4;logger['error'](_0x030e('0x68'),_0x030e('0x4d'),_0x16d73c,JSON['stringify'](_0x3263e9));delete _0x3263e9[_0x030e('0x24')];if(_0x16d73c===0x191){_0x16d73c=0x190;}_0x1d6d6['status'](_0x16d73c)[_0x030e('0x25')](_0x4aa088[_0x030e('0x2a')][_0x030e('0x66')]?{'message':'Wrong\x20credentials','statusCode':_0x3263e9['statusCode']}:_0x3263e9);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index b377bac..4d6c370 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 _0x9d14=['request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x484752,_0x5749bd){var _0x4d5e0a=function(_0x141c9f){while(--_0x141c9f){_0x484752['push'](_0x484752['shift']());}};_0x4d5e0a(++_0x5749bd);}(_0x9d14,0x1ad));var _0x49d1=function(_0x34f66c,_0x1934b5){_0x34f66c=_0x34f66c-0x0;var _0x272c69=_0x9d14[_0x34f66c];return _0x272c69;};'use strict';var _=require(_0x49d1('0x0'));var util=require(_0x49d1('0x1'));var logger=require(_0x49d1('0x2'))(_0x49d1('0x3'));var moment=require(_0x49d1('0x4'));var BPromise=require(_0x49d1('0x5'));var rp=require(_0x49d1('0x6'));var fs=require('fs');var path=require(_0x49d1('0x7'));var rimraf=require(_0x49d1('0x8'));var config=require(_0x49d1('0x9'));var attributes=require(_0x49d1('0xa'));var integrations=require(_0x49d1('0xb'));module['exports']=function(_0x1ea4d4,_0x397adf){return _0x1ea4d4[_0x49d1('0xc')](_0x49d1('0xd'),attributes,{'tableName':_0x49d1('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2135=['exports','define','int_desk_accounts','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0x2135,0x87));var _0x5213=function(_0x3d9bc3,_0x42f819){_0x3d9bc3=_0x3d9bc3-0x0;var _0x3f26d4=_0x2135[_0x3d9bc3];return _0x3f26d4;};'use strict';var _=require('lodash');var util=require(_0x5213('0x0'));var logger=require(_0x5213('0x1'))(_0x5213('0x2'));var moment=require('moment');var BPromise=require(_0x5213('0x3'));var rp=require(_0x5213('0x4'));var fs=require('fs');var path=require(_0x5213('0x5'));var rimraf=require(_0x5213('0x6'));var config=require(_0x5213('0x7'));var attributes=require('./intDeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x5213('0x8')]=function(_0x337d09,_0x393860){return _0x337d09[_0x5213('0x9')]('DeskAccount',attributes,{'tableName':_0x5213('0xa'),'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 bc75b0f..30c9f67 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 _0x45cf=['where','attributes','include','map','model','ShowDeskAccount','find','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetDeskAccount','DeskAccount','findAll','options'];(function(_0x45c262,_0x2e3ce5){var _0x4f2ba6=function(_0x4912d1){while(--_0x4912d1){_0x45c262['push'](_0x45c262['shift']());}};_0x4f2ba6(++_0x2e3ce5);}(_0x45cf,0x1dc));var _0xf45c=function(_0xdff215,_0x51203d){_0xdff215=_0xdff215-0x0;var _0x51b48e=_0x45cf[_0xdff215];return _0x51b48e;};'use strict';var _=require(_0xf45c('0x0'));var util=require('util');var moment=require(_0xf45c('0x1'));var BPromise=require(_0xf45c('0x2'));var rs=require(_0xf45c('0x3'));var fs=require('fs');var Redis=require(_0xf45c('0x4'));var db=require(_0xf45c('0x5'))['db'];var utils=require(_0xf45c('0x6'));var logger=require(_0xf45c('0x7'))(_0xf45c('0x8'));var config=require('../../config/environment');var jayson=require(_0xf45c('0x9'));var client=jayson[_0xf45c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15785a,_0x183ccf,_0x60938e){return new BPromise(function(_0x53ac2a,_0x20c922){return client[_0xf45c('0xb')](_0x15785a,_0x60938e)[_0xf45c('0xc')](function(_0x105075){logger[_0xf45c('0xd')](_0xf45c('0xe'),_0x183ccf,'request\x20sent');logger[_0xf45c('0xf')](_0xf45c('0x10'),_0x183ccf,_0xf45c('0x11'),JSON[_0xf45c('0x12')](_0x105075));if(_0x105075[_0xf45c('0x13')]){if(_0x105075['error'][_0xf45c('0x14')]===0x1f4){logger[_0xf45c('0x13')](_0xf45c('0xe'),_0x183ccf,_0x105075[_0xf45c('0x13')][_0xf45c('0x15')]);return _0x20c922(_0x105075['error'][_0xf45c('0x15')]);}logger['error'](_0xf45c('0xe'),_0x183ccf,_0x105075['error'][_0xf45c('0x15')]);return _0x53ac2a(_0x105075[_0xf45c('0x13')]['message']);}else{logger[_0xf45c('0xd')](_0xf45c('0xe'),_0x183ccf,_0xf45c('0x11'));_0x53ac2a(_0x105075[_0xf45c('0x16')][_0xf45c('0x15')]);}})[_0xf45c('0x17')](function(_0x2eb3d4){logger['error'](_0xf45c('0xe'),_0x183ccf,_0x2eb3d4);_0x20c922(_0x2eb3d4);});});}exports[_0xf45c('0x18')]=function(_0x17f8f9){var _0x3718f8=this;return new Promise(function(_0xd042d9,_0x12613e){return db[_0xf45c('0x19')][_0xf45c('0x1a')]({'raw':_0x17f8f9['options']?_0x17f8f9[_0xf45c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x17f8f9[_0xf45c('0x1b')]?_0x17f8f9[_0xf45c('0x1b')][_0xf45c('0x1c')]||null:null,'attributes':_0x17f8f9[_0xf45c('0x1b')]?_0x17f8f9[_0xf45c('0x1b')][_0xf45c('0x1d')]||null:null,'limit':_0x17f8f9['options']?_0x17f8f9[_0xf45c('0x1b')]['limit']||null:null,'include':_0x17f8f9[_0xf45c('0x1b')]?_0x17f8f9['options'][_0xf45c('0x1e')]?_[_0xf45c('0x1f')](_0x17f8f9['options'][_0xf45c('0x1e')],function(_0x3da2ad){return{'model':db[_0x3da2ad[_0xf45c('0x20')]],'as':_0x3da2ad['as'],'attributes':_0x3da2ad[_0xf45c('0x1d')],'include':_0x3da2ad[_0xf45c('0x1e')]?_[_0xf45c('0x1f')](_0x3da2ad[_0xf45c('0x1e')],function(_0x274cf6){return{'model':db[_0x274cf6['model']],'as':_0x274cf6['as'],'attributes':_0x274cf6['attributes'],'include':_0x274cf6['include']?_[_0xf45c('0x1f')](_0x274cf6[_0xf45c('0x1e')],function(_0x5bee16){return{'model':db[_0x5bee16[_0xf45c('0x20')]],'as':_0x5bee16['as'],'attributes':_0x5bee16[_0xf45c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf45c('0xc')](function(_0x41f6e2){logger[_0xf45c('0xd')]('GetDeskAccount',_0x17f8f9);logger[_0xf45c('0xf')](_0xf45c('0x18'),_0x17f8f9,JSON[_0xf45c('0x12')](_0x41f6e2));_0xd042d9(_0x41f6e2);})[_0xf45c('0x17')](function(_0xec2917){logger[_0xf45c('0x13')](_0xf45c('0x18'),_0xec2917['message'],_0x17f8f9);_0x12613e(_0x3718f8[_0xf45c('0x13')](0x1f4,_0xec2917['message']));});});};exports[_0xf45c('0x21')]=function(_0x49ec95){var _0x49c04e=this;return new Promise(function(_0x1c9c48,_0x1f68f1){return db[_0xf45c('0x19')][_0xf45c('0x22')]({'raw':_0x49ec95['options']?_0x49ec95[_0xf45c('0x1b')][_0xf45c('0x23')]===undefined?!![]:![]:!![],'where':_0x49ec95[_0xf45c('0x1b')]?_0x49ec95[_0xf45c('0x1b')][_0xf45c('0x1c')]||null:null,'attributes':_0x49ec95[_0xf45c('0x1b')]?_0x49ec95[_0xf45c('0x1b')][_0xf45c('0x1d')]||null:null,'include':_0x49ec95[_0xf45c('0x1b')]?_0x49ec95['options'][_0xf45c('0x1e')]?_[_0xf45c('0x1f')](_0x49ec95['options'][_0xf45c('0x1e')],function(_0x1144ab){return{'model':db[_0x1144ab[_0xf45c('0x20')]],'as':_0x1144ab['as'],'attributes':_0x1144ab[_0xf45c('0x1d')],'include':_0x1144ab[_0xf45c('0x1e')]?_[_0xf45c('0x1f')](_0x1144ab[_0xf45c('0x1e')],function(_0x22c740){return{'model':db[_0x22c740[_0xf45c('0x20')]],'as':_0x22c740['as'],'attributes':_0x22c740[_0xf45c('0x1d')],'include':_0x22c740[_0xf45c('0x1e')]?_['map'](_0x22c740[_0xf45c('0x1e')],function(_0xf93ee9){return{'model':db[_0xf93ee9[_0xf45c('0x20')]],'as':_0xf93ee9['as'],'attributes':_0xf93ee9[_0xf45c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf45c('0xc')](function(_0x2fd66b){logger[_0xf45c('0xd')](_0xf45c('0x21'),_0x49ec95);logger[_0xf45c('0xf')](_0xf45c('0x21'),_0x49ec95,JSON['stringify'](_0x2fd66b));_0x1c9c48(_0x2fd66b);})['catch'](function(_0x433876){logger['error']('ShowDeskAccount',_0x433876[_0xf45c('0x15')],_0x49ec95);_0x1f68f1(_0x49c04e['error'](0x1f4,_0x433876[_0xf45c('0x15')]));});});}; \ No newline at end of file +var _0x4b8e=['find','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','DeskAccount,\x20%s,\x20%s','debug','request\x20sent','error','message','info','GetDeskAccount','DeskAccount','findAll','options','raw','where','limit','include','map','attributes','model','stringify','catch','ShowDeskAccount'];(function(_0x5cb19e,_0x38aca7){var _0xfed456=function(_0x33952b){while(--_0x33952b){_0x5cb19e['push'](_0x5cb19e['shift']());}};_0xfed456(++_0x38aca7);}(_0x4b8e,0x86));var _0xe4b8=function(_0x2442b9,_0x3d87e9){_0x2442b9=_0x2442b9-0x0;var _0x31b571=_0x4b8e[_0x2442b9];return _0x31b571;};'use strict';var _=require('lodash');var util=require(_0xe4b8('0x0'));var moment=require(_0xe4b8('0x1'));var BPromise=require(_0xe4b8('0x2'));var rs=require(_0xe4b8('0x3'));var fs=require('fs');var Redis=require(_0xe4b8('0x4'));var db=require(_0xe4b8('0x5'))['db'];var utils=require(_0xe4b8('0x6'));var logger=require(_0xe4b8('0x7'))('rpc');var config=require(_0xe4b8('0x8'));var jayson=require(_0xe4b8('0x9'));var client=jayson[_0xe4b8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x281826,_0x57a215,_0x353869){return new BPromise(function(_0x42b74e,_0x33cd77){return client['request'](_0x281826,_0x353869)['then'](function(_0x96d981){logger['info'](_0xe4b8('0xb'),_0x57a215,'request\x20sent');logger[_0xe4b8('0xc')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x57a215,_0xe4b8('0xd'),JSON['stringify'](_0x96d981));if(_0x96d981[_0xe4b8('0xe')]){if(_0x96d981['error']['code']===0x1f4){logger[_0xe4b8('0xe')](_0xe4b8('0xb'),_0x57a215,_0x96d981[_0xe4b8('0xe')]['message']);return _0x33cd77(_0x96d981['error'][_0xe4b8('0xf')]);}logger['error']('DeskAccount,\x20%s,\x20%s',_0x57a215,_0x96d981[_0xe4b8('0xe')][_0xe4b8('0xf')]);return _0x42b74e(_0x96d981[_0xe4b8('0xe')][_0xe4b8('0xf')]);}else{logger[_0xe4b8('0x10')]('DeskAccount,\x20%s,\x20%s',_0x57a215,_0xe4b8('0xd'));_0x42b74e(_0x96d981['result']['message']);}})['catch'](function(_0x11fe48){logger['error']('DeskAccount,\x20%s,\x20%s',_0x57a215,_0x11fe48);_0x33cd77(_0x11fe48);});});}exports[_0xe4b8('0x11')]=function(_0x26bb71){var _0x4c76de=this;return new Promise(function(_0x14604a,_0x1ee37e){return db[_0xe4b8('0x12')][_0xe4b8('0x13')]({'raw':_0x26bb71[_0xe4b8('0x14')]?_0x26bb71['options'][_0xe4b8('0x15')]===undefined?!![]:![]:!![],'where':_0x26bb71[_0xe4b8('0x14')]?_0x26bb71[_0xe4b8('0x14')][_0xe4b8('0x16')]||null:null,'attributes':_0x26bb71[_0xe4b8('0x14')]?_0x26bb71['options']['attributes']||null:null,'limit':_0x26bb71[_0xe4b8('0x14')]?_0x26bb71[_0xe4b8('0x14')][_0xe4b8('0x17')]||null:null,'include':_0x26bb71[_0xe4b8('0x14')]?_0x26bb71[_0xe4b8('0x14')][_0xe4b8('0x18')]?_[_0xe4b8('0x19')](_0x26bb71['options'][_0xe4b8('0x18')],function(_0x5a34c5){return{'model':db[_0x5a34c5['model']],'as':_0x5a34c5['as'],'attributes':_0x5a34c5[_0xe4b8('0x1a')],'include':_0x5a34c5[_0xe4b8('0x18')]?_[_0xe4b8('0x19')](_0x5a34c5[_0xe4b8('0x18')],function(_0x568d05){return{'model':db[_0x568d05[_0xe4b8('0x1b')]],'as':_0x568d05['as'],'attributes':_0x568d05[_0xe4b8('0x1a')],'include':_0x568d05[_0xe4b8('0x18')]?_[_0xe4b8('0x19')](_0x568d05['include'],function(_0x55f340){return{'model':db[_0x55f340[_0xe4b8('0x1b')]],'as':_0x55f340['as'],'attributes':_0x55f340[_0xe4b8('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x18b86d){logger[_0xe4b8('0x10')](_0xe4b8('0x11'),_0x26bb71);logger[_0xe4b8('0xc')](_0xe4b8('0x11'),_0x26bb71,JSON[_0xe4b8('0x1c')](_0x18b86d));_0x14604a(_0x18b86d);})[_0xe4b8('0x1d')](function(_0x1f2de2){logger[_0xe4b8('0xe')](_0xe4b8('0x11'),_0x1f2de2['message'],_0x26bb71);_0x1ee37e(_0x4c76de[_0xe4b8('0xe')](0x1f4,_0x1f2de2[_0xe4b8('0xf')]));});});};exports[_0xe4b8('0x1e')]=function(_0x431328){var _0x5d78c3=this;return new Promise(function(_0x2d9ede,_0x2906f1){return db['DeskAccount'][_0xe4b8('0x1f')]({'raw':_0x431328[_0xe4b8('0x14')]?_0x431328[_0xe4b8('0x14')][_0xe4b8('0x15')]===undefined?!![]:![]:!![],'where':_0x431328['options']?_0x431328[_0xe4b8('0x14')][_0xe4b8('0x16')]||null:null,'attributes':_0x431328[_0xe4b8('0x14')]?_0x431328['options'][_0xe4b8('0x1a')]||null:null,'include':_0x431328['options']?_0x431328[_0xe4b8('0x14')][_0xe4b8('0x18')]?_[_0xe4b8('0x19')](_0x431328['options'][_0xe4b8('0x18')],function(_0x41010a){return{'model':db[_0x41010a[_0xe4b8('0x1b')]],'as':_0x41010a['as'],'attributes':_0x41010a[_0xe4b8('0x1a')],'include':_0x41010a[_0xe4b8('0x18')]?_[_0xe4b8('0x19')](_0x41010a['include'],function(_0x2ce9fa){return{'model':db[_0x2ce9fa[_0xe4b8('0x1b')]],'as':_0x2ce9fa['as'],'attributes':_0x2ce9fa['attributes'],'include':_0x2ce9fa[_0xe4b8('0x18')]?_[_0xe4b8('0x19')](_0x2ce9fa[_0xe4b8('0x18')],function(_0x2fdee0){return{'model':db[_0x2fdee0['model']],'as':_0x2fdee0['as'],'attributes':_0x2fdee0['attributes']};}):[]};}):[]};}):[]:[]})[_0xe4b8('0x20')](function(_0x12eeb6){logger[_0xe4b8('0x10')]('ShowDeskAccount',_0x431328);logger[_0xe4b8('0xc')]('ShowDeskAccount',_0x431328,JSON[_0xe4b8('0x1c')](_0x12eeb6));_0x2d9ede(_0x12eeb6);})['catch'](function(_0x28a1fb){logger[_0xe4b8('0xe')](_0xe4b8('0x1e'),_0x28a1fb[_0xe4b8('0xf')],_0x431328);_0x2906f1(_0x5d78c3[_0xe4b8('0xe')](0x1f4,_0x28a1fb[_0xe4b8('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 91a781b..4d80434 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x163315,_0x4a0dbe){var _0x5d3c72=function(_0x1426e6){while(--_0x1426e6){_0x163315['push'](_0x163315['shift']());}};_0x5d3c72(++_0x4a0dbe);}(_0x3e74,0x175));var _0x43e7=function(_0xde2ae1,_0x1b83a8){_0xde2ae1=_0xde2ae1-0x0;var _0x53b42d=_0x3e74[_0xde2ae1];return _0x53b42d;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router; \ No newline at end of file +var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4b756a,_0x44d33e){var _0x4a3885=function(_0x51bd48){while(--_0x51bd48){_0x4b756a['push'](_0x4b756a['shift']());}};_0x4a3885(++_0x44d33e);}(_0x008c,0x188));var _0xc008=function(_0xd05d0e,_0x222ec6){_0xd05d0e=_0xd05d0e-0x0;var _0xa812c=_0x008c[_0xd05d0e];return _0xa812c;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 56d278d..9bc2ccf 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 _0x1600=['STRING','exports'];(function(_0x3b66c8,_0x45a72b){var _0x4ab7c9=function(_0x4d949e){while(--_0x4d949e){_0x3b66c8['push'](_0x3b66c8['shift']());}};_0x4ab7c9(++_0x45a72b);}(_0x1600,0x181));var _0x0160=function(_0x4f6046,_0x2868c2){_0x4f6046=_0x4f6046-0x0;var _0x529972=_0x1600[_0x4f6046];return _0x529972;};'use strict';var Sequelize=require('sequelize');module[_0x0160('0x0')]={'name':{'type':Sequelize[_0x0160('0x1')]},'description':{'type':Sequelize[_0x0160('0x1')]}}; \ No newline at end of file +var _0x0384=['sequelize'];(function(_0x1731e9,_0x4e8d60){var _0x3748c6=function(_0x733dce){while(--_0x733dce){_0x1731e9['push'](_0x1731e9['shift']());}};_0x3748c6(++_0x4e8d60);}(_0x0384,0x1db));var _0x4038=function(_0x451e94,_0x57cd38){_0x451e94=_0x451e94-0x0;var _0x1b5884=_0x0384[_0x451e94];return _0x1b5884;};'use strict';var Sequelize=require(_0x4038('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 770f766..b9c4038 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 _0x25e6=['where','merge','VIRTUAL','then','includeAll','findAll','rows','catch','show','include','options','create','body','find','params','getFields','findOne','DeskField','length','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','update','destroy','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter'];(function(_0x13e11a,_0xe0fc7){var _0xd7f115=function(_0x59b196){while(--_0x59b196){_0x13e11a['push'](_0x13e11a['shift']());}};_0xd7f115(++_0xe0fc7);}(_0x25e6,0x11b));var _0x625e=function(_0x23ad7f,_0x5f2641){_0x23ad7f=_0x23ad7f-0x0;var _0x25c67d=_0x25e6[_0x23ad7f];return _0x25c67d;};'use strict';var emlformat=require(_0x625e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x625e('0x1'));var jsonpatch=require(_0x625e('0x2'));var rp=require(_0x625e('0x3'));var moment=require(_0x625e('0x4'));var BPromise=require(_0x625e('0x5'));var Mustache=require(_0x625e('0x6'));var util=require(_0x625e('0x7'));var path=require('path');var sox=require(_0x625e('0x8'));var csv=require(_0x625e('0x9'));var ejs=require(_0x625e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x625e('0xb'));var squel=require(_0x625e('0xc'));var crypto=require(_0x625e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x625e('0xe'));var toCsv=require(_0x625e('0x9'));var querystring=require(_0x625e('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x625e('0x10'));var qs=require(_0x625e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x625e('0x12'));var logger=require(_0x625e('0x13'))(_0x625e('0x14'));var utils=require('../../config/utils');var config=require(_0x625e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x625e('0x16'))['db'];function respondWithStatusCode(_0xa9ec9b,_0x3f598f){_0x3f598f=_0x3f598f||0xcc;return function(_0x535a38){if(_0x535a38){return _0xa9ec9b[_0x625e('0x17')](_0x3f598f);}return _0xa9ec9b['status'](_0x3f598f)[_0x625e('0x18')]();};}function respondWithResult(_0xe69306,_0x1ddae7){_0x1ddae7=_0x1ddae7||0xc8;return function(_0x2e57a2){if(_0x2e57a2){return _0xe69306['status'](_0x1ddae7)['json'](_0x2e57a2);}};}function respondWithFilteredResult(_0x35171d,_0x65b3da){return function(_0x57c326){if(_0x57c326){var _0x45e4b2=typeof _0x65b3da[_0x625e('0x19')]===_0x625e('0x1a')&&typeof _0x65b3da[_0x625e('0x1b')]===_0x625e('0x1a');var _0x10f307=_0x57c326[_0x625e('0x1c')];var _0x5b607b=_0x45e4b2?0x0:_0x65b3da['offset'];var _0x7d4acd=_0x45e4b2?_0x57c326[_0x625e('0x1c')]:_0x65b3da[_0x625e('0x19')]+_0x65b3da[_0x625e('0x1b')];var _0x38129c;if(_0x7d4acd>=_0x10f307){_0x7d4acd=_0x10f307;_0x38129c=0xc8;}else{_0x38129c=0xce;}_0x35171d[_0x625e('0x1d')](_0x38129c);return _0x35171d[_0x625e('0x1e')](_0x625e('0x1f'),_0x5b607b+'-'+_0x7d4acd+'/'+_0x10f307)[_0x625e('0x20')](_0x57c326);}return null;};}function patchUpdates(_0x3e3dec){return function(_0x1c3a8e){try{jsonpatch[_0x625e('0x21')](_0x1c3a8e,_0x3e3dec,!![]);}catch(_0x545000){return BPromise[_0x625e('0x22')](_0x545000);}return _0x1c3a8e[_0x625e('0x23')]();};}function saveUpdates(_0x269f4d,_0x27aadf){return function(_0x5e1648){if(_0x5e1648){return _0x5e1648[_0x625e('0x24')](_0x269f4d)['then'](function(_0x4baad6){return _0x4baad6;});}return null;};}function removeEntity(_0x53ae15,_0x1c1eb3){return function(_0x356140){if(_0x356140){return _0x356140[_0x625e('0x25')]()['then'](function(){_0x53ae15[_0x625e('0x1d')](0xcc)[_0x625e('0x18')]();});}};}function handleEntityNotFound(_0x3edc5e,_0x9198d8){return function(_0x3eb3ea){if(!_0x3eb3ea){_0x3edc5e[_0x625e('0x17')](0x194);}return _0x3eb3ea;};}function handleError(_0x228a18,_0x167dbb){_0x167dbb=_0x167dbb||0x1f4;return function(_0x5899a2){logger[_0x625e('0x26')](_0x5899a2[_0x625e('0x27')]);if(_0x5899a2['name']){delete _0x5899a2[_0x625e('0x28')];}_0x228a18['status'](_0x167dbb)[_0x625e('0x29')](_0x5899a2);};}exports[_0x625e('0x2a')]=function(_0x206f06,_0x5b2b1c){var _0xbfdd75={},_0x10c360={},_0x3aab54={'count':0x0,'rows':[]};var _0x61606d=_[_0x625e('0x2b')](db[_0x625e('0x2c')][_0x625e('0x2d')],function(_0x41e749){return{'name':_0x41e749[_0x625e('0x2e')],'type':_0x41e749[_0x625e('0x2f')]['key']};});_0x10c360[_0x625e('0x30')]=_[_0x625e('0x2b')](_0x61606d,_0x625e('0x28'));_0x10c360[_0x625e('0x31')]=_[_0x625e('0x32')](_0x206f06[_0x625e('0x31')]);_0x10c360[_0x625e('0x33')]=_['intersection'](_0x10c360['model'],_0x10c360[_0x625e('0x31')]);_0xbfdd75['attributes']=_[_0x625e('0x34')](_0x10c360[_0x625e('0x30')],qs[_0x625e('0x35')](_0x206f06[_0x625e('0x31')][_0x625e('0x35')]));_0xbfdd75[_0x625e('0x36')]=_0xbfdd75['attributes']['length']?_0xbfdd75[_0x625e('0x36')]:_0x10c360['model'];if(!_0x206f06[_0x625e('0x31')][_0x625e('0x37')](_0x625e('0x38'))){_0xbfdd75['limit']=qs[_0x625e('0x1b')](_0x206f06[_0x625e('0x31')][_0x625e('0x1b')]);_0xbfdd75[_0x625e('0x19')]=qs[_0x625e('0x19')](_0x206f06['query'][_0x625e('0x19')]);}_0xbfdd75[_0x625e('0x39')]=qs[_0x625e('0x3a')](_0x206f06[_0x625e('0x31')]['sort']);_0xbfdd75['where']=qs['filters'](_[_0x625e('0x3b')](_0x206f06[_0x625e('0x31')],_0x10c360['filters']),_0x61606d);if(_0x206f06[_0x625e('0x31')][_0x625e('0x3c')]){_0xbfdd75[_0x625e('0x3d')]=_[_0x625e('0x3e')](_0xbfdd75[_0x625e('0x3d')],{'$or':_[_0x625e('0x2b')](_0x61606d,function(_0x383185){if(_0x383185[_0x625e('0x2f')]!==_0x625e('0x3f')){var _0x2d0aac={};_0x2d0aac[_0x383185[_0x625e('0x28')]]={'$like':'%'+_0x206f06[_0x625e('0x31')][_0x625e('0x3c')]+'%'};return _0x2d0aac;}})});}_0xbfdd75=_[_0x625e('0x3e')]({},_0xbfdd75,_0x206f06['options']);var _0x3d8a7c={'where':_0xbfdd75[_0x625e('0x3d')]};return db[_0x625e('0x2c')][_0x625e('0x1c')](_0x3d8a7c)[_0x625e('0x40')](function(_0x589af3){_0x3aab54['count']=_0x589af3;if(_0x206f06[_0x625e('0x31')][_0x625e('0x41')]){_0xbfdd75['include']=[{'all':!![]}];}return db['DeskConfiguration'][_0x625e('0x42')](_0xbfdd75);})[_0x625e('0x40')](function(_0x3ad6d7){_0x3aab54[_0x625e('0x43')]=_0x3ad6d7;return _0x3aab54;})[_0x625e('0x40')](respondWithFilteredResult(_0x5b2b1c,_0xbfdd75))[_0x625e('0x44')](handleError(_0x5b2b1c,null));};exports[_0x625e('0x45')]=function(_0x370e27,_0x40eda0){var _0x4de91d={'raw':![],'where':{'id':_0x370e27['params']['id']}},_0x274fea={};_0x274fea[_0x625e('0x30')]=_[_0x625e('0x32')](db['DeskConfiguration'][_0x625e('0x2d')]);_0x274fea['query']=_[_0x625e('0x32')](_0x370e27[_0x625e('0x31')]);_0x274fea[_0x625e('0x33')]=_['intersection'](_0x274fea[_0x625e('0x30')],_0x274fea[_0x625e('0x31')]);_0x4de91d[_0x625e('0x36')]=_['intersection'](_0x274fea[_0x625e('0x30')],qs[_0x625e('0x35')](_0x370e27['query'][_0x625e('0x35')]));_0x4de91d[_0x625e('0x36')]=_0x4de91d['attributes']['length']?_0x4de91d[_0x625e('0x36')]:_0x274fea[_0x625e('0x30')];if(_0x370e27[_0x625e('0x31')][_0x625e('0x41')]){_0x4de91d[_0x625e('0x46')]=[{'all':!![]}];}_0x4de91d=_[_0x625e('0x3e')]({},_0x4de91d,_0x370e27[_0x625e('0x47')]);return db[_0x625e('0x2c')]['find'](_0x4de91d)['then'](handleEntityNotFound(_0x40eda0,null))[_0x625e('0x40')](respondWithResult(_0x40eda0,null))[_0x625e('0x44')](handleError(_0x40eda0,null));};exports[_0x625e('0x48')]=function(_0x10b9ff,_0xb4726d){return db[_0x625e('0x2c')][_0x625e('0x48')](_0x10b9ff['body'],{})[_0x625e('0x40')](respondWithResult(_0xb4726d,0xc9))[_0x625e('0x44')](handleError(_0xb4726d,null));};exports['update']=function(_0x4483e7,_0x4539a1){if(_0x4483e7['body']['id']){delete _0x4483e7[_0x625e('0x49')]['id'];}return db[_0x625e('0x2c')][_0x625e('0x4a')]({'where':{'id':_0x4483e7[_0x625e('0x4b')]['id']}})[_0x625e('0x40')](handleEntityNotFound(_0x4539a1,null))['then'](saveUpdates(_0x4483e7[_0x625e('0x49')],null))[_0x625e('0x40')](respondWithResult(_0x4539a1,null))[_0x625e('0x44')](handleError(_0x4539a1,null));};exports[_0x625e('0x25')]=function(_0xf7e7ae,_0xd219ae){return db[_0x625e('0x2c')][_0x625e('0x4a')]({'where':{'id':_0xf7e7ae[_0x625e('0x4b')]['id']}})[_0x625e('0x40')](handleEntityNotFound(_0xd219ae,null))[_0x625e('0x40')](removeEntity(_0xd219ae,null))[_0x625e('0x44')](handleError(_0xd219ae,null));};exports[_0x625e('0x4c')]=function(_0x8da3da,_0x67f059,_0x11132d){var _0x2c7836={};var _0x3c0567={};var _0x50ff0a;var _0x36644c;return db[_0x625e('0x2c')][_0x625e('0x4d')]({'where':{'id':_0x8da3da['params']['id']}})[_0x625e('0x40')](handleEntityNotFound(_0x67f059,null))[_0x625e('0x40')](function(_0x5eb63f){if(_0x5eb63f){_0x50ff0a=_0x5eb63f;_0x3c0567[_0x625e('0x30')]=_['keys'](db[_0x625e('0x4e')][_0x625e('0x2d')]);_0x3c0567[_0x625e('0x31')]=_[_0x625e('0x32')](_0x8da3da[_0x625e('0x31')]);_0x3c0567[_0x625e('0x33')]=_[_0x625e('0x34')](_0x3c0567[_0x625e('0x30')],_0x3c0567['query']);_0x2c7836[_0x625e('0x36')]=_['intersection'](_0x3c0567[_0x625e('0x30')],qs[_0x625e('0x35')](_0x8da3da['query']['fields']));_0x2c7836[_0x625e('0x36')]=_0x2c7836[_0x625e('0x36')][_0x625e('0x4f')]?_0x2c7836[_0x625e('0x36')]:_0x3c0567['model'];_0x2c7836[_0x625e('0x39')]=qs[_0x625e('0x3a')](_0x8da3da[_0x625e('0x31')]['sort']);_0x2c7836[_0x625e('0x3d')]=qs[_0x625e('0x33')](_[_0x625e('0x3b')](_0x8da3da[_0x625e('0x31')],_0x3c0567[_0x625e('0x33')]));if(_0x8da3da[_0x625e('0x31')][_0x625e('0x3c')]){_0x2c7836[_0x625e('0x3d')]=_[_0x625e('0x3e')](_0x2c7836[_0x625e('0x3d')],{'$or':_[_0x625e('0x2b')](_0x2c7836[_0x625e('0x36')],function(_0x5d80bc){var _0x2b2400={};_0x2b2400[_0x5d80bc]={'$like':'%'+_0x8da3da['query']['filter']+'%'};return _0x2b2400;})});}_0x2c7836=_[_0x625e('0x3e')]({},_0x2c7836,_0x8da3da['options']);return _0x50ff0a['getFields'](_0x2c7836);}})[_0x625e('0x40')](function(_0x677a76){if(_0x677a76){_0x36644c=_0x677a76[_0x625e('0x4f')];if(!_0x8da3da['query'][_0x625e('0x37')](_0x625e('0x38'))){_0x2c7836[_0x625e('0x1b')]=qs[_0x625e('0x1b')](_0x8da3da[_0x625e('0x31')][_0x625e('0x1b')]);_0x2c7836[_0x625e('0x19')]=qs[_0x625e('0x19')](_0x8da3da[_0x625e('0x31')][_0x625e('0x19')]);}return _0x50ff0a['getFields'](_0x2c7836);}})['then'](function(_0x41fe81){if(_0x41fe81){return _0x41fe81?{'count':_0x36644c,'rows':_0x41fe81}:null;}})[_0x625e('0x40')](respondWithResult(_0x67f059,null))[_0x625e('0x44')](handleError(_0x67f059,null));};exports['getSubjects']=function(_0x2ac1a3,_0x26c5b0,_0x48b8d7){var _0x5dc2ca={};var _0x377d9a={};var _0x19cb4a;var _0x4733dd;return db[_0x625e('0x2c')]['findOne']({'where':{'id':_0x2ac1a3[_0x625e('0x4b')]['id']}})[_0x625e('0x40')](handleEntityNotFound(_0x26c5b0,null))[_0x625e('0x40')](function(_0x17a07b){if(_0x17a07b){_0x19cb4a=_0x17a07b;_0x377d9a[_0x625e('0x30')]=_[_0x625e('0x32')](db[_0x625e('0x4e')][_0x625e('0x2d')]);_0x377d9a['query']=_[_0x625e('0x32')](_0x2ac1a3[_0x625e('0x31')]);_0x377d9a[_0x625e('0x33')]=_[_0x625e('0x34')](_0x377d9a['model'],_0x377d9a[_0x625e('0x31')]);_0x5dc2ca[_0x625e('0x36')]=_[_0x625e('0x34')](_0x377d9a[_0x625e('0x30')],qs[_0x625e('0x35')](_0x2ac1a3[_0x625e('0x31')][_0x625e('0x35')]));_0x5dc2ca[_0x625e('0x36')]=_0x5dc2ca[_0x625e('0x36')][_0x625e('0x4f')]?_0x5dc2ca[_0x625e('0x36')]:_0x377d9a[_0x625e('0x30')];_0x5dc2ca[_0x625e('0x39')]=qs[_0x625e('0x3a')](_0x2ac1a3[_0x625e('0x31')][_0x625e('0x3a')]);_0x5dc2ca[_0x625e('0x3d')]=qs[_0x625e('0x33')](_[_0x625e('0x3b')](_0x2ac1a3[_0x625e('0x31')],_0x377d9a[_0x625e('0x33')]));if(_0x2ac1a3[_0x625e('0x31')][_0x625e('0x3c')]){_0x5dc2ca[_0x625e('0x3d')]=_['merge'](_0x5dc2ca[_0x625e('0x3d')],{'$or':_[_0x625e('0x2b')](_0x5dc2ca[_0x625e('0x36')],function(_0x346b28){var _0x3be1b8={};_0x3be1b8[_0x346b28]={'$like':'%'+_0x2ac1a3[_0x625e('0x31')][_0x625e('0x3c')]+'%'};return _0x3be1b8;})});}_0x5dc2ca=_['merge']({},_0x5dc2ca,_0x2ac1a3[_0x625e('0x47')]);return _0x19cb4a[_0x625e('0x50')](_0x5dc2ca);}})[_0x625e('0x40')](function(_0x3dc3d8){if(_0x3dc3d8){_0x4733dd=_0x3dc3d8['length'];if(!_0x2ac1a3[_0x625e('0x31')][_0x625e('0x37')]('nolimit')){_0x5dc2ca[_0x625e('0x1b')]=qs[_0x625e('0x1b')](_0x2ac1a3['query'][_0x625e('0x1b')]);_0x5dc2ca['offset']=qs[_0x625e('0x19')](_0x2ac1a3[_0x625e('0x31')][_0x625e('0x19')]);}return _0x19cb4a[_0x625e('0x50')](_0x5dc2ca);}})[_0x625e('0x40')](function(_0x3aa0fa){if(_0x3aa0fa){return _0x3aa0fa?{'count':_0x4733dd,'rows':_0x3aa0fa}:null;}})[_0x625e('0x40')](respondWithResult(_0x26c5b0,null))['catch'](handleError(_0x26c5b0,null));};exports[_0x625e('0x51')]=function(_0x53b8c5,_0x3563ef,_0x983f7f){var _0x3c046b={};var _0x49d768={};var _0x5359b1;var _0x263572;return db['DeskConfiguration'][_0x625e('0x4d')]({'where':{'id':_0x53b8c5['params']['id']}})[_0x625e('0x40')](handleEntityNotFound(_0x3563ef,null))[_0x625e('0x40')](function(_0x50752d){if(_0x50752d){_0x5359b1=_0x50752d;_0x49d768[_0x625e('0x30')]=_[_0x625e('0x32')](db[_0x625e('0x4e')][_0x625e('0x2d')]);_0x49d768[_0x625e('0x31')]=_[_0x625e('0x32')](_0x53b8c5[_0x625e('0x31')]);_0x49d768['filters']=_[_0x625e('0x34')](_0x49d768[_0x625e('0x30')],_0x49d768[_0x625e('0x31')]);_0x3c046b['attributes']=_[_0x625e('0x34')](_0x49d768[_0x625e('0x30')],qs[_0x625e('0x35')](_0x53b8c5[_0x625e('0x31')][_0x625e('0x35')]));_0x3c046b[_0x625e('0x36')]=_0x3c046b[_0x625e('0x36')][_0x625e('0x4f')]?_0x3c046b['attributes']:_0x49d768['model'];_0x3c046b[_0x625e('0x39')]=qs[_0x625e('0x3a')](_0x53b8c5['query']['sort']);_0x3c046b[_0x625e('0x3d')]=qs[_0x625e('0x33')](_['pick'](_0x53b8c5['query'],_0x49d768['filters']));if(_0x53b8c5['query'][_0x625e('0x3c')]){_0x3c046b[_0x625e('0x3d')]=_[_0x625e('0x3e')](_0x3c046b['where'],{'$or':_[_0x625e('0x2b')](_0x3c046b[_0x625e('0x36')],function(_0x40cebb){var _0xb356b6={};_0xb356b6[_0x40cebb]={'$like':'%'+_0x53b8c5[_0x625e('0x31')][_0x625e('0x3c')]+'%'};return _0xb356b6;})});}_0x3c046b=_[_0x625e('0x3e')]({},_0x3c046b,_0x53b8c5[_0x625e('0x47')]);return _0x5359b1[_0x625e('0x51')](_0x3c046b);}})[_0x625e('0x40')](function(_0x1d61a7){if(_0x1d61a7){_0x263572=_0x1d61a7[_0x625e('0x4f')];if(!_0x53b8c5['query'][_0x625e('0x37')]('nolimit')){_0x3c046b[_0x625e('0x1b')]=qs[_0x625e('0x1b')](_0x53b8c5['query'][_0x625e('0x1b')]);_0x3c046b[_0x625e('0x19')]=qs[_0x625e('0x19')](_0x53b8c5[_0x625e('0x31')][_0x625e('0x19')]);}return _0x5359b1[_0x625e('0x51')](_0x3c046b);}})[_0x625e('0x40')](function(_0x5f47ec){if(_0x5f47ec){return _0x5f47ec?{'count':_0x263572,'rows':_0x5f47ec}:null;}})['then'](respondWithResult(_0x3563ef,null))['catch'](handleError(_0x3563ef,null));};exports[_0x625e('0x52')]=function(_0x2ff065,_0x5d4a95,_0x4dcd46){var _0x26345d={};var _0x278c64={};var _0x455a3e;var _0x47fc5a;return db['DeskConfiguration'][_0x625e('0x4d')]({'where':{'id':_0x2ff065[_0x625e('0x4b')]['id']}})[_0x625e('0x40')](handleEntityNotFound(_0x5d4a95,null))[_0x625e('0x40')](function(_0x34c820){if(_0x34c820){_0x455a3e=_0x34c820;_0x278c64[_0x625e('0x30')]=_[_0x625e('0x32')](db[_0x625e('0x53')][_0x625e('0x2d')]);_0x278c64[_0x625e('0x31')]=_[_0x625e('0x32')](_0x2ff065[_0x625e('0x31')]);_0x278c64['filters']=_['intersection'](_0x278c64[_0x625e('0x30')],_0x278c64[_0x625e('0x31')]);_0x26345d[_0x625e('0x36')]=_[_0x625e('0x34')](_0x278c64[_0x625e('0x30')],qs[_0x625e('0x35')](_0x2ff065['query'][_0x625e('0x35')]));_0x26345d[_0x625e('0x36')]=_0x26345d[_0x625e('0x36')][_0x625e('0x4f')]?_0x26345d[_0x625e('0x36')]:_0x278c64[_0x625e('0x30')];_0x26345d[_0x625e('0x39')]=qs[_0x625e('0x3a')](_0x2ff065['query']['sort']);_0x26345d[_0x625e('0x3d')]=qs[_0x625e('0x33')](_[_0x625e('0x3b')](_0x2ff065[_0x625e('0x31')],_0x278c64['filters']));if(_0x2ff065[_0x625e('0x31')][_0x625e('0x3c')]){_0x26345d[_0x625e('0x3d')]=_['merge'](_0x26345d[_0x625e('0x3d')],{'$or':_[_0x625e('0x2b')](_0x26345d[_0x625e('0x36')],function(_0x48795b){var _0x3e6191={};_0x3e6191[_0x48795b]={'$like':'%'+_0x2ff065[_0x625e('0x31')][_0x625e('0x3c')]+'%'};return _0x3e6191;})});}_0x26345d=_[_0x625e('0x3e')]({},_0x26345d,_0x2ff065['options']);return _0x455a3e[_0x625e('0x52')](_0x26345d);}})['then'](function(_0x3091c4){if(_0x3091c4){_0x47fc5a=_0x3091c4['length'];if(!_0x2ff065[_0x625e('0x31')][_0x625e('0x37')]('nolimit')){_0x26345d[_0x625e('0x1b')]=qs[_0x625e('0x1b')](_0x2ff065[_0x625e('0x31')][_0x625e('0x1b')]);_0x26345d[_0x625e('0x19')]=qs[_0x625e('0x19')](_0x2ff065[_0x625e('0x31')][_0x625e('0x19')]);}return _0x455a3e[_0x625e('0x52')](_0x26345d);}})[_0x625e('0x40')](function(_0x28eb58){if(_0x28eb58){return _0x28eb58?{'count':_0x47fc5a,'rows':_0x28eb58}:null;}})[_0x625e('0x40')](respondWithResult(_0x5d4a95,null))[_0x625e('0x44')](handleError(_0x5d4a95,null));};exports[_0x625e('0x54')]=function(_0x4b73fa,_0x4f4067,_0x1c1e1d){if(_0x4b73fa['body']['id']){delete _0x4b73fa[_0x625e('0x49')]['id'];}return db[_0x625e('0x2c')]['findOne']({'where':{'id':_0x4b73fa['params']['id']}})[_0x625e('0x40')](handleEntityNotFound(_0x4f4067,null))[_0x625e('0x40')](function(_0x2546a9){if(_0x2546a9){return _0x2546a9[_0x625e('0x54')](_0x4b73fa[_0x625e('0x49')][_0x625e('0x55')]||[]);}return null;})[_0x625e('0x40')](respondWithResult(_0x4f4067,null))[_0x625e('0x44')](handleError(_0x4f4067,null));}; \ No newline at end of file +var _0x014a=['catch','show','params','includeAll','find','create','body','getFields','findOne','DeskField','rawAttributes','getSubjects','nolimit','getDescriptions','getTags','Tag','setTags','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','name','send','index','DeskConfiguration','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll'];(function(_0x352508,_0x5b8982){var _0x3de275=function(_0x596a09){while(--_0x596a09){_0x352508['push'](_0x352508['shift']());}};_0x3de275(++_0x5b8982);}(_0x014a,0x151));var _0xa014=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x014a[_0x40ac5e];return _0x2839d6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa014('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa014('0x1'));var rp=require(_0xa014('0x2'));var moment=require(_0xa014('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa014('0x4'));var util=require(_0xa014('0x5'));var path=require(_0xa014('0x6'));var sox=require(_0xa014('0x7'));var csv=require('to-csv');var ejs=require(_0xa014('0x8'));var fs=require('fs');var fs_extra=require(_0xa014('0x9'));var _=require(_0xa014('0xa'));var squel=require(_0xa014('0xb'));var crypto=require('crypto');var jsforce=require(_0xa014('0xc'));var deskjs=require(_0xa014('0xd'));var toCsv=require(_0xa014('0xe'));var querystring=require(_0xa014('0xf'));var Papa=require(_0xa014('0x10'));var Redis=require(_0xa014('0x11'));var authService=require(_0xa014('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa014('0x13'));var hardwareService=require(_0xa014('0x14'));var logger=require(_0xa014('0x15'))(_0xa014('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa014('0x17'));var db=require(_0xa014('0x18'))['db'];function respondWithStatusCode(_0x12e3fd,_0x2b8fa9){_0x2b8fa9=_0x2b8fa9||0xcc;return function(_0x1bfaf6){if(_0x1bfaf6){return _0x12e3fd['sendStatus'](_0x2b8fa9);}return _0x12e3fd[_0xa014('0x19')](_0x2b8fa9)[_0xa014('0x1a')]();};}function respondWithResult(_0x2992ea,_0x214c0f){_0x214c0f=_0x214c0f||0xc8;return function(_0x39ee0a){if(_0x39ee0a){return _0x2992ea['status'](_0x214c0f)[_0xa014('0x1b')](_0x39ee0a);}};}function respondWithFilteredResult(_0x3e8161,_0x3825cd){return function(_0x109d81){if(_0x109d81){var _0xa3389a=typeof _0x3825cd[_0xa014('0x1c')]===_0xa014('0x1d')&&typeof _0x3825cd['limit']===_0xa014('0x1d');var _0x239800=_0x109d81[_0xa014('0x1e')];var _0x443b8c=_0xa3389a?0x0:_0x3825cd['offset'];var _0x4d4592=_0xa3389a?_0x109d81[_0xa014('0x1e')]:_0x3825cd['offset']+_0x3825cd[_0xa014('0x1f')];var _0x22f1b5;if(_0x4d4592>=_0x239800){_0x4d4592=_0x239800;_0x22f1b5=0xc8;}else{_0x22f1b5=0xce;}_0x3e8161[_0xa014('0x19')](_0x22f1b5);return _0x3e8161[_0xa014('0x20')]('Content-Range',_0x443b8c+'-'+_0x4d4592+'/'+_0x239800)[_0xa014('0x1b')](_0x109d81);}return null;};}function patchUpdates(_0x800bd1){return function(_0x421607){try{jsonpatch['apply'](_0x421607,_0x800bd1,!![]);}catch(_0xc9091c){return BPromise[_0xa014('0x21')](_0xc9091c);}return _0x421607[_0xa014('0x22')]();};}function saveUpdates(_0x45b453,_0x13790e){return function(_0x5b6e05){if(_0x5b6e05){return _0x5b6e05[_0xa014('0x23')](_0x45b453)[_0xa014('0x24')](function(_0x1188b8){return _0x1188b8;});}return null;};}function removeEntity(_0x367067,_0xeb157e){return function(_0x6e4816){if(_0x6e4816){return _0x6e4816['destroy']()['then'](function(){_0x367067['status'](0xcc)[_0xa014('0x1a')]();});}};}function handleEntityNotFound(_0x5b7c2f,_0x492db5){return function(_0x383af2){if(!_0x383af2){_0x5b7c2f['sendStatus'](0x194);}return _0x383af2;};}function handleError(_0x5c4b79,_0x2b5c89){_0x2b5c89=_0x2b5c89||0x1f4;return function(_0x11f0ea){logger['error'](_0x11f0ea['stack']);if(_0x11f0ea[_0xa014('0x25')]){delete _0x11f0ea[_0xa014('0x25')];}_0x5c4b79[_0xa014('0x19')](_0x2b5c89)[_0xa014('0x26')](_0x11f0ea);};}exports[_0xa014('0x27')]=function(_0xaefa5e,_0x477dd2){var _0x1d2acd={},_0x43e4af={},_0x2a2761={'count':0x0,'rows':[]};var _0x381ed4=_['map'](db[_0xa014('0x28')]['rawAttributes'],function(_0x50b975){return{'name':_0x50b975['fieldName'],'type':_0x50b975[_0xa014('0x29')][_0xa014('0x2a')]};});_0x43e4af[_0xa014('0x2b')]=_[_0xa014('0x2c')](_0x381ed4,_0xa014('0x25'));_0x43e4af['query']=_[_0xa014('0x2d')](_0xaefa5e[_0xa014('0x2e')]);_0x43e4af['filters']=_[_0xa014('0x2f')](_0x43e4af['model'],_0x43e4af[_0xa014('0x2e')]);_0x1d2acd[_0xa014('0x30')]=_[_0xa014('0x2f')](_0x43e4af['model'],qs[_0xa014('0x31')](_0xaefa5e[_0xa014('0x2e')]['fields']));_0x1d2acd[_0xa014('0x30')]=_0x1d2acd[_0xa014('0x30')][_0xa014('0x32')]?_0x1d2acd[_0xa014('0x30')]:_0x43e4af[_0xa014('0x2b')];if(!_0xaefa5e[_0xa014('0x2e')][_0xa014('0x33')]('nolimit')){_0x1d2acd['limit']=qs[_0xa014('0x1f')](_0xaefa5e[_0xa014('0x2e')][_0xa014('0x1f')]);_0x1d2acd[_0xa014('0x1c')]=qs[_0xa014('0x1c')](_0xaefa5e[_0xa014('0x2e')][_0xa014('0x1c')]);}_0x1d2acd[_0xa014('0x34')]=qs['sort'](_0xaefa5e['query'][_0xa014('0x35')]);_0x1d2acd[_0xa014('0x36')]=qs[_0xa014('0x37')](_[_0xa014('0x38')](_0xaefa5e[_0xa014('0x2e')],_0x43e4af[_0xa014('0x37')]),_0x381ed4);if(_0xaefa5e[_0xa014('0x2e')][_0xa014('0x39')]){_0x1d2acd[_0xa014('0x36')]=_[_0xa014('0x3a')](_0x1d2acd[_0xa014('0x36')],{'$or':_[_0xa014('0x2c')](_0x381ed4,function(_0x4aec8f){if(_0x4aec8f[_0xa014('0x29')]!==_0xa014('0x3b')){var _0x27b5e6={};_0x27b5e6[_0x4aec8f[_0xa014('0x25')]]={'$like':'%'+_0xaefa5e['query'][_0xa014('0x39')]+'%'};return _0x27b5e6;}})});}_0x1d2acd=_['merge']({},_0x1d2acd,_0xaefa5e[_0xa014('0x3c')]);var _0x562d85={'where':_0x1d2acd[_0xa014('0x36')]};return db['DeskConfiguration'][_0xa014('0x1e')](_0x562d85)[_0xa014('0x24')](function(_0x2dba86){_0x2a2761[_0xa014('0x1e')]=_0x2dba86;if(_0xaefa5e[_0xa014('0x2e')]['includeAll']){_0x1d2acd[_0xa014('0x3d')]=[{'all':!![]}];}return db[_0xa014('0x28')][_0xa014('0x3e')](_0x1d2acd);})[_0xa014('0x24')](function(_0x3f7c13){_0x2a2761['rows']=_0x3f7c13;return _0x2a2761;})['then'](respondWithFilteredResult(_0x477dd2,_0x1d2acd))[_0xa014('0x3f')](handleError(_0x477dd2,null));};exports[_0xa014('0x40')]=function(_0x26bdfa,_0x47eb3f){var _0x1d0887={'raw':![],'where':{'id':_0x26bdfa[_0xa014('0x41')]['id']}},_0x193c47={};_0x193c47['model']=_[_0xa014('0x2d')](db[_0xa014('0x28')]['rawAttributes']);_0x193c47[_0xa014('0x2e')]=_['keys'](_0x26bdfa[_0xa014('0x2e')]);_0x193c47[_0xa014('0x37')]=_[_0xa014('0x2f')](_0x193c47[_0xa014('0x2b')],_0x193c47[_0xa014('0x2e')]);_0x1d0887[_0xa014('0x30')]=_[_0xa014('0x2f')](_0x193c47[_0xa014('0x2b')],qs[_0xa014('0x31')](_0x26bdfa[_0xa014('0x2e')][_0xa014('0x31')]));_0x1d0887[_0xa014('0x30')]=_0x1d0887['attributes'][_0xa014('0x32')]?_0x1d0887[_0xa014('0x30')]:_0x193c47[_0xa014('0x2b')];if(_0x26bdfa['query'][_0xa014('0x42')]){_0x1d0887[_0xa014('0x3d')]=[{'all':!![]}];}_0x1d0887=_['merge']({},_0x1d0887,_0x26bdfa['options']);return db[_0xa014('0x28')][_0xa014('0x43')](_0x1d0887)[_0xa014('0x24')](handleEntityNotFound(_0x47eb3f,null))[_0xa014('0x24')](respondWithResult(_0x47eb3f,null))[_0xa014('0x3f')](handleError(_0x47eb3f,null));};exports['create']=function(_0x569020,_0x5b433e){return db[_0xa014('0x28')][_0xa014('0x44')](_0x569020[_0xa014('0x45')],{})[_0xa014('0x24')](respondWithResult(_0x5b433e,0xc9))['catch'](handleError(_0x5b433e,null));};exports[_0xa014('0x23')]=function(_0x422fe8,_0x4b589d){if(_0x422fe8[_0xa014('0x45')]['id']){delete _0x422fe8[_0xa014('0x45')]['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x422fe8[_0xa014('0x41')]['id']}})[_0xa014('0x24')](handleEntityNotFound(_0x4b589d,null))[_0xa014('0x24')](saveUpdates(_0x422fe8['body'],null))[_0xa014('0x24')](respondWithResult(_0x4b589d,null))[_0xa014('0x3f')](handleError(_0x4b589d,null));};exports['destroy']=function(_0x41cd74,_0x39e16b){return db[_0xa014('0x28')]['find']({'where':{'id':_0x41cd74['params']['id']}})[_0xa014('0x24')](handleEntityNotFound(_0x39e16b,null))[_0xa014('0x24')](removeEntity(_0x39e16b,null))[_0xa014('0x3f')](handleError(_0x39e16b,null));};exports[_0xa014('0x46')]=function(_0x28cc43,_0xde2a63,_0x5ed6cd){var _0x392896={};var _0x48f9d5={};var _0x551723;var _0x5068ca;return db[_0xa014('0x28')][_0xa014('0x47')]({'where':{'id':_0x28cc43['params']['id']}})[_0xa014('0x24')](handleEntityNotFound(_0xde2a63,null))['then'](function(_0x553a46){if(_0x553a46){_0x551723=_0x553a46;_0x48f9d5['model']=_[_0xa014('0x2d')](db[_0xa014('0x48')][_0xa014('0x49')]);_0x48f9d5[_0xa014('0x2e')]=_[_0xa014('0x2d')](_0x28cc43[_0xa014('0x2e')]);_0x48f9d5[_0xa014('0x37')]=_[_0xa014('0x2f')](_0x48f9d5['model'],_0x48f9d5[_0xa014('0x2e')]);_0x392896['attributes']=_[_0xa014('0x2f')](_0x48f9d5[_0xa014('0x2b')],qs[_0xa014('0x31')](_0x28cc43[_0xa014('0x2e')][_0xa014('0x31')]));_0x392896[_0xa014('0x30')]=_0x392896['attributes']['length']?_0x392896[_0xa014('0x30')]:_0x48f9d5[_0xa014('0x2b')];_0x392896[_0xa014('0x34')]=qs[_0xa014('0x35')](_0x28cc43['query'][_0xa014('0x35')]);_0x392896[_0xa014('0x36')]=qs[_0xa014('0x37')](_['pick'](_0x28cc43[_0xa014('0x2e')],_0x48f9d5[_0xa014('0x37')]));if(_0x28cc43[_0xa014('0x2e')][_0xa014('0x39')]){_0x392896['where']=_[_0xa014('0x3a')](_0x392896[_0xa014('0x36')],{'$or':_[_0xa014('0x2c')](_0x392896['attributes'],function(_0x41fa2c){var _0x170564={};_0x170564[_0x41fa2c]={'$like':'%'+_0x28cc43[_0xa014('0x2e')][_0xa014('0x39')]+'%'};return _0x170564;})});}_0x392896=_['merge']({},_0x392896,_0x28cc43['options']);return _0x551723['getFields'](_0x392896);}})[_0xa014('0x24')](function(_0x301f7b){if(_0x301f7b){_0x5068ca=_0x301f7b[_0xa014('0x32')];if(!_0x28cc43[_0xa014('0x2e')][_0xa014('0x33')]('nolimit')){_0x392896['limit']=qs[_0xa014('0x1f')](_0x28cc43[_0xa014('0x2e')]['limit']);_0x392896[_0xa014('0x1c')]=qs['offset'](_0x28cc43[_0xa014('0x2e')]['offset']);}return _0x551723[_0xa014('0x46')](_0x392896);}})[_0xa014('0x24')](function(_0x3d6a6f){if(_0x3d6a6f){return _0x3d6a6f?{'count':_0x5068ca,'rows':_0x3d6a6f}:null;}})[_0xa014('0x24')](respondWithResult(_0xde2a63,null))['catch'](handleError(_0xde2a63,null));};exports[_0xa014('0x4a')]=function(_0x20965c,_0xa5efb2,_0x23ad19){var _0x48e003={};var _0x55f326={};var _0x2b0de5;var _0x1b071;return db[_0xa014('0x28')][_0xa014('0x47')]({'where':{'id':_0x20965c[_0xa014('0x41')]['id']}})[_0xa014('0x24')](handleEntityNotFound(_0xa5efb2,null))[_0xa014('0x24')](function(_0x438e79){if(_0x438e79){_0x2b0de5=_0x438e79;_0x55f326['model']=_[_0xa014('0x2d')](db[_0xa014('0x48')][_0xa014('0x49')]);_0x55f326[_0xa014('0x2e')]=_[_0xa014('0x2d')](_0x20965c['query']);_0x55f326[_0xa014('0x37')]=_[_0xa014('0x2f')](_0x55f326['model'],_0x55f326[_0xa014('0x2e')]);_0x48e003[_0xa014('0x30')]=_[_0xa014('0x2f')](_0x55f326['model'],qs['fields'](_0x20965c[_0xa014('0x2e')][_0xa014('0x31')]));_0x48e003[_0xa014('0x30')]=_0x48e003[_0xa014('0x30')]['length']?_0x48e003[_0xa014('0x30')]:_0x55f326[_0xa014('0x2b')];_0x48e003['order']=qs[_0xa014('0x35')](_0x20965c[_0xa014('0x2e')]['sort']);_0x48e003[_0xa014('0x36')]=qs[_0xa014('0x37')](_[_0xa014('0x38')](_0x20965c['query'],_0x55f326['filters']));if(_0x20965c['query']['filter']){_0x48e003[_0xa014('0x36')]=_['merge'](_0x48e003[_0xa014('0x36')],{'$or':_[_0xa014('0x2c')](_0x48e003[_0xa014('0x30')],function(_0x3fbc75){var _0x378c00={};_0x378c00[_0x3fbc75]={'$like':'%'+_0x20965c[_0xa014('0x2e')][_0xa014('0x39')]+'%'};return _0x378c00;})});}_0x48e003=_[_0xa014('0x3a')]({},_0x48e003,_0x20965c[_0xa014('0x3c')]);return _0x2b0de5[_0xa014('0x4a')](_0x48e003);}})['then'](function(_0xd8374c){if(_0xd8374c){_0x1b071=_0xd8374c['length'];if(!_0x20965c[_0xa014('0x2e')][_0xa014('0x33')](_0xa014('0x4b'))){_0x48e003[_0xa014('0x1f')]=qs['limit'](_0x20965c[_0xa014('0x2e')][_0xa014('0x1f')]);_0x48e003['offset']=qs[_0xa014('0x1c')](_0x20965c['query']['offset']);}return _0x2b0de5[_0xa014('0x4a')](_0x48e003);}})[_0xa014('0x24')](function(_0x335f08){if(_0x335f08){return _0x335f08?{'count':_0x1b071,'rows':_0x335f08}:null;}})['then'](respondWithResult(_0xa5efb2,null))[_0xa014('0x3f')](handleError(_0xa5efb2,null));};exports[_0xa014('0x4c')]=function(_0x1ed05e,_0x3497ea,_0x249804){var _0x34f25c={};var _0x55cb6f={};var _0x10cf8f;var _0xfa8f0;return db[_0xa014('0x28')][_0xa014('0x47')]({'where':{'id':_0x1ed05e[_0xa014('0x41')]['id']}})[_0xa014('0x24')](handleEntityNotFound(_0x3497ea,null))['then'](function(_0x332543){if(_0x332543){_0x10cf8f=_0x332543;_0x55cb6f['model']=_['keys'](db[_0xa014('0x48')][_0xa014('0x49')]);_0x55cb6f[_0xa014('0x2e')]=_[_0xa014('0x2d')](_0x1ed05e[_0xa014('0x2e')]);_0x55cb6f[_0xa014('0x37')]=_[_0xa014('0x2f')](_0x55cb6f[_0xa014('0x2b')],_0x55cb6f[_0xa014('0x2e')]);_0x34f25c[_0xa014('0x30')]=_[_0xa014('0x2f')](_0x55cb6f[_0xa014('0x2b')],qs[_0xa014('0x31')](_0x1ed05e['query']['fields']));_0x34f25c['attributes']=_0x34f25c[_0xa014('0x30')][_0xa014('0x32')]?_0x34f25c['attributes']:_0x55cb6f['model'];_0x34f25c['order']=qs[_0xa014('0x35')](_0x1ed05e[_0xa014('0x2e')]['sort']);_0x34f25c[_0xa014('0x36')]=qs[_0xa014('0x37')](_[_0xa014('0x38')](_0x1ed05e[_0xa014('0x2e')],_0x55cb6f[_0xa014('0x37')]));if(_0x1ed05e[_0xa014('0x2e')][_0xa014('0x39')]){_0x34f25c['where']=_['merge'](_0x34f25c[_0xa014('0x36')],{'$or':_[_0xa014('0x2c')](_0x34f25c[_0xa014('0x30')],function(_0x138a98){var _0x1d2490={};_0x1d2490[_0x138a98]={'$like':'%'+_0x1ed05e['query']['filter']+'%'};return _0x1d2490;})});}_0x34f25c=_[_0xa014('0x3a')]({},_0x34f25c,_0x1ed05e[_0xa014('0x3c')]);return _0x10cf8f[_0xa014('0x4c')](_0x34f25c);}})[_0xa014('0x24')](function(_0x57a8b9){if(_0x57a8b9){_0xfa8f0=_0x57a8b9['length'];if(!_0x1ed05e['query'][_0xa014('0x33')](_0xa014('0x4b'))){_0x34f25c['limit']=qs['limit'](_0x1ed05e[_0xa014('0x2e')][_0xa014('0x1f')]);_0x34f25c[_0xa014('0x1c')]=qs[_0xa014('0x1c')](_0x1ed05e[_0xa014('0x2e')][_0xa014('0x1c')]);}return _0x10cf8f['getDescriptions'](_0x34f25c);}})[_0xa014('0x24')](function(_0x65130f){if(_0x65130f){return _0x65130f?{'count':_0xfa8f0,'rows':_0x65130f}:null;}})[_0xa014('0x24')](respondWithResult(_0x3497ea,null))[_0xa014('0x3f')](handleError(_0x3497ea,null));};exports[_0xa014('0x4d')]=function(_0x189f89,_0x41a980,_0x15ebcf){var _0x2dc183={};var _0x1660af={};var _0x2e3a10;var _0x5796d0;return db[_0xa014('0x28')][_0xa014('0x47')]({'where':{'id':_0x189f89[_0xa014('0x41')]['id']}})[_0xa014('0x24')](handleEntityNotFound(_0x41a980,null))[_0xa014('0x24')](function(_0x102785){if(_0x102785){_0x2e3a10=_0x102785;_0x1660af['model']=_[_0xa014('0x2d')](db[_0xa014('0x4e')][_0xa014('0x49')]);_0x1660af[_0xa014('0x2e')]=_[_0xa014('0x2d')](_0x189f89[_0xa014('0x2e')]);_0x1660af['filters']=_[_0xa014('0x2f')](_0x1660af['model'],_0x1660af[_0xa014('0x2e')]);_0x2dc183['attributes']=_['intersection'](_0x1660af['model'],qs['fields'](_0x189f89['query'][_0xa014('0x31')]));_0x2dc183[_0xa014('0x30')]=_0x2dc183[_0xa014('0x30')][_0xa014('0x32')]?_0x2dc183[_0xa014('0x30')]:_0x1660af['model'];_0x2dc183[_0xa014('0x34')]=qs[_0xa014('0x35')](_0x189f89[_0xa014('0x2e')][_0xa014('0x35')]);_0x2dc183[_0xa014('0x36')]=qs['filters'](_['pick'](_0x189f89['query'],_0x1660af[_0xa014('0x37')]));if(_0x189f89[_0xa014('0x2e')][_0xa014('0x39')]){_0x2dc183[_0xa014('0x36')]=_['merge'](_0x2dc183[_0xa014('0x36')],{'$or':_[_0xa014('0x2c')](_0x2dc183['attributes'],function(_0x883dfd){var _0x360e62={};_0x360e62[_0x883dfd]={'$like':'%'+_0x189f89[_0xa014('0x2e')]['filter']+'%'};return _0x360e62;})});}_0x2dc183=_[_0xa014('0x3a')]({},_0x2dc183,_0x189f89[_0xa014('0x3c')]);return _0x2e3a10['getTags'](_0x2dc183);}})[_0xa014('0x24')](function(_0x1c8c48){if(_0x1c8c48){_0x5796d0=_0x1c8c48[_0xa014('0x32')];if(!_0x189f89[_0xa014('0x2e')]['hasOwnProperty'](_0xa014('0x4b'))){_0x2dc183[_0xa014('0x1f')]=qs[_0xa014('0x1f')](_0x189f89[_0xa014('0x2e')][_0xa014('0x1f')]);_0x2dc183[_0xa014('0x1c')]=qs[_0xa014('0x1c')](_0x189f89['query'][_0xa014('0x1c')]);}return _0x2e3a10[_0xa014('0x4d')](_0x2dc183);}})[_0xa014('0x24')](function(_0x587980){if(_0x587980){return _0x587980?{'count':_0x5796d0,'rows':_0x587980}:null;}})[_0xa014('0x24')](respondWithResult(_0x41a980,null))[_0xa014('0x3f')](handleError(_0x41a980,null));};exports[_0xa014('0x4f')]=function(_0x155b6,_0x2dcb1c,_0x685488){if(_0x155b6[_0xa014('0x45')]['id']){delete _0x155b6[_0xa014('0x45')]['id'];}return db[_0xa014('0x28')][_0xa014('0x47')]({'where':{'id':_0x155b6[_0xa014('0x41')]['id']}})[_0xa014('0x24')](handleEntityNotFound(_0x2dcb1c,null))[_0xa014('0x24')](function(_0x9c2982){if(_0x9c2982){return _0x9c2982[_0xa014('0x4f')](_0x155b6[_0xa014('0x45')]['ids']||[]);}return null;})['then'](respondWithResult(_0x2dcb1c,null))['catch'](handleError(_0x2dcb1c,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 25004dd..305ab11 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 _0x4bdc=['./intDeskConfiguration.attributes','define','DeskConfiguration','int_desk_configurations','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5517c0,_0x358609){var _0x33803b=function(_0x513c18){while(--_0x513c18){_0x5517c0['push'](_0x5517c0['shift']());}};_0x33803b(++_0x358609);}(_0x4bdc,0x100));var _0xc4bd=function(_0x296a8c,_0x59b86c){_0x296a8c=_0x296a8c-0x0;var _0x2eaa55=_0x4bdc[_0x296a8c];return _0x2eaa55;};'use strict';var _=require('lodash');var util=require(_0xc4bd('0x0'));var logger=require(_0xc4bd('0x1'))('api');var moment=require(_0xc4bd('0x2'));var BPromise=require(_0xc4bd('0x3'));var rp=require(_0xc4bd('0x4'));var fs=require('fs');var path=require(_0xc4bd('0x5'));var rimraf=require(_0xc4bd('0x6'));var config=require(_0xc4bd('0x7'));var attributes=require(_0xc4bd('0x8'));module['exports']=function(_0x445721,_0x4cdb8b){return _0x445721[_0xc4bd('0x9')](_0xc4bd('0xa'),attributes,{'tableName':_0xc4bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d25=['../../config/logger','moment','bluebird','request-promise','rimraf','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util'];(function(_0x1f4d0f,_0x596b2f){var _0x4e0a9e=function(_0x2a49f7){while(--_0x2a49f7){_0x1f4d0f['push'](_0x1f4d0f['shift']());}};_0x4e0a9e(++_0x596b2f);}(_0x5d25,0x8e));var _0x55d2=function(_0x38944a,_0x51e659){_0x38944a=_0x38944a-0x0;var _0x46528f=_0x5d25[_0x38944a];return _0x46528f;};'use strict';var _=require(_0x55d2('0x0'));var util=require(_0x55d2('0x1'));var logger=require(_0x55d2('0x2'))('api');var moment=require(_0x55d2('0x3'));var BPromise=require(_0x55d2('0x4'));var rp=require(_0x55d2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x55d2('0x6'));var config=require('../../config/environment');var attributes=require(_0x55d2('0x7'));module[_0x55d2('0x8')]=function(_0x15543c,_0x53bbf2){return _0x15543c[_0x55d2('0x9')](_0x55d2('0xa'),attributes,{'tableName':_0x55d2('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 a40445f..2085ec1 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 _0xc30e=['../../config/logger','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x17d7c0,_0x288eab){var _0x289b50=function(_0x22809e){while(--_0x22809e){_0x17d7c0['push'](_0x17d7c0['shift']());}};_0x289b50(++_0x288eab);}(_0xc30e,0x15a));var _0xec30=function(_0x3f184f,_0x1c28c1){_0x3f184f=_0x3f184f-0x0;var _0x2ee1de=_0xc30e[_0x3f184f];return _0x2ee1de;};'use strict';var _=require('lodash');var util=require(_0xec30('0x0'));var moment=require('moment');var BPromise=require(_0xec30('0x1'));var rs=require(_0xec30('0x2'));var fs=require('fs');var Redis=require(_0xec30('0x3'));var db=require(_0xec30('0x4'))['db'];var utils=require(_0xec30('0x5'));var logger=require(_0xec30('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xec30('0x7'));var client=jayson[_0xec30('0x8')][_0xec30('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a1daf,_0x3014a9,_0x275ea2){return new BPromise(function(_0x1e46f9,_0x767fb3){return client[_0xec30('0xa')](_0x5a1daf,_0x275ea2)[_0xec30('0xb')](function(_0x1625b){logger[_0xec30('0xc')](_0xec30('0xd'),_0x3014a9,_0xec30('0xe'));logger[_0xec30('0xf')](_0xec30('0x10'),_0x3014a9,_0xec30('0xe'),JSON['stringify'](_0x1625b));if(_0x1625b[_0xec30('0x11')]){if(_0x1625b[_0xec30('0x11')][_0xec30('0x12')]===0x1f4){logger['error'](_0xec30('0xd'),_0x3014a9,_0x1625b['error'][_0xec30('0x13')]);return _0x767fb3(_0x1625b['error']['message']);}logger[_0xec30('0x11')](_0xec30('0xd'),_0x3014a9,_0x1625b[_0xec30('0x11')][_0xec30('0x13')]);return _0x1e46f9(_0x1625b[_0xec30('0x11')][_0xec30('0x13')]);}else{logger[_0xec30('0xc')](_0xec30('0xd'),_0x3014a9,_0xec30('0xe'));_0x1e46f9(_0x1625b[_0xec30('0x14')][_0xec30('0x13')]);}})[_0xec30('0x15')](function(_0x47ce75){logger[_0xec30('0x11')](_0xec30('0xd'),_0x3014a9,_0x47ce75);_0x767fb3(_0x47ce75);});});} \ No newline at end of file +var _0x8ed7=['jayson/promise','client','http','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x44a64f,_0x38475c){var _0x52024b=function(_0x2cd055){while(--_0x2cd055){_0x44a64f['push'](_0x44a64f['shift']());}};_0x52024b(++_0x38475c);}(_0x8ed7,0x8b));var _0x78ed=function(_0x107cf0,_0x1b33ce){_0x107cf0=_0x107cf0-0x0;var _0x57a98f=_0x8ed7[_0x107cf0];return _0x57a98f;};'use strict';var _=require('lodash');var util=require(_0x78ed('0x0'));var moment=require(_0x78ed('0x1'));var BPromise=require(_0x78ed('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x78ed('0x3'))['db'];var utils=require(_0x78ed('0x4'));var logger=require(_0x78ed('0x5'))(_0x78ed('0x6'));var config=require(_0x78ed('0x7'));var jayson=require(_0x78ed('0x8'));var client=jayson[_0x78ed('0x9')][_0x78ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fc5e7,_0x54c783,_0x232d7b){return new BPromise(function(_0x5197a3,_0x1c0ec8){return client['request'](_0x1fc5e7,_0x232d7b)[_0x78ed('0xb')](function(_0x550763){logger['info'](_0x78ed('0xc'),_0x54c783,_0x78ed('0xd'));logger['debug'](_0x78ed('0xe'),_0x54c783,_0x78ed('0xd'),JSON['stringify'](_0x550763));if(_0x550763[_0x78ed('0xf')]){if(_0x550763['error'][_0x78ed('0x10')]===0x1f4){logger[_0x78ed('0xf')](_0x78ed('0xc'),_0x54c783,_0x550763[_0x78ed('0xf')][_0x78ed('0x11')]);return _0x1c0ec8(_0x550763[_0x78ed('0xf')]['message']);}logger[_0x78ed('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x54c783,_0x550763['error']['message']);return _0x5197a3(_0x550763['error']['message']);}else{logger[_0x78ed('0x12')](_0x78ed('0xc'),_0x54c783,_0x78ed('0xd'));_0x5197a3(_0x550763[_0x78ed('0x13')][_0x78ed('0x11')]);}})[_0x78ed('0x14')](function(_0x336ae1){logger[_0x78ed('0xf')](_0x78ed('0xc'),_0x54c783,_0x336ae1);_0x1c0ec8(_0x336ae1);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 6555d63..ea0f92a 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 _0xd555=['create','put','update','destroy','exports','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd555,0xef));var _0x5d55=function(_0x2827f9,_0x2682a8){_0x2827f9=_0x2827f9-0x0;var _0x5a00a5=_0xd555[_0x2827f9];return _0x5a00a5;};'use strict';var multer=require('multer');var util=require(_0x5d55('0x0'));var path=require(_0x5d55('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5d55('0x2')]();var fs_extra=require(_0x5d55('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5d55('0x4'));var config=require(_0x5d55('0x5'));var controller=require(_0x5d55('0x6'));router[_0x5d55('0x7')]('/',auth[_0x5d55('0x8')](),controller[_0x5d55('0x9')]);router[_0x5d55('0x7')](_0x5d55('0xa'),auth[_0x5d55('0x8')](),controller[_0x5d55('0xb')]);router[_0x5d55('0xc')]('/',auth['isAuthenticated'](),controller[_0x5d55('0xd')]);router[_0x5d55('0xe')](_0x5d55('0xa'),auth[_0x5d55('0x8')](),controller[_0x5d55('0xf')]);router['delete'](_0x5d55('0xa'),auth[_0x5d55('0x8')](),controller[_0x5d55('0x10')]);module[_0x5d55('0x11')]=router; \ No newline at end of file +var _0x21ad=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../config/environment','./intDeskField.controller','get','isAuthenticated','/:id','post'];(function(_0x19b03d,_0x83a045){var _0x2d9a6b=function(_0x55046a){while(--_0x55046a){_0x19b03d['push'](_0x19b03d['shift']());}};_0x2d9a6b(++_0x83a045);}(_0x21ad,0x85));var _0xd21a=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x21ad[_0x31cb5f];return _0x586042;};'use strict';var multer=require(_0xd21a('0x0'));var util=require('util');var path=require(_0xd21a('0x1'));var timeout=require(_0xd21a('0x2'));var express=require(_0xd21a('0x3'));var router=express['Router']();var fs_extra=require(_0xd21a('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd21a('0x5'));var controller=require(_0xd21a('0x6'));router[_0xd21a('0x7')]('/',auth[_0xd21a('0x8')](),controller['index']);router[_0xd21a('0x7')](_0xd21a('0x9'),auth[_0xd21a('0x8')](),controller['show']);router[_0xd21a('0xa')]('/',auth[_0xd21a('0x8')](),controller['create']);router[_0xd21a('0xb')](_0xd21a('0x9'),auth['isAuthenticated'](),controller[_0xd21a('0xc')]);router[_0xd21a('0xd')](_0xd21a('0x9'),auth[_0xd21a('0x8')](),controller[_0xd21a('0xe')]);module[_0xd21a('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index d20bf5c..8317530 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 _0x3638=['keyValue','picklist','STRING','variable','BOOLEAN','sequelize','ENUM','string','customVariable'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x3638,0x1c7));var _0x8363=function(_0x2ad789,_0x2e30f9){_0x2ad789=_0x2ad789-0x0;var _0x1d1bd8=_0x3638[_0x2ad789];return _0x1d1bd8;};'use strict';var Sequelize=require(_0x8363('0x0'));module['exports']={'type':{'type':Sequelize[_0x8363('0x1')](_0x8363('0x2'),'variable',_0x8363('0x3'),_0x8363('0x4'),_0x8363('0x5')),'defaultValue':_0x8363('0x2')},'content':{'type':Sequelize[_0x8363('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x8363('0x1')](_0x8363('0x2'),_0x8363('0x7'),_0x8363('0x3'))},'keyContent':{'type':Sequelize[_0x8363('0x6')]},'idField':{'type':Sequelize[_0x8363('0x6')]},'nameField':{'type':Sequelize[_0x8363('0x6')]},'customField':{'type':Sequelize[_0x8363('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8363('0x6')]}}; \ No newline at end of file +var _0xf576=['exports','ENUM','string','customVariable','keyValue','STRING','variable','BOOLEAN','sequelize'];(function(_0x3c487b,_0x44c5e2){var _0x1d65f6=function(_0x135e6d){while(--_0x135e6d){_0x3c487b['push'](_0x3c487b['shift']());}};_0x1d65f6(++_0x44c5e2);}(_0xf576,0x1b8));var _0x6f57=function(_0x663f5c,_0xcf841){_0x663f5c=_0x663f5c-0x0;var _0x3ae1ea=_0xf576[_0x663f5c];return _0x3ae1ea;};'use strict';var Sequelize=require(_0x6f57('0x0'));module[_0x6f57('0x1')]={'type':{'type':Sequelize[_0x6f57('0x2')](_0x6f57('0x3'),'variable',_0x6f57('0x4'),_0x6f57('0x5'),'picklist'),'defaultValue':_0x6f57('0x3')},'content':{'type':Sequelize[_0x6f57('0x6')]},'key':{'type':Sequelize[_0x6f57('0x6')]},'keyType':{'type':Sequelize[_0x6f57('0x2')]('string',_0x6f57('0x7'),_0x6f57('0x4'))},'keyContent':{'type':Sequelize[_0x6f57('0x6')]},'idField':{'type':Sequelize[_0x6f57('0x6')]},'nameField':{'type':Sequelize[_0x6f57('0x6')]},'customField':{'type':Sequelize[_0x6f57('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6f57('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 2b1321a..9766a1b 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 _0x27fa=['rows','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','error','name','send','index','map','fieldName','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','limit','sort','where','pick','filter','merge','type','VIRTUAL','options','DeskField','includeAll','include','findAll'];(function(_0x140606,_0x3e978a){var _0x428922=function(_0x48a3fd){while(--_0x48a3fd){_0x140606['push'](_0x140606['shift']());}};_0x428922(++_0x3e978a);}(_0x27fa,0x1c3));var _0xa27f=function(_0x28681d,_0x2e1381){_0x28681d=_0x28681d-0x0;var _0x5d2c6f=_0x27fa[_0x28681d];return _0x5d2c6f;};'use strict';var emlformat=require(_0xa27f('0x0'));var rimraf=require(_0xa27f('0x1'));var zipdir=require(_0xa27f('0x2'));var jsonpatch=require(_0xa27f('0x3'));var rp=require(_0xa27f('0x4'));var moment=require(_0xa27f('0x5'));var BPromise=require(_0xa27f('0x6'));var Mustache=require('mustache');var util=require(_0xa27f('0x7'));var path=require(_0xa27f('0x8'));var sox=require(_0xa27f('0x9'));var csv=require(_0xa27f('0xa'));var ejs=require(_0xa27f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa27f('0xc'));var squel=require(_0xa27f('0xd'));var crypto=require(_0xa27f('0xe'));var jsforce=require(_0xa27f('0xf'));var deskjs=require(_0xa27f('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa27f('0x11'));var Papa=require(_0xa27f('0x12'));var Redis=require(_0xa27f('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xa27f('0x14'));var as=require(_0xa27f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa27f('0x16'))('api');var utils=require(_0xa27f('0x17'));var config=require(_0xa27f('0x18'));var licenseUtil=require(_0xa27f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22c9e1,_0xab5a96){_0xab5a96=_0xab5a96||0xcc;return function(_0x1ac468){if(_0x1ac468){return _0x22c9e1[_0xa27f('0x1a')](_0xab5a96);}return _0x22c9e1[_0xa27f('0x1b')](_0xab5a96)[_0xa27f('0x1c')]();};}function respondWithResult(_0x499eb8,_0x4466b5){_0x4466b5=_0x4466b5||0xc8;return function(_0x4392b1){if(_0x4392b1){return _0x499eb8[_0xa27f('0x1b')](_0x4466b5)['json'](_0x4392b1);}};}function respondWithFilteredResult(_0x39ce35,_0x57bbaf){return function(_0x56df4c){if(_0x56df4c){var _0x201310=typeof _0x57bbaf[_0xa27f('0x1d')]==='undefined'&&typeof _0x57bbaf['limit']===_0xa27f('0x1e');var _0x35e129=_0x56df4c[_0xa27f('0x1f')];var _0x531ce3=_0x201310?0x0:_0x57bbaf[_0xa27f('0x1d')];var _0x491a93=_0x201310?_0x56df4c['count']:_0x57bbaf['offset']+_0x57bbaf['limit'];var _0x10aa1c;if(_0x491a93>=_0x35e129){_0x491a93=_0x35e129;_0x10aa1c=0xc8;}else{_0x10aa1c=0xce;}_0x39ce35[_0xa27f('0x1b')](_0x10aa1c);return _0x39ce35[_0xa27f('0x20')](_0xa27f('0x21'),_0x531ce3+'-'+_0x491a93+'/'+_0x35e129)[_0xa27f('0x22')](_0x56df4c);}return null;};}function patchUpdates(_0x395634){return function(_0x54c060){try{jsonpatch['apply'](_0x54c060,_0x395634,!![]);}catch(_0x27f556){return BPromise[_0xa27f('0x23')](_0x27f556);}return _0x54c060[_0xa27f('0x24')]();};}function saveUpdates(_0x415560,_0x45593f){return function(_0x17ddfc){if(_0x17ddfc){return _0x17ddfc[_0xa27f('0x25')](_0x415560)[_0xa27f('0x26')](function(_0x3de2af){return _0x3de2af;});}return null;};}function removeEntity(_0x405a90,_0x1721a1){return function(_0x549eab){if(_0x549eab){return _0x549eab[_0xa27f('0x27')]()[_0xa27f('0x26')](function(){_0x405a90[_0xa27f('0x1b')](0xcc)[_0xa27f('0x1c')]();});}};}function handleEntityNotFound(_0x24537c,_0x4f6e20){return function(_0x76691c){if(!_0x76691c){_0x24537c['sendStatus'](0x194);}return _0x76691c;};}function handleError(_0x45f4d8,_0x8e8ae8){_0x8e8ae8=_0x8e8ae8||0x1f4;return function(_0x125236){logger[_0xa27f('0x28')](_0x125236['stack']);if(_0x125236['name']){delete _0x125236[_0xa27f('0x29')];}_0x45f4d8[_0xa27f('0x1b')](_0x8e8ae8)[_0xa27f('0x2a')](_0x125236);};}exports[_0xa27f('0x2b')]=function(_0x4e4464,_0x41d28a){var _0x4e513e={},_0x532360={},_0x4b76e0={'count':0x0,'rows':[]};var _0x454aed=_[_0xa27f('0x2c')](db['DeskField']['rawAttributes'],function(_0x293af3){return{'name':_0x293af3[_0xa27f('0x2d')],'type':_0x293af3['type']['key']};});_0x532360[_0xa27f('0x2e')]=_[_0xa27f('0x2c')](_0x454aed,_0xa27f('0x29'));_0x532360['query']=_[_0xa27f('0x2f')](_0x4e4464[_0xa27f('0x30')]);_0x532360[_0xa27f('0x31')]=_[_0xa27f('0x32')](_0x532360[_0xa27f('0x2e')],_0x532360[_0xa27f('0x30')]);_0x4e513e['attributes']=_[_0xa27f('0x32')](_0x532360[_0xa27f('0x2e')],qs[_0xa27f('0x33')](_0x4e4464[_0xa27f('0x30')][_0xa27f('0x33')]));_0x4e513e[_0xa27f('0x34')]=_0x4e513e['attributes']['length']?_0x4e513e[_0xa27f('0x34')]:_0x532360[_0xa27f('0x2e')];if(!_0x4e4464[_0xa27f('0x30')][_0xa27f('0x35')]('nolimit')){_0x4e513e[_0xa27f('0x36')]=qs[_0xa27f('0x36')](_0x4e4464[_0xa27f('0x30')]['limit']);_0x4e513e['offset']=qs['offset'](_0x4e4464['query'][_0xa27f('0x1d')]);}_0x4e513e['order']=qs[_0xa27f('0x37')](_0x4e4464['query'][_0xa27f('0x37')]);_0x4e513e[_0xa27f('0x38')]=qs[_0xa27f('0x31')](_[_0xa27f('0x39')](_0x4e4464[_0xa27f('0x30')],_0x532360[_0xa27f('0x31')]),_0x454aed);if(_0x4e4464[_0xa27f('0x30')][_0xa27f('0x3a')]){_0x4e513e['where']=_[_0xa27f('0x3b')](_0x4e513e[_0xa27f('0x38')],{'$or':_[_0xa27f('0x2c')](_0x454aed,function(_0x1d36d4){if(_0x1d36d4[_0xa27f('0x3c')]!==_0xa27f('0x3d')){var _0x27a152={};_0x27a152[_0x1d36d4['name']]={'$like':'%'+_0x4e4464['query'][_0xa27f('0x3a')]+'%'};return _0x27a152;}})});}_0x4e513e=_['merge']({},_0x4e513e,_0x4e4464[_0xa27f('0x3e')]);var _0x133bf8={'where':_0x4e513e[_0xa27f('0x38')]};return db[_0xa27f('0x3f')][_0xa27f('0x1f')](_0x133bf8)['then'](function(_0x534c28){_0x4b76e0['count']=_0x534c28;if(_0x4e4464[_0xa27f('0x30')][_0xa27f('0x40')]){_0x4e513e[_0xa27f('0x41')]=[{'all':!![]}];}return db[_0xa27f('0x3f')][_0xa27f('0x42')](_0x4e513e);})[_0xa27f('0x26')](function(_0x29cfa8){_0x4b76e0[_0xa27f('0x43')]=_0x29cfa8;return _0x4b76e0;})['then'](respondWithFilteredResult(_0x41d28a,_0x4e513e))['catch'](handleError(_0x41d28a,null));};exports[_0xa27f('0x44')]=function(_0x9c3386,_0x56f12d){var _0x37e56b={'raw':!![],'where':{'id':_0x9c3386[_0xa27f('0x45')]['id']}},_0x2d8449={};_0x2d8449['model']=_[_0xa27f('0x2f')](db[_0xa27f('0x3f')]['rawAttributes']);_0x2d8449[_0xa27f('0x30')]=_[_0xa27f('0x2f')](_0x9c3386[_0xa27f('0x30')]);_0x2d8449[_0xa27f('0x31')]=_['intersection'](_0x2d8449[_0xa27f('0x2e')],_0x2d8449[_0xa27f('0x30')]);_0x37e56b[_0xa27f('0x34')]=_['intersection'](_0x2d8449['model'],qs[_0xa27f('0x33')](_0x9c3386[_0xa27f('0x30')][_0xa27f('0x33')]));_0x37e56b[_0xa27f('0x34')]=_0x37e56b[_0xa27f('0x34')]['length']?_0x37e56b[_0xa27f('0x34')]:_0x2d8449[_0xa27f('0x2e')];if(_0x9c3386[_0xa27f('0x30')]['includeAll']){_0x37e56b['include']=[{'all':!![]}];}_0x37e56b=_[_0xa27f('0x3b')]({},_0x37e56b,_0x9c3386[_0xa27f('0x3e')]);return db['DeskField'][_0xa27f('0x46')](_0x37e56b)[_0xa27f('0x26')](handleEntityNotFound(_0x56f12d,null))[_0xa27f('0x26')](respondWithResult(_0x56f12d,null))[_0xa27f('0x47')](handleError(_0x56f12d,null));};exports[_0xa27f('0x48')]=function(_0x3f966c,_0x9a028c){return db[_0xa27f('0x3f')][_0xa27f('0x48')](_0x3f966c[_0xa27f('0x49')],{})[_0xa27f('0x26')](respondWithResult(_0x9a028c,0xc9))['catch'](handleError(_0x9a028c,null));};exports[_0xa27f('0x25')]=function(_0xe421d9,_0x541e51){if(_0xe421d9[_0xa27f('0x49')]['id']){delete _0xe421d9[_0xa27f('0x49')]['id'];}return db['DeskField'][_0xa27f('0x46')]({'where':{'id':_0xe421d9[_0xa27f('0x45')]['id']}})[_0xa27f('0x26')](handleEntityNotFound(_0x541e51,null))['then'](saveUpdates(_0xe421d9[_0xa27f('0x49')],null))['then'](respondWithResult(_0x541e51,null))['catch'](handleError(_0x541e51,null));};exports[_0xa27f('0x27')]=function(_0x50e359,_0x391335){return db[_0xa27f('0x3f')][_0xa27f('0x46')]({'where':{'id':_0x50e359[_0xa27f('0x45')]['id']}})[_0xa27f('0x26')](handleEntityNotFound(_0x391335,null))[_0xa27f('0x26')](removeEntity(_0x391335,null))[_0xa27f('0x47')](handleError(_0x391335,null));}; \ No newline at end of file +var _0xf1c6=['json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','sendStatus','name','send','index','map','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','DeskField','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','create','body','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','end','status'];(function(_0x589f37,_0x34aee3){var _0x2c4cbe=function(_0x37eac2){while(--_0x37eac2){_0x589f37['push'](_0x589f37['shift']());}};_0x2c4cbe(++_0x34aee3);}(_0xf1c6,0x145));var _0x6f1c=function(_0x15db51,_0x5cf64b){_0x15db51=_0x15db51-0x0;var _0x20de1f=_0xf1c6[_0x15db51];return _0x20de1f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6f1c('0x0'));var jsonpatch=require(_0x6f1c('0x1'));var rp=require(_0x6f1c('0x2'));var moment=require(_0x6f1c('0x3'));var BPromise=require(_0x6f1c('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6f1c('0x5'));var sox=require('sox');var csv=require(_0x6f1c('0x6'));var ejs=require(_0x6f1c('0x7'));var fs=require('fs');var fs_extra=require(_0x6f1c('0x8'));var _=require('lodash');var squel=require(_0x6f1c('0x9'));var crypto=require('crypto');var jsforce=require(_0x6f1c('0xa'));var deskjs=require(_0x6f1c('0xb'));var toCsv=require(_0x6f1c('0x6'));var querystring=require('querystring');var Papa=require(_0x6f1c('0xc'));var Redis=require('ioredis');var authService=require(_0x6f1c('0xd'));var qs=require(_0x6f1c('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6f1c('0xf'));var logger=require(_0x6f1c('0x10'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6f1c('0x11'))['db'];function respondWithStatusCode(_0x4d03bc,_0x553922){_0x553922=_0x553922||0xcc;return function(_0x4c0560){if(_0x4c0560){return _0x4d03bc['sendStatus'](_0x553922);}return _0x4d03bc['status'](_0x553922)[_0x6f1c('0x12')]();};}function respondWithResult(_0x1899ff,_0x42b4be){_0x42b4be=_0x42b4be||0xc8;return function(_0x5549d1){if(_0x5549d1){return _0x1899ff[_0x6f1c('0x13')](_0x42b4be)[_0x6f1c('0x14')](_0x5549d1);}};}function respondWithFilteredResult(_0x4547a7,_0x4b21a4){return function(_0x3b7b71){if(_0x3b7b71){var _0x210abb=typeof _0x4b21a4['offset']===_0x6f1c('0x15')&&typeof _0x4b21a4[_0x6f1c('0x16')]===_0x6f1c('0x15');var _0x6e2d39=_0x3b7b71[_0x6f1c('0x17')];var _0x16d2bb=_0x210abb?0x0:_0x4b21a4['offset'];var _0x2f9949=_0x210abb?_0x3b7b71[_0x6f1c('0x17')]:_0x4b21a4[_0x6f1c('0x18')]+_0x4b21a4[_0x6f1c('0x16')];var _0x20c2bb;if(_0x2f9949>=_0x6e2d39){_0x2f9949=_0x6e2d39;_0x20c2bb=0xc8;}else{_0x20c2bb=0xce;}_0x4547a7[_0x6f1c('0x13')](_0x20c2bb);return _0x4547a7['set']('Content-Range',_0x16d2bb+'-'+_0x2f9949+'/'+_0x6e2d39)['json'](_0x3b7b71);}return null;};}function patchUpdates(_0x29e9b5){return function(_0x5d5df9){try{jsonpatch[_0x6f1c('0x19')](_0x5d5df9,_0x29e9b5,!![]);}catch(_0x4f6637){return BPromise[_0x6f1c('0x1a')](_0x4f6637);}return _0x5d5df9[_0x6f1c('0x1b')]();};}function saveUpdates(_0x475b48,_0x14effb){return function(_0x2ed8f1){if(_0x2ed8f1){return _0x2ed8f1[_0x6f1c('0x1c')](_0x475b48)[_0x6f1c('0x1d')](function(_0x35934b){return _0x35934b;});}return null;};}function removeEntity(_0x255e0f,_0x18ff09){return function(_0x130bae){if(_0x130bae){return _0x130bae[_0x6f1c('0x1e')]()[_0x6f1c('0x1d')](function(){_0x255e0f[_0x6f1c('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a3b6a,_0x2b29af){return function(_0x4a8fc1){if(!_0x4a8fc1){_0x2a3b6a[_0x6f1c('0x1f')](0x194);}return _0x4a8fc1;};}function handleError(_0x4582c7,_0x557ed7){_0x557ed7=_0x557ed7||0x1f4;return function(_0x59931c){logger['error'](_0x59931c['stack']);if(_0x59931c[_0x6f1c('0x20')]){delete _0x59931c[_0x6f1c('0x20')];}_0x4582c7[_0x6f1c('0x13')](_0x557ed7)[_0x6f1c('0x21')](_0x59931c);};}exports[_0x6f1c('0x22')]=function(_0x66cb25,_0x88295d){var _0x2fe858={},_0x32c722={},_0xd5e1a7={'count':0x0,'rows':[]};var _0x33db9d=_[_0x6f1c('0x23')](db['DeskField']['rawAttributes'],function(_0x1f783a){return{'name':_0x1f783a[_0x6f1c('0x24')],'type':_0x1f783a[_0x6f1c('0x25')][_0x6f1c('0x26')]};});_0x32c722[_0x6f1c('0x27')]=_['map'](_0x33db9d,_0x6f1c('0x20'));_0x32c722['query']=_[_0x6f1c('0x28')](_0x66cb25['query']);_0x32c722[_0x6f1c('0x29')]=_[_0x6f1c('0x2a')](_0x32c722[_0x6f1c('0x27')],_0x32c722[_0x6f1c('0x2b')]);_0x2fe858[_0x6f1c('0x2c')]=_[_0x6f1c('0x2a')](_0x32c722[_0x6f1c('0x27')],qs[_0x6f1c('0x2d')](_0x66cb25[_0x6f1c('0x2b')][_0x6f1c('0x2d')]));_0x2fe858['attributes']=_0x2fe858[_0x6f1c('0x2c')][_0x6f1c('0x2e')]?_0x2fe858[_0x6f1c('0x2c')]:_0x32c722[_0x6f1c('0x27')];if(!_0x66cb25[_0x6f1c('0x2b')][_0x6f1c('0x2f')](_0x6f1c('0x30'))){_0x2fe858[_0x6f1c('0x16')]=qs[_0x6f1c('0x16')](_0x66cb25['query']['limit']);_0x2fe858[_0x6f1c('0x18')]=qs[_0x6f1c('0x18')](_0x66cb25[_0x6f1c('0x2b')][_0x6f1c('0x18')]);}_0x2fe858[_0x6f1c('0x31')]=qs[_0x6f1c('0x32')](_0x66cb25[_0x6f1c('0x2b')][_0x6f1c('0x32')]);_0x2fe858[_0x6f1c('0x33')]=qs[_0x6f1c('0x29')](_[_0x6f1c('0x34')](_0x66cb25[_0x6f1c('0x2b')],_0x32c722[_0x6f1c('0x29')]),_0x33db9d);if(_0x66cb25[_0x6f1c('0x2b')][_0x6f1c('0x35')]){_0x2fe858[_0x6f1c('0x33')]=_['merge'](_0x2fe858['where'],{'$or':_[_0x6f1c('0x23')](_0x33db9d,function(_0x317dde){if(_0x317dde[_0x6f1c('0x25')]!==_0x6f1c('0x36')){var _0x2b93cd={};_0x2b93cd[_0x317dde[_0x6f1c('0x20')]]={'$like':'%'+_0x66cb25[_0x6f1c('0x2b')][_0x6f1c('0x35')]+'%'};return _0x2b93cd;}})});}_0x2fe858=_[_0x6f1c('0x37')]({},_0x2fe858,_0x66cb25['options']);var _0x1c0860={'where':_0x2fe858[_0x6f1c('0x33')]};return db[_0x6f1c('0x38')][_0x6f1c('0x17')](_0x1c0860)['then'](function(_0x907834){_0xd5e1a7['count']=_0x907834;if(_0x66cb25[_0x6f1c('0x2b')][_0x6f1c('0x39')]){_0x2fe858[_0x6f1c('0x3a')]=[{'all':!![]}];}return db[_0x6f1c('0x38')][_0x6f1c('0x3b')](_0x2fe858);})[_0x6f1c('0x1d')](function(_0xdd1b55){_0xd5e1a7[_0x6f1c('0x3c')]=_0xdd1b55;return _0xd5e1a7;})[_0x6f1c('0x1d')](respondWithFilteredResult(_0x88295d,_0x2fe858))[_0x6f1c('0x3d')](handleError(_0x88295d,null));};exports[_0x6f1c('0x3e')]=function(_0x184130,_0x5113b5){var _0x242704={'raw':!![],'where':{'id':_0x184130['params']['id']}},_0x33d4ca={};_0x33d4ca[_0x6f1c('0x27')]=_[_0x6f1c('0x28')](db[_0x6f1c('0x38')][_0x6f1c('0x3f')]);_0x33d4ca[_0x6f1c('0x2b')]=_[_0x6f1c('0x28')](_0x184130[_0x6f1c('0x2b')]);_0x33d4ca['filters']=_[_0x6f1c('0x2a')](_0x33d4ca['model'],_0x33d4ca[_0x6f1c('0x2b')]);_0x242704[_0x6f1c('0x2c')]=_[_0x6f1c('0x2a')](_0x33d4ca[_0x6f1c('0x27')],qs[_0x6f1c('0x2d')](_0x184130['query'][_0x6f1c('0x2d')]));_0x242704[_0x6f1c('0x2c')]=_0x242704['attributes'][_0x6f1c('0x2e')]?_0x242704[_0x6f1c('0x2c')]:_0x33d4ca[_0x6f1c('0x27')];if(_0x184130['query'][_0x6f1c('0x39')]){_0x242704[_0x6f1c('0x3a')]=[{'all':!![]}];}_0x242704=_[_0x6f1c('0x37')]({},_0x242704,_0x184130[_0x6f1c('0x40')]);return db[_0x6f1c('0x38')][_0x6f1c('0x41')](_0x242704)[_0x6f1c('0x1d')](handleEntityNotFound(_0x5113b5,null))[_0x6f1c('0x1d')](respondWithResult(_0x5113b5,null))['catch'](handleError(_0x5113b5,null));};exports[_0x6f1c('0x42')]=function(_0x212d38,_0x425cb5){return db['DeskField'][_0x6f1c('0x42')](_0x212d38[_0x6f1c('0x43')],{})[_0x6f1c('0x1d')](respondWithResult(_0x425cb5,0xc9))['catch'](handleError(_0x425cb5,null));};exports[_0x6f1c('0x1c')]=function(_0x215b86,_0x435f52){if(_0x215b86[_0x6f1c('0x43')]['id']){delete _0x215b86[_0x6f1c('0x43')]['id'];}return db[_0x6f1c('0x38')][_0x6f1c('0x41')]({'where':{'id':_0x215b86[_0x6f1c('0x44')]['id']}})['then'](handleEntityNotFound(_0x435f52,null))[_0x6f1c('0x1d')](saveUpdates(_0x215b86[_0x6f1c('0x43')],null))['then'](respondWithResult(_0x435f52,null))[_0x6f1c('0x3d')](handleError(_0x435f52,null));};exports[_0x6f1c('0x1e')]=function(_0x51fa40,_0x4e4e81){return db['DeskField'][_0x6f1c('0x41')]({'where':{'id':_0x51fa40['params']['id']}})['then'](handleEntityNotFound(_0x4e4e81,null))[_0x6f1c('0x1d')](removeEntity(_0x4e4e81,null))[_0x6f1c('0x3d')](handleError(_0x4e4e81,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 4c70806..d9299cd 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 _0x832b=['exports','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes'];(function(_0xcb73cb,_0x1c1ac8){var _0x217d7a=function(_0x4744c1){while(--_0x4744c1){_0xcb73cb['push'](_0xcb73cb['shift']());}};_0x217d7a(++_0x1c1ac8);}(_0x832b,0x78));var _0xb832=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x832b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xb832('0x0'));var logger=require(_0xb832('0x1'))(_0xb832('0x2'));var moment=require(_0xb832('0x3'));var BPromise=require(_0xb832('0x4'));var rp=require(_0xb832('0x5'));var fs=require('fs');var path=require(_0xb832('0x6'));var rimraf=require(_0xb832('0x7'));var config=require(_0xb832('0x8'));var attributes=require(_0xb832('0x9'));module[_0xb832('0xa')]=function(_0x4c88d1,_0x15d0cc){return _0x4c88d1['define']('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xb832('0xb'),_0xb832('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a14=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDeskField.attributes','exports','define','DeskField','desk_unique_index','idField'];(function(_0x417401,_0x2f97a4){var _0x3c6a26=function(_0x37b077){while(--_0x37b077){_0x417401['push'](_0x417401['shift']());}};_0x3c6a26(++_0x2f97a4);}(_0x7a14,0x1c2));var _0x47a1=function(_0x53774b,_0x22ef5f){_0x53774b=_0x53774b-0x0;var _0x129c32=_0x7a14[_0x53774b];return _0x129c32;};'use strict';var _=require(_0x47a1('0x0'));var util=require(_0x47a1('0x1'));var logger=require(_0x47a1('0x2'))(_0x47a1('0x3'));var moment=require(_0x47a1('0x4'));var BPromise=require(_0x47a1('0x5'));var rp=require(_0x47a1('0x6'));var fs=require('fs');var path=require(_0x47a1('0x7'));var rimraf=require(_0x47a1('0x8'));var config=require('../../config/environment');var attributes=require(_0x47a1('0x9'));module[_0x47a1('0xa')]=function(_0xad8d3a,_0x30788c){return _0xad8d3a[_0x47a1('0xb')](_0x47a1('0xc'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x47a1('0xd'),'fields':[_0x47a1('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 9912bbd..6059691 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 _0xeeb8=['DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','DeskField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x139144,_0x3ac9f6){var _0x4ba75e=function(_0x3c21ef){while(--_0x3c21ef){_0x139144['push'](_0x139144['shift']());}};_0x4ba75e(++_0x3ac9f6);}(_0xeeb8,0x11c));var _0x8eeb=function(_0x272616,_0x3a04cc){_0x272616=_0x272616-0x0;var _0x4621c3=_0xeeb8[_0x272616];return _0x4621c3;};'use strict';var _=require('lodash');var util=require(_0x8eeb('0x0'));var moment=require(_0x8eeb('0x1'));var BPromise=require(_0x8eeb('0x2'));var rs=require(_0x8eeb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8eeb('0x4'))['db'];var utils=require(_0x8eeb('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x8eeb('0x6'));var jayson=require(_0x8eeb('0x7'));var client=jayson[_0x8eeb('0x8')][_0x8eeb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21e5f0,_0x4b2942,_0x418258){return new BPromise(function(_0x1605c8,_0x2eba16){return client[_0x8eeb('0xa')](_0x21e5f0,_0x418258)[_0x8eeb('0xb')](function(_0x54f816){logger['info'](_0x8eeb('0xc'),_0x4b2942,_0x8eeb('0xd'));logger[_0x8eeb('0xe')](_0x8eeb('0xf'),_0x4b2942,_0x8eeb('0xd'),JSON[_0x8eeb('0x10')](_0x54f816));if(_0x54f816[_0x8eeb('0x11')]){if(_0x54f816['error'][_0x8eeb('0x12')]===0x1f4){logger['error'](_0x8eeb('0xc'),_0x4b2942,_0x54f816[_0x8eeb('0x11')]['message']);return _0x2eba16(_0x54f816[_0x8eeb('0x11')][_0x8eeb('0x13')]);}logger[_0x8eeb('0x11')](_0x8eeb('0xc'),_0x4b2942,_0x54f816[_0x8eeb('0x11')]['message']);return _0x1605c8(_0x54f816[_0x8eeb('0x11')]['message']);}else{logger[_0x8eeb('0x14')](_0x8eeb('0xc'),_0x4b2942,_0x8eeb('0xd'));_0x1605c8(_0x54f816[_0x8eeb('0x15')][_0x8eeb('0x13')]);}})[_0x8eeb('0x16')](function(_0x1a94c2){logger[_0x8eeb('0x11')](_0x8eeb('0xc'),_0x4b2942,_0x1a94c2);_0x2eba16(_0x1a94c2);});});} \ No newline at end of file +var _0x84c0=['message','DeskField,\x20%s,\x20%s','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','http','request','then','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x84c0,0x1a8));var _0x084c=function(_0x2ea5ae,_0x3fe75f){_0x2ea5ae=_0x2ea5ae-0x0;var _0x208303=_0x84c0[_0x2ea5ae];return _0x208303;};'use strict';var _=require(_0x084c('0x0'));var util=require('util');var moment=require(_0x084c('0x1'));var BPromise=require(_0x084c('0x2'));var rs=require(_0x084c('0x3'));var fs=require('fs');var Redis=require(_0x084c('0x4'));var db=require(_0x084c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x084c('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x084c('0x7')][_0x084c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3cfa73,_0x485bd4,_0x1e6831){return new BPromise(function(_0x1d6ba5,_0x2071a6){return client[_0x084c('0x9')](_0x3cfa73,_0x1e6831)[_0x084c('0xa')](function(_0x60237f){logger['info']('DeskField,\x20%s,\x20%s',_0x485bd4,_0x084c('0xb'));logger[_0x084c('0xc')](_0x084c('0xd'),_0x485bd4,_0x084c('0xb'),JSON[_0x084c('0xe')](_0x60237f));if(_0x60237f[_0x084c('0xf')]){if(_0x60237f[_0x084c('0xf')][_0x084c('0x10')]===0x1f4){logger[_0x084c('0xf')]('DeskField,\x20%s,\x20%s',_0x485bd4,_0x60237f['error'][_0x084c('0x11')]);return _0x2071a6(_0x60237f['error'][_0x084c('0x11')]);}logger[_0x084c('0xf')](_0x084c('0x12'),_0x485bd4,_0x60237f['error'][_0x084c('0x11')]);return _0x1d6ba5(_0x60237f['error']['message']);}else{logger[_0x084c('0x13')](_0x084c('0x12'),_0x485bd4,_0x084c('0xb'));_0x1d6ba5(_0x60237f[_0x084c('0x14')][_0x084c('0x11')]);}})['catch'](function(_0x402a81){logger[_0x084c('0xf')](_0x084c('0x12'),_0x485bd4,_0x402a81);_0x2071a6(_0x402a81);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index bdd2c58..3016a1d 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 _0x3e30=['Router','fs-extra','../../config/environment','./intDynamics365Account.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x49de12,_0x14458f){var _0x400593=function(_0x4f8054){while(--_0x4f8054){_0x49de12['push'](_0x49de12['shift']());}};_0x400593(++_0x14458f);}(_0x3e30,0x97));var _0x03e3=function(_0x2319b0,_0x215176){_0x2319b0=_0x2319b0-0x0;var _0x32039b=_0x3e30[_0x2319b0];return _0x32039b;};'use strict';var multer=require(_0x03e3('0x0'));var util=require(_0x03e3('0x1'));var path=require(_0x03e3('0x2'));var timeout=require(_0x03e3('0x3'));var express=require(_0x03e3('0x4'));var router=express[_0x03e3('0x5')]();var fs_extra=require(_0x03e3('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x03e3('0x7'));var controller=require(_0x03e3('0x8'));router['get']('/',auth[_0x03e3('0x9')](),controller[_0x03e3('0xa')]);router[_0x03e3('0xb')](_0x03e3('0xc'),auth[_0x03e3('0x9')](),controller[_0x03e3('0xd')]);router[_0x03e3('0xb')](_0x03e3('0xe'),auth[_0x03e3('0x9')](),controller[_0x03e3('0xf')]);router[_0x03e3('0xb')](_0x03e3('0x10'),auth['isAuthenticated'](),controller[_0x03e3('0x11')]);router[_0x03e3('0x12')]('/',auth[_0x03e3('0x9')](),controller[_0x03e3('0x13')]);router[_0x03e3('0x12')](_0x03e3('0xe'),auth[_0x03e3('0x9')](),controller[_0x03e3('0x14')]);router[_0x03e3('0x15')](_0x03e3('0xc'),auth['isAuthenticated'](),controller[_0x03e3('0x16')]);router[_0x03e3('0x17')](_0x03e3('0xc'),auth[_0x03e3('0x9')](),controller[_0x03e3('0x18')]);module[_0x03e3('0x19')]=router; \ No newline at end of file +var _0xbc8d=['Router','../../components/auth/service','get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields','getFields','post','create','put','delete','exports','multer','util','path'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xbc8d,0x1b7));var _0xdbc8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc8d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xdbc8('0x0'));var util=require(_0xdbc8('0x1'));var path=require(_0xdbc8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdbc8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdbc8('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router[_0xdbc8('0x5')]('/',auth[_0xdbc8('0x6')](),controller[_0xdbc8('0x7')]);router[_0xdbc8('0x5')](_0xdbc8('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xdbc8('0x5')](_0xdbc8('0x9'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xdbc8('0x5')](_0xdbc8('0xa'),auth[_0xdbc8('0x6')](),controller[_0xdbc8('0xb')]);router[_0xdbc8('0xc')]('/',auth['isAuthenticated'](),controller[_0xdbc8('0xd')]);router[_0xdbc8('0xc')](_0xdbc8('0x9'),auth[_0xdbc8('0x6')](),controller['addConfiguration']);router[_0xdbc8('0xe')](_0xdbc8('0x8'),auth[_0xdbc8('0x6')](),controller['update']);router[_0xdbc8('0xf')](_0xdbc8('0x8'),auth[_0xdbc8('0x6')](),controller['destroy']);module[_0xdbc8('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index f84e65f..43669f9 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 _0xb93c=['sequelize','STRING'];(function(_0x21d6ff,_0xb9d12e){var _0x67f3c2=function(_0x153335){while(--_0x153335){_0x21d6ff['push'](_0x21d6ff['shift']());}};_0x67f3c2(++_0xb9d12e);}(_0xb93c,0x128));var _0xcb93=function(_0x158f01,_0x12af3e){_0x158f01=_0x158f01-0x0;var _0x5ef74e=_0xb93c[_0x158f01];return _0x5ef74e;};'use strict';var Sequelize=require(_0xcb93('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xcb93('0x1')]},'password':{'type':Sequelize[_0xcb93('0x1')]},'remoteUri':{'type':Sequelize[_0xcb93('0x1')]},'tenantId':{'type':Sequelize[_0xcb93('0x1')]},'clientId':{'type':Sequelize[_0xcb93('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xcb93('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xcb93('0x1')]}}; \ No newline at end of file +var _0x136d=['exports','STRING'];(function(_0x3a146c,_0x25945c){var _0x4bba19=function(_0x2eee56){while(--_0x2eee56){_0x3a146c['push'](_0x3a146c['shift']());}};_0x4bba19(++_0x25945c);}(_0x136d,0x1a2));var _0xd136=function(_0x4ec3ab,_0x50a5de){_0x4ec3ab=_0x4ec3ab-0x0;var _0x229613=_0x136d[_0x4ec3ab];return _0x229613;};'use strict';var Sequelize=require('sequelize');module[_0xd136('0x0')]={'name':{'type':Sequelize[_0xd136('0x1')]},'username':{'type':Sequelize[_0xd136('0x1')]},'password':{'type':Sequelize[_0xd136('0x1')]},'remoteUri':{'type':Sequelize[_0xd136('0x1')]},'tenantId':{'type':Sequelize[_0xd136('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xd136('0x1')]},'serverUrl':{'type':Sequelize[_0xd136('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd136('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 3b1a5f8..75b50da 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 _0xf1e1=['format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','GET',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','4.0','Attributes','remove','includes','forEach','@odata.type','PicklistAttributeMetadata','MetadataId','all','isNil','BooleanAttributeMetadata','push','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','stack','Wrong\x20credentials','statusCode','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','UserLocalizedLabel','Label','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','false','LogicalName',')/Microsoft.Dynamics.CRM.','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','where','filters','pick','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','find','body','findOne','Dynamics365Configuration','sort','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','create','Dynamics365Field','getFields','ticketType','incident','title','customerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','customeridname','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','socialprofileidname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','slice','substring','lastIndexOf'];(function(_0x1a3fba,_0x421605){var _0x5306f0=function(_0x408e48){while(--_0x408e48){_0x1a3fba['push'](_0x1a3fba['shift']());}};_0x5306f0(++_0x421605);}(_0xf1e1,0x102));var _0x1f1e=function(_0x343dfb,_0xed8587){_0x343dfb=_0x343dfb-0x0;var _0x297fe2=_0xf1e1[_0x343dfb];return _0x297fe2;};'use strict';var emlformat=require(_0x1f1e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1f1e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1f1e('0x2'));var moment=require('moment');var BPromise=require(_0x1f1e('0x3'));var Mustache=require(_0x1f1e('0x4'));var util=require(_0x1f1e('0x5'));var path=require(_0x1f1e('0x6'));var sox=require(_0x1f1e('0x7'));var csv=require(_0x1f1e('0x8'));var ejs=require(_0x1f1e('0x9'));var fs=require('fs');var fs_extra=require(_0x1f1e('0xa'));var _=require(_0x1f1e('0xb'));var squel=require(_0x1f1e('0xc'));var crypto=require(_0x1f1e('0xd'));var jsforce=require(_0x1f1e('0xe'));var deskjs=require(_0x1f1e('0xf'));var toCsv=require(_0x1f1e('0x8'));var querystring=require('querystring');var Papa=require(_0x1f1e('0x10'));var Redis=require(_0x1f1e('0x11'));var authService=require(_0x1f1e('0x12'));var qs=require(_0x1f1e('0x13'));var as=require(_0x1f1e('0x14'));var hardwareService=require(_0x1f1e('0x15'));var logger=require(_0x1f1e('0x16'))(_0x1f1e('0x17'));var utils=require(_0x1f1e('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x1f1e('0x19'));var db=require(_0x1f1e('0x1a'))['db'];var integrations=require(_0x1f1e('0x1b'));function respondWithStatusCode(_0x3f5ade,_0x11a6c8){_0x11a6c8=_0x11a6c8||0xcc;return function(_0x3a0261){if(_0x3a0261){return _0x3f5ade[_0x1f1e('0x1c')](_0x11a6c8);}return _0x3f5ade['status'](_0x11a6c8)[_0x1f1e('0x1d')]();};}function respondWithResult(_0x4609c4,_0x53c5e1){_0x53c5e1=_0x53c5e1||0xc8;return function(_0x28563e){if(_0x28563e){return _0x4609c4[_0x1f1e('0x1e')](_0x53c5e1)['json'](_0x28563e);}};}function respondWithFilteredResult(_0x1553d,_0x21da96){return function(_0xe4cef0){if(_0xe4cef0){var _0x2b0a44=typeof _0x21da96[_0x1f1e('0x1f')]===_0x1f1e('0x20')&&typeof _0x21da96[_0x1f1e('0x21')]===_0x1f1e('0x20');var _0xa67227=_0xe4cef0['count'];var _0x4b876c=_0x2b0a44?0x0:_0x21da96[_0x1f1e('0x1f')];var _0x5702db=_0x2b0a44?_0xe4cef0[_0x1f1e('0x22')]:_0x21da96[_0x1f1e('0x1f')]+_0x21da96[_0x1f1e('0x21')];var _0x4ea800;if(_0x5702db>=_0xa67227){_0x5702db=_0xa67227;_0x4ea800=0xc8;}else{_0x4ea800=0xce;}_0x1553d['status'](_0x4ea800);return _0x1553d['set'](_0x1f1e('0x23'),_0x4b876c+'-'+_0x5702db+'/'+_0xa67227)[_0x1f1e('0x24')](_0xe4cef0);}return null;};}function patchUpdates(_0xed547a){return function(_0x2642b3){try{jsonpatch[_0x1f1e('0x25')](_0x2642b3,_0xed547a,!![]);}catch(_0x46d28){return BPromise[_0x1f1e('0x26')](_0x46d28);}return _0x2642b3[_0x1f1e('0x27')]();};}function saveUpdates(_0x5c777e,_0x497c57){return function(_0x58b5e5){if(_0x58b5e5){return _0x58b5e5[_0x1f1e('0x28')](_0x5c777e)[_0x1f1e('0x29')](function(_0x2830d0){return _0x2830d0;});}return null;};}function removeEntity(_0x4268ed,_0x5b9a47){return function(_0x79c4db){if(_0x79c4db){return _0x79c4db[_0x1f1e('0x2a')]()[_0x1f1e('0x29')](function(){_0x4268ed['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dfe89,_0x44fef9){return function(_0x430310){if(!_0x430310){_0x1dfe89['sendStatus'](0x194);}return _0x430310;};}function handleError(_0x2e76e5,_0x31f48b){_0x31f48b=_0x31f48b||0x1f4;return function(_0x5294bf){logger[_0x1f1e('0x2b')](_0x5294bf['stack']);if(_0x5294bf[_0x1f1e('0x2c')]){delete _0x5294bf[_0x1f1e('0x2c')];}_0x2e76e5[_0x1f1e('0x1e')](_0x31f48b)[_0x1f1e('0x2d')](_0x5294bf);};}exports[_0x1f1e('0x2e')]=function(_0x420e4b,_0x52e414){var _0x2b24a6={},_0x175372={},_0x290a3b={'count':0x0,'rows':[]};var _0x1b9b3d=_[_0x1f1e('0x2f')](db[_0x1f1e('0x30')][_0x1f1e('0x31')],function(_0x5b1610){return{'name':_0x5b1610[_0x1f1e('0x32')],'type':_0x5b1610[_0x1f1e('0x33')][_0x1f1e('0x34')]};});_0x175372[_0x1f1e('0x35')]=_[_0x1f1e('0x2f')](_0x1b9b3d,_0x1f1e('0x2c'));_0x175372[_0x1f1e('0x36')]=_[_0x1f1e('0x37')](_0x420e4b['query']);_0x175372['filters']=_[_0x1f1e('0x38')](_0x175372['model'],_0x175372['query']);_0x2b24a6[_0x1f1e('0x39')]=_[_0x1f1e('0x38')](_0x175372[_0x1f1e('0x35')],qs[_0x1f1e('0x3a')](_0x420e4b[_0x1f1e('0x36')][_0x1f1e('0x3a')]));_0x2b24a6['attributes']=_0x2b24a6[_0x1f1e('0x39')][_0x1f1e('0x3b')]?_0x2b24a6[_0x1f1e('0x39')]:_0x175372['model'];if(!_0x420e4b[_0x1f1e('0x36')][_0x1f1e('0x3c')]('nolimit')){_0x2b24a6['limit']=qs['limit'](_0x420e4b['query'][_0x1f1e('0x21')]);_0x2b24a6['offset']=qs[_0x1f1e('0x1f')](_0x420e4b[_0x1f1e('0x36')]['offset']);}_0x2b24a6[_0x1f1e('0x3d')]=qs['sort'](_0x420e4b[_0x1f1e('0x36')]['sort']);_0x2b24a6[_0x1f1e('0x3e')]=qs[_0x1f1e('0x3f')](_[_0x1f1e('0x40')](_0x420e4b[_0x1f1e('0x36')],_0x175372[_0x1f1e('0x3f')]),_0x1b9b3d);if(_0x420e4b[_0x1f1e('0x36')][_0x1f1e('0x41')]){_0x2b24a6['where']=_[_0x1f1e('0x42')](_0x2b24a6['where'],{'$or':_[_0x1f1e('0x2f')](_0x1b9b3d,function(_0x5a29a9){if(_0x5a29a9['type']!==_0x1f1e('0x43')){var _0x5a531e={};_0x5a531e[_0x5a29a9[_0x1f1e('0x2c')]]={'$like':'%'+_0x420e4b[_0x1f1e('0x36')][_0x1f1e('0x41')]+'%'};return _0x5a531e;}})});}_0x2b24a6=_[_0x1f1e('0x42')]({},_0x2b24a6,_0x420e4b[_0x1f1e('0x44')]);var _0x4c8be8={'where':_0x2b24a6[_0x1f1e('0x3e')]};return db[_0x1f1e('0x30')][_0x1f1e('0x22')](_0x4c8be8)[_0x1f1e('0x29')](function(_0x2b2c74){_0x290a3b[_0x1f1e('0x22')]=_0x2b2c74;if(_0x420e4b['query']['includeAll']){_0x2b24a6[_0x1f1e('0x45')]=[{'all':!![]}];}return db[_0x1f1e('0x30')]['findAll'](_0x2b24a6);})['then'](function(_0x111919){_0x290a3b['rows']=_0x111919;return _0x290a3b;})[_0x1f1e('0x29')](respondWithFilteredResult(_0x52e414,_0x2b24a6))[_0x1f1e('0x46')](handleError(_0x52e414,null));};exports[_0x1f1e('0x47')]=function(_0xfeb040,_0x397f1f){var _0x4dff8b={'raw':![],'where':{'id':_0xfeb040[_0x1f1e('0x48')]['id']}},_0x23ae9c={};_0x23ae9c[_0x1f1e('0x35')]=_[_0x1f1e('0x37')](db[_0x1f1e('0x30')][_0x1f1e('0x31')]);_0x23ae9c[_0x1f1e('0x36')]=_[_0x1f1e('0x37')](_0xfeb040[_0x1f1e('0x36')]);_0x23ae9c[_0x1f1e('0x3f')]=_[_0x1f1e('0x38')](_0x23ae9c[_0x1f1e('0x35')],_0x23ae9c[_0x1f1e('0x36')]);_0x4dff8b[_0x1f1e('0x39')]=_[_0x1f1e('0x38')](_0x23ae9c[_0x1f1e('0x35')],qs[_0x1f1e('0x3a')](_0xfeb040['query']['fields']));_0x4dff8b['attributes']=_0x4dff8b[_0x1f1e('0x39')]['length']?_0x4dff8b[_0x1f1e('0x39')]:_0x23ae9c[_0x1f1e('0x35')];if(_0xfeb040[_0x1f1e('0x36')][_0x1f1e('0x49')]){_0x4dff8b[_0x1f1e('0x45')]=[{'all':!![]}];}_0x4dff8b=_['merge']({},_0x4dff8b,_0xfeb040['options']);return db[_0x1f1e('0x30')][_0x1f1e('0x4a')](_0x4dff8b)[_0x1f1e('0x29')](handleEntityNotFound(_0x397f1f,null))['then'](respondWithResult(_0x397f1f,null))[_0x1f1e('0x46')](handleError(_0x397f1f,null));};exports['create']=function(_0x2e187c,_0x207744){return db[_0x1f1e('0x30')]['create'](_0x2e187c['body'],{})[_0x1f1e('0x29')](respondWithResult(_0x207744,0xc9))['catch'](handleError(_0x207744,null));};exports[_0x1f1e('0x28')]=function(_0xc5ca52,_0x32037f){if(_0xc5ca52[_0x1f1e('0x4b')]['id']){delete _0xc5ca52[_0x1f1e('0x4b')]['id'];}return db['Dynamics365Account'][_0x1f1e('0x4a')]({'where':{'id':_0xc5ca52['params']['id']}})[_0x1f1e('0x29')](handleEntityNotFound(_0x32037f,null))['then'](saveUpdates(_0xc5ca52[_0x1f1e('0x4b')],null))[_0x1f1e('0x29')](respondWithResult(_0x32037f,null))['catch'](handleError(_0x32037f,null));};exports[_0x1f1e('0x2a')]=function(_0x48d5d9,_0x3a8b63){return db[_0x1f1e('0x30')]['find']({'where':{'id':_0x48d5d9[_0x1f1e('0x48')]['id']}})['then'](handleEntityNotFound(_0x3a8b63,null))[_0x1f1e('0x29')](removeEntity(_0x3a8b63,null))[_0x1f1e('0x46')](handleError(_0x3a8b63,null));};exports['getConfigurations']=function(_0x35c171,_0x4fe2c2,_0x5ee30e){var _0x59d805={};var _0x4e2adb={};var _0x2453c5;var _0x384f13;return db[_0x1f1e('0x30')][_0x1f1e('0x4c')]({'where':{'id':_0x35c171[_0x1f1e('0x48')]['id']}})['then'](handleEntityNotFound(_0x4fe2c2,null))[_0x1f1e('0x29')](function(_0xe5a15b){if(_0xe5a15b){_0x2453c5=_0xe5a15b;_0x4e2adb[_0x1f1e('0x35')]=_[_0x1f1e('0x37')](db[_0x1f1e('0x4d')][_0x1f1e('0x31')]);_0x4e2adb[_0x1f1e('0x36')]=_[_0x1f1e('0x37')](_0x35c171[_0x1f1e('0x36')]);_0x4e2adb[_0x1f1e('0x3f')]=_[_0x1f1e('0x38')](_0x4e2adb[_0x1f1e('0x35')],_0x4e2adb[_0x1f1e('0x36')]);_0x59d805[_0x1f1e('0x39')]=_['intersection'](_0x4e2adb[_0x1f1e('0x35')],qs['fields'](_0x35c171['query'][_0x1f1e('0x3a')]));_0x59d805[_0x1f1e('0x39')]=_0x59d805['attributes'][_0x1f1e('0x3b')]?_0x59d805[_0x1f1e('0x39')]:_0x4e2adb[_0x1f1e('0x35')];_0x59d805[_0x1f1e('0x3d')]=qs[_0x1f1e('0x4e')](_0x35c171[_0x1f1e('0x36')][_0x1f1e('0x4e')]);_0x59d805[_0x1f1e('0x3e')]=qs[_0x1f1e('0x3f')](_[_0x1f1e('0x40')](_0x35c171['query'],_0x4e2adb[_0x1f1e('0x3f')]));if(_0x35c171[_0x1f1e('0x36')][_0x1f1e('0x41')]){_0x59d805[_0x1f1e('0x3e')]=_[_0x1f1e('0x42')](_0x59d805[_0x1f1e('0x3e')],{'$or':_[_0x1f1e('0x2f')](_0x59d805[_0x1f1e('0x39')],function(_0x3e4d4c){var _0x15f9cf={};_0x15f9cf[_0x3e4d4c]={'$like':'%'+_0x35c171[_0x1f1e('0x36')]['filter']+'%'};return _0x15f9cf;})});}_0x59d805=_[_0x1f1e('0x42')]({},_0x59d805,_0x35c171['options']);return _0x2453c5['getConfigurations'](_0x59d805);}})[_0x1f1e('0x29')](function(_0x1a5dae){if(_0x1a5dae){_0x384f13=_0x1a5dae[_0x1f1e('0x3b')];if(!_0x35c171[_0x1f1e('0x36')]['hasOwnProperty'](_0x1f1e('0x4f'))){_0x59d805['limit']=qs[_0x1f1e('0x21')](_0x35c171[_0x1f1e('0x36')][_0x1f1e('0x21')]);_0x59d805[_0x1f1e('0x1f')]=qs[_0x1f1e('0x1f')](_0x35c171[_0x1f1e('0x36')]['offset']);}return _0x2453c5['getConfigurations'](_0x59d805);}})[_0x1f1e('0x29')](function(_0x2a8cfd){if(_0x2a8cfd){return _0x2a8cfd?{'count':_0x384f13,'rows':_0x2a8cfd}:null;}})[_0x1f1e('0x29')](respondWithResult(_0x4fe2c2,null))[_0x1f1e('0x46')](handleError(_0x4fe2c2,null));};exports[_0x1f1e('0x50')]=function(_0x5b02a1,_0x735dbd,_0x175450){if(_0x5b02a1[_0x1f1e('0x4b')]['id']){delete _0x5b02a1[_0x1f1e('0x4b')]['id'];}return db[_0x1f1e('0x30')][_0x1f1e('0x4c')]({'where':{'id':_0x5b02a1[_0x1f1e('0x48')]['id']}})[_0x1f1e('0x29')](handleEntityNotFound(_0x735dbd,null))['then'](function(_0x39d5fe){if(_0x39d5fe){_0x5b02a1[_0x1f1e('0x4b')][_0x1f1e('0x51')]=_0x39d5fe['id'];_0x5b02a1[_0x1f1e('0x4b')][_0x1f1e('0x52')]=integrations[_0x1f1e('0x53')](_0x5b02a1[_0x1f1e('0x4b')]['channel'],_0x5b02a1[_0x1f1e('0x4b')][_0x1f1e('0x33')]);_0x5b02a1[_0x1f1e('0x4b')][_0x1f1e('0x54')]=integrations[_0x1f1e('0x55')](_0x5b02a1[_0x1f1e('0x4b')][_0x1f1e('0x56')],_0x5b02a1['body']['type']);return db[_0x1f1e('0x4d')][_0x1f1e('0x57')](_0x5b02a1['body'],{'include':[{'model':db['Dynamics365Field'],'as':_0x1f1e('0x52')},{'model':db[_0x1f1e('0x58')],'as':'Descriptions'}]});}return null;})[_0x1f1e('0x29')](respondWithResult(_0x735dbd,null))['catch'](handleError(_0x735dbd,null));};exports[_0x1f1e('0x59')]=function(_0x59210c,_0xa22cca,_0x37ecd0){var _0x244a93=_0x59210c[_0x1f1e('0x36')][_0x1f1e('0x5a')];var _0x4af707=_0x244a93===_0x1f1e('0x5b')?'Incident':'PhoneCall';var _0x6eeb30='';var _0x456a7d='';var _0x43888f='';var _0x56abd0='';var _0x103a0f='';var _0x16922d='';var _0x5a72d2='';var _0x179f5f='';var _0x214b75=[_0x1f1e('0x5c'),'description',_0x1f1e('0x5d'),'ownerid',_0x1f1e('0x5e'),_0x1f1e('0x5f'),_0x1f1e('0x60'),_0x1f1e('0x61'),_0x1f1e('0x62'),_0x1f1e('0x63')];var _0x46bf8f=[_0x1f1e('0x64'),'accountidyominame','actualserviceunits',_0x1f1e('0x65'),_0x1f1e('0x66'),_0x1f1e('0x67'),_0x1f1e('0x68'),_0x1f1e('0x69'),_0x1f1e('0x6a'),_0x1f1e('0x6b'),_0x1f1e('0x6c'),_0x1f1e('0x6d'),'createdon','createdonbehalfbyname','createdonbehalfbyyominame',_0x1f1e('0x6e'),'customeridtype',_0x1f1e('0x6f'),_0x1f1e('0x70'),'entitlementidname',_0x1f1e('0x71'),_0x1f1e('0x72'),_0x1f1e('0x73'),_0x1f1e('0x74'),_0x1f1e('0x75'),_0x1f1e('0x76'),_0x1f1e('0x77'),_0x1f1e('0x78'),'kbarticleidname',_0x1f1e('0x79'),'masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame',_0x1f1e('0x7a'),_0x1f1e('0x7b'),_0x1f1e('0x7c'),'modifiedonbehalfbyname',_0x1f1e('0x7d'),_0x1f1e('0x7e'),_0x1f1e('0x7f'),_0x1f1e('0x80'),'onholdtime',_0x1f1e('0x81'),_0x1f1e('0x82'),_0x1f1e('0x83'),_0x1f1e('0x84'),_0x1f1e('0x85'),_0x1f1e('0x86'),_0x1f1e('0x87'),_0x1f1e('0x88'),'productidname',_0x1f1e('0x89'),_0x1f1e('0x8a'),_0x1f1e('0x8b'),_0x1f1e('0x8c'),_0x1f1e('0x8d'),'responsiblecontactidyominame',_0x1f1e('0x8e'),'slainvokedidname','slaname',_0x1f1e('0x8f'),_0x1f1e('0x90'),'statuscode',_0x1f1e('0x91'),_0x1f1e('0x92'),_0x1f1e('0x93'),_0x1f1e('0x94'),_0x1f1e('0x95'),_0x1f1e('0x96'),_0x1f1e('0x97')];var _0x2ddf51=_0x214b75[_0x1f1e('0x98')](_0x46bf8f);return db[_0x1f1e('0x30')]['findOne']({'where':{'id':_0x59210c[_0x1f1e('0x48')]['id']},'attributes':['id',_0x1f1e('0x99'),_0x1f1e('0x9a'),_0x1f1e('0x9b'),_0x1f1e('0x9c'),_0x1f1e('0x9d'),_0x1f1e('0x9e')]})[_0x1f1e('0x29')](handleEntityNotFound(_0xa22cca,null))[_0x1f1e('0x29')](function(_0x59a478){if(_0x59a478){_0x179f5f=_0x59a478[_0x1f1e('0x9b')];var _0x1fa3c4=_0x179f5f[_0x1f1e('0x9f')](-0x1);if(_0x1fa3c4==='/'){_0x179f5f=_0x179f5f[_0x1f1e('0xa0')](0x0,_0x179f5f[_0x1f1e('0xa1')](_0x1fa3c4));}_0x5a72d2=util[_0x1f1e('0xa2')](_0x1f1e('0xa3'),_0x179f5f);var _0x367051={'method':_0x1f1e('0xa4'),'uri':_0x1f1e('0xa5')+_0x59a478[_0x1f1e('0x9c')]+_0x1f1e('0xa6'),'form':{'client_id':_0x59a478[_0x1f1e('0x9d')],'resource':_0x179f5f,'username':_0x59a478[_0x1f1e('0x99')],'password':_0x59a478[_0x1f1e('0x9a')],'grant_type':_0x1f1e('0x9a'),'client_secret':_0x59a478['clientSecret']},'json':!![]};return rp(_0x367051);}})[_0x1f1e('0x29')](function(_0x1f6003){_0x16922d=_0x1f6003[_0x1f1e('0xa7')];var _0x11c507={'method':'GET','uri':encodeURI(_0x5a72d2+_0x1f1e('0xa8')+_0x4af707+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x16922d,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x11c507);})[_0x1f1e('0x29')](function(_0x5d32e8){var _0x3a6d2f=_0x5d32e8['value'][0x0];var _0x4f9218=_0x3a6d2f['MetadataId'];var _0x466ebe={'method':_0x1f1e('0xa9'),'uri':_0x5a72d2+'EntityDefinitions('+_0x4f9218+_0x1f1e('0xaa'),'headers':{'Authorization':_0x1f1e('0xab')+_0x16922d,'If-None-Match':null,'OData-Version':_0x1f1e('0xac')},'json':!![]};return rp(_0x466ebe);})[_0x1f1e('0x29')](function(_0x350c1c){_0x6eeb30=_0x350c1c;_0x456a7d=_0x6eeb30[_0x1f1e('0xad')];_0x456a7d=_[_0x1f1e('0xae')](_0x456a7d,function(_0xc49cc1){return!_0x2ddf51[_0x1f1e('0xaf')](_0xc49cc1['LogicalName']);});var _0x2f0381=[];var _0x284698=[];_0x456a7d[_0x1f1e('0xb0')](function(_0x12b2b6){if(_0x12b2b6[_0x1f1e('0xb1')]){var _0x451e8a=_0x12b2b6[_0x1f1e('0xb1')][_0x1f1e('0xa0')](_0x12b2b6['@odata.type'][_0x1f1e('0xa1')]('.')+0x1);if(_0x451e8a===_0x1f1e('0xb2')){_0x2f0381['push'](getSelectList(_0x5a72d2,_0x244a93,_0x284698,_0x6eeb30[_0x1f1e('0xb3')],_0x12b2b6['MetadataId'],_0x16922d));}}});return Promise[_0x1f1e('0xb4')](_0x2f0381);})[_0x1f1e('0x29')](function(_0x473bbb){_0x43888f=_0x473bbb[0x0];var _0x44b322=[];var _0x264b51=[];_0x456a7d[_0x1f1e('0xb0')](function(_0x4c71ae){if(!_[_0x1f1e('0xb5')](_0x4c71ae[_0x1f1e('0xb1')])){var _0x5482cf=_0x4c71ae['@odata.type']['substring'](_0x4c71ae[_0x1f1e('0xb1')]['lastIndexOf']('.')+0x1);if(_0x5482cf===_0x1f1e('0xb6')){_0x44b322[_0x1f1e('0xb7')](getBooleanList(_0x5a72d2,_0x244a93,_0x264b51,_0x6eeb30[_0x1f1e('0xb3')],_0x4c71ae[_0x1f1e('0xb3')],_0x16922d));}}});return Promise['all'](_0x44b322);})['then'](function(_0x489c06){_0x56abd0=_0x489c06[0x0];var _0x1593a3=[];var _0x347e14=[];_0x456a7d['forEach'](function(_0x45f60a){if(_0x45f60a['@odata.type']){var _0x459572=_0x45f60a[_0x1f1e('0xb1')][_0x1f1e('0xa0')](_0x45f60a[_0x1f1e('0xb1')]['lastIndexOf']('.')+0x1);if(_0x459572===_0x1f1e('0xb8')||_0x459572===_0x1f1e('0xb9')||_0x459572===_0x1f1e('0xba')||_0x459572===_0x1f1e('0xbb')||_0x459572===_0x1f1e('0xbc')||_0x459572===_0x1f1e('0xbd')||_0x459572==='StatusAttributeMetadata'||_0x459572===_0x1f1e('0xbe')||_0x459572==='StateAttributeMetadata'||_0x459572===_0x1f1e('0xbf')){_0x1593a3[_0x1f1e('0xb7')](getInputList(_0x5a72d2,_0x244a93,_0x459572,_0x347e14,_0x6eeb30[_0x1f1e('0xb3')],_0x45f60a[_0x1f1e('0xb3')],_0x16922d));}}});return Promise[_0x1f1e('0xb4')](_0x1593a3);})[_0x1f1e('0x29')](function(_0x32399e){_0x103a0f=_0x32399e[0x0];var _0x2af30a=_0x43888f[_0x1f1e('0x98')](_0x56abd0)[_0x1f1e('0x98')](_0x103a0f);var _0x2edd08={'count':_0x2af30a['length'],'rows':_0x2af30a};return _0x2edd08;})[_0x1f1e('0x29')](respondWithResult(_0xa22cca,null))[_0x1f1e('0x46')](function(_0x9b534d){var _0x1d3285=_0x59210c[_0x1f1e('0x36')]['test']?0x1f4:_0x9b534d['statusCode']||0x1f4;logger[_0x1f1e('0x2b')](_0x9b534d[_0x1f1e('0xc0')]);delete _0x9b534d[_0x1f1e('0x2c')];if(_0x1d3285===0x191){_0x1d3285=0x190;}_0xa22cca[_0x1f1e('0x1e')](_0x1d3285)[_0x1f1e('0x2d')](_0x59210c['query']['test']?{'message':_0x1f1e('0xc1'),'statusCode':_0x9b534d[_0x1f1e('0xc2')]}:_0x9b534d);});};function getSelectList(_0x3bcd3d,_0x3d12bb,_0x409675,_0x45c4b5,_0x2c78b0,_0x40799c){var _0x27d0bb={'method':_0x1f1e('0xa9'),'uri':_0x3bcd3d+_0x1f1e('0xc3')+_0x45c4b5+_0x1f1e('0xc4')+_0x2c78b0+_0x1f1e('0xc5')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x1f1e('0xab')+_0x40799c,'If-None-Match':null,'OData-Version':_0x1f1e('0xac')},'json':!![]};return rp(_0x27d0bb)[_0x1f1e('0x29')](function(_0x3b46c6){var _0x24f190=[];var _0x591425=_0x3b46c6[_0x1f1e('0xc6')][_0x1f1e('0xc7')];_0x591425['forEach'](function(_0x2254f5){_0x24f190['push']({'name':_0x2254f5['Label'][_0x1f1e('0xc8')][_0x1f1e('0xc9')],'value':String(_0x2254f5[_0x1f1e('0xca')])});});var _0x9b673e={'id':_0x3d12bb+'_'+_0x3b46c6['LogicalName'],'name':_0x3b46c6[_0x1f1e('0xcb')][_0x1f1e('0xc8')][_0x1f1e('0xc9')],'custom':![],'options':_0x24f190};_0x409675[_0x1f1e('0xb7')](_0x9b673e);return _0x409675;});}function getBooleanList(_0x18e90d,_0x2ac72e,_0x53681f,_0x504a27,_0x62e93,_0x1cb178){var _0x42e041={'method':_0x1f1e('0xa9'),'uri':_0x18e90d+_0x1f1e('0xc3')+_0x504a27+')/Attributes('+_0x62e93+_0x1f1e('0xcc'),'headers':{'Authorization':_0x1f1e('0xab')+_0x1cb178,'If-None-Match':null,'OData-Version':_0x1f1e('0xac')},'json':!![]};return rp(_0x42e041)[_0x1f1e('0x29')](function(_0x28cc5f){var _0x4ec390=[];_0x4ec390[_0x1f1e('0xb7')]({'name':_0x28cc5f[_0x1f1e('0xc6')][_0x1f1e('0xcd')][_0x1f1e('0xc9')][_0x1f1e('0xc8')]['Label'],'value':_0x1f1e('0xce')},{'name':_0x28cc5f[_0x1f1e('0xc6')]['FalseOption'][_0x1f1e('0xc9')][_0x1f1e('0xc8')][_0x1f1e('0xc9')],'value':_0x1f1e('0xcf')});var _0x28aa64={'id':_0x2ac72e+'_'+_0x28cc5f[_0x1f1e('0xd0')],'name':_0x28cc5f[_0x1f1e('0xcb')][_0x1f1e('0xc8')][_0x1f1e('0xc9')],'custom':![],'options':_0x4ec390};_0x53681f['push'](_0x28aa64);return _0x53681f;});}function getInputList(_0x2284dc,_0x41c23f,_0x45a4be,_0x52a18b,_0x1fce44,_0x30bea8,_0xb58bef){var _0x32126b={'method':'GET','uri':_0x2284dc+_0x1f1e('0xc3')+_0x1fce44+_0x1f1e('0xc4')+_0x30bea8+_0x1f1e('0xd1')+_0x45a4be+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x1f1e('0xab')+_0xb58bef,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x32126b)[_0x1f1e('0x29')](function(_0x229247){var _0x4c5ea5={'id':_0x41c23f+'_'+_0x229247[_0x1f1e('0xd0')],'name':_0x229247['DisplayName'][_0x1f1e('0xc8')]?_0x229247[_0x1f1e('0xcb')]['UserLocalizedLabel'][_0x1f1e('0xc9')]:_0x229247[_0x1f1e('0xd0')],'custom':![],'options':[]};_0x52a18b[_0x1f1e('0xb7')](_0x4c5ea5);return _0x52a18b;});} \ No newline at end of file +var _0x3248=['BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','send','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Options','Label','UserLocalizedLabel','Value','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','show','params','Dynamics365Account','rawAttributes','intersection','include','find','create','body','getConfigurations','Dynamics365Configuration','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','Subjects','getFields','Incident','title','description','caseorigincode','subject','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidname','prioritycodename','resolveby','resolvebykpiidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username','remoteUri','tenantId','clientId','clientSecret','slice','substring','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','password','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','forEach','@odata.type','lastIndexOf','push','MetadataId','all','isNil'];(function(_0x3839c1,_0x3377c3){var _0x1f15d9=function(_0x4e1996){while(--_0x4e1996){_0x3839c1['push'](_0x3839c1['shift']());}};_0x1f15d9(++_0x3377c3);}(_0x3248,0x1bc));var _0x8324=function(_0x4e007f,_0x36923d){_0x4e007f=_0x4e007f-0x0;var _0x183b2e=_0x3248[_0x4e007f];return _0x183b2e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8324('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8324('0x1'));var moment=require(_0x8324('0x2'));var BPromise=require(_0x8324('0x3'));var Mustache=require(_0x8324('0x4'));var util=require(_0x8324('0x5'));var path=require(_0x8324('0x6'));var sox=require('sox');var csv=require(_0x8324('0x7'));var ejs=require(_0x8324('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8324('0x9'));var squel=require(_0x8324('0xa'));var crypto=require(_0x8324('0xb'));var jsforce=require(_0x8324('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8324('0x7'));var querystring=require(_0x8324('0xd'));var Papa=require(_0x8324('0xe'));var Redis=require(_0x8324('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8324('0x10'));var as=require(_0x8324('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8324('0x12'))(_0x8324('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8324('0x14'))['db'];var integrations=require(_0x8324('0x15'));function respondWithStatusCode(_0x2aa8c1,_0x3619ec){_0x3619ec=_0x3619ec||0xcc;return function(_0x5f4d08){if(_0x5f4d08){return _0x2aa8c1[_0x8324('0x16')](_0x3619ec);}return _0x2aa8c1[_0x8324('0x17')](_0x3619ec)[_0x8324('0x18')]();};}function respondWithResult(_0x13a81f,_0x18a6fd){_0x18a6fd=_0x18a6fd||0xc8;return function(_0x48a712){if(_0x48a712){return _0x13a81f[_0x8324('0x17')](_0x18a6fd)[_0x8324('0x19')](_0x48a712);}};}function respondWithFilteredResult(_0x411e41,_0x3b1a18){return function(_0x3f8f66){if(_0x3f8f66){var _0x5ecb20=typeof _0x3b1a18[_0x8324('0x1a')]===_0x8324('0x1b')&&typeof _0x3b1a18[_0x8324('0x1c')]===_0x8324('0x1b');var _0x5af66a=_0x3f8f66['count'];var _0x47b5e1=_0x5ecb20?0x0:_0x3b1a18['offset'];var _0x1c4e04=_0x5ecb20?_0x3f8f66[_0x8324('0x1d')]:_0x3b1a18[_0x8324('0x1a')]+_0x3b1a18[_0x8324('0x1c')];var _0x50508e;if(_0x1c4e04>=_0x5af66a){_0x1c4e04=_0x5af66a;_0x50508e=0xc8;}else{_0x50508e=0xce;}_0x411e41[_0x8324('0x17')](_0x50508e);return _0x411e41[_0x8324('0x1e')](_0x8324('0x1f'),_0x47b5e1+'-'+_0x1c4e04+'/'+_0x5af66a)[_0x8324('0x19')](_0x3f8f66);}return null;};}function patchUpdates(_0x3c2254){return function(_0x4885a9){try{jsonpatch[_0x8324('0x20')](_0x4885a9,_0x3c2254,!![]);}catch(_0x7cb877){return BPromise[_0x8324('0x21')](_0x7cb877);}return _0x4885a9['save']();};}function saveUpdates(_0x378451,_0x864bf8){return function(_0x13bae7){if(_0x13bae7){return _0x13bae7[_0x8324('0x22')](_0x378451)[_0x8324('0x23')](function(_0x4d0e92){return _0x4d0e92;});}return null;};}function removeEntity(_0x21c707,_0x351079){return function(_0x5274a1){if(_0x5274a1){return _0x5274a1[_0x8324('0x24')]()[_0x8324('0x23')](function(){_0x21c707[_0x8324('0x17')](0xcc)[_0x8324('0x18')]();});}};}function handleEntityNotFound(_0x2c398f,_0x4fc210){return function(_0x575845){if(!_0x575845){_0x2c398f[_0x8324('0x16')](0x194);}return _0x575845;};}function handleError(_0x3569db,_0x3e78f2){_0x3e78f2=_0x3e78f2||0x1f4;return function(_0x3e70fe){logger[_0x8324('0x25')](_0x3e70fe[_0x8324('0x26')]);if(_0x3e70fe['name']){delete _0x3e70fe[_0x8324('0x27')];}_0x3569db['status'](_0x3e78f2)['send'](_0x3e70fe);};}exports[_0x8324('0x28')]=function(_0x3afd87,_0x28ba63){var _0x2cf245={},_0x312f7e={},_0x4926f2={'count':0x0,'rows':[]};var _0x4cad69=_[_0x8324('0x29')](db['Dynamics365Account']['rawAttributes'],function(_0x562798){return{'name':_0x562798['fieldName'],'type':_0x562798['type'][_0x8324('0x2a')]};});_0x312f7e[_0x8324('0x2b')]=_[_0x8324('0x29')](_0x4cad69,_0x8324('0x27'));_0x312f7e['query']=_[_0x8324('0x2c')](_0x3afd87[_0x8324('0x2d')]);_0x312f7e[_0x8324('0x2e')]=_['intersection'](_0x312f7e[_0x8324('0x2b')],_0x312f7e[_0x8324('0x2d')]);_0x2cf245[_0x8324('0x2f')]=_['intersection'](_0x312f7e[_0x8324('0x2b')],qs[_0x8324('0x30')](_0x3afd87['query'][_0x8324('0x30')]));_0x2cf245[_0x8324('0x2f')]=_0x2cf245[_0x8324('0x2f')][_0x8324('0x31')]?_0x2cf245[_0x8324('0x2f')]:_0x312f7e[_0x8324('0x2b')];if(!_0x3afd87[_0x8324('0x2d')][_0x8324('0x32')](_0x8324('0x33'))){_0x2cf245[_0x8324('0x1c')]=qs[_0x8324('0x1c')](_0x3afd87['query'][_0x8324('0x1c')]);_0x2cf245[_0x8324('0x1a')]=qs[_0x8324('0x1a')](_0x3afd87[_0x8324('0x2d')][_0x8324('0x1a')]);}_0x2cf245[_0x8324('0x34')]=qs[_0x8324('0x35')](_0x3afd87['query'][_0x8324('0x35')]);_0x2cf245[_0x8324('0x36')]=qs[_0x8324('0x2e')](_[_0x8324('0x37')](_0x3afd87[_0x8324('0x2d')],_0x312f7e[_0x8324('0x2e')]),_0x4cad69);if(_0x3afd87[_0x8324('0x2d')][_0x8324('0x38')]){_0x2cf245['where']=_[_0x8324('0x39')](_0x2cf245[_0x8324('0x36')],{'$or':_[_0x8324('0x29')](_0x4cad69,function(_0x29a163){if(_0x29a163[_0x8324('0x3a')]!==_0x8324('0x3b')){var _0x1fb84f={};_0x1fb84f[_0x29a163[_0x8324('0x27')]]={'$like':'%'+_0x3afd87[_0x8324('0x2d')][_0x8324('0x38')]+'%'};return _0x1fb84f;}})});}_0x2cf245=_['merge']({},_0x2cf245,_0x3afd87[_0x8324('0x3c')]);var _0x2845b3={'where':_0x2cf245[_0x8324('0x36')]};return db['Dynamics365Account'][_0x8324('0x1d')](_0x2845b3)[_0x8324('0x23')](function(_0x274438){_0x4926f2['count']=_0x274438;if(_0x3afd87[_0x8324('0x2d')][_0x8324('0x3d')]){_0x2cf245['include']=[{'all':!![]}];}return db['Dynamics365Account']['findAll'](_0x2cf245);})[_0x8324('0x23')](function(_0x47f5a0){_0x4926f2[_0x8324('0x3e')]=_0x47f5a0;return _0x4926f2;})[_0x8324('0x23')](respondWithFilteredResult(_0x28ba63,_0x2cf245))[_0x8324('0x3f')](handleError(_0x28ba63,null));};exports[_0x8324('0x40')]=function(_0x3a59e2,_0x61df46){var _0x1e7d11={'raw':![],'where':{'id':_0x3a59e2[_0x8324('0x41')]['id']}},_0x5e1fb8={};_0x5e1fb8[_0x8324('0x2b')]=_[_0x8324('0x2c')](db[_0x8324('0x42')][_0x8324('0x43')]);_0x5e1fb8['query']=_[_0x8324('0x2c')](_0x3a59e2[_0x8324('0x2d')]);_0x5e1fb8[_0x8324('0x2e')]=_[_0x8324('0x44')](_0x5e1fb8[_0x8324('0x2b')],_0x5e1fb8[_0x8324('0x2d')]);_0x1e7d11['attributes']=_[_0x8324('0x44')](_0x5e1fb8[_0x8324('0x2b')],qs['fields'](_0x3a59e2[_0x8324('0x2d')][_0x8324('0x30')]));_0x1e7d11['attributes']=_0x1e7d11[_0x8324('0x2f')][_0x8324('0x31')]?_0x1e7d11[_0x8324('0x2f')]:_0x5e1fb8[_0x8324('0x2b')];if(_0x3a59e2[_0x8324('0x2d')][_0x8324('0x3d')]){_0x1e7d11[_0x8324('0x45')]=[{'all':!![]}];}_0x1e7d11=_[_0x8324('0x39')]({},_0x1e7d11,_0x3a59e2[_0x8324('0x3c')]);return db['Dynamics365Account'][_0x8324('0x46')](_0x1e7d11)[_0x8324('0x23')](handleEntityNotFound(_0x61df46,null))[_0x8324('0x23')](respondWithResult(_0x61df46,null))['catch'](handleError(_0x61df46,null));};exports[_0x8324('0x47')]=function(_0x1bf120,_0x489b2a){return db[_0x8324('0x42')][_0x8324('0x47')](_0x1bf120['body'],{})['then'](respondWithResult(_0x489b2a,0xc9))['catch'](handleError(_0x489b2a,null));};exports['update']=function(_0x1ddee1,_0x4f34a1){if(_0x1ddee1[_0x8324('0x48')]['id']){delete _0x1ddee1[_0x8324('0x48')]['id'];}return db[_0x8324('0x42')][_0x8324('0x46')]({'where':{'id':_0x1ddee1[_0x8324('0x41')]['id']}})[_0x8324('0x23')](handleEntityNotFound(_0x4f34a1,null))['then'](saveUpdates(_0x1ddee1[_0x8324('0x48')],null))[_0x8324('0x23')](respondWithResult(_0x4f34a1,null))[_0x8324('0x3f')](handleError(_0x4f34a1,null));};exports[_0x8324('0x24')]=function(_0xe2a537,_0x18d9b8){return db['Dynamics365Account'][_0x8324('0x46')]({'where':{'id':_0xe2a537['params']['id']}})[_0x8324('0x23')](handleEntityNotFound(_0x18d9b8,null))[_0x8324('0x23')](removeEntity(_0x18d9b8,null))[_0x8324('0x3f')](handleError(_0x18d9b8,null));};exports[_0x8324('0x49')]=function(_0x53acd6,_0x25358e,_0x283254){var _0x135aa1={};var _0x3d161c={};var _0x55e653;var _0x386479;return db[_0x8324('0x42')]['findOne']({'where':{'id':_0x53acd6['params']['id']}})[_0x8324('0x23')](handleEntityNotFound(_0x25358e,null))[_0x8324('0x23')](function(_0x591a89){if(_0x591a89){_0x55e653=_0x591a89;_0x3d161c[_0x8324('0x2b')]=_[_0x8324('0x2c')](db[_0x8324('0x4a')]['rawAttributes']);_0x3d161c[_0x8324('0x2d')]=_[_0x8324('0x2c')](_0x53acd6[_0x8324('0x2d')]);_0x3d161c[_0x8324('0x2e')]=_[_0x8324('0x44')](_0x3d161c[_0x8324('0x2b')],_0x3d161c[_0x8324('0x2d')]);_0x135aa1[_0x8324('0x2f')]=_[_0x8324('0x44')](_0x3d161c[_0x8324('0x2b')],qs[_0x8324('0x30')](_0x53acd6[_0x8324('0x2d')][_0x8324('0x30')]));_0x135aa1[_0x8324('0x2f')]=_0x135aa1['attributes'][_0x8324('0x31')]?_0x135aa1[_0x8324('0x2f')]:_0x3d161c['model'];_0x135aa1[_0x8324('0x34')]=qs[_0x8324('0x35')](_0x53acd6[_0x8324('0x2d')][_0x8324('0x35')]);_0x135aa1['where']=qs[_0x8324('0x2e')](_[_0x8324('0x37')](_0x53acd6[_0x8324('0x2d')],_0x3d161c[_0x8324('0x2e')]));if(_0x53acd6[_0x8324('0x2d')][_0x8324('0x38')]){_0x135aa1[_0x8324('0x36')]=_[_0x8324('0x39')](_0x135aa1['where'],{'$or':_[_0x8324('0x29')](_0x135aa1[_0x8324('0x2f')],function(_0x49a5de){var _0x375b82={};_0x375b82[_0x49a5de]={'$like':'%'+_0x53acd6[_0x8324('0x2d')][_0x8324('0x38')]+'%'};return _0x375b82;})});}_0x135aa1=_[_0x8324('0x39')]({},_0x135aa1,_0x53acd6[_0x8324('0x3c')]);return _0x55e653[_0x8324('0x49')](_0x135aa1);}})['then'](function(_0x2263a3){if(_0x2263a3){_0x386479=_0x2263a3['length'];if(!_0x53acd6[_0x8324('0x2d')][_0x8324('0x32')](_0x8324('0x33'))){_0x135aa1[_0x8324('0x1c')]=qs[_0x8324('0x1c')](_0x53acd6[_0x8324('0x2d')][_0x8324('0x1c')]);_0x135aa1[_0x8324('0x1a')]=qs[_0x8324('0x1a')](_0x53acd6[_0x8324('0x2d')][_0x8324('0x1a')]);}return _0x55e653[_0x8324('0x49')](_0x135aa1);}})[_0x8324('0x23')](function(_0x5b082a){if(_0x5b082a){return _0x5b082a?{'count':_0x386479,'rows':_0x5b082a}:null;}})[_0x8324('0x23')](respondWithResult(_0x25358e,null))['catch'](handleError(_0x25358e,null));};exports[_0x8324('0x4b')]=function(_0x12116a,_0x4f78ec,_0x64c32f){if(_0x12116a[_0x8324('0x48')]['id']){delete _0x12116a[_0x8324('0x48')]['id'];}return db[_0x8324('0x42')][_0x8324('0x4c')]({'where':{'id':_0x12116a['params']['id']}})['then'](handleEntityNotFound(_0x4f78ec,null))['then'](function(_0x2044b1){if(_0x2044b1){_0x12116a['body'][_0x8324('0x4d')]=_0x2044b1['id'];_0x12116a[_0x8324('0x48')]['Subjects']=integrations[_0x8324('0x4e')](_0x12116a[_0x8324('0x48')][_0x8324('0x4f')],_0x12116a['body']['type']);_0x12116a['body'][_0x8324('0x50')]=integrations[_0x8324('0x51')](_0x12116a[_0x8324('0x48')]['channel'],_0x12116a[_0x8324('0x48')]['type']);return db[_0x8324('0x4a')][_0x8324('0x47')](_0x12116a['body'],{'include':[{'model':db[_0x8324('0x52')],'as':_0x8324('0x53')},{'model':db[_0x8324('0x52')],'as':_0x8324('0x50')}]});}return null;})[_0x8324('0x23')](respondWithResult(_0x4f78ec,null))[_0x8324('0x3f')](handleError(_0x4f78ec,null));};exports[_0x8324('0x54')]=function(_0x3e30dc,_0x1a0f9f,_0x2a6964){var _0x5228d0=_0x3e30dc[_0x8324('0x2d')]['ticketType'];var _0x3a9696=_0x5228d0==='incident'?_0x8324('0x55'):'PhoneCall';var _0x3674ce='';var _0x35879e='';var _0x283836='';var _0x184b5b='';var _0x495a8b='';var _0x392a69='';var _0x4d6188='';var _0x2889a9='';var _0xee0e2=[_0x8324('0x56'),_0x8324('0x57'),'customerid','ownerid',_0x8324('0x58'),_0x8324('0x59'),'phonenumber',_0x8324('0x5a'),_0x8324('0x5b'),_0x8324('0x5c')];var _0x37d633=[_0x8324('0x5d'),_0x8324('0x5e'),_0x8324('0x5f'),_0x8324('0x60'),_0x8324('0x61'),_0x8324('0x62'),_0x8324('0x63'),'contractidname',_0x8324('0x64'),_0x8324('0x65'),_0x8324('0x66'),_0x8324('0x67'),_0x8324('0x68'),'createdonbehalfbyname','createdonbehalfbyyominame',_0x8324('0x69'),_0x8324('0x6a'),_0x8324('0x6b'),_0x8324('0x6c'),_0x8324('0x6d'),_0x8324('0x6e'),_0x8324('0x6f'),_0x8324('0x70'),_0x8324('0x71'),_0x8324('0x72'),_0x8324('0x73'),_0x8324('0x74'),_0x8324('0x75'),'kbarticleidname',_0x8324('0x76'),_0x8324('0x77'),_0x8324('0x78'),_0x8324('0x79'),_0x8324('0x7a'),_0x8324('0x7b'),'modifiedon',_0x8324('0x7c'),_0x8324('0x7d'),_0x8324('0x7e'),_0x8324('0x7f'),_0x8324('0x80'),'onholdtime',_0x8324('0x81'),_0x8324('0x82'),_0x8324('0x83'),'owneridyominame',_0x8324('0x84'),_0x8324('0x85'),'primarycontactidyominame',_0x8324('0x86'),'productidname','productserialnumber',_0x8324('0x87'),_0x8324('0x88'),'responseby','responsiblecontactidname',_0x8324('0x89'),_0x8324('0x8a'),_0x8324('0x8b'),'slaname','socialprofileidname',_0x8324('0x8c'),_0x8324('0x8d'),_0x8324('0x8e'),_0x8324('0x8f'),_0x8324('0x90'),_0x8324('0x91'),_0x8324('0x92'),_0x8324('0x93'),'versionnumber'];var _0x25134d=_0xee0e2[_0x8324('0x94')](_0x37d633);return db[_0x8324('0x42')][_0x8324('0x4c')]({'where':{'id':_0x3e30dc[_0x8324('0x41')]['id']},'attributes':['id',_0x8324('0x95'),'password',_0x8324('0x96'),_0x8324('0x97'),_0x8324('0x98'),_0x8324('0x99')]})[_0x8324('0x23')](handleEntityNotFound(_0x1a0f9f,null))['then'](function(_0x182bfe){if(_0x182bfe){_0x2889a9=_0x182bfe['remoteUri'];var _0x9c5551=_0x2889a9[_0x8324('0x9a')](-0x1);if(_0x9c5551==='/'){_0x2889a9=_0x2889a9[_0x8324('0x9b')](0x0,_0x2889a9['lastIndexOf'](_0x9c5551));}_0x4d6188=util[_0x8324('0x9c')](_0x8324('0x9d'),_0x2889a9);var _0x56a41c={'method':_0x8324('0x9e'),'uri':_0x8324('0x9f')+_0x182bfe[_0x8324('0x97')]+_0x8324('0xa0'),'form':{'client_id':_0x182bfe[_0x8324('0x98')],'resource':_0x2889a9,'username':_0x182bfe[_0x8324('0x95')],'password':_0x182bfe['password'],'grant_type':_0x8324('0xa1'),'client_secret':_0x182bfe[_0x8324('0x99')]},'json':!![]};return rp(_0x56a41c);}})[_0x8324('0x23')](function(_0x3aed31){_0x392a69=_0x3aed31[_0x8324('0xa2')];var _0x47d045={'method':_0x8324('0xa3'),'uri':encodeURI(_0x4d6188+_0x8324('0xa4')+_0x3a9696+'\x27'),'headers':{'Authorization':_0x8324('0xa5')+_0x392a69,'If-None-Match':null,'OData-Version':_0x8324('0xa6')},'json':!![]};return rp(_0x47d045);})[_0x8324('0x23')](function(_0x5e82dd){var _0x72b9bb=_0x5e82dd[_0x8324('0xa7')][0x0];var _0x482af2=_0x72b9bb['MetadataId'];var _0x405d3a={'method':_0x8324('0xa3'),'uri':_0x4d6188+_0x8324('0xa8')+_0x482af2+_0x8324('0xa9'),'headers':{'Authorization':_0x8324('0xa5')+_0x392a69,'If-None-Match':null,'OData-Version':_0x8324('0xa6')},'json':!![]};return rp(_0x405d3a);})[_0x8324('0x23')](function(_0x1e7211){_0x3674ce=_0x1e7211;_0x35879e=_0x3674ce[_0x8324('0xaa')];_0x35879e=_[_0x8324('0xab')](_0x35879e,function(_0x24374b){return!_0x25134d[_0x8324('0xac')](_0x24374b['LogicalName']);});var _0x44fd41=[];var _0x23a104=[];_0x35879e[_0x8324('0xad')](function(_0x2ad099){if(_0x2ad099[_0x8324('0xae')]){var _0x3af575=_0x2ad099['@odata.type'][_0x8324('0x9b')](_0x2ad099['@odata.type'][_0x8324('0xaf')]('.')+0x1);if(_0x3af575==='PicklistAttributeMetadata'){_0x44fd41[_0x8324('0xb0')](getSelectList(_0x4d6188,_0x5228d0,_0x23a104,_0x3674ce[_0x8324('0xb1')],_0x2ad099[_0x8324('0xb1')],_0x392a69));}}});return Promise[_0x8324('0xb2')](_0x44fd41);})['then'](function(_0x35d7ab){_0x283836=_0x35d7ab[0x0];var _0x1f28ee=[];var _0x19a0e9=[];_0x35879e[_0x8324('0xad')](function(_0x3ca9b0){if(!_[_0x8324('0xb3')](_0x3ca9b0[_0x8324('0xae')])){var _0x2eb326=_0x3ca9b0[_0x8324('0xae')][_0x8324('0x9b')](_0x3ca9b0[_0x8324('0xae')]['lastIndexOf']('.')+0x1);if(_0x2eb326===_0x8324('0xb4')){_0x1f28ee[_0x8324('0xb0')](getBooleanList(_0x4d6188,_0x5228d0,_0x19a0e9,_0x3674ce[_0x8324('0xb1')],_0x3ca9b0['MetadataId'],_0x392a69));}}});return Promise[_0x8324('0xb2')](_0x1f28ee);})[_0x8324('0x23')](function(_0x214b11){_0x184b5b=_0x214b11[0x0];var _0x540df1=[];var _0x4b15e6=[];_0x35879e[_0x8324('0xad')](function(_0x43fa7e){if(_0x43fa7e[_0x8324('0xae')]){var _0x2c0342=_0x43fa7e['@odata.type'][_0x8324('0x9b')](_0x43fa7e[_0x8324('0xae')][_0x8324('0xaf')]('.')+0x1);if(_0x2c0342===_0x8324('0xb5')||_0x2c0342===_0x8324('0xb6')||_0x2c0342===_0x8324('0xb7')||_0x2c0342===_0x8324('0xb8')||_0x2c0342===_0x8324('0xb9')||_0x2c0342==='DateTimeAttributeMetadata'||_0x2c0342===_0x8324('0xba')||_0x2c0342===_0x8324('0xbb')||_0x2c0342===_0x8324('0xbc')||_0x2c0342===_0x8324('0xbd')){_0x540df1[_0x8324('0xb0')](getInputList(_0x4d6188,_0x5228d0,_0x2c0342,_0x4b15e6,_0x3674ce[_0x8324('0xb1')],_0x43fa7e[_0x8324('0xb1')],_0x392a69));}}});return Promise[_0x8324('0xb2')](_0x540df1);})[_0x8324('0x23')](function(_0x4564e8){_0x495a8b=_0x4564e8[0x0];var _0x199a99=_0x283836[_0x8324('0x94')](_0x184b5b)[_0x8324('0x94')](_0x495a8b);var _0x2e5f75={'count':_0x199a99[_0x8324('0x31')],'rows':_0x199a99};return _0x2e5f75;})[_0x8324('0x23')](respondWithResult(_0x1a0f9f,null))[_0x8324('0x3f')](function(_0x3dbbe9){var _0x2d98e9=_0x3e30dc['query'][_0x8324('0xbe')]?0x1f4:_0x3dbbe9[_0x8324('0xbf')]||0x1f4;logger['error'](_0x3dbbe9[_0x8324('0x26')]);delete _0x3dbbe9['name'];if(_0x2d98e9===0x191){_0x2d98e9=0x190;}_0x1a0f9f[_0x8324('0x17')](_0x2d98e9)[_0x8324('0xc0')](_0x3e30dc[_0x8324('0x2d')][_0x8324('0xbe')]?{'message':_0x8324('0xc1'),'statusCode':_0x3dbbe9[_0x8324('0xbf')]}:_0x3dbbe9);});};function getSelectList(_0x5dc4a5,_0xbc4ee0,_0x5a1a23,_0x23163a,_0x351b0b,_0xa7172e){var _0x43439a={'method':_0x8324('0xa3'),'uri':_0x5dc4a5+'EntityDefinitions('+_0x23163a+_0x8324('0xc2')+_0x351b0b+_0x8324('0xc3')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x8324('0xa5')+_0xa7172e,'If-None-Match':null,'OData-Version':_0x8324('0xa6')},'json':!![]};return rp(_0x43439a)['then'](function(_0x2bd33e){var _0x2c77ea=[];var _0xc97a1c=_0x2bd33e['OptionSet'][_0x8324('0xc4')];_0xc97a1c[_0x8324('0xad')](function(_0x68b32f){_0x2c77ea[_0x8324('0xb0')]({'name':_0x68b32f[_0x8324('0xc5')][_0x8324('0xc6')]['Label'],'value':String(_0x68b32f[_0x8324('0xc7')])});});var _0x455953={'id':_0xbc4ee0+'_'+_0x2bd33e[_0x8324('0xc8')],'name':_0x2bd33e[_0x8324('0xc9')][_0x8324('0xc6')][_0x8324('0xc5')],'custom':![],'options':_0x2c77ea};_0x5a1a23[_0x8324('0xb0')](_0x455953);return _0x5a1a23;});}function getBooleanList(_0x42b3be,_0x58176c,_0x2bccd5,_0xcddee5,_0x393191,_0xda8c38){var _0xa809a5={'method':_0x8324('0xa3'),'uri':_0x42b3be+_0x8324('0xa8')+_0xcddee5+_0x8324('0xc2')+_0x393191+_0x8324('0xca'),'headers':{'Authorization':_0x8324('0xa5')+_0xda8c38,'If-None-Match':null,'OData-Version':_0x8324('0xa6')},'json':!![]};return rp(_0xa809a5)[_0x8324('0x23')](function(_0x35174d){var _0x4c4df8=[];_0x4c4df8[_0x8324('0xb0')]({'name':_0x35174d[_0x8324('0xcb')][_0x8324('0xcc')][_0x8324('0xc5')][_0x8324('0xc6')][_0x8324('0xc5')],'value':'true'},{'name':_0x35174d[_0x8324('0xcb')]['FalseOption'][_0x8324('0xc5')][_0x8324('0xc6')]['Label'],'value':_0x8324('0xcd')});var _0x333346={'id':_0x58176c+'_'+_0x35174d['LogicalName'],'name':_0x35174d[_0x8324('0xc9')][_0x8324('0xc6')][_0x8324('0xc5')],'custom':![],'options':_0x4c4df8};_0x2bccd5[_0x8324('0xb0')](_0x333346);return _0x2bccd5;});}function getInputList(_0x235c7c,_0x26f3df,_0x5e62d7,_0x2ffe33,_0x2c7d9c,_0x273818,_0x376cba){var _0xd22927={'method':_0x8324('0xa3'),'uri':_0x235c7c+_0x8324('0xa8')+_0x2c7d9c+_0x8324('0xc2')+_0x273818+_0x8324('0xce')+_0x5e62d7+_0x8324('0xcf'),'headers':{'Authorization':_0x8324('0xa5')+_0x376cba,'If-None-Match':null,'OData-Version':_0x8324('0xa6')},'json':!![]};return rp(_0xd22927)[_0x8324('0x23')](function(_0x51f253){var _0x63a4e0={'id':_0x26f3df+'_'+_0x51f253[_0x8324('0xc8')],'name':_0x51f253[_0x8324('0xc9')][_0x8324('0xc6')]?_0x51f253[_0x8324('0xc9')][_0x8324('0xc6')][_0x8324('0xc5')]:_0x51f253[_0x8324('0xc8')],'custom':![],'options':[]};_0x2ffe33[_0x8324('0xb0')](_0x63a4e0);return _0x2ffe33;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 85eb659..451a6a7 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 _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x585f64,_0x35323b){var _0x2aafbf=function(_0xc9dcf6){while(--_0xc9dcf6){_0x585f64['push'](_0x585f64['shift']());}};_0x2aafbf(++_0x35323b);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xb7e7[_0x2f3848];return _0x102668;};'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'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x439fcb,_0x184d22){var _0x3d223e=function(_0x34d507){while(--_0x34d507){_0x439fcb['push'](_0x439fcb['shift']());}};_0x3d223e(++_0x184d22);}(_0xe706,0xa3));var _0x6e70=function(_0xfd3d87,_0x10aa44){_0xfd3d87=_0xfd3d87-0x0;var _0x21fc4a=_0xe706[_0xfd3d87];return _0x21fc4a;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index dd0cfaa..2a8b7d8 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 _0x6e1a=['debug','error','code','Dynamics365Account,\x20%s,\x20%s','message','options','raw','where','attributes','limit','include','map','model','GetDynamics365Account','stringify','catch','ShowDynamics365Account','Dynamics365Account','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x3ddd8b,_0x1cbd68){var _0x37d6aa=function(_0x517f36){while(--_0x517f36){_0x3ddd8b['push'](_0x3ddd8b['shift']());}};_0x37d6aa(++_0x1cbd68);}(_0x6e1a,0x167));var _0xa6e1=function(_0x4daee3,_0x2add6d){_0x4daee3=_0x4daee3-0x0;var _0x505c1b=_0x6e1a[_0x4daee3];return _0x505c1b;};'use strict';var _=require('lodash');var util=require(_0xa6e1('0x0'));var moment=require(_0xa6e1('0x1'));var BPromise=require(_0xa6e1('0x2'));var rs=require(_0xa6e1('0x3'));var fs=require('fs');var Redis=require(_0xa6e1('0x4'));var db=require(_0xa6e1('0x5'))['db'];var utils=require(_0xa6e1('0x6'));var logger=require('../../config/logger')(_0xa6e1('0x7'));var config=require('../../config/environment');var jayson=require(_0xa6e1('0x8'));var client=jayson[_0xa6e1('0x9')][_0xa6e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7917e4,_0x4b093c,_0x7bb8a2){return new BPromise(function(_0x282fb3,_0x43f9b8){return client[_0xa6e1('0xb')](_0x7917e4,_0x7bb8a2)[_0xa6e1('0xc')](function(_0x3a74c9){logger[_0xa6e1('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x4b093c,_0xa6e1('0xe'));logger[_0xa6e1('0xf')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x4b093c,_0xa6e1('0xe'),JSON['stringify'](_0x3a74c9));if(_0x3a74c9['error']){if(_0x3a74c9[_0xa6e1('0x10')][_0xa6e1('0x11')]===0x1f4){logger[_0xa6e1('0x10')](_0xa6e1('0x12'),_0x4b093c,_0x3a74c9[_0xa6e1('0x10')][_0xa6e1('0x13')]);return _0x43f9b8(_0x3a74c9[_0xa6e1('0x10')][_0xa6e1('0x13')]);}logger[_0xa6e1('0x10')](_0xa6e1('0x12'),_0x4b093c,_0x3a74c9[_0xa6e1('0x10')]['message']);return _0x282fb3(_0x3a74c9[_0xa6e1('0x10')]['message']);}else{logger['info'](_0xa6e1('0x12'),_0x4b093c,_0xa6e1('0xe'));_0x282fb3(_0x3a74c9['result']['message']);}})['catch'](function(_0xaa3421){logger['error'](_0xa6e1('0x12'),_0x4b093c,_0xaa3421);_0x43f9b8(_0xaa3421);});});}exports['GetDynamics365Account']=function(_0x5b1fa7){var _0x1cf590=this;return new Promise(function(_0x5cf826,_0x4acb4e){return db['Dynamics365Account']['findAll']({'raw':_0x5b1fa7['options']?_0x5b1fa7[_0xa6e1('0x14')][_0xa6e1('0x15')]===undefined?!![]:![]:!![],'where':_0x5b1fa7[_0xa6e1('0x14')]?_0x5b1fa7[_0xa6e1('0x14')][_0xa6e1('0x16')]||null:null,'attributes':_0x5b1fa7['options']?_0x5b1fa7[_0xa6e1('0x14')][_0xa6e1('0x17')]||null:null,'limit':_0x5b1fa7['options']?_0x5b1fa7[_0xa6e1('0x14')][_0xa6e1('0x18')]||null:null,'include':_0x5b1fa7[_0xa6e1('0x14')]?_0x5b1fa7[_0xa6e1('0x14')][_0xa6e1('0x19')]?_[_0xa6e1('0x1a')](_0x5b1fa7[_0xa6e1('0x14')][_0xa6e1('0x19')],function(_0x53b11b){return{'model':db[_0x53b11b[_0xa6e1('0x1b')]],'as':_0x53b11b['as'],'attributes':_0x53b11b[_0xa6e1('0x17')],'include':_0x53b11b[_0xa6e1('0x19')]?_[_0xa6e1('0x1a')](_0x53b11b[_0xa6e1('0x19')],function(_0x648227){return{'model':db[_0x648227[_0xa6e1('0x1b')]],'as':_0x648227['as'],'attributes':_0x648227['attributes'],'include':_0x648227['include']?_[_0xa6e1('0x1a')](_0x648227[_0xa6e1('0x19')],function(_0x223b8e){return{'model':db[_0x223b8e[_0xa6e1('0x1b')]],'as':_0x223b8e['as'],'attributes':_0x223b8e[_0xa6e1('0x17')]};}):[]};}):[]};}):[]:[]})[_0xa6e1('0xc')](function(_0x3a23fe){logger[_0xa6e1('0xd')](_0xa6e1('0x1c'),_0x5b1fa7);logger[_0xa6e1('0xf')](_0xa6e1('0x1c'),_0x5b1fa7,JSON[_0xa6e1('0x1d')](_0x3a23fe));_0x5cf826(_0x3a23fe);})[_0xa6e1('0x1e')](function(_0x5ccdc4){logger[_0xa6e1('0x10')](_0xa6e1('0x1c'),_0x5ccdc4[_0xa6e1('0x13')],_0x5b1fa7);_0x4acb4e(_0x1cf590[_0xa6e1('0x10')](0x1f4,_0x5ccdc4[_0xa6e1('0x13')]));});});};exports[_0xa6e1('0x1f')]=function(_0xb066d){var _0x4f4ce6=this;return new Promise(function(_0x4a8850,_0x33a6ea){return db[_0xa6e1('0x20')][_0xa6e1('0x21')]({'raw':_0xb066d['options']?_0xb066d[_0xa6e1('0x14')][_0xa6e1('0x15')]===undefined?!![]:![]:!![],'where':_0xb066d['options']?_0xb066d[_0xa6e1('0x14')][_0xa6e1('0x16')]||null:null,'attributes':_0xb066d[_0xa6e1('0x14')]?_0xb066d[_0xa6e1('0x14')][_0xa6e1('0x17')]||null:null,'include':_0xb066d[_0xa6e1('0x14')]?_0xb066d[_0xa6e1('0x14')][_0xa6e1('0x19')]?_['map'](_0xb066d[_0xa6e1('0x14')][_0xa6e1('0x19')],function(_0x3c9e64){return{'model':db[_0x3c9e64[_0xa6e1('0x1b')]],'as':_0x3c9e64['as'],'attributes':_0x3c9e64[_0xa6e1('0x17')],'include':_0x3c9e64[_0xa6e1('0x19')]?_[_0xa6e1('0x1a')](_0x3c9e64[_0xa6e1('0x19')],function(_0x4082b2){return{'model':db[_0x4082b2[_0xa6e1('0x1b')]],'as':_0x4082b2['as'],'attributes':_0x4082b2[_0xa6e1('0x17')],'include':_0x4082b2[_0xa6e1('0x19')]?_[_0xa6e1('0x1a')](_0x4082b2['include'],function(_0x44e641){return{'model':db[_0x44e641['model']],'as':_0x44e641['as'],'attributes':_0x44e641['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e1dab){logger[_0xa6e1('0xd')](_0xa6e1('0x1f'),_0xb066d);logger[_0xa6e1('0xf')](_0xa6e1('0x1f'),_0xb066d,JSON['stringify'](_0x3e1dab));_0x4a8850(_0x3e1dab);})[_0xa6e1('0x1e')](function(_0x5e9072){logger[_0xa6e1('0x10')](_0xa6e1('0x1f'),_0x5e9072['message'],_0xb066d);_0x33a6ea(_0x4f4ce6[_0xa6e1('0x10')](0x1f4,_0x5e9072[_0xa6e1('0x13')]));});});}; \ No newline at end of file +var _0x83a8=['then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','message','catch','GetDynamics365Account','findAll','options','raw','where','attributes','limit','map','model','include','stringify','ShowDynamics365Account','Dynamics365Account','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x54ea4f,_0x495cff){var _0x51b79e=function(_0x2ecb38){while(--_0x2ecb38){_0x54ea4f['push'](_0x54ea4f['shift']());}};_0x51b79e(++_0x495cff);}(_0x83a8,0x148));var _0x883a=function(_0x560796,_0x374571){_0x560796=_0x560796-0x0;var _0x2c6691=_0x83a8[_0x560796];return _0x2c6691;};'use strict';var _=require(_0x883a('0x0'));var util=require(_0x883a('0x1'));var moment=require('moment');var BPromise=require(_0x883a('0x2'));var rs=require(_0x883a('0x3'));var fs=require('fs');var Redis=require(_0x883a('0x4'));var db=require(_0x883a('0x5'))['db'];var utils=require(_0x883a('0x6'));var logger=require(_0x883a('0x7'))(_0x883a('0x8'));var config=require(_0x883a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x883a('0xa')][_0x883a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd57cce,_0x3f3256,_0x1a396d){return new BPromise(function(_0x4dbfc3,_0x3c1b1a){return client['request'](_0xd57cce,_0x1a396d)[_0x883a('0xc')](function(_0x293823){logger[_0x883a('0xd')](_0x883a('0xe'),_0x3f3256,_0x883a('0xf'));logger[_0x883a('0x10')](_0x883a('0x11'),_0x3f3256,_0x883a('0xf'),JSON['stringify'](_0x293823));if(_0x293823['error']){if(_0x293823['error']['code']===0x1f4){logger[_0x883a('0x12')](_0x883a('0xe'),_0x3f3256,_0x293823[_0x883a('0x12')][_0x883a('0x13')]);return _0x3c1b1a(_0x293823[_0x883a('0x12')][_0x883a('0x13')]);}logger[_0x883a('0x12')](_0x883a('0xe'),_0x3f3256,_0x293823[_0x883a('0x12')][_0x883a('0x13')]);return _0x4dbfc3(_0x293823[_0x883a('0x12')][_0x883a('0x13')]);}else{logger[_0x883a('0xd')](_0x883a('0xe'),_0x3f3256,_0x883a('0xf'));_0x4dbfc3(_0x293823['result']['message']);}})[_0x883a('0x14')](function(_0x27b67e){logger[_0x883a('0x12')](_0x883a('0xe'),_0x3f3256,_0x27b67e);_0x3c1b1a(_0x27b67e);});});}exports[_0x883a('0x15')]=function(_0x2b56ae){var _0xbf98fb=this;return new Promise(function(_0x21efdf,_0x476cce){return db['Dynamics365Account'][_0x883a('0x16')]({'raw':_0x2b56ae[_0x883a('0x17')]?_0x2b56ae[_0x883a('0x17')][_0x883a('0x18')]===undefined?!![]:![]:!![],'where':_0x2b56ae['options']?_0x2b56ae['options'][_0x883a('0x19')]||null:null,'attributes':_0x2b56ae[_0x883a('0x17')]?_0x2b56ae['options'][_0x883a('0x1a')]||null:null,'limit':_0x2b56ae[_0x883a('0x17')]?_0x2b56ae[_0x883a('0x17')][_0x883a('0x1b')]||null:null,'include':_0x2b56ae[_0x883a('0x17')]?_0x2b56ae[_0x883a('0x17')]['include']?_[_0x883a('0x1c')](_0x2b56ae[_0x883a('0x17')]['include'],function(_0x33204d){return{'model':db[_0x33204d[_0x883a('0x1d')]],'as':_0x33204d['as'],'attributes':_0x33204d['attributes'],'include':_0x33204d[_0x883a('0x1e')]?_[_0x883a('0x1c')](_0x33204d[_0x883a('0x1e')],function(_0x313a13){return{'model':db[_0x313a13[_0x883a('0x1d')]],'as':_0x313a13['as'],'attributes':_0x313a13[_0x883a('0x1a')],'include':_0x313a13[_0x883a('0x1e')]?_[_0x883a('0x1c')](_0x313a13[_0x883a('0x1e')],function(_0x2aae59){return{'model':db[_0x2aae59[_0x883a('0x1d')]],'as':_0x2aae59['as'],'attributes':_0x2aae59[_0x883a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x883a('0xc')](function(_0x26b7d2){logger[_0x883a('0xd')](_0x883a('0x15'),_0x2b56ae);logger[_0x883a('0x10')](_0x883a('0x15'),_0x2b56ae,JSON[_0x883a('0x1f')](_0x26b7d2));_0x21efdf(_0x26b7d2);})[_0x883a('0x14')](function(_0x5c1d16){logger[_0x883a('0x12')](_0x883a('0x15'),_0x5c1d16[_0x883a('0x13')],_0x2b56ae);_0x476cce(_0xbf98fb[_0x883a('0x12')](0x1f4,_0x5c1d16[_0x883a('0x13')]));});});};exports[_0x883a('0x20')]=function(_0x2cb657){var _0x5e0aee=this;return new Promise(function(_0x520888,_0x4c03cf){return db[_0x883a('0x21')]['find']({'raw':_0x2cb657[_0x883a('0x17')]?_0x2cb657[_0x883a('0x17')][_0x883a('0x18')]===undefined?!![]:![]:!![],'where':_0x2cb657[_0x883a('0x17')]?_0x2cb657['options']['where']||null:null,'attributes':_0x2cb657[_0x883a('0x17')]?_0x2cb657[_0x883a('0x17')][_0x883a('0x1a')]||null:null,'include':_0x2cb657[_0x883a('0x17')]?_0x2cb657[_0x883a('0x17')][_0x883a('0x1e')]?_[_0x883a('0x1c')](_0x2cb657[_0x883a('0x17')][_0x883a('0x1e')],function(_0x7108a0){return{'model':db[_0x7108a0['model']],'as':_0x7108a0['as'],'attributes':_0x7108a0['attributes'],'include':_0x7108a0[_0x883a('0x1e')]?_['map'](_0x7108a0[_0x883a('0x1e')],function(_0x44c7a7){return{'model':db[_0x44c7a7[_0x883a('0x1d')]],'as':_0x44c7a7['as'],'attributes':_0x44c7a7[_0x883a('0x1a')],'include':_0x44c7a7[_0x883a('0x1e')]?_[_0x883a('0x1c')](_0x44c7a7[_0x883a('0x1e')],function(_0x3c8ff3){return{'model':db[_0x3c8ff3[_0x883a('0x1d')]],'as':_0x3c8ff3['as'],'attributes':_0x3c8ff3['attributes']};}):[]};}):[]};}):[]:[]})[_0x883a('0xc')](function(_0x2b003a){logger['info']('ShowDynamics365Account',_0x2cb657);logger[_0x883a('0x10')](_0x883a('0x20'),_0x2cb657,JSON[_0x883a('0x1f')](_0x2b003a));_0x520888(_0x2b003a);})['catch'](function(_0x4a4dd3){logger[_0x883a('0x12')](_0x883a('0x20'),_0x4a4dd3[_0x883a('0x13')],_0x2cb657);_0x4c03cf(_0x5e0aee[_0x883a('0x12')](0x1f4,_0x4a4dd3[_0x883a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 256b846..ad4d9f0 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 _0x45d8=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','index','/:id','isAuthenticated','show','get','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','destroy','multer','util'];(function(_0x195032,_0x1095f2){var _0x3a4e24=function(_0x1a9bf0){while(--_0x1a9bf0){_0x195032['push'](_0x195032['shift']());}};_0x3a4e24(++_0x1095f2);}(_0x45d8,0x174));var _0x845d=function(_0x3f4dd9,_0xe0b819){_0x3f4dd9=_0x3f4dd9-0x0;var _0x31c54a=_0x45d8[_0x3f4dd9];return _0x31c54a;};'use strict';var multer=require(_0x845d('0x0'));var util=require(_0x845d('0x1'));var path=require(_0x845d('0x2'));var timeout=require(_0x845d('0x3'));var express=require(_0x845d('0x4'));var router=express[_0x845d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x845d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x845d('0x7'));var controller=require(_0x845d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x845d('0x9')]);router['get'](_0x845d('0xa'),auth[_0x845d('0xb')](),controller[_0x845d('0xc')]);router[_0x845d('0xd')](_0x845d('0xe'),auth[_0x845d('0xb')](),controller['getFields']);router[_0x845d('0xd')](_0x845d('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x845d('0xd')](_0x845d('0x10'),auth[_0x845d('0xb')](),controller[_0x845d('0x11')]);router[_0x845d('0x12')]('/',auth['isAuthenticated'](),controller[_0x845d('0x13')]);router[_0x845d('0x14')](_0x845d('0xa'),auth[_0x845d('0xb')](),controller['update']);router['delete'](_0x845d('0xa'),auth[_0x845d('0xb')](),controller[_0x845d('0x15')]);module['exports']=router; \ No newline at end of file +var _0x96ee=['util','path','../../components/auth/service','./intDynamics365Configuration.controller','get','index','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','delete','exports'];(function(_0x3dd9a3,_0x18aa7d){var _0x3c7029=function(_0x4ad3a1){while(--_0x4ad3a1){_0x3dd9a3['push'](_0x3dd9a3['shift']());}};_0x3c7029(++_0x18aa7d);}(_0x96ee,0x72));var _0xe96e=function(_0x5d0609,_0x127562){_0x5d0609=_0x5d0609-0x0;var _0xaa3fd1=_0x96ee[_0x5d0609];return _0xaa3fd1;};'use strict';var multer=require('multer');var util=require(_0xe96e('0x0'));var path=require(_0xe96e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe96e('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe96e('0x3'));router[_0xe96e('0x4')]('/',auth['isAuthenticated'](),controller[_0xe96e('0x5')]);router[_0xe96e('0x4')](_0xe96e('0x6'),auth['isAuthenticated'](),controller[_0xe96e('0x7')]);router[_0xe96e('0x4')](_0xe96e('0x8'),auth[_0xe96e('0x9')](),controller[_0xe96e('0xa')]);router[_0xe96e('0x4')](_0xe96e('0xb'),auth[_0xe96e('0x9')](),controller[_0xe96e('0xc')]);router[_0xe96e('0x4')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xe96e('0xd')]);router[_0xe96e('0xe')]('/',auth[_0xe96e('0x9')](),controller[_0xe96e('0xf')]);router[_0xe96e('0x10')](_0xe96e('0x6'),auth['isAuthenticated'](),controller['update']);router[_0xe96e('0x11')](_0xe96e('0x6'),auth[_0xe96e('0x9')](),controller['destroy']);module[_0xe96e('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 61ca8e8..de05502 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 _0xa1d4=['sequelize','STRING','phonecall','incident','ENUM','nothing'];(function(_0x19e57f,_0x4ae750){var _0x469556=function(_0xf6968b){while(--_0xf6968b){_0x19e57f['push'](_0x19e57f['shift']());}};_0x469556(++_0x4ae750);}(_0xa1d4,0x1a4));var _0x4a1d=function(_0x4c9ce1,_0x3ac434){_0x4c9ce1=_0x4c9ce1-0x0;var _0x3474e5=_0xa1d4[_0x4c9ce1];return _0x3474e5;};'use strict';var Sequelize=require(_0x4a1d('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4a1d('0x1')]},'ticketType':{'type':Sequelize['ENUM']('incident',_0x4a1d('0x2')),'defaultValue':_0x4a1d('0x3')},'moduleCreate':{'type':Sequelize[_0x4a1d('0x4')]('contact',_0x4a1d('0x5')),'defaultValue':'contact','allowNull':![]}}; \ No newline at end of file +var _0xabfc=['nothing','sequelize','exports','ENUM','incident','contact'];(function(_0x158a14,_0x59d892){var _0x40a790=function(_0xc266c1){while(--_0xc266c1){_0x158a14['push'](_0x158a14['shift']());}};_0x40a790(++_0x59d892);}(_0xabfc,0x73));var _0xcabf=function(_0x5e3701,_0x596265){_0x5e3701=_0x5e3701-0x0;var _0x345dcf=_0xabfc[_0x5e3701];return _0x345dcf;};'use strict';var Sequelize=require(_0xcabf('0x0'));module[_0xcabf('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xcabf('0x2')](_0xcabf('0x3'),'phonecall'),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0xcabf('0x2')](_0xcabf('0x4'),_0xcabf('0x5')),'defaultValue':_0xcabf('0x4'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 44c9dcb..3e1ac42 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 _0x883e=['getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','sendStatus','error','index','map','Dynamics365Configuration','type','key','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','VIRTUAL','filter','merge','options','include','findAll','rows','show','params','rawAttributes','keys','length','includeAll','find','catch','create','body','getFields','findOne','Dynamics365Field','order','nolimit','pick','getSubjects'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x883e,0x1a0));var _0xe883=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x883e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe883('0x0'));var rimraf=require(_0xe883('0x1'));var zipdir=require(_0xe883('0x2'));var jsonpatch=require(_0xe883('0x3'));var rp=require(_0xe883('0x4'));var moment=require(_0xe883('0x5'));var BPromise=require(_0xe883('0x6'));var Mustache=require(_0xe883('0x7'));var util=require(_0xe883('0x8'));var path=require(_0xe883('0x9'));var sox=require(_0xe883('0xa'));var csv=require(_0xe883('0xb'));var ejs=require(_0xe883('0xc'));var fs=require('fs');var fs_extra=require(_0xe883('0xd'));var _=require('lodash');var squel=require(_0xe883('0xe'));var crypto=require(_0xe883('0xf'));var jsforce=require(_0xe883('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe883('0xb'));var querystring=require(_0xe883('0x11'));var Papa=require(_0xe883('0x12'));var Redis=require(_0xe883('0x13'));var authService=require(_0xe883('0x14'));var qs=require(_0xe883('0x15'));var as=require(_0xe883('0x16'));var hardwareService=require(_0xe883('0x17'));var logger=require(_0xe883('0x18'))(_0xe883('0x19'));var utils=require(_0xe883('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xe883('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38b273,_0x363092){_0x363092=_0x363092||0xcc;return function(_0x1b5f5a){if(_0x1b5f5a){return _0x38b273['sendStatus'](_0x363092);}return _0x38b273[_0xe883('0x1c')](_0x363092)[_0xe883('0x1d')]();};}function respondWithResult(_0x82b07c,_0x219304){_0x219304=_0x219304||0xc8;return function(_0x34a422){if(_0x34a422){return _0x82b07c['status'](_0x219304)[_0xe883('0x1e')](_0x34a422);}};}function respondWithFilteredResult(_0x2d46e1,_0x19d5ec){return function(_0x16c87b){if(_0x16c87b){var _0x504b9d=typeof _0x19d5ec[_0xe883('0x1f')]==='undefined'&&typeof _0x19d5ec['limit']===_0xe883('0x20');var _0x29c52b=_0x16c87b[_0xe883('0x21')];var _0x4195f7=_0x504b9d?0x0:_0x19d5ec['offset'];var _0x1e9e1c=_0x504b9d?_0x16c87b[_0xe883('0x21')]:_0x19d5ec[_0xe883('0x1f')]+_0x19d5ec[_0xe883('0x22')];var _0x205728;if(_0x1e9e1c>=_0x29c52b){_0x1e9e1c=_0x29c52b;_0x205728=0xc8;}else{_0x205728=0xce;}_0x2d46e1[_0xe883('0x1c')](_0x205728);return _0x2d46e1[_0xe883('0x23')]('Content-Range',_0x4195f7+'-'+_0x1e9e1c+'/'+_0x29c52b)[_0xe883('0x1e')](_0x16c87b);}return null;};}function patchUpdates(_0x1c9d28){return function(_0x5db7a7){try{jsonpatch[_0xe883('0x24')](_0x5db7a7,_0x1c9d28,!![]);}catch(_0xad1adf){return BPromise[_0xe883('0x25')](_0xad1adf);}return _0x5db7a7[_0xe883('0x26')]();};}function saveUpdates(_0xfbbd03,_0xa005f8){return function(_0x5270b8){if(_0x5270b8){return _0x5270b8[_0xe883('0x27')](_0xfbbd03)[_0xe883('0x28')](function(_0x4a6ffe){return _0x4a6ffe;});}return null;};}function removeEntity(_0x1a4fc4,_0x4a3aa9){return function(_0x1e2d77){if(_0x1e2d77){return _0x1e2d77['destroy']()[_0xe883('0x28')](function(){_0x1a4fc4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e71bf,_0xff784a){return function(_0x6e0743){if(!_0x6e0743){_0x3e71bf[_0xe883('0x29')](0x194);}return _0x6e0743;};}function handleError(_0x249ef3,_0x53fcd6){_0x53fcd6=_0x53fcd6||0x1f4;return function(_0x3b8941){logger[_0xe883('0x2a')](_0x3b8941['stack']);if(_0x3b8941['name']){delete _0x3b8941['name'];}_0x249ef3[_0xe883('0x1c')](_0x53fcd6)['send'](_0x3b8941);};}exports[_0xe883('0x2b')]=function(_0x36ef52,_0x26042c){var _0x2e0f38={},_0xccd86d={},_0x44f7e8={'count':0x0,'rows':[]};var _0x47f972=_[_0xe883('0x2c')](db[_0xe883('0x2d')]['rawAttributes'],function(_0x36dee4){return{'name':_0x36dee4['fieldName'],'type':_0x36dee4[_0xe883('0x2e')][_0xe883('0x2f')]};});_0xccd86d[_0xe883('0x30')]=_[_0xe883('0x2c')](_0x47f972,_0xe883('0x31'));_0xccd86d[_0xe883('0x32')]=_['keys'](_0x36ef52['query']);_0xccd86d[_0xe883('0x33')]=_[_0xe883('0x34')](_0xccd86d['model'],_0xccd86d[_0xe883('0x32')]);_0x2e0f38[_0xe883('0x35')]=_[_0xe883('0x34')](_0xccd86d[_0xe883('0x30')],qs[_0xe883('0x36')](_0x36ef52['query'][_0xe883('0x36')]));_0x2e0f38[_0xe883('0x35')]=_0x2e0f38[_0xe883('0x35')]['length']?_0x2e0f38[_0xe883('0x35')]:_0xccd86d[_0xe883('0x30')];if(!_0x36ef52['query'][_0xe883('0x37')]('nolimit')){_0x2e0f38[_0xe883('0x22')]=qs[_0xe883('0x22')](_0x36ef52[_0xe883('0x32')]['limit']);_0x2e0f38[_0xe883('0x1f')]=qs['offset'](_0x36ef52[_0xe883('0x32')][_0xe883('0x1f')]);}_0x2e0f38['order']=qs[_0xe883('0x38')](_0x36ef52[_0xe883('0x32')][_0xe883('0x38')]);_0x2e0f38['where']=qs['filters'](_['pick'](_0x36ef52[_0xe883('0x32')],_0xccd86d[_0xe883('0x33')]),_0x47f972);if(_0x36ef52['query']['filter']){_0x2e0f38[_0xe883('0x39')]=_['merge'](_0x2e0f38['where'],{'$or':_['map'](_0x47f972,function(_0x1d50e8){if(_0x1d50e8['type']!==_0xe883('0x3a')){var _0x1fa8fa={};_0x1fa8fa[_0x1d50e8[_0xe883('0x31')]]={'$like':'%'+_0x36ef52[_0xe883('0x32')][_0xe883('0x3b')]+'%'};return _0x1fa8fa;}})});}_0x2e0f38=_[_0xe883('0x3c')]({},_0x2e0f38,_0x36ef52[_0xe883('0x3d')]);var _0x5928c3={'where':_0x2e0f38[_0xe883('0x39')]};return db['Dynamics365Configuration'][_0xe883('0x21')](_0x5928c3)[_0xe883('0x28')](function(_0x1dfb53){_0x44f7e8['count']=_0x1dfb53;if(_0x36ef52[_0xe883('0x32')]['includeAll']){_0x2e0f38[_0xe883('0x3e')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xe883('0x3f')](_0x2e0f38);})[_0xe883('0x28')](function(_0x4ebce5){_0x44f7e8[_0xe883('0x40')]=_0x4ebce5;return _0x44f7e8;})['then'](respondWithFilteredResult(_0x26042c,_0x2e0f38))['catch'](handleError(_0x26042c,null));};exports[_0xe883('0x41')]=function(_0x4e2706,_0x5c228e){var _0x264089={'raw':![],'where':{'id':_0x4e2706[_0xe883('0x42')]['id']}},_0x4e89f1={};_0x4e89f1[_0xe883('0x30')]=_['keys'](db[_0xe883('0x2d')][_0xe883('0x43')]);_0x4e89f1[_0xe883('0x32')]=_[_0xe883('0x44')](_0x4e2706['query']);_0x4e89f1[_0xe883('0x33')]=_[_0xe883('0x34')](_0x4e89f1[_0xe883('0x30')],_0x4e89f1[_0xe883('0x32')]);_0x264089['attributes']=_[_0xe883('0x34')](_0x4e89f1[_0xe883('0x30')],qs['fields'](_0x4e2706[_0xe883('0x32')]['fields']));_0x264089[_0xe883('0x35')]=_0x264089[_0xe883('0x35')][_0xe883('0x45')]?_0x264089[_0xe883('0x35')]:_0x4e89f1[_0xe883('0x30')];if(_0x4e2706[_0xe883('0x32')][_0xe883('0x46')]){_0x264089[_0xe883('0x3e')]=[{'all':!![]}];}_0x264089=_[_0xe883('0x3c')]({},_0x264089,_0x4e2706[_0xe883('0x3d')]);return db['Dynamics365Configuration'][_0xe883('0x47')](_0x264089)[_0xe883('0x28')](handleEntityNotFound(_0x5c228e,null))[_0xe883('0x28')](respondWithResult(_0x5c228e,null))[_0xe883('0x48')](handleError(_0x5c228e,null));};exports[_0xe883('0x49')]=function(_0x3bb543,_0x198a95){return db[_0xe883('0x2d')][_0xe883('0x49')](_0x3bb543[_0xe883('0x4a')],{})[_0xe883('0x28')](respondWithResult(_0x198a95,0xc9))[_0xe883('0x48')](handleError(_0x198a95,null));};exports[_0xe883('0x27')]=function(_0x4bf46a,_0x30fbcc){if(_0x4bf46a[_0xe883('0x4a')]['id']){delete _0x4bf46a[_0xe883('0x4a')]['id'];}return db[_0xe883('0x2d')]['find']({'where':{'id':_0x4bf46a['params']['id']}})[_0xe883('0x28')](handleEntityNotFound(_0x30fbcc,null))[_0xe883('0x28')](saveUpdates(_0x4bf46a[_0xe883('0x4a')],null))[_0xe883('0x28')](respondWithResult(_0x30fbcc,null))[_0xe883('0x48')](handleError(_0x30fbcc,null));};exports['destroy']=function(_0x1518b3,_0x125c52){return db[_0xe883('0x2d')]['find']({'where':{'id':_0x1518b3[_0xe883('0x42')]['id']}})[_0xe883('0x28')](handleEntityNotFound(_0x125c52,null))[_0xe883('0x28')](removeEntity(_0x125c52,null))[_0xe883('0x48')](handleError(_0x125c52,null));};exports[_0xe883('0x4b')]=function(_0x2cc28f,_0x198719,_0x384d41){var _0x58720f={};var _0x6e6bd0={};var _0x476368;var _0x5a1646;return db[_0xe883('0x2d')][_0xe883('0x4c')]({'where':{'id':_0x2cc28f[_0xe883('0x42')]['id']}})[_0xe883('0x28')](handleEntityNotFound(_0x198719,null))[_0xe883('0x28')](function(_0xb89d03){if(_0xb89d03){_0x476368=_0xb89d03;_0x6e6bd0['model']=_[_0xe883('0x44')](db[_0xe883('0x4d')][_0xe883('0x43')]);_0x6e6bd0[_0xe883('0x32')]=_[_0xe883('0x44')](_0x2cc28f[_0xe883('0x32')]);_0x6e6bd0[_0xe883('0x33')]=_['intersection'](_0x6e6bd0[_0xe883('0x30')],_0x6e6bd0[_0xe883('0x32')]);_0x58720f[_0xe883('0x35')]=_[_0xe883('0x34')](_0x6e6bd0[_0xe883('0x30')],qs[_0xe883('0x36')](_0x2cc28f['query']['fields']));_0x58720f['attributes']=_0x58720f[_0xe883('0x35')][_0xe883('0x45')]?_0x58720f[_0xe883('0x35')]:_0x6e6bd0[_0xe883('0x30')];_0x58720f[_0xe883('0x4e')]=qs['sort'](_0x2cc28f[_0xe883('0x32')][_0xe883('0x38')]);_0x58720f[_0xe883('0x39')]=qs[_0xe883('0x33')](_['pick'](_0x2cc28f['query'],_0x6e6bd0[_0xe883('0x33')]));if(_0x2cc28f['query'][_0xe883('0x3b')]){_0x58720f[_0xe883('0x39')]=_[_0xe883('0x3c')](_0x58720f['where'],{'$or':_[_0xe883('0x2c')](_0x58720f['attributes'],function(_0x75366d){var _0x5b363a={};_0x5b363a[_0x75366d]={'$like':'%'+_0x2cc28f[_0xe883('0x32')][_0xe883('0x3b')]+'%'};return _0x5b363a;})});}_0x58720f=_[_0xe883('0x3c')]({},_0x58720f,_0x2cc28f['options']);return _0x476368['getFields'](_0x58720f);}})[_0xe883('0x28')](function(_0x37d1d7){if(_0x37d1d7){_0x5a1646=_0x37d1d7['length'];if(!_0x2cc28f['query']['hasOwnProperty'](_0xe883('0x4f'))){_0x58720f[_0xe883('0x22')]=qs['limit'](_0x2cc28f[_0xe883('0x32')][_0xe883('0x22')]);_0x58720f['offset']=qs[_0xe883('0x1f')](_0x2cc28f[_0xe883('0x32')][_0xe883('0x1f')]);}return _0x476368[_0xe883('0x4b')](_0x58720f);}})[_0xe883('0x28')](function(_0x387827){if(_0x387827){return _0x387827?{'count':_0x5a1646,'rows':_0x387827}:null;}})[_0xe883('0x28')](respondWithResult(_0x198719,null))['catch'](handleError(_0x198719,null));};exports['getSubjects']=function(_0x48d03d,_0xbff899,_0x169100){var _0xec6fac={};var _0x1f4536={};var _0x13b8d7;var _0x241215;return db[_0xe883('0x2d')][_0xe883('0x4c')]({'where':{'id':_0x48d03d[_0xe883('0x42')]['id']}})['then'](handleEntityNotFound(_0xbff899,null))[_0xe883('0x28')](function(_0x3cad6d){if(_0x3cad6d){_0x13b8d7=_0x3cad6d;_0x1f4536[_0xe883('0x30')]=_[_0xe883('0x44')](db['Dynamics365Field']['rawAttributes']);_0x1f4536[_0xe883('0x32')]=_[_0xe883('0x44')](_0x48d03d[_0xe883('0x32')]);_0x1f4536['filters']=_[_0xe883('0x34')](_0x1f4536[_0xe883('0x30')],_0x1f4536[_0xe883('0x32')]);_0xec6fac['attributes']=_[_0xe883('0x34')](_0x1f4536[_0xe883('0x30')],qs[_0xe883('0x36')](_0x48d03d[_0xe883('0x32')][_0xe883('0x36')]));_0xec6fac[_0xe883('0x35')]=_0xec6fac[_0xe883('0x35')][_0xe883('0x45')]?_0xec6fac['attributes']:_0x1f4536['model'];_0xec6fac[_0xe883('0x4e')]=qs[_0xe883('0x38')](_0x48d03d[_0xe883('0x32')]['sort']);_0xec6fac[_0xe883('0x39')]=qs[_0xe883('0x33')](_[_0xe883('0x50')](_0x48d03d[_0xe883('0x32')],_0x1f4536[_0xe883('0x33')]));if(_0x48d03d[_0xe883('0x32')][_0xe883('0x3b')]){_0xec6fac[_0xe883('0x39')]=_['merge'](_0xec6fac[_0xe883('0x39')],{'$or':_[_0xe883('0x2c')](_0xec6fac[_0xe883('0x35')],function(_0x46d938){var _0x2251d8={};_0x2251d8[_0x46d938]={'$like':'%'+_0x48d03d[_0xe883('0x32')]['filter']+'%'};return _0x2251d8;})});}_0xec6fac=_[_0xe883('0x3c')]({},_0xec6fac,_0x48d03d[_0xe883('0x3d')]);return _0x13b8d7[_0xe883('0x51')](_0xec6fac);}})[_0xe883('0x28')](function(_0x2b3730){if(_0x2b3730){_0x241215=_0x2b3730[_0xe883('0x45')];if(!_0x48d03d['query'][_0xe883('0x37')](_0xe883('0x4f'))){_0xec6fac[_0xe883('0x22')]=qs[_0xe883('0x22')](_0x48d03d[_0xe883('0x32')][_0xe883('0x22')]);_0xec6fac[_0xe883('0x1f')]=qs['offset'](_0x48d03d[_0xe883('0x32')][_0xe883('0x1f')]);}return _0x13b8d7[_0xe883('0x51')](_0xec6fac);}})['then'](function(_0x31cc3c){if(_0x31cc3c){return _0x31cc3c?{'count':_0x241215,'rows':_0x31cc3c}:null;}})[_0xe883('0x28')](respondWithResult(_0xbff899,null))[_0xe883('0x48')](handleError(_0xbff899,null));};exports['getDescriptions']=function(_0x98d307,_0x40a5f1,_0x4428d6){var _0x5396bd={};var _0x12137b={};var _0x31913c;var _0x2705ca;return db[_0xe883('0x2d')][_0xe883('0x4c')]({'where':{'id':_0x98d307[_0xe883('0x42')]['id']}})[_0xe883('0x28')](handleEntityNotFound(_0x40a5f1,null))[_0xe883('0x28')](function(_0x133479){if(_0x133479){_0x31913c=_0x133479;_0x12137b['model']=_[_0xe883('0x44')](db[_0xe883('0x4d')][_0xe883('0x43')]);_0x12137b[_0xe883('0x32')]=_['keys'](_0x98d307[_0xe883('0x32')]);_0x12137b[_0xe883('0x33')]=_[_0xe883('0x34')](_0x12137b[_0xe883('0x30')],_0x12137b[_0xe883('0x32')]);_0x5396bd[_0xe883('0x35')]=_['intersection'](_0x12137b['model'],qs[_0xe883('0x36')](_0x98d307['query'][_0xe883('0x36')]));_0x5396bd[_0xe883('0x35')]=_0x5396bd[_0xe883('0x35')][_0xe883('0x45')]?_0x5396bd[_0xe883('0x35')]:_0x12137b[_0xe883('0x30')];_0x5396bd[_0xe883('0x4e')]=qs[_0xe883('0x38')](_0x98d307[_0xe883('0x32')][_0xe883('0x38')]);_0x5396bd[_0xe883('0x39')]=qs[_0xe883('0x33')](_[_0xe883('0x50')](_0x98d307[_0xe883('0x32')],_0x12137b[_0xe883('0x33')]));if(_0x98d307['query'][_0xe883('0x3b')]){_0x5396bd[_0xe883('0x39')]=_[_0xe883('0x3c')](_0x5396bd[_0xe883('0x39')],{'$or':_[_0xe883('0x2c')](_0x5396bd[_0xe883('0x35')],function(_0x211799){var _0x98c3ef={};_0x98c3ef[_0x211799]={'$like':'%'+_0x98d307[_0xe883('0x32')]['filter']+'%'};return _0x98c3ef;})});}_0x5396bd=_[_0xe883('0x3c')]({},_0x5396bd,_0x98d307[_0xe883('0x3d')]);return _0x31913c[_0xe883('0x52')](_0x5396bd);}})['then'](function(_0x52e41a){if(_0x52e41a){_0x2705ca=_0x52e41a[_0xe883('0x45')];if(!_0x98d307[_0xe883('0x32')][_0xe883('0x37')](_0xe883('0x4f'))){_0x5396bd[_0xe883('0x22')]=qs[_0xe883('0x22')](_0x98d307[_0xe883('0x32')]['limit']);_0x5396bd[_0xe883('0x1f')]=qs[_0xe883('0x1f')](_0x98d307[_0xe883('0x32')][_0xe883('0x1f')]);}return _0x31913c[_0xe883('0x52')](_0x5396bd);}})[_0xe883('0x28')](function(_0x8dd0e8){if(_0x8dd0e8){return _0x8dd0e8?{'count':_0x2705ca,'rows':_0x8dd0e8}:null;}})[_0xe883('0x28')](respondWithResult(_0x40a5f1,null))[_0xe883('0x48')](handleError(_0x40a5f1,null));}; \ No newline at end of file +var _0xefc5=['index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','find','catch','create','body','params','getFields','pick','filter','getSubjects','getDescriptions','Dynamics365Field','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send'];(function(_0x22eb18,_0x3f3f86){var _0x2edd39=function(_0x27c1d3){while(--_0x27c1d3){_0x22eb18['push'](_0x22eb18['shift']());}};_0x2edd39(++_0x3f3f86);}(_0xefc5,0x1d4));var _0x5efc=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xefc5[_0x550d12];return _0x12103d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5efc('0x0'));var zipdir=require(_0x5efc('0x1'));var jsonpatch=require(_0x5efc('0x2'));var rp=require(_0x5efc('0x3'));var moment=require(_0x5efc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5efc('0x5'));var util=require(_0x5efc('0x6'));var path=require(_0x5efc('0x7'));var sox=require(_0x5efc('0x8'));var csv=require(_0x5efc('0x9'));var ejs=require(_0x5efc('0xa'));var fs=require('fs');var fs_extra=require(_0x5efc('0xb'));var _=require(_0x5efc('0xc'));var squel=require(_0x5efc('0xd'));var crypto=require(_0x5efc('0xe'));var jsforce=require(_0x5efc('0xf'));var deskjs=require(_0x5efc('0x10'));var toCsv=require(_0x5efc('0x9'));var querystring=require(_0x5efc('0x11'));var Papa=require(_0x5efc('0x12'));var Redis=require(_0x5efc('0x13'));var authService=require(_0x5efc('0x14'));var qs=require(_0x5efc('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5efc('0x16'));var logger=require(_0x5efc('0x17'))(_0x5efc('0x18'));var utils=require(_0x5efc('0x19'));var config=require(_0x5efc('0x1a'));var licenseUtil=require(_0x5efc('0x1b'));var db=require(_0x5efc('0x1c'))['db'];function respondWithStatusCode(_0x3f51a5,_0x4f7760){_0x4f7760=_0x4f7760||0xcc;return function(_0x12da3a){if(_0x12da3a){return _0x3f51a5[_0x5efc('0x1d')](_0x4f7760);}return _0x3f51a5[_0x5efc('0x1e')](_0x4f7760)[_0x5efc('0x1f')]();};}function respondWithResult(_0x29881d,_0x148199){_0x148199=_0x148199||0xc8;return function(_0x4c5c2e){if(_0x4c5c2e){return _0x29881d[_0x5efc('0x1e')](_0x148199)['json'](_0x4c5c2e);}};}function respondWithFilteredResult(_0x3ae847,_0x3b3759){return function(_0x2ebb00){if(_0x2ebb00){var _0x5dc915=typeof _0x3b3759[_0x5efc('0x20')]===_0x5efc('0x21')&&typeof _0x3b3759[_0x5efc('0x22')]===_0x5efc('0x21');var _0x2a74e7=_0x2ebb00[_0x5efc('0x23')];var _0x2045a7=_0x5dc915?0x0:_0x3b3759[_0x5efc('0x20')];var _0x9026fa=_0x5dc915?_0x2ebb00[_0x5efc('0x23')]:_0x3b3759[_0x5efc('0x20')]+_0x3b3759['limit'];var _0x547628;if(_0x9026fa>=_0x2a74e7){_0x9026fa=_0x2a74e7;_0x547628=0xc8;}else{_0x547628=0xce;}_0x3ae847[_0x5efc('0x1e')](_0x547628);return _0x3ae847[_0x5efc('0x24')](_0x5efc('0x25'),_0x2045a7+'-'+_0x9026fa+'/'+_0x2a74e7)[_0x5efc('0x26')](_0x2ebb00);}return null;};}function patchUpdates(_0x2b20ef){return function(_0x539ee4){try{jsonpatch[_0x5efc('0x27')](_0x539ee4,_0x2b20ef,!![]);}catch(_0x20796e){return BPromise[_0x5efc('0x28')](_0x20796e);}return _0x539ee4['save']();};}function saveUpdates(_0xa212e,_0x22ae5f){return function(_0x37d7){if(_0x37d7){return _0x37d7[_0x5efc('0x29')](_0xa212e)[_0x5efc('0x2a')](function(_0x231d22){return _0x231d22;});}return null;};}function removeEntity(_0xdabc05,_0x3b4f6d){return function(_0x457041){if(_0x457041){return _0x457041[_0x5efc('0x2b')]()['then'](function(){_0xdabc05[_0x5efc('0x1e')](0xcc)[_0x5efc('0x1f')]();});}};}function handleEntityNotFound(_0x54b77b,_0x345710){return function(_0x12ec35){if(!_0x12ec35){_0x54b77b[_0x5efc('0x1d')](0x194);}return _0x12ec35;};}function handleError(_0x34e294,_0x4d0314){_0x4d0314=_0x4d0314||0x1f4;return function(_0x4539fc){logger[_0x5efc('0x2c')](_0x4539fc[_0x5efc('0x2d')]);if(_0x4539fc[_0x5efc('0x2e')]){delete _0x4539fc[_0x5efc('0x2e')];}_0x34e294['status'](_0x4d0314)[_0x5efc('0x2f')](_0x4539fc);};}exports[_0x5efc('0x30')]=function(_0xd94404,_0x17eca1){var _0x111f38={},_0x2cee02={},_0x15b675={'count':0x0,'rows':[]};var _0x4e9cab=_[_0x5efc('0x31')](db[_0x5efc('0x32')][_0x5efc('0x33')],function(_0x48f725){return{'name':_0x48f725[_0x5efc('0x34')],'type':_0x48f725[_0x5efc('0x35')][_0x5efc('0x36')]};});_0x2cee02[_0x5efc('0x37')]=_[_0x5efc('0x31')](_0x4e9cab,'name');_0x2cee02[_0x5efc('0x38')]=_[_0x5efc('0x39')](_0xd94404[_0x5efc('0x38')]);_0x2cee02[_0x5efc('0x3a')]=_[_0x5efc('0x3b')](_0x2cee02[_0x5efc('0x37')],_0x2cee02[_0x5efc('0x38')]);_0x111f38[_0x5efc('0x3c')]=_[_0x5efc('0x3b')](_0x2cee02[_0x5efc('0x37')],qs['fields'](_0xd94404[_0x5efc('0x38')][_0x5efc('0x3d')]));_0x111f38[_0x5efc('0x3c')]=_0x111f38[_0x5efc('0x3c')][_0x5efc('0x3e')]?_0x111f38['attributes']:_0x2cee02[_0x5efc('0x37')];if(!_0xd94404[_0x5efc('0x38')][_0x5efc('0x3f')](_0x5efc('0x40'))){_0x111f38[_0x5efc('0x22')]=qs[_0x5efc('0x22')](_0xd94404[_0x5efc('0x38')][_0x5efc('0x22')]);_0x111f38[_0x5efc('0x20')]=qs[_0x5efc('0x20')](_0xd94404['query']['offset']);}_0x111f38[_0x5efc('0x41')]=qs[_0x5efc('0x42')](_0xd94404['query'][_0x5efc('0x42')]);_0x111f38[_0x5efc('0x43')]=qs[_0x5efc('0x3a')](_['pick'](_0xd94404[_0x5efc('0x38')],_0x2cee02[_0x5efc('0x3a')]),_0x4e9cab);if(_0xd94404['query']['filter']){_0x111f38[_0x5efc('0x43')]=_[_0x5efc('0x44')](_0x111f38[_0x5efc('0x43')],{'$or':_[_0x5efc('0x31')](_0x4e9cab,function(_0x484536){if(_0x484536[_0x5efc('0x35')]!==_0x5efc('0x45')){var _0x1a8984={};_0x1a8984[_0x484536[_0x5efc('0x2e')]]={'$like':'%'+_0xd94404[_0x5efc('0x38')]['filter']+'%'};return _0x1a8984;}})});}_0x111f38=_['merge']({},_0x111f38,_0xd94404[_0x5efc('0x46')]);var _0x2369a1={'where':_0x111f38[_0x5efc('0x43')]};return db[_0x5efc('0x32')]['count'](_0x2369a1)['then'](function(_0xff8dcc){_0x15b675[_0x5efc('0x23')]=_0xff8dcc;if(_0xd94404[_0x5efc('0x38')][_0x5efc('0x47')]){_0x111f38[_0x5efc('0x48')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x5efc('0x49')](_0x111f38);})[_0x5efc('0x2a')](function(_0x1873b2){_0x15b675[_0x5efc('0x4a')]=_0x1873b2;return _0x15b675;})['then'](respondWithFilteredResult(_0x17eca1,_0x111f38))['catch'](handleError(_0x17eca1,null));};exports['show']=function(_0x287006,_0x268635){var _0x5d4611={'raw':![],'where':{'id':_0x287006['params']['id']}},_0x563bc8={};_0x563bc8[_0x5efc('0x37')]=_[_0x5efc('0x39')](db[_0x5efc('0x32')]['rawAttributes']);_0x563bc8['query']=_[_0x5efc('0x39')](_0x287006['query']);_0x563bc8[_0x5efc('0x3a')]=_[_0x5efc('0x3b')](_0x563bc8[_0x5efc('0x37')],_0x563bc8['query']);_0x5d4611[_0x5efc('0x3c')]=_['intersection'](_0x563bc8['model'],qs[_0x5efc('0x3d')](_0x287006[_0x5efc('0x38')][_0x5efc('0x3d')]));_0x5d4611['attributes']=_0x5d4611[_0x5efc('0x3c')][_0x5efc('0x3e')]?_0x5d4611['attributes']:_0x563bc8[_0x5efc('0x37')];if(_0x287006['query'][_0x5efc('0x47')]){_0x5d4611[_0x5efc('0x48')]=[{'all':!![]}];}_0x5d4611=_[_0x5efc('0x44')]({},_0x5d4611,_0x287006[_0x5efc('0x46')]);return db[_0x5efc('0x32')][_0x5efc('0x4b')](_0x5d4611)['then'](handleEntityNotFound(_0x268635,null))[_0x5efc('0x2a')](respondWithResult(_0x268635,null))[_0x5efc('0x4c')](handleError(_0x268635,null));};exports['create']=function(_0x4470d0,_0x372fa0){return db['Dynamics365Configuration'][_0x5efc('0x4d')](_0x4470d0[_0x5efc('0x4e')],{})[_0x5efc('0x2a')](respondWithResult(_0x372fa0,0xc9))['catch'](handleError(_0x372fa0,null));};exports[_0x5efc('0x29')]=function(_0x20e5e9,_0x55925a){if(_0x20e5e9['body']['id']){delete _0x20e5e9[_0x5efc('0x4e')]['id'];}return db['Dynamics365Configuration'][_0x5efc('0x4b')]({'where':{'id':_0x20e5e9[_0x5efc('0x4f')]['id']}})[_0x5efc('0x2a')](handleEntityNotFound(_0x55925a,null))[_0x5efc('0x2a')](saveUpdates(_0x20e5e9[_0x5efc('0x4e')],null))['then'](respondWithResult(_0x55925a,null))['catch'](handleError(_0x55925a,null));};exports['destroy']=function(_0x401d01,_0x15a0ec){return db[_0x5efc('0x32')]['find']({'where':{'id':_0x401d01[_0x5efc('0x4f')]['id']}})['then'](handleEntityNotFound(_0x15a0ec,null))[_0x5efc('0x2a')](removeEntity(_0x15a0ec,null))[_0x5efc('0x4c')](handleError(_0x15a0ec,null));};exports[_0x5efc('0x50')]=function(_0x4c50b1,_0x16699c,_0x1ee88d){var _0x4e4408={};var _0x241492={};var _0x497a61;var _0x5384fd;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x4c50b1['params']['id']}})[_0x5efc('0x2a')](handleEntityNotFound(_0x16699c,null))[_0x5efc('0x2a')](function(_0x3d0098){if(_0x3d0098){_0x497a61=_0x3d0098;_0x241492[_0x5efc('0x37')]=_[_0x5efc('0x39')](db['Dynamics365Field'][_0x5efc('0x33')]);_0x241492['query']=_[_0x5efc('0x39')](_0x4c50b1['query']);_0x241492[_0x5efc('0x3a')]=_[_0x5efc('0x3b')](_0x241492['model'],_0x241492[_0x5efc('0x38')]);_0x4e4408[_0x5efc('0x3c')]=_['intersection'](_0x241492['model'],qs[_0x5efc('0x3d')](_0x4c50b1[_0x5efc('0x38')][_0x5efc('0x3d')]));_0x4e4408[_0x5efc('0x3c')]=_0x4e4408['attributes'][_0x5efc('0x3e')]?_0x4e4408[_0x5efc('0x3c')]:_0x241492['model'];_0x4e4408[_0x5efc('0x41')]=qs[_0x5efc('0x42')](_0x4c50b1[_0x5efc('0x38')][_0x5efc('0x42')]);_0x4e4408['where']=qs['filters'](_[_0x5efc('0x51')](_0x4c50b1[_0x5efc('0x38')],_0x241492[_0x5efc('0x3a')]));if(_0x4c50b1[_0x5efc('0x38')][_0x5efc('0x52')]){_0x4e4408[_0x5efc('0x43')]=_[_0x5efc('0x44')](_0x4e4408[_0x5efc('0x43')],{'$or':_[_0x5efc('0x31')](_0x4e4408[_0x5efc('0x3c')],function(_0xc0af2f){var _0x72f3f2={};_0x72f3f2[_0xc0af2f]={'$like':'%'+_0x4c50b1[_0x5efc('0x38')]['filter']+'%'};return _0x72f3f2;})});}_0x4e4408=_[_0x5efc('0x44')]({},_0x4e4408,_0x4c50b1[_0x5efc('0x46')]);return _0x497a61[_0x5efc('0x50')](_0x4e4408);}})['then'](function(_0x16698d){if(_0x16698d){_0x5384fd=_0x16698d['length'];if(!_0x4c50b1[_0x5efc('0x38')][_0x5efc('0x3f')](_0x5efc('0x40'))){_0x4e4408[_0x5efc('0x22')]=qs[_0x5efc('0x22')](_0x4c50b1['query']['limit']);_0x4e4408['offset']=qs[_0x5efc('0x20')](_0x4c50b1[_0x5efc('0x38')]['offset']);}return _0x497a61[_0x5efc('0x50')](_0x4e4408);}})[_0x5efc('0x2a')](function(_0x19ebda){if(_0x19ebda){return _0x19ebda?{'count':_0x5384fd,'rows':_0x19ebda}:null;}})['then'](respondWithResult(_0x16699c,null))[_0x5efc('0x4c')](handleError(_0x16699c,null));};exports['getSubjects']=function(_0x42f601,_0xce019,_0x5e0a45){var _0x1559b4={};var _0x3f89a7={};var _0x3ab4ae;var _0x36e220;return db[_0x5efc('0x32')]['findOne']({'where':{'id':_0x42f601[_0x5efc('0x4f')]['id']}})['then'](handleEntityNotFound(_0xce019,null))['then'](function(_0x426be6){if(_0x426be6){_0x3ab4ae=_0x426be6;_0x3f89a7[_0x5efc('0x37')]=_[_0x5efc('0x39')](db['Dynamics365Field'][_0x5efc('0x33')]);_0x3f89a7[_0x5efc('0x38')]=_[_0x5efc('0x39')](_0x42f601['query']);_0x3f89a7[_0x5efc('0x3a')]=_['intersection'](_0x3f89a7[_0x5efc('0x37')],_0x3f89a7[_0x5efc('0x38')]);_0x1559b4[_0x5efc('0x3c')]=_['intersection'](_0x3f89a7[_0x5efc('0x37')],qs['fields'](_0x42f601[_0x5efc('0x38')][_0x5efc('0x3d')]));_0x1559b4['attributes']=_0x1559b4['attributes'][_0x5efc('0x3e')]?_0x1559b4['attributes']:_0x3f89a7['model'];_0x1559b4[_0x5efc('0x41')]=qs['sort'](_0x42f601[_0x5efc('0x38')][_0x5efc('0x42')]);_0x1559b4[_0x5efc('0x43')]=qs[_0x5efc('0x3a')](_[_0x5efc('0x51')](_0x42f601[_0x5efc('0x38')],_0x3f89a7['filters']));if(_0x42f601[_0x5efc('0x38')][_0x5efc('0x52')]){_0x1559b4[_0x5efc('0x43')]=_[_0x5efc('0x44')](_0x1559b4[_0x5efc('0x43')],{'$or':_[_0x5efc('0x31')](_0x1559b4[_0x5efc('0x3c')],function(_0x3d79a3){var _0x2316a0={};_0x2316a0[_0x3d79a3]={'$like':'%'+_0x42f601[_0x5efc('0x38')][_0x5efc('0x52')]+'%'};return _0x2316a0;})});}_0x1559b4=_[_0x5efc('0x44')]({},_0x1559b4,_0x42f601[_0x5efc('0x46')]);return _0x3ab4ae[_0x5efc('0x53')](_0x1559b4);}})[_0x5efc('0x2a')](function(_0x1cae04){if(_0x1cae04){_0x36e220=_0x1cae04['length'];if(!_0x42f601['query'][_0x5efc('0x3f')]('nolimit')){_0x1559b4[_0x5efc('0x22')]=qs[_0x5efc('0x22')](_0x42f601['query'][_0x5efc('0x22')]);_0x1559b4['offset']=qs[_0x5efc('0x20')](_0x42f601['query'][_0x5efc('0x20')]);}return _0x3ab4ae[_0x5efc('0x53')](_0x1559b4);}})['then'](function(_0x1b721c){if(_0x1b721c){return _0x1b721c?{'count':_0x36e220,'rows':_0x1b721c}:null;}})[_0x5efc('0x2a')](respondWithResult(_0xce019,null))[_0x5efc('0x4c')](handleError(_0xce019,null));};exports[_0x5efc('0x54')]=function(_0x5d4645,_0x282e2f,_0x178072){var _0x5916d3={};var _0xaeb117={};var _0x3c05d6;var _0x4cf1ee;return db[_0x5efc('0x32')]['findOne']({'where':{'id':_0x5d4645['params']['id']}})[_0x5efc('0x2a')](handleEntityNotFound(_0x282e2f,null))[_0x5efc('0x2a')](function(_0x553af5){if(_0x553af5){_0x3c05d6=_0x553af5;_0xaeb117['model']=_[_0x5efc('0x39')](db[_0x5efc('0x55')][_0x5efc('0x33')]);_0xaeb117[_0x5efc('0x38')]=_['keys'](_0x5d4645[_0x5efc('0x38')]);_0xaeb117[_0x5efc('0x3a')]=_[_0x5efc('0x3b')](_0xaeb117[_0x5efc('0x37')],_0xaeb117[_0x5efc('0x38')]);_0x5916d3['attributes']=_[_0x5efc('0x3b')](_0xaeb117[_0x5efc('0x37')],qs[_0x5efc('0x3d')](_0x5d4645[_0x5efc('0x38')][_0x5efc('0x3d')]));_0x5916d3[_0x5efc('0x3c')]=_0x5916d3['attributes']['length']?_0x5916d3[_0x5efc('0x3c')]:_0xaeb117['model'];_0x5916d3['order']=qs[_0x5efc('0x42')](_0x5d4645[_0x5efc('0x38')]['sort']);_0x5916d3[_0x5efc('0x43')]=qs[_0x5efc('0x3a')](_[_0x5efc('0x51')](_0x5d4645[_0x5efc('0x38')],_0xaeb117['filters']));if(_0x5d4645['query'][_0x5efc('0x52')]){_0x5916d3['where']=_['merge'](_0x5916d3['where'],{'$or':_[_0x5efc('0x31')](_0x5916d3['attributes'],function(_0x4e98f4){var _0x5b6120={};_0x5b6120[_0x4e98f4]={'$like':'%'+_0x5d4645[_0x5efc('0x38')][_0x5efc('0x52')]+'%'};return _0x5b6120;})});}_0x5916d3=_[_0x5efc('0x44')]({},_0x5916d3,_0x5d4645[_0x5efc('0x46')]);return _0x3c05d6[_0x5efc('0x54')](_0x5916d3);}})[_0x5efc('0x2a')](function(_0x5334d6){if(_0x5334d6){_0x4cf1ee=_0x5334d6[_0x5efc('0x3e')];if(!_0x5d4645['query'][_0x5efc('0x3f')](_0x5efc('0x40'))){_0x5916d3[_0x5efc('0x22')]=qs['limit'](_0x5d4645[_0x5efc('0x38')][_0x5efc('0x22')]);_0x5916d3[_0x5efc('0x20')]=qs[_0x5efc('0x20')](_0x5d4645['query'][_0x5efc('0x20')]);}return _0x3c05d6['getDescriptions'](_0x5916d3);}})[_0x5efc('0x2a')](function(_0x364ecf){if(_0x364ecf){return _0x364ecf?{'count':_0x4cf1ee,'rows':_0x364ecf}:null;}})[_0x5efc('0x2a')](respondWithResult(_0x282e2f,null))[_0x5efc('0x4c')](handleError(_0x282e2f,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index d513315..ab8702e 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 _0x70e0=['int_dynamics365_configurations','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes'];(function(_0x56eaa4,_0xe8ca71){var _0xa7e4a3=function(_0x28cdb0){while(--_0x28cdb0){_0x56eaa4['push'](_0x56eaa4['shift']());}};_0xa7e4a3(++_0xe8ca71);}(_0x70e0,0x17b));var _0x070e=function(_0x29dcb7,_0x5ca4fb){_0x29dcb7=_0x29dcb7-0x0;var _0xe31605=_0x70e0[_0x29dcb7];return _0xe31605;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('Dynamics365Configuration',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf109=['Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define'];(function(_0x323437,_0x3bc345){var _0x2da452=function(_0x1d3776){while(--_0x1d3776){_0x323437['push'](_0x323437['shift']());}};_0x2da452(++_0x3bc345);}(_0xf109,0xce));var _0x9f10=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xf109[_0x101e7b];return _0x4995c0;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var logger=require(_0x9f10('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f10('0x3'));var fs=require('fs');var path=require(_0x9f10('0x4'));var rimraf=require(_0x9f10('0x5'));var config=require(_0x9f10('0x6'));var attributes=require(_0x9f10('0x7'));module[_0x9f10('0x8')]=function(_0x408fe8,_0xd3137b){return _0x408fe8[_0x9f10('0x9')](_0x9f10('0xa'),attributes,{'tableName':_0x9f10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index fd24fb3..b49b7aa 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 _0xf02d=['catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x24baa7,_0x461080){var _0x14f4d0=function(_0x4f77d4){while(--_0x4f77d4){_0x24baa7['push'](_0x24baa7['shift']());}};_0x14f4d0(++_0x461080);}(_0xf02d,0xb1));var _0xdf02=function(_0x335e3f,_0x1c019d){_0x335e3f=_0x335e3f-0x0;var _0x3e809a=_0xf02d[_0x335e3f];return _0x3e809a;};'use strict';var _=require(_0xdf02('0x0'));var util=require('util');var moment=require(_0xdf02('0x1'));var BPromise=require(_0xdf02('0x2'));var rs=require(_0xdf02('0x3'));var fs=require('fs');var Redis=require(_0xdf02('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf02('0x5'));var logger=require('../../config/logger')(_0xdf02('0x6'));var config=require(_0xdf02('0x7'));var jayson=require(_0xdf02('0x8'));var client=jayson['client'][_0xdf02('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f20d4,_0x1ac256,_0xdb12e7){return new BPromise(function(_0x5563a6,_0x13935b){return client[_0xdf02('0xa')](_0x3f20d4,_0xdb12e7)[_0xdf02('0xb')](function(_0x30329e){logger[_0xdf02('0xc')](_0xdf02('0xd'),_0x1ac256,_0xdf02('0xe'));logger['debug'](_0xdf02('0xf'),_0x1ac256,_0xdf02('0xe'),JSON[_0xdf02('0x10')](_0x30329e));if(_0x30329e[_0xdf02('0x11')]){if(_0x30329e['error'][_0xdf02('0x12')]===0x1f4){logger[_0xdf02('0x11')](_0xdf02('0xd'),_0x1ac256,_0x30329e[_0xdf02('0x11')][_0xdf02('0x13')]);return _0x13935b(_0x30329e[_0xdf02('0x11')]['message']);}logger[_0xdf02('0x11')](_0xdf02('0xd'),_0x1ac256,_0x30329e[_0xdf02('0x11')][_0xdf02('0x13')]);return _0x5563a6(_0x30329e['error'][_0xdf02('0x13')]);}else{logger[_0xdf02('0xc')](_0xdf02('0xd'),_0x1ac256,_0xdf02('0xe'));_0x5563a6(_0x30329e[_0xdf02('0x14')]['message']);}})[_0xdf02('0x15')](function(_0x55c3b6){logger[_0xdf02('0x11')](_0xdf02('0xd'),_0x1ac256,_0x55c3b6);_0x13935b(_0x55c3b6);});});} \ No newline at end of file +var _0x3e50=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x8fd77a,_0x1f1cbf){var _0x1b6fd3=function(_0xdf07b7){while(--_0xdf07b7){_0x8fd77a['push'](_0x8fd77a['shift']());}};_0x1b6fd3(++_0x1f1cbf);}(_0x3e50,0x1de));var _0x03e5=function(_0x237e18,_0x278dbd){_0x237e18=_0x237e18-0x0;var _0x4f48d7=_0x3e50[_0x237e18];return _0x4f48d7;};'use strict';var _=require(_0x03e5('0x0'));var util=require(_0x03e5('0x1'));var moment=require('moment');var BPromise=require(_0x03e5('0x2'));var rs=require(_0x03e5('0x3'));var fs=require('fs');var Redis=require(_0x03e5('0x4'));var db=require(_0x03e5('0x5'))['db'];var utils=require(_0x03e5('0x6'));var logger=require(_0x03e5('0x7'))(_0x03e5('0x8'));var config=require(_0x03e5('0x9'));var jayson=require(_0x03e5('0xa'));var client=jayson[_0x03e5('0xb')][_0x03e5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x48bb8a,_0x24ab31,_0x2217b5){return new BPromise(function(_0x3c74d5,_0x32fbad){return client['request'](_0x48bb8a,_0x2217b5)[_0x03e5('0xd')](function(_0x409e67){logger[_0x03e5('0xe')](_0x03e5('0xf'),_0x24ab31,_0x03e5('0x10'));logger['debug'](_0x03e5('0x11'),_0x24ab31,_0x03e5('0x10'),JSON[_0x03e5('0x12')](_0x409e67));if(_0x409e67[_0x03e5('0x13')]){if(_0x409e67[_0x03e5('0x13')][_0x03e5('0x14')]===0x1f4){logger[_0x03e5('0x13')](_0x03e5('0xf'),_0x24ab31,_0x409e67[_0x03e5('0x13')]['message']);return _0x32fbad(_0x409e67['error']['message']);}logger[_0x03e5('0x13')](_0x03e5('0xf'),_0x24ab31,_0x409e67['error'][_0x03e5('0x15')]);return _0x3c74d5(_0x409e67[_0x03e5('0x13')][_0x03e5('0x15')]);}else{logger[_0x03e5('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x24ab31,_0x03e5('0x10'));_0x3c74d5(_0x409e67[_0x03e5('0x16')][_0x03e5('0x15')]);}})[_0x03e5('0x17')](function(_0xfaee57){logger[_0x03e5('0x13')](_0x03e5('0xf'),_0x24ab31,_0xfaee57);_0x32fbad(_0xfaee57);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 2ae5023..53e3039 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 _0x4d2d=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','post','put','/:id','delete','exports','multer','util','path','connect-timeout','Router'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0x4d2d,0x187));var _0xd4d2=function(_0x2c32ad,_0x1a12d4){_0x2c32ad=_0x2c32ad-0x0;var _0x1d474f=_0x4d2d[_0x2c32ad];return _0x1d474f;};'use strict';var multer=require(_0xd4d2('0x0'));var util=require(_0xd4d2('0x1'));var path=require(_0xd4d2('0x2'));var timeout=require(_0xd4d2('0x3'));var express=require('express');var router=express[_0xd4d2('0x4')]();var fs_extra=require(_0xd4d2('0x5'));var auth=require(_0xd4d2('0x6'));var interaction=require(_0xd4d2('0x7'));var config=require(_0xd4d2('0x8'));var controller=require(_0xd4d2('0x9'));router[_0xd4d2('0xa')]('/',auth[_0xd4d2('0xb')](),controller[_0xd4d2('0xc')]);router[_0xd4d2('0xa')]('/:id',auth[_0xd4d2('0xb')](),controller['show']);router[_0xd4d2('0xd')]('/',auth[_0xd4d2('0xb')](),controller['create']);router[_0xd4d2('0xe')](_0xd4d2('0xf'),auth[_0xd4d2('0xb')](),controller['update']);router[_0xd4d2('0x10')](_0xd4d2('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xd4d2('0x11')]=router; \ No newline at end of file +var _0x1332=['post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','index','get','/:id','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1332,0x157));var _0x2133=function(_0x4b4319,_0x4e38e4){_0x4b4319=_0x4b4319-0x0;var _0x404d4f=_0x1332[_0x4b4319];return _0x404d4f;};'use strict';var multer=require(_0x2133('0x0'));var util=require(_0x2133('0x1'));var path=require(_0x2133('0x2'));var timeout=require('connect-timeout');var express=require(_0x2133('0x3'));var router=express[_0x2133('0x4')]();var fs_extra=require(_0x2133('0x5'));var auth=require(_0x2133('0x6'));var interaction=require(_0x2133('0x7'));var config=require(_0x2133('0x8'));var controller=require(_0x2133('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x2133('0xa')]);router[_0x2133('0xb')](_0x2133('0xc'),auth[_0x2133('0xd')](),controller['show']);router[_0x2133('0xe')]('/',auth[_0x2133('0xd')](),controller[_0x2133('0xf')]);router[_0x2133('0x10')](_0x2133('0xc'),auth['isAuthenticated'](),controller[_0x2133('0x11')]);router[_0x2133('0x12')](_0x2133('0xc'),auth['isAuthenticated'](),controller[_0x2133('0x13')]);module[_0x2133('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 e6470cf..ef5dcd7 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 _0xa002=['ENUM','variable','sequelize','string','customVariable','keyValue','STRING'];(function(_0xfc7c8e,_0x5093fe){var _0x5bfc9b=function(_0x5c3468){while(--_0x5c3468){_0xfc7c8e['push'](_0xfc7c8e['shift']());}};_0x5bfc9b(++_0x5093fe);}(_0xa002,0x128));var _0x2a00=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa002[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x2a00('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x2a00('0x1'),'variable',_0x2a00('0x2'),_0x2a00('0x3'),'picklist'),'defaultValue':_0x2a00('0x1')},'content':{'type':Sequelize[_0x2a00('0x4')]},'key':{'type':Sequelize[_0x2a00('0x4')]},'keyType':{'type':Sequelize[_0x2a00('0x5')](_0x2a00('0x1'),_0x2a00('0x6'),_0x2a00('0x2'))},'keyContent':{'type':Sequelize[_0x2a00('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2a00('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xef6d=['STRING','BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue','picklist'];(function(_0x4383c4,_0xb1a7ab){var _0x2f77ca=function(_0x2d9a68){while(--_0x2d9a68){_0x4383c4['push'](_0x4383c4['shift']());}};_0x2f77ca(++_0xb1a7ab);}(_0xef6d,0x110));var _0xdef6=function(_0x56c799,_0x5055a9){_0x56c799=_0x56c799-0x0;var _0x220289=_0xef6d[_0x56c799];return _0x220289;};'use strict';var Sequelize=require(_0xdef6('0x0'));module[_0xdef6('0x1')]={'type':{'type':Sequelize['ENUM'](_0xdef6('0x2'),_0xdef6('0x3'),_0xdef6('0x4'),_0xdef6('0x5'),_0xdef6('0x6')),'defaultValue':_0xdef6('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xdef6('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xdef6('0x2'),_0xdef6('0x3'),_0xdef6('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xdef6('0x7')]},'nameField':{'type':Sequelize[_0xdef6('0x7')]},'customField':{'type':Sequelize[_0xdef6('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdef6('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index f39b15f..189bb5b 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 _0x1b92=['rawAttributes','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','end','name','send','map','Dynamics365Field','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','catch','params'];(function(_0x3cd469,_0x2b847e){var _0x41d4e9=function(_0x204e8b){while(--_0x204e8b){_0x3cd469['push'](_0x3cd469['shift']());}};_0x41d4e9(++_0x2b847e);}(_0x1b92,0x95));var _0x21b9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1b92[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x21b9('0x0'));var rimraf=require(_0x21b9('0x1'));var zipdir=require(_0x21b9('0x2'));var jsonpatch=require(_0x21b9('0x3'));var rp=require(_0x21b9('0x4'));var moment=require(_0x21b9('0x5'));var BPromise=require(_0x21b9('0x6'));var Mustache=require(_0x21b9('0x7'));var util=require('util');var path=require('path');var sox=require(_0x21b9('0x8'));var csv=require(_0x21b9('0x9'));var ejs=require(_0x21b9('0xa'));var fs=require('fs');var fs_extra=require(_0x21b9('0xb'));var _=require('lodash');var squel=require(_0x21b9('0xc'));var crypto=require('crypto');var jsforce=require(_0x21b9('0xd'));var deskjs=require(_0x21b9('0xe'));var toCsv=require('to-csv');var querystring=require(_0x21b9('0xf'));var Papa=require(_0x21b9('0x10'));var Redis=require(_0x21b9('0x11'));var authService=require(_0x21b9('0x12'));var qs=require(_0x21b9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x21b9('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x21b9('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x21b9('0x16'));var db=require(_0x21b9('0x17'))['db'];function respondWithStatusCode(_0x1b5dc7,_0x197803){_0x197803=_0x197803||0xcc;return function(_0x1cd500){if(_0x1cd500){return _0x1b5dc7[_0x21b9('0x18')](_0x197803);}return _0x1b5dc7['status'](_0x197803)['end']();};}function respondWithResult(_0x1e72df,_0x1b3b32){_0x1b3b32=_0x1b3b32||0xc8;return function(_0x40a3bc){if(_0x40a3bc){return _0x1e72df[_0x21b9('0x19')](_0x1b3b32)[_0x21b9('0x1a')](_0x40a3bc);}};}function respondWithFilteredResult(_0x5f8fa3,_0x3a469f){return function(_0x47fe49){if(_0x47fe49){var _0x2def58=typeof _0x3a469f[_0x21b9('0x1b')]===_0x21b9('0x1c')&&typeof _0x3a469f[_0x21b9('0x1d')]===_0x21b9('0x1c');var _0x29563c=_0x47fe49['count'];var _0x58e8b6=_0x2def58?0x0:_0x3a469f['offset'];var _0x1e0138=_0x2def58?_0x47fe49['count']:_0x3a469f[_0x21b9('0x1b')]+_0x3a469f[_0x21b9('0x1d')];var _0x5ddbbc;if(_0x1e0138>=_0x29563c){_0x1e0138=_0x29563c;_0x5ddbbc=0xc8;}else{_0x5ddbbc=0xce;}_0x5f8fa3[_0x21b9('0x19')](_0x5ddbbc);return _0x5f8fa3[_0x21b9('0x1e')](_0x21b9('0x1f'),_0x58e8b6+'-'+_0x1e0138+'/'+_0x29563c)[_0x21b9('0x1a')](_0x47fe49);}return null;};}function patchUpdates(_0x2c811b){return function(_0x3ab0c8){try{jsonpatch[_0x21b9('0x20')](_0x3ab0c8,_0x2c811b,!![]);}catch(_0x1f0c81){return BPromise['reject'](_0x1f0c81);}return _0x3ab0c8[_0x21b9('0x21')]();};}function saveUpdates(_0x212006,_0x1ffe70){return function(_0x63cec6){if(_0x63cec6){return _0x63cec6[_0x21b9('0x22')](_0x212006)[_0x21b9('0x23')](function(_0x2ac897){return _0x2ac897;});}return null;};}function removeEntity(_0xe3ede7,_0x5b3970){return function(_0x185313){if(_0x185313){return _0x185313['destroy']()[_0x21b9('0x23')](function(){_0xe3ede7['status'](0xcc)[_0x21b9('0x24')]();});}};}function handleEntityNotFound(_0x1f7740,_0x2370d1){return function(_0x217690){if(!_0x217690){_0x1f7740[_0x21b9('0x18')](0x194);}return _0x217690;};}function handleError(_0x2dcff1,_0x7a0115){_0x7a0115=_0x7a0115||0x1f4;return function(_0x5797d2){logger['error'](_0x5797d2['stack']);if(_0x5797d2[_0x21b9('0x25')]){delete _0x5797d2['name'];}_0x2dcff1[_0x21b9('0x19')](_0x7a0115)[_0x21b9('0x26')](_0x5797d2);};}exports['index']=function(_0x4cda3d,_0xd3194){var _0x86490={},_0x2c2350={},_0xdabe32={'count':0x0,'rows':[]};var _0x3eaac=_[_0x21b9('0x27')](db[_0x21b9('0x28')]['rawAttributes'],function(_0x147b9d){return{'name':_0x147b9d['fieldName'],'type':_0x147b9d[_0x21b9('0x29')][_0x21b9('0x2a')]};});_0x2c2350['model']=_['map'](_0x3eaac,_0x21b9('0x25'));_0x2c2350[_0x21b9('0x2b')]=_[_0x21b9('0x2c')](_0x4cda3d[_0x21b9('0x2b')]);_0x2c2350[_0x21b9('0x2d')]=_[_0x21b9('0x2e')](_0x2c2350[_0x21b9('0x2f')],_0x2c2350[_0x21b9('0x2b')]);_0x86490['attributes']=_[_0x21b9('0x2e')](_0x2c2350[_0x21b9('0x2f')],qs['fields'](_0x4cda3d[_0x21b9('0x2b')][_0x21b9('0x30')]));_0x86490[_0x21b9('0x31')]=_0x86490[_0x21b9('0x31')][_0x21b9('0x32')]?_0x86490[_0x21b9('0x31')]:_0x2c2350[_0x21b9('0x2f')];if(!_0x4cda3d[_0x21b9('0x2b')][_0x21b9('0x33')](_0x21b9('0x34'))){_0x86490[_0x21b9('0x1d')]=qs[_0x21b9('0x1d')](_0x4cda3d[_0x21b9('0x2b')]['limit']);_0x86490[_0x21b9('0x1b')]=qs[_0x21b9('0x1b')](_0x4cda3d['query'][_0x21b9('0x1b')]);}_0x86490[_0x21b9('0x35')]=qs[_0x21b9('0x36')](_0x4cda3d['query'][_0x21b9('0x36')]);_0x86490[_0x21b9('0x37')]=qs[_0x21b9('0x2d')](_[_0x21b9('0x38')](_0x4cda3d[_0x21b9('0x2b')],_0x2c2350['filters']),_0x3eaac);if(_0x4cda3d[_0x21b9('0x2b')]['filter']){_0x86490[_0x21b9('0x37')]=_[_0x21b9('0x39')](_0x86490['where'],{'$or':_[_0x21b9('0x27')](_0x3eaac,function(_0x19adf7){if(_0x19adf7[_0x21b9('0x29')]!==_0x21b9('0x3a')){var _0x19db5d={};_0x19db5d[_0x19adf7[_0x21b9('0x25')]]={'$like':'%'+_0x4cda3d['query'][_0x21b9('0x3b')]+'%'};return _0x19db5d;}})});}_0x86490=_['merge']({},_0x86490,_0x4cda3d[_0x21b9('0x3c')]);var _0x17c86d={'where':_0x86490[_0x21b9('0x37')]};return db['Dynamics365Field']['count'](_0x17c86d)[_0x21b9('0x23')](function(_0x5ebaac){_0xdabe32[_0x21b9('0x3d')]=_0x5ebaac;if(_0x4cda3d[_0x21b9('0x2b')][_0x21b9('0x3e')]){_0x86490[_0x21b9('0x3f')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x21b9('0x40')](_0x86490);})[_0x21b9('0x23')](function(_0x2ecfb3){_0xdabe32['rows']=_0x2ecfb3;return _0xdabe32;})[_0x21b9('0x23')](respondWithFilteredResult(_0xd3194,_0x86490))[_0x21b9('0x41')](handleError(_0xd3194,null));};exports['show']=function(_0x2d6bfe,_0x4d6342){var _0x85bed1={'raw':!![],'where':{'id':_0x2d6bfe[_0x21b9('0x42')]['id']}},_0x3bf777={};_0x3bf777['model']=_[_0x21b9('0x2c')](db[_0x21b9('0x28')][_0x21b9('0x43')]);_0x3bf777['query']=_['keys'](_0x2d6bfe[_0x21b9('0x2b')]);_0x3bf777[_0x21b9('0x2d')]=_[_0x21b9('0x2e')](_0x3bf777[_0x21b9('0x2f')],_0x3bf777[_0x21b9('0x2b')]);_0x85bed1['attributes']=_[_0x21b9('0x2e')](_0x3bf777['model'],qs[_0x21b9('0x30')](_0x2d6bfe[_0x21b9('0x2b')]['fields']));_0x85bed1[_0x21b9('0x31')]=_0x85bed1[_0x21b9('0x31')]['length']?_0x85bed1[_0x21b9('0x31')]:_0x3bf777[_0x21b9('0x2f')];if(_0x2d6bfe[_0x21b9('0x2b')]['includeAll']){_0x85bed1['include']=[{'all':!![]}];}_0x85bed1=_['merge']({},_0x85bed1,_0x2d6bfe[_0x21b9('0x3c')]);return db['Dynamics365Field'][_0x21b9('0x44')](_0x85bed1)[_0x21b9('0x23')](handleEntityNotFound(_0x4d6342,null))[_0x21b9('0x23')](respondWithResult(_0x4d6342,null))[_0x21b9('0x41')](handleError(_0x4d6342,null));};exports[_0x21b9('0x45')]=function(_0x2f60fc,_0x414411){return db[_0x21b9('0x28')][_0x21b9('0x45')](_0x2f60fc[_0x21b9('0x46')],{})[_0x21b9('0x23')](respondWithResult(_0x414411,0xc9))[_0x21b9('0x41')](handleError(_0x414411,null));};exports[_0x21b9('0x22')]=function(_0x6b9dc2,_0x19c066){if(_0x6b9dc2[_0x21b9('0x46')]['id']){delete _0x6b9dc2[_0x21b9('0x46')]['id'];}return db['Dynamics365Field'][_0x21b9('0x44')]({'where':{'id':_0x6b9dc2[_0x21b9('0x42')]['id']}})[_0x21b9('0x23')](handleEntityNotFound(_0x19c066,null))[_0x21b9('0x23')](saveUpdates(_0x6b9dc2['body'],null))[_0x21b9('0x23')](respondWithResult(_0x19c066,null))[_0x21b9('0x41')](handleError(_0x19c066,null));};exports[_0x21b9('0x47')]=function(_0x5cad26,_0xa8219e){return db[_0x21b9('0x28')][_0x21b9('0x44')]({'where':{'id':_0x5cad26[_0x21b9('0x42')]['id']}})['then'](handleEntityNotFound(_0xa8219e,null))[_0x21b9('0x23')](removeEntity(_0xa8219e,null))['catch'](handleError(_0xa8219e,null));}; \ No newline at end of file +var _0xe2fa=['length','includeAll','options','find','catch','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','end','undefined','limit','count','offset','set','json','apply','reject','save','update','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','where','pick','filters','filter','merge','VIRTUAL','then','include','findAll','rows','show','params','Dynamics365Field'];(function(_0x5865c2,_0x396dc8){var _0x292cf6=function(_0x22fabc){while(--_0x22fabc){_0x5865c2['push'](_0x5865c2['shift']());}};_0x292cf6(++_0x396dc8);}(_0xe2fa,0x9c));var _0xae2f=function(_0x2834b0,_0x4cfed5){_0x2834b0=_0x2834b0-0x0;var _0x3704ae=_0xe2fa[_0x2834b0];return _0x3704ae;};'use strict';var emlformat=require(_0xae2f('0x0'));var rimraf=require(_0xae2f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xae2f('0x2'));var rp=require(_0xae2f('0x3'));var moment=require(_0xae2f('0x4'));var BPromise=require(_0xae2f('0x5'));var Mustache=require(_0xae2f('0x6'));var util=require(_0xae2f('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xae2f('0x8'));var ejs=require(_0xae2f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xae2f('0xa'));var squel=require('squel');var crypto=require(_0xae2f('0xb'));var jsforce=require(_0xae2f('0xc'));var deskjs=require(_0xae2f('0xd'));var toCsv=require(_0xae2f('0x8'));var querystring=require(_0xae2f('0xe'));var Papa=require(_0xae2f('0xf'));var Redis=require('ioredis');var authService=require(_0xae2f('0x10'));var qs=require(_0xae2f('0x11'));var as=require(_0xae2f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xae2f('0x13'))(_0xae2f('0x14'));var utils=require(_0xae2f('0x15'));var config=require(_0xae2f('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xdf3d9b,_0x37150d){_0x37150d=_0x37150d||0xcc;return function(_0x412395){if(_0x412395){return _0xdf3d9b['sendStatus'](_0x37150d);}return _0xdf3d9b[_0xae2f('0x17')](_0x37150d)[_0xae2f('0x18')]();};}function respondWithResult(_0xedfa66,_0x4b1dac){_0x4b1dac=_0x4b1dac||0xc8;return function(_0x3fcf2e){if(_0x3fcf2e){return _0xedfa66[_0xae2f('0x17')](_0x4b1dac)['json'](_0x3fcf2e);}};}function respondWithFilteredResult(_0x48042c,_0x123ba6){return function(_0x295fc8){if(_0x295fc8){var _0x45c265=typeof _0x123ba6['offset']===_0xae2f('0x19')&&typeof _0x123ba6[_0xae2f('0x1a')]===_0xae2f('0x19');var _0x3b228f=_0x295fc8[_0xae2f('0x1b')];var _0x3e6051=_0x45c265?0x0:_0x123ba6[_0xae2f('0x1c')];var _0x46ea67=_0x45c265?_0x295fc8[_0xae2f('0x1b')]:_0x123ba6[_0xae2f('0x1c')]+_0x123ba6[_0xae2f('0x1a')];var _0x105718;if(_0x46ea67>=_0x3b228f){_0x46ea67=_0x3b228f;_0x105718=0xc8;}else{_0x105718=0xce;}_0x48042c[_0xae2f('0x17')](_0x105718);return _0x48042c[_0xae2f('0x1d')]('Content-Range',_0x3e6051+'-'+_0x46ea67+'/'+_0x3b228f)[_0xae2f('0x1e')](_0x295fc8);}return null;};}function patchUpdates(_0x13a3e1){return function(_0x56d5ed){try{jsonpatch[_0xae2f('0x1f')](_0x56d5ed,_0x13a3e1,!![]);}catch(_0x249373){return BPromise[_0xae2f('0x20')](_0x249373);}return _0x56d5ed[_0xae2f('0x21')]();};}function saveUpdates(_0x4b3ae8,_0x54900b){return function(_0x5aca41){if(_0x5aca41){return _0x5aca41[_0xae2f('0x22')](_0x4b3ae8)['then'](function(_0x42c77b){return _0x42c77b;});}return null;};}function removeEntity(_0xe7b3c3,_0x61b8ad){return function(_0x12cd5e){if(_0x12cd5e){return _0x12cd5e['destroy']()['then'](function(){_0xe7b3c3[_0xae2f('0x17')](0xcc)[_0xae2f('0x18')]();});}};}function handleEntityNotFound(_0x8c45ed,_0x194896){return function(_0x30fc1b){if(!_0x30fc1b){_0x8c45ed[_0xae2f('0x23')](0x194);}return _0x30fc1b;};}function handleError(_0xd69884,_0x257fd3){_0x257fd3=_0x257fd3||0x1f4;return function(_0x160870){logger[_0xae2f('0x24')](_0x160870[_0xae2f('0x25')]);if(_0x160870[_0xae2f('0x26')]){delete _0x160870[_0xae2f('0x26')];}_0xd69884[_0xae2f('0x17')](_0x257fd3)[_0xae2f('0x27')](_0x160870);};}exports[_0xae2f('0x28')]=function(_0x403a88,_0x14a657){var _0x7f8da9={},_0x13802e={},_0x5d0729={'count':0x0,'rows':[]};var _0x45ec28=_[_0xae2f('0x29')](db['Dynamics365Field'][_0xae2f('0x2a')],function(_0x4698df){return{'name':_0x4698df[_0xae2f('0x2b')],'type':_0x4698df[_0xae2f('0x2c')]['key']};});_0x13802e[_0xae2f('0x2d')]=_[_0xae2f('0x29')](_0x45ec28,_0xae2f('0x26'));_0x13802e[_0xae2f('0x2e')]=_[_0xae2f('0x2f')](_0x403a88[_0xae2f('0x2e')]);_0x13802e['filters']=_[_0xae2f('0x30')](_0x13802e[_0xae2f('0x2d')],_0x13802e[_0xae2f('0x2e')]);_0x7f8da9[_0xae2f('0x31')]=_[_0xae2f('0x30')](_0x13802e[_0xae2f('0x2d')],qs[_0xae2f('0x32')](_0x403a88['query'][_0xae2f('0x32')]));_0x7f8da9[_0xae2f('0x31')]=_0x7f8da9[_0xae2f('0x31')]['length']?_0x7f8da9[_0xae2f('0x31')]:_0x13802e[_0xae2f('0x2d')];if(!_0x403a88['query'][_0xae2f('0x33')]('nolimit')){_0x7f8da9[_0xae2f('0x1a')]=qs[_0xae2f('0x1a')](_0x403a88['query'][_0xae2f('0x1a')]);_0x7f8da9[_0xae2f('0x1c')]=qs[_0xae2f('0x1c')](_0x403a88[_0xae2f('0x2e')][_0xae2f('0x1c')]);}_0x7f8da9[_0xae2f('0x34')]=qs['sort'](_0x403a88[_0xae2f('0x2e')]['sort']);_0x7f8da9[_0xae2f('0x35')]=qs['filters'](_[_0xae2f('0x36')](_0x403a88[_0xae2f('0x2e')],_0x13802e[_0xae2f('0x37')]),_0x45ec28);if(_0x403a88[_0xae2f('0x2e')][_0xae2f('0x38')]){_0x7f8da9[_0xae2f('0x35')]=_[_0xae2f('0x39')](_0x7f8da9[_0xae2f('0x35')],{'$or':_[_0xae2f('0x29')](_0x45ec28,function(_0x582087){if(_0x582087[_0xae2f('0x2c')]!==_0xae2f('0x3a')){var _0x2cfd79={};_0x2cfd79[_0x582087[_0xae2f('0x26')]]={'$like':'%'+_0x403a88[_0xae2f('0x2e')]['filter']+'%'};return _0x2cfd79;}})});}_0x7f8da9=_[_0xae2f('0x39')]({},_0x7f8da9,_0x403a88['options']);var _0x1cc5a5={'where':_0x7f8da9[_0xae2f('0x35')]};return db['Dynamics365Field'][_0xae2f('0x1b')](_0x1cc5a5)[_0xae2f('0x3b')](function(_0x3799ec){_0x5d0729[_0xae2f('0x1b')]=_0x3799ec;if(_0x403a88[_0xae2f('0x2e')]['includeAll']){_0x7f8da9[_0xae2f('0x3c')]=[{'all':!![]}];}return db['Dynamics365Field'][_0xae2f('0x3d')](_0x7f8da9);})[_0xae2f('0x3b')](function(_0x2f0684){_0x5d0729[_0xae2f('0x3e')]=_0x2f0684;return _0x5d0729;})[_0xae2f('0x3b')](respondWithFilteredResult(_0x14a657,_0x7f8da9))['catch'](handleError(_0x14a657,null));};exports[_0xae2f('0x3f')]=function(_0x4bf585,_0x15ebc5){var _0x2cfe40={'raw':!![],'where':{'id':_0x4bf585[_0xae2f('0x40')]['id']}},_0x76d243={};_0x76d243[_0xae2f('0x2d')]=_[_0xae2f('0x2f')](db[_0xae2f('0x41')]['rawAttributes']);_0x76d243[_0xae2f('0x2e')]=_['keys'](_0x4bf585[_0xae2f('0x2e')]);_0x76d243[_0xae2f('0x37')]=_[_0xae2f('0x30')](_0x76d243[_0xae2f('0x2d')],_0x76d243['query']);_0x2cfe40[_0xae2f('0x31')]=_[_0xae2f('0x30')](_0x76d243[_0xae2f('0x2d')],qs['fields'](_0x4bf585[_0xae2f('0x2e')][_0xae2f('0x32')]));_0x2cfe40[_0xae2f('0x31')]=_0x2cfe40['attributes'][_0xae2f('0x42')]?_0x2cfe40[_0xae2f('0x31')]:_0x76d243['model'];if(_0x4bf585[_0xae2f('0x2e')][_0xae2f('0x43')]){_0x2cfe40['include']=[{'all':!![]}];}_0x2cfe40=_[_0xae2f('0x39')]({},_0x2cfe40,_0x4bf585[_0xae2f('0x44')]);return db[_0xae2f('0x41')][_0xae2f('0x45')](_0x2cfe40)[_0xae2f('0x3b')](handleEntityNotFound(_0x15ebc5,null))[_0xae2f('0x3b')](respondWithResult(_0x15ebc5,null))[_0xae2f('0x46')](handleError(_0x15ebc5,null));};exports[_0xae2f('0x47')]=function(_0x31ee11,_0x28ebba){return db['Dynamics365Field'][_0xae2f('0x47')](_0x31ee11[_0xae2f('0x48')],{})['then'](respondWithResult(_0x28ebba,0xc9))[_0xae2f('0x46')](handleError(_0x28ebba,null));};exports['update']=function(_0x414648,_0x59645f){if(_0x414648[_0xae2f('0x48')]['id']){delete _0x414648[_0xae2f('0x48')]['id'];}return db['Dynamics365Field'][_0xae2f('0x45')]({'where':{'id':_0x414648[_0xae2f('0x40')]['id']}})['then'](handleEntityNotFound(_0x59645f,null))[_0xae2f('0x3b')](saveUpdates(_0x414648['body'],null))[_0xae2f('0x3b')](respondWithResult(_0x59645f,null))[_0xae2f('0x46')](handleError(_0x59645f,null));};exports[_0xae2f('0x49')]=function(_0x2dac69,_0x48a265){return db[_0xae2f('0x41')]['find']({'where':{'id':_0x2dac69[_0xae2f('0x40')]['id']}})['then'](handleEntityNotFound(_0x48a265,null))[_0xae2f('0x3b')](removeEntity(_0x48a265,null))[_0xae2f('0x46')](handleError(_0x48a265,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index bc02042..4ad5299 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 _0x8145=['Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define'];(function(_0x2a349b,_0x11fa55){var _0x2d23c8=function(_0x1d0b41){while(--_0x1d0b41){_0x2a349b['push'](_0x2a349b['shift']());}};_0x2d23c8(++_0x11fa55);}(_0x8145,0x17b));var _0x5814=function(_0x23918d,_0x123175){_0x23918d=_0x23918d-0x0;var _0x598686=_0x8145[_0x23918d];return _0x598686;};'use strict';var _=require('lodash');var util=require(_0x5814('0x0'));var logger=require(_0x5814('0x1'))(_0x5814('0x2'));var moment=require(_0x5814('0x3'));var BPromise=require(_0x5814('0x4'));var rp=require(_0x5814('0x5'));var fs=require('fs');var path=require(_0x5814('0x6'));var rimraf=require(_0x5814('0x7'));var config=require(_0x5814('0x8'));var attributes=require(_0x5814('0x9'));module[_0x5814('0xa')]=function(_0xc0b844,_0x3c7297){return _0xc0b844[_0x5814('0xb')](_0x5814('0xc'),attributes,{'tableName':_0x5814('0xd'),'paranoid':![],'indexes':[{'name':_0x5814('0xe'),'fields':[_0x5814('0xf'),_0x5814('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x71e9=['../../config/environment','define','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x5ed7a3,_0x13fbc4){var _0x2121fd=function(_0x13b2f9){while(--_0x13b2f9){_0x5ed7a3['push'](_0x5ed7a3['shift']());}};_0x2121fd(++_0x13fbc4);}(_0x71e9,0x92));var _0x971e=function(_0x5ded91,_0x41ae00){_0x5ded91=_0x5ded91-0x0;var _0x21bce4=_0x71e9[_0x5ded91];return _0x21bce4;};'use strict';var _=require(_0x971e('0x0'));var util=require(_0x971e('0x1'));var logger=require(_0x971e('0x2'))(_0x971e('0x3'));var moment=require(_0x971e('0x4'));var BPromise=require(_0x971e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x971e('0x6'));var rimraf=require(_0x971e('0x7'));var config=require(_0x971e('0x8'));var attributes=require('./intDynamics365Field.attributes');module['exports']=function(_0x4792f5,_0x2a3161){return _0x4792f5[_0x971e('0x9')]('Dynamics365Field',attributes,{'tableName':_0x971e('0xa'),'paranoid':![],'indexes':[{'name':_0x971e('0xb'),'fields':[_0x971e('0xc'),_0x971e('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 28a180e..b7cea8b 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 _0xa620=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x44b868,_0x498b1c){var _0x5e5b4a=function(_0x2af352){while(--_0x2af352){_0x44b868['push'](_0x44b868['shift']());}};_0x5e5b4a(++_0x498b1c);}(_0xa620,0x67));var _0x0a62=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa620[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0x0a62('0x0'));var util=require(_0x0a62('0x1'));var moment=require(_0x0a62('0x2'));var BPromise=require('bluebird');var rs=require(_0x0a62('0x3'));var fs=require('fs');var Redis=require(_0x0a62('0x4'));var db=require(_0x0a62('0x5'))['db'];var utils=require(_0x0a62('0x6'));var logger=require(_0x0a62('0x7'))('rpc');var config=require(_0x0a62('0x8'));var jayson=require(_0x0a62('0x9'));var client=jayson[_0x0a62('0xa')][_0x0a62('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2fe30d,_0x1112bf,_0x19f472){return new BPromise(function(_0x4af5f5,_0x2711f8){return client[_0x0a62('0xc')](_0x2fe30d,_0x19f472)[_0x0a62('0xd')](function(_0xbdacf4){logger['info'](_0x0a62('0xe'),_0x1112bf,_0x0a62('0xf'));logger[_0x0a62('0x10')](_0x0a62('0x11'),_0x1112bf,_0x0a62('0xf'),JSON['stringify'](_0xbdacf4));if(_0xbdacf4[_0x0a62('0x12')]){if(_0xbdacf4['error'][_0x0a62('0x13')]===0x1f4){logger['error'](_0x0a62('0xe'),_0x1112bf,_0xbdacf4[_0x0a62('0x12')][_0x0a62('0x14')]);return _0x2711f8(_0xbdacf4['error'][_0x0a62('0x14')]);}logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x1112bf,_0xbdacf4['error']['message']);return _0x4af5f5(_0xbdacf4[_0x0a62('0x12')][_0x0a62('0x14')]);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x1112bf,_0x0a62('0xf'));_0x4af5f5(_0xbdacf4['result'][_0x0a62('0x14')]);}})[_0x0a62('0x15')](function(_0x4180aa){logger['error'](_0x0a62('0xe'),_0x1112bf,_0x4180aa);_0x2711f8(_0x4180aa);});});} \ No newline at end of file +var _0xed9e=['request','then','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x35750a,_0x4d13d8){var _0x4c0a34=function(_0x408f24){while(--_0x408f24){_0x35750a['push'](_0x35750a['shift']());}};_0x4c0a34(++_0x4d13d8);}(_0xed9e,0x106));var _0xeed9=function(_0x45262e,_0x1d9c0b){_0x45262e=_0x45262e-0x0;var _0x3b7f60=_0xed9e[_0x45262e];return _0x3b7f60;};'use strict';var _=require(_0xeed9('0x0'));var util=require(_0xeed9('0x1'));var moment=require(_0xeed9('0x2'));var BPromise=require(_0xeed9('0x3'));var rs=require(_0xeed9('0x4'));var fs=require('fs');var Redis=require(_0xeed9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xeed9('0x6'));var logger=require('../../config/logger')(_0xeed9('0x7'));var config=require(_0xeed9('0x8'));var jayson=require(_0xeed9('0x9'));var client=jayson[_0xeed9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e4683,_0x261e0c,_0x3730f5){return new BPromise(function(_0x2863e2,_0x2859cf){return client[_0xeed9('0xb')](_0x2e4683,_0x3730f5)[_0xeed9('0xc')](function(_0x4ee00b){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x261e0c,_0xeed9('0xd'));logger['debug'](_0xeed9('0xe'),_0x261e0c,_0xeed9('0xd'),JSON[_0xeed9('0xf')](_0x4ee00b));if(_0x4ee00b[_0xeed9('0x10')]){if(_0x4ee00b[_0xeed9('0x10')][_0xeed9('0x11')]===0x1f4){logger[_0xeed9('0x10')](_0xeed9('0x12'),_0x261e0c,_0x4ee00b['error'][_0xeed9('0x13')]);return _0x2859cf(_0x4ee00b[_0xeed9('0x10')][_0xeed9('0x13')]);}logger[_0xeed9('0x10')](_0xeed9('0x12'),_0x261e0c,_0x4ee00b[_0xeed9('0x10')][_0xeed9('0x13')]);return _0x2863e2(_0x4ee00b[_0xeed9('0x10')][_0xeed9('0x13')]);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x261e0c,_0xeed9('0xd'));_0x2863e2(_0x4ee00b[_0xeed9('0x14')]['message']);}})['catch'](function(_0x41015a){logger[_0xeed9('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x261e0c,_0x41015a);_0x2859cf(_0x41015a);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index af3c3f4..18f1ed0 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 _0x75d5=['/:id/configurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x346548,_0x2f4640){var _0xcc730b=function(_0x5f30aa){while(--_0x5f30aa){_0x346548['push'](_0x346548['shift']());}};_0xcc730b(++_0x2f4640);}(_0x75d5,0xef));var _0x575d=function(_0x32a529,_0x460811){_0x32a529=_0x32a529-0x0;var _0x162a9a=_0x75d5[_0x32a529];return _0x162a9a;};'use strict';var multer=require(_0x575d('0x0'));var util=require(_0x575d('0x1'));var path=require(_0x575d('0x2'));var timeout=require(_0x575d('0x3'));var express=require(_0x575d('0x4'));var router=express[_0x575d('0x5')]();var fs_extra=require(_0x575d('0x6'));var auth=require(_0x575d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x575d('0x8'));var controller=require('./intFreshdeskAccount.controller');router[_0x575d('0x9')]('/',auth[_0x575d('0xa')](),controller[_0x575d('0xb')]);router[_0x575d('0x9')](_0x575d('0xc'),auth['isAuthenticated'](),controller[_0x575d('0xd')]);router[_0x575d('0x9')](_0x575d('0xe'),auth[_0x575d('0xa')](),controller['getConfigurations']);router[_0x575d('0x9')](_0x575d('0xf'),auth[_0x575d('0xa')](),controller[_0x575d('0x10')]);router[_0x575d('0x11')]('/',auth[_0x575d('0xa')](),controller['create']);router['post'](_0x575d('0xe'),auth[_0x575d('0xa')](),controller[_0x575d('0x12')]);router[_0x575d('0x13')](_0x575d('0xc'),auth['isAuthenticated'](),controller[_0x575d('0x14')]);router[_0x575d('0x15')]('/:id',auth[_0x575d('0xa')](),controller['destroy']);module[_0x575d('0x16')]=router; \ No newline at end of file +var _0xd53d=['put','update','destroy','util','path','Router','../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post'];(function(_0x4ca0f3,_0x5ba262){var _0x187535=function(_0x269553){while(--_0x269553){_0x4ca0f3['push'](_0x4ca0f3['shift']());}};_0x187535(++_0x5ba262);}(_0xd53d,0xb7));var _0xdd53=function(_0x217253,_0x46684d){_0x217253=_0x217253-0x0;var _0x273f82=_0xd53d[_0x217253];return _0x273f82;};'use strict';var multer=require('multer');var util=require(_0xdd53('0x0'));var path=require(_0xdd53('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdd53('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xdd53('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xdd53('0x4'));var controller=require(_0xdd53('0x5'));router[_0xdd53('0x6')]('/',auth['isAuthenticated'](),controller[_0xdd53('0x7')]);router[_0xdd53('0x6')](_0xdd53('0x8'),auth[_0xdd53('0x9')](),controller[_0xdd53('0xa')]);router['get'](_0xdd53('0xb'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xdd53('0x6')](_0xdd53('0xc'),auth[_0xdd53('0x9')](),controller[_0xdd53('0xd')]);router[_0xdd53('0xe')]('/',auth[_0xdd53('0x9')](),controller['create']);router[_0xdd53('0xe')](_0xdd53('0xb'),auth[_0xdd53('0x9')](),controller['addConfiguration']);router[_0xdd53('0xf')](_0xdd53('0x8'),auth[_0xdd53('0x9')](),controller[_0xdd53('0x10')]);router['delete']('/:id',auth[_0xdd53('0x9')](),controller[_0xdd53('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 0e9c90e..6378d92 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 _0x896e=['exports','STRING','username','remoteUri','sequelize'];(function(_0xb6e2ea,_0x3b26e9){var _0x2a57bb=function(_0x2a1ac9){while(--_0x2a1ac9){_0xb6e2ea['push'](_0xb6e2ea['shift']());}};_0x2a57bb(++_0x3b26e9);}(_0x896e,0x1e9));var _0xe896=function(_0x529c81,_0xade601){_0x529c81=_0x529c81-0x0;var _0x1357cd=_0x896e[_0x529c81];return _0x1357cd;};'use strict';var Sequelize=require(_0xe896('0x0'));module[_0xe896('0x1')]={'name':{'type':Sequelize[_0xe896('0x2')]},'description':{'type':Sequelize[_0xe896('0x2')]},'username':{'type':Sequelize[_0xe896('0x2')],'unique':_0xe896('0x3')},'apiKey':{'type':Sequelize[_0xe896('0x2')]},'remoteUri':{'type':Sequelize[_0xe896('0x2')],'unique':_0xe896('0x4')},'serverUrl':{'type':Sequelize[_0xe896('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xe2cf=['remoteUri','exports','STRING','username'];(function(_0x378891,_0x4e3e16){var _0xfbfda2=function(_0x3b7681){while(--_0x3b7681){_0x378891['push'](_0x378891['shift']());}};_0xfbfda2(++_0x4e3e16);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x56f187,_0x2eec20){_0x56f187=_0x56f187-0x0;var _0x1b8b67=_0xe2cf[_0x56f187];return _0x1b8b67;};'use strict';var Sequelize=require('sequelize');module[_0xfe2c('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfe2c('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xfe2c('0x2')},'apiKey':{'type':Sequelize[_0xfe2c('0x1')]},'remoteUri':{'type':Sequelize[_0xfe2c('0x1')],'unique':_0xfe2c('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 3b1033e..77e2e55 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 _0x1db3=['source','company','remove','includes','default','custom_text','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','fieldName','type','model','query','keys','attributes','intersection','fields','hasOwnProperty','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','FreshdeskAccount','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','length','nolimit','AccountId','getSubjects','Descriptions','getDescriptions','channel','Subjects','FreshdeskField','getFields','remoteUri','slice','GET','format','%s/%s','Basic\x20%s','%s:X','apiKey','toString','requester','agent','description','priority','group'];(function(_0x129304,_0x4fb8b5){var _0x1c7ea4=function(_0x597c82){while(--_0x597c82){_0x129304['push'](_0x129304['shift']());}};_0x1c7ea4(++_0x4fb8b5);}(_0x1db3,0x1e5));var _0x31db=function(_0x28df0f,_0x1d48db){_0x28df0f=_0x28df0f-0x0;var _0x1c76b7=_0x1db3[_0x28df0f];return _0x1c76b7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x31db('0x0'));var zipdir=require(_0x31db('0x1'));var jsonpatch=require(_0x31db('0x2'));var rp=require(_0x31db('0x3'));var moment=require(_0x31db('0x4'));var BPromise=require(_0x31db('0x5'));var Mustache=require(_0x31db('0x6'));var util=require(_0x31db('0x7'));var path=require(_0x31db('0x8'));var sox=require(_0x31db('0x9'));var csv=require(_0x31db('0xa'));var ejs=require(_0x31db('0xb'));var fs=require('fs');var fs_extra=require(_0x31db('0xc'));var _=require(_0x31db('0xd'));var squel=require(_0x31db('0xe'));var crypto=require(_0x31db('0xf'));var jsforce=require(_0x31db('0x10'));var deskjs=require(_0x31db('0x11'));var toCsv=require(_0x31db('0xa'));var querystring=require('querystring');var Papa=require(_0x31db('0x12'));var Redis=require(_0x31db('0x13'));var authService=require(_0x31db('0x14'));var qs=require(_0x31db('0x15'));var as=require(_0x31db('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x31db('0x17'))(_0x31db('0x18'));var utils=require(_0x31db('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x31db('0x1a'));var db=require(_0x31db('0x1b'))['db'];var integrations=require(_0x31db('0x1c'));function respondWithStatusCode(_0x1ca88f,_0x298707){_0x298707=_0x298707||0xcc;return function(_0x98c3d0){if(_0x98c3d0){return _0x1ca88f['sendStatus'](_0x298707);}return _0x1ca88f['status'](_0x298707)[_0x31db('0x1d')]();};}function respondWithResult(_0x5706dc,_0x1ccc17){_0x1ccc17=_0x1ccc17||0xc8;return function(_0x14dc43){if(_0x14dc43){return _0x5706dc[_0x31db('0x1e')](_0x1ccc17)[_0x31db('0x1f')](_0x14dc43);}};}function respondWithFilteredResult(_0x29f691,_0x4ccb3d){return function(_0x557907){if(_0x557907){var _0x509ea3=typeof _0x4ccb3d[_0x31db('0x20')]===_0x31db('0x21')&&typeof _0x4ccb3d[_0x31db('0x22')]===_0x31db('0x21');var _0xb54695=_0x557907[_0x31db('0x23')];var _0x9f2780=_0x509ea3?0x0:_0x4ccb3d[_0x31db('0x20')];var _0x2d9dd7=_0x509ea3?_0x557907[_0x31db('0x23')]:_0x4ccb3d[_0x31db('0x20')]+_0x4ccb3d['limit'];var _0x2182c7;if(_0x2d9dd7>=_0xb54695){_0x2d9dd7=_0xb54695;_0x2182c7=0xc8;}else{_0x2182c7=0xce;}_0x29f691['status'](_0x2182c7);return _0x29f691['set'](_0x31db('0x24'),_0x9f2780+'-'+_0x2d9dd7+'/'+_0xb54695)[_0x31db('0x1f')](_0x557907);}return null;};}function patchUpdates(_0x168002){return function(_0x2d11b2){try{jsonpatch[_0x31db('0x25')](_0x2d11b2,_0x168002,!![]);}catch(_0x20264f){return BPromise[_0x31db('0x26')](_0x20264f);}return _0x2d11b2[_0x31db('0x27')]();};}function saveUpdates(_0x204781,_0x1f00f7){return function(_0xfa19ca){if(_0xfa19ca){return _0xfa19ca[_0x31db('0x28')](_0x204781)['then'](function(_0x358d1d){return _0x358d1d;});}return null;};}function removeEntity(_0x335cc9,_0x303cf4){return function(_0x5e44b8){if(_0x5e44b8){return _0x5e44b8[_0x31db('0x29')]()['then'](function(){_0x335cc9['status'](0xcc)[_0x31db('0x1d')]();});}};}function handleEntityNotFound(_0x28d247,_0x47e34b){return function(_0x4a2dbc){if(!_0x4a2dbc){_0x28d247['sendStatus'](0x194);}return _0x4a2dbc;};}function handleError(_0x313917,_0x48668b){_0x48668b=_0x48668b||0x1f4;return function(_0x2d06de){logger[_0x31db('0x2a')](_0x2d06de[_0x31db('0x2b')]);if(_0x2d06de[_0x31db('0x2c')]){delete _0x2d06de[_0x31db('0x2c')];}_0x313917[_0x31db('0x1e')](_0x48668b)[_0x31db('0x2d')](_0x2d06de);};}exports[_0x31db('0x2e')]=function(_0x4275fb,_0x4df070){var _0x1a1124={},_0x3a7386={},_0x5e9952={'count':0x0,'rows':[]};var _0x57f5a9=_[_0x31db('0x2f')](db['FreshdeskAccount']['rawAttributes'],function(_0x5a6368){return{'name':_0x5a6368[_0x31db('0x30')],'type':_0x5a6368[_0x31db('0x31')]['key']};});_0x3a7386[_0x31db('0x32')]=_['map'](_0x57f5a9,'name');_0x3a7386[_0x31db('0x33')]=_[_0x31db('0x34')](_0x4275fb[_0x31db('0x33')]);_0x3a7386['filters']=_['intersection'](_0x3a7386[_0x31db('0x32')],_0x3a7386[_0x31db('0x33')]);_0x1a1124[_0x31db('0x35')]=_[_0x31db('0x36')](_0x3a7386[_0x31db('0x32')],qs['fields'](_0x4275fb['query'][_0x31db('0x37')]));_0x1a1124['attributes']=_0x1a1124[_0x31db('0x35')]['length']?_0x1a1124[_0x31db('0x35')]:_0x3a7386[_0x31db('0x32')];if(!_0x4275fb[_0x31db('0x33')][_0x31db('0x38')]('nolimit')){_0x1a1124[_0x31db('0x22')]=qs[_0x31db('0x22')](_0x4275fb['query']['limit']);_0x1a1124[_0x31db('0x20')]=qs[_0x31db('0x20')](_0x4275fb['query']['offset']);}_0x1a1124[_0x31db('0x39')]=qs[_0x31db('0x3a')](_0x4275fb[_0x31db('0x33')][_0x31db('0x3a')]);_0x1a1124['where']=qs[_0x31db('0x3b')](_[_0x31db('0x3c')](_0x4275fb[_0x31db('0x33')],_0x3a7386['filters']),_0x57f5a9);if(_0x4275fb[_0x31db('0x33')]['filter']){_0x1a1124[_0x31db('0x3d')]=_[_0x31db('0x3e')](_0x1a1124[_0x31db('0x3d')],{'$or':_[_0x31db('0x2f')](_0x57f5a9,function(_0x593638){if(_0x593638[_0x31db('0x31')]!==_0x31db('0x3f')){var _0x22254a={};_0x22254a[_0x593638[_0x31db('0x2c')]]={'$like':'%'+_0x4275fb['query'][_0x31db('0x40')]+'%'};return _0x22254a;}})});}_0x1a1124=_[_0x31db('0x3e')]({},_0x1a1124,_0x4275fb[_0x31db('0x41')]);var _0x14aa99={'where':_0x1a1124['where']};return db[_0x31db('0x42')][_0x31db('0x23')](_0x14aa99)[_0x31db('0x43')](function(_0x219e7f){_0x5e9952[_0x31db('0x23')]=_0x219e7f;if(_0x4275fb[_0x31db('0x33')][_0x31db('0x44')]){_0x1a1124[_0x31db('0x45')]=[{'all':!![]}];}return db[_0x31db('0x42')][_0x31db('0x46')](_0x1a1124);})[_0x31db('0x43')](function(_0x4836e2){_0x5e9952[_0x31db('0x47')]=_0x4836e2;return _0x5e9952;})[_0x31db('0x43')](respondWithFilteredResult(_0x4df070,_0x1a1124))[_0x31db('0x48')](handleError(_0x4df070,null));};exports[_0x31db('0x49')]=function(_0x3c2705,_0x405361){var _0x17d9b8={'raw':![],'where':{'id':_0x3c2705[_0x31db('0x4a')]['id']}},_0x50720e={};_0x50720e[_0x31db('0x32')]=_['keys'](db[_0x31db('0x42')]['rawAttributes']);_0x50720e[_0x31db('0x33')]=_[_0x31db('0x34')](_0x3c2705[_0x31db('0x33')]);_0x50720e['filters']=_[_0x31db('0x36')](_0x50720e[_0x31db('0x32')],_0x50720e['query']);_0x17d9b8[_0x31db('0x35')]=_[_0x31db('0x36')](_0x50720e[_0x31db('0x32')],qs[_0x31db('0x37')](_0x3c2705[_0x31db('0x33')][_0x31db('0x37')]));_0x17d9b8[_0x31db('0x35')]=_0x17d9b8[_0x31db('0x35')]['length']?_0x17d9b8[_0x31db('0x35')]:_0x50720e[_0x31db('0x32')];if(_0x3c2705[_0x31db('0x33')][_0x31db('0x44')]){_0x17d9b8[_0x31db('0x45')]=[{'all':!![]}];}_0x17d9b8=_['merge']({},_0x17d9b8,_0x3c2705['options']);return db[_0x31db('0x42')][_0x31db('0x4b')](_0x17d9b8)[_0x31db('0x43')](handleEntityNotFound(_0x405361,null))[_0x31db('0x43')](respondWithResult(_0x405361,null))[_0x31db('0x48')](handleError(_0x405361,null));};exports[_0x31db('0x4c')]=function(_0x41a9e1,_0xfa9006){return db[_0x31db('0x42')][_0x31db('0x4c')](_0x41a9e1['body'],{})[_0x31db('0x43')](respondWithResult(_0xfa9006,0xc9))[_0x31db('0x48')](handleError(_0xfa9006,null));};exports[_0x31db('0x28')]=function(_0x180021,_0x337cc3){if(_0x180021[_0x31db('0x4d')]['id']){delete _0x180021[_0x31db('0x4d')]['id'];}return db[_0x31db('0x42')]['find']({'where':{'id':_0x180021[_0x31db('0x4a')]['id']}})['then'](handleEntityNotFound(_0x337cc3,null))[_0x31db('0x43')](saveUpdates(_0x180021[_0x31db('0x4d')],null))[_0x31db('0x43')](respondWithResult(_0x337cc3,null))[_0x31db('0x48')](handleError(_0x337cc3,null));};exports['destroy']=function(_0x495e72,_0x55db42){return db[_0x31db('0x42')][_0x31db('0x4b')]({'where':{'id':_0x495e72[_0x31db('0x4a')]['id']}})[_0x31db('0x43')](handleEntityNotFound(_0x55db42,null))['then'](removeEntity(_0x55db42,null))[_0x31db('0x48')](handleError(_0x55db42,null));};exports[_0x31db('0x4e')]=function(_0x264acf,_0x484670,_0x3937ac){var _0x517094={};var _0x271e11={};var _0x17a846;var _0x51fe21;return db[_0x31db('0x42')][_0x31db('0x4f')]({'where':{'id':_0x264acf['params']['id']}})[_0x31db('0x43')](handleEntityNotFound(_0x484670,null))['then'](function(_0x919425){if(_0x919425){_0x17a846=_0x919425;_0x271e11[_0x31db('0x32')]=_['keys'](db[_0x31db('0x50')]['rawAttributes']);_0x271e11[_0x31db('0x33')]=_[_0x31db('0x34')](_0x264acf[_0x31db('0x33')]);_0x271e11[_0x31db('0x3b')]=_[_0x31db('0x36')](_0x271e11[_0x31db('0x32')],_0x271e11[_0x31db('0x33')]);_0x517094[_0x31db('0x35')]=_['intersection'](_0x271e11[_0x31db('0x32')],qs[_0x31db('0x37')](_0x264acf[_0x31db('0x33')][_0x31db('0x37')]));_0x517094[_0x31db('0x35')]=_0x517094[_0x31db('0x35')][_0x31db('0x51')]?_0x517094[_0x31db('0x35')]:_0x271e11['model'];_0x517094[_0x31db('0x39')]=qs['sort'](_0x264acf[_0x31db('0x33')][_0x31db('0x3a')]);_0x517094[_0x31db('0x3d')]=qs[_0x31db('0x3b')](_[_0x31db('0x3c')](_0x264acf[_0x31db('0x33')],_0x271e11[_0x31db('0x3b')]));if(_0x264acf[_0x31db('0x33')]['filter']){_0x517094[_0x31db('0x3d')]=_['merge'](_0x517094[_0x31db('0x3d')],{'$or':_[_0x31db('0x2f')](_0x517094[_0x31db('0x35')],function(_0x319740){var _0x22a2cf={};_0x22a2cf[_0x319740]={'$like':'%'+_0x264acf[_0x31db('0x33')][_0x31db('0x40')]+'%'};return _0x22a2cf;})});}_0x517094=_[_0x31db('0x3e')]({},_0x517094,_0x264acf[_0x31db('0x41')]);return _0x17a846[_0x31db('0x4e')](_0x517094);}})[_0x31db('0x43')](function(_0x4ced2f){if(_0x4ced2f){_0x51fe21=_0x4ced2f[_0x31db('0x51')];if(!_0x264acf['query'][_0x31db('0x38')](_0x31db('0x52'))){_0x517094[_0x31db('0x22')]=qs[_0x31db('0x22')](_0x264acf[_0x31db('0x33')][_0x31db('0x22')]);_0x517094[_0x31db('0x20')]=qs[_0x31db('0x20')](_0x264acf['query'][_0x31db('0x20')]);}return _0x17a846['getConfigurations'](_0x517094);}})[_0x31db('0x43')](function(_0x5d448b){if(_0x5d448b){return _0x5d448b?{'count':_0x51fe21,'rows':_0x5d448b}:null;}})[_0x31db('0x43')](respondWithResult(_0x484670,null))[_0x31db('0x48')](handleError(_0x484670,null));};exports['addConfiguration']=function(_0x17fe57,_0xfa95d6,_0x95c8c1){if(_0x17fe57[_0x31db('0x4d')]['id']){delete _0x17fe57[_0x31db('0x4d')]['id'];}return db[_0x31db('0x42')][_0x31db('0x4f')]({'where':{'id':_0x17fe57[_0x31db('0x4a')]['id']}})[_0x31db('0x43')](handleEntityNotFound(_0xfa95d6,null))[_0x31db('0x43')](function(_0x1526af){if(_0x1526af){_0x17fe57['body'][_0x31db('0x53')]=_0x1526af['id'];_0x17fe57[_0x31db('0x4d')]['Subjects']=integrations[_0x31db('0x54')](_0x17fe57[_0x31db('0x4d')]['channel'],_0x17fe57[_0x31db('0x4d')]['type']);_0x17fe57[_0x31db('0x4d')][_0x31db('0x55')]=integrations[_0x31db('0x56')](_0x17fe57[_0x31db('0x4d')][_0x31db('0x57')],_0x17fe57[_0x31db('0x4d')][_0x31db('0x31')]);return db['FreshdeskConfiguration']['create'](_0x17fe57['body'],{'include':[{'model':db['FreshdeskField'],'as':_0x31db('0x58')},{'model':db[_0x31db('0x59')],'as':_0x31db('0x55')}]});}return null;})[_0x31db('0x43')](respondWithResult(_0xfa95d6,null))[_0x31db('0x48')](handleError(_0xfa95d6,null));};exports[_0x31db('0x5a')]=function(_0x38cc83,_0x5dd9ab,_0x33843f){var _0xb4f67e='';return db[_0x31db('0x42')][_0x31db('0x4f')]({'where':{'id':_0x38cc83[_0x31db('0x4a')]['id']},'attributes':['id','remoteUri','apiKey']})[_0x31db('0x43')](handleEntityNotFound(_0x5dd9ab,null))[_0x31db('0x43')](function(_0x32a9bd){if(_0x32a9bd){_0xb4f67e=_0x32a9bd[_0x31db('0x5b')];var _0x107daa=_0xb4f67e[_0x31db('0x5c')](-0x1);if(_0x107daa==='/'){_0xb4f67e=_0xb4f67e['substring'](0x0,_0xb4f67e['lastIndexOf'](_0x107daa));}return rp({'method':_0x31db('0x5d'),'uri':util[_0x31db('0x5e')](_0x31db('0x5f'),_0xb4f67e,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x31db('0x5e')](_0x31db('0x60'),new Buffer(util[_0x31db('0x5e')](_0x31db('0x61'),_0x32a9bd[_0x31db('0x62')]))[_0x31db('0x63')]('base64'))},'json':!![]});}})['then'](function(_0x496478){if(_0x496478){var _0x2bfec8=[_0x31db('0x64'),'subject',_0x31db('0x65'),_0x31db('0x66'),_0x31db('0x1e'),_0x31db('0x67'),_0x31db('0x68'),_0x31db('0x69'),'ticket_type',_0x31db('0x68'),_0x31db('0x6a')];_[_0x31db('0x6b')](_0x496478,function(_0xfb23f9){return _0x2bfec8[_0x31db('0x6c')](_0xfb23f9[_0x31db('0x2c')])||!_0xfb23f9[_0x31db('0x6d')]&&_0xfb23f9[_0x31db('0x31')]!==_0x31db('0x6e')&&_0xfb23f9[_0x31db('0x31')]!=='custom_dropdown';});return{'count':_0x496478[_0x31db('0x51')],'rows':_[_0x31db('0x2f')](_0x496478,function(_0x507763){return{'id':_0x507763[_0x31db('0x2c')],'name':_0x507763[_0x31db('0x6f')],'custom':!_0x507763[_0x31db('0x6d')],'options':_0x507763[_0x31db('0x70')]?_['map'](_0x507763[_0x31db('0x70')],function(_0x5290ab){return{'name':_[_0x31db('0x71')](_0x5290ab),'value':_0x5290ab};}):[]};})};}})['then'](respondWithResult(_0x5dd9ab,null))['catch'](function(_0x1bbdc4){var _0x3a3f77=_0x38cc83['query'][_0x31db('0x72')]?0x1f4:_0x1bbdc4[_0x31db('0x73')]||0x1f4;logger[_0x31db('0x2a')](_0x31db('0x74'),_0x31db('0x5a'),_0x3a3f77,JSON[_0x31db('0x75')](_0x1bbdc4));delete _0x1bbdc4[_0x31db('0x2c')];if(_0x3a3f77===0x191){_0x3a3f77=0x190;}_0x5dd9ab[_0x31db('0x1e')](_0x3a3f77)[_0x31db('0x2d')](_0x38cc83[_0x31db('0x33')][_0x31db('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x1bbdc4[_0x31db('0x73')]}:_0x1bbdc4);});}; \ No newline at end of file +var _0xd61e=['update','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','FreshdeskAccount','count','includeAll','include','findAll','rows','show','find','catch','create','body','params','getConfigurations','findOne','FreshdeskConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','apiKey','remoteUri','slice','substring','lastIndexOf','GET','api/v2/ticket_fields','format','Basic\x20%s','toString','base64','requester','subject','agent','priority','group','source','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../components/integrations/configuration','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save'];(function(_0x2fbf56,_0x340922){var _0x5d5c66=function(_0x79f8b6){while(--_0x79f8b6){_0x2fbf56['push'](_0x2fbf56['shift']());}};_0x5d5c66(++_0x340922);}(_0xd61e,0x13d));var _0xed61=function(_0x2f9695,_0x4a3eae){_0x2f9695=_0x2f9695-0x0;var _0x4fbab4=_0xd61e[_0x2f9695];return _0x4fbab4;};'use strict';var emlformat=require(_0xed61('0x0'));var rimraf=require(_0xed61('0x1'));var zipdir=require(_0xed61('0x2'));var jsonpatch=require(_0xed61('0x3'));var rp=require(_0xed61('0x4'));var moment=require(_0xed61('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xed61('0x6'));var util=require(_0xed61('0x7'));var path=require(_0xed61('0x8'));var sox=require(_0xed61('0x9'));var csv=require(_0xed61('0xa'));var ejs=require(_0xed61('0xb'));var fs=require('fs');var fs_extra=require(_0xed61('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xed61('0xa'));var querystring=require(_0xed61('0xd'));var Papa=require(_0xed61('0xe'));var Redis=require(_0xed61('0xf'));var authService=require(_0xed61('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xed61('0x11'))(_0xed61('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xed61('0x13'));function respondWithStatusCode(_0x21511d,_0x19c74c){_0x19c74c=_0x19c74c||0xcc;return function(_0x168554){if(_0x168554){return _0x21511d['sendStatus'](_0x19c74c);}return _0x21511d[_0xed61('0x14')](_0x19c74c)[_0xed61('0x15')]();};}function respondWithResult(_0xe08d33,_0x4ac6e2){_0x4ac6e2=_0x4ac6e2||0xc8;return function(_0x445545){if(_0x445545){return _0xe08d33[_0xed61('0x14')](_0x4ac6e2)[_0xed61('0x16')](_0x445545);}};}function respondWithFilteredResult(_0x2ad52a,_0x4d3930){return function(_0x15198a){if(_0x15198a){var _0x391d53=typeof _0x4d3930[_0xed61('0x17')]===_0xed61('0x18')&&typeof _0x4d3930['limit']===_0xed61('0x18');var _0x27416b=_0x15198a['count'];var _0x31b034=_0x391d53?0x0:_0x4d3930[_0xed61('0x17')];var _0x9d980e=_0x391d53?_0x15198a['count']:_0x4d3930[_0xed61('0x17')]+_0x4d3930[_0xed61('0x19')];var _0xd5aa2d;if(_0x9d980e>=_0x27416b){_0x9d980e=_0x27416b;_0xd5aa2d=0xc8;}else{_0xd5aa2d=0xce;}_0x2ad52a['status'](_0xd5aa2d);return _0x2ad52a[_0xed61('0x1a')](_0xed61('0x1b'),_0x31b034+'-'+_0x9d980e+'/'+_0x27416b)[_0xed61('0x16')](_0x15198a);}return null;};}function patchUpdates(_0x5ee0b9){return function(_0x3bab6f){try{jsonpatch[_0xed61('0x1c')](_0x3bab6f,_0x5ee0b9,!![]);}catch(_0x481211){return BPromise[_0xed61('0x1d')](_0x481211);}return _0x3bab6f[_0xed61('0x1e')]();};}function saveUpdates(_0x864dfa,_0x5f3d0f){return function(_0x53f131){if(_0x53f131){return _0x53f131[_0xed61('0x1f')](_0x864dfa)['then'](function(_0xa17a06){return _0xa17a06;});}return null;};}function removeEntity(_0x217e93,_0x2722d0){return function(_0x39a8ff){if(_0x39a8ff){return _0x39a8ff[_0xed61('0x20')]()[_0xed61('0x21')](function(){_0x217e93['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x59893f,_0x50f56d){return function(_0x405c67){if(!_0x405c67){_0x59893f['sendStatus'](0x194);}return _0x405c67;};}function handleError(_0x159418,_0x2c43ba){_0x2c43ba=_0x2c43ba||0x1f4;return function(_0x5dc3bf){logger['error'](_0x5dc3bf[_0xed61('0x22')]);if(_0x5dc3bf[_0xed61('0x23')]){delete _0x5dc3bf[_0xed61('0x23')];}_0x159418['status'](_0x2c43ba)[_0xed61('0x24')](_0x5dc3bf);};}exports[_0xed61('0x25')]=function(_0x1ac86e,_0x4c154b){var _0x35c2af={},_0x4a2d38={},_0x11fd35={'count':0x0,'rows':[]};var _0x3ec2e6=_[_0xed61('0x26')](db['FreshdeskAccount'][_0xed61('0x27')],function(_0xa5a8aa){return{'name':_0xa5a8aa[_0xed61('0x28')],'type':_0xa5a8aa[_0xed61('0x29')]['key']};});_0x4a2d38[_0xed61('0x2a')]=_['map'](_0x3ec2e6,'name');_0x4a2d38[_0xed61('0x2b')]=_[_0xed61('0x2c')](_0x1ac86e[_0xed61('0x2b')]);_0x4a2d38[_0xed61('0x2d')]=_['intersection'](_0x4a2d38['model'],_0x4a2d38[_0xed61('0x2b')]);_0x35c2af[_0xed61('0x2e')]=_[_0xed61('0x2f')](_0x4a2d38[_0xed61('0x2a')],qs[_0xed61('0x30')](_0x1ac86e[_0xed61('0x2b')][_0xed61('0x30')]));_0x35c2af['attributes']=_0x35c2af['attributes'][_0xed61('0x31')]?_0x35c2af['attributes']:_0x4a2d38[_0xed61('0x2a')];if(!_0x1ac86e['query']['hasOwnProperty']('nolimit')){_0x35c2af['limit']=qs['limit'](_0x1ac86e[_0xed61('0x2b')][_0xed61('0x19')]);_0x35c2af[_0xed61('0x17')]=qs[_0xed61('0x17')](_0x1ac86e[_0xed61('0x2b')][_0xed61('0x17')]);}_0x35c2af[_0xed61('0x32')]=qs[_0xed61('0x33')](_0x1ac86e['query']['sort']);_0x35c2af[_0xed61('0x34')]=qs[_0xed61('0x2d')](_[_0xed61('0x35')](_0x1ac86e[_0xed61('0x2b')],_0x4a2d38['filters']),_0x3ec2e6);if(_0x1ac86e[_0xed61('0x2b')][_0xed61('0x36')]){_0x35c2af['where']=_[_0xed61('0x37')](_0x35c2af[_0xed61('0x34')],{'$or':_[_0xed61('0x26')](_0x3ec2e6,function(_0x3ac45e){if(_0x3ac45e['type']!==_0xed61('0x38')){var _0x6c2723={};_0x6c2723[_0x3ac45e[_0xed61('0x23')]]={'$like':'%'+_0x1ac86e[_0xed61('0x2b')][_0xed61('0x36')]+'%'};return _0x6c2723;}})});}_0x35c2af=_[_0xed61('0x37')]({},_0x35c2af,_0x1ac86e[_0xed61('0x39')]);var _0x57e623={'where':_0x35c2af[_0xed61('0x34')]};return db[_0xed61('0x3a')][_0xed61('0x3b')](_0x57e623)[_0xed61('0x21')](function(_0x10c835){_0x11fd35[_0xed61('0x3b')]=_0x10c835;if(_0x1ac86e[_0xed61('0x2b')][_0xed61('0x3c')]){_0x35c2af[_0xed61('0x3d')]=[{'all':!![]}];}return db[_0xed61('0x3a')][_0xed61('0x3e')](_0x35c2af);})[_0xed61('0x21')](function(_0x4005dd){_0x11fd35[_0xed61('0x3f')]=_0x4005dd;return _0x11fd35;})['then'](respondWithFilteredResult(_0x4c154b,_0x35c2af))['catch'](handleError(_0x4c154b,null));};exports[_0xed61('0x40')]=function(_0x4595ba,_0x48b591){var _0x5b9bef={'raw':![],'where':{'id':_0x4595ba['params']['id']}},_0x4de103={};_0x4de103[_0xed61('0x2a')]=_[_0xed61('0x2c')](db[_0xed61('0x3a')][_0xed61('0x27')]);_0x4de103[_0xed61('0x2b')]=_[_0xed61('0x2c')](_0x4595ba['query']);_0x4de103[_0xed61('0x2d')]=_[_0xed61('0x2f')](_0x4de103[_0xed61('0x2a')],_0x4de103['query']);_0x5b9bef[_0xed61('0x2e')]=_[_0xed61('0x2f')](_0x4de103[_0xed61('0x2a')],qs[_0xed61('0x30')](_0x4595ba[_0xed61('0x2b')]['fields']));_0x5b9bef['attributes']=_0x5b9bef[_0xed61('0x2e')][_0xed61('0x31')]?_0x5b9bef[_0xed61('0x2e')]:_0x4de103[_0xed61('0x2a')];if(_0x4595ba['query'][_0xed61('0x3c')]){_0x5b9bef[_0xed61('0x3d')]=[{'all':!![]}];}_0x5b9bef=_[_0xed61('0x37')]({},_0x5b9bef,_0x4595ba['options']);return db[_0xed61('0x3a')][_0xed61('0x41')](_0x5b9bef)['then'](handleEntityNotFound(_0x48b591,null))[_0xed61('0x21')](respondWithResult(_0x48b591,null))[_0xed61('0x42')](handleError(_0x48b591,null));};exports[_0xed61('0x43')]=function(_0x3403cf,_0xdca8b8){return db[_0xed61('0x3a')][_0xed61('0x43')](_0x3403cf[_0xed61('0x44')],{})[_0xed61('0x21')](respondWithResult(_0xdca8b8,0xc9))[_0xed61('0x42')](handleError(_0xdca8b8,null));};exports[_0xed61('0x1f')]=function(_0x3a6693,_0x363a82){if(_0x3a6693[_0xed61('0x44')]['id']){delete _0x3a6693[_0xed61('0x44')]['id'];}return db[_0xed61('0x3a')][_0xed61('0x41')]({'where':{'id':_0x3a6693[_0xed61('0x45')]['id']}})[_0xed61('0x21')](handleEntityNotFound(_0x363a82,null))[_0xed61('0x21')](saveUpdates(_0x3a6693[_0xed61('0x44')],null))[_0xed61('0x21')](respondWithResult(_0x363a82,null))[_0xed61('0x42')](handleError(_0x363a82,null));};exports['destroy']=function(_0x4effa3,_0x28950f){return db[_0xed61('0x3a')][_0xed61('0x41')]({'where':{'id':_0x4effa3[_0xed61('0x45')]['id']}})['then'](handleEntityNotFound(_0x28950f,null))[_0xed61('0x21')](removeEntity(_0x28950f,null))[_0xed61('0x42')](handleError(_0x28950f,null));};exports[_0xed61('0x46')]=function(_0x53de57,_0x4df2dd,_0x531a57){var _0x1b8f08={};var _0xa3a22f={};var _0x134401;var _0x1d3b9d;return db[_0xed61('0x3a')][_0xed61('0x47')]({'where':{'id':_0x53de57[_0xed61('0x45')]['id']}})[_0xed61('0x21')](handleEntityNotFound(_0x4df2dd,null))['then'](function(_0x2bb9b9){if(_0x2bb9b9){_0x134401=_0x2bb9b9;_0xa3a22f[_0xed61('0x2a')]=_['keys'](db[_0xed61('0x48')][_0xed61('0x27')]);_0xa3a22f[_0xed61('0x2b')]=_['keys'](_0x53de57[_0xed61('0x2b')]);_0xa3a22f['filters']=_[_0xed61('0x2f')](_0xa3a22f[_0xed61('0x2a')],_0xa3a22f[_0xed61('0x2b')]);_0x1b8f08[_0xed61('0x2e')]=_[_0xed61('0x2f')](_0xa3a22f[_0xed61('0x2a')],qs[_0xed61('0x30')](_0x53de57['query'][_0xed61('0x30')]));_0x1b8f08[_0xed61('0x2e')]=_0x1b8f08[_0xed61('0x2e')][_0xed61('0x31')]?_0x1b8f08[_0xed61('0x2e')]:_0xa3a22f[_0xed61('0x2a')];_0x1b8f08['order']=qs[_0xed61('0x33')](_0x53de57['query'][_0xed61('0x33')]);_0x1b8f08['where']=qs[_0xed61('0x2d')](_[_0xed61('0x35')](_0x53de57['query'],_0xa3a22f[_0xed61('0x2d')]));if(_0x53de57[_0xed61('0x2b')][_0xed61('0x36')]){_0x1b8f08[_0xed61('0x34')]=_[_0xed61('0x37')](_0x1b8f08['where'],{'$or':_[_0xed61('0x26')](_0x1b8f08[_0xed61('0x2e')],function(_0x21aa72){var _0x1683b5={};_0x1683b5[_0x21aa72]={'$like':'%'+_0x53de57[_0xed61('0x2b')][_0xed61('0x36')]+'%'};return _0x1683b5;})});}_0x1b8f08=_[_0xed61('0x37')]({},_0x1b8f08,_0x53de57['options']);return _0x134401['getConfigurations'](_0x1b8f08);}})[_0xed61('0x21')](function(_0x4729f3){if(_0x4729f3){_0x1d3b9d=_0x4729f3[_0xed61('0x31')];if(!_0x53de57[_0xed61('0x2b')][_0xed61('0x49')]('nolimit')){_0x1b8f08[_0xed61('0x19')]=qs[_0xed61('0x19')](_0x53de57[_0xed61('0x2b')]['limit']);_0x1b8f08[_0xed61('0x17')]=qs[_0xed61('0x17')](_0x53de57[_0xed61('0x2b')][_0xed61('0x17')]);}return _0x134401[_0xed61('0x46')](_0x1b8f08);}})['then'](function(_0x55ef0b){if(_0x55ef0b){return _0x55ef0b?{'count':_0x1d3b9d,'rows':_0x55ef0b}:null;}})[_0xed61('0x21')](respondWithResult(_0x4df2dd,null))[_0xed61('0x42')](handleError(_0x4df2dd,null));};exports[_0xed61('0x4a')]=function(_0x3aa517,_0x457d66,_0x1670e5){if(_0x3aa517[_0xed61('0x44')]['id']){delete _0x3aa517[_0xed61('0x44')]['id'];}return db[_0xed61('0x3a')][_0xed61('0x47')]({'where':{'id':_0x3aa517['params']['id']}})[_0xed61('0x21')](handleEntityNotFound(_0x457d66,null))[_0xed61('0x21')](function(_0x5aeffd){if(_0x5aeffd){_0x3aa517[_0xed61('0x44')][_0xed61('0x4b')]=_0x5aeffd['id'];_0x3aa517[_0xed61('0x44')][_0xed61('0x4c')]=integrations[_0xed61('0x4d')](_0x3aa517['body'][_0xed61('0x4e')],_0x3aa517['body']['type']);_0x3aa517[_0xed61('0x44')][_0xed61('0x4f')]=integrations[_0xed61('0x50')](_0x3aa517['body'][_0xed61('0x4e')],_0x3aa517[_0xed61('0x44')][_0xed61('0x29')]);return db[_0xed61('0x48')][_0xed61('0x43')](_0x3aa517['body'],{'include':[{'model':db['FreshdeskField'],'as':_0xed61('0x4c')},{'model':db[_0xed61('0x51')],'as':_0xed61('0x4f')}]});}return null;})[_0xed61('0x21')](respondWithResult(_0x457d66,null))[_0xed61('0x42')](handleError(_0x457d66,null));};exports['getFields']=function(_0xe89a4,_0xb883f7,_0x45824f){var _0x31d1c0='';return db['FreshdeskAccount'][_0xed61('0x47')]({'where':{'id':_0xe89a4[_0xed61('0x45')]['id']},'attributes':['id','remoteUri',_0xed61('0x52')]})[_0xed61('0x21')](handleEntityNotFound(_0xb883f7,null))[_0xed61('0x21')](function(_0x121920){if(_0x121920){_0x31d1c0=_0x121920[_0xed61('0x53')];var _0x87cbe=_0x31d1c0[_0xed61('0x54')](-0x1);if(_0x87cbe==='/'){_0x31d1c0=_0x31d1c0[_0xed61('0x55')](0x0,_0x31d1c0[_0xed61('0x56')](_0x87cbe));}return rp({'method':_0xed61('0x57'),'uri':util['format']('%s/%s',_0x31d1c0,_0xed61('0x58')),'headers':{'Authorization':util[_0xed61('0x59')](_0xed61('0x5a'),new Buffer(util['format']('%s:X',_0x121920[_0xed61('0x52')]))[_0xed61('0x5b')](_0xed61('0x5c')))},'json':!![]});}})[_0xed61('0x21')](function(_0x307916){if(_0x307916){var _0x1c325a=[_0xed61('0x5d'),_0xed61('0x5e'),_0xed61('0x5f'),'description',_0xed61('0x14'),_0xed61('0x60'),_0xed61('0x61'),_0xed61('0x62'),_0xed61('0x63'),_0xed61('0x61'),_0xed61('0x64')];_[_0xed61('0x65')](_0x307916,function(_0x4e01f7){return _0x1c325a[_0xed61('0x66')](_0x4e01f7[_0xed61('0x23')])||!_0x4e01f7[_0xed61('0x67')]&&_0x4e01f7[_0xed61('0x29')]!==_0xed61('0x68')&&_0x4e01f7[_0xed61('0x29')]!==_0xed61('0x69');});return{'count':_0x307916[_0xed61('0x31')],'rows':_[_0xed61('0x26')](_0x307916,function(_0x379262){return{'id':_0x379262[_0xed61('0x23')],'name':_0x379262[_0xed61('0x6a')],'custom':!_0x379262[_0xed61('0x67')],'options':_0x379262[_0xed61('0x6b')]?_[_0xed61('0x26')](_0x379262['choices'],function(_0x1b467f){return{'name':_[_0xed61('0x6c')](_0x1b467f),'value':_0x1b467f};}):[]};})};}})[_0xed61('0x21')](respondWithResult(_0xb883f7,null))[_0xed61('0x42')](function(_0x3c16ae){var _0x465053=_0xe89a4['query'][_0xed61('0x6d')]?0x1f4:_0x3c16ae[_0xed61('0x6e')]||0x1f4;logger[_0xed61('0x6f')](_0xed61('0x70'),_0xed61('0x71'),_0x465053,JSON[_0xed61('0x72')](_0x3c16ae));delete _0x3c16ae['name'];if(_0x465053===0x191){_0x465053=0x190;}_0xb883f7[_0xed61('0x14')](_0x465053)['send'](_0xe89a4[_0xed61('0x2b')][_0xed61('0x6d')]?{'message':_0xed61('0x73'),'statusCode':_0x3c16ae['statusCode']}:_0x3c16ae);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 6c89d30..49f90d2 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 _0x80bc=['rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x2cffc9,_0x5dc809){var _0x150c20=function(_0x18a609){while(--_0x18a609){_0x2cffc9['push'](_0x2cffc9['shift']());}};_0x150c20(++_0x5dc809);}(_0x80bc,0x1da));var _0xc80b=function(_0x2f37e0,_0x393ef9){_0x2f37e0=_0x2f37e0-0x0;var _0x43ccce=_0x80bc[_0x2f37e0];return _0x43ccce;};'use strict';var _=require(_0xc80b('0x0'));var util=require('util');var logger=require(_0xc80b('0x1'))(_0xc80b('0x2'));var moment=require(_0xc80b('0x3'));var BPromise=require(_0xc80b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc80b('0x5'));var rimraf=require(_0xc80b('0x6'));var config=require(_0xc80b('0x7'));var attributes=require(_0xc80b('0x8'));var integrations=require(_0xc80b('0x9'));module[_0xc80b('0xa')]=function(_0x1d319e,_0x1bc304){return _0x1d319e[_0xc80b('0xb')]('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7730=['../../components/integrations/configuration','exports','FreshdeskAccount','lodash','util','api','bluebird','rimraf'];(function(_0x47cce1,_0x1b92a5){var _0x7b4329=function(_0x28d168){while(--_0x28d168){_0x47cce1['push'](_0x47cce1['shift']());}};_0x7b4329(++_0x1b92a5);}(_0x7730,0x143));var _0x0773=function(_0x2f31b1,_0x17daa8){_0x2f31b1=_0x2f31b1-0x0;var _0x448988=_0x7730[_0x2f31b1];return _0x448988;};'use strict';var _=require(_0x0773('0x0'));var util=require(_0x0773('0x1'));var logger=require('../../config/logger')(_0x0773('0x2'));var moment=require('moment');var BPromise=require(_0x0773('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0773('0x4'));var config=require('../../config/environment');var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x0773('0x5'));module[_0x0773('0x6')]=function(_0x3de4ff,_0x492de6){return _0x3de4ff['define'](_0x0773('0x7'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index c365ed5..d8e88c8 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 _0x3d5d=['GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','map','include','model','attributes','ShowFreshdeskAccount','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','stringify','error','FreshdeskAccount,\x20%s,\x20%s','message','catch'];(function(_0x2fdee1,_0x466858){var _0x2c5533=function(_0x1f34de){while(--_0x1f34de){_0x2fdee1['push'](_0x2fdee1['shift']());}};_0x2c5533(++_0x466858);}(_0x3d5d,0x104));var _0xd3d5=function(_0x119d25,_0x588c8){_0x119d25=_0x119d25-0x0;var _0x39cf30=_0x3d5d[_0x119d25];return _0x39cf30;};'use strict';var _=require(_0xd3d5('0x0'));var util=require(_0xd3d5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd3d5('0x2'));var fs=require('fs');var Redis=require(_0xd3d5('0x3'));var db=require(_0xd3d5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd3d5('0x5'))(_0xd3d5('0x6'));var config=require(_0xd3d5('0x7'));var jayson=require(_0xd3d5('0x8'));var client=jayson['client'][_0xd3d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x490a17,_0x174d5f,_0x4423f5){return new BPromise(function(_0x267d52,_0x2a9f54){return client['request'](_0x490a17,_0x4423f5)[_0xd3d5('0xa')](function(_0x30b884){logger[_0xd3d5('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x174d5f,_0xd3d5('0xc'));logger[_0xd3d5('0xd')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x174d5f,_0xd3d5('0xc'),JSON[_0xd3d5('0xe')](_0x30b884));if(_0x30b884[_0xd3d5('0xf')]){if(_0x30b884[_0xd3d5('0xf')]['code']===0x1f4){logger['error'](_0xd3d5('0x10'),_0x174d5f,_0x30b884[_0xd3d5('0xf')][_0xd3d5('0x11')]);return _0x2a9f54(_0x30b884[_0xd3d5('0xf')][_0xd3d5('0x11')]);}logger['error'](_0xd3d5('0x10'),_0x174d5f,_0x30b884[_0xd3d5('0xf')][_0xd3d5('0x11')]);return _0x267d52(_0x30b884['error'][_0xd3d5('0x11')]);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x174d5f,_0xd3d5('0xc'));_0x267d52(_0x30b884['result'][_0xd3d5('0x11')]);}})[_0xd3d5('0x12')](function(_0x30efb3){logger['error'](_0xd3d5('0x10'),_0x174d5f,_0x30efb3);_0x2a9f54(_0x30efb3);});});}exports[_0xd3d5('0x13')]=function(_0x211520){var _0x6c76cb=this;return new Promise(function(_0x2efc84,_0x3182be){return db[_0xd3d5('0x14')][_0xd3d5('0x15')]({'raw':_0x211520['options']?_0x211520[_0xd3d5('0x16')][_0xd3d5('0x17')]===undefined?!![]:![]:!![],'where':_0x211520[_0xd3d5('0x16')]?_0x211520[_0xd3d5('0x16')][_0xd3d5('0x18')]||null:null,'attributes':_0x211520[_0xd3d5('0x16')]?_0x211520[_0xd3d5('0x16')]['attributes']||null:null,'limit':_0x211520[_0xd3d5('0x16')]?_0x211520[_0xd3d5('0x16')]['limit']||null:null,'include':_0x211520[_0xd3d5('0x16')]?_0x211520[_0xd3d5('0x16')]['include']?_[_0xd3d5('0x19')](_0x211520['options'][_0xd3d5('0x1a')],function(_0x382b0a){return{'model':db[_0x382b0a[_0xd3d5('0x1b')]],'as':_0x382b0a['as'],'attributes':_0x382b0a[_0xd3d5('0x1c')],'include':_0x382b0a[_0xd3d5('0x1a')]?_['map'](_0x382b0a[_0xd3d5('0x1a')],function(_0x562a96){return{'model':db[_0x562a96[_0xd3d5('0x1b')]],'as':_0x562a96['as'],'attributes':_0x562a96[_0xd3d5('0x1c')],'include':_0x562a96['include']?_[_0xd3d5('0x19')](_0x562a96[_0xd3d5('0x1a')],function(_0x18db9b){return{'model':db[_0x18db9b[_0xd3d5('0x1b')]],'as':_0x18db9b['as'],'attributes':_0x18db9b[_0xd3d5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd3d5('0xa')](function(_0x50703b){logger['info'](_0xd3d5('0x13'),_0x211520);logger[_0xd3d5('0xd')](_0xd3d5('0x13'),_0x211520,JSON[_0xd3d5('0xe')](_0x50703b));_0x2efc84(_0x50703b);})[_0xd3d5('0x12')](function(_0x135c99){logger[_0xd3d5('0xf')](_0xd3d5('0x13'),_0x135c99['message'],_0x211520);_0x3182be(_0x6c76cb[_0xd3d5('0xf')](0x1f4,_0x135c99['message']));});});};exports[_0xd3d5('0x1d')]=function(_0xa953a2){var _0x55b982=this;return new Promise(function(_0x59cf95,_0x53d29d){return db['FreshdeskAccount'][_0xd3d5('0x1e')]({'raw':_0xa953a2['options']?_0xa953a2['options'][_0xd3d5('0x17')]===undefined?!![]:![]:!![],'where':_0xa953a2[_0xd3d5('0x16')]?_0xa953a2['options'][_0xd3d5('0x18')]||null:null,'attributes':_0xa953a2[_0xd3d5('0x16')]?_0xa953a2[_0xd3d5('0x16')][_0xd3d5('0x1c')]||null:null,'include':_0xa953a2['options']?_0xa953a2[_0xd3d5('0x16')][_0xd3d5('0x1a')]?_[_0xd3d5('0x19')](_0xa953a2['options']['include'],function(_0x28b1e7){return{'model':db[_0x28b1e7[_0xd3d5('0x1b')]],'as':_0x28b1e7['as'],'attributes':_0x28b1e7[_0xd3d5('0x1c')],'include':_0x28b1e7[_0xd3d5('0x1a')]?_[_0xd3d5('0x19')](_0x28b1e7[_0xd3d5('0x1a')],function(_0x7f3f37){return{'model':db[_0x7f3f37['model']],'as':_0x7f3f37['as'],'attributes':_0x7f3f37[_0xd3d5('0x1c')],'include':_0x7f3f37['include']?_[_0xd3d5('0x19')](_0x7f3f37[_0xd3d5('0x1a')],function(_0x2d84){return{'model':db[_0x2d84[_0xd3d5('0x1b')]],'as':_0x2d84['as'],'attributes':_0x2d84['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x45b2f9){logger[_0xd3d5('0xb')](_0xd3d5('0x1d'),_0xa953a2);logger[_0xd3d5('0xd')]('ShowFreshdeskAccount',_0xa953a2,JSON[_0xd3d5('0xe')](_0x45b2f9));_0x59cf95(_0x45b2f9);})[_0xd3d5('0x12')](function(_0x3da77f){logger['error'](_0xd3d5('0x1d'),_0x3da77f[_0xd3d5('0x11')],_0xa953a2);_0x53d29d(_0x55b982[_0xd3d5('0xf')](0x1f4,_0x3da77f[_0xd3d5('0x11')]));});});}; \ No newline at end of file +var _0x67fe=['limit','map','include','model','debug','catch','ShowFreshdeskAccount','find','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','then','info','request\x20sent','stringify','error','code','message','FreshdeskAccount,\x20%s,\x20%s','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes'];(function(_0xa8c8f,_0x29e912){var _0x534880=function(_0x58530f){while(--_0x58530f){_0xa8c8f['push'](_0xa8c8f['shift']());}};_0x534880(++_0x29e912);}(_0x67fe,0x110));var _0xe67f=function(_0x196949,_0x126900){_0x196949=_0x196949-0x0;var _0x398eb7=_0x67fe[_0x196949];return _0x398eb7;};'use strict';var _=require('lodash');var util=require(_0xe67f('0x0'));var moment=require(_0xe67f('0x1'));var BPromise=require(_0xe67f('0x2'));var rs=require(_0xe67f('0x3'));var fs=require('fs');var Redis=require(_0xe67f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe67f('0x5'))(_0xe67f('0x6'));var config=require('../../config/environment');var jayson=require(_0xe67f('0x7'));var client=jayson['client'][_0xe67f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x512616,_0x140549,_0xa1972c){return new BPromise(function(_0x430832,_0x1a9c61){return client['request'](_0x512616,_0xa1972c)[_0xe67f('0x9')](function(_0x568a50){logger[_0xe67f('0xa')]('FreshdeskAccount,\x20%s,\x20%s',_0x140549,_0xe67f('0xb'));logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x140549,_0xe67f('0xb'),JSON[_0xe67f('0xc')](_0x568a50));if(_0x568a50[_0xe67f('0xd')]){if(_0x568a50[_0xe67f('0xd')][_0xe67f('0xe')]===0x1f4){logger[_0xe67f('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x140549,_0x568a50['error'][_0xe67f('0xf')]);return _0x1a9c61(_0x568a50[_0xe67f('0xd')][_0xe67f('0xf')]);}logger[_0xe67f('0xd')](_0xe67f('0x10'),_0x140549,_0x568a50['error'][_0xe67f('0xf')]);return _0x430832(_0x568a50[_0xe67f('0xd')][_0xe67f('0xf')]);}else{logger['info'](_0xe67f('0x10'),_0x140549,_0xe67f('0xb'));_0x430832(_0x568a50[_0xe67f('0x11')]['message']);}})['catch'](function(_0x4f720f){logger['error'](_0xe67f('0x10'),_0x140549,_0x4f720f);_0x1a9c61(_0x4f720f);});});}exports[_0xe67f('0x12')]=function(_0x3b3549){var _0x246fd0=this;return new Promise(function(_0x7183c6,_0x465f6b){return db[_0xe67f('0x13')][_0xe67f('0x14')]({'raw':_0x3b3549[_0xe67f('0x15')]?_0x3b3549[_0xe67f('0x15')][_0xe67f('0x16')]===undefined?!![]:![]:!![],'where':_0x3b3549[_0xe67f('0x15')]?_0x3b3549['options'][_0xe67f('0x17')]||null:null,'attributes':_0x3b3549['options']?_0x3b3549[_0xe67f('0x15')][_0xe67f('0x18')]||null:null,'limit':_0x3b3549[_0xe67f('0x15')]?_0x3b3549['options'][_0xe67f('0x19')]||null:null,'include':_0x3b3549[_0xe67f('0x15')]?_0x3b3549[_0xe67f('0x15')]['include']?_[_0xe67f('0x1a')](_0x3b3549['options'][_0xe67f('0x1b')],function(_0x58b817){return{'model':db[_0x58b817['model']],'as':_0x58b817['as'],'attributes':_0x58b817[_0xe67f('0x18')],'include':_0x58b817[_0xe67f('0x1b')]?_[_0xe67f('0x1a')](_0x58b817['include'],function(_0x2f05ae){return{'model':db[_0x2f05ae[_0xe67f('0x1c')]],'as':_0x2f05ae['as'],'attributes':_0x2f05ae[_0xe67f('0x18')],'include':_0x2f05ae[_0xe67f('0x1b')]?_[_0xe67f('0x1a')](_0x2f05ae[_0xe67f('0x1b')],function(_0x5e9ff4){return{'model':db[_0x5e9ff4[_0xe67f('0x1c')]],'as':_0x5e9ff4['as'],'attributes':_0x5e9ff4[_0xe67f('0x18')]};}):[]};}):[]};}):[]:[]})[_0xe67f('0x9')](function(_0x19a5d7){logger[_0xe67f('0xa')](_0xe67f('0x12'),_0x3b3549);logger[_0xe67f('0x1d')](_0xe67f('0x12'),_0x3b3549,JSON['stringify'](_0x19a5d7));_0x7183c6(_0x19a5d7);})[_0xe67f('0x1e')](function(_0x1ef750){logger[_0xe67f('0xd')]('GetFreshdeskAccount',_0x1ef750['message'],_0x3b3549);_0x465f6b(_0x246fd0[_0xe67f('0xd')](0x1f4,_0x1ef750[_0xe67f('0xf')]));});});};exports[_0xe67f('0x1f')]=function(_0x46453c){var _0x57e7f6=this;return new Promise(function(_0x55c0a0,_0x27c925){return db['FreshdeskAccount'][_0xe67f('0x20')]({'raw':_0x46453c[_0xe67f('0x15')]?_0x46453c[_0xe67f('0x15')][_0xe67f('0x16')]===undefined?!![]:![]:!![],'where':_0x46453c[_0xe67f('0x15')]?_0x46453c['options'][_0xe67f('0x17')]||null:null,'attributes':_0x46453c[_0xe67f('0x15')]?_0x46453c[_0xe67f('0x15')]['attributes']||null:null,'include':_0x46453c['options']?_0x46453c[_0xe67f('0x15')]['include']?_[_0xe67f('0x1a')](_0x46453c[_0xe67f('0x15')][_0xe67f('0x1b')],function(_0x802214){return{'model':db[_0x802214[_0xe67f('0x1c')]],'as':_0x802214['as'],'attributes':_0x802214['attributes'],'include':_0x802214['include']?_[_0xe67f('0x1a')](_0x802214[_0xe67f('0x1b')],function(_0x43df9c){return{'model':db[_0x43df9c[_0xe67f('0x1c')]],'as':_0x43df9c['as'],'attributes':_0x43df9c[_0xe67f('0x18')],'include':_0x43df9c[_0xe67f('0x1b')]?_[_0xe67f('0x1a')](_0x43df9c[_0xe67f('0x1b')],function(_0xd95866){return{'model':db[_0xd95866[_0xe67f('0x1c')]],'as':_0xd95866['as'],'attributes':_0xd95866[_0xe67f('0x18')]};}):[]};}):[]};}):[]:[]})[_0xe67f('0x9')](function(_0x44792d){logger[_0xe67f('0xa')](_0xe67f('0x1f'),_0x46453c);logger[_0xe67f('0x1d')](_0xe67f('0x1f'),_0x46453c,JSON[_0xe67f('0xc')](_0x44792d));_0x55c0a0(_0x44792d);})[_0xe67f('0x1e')](function(_0x8ae74f){logger[_0xe67f('0xd')](_0xe67f('0x1f'),_0x8ae74f[_0xe67f('0xf')],_0x46453c);_0x27c925(_0x57e7f6[_0xe67f('0xd')](0x1f4,_0x8ae74f[_0xe67f('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index bfcc669..59ef302 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 _0xe0b2=['fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','delete','util','path','Router'];(function(_0x5db52a,_0x889ddf){var _0x127e38=function(_0xb852a){while(--_0xb852a){_0x5db52a['push'](_0x5db52a['shift']());}};_0x127e38(++_0x889ddf);}(_0xe0b2,0x1a6));var _0x2e0b=function(_0x2b744e,_0x3de5c7){_0x2b744e=_0x2b744e-0x0;var _0x8da216=_0xe0b2[_0x2b744e];return _0x8da216;};'use strict';var multer=require('multer');var util=require(_0x2e0b('0x0'));var path=require(_0x2e0b('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2e0b('0x2')]();var fs_extra=require(_0x2e0b('0x3'));var auth=require(_0x2e0b('0x4'));var interaction=require(_0x2e0b('0x5'));var config=require('../../config/environment');var controller=require(_0x2e0b('0x6'));router[_0x2e0b('0x7')]('/',auth[_0x2e0b('0x8')](),controller[_0x2e0b('0x9')]);router[_0x2e0b('0x7')](_0x2e0b('0xa'),auth[_0x2e0b('0x8')](),controller[_0x2e0b('0xb')]);router[_0x2e0b('0x7')](_0x2e0b('0xc'),auth[_0x2e0b('0x8')](),controller[_0x2e0b('0xd')]);router['get'](_0x2e0b('0xe'),auth['isAuthenticated'](),controller[_0x2e0b('0xf')]);router['get'](_0x2e0b('0x10'),auth['isAuthenticated'](),controller[_0x2e0b('0x11')]);router[_0x2e0b('0x7')]('/:id/tags',auth['isAuthenticated'](),controller[_0x2e0b('0x12')]);router[_0x2e0b('0x13')]('/',auth[_0x2e0b('0x8')](),controller[_0x2e0b('0x14')]);router[_0x2e0b('0x13')](_0x2e0b('0x15'),auth[_0x2e0b('0x8')](),controller[_0x2e0b('0x16')]);router[_0x2e0b('0x17')](_0x2e0b('0xa'),auth[_0x2e0b('0x8')](),controller['update']);router[_0x2e0b('0x18')](_0x2e0b('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5b9d=['/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','post','setTags','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index'];(function(_0x1fc303,_0x535c37){var _0x23b54d=function(_0x2509d9){while(--_0x2509d9){_0x1fc303['push'](_0x1fc303['shift']());}};_0x23b54d(++_0x535c37);}(_0x5b9d,0x194));var _0xd5b9=function(_0x1ca890,_0x21d0d3){_0x1ca890=_0x1ca890-0x0;var _0x3f8e01=_0x5b9d[_0x1ca890];return _0x3f8e01;};'use strict';var multer=require(_0xd5b9('0x0'));var util=require(_0xd5b9('0x1'));var path=require(_0xd5b9('0x2'));var timeout=require(_0xd5b9('0x3'));var express=require(_0xd5b9('0x4'));var router=express[_0xd5b9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd5b9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd5b9('0x7'));var controller=require(_0xd5b9('0x8'));router[_0xd5b9('0x9')]('/',auth[_0xd5b9('0xa')](),controller[_0xd5b9('0xb')]);router[_0xd5b9('0x9')](_0xd5b9('0xc'),auth[_0xd5b9('0xa')](),controller[_0xd5b9('0xd')]);router[_0xd5b9('0x9')](_0xd5b9('0xe'),auth[_0xd5b9('0xa')](),controller[_0xd5b9('0xf')]);router[_0xd5b9('0x9')](_0xd5b9('0x10'),auth[_0xd5b9('0xa')](),controller[_0xd5b9('0x11')]);router['get'](_0xd5b9('0x12'),auth[_0xd5b9('0xa')](),controller['getDescriptions']);router[_0xd5b9('0x9')](_0xd5b9('0x13'),auth[_0xd5b9('0xa')](),controller['getTags']);router[_0xd5b9('0x14')]('/',auth[_0xd5b9('0xa')](),controller['create']);router[_0xd5b9('0x14')](_0xd5b9('0x13'),auth['isAuthenticated'](),controller[_0xd5b9('0x15')]);router['put'](_0xd5b9('0xc'),auth[_0xd5b9('0xa')](),controller[_0xd5b9('0x16')]);router[_0xd5b9('0x17')](_0xd5b9('0xc'),auth['isAuthenticated'](),controller[_0xd5b9('0x18')]);module[_0xd5b9('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 d93b7fb..5898913 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 _0x3e7a=['STRING','sequelize','exports'];(function(_0x10cfc0,_0x56b7be){var _0x1b4557=function(_0x31e687){while(--_0x31e687){_0x10cfc0['push'](_0x10cfc0['shift']());}};_0x1b4557(++_0x56b7be);}(_0x3e7a,0x1c0));var _0xa3e7=function(_0x34c669,_0x441344){_0x34c669=_0x34c669-0x0;var _0x527d01=_0x3e7a[_0x34c669];return _0x527d01;};'use strict';var Sequelize=require(_0xa3e7('0x0'));module[_0xa3e7('0x1')]={'name':{'type':Sequelize[_0xa3e7('0x2')]},'description':{'type':Sequelize[_0xa3e7('0x2')]}}; \ No newline at end of file +var _0xbedb=['sequelize','STRING'];(function(_0x587804,_0x26cdcf){var _0x499722=function(_0x5ab82b){while(--_0x5ab82b){_0x587804['push'](_0x587804['shift']());}};_0x499722(++_0x26cdcf);}(_0xbedb,0x98));var _0xbbed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbedb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xbbed('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbbed('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 452a9c4..bff5dfe 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 _0xf2a2=['set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','FreshdeskConfiguration','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','filters','create','body','find','getFields','findOne','FreshdeskField','pick','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','moment','mustache','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count'];(function(_0x37a794,_0x21db19){var _0x2d88ce=function(_0x12ea65){while(--_0x12ea65){_0x37a794['push'](_0x37a794['shift']());}};_0x2d88ce(++_0x21db19);}(_0xf2a2,0xde));var _0x2f2a=function(_0x422be2,_0x1c439e){_0x422be2=_0x422be2-0x0;var _0x1b820e=_0xf2a2[_0x422be2];return _0x1b820e;};'use strict';var emlformat=require(_0x2f2a('0x0'));var rimraf=require(_0x2f2a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2f2a('0x2'));var rp=require('request-promise');var moment=require(_0x2f2a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2f2a('0x4'));var util=require(_0x2f2a('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x2f2a('0x6'));var ejs=require(_0x2f2a('0x7'));var fs=require('fs');var fs_extra=require(_0x2f2a('0x8'));var _=require('lodash');var squel=require(_0x2f2a('0x9'));var crypto=require(_0x2f2a('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2f2a('0xb'));var toCsv=require('to-csv');var querystring=require(_0x2f2a('0xc'));var Papa=require(_0x2f2a('0xd'));var Redis=require(_0x2f2a('0xe'));var authService=require(_0x2f2a('0xf'));var qs=require(_0x2f2a('0x10'));var as=require(_0x2f2a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2f2a('0x12'));var utils=require('../../config/utils');var config=require(_0x2f2a('0x13'));var licenseUtil=require(_0x2f2a('0x14'));var db=require(_0x2f2a('0x15'))['db'];function respondWithStatusCode(_0x1c396a,_0x26eb83){_0x26eb83=_0x26eb83||0xcc;return function(_0x3fda72){if(_0x3fda72){return _0x1c396a[_0x2f2a('0x16')](_0x26eb83);}return _0x1c396a[_0x2f2a('0x17')](_0x26eb83)[_0x2f2a('0x18')]();};}function respondWithResult(_0x29f882,_0x5a787b){_0x5a787b=_0x5a787b||0xc8;return function(_0x21490b){if(_0x21490b){return _0x29f882['status'](_0x5a787b)[_0x2f2a('0x19')](_0x21490b);}};}function respondWithFilteredResult(_0x20b19d,_0x48edaa){return function(_0x266625){if(_0x266625){var _0x245538=typeof _0x48edaa['offset']===_0x2f2a('0x1a')&&typeof _0x48edaa[_0x2f2a('0x1b')]==='undefined';var _0x535d0b=_0x266625['count'];var _0x5ed13a=_0x245538?0x0:_0x48edaa[_0x2f2a('0x1c')];var _0x417b08=_0x245538?_0x266625[_0x2f2a('0x1d')]:_0x48edaa[_0x2f2a('0x1c')]+_0x48edaa['limit'];var _0x2e5713;if(_0x417b08>=_0x535d0b){_0x417b08=_0x535d0b;_0x2e5713=0xc8;}else{_0x2e5713=0xce;}_0x20b19d[_0x2f2a('0x17')](_0x2e5713);return _0x20b19d[_0x2f2a('0x1e')](_0x2f2a('0x1f'),_0x5ed13a+'-'+_0x417b08+'/'+_0x535d0b)[_0x2f2a('0x19')](_0x266625);}return null;};}function patchUpdates(_0x4002e5){return function(_0x3788c1){try{jsonpatch[_0x2f2a('0x20')](_0x3788c1,_0x4002e5,!![]);}catch(_0x4d9970){return BPromise[_0x2f2a('0x21')](_0x4d9970);}return _0x3788c1[_0x2f2a('0x22')]();};}function saveUpdates(_0x536929,_0x4bada4){return function(_0x33eab9){if(_0x33eab9){return _0x33eab9[_0x2f2a('0x23')](_0x536929)[_0x2f2a('0x24')](function(_0x318fad){return _0x318fad;});}return null;};}function removeEntity(_0x4549da,_0x2f1ddc){return function(_0x6b4df1){if(_0x6b4df1){return _0x6b4df1[_0x2f2a('0x25')]()[_0x2f2a('0x24')](function(){_0x4549da[_0x2f2a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x574703,_0x59b1c1){return function(_0x392e2){if(!_0x392e2){_0x574703[_0x2f2a('0x16')](0x194);}return _0x392e2;};}function handleError(_0x394f16,_0x1b3c2c){_0x1b3c2c=_0x1b3c2c||0x1f4;return function(_0x12d05b){logger[_0x2f2a('0x26')](_0x12d05b[_0x2f2a('0x27')]);if(_0x12d05b[_0x2f2a('0x28')]){delete _0x12d05b[_0x2f2a('0x28')];}_0x394f16[_0x2f2a('0x17')](_0x1b3c2c)[_0x2f2a('0x29')](_0x12d05b);};}exports['index']=function(_0x40976d,_0x413378){var _0x5c8540={},_0x2c3619={},_0x2e4c22={'count':0x0,'rows':[]};var _0x576c2b=_[_0x2f2a('0x2a')](db[_0x2f2a('0x2b')][_0x2f2a('0x2c')],function(_0x176b5f){return{'name':_0x176b5f[_0x2f2a('0x2d')],'type':_0x176b5f['type'][_0x2f2a('0x2e')]};});_0x2c3619[_0x2f2a('0x2f')]=_[_0x2f2a('0x2a')](_0x576c2b,_0x2f2a('0x28'));_0x2c3619[_0x2f2a('0x30')]=_[_0x2f2a('0x31')](_0x40976d[_0x2f2a('0x30')]);_0x2c3619['filters']=_[_0x2f2a('0x32')](_0x2c3619['model'],_0x2c3619[_0x2f2a('0x30')]);_0x5c8540[_0x2f2a('0x33')]=_[_0x2f2a('0x32')](_0x2c3619[_0x2f2a('0x2f')],qs[_0x2f2a('0x34')](_0x40976d['query'][_0x2f2a('0x34')]));_0x5c8540['attributes']=_0x5c8540['attributes'][_0x2f2a('0x35')]?_0x5c8540[_0x2f2a('0x33')]:_0x2c3619[_0x2f2a('0x2f')];if(!_0x40976d[_0x2f2a('0x30')][_0x2f2a('0x36')](_0x2f2a('0x37'))){_0x5c8540[_0x2f2a('0x1b')]=qs[_0x2f2a('0x1b')](_0x40976d[_0x2f2a('0x30')]['limit']);_0x5c8540[_0x2f2a('0x1c')]=qs[_0x2f2a('0x1c')](_0x40976d[_0x2f2a('0x30')][_0x2f2a('0x1c')]);}_0x5c8540[_0x2f2a('0x38')]=qs[_0x2f2a('0x39')](_0x40976d['query'][_0x2f2a('0x39')]);_0x5c8540[_0x2f2a('0x3a')]=qs['filters'](_['pick'](_0x40976d[_0x2f2a('0x30')],_0x2c3619['filters']),_0x576c2b);if(_0x40976d[_0x2f2a('0x30')][_0x2f2a('0x3b')]){_0x5c8540[_0x2f2a('0x3a')]=_[_0x2f2a('0x3c')](_0x5c8540[_0x2f2a('0x3a')],{'$or':_[_0x2f2a('0x2a')](_0x576c2b,function(_0x255833){if(_0x255833[_0x2f2a('0x3d')]!==_0x2f2a('0x3e')){var _0x20d87f={};_0x20d87f[_0x255833[_0x2f2a('0x28')]]={'$like':'%'+_0x40976d[_0x2f2a('0x30')][_0x2f2a('0x3b')]+'%'};return _0x20d87f;}})});}_0x5c8540=_[_0x2f2a('0x3c')]({},_0x5c8540,_0x40976d[_0x2f2a('0x3f')]);var _0x1da132={'where':_0x5c8540[_0x2f2a('0x3a')]};return db[_0x2f2a('0x2b')][_0x2f2a('0x1d')](_0x1da132)[_0x2f2a('0x24')](function(_0x430c20){_0x2e4c22[_0x2f2a('0x1d')]=_0x430c20;if(_0x40976d[_0x2f2a('0x30')][_0x2f2a('0x40')]){_0x5c8540[_0x2f2a('0x41')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x2f2a('0x42')](_0x5c8540);})['then'](function(_0x346992){_0x2e4c22[_0x2f2a('0x43')]=_0x346992;return _0x2e4c22;})['then'](respondWithFilteredResult(_0x413378,_0x5c8540))[_0x2f2a('0x44')](handleError(_0x413378,null));};exports[_0x2f2a('0x45')]=function(_0x2a02e2,_0x2d5080){var _0x2c080e={'raw':![],'where':{'id':_0x2a02e2[_0x2f2a('0x46')]['id']}},_0x2aba1d={};_0x2aba1d['model']=_[_0x2f2a('0x31')](db['FreshdeskConfiguration'][_0x2f2a('0x2c')]);_0x2aba1d[_0x2f2a('0x30')]=_['keys'](_0x2a02e2['query']);_0x2aba1d[_0x2f2a('0x47')]=_[_0x2f2a('0x32')](_0x2aba1d[_0x2f2a('0x2f')],_0x2aba1d[_0x2f2a('0x30')]);_0x2c080e[_0x2f2a('0x33')]=_['intersection'](_0x2aba1d[_0x2f2a('0x2f')],qs['fields'](_0x2a02e2[_0x2f2a('0x30')][_0x2f2a('0x34')]));_0x2c080e[_0x2f2a('0x33')]=_0x2c080e[_0x2f2a('0x33')][_0x2f2a('0x35')]?_0x2c080e[_0x2f2a('0x33')]:_0x2aba1d['model'];if(_0x2a02e2['query'][_0x2f2a('0x40')]){_0x2c080e[_0x2f2a('0x41')]=[{'all':!![]}];}_0x2c080e=_[_0x2f2a('0x3c')]({},_0x2c080e,_0x2a02e2[_0x2f2a('0x3f')]);return db[_0x2f2a('0x2b')]['find'](_0x2c080e)[_0x2f2a('0x24')](handleEntityNotFound(_0x2d5080,null))[_0x2f2a('0x24')](respondWithResult(_0x2d5080,null))[_0x2f2a('0x44')](handleError(_0x2d5080,null));};exports[_0x2f2a('0x48')]=function(_0x867053,_0x365969){return db[_0x2f2a('0x2b')][_0x2f2a('0x48')](_0x867053['body'],{})['then'](respondWithResult(_0x365969,0xc9))['catch'](handleError(_0x365969,null));};exports[_0x2f2a('0x23')]=function(_0x4a6af1,_0x2abe4b){if(_0x4a6af1[_0x2f2a('0x49')]['id']){delete _0x4a6af1[_0x2f2a('0x49')]['id'];}return db[_0x2f2a('0x2b')][_0x2f2a('0x4a')]({'where':{'id':_0x4a6af1['params']['id']}})[_0x2f2a('0x24')](handleEntityNotFound(_0x2abe4b,null))[_0x2f2a('0x24')](saveUpdates(_0x4a6af1[_0x2f2a('0x49')],null))['then'](respondWithResult(_0x2abe4b,null))[_0x2f2a('0x44')](handleError(_0x2abe4b,null));};exports['destroy']=function(_0xc8b8d5,_0x57ebf0){return db[_0x2f2a('0x2b')][_0x2f2a('0x4a')]({'where':{'id':_0xc8b8d5[_0x2f2a('0x46')]['id']}})[_0x2f2a('0x24')](handleEntityNotFound(_0x57ebf0,null))['then'](removeEntity(_0x57ebf0,null))['catch'](handleError(_0x57ebf0,null));};exports[_0x2f2a('0x4b')]=function(_0x54f208,_0x494f,_0x28bf95){var _0x709417={};var _0x286c3d={};var _0x3e7d45;var _0x54febf;return db[_0x2f2a('0x2b')][_0x2f2a('0x4c')]({'where':{'id':_0x54f208[_0x2f2a('0x46')]['id']}})[_0x2f2a('0x24')](handleEntityNotFound(_0x494f,null))[_0x2f2a('0x24')](function(_0x43e139){if(_0x43e139){_0x3e7d45=_0x43e139;_0x286c3d['model']=_[_0x2f2a('0x31')](db[_0x2f2a('0x4d')][_0x2f2a('0x2c')]);_0x286c3d['query']=_['keys'](_0x54f208[_0x2f2a('0x30')]);_0x286c3d[_0x2f2a('0x47')]=_['intersection'](_0x286c3d['model'],_0x286c3d['query']);_0x709417[_0x2f2a('0x33')]=_[_0x2f2a('0x32')](_0x286c3d[_0x2f2a('0x2f')],qs['fields'](_0x54f208['query']['fields']));_0x709417[_0x2f2a('0x33')]=_0x709417['attributes']['length']?_0x709417[_0x2f2a('0x33')]:_0x286c3d[_0x2f2a('0x2f')];_0x709417[_0x2f2a('0x38')]=qs[_0x2f2a('0x39')](_0x54f208[_0x2f2a('0x30')][_0x2f2a('0x39')]);_0x709417[_0x2f2a('0x3a')]=qs['filters'](_[_0x2f2a('0x4e')](_0x54f208[_0x2f2a('0x30')],_0x286c3d[_0x2f2a('0x47')]));if(_0x54f208[_0x2f2a('0x30')][_0x2f2a('0x3b')]){_0x709417[_0x2f2a('0x3a')]=_[_0x2f2a('0x3c')](_0x709417[_0x2f2a('0x3a')],{'$or':_[_0x2f2a('0x2a')](_0x709417['attributes'],function(_0x90b71e){var _0x79f1aa={};_0x79f1aa[_0x90b71e]={'$like':'%'+_0x54f208[_0x2f2a('0x30')]['filter']+'%'};return _0x79f1aa;})});}_0x709417=_['merge']({},_0x709417,_0x54f208[_0x2f2a('0x3f')]);return _0x3e7d45[_0x2f2a('0x4b')](_0x709417);}})['then'](function(_0x5dbadb){if(_0x5dbadb){_0x54febf=_0x5dbadb[_0x2f2a('0x35')];if(!_0x54f208[_0x2f2a('0x30')][_0x2f2a('0x36')](_0x2f2a('0x37'))){_0x709417['limit']=qs[_0x2f2a('0x1b')](_0x54f208[_0x2f2a('0x30')][_0x2f2a('0x1b')]);_0x709417[_0x2f2a('0x1c')]=qs['offset'](_0x54f208[_0x2f2a('0x30')][_0x2f2a('0x1c')]);}return _0x3e7d45[_0x2f2a('0x4b')](_0x709417);}})[_0x2f2a('0x24')](function(_0x3245cc){if(_0x3245cc){return _0x3245cc?{'count':_0x54febf,'rows':_0x3245cc}:null;}})[_0x2f2a('0x24')](respondWithResult(_0x494f,null))[_0x2f2a('0x44')](handleError(_0x494f,null));};exports[_0x2f2a('0x4f')]=function(_0x2e8cd1,_0xf961c9,_0x1bdc44){var _0x1dc38b={};var _0x1c09ce={};var _0x3e25ee;var _0x59c051;return db[_0x2f2a('0x2b')][_0x2f2a('0x4c')]({'where':{'id':_0x2e8cd1[_0x2f2a('0x46')]['id']}})['then'](handleEntityNotFound(_0xf961c9,null))[_0x2f2a('0x24')](function(_0xb6642f){if(_0xb6642f){_0x3e25ee=_0xb6642f;_0x1c09ce[_0x2f2a('0x2f')]=_[_0x2f2a('0x31')](db[_0x2f2a('0x4d')][_0x2f2a('0x2c')]);_0x1c09ce['query']=_['keys'](_0x2e8cd1[_0x2f2a('0x30')]);_0x1c09ce[_0x2f2a('0x47')]=_['intersection'](_0x1c09ce[_0x2f2a('0x2f')],_0x1c09ce[_0x2f2a('0x30')]);_0x1dc38b['attributes']=_[_0x2f2a('0x32')](_0x1c09ce[_0x2f2a('0x2f')],qs[_0x2f2a('0x34')](_0x2e8cd1[_0x2f2a('0x30')][_0x2f2a('0x34')]));_0x1dc38b[_0x2f2a('0x33')]=_0x1dc38b[_0x2f2a('0x33')][_0x2f2a('0x35')]?_0x1dc38b['attributes']:_0x1c09ce[_0x2f2a('0x2f')];_0x1dc38b[_0x2f2a('0x38')]=qs[_0x2f2a('0x39')](_0x2e8cd1[_0x2f2a('0x30')][_0x2f2a('0x39')]);_0x1dc38b[_0x2f2a('0x3a')]=qs['filters'](_[_0x2f2a('0x4e')](_0x2e8cd1[_0x2f2a('0x30')],_0x1c09ce[_0x2f2a('0x47')]));if(_0x2e8cd1[_0x2f2a('0x30')][_0x2f2a('0x3b')]){_0x1dc38b['where']=_['merge'](_0x1dc38b[_0x2f2a('0x3a')],{'$or':_['map'](_0x1dc38b[_0x2f2a('0x33')],function(_0x2569c3){var _0x1a5a7b={};_0x1a5a7b[_0x2569c3]={'$like':'%'+_0x2e8cd1[_0x2f2a('0x30')]['filter']+'%'};return _0x1a5a7b;})});}_0x1dc38b=_[_0x2f2a('0x3c')]({},_0x1dc38b,_0x2e8cd1[_0x2f2a('0x3f')]);return _0x3e25ee[_0x2f2a('0x4f')](_0x1dc38b);}})[_0x2f2a('0x24')](function(_0x3ba6e8){if(_0x3ba6e8){_0x59c051=_0x3ba6e8[_0x2f2a('0x35')];if(!_0x2e8cd1[_0x2f2a('0x30')]['hasOwnProperty']('nolimit')){_0x1dc38b[_0x2f2a('0x1b')]=qs[_0x2f2a('0x1b')](_0x2e8cd1[_0x2f2a('0x30')][_0x2f2a('0x1b')]);_0x1dc38b[_0x2f2a('0x1c')]=qs[_0x2f2a('0x1c')](_0x2e8cd1[_0x2f2a('0x30')]['offset']);}return _0x3e25ee[_0x2f2a('0x4f')](_0x1dc38b);}})[_0x2f2a('0x24')](function(_0xf4d95){if(_0xf4d95){return _0xf4d95?{'count':_0x59c051,'rows':_0xf4d95}:null;}})[_0x2f2a('0x24')](respondWithResult(_0xf961c9,null))['catch'](handleError(_0xf961c9,null));};exports[_0x2f2a('0x50')]=function(_0x59f4c7,_0x2b8cd3,_0x4f668d){var _0x2fad20={};var _0x4b9129={};var _0x1305d2;var _0x5b24f2;return db[_0x2f2a('0x2b')][_0x2f2a('0x4c')]({'where':{'id':_0x59f4c7[_0x2f2a('0x46')]['id']}})[_0x2f2a('0x24')](handleEntityNotFound(_0x2b8cd3,null))[_0x2f2a('0x24')](function(_0x49a77c){if(_0x49a77c){_0x1305d2=_0x49a77c;_0x4b9129['model']=_['keys'](db['FreshdeskField'][_0x2f2a('0x2c')]);_0x4b9129[_0x2f2a('0x30')]=_['keys'](_0x59f4c7['query']);_0x4b9129[_0x2f2a('0x47')]=_[_0x2f2a('0x32')](_0x4b9129[_0x2f2a('0x2f')],_0x4b9129[_0x2f2a('0x30')]);_0x2fad20[_0x2f2a('0x33')]=_['intersection'](_0x4b9129['model'],qs[_0x2f2a('0x34')](_0x59f4c7['query']['fields']));_0x2fad20['attributes']=_0x2fad20[_0x2f2a('0x33')][_0x2f2a('0x35')]?_0x2fad20['attributes']:_0x4b9129[_0x2f2a('0x2f')];_0x2fad20[_0x2f2a('0x38')]=qs[_0x2f2a('0x39')](_0x59f4c7[_0x2f2a('0x30')][_0x2f2a('0x39')]);_0x2fad20[_0x2f2a('0x3a')]=qs[_0x2f2a('0x47')](_[_0x2f2a('0x4e')](_0x59f4c7['query'],_0x4b9129['filters']));if(_0x59f4c7['query'][_0x2f2a('0x3b')]){_0x2fad20['where']=_['merge'](_0x2fad20[_0x2f2a('0x3a')],{'$or':_[_0x2f2a('0x2a')](_0x2fad20[_0x2f2a('0x33')],function(_0xd33112){var _0x2476c5={};_0x2476c5[_0xd33112]={'$like':'%'+_0x59f4c7['query'][_0x2f2a('0x3b')]+'%'};return _0x2476c5;})});}_0x2fad20=_[_0x2f2a('0x3c')]({},_0x2fad20,_0x59f4c7['options']);return _0x1305d2[_0x2f2a('0x50')](_0x2fad20);}})[_0x2f2a('0x24')](function(_0x29232d){if(_0x29232d){_0x5b24f2=_0x29232d['length'];if(!_0x59f4c7['query'][_0x2f2a('0x36')](_0x2f2a('0x37'))){_0x2fad20[_0x2f2a('0x1b')]=qs[_0x2f2a('0x1b')](_0x59f4c7['query'][_0x2f2a('0x1b')]);_0x2fad20['offset']=qs[_0x2f2a('0x1c')](_0x59f4c7[_0x2f2a('0x30')][_0x2f2a('0x1c')]);}return _0x1305d2[_0x2f2a('0x50')](_0x2fad20);}})[_0x2f2a('0x24')](function(_0x55e616){if(_0x55e616){return _0x55e616?{'count':_0x5b24f2,'rows':_0x55e616}:null;}})[_0x2f2a('0x24')](respondWithResult(_0x2b8cd3,null))[_0x2f2a('0x44')](handleError(_0x2b8cd3,null));};exports[_0x2f2a('0x51')]=function(_0x379642,_0xc80cd,_0x4a67d9){var _0x1dbb7b={};var _0x565197={};var _0x2d33ed;var _0x34ffe1;return db[_0x2f2a('0x2b')]['findOne']({'where':{'id':_0x379642['params']['id']}})[_0x2f2a('0x24')](handleEntityNotFound(_0xc80cd,null))[_0x2f2a('0x24')](function(_0x84111c){if(_0x84111c){_0x2d33ed=_0x84111c;_0x565197[_0x2f2a('0x2f')]=_[_0x2f2a('0x31')](db['Tag']['rawAttributes']);_0x565197[_0x2f2a('0x30')]=_[_0x2f2a('0x31')](_0x379642[_0x2f2a('0x30')]);_0x565197[_0x2f2a('0x47')]=_['intersection'](_0x565197[_0x2f2a('0x2f')],_0x565197['query']);_0x1dbb7b[_0x2f2a('0x33')]=_[_0x2f2a('0x32')](_0x565197['model'],qs[_0x2f2a('0x34')](_0x379642[_0x2f2a('0x30')][_0x2f2a('0x34')]));_0x1dbb7b[_0x2f2a('0x33')]=_0x1dbb7b[_0x2f2a('0x33')][_0x2f2a('0x35')]?_0x1dbb7b[_0x2f2a('0x33')]:_0x565197[_0x2f2a('0x2f')];_0x1dbb7b[_0x2f2a('0x38')]=qs[_0x2f2a('0x39')](_0x379642['query'][_0x2f2a('0x39')]);_0x1dbb7b[_0x2f2a('0x3a')]=qs[_0x2f2a('0x47')](_['pick'](_0x379642['query'],_0x565197[_0x2f2a('0x47')]));if(_0x379642[_0x2f2a('0x30')]['filter']){_0x1dbb7b[_0x2f2a('0x3a')]=_[_0x2f2a('0x3c')](_0x1dbb7b[_0x2f2a('0x3a')],{'$or':_[_0x2f2a('0x2a')](_0x1dbb7b[_0x2f2a('0x33')],function(_0x135b51){var _0x46dad6={};_0x46dad6[_0x135b51]={'$like':'%'+_0x379642[_0x2f2a('0x30')][_0x2f2a('0x3b')]+'%'};return _0x46dad6;})});}_0x1dbb7b=_['merge']({},_0x1dbb7b,_0x379642[_0x2f2a('0x3f')]);return _0x2d33ed[_0x2f2a('0x51')](_0x1dbb7b);}})[_0x2f2a('0x24')](function(_0x515ba5){if(_0x515ba5){_0x34ffe1=_0x515ba5['length'];if(!_0x379642[_0x2f2a('0x30')][_0x2f2a('0x36')](_0x2f2a('0x37'))){_0x1dbb7b['limit']=qs[_0x2f2a('0x1b')](_0x379642[_0x2f2a('0x30')][_0x2f2a('0x1b')]);_0x1dbb7b[_0x2f2a('0x1c')]=qs['offset'](_0x379642[_0x2f2a('0x30')][_0x2f2a('0x1c')]);}return _0x2d33ed[_0x2f2a('0x51')](_0x1dbb7b);}})['then'](function(_0x2affd9){if(_0x2affd9){return _0x2affd9?{'count':_0x34ffe1,'rows':_0x2affd9}:null;}})[_0x2f2a('0x24')](respondWithResult(_0xc80cd,null))[_0x2f2a('0x44')](handleError(_0xc80cd,null));};exports[_0x2f2a('0x52')]=function(_0x4d960f,_0x548852,_0x37ee93){if(_0x4d960f[_0x2f2a('0x49')]['id']){delete _0x4d960f[_0x2f2a('0x49')]['id'];}return db[_0x2f2a('0x2b')][_0x2f2a('0x4c')]({'where':{'id':_0x4d960f[_0x2f2a('0x46')]['id']}})['then'](handleEntityNotFound(_0x548852,null))[_0x2f2a('0x24')](function(_0x3dade1){if(_0x3dade1){return _0x3dade1[_0x2f2a('0x52')](_0x4d960f[_0x2f2a('0x49')][_0x2f2a('0x53')]||[]);}return null;})[_0x2f2a('0x24')](respondWithResult(_0x548852,null))[_0x2f2a('0x44')](handleError(_0x548852,null));}; \ No newline at end of file +var _0x8118=['show','params','rawAttributes','options','body','find','findOne','FreshdeskField','getFields','hasOwnProperty','nolimit','getSubjects','getDescriptions','getTags','setTags','ids','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','limit','undefined','count','set','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','FreshdeskConfiguration','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch'];(function(_0x44a07d,_0xdcb9c2){var _0x2b88c1=function(_0x590a32){while(--_0x590a32){_0x44a07d['push'](_0x44a07d['shift']());}};_0x2b88c1(++_0xdcb9c2);}(_0x8118,0x1a5));var _0x8811=function(_0xccf869,_0x2556a5){_0xccf869=_0xccf869-0x0;var _0x21a9db=_0x8118[_0xccf869];return _0x21a9db;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8811('0x0'));var zipdir=require(_0x8811('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8811('0x2'));var moment=require(_0x8811('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8811('0x4'));var util=require(_0x8811('0x5'));var path=require('path');var sox=require(_0x8811('0x6'));var csv=require(_0x8811('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8811('0x8'));var squel=require('squel');var crypto=require(_0x8811('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8811('0x7'));var querystring=require(_0x8811('0xa'));var Papa=require(_0x8811('0xb'));var Redis=require(_0x8811('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x8811('0xd'));var as=require(_0x8811('0xe'));var hardwareService=require(_0x8811('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x8811('0x10'));var config=require(_0x8811('0x11'));var licenseUtil=require(_0x8811('0x12'));var db=require(_0x8811('0x13'))['db'];function respondWithStatusCode(_0x48816d,_0x2e255d){_0x2e255d=_0x2e255d||0xcc;return function(_0xf423fc){if(_0xf423fc){return _0x48816d['sendStatus'](_0x2e255d);}return _0x48816d['status'](_0x2e255d)[_0x8811('0x14')]();};}function respondWithResult(_0x451a1b,_0x3d9fef){_0x3d9fef=_0x3d9fef||0xc8;return function(_0x429c1e){if(_0x429c1e){return _0x451a1b[_0x8811('0x15')](_0x3d9fef)['json'](_0x429c1e);}};}function respondWithFilteredResult(_0x4e5698,_0x3e57f4){return function(_0x6026a0){if(_0x6026a0){var _0x4e748d=typeof _0x3e57f4[_0x8811('0x16')]==='undefined'&&typeof _0x3e57f4[_0x8811('0x17')]===_0x8811('0x18');var _0x3a6504=_0x6026a0[_0x8811('0x19')];var _0x38284b=_0x4e748d?0x0:_0x3e57f4[_0x8811('0x16')];var _0x47dc77=_0x4e748d?_0x6026a0[_0x8811('0x19')]:_0x3e57f4[_0x8811('0x16')]+_0x3e57f4[_0x8811('0x17')];var _0x4a4d11;if(_0x47dc77>=_0x3a6504){_0x47dc77=_0x3a6504;_0x4a4d11=0xc8;}else{_0x4a4d11=0xce;}_0x4e5698['status'](_0x4a4d11);return _0x4e5698[_0x8811('0x1a')]('Content-Range',_0x38284b+'-'+_0x47dc77+'/'+_0x3a6504)[_0x8811('0x1b')](_0x6026a0);}return null;};}function patchUpdates(_0x49ede0){return function(_0x2301c5){try{jsonpatch[_0x8811('0x1c')](_0x2301c5,_0x49ede0,!![]);}catch(_0x37c8e2){return BPromise[_0x8811('0x1d')](_0x37c8e2);}return _0x2301c5[_0x8811('0x1e')]();};}function saveUpdates(_0x2dcd14,_0x433eb9){return function(_0x1a2a75){if(_0x1a2a75){return _0x1a2a75[_0x8811('0x1f')](_0x2dcd14)[_0x8811('0x20')](function(_0x40e87a){return _0x40e87a;});}return null;};}function removeEntity(_0x535dbf,_0x7adc23){return function(_0x5ded50){if(_0x5ded50){return _0x5ded50[_0x8811('0x21')]()['then'](function(){_0x535dbf[_0x8811('0x15')](0xcc)[_0x8811('0x14')]();});}};}function handleEntityNotFound(_0x300e48,_0x1d6ba9){return function(_0x373d2d){if(!_0x373d2d){_0x300e48[_0x8811('0x22')](0x194);}return _0x373d2d;};}function handleError(_0x4024de,_0x464d76){_0x464d76=_0x464d76||0x1f4;return function(_0x361628){logger[_0x8811('0x23')](_0x361628[_0x8811('0x24')]);if(_0x361628['name']){delete _0x361628[_0x8811('0x25')];}_0x4024de[_0x8811('0x15')](_0x464d76)[_0x8811('0x26')](_0x361628);};}exports[_0x8811('0x27')]=function(_0x43c531,_0x4b1b0a){var _0x465bc9={},_0x16df03={},_0x5a8d98={'count':0x0,'rows':[]};var _0x48066d=_[_0x8811('0x28')](db[_0x8811('0x29')]['rawAttributes'],function(_0x512523){return{'name':_0x512523[_0x8811('0x2a')],'type':_0x512523[_0x8811('0x2b')][_0x8811('0x2c')]};});_0x16df03['model']=_[_0x8811('0x28')](_0x48066d,_0x8811('0x25'));_0x16df03[_0x8811('0x2d')]=_[_0x8811('0x2e')](_0x43c531[_0x8811('0x2d')]);_0x16df03[_0x8811('0x2f')]=_[_0x8811('0x30')](_0x16df03[_0x8811('0x31')],_0x16df03['query']);_0x465bc9['attributes']=_[_0x8811('0x30')](_0x16df03[_0x8811('0x31')],qs[_0x8811('0x32')](_0x43c531[_0x8811('0x2d')][_0x8811('0x32')]));_0x465bc9[_0x8811('0x33')]=_0x465bc9[_0x8811('0x33')][_0x8811('0x34')]?_0x465bc9['attributes']:_0x16df03[_0x8811('0x31')];if(!_0x43c531[_0x8811('0x2d')]['hasOwnProperty']('nolimit')){_0x465bc9[_0x8811('0x17')]=qs[_0x8811('0x17')](_0x43c531[_0x8811('0x2d')]['limit']);_0x465bc9['offset']=qs['offset'](_0x43c531['query'][_0x8811('0x16')]);}_0x465bc9[_0x8811('0x35')]=qs[_0x8811('0x36')](_0x43c531[_0x8811('0x2d')][_0x8811('0x36')]);_0x465bc9['where']=qs[_0x8811('0x2f')](_[_0x8811('0x37')](_0x43c531[_0x8811('0x2d')],_0x16df03[_0x8811('0x2f')]),_0x48066d);if(_0x43c531[_0x8811('0x2d')][_0x8811('0x38')]){_0x465bc9[_0x8811('0x39')]=_[_0x8811('0x3a')](_0x465bc9[_0x8811('0x39')],{'$or':_[_0x8811('0x28')](_0x48066d,function(_0x28883b){if(_0x28883b[_0x8811('0x2b')]!==_0x8811('0x3b')){var _0x3ae123={};_0x3ae123[_0x28883b[_0x8811('0x25')]]={'$like':'%'+_0x43c531[_0x8811('0x2d')]['filter']+'%'};return _0x3ae123;}})});}_0x465bc9=_[_0x8811('0x3a')]({},_0x465bc9,_0x43c531['options']);var _0x218515={'where':_0x465bc9[_0x8811('0x39')]};return db[_0x8811('0x29')][_0x8811('0x19')](_0x218515)[_0x8811('0x20')](function(_0x3664c2){_0x5a8d98[_0x8811('0x19')]=_0x3664c2;if(_0x43c531['query'][_0x8811('0x3c')]){_0x465bc9[_0x8811('0x3d')]=[{'all':!![]}];}return db[_0x8811('0x29')][_0x8811('0x3e')](_0x465bc9);})[_0x8811('0x20')](function(_0x550179){_0x5a8d98[_0x8811('0x3f')]=_0x550179;return _0x5a8d98;})[_0x8811('0x20')](respondWithFilteredResult(_0x4b1b0a,_0x465bc9))[_0x8811('0x40')](handleError(_0x4b1b0a,null));};exports[_0x8811('0x41')]=function(_0x54b425,_0x2ecb2f){var _0x17f403={'raw':![],'where':{'id':_0x54b425[_0x8811('0x42')]['id']}},_0x205701={};_0x205701[_0x8811('0x31')]=_[_0x8811('0x2e')](db['FreshdeskConfiguration'][_0x8811('0x43')]);_0x205701['query']=_['keys'](_0x54b425[_0x8811('0x2d')]);_0x205701[_0x8811('0x2f')]=_[_0x8811('0x30')](_0x205701[_0x8811('0x31')],_0x205701[_0x8811('0x2d')]);_0x17f403[_0x8811('0x33')]=_[_0x8811('0x30')](_0x205701[_0x8811('0x31')],qs[_0x8811('0x32')](_0x54b425['query'][_0x8811('0x32')]));_0x17f403[_0x8811('0x33')]=_0x17f403[_0x8811('0x33')][_0x8811('0x34')]?_0x17f403['attributes']:_0x205701[_0x8811('0x31')];if(_0x54b425[_0x8811('0x2d')][_0x8811('0x3c')]){_0x17f403[_0x8811('0x3d')]=[{'all':!![]}];}_0x17f403=_[_0x8811('0x3a')]({},_0x17f403,_0x54b425[_0x8811('0x44')]);return db[_0x8811('0x29')]['find'](_0x17f403)[_0x8811('0x20')](handleEntityNotFound(_0x2ecb2f,null))[_0x8811('0x20')](respondWithResult(_0x2ecb2f,null))['catch'](handleError(_0x2ecb2f,null));};exports['create']=function(_0x52b4d7,_0x49c8ec){return db[_0x8811('0x29')]['create'](_0x52b4d7['body'],{})[_0x8811('0x20')](respondWithResult(_0x49c8ec,0xc9))['catch'](handleError(_0x49c8ec,null));};exports[_0x8811('0x1f')]=function(_0x43714b,_0x2f3031){if(_0x43714b[_0x8811('0x45')]['id']){delete _0x43714b[_0x8811('0x45')]['id'];}return db[_0x8811('0x29')][_0x8811('0x46')]({'where':{'id':_0x43714b[_0x8811('0x42')]['id']}})[_0x8811('0x20')](handleEntityNotFound(_0x2f3031,null))[_0x8811('0x20')](saveUpdates(_0x43714b[_0x8811('0x45')],null))[_0x8811('0x20')](respondWithResult(_0x2f3031,null))[_0x8811('0x40')](handleError(_0x2f3031,null));};exports['destroy']=function(_0xee4d42,_0x4a5049){return db[_0x8811('0x29')]['find']({'where':{'id':_0xee4d42[_0x8811('0x42')]['id']}})[_0x8811('0x20')](handleEntityNotFound(_0x4a5049,null))['then'](removeEntity(_0x4a5049,null))[_0x8811('0x40')](handleError(_0x4a5049,null));};exports['getFields']=function(_0x546060,_0x2c2f58,_0x32b74f){var _0x3f777e={};var _0x3b383e={};var _0x352a5e;var _0x4465cd;return db[_0x8811('0x29')][_0x8811('0x47')]({'where':{'id':_0x546060[_0x8811('0x42')]['id']}})[_0x8811('0x20')](handleEntityNotFound(_0x2c2f58,null))['then'](function(_0x50f852){if(_0x50f852){_0x352a5e=_0x50f852;_0x3b383e[_0x8811('0x31')]=_['keys'](db[_0x8811('0x48')]['rawAttributes']);_0x3b383e[_0x8811('0x2d')]=_[_0x8811('0x2e')](_0x546060[_0x8811('0x2d')]);_0x3b383e[_0x8811('0x2f')]=_[_0x8811('0x30')](_0x3b383e[_0x8811('0x31')],_0x3b383e[_0x8811('0x2d')]);_0x3f777e['attributes']=_['intersection'](_0x3b383e[_0x8811('0x31')],qs['fields'](_0x546060['query'][_0x8811('0x32')]));_0x3f777e[_0x8811('0x33')]=_0x3f777e[_0x8811('0x33')]['length']?_0x3f777e[_0x8811('0x33')]:_0x3b383e[_0x8811('0x31')];_0x3f777e[_0x8811('0x35')]=qs[_0x8811('0x36')](_0x546060[_0x8811('0x2d')]['sort']);_0x3f777e[_0x8811('0x39')]=qs[_0x8811('0x2f')](_[_0x8811('0x37')](_0x546060[_0x8811('0x2d')],_0x3b383e[_0x8811('0x2f')]));if(_0x546060[_0x8811('0x2d')][_0x8811('0x38')]){_0x3f777e['where']=_[_0x8811('0x3a')](_0x3f777e[_0x8811('0x39')],{'$or':_[_0x8811('0x28')](_0x3f777e[_0x8811('0x33')],function(_0x33cdb2){var _0x2b1e19={};_0x2b1e19[_0x33cdb2]={'$like':'%'+_0x546060['query'][_0x8811('0x38')]+'%'};return _0x2b1e19;})});}_0x3f777e=_['merge']({},_0x3f777e,_0x546060[_0x8811('0x44')]);return _0x352a5e[_0x8811('0x49')](_0x3f777e);}})[_0x8811('0x20')](function(_0xc3e81){if(_0xc3e81){_0x4465cd=_0xc3e81[_0x8811('0x34')];if(!_0x546060[_0x8811('0x2d')][_0x8811('0x4a')](_0x8811('0x4b'))){_0x3f777e[_0x8811('0x17')]=qs[_0x8811('0x17')](_0x546060[_0x8811('0x2d')][_0x8811('0x17')]);_0x3f777e[_0x8811('0x16')]=qs[_0x8811('0x16')](_0x546060[_0x8811('0x2d')][_0x8811('0x16')]);}return _0x352a5e[_0x8811('0x49')](_0x3f777e);}})[_0x8811('0x20')](function(_0x3ade0f){if(_0x3ade0f){return _0x3ade0f?{'count':_0x4465cd,'rows':_0x3ade0f}:null;}})[_0x8811('0x20')](respondWithResult(_0x2c2f58,null))['catch'](handleError(_0x2c2f58,null));};exports[_0x8811('0x4c')]=function(_0x5480fa,_0x198592,_0x4a8bdc){var _0x55bb9d={};var _0x2308a6={};var _0x5a42ad;var _0x2c3b9c;return db[_0x8811('0x29')][_0x8811('0x47')]({'where':{'id':_0x5480fa[_0x8811('0x42')]['id']}})['then'](handleEntityNotFound(_0x198592,null))['then'](function(_0x80ded4){if(_0x80ded4){_0x5a42ad=_0x80ded4;_0x2308a6[_0x8811('0x31')]=_['keys'](db[_0x8811('0x48')][_0x8811('0x43')]);_0x2308a6[_0x8811('0x2d')]=_[_0x8811('0x2e')](_0x5480fa[_0x8811('0x2d')]);_0x2308a6[_0x8811('0x2f')]=_['intersection'](_0x2308a6['model'],_0x2308a6['query']);_0x55bb9d[_0x8811('0x33')]=_[_0x8811('0x30')](_0x2308a6[_0x8811('0x31')],qs[_0x8811('0x32')](_0x5480fa[_0x8811('0x2d')][_0x8811('0x32')]));_0x55bb9d[_0x8811('0x33')]=_0x55bb9d[_0x8811('0x33')][_0x8811('0x34')]?_0x55bb9d['attributes']:_0x2308a6[_0x8811('0x31')];_0x55bb9d[_0x8811('0x35')]=qs[_0x8811('0x36')](_0x5480fa[_0x8811('0x2d')]['sort']);_0x55bb9d[_0x8811('0x39')]=qs['filters'](_['pick'](_0x5480fa[_0x8811('0x2d')],_0x2308a6['filters']));if(_0x5480fa[_0x8811('0x2d')][_0x8811('0x38')]){_0x55bb9d[_0x8811('0x39')]=_[_0x8811('0x3a')](_0x55bb9d[_0x8811('0x39')],{'$or':_[_0x8811('0x28')](_0x55bb9d[_0x8811('0x33')],function(_0x484be7){var _0x54d07d={};_0x54d07d[_0x484be7]={'$like':'%'+_0x5480fa[_0x8811('0x2d')]['filter']+'%'};return _0x54d07d;})});}_0x55bb9d=_['merge']({},_0x55bb9d,_0x5480fa['options']);return _0x5a42ad['getSubjects'](_0x55bb9d);}})[_0x8811('0x20')](function(_0x38d0dc){if(_0x38d0dc){_0x2c3b9c=_0x38d0dc[_0x8811('0x34')];if(!_0x5480fa[_0x8811('0x2d')][_0x8811('0x4a')](_0x8811('0x4b'))){_0x55bb9d[_0x8811('0x17')]=qs['limit'](_0x5480fa[_0x8811('0x2d')][_0x8811('0x17')]);_0x55bb9d[_0x8811('0x16')]=qs['offset'](_0x5480fa[_0x8811('0x2d')][_0x8811('0x16')]);}return _0x5a42ad[_0x8811('0x4c')](_0x55bb9d);}})[_0x8811('0x20')](function(_0x11e165){if(_0x11e165){return _0x11e165?{'count':_0x2c3b9c,'rows':_0x11e165}:null;}})[_0x8811('0x20')](respondWithResult(_0x198592,null))[_0x8811('0x40')](handleError(_0x198592,null));};exports['getDescriptions']=function(_0x2eec72,_0x71eb51,_0x3c766){var _0x98d71c={};var _0x238a70={};var _0x104ed5;var _0x357223;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x2eec72[_0x8811('0x42')]['id']}})['then'](handleEntityNotFound(_0x71eb51,null))[_0x8811('0x20')](function(_0x55f66d){if(_0x55f66d){_0x104ed5=_0x55f66d;_0x238a70[_0x8811('0x31')]=_['keys'](db[_0x8811('0x48')][_0x8811('0x43')]);_0x238a70[_0x8811('0x2d')]=_[_0x8811('0x2e')](_0x2eec72['query']);_0x238a70[_0x8811('0x2f')]=_[_0x8811('0x30')](_0x238a70['model'],_0x238a70[_0x8811('0x2d')]);_0x98d71c[_0x8811('0x33')]=_[_0x8811('0x30')](_0x238a70[_0x8811('0x31')],qs[_0x8811('0x32')](_0x2eec72[_0x8811('0x2d')][_0x8811('0x32')]));_0x98d71c['attributes']=_0x98d71c[_0x8811('0x33')][_0x8811('0x34')]?_0x98d71c[_0x8811('0x33')]:_0x238a70[_0x8811('0x31')];_0x98d71c['order']=qs['sort'](_0x2eec72['query'][_0x8811('0x36')]);_0x98d71c[_0x8811('0x39')]=qs[_0x8811('0x2f')](_[_0x8811('0x37')](_0x2eec72[_0x8811('0x2d')],_0x238a70['filters']));if(_0x2eec72[_0x8811('0x2d')]['filter']){_0x98d71c[_0x8811('0x39')]=_[_0x8811('0x3a')](_0x98d71c[_0x8811('0x39')],{'$or':_['map'](_0x98d71c[_0x8811('0x33')],function(_0x27f6f3){var _0x4f5ca6={};_0x4f5ca6[_0x27f6f3]={'$like':'%'+_0x2eec72[_0x8811('0x2d')][_0x8811('0x38')]+'%'};return _0x4f5ca6;})});}_0x98d71c=_['merge']({},_0x98d71c,_0x2eec72[_0x8811('0x44')]);return _0x104ed5['getDescriptions'](_0x98d71c);}})[_0x8811('0x20')](function(_0x4d57c7){if(_0x4d57c7){_0x357223=_0x4d57c7[_0x8811('0x34')];if(!_0x2eec72[_0x8811('0x2d')]['hasOwnProperty'](_0x8811('0x4b'))){_0x98d71c[_0x8811('0x17')]=qs[_0x8811('0x17')](_0x2eec72['query'][_0x8811('0x17')]);_0x98d71c['offset']=qs[_0x8811('0x16')](_0x2eec72[_0x8811('0x2d')][_0x8811('0x16')]);}return _0x104ed5[_0x8811('0x4d')](_0x98d71c);}})[_0x8811('0x20')](function(_0x2c1508){if(_0x2c1508){return _0x2c1508?{'count':_0x357223,'rows':_0x2c1508}:null;}})[_0x8811('0x20')](respondWithResult(_0x71eb51,null))['catch'](handleError(_0x71eb51,null));};exports[_0x8811('0x4e')]=function(_0x3552e7,_0x4238c0,_0x52036f){var _0x5687c4={};var _0x320fa4={};var _0x368d31;var _0x3248fe;return db[_0x8811('0x29')][_0x8811('0x47')]({'where':{'id':_0x3552e7[_0x8811('0x42')]['id']}})[_0x8811('0x20')](handleEntityNotFound(_0x4238c0,null))[_0x8811('0x20')](function(_0x2234c7){if(_0x2234c7){_0x368d31=_0x2234c7;_0x320fa4[_0x8811('0x31')]=_['keys'](db['Tag']['rawAttributes']);_0x320fa4[_0x8811('0x2d')]=_[_0x8811('0x2e')](_0x3552e7['query']);_0x320fa4[_0x8811('0x2f')]=_['intersection'](_0x320fa4[_0x8811('0x31')],_0x320fa4[_0x8811('0x2d')]);_0x5687c4[_0x8811('0x33')]=_[_0x8811('0x30')](_0x320fa4[_0x8811('0x31')],qs['fields'](_0x3552e7[_0x8811('0x2d')][_0x8811('0x32')]));_0x5687c4[_0x8811('0x33')]=_0x5687c4[_0x8811('0x33')][_0x8811('0x34')]?_0x5687c4[_0x8811('0x33')]:_0x320fa4[_0x8811('0x31')];_0x5687c4[_0x8811('0x35')]=qs[_0x8811('0x36')](_0x3552e7[_0x8811('0x2d')]['sort']);_0x5687c4[_0x8811('0x39')]=qs[_0x8811('0x2f')](_[_0x8811('0x37')](_0x3552e7[_0x8811('0x2d')],_0x320fa4[_0x8811('0x2f')]));if(_0x3552e7[_0x8811('0x2d')][_0x8811('0x38')]){_0x5687c4['where']=_['merge'](_0x5687c4[_0x8811('0x39')],{'$or':_[_0x8811('0x28')](_0x5687c4[_0x8811('0x33')],function(_0x1da279){var _0x502e67={};_0x502e67[_0x1da279]={'$like':'%'+_0x3552e7[_0x8811('0x2d')][_0x8811('0x38')]+'%'};return _0x502e67;})});}_0x5687c4=_[_0x8811('0x3a')]({},_0x5687c4,_0x3552e7[_0x8811('0x44')]);return _0x368d31['getTags'](_0x5687c4);}})['then'](function(_0x499d29){if(_0x499d29){_0x3248fe=_0x499d29[_0x8811('0x34')];if(!_0x3552e7['query'][_0x8811('0x4a')](_0x8811('0x4b'))){_0x5687c4[_0x8811('0x17')]=qs[_0x8811('0x17')](_0x3552e7['query']['limit']);_0x5687c4[_0x8811('0x16')]=qs[_0x8811('0x16')](_0x3552e7[_0x8811('0x2d')][_0x8811('0x16')]);}return _0x368d31[_0x8811('0x4e')](_0x5687c4);}})[_0x8811('0x20')](function(_0x5ab7ee){if(_0x5ab7ee){return _0x5ab7ee?{'count':_0x3248fe,'rows':_0x5ab7ee}:null;}})[_0x8811('0x20')](respondWithResult(_0x4238c0,null))['catch'](handleError(_0x4238c0,null));};exports[_0x8811('0x4f')]=function(_0x20caa2,_0x53f247,_0x14aa6e){if(_0x20caa2[_0x8811('0x45')]['id']){delete _0x20caa2[_0x8811('0x45')]['id'];}return db[_0x8811('0x29')][_0x8811('0x47')]({'where':{'id':_0x20caa2[_0x8811('0x42')]['id']}})[_0x8811('0x20')](handleEntityNotFound(_0x53f247,null))['then'](function(_0x4fda63){if(_0x4fda63){return _0x4fda63[_0x8811('0x4f')](_0x20caa2['body'][_0x8811('0x50')]||[]);}return null;})[_0x8811('0x20')](respondWithResult(_0x53f247,null))[_0x8811('0x40')](handleError(_0x53f247,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 932eb0d..9637867 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 _0x535c=['../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','util','api','bluebird','path','rimraf'];(function(_0x516618,_0x214849){var _0x16d65f=function(_0x2fbad6){while(--_0x2fbad6){_0x516618['push'](_0x516618['shift']());}};_0x16d65f(++_0x214849);}(_0x535c,0x1b3));var _0xc535=function(_0x5ad67c,_0x144860){_0x5ad67c=_0x5ad67c-0x0;var _0xccce2e=_0x535c[_0x5ad67c];return _0xccce2e;};'use strict';var _=require('lodash');var util=require(_0xc535('0x0'));var logger=require('../../config/logger')(_0xc535('0x1'));var moment=require('moment');var BPromise=require(_0xc535('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc535('0x3'));var rimraf=require(_0xc535('0x4'));var config=require(_0xc535('0x5'));var attributes=require(_0xc535('0x6'));module[_0xc535('0x7')]=function(_0x455b69,_0xe2ed82){return _0x455b69[_0xc535('0x8')](_0xc535('0x9'),attributes,{'tableName':_0xc535('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa6d6=['request-promise','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','api','moment','bluebird'];(function(_0x1948ac,_0x5254b3){var _0x98b6f7=function(_0xea9e0f){while(--_0xea9e0f){_0x1948ac['push'](_0x1948ac['shift']());}};_0x98b6f7(++_0x5254b3);}(_0xa6d6,0x14b));var _0x6a6d=function(_0x36bdd2,_0x1cfead){_0x36bdd2=_0x36bdd2-0x0;var _0x251b1f=_0xa6d6[_0x36bdd2];return _0x251b1f;};'use strict';var _=require(_0x6a6d('0x0'));var util=require('util');var logger=require(_0x6a6d('0x1'))(_0x6a6d('0x2'));var moment=require(_0x6a6d('0x3'));var BPromise=require(_0x6a6d('0x4'));var rp=require(_0x6a6d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6a6d('0x6'));var attributes=require(_0x6a6d('0x7'));module[_0x6a6d('0x8')]=function(_0x52772b,_0x11dd34){return _0x52772b[_0x6a6d('0x9')](_0x6a6d('0xa'),attributes,{'tableName':_0x6a6d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 005a577..f754b7a 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 _0x0a99=['info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x0a99,0x11e));var _0x90a9=function(_0x2e2f1c,_0x4e9136){_0x2e2f1c=_0x2e2f1c-0x0;var _0x12c396=_0x0a99[_0x2e2f1c];return _0x12c396;};'use strict';var _=require(_0x90a9('0x0'));var util=require(_0x90a9('0x1'));var moment=require(_0x90a9('0x2'));var BPromise=require(_0x90a9('0x3'));var rs=require(_0x90a9('0x4'));var fs=require('fs');var Redis=require(_0x90a9('0x5'));var db=require(_0x90a9('0x6'))['db'];var utils=require(_0x90a9('0x7'));var logger=require('../../config/logger')(_0x90a9('0x8'));var config=require('../../config/environment');var jayson=require(_0x90a9('0x9'));var client=jayson[_0x90a9('0xa')][_0x90a9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b0536,_0x536a75,_0xab22a){return new BPromise(function(_0x355a53,_0x4ce92d){return client[_0x90a9('0xc')](_0x1b0536,_0xab22a)[_0x90a9('0xd')](function(_0x39e0e6){logger[_0x90a9('0xe')](_0x90a9('0xf'),_0x536a75,_0x90a9('0x10'));logger[_0x90a9('0x11')](_0x90a9('0x12'),_0x536a75,'request\x20sent',JSON[_0x90a9('0x13')](_0x39e0e6));if(_0x39e0e6[_0x90a9('0x14')]){if(_0x39e0e6['error'][_0x90a9('0x15')]===0x1f4){logger['error'](_0x90a9('0xf'),_0x536a75,_0x39e0e6[_0x90a9('0x14')][_0x90a9('0x16')]);return _0x4ce92d(_0x39e0e6[_0x90a9('0x14')][_0x90a9('0x16')]);}logger[_0x90a9('0x14')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x536a75,_0x39e0e6[_0x90a9('0x14')][_0x90a9('0x16')]);return _0x355a53(_0x39e0e6[_0x90a9('0x14')][_0x90a9('0x16')]);}else{logger[_0x90a9('0xe')](_0x90a9('0xf'),_0x536a75,_0x90a9('0x10'));_0x355a53(_0x39e0e6[_0x90a9('0x17')][_0x90a9('0x16')]);}})[_0x90a9('0x18')](function(_0x48707a){logger[_0x90a9('0x14')](_0x90a9('0xf'),_0x536a75,_0x48707a);_0x4ce92d(_0x48707a);});});} \ No newline at end of file +var _0x54c8=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','catch','util'];(function(_0x3410ee,_0x2463ed){var _0x4bf77f=function(_0x2ee70f){while(--_0x2ee70f){_0x3410ee['push'](_0x3410ee['shift']());}};_0x4bf77f(++_0x2463ed);}(_0x54c8,0x186));var _0x854c=function(_0x1bc88f,_0x5697c4){_0x1bc88f=_0x1bc88f-0x0;var _0x1007d1=_0x54c8[_0x1bc88f];return _0x1007d1;};'use strict';var _=require('lodash');var util=require(_0x854c('0x0'));var moment=require(_0x854c('0x1'));var BPromise=require(_0x854c('0x2'));var rs=require(_0x854c('0x3'));var fs=require('fs');var Redis=require(_0x854c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x854c('0x5'));var logger=require('../../config/logger')(_0x854c('0x6'));var config=require(_0x854c('0x7'));var jayson=require(_0x854c('0x8'));var client=jayson[_0x854c('0x9')][_0x854c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c6275,_0x27fd11,_0x22304d){return new BPromise(function(_0x5dac45,_0x519d8d){return client[_0x854c('0xb')](_0x1c6275,_0x22304d)[_0x854c('0xc')](function(_0x290cf2){logger[_0x854c('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x27fd11,_0x854c('0xe'));logger[_0x854c('0xf')](_0x854c('0x10'),_0x27fd11,_0x854c('0xe'),JSON[_0x854c('0x11')](_0x290cf2));if(_0x290cf2[_0x854c('0x12')]){if(_0x290cf2['error'][_0x854c('0x13')]===0x1f4){logger[_0x854c('0x12')](_0x854c('0x14'),_0x27fd11,_0x290cf2[_0x854c('0x12')]['message']);return _0x519d8d(_0x290cf2['error']['message']);}logger['error'](_0x854c('0x14'),_0x27fd11,_0x290cf2[_0x854c('0x12')][_0x854c('0x15')]);return _0x5dac45(_0x290cf2[_0x854c('0x12')][_0x854c('0x15')]);}else{logger[_0x854c('0xd')](_0x854c('0x14'),_0x27fd11,_0x854c('0xe'));_0x5dac45(_0x290cf2['result'][_0x854c('0x15')]);}})[_0x854c('0x16')](function(_0x1b18c8){logger['error'](_0x854c('0x14'),_0x27fd11,_0x1b18c8);_0x519d8d(_0x1b18c8);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 906c41b..fc3a51a 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 _0x52b8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','show','post','put','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x52b8,0x1c7));var _0x852b=function(_0x4bba83,_0x36bc5c){_0x4bba83=_0x4bba83-0x0;var _0x4433ae=_0x52b8[_0x4bba83];return _0x4433ae;};'use strict';var multer=require('multer');var util=require(_0x852b('0x0'));var path=require(_0x852b('0x1'));var timeout=require(_0x852b('0x2'));var express=require(_0x852b('0x3'));var router=express[_0x852b('0x4')]();var fs_extra=require(_0x852b('0x5'));var auth=require(_0x852b('0x6'));var interaction=require(_0x852b('0x7'));var config=require(_0x852b('0x8'));var controller=require(_0x852b('0x9'));router[_0x852b('0xa')]('/',auth[_0x852b('0xb')](),controller[_0x852b('0xc')]);router[_0x852b('0xa')]('/:id',auth[_0x852b('0xb')](),controller[_0x852b('0xd')]);router[_0x852b('0xe')]('/',auth[_0x852b('0xb')](),controller['create']);router[_0x852b('0xf')](_0x852b('0x10'),auth[_0x852b('0xb')](),controller['update']);router[_0x852b('0x11')](_0x852b('0x10'),auth[_0x852b('0xb')](),controller[_0x852b('0x12')]);module[_0x852b('0x13')]=router; \ No newline at end of file +var _0xc8c6=['multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','get','index','/:id','isAuthenticated','show','post','put','delete','destroy'];(function(_0x300522,_0x4562b4){var _0x536ff5=function(_0x3158b4){while(--_0x3158b4){_0x300522['push'](_0x300522['shift']());}};_0x536ff5(++_0x4562b4);}(_0xc8c6,0x160));var _0x6c8c=function(_0x3a10b6,_0x3181f0){_0x3a10b6=_0x3a10b6-0x0;var _0x463dc3=_0xc8c6[_0x3a10b6];return _0x463dc3;};'use strict';var multer=require(_0x6c8c('0x0'));var util=require('util');var path=require(_0x6c8c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6c8c('0x2')]();var fs_extra=require(_0x6c8c('0x3'));var auth=require(_0x6c8c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6c8c('0x5'));var controller=require(_0x6c8c('0x6'));router[_0x6c8c('0x7')]('/',auth['isAuthenticated'](),controller[_0x6c8c('0x8')]);router[_0x6c8c('0x7')](_0x6c8c('0x9'),auth[_0x6c8c('0xa')](),controller[_0x6c8c('0xb')]);router[_0x6c8c('0xc')]('/',auth[_0x6c8c('0xa')](),controller['create']);router[_0x6c8c('0xd')](_0x6c8c('0x9'),auth[_0x6c8c('0xa')](),controller['update']);router[_0x6c8c('0xe')]('/:id',auth[_0x6c8c('0xa')](),controller[_0x6c8c('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index e1f0ecb..abd7577 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 _0xe1f6=['customVariable','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x5498b8,_0x5033e7){var _0x29c87b=function(_0x249f60){while(--_0x249f60){_0x5498b8['push'](_0x5498b8['shift']());}};_0x29c87b(++_0x5033e7);}(_0xe1f6,0x1cf));var _0x6e1f=function(_0x527eef,_0x386ebb){_0x527eef=_0x527eef-0x0;var _0x4903cc=_0xe1f6[_0x527eef];return _0x4903cc;};'use strict';var Sequelize=require(_0x6e1f('0x0'));module[_0x6e1f('0x1')]={'type':{'type':Sequelize[_0x6e1f('0x2')](_0x6e1f('0x3'),_0x6e1f('0x4'),_0x6e1f('0x5'),'keyValue',_0x6e1f('0x6')),'defaultValue':_0x6e1f('0x3')},'content':{'type':Sequelize[_0x6e1f('0x7')]},'key':{'type':Sequelize[_0x6e1f('0x7')]},'keyType':{'type':Sequelize[_0x6e1f('0x2')](_0x6e1f('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6e1f('0x7')]},'nameField':{'type':Sequelize[_0x6e1f('0x7')]},'customField':{'type':Sequelize[_0x6e1f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6e1f('0x7')]}}; \ No newline at end of file +var _0x60d7=['variable','keyValue','picklist','customVariable','STRING','BOOLEAN','sequelize','string'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x60d7,0x19e));var _0x760d=function(_0x4f3254,_0x424c1e){_0x4f3254=_0x4f3254-0x0;var _0x2dda15=_0x60d7[_0x4f3254];return _0x2dda15;};'use strict';var Sequelize=require(_0x760d('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x760d('0x1'),_0x760d('0x2'),'customVariable',_0x760d('0x3'),_0x760d('0x4')),'defaultValue':_0x760d('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x760d('0x1'),_0x760d('0x2'),_0x760d('0x5'))},'keyContent':{'type':Sequelize[_0x760d('0x6')]},'idField':{'type':Sequelize[_0x760d('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x760d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x760d('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 007b921..7ed0a6a 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 _0xd52a=['catch','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','name','send','index','map','FreshdeskField','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','type','filter','options','then','includeAll','rows','show','params','keys','include','find','create','body'];(function(_0x5bc974,_0x88638c){var _0x5c3504=function(_0x36647e){while(--_0x36647e){_0x5bc974['push'](_0x5bc974['shift']());}};_0x5c3504(++_0x88638c);}(_0xd52a,0xca));var _0xad52=function(_0x4a6bfb,_0x16acff){_0x4a6bfb=_0x4a6bfb-0x0;var _0x799c15=_0xd52a[_0x4a6bfb];return _0x799c15;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xad52('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xad52('0x1'));var rp=require(_0xad52('0x2'));var moment=require(_0xad52('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xad52('0x4'));var util=require(_0xad52('0x5'));var path=require(_0xad52('0x6'));var sox=require(_0xad52('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xad52('0x8'));var squel=require('squel');var crypto=require(_0xad52('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xad52('0xa'));var toCsv=require(_0xad52('0xb'));var querystring=require('querystring');var Papa=require(_0xad52('0xc'));var Redis=require('ioredis');var authService=require(_0xad52('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xad52('0xe'));var hardwareService=require(_0xad52('0xf'));var logger=require(_0xad52('0x10'))(_0xad52('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xad52('0x12'))['db'];function respondWithStatusCode(_0x79b1e7,_0x378b0c){_0x378b0c=_0x378b0c||0xcc;return function(_0x41331e){if(_0x41331e){return _0x79b1e7[_0xad52('0x13')](_0x378b0c);}return _0x79b1e7[_0xad52('0x14')](_0x378b0c)[_0xad52('0x15')]();};}function respondWithResult(_0xd04cde,_0x3d2df6){_0x3d2df6=_0x3d2df6||0xc8;return function(_0x5727a2){if(_0x5727a2){return _0xd04cde[_0xad52('0x14')](_0x3d2df6)[_0xad52('0x16')](_0x5727a2);}};}function respondWithFilteredResult(_0x3bc8f6,_0x42eb20){return function(_0x38be7e){if(_0x38be7e){var _0xcb6cd5=typeof _0x42eb20[_0xad52('0x17')]===_0xad52('0x18')&&typeof _0x42eb20[_0xad52('0x19')]==='undefined';var _0x4abd73=_0x38be7e[_0xad52('0x1a')];var _0x39128c=_0xcb6cd5?0x0:_0x42eb20[_0xad52('0x17')];var _0x1c19e9=_0xcb6cd5?_0x38be7e[_0xad52('0x1a')]:_0x42eb20['offset']+_0x42eb20[_0xad52('0x19')];var _0x5a71c4;if(_0x1c19e9>=_0x4abd73){_0x1c19e9=_0x4abd73;_0x5a71c4=0xc8;}else{_0x5a71c4=0xce;}_0x3bc8f6[_0xad52('0x14')](_0x5a71c4);return _0x3bc8f6[_0xad52('0x1b')](_0xad52('0x1c'),_0x39128c+'-'+_0x1c19e9+'/'+_0x4abd73)['json'](_0x38be7e);}return null;};}function patchUpdates(_0x24fb52){return function(_0x593dfd){try{jsonpatch[_0xad52('0x1d')](_0x593dfd,_0x24fb52,!![]);}catch(_0x179a64){return BPromise[_0xad52('0x1e')](_0x179a64);}return _0x593dfd[_0xad52('0x1f')]();};}function saveUpdates(_0x2c182f,_0x2f1526){return function(_0x4b5f2f){if(_0x4b5f2f){return _0x4b5f2f[_0xad52('0x20')](_0x2c182f)['then'](function(_0x1aac2e){return _0x1aac2e;});}return null;};}function removeEntity(_0x2acbb4,_0x2fa90c){return function(_0x5bce67){if(_0x5bce67){return _0x5bce67[_0xad52('0x21')]()['then'](function(){_0x2acbb4['status'](0xcc)[_0xad52('0x15')]();});}};}function handleEntityNotFound(_0x583999,_0x477b47){return function(_0x3a54a1){if(!_0x3a54a1){_0x583999['sendStatus'](0x194);}return _0x3a54a1;};}function handleError(_0x58adf5,_0xb526bf){_0xb526bf=_0xb526bf||0x1f4;return function(_0x31b5e0){logger[_0xad52('0x22')](_0x31b5e0['stack']);if(_0x31b5e0[_0xad52('0x23')]){delete _0x31b5e0['name'];}_0x58adf5[_0xad52('0x14')](_0xb526bf)[_0xad52('0x24')](_0x31b5e0);};}exports[_0xad52('0x25')]=function(_0x231bbe,_0x503bd0){var _0x426106={},_0x2a604c={},_0x534cc5={'count':0x0,'rows':[]};var _0x3f5757=_[_0xad52('0x26')](db[_0xad52('0x27')][_0xad52('0x28')],function(_0x32f4fe){return{'name':_0x32f4fe['fieldName'],'type':_0x32f4fe['type']['key']};});_0x2a604c[_0xad52('0x29')]=_[_0xad52('0x26')](_0x3f5757,_0xad52('0x23'));_0x2a604c['query']=_['keys'](_0x231bbe[_0xad52('0x2a')]);_0x2a604c[_0xad52('0x2b')]=_[_0xad52('0x2c')](_0x2a604c[_0xad52('0x29')],_0x2a604c[_0xad52('0x2a')]);_0x426106[_0xad52('0x2d')]=_['intersection'](_0x2a604c[_0xad52('0x29')],qs[_0xad52('0x2e')](_0x231bbe[_0xad52('0x2a')][_0xad52('0x2e')]));_0x426106[_0xad52('0x2d')]=_0x426106[_0xad52('0x2d')][_0xad52('0x2f')]?_0x426106[_0xad52('0x2d')]:_0x2a604c[_0xad52('0x29')];if(!_0x231bbe[_0xad52('0x2a')][_0xad52('0x30')]('nolimit')){_0x426106[_0xad52('0x19')]=qs[_0xad52('0x19')](_0x231bbe[_0xad52('0x2a')][_0xad52('0x19')]);_0x426106[_0xad52('0x17')]=qs[_0xad52('0x17')](_0x231bbe['query'][_0xad52('0x17')]);}_0x426106[_0xad52('0x31')]=qs[_0xad52('0x32')](_0x231bbe['query'][_0xad52('0x32')]);_0x426106[_0xad52('0x33')]=qs[_0xad52('0x2b')](_['pick'](_0x231bbe[_0xad52('0x2a')],_0x2a604c[_0xad52('0x2b')]),_0x3f5757);if(_0x231bbe[_0xad52('0x2a')]['filter']){_0x426106[_0xad52('0x33')]=_[_0xad52('0x34')](_0x426106[_0xad52('0x33')],{'$or':_[_0xad52('0x26')](_0x3f5757,function(_0x253c86){if(_0x253c86[_0xad52('0x35')]!=='VIRTUAL'){var _0xb1ea93={};_0xb1ea93[_0x253c86['name']]={'$like':'%'+_0x231bbe[_0xad52('0x2a')][_0xad52('0x36')]+'%'};return _0xb1ea93;}})});}_0x426106=_[_0xad52('0x34')]({},_0x426106,_0x231bbe[_0xad52('0x37')]);var _0x1d5e8a={'where':_0x426106['where']};return db[_0xad52('0x27')][_0xad52('0x1a')](_0x1d5e8a)[_0xad52('0x38')](function(_0x47f02c){_0x534cc5[_0xad52('0x1a')]=_0x47f02c;if(_0x231bbe[_0xad52('0x2a')][_0xad52('0x39')]){_0x426106['include']=[{'all':!![]}];}return db[_0xad52('0x27')]['findAll'](_0x426106);})[_0xad52('0x38')](function(_0x355381){_0x534cc5[_0xad52('0x3a')]=_0x355381;return _0x534cc5;})[_0xad52('0x38')](respondWithFilteredResult(_0x503bd0,_0x426106))['catch'](handleError(_0x503bd0,null));};exports[_0xad52('0x3b')]=function(_0x134d54,_0x249724){var _0x2bd94a={'raw':!![],'where':{'id':_0x134d54[_0xad52('0x3c')]['id']}},_0x3886ec={};_0x3886ec[_0xad52('0x29')]=_[_0xad52('0x3d')](db['FreshdeskField'][_0xad52('0x28')]);_0x3886ec['query']=_[_0xad52('0x3d')](_0x134d54[_0xad52('0x2a')]);_0x3886ec[_0xad52('0x2b')]=_[_0xad52('0x2c')](_0x3886ec[_0xad52('0x29')],_0x3886ec[_0xad52('0x2a')]);_0x2bd94a[_0xad52('0x2d')]=_[_0xad52('0x2c')](_0x3886ec[_0xad52('0x29')],qs[_0xad52('0x2e')](_0x134d54[_0xad52('0x2a')][_0xad52('0x2e')]));_0x2bd94a[_0xad52('0x2d')]=_0x2bd94a[_0xad52('0x2d')][_0xad52('0x2f')]?_0x2bd94a[_0xad52('0x2d')]:_0x3886ec[_0xad52('0x29')];if(_0x134d54[_0xad52('0x2a')][_0xad52('0x39')]){_0x2bd94a[_0xad52('0x3e')]=[{'all':!![]}];}_0x2bd94a=_['merge']({},_0x2bd94a,_0x134d54[_0xad52('0x37')]);return db[_0xad52('0x27')][_0xad52('0x3f')](_0x2bd94a)['then'](handleEntityNotFound(_0x249724,null))[_0xad52('0x38')](respondWithResult(_0x249724,null))['catch'](handleError(_0x249724,null));};exports[_0xad52('0x40')]=function(_0x5bb02a,_0x4cf477){return db[_0xad52('0x27')][_0xad52('0x40')](_0x5bb02a[_0xad52('0x41')],{})[_0xad52('0x38')](respondWithResult(_0x4cf477,0xc9))['catch'](handleError(_0x4cf477,null));};exports['update']=function(_0x254416,_0x5dede4){if(_0x254416[_0xad52('0x41')]['id']){delete _0x254416['body']['id'];}return db[_0xad52('0x27')][_0xad52('0x3f')]({'where':{'id':_0x254416[_0xad52('0x3c')]['id']}})[_0xad52('0x38')](handleEntityNotFound(_0x5dede4,null))[_0xad52('0x38')](saveUpdates(_0x254416[_0xad52('0x41')],null))['then'](respondWithResult(_0x5dede4,null))[_0xad52('0x42')](handleError(_0x5dede4,null));};exports[_0xad52('0x21')]=function(_0x44c401,_0xb3a238){return db['FreshdeskField'][_0xad52('0x3f')]({'where':{'id':_0x44c401[_0xad52('0x3c')]['id']}})[_0xad52('0x38')](handleEntityNotFound(_0xb3a238,null))['then'](removeEntity(_0xb3a238,null))[_0xad52('0x42')](handleError(_0xb3a238,null));}; \ No newline at end of file +var _0x1152=['stack','name','index','map','FreshdeskField','rawAttributes','key','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','findAll','show','keys','include','merge','create','body','catch','update','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error'];(function(_0x13f4ac,_0x1d5447){var _0xbd7a0=function(_0x2d5abe){while(--_0x2d5abe){_0x13f4ac['push'](_0x13f4ac['shift']());}};_0xbd7a0(++_0x1d5447);}(_0x1152,0x182));var _0x2115=function(_0xf60cd0,_0x34bf81){_0xf60cd0=_0xf60cd0-0x0;var _0x32ad56=_0x1152[_0xf60cd0];return _0x32ad56;};'use strict';var emlformat=require(_0x2115('0x0'));var rimraf=require(_0x2115('0x1'));var zipdir=require(_0x2115('0x2'));var jsonpatch=require(_0x2115('0x3'));var rp=require(_0x2115('0x4'));var moment=require(_0x2115('0x5'));var BPromise=require(_0x2115('0x6'));var Mustache=require(_0x2115('0x7'));var util=require('util');var path=require(_0x2115('0x8'));var sox=require('sox');var csv=require(_0x2115('0x9'));var ejs=require(_0x2115('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(_0x2115('0xb'));var toCsv=require(_0x2115('0x9'));var querystring=require(_0x2115('0xc'));var Papa=require('papaparse');var Redis=require(_0x2115('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2115('0xe'));var hardwareService=require(_0x2115('0xf'));var logger=require(_0x2115('0x10'))('api');var utils=require(_0x2115('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x2115('0x12'));var db=require(_0x2115('0x13'))['db'];function respondWithStatusCode(_0x2bb885,_0x33d38b){_0x33d38b=_0x33d38b||0xcc;return function(_0x22475e){if(_0x22475e){return _0x2bb885['sendStatus'](_0x33d38b);}return _0x2bb885[_0x2115('0x14')](_0x33d38b)['end']();};}function respondWithResult(_0x3727a3,_0x38e406){_0x38e406=_0x38e406||0xc8;return function(_0x17028e){if(_0x17028e){return _0x3727a3[_0x2115('0x14')](_0x38e406)[_0x2115('0x15')](_0x17028e);}};}function respondWithFilteredResult(_0x113ce2,_0x350969){return function(_0x5e8f81){if(_0x5e8f81){var _0xdf3e24=typeof _0x350969[_0x2115('0x16')]===_0x2115('0x17')&&typeof _0x350969[_0x2115('0x18')]===_0x2115('0x17');var _0x1bdef9=_0x5e8f81[_0x2115('0x19')];var _0x77e2c6=_0xdf3e24?0x0:_0x350969['offset'];var _0x154f69=_0xdf3e24?_0x5e8f81[_0x2115('0x19')]:_0x350969[_0x2115('0x16')]+_0x350969['limit'];var _0x2dfb3c;if(_0x154f69>=_0x1bdef9){_0x154f69=_0x1bdef9;_0x2dfb3c=0xc8;}else{_0x2dfb3c=0xce;}_0x113ce2[_0x2115('0x14')](_0x2dfb3c);return _0x113ce2[_0x2115('0x1a')](_0x2115('0x1b'),_0x77e2c6+'-'+_0x154f69+'/'+_0x1bdef9)[_0x2115('0x15')](_0x5e8f81);}return null;};}function patchUpdates(_0xcc2d7b){return function(_0x21d079){try{jsonpatch[_0x2115('0x1c')](_0x21d079,_0xcc2d7b,!![]);}catch(_0x464af4){return BPromise[_0x2115('0x1d')](_0x464af4);}return _0x21d079[_0x2115('0x1e')]();};}function saveUpdates(_0x8b7304,_0x8e37c){return function(_0x13fde1){if(_0x13fde1){return _0x13fde1['update'](_0x8b7304)[_0x2115('0x1f')](function(_0x340c42){return _0x340c42;});}return null;};}function removeEntity(_0x40d19f,_0x4ac436){return function(_0x27c2f5){if(_0x27c2f5){return _0x27c2f5[_0x2115('0x20')]()['then'](function(){_0x40d19f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x201c94,_0x5e9d07){return function(_0x1a2ec3){if(!_0x1a2ec3){_0x201c94['sendStatus'](0x194);}return _0x1a2ec3;};}function handleError(_0x1283ec,_0x115800){_0x115800=_0x115800||0x1f4;return function(_0x1b7f47){logger[_0x2115('0x21')](_0x1b7f47[_0x2115('0x22')]);if(_0x1b7f47['name']){delete _0x1b7f47[_0x2115('0x23')];}_0x1283ec[_0x2115('0x14')](_0x115800)['send'](_0x1b7f47);};}exports[_0x2115('0x24')]=function(_0x33d81c,_0x26eff7){var _0x1262e7={},_0x59ca70={},_0x19c595={'count':0x0,'rows':[]};var _0x15229e=_[_0x2115('0x25')](db[_0x2115('0x26')][_0x2115('0x27')],function(_0x27969d){return{'name':_0x27969d['fieldName'],'type':_0x27969d['type'][_0x2115('0x28')]};});_0x59ca70[_0x2115('0x29')]=_[_0x2115('0x25')](_0x15229e,_0x2115('0x23'));_0x59ca70[_0x2115('0x2a')]=_['keys'](_0x33d81c[_0x2115('0x2a')]);_0x59ca70[_0x2115('0x2b')]=_[_0x2115('0x2c')](_0x59ca70['model'],_0x59ca70[_0x2115('0x2a')]);_0x1262e7['attributes']=_[_0x2115('0x2c')](_0x59ca70['model'],qs[_0x2115('0x2d')](_0x33d81c[_0x2115('0x2a')][_0x2115('0x2d')]));_0x1262e7['attributes']=_0x1262e7['attributes'][_0x2115('0x2e')]?_0x1262e7[_0x2115('0x2f')]:_0x59ca70['model'];if(!_0x33d81c[_0x2115('0x2a')][_0x2115('0x30')](_0x2115('0x31'))){_0x1262e7[_0x2115('0x18')]=qs['limit'](_0x33d81c[_0x2115('0x2a')][_0x2115('0x18')]);_0x1262e7[_0x2115('0x16')]=qs[_0x2115('0x16')](_0x33d81c['query'][_0x2115('0x16')]);}_0x1262e7[_0x2115('0x32')]=qs[_0x2115('0x33')](_0x33d81c[_0x2115('0x2a')][_0x2115('0x33')]);_0x1262e7[_0x2115('0x34')]=qs['filters'](_[_0x2115('0x35')](_0x33d81c[_0x2115('0x2a')],_0x59ca70[_0x2115('0x2b')]),_0x15229e);if(_0x33d81c[_0x2115('0x2a')][_0x2115('0x36')]){_0x1262e7[_0x2115('0x34')]=_['merge'](_0x1262e7[_0x2115('0x34')],{'$or':_['map'](_0x15229e,function(_0x59b531){if(_0x59b531[_0x2115('0x37')]!==_0x2115('0x38')){var _0x4572f3={};_0x4572f3[_0x59b531[_0x2115('0x23')]]={'$like':'%'+_0x33d81c[_0x2115('0x2a')][_0x2115('0x36')]+'%'};return _0x4572f3;}})});}_0x1262e7=_['merge']({},_0x1262e7,_0x33d81c[_0x2115('0x39')]);var _0x1c2508={'where':_0x1262e7[_0x2115('0x34')]};return db[_0x2115('0x26')][_0x2115('0x19')](_0x1c2508)[_0x2115('0x1f')](function(_0x1aa165){_0x19c595[_0x2115('0x19')]=_0x1aa165;if(_0x33d81c[_0x2115('0x2a')][_0x2115('0x3a')]){_0x1262e7['include']=[{'all':!![]}];}return db['FreshdeskField'][_0x2115('0x3b')](_0x1262e7);})['then'](function(_0xa652de){_0x19c595['rows']=_0xa652de;return _0x19c595;})['then'](respondWithFilteredResult(_0x26eff7,_0x1262e7))['catch'](handleError(_0x26eff7,null));};exports[_0x2115('0x3c')]=function(_0x40d5d6,_0x11b840){var _0x96847d={'raw':!![],'where':{'id':_0x40d5d6['params']['id']}},_0x16f022={};_0x16f022[_0x2115('0x29')]=_['keys'](db[_0x2115('0x26')][_0x2115('0x27')]);_0x16f022['query']=_[_0x2115('0x3d')](_0x40d5d6[_0x2115('0x2a')]);_0x16f022['filters']=_['intersection'](_0x16f022[_0x2115('0x29')],_0x16f022[_0x2115('0x2a')]);_0x96847d['attributes']=_['intersection'](_0x16f022[_0x2115('0x29')],qs[_0x2115('0x2d')](_0x40d5d6['query']['fields']));_0x96847d[_0x2115('0x2f')]=_0x96847d[_0x2115('0x2f')][_0x2115('0x2e')]?_0x96847d['attributes']:_0x16f022[_0x2115('0x29')];if(_0x40d5d6['query'][_0x2115('0x3a')]){_0x96847d[_0x2115('0x3e')]=[{'all':!![]}];}_0x96847d=_[_0x2115('0x3f')]({},_0x96847d,_0x40d5d6[_0x2115('0x39')]);return db[_0x2115('0x26')]['find'](_0x96847d)[_0x2115('0x1f')](handleEntityNotFound(_0x11b840,null))['then'](respondWithResult(_0x11b840,null))['catch'](handleError(_0x11b840,null));};exports[_0x2115('0x40')]=function(_0xa67937,_0x583575){return db[_0x2115('0x26')][_0x2115('0x40')](_0xa67937[_0x2115('0x41')],{})[_0x2115('0x1f')](respondWithResult(_0x583575,0xc9))[_0x2115('0x42')](handleError(_0x583575,null));};exports[_0x2115('0x43')]=function(_0x41d1a4,_0x347f16){if(_0x41d1a4[_0x2115('0x41')]['id']){delete _0x41d1a4['body']['id'];}return db[_0x2115('0x26')][_0x2115('0x44')]({'where':{'id':_0x41d1a4[_0x2115('0x45')]['id']}})['then'](handleEntityNotFound(_0x347f16,null))[_0x2115('0x1f')](saveUpdates(_0x41d1a4['body'],null))['then'](respondWithResult(_0x347f16,null))['catch'](handleError(_0x347f16,null));};exports[_0x2115('0x20')]=function(_0x24d601,_0x4820c7){return db['FreshdeskField'][_0x2115('0x44')]({'where':{'id':_0x24d601[_0x2115('0x45')]['id']}})[_0x2115('0x1f')](handleEntityNotFound(_0x4820c7,null))[_0x2115('0x1f')](removeEntity(_0x4820c7,null))[_0x2115('0x42')](handleError(_0x4820c7,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 139c488..9897bcc 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 _0xad13=['request-promise','path','../../config/environment','exports','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','bluebird'];(function(_0x5206b7,_0x5298df){var _0x246d0a=function(_0x4f05d0){while(--_0x4f05d0){_0x5206b7['push'](_0x5206b7['shift']());}};_0x246d0a(++_0x5298df);}(_0xad13,0x129));var _0x3ad1=function(_0x2361c5,_0x149033){_0x2361c5=_0x2361c5-0x0;var _0x4a09b4=_0xad13[_0x2361c5];return _0x4a09b4;};'use strict';var _=require(_0x3ad1('0x0'));var util=require(_0x3ad1('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x3ad1('0x2'));var rp=require(_0x3ad1('0x3'));var fs=require('fs');var path=require(_0x3ad1('0x4'));var rimraf=require('rimraf');var config=require(_0x3ad1('0x5'));var attributes=require('./intFreshdeskField.attributes');module[_0x3ad1('0x6')]=function(_0x1814a9,_0x3697b5){return _0x1814a9['define'](_0x3ad1('0x7'),attributes,{'tableName':_0x3ad1('0x8'),'paranoid':![],'indexes':[{'name':_0x3ad1('0x9'),'fields':[_0x3ad1('0xa'),_0x3ad1('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x21ca=['moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskField.attributes','FreshdeskField','freshdesk_unique_index','idField','FieldId','util','../../config/logger'];(function(_0x5917c4,_0x230db0){var _0x20305f=function(_0x5ca3c6){while(--_0x5ca3c6){_0x5917c4['push'](_0x5917c4['shift']());}};_0x20305f(++_0x230db0);}(_0x21ca,0x14e));var _0xa21c=function(_0x2c437c,_0x1da7d2){_0x2c437c=_0x2c437c-0x0;var _0x473e11=_0x21ca[_0x2c437c];return _0x473e11;};'use strict';var _=require('lodash');var util=require(_0xa21c('0x0'));var logger=require(_0xa21c('0x1'))('api');var moment=require(_0xa21c('0x2'));var BPromise=require(_0xa21c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa21c('0x4'));var rimraf=require(_0xa21c('0x5'));var config=require(_0xa21c('0x6'));var attributes=require(_0xa21c('0x7'));module['exports']=function(_0x29c9f5,_0x24efd2){return _0x29c9f5['define'](_0xa21c('0x8'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0xa21c('0x9'),'fields':[_0xa21c('0xa'),_0xa21c('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index c25713e..a21b30d 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 _0x97bc=['info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x55d851,_0x5d46ca){var _0x1ae525=function(_0xd1621){while(--_0xd1621){_0x55d851['push'](_0x55d851['shift']());}};_0x1ae525(++_0x5d46ca);}(_0x97bc,0x1ab));var _0xc97b=function(_0x4b0863,_0x35378a){_0x4b0863=_0x4b0863-0x0;var _0x4ceedb=_0x97bc[_0x4b0863];return _0x4ceedb;};'use strict';var _=require('lodash');var util=require(_0xc97b('0x0'));var moment=require(_0xc97b('0x1'));var BPromise=require(_0xc97b('0x2'));var rs=require(_0xc97b('0x3'));var fs=require('fs');var Redis=require(_0xc97b('0x4'));var db=require(_0xc97b('0x5'))['db'];var utils=require(_0xc97b('0x6'));var logger=require(_0xc97b('0x7'))(_0xc97b('0x8'));var config=require(_0xc97b('0x9'));var jayson=require(_0xc97b('0xa'));var client=jayson['client'][_0xc97b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40a0c5,_0x48149f,_0x4e42c4){return new BPromise(function(_0x14f943,_0x3e6c4a){return client['request'](_0x40a0c5,_0x4e42c4)[_0xc97b('0xc')](function(_0x46d9f8){logger[_0xc97b('0xd')](_0xc97b('0xe'),_0x48149f,_0xc97b('0xf'));logger[_0xc97b('0x10')](_0xc97b('0x11'),_0x48149f,_0xc97b('0xf'),JSON[_0xc97b('0x12')](_0x46d9f8));if(_0x46d9f8[_0xc97b('0x13')]){if(_0x46d9f8[_0xc97b('0x13')]['code']===0x1f4){logger[_0xc97b('0x13')](_0xc97b('0xe'),_0x48149f,_0x46d9f8[_0xc97b('0x13')][_0xc97b('0x14')]);return _0x3e6c4a(_0x46d9f8[_0xc97b('0x13')]['message']);}logger['error'](_0xc97b('0xe'),_0x48149f,_0x46d9f8[_0xc97b('0x13')]['message']);return _0x14f943(_0x46d9f8['error'][_0xc97b('0x14')]);}else{logger[_0xc97b('0xd')](_0xc97b('0xe'),_0x48149f,_0xc97b('0xf'));_0x14f943(_0x46d9f8['result']['message']);}})[_0xc97b('0x15')](function(_0xd0892a){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x48149f,_0xd0892a);_0x3e6c4a(_0xd0892a);});});} \ No newline at end of file +var _0xc41e=['code','message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x163042,_0x5a55d8){var _0x501243=function(_0x3ed0c4){while(--_0x3ed0c4){_0x163042['push'](_0x163042['shift']());}};_0x501243(++_0x5a55d8);}(_0xc41e,0x10e));var _0xec41=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xc41e[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xec41('0x0'));var util=require(_0xec41('0x1'));var moment=require(_0xec41('0x2'));var BPromise=require(_0xec41('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xec41('0x4'));var db=require(_0xec41('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xec41('0x6'));var config=require(_0xec41('0x7'));var jayson=require(_0xec41('0x8'));var client=jayson[_0xec41('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3318d2,_0x6a6189,_0x56f0e4){return new BPromise(function(_0xc08613,_0x20ecfa){return client['request'](_0x3318d2,_0x56f0e4)['then'](function(_0x51c5cb){logger['info'](_0xec41('0xa'),_0x6a6189,_0xec41('0xb'));logger[_0xec41('0xc')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x6a6189,_0xec41('0xb'),JSON[_0xec41('0xd')](_0x51c5cb));if(_0x51c5cb['error']){if(_0x51c5cb[_0xec41('0xe')][_0xec41('0xf')]===0x1f4){logger['error'](_0xec41('0xa'),_0x6a6189,_0x51c5cb[_0xec41('0xe')][_0xec41('0x10')]);return _0x20ecfa(_0x51c5cb[_0xec41('0xe')][_0xec41('0x10')]);}logger['error'](_0xec41('0xa'),_0x6a6189,_0x51c5cb['error'][_0xec41('0x10')]);return _0xc08613(_0x51c5cb['error'][_0xec41('0x10')]);}else{logger[_0xec41('0x11')](_0xec41('0xa'),_0x6a6189,_0xec41('0xb'));_0xc08613(_0x51c5cb['result'][_0xec41('0x10')]);}})[_0xec41('0x12')](function(_0x4be267){logger[_0xec41('0xe')](_0xec41('0xa'),_0x6a6189,_0x4be267);_0x20ecfa(_0x4be267);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index a1d13fd..ae01304 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 _0x9354=['addConfiguration','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0x3dc089,_0x5ccb0d){var _0x34d9d3=function(_0x4556bf){while(--_0x4556bf){_0x3dc089['push'](_0x3dc089['shift']());}};_0x34d9d3(++_0x5ccb0d);}(_0x9354,0x96));var _0x4935=function(_0x10b1bb,_0x2a5815){_0x10b1bb=_0x10b1bb-0x0;var _0x2d4e05=_0x9354[_0x10b1bb];return _0x2d4e05;};'use strict';var multer=require('multer');var util=require(_0x4935('0x0'));var path=require(_0x4935('0x1'));var timeout=require('connect-timeout');var express=require(_0x4935('0x2'));var router=express[_0x4935('0x3')]();var fs_extra=require(_0x4935('0x4'));var auth=require(_0x4935('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4935('0x6'));var controller=require(_0x4935('0x7'));router[_0x4935('0x8')]('/',auth[_0x4935('0x9')](),controller[_0x4935('0xa')]);router[_0x4935('0x8')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0xc')]);router['get'](_0x4935('0xd'),auth['isAuthenticated'](),controller[_0x4935('0xe')]);router[_0x4935('0x8')](_0x4935('0xf'),auth[_0x4935('0x9')](),controller[_0x4935('0x10')]);router[_0x4935('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4935('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x4935('0x12')]);router[_0x4935('0x13')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0x14')]);router[_0x4935('0x15')](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0x16')]);module[_0x4935('0x17')]=router; \ No newline at end of file +var _0x5c00=['isAuthenticated','index','show','getConfigurations','/:id/fields','getFields','create','/:id/configurations','addConfiguration','/:id','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x2b2bb4,_0x3f1ae5){var _0x47d066=function(_0x14b759){while(--_0x14b759){_0x2b2bb4['push'](_0x2b2bb4['shift']());}};_0x47d066(++_0x3f1ae5);}(_0x5c00,0x17e));var _0x05c0=function(_0x171fa7,_0x587eca){_0x171fa7=_0x171fa7-0x0;var _0xc894e1=_0x5c00[_0x171fa7];return _0xc894e1;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var fs_extra=require(_0x05c0('0x4'));var auth=require(_0x05c0('0x5'));var interaction=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var controller=require('./intFreshsalesAccount.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0x8')]('/:id/configurations',auth[_0x05c0('0x9')](),controller[_0x05c0('0xc')]);router[_0x05c0('0x8')](_0x05c0('0xd'),auth[_0x05c0('0x9')](),controller[_0x05c0('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x05c0('0xf')]);router['post'](_0x05c0('0x10'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x11')]);router['put'](_0x05c0('0x12'),auth['isAuthenticated'](),controller[_0x05c0('0x13')]);router[_0x05c0('0x14')](_0x05c0('0x12'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x15')]);module[_0x05c0('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 902573c..d499f86 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 _0x6a55=['STRING','sequelize'];(function(_0x3a4321,_0x8619c5){var _0x4c1c85=function(_0x22bd93){while(--_0x22bd93){_0x3a4321['push'](_0x3a4321['shift']());}};_0x4c1c85(++_0x8619c5);}(_0x6a55,0xdb));var _0x56a5=function(_0x5e2b34,_0x58385c){_0x5e2b34=_0x5e2b34-0x0;var _0x4859f9=_0x6a55[_0x5e2b34];return _0x4859f9;};'use strict';var Sequelize=require(_0x56a5('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x56a5('0x1')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x56a5('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x56a5('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x77e6=['STRING','username','sequelize','exports'];(function(_0x4b6830,_0x2bf6fb){var _0x239e4a=function(_0x364735){while(--_0x364735){_0x4b6830['push'](_0x4b6830['shift']());}};_0x239e4a(++_0x2bf6fb);}(_0x77e6,0x1a6));var _0x677e=function(_0xdf6a04,_0x21e8ad){_0xdf6a04=_0xdf6a04-0x0;var _0x446f53=_0x77e6[_0xdf6a04];return _0x446f53;};'use strict';var Sequelize=require(_0x677e('0x0'));module[_0x677e('0x1')]={'name':{'type':Sequelize[_0x677e('0x2')]},'description':{'type':Sequelize[_0x677e('0x2')]},'username':{'type':Sequelize[_0x677e('0x2')],'unique':_0x677e('0x3')},'apiKey':{'type':Sequelize[_0x677e('0x2')]},'remoteUri':{'type':Sequelize[_0x677e('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x677e('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 4455341..aa5955a 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 _0x4382=['json','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','length','nolimit','offset','order','sort','where','filter','merge','options','FreshsalesAccount','includeAll','include','findAll','rows','catch','fields','find','create','body','params','pick','getConfigurations','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshsalesConfiguration','FreshsalesField','getFields','remoteUri','apiKey','username','slice','substring','lastIndexOf','GET','format','%s%s','Token\x20token=','users','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','status'];(function(_0xe5d71c,_0x15509f){var _0x588175=function(_0x593a1f){while(--_0x593a1f){_0xe5d71c['push'](_0xe5d71c['shift']());}};_0x588175(++_0x15509f);}(_0x4382,0x113));var _0x2438=function(_0x1317d1,_0x14924c){_0x1317d1=_0x1317d1-0x0;var _0x2f2b2f=_0x4382[_0x1317d1];return _0x2f2b2f;};'use strict';var emlformat=require(_0x2438('0x0'));var rimraf=require(_0x2438('0x1'));var zipdir=require(_0x2438('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2438('0x3'));var moment=require(_0x2438('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2438('0x5'));var path=require(_0x2438('0x6'));var sox=require('sox');var csv=require(_0x2438('0x7'));var ejs=require(_0x2438('0x8'));var fs=require('fs');var fs_extra=require(_0x2438('0x9'));var _=require('lodash');var squel=require(_0x2438('0xa'));var crypto=require('crypto');var jsforce=require(_0x2438('0xb'));var deskjs=require(_0x2438('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2438('0xd'));var Redis=require(_0x2438('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2438('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2438('0x10'))(_0x2438('0x11'));var utils=require(_0x2438('0x12'));var config=require(_0x2438('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x2438('0x14'));function respondWithStatusCode(_0x5d0ba0,_0x312dfe){_0x312dfe=_0x312dfe||0xcc;return function(_0xfd666e){if(_0xfd666e){return _0x5d0ba0['sendStatus'](_0x312dfe);}return _0x5d0ba0[_0x2438('0x15')](_0x312dfe)['end']();};}function respondWithResult(_0x4af7c3,_0x9e6ee4){_0x9e6ee4=_0x9e6ee4||0xc8;return function(_0x29ce26){if(_0x29ce26){return _0x4af7c3[_0x2438('0x15')](_0x9e6ee4)[_0x2438('0x16')](_0x29ce26);}};}function respondWithFilteredResult(_0x24ff03,_0x47b7e3){return function(_0x5aed97){if(_0x5aed97){var _0xfaa1ca=typeof _0x47b7e3['offset']===_0x2438('0x17')&&typeof _0x47b7e3[_0x2438('0x18')]==='undefined';var _0x1aa988=_0x5aed97['count'];var _0x135298=_0xfaa1ca?0x0:_0x47b7e3['offset'];var _0x18401a=_0xfaa1ca?_0x5aed97[_0x2438('0x19')]:_0x47b7e3['offset']+_0x47b7e3[_0x2438('0x18')];var _0x32911f;if(_0x18401a>=_0x1aa988){_0x18401a=_0x1aa988;_0x32911f=0xc8;}else{_0x32911f=0xce;}_0x24ff03[_0x2438('0x15')](_0x32911f);return _0x24ff03[_0x2438('0x1a')](_0x2438('0x1b'),_0x135298+'-'+_0x18401a+'/'+_0x1aa988)['json'](_0x5aed97);}return null;};}function patchUpdates(_0x12a462){return function(_0x34f837){try{jsonpatch[_0x2438('0x1c')](_0x34f837,_0x12a462,!![]);}catch(_0x51a58e){return BPromise['reject'](_0x51a58e);}return _0x34f837[_0x2438('0x1d')]();};}function saveUpdates(_0x35979a,_0x322192){return function(_0x2e8fc7){if(_0x2e8fc7){return _0x2e8fc7[_0x2438('0x1e')](_0x35979a)[_0x2438('0x1f')](function(_0xca3455){return _0xca3455;});}return null;};}function removeEntity(_0x365953,_0x46892d){return function(_0x5ac297){if(_0x5ac297){return _0x5ac297[_0x2438('0x20')]()['then'](function(){_0x365953[_0x2438('0x15')](0xcc)[_0x2438('0x21')]();});}};}function handleEntityNotFound(_0x4e50ee,_0x3c987b){return function(_0x1348d2){if(!_0x1348d2){_0x4e50ee['sendStatus'](0x194);}return _0x1348d2;};}function handleError(_0x5aa709,_0x3edd10){_0x3edd10=_0x3edd10||0x1f4;return function(_0x320a8f){logger['error'](_0x320a8f[_0x2438('0x22')]);if(_0x320a8f[_0x2438('0x23')]){delete _0x320a8f[_0x2438('0x23')];}_0x5aa709[_0x2438('0x15')](_0x3edd10)[_0x2438('0x24')](_0x320a8f);};}exports[_0x2438('0x25')]=function(_0x5b500d,_0x2b2b10){var _0x33b96b={},_0x14c9c3={},_0x1f2865={'count':0x0,'rows':[]};var _0x1fccbd=_[_0x2438('0x26')](db['FreshsalesAccount'][_0x2438('0x27')],function(_0x4c7d1e){return{'name':_0x4c7d1e[_0x2438('0x28')],'type':_0x4c7d1e[_0x2438('0x29')][_0x2438('0x2a')]};});_0x14c9c3[_0x2438('0x2b')]=_[_0x2438('0x26')](_0x1fccbd,_0x2438('0x23'));_0x14c9c3['query']=_[_0x2438('0x2c')](_0x5b500d[_0x2438('0x2d')]);_0x14c9c3[_0x2438('0x2e')]=_['intersection'](_0x14c9c3[_0x2438('0x2b')],_0x14c9c3['query']);_0x33b96b[_0x2438('0x2f')]=_[_0x2438('0x30')](_0x14c9c3[_0x2438('0x2b')],qs['fields'](_0x5b500d[_0x2438('0x2d')]['fields']));_0x33b96b[_0x2438('0x2f')]=_0x33b96b[_0x2438('0x2f')][_0x2438('0x31')]?_0x33b96b[_0x2438('0x2f')]:_0x14c9c3[_0x2438('0x2b')];if(!_0x5b500d[_0x2438('0x2d')]['hasOwnProperty'](_0x2438('0x32'))){_0x33b96b[_0x2438('0x18')]=qs[_0x2438('0x18')](_0x5b500d[_0x2438('0x2d')][_0x2438('0x18')]);_0x33b96b[_0x2438('0x33')]=qs['offset'](_0x5b500d[_0x2438('0x2d')][_0x2438('0x33')]);}_0x33b96b[_0x2438('0x34')]=qs[_0x2438('0x35')](_0x5b500d['query'][_0x2438('0x35')]);_0x33b96b[_0x2438('0x36')]=qs[_0x2438('0x2e')](_['pick'](_0x5b500d[_0x2438('0x2d')],_0x14c9c3[_0x2438('0x2e')]),_0x1fccbd);if(_0x5b500d[_0x2438('0x2d')][_0x2438('0x37')]){_0x33b96b[_0x2438('0x36')]=_[_0x2438('0x38')](_0x33b96b[_0x2438('0x36')],{'$or':_['map'](_0x1fccbd,function(_0x4758e5){if(_0x4758e5[_0x2438('0x29')]!=='VIRTUAL'){var _0x238e7d={};_0x238e7d[_0x4758e5[_0x2438('0x23')]]={'$like':'%'+_0x5b500d[_0x2438('0x2d')]['filter']+'%'};return _0x238e7d;}})});}_0x33b96b=_[_0x2438('0x38')]({},_0x33b96b,_0x5b500d[_0x2438('0x39')]);var _0x5b3f3f={'where':_0x33b96b['where']};return db[_0x2438('0x3a')][_0x2438('0x19')](_0x5b3f3f)[_0x2438('0x1f')](function(_0x33950c){_0x1f2865[_0x2438('0x19')]=_0x33950c;if(_0x5b500d['query'][_0x2438('0x3b')]){_0x33b96b[_0x2438('0x3c')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0x2438('0x3d')](_0x33b96b);})[_0x2438('0x1f')](function(_0x19dbdb){_0x1f2865[_0x2438('0x3e')]=_0x19dbdb;return _0x1f2865;})[_0x2438('0x1f')](respondWithFilteredResult(_0x2b2b10,_0x33b96b))[_0x2438('0x3f')](handleError(_0x2b2b10,null));};exports['show']=function(_0x169e91,_0x1fa2e2){var _0x4334f8={'raw':![],'where':{'id':_0x169e91['params']['id']}},_0x45341d={};_0x45341d[_0x2438('0x2b')]=_[_0x2438('0x2c')](db[_0x2438('0x3a')][_0x2438('0x27')]);_0x45341d['query']=_[_0x2438('0x2c')](_0x169e91[_0x2438('0x2d')]);_0x45341d['filters']=_[_0x2438('0x30')](_0x45341d[_0x2438('0x2b')],_0x45341d[_0x2438('0x2d')]);_0x4334f8[_0x2438('0x2f')]=_[_0x2438('0x30')](_0x45341d[_0x2438('0x2b')],qs[_0x2438('0x40')](_0x169e91[_0x2438('0x2d')][_0x2438('0x40')]));_0x4334f8[_0x2438('0x2f')]=_0x4334f8[_0x2438('0x2f')]['length']?_0x4334f8[_0x2438('0x2f')]:_0x45341d[_0x2438('0x2b')];if(_0x169e91[_0x2438('0x2d')][_0x2438('0x3b')]){_0x4334f8['include']=[{'all':!![]}];}_0x4334f8=_[_0x2438('0x38')]({},_0x4334f8,_0x169e91[_0x2438('0x39')]);return db[_0x2438('0x3a')][_0x2438('0x41')](_0x4334f8)['then'](handleEntityNotFound(_0x1fa2e2,null))[_0x2438('0x1f')](respondWithResult(_0x1fa2e2,null))[_0x2438('0x3f')](handleError(_0x1fa2e2,null));};exports[_0x2438('0x42')]=function(_0x5ddeeb,_0x3c099f){return db['FreshsalesAccount'][_0x2438('0x42')](_0x5ddeeb[_0x2438('0x43')],{})[_0x2438('0x1f')](respondWithResult(_0x3c099f,0xc9))[_0x2438('0x3f')](handleError(_0x3c099f,null));};exports[_0x2438('0x1e')]=function(_0x3b1842,_0x4fe1d0){if(_0x3b1842[_0x2438('0x43')]['id']){delete _0x3b1842['body']['id'];}return db[_0x2438('0x3a')]['find']({'where':{'id':_0x3b1842[_0x2438('0x44')]['id']}})[_0x2438('0x1f')](handleEntityNotFound(_0x4fe1d0,null))['then'](saveUpdates(_0x3b1842[_0x2438('0x43')],null))[_0x2438('0x1f')](respondWithResult(_0x4fe1d0,null))[_0x2438('0x3f')](handleError(_0x4fe1d0,null));};exports[_0x2438('0x20')]=function(_0x1f8ff8,_0x1f269d){return db['FreshsalesAccount']['find']({'where':{'id':_0x1f8ff8[_0x2438('0x44')]['id']}})[_0x2438('0x1f')](handleEntityNotFound(_0x1f269d,null))[_0x2438('0x1f')](removeEntity(_0x1f269d,null))[_0x2438('0x3f')](handleError(_0x1f269d,null));};exports['getConfigurations']=function(_0x5eb23d,_0x2f52bc,_0x362059){var _0x171b97={};var _0x3fb02f={};var _0x3925d3;var _0x2787b1;return db[_0x2438('0x3a')]['findOne']({'where':{'id':_0x5eb23d['params']['id']}})[_0x2438('0x1f')](handleEntityNotFound(_0x2f52bc,null))[_0x2438('0x1f')](function(_0x27bdb4){if(_0x27bdb4){_0x3925d3=_0x27bdb4;_0x3fb02f[_0x2438('0x2b')]=_['keys'](db['FreshsalesConfiguration']['rawAttributes']);_0x3fb02f[_0x2438('0x2d')]=_[_0x2438('0x2c')](_0x5eb23d[_0x2438('0x2d')]);_0x3fb02f[_0x2438('0x2e')]=_['intersection'](_0x3fb02f['model'],_0x3fb02f[_0x2438('0x2d')]);_0x171b97['attributes']=_['intersection'](_0x3fb02f[_0x2438('0x2b')],qs[_0x2438('0x40')](_0x5eb23d[_0x2438('0x2d')][_0x2438('0x40')]));_0x171b97['attributes']=_0x171b97[_0x2438('0x2f')][_0x2438('0x31')]?_0x171b97['attributes']:_0x3fb02f['model'];_0x171b97[_0x2438('0x34')]=qs[_0x2438('0x35')](_0x5eb23d[_0x2438('0x2d')]['sort']);_0x171b97['where']=qs['filters'](_[_0x2438('0x45')](_0x5eb23d[_0x2438('0x2d')],_0x3fb02f[_0x2438('0x2e')]));if(_0x5eb23d[_0x2438('0x2d')][_0x2438('0x37')]){_0x171b97['where']=_[_0x2438('0x38')](_0x171b97[_0x2438('0x36')],{'$or':_[_0x2438('0x26')](_0x171b97[_0x2438('0x2f')],function(_0x22009b){var _0x2384e3={};_0x2384e3[_0x22009b]={'$like':'%'+_0x5eb23d[_0x2438('0x2d')][_0x2438('0x37')]+'%'};return _0x2384e3;})});}_0x171b97=_[_0x2438('0x38')]({},_0x171b97,_0x5eb23d[_0x2438('0x39')]);return _0x3925d3[_0x2438('0x46')](_0x171b97);}})[_0x2438('0x1f')](function(_0x452336){if(_0x452336){_0x2787b1=_0x452336['length'];if(!_0x5eb23d[_0x2438('0x2d')][_0x2438('0x47')](_0x2438('0x32'))){_0x171b97[_0x2438('0x18')]=qs[_0x2438('0x18')](_0x5eb23d[_0x2438('0x2d')][_0x2438('0x18')]);_0x171b97[_0x2438('0x33')]=qs[_0x2438('0x33')](_0x5eb23d[_0x2438('0x2d')]['offset']);}return _0x3925d3[_0x2438('0x46')](_0x171b97);}})['then'](function(_0x7f8549){if(_0x7f8549){return _0x7f8549?{'count':_0x2787b1,'rows':_0x7f8549}:null;}})['then'](respondWithResult(_0x2f52bc,null))[_0x2438('0x3f')](handleError(_0x2f52bc,null));};exports[_0x2438('0x48')]=function(_0x3f898d,_0xf21720,_0x4503d4){if(_0x3f898d[_0x2438('0x43')]['id']){delete _0x3f898d[_0x2438('0x43')]['id'];}return db[_0x2438('0x3a')][_0x2438('0x49')]({'where':{'id':_0x3f898d[_0x2438('0x44')]['id']}})[_0x2438('0x1f')](handleEntityNotFound(_0xf21720,null))[_0x2438('0x1f')](function(_0x55fc02){if(_0x55fc02){_0x3f898d['body'][_0x2438('0x4a')]=_0x55fc02['id'];_0x3f898d['body'][_0x2438('0x4b')]=integrations[_0x2438('0x4c')](_0x3f898d[_0x2438('0x43')]['channel'],_0x3f898d[_0x2438('0x43')][_0x2438('0x29')]);_0x3f898d['body'][_0x2438('0x4d')]=integrations[_0x2438('0x4e')](_0x3f898d[_0x2438('0x43')][_0x2438('0x4f')],_0x3f898d[_0x2438('0x43')]['type']);return db[_0x2438('0x50')]['create'](_0x3f898d[_0x2438('0x43')],{'include':[{'model':db[_0x2438('0x51')],'as':'Subjects'},{'model':db[_0x2438('0x51')],'as':_0x2438('0x4d')}]});}return null;})[_0x2438('0x1f')](respondWithResult(_0xf21720,null))[_0x2438('0x3f')](handleError(_0xf21720,null));};exports[_0x2438('0x52')]=function(_0x42bff1,_0x260aba,_0x26515f){var _0x424642='';var _0x1889c7='';return db[_0x2438('0x3a')][_0x2438('0x49')]({'where':{'id':_0x42bff1['params']['id']},'attributes':['id','username',_0x2438('0x53'),_0x2438('0x54')]})[_0x2438('0x1f')](handleEntityNotFound(_0x260aba,null))[_0x2438('0x1f')](function(_0x32381b){if(_0x32381b){_0x1889c7=_0x32381b[_0x2438('0x55')];_0x424642=_0x32381b['remoteUri'];var _0xc4fa7d=_0x32381b[_0x2438('0x53')][_0x2438('0x56')](-0x1);if(_0xc4fa7d==='/'){_0x424642=_0x424642[_0x2438('0x57')](0x0,_0x424642[_0x2438('0x58')](_0xc4fa7d));}return rp({'method':_0x2438('0x59'),'uri':util[_0x2438('0x5a')](_0x2438('0x5b'),_0x424642,'/api/selector/owners'),'headers':{'Authorization':_0x2438('0x5c')+_0x32381b[_0x2438('0x54')]},'json':!![]});}})[_0x2438('0x1f')](function(_0x285c83){if(_0x285c83){var _0x2c2cc9=_0x285c83[_0x2438('0x5d')];var _0x306be1=![];var _0x3cdb90=null;for(_0x3cdb90=0x0;_0x3cdb90<_0x2c2cc9[_0x2438('0x31')];_0x3cdb90++){if(_0x2c2cc9[_0x3cdb90]['email']===_0x1889c7){_0x306be1=!![];}}if(_0x306be1){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})['then'](respondWithResult(_0x260aba,null))[_0x2438('0x3f')](function(_0x10a7bf){var _0x19dd98=_0x42bff1[_0x2438('0x2d')][_0x2438('0x5e')]?0x1f4:_0x10a7bf[_0x2438('0x5f')]||0x1f4;logger[_0x2438('0x60')](_0x2438('0x61'),_0x2438('0x52'),_0x19dd98,JSON[_0x2438('0x62')](_0x10a7bf));delete _0x10a7bf[_0x2438('0x23')];if(_0x19dd98===0x191){_0x19dd98=0x190;}_0x260aba[_0x2438('0x15')](_0x19dd98)[_0x2438('0x24')](_0x42bff1['query'][_0x2438('0x5e')]?{'message':'Wrong\x20credentials','statusCode':_0x10a7bf[_0x2438('0x5f')]}:_0x10a7bf);});}; \ No newline at end of file +var _0xc93b=['sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','error','name','index','map','FreshsalesAccount','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','destroy','FreshsalesConfiguration','pick','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','email','Requested\x20Resource\x20not\x20Found','test','stringify','send','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x319b16,_0x481408){var _0x453d37=function(_0x5e31f0){while(--_0x5e31f0){_0x319b16['push'](_0x319b16['shift']());}};_0x453d37(++_0x481408);}(_0xc93b,0xbf));var _0xbc93=function(_0x178ca4,_0x5aaa16){_0x178ca4=_0x178ca4-0x0;var _0x57f6a8=_0xc93b[_0x178ca4];return _0x57f6a8;};'use strict';var emlformat=require(_0xbc93('0x0'));var rimraf=require(_0xbc93('0x1'));var zipdir=require(_0xbc93('0x2'));var jsonpatch=require(_0xbc93('0x3'));var rp=require(_0xbc93('0x4'));var moment=require(_0xbc93('0x5'));var BPromise=require(_0xbc93('0x6'));var Mustache=require('mustache');var util=require(_0xbc93('0x7'));var path=require(_0xbc93('0x8'));var sox=require(_0xbc93('0x9'));var csv=require('to-csv');var ejs=require(_0xbc93('0xa'));var fs=require('fs');var fs_extra=require(_0xbc93('0xb'));var _=require(_0xbc93('0xc'));var squel=require('squel');var crypto=require(_0xbc93('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbc93('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbc93('0xf'));var Papa=require('papaparse');var Redis=require(_0xbc93('0x10'));var authService=require(_0xbc93('0x11'));var qs=require(_0xbc93('0x12'));var as=require(_0xbc93('0x13'));var hardwareService=require(_0xbc93('0x14'));var logger=require('../../config/logger')(_0xbc93('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbc93('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbc93('0x17'));function respondWithStatusCode(_0x457b0d,_0x2d3ccd){_0x2d3ccd=_0x2d3ccd||0xcc;return function(_0x3ace18){if(_0x3ace18){return _0x457b0d['sendStatus'](_0x2d3ccd);}return _0x457b0d[_0xbc93('0x18')](_0x2d3ccd)[_0xbc93('0x19')]();};}function respondWithResult(_0x5a204a,_0x2002f4){_0x2002f4=_0x2002f4||0xc8;return function(_0x39bf7d){if(_0x39bf7d){return _0x5a204a[_0xbc93('0x18')](_0x2002f4)[_0xbc93('0x1a')](_0x39bf7d);}};}function respondWithFilteredResult(_0x2c10a1,_0x551363){return function(_0x177710){if(_0x177710){var _0x2db3fe=typeof _0x551363[_0xbc93('0x1b')]==='undefined'&&typeof _0x551363[_0xbc93('0x1c')]===_0xbc93('0x1d');var _0x37e7d5=_0x177710[_0xbc93('0x1e')];var _0x208269=_0x2db3fe?0x0:_0x551363[_0xbc93('0x1b')];var _0x4e53b2=_0x2db3fe?_0x177710[_0xbc93('0x1e')]:_0x551363['offset']+_0x551363[_0xbc93('0x1c')];var _0x13e66d;if(_0x4e53b2>=_0x37e7d5){_0x4e53b2=_0x37e7d5;_0x13e66d=0xc8;}else{_0x13e66d=0xce;}_0x2c10a1['status'](_0x13e66d);return _0x2c10a1[_0xbc93('0x1f')](_0xbc93('0x20'),_0x208269+'-'+_0x4e53b2+'/'+_0x37e7d5)[_0xbc93('0x1a')](_0x177710);}return null;};}function patchUpdates(_0x538128){return function(_0x486002){try{jsonpatch['apply'](_0x486002,_0x538128,!![]);}catch(_0x527095){return BPromise[_0xbc93('0x21')](_0x527095);}return _0x486002['save']();};}function saveUpdates(_0x485a1f,_0x411167){return function(_0x32bb89){if(_0x32bb89){return _0x32bb89[_0xbc93('0x22')](_0x485a1f)[_0xbc93('0x23')](function(_0x9e455f){return _0x9e455f;});}return null;};}function removeEntity(_0x14151b,_0x10e644){return function(_0xc90ada){if(_0xc90ada){return _0xc90ada['destroy']()[_0xbc93('0x23')](function(){_0x14151b[_0xbc93('0x18')](0xcc)[_0xbc93('0x19')]();});}};}function handleEntityNotFound(_0x16e6eb,_0x3e41f1){return function(_0x166ecb){if(!_0x166ecb){_0x16e6eb['sendStatus'](0x194);}return _0x166ecb;};}function handleError(_0x210142,_0x1c379d){_0x1c379d=_0x1c379d||0x1f4;return function(_0x1854aa){logger[_0xbc93('0x24')](_0x1854aa['stack']);if(_0x1854aa[_0xbc93('0x25')]){delete _0x1854aa[_0xbc93('0x25')];}_0x210142[_0xbc93('0x18')](_0x1c379d)['send'](_0x1854aa);};}exports[_0xbc93('0x26')]=function(_0x57cd89,_0x59027f){var _0x56b40c={},_0x211e4b={},_0xa12852={'count':0x0,'rows':[]};var _0x5c056e=_[_0xbc93('0x27')](db[_0xbc93('0x28')][_0xbc93('0x29')],function(_0x57474b){return{'name':_0x57474b[_0xbc93('0x2a')],'type':_0x57474b[_0xbc93('0x2b')]['key']};});_0x211e4b[_0xbc93('0x2c')]=_[_0xbc93('0x27')](_0x5c056e,_0xbc93('0x25'));_0x211e4b['query']=_[_0xbc93('0x2d')](_0x57cd89['query']);_0x211e4b[_0xbc93('0x2e')]=_[_0xbc93('0x2f')](_0x211e4b[_0xbc93('0x2c')],_0x211e4b[_0xbc93('0x30')]);_0x56b40c[_0xbc93('0x31')]=_[_0xbc93('0x2f')](_0x211e4b[_0xbc93('0x2c')],qs[_0xbc93('0x32')](_0x57cd89[_0xbc93('0x30')][_0xbc93('0x32')]));_0x56b40c['attributes']=_0x56b40c[_0xbc93('0x31')][_0xbc93('0x33')]?_0x56b40c[_0xbc93('0x31')]:_0x211e4b['model'];if(!_0x57cd89[_0xbc93('0x30')][_0xbc93('0x34')](_0xbc93('0x35'))){_0x56b40c['limit']=qs[_0xbc93('0x1c')](_0x57cd89['query']['limit']);_0x56b40c[_0xbc93('0x1b')]=qs[_0xbc93('0x1b')](_0x57cd89[_0xbc93('0x30')][_0xbc93('0x1b')]);}_0x56b40c['order']=qs[_0xbc93('0x36')](_0x57cd89[_0xbc93('0x30')][_0xbc93('0x36')]);_0x56b40c['where']=qs[_0xbc93('0x2e')](_['pick'](_0x57cd89[_0xbc93('0x30')],_0x211e4b[_0xbc93('0x2e')]),_0x5c056e);if(_0x57cd89[_0xbc93('0x30')][_0xbc93('0x37')]){_0x56b40c[_0xbc93('0x38')]=_[_0xbc93('0x39')](_0x56b40c[_0xbc93('0x38')],{'$or':_[_0xbc93('0x27')](_0x5c056e,function(_0x3c4d7e){if(_0x3c4d7e[_0xbc93('0x2b')]!=='VIRTUAL'){var _0xda68d7={};_0xda68d7[_0x3c4d7e[_0xbc93('0x25')]]={'$like':'%'+_0x57cd89[_0xbc93('0x30')][_0xbc93('0x37')]+'%'};return _0xda68d7;}})});}_0x56b40c=_[_0xbc93('0x39')]({},_0x56b40c,_0x57cd89[_0xbc93('0x3a')]);var _0x1e1cd5={'where':_0x56b40c[_0xbc93('0x38')]};return db[_0xbc93('0x28')]['count'](_0x1e1cd5)[_0xbc93('0x23')](function(_0x171dcb){_0xa12852[_0xbc93('0x1e')]=_0x171dcb;if(_0x57cd89[_0xbc93('0x30')][_0xbc93('0x3b')]){_0x56b40c['include']=[{'all':!![]}];}return db[_0xbc93('0x28')][_0xbc93('0x3c')](_0x56b40c);})[_0xbc93('0x23')](function(_0x5725b3){_0xa12852[_0xbc93('0x3d')]=_0x5725b3;return _0xa12852;})[_0xbc93('0x23')](respondWithFilteredResult(_0x59027f,_0x56b40c))[_0xbc93('0x3e')](handleError(_0x59027f,null));};exports[_0xbc93('0x3f')]=function(_0x12b8a2,_0x126d3f){var _0x53d662={'raw':![],'where':{'id':_0x12b8a2['params']['id']}},_0x5d77da={};_0x5d77da[_0xbc93('0x2c')]=_[_0xbc93('0x2d')](db[_0xbc93('0x28')][_0xbc93('0x29')]);_0x5d77da[_0xbc93('0x30')]=_[_0xbc93('0x2d')](_0x12b8a2[_0xbc93('0x30')]);_0x5d77da[_0xbc93('0x2e')]=_[_0xbc93('0x2f')](_0x5d77da[_0xbc93('0x2c')],_0x5d77da[_0xbc93('0x30')]);_0x53d662[_0xbc93('0x31')]=_[_0xbc93('0x2f')](_0x5d77da['model'],qs['fields'](_0x12b8a2[_0xbc93('0x30')][_0xbc93('0x32')]));_0x53d662[_0xbc93('0x31')]=_0x53d662[_0xbc93('0x31')][_0xbc93('0x33')]?_0x53d662['attributes']:_0x5d77da[_0xbc93('0x2c')];if(_0x12b8a2[_0xbc93('0x30')][_0xbc93('0x3b')]){_0x53d662[_0xbc93('0x40')]=[{'all':!![]}];}_0x53d662=_[_0xbc93('0x39')]({},_0x53d662,_0x12b8a2[_0xbc93('0x3a')]);return db[_0xbc93('0x28')][_0xbc93('0x41')](_0x53d662)[_0xbc93('0x23')](handleEntityNotFound(_0x126d3f,null))[_0xbc93('0x23')](respondWithResult(_0x126d3f,null))[_0xbc93('0x3e')](handleError(_0x126d3f,null));};exports['create']=function(_0xe8d75e,_0x1b24ed){return db['FreshsalesAccount'][_0xbc93('0x42')](_0xe8d75e[_0xbc93('0x43')],{})['then'](respondWithResult(_0x1b24ed,0xc9))['catch'](handleError(_0x1b24ed,null));};exports[_0xbc93('0x22')]=function(_0x312740,_0x32b2bc){if(_0x312740[_0xbc93('0x43')]['id']){delete _0x312740['body']['id'];}return db[_0xbc93('0x28')][_0xbc93('0x41')]({'where':{'id':_0x312740[_0xbc93('0x44')]['id']}})[_0xbc93('0x23')](handleEntityNotFound(_0x32b2bc,null))[_0xbc93('0x23')](saveUpdates(_0x312740[_0xbc93('0x43')],null))[_0xbc93('0x23')](respondWithResult(_0x32b2bc,null))[_0xbc93('0x3e')](handleError(_0x32b2bc,null));};exports[_0xbc93('0x45')]=function(_0x3f755f,_0xb5ecfc){return db['FreshsalesAccount'][_0xbc93('0x41')]({'where':{'id':_0x3f755f[_0xbc93('0x44')]['id']}})['then'](handleEntityNotFound(_0xb5ecfc,null))[_0xbc93('0x23')](removeEntity(_0xb5ecfc,null))[_0xbc93('0x3e')](handleError(_0xb5ecfc,null));};exports['getConfigurations']=function(_0x39ad5f,_0x4daeee,_0x5ea963){var _0x4d5aea={};var _0x2ab83b={};var _0xab2418;var _0x49c6f4;return db[_0xbc93('0x28')]['findOne']({'where':{'id':_0x39ad5f['params']['id']}})['then'](handleEntityNotFound(_0x4daeee,null))[_0xbc93('0x23')](function(_0x230a6d){if(_0x230a6d){_0xab2418=_0x230a6d;_0x2ab83b['model']=_['keys'](db[_0xbc93('0x46')][_0xbc93('0x29')]);_0x2ab83b[_0xbc93('0x30')]=_['keys'](_0x39ad5f[_0xbc93('0x30')]);_0x2ab83b[_0xbc93('0x2e')]=_[_0xbc93('0x2f')](_0x2ab83b[_0xbc93('0x2c')],_0x2ab83b['query']);_0x4d5aea[_0xbc93('0x31')]=_[_0xbc93('0x2f')](_0x2ab83b[_0xbc93('0x2c')],qs['fields'](_0x39ad5f[_0xbc93('0x30')][_0xbc93('0x32')]));_0x4d5aea[_0xbc93('0x31')]=_0x4d5aea[_0xbc93('0x31')][_0xbc93('0x33')]?_0x4d5aea['attributes']:_0x2ab83b['model'];_0x4d5aea['order']=qs[_0xbc93('0x36')](_0x39ad5f[_0xbc93('0x30')]['sort']);_0x4d5aea['where']=qs[_0xbc93('0x2e')](_[_0xbc93('0x47')](_0x39ad5f[_0xbc93('0x30')],_0x2ab83b[_0xbc93('0x2e')]));if(_0x39ad5f[_0xbc93('0x30')]['filter']){_0x4d5aea['where']=_[_0xbc93('0x39')](_0x4d5aea[_0xbc93('0x38')],{'$or':_['map'](_0x4d5aea['attributes'],function(_0x351b26){var _0x2c1f10={};_0x2c1f10[_0x351b26]={'$like':'%'+_0x39ad5f[_0xbc93('0x30')][_0xbc93('0x37')]+'%'};return _0x2c1f10;})});}_0x4d5aea=_[_0xbc93('0x39')]({},_0x4d5aea,_0x39ad5f[_0xbc93('0x3a')]);return _0xab2418[_0xbc93('0x48')](_0x4d5aea);}})[_0xbc93('0x23')](function(_0x2a0311){if(_0x2a0311){_0x49c6f4=_0x2a0311[_0xbc93('0x33')];if(!_0x39ad5f[_0xbc93('0x30')][_0xbc93('0x34')](_0xbc93('0x35'))){_0x4d5aea[_0xbc93('0x1c')]=qs['limit'](_0x39ad5f['query'][_0xbc93('0x1c')]);_0x4d5aea[_0xbc93('0x1b')]=qs[_0xbc93('0x1b')](_0x39ad5f[_0xbc93('0x30')]['offset']);}return _0xab2418['getConfigurations'](_0x4d5aea);}})[_0xbc93('0x23')](function(_0x42df92){if(_0x42df92){return _0x42df92?{'count':_0x49c6f4,'rows':_0x42df92}:null;}})[_0xbc93('0x23')](respondWithResult(_0x4daeee,null))['catch'](handleError(_0x4daeee,null));};exports[_0xbc93('0x49')]=function(_0x5dc269,_0xf18bce,_0x50d7a5){if(_0x5dc269[_0xbc93('0x43')]['id']){delete _0x5dc269[_0xbc93('0x43')]['id'];}return db[_0xbc93('0x28')][_0xbc93('0x4a')]({'where':{'id':_0x5dc269[_0xbc93('0x44')]['id']}})[_0xbc93('0x23')](handleEntityNotFound(_0xf18bce,null))[_0xbc93('0x23')](function(_0x39e2d0){if(_0x39e2d0){_0x5dc269['body'][_0xbc93('0x4b')]=_0x39e2d0['id'];_0x5dc269[_0xbc93('0x43')][_0xbc93('0x4c')]=integrations[_0xbc93('0x4d')](_0x5dc269['body'][_0xbc93('0x4e')],_0x5dc269[_0xbc93('0x43')][_0xbc93('0x2b')]);_0x5dc269['body'][_0xbc93('0x4f')]=integrations[_0xbc93('0x50')](_0x5dc269[_0xbc93('0x43')][_0xbc93('0x4e')],_0x5dc269[_0xbc93('0x43')]['type']);return db[_0xbc93('0x46')][_0xbc93('0x42')](_0x5dc269[_0xbc93('0x43')],{'include':[{'model':db[_0xbc93('0x51')],'as':_0xbc93('0x4c')},{'model':db[_0xbc93('0x51')],'as':_0xbc93('0x4f')}]});}return null;})[_0xbc93('0x23')](respondWithResult(_0xf18bce,null))['catch'](handleError(_0xf18bce,null));};exports[_0xbc93('0x52')]=function(_0x4b8e2a,_0x2cd117,_0x102775){var _0x4d7f5a='';var _0x2309e8='';return db[_0xbc93('0x28')]['findOne']({'where':{'id':_0x4b8e2a[_0xbc93('0x44')]['id']},'attributes':['id',_0xbc93('0x53'),_0xbc93('0x54'),_0xbc93('0x55')]})[_0xbc93('0x23')](handleEntityNotFound(_0x2cd117,null))[_0xbc93('0x23')](function(_0x38961c){if(_0x38961c){_0x2309e8=_0x38961c[_0xbc93('0x53')];_0x4d7f5a=_0x38961c[_0xbc93('0x54')];var _0x1091a4=_0x38961c['remoteUri'][_0xbc93('0x56')](-0x1);if(_0x1091a4==='/'){_0x4d7f5a=_0x4d7f5a[_0xbc93('0x57')](0x0,_0x4d7f5a[_0xbc93('0x58')](_0x1091a4));}return rp({'method':_0xbc93('0x59'),'uri':util[_0xbc93('0x5a')](_0xbc93('0x5b'),_0x4d7f5a,_0xbc93('0x5c')),'headers':{'Authorization':'Token\x20token='+_0x38961c[_0xbc93('0x55')]},'json':!![]});}})[_0xbc93('0x23')](function(_0x17d5a5){if(_0x17d5a5){var _0x2b4a76=_0x17d5a5['users'];var _0x42a89f=![];var _0x2e8219=null;for(_0x2e8219=0x0;_0x2e8219<_0x2b4a76[_0xbc93('0x33')];_0x2e8219++){if(_0x2b4a76[_0x2e8219][_0xbc93('0x5d')]===_0x2309e8){_0x42a89f=!![];}}if(_0x42a89f){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xbc93('0x5e')});}}})[_0xbc93('0x23')](respondWithResult(_0x2cd117,null))['catch'](function(_0x5a6b78){var _0x2489cc=_0x4b8e2a[_0xbc93('0x30')][_0xbc93('0x5f')]?0x1f4:_0x5a6b78['statusCode']||0x1f4;logger[_0xbc93('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0xbc93('0x52'),_0x2489cc,JSON[_0xbc93('0x60')](_0x5a6b78));delete _0x5a6b78[_0xbc93('0x25')];if(_0x2489cc===0x191){_0x2489cc=0x190;}_0x2cd117['status'](_0x2489cc)[_0xbc93('0x61')](_0x4b8e2a[_0xbc93('0x30')][_0xbc93('0x5f')]?{'message':_0xbc93('0x62'),'statusCode':_0x5a6b78[_0xbc93('0x63')]}:_0x5a6b78);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 750d080..9350743 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 _0x7b84=['../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesAccount.attributes'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x7b84,0x17c));var _0x47b8=function(_0x2c53bd,_0x1b5103){_0x2c53bd=_0x2c53bd-0x0;var _0x4752ed=_0x7b84[_0x2c53bd];return _0x4752ed;};'use strict';var _=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var logger=require(_0x47b8('0x2'))(_0x47b8('0x3'));var moment=require(_0x47b8('0x4'));var BPromise=require(_0x47b8('0x5'));var rp=require(_0x47b8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x47b8('0x7'));var config=require(_0x47b8('0x8'));var attributes=require(_0x47b8('0x9'));var integrations=require(_0x47b8('0xa'));module[_0x47b8('0xb')]=function(_0xafe88a,_0x53e656){return _0xafe88a[_0x47b8('0xc')](_0x47b8('0xd'),attributes,{'tableName':_0x47b8('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2272=['request-promise','path','rimraf','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x5ce2ba,_0x279e2e){var _0x6bf5b5=function(_0x373df6){while(--_0x373df6){_0x5ce2ba['push'](_0x5ce2ba['shift']());}};_0x6bf5b5(++_0x279e2e);}(_0x2272,0xd8));var _0x2227=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2272[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var logger=require(_0x2227('0x2'))(_0x2227('0x3'));var moment=require(_0x2227('0x4'));var BPromise=require('bluebird');var rp=require(_0x2227('0x5'));var fs=require('fs');var path=require(_0x2227('0x6'));var rimraf=require(_0x2227('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x2227('0x8'));module[_0x2227('0x9')]=function(_0xb33647,_0x2591db){return _0xb33647[_0x2227('0xa')](_0x2227('0xb'),attributes,{'tableName':_0x2227('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index c6bac60..34bf249 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 _0x0598=['map','model','then','ShowFreshsalesAccount','find','where','lodash','util','bluebird','../../mysqldb','../../config/utils','jayson/promise','client','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','attributes','limit','include'];(function(_0xc8e8be,_0x3cc764){var _0x4b0910=function(_0xe884c6){while(--_0xe884c6){_0xc8e8be['push'](_0xc8e8be['shift']());}};_0x4b0910(++_0x3cc764);}(_0x0598,0x92));var _0x8059=function(_0x542b42,_0x48f96c){_0x542b42=_0x542b42-0x0;var _0x4e400c=_0x0598[_0x542b42];return _0x4e400c;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var moment=require('moment');var BPromise=require(_0x8059('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8059('0x3'))['db'];var utils=require(_0x8059('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8059('0x5'));var client=jayson[_0x8059('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5996d7,_0x248273,_0x347f1b){return new BPromise(function(_0x4610d2,_0x116946){return client['request'](_0x5996d7,_0x347f1b)['then'](function(_0x89dda1){logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,_0x8059('0x9'));logger[_0x8059('0xa')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x248273,'request\x20sent',JSON[_0x8059('0xb')](_0x89dda1));if(_0x89dda1[_0x8059('0xc')]){if(_0x89dda1['error']['code']===0x1f4){logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);return _0x116946(_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);}logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1['error'][_0x8059('0xd')]);return _0x4610d2(_0x89dda1['error'][_0x8059('0xd')]);}else{logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,'request\x20sent');_0x4610d2(_0x89dda1['result']['message']);}})[_0x8059('0xe')](function(_0x239195){logger[_0x8059('0xc')](_0x8059('0x8'),_0x248273,_0x239195);_0x116946(_0x239195);});});}exports[_0x8059('0xf')]=function(_0x4b6d55){var _0x10ad98=this;return new Promise(function(_0x2bb670,_0x37e926){return db[_0x8059('0x10')]['findAll']({'raw':_0x4b6d55[_0x8059('0x11')]?_0x4b6d55['options'][_0x8059('0x12')]===undefined?!![]:![]:!![],'where':_0x4b6d55['options']?_0x4b6d55[_0x8059('0x11')]['where']||null:null,'attributes':_0x4b6d55[_0x8059('0x11')]?_0x4b6d55[_0x8059('0x11')][_0x8059('0x13')]||null:null,'limit':_0x4b6d55['options']?_0x4b6d55['options'][_0x8059('0x14')]||null:null,'include':_0x4b6d55[_0x8059('0x11')]?_0x4b6d55[_0x8059('0x11')][_0x8059('0x15')]?_['map'](_0x4b6d55[_0x8059('0x11')][_0x8059('0x15')],function(_0x3da080){return{'model':db[_0x3da080['model']],'as':_0x3da080['as'],'attributes':_0x3da080[_0x8059('0x13')],'include':_0x3da080[_0x8059('0x15')]?_[_0x8059('0x16')](_0x3da080[_0x8059('0x15')],function(_0x59d3a6){return{'model':db[_0x59d3a6[_0x8059('0x17')]],'as':_0x59d3a6['as'],'attributes':_0x59d3a6[_0x8059('0x13')],'include':_0x59d3a6[_0x8059('0x15')]?_[_0x8059('0x16')](_0x59d3a6[_0x8059('0x15')],function(_0x54b88b){return{'model':db[_0x54b88b[_0x8059('0x17')]],'as':_0x54b88b['as'],'attributes':_0x54b88b[_0x8059('0x13')]};}):[]};}):[]};}):[]:[]})[_0x8059('0x18')](function(_0x4a294f){logger['info']('GetFreshsalesAccount',_0x4b6d55);logger[_0x8059('0xa')](_0x8059('0xf'),_0x4b6d55,JSON[_0x8059('0xb')](_0x4a294f));_0x2bb670(_0x4a294f);})[_0x8059('0xe')](function(_0x59abe9){logger[_0x8059('0xc')]('GetFreshsalesAccount',_0x59abe9[_0x8059('0xd')],_0x4b6d55);_0x37e926(_0x10ad98[_0x8059('0xc')](0x1f4,_0x59abe9['message']));});});};exports[_0x8059('0x19')]=function(_0x1aead2){var _0x30aac2=this;return new Promise(function(_0x260ba8,_0x2799b7){return db[_0x8059('0x10')][_0x8059('0x1a')]({'raw':_0x1aead2[_0x8059('0x11')]?_0x1aead2['options'][_0x8059('0x12')]===undefined?!![]:![]:!![],'where':_0x1aead2[_0x8059('0x11')]?_0x1aead2[_0x8059('0x11')][_0x8059('0x1b')]||null:null,'attributes':_0x1aead2[_0x8059('0x11')]?_0x1aead2['options'][_0x8059('0x13')]||null:null,'include':_0x1aead2[_0x8059('0x11')]?_0x1aead2[_0x8059('0x11')][_0x8059('0x15')]?_[_0x8059('0x16')](_0x1aead2[_0x8059('0x11')][_0x8059('0x15')],function(_0x175d57){return{'model':db[_0x175d57[_0x8059('0x17')]],'as':_0x175d57['as'],'attributes':_0x175d57[_0x8059('0x13')],'include':_0x175d57['include']?_[_0x8059('0x16')](_0x175d57['include'],function(_0x24194d){return{'model':db[_0x24194d['model']],'as':_0x24194d['as'],'attributes':_0x24194d['attributes'],'include':_0x24194d[_0x8059('0x15')]?_['map'](_0x24194d[_0x8059('0x15')],function(_0x50c745){return{'model':db[_0x50c745[_0x8059('0x17')]],'as':_0x50c745['as'],'attributes':_0x50c745['attributes']};}):[]};}):[]};}):[]:[]})[_0x8059('0x18')](function(_0x5c4aa0){logger['info'](_0x8059('0x19'),_0x1aead2);logger[_0x8059('0xa')](_0x8059('0x19'),_0x1aead2,JSON['stringify'](_0x5c4aa0));_0x260ba8(_0x5c4aa0);})[_0x8059('0xe')](function(_0x4927c9){logger[_0x8059('0xc')]('ShowFreshsalesAccount',_0x4927c9[_0x8059('0xd')],_0x1aead2);_0x2799b7(_0x30aac2[_0x8059('0xc')](0x1f4,_0x4927c9[_0x8059('0xd')]));});});}; \ No newline at end of file +var _0x5f2f=['map','include','model','attributes','then','ShowFreshsalesAccount','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','FreshsalesAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','limit'];(function(_0x1a89a1,_0x56d889){var _0x3d5b46=function(_0x56debf){while(--_0x56debf){_0x1a89a1['push'](_0x1a89a1['shift']());}};_0x3d5b46(++_0x56d889);}(_0x5f2f,0x73));var _0xf5f2=function(_0x496cdc,_0x9d6db3){_0x496cdc=_0x496cdc-0x0;var _0x103a8e=_0x5f2f[_0x496cdc];return _0x103a8e;};'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')]('FreshsalesAccount,\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);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')]({'raw':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd['options'][_0xf5f2('0x1b')]===undefined?!![]:![]:!![],'where':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd['options']['where']||null:null,'attributes':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')]['attributes']||null:null,'limit':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')][_0xf5f2('0x1c')]||null:null,'include':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')]['include']?_[_0xf5f2('0x1d')](_0x20fccd[_0xf5f2('0x1a')][_0xf5f2('0x1e')],function(_0x2833fe){return{'model':db[_0x2833fe[_0xf5f2('0x1f')]],'as':_0x2833fe['as'],'attributes':_0x2833fe['attributes'],'include':_0x2833fe['include']?_[_0xf5f2('0x1d')](_0x2833fe[_0xf5f2('0x1e')],function(_0x13da6f){return{'model':db[_0x13da6f[_0xf5f2('0x1f')]],'as':_0x13da6f['as'],'attributes':_0x13da6f[_0xf5f2('0x20')],'include':_0x13da6f[_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x13da6f[_0xf5f2('0x1e')],function(_0x294414){return{'model':db[_0x294414['model']],'as':_0x294414['as'],'attributes':_0x294414[_0xf5f2('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x21')](function(_0x375ca8){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger[_0xf5f2('0xf')]('GetFreshsalesAccount',_0x20fccd,JSON['stringify'](_0x375ca8));_0x4ff59b(_0x375ca8);})[_0xf5f2('0x16')](function(_0x14c829){logger[_0xf5f2('0x11')]('GetFreshsalesAccount',_0x14c829['message'],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x14c829[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x22')]=function(_0x153924){var _0x1b381e=this;return new Promise(function(_0x54c0c8,_0x52e959){return db[_0xf5f2('0x18')]['find']({'raw':_0x153924[_0xf5f2('0x1a')]?_0x153924['options'][_0xf5f2('0x1b')]===undefined?!![]:![]:!![],'where':_0x153924[_0xf5f2('0x1a')]?_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x23')]||null:null,'attributes':_0x153924[_0xf5f2('0x1a')]?_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x20')]||null:null,'include':_0x153924[_0xf5f2('0x1a')]?_0x153924['options'][_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x1e')],function(_0x1408b9){return{'model':db[_0x1408b9[_0xf5f2('0x1f')]],'as':_0x1408b9['as'],'attributes':_0x1408b9[_0xf5f2('0x20')],'include':_0x1408b9['include']?_[_0xf5f2('0x1d')](_0x1408b9[_0xf5f2('0x1e')],function(_0x55989d){return{'model':db[_0x55989d[_0xf5f2('0x1f')]],'as':_0x55989d['as'],'attributes':_0x55989d['attributes'],'include':_0x55989d[_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x55989d[_0xf5f2('0x1e')],function(_0x2e3cca){return{'model':db[_0x2e3cca['model']],'as':_0x2e3cca['as'],'attributes':_0x2e3cca['attributes']};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x21')](function(_0x46ad4a){logger[_0xf5f2('0xd')]('ShowFreshsalesAccount',_0x153924);logger[_0xf5f2('0xf')]('ShowFreshsalesAccount',_0x153924,JSON[_0xf5f2('0x10')](_0x46ad4a));_0x54c0c8(_0x46ad4a);})['catch'](function(_0x46f464){logger[_0xf5f2('0x11')]('ShowFreshsalesAccount',_0x46f464[_0xf5f2('0x13')],_0x153924);_0x52e959(_0x1b381e[_0xf5f2('0x11')](0x1f4,_0x46f464[_0xf5f2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 2131321..94b26c7 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 _0xd5d1=['util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/subjects','getSubjects','getDescriptions','/:id/fields','post','create','put','update','delete','destroy','exports','multer'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xd5d1,0xef));var _0x1d5d=function(_0xbc96f7,_0x91820f){_0xbc96f7=_0xbc96f7-0x0;var _0x878d34=_0xd5d1[_0xbc96f7];return _0x878d34;};'use strict';var multer=require(_0x1d5d('0x0'));var util=require(_0x1d5d('0x1'));var path=require(_0x1d5d('0x2'));var timeout=require(_0x1d5d('0x3'));var express=require(_0x1d5d('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1d5d('0x5'));var config=require(_0x1d5d('0x6'));var controller=require(_0x1d5d('0x7'));router[_0x1d5d('0x8')]('/',auth['isAuthenticated'](),controller[_0x1d5d('0x9')]);router[_0x1d5d('0x8')](_0x1d5d('0xa'),auth[_0x1d5d('0xb')](),controller[_0x1d5d('0xc')]);router[_0x1d5d('0x8')](_0x1d5d('0xd'),auth[_0x1d5d('0xb')](),controller[_0x1d5d('0xe')]);router['get']('/:id/descriptions',auth[_0x1d5d('0xb')](),controller[_0x1d5d('0xf')]);router[_0x1d5d('0x8')](_0x1d5d('0x10'),auth[_0x1d5d('0xb')](),controller['getFields']);router[_0x1d5d('0x11')]('/',auth[_0x1d5d('0xb')](),controller[_0x1d5d('0x12')]);router[_0x1d5d('0x13')]('/:id',auth[_0x1d5d('0xb')](),controller[_0x1d5d('0x14')]);router[_0x1d5d('0x15')](_0x1d5d('0xa'),auth[_0x1d5d('0xb')](),controller[_0x1d5d('0x16')]);module[_0x1d5d('0x17')]=router; \ No newline at end of file +var _0xaa2b=['/:id','show','/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0xaa2b,0xcd));var _0xbaa2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa2b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xbaa2('0x0'));var util=require('util');var path=require(_0xbaa2('0x1'));var timeout=require('connect-timeout');var express=require(_0xbaa2('0x2'));var router=express['Router']();var fs_extra=require(_0xbaa2('0x3'));var auth=require(_0xbaa2('0x4'));var interaction=require(_0xbaa2('0x5'));var config=require(_0xbaa2('0x6'));var controller=require(_0xbaa2('0x7'));router[_0xbaa2('0x8')]('/',auth[_0xbaa2('0x9')](),controller[_0xbaa2('0xa')]);router[_0xbaa2('0x8')](_0xbaa2('0xb'),auth[_0xbaa2('0x9')](),controller[_0xbaa2('0xc')]);router['get'](_0xbaa2('0xd'),auth[_0xbaa2('0x9')](),controller['getSubjects']);router[_0xbaa2('0x8')](_0xbaa2('0xe'),auth[_0xbaa2('0x9')](),controller[_0xbaa2('0xf')]);router['get'](_0xbaa2('0x10'),auth['isAuthenticated'](),controller[_0xbaa2('0x11')]);router[_0xbaa2('0x12')]('/',auth[_0xbaa2('0x9')](),controller[_0xbaa2('0x13')]);router[_0xbaa2('0x14')](_0xbaa2('0xb'),auth[_0xbaa2('0x9')](),controller['update']);router[_0xbaa2('0x15')](_0xbaa2('0xb'),auth[_0xbaa2('0x9')](),controller[_0xbaa2('0x16')]);module[_0xbaa2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 25c12f5..77304a7 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 _0x3788=['sequelize','exports','STRING'];(function(_0x17b7f1,_0x14618b){var _0x2b1471=function(_0x381226){while(--_0x381226){_0x17b7f1['push'](_0x17b7f1['shift']());}};_0x2b1471(++_0x14618b);}(_0x3788,0x90));var _0x8378=function(_0x84644d,_0x51cca4){_0x84644d=_0x84644d-0x0;var _0x3997cb=_0x3788[_0x84644d];return _0x3997cb;};'use strict';var Sequelize=require(_0x8378('0x0'));module[_0x8378('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8378('0x2')]}}; \ No newline at end of file +var _0x9baa=['exports','STRING','sequelize'];(function(_0x36f4fd,_0x17c8e8){var _0x32f217=function(_0x5df1e6){while(--_0x5df1e6){_0x36f4fd['push'](_0x36f4fd['shift']());}};_0x32f217(++_0x17c8e8);}(_0x9baa,0xa7));var _0xa9ba=function(_0xf9bcaf,_0x3c9230){_0xf9bcaf=_0xf9bcaf-0x0;var _0x1dff25=_0x9baa[_0xf9bcaf];return _0x1dff25;};'use strict';var Sequelize=require(_0xa9ba('0x0'));module[_0xa9ba('0x1')]={'name':{'type':Sequelize[_0xa9ba('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index ba75422..0c07882 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 _0x1335=['destroy','getSubjects','findOne','params','FreshsalesField','getDescriptions','pick','getFields','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','reject','update','then','error','name','map','FreshsalesConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','catch','show','find','create','body'];(function(_0x32a310,_0x370570){var _0x34393e=function(_0x1fafa6){while(--_0x1fafa6){_0x32a310['push'](_0x32a310['shift']());}};_0x34393e(++_0x370570);}(_0x1335,0xe6));var _0x5133=function(_0x99d905,_0x57dabc){_0x99d905=_0x99d905-0x0;var _0x46acd3=_0x1335[_0x99d905];return _0x46acd3;};'use strict';var emlformat=require(_0x5133('0x0'));var rimraf=require(_0x5133('0x1'));var zipdir=require(_0x5133('0x2'));var jsonpatch=require(_0x5133('0x3'));var rp=require('request-promise');var moment=require(_0x5133('0x4'));var BPromise=require(_0x5133('0x5'));var Mustache=require(_0x5133('0x6'));var util=require(_0x5133('0x7'));var path=require(_0x5133('0x8'));var sox=require(_0x5133('0x9'));var csv=require('to-csv');var ejs=require(_0x5133('0xa'));var fs=require('fs');var fs_extra=require(_0x5133('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5133('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5133('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5133('0xe'));var Papa=require(_0x5133('0xf'));var Redis=require('ioredis');var authService=require(_0x5133('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5133('0x11'));var hardwareService=require(_0x5133('0x12'));var logger=require(_0x5133('0x13'))(_0x5133('0x14'));var utils=require('../../config/utils');var config=require(_0x5133('0x15'));var licenseUtil=require(_0x5133('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x491703,_0x55f495){_0x55f495=_0x55f495||0xcc;return function(_0x799ba){if(_0x799ba){return _0x491703[_0x5133('0x17')](_0x55f495);}return _0x491703[_0x5133('0x18')](_0x55f495)[_0x5133('0x19')]();};}function respondWithResult(_0x1e4833,_0x627ac9){_0x627ac9=_0x627ac9||0xc8;return function(_0x374a67){if(_0x374a67){return _0x1e4833['status'](_0x627ac9)[_0x5133('0x1a')](_0x374a67);}};}function respondWithFilteredResult(_0x3b437a,_0x366622){return function(_0x19af68){if(_0x19af68){var _0x3a1f91=typeof _0x366622['offset']===_0x5133('0x1b')&&typeof _0x366622[_0x5133('0x1c')]===_0x5133('0x1b');var _0x3b8e7a=_0x19af68[_0x5133('0x1d')];var _0x451ae3=_0x3a1f91?0x0:_0x366622[_0x5133('0x1e')];var _0x55d815=_0x3a1f91?_0x19af68[_0x5133('0x1d')]:_0x366622[_0x5133('0x1e')]+_0x366622[_0x5133('0x1c')];var _0xa6ca5a;if(_0x55d815>=_0x3b8e7a){_0x55d815=_0x3b8e7a;_0xa6ca5a=0xc8;}else{_0xa6ca5a=0xce;}_0x3b437a[_0x5133('0x18')](_0xa6ca5a);return _0x3b437a['set'](_0x5133('0x1f'),_0x451ae3+'-'+_0x55d815+'/'+_0x3b8e7a)[_0x5133('0x1a')](_0x19af68);}return null;};}function patchUpdates(_0x38fc77){return function(_0x5d3440){try{jsonpatch['apply'](_0x5d3440,_0x38fc77,!![]);}catch(_0x5e30d1){return BPromise[_0x5133('0x20')](_0x5e30d1);}return _0x5d3440['save']();};}function saveUpdates(_0x474733,_0x266e7e){return function(_0x5ad381){if(_0x5ad381){return _0x5ad381[_0x5133('0x21')](_0x474733)[_0x5133('0x22')](function(_0x3eb78f){return _0x3eb78f;});}return null;};}function removeEntity(_0x4b9a88,_0x14c5ba){return function(_0x33bad7){if(_0x33bad7){return _0x33bad7['destroy']()[_0x5133('0x22')](function(){_0x4b9a88[_0x5133('0x18')](0xcc)[_0x5133('0x19')]();});}};}function handleEntityNotFound(_0x5d64dc,_0x514951){return function(_0x11b352){if(!_0x11b352){_0x5d64dc[_0x5133('0x17')](0x194);}return _0x11b352;};}function handleError(_0x36c32e,_0x7fb24f){_0x7fb24f=_0x7fb24f||0x1f4;return function(_0x4ca935){logger[_0x5133('0x23')](_0x4ca935['stack']);if(_0x4ca935['name']){delete _0x4ca935[_0x5133('0x24')];}_0x36c32e[_0x5133('0x18')](_0x7fb24f)['send'](_0x4ca935);};}exports['index']=function(_0x57f941,_0x1d9fa7){var _0x1cb5f1={},_0x1ecb32={},_0x13d5b1={'count':0x0,'rows':[]};var _0x152fc8=_[_0x5133('0x25')](db[_0x5133('0x26')][_0x5133('0x27')],function(_0x11180c){return{'name':_0x11180c['fieldName'],'type':_0x11180c[_0x5133('0x28')][_0x5133('0x29')]};});_0x1ecb32[_0x5133('0x2a')]=_['map'](_0x152fc8,'name');_0x1ecb32[_0x5133('0x2b')]=_[_0x5133('0x2c')](_0x57f941[_0x5133('0x2b')]);_0x1ecb32[_0x5133('0x2d')]=_[_0x5133('0x2e')](_0x1ecb32[_0x5133('0x2a')],_0x1ecb32[_0x5133('0x2b')]);_0x1cb5f1['attributes']=_[_0x5133('0x2e')](_0x1ecb32[_0x5133('0x2a')],qs[_0x5133('0x2f')](_0x57f941[_0x5133('0x2b')][_0x5133('0x2f')]));_0x1cb5f1[_0x5133('0x30')]=_0x1cb5f1[_0x5133('0x30')][_0x5133('0x31')]?_0x1cb5f1[_0x5133('0x30')]:_0x1ecb32[_0x5133('0x2a')];if(!_0x57f941['query'][_0x5133('0x32')](_0x5133('0x33'))){_0x1cb5f1[_0x5133('0x1c')]=qs[_0x5133('0x1c')](_0x57f941[_0x5133('0x2b')][_0x5133('0x1c')]);_0x1cb5f1[_0x5133('0x1e')]=qs[_0x5133('0x1e')](_0x57f941[_0x5133('0x2b')]['offset']);}_0x1cb5f1[_0x5133('0x34')]=qs['sort'](_0x57f941[_0x5133('0x2b')][_0x5133('0x35')]);_0x1cb5f1[_0x5133('0x36')]=qs[_0x5133('0x2d')](_['pick'](_0x57f941[_0x5133('0x2b')],_0x1ecb32[_0x5133('0x2d')]),_0x152fc8);if(_0x57f941['query'][_0x5133('0x37')]){_0x1cb5f1['where']=_[_0x5133('0x38')](_0x1cb5f1[_0x5133('0x36')],{'$or':_[_0x5133('0x25')](_0x152fc8,function(_0x20d5cf){if(_0x20d5cf[_0x5133('0x28')]!=='VIRTUAL'){var _0x3f6f3e={};_0x3f6f3e[_0x20d5cf[_0x5133('0x24')]]={'$like':'%'+_0x57f941[_0x5133('0x2b')][_0x5133('0x37')]+'%'};return _0x3f6f3e;}})});}_0x1cb5f1=_[_0x5133('0x38')]({},_0x1cb5f1,_0x57f941[_0x5133('0x39')]);var _0x2a8beb={'where':_0x1cb5f1[_0x5133('0x36')]};return db['FreshsalesConfiguration'][_0x5133('0x1d')](_0x2a8beb)['then'](function(_0x75f45b){_0x13d5b1[_0x5133('0x1d')]=_0x75f45b;if(_0x57f941[_0x5133('0x2b')][_0x5133('0x3a')]){_0x1cb5f1[_0x5133('0x3b')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x5133('0x3c')](_0x1cb5f1);})['then'](function(_0x65155b){_0x13d5b1['rows']=_0x65155b;return _0x13d5b1;})[_0x5133('0x22')](respondWithFilteredResult(_0x1d9fa7,_0x1cb5f1))[_0x5133('0x3d')](handleError(_0x1d9fa7,null));};exports[_0x5133('0x3e')]=function(_0xee7956,_0x15d43f){var _0x8ffe5f={'raw':![],'where':{'id':_0xee7956['params']['id']}},_0x3864b7={};_0x3864b7['model']=_['keys'](db['FreshsalesConfiguration'][_0x5133('0x27')]);_0x3864b7[_0x5133('0x2b')]=_['keys'](_0xee7956[_0x5133('0x2b')]);_0x3864b7[_0x5133('0x2d')]=_[_0x5133('0x2e')](_0x3864b7['model'],_0x3864b7['query']);_0x8ffe5f[_0x5133('0x30')]=_[_0x5133('0x2e')](_0x3864b7[_0x5133('0x2a')],qs[_0x5133('0x2f')](_0xee7956[_0x5133('0x2b')][_0x5133('0x2f')]));_0x8ffe5f['attributes']=_0x8ffe5f[_0x5133('0x30')][_0x5133('0x31')]?_0x8ffe5f['attributes']:_0x3864b7[_0x5133('0x2a')];if(_0xee7956[_0x5133('0x2b')][_0x5133('0x3a')]){_0x8ffe5f[_0x5133('0x3b')]=[{'all':!![]}];}_0x8ffe5f=_['merge']({},_0x8ffe5f,_0xee7956[_0x5133('0x39')]);return db[_0x5133('0x26')][_0x5133('0x3f')](_0x8ffe5f)[_0x5133('0x22')](handleEntityNotFound(_0x15d43f,null))['then'](respondWithResult(_0x15d43f,null))[_0x5133('0x3d')](handleError(_0x15d43f,null));};exports[_0x5133('0x40')]=function(_0x306a6c,_0x53897c){return db[_0x5133('0x26')][_0x5133('0x40')](_0x306a6c[_0x5133('0x41')],{})[_0x5133('0x22')](respondWithResult(_0x53897c,0xc9))['catch'](handleError(_0x53897c,null));};exports[_0x5133('0x21')]=function(_0x1e0204,_0x27ff30){if(_0x1e0204[_0x5133('0x41')]['id']){delete _0x1e0204[_0x5133('0x41')]['id'];}return db[_0x5133('0x26')][_0x5133('0x3f')]({'where':{'id':_0x1e0204['params']['id']}})[_0x5133('0x22')](handleEntityNotFound(_0x27ff30,null))[_0x5133('0x22')](saveUpdates(_0x1e0204[_0x5133('0x41')],null))[_0x5133('0x22')](respondWithResult(_0x27ff30,null))[_0x5133('0x3d')](handleError(_0x27ff30,null));};exports[_0x5133('0x42')]=function(_0x328425,_0x160bc7){return db['FreshsalesConfiguration'][_0x5133('0x3f')]({'where':{'id':_0x328425['params']['id']}})[_0x5133('0x22')](handleEntityNotFound(_0x160bc7,null))[_0x5133('0x22')](removeEntity(_0x160bc7,null))[_0x5133('0x3d')](handleError(_0x160bc7,null));};exports[_0x5133('0x43')]=function(_0x10086a,_0x3ccc5a,_0x6872e2){var _0x59e49f={};var _0x229512={};var _0x4230aa;var _0x41cb3e;return db[_0x5133('0x26')][_0x5133('0x44')]({'where':{'id':_0x10086a[_0x5133('0x45')]['id']}})[_0x5133('0x22')](handleEntityNotFound(_0x3ccc5a,null))[_0x5133('0x22')](function(_0x51ff52){if(_0x51ff52){_0x4230aa=_0x51ff52;_0x229512[_0x5133('0x2a')]=_[_0x5133('0x2c')](db[_0x5133('0x46')][_0x5133('0x27')]);_0x229512[_0x5133('0x2b')]=_['keys'](_0x10086a[_0x5133('0x2b')]);_0x229512['filters']=_['intersection'](_0x229512[_0x5133('0x2a')],_0x229512[_0x5133('0x2b')]);_0x59e49f[_0x5133('0x30')]=_[_0x5133('0x2e')](_0x229512[_0x5133('0x2a')],qs[_0x5133('0x2f')](_0x10086a[_0x5133('0x2b')][_0x5133('0x2f')]));_0x59e49f[_0x5133('0x30')]=_0x59e49f[_0x5133('0x30')][_0x5133('0x31')]?_0x59e49f['attributes']:_0x229512[_0x5133('0x2a')];_0x59e49f[_0x5133('0x34')]=qs[_0x5133('0x35')](_0x10086a[_0x5133('0x2b')][_0x5133('0x35')]);_0x59e49f[_0x5133('0x36')]=qs[_0x5133('0x2d')](_['pick'](_0x10086a[_0x5133('0x2b')],_0x229512[_0x5133('0x2d')]));if(_0x10086a['query'][_0x5133('0x37')]){_0x59e49f[_0x5133('0x36')]=_[_0x5133('0x38')](_0x59e49f[_0x5133('0x36')],{'$or':_[_0x5133('0x25')](_0x59e49f[_0x5133('0x30')],function(_0x495d25){var _0x431974={};_0x431974[_0x495d25]={'$like':'%'+_0x10086a[_0x5133('0x2b')][_0x5133('0x37')]+'%'};return _0x431974;})});}_0x59e49f=_[_0x5133('0x38')]({},_0x59e49f,_0x10086a[_0x5133('0x39')]);return _0x4230aa[_0x5133('0x43')](_0x59e49f);}})['then'](function(_0xce9e89){if(_0xce9e89){_0x41cb3e=_0xce9e89[_0x5133('0x31')];if(!_0x10086a[_0x5133('0x2b')][_0x5133('0x32')](_0x5133('0x33'))){_0x59e49f['limit']=qs['limit'](_0x10086a[_0x5133('0x2b')][_0x5133('0x1c')]);_0x59e49f['offset']=qs[_0x5133('0x1e')](_0x10086a[_0x5133('0x2b')][_0x5133('0x1e')]);}return _0x4230aa[_0x5133('0x43')](_0x59e49f);}})['then'](function(_0x2f67fd){if(_0x2f67fd){return _0x2f67fd?{'count':_0x41cb3e,'rows':_0x2f67fd}:null;}})[_0x5133('0x22')](respondWithResult(_0x3ccc5a,null))[_0x5133('0x3d')](handleError(_0x3ccc5a,null));};exports[_0x5133('0x47')]=function(_0x26a70d,_0x58cfe3,_0x3aca15){var _0x438f66={};var _0x244f04={};var _0x180ae8;var _0x178b43;return db[_0x5133('0x26')]['findOne']({'where':{'id':_0x26a70d[_0x5133('0x45')]['id']}})[_0x5133('0x22')](handleEntityNotFound(_0x58cfe3,null))[_0x5133('0x22')](function(_0x255738){if(_0x255738){_0x180ae8=_0x255738;_0x244f04[_0x5133('0x2a')]=_['keys'](db[_0x5133('0x46')]['rawAttributes']);_0x244f04[_0x5133('0x2b')]=_[_0x5133('0x2c')](_0x26a70d[_0x5133('0x2b')]);_0x244f04[_0x5133('0x2d')]=_[_0x5133('0x2e')](_0x244f04[_0x5133('0x2a')],_0x244f04[_0x5133('0x2b')]);_0x438f66[_0x5133('0x30')]=_['intersection'](_0x244f04[_0x5133('0x2a')],qs['fields'](_0x26a70d[_0x5133('0x2b')][_0x5133('0x2f')]));_0x438f66['attributes']=_0x438f66[_0x5133('0x30')]['length']?_0x438f66[_0x5133('0x30')]:_0x244f04[_0x5133('0x2a')];_0x438f66[_0x5133('0x34')]=qs[_0x5133('0x35')](_0x26a70d[_0x5133('0x2b')][_0x5133('0x35')]);_0x438f66[_0x5133('0x36')]=qs['filters'](_[_0x5133('0x48')](_0x26a70d[_0x5133('0x2b')],_0x244f04[_0x5133('0x2d')]));if(_0x26a70d[_0x5133('0x2b')][_0x5133('0x37')]){_0x438f66['where']=_[_0x5133('0x38')](_0x438f66[_0x5133('0x36')],{'$or':_[_0x5133('0x25')](_0x438f66[_0x5133('0x30')],function(_0x415b40){var _0x59938e={};_0x59938e[_0x415b40]={'$like':'%'+_0x26a70d[_0x5133('0x2b')][_0x5133('0x37')]+'%'};return _0x59938e;})});}_0x438f66=_['merge']({},_0x438f66,_0x26a70d[_0x5133('0x39')]);return _0x180ae8[_0x5133('0x47')](_0x438f66);}})['then'](function(_0x475239){if(_0x475239){_0x178b43=_0x475239[_0x5133('0x31')];if(!_0x26a70d[_0x5133('0x2b')]['hasOwnProperty'](_0x5133('0x33'))){_0x438f66[_0x5133('0x1c')]=qs[_0x5133('0x1c')](_0x26a70d['query'][_0x5133('0x1c')]);_0x438f66['offset']=qs[_0x5133('0x1e')](_0x26a70d[_0x5133('0x2b')]['offset']);}return _0x180ae8[_0x5133('0x47')](_0x438f66);}})[_0x5133('0x22')](function(_0xb37a15){if(_0xb37a15){return _0xb37a15?{'count':_0x178b43,'rows':_0xb37a15}:null;}})[_0x5133('0x22')](respondWithResult(_0x58cfe3,null))[_0x5133('0x3d')](handleError(_0x58cfe3,null));};exports[_0x5133('0x49')]=function(_0x37ec72,_0x52100d,_0x3d347e){var _0x13d87c={};var _0x4bfb93={};var _0x84f27d;var _0x198d29;return db[_0x5133('0x26')][_0x5133('0x44')]({'where':{'id':_0x37ec72[_0x5133('0x45')]['id']}})[_0x5133('0x22')](handleEntityNotFound(_0x52100d,null))[_0x5133('0x22')](function(_0x117a37){if(_0x117a37){_0x84f27d=_0x117a37;_0x4bfb93[_0x5133('0x2a')]=_['keys'](db[_0x5133('0x46')]['rawAttributes']);_0x4bfb93[_0x5133('0x2b')]=_['keys'](_0x37ec72[_0x5133('0x2b')]);_0x4bfb93[_0x5133('0x2d')]=_['intersection'](_0x4bfb93['model'],_0x4bfb93[_0x5133('0x2b')]);_0x13d87c[_0x5133('0x30')]=_['intersection'](_0x4bfb93[_0x5133('0x2a')],qs[_0x5133('0x2f')](_0x37ec72['query']['fields']));_0x13d87c[_0x5133('0x30')]=_0x13d87c[_0x5133('0x30')]['length']?_0x13d87c['attributes']:_0x4bfb93[_0x5133('0x2a')];_0x13d87c[_0x5133('0x34')]=qs[_0x5133('0x35')](_0x37ec72[_0x5133('0x2b')]['sort']);_0x13d87c[_0x5133('0x36')]=qs[_0x5133('0x2d')](_[_0x5133('0x48')](_0x37ec72['query'],_0x4bfb93[_0x5133('0x2d')]));if(_0x37ec72[_0x5133('0x2b')][_0x5133('0x37')]){_0x13d87c[_0x5133('0x36')]=_['merge'](_0x13d87c[_0x5133('0x36')],{'$or':_[_0x5133('0x25')](_0x13d87c[_0x5133('0x30')],function(_0xea4e78){var _0x5bf45f={};_0x5bf45f[_0xea4e78]={'$like':'%'+_0x37ec72[_0x5133('0x2b')][_0x5133('0x37')]+'%'};return _0x5bf45f;})});}_0x13d87c=_['merge']({},_0x13d87c,_0x37ec72[_0x5133('0x39')]);return _0x84f27d[_0x5133('0x49')](_0x13d87c);}})[_0x5133('0x22')](function(_0x506a8e){if(_0x506a8e){_0x198d29=_0x506a8e[_0x5133('0x31')];if(!_0x37ec72[_0x5133('0x2b')][_0x5133('0x32')](_0x5133('0x33'))){_0x13d87c['limit']=qs['limit'](_0x37ec72[_0x5133('0x2b')][_0x5133('0x1c')]);_0x13d87c['offset']=qs[_0x5133('0x1e')](_0x37ec72[_0x5133('0x2b')]['offset']);}return _0x84f27d[_0x5133('0x49')](_0x13d87c);}})['then'](function(_0xd7fc68){if(_0xd7fc68){return _0xd7fc68?{'count':_0x198d29,'rows':_0xd7fc68}:null;}})[_0x5133('0x22')](respondWithResult(_0x52100d,null))[_0x5133('0x3d')](handleError(_0x52100d,null));}; \ No newline at end of file +var _0x4f67=['find','create','body','params','destroy','getSubjects','findOne','nolimit','getDescriptions','getFields','rimraf','moment','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','end','status','json','limit','undefined','count','offset','apply','reject','save','update','then','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','options'];(function(_0x10fb97,_0x55af48){var _0x3a9cb3=function(_0x2a928e){while(--_0x2a928e){_0x10fb97['push'](_0x10fb97['shift']());}};_0x3a9cb3(++_0x55af48);}(_0x4f67,0x16d));var _0x74f6=function(_0x5e5c4c,_0x21abba){_0x5e5c4c=_0x5e5c4c-0x0;var _0x176148=_0x4f67[_0x5e5c4c];return _0x176148;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x74f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x74f6('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x74f6('0x2'));var sox=require('sox');var csv=require(_0x74f6('0x3'));var ejs=require(_0x74f6('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x74f6('0x5'));var squel=require(_0x74f6('0x6'));var crypto=require(_0x74f6('0x7'));var jsforce=require(_0x74f6('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x74f6('0x3'));var querystring=require(_0x74f6('0x9'));var Papa=require(_0x74f6('0xa'));var Redis=require(_0x74f6('0xb'));var authService=require(_0x74f6('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x74f6('0xd'));var hardwareService=require(_0x74f6('0xe'));var logger=require(_0x74f6('0xf'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x74f6('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b223f,_0x2d7642){_0x2d7642=_0x2d7642||0xcc;return function(_0x702e1a){if(_0x702e1a){return _0x2b223f[_0x74f6('0x11')](_0x2d7642);}return _0x2b223f['status'](_0x2d7642)[_0x74f6('0x12')]();};}function respondWithResult(_0xb2328e,_0x10eb68){_0x10eb68=_0x10eb68||0xc8;return function(_0x2d9312){if(_0x2d9312){return _0xb2328e[_0x74f6('0x13')](_0x10eb68)[_0x74f6('0x14')](_0x2d9312);}};}function respondWithFilteredResult(_0x5443bb,_0x212ed4){return function(_0x141293){if(_0x141293){var _0x3bdf8d=typeof _0x212ed4['offset']==='undefined'&&typeof _0x212ed4[_0x74f6('0x15')]===_0x74f6('0x16');var _0x5426d9=_0x141293[_0x74f6('0x17')];var _0x4ff53f=_0x3bdf8d?0x0:_0x212ed4[_0x74f6('0x18')];var _0x55cb51=_0x3bdf8d?_0x141293[_0x74f6('0x17')]:_0x212ed4[_0x74f6('0x18')]+_0x212ed4[_0x74f6('0x15')];var _0x10559f;if(_0x55cb51>=_0x5426d9){_0x55cb51=_0x5426d9;_0x10559f=0xc8;}else{_0x10559f=0xce;}_0x5443bb[_0x74f6('0x13')](_0x10559f);return _0x5443bb['set']('Content-Range',_0x4ff53f+'-'+_0x55cb51+'/'+_0x5426d9)[_0x74f6('0x14')](_0x141293);}return null;};}function patchUpdates(_0x29f141){return function(_0xdc06d4){try{jsonpatch[_0x74f6('0x19')](_0xdc06d4,_0x29f141,!![]);}catch(_0x73fa88){return BPromise[_0x74f6('0x1a')](_0x73fa88);}return _0xdc06d4[_0x74f6('0x1b')]();};}function saveUpdates(_0x5c8734,_0x30c549){return function(_0xf54676){if(_0xf54676){return _0xf54676[_0x74f6('0x1c')](_0x5c8734)[_0x74f6('0x1d')](function(_0x5912f9){return _0x5912f9;});}return null;};}function removeEntity(_0x4d2fa2,_0x3db295){return function(_0x51cff8){if(_0x51cff8){return _0x51cff8['destroy']()[_0x74f6('0x1d')](function(){_0x4d2fa2[_0x74f6('0x13')](0xcc)[_0x74f6('0x12')]();});}};}function handleEntityNotFound(_0x219985,_0x5cc5c1){return function(_0x1f2a77){if(!_0x1f2a77){_0x219985['sendStatus'](0x194);}return _0x1f2a77;};}function handleError(_0x137702,_0x225657){_0x225657=_0x225657||0x1f4;return function(_0x24975b){logger['error'](_0x24975b[_0x74f6('0x1e')]);if(_0x24975b[_0x74f6('0x1f')]){delete _0x24975b['name'];}_0x137702[_0x74f6('0x13')](_0x225657)[_0x74f6('0x20')](_0x24975b);};}exports[_0x74f6('0x21')]=function(_0x28c20a,_0x29f10d){var _0x22efe6={},_0x149fb7={},_0xc08231={'count':0x0,'rows':[]};var _0x119db7=_[_0x74f6('0x22')](db[_0x74f6('0x23')][_0x74f6('0x24')],function(_0x260782){return{'name':_0x260782[_0x74f6('0x25')],'type':_0x260782['type'][_0x74f6('0x26')]};});_0x149fb7[_0x74f6('0x27')]=_[_0x74f6('0x22')](_0x119db7,'name');_0x149fb7[_0x74f6('0x28')]=_[_0x74f6('0x29')](_0x28c20a[_0x74f6('0x28')]);_0x149fb7['filters']=_[_0x74f6('0x2a')](_0x149fb7[_0x74f6('0x27')],_0x149fb7[_0x74f6('0x28')]);_0x22efe6[_0x74f6('0x2b')]=_[_0x74f6('0x2a')](_0x149fb7[_0x74f6('0x27')],qs[_0x74f6('0x2c')](_0x28c20a[_0x74f6('0x28')][_0x74f6('0x2c')]));_0x22efe6['attributes']=_0x22efe6[_0x74f6('0x2b')][_0x74f6('0x2d')]?_0x22efe6[_0x74f6('0x2b')]:_0x149fb7[_0x74f6('0x27')];if(!_0x28c20a[_0x74f6('0x28')][_0x74f6('0x2e')]('nolimit')){_0x22efe6[_0x74f6('0x15')]=qs[_0x74f6('0x15')](_0x28c20a[_0x74f6('0x28')][_0x74f6('0x15')]);_0x22efe6[_0x74f6('0x18')]=qs[_0x74f6('0x18')](_0x28c20a['query'][_0x74f6('0x18')]);}_0x22efe6[_0x74f6('0x2f')]=qs[_0x74f6('0x30')](_0x28c20a[_0x74f6('0x28')]['sort']);_0x22efe6[_0x74f6('0x31')]=qs['filters'](_[_0x74f6('0x32')](_0x28c20a[_0x74f6('0x28')],_0x149fb7[_0x74f6('0x33')]),_0x119db7);if(_0x28c20a['query'][_0x74f6('0x34')]){_0x22efe6[_0x74f6('0x31')]=_[_0x74f6('0x35')](_0x22efe6[_0x74f6('0x31')],{'$or':_[_0x74f6('0x22')](_0x119db7,function(_0x430fce){if(_0x430fce[_0x74f6('0x36')]!==_0x74f6('0x37')){var _0x2c7468={};_0x2c7468[_0x430fce['name']]={'$like':'%'+_0x28c20a[_0x74f6('0x28')][_0x74f6('0x34')]+'%'};return _0x2c7468;}})});}_0x22efe6=_['merge']({},_0x22efe6,_0x28c20a['options']);var _0x46f6d7={'where':_0x22efe6[_0x74f6('0x31')]};return db[_0x74f6('0x23')][_0x74f6('0x17')](_0x46f6d7)['then'](function(_0x3a2d2b){_0xc08231['count']=_0x3a2d2b;if(_0x28c20a['query'][_0x74f6('0x38')]){_0x22efe6[_0x74f6('0x39')]=[{'all':!![]}];}return db[_0x74f6('0x23')][_0x74f6('0x3a')](_0x22efe6);})[_0x74f6('0x1d')](function(_0x21b684){_0xc08231['rows']=_0x21b684;return _0xc08231;})['then'](respondWithFilteredResult(_0x29f10d,_0x22efe6))[_0x74f6('0x3b')](handleError(_0x29f10d,null));};exports['show']=function(_0xce6da,_0x3f6c10){var _0x1dec6c={'raw':![],'where':{'id':_0xce6da['params']['id']}},_0x2c0172={};_0x2c0172[_0x74f6('0x27')]=_[_0x74f6('0x29')](db[_0x74f6('0x23')][_0x74f6('0x24')]);_0x2c0172['query']=_[_0x74f6('0x29')](_0xce6da['query']);_0x2c0172['filters']=_[_0x74f6('0x2a')](_0x2c0172[_0x74f6('0x27')],_0x2c0172['query']);_0x1dec6c[_0x74f6('0x2b')]=_[_0x74f6('0x2a')](_0x2c0172[_0x74f6('0x27')],qs[_0x74f6('0x2c')](_0xce6da[_0x74f6('0x28')]['fields']));_0x1dec6c['attributes']=_0x1dec6c[_0x74f6('0x2b')]['length']?_0x1dec6c['attributes']:_0x2c0172[_0x74f6('0x27')];if(_0xce6da[_0x74f6('0x28')]['includeAll']){_0x1dec6c[_0x74f6('0x39')]=[{'all':!![]}];}_0x1dec6c=_[_0x74f6('0x35')]({},_0x1dec6c,_0xce6da[_0x74f6('0x3c')]);return db[_0x74f6('0x23')][_0x74f6('0x3d')](_0x1dec6c)[_0x74f6('0x1d')](handleEntityNotFound(_0x3f6c10,null))[_0x74f6('0x1d')](respondWithResult(_0x3f6c10,null))[_0x74f6('0x3b')](handleError(_0x3f6c10,null));};exports[_0x74f6('0x3e')]=function(_0x392d23,_0x198d9a){return db[_0x74f6('0x23')][_0x74f6('0x3e')](_0x392d23[_0x74f6('0x3f')],{})[_0x74f6('0x1d')](respondWithResult(_0x198d9a,0xc9))[_0x74f6('0x3b')](handleError(_0x198d9a,null));};exports[_0x74f6('0x1c')]=function(_0x2153e4,_0x2d352a){if(_0x2153e4[_0x74f6('0x3f')]['id']){delete _0x2153e4[_0x74f6('0x3f')]['id'];}return db[_0x74f6('0x23')]['find']({'where':{'id':_0x2153e4[_0x74f6('0x40')]['id']}})[_0x74f6('0x1d')](handleEntityNotFound(_0x2d352a,null))[_0x74f6('0x1d')](saveUpdates(_0x2153e4['body'],null))[_0x74f6('0x1d')](respondWithResult(_0x2d352a,null))[_0x74f6('0x3b')](handleError(_0x2d352a,null));};exports[_0x74f6('0x41')]=function(_0x489feb,_0xf8ab0){return db[_0x74f6('0x23')]['find']({'where':{'id':_0x489feb['params']['id']}})['then'](handleEntityNotFound(_0xf8ab0,null))[_0x74f6('0x1d')](removeEntity(_0xf8ab0,null))[_0x74f6('0x3b')](handleError(_0xf8ab0,null));};exports[_0x74f6('0x42')]=function(_0x16a569,_0x2a37a6,_0x4145ba){var _0xf8d257={};var _0x47ab32={};var _0x327709;var _0x4fad5c;return db[_0x74f6('0x23')][_0x74f6('0x43')]({'where':{'id':_0x16a569[_0x74f6('0x40')]['id']}})['then'](handleEntityNotFound(_0x2a37a6,null))['then'](function(_0x108b05){if(_0x108b05){_0x327709=_0x108b05;_0x47ab32['model']=_[_0x74f6('0x29')](db['FreshsalesField']['rawAttributes']);_0x47ab32['query']=_[_0x74f6('0x29')](_0x16a569[_0x74f6('0x28')]);_0x47ab32['filters']=_['intersection'](_0x47ab32[_0x74f6('0x27')],_0x47ab32[_0x74f6('0x28')]);_0xf8d257[_0x74f6('0x2b')]=_[_0x74f6('0x2a')](_0x47ab32[_0x74f6('0x27')],qs[_0x74f6('0x2c')](_0x16a569[_0x74f6('0x28')]['fields']));_0xf8d257['attributes']=_0xf8d257[_0x74f6('0x2b')][_0x74f6('0x2d')]?_0xf8d257['attributes']:_0x47ab32[_0x74f6('0x27')];_0xf8d257[_0x74f6('0x2f')]=qs[_0x74f6('0x30')](_0x16a569['query'][_0x74f6('0x30')]);_0xf8d257[_0x74f6('0x31')]=qs[_0x74f6('0x33')](_[_0x74f6('0x32')](_0x16a569[_0x74f6('0x28')],_0x47ab32['filters']));if(_0x16a569[_0x74f6('0x28')][_0x74f6('0x34')]){_0xf8d257[_0x74f6('0x31')]=_[_0x74f6('0x35')](_0xf8d257['where'],{'$or':_['map'](_0xf8d257[_0x74f6('0x2b')],function(_0x1d1b08){var _0x32046a={};_0x32046a[_0x1d1b08]={'$like':'%'+_0x16a569['query'][_0x74f6('0x34')]+'%'};return _0x32046a;})});}_0xf8d257=_[_0x74f6('0x35')]({},_0xf8d257,_0x16a569[_0x74f6('0x3c')]);return _0x327709['getSubjects'](_0xf8d257);}})['then'](function(_0xc21b7f){if(_0xc21b7f){_0x4fad5c=_0xc21b7f[_0x74f6('0x2d')];if(!_0x16a569['query'][_0x74f6('0x2e')](_0x74f6('0x44'))){_0xf8d257[_0x74f6('0x15')]=qs[_0x74f6('0x15')](_0x16a569[_0x74f6('0x28')][_0x74f6('0x15')]);_0xf8d257[_0x74f6('0x18')]=qs[_0x74f6('0x18')](_0x16a569['query']['offset']);}return _0x327709[_0x74f6('0x42')](_0xf8d257);}})[_0x74f6('0x1d')](function(_0x12154b){if(_0x12154b){return _0x12154b?{'count':_0x4fad5c,'rows':_0x12154b}:null;}})[_0x74f6('0x1d')](respondWithResult(_0x2a37a6,null))['catch'](handleError(_0x2a37a6,null));};exports[_0x74f6('0x45')]=function(_0x20c112,_0x22fb72,_0x5706cb){var _0x3d983d={};var _0x285b0b={};var _0x909b09;var _0x3b4f91;return db[_0x74f6('0x23')][_0x74f6('0x43')]({'where':{'id':_0x20c112[_0x74f6('0x40')]['id']}})[_0x74f6('0x1d')](handleEntityNotFound(_0x22fb72,null))[_0x74f6('0x1d')](function(_0x407116){if(_0x407116){_0x909b09=_0x407116;_0x285b0b[_0x74f6('0x27')]=_[_0x74f6('0x29')](db['FreshsalesField'][_0x74f6('0x24')]);_0x285b0b['query']=_[_0x74f6('0x29')](_0x20c112[_0x74f6('0x28')]);_0x285b0b['filters']=_['intersection'](_0x285b0b[_0x74f6('0x27')],_0x285b0b[_0x74f6('0x28')]);_0x3d983d[_0x74f6('0x2b')]=_[_0x74f6('0x2a')](_0x285b0b['model'],qs[_0x74f6('0x2c')](_0x20c112[_0x74f6('0x28')]['fields']));_0x3d983d['attributes']=_0x3d983d[_0x74f6('0x2b')][_0x74f6('0x2d')]?_0x3d983d[_0x74f6('0x2b')]:_0x285b0b[_0x74f6('0x27')];_0x3d983d[_0x74f6('0x2f')]=qs[_0x74f6('0x30')](_0x20c112[_0x74f6('0x28')][_0x74f6('0x30')]);_0x3d983d[_0x74f6('0x31')]=qs[_0x74f6('0x33')](_['pick'](_0x20c112['query'],_0x285b0b[_0x74f6('0x33')]));if(_0x20c112['query'][_0x74f6('0x34')]){_0x3d983d[_0x74f6('0x31')]=_[_0x74f6('0x35')](_0x3d983d[_0x74f6('0x31')],{'$or':_[_0x74f6('0x22')](_0x3d983d[_0x74f6('0x2b')],function(_0x501291){var _0x32128e={};_0x32128e[_0x501291]={'$like':'%'+_0x20c112[_0x74f6('0x28')]['filter']+'%'};return _0x32128e;})});}_0x3d983d=_[_0x74f6('0x35')]({},_0x3d983d,_0x20c112[_0x74f6('0x3c')]);return _0x909b09[_0x74f6('0x45')](_0x3d983d);}})['then'](function(_0x1585b3){if(_0x1585b3){_0x3b4f91=_0x1585b3[_0x74f6('0x2d')];if(!_0x20c112['query'][_0x74f6('0x2e')](_0x74f6('0x44'))){_0x3d983d['limit']=qs[_0x74f6('0x15')](_0x20c112[_0x74f6('0x28')]['limit']);_0x3d983d[_0x74f6('0x18')]=qs[_0x74f6('0x18')](_0x20c112[_0x74f6('0x28')][_0x74f6('0x18')]);}return _0x909b09['getDescriptions'](_0x3d983d);}})[_0x74f6('0x1d')](function(_0x42464b){if(_0x42464b){return _0x42464b?{'count':_0x3b4f91,'rows':_0x42464b}:null;}})[_0x74f6('0x1d')](respondWithResult(_0x22fb72,null))['catch'](handleError(_0x22fb72,null));};exports[_0x74f6('0x46')]=function(_0x42f3c1,_0x175d30,_0x389936){var _0x1c7383={};var _0x167299={};var _0x1d3eb8;var _0x5bbed4;return db[_0x74f6('0x23')][_0x74f6('0x43')]({'where':{'id':_0x42f3c1[_0x74f6('0x40')]['id']}})[_0x74f6('0x1d')](handleEntityNotFound(_0x175d30,null))[_0x74f6('0x1d')](function(_0x56baee){if(_0x56baee){_0x1d3eb8=_0x56baee;_0x167299[_0x74f6('0x27')]=_[_0x74f6('0x29')](db['FreshsalesField'][_0x74f6('0x24')]);_0x167299[_0x74f6('0x28')]=_['keys'](_0x42f3c1[_0x74f6('0x28')]);_0x167299['filters']=_[_0x74f6('0x2a')](_0x167299[_0x74f6('0x27')],_0x167299['query']);_0x1c7383[_0x74f6('0x2b')]=_['intersection'](_0x167299[_0x74f6('0x27')],qs[_0x74f6('0x2c')](_0x42f3c1[_0x74f6('0x28')][_0x74f6('0x2c')]));_0x1c7383['attributes']=_0x1c7383['attributes'][_0x74f6('0x2d')]?_0x1c7383[_0x74f6('0x2b')]:_0x167299[_0x74f6('0x27')];_0x1c7383[_0x74f6('0x2f')]=qs[_0x74f6('0x30')](_0x42f3c1[_0x74f6('0x28')]['sort']);_0x1c7383[_0x74f6('0x31')]=qs['filters'](_['pick'](_0x42f3c1[_0x74f6('0x28')],_0x167299[_0x74f6('0x33')]));if(_0x42f3c1[_0x74f6('0x28')][_0x74f6('0x34')]){_0x1c7383[_0x74f6('0x31')]=_[_0x74f6('0x35')](_0x1c7383[_0x74f6('0x31')],{'$or':_['map'](_0x1c7383[_0x74f6('0x2b')],function(_0x5c5349){var _0x6a3c2={};_0x6a3c2[_0x5c5349]={'$like':'%'+_0x42f3c1[_0x74f6('0x28')]['filter']+'%'};return _0x6a3c2;})});}_0x1c7383=_[_0x74f6('0x35')]({},_0x1c7383,_0x42f3c1[_0x74f6('0x3c')]);return _0x1d3eb8[_0x74f6('0x46')](_0x1c7383);}})[_0x74f6('0x1d')](function(_0x5a05e8){if(_0x5a05e8){_0x5bbed4=_0x5a05e8[_0x74f6('0x2d')];if(!_0x42f3c1[_0x74f6('0x28')][_0x74f6('0x2e')](_0x74f6('0x44'))){_0x1c7383[_0x74f6('0x15')]=qs['limit'](_0x42f3c1[_0x74f6('0x28')][_0x74f6('0x15')]);_0x1c7383[_0x74f6('0x18')]=qs['offset'](_0x42f3c1[_0x74f6('0x28')]['offset']);}return _0x1d3eb8[_0x74f6('0x46')](_0x1c7383);}})[_0x74f6('0x1d')](function(_0x406977){if(_0x406977){return _0x406977?{'count':_0x5bbed4,'rows':_0x406977}:null;}})[_0x74f6('0x1d')](respondWithResult(_0x175d30,null))[_0x74f6('0x3b')](handleError(_0x175d30,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 825562f..de35d87 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 _0x3b52=['FreshsalesConfiguration','int_freshsales_configurations','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x3b52,0x182));var _0x23b5=function(_0x4d7461,_0x247731){_0x4d7461=_0x4d7461-0x0;var _0x53ffe7=_0x3b52[_0x4d7461];return _0x53ffe7;};'use strict';var _=require(_0x23b5('0x0'));var util=require(_0x23b5('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x23b5('0x2'));var rp=require(_0x23b5('0x3'));var fs=require('fs');var path=require(_0x23b5('0x4'));var rimraf=require(_0x23b5('0x5'));var config=require(_0x23b5('0x6'));var attributes=require(_0x23b5('0x7'));module[_0x23b5('0x8')]=function(_0x5d5ead,_0x122d69){return _0x5d5ead[_0x23b5('0x9')](_0x23b5('0xa'),attributes,{'tableName':_0x23b5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9274=['../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x517ee8,_0x122802){var _0x44b743=function(_0x3b1fa9){while(--_0x3b1fa9){_0x517ee8['push'](_0x517ee8['shift']());}};_0x44b743(++_0x122802);}(_0x9274,0xae));var _0x4927=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9274[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x4927('0x0'));var logger=require(_0x4927('0x1'))(_0x4927('0x2'));var moment=require(_0x4927('0x3'));var BPromise=require(_0x4927('0x4'));var rp=require(_0x4927('0x5'));var fs=require('fs');var path=require(_0x4927('0x6'));var rimraf=require(_0x4927('0x7'));var config=require(_0x4927('0x8'));var attributes=require(_0x4927('0x9'));module[_0x4927('0xa')]=function(_0x5bfc2b,_0x1ee5ad){return _0x5bfc2b[_0x4927('0xb')](_0x4927('0xc'),attributes,{'tableName':_0x4927('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index bef34de..36235ea 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 _0x03fd=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','lodash','bluebird'];(function(_0x40f62c,_0x2970bf){var _0x387b88=function(_0x39b959){while(--_0x39b959){_0x40f62c['push'](_0x40f62c['shift']());}};_0x387b88(++_0x2970bf);}(_0x03fd,0x1b6));var _0xd03f=function(_0x22ca5e,_0x63f5c7){_0x22ca5e=_0x22ca5e-0x0;var _0x1ffb5d=_0x03fd[_0x22ca5e];return _0x1ffb5d;};'use strict';var _=require(_0xd03f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd03f('0x1'));var rs=require(_0xd03f('0x2'));var fs=require('fs');var Redis=require(_0xd03f('0x3'));var db=require(_0xd03f('0x4'))['db'];var utils=require(_0xd03f('0x5'));var logger=require(_0xd03f('0x6'))(_0xd03f('0x7'));var config=require('../../config/environment');var jayson=require(_0xd03f('0x8'));var client=jayson['client'][_0xd03f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24a1fe,_0x34ff04,_0x6aefa4){return new BPromise(function(_0x55dfbc,_0x227a81){return client[_0xd03f('0xa')](_0x24a1fe,_0x6aefa4)['then'](function(_0x559812){logger[_0xd03f('0xb')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x34ff04,_0xd03f('0xc'));logger[_0xd03f('0xd')](_0xd03f('0xe'),_0x34ff04,'request\x20sent',JSON[_0xd03f('0xf')](_0x559812));if(_0x559812[_0xd03f('0x10')]){if(_0x559812[_0xd03f('0x10')][_0xd03f('0x11')]===0x1f4){logger['error'](_0xd03f('0x12'),_0x34ff04,_0x559812[_0xd03f('0x10')][_0xd03f('0x13')]);return _0x227a81(_0x559812['error']['message']);}logger[_0xd03f('0x10')](_0xd03f('0x12'),_0x34ff04,_0x559812[_0xd03f('0x10')][_0xd03f('0x13')]);return _0x55dfbc(_0x559812[_0xd03f('0x10')][_0xd03f('0x13')]);}else{logger[_0xd03f('0xb')](_0xd03f('0x12'),_0x34ff04,_0xd03f('0xc'));_0x55dfbc(_0x559812[_0xd03f('0x14')][_0xd03f('0x13')]);}})[_0xd03f('0x15')](function(_0x264cf1){logger[_0xd03f('0x10')](_0xd03f('0x12'),_0x34ff04,_0x264cf1);_0x227a81(_0x264cf1);});});} \ No newline at end of file +var _0xba1a=['error','FreshsalesConfiguration,\x20%s,\x20%s','message','info','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x45a9ed,_0xe780b3){var _0x199551=function(_0x8301c3){while(--_0x8301c3){_0x45a9ed['push'](_0x45a9ed['shift']());}};_0x199551(++_0xe780b3);}(_0xba1a,0x83));var _0xaba1=function(_0x294bb6,_0x3ee66e){_0x294bb6=_0x294bb6-0x0;var _0x554eb2=_0xba1a[_0x294bb6];return _0x554eb2;};'use strict';var _=require('lodash');var util=require(_0xaba1('0x0'));var moment=require(_0xaba1('0x1'));var BPromise=require(_0xaba1('0x2'));var rs=require(_0xaba1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaba1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xaba1('0x5'))(_0xaba1('0x6'));var config=require(_0xaba1('0x7'));var jayson=require(_0xaba1('0x8'));var client=jayson[_0xaba1('0x9')][_0xaba1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x234599,_0xc97093,_0x2b6cb5){return new BPromise(function(_0x1513aa,_0x46fcb0){return client[_0xaba1('0xb')](_0x234599,_0x2b6cb5)['then'](function(_0x56c705){logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0xc97093,_0xaba1('0xc'));logger[_0xaba1('0xd')](_0xaba1('0xe'),_0xc97093,'request\x20sent',JSON[_0xaba1('0xf')](_0x56c705));if(_0x56c705[_0xaba1('0x10')]){if(_0x56c705[_0xaba1('0x10')]['code']===0x1f4){logger[_0xaba1('0x10')](_0xaba1('0x11'),_0xc97093,_0x56c705[_0xaba1('0x10')]['message']);return _0x46fcb0(_0x56c705[_0xaba1('0x10')][_0xaba1('0x12')]);}logger[_0xaba1('0x10')](_0xaba1('0x11'),_0xc97093,_0x56c705[_0xaba1('0x10')][_0xaba1('0x12')]);return _0x1513aa(_0x56c705[_0xaba1('0x10')][_0xaba1('0x12')]);}else{logger[_0xaba1('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0xc97093,_0xaba1('0xc'));_0x1513aa(_0x56c705[_0xaba1('0x14')]['message']);}})['catch'](function(_0x5bd212){logger['error'](_0xaba1('0x11'),_0xc97093,_0x5bd212);_0x46fcb0(_0x5bd212);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 7ea6af9..26524c6 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 _0x25ad=['get','/:id','show','post','isAuthenticated','create','put','delete','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x25ad,0x1b1));var _0xd25a=function(_0x511a19,_0x417e36){_0x511a19=_0x511a19-0x0;var _0x499aa6=_0x25ad[_0x511a19];return _0x499aa6;};'use strict';var multer=require(_0xd25a('0x0'));var util=require('util');var path=require(_0xd25a('0x1'));var timeout=require(_0xd25a('0x2'));var express=require(_0xd25a('0x3'));var router=express['Router']();var fs_extra=require(_0xd25a('0x4'));var auth=require(_0xd25a('0x5'));var interaction=require(_0xd25a('0x6'));var config=require(_0xd25a('0x7'));var controller=require(_0xd25a('0x8'));router[_0xd25a('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd25a('0x9')](_0xd25a('0xa'),auth['isAuthenticated'](),controller[_0xd25a('0xb')]);router[_0xd25a('0xc')]('/',auth[_0xd25a('0xd')](),controller[_0xd25a('0xe')]);router[_0xd25a('0xf')](_0xd25a('0xa'),auth[_0xd25a('0xd')](),controller['update']);router[_0xd25a('0x10')]('/:id',auth[_0xd25a('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0e35=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','create','put'];(function(_0x1e9a15,_0x814bf0){var _0x5675d2=function(_0x3d5b3a){while(--_0x3d5b3a){_0x1e9a15['push'](_0x1e9a15['shift']());}};_0x5675d2(++_0x814bf0);}(_0x0e35,0xc2));var _0x50e3=function(_0x3633aa,_0x5d04da){_0x3633aa=_0x3633aa-0x0;var _0x4a4ea7=_0x0e35[_0x3633aa];return _0x4a4ea7;};'use strict';var multer=require(_0x50e3('0x0'));var util=require(_0x50e3('0x1'));var path=require(_0x50e3('0x2'));var timeout=require(_0x50e3('0x3'));var express=require(_0x50e3('0x4'));var router=express[_0x50e3('0x5')]();var fs_extra=require(_0x50e3('0x6'));var auth=require(_0x50e3('0x7'));var interaction=require(_0x50e3('0x8'));var config=require(_0x50e3('0x9'));var controller=require('./intFreshsalesField.controller');router[_0x50e3('0xa')]('/',auth[_0x50e3('0xb')](),controller['index']);router['get'](_0x50e3('0xc'),auth[_0x50e3('0xb')](),controller['show']);router['post']('/',auth[_0x50e3('0xb')](),controller[_0x50e3('0xd')]);router[_0x50e3('0xe')](_0x50e3('0xc'),auth[_0x50e3('0xb')](),controller[_0x50e3('0xf')]);router[_0x50e3('0x10')](_0x50e3('0xc'),auth[_0x50e3('0xb')](),controller[_0x50e3('0x11')]);module[_0x50e3('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 331f204..ce49b6f 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 _0x46cf=['STRING','string','customVariable','BOOLEAN','sequelize','ENUM','variable','keyValue','picklist'];(function(_0x326c47,_0x8dca2){var _0x564786=function(_0x276e63){while(--_0x276e63){_0x326c47['push'](_0x326c47['shift']());}};_0x564786(++_0x8dca2);}(_0x46cf,0x1c6));var _0xf46c=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x46cf[_0x4792c8];return _0x35edb1;};'use strict';var Sequelize=require(_0xf46c('0x0'));module['exports']={'type':{'type':Sequelize[_0xf46c('0x1')]('string',_0xf46c('0x2'),'customVariable',_0xf46c('0x3'),_0xf46c('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf46c('0x5')]},'key':{'type':Sequelize[_0xf46c('0x5')]},'keyType':{'type':Sequelize[_0xf46c('0x1')](_0xf46c('0x6'),_0xf46c('0x2'),_0xf46c('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf46c('0x5')]},'nameField':{'type':Sequelize[_0xf46c('0x5')]},'customField':{'type':Sequelize[_0xf46c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf46c('0x5')]}}; \ No newline at end of file +var _0x5a60=['sequelize','exports','ENUM','variable','customVariable','picklist','string','STRING','BOOLEAN'];(function(_0x476958,_0x125272){var _0x23bdac=function(_0x155668){while(--_0x155668){_0x476958['push'](_0x476958['shift']());}};_0x23bdac(++_0x125272);}(_0x5a60,0x7e));var _0x05a6=function(_0x8e37e4,_0x2eb976){_0x8e37e4=_0x8e37e4-0x0;var _0x4aff4e=_0x5a60[_0x8e37e4];return _0x4aff4e;};'use strict';var Sequelize=require(_0x05a6('0x0'));module[_0x05a6('0x1')]={'type':{'type':Sequelize[_0x05a6('0x2')]('string',_0x05a6('0x3'),_0x05a6('0x4'),'keyValue',_0x05a6('0x5')),'defaultValue':_0x05a6('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x05a6('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x05a6('0x6'),_0x05a6('0x3'),_0x05a6('0x4'))},'keyContent':{'type':Sequelize[_0x05a6('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x05a6('0x7')]},'customField':{'type':Sequelize[_0x05a6('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 57f373d..31b1d22 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 _0x91e8=['undefined','limit','offset','set','Content-Range','save','update','then','destroy','error','stack','name','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','show','keys','find','catch','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json'];(function(_0x4ee89a,_0x56d642){var _0x42aca9=function(_0xa1f425){while(--_0xa1f425){_0x4ee89a['push'](_0x4ee89a['shift']());}};_0x42aca9(++_0x56d642);}(_0x91e8,0x7e));var _0x891e=function(_0x292d98,_0x519399){_0x292d98=_0x292d98-0x0;var _0x243bb3=_0x91e8[_0x292d98];return _0x243bb3;};'use strict';var emlformat=require(_0x891e('0x0'));var rimraf=require(_0x891e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x891e('0x2'));var rp=require(_0x891e('0x3'));var moment=require(_0x891e('0x4'));var BPromise=require(_0x891e('0x5'));var Mustache=require(_0x891e('0x6'));var util=require('util');var path=require(_0x891e('0x7'));var sox=require(_0x891e('0x8'));var csv=require(_0x891e('0x9'));var ejs=require(_0x891e('0xa'));var fs=require('fs');var fs_extra=require(_0x891e('0xb'));var _=require('lodash');var squel=require(_0x891e('0xc'));var crypto=require(_0x891e('0xd'));var jsforce=require(_0x891e('0xe'));var deskjs=require(_0x891e('0xf'));var toCsv=require(_0x891e('0x9'));var querystring=require(_0x891e('0x10'));var Papa=require(_0x891e('0x11'));var Redis=require(_0x891e('0x12'));var authService=require(_0x891e('0x13'));var qs=require(_0x891e('0x14'));var as=require(_0x891e('0x15'));var hardwareService=require(_0x891e('0x16'));var logger=require(_0x891e('0x17'))(_0x891e('0x18'));var utils=require(_0x891e('0x19'));var config=require(_0x891e('0x1a'));var licenseUtil=require(_0x891e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c6764,_0x263f04){_0x263f04=_0x263f04||0xcc;return function(_0x1b2682){if(_0x1b2682){return _0x4c6764[_0x891e('0x1c')](_0x263f04);}return _0x4c6764[_0x891e('0x1d')](_0x263f04)[_0x891e('0x1e')]();};}function respondWithResult(_0x33a60f,_0xe2a474){_0xe2a474=_0xe2a474||0xc8;return function(_0x5bf246){if(_0x5bf246){return _0x33a60f[_0x891e('0x1d')](_0xe2a474)[_0x891e('0x1f')](_0x5bf246);}};}function respondWithFilteredResult(_0x3c1d6c,_0x5de6ee){return function(_0xeebd65){if(_0xeebd65){var _0x543827=typeof _0x5de6ee['offset']===_0x891e('0x20')&&typeof _0x5de6ee[_0x891e('0x21')]===_0x891e('0x20');var _0x351723=_0xeebd65['count'];var _0x57ff75=_0x543827?0x0:_0x5de6ee[_0x891e('0x22')];var _0x334486=_0x543827?_0xeebd65['count']:_0x5de6ee[_0x891e('0x22')]+_0x5de6ee[_0x891e('0x21')];var _0x1cf15c;if(_0x334486>=_0x351723){_0x334486=_0x351723;_0x1cf15c=0xc8;}else{_0x1cf15c=0xce;}_0x3c1d6c['status'](_0x1cf15c);return _0x3c1d6c[_0x891e('0x23')](_0x891e('0x24'),_0x57ff75+'-'+_0x334486+'/'+_0x351723)[_0x891e('0x1f')](_0xeebd65);}return null;};}function patchUpdates(_0x241524){return function(_0x24234e){try{jsonpatch['apply'](_0x24234e,_0x241524,!![]);}catch(_0x281038){return BPromise['reject'](_0x281038);}return _0x24234e[_0x891e('0x25')]();};}function saveUpdates(_0x33a4a1,_0x409e62){return function(_0x1533ad){if(_0x1533ad){return _0x1533ad[_0x891e('0x26')](_0x33a4a1)[_0x891e('0x27')](function(_0x1089fa){return _0x1089fa;});}return null;};}function removeEntity(_0x43b659,_0x1b605b){return function(_0x4ff531){if(_0x4ff531){return _0x4ff531[_0x891e('0x28')]()['then'](function(){_0x43b659['status'](0xcc)[_0x891e('0x1e')]();});}};}function handleEntityNotFound(_0x21f73b,_0x3938c9){return function(_0xfddef){if(!_0xfddef){_0x21f73b[_0x891e('0x1c')](0x194);}return _0xfddef;};}function handleError(_0x14697e,_0x519499){_0x519499=_0x519499||0x1f4;return function(_0x5d5a13){logger[_0x891e('0x29')](_0x5d5a13[_0x891e('0x2a')]);if(_0x5d5a13['name']){delete _0x5d5a13[_0x891e('0x2b')];}_0x14697e[_0x891e('0x1d')](_0x519499)['send'](_0x5d5a13);};}exports[_0x891e('0x2c')]=function(_0x5ed1a5,_0x3d7be8){var _0x3e06f1={},_0x2be91b={},_0x1a5753={'count':0x0,'rows':[]};var _0x55664b=_[_0x891e('0x2d')](db[_0x891e('0x2e')][_0x891e('0x2f')],function(_0x1fdba6){return{'name':_0x1fdba6[_0x891e('0x30')],'type':_0x1fdba6[_0x891e('0x31')][_0x891e('0x32')]};});_0x2be91b[_0x891e('0x33')]=_['map'](_0x55664b,_0x891e('0x2b'));_0x2be91b[_0x891e('0x34')]=_['keys'](_0x5ed1a5[_0x891e('0x34')]);_0x2be91b[_0x891e('0x35')]=_[_0x891e('0x36')](_0x2be91b[_0x891e('0x33')],_0x2be91b[_0x891e('0x34')]);_0x3e06f1[_0x891e('0x37')]=_[_0x891e('0x36')](_0x2be91b[_0x891e('0x33')],qs[_0x891e('0x38')](_0x5ed1a5[_0x891e('0x34')][_0x891e('0x38')]));_0x3e06f1[_0x891e('0x37')]=_0x3e06f1['attributes'][_0x891e('0x39')]?_0x3e06f1[_0x891e('0x37')]:_0x2be91b[_0x891e('0x33')];if(!_0x5ed1a5['query'][_0x891e('0x3a')](_0x891e('0x3b'))){_0x3e06f1[_0x891e('0x21')]=qs[_0x891e('0x21')](_0x5ed1a5[_0x891e('0x34')][_0x891e('0x21')]);_0x3e06f1[_0x891e('0x22')]=qs['offset'](_0x5ed1a5[_0x891e('0x34')][_0x891e('0x22')]);}_0x3e06f1[_0x891e('0x3c')]=qs['sort'](_0x5ed1a5[_0x891e('0x34')][_0x891e('0x3d')]);_0x3e06f1[_0x891e('0x3e')]=qs[_0x891e('0x35')](_[_0x891e('0x3f')](_0x5ed1a5['query'],_0x2be91b[_0x891e('0x35')]),_0x55664b);if(_0x5ed1a5[_0x891e('0x34')][_0x891e('0x40')]){_0x3e06f1[_0x891e('0x3e')]=_[_0x891e('0x41')](_0x3e06f1[_0x891e('0x3e')],{'$or':_[_0x891e('0x2d')](_0x55664b,function(_0x34dfb0){if(_0x34dfb0['type']!=='VIRTUAL'){var _0x42473d={};_0x42473d[_0x34dfb0[_0x891e('0x2b')]]={'$like':'%'+_0x5ed1a5[_0x891e('0x34')][_0x891e('0x40')]+'%'};return _0x42473d;}})});}_0x3e06f1=_[_0x891e('0x41')]({},_0x3e06f1,_0x5ed1a5[_0x891e('0x42')]);var _0x5b3de2={'where':_0x3e06f1[_0x891e('0x3e')]};return db[_0x891e('0x2e')][_0x891e('0x43')](_0x5b3de2)[_0x891e('0x27')](function(_0x325d60){_0x1a5753['count']=_0x325d60;if(_0x5ed1a5[_0x891e('0x34')][_0x891e('0x44')]){_0x3e06f1[_0x891e('0x45')]=[{'all':!![]}];}return db[_0x891e('0x2e')][_0x891e('0x46')](_0x3e06f1);})[_0x891e('0x27')](function(_0x6e3e59){_0x1a5753[_0x891e('0x47')]=_0x6e3e59;return _0x1a5753;})[_0x891e('0x27')](respondWithFilteredResult(_0x3d7be8,_0x3e06f1))['catch'](handleError(_0x3d7be8,null));};exports[_0x891e('0x48')]=function(_0x419bb0,_0x149c25){var _0x16f1bd={'raw':!![],'where':{'id':_0x419bb0['params']['id']}},_0x521518={};_0x521518[_0x891e('0x33')]=_[_0x891e('0x49')](db[_0x891e('0x2e')][_0x891e('0x2f')]);_0x521518[_0x891e('0x34')]=_[_0x891e('0x49')](_0x419bb0['query']);_0x521518['filters']=_[_0x891e('0x36')](_0x521518[_0x891e('0x33')],_0x521518[_0x891e('0x34')]);_0x16f1bd[_0x891e('0x37')]=_['intersection'](_0x521518['model'],qs[_0x891e('0x38')](_0x419bb0[_0x891e('0x34')]['fields']));_0x16f1bd[_0x891e('0x37')]=_0x16f1bd[_0x891e('0x37')]['length']?_0x16f1bd['attributes']:_0x521518['model'];if(_0x419bb0['query'][_0x891e('0x44')]){_0x16f1bd[_0x891e('0x45')]=[{'all':!![]}];}_0x16f1bd=_[_0x891e('0x41')]({},_0x16f1bd,_0x419bb0[_0x891e('0x42')]);return db[_0x891e('0x2e')][_0x891e('0x4a')](_0x16f1bd)['then'](handleEntityNotFound(_0x149c25,null))[_0x891e('0x27')](respondWithResult(_0x149c25,null))[_0x891e('0x4b')](handleError(_0x149c25,null));};exports[_0x891e('0x4c')]=function(_0x50b444,_0x222be3){return db['FreshsalesField'][_0x891e('0x4c')](_0x50b444[_0x891e('0x4d')],{})['then'](respondWithResult(_0x222be3,0xc9))[_0x891e('0x4b')](handleError(_0x222be3,null));};exports['update']=function(_0x3e2024,_0x576bce){if(_0x3e2024[_0x891e('0x4d')]['id']){delete _0x3e2024[_0x891e('0x4d')]['id'];}return db[_0x891e('0x2e')][_0x891e('0x4a')]({'where':{'id':_0x3e2024[_0x891e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x576bce,null))[_0x891e('0x27')](saveUpdates(_0x3e2024['body'],null))['then'](respondWithResult(_0x576bce,null))[_0x891e('0x4b')](handleError(_0x576bce,null));};exports[_0x891e('0x28')]=function(_0x19dba,_0x121a28){return db[_0x891e('0x2e')][_0x891e('0x4a')]({'where':{'id':_0x19dba[_0x891e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x121a28,null))['then'](removeEntity(_0x121a28,null))[_0x891e('0x4b')](handleError(_0x121a28,null));}; \ No newline at end of file +var _0x060f=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','error','stack','name','send','map','FreshsalesField','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','includeAll','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x138c7f,_0x558d0e){var _0x44d765=function(_0xfee3c6){while(--_0xfee3c6){_0x138c7f['push'](_0x138c7f['shift']());}};_0x44d765(++_0x558d0e);}(_0x060f,0x110));var _0xf060=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x060f[_0x710815];return _0x5b3b89;};'use strict';var emlformat=require(_0xf060('0x0'));var rimraf=require(_0xf060('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf060('0x2'));var rp=require(_0xf060('0x3'));var moment=require(_0xf060('0x4'));var BPromise=require(_0xf060('0x5'));var Mustache=require(_0xf060('0x6'));var util=require(_0xf060('0x7'));var path=require('path');var sox=require(_0xf060('0x8'));var csv=require('to-csv');var ejs=require(_0xf060('0x9'));var fs=require('fs');var fs_extra=require(_0xf060('0xa'));var _=require('lodash');var squel=require(_0xf060('0xb'));var crypto=require(_0xf060('0xc'));var jsforce=require(_0xf060('0xd'));var deskjs=require(_0xf060('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf060('0xf'));var Papa=require('papaparse');var Redis=require(_0xf060('0x10'));var authService=require(_0xf060('0x11'));var qs=require(_0xf060('0x12'));var as=require(_0xf060('0x13'));var hardwareService=require(_0xf060('0x14'));var logger=require(_0xf060('0x15'))(_0xf060('0x16'));var utils=require(_0xf060('0x17'));var config=require(_0xf060('0x18'));var licenseUtil=require(_0xf060('0x19'));var db=require(_0xf060('0x1a'))['db'];function respondWithStatusCode(_0x4e6223,_0x16c28a){_0x16c28a=_0x16c28a||0xcc;return function(_0x24ca07){if(_0x24ca07){return _0x4e6223[_0xf060('0x1b')](_0x16c28a);}return _0x4e6223[_0xf060('0x1c')](_0x16c28a)[_0xf060('0x1d')]();};}function respondWithResult(_0x439905,_0x3b2fd7){_0x3b2fd7=_0x3b2fd7||0xc8;return function(_0x47ee07){if(_0x47ee07){return _0x439905[_0xf060('0x1c')](_0x3b2fd7)[_0xf060('0x1e')](_0x47ee07);}};}function respondWithFilteredResult(_0x2c1727,_0x116436){return function(_0x33f56c){if(_0x33f56c){var _0x47d18d=typeof _0x116436[_0xf060('0x1f')]==='undefined'&&typeof _0x116436[_0xf060('0x20')]===_0xf060('0x21');var _0x3bd0f3=_0x33f56c[_0xf060('0x22')];var _0x2b2d84=_0x47d18d?0x0:_0x116436[_0xf060('0x1f')];var _0x345cfb=_0x47d18d?_0x33f56c[_0xf060('0x22')]:_0x116436[_0xf060('0x1f')]+_0x116436[_0xf060('0x20')];var _0x250260;if(_0x345cfb>=_0x3bd0f3){_0x345cfb=_0x3bd0f3;_0x250260=0xc8;}else{_0x250260=0xce;}_0x2c1727['status'](_0x250260);return _0x2c1727['set'](_0xf060('0x23'),_0x2b2d84+'-'+_0x345cfb+'/'+_0x3bd0f3)['json'](_0x33f56c);}return null;};}function patchUpdates(_0x17f2ad){return function(_0x320087){try{jsonpatch[_0xf060('0x24')](_0x320087,_0x17f2ad,!![]);}catch(_0x21a0ca){return BPromise['reject'](_0x21a0ca);}return _0x320087[_0xf060('0x25')]();};}function saveUpdates(_0x48f6df,_0x4f86fc){return function(_0x1f35c7){if(_0x1f35c7){return _0x1f35c7[_0xf060('0x26')](_0x48f6df)['then'](function(_0x2425e4){return _0x2425e4;});}return null;};}function removeEntity(_0x414558,_0x5351bc){return function(_0x3379ae){if(_0x3379ae){return _0x3379ae['destroy']()[_0xf060('0x27')](function(){_0x414558[_0xf060('0x1c')](0xcc)[_0xf060('0x1d')]();});}};}function handleEntityNotFound(_0x46c252,_0x4b50ed){return function(_0xadd4da){if(!_0xadd4da){_0x46c252[_0xf060('0x1b')](0x194);}return _0xadd4da;};}function handleError(_0x1a36ba,_0x1b50df){_0x1b50df=_0x1b50df||0x1f4;return function(_0x52b60e){logger[_0xf060('0x28')](_0x52b60e[_0xf060('0x29')]);if(_0x52b60e[_0xf060('0x2a')]){delete _0x52b60e[_0xf060('0x2a')];}_0x1a36ba[_0xf060('0x1c')](_0x1b50df)[_0xf060('0x2b')](_0x52b60e);};}exports['index']=function(_0x5919e7,_0x21c200){var _0x3f7518={},_0x59ea72={},_0x4600e7={'count':0x0,'rows':[]};var _0xa85d5b=_[_0xf060('0x2c')](db[_0xf060('0x2d')][_0xf060('0x2e')],function(_0x33649f){return{'name':_0x33649f[_0xf060('0x2f')],'type':_0x33649f[_0xf060('0x30')][_0xf060('0x31')]};});_0x59ea72['model']=_[_0xf060('0x2c')](_0xa85d5b,_0xf060('0x2a'));_0x59ea72[_0xf060('0x32')]=_['keys'](_0x5919e7[_0xf060('0x32')]);_0x59ea72[_0xf060('0x33')]=_[_0xf060('0x34')](_0x59ea72[_0xf060('0x35')],_0x59ea72[_0xf060('0x32')]);_0x3f7518['attributes']=_[_0xf060('0x34')](_0x59ea72[_0xf060('0x35')],qs[_0xf060('0x36')](_0x5919e7[_0xf060('0x32')][_0xf060('0x36')]));_0x3f7518[_0xf060('0x37')]=_0x3f7518[_0xf060('0x37')]['length']?_0x3f7518[_0xf060('0x37')]:_0x59ea72['model'];if(!_0x5919e7[_0xf060('0x32')]['hasOwnProperty']('nolimit')){_0x3f7518['limit']=qs[_0xf060('0x20')](_0x5919e7['query'][_0xf060('0x20')]);_0x3f7518[_0xf060('0x1f')]=qs[_0xf060('0x1f')](_0x5919e7['query']['offset']);}_0x3f7518[_0xf060('0x38')]=qs[_0xf060('0x39')](_0x5919e7['query'][_0xf060('0x39')]);_0x3f7518[_0xf060('0x3a')]=qs[_0xf060('0x33')](_['pick'](_0x5919e7['query'],_0x59ea72['filters']),_0xa85d5b);if(_0x5919e7[_0xf060('0x32')][_0xf060('0x3b')]){_0x3f7518[_0xf060('0x3a')]=_[_0xf060('0x3c')](_0x3f7518[_0xf060('0x3a')],{'$or':_['map'](_0xa85d5b,function(_0x22414b){if(_0x22414b['type']!==_0xf060('0x3d')){var _0x215543={};_0x215543[_0x22414b[_0xf060('0x2a')]]={'$like':'%'+_0x5919e7['query'][_0xf060('0x3b')]+'%'};return _0x215543;}})});}_0x3f7518=_['merge']({},_0x3f7518,_0x5919e7[_0xf060('0x3e')]);var _0x3a1597={'where':_0x3f7518[_0xf060('0x3a')]};return db['FreshsalesField'][_0xf060('0x22')](_0x3a1597)['then'](function(_0x31c49c){_0x4600e7[_0xf060('0x22')]=_0x31c49c;if(_0x5919e7['query']['includeAll']){_0x3f7518[_0xf060('0x3f')]=[{'all':!![]}];}return db[_0xf060('0x2d')][_0xf060('0x40')](_0x3f7518);})[_0xf060('0x27')](function(_0xec0cb1){_0x4600e7[_0xf060('0x41')]=_0xec0cb1;return _0x4600e7;})[_0xf060('0x27')](respondWithFilteredResult(_0x21c200,_0x3f7518))[_0xf060('0x42')](handleError(_0x21c200,null));};exports[_0xf060('0x43')]=function(_0x1e4dda,_0x3d7032){var _0x423fd6={'raw':!![],'where':{'id':_0x1e4dda['params']['id']}},_0x3eff1c={};_0x3eff1c[_0xf060('0x35')]=_[_0xf060('0x44')](db[_0xf060('0x2d')][_0xf060('0x2e')]);_0x3eff1c[_0xf060('0x32')]=_[_0xf060('0x44')](_0x1e4dda['query']);_0x3eff1c['filters']=_['intersection'](_0x3eff1c[_0xf060('0x35')],_0x3eff1c[_0xf060('0x32')]);_0x423fd6[_0xf060('0x37')]=_[_0xf060('0x34')](_0x3eff1c[_0xf060('0x35')],qs[_0xf060('0x36')](_0x1e4dda['query'][_0xf060('0x36')]));_0x423fd6['attributes']=_0x423fd6['attributes']['length']?_0x423fd6[_0xf060('0x37')]:_0x3eff1c[_0xf060('0x35')];if(_0x1e4dda['query'][_0xf060('0x45')]){_0x423fd6[_0xf060('0x3f')]=[{'all':!![]}];}_0x423fd6=_[_0xf060('0x3c')]({},_0x423fd6,_0x1e4dda['options']);return db[_0xf060('0x2d')][_0xf060('0x46')](_0x423fd6)[_0xf060('0x27')](handleEntityNotFound(_0x3d7032,null))['then'](respondWithResult(_0x3d7032,null))[_0xf060('0x42')](handleError(_0x3d7032,null));};exports[_0xf060('0x47')]=function(_0x392dbe,_0x9d0481){return db['FreshsalesField'][_0xf060('0x47')](_0x392dbe[_0xf060('0x48')],{})[_0xf060('0x27')](respondWithResult(_0x9d0481,0xc9))[_0xf060('0x42')](handleError(_0x9d0481,null));};exports['update']=function(_0x4b42c0,_0x40b65e){if(_0x4b42c0[_0xf060('0x48')]['id']){delete _0x4b42c0[_0xf060('0x48')]['id'];}return db['FreshsalesField'][_0xf060('0x46')]({'where':{'id':_0x4b42c0[_0xf060('0x49')]['id']}})[_0xf060('0x27')](handleEntityNotFound(_0x40b65e,null))['then'](saveUpdates(_0x4b42c0[_0xf060('0x48')],null))['then'](respondWithResult(_0x40b65e,null))[_0xf060('0x42')](handleError(_0x40b65e,null));};exports['destroy']=function(_0x2ebd63,_0x12061a){return db[_0xf060('0x2d')][_0xf060('0x46')]({'where':{'id':_0x2ebd63[_0xf060('0x49')]['id']}})[_0xf060('0x27')](handleEntityNotFound(_0x12061a,null))['then'](removeEntity(_0x12061a,null))[_0xf060('0x42')](handleError(_0x12061a,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index e79383c..a9b0eec 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 _0x7031=['../../config/environment','./intFreshsalesField.attributes','define','FreshsalesField','int_freshsales_fields','idField','FieldId','lodash','util','api','moment','request-promise','path'];(function(_0x32dc62,_0xb7f67c){var _0x307f88=function(_0x4ef903){while(--_0x4ef903){_0x32dc62['push'](_0x32dc62['shift']());}};_0x307f88(++_0xb7f67c);}(_0x7031,0x19a));var _0x1703=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0x7031[_0x119d5a];return _0x15bff4;};'use strict';var _=require(_0x1703('0x0'));var util=require(_0x1703('0x1'));var logger=require('../../config/logger')(_0x1703('0x2'));var moment=require(_0x1703('0x3'));var BPromise=require('bluebird');var rp=require(_0x1703('0x4'));var fs=require('fs');var path=require(_0x1703('0x5'));var rimraf=require('rimraf');var config=require(_0x1703('0x6'));var attributes=require(_0x1703('0x7'));module['exports']=function(_0x9222f3,_0x5a31df){return _0x9222f3[_0x1703('0x8')](_0x1703('0x9'),attributes,{'tableName':_0x1703('0xa'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x1703('0xb'),_0x1703('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0c2b=['api','moment','bluebird','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','idField','FieldId','lodash','util'];(function(_0x3a1901,_0x389e90){var _0x2f15f6=function(_0x458586){while(--_0x458586){_0x3a1901['push'](_0x3a1901['shift']());}};_0x2f15f6(++_0x389e90);}(_0x0c2b,0x194));var _0xb0c2=function(_0x15744f,_0x2807b1){_0x15744f=_0x15744f-0x0;var _0x31caeb=_0x0c2b[_0x15744f];return _0x31caeb;};'use strict';var _=require(_0xb0c2('0x0'));var util=require(_0xb0c2('0x1'));var logger=require('../../config/logger')(_0xb0c2('0x2'));var moment=require(_0xb0c2('0x3'));var BPromise=require(_0xb0c2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb0c2('0x5'));var config=require(_0xb0c2('0x6'));var attributes=require(_0xb0c2('0x7'));module[_0xb0c2('0x8')]=function(_0x1ba842,_0x5f102a){return _0x1ba842[_0xb0c2('0x9')](_0xb0c2('0xa'),attributes,{'tableName':_0xb0c2('0xb'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xb0c2('0xc'),_0xb0c2('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index f5215e9..ccda218 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 _0xdbf5=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesField,\x20%s,\x20%s','debug','stringify','code','error','message','request\x20sent','result','catch'];(function(_0x180e38,_0x40c450){var _0x1eb2f8=function(_0x475c16){while(--_0x475c16){_0x180e38['push'](_0x180e38['shift']());}};_0x1eb2f8(++_0x40c450);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x6e29a2,_0x53e707){_0x6e29a2=_0x6e29a2-0x0;var _0x3ec16d=_0xdbf5[_0x6e29a2];return _0x3ec16d;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5dbf('0x1'));var fs=require('fs');var Redis=require(_0x5dbf('0x2'));var db=require(_0x5dbf('0x3'))['db'];var utils=require(_0x5dbf('0x4'));var logger=require(_0x5dbf('0x5'))(_0x5dbf('0x6'));var config=require(_0x5dbf('0x7'));var jayson=require(_0x5dbf('0x8'));var client=jayson[_0x5dbf('0x9')][_0x5dbf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x209b7d,_0x88128e,_0x93e657){return new BPromise(function(_0x52b039,_0x134810){return client['request'](_0x209b7d,_0x93e657)[_0x5dbf('0xb')](function(_0x3bec50){logger[_0x5dbf('0xc')](_0x5dbf('0xd'),_0x88128e,'request\x20sent');logger[_0x5dbf('0xe')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x88128e,'request\x20sent',JSON[_0x5dbf('0xf')](_0x3bec50));if(_0x3bec50['error']){if(_0x3bec50['error'][_0x5dbf('0x10')]===0x1f4){logger['error'](_0x5dbf('0xd'),_0x88128e,_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);return _0x134810(_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);}logger['error']('FreshsalesField,\x20%s,\x20%s',_0x88128e,_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);return _0x52b039(_0x3bec50['error'][_0x5dbf('0x12')]);}else{logger[_0x5dbf('0xc')](_0x5dbf('0xd'),_0x88128e,_0x5dbf('0x13'));_0x52b039(_0x3bec50[_0x5dbf('0x14')][_0x5dbf('0x12')]);}})[_0x5dbf('0x15')](function(_0x50ef1d){logger['error'](_0x5dbf('0xd'),_0x88128e,_0x50ef1d);_0x134810(_0x50ef1d);});});} \ No newline at end of file +var _0x31f0=['../../config/environment','request','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x4d29eb,_0x5ba766){var _0x53cadb=function(_0x121326){while(--_0x121326){_0x4d29eb['push'](_0x4d29eb['shift']());}};_0x53cadb(++_0x5ba766);}(_0x31f0,0xb7));var _0x031f=function(_0x123a77,_0x244020){_0x123a77=_0x123a77-0x0;var _0x361309=_0x31f0[_0x123a77];return _0x361309;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var moment=require(_0x031f('0x1'));var BPromise=require('bluebird');var rs=require(_0x031f('0x2'));var fs=require('fs');var Redis=require(_0x031f('0x3'));var db=require(_0x031f('0x4'))['db'];var utils=require(_0x031f('0x5'));var logger=require('../../config/logger')(_0x031f('0x6'));var config=require(_0x031f('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3dc98e,_0x487e65,_0x365f59){return new BPromise(function(_0x4300b4,_0x2569b6){return client[_0x031f('0x8')](_0x3dc98e,_0x365f59)['then'](function(_0x2e5624){logger[_0x031f('0x9')](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));logger[_0x031f('0xc')](_0x031f('0xd'),_0x487e65,_0x031f('0xb'),JSON[_0x031f('0xe')](_0x2e5624));if(_0x2e5624['error']){if(_0x2e5624[_0x031f('0xf')][_0x031f('0x10')]===0x1f4){logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x2569b6(_0x2e5624[_0x031f('0xf')]['message']);}logger[_0x031f('0xf')](_0x031f('0xa'),_0x487e65,_0x2e5624[_0x031f('0xf')][_0x031f('0x11')]);return _0x4300b4(_0x2e5624[_0x031f('0xf')]['message']);}else{logger['info'](_0x031f('0xa'),_0x487e65,_0x031f('0xb'));_0x4300b4(_0x2e5624[_0x031f('0x12')][_0x031f('0x11')]);}})['catch'](function(_0x1dc4a7){logger[_0x031f('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x487e65,_0x1dc4a7);_0x2569b6(_0x1dc4a7);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 0acfb0e..f543294 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(_0xdd614e,_0x193e07){var _0x342c26=function(_0xc3297f){while(--_0xc3297f){_0xdd614e['push'](_0xdd614e['shift']());}};_0x342c26(++_0x193e07);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2e01cc,_0x3fe3ea){var _0x5db438=function(_0x5ad91a){while(--_0x5ad91a){_0x2e01cc['push'](_0x2e01cc['shift']());}};_0x5db438(++_0x3fe3ea);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index d5cb960..0028844 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 _0x707b=['exports','STRING','integrationTab','sequelize'];(function(_0x4bcfa6,_0x1c7e43){var _0x1c0165=function(_0x30c963){while(--_0x30c963){_0x4bcfa6['push'](_0x4bcfa6['shift']());}};_0x1c0165(++_0x1c7e43);}(_0x707b,0xdf));var _0xb707=function(_0xd60cb,_0x25496e){_0xd60cb=_0xd60cb-0x0;var _0x47eecd=_0x707b[_0xd60cb];return _0x47eecd;};'use strict';var Sequelize=require(_0xb707('0x0'));module[_0xb707('0x1')]={'name':{'type':Sequelize[_0xb707('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xb707('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xb707('0x2')]},'clientId':{'type':Sequelize[_0xb707('0x2')]},'clientSecret':{'type':Sequelize[_0xb707('0x2')]},'securityToken':{'type':Sequelize[_0xb707('0x2')]},'serverUrl':{'type':Sequelize[_0xb707('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab','newTab'),'defaultValue':_0xb707('0x3')}}; \ No newline at end of file +var _0xb03e=['STRING','username','ENUM','newTab','integrationTab','exports'];(function(_0x592fe4,_0xa3d75d){var _0x48b30c=function(_0x4a29da){while(--_0x4a29da){_0x592fe4['push'](_0x592fe4['shift']());}};_0x48b30c(++_0xa3d75d);}(_0xb03e,0x1eb));var _0xeb03=function(_0x477c73,_0x30bd20){_0x477c73=_0x477c73-0x0;var _0x123a67=_0xb03e[_0x477c73];return _0x123a67;};'use strict';var Sequelize=require('sequelize');module[_0xeb03('0x0')]={'name':{'type':Sequelize[_0xeb03('0x1')]},'description':{'type':Sequelize[_0xeb03('0x1')]},'username':{'type':Sequelize[_0xeb03('0x1')],'unique':_0xeb03('0x2')},'remoteUri':{'type':Sequelize[_0xeb03('0x1')]},'password':{'type':Sequelize[_0xeb03('0x1')]},'clientId':{'type':Sequelize[_0xeb03('0x1')]},'clientSecret':{'type':Sequelize[_0xeb03('0x1')]},'securityToken':{'type':Sequelize[_0xeb03('0x1')]},'serverUrl':{'type':Sequelize[_0xeb03('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xeb03('0x3')]('integrationTab',_0xeb03('0x4')),'defaultValue':_0xeb03('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 1876f3a..a5b1608 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 _0x147b=['picklistValues','value','True','False','false','test','error','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','save','update','destroy','then','end','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','catch','findOne','SalesforceConfiguration','getConfigurations','addConfiguration','Descriptions','getDescriptions','channel','SalesforceField','Subjects','getFields','Task','remoteUri','clientId','clientSecret','password','securityToken','slice','login','concat','isNil','sobject','describe','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','boolean','email','textarea','phone','remove','includes','label','custom'];(function(_0x198f7b,_0x2acdb8){var _0x48b989=function(_0x2a2fc8){while(--_0x2a2fc8){_0x198f7b['push'](_0x198f7b['shift']());}};_0x48b989(++_0x2acdb8);}(_0x147b,0x1ee));var _0xb147=function(_0x231b2e,_0x2a33f9){_0x231b2e=_0x231b2e-0x0;var _0x3feb2a=_0x147b[_0x231b2e];return _0x3feb2a;};'use strict';var emlformat=require(_0xb147('0x0'));var rimraf=require(_0xb147('0x1'));var zipdir=require(_0xb147('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb147('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb147('0x4'));var util=require('util');var path=require(_0xb147('0x5'));var sox=require(_0xb147('0x6'));var csv=require(_0xb147('0x7'));var ejs=require(_0xb147('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb147('0x9'));var squel=require(_0xb147('0xa'));var crypto=require(_0xb147('0xb'));var jsforce=require(_0xb147('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb147('0x7'));var querystring=require(_0xb147('0xd'));var Papa=require(_0xb147('0xe'));var Redis=require(_0xb147('0xf'));var authService=require(_0xb147('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb147('0x11'));var hardwareService=require(_0xb147('0x12'));var logger=require(_0xb147('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xb147('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb147('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1a8c2d,_0xf3540){_0xf3540=_0xf3540||0xcc;return function(_0x287369){if(_0x287369){return _0x1a8c2d[_0xb147('0x16')](_0xf3540);}return _0x1a8c2d[_0xb147('0x17')](_0xf3540)['end']();};}function respondWithResult(_0x1c827f,_0x4d1d61){_0x4d1d61=_0x4d1d61||0xc8;return function(_0x36c14a){if(_0x36c14a){return _0x1c827f[_0xb147('0x17')](_0x4d1d61)[_0xb147('0x18')](_0x36c14a);}};}function respondWithFilteredResult(_0x4de81e,_0x3ee72d){return function(_0x4ff20f){if(_0x4ff20f){var _0x40bdcb=typeof _0x3ee72d[_0xb147('0x19')]==='undefined'&&typeof _0x3ee72d[_0xb147('0x1a')]===_0xb147('0x1b');var _0x427e42=_0x4ff20f[_0xb147('0x1c')];var _0x5448fd=_0x40bdcb?0x0:_0x3ee72d['offset'];var _0xf22809=_0x40bdcb?_0x4ff20f[_0xb147('0x1c')]:_0x3ee72d[_0xb147('0x19')]+_0x3ee72d[_0xb147('0x1a')];var _0xbb45c7;if(_0xf22809>=_0x427e42){_0xf22809=_0x427e42;_0xbb45c7=0xc8;}else{_0xbb45c7=0xce;}_0x4de81e[_0xb147('0x17')](_0xbb45c7);return _0x4de81e[_0xb147('0x1d')](_0xb147('0x1e'),_0x5448fd+'-'+_0xf22809+'/'+_0x427e42)[_0xb147('0x18')](_0x4ff20f);}return null;};}function patchUpdates(_0x2823c9){return function(_0x29d934){try{jsonpatch['apply'](_0x29d934,_0x2823c9,!![]);}catch(_0x2ee564){return BPromise['reject'](_0x2ee564);}return _0x29d934[_0xb147('0x1f')]();};}function saveUpdates(_0x1d0e56,_0x4f5572){return function(_0x9be04){if(_0x9be04){return _0x9be04[_0xb147('0x20')](_0x1d0e56)['then'](function(_0x5ebd6a){return _0x5ebd6a;});}return null;};}function removeEntity(_0x449f24,_0x6cd70f){return function(_0x1ca282){if(_0x1ca282){return _0x1ca282[_0xb147('0x21')]()[_0xb147('0x22')](function(){_0x449f24['status'](0xcc)[_0xb147('0x23')]();});}};}function handleEntityNotFound(_0x80cbae,_0x2ad9d1){return function(_0x418228){if(!_0x418228){_0x80cbae['sendStatus'](0x194);}return _0x418228;};}function handleError(_0x358d35,_0x12b2ea){_0x12b2ea=_0x12b2ea||0x1f4;return function(_0x53460e){logger['error'](_0x53460e[_0xb147('0x24')]);if(_0x53460e['name']){delete _0x53460e[_0xb147('0x25')];}_0x358d35[_0xb147('0x17')](_0x12b2ea)[_0xb147('0x26')](_0x53460e);};}exports[_0xb147('0x27')]=function(_0x837f89,_0x41086f){var _0x3718f4={},_0xb57baf={},_0x53d82e={'count':0x0,'rows':[]};var _0x415e92=_[_0xb147('0x28')](db[_0xb147('0x29')][_0xb147('0x2a')],function(_0x20aa43){return{'name':_0x20aa43[_0xb147('0x2b')],'type':_0x20aa43[_0xb147('0x2c')][_0xb147('0x2d')]};});_0xb57baf[_0xb147('0x2e')]=_[_0xb147('0x28')](_0x415e92,_0xb147('0x25'));_0xb57baf[_0xb147('0x2f')]=_[_0xb147('0x30')](_0x837f89['query']);_0xb57baf[_0xb147('0x31')]=_[_0xb147('0x32')](_0xb57baf[_0xb147('0x2e')],_0xb57baf['query']);_0x3718f4['attributes']=_[_0xb147('0x32')](_0xb57baf[_0xb147('0x2e')],qs[_0xb147('0x33')](_0x837f89[_0xb147('0x2f')]['fields']));_0x3718f4[_0xb147('0x34')]=_0x3718f4[_0xb147('0x34')][_0xb147('0x35')]?_0x3718f4[_0xb147('0x34')]:_0xb57baf['model'];if(!_0x837f89[_0xb147('0x2f')][_0xb147('0x36')](_0xb147('0x37'))){_0x3718f4[_0xb147('0x1a')]=qs[_0xb147('0x1a')](_0x837f89[_0xb147('0x2f')][_0xb147('0x1a')]);_0x3718f4[_0xb147('0x19')]=qs[_0xb147('0x19')](_0x837f89['query']['offset']);}_0x3718f4[_0xb147('0x38')]=qs[_0xb147('0x39')](_0x837f89[_0xb147('0x2f')][_0xb147('0x39')]);_0x3718f4[_0xb147('0x3a')]=qs[_0xb147('0x31')](_[_0xb147('0x3b')](_0x837f89[_0xb147('0x2f')],_0xb57baf[_0xb147('0x31')]),_0x415e92);if(_0x837f89[_0xb147('0x2f')][_0xb147('0x3c')]){_0x3718f4[_0xb147('0x3a')]=_[_0xb147('0x3d')](_0x3718f4['where'],{'$or':_[_0xb147('0x28')](_0x415e92,function(_0x44bf59){if(_0x44bf59['type']!==_0xb147('0x3e')){var _0x5501e9={};_0x5501e9[_0x44bf59[_0xb147('0x25')]]={'$like':'%'+_0x837f89['query'][_0xb147('0x3c')]+'%'};return _0x5501e9;}})});}_0x3718f4=_[_0xb147('0x3d')]({},_0x3718f4,_0x837f89[_0xb147('0x3f')]);var _0x3e1d93={'where':_0x3718f4[_0xb147('0x3a')]};return db[_0xb147('0x29')][_0xb147('0x1c')](_0x3e1d93)[_0xb147('0x22')](function(_0x4ae38c){_0x53d82e[_0xb147('0x1c')]=_0x4ae38c;if(_0x837f89[_0xb147('0x2f')][_0xb147('0x40')]){_0x3718f4[_0xb147('0x41')]=[{'all':!![]}];}return db['SalesforceAccount'][_0xb147('0x42')](_0x3718f4);})['then'](function(_0x1d19a9){_0x53d82e[_0xb147('0x43')]=_0x1d19a9;return _0x53d82e;})[_0xb147('0x22')](respondWithFilteredResult(_0x41086f,_0x3718f4))['catch'](handleError(_0x41086f,null));};exports[_0xb147('0x44')]=function(_0x2ea090,_0x3efb76){var _0x273da6={'raw':![],'where':{'id':_0x2ea090[_0xb147('0x45')]['id']}},_0x2239f7={};_0x2239f7[_0xb147('0x2e')]=_[_0xb147('0x30')](db[_0xb147('0x29')][_0xb147('0x2a')]);_0x2239f7[_0xb147('0x2f')]=_[_0xb147('0x30')](_0x2ea090[_0xb147('0x2f')]);_0x2239f7[_0xb147('0x31')]=_[_0xb147('0x32')](_0x2239f7[_0xb147('0x2e')],_0x2239f7[_0xb147('0x2f')]);_0x273da6[_0xb147('0x34')]=_['intersection'](_0x2239f7[_0xb147('0x2e')],qs[_0xb147('0x33')](_0x2ea090[_0xb147('0x2f')]['fields']));_0x273da6[_0xb147('0x34')]=_0x273da6[_0xb147('0x34')][_0xb147('0x35')]?_0x273da6[_0xb147('0x34')]:_0x2239f7[_0xb147('0x2e')];if(_0x2ea090['query'][_0xb147('0x40')]){_0x273da6[_0xb147('0x41')]=[{'all':!![]}];}_0x273da6=_['merge']({},_0x273da6,_0x2ea090[_0xb147('0x3f')]);return db['SalesforceAccount'][_0xb147('0x46')](_0x273da6)[_0xb147('0x22')](handleEntityNotFound(_0x3efb76,null))[_0xb147('0x22')](respondWithResult(_0x3efb76,null))['catch'](handleError(_0x3efb76,null));};exports[_0xb147('0x47')]=function(_0x72f72f,_0x28d9b8){return db[_0xb147('0x29')][_0xb147('0x47')](_0x72f72f[_0xb147('0x48')],{})[_0xb147('0x22')](respondWithResult(_0x28d9b8,0xc9))[_0xb147('0x49')](handleError(_0x28d9b8,null));};exports[_0xb147('0x20')]=function(_0x5073f8,_0x40a78d){if(_0x5073f8['body']['id']){delete _0x5073f8[_0xb147('0x48')]['id'];}return db[_0xb147('0x29')][_0xb147('0x46')]({'where':{'id':_0x5073f8['params']['id']}})[_0xb147('0x22')](handleEntityNotFound(_0x40a78d,null))['then'](saveUpdates(_0x5073f8[_0xb147('0x48')],null))[_0xb147('0x22')](respondWithResult(_0x40a78d,null))[_0xb147('0x49')](handleError(_0x40a78d,null));};exports[_0xb147('0x21')]=function(_0xbcf272,_0x5690f5){return db[_0xb147('0x29')][_0xb147('0x46')]({'where':{'id':_0xbcf272[_0xb147('0x45')]['id']}})[_0xb147('0x22')](handleEntityNotFound(_0x5690f5,null))['then'](removeEntity(_0x5690f5,null))['catch'](handleError(_0x5690f5,null));};exports['getConfigurations']=function(_0x1ea2a6,_0x226898,_0x29a941){var _0x335d60={};var _0x56f1f7={};var _0x24b9af;var _0x1ad86f;return db[_0xb147('0x29')][_0xb147('0x4a')]({'where':{'id':_0x1ea2a6['params']['id']}})[_0xb147('0x22')](handleEntityNotFound(_0x226898,null))[_0xb147('0x22')](function(_0x18df12){if(_0x18df12){_0x24b9af=_0x18df12;_0x56f1f7[_0xb147('0x2e')]=_[_0xb147('0x30')](db[_0xb147('0x4b')]['rawAttributes']);_0x56f1f7['query']=_[_0xb147('0x30')](_0x1ea2a6[_0xb147('0x2f')]);_0x56f1f7['filters']=_[_0xb147('0x32')](_0x56f1f7['model'],_0x56f1f7[_0xb147('0x2f')]);_0x335d60['attributes']=_[_0xb147('0x32')](_0x56f1f7['model'],qs['fields'](_0x1ea2a6[_0xb147('0x2f')][_0xb147('0x33')]));_0x335d60[_0xb147('0x34')]=_0x335d60['attributes']['length']?_0x335d60[_0xb147('0x34')]:_0x56f1f7[_0xb147('0x2e')];_0x335d60[_0xb147('0x38')]=qs[_0xb147('0x39')](_0x1ea2a6[_0xb147('0x2f')][_0xb147('0x39')]);_0x335d60['where']=qs[_0xb147('0x31')](_['pick'](_0x1ea2a6[_0xb147('0x2f')],_0x56f1f7[_0xb147('0x31')]));if(_0x1ea2a6[_0xb147('0x2f')]['filter']){_0x335d60[_0xb147('0x3a')]=_[_0xb147('0x3d')](_0x335d60[_0xb147('0x3a')],{'$or':_[_0xb147('0x28')](_0x335d60[_0xb147('0x34')],function(_0x3c503a){var _0x5b6ede={};_0x5b6ede[_0x3c503a]={'$like':'%'+_0x1ea2a6[_0xb147('0x2f')]['filter']+'%'};return _0x5b6ede;})});}_0x335d60=_['merge']({},_0x335d60,_0x1ea2a6[_0xb147('0x3f')]);return _0x24b9af['getConfigurations'](_0x335d60);}})['then'](function(_0x101e67){if(_0x101e67){_0x1ad86f=_0x101e67[_0xb147('0x35')];if(!_0x1ea2a6[_0xb147('0x2f')][_0xb147('0x36')]('nolimit')){_0x335d60[_0xb147('0x1a')]=qs['limit'](_0x1ea2a6[_0xb147('0x2f')][_0xb147('0x1a')]);_0x335d60['offset']=qs[_0xb147('0x19')](_0x1ea2a6[_0xb147('0x2f')][_0xb147('0x19')]);}return _0x24b9af[_0xb147('0x4c')](_0x335d60);}})[_0xb147('0x22')](function(_0x39b9c5){if(_0x39b9c5){return _0x39b9c5?{'count':_0x1ad86f,'rows':_0x39b9c5}:null;}})[_0xb147('0x22')](respondWithResult(_0x226898,null))[_0xb147('0x49')](handleError(_0x226898,null));};exports[_0xb147('0x4d')]=function(_0x31e9db,_0x38d8d5,_0x47e455){if(_0x31e9db[_0xb147('0x48')]['id']){delete _0x31e9db[_0xb147('0x48')]['id'];}return db[_0xb147('0x29')][_0xb147('0x4a')]({'where':{'id':_0x31e9db[_0xb147('0x45')]['id']}})[_0xb147('0x22')](handleEntityNotFound(_0x38d8d5,null))[_0xb147('0x22')](function(_0x4ba5a2){if(_0x4ba5a2){_0x31e9db[_0xb147('0x48')]['AccountId']=_0x4ba5a2['id'];_0x31e9db['body']['Subjects']=integrations['getSubjects'](_0x31e9db[_0xb147('0x48')]['channel'],_0x31e9db[_0xb147('0x48')][_0xb147('0x2c')]);_0x31e9db[_0xb147('0x48')][_0xb147('0x4e')]=integrations[_0xb147('0x4f')](_0x31e9db['body'][_0xb147('0x50')],_0x31e9db[_0xb147('0x48')][_0xb147('0x2c')]);return db[_0xb147('0x4b')][_0xb147('0x47')](_0x31e9db[_0xb147('0x48')],{'include':[{'model':db[_0xb147('0x51')],'as':_0xb147('0x52')},{'model':db[_0xb147('0x51')],'as':_0xb147('0x4e')}]});}return null;})[_0xb147('0x22')](respondWithResult(_0x38d8d5,null))['catch'](handleError(_0x38d8d5,null));};exports[_0xb147('0x53')]=function(_0xab5e7e,_0x595ead,_0x494151){var _0x5308fd;var _0x2fc230='';var _0x45a1d2=_0xb147('0x54');return db[_0xb147('0x29')][_0xb147('0x4a')]({'where':{'id':_0xab5e7e['params']['id']},'attributes':['id',_0xb147('0x55'),_0xb147('0x56'),_0xb147('0x57'),'username',_0xb147('0x58'),_0xb147('0x59')]})[_0xb147('0x22')](handleEntityNotFound(_0x595ead,null))[_0xb147('0x22')](function(_0x3be560){if(_0x3be560){_0x2fc230=_0x3be560['remoteUri'];var _0x450fd5=_0x2fc230[_0xb147('0x5a')](-0x1);if(_0x450fd5==='/'){_0x2fc230=_0x2fc230['substring'](0x0,_0x2fc230['lastIndexOf'](_0x450fd5));}_0x5308fd=new jsforce['Connection']({'oauth2':{'loginUrl':_0x2fc230,'clientId':_0x3be560[_0xb147('0x56')],'clientSecret':_0x3be560['clientSecret']}});return _0x5308fd[_0xb147('0x5b')](_0x3be560['username'],_0x3be560[_0xb147('0x58')][_0xb147('0x5c')](_0x3be560[_0xb147('0x59')]));}})[_0xb147('0x22')](function(_0x105b99){if(_0x105b99){if(!_[_0xb147('0x5d')](_0xab5e7e[_0xb147('0x2f')]['ticketType'])){_0x45a1d2=_0xab5e7e['query']['ticketType'];}return _0x5308fd[_0xb147('0x5e')](_0x45a1d2)[_0xb147('0x5f')]();}})['then'](function(_0x387ec4){var _0x588614=['OwnerId',_0xb147('0x60'),_0xb147('0x61'),_0xb147('0x62'),_0xb147('0x63'),_0xb147('0x64')];var _0x1c22ad=[_0xb147('0x65'),_0xb147('0x66'),'picklist',_0xb147('0x67'),_0xb147('0x68'),_0xb147('0x69'),_0xb147('0x6a')];if(_0x387ec4){_[_0xb147('0x6b')](_0x387ec4[_0xb147('0x33')],function(_0x3418a7){return _0x588614[_0xb147('0x6c')](_0x3418a7[_0xb147('0x25')])||!_0x1c22ad['includes'](_0x3418a7[_0xb147('0x2c')]);});return{'count':_0x387ec4[_0xb147('0x33')][_0xb147('0x35')],'rows':_[_0xb147('0x28')](_0x387ec4[_0xb147('0x33')],function(_0x5a3529){return{'id':_0x5a3529[_0xb147('0x25')],'name':_0x5a3529[_0xb147('0x6d')],'custom':_0x5a3529[_0xb147('0x6e')],'options':_0x5a3529['picklistValues']['length']>0x0?_[_0xb147('0x28')](_0x5a3529[_0xb147('0x6f')],function(_0x4ed9b4){return{'name':_0x4ed9b4['label'],'value':_0x4ed9b4[_0xb147('0x70')]};}):_0x5a3529[_0xb147('0x2c')]==_0xb147('0x67')?[{'name':_0xb147('0x71'),'value':'true'},{'name':_0xb147('0x72'),'value':_0xb147('0x73')}]:[]};})};}})[_0xb147('0x22')](respondWithResult(_0x595ead,null))[_0xb147('0x49')](function(_0x265fdf){var _0x19101a=_0xab5e7e[_0xb147('0x2f')][_0xb147('0x74')]?0x1f4:_0x265fdf['statusCode']||0x1f4;logger[_0xb147('0x75')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x19101a,JSON[_0xb147('0x76')](_0x265fdf));delete _0x265fdf['name'];if(_0x19101a===0x191){_0x19101a=0x190;}_0x595ead[_0xb147('0x17')](_0x19101a)[_0xb147('0x26')](_0xab5e7e[_0xb147('0x2f')][_0xb147('0x74')]?{'message':_0xb147('0x77'),'statusCode':_0x265fdf[_0xb147('0x78')]}:_0x265fdf);});}; \ No newline at end of file +var _0xfcd9=['SalesforceField','getFields','Task','remoteUri','clientSecret','securityToken','slice','substring','Connection','clientId','username','password','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Description','string','int','email','textarea','phone','remove','includes','label','picklistValues','boolean','True','true','False','false','test','stringify','send','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','SalesforceAccount','findAll','rows','catch','show','params','keys','find','create','body','findOne','getConfigurations','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','SalesforceConfiguration'];(function(_0x3da0fd,_0x208e3b){var _0x132a94=function(_0x11cba9){while(--_0x11cba9){_0x3da0fd['push'](_0x3da0fd['shift']());}};_0x132a94(++_0x208e3b);}(_0xfcd9,0x126));var _0x9fcd=function(_0x428029,_0x1a5eb3){_0x428029=_0x428029-0x0;var _0x52033a=_0xfcd9[_0x428029];return _0x52033a;};'use strict';var emlformat=require(_0x9fcd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9fcd('0x1'));var rp=require(_0x9fcd('0x2'));var moment=require('moment');var BPromise=require(_0x9fcd('0x3'));var Mustache=require(_0x9fcd('0x4'));var util=require(_0x9fcd('0x5'));var path=require(_0x9fcd('0x6'));var sox=require(_0x9fcd('0x7'));var csv=require(_0x9fcd('0x8'));var ejs=require(_0x9fcd('0x9'));var fs=require('fs');var fs_extra=require(_0x9fcd('0xa'));var _=require(_0x9fcd('0xb'));var squel=require(_0x9fcd('0xc'));var crypto=require(_0x9fcd('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9fcd('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9fcd('0xf'));var Papa=require(_0x9fcd('0x10'));var Redis=require(_0x9fcd('0x11'));var authService=require(_0x9fcd('0x12'));var qs=require(_0x9fcd('0x13'));var as=require(_0x9fcd('0x14'));var hardwareService=require(_0x9fcd('0x15'));var logger=require(_0x9fcd('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x9fcd('0x17'));var licenseUtil=require(_0x9fcd('0x18'));var db=require(_0x9fcd('0x19'))['db'];var integrations=require(_0x9fcd('0x1a'));function respondWithStatusCode(_0x636f65,_0x1844b6){_0x1844b6=_0x1844b6||0xcc;return function(_0x2b02cc){if(_0x2b02cc){return _0x636f65[_0x9fcd('0x1b')](_0x1844b6);}return _0x636f65[_0x9fcd('0x1c')](_0x1844b6)['end']();};}function respondWithResult(_0x2276d8,_0x13901d){_0x13901d=_0x13901d||0xc8;return function(_0x47f2fa){if(_0x47f2fa){return _0x2276d8[_0x9fcd('0x1c')](_0x13901d)[_0x9fcd('0x1d')](_0x47f2fa);}};}function respondWithFilteredResult(_0xb4029e,_0x1f66b8){return function(_0x694d16){if(_0x694d16){var _0x5c13d5=typeof _0x1f66b8['offset']===_0x9fcd('0x1e')&&typeof _0x1f66b8['limit']===_0x9fcd('0x1e');var _0x397d1f=_0x694d16[_0x9fcd('0x1f')];var _0x57f953=_0x5c13d5?0x0:_0x1f66b8[_0x9fcd('0x20')];var _0x26e462=_0x5c13d5?_0x694d16[_0x9fcd('0x1f')]:_0x1f66b8[_0x9fcd('0x20')]+_0x1f66b8[_0x9fcd('0x21')];var _0x348c92;if(_0x26e462>=_0x397d1f){_0x26e462=_0x397d1f;_0x348c92=0xc8;}else{_0x348c92=0xce;}_0xb4029e[_0x9fcd('0x1c')](_0x348c92);return _0xb4029e[_0x9fcd('0x22')](_0x9fcd('0x23'),_0x57f953+'-'+_0x26e462+'/'+_0x397d1f)['json'](_0x694d16);}return null;};}function patchUpdates(_0x56a7eb){return function(_0x168d92){try{jsonpatch[_0x9fcd('0x24')](_0x168d92,_0x56a7eb,!![]);}catch(_0x39c15b){return BPromise[_0x9fcd('0x25')](_0x39c15b);}return _0x168d92[_0x9fcd('0x26')]();};}function saveUpdates(_0x452aec,_0xcbe483){return function(_0x44610a){if(_0x44610a){return _0x44610a[_0x9fcd('0x27')](_0x452aec)[_0x9fcd('0x28')](function(_0x2755aa){return _0x2755aa;});}return null;};}function removeEntity(_0x2616e5,_0x43532f){return function(_0x52b412){if(_0x52b412){return _0x52b412[_0x9fcd('0x29')]()[_0x9fcd('0x28')](function(){_0x2616e5['status'](0xcc)[_0x9fcd('0x2a')]();});}};}function handleEntityNotFound(_0x48212a,_0x215230){return function(_0x481358){if(!_0x481358){_0x48212a[_0x9fcd('0x1b')](0x194);}return _0x481358;};}function handleError(_0x115921,_0x40a602){_0x40a602=_0x40a602||0x1f4;return function(_0x2ac048){logger[_0x9fcd('0x2b')](_0x2ac048[_0x9fcd('0x2c')]);if(_0x2ac048['name']){delete _0x2ac048[_0x9fcd('0x2d')];}_0x115921[_0x9fcd('0x1c')](_0x40a602)['send'](_0x2ac048);};}exports['index']=function(_0x389df2,_0x44ee6b){var _0x2492dc={},_0x245ac4={},_0x2df6b7={'count':0x0,'rows':[]};var _0x37c7d1=_['map'](db['SalesforceAccount'][_0x9fcd('0x2e')],function(_0x5e3e74){return{'name':_0x5e3e74[_0x9fcd('0x2f')],'type':_0x5e3e74[_0x9fcd('0x30')][_0x9fcd('0x31')]};});_0x245ac4[_0x9fcd('0x32')]=_[_0x9fcd('0x33')](_0x37c7d1,_0x9fcd('0x2d'));_0x245ac4[_0x9fcd('0x34')]=_['keys'](_0x389df2[_0x9fcd('0x34')]);_0x245ac4[_0x9fcd('0x35')]=_[_0x9fcd('0x36')](_0x245ac4['model'],_0x245ac4[_0x9fcd('0x34')]);_0x2492dc[_0x9fcd('0x37')]=_[_0x9fcd('0x36')](_0x245ac4['model'],qs[_0x9fcd('0x38')](_0x389df2['query']['fields']));_0x2492dc['attributes']=_0x2492dc[_0x9fcd('0x37')][_0x9fcd('0x39')]?_0x2492dc['attributes']:_0x245ac4[_0x9fcd('0x32')];if(!_0x389df2[_0x9fcd('0x34')][_0x9fcd('0x3a')]('nolimit')){_0x2492dc[_0x9fcd('0x21')]=qs[_0x9fcd('0x21')](_0x389df2[_0x9fcd('0x34')]['limit']);_0x2492dc[_0x9fcd('0x20')]=qs[_0x9fcd('0x20')](_0x389df2[_0x9fcd('0x34')][_0x9fcd('0x20')]);}_0x2492dc[_0x9fcd('0x3b')]=qs[_0x9fcd('0x3c')](_0x389df2[_0x9fcd('0x34')][_0x9fcd('0x3c')]);_0x2492dc[_0x9fcd('0x3d')]=qs[_0x9fcd('0x35')](_[_0x9fcd('0x3e')](_0x389df2[_0x9fcd('0x34')],_0x245ac4[_0x9fcd('0x35')]),_0x37c7d1);if(_0x389df2[_0x9fcd('0x34')][_0x9fcd('0x3f')]){_0x2492dc[_0x9fcd('0x3d')]=_['merge'](_0x2492dc['where'],{'$or':_[_0x9fcd('0x33')](_0x37c7d1,function(_0x14ccc8){if(_0x14ccc8['type']!=='VIRTUAL'){var _0x48c68d={};_0x48c68d[_0x14ccc8[_0x9fcd('0x2d')]]={'$like':'%'+_0x389df2['query'][_0x9fcd('0x3f')]+'%'};return _0x48c68d;}})});}_0x2492dc=_[_0x9fcd('0x40')]({},_0x2492dc,_0x389df2[_0x9fcd('0x41')]);var _0xe930e1={'where':_0x2492dc[_0x9fcd('0x3d')]};return db['SalesforceAccount'][_0x9fcd('0x1f')](_0xe930e1)[_0x9fcd('0x28')](function(_0x10b81d){_0x2df6b7[_0x9fcd('0x1f')]=_0x10b81d;if(_0x389df2[_0x9fcd('0x34')][_0x9fcd('0x42')]){_0x2492dc[_0x9fcd('0x43')]=[{'all':!![]}];}return db[_0x9fcd('0x44')][_0x9fcd('0x45')](_0x2492dc);})[_0x9fcd('0x28')](function(_0x443f65){_0x2df6b7[_0x9fcd('0x46')]=_0x443f65;return _0x2df6b7;})[_0x9fcd('0x28')](respondWithFilteredResult(_0x44ee6b,_0x2492dc))[_0x9fcd('0x47')](handleError(_0x44ee6b,null));};exports[_0x9fcd('0x48')]=function(_0x2af82f,_0x1d1022){var _0x48a72f={'raw':![],'where':{'id':_0x2af82f[_0x9fcd('0x49')]['id']}},_0x444f3b={};_0x444f3b[_0x9fcd('0x32')]=_[_0x9fcd('0x4a')](db['SalesforceAccount']['rawAttributes']);_0x444f3b['query']=_[_0x9fcd('0x4a')](_0x2af82f[_0x9fcd('0x34')]);_0x444f3b['filters']=_[_0x9fcd('0x36')](_0x444f3b['model'],_0x444f3b[_0x9fcd('0x34')]);_0x48a72f[_0x9fcd('0x37')]=_[_0x9fcd('0x36')](_0x444f3b[_0x9fcd('0x32')],qs[_0x9fcd('0x38')](_0x2af82f[_0x9fcd('0x34')]['fields']));_0x48a72f[_0x9fcd('0x37')]=_0x48a72f[_0x9fcd('0x37')][_0x9fcd('0x39')]?_0x48a72f['attributes']:_0x444f3b[_0x9fcd('0x32')];if(_0x2af82f['query'][_0x9fcd('0x42')]){_0x48a72f[_0x9fcd('0x43')]=[{'all':!![]}];}_0x48a72f=_['merge']({},_0x48a72f,_0x2af82f[_0x9fcd('0x41')]);return db[_0x9fcd('0x44')][_0x9fcd('0x4b')](_0x48a72f)[_0x9fcd('0x28')](handleEntityNotFound(_0x1d1022,null))[_0x9fcd('0x28')](respondWithResult(_0x1d1022,null))[_0x9fcd('0x47')](handleError(_0x1d1022,null));};exports[_0x9fcd('0x4c')]=function(_0x1a853d,_0x505a2d){return db[_0x9fcd('0x44')][_0x9fcd('0x4c')](_0x1a853d[_0x9fcd('0x4d')],{})['then'](respondWithResult(_0x505a2d,0xc9))[_0x9fcd('0x47')](handleError(_0x505a2d,null));};exports[_0x9fcd('0x27')]=function(_0x3a1567,_0x1ee60b){if(_0x3a1567[_0x9fcd('0x4d')]['id']){delete _0x3a1567[_0x9fcd('0x4d')]['id'];}return db[_0x9fcd('0x44')][_0x9fcd('0x4b')]({'where':{'id':_0x3a1567[_0x9fcd('0x49')]['id']}})[_0x9fcd('0x28')](handleEntityNotFound(_0x1ee60b,null))[_0x9fcd('0x28')](saveUpdates(_0x3a1567[_0x9fcd('0x4d')],null))['then'](respondWithResult(_0x1ee60b,null))['catch'](handleError(_0x1ee60b,null));};exports['destroy']=function(_0x56dc87,_0x59978b){return db[_0x9fcd('0x44')][_0x9fcd('0x4b')]({'where':{'id':_0x56dc87[_0x9fcd('0x49')]['id']}})['then'](handleEntityNotFound(_0x59978b,null))['then'](removeEntity(_0x59978b,null))[_0x9fcd('0x47')](handleError(_0x59978b,null));};exports['getConfigurations']=function(_0x176555,_0x478ece,_0x367eb1){var _0x56e04f={};var _0xae78f0={};var _0x3903f6;var _0x1ec3ce;return db[_0x9fcd('0x44')][_0x9fcd('0x4e')]({'where':{'id':_0x176555[_0x9fcd('0x49')]['id']}})[_0x9fcd('0x28')](handleEntityNotFound(_0x478ece,null))[_0x9fcd('0x28')](function(_0x139e34){if(_0x139e34){_0x3903f6=_0x139e34;_0xae78f0[_0x9fcd('0x32')]=_[_0x9fcd('0x4a')](db['SalesforceConfiguration']['rawAttributes']);_0xae78f0['query']=_[_0x9fcd('0x4a')](_0x176555[_0x9fcd('0x34')]);_0xae78f0[_0x9fcd('0x35')]=_[_0x9fcd('0x36')](_0xae78f0[_0x9fcd('0x32')],_0xae78f0[_0x9fcd('0x34')]);_0x56e04f[_0x9fcd('0x37')]=_['intersection'](_0xae78f0[_0x9fcd('0x32')],qs[_0x9fcd('0x38')](_0x176555['query'][_0x9fcd('0x38')]));_0x56e04f[_0x9fcd('0x37')]=_0x56e04f[_0x9fcd('0x37')]['length']?_0x56e04f[_0x9fcd('0x37')]:_0xae78f0[_0x9fcd('0x32')];_0x56e04f[_0x9fcd('0x3b')]=qs[_0x9fcd('0x3c')](_0x176555['query']['sort']);_0x56e04f['where']=qs['filters'](_['pick'](_0x176555[_0x9fcd('0x34')],_0xae78f0['filters']));if(_0x176555['query']['filter']){_0x56e04f[_0x9fcd('0x3d')]=_['merge'](_0x56e04f[_0x9fcd('0x3d')],{'$or':_[_0x9fcd('0x33')](_0x56e04f[_0x9fcd('0x37')],function(_0x3c51ff){var _0x428d33={};_0x428d33[_0x3c51ff]={'$like':'%'+_0x176555['query'][_0x9fcd('0x3f')]+'%'};return _0x428d33;})});}_0x56e04f=_[_0x9fcd('0x40')]({},_0x56e04f,_0x176555[_0x9fcd('0x41')]);return _0x3903f6[_0x9fcd('0x4f')](_0x56e04f);}})[_0x9fcd('0x28')](function(_0x191252){if(_0x191252){_0x1ec3ce=_0x191252[_0x9fcd('0x39')];if(!_0x176555[_0x9fcd('0x34')][_0x9fcd('0x3a')](_0x9fcd('0x50'))){_0x56e04f['limit']=qs[_0x9fcd('0x21')](_0x176555[_0x9fcd('0x34')][_0x9fcd('0x21')]);_0x56e04f[_0x9fcd('0x20')]=qs[_0x9fcd('0x20')](_0x176555['query'][_0x9fcd('0x20')]);}return _0x3903f6[_0x9fcd('0x4f')](_0x56e04f);}})[_0x9fcd('0x28')](function(_0x3aeeb6){if(_0x3aeeb6){return _0x3aeeb6?{'count':_0x1ec3ce,'rows':_0x3aeeb6}:null;}})['then'](respondWithResult(_0x478ece,null))['catch'](handleError(_0x478ece,null));};exports[_0x9fcd('0x51')]=function(_0xe2ffe6,_0x4dbecb,_0x39b979){if(_0xe2ffe6['body']['id']){delete _0xe2ffe6[_0x9fcd('0x4d')]['id'];}return db[_0x9fcd('0x44')][_0x9fcd('0x4e')]({'where':{'id':_0xe2ffe6[_0x9fcd('0x49')]['id']}})['then'](handleEntityNotFound(_0x4dbecb,null))[_0x9fcd('0x28')](function(_0x5316f3){if(_0x5316f3){_0xe2ffe6[_0x9fcd('0x4d')]['AccountId']=_0x5316f3['id'];_0xe2ffe6[_0x9fcd('0x4d')][_0x9fcd('0x52')]=integrations[_0x9fcd('0x53')](_0xe2ffe6[_0x9fcd('0x4d')][_0x9fcd('0x54')],_0xe2ffe6[_0x9fcd('0x4d')][_0x9fcd('0x30')]);_0xe2ffe6['body'][_0x9fcd('0x55')]=integrations['getDescriptions'](_0xe2ffe6[_0x9fcd('0x4d')][_0x9fcd('0x54')],_0xe2ffe6[_0x9fcd('0x4d')][_0x9fcd('0x30')]);return db[_0x9fcd('0x56')][_0x9fcd('0x4c')](_0xe2ffe6[_0x9fcd('0x4d')],{'include':[{'model':db[_0x9fcd('0x57')],'as':_0x9fcd('0x52')},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})[_0x9fcd('0x28')](respondWithResult(_0x4dbecb,null))[_0x9fcd('0x47')](handleError(_0x4dbecb,null));};exports[_0x9fcd('0x58')]=function(_0xf1b089,_0x5d28ce,_0x4f126f){var _0xfb9a56;var _0x2c68b5='';var _0xee5994=_0x9fcd('0x59');return db['SalesforceAccount'][_0x9fcd('0x4e')]({'where':{'id':_0xf1b089[_0x9fcd('0x49')]['id']},'attributes':['id',_0x9fcd('0x5a'),'clientId',_0x9fcd('0x5b'),'username','password',_0x9fcd('0x5c')]})['then'](handleEntityNotFound(_0x5d28ce,null))[_0x9fcd('0x28')](function(_0x316313){if(_0x316313){_0x2c68b5=_0x316313[_0x9fcd('0x5a')];var _0x8bed80=_0x2c68b5[_0x9fcd('0x5d')](-0x1);if(_0x8bed80==='/'){_0x2c68b5=_0x2c68b5[_0x9fcd('0x5e')](0x0,_0x2c68b5['lastIndexOf'](_0x8bed80));}_0xfb9a56=new jsforce[(_0x9fcd('0x5f'))]({'oauth2':{'loginUrl':_0x2c68b5,'clientId':_0x316313[_0x9fcd('0x60')],'clientSecret':_0x316313[_0x9fcd('0x5b')]}});return _0xfb9a56['login'](_0x316313[_0x9fcd('0x61')],_0x316313[_0x9fcd('0x62')][_0x9fcd('0x63')](_0x316313[_0x9fcd('0x5c')]));}})['then'](function(_0x1b4c63){if(_0x1b4c63){if(!_[_0x9fcd('0x64')](_0xf1b089[_0x9fcd('0x34')][_0x9fcd('0x65')])){_0xee5994=_0xf1b089[_0x9fcd('0x34')]['ticketType'];}return _0xfb9a56[_0x9fcd('0x66')](_0xee5994)[_0x9fcd('0x67')]();}})[_0x9fcd('0x28')](function(_0x336034){var _0xa4df20=[_0x9fcd('0x68'),_0x9fcd('0x69'),_0x9fcd('0x6a'),_0x9fcd('0x6b'),'Subject',_0x9fcd('0x6c')];var _0x197f4c=[_0x9fcd('0x6d'),_0x9fcd('0x6e'),'picklist','boolean',_0x9fcd('0x6f'),_0x9fcd('0x70'),_0x9fcd('0x71')];if(_0x336034){_[_0x9fcd('0x72')](_0x336034[_0x9fcd('0x38')],function(_0x27cb2e){return _0xa4df20[_0x9fcd('0x73')](_0x27cb2e[_0x9fcd('0x2d')])||!_0x197f4c[_0x9fcd('0x73')](_0x27cb2e['type']);});return{'count':_0x336034[_0x9fcd('0x38')][_0x9fcd('0x39')],'rows':_[_0x9fcd('0x33')](_0x336034[_0x9fcd('0x38')],function(_0x48f410){return{'id':_0x48f410[_0x9fcd('0x2d')],'name':_0x48f410[_0x9fcd('0x74')],'custom':_0x48f410['custom'],'options':_0x48f410[_0x9fcd('0x75')]['length']>0x0?_['map'](_0x48f410[_0x9fcd('0x75')],function(_0x5bd98e){return{'name':_0x5bd98e[_0x9fcd('0x74')],'value':_0x5bd98e['value']};}):_0x48f410[_0x9fcd('0x30')]==_0x9fcd('0x76')?[{'name':_0x9fcd('0x77'),'value':_0x9fcd('0x78')},{'name':_0x9fcd('0x79'),'value':_0x9fcd('0x7a')}]:[]};})};}})[_0x9fcd('0x28')](respondWithResult(_0x5d28ce,null))[_0x9fcd('0x47')](function(_0x23b97b){var _0x1e3b3b=_0xf1b089[_0x9fcd('0x34')][_0x9fcd('0x7b')]?0x1f4:_0x23b97b['statusCode']||0x1f4;logger[_0x9fcd('0x2b')]('getFields,\x20%s,\x20%s,\x20%s',_0x9fcd('0x58'),_0x1e3b3b,JSON[_0x9fcd('0x7c')](_0x23b97b));delete _0x23b97b['name'];if(_0x1e3b3b===0x191){_0x1e3b3b=0x190;}_0x5d28ce[_0x9fcd('0x1c')](_0x1e3b3b)[_0x9fcd('0x7d')](_0xf1b089[_0x9fcd('0x34')][_0x9fcd('0x7b')]?{'message':_0x9fcd('0x7e'),'statusCode':_0x23b97b['statusCode']}:_0x23b97b);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 7cabd1a..b4b23cd 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 _0x4323=['bluebird','request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','util','api'];(function(_0x34ffa7,_0x500aac){var _0x40160c=function(_0x51ad28){while(--_0x51ad28){_0x34ffa7['push'](_0x34ffa7['shift']());}};_0x40160c(++_0x500aac);}(_0x4323,0x1cc));var _0x3432=function(_0x196f71,_0x51dc09){_0x196f71=_0x196f71-0x0;var _0xfb8ae2=_0x4323[_0x196f71];return _0xfb8ae2;};'use strict';var _=require('lodash');var util=require(_0x3432('0x0'));var logger=require('../../config/logger')(_0x3432('0x1'));var moment=require('moment');var BPromise=require(_0x3432('0x2'));var rp=require(_0x3432('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3432('0x4'));var config=require(_0x3432('0x5'));var attributes=require(_0x3432('0x6'));var integrations=require(_0x3432('0x7'));module[_0x3432('0x8')]=function(_0x19af6a,_0x1cdacb){return _0x19af6a[_0x3432('0x9')](_0x3432('0xa'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc8d8=['exports','define','SalesforceAccount','int_salesforce_accounts','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration'];(function(_0x525f6e,_0x4a4f17){var _0x1ef866=function(_0x19aa4f){while(--_0x19aa4f){_0x525f6e['push'](_0x525f6e['shift']());}};_0x1ef866(++_0x4a4f17);}(_0xc8d8,0x6c));var _0x8c8d=function(_0x3a5066,_0x4ec243){_0x3a5066=_0x3a5066-0x0;var _0x36a6ba=_0xc8d8[_0x3a5066];return _0x36a6ba;};'use strict';var _=require('lodash');var util=require(_0x8c8d('0x0'));var logger=require(_0x8c8d('0x1'))('api');var moment=require(_0x8c8d('0x2'));var BPromise=require(_0x8c8d('0x3'));var rp=require(_0x8c8d('0x4'));var fs=require('fs');var path=require(_0x8c8d('0x5'));var rimraf=require(_0x8c8d('0x6'));var config=require('../../config/environment');var attributes=require(_0x8c8d('0x7'));var integrations=require(_0x8c8d('0x8'));module[_0x8c8d('0x9')]=function(_0x17d3bc,_0x407ec2){return _0x17d3bc[_0x8c8d('0xa')](_0x8c8d('0xb'),attributes,{'tableName':_0x8c8d('0xc'),'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 89d41e0..5a9f30d 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 _0x085d=['SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetSalesforceAccount','findAll','options','raw','where','attributes','limit','include','model','map','catch','ShowSalesforceAccount','SalesforceAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x590acb,_0x2e3f40){var _0x2d4f7d=function(_0x5394f9){while(--_0x5394f9){_0x590acb['push'](_0x590acb['shift']());}};_0x2d4f7d(++_0x2e3f40);}(_0x085d,0x192));var _0xd085=function(_0x381379,_0x3f3b86){_0x381379=_0x381379-0x0;var _0x3e1063=_0x085d[_0x381379];return _0x3e1063;};'use strict';var _=require(_0xd085('0x0'));var util=require(_0xd085('0x1'));var moment=require('moment');var BPromise=require(_0xd085('0x2'));var rs=require(_0xd085('0x3'));var fs=require('fs');var Redis=require(_0xd085('0x4'));var db=require(_0xd085('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd085('0x6'))('rpc');var config=require(_0xd085('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd085('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20a63f,_0x492d9e,_0x5d7bf0){return new BPromise(function(_0x865a9e,_0x4d8306){return client['request'](_0x20a63f,_0x5d7bf0)[_0xd085('0x9')](function(_0x652a03){logger[_0xd085('0xa')](_0xd085('0xb'),_0x492d9e,_0xd085('0xc'));logger[_0xd085('0xd')](_0xd085('0xe'),_0x492d9e,'request\x20sent',JSON[_0xd085('0xf')](_0x652a03));if(_0x652a03[_0xd085('0x10')]){if(_0x652a03[_0xd085('0x10')]['code']===0x1f4){logger[_0xd085('0x10')](_0xd085('0xb'),_0x492d9e,_0x652a03[_0xd085('0x10')][_0xd085('0x11')]);return _0x4d8306(_0x652a03['error'][_0xd085('0x11')]);}logger['error'](_0xd085('0xb'),_0x492d9e,_0x652a03[_0xd085('0x10')][_0xd085('0x11')]);return _0x865a9e(_0x652a03[_0xd085('0x10')]['message']);}else{logger[_0xd085('0xa')](_0xd085('0xb'),_0x492d9e,_0xd085('0xc'));_0x865a9e(_0x652a03[_0xd085('0x12')]['message']);}})['catch'](function(_0x2c8774){logger[_0xd085('0x10')](_0xd085('0xb'),_0x492d9e,_0x2c8774);_0x4d8306(_0x2c8774);});});}exports[_0xd085('0x13')]=function(_0x42d390){var _0x521ae3=this;return new Promise(function(_0x5e00c9,_0x4d3f9e){return db['SalesforceAccount'][_0xd085('0x14')]({'raw':_0x42d390[_0xd085('0x15')]?_0x42d390[_0xd085('0x15')][_0xd085('0x16')]===undefined?!![]:![]:!![],'where':_0x42d390['options']?_0x42d390['options'][_0xd085('0x17')]||null:null,'attributes':_0x42d390[_0xd085('0x15')]?_0x42d390[_0xd085('0x15')][_0xd085('0x18')]||null:null,'limit':_0x42d390[_0xd085('0x15')]?_0x42d390[_0xd085('0x15')][_0xd085('0x19')]||null:null,'include':_0x42d390[_0xd085('0x15')]?_0x42d390[_0xd085('0x15')][_0xd085('0x1a')]?_['map'](_0x42d390[_0xd085('0x15')][_0xd085('0x1a')],function(_0x5afc13){return{'model':db[_0x5afc13[_0xd085('0x1b')]],'as':_0x5afc13['as'],'attributes':_0x5afc13[_0xd085('0x18')],'include':_0x5afc13[_0xd085('0x1a')]?_[_0xd085('0x1c')](_0x5afc13['include'],function(_0x3b8c22){return{'model':db[_0x3b8c22[_0xd085('0x1b')]],'as':_0x3b8c22['as'],'attributes':_0x3b8c22['attributes'],'include':_0x3b8c22[_0xd085('0x1a')]?_[_0xd085('0x1c')](_0x3b8c22[_0xd085('0x1a')],function(_0xfa281d){return{'model':db[_0xfa281d[_0xd085('0x1b')]],'as':_0xfa281d['as'],'attributes':_0xfa281d[_0xd085('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16dd91){logger[_0xd085('0xa')]('GetSalesforceAccount',_0x42d390);logger['debug']('GetSalesforceAccount',_0x42d390,JSON['stringify'](_0x16dd91));_0x5e00c9(_0x16dd91);})[_0xd085('0x1d')](function(_0x36e3e4){logger['error'](_0xd085('0x13'),_0x36e3e4['message'],_0x42d390);_0x4d3f9e(_0x521ae3[_0xd085('0x10')](0x1f4,_0x36e3e4[_0xd085('0x11')]));});});};exports[_0xd085('0x1e')]=function(_0x323813){var _0x4c4abe=this;return new Promise(function(_0x14b1ad,_0x5ca67a){return db[_0xd085('0x1f')]['find']({'raw':_0x323813[_0xd085('0x15')]?_0x323813[_0xd085('0x15')][_0xd085('0x16')]===undefined?!![]:![]:!![],'where':_0x323813[_0xd085('0x15')]?_0x323813[_0xd085('0x15')][_0xd085('0x17')]||null:null,'attributes':_0x323813[_0xd085('0x15')]?_0x323813['options'][_0xd085('0x18')]||null:null,'include':_0x323813[_0xd085('0x15')]?_0x323813[_0xd085('0x15')][_0xd085('0x1a')]?_[_0xd085('0x1c')](_0x323813['options'][_0xd085('0x1a')],function(_0x3dd287){return{'model':db[_0x3dd287['model']],'as':_0x3dd287['as'],'attributes':_0x3dd287['attributes'],'include':_0x3dd287[_0xd085('0x1a')]?_[_0xd085('0x1c')](_0x3dd287[_0xd085('0x1a')],function(_0x458182){return{'model':db[_0x458182['model']],'as':_0x458182['as'],'attributes':_0x458182['attributes'],'include':_0x458182['include']?_[_0xd085('0x1c')](_0x458182[_0xd085('0x1a')],function(_0x44d54c){return{'model':db[_0x44d54c['model']],'as':_0x44d54c['as'],'attributes':_0x44d54c[_0xd085('0x18')]};}):[]};}):[]};}):[]:[]})[_0xd085('0x9')](function(_0x524537){logger['info'](_0xd085('0x1e'),_0x323813);logger['debug'](_0xd085('0x1e'),_0x323813,JSON[_0xd085('0xf')](_0x524537));_0x14b1ad(_0x524537);})[_0xd085('0x1d')](function(_0x42a507){logger['error']('ShowSalesforceAccount',_0x42a507['message'],_0x323813);_0x5ca67a(_0x4c4abe[_0xd085('0x10')](0x1f4,_0x42a507['message']));});});}; \ No newline at end of file +var _0xcb0e=['info','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','model','debug','find','map','ShowSalesforceAccount','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x1e0cd4,_0x21f6bd){var _0x1b32c7=function(_0xe32910){while(--_0xe32910){_0x1e0cd4['push'](_0x1e0cd4['shift']());}};_0x1b32c7(++_0x21f6bd);}(_0xcb0e,0x1c0));var _0xecb0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcb0e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xecb0('0x0'));var util=require(_0xecb0('0x1'));var moment=require(_0xecb0('0x2'));var BPromise=require(_0xecb0('0x3'));var rs=require(_0xecb0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xecb0('0x5'));var logger=require('../../config/logger')(_0xecb0('0x6'));var config=require(_0xecb0('0x7'));var jayson=require(_0xecb0('0x8'));var client=jayson[_0xecb0('0x9')][_0xecb0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4de138,_0x54abf7,_0x3147d7){return new BPromise(function(_0x4ee9b8,_0x4aaccd){return client[_0xecb0('0xb')](_0x4de138,_0x3147d7)[_0xecb0('0xc')](function(_0xa5719f){logger['info'](_0xecb0('0xd'),_0x54abf7,_0xecb0('0xe'));logger['debug'](_0xecb0('0xf'),_0x54abf7,'request\x20sent',JSON[_0xecb0('0x10')](_0xa5719f));if(_0xa5719f['error']){if(_0xa5719f['error'][_0xecb0('0x11')]===0x1f4){logger[_0xecb0('0x12')](_0xecb0('0xd'),_0x54abf7,_0xa5719f[_0xecb0('0x12')][_0xecb0('0x13')]);return _0x4aaccd(_0xa5719f[_0xecb0('0x12')][_0xecb0('0x13')]);}logger[_0xecb0('0x12')](_0xecb0('0xd'),_0x54abf7,_0xa5719f[_0xecb0('0x12')][_0xecb0('0x13')]);return _0x4ee9b8(_0xa5719f[_0xecb0('0x12')][_0xecb0('0x13')]);}else{logger[_0xecb0('0x14')](_0xecb0('0xd'),_0x54abf7,'request\x20sent');_0x4ee9b8(_0xa5719f['result'][_0xecb0('0x13')]);}})[_0xecb0('0x15')](function(_0x203a59){logger[_0xecb0('0x12')](_0xecb0('0xd'),_0x54abf7,_0x203a59);_0x4aaccd(_0x203a59);});});}exports[_0xecb0('0x16')]=function(_0x1c2e4f){var _0x49bd56=this;return new Promise(function(_0x253bea,_0x2fa0df){return db[_0xecb0('0x17')][_0xecb0('0x18')]({'raw':_0x1c2e4f[_0xecb0('0x19')]?_0x1c2e4f[_0xecb0('0x19')][_0xecb0('0x1a')]===undefined?!![]:![]:!![],'where':_0x1c2e4f[_0xecb0('0x19')]?_0x1c2e4f[_0xecb0('0x19')][_0xecb0('0x1b')]||null:null,'attributes':_0x1c2e4f[_0xecb0('0x19')]?_0x1c2e4f[_0xecb0('0x19')][_0xecb0('0x1c')]||null:null,'limit':_0x1c2e4f[_0xecb0('0x19')]?_0x1c2e4f['options'][_0xecb0('0x1d')]||null:null,'include':_0x1c2e4f[_0xecb0('0x19')]?_0x1c2e4f['options'][_0xecb0('0x1e')]?_['map'](_0x1c2e4f[_0xecb0('0x19')][_0xecb0('0x1e')],function(_0x849d0d){return{'model':db[_0x849d0d[_0xecb0('0x1f')]],'as':_0x849d0d['as'],'attributes':_0x849d0d[_0xecb0('0x1c')],'include':_0x849d0d[_0xecb0('0x1e')]?_['map'](_0x849d0d['include'],function(_0xbdb69e){return{'model':db[_0xbdb69e[_0xecb0('0x1f')]],'as':_0xbdb69e['as'],'attributes':_0xbdb69e[_0xecb0('0x1c')],'include':_0xbdb69e[_0xecb0('0x1e')]?_['map'](_0xbdb69e[_0xecb0('0x1e')],function(_0x4dcc1d){return{'model':db[_0x4dcc1d[_0xecb0('0x1f')]],'as':_0x4dcc1d['as'],'attributes':_0x4dcc1d[_0xecb0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xecb0('0xc')](function(_0x4b3ff0){logger[_0xecb0('0x14')](_0xecb0('0x16'),_0x1c2e4f);logger[_0xecb0('0x20')](_0xecb0('0x16'),_0x1c2e4f,JSON[_0xecb0('0x10')](_0x4b3ff0));_0x253bea(_0x4b3ff0);})[_0xecb0('0x15')](function(_0x4001ac){logger['error']('GetSalesforceAccount',_0x4001ac[_0xecb0('0x13')],_0x1c2e4f);_0x2fa0df(_0x49bd56[_0xecb0('0x12')](0x1f4,_0x4001ac[_0xecb0('0x13')]));});});};exports['ShowSalesforceAccount']=function(_0x43d8dc){var _0x2c13a0=this;return new Promise(function(_0x189151,_0x4fee69){return db[_0xecb0('0x17')][_0xecb0('0x21')]({'raw':_0x43d8dc[_0xecb0('0x19')]?_0x43d8dc[_0xecb0('0x19')][_0xecb0('0x1a')]===undefined?!![]:![]:!![],'where':_0x43d8dc[_0xecb0('0x19')]?_0x43d8dc['options'][_0xecb0('0x1b')]||null:null,'attributes':_0x43d8dc[_0xecb0('0x19')]?_0x43d8dc[_0xecb0('0x19')][_0xecb0('0x1c')]||null:null,'include':_0x43d8dc[_0xecb0('0x19')]?_0x43d8dc[_0xecb0('0x19')][_0xecb0('0x1e')]?_[_0xecb0('0x22')](_0x43d8dc[_0xecb0('0x19')][_0xecb0('0x1e')],function(_0x224e0b){return{'model':db[_0x224e0b['model']],'as':_0x224e0b['as'],'attributes':_0x224e0b[_0xecb0('0x1c')],'include':_0x224e0b[_0xecb0('0x1e')]?_['map'](_0x224e0b[_0xecb0('0x1e')],function(_0x24fe6e){return{'model':db[_0x24fe6e['model']],'as':_0x24fe6e['as'],'attributes':_0x24fe6e['attributes'],'include':_0x24fe6e[_0xecb0('0x1e')]?_[_0xecb0('0x22')](_0x24fe6e[_0xecb0('0x1e')],function(_0x611bf3){return{'model':db[_0x611bf3['model']],'as':_0x611bf3['as'],'attributes':_0x611bf3[_0xecb0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xecb0('0xc')](function(_0x354e68){logger[_0xecb0('0x14')](_0xecb0('0x23'),_0x43d8dc);logger[_0xecb0('0x20')]('ShowSalesforceAccount',_0x43d8dc,JSON[_0xecb0('0x10')](_0x354e68));_0x189151(_0x354e68);})[_0xecb0('0x15')](function(_0x2bc938){logger[_0xecb0('0x12')]('ShowSalesforceAccount',_0x2bc938[_0xecb0('0x13')],_0x43d8dc);_0x4fee69(_0x2c13a0[_0xecb0('0x12')](0x1f4,_0x2bc938[_0xecb0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 4d71636..d916e4b 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xdb28,0x106));var _0x8db2=function(_0x5d32bf,_0x2b8112){_0x5d32bf=_0x5d32bf-0x0;var _0xd55b23=_0xdb28[_0x5d32bf];return _0xd55b23;};'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('./intSalesforceConfiguration.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['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file +var _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0x0b0e,0x187));var _0xe0b0=function(_0x50b1c5,_0x1cf2a9){_0x50b1c5=_0x50b1c5-0x0;var _0x344f99=_0x0b0e[_0x50b1c5];return _0x344f99;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index ff41160..fb158ab 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 _0x9899=['lead','account','sequelize','exports','STRING','ENUM','Task','Case','contact_lead','contact'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x9899,0xb6));var _0x9989=function(_0x5e60e6,_0x206364){_0x5e60e6=_0x5e60e6-0x0;var _0x351b81=_0x9899[_0x5e60e6];return _0x351b81;};'use strict';var Sequelize=require(_0x9989('0x0'));module[_0x9989('0x1')]={'name':{'type':Sequelize[_0x9989('0x2')]},'description':{'type':Sequelize[_0x9989('0x2')]},'ticketType':{'type':Sequelize[_0x9989('0x3')](_0x9989('0x4'),_0x9989('0x5')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x9989('0x3')](_0x9989('0x6'),_0x9989('0x7'),_0x9989('0x8'),'account_contact_lead','account'),'defaultValue':_0x9989('0x6')},'moduleCreate':{'type':Sequelize[_0x9989('0x3')]('nothing',_0x9989('0x7'),'lead',_0x9989('0x9')),'defaultValue':_0x9989('0x8')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x9989('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x9989('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x9989('0x2')]}}; \ No newline at end of file +var _0xbedd=['ENUM','Task','contact','lead','account_contact_lead','nothing','sequelize','STRING'];(function(_0x1570cc,_0xfec569){var _0x1ea201=function(_0x3db171){while(--_0x3db171){_0x1570cc['push'](_0x1570cc['shift']());}};_0x1ea201(++_0xfec569);}(_0xbedd,0x186));var _0xdbed=function(_0x20f7f4,_0x11fb3d){_0x20f7f4=_0x20f7f4-0x0;var _0x197f95=_0xbedd[_0x20f7f4];return _0x197f95;};'use strict';var Sequelize=require(_0xdbed('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdbed('0x1')]},'ticketType':{'type':Sequelize[_0xdbed('0x2')](_0xdbed('0x3'),'Case'),'defaultValue':_0xdbed('0x3')},'moduleSearch':{'type':Sequelize[_0xdbed('0x2')]('contact_lead',_0xdbed('0x4'),_0xdbed('0x5'),_0xdbed('0x6'),'account'),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xdbed('0x2')](_0xdbed('0x7'),_0xdbed('0x4'),_0xdbed('0x5'),'account'),'defaultValue':'lead'},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0xdbed('0x1')]},'additionalSearchContact':{'type':Sequelize[_0xdbed('0x1')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 0cffcd0..840355d 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 _0xb8bc=['bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','status','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','SalesforceConfiguration','includeAll','include','findAll','rows','catch','show','merge','find','create','body','params','getFields','findOne','SalesforceField','getSubjects','getDescriptions','request-promise','moment'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xb8bc,0x1d8));var _0xcb8b=function(_0x5539a4,_0x4ecbf7){_0x5539a4=_0x5539a4-0x0;var _0x313000=_0xb8bc[_0x5539a4];return _0x313000;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcb8b('0x0'));var moment=require(_0xcb8b('0x1'));var BPromise=require(_0xcb8b('0x2'));var Mustache=require(_0xcb8b('0x3'));var util=require(_0xcb8b('0x4'));var path=require(_0xcb8b('0x5'));var sox=require(_0xcb8b('0x6'));var csv=require(_0xcb8b('0x7'));var ejs=require(_0xcb8b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcb8b('0x9'));var squel=require(_0xcb8b('0xa'));var crypto=require(_0xcb8b('0xb'));var jsforce=require(_0xcb8b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcb8b('0x7'));var querystring=require('querystring');var Papa=require(_0xcb8b('0xd'));var Redis=require(_0xcb8b('0xe'));var authService=require(_0xcb8b('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb8b('0x10'))(_0xcb8b('0x11'));var utils=require(_0xcb8b('0x12'));var config=require(_0xcb8b('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xcb8b('0x14'))['db'];function respondWithStatusCode(_0x5da112,_0x10c1d6){_0x10c1d6=_0x10c1d6||0xcc;return function(_0x482328){if(_0x482328){return _0x5da112[_0xcb8b('0x15')](_0x10c1d6);}return _0x5da112['status'](_0x10c1d6)[_0xcb8b('0x16')]();};}function respondWithResult(_0x567fb0,_0x2cd125){_0x2cd125=_0x2cd125||0xc8;return function(_0x56c1b9){if(_0x56c1b9){return _0x567fb0['status'](_0x2cd125)[_0xcb8b('0x17')](_0x56c1b9);}};}function respondWithFilteredResult(_0x478044,_0x5720c6){return function(_0x33a8f7){if(_0x33a8f7){var _0x1b63f6=typeof _0x5720c6[_0xcb8b('0x18')]===_0xcb8b('0x19')&&typeof _0x5720c6[_0xcb8b('0x1a')]==='undefined';var _0x24cb38=_0x33a8f7[_0xcb8b('0x1b')];var _0x582ea5=_0x1b63f6?0x0:_0x5720c6[_0xcb8b('0x18')];var _0x5ea99c=_0x1b63f6?_0x33a8f7[_0xcb8b('0x1b')]:_0x5720c6[_0xcb8b('0x18')]+_0x5720c6[_0xcb8b('0x1a')];var _0x41efc3;if(_0x5ea99c>=_0x24cb38){_0x5ea99c=_0x24cb38;_0x41efc3=0xc8;}else{_0x41efc3=0xce;}_0x478044['status'](_0x41efc3);return _0x478044[_0xcb8b('0x1c')](_0xcb8b('0x1d'),_0x582ea5+'-'+_0x5ea99c+'/'+_0x24cb38)[_0xcb8b('0x17')](_0x33a8f7);}return null;};}function patchUpdates(_0x215bca){return function(_0x3c835e){try{jsonpatch[_0xcb8b('0x1e')](_0x3c835e,_0x215bca,!![]);}catch(_0x1e4a24){return BPromise[_0xcb8b('0x1f')](_0x1e4a24);}return _0x3c835e[_0xcb8b('0x20')]();};}function saveUpdates(_0x442bfb,_0x5464be){return function(_0x16ea5c){if(_0x16ea5c){return _0x16ea5c[_0xcb8b('0x21')](_0x442bfb)['then'](function(_0x232f34){return _0x232f34;});}return null;};}function removeEntity(_0x45dd57,_0x4b3a26){return function(_0x57cc55){if(_0x57cc55){return _0x57cc55[_0xcb8b('0x22')]()[_0xcb8b('0x23')](function(){_0x45dd57[_0xcb8b('0x24')](0xcc)[_0xcb8b('0x16')]();});}};}function handleEntityNotFound(_0x3049e3,_0x1b68a8){return function(_0x31f65e){if(!_0x31f65e){_0x3049e3[_0xcb8b('0x15')](0x194);}return _0x31f65e;};}function handleError(_0x1aef06,_0x2857c9){_0x2857c9=_0x2857c9||0x1f4;return function(_0x1ef76a){logger['error'](_0x1ef76a[_0xcb8b('0x25')]);if(_0x1ef76a[_0xcb8b('0x26')]){delete _0x1ef76a[_0xcb8b('0x26')];}_0x1aef06[_0xcb8b('0x24')](_0x2857c9)[_0xcb8b('0x27')](_0x1ef76a);};}exports['index']=function(_0x1cd221,_0x3f4265){var _0x4a51c3={},_0x5e3564={},_0x267039={'count':0x0,'rows':[]};var _0x16a5bf=_['map'](db['SalesforceConfiguration'][_0xcb8b('0x28')],function(_0x413f80){return{'name':_0x413f80[_0xcb8b('0x29')],'type':_0x413f80[_0xcb8b('0x2a')][_0xcb8b('0x2b')]};});_0x5e3564[_0xcb8b('0x2c')]=_[_0xcb8b('0x2d')](_0x16a5bf,_0xcb8b('0x26'));_0x5e3564[_0xcb8b('0x2e')]=_[_0xcb8b('0x2f')](_0x1cd221[_0xcb8b('0x2e')]);_0x5e3564[_0xcb8b('0x30')]=_['intersection'](_0x5e3564[_0xcb8b('0x2c')],_0x5e3564[_0xcb8b('0x2e')]);_0x4a51c3[_0xcb8b('0x31')]=_[_0xcb8b('0x32')](_0x5e3564[_0xcb8b('0x2c')],qs[_0xcb8b('0x33')](_0x1cd221[_0xcb8b('0x2e')][_0xcb8b('0x33')]));_0x4a51c3[_0xcb8b('0x31')]=_0x4a51c3[_0xcb8b('0x31')][_0xcb8b('0x34')]?_0x4a51c3[_0xcb8b('0x31')]:_0x5e3564['model'];if(!_0x1cd221[_0xcb8b('0x2e')][_0xcb8b('0x35')](_0xcb8b('0x36'))){_0x4a51c3[_0xcb8b('0x1a')]=qs[_0xcb8b('0x1a')](_0x1cd221[_0xcb8b('0x2e')][_0xcb8b('0x1a')]);_0x4a51c3['offset']=qs[_0xcb8b('0x18')](_0x1cd221[_0xcb8b('0x2e')][_0xcb8b('0x18')]);}_0x4a51c3[_0xcb8b('0x37')]=qs[_0xcb8b('0x38')](_0x1cd221[_0xcb8b('0x2e')][_0xcb8b('0x38')]);_0x4a51c3[_0xcb8b('0x39')]=qs[_0xcb8b('0x30')](_[_0xcb8b('0x3a')](_0x1cd221[_0xcb8b('0x2e')],_0x5e3564['filters']),_0x16a5bf);if(_0x1cd221['query'][_0xcb8b('0x3b')]){_0x4a51c3[_0xcb8b('0x39')]=_['merge'](_0x4a51c3['where'],{'$or':_['map'](_0x16a5bf,function(_0x5ffd14){if(_0x5ffd14[_0xcb8b('0x2a')]!==_0xcb8b('0x3c')){var _0x564b2f={};_0x564b2f[_0x5ffd14['name']]={'$like':'%'+_0x1cd221[_0xcb8b('0x2e')][_0xcb8b('0x3b')]+'%'};return _0x564b2f;}})});}_0x4a51c3=_['merge']({},_0x4a51c3,_0x1cd221[_0xcb8b('0x3d')]);var _0x3dbf28={'where':_0x4a51c3[_0xcb8b('0x39')]};return db[_0xcb8b('0x3e')][_0xcb8b('0x1b')](_0x3dbf28)[_0xcb8b('0x23')](function(_0x17b1d8){_0x267039[_0xcb8b('0x1b')]=_0x17b1d8;if(_0x1cd221['query'][_0xcb8b('0x3f')]){_0x4a51c3[_0xcb8b('0x40')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xcb8b('0x41')](_0x4a51c3);})[_0xcb8b('0x23')](function(_0x3799f5){_0x267039[_0xcb8b('0x42')]=_0x3799f5;return _0x267039;})[_0xcb8b('0x23')](respondWithFilteredResult(_0x3f4265,_0x4a51c3))[_0xcb8b('0x43')](handleError(_0x3f4265,null));};exports[_0xcb8b('0x44')]=function(_0x333563,_0x5b4440){var _0x45066b={'raw':![],'where':{'id':_0x333563['params']['id']}},_0x4ed11e={};_0x4ed11e['model']=_['keys'](db['SalesforceConfiguration'][_0xcb8b('0x28')]);_0x4ed11e[_0xcb8b('0x2e')]=_['keys'](_0x333563[_0xcb8b('0x2e')]);_0x4ed11e[_0xcb8b('0x30')]=_[_0xcb8b('0x32')](_0x4ed11e[_0xcb8b('0x2c')],_0x4ed11e[_0xcb8b('0x2e')]);_0x45066b['attributes']=_[_0xcb8b('0x32')](_0x4ed11e[_0xcb8b('0x2c')],qs[_0xcb8b('0x33')](_0x333563[_0xcb8b('0x2e')][_0xcb8b('0x33')]));_0x45066b[_0xcb8b('0x31')]=_0x45066b['attributes'][_0xcb8b('0x34')]?_0x45066b[_0xcb8b('0x31')]:_0x4ed11e[_0xcb8b('0x2c')];if(_0x333563[_0xcb8b('0x2e')][_0xcb8b('0x3f')]){_0x45066b[_0xcb8b('0x40')]=[{'all':!![]}];}_0x45066b=_[_0xcb8b('0x45')]({},_0x45066b,_0x333563[_0xcb8b('0x3d')]);return db[_0xcb8b('0x3e')][_0xcb8b('0x46')](_0x45066b)[_0xcb8b('0x23')](handleEntityNotFound(_0x5b4440,null))[_0xcb8b('0x23')](respondWithResult(_0x5b4440,null))[_0xcb8b('0x43')](handleError(_0x5b4440,null));};exports[_0xcb8b('0x47')]=function(_0x4f41be,_0x2821b2){return db[_0xcb8b('0x3e')][_0xcb8b('0x47')](_0x4f41be[_0xcb8b('0x48')],{})['then'](respondWithResult(_0x2821b2,0xc9))['catch'](handleError(_0x2821b2,null));};exports[_0xcb8b('0x21')]=function(_0x483f8d,_0x5b6ece){if(_0x483f8d[_0xcb8b('0x48')]['id']){delete _0x483f8d[_0xcb8b('0x48')]['id'];}return db['SalesforceConfiguration'][_0xcb8b('0x46')]({'where':{'id':_0x483f8d[_0xcb8b('0x49')]['id']}})[_0xcb8b('0x23')](handleEntityNotFound(_0x5b6ece,null))[_0xcb8b('0x23')](saveUpdates(_0x483f8d[_0xcb8b('0x48')],null))[_0xcb8b('0x23')](respondWithResult(_0x5b6ece,null))['catch'](handleError(_0x5b6ece,null));};exports[_0xcb8b('0x22')]=function(_0x2f7ffd,_0x21f4e8){return db[_0xcb8b('0x3e')]['find']({'where':{'id':_0x2f7ffd[_0xcb8b('0x49')]['id']}})[_0xcb8b('0x23')](handleEntityNotFound(_0x21f4e8,null))[_0xcb8b('0x23')](removeEntity(_0x21f4e8,null))['catch'](handleError(_0x21f4e8,null));};exports[_0xcb8b('0x4a')]=function(_0xa709d7,_0x4612ff,_0x5a5318){var _0x4e8bc7={};var _0x396ffa={};var _0x5a47c0;var _0x44d7f4;return db['SalesforceConfiguration'][_0xcb8b('0x4b')]({'where':{'id':_0xa709d7[_0xcb8b('0x49')]['id']}})[_0xcb8b('0x23')](handleEntityNotFound(_0x4612ff,null))[_0xcb8b('0x23')](function(_0x4daeb8){if(_0x4daeb8){_0x5a47c0=_0x4daeb8;_0x396ffa[_0xcb8b('0x2c')]=_[_0xcb8b('0x2f')](db[_0xcb8b('0x4c')]['rawAttributes']);_0x396ffa[_0xcb8b('0x2e')]=_[_0xcb8b('0x2f')](_0xa709d7[_0xcb8b('0x2e')]);_0x396ffa[_0xcb8b('0x30')]=_[_0xcb8b('0x32')](_0x396ffa[_0xcb8b('0x2c')],_0x396ffa[_0xcb8b('0x2e')]);_0x4e8bc7[_0xcb8b('0x31')]=_['intersection'](_0x396ffa[_0xcb8b('0x2c')],qs[_0xcb8b('0x33')](_0xa709d7[_0xcb8b('0x2e')][_0xcb8b('0x33')]));_0x4e8bc7[_0xcb8b('0x31')]=_0x4e8bc7[_0xcb8b('0x31')][_0xcb8b('0x34')]?_0x4e8bc7['attributes']:_0x396ffa[_0xcb8b('0x2c')];_0x4e8bc7[_0xcb8b('0x37')]=qs['sort'](_0xa709d7['query'][_0xcb8b('0x38')]);_0x4e8bc7[_0xcb8b('0x39')]=qs[_0xcb8b('0x30')](_[_0xcb8b('0x3a')](_0xa709d7['query'],_0x396ffa[_0xcb8b('0x30')]));if(_0xa709d7['query'][_0xcb8b('0x3b')]){_0x4e8bc7[_0xcb8b('0x39')]=_[_0xcb8b('0x45')](_0x4e8bc7[_0xcb8b('0x39')],{'$or':_[_0xcb8b('0x2d')](_0x4e8bc7['attributes'],function(_0x4f641f){var _0x11ab75={};_0x11ab75[_0x4f641f]={'$like':'%'+_0xa709d7[_0xcb8b('0x2e')][_0xcb8b('0x3b')]+'%'};return _0x11ab75;})});}_0x4e8bc7=_[_0xcb8b('0x45')]({},_0x4e8bc7,_0xa709d7[_0xcb8b('0x3d')]);return _0x5a47c0[_0xcb8b('0x4a')](_0x4e8bc7);}})[_0xcb8b('0x23')](function(_0x37f095){if(_0x37f095){_0x44d7f4=_0x37f095[_0xcb8b('0x34')];if(!_0xa709d7[_0xcb8b('0x2e')][_0xcb8b('0x35')](_0xcb8b('0x36'))){_0x4e8bc7['limit']=qs[_0xcb8b('0x1a')](_0xa709d7[_0xcb8b('0x2e')][_0xcb8b('0x1a')]);_0x4e8bc7[_0xcb8b('0x18')]=qs[_0xcb8b('0x18')](_0xa709d7[_0xcb8b('0x2e')]['offset']);}return _0x5a47c0[_0xcb8b('0x4a')](_0x4e8bc7);}})['then'](function(_0x2b2f03){if(_0x2b2f03){return _0x2b2f03?{'count':_0x44d7f4,'rows':_0x2b2f03}:null;}})[_0xcb8b('0x23')](respondWithResult(_0x4612ff,null))[_0xcb8b('0x43')](handleError(_0x4612ff,null));};exports[_0xcb8b('0x4d')]=function(_0xfe84e0,_0x3a39ae,_0x551dcf){var _0x1be969={};var _0x394929={};var _0x433b2d;var _0x23f1e6;return db[_0xcb8b('0x3e')][_0xcb8b('0x4b')]({'where':{'id':_0xfe84e0[_0xcb8b('0x49')]['id']}})[_0xcb8b('0x23')](handleEntityNotFound(_0x3a39ae,null))[_0xcb8b('0x23')](function(_0x4e16b9){if(_0x4e16b9){_0x433b2d=_0x4e16b9;_0x394929[_0xcb8b('0x2c')]=_['keys'](db[_0xcb8b('0x4c')][_0xcb8b('0x28')]);_0x394929[_0xcb8b('0x2e')]=_[_0xcb8b('0x2f')](_0xfe84e0[_0xcb8b('0x2e')]);_0x394929[_0xcb8b('0x30')]=_[_0xcb8b('0x32')](_0x394929[_0xcb8b('0x2c')],_0x394929['query']);_0x1be969['attributes']=_[_0xcb8b('0x32')](_0x394929[_0xcb8b('0x2c')],qs[_0xcb8b('0x33')](_0xfe84e0[_0xcb8b('0x2e')][_0xcb8b('0x33')]));_0x1be969[_0xcb8b('0x31')]=_0x1be969['attributes'][_0xcb8b('0x34')]?_0x1be969[_0xcb8b('0x31')]:_0x394929[_0xcb8b('0x2c')];_0x1be969[_0xcb8b('0x37')]=qs['sort'](_0xfe84e0[_0xcb8b('0x2e')][_0xcb8b('0x38')]);_0x1be969[_0xcb8b('0x39')]=qs['filters'](_[_0xcb8b('0x3a')](_0xfe84e0['query'],_0x394929[_0xcb8b('0x30')]));if(_0xfe84e0['query'][_0xcb8b('0x3b')]){_0x1be969['where']=_[_0xcb8b('0x45')](_0x1be969[_0xcb8b('0x39')],{'$or':_[_0xcb8b('0x2d')](_0x1be969[_0xcb8b('0x31')],function(_0x90a73c){var _0x5e8301={};_0x5e8301[_0x90a73c]={'$like':'%'+_0xfe84e0[_0xcb8b('0x2e')][_0xcb8b('0x3b')]+'%'};return _0x5e8301;})});}_0x1be969=_['merge']({},_0x1be969,_0xfe84e0[_0xcb8b('0x3d')]);return _0x433b2d[_0xcb8b('0x4d')](_0x1be969);}})[_0xcb8b('0x23')](function(_0x10a8bb){if(_0x10a8bb){_0x23f1e6=_0x10a8bb[_0xcb8b('0x34')];if(!_0xfe84e0[_0xcb8b('0x2e')][_0xcb8b('0x35')](_0xcb8b('0x36'))){_0x1be969['limit']=qs[_0xcb8b('0x1a')](_0xfe84e0[_0xcb8b('0x2e')][_0xcb8b('0x1a')]);_0x1be969[_0xcb8b('0x18')]=qs[_0xcb8b('0x18')](_0xfe84e0[_0xcb8b('0x2e')][_0xcb8b('0x18')]);}return _0x433b2d[_0xcb8b('0x4d')](_0x1be969);}})[_0xcb8b('0x23')](function(_0x4c7e09){if(_0x4c7e09){return _0x4c7e09?{'count':_0x23f1e6,'rows':_0x4c7e09}:null;}})[_0xcb8b('0x23')](respondWithResult(_0x3a39ae,null))[_0xcb8b('0x43')](handleError(_0x3a39ae,null));};exports[_0xcb8b('0x4e')]=function(_0x16f104,_0xf5ac6b,_0x2ce749){var _0x413abb={};var _0x383a4c={};var _0x42d8cf;var _0x30c722;return db[_0xcb8b('0x3e')][_0xcb8b('0x4b')]({'where':{'id':_0x16f104[_0xcb8b('0x49')]['id']}})['then'](handleEntityNotFound(_0xf5ac6b,null))['then'](function(_0x55d5d2){if(_0x55d5d2){_0x42d8cf=_0x55d5d2;_0x383a4c[_0xcb8b('0x2c')]=_[_0xcb8b('0x2f')](db[_0xcb8b('0x4c')][_0xcb8b('0x28')]);_0x383a4c[_0xcb8b('0x2e')]=_['keys'](_0x16f104['query']);_0x383a4c[_0xcb8b('0x30')]=_[_0xcb8b('0x32')](_0x383a4c[_0xcb8b('0x2c')],_0x383a4c[_0xcb8b('0x2e')]);_0x413abb[_0xcb8b('0x31')]=_[_0xcb8b('0x32')](_0x383a4c[_0xcb8b('0x2c')],qs[_0xcb8b('0x33')](_0x16f104['query'][_0xcb8b('0x33')]));_0x413abb['attributes']=_0x413abb[_0xcb8b('0x31')][_0xcb8b('0x34')]?_0x413abb[_0xcb8b('0x31')]:_0x383a4c['model'];_0x413abb[_0xcb8b('0x37')]=qs['sort'](_0x16f104[_0xcb8b('0x2e')][_0xcb8b('0x38')]);_0x413abb[_0xcb8b('0x39')]=qs[_0xcb8b('0x30')](_[_0xcb8b('0x3a')](_0x16f104['query'],_0x383a4c['filters']));if(_0x16f104[_0xcb8b('0x2e')][_0xcb8b('0x3b')]){_0x413abb['where']=_['merge'](_0x413abb[_0xcb8b('0x39')],{'$or':_[_0xcb8b('0x2d')](_0x413abb[_0xcb8b('0x31')],function(_0x480330){var _0x4f3c2b={};_0x4f3c2b[_0x480330]={'$like':'%'+_0x16f104[_0xcb8b('0x2e')][_0xcb8b('0x3b')]+'%'};return _0x4f3c2b;})});}_0x413abb=_[_0xcb8b('0x45')]({},_0x413abb,_0x16f104[_0xcb8b('0x3d')]);return _0x42d8cf[_0xcb8b('0x4e')](_0x413abb);}})[_0xcb8b('0x23')](function(_0x2dee08){if(_0x2dee08){_0x30c722=_0x2dee08[_0xcb8b('0x34')];if(!_0x16f104[_0xcb8b('0x2e')]['hasOwnProperty']('nolimit')){_0x413abb[_0xcb8b('0x1a')]=qs[_0xcb8b('0x1a')](_0x16f104[_0xcb8b('0x2e')]['limit']);_0x413abb[_0xcb8b('0x18')]=qs[_0xcb8b('0x18')](_0x16f104[_0xcb8b('0x2e')]['offset']);}return _0x42d8cf['getDescriptions'](_0x413abb);}})[_0xcb8b('0x23')](function(_0x465566){if(_0x465566){return _0x465566?{'count':_0x30c722,'rows':_0x465566}:null;}})['then'](respondWithResult(_0xf5ac6b,null))[_0xcb8b('0x43')](handleError(_0xf5ac6b,null));}; \ No newline at end of file +var _0x43e7=['zip-dir','bluebird','util','path','ejs','lodash','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','SalesforceConfiguration','rawAttributes','fieldName','type','key','keys','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','catch','show','params','body','find','getFields','findOne','getSubjects','SalesforceField','getDescriptions','eml-format'];(function(_0x306626,_0x425e93){var _0x466728=function(_0x3b3478){while(--_0x3b3478){_0x306626['push'](_0x306626['shift']());}};_0x466728(++_0x425e93);}(_0x43e7,0xda));var _0x743e=function(_0x533e4e,_0x4eba54){_0x533e4e=_0x533e4e-0x0;var _0x1f14bb=_0x43e7[_0x533e4e];return _0x1f14bb;};'use strict';var emlformat=require(_0x743e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x743e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x743e('0x2'));var Mustache=require('mustache');var util=require(_0x743e('0x3'));var path=require(_0x743e('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x743e('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x743e('0x6'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x743e('0x7'));var querystring=require(_0x743e('0x8'));var Papa=require(_0x743e('0x9'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x743e('0xa'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x743e('0xb'));var logger=require(_0x743e('0xc'))(_0x743e('0xd'));var utils=require('../../config/utils');var config=require(_0x743e('0xe'));var licenseUtil=require('../../config/license/util');var db=require(_0x743e('0xf'))['db'];function respondWithStatusCode(_0x367fe7,_0x456344){_0x456344=_0x456344||0xcc;return function(_0x5a9269){if(_0x5a9269){return _0x367fe7[_0x743e('0x10')](_0x456344);}return _0x367fe7[_0x743e('0x11')](_0x456344)[_0x743e('0x12')]();};}function respondWithResult(_0x32998e,_0x2ebce8){_0x2ebce8=_0x2ebce8||0xc8;return function(_0x4e8ed7){if(_0x4e8ed7){return _0x32998e['status'](_0x2ebce8)[_0x743e('0x13')](_0x4e8ed7);}};}function respondWithFilteredResult(_0x68e0e4,_0x2b4cf1){return function(_0x18dd39){if(_0x18dd39){var _0x263603=typeof _0x2b4cf1[_0x743e('0x14')]===_0x743e('0x15')&&typeof _0x2b4cf1[_0x743e('0x16')]===_0x743e('0x15');var _0xe8174b=_0x18dd39[_0x743e('0x17')];var _0x2ffa92=_0x263603?0x0:_0x2b4cf1[_0x743e('0x14')];var _0x195772=_0x263603?_0x18dd39[_0x743e('0x17')]:_0x2b4cf1[_0x743e('0x14')]+_0x2b4cf1[_0x743e('0x16')];var _0x2723ee;if(_0x195772>=_0xe8174b){_0x195772=_0xe8174b;_0x2723ee=0xc8;}else{_0x2723ee=0xce;}_0x68e0e4[_0x743e('0x11')](_0x2723ee);return _0x68e0e4[_0x743e('0x18')](_0x743e('0x19'),_0x2ffa92+'-'+_0x195772+'/'+_0xe8174b)[_0x743e('0x13')](_0x18dd39);}return null;};}function patchUpdates(_0x4a6bc8){return function(_0x2ea7fc){try{jsonpatch[_0x743e('0x1a')](_0x2ea7fc,_0x4a6bc8,!![]);}catch(_0x43523f){return BPromise[_0x743e('0x1b')](_0x43523f);}return _0x2ea7fc[_0x743e('0x1c')]();};}function saveUpdates(_0x5145e2,_0x43850d){return function(_0x2df2e9){if(_0x2df2e9){return _0x2df2e9[_0x743e('0x1d')](_0x5145e2)[_0x743e('0x1e')](function(_0x68ef57){return _0x68ef57;});}return null;};}function removeEntity(_0x10c273,_0x3baa81){return function(_0x42aed3){if(_0x42aed3){return _0x42aed3[_0x743e('0x1f')]()[_0x743e('0x1e')](function(){_0x10c273[_0x743e('0x11')](0xcc)[_0x743e('0x12')]();});}};}function handleEntityNotFound(_0x16b5e2,_0x334c23){return function(_0x5a3d4f){if(!_0x5a3d4f){_0x16b5e2[_0x743e('0x10')](0x194);}return _0x5a3d4f;};}function handleError(_0x378d3c,_0x217b84){_0x217b84=_0x217b84||0x1f4;return function(_0x962741){logger[_0x743e('0x20')](_0x962741[_0x743e('0x21')]);if(_0x962741['name']){delete _0x962741[_0x743e('0x22')];}_0x378d3c['status'](_0x217b84)['send'](_0x962741);};}exports[_0x743e('0x23')]=function(_0x230739,_0x4936c1){var _0x34f826={},_0x1da709={},_0x53eff3={'count':0x0,'rows':[]};var _0x3f72df=_['map'](db[_0x743e('0x24')][_0x743e('0x25')],function(_0x4cd1f7){return{'name':_0x4cd1f7[_0x743e('0x26')],'type':_0x4cd1f7[_0x743e('0x27')][_0x743e('0x28')]};});_0x1da709['model']=_['map'](_0x3f72df,_0x743e('0x22'));_0x1da709['query']=_[_0x743e('0x29')](_0x230739['query']);_0x1da709[_0x743e('0x2a')]=_[_0x743e('0x2b')](_0x1da709[_0x743e('0x2c')],_0x1da709['query']);_0x34f826[_0x743e('0x2d')]=_['intersection'](_0x1da709['model'],qs[_0x743e('0x2e')](_0x230739[_0x743e('0x2f')][_0x743e('0x2e')]));_0x34f826['attributes']=_0x34f826['attributes'][_0x743e('0x30')]?_0x34f826[_0x743e('0x2d')]:_0x1da709[_0x743e('0x2c')];if(!_0x230739[_0x743e('0x2f')][_0x743e('0x31')](_0x743e('0x32'))){_0x34f826[_0x743e('0x16')]=qs[_0x743e('0x16')](_0x230739[_0x743e('0x2f')][_0x743e('0x16')]);_0x34f826[_0x743e('0x14')]=qs[_0x743e('0x14')](_0x230739[_0x743e('0x2f')][_0x743e('0x14')]);}_0x34f826[_0x743e('0x33')]=qs[_0x743e('0x34')](_0x230739[_0x743e('0x2f')][_0x743e('0x34')]);_0x34f826[_0x743e('0x35')]=qs[_0x743e('0x2a')](_[_0x743e('0x36')](_0x230739[_0x743e('0x2f')],_0x1da709[_0x743e('0x2a')]),_0x3f72df);if(_0x230739[_0x743e('0x2f')][_0x743e('0x37')]){_0x34f826[_0x743e('0x35')]=_[_0x743e('0x38')](_0x34f826['where'],{'$or':_[_0x743e('0x39')](_0x3f72df,function(_0x310471){if(_0x310471[_0x743e('0x27')]!==_0x743e('0x3a')){var _0x39e985={};_0x39e985[_0x310471[_0x743e('0x22')]]={'$like':'%'+_0x230739['query'][_0x743e('0x37')]+'%'};return _0x39e985;}})});}_0x34f826=_['merge']({},_0x34f826,_0x230739[_0x743e('0x3b')]);var _0x3a1868={'where':_0x34f826[_0x743e('0x35')]};return db[_0x743e('0x24')][_0x743e('0x17')](_0x3a1868)[_0x743e('0x1e')](function(_0x241708){_0x53eff3[_0x743e('0x17')]=_0x241708;if(_0x230739[_0x743e('0x2f')][_0x743e('0x3c')]){_0x34f826[_0x743e('0x3d')]=[{'all':!![]}];}return db[_0x743e('0x24')][_0x743e('0x3e')](_0x34f826);})['then'](function(_0x5f1a6e){_0x53eff3['rows']=_0x5f1a6e;return _0x53eff3;})[_0x743e('0x1e')](respondWithFilteredResult(_0x4936c1,_0x34f826))[_0x743e('0x3f')](handleError(_0x4936c1,null));};exports[_0x743e('0x40')]=function(_0x24b3b3,_0x3ad3d0){var _0x56143c={'raw':![],'where':{'id':_0x24b3b3[_0x743e('0x41')]['id']}},_0x7a452={};_0x7a452[_0x743e('0x2c')]=_['keys'](db[_0x743e('0x24')][_0x743e('0x25')]);_0x7a452[_0x743e('0x2f')]=_[_0x743e('0x29')](_0x24b3b3[_0x743e('0x2f')]);_0x7a452[_0x743e('0x2a')]=_[_0x743e('0x2b')](_0x7a452['model'],_0x7a452[_0x743e('0x2f')]);_0x56143c[_0x743e('0x2d')]=_[_0x743e('0x2b')](_0x7a452[_0x743e('0x2c')],qs['fields'](_0x24b3b3[_0x743e('0x2f')][_0x743e('0x2e')]));_0x56143c[_0x743e('0x2d')]=_0x56143c[_0x743e('0x2d')][_0x743e('0x30')]?_0x56143c[_0x743e('0x2d')]:_0x7a452['model'];if(_0x24b3b3[_0x743e('0x2f')][_0x743e('0x3c')]){_0x56143c[_0x743e('0x3d')]=[{'all':!![]}];}_0x56143c=_[_0x743e('0x38')]({},_0x56143c,_0x24b3b3[_0x743e('0x3b')]);return db[_0x743e('0x24')]['find'](_0x56143c)[_0x743e('0x1e')](handleEntityNotFound(_0x3ad3d0,null))[_0x743e('0x1e')](respondWithResult(_0x3ad3d0,null))[_0x743e('0x3f')](handleError(_0x3ad3d0,null));};exports['create']=function(_0x515c11,_0x1b9648){return db['SalesforceConfiguration']['create'](_0x515c11[_0x743e('0x42')],{})[_0x743e('0x1e')](respondWithResult(_0x1b9648,0xc9))['catch'](handleError(_0x1b9648,null));};exports[_0x743e('0x1d')]=function(_0x583c98,_0x2d8889){if(_0x583c98[_0x743e('0x42')]['id']){delete _0x583c98[_0x743e('0x42')]['id'];}return db['SalesforceConfiguration']['find']({'where':{'id':_0x583c98[_0x743e('0x41')]['id']}})[_0x743e('0x1e')](handleEntityNotFound(_0x2d8889,null))[_0x743e('0x1e')](saveUpdates(_0x583c98['body'],null))[_0x743e('0x1e')](respondWithResult(_0x2d8889,null))[_0x743e('0x3f')](handleError(_0x2d8889,null));};exports[_0x743e('0x1f')]=function(_0x3ff095,_0x17d244){return db[_0x743e('0x24')][_0x743e('0x43')]({'where':{'id':_0x3ff095['params']['id']}})['then'](handleEntityNotFound(_0x17d244,null))[_0x743e('0x1e')](removeEntity(_0x17d244,null))[_0x743e('0x3f')](handleError(_0x17d244,null));};exports[_0x743e('0x44')]=function(_0x1ad129,_0x16514e,_0x50f078){var _0x251f9c={};var _0x579284={};var _0x681cdb;var _0x2b0b8a;return db[_0x743e('0x24')][_0x743e('0x45')]({'where':{'id':_0x1ad129['params']['id']}})['then'](handleEntityNotFound(_0x16514e,null))[_0x743e('0x1e')](function(_0x577648){if(_0x577648){_0x681cdb=_0x577648;_0x579284['model']=_[_0x743e('0x29')](db['SalesforceField'][_0x743e('0x25')]);_0x579284[_0x743e('0x2f')]=_[_0x743e('0x29')](_0x1ad129['query']);_0x579284[_0x743e('0x2a')]=_[_0x743e('0x2b')](_0x579284['model'],_0x579284[_0x743e('0x2f')]);_0x251f9c[_0x743e('0x2d')]=_[_0x743e('0x2b')](_0x579284[_0x743e('0x2c')],qs[_0x743e('0x2e')](_0x1ad129[_0x743e('0x2f')]['fields']));_0x251f9c[_0x743e('0x2d')]=_0x251f9c[_0x743e('0x2d')][_0x743e('0x30')]?_0x251f9c[_0x743e('0x2d')]:_0x579284[_0x743e('0x2c')];_0x251f9c[_0x743e('0x33')]=qs[_0x743e('0x34')](_0x1ad129['query'][_0x743e('0x34')]);_0x251f9c['where']=qs[_0x743e('0x2a')](_['pick'](_0x1ad129[_0x743e('0x2f')],_0x579284[_0x743e('0x2a')]));if(_0x1ad129[_0x743e('0x2f')]['filter']){_0x251f9c['where']=_[_0x743e('0x38')](_0x251f9c[_0x743e('0x35')],{'$or':_[_0x743e('0x39')](_0x251f9c[_0x743e('0x2d')],function(_0x36f41b){var _0x3a592f={};_0x3a592f[_0x36f41b]={'$like':'%'+_0x1ad129[_0x743e('0x2f')][_0x743e('0x37')]+'%'};return _0x3a592f;})});}_0x251f9c=_[_0x743e('0x38')]({},_0x251f9c,_0x1ad129[_0x743e('0x3b')]);return _0x681cdb[_0x743e('0x44')](_0x251f9c);}})[_0x743e('0x1e')](function(_0x27ce51){if(_0x27ce51){_0x2b0b8a=_0x27ce51['length'];if(!_0x1ad129[_0x743e('0x2f')][_0x743e('0x31')](_0x743e('0x32'))){_0x251f9c['limit']=qs[_0x743e('0x16')](_0x1ad129[_0x743e('0x2f')][_0x743e('0x16')]);_0x251f9c[_0x743e('0x14')]=qs[_0x743e('0x14')](_0x1ad129[_0x743e('0x2f')][_0x743e('0x14')]);}return _0x681cdb['getFields'](_0x251f9c);}})[_0x743e('0x1e')](function(_0x5ac0ea){if(_0x5ac0ea){return _0x5ac0ea?{'count':_0x2b0b8a,'rows':_0x5ac0ea}:null;}})[_0x743e('0x1e')](respondWithResult(_0x16514e,null))[_0x743e('0x3f')](handleError(_0x16514e,null));};exports[_0x743e('0x46')]=function(_0x2d0738,_0x4a590b,_0x56f12e){var _0x26f448={};var _0x33510e={};var _0x11b3c5;var _0x3938b6;return db[_0x743e('0x24')][_0x743e('0x45')]({'where':{'id':_0x2d0738['params']['id']}})['then'](handleEntityNotFound(_0x4a590b,null))[_0x743e('0x1e')](function(_0xc1d02b){if(_0xc1d02b){_0x11b3c5=_0xc1d02b;_0x33510e[_0x743e('0x2c')]=_[_0x743e('0x29')](db[_0x743e('0x47')][_0x743e('0x25')]);_0x33510e['query']=_[_0x743e('0x29')](_0x2d0738[_0x743e('0x2f')]);_0x33510e[_0x743e('0x2a')]=_[_0x743e('0x2b')](_0x33510e[_0x743e('0x2c')],_0x33510e[_0x743e('0x2f')]);_0x26f448['attributes']=_[_0x743e('0x2b')](_0x33510e['model'],qs['fields'](_0x2d0738[_0x743e('0x2f')]['fields']));_0x26f448[_0x743e('0x2d')]=_0x26f448[_0x743e('0x2d')][_0x743e('0x30')]?_0x26f448[_0x743e('0x2d')]:_0x33510e[_0x743e('0x2c')];_0x26f448[_0x743e('0x33')]=qs[_0x743e('0x34')](_0x2d0738[_0x743e('0x2f')][_0x743e('0x34')]);_0x26f448[_0x743e('0x35')]=qs[_0x743e('0x2a')](_['pick'](_0x2d0738[_0x743e('0x2f')],_0x33510e[_0x743e('0x2a')]));if(_0x2d0738[_0x743e('0x2f')][_0x743e('0x37')]){_0x26f448['where']=_[_0x743e('0x38')](_0x26f448['where'],{'$or':_[_0x743e('0x39')](_0x26f448[_0x743e('0x2d')],function(_0x2aa88c){var _0x12aaf6={};_0x12aaf6[_0x2aa88c]={'$like':'%'+_0x2d0738[_0x743e('0x2f')][_0x743e('0x37')]+'%'};return _0x12aaf6;})});}_0x26f448=_[_0x743e('0x38')]({},_0x26f448,_0x2d0738['options']);return _0x11b3c5[_0x743e('0x46')](_0x26f448);}})[_0x743e('0x1e')](function(_0x3d6149){if(_0x3d6149){_0x3938b6=_0x3d6149['length'];if(!_0x2d0738[_0x743e('0x2f')]['hasOwnProperty']('nolimit')){_0x26f448[_0x743e('0x16')]=qs[_0x743e('0x16')](_0x2d0738[_0x743e('0x2f')][_0x743e('0x16')]);_0x26f448['offset']=qs['offset'](_0x2d0738[_0x743e('0x2f')]['offset']);}return _0x11b3c5['getSubjects'](_0x26f448);}})[_0x743e('0x1e')](function(_0x559f00){if(_0x559f00){return _0x559f00?{'count':_0x3938b6,'rows':_0x559f00}:null;}})[_0x743e('0x1e')](respondWithResult(_0x4a590b,null))[_0x743e('0x3f')](handleError(_0x4a590b,null));};exports[_0x743e('0x48')]=function(_0x542ce3,_0x33821d,_0x184c64){var _0x2066db={};var _0xbd9c21={};var _0x1caecf;var _0x47cbb0;return db[_0x743e('0x24')][_0x743e('0x45')]({'where':{'id':_0x542ce3[_0x743e('0x41')]['id']}})[_0x743e('0x1e')](handleEntityNotFound(_0x33821d,null))['then'](function(_0x3505c9){if(_0x3505c9){_0x1caecf=_0x3505c9;_0xbd9c21[_0x743e('0x2c')]=_[_0x743e('0x29')](db[_0x743e('0x47')][_0x743e('0x25')]);_0xbd9c21['query']=_[_0x743e('0x29')](_0x542ce3['query']);_0xbd9c21['filters']=_[_0x743e('0x2b')](_0xbd9c21[_0x743e('0x2c')],_0xbd9c21[_0x743e('0x2f')]);_0x2066db['attributes']=_[_0x743e('0x2b')](_0xbd9c21[_0x743e('0x2c')],qs['fields'](_0x542ce3[_0x743e('0x2f')][_0x743e('0x2e')]));_0x2066db['attributes']=_0x2066db[_0x743e('0x2d')]['length']?_0x2066db[_0x743e('0x2d')]:_0xbd9c21[_0x743e('0x2c')];_0x2066db[_0x743e('0x33')]=qs[_0x743e('0x34')](_0x542ce3[_0x743e('0x2f')][_0x743e('0x34')]);_0x2066db[_0x743e('0x35')]=qs[_0x743e('0x2a')](_['pick'](_0x542ce3[_0x743e('0x2f')],_0xbd9c21[_0x743e('0x2a')]));if(_0x542ce3[_0x743e('0x2f')][_0x743e('0x37')]){_0x2066db[_0x743e('0x35')]=_[_0x743e('0x38')](_0x2066db[_0x743e('0x35')],{'$or':_[_0x743e('0x39')](_0x2066db[_0x743e('0x2d')],function(_0x1e3131){var _0xde772c={};_0xde772c[_0x1e3131]={'$like':'%'+_0x542ce3[_0x743e('0x2f')][_0x743e('0x37')]+'%'};return _0xde772c;})});}_0x2066db=_[_0x743e('0x38')]({},_0x2066db,_0x542ce3[_0x743e('0x3b')]);return _0x1caecf['getDescriptions'](_0x2066db);}})[_0x743e('0x1e')](function(_0x176142){if(_0x176142){_0x47cbb0=_0x176142[_0x743e('0x30')];if(!_0x542ce3['query'][_0x743e('0x31')](_0x743e('0x32'))){_0x2066db[_0x743e('0x16')]=qs[_0x743e('0x16')](_0x542ce3[_0x743e('0x2f')][_0x743e('0x16')]);_0x2066db[_0x743e('0x14')]=qs[_0x743e('0x14')](_0x542ce3[_0x743e('0x2f')]['offset']);}return _0x1caecf[_0x743e('0x48')](_0x2066db);}})[_0x743e('0x1e')](function(_0x530f2c){if(_0x530f2c){return _0x530f2c?{'count':_0x47cbb0,'rows':_0x530f2c}:null;}})['then'](respondWithResult(_0x33821d,null))[_0x743e('0x3f')](handleError(_0x33821d,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 1557d42..a447e4b 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 _0x3031=['api','bluebird','request-promise','path','../../config/environment','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger'];(function(_0x18ae07,_0x3706ea){var _0x5992a3=function(_0x2a09b0){while(--_0x2a09b0){_0x18ae07['push'](_0x18ae07['shift']());}};_0x5992a3(++_0x3706ea);}(_0x3031,0x81));var _0x1303=function(_0x4672d5,_0x22d730){_0x4672d5=_0x4672d5-0x0;var _0x207ed9=_0x3031[_0x4672d5];return _0x207ed9;};'use strict';var _=require(_0x1303('0x0'));var util=require(_0x1303('0x1'));var logger=require(_0x1303('0x2'))(_0x1303('0x3'));var moment=require('moment');var BPromise=require(_0x1303('0x4'));var rp=require(_0x1303('0x5'));var fs=require('fs');var path=require(_0x1303('0x6'));var rimraf=require('rimraf');var config=require(_0x1303('0x7'));var attributes=require(_0x1303('0x8'));module[_0x1303('0x9')]=function(_0x1c41cf,_0x6d6c10){return _0x1c41cf['define'](_0x1303('0xa'),attributes,{'tableName':_0x1303('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb471=['int_salesforce_configurations','util','../../config/logger','api','moment','bluebird','request-promise','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration'];(function(_0x2c3636,_0x2a5905){var _0x4e24d1=function(_0x203179){while(--_0x203179){_0x2c3636['push'](_0x2c3636['shift']());}};_0x4e24d1(++_0x2a5905);}(_0xb471,0xbc));var _0x1b47=function(_0x216f4f,_0x4fdb9c){_0x216f4f=_0x216f4f-0x0;var _0x4f554b=_0xb471[_0x216f4f];return _0x4f554b;};'use strict';var _=require('lodash');var util=require(_0x1b47('0x0'));var logger=require(_0x1b47('0x1'))(_0x1b47('0x2'));var moment=require(_0x1b47('0x3'));var BPromise=require(_0x1b47('0x4'));var rp=require(_0x1b47('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1b47('0x6'));module[_0x1b47('0x7')]=function(_0x1aeeda,_0x19394e){return _0x1aeeda[_0x1b47('0x8')](_0x1b47('0x9'),attributes,{'tableName':_0x1b47('0xa'),'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 48fa2d7..7f9c14b 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 _0x3006=['code','SalesforceConfiguration,\x20%s,\x20%s','message','catch','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error'];(function(_0x1be4c9,_0x44e677){var _0x42d8af=function(_0x19f81d){while(--_0x19f81d){_0x1be4c9['push'](_0x1be4c9['shift']());}};_0x42d8af(++_0x44e677);}(_0x3006,0x15a));var _0x6300=function(_0x498a4c,_0x562ddc){_0x498a4c=_0x498a4c-0x0;var _0x451184=_0x3006[_0x498a4c];return _0x451184;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6300('0x0'));var BPromise=require(_0x6300('0x1'));var rs=require(_0x6300('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6300('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6300('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6300('0x5'));var client=jayson[_0x6300('0x6')][_0x6300('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x544535,_0x2ef88e,_0x101532){return new BPromise(function(_0x367a64,_0x5432c3){return client[_0x6300('0x8')](_0x544535,_0x101532)[_0x6300('0x9')](function(_0x2a5681){logger[_0x6300('0xa')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2ef88e,'request\x20sent');logger[_0x6300('0xb')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x2ef88e,_0x6300('0xc'),JSON[_0x6300('0xd')](_0x2a5681));if(_0x2a5681[_0x6300('0xe')]){if(_0x2a5681[_0x6300('0xe')][_0x6300('0xf')]===0x1f4){logger['error'](_0x6300('0x10'),_0x2ef88e,_0x2a5681[_0x6300('0xe')][_0x6300('0x11')]);return _0x5432c3(_0x2a5681['error'][_0x6300('0x11')]);}logger[_0x6300('0xe')](_0x6300('0x10'),_0x2ef88e,_0x2a5681[_0x6300('0xe')]['message']);return _0x367a64(_0x2a5681[_0x6300('0xe')]['message']);}else{logger[_0x6300('0xa')](_0x6300('0x10'),_0x2ef88e,_0x6300('0xc'));_0x367a64(_0x2a5681['result'][_0x6300('0x11')]);}})[_0x6300('0x12')](function(_0x33910e){logger['error'](_0x6300('0x10'),_0x2ef88e,_0x33910e);_0x5432c3(_0x33910e);});});} \ No newline at end of file +var _0xc554=['then','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x5c4cc3,_0x192001){var _0x41fcc6=function(_0x28bd88){while(--_0x28bd88){_0x5c4cc3['push'](_0x5c4cc3['shift']());}};_0x41fcc6(++_0x192001);}(_0xc554,0x173));var _0x4c55=function(_0x12a612,_0x2a147e){_0x12a612=_0x12a612-0x0;var _0x20eea8=_0xc554[_0x12a612];return _0x20eea8;};'use strict';var _=require(_0x4c55('0x0'));var util=require(_0x4c55('0x1'));var moment=require(_0x4c55('0x2'));var BPromise=require(_0x4c55('0x3'));var rs=require(_0x4c55('0x4'));var fs=require('fs');var Redis=require(_0x4c55('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c55('0x6'));var logger=require(_0x4c55('0x7'))(_0x4c55('0x8'));var config=require(_0x4c55('0x9'));var jayson=require(_0x4c55('0xa'));var client=jayson[_0x4c55('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37113b,_0x43fad9,_0x3b88ce){return new BPromise(function(_0x3b0a83,_0x41ad0f){return client[_0x4c55('0xc')](_0x37113b,_0x3b88ce)[_0x4c55('0xd')](function(_0x3d26bc){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x43fad9,'request\x20sent');logger[_0x4c55('0xe')](_0x4c55('0xf'),_0x43fad9,_0x4c55('0x10'),JSON[_0x4c55('0x11')](_0x3d26bc));if(_0x3d26bc[_0x4c55('0x12')]){if(_0x3d26bc['error'][_0x4c55('0x13')]===0x1f4){logger['error'](_0x4c55('0x14'),_0x43fad9,_0x3d26bc[_0x4c55('0x12')][_0x4c55('0x15')]);return _0x41ad0f(_0x3d26bc[_0x4c55('0x12')][_0x4c55('0x15')]);}logger[_0x4c55('0x12')](_0x4c55('0x14'),_0x43fad9,_0x3d26bc[_0x4c55('0x12')]['message']);return _0x3b0a83(_0x3d26bc[_0x4c55('0x12')][_0x4c55('0x15')]);}else{logger['info'](_0x4c55('0x14'),_0x43fad9,_0x4c55('0x10'));_0x3b0a83(_0x3d26bc[_0x4c55('0x16')][_0x4c55('0x15')]);}})[_0x4c55('0x17')](function(_0x72c8df){logger[_0x4c55('0x12')](_0x4c55('0x14'),_0x43fad9,_0x72c8df);_0x41ad0f(_0x72c8df);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 10cf110..0847f56 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 _0x38f9=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','/:id','isAuthenticated','show','post','create','put'];(function(_0x580c5d,_0x1147db){var _0x4a0da1=function(_0xfdf31f){while(--_0xfdf31f){_0x580c5d['push'](_0x580c5d['shift']());}};_0x4a0da1(++_0x1147db);}(_0x38f9,0x1bc));var _0x938f=function(_0x1b3564,_0x16c919){_0x1b3564=_0x1b3564-0x0;var _0x504069=_0x38f9[_0x1b3564];return _0x504069;};'use strict';var multer=require('multer');var util=require(_0x938f('0x0'));var path=require(_0x938f('0x1'));var timeout=require(_0x938f('0x2'));var express=require(_0x938f('0x3'));var router=express[_0x938f('0x4')]();var fs_extra=require(_0x938f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x938f('0x6'));var config=require(_0x938f('0x7'));var controller=require(_0x938f('0x8'));router[_0x938f('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x938f('0x9')](_0x938f('0xa'),auth[_0x938f('0xb')](),controller[_0x938f('0xc')]);router[_0x938f('0xd')]('/',auth[_0x938f('0xb')](),controller[_0x938f('0xe')]);router[_0x938f('0xf')](_0x938f('0xa'),auth[_0x938f('0xb')](),controller[_0x938f('0x10')]);router[_0x938f('0x11')](_0x938f('0xa'),auth[_0x938f('0xb')](),controller[_0x938f('0x12')]);module[_0x938f('0x13')]=router; \ No newline at end of file +var _0x5be7=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','/:id','show','post','create','update','destroy','exports','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5be7,0x76));var _0x75be=function(_0x52e44c,_0xaee70b){_0x52e44c=_0x52e44c-0x0;var _0x131e4f=_0x5be7[_0x52e44c];return _0x131e4f;};'use strict';var multer=require('multer');var util=require(_0x75be('0x0'));var path=require(_0x75be('0x1'));var timeout=require(_0x75be('0x2'));var express=require(_0x75be('0x3'));var router=express[_0x75be('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x75be('0x5'));var config=require(_0x75be('0x6'));var controller=require(_0x75be('0x7'));router[_0x75be('0x8')]('/',auth[_0x75be('0x9')](),controller['index']);router[_0x75be('0x8')](_0x75be('0xa'),auth[_0x75be('0x9')](),controller[_0x75be('0xb')]);router[_0x75be('0xc')]('/',auth[_0x75be('0x9')](),controller[_0x75be('0xd')]);router['put'](_0x75be('0xa'),auth[_0x75be('0x9')](),controller[_0x75be('0xe')]);router['delete'](_0x75be('0xa'),auth[_0x75be('0x9')](),controller[_0x75be('0xf')]);module[_0x75be('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 244fd52..9dd49c4 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 _0x2f52=['STRING','sequelize','ENUM','variable','customVariable','keyValue','picklist','string'];(function(_0x4b99f0,_0x419040){var _0x29d886=function(_0x398626){while(--_0x398626){_0x4b99f0['push'](_0x4b99f0['shift']());}};_0x29d886(++_0x419040);}(_0x2f52,0x109));var _0x22f5=function(_0x573c9e,_0xd4ab71){_0x573c9e=_0x573c9e-0x0;var _0x5d0714=_0x2f52[_0x573c9e];return _0x5d0714;};'use strict';var Sequelize=require(_0x22f5('0x0'));module['exports']={'type':{'type':Sequelize[_0x22f5('0x1')]('string',_0x22f5('0x2'),_0x22f5('0x3'),_0x22f5('0x4'),_0x22f5('0x5')),'defaultValue':_0x22f5('0x6')},'content':{'type':Sequelize[_0x22f5('0x7')]},'key':{'type':Sequelize[_0x22f5('0x7')]},'keyType':{'type':Sequelize[_0x22f5('0x1')]('string','variable',_0x22f5('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x22f5('0x7')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x21fe=['exports','ENUM','variable','customVariable','keyValue','picklist','STRING','string','sequelize'];(function(_0x34ffa0,_0x31d22b){var _0x4b12e9=function(_0x22a1e8){while(--_0x22a1e8){_0x34ffa0['push'](_0x34ffa0['shift']());}};_0x4b12e9(++_0x31d22b);}(_0x21fe,0x13a));var _0xe21f=function(_0x19a25d,_0x347f75){_0x19a25d=_0x19a25d-0x0;var _0x216a9f=_0x21fe[_0x19a25d];return _0x216a9f;};'use strict';var Sequelize=require(_0xe21f('0x0'));module[_0xe21f('0x1')]={'type':{'type':Sequelize[_0xe21f('0x2')]('string',_0xe21f('0x3'),_0xe21f('0x4'),_0xe21f('0x5'),_0xe21f('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xe21f('0x7')]},'key':{'type':Sequelize[_0xe21f('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xe21f('0x8'),_0xe21f('0x3'),_0xe21f('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe21f('0x7')]},'variableName':{'type':Sequelize[_0xe21f('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 549a94f..03f8f3c 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 _0xc126=['request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','stack','name','index','rawAttributes','map','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','SalesforceField','include','findAll','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir'];(function(_0x3e436c,_0xebf949){var _0x3e4924=function(_0xab2179){while(--_0xab2179){_0x3e436c['push'](_0x3e436c['shift']());}};_0x3e4924(++_0xebf949);}(_0xc126,0x19b));var _0x6c12=function(_0x25a5b4,_0x596f8d){_0x25a5b4=_0x25a5b4-0x0;var _0x5edb56=_0xc126[_0x25a5b4];return _0x5edb56;};'use strict';var emlformat=require(_0x6c12('0x0'));var rimraf=require(_0x6c12('0x1'));var zipdir=require(_0x6c12('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c12('0x3'));var moment=require(_0x6c12('0x4'));var BPromise=require(_0x6c12('0x5'));var Mustache=require('mustache');var util=require(_0x6c12('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6c12('0x7'));var ejs=require(_0x6c12('0x8'));var fs=require('fs');var fs_extra=require(_0x6c12('0x9'));var _=require(_0x6c12('0xa'));var squel=require('squel');var crypto=require(_0x6c12('0xb'));var jsforce=require(_0x6c12('0xc'));var deskjs=require(_0x6c12('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6c12('0xe'));var Papa=require(_0x6c12('0xf'));var Redis=require('ioredis');var authService=require(_0x6c12('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6c12('0x11'));var logger=require(_0x6c12('0x12'))(_0x6c12('0x13'));var utils=require(_0x6c12('0x14'));var config=require(_0x6c12('0x15'));var licenseUtil=require(_0x6c12('0x16'));var db=require(_0x6c12('0x17'))['db'];function respondWithStatusCode(_0x4bd494,_0x4311e3){_0x4311e3=_0x4311e3||0xcc;return function(_0x57184c){if(_0x57184c){return _0x4bd494[_0x6c12('0x18')](_0x4311e3);}return _0x4bd494[_0x6c12('0x19')](_0x4311e3)[_0x6c12('0x1a')]();};}function respondWithResult(_0x41f6c7,_0xc05753){_0xc05753=_0xc05753||0xc8;return function(_0xe40ca1){if(_0xe40ca1){return _0x41f6c7[_0x6c12('0x19')](_0xc05753)['json'](_0xe40ca1);}};}function respondWithFilteredResult(_0x71811d,_0xdccbeb){return function(_0x207d6d){if(_0x207d6d){var _0x840d79=typeof _0xdccbeb[_0x6c12('0x1b')]===_0x6c12('0x1c')&&typeof _0xdccbeb[_0x6c12('0x1d')]===_0x6c12('0x1c');var _0x523d0b=_0x207d6d[_0x6c12('0x1e')];var _0x5d5693=_0x840d79?0x0:_0xdccbeb[_0x6c12('0x1b')];var _0x1260e1=_0x840d79?_0x207d6d['count']:_0xdccbeb['offset']+_0xdccbeb[_0x6c12('0x1d')];var _0x53ff2c;if(_0x1260e1>=_0x523d0b){_0x1260e1=_0x523d0b;_0x53ff2c=0xc8;}else{_0x53ff2c=0xce;}_0x71811d[_0x6c12('0x19')](_0x53ff2c);return _0x71811d['set'](_0x6c12('0x1f'),_0x5d5693+'-'+_0x1260e1+'/'+_0x523d0b)[_0x6c12('0x20')](_0x207d6d);}return null;};}function patchUpdates(_0x43de56){return function(_0x35ca42){try{jsonpatch[_0x6c12('0x21')](_0x35ca42,_0x43de56,!![]);}catch(_0x41bdde){return BPromise['reject'](_0x41bdde);}return _0x35ca42[_0x6c12('0x22')]();};}function saveUpdates(_0x1821ff,_0xacfed7){return function(_0x384c29){if(_0x384c29){return _0x384c29[_0x6c12('0x23')](_0x1821ff)[_0x6c12('0x24')](function(_0x4a28e0){return _0x4a28e0;});}return null;};}function removeEntity(_0x167753,_0xf6b744){return function(_0x1851e5){if(_0x1851e5){return _0x1851e5[_0x6c12('0x25')]()['then'](function(){_0x167753['status'](0xcc)[_0x6c12('0x1a')]();});}};}function handleEntityNotFound(_0x5ed7cd,_0xbdfbbb){return function(_0x7e46de){if(!_0x7e46de){_0x5ed7cd['sendStatus'](0x194);}return _0x7e46de;};}function handleError(_0x277a16,_0x4f202b){_0x4f202b=_0x4f202b||0x1f4;return function(_0x5b0196){logger['error'](_0x5b0196[_0x6c12('0x26')]);if(_0x5b0196[_0x6c12('0x27')]){delete _0x5b0196[_0x6c12('0x27')];}_0x277a16['status'](_0x4f202b)['send'](_0x5b0196);};}exports[_0x6c12('0x28')]=function(_0x33e38b,_0x1d7622){var _0x300bd2={},_0x14989c={},_0x2b6e1a={'count':0x0,'rows':[]};var _0x1ad6d9=_['map'](db['SalesforceField'][_0x6c12('0x29')],function(_0x1e7966){return{'name':_0x1e7966['fieldName'],'type':_0x1e7966['type']['key']};});_0x14989c['model']=_[_0x6c12('0x2a')](_0x1ad6d9,_0x6c12('0x27'));_0x14989c[_0x6c12('0x2b')]=_[_0x6c12('0x2c')](_0x33e38b[_0x6c12('0x2b')]);_0x14989c[_0x6c12('0x2d')]=_[_0x6c12('0x2e')](_0x14989c['model'],_0x14989c[_0x6c12('0x2b')]);_0x300bd2[_0x6c12('0x2f')]=_[_0x6c12('0x2e')](_0x14989c[_0x6c12('0x30')],qs[_0x6c12('0x31')](_0x33e38b[_0x6c12('0x2b')][_0x6c12('0x31')]));_0x300bd2[_0x6c12('0x2f')]=_0x300bd2[_0x6c12('0x2f')]['length']?_0x300bd2[_0x6c12('0x2f')]:_0x14989c[_0x6c12('0x30')];if(!_0x33e38b[_0x6c12('0x2b')][_0x6c12('0x32')]('nolimit')){_0x300bd2['limit']=qs[_0x6c12('0x1d')](_0x33e38b[_0x6c12('0x2b')][_0x6c12('0x1d')]);_0x300bd2[_0x6c12('0x1b')]=qs[_0x6c12('0x1b')](_0x33e38b[_0x6c12('0x2b')][_0x6c12('0x1b')]);}_0x300bd2[_0x6c12('0x33')]=qs[_0x6c12('0x34')](_0x33e38b['query']['sort']);_0x300bd2[_0x6c12('0x35')]=qs['filters'](_[_0x6c12('0x36')](_0x33e38b[_0x6c12('0x2b')],_0x14989c[_0x6c12('0x2d')]),_0x1ad6d9);if(_0x33e38b['query']['filter']){_0x300bd2['where']=_[_0x6c12('0x37')](_0x300bd2['where'],{'$or':_['map'](_0x1ad6d9,function(_0x57dc4c){if(_0x57dc4c['type']!==_0x6c12('0x38')){var _0x533077={};_0x533077[_0x57dc4c[_0x6c12('0x27')]]={'$like':'%'+_0x33e38b[_0x6c12('0x2b')][_0x6c12('0x39')]+'%'};return _0x533077;}})});}_0x300bd2=_[_0x6c12('0x37')]({},_0x300bd2,_0x33e38b[_0x6c12('0x3a')]);var _0x169652={'where':_0x300bd2[_0x6c12('0x35')]};return db[_0x6c12('0x3b')][_0x6c12('0x1e')](_0x169652)[_0x6c12('0x24')](function(_0x4f0635){_0x2b6e1a[_0x6c12('0x1e')]=_0x4f0635;if(_0x33e38b[_0x6c12('0x2b')]['includeAll']){_0x300bd2[_0x6c12('0x3c')]=[{'all':!![]}];}return db[_0x6c12('0x3b')][_0x6c12('0x3d')](_0x300bd2);})[_0x6c12('0x24')](function(_0x388432){_0x2b6e1a['rows']=_0x388432;return _0x2b6e1a;})[_0x6c12('0x24')](respondWithFilteredResult(_0x1d7622,_0x300bd2))[_0x6c12('0x3e')](handleError(_0x1d7622,null));};exports[_0x6c12('0x3f')]=function(_0x5556bf,_0x4d2053){var _0x3a4f1e={'raw':!![],'where':{'id':_0x5556bf[_0x6c12('0x40')]['id']}},_0x2a526b={};_0x2a526b[_0x6c12('0x30')]=_['keys'](db[_0x6c12('0x3b')][_0x6c12('0x29')]);_0x2a526b['query']=_[_0x6c12('0x2c')](_0x5556bf[_0x6c12('0x2b')]);_0x2a526b[_0x6c12('0x2d')]=_[_0x6c12('0x2e')](_0x2a526b[_0x6c12('0x30')],_0x2a526b[_0x6c12('0x2b')]);_0x3a4f1e[_0x6c12('0x2f')]=_['intersection'](_0x2a526b['model'],qs['fields'](_0x5556bf[_0x6c12('0x2b')][_0x6c12('0x31')]));_0x3a4f1e['attributes']=_0x3a4f1e['attributes'][_0x6c12('0x41')]?_0x3a4f1e[_0x6c12('0x2f')]:_0x2a526b['model'];if(_0x5556bf['query']['includeAll']){_0x3a4f1e['include']=[{'all':!![]}];}_0x3a4f1e=_[_0x6c12('0x37')]({},_0x3a4f1e,_0x5556bf[_0x6c12('0x3a')]);return db[_0x6c12('0x3b')][_0x6c12('0x42')](_0x3a4f1e)[_0x6c12('0x24')](handleEntityNotFound(_0x4d2053,null))[_0x6c12('0x24')](respondWithResult(_0x4d2053,null))[_0x6c12('0x3e')](handleError(_0x4d2053,null));};exports[_0x6c12('0x43')]=function(_0x549c51,_0x6e5251){return db[_0x6c12('0x3b')]['create'](_0x549c51[_0x6c12('0x44')],{})[_0x6c12('0x24')](respondWithResult(_0x6e5251,0xc9))['catch'](handleError(_0x6e5251,null));};exports['update']=function(_0x60daef,_0x4f44ec){if(_0x60daef[_0x6c12('0x44')]['id']){delete _0x60daef[_0x6c12('0x44')]['id'];}return db['SalesforceField'][_0x6c12('0x42')]({'where':{'id':_0x60daef[_0x6c12('0x40')]['id']}})[_0x6c12('0x24')](handleEntityNotFound(_0x4f44ec,null))[_0x6c12('0x24')](saveUpdates(_0x60daef[_0x6c12('0x44')],null))['then'](respondWithResult(_0x4f44ec,null))['catch'](handleError(_0x4f44ec,null));};exports[_0x6c12('0x25')]=function(_0x109b08,_0x58a467){return db[_0x6c12('0x3b')][_0x6c12('0x42')]({'where':{'id':_0x109b08[_0x6c12('0x40')]['id']}})[_0x6c12('0x24')](handleEntityNotFound(_0x58a467,null))[_0x6c12('0x24')](removeEntity(_0x58a467,null))[_0x6c12('0x3e')](handleError(_0x58a467,null));}; \ No newline at end of file +var _0xfd77=['status','end','json','offset','limit','undefined','count','set','reject','update','destroy','then','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','create','body','find','params','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x20b80b,_0x788618){var _0x40820d=function(_0x1cae91){while(--_0x1cae91){_0x20b80b['push'](_0x20b80b['shift']());}};_0x40820d(++_0x788618);}(_0xfd77,0xbb));var _0x7fd7=function(_0x198f04,_0x4e0dc8){_0x198f04=_0x198f04-0x0;var _0x541a84=_0xfd77[_0x198f04];return _0x541a84;};'use strict';var emlformat=require(_0x7fd7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7fd7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7fd7('0x2'));var BPromise=require(_0x7fd7('0x3'));var Mustache=require(_0x7fd7('0x4'));var util=require(_0x7fd7('0x5'));var path=require(_0x7fd7('0x6'));var sox=require(_0x7fd7('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7fd7('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7fd7('0x9'));var deskjs=require(_0x7fd7('0xa'));var toCsv=require(_0x7fd7('0xb'));var querystring=require('querystring');var Papa=require(_0x7fd7('0xc'));var Redis=require(_0x7fd7('0xd'));var authService=require(_0x7fd7('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7fd7('0xf'));var logger=require(_0x7fd7('0x10'))(_0x7fd7('0x11'));var utils=require(_0x7fd7('0x12'));var config=require(_0x7fd7('0x13'));var licenseUtil=require(_0x7fd7('0x14'));var db=require(_0x7fd7('0x15'))['db'];function respondWithStatusCode(_0x4e7828,_0x139ff7){_0x139ff7=_0x139ff7||0xcc;return function(_0x343b25){if(_0x343b25){return _0x4e7828[_0x7fd7('0x16')](_0x139ff7);}return _0x4e7828[_0x7fd7('0x17')](_0x139ff7)[_0x7fd7('0x18')]();};}function respondWithResult(_0x55eb21,_0x49eeb6){_0x49eeb6=_0x49eeb6||0xc8;return function(_0x44bfef){if(_0x44bfef){return _0x55eb21[_0x7fd7('0x17')](_0x49eeb6)[_0x7fd7('0x19')](_0x44bfef);}};}function respondWithFilteredResult(_0x1b56d3,_0x12bbf6){return function(_0x27729e){if(_0x27729e){var _0x157e57=typeof _0x12bbf6[_0x7fd7('0x1a')]==='undefined'&&typeof _0x12bbf6[_0x7fd7('0x1b')]===_0x7fd7('0x1c');var _0x1634d3=_0x27729e[_0x7fd7('0x1d')];var _0x2901a9=_0x157e57?0x0:_0x12bbf6['offset'];var _0x50e5b6=_0x157e57?_0x27729e[_0x7fd7('0x1d')]:_0x12bbf6[_0x7fd7('0x1a')]+_0x12bbf6[_0x7fd7('0x1b')];var _0x2e73b3;if(_0x50e5b6>=_0x1634d3){_0x50e5b6=_0x1634d3;_0x2e73b3=0xc8;}else{_0x2e73b3=0xce;}_0x1b56d3['status'](_0x2e73b3);return _0x1b56d3[_0x7fd7('0x1e')]('Content-Range',_0x2901a9+'-'+_0x50e5b6+'/'+_0x1634d3)[_0x7fd7('0x19')](_0x27729e);}return null;};}function patchUpdates(_0x349e22){return function(_0x352383){try{jsonpatch['apply'](_0x352383,_0x349e22,!![]);}catch(_0x251d8d){return BPromise[_0x7fd7('0x1f')](_0x251d8d);}return _0x352383['save']();};}function saveUpdates(_0x55f943,_0x5d2a10){return function(_0x1b341f){if(_0x1b341f){return _0x1b341f[_0x7fd7('0x20')](_0x55f943)['then'](function(_0x3a7b81){return _0x3a7b81;});}return null;};}function removeEntity(_0x3981f1,_0x50405d){return function(_0x3759b1){if(_0x3759b1){return _0x3759b1[_0x7fd7('0x21')]()[_0x7fd7('0x22')](function(){_0x3981f1[_0x7fd7('0x17')](0xcc)[_0x7fd7('0x18')]();});}};}function handleEntityNotFound(_0x3aa08d,_0x52f70a){return function(_0x210eb8){if(!_0x210eb8){_0x3aa08d[_0x7fd7('0x16')](0x194);}return _0x210eb8;};}function handleError(_0x4cce84,_0x2b8a11){_0x2b8a11=_0x2b8a11||0x1f4;return function(_0x8b7a8e){logger['error'](_0x8b7a8e[_0x7fd7('0x23')]);if(_0x8b7a8e[_0x7fd7('0x24')]){delete _0x8b7a8e[_0x7fd7('0x24')];}_0x4cce84[_0x7fd7('0x17')](_0x2b8a11)[_0x7fd7('0x25')](_0x8b7a8e);};}exports[_0x7fd7('0x26')]=function(_0x1b2e73,_0x1db6c6){var _0x2f7a0b={},_0x551483={},_0xfbc73d={'count':0x0,'rows':[]};var _0x336dbb=_[_0x7fd7('0x27')](db[_0x7fd7('0x28')][_0x7fd7('0x29')],function(_0x5a995c){return{'name':_0x5a995c[_0x7fd7('0x2a')],'type':_0x5a995c[_0x7fd7('0x2b')][_0x7fd7('0x2c')]};});_0x551483[_0x7fd7('0x2d')]=_['map'](_0x336dbb,'name');_0x551483['query']=_[_0x7fd7('0x2e')](_0x1b2e73['query']);_0x551483['filters']=_[_0x7fd7('0x2f')](_0x551483[_0x7fd7('0x2d')],_0x551483[_0x7fd7('0x30')]);_0x2f7a0b[_0x7fd7('0x31')]=_[_0x7fd7('0x2f')](_0x551483[_0x7fd7('0x2d')],qs[_0x7fd7('0x32')](_0x1b2e73[_0x7fd7('0x30')][_0x7fd7('0x32')]));_0x2f7a0b['attributes']=_0x2f7a0b[_0x7fd7('0x31')][_0x7fd7('0x33')]?_0x2f7a0b[_0x7fd7('0x31')]:_0x551483['model'];if(!_0x1b2e73[_0x7fd7('0x30')][_0x7fd7('0x34')](_0x7fd7('0x35'))){_0x2f7a0b[_0x7fd7('0x1b')]=qs[_0x7fd7('0x1b')](_0x1b2e73[_0x7fd7('0x30')][_0x7fd7('0x1b')]);_0x2f7a0b[_0x7fd7('0x1a')]=qs[_0x7fd7('0x1a')](_0x1b2e73[_0x7fd7('0x30')][_0x7fd7('0x1a')]);}_0x2f7a0b['order']=qs[_0x7fd7('0x36')](_0x1b2e73['query'][_0x7fd7('0x36')]);_0x2f7a0b['where']=qs['filters'](_['pick'](_0x1b2e73[_0x7fd7('0x30')],_0x551483[_0x7fd7('0x37')]),_0x336dbb);if(_0x1b2e73[_0x7fd7('0x30')]['filter']){_0x2f7a0b[_0x7fd7('0x38')]=_[_0x7fd7('0x39')](_0x2f7a0b['where'],{'$or':_[_0x7fd7('0x27')](_0x336dbb,function(_0x2ec5d1){if(_0x2ec5d1[_0x7fd7('0x2b')]!==_0x7fd7('0x3a')){var _0x866822={};_0x866822[_0x2ec5d1[_0x7fd7('0x24')]]={'$like':'%'+_0x1b2e73['query'][_0x7fd7('0x3b')]+'%'};return _0x866822;}})});}_0x2f7a0b=_['merge']({},_0x2f7a0b,_0x1b2e73[_0x7fd7('0x3c')]);var _0x286834={'where':_0x2f7a0b[_0x7fd7('0x38')]};return db[_0x7fd7('0x28')][_0x7fd7('0x1d')](_0x286834)[_0x7fd7('0x22')](function(_0x55ceb4){_0xfbc73d[_0x7fd7('0x1d')]=_0x55ceb4;if(_0x1b2e73[_0x7fd7('0x30')][_0x7fd7('0x3d')]){_0x2f7a0b[_0x7fd7('0x3e')]=[{'all':!![]}];}return db[_0x7fd7('0x28')][_0x7fd7('0x3f')](_0x2f7a0b);})[_0x7fd7('0x22')](function(_0x168c0c){_0xfbc73d[_0x7fd7('0x40')]=_0x168c0c;return _0xfbc73d;})[_0x7fd7('0x22')](respondWithFilteredResult(_0x1db6c6,_0x2f7a0b))[_0x7fd7('0x41')](handleError(_0x1db6c6,null));};exports['show']=function(_0x16e68e,_0x2696da){var _0x332206={'raw':!![],'where':{'id':_0x16e68e['params']['id']}},_0x2cf43d={};_0x2cf43d['model']=_[_0x7fd7('0x2e')](db[_0x7fd7('0x28')][_0x7fd7('0x29')]);_0x2cf43d[_0x7fd7('0x30')]=_['keys'](_0x16e68e['query']);_0x2cf43d[_0x7fd7('0x37')]=_[_0x7fd7('0x2f')](_0x2cf43d[_0x7fd7('0x2d')],_0x2cf43d[_0x7fd7('0x30')]);_0x332206[_0x7fd7('0x31')]=_[_0x7fd7('0x2f')](_0x2cf43d['model'],qs[_0x7fd7('0x32')](_0x16e68e['query'][_0x7fd7('0x32')]));_0x332206[_0x7fd7('0x31')]=_0x332206['attributes'][_0x7fd7('0x33')]?_0x332206[_0x7fd7('0x31')]:_0x2cf43d['model'];if(_0x16e68e[_0x7fd7('0x30')][_0x7fd7('0x3d')]){_0x332206[_0x7fd7('0x3e')]=[{'all':!![]}];}_0x332206=_[_0x7fd7('0x39')]({},_0x332206,_0x16e68e['options']);return db[_0x7fd7('0x28')]['find'](_0x332206)['then'](handleEntityNotFound(_0x2696da,null))[_0x7fd7('0x22')](respondWithResult(_0x2696da,null))[_0x7fd7('0x41')](handleError(_0x2696da,null));};exports[_0x7fd7('0x42')]=function(_0x4af9e2,_0x4aea7d){return db['SalesforceField']['create'](_0x4af9e2[_0x7fd7('0x43')],{})[_0x7fd7('0x22')](respondWithResult(_0x4aea7d,0xc9))[_0x7fd7('0x41')](handleError(_0x4aea7d,null));};exports[_0x7fd7('0x20')]=function(_0x9a49da,_0x478280){if(_0x9a49da[_0x7fd7('0x43')]['id']){delete _0x9a49da[_0x7fd7('0x43')]['id'];}return db[_0x7fd7('0x28')][_0x7fd7('0x44')]({'where':{'id':_0x9a49da[_0x7fd7('0x45')]['id']}})[_0x7fd7('0x22')](handleEntityNotFound(_0x478280,null))[_0x7fd7('0x22')](saveUpdates(_0x9a49da[_0x7fd7('0x43')],null))['then'](respondWithResult(_0x478280,null))[_0x7fd7('0x41')](handleError(_0x478280,null));};exports[_0x7fd7('0x21')]=function(_0x2f84eb,_0xb7d769){return db[_0x7fd7('0x28')][_0x7fd7('0x44')]({'where':{'id':_0x2f84eb[_0x7fd7('0x45')]['id']}})[_0x7fd7('0x22')](handleEntityNotFound(_0xb7d769,null))[_0x7fd7('0x22')](removeEntity(_0xb7d769,null))[_0x7fd7('0x41')](handleError(_0xb7d769,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 9d03624..8bbc6e5 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 _0x77bb=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','idField','FieldId','lodash'];(function(_0x3603ba,_0x137527){var _0x15f202=function(_0x10c121){while(--_0x10c121){_0x3603ba['push'](_0x3603ba['shift']());}};_0x15f202(++_0x137527);}(_0x77bb,0x8f));var _0xb77b=function(_0x3f53c9,_0x1a6047){_0x3f53c9=_0x3f53c9-0x0;var _0x486a47=_0x77bb[_0x3f53c9];return _0x486a47;};'use strict';var _=require(_0xb77b('0x0'));var util=require(_0xb77b('0x1'));var logger=require(_0xb77b('0x2'))(_0xb77b('0x3'));var moment=require(_0xb77b('0x4'));var BPromise=require(_0xb77b('0x5'));var rp=require(_0xb77b('0x6'));var fs=require('fs');var path=require(_0xb77b('0x7'));var rimraf=require('rimraf');var config=require(_0xb77b('0x8'));var attributes=require(_0xb77b('0x9'));module[_0xb77b('0xa')]=function(_0x3c6ec5,_0xd757de){return _0x3c6ec5[_0xb77b('0xb')](_0xb77b('0xc'),attributes,{'tableName':_0xb77b('0xd'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0xb77b('0xe'),_0xb77b('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8313=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','SalesforceField','int_salesforce_fields','idField','lodash','util','../../config/logger'];(function(_0x347379,_0x37de29){var _0x1e6dbf=function(_0x137484){while(--_0x137484){_0x347379['push'](_0x347379['shift']());}};_0x1e6dbf(++_0x37de29);}(_0x8313,0x115));var _0x3831=function(_0x2b9ec4,_0x441c65){_0x2b9ec4=_0x2b9ec4-0x0;var _0x38bdbe=_0x8313[_0x2b9ec4];return _0x38bdbe;};'use strict';var _=require(_0x3831('0x0'));var util=require(_0x3831('0x1'));var logger=require(_0x3831('0x2'))(_0x3831('0x3'));var moment=require(_0x3831('0x4'));var BPromise=require(_0x3831('0x5'));var rp=require(_0x3831('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3831('0x7'));var config=require(_0x3831('0x8'));var attributes=require('./intSalesforceField.attributes');module[_0x3831('0x9')]=function(_0x50c860,_0x29e066){return _0x50c860[_0x3831('0xa')](_0x3831('0xb'),attributes,{'tableName':_0x3831('0xc'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x3831('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index dff3365..5e9239f 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 _0xea7b=['rpc','../../config/environment','jayson/promise','client','http','then','SalesforceField,\x20%s,\x20%s','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x455893,_0x909838){var _0x3851e8=function(_0x32ac8a){while(--_0x32ac8a){_0x455893['push'](_0x455893['shift']());}};_0x3851e8(++_0x909838);}(_0xea7b,0xd5));var _0xbea7=function(_0xeb92f0,_0x1e102e){_0xeb92f0=_0xeb92f0-0x0;var _0x8bd9b6=_0xea7b[_0xeb92f0];return _0x8bd9b6;};'use strict';var _=require(_0xbea7('0x0'));var util=require(_0xbea7('0x1'));var moment=require('moment');var BPromise=require(_0xbea7('0x2'));var rs=require(_0xbea7('0x3'));var fs=require('fs');var Redis=require(_0xbea7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbea7('0x5'));var logger=require(_0xbea7('0x6'))(_0xbea7('0x7'));var config=require(_0xbea7('0x8'));var jayson=require(_0xbea7('0x9'));var client=jayson[_0xbea7('0xa')][_0xbea7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38430a,_0x318166,_0x1c875e){return new BPromise(function(_0x52dea1,_0x4c09ee){return client['request'](_0x38430a,_0x1c875e)[_0xbea7('0xc')](function(_0x48134a){logger['info'](_0xbea7('0xd'),_0x318166,'request\x20sent');logger['debug'](_0xbea7('0xe'),_0x318166,'request\x20sent',JSON['stringify'](_0x48134a));if(_0x48134a[_0xbea7('0xf')]){if(_0x48134a[_0xbea7('0xf')][_0xbea7('0x10')]===0x1f4){logger[_0xbea7('0xf')](_0xbea7('0xd'),_0x318166,_0x48134a[_0xbea7('0xf')][_0xbea7('0x11')]);return _0x4c09ee(_0x48134a[_0xbea7('0xf')]['message']);}logger['error'](_0xbea7('0xd'),_0x318166,_0x48134a['error'][_0xbea7('0x11')]);return _0x52dea1(_0x48134a[_0xbea7('0xf')][_0xbea7('0x11')]);}else{logger[_0xbea7('0x12')](_0xbea7('0xd'),_0x318166,_0xbea7('0x13'));_0x52dea1(_0x48134a[_0xbea7('0x14')][_0xbea7('0x11')]);}})[_0xbea7('0x15')](function(_0x545d17){logger[_0xbea7('0xf')](_0xbea7('0xd'),_0x318166,_0x545d17);_0x4c09ee(_0x545d17);});});} \ No newline at end of file +var _0x7f0b=['http','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4ec9e3,_0x15fbf4){var _0x2883ce=function(_0x3e9998){while(--_0x3e9998){_0x4ec9e3['push'](_0x4ec9e3['shift']());}};_0x2883ce(++_0x15fbf4);}(_0x7f0b,0x15b));var _0xb7f0=function(_0x3d9b04,_0x1e851a){_0x3d9b04=_0x3d9b04-0x0;var _0x557936=_0x7f0b[_0x3d9b04];return _0x557936;};'use strict';var _=require(_0xb7f0('0x0'));var util=require(_0xb7f0('0x1'));var moment=require(_0xb7f0('0x2'));var BPromise=require(_0xb7f0('0x3'));var rs=require(_0xb7f0('0x4'));var fs=require('fs');var Redis=require(_0xb7f0('0x5'));var db=require(_0xb7f0('0x6'))['db'];var utils=require(_0xb7f0('0x7'));var logger=require(_0xb7f0('0x8'))(_0xb7f0('0x9'));var config=require(_0xb7f0('0xa'));var jayson=require(_0xb7f0('0xb'));var client=jayson[_0xb7f0('0xc')][_0xb7f0('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3f0748,_0x631c72,_0x3f6cb3){return new BPromise(function(_0x124daf,_0x32527b){return client['request'](_0x3f0748,_0x3f6cb3)[_0xb7f0('0xe')](function(_0x8bc47){logger[_0xb7f0('0xf')](_0xb7f0('0x10'),_0x631c72,_0xb7f0('0x11'));logger[_0xb7f0('0x12')](_0xb7f0('0x13'),_0x631c72,_0xb7f0('0x11'),JSON['stringify'](_0x8bc47));if(_0x8bc47[_0xb7f0('0x14')]){if(_0x8bc47['error'][_0xb7f0('0x15')]===0x1f4){logger[_0xb7f0('0x14')](_0xb7f0('0x10'),_0x631c72,_0x8bc47['error'][_0xb7f0('0x16')]);return _0x32527b(_0x8bc47[_0xb7f0('0x14')][_0xb7f0('0x16')]);}logger[_0xb7f0('0x14')](_0xb7f0('0x10'),_0x631c72,_0x8bc47[_0xb7f0('0x14')][_0xb7f0('0x16')]);return _0x124daf(_0x8bc47[_0xb7f0('0x14')]['message']);}else{logger[_0xb7f0('0xf')](_0xb7f0('0x10'),_0x631c72,'request\x20sent');_0x124daf(_0x8bc47['result'][_0xb7f0('0x16')]);}})[_0xb7f0('0x17')](function(_0x5b2fad){logger[_0xb7f0('0x14')](_0xb7f0('0x10'),_0x631c72,_0x5b2fad);_0x32527b(_0x5b2fad);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index ebfdcba..ede8686 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 _0x0f73=['post','create','put','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/configurations','getFields'];(function(_0x1d2eff,_0x45286f){var _0x25e995=function(_0x22feec){while(--_0x22feec){_0x1d2eff['push'](_0x1d2eff['shift']());}};_0x25e995(++_0x45286f);}(_0x0f73,0x146));var _0x30f7=function(_0x5d71ae,_0x52afa0){_0x5d71ae=_0x5d71ae-0x0;var _0x4c0730=_0x0f73[_0x5d71ae];return _0x4c0730;};'use strict';var multer=require(_0x30f7('0x0'));var util=require(_0x30f7('0x1'));var path=require(_0x30f7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x30f7('0x3')]();var fs_extra=require(_0x30f7('0x4'));var auth=require(_0x30f7('0x5'));var interaction=require(_0x30f7('0x6'));var config=require(_0x30f7('0x7'));var controller=require('./intServicenowAccount.controller');router[_0x30f7('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x30f7('0x8')](_0x30f7('0x9'),auth[_0x30f7('0xa')](),controller[_0x30f7('0xb')]);router['get'](_0x30f7('0xc'),auth[_0x30f7('0xa')](),controller['getConfigurations']);router[_0x30f7('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x30f7('0xd')]);router[_0x30f7('0xe')]('/',auth[_0x30f7('0xa')](),controller[_0x30f7('0xf')]);router['post'](_0x30f7('0xc'),auth[_0x30f7('0xa')](),controller['addConfiguration']);router[_0x30f7('0x10')](_0x30f7('0x9'),auth[_0x30f7('0xa')](),controller['update']);router[_0x30f7('0x11')](_0x30f7('0x9'),auth['isAuthenticated'](),controller[_0x30f7('0x12')]);module[_0x30f7('0x13')]=router; \ No newline at end of file +var _0xdeff=['getFields','create','post','/:id/configurations','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0xdeff,0xef));var _0xfdef=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xdeff[_0xbe200f];return _0x192597;};'use strict';var multer=require(_0xfdef('0x0'));var util=require(_0xfdef('0x1'));var path=require(_0xfdef('0x2'));var timeout=require(_0xfdef('0x3'));var express=require('express');var router=express[_0xfdef('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfdef('0x5'));var interaction=require(_0xfdef('0x6'));var config=require(_0xfdef('0x7'));var controller=require(_0xfdef('0x8'));router[_0xfdef('0x9')]('/',auth[_0xfdef('0xa')](),controller[_0xfdef('0xb')]);router[_0xfdef('0x9')](_0xfdef('0xc'),auth[_0xfdef('0xa')](),controller[_0xfdef('0xd')]);router[_0xfdef('0x9')]('/:id/configurations',auth[_0xfdef('0xa')](),controller['getConfigurations']);router[_0xfdef('0x9')]('/:id/fields',auth[_0xfdef('0xa')](),controller[_0xfdef('0xe')]);router['post']('/',auth[_0xfdef('0xa')](),controller[_0xfdef('0xf')]);router[_0xfdef('0x10')](_0xfdef('0x11'),auth[_0xfdef('0xa')](),controller[_0xfdef('0x12')]);router[_0xfdef('0x13')]('/:id',auth[_0xfdef('0xa')](),controller[_0xfdef('0x14')]);router[_0xfdef('0x15')](_0xfdef('0xc'),auth[_0xfdef('0xa')](),controller['destroy']);module[_0xfdef('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 2d440a1..00d9368 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 _0xf226=['remoteUri','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf226,0x1b5));var _0x6f22=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf226[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x6f22('0x0'));module[_0x6f22('0x1')]={'name':{'type':Sequelize[_0x6f22('0x2')]},'description':{'type':Sequelize[_0x6f22('0x2')]},'username':{'type':Sequelize[_0x6f22('0x2')],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x6f22('0x2')]},'remoteUri':{'type':Sequelize[_0x6f22('0x2')],'unique':_0x6f22('0x3')},'serverUrl':{'type':Sequelize[_0x6f22('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x2c89=['exports','STRING','username','remoteUri','sequelize'];(function(_0x15bb1c,_0x1a0b3a){var _0x32dbfa=function(_0x4bf73e){while(--_0x4bf73e){_0x15bb1c['push'](_0x15bb1c['shift']());}};_0x32dbfa(++_0x1a0b3a);}(_0x2c89,0xc2));var _0x92c8=function(_0x163629,_0x37bdf8){_0x163629=_0x163629-0x0;var _0x519c12=_0x2c89[_0x163629];return _0x519c12;};'use strict';var Sequelize=require(_0x92c8('0x0'));module[_0x92c8('0x1')]={'name':{'type':Sequelize[_0x92c8('0x2')]},'description':{'type':Sequelize[_0x92c8('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x92c8('0x3')},'password':{'type':Sequelize[_0x92c8('0x2')]},'email':{'type':Sequelize[_0x92c8('0x2')]},'remoteUri':{'type':Sequelize[_0x92c8('0x2')],'unique':_0x92c8('0x4')},'serverUrl':{'type':Sequelize[_0x92c8('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 7ad9c03..cf926ee 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 _0x7883=['nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','ServicenowConfiguration','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','severity','parent','watch_list','upon_reject','child_incidents','approval_history','number','resolved_by','opened_by','user_input','sys_created_on','sys_domain','state','calendar_stc','closed_at','cmdb_ci','delivery_plan','active','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','close_notes','parent_incident','sys_id','contact_type','reopened_by','incident_state','problem_id','company','reassignment_count','activity_due','comments','approval','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','remoteUri','serverUrl','slice','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ServicenowAccount','fieldName','type','key','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','params','model','includeAll','options','find','create','body','getConfigurations','findOne'];(function(_0x53b1fa,_0x326456){var _0x551674=function(_0xc7918b){while(--_0xc7918b){_0x53b1fa['push'](_0x53b1fa['shift']());}};_0x551674(++_0x326456);}(_0x7883,0x1ee));var _0x3788=function(_0x5ef0e7,_0x461cf0){_0x5ef0e7=_0x5ef0e7-0x0;var _0x152ff2=_0x7883[_0x5ef0e7];return _0x152ff2;};'use strict';var emlformat=require(_0x3788('0x0'));var rimraf=require(_0x3788('0x1'));var zipdir=require(_0x3788('0x2'));var jsonpatch=require(_0x3788('0x3'));var rp=require(_0x3788('0x4'));var moment=require(_0x3788('0x5'));var BPromise=require(_0x3788('0x6'));var Mustache=require(_0x3788('0x7'));var util=require(_0x3788('0x8'));var path=require(_0x3788('0x9'));var sox=require(_0x3788('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3788('0xb'));var _=require(_0x3788('0xc'));var squel=require(_0x3788('0xd'));var crypto=require(_0x3788('0xe'));var jsforce=require(_0x3788('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3788('0x10'));var querystring=require(_0x3788('0x11'));var Papa=require(_0x3788('0x12'));var Redis=require('ioredis');var authService=require(_0x3788('0x13'));var qs=require(_0x3788('0x14'));var as=require(_0x3788('0x15'));var hardwareService=require(_0x3788('0x16'));var logger=require(_0x3788('0x17'))(_0x3788('0x18'));var utils=require(_0x3788('0x19'));var config=require(_0x3788('0x1a'));var licenseUtil=require(_0x3788('0x1b'));var db=require(_0x3788('0x1c'))['db'];var integrations=require(_0x3788('0x1d'));function respondWithStatusCode(_0xe6be18,_0x4c7178){_0x4c7178=_0x4c7178||0xcc;return function(_0x2aecab){if(_0x2aecab){return _0xe6be18[_0x3788('0x1e')](_0x4c7178);}return _0xe6be18[_0x3788('0x1f')](_0x4c7178)['end']();};}function respondWithResult(_0x286384,_0x3957e7){_0x3957e7=_0x3957e7||0xc8;return function(_0x35d075){if(_0x35d075){return _0x286384[_0x3788('0x1f')](_0x3957e7)[_0x3788('0x20')](_0x35d075);}};}function respondWithFilteredResult(_0x8585e2,_0x1dfe7a){return function(_0x2e41d4){if(_0x2e41d4){var _0x5c3d10=typeof _0x1dfe7a[_0x3788('0x21')]===_0x3788('0x22')&&typeof _0x1dfe7a[_0x3788('0x23')]===_0x3788('0x22');var _0x23b417=_0x2e41d4['count'];var _0x1d6f0d=_0x5c3d10?0x0:_0x1dfe7a[_0x3788('0x21')];var _0x5c8dde=_0x5c3d10?_0x2e41d4[_0x3788('0x24')]:_0x1dfe7a[_0x3788('0x21')]+_0x1dfe7a[_0x3788('0x23')];var _0x47b502;if(_0x5c8dde>=_0x23b417){_0x5c8dde=_0x23b417;_0x47b502=0xc8;}else{_0x47b502=0xce;}_0x8585e2['status'](_0x47b502);return _0x8585e2['set'](_0x3788('0x25'),_0x1d6f0d+'-'+_0x5c8dde+'/'+_0x23b417)[_0x3788('0x20')](_0x2e41d4);}return null;};}function patchUpdates(_0x43c7cd){return function(_0x41a9d0){try{jsonpatch[_0x3788('0x26')](_0x41a9d0,_0x43c7cd,!![]);}catch(_0x4d1e09){return BPromise[_0x3788('0x27')](_0x4d1e09);}return _0x41a9d0['save']();};}function saveUpdates(_0x1dd6d5,_0x1ccc39){return function(_0x491ec4){if(_0x491ec4){return _0x491ec4[_0x3788('0x28')](_0x1dd6d5)[_0x3788('0x29')](function(_0x3f2c8e){return _0x3f2c8e;});}return null;};}function removeEntity(_0x40b6ec,_0x263d88){return function(_0x2c2571){if(_0x2c2571){return _0x2c2571[_0x3788('0x2a')]()[_0x3788('0x29')](function(){_0x40b6ec[_0x3788('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb28b80,_0x9b097e){return function(_0x139051){if(!_0x139051){_0xb28b80[_0x3788('0x1e')](0x194);}return _0x139051;};}function handleError(_0x35ae8e,_0x21e814){_0x21e814=_0x21e814||0x1f4;return function(_0x583096){logger[_0x3788('0x2b')](_0x583096[_0x3788('0x2c')]);if(_0x583096['name']){delete _0x583096[_0x3788('0x2d')];}_0x35ae8e['status'](_0x21e814)[_0x3788('0x2e')](_0x583096);};}exports[_0x3788('0x2f')]=function(_0x2a4fd1,_0x108b12){var _0x2027ca={},_0x34c217={},_0x41ce24={'count':0x0,'rows':[]};var _0x1245ee=_[_0x3788('0x30')](db[_0x3788('0x31')]['rawAttributes'],function(_0x2d2c7f){return{'name':_0x2d2c7f[_0x3788('0x32')],'type':_0x2d2c7f[_0x3788('0x33')][_0x3788('0x34')]};});_0x34c217['model']=_[_0x3788('0x30')](_0x1245ee,_0x3788('0x2d'));_0x34c217[_0x3788('0x35')]=_[_0x3788('0x36')](_0x2a4fd1['query']);_0x34c217[_0x3788('0x37')]=_['intersection'](_0x34c217['model'],_0x34c217['query']);_0x2027ca[_0x3788('0x38')]=_[_0x3788('0x39')](_0x34c217['model'],qs[_0x3788('0x3a')](_0x2a4fd1[_0x3788('0x35')][_0x3788('0x3a')]));_0x2027ca[_0x3788('0x38')]=_0x2027ca['attributes'][_0x3788('0x3b')]?_0x2027ca[_0x3788('0x38')]:_0x34c217['model'];if(!_0x2a4fd1['query'][_0x3788('0x3c')]('nolimit')){_0x2027ca[_0x3788('0x23')]=qs[_0x3788('0x23')](_0x2a4fd1[_0x3788('0x35')][_0x3788('0x23')]);_0x2027ca[_0x3788('0x21')]=qs[_0x3788('0x21')](_0x2a4fd1[_0x3788('0x35')][_0x3788('0x21')]);}_0x2027ca[_0x3788('0x3d')]=qs[_0x3788('0x3e')](_0x2a4fd1[_0x3788('0x35')]['sort']);_0x2027ca['where']=qs[_0x3788('0x37')](_[_0x3788('0x3f')](_0x2a4fd1[_0x3788('0x35')],_0x34c217[_0x3788('0x37')]),_0x1245ee);if(_0x2a4fd1[_0x3788('0x35')][_0x3788('0x40')]){_0x2027ca[_0x3788('0x41')]=_[_0x3788('0x42')](_0x2027ca['where'],{'$or':_['map'](_0x1245ee,function(_0x4b1831){if(_0x4b1831[_0x3788('0x33')]!==_0x3788('0x43')){var _0x5b7628={};_0x5b7628[_0x4b1831[_0x3788('0x2d')]]={'$like':'%'+_0x2a4fd1[_0x3788('0x35')][_0x3788('0x40')]+'%'};return _0x5b7628;}})});}_0x2027ca=_[_0x3788('0x42')]({},_0x2027ca,_0x2a4fd1['options']);var _0x34ac96={'where':_0x2027ca[_0x3788('0x41')]};return db[_0x3788('0x31')]['count'](_0x34ac96)[_0x3788('0x29')](function(_0x3c6827){_0x41ce24['count']=_0x3c6827;if(_0x2a4fd1[_0x3788('0x35')]['includeAll']){_0x2027ca[_0x3788('0x44')]=[{'all':!![]}];}return db[_0x3788('0x31')][_0x3788('0x45')](_0x2027ca);})[_0x3788('0x29')](function(_0x351bca){_0x41ce24[_0x3788('0x46')]=_0x351bca;return _0x41ce24;})[_0x3788('0x29')](respondWithFilteredResult(_0x108b12,_0x2027ca))[_0x3788('0x47')](handleError(_0x108b12,null));};exports[_0x3788('0x48')]=function(_0x5dd3ca,_0x517917){var _0x3c8d7d={'raw':![],'where':{'id':_0x5dd3ca[_0x3788('0x49')]['id']}},_0x53b54e={};_0x53b54e[_0x3788('0x4a')]=_[_0x3788('0x36')](db[_0x3788('0x31')]['rawAttributes']);_0x53b54e['query']=_[_0x3788('0x36')](_0x5dd3ca[_0x3788('0x35')]);_0x53b54e[_0x3788('0x37')]=_[_0x3788('0x39')](_0x53b54e[_0x3788('0x4a')],_0x53b54e[_0x3788('0x35')]);_0x3c8d7d[_0x3788('0x38')]=_[_0x3788('0x39')](_0x53b54e[_0x3788('0x4a')],qs[_0x3788('0x3a')](_0x5dd3ca[_0x3788('0x35')][_0x3788('0x3a')]));_0x3c8d7d[_0x3788('0x38')]=_0x3c8d7d[_0x3788('0x38')][_0x3788('0x3b')]?_0x3c8d7d[_0x3788('0x38')]:_0x53b54e[_0x3788('0x4a')];if(_0x5dd3ca[_0x3788('0x35')][_0x3788('0x4b')]){_0x3c8d7d['include']=[{'all':!![]}];}_0x3c8d7d=_[_0x3788('0x42')]({},_0x3c8d7d,_0x5dd3ca[_0x3788('0x4c')]);return db[_0x3788('0x31')][_0x3788('0x4d')](_0x3c8d7d)[_0x3788('0x29')](handleEntityNotFound(_0x517917,null))[_0x3788('0x29')](respondWithResult(_0x517917,null))[_0x3788('0x47')](handleError(_0x517917,null));};exports[_0x3788('0x4e')]=function(_0x39f9fc,_0x35625a){return db[_0x3788('0x31')][_0x3788('0x4e')](_0x39f9fc[_0x3788('0x4f')],{})[_0x3788('0x29')](respondWithResult(_0x35625a,0xc9))['catch'](handleError(_0x35625a,null));};exports[_0x3788('0x28')]=function(_0x3756fe,_0x23805f){if(_0x3756fe[_0x3788('0x4f')]['id']){delete _0x3756fe[_0x3788('0x4f')]['id'];}return db[_0x3788('0x31')][_0x3788('0x4d')]({'where':{'id':_0x3756fe[_0x3788('0x49')]['id']}})['then'](handleEntityNotFound(_0x23805f,null))['then'](saveUpdates(_0x3756fe[_0x3788('0x4f')],null))[_0x3788('0x29')](respondWithResult(_0x23805f,null))[_0x3788('0x47')](handleError(_0x23805f,null));};exports[_0x3788('0x2a')]=function(_0x620860,_0x5e0246){return db[_0x3788('0x31')][_0x3788('0x4d')]({'where':{'id':_0x620860[_0x3788('0x49')]['id']}})['then'](handleEntityNotFound(_0x5e0246,null))[_0x3788('0x29')](removeEntity(_0x5e0246,null))[_0x3788('0x47')](handleError(_0x5e0246,null));};exports[_0x3788('0x50')]=function(_0x5dc667,_0x70d9a,_0x3a1fd6){var _0x40d37b={};var _0x4b4ecf={};var _0x37b42e;var _0x586d92;return db['ServicenowAccount'][_0x3788('0x51')]({'where':{'id':_0x5dc667[_0x3788('0x49')]['id']}})[_0x3788('0x29')](handleEntityNotFound(_0x70d9a,null))[_0x3788('0x29')](function(_0x16ceb9){if(_0x16ceb9){_0x37b42e=_0x16ceb9;_0x4b4ecf['model']=_[_0x3788('0x36')](db['ServicenowConfiguration']['rawAttributes']);_0x4b4ecf[_0x3788('0x35')]=_[_0x3788('0x36')](_0x5dc667[_0x3788('0x35')]);_0x4b4ecf[_0x3788('0x37')]=_['intersection'](_0x4b4ecf[_0x3788('0x4a')],_0x4b4ecf[_0x3788('0x35')]);_0x40d37b[_0x3788('0x38')]=_[_0x3788('0x39')](_0x4b4ecf[_0x3788('0x4a')],qs['fields'](_0x5dc667[_0x3788('0x35')]['fields']));_0x40d37b[_0x3788('0x38')]=_0x40d37b[_0x3788('0x38')]['length']?_0x40d37b[_0x3788('0x38')]:_0x4b4ecf[_0x3788('0x4a')];_0x40d37b['order']=qs[_0x3788('0x3e')](_0x5dc667[_0x3788('0x35')][_0x3788('0x3e')]);_0x40d37b[_0x3788('0x41')]=qs['filters'](_[_0x3788('0x3f')](_0x5dc667[_0x3788('0x35')],_0x4b4ecf['filters']));if(_0x5dc667['query'][_0x3788('0x40')]){_0x40d37b[_0x3788('0x41')]=_['merge'](_0x40d37b[_0x3788('0x41')],{'$or':_[_0x3788('0x30')](_0x40d37b[_0x3788('0x38')],function(_0x547adb){var _0xc1590e={};_0xc1590e[_0x547adb]={'$like':'%'+_0x5dc667[_0x3788('0x35')]['filter']+'%'};return _0xc1590e;})});}_0x40d37b=_[_0x3788('0x42')]({},_0x40d37b,_0x5dc667[_0x3788('0x4c')]);return _0x37b42e[_0x3788('0x50')](_0x40d37b);}})[_0x3788('0x29')](function(_0x47df40){if(_0x47df40){_0x586d92=_0x47df40['length'];if(!_0x5dc667[_0x3788('0x35')][_0x3788('0x3c')](_0x3788('0x52'))){_0x40d37b['limit']=qs[_0x3788('0x23')](_0x5dc667['query'][_0x3788('0x23')]);_0x40d37b[_0x3788('0x21')]=qs['offset'](_0x5dc667[_0x3788('0x35')][_0x3788('0x21')]);}return _0x37b42e[_0x3788('0x50')](_0x40d37b);}})[_0x3788('0x29')](function(_0x10890f){if(_0x10890f){return _0x10890f?{'count':_0x586d92,'rows':_0x10890f}:null;}})[_0x3788('0x29')](respondWithResult(_0x70d9a,null))[_0x3788('0x47')](handleError(_0x70d9a,null));};exports['addConfiguration']=function(_0x1ab680,_0x257bb0,_0x3b337a){if(_0x1ab680[_0x3788('0x4f')]['id']){delete _0x1ab680[_0x3788('0x4f')]['id'];}return db[_0x3788('0x31')][_0x3788('0x51')]({'where':{'id':_0x1ab680[_0x3788('0x49')]['id']}})[_0x3788('0x29')](handleEntityNotFound(_0x257bb0,null))['then'](function(_0x159dce){if(_0x159dce){_0x1ab680[_0x3788('0x4f')][_0x3788('0x53')]=_0x159dce['id'];_0x1ab680[_0x3788('0x4f')][_0x3788('0x54')]=integrations[_0x3788('0x55')](_0x1ab680[_0x3788('0x4f')][_0x3788('0x56')],_0x1ab680[_0x3788('0x4f')][_0x3788('0x33')]);_0x1ab680[_0x3788('0x4f')][_0x3788('0x57')]=integrations['getDescriptions'](_0x1ab680[_0x3788('0x4f')][_0x3788('0x56')],_0x1ab680[_0x3788('0x4f')][_0x3788('0x33')]);return db[_0x3788('0x58')][_0x3788('0x4e')](_0x1ab680['body'],{'include':[{'model':db[_0x3788('0x59')],'as':'Subjects'},{'model':db[_0x3788('0x59')],'as':_0x3788('0x57')}]});}return null;})[_0x3788('0x29')](respondWithResult(_0x257bb0,null))[_0x3788('0x47')](handleError(_0x257bb0,null));};exports[_0x3788('0x5a')]=function(_0x263375,_0x4066b1,_0x3e4045){var _0x1f100d=[_0x3788('0x5b'),_0x3788('0x5c'),_0x3788('0x5d'),_0x3788('0x5e'),_0x3788('0x5f'),_0x3788('0x60'),'incident_state',_0x3788('0x61'),'category'];var _0x51fe54=[_0x3788('0x62'),_0x3788('0x5b'),'caused_by',_0x3788('0x63'),_0x3788('0x64'),'sys_updated_on',_0x3788('0x65'),_0x3788('0x5c'),_0x3788('0x66'),_0x3788('0x67'),_0x3788('0x68'),'sys_updated_by',_0x3788('0x69'),_0x3788('0x6a'),_0x3788('0x6b'),_0x3788('0x6c'),_0x3788('0x6d'),'sys_created_by',_0x3788('0x5d'),'order',_0x3788('0x6e'),_0x3788('0x6f'),_0x3788('0x70'),_0x3788('0x71'),'impact',_0x3788('0x72'),'work_notes_list',_0x3788('0x73'),_0x3788('0x74'),_0x3788('0x75'),_0x3788('0x76'),_0x3788('0x77'),_0x3788('0x78'),_0x3788('0x79'),'business_duration','group_list',_0x3788('0x7a'),_0x3788('0x7b'),_0x3788('0x7c'),_0x3788('0x7d'),_0x3788('0x7e'),_0x3788('0x5e'),_0x3788('0x7f'),_0x3788('0x80'),_0x3788('0x5f'),_0x3788('0x81'),_0x3788('0x82'),_0x3788('0x83'),_0x3788('0x84'),_0x3788('0x85'),_0x3788('0x86'),_0x3788('0x87'),_0x3788('0x88'),_0x3788('0x60'),'sys_class_name',_0x3788('0x89'),'closed_by','follow_up',_0x3788('0x8a'),_0x3788('0x8b'),_0x3788('0x8c'),_0x3788('0x8d'),_0x3788('0x8e'),'urgency',_0x3788('0x8f'),_0x3788('0x90'),_0x3788('0x91'),_0x3788('0x92'),'assigned_to','severity',_0x3788('0x93'),'sla_due',_0x3788('0x94'),'comments_and_work_notes','due_date',_0x3788('0x95'),'reopen_count',_0x3788('0x96'),_0x3788('0x97'),_0x3788('0x98'),_0x3788('0x99'),_0x3788('0x9a'),'category'];var _0x33f029='';var _0x47c63c='';var _0x5d82a1=[];var _0x384c54='';var _0x30c9a7='';var _0x562320=[];var _0xcb65d8='';var _0x439dd5='';var _0x276ab6={};var _0x360b87='';return db[_0x3788('0x31')]['findOne']({'where':{'id':_0x263375['params']['id']},'attributes':['id',_0x3788('0x9b'),_0x3788('0x9c'),'email',_0x3788('0x9d'),_0x3788('0x9e')]})[_0x3788('0x29')](handleEntityNotFound(_0x4066b1,null))['then'](function(_0x51cddc){if(_0x51cddc){_0x360b87=_0x51cddc[_0x3788('0x9d')];var _0x1b61f3=_0x360b87[_0x3788('0x9f')](-0x1);if(_0x1b61f3==='/'){_0x360b87=_0x360b87[_0x3788('0xa0')](0x0,_0x360b87['lastIndexOf'](_0x1b61f3));}_0x439dd5=util[_0x3788('0xa1')](_0x3788('0xa2'),_0x360b87);_0xcb65d8=util[_0x3788('0xa1')](_0x3788('0xa3'),_0x360b87);_0x276ab6={'user':_0x51cddc[_0x3788('0x9b')],'pass':_0x51cddc[_0x3788('0x9c')]};var _0x515aa1={'method':_0x3788('0xa4'),'uri':_0x439dd5+_0x3788('0xa5'),'auth':_0x276ab6,'json':!![]};return rp(_0x515aa1);}})[_0x3788('0x29')](function(_0x791f4d){if(_0x791f4d[_0x3788('0xa6')][_0x3788('0x3b')]>0x0){_0x33f029=_0x791f4d[_0x3788('0xa6')];}console[_0x3788('0xa7')](_0x3788('0xa8'),_0x33f029);_0x562320=[];_0x47c63c=Object[_0x3788('0xa9')]([],_0x33f029);_[_0x3788('0xaa')](_0x47c63c,function(_0x48506b){return!_0x1f100d[_0x3788('0xab')](_0x48506b['name']);});_0x47c63c[_0x3788('0xac')](function(_0x29fa6c){var _0x4c7a59=createFieldObject(_0xcb65d8,_0x276ab6,_0x29fa6c[_0x3788('0xad')],_0x29fa6c['name'],_0x29fa6c[_0x3788('0xae')],![]);_0x562320[_0x3788('0xaf')](_0x4c7a59);});return Promise[_0x3788('0xb0')](_0x562320);})[_0x3788('0x29')](function(_0x39b323){_0x5d82a1=_0x39b323;_0x384c54=Object[_0x3788('0xa9')]([],_0x33f029);console['log'](_0x3788('0xb1'),_0x33f029);_['remove'](_0x384c54,function(_0x1588e3){return _0x51fe54[_0x3788('0xab')](_0x1588e3[_0x3788('0x2d')]);});console[_0x3788('0xa7')](_0x3788('0xb2'),_0x384c54);_0x562320=[];_0x384c54[_0x3788('0xac')](function(_0xb08104){var _0x38179c=createFieldObject(_0xcb65d8,_0x276ab6,_0xb08104[_0x3788('0xad')],_0xb08104[_0x3788('0x2d')],_0xb08104[_0x3788('0xae')],!![]);_0x562320[_0x3788('0xaf')](_0x38179c);});return Promise[_0x3788('0xb0')](_0x562320);})[_0x3788('0x29')](function(_0x73554d){_0x30c9a7=_0x73554d;var _0x30024e=_0x5d82a1[_0x3788('0xb3')](_0x30c9a7);return{'count':_0x30024e[_0x3788('0x3b')],'rows':_0x30024e};})[_0x3788('0x29')](respondWithResult(_0x4066b1,null))[_0x3788('0x47')](function(_0x5ee757){console[_0x3788('0xa7')](_0x3788('0xb4')+_0x5ee757);var _0x5293fe=_0x263375[_0x3788('0x35')][_0x3788('0xb5')]?0x1f4:_0x5ee757[_0x3788('0xb6')]||0x1f4;logger['error'](_0x5ee757[_0x3788('0x2c')]);delete _0x5ee757[_0x3788('0x2d')];if(_0x5293fe===0x191){_0x5293fe=0x190;}_0x4066b1[_0x3788('0x1f')](_0x5293fe)['send'](_0x263375[_0x3788('0x35')][_0x3788('0xb5')]?{'message':_0x3788('0xb7'),'statusCode':_0x5ee757['statusCode']}:_0x5ee757);});};function createFieldObject(_0x4f37ce,_0x3a281c,_0x3e5e26,_0x3ea7a6,_0x37a407,_0x547f30){return new Promise(function(_0x535584,_0x269bb3){var _0x59ff69={'id':_0x3ea7a6,'name':_0x37a407,'custom':_0x547f30};if(_0x3e5e26===_0x3788('0xb8')){_0x59ff69[_0x3788('0x4c')]=[{'name':_0x3788('0xb9'),'value':_0x3788('0xba')},{'name':_0x3788('0xbb'),'value':_0x3788('0xbc')}];_0x535584(_0x59ff69);}else{var _0x54ea0f={'method':'GET','uri':_0x4f37ce+_0x3788('0xbd')+_0x3ea7a6,'auth':_0x3a281c,'json':!![]};return rp(_0x54ea0f)[_0x3788('0x29')](function(_0x3924e6){var _0x77f759=[];if(_0x3924e6[_0x3788('0xa6')]['length']>0x0){_0x3924e6[_0x3788('0xa6')][_0x3788('0xac')](function(_0x1540bd){if(_0x1540bd[_0x3788('0xbe')]==='false'){var _0x455d67={'name':_0x1540bd[_0x3788('0xae')],'value':_0x1540bd[_0x3788('0xbf')]};_0x77f759['push'](_0x455d67);}});}_0x59ff69[_0x3788('0x4c')]=_0x77f759;if(_0x59ff69[_0x3788('0x4c')][_0x3788('0x3b')]>0x0){_0x535584(_0x59ff69);}else{if(_0x547f30==![]){_0x535584();}else{_0x535584(_0x59ff69);}}});}});} \ No newline at end of file +var _0xf489=['destroy','getConfigurations','findOne','ServicenowConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','getFields','hold_reason','knowledge','subcategory','notify','incident_state','severity','category','parent','caused_by','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','work_notes_list','priority','sys_domain_path','rfc','time_worked','expected_start','business_duration','group_list','work_end','reopened_time','resolved_at','close_code','correlation_display','delivery_task','work_start','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','sla_due','approval','comments_and_work_notes','sys_mod_count','upon_approval','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','forEach','internalType','label','push','all','includes','concat','ServiceNow\x20error:\x20','statusCode','error','test','Wrong\x20credentials','boolean','True','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','Content-Range','json','apply','reject','save','then','stack','name','send','index','map','ServicenowAccount','rawAttributes','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','update'];(function(_0x2ecac5,_0x1d3eb0){var _0x2f644e=function(_0x37ca88){while(--_0x37ca88){_0x2ecac5['push'](_0x2ecac5['shift']());}};_0x2f644e(++_0x1d3eb0);}(_0xf489,0x6d));var _0x9f48=function(_0x4ce274,_0x26d7df){_0x4ce274=_0x4ce274-0x0;var _0x3f81b9=_0xf489[_0x4ce274];return _0x3f81b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9f48('0x0'));var zipdir=require(_0x9f48('0x1'));var jsonpatch=require(_0x9f48('0x2'));var rp=require(_0x9f48('0x3'));var moment=require(_0x9f48('0x4'));var BPromise=require(_0x9f48('0x5'));var Mustache=require(_0x9f48('0x6'));var util=require(_0x9f48('0x7'));var path=require(_0x9f48('0x8'));var sox=require('sox');var csv=require(_0x9f48('0x9'));var ejs=require(_0x9f48('0xa'));var fs=require('fs');var fs_extra=require(_0x9f48('0xb'));var _=require('lodash');var squel=require(_0x9f48('0xc'));var crypto=require(_0x9f48('0xd'));var jsforce=require(_0x9f48('0xe'));var deskjs=require(_0x9f48('0xf'));var toCsv=require(_0x9f48('0x9'));var querystring=require(_0x9f48('0x10'));var Papa=require(_0x9f48('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9f48('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9f48('0x13'));var logger=require(_0x9f48('0x14'))(_0x9f48('0x15'));var utils=require(_0x9f48('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9f48('0x17'));var db=require(_0x9f48('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x428321,_0x4ee82d){_0x4ee82d=_0x4ee82d||0xcc;return function(_0x1d1477){if(_0x1d1477){return _0x428321[_0x9f48('0x19')](_0x4ee82d);}return _0x428321[_0x9f48('0x1a')](_0x4ee82d)[_0x9f48('0x1b')]();};}function respondWithResult(_0x4bbcc9,_0x4c777c){_0x4c777c=_0x4c777c||0xc8;return function(_0x8a62d7){if(_0x8a62d7){return _0x4bbcc9[_0x9f48('0x1a')](_0x4c777c)['json'](_0x8a62d7);}};}function respondWithFilteredResult(_0x43a38b,_0x28e36e){return function(_0xa69ddb){if(_0xa69ddb){var _0x154916=typeof _0x28e36e['offset']===_0x9f48('0x1c')&&typeof _0x28e36e['limit']==='undefined';var _0xa73f7b=_0xa69ddb[_0x9f48('0x1d')];var _0x46b3a2=_0x154916?0x0:_0x28e36e[_0x9f48('0x1e')];var _0x1d126b=_0x154916?_0xa69ddb[_0x9f48('0x1d')]:_0x28e36e[_0x9f48('0x1e')]+_0x28e36e[_0x9f48('0x1f')];var _0x5be5fd;if(_0x1d126b>=_0xa73f7b){_0x1d126b=_0xa73f7b;_0x5be5fd=0xc8;}else{_0x5be5fd=0xce;}_0x43a38b[_0x9f48('0x1a')](_0x5be5fd);return _0x43a38b['set'](_0x9f48('0x20'),_0x46b3a2+'-'+_0x1d126b+'/'+_0xa73f7b)[_0x9f48('0x21')](_0xa69ddb);}return null;};}function patchUpdates(_0x387348){return function(_0x1e0460){try{jsonpatch[_0x9f48('0x22')](_0x1e0460,_0x387348,!![]);}catch(_0x59164a){return BPromise[_0x9f48('0x23')](_0x59164a);}return _0x1e0460[_0x9f48('0x24')]();};}function saveUpdates(_0x2f2787,_0x28616f){return function(_0x4d366b){if(_0x4d366b){return _0x4d366b['update'](_0x2f2787)[_0x9f48('0x25')](function(_0xcf7208){return _0xcf7208;});}return null;};}function removeEntity(_0xb370d5,_0x26ad6f){return function(_0x951378){if(_0x951378){return _0x951378['destroy']()[_0x9f48('0x25')](function(){_0xb370d5[_0x9f48('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fad25,_0x5b4e28){return function(_0x20d2cd){if(!_0x20d2cd){_0x3fad25[_0x9f48('0x19')](0x194);}return _0x20d2cd;};}function handleError(_0x40679b,_0x2e2922){_0x2e2922=_0x2e2922||0x1f4;return function(_0x183561){logger['error'](_0x183561[_0x9f48('0x26')]);if(_0x183561[_0x9f48('0x27')]){delete _0x183561[_0x9f48('0x27')];}_0x40679b[_0x9f48('0x1a')](_0x2e2922)[_0x9f48('0x28')](_0x183561);};}exports[_0x9f48('0x29')]=function(_0x52c150,_0x24f66a){var _0x1315a2={},_0x576c12={},_0x563a69={'count':0x0,'rows':[]};var _0x3994b3=_[_0x9f48('0x2a')](db[_0x9f48('0x2b')][_0x9f48('0x2c')],function(_0x5f1c56){return{'name':_0x5f1c56['fieldName'],'type':_0x5f1c56['type'][_0x9f48('0x2d')]};});_0x576c12['model']=_[_0x9f48('0x2a')](_0x3994b3,_0x9f48('0x27'));_0x576c12[_0x9f48('0x2e')]=_[_0x9f48('0x2f')](_0x52c150[_0x9f48('0x2e')]);_0x576c12['filters']=_['intersection'](_0x576c12[_0x9f48('0x30')],_0x576c12[_0x9f48('0x2e')]);_0x1315a2[_0x9f48('0x31')]=_[_0x9f48('0x32')](_0x576c12[_0x9f48('0x30')],qs[_0x9f48('0x33')](_0x52c150[_0x9f48('0x2e')][_0x9f48('0x33')]));_0x1315a2[_0x9f48('0x31')]=_0x1315a2[_0x9f48('0x31')][_0x9f48('0x34')]?_0x1315a2[_0x9f48('0x31')]:_0x576c12[_0x9f48('0x30')];if(!_0x52c150[_0x9f48('0x2e')][_0x9f48('0x35')](_0x9f48('0x36'))){_0x1315a2[_0x9f48('0x1f')]=qs['limit'](_0x52c150[_0x9f48('0x2e')][_0x9f48('0x1f')]);_0x1315a2[_0x9f48('0x1e')]=qs['offset'](_0x52c150['query'][_0x9f48('0x1e')]);}_0x1315a2[_0x9f48('0x37')]=qs[_0x9f48('0x38')](_0x52c150[_0x9f48('0x2e')][_0x9f48('0x38')]);_0x1315a2[_0x9f48('0x39')]=qs['filters'](_['pick'](_0x52c150['query'],_0x576c12[_0x9f48('0x3a')]),_0x3994b3);if(_0x52c150['query'][_0x9f48('0x3b')]){_0x1315a2[_0x9f48('0x39')]=_[_0x9f48('0x3c')](_0x1315a2[_0x9f48('0x39')],{'$or':_['map'](_0x3994b3,function(_0x550bb3){if(_0x550bb3[_0x9f48('0x3d')]!==_0x9f48('0x3e')){var _0x49af2a={};_0x49af2a[_0x550bb3[_0x9f48('0x27')]]={'$like':'%'+_0x52c150[_0x9f48('0x2e')]['filter']+'%'};return _0x49af2a;}})});}_0x1315a2=_[_0x9f48('0x3c')]({},_0x1315a2,_0x52c150[_0x9f48('0x3f')]);var _0x96cbc7={'where':_0x1315a2[_0x9f48('0x39')]};return db[_0x9f48('0x2b')][_0x9f48('0x1d')](_0x96cbc7)[_0x9f48('0x25')](function(_0x3436b4){_0x563a69[_0x9f48('0x1d')]=_0x3436b4;if(_0x52c150[_0x9f48('0x2e')]['includeAll']){_0x1315a2[_0x9f48('0x40')]=[{'all':!![]}];}return db[_0x9f48('0x2b')][_0x9f48('0x41')](_0x1315a2);})[_0x9f48('0x25')](function(_0x300c46){_0x563a69['rows']=_0x300c46;return _0x563a69;})['then'](respondWithFilteredResult(_0x24f66a,_0x1315a2))[_0x9f48('0x42')](handleError(_0x24f66a,null));};exports[_0x9f48('0x43')]=function(_0x525e3c,_0x45cefd){var _0x100f1e={'raw':![],'where':{'id':_0x525e3c[_0x9f48('0x44')]['id']}},_0x23c5d3={};_0x23c5d3[_0x9f48('0x30')]=_[_0x9f48('0x2f')](db[_0x9f48('0x2b')][_0x9f48('0x2c')]);_0x23c5d3[_0x9f48('0x2e')]=_['keys'](_0x525e3c[_0x9f48('0x2e')]);_0x23c5d3[_0x9f48('0x3a')]=_[_0x9f48('0x32')](_0x23c5d3[_0x9f48('0x30')],_0x23c5d3[_0x9f48('0x2e')]);_0x100f1e[_0x9f48('0x31')]=_[_0x9f48('0x32')](_0x23c5d3[_0x9f48('0x30')],qs[_0x9f48('0x33')](_0x525e3c[_0x9f48('0x2e')][_0x9f48('0x33')]));_0x100f1e[_0x9f48('0x31')]=_0x100f1e[_0x9f48('0x31')]['length']?_0x100f1e[_0x9f48('0x31')]:_0x23c5d3[_0x9f48('0x30')];if(_0x525e3c[_0x9f48('0x2e')][_0x9f48('0x45')]){_0x100f1e['include']=[{'all':!![]}];}_0x100f1e=_[_0x9f48('0x3c')]({},_0x100f1e,_0x525e3c[_0x9f48('0x3f')]);return db[_0x9f48('0x2b')][_0x9f48('0x46')](_0x100f1e)['then'](handleEntityNotFound(_0x45cefd,null))[_0x9f48('0x25')](respondWithResult(_0x45cefd,null))[_0x9f48('0x42')](handleError(_0x45cefd,null));};exports[_0x9f48('0x47')]=function(_0x2f1179,_0x222a83){return db[_0x9f48('0x2b')][_0x9f48('0x47')](_0x2f1179[_0x9f48('0x48')],{})['then'](respondWithResult(_0x222a83,0xc9))[_0x9f48('0x42')](handleError(_0x222a83,null));};exports[_0x9f48('0x49')]=function(_0x1f2f1b,_0x77bf7b){if(_0x1f2f1b[_0x9f48('0x48')]['id']){delete _0x1f2f1b['body']['id'];}return db['ServicenowAccount'][_0x9f48('0x46')]({'where':{'id':_0x1f2f1b[_0x9f48('0x44')]['id']}})[_0x9f48('0x25')](handleEntityNotFound(_0x77bf7b,null))[_0x9f48('0x25')](saveUpdates(_0x1f2f1b[_0x9f48('0x48')],null))['then'](respondWithResult(_0x77bf7b,null))[_0x9f48('0x42')](handleError(_0x77bf7b,null));};exports[_0x9f48('0x4a')]=function(_0x2e10b6,_0x5863c2){return db['ServicenowAccount'][_0x9f48('0x46')]({'where':{'id':_0x2e10b6['params']['id']}})[_0x9f48('0x25')](handleEntityNotFound(_0x5863c2,null))[_0x9f48('0x25')](removeEntity(_0x5863c2,null))[_0x9f48('0x42')](handleError(_0x5863c2,null));};exports[_0x9f48('0x4b')]=function(_0x3a985d,_0x2f0be6,_0x489eef){var _0x5dda88={};var _0x12802c={};var _0x3cc276;var _0x2297cc;return db[_0x9f48('0x2b')][_0x9f48('0x4c')]({'where':{'id':_0x3a985d[_0x9f48('0x44')]['id']}})['then'](handleEntityNotFound(_0x2f0be6,null))[_0x9f48('0x25')](function(_0x42a4f8){if(_0x42a4f8){_0x3cc276=_0x42a4f8;_0x12802c[_0x9f48('0x30')]=_[_0x9f48('0x2f')](db[_0x9f48('0x4d')][_0x9f48('0x2c')]);_0x12802c[_0x9f48('0x2e')]=_[_0x9f48('0x2f')](_0x3a985d[_0x9f48('0x2e')]);_0x12802c[_0x9f48('0x3a')]=_['intersection'](_0x12802c[_0x9f48('0x30')],_0x12802c[_0x9f48('0x2e')]);_0x5dda88[_0x9f48('0x31')]=_['intersection'](_0x12802c[_0x9f48('0x30')],qs[_0x9f48('0x33')](_0x3a985d[_0x9f48('0x2e')][_0x9f48('0x33')]));_0x5dda88[_0x9f48('0x31')]=_0x5dda88['attributes'][_0x9f48('0x34')]?_0x5dda88[_0x9f48('0x31')]:_0x12802c[_0x9f48('0x30')];_0x5dda88[_0x9f48('0x37')]=qs[_0x9f48('0x38')](_0x3a985d[_0x9f48('0x2e')][_0x9f48('0x38')]);_0x5dda88[_0x9f48('0x39')]=qs[_0x9f48('0x3a')](_[_0x9f48('0x4e')](_0x3a985d[_0x9f48('0x2e')],_0x12802c[_0x9f48('0x3a')]));if(_0x3a985d[_0x9f48('0x2e')][_0x9f48('0x3b')]){_0x5dda88['where']=_[_0x9f48('0x3c')](_0x5dda88[_0x9f48('0x39')],{'$or':_[_0x9f48('0x2a')](_0x5dda88[_0x9f48('0x31')],function(_0x1349f6){var _0x52c7e4={};_0x52c7e4[_0x1349f6]={'$like':'%'+_0x3a985d[_0x9f48('0x2e')][_0x9f48('0x3b')]+'%'};return _0x52c7e4;})});}_0x5dda88=_[_0x9f48('0x3c')]({},_0x5dda88,_0x3a985d[_0x9f48('0x3f')]);return _0x3cc276[_0x9f48('0x4b')](_0x5dda88);}})['then'](function(_0x203e48){if(_0x203e48){_0x2297cc=_0x203e48[_0x9f48('0x34')];if(!_0x3a985d[_0x9f48('0x2e')][_0x9f48('0x35')](_0x9f48('0x36'))){_0x5dda88[_0x9f48('0x1f')]=qs[_0x9f48('0x1f')](_0x3a985d[_0x9f48('0x2e')][_0x9f48('0x1f')]);_0x5dda88[_0x9f48('0x1e')]=qs['offset'](_0x3a985d['query'][_0x9f48('0x1e')]);}return _0x3cc276[_0x9f48('0x4b')](_0x5dda88);}})[_0x9f48('0x25')](function(_0x2ecd75){if(_0x2ecd75){return _0x2ecd75?{'count':_0x2297cc,'rows':_0x2ecd75}:null;}})[_0x9f48('0x25')](respondWithResult(_0x2f0be6,null))[_0x9f48('0x42')](handleError(_0x2f0be6,null));};exports[_0x9f48('0x4f')]=function(_0x199f6c,_0x564131,_0x3d5db9){if(_0x199f6c[_0x9f48('0x48')]['id']){delete _0x199f6c[_0x9f48('0x48')]['id'];}return db['ServicenowAccount'][_0x9f48('0x4c')]({'where':{'id':_0x199f6c[_0x9f48('0x44')]['id']}})[_0x9f48('0x25')](handleEntityNotFound(_0x564131,null))[_0x9f48('0x25')](function(_0x5ea502){if(_0x5ea502){_0x199f6c[_0x9f48('0x48')][_0x9f48('0x50')]=_0x5ea502['id'];_0x199f6c[_0x9f48('0x48')][_0x9f48('0x51')]=integrations[_0x9f48('0x52')](_0x199f6c[_0x9f48('0x48')][_0x9f48('0x53')],_0x199f6c[_0x9f48('0x48')][_0x9f48('0x3d')]);_0x199f6c['body']['Descriptions']=integrations[_0x9f48('0x54')](_0x199f6c[_0x9f48('0x48')][_0x9f48('0x53')],_0x199f6c[_0x9f48('0x48')]['type']);return db[_0x9f48('0x4d')][_0x9f48('0x47')](_0x199f6c[_0x9f48('0x48')],{'include':[{'model':db['ServicenowField'],'as':_0x9f48('0x51')},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})[_0x9f48('0x25')](respondWithResult(_0x564131,null))['catch'](handleError(_0x564131,null));};exports[_0x9f48('0x55')]=function(_0x155ae6,_0x5bd161,_0x28ca1f){var _0xdde371=['made_sla',_0x9f48('0x56'),_0x9f48('0x57'),_0x9f48('0x58'),'close_code',_0x9f48('0x59'),_0x9f48('0x5a'),_0x9f48('0x5b'),_0x9f48('0x5c')];var _0x52e830=[_0x9f48('0x5d'),'made_sla',_0x9f48('0x5e'),'watch_list',_0x9f48('0x5f'),_0x9f48('0x60'),_0x9f48('0x61'),'hold_reason',_0x9f48('0x62'),_0x9f48('0x63'),_0x9f48('0x64'),_0x9f48('0x65'),_0x9f48('0x66'),_0x9f48('0x67'),_0x9f48('0x68'),_0x9f48('0x69'),_0x9f48('0x6a'),_0x9f48('0x6b'),_0x9f48('0x57'),'order',_0x9f48('0x6c'),_0x9f48('0x6d'),_0x9f48('0x6e'),_0x9f48('0x6f'),_0x9f48('0x70'),'active',_0x9f48('0x71'),'business_service',_0x9f48('0x72'),_0x9f48('0x73'),_0x9f48('0x74'),_0x9f48('0x75'),_0x9f48('0x76'),'opened_at',_0x9f48('0x77'),_0x9f48('0x78'),_0x9f48('0x79'),_0x9f48('0x7a'),_0x9f48('0x7b'),'caller_id','approval_set',_0x9f48('0x58'),'work_notes','short_description',_0x9f48('0x7c'),_0x9f48('0x7d'),_0x9f48('0x7e'),_0x9f48('0x7f'),'assignment_group','business_stc','additional_assignee_list','description',_0x9f48('0x80'),_0x9f48('0x59'),_0x9f48('0x81'),_0x9f48('0x82'),_0x9f48('0x83'),_0x9f48('0x84'),_0x9f48('0x85'),_0x9f48('0x86'),_0x9f48('0x87'),'reopened_by','incident_state',_0x9f48('0x88'),_0x9f48('0x89'),_0x9f48('0x8a'),_0x9f48('0x8b'),_0x9f48('0x8c'),_0x9f48('0x8d'),_0x9f48('0x5b'),'comments',_0x9f48('0x8e'),_0x9f48('0x8f'),_0x9f48('0x90'),'due_date',_0x9f48('0x91'),'reopen_count','sys_tags','escalation',_0x9f48('0x92'),'correlation_id','location',_0x9f48('0x5c')];var _0x42b1d9='';var _0x299f91='';var _0x53e50e=[];var _0x588ef7='';var _0x36bc78='';var _0x55ecb1=[];var _0x41cf1d='';var _0x15f07d='';var _0x4c0fe9={};var _0x2bb03c='';return db['ServicenowAccount'][_0x9f48('0x4c')]({'where':{'id':_0x155ae6[_0x9f48('0x44')]['id']},'attributes':['id',_0x9f48('0x93'),_0x9f48('0x94'),_0x9f48('0x95'),_0x9f48('0x96'),_0x9f48('0x97')]})[_0x9f48('0x25')](handleEntityNotFound(_0x5bd161,null))[_0x9f48('0x25')](function(_0x59debc){if(_0x59debc){_0x2bb03c=_0x59debc[_0x9f48('0x96')];var _0x67fa27=_0x2bb03c[_0x9f48('0x98')](-0x1);if(_0x67fa27==='/'){_0x2bb03c=_0x2bb03c[_0x9f48('0x99')](0x0,_0x2bb03c[_0x9f48('0x9a')](_0x67fa27));}_0x15f07d=util[_0x9f48('0x9b')](_0x9f48('0x9c'),_0x2bb03c);_0x41cf1d=util[_0x9f48('0x9b')](_0x9f48('0x9d'),_0x2bb03c);_0x4c0fe9={'user':_0x59debc[_0x9f48('0x93')],'pass':_0x59debc['password']};var _0x1a082e={'method':_0x9f48('0x9e'),'uri':_0x15f07d+_0x9f48('0x9f'),'auth':_0x4c0fe9,'json':!![]};return rp(_0x1a082e);}})[_0x9f48('0x25')](function(_0x2c6a32){if(_0x2c6a32['result']['length']>0x0){_0x42b1d9=_0x2c6a32[_0x9f48('0xa0')];}console[_0x9f48('0xa1')](_0x9f48('0xa2'),_0x42b1d9);_0x55ecb1=[];_0x299f91=Object[_0x9f48('0xa3')]([],_0x42b1d9);_[_0x9f48('0xa4')](_0x299f91,function(_0x108c3b){return!_0xdde371['includes'](_0x108c3b[_0x9f48('0x27')]);});_0x299f91[_0x9f48('0xa5')](function(_0x5eee46){var _0x41f7ea=createFieldObject(_0x41cf1d,_0x4c0fe9,_0x5eee46[_0x9f48('0xa6')],_0x5eee46[_0x9f48('0x27')],_0x5eee46[_0x9f48('0xa7')],![]);_0x55ecb1[_0x9f48('0xa8')](_0x41f7ea);});return Promise[_0x9f48('0xa9')](_0x55ecb1);})[_0x9f48('0x25')](function(_0xc65c01){_0x53e50e=_0xc65c01;_0x588ef7=Object['assign']([],_0x42b1d9);console['log']('TCL:\x20_object',_0x42b1d9);_[_0x9f48('0xa4')](_0x588ef7,function(_0x25945c){return _0x52e830[_0x9f48('0xaa')](_0x25945c['name']);});console[_0x9f48('0xa1')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x588ef7);_0x55ecb1=[];_0x588ef7['forEach'](function(_0xcaee9f){var _0xcfdd87=createFieldObject(_0x41cf1d,_0x4c0fe9,_0xcaee9f[_0x9f48('0xa6')],_0xcaee9f[_0x9f48('0x27')],_0xcaee9f[_0x9f48('0xa7')],!![]);_0x55ecb1[_0x9f48('0xa8')](_0xcfdd87);});return Promise[_0x9f48('0xa9')](_0x55ecb1);})[_0x9f48('0x25')](function(_0x2fea17){_0x36bc78=_0x2fea17;var _0x209232=_0x53e50e[_0x9f48('0xab')](_0x36bc78);return{'count':_0x209232[_0x9f48('0x34')],'rows':_0x209232};})[_0x9f48('0x25')](respondWithResult(_0x5bd161,null))['catch'](function(_0x181e98){console['log'](_0x9f48('0xac')+_0x181e98);var _0x156235=_0x155ae6[_0x9f48('0x2e')]['test']?0x1f4:_0x181e98[_0x9f48('0xad')]||0x1f4;logger[_0x9f48('0xae')](_0x181e98[_0x9f48('0x26')]);delete _0x181e98[_0x9f48('0x27')];if(_0x156235===0x191){_0x156235=0x190;}_0x5bd161['status'](_0x156235)[_0x9f48('0x28')](_0x155ae6['query'][_0x9f48('0xaf')]?{'message':_0x9f48('0xb0'),'statusCode':_0x181e98[_0x9f48('0xad')]}:_0x181e98);});};function createFieldObject(_0x388b69,_0x280837,_0xd9a4ad,_0xda3d5d,_0x55ea7a,_0x1a8687){return new Promise(function(_0x514c7c,_0x420e14){var _0x5d244e={'id':_0xda3d5d,'name':_0x55ea7a,'custom':_0x1a8687};if(_0xd9a4ad===_0x9f48('0xb1')){_0x5d244e[_0x9f48('0x3f')]=[{'name':_0x9f48('0xb2'),'value':'true'},{'name':'False','value':_0x9f48('0xb3')}];_0x514c7c(_0x5d244e);}else{var _0x2a7fc1={'method':'GET','uri':_0x388b69+_0x9f48('0xb4')+_0xda3d5d,'auth':_0x280837,'json':!![]};return rp(_0x2a7fc1)[_0x9f48('0x25')](function(_0x1f1c02){var _0x515ac1=[];if(_0x1f1c02[_0x9f48('0xa0')][_0x9f48('0x34')]>0x0){_0x1f1c02['result']['forEach'](function(_0x2c802b){if(_0x2c802b[_0x9f48('0xb5')]==='false'){var _0x5af5d7={'name':_0x2c802b[_0x9f48('0xa7')],'value':_0x2c802b[_0x9f48('0xb6')]};_0x515ac1[_0x9f48('0xa8')](_0x5af5d7);}});}_0x5d244e['options']=_0x515ac1;if(_0x5d244e[_0x9f48('0x3f')]['length']>0x0){_0x514c7c(_0x5d244e);}else{if(_0x1a8687==![]){_0x514c7c();}else{_0x514c7c(_0x5d244e);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 6fcffa7..21edc87 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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','lodash','util'];(function(_0x5c78d9,_0x2736c7){var _0x69ae1f=function(_0x4b31ac){while(--_0x4b31ac){_0x5c78d9['push'](_0x5c78d9['shift']());}};_0x69ae1f(++_0x2736c7);}(_0x7a54,0x106));var _0x47a5=function(_0xa6bd42,_0x527906){_0xa6bd42=_0xa6bd42-0x0;var _0x4a82f1=_0x7a54[_0xa6bd42];return _0x4a82f1;};'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'));var integrations=require(_0x47a5('0x9'));module['exports']=function(_0x3d5629,_0x59199c){return _0x3d5629[_0x47a5('0xa')](_0x47a5('0xb'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f47=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','int_servicenow_accounts','util'];(function(_0x3303fb,_0x1266dd){var _0x71a686=function(_0x2c7537){while(--_0x2c7537){_0x3303fb['push'](_0x3303fb['shift']());}};_0x71a686(++_0x1266dd);}(_0x6f47,0xc7));var _0x76f4=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x6f47[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require('lodash');var util=require(_0x76f4('0x0'));var logger=require(_0x76f4('0x1'))('api');var moment=require(_0x76f4('0x2'));var BPromise=require('bluebird');var rp=require(_0x76f4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var attributes=require(_0x76f4('0x6'));var integrations=require(_0x76f4('0x7'));module['exports']=function(_0x35602f,_0xfc2405){return _0x35602f[_0x76f4('0x8')]('ServicenowAccount',attributes,{'tableName':_0x76f4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index f4d293b..41ef520 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 _0x60ec=['ServicenowAccount','findAll','options','raw','limit','include','map','model','attributes','GetServicenowAccount','catch','ShowServicenowAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x60ec,0x12d));var _0xc60e=function(_0x2bb915,_0x549e4c){_0x2bb915=_0x2bb915-0x0;var _0x24fdae=_0x60ec[_0x2bb915];return _0x24fdae;};'use strict';var _=require(_0xc60e('0x0'));var util=require(_0xc60e('0x1'));var moment=require(_0xc60e('0x2'));var BPromise=require(_0xc60e('0x3'));var rs=require(_0xc60e('0x4'));var fs=require('fs');var Redis=require(_0xc60e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc60e('0x6'));var logger=require(_0xc60e('0x7'))(_0xc60e('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc60e('0x9')][_0xc60e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c1923,_0x163d5b,_0x102230){return new BPromise(function(_0x59009e,_0xc46bff){return client[_0xc60e('0xb')](_0x2c1923,_0x102230)[_0xc60e('0xc')](function(_0x2e858f){logger[_0xc60e('0xd')](_0xc60e('0xe'),_0x163d5b,'request\x20sent');logger[_0xc60e('0xf')](_0xc60e('0x10'),_0x163d5b,_0xc60e('0x11'),JSON[_0xc60e('0x12')](_0x2e858f));if(_0x2e858f[_0xc60e('0x13')]){if(_0x2e858f[_0xc60e('0x13')][_0xc60e('0x14')]===0x1f4){logger[_0xc60e('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0x163d5b,_0x2e858f['error'][_0xc60e('0x15')]);return _0xc46bff(_0x2e858f['error'][_0xc60e('0x15')]);}logger[_0xc60e('0x13')](_0xc60e('0xe'),_0x163d5b,_0x2e858f[_0xc60e('0x13')][_0xc60e('0x15')]);return _0x59009e(_0x2e858f[_0xc60e('0x13')][_0xc60e('0x15')]);}else{logger[_0xc60e('0xd')](_0xc60e('0xe'),_0x163d5b,'request\x20sent');_0x59009e(_0x2e858f[_0xc60e('0x16')][_0xc60e('0x15')]);}})['catch'](function(_0x1e1a36){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x163d5b,_0x1e1a36);_0xc46bff(_0x1e1a36);});});}exports['GetServicenowAccount']=function(_0x1ed876){var _0x289cc2=this;return new Promise(function(_0x39f046,_0x5ba8ab){return db[_0xc60e('0x17')][_0xc60e('0x18')]({'raw':_0x1ed876['options']?_0x1ed876[_0xc60e('0x19')][_0xc60e('0x1a')]===undefined?!![]:![]:!![],'where':_0x1ed876[_0xc60e('0x19')]?_0x1ed876[_0xc60e('0x19')]['where']||null:null,'attributes':_0x1ed876[_0xc60e('0x19')]?_0x1ed876['options']['attributes']||null:null,'limit':_0x1ed876[_0xc60e('0x19')]?_0x1ed876[_0xc60e('0x19')][_0xc60e('0x1b')]||null:null,'include':_0x1ed876[_0xc60e('0x19')]?_0x1ed876[_0xc60e('0x19')][_0xc60e('0x1c')]?_[_0xc60e('0x1d')](_0x1ed876[_0xc60e('0x19')][_0xc60e('0x1c')],function(_0x5a1b07){return{'model':db[_0x5a1b07[_0xc60e('0x1e')]],'as':_0x5a1b07['as'],'attributes':_0x5a1b07[_0xc60e('0x1f')],'include':_0x5a1b07[_0xc60e('0x1c')]?_[_0xc60e('0x1d')](_0x5a1b07['include'],function(_0x43f66d){return{'model':db[_0x43f66d['model']],'as':_0x43f66d['as'],'attributes':_0x43f66d[_0xc60e('0x1f')],'include':_0x43f66d[_0xc60e('0x1c')]?_[_0xc60e('0x1d')](_0x43f66d[_0xc60e('0x1c')],function(_0xa5d3fa){return{'model':db[_0xa5d3fa['model']],'as':_0xa5d3fa['as'],'attributes':_0xa5d3fa[_0xc60e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc60e('0xc')](function(_0x230cce){logger[_0xc60e('0xd')]('GetServicenowAccount',_0x1ed876);logger[_0xc60e('0xf')](_0xc60e('0x20'),_0x1ed876,JSON['stringify'](_0x230cce));_0x39f046(_0x230cce);})[_0xc60e('0x21')](function(_0x2041c3){logger[_0xc60e('0x13')](_0xc60e('0x20'),_0x2041c3[_0xc60e('0x15')],_0x1ed876);_0x5ba8ab(_0x289cc2['error'](0x1f4,_0x2041c3[_0xc60e('0x15')]));});});};exports[_0xc60e('0x22')]=function(_0x4b50da){var _0x2ea887=this;return new Promise(function(_0x255e59,_0x2576a1){return db[_0xc60e('0x17')][_0xc60e('0x23')]({'raw':_0x4b50da[_0xc60e('0x19')]?_0x4b50da[_0xc60e('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4b50da[_0xc60e('0x19')]?_0x4b50da[_0xc60e('0x19')]['where']||null:null,'attributes':_0x4b50da[_0xc60e('0x19')]?_0x4b50da['options'][_0xc60e('0x1f')]||null:null,'include':_0x4b50da[_0xc60e('0x19')]?_0x4b50da[_0xc60e('0x19')][_0xc60e('0x1c')]?_[_0xc60e('0x1d')](_0x4b50da[_0xc60e('0x19')][_0xc60e('0x1c')],function(_0x153eff){return{'model':db[_0x153eff['model']],'as':_0x153eff['as'],'attributes':_0x153eff[_0xc60e('0x1f')],'include':_0x153eff[_0xc60e('0x1c')]?_['map'](_0x153eff[_0xc60e('0x1c')],function(_0x50ec22){return{'model':db[_0x50ec22[_0xc60e('0x1e')]],'as':_0x50ec22['as'],'attributes':_0x50ec22[_0xc60e('0x1f')],'include':_0x50ec22[_0xc60e('0x1c')]?_[_0xc60e('0x1d')](_0x50ec22[_0xc60e('0x1c')],function(_0x989f03){return{'model':db[_0x989f03[_0xc60e('0x1e')]],'as':_0x989f03['as'],'attributes':_0x989f03[_0xc60e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc60e('0xc')](function(_0x31ad80){logger['info']('ShowServicenowAccount',_0x4b50da);logger[_0xc60e('0xf')](_0xc60e('0x22'),_0x4b50da,JSON['stringify'](_0x31ad80));_0x255e59(_0x31ad80);})['catch'](function(_0x5690d9){logger['error'](_0xc60e('0x22'),_0x5690d9[_0xc60e('0x15')],_0x4b50da);_0x2576a1(_0x2ea887[_0xc60e('0x13')](0x1f4,_0x5690d9[_0xc60e('0x15')]));});});}; \ No newline at end of file +var _0xf99c=['../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','ServicenowAccount,\x20%s,\x20%s','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','attributes','limit','include','model','map','stringify','ShowServicenowAccount','find','where','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xf99c,0x64));var _0xcf99=function(_0x1463f8,_0x5e626f){_0x1463f8=_0x1463f8-0x0;var _0x4fc959=_0xf99c[_0x1463f8];return _0x4fc959;};'use strict';var _=require(_0xcf99('0x0'));var util=require('util');var moment=require(_0xcf99('0x1'));var BPromise=require(_0xcf99('0x2'));var rs=require(_0xcf99('0x3'));var fs=require('fs');var Redis=require(_0xcf99('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcf99('0x5'));var logger=require(_0xcf99('0x6'))(_0xcf99('0x7'));var config=require(_0xcf99('0x8'));var jayson=require(_0xcf99('0x9'));var client=jayson[_0xcf99('0xa')][_0xcf99('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xee1ed4,_0x4f9f25,_0x40192d){return new BPromise(function(_0x3dc75b,_0xbc8263){return client['request'](_0xee1ed4,_0x40192d)[_0xcf99('0xc')](function(_0x59d959){logger[_0xcf99('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x4f9f25,_0xcf99('0xe'));logger[_0xcf99('0xf')](_0xcf99('0x10'),_0x4f9f25,_0xcf99('0xe'),JSON['stringify'](_0x59d959));if(_0x59d959['error']){if(_0x59d959[_0xcf99('0x11')]['code']===0x1f4){logger[_0xcf99('0x11')](_0xcf99('0x12'),_0x4f9f25,_0x59d959[_0xcf99('0x11')][_0xcf99('0x13')]);return _0xbc8263(_0x59d959[_0xcf99('0x11')]['message']);}logger[_0xcf99('0x11')](_0xcf99('0x12'),_0x4f9f25,_0x59d959['error']['message']);return _0x3dc75b(_0x59d959[_0xcf99('0x11')]['message']);}else{logger[_0xcf99('0xd')](_0xcf99('0x12'),_0x4f9f25,_0xcf99('0xe'));_0x3dc75b(_0x59d959[_0xcf99('0x14')][_0xcf99('0x13')]);}})[_0xcf99('0x15')](function(_0xc34714){logger[_0xcf99('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x4f9f25,_0xc34714);_0xbc8263(_0xc34714);});});}exports[_0xcf99('0x16')]=function(_0x1e2599){var _0x29dab4=this;return new Promise(function(_0x9dd054,_0x1d9bfb){return db[_0xcf99('0x17')][_0xcf99('0x18')]({'raw':_0x1e2599[_0xcf99('0x19')]?_0x1e2599['options'][_0xcf99('0x1a')]===undefined?!![]:![]:!![],'where':_0x1e2599[_0xcf99('0x19')]?_0x1e2599[_0xcf99('0x19')]['where']||null:null,'attributes':_0x1e2599['options']?_0x1e2599['options'][_0xcf99('0x1b')]||null:null,'limit':_0x1e2599[_0xcf99('0x19')]?_0x1e2599[_0xcf99('0x19')][_0xcf99('0x1c')]||null:null,'include':_0x1e2599[_0xcf99('0x19')]?_0x1e2599[_0xcf99('0x19')]['include']?_['map'](_0x1e2599['options'][_0xcf99('0x1d')],function(_0x1e4fce){return{'model':db[_0x1e4fce['model']],'as':_0x1e4fce['as'],'attributes':_0x1e4fce[_0xcf99('0x1b')],'include':_0x1e4fce[_0xcf99('0x1d')]?_['map'](_0x1e4fce[_0xcf99('0x1d')],function(_0x4b9990){return{'model':db[_0x4b9990[_0xcf99('0x1e')]],'as':_0x4b9990['as'],'attributes':_0x4b9990[_0xcf99('0x1b')],'include':_0x4b9990[_0xcf99('0x1d')]?_[_0xcf99('0x1f')](_0x4b9990[_0xcf99('0x1d')],function(_0x3ad5f9){return{'model':db[_0x3ad5f9[_0xcf99('0x1e')]],'as':_0x3ad5f9['as'],'attributes':_0x3ad5f9[_0xcf99('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcf99('0xc')](function(_0x3dad50){logger[_0xcf99('0xd')](_0xcf99('0x16'),_0x1e2599);logger['debug'](_0xcf99('0x16'),_0x1e2599,JSON[_0xcf99('0x20')](_0x3dad50));_0x9dd054(_0x3dad50);})['catch'](function(_0x4b7208){logger[_0xcf99('0x11')](_0xcf99('0x16'),_0x4b7208[_0xcf99('0x13')],_0x1e2599);_0x1d9bfb(_0x29dab4[_0xcf99('0x11')](0x1f4,_0x4b7208[_0xcf99('0x13')]));});});};exports[_0xcf99('0x21')]=function(_0x3eee40){var _0x48ed72=this;return new Promise(function(_0x5c3a3b,_0x2ea1e5){return db[_0xcf99('0x17')][_0xcf99('0x22')]({'raw':_0x3eee40[_0xcf99('0x19')]?_0x3eee40['options'][_0xcf99('0x1a')]===undefined?!![]:![]:!![],'where':_0x3eee40[_0xcf99('0x19')]?_0x3eee40['options'][_0xcf99('0x23')]||null:null,'attributes':_0x3eee40[_0xcf99('0x19')]?_0x3eee40['options']['attributes']||null:null,'include':_0x3eee40['options']?_0x3eee40['options'][_0xcf99('0x1d')]?_[_0xcf99('0x1f')](_0x3eee40[_0xcf99('0x19')][_0xcf99('0x1d')],function(_0x5d856d){return{'model':db[_0x5d856d[_0xcf99('0x1e')]],'as':_0x5d856d['as'],'attributes':_0x5d856d[_0xcf99('0x1b')],'include':_0x5d856d[_0xcf99('0x1d')]?_['map'](_0x5d856d[_0xcf99('0x1d')],function(_0x1b7b28){return{'model':db[_0x1b7b28[_0xcf99('0x1e')]],'as':_0x1b7b28['as'],'attributes':_0x1b7b28[_0xcf99('0x1b')],'include':_0x1b7b28[_0xcf99('0x1d')]?_[_0xcf99('0x1f')](_0x1b7b28[_0xcf99('0x1d')],function(_0x369dcf){return{'model':db[_0x369dcf[_0xcf99('0x1e')]],'as':_0x369dcf['as'],'attributes':_0x369dcf[_0xcf99('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42711a){logger[_0xcf99('0xd')](_0xcf99('0x21'),_0x3eee40);logger['debug'](_0xcf99('0x21'),_0x3eee40,JSON[_0xcf99('0x20')](_0x42711a));_0x5c3a3b(_0x42711a);})[_0xcf99('0x15')](function(_0x2717ac){logger['error']('ShowServicenowAccount',_0x2717ac[_0xcf99('0x13')],_0x3eee40);_0x2ea1e5(_0x48ed72[_0xcf99('0x11')](0x1f4,_0x2717ac['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index f3ab538..968865a 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 _0xc5a2=['path','Router','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','post','create','destroy','multer'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc5a2,0xfe));var _0x2c5a=function(_0x1bfeec,_0x12b5bd){_0x1bfeec=_0x1bfeec-0x0;var _0xe1f57c=_0xc5a2[_0x1bfeec];return _0xe1f57c;};'use strict';var multer=require(_0x2c5a('0x0'));var util=require('util');var path=require(_0x2c5a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2c5a('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2c5a('0x3'));var config=require(_0x2c5a('0x4'));var controller=require(_0x2c5a('0x5'));router[_0x2c5a('0x6')]('/',auth['isAuthenticated'](),controller[_0x2c5a('0x7')]);router[_0x2c5a('0x6')](_0x2c5a('0x8'),auth[_0x2c5a('0x9')](),controller[_0x2c5a('0xa')]);router[_0x2c5a('0x6')](_0x2c5a('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0x2c5a('0x6')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0x2c5a('0x6')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0x2c5a('0xc')]('/',auth[_0x2c5a('0x9')](),controller[_0x2c5a('0xd')]);router['put'](_0x2c5a('0x8'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x2c5a('0x8'),auth['isAuthenticated'](),controller[_0x2c5a('0xe')]);module['exports']=router; \ No newline at end of file +var _0x205f=['show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x4bfcbe,_0x4630f5){var _0x5b65e6=function(_0x5dcfc8){while(--_0x5dcfc8){_0x4bfcbe['push'](_0x4bfcbe['shift']());}};_0x5b65e6(++_0x4630f5);}(_0x205f,0x1ad));var _0xf205=function(_0xd4636c,_0x34dbf6){_0xd4636c=_0xd4636c-0x0;var _0x5ee17d=_0x205f[_0xd4636c];return _0x5ee17d;};'use strict';var multer=require(_0xf205('0x0'));var util=require('util');var path=require(_0xf205('0x1'));var timeout=require(_0xf205('0x2'));var express=require(_0xf205('0x3'));var router=express[_0xf205('0x4')]();var fs_extra=require(_0xf205('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf205('0x6'));router[_0xf205('0x7')]('/',auth[_0xf205('0x8')](),controller[_0xf205('0x9')]);router['get'](_0xf205('0xa'),auth[_0xf205('0x8')](),controller[_0xf205('0xb')]);router[_0xf205('0x7')](_0xf205('0xc'),auth['isAuthenticated'](),controller[_0xf205('0xd')]);router[_0xf205('0x7')](_0xf205('0xe'),auth[_0xf205('0x8')](),controller[_0xf205('0xf')]);router[_0xf205('0x7')]('/:id/descriptions',auth[_0xf205('0x8')](),controller[_0xf205('0x10')]);router[_0xf205('0x11')]('/',auth['isAuthenticated'](),controller[_0xf205('0x12')]);router[_0xf205('0x13')](_0xf205('0xa'),auth[_0xf205('0x8')](),controller['update']);router[_0xf205('0x14')](_0xf205('0xa'),auth[_0xf205('0x8')](),controller[_0xf205('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 89e7e7f..17209da 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 _0x854a=['STRING','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x854a,0x15a));var _0xa854=function(_0x4c8437,_0x598ee4){_0x4c8437=_0x4c8437-0x0;var _0x1aca20=_0x854a[_0x4c8437];return _0x1aca20;};'use strict';var Sequelize=require(_0xa854('0x0'));module[_0xa854('0x1')]={'name':{'type':Sequelize[_0xa854('0x2')]},'description':{'type':Sequelize[_0xa854('0x2')]}}; \ No newline at end of file +var _0x16fc=['STRING','sequelize'];(function(_0x3c4c1b,_0x567fb1){var _0x1e0d7c=function(_0x52fdd0){while(--_0x52fdd0){_0x3c4c1b['push'](_0x3c4c1b['shift']());}};_0x1e0d7c(++_0x567fb1);}(_0x16fc,0x9b));var _0xc16f=function(_0x214261,_0x1aa243){_0x214261=_0x214261-0x0;var _0x55f0f4=_0x16fc[_0x214261];return _0x55f0f4;};'use strict';var Sequelize=require(_0xc16f('0x0'));module['exports']={'name':{'type':Sequelize[_0xc16f('0x1')]},'description':{'type':Sequelize[_0xc16f('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 946e252..0cabc48 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 _0x9622=['name','send','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','findAll','rows','catch','show','params','find','create','body','update','destroy','getFields','findOne','getSubjects','getDescriptions','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','set','Content-Range','json','apply','then','error','stack'];(function(_0x37fcda,_0x2f5aa1){var _0xf5ed91=function(_0x3c3241){while(--_0x3c3241){_0x37fcda['push'](_0x37fcda['shift']());}};_0xf5ed91(++_0x2f5aa1);}(_0x9622,0xbe));var _0x2962=function(_0x4c1711,_0x2f49ce){_0x4c1711=_0x4c1711-0x0;var _0x3de6eb=_0x9622[_0x4c1711];return _0x3de6eb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2962('0x0'));var rp=require(_0x2962('0x1'));var moment=require('moment');var BPromise=require(_0x2962('0x2'));var Mustache=require(_0x2962('0x3'));var util=require('util');var path=require(_0x2962('0x4'));var sox=require(_0x2962('0x5'));var csv=require(_0x2962('0x6'));var ejs=require(_0x2962('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2962('0x8'));var squel=require('squel');var crypto=require(_0x2962('0x9'));var jsforce=require(_0x2962('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x2962('0x6'));var querystring=require(_0x2962('0xb'));var Papa=require(_0x2962('0xc'));var Redis=require(_0x2962('0xd'));var authService=require(_0x2962('0xe'));var qs=require(_0x2962('0xf'));var as=require(_0x2962('0x10'));var hardwareService=require(_0x2962('0x11'));var logger=require(_0x2962('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x2962('0x13'));var licenseUtil=require(_0x2962('0x14'));var db=require(_0x2962('0x15'))['db'];function respondWithStatusCode(_0x3195a1,_0x227c79){_0x227c79=_0x227c79||0xcc;return function(_0x212597){if(_0x212597){return _0x3195a1[_0x2962('0x16')](_0x227c79);}return _0x3195a1['status'](_0x227c79)[_0x2962('0x17')]();};}function respondWithResult(_0x4e1e4b,_0xec92a5){_0xec92a5=_0xec92a5||0xc8;return function(_0x42d46c){if(_0x42d46c){return _0x4e1e4b[_0x2962('0x18')](_0xec92a5)['json'](_0x42d46c);}};}function respondWithFilteredResult(_0x2454eb,_0x317049){return function(_0x43e958){if(_0x43e958){var _0x17432b=typeof _0x317049[_0x2962('0x19')]===_0x2962('0x1a')&&typeof _0x317049['limit']===_0x2962('0x1a');var _0x436ad5=_0x43e958['count'];var _0x13ade7=_0x17432b?0x0:_0x317049[_0x2962('0x19')];var _0x3882c7=_0x17432b?_0x43e958['count']:_0x317049[_0x2962('0x19')]+_0x317049[_0x2962('0x1b')];var _0x28de19;if(_0x3882c7>=_0x436ad5){_0x3882c7=_0x436ad5;_0x28de19=0xc8;}else{_0x28de19=0xce;}_0x2454eb[_0x2962('0x18')](_0x28de19);return _0x2454eb[_0x2962('0x1c')](_0x2962('0x1d'),_0x13ade7+'-'+_0x3882c7+'/'+_0x436ad5)[_0x2962('0x1e')](_0x43e958);}return null;};}function patchUpdates(_0xa51e1a){return function(_0xc92b7a){try{jsonpatch[_0x2962('0x1f')](_0xc92b7a,_0xa51e1a,!![]);}catch(_0xd3e447){return BPromise['reject'](_0xd3e447);}return _0xc92b7a['save']();};}function saveUpdates(_0x3b1ed3,_0x116b23){return function(_0x38e78f){if(_0x38e78f){return _0x38e78f['update'](_0x3b1ed3)[_0x2962('0x20')](function(_0x3d6032){return _0x3d6032;});}return null;};}function removeEntity(_0xdf614,_0x2d0320){return function(_0x15bd9d){if(_0x15bd9d){return _0x15bd9d['destroy']()[_0x2962('0x20')](function(){_0xdf614['status'](0xcc)[_0x2962('0x17')]();});}};}function handleEntityNotFound(_0x1d71d6,_0x46dbc7){return function(_0x315c7f){if(!_0x315c7f){_0x1d71d6[_0x2962('0x16')](0x194);}return _0x315c7f;};}function handleError(_0x379a89,_0x58384c){_0x58384c=_0x58384c||0x1f4;return function(_0x265bf9){logger[_0x2962('0x21')](_0x265bf9[_0x2962('0x22')]);if(_0x265bf9[_0x2962('0x23')]){delete _0x265bf9[_0x2962('0x23')];}_0x379a89['status'](_0x58384c)[_0x2962('0x24')](_0x265bf9);};}exports['index']=function(_0x1840e2,_0x202465){var _0x4238aa={},_0x20c12e={},_0xcc5ded={'count':0x0,'rows':[]};var _0x2e526e=_[_0x2962('0x25')](db[_0x2962('0x26')][_0x2962('0x27')],function(_0x1904cd){return{'name':_0x1904cd[_0x2962('0x28')],'type':_0x1904cd[_0x2962('0x29')][_0x2962('0x2a')]};});_0x20c12e[_0x2962('0x2b')]=_[_0x2962('0x25')](_0x2e526e,_0x2962('0x23'));_0x20c12e['query']=_[_0x2962('0x2c')](_0x1840e2[_0x2962('0x2d')]);_0x20c12e[_0x2962('0x2e')]=_[_0x2962('0x2f')](_0x20c12e[_0x2962('0x2b')],_0x20c12e['query']);_0x4238aa[_0x2962('0x30')]=_['intersection'](_0x20c12e[_0x2962('0x2b')],qs['fields'](_0x1840e2[_0x2962('0x2d')][_0x2962('0x31')]));_0x4238aa['attributes']=_0x4238aa[_0x2962('0x30')][_0x2962('0x32')]?_0x4238aa[_0x2962('0x30')]:_0x20c12e[_0x2962('0x2b')];if(!_0x1840e2['query'][_0x2962('0x33')](_0x2962('0x34'))){_0x4238aa[_0x2962('0x1b')]=qs['limit'](_0x1840e2[_0x2962('0x2d')][_0x2962('0x1b')]);_0x4238aa['offset']=qs['offset'](_0x1840e2[_0x2962('0x2d')]['offset']);}_0x4238aa[_0x2962('0x35')]=qs[_0x2962('0x36')](_0x1840e2[_0x2962('0x2d')][_0x2962('0x36')]);_0x4238aa[_0x2962('0x37')]=qs[_0x2962('0x2e')](_[_0x2962('0x38')](_0x1840e2[_0x2962('0x2d')],_0x20c12e[_0x2962('0x2e')]),_0x2e526e);if(_0x1840e2[_0x2962('0x2d')][_0x2962('0x39')]){_0x4238aa[_0x2962('0x37')]=_['merge'](_0x4238aa[_0x2962('0x37')],{'$or':_[_0x2962('0x25')](_0x2e526e,function(_0x501c62){if(_0x501c62[_0x2962('0x29')]!=='VIRTUAL'){var _0x217eab={};_0x217eab[_0x501c62[_0x2962('0x23')]]={'$like':'%'+_0x1840e2[_0x2962('0x2d')][_0x2962('0x39')]+'%'};return _0x217eab;}})});}_0x4238aa=_[_0x2962('0x3a')]({},_0x4238aa,_0x1840e2[_0x2962('0x3b')]);var _0x159fd7={'where':_0x4238aa[_0x2962('0x37')]};return db[_0x2962('0x26')][_0x2962('0x3c')](_0x159fd7)[_0x2962('0x20')](function(_0x1a8247){_0xcc5ded[_0x2962('0x3c')]=_0x1a8247;if(_0x1840e2['query']['includeAll']){_0x4238aa['include']=[{'all':!![]}];}return db[_0x2962('0x26')][_0x2962('0x3d')](_0x4238aa);})[_0x2962('0x20')](function(_0x2c5de3){_0xcc5ded[_0x2962('0x3e')]=_0x2c5de3;return _0xcc5ded;})['then'](respondWithFilteredResult(_0x202465,_0x4238aa))[_0x2962('0x3f')](handleError(_0x202465,null));};exports[_0x2962('0x40')]=function(_0x485fe8,_0xe86c47){var _0x41e26b={'raw':![],'where':{'id':_0x485fe8[_0x2962('0x41')]['id']}},_0xc6bfe2={};_0xc6bfe2[_0x2962('0x2b')]=_[_0x2962('0x2c')](db[_0x2962('0x26')][_0x2962('0x27')]);_0xc6bfe2[_0x2962('0x2d')]=_[_0x2962('0x2c')](_0x485fe8[_0x2962('0x2d')]);_0xc6bfe2['filters']=_['intersection'](_0xc6bfe2[_0x2962('0x2b')],_0xc6bfe2['query']);_0x41e26b[_0x2962('0x30')]=_[_0x2962('0x2f')](_0xc6bfe2[_0x2962('0x2b')],qs[_0x2962('0x31')](_0x485fe8[_0x2962('0x2d')][_0x2962('0x31')]));_0x41e26b[_0x2962('0x30')]=_0x41e26b[_0x2962('0x30')][_0x2962('0x32')]?_0x41e26b[_0x2962('0x30')]:_0xc6bfe2[_0x2962('0x2b')];if(_0x485fe8['query']['includeAll']){_0x41e26b['include']=[{'all':!![]}];}_0x41e26b=_[_0x2962('0x3a')]({},_0x41e26b,_0x485fe8[_0x2962('0x3b')]);return db[_0x2962('0x26')][_0x2962('0x42')](_0x41e26b)[_0x2962('0x20')](handleEntityNotFound(_0xe86c47,null))[_0x2962('0x20')](respondWithResult(_0xe86c47,null))['catch'](handleError(_0xe86c47,null));};exports[_0x2962('0x43')]=function(_0x32b4e6,_0x139085){return db[_0x2962('0x26')][_0x2962('0x43')](_0x32b4e6[_0x2962('0x44')],{})[_0x2962('0x20')](respondWithResult(_0x139085,0xc9))[_0x2962('0x3f')](handleError(_0x139085,null));};exports[_0x2962('0x45')]=function(_0x35c790,_0x4ddae3){if(_0x35c790[_0x2962('0x44')]['id']){delete _0x35c790[_0x2962('0x44')]['id'];}return db[_0x2962('0x26')][_0x2962('0x42')]({'where':{'id':_0x35c790[_0x2962('0x41')]['id']}})[_0x2962('0x20')](handleEntityNotFound(_0x4ddae3,null))['then'](saveUpdates(_0x35c790[_0x2962('0x44')],null))[_0x2962('0x20')](respondWithResult(_0x4ddae3,null))[_0x2962('0x3f')](handleError(_0x4ddae3,null));};exports[_0x2962('0x46')]=function(_0x210a10,_0x594dba){return db[_0x2962('0x26')]['find']({'where':{'id':_0x210a10[_0x2962('0x41')]['id']}})['then'](handleEntityNotFound(_0x594dba,null))['then'](removeEntity(_0x594dba,null))[_0x2962('0x3f')](handleError(_0x594dba,null));};exports[_0x2962('0x47')]=function(_0x5b1124,_0x377036,_0x1d64c9){var _0x1471d8={};var _0x1a266d={};var _0x4508f6;var _0x24e937;return db['ServicenowConfiguration'][_0x2962('0x48')]({'where':{'id':_0x5b1124[_0x2962('0x41')]['id']}})[_0x2962('0x20')](handleEntityNotFound(_0x377036,null))[_0x2962('0x20')](function(_0x5cf36e){if(_0x5cf36e){_0x4508f6=_0x5cf36e;_0x1a266d['model']=_['keys'](db['ServicenowField'][_0x2962('0x27')]);_0x1a266d[_0x2962('0x2d')]=_['keys'](_0x5b1124[_0x2962('0x2d')]);_0x1a266d[_0x2962('0x2e')]=_[_0x2962('0x2f')](_0x1a266d[_0x2962('0x2b')],_0x1a266d[_0x2962('0x2d')]);_0x1471d8[_0x2962('0x30')]=_[_0x2962('0x2f')](_0x1a266d['model'],qs[_0x2962('0x31')](_0x5b1124[_0x2962('0x2d')][_0x2962('0x31')]));_0x1471d8[_0x2962('0x30')]=_0x1471d8['attributes']['length']?_0x1471d8[_0x2962('0x30')]:_0x1a266d[_0x2962('0x2b')];_0x1471d8[_0x2962('0x35')]=qs[_0x2962('0x36')](_0x5b1124[_0x2962('0x2d')][_0x2962('0x36')]);_0x1471d8['where']=qs['filters'](_[_0x2962('0x38')](_0x5b1124['query'],_0x1a266d[_0x2962('0x2e')]));if(_0x5b1124[_0x2962('0x2d')][_0x2962('0x39')]){_0x1471d8['where']=_[_0x2962('0x3a')](_0x1471d8[_0x2962('0x37')],{'$or':_[_0x2962('0x25')](_0x1471d8['attributes'],function(_0x4666cc){var _0x1b5344={};_0x1b5344[_0x4666cc]={'$like':'%'+_0x5b1124['query'][_0x2962('0x39')]+'%'};return _0x1b5344;})});}_0x1471d8=_['merge']({},_0x1471d8,_0x5b1124[_0x2962('0x3b')]);return _0x4508f6[_0x2962('0x47')](_0x1471d8);}})[_0x2962('0x20')](function(_0x3d3633){if(_0x3d3633){_0x24e937=_0x3d3633[_0x2962('0x32')];if(!_0x5b1124[_0x2962('0x2d')][_0x2962('0x33')](_0x2962('0x34'))){_0x1471d8[_0x2962('0x1b')]=qs['limit'](_0x5b1124[_0x2962('0x2d')][_0x2962('0x1b')]);_0x1471d8['offset']=qs[_0x2962('0x19')](_0x5b1124[_0x2962('0x2d')][_0x2962('0x19')]);}return _0x4508f6[_0x2962('0x47')](_0x1471d8);}})[_0x2962('0x20')](function(_0x373022){if(_0x373022){return _0x373022?{'count':_0x24e937,'rows':_0x373022}:null;}})[_0x2962('0x20')](respondWithResult(_0x377036,null))['catch'](handleError(_0x377036,null));};exports['getSubjects']=function(_0x343647,_0x178f54,_0x523c13){var _0x4c9be7={};var _0x3fb57c={};var _0x4cbb90;var _0xd0d452;return db['ServicenowConfiguration'][_0x2962('0x48')]({'where':{'id':_0x343647[_0x2962('0x41')]['id']}})['then'](handleEntityNotFound(_0x178f54,null))[_0x2962('0x20')](function(_0x1ab5f4){if(_0x1ab5f4){_0x4cbb90=_0x1ab5f4;_0x3fb57c[_0x2962('0x2b')]=_[_0x2962('0x2c')](db['ServicenowField'][_0x2962('0x27')]);_0x3fb57c['query']=_[_0x2962('0x2c')](_0x343647['query']);_0x3fb57c['filters']=_[_0x2962('0x2f')](_0x3fb57c[_0x2962('0x2b')],_0x3fb57c['query']);_0x4c9be7['attributes']=_[_0x2962('0x2f')](_0x3fb57c[_0x2962('0x2b')],qs[_0x2962('0x31')](_0x343647['query']['fields']));_0x4c9be7[_0x2962('0x30')]=_0x4c9be7[_0x2962('0x30')][_0x2962('0x32')]?_0x4c9be7['attributes']:_0x3fb57c[_0x2962('0x2b')];_0x4c9be7['order']=qs[_0x2962('0x36')](_0x343647[_0x2962('0x2d')]['sort']);_0x4c9be7[_0x2962('0x37')]=qs[_0x2962('0x2e')](_[_0x2962('0x38')](_0x343647[_0x2962('0x2d')],_0x3fb57c['filters']));if(_0x343647[_0x2962('0x2d')][_0x2962('0x39')]){_0x4c9be7['where']=_[_0x2962('0x3a')](_0x4c9be7[_0x2962('0x37')],{'$or':_[_0x2962('0x25')](_0x4c9be7['attributes'],function(_0x5a47bd){var _0xa48f22={};_0xa48f22[_0x5a47bd]={'$like':'%'+_0x343647[_0x2962('0x2d')][_0x2962('0x39')]+'%'};return _0xa48f22;})});}_0x4c9be7=_[_0x2962('0x3a')]({},_0x4c9be7,_0x343647[_0x2962('0x3b')]);return _0x4cbb90['getSubjects'](_0x4c9be7);}})[_0x2962('0x20')](function(_0x19850f){if(_0x19850f){_0xd0d452=_0x19850f['length'];if(!_0x343647[_0x2962('0x2d')][_0x2962('0x33')](_0x2962('0x34'))){_0x4c9be7['limit']=qs['limit'](_0x343647[_0x2962('0x2d')][_0x2962('0x1b')]);_0x4c9be7['offset']=qs[_0x2962('0x19')](_0x343647[_0x2962('0x2d')]['offset']);}return _0x4cbb90[_0x2962('0x49')](_0x4c9be7);}})[_0x2962('0x20')](function(_0xb03e35){if(_0xb03e35){return _0xb03e35?{'count':_0xd0d452,'rows':_0xb03e35}:null;}})['then'](respondWithResult(_0x178f54,null))['catch'](handleError(_0x178f54,null));};exports[_0x2962('0x4a')]=function(_0x50db6e,_0x3bdeac,_0x1e125c){var _0xe7fbef={};var _0x3ae90d={};var _0x412801;var _0x133365;return db[_0x2962('0x26')]['findOne']({'where':{'id':_0x50db6e[_0x2962('0x41')]['id']}})[_0x2962('0x20')](handleEntityNotFound(_0x3bdeac,null))['then'](function(_0x4298c8){if(_0x4298c8){_0x412801=_0x4298c8;_0x3ae90d[_0x2962('0x2b')]=_['keys'](db['ServicenowField'][_0x2962('0x27')]);_0x3ae90d[_0x2962('0x2d')]=_[_0x2962('0x2c')](_0x50db6e[_0x2962('0x2d')]);_0x3ae90d[_0x2962('0x2e')]=_[_0x2962('0x2f')](_0x3ae90d[_0x2962('0x2b')],_0x3ae90d[_0x2962('0x2d')]);_0xe7fbef[_0x2962('0x30')]=_[_0x2962('0x2f')](_0x3ae90d['model'],qs['fields'](_0x50db6e[_0x2962('0x2d')][_0x2962('0x31')]));_0xe7fbef['attributes']=_0xe7fbef[_0x2962('0x30')][_0x2962('0x32')]?_0xe7fbef[_0x2962('0x30')]:_0x3ae90d[_0x2962('0x2b')];_0xe7fbef[_0x2962('0x35')]=qs[_0x2962('0x36')](_0x50db6e[_0x2962('0x2d')][_0x2962('0x36')]);_0xe7fbef['where']=qs[_0x2962('0x2e')](_[_0x2962('0x38')](_0x50db6e[_0x2962('0x2d')],_0x3ae90d[_0x2962('0x2e')]));if(_0x50db6e[_0x2962('0x2d')][_0x2962('0x39')]){_0xe7fbef[_0x2962('0x37')]=_['merge'](_0xe7fbef['where'],{'$or':_['map'](_0xe7fbef[_0x2962('0x30')],function(_0x3b2269){var _0x40956e={};_0x40956e[_0x3b2269]={'$like':'%'+_0x50db6e[_0x2962('0x2d')][_0x2962('0x39')]+'%'};return _0x40956e;})});}_0xe7fbef=_[_0x2962('0x3a')]({},_0xe7fbef,_0x50db6e['options']);return _0x412801[_0x2962('0x4a')](_0xe7fbef);}})[_0x2962('0x20')](function(_0x165c4e){if(_0x165c4e){_0x133365=_0x165c4e['length'];if(!_0x50db6e['query'][_0x2962('0x33')](_0x2962('0x34'))){_0xe7fbef['limit']=qs[_0x2962('0x1b')](_0x50db6e['query']['limit']);_0xe7fbef[_0x2962('0x19')]=qs['offset'](_0x50db6e[_0x2962('0x2d')][_0x2962('0x19')]);}return _0x412801[_0x2962('0x4a')](_0xe7fbef);}})[_0x2962('0x20')](function(_0x19e0f9){if(_0x19e0f9){return _0x19e0f9?{'count':_0x133365,'rows':_0x19e0f9}:null;}})['then'](respondWithResult(_0x3bdeac,null))[_0x2962('0x3f')](handleError(_0x3bdeac,null));}; \ No newline at end of file +var _0x5d02=['sort','filters','pick','filter','merge','where','VIRTUAL','count','includeAll','include','findAll','catch','params','keys','options','create','body','update','find','ServicenowField','getFields','hasOwnProperty','getSubjects','findOne','getDescriptions','eml-format','fast-json-patch','request-promise','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','nolimit','order'];(function(_0x415700,_0x4eccf3){var _0x44d4f0=function(_0x3fc715){while(--_0x3fc715){_0x415700['push'](_0x415700['shift']());}};_0x44d4f0(++_0x4eccf3);}(_0x5d02,0x1ed));var _0x25d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d02[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x25d0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x25d0('0x1'));var rp=require(_0x25d0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x25d0('0x3'));var path=require(_0x25d0('0x4'));var sox=require('sox');var csv=require(_0x25d0('0x5'));var ejs=require(_0x25d0('0x6'));var fs=require('fs');var fs_extra=require(_0x25d0('0x7'));var _=require(_0x25d0('0x8'));var squel=require('squel');var crypto=require(_0x25d0('0x9'));var jsforce=require(_0x25d0('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x25d0('0x5'));var querystring=require(_0x25d0('0xb'));var Papa=require(_0x25d0('0xc'));var Redis=require(_0x25d0('0xd'));var authService=require(_0x25d0('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x25d0('0xf'));var hardwareService=require(_0x25d0('0x10'));var logger=require(_0x25d0('0x11'))('api');var utils=require(_0x25d0('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x25d0('0x13'));var db=require(_0x25d0('0x14'))['db'];function respondWithStatusCode(_0x317186,_0x4a2d31){_0x4a2d31=_0x4a2d31||0xcc;return function(_0x12c437){if(_0x12c437){return _0x317186[_0x25d0('0x15')](_0x4a2d31);}return _0x317186[_0x25d0('0x16')](_0x4a2d31)[_0x25d0('0x17')]();};}function respondWithResult(_0x131100,_0x2851e7){_0x2851e7=_0x2851e7||0xc8;return function(_0x1d920d){if(_0x1d920d){return _0x131100[_0x25d0('0x16')](_0x2851e7)[_0x25d0('0x18')](_0x1d920d);}};}function respondWithFilteredResult(_0x266980,_0x2245ac){return function(_0x25b4fe){if(_0x25b4fe){var _0x4ea1d9=typeof _0x2245ac['offset']==='undefined'&&typeof _0x2245ac['limit']==='undefined';var _0x3fda55=_0x25b4fe['count'];var _0x3929fb=_0x4ea1d9?0x0:_0x2245ac['offset'];var _0x1712cf=_0x4ea1d9?_0x25b4fe['count']:_0x2245ac[_0x25d0('0x19')]+_0x2245ac[_0x25d0('0x1a')];var _0xa4f34;if(_0x1712cf>=_0x3fda55){_0x1712cf=_0x3fda55;_0xa4f34=0xc8;}else{_0xa4f34=0xce;}_0x266980[_0x25d0('0x16')](_0xa4f34);return _0x266980[_0x25d0('0x1b')](_0x25d0('0x1c'),_0x3929fb+'-'+_0x1712cf+'/'+_0x3fda55)[_0x25d0('0x18')](_0x25b4fe);}return null;};}function patchUpdates(_0x3df320){return function(_0x574226){try{jsonpatch[_0x25d0('0x1d')](_0x574226,_0x3df320,!![]);}catch(_0x32adc0){return BPromise[_0x25d0('0x1e')](_0x32adc0);}return _0x574226[_0x25d0('0x1f')]();};}function saveUpdates(_0x2610cf,_0x1f0093){return function(_0x2cf339){if(_0x2cf339){return _0x2cf339['update'](_0x2610cf)[_0x25d0('0x20')](function(_0xf06f8b){return _0xf06f8b;});}return null;};}function removeEntity(_0x59bd72,_0x447356){return function(_0x1c67bb){if(_0x1c67bb){return _0x1c67bb[_0x25d0('0x21')]()[_0x25d0('0x20')](function(){_0x59bd72[_0x25d0('0x16')](0xcc)[_0x25d0('0x17')]();});}};}function handleEntityNotFound(_0x414e62,_0x6fb324){return function(_0x1aee5d){if(!_0x1aee5d){_0x414e62[_0x25d0('0x15')](0x194);}return _0x1aee5d;};}function handleError(_0x1f5f55,_0x1f7026){_0x1f7026=_0x1f7026||0x1f4;return function(_0x24d2a7){logger[_0x25d0('0x22')](_0x24d2a7[_0x25d0('0x23')]);if(_0x24d2a7[_0x25d0('0x24')]){delete _0x24d2a7[_0x25d0('0x24')];}_0x1f5f55[_0x25d0('0x16')](_0x1f7026)[_0x25d0('0x25')](_0x24d2a7);};}exports[_0x25d0('0x26')]=function(_0x59bdb6,_0x428940){var _0x1bf939={},_0x3053cb={},_0x27b5da={'count':0x0,'rows':[]};var _0x526636=_[_0x25d0('0x27')](db[_0x25d0('0x28')][_0x25d0('0x29')],function(_0x2d24be){return{'name':_0x2d24be[_0x25d0('0x2a')],'type':_0x2d24be[_0x25d0('0x2b')][_0x25d0('0x2c')]};});_0x3053cb[_0x25d0('0x2d')]=_[_0x25d0('0x27')](_0x526636,_0x25d0('0x24'));_0x3053cb['query']=_['keys'](_0x59bdb6[_0x25d0('0x2e')]);_0x3053cb['filters']=_['intersection'](_0x3053cb[_0x25d0('0x2d')],_0x3053cb[_0x25d0('0x2e')]);_0x1bf939[_0x25d0('0x2f')]=_[_0x25d0('0x30')](_0x3053cb[_0x25d0('0x2d')],qs['fields'](_0x59bdb6['query'][_0x25d0('0x31')]));_0x1bf939[_0x25d0('0x2f')]=_0x1bf939[_0x25d0('0x2f')][_0x25d0('0x32')]?_0x1bf939[_0x25d0('0x2f')]:_0x3053cb['model'];if(!_0x59bdb6[_0x25d0('0x2e')]['hasOwnProperty'](_0x25d0('0x33'))){_0x1bf939[_0x25d0('0x1a')]=qs[_0x25d0('0x1a')](_0x59bdb6[_0x25d0('0x2e')]['limit']);_0x1bf939[_0x25d0('0x19')]=qs[_0x25d0('0x19')](_0x59bdb6[_0x25d0('0x2e')][_0x25d0('0x19')]);}_0x1bf939[_0x25d0('0x34')]=qs[_0x25d0('0x35')](_0x59bdb6[_0x25d0('0x2e')]['sort']);_0x1bf939['where']=qs[_0x25d0('0x36')](_[_0x25d0('0x37')](_0x59bdb6[_0x25d0('0x2e')],_0x3053cb[_0x25d0('0x36')]),_0x526636);if(_0x59bdb6[_0x25d0('0x2e')][_0x25d0('0x38')]){_0x1bf939['where']=_[_0x25d0('0x39')](_0x1bf939[_0x25d0('0x3a')],{'$or':_[_0x25d0('0x27')](_0x526636,function(_0x22a578){if(_0x22a578[_0x25d0('0x2b')]!==_0x25d0('0x3b')){var _0x6cea9e={};_0x6cea9e[_0x22a578[_0x25d0('0x24')]]={'$like':'%'+_0x59bdb6['query'][_0x25d0('0x38')]+'%'};return _0x6cea9e;}})});}_0x1bf939=_[_0x25d0('0x39')]({},_0x1bf939,_0x59bdb6['options']);var _0x363caa={'where':_0x1bf939[_0x25d0('0x3a')]};return db['ServicenowConfiguration'][_0x25d0('0x3c')](_0x363caa)[_0x25d0('0x20')](function(_0x4c5a67){_0x27b5da['count']=_0x4c5a67;if(_0x59bdb6[_0x25d0('0x2e')][_0x25d0('0x3d')]){_0x1bf939[_0x25d0('0x3e')]=[{'all':!![]}];}return db[_0x25d0('0x28')][_0x25d0('0x3f')](_0x1bf939);})[_0x25d0('0x20')](function(_0x5ba814){_0x27b5da['rows']=_0x5ba814;return _0x27b5da;})[_0x25d0('0x20')](respondWithFilteredResult(_0x428940,_0x1bf939))[_0x25d0('0x40')](handleError(_0x428940,null));};exports['show']=function(_0x6b4432,_0x3c69fb){var _0x47179f={'raw':![],'where':{'id':_0x6b4432[_0x25d0('0x41')]['id']}},_0x7f526={};_0x7f526[_0x25d0('0x2d')]=_['keys'](db['ServicenowConfiguration'][_0x25d0('0x29')]);_0x7f526['query']=_[_0x25d0('0x42')](_0x6b4432[_0x25d0('0x2e')]);_0x7f526[_0x25d0('0x36')]=_['intersection'](_0x7f526[_0x25d0('0x2d')],_0x7f526['query']);_0x47179f[_0x25d0('0x2f')]=_[_0x25d0('0x30')](_0x7f526[_0x25d0('0x2d')],qs[_0x25d0('0x31')](_0x6b4432['query']['fields']));_0x47179f['attributes']=_0x47179f[_0x25d0('0x2f')][_0x25d0('0x32')]?_0x47179f[_0x25d0('0x2f')]:_0x7f526[_0x25d0('0x2d')];if(_0x6b4432[_0x25d0('0x2e')][_0x25d0('0x3d')]){_0x47179f['include']=[{'all':!![]}];}_0x47179f=_[_0x25d0('0x39')]({},_0x47179f,_0x6b4432[_0x25d0('0x43')]);return db[_0x25d0('0x28')]['find'](_0x47179f)[_0x25d0('0x20')](handleEntityNotFound(_0x3c69fb,null))[_0x25d0('0x20')](respondWithResult(_0x3c69fb,null))['catch'](handleError(_0x3c69fb,null));};exports[_0x25d0('0x44')]=function(_0x5b7db0,_0x4d7bfe){return db['ServicenowConfiguration'][_0x25d0('0x44')](_0x5b7db0[_0x25d0('0x45')],{})['then'](respondWithResult(_0x4d7bfe,0xc9))[_0x25d0('0x40')](handleError(_0x4d7bfe,null));};exports[_0x25d0('0x46')]=function(_0x3e3f7c,_0x311a94){if(_0x3e3f7c[_0x25d0('0x45')]['id']){delete _0x3e3f7c['body']['id'];}return db[_0x25d0('0x28')][_0x25d0('0x47')]({'where':{'id':_0x3e3f7c['params']['id']}})['then'](handleEntityNotFound(_0x311a94,null))[_0x25d0('0x20')](saveUpdates(_0x3e3f7c[_0x25d0('0x45')],null))['then'](respondWithResult(_0x311a94,null))[_0x25d0('0x40')](handleError(_0x311a94,null));};exports[_0x25d0('0x21')]=function(_0x390459,_0x34d78e){return db[_0x25d0('0x28')][_0x25d0('0x47')]({'where':{'id':_0x390459[_0x25d0('0x41')]['id']}})[_0x25d0('0x20')](handleEntityNotFound(_0x34d78e,null))[_0x25d0('0x20')](removeEntity(_0x34d78e,null))[_0x25d0('0x40')](handleError(_0x34d78e,null));};exports['getFields']=function(_0x1b1532,_0x3cadfa,_0x35d1e6){var _0x3c88d1={};var _0x33340b={};var _0x3e6ee7;var _0x2eb386;return db[_0x25d0('0x28')]['findOne']({'where':{'id':_0x1b1532['params']['id']}})[_0x25d0('0x20')](handleEntityNotFound(_0x3cadfa,null))[_0x25d0('0x20')](function(_0xbaa4f8){if(_0xbaa4f8){_0x3e6ee7=_0xbaa4f8;_0x33340b[_0x25d0('0x2d')]=_[_0x25d0('0x42')](db[_0x25d0('0x48')][_0x25d0('0x29')]);_0x33340b['query']=_[_0x25d0('0x42')](_0x1b1532[_0x25d0('0x2e')]);_0x33340b[_0x25d0('0x36')]=_['intersection'](_0x33340b['model'],_0x33340b[_0x25d0('0x2e')]);_0x3c88d1['attributes']=_[_0x25d0('0x30')](_0x33340b[_0x25d0('0x2d')],qs['fields'](_0x1b1532[_0x25d0('0x2e')][_0x25d0('0x31')]));_0x3c88d1['attributes']=_0x3c88d1[_0x25d0('0x2f')][_0x25d0('0x32')]?_0x3c88d1[_0x25d0('0x2f')]:_0x33340b['model'];_0x3c88d1[_0x25d0('0x34')]=qs[_0x25d0('0x35')](_0x1b1532['query'][_0x25d0('0x35')]);_0x3c88d1[_0x25d0('0x3a')]=qs[_0x25d0('0x36')](_[_0x25d0('0x37')](_0x1b1532[_0x25d0('0x2e')],_0x33340b[_0x25d0('0x36')]));if(_0x1b1532['query'][_0x25d0('0x38')]){_0x3c88d1[_0x25d0('0x3a')]=_[_0x25d0('0x39')](_0x3c88d1[_0x25d0('0x3a')],{'$or':_['map'](_0x3c88d1[_0x25d0('0x2f')],function(_0x511e11){var _0x549768={};_0x549768[_0x511e11]={'$like':'%'+_0x1b1532[_0x25d0('0x2e')][_0x25d0('0x38')]+'%'};return _0x549768;})});}_0x3c88d1=_[_0x25d0('0x39')]({},_0x3c88d1,_0x1b1532['options']);return _0x3e6ee7[_0x25d0('0x49')](_0x3c88d1);}})[_0x25d0('0x20')](function(_0x303d76){if(_0x303d76){_0x2eb386=_0x303d76[_0x25d0('0x32')];if(!_0x1b1532[_0x25d0('0x2e')][_0x25d0('0x4a')](_0x25d0('0x33'))){_0x3c88d1['limit']=qs['limit'](_0x1b1532['query'][_0x25d0('0x1a')]);_0x3c88d1[_0x25d0('0x19')]=qs[_0x25d0('0x19')](_0x1b1532['query'][_0x25d0('0x19')]);}return _0x3e6ee7['getFields'](_0x3c88d1);}})[_0x25d0('0x20')](function(_0x329e52){if(_0x329e52){return _0x329e52?{'count':_0x2eb386,'rows':_0x329e52}:null;}})['then'](respondWithResult(_0x3cadfa,null))[_0x25d0('0x40')](handleError(_0x3cadfa,null));};exports[_0x25d0('0x4b')]=function(_0x258df6,_0x3b2245,_0x32974b){var _0xad23a4={};var _0x537309={};var _0x2b2d77;var _0x13b4d3;return db[_0x25d0('0x28')][_0x25d0('0x4c')]({'where':{'id':_0x258df6[_0x25d0('0x41')]['id']}})['then'](handleEntityNotFound(_0x3b2245,null))['then'](function(_0x389a02){if(_0x389a02){_0x2b2d77=_0x389a02;_0x537309['model']=_['keys'](db[_0x25d0('0x48')][_0x25d0('0x29')]);_0x537309[_0x25d0('0x2e')]=_['keys'](_0x258df6[_0x25d0('0x2e')]);_0x537309[_0x25d0('0x36')]=_[_0x25d0('0x30')](_0x537309[_0x25d0('0x2d')],_0x537309[_0x25d0('0x2e')]);_0xad23a4['attributes']=_[_0x25d0('0x30')](_0x537309[_0x25d0('0x2d')],qs[_0x25d0('0x31')](_0x258df6[_0x25d0('0x2e')][_0x25d0('0x31')]));_0xad23a4[_0x25d0('0x2f')]=_0xad23a4[_0x25d0('0x2f')][_0x25d0('0x32')]?_0xad23a4[_0x25d0('0x2f')]:_0x537309['model'];_0xad23a4[_0x25d0('0x34')]=qs[_0x25d0('0x35')](_0x258df6[_0x25d0('0x2e')][_0x25d0('0x35')]);_0xad23a4[_0x25d0('0x3a')]=qs[_0x25d0('0x36')](_[_0x25d0('0x37')](_0x258df6[_0x25d0('0x2e')],_0x537309[_0x25d0('0x36')]));if(_0x258df6[_0x25d0('0x2e')]['filter']){_0xad23a4[_0x25d0('0x3a')]=_['merge'](_0xad23a4[_0x25d0('0x3a')],{'$or':_[_0x25d0('0x27')](_0xad23a4[_0x25d0('0x2f')],function(_0x4524cc){var _0xcd89b9={};_0xcd89b9[_0x4524cc]={'$like':'%'+_0x258df6[_0x25d0('0x2e')][_0x25d0('0x38')]+'%'};return _0xcd89b9;})});}_0xad23a4=_[_0x25d0('0x39')]({},_0xad23a4,_0x258df6[_0x25d0('0x43')]);return _0x2b2d77[_0x25d0('0x4b')](_0xad23a4);}})['then'](function(_0xdce68a){if(_0xdce68a){_0x13b4d3=_0xdce68a[_0x25d0('0x32')];if(!_0x258df6[_0x25d0('0x2e')][_0x25d0('0x4a')]('nolimit')){_0xad23a4['limit']=qs[_0x25d0('0x1a')](_0x258df6[_0x25d0('0x2e')][_0x25d0('0x1a')]);_0xad23a4[_0x25d0('0x19')]=qs[_0x25d0('0x19')](_0x258df6[_0x25d0('0x2e')][_0x25d0('0x19')]);}return _0x2b2d77[_0x25d0('0x4b')](_0xad23a4);}})[_0x25d0('0x20')](function(_0x2830f6){if(_0x2830f6){return _0x2830f6?{'count':_0x13b4d3,'rows':_0x2830f6}:null;}})[_0x25d0('0x20')](respondWithResult(_0x3b2245,null))['catch'](handleError(_0x3b2245,null));};exports[_0x25d0('0x4d')]=function(_0xf4e7f4,_0x1dfeee,_0x2d0c5e){var _0x22b1e8={};var _0x4722b2={};var _0x2b4768;var _0x5c3c43;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0xf4e7f4[_0x25d0('0x41')]['id']}})[_0x25d0('0x20')](handleEntityNotFound(_0x1dfeee,null))[_0x25d0('0x20')](function(_0x1f2c31){if(_0x1f2c31){_0x2b4768=_0x1f2c31;_0x4722b2[_0x25d0('0x2d')]=_[_0x25d0('0x42')](db[_0x25d0('0x48')][_0x25d0('0x29')]);_0x4722b2[_0x25d0('0x2e')]=_[_0x25d0('0x42')](_0xf4e7f4[_0x25d0('0x2e')]);_0x4722b2['filters']=_[_0x25d0('0x30')](_0x4722b2[_0x25d0('0x2d')],_0x4722b2['query']);_0x22b1e8[_0x25d0('0x2f')]=_[_0x25d0('0x30')](_0x4722b2[_0x25d0('0x2d')],qs[_0x25d0('0x31')](_0xf4e7f4[_0x25d0('0x2e')]['fields']));_0x22b1e8['attributes']=_0x22b1e8['attributes'][_0x25d0('0x32')]?_0x22b1e8[_0x25d0('0x2f')]:_0x4722b2[_0x25d0('0x2d')];_0x22b1e8[_0x25d0('0x34')]=qs[_0x25d0('0x35')](_0xf4e7f4[_0x25d0('0x2e')][_0x25d0('0x35')]);_0x22b1e8[_0x25d0('0x3a')]=qs['filters'](_['pick'](_0xf4e7f4[_0x25d0('0x2e')],_0x4722b2['filters']));if(_0xf4e7f4[_0x25d0('0x2e')]['filter']){_0x22b1e8['where']=_[_0x25d0('0x39')](_0x22b1e8[_0x25d0('0x3a')],{'$or':_[_0x25d0('0x27')](_0x22b1e8[_0x25d0('0x2f')],function(_0x51e705){var _0x2be8b0={};_0x2be8b0[_0x51e705]={'$like':'%'+_0xf4e7f4[_0x25d0('0x2e')][_0x25d0('0x38')]+'%'};return _0x2be8b0;})});}_0x22b1e8=_[_0x25d0('0x39')]({},_0x22b1e8,_0xf4e7f4[_0x25d0('0x43')]);return _0x2b4768[_0x25d0('0x4d')](_0x22b1e8);}})['then'](function(_0x3eaa5d){if(_0x3eaa5d){_0x5c3c43=_0x3eaa5d[_0x25d0('0x32')];if(!_0xf4e7f4[_0x25d0('0x2e')][_0x25d0('0x4a')](_0x25d0('0x33'))){_0x22b1e8[_0x25d0('0x1a')]=qs[_0x25d0('0x1a')](_0xf4e7f4[_0x25d0('0x2e')][_0x25d0('0x1a')]);_0x22b1e8[_0x25d0('0x19')]=qs[_0x25d0('0x19')](_0xf4e7f4['query'][_0x25d0('0x19')]);}return _0x2b4768[_0x25d0('0x4d')](_0x22b1e8);}})[_0x25d0('0x20')](function(_0x4ab314){if(_0x4ab314){return _0x4ab314?{'count':_0x5c3c43,'rows':_0x4ab314}:null;}})[_0x25d0('0x20')](respondWithResult(_0x1dfeee,null))['catch'](handleError(_0x1dfeee,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 7a68a04..7b9a001 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 _0x19cb=['ServicenowConfiguration','int_servicenow_configurations','util','../../config/logger','moment','request-promise','./intServicenowConfiguration.attributes','exports','define'];(function(_0x513047,_0x2199c5){var _0x15b779=function(_0x412fd5){while(--_0x412fd5){_0x513047['push'](_0x513047['shift']());}};_0x15b779(++_0x2199c5);}(_0x19cb,0x146));var _0xb19c=function(_0x4e4300,_0x14bb07){_0x4e4300=_0x4e4300-0x0;var _0x7585b5=_0x19cb[_0x4e4300];return _0x7585b5;};'use strict';var _=require('lodash');var util=require(_0xb19c('0x0'));var logger=require(_0xb19c('0x1'))('api');var moment=require(_0xb19c('0x2'));var BPromise=require('bluebird');var rp=require(_0xb19c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb19c('0x4'));module[_0xb19c('0x5')]=function(_0x5a145d,_0x551f8d){return _0x5a145d[_0xb19c('0x6')](_0xb19c('0x7'),attributes,{'tableName':_0xb19c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2868=['path','../../config/environment','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','lodash','../../config/logger','api','bluebird'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x2868,0x191));var _0x8286=function(_0x7b2482,_0x44d23b){_0x7b2482=_0x7b2482-0x0;var _0x574160=_0x2868[_0x7b2482];return _0x574160;};'use strict';var _=require(_0x8286('0x0'));var util=require('util');var logger=require(_0x8286('0x1'))(_0x8286('0x2'));var moment=require('moment');var BPromise=require(_0x8286('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8286('0x4'));var rimraf=require('rimraf');var config=require(_0x8286('0x5'));var attributes=require(_0x8286('0x6'));module['exports']=function(_0xa1b0f9,_0x9a8dcd){return _0xa1b0f9[_0x8286('0x7')](_0x8286('0x8'),attributes,{'tableName':'int_servicenow_configurations','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 9a488e9..f1bf596 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 _0x8e7b=['jayson/promise','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x8e7b,0x184));var _0xb8e7=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8e7b[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xb8e7('0x0'));var util=require('util');var moment=require(_0xb8e7('0x1'));var BPromise=require(_0xb8e7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb8e7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb8e7('0x4'));var logger=require(_0xb8e7('0x5'))(_0xb8e7('0x6'));var config=require(_0xb8e7('0x7'));var jayson=require(_0xb8e7('0x8'));var client=jayson['client'][_0xb8e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x78cd62,_0x584e20,_0x33c814){return new BPromise(function(_0x39b3fb,_0x105347){return client[_0xb8e7('0xa')](_0x78cd62,_0x33c814)[_0xb8e7('0xb')](function(_0x1d7b4c){logger[_0xb8e7('0xc')](_0xb8e7('0xd'),_0x584e20,_0xb8e7('0xe'));logger[_0xb8e7('0xf')](_0xb8e7('0x10'),_0x584e20,_0xb8e7('0xe'),JSON[_0xb8e7('0x11')](_0x1d7b4c));if(_0x1d7b4c['error']){if(_0x1d7b4c[_0xb8e7('0x12')][_0xb8e7('0x13')]===0x1f4){logger[_0xb8e7('0x12')](_0xb8e7('0xd'),_0x584e20,_0x1d7b4c[_0xb8e7('0x12')]['message']);return _0x105347(_0x1d7b4c[_0xb8e7('0x12')][_0xb8e7('0x14')]);}logger[_0xb8e7('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x584e20,_0x1d7b4c[_0xb8e7('0x12')][_0xb8e7('0x14')]);return _0x39b3fb(_0x1d7b4c[_0xb8e7('0x12')][_0xb8e7('0x14')]);}else{logger[_0xb8e7('0xc')](_0xb8e7('0xd'),_0x584e20,_0xb8e7('0xe'));_0x39b3fb(_0x1d7b4c[_0xb8e7('0x15')]['message']);}})['catch'](function(_0x3d395b){logger[_0xb8e7('0x12')](_0xb8e7('0xd'),_0x584e20,_0x3d395b);_0x105347(_0x3d395b);});});} \ No newline at end of file +var _0x910c=['http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x53936a,_0x12f660){var _0xa7162a=function(_0x409421){while(--_0x409421){_0x53936a['push'](_0x53936a['shift']());}};_0xa7162a(++_0x12f660);}(_0x910c,0x12d));var _0xc910=function(_0x35d775,_0x25431e){_0x35d775=_0x35d775-0x0;var _0x59384d=_0x910c[_0x35d775];return _0x59384d;};'use strict';var _=require(_0xc910('0x0'));var util=require(_0xc910('0x1'));var moment=require(_0xc910('0x2'));var BPromise=require(_0xc910('0x3'));var rs=require(_0xc910('0x4'));var fs=require('fs');var Redis=require(_0xc910('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc910('0x6'));var logger=require(_0xc910('0x7'))(_0xc910('0x8'));var config=require(_0xc910('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc910('0xa')][_0xc910('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11586f,_0x9df1d0,_0x3bd84e){return new BPromise(function(_0x38f3a3,_0xfc81d2){return client[_0xc910('0xc')](_0x11586f,_0x3bd84e)[_0xc910('0xd')](function(_0x5381aa){logger[_0xc910('0xe')](_0xc910('0xf'),_0x9df1d0,'request\x20sent');logger[_0xc910('0x10')](_0xc910('0x11'),_0x9df1d0,_0xc910('0x12'),JSON['stringify'](_0x5381aa));if(_0x5381aa[_0xc910('0x13')]){if(_0x5381aa[_0xc910('0x13')][_0xc910('0x14')]===0x1f4){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x9df1d0,_0x5381aa[_0xc910('0x13')][_0xc910('0x15')]);return _0xfc81d2(_0x5381aa[_0xc910('0x13')][_0xc910('0x15')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x9df1d0,_0x5381aa[_0xc910('0x13')][_0xc910('0x15')]);return _0x38f3a3(_0x5381aa[_0xc910('0x13')][_0xc910('0x15')]);}else{logger[_0xc910('0xe')](_0xc910('0xf'),_0x9df1d0,'request\x20sent');_0x38f3a3(_0x5381aa[_0xc910('0x16')][_0xc910('0x15')]);}})[_0xc910('0x17')](function(_0x3e84f6){logger[_0xc910('0x13')](_0xc910('0xf'),_0x9df1d0,_0x3e84f6);_0xfc81d2(_0x3e84f6);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 5bc93bd..3df069e 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 _0xe41b=['multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowField.controller','isAuthenticated','get','/:id','show','post','create','put','update','destroy'];(function(_0x4a5b5e,_0x54e34d){var _0x54da82=function(_0xbdbe72){while(--_0xbdbe72){_0x4a5b5e['push'](_0x4a5b5e['shift']());}};_0x54da82(++_0x54e34d);}(_0xe41b,0x154));var _0xbe41=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0xe41b[_0x257642];return _0x3d813b;};'use strict';var multer=require(_0xbe41('0x0'));var util=require(_0xbe41('0x1'));var path=require('path');var timeout=require(_0xbe41('0x2'));var express=require(_0xbe41('0x3'));var router=express['Router']();var fs_extra=require(_0xbe41('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbe41('0x5'));var config=require(_0xbe41('0x6'));var controller=require(_0xbe41('0x7'));router['get']('/',auth[_0xbe41('0x8')](),controller['index']);router[_0xbe41('0x9')](_0xbe41('0xa'),auth[_0xbe41('0x8')](),controller[_0xbe41('0xb')]);router[_0xbe41('0xc')]('/',auth[_0xbe41('0x8')](),controller[_0xbe41('0xd')]);router[_0xbe41('0xe')](_0xbe41('0xa'),auth[_0xbe41('0x8')](),controller[_0xbe41('0xf')]);router['delete'](_0xbe41('0xa'),auth[_0xbe41('0x8')](),controller[_0xbe41('0x10')]);module['exports']=router; \ No newline at end of file +var _0x068f=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','/:id','show','post'];(function(_0x3b1c47,_0x2cfcde){var _0x396bf7=function(_0x1a365b){while(--_0x1a365b){_0x3b1c47['push'](_0x3b1c47['shift']());}};_0x396bf7(++_0x2cfcde);}(_0x068f,0x8a));var _0xf068=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x068f[_0x138adb];return _0x1b27f2;};'use strict';var multer=require(_0xf068('0x0'));var util=require(_0xf068('0x1'));var path=require(_0xf068('0x2'));var timeout=require(_0xf068('0x3'));var express=require(_0xf068('0x4'));var router=express[_0xf068('0x5')]();var fs_extra=require(_0xf068('0x6'));var auth=require(_0xf068('0x7'));var interaction=require(_0xf068('0x8'));var config=require(_0xf068('0x9'));var controller=require(_0xf068('0xa'));router[_0xf068('0xb')]('/',auth[_0xf068('0xc')](),controller['index']);router[_0xf068('0xb')](_0xf068('0xd'),auth[_0xf068('0xc')](),controller[_0xf068('0xe')]);router[_0xf068('0xf')]('/',auth[_0xf068('0xc')](),controller[_0xf068('0x10')]);router[_0xf068('0x11')](_0xf068('0xd'),auth['isAuthenticated'](),controller[_0xf068('0x12')]);router[_0xf068('0x13')](_0xf068('0xd'),auth['isAuthenticated'](),controller[_0xf068('0x14')]);module[_0xf068('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 6c9ceda..1c17b44 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 _0xecda=['BOOLEAN','exports','ENUM','keyValue','string','STRING','variable'];(function(_0x39ebc4,_0x3bdb20){var _0x622721=function(_0x59307c){while(--_0x59307c){_0x39ebc4['push'](_0x39ebc4['shift']());}};_0x622721(++_0x3bdb20);}(_0xecda,0x16d));var _0xaecd=function(_0x3eddea,_0x3a0e12){_0x3eddea=_0x3eddea-0x0;var _0x18a6fc=_0xecda[_0x3eddea];return _0x18a6fc;};'use strict';var Sequelize=require('sequelize');module[_0xaecd('0x0')]={'type':{'type':Sequelize[_0xaecd('0x1')]('string','variable','customVariable',_0xaecd('0x2'),'picklist'),'defaultValue':_0xaecd('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xaecd('0x4')]},'keyType':{'type':Sequelize['ENUM']('string',_0xaecd('0x5'),'customVariable')},'keyContent':{'type':Sequelize[_0xaecd('0x4')]},'idField':{'type':Sequelize[_0xaecd('0x4')]},'nameField':{'type':Sequelize[_0xaecd('0x4')]},'customField':{'type':Sequelize[_0xaecd('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdb62=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x4d2ed7,_0x1999e5){var _0x12af27=function(_0x28e2d4){while(--_0x28e2d4){_0x4d2ed7['push'](_0x4d2ed7['shift']());}};_0x12af27(++_0x1999e5);}(_0xdb62,0x12c));var _0x2db6=function(_0x4f4d19,_0x574245){_0x4f4d19=_0x4f4d19-0x0;var _0x27a258=_0xdb62[_0x4f4d19];return _0x27a258;};'use strict';var Sequelize=require(_0x2db6('0x0'));module[_0x2db6('0x1')]={'type':{'type':Sequelize[_0x2db6('0x2')](_0x2db6('0x3'),_0x2db6('0x4'),_0x2db6('0x5'),'keyValue',_0x2db6('0x6')),'defaultValue':_0x2db6('0x3')},'content':{'type':Sequelize[_0x2db6('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x2db6('0x3'),'variable',_0x2db6('0x5'))},'keyContent':{'type':Sequelize[_0x2db6('0x7')]},'idField':{'type':Sequelize[_0x2db6('0x7')]},'nameField':{'type':Sequelize[_0x2db6('0x7')]},'customField':{'type':Sequelize[_0x2db6('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2db6('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index de79be6..f08947b 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 _0x5314=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','ServicenowField','includeAll','catch','params','keys','length','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x286e63,_0x90bf8f){var _0x4535eb=function(_0x1d71b4){while(--_0x1d71b4){_0x286e63['push'](_0x286e63['shift']());}};_0x4535eb(++_0x90bf8f);}(_0x5314,0x1d4));var _0x4531=function(_0x455fd8,_0xe5ce98){_0x455fd8=_0x455fd8-0x0;var _0x150340=_0x5314[_0x455fd8];return _0x150340;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4531('0x0'));var zipdir=require(_0x4531('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4531('0x2'));var moment=require(_0x4531('0x3'));var BPromise=require(_0x4531('0x4'));var Mustache=require(_0x4531('0x5'));var util=require('util');var path=require('path');var sox=require(_0x4531('0x6'));var csv=require(_0x4531('0x7'));var ejs=require(_0x4531('0x8'));var fs=require('fs');var fs_extra=require(_0x4531('0x9'));var _=require('lodash');var squel=require(_0x4531('0xa'));var crypto=require('crypto');var jsforce=require(_0x4531('0xb'));var deskjs=require(_0x4531('0xc'));var toCsv=require(_0x4531('0x7'));var querystring=require(_0x4531('0xd'));var Papa=require(_0x4531('0xe'));var Redis=require('ioredis');var authService=require(_0x4531('0xf'));var qs=require(_0x4531('0x10'));var as=require(_0x4531('0x11'));var hardwareService=require(_0x4531('0x12'));var logger=require('../../config/logger')(_0x4531('0x13'));var utils=require(_0x4531('0x14'));var config=require(_0x4531('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4531('0x16'))['db'];function respondWithStatusCode(_0x398e96,_0x48e678){_0x48e678=_0x48e678||0xcc;return function(_0x22a373){if(_0x22a373){return _0x398e96[_0x4531('0x17')](_0x48e678);}return _0x398e96[_0x4531('0x18')](_0x48e678)['end']();};}function respondWithResult(_0x1e4ef4,_0x4a686f){_0x4a686f=_0x4a686f||0xc8;return function(_0x2aacd5){if(_0x2aacd5){return _0x1e4ef4[_0x4531('0x18')](_0x4a686f)['json'](_0x2aacd5);}};}function respondWithFilteredResult(_0x40a1cf,_0x26c216){return function(_0x39015e){if(_0x39015e){var _0x1f56c2=typeof _0x26c216[_0x4531('0x19')]===_0x4531('0x1a')&&typeof _0x26c216[_0x4531('0x1b')]===_0x4531('0x1a');var _0x196431=_0x39015e[_0x4531('0x1c')];var _0x5ce86f=_0x1f56c2?0x0:_0x26c216[_0x4531('0x19')];var _0xb35914=_0x1f56c2?_0x39015e[_0x4531('0x1c')]:_0x26c216['offset']+_0x26c216[_0x4531('0x1b')];var _0x236331;if(_0xb35914>=_0x196431){_0xb35914=_0x196431;_0x236331=0xc8;}else{_0x236331=0xce;}_0x40a1cf[_0x4531('0x18')](_0x236331);return _0x40a1cf[_0x4531('0x1d')](_0x4531('0x1e'),_0x5ce86f+'-'+_0xb35914+'/'+_0x196431)[_0x4531('0x1f')](_0x39015e);}return null;};}function patchUpdates(_0x461b06){return function(_0x1ebefe){try{jsonpatch[_0x4531('0x20')](_0x1ebefe,_0x461b06,!![]);}catch(_0x47ca13){return BPromise[_0x4531('0x21')](_0x47ca13);}return _0x1ebefe[_0x4531('0x22')]();};}function saveUpdates(_0xe9920d,_0x510d83){return function(_0x314813){if(_0x314813){return _0x314813[_0x4531('0x23')](_0xe9920d)[_0x4531('0x24')](function(_0x356ea9){return _0x356ea9;});}return null;};}function removeEntity(_0x78c2d9,_0x63f9fe){return function(_0x1ff4ce){if(_0x1ff4ce){return _0x1ff4ce[_0x4531('0x25')]()[_0x4531('0x24')](function(){_0x78c2d9[_0x4531('0x18')](0xcc)[_0x4531('0x26')]();});}};}function handleEntityNotFound(_0x4988d7,_0x298d47){return function(_0x29b614){if(!_0x29b614){_0x4988d7[_0x4531('0x17')](0x194);}return _0x29b614;};}function handleError(_0x344081,_0x43f44a){_0x43f44a=_0x43f44a||0x1f4;return function(_0x342db9){logger[_0x4531('0x27')](_0x342db9[_0x4531('0x28')]);if(_0x342db9['name']){delete _0x342db9[_0x4531('0x29')];}_0x344081[_0x4531('0x18')](_0x43f44a)[_0x4531('0x2a')](_0x342db9);};}exports['index']=function(_0x25c609,_0x4a2a59){var _0x202278={},_0x5a848b={},_0x5d4a18={'count':0x0,'rows':[]};var _0x37e6ad=_[_0x4531('0x2b')](db['ServicenowField']['rawAttributes'],function(_0x2840f5){return{'name':_0x2840f5['fieldName'],'type':_0x2840f5[_0x4531('0x2c')][_0x4531('0x2d')]};});_0x5a848b[_0x4531('0x2e')]=_['map'](_0x37e6ad,_0x4531('0x29'));_0x5a848b[_0x4531('0x2f')]=_['keys'](_0x25c609[_0x4531('0x2f')]);_0x5a848b[_0x4531('0x30')]=_[_0x4531('0x31')](_0x5a848b[_0x4531('0x2e')],_0x5a848b[_0x4531('0x2f')]);_0x202278['attributes']=_['intersection'](_0x5a848b[_0x4531('0x2e')],qs['fields'](_0x25c609[_0x4531('0x2f')][_0x4531('0x32')]));_0x202278[_0x4531('0x33')]=_0x202278[_0x4531('0x33')]['length']?_0x202278['attributes']:_0x5a848b[_0x4531('0x2e')];if(!_0x25c609['query'][_0x4531('0x34')]('nolimit')){_0x202278[_0x4531('0x1b')]=qs[_0x4531('0x1b')](_0x25c609[_0x4531('0x2f')][_0x4531('0x1b')]);_0x202278[_0x4531('0x19')]=qs[_0x4531('0x19')](_0x25c609[_0x4531('0x2f')][_0x4531('0x19')]);}_0x202278['order']=qs[_0x4531('0x35')](_0x25c609[_0x4531('0x2f')][_0x4531('0x35')]);_0x202278['where']=qs[_0x4531('0x30')](_[_0x4531('0x36')](_0x25c609[_0x4531('0x2f')],_0x5a848b[_0x4531('0x30')]),_0x37e6ad);if(_0x25c609[_0x4531('0x2f')][_0x4531('0x37')]){_0x202278[_0x4531('0x38')]=_[_0x4531('0x39')](_0x202278[_0x4531('0x38')],{'$or':_[_0x4531('0x2b')](_0x37e6ad,function(_0x23e65a){if(_0x23e65a['type']!==_0x4531('0x3a')){var _0x31ddf3={};_0x31ddf3[_0x23e65a['name']]={'$like':'%'+_0x25c609[_0x4531('0x2f')][_0x4531('0x37')]+'%'};return _0x31ddf3;}})});}_0x202278=_[_0x4531('0x39')]({},_0x202278,_0x25c609[_0x4531('0x3b')]);var _0x55fec5={'where':_0x202278[_0x4531('0x38')]};return db[_0x4531('0x3c')][_0x4531('0x1c')](_0x55fec5)[_0x4531('0x24')](function(_0x1d745e){_0x5d4a18[_0x4531('0x1c')]=_0x1d745e;if(_0x25c609['query'][_0x4531('0x3d')]){_0x202278['include']=[{'all':!![]}];}return db[_0x4531('0x3c')]['findAll'](_0x202278);})[_0x4531('0x24')](function(_0x40310d){_0x5d4a18['rows']=_0x40310d;return _0x5d4a18;})[_0x4531('0x24')](respondWithFilteredResult(_0x4a2a59,_0x202278))[_0x4531('0x3e')](handleError(_0x4a2a59,null));};exports['show']=function(_0x250aac,_0xf5c1a8){var _0x39f8d4={'raw':!![],'where':{'id':_0x250aac[_0x4531('0x3f')]['id']}},_0x47222b={};_0x47222b[_0x4531('0x2e')]=_['keys'](db[_0x4531('0x3c')]['rawAttributes']);_0x47222b[_0x4531('0x2f')]=_[_0x4531('0x40')](_0x250aac[_0x4531('0x2f')]);_0x47222b[_0x4531('0x30')]=_[_0x4531('0x31')](_0x47222b[_0x4531('0x2e')],_0x47222b[_0x4531('0x2f')]);_0x39f8d4[_0x4531('0x33')]=_[_0x4531('0x31')](_0x47222b[_0x4531('0x2e')],qs[_0x4531('0x32')](_0x250aac[_0x4531('0x2f')][_0x4531('0x32')]));_0x39f8d4[_0x4531('0x33')]=_0x39f8d4[_0x4531('0x33')][_0x4531('0x41')]?_0x39f8d4[_0x4531('0x33')]:_0x47222b[_0x4531('0x2e')];if(_0x250aac[_0x4531('0x2f')][_0x4531('0x3d')]){_0x39f8d4['include']=[{'all':!![]}];}_0x39f8d4=_[_0x4531('0x39')]({},_0x39f8d4,_0x250aac[_0x4531('0x3b')]);return db['ServicenowField'][_0x4531('0x42')](_0x39f8d4)[_0x4531('0x24')](handleEntityNotFound(_0xf5c1a8,null))[_0x4531('0x24')](respondWithResult(_0xf5c1a8,null))[_0x4531('0x3e')](handleError(_0xf5c1a8,null));};exports[_0x4531('0x43')]=function(_0x48a1b8,_0x5d10e1){return db[_0x4531('0x3c')]['create'](_0x48a1b8['body'],{})[_0x4531('0x24')](respondWithResult(_0x5d10e1,0xc9))[_0x4531('0x3e')](handleError(_0x5d10e1,null));};exports[_0x4531('0x23')]=function(_0x264bd8,_0x30e262){if(_0x264bd8[_0x4531('0x44')]['id']){delete _0x264bd8[_0x4531('0x44')]['id'];}return db[_0x4531('0x3c')]['find']({'where':{'id':_0x264bd8[_0x4531('0x3f')]['id']}})[_0x4531('0x24')](handleEntityNotFound(_0x30e262,null))[_0x4531('0x24')](saveUpdates(_0x264bd8[_0x4531('0x44')],null))['then'](respondWithResult(_0x30e262,null))[_0x4531('0x3e')](handleError(_0x30e262,null));};exports[_0x4531('0x25')]=function(_0x39dda6,_0x2967db){return db['ServicenowField'][_0x4531('0x42')]({'where':{'id':_0x39dda6[_0x4531('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2967db,null))[_0x4531('0x24')](removeEntity(_0x2967db,null))[_0x4531('0x3e')](handleError(_0x2967db,null));}; \ No newline at end of file +var _0x4389=['status','end','json','offset','limit','undefined','set','Content-Range','save','update','then','error','stack','name','send','index','ServicenowField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x245d02,_0x454cd7){var _0x3d7d1d=function(_0x2aa8ed){while(--_0x2aa8ed){_0x245d02['push'](_0x245d02['shift']());}};_0x3d7d1d(++_0x454cd7);}(_0x4389,0x16e));var _0x9438=function(_0x5d515c,_0x16947f){_0x5d515c=_0x5d515c-0x0;var _0x23e661=_0x4389[_0x5d515c];return _0x23e661;};'use strict';var emlformat=require(_0x9438('0x0'));var rimraf=require(_0x9438('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9438('0x2'));var rp=require(_0x9438('0x3'));var moment=require(_0x9438('0x4'));var BPromise=require(_0x9438('0x5'));var Mustache=require(_0x9438('0x6'));var util=require(_0x9438('0x7'));var path=require(_0x9438('0x8'));var sox=require(_0x9438('0x9'));var csv=require(_0x9438('0xa'));var ejs=require(_0x9438('0xb'));var fs=require('fs');var fs_extra=require(_0x9438('0xc'));var _=require('lodash');var squel=require(_0x9438('0xd'));var crypto=require(_0x9438('0xe'));var jsforce=require(_0x9438('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9438('0x10'));var Papa=require('papaparse');var Redis=require(_0x9438('0x11'));var authService=require(_0x9438('0x12'));var qs=require(_0x9438('0x13'));var as=require(_0x9438('0x14'));var hardwareService=require(_0x9438('0x15'));var logger=require(_0x9438('0x16'))(_0x9438('0x17'));var utils=require(_0x9438('0x18'));var config=require(_0x9438('0x19'));var licenseUtil=require(_0x9438('0x1a'));var db=require(_0x9438('0x1b'))['db'];function respondWithStatusCode(_0x186079,_0x17b337){_0x17b337=_0x17b337||0xcc;return function(_0x2cdd0f){if(_0x2cdd0f){return _0x186079[_0x9438('0x1c')](_0x17b337);}return _0x186079[_0x9438('0x1d')](_0x17b337)[_0x9438('0x1e')]();};}function respondWithResult(_0x47d06,_0x350224){_0x350224=_0x350224||0xc8;return function(_0x28b09d){if(_0x28b09d){return _0x47d06[_0x9438('0x1d')](_0x350224)[_0x9438('0x1f')](_0x28b09d);}};}function respondWithFilteredResult(_0x3ce587,_0x4eb97e){return function(_0x28e6b2){if(_0x28e6b2){var _0xe8de19=typeof _0x4eb97e[_0x9438('0x20')]==='undefined'&&typeof _0x4eb97e[_0x9438('0x21')]===_0x9438('0x22');var _0x5f2a26=_0x28e6b2['count'];var _0xd29aca=_0xe8de19?0x0:_0x4eb97e[_0x9438('0x20')];var _0x1bef83=_0xe8de19?_0x28e6b2['count']:_0x4eb97e[_0x9438('0x20')]+_0x4eb97e[_0x9438('0x21')];var _0x328f05;if(_0x1bef83>=_0x5f2a26){_0x1bef83=_0x5f2a26;_0x328f05=0xc8;}else{_0x328f05=0xce;}_0x3ce587[_0x9438('0x1d')](_0x328f05);return _0x3ce587[_0x9438('0x23')](_0x9438('0x24'),_0xd29aca+'-'+_0x1bef83+'/'+_0x5f2a26)[_0x9438('0x1f')](_0x28e6b2);}return null;};}function patchUpdates(_0x5ba1b9){return function(_0xbcf3f2){try{jsonpatch['apply'](_0xbcf3f2,_0x5ba1b9,!![]);}catch(_0x48f857){return BPromise['reject'](_0x48f857);}return _0xbcf3f2[_0x9438('0x25')]();};}function saveUpdates(_0x1268b8,_0xbb07c){return function(_0x4760d3){if(_0x4760d3){return _0x4760d3[_0x9438('0x26')](_0x1268b8)[_0x9438('0x27')](function(_0x27d064){return _0x27d064;});}return null;};}function removeEntity(_0x539c7f,_0x45d587){return function(_0x3e85ad){if(_0x3e85ad){return _0x3e85ad['destroy']()[_0x9438('0x27')](function(){_0x539c7f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x332da4,_0x1beb22){return function(_0x5c2c13){if(!_0x5c2c13){_0x332da4['sendStatus'](0x194);}return _0x5c2c13;};}function handleError(_0x288df9,_0x4db203){_0x4db203=_0x4db203||0x1f4;return function(_0x1d8351){logger[_0x9438('0x28')](_0x1d8351[_0x9438('0x29')]);if(_0x1d8351[_0x9438('0x2a')]){delete _0x1d8351[_0x9438('0x2a')];}_0x288df9[_0x9438('0x1d')](_0x4db203)[_0x9438('0x2b')](_0x1d8351);};}exports[_0x9438('0x2c')]=function(_0x41286b,_0x534486){var _0x1a777e={},_0x48809a={},_0x595334={'count':0x0,'rows':[]};var _0x1f1e08=_['map'](db[_0x9438('0x2d')][_0x9438('0x2e')],function(_0x59c404){return{'name':_0x59c404[_0x9438('0x2f')],'type':_0x59c404[_0x9438('0x30')][_0x9438('0x31')]};});_0x48809a[_0x9438('0x32')]=_[_0x9438('0x33')](_0x1f1e08,_0x9438('0x2a'));_0x48809a[_0x9438('0x34')]=_[_0x9438('0x35')](_0x41286b[_0x9438('0x34')]);_0x48809a[_0x9438('0x36')]=_[_0x9438('0x37')](_0x48809a[_0x9438('0x32')],_0x48809a[_0x9438('0x34')]);_0x1a777e['attributes']=_['intersection'](_0x48809a[_0x9438('0x32')],qs['fields'](_0x41286b[_0x9438('0x34')]['fields']));_0x1a777e[_0x9438('0x38')]=_0x1a777e[_0x9438('0x38')]['length']?_0x1a777e[_0x9438('0x38')]:_0x48809a['model'];if(!_0x41286b[_0x9438('0x34')][_0x9438('0x39')](_0x9438('0x3a'))){_0x1a777e[_0x9438('0x21')]=qs['limit'](_0x41286b[_0x9438('0x34')]['limit']);_0x1a777e['offset']=qs[_0x9438('0x20')](_0x41286b['query'][_0x9438('0x20')]);}_0x1a777e[_0x9438('0x3b')]=qs[_0x9438('0x3c')](_0x41286b[_0x9438('0x34')]['sort']);_0x1a777e[_0x9438('0x3d')]=qs[_0x9438('0x36')](_['pick'](_0x41286b['query'],_0x48809a[_0x9438('0x36')]),_0x1f1e08);if(_0x41286b[_0x9438('0x34')][_0x9438('0x3e')]){_0x1a777e[_0x9438('0x3d')]=_['merge'](_0x1a777e[_0x9438('0x3d')],{'$or':_['map'](_0x1f1e08,function(_0x455cb8){if(_0x455cb8[_0x9438('0x30')]!==_0x9438('0x3f')){var _0x480a56={};_0x480a56[_0x455cb8['name']]={'$like':'%'+_0x41286b[_0x9438('0x34')]['filter']+'%'};return _0x480a56;}})});}_0x1a777e=_[_0x9438('0x40')]({},_0x1a777e,_0x41286b[_0x9438('0x41')]);var _0xb8d3d1={'where':_0x1a777e[_0x9438('0x3d')]};return db['ServicenowField']['count'](_0xb8d3d1)['then'](function(_0x277cad){_0x595334[_0x9438('0x42')]=_0x277cad;if(_0x41286b[_0x9438('0x34')][_0x9438('0x43')]){_0x1a777e[_0x9438('0x44')]=[{'all':!![]}];}return db[_0x9438('0x2d')][_0x9438('0x45')](_0x1a777e);})[_0x9438('0x27')](function(_0x2a7c3d){_0x595334[_0x9438('0x46')]=_0x2a7c3d;return _0x595334;})[_0x9438('0x27')](respondWithFilteredResult(_0x534486,_0x1a777e))[_0x9438('0x47')](handleError(_0x534486,null));};exports[_0x9438('0x48')]=function(_0xc7d43,_0x4acac3){var _0x1d679d={'raw':!![],'where':{'id':_0xc7d43[_0x9438('0x49')]['id']}},_0x291dd6={};_0x291dd6[_0x9438('0x32')]=_['keys'](db['ServicenowField'][_0x9438('0x2e')]);_0x291dd6[_0x9438('0x34')]=_['keys'](_0xc7d43[_0x9438('0x34')]);_0x291dd6[_0x9438('0x36')]=_[_0x9438('0x37')](_0x291dd6[_0x9438('0x32')],_0x291dd6[_0x9438('0x34')]);_0x1d679d[_0x9438('0x38')]=_[_0x9438('0x37')](_0x291dd6[_0x9438('0x32')],qs[_0x9438('0x4a')](_0xc7d43['query'][_0x9438('0x4a')]));_0x1d679d[_0x9438('0x38')]=_0x1d679d[_0x9438('0x38')]['length']?_0x1d679d[_0x9438('0x38')]:_0x291dd6[_0x9438('0x32')];if(_0xc7d43[_0x9438('0x34')][_0x9438('0x43')]){_0x1d679d[_0x9438('0x44')]=[{'all':!![]}];}_0x1d679d=_[_0x9438('0x40')]({},_0x1d679d,_0xc7d43[_0x9438('0x41')]);return db[_0x9438('0x2d')][_0x9438('0x4b')](_0x1d679d)[_0x9438('0x27')](handleEntityNotFound(_0x4acac3,null))['then'](respondWithResult(_0x4acac3,null))[_0x9438('0x47')](handleError(_0x4acac3,null));};exports[_0x9438('0x4c')]=function(_0x383a81,_0x13baf7){return db['ServicenowField'][_0x9438('0x4c')](_0x383a81[_0x9438('0x4d')],{})['then'](respondWithResult(_0x13baf7,0xc9))[_0x9438('0x47')](handleError(_0x13baf7,null));};exports[_0x9438('0x26')]=function(_0x24bf96,_0x4bea6c){if(_0x24bf96['body']['id']){delete _0x24bf96[_0x9438('0x4d')]['id'];}return db['ServicenowField'][_0x9438('0x4b')]({'where':{'id':_0x24bf96[_0x9438('0x49')]['id']}})[_0x9438('0x27')](handleEntityNotFound(_0x4bea6c,null))[_0x9438('0x27')](saveUpdates(_0x24bf96['body'],null))[_0x9438('0x27')](respondWithResult(_0x4bea6c,null))[_0x9438('0x47')](handleError(_0x4bea6c,null));};exports[_0x9438('0x4e')]=function(_0x47afcc,_0x2de601){return db[_0x9438('0x2d')][_0x9438('0x4b')]({'where':{'id':_0x47afcc[_0x9438('0x49')]['id']}})[_0x9438('0x27')](handleEntityNotFound(_0x2de601,null))[_0x9438('0x27')](removeEntity(_0x2de601,null))[_0x9438('0x47')](handleError(_0x2de601,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 44f2617..6362756 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 _0x2748=['idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ServicenowField','int_servicenow_fields','servicenow_unique_index'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x2748,0x1c4));var _0x8274=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2748[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x8274('0x0'));var util=require('util');var logger=require(_0x8274('0x1'))(_0x8274('0x2'));var moment=require(_0x8274('0x3'));var BPromise=require(_0x8274('0x4'));var rp=require(_0x8274('0x5'));var fs=require('fs');var path=require(_0x8274('0x6'));var rimraf=require(_0x8274('0x7'));var config=require(_0x8274('0x8'));var attributes=require('./intServicenowField.attributes');module[_0x8274('0x9')]=function(_0x54ab73,_0x19d786){return _0x54ab73['define'](_0x8274('0xa'),attributes,{'tableName':_0x8274('0xb'),'paranoid':![],'indexes':[{'name':_0x8274('0xc'),'fields':[_0x8274('0xd'),_0x8274('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1966=['./intServicenowField.attributes','exports','define','servicenow_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1966,0x148));var _0x6196=function(_0x384e86,_0x4892be){_0x384e86=_0x384e86-0x0;var _0x4b9abf=_0x1966[_0x384e86];return _0x4b9abf;};'use strict';var _=require(_0x6196('0x0'));var util=require(_0x6196('0x1'));var logger=require('../../config/logger')(_0x6196('0x2'));var moment=require(_0x6196('0x3'));var BPromise=require(_0x6196('0x4'));var rp=require(_0x6196('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6196('0x6'));var config=require(_0x6196('0x7'));var attributes=require(_0x6196('0x8'));module[_0x6196('0x9')]=function(_0x3caa44,_0x572b33){return _0x3caa44[_0x6196('0xa')]('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x6196('0xb'),'fields':[_0x6196('0xc'),_0x6196('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 98269f5..19c65aa 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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s'];(function(_0x3c1923,_0x5684f4){var _0x1fffd3=function(_0x267ed9){while(--_0x267ed9){_0x3c1923['push'](_0x3c1923['shift']());}};_0x1fffd3(++_0x5684f4);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1ca890,_0x21d0d3){_0x1ca890=_0x1ca890-0x0;var _0x3f8e01=_0xcb91[_0x1ca890];return _0x3f8e01;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('ServicenowField,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x15bbd4,_0x738cc0){var _0x3c6863=function(_0x1b773a){while(--_0x1b773a){_0x15bbd4['push'](_0x15bbd4['shift']());}};_0x3c6863(++_0x738cc0);}(_0xaa88,0x137));var _0x8aa8=function(_0x2fd160,_0x53c0d6){_0x2fd160=_0x2fd160-0x0;var _0x5c2031=_0xaa88[_0x2fd160];return _0x5c2031;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('ServicenowField,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 13a14f0..e98df05 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(_0x54330c,_0x5a788a){var _0x51e565=function(_0x4d52ca){while(--_0x4d52ca){_0x54330c['push'](_0x54330c['shift']());}};_0x51e565(++_0x5a788a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x19e834,_0x38b38d){var _0x34691e=function(_0x380bdd){while(--_0x380bdd){_0x19e834['push'](_0x19e834['shift']());}};_0x34691e(++_0x38b38d);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 21ab9c5..5cc5800 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(_0x406c5c,_0x57708d){var _0x2439da=function(_0x5eb2c3){while(--_0x5eb2c3){_0x406c5c['push'](_0x406c5c['shift']());}};_0x2439da(++_0x57708d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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(_0x3fbd23,_0x4e6dc1){var _0x10646a=function(_0x3fca35){while(--_0x3fca35){_0x3fbd23['push'](_0x3fbd23['shift']());}};_0x10646a(++_0x4e6dc1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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 3090a87..34b2f50 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 _0xeff2=['Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','%s%s','/service/v4_1/rest.php','get_module_fields','Calls','values','module_fields','remove','includes','label','value','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','json','limit','undefined','count','offset','set','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','map','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','options','SugarcrmAccount','include','findAll','rows','params','rawAttributes','includeAll','find','catch','create','body','destroy','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration'];(function(_0x452767,_0x46483b){var _0x3d7508=function(_0x12b9d8){while(--_0x12b9d8){_0x452767['push'](_0x452767['shift']());}};_0x3d7508(++_0x46483b);}(_0xeff2,0x180));var _0x2eff=function(_0x2825e5,_0x3391c7){_0x2825e5=_0x2825e5-0x0;var _0x2add82=_0xeff2[_0x2825e5];return _0x2add82;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2eff('0x0'));var BPromise=require(_0x2eff('0x1'));var Mustache=require(_0x2eff('0x2'));var util=require(_0x2eff('0x3'));var path=require('path');var sox=require(_0x2eff('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2eff('0x5'));var _=require(_0x2eff('0x6'));var squel=require(_0x2eff('0x7'));var crypto=require(_0x2eff('0x8'));var jsforce=require(_0x2eff('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x2eff('0xa'));var querystring=require('querystring');var Papa=require(_0x2eff('0xb'));var Redis=require('ioredis');var authService=require(_0x2eff('0xc'));var qs=require(_0x2eff('0xd'));var as=require(_0x2eff('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2eff('0xf'));var licenseUtil=require('../../config/license/util');var db=require(_0x2eff('0x10'))['db'];var integrations=require(_0x2eff('0x11'));function respondWithStatusCode(_0x34f8f6,_0x3cd521){_0x3cd521=_0x3cd521||0xcc;return function(_0x33225f){if(_0x33225f){return _0x34f8f6['sendStatus'](_0x3cd521);}return _0x34f8f6[_0x2eff('0x12')](_0x3cd521)['end']();};}function respondWithResult(_0x46dc59,_0x333bbf){_0x333bbf=_0x333bbf||0xc8;return function(_0xe157d3){if(_0xe157d3){return _0x46dc59[_0x2eff('0x12')](_0x333bbf)[_0x2eff('0x13')](_0xe157d3);}};}function respondWithFilteredResult(_0x49f37f,_0x12d99a){return function(_0x50f39c){if(_0x50f39c){var _0x6f24a6=typeof _0x12d99a['offset']==='undefined'&&typeof _0x12d99a[_0x2eff('0x14')]===_0x2eff('0x15');var _0x2ed5ea=_0x50f39c[_0x2eff('0x16')];var _0x31ba4c=_0x6f24a6?0x0:_0x12d99a['offset'];var _0x2c3ada=_0x6f24a6?_0x50f39c[_0x2eff('0x16')]:_0x12d99a[_0x2eff('0x17')]+_0x12d99a[_0x2eff('0x14')];var _0x3c8622;if(_0x2c3ada>=_0x2ed5ea){_0x2c3ada=_0x2ed5ea;_0x3c8622=0xc8;}else{_0x3c8622=0xce;}_0x49f37f[_0x2eff('0x12')](_0x3c8622);return _0x49f37f[_0x2eff('0x18')]('Content-Range',_0x31ba4c+'-'+_0x2c3ada+'/'+_0x2ed5ea)[_0x2eff('0x13')](_0x50f39c);}return null;};}function patchUpdates(_0x38b1a9){return function(_0x26c1fd){try{jsonpatch[_0x2eff('0x19')](_0x26c1fd,_0x38b1a9,!![]);}catch(_0x28c869){return BPromise[_0x2eff('0x1a')](_0x28c869);}return _0x26c1fd[_0x2eff('0x1b')]();};}function saveUpdates(_0x49a57c,_0x4791a7){return function(_0x574391){if(_0x574391){return _0x574391[_0x2eff('0x1c')](_0x49a57c)[_0x2eff('0x1d')](function(_0xcca868){return _0xcca868;});}return null;};}function removeEntity(_0x15375d,_0x5ba6be){return function(_0x4caec7){if(_0x4caec7){return _0x4caec7['destroy']()[_0x2eff('0x1d')](function(){_0x15375d['status'](0xcc)[_0x2eff('0x1e')]();});}};}function handleEntityNotFound(_0x448719,_0x246b60){return function(_0x174c14){if(!_0x174c14){_0x448719[_0x2eff('0x1f')](0x194);}return _0x174c14;};}function handleError(_0x28085b,_0x4fb4af){_0x4fb4af=_0x4fb4af||0x1f4;return function(_0x140b3e){logger[_0x2eff('0x20')](_0x140b3e[_0x2eff('0x21')]);if(_0x140b3e[_0x2eff('0x22')]){delete _0x140b3e[_0x2eff('0x22')];}_0x28085b[_0x2eff('0x12')](_0x4fb4af)[_0x2eff('0x23')](_0x140b3e);};}exports['index']=function(_0x44c8a5,_0x425566){var _0x4fbcee={},_0x30c26f={},_0x155bbe={'count':0x0,'rows':[]};var _0x183c3a=_[_0x2eff('0x24')](db['SugarcrmAccount']['rawAttributes'],function(_0x4c52b0){return{'name':_0x4c52b0['fieldName'],'type':_0x4c52b0[_0x2eff('0x25')][_0x2eff('0x26')]};});_0x30c26f['model']=_['map'](_0x183c3a,_0x2eff('0x22'));_0x30c26f[_0x2eff('0x27')]=_[_0x2eff('0x28')](_0x44c8a5[_0x2eff('0x27')]);_0x30c26f['filters']=_[_0x2eff('0x29')](_0x30c26f['model'],_0x30c26f[_0x2eff('0x27')]);_0x4fbcee[_0x2eff('0x2a')]=_['intersection'](_0x30c26f[_0x2eff('0x2b')],qs[_0x2eff('0x2c')](_0x44c8a5[_0x2eff('0x27')][_0x2eff('0x2c')]));_0x4fbcee['attributes']=_0x4fbcee[_0x2eff('0x2a')][_0x2eff('0x2d')]?_0x4fbcee[_0x2eff('0x2a')]:_0x30c26f['model'];if(!_0x44c8a5['query'][_0x2eff('0x2e')](_0x2eff('0x2f'))){_0x4fbcee[_0x2eff('0x14')]=qs[_0x2eff('0x14')](_0x44c8a5[_0x2eff('0x27')][_0x2eff('0x14')]);_0x4fbcee[_0x2eff('0x17')]=qs[_0x2eff('0x17')](_0x44c8a5[_0x2eff('0x27')]['offset']);}_0x4fbcee[_0x2eff('0x30')]=qs[_0x2eff('0x31')](_0x44c8a5[_0x2eff('0x27')][_0x2eff('0x31')]);_0x4fbcee['where']=qs['filters'](_[_0x2eff('0x32')](_0x44c8a5[_0x2eff('0x27')],_0x30c26f[_0x2eff('0x33')]),_0x183c3a);if(_0x44c8a5[_0x2eff('0x27')][_0x2eff('0x34')]){_0x4fbcee[_0x2eff('0x35')]=_['merge'](_0x4fbcee[_0x2eff('0x35')],{'$or':_[_0x2eff('0x24')](_0x183c3a,function(_0x13f27f){if(_0x13f27f[_0x2eff('0x25')]!=='VIRTUAL'){var _0x69c588={};_0x69c588[_0x13f27f[_0x2eff('0x22')]]={'$like':'%'+_0x44c8a5['query'][_0x2eff('0x34')]+'%'};return _0x69c588;}})});}_0x4fbcee=_[_0x2eff('0x36')]({},_0x4fbcee,_0x44c8a5[_0x2eff('0x37')]);var _0x7bba2f={'where':_0x4fbcee['where']};return db[_0x2eff('0x38')]['count'](_0x7bba2f)[_0x2eff('0x1d')](function(_0x4fbbc5){_0x155bbe[_0x2eff('0x16')]=_0x4fbbc5;if(_0x44c8a5[_0x2eff('0x27')]['includeAll']){_0x4fbcee[_0x2eff('0x39')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x2eff('0x3a')](_0x4fbcee);})[_0x2eff('0x1d')](function(_0x797c3e){_0x155bbe[_0x2eff('0x3b')]=_0x797c3e;return _0x155bbe;})[_0x2eff('0x1d')](respondWithFilteredResult(_0x425566,_0x4fbcee))['catch'](handleError(_0x425566,null));};exports['show']=function(_0x12c321,_0x2ee894){var _0x541be8={'raw':![],'where':{'id':_0x12c321[_0x2eff('0x3c')]['id']}},_0xa81305={};_0xa81305[_0x2eff('0x2b')]=_['keys'](db['SugarcrmAccount'][_0x2eff('0x3d')]);_0xa81305[_0x2eff('0x27')]=_[_0x2eff('0x28')](_0x12c321[_0x2eff('0x27')]);_0xa81305[_0x2eff('0x33')]=_[_0x2eff('0x29')](_0xa81305[_0x2eff('0x2b')],_0xa81305[_0x2eff('0x27')]);_0x541be8[_0x2eff('0x2a')]=_[_0x2eff('0x29')](_0xa81305['model'],qs['fields'](_0x12c321[_0x2eff('0x27')]['fields']));_0x541be8['attributes']=_0x541be8[_0x2eff('0x2a')][_0x2eff('0x2d')]?_0x541be8['attributes']:_0xa81305[_0x2eff('0x2b')];if(_0x12c321[_0x2eff('0x27')][_0x2eff('0x3e')]){_0x541be8[_0x2eff('0x39')]=[{'all':!![]}];}_0x541be8=_[_0x2eff('0x36')]({},_0x541be8,_0x12c321['options']);return db[_0x2eff('0x38')][_0x2eff('0x3f')](_0x541be8)['then'](handleEntityNotFound(_0x2ee894,null))['then'](respondWithResult(_0x2ee894,null))[_0x2eff('0x40')](handleError(_0x2ee894,null));};exports[_0x2eff('0x41')]=function(_0xdb1816,_0x152cf7){return db[_0x2eff('0x38')]['create'](_0xdb1816[_0x2eff('0x42')],{})[_0x2eff('0x1d')](respondWithResult(_0x152cf7,0xc9))[_0x2eff('0x40')](handleError(_0x152cf7,null));};exports[_0x2eff('0x1c')]=function(_0x53d91d,_0x33535b){if(_0x53d91d[_0x2eff('0x42')]['id']){delete _0x53d91d[_0x2eff('0x42')]['id'];}return db[_0x2eff('0x38')][_0x2eff('0x3f')]({'where':{'id':_0x53d91d[_0x2eff('0x3c')]['id']}})[_0x2eff('0x1d')](handleEntityNotFound(_0x33535b,null))['then'](saveUpdates(_0x53d91d[_0x2eff('0x42')],null))[_0x2eff('0x1d')](respondWithResult(_0x33535b,null))[_0x2eff('0x40')](handleError(_0x33535b,null));};exports[_0x2eff('0x43')]=function(_0x1c8647,_0x16672c){return db[_0x2eff('0x38')][_0x2eff('0x3f')]({'where':{'id':_0x1c8647[_0x2eff('0x3c')]['id']}})[_0x2eff('0x1d')](handleEntityNotFound(_0x16672c,null))[_0x2eff('0x1d')](removeEntity(_0x16672c,null))[_0x2eff('0x40')](handleError(_0x16672c,null));};exports[_0x2eff('0x44')]=function(_0x1d3045,_0x356281,_0x59af93){var _0x1bfb86={};var _0x20e469={};var _0x140a0c;var _0x14fc0e;return db[_0x2eff('0x38')][_0x2eff('0x45')]({'where':{'id':_0x1d3045['params']['id']}})[_0x2eff('0x1d')](handleEntityNotFound(_0x356281,null))[_0x2eff('0x1d')](function(_0x51ddfb){if(_0x51ddfb){_0x140a0c=_0x51ddfb;_0x20e469[_0x2eff('0x2b')]=_[_0x2eff('0x28')](db[_0x2eff('0x46')][_0x2eff('0x3d')]);_0x20e469[_0x2eff('0x27')]=_[_0x2eff('0x28')](_0x1d3045['query']);_0x20e469[_0x2eff('0x33')]=_[_0x2eff('0x29')](_0x20e469[_0x2eff('0x2b')],_0x20e469[_0x2eff('0x27')]);_0x1bfb86['attributes']=_['intersection'](_0x20e469[_0x2eff('0x2b')],qs['fields'](_0x1d3045[_0x2eff('0x27')][_0x2eff('0x2c')]));_0x1bfb86['attributes']=_0x1bfb86['attributes'][_0x2eff('0x2d')]?_0x1bfb86[_0x2eff('0x2a')]:_0x20e469[_0x2eff('0x2b')];_0x1bfb86[_0x2eff('0x30')]=qs[_0x2eff('0x31')](_0x1d3045[_0x2eff('0x27')][_0x2eff('0x31')]);_0x1bfb86[_0x2eff('0x35')]=qs['filters'](_['pick'](_0x1d3045[_0x2eff('0x27')],_0x20e469[_0x2eff('0x33')]));if(_0x1d3045[_0x2eff('0x27')]['filter']){_0x1bfb86[_0x2eff('0x35')]=_[_0x2eff('0x36')](_0x1bfb86[_0x2eff('0x35')],{'$or':_['map'](_0x1bfb86['attributes'],function(_0x2590fc){var _0xc9d202={};_0xc9d202[_0x2590fc]={'$like':'%'+_0x1d3045[_0x2eff('0x27')]['filter']+'%'};return _0xc9d202;})});}_0x1bfb86=_[_0x2eff('0x36')]({},_0x1bfb86,_0x1d3045['options']);return _0x140a0c[_0x2eff('0x44')](_0x1bfb86);}})['then'](function(_0x61bb58){if(_0x61bb58){_0x14fc0e=_0x61bb58[_0x2eff('0x2d')];if(!_0x1d3045[_0x2eff('0x27')][_0x2eff('0x2e')](_0x2eff('0x2f'))){_0x1bfb86[_0x2eff('0x14')]=qs[_0x2eff('0x14')](_0x1d3045[_0x2eff('0x27')][_0x2eff('0x14')]);_0x1bfb86[_0x2eff('0x17')]=qs[_0x2eff('0x17')](_0x1d3045[_0x2eff('0x27')][_0x2eff('0x17')]);}return _0x140a0c[_0x2eff('0x44')](_0x1bfb86);}})[_0x2eff('0x1d')](function(_0x352e74){if(_0x352e74){return _0x352e74?{'count':_0x14fc0e,'rows':_0x352e74}:null;}})[_0x2eff('0x1d')](respondWithResult(_0x356281,null))[_0x2eff('0x40')](handleError(_0x356281,null));};exports[_0x2eff('0x47')]=function(_0x516bdc,_0xdf9fba,_0x54b79e){if(_0x516bdc[_0x2eff('0x42')]['id']){delete _0x516bdc[_0x2eff('0x42')]['id'];}return db[_0x2eff('0x38')][_0x2eff('0x45')]({'where':{'id':_0x516bdc['params']['id']}})[_0x2eff('0x1d')](handleEntityNotFound(_0xdf9fba,null))[_0x2eff('0x1d')](function(_0x59a2f3){if(_0x59a2f3){_0x516bdc[_0x2eff('0x42')]['AccountId']=_0x59a2f3['id'];_0x516bdc[_0x2eff('0x42')][_0x2eff('0x48')]=integrations[_0x2eff('0x49')](_0x516bdc[_0x2eff('0x42')][_0x2eff('0x4a')],_0x516bdc[_0x2eff('0x42')][_0x2eff('0x25')]);_0x516bdc[_0x2eff('0x42')][_0x2eff('0x4b')]=integrations[_0x2eff('0x4c')](_0x516bdc[_0x2eff('0x42')][_0x2eff('0x4a')],_0x516bdc[_0x2eff('0x42')][_0x2eff('0x25')]);return db[_0x2eff('0x46')][_0x2eff('0x41')](_0x516bdc[_0x2eff('0x42')],{'include':[{'model':db[_0x2eff('0x4d')],'as':_0x2eff('0x48')},{'model':db[_0x2eff('0x4d')],'as':_0x2eff('0x4b')}]});}return null;})[_0x2eff('0x1d')](respondWithResult(_0xdf9fba,null))[_0x2eff('0x40')](handleError(_0xdf9fba,null));};exports[_0x2eff('0x4e')]=function(_0x5a04c0,_0x452b8f,_0x1e24ad){var _0x47a131='';var _0x24515c=['id',_0x2eff('0x22'),_0x2eff('0x4f'),_0x2eff('0x50'),_0x2eff('0x51'),_0x2eff('0x52'),_0x2eff('0x53'),'duration_minutes','parent_id','parent_type',_0x2eff('0x54'),_0x2eff('0x55')];return db[_0x2eff('0x38')][_0x2eff('0x45')]({'where':{'id':_0x5a04c0[_0x2eff('0x3c')]['id']},'attributes':['id',_0x2eff('0x56'),_0x2eff('0x57'),_0x2eff('0x58')]})[_0x2eff('0x1d')](handleEntityNotFound(_0x452b8f,null))[_0x2eff('0x1d')](function(_0x5d0716){if(_0x5d0716){_0x47a131=_0x5d0716['remoteUri'];var _0x13bffb=_0x47a131[_0x2eff('0x59')](-0x1);if(_0x13bffb==='/'){_0x47a131=_0x47a131[_0x2eff('0x5a')](0x0,_0x47a131[_0x2eff('0x5b')](_0x13bffb));}return rp({'method':_0x2eff('0x5c'),'uri':util[_0x2eff('0x5d')]('%s%s',_0x47a131,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x2eff('0x5e'),'input_type':_0x2eff('0x5f'),'response_type':'JSON','rest_data':JSON[_0x2eff('0x60')]({'user_auth':{'user_name':_0x5d0716[_0x2eff('0x56')],'password':_0x5d0716[_0x2eff('0x57')],'encryption':_0x2eff('0x61')},'application':_0x2eff('0x62')})}});}})[_0x2eff('0x1d')](function(_0x1f611e){if(_0x1f611e&&_0x1f611e[_0x2eff('0x22')]!=='Invalid\x20Login'&&_0x1f611e['name']!==_0x2eff('0x63')){return rp({'method':'POST','uri':util[_0x2eff('0x5d')](_0x2eff('0x64'),_0x47a131,_0x2eff('0x65')),'json':!![],'form':{'method':_0x2eff('0x66'),'input_type':_0x2eff('0x5f'),'response_type':_0x2eff('0x5f'),'rest_data':JSON['stringify']({'session':_0x1f611e['id'],'module_name':_0x2eff('0x67')})}})['then'](function(_0x15c595){if(_0x15c595){var _0x56a9c9=_[_0x2eff('0x68')](_0x15c595[_0x2eff('0x69')]);_[_0x2eff('0x6a')](_0x56a9c9,function(_0x5517a7){return _0x24515c[_0x2eff('0x6b')](_0x5517a7[_0x2eff('0x22')]);});return{'count':_0x56a9c9[_0x2eff('0x2d')],'rows':_['map'](_0x56a9c9,function(_0x5c85f5){return{'id':_0x5c85f5['name'],'name':_0x5c85f5[_0x2eff('0x6c')],'custom':_['endsWith'](_0x5c85f5['name'],'_c')?!![]:![],'options':_0x5c85f5[_0x2eff('0x37')]?_[_0x2eff('0x24')](_['values'](_0x5c85f5[_0x2eff('0x37')]),function(_0x2a8389){return{'name':_0x2a8389[_0x2eff('0x6d')],'value':_0x2a8389[_0x2eff('0x22')]};}):[]};})};}})['then'](respondWithResult(_0x452b8f,null))[_0x2eff('0x40')](function(_0x3c7898){var _0x16740f=_0x5a04c0['query'][_0x2eff('0x6e')]?0x1f4:_0x3c7898['statusCode']||0x1f4;logger[_0x2eff('0x20')](_0x2eff('0x6f'),'getFields',_0x16740f,JSON['stringify'](_0x3c7898));delete _0x3c7898[_0x2eff('0x22')];if(_0x16740f===0x191){_0x16740f=0x190;}_0x452b8f[_0x2eff('0x12')](_0x16740f)[_0x2eff('0x23')](_0x5a04c0['query']['test']?{'message':_0x2eff('0x70'),'statusCode':_0x3c7898[_0x2eff('0x71')]}:_0x3c7898);});}else{var _0x343bde=0x1f4;_0x452b8f[_0x2eff('0x12')](_0x343bde)['send']({'message':_0x2eff('0x70'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x2383=['json','undefined','count','offset','limit','Content-Range','apply','save','update','destroy','end','error','stack','name','map','SugarcrmAccount','fieldName','type','model','keys','filters','intersection','attributes','fields','query','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','length','order','hasOwnProperty','AccountId','Subjects','getSubjects','channel','getDescriptions','SugarcrmField','Descriptions','getFields','assigned_user_id','description','date_start','duration_hours','duration_minutes','parent_id','parent_name','direction','password','remoteUri','slice','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','username','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','module_fields','remove','includes','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status'];(function(_0x18d3d,_0x2dfe05){var _0x19f165=function(_0x3b4fca){while(--_0x3b4fca){_0x18d3d['push'](_0x18d3d['shift']());}};_0x19f165(++_0x2dfe05);}(_0x2383,0x152));var _0x3238=function(_0x46c420,_0x4aa4ed){_0x46c420=_0x46c420-0x0;var _0x3a13cc=_0x2383[_0x46c420];return _0x3a13cc;};'use strict';var emlformat=require(_0x3238('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3238('0x1'));var jsonpatch=require(_0x3238('0x2'));var rp=require(_0x3238('0x3'));var moment=require('moment');var BPromise=require(_0x3238('0x4'));var Mustache=require('mustache');var util=require(_0x3238('0x5'));var path=require(_0x3238('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3238('0x7'));var fs=require('fs');var fs_extra=require(_0x3238('0x8'));var _=require(_0x3238('0x9'));var squel=require(_0x3238('0xa'));var crypto=require(_0x3238('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3238('0xc'));var toCsv=require(_0x3238('0xd'));var querystring=require(_0x3238('0xe'));var Papa=require(_0x3238('0xf'));var Redis=require(_0x3238('0x10'));var authService=require(_0x3238('0x11'));var qs=require(_0x3238('0x12'));var as=require(_0x3238('0x13'));var hardwareService=require(_0x3238('0x14'));var logger=require(_0x3238('0x15'))('api');var utils=require(_0x3238('0x16'));var config=require(_0x3238('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3238('0x18'))['db'];var integrations=require(_0x3238('0x19'));function respondWithStatusCode(_0x1b1718,_0x2605aa){_0x2605aa=_0x2605aa||0xcc;return function(_0x55b5cc){if(_0x55b5cc){return _0x1b1718[_0x3238('0x1a')](_0x2605aa);}return _0x1b1718[_0x3238('0x1b')](_0x2605aa)['end']();};}function respondWithResult(_0x1b1394,_0x13e32b){_0x13e32b=_0x13e32b||0xc8;return function(_0x135259){if(_0x135259){return _0x1b1394['status'](_0x13e32b)[_0x3238('0x1c')](_0x135259);}};}function respondWithFilteredResult(_0x4c67a5,_0xe0ce68){return function(_0xd08ec0){if(_0xd08ec0){var _0x1e51b0=typeof _0xe0ce68['offset']===_0x3238('0x1d')&&typeof _0xe0ce68['limit']===_0x3238('0x1d');var _0xb84bf4=_0xd08ec0['count'];var _0x1b4426=_0x1e51b0?0x0:_0xe0ce68['offset'];var _0x33c820=_0x1e51b0?_0xd08ec0[_0x3238('0x1e')]:_0xe0ce68[_0x3238('0x1f')]+_0xe0ce68[_0x3238('0x20')];var _0x616be8;if(_0x33c820>=_0xb84bf4){_0x33c820=_0xb84bf4;_0x616be8=0xc8;}else{_0x616be8=0xce;}_0x4c67a5[_0x3238('0x1b')](_0x616be8);return _0x4c67a5['set'](_0x3238('0x21'),_0x1b4426+'-'+_0x33c820+'/'+_0xb84bf4)[_0x3238('0x1c')](_0xd08ec0);}return null;};}function patchUpdates(_0x4e7b81){return function(_0xbe2b1f){try{jsonpatch[_0x3238('0x22')](_0xbe2b1f,_0x4e7b81,!![]);}catch(_0x559898){return BPromise['reject'](_0x559898);}return _0xbe2b1f[_0x3238('0x23')]();};}function saveUpdates(_0x2143d0,_0xeb4c8b){return function(_0x296b23){if(_0x296b23){return _0x296b23[_0x3238('0x24')](_0x2143d0)['then'](function(_0x339a03){return _0x339a03;});}return null;};}function removeEntity(_0x240c76,_0x371728){return function(_0x885af8){if(_0x885af8){return _0x885af8[_0x3238('0x25')]()['then'](function(){_0x240c76[_0x3238('0x1b')](0xcc)[_0x3238('0x26')]();});}};}function handleEntityNotFound(_0x2bf920,_0x2ee343){return function(_0x387c0f){if(!_0x387c0f){_0x2bf920[_0x3238('0x1a')](0x194);}return _0x387c0f;};}function handleError(_0x461825,_0x4b1dec){_0x4b1dec=_0x4b1dec||0x1f4;return function(_0x1aa2d6){logger[_0x3238('0x27')](_0x1aa2d6[_0x3238('0x28')]);if(_0x1aa2d6[_0x3238('0x29')]){delete _0x1aa2d6[_0x3238('0x29')];}_0x461825[_0x3238('0x1b')](_0x4b1dec)['send'](_0x1aa2d6);};}exports['index']=function(_0x3f121c,_0x4eee07){var _0xf76199={},_0xd4986a={},_0x5c9363={'count':0x0,'rows':[]};var _0x43758f=_[_0x3238('0x2a')](db[_0x3238('0x2b')]['rawAttributes'],function(_0x1e31b8){return{'name':_0x1e31b8[_0x3238('0x2c')],'type':_0x1e31b8[_0x3238('0x2d')]['key']};});_0xd4986a[_0x3238('0x2e')]=_[_0x3238('0x2a')](_0x43758f,_0x3238('0x29'));_0xd4986a['query']=_[_0x3238('0x2f')](_0x3f121c['query']);_0xd4986a[_0x3238('0x30')]=_[_0x3238('0x31')](_0xd4986a['model'],_0xd4986a['query']);_0xf76199[_0x3238('0x32')]=_[_0x3238('0x31')](_0xd4986a[_0x3238('0x2e')],qs[_0x3238('0x33')](_0x3f121c[_0x3238('0x34')][_0x3238('0x33')]));_0xf76199[_0x3238('0x32')]=_0xf76199[_0x3238('0x32')]['length']?_0xf76199[_0x3238('0x32')]:_0xd4986a[_0x3238('0x2e')];if(!_0x3f121c[_0x3238('0x34')]['hasOwnProperty'](_0x3238('0x35'))){_0xf76199[_0x3238('0x20')]=qs[_0x3238('0x20')](_0x3f121c[_0x3238('0x34')][_0x3238('0x20')]);_0xf76199[_0x3238('0x1f')]=qs[_0x3238('0x1f')](_0x3f121c[_0x3238('0x34')][_0x3238('0x1f')]);}_0xf76199['order']=qs[_0x3238('0x36')](_0x3f121c['query']['sort']);_0xf76199['where']=qs[_0x3238('0x30')](_[_0x3238('0x37')](_0x3f121c['query'],_0xd4986a[_0x3238('0x30')]),_0x43758f);if(_0x3f121c[_0x3238('0x34')][_0x3238('0x38')]){_0xf76199[_0x3238('0x39')]=_[_0x3238('0x3a')](_0xf76199[_0x3238('0x39')],{'$or':_[_0x3238('0x2a')](_0x43758f,function(_0x349035){if(_0x349035[_0x3238('0x2d')]!==_0x3238('0x3b')){var _0x5acb85={};_0x5acb85[_0x349035['name']]={'$like':'%'+_0x3f121c[_0x3238('0x34')][_0x3238('0x38')]+'%'};return _0x5acb85;}})});}_0xf76199=_[_0x3238('0x3a')]({},_0xf76199,_0x3f121c[_0x3238('0x3c')]);var _0x268992={'where':_0xf76199[_0x3238('0x39')]};return db[_0x3238('0x2b')][_0x3238('0x1e')](_0x268992)[_0x3238('0x3d')](function(_0x576a4b){_0x5c9363[_0x3238('0x1e')]=_0x576a4b;if(_0x3f121c[_0x3238('0x34')][_0x3238('0x3e')]){_0xf76199[_0x3238('0x3f')]=[{'all':!![]}];}return db[_0x3238('0x2b')][_0x3238('0x40')](_0xf76199);})['then'](function(_0x3dcfea){_0x5c9363[_0x3238('0x41')]=_0x3dcfea;return _0x5c9363;})[_0x3238('0x3d')](respondWithFilteredResult(_0x4eee07,_0xf76199))[_0x3238('0x42')](handleError(_0x4eee07,null));};exports[_0x3238('0x43')]=function(_0x2cdd10,_0x5a7082){var _0x9f0e1f={'raw':![],'where':{'id':_0x2cdd10[_0x3238('0x44')]['id']}},_0x21968c={};_0x21968c[_0x3238('0x2e')]=_['keys'](db['SugarcrmAccount'][_0x3238('0x45')]);_0x21968c[_0x3238('0x34')]=_[_0x3238('0x2f')](_0x2cdd10[_0x3238('0x34')]);_0x21968c[_0x3238('0x30')]=_[_0x3238('0x31')](_0x21968c[_0x3238('0x2e')],_0x21968c[_0x3238('0x34')]);_0x9f0e1f[_0x3238('0x32')]=_[_0x3238('0x31')](_0x21968c[_0x3238('0x2e')],qs[_0x3238('0x33')](_0x2cdd10['query'][_0x3238('0x33')]));_0x9f0e1f[_0x3238('0x32')]=_0x9f0e1f['attributes']['length']?_0x9f0e1f[_0x3238('0x32')]:_0x21968c[_0x3238('0x2e')];if(_0x2cdd10[_0x3238('0x34')][_0x3238('0x3e')]){_0x9f0e1f[_0x3238('0x3f')]=[{'all':!![]}];}_0x9f0e1f=_['merge']({},_0x9f0e1f,_0x2cdd10[_0x3238('0x3c')]);return db['SugarcrmAccount'][_0x3238('0x46')](_0x9f0e1f)[_0x3238('0x3d')](handleEntityNotFound(_0x5a7082,null))[_0x3238('0x3d')](respondWithResult(_0x5a7082,null))[_0x3238('0x42')](handleError(_0x5a7082,null));};exports[_0x3238('0x47')]=function(_0x53f74a,_0x551179){return db[_0x3238('0x2b')][_0x3238('0x47')](_0x53f74a[_0x3238('0x48')],{})['then'](respondWithResult(_0x551179,0xc9))[_0x3238('0x42')](handleError(_0x551179,null));};exports[_0x3238('0x24')]=function(_0x4ccbd5,_0x19c230){if(_0x4ccbd5['body']['id']){delete _0x4ccbd5['body']['id'];}return db[_0x3238('0x2b')]['find']({'where':{'id':_0x4ccbd5[_0x3238('0x44')]['id']}})['then'](handleEntityNotFound(_0x19c230,null))[_0x3238('0x3d')](saveUpdates(_0x4ccbd5[_0x3238('0x48')],null))['then'](respondWithResult(_0x19c230,null))[_0x3238('0x42')](handleError(_0x19c230,null));};exports[_0x3238('0x25')]=function(_0x176f2c,_0x329081){return db[_0x3238('0x2b')]['find']({'where':{'id':_0x176f2c['params']['id']}})[_0x3238('0x3d')](handleEntityNotFound(_0x329081,null))['then'](removeEntity(_0x329081,null))['catch'](handleError(_0x329081,null));};exports[_0x3238('0x49')]=function(_0xc4e84f,_0x129648,_0x159211){var _0x221b89={};var _0x2373a7={};var _0x11e735;var _0x461ef5;return db[_0x3238('0x2b')][_0x3238('0x4a')]({'where':{'id':_0xc4e84f[_0x3238('0x44')]['id']}})[_0x3238('0x3d')](handleEntityNotFound(_0x129648,null))[_0x3238('0x3d')](function(_0x144fdc){if(_0x144fdc){_0x11e735=_0x144fdc;_0x2373a7[_0x3238('0x2e')]=_[_0x3238('0x2f')](db[_0x3238('0x4b')][_0x3238('0x45')]);_0x2373a7[_0x3238('0x34')]=_[_0x3238('0x2f')](_0xc4e84f[_0x3238('0x34')]);_0x2373a7[_0x3238('0x30')]=_[_0x3238('0x31')](_0x2373a7['model'],_0x2373a7[_0x3238('0x34')]);_0x221b89[_0x3238('0x32')]=_['intersection'](_0x2373a7['model'],qs[_0x3238('0x33')](_0xc4e84f[_0x3238('0x34')]['fields']));_0x221b89[_0x3238('0x32')]=_0x221b89[_0x3238('0x32')][_0x3238('0x4c')]?_0x221b89[_0x3238('0x32')]:_0x2373a7[_0x3238('0x2e')];_0x221b89[_0x3238('0x4d')]=qs[_0x3238('0x36')](_0xc4e84f[_0x3238('0x34')][_0x3238('0x36')]);_0x221b89['where']=qs[_0x3238('0x30')](_['pick'](_0xc4e84f[_0x3238('0x34')],_0x2373a7[_0x3238('0x30')]));if(_0xc4e84f[_0x3238('0x34')][_0x3238('0x38')]){_0x221b89[_0x3238('0x39')]=_['merge'](_0x221b89[_0x3238('0x39')],{'$or':_[_0x3238('0x2a')](_0x221b89[_0x3238('0x32')],function(_0x1b6b39){var _0x147d3e={};_0x147d3e[_0x1b6b39]={'$like':'%'+_0xc4e84f[_0x3238('0x34')][_0x3238('0x38')]+'%'};return _0x147d3e;})});}_0x221b89=_['merge']({},_0x221b89,_0xc4e84f[_0x3238('0x3c')]);return _0x11e735[_0x3238('0x49')](_0x221b89);}})['then'](function(_0x1a7158){if(_0x1a7158){_0x461ef5=_0x1a7158[_0x3238('0x4c')];if(!_0xc4e84f['query'][_0x3238('0x4e')](_0x3238('0x35'))){_0x221b89[_0x3238('0x20')]=qs[_0x3238('0x20')](_0xc4e84f[_0x3238('0x34')][_0x3238('0x20')]);_0x221b89['offset']=qs['offset'](_0xc4e84f[_0x3238('0x34')][_0x3238('0x1f')]);}return _0x11e735[_0x3238('0x49')](_0x221b89);}})[_0x3238('0x3d')](function(_0x194840){if(_0x194840){return _0x194840?{'count':_0x461ef5,'rows':_0x194840}:null;}})['then'](respondWithResult(_0x129648,null))[_0x3238('0x42')](handleError(_0x129648,null));};exports['addConfiguration']=function(_0x4a9b41,_0x4d26ef,_0x3ecde6){if(_0x4a9b41[_0x3238('0x48')]['id']){delete _0x4a9b41[_0x3238('0x48')]['id'];}return db[_0x3238('0x2b')][_0x3238('0x4a')]({'where':{'id':_0x4a9b41['params']['id']}})[_0x3238('0x3d')](handleEntityNotFound(_0x4d26ef,null))[_0x3238('0x3d')](function(_0x35c228){if(_0x35c228){_0x4a9b41[_0x3238('0x48')][_0x3238('0x4f')]=_0x35c228['id'];_0x4a9b41[_0x3238('0x48')][_0x3238('0x50')]=integrations[_0x3238('0x51')](_0x4a9b41[_0x3238('0x48')][_0x3238('0x52')],_0x4a9b41[_0x3238('0x48')][_0x3238('0x2d')]);_0x4a9b41[_0x3238('0x48')]['Descriptions']=integrations[_0x3238('0x53')](_0x4a9b41[_0x3238('0x48')][_0x3238('0x52')],_0x4a9b41['body'][_0x3238('0x2d')]);return db[_0x3238('0x4b')][_0x3238('0x47')](_0x4a9b41[_0x3238('0x48')],{'include':[{'model':db[_0x3238('0x54')],'as':_0x3238('0x50')},{'model':db[_0x3238('0x54')],'as':_0x3238('0x55')}]});}return null;})['then'](respondWithResult(_0x4d26ef,null))[_0x3238('0x42')](handleError(_0x4d26ef,null));};exports[_0x3238('0x56')]=function(_0x366e54,_0x5730fc,_0x4a0eea){var _0x122494='';var _0x13f28f=['id',_0x3238('0x29'),_0x3238('0x57'),'created_by',_0x3238('0x58'),_0x3238('0x59'),_0x3238('0x5a'),_0x3238('0x5b'),_0x3238('0x5c'),'parent_type',_0x3238('0x5d'),_0x3238('0x5e')];return db[_0x3238('0x2b')][_0x3238('0x4a')]({'where':{'id':_0x366e54[_0x3238('0x44')]['id']},'attributes':['id','username',_0x3238('0x5f'),'remoteUri']})[_0x3238('0x3d')](handleEntityNotFound(_0x5730fc,null))['then'](function(_0x2f89d5){if(_0x2f89d5){_0x122494=_0x2f89d5[_0x3238('0x60')];var _0x23e9e8=_0x122494[_0x3238('0x61')](-0x1);if(_0x23e9e8==='/'){_0x122494=_0x122494['substring'](0x0,_0x122494[_0x3238('0x62')](_0x23e9e8));}return rp({'method':_0x3238('0x63'),'uri':util[_0x3238('0x64')](_0x3238('0x65'),_0x122494,_0x3238('0x66')),'json':!![],'form':{'method':_0x3238('0x67'),'input_type':'JSON','response_type':_0x3238('0x68'),'rest_data':JSON[_0x3238('0x69')]({'user_auth':{'user_name':_0x2f89d5[_0x3238('0x6a')],'password':_0x2f89d5[_0x3238('0x5f')],'encryption':'PLAIN'},'application':_0x3238('0x6b')})}});}})[_0x3238('0x3d')](function(_0x529969){if(_0x529969&&_0x529969[_0x3238('0x29')]!==_0x3238('0x6c')&&_0x529969[_0x3238('0x29')]!==_0x3238('0x6d')){return rp({'method':'POST','uri':util[_0x3238('0x64')](_0x3238('0x65'),_0x122494,_0x3238('0x66')),'json':!![],'form':{'method':_0x3238('0x6e'),'input_type':_0x3238('0x68'),'response_type':'JSON','rest_data':JSON[_0x3238('0x69')]({'session':_0x529969['id'],'module_name':_0x3238('0x6f')})}})[_0x3238('0x3d')](function(_0x2975bb){if(_0x2975bb){var _0x36f82b=_[_0x3238('0x70')](_0x2975bb[_0x3238('0x71')]);_[_0x3238('0x72')](_0x36f82b,function(_0x21dd2c){return _0x13f28f[_0x3238('0x73')](_0x21dd2c['name']);});return{'count':_0x36f82b['length'],'rows':_['map'](_0x36f82b,function(_0x310a51){return{'id':_0x310a51['name'],'name':_0x310a51['label'],'custom':_['endsWith'](_0x310a51[_0x3238('0x29')],'_c')?!![]:![],'options':_0x310a51['options']?_[_0x3238('0x2a')](_[_0x3238('0x70')](_0x310a51['options']),function(_0x345e0c){return{'name':_0x345e0c[_0x3238('0x74')],'value':_0x345e0c[_0x3238('0x29')]};}):[]};})};}})[_0x3238('0x3d')](respondWithResult(_0x5730fc,null))[_0x3238('0x42')](function(_0x10fd08){var _0x5b6331=_0x366e54['query'][_0x3238('0x75')]?0x1f4:_0x10fd08[_0x3238('0x76')]||0x1f4;logger['error'](_0x3238('0x77'),_0x3238('0x56'),_0x5b6331,JSON[_0x3238('0x69')](_0x10fd08));delete _0x10fd08['name'];if(_0x5b6331===0x191){_0x5b6331=0x190;}_0x5730fc[_0x3238('0x1b')](_0x5b6331)[_0x3238('0x78')](_0x366e54[_0x3238('0x34')][_0x3238('0x75')]?{'message':_0x3238('0x79'),'statusCode':_0x10fd08[_0x3238('0x76')]}:_0x10fd08);});}else{var _0x4a31c4=0x1f4;_0x5730fc[_0x3238('0x1b')](_0x4a31c4)['send']({'message':_0x3238('0x79'),'statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index b27e563..eff7fb4 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 _0x4110=['./intSugarcrmAccount.attributes','../../components/integrations/configuration','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x49537e,_0x2779d7){var _0x46655c=function(_0x3b2ab3){while(--_0x3b2ab3){_0x49537e['push'](_0x49537e['shift']());}};_0x46655c(++_0x2779d7);}(_0x4110,0xac));var _0x0411=function(_0xc97a87,_0xe27213){_0xc97a87=_0xc97a87-0x0;var _0x4e0652=_0x4110[_0xc97a87];return _0x4e0652;};'use strict';var _=require(_0x0411('0x0'));var util=require(_0x0411('0x1'));var logger=require(_0x0411('0x2'))(_0x0411('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0411('0x4'));var fs=require('fs');var path=require(_0x0411('0x5'));var rimraf=require(_0x0411('0x6'));var config=require(_0x0411('0x7'));var attributes=require(_0x0411('0x8'));var integrations=require(_0x0411('0x9'));module['exports']=function(_0x2714f0,_0x50ac52){return _0x2714f0['define'](_0x0411('0xa'),attributes,{'tableName':_0x0411('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf7e=['../../config/environment','./intSugarcrmAccount.attributes','exports','define','../../config/logger','api','moment','request-promise','path'];(function(_0xcc5fea,_0x484ccc){var _0x9969af=function(_0x2c8ba6){while(--_0x2c8ba6){_0xcc5fea['push'](_0xcc5fea['shift']());}};_0x9969af(++_0x484ccc);}(_0xcf7e,0xaf));var _0xecf7=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xcf7e[_0x2b7764];return _0x848dcb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xecf7('0x0'))(_0xecf7('0x1'));var moment=require(_0xecf7('0x2'));var BPromise=require('bluebird');var rp=require(_0xecf7('0x3'));var fs=require('fs');var path=require(_0xecf7('0x4'));var rimraf=require('rimraf');var config=require(_0xecf7('0x5'));var attributes=require(_0xecf7('0x6'));var integrations=require('../../components/integrations/configuration');module[_0xecf7('0x7')]=function(_0x47882d,_0x16e243){return _0x47882d[_0xecf7('0x8')]('SugarcrmAccount',attributes,{'tableName':'int_sugarcrm_accounts','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 9d743b2..befffae 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 _0x4714=['ShowSugarcrmAccount','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','attributes','limit','include','map','model','info'];(function(_0x2b441d,_0x3cb821){var _0x19ba4a=function(_0x198dc1){while(--_0x198dc1){_0x2b441d['push'](_0x2b441d['shift']());}};_0x19ba4a(++_0x3cb821);}(_0x4714,0x8e));var _0x4471=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4714[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x4471('0x0'));var util=require(_0x4471('0x1'));var moment=require('moment');var BPromise=require(_0x4471('0x2'));var rs=require(_0x4471('0x3'));var fs=require('fs');var Redis=require(_0x4471('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4471('0x5'));var logger=require(_0x4471('0x6'))(_0x4471('0x7'));var config=require(_0x4471('0x8'));var jayson=require(_0x4471('0x9'));var client=jayson[_0x4471('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33c986,_0xe23d1,_0x55113e){return new BPromise(function(_0x24bf92,_0x2f5e47){return client[_0x4471('0xb')](_0x33c986,_0x55113e)[_0x4471('0xc')](function(_0x3711b5){logger['info'](_0x4471('0xd'),_0xe23d1,_0x4471('0xe'));logger[_0x4471('0xf')](_0x4471('0x10'),_0xe23d1,_0x4471('0xe'),JSON[_0x4471('0x11')](_0x3711b5));if(_0x3711b5[_0x4471('0x12')]){if(_0x3711b5[_0x4471('0x12')][_0x4471('0x13')]===0x1f4){logger['error'](_0x4471('0xd'),_0xe23d1,_0x3711b5['error'][_0x4471('0x14')]);return _0x2f5e47(_0x3711b5[_0x4471('0x12')][_0x4471('0x14')]);}logger['error'](_0x4471('0xd'),_0xe23d1,_0x3711b5[_0x4471('0x12')][_0x4471('0x14')]);return _0x24bf92(_0x3711b5[_0x4471('0x12')]['message']);}else{logger['info'](_0x4471('0xd'),_0xe23d1,_0x4471('0xe'));_0x24bf92(_0x3711b5[_0x4471('0x15')][_0x4471('0x14')]);}})['catch'](function(_0x3f1a6e){logger['error'](_0x4471('0xd'),_0xe23d1,_0x3f1a6e);_0x2f5e47(_0x3f1a6e);});});}exports[_0x4471('0x16')]=function(_0x43f61a){var _0x1ab6c3=this;return new Promise(function(_0x5b6fe1,_0x23f186){return db[_0x4471('0x17')][_0x4471('0x18')]({'raw':_0x43f61a[_0x4471('0x19')]?_0x43f61a[_0x4471('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x43f61a['options']?_0x43f61a[_0x4471('0x19')][_0x4471('0x1a')]||null:null,'attributes':_0x43f61a[_0x4471('0x19')]?_0x43f61a[_0x4471('0x19')][_0x4471('0x1b')]||null:null,'limit':_0x43f61a[_0x4471('0x19')]?_0x43f61a[_0x4471('0x19')][_0x4471('0x1c')]||null:null,'include':_0x43f61a[_0x4471('0x19')]?_0x43f61a[_0x4471('0x19')][_0x4471('0x1d')]?_[_0x4471('0x1e')](_0x43f61a[_0x4471('0x19')][_0x4471('0x1d')],function(_0x1c5553){return{'model':db[_0x1c5553['model']],'as':_0x1c5553['as'],'attributes':_0x1c5553[_0x4471('0x1b')],'include':_0x1c5553[_0x4471('0x1d')]?_[_0x4471('0x1e')](_0x1c5553[_0x4471('0x1d')],function(_0x54fb6c){return{'model':db[_0x54fb6c['model']],'as':_0x54fb6c['as'],'attributes':_0x54fb6c['attributes'],'include':_0x54fb6c['include']?_['map'](_0x54fb6c[_0x4471('0x1d')],function(_0x11e0e6){return{'model':db[_0x11e0e6[_0x4471('0x1f')]],'as':_0x11e0e6['as'],'attributes':_0x11e0e6[_0x4471('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4471('0xc')](function(_0x26bcdb){logger[_0x4471('0x20')]('GetSugarcrmAccount',_0x43f61a);logger[_0x4471('0xf')]('GetSugarcrmAccount',_0x43f61a,JSON[_0x4471('0x11')](_0x26bcdb));_0x5b6fe1(_0x26bcdb);})['catch'](function(_0x25ee3d){logger[_0x4471('0x12')](_0x4471('0x16'),_0x25ee3d[_0x4471('0x14')],_0x43f61a);_0x23f186(_0x1ab6c3['error'](0x1f4,_0x25ee3d[_0x4471('0x14')]));});});};exports[_0x4471('0x21')]=function(_0x33ce04){var _0x110177=this;return new Promise(function(_0x523515,_0x43aeed){return db[_0x4471('0x17')]['find']({'raw':_0x33ce04['options']?_0x33ce04[_0x4471('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x33ce04[_0x4471('0x19')]?_0x33ce04[_0x4471('0x19')][_0x4471('0x1a')]||null:null,'attributes':_0x33ce04[_0x4471('0x19')]?_0x33ce04[_0x4471('0x19')][_0x4471('0x1b')]||null:null,'include':_0x33ce04[_0x4471('0x19')]?_0x33ce04[_0x4471('0x19')][_0x4471('0x1d')]?_[_0x4471('0x1e')](_0x33ce04[_0x4471('0x19')][_0x4471('0x1d')],function(_0x27959f){return{'model':db[_0x27959f[_0x4471('0x1f')]],'as':_0x27959f['as'],'attributes':_0x27959f['attributes'],'include':_0x27959f[_0x4471('0x1d')]?_[_0x4471('0x1e')](_0x27959f[_0x4471('0x1d')],function(_0xc3bcfe){return{'model':db[_0xc3bcfe[_0x4471('0x1f')]],'as':_0xc3bcfe['as'],'attributes':_0xc3bcfe[_0x4471('0x1b')],'include':_0xc3bcfe['include']?_['map'](_0xc3bcfe[_0x4471('0x1d')],function(_0x34f747){return{'model':db[_0x34f747[_0x4471('0x1f')]],'as':_0x34f747['as'],'attributes':_0x34f747['attributes']};}):[]};}):[]};}):[]:[]})[_0x4471('0xc')](function(_0x564123){logger[_0x4471('0x20')](_0x4471('0x21'),_0x33ce04);logger[_0x4471('0xf')](_0x4471('0x21'),_0x33ce04,JSON[_0x4471('0x11')](_0x564123));_0x523515(_0x564123);})[_0x4471('0x22')](function(_0x19cad6){logger['error'](_0x4471('0x21'),_0x19cad6[_0x4471('0x14')],_0x33ce04);_0x43aeed(_0x110177[_0x4471('0x12')](0x1f4,_0x19cad6[_0x4471('0x14')]));});});}; \ No newline at end of file +var _0x1b58=['SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','GetSugarcrmAccount','options','raw','where','attributes','limit','map','model','include','then','ShowSugarcrmAccount','SugarcrmAccount','find','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','info'];(function(_0x1fa00e,_0x21c0f3){var _0x32cdd7=function(_0x3c1f12){while(--_0x3c1f12){_0x1fa00e['push'](_0x1fa00e['shift']());}};_0x32cdd7(++_0x21c0f3);}(_0x1b58,0x9e));var _0x81b5=function(_0x4342b1,_0x4a1851){_0x4342b1=_0x4342b1-0x0;var _0x1c7e2e=_0x1b58[_0x4342b1];return _0x1c7e2e;};'use strict';var _=require(_0x81b5('0x0'));var util=require(_0x81b5('0x1'));var moment=require(_0x81b5('0x2'));var BPromise=require(_0x81b5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x81b5('0x4'));var db=require(_0x81b5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x81b5('0x6'))(_0x81b5('0x7'));var config=require('../../config/environment');var jayson=require(_0x81b5('0x8'));var client=jayson[_0x81b5('0x9')][_0x81b5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ad00c,_0x3ae330,_0x4904d5){return new BPromise(function(_0x1eadf5,_0x4b55f2){return client['request'](_0x4ad00c,_0x4904d5)['then'](function(_0x92fae5){logger[_0x81b5('0xb')](_0x81b5('0xc'),_0x3ae330,'request\x20sent');logger[_0x81b5('0xd')](_0x81b5('0xe'),_0x3ae330,'request\x20sent',JSON['stringify'](_0x92fae5));if(_0x92fae5['error']){if(_0x92fae5[_0x81b5('0xf')]['code']===0x1f4){logger[_0x81b5('0xf')](_0x81b5('0xc'),_0x3ae330,_0x92fae5[_0x81b5('0xf')][_0x81b5('0x10')]);return _0x4b55f2(_0x92fae5[_0x81b5('0xf')][_0x81b5('0x10')]);}logger[_0x81b5('0xf')](_0x81b5('0xc'),_0x3ae330,_0x92fae5[_0x81b5('0xf')]['message']);return _0x1eadf5(_0x92fae5[_0x81b5('0xf')][_0x81b5('0x10')]);}else{logger[_0x81b5('0xb')](_0x81b5('0xc'),_0x3ae330,_0x81b5('0x11'));_0x1eadf5(_0x92fae5[_0x81b5('0x12')][_0x81b5('0x10')]);}})[_0x81b5('0x13')](function(_0x354450){logger['error'](_0x81b5('0xc'),_0x3ae330,_0x354450);_0x4b55f2(_0x354450);});});}exports[_0x81b5('0x14')]=function(_0x1af518){var _0x57a245=this;return new Promise(function(_0x5165c9,_0x55ffa2){return db['SugarcrmAccount']['findAll']({'raw':_0x1af518['options']?_0x1af518[_0x81b5('0x15')][_0x81b5('0x16')]===undefined?!![]:![]:!![],'where':_0x1af518[_0x81b5('0x15')]?_0x1af518[_0x81b5('0x15')][_0x81b5('0x17')]||null:null,'attributes':_0x1af518[_0x81b5('0x15')]?_0x1af518['options'][_0x81b5('0x18')]||null:null,'limit':_0x1af518[_0x81b5('0x15')]?_0x1af518['options'][_0x81b5('0x19')]||null:null,'include':_0x1af518[_0x81b5('0x15')]?_0x1af518[_0x81b5('0x15')]['include']?_[_0x81b5('0x1a')](_0x1af518[_0x81b5('0x15')]['include'],function(_0x321e01){return{'model':db[_0x321e01[_0x81b5('0x1b')]],'as':_0x321e01['as'],'attributes':_0x321e01[_0x81b5('0x18')],'include':_0x321e01[_0x81b5('0x1c')]?_[_0x81b5('0x1a')](_0x321e01[_0x81b5('0x1c')],function(_0x3e2b71){return{'model':db[_0x3e2b71[_0x81b5('0x1b')]],'as':_0x3e2b71['as'],'attributes':_0x3e2b71[_0x81b5('0x18')],'include':_0x3e2b71[_0x81b5('0x1c')]?_[_0x81b5('0x1a')](_0x3e2b71[_0x81b5('0x1c')],function(_0x486971){return{'model':db[_0x486971[_0x81b5('0x1b')]],'as':_0x486971['as'],'attributes':_0x486971['attributes']};}):[]};}):[]};}):[]:[]})[_0x81b5('0x1d')](function(_0xaad018){logger[_0x81b5('0xb')](_0x81b5('0x14'),_0x1af518);logger[_0x81b5('0xd')]('GetSugarcrmAccount',_0x1af518,JSON['stringify'](_0xaad018));_0x5165c9(_0xaad018);})[_0x81b5('0x13')](function(_0x1d23f2){logger[_0x81b5('0xf')](_0x81b5('0x14'),_0x1d23f2[_0x81b5('0x10')],_0x1af518);_0x55ffa2(_0x57a245['error'](0x1f4,_0x1d23f2[_0x81b5('0x10')]));});});};exports[_0x81b5('0x1e')]=function(_0x1d50ff){var _0x4d5723=this;return new Promise(function(_0xb6a03a,_0x37c737){return db[_0x81b5('0x1f')][_0x81b5('0x20')]({'raw':_0x1d50ff[_0x81b5('0x15')]?_0x1d50ff[_0x81b5('0x15')][_0x81b5('0x16')]===undefined?!![]:![]:!![],'where':_0x1d50ff['options']?_0x1d50ff[_0x81b5('0x15')][_0x81b5('0x17')]||null:null,'attributes':_0x1d50ff['options']?_0x1d50ff['options'][_0x81b5('0x18')]||null:null,'include':_0x1d50ff[_0x81b5('0x15')]?_0x1d50ff[_0x81b5('0x15')][_0x81b5('0x1c')]?_['map'](_0x1d50ff[_0x81b5('0x15')]['include'],function(_0x4b6c36){return{'model':db[_0x4b6c36['model']],'as':_0x4b6c36['as'],'attributes':_0x4b6c36[_0x81b5('0x18')],'include':_0x4b6c36[_0x81b5('0x1c')]?_[_0x81b5('0x1a')](_0x4b6c36[_0x81b5('0x1c')],function(_0x42d4f1){return{'model':db[_0x42d4f1[_0x81b5('0x1b')]],'as':_0x42d4f1['as'],'attributes':_0x42d4f1[_0x81b5('0x18')],'include':_0x42d4f1[_0x81b5('0x1c')]?_[_0x81b5('0x1a')](_0x42d4f1['include'],function(_0x22d9c9){return{'model':db[_0x22d9c9[_0x81b5('0x1b')]],'as':_0x22d9c9['as'],'attributes':_0x22d9c9[_0x81b5('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xfe22d3){logger['info'](_0x81b5('0x1e'),_0x1d50ff);logger[_0x81b5('0xd')](_0x81b5('0x1e'),_0x1d50ff,JSON[_0x81b5('0x21')](_0xfe22d3));_0xb6a03a(_0xfe22d3);})[_0x81b5('0x13')](function(_0x4d8b80){logger['error'](_0x81b5('0x1e'),_0x4d8b80[_0x81b5('0x10')],_0x1d50ff);_0x37c737(_0x4d5723['error'](0x1f4,_0x4d8b80[_0x81b5('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 903492e..7b109bf 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 _0x7b22=['put','/:id','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x2e364c,_0x3a9865){var _0x13f7b4=function(_0x82c20a){while(--_0x82c20a){_0x2e364c['push'](_0x2e364c['shift']());}};_0x13f7b4(++_0x3a9865);}(_0x7b22,0x1e6));var _0x27b2=function(_0x3186aa,_0x34c21e){_0x3186aa=_0x3186aa-0x0;var _0x2d8c36=_0x7b22[_0x3186aa];return _0x2d8c36;};'use strict';var multer=require('multer');var util=require(_0x27b2('0x0'));var path=require(_0x27b2('0x1'));var timeout=require(_0x27b2('0x2'));var express=require('express');var router=express[_0x27b2('0x3')]();var fs_extra=require(_0x27b2('0x4'));var auth=require(_0x27b2('0x5'));var interaction=require(_0x27b2('0x6'));var config=require(_0x27b2('0x7'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x27b2('0x8')]('/',auth['isAuthenticated'](),controller[_0x27b2('0x9')]);router['get']('/:id',auth[_0x27b2('0xa')](),controller[_0x27b2('0xb')]);router['get'](_0x27b2('0xc'),auth[_0x27b2('0xa')](),controller[_0x27b2('0xd')]);router[_0x27b2('0x8')](_0x27b2('0xe'),auth[_0x27b2('0xa')](),controller[_0x27b2('0xf')]);router['get'](_0x27b2('0x10'),auth[_0x27b2('0xa')](),controller[_0x27b2('0x11')]);router[_0x27b2('0x12')]('/',auth[_0x27b2('0xa')](),controller[_0x27b2('0x13')]);router[_0x27b2('0x14')](_0x27b2('0x15'),auth[_0x27b2('0xa')](),controller['update']);router['delete'](_0x27b2('0x15'),auth[_0x27b2('0xa')](),controller['destroy']);module[_0x27b2('0x16')]=router; \ No newline at end of file +var _0x394f=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','index','isAuthenticated','show','get','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','create','put','update','/:id','destroy','multer','path'];(function(_0x47761d,_0x3f8494){var _0x3d1c05=function(_0x3571da){while(--_0x3571da){_0x47761d['push'](_0x47761d['shift']());}};_0x3d1c05(++_0x3f8494);}(_0x394f,0xe4));var _0xf394=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x394f[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xf394('0x0'));var util=require('util');var path=require(_0xf394('0x1'));var timeout=require(_0xf394('0x2'));var express=require('express');var router=express[_0xf394('0x3')]();var fs_extra=require(_0xf394('0x4'));var auth=require(_0xf394('0x5'));var interaction=require(_0xf394('0x6'));var config=require(_0xf394('0x7'));var controller=require(_0xf394('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xf394('0x9')]);router['get']('/:id',auth[_0xf394('0xa')](),controller[_0xf394('0xb')]);router[_0xf394('0xc')](_0xf394('0xd'),auth[_0xf394('0xa')](),controller[_0xf394('0xe')]);router[_0xf394('0xc')](_0xf394('0xf'),auth[_0xf394('0xa')](),controller['getSubjects']);router[_0xf394('0xc')](_0xf394('0x10'),auth[_0xf394('0xa')](),controller[_0xf394('0x11')]);router['post']('/',auth[_0xf394('0xa')](),controller[_0xf394('0x12')]);router[_0xf394('0x13')]('/:id',auth[_0xf394('0xa')](),controller[_0xf394('0x14')]);router['delete'](_0xf394('0x15'),auth[_0xf394('0xa')](),controller[_0xf394('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 1ab6848..8c3ebfb 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 _0x9b1f=['sequelize','STRING'];(function(_0x403beb,_0x5bcf8c){var _0x30cb32=function(_0x1fefc7){while(--_0x1fefc7){_0x403beb['push'](_0x403beb['shift']());}};_0x30cb32(++_0x5bcf8c);}(_0x9b1f,0x90));var _0xf9b1=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x9b1f[_0x307d86];return _0x361745;};'use strict';var Sequelize=require(_0xf9b1('0x0'));module['exports']={'name':{'type':Sequelize[_0xf9b1('0x1')]},'description':{'type':Sequelize[_0xf9b1('0x1')]}}; \ No newline at end of file +var _0xed9a=['sequelize','exports','STRING'];(function(_0x523a6b,_0x2fcdeb){var _0x587dbb=function(_0x3e661f){while(--_0x3e661f){_0x523a6b['push'](_0x523a6b['shift']());}};_0x587dbb(++_0x2fcdeb);}(_0xed9a,0xc0));var _0xaed9=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xed9a[_0x40220a];return _0x3903cc;};'use strict';var Sequelize=require(_0xaed9('0x0'));module[_0xaed9('0x1')]={'name':{'type':Sequelize[_0xaed9('0x2')]},'description':{'type':Sequelize[_0xaed9('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 4e1ccfb..9ea9ee9 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 _0x6702=['nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','getFields','SugarcrmField','pick','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','apply','save','update','then','destroy','name','send','index','map','SugarcrmConfiguration','fieldName','type','key','query','keys','model','attributes','intersection','fields','length'];(function(_0xee1cc0,_0x119502){var _0x58564f=function(_0x5a06d8){while(--_0x5a06d8){_0xee1cc0['push'](_0xee1cc0['shift']());}};_0x58564f(++_0x119502);}(_0x6702,0x106));var _0x2670=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x6702[_0x4ae6ef];return _0x3cbb4e;};'use strict';var emlformat=require(_0x2670('0x0'));var rimraf=require(_0x2670('0x1'));var zipdir=require(_0x2670('0x2'));var jsonpatch=require(_0x2670('0x3'));var rp=require('request-promise');var moment=require(_0x2670('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2670('0x5'));var util=require('util');var path=require(_0x2670('0x6'));var sox=require(_0x2670('0x7'));var csv=require(_0x2670('0x8'));var ejs=require(_0x2670('0x9'));var fs=require('fs');var fs_extra=require(_0x2670('0xa'));var _=require(_0x2670('0xb'));var squel=require(_0x2670('0xc'));var crypto=require('crypto');var jsforce=require(_0x2670('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2670('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2670('0xf'));var qs=require(_0x2670('0x10'));var as=require(_0x2670('0x11'));var hardwareService=require(_0x2670('0x12'));var logger=require(_0x2670('0x13'))('api');var utils=require(_0x2670('0x14'));var config=require(_0x2670('0x15'));var licenseUtil=require(_0x2670('0x16'));var db=require(_0x2670('0x17'))['db'];function respondWithStatusCode(_0x3c4771,_0x503b0f){_0x503b0f=_0x503b0f||0xcc;return function(_0x5754ce){if(_0x5754ce){return _0x3c4771[_0x2670('0x18')](_0x503b0f);}return _0x3c4771['status'](_0x503b0f)[_0x2670('0x19')]();};}function respondWithResult(_0x25843f,_0x108a03){_0x108a03=_0x108a03||0xc8;return function(_0x5dffd0){if(_0x5dffd0){return _0x25843f['status'](_0x108a03)[_0x2670('0x1a')](_0x5dffd0);}};}function respondWithFilteredResult(_0x142dac,_0x31791c){return function(_0x17a421){if(_0x17a421){var _0x1973fe=typeof _0x31791c['offset']===_0x2670('0x1b')&&typeof _0x31791c[_0x2670('0x1c')]===_0x2670('0x1b');var _0x4972de=_0x17a421[_0x2670('0x1d')];var _0xbfce47=_0x1973fe?0x0:_0x31791c[_0x2670('0x1e')];var _0x12b6b8=_0x1973fe?_0x17a421[_0x2670('0x1d')]:_0x31791c[_0x2670('0x1e')]+_0x31791c[_0x2670('0x1c')];var _0x589013;if(_0x12b6b8>=_0x4972de){_0x12b6b8=_0x4972de;_0x589013=0xc8;}else{_0x589013=0xce;}_0x142dac[_0x2670('0x1f')](_0x589013);return _0x142dac[_0x2670('0x20')](_0x2670('0x21'),_0xbfce47+'-'+_0x12b6b8+'/'+_0x4972de)['json'](_0x17a421);}return null;};}function patchUpdates(_0x33e5fd){return function(_0xa0d276){try{jsonpatch[_0x2670('0x22')](_0xa0d276,_0x33e5fd,!![]);}catch(_0x141cc0){return BPromise['reject'](_0x141cc0);}return _0xa0d276[_0x2670('0x23')]();};}function saveUpdates(_0x565526,_0x2b6f37){return function(_0x1d965f){if(_0x1d965f){return _0x1d965f[_0x2670('0x24')](_0x565526)[_0x2670('0x25')](function(_0x386792){return _0x386792;});}return null;};}function removeEntity(_0x1f01b1,_0x575d69){return function(_0x3c62a8){if(_0x3c62a8){return _0x3c62a8[_0x2670('0x26')]()[_0x2670('0x25')](function(){_0x1f01b1[_0x2670('0x1f')](0xcc)[_0x2670('0x19')]();});}};}function handleEntityNotFound(_0x35f552,_0x2c1246){return function(_0x5dff94){if(!_0x5dff94){_0x35f552[_0x2670('0x18')](0x194);}return _0x5dff94;};}function handleError(_0x42eb71,_0x308798){_0x308798=_0x308798||0x1f4;return function(_0x42728c){logger['error'](_0x42728c['stack']);if(_0x42728c[_0x2670('0x27')]){delete _0x42728c[_0x2670('0x27')];}_0x42eb71[_0x2670('0x1f')](_0x308798)[_0x2670('0x28')](_0x42728c);};}exports[_0x2670('0x29')]=function(_0xdc540c,_0x61e82e){var _0x460377={},_0x4fa9a9={},_0x24c4cd={'count':0x0,'rows':[]};var _0x105557=_[_0x2670('0x2a')](db[_0x2670('0x2b')]['rawAttributes'],function(_0x46e9cd){return{'name':_0x46e9cd[_0x2670('0x2c')],'type':_0x46e9cd[_0x2670('0x2d')][_0x2670('0x2e')]};});_0x4fa9a9['model']=_[_0x2670('0x2a')](_0x105557,'name');_0x4fa9a9[_0x2670('0x2f')]=_[_0x2670('0x30')](_0xdc540c[_0x2670('0x2f')]);_0x4fa9a9['filters']=_['intersection'](_0x4fa9a9[_0x2670('0x31')],_0x4fa9a9['query']);_0x460377[_0x2670('0x32')]=_[_0x2670('0x33')](_0x4fa9a9['model'],qs['fields'](_0xdc540c['query'][_0x2670('0x34')]));_0x460377[_0x2670('0x32')]=_0x460377[_0x2670('0x32')][_0x2670('0x35')]?_0x460377[_0x2670('0x32')]:_0x4fa9a9[_0x2670('0x31')];if(!_0xdc540c[_0x2670('0x2f')]['hasOwnProperty'](_0x2670('0x36'))){_0x460377[_0x2670('0x1c')]=qs[_0x2670('0x1c')](_0xdc540c[_0x2670('0x2f')][_0x2670('0x1c')]);_0x460377['offset']=qs[_0x2670('0x1e')](_0xdc540c['query'][_0x2670('0x1e')]);}_0x460377[_0x2670('0x37')]=qs[_0x2670('0x38')](_0xdc540c[_0x2670('0x2f')][_0x2670('0x38')]);_0x460377[_0x2670('0x39')]=qs[_0x2670('0x3a')](_['pick'](_0xdc540c[_0x2670('0x2f')],_0x4fa9a9[_0x2670('0x3a')]),_0x105557);if(_0xdc540c[_0x2670('0x2f')][_0x2670('0x3b')]){_0x460377[_0x2670('0x39')]=_[_0x2670('0x3c')](_0x460377[_0x2670('0x39')],{'$or':_[_0x2670('0x2a')](_0x105557,function(_0x209172){if(_0x209172[_0x2670('0x2d')]!=='VIRTUAL'){var _0x1273b4={};_0x1273b4[_0x209172[_0x2670('0x27')]]={'$like':'%'+_0xdc540c[_0x2670('0x2f')][_0x2670('0x3b')]+'%'};return _0x1273b4;}})});}_0x460377=_['merge']({},_0x460377,_0xdc540c[_0x2670('0x3d')]);var _0x25fcd8={'where':_0x460377['where']};return db['SugarcrmConfiguration']['count'](_0x25fcd8)['then'](function(_0x3de268){_0x24c4cd['count']=_0x3de268;if(_0xdc540c[_0x2670('0x2f')][_0x2670('0x3e')]){_0x460377[_0x2670('0x3f')]=[{'all':!![]}];}return db[_0x2670('0x2b')][_0x2670('0x40')](_0x460377);})['then'](function(_0x3a29c5){_0x24c4cd[_0x2670('0x41')]=_0x3a29c5;return _0x24c4cd;})[_0x2670('0x25')](respondWithFilteredResult(_0x61e82e,_0x460377))[_0x2670('0x42')](handleError(_0x61e82e,null));};exports[_0x2670('0x43')]=function(_0x434692,_0x291db3){var _0x589c35={'raw':![],'where':{'id':_0x434692[_0x2670('0x44')]['id']}},_0x5d65b4={};_0x5d65b4[_0x2670('0x31')]=_[_0x2670('0x30')](db[_0x2670('0x2b')][_0x2670('0x45')]);_0x5d65b4[_0x2670('0x2f')]=_[_0x2670('0x30')](_0x434692[_0x2670('0x2f')]);_0x5d65b4['filters']=_[_0x2670('0x33')](_0x5d65b4[_0x2670('0x31')],_0x5d65b4[_0x2670('0x2f')]);_0x589c35[_0x2670('0x32')]=_[_0x2670('0x33')](_0x5d65b4[_0x2670('0x31')],qs[_0x2670('0x34')](_0x434692[_0x2670('0x2f')]['fields']));_0x589c35[_0x2670('0x32')]=_0x589c35[_0x2670('0x32')][_0x2670('0x35')]?_0x589c35['attributes']:_0x5d65b4[_0x2670('0x31')];if(_0x434692[_0x2670('0x2f')]['includeAll']){_0x589c35[_0x2670('0x3f')]=[{'all':!![]}];}_0x589c35=_[_0x2670('0x3c')]({},_0x589c35,_0x434692[_0x2670('0x3d')]);return db[_0x2670('0x2b')]['find'](_0x589c35)[_0x2670('0x25')](handleEntityNotFound(_0x291db3,null))['then'](respondWithResult(_0x291db3,null))[_0x2670('0x42')](handleError(_0x291db3,null));};exports[_0x2670('0x46')]=function(_0x3f17d1,_0x23286b){return db[_0x2670('0x2b')]['create'](_0x3f17d1['body'],{})[_0x2670('0x25')](respondWithResult(_0x23286b,0xc9))[_0x2670('0x42')](handleError(_0x23286b,null));};exports['update']=function(_0x434e8e,_0x29d0bc){if(_0x434e8e['body']['id']){delete _0x434e8e[_0x2670('0x47')]['id'];}return db[_0x2670('0x2b')][_0x2670('0x48')]({'where':{'id':_0x434e8e[_0x2670('0x44')]['id']}})['then'](handleEntityNotFound(_0x29d0bc,null))[_0x2670('0x25')](saveUpdates(_0x434e8e[_0x2670('0x47')],null))[_0x2670('0x25')](respondWithResult(_0x29d0bc,null))[_0x2670('0x42')](handleError(_0x29d0bc,null));};exports['destroy']=function(_0xc96c2b,_0x269ad0){return db[_0x2670('0x2b')][_0x2670('0x48')]({'where':{'id':_0xc96c2b[_0x2670('0x44')]['id']}})['then'](handleEntityNotFound(_0x269ad0,null))['then'](removeEntity(_0x269ad0,null))[_0x2670('0x42')](handleError(_0x269ad0,null));};exports[_0x2670('0x49')]=function(_0x37dc42,_0x4ee04f,_0x113474){var _0x296aa3={};var _0x37cd77={};var _0x1e0b7e;var _0x5f10bd;return db[_0x2670('0x2b')]['findOne']({'where':{'id':_0x37dc42[_0x2670('0x44')]['id']}})['then'](handleEntityNotFound(_0x4ee04f,null))['then'](function(_0xcf6acd){if(_0xcf6acd){_0x1e0b7e=_0xcf6acd;_0x37cd77[_0x2670('0x31')]=_['keys'](db[_0x2670('0x4a')][_0x2670('0x45')]);_0x37cd77[_0x2670('0x2f')]=_[_0x2670('0x30')](_0x37dc42[_0x2670('0x2f')]);_0x37cd77['filters']=_[_0x2670('0x33')](_0x37cd77[_0x2670('0x31')],_0x37cd77['query']);_0x296aa3[_0x2670('0x32')]=_[_0x2670('0x33')](_0x37cd77['model'],qs[_0x2670('0x34')](_0x37dc42['query'][_0x2670('0x34')]));_0x296aa3[_0x2670('0x32')]=_0x296aa3[_0x2670('0x32')][_0x2670('0x35')]?_0x296aa3['attributes']:_0x37cd77['model'];_0x296aa3[_0x2670('0x37')]=qs[_0x2670('0x38')](_0x37dc42['query'][_0x2670('0x38')]);_0x296aa3[_0x2670('0x39')]=qs[_0x2670('0x3a')](_[_0x2670('0x4b')](_0x37dc42['query'],_0x37cd77[_0x2670('0x3a')]));if(_0x37dc42[_0x2670('0x2f')][_0x2670('0x3b')]){_0x296aa3['where']=_[_0x2670('0x3c')](_0x296aa3[_0x2670('0x39')],{'$or':_[_0x2670('0x2a')](_0x296aa3[_0x2670('0x32')],function(_0x59af78){var _0xebdcf3={};_0xebdcf3[_0x59af78]={'$like':'%'+_0x37dc42[_0x2670('0x2f')][_0x2670('0x3b')]+'%'};return _0xebdcf3;})});}_0x296aa3=_[_0x2670('0x3c')]({},_0x296aa3,_0x37dc42[_0x2670('0x3d')]);return _0x1e0b7e[_0x2670('0x49')](_0x296aa3);}})[_0x2670('0x25')](function(_0x3b3332){if(_0x3b3332){_0x5f10bd=_0x3b3332['length'];if(!_0x37dc42[_0x2670('0x2f')]['hasOwnProperty']('nolimit')){_0x296aa3['limit']=qs['limit'](_0x37dc42[_0x2670('0x2f')][_0x2670('0x1c')]);_0x296aa3['offset']=qs['offset'](_0x37dc42[_0x2670('0x2f')][_0x2670('0x1e')]);}return _0x1e0b7e['getFields'](_0x296aa3);}})[_0x2670('0x25')](function(_0xc3033d){if(_0xc3033d){return _0xc3033d?{'count':_0x5f10bd,'rows':_0xc3033d}:null;}})[_0x2670('0x25')](respondWithResult(_0x4ee04f,null))[_0x2670('0x42')](handleError(_0x4ee04f,null));};exports[_0x2670('0x4c')]=function(_0x20dd8a,_0x140695,_0x67561c){var _0x37406d={};var _0x14d8e7={};var _0xc240eb;var _0x371be5;return db[_0x2670('0x2b')]['findOne']({'where':{'id':_0x20dd8a[_0x2670('0x44')]['id']}})['then'](handleEntityNotFound(_0x140695,null))[_0x2670('0x25')](function(_0x584646){if(_0x584646){_0xc240eb=_0x584646;_0x14d8e7[_0x2670('0x31')]=_['keys'](db[_0x2670('0x4a')]['rawAttributes']);_0x14d8e7[_0x2670('0x2f')]=_[_0x2670('0x30')](_0x20dd8a[_0x2670('0x2f')]);_0x14d8e7[_0x2670('0x3a')]=_[_0x2670('0x33')](_0x14d8e7['model'],_0x14d8e7[_0x2670('0x2f')]);_0x37406d[_0x2670('0x32')]=_['intersection'](_0x14d8e7[_0x2670('0x31')],qs[_0x2670('0x34')](_0x20dd8a[_0x2670('0x2f')][_0x2670('0x34')]));_0x37406d[_0x2670('0x32')]=_0x37406d[_0x2670('0x32')][_0x2670('0x35')]?_0x37406d[_0x2670('0x32')]:_0x14d8e7[_0x2670('0x31')];_0x37406d[_0x2670('0x37')]=qs['sort'](_0x20dd8a['query']['sort']);_0x37406d[_0x2670('0x39')]=qs[_0x2670('0x3a')](_[_0x2670('0x4b')](_0x20dd8a[_0x2670('0x2f')],_0x14d8e7[_0x2670('0x3a')]));if(_0x20dd8a['query'][_0x2670('0x3b')]){_0x37406d[_0x2670('0x39')]=_[_0x2670('0x3c')](_0x37406d[_0x2670('0x39')],{'$or':_[_0x2670('0x2a')](_0x37406d['attributes'],function(_0x3c292c){var _0x1502ac={};_0x1502ac[_0x3c292c]={'$like':'%'+_0x20dd8a[_0x2670('0x2f')][_0x2670('0x3b')]+'%'};return _0x1502ac;})});}_0x37406d=_[_0x2670('0x3c')]({},_0x37406d,_0x20dd8a['options']);return _0xc240eb[_0x2670('0x4c')](_0x37406d);}})[_0x2670('0x25')](function(_0x1c7107){if(_0x1c7107){_0x371be5=_0x1c7107['length'];if(!_0x20dd8a['query'][_0x2670('0x4d')](_0x2670('0x36'))){_0x37406d['limit']=qs[_0x2670('0x1c')](_0x20dd8a['query'][_0x2670('0x1c')]);_0x37406d['offset']=qs['offset'](_0x20dd8a[_0x2670('0x2f')][_0x2670('0x1e')]);}return _0xc240eb[_0x2670('0x4c')](_0x37406d);}})[_0x2670('0x25')](function(_0x4aa13c){if(_0x4aa13c){return _0x4aa13c?{'count':_0x371be5,'rows':_0x4aa13c}:null;}})[_0x2670('0x25')](respondWithResult(_0x140695,null))[_0x2670('0x42')](handleError(_0x140695,null));};exports[_0x2670('0x4e')]=function(_0xecae6b,_0x3a6e17,_0x75d27d){var _0x2480da={};var _0x5ede40={};var _0x3e82ee;var _0x466789;return db[_0x2670('0x2b')]['findOne']({'where':{'id':_0xecae6b[_0x2670('0x44')]['id']}})[_0x2670('0x25')](handleEntityNotFound(_0x3a6e17,null))[_0x2670('0x25')](function(_0x36ea84){if(_0x36ea84){_0x3e82ee=_0x36ea84;_0x5ede40[_0x2670('0x31')]=_[_0x2670('0x30')](db[_0x2670('0x4a')][_0x2670('0x45')]);_0x5ede40['query']=_[_0x2670('0x30')](_0xecae6b[_0x2670('0x2f')]);_0x5ede40['filters']=_[_0x2670('0x33')](_0x5ede40[_0x2670('0x31')],_0x5ede40['query']);_0x2480da[_0x2670('0x32')]=_[_0x2670('0x33')](_0x5ede40['model'],qs[_0x2670('0x34')](_0xecae6b[_0x2670('0x2f')]['fields']));_0x2480da[_0x2670('0x32')]=_0x2480da[_0x2670('0x32')]['length']?_0x2480da['attributes']:_0x5ede40['model'];_0x2480da[_0x2670('0x37')]=qs['sort'](_0xecae6b['query'][_0x2670('0x38')]);_0x2480da[_0x2670('0x39')]=qs[_0x2670('0x3a')](_[_0x2670('0x4b')](_0xecae6b[_0x2670('0x2f')],_0x5ede40[_0x2670('0x3a')]));if(_0xecae6b[_0x2670('0x2f')][_0x2670('0x3b')]){_0x2480da[_0x2670('0x39')]=_[_0x2670('0x3c')](_0x2480da[_0x2670('0x39')],{'$or':_[_0x2670('0x2a')](_0x2480da['attributes'],function(_0x166570){var _0x9f4bfd={};_0x9f4bfd[_0x166570]={'$like':'%'+_0xecae6b[_0x2670('0x2f')][_0x2670('0x3b')]+'%'};return _0x9f4bfd;})});}_0x2480da=_[_0x2670('0x3c')]({},_0x2480da,_0xecae6b[_0x2670('0x3d')]);return _0x3e82ee[_0x2670('0x4e')](_0x2480da);}})[_0x2670('0x25')](function(_0x3c8895){if(_0x3c8895){_0x466789=_0x3c8895[_0x2670('0x35')];if(!_0xecae6b[_0x2670('0x2f')]['hasOwnProperty']('nolimit')){_0x2480da[_0x2670('0x1c')]=qs[_0x2670('0x1c')](_0xecae6b['query'][_0x2670('0x1c')]);_0x2480da[_0x2670('0x1e')]=qs[_0x2670('0x1e')](_0xecae6b[_0x2670('0x2f')]['offset']);}return _0x3e82ee[_0x2670('0x4e')](_0x2480da);}})['then'](function(_0xeb8187){if(_0xeb8187){return _0xeb8187?{'count':_0x466789,'rows':_0xeb8187}:null;}})['then'](respondWithResult(_0x3a6e17,null))[_0x2670('0x42')](handleError(_0x3a6e17,null));}; \ No newline at end of file +var _0xeaa0=['end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SugarcrmConfiguration','includeAll','include','length','find','catch','create','body','params','findOne','getFields','hasOwnProperty','getSubjects','getDescriptions','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xeaa0,0x176));var _0x0eaa=function(_0xce8373,_0x2ad630){_0xce8373=_0xce8373-0x0;var _0xa5cd5f=_0xeaa0[_0xce8373];return _0xa5cd5f;};'use strict';var emlformat=require(_0x0eaa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0eaa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0eaa('0x2'));var moment=require(_0x0eaa('0x3'));var BPromise=require(_0x0eaa('0x4'));var Mustache=require(_0x0eaa('0x5'));var util=require(_0x0eaa('0x6'));var path=require('path');var sox=require(_0x0eaa('0x7'));var csv=require(_0x0eaa('0x8'));var ejs=require(_0x0eaa('0x9'));var fs=require('fs');var fs_extra=require(_0x0eaa('0xa'));var _=require(_0x0eaa('0xb'));var squel=require(_0x0eaa('0xc'));var crypto=require(_0x0eaa('0xd'));var jsforce=require(_0x0eaa('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0eaa('0xf'));var Redis=require('ioredis');var authService=require(_0x0eaa('0x10'));var qs=require(_0x0eaa('0x11'));var as=require(_0x0eaa('0x12'));var hardwareService=require(_0x0eaa('0x13'));var logger=require(_0x0eaa('0x14'))('api');var utils=require(_0x0eaa('0x15'));var config=require(_0x0eaa('0x16'));var licenseUtil=require(_0x0eaa('0x17'));var db=require(_0x0eaa('0x18'))['db'];function respondWithStatusCode(_0x30fa11,_0x20fe7b){_0x20fe7b=_0x20fe7b||0xcc;return function(_0x4b8cf2){if(_0x4b8cf2){return _0x30fa11['sendStatus'](_0x20fe7b);}return _0x30fa11[_0x0eaa('0x19')](_0x20fe7b)[_0x0eaa('0x1a')]();};}function respondWithResult(_0xdcf8ff,_0x497a8f){_0x497a8f=_0x497a8f||0xc8;return function(_0x142b47){if(_0x142b47){return _0xdcf8ff['status'](_0x497a8f)[_0x0eaa('0x1b')](_0x142b47);}};}function respondWithFilteredResult(_0x2a9d9f,_0x6fe982){return function(_0x1d7ede){if(_0x1d7ede){var _0x597564=typeof _0x6fe982['offset']===_0x0eaa('0x1c')&&typeof _0x6fe982['limit']==='undefined';var _0x2553d6=_0x1d7ede[_0x0eaa('0x1d')];var _0x3b513d=_0x597564?0x0:_0x6fe982[_0x0eaa('0x1e')];var _0x585279=_0x597564?_0x1d7ede[_0x0eaa('0x1d')]:_0x6fe982[_0x0eaa('0x1e')]+_0x6fe982[_0x0eaa('0x1f')];var _0x408f43;if(_0x585279>=_0x2553d6){_0x585279=_0x2553d6;_0x408f43=0xc8;}else{_0x408f43=0xce;}_0x2a9d9f[_0x0eaa('0x19')](_0x408f43);return _0x2a9d9f[_0x0eaa('0x20')](_0x0eaa('0x21'),_0x3b513d+'-'+_0x585279+'/'+_0x2553d6)[_0x0eaa('0x1b')](_0x1d7ede);}return null;};}function patchUpdates(_0x3574f8){return function(_0x3f8bdc){try{jsonpatch[_0x0eaa('0x22')](_0x3f8bdc,_0x3574f8,!![]);}catch(_0x51ff8c){return BPromise[_0x0eaa('0x23')](_0x51ff8c);}return _0x3f8bdc[_0x0eaa('0x24')]();};}function saveUpdates(_0x1b5f68,_0x2ca517){return function(_0x22a001){if(_0x22a001){return _0x22a001[_0x0eaa('0x25')](_0x1b5f68)[_0x0eaa('0x26')](function(_0x3f46c7){return _0x3f46c7;});}return null;};}function removeEntity(_0x1be512,_0x558131){return function(_0x20a5b8){if(_0x20a5b8){return _0x20a5b8[_0x0eaa('0x27')]()[_0x0eaa('0x26')](function(){_0x1be512[_0x0eaa('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cf3c2,_0x9a8ea7){return function(_0x268e77){if(!_0x268e77){_0x5cf3c2[_0x0eaa('0x28')](0x194);}return _0x268e77;};}function handleError(_0x4dd7ce,_0x3932c7){_0x3932c7=_0x3932c7||0x1f4;return function(_0x205c11){logger[_0x0eaa('0x29')](_0x205c11[_0x0eaa('0x2a')]);if(_0x205c11[_0x0eaa('0x2b')]){delete _0x205c11[_0x0eaa('0x2b')];}_0x4dd7ce[_0x0eaa('0x19')](_0x3932c7)['send'](_0x205c11);};}exports[_0x0eaa('0x2c')]=function(_0x50d89e,_0x172dd7){var _0x10cace={},_0x147be0={},_0x3f68f2={'count':0x0,'rows':[]};var _0xba0824=_[_0x0eaa('0x2d')](db['SugarcrmConfiguration'][_0x0eaa('0x2e')],function(_0x54332e){return{'name':_0x54332e[_0x0eaa('0x2f')],'type':_0x54332e[_0x0eaa('0x30')][_0x0eaa('0x31')]};});_0x147be0[_0x0eaa('0x32')]=_[_0x0eaa('0x2d')](_0xba0824,_0x0eaa('0x2b'));_0x147be0[_0x0eaa('0x33')]=_[_0x0eaa('0x34')](_0x50d89e[_0x0eaa('0x33')]);_0x147be0[_0x0eaa('0x35')]=_[_0x0eaa('0x36')](_0x147be0[_0x0eaa('0x32')],_0x147be0['query']);_0x10cace[_0x0eaa('0x37')]=_[_0x0eaa('0x36')](_0x147be0['model'],qs[_0x0eaa('0x38')](_0x50d89e[_0x0eaa('0x33')][_0x0eaa('0x38')]));_0x10cace[_0x0eaa('0x37')]=_0x10cace[_0x0eaa('0x37')]['length']?_0x10cace[_0x0eaa('0x37')]:_0x147be0[_0x0eaa('0x32')];if(!_0x50d89e[_0x0eaa('0x33')]['hasOwnProperty'](_0x0eaa('0x39'))){_0x10cace[_0x0eaa('0x1f')]=qs[_0x0eaa('0x1f')](_0x50d89e[_0x0eaa('0x33')]['limit']);_0x10cace['offset']=qs['offset'](_0x50d89e[_0x0eaa('0x33')][_0x0eaa('0x1e')]);}_0x10cace[_0x0eaa('0x3a')]=qs[_0x0eaa('0x3b')](_0x50d89e[_0x0eaa('0x33')][_0x0eaa('0x3b')]);_0x10cace[_0x0eaa('0x3c')]=qs['filters'](_[_0x0eaa('0x3d')](_0x50d89e['query'],_0x147be0[_0x0eaa('0x35')]),_0xba0824);if(_0x50d89e[_0x0eaa('0x33')][_0x0eaa('0x3e')]){_0x10cace[_0x0eaa('0x3c')]=_[_0x0eaa('0x3f')](_0x10cace[_0x0eaa('0x3c')],{'$or':_['map'](_0xba0824,function(_0x25ce8b){if(_0x25ce8b[_0x0eaa('0x30')]!==_0x0eaa('0x40')){var _0x421482={};_0x421482[_0x25ce8b['name']]={'$like':'%'+_0x50d89e[_0x0eaa('0x33')][_0x0eaa('0x3e')]+'%'};return _0x421482;}})});}_0x10cace=_[_0x0eaa('0x3f')]({},_0x10cace,_0x50d89e[_0x0eaa('0x41')]);var _0x2a2222={'where':_0x10cace['where']};return db[_0x0eaa('0x42')][_0x0eaa('0x1d')](_0x2a2222)[_0x0eaa('0x26')](function(_0x387cdd){_0x3f68f2['count']=_0x387cdd;if(_0x50d89e['query'][_0x0eaa('0x43')]){_0x10cace[_0x0eaa('0x44')]=[{'all':!![]}];}return db[_0x0eaa('0x42')]['findAll'](_0x10cace);})['then'](function(_0x330131){_0x3f68f2['rows']=_0x330131;return _0x3f68f2;})[_0x0eaa('0x26')](respondWithFilteredResult(_0x172dd7,_0x10cace))['catch'](handleError(_0x172dd7,null));};exports['show']=function(_0x34d252,_0x1bbea3){var _0x1dfa18={'raw':![],'where':{'id':_0x34d252['params']['id']}},_0x2e05d6={};_0x2e05d6[_0x0eaa('0x32')]=_['keys'](db[_0x0eaa('0x42')][_0x0eaa('0x2e')]);_0x2e05d6['query']=_['keys'](_0x34d252[_0x0eaa('0x33')]);_0x2e05d6[_0x0eaa('0x35')]=_[_0x0eaa('0x36')](_0x2e05d6['model'],_0x2e05d6[_0x0eaa('0x33')]);_0x1dfa18[_0x0eaa('0x37')]=_[_0x0eaa('0x36')](_0x2e05d6['model'],qs[_0x0eaa('0x38')](_0x34d252[_0x0eaa('0x33')]['fields']));_0x1dfa18[_0x0eaa('0x37')]=_0x1dfa18[_0x0eaa('0x37')][_0x0eaa('0x45')]?_0x1dfa18[_0x0eaa('0x37')]:_0x2e05d6[_0x0eaa('0x32')];if(_0x34d252[_0x0eaa('0x33')][_0x0eaa('0x43')]){_0x1dfa18['include']=[{'all':!![]}];}_0x1dfa18=_[_0x0eaa('0x3f')]({},_0x1dfa18,_0x34d252[_0x0eaa('0x41')]);return db[_0x0eaa('0x42')][_0x0eaa('0x46')](_0x1dfa18)[_0x0eaa('0x26')](handleEntityNotFound(_0x1bbea3,null))[_0x0eaa('0x26')](respondWithResult(_0x1bbea3,null))[_0x0eaa('0x47')](handleError(_0x1bbea3,null));};exports[_0x0eaa('0x48')]=function(_0x1b81ee,_0x305a8a){return db[_0x0eaa('0x42')]['create'](_0x1b81ee[_0x0eaa('0x49')],{})[_0x0eaa('0x26')](respondWithResult(_0x305a8a,0xc9))[_0x0eaa('0x47')](handleError(_0x305a8a,null));};exports['update']=function(_0x2b9784,_0x1099b5){if(_0x2b9784[_0x0eaa('0x49')]['id']){delete _0x2b9784[_0x0eaa('0x49')]['id'];}return db[_0x0eaa('0x42')][_0x0eaa('0x46')]({'where':{'id':_0x2b9784[_0x0eaa('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1099b5,null))[_0x0eaa('0x26')](saveUpdates(_0x2b9784[_0x0eaa('0x49')],null))['then'](respondWithResult(_0x1099b5,null))['catch'](handleError(_0x1099b5,null));};exports[_0x0eaa('0x27')]=function(_0x359b81,_0x293ef1){return db[_0x0eaa('0x42')][_0x0eaa('0x46')]({'where':{'id':_0x359b81[_0x0eaa('0x4a')]['id']}})[_0x0eaa('0x26')](handleEntityNotFound(_0x293ef1,null))[_0x0eaa('0x26')](removeEntity(_0x293ef1,null))['catch'](handleError(_0x293ef1,null));};exports['getFields']=function(_0x38137d,_0x3689e4,_0x1a6dd4){var _0x3128b0={};var _0x2736ce={};var _0x407f3d;var _0x1ac33e;return db[_0x0eaa('0x42')][_0x0eaa('0x4b')]({'where':{'id':_0x38137d['params']['id']}})[_0x0eaa('0x26')](handleEntityNotFound(_0x3689e4,null))[_0x0eaa('0x26')](function(_0x312150){if(_0x312150){_0x407f3d=_0x312150;_0x2736ce[_0x0eaa('0x32')]=_[_0x0eaa('0x34')](db['SugarcrmField']['rawAttributes']);_0x2736ce[_0x0eaa('0x33')]=_[_0x0eaa('0x34')](_0x38137d[_0x0eaa('0x33')]);_0x2736ce[_0x0eaa('0x35')]=_['intersection'](_0x2736ce[_0x0eaa('0x32')],_0x2736ce[_0x0eaa('0x33')]);_0x3128b0[_0x0eaa('0x37')]=_[_0x0eaa('0x36')](_0x2736ce[_0x0eaa('0x32')],qs[_0x0eaa('0x38')](_0x38137d[_0x0eaa('0x33')]['fields']));_0x3128b0[_0x0eaa('0x37')]=_0x3128b0['attributes']['length']?_0x3128b0[_0x0eaa('0x37')]:_0x2736ce['model'];_0x3128b0[_0x0eaa('0x3a')]=qs[_0x0eaa('0x3b')](_0x38137d[_0x0eaa('0x33')][_0x0eaa('0x3b')]);_0x3128b0['where']=qs[_0x0eaa('0x35')](_[_0x0eaa('0x3d')](_0x38137d[_0x0eaa('0x33')],_0x2736ce[_0x0eaa('0x35')]));if(_0x38137d['query']['filter']){_0x3128b0[_0x0eaa('0x3c')]=_[_0x0eaa('0x3f')](_0x3128b0[_0x0eaa('0x3c')],{'$or':_[_0x0eaa('0x2d')](_0x3128b0[_0x0eaa('0x37')],function(_0x594f5d){var _0x451eb7={};_0x451eb7[_0x594f5d]={'$like':'%'+_0x38137d['query'][_0x0eaa('0x3e')]+'%'};return _0x451eb7;})});}_0x3128b0=_[_0x0eaa('0x3f')]({},_0x3128b0,_0x38137d['options']);return _0x407f3d[_0x0eaa('0x4c')](_0x3128b0);}})[_0x0eaa('0x26')](function(_0x30be06){if(_0x30be06){_0x1ac33e=_0x30be06[_0x0eaa('0x45')];if(!_0x38137d['query'][_0x0eaa('0x4d')](_0x0eaa('0x39'))){_0x3128b0[_0x0eaa('0x1f')]=qs[_0x0eaa('0x1f')](_0x38137d[_0x0eaa('0x33')][_0x0eaa('0x1f')]);_0x3128b0[_0x0eaa('0x1e')]=qs[_0x0eaa('0x1e')](_0x38137d[_0x0eaa('0x33')][_0x0eaa('0x1e')]);}return _0x407f3d[_0x0eaa('0x4c')](_0x3128b0);}})[_0x0eaa('0x26')](function(_0x194ce2){if(_0x194ce2){return _0x194ce2?{'count':_0x1ac33e,'rows':_0x194ce2}:null;}})[_0x0eaa('0x26')](respondWithResult(_0x3689e4,null))[_0x0eaa('0x47')](handleError(_0x3689e4,null));};exports[_0x0eaa('0x4e')]=function(_0x35a82d,_0x2e74e9,_0x15292d){var _0x29a0fa={};var _0x10ac58={};var _0xfa13fc;var _0x387334;return db[_0x0eaa('0x42')][_0x0eaa('0x4b')]({'where':{'id':_0x35a82d[_0x0eaa('0x4a')]['id']}})[_0x0eaa('0x26')](handleEntityNotFound(_0x2e74e9,null))[_0x0eaa('0x26')](function(_0xe93255){if(_0xe93255){_0xfa13fc=_0xe93255;_0x10ac58[_0x0eaa('0x32')]=_['keys'](db['SugarcrmField'][_0x0eaa('0x2e')]);_0x10ac58[_0x0eaa('0x33')]=_[_0x0eaa('0x34')](_0x35a82d[_0x0eaa('0x33')]);_0x10ac58[_0x0eaa('0x35')]=_[_0x0eaa('0x36')](_0x10ac58[_0x0eaa('0x32')],_0x10ac58[_0x0eaa('0x33')]);_0x29a0fa[_0x0eaa('0x37')]=_[_0x0eaa('0x36')](_0x10ac58['model'],qs[_0x0eaa('0x38')](_0x35a82d['query'][_0x0eaa('0x38')]));_0x29a0fa['attributes']=_0x29a0fa[_0x0eaa('0x37')][_0x0eaa('0x45')]?_0x29a0fa[_0x0eaa('0x37')]:_0x10ac58['model'];_0x29a0fa['order']=qs[_0x0eaa('0x3b')](_0x35a82d[_0x0eaa('0x33')][_0x0eaa('0x3b')]);_0x29a0fa['where']=qs['filters'](_[_0x0eaa('0x3d')](_0x35a82d['query'],_0x10ac58[_0x0eaa('0x35')]));if(_0x35a82d[_0x0eaa('0x33')][_0x0eaa('0x3e')]){_0x29a0fa[_0x0eaa('0x3c')]=_[_0x0eaa('0x3f')](_0x29a0fa['where'],{'$or':_[_0x0eaa('0x2d')](_0x29a0fa[_0x0eaa('0x37')],function(_0x3fa4a6){var _0x4f218c={};_0x4f218c[_0x3fa4a6]={'$like':'%'+_0x35a82d[_0x0eaa('0x33')][_0x0eaa('0x3e')]+'%'};return _0x4f218c;})});}_0x29a0fa=_[_0x0eaa('0x3f')]({},_0x29a0fa,_0x35a82d[_0x0eaa('0x41')]);return _0xfa13fc[_0x0eaa('0x4e')](_0x29a0fa);}})[_0x0eaa('0x26')](function(_0x362a4d){if(_0x362a4d){_0x387334=_0x362a4d[_0x0eaa('0x45')];if(!_0x35a82d['query']['hasOwnProperty']('nolimit')){_0x29a0fa[_0x0eaa('0x1f')]=qs[_0x0eaa('0x1f')](_0x35a82d[_0x0eaa('0x33')]['limit']);_0x29a0fa[_0x0eaa('0x1e')]=qs[_0x0eaa('0x1e')](_0x35a82d[_0x0eaa('0x33')][_0x0eaa('0x1e')]);}return _0xfa13fc[_0x0eaa('0x4e')](_0x29a0fa);}})[_0x0eaa('0x26')](function(_0x4a5861){if(_0x4a5861){return _0x4a5861?{'count':_0x387334,'rows':_0x4a5861}:null;}})[_0x0eaa('0x26')](respondWithResult(_0x2e74e9,null))['catch'](handleError(_0x2e74e9,null));};exports[_0x0eaa('0x4f')]=function(_0x5e7fc4,_0xd7b6ae,_0x5b7591){var _0x4e943e={};var _0x528a6d={};var _0x5f0d10;var _0x1bebdd;return db['SugarcrmConfiguration'][_0x0eaa('0x4b')]({'where':{'id':_0x5e7fc4['params']['id']}})[_0x0eaa('0x26')](handleEntityNotFound(_0xd7b6ae,null))['then'](function(_0x2fe69f){if(_0x2fe69f){_0x5f0d10=_0x2fe69f;_0x528a6d[_0x0eaa('0x32')]=_[_0x0eaa('0x34')](db['SugarcrmField'][_0x0eaa('0x2e')]);_0x528a6d['query']=_[_0x0eaa('0x34')](_0x5e7fc4['query']);_0x528a6d['filters']=_[_0x0eaa('0x36')](_0x528a6d['model'],_0x528a6d['query']);_0x4e943e['attributes']=_[_0x0eaa('0x36')](_0x528a6d['model'],qs['fields'](_0x5e7fc4[_0x0eaa('0x33')][_0x0eaa('0x38')]));_0x4e943e[_0x0eaa('0x37')]=_0x4e943e[_0x0eaa('0x37')][_0x0eaa('0x45')]?_0x4e943e[_0x0eaa('0x37')]:_0x528a6d[_0x0eaa('0x32')];_0x4e943e['order']=qs[_0x0eaa('0x3b')](_0x5e7fc4[_0x0eaa('0x33')][_0x0eaa('0x3b')]);_0x4e943e['where']=qs[_0x0eaa('0x35')](_[_0x0eaa('0x3d')](_0x5e7fc4[_0x0eaa('0x33')],_0x528a6d[_0x0eaa('0x35')]));if(_0x5e7fc4[_0x0eaa('0x33')]['filter']){_0x4e943e[_0x0eaa('0x3c')]=_[_0x0eaa('0x3f')](_0x4e943e[_0x0eaa('0x3c')],{'$or':_[_0x0eaa('0x2d')](_0x4e943e['attributes'],function(_0x2d4004){var _0x19a744={};_0x19a744[_0x2d4004]={'$like':'%'+_0x5e7fc4[_0x0eaa('0x33')]['filter']+'%'};return _0x19a744;})});}_0x4e943e=_[_0x0eaa('0x3f')]({},_0x4e943e,_0x5e7fc4[_0x0eaa('0x41')]);return _0x5f0d10[_0x0eaa('0x4f')](_0x4e943e);}})[_0x0eaa('0x26')](function(_0x4b0c68){if(_0x4b0c68){_0x1bebdd=_0x4b0c68[_0x0eaa('0x45')];if(!_0x5e7fc4[_0x0eaa('0x33')][_0x0eaa('0x4d')](_0x0eaa('0x39'))){_0x4e943e['limit']=qs[_0x0eaa('0x1f')](_0x5e7fc4[_0x0eaa('0x33')][_0x0eaa('0x1f')]);_0x4e943e[_0x0eaa('0x1e')]=qs[_0x0eaa('0x1e')](_0x5e7fc4[_0x0eaa('0x33')][_0x0eaa('0x1e')]);}return _0x5f0d10[_0x0eaa('0x4f')](_0x4e943e);}})[_0x0eaa('0x26')](function(_0x2d5783){if(_0x2d5783){return _0x2d5783?{'count':_0x1bebdd,'rows':_0x2d5783}:null;}})['then'](respondWithResult(_0xd7b6ae,null))['catch'](handleError(_0xd7b6ae,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 5907122..caf4486 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 _0x5447=['SugarcrmConfiguration','int_sugarcrm_configurations','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x39abce,_0x444cc1){var _0x178049=function(_0x3b1034){while(--_0x3b1034){_0x39abce['push'](_0x39abce['shift']());}};_0x178049(++_0x444cc1);}(_0x5447,0x1a6));var _0x7544=function(_0x4aba67,_0x17a028){_0x4aba67=_0x4aba67-0x0;var _0x321ead=_0x5447[_0x4aba67];return _0x321ead;};'use strict';var _=require('lodash');var util=require(_0x7544('0x0'));var logger=require('../../config/logger')(_0x7544('0x1'));var moment=require('moment');var BPromise=require(_0x7544('0x2'));var rp=require(_0x7544('0x3'));var fs=require('fs');var path=require(_0x7544('0x4'));var rimraf=require(_0x7544('0x5'));var config=require(_0x7544('0x6'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x7544('0x7')]=function(_0x12ce8f,_0x3bab04){return _0x12ce8f['define'](_0x7544('0x8'),attributes,{'tableName':_0x7544('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe02c=['int_sugarcrm_configurations','lodash','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define'];(function(_0x1acdd7,_0x33e463){var _0x261e0b=function(_0x250807){while(--_0x250807){_0x1acdd7['push'](_0x1acdd7['shift']());}};_0x261e0b(++_0x33e463);}(_0xe02c,0x123));var _0xce02=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe02c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xce02('0x0'));var util=require('util');var logger=require(_0xce02('0x1'))('api');var moment=require('moment');var BPromise=require(_0xce02('0x2'));var rp=require(_0xce02('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xce02('0x4'));var config=require(_0xce02('0x5'));var attributes=require(_0xce02('0x6'));module[_0xce02('0x7')]=function(_0x6cd60f,_0x2eb47d){return _0x6cd60f[_0xce02('0x8')]('SugarcrmConfiguration',attributes,{'tableName':_0xce02('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 2531d21..7a966f1 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 _0x7e12=['SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug'];(function(_0x525ff3,_0x2882e1){var _0x24793f=function(_0x16d84f){while(--_0x16d84f){_0x525ff3['push'](_0x525ff3['shift']());}};_0x24793f(++_0x2882e1);}(_0x7e12,0x157));var _0x27e1=function(_0x16de68,_0x33d7ff){_0x16de68=_0x16de68-0x0;var _0x1c277e=_0x7e12[_0x16de68];return _0x1c277e;};'use strict';var _=require('lodash');var util=require(_0x27e1('0x0'));var moment=require(_0x27e1('0x1'));var BPromise=require(_0x27e1('0x2'));var rs=require(_0x27e1('0x3'));var fs=require('fs');var Redis=require(_0x27e1('0x4'));var db=require(_0x27e1('0x5'))['db'];var utils=require(_0x27e1('0x6'));var logger=require(_0x27e1('0x7'))(_0x27e1('0x8'));var config=require('../../config/environment');var jayson=require(_0x27e1('0x9'));var client=jayson[_0x27e1('0xa')][_0x27e1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x20bdbf,_0x520b0f,_0x198dca){return new BPromise(function(_0x15c231,_0x4c9839){return client[_0x27e1('0xc')](_0x20bdbf,_0x198dca)[_0x27e1('0xd')](function(_0x1d48ee){logger[_0x27e1('0xe')](_0x27e1('0xf'),_0x520b0f,'request\x20sent');logger[_0x27e1('0x10')](_0x27e1('0x11'),_0x520b0f,'request\x20sent',JSON[_0x27e1('0x12')](_0x1d48ee));if(_0x1d48ee[_0x27e1('0x13')]){if(_0x1d48ee[_0x27e1('0x13')]['code']===0x1f4){logger[_0x27e1('0x13')](_0x27e1('0xf'),_0x520b0f,_0x1d48ee[_0x27e1('0x13')][_0x27e1('0x14')]);return _0x4c9839(_0x1d48ee[_0x27e1('0x13')]['message']);}logger[_0x27e1('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x520b0f,_0x1d48ee[_0x27e1('0x13')][_0x27e1('0x14')]);return _0x15c231(_0x1d48ee['error'][_0x27e1('0x14')]);}else{logger[_0x27e1('0xe')](_0x27e1('0xf'),_0x520b0f,_0x27e1('0x15'));_0x15c231(_0x1d48ee[_0x27e1('0x16')]['message']);}})[_0x27e1('0x17')](function(_0xa4a63c){logger[_0x27e1('0x13')](_0x27e1('0xf'),_0x520b0f,_0xa4a63c);_0x4c9839(_0xa4a63c);});});} \ No newline at end of file +var _0x237a=['error','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5cae8d,_0x56a7b2){var _0x100637=function(_0x5c8751){while(--_0x5c8751){_0x5cae8d['push'](_0x5cae8d['shift']());}};_0x100637(++_0x56a7b2);}(_0x237a,0x143));var _0xa237=function(_0x14a194,_0x8a1db5){_0x14a194=_0x14a194-0x0;var _0x1fd244=_0x237a[_0x14a194];return _0x1fd244;};'use strict';var _=require(_0xa237('0x0'));var util=require(_0xa237('0x1'));var moment=require(_0xa237('0x2'));var BPromise=require('bluebird');var rs=require(_0xa237('0x3'));var fs=require('fs');var Redis=require(_0xa237('0x4'));var db=require(_0xa237('0x5'))['db'];var utils=require(_0xa237('0x6'));var logger=require(_0xa237('0x7'))(_0xa237('0x8'));var config=require(_0xa237('0x9'));var jayson=require(_0xa237('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x35d26e,_0x15e35e,_0x3af8d1){return new BPromise(function(_0x2f8af0,_0x3213cc){return client[_0xa237('0xb')](_0x35d26e,_0x3af8d1)[_0xa237('0xc')](function(_0x3e5164){logger[_0xa237('0xd')](_0xa237('0xe'),_0x15e35e,_0xa237('0xf'));logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x15e35e,_0xa237('0xf'),JSON[_0xa237('0x10')](_0x3e5164));if(_0x3e5164['error']){if(_0x3e5164[_0xa237('0x11')]['code']===0x1f4){logger[_0xa237('0x11')](_0xa237('0xe'),_0x15e35e,_0x3e5164[_0xa237('0x11')][_0xa237('0x12')]);return _0x3213cc(_0x3e5164[_0xa237('0x11')][_0xa237('0x12')]);}logger[_0xa237('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x15e35e,_0x3e5164['error']['message']);return _0x2f8af0(_0x3e5164[_0xa237('0x11')][_0xa237('0x12')]);}else{logger[_0xa237('0xd')](_0xa237('0xe'),_0x15e35e,_0xa237('0xf'));_0x2f8af0(_0x3e5164[_0xa237('0x13')]['message']);}})['catch'](function(_0x59dfc6){logger[_0xa237('0x11')](_0xa237('0xe'),_0x15e35e,_0x59dfc6);_0x3213cc(_0x59dfc6);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index f100495..2b7c576 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 _0x3ba8=['show','post','create','put','update','delete','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','index','isAuthenticated'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3ba8,0x116));var _0x83ba=function(_0x32c54d,_0x1fab4c){_0x32c54d=_0x32c54d-0x0;var _0x1344ac=_0x3ba8[_0x32c54d];return _0x1344ac;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x83ba('0x0'));var timeout=require('connect-timeout');var express=require(_0x83ba('0x1'));var router=express[_0x83ba('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x83ba('0x3'));var interaction=require(_0x83ba('0x4'));var config=require(_0x83ba('0x5'));var controller=require(_0x83ba('0x6'));router[_0x83ba('0x7')]('/',auth['isAuthenticated'](),controller[_0x83ba('0x8')]);router[_0x83ba('0x7')]('/:id',auth[_0x83ba('0x9')](),controller[_0x83ba('0xa')]);router[_0x83ba('0xb')]('/',auth[_0x83ba('0x9')](),controller[_0x83ba('0xc')]);router[_0x83ba('0xd')]('/:id',auth[_0x83ba('0x9')](),controller[_0x83ba('0xe')]);router[_0x83ba('0xf')]('/:id',auth[_0x83ba('0x9')](),controller[_0x83ba('0x10')]);module[_0x83ba('0x11')]=router; \ No newline at end of file +var _0xb2ea=['../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x25063a,_0x1cc2d9){var _0x2d9a29=function(_0x21a8b7){while(--_0x21a8b7){_0x25063a['push'](_0x25063a['shift']());}};_0x2d9a29(++_0x1cc2d9);}(_0xb2ea,0x135));var _0xab2e=function(_0x4b2037,_0x41055c){_0x4b2037=_0x4b2037-0x0;var _0x48599b=_0xb2ea[_0x4b2037];return _0x48599b;};'use strict';var multer=require('multer');var util=require(_0xab2e('0x0'));var path=require(_0xab2e('0x1'));var timeout=require(_0xab2e('0x2'));var express=require(_0xab2e('0x3'));var router=express[_0xab2e('0x4')]();var fs_extra=require(_0xab2e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xab2e('0x6'));var config=require(_0xab2e('0x7'));var controller=require(_0xab2e('0x8'));router[_0xab2e('0x9')]('/',auth[_0xab2e('0xa')](),controller[_0xab2e('0xb')]);router[_0xab2e('0x9')](_0xab2e('0xc'),auth[_0xab2e('0xa')](),controller[_0xab2e('0xd')]);router[_0xab2e('0xe')]('/',auth[_0xab2e('0xa')](),controller[_0xab2e('0xf')]);router[_0xab2e('0x10')](_0xab2e('0xc'),auth[_0xab2e('0xa')](),controller[_0xab2e('0x11')]);router[_0xab2e('0x12')](_0xab2e('0xc'),auth[_0xab2e('0xa')](),controller[_0xab2e('0x13')]);module[_0xab2e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 366e9a0..d131c14 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 _0xd6dd=['ENUM','variable','customVariable','keyValue','picklist','string','STRING','sequelize','exports'];(function(_0x5f335f,_0x5ac3aa){var _0x44744a=function(_0x559cbe){while(--_0x559cbe){_0x5f335f['push'](_0x5f335f['shift']());}};_0x44744a(++_0x5ac3aa);}(_0xd6dd,0xc4));var _0xdd6d=function(_0x3cfb0d,_0x4df584){_0x3cfb0d=_0x3cfb0d-0x0;var _0x3486b4=_0xd6dd[_0x3cfb0d];return _0x3486b4;};'use strict';var Sequelize=require(_0xdd6d('0x0'));module[_0xdd6d('0x1')]={'type':{'type':Sequelize[_0xdd6d('0x2')]('string',_0xdd6d('0x3'),_0xdd6d('0x4'),_0xdd6d('0x5'),_0xdd6d('0x6')),'defaultValue':_0xdd6d('0x7')},'content':{'type':Sequelize[_0xdd6d('0x8')]},'key':{'type':Sequelize[_0xdd6d('0x8')]},'keyType':{'type':Sequelize[_0xdd6d('0x2')]('string',_0xdd6d('0x3'),_0xdd6d('0x4'))},'keyContent':{'type':Sequelize[_0xdd6d('0x8')]},'idField':{'type':Sequelize[_0xdd6d('0x8')]},'nameField':{'type':Sequelize[_0xdd6d('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdd6d('0x8')]}}; \ No newline at end of file +var _0xc662=['string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc662,0x1c5));var _0x2c66=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xc662[_0x3b5250];return _0xc844a1;};'use strict';var Sequelize=require(_0x2c66('0x0'));module[_0x2c66('0x1')]={'type':{'type':Sequelize[_0x2c66('0x2')]('string',_0x2c66('0x3'),_0x2c66('0x4'),_0x2c66('0x5'),_0x2c66('0x6')),'defaultValue':_0x2c66('0x7')},'content':{'type':Sequelize[_0x2c66('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2c66('0x2')](_0x2c66('0x7'),_0x2c66('0x3'),_0x2c66('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2c66('0x8')]},'nameField':{'type':Sequelize[_0x2c66('0x8')]},'customField':{'type':Sequelize[_0x2c66('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2c66('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index d18eae6..8a093eb 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 _0x2e07=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SugarcrmField','rawAttributes','type','model','query','keys','filters','intersection','attributes'];(function(_0x2e0fb8,_0x489160){var _0x212b1b=function(_0x2bb946){while(--_0x2bb946){_0x2e0fb8['push'](_0x2e0fb8['shift']());}};_0x212b1b(++_0x489160);}(_0x2e07,0x64));var _0x72e0=function(_0x4a2f39,_0x37fd97){_0x4a2f39=_0x4a2f39-0x0;var _0xe874fa=_0x2e07[_0x4a2f39];return _0xe874fa;};'use strict';var emlformat=require(_0x72e0('0x0'));var rimraf=require(_0x72e0('0x1'));var zipdir=require(_0x72e0('0x2'));var jsonpatch=require(_0x72e0('0x3'));var rp=require(_0x72e0('0x4'));var moment=require(_0x72e0('0x5'));var BPromise=require(_0x72e0('0x6'));var Mustache=require('mustache');var util=require(_0x72e0('0x7'));var path=require(_0x72e0('0x8'));var sox=require(_0x72e0('0x9'));var csv=require(_0x72e0('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x72e0('0xb'));var _=require(_0x72e0('0xc'));var squel=require('squel');var crypto=require(_0x72e0('0xd'));var jsforce=require(_0x72e0('0xe'));var deskjs=require(_0x72e0('0xf'));var toCsv=require(_0x72e0('0xa'));var querystring=require(_0x72e0('0x10'));var Papa=require(_0x72e0('0x11'));var Redis=require(_0x72e0('0x12'));var authService=require(_0x72e0('0x13'));var qs=require(_0x72e0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72e0('0x15'));var logger=require(_0x72e0('0x16'))(_0x72e0('0x17'));var utils=require(_0x72e0('0x18'));var config=require(_0x72e0('0x19'));var licenseUtil=require(_0x72e0('0x1a'));var db=require(_0x72e0('0x1b'))['db'];function respondWithStatusCode(_0x56ea65,_0x3637df){_0x3637df=_0x3637df||0xcc;return function(_0x29bba3){if(_0x29bba3){return _0x56ea65[_0x72e0('0x1c')](_0x3637df);}return _0x56ea65['status'](_0x3637df)[_0x72e0('0x1d')]();};}function respondWithResult(_0x297ee5,_0x258b6c){_0x258b6c=_0x258b6c||0xc8;return function(_0x2dd6c6){if(_0x2dd6c6){return _0x297ee5[_0x72e0('0x1e')](_0x258b6c)['json'](_0x2dd6c6);}};}function respondWithFilteredResult(_0x3705d6,_0x4ee366){return function(_0x3a3066){if(_0x3a3066){var _0x323776=typeof _0x4ee366[_0x72e0('0x1f')]===_0x72e0('0x20')&&typeof _0x4ee366[_0x72e0('0x21')]===_0x72e0('0x20');var _0x167904=_0x3a3066[_0x72e0('0x22')];var _0x3a62cf=_0x323776?0x0:_0x4ee366[_0x72e0('0x1f')];var _0x4a83cc=_0x323776?_0x3a3066[_0x72e0('0x22')]:_0x4ee366[_0x72e0('0x1f')]+_0x4ee366[_0x72e0('0x21')];var _0x2d5d6b;if(_0x4a83cc>=_0x167904){_0x4a83cc=_0x167904;_0x2d5d6b=0xc8;}else{_0x2d5d6b=0xce;}_0x3705d6[_0x72e0('0x1e')](_0x2d5d6b);return _0x3705d6[_0x72e0('0x23')]('Content-Range',_0x3a62cf+'-'+_0x4a83cc+'/'+_0x167904)[_0x72e0('0x24')](_0x3a3066);}return null;};}function patchUpdates(_0x414683){return function(_0x42b197){try{jsonpatch[_0x72e0('0x25')](_0x42b197,_0x414683,!![]);}catch(_0x1f12b7){return BPromise[_0x72e0('0x26')](_0x1f12b7);}return _0x42b197[_0x72e0('0x27')]();};}function saveUpdates(_0x4ec73d,_0x5c190b){return function(_0x1d8918){if(_0x1d8918){return _0x1d8918[_0x72e0('0x28')](_0x4ec73d)[_0x72e0('0x29')](function(_0x9cc7ee){return _0x9cc7ee;});}return null;};}function removeEntity(_0x380a45,_0x252134){return function(_0x564a69){if(_0x564a69){return _0x564a69[_0x72e0('0x2a')]()['then'](function(){_0x380a45[_0x72e0('0x1e')](0xcc)[_0x72e0('0x1d')]();});}};}function handleEntityNotFound(_0x1ec62f,_0x2b78db){return function(_0xf62c2c){if(!_0xf62c2c){_0x1ec62f[_0x72e0('0x1c')](0x194);}return _0xf62c2c;};}function handleError(_0x4e18bb,_0x2aedd0){_0x2aedd0=_0x2aedd0||0x1f4;return function(_0x32fd3d){logger[_0x72e0('0x2b')](_0x32fd3d[_0x72e0('0x2c')]);if(_0x32fd3d[_0x72e0('0x2d')]){delete _0x32fd3d[_0x72e0('0x2d')];}_0x4e18bb['status'](_0x2aedd0)[_0x72e0('0x2e')](_0x32fd3d);};}exports[_0x72e0('0x2f')]=function(_0x5e9260,_0x9d9c06){var _0x8797d8={},_0x328150={},_0x267849={'count':0x0,'rows':[]};var _0x3d4f14=_[_0x72e0('0x30')](db[_0x72e0('0x31')][_0x72e0('0x32')],function(_0x5266ea){return{'name':_0x5266ea['fieldName'],'type':_0x5266ea[_0x72e0('0x33')]['key']};});_0x328150[_0x72e0('0x34')]=_[_0x72e0('0x30')](_0x3d4f14,'name');_0x328150[_0x72e0('0x35')]=_[_0x72e0('0x36')](_0x5e9260[_0x72e0('0x35')]);_0x328150[_0x72e0('0x37')]=_[_0x72e0('0x38')](_0x328150[_0x72e0('0x34')],_0x328150[_0x72e0('0x35')]);_0x8797d8[_0x72e0('0x39')]=_['intersection'](_0x328150[_0x72e0('0x34')],qs[_0x72e0('0x3a')](_0x5e9260[_0x72e0('0x35')][_0x72e0('0x3a')]));_0x8797d8[_0x72e0('0x39')]=_0x8797d8['attributes'][_0x72e0('0x3b')]?_0x8797d8['attributes']:_0x328150['model'];if(!_0x5e9260['query'][_0x72e0('0x3c')](_0x72e0('0x3d'))){_0x8797d8[_0x72e0('0x21')]=qs[_0x72e0('0x21')](_0x5e9260['query'][_0x72e0('0x21')]);_0x8797d8[_0x72e0('0x1f')]=qs[_0x72e0('0x1f')](_0x5e9260[_0x72e0('0x35')][_0x72e0('0x1f')]);}_0x8797d8[_0x72e0('0x3e')]=qs[_0x72e0('0x3f')](_0x5e9260['query'][_0x72e0('0x3f')]);_0x8797d8[_0x72e0('0x40')]=qs[_0x72e0('0x37')](_[_0x72e0('0x41')](_0x5e9260[_0x72e0('0x35')],_0x328150[_0x72e0('0x37')]),_0x3d4f14);if(_0x5e9260[_0x72e0('0x35')][_0x72e0('0x42')]){_0x8797d8[_0x72e0('0x40')]=_[_0x72e0('0x43')](_0x8797d8[_0x72e0('0x40')],{'$or':_['map'](_0x3d4f14,function(_0x4c8210){if(_0x4c8210[_0x72e0('0x33')]!==_0x72e0('0x44')){var _0x3390e4={};_0x3390e4[_0x4c8210[_0x72e0('0x2d')]]={'$like':'%'+_0x5e9260[_0x72e0('0x35')]['filter']+'%'};return _0x3390e4;}})});}_0x8797d8=_[_0x72e0('0x43')]({},_0x8797d8,_0x5e9260[_0x72e0('0x45')]);var _0x5489ad={'where':_0x8797d8['where']};return db[_0x72e0('0x31')]['count'](_0x5489ad)[_0x72e0('0x29')](function(_0x4823d2){_0x267849['count']=_0x4823d2;if(_0x5e9260[_0x72e0('0x35')]['includeAll']){_0x8797d8[_0x72e0('0x46')]=[{'all':!![]}];}return db[_0x72e0('0x31')][_0x72e0('0x47')](_0x8797d8);})[_0x72e0('0x29')](function(_0x2b05c8){_0x267849[_0x72e0('0x48')]=_0x2b05c8;return _0x267849;})[_0x72e0('0x29')](respondWithFilteredResult(_0x9d9c06,_0x8797d8))['catch'](handleError(_0x9d9c06,null));};exports[_0x72e0('0x49')]=function(_0x13a1f7,_0x5981e4){var _0x51ea0d={'raw':!![],'where':{'id':_0x13a1f7[_0x72e0('0x4a')]['id']}},_0x227120={};_0x227120[_0x72e0('0x34')]=_[_0x72e0('0x36')](db['SugarcrmField'][_0x72e0('0x32')]);_0x227120[_0x72e0('0x35')]=_[_0x72e0('0x36')](_0x13a1f7[_0x72e0('0x35')]);_0x227120[_0x72e0('0x37')]=_[_0x72e0('0x38')](_0x227120[_0x72e0('0x34')],_0x227120[_0x72e0('0x35')]);_0x51ea0d[_0x72e0('0x39')]=_['intersection'](_0x227120[_0x72e0('0x34')],qs[_0x72e0('0x3a')](_0x13a1f7['query'][_0x72e0('0x3a')]));_0x51ea0d[_0x72e0('0x39')]=_0x51ea0d[_0x72e0('0x39')]['length']?_0x51ea0d[_0x72e0('0x39')]:_0x227120[_0x72e0('0x34')];if(_0x13a1f7[_0x72e0('0x35')]['includeAll']){_0x51ea0d[_0x72e0('0x46')]=[{'all':!![]}];}_0x51ea0d=_[_0x72e0('0x43')]({},_0x51ea0d,_0x13a1f7[_0x72e0('0x45')]);return db['SugarcrmField'][_0x72e0('0x4b')](_0x51ea0d)[_0x72e0('0x29')](handleEntityNotFound(_0x5981e4,null))['then'](respondWithResult(_0x5981e4,null))[_0x72e0('0x4c')](handleError(_0x5981e4,null));};exports[_0x72e0('0x4d')]=function(_0x5d81e7,_0x3443c8){return db[_0x72e0('0x31')][_0x72e0('0x4d')](_0x5d81e7[_0x72e0('0x4e')],{})[_0x72e0('0x29')](respondWithResult(_0x3443c8,0xc9))[_0x72e0('0x4c')](handleError(_0x3443c8,null));};exports[_0x72e0('0x28')]=function(_0xcdd423,_0x2ec008){if(_0xcdd423[_0x72e0('0x4e')]['id']){delete _0xcdd423[_0x72e0('0x4e')]['id'];}return db['SugarcrmField'][_0x72e0('0x4b')]({'where':{'id':_0xcdd423['params']['id']}})[_0x72e0('0x29')](handleEntityNotFound(_0x2ec008,null))['then'](saveUpdates(_0xcdd423[_0x72e0('0x4e')],null))[_0x72e0('0x29')](respondWithResult(_0x2ec008,null))[_0x72e0('0x4c')](handleError(_0x2ec008,null));};exports[_0x72e0('0x2a')]=function(_0x2511ae,_0x3e584c){return db[_0x72e0('0x31')][_0x72e0('0x4b')]({'where':{'id':_0x2511ae[_0x72e0('0x4a')]['id']}})[_0x72e0('0x29')](handleEntityNotFound(_0x3e584c,null))[_0x72e0('0x29')](removeEntity(_0x3e584c,null))[_0x72e0('0x4c')](handleError(_0x3e584c,null));}; \ No newline at end of file +var _0x44b8=['then','destroy','sendStatus','error','stack','name','send','index','map','SugarcrmField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','include','findAll','catch','show','params','rawAttributes','includeAll','create','body','find','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update'];(function(_0x97c6ea,_0x4cffce){var _0x2d7f50=function(_0x54010e){while(--_0x54010e){_0x97c6ea['push'](_0x97c6ea['shift']());}};_0x2d7f50(++_0x4cffce);}(_0x44b8,0xba));var _0x844b=function(_0x287522,_0x367804){_0x287522=_0x287522-0x0;var _0x38c06a=_0x44b8[_0x287522];return _0x38c06a;};'use strict';var emlformat=require(_0x844b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x844b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x844b('0x2'));var moment=require('moment');var BPromise=require(_0x844b('0x3'));var Mustache=require(_0x844b('0x4'));var util=require(_0x844b('0x5'));var path=require(_0x844b('0x6'));var sox=require('sox');var csv=require(_0x844b('0x7'));var ejs=require(_0x844b('0x8'));var fs=require('fs');var fs_extra=require(_0x844b('0x9'));var _=require(_0x844b('0xa'));var squel=require(_0x844b('0xb'));var crypto=require(_0x844b('0xc'));var jsforce=require(_0x844b('0xd'));var deskjs=require(_0x844b('0xe'));var toCsv=require(_0x844b('0x7'));var querystring=require(_0x844b('0xf'));var Papa=require(_0x844b('0x10'));var Redis=require(_0x844b('0x11'));var authService=require(_0x844b('0x12'));var qs=require(_0x844b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x844b('0x14'));var logger=require(_0x844b('0x15'))(_0x844b('0x16'));var utils=require(_0x844b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x844b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x572a13,_0x1578f9){_0x1578f9=_0x1578f9||0xcc;return function(_0x410b8e){if(_0x410b8e){return _0x572a13['sendStatus'](_0x1578f9);}return _0x572a13[_0x844b('0x19')](_0x1578f9)[_0x844b('0x1a')]();};}function respondWithResult(_0x2ce7a6,_0x252ca5){_0x252ca5=_0x252ca5||0xc8;return function(_0x4d9523){if(_0x4d9523){return _0x2ce7a6[_0x844b('0x19')](_0x252ca5)[_0x844b('0x1b')](_0x4d9523);}};}function respondWithFilteredResult(_0x2d2afc,_0x19c40d){return function(_0x37528e){if(_0x37528e){var _0x2ff735=typeof _0x19c40d['offset']==='undefined'&&typeof _0x19c40d[_0x844b('0x1c')]==='undefined';var _0x1111c1=_0x37528e[_0x844b('0x1d')];var _0x515958=_0x2ff735?0x0:_0x19c40d[_0x844b('0x1e')];var _0x535e15=_0x2ff735?_0x37528e['count']:_0x19c40d[_0x844b('0x1e')]+_0x19c40d[_0x844b('0x1c')];var _0xa7decd;if(_0x535e15>=_0x1111c1){_0x535e15=_0x1111c1;_0xa7decd=0xc8;}else{_0xa7decd=0xce;}_0x2d2afc[_0x844b('0x19')](_0xa7decd);return _0x2d2afc['set'](_0x844b('0x1f'),_0x515958+'-'+_0x535e15+'/'+_0x1111c1)[_0x844b('0x1b')](_0x37528e);}return null;};}function patchUpdates(_0x4ee8e3){return function(_0x39422f){try{jsonpatch[_0x844b('0x20')](_0x39422f,_0x4ee8e3,!![]);}catch(_0x2d9236){return BPromise[_0x844b('0x21')](_0x2d9236);}return _0x39422f[_0x844b('0x22')]();};}function saveUpdates(_0x13d339,_0x2cd4ce){return function(_0x2bd0fb){if(_0x2bd0fb){return _0x2bd0fb[_0x844b('0x23')](_0x13d339)[_0x844b('0x24')](function(_0x306fac){return _0x306fac;});}return null;};}function removeEntity(_0x45ded2,_0x34ccc0){return function(_0x44baae){if(_0x44baae){return _0x44baae[_0x844b('0x25')]()[_0x844b('0x24')](function(){_0x45ded2[_0x844b('0x19')](0xcc)[_0x844b('0x1a')]();});}};}function handleEntityNotFound(_0x2936b8,_0x54aaf4){return function(_0x1481df){if(!_0x1481df){_0x2936b8[_0x844b('0x26')](0x194);}return _0x1481df;};}function handleError(_0x2510fe,_0x8b6a5c){_0x8b6a5c=_0x8b6a5c||0x1f4;return function(_0x35d7cb){logger[_0x844b('0x27')](_0x35d7cb[_0x844b('0x28')]);if(_0x35d7cb['name']){delete _0x35d7cb[_0x844b('0x29')];}_0x2510fe[_0x844b('0x19')](_0x8b6a5c)[_0x844b('0x2a')](_0x35d7cb);};}exports[_0x844b('0x2b')]=function(_0x1fb44a,_0x252b99){var _0x106834={},_0x54c3fc={},_0x65c575={'count':0x0,'rows':[]};var _0x4b757a=_[_0x844b('0x2c')](db[_0x844b('0x2d')]['rawAttributes'],function(_0x4248d6){return{'name':_0x4248d6[_0x844b('0x2e')],'type':_0x4248d6[_0x844b('0x2f')][_0x844b('0x30')]};});_0x54c3fc[_0x844b('0x31')]=_['map'](_0x4b757a,_0x844b('0x29'));_0x54c3fc[_0x844b('0x32')]=_[_0x844b('0x33')](_0x1fb44a[_0x844b('0x32')]);_0x54c3fc[_0x844b('0x34')]=_[_0x844b('0x35')](_0x54c3fc[_0x844b('0x31')],_0x54c3fc[_0x844b('0x32')]);_0x106834[_0x844b('0x36')]=_[_0x844b('0x35')](_0x54c3fc['model'],qs[_0x844b('0x37')](_0x1fb44a['query'][_0x844b('0x37')]));_0x106834['attributes']=_0x106834[_0x844b('0x36')][_0x844b('0x38')]?_0x106834['attributes']:_0x54c3fc[_0x844b('0x31')];if(!_0x1fb44a[_0x844b('0x32')]['hasOwnProperty']('nolimit')){_0x106834[_0x844b('0x1c')]=qs['limit'](_0x1fb44a[_0x844b('0x32')][_0x844b('0x1c')]);_0x106834[_0x844b('0x1e')]=qs[_0x844b('0x1e')](_0x1fb44a[_0x844b('0x32')][_0x844b('0x1e')]);}_0x106834[_0x844b('0x39')]=qs['sort'](_0x1fb44a[_0x844b('0x32')][_0x844b('0x3a')]);_0x106834[_0x844b('0x3b')]=qs[_0x844b('0x34')](_[_0x844b('0x3c')](_0x1fb44a['query'],_0x54c3fc[_0x844b('0x34')]),_0x4b757a);if(_0x1fb44a[_0x844b('0x32')][_0x844b('0x3d')]){_0x106834[_0x844b('0x3b')]=_[_0x844b('0x3e')](_0x106834['where'],{'$or':_[_0x844b('0x2c')](_0x4b757a,function(_0x301530){if(_0x301530[_0x844b('0x2f')]!=='VIRTUAL'){var _0x6aca57={};_0x6aca57[_0x301530[_0x844b('0x29')]]={'$like':'%'+_0x1fb44a[_0x844b('0x32')][_0x844b('0x3d')]+'%'};return _0x6aca57;}})});}_0x106834=_['merge']({},_0x106834,_0x1fb44a[_0x844b('0x3f')]);var _0x3a072a={'where':_0x106834['where']};return db[_0x844b('0x2d')][_0x844b('0x1d')](_0x3a072a)[_0x844b('0x24')](function(_0x432e9e){_0x65c575[_0x844b('0x1d')]=_0x432e9e;if(_0x1fb44a[_0x844b('0x32')]['includeAll']){_0x106834[_0x844b('0x40')]=[{'all':!![]}];}return db[_0x844b('0x2d')][_0x844b('0x41')](_0x106834);})[_0x844b('0x24')](function(_0x469d43){_0x65c575['rows']=_0x469d43;return _0x65c575;})['then'](respondWithFilteredResult(_0x252b99,_0x106834))[_0x844b('0x42')](handleError(_0x252b99,null));};exports[_0x844b('0x43')]=function(_0x43373e,_0x445fc2){var _0x38dbb8={'raw':!![],'where':{'id':_0x43373e[_0x844b('0x44')]['id']}},_0x5b2d42={};_0x5b2d42['model']=_[_0x844b('0x33')](db[_0x844b('0x2d')][_0x844b('0x45')]);_0x5b2d42[_0x844b('0x32')]=_[_0x844b('0x33')](_0x43373e[_0x844b('0x32')]);_0x5b2d42['filters']=_['intersection'](_0x5b2d42['model'],_0x5b2d42[_0x844b('0x32')]);_0x38dbb8[_0x844b('0x36')]=_[_0x844b('0x35')](_0x5b2d42['model'],qs[_0x844b('0x37')](_0x43373e['query'][_0x844b('0x37')]));_0x38dbb8[_0x844b('0x36')]=_0x38dbb8['attributes'][_0x844b('0x38')]?_0x38dbb8[_0x844b('0x36')]:_0x5b2d42[_0x844b('0x31')];if(_0x43373e[_0x844b('0x32')][_0x844b('0x46')]){_0x38dbb8['include']=[{'all':!![]}];}_0x38dbb8=_['merge']({},_0x38dbb8,_0x43373e['options']);return db[_0x844b('0x2d')]['find'](_0x38dbb8)['then'](handleEntityNotFound(_0x445fc2,null))['then'](respondWithResult(_0x445fc2,null))[_0x844b('0x42')](handleError(_0x445fc2,null));};exports['create']=function(_0x54a623,_0x553867){return db[_0x844b('0x2d')][_0x844b('0x47')](_0x54a623[_0x844b('0x48')],{})[_0x844b('0x24')](respondWithResult(_0x553867,0xc9))['catch'](handleError(_0x553867,null));};exports[_0x844b('0x23')]=function(_0x46e2ef,_0x3000a9){if(_0x46e2ef[_0x844b('0x48')]['id']){delete _0x46e2ef[_0x844b('0x48')]['id'];}return db[_0x844b('0x2d')][_0x844b('0x49')]({'where':{'id':_0x46e2ef[_0x844b('0x44')]['id']}})[_0x844b('0x24')](handleEntityNotFound(_0x3000a9,null))[_0x844b('0x24')](saveUpdates(_0x46e2ef['body'],null))[_0x844b('0x24')](respondWithResult(_0x3000a9,null))[_0x844b('0x42')](handleError(_0x3000a9,null));};exports[_0x844b('0x25')]=function(_0x1d49cc,_0x350133){return db[_0x844b('0x2d')][_0x844b('0x49')]({'where':{'id':_0x1d49cc[_0x844b('0x44')]['id']}})[_0x844b('0x24')](handleEntityNotFound(_0x350133,null))[_0x844b('0x24')](removeEntity(_0x350133,null))[_0x844b('0x42')](handleError(_0x350133,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index f95173a..211d5a4 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 _0xe792=['SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','lodash','util','../../config/logger','api','path','../../config/environment','./intSugarcrmField.attributes','exports','define'];(function(_0x45be57,_0x4313f3){var _0x4cef38=function(_0x26b560){while(--_0x26b560){_0x45be57['push'](_0x45be57['shift']());}};_0x4cef38(++_0x4313f3);}(_0xe792,0xa0));var _0x2e79=function(_0x597d92,_0x7b0ab2){_0x597d92=_0x597d92-0x0;var _0x8a163d=_0xe792[_0x597d92];return _0x8a163d;};'use strict';var _=require(_0x2e79('0x0'));var util=require(_0x2e79('0x1'));var logger=require(_0x2e79('0x2'))(_0x2e79('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e79('0x4'));var rimraf=require('rimraf');var config=require(_0x2e79('0x5'));var attributes=require(_0x2e79('0x6'));module[_0x2e79('0x7')]=function(_0x539b6a,_0x515972){return _0x539b6a[_0x2e79('0x8')](_0x2e79('0x9'),attributes,{'tableName':_0x2e79('0xa'),'paranoid':![],'indexes':[{'name':_0x2e79('0xb'),'fields':[_0x2e79('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x400d=['rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x400d,0x179));var _0xd400=function(_0x3575ed,_0x3294bb){_0x3575ed=_0x3575ed-0x0;var _0x36cb29=_0x400d[_0x3575ed];return _0x36cb29;};'use strict';var _=require(_0xd400('0x0'));var util=require(_0xd400('0x1'));var logger=require(_0xd400('0x2'))('api');var moment=require(_0xd400('0x3'));var BPromise=require(_0xd400('0x4'));var rp=require(_0xd400('0x5'));var fs=require('fs');var path=require(_0xd400('0x6'));var rimraf=require(_0xd400('0x7'));var config=require(_0xd400('0x8'));var attributes=require(_0xd400('0x9'));module[_0xd400('0xa')]=function(_0x43e7b5,_0x26ef37){return _0x43e7b5[_0xd400('0xb')](_0xd400('0xc'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xd400('0xd'),'fields':[_0xd400('0xe'),_0xd400('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 c25dd98..46c9bd2 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 _0x2b46=['stringify','error','code','SugarcrmField,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s'];(function(_0x15497f,_0x15ecb3){var _0x3dff4e=function(_0x539f9c){while(--_0x539f9c){_0x15497f['push'](_0x15497f['shift']());}};_0x3dff4e(++_0x15ecb3);}(_0x2b46,0x125));var _0x62b4=function(_0x275da0,_0x39bdcd){_0x275da0=_0x275da0-0x0;var _0x4f65c3=_0x2b46[_0x275da0];return _0x4f65c3;};'use strict';var _=require(_0x62b4('0x0'));var util=require(_0x62b4('0x1'));var moment=require(_0x62b4('0x2'));var BPromise=require(_0x62b4('0x3'));var rs=require(_0x62b4('0x4'));var fs=require('fs');var Redis=require(_0x62b4('0x5'));var db=require(_0x62b4('0x6'))['db'];var utils=require(_0x62b4('0x7'));var logger=require(_0x62b4('0x8'))(_0x62b4('0x9'));var config=require(_0x62b4('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x62b4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40e6ec,_0x118385,_0x271362){return new BPromise(function(_0x59ddc6,_0x48ea9d){return client['request'](_0x40e6ec,_0x271362)['then'](function(_0x365c7f){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x118385,_0x62b4('0xc'));logger[_0x62b4('0xd')](_0x62b4('0xe'),_0x118385,_0x62b4('0xc'),JSON[_0x62b4('0xf')](_0x365c7f));if(_0x365c7f['error']){if(_0x365c7f[_0x62b4('0x10')][_0x62b4('0x11')]===0x1f4){logger['error'](_0x62b4('0x12'),_0x118385,_0x365c7f[_0x62b4('0x10')][_0x62b4('0x13')]);return _0x48ea9d(_0x365c7f[_0x62b4('0x10')][_0x62b4('0x13')]);}logger['error'](_0x62b4('0x12'),_0x118385,_0x365c7f[_0x62b4('0x10')]['message']);return _0x59ddc6(_0x365c7f[_0x62b4('0x10')][_0x62b4('0x13')]);}else{logger[_0x62b4('0x14')](_0x62b4('0x12'),_0x118385,_0x62b4('0xc'));_0x59ddc6(_0x365c7f['result'][_0x62b4('0x13')]);}})[_0x62b4('0x15')](function(_0x1e010e){logger[_0x62b4('0x10')](_0x62b4('0x12'),_0x118385,_0x1e010e);_0x48ea9d(_0x1e010e);});});} \ No newline at end of file +var _0x6d5c=['client','http','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x333798,_0x9f6561){var _0x389f4e=function(_0x193b28){while(--_0x193b28){_0x333798['push'](_0x333798['shift']());}};_0x389f4e(++_0x9f6561);}(_0x6d5c,0x161));var _0xc6d5=function(_0x5e4752,_0x392bf4){_0x5e4752=_0x5e4752-0x0;var _0x5ac578=_0x6d5c[_0x5e4752];return _0x5ac578;};'use strict';var _=require(_0xc6d5('0x0'));var util=require('util');var moment=require(_0xc6d5('0x1'));var BPromise=require(_0xc6d5('0x2'));var rs=require(_0xc6d5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc6d5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc6d5('0x5'))('rpc');var config=require(_0xc6d5('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc6d5('0x7')][_0xc6d5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x304d30,_0x2524f3,_0x4fa0fa){return new BPromise(function(_0x3c1f24,_0x5eac14){return client[_0xc6d5('0x9')](_0x304d30,_0x4fa0fa)['then'](function(_0x3de732){logger[_0xc6d5('0xa')](_0xc6d5('0xb'),_0x2524f3,_0xc6d5('0xc'));logger[_0xc6d5('0xd')](_0xc6d5('0xe'),_0x2524f3,_0xc6d5('0xc'),JSON[_0xc6d5('0xf')](_0x3de732));if(_0x3de732['error']){if(_0x3de732[_0xc6d5('0x10')]['code']===0x1f4){logger['error'](_0xc6d5('0xb'),_0x2524f3,_0x3de732['error']['message']);return _0x5eac14(_0x3de732['error'][_0xc6d5('0x11')]);}logger[_0xc6d5('0x10')](_0xc6d5('0xb'),_0x2524f3,_0x3de732['error'][_0xc6d5('0x11')]);return _0x3c1f24(_0x3de732[_0xc6d5('0x10')][_0xc6d5('0x11')]);}else{logger[_0xc6d5('0xa')](_0xc6d5('0xb'),_0x2524f3,_0xc6d5('0xc'));_0x3c1f24(_0x3de732[_0xc6d5('0x12')][_0xc6d5('0x11')]);}})[_0xc6d5('0x13')](function(_0x51c6d9){logger[_0xc6d5('0x10')](_0xc6d5('0xb'),_0x2524f3,_0x51c6d9);_0x5eac14(_0x51c6d9);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index d1ad9b0..2647f17 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 _0xb898=['getFields','post','put','/:id','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','get','index','isAuthenticated','show','/:id/configurations','/:id/fields'];(function(_0x2bacc6,_0x213dc5){var _0x2ac541=function(_0x581d41){while(--_0x581d41){_0x2bacc6['push'](_0x2bacc6['shift']());}};_0x2ac541(++_0x213dc5);}(_0xb898,0xa9));var _0x8b89=function(_0x5a1cc9,_0x28f54d){_0x5a1cc9=_0x5a1cc9-0x0;var _0x471761=_0xb898[_0x5a1cc9];return _0x471761;};'use strict';var multer=require(_0x8b89('0x0'));var util=require('util');var path=require(_0x8b89('0x1'));var timeout=require(_0x8b89('0x2'));var express=require(_0x8b89('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8b89('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intVtigerAccount.controller');router[_0x8b89('0x5')]('/',auth['isAuthenticated'](),controller[_0x8b89('0x6')]);router[_0x8b89('0x5')]('/:id',auth[_0x8b89('0x7')](),controller[_0x8b89('0x8')]);router[_0x8b89('0x5')](_0x8b89('0x9'),auth[_0x8b89('0x7')](),controller['getConfigurations']);router[_0x8b89('0x5')](_0x8b89('0xa'),auth[_0x8b89('0x7')](),controller[_0x8b89('0xb')]);router[_0x8b89('0xc')]('/',auth[_0x8b89('0x7')](),controller['create']);router[_0x8b89('0xc')](_0x8b89('0x9'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x8b89('0xd')](_0x8b89('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x8b89('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x8b89('0x10')]);module[_0x8b89('0x11')]=router; \ No newline at end of file +var _0x6f2d=['delete','destroy','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update'];(function(_0x2c13cf,_0x599899){var _0x2a95ac=function(_0x3490a3){while(--_0x3490a3){_0x2c13cf['push'](_0x2c13cf['shift']());}};_0x2a95ac(++_0x599899);}(_0x6f2d,0x182));var _0xd6f2=function(_0x2e0c27,_0x31ed73){_0x2e0c27=_0x2e0c27-0x0;var _0x2a785b=_0x6f2d[_0x2e0c27];return _0x2a785b;};'use strict';var multer=require(_0xd6f2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd6f2('0x1'));var express=require('express');var router=express[_0xd6f2('0x2')]();var fs_extra=require(_0xd6f2('0x3'));var auth=require(_0xd6f2('0x4'));var interaction=require(_0xd6f2('0x5'));var config=require(_0xd6f2('0x6'));var controller=require(_0xd6f2('0x7'));router[_0xd6f2('0x8')]('/',auth[_0xd6f2('0x9')](),controller[_0xd6f2('0xa')]);router[_0xd6f2('0x8')](_0xd6f2('0xb'),auth[_0xd6f2('0x9')](),controller[_0xd6f2('0xc')]);router[_0xd6f2('0x8')](_0xd6f2('0xd'),auth[_0xd6f2('0x9')](),controller[_0xd6f2('0xe')]);router[_0xd6f2('0x8')](_0xd6f2('0xf'),auth[_0xd6f2('0x9')](),controller[_0xd6f2('0x10')]);router[_0xd6f2('0x11')]('/',auth['isAuthenticated'](),controller[_0xd6f2('0x12')]);router[_0xd6f2('0x11')](_0xd6f2('0xd'),auth[_0xd6f2('0x9')](),controller[_0xd6f2('0x13')]);router[_0xd6f2('0x14')](_0xd6f2('0xb'),auth[_0xd6f2('0x9')](),controller[_0xd6f2('0x15')]);router[_0xd6f2('0x16')](_0xd6f2('0xb'),auth[_0xd6f2('0x9')](),controller[_0xd6f2('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 3c55dbd..e0a75cb 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 _0xdf18=['sequelize','STRING'];(function(_0x13ce6d,_0x5984bf){var _0x397a06=function(_0x57c4bf){while(--_0x57c4bf){_0x13ce6d['push'](_0x13ce6d['shift']());}};_0x397a06(++_0x5984bf);}(_0xdf18,0xe2));var _0x8df1=function(_0xb86549,_0x4fd63c){_0xb86549=_0xb86549-0x0;var _0x4853a8=_0xdf18[_0xb86549];return _0x4853a8;};'use strict';var Sequelize=require(_0x8df1('0x0'));module['exports']={'name':{'type':Sequelize[_0x8df1('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x8df1('0x1')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x8df1('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x8df1('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x8df1('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x2047=['exports','STRING','HelpDesk','sequelize'];(function(_0x3ce755,_0x5129fe){var _0x38c9cf=function(_0x2e1980){while(--_0x2e1980){_0x3ce755['push'](_0x3ce755['shift']());}};_0x38c9cf(++_0x5129fe);}(_0x2047,0xf7));var _0x7204=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x2047[_0x31e29a];return _0x32d892;};'use strict';var Sequelize=require(_0x7204('0x0'));module[_0x7204('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x7204('0x2')]},'username':{'type':Sequelize[_0x7204('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7204('0x3')},'remoteUri':{'type':Sequelize[_0x7204('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x7204('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x7204('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 48396dd..1897ed3 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 _0xac78=['Content-Range','apply','reject','update','then','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','filter','options','include','findAll','catch','show','keys','includeAll','find','create','body','params','destroy','VtigerConfiguration','length','getConfigurations','nolimit','AccountId','Subjects','getSubjects','channel','getDescriptions','VtigerField','Descriptions','md5','getFields','findOne','description','moduleName','remoteUri','serverUrl','username','accessKey','slice','substring','lastIndexOf','%s/webservice.php','getchallenge','success','POST','login','result','token','GET','describe','sessionName','owner','includes','remove','editable','false','picklist','picklistValues','label','log','vTiger\x20error:\x20','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x49fa22,_0x3a8ccb){var _0x4af7a1=function(_0x5010c3){while(--_0x5010c3){_0x49fa22['push'](_0x49fa22['shift']());}};_0x4af7a1(++_0x3a8ccb);}(_0xac78,0x150));var _0x8ac7=function(_0x59955a,_0xb56364){_0x59955a=_0x59955a-0x0;var _0x22e11f=_0xac78[_0x59955a];return _0x22e11f;};'use strict';var emlformat=require(_0x8ac7('0x0'));var rimraf=require(_0x8ac7('0x1'));var zipdir=require(_0x8ac7('0x2'));var jsonpatch=require(_0x8ac7('0x3'));var rp=require(_0x8ac7('0x4'));var moment=require('moment');var BPromise=require(_0x8ac7('0x5'));var Mustache=require(_0x8ac7('0x6'));var util=require(_0x8ac7('0x7'));var path=require(_0x8ac7('0x8'));var sox=require(_0x8ac7('0x9'));var csv=require(_0x8ac7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8ac7('0xb'));var _=require(_0x8ac7('0xc'));var squel=require(_0x8ac7('0xd'));var crypto=require(_0x8ac7('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8ac7('0xf'));var toCsv=require(_0x8ac7('0xa'));var querystring=require(_0x8ac7('0x10'));var Papa=require(_0x8ac7('0x11'));var Redis=require('ioredis');var authService=require(_0x8ac7('0x12'));var qs=require(_0x8ac7('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8ac7('0x14'));var logger=require(_0x8ac7('0x15'))(_0x8ac7('0x16'));var utils=require('../../config/utils');var config=require(_0x8ac7('0x17'));var licenseUtil=require(_0x8ac7('0x18'));var db=require(_0x8ac7('0x19'))['db'];var integrations=require(_0x8ac7('0x1a'));function respondWithStatusCode(_0x255052,_0x98f66e){_0x98f66e=_0x98f66e||0xcc;return function(_0x5d42be){if(_0x5d42be){return _0x255052[_0x8ac7('0x1b')](_0x98f66e);}return _0x255052[_0x8ac7('0x1c')](_0x98f66e)[_0x8ac7('0x1d')]();};}function respondWithResult(_0xa3d7fa,_0x3d90d8){_0x3d90d8=_0x3d90d8||0xc8;return function(_0x241322){if(_0x241322){return _0xa3d7fa['status'](_0x3d90d8)[_0x8ac7('0x1e')](_0x241322);}};}function respondWithFilteredResult(_0x1ca27,_0x14c1d7){return function(_0x2b361a){if(_0x2b361a){var _0x331a1e=typeof _0x14c1d7[_0x8ac7('0x1f')]===_0x8ac7('0x20')&&typeof _0x14c1d7[_0x8ac7('0x21')]===_0x8ac7('0x20');var _0x53e26f=_0x2b361a[_0x8ac7('0x22')];var _0x33d1e4=_0x331a1e?0x0:_0x14c1d7['offset'];var _0x2230ad=_0x331a1e?_0x2b361a[_0x8ac7('0x22')]:_0x14c1d7[_0x8ac7('0x1f')]+_0x14c1d7[_0x8ac7('0x21')];var _0x21870d;if(_0x2230ad>=_0x53e26f){_0x2230ad=_0x53e26f;_0x21870d=0xc8;}else{_0x21870d=0xce;}_0x1ca27[_0x8ac7('0x1c')](_0x21870d);return _0x1ca27[_0x8ac7('0x23')](_0x8ac7('0x24'),_0x33d1e4+'-'+_0x2230ad+'/'+_0x53e26f)[_0x8ac7('0x1e')](_0x2b361a);}return null;};}function patchUpdates(_0x213c2b){return function(_0x5d5c5e){try{jsonpatch[_0x8ac7('0x25')](_0x5d5c5e,_0x213c2b,!![]);}catch(_0x4b2679){return BPromise[_0x8ac7('0x26')](_0x4b2679);}return _0x5d5c5e['save']();};}function saveUpdates(_0x36f16c,_0xbc211c){return function(_0x37b1c8){if(_0x37b1c8){return _0x37b1c8[_0x8ac7('0x27')](_0x36f16c)[_0x8ac7('0x28')](function(_0x40c80a){return _0x40c80a;});}return null;};}function removeEntity(_0x21d3fc,_0x34685f){return function(_0x173ac9){if(_0x173ac9){return _0x173ac9['destroy']()[_0x8ac7('0x28')](function(){_0x21d3fc[_0x8ac7('0x1c')](0xcc)[_0x8ac7('0x1d')]();});}};}function handleEntityNotFound(_0xc8564f,_0x384106){return function(_0x43089f){if(!_0x43089f){_0xc8564f[_0x8ac7('0x1b')](0x194);}return _0x43089f;};}function handleError(_0x3dbb5a,_0x106418){_0x106418=_0x106418||0x1f4;return function(_0x351d22){logger['error'](_0x351d22[_0x8ac7('0x29')]);if(_0x351d22[_0x8ac7('0x2a')]){delete _0x351d22['name'];}_0x3dbb5a[_0x8ac7('0x1c')](_0x106418)[_0x8ac7('0x2b')](_0x351d22);};}exports[_0x8ac7('0x2c')]=function(_0x373367,_0x1b66f6){var _0xc65186={},_0x429c2d={},_0x50a68b={'count':0x0,'rows':[]};var _0x6e3ae8=_[_0x8ac7('0x2d')](db[_0x8ac7('0x2e')][_0x8ac7('0x2f')],function(_0x2fe1be){return{'name':_0x2fe1be[_0x8ac7('0x30')],'type':_0x2fe1be[_0x8ac7('0x31')][_0x8ac7('0x32')]};});_0x429c2d[_0x8ac7('0x33')]=_[_0x8ac7('0x2d')](_0x6e3ae8,_0x8ac7('0x2a'));_0x429c2d[_0x8ac7('0x34')]=_['keys'](_0x373367[_0x8ac7('0x34')]);_0x429c2d[_0x8ac7('0x35')]=_[_0x8ac7('0x36')](_0x429c2d[_0x8ac7('0x33')],_0x429c2d['query']);_0xc65186[_0x8ac7('0x37')]=_[_0x8ac7('0x36')](_0x429c2d['model'],qs[_0x8ac7('0x38')](_0x373367['query'][_0x8ac7('0x38')]));_0xc65186[_0x8ac7('0x37')]=_0xc65186[_0x8ac7('0x37')]['length']?_0xc65186['attributes']:_0x429c2d[_0x8ac7('0x33')];if(!_0x373367[_0x8ac7('0x34')][_0x8ac7('0x39')]('nolimit')){_0xc65186[_0x8ac7('0x21')]=qs[_0x8ac7('0x21')](_0x373367[_0x8ac7('0x34')][_0x8ac7('0x21')]);_0xc65186[_0x8ac7('0x1f')]=qs['offset'](_0x373367[_0x8ac7('0x34')]['offset']);}_0xc65186[_0x8ac7('0x3a')]=qs[_0x8ac7('0x3b')](_0x373367['query'][_0x8ac7('0x3b')]);_0xc65186[_0x8ac7('0x3c')]=qs[_0x8ac7('0x35')](_['pick'](_0x373367[_0x8ac7('0x34')],_0x429c2d[_0x8ac7('0x35')]),_0x6e3ae8);if(_0x373367[_0x8ac7('0x34')]['filter']){_0xc65186[_0x8ac7('0x3c')]=_[_0x8ac7('0x3d')](_0xc65186['where'],{'$or':_['map'](_0x6e3ae8,function(_0xd0affd){if(_0xd0affd[_0x8ac7('0x31')]!=='VIRTUAL'){var _0x1d412f={};_0x1d412f[_0xd0affd['name']]={'$like':'%'+_0x373367[_0x8ac7('0x34')][_0x8ac7('0x3e')]+'%'};return _0x1d412f;}})});}_0xc65186=_[_0x8ac7('0x3d')]({},_0xc65186,_0x373367[_0x8ac7('0x3f')]);var _0x2e4b94={'where':_0xc65186[_0x8ac7('0x3c')]};return db[_0x8ac7('0x2e')][_0x8ac7('0x22')](_0x2e4b94)['then'](function(_0x2e0a40){_0x50a68b[_0x8ac7('0x22')]=_0x2e0a40;if(_0x373367[_0x8ac7('0x34')]['includeAll']){_0xc65186[_0x8ac7('0x40')]=[{'all':!![]}];}return db[_0x8ac7('0x2e')][_0x8ac7('0x41')](_0xc65186);})[_0x8ac7('0x28')](function(_0x9c4e5f){_0x50a68b['rows']=_0x9c4e5f;return _0x50a68b;})[_0x8ac7('0x28')](respondWithFilteredResult(_0x1b66f6,_0xc65186))[_0x8ac7('0x42')](handleError(_0x1b66f6,null));};exports[_0x8ac7('0x43')]=function(_0x1390b2,_0x2599b0){var _0x2b2d55={'raw':![],'where':{'id':_0x1390b2['params']['id']}},_0x2fd85f={};_0x2fd85f['model']=_['keys'](db[_0x8ac7('0x2e')][_0x8ac7('0x2f')]);_0x2fd85f[_0x8ac7('0x34')]=_[_0x8ac7('0x44')](_0x1390b2['query']);_0x2fd85f['filters']=_[_0x8ac7('0x36')](_0x2fd85f[_0x8ac7('0x33')],_0x2fd85f[_0x8ac7('0x34')]);_0x2b2d55['attributes']=_['intersection'](_0x2fd85f['model'],qs[_0x8ac7('0x38')](_0x1390b2[_0x8ac7('0x34')][_0x8ac7('0x38')]));_0x2b2d55[_0x8ac7('0x37')]=_0x2b2d55[_0x8ac7('0x37')]['length']?_0x2b2d55[_0x8ac7('0x37')]:_0x2fd85f[_0x8ac7('0x33')];if(_0x1390b2[_0x8ac7('0x34')][_0x8ac7('0x45')]){_0x2b2d55[_0x8ac7('0x40')]=[{'all':!![]}];}_0x2b2d55=_['merge']({},_0x2b2d55,_0x1390b2[_0x8ac7('0x3f')]);return db[_0x8ac7('0x2e')][_0x8ac7('0x46')](_0x2b2d55)[_0x8ac7('0x28')](handleEntityNotFound(_0x2599b0,null))[_0x8ac7('0x28')](respondWithResult(_0x2599b0,null))[_0x8ac7('0x42')](handleError(_0x2599b0,null));};exports[_0x8ac7('0x47')]=function(_0x5310c4,_0x429502){return db[_0x8ac7('0x2e')]['create'](_0x5310c4[_0x8ac7('0x48')],{})['then'](respondWithResult(_0x429502,0xc9))[_0x8ac7('0x42')](handleError(_0x429502,null));};exports[_0x8ac7('0x27')]=function(_0x4077f5,_0x1913fe){if(_0x4077f5[_0x8ac7('0x48')]['id']){delete _0x4077f5[_0x8ac7('0x48')]['id'];}return db[_0x8ac7('0x2e')][_0x8ac7('0x46')]({'where':{'id':_0x4077f5[_0x8ac7('0x49')]['id']}})['then'](handleEntityNotFound(_0x1913fe,null))[_0x8ac7('0x28')](saveUpdates(_0x4077f5[_0x8ac7('0x48')],null))[_0x8ac7('0x28')](respondWithResult(_0x1913fe,null))['catch'](handleError(_0x1913fe,null));};exports[_0x8ac7('0x4a')]=function(_0x320a4a,_0x45e72a){return db[_0x8ac7('0x2e')][_0x8ac7('0x46')]({'where':{'id':_0x320a4a[_0x8ac7('0x49')]['id']}})['then'](handleEntityNotFound(_0x45e72a,null))[_0x8ac7('0x28')](removeEntity(_0x45e72a,null))[_0x8ac7('0x42')](handleError(_0x45e72a,null));};exports['getConfigurations']=function(_0x3e8ca3,_0x9fcf90,_0x3b65ce){var _0x4efe1a={};var _0x38ccb1={};var _0x411239;var _0x501bb4;return db[_0x8ac7('0x2e')]['findOne']({'where':{'id':_0x3e8ca3[_0x8ac7('0x49')]['id']}})['then'](handleEntityNotFound(_0x9fcf90,null))[_0x8ac7('0x28')](function(_0xde29b4){if(_0xde29b4){_0x411239=_0xde29b4;_0x38ccb1['model']=_[_0x8ac7('0x44')](db[_0x8ac7('0x4b')][_0x8ac7('0x2f')]);_0x38ccb1['query']=_['keys'](_0x3e8ca3[_0x8ac7('0x34')]);_0x38ccb1[_0x8ac7('0x35')]=_['intersection'](_0x38ccb1[_0x8ac7('0x33')],_0x38ccb1[_0x8ac7('0x34')]);_0x4efe1a['attributes']=_[_0x8ac7('0x36')](_0x38ccb1[_0x8ac7('0x33')],qs[_0x8ac7('0x38')](_0x3e8ca3[_0x8ac7('0x34')][_0x8ac7('0x38')]));_0x4efe1a[_0x8ac7('0x37')]=_0x4efe1a['attributes'][_0x8ac7('0x4c')]?_0x4efe1a['attributes']:_0x38ccb1[_0x8ac7('0x33')];_0x4efe1a[_0x8ac7('0x3a')]=qs[_0x8ac7('0x3b')](_0x3e8ca3[_0x8ac7('0x34')][_0x8ac7('0x3b')]);_0x4efe1a['where']=qs[_0x8ac7('0x35')](_['pick'](_0x3e8ca3[_0x8ac7('0x34')],_0x38ccb1[_0x8ac7('0x35')]));if(_0x3e8ca3[_0x8ac7('0x34')][_0x8ac7('0x3e')]){_0x4efe1a[_0x8ac7('0x3c')]=_['merge'](_0x4efe1a[_0x8ac7('0x3c')],{'$or':_[_0x8ac7('0x2d')](_0x4efe1a[_0x8ac7('0x37')],function(_0x513e66){var _0x756888={};_0x756888[_0x513e66]={'$like':'%'+_0x3e8ca3[_0x8ac7('0x34')][_0x8ac7('0x3e')]+'%'};return _0x756888;})});}_0x4efe1a=_[_0x8ac7('0x3d')]({},_0x4efe1a,_0x3e8ca3['options']);return _0x411239[_0x8ac7('0x4d')](_0x4efe1a);}})[_0x8ac7('0x28')](function(_0x43093c){if(_0x43093c){_0x501bb4=_0x43093c['length'];if(!_0x3e8ca3['query'][_0x8ac7('0x39')](_0x8ac7('0x4e'))){_0x4efe1a[_0x8ac7('0x21')]=qs[_0x8ac7('0x21')](_0x3e8ca3[_0x8ac7('0x34')]['limit']);_0x4efe1a[_0x8ac7('0x1f')]=qs[_0x8ac7('0x1f')](_0x3e8ca3[_0x8ac7('0x34')][_0x8ac7('0x1f')]);}return _0x411239[_0x8ac7('0x4d')](_0x4efe1a);}})[_0x8ac7('0x28')](function(_0x1f8daa){if(_0x1f8daa){return _0x1f8daa?{'count':_0x501bb4,'rows':_0x1f8daa}:null;}})[_0x8ac7('0x28')](respondWithResult(_0x9fcf90,null))['catch'](handleError(_0x9fcf90,null));};exports['addConfiguration']=function(_0x214e0b,_0x10a30e,_0x24d0f2){if(_0x214e0b['body']['id']){delete _0x214e0b[_0x8ac7('0x48')]['id'];}return db['VtigerAccount']['findOne']({'where':{'id':_0x214e0b['params']['id']}})[_0x8ac7('0x28')](handleEntityNotFound(_0x10a30e,null))[_0x8ac7('0x28')](function(_0x126bb4){if(_0x126bb4){_0x214e0b[_0x8ac7('0x48')][_0x8ac7('0x4f')]=_0x126bb4['id'];_0x214e0b[_0x8ac7('0x48')][_0x8ac7('0x50')]=integrations[_0x8ac7('0x51')](_0x214e0b[_0x8ac7('0x48')][_0x8ac7('0x52')],_0x214e0b[_0x8ac7('0x48')][_0x8ac7('0x31')]);_0x214e0b[_0x8ac7('0x48')]['Descriptions']=integrations[_0x8ac7('0x53')](_0x214e0b['body'][_0x8ac7('0x52')],_0x214e0b[_0x8ac7('0x48')][_0x8ac7('0x31')]);return db[_0x8ac7('0x4b')][_0x8ac7('0x47')](_0x214e0b[_0x8ac7('0x48')],{'include':[{'model':db[_0x8ac7('0x54')],'as':_0x8ac7('0x50')},{'model':db['VtigerField'],'as':_0x8ac7('0x55')}]});}return null;})[_0x8ac7('0x28')](respondWithResult(_0x10a30e,null))['catch'](handleError(_0x10a30e,null));};var md5=require(_0x8ac7('0x56'));exports[_0x8ac7('0x57')]=function(_0x4d61de,_0x4ce5cf,_0x23831b){var _0x30c31c=null;var _0xb3bcfd=null;var _0x15e6f1=null;var _0x1a21e6=null;var _0x452b4f='';return db[_0x8ac7('0x2e')][_0x8ac7('0x58')]({'where':{'id':_0x4d61de[_0x8ac7('0x49')]['id']},'attributes':['id',_0x8ac7('0x2a'),'username',_0x8ac7('0x59'),_0x8ac7('0x5a'),_0x8ac7('0x5b'),_0x8ac7('0x5c'),'accessKey']})[_0x8ac7('0x28')](handleEntityNotFound(_0x4ce5cf,null))[_0x8ac7('0x28')](function(_0x35f04f){if(_0x35f04f){_0x30c31c=_0x35f04f[_0x8ac7('0x5d')];_0xb3bcfd=_0x35f04f[_0x8ac7('0x5e')];_0x15e6f1=_0x35f04f[_0x8ac7('0x5a')];_0x452b4f=_0x35f04f[_0x8ac7('0x5b')];var _0x1e01ee=_0x452b4f[_0x8ac7('0x5f')](-0x1);if(_0x1e01ee==='/'){_0x452b4f=_0x452b4f[_0x8ac7('0x60')](0x0,_0x452b4f[_0x8ac7('0x61')](_0x1e01ee));}_0x1a21e6=util['format'](_0x8ac7('0x62'),_0x452b4f);var _0x2d7d4b={'method':'GET','uri':_0x1a21e6,'qs':{'operation':_0x8ac7('0x63'),'username':_0x35f04f[_0x8ac7('0x5d')]},'json':!![]};return rp(_0x2d7d4b);}})[_0x8ac7('0x28')](function(_0x24332c){if(_0x24332c[_0x8ac7('0x64')]){var _0x4d46bd={'method':_0x8ac7('0x65'),'uri':_0x1a21e6,'form':{'operation':_0x8ac7('0x66'),'username':_0x30c31c,'accessKey':md5(_0x24332c[_0x8ac7('0x67')][_0x8ac7('0x68')]+_0xb3bcfd)},'json':!![]};return rp(_0x4d46bd);}})[_0x8ac7('0x28')](function(_0x1e2c50){if(_0x1e2c50[_0x8ac7('0x64')]){var _0x10f1e0={'method':_0x8ac7('0x69'),'uri':_0x1a21e6,'qs':{'operation':_0x8ac7('0x6a'),'username':_0x30c31c,'sessionName':_0x1e2c50['result'][_0x8ac7('0x6b')],'elementType':_0x15e6f1},'json':!![]};return rp(_0x10f1e0);}})['then'](function(_0x1d6c4e){if(_0x1d6c4e[_0x8ac7('0x64')]){var _0x4692f6=['autogenerated','reference',_0x8ac7('0x6c')];_['remove'](_0x1d6c4e[_0x8ac7('0x67')][_0x8ac7('0x38')],function(_0x21db3c){return _0x4692f6[_0x8ac7('0x6d')](_0x21db3c[_0x8ac7('0x31')]['name']);});_[_0x8ac7('0x6e')](_0x1d6c4e[_0x8ac7('0x67')][_0x8ac7('0x38')],function(_0x44444c){return _0x44444c[_0x8ac7('0x6f')]===_0x8ac7('0x70');});return{'count':_0x1d6c4e[_0x8ac7('0x67')][_0x8ac7('0x38')][_0x8ac7('0x4c')],'rows':_['map'](_0x1d6c4e[_0x8ac7('0x67')][_0x8ac7('0x38')],function(_0x212299){return{'id':_0x212299[_0x8ac7('0x2a')],'name':_0x212299['label'],'custom':_['startsWith'](_0x212299[_0x8ac7('0x2a')],'cf_')?!![]:![],'options':_0x212299[_0x8ac7('0x31')][_0x8ac7('0x2a')]===_0x8ac7('0x71')&&_0x212299[_0x8ac7('0x31')][_0x8ac7('0x72')][_0x8ac7('0x4c')]>0x0?_['map'](_0x212299[_0x8ac7('0x31')][_0x8ac7('0x72')],function(_0x24011f){return{'name':_0x24011f[_0x8ac7('0x73')],'value':_0x24011f['value']};}):[]};})};}})[_0x8ac7('0x28')](respondWithResult(_0x4ce5cf,null))['catch'](function(_0x54357f){console[_0x8ac7('0x74')](_0x8ac7('0x75')+_0x54357f);var _0xfb762a=_0x4d61de[_0x8ac7('0x34')]['test']?0x1f4:_0x54357f[_0x8ac7('0x76')]||0x1f4;logger[_0x8ac7('0x77')](_0x8ac7('0x78'),_0x8ac7('0x57'),_0xfb762a,JSON[_0x8ac7('0x79')](_0x54357f));delete _0x54357f[_0x8ac7('0x2a')];if(_0xfb762a===0x191){_0xfb762a=0x190;}_0x4ce5cf['status'](_0xfb762a)[_0x8ac7('0x2b')](_0x4d61de[_0x8ac7('0x34')][_0x8ac7('0x7a')]?{'message':_0x8ac7('0x7b'),'statusCode':_0x54357f[_0x8ac7('0x76')]}:_0x54357f);});}; \ No newline at end of file +var _0xd3be=['index','map','VtigerAccount','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','options','includeAll','findAll','rows','catch','params','include','find','create','body','findOne','sort','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','md5','getFields','username','description','remoteUri','serverUrl','accessKey','moduleName','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','login','result','describe','autogenerated','reference','remove','includes','false','label','startsWith','cf_','picklistValues','log','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send'];(function(_0x9644a5,_0x2aeb75){var _0x6d1350=function(_0x4b035d){while(--_0x4b035d){_0x9644a5['push'](_0x9644a5['shift']());}};_0x6d1350(++_0x2aeb75);}(_0xd3be,0x138));var _0xed3b=function(_0x2c0467,_0x1b83aa){_0x2c0467=_0x2c0467-0x0;var _0x2b999b=_0xd3be[_0x2c0467];return _0x2b999b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xed3b('0x0'));var zipdir=require(_0xed3b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xed3b('0x2'));var moment=require(_0xed3b('0x3'));var BPromise=require(_0xed3b('0x4'));var Mustache=require('mustache');var util=require(_0xed3b('0x5'));var path=require(_0xed3b('0x6'));var sox=require(_0xed3b('0x7'));var csv=require(_0xed3b('0x8'));var ejs=require(_0xed3b('0x9'));var fs=require('fs');var fs_extra=require(_0xed3b('0xa'));var _=require(_0xed3b('0xb'));var squel=require(_0xed3b('0xc'));var crypto=require('crypto');var jsforce=require(_0xed3b('0xd'));var deskjs=require(_0xed3b('0xe'));var toCsv=require('to-csv');var querystring=require(_0xed3b('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xed3b('0x10'));var qs=require(_0xed3b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xed3b('0x12'));var logger=require(_0xed3b('0x13'))(_0xed3b('0x14'));var utils=require(_0xed3b('0x15'));var config=require(_0xed3b('0x16'));var licenseUtil=require(_0xed3b('0x17'));var db=require(_0xed3b('0x18'))['db'];var integrations=require(_0xed3b('0x19'));function respondWithStatusCode(_0x4d04d9,_0x589c3e){_0x589c3e=_0x589c3e||0xcc;return function(_0x15f6b8){if(_0x15f6b8){return _0x4d04d9[_0xed3b('0x1a')](_0x589c3e);}return _0x4d04d9[_0xed3b('0x1b')](_0x589c3e)[_0xed3b('0x1c')]();};}function respondWithResult(_0x19a40c,_0xb9c266){_0xb9c266=_0xb9c266||0xc8;return function(_0x602904){if(_0x602904){return _0x19a40c[_0xed3b('0x1b')](_0xb9c266)[_0xed3b('0x1d')](_0x602904);}};}function respondWithFilteredResult(_0x37413f,_0x5d0bb6){return function(_0x57bafa){if(_0x57bafa){var _0x37383a=typeof _0x5d0bb6['offset']==='undefined'&&typeof _0x5d0bb6[_0xed3b('0x1e')]===_0xed3b('0x1f');var _0x4a61bf=_0x57bafa[_0xed3b('0x20')];var _0x2be42c=_0x37383a?0x0:_0x5d0bb6[_0xed3b('0x21')];var _0x50b8a2=_0x37383a?_0x57bafa['count']:_0x5d0bb6[_0xed3b('0x21')]+_0x5d0bb6['limit'];var _0x3e18f;if(_0x50b8a2>=_0x4a61bf){_0x50b8a2=_0x4a61bf;_0x3e18f=0xc8;}else{_0x3e18f=0xce;}_0x37413f[_0xed3b('0x1b')](_0x3e18f);return _0x37413f[_0xed3b('0x22')](_0xed3b('0x23'),_0x2be42c+'-'+_0x50b8a2+'/'+_0x4a61bf)['json'](_0x57bafa);}return null;};}function patchUpdates(_0x422f48){return function(_0x59e762){try{jsonpatch[_0xed3b('0x24')](_0x59e762,_0x422f48,!![]);}catch(_0x346e69){return BPromise[_0xed3b('0x25')](_0x346e69);}return _0x59e762['save']();};}function saveUpdates(_0x18dbbe,_0x4e2d6b){return function(_0x3e3cd3){if(_0x3e3cd3){return _0x3e3cd3[_0xed3b('0x26')](_0x18dbbe)[_0xed3b('0x27')](function(_0x26e9da){return _0x26e9da;});}return null;};}function removeEntity(_0x1bb0ee,_0x3ea714){return function(_0x3c7148){if(_0x3c7148){return _0x3c7148[_0xed3b('0x28')]()[_0xed3b('0x27')](function(){_0x1bb0ee[_0xed3b('0x1b')](0xcc)[_0xed3b('0x1c')]();});}};}function handleEntityNotFound(_0x395231,_0x546bf9){return function(_0x5eb377){if(!_0x5eb377){_0x395231[_0xed3b('0x1a')](0x194);}return _0x5eb377;};}function handleError(_0x324774,_0x240af2){_0x240af2=_0x240af2||0x1f4;return function(_0x4b2dac){logger[_0xed3b('0x29')](_0x4b2dac[_0xed3b('0x2a')]);if(_0x4b2dac[_0xed3b('0x2b')]){delete _0x4b2dac[_0xed3b('0x2b')];}_0x324774[_0xed3b('0x1b')](_0x240af2)[_0xed3b('0x2c')](_0x4b2dac);};}exports[_0xed3b('0x2d')]=function(_0x1245b0,_0x9dc904){var _0x1f69a3={},_0x38d5a4={},_0x469e72={'count':0x0,'rows':[]};var _0x364757=_[_0xed3b('0x2e')](db[_0xed3b('0x2f')][_0xed3b('0x30')],function(_0x147981){return{'name':_0x147981['fieldName'],'type':_0x147981[_0xed3b('0x31')][_0xed3b('0x32')]};});_0x38d5a4[_0xed3b('0x33')]=_[_0xed3b('0x2e')](_0x364757,_0xed3b('0x2b'));_0x38d5a4[_0xed3b('0x34')]=_[_0xed3b('0x35')](_0x1245b0[_0xed3b('0x34')]);_0x38d5a4['filters']=_[_0xed3b('0x36')](_0x38d5a4[_0xed3b('0x33')],_0x38d5a4[_0xed3b('0x34')]);_0x1f69a3[_0xed3b('0x37')]=_['intersection'](_0x38d5a4[_0xed3b('0x33')],qs['fields'](_0x1245b0['query'][_0xed3b('0x38')]));_0x1f69a3['attributes']=_0x1f69a3['attributes'][_0xed3b('0x39')]?_0x1f69a3[_0xed3b('0x37')]:_0x38d5a4['model'];if(!_0x1245b0[_0xed3b('0x34')][_0xed3b('0x3a')](_0xed3b('0x3b'))){_0x1f69a3['limit']=qs[_0xed3b('0x1e')](_0x1245b0[_0xed3b('0x34')][_0xed3b('0x1e')]);_0x1f69a3[_0xed3b('0x21')]=qs[_0xed3b('0x21')](_0x1245b0[_0xed3b('0x34')]['offset']);}_0x1f69a3[_0xed3b('0x3c')]=qs['sort'](_0x1245b0[_0xed3b('0x34')]['sort']);_0x1f69a3[_0xed3b('0x3d')]=qs[_0xed3b('0x3e')](_[_0xed3b('0x3f')](_0x1245b0[_0xed3b('0x34')],_0x38d5a4[_0xed3b('0x3e')]),_0x364757);if(_0x1245b0[_0xed3b('0x34')][_0xed3b('0x40')]){_0x1f69a3[_0xed3b('0x3d')]=_[_0xed3b('0x41')](_0x1f69a3[_0xed3b('0x3d')],{'$or':_[_0xed3b('0x2e')](_0x364757,function(_0x508099){if(_0x508099[_0xed3b('0x31')]!=='VIRTUAL'){var _0x5a1aae={};_0x5a1aae[_0x508099[_0xed3b('0x2b')]]={'$like':'%'+_0x1245b0['query'][_0xed3b('0x40')]+'%'};return _0x5a1aae;}})});}_0x1f69a3=_[_0xed3b('0x41')]({},_0x1f69a3,_0x1245b0[_0xed3b('0x42')]);var _0x2b7ba7={'where':_0x1f69a3[_0xed3b('0x3d')]};return db[_0xed3b('0x2f')][_0xed3b('0x20')](_0x2b7ba7)['then'](function(_0x2f6cb9){_0x469e72[_0xed3b('0x20')]=_0x2f6cb9;if(_0x1245b0[_0xed3b('0x34')][_0xed3b('0x43')]){_0x1f69a3['include']=[{'all':!![]}];}return db[_0xed3b('0x2f')][_0xed3b('0x44')](_0x1f69a3);})[_0xed3b('0x27')](function(_0x545acf){_0x469e72[_0xed3b('0x45')]=_0x545acf;return _0x469e72;})[_0xed3b('0x27')](respondWithFilteredResult(_0x9dc904,_0x1f69a3))[_0xed3b('0x46')](handleError(_0x9dc904,null));};exports['show']=function(_0x2d5f4a,_0x2e10ce){var _0x303de5={'raw':![],'where':{'id':_0x2d5f4a[_0xed3b('0x47')]['id']}},_0x3e70f0={};_0x3e70f0[_0xed3b('0x33')]=_[_0xed3b('0x35')](db[_0xed3b('0x2f')][_0xed3b('0x30')]);_0x3e70f0[_0xed3b('0x34')]=_['keys'](_0x2d5f4a[_0xed3b('0x34')]);_0x3e70f0[_0xed3b('0x3e')]=_['intersection'](_0x3e70f0['model'],_0x3e70f0[_0xed3b('0x34')]);_0x303de5[_0xed3b('0x37')]=_['intersection'](_0x3e70f0['model'],qs[_0xed3b('0x38')](_0x2d5f4a[_0xed3b('0x34')][_0xed3b('0x38')]));_0x303de5['attributes']=_0x303de5[_0xed3b('0x37')][_0xed3b('0x39')]?_0x303de5[_0xed3b('0x37')]:_0x3e70f0[_0xed3b('0x33')];if(_0x2d5f4a[_0xed3b('0x34')][_0xed3b('0x43')]){_0x303de5[_0xed3b('0x48')]=[{'all':!![]}];}_0x303de5=_['merge']({},_0x303de5,_0x2d5f4a['options']);return db[_0xed3b('0x2f')][_0xed3b('0x49')](_0x303de5)['then'](handleEntityNotFound(_0x2e10ce,null))[_0xed3b('0x27')](respondWithResult(_0x2e10ce,null))[_0xed3b('0x46')](handleError(_0x2e10ce,null));};exports[_0xed3b('0x4a')]=function(_0x1303c7,_0x2293b2){return db[_0xed3b('0x2f')][_0xed3b('0x4a')](_0x1303c7[_0xed3b('0x4b')],{})['then'](respondWithResult(_0x2293b2,0xc9))['catch'](handleError(_0x2293b2,null));};exports[_0xed3b('0x26')]=function(_0x1d0748,_0x288e06){if(_0x1d0748[_0xed3b('0x4b')]['id']){delete _0x1d0748[_0xed3b('0x4b')]['id'];}return db['VtigerAccount']['find']({'where':{'id':_0x1d0748[_0xed3b('0x47')]['id']}})[_0xed3b('0x27')](handleEntityNotFound(_0x288e06,null))[_0xed3b('0x27')](saveUpdates(_0x1d0748[_0xed3b('0x4b')],null))[_0xed3b('0x27')](respondWithResult(_0x288e06,null))[_0xed3b('0x46')](handleError(_0x288e06,null));};exports[_0xed3b('0x28')]=function(_0x30a824,_0x5695f1){return db[_0xed3b('0x2f')]['find']({'where':{'id':_0x30a824[_0xed3b('0x47')]['id']}})[_0xed3b('0x27')](handleEntityNotFound(_0x5695f1,null))[_0xed3b('0x27')](removeEntity(_0x5695f1,null))[_0xed3b('0x46')](handleError(_0x5695f1,null));};exports['getConfigurations']=function(_0x37c742,_0x1b8fc0,_0x4326bb){var _0x597720={};var _0xef488a={};var _0x55b2c6;var _0x53ba02;return db[_0xed3b('0x2f')][_0xed3b('0x4c')]({'where':{'id':_0x37c742[_0xed3b('0x47')]['id']}})[_0xed3b('0x27')](handleEntityNotFound(_0x1b8fc0,null))[_0xed3b('0x27')](function(_0xbeee43){if(_0xbeee43){_0x55b2c6=_0xbeee43;_0xef488a[_0xed3b('0x33')]=_[_0xed3b('0x35')](db['VtigerConfiguration'][_0xed3b('0x30')]);_0xef488a[_0xed3b('0x34')]=_[_0xed3b('0x35')](_0x37c742['query']);_0xef488a[_0xed3b('0x3e')]=_[_0xed3b('0x36')](_0xef488a['model'],_0xef488a['query']);_0x597720['attributes']=_[_0xed3b('0x36')](_0xef488a[_0xed3b('0x33')],qs[_0xed3b('0x38')](_0x37c742[_0xed3b('0x34')][_0xed3b('0x38')]));_0x597720[_0xed3b('0x37')]=_0x597720[_0xed3b('0x37')][_0xed3b('0x39')]?_0x597720[_0xed3b('0x37')]:_0xef488a[_0xed3b('0x33')];_0x597720[_0xed3b('0x3c')]=qs['sort'](_0x37c742['query'][_0xed3b('0x4d')]);_0x597720[_0xed3b('0x3d')]=qs['filters'](_[_0xed3b('0x3f')](_0x37c742['query'],_0xef488a['filters']));if(_0x37c742[_0xed3b('0x34')][_0xed3b('0x40')]){_0x597720[_0xed3b('0x3d')]=_[_0xed3b('0x41')](_0x597720[_0xed3b('0x3d')],{'$or':_[_0xed3b('0x2e')](_0x597720['attributes'],function(_0x42925b){var _0x414c39={};_0x414c39[_0x42925b]={'$like':'%'+_0x37c742[_0xed3b('0x34')]['filter']+'%'};return _0x414c39;})});}_0x597720=_['merge']({},_0x597720,_0x37c742['options']);return _0x55b2c6[_0xed3b('0x4e')](_0x597720);}})[_0xed3b('0x27')](function(_0x526b9f){if(_0x526b9f){_0x53ba02=_0x526b9f['length'];if(!_0x37c742[_0xed3b('0x34')][_0xed3b('0x3a')]('nolimit')){_0x597720[_0xed3b('0x1e')]=qs['limit'](_0x37c742[_0xed3b('0x34')][_0xed3b('0x1e')]);_0x597720[_0xed3b('0x21')]=qs[_0xed3b('0x21')](_0x37c742[_0xed3b('0x34')][_0xed3b('0x21')]);}return _0x55b2c6['getConfigurations'](_0x597720);}})[_0xed3b('0x27')](function(_0x5b9428){if(_0x5b9428){return _0x5b9428?{'count':_0x53ba02,'rows':_0x5b9428}:null;}})['then'](respondWithResult(_0x1b8fc0,null))[_0xed3b('0x46')](handleError(_0x1b8fc0,null));};exports['addConfiguration']=function(_0x52f6f0,_0x17617c,_0x251033){if(_0x52f6f0[_0xed3b('0x4b')]['id']){delete _0x52f6f0[_0xed3b('0x4b')]['id'];}return db[_0xed3b('0x2f')][_0xed3b('0x4c')]({'where':{'id':_0x52f6f0[_0xed3b('0x47')]['id']}})['then'](handleEntityNotFound(_0x17617c,null))['then'](function(_0x341bce){if(_0x341bce){_0x52f6f0[_0xed3b('0x4b')][_0xed3b('0x4f')]=_0x341bce['id'];_0x52f6f0['body'][_0xed3b('0x50')]=integrations[_0xed3b('0x51')](_0x52f6f0[_0xed3b('0x4b')][_0xed3b('0x52')],_0x52f6f0['body']['type']);_0x52f6f0['body'][_0xed3b('0x53')]=integrations[_0xed3b('0x54')](_0x52f6f0['body'][_0xed3b('0x52')],_0x52f6f0[_0xed3b('0x4b')][_0xed3b('0x31')]);return db[_0xed3b('0x55')][_0xed3b('0x4a')](_0x52f6f0[_0xed3b('0x4b')],{'include':[{'model':db[_0xed3b('0x56')],'as':_0xed3b('0x50')},{'model':db[_0xed3b('0x56')],'as':_0xed3b('0x53')}]});}return null;})[_0xed3b('0x27')](respondWithResult(_0x17617c,null))[_0xed3b('0x46')](handleError(_0x17617c,null));};var md5=require(_0xed3b('0x57'));exports[_0xed3b('0x58')]=function(_0x530aae,_0x4163dd,_0x15939a){var _0x55d889=null;var _0x16be7f=null;var _0xbf67ce=null;var _0xe697f6=null;var _0x2081f4='';return db[_0xed3b('0x2f')][_0xed3b('0x4c')]({'where':{'id':_0x530aae[_0xed3b('0x47')]['id']},'attributes':['id','name',_0xed3b('0x59'),_0xed3b('0x5a'),'moduleName',_0xed3b('0x5b'),_0xed3b('0x5c'),'accessKey']})[_0xed3b('0x27')](handleEntityNotFound(_0x4163dd,null))['then'](function(_0x35719e){if(_0x35719e){_0x55d889=_0x35719e['username'];_0x16be7f=_0x35719e[_0xed3b('0x5d')];_0xbf67ce=_0x35719e[_0xed3b('0x5e')];_0x2081f4=_0x35719e['remoteUri'];var _0x260e6e=_0x2081f4['slice'](-0x1);if(_0x260e6e==='/'){_0x2081f4=_0x2081f4['substring'](0x0,_0x2081f4[_0xed3b('0x5f')](_0x260e6e));}_0xe697f6=util[_0xed3b('0x60')](_0xed3b('0x61'),_0x2081f4);var _0x3ed283={'method':_0xed3b('0x62'),'uri':_0xe697f6,'qs':{'operation':_0xed3b('0x63'),'username':_0x35719e['username']},'json':!![]};return rp(_0x3ed283);}})[_0xed3b('0x27')](function(_0x365272){if(_0x365272[_0xed3b('0x64')]){var _0x2d423f={'method':'POST','uri':_0xe697f6,'form':{'operation':_0xed3b('0x65'),'username':_0x55d889,'accessKey':md5(_0x365272[_0xed3b('0x66')]['token']+_0x16be7f)},'json':!![]};return rp(_0x2d423f);}})['then'](function(_0x3019a3){if(_0x3019a3['success']){var _0x502a6f={'method':_0xed3b('0x62'),'uri':_0xe697f6,'qs':{'operation':_0xed3b('0x67'),'username':_0x55d889,'sessionName':_0x3019a3[_0xed3b('0x66')]['sessionName'],'elementType':_0xbf67ce},'json':!![]};return rp(_0x502a6f);}})['then'](function(_0x2d315a){if(_0x2d315a[_0xed3b('0x64')]){var _0x16ac7a=[_0xed3b('0x68'),_0xed3b('0x69'),'owner'];_[_0xed3b('0x6a')](_0x2d315a[_0xed3b('0x66')]['fields'],function(_0xc046a5){return _0x16ac7a[_0xed3b('0x6b')](_0xc046a5['type']['name']);});_[_0xed3b('0x6a')](_0x2d315a[_0xed3b('0x66')]['fields'],function(_0x9074b1){return _0x9074b1['editable']===_0xed3b('0x6c');});return{'count':_0x2d315a[_0xed3b('0x66')][_0xed3b('0x38')]['length'],'rows':_[_0xed3b('0x2e')](_0x2d315a[_0xed3b('0x66')][_0xed3b('0x38')],function(_0x48c92d){return{'id':_0x48c92d[_0xed3b('0x2b')],'name':_0x48c92d[_0xed3b('0x6d')],'custom':_[_0xed3b('0x6e')](_0x48c92d[_0xed3b('0x2b')],_0xed3b('0x6f'))?!![]:![],'options':_0x48c92d[_0xed3b('0x31')][_0xed3b('0x2b')]==='picklist'&&_0x48c92d[_0xed3b('0x31')][_0xed3b('0x70')][_0xed3b('0x39')]>0x0?_['map'](_0x48c92d[_0xed3b('0x31')][_0xed3b('0x70')],function(_0x3b8cf7){return{'name':_0x3b8cf7['label'],'value':_0x3b8cf7['value']};}):[]};})};}})[_0xed3b('0x27')](respondWithResult(_0x4163dd,null))[_0xed3b('0x46')](function(_0x1f27e7){console[_0xed3b('0x71')]('vTiger\x20error:\x20'+_0x1f27e7);var _0x4f8785=_0x530aae[_0xed3b('0x34')][_0xed3b('0x72')]?0x1f4:_0x1f27e7['statusCode']||0x1f4;logger['error'](_0xed3b('0x73'),_0xed3b('0x58'),_0x4f8785,JSON[_0xed3b('0x74')](_0x1f27e7));delete _0x1f27e7[_0xed3b('0x2b')];if(_0x4f8785===0x191){_0x4f8785=0x190;}_0x4163dd[_0xed3b('0x1b')](_0x4f8785)[_0xed3b('0x2c')](_0x530aae['query']['test']?{'message':_0xed3b('0x75'),'statusCode':_0x1f27e7[_0xed3b('0x76')]}:_0x1f27e7);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index c714176..f604f6e 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 _0x930a=['./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x21e97b,_0x65a77f){var _0x10ba44=function(_0x239ef2){while(--_0x239ef2){_0x21e97b['push'](_0x21e97b['shift']());}};_0x10ba44(++_0x65a77f);}(_0x930a,0x118));var _0xa930=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x930a[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0xa930('0x0'));var util=require(_0xa930('0x1'));var logger=require(_0xa930('0x2'))('api');var moment=require(_0xa930('0x3'));var BPromise=require(_0xa930('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa930('0x5'));var rimraf=require(_0xa930('0x6'));var config=require(_0xa930('0x7'));var attributes=require(_0xa930('0x8'));var integrations=require(_0xa930('0x9'));module[_0xa930('0xa')]=function(_0x5ec8d6,_0x255ce9){return _0x5ec8d6[_0xa930('0xb')]('VtigerAccount',attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x26c9=['bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','define','VtigerAccount','lodash','util','api'];(function(_0x2d335f,_0x16aacd){var _0x2294c6=function(_0x288c7e){while(--_0x288c7e){_0x2d335f['push'](_0x2d335f['shift']());}};_0x2294c6(++_0x16aacd);}(_0x26c9,0x173));var _0x926c=function(_0x2307fa,_0x266e5e){_0x2307fa=_0x2307fa-0x0;var _0x496486=_0x26c9[_0x2307fa];return _0x496486;};'use strict';var _=require(_0x926c('0x0'));var util=require(_0x926c('0x1'));var logger=require('../../config/logger')(_0x926c('0x2'));var moment=require('moment');var BPromise=require(_0x926c('0x3'));var rp=require(_0x926c('0x4'));var fs=require('fs');var path=require(_0x926c('0x5'));var rimraf=require(_0x926c('0x6'));var config=require(_0x926c('0x7'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x926c('0x8'));module['exports']=function(_0x5adf71,_0x102f72){return _0x5adf71[_0x926c('0x9')](_0x926c('0xa'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index b363999..d5de96f 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 _0x7334=['code','message','request\x20sent','result','GetVtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','VtigerAccount','find','ShowVtigerAccount','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7334,0x184));var _0x4733=function(_0xc924a0,_0x43908e){_0xc924a0=_0xc924a0-0x0;var _0x17a7f3=_0x7334[_0xc924a0];return _0x17a7f3;};'use strict';var _=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var moment=require(_0x4733('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4733('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4733('0x4'));var logger=require(_0x4733('0x5'))(_0x4733('0x6'));var config=require(_0x4733('0x7'));var jayson=require(_0x4733('0x8'));var client=jayson[_0x4733('0x9')][_0x4733('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x283754,_0x12cafa,_0x43d95c){return new BPromise(function(_0x8257cf,_0x3562b7){return client[_0x4733('0xb')](_0x283754,_0x43d95c)[_0x4733('0xc')](function(_0x2d5fde){logger[_0x4733('0xd')](_0x4733('0xe'),_0x12cafa,'request\x20sent');logger[_0x4733('0xf')](_0x4733('0x10'),_0x12cafa,'request\x20sent',JSON[_0x4733('0x11')](_0x2d5fde));if(_0x2d5fde['error']){if(_0x2d5fde[_0x4733('0x12')][_0x4733('0x13')]===0x1f4){logger[_0x4733('0x12')](_0x4733('0xe'),_0x12cafa,_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);return _0x3562b7(_0x2d5fde[_0x4733('0x12')]['message']);}logger[_0x4733('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x12cafa,_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);return _0x8257cf(_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);}else{logger[_0x4733('0xd')](_0x4733('0xe'),_0x12cafa,_0x4733('0x15'));_0x8257cf(_0x2d5fde[_0x4733('0x16')][_0x4733('0x14')]);}})['catch'](function(_0x2c0031){logger[_0x4733('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x12cafa,_0x2c0031);_0x3562b7(_0x2c0031);});});}exports[_0x4733('0x17')]=function(_0x1d2fb6){var _0x2aa223=this;return new Promise(function(_0x384e0c,_0x579f67){return db['VtigerAccount'][_0x4733('0x18')]({'raw':_0x1d2fb6[_0x4733('0x19')]?_0x1d2fb6['options'][_0x4733('0x1a')]===undefined?!![]:![]:!![],'where':_0x1d2fb6[_0x4733('0x19')]?_0x1d2fb6[_0x4733('0x19')][_0x4733('0x1b')]||null:null,'attributes':_0x1d2fb6['options']?_0x1d2fb6[_0x4733('0x19')][_0x4733('0x1c')]||null:null,'limit':_0x1d2fb6['options']?_0x1d2fb6[_0x4733('0x19')][_0x4733('0x1d')]||null:null,'include':_0x1d2fb6['options']?_0x1d2fb6[_0x4733('0x19')][_0x4733('0x1e')]?_[_0x4733('0x1f')](_0x1d2fb6[_0x4733('0x19')][_0x4733('0x1e')],function(_0x24db74){return{'model':db[_0x24db74[_0x4733('0x20')]],'as':_0x24db74['as'],'attributes':_0x24db74[_0x4733('0x1c')],'include':_0x24db74['include']?_[_0x4733('0x1f')](_0x24db74[_0x4733('0x1e')],function(_0x7884e5){return{'model':db[_0x7884e5[_0x4733('0x20')]],'as':_0x7884e5['as'],'attributes':_0x7884e5[_0x4733('0x1c')],'include':_0x7884e5[_0x4733('0x1e')]?_[_0x4733('0x1f')](_0x7884e5[_0x4733('0x1e')],function(_0x13bc12){return{'model':db[_0x13bc12[_0x4733('0x20')]],'as':_0x13bc12['as'],'attributes':_0x13bc12['attributes']};}):[]};}):[]};}):[]:[]})[_0x4733('0xc')](function(_0x4c91bc){logger['info'](_0x4733('0x17'),_0x1d2fb6);logger['debug'](_0x4733('0x17'),_0x1d2fb6,JSON['stringify'](_0x4c91bc));_0x384e0c(_0x4c91bc);})['catch'](function(_0x517c73){logger[_0x4733('0x12')](_0x4733('0x17'),_0x517c73[_0x4733('0x14')],_0x1d2fb6);_0x579f67(_0x2aa223[_0x4733('0x12')](0x1f4,_0x517c73['message']));});});};exports['ShowVtigerAccount']=function(_0x50f67e){var _0x2b2757=this;return new Promise(function(_0x56872b,_0x5a4814){return db[_0x4733('0x21')][_0x4733('0x22')]({'raw':_0x50f67e[_0x4733('0x19')]?_0x50f67e['options']['raw']===undefined?!![]:![]:!![],'where':_0x50f67e[_0x4733('0x19')]?_0x50f67e[_0x4733('0x19')][_0x4733('0x1b')]||null:null,'attributes':_0x50f67e[_0x4733('0x19')]?_0x50f67e[_0x4733('0x19')]['attributes']||null:null,'include':_0x50f67e[_0x4733('0x19')]?_0x50f67e[_0x4733('0x19')][_0x4733('0x1e')]?_[_0x4733('0x1f')](_0x50f67e[_0x4733('0x19')]['include'],function(_0x570bc6){return{'model':db[_0x570bc6[_0x4733('0x20')]],'as':_0x570bc6['as'],'attributes':_0x570bc6[_0x4733('0x1c')],'include':_0x570bc6[_0x4733('0x1e')]?_[_0x4733('0x1f')](_0x570bc6[_0x4733('0x1e')],function(_0x5e31c8){return{'model':db[_0x5e31c8[_0x4733('0x20')]],'as':_0x5e31c8['as'],'attributes':_0x5e31c8[_0x4733('0x1c')],'include':_0x5e31c8[_0x4733('0x1e')]?_['map'](_0x5e31c8[_0x4733('0x1e')],function(_0x10a5e9){return{'model':db[_0x10a5e9[_0x4733('0x20')]],'as':_0x10a5e9['as'],'attributes':_0x10a5e9[_0x4733('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4733('0xc')](function(_0x311c1d){logger[_0x4733('0xd')](_0x4733('0x23'),_0x50f67e);logger['debug'](_0x4733('0x23'),_0x50f67e,JSON['stringify'](_0x311c1d));_0x56872b(_0x311c1d);})[_0x4733('0x24')](function(_0x29db03){logger[_0x4733('0x12')](_0x4733('0x23'),_0x29db03[_0x4733('0x14')],_0x50f67e);_0x5a4814(_0x2b2757[_0x4733('0x12')](0x1f4,_0x29db03[_0x4733('0x14')]));});});}; \ No newline at end of file +var _0x2e54=['error','message','result','catch','GetVtigerAccount','VtigerAccount','options','raw','where','attributes','map','include','model','ShowVtigerAccount','stringify','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s'];(function(_0xe0e520,_0x278e0a){var _0x1b5039=function(_0x401151){while(--_0x401151){_0xe0e520['push'](_0xe0e520['shift']());}};_0x1b5039(++_0x278e0a);}(_0x2e54,0x1dd));var _0x42e5=function(_0xcb958,_0x2c2ed3){_0xcb958=_0xcb958-0x0;var _0x54a906=_0x2e54[_0xcb958];return _0x54a906;};'use strict';var _=require(_0x42e5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x42e5('0x1'));var rs=require(_0x42e5('0x2'));var fs=require('fs');var Redis=require(_0x42e5('0x3'));var db=require(_0x42e5('0x4'))['db'];var utils=require(_0x42e5('0x5'));var logger=require(_0x42e5('0x6'))(_0x42e5('0x7'));var config=require('../../config/environment');var jayson=require(_0x42e5('0x8'));var client=jayson[_0x42e5('0x9')][_0x42e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bed10,_0x2af5bb,_0x56be20){return new BPromise(function(_0x335b92,_0x490b99){return client[_0x42e5('0xb')](_0x4bed10,_0x56be20)[_0x42e5('0xc')](function(_0x10ee5a){logger[_0x42e5('0xd')](_0x42e5('0xe'),_0x2af5bb,_0x42e5('0xf'));logger[_0x42e5('0x10')](_0x42e5('0x11'),_0x2af5bb,_0x42e5('0xf'),JSON['stringify'](_0x10ee5a));if(_0x10ee5a[_0x42e5('0x12')]){if(_0x10ee5a[_0x42e5('0x12')]['code']===0x1f4){logger[_0x42e5('0x12')](_0x42e5('0xe'),_0x2af5bb,_0x10ee5a[_0x42e5('0x12')][_0x42e5('0x13')]);return _0x490b99(_0x10ee5a[_0x42e5('0x12')][_0x42e5('0x13')]);}logger[_0x42e5('0x12')](_0x42e5('0xe'),_0x2af5bb,_0x10ee5a[_0x42e5('0x12')][_0x42e5('0x13')]);return _0x335b92(_0x10ee5a['error'][_0x42e5('0x13')]);}else{logger[_0x42e5('0xd')](_0x42e5('0xe'),_0x2af5bb,_0x42e5('0xf'));_0x335b92(_0x10ee5a[_0x42e5('0x14')][_0x42e5('0x13')]);}})[_0x42e5('0x15')](function(_0x3abe3d){logger[_0x42e5('0x12')](_0x42e5('0xe'),_0x2af5bb,_0x3abe3d);_0x490b99(_0x3abe3d);});});}exports[_0x42e5('0x16')]=function(_0x38282d){var _0x11550e=this;return new Promise(function(_0x23fe09,_0x54fcfc){return db[_0x42e5('0x17')]['findAll']({'raw':_0x38282d['options']?_0x38282d[_0x42e5('0x18')][_0x42e5('0x19')]===undefined?!![]:![]:!![],'where':_0x38282d['options']?_0x38282d[_0x42e5('0x18')][_0x42e5('0x1a')]||null:null,'attributes':_0x38282d[_0x42e5('0x18')]?_0x38282d[_0x42e5('0x18')][_0x42e5('0x1b')]||null:null,'limit':_0x38282d[_0x42e5('0x18')]?_0x38282d[_0x42e5('0x18')]['limit']||null:null,'include':_0x38282d['options']?_0x38282d[_0x42e5('0x18')]['include']?_[_0x42e5('0x1c')](_0x38282d[_0x42e5('0x18')][_0x42e5('0x1d')],function(_0x49490f){return{'model':db[_0x49490f[_0x42e5('0x1e')]],'as':_0x49490f['as'],'attributes':_0x49490f['attributes'],'include':_0x49490f[_0x42e5('0x1d')]?_[_0x42e5('0x1c')](_0x49490f[_0x42e5('0x1d')],function(_0x275c80){return{'model':db[_0x275c80[_0x42e5('0x1e')]],'as':_0x275c80['as'],'attributes':_0x275c80['attributes'],'include':_0x275c80['include']?_[_0x42e5('0x1c')](_0x275c80['include'],function(_0x56f812){return{'model':db[_0x56f812[_0x42e5('0x1e')]],'as':_0x56f812['as'],'attributes':_0x56f812['attributes']};}):[]};}):[]};}):[]:[]})[_0x42e5('0xc')](function(_0x2d9e65){logger[_0x42e5('0xd')](_0x42e5('0x16'),_0x38282d);logger[_0x42e5('0x10')](_0x42e5('0x16'),_0x38282d,JSON['stringify'](_0x2d9e65));_0x23fe09(_0x2d9e65);})[_0x42e5('0x15')](function(_0x201d9e){logger[_0x42e5('0x12')](_0x42e5('0x16'),_0x201d9e[_0x42e5('0x13')],_0x38282d);_0x54fcfc(_0x11550e[_0x42e5('0x12')](0x1f4,_0x201d9e[_0x42e5('0x13')]));});});};exports[_0x42e5('0x1f')]=function(_0x5a4930){var _0x2ba9ef=this;return new Promise(function(_0x2c7542,_0x3d9e8b){return db[_0x42e5('0x17')]['find']({'raw':_0x5a4930[_0x42e5('0x18')]?_0x5a4930[_0x42e5('0x18')][_0x42e5('0x19')]===undefined?!![]:![]:!![],'where':_0x5a4930[_0x42e5('0x18')]?_0x5a4930['options']['where']||null:null,'attributes':_0x5a4930[_0x42e5('0x18')]?_0x5a4930['options'][_0x42e5('0x1b')]||null:null,'include':_0x5a4930['options']?_0x5a4930[_0x42e5('0x18')][_0x42e5('0x1d')]?_[_0x42e5('0x1c')](_0x5a4930['options'][_0x42e5('0x1d')],function(_0x3a8d1c){return{'model':db[_0x3a8d1c['model']],'as':_0x3a8d1c['as'],'attributes':_0x3a8d1c[_0x42e5('0x1b')],'include':_0x3a8d1c['include']?_[_0x42e5('0x1c')](_0x3a8d1c[_0x42e5('0x1d')],function(_0x25a040){return{'model':db[_0x25a040[_0x42e5('0x1e')]],'as':_0x25a040['as'],'attributes':_0x25a040[_0x42e5('0x1b')],'include':_0x25a040[_0x42e5('0x1d')]?_[_0x42e5('0x1c')](_0x25a040['include'],function(_0x5a18cc){return{'model':db[_0x5a18cc[_0x42e5('0x1e')]],'as':_0x5a18cc['as'],'attributes':_0x5a18cc[_0x42e5('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x42e5('0xc')](function(_0x4a1a8a){logger['info']('ShowVtigerAccount',_0x5a4930);logger['debug'](_0x42e5('0x1f'),_0x5a4930,JSON[_0x42e5('0x20')](_0x4a1a8a));_0x2c7542(_0x4a1a8a);})[_0x42e5('0x15')](function(_0xedb7bc){logger[_0x42e5('0x12')](_0x42e5('0x1f'),_0xedb7bc[_0x42e5('0x13')],_0x5a4930);_0x3d9e8b(_0x2ba9ef[_0x42e5('0x12')](0x1f4,_0xedb7bc['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 24c3422..bc8a1fb 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 _0x4585=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','isAuthenticated','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id'];(function(_0x4571bb,_0x75f4dd){var _0x3af22c=function(_0x2dd25b){while(--_0x2dd25b){_0x4571bb['push'](_0x4571bb['shift']());}};_0x3af22c(++_0x75f4dd);}(_0x4585,0x16f));var _0x5458=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x4585[_0x4c12ec];return _0x3ae42c;};'use strict';var multer=require(_0x5458('0x0'));var util=require(_0x5458('0x1'));var path=require(_0x5458('0x2'));var timeout=require(_0x5458('0x3'));var express=require(_0x5458('0x4'));var router=express[_0x5458('0x5')]();var fs_extra=require(_0x5458('0x6'));var auth=require(_0x5458('0x7'));var interaction=require(_0x5458('0x8'));var config=require('../../config/environment');var controller=require(_0x5458('0x9'));router['get']('/',auth[_0x5458('0xa')](),controller['index']);router[_0x5458('0xb')]('/:id',auth[_0x5458('0xa')](),controller[_0x5458('0xc')]);router[_0x5458('0xb')](_0x5458('0xd'),auth[_0x5458('0xa')](),controller[_0x5458('0xe')]);router['get'](_0x5458('0xf'),auth[_0x5458('0xa')](),controller[_0x5458('0x10')]);router[_0x5458('0xb')](_0x5458('0x11'),auth['isAuthenticated'](),controller[_0x5458('0x12')]);router[_0x5458('0x13')]('/',auth[_0x5458('0xa')](),controller[_0x5458('0x14')]);router[_0x5458('0x15')](_0x5458('0x16'),auth['isAuthenticated'](),controller['update']);router[_0x5458('0x17')](_0x5458('0x16'),auth[_0x5458('0xa')](),controller[_0x5458('0x18')]);module[_0x5458('0x19')]=router; \ No newline at end of file +var _0x7444=['../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','exports','multer','path','express','Router','fs-extra'];(function(_0x53962a,_0x7ce86e){var _0x27ea46=function(_0x2982d7){while(--_0x2982d7){_0x53962a['push'](_0x53962a['shift']());}};_0x27ea46(++_0x7ce86e);}(_0x7444,0x1ef));var _0x4744=function(_0x1d8527,_0xd2b4c8){_0x1d8527=_0x1d8527-0x0;var _0x41e962=_0x7444[_0x1d8527];return _0x41e962;};'use strict';var multer=require(_0x4744('0x0'));var util=require('util');var path=require(_0x4744('0x1'));var timeout=require('connect-timeout');var express=require(_0x4744('0x2'));var router=express[_0x4744('0x3')]();var fs_extra=require(_0x4744('0x4'));var auth=require(_0x4744('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4744('0x6'));var controller=require(_0x4744('0x7'));router[_0x4744('0x8')]('/',auth[_0x4744('0x9')](),controller[_0x4744('0xa')]);router[_0x4744('0x8')](_0x4744('0xb'),auth[_0x4744('0x9')](),controller[_0x4744('0xc')]);router['get'](_0x4744('0xd'),auth[_0x4744('0x9')](),controller[_0x4744('0xe')]);router[_0x4744('0x8')](_0x4744('0xf'),auth['isAuthenticated'](),controller[_0x4744('0x10')]);router['get'](_0x4744('0x11'),auth['isAuthenticated'](),controller[_0x4744('0x12')]);router[_0x4744('0x13')]('/',auth[_0x4744('0x9')](),controller[_0x4744('0x14')]);router[_0x4744('0x15')](_0x4744('0xb'),auth[_0x4744('0x9')](),controller['update']);router[_0x4744('0x16')](_0x4744('0xb'),auth[_0x4744('0x9')](),controller[_0x4744('0x17')]);module[_0x4744('0x18')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 8067cad..da53e61 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 _0x4701=['STRING','sequelize','exports'];(function(_0x373ce4,_0x46d3c8){var _0x39d739=function(_0x62d988){while(--_0x62d988){_0x373ce4['push'](_0x373ce4['shift']());}};_0x39d739(++_0x46d3c8);}(_0x4701,0x12d));var _0x1470=function(_0x46635a,_0x3c194e){_0x46635a=_0x46635a-0x0;var _0x3da1b8=_0x4701[_0x46635a];return _0x3da1b8;};'use strict';var Sequelize=require(_0x1470('0x0'));module[_0x1470('0x1')]={'name':{'type':Sequelize[_0x1470('0x2')]},'description':{'type':Sequelize[_0x1470('0x2')]}}; \ No newline at end of file +var _0x69d3=['STRING'];(function(_0x35e92e,_0x21581b){var _0x1205a8=function(_0x4325d8){while(--_0x4325d8){_0x35e92e['push'](_0x35e92e['shift']());}};_0x1205a8(++_0x21581b);}(_0x69d3,0xc4));var _0x369d=function(_0x4b76a7,_0x3d6d7d){_0x4b76a7=_0x4b76a7-0x0;var _0x10ea1c=_0x69d3[_0x4b76a7];return _0x10ea1c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x369d('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 610c318..c6d7061 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 _0xb2b3=['body','getFields','findOne','VtigerField','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','crypto','jsforce','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','undefined','count','offset','limit','Content-Range','apply','reject','update','then','destroy','end','error','name','send','map','VtigerConfiguration','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0xb2b3,0x18c));var _0x3b2b=function(_0x1de894,_0x10dcc0){_0x1de894=_0x1de894-0x0;var _0x11862b=_0xb2b3[_0x1de894];return _0x11862b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3b2b('0x0'));var zipdir=require(_0x3b2b('0x1'));var jsonpatch=require(_0x3b2b('0x2'));var rp=require(_0x3b2b('0x3'));var moment=require(_0x3b2b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3b2b('0x5'));var util=require('util');var path=require(_0x3b2b('0x6'));var sox=require('sox');var csv=require(_0x3b2b('0x7'));var ejs=require(_0x3b2b('0x8'));var fs=require('fs');var fs_extra=require(_0x3b2b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3b2b('0xa'));var jsforce=require(_0x3b2b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3b2b('0x7'));var querystring=require(_0x3b2b('0xc'));var Papa=require(_0x3b2b('0xd'));var Redis=require(_0x3b2b('0xe'));var authService=require(_0x3b2b('0xf'));var qs=require(_0x3b2b('0x10'));var as=require(_0x3b2b('0x11'));var hardwareService=require(_0x3b2b('0x12'));var logger=require(_0x3b2b('0x13'))(_0x3b2b('0x14'));var utils=require(_0x3b2b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3b2b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xad52f4,_0x4dc38c){_0x4dc38c=_0x4dc38c||0xcc;return function(_0x120d7d){if(_0x120d7d){return _0xad52f4[_0x3b2b('0x17')](_0x4dc38c);}return _0xad52f4[_0x3b2b('0x18')](_0x4dc38c)['end']();};}function respondWithResult(_0x23d472,_0x219fd9){_0x219fd9=_0x219fd9||0xc8;return function(_0x596f69){if(_0x596f69){return _0x23d472['status'](_0x219fd9)[_0x3b2b('0x19')](_0x596f69);}};}function respondWithFilteredResult(_0xf30982,_0x374053){return function(_0x28a6ff){if(_0x28a6ff){var _0xb34e73=typeof _0x374053['offset']==='undefined'&&typeof _0x374053['limit']===_0x3b2b('0x1a');var _0x9d9982=_0x28a6ff[_0x3b2b('0x1b')];var _0x166d40=_0xb34e73?0x0:_0x374053[_0x3b2b('0x1c')];var _0x551294=_0xb34e73?_0x28a6ff[_0x3b2b('0x1b')]:_0x374053[_0x3b2b('0x1c')]+_0x374053[_0x3b2b('0x1d')];var _0x3493fb;if(_0x551294>=_0x9d9982){_0x551294=_0x9d9982;_0x3493fb=0xc8;}else{_0x3493fb=0xce;}_0xf30982[_0x3b2b('0x18')](_0x3493fb);return _0xf30982['set'](_0x3b2b('0x1e'),_0x166d40+'-'+_0x551294+'/'+_0x9d9982)[_0x3b2b('0x19')](_0x28a6ff);}return null;};}function patchUpdates(_0x5b1a7b){return function(_0x12c097){try{jsonpatch[_0x3b2b('0x1f')](_0x12c097,_0x5b1a7b,!![]);}catch(_0x397836){return BPromise[_0x3b2b('0x20')](_0x397836);}return _0x12c097['save']();};}function saveUpdates(_0x445406,_0x3ce9b2){return function(_0x3d9810){if(_0x3d9810){return _0x3d9810[_0x3b2b('0x21')](_0x445406)[_0x3b2b('0x22')](function(_0x7b4968){return _0x7b4968;});}return null;};}function removeEntity(_0x496fda,_0x1c47f4){return function(_0x1c2fb5){if(_0x1c2fb5){return _0x1c2fb5[_0x3b2b('0x23')]()[_0x3b2b('0x22')](function(){_0x496fda[_0x3b2b('0x18')](0xcc)[_0x3b2b('0x24')]();});}};}function handleEntityNotFound(_0x2a10f8,_0x25a3d6){return function(_0xc6a233){if(!_0xc6a233){_0x2a10f8[_0x3b2b('0x17')](0x194);}return _0xc6a233;};}function handleError(_0x3b0cb7,_0x515943){_0x515943=_0x515943||0x1f4;return function(_0xf879b1){logger[_0x3b2b('0x25')](_0xf879b1['stack']);if(_0xf879b1['name']){delete _0xf879b1[_0x3b2b('0x26')];}_0x3b0cb7[_0x3b2b('0x18')](_0x515943)[_0x3b2b('0x27')](_0xf879b1);};}exports['index']=function(_0x2d023c,_0x567ff9){var _0x4c59b9={},_0x43a2a4={},_0x396a2c={'count':0x0,'rows':[]};var _0x5be80d=_[_0x3b2b('0x28')](db[_0x3b2b('0x29')][_0x3b2b('0x2a')],function(_0xd5015a){return{'name':_0xd5015a[_0x3b2b('0x2b')],'type':_0xd5015a[_0x3b2b('0x2c')]['key']};});_0x43a2a4[_0x3b2b('0x2d')]=_[_0x3b2b('0x28')](_0x5be80d,_0x3b2b('0x26'));_0x43a2a4[_0x3b2b('0x2e')]=_['keys'](_0x2d023c['query']);_0x43a2a4[_0x3b2b('0x2f')]=_['intersection'](_0x43a2a4[_0x3b2b('0x2d')],_0x43a2a4['query']);_0x4c59b9[_0x3b2b('0x30')]=_[_0x3b2b('0x31')](_0x43a2a4[_0x3b2b('0x2d')],qs[_0x3b2b('0x32')](_0x2d023c[_0x3b2b('0x2e')][_0x3b2b('0x32')]));_0x4c59b9[_0x3b2b('0x30')]=_0x4c59b9[_0x3b2b('0x30')][_0x3b2b('0x33')]?_0x4c59b9[_0x3b2b('0x30')]:_0x43a2a4[_0x3b2b('0x2d')];if(!_0x2d023c[_0x3b2b('0x2e')][_0x3b2b('0x34')](_0x3b2b('0x35'))){_0x4c59b9['limit']=qs[_0x3b2b('0x1d')](_0x2d023c[_0x3b2b('0x2e')][_0x3b2b('0x1d')]);_0x4c59b9[_0x3b2b('0x1c')]=qs[_0x3b2b('0x1c')](_0x2d023c[_0x3b2b('0x2e')][_0x3b2b('0x1c')]);}_0x4c59b9[_0x3b2b('0x36')]=qs[_0x3b2b('0x37')](_0x2d023c['query']['sort']);_0x4c59b9[_0x3b2b('0x38')]=qs[_0x3b2b('0x2f')](_[_0x3b2b('0x39')](_0x2d023c[_0x3b2b('0x2e')],_0x43a2a4[_0x3b2b('0x2f')]),_0x5be80d);if(_0x2d023c[_0x3b2b('0x2e')][_0x3b2b('0x3a')]){_0x4c59b9[_0x3b2b('0x38')]=_[_0x3b2b('0x3b')](_0x4c59b9[_0x3b2b('0x38')],{'$or':_[_0x3b2b('0x28')](_0x5be80d,function(_0x36f0da){if(_0x36f0da[_0x3b2b('0x2c')]!==_0x3b2b('0x3c')){var _0x480959={};_0x480959[_0x36f0da[_0x3b2b('0x26')]]={'$like':'%'+_0x2d023c[_0x3b2b('0x2e')][_0x3b2b('0x3a')]+'%'};return _0x480959;}})});}_0x4c59b9=_[_0x3b2b('0x3b')]({},_0x4c59b9,_0x2d023c[_0x3b2b('0x3d')]);var _0x23234a={'where':_0x4c59b9[_0x3b2b('0x38')]};return db[_0x3b2b('0x29')][_0x3b2b('0x1b')](_0x23234a)[_0x3b2b('0x22')](function(_0x3f97a6){_0x396a2c['count']=_0x3f97a6;if(_0x2d023c['query'][_0x3b2b('0x3e')]){_0x4c59b9[_0x3b2b('0x3f')]=[{'all':!![]}];}return db[_0x3b2b('0x29')][_0x3b2b('0x40')](_0x4c59b9);})['then'](function(_0x452f8b){_0x396a2c[_0x3b2b('0x41')]=_0x452f8b;return _0x396a2c;})['then'](respondWithFilteredResult(_0x567ff9,_0x4c59b9))[_0x3b2b('0x42')](handleError(_0x567ff9,null));};exports[_0x3b2b('0x43')]=function(_0x1ebbb,_0x26c455){var _0x2fd1ee={'raw':![],'where':{'id':_0x1ebbb[_0x3b2b('0x44')]['id']}},_0xe3ce5e={};_0xe3ce5e['model']=_[_0x3b2b('0x45')](db[_0x3b2b('0x29')][_0x3b2b('0x2a')]);_0xe3ce5e['query']=_[_0x3b2b('0x45')](_0x1ebbb[_0x3b2b('0x2e')]);_0xe3ce5e[_0x3b2b('0x2f')]=_['intersection'](_0xe3ce5e[_0x3b2b('0x2d')],_0xe3ce5e[_0x3b2b('0x2e')]);_0x2fd1ee[_0x3b2b('0x30')]=_[_0x3b2b('0x31')](_0xe3ce5e['model'],qs[_0x3b2b('0x32')](_0x1ebbb[_0x3b2b('0x2e')][_0x3b2b('0x32')]));_0x2fd1ee[_0x3b2b('0x30')]=_0x2fd1ee[_0x3b2b('0x30')][_0x3b2b('0x33')]?_0x2fd1ee['attributes']:_0xe3ce5e[_0x3b2b('0x2d')];if(_0x1ebbb[_0x3b2b('0x2e')]['includeAll']){_0x2fd1ee[_0x3b2b('0x3f')]=[{'all':!![]}];}_0x2fd1ee=_['merge']({},_0x2fd1ee,_0x1ebbb[_0x3b2b('0x3d')]);return db['VtigerConfiguration'][_0x3b2b('0x46')](_0x2fd1ee)[_0x3b2b('0x22')](handleEntityNotFound(_0x26c455,null))[_0x3b2b('0x22')](respondWithResult(_0x26c455,null))[_0x3b2b('0x42')](handleError(_0x26c455,null));};exports[_0x3b2b('0x47')]=function(_0x195d56,_0x1a4235){return db[_0x3b2b('0x29')][_0x3b2b('0x47')](_0x195d56[_0x3b2b('0x48')],{})[_0x3b2b('0x22')](respondWithResult(_0x1a4235,0xc9))[_0x3b2b('0x42')](handleError(_0x1a4235,null));};exports['update']=function(_0xd6226c,_0x50bb72){if(_0xd6226c[_0x3b2b('0x48')]['id']){delete _0xd6226c[_0x3b2b('0x48')]['id'];}return db[_0x3b2b('0x29')]['find']({'where':{'id':_0xd6226c['params']['id']}})[_0x3b2b('0x22')](handleEntityNotFound(_0x50bb72,null))[_0x3b2b('0x22')](saveUpdates(_0xd6226c[_0x3b2b('0x48')],null))[_0x3b2b('0x22')](respondWithResult(_0x50bb72,null))['catch'](handleError(_0x50bb72,null));};exports[_0x3b2b('0x23')]=function(_0x2f4096,_0x5433cd){return db['VtigerConfiguration'][_0x3b2b('0x46')]({'where':{'id':_0x2f4096[_0x3b2b('0x44')]['id']}})['then'](handleEntityNotFound(_0x5433cd,null))[_0x3b2b('0x22')](removeEntity(_0x5433cd,null))[_0x3b2b('0x42')](handleError(_0x5433cd,null));};exports[_0x3b2b('0x49')]=function(_0x4982f3,_0x5e92b7,_0x4c357a){var _0x3134b3={};var _0x3aa475={};var _0xb6b52;var _0x2a6f9b;return db[_0x3b2b('0x29')][_0x3b2b('0x4a')]({'where':{'id':_0x4982f3[_0x3b2b('0x44')]['id']}})['then'](handleEntityNotFound(_0x5e92b7,null))['then'](function(_0x3366a0){if(_0x3366a0){_0xb6b52=_0x3366a0;_0x3aa475[_0x3b2b('0x2d')]=_['keys'](db[_0x3b2b('0x4b')][_0x3b2b('0x2a')]);_0x3aa475[_0x3b2b('0x2e')]=_[_0x3b2b('0x45')](_0x4982f3[_0x3b2b('0x2e')]);_0x3aa475['filters']=_[_0x3b2b('0x31')](_0x3aa475[_0x3b2b('0x2d')],_0x3aa475[_0x3b2b('0x2e')]);_0x3134b3['attributes']=_['intersection'](_0x3aa475['model'],qs[_0x3b2b('0x32')](_0x4982f3[_0x3b2b('0x2e')][_0x3b2b('0x32')]));_0x3134b3['attributes']=_0x3134b3[_0x3b2b('0x30')][_0x3b2b('0x33')]?_0x3134b3[_0x3b2b('0x30')]:_0x3aa475[_0x3b2b('0x2d')];_0x3134b3[_0x3b2b('0x36')]=qs[_0x3b2b('0x37')](_0x4982f3['query'][_0x3b2b('0x37')]);_0x3134b3[_0x3b2b('0x38')]=qs[_0x3b2b('0x2f')](_[_0x3b2b('0x39')](_0x4982f3['query'],_0x3aa475[_0x3b2b('0x2f')]));if(_0x4982f3[_0x3b2b('0x2e')][_0x3b2b('0x3a')]){_0x3134b3[_0x3b2b('0x38')]=_[_0x3b2b('0x3b')](_0x3134b3['where'],{'$or':_[_0x3b2b('0x28')](_0x3134b3['attributes'],function(_0xc505f5){var _0x31dc81={};_0x31dc81[_0xc505f5]={'$like':'%'+_0x4982f3[_0x3b2b('0x2e')]['filter']+'%'};return _0x31dc81;})});}_0x3134b3=_[_0x3b2b('0x3b')]({},_0x3134b3,_0x4982f3[_0x3b2b('0x3d')]);return _0xb6b52[_0x3b2b('0x49')](_0x3134b3);}})[_0x3b2b('0x22')](function(_0x1f0c97){if(_0x1f0c97){_0x2a6f9b=_0x1f0c97[_0x3b2b('0x33')];if(!_0x4982f3[_0x3b2b('0x2e')][_0x3b2b('0x34')](_0x3b2b('0x35'))){_0x3134b3['limit']=qs[_0x3b2b('0x1d')](_0x4982f3['query'][_0x3b2b('0x1d')]);_0x3134b3[_0x3b2b('0x1c')]=qs['offset'](_0x4982f3['query'][_0x3b2b('0x1c')]);}return _0xb6b52[_0x3b2b('0x49')](_0x3134b3);}})[_0x3b2b('0x22')](function(_0xb23a96){if(_0xb23a96){return _0xb23a96?{'count':_0x2a6f9b,'rows':_0xb23a96}:null;}})['then'](respondWithResult(_0x5e92b7,null))['catch'](handleError(_0x5e92b7,null));};exports[_0x3b2b('0x4c')]=function(_0x2416ef,_0x5518ca,_0x24fdcd){var _0x378cf4={};var _0x1a1a56={};var _0x4586b1;var _0x278a1f;return db[_0x3b2b('0x29')][_0x3b2b('0x4a')]({'where':{'id':_0x2416ef['params']['id']}})['then'](handleEntityNotFound(_0x5518ca,null))['then'](function(_0x546038){if(_0x546038){_0x4586b1=_0x546038;_0x1a1a56[_0x3b2b('0x2d')]=_[_0x3b2b('0x45')](db[_0x3b2b('0x4b')]['rawAttributes']);_0x1a1a56[_0x3b2b('0x2e')]=_[_0x3b2b('0x45')](_0x2416ef[_0x3b2b('0x2e')]);_0x1a1a56[_0x3b2b('0x2f')]=_[_0x3b2b('0x31')](_0x1a1a56['model'],_0x1a1a56[_0x3b2b('0x2e')]);_0x378cf4['attributes']=_[_0x3b2b('0x31')](_0x1a1a56[_0x3b2b('0x2d')],qs[_0x3b2b('0x32')](_0x2416ef['query'][_0x3b2b('0x32')]));_0x378cf4[_0x3b2b('0x30')]=_0x378cf4[_0x3b2b('0x30')][_0x3b2b('0x33')]?_0x378cf4[_0x3b2b('0x30')]:_0x1a1a56['model'];_0x378cf4[_0x3b2b('0x36')]=qs[_0x3b2b('0x37')](_0x2416ef[_0x3b2b('0x2e')][_0x3b2b('0x37')]);_0x378cf4[_0x3b2b('0x38')]=qs[_0x3b2b('0x2f')](_['pick'](_0x2416ef[_0x3b2b('0x2e')],_0x1a1a56['filters']));if(_0x2416ef[_0x3b2b('0x2e')][_0x3b2b('0x3a')]){_0x378cf4[_0x3b2b('0x38')]=_[_0x3b2b('0x3b')](_0x378cf4[_0x3b2b('0x38')],{'$or':_[_0x3b2b('0x28')](_0x378cf4[_0x3b2b('0x30')],function(_0x2cd6ba){var _0x59fe53={};_0x59fe53[_0x2cd6ba]={'$like':'%'+_0x2416ef[_0x3b2b('0x2e')]['filter']+'%'};return _0x59fe53;})});}_0x378cf4=_[_0x3b2b('0x3b')]({},_0x378cf4,_0x2416ef[_0x3b2b('0x3d')]);return _0x4586b1['getSubjects'](_0x378cf4);}})[_0x3b2b('0x22')](function(_0x4b8ce3){if(_0x4b8ce3){_0x278a1f=_0x4b8ce3[_0x3b2b('0x33')];if(!_0x2416ef[_0x3b2b('0x2e')][_0x3b2b('0x34')](_0x3b2b('0x35'))){_0x378cf4['limit']=qs[_0x3b2b('0x1d')](_0x2416ef[_0x3b2b('0x2e')][_0x3b2b('0x1d')]);_0x378cf4['offset']=qs[_0x3b2b('0x1c')](_0x2416ef[_0x3b2b('0x2e')]['offset']);}return _0x4586b1['getSubjects'](_0x378cf4);}})[_0x3b2b('0x22')](function(_0x11d597){if(_0x11d597){return _0x11d597?{'count':_0x278a1f,'rows':_0x11d597}:null;}})[_0x3b2b('0x22')](respondWithResult(_0x5518ca,null))['catch'](handleError(_0x5518ca,null));};exports[_0x3b2b('0x4d')]=function(_0x377383,_0x29a729,_0x4f3ca1){var _0x5af4fc={};var _0x503b25={};var _0x1f6289;var _0x31738a;return db[_0x3b2b('0x29')][_0x3b2b('0x4a')]({'where':{'id':_0x377383['params']['id']}})['then'](handleEntityNotFound(_0x29a729,null))[_0x3b2b('0x22')](function(_0x4fb74b){if(_0x4fb74b){_0x1f6289=_0x4fb74b;_0x503b25[_0x3b2b('0x2d')]=_[_0x3b2b('0x45')](db[_0x3b2b('0x4b')][_0x3b2b('0x2a')]);_0x503b25[_0x3b2b('0x2e')]=_['keys'](_0x377383[_0x3b2b('0x2e')]);_0x503b25[_0x3b2b('0x2f')]=_[_0x3b2b('0x31')](_0x503b25[_0x3b2b('0x2d')],_0x503b25[_0x3b2b('0x2e')]);_0x5af4fc[_0x3b2b('0x30')]=_[_0x3b2b('0x31')](_0x503b25['model'],qs[_0x3b2b('0x32')](_0x377383[_0x3b2b('0x2e')]['fields']));_0x5af4fc[_0x3b2b('0x30')]=_0x5af4fc[_0x3b2b('0x30')]['length']?_0x5af4fc[_0x3b2b('0x30')]:_0x503b25[_0x3b2b('0x2d')];_0x5af4fc['order']=qs[_0x3b2b('0x37')](_0x377383[_0x3b2b('0x2e')]['sort']);_0x5af4fc[_0x3b2b('0x38')]=qs[_0x3b2b('0x2f')](_['pick'](_0x377383[_0x3b2b('0x2e')],_0x503b25['filters']));if(_0x377383['query'][_0x3b2b('0x3a')]){_0x5af4fc[_0x3b2b('0x38')]=_[_0x3b2b('0x3b')](_0x5af4fc[_0x3b2b('0x38')],{'$or':_['map'](_0x5af4fc[_0x3b2b('0x30')],function(_0x45e448){var _0x4477ab={};_0x4477ab[_0x45e448]={'$like':'%'+_0x377383[_0x3b2b('0x2e')][_0x3b2b('0x3a')]+'%'};return _0x4477ab;})});}_0x5af4fc=_['merge']({},_0x5af4fc,_0x377383['options']);return _0x1f6289['getDescriptions'](_0x5af4fc);}})[_0x3b2b('0x22')](function(_0x440c83){if(_0x440c83){_0x31738a=_0x440c83[_0x3b2b('0x33')];if(!_0x377383[_0x3b2b('0x2e')][_0x3b2b('0x34')](_0x3b2b('0x35'))){_0x5af4fc[_0x3b2b('0x1d')]=qs[_0x3b2b('0x1d')](_0x377383[_0x3b2b('0x2e')]['limit']);_0x5af4fc[_0x3b2b('0x1c')]=qs[_0x3b2b('0x1c')](_0x377383[_0x3b2b('0x2e')][_0x3b2b('0x1c')]);}return _0x1f6289[_0x3b2b('0x4d')](_0x5af4fc);}})[_0x3b2b('0x22')](function(_0x5ef842){if(_0x5ef842){return _0x5ef842?{'count':_0x31738a,'rows':_0x5ef842}:null;}})['then'](respondWithResult(_0x29a729,null))['catch'](handleError(_0x29a729,null));}; \ No newline at end of file +var _0xed59=['intersection','fields','order','sort','where','filter','merge','VIRTUAL','findAll','rows','catch','show','params','rawAttributes','length','includeAll','include','options','find','body','getFields','findOne','VtigerField','hasOwnProperty','nolimit','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','VtigerConfiguration','fieldName','type','key','query','keys','filters','model','attributes'];(function(_0xc80702,_0x18ef50){var _0x4c4c76=function(_0x24ee31){while(--_0x24ee31){_0xc80702['push'](_0xc80702['shift']());}};_0x4c4c76(++_0x18ef50);}(_0xed59,0x112));var _0x9ed5=function(_0x1688c6,_0x5e50d1){_0x1688c6=_0x1688c6-0x0;var _0x594d2b=_0xed59[_0x1688c6];return _0x594d2b;};'use strict';var emlformat=require(_0x9ed5('0x0'));var rimraf=require(_0x9ed5('0x1'));var zipdir=require(_0x9ed5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9ed5('0x3'));var moment=require(_0x9ed5('0x4'));var BPromise=require(_0x9ed5('0x5'));var Mustache=require(_0x9ed5('0x6'));var util=require(_0x9ed5('0x7'));var path=require(_0x9ed5('0x8'));var sox=require(_0x9ed5('0x9'));var csv=require(_0x9ed5('0xa'));var ejs=require(_0x9ed5('0xb'));var fs=require('fs');var fs_extra=require(_0x9ed5('0xc'));var _=require(_0x9ed5('0xd'));var squel=require(_0x9ed5('0xe'));var crypto=require(_0x9ed5('0xf'));var jsforce=require(_0x9ed5('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x9ed5('0xa'));var querystring=require('querystring');var Papa=require(_0x9ed5('0x11'));var Redis=require('ioredis');var authService=require(_0x9ed5('0x12'));var qs=require(_0x9ed5('0x13'));var as=require(_0x9ed5('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9ed5('0x15'))('api');var utils=require(_0x9ed5('0x16'));var config=require(_0x9ed5('0x17'));var licenseUtil=require(_0x9ed5('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x144929,_0x4a1ebe){_0x4a1ebe=_0x4a1ebe||0xcc;return function(_0x124274){if(_0x124274){return _0x144929[_0x9ed5('0x19')](_0x4a1ebe);}return _0x144929[_0x9ed5('0x1a')](_0x4a1ebe)['end']();};}function respondWithResult(_0x528cfd,_0x368c31){_0x368c31=_0x368c31||0xc8;return function(_0x5765d8){if(_0x5765d8){return _0x528cfd[_0x9ed5('0x1a')](_0x368c31)[_0x9ed5('0x1b')](_0x5765d8);}};}function respondWithFilteredResult(_0x347846,_0x3c0cac){return function(_0x416419){if(_0x416419){var _0xda4421=typeof _0x3c0cac[_0x9ed5('0x1c')]===_0x9ed5('0x1d')&&typeof _0x3c0cac['limit']===_0x9ed5('0x1d');var _0x487493=_0x416419[_0x9ed5('0x1e')];var _0x4cd40e=_0xda4421?0x0:_0x3c0cac['offset'];var _0x53bd5d=_0xda4421?_0x416419['count']:_0x3c0cac[_0x9ed5('0x1c')]+_0x3c0cac[_0x9ed5('0x1f')];var _0x82ad19;if(_0x53bd5d>=_0x487493){_0x53bd5d=_0x487493;_0x82ad19=0xc8;}else{_0x82ad19=0xce;}_0x347846[_0x9ed5('0x1a')](_0x82ad19);return _0x347846[_0x9ed5('0x20')](_0x9ed5('0x21'),_0x4cd40e+'-'+_0x53bd5d+'/'+_0x487493)[_0x9ed5('0x1b')](_0x416419);}return null;};}function patchUpdates(_0x15b2c2){return function(_0x53cbda){try{jsonpatch[_0x9ed5('0x22')](_0x53cbda,_0x15b2c2,!![]);}catch(_0xc91536){return BPromise[_0x9ed5('0x23')](_0xc91536);}return _0x53cbda[_0x9ed5('0x24')]();};}function saveUpdates(_0x52545a,_0x21f467){return function(_0x1b3acb){if(_0x1b3acb){return _0x1b3acb[_0x9ed5('0x25')](_0x52545a)[_0x9ed5('0x26')](function(_0x2e6286){return _0x2e6286;});}return null;};}function removeEntity(_0xa6336d,_0x1e0648){return function(_0x42f5ff){if(_0x42f5ff){return _0x42f5ff[_0x9ed5('0x27')]()[_0x9ed5('0x26')](function(){_0xa6336d[_0x9ed5('0x1a')](0xcc)[_0x9ed5('0x28')]();});}};}function handleEntityNotFound(_0x77151d,_0x1b172a){return function(_0x4b22b7){if(!_0x4b22b7){_0x77151d[_0x9ed5('0x19')](0x194);}return _0x4b22b7;};}function handleError(_0x29d264,_0x3e5e38){_0x3e5e38=_0x3e5e38||0x1f4;return function(_0x28dccf){logger[_0x9ed5('0x29')](_0x28dccf[_0x9ed5('0x2a')]);if(_0x28dccf[_0x9ed5('0x2b')]){delete _0x28dccf['name'];}_0x29d264[_0x9ed5('0x1a')](_0x3e5e38)['send'](_0x28dccf);};}exports['index']=function(_0x46cf1c,_0x81edf0){var _0x5271fd={},_0x5d9768={},_0x34b2bf={'count':0x0,'rows':[]};var _0x3f40e4=_[_0x9ed5('0x2c')](db[_0x9ed5('0x2d')]['rawAttributes'],function(_0x3012c8){return{'name':_0x3012c8[_0x9ed5('0x2e')],'type':_0x3012c8[_0x9ed5('0x2f')][_0x9ed5('0x30')]};});_0x5d9768['model']=_[_0x9ed5('0x2c')](_0x3f40e4,'name');_0x5d9768[_0x9ed5('0x31')]=_[_0x9ed5('0x32')](_0x46cf1c[_0x9ed5('0x31')]);_0x5d9768[_0x9ed5('0x33')]=_['intersection'](_0x5d9768[_0x9ed5('0x34')],_0x5d9768[_0x9ed5('0x31')]);_0x5271fd[_0x9ed5('0x35')]=_[_0x9ed5('0x36')](_0x5d9768['model'],qs[_0x9ed5('0x37')](_0x46cf1c[_0x9ed5('0x31')]['fields']));_0x5271fd[_0x9ed5('0x35')]=_0x5271fd[_0x9ed5('0x35')]['length']?_0x5271fd['attributes']:_0x5d9768[_0x9ed5('0x34')];if(!_0x46cf1c[_0x9ed5('0x31')]['hasOwnProperty']('nolimit')){_0x5271fd['limit']=qs['limit'](_0x46cf1c[_0x9ed5('0x31')][_0x9ed5('0x1f')]);_0x5271fd[_0x9ed5('0x1c')]=qs['offset'](_0x46cf1c[_0x9ed5('0x31')]['offset']);}_0x5271fd[_0x9ed5('0x38')]=qs[_0x9ed5('0x39')](_0x46cf1c['query'][_0x9ed5('0x39')]);_0x5271fd[_0x9ed5('0x3a')]=qs['filters'](_['pick'](_0x46cf1c[_0x9ed5('0x31')],_0x5d9768[_0x9ed5('0x33')]),_0x3f40e4);if(_0x46cf1c[_0x9ed5('0x31')][_0x9ed5('0x3b')]){_0x5271fd['where']=_[_0x9ed5('0x3c')](_0x5271fd['where'],{'$or':_[_0x9ed5('0x2c')](_0x3f40e4,function(_0x40e337){if(_0x40e337[_0x9ed5('0x2f')]!==_0x9ed5('0x3d')){var _0x52d0aa={};_0x52d0aa[_0x40e337[_0x9ed5('0x2b')]]={'$like':'%'+_0x46cf1c['query'][_0x9ed5('0x3b')]+'%'};return _0x52d0aa;}})});}_0x5271fd=_[_0x9ed5('0x3c')]({},_0x5271fd,_0x46cf1c['options']);var _0x5e5a6c={'where':_0x5271fd['where']};return db[_0x9ed5('0x2d')][_0x9ed5('0x1e')](_0x5e5a6c)[_0x9ed5('0x26')](function(_0x5f496b){_0x34b2bf['count']=_0x5f496b;if(_0x46cf1c['query']['includeAll']){_0x5271fd['include']=[{'all':!![]}];}return db[_0x9ed5('0x2d')][_0x9ed5('0x3e')](_0x5271fd);})['then'](function(_0x163b28){_0x34b2bf[_0x9ed5('0x3f')]=_0x163b28;return _0x34b2bf;})[_0x9ed5('0x26')](respondWithFilteredResult(_0x81edf0,_0x5271fd))[_0x9ed5('0x40')](handleError(_0x81edf0,null));};exports[_0x9ed5('0x41')]=function(_0x57a29a,_0x4737d6){var _0x1d1220={'raw':![],'where':{'id':_0x57a29a[_0x9ed5('0x42')]['id']}},_0x2857a2={};_0x2857a2[_0x9ed5('0x34')]=_['keys'](db[_0x9ed5('0x2d')][_0x9ed5('0x43')]);_0x2857a2[_0x9ed5('0x31')]=_[_0x9ed5('0x32')](_0x57a29a['query']);_0x2857a2['filters']=_[_0x9ed5('0x36')](_0x2857a2[_0x9ed5('0x34')],_0x2857a2[_0x9ed5('0x31')]);_0x1d1220[_0x9ed5('0x35')]=_['intersection'](_0x2857a2['model'],qs[_0x9ed5('0x37')](_0x57a29a[_0x9ed5('0x31')][_0x9ed5('0x37')]));_0x1d1220['attributes']=_0x1d1220[_0x9ed5('0x35')][_0x9ed5('0x44')]?_0x1d1220[_0x9ed5('0x35')]:_0x2857a2[_0x9ed5('0x34')];if(_0x57a29a[_0x9ed5('0x31')][_0x9ed5('0x45')]){_0x1d1220[_0x9ed5('0x46')]=[{'all':!![]}];}_0x1d1220=_[_0x9ed5('0x3c')]({},_0x1d1220,_0x57a29a[_0x9ed5('0x47')]);return db[_0x9ed5('0x2d')][_0x9ed5('0x48')](_0x1d1220)[_0x9ed5('0x26')](handleEntityNotFound(_0x4737d6,null))['then'](respondWithResult(_0x4737d6,null))[_0x9ed5('0x40')](handleError(_0x4737d6,null));};exports['create']=function(_0x212622,_0x4550ab){return db[_0x9ed5('0x2d')]['create'](_0x212622[_0x9ed5('0x49')],{})[_0x9ed5('0x26')](respondWithResult(_0x4550ab,0xc9))[_0x9ed5('0x40')](handleError(_0x4550ab,null));};exports[_0x9ed5('0x25')]=function(_0x47fdab,_0x23a5da){if(_0x47fdab['body']['id']){delete _0x47fdab[_0x9ed5('0x49')]['id'];}return db[_0x9ed5('0x2d')][_0x9ed5('0x48')]({'where':{'id':_0x47fdab[_0x9ed5('0x42')]['id']}})['then'](handleEntityNotFound(_0x23a5da,null))[_0x9ed5('0x26')](saveUpdates(_0x47fdab[_0x9ed5('0x49')],null))['then'](respondWithResult(_0x23a5da,null))[_0x9ed5('0x40')](handleError(_0x23a5da,null));};exports[_0x9ed5('0x27')]=function(_0x40481b,_0x31e3d0){return db[_0x9ed5('0x2d')]['find']({'where':{'id':_0x40481b[_0x9ed5('0x42')]['id']}})[_0x9ed5('0x26')](handleEntityNotFound(_0x31e3d0,null))['then'](removeEntity(_0x31e3d0,null))['catch'](handleError(_0x31e3d0,null));};exports[_0x9ed5('0x4a')]=function(_0x36c603,_0x4e5767,_0x33af57){var _0xa2b2d4={};var _0x36c7ba={};var _0x269af1;var _0x40f50c;return db[_0x9ed5('0x2d')][_0x9ed5('0x4b')]({'where':{'id':_0x36c603[_0x9ed5('0x42')]['id']}})[_0x9ed5('0x26')](handleEntityNotFound(_0x4e5767,null))[_0x9ed5('0x26')](function(_0x4c6e4e){if(_0x4c6e4e){_0x269af1=_0x4c6e4e;_0x36c7ba['model']=_['keys'](db[_0x9ed5('0x4c')]['rawAttributes']);_0x36c7ba[_0x9ed5('0x31')]=_[_0x9ed5('0x32')](_0x36c603[_0x9ed5('0x31')]);_0x36c7ba['filters']=_['intersection'](_0x36c7ba[_0x9ed5('0x34')],_0x36c7ba[_0x9ed5('0x31')]);_0xa2b2d4['attributes']=_[_0x9ed5('0x36')](_0x36c7ba[_0x9ed5('0x34')],qs[_0x9ed5('0x37')](_0x36c603[_0x9ed5('0x31')][_0x9ed5('0x37')]));_0xa2b2d4[_0x9ed5('0x35')]=_0xa2b2d4[_0x9ed5('0x35')][_0x9ed5('0x44')]?_0xa2b2d4[_0x9ed5('0x35')]:_0x36c7ba[_0x9ed5('0x34')];_0xa2b2d4[_0x9ed5('0x38')]=qs[_0x9ed5('0x39')](_0x36c603[_0x9ed5('0x31')]['sort']);_0xa2b2d4[_0x9ed5('0x3a')]=qs[_0x9ed5('0x33')](_['pick'](_0x36c603[_0x9ed5('0x31')],_0x36c7ba[_0x9ed5('0x33')]));if(_0x36c603[_0x9ed5('0x31')][_0x9ed5('0x3b')]){_0xa2b2d4[_0x9ed5('0x3a')]=_['merge'](_0xa2b2d4['where'],{'$or':_[_0x9ed5('0x2c')](_0xa2b2d4[_0x9ed5('0x35')],function(_0x2ce4d9){var _0x33e8eb={};_0x33e8eb[_0x2ce4d9]={'$like':'%'+_0x36c603['query']['filter']+'%'};return _0x33e8eb;})});}_0xa2b2d4=_[_0x9ed5('0x3c')]({},_0xa2b2d4,_0x36c603[_0x9ed5('0x47')]);return _0x269af1[_0x9ed5('0x4a')](_0xa2b2d4);}})[_0x9ed5('0x26')](function(_0x50d429){if(_0x50d429){_0x40f50c=_0x50d429['length'];if(!_0x36c603['query'][_0x9ed5('0x4d')](_0x9ed5('0x4e'))){_0xa2b2d4[_0x9ed5('0x1f')]=qs[_0x9ed5('0x1f')](_0x36c603[_0x9ed5('0x31')][_0x9ed5('0x1f')]);_0xa2b2d4[_0x9ed5('0x1c')]=qs[_0x9ed5('0x1c')](_0x36c603[_0x9ed5('0x31')][_0x9ed5('0x1c')]);}return _0x269af1[_0x9ed5('0x4a')](_0xa2b2d4);}})[_0x9ed5('0x26')](function(_0x135c08){if(_0x135c08){return _0x135c08?{'count':_0x40f50c,'rows':_0x135c08}:null;}})[_0x9ed5('0x26')](respondWithResult(_0x4e5767,null))[_0x9ed5('0x40')](handleError(_0x4e5767,null));};exports['getSubjects']=function(_0x404fae,_0x115e3d,_0x30f916){var _0x21bb72={};var _0x1a8646={};var _0x42fbc1;var _0x4aef0a;return db[_0x9ed5('0x2d')][_0x9ed5('0x4b')]({'where':{'id':_0x404fae[_0x9ed5('0x42')]['id']}})['then'](handleEntityNotFound(_0x115e3d,null))[_0x9ed5('0x26')](function(_0x18f5f7){if(_0x18f5f7){_0x42fbc1=_0x18f5f7;_0x1a8646['model']=_[_0x9ed5('0x32')](db[_0x9ed5('0x4c')]['rawAttributes']);_0x1a8646[_0x9ed5('0x31')]=_[_0x9ed5('0x32')](_0x404fae[_0x9ed5('0x31')]);_0x1a8646['filters']=_[_0x9ed5('0x36')](_0x1a8646[_0x9ed5('0x34')],_0x1a8646[_0x9ed5('0x31')]);_0x21bb72[_0x9ed5('0x35')]=_[_0x9ed5('0x36')](_0x1a8646[_0x9ed5('0x34')],qs[_0x9ed5('0x37')](_0x404fae[_0x9ed5('0x31')][_0x9ed5('0x37')]));_0x21bb72[_0x9ed5('0x35')]=_0x21bb72['attributes'][_0x9ed5('0x44')]?_0x21bb72[_0x9ed5('0x35')]:_0x1a8646['model'];_0x21bb72[_0x9ed5('0x38')]=qs[_0x9ed5('0x39')](_0x404fae['query'][_0x9ed5('0x39')]);_0x21bb72[_0x9ed5('0x3a')]=qs[_0x9ed5('0x33')](_[_0x9ed5('0x4f')](_0x404fae['query'],_0x1a8646[_0x9ed5('0x33')]));if(_0x404fae[_0x9ed5('0x31')][_0x9ed5('0x3b')]){_0x21bb72[_0x9ed5('0x3a')]=_[_0x9ed5('0x3c')](_0x21bb72[_0x9ed5('0x3a')],{'$or':_[_0x9ed5('0x2c')](_0x21bb72[_0x9ed5('0x35')],function(_0x51cf06){var _0x4fedd7={};_0x4fedd7[_0x51cf06]={'$like':'%'+_0x404fae[_0x9ed5('0x31')][_0x9ed5('0x3b')]+'%'};return _0x4fedd7;})});}_0x21bb72=_[_0x9ed5('0x3c')]({},_0x21bb72,_0x404fae['options']);return _0x42fbc1['getSubjects'](_0x21bb72);}})[_0x9ed5('0x26')](function(_0x4be141){if(_0x4be141){_0x4aef0a=_0x4be141[_0x9ed5('0x44')];if(!_0x404fae[_0x9ed5('0x31')][_0x9ed5('0x4d')](_0x9ed5('0x4e'))){_0x21bb72[_0x9ed5('0x1f')]=qs[_0x9ed5('0x1f')](_0x404fae[_0x9ed5('0x31')][_0x9ed5('0x1f')]);_0x21bb72[_0x9ed5('0x1c')]=qs[_0x9ed5('0x1c')](_0x404fae[_0x9ed5('0x31')][_0x9ed5('0x1c')]);}return _0x42fbc1[_0x9ed5('0x50')](_0x21bb72);}})['then'](function(_0x5eed03){if(_0x5eed03){return _0x5eed03?{'count':_0x4aef0a,'rows':_0x5eed03}:null;}})[_0x9ed5('0x26')](respondWithResult(_0x115e3d,null))[_0x9ed5('0x40')](handleError(_0x115e3d,null));};exports[_0x9ed5('0x51')]=function(_0x350835,_0x54e6e2,_0xecb8fd){var _0x4686ba={};var _0x204db6={};var _0x323f31;var _0x348774;return db['VtigerConfiguration'][_0x9ed5('0x4b')]({'where':{'id':_0x350835[_0x9ed5('0x42')]['id']}})[_0x9ed5('0x26')](handleEntityNotFound(_0x54e6e2,null))[_0x9ed5('0x26')](function(_0x212ee7){if(_0x212ee7){_0x323f31=_0x212ee7;_0x204db6['model']=_[_0x9ed5('0x32')](db['VtigerField'][_0x9ed5('0x43')]);_0x204db6[_0x9ed5('0x31')]=_[_0x9ed5('0x32')](_0x350835[_0x9ed5('0x31')]);_0x204db6[_0x9ed5('0x33')]=_[_0x9ed5('0x36')](_0x204db6[_0x9ed5('0x34')],_0x204db6['query']);_0x4686ba['attributes']=_['intersection'](_0x204db6[_0x9ed5('0x34')],qs[_0x9ed5('0x37')](_0x350835['query'][_0x9ed5('0x37')]));_0x4686ba[_0x9ed5('0x35')]=_0x4686ba['attributes'][_0x9ed5('0x44')]?_0x4686ba[_0x9ed5('0x35')]:_0x204db6[_0x9ed5('0x34')];_0x4686ba[_0x9ed5('0x38')]=qs[_0x9ed5('0x39')](_0x350835[_0x9ed5('0x31')]['sort']);_0x4686ba[_0x9ed5('0x3a')]=qs['filters'](_[_0x9ed5('0x4f')](_0x350835['query'],_0x204db6[_0x9ed5('0x33')]));if(_0x350835[_0x9ed5('0x31')][_0x9ed5('0x3b')]){_0x4686ba[_0x9ed5('0x3a')]=_[_0x9ed5('0x3c')](_0x4686ba[_0x9ed5('0x3a')],{'$or':_[_0x9ed5('0x2c')](_0x4686ba[_0x9ed5('0x35')],function(_0x2b56d7){var _0x3d36d3={};_0x3d36d3[_0x2b56d7]={'$like':'%'+_0x350835['query'][_0x9ed5('0x3b')]+'%'};return _0x3d36d3;})});}_0x4686ba=_[_0x9ed5('0x3c')]({},_0x4686ba,_0x350835[_0x9ed5('0x47')]);return _0x323f31[_0x9ed5('0x51')](_0x4686ba);}})[_0x9ed5('0x26')](function(_0x2e187d){if(_0x2e187d){_0x348774=_0x2e187d[_0x9ed5('0x44')];if(!_0x350835[_0x9ed5('0x31')][_0x9ed5('0x4d')]('nolimit')){_0x4686ba[_0x9ed5('0x1f')]=qs[_0x9ed5('0x1f')](_0x350835['query'][_0x9ed5('0x1f')]);_0x4686ba[_0x9ed5('0x1c')]=qs[_0x9ed5('0x1c')](_0x350835[_0x9ed5('0x31')]['offset']);}return _0x323f31['getDescriptions'](_0x4686ba);}})['then'](function(_0x5d0860){if(_0x5d0860){return _0x5d0860?{'count':_0x348774,'rows':_0x5d0860}:null;}})[_0x9ed5('0x26')](respondWithResult(_0x54e6e2,null))['catch'](handleError(_0x54e6e2,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index fa320c5..12eb2ef 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 _0xe730=['path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x7edc0a,_0x1e4437){var _0x4cf0ce=function(_0x8cd0dc){while(--_0x8cd0dc){_0x7edc0a['push'](_0x7edc0a['shift']());}};_0x4cf0ce(++_0x1e4437);}(_0xe730,0x96));var _0x0e73=function(_0x4127cb,_0x508a52){_0x4127cb=_0x4127cb-0x0;var _0x2143af=_0xe730[_0x4127cb];return _0x2143af;};'use strict';var _=require(_0x0e73('0x0'));var util=require(_0x0e73('0x1'));var logger=require(_0x0e73('0x2'))(_0x0e73('0x3'));var moment=require(_0x0e73('0x4'));var BPromise=require(_0x0e73('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0e73('0x6'));var rimraf=require(_0x0e73('0x7'));var config=require(_0x0e73('0x8'));var attributes=require(_0x0e73('0x9'));module[_0x0e73('0xa')]=function(_0x1d4373,_0x590c61){return _0x1d4373[_0x0e73('0xb')]('VtigerConfiguration',attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x549f=['api','moment','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger'];(function(_0x679df6,_0x137da1){var _0x273eb=function(_0x519937){while(--_0x519937){_0x679df6['push'](_0x679df6['shift']());}};_0x273eb(++_0x137da1);}(_0x549f,0x1b5));var _0xf549=function(_0x2289aa,_0x688de9){_0x2289aa=_0x2289aa-0x0;var _0x5672b0=_0x549f[_0x2289aa];return _0x5672b0;};'use strict';var _=require(_0xf549('0x0'));var util=require(_0xf549('0x1'));var logger=require(_0xf549('0x2'))(_0xf549('0x3'));var moment=require(_0xf549('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf549('0x5'));var config=require(_0xf549('0x6'));var attributes=require(_0xf549('0x7'));module[_0xf549('0x8')]=function(_0x2bb77f,_0x11757c){return _0x2bb77f['define'](_0xf549('0x9'),attributes,{'tableName':_0xf549('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index cd0d2b7..3dcfeaf 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 _0x2951=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','error','message'];(function(_0x1c851f,_0x58a11b){var _0x2f7efb=function(_0x24de2d){while(--_0x24de2d){_0x1c851f['push'](_0x1c851f['shift']());}};_0x2f7efb(++_0x58a11b);}(_0x2951,0xc0));var _0x1295=function(_0x10dc60,_0x2fcce1){_0x10dc60=_0x10dc60-0x0;var _0x47dec5=_0x2951[_0x10dc60];return _0x47dec5;};'use strict';var _=require(_0x1295('0x0'));var util=require('util');var moment=require(_0x1295('0x1'));var BPromise=require(_0x1295('0x2'));var rs=require(_0x1295('0x3'));var fs=require('fs');var Redis=require(_0x1295('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1295('0x5'));var logger=require('../../config/logger')(_0x1295('0x6'));var config=require('../../config/environment');var jayson=require(_0x1295('0x7'));var client=jayson[_0x1295('0x8')][_0x1295('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3aacec,_0x4aa589,_0x4d2cb1){return new BPromise(function(_0xac47c1,_0x212d4a){return client[_0x1295('0xa')](_0x3aacec,_0x4d2cb1)[_0x1295('0xb')](function(_0x32a97a){logger[_0x1295('0xc')](_0x1295('0xd'),_0x4aa589,_0x1295('0xe'));logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x4aa589,_0x1295('0xe'),JSON['stringify'](_0x32a97a));if(_0x32a97a['error']){if(_0x32a97a['error']['code']===0x1f4){logger[_0x1295('0xf')](_0x1295('0xd'),_0x4aa589,_0x32a97a[_0x1295('0xf')][_0x1295('0x10')]);return _0x212d4a(_0x32a97a[_0x1295('0xf')][_0x1295('0x10')]);}logger[_0x1295('0xf')](_0x1295('0xd'),_0x4aa589,_0x32a97a[_0x1295('0xf')][_0x1295('0x10')]);return _0xac47c1(_0x32a97a['error'][_0x1295('0x10')]);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x4aa589,_0x1295('0xe'));_0xac47c1(_0x32a97a[_0x1295('0x11')]['message']);}})[_0x1295('0x12')](function(_0xfb4809){logger[_0x1295('0xf')](_0x1295('0xd'),_0x4aa589,_0xfb4809);_0x212d4a(_0xfb4809);});});} \ No newline at end of file +var _0x8e14=['request\x20sent','stringify','error','VtigerConfiguration,\x20%s,\x20%s','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8e14,0x1d3));var _0x48e1=function(_0x39ca8b,_0x1752af){_0x39ca8b=_0x39ca8b-0x0;var _0xc0ba73=_0x8e14[_0x39ca8b];return _0xc0ba73;};'use strict';var _=require(_0x48e1('0x0'));var util=require(_0x48e1('0x1'));var moment=require(_0x48e1('0x2'));var BPromise=require('bluebird');var rs=require(_0x48e1('0x3'));var fs=require('fs');var Redis=require(_0x48e1('0x4'));var db=require(_0x48e1('0x5'))['db'];var utils=require(_0x48e1('0x6'));var logger=require(_0x48e1('0x7'))(_0x48e1('0x8'));var config=require(_0x48e1('0x9'));var jayson=require(_0x48e1('0xa'));var client=jayson[_0x48e1('0xb')][_0x48e1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x10d337,_0x5c75df,_0x155728){return new BPromise(function(_0x45873f,_0x5c437f){return client['request'](_0x10d337,_0x155728)[_0x48e1('0xd')](function(_0x1b2f05){logger[_0x48e1('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x5c75df,'request\x20sent');logger[_0x48e1('0xf')](_0x48e1('0x10'),_0x5c75df,_0x48e1('0x11'),JSON[_0x48e1('0x12')](_0x1b2f05));if(_0x1b2f05[_0x48e1('0x13')]){if(_0x1b2f05[_0x48e1('0x13')]['code']===0x1f4){logger[_0x48e1('0x13')](_0x48e1('0x14'),_0x5c75df,_0x1b2f05['error']['message']);return _0x5c437f(_0x1b2f05[_0x48e1('0x13')][_0x48e1('0x15')]);}logger['error'](_0x48e1('0x14'),_0x5c75df,_0x1b2f05['error'][_0x48e1('0x15')]);return _0x45873f(_0x1b2f05['error'][_0x48e1('0x15')]);}else{logger[_0x48e1('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x5c75df,'request\x20sent');_0x45873f(_0x1b2f05['result'][_0x48e1('0x15')]);}})['catch'](function(_0x2b9057){logger[_0x48e1('0x13')](_0x48e1('0x14'),_0x5c75df,_0x2b9057);_0x5c437f(_0x2b9057);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 31f5595..f437e13 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 _0x1cdc=['../../components/auth/service','./intVtigerField.controller','isAuthenticated','index','get','post','create','update','delete','/:id','exports','multer','path','express','Router','fs-extra'];(function(_0x576a20,_0x2da761){var _0x6e57a0=function(_0x20701b){while(--_0x20701b){_0x576a20['push'](_0x576a20['shift']());}};_0x6e57a0(++_0x2da761);}(_0x1cdc,0x1eb));var _0xc1cd=function(_0x296906,_0x2c3767){_0x296906=_0x296906-0x0;var _0x42a703=_0x1cdc[_0x296906];return _0x42a703;};'use strict';var multer=require(_0xc1cd('0x0'));var util=require('util');var path=require(_0xc1cd('0x1'));var timeout=require('connect-timeout');var express=require(_0xc1cd('0x2'));var router=express[_0xc1cd('0x3')]();var fs_extra=require(_0xc1cd('0x4'));var auth=require(_0xc1cd('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc1cd('0x6'));router['get']('/',auth[_0xc1cd('0x7')](),controller[_0xc1cd('0x8')]);router[_0xc1cd('0x9')]('/:id',auth[_0xc1cd('0x7')](),controller['show']);router[_0xc1cd('0xa')]('/',auth[_0xc1cd('0x7')](),controller[_0xc1cd('0xb')]);router['put']('/:id',auth[_0xc1cd('0x7')](),controller[_0xc1cd('0xc')]);router[_0xc1cd('0xd')](_0xc1cd('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xc1cd('0xf')]=router; \ No newline at end of file +var _0xa44f=['delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x5ab08e,_0x2cf537){var _0x52234e=function(_0x981fbb){while(--_0x981fbb){_0x5ab08e['push'](_0x5ab08e['shift']());}};_0x52234e(++_0x2cf537);}(_0xa44f,0xcb));var _0xfa44=function(_0x3baa8a,_0x5258d2){_0x3baa8a=_0x3baa8a-0x0;var _0x59ddea=_0xa44f[_0x3baa8a];return _0x59ddea;};'use strict';var multer=require('multer');var util=require(_0xfa44('0x0'));var path=require(_0xfa44('0x1'));var timeout=require(_0xfa44('0x2'));var express=require(_0xfa44('0x3'));var router=express[_0xfa44('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfa44('0x5'));var interaction=require(_0xfa44('0x6'));var config=require('../../config/environment');var controller=require(_0xfa44('0x7'));router[_0xfa44('0x8')]('/',auth[_0xfa44('0x9')](),controller[_0xfa44('0xa')]);router[_0xfa44('0x8')]('/:id',auth[_0xfa44('0x9')](),controller[_0xfa44('0xb')]);router[_0xfa44('0xc')]('/',auth['isAuthenticated'](),controller[_0xfa44('0xd')]);router[_0xfa44('0xe')](_0xfa44('0xf'),auth[_0xfa44('0x9')](),controller[_0xfa44('0x10')]);router[_0xfa44('0x11')](_0xfa44('0xf'),auth[_0xfa44('0x9')](),controller[_0xfa44('0x12')]);module[_0xfa44('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index b4f73f0..19fa2d9 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 _0xe66e=['picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xe66e,0xae));var _0xee66=function(_0xd63e3a,_0x1bd6eb){_0xd63e3a=_0xd63e3a-0x0;var _0x19c178=_0xe66e[_0xd63e3a];return _0x19c178;};'use strict';var Sequelize=require(_0xee66('0x0'));module[_0xee66('0x1')]={'type':{'type':Sequelize[_0xee66('0x2')]('string',_0xee66('0x3'),_0xee66('0x4'),_0xee66('0x5'),_0xee66('0x6')),'defaultValue':_0xee66('0x7')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xee66('0x8')]},'keyType':{'type':Sequelize[_0xee66('0x2')]('string',_0xee66('0x3'),_0xee66('0x4'))},'keyContent':{'type':Sequelize[_0xee66('0x8')]},'idField':{'type':Sequelize[_0xee66('0x8')]},'nameField':{'type':Sequelize[_0xee66('0x8')]},'customField':{'type':Sequelize[_0xee66('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xee66('0x8')]}}; \ No newline at end of file +var _0x3f63=['string','variable','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0xb6516e,_0x2c0401){var _0x575bed=function(_0x2ff90a){while(--_0x2ff90a){_0xb6516e['push'](_0xb6516e['shift']());}};_0x575bed(++_0x2c0401);}(_0x3f63,0xc1));var _0x33f6=function(_0x4efa2d,_0x551d6b){_0x4efa2d=_0x4efa2d-0x0;var _0x5311a7=_0x3f63[_0x4efa2d];return _0x5311a7;};'use strict';var Sequelize=require(_0x33f6('0x0'));module[_0x33f6('0x1')]={'type':{'type':Sequelize[_0x33f6('0x2')](_0x33f6('0x3'),_0x33f6('0x4'),'customVariable','keyValue','picklist'),'defaultValue':_0x33f6('0x3')},'content':{'type':Sequelize[_0x33f6('0x5')]},'key':{'type':Sequelize[_0x33f6('0x5')]},'keyType':{'type':Sequelize[_0x33f6('0x2')](_0x33f6('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x33f6('0x5')]},'idField':{'type':Sequelize[_0x33f6('0x5')]},'nameField':{'type':Sequelize[_0x33f6('0x5')]},'customField':{'type':Sequelize[_0x33f6('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index ee1bf17..a2c2e6e 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 _0x8395=['include','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','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','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','stack','name','index','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','VtigerField','includeAll'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x8395,0x9d));var _0x5839=function(_0x2d2ca2,_0x51873f){_0x2d2ca2=_0x2d2ca2-0x0;var _0x48489d=_0x8395[_0x2d2ca2];return _0x48489d;};'use strict';var emlformat=require(_0x5839('0x0'));var rimraf=require(_0x5839('0x1'));var zipdir=require(_0x5839('0x2'));var jsonpatch=require(_0x5839('0x3'));var rp=require(_0x5839('0x4'));var moment=require('moment');var BPromise=require(_0x5839('0x5'));var Mustache=require(_0x5839('0x6'));var util=require(_0x5839('0x7'));var path=require(_0x5839('0x8'));var sox=require(_0x5839('0x9'));var csv=require(_0x5839('0xa'));var ejs=require(_0x5839('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5839('0xc'));var squel=require(_0x5839('0xd'));var crypto=require('crypto');var jsforce=require(_0x5839('0xe'));var deskjs=require(_0x5839('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5839('0x10'));var Redis=require(_0x5839('0x11'));var authService=require(_0x5839('0x12'));var qs=require(_0x5839('0x13'));var as=require(_0x5839('0x14'));var hardwareService=require(_0x5839('0x15'));var logger=require(_0x5839('0x16'))(_0x5839('0x17'));var utils=require(_0x5839('0x18'));var config=require(_0x5839('0x19'));var licenseUtil=require(_0x5839('0x1a'));var db=require(_0x5839('0x1b'))['db'];function respondWithStatusCode(_0x2f51bd,_0x32a839){_0x32a839=_0x32a839||0xcc;return function(_0x5eef87){if(_0x5eef87){return _0x2f51bd[_0x5839('0x1c')](_0x32a839);}return _0x2f51bd[_0x5839('0x1d')](_0x32a839)[_0x5839('0x1e')]();};}function respondWithResult(_0x3a8d2a,_0x2b3fd0){_0x2b3fd0=_0x2b3fd0||0xc8;return function(_0x50a766){if(_0x50a766){return _0x3a8d2a['status'](_0x2b3fd0)[_0x5839('0x1f')](_0x50a766);}};}function respondWithFilteredResult(_0xe9a24f,_0x1d4998){return function(_0x1d5d4f){if(_0x1d5d4f){var _0x2748e1=typeof _0x1d4998[_0x5839('0x20')]===_0x5839('0x21')&&typeof _0x1d4998[_0x5839('0x22')]==='undefined';var _0x41f71b=_0x1d5d4f[_0x5839('0x23')];var _0x209a58=_0x2748e1?0x0:_0x1d4998[_0x5839('0x20')];var _0x4b70cc=_0x2748e1?_0x1d5d4f[_0x5839('0x23')]:_0x1d4998[_0x5839('0x20')]+_0x1d4998['limit'];var _0x349c6d;if(_0x4b70cc>=_0x41f71b){_0x4b70cc=_0x41f71b;_0x349c6d=0xc8;}else{_0x349c6d=0xce;}_0xe9a24f[_0x5839('0x1d')](_0x349c6d);return _0xe9a24f['set'](_0x5839('0x24'),_0x209a58+'-'+_0x4b70cc+'/'+_0x41f71b)[_0x5839('0x1f')](_0x1d5d4f);}return null;};}function patchUpdates(_0x260a84){return function(_0x21b58e){try{jsonpatch['apply'](_0x21b58e,_0x260a84,!![]);}catch(_0x398968){return BPromise[_0x5839('0x25')](_0x398968);}return _0x21b58e[_0x5839('0x26')]();};}function saveUpdates(_0x3b2a94,_0xf6ee9e){return function(_0x1ad3fa){if(_0x1ad3fa){return _0x1ad3fa[_0x5839('0x27')](_0x3b2a94)[_0x5839('0x28')](function(_0x563e2e){return _0x563e2e;});}return null;};}function removeEntity(_0x1bf5a3,_0x19b681){return function(_0x1928f4){if(_0x1928f4){return _0x1928f4[_0x5839('0x29')]()[_0x5839('0x28')](function(){_0x1bf5a3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e7df3,_0x142377){return function(_0x41b1d6){if(!_0x41b1d6){_0x3e7df3[_0x5839('0x1c')](0x194);}return _0x41b1d6;};}function handleError(_0x5f25fa,_0xd3f8f4){_0xd3f8f4=_0xd3f8f4||0x1f4;return function(_0x41d057){logger['error'](_0x41d057[_0x5839('0x2a')]);if(_0x41d057[_0x5839('0x2b')]){delete _0x41d057[_0x5839('0x2b')];}_0x5f25fa['status'](_0xd3f8f4)['send'](_0x41d057);};}exports[_0x5839('0x2c')]=function(_0x4bd669,_0x13c244){var _0x876d11={},_0x2b3fc9={},_0xcc61f6={'count':0x0,'rows':[]};var _0x177ed3=_['map'](db['VtigerField']['rawAttributes'],function(_0x497754){return{'name':_0x497754[_0x5839('0x2d')],'type':_0x497754[_0x5839('0x2e')][_0x5839('0x2f')]};});_0x2b3fc9[_0x5839('0x30')]=_[_0x5839('0x31')](_0x177ed3,_0x5839('0x2b'));_0x2b3fc9['query']=_[_0x5839('0x32')](_0x4bd669[_0x5839('0x33')]);_0x2b3fc9[_0x5839('0x34')]=_[_0x5839('0x35')](_0x2b3fc9[_0x5839('0x30')],_0x2b3fc9[_0x5839('0x33')]);_0x876d11['attributes']=_[_0x5839('0x35')](_0x2b3fc9[_0x5839('0x30')],qs[_0x5839('0x36')](_0x4bd669[_0x5839('0x33')][_0x5839('0x36')]));_0x876d11['attributes']=_0x876d11[_0x5839('0x37')][_0x5839('0x38')]?_0x876d11[_0x5839('0x37')]:_0x2b3fc9[_0x5839('0x30')];if(!_0x4bd669[_0x5839('0x33')][_0x5839('0x39')](_0x5839('0x3a'))){_0x876d11[_0x5839('0x22')]=qs[_0x5839('0x22')](_0x4bd669[_0x5839('0x33')][_0x5839('0x22')]);_0x876d11[_0x5839('0x20')]=qs[_0x5839('0x20')](_0x4bd669[_0x5839('0x33')][_0x5839('0x20')]);}_0x876d11[_0x5839('0x3b')]=qs[_0x5839('0x3c')](_0x4bd669[_0x5839('0x33')][_0x5839('0x3c')]);_0x876d11[_0x5839('0x3d')]=qs[_0x5839('0x34')](_['pick'](_0x4bd669[_0x5839('0x33')],_0x2b3fc9['filters']),_0x177ed3);if(_0x4bd669[_0x5839('0x33')][_0x5839('0x3e')]){_0x876d11[_0x5839('0x3d')]=_['merge'](_0x876d11[_0x5839('0x3d')],{'$or':_['map'](_0x177ed3,function(_0x1ee3a5){if(_0x1ee3a5[_0x5839('0x2e')]!==_0x5839('0x3f')){var _0x43dacb={};_0x43dacb[_0x1ee3a5[_0x5839('0x2b')]]={'$like':'%'+_0x4bd669[_0x5839('0x33')][_0x5839('0x3e')]+'%'};return _0x43dacb;}})});}_0x876d11=_[_0x5839('0x40')]({},_0x876d11,_0x4bd669[_0x5839('0x41')]);var _0x3fb685={'where':_0x876d11[_0x5839('0x3d')]};return db[_0x5839('0x42')]['count'](_0x3fb685)[_0x5839('0x28')](function(_0x4ef463){_0xcc61f6[_0x5839('0x23')]=_0x4ef463;if(_0x4bd669[_0x5839('0x33')][_0x5839('0x43')]){_0x876d11[_0x5839('0x44')]=[{'all':!![]}];}return db[_0x5839('0x42')]['findAll'](_0x876d11);})[_0x5839('0x28')](function(_0x4d3c68){_0xcc61f6['rows']=_0x4d3c68;return _0xcc61f6;})[_0x5839('0x28')](respondWithFilteredResult(_0x13c244,_0x876d11))[_0x5839('0x45')](handleError(_0x13c244,null));};exports[_0x5839('0x46')]=function(_0xb7dd30,_0x10050d){var _0x45a240={'raw':!![],'where':{'id':_0xb7dd30['params']['id']}},_0x10022e={};_0x10022e[_0x5839('0x30')]=_['keys'](db['VtigerField']['rawAttributes']);_0x10022e[_0x5839('0x33')]=_[_0x5839('0x32')](_0xb7dd30[_0x5839('0x33')]);_0x10022e[_0x5839('0x34')]=_[_0x5839('0x35')](_0x10022e['model'],_0x10022e[_0x5839('0x33')]);_0x45a240[_0x5839('0x37')]=_[_0x5839('0x35')](_0x10022e[_0x5839('0x30')],qs['fields'](_0xb7dd30[_0x5839('0x33')][_0x5839('0x36')]));_0x45a240['attributes']=_0x45a240[_0x5839('0x37')][_0x5839('0x38')]?_0x45a240['attributes']:_0x10022e[_0x5839('0x30')];if(_0xb7dd30['query']['includeAll']){_0x45a240[_0x5839('0x44')]=[{'all':!![]}];}_0x45a240=_[_0x5839('0x40')]({},_0x45a240,_0xb7dd30[_0x5839('0x41')]);return db[_0x5839('0x42')][_0x5839('0x47')](_0x45a240)[_0x5839('0x28')](handleEntityNotFound(_0x10050d,null))[_0x5839('0x28')](respondWithResult(_0x10050d,null))[_0x5839('0x45')](handleError(_0x10050d,null));};exports[_0x5839('0x48')]=function(_0x4008bf,_0x10c7f7){return db[_0x5839('0x42')][_0x5839('0x48')](_0x4008bf[_0x5839('0x49')],{})[_0x5839('0x28')](respondWithResult(_0x10c7f7,0xc9))[_0x5839('0x45')](handleError(_0x10c7f7,null));};exports[_0x5839('0x27')]=function(_0x57a2ba,_0x309653){if(_0x57a2ba[_0x5839('0x49')]['id']){delete _0x57a2ba[_0x5839('0x49')]['id'];}return db['VtigerField'][_0x5839('0x47')]({'where':{'id':_0x57a2ba[_0x5839('0x4a')]['id']}})['then'](handleEntityNotFound(_0x309653,null))[_0x5839('0x28')](saveUpdates(_0x57a2ba['body'],null))['then'](respondWithResult(_0x309653,null))['catch'](handleError(_0x309653,null));};exports[_0x5839('0x29')]=function(_0x3927b4,_0x54b698){return db[_0x5839('0x42')][_0x5839('0x47')]({'where':{'id':_0x3927b4['params']['id']}})[_0x5839('0x28')](handleEntityNotFound(_0x54b698,null))[_0x5839('0x28')](removeEntity(_0x54b698,null))['catch'](handleError(_0x54b698,null));}; \ No newline at end of file +var _0xbeed=['limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VtigerField','includeAll','include','findAll','rows','params','keys','find','catch','create','body','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x592e40,_0x2ed011){var _0x5d4288=function(_0x366e87){while(--_0x366e87){_0x592e40['push'](_0x592e40['shift']());}};_0x5d4288(++_0x2ed011);}(_0xbeed,0xb3));var _0xdbee=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbeed[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdbee('0x0'));var moment=require(_0xdbee('0x1'));var BPromise=require(_0xdbee('0x2'));var Mustache=require(_0xdbee('0x3'));var util=require(_0xdbee('0x4'));var path=require(_0xdbee('0x5'));var sox=require('sox');var csv=require(_0xdbee('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdbee('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xdbee('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xdbee('0x9'));var toCsv=require('to-csv');var querystring=require(_0xdbee('0xa'));var Papa=require(_0xdbee('0xb'));var Redis=require(_0xdbee('0xc'));var authService=require(_0xdbee('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xdbee('0xe'));var hardwareService=require(_0xdbee('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdbee('0x10'))['db'];function respondWithStatusCode(_0x45aa24,_0x1262a9){_0x1262a9=_0x1262a9||0xcc;return function(_0x21593e){if(_0x21593e){return _0x45aa24[_0xdbee('0x11')](_0x1262a9);}return _0x45aa24[_0xdbee('0x12')](_0x1262a9)[_0xdbee('0x13')]();};}function respondWithResult(_0x3d6919,_0x31118f){_0x31118f=_0x31118f||0xc8;return function(_0x56366e){if(_0x56366e){return _0x3d6919[_0xdbee('0x12')](_0x31118f)['json'](_0x56366e);}};}function respondWithFilteredResult(_0x5cd8bb,_0x2d6053){return function(_0x361482){if(_0x361482){var _0x399de9=typeof _0x2d6053[_0xdbee('0x14')]===_0xdbee('0x15')&&typeof _0x2d6053[_0xdbee('0x16')]===_0xdbee('0x15');var _0x41b878=_0x361482[_0xdbee('0x17')];var _0x25eb9e=_0x399de9?0x0:_0x2d6053[_0xdbee('0x14')];var _0xc25d1f=_0x399de9?_0x361482[_0xdbee('0x17')]:_0x2d6053[_0xdbee('0x14')]+_0x2d6053[_0xdbee('0x16')];var _0x448074;if(_0xc25d1f>=_0x41b878){_0xc25d1f=_0x41b878;_0x448074=0xc8;}else{_0x448074=0xce;}_0x5cd8bb[_0xdbee('0x12')](_0x448074);return _0x5cd8bb['set'](_0xdbee('0x18'),_0x25eb9e+'-'+_0xc25d1f+'/'+_0x41b878)['json'](_0x361482);}return null;};}function patchUpdates(_0x431531){return function(_0x39cecf){try{jsonpatch[_0xdbee('0x19')](_0x39cecf,_0x431531,!![]);}catch(_0x5b32bb){return BPromise[_0xdbee('0x1a')](_0x5b32bb);}return _0x39cecf[_0xdbee('0x1b')]();};}function saveUpdates(_0x320898,_0xca36d0){return function(_0x2dc3b1){if(_0x2dc3b1){return _0x2dc3b1[_0xdbee('0x1c')](_0x320898)[_0xdbee('0x1d')](function(_0x4f9052){return _0x4f9052;});}return null;};}function removeEntity(_0x55c3b8,_0xaa8106){return function(_0x193881){if(_0x193881){return _0x193881[_0xdbee('0x1e')]()[_0xdbee('0x1d')](function(){_0x55c3b8[_0xdbee('0x12')](0xcc)[_0xdbee('0x13')]();});}};}function handleEntityNotFound(_0x432792,_0x5b1a8d){return function(_0x4fb56c){if(!_0x4fb56c){_0x432792[_0xdbee('0x11')](0x194);}return _0x4fb56c;};}function handleError(_0x27e54b,_0x1fa4c4){_0x1fa4c4=_0x1fa4c4||0x1f4;return function(_0x3adc4e){logger[_0xdbee('0x1f')](_0x3adc4e['stack']);if(_0x3adc4e[_0xdbee('0x20')]){delete _0x3adc4e[_0xdbee('0x20')];}_0x27e54b[_0xdbee('0x12')](_0x1fa4c4)['send'](_0x3adc4e);};}exports[_0xdbee('0x21')]=function(_0x36374e,_0x41b90a){var _0x416327={},_0x376c06={},_0x4df474={'count':0x0,'rows':[]};var _0x3adec2=_[_0xdbee('0x22')](db['VtigerField'][_0xdbee('0x23')],function(_0x1015bb){return{'name':_0x1015bb[_0xdbee('0x24')],'type':_0x1015bb[_0xdbee('0x25')][_0xdbee('0x26')]};});_0x376c06[_0xdbee('0x27')]=_['map'](_0x3adec2,_0xdbee('0x20'));_0x376c06[_0xdbee('0x28')]=_['keys'](_0x36374e['query']);_0x376c06[_0xdbee('0x29')]=_['intersection'](_0x376c06[_0xdbee('0x27')],_0x376c06[_0xdbee('0x28')]);_0x416327['attributes']=_[_0xdbee('0x2a')](_0x376c06['model'],qs[_0xdbee('0x2b')](_0x36374e['query']['fields']));_0x416327[_0xdbee('0x2c')]=_0x416327[_0xdbee('0x2c')][_0xdbee('0x2d')]?_0x416327[_0xdbee('0x2c')]:_0x376c06[_0xdbee('0x27')];if(!_0x36374e[_0xdbee('0x28')][_0xdbee('0x2e')](_0xdbee('0x2f'))){_0x416327[_0xdbee('0x16')]=qs[_0xdbee('0x16')](_0x36374e['query'][_0xdbee('0x16')]);_0x416327['offset']=qs[_0xdbee('0x14')](_0x36374e[_0xdbee('0x28')][_0xdbee('0x14')]);}_0x416327[_0xdbee('0x30')]=qs[_0xdbee('0x31')](_0x36374e['query'][_0xdbee('0x31')]);_0x416327[_0xdbee('0x32')]=qs[_0xdbee('0x29')](_[_0xdbee('0x33')](_0x36374e[_0xdbee('0x28')],_0x376c06[_0xdbee('0x29')]),_0x3adec2);if(_0x36374e['query'][_0xdbee('0x34')]){_0x416327[_0xdbee('0x32')]=_[_0xdbee('0x35')](_0x416327[_0xdbee('0x32')],{'$or':_[_0xdbee('0x22')](_0x3adec2,function(_0x26d7ce){if(_0x26d7ce[_0xdbee('0x25')]!==_0xdbee('0x36')){var _0xa135dc={};_0xa135dc[_0x26d7ce[_0xdbee('0x20')]]={'$like':'%'+_0x36374e['query'][_0xdbee('0x34')]+'%'};return _0xa135dc;}})});}_0x416327=_[_0xdbee('0x35')]({},_0x416327,_0x36374e[_0xdbee('0x37')]);var _0x48813e={'where':_0x416327[_0xdbee('0x32')]};return db[_0xdbee('0x38')][_0xdbee('0x17')](_0x48813e)['then'](function(_0x26423d){_0x4df474[_0xdbee('0x17')]=_0x26423d;if(_0x36374e[_0xdbee('0x28')][_0xdbee('0x39')]){_0x416327[_0xdbee('0x3a')]=[{'all':!![]}];}return db['VtigerField'][_0xdbee('0x3b')](_0x416327);})[_0xdbee('0x1d')](function(_0x1cb23d){_0x4df474[_0xdbee('0x3c')]=_0x1cb23d;return _0x4df474;})[_0xdbee('0x1d')](respondWithFilteredResult(_0x41b90a,_0x416327))['catch'](handleError(_0x41b90a,null));};exports['show']=function(_0x1b54c6,_0x42bca9){var _0x1d2b24={'raw':!![],'where':{'id':_0x1b54c6[_0xdbee('0x3d')]['id']}},_0x1d5d63={};_0x1d5d63[_0xdbee('0x27')]=_[_0xdbee('0x3e')](db[_0xdbee('0x38')][_0xdbee('0x23')]);_0x1d5d63[_0xdbee('0x28')]=_['keys'](_0x1b54c6[_0xdbee('0x28')]);_0x1d5d63[_0xdbee('0x29')]=_[_0xdbee('0x2a')](_0x1d5d63[_0xdbee('0x27')],_0x1d5d63[_0xdbee('0x28')]);_0x1d2b24[_0xdbee('0x2c')]=_[_0xdbee('0x2a')](_0x1d5d63[_0xdbee('0x27')],qs[_0xdbee('0x2b')](_0x1b54c6[_0xdbee('0x28')][_0xdbee('0x2b')]));_0x1d2b24[_0xdbee('0x2c')]=_0x1d2b24['attributes'][_0xdbee('0x2d')]?_0x1d2b24[_0xdbee('0x2c')]:_0x1d5d63[_0xdbee('0x27')];if(_0x1b54c6['query'][_0xdbee('0x39')]){_0x1d2b24[_0xdbee('0x3a')]=[{'all':!![]}];}_0x1d2b24=_[_0xdbee('0x35')]({},_0x1d2b24,_0x1b54c6['options']);return db[_0xdbee('0x38')][_0xdbee('0x3f')](_0x1d2b24)[_0xdbee('0x1d')](handleEntityNotFound(_0x42bca9,null))['then'](respondWithResult(_0x42bca9,null))[_0xdbee('0x40')](handleError(_0x42bca9,null));};exports[_0xdbee('0x41')]=function(_0x359e28,_0xcf92bd){return db[_0xdbee('0x38')]['create'](_0x359e28[_0xdbee('0x42')],{})[_0xdbee('0x1d')](respondWithResult(_0xcf92bd,0xc9))[_0xdbee('0x40')](handleError(_0xcf92bd,null));};exports[_0xdbee('0x1c')]=function(_0x1fd8a6,_0x150c9b){if(_0x1fd8a6[_0xdbee('0x42')]['id']){delete _0x1fd8a6['body']['id'];}return db['VtigerField'][_0xdbee('0x3f')]({'where':{'id':_0x1fd8a6['params']['id']}})[_0xdbee('0x1d')](handleEntityNotFound(_0x150c9b,null))[_0xdbee('0x1d')](saveUpdates(_0x1fd8a6['body'],null))['then'](respondWithResult(_0x150c9b,null))['catch'](handleError(_0x150c9b,null));};exports[_0xdbee('0x1e')]=function(_0x221974,_0x1f41a8){return db[_0xdbee('0x38')][_0xdbee('0x3f')]({'where':{'id':_0x221974['params']['id']}})[_0xdbee('0x1d')](handleEntityNotFound(_0x1f41a8,null))[_0xdbee('0x1d')](removeEntity(_0x1f41a8,null))[_0xdbee('0x40')](handleError(_0x1f41a8,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 474cbe4..fab8071 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 _0x68c8=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util'];(function(_0x289681,_0x39da4d){var _0xa88e49=function(_0x418dbd){while(--_0x418dbd){_0x289681['push'](_0x289681['shift']());}};_0xa88e49(++_0x39da4d);}(_0x68c8,0x141));var _0x868c=function(_0x8d1aad,_0x2577a3){_0x8d1aad=_0x8d1aad-0x0;var _0x3696fc=_0x68c8[_0x8d1aad];return _0x3696fc;};'use strict';var _=require(_0x868c('0x0'));var util=require(_0x868c('0x1'));var logger=require(_0x868c('0x2'))(_0x868c('0x3'));var moment=require(_0x868c('0x4'));var BPromise=require(_0x868c('0x5'));var rp=require(_0x868c('0x6'));var fs=require('fs');var path=require(_0x868c('0x7'));var rimraf=require(_0x868c('0x8'));var config=require('../../config/environment');var attributes=require(_0x868c('0x9'));module[_0x868c('0xa')]=function(_0x25cb1a,_0x3ddc0b){return _0x25cb1a[_0x868c('0xb')](_0x868c('0xc'),attributes,{'tableName':_0x868c('0xd'),'paranoid':![],'indexes':[{'name':_0x868c('0xe'),'fields':[_0x868c('0xf'),_0x868c('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x89d9=['define','VtigerField','vtiger_unique_index','idField','FieldId','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes'];(function(_0x3825a3,_0xe67c62){var _0x286dbc=function(_0x425c8e){while(--_0x425c8e){_0x3825a3['push'](_0x3825a3['shift']());}};_0x286dbc(++_0xe67c62);}(_0x89d9,0x17e));var _0x989d=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x89d9[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x989d('0x0'));var util=require(_0x989d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x989d('0x2'));var BPromise=require('bluebird');var rp=require(_0x989d('0x3'));var fs=require('fs');var path=require(_0x989d('0x4'));var rimraf=require(_0x989d('0x5'));var config=require(_0x989d('0x6'));var attributes=require(_0x989d('0x7'));module['exports']=function(_0x8d1d28,_0x115faf){return _0x8d1d28[_0x989d('0x8')](_0x989d('0x9'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x989d('0xa'),'fields':[_0x989d('0xb'),_0x989d('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 353ac66..656471d 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 _0xe0c0=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x4ce32f,_0x296fac){var _0xd1431b=function(_0x27f98b){while(--_0x27f98b){_0x4ce32f['push'](_0x4ce32f['shift']());}};_0xd1431b(++_0x296fac);}(_0xe0c0,0xa7));var _0x0e0c=function(_0x5fd9f9,_0x34f428){_0x5fd9f9=_0x5fd9f9-0x0;var _0xa73e72=_0xe0c0[_0x5fd9f9];return _0xa73e72;};'use strict';var _=require(_0x0e0c('0x0'));var util=require('util');var moment=require(_0x0e0c('0x1'));var BPromise=require(_0x0e0c('0x2'));var rs=require(_0x0e0c('0x3'));var fs=require('fs');var Redis=require(_0x0e0c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0e0c('0x5'));var logger=require(_0x0e0c('0x6'))(_0x0e0c('0x7'));var config=require('../../config/environment');var jayson=require(_0x0e0c('0x8'));var client=jayson[_0x0e0c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14e5de,_0xd67cf8,_0xf7de29){return new BPromise(function(_0x13e45d,_0xe3ccce){return client['request'](_0x14e5de,_0xf7de29)['then'](function(_0x518486){logger[_0x0e0c('0xa')]('VtigerField,\x20%s,\x20%s',_0xd67cf8,_0x0e0c('0xb'));logger[_0x0e0c('0xc')](_0x0e0c('0xd'),_0xd67cf8,_0x0e0c('0xb'),JSON[_0x0e0c('0xe')](_0x518486));if(_0x518486[_0x0e0c('0xf')]){if(_0x518486[_0x0e0c('0xf')][_0x0e0c('0x10')]===0x1f4){logger['error'](_0x0e0c('0x11'),_0xd67cf8,_0x518486['error']['message']);return _0xe3ccce(_0x518486[_0x0e0c('0xf')][_0x0e0c('0x12')]);}logger[_0x0e0c('0xf')](_0x0e0c('0x11'),_0xd67cf8,_0x518486[_0x0e0c('0xf')][_0x0e0c('0x12')]);return _0x13e45d(_0x518486['error'][_0x0e0c('0x12')]);}else{logger[_0x0e0c('0xa')](_0x0e0c('0x11'),_0xd67cf8,'request\x20sent');_0x13e45d(_0x518486[_0x0e0c('0x13')][_0x0e0c('0x12')]);}})[_0x0e0c('0x14')](function(_0x20f13d){logger[_0x0e0c('0xf')](_0x0e0c('0x11'),_0xd67cf8,_0x20f13d);_0xe3ccce(_0x20f13d);});});} \ No newline at end of file +var _0x143a=['VtigerField,\x20%s,\x20%s','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x5069bc,_0x5ba47f){var _0x5600a6=function(_0x40c4e4){while(--_0x40c4e4){_0x5069bc['push'](_0x5069bc['shift']());}};_0x5600a6(++_0x5ba47f);}(_0x143a,0x68));var _0xa143=function(_0x29a5e4,_0x3d11f7){_0x29a5e4=_0x29a5e4-0x0;var _0x551abc=_0x143a[_0x29a5e4];return _0x551abc;};'use strict';var _=require(_0xa143('0x0'));var util=require(_0xa143('0x1'));var moment=require('moment');var BPromise=require(_0xa143('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa143('0x3'))['db'];var utils=require(_0xa143('0x4'));var logger=require(_0xa143('0x5'))(_0xa143('0x6'));var config=require('../../config/environment');var jayson=require(_0xa143('0x7'));var client=jayson[_0xa143('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22f10b,_0x2998a7,_0x5404c2){return new BPromise(function(_0x4ad708,_0x4c7386){return client[_0xa143('0x9')](_0x22f10b,_0x5404c2)['then'](function(_0x3ba518){logger['info'](_0xa143('0xa'),_0x2998a7,'request\x20sent');logger['debug'](_0xa143('0xb'),_0x2998a7,_0xa143('0xc'),JSON['stringify'](_0x3ba518));if(_0x3ba518[_0xa143('0xd')]){if(_0x3ba518['error'][_0xa143('0xe')]===0x1f4){logger['error'](_0xa143('0xa'),_0x2998a7,_0x3ba518['error']['message']);return _0x4c7386(_0x3ba518['error']['message']);}logger[_0xa143('0xd')](_0xa143('0xa'),_0x2998a7,_0x3ba518[_0xa143('0xd')]['message']);return _0x4ad708(_0x3ba518[_0xa143('0xd')][_0xa143('0xf')]);}else{logger[_0xa143('0x10')](_0xa143('0xa'),_0x2998a7,_0xa143('0xc'));_0x4ad708(_0x3ba518[_0xa143('0x11')][_0xa143('0xf')]);}})[_0xa143('0x12')](function(_0x397602){logger[_0xa143('0xd')](_0xa143('0xa'),_0x2998a7,_0x397602);_0x4c7386(_0x397602);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index f735018..84cec19 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 _0x5bc7=['index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','put','update','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated'];(function(_0x495984,_0x20ff45){var _0x93c24c=function(_0x48015b){while(--_0x48015b){_0x495984['push'](_0x495984['shift']());}};_0x93c24c(++_0x20ff45);}(_0x5bc7,0x15b));var _0x75bc=function(_0x1c8fa5,_0x1e40b6){_0x1c8fa5=_0x1c8fa5-0x0;var _0x556021=_0x5bc7[_0x1c8fa5];return _0x556021;};'use strict';var multer=require(_0x75bc('0x0'));var util=require(_0x75bc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x75bc('0x2'));var router=express[_0x75bc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x75bc('0x4'));var interaction=require(_0x75bc('0x5'));var config=require(_0x75bc('0x6'));var controller=require(_0x75bc('0x7'));router[_0x75bc('0x8')]('/',auth[_0x75bc('0x9')](),controller[_0x75bc('0xa')]);router[_0x75bc('0x8')](_0x75bc('0xb'),auth[_0x75bc('0x9')](),controller[_0x75bc('0xc')]);router[_0x75bc('0x8')](_0x75bc('0xd'),auth[_0x75bc('0x9')](),controller[_0x75bc('0xe')]);router[_0x75bc('0x8')](_0x75bc('0xf'),auth[_0x75bc('0x9')](),controller['getFields']);router['post']('/',auth[_0x75bc('0x9')](),controller[_0x75bc('0x10')]);router['post'](_0x75bc('0xd'),auth[_0x75bc('0x9')](),controller['addConfiguration']);router[_0x75bc('0x11')](_0x75bc('0xb'),auth['isAuthenticated'](),controller[_0x75bc('0x12')]);router['delete'](_0x75bc('0xb'),auth[_0x75bc('0x9')](),controller[_0x75bc('0x13')]);module[_0x75bc('0x14')]=router; \ No newline at end of file +var _0x8d7b=['/:id/fields','getFields','post','create','addConfiguration','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x8d7b,0x1e8));var _0xb8d7=function(_0x364e2b,_0x1098fb){_0x364e2b=_0x364e2b-0x0;var _0x3b7560=_0x8d7b[_0x364e2b];return _0x3b7560;};'use strict';var multer=require(_0xb8d7('0x0'));var util=require('util');var path=require(_0xb8d7('0x1'));var timeout=require(_0xb8d7('0x2'));var express=require(_0xb8d7('0x3'));var router=express[_0xb8d7('0x4')]();var fs_extra=require(_0xb8d7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb8d7('0x6'));var config=require(_0xb8d7('0x7'));var controller=require(_0xb8d7('0x8'));router[_0xb8d7('0x9')]('/',auth[_0xb8d7('0xa')](),controller[_0xb8d7('0xb')]);router[_0xb8d7('0x9')](_0xb8d7('0xc'),auth[_0xb8d7('0xa')](),controller[_0xb8d7('0xd')]);router['get'](_0xb8d7('0xe'),auth[_0xb8d7('0xa')](),controller[_0xb8d7('0xf')]);router[_0xb8d7('0x9')](_0xb8d7('0x10'),auth[_0xb8d7('0xa')](),controller[_0xb8d7('0x11')]);router[_0xb8d7('0x12')]('/',auth['isAuthenticated'](),controller[_0xb8d7('0x13')]);router[_0xb8d7('0x12')](_0xb8d7('0xe'),auth[_0xb8d7('0xa')](),controller[_0xb8d7('0x14')]);router[_0xb8d7('0x15')](_0xb8d7('0xc'),auth['isAuthenticated'](),controller[_0xb8d7('0x16')]);router['delete'](_0xb8d7('0xc'),auth[_0xb8d7('0xa')](),controller['destroy']);module[_0xb8d7('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 0cf92fc..97003a8 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 _0x27a0=['STRING','username','ENUM','password','token','newTab','integrationTab','exports'];(function(_0x18bd9,_0x1ef045){var _0x3dee22=function(_0x123899){while(--_0x123899){_0x18bd9['push'](_0x18bd9['shift']());}};_0x3dee22(++_0x1ef045);}(_0x27a0,0xbf));var _0x027a=function(_0x4b5290,_0x2a0a1f){_0x4b5290=_0x4b5290-0x0;var _0x19775f=_0x27a0[_0x4b5290];return _0x19775f;};'use strict';var Sequelize=require('sequelize');module[_0x027a('0x0')]={'name':{'type':Sequelize[_0x027a('0x1')]},'description':{'type':Sequelize[_0x027a('0x1')]},'username':{'type':Sequelize[_0x027a('0x1')],'unique':_0x027a('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x027a('0x3')](_0x027a('0x4'),_0x027a('0x5')),'defaultValue':_0x027a('0x4')},'serverUrl':{'type':Sequelize[_0x027a('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x027a('0x3')]('integrationTab',_0x027a('0x6')),'defaultValue':_0x027a('0x7')}}; \ No newline at end of file +var _0x2d0b=['integrationTab','newTab','exports','STRING','username','ENUM','token','password'];(function(_0x58a087,_0x3cd5b4){var _0xe1360d=function(_0x53febc){while(--_0x53febc){_0x58a087['push'](_0x58a087['shift']());}};_0xe1360d(++_0x3cd5b4);}(_0x2d0b,0x102));var _0xb2d0=function(_0x421b7d,_0xcb291){_0x421b7d=_0x421b7d-0x0;var _0x476178=_0x2d0b[_0x421b7d];return _0x476178;};'use strict';var Sequelize=require('sequelize');module[_0xb2d0('0x0')]={'name':{'type':Sequelize[_0xb2d0('0x1')]},'description':{'type':Sequelize[_0xb2d0('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xb2d0('0x2')},'password':{'type':Sequelize[_0xb2d0('0x1')]},'token':{'type':Sequelize[_0xb2d0('0x1')]},'remoteUri':{'type':Sequelize[_0xb2d0('0x1')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0xb2d0('0x3')]('password',_0xb2d0('0x4')),'defaultValue':_0xb2d0('0x5')},'serverUrl':{'type':Sequelize[_0xb2d0('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xb2d0('0x3')](_0xb2d0('0x6'),_0xb2d0('0x7')),'defaultValue':_0xb2d0('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 7bf8158..837e3f4 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 _0x6e6c=['name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','getConfigurations','ZendeskConfiguration','sort','addConfiguration','AccountId','channel','Descriptions','ZendeskField','Subjects','getFields','username','password','token','authType','remoteUri','slice','lastIndexOf','format','ticket_fields','headers','Basic\x20%s','%s:%s','base64','%s/token:%s','toString','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','error','stack'];(function(_0x5a585b,_0x3e0674){var _0x4cd398=function(_0x32fbb5){while(--_0x32fbb5){_0x5a585b['push'](_0x5a585b['shift']());}};_0x4cd398(++_0x3e0674);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6e6c[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0xc6e6('0x0'));var rimraf=require(_0xc6e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc6e6('0x2'));var rp=require(_0xc6e6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc6e6('0x4'));var util=require('util');var path=require(_0xc6e6('0x5'));var sox=require('sox');var csv=require(_0xc6e6('0x6'));var ejs=require(_0xc6e6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc6e6('0x8'));var squel=require(_0xc6e6('0x9'));var crypto=require('crypto');var jsforce=require(_0xc6e6('0xa'));var deskjs=require(_0xc6e6('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc6e6('0xc'));var Papa=require('papaparse');var Redis=require(_0xc6e6('0xd'));var authService=require(_0xc6e6('0xe'));var qs=require(_0xc6e6('0xf'));var as=require(_0xc6e6('0x10'));var hardwareService=require(_0xc6e6('0x11'));var logger=require(_0xc6e6('0x12'))(_0xc6e6('0x13'));var utils=require(_0xc6e6('0x14'));var config=require(_0xc6e6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc6e6('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3a30ce,_0x314d0f){_0x314d0f=_0x314d0f||0xcc;return function(_0x33aea0){if(_0x33aea0){return _0x3a30ce[_0xc6e6('0x17')](_0x314d0f);}return _0x3a30ce['status'](_0x314d0f)[_0xc6e6('0x18')]();};}function respondWithResult(_0x2bfe7d,_0x13be73){_0x13be73=_0x13be73||0xc8;return function(_0x1b6ca9){if(_0x1b6ca9){return _0x2bfe7d[_0xc6e6('0x19')](_0x13be73)['json'](_0x1b6ca9);}};}function respondWithFilteredResult(_0x413cf8,_0x178b34){return function(_0x569474){if(_0x569474){var _0x2f11b0=typeof _0x178b34[_0xc6e6('0x1a')]===_0xc6e6('0x1b')&&typeof _0x178b34['limit']==='undefined';var _0x5867bf=_0x569474[_0xc6e6('0x1c')];var _0x554262=_0x2f11b0?0x0:_0x178b34[_0xc6e6('0x1a')];var _0x2069e4=_0x2f11b0?_0x569474[_0xc6e6('0x1c')]:_0x178b34[_0xc6e6('0x1a')]+_0x178b34[_0xc6e6('0x1d')];var _0x3a0d83;if(_0x2069e4>=_0x5867bf){_0x2069e4=_0x5867bf;_0x3a0d83=0xc8;}else{_0x3a0d83=0xce;}_0x413cf8[_0xc6e6('0x19')](_0x3a0d83);return _0x413cf8[_0xc6e6('0x1e')](_0xc6e6('0x1f'),_0x554262+'-'+_0x2069e4+'/'+_0x5867bf)[_0xc6e6('0x20')](_0x569474);}return null;};}function patchUpdates(_0x4a36b6){return function(_0x428401){try{jsonpatch['apply'](_0x428401,_0x4a36b6,!![]);}catch(_0x1c34cc){return BPromise[_0xc6e6('0x21')](_0x1c34cc);}return _0x428401[_0xc6e6('0x22')]();};}function saveUpdates(_0x2f69f1,_0x4f1d68){return function(_0x35253d){if(_0x35253d){return _0x35253d[_0xc6e6('0x23')](_0x2f69f1)[_0xc6e6('0x24')](function(_0x36ebfa){return _0x36ebfa;});}return null;};}function removeEntity(_0x107561,_0x4c35ae){return function(_0x41fe96){if(_0x41fe96){return _0x41fe96['destroy']()[_0xc6e6('0x24')](function(){_0x107561[_0xc6e6('0x19')](0xcc)[_0xc6e6('0x18')]();});}};}function handleEntityNotFound(_0x64e1dc,_0x53a1bf){return function(_0x3ff8a4){if(!_0x3ff8a4){_0x64e1dc['sendStatus'](0x194);}return _0x3ff8a4;};}function handleError(_0x28577b,_0x534745){_0x534745=_0x534745||0x1f4;return function(_0x267c6a){logger[_0xc6e6('0x25')](_0x267c6a[_0xc6e6('0x26')]);if(_0x267c6a[_0xc6e6('0x27')]){delete _0x267c6a[_0xc6e6('0x27')];}_0x28577b['status'](_0x534745)[_0xc6e6('0x28')](_0x267c6a);};}exports[_0xc6e6('0x29')]=function(_0x166313,_0x1af05c){var _0x4d1284={},_0x34ae96={},_0x50b735={'count':0x0,'rows':[]};var _0x29411c=_[_0xc6e6('0x2a')](db[_0xc6e6('0x2b')][_0xc6e6('0x2c')],function(_0xd3b63){return{'name':_0xd3b63[_0xc6e6('0x2d')],'type':_0xd3b63[_0xc6e6('0x2e')][_0xc6e6('0x2f')]};});_0x34ae96[_0xc6e6('0x30')]=_[_0xc6e6('0x2a')](_0x29411c,_0xc6e6('0x27'));_0x34ae96[_0xc6e6('0x31')]=_[_0xc6e6('0x32')](_0x166313[_0xc6e6('0x31')]);_0x34ae96[_0xc6e6('0x33')]=_[_0xc6e6('0x34')](_0x34ae96[_0xc6e6('0x30')],_0x34ae96['query']);_0x4d1284[_0xc6e6('0x35')]=_[_0xc6e6('0x34')](_0x34ae96['model'],qs['fields'](_0x166313[_0xc6e6('0x31')][_0xc6e6('0x36')]));_0x4d1284[_0xc6e6('0x35')]=_0x4d1284[_0xc6e6('0x35')][_0xc6e6('0x37')]?_0x4d1284[_0xc6e6('0x35')]:_0x34ae96['model'];if(!_0x166313[_0xc6e6('0x31')][_0xc6e6('0x38')](_0xc6e6('0x39'))){_0x4d1284['limit']=qs['limit'](_0x166313[_0xc6e6('0x31')][_0xc6e6('0x1d')]);_0x4d1284[_0xc6e6('0x1a')]=qs[_0xc6e6('0x1a')](_0x166313['query']['offset']);}_0x4d1284[_0xc6e6('0x3a')]=qs['sort'](_0x166313[_0xc6e6('0x31')]['sort']);_0x4d1284[_0xc6e6('0x3b')]=qs[_0xc6e6('0x33')](_[_0xc6e6('0x3c')](_0x166313[_0xc6e6('0x31')],_0x34ae96['filters']),_0x29411c);if(_0x166313['query'][_0xc6e6('0x3d')]){_0x4d1284[_0xc6e6('0x3b')]=_[_0xc6e6('0x3e')](_0x4d1284[_0xc6e6('0x3b')],{'$or':_['map'](_0x29411c,function(_0x4cbdcf){if(_0x4cbdcf[_0xc6e6('0x2e')]!==_0xc6e6('0x3f')){var _0x3a9104={};_0x3a9104[_0x4cbdcf[_0xc6e6('0x27')]]={'$like':'%'+_0x166313['query'][_0xc6e6('0x3d')]+'%'};return _0x3a9104;}})});}_0x4d1284=_[_0xc6e6('0x3e')]({},_0x4d1284,_0x166313['options']);var _0x500b7e={'where':_0x4d1284[_0xc6e6('0x3b')]};return db['ZendeskAccount'][_0xc6e6('0x1c')](_0x500b7e)[_0xc6e6('0x24')](function(_0x53d313){_0x50b735[_0xc6e6('0x1c')]=_0x53d313;if(_0x166313['query'][_0xc6e6('0x40')]){_0x4d1284['include']=[{'all':!![]}];}return db[_0xc6e6('0x2b')][_0xc6e6('0x41')](_0x4d1284);})[_0xc6e6('0x24')](function(_0x2f7af9){_0x50b735[_0xc6e6('0x42')]=_0x2f7af9;return _0x50b735;})[_0xc6e6('0x24')](respondWithFilteredResult(_0x1af05c,_0x4d1284))[_0xc6e6('0x43')](handleError(_0x1af05c,null));};exports[_0xc6e6('0x44')]=function(_0x5ecf6c,_0x5722db){var _0x3e3da6={'raw':![],'where':{'id':_0x5ecf6c[_0xc6e6('0x45')]['id']}},_0x2b494f={};_0x2b494f[_0xc6e6('0x30')]=_['keys'](db[_0xc6e6('0x2b')][_0xc6e6('0x2c')]);_0x2b494f[_0xc6e6('0x31')]=_[_0xc6e6('0x32')](_0x5ecf6c['query']);_0x2b494f[_0xc6e6('0x33')]=_[_0xc6e6('0x34')](_0x2b494f[_0xc6e6('0x30')],_0x2b494f[_0xc6e6('0x31')]);_0x3e3da6[_0xc6e6('0x35')]=_['intersection'](_0x2b494f[_0xc6e6('0x30')],qs['fields'](_0x5ecf6c[_0xc6e6('0x31')]['fields']));_0x3e3da6[_0xc6e6('0x35')]=_0x3e3da6[_0xc6e6('0x35')][_0xc6e6('0x37')]?_0x3e3da6[_0xc6e6('0x35')]:_0x2b494f[_0xc6e6('0x30')];if(_0x5ecf6c[_0xc6e6('0x31')][_0xc6e6('0x40')]){_0x3e3da6[_0xc6e6('0x46')]=[{'all':!![]}];}_0x3e3da6=_['merge']({},_0x3e3da6,_0x5ecf6c[_0xc6e6('0x47')]);return db[_0xc6e6('0x2b')][_0xc6e6('0x48')](_0x3e3da6)['then'](handleEntityNotFound(_0x5722db,null))[_0xc6e6('0x24')](respondWithResult(_0x5722db,null))[_0xc6e6('0x43')](handleError(_0x5722db,null));};exports[_0xc6e6('0x49')]=function(_0x42ed90,_0x7ba471){return db[_0xc6e6('0x2b')][_0xc6e6('0x49')](_0x42ed90[_0xc6e6('0x4a')],{})[_0xc6e6('0x24')](respondWithResult(_0x7ba471,0xc9))[_0xc6e6('0x43')](handleError(_0x7ba471,null));};exports[_0xc6e6('0x23')]=function(_0x470167,_0x3e0117){if(_0x470167[_0xc6e6('0x4a')]['id']){delete _0x470167['body']['id'];}return db[_0xc6e6('0x2b')]['find']({'where':{'id':_0x470167[_0xc6e6('0x45')]['id']}})[_0xc6e6('0x24')](handleEntityNotFound(_0x3e0117,null))['then'](saveUpdates(_0x470167['body'],null))['then'](respondWithResult(_0x3e0117,null))['catch'](handleError(_0x3e0117,null));};exports['destroy']=function(_0x3edc16,_0x40bbe9){return db[_0xc6e6('0x2b')][_0xc6e6('0x48')]({'where':{'id':_0x3edc16[_0xc6e6('0x45')]['id']}})['then'](handleEntityNotFound(_0x40bbe9,null))['then'](removeEntity(_0x40bbe9,null))[_0xc6e6('0x43')](handleError(_0x40bbe9,null));};exports[_0xc6e6('0x4b')]=function(_0x1aa872,_0x48ba2e,_0x577840){var _0x120a00={};var _0x467e9b={};var _0x286dc1;var _0x286dcf;return db[_0xc6e6('0x2b')]['findOne']({'where':{'id':_0x1aa872[_0xc6e6('0x45')]['id']}})[_0xc6e6('0x24')](handleEntityNotFound(_0x48ba2e,null))[_0xc6e6('0x24')](function(_0x5113e3){if(_0x5113e3){_0x286dc1=_0x5113e3;_0x467e9b[_0xc6e6('0x30')]=_[_0xc6e6('0x32')](db[_0xc6e6('0x4c')][_0xc6e6('0x2c')]);_0x467e9b[_0xc6e6('0x31')]=_['keys'](_0x1aa872[_0xc6e6('0x31')]);_0x467e9b[_0xc6e6('0x33')]=_[_0xc6e6('0x34')](_0x467e9b[_0xc6e6('0x30')],_0x467e9b[_0xc6e6('0x31')]);_0x120a00['attributes']=_['intersection'](_0x467e9b['model'],qs[_0xc6e6('0x36')](_0x1aa872[_0xc6e6('0x31')][_0xc6e6('0x36')]));_0x120a00[_0xc6e6('0x35')]=_0x120a00[_0xc6e6('0x35')][_0xc6e6('0x37')]?_0x120a00['attributes']:_0x467e9b[_0xc6e6('0x30')];_0x120a00['order']=qs[_0xc6e6('0x4d')](_0x1aa872[_0xc6e6('0x31')][_0xc6e6('0x4d')]);_0x120a00['where']=qs[_0xc6e6('0x33')](_['pick'](_0x1aa872[_0xc6e6('0x31')],_0x467e9b['filters']));if(_0x1aa872['query'][_0xc6e6('0x3d')]){_0x120a00['where']=_['merge'](_0x120a00[_0xc6e6('0x3b')],{'$or':_[_0xc6e6('0x2a')](_0x120a00[_0xc6e6('0x35')],function(_0x20c4cf){var _0x414bc4={};_0x414bc4[_0x20c4cf]={'$like':'%'+_0x1aa872[_0xc6e6('0x31')][_0xc6e6('0x3d')]+'%'};return _0x414bc4;})});}_0x120a00=_[_0xc6e6('0x3e')]({},_0x120a00,_0x1aa872['options']);return _0x286dc1[_0xc6e6('0x4b')](_0x120a00);}})[_0xc6e6('0x24')](function(_0x35b43f){if(_0x35b43f){_0x286dcf=_0x35b43f[_0xc6e6('0x37')];if(!_0x1aa872['query'][_0xc6e6('0x38')](_0xc6e6('0x39'))){_0x120a00[_0xc6e6('0x1d')]=qs['limit'](_0x1aa872['query'][_0xc6e6('0x1d')]);_0x120a00['offset']=qs['offset'](_0x1aa872[_0xc6e6('0x31')][_0xc6e6('0x1a')]);}return _0x286dc1[_0xc6e6('0x4b')](_0x120a00);}})[_0xc6e6('0x24')](function(_0x269f63){if(_0x269f63){return _0x269f63?{'count':_0x286dcf,'rows':_0x269f63}:null;}})[_0xc6e6('0x24')](respondWithResult(_0x48ba2e,null))[_0xc6e6('0x43')](handleError(_0x48ba2e,null));};exports[_0xc6e6('0x4e')]=function(_0x8bfc70,_0x1956be,_0x15404a){if(_0x8bfc70['body']['id']){delete _0x8bfc70['body']['id'];}return db[_0xc6e6('0x2b')]['findOne']({'where':{'id':_0x8bfc70['params']['id']}})[_0xc6e6('0x24')](handleEntityNotFound(_0x1956be,null))[_0xc6e6('0x24')](function(_0x27c5f0){if(_0x27c5f0){_0x8bfc70['body'][_0xc6e6('0x4f')]=_0x27c5f0['id'];_0x8bfc70[_0xc6e6('0x4a')]['Subjects']=integrations['getSubjects'](_0x8bfc70[_0xc6e6('0x4a')][_0xc6e6('0x50')],_0x8bfc70[_0xc6e6('0x4a')][_0xc6e6('0x2e')]);_0x8bfc70[_0xc6e6('0x4a')][_0xc6e6('0x51')]=integrations['getDescriptions'](_0x8bfc70[_0xc6e6('0x4a')][_0xc6e6('0x50')],_0x8bfc70[_0xc6e6('0x4a')][_0xc6e6('0x2e')]);return db[_0xc6e6('0x4c')]['create'](_0x8bfc70[_0xc6e6('0x4a')],{'include':[{'model':db[_0xc6e6('0x52')],'as':_0xc6e6('0x53')},{'model':db[_0xc6e6('0x52')],'as':_0xc6e6('0x51')}]});}return null;})[_0xc6e6('0x24')](respondWithResult(_0x1956be,null))['catch'](handleError(_0x1956be,null));};exports[_0xc6e6('0x54')]=function(_0x4c4985,_0x46c3df,_0x5c2cfc){var _0x55cec5='';return db[_0xc6e6('0x2b')]['findOne']({'where':{'id':_0x4c4985[_0xc6e6('0x45')]['id']},'attributes':['id',_0xc6e6('0x55'),_0xc6e6('0x56'),_0xc6e6('0x57'),_0xc6e6('0x58'),'remoteUri']})[_0xc6e6('0x24')](handleEntityNotFound(_0x46c3df,null))['then'](function(_0x4bdac6){if(_0x4bdac6){_0x55cec5=_0x4bdac6[_0xc6e6('0x59')];var _0xc38c57=_0x55cec5[_0xc6e6('0x5a')](-0x1);if(_0xc38c57==='/'){_0x55cec5=_0x55cec5['substring'](0x0,_0x55cec5[_0xc6e6('0x5b')](_0xc38c57));}var _0x4ec143={'method':'GET','uri':util[_0xc6e6('0x5c')]('%s/%s',_0x55cec5,_0xc6e6('0x5d')),'json':!![]};switch(_0x4bdac6[_0xc6e6('0x58')]){case _0xc6e6('0x56'):_0x4ec143[_0xc6e6('0x5e')]={'Authorization':util['format'](_0xc6e6('0x5f'),new Buffer(util[_0xc6e6('0x5c')](_0xc6e6('0x60'),_0x4bdac6[_0xc6e6('0x55')],_0x4bdac6[_0xc6e6('0x56')]))['toString'](_0xc6e6('0x61')))};break;case _0xc6e6('0x57'):_0x4ec143[_0xc6e6('0x5e')]={'Authorization':util[_0xc6e6('0x5c')]('Basic\x20%s',new Buffer(util['format'](_0xc6e6('0x62'),_0x4bdac6[_0xc6e6('0x55')],_0x4bdac6[_0xc6e6('0x57')]))[_0xc6e6('0x63')](_0xc6e6('0x61')))};break;default:throw new db[(_0xc6e6('0x64'))][(_0xc6e6('0x65'))](_0xc6e6('0x66'));}return rp(_0x4ec143);}})[_0xc6e6('0x24')](function(_0x4bbe4c){if(_0x4bbe4c){var _0x506679=[_0xc6e6('0x67'),'description',_0xc6e6('0x68'),_0xc6e6('0x69')];_[_0xc6e6('0x6a')](_0x4bbe4c['ticket_fields'],function(_0x5b0c3b){return _0x506679[_0xc6e6('0x6b')](_0x5b0c3b['type']);});return{'count':_0x4bbe4c[_0xc6e6('0x5d')]['length'],'rows':_[_0xc6e6('0x2a')](_0x4bbe4c[_0xc6e6('0x5d')],function(_0x5d867e){return{'id':_0x5d867e['id'],'name':_0x5d867e[_0xc6e6('0x6c')]>0x7?_0x5d867e[_0xc6e6('0x6d')]:_0x5d867e[_0xc6e6('0x2e')],'custom':_0x5d867e['position']>0x7?!![]:![],'options':_0x5d867e[_0xc6e6('0x6e')]?_0x5d867e[_0xc6e6('0x6e')]:_0x5d867e[_0xc6e6('0x6f')]?_0x5d867e['custom_field_options']:[]};})};}})[_0xc6e6('0x24')](respondWithResult(_0x46c3df,null))[_0xc6e6('0x43')](function(_0x4e7b05){var _0x4e0add=_0x4c4985['query'][_0xc6e6('0x70')]?0x1f4:_0x4e7b05[_0xc6e6('0x71')]||0x1f4;logger[_0xc6e6('0x25')](_0xc6e6('0x72'),_0xc6e6('0x54'),_0x4e0add,JSON[_0xc6e6('0x73')](_0x4e7b05));delete _0x4e7b05['name'];if(_0x4e0add===0x191){_0x4e0add=0x190;}_0x46c3df[_0xc6e6('0x19')](_0x4e0add)['send'](_0x4c4985[_0xc6e6('0x31')][_0xc6e6('0x70')]?{'message':_0xc6e6('0x74'),'statusCode':_0x4e7b05['statusCode']}:_0x4e7b05);});}; \ No newline at end of file +var _0xd64b=['undefined','count','Content-Range','apply','update','then','stack','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','model','name','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','rows','catch','show','params','keys','includeAll','include','merge','options','find','create','body','destroy','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','ZendeskField','Descriptions','getFields','username','password','token','remoteUri','substring','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','Sequelize','ValidationError','subject','description','assignee','remove','position','title','system_field_options','custom_field_options','test','statusCode','error','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit'];(function(_0x7e45ed,_0x2aaf0c){var _0xaf5391=function(_0x5d6fe1){while(--_0x5d6fe1){_0x7e45ed['push'](_0x7e45ed['shift']());}};_0xaf5391(++_0x2aaf0c);}(_0xd64b,0xc1));var _0xbd64=function(_0x11cbfd,_0x3b7378){_0x11cbfd=_0x11cbfd-0x0;var _0x45f08c=_0xd64b[_0x11cbfd];return _0x45f08c;};'use strict';var emlformat=require(_0xbd64('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd64('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd64('0x2'));var moment=require(_0xbd64('0x3'));var BPromise=require(_0xbd64('0x4'));var Mustache=require(_0xbd64('0x5'));var util=require(_0xbd64('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd64('0x7'));var _=require(_0xbd64('0x8'));var squel=require(_0xbd64('0x9'));var crypto=require(_0xbd64('0xa'));var jsforce=require(_0xbd64('0xb'));var deskjs=require(_0xbd64('0xc'));var toCsv=require(_0xbd64('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbd64('0xe'));var authService=require(_0xbd64('0xf'));var qs=require(_0xbd64('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd64('0x11'));var logger=require(_0xbd64('0x12'))(_0xbd64('0x13'));var utils=require(_0xbd64('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xbd64('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbd64('0x16'));function respondWithStatusCode(_0x2729d8,_0x3a941c){_0x3a941c=_0x3a941c||0xcc;return function(_0x2183e2){if(_0x2183e2){return _0x2729d8[_0xbd64('0x17')](_0x3a941c);}return _0x2729d8[_0xbd64('0x18')](_0x3a941c)[_0xbd64('0x19')]();};}function respondWithResult(_0x269e2f,_0x2b5808){_0x2b5808=_0x2b5808||0xc8;return function(_0x4ae471){if(_0x4ae471){return _0x269e2f[_0xbd64('0x18')](_0x2b5808)[_0xbd64('0x1a')](_0x4ae471);}};}function respondWithFilteredResult(_0x3ff550,_0x32fd34){return function(_0x29fc16){if(_0x29fc16){var _0x49a914=typeof _0x32fd34[_0xbd64('0x1b')]==='undefined'&&typeof _0x32fd34[_0xbd64('0x1c')]===_0xbd64('0x1d');var _0x3aef70=_0x29fc16[_0xbd64('0x1e')];var _0x17d015=_0x49a914?0x0:_0x32fd34[_0xbd64('0x1b')];var _0xa5491d=_0x49a914?_0x29fc16[_0xbd64('0x1e')]:_0x32fd34['offset']+_0x32fd34[_0xbd64('0x1c')];var _0x1f618b;if(_0xa5491d>=_0x3aef70){_0xa5491d=_0x3aef70;_0x1f618b=0xc8;}else{_0x1f618b=0xce;}_0x3ff550['status'](_0x1f618b);return _0x3ff550['set'](_0xbd64('0x1f'),_0x17d015+'-'+_0xa5491d+'/'+_0x3aef70)[_0xbd64('0x1a')](_0x29fc16);}return null;};}function patchUpdates(_0x196d21){return function(_0x39e2eb){try{jsonpatch[_0xbd64('0x20')](_0x39e2eb,_0x196d21,!![]);}catch(_0x816e00){return BPromise['reject'](_0x816e00);}return _0x39e2eb['save']();};}function saveUpdates(_0x6038f,_0x41f2f){return function(_0x12f67b){if(_0x12f67b){return _0x12f67b[_0xbd64('0x21')](_0x6038f)['then'](function(_0x51d118){return _0x51d118;});}return null;};}function removeEntity(_0x28497c,_0x4afaff){return function(_0x46ab38){if(_0x46ab38){return _0x46ab38['destroy']()[_0xbd64('0x22')](function(){_0x28497c[_0xbd64('0x18')](0xcc)[_0xbd64('0x19')]();});}};}function handleEntityNotFound(_0x2d0993,_0x5ae417){return function(_0x9d0fb8){if(!_0x9d0fb8){_0x2d0993[_0xbd64('0x17')](0x194);}return _0x9d0fb8;};}function handleError(_0x13f527,_0x2a44d0){_0x2a44d0=_0x2a44d0||0x1f4;return function(_0x4d1563){logger['error'](_0x4d1563[_0xbd64('0x23')]);if(_0x4d1563['name']){delete _0x4d1563['name'];}_0x13f527[_0xbd64('0x18')](_0x2a44d0)['send'](_0x4d1563);};}exports[_0xbd64('0x24')]=function(_0x5300e8,_0x28199c){var _0x5d8c35={},_0x1db9f3={},_0x3c0eaf={'count':0x0,'rows':[]};var _0x3be63a=_[_0xbd64('0x25')](db[_0xbd64('0x26')][_0xbd64('0x27')],function(_0x4ed44a){return{'name':_0x4ed44a[_0xbd64('0x28')],'type':_0x4ed44a[_0xbd64('0x29')][_0xbd64('0x2a')]};});_0x1db9f3[_0xbd64('0x2b')]=_[_0xbd64('0x25')](_0x3be63a,_0xbd64('0x2c'));_0x1db9f3['query']=_['keys'](_0x5300e8[_0xbd64('0x2d')]);_0x1db9f3['filters']=_[_0xbd64('0x2e')](_0x1db9f3[_0xbd64('0x2b')],_0x1db9f3['query']);_0x5d8c35['attributes']=_[_0xbd64('0x2e')](_0x1db9f3['model'],qs['fields'](_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x2f')]));_0x5d8c35[_0xbd64('0x30')]=_0x5d8c35['attributes'][_0xbd64('0x31')]?_0x5d8c35['attributes']:_0x1db9f3[_0xbd64('0x2b')];if(!_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x32')](_0xbd64('0x33'))){_0x5d8c35[_0xbd64('0x1c')]=qs[_0xbd64('0x1c')](_0x5300e8['query']['limit']);_0x5d8c35[_0xbd64('0x1b')]=qs[_0xbd64('0x1b')](_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x1b')]);}_0x5d8c35[_0xbd64('0x34')]=qs[_0xbd64('0x35')](_0x5300e8['query']['sort']);_0x5d8c35[_0xbd64('0x36')]=qs[_0xbd64('0x37')](_[_0xbd64('0x38')](_0x5300e8['query'],_0x1db9f3['filters']),_0x3be63a);if(_0x5300e8[_0xbd64('0x2d')]['filter']){_0x5d8c35[_0xbd64('0x36')]=_['merge'](_0x5d8c35[_0xbd64('0x36')],{'$or':_[_0xbd64('0x25')](_0x3be63a,function(_0x550221){if(_0x550221[_0xbd64('0x29')]!=='VIRTUAL'){var _0x534091={};_0x534091[_0x550221[_0xbd64('0x2c')]]={'$like':'%'+_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x39')]+'%'};return _0x534091;}})});}_0x5d8c35=_['merge']({},_0x5d8c35,_0x5300e8['options']);var _0x5d6bcf={'where':_0x5d8c35[_0xbd64('0x36')]};return db[_0xbd64('0x26')]['count'](_0x5d6bcf)[_0xbd64('0x22')](function(_0x34b19a){_0x3c0eaf[_0xbd64('0x1e')]=_0x34b19a;if(_0x5300e8[_0xbd64('0x2d')]['includeAll']){_0x5d8c35['include']=[{'all':!![]}];}return db[_0xbd64('0x26')]['findAll'](_0x5d8c35);})['then'](function(_0x231fa6){_0x3c0eaf[_0xbd64('0x3a')]=_0x231fa6;return _0x3c0eaf;})[_0xbd64('0x22')](respondWithFilteredResult(_0x28199c,_0x5d8c35))[_0xbd64('0x3b')](handleError(_0x28199c,null));};exports[_0xbd64('0x3c')]=function(_0x3155b3,_0x247775){var _0x762380={'raw':![],'where':{'id':_0x3155b3[_0xbd64('0x3d')]['id']}},_0x4870fd={};_0x4870fd[_0xbd64('0x2b')]=_['keys'](db[_0xbd64('0x26')][_0xbd64('0x27')]);_0x4870fd[_0xbd64('0x2d')]=_[_0xbd64('0x3e')](_0x3155b3[_0xbd64('0x2d')]);_0x4870fd[_0xbd64('0x37')]=_[_0xbd64('0x2e')](_0x4870fd['model'],_0x4870fd[_0xbd64('0x2d')]);_0x762380['attributes']=_[_0xbd64('0x2e')](_0x4870fd['model'],qs[_0xbd64('0x2f')](_0x3155b3[_0xbd64('0x2d')][_0xbd64('0x2f')]));_0x762380['attributes']=_0x762380[_0xbd64('0x30')]['length']?_0x762380['attributes']:_0x4870fd['model'];if(_0x3155b3[_0xbd64('0x2d')][_0xbd64('0x3f')]){_0x762380[_0xbd64('0x40')]=[{'all':!![]}];}_0x762380=_[_0xbd64('0x41')]({},_0x762380,_0x3155b3[_0xbd64('0x42')]);return db[_0xbd64('0x26')][_0xbd64('0x43')](_0x762380)['then'](handleEntityNotFound(_0x247775,null))[_0xbd64('0x22')](respondWithResult(_0x247775,null))[_0xbd64('0x3b')](handleError(_0x247775,null));};exports[_0xbd64('0x44')]=function(_0x4e5efe,_0x105bee){return db[_0xbd64('0x26')][_0xbd64('0x44')](_0x4e5efe[_0xbd64('0x45')],{})[_0xbd64('0x22')](respondWithResult(_0x105bee,0xc9))['catch'](handleError(_0x105bee,null));};exports[_0xbd64('0x21')]=function(_0x1a9ec8,_0x2a8011){if(_0x1a9ec8[_0xbd64('0x45')]['id']){delete _0x1a9ec8['body']['id'];}return db['ZendeskAccount'][_0xbd64('0x43')]({'where':{'id':_0x1a9ec8[_0xbd64('0x3d')]['id']}})[_0xbd64('0x22')](handleEntityNotFound(_0x2a8011,null))[_0xbd64('0x22')](saveUpdates(_0x1a9ec8[_0xbd64('0x45')],null))[_0xbd64('0x22')](respondWithResult(_0x2a8011,null))[_0xbd64('0x3b')](handleError(_0x2a8011,null));};exports[_0xbd64('0x46')]=function(_0x460158,_0x2709b2){return db[_0xbd64('0x26')][_0xbd64('0x43')]({'where':{'id':_0x460158[_0xbd64('0x3d')]['id']}})[_0xbd64('0x22')](handleEntityNotFound(_0x2709b2,null))[_0xbd64('0x22')](removeEntity(_0x2709b2,null))['catch'](handleError(_0x2709b2,null));};exports[_0xbd64('0x47')]=function(_0x4952db,_0x5ede67,_0x552c95){var _0x4aa662={};var _0xced0ca={};var _0x2f56df;var _0x5480f5;return db[_0xbd64('0x26')][_0xbd64('0x48')]({'where':{'id':_0x4952db[_0xbd64('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5ede67,null))[_0xbd64('0x22')](function(_0x371bad){if(_0x371bad){_0x2f56df=_0x371bad;_0xced0ca[_0xbd64('0x2b')]=_[_0xbd64('0x3e')](db[_0xbd64('0x49')][_0xbd64('0x27')]);_0xced0ca['query']=_['keys'](_0x4952db['query']);_0xced0ca[_0xbd64('0x37')]=_[_0xbd64('0x2e')](_0xced0ca[_0xbd64('0x2b')],_0xced0ca[_0xbd64('0x2d')]);_0x4aa662['attributes']=_[_0xbd64('0x2e')](_0xced0ca[_0xbd64('0x2b')],qs[_0xbd64('0x2f')](_0x4952db[_0xbd64('0x2d')][_0xbd64('0x2f')]));_0x4aa662[_0xbd64('0x30')]=_0x4aa662['attributes'][_0xbd64('0x31')]?_0x4aa662[_0xbd64('0x30')]:_0xced0ca[_0xbd64('0x2b')];_0x4aa662[_0xbd64('0x34')]=qs[_0xbd64('0x35')](_0x4952db[_0xbd64('0x2d')][_0xbd64('0x35')]);_0x4aa662[_0xbd64('0x36')]=qs[_0xbd64('0x37')](_[_0xbd64('0x38')](_0x4952db[_0xbd64('0x2d')],_0xced0ca[_0xbd64('0x37')]));if(_0x4952db['query']['filter']){_0x4aa662[_0xbd64('0x36')]=_[_0xbd64('0x41')](_0x4aa662['where'],{'$or':_['map'](_0x4aa662[_0xbd64('0x30')],function(_0x12bc56){var _0x49051a={};_0x49051a[_0x12bc56]={'$like':'%'+_0x4952db[_0xbd64('0x2d')][_0xbd64('0x39')]+'%'};return _0x49051a;})});}_0x4aa662=_[_0xbd64('0x41')]({},_0x4aa662,_0x4952db[_0xbd64('0x42')]);return _0x2f56df[_0xbd64('0x47')](_0x4aa662);}})[_0xbd64('0x22')](function(_0x2d788){if(_0x2d788){_0x5480f5=_0x2d788[_0xbd64('0x31')];if(!_0x4952db[_0xbd64('0x2d')]['hasOwnProperty'](_0xbd64('0x33'))){_0x4aa662[_0xbd64('0x1c')]=qs[_0xbd64('0x1c')](_0x4952db['query'][_0xbd64('0x1c')]);_0x4aa662[_0xbd64('0x1b')]=qs['offset'](_0x4952db[_0xbd64('0x2d')][_0xbd64('0x1b')]);}return _0x2f56df[_0xbd64('0x47')](_0x4aa662);}})[_0xbd64('0x22')](function(_0x3615bc){if(_0x3615bc){return _0x3615bc?{'count':_0x5480f5,'rows':_0x3615bc}:null;}})[_0xbd64('0x22')](respondWithResult(_0x5ede67,null))['catch'](handleError(_0x5ede67,null));};exports[_0xbd64('0x4a')]=function(_0x1f3bd0,_0xc57eb1,_0x28d899){if(_0x1f3bd0['body']['id']){delete _0x1f3bd0[_0xbd64('0x45')]['id'];}return db[_0xbd64('0x26')]['findOne']({'where':{'id':_0x1f3bd0[_0xbd64('0x3d')]['id']}})['then'](handleEntityNotFound(_0xc57eb1,null))[_0xbd64('0x22')](function(_0x10e269){if(_0x10e269){_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x4b')]=_0x10e269['id'];_0x1f3bd0['body'][_0xbd64('0x4c')]=integrations[_0xbd64('0x4d')](_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x4e')],_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x29')]);_0x1f3bd0['body']['Descriptions']=integrations['getDescriptions'](_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x4e')],_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x29')]);return db[_0xbd64('0x49')][_0xbd64('0x44')](_0x1f3bd0['body'],{'include':[{'model':db[_0xbd64('0x4f')],'as':_0xbd64('0x4c')},{'model':db[_0xbd64('0x4f')],'as':_0xbd64('0x50')}]});}return null;})[_0xbd64('0x22')](respondWithResult(_0xc57eb1,null))[_0xbd64('0x3b')](handleError(_0xc57eb1,null));};exports[_0xbd64('0x51')]=function(_0x3d7e47,_0x301f42,_0x18e724){var _0x32e611='';return db[_0xbd64('0x26')]['findOne']({'where':{'id':_0x3d7e47['params']['id']},'attributes':['id',_0xbd64('0x52'),_0xbd64('0x53'),_0xbd64('0x54'),'authType',_0xbd64('0x55')]})['then'](handleEntityNotFound(_0x301f42,null))[_0xbd64('0x22')](function(_0x36ebb5){if(_0x36ebb5){_0x32e611=_0x36ebb5[_0xbd64('0x55')];var _0x819774=_0x32e611['slice'](-0x1);if(_0x819774==='/'){_0x32e611=_0x32e611[_0xbd64('0x56')](0x0,_0x32e611['lastIndexOf'](_0x819774));}var _0x14f79e={'method':_0xbd64('0x57'),'uri':util[_0xbd64('0x58')](_0xbd64('0x59'),_0x32e611,_0xbd64('0x5a')),'json':!![]};switch(_0x36ebb5['authType']){case _0xbd64('0x53'):_0x14f79e[_0xbd64('0x5b')]={'Authorization':util['format'](_0xbd64('0x5c'),new Buffer(util[_0xbd64('0x58')](_0xbd64('0x5d'),_0x36ebb5[_0xbd64('0x52')],_0x36ebb5['password']))[_0xbd64('0x5e')]('base64'))};break;case _0xbd64('0x54'):_0x14f79e[_0xbd64('0x5b')]={'Authorization':util[_0xbd64('0x58')]('Basic\x20%s',new Buffer(util['format']('%s/token:%s',_0x36ebb5['username'],_0x36ebb5[_0xbd64('0x54')]))[_0xbd64('0x5e')](_0xbd64('0x5f')))};break;default:throw new db[(_0xbd64('0x60'))][(_0xbd64('0x61'))]('Unknown\x20authentication\x20type');}return rp(_0x14f79e);}})[_0xbd64('0x22')](function(_0x23de71){if(_0x23de71){var _0xac13e6=[_0xbd64('0x62'),_0xbd64('0x63'),'group',_0xbd64('0x64')];_[_0xbd64('0x65')](_0x23de71[_0xbd64('0x5a')],function(_0x808467){return _0xac13e6['includes'](_0x808467['type']);});return{'count':_0x23de71[_0xbd64('0x5a')][_0xbd64('0x31')],'rows':_[_0xbd64('0x25')](_0x23de71[_0xbd64('0x5a')],function(_0x18b0f0){return{'id':_0x18b0f0['id'],'name':_0x18b0f0[_0xbd64('0x66')]>0x7?_0x18b0f0[_0xbd64('0x67')]:_0x18b0f0[_0xbd64('0x29')],'custom':_0x18b0f0['position']>0x7?!![]:![],'options':_0x18b0f0[_0xbd64('0x68')]?_0x18b0f0['system_field_options']:_0x18b0f0[_0xbd64('0x69')]?_0x18b0f0[_0xbd64('0x69')]:[]};})};}})[_0xbd64('0x22')](respondWithResult(_0x301f42,null))['catch'](function(_0x15b625){var _0x5c30f9=_0x3d7e47['query'][_0xbd64('0x6a')]?0x1f4:_0x15b625[_0xbd64('0x6b')]||0x1f4;logger[_0xbd64('0x6c')]('getFields,\x20%s,\x20%s,\x20%s',_0xbd64('0x51'),_0x5c30f9,JSON[_0xbd64('0x6d')](_0x15b625));delete _0x15b625[_0xbd64('0x2c')];if(_0x5c30f9===0x191){_0x5c30f9=0x190;}_0x301f42[_0xbd64('0x18')](_0x5c30f9)['send'](_0x3d7e47[_0xbd64('0x2d')][_0xbd64('0x6a')]?{'message':_0xbd64('0x6e'),'statusCode':_0x15b625[_0xbd64('0x6b')]}:_0x15b625);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 71d09e9..4ca62e7 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 _0xecfc=['../../components/integrations/configuration','exports','ZendeskAccount','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intZendeskAccount.attributes'];(function(_0x42912f,_0x4c0be1){var _0x14bfeb=function(_0x475b51){while(--_0x475b51){_0x42912f['push'](_0x42912f['shift']());}};_0x14bfeb(++_0x4c0be1);}(_0xecfc,0x117));var _0xcecf=function(_0x4de7ca,_0x4a9009){_0x4de7ca=_0x4de7ca-0x0;var _0x1749fd=_0xecfc[_0x4de7ca];return _0x1749fd;};'use strict';var _=require(_0xcecf('0x0'));var util=require(_0xcecf('0x1'));var logger=require(_0xcecf('0x2'))(_0xcecf('0x3'));var moment=require(_0xcecf('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcecf('0x5'));var rimraf=require(_0xcecf('0x6'));var config=require(_0xcecf('0x7'));var attributes=require(_0xcecf('0x8'));var integrations=require(_0xcecf('0x9'));module[_0xcecf('0xa')]=function(_0x21a64c,_0x3e490b){return _0x21a64c['define'](_0xcecf('0xb'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3bd8=['define','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./intZendeskAccount.attributes','../../components/integrations/configuration'];(function(_0x1d1edc,_0x13d75a){var _0x52b2a5=function(_0x220dc8){while(--_0x220dc8){_0x1d1edc['push'](_0x1d1edc['shift']());}};_0x52b2a5(++_0x13d75a);}(_0x3bd8,0x182));var _0x83bd=function(_0x296809,_0x1c9665){_0x296809=_0x296809-0x0;var _0x18c0d3=_0x3bd8[_0x296809];return _0x18c0d3;};'use strict';var _=require(_0x83bd('0x0'));var util=require(_0x83bd('0x1'));var logger=require(_0x83bd('0x2'))(_0x83bd('0x3'));var moment=require(_0x83bd('0x4'));var BPromise=require(_0x83bd('0x5'));var rp=require(_0x83bd('0x6'));var fs=require('fs');var path=require(_0x83bd('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x83bd('0x8'));var integrations=require(_0x83bd('0x9'));module['exports']=function(_0x2e8cae,_0x5bca62){return _0x2e8cae[_0x83bd('0xa')]('ZendeskAccount',attributes,{'tableName':_0x83bd('0xb'),'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 f55eb61..8520d5a 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 _0xf08f=['findAll','options','raw','where','limit','include','model','attributes','map','ShowZendeskAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetZendeskAccount','ZendeskAccount'];(function(_0x525af9,_0x4edd23){var _0x129fbf=function(_0x4f44fe){while(--_0x4f44fe){_0x525af9['push'](_0x525af9['shift']());}};_0x129fbf(++_0x4edd23);}(_0xf08f,0x73));var _0xff08=function(_0x514c15,_0x486901){_0x514c15=_0x514c15-0x0;var _0x16283e=_0xf08f[_0x514c15];return _0x16283e;};'use strict';var _=require('lodash');var util=require(_0xff08('0x0'));var moment=require(_0xff08('0x1'));var BPromise=require(_0xff08('0x2'));var rs=require(_0xff08('0x3'));var fs=require('fs');var Redis=require(_0xff08('0x4'));var db=require(_0xff08('0x5'))['db'];var utils=require(_0xff08('0x6'));var logger=require('../../config/logger')(_0xff08('0x7'));var config=require('../../config/environment');var jayson=require(_0xff08('0x8'));var client=jayson[_0xff08('0x9')][_0xff08('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c8cae,_0x6d6985,_0x27fef8){return new BPromise(function(_0x2dc692,_0x4df5dc){return client[_0xff08('0xb')](_0x1c8cae,_0x27fef8)[_0xff08('0xc')](function(_0xc5ac84){logger[_0xff08('0xd')](_0xff08('0xe'),_0x6d6985,'request\x20sent');logger[_0xff08('0xf')](_0xff08('0x10'),_0x6d6985,_0xff08('0x11'),JSON[_0xff08('0x12')](_0xc5ac84));if(_0xc5ac84[_0xff08('0x13')]){if(_0xc5ac84[_0xff08('0x13')][_0xff08('0x14')]===0x1f4){logger[_0xff08('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x6d6985,_0xc5ac84[_0xff08('0x13')][_0xff08('0x15')]);return _0x4df5dc(_0xc5ac84[_0xff08('0x13')]['message']);}logger[_0xff08('0x13')](_0xff08('0xe'),_0x6d6985,_0xc5ac84[_0xff08('0x13')]['message']);return _0x2dc692(_0xc5ac84[_0xff08('0x13')][_0xff08('0x15')]);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x6d6985,_0xff08('0x11'));_0x2dc692(_0xc5ac84['result'][_0xff08('0x15')]);}})[_0xff08('0x16')](function(_0x3fc1ca){logger[_0xff08('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x6d6985,_0x3fc1ca);_0x4df5dc(_0x3fc1ca);});});}exports[_0xff08('0x17')]=function(_0x156ce2){var _0x52a519=this;return new Promise(function(_0x354d0c,_0x2523ff){return db[_0xff08('0x18')][_0xff08('0x19')]({'raw':_0x156ce2[_0xff08('0x1a')]?_0x156ce2['options'][_0xff08('0x1b')]===undefined?!![]:![]:!![],'where':_0x156ce2[_0xff08('0x1a')]?_0x156ce2[_0xff08('0x1a')][_0xff08('0x1c')]||null:null,'attributes':_0x156ce2[_0xff08('0x1a')]?_0x156ce2['options']['attributes']||null:null,'limit':_0x156ce2[_0xff08('0x1a')]?_0x156ce2['options'][_0xff08('0x1d')]||null:null,'include':_0x156ce2['options']?_0x156ce2[_0xff08('0x1a')][_0xff08('0x1e')]?_['map'](_0x156ce2['options'][_0xff08('0x1e')],function(_0x5ad844){return{'model':db[_0x5ad844[_0xff08('0x1f')]],'as':_0x5ad844['as'],'attributes':_0x5ad844[_0xff08('0x20')],'include':_0x5ad844[_0xff08('0x1e')]?_[_0xff08('0x21')](_0x5ad844[_0xff08('0x1e')],function(_0x140be7){return{'model':db[_0x140be7[_0xff08('0x1f')]],'as':_0x140be7['as'],'attributes':_0x140be7[_0xff08('0x20')],'include':_0x140be7[_0xff08('0x1e')]?_['map'](_0x140be7[_0xff08('0x1e')],function(_0x492d9b){return{'model':db[_0x492d9b[_0xff08('0x1f')]],'as':_0x492d9b['as'],'attributes':_0x492d9b[_0xff08('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b5521){logger[_0xff08('0xd')](_0xff08('0x17'),_0x156ce2);logger[_0xff08('0xf')](_0xff08('0x17'),_0x156ce2,JSON[_0xff08('0x12')](_0x4b5521));_0x354d0c(_0x4b5521);})[_0xff08('0x16')](function(_0x13a327){logger['error'](_0xff08('0x17'),_0x13a327['message'],_0x156ce2);_0x2523ff(_0x52a519[_0xff08('0x13')](0x1f4,_0x13a327[_0xff08('0x15')]));});});};exports[_0xff08('0x22')]=function(_0x4910eb){var _0x431fe7=this;return new Promise(function(_0x1a8b8c,_0x3b860e){return db[_0xff08('0x18')]['find']({'raw':_0x4910eb['options']?_0x4910eb[_0xff08('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4910eb[_0xff08('0x1a')]?_0x4910eb[_0xff08('0x1a')][_0xff08('0x1c')]||null:null,'attributes':_0x4910eb[_0xff08('0x1a')]?_0x4910eb[_0xff08('0x1a')][_0xff08('0x20')]||null:null,'include':_0x4910eb[_0xff08('0x1a')]?_0x4910eb[_0xff08('0x1a')][_0xff08('0x1e')]?_[_0xff08('0x21')](_0x4910eb[_0xff08('0x1a')][_0xff08('0x1e')],function(_0x55163e){return{'model':db[_0x55163e[_0xff08('0x1f')]],'as':_0x55163e['as'],'attributes':_0x55163e[_0xff08('0x20')],'include':_0x55163e[_0xff08('0x1e')]?_['map'](_0x55163e[_0xff08('0x1e')],function(_0x26b993){return{'model':db[_0x26b993[_0xff08('0x1f')]],'as':_0x26b993['as'],'attributes':_0x26b993[_0xff08('0x20')],'include':_0x26b993[_0xff08('0x1e')]?_[_0xff08('0x21')](_0x26b993[_0xff08('0x1e')],function(_0x18fed5){return{'model':db[_0x18fed5[_0xff08('0x1f')]],'as':_0x18fed5['as'],'attributes':_0x18fed5['attributes']};}):[]};}):[]};}):[]:[]})[_0xff08('0xc')](function(_0x1d0045){logger['info']('ShowZendeskAccount',_0x4910eb);logger[_0xff08('0xf')](_0xff08('0x22'),_0x4910eb,JSON[_0xff08('0x12')](_0x1d0045));_0x1a8b8c(_0x1d0045);})[_0xff08('0x16')](function(_0x1ccec6){logger[_0xff08('0x13')](_0xff08('0x22'),_0x1ccec6[_0xff08('0x15')],_0x4910eb);_0x3b860e(_0x431fe7[_0xff08('0x13')](0x1f4,_0x1ccec6[_0xff08('0x15')]));});});}; \ No newline at end of file +var _0xa633=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','include','model','attributes','map','info','debug','ShowZendeskAccount','lodash','bluebird','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa633,0x15d));var _0x3a63=function(_0x534078,_0x47bdce){_0x534078=_0x534078-0x0;var _0x2e0075=_0xa633[_0x534078];return _0x2e0075;};'use strict';var _=require(_0x3a63('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3a63('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a63('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x3a63('0x3'))(_0x3a63('0x4'));var config=require(_0x3a63('0x5'));var jayson=require(_0x3a63('0x6'));var client=jayson[_0x3a63('0x7')][_0x3a63('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7ebc45,_0x1f769d,_0x567ff5){return new BPromise(function(_0x574b7c,_0x77c6ff){return client[_0x3a63('0x9')](_0x7ebc45,_0x567ff5)[_0x3a63('0xa')](function(_0x1aa5db){logger['info'](_0x3a63('0xb'),_0x1f769d,_0x3a63('0xc'));logger['debug'](_0x3a63('0xd'),_0x1f769d,'request\x20sent',JSON[_0x3a63('0xe')](_0x1aa5db));if(_0x1aa5db[_0x3a63('0xf')]){if(_0x1aa5db['error']['code']===0x1f4){logger[_0x3a63('0xf')]('ZendeskAccount,\x20%s,\x20%s',_0x1f769d,_0x1aa5db[_0x3a63('0xf')][_0x3a63('0x10')]);return _0x77c6ff(_0x1aa5db['error'][_0x3a63('0x10')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x1f769d,_0x1aa5db['error'][_0x3a63('0x10')]);return _0x574b7c(_0x1aa5db[_0x3a63('0xf')][_0x3a63('0x10')]);}else{logger['info'](_0x3a63('0xb'),_0x1f769d,_0x3a63('0xc'));_0x574b7c(_0x1aa5db[_0x3a63('0x11')][_0x3a63('0x10')]);}})[_0x3a63('0x12')](function(_0x3c909a){logger[_0x3a63('0xf')]('ZendeskAccount,\x20%s,\x20%s',_0x1f769d,_0x3c909a);_0x77c6ff(_0x3c909a);});});}exports[_0x3a63('0x13')]=function(_0x3abdc0){var _0x1115f8=this;return new Promise(function(_0x11c176,_0x350791){return db[_0x3a63('0x14')][_0x3a63('0x15')]({'raw':_0x3abdc0[_0x3a63('0x16')]?_0x3abdc0[_0x3a63('0x16')][_0x3a63('0x17')]===undefined?!![]:![]:!![],'where':_0x3abdc0[_0x3a63('0x16')]?_0x3abdc0[_0x3a63('0x16')][_0x3a63('0x18')]||null:null,'attributes':_0x3abdc0[_0x3a63('0x16')]?_0x3abdc0['options']['attributes']||null:null,'limit':_0x3abdc0['options']?_0x3abdc0['options']['limit']||null:null,'include':_0x3abdc0[_0x3a63('0x16')]?_0x3abdc0[_0x3a63('0x16')][_0x3a63('0x19')]?_['map'](_0x3abdc0[_0x3a63('0x16')]['include'],function(_0xea9259){return{'model':db[_0xea9259[_0x3a63('0x1a')]],'as':_0xea9259['as'],'attributes':_0xea9259[_0x3a63('0x1b')],'include':_0xea9259['include']?_[_0x3a63('0x1c')](_0xea9259[_0x3a63('0x19')],function(_0x1ec46d){return{'model':db[_0x1ec46d[_0x3a63('0x1a')]],'as':_0x1ec46d['as'],'attributes':_0x1ec46d['attributes'],'include':_0x1ec46d[_0x3a63('0x19')]?_[_0x3a63('0x1c')](_0x1ec46d[_0x3a63('0x19')],function(_0x477483){return{'model':db[_0x477483[_0x3a63('0x1a')]],'as':_0x477483['as'],'attributes':_0x477483[_0x3a63('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3a63('0xa')](function(_0x402b45){logger[_0x3a63('0x1d')](_0x3a63('0x13'),_0x3abdc0);logger[_0x3a63('0x1e')](_0x3a63('0x13'),_0x3abdc0,JSON['stringify'](_0x402b45));_0x11c176(_0x402b45);})['catch'](function(_0x8d99c7){logger['error']('GetZendeskAccount',_0x8d99c7[_0x3a63('0x10')],_0x3abdc0);_0x350791(_0x1115f8[_0x3a63('0xf')](0x1f4,_0x8d99c7['message']));});});};exports[_0x3a63('0x1f')]=function(_0x2179fd){var _0x126abc=this;return new Promise(function(_0x3c90b0,_0x164715){return db[_0x3a63('0x14')]['find']({'raw':_0x2179fd['options']?_0x2179fd[_0x3a63('0x16')][_0x3a63('0x17')]===undefined?!![]:![]:!![],'where':_0x2179fd[_0x3a63('0x16')]?_0x2179fd[_0x3a63('0x16')][_0x3a63('0x18')]||null:null,'attributes':_0x2179fd[_0x3a63('0x16')]?_0x2179fd['options'][_0x3a63('0x1b')]||null:null,'include':_0x2179fd[_0x3a63('0x16')]?_0x2179fd[_0x3a63('0x16')][_0x3a63('0x19')]?_[_0x3a63('0x1c')](_0x2179fd[_0x3a63('0x16')][_0x3a63('0x19')],function(_0x1a6f31){return{'model':db[_0x1a6f31[_0x3a63('0x1a')]],'as':_0x1a6f31['as'],'attributes':_0x1a6f31[_0x3a63('0x1b')],'include':_0x1a6f31[_0x3a63('0x19')]?_[_0x3a63('0x1c')](_0x1a6f31[_0x3a63('0x19')],function(_0x237c38){return{'model':db[_0x237c38['model']],'as':_0x237c38['as'],'attributes':_0x237c38[_0x3a63('0x1b')],'include':_0x237c38[_0x3a63('0x19')]?_['map'](_0x237c38[_0x3a63('0x19')],function(_0x5a5706){return{'model':db[_0x5a5706[_0x3a63('0x1a')]],'as':_0x5a5706['as'],'attributes':_0x5a5706[_0x3a63('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3a63('0xa')](function(_0x2d097a){logger['info']('ShowZendeskAccount',_0x2179fd);logger[_0x3a63('0x1e')](_0x3a63('0x1f'),_0x2179fd,JSON[_0x3a63('0xe')](_0x2d097a));_0x3c90b0(_0x2d097a);})[_0x3a63('0x12')](function(_0x417dd3){logger[_0x3a63('0xf')]('ShowZendeskAccount',_0x417dd3['message'],_0x2179fd);_0x164715(_0x126abc[_0x3a63('0xf')](0x1f4,_0x417dd3['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 5419534..30598ba 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 _0x0bb5=['put','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags'];(function(_0x4d5cb2,_0x4940a6){var _0x1bfd02=function(_0x2a3a39){while(--_0x2a3a39){_0x4d5cb2['push'](_0x4d5cb2['shift']());}};_0x1bfd02(++_0x4940a6);}(_0x0bb5,0x148));var _0x50bb=function(_0x1e7f0c,_0x210c54){_0x1e7f0c=_0x1e7f0c-0x0;var _0x36b20d=_0x0bb5[_0x1e7f0c];return _0x36b20d;};'use strict';var multer=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50bb('0x2'));var router=express[_0x50bb('0x3')]();var fs_extra=require(_0x50bb('0x4'));var auth=require(_0x50bb('0x5'));var interaction=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var controller=require(_0x50bb('0x8'));router[_0x50bb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x50bb('0x9')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0xc')]);router['get']('/:id/fields',auth[_0x50bb('0xb')](),controller[_0x50bb('0xd')]);router[_0x50bb('0x9')](_0x50bb('0xe'),auth['isAuthenticated'](),controller[_0x50bb('0xf')]);router[_0x50bb('0x9')](_0x50bb('0x10'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x11')]);router[_0x50bb('0x9')](_0x50bb('0x12'),auth['isAuthenticated'](),controller[_0x50bb('0x13')]);router['post']('/',auth[_0x50bb('0xb')](),controller[_0x50bb('0x14')]);router[_0x50bb('0x15')]('/:id/tags',auth[_0x50bb('0xb')](),controller[_0x50bb('0x16')]);router[_0x50bb('0x17')]('/:id',auth[_0x50bb('0xb')](),controller['update']);router[_0x50bb('0x18')](_0x50bb('0xa'),auth[_0x50bb('0xb')](),controller[_0x50bb('0x19')]);module[_0x50bb('0x1a')]=router; \ No newline at end of file +var _0xe5b5=['../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x228f5b,_0x5d615f){var _0x3b69b4=function(_0x45e8ea){while(--_0x45e8ea){_0x228f5b['push'](_0x228f5b['shift']());}};_0x3b69b4(++_0x5d615f);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x39758d,_0x346423){_0x39758d=_0x39758d-0x0;var _0x44ac11=_0xe5b5[_0x39758d];return _0x44ac11;};'use strict';var multer=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var path=require(_0x5e5b('0x2'));var timeout=require(_0x5e5b('0x3'));var express=require(_0x5e5b('0x4'));var router=express[_0x5e5b('0x5')]();var fs_extra=require(_0x5e5b('0x6'));var auth=require(_0x5e5b('0x7'));var interaction=require(_0x5e5b('0x8'));var config=require(_0x5e5b('0x9'));var controller=require(_0x5e5b('0xa'));router[_0x5e5b('0xb')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xd')]);router[_0x5e5b('0xb')](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xf')]);router[_0x5e5b('0xb')](_0x5e5b('0x10'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x11')]);router[_0x5e5b('0xb')]('/:id/subjects',auth[_0x5e5b('0xc')](),controller['getSubjects']);router[_0x5e5b('0xb')](_0x5e5b('0x12'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x13')]);router['get']('/:id/tags',auth['isAuthenticated'](),controller[_0x5e5b('0x14')]);router[_0x5e5b('0x15')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x16')]);router[_0x5e5b('0x15')](_0x5e5b('0x17'),auth[_0x5e5b('0xc')](),controller['setTags']);router[_0x5e5b('0x18')](_0x5e5b('0xe'),auth['isAuthenticated'](),controller[_0x5e5b('0x19')]);router['delete']('/:id',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x1a')]);module[_0x5e5b('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index d69320f..d5c4b6c 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 _0x99c6=['exports','STRING'];(function(_0x5b5396,_0x17092a){var _0xb2295f=function(_0x122503){while(--_0x122503){_0x5b5396['push'](_0x5b5396['shift']());}};_0xb2295f(++_0x17092a);}(_0x99c6,0x126));var _0x699c=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x99c6[_0x381589];return _0x2a075d;};'use strict';var Sequelize=require('sequelize');module[_0x699c('0x0')]={'name':{'type':Sequelize[_0x699c('0x1')]},'description':{'type':Sequelize[_0x699c('0x1')]}}; \ No newline at end of file +var _0xd03a=['sequelize','exports','STRING'];(function(_0x392572,_0x49ec7a){var _0x9ef0dc=function(_0x491248){while(--_0x491248){_0x392572['push'](_0x392572['shift']());}};_0x9ef0dc(++_0x49ec7a);}(_0xd03a,0x66));var _0xad03=function(_0x15e4cf,_0x49df0a){_0x15e4cf=_0x15e4cf-0x0;var _0x1c37bd=_0xd03a[_0x15e4cf];return _0x1c37bd;};'use strict';var Sequelize=require(_0xad03('0x0'));module[_0xad03('0x1')]={'name':{'type':Sequelize[_0xad03('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index cf5e8e2..7a6b82d 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 _0x68ab=['../../config/utils','../../config/environment','status','json','offset','undefined','limit','count','set','save','update','then','end','sendStatus','error','stack','name','send','index','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','ZendeskConfiguration','includeAll','include','findAll','catch','params','rawAttributes','length','options','find','create','body','destroy','getFields','findOne','getSubjects','ZendeskField','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','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'];(function(_0x37f73b,_0x3eb871){var _0x54792c=function(_0x421374){while(--_0x421374){_0x37f73b['push'](_0x37f73b['shift']());}};_0x54792c(++_0x3eb871);}(_0x68ab,0x188));var _0xb68a=function(_0x2f8629,_0x1862b6){_0x2f8629=_0x2f8629-0x0;var _0x4d9af4=_0x68ab[_0x2f8629];return _0x4d9af4;};'use strict';var emlformat=require(_0xb68a('0x0'));var rimraf=require(_0xb68a('0x1'));var zipdir=require(_0xb68a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb68a('0x3'));var moment=require('moment');var BPromise=require(_0xb68a('0x4'));var Mustache=require('mustache');var util=require(_0xb68a('0x5'));var path=require(_0xb68a('0x6'));var sox=require(_0xb68a('0x7'));var csv=require(_0xb68a('0x8'));var ejs=require(_0xb68a('0x9'));var fs=require('fs');var fs_extra=require(_0xb68a('0xa'));var _=require('lodash');var squel=require(_0xb68a('0xb'));var crypto=require(_0xb68a('0xc'));var jsforce=require(_0xb68a('0xd'));var deskjs=require(_0xb68a('0xe'));var toCsv=require(_0xb68a('0x8'));var querystring=require(_0xb68a('0xf'));var Papa=require(_0xb68a('0x10'));var Redis=require(_0xb68a('0x11'));var authService=require(_0xb68a('0x12'));var qs=require(_0xb68a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb68a('0x14'));var logger=require(_0xb68a('0x15'))(_0xb68a('0x16'));var utils=require(_0xb68a('0x17'));var config=require(_0xb68a('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2cf926,_0x22b8ee){_0x22b8ee=_0x22b8ee||0xcc;return function(_0x331204){if(_0x331204){return _0x2cf926['sendStatus'](_0x22b8ee);}return _0x2cf926[_0xb68a('0x19')](_0x22b8ee)['end']();};}function respondWithResult(_0x58cced,_0x41d30f){_0x41d30f=_0x41d30f||0xc8;return function(_0x1e5ed7){if(_0x1e5ed7){return _0x58cced[_0xb68a('0x19')](_0x41d30f)[_0xb68a('0x1a')](_0x1e5ed7);}};}function respondWithFilteredResult(_0x1ad837,_0x512d3f){return function(_0x56e873){if(_0x56e873){var _0x4e9bac=typeof _0x512d3f[_0xb68a('0x1b')]===_0xb68a('0x1c')&&typeof _0x512d3f[_0xb68a('0x1d')]===_0xb68a('0x1c');var _0x169c89=_0x56e873['count'];var _0x1ce8d4=_0x4e9bac?0x0:_0x512d3f['offset'];var _0x3b388d=_0x4e9bac?_0x56e873[_0xb68a('0x1e')]:_0x512d3f[_0xb68a('0x1b')]+_0x512d3f['limit'];var _0x1eb744;if(_0x3b388d>=_0x169c89){_0x3b388d=_0x169c89;_0x1eb744=0xc8;}else{_0x1eb744=0xce;}_0x1ad837['status'](_0x1eb744);return _0x1ad837[_0xb68a('0x1f')]('Content-Range',_0x1ce8d4+'-'+_0x3b388d+'/'+_0x169c89)['json'](_0x56e873);}return null;};}function patchUpdates(_0x528299){return function(_0x191d67){try{jsonpatch['apply'](_0x191d67,_0x528299,!![]);}catch(_0x322834){return BPromise['reject'](_0x322834);}return _0x191d67[_0xb68a('0x20')]();};}function saveUpdates(_0x2dee3e,_0x40fb4d){return function(_0x587ca6){if(_0x587ca6){return _0x587ca6[_0xb68a('0x21')](_0x2dee3e)[_0xb68a('0x22')](function(_0x331d77){return _0x331d77;});}return null;};}function removeEntity(_0x141fab,_0x2ffa74){return function(_0x529359){if(_0x529359){return _0x529359['destroy']()[_0xb68a('0x22')](function(){_0x141fab[_0xb68a('0x19')](0xcc)[_0xb68a('0x23')]();});}};}function handleEntityNotFound(_0x9d8ad8,_0x435ee4){return function(_0x23289d){if(!_0x23289d){_0x9d8ad8[_0xb68a('0x24')](0x194);}return _0x23289d;};}function handleError(_0x534ce5,_0x463671){_0x463671=_0x463671||0x1f4;return function(_0x414738){logger[_0xb68a('0x25')](_0x414738[_0xb68a('0x26')]);if(_0x414738[_0xb68a('0x27')]){delete _0x414738[_0xb68a('0x27')];}_0x534ce5[_0xb68a('0x19')](_0x463671)[_0xb68a('0x28')](_0x414738);};}exports[_0xb68a('0x29')]=function(_0x1d618b,_0x151b46){var _0x4939d8={},_0xb8fc9f={},_0xd11a73={'count':0x0,'rows':[]};var _0x5f06e9=_['map'](db['ZendeskConfiguration']['rawAttributes'],function(_0x50a544){return{'name':_0x50a544['fieldName'],'type':_0x50a544[_0xb68a('0x2a')][_0xb68a('0x2b')]};});_0xb8fc9f[_0xb68a('0x2c')]=_[_0xb68a('0x2d')](_0x5f06e9,_0xb68a('0x27'));_0xb8fc9f[_0xb68a('0x2e')]=_[_0xb68a('0x2f')](_0x1d618b[_0xb68a('0x2e')]);_0xb8fc9f[_0xb68a('0x30')]=_[_0xb68a('0x31')](_0xb8fc9f['model'],_0xb8fc9f[_0xb68a('0x2e')]);_0x4939d8[_0xb68a('0x32')]=_['intersection'](_0xb8fc9f['model'],qs[_0xb68a('0x33')](_0x1d618b[_0xb68a('0x2e')][_0xb68a('0x33')]));_0x4939d8[_0xb68a('0x32')]=_0x4939d8[_0xb68a('0x32')]['length']?_0x4939d8['attributes']:_0xb8fc9f[_0xb68a('0x2c')];if(!_0x1d618b[_0xb68a('0x2e')][_0xb68a('0x34')](_0xb68a('0x35'))){_0x4939d8[_0xb68a('0x1d')]=qs[_0xb68a('0x1d')](_0x1d618b[_0xb68a('0x2e')]['limit']);_0x4939d8['offset']=qs[_0xb68a('0x1b')](_0x1d618b['query'][_0xb68a('0x1b')]);}_0x4939d8[_0xb68a('0x36')]=qs[_0xb68a('0x37')](_0x1d618b[_0xb68a('0x2e')][_0xb68a('0x37')]);_0x4939d8['where']=qs['filters'](_[_0xb68a('0x38')](_0x1d618b['query'],_0xb8fc9f[_0xb68a('0x30')]),_0x5f06e9);if(_0x1d618b[_0xb68a('0x2e')][_0xb68a('0x39')]){_0x4939d8[_0xb68a('0x3a')]=_[_0xb68a('0x3b')](_0x4939d8['where'],{'$or':_[_0xb68a('0x2d')](_0x5f06e9,function(_0x65d43f){if(_0x65d43f[_0xb68a('0x2a')]!==_0xb68a('0x3c')){var _0x277cb9={};_0x277cb9[_0x65d43f[_0xb68a('0x27')]]={'$like':'%'+_0x1d618b[_0xb68a('0x2e')]['filter']+'%'};return _0x277cb9;}})});}_0x4939d8=_['merge']({},_0x4939d8,_0x1d618b['options']);var _0x4d2a35={'where':_0x4939d8[_0xb68a('0x3a')]};return db[_0xb68a('0x3d')][_0xb68a('0x1e')](_0x4d2a35)['then'](function(_0x3e15f0){_0xd11a73[_0xb68a('0x1e')]=_0x3e15f0;if(_0x1d618b[_0xb68a('0x2e')][_0xb68a('0x3e')]){_0x4939d8[_0xb68a('0x3f')]=[{'all':!![]}];}return db[_0xb68a('0x3d')][_0xb68a('0x40')](_0x4939d8);})[_0xb68a('0x22')](function(_0x5dd3a3){_0xd11a73['rows']=_0x5dd3a3;return _0xd11a73;})[_0xb68a('0x22')](respondWithFilteredResult(_0x151b46,_0x4939d8))[_0xb68a('0x41')](handleError(_0x151b46,null));};exports['show']=function(_0x28ae6b,_0x4d854e){var _0x5e3316={'raw':![],'where':{'id':_0x28ae6b[_0xb68a('0x42')]['id']}},_0x4f5bd0={};_0x4f5bd0[_0xb68a('0x2c')]=_[_0xb68a('0x2f')](db['ZendeskConfiguration'][_0xb68a('0x43')]);_0x4f5bd0[_0xb68a('0x2e')]=_['keys'](_0x28ae6b[_0xb68a('0x2e')]);_0x4f5bd0['filters']=_[_0xb68a('0x31')](_0x4f5bd0[_0xb68a('0x2c')],_0x4f5bd0['query']);_0x5e3316['attributes']=_[_0xb68a('0x31')](_0x4f5bd0[_0xb68a('0x2c')],qs[_0xb68a('0x33')](_0x28ae6b[_0xb68a('0x2e')][_0xb68a('0x33')]));_0x5e3316[_0xb68a('0x32')]=_0x5e3316[_0xb68a('0x32')][_0xb68a('0x44')]?_0x5e3316[_0xb68a('0x32')]:_0x4f5bd0[_0xb68a('0x2c')];if(_0x28ae6b[_0xb68a('0x2e')][_0xb68a('0x3e')]){_0x5e3316[_0xb68a('0x3f')]=[{'all':!![]}];}_0x5e3316=_[_0xb68a('0x3b')]({},_0x5e3316,_0x28ae6b[_0xb68a('0x45')]);return db['ZendeskConfiguration'][_0xb68a('0x46')](_0x5e3316)[_0xb68a('0x22')](handleEntityNotFound(_0x4d854e,null))[_0xb68a('0x22')](respondWithResult(_0x4d854e,null))['catch'](handleError(_0x4d854e,null));};exports[_0xb68a('0x47')]=function(_0x508cde,_0x305a1f){return db['ZendeskConfiguration'][_0xb68a('0x47')](_0x508cde[_0xb68a('0x48')],{})['then'](respondWithResult(_0x305a1f,0xc9))[_0xb68a('0x41')](handleError(_0x305a1f,null));};exports['update']=function(_0x16e22b,_0x43e470){if(_0x16e22b[_0xb68a('0x48')]['id']){delete _0x16e22b[_0xb68a('0x48')]['id'];}return db[_0xb68a('0x3d')][_0xb68a('0x46')]({'where':{'id':_0x16e22b[_0xb68a('0x42')]['id']}})[_0xb68a('0x22')](handleEntityNotFound(_0x43e470,null))[_0xb68a('0x22')](saveUpdates(_0x16e22b[_0xb68a('0x48')],null))['then'](respondWithResult(_0x43e470,null))['catch'](handleError(_0x43e470,null));};exports[_0xb68a('0x49')]=function(_0x38d7e1,_0x1717ff){return db[_0xb68a('0x3d')][_0xb68a('0x46')]({'where':{'id':_0x38d7e1[_0xb68a('0x42')]['id']}})[_0xb68a('0x22')](handleEntityNotFound(_0x1717ff,null))[_0xb68a('0x22')](removeEntity(_0x1717ff,null))[_0xb68a('0x41')](handleError(_0x1717ff,null));};exports[_0xb68a('0x4a')]=function(_0x5a48aa,_0xdf2b93,_0x16f149){var _0x193237={};var _0x17c742={};var _0x3efe94;var _0x3904ff;return db['ZendeskConfiguration'][_0xb68a('0x4b')]({'where':{'id':_0x5a48aa[_0xb68a('0x42')]['id']}})[_0xb68a('0x22')](handleEntityNotFound(_0xdf2b93,null))[_0xb68a('0x22')](function(_0x5670f8){if(_0x5670f8){_0x3efe94=_0x5670f8;_0x17c742[_0xb68a('0x2c')]=_[_0xb68a('0x2f')](db['ZendeskField'][_0xb68a('0x43')]);_0x17c742[_0xb68a('0x2e')]=_[_0xb68a('0x2f')](_0x5a48aa['query']);_0x17c742[_0xb68a('0x30')]=_[_0xb68a('0x31')](_0x17c742['model'],_0x17c742['query']);_0x193237['attributes']=_[_0xb68a('0x31')](_0x17c742['model'],qs['fields'](_0x5a48aa['query'][_0xb68a('0x33')]));_0x193237[_0xb68a('0x32')]=_0x193237[_0xb68a('0x32')]['length']?_0x193237[_0xb68a('0x32')]:_0x17c742[_0xb68a('0x2c')];_0x193237['order']=qs[_0xb68a('0x37')](_0x5a48aa[_0xb68a('0x2e')][_0xb68a('0x37')]);_0x193237[_0xb68a('0x3a')]=qs[_0xb68a('0x30')](_[_0xb68a('0x38')](_0x5a48aa[_0xb68a('0x2e')],_0x17c742['filters']));if(_0x5a48aa['query']['filter']){_0x193237[_0xb68a('0x3a')]=_[_0xb68a('0x3b')](_0x193237[_0xb68a('0x3a')],{'$or':_[_0xb68a('0x2d')](_0x193237[_0xb68a('0x32')],function(_0x36c5df){var _0x3acf2f={};_0x3acf2f[_0x36c5df]={'$like':'%'+_0x5a48aa[_0xb68a('0x2e')][_0xb68a('0x39')]+'%'};return _0x3acf2f;})});}_0x193237=_[_0xb68a('0x3b')]({},_0x193237,_0x5a48aa['options']);return _0x3efe94['getFields'](_0x193237);}})[_0xb68a('0x22')](function(_0x4321a7){if(_0x4321a7){_0x3904ff=_0x4321a7[_0xb68a('0x44')];if(!_0x5a48aa[_0xb68a('0x2e')]['hasOwnProperty'](_0xb68a('0x35'))){_0x193237[_0xb68a('0x1d')]=qs['limit'](_0x5a48aa['query'][_0xb68a('0x1d')]);_0x193237[_0xb68a('0x1b')]=qs['offset'](_0x5a48aa[_0xb68a('0x2e')][_0xb68a('0x1b')]);}return _0x3efe94[_0xb68a('0x4a')](_0x193237);}})['then'](function(_0x1cf0b2){if(_0x1cf0b2){return _0x1cf0b2?{'count':_0x3904ff,'rows':_0x1cf0b2}:null;}})[_0xb68a('0x22')](respondWithResult(_0xdf2b93,null))[_0xb68a('0x41')](handleError(_0xdf2b93,null));};exports[_0xb68a('0x4c')]=function(_0x553a8a,_0x3326ed,_0x51f420){var _0x26c899={};var _0x2e6a82={};var _0x5217af;var _0x12d3a0;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x553a8a[_0xb68a('0x42')]['id']}})['then'](handleEntityNotFound(_0x3326ed,null))[_0xb68a('0x22')](function(_0x2e40fc){if(_0x2e40fc){_0x5217af=_0x2e40fc;_0x2e6a82[_0xb68a('0x2c')]=_[_0xb68a('0x2f')](db[_0xb68a('0x4d')][_0xb68a('0x43')]);_0x2e6a82['query']=_[_0xb68a('0x2f')](_0x553a8a[_0xb68a('0x2e')]);_0x2e6a82[_0xb68a('0x30')]=_[_0xb68a('0x31')](_0x2e6a82[_0xb68a('0x2c')],_0x2e6a82[_0xb68a('0x2e')]);_0x26c899[_0xb68a('0x32')]=_['intersection'](_0x2e6a82[_0xb68a('0x2c')],qs[_0xb68a('0x33')](_0x553a8a['query'][_0xb68a('0x33')]));_0x26c899['attributes']=_0x26c899[_0xb68a('0x32')][_0xb68a('0x44')]?_0x26c899[_0xb68a('0x32')]:_0x2e6a82[_0xb68a('0x2c')];_0x26c899[_0xb68a('0x36')]=qs[_0xb68a('0x37')](_0x553a8a['query'][_0xb68a('0x37')]);_0x26c899[_0xb68a('0x3a')]=qs['filters'](_[_0xb68a('0x38')](_0x553a8a[_0xb68a('0x2e')],_0x2e6a82[_0xb68a('0x30')]));if(_0x553a8a[_0xb68a('0x2e')][_0xb68a('0x39')]){_0x26c899[_0xb68a('0x3a')]=_[_0xb68a('0x3b')](_0x26c899[_0xb68a('0x3a')],{'$or':_[_0xb68a('0x2d')](_0x26c899[_0xb68a('0x32')],function(_0x199184){var _0x17d178={};_0x17d178[_0x199184]={'$like':'%'+_0x553a8a[_0xb68a('0x2e')][_0xb68a('0x39')]+'%'};return _0x17d178;})});}_0x26c899=_['merge']({},_0x26c899,_0x553a8a[_0xb68a('0x45')]);return _0x5217af[_0xb68a('0x4c')](_0x26c899);}})[_0xb68a('0x22')](function(_0x497f08){if(_0x497f08){_0x12d3a0=_0x497f08[_0xb68a('0x44')];if(!_0x553a8a['query'][_0xb68a('0x34')]('nolimit')){_0x26c899[_0xb68a('0x1d')]=qs[_0xb68a('0x1d')](_0x553a8a['query'][_0xb68a('0x1d')]);_0x26c899[_0xb68a('0x1b')]=qs[_0xb68a('0x1b')](_0x553a8a[_0xb68a('0x2e')][_0xb68a('0x1b')]);}return _0x5217af[_0xb68a('0x4c')](_0x26c899);}})[_0xb68a('0x22')](function(_0xabf724){if(_0xabf724){return _0xabf724?{'count':_0x12d3a0,'rows':_0xabf724}:null;}})['then'](respondWithResult(_0x3326ed,null))[_0xb68a('0x41')](handleError(_0x3326ed,null));};exports[_0xb68a('0x4e')]=function(_0x50a28d,_0x226f8a,_0x3e78fb){var _0x2f9525={};var _0x25c3f5={};var _0x53cc80;var _0x455166;return db[_0xb68a('0x3d')]['findOne']({'where':{'id':_0x50a28d[_0xb68a('0x42')]['id']}})[_0xb68a('0x22')](handleEntityNotFound(_0x226f8a,null))['then'](function(_0x32f3bb){if(_0x32f3bb){_0x53cc80=_0x32f3bb;_0x25c3f5[_0xb68a('0x2c')]=_[_0xb68a('0x2f')](db[_0xb68a('0x4d')][_0xb68a('0x43')]);_0x25c3f5['query']=_[_0xb68a('0x2f')](_0x50a28d[_0xb68a('0x2e')]);_0x25c3f5[_0xb68a('0x30')]=_[_0xb68a('0x31')](_0x25c3f5[_0xb68a('0x2c')],_0x25c3f5[_0xb68a('0x2e')]);_0x2f9525[_0xb68a('0x32')]=_[_0xb68a('0x31')](_0x25c3f5['model'],qs['fields'](_0x50a28d['query'][_0xb68a('0x33')]));_0x2f9525[_0xb68a('0x32')]=_0x2f9525[_0xb68a('0x32')][_0xb68a('0x44')]?_0x2f9525[_0xb68a('0x32')]:_0x25c3f5[_0xb68a('0x2c')];_0x2f9525[_0xb68a('0x36')]=qs['sort'](_0x50a28d[_0xb68a('0x2e')][_0xb68a('0x37')]);_0x2f9525[_0xb68a('0x3a')]=qs['filters'](_[_0xb68a('0x38')](_0x50a28d[_0xb68a('0x2e')],_0x25c3f5[_0xb68a('0x30')]));if(_0x50a28d['query'][_0xb68a('0x39')]){_0x2f9525[_0xb68a('0x3a')]=_[_0xb68a('0x3b')](_0x2f9525['where'],{'$or':_['map'](_0x2f9525[_0xb68a('0x32')],function(_0x44c188){var _0x272f27={};_0x272f27[_0x44c188]={'$like':'%'+_0x50a28d['query'][_0xb68a('0x39')]+'%'};return _0x272f27;})});}_0x2f9525=_[_0xb68a('0x3b')]({},_0x2f9525,_0x50a28d[_0xb68a('0x45')]);return _0x53cc80[_0xb68a('0x4e')](_0x2f9525);}})[_0xb68a('0x22')](function(_0x5e92c0){if(_0x5e92c0){_0x455166=_0x5e92c0[_0xb68a('0x44')];if(!_0x50a28d[_0xb68a('0x2e')][_0xb68a('0x34')](_0xb68a('0x35'))){_0x2f9525[_0xb68a('0x1d')]=qs[_0xb68a('0x1d')](_0x50a28d[_0xb68a('0x2e')][_0xb68a('0x1d')]);_0x2f9525[_0xb68a('0x1b')]=qs[_0xb68a('0x1b')](_0x50a28d[_0xb68a('0x2e')][_0xb68a('0x1b')]);}return _0x53cc80[_0xb68a('0x4e')](_0x2f9525);}})[_0xb68a('0x22')](function(_0x13a5c7){if(_0x13a5c7){return _0x13a5c7?{'count':_0x455166,'rows':_0x13a5c7}:null;}})[_0xb68a('0x22')](respondWithResult(_0x226f8a,null))[_0xb68a('0x41')](handleError(_0x226f8a,null));};exports[_0xb68a('0x4f')]=function(_0x572f79,_0x1f830f,_0x5c1eca){var _0x5600ec={};var _0x4fa624={};var _0x24ae79;var _0x80a429;return db[_0xb68a('0x3d')]['findOne']({'where':{'id':_0x572f79[_0xb68a('0x42')]['id']}})[_0xb68a('0x22')](handleEntityNotFound(_0x1f830f,null))[_0xb68a('0x22')](function(_0x236434){if(_0x236434){_0x24ae79=_0x236434;_0x4fa624[_0xb68a('0x2c')]=_[_0xb68a('0x2f')](db[_0xb68a('0x50')][_0xb68a('0x43')]);_0x4fa624[_0xb68a('0x2e')]=_[_0xb68a('0x2f')](_0x572f79[_0xb68a('0x2e')]);_0x4fa624['filters']=_[_0xb68a('0x31')](_0x4fa624[_0xb68a('0x2c')],_0x4fa624['query']);_0x5600ec[_0xb68a('0x32')]=_[_0xb68a('0x31')](_0x4fa624['model'],qs[_0xb68a('0x33')](_0x572f79[_0xb68a('0x2e')][_0xb68a('0x33')]));_0x5600ec[_0xb68a('0x32')]=_0x5600ec['attributes'][_0xb68a('0x44')]?_0x5600ec[_0xb68a('0x32')]:_0x4fa624[_0xb68a('0x2c')];_0x5600ec[_0xb68a('0x36')]=qs[_0xb68a('0x37')](_0x572f79[_0xb68a('0x2e')][_0xb68a('0x37')]);_0x5600ec[_0xb68a('0x3a')]=qs[_0xb68a('0x30')](_[_0xb68a('0x38')](_0x572f79[_0xb68a('0x2e')],_0x4fa624[_0xb68a('0x30')]));if(_0x572f79[_0xb68a('0x2e')][_0xb68a('0x39')]){_0x5600ec['where']=_[_0xb68a('0x3b')](_0x5600ec['where'],{'$or':_[_0xb68a('0x2d')](_0x5600ec['attributes'],function(_0x4277f6){var _0x1cfb95={};_0x1cfb95[_0x4277f6]={'$like':'%'+_0x572f79[_0xb68a('0x2e')][_0xb68a('0x39')]+'%'};return _0x1cfb95;})});}_0x5600ec=_[_0xb68a('0x3b')]({},_0x5600ec,_0x572f79[_0xb68a('0x45')]);return _0x24ae79[_0xb68a('0x4f')](_0x5600ec);}})[_0xb68a('0x22')](function(_0x599499){if(_0x599499){_0x80a429=_0x599499['length'];if(!_0x572f79[_0xb68a('0x2e')][_0xb68a('0x34')](_0xb68a('0x35'))){_0x5600ec[_0xb68a('0x1d')]=qs[_0xb68a('0x1d')](_0x572f79[_0xb68a('0x2e')][_0xb68a('0x1d')]);_0x5600ec[_0xb68a('0x1b')]=qs[_0xb68a('0x1b')](_0x572f79[_0xb68a('0x2e')][_0xb68a('0x1b')]);}return _0x24ae79[_0xb68a('0x4f')](_0x5600ec);}})['then'](function(_0x5344e9){if(_0x5344e9){return _0x5344e9?{'count':_0x80a429,'rows':_0x5344e9}:null;}})[_0xb68a('0x22')](respondWithResult(_0x1f830f,null))[_0xb68a('0x41')](handleError(_0x1f830f,null));};exports[_0xb68a('0x51')]=function(_0x33f13f,_0x142416,_0x4b86d6){if(_0x33f13f[_0xb68a('0x48')]['id']){delete _0x33f13f['body']['id'];}return db[_0xb68a('0x3d')][_0xb68a('0x4b')]({'where':{'id':_0x33f13f[_0xb68a('0x42')]['id']}})[_0xb68a('0x22')](handleEntityNotFound(_0x142416,null))['then'](function(_0x5cee9a){if(_0x5cee9a){return _0x5cee9a[_0xb68a('0x51')](_0x33f13f[_0xb68a('0x48')][_0xb68a('0x52')]||[]);}return null;})[_0xb68a('0x22')](respondWithResult(_0x142416,null))[_0xb68a('0x41')](handleError(_0x142416,null));}; \ No newline at end of file +var _0x2f5b=['body','params','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../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','apply','save','update','then','destroy','stack','name','index','map','ZendeskConfiguration','rawAttributes','fieldName','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','intersection','find','catch','create'];(function(_0x1c1fc0,_0x1e7f3b){var _0x14d2c3=function(_0x5621d1){while(--_0x5621d1){_0x1c1fc0['push'](_0x1c1fc0['shift']());}};_0x14d2c3(++_0x1e7f3b);}(_0x2f5b,0x167));var _0xb2f5=function(_0x38c554,_0x10ef2d){_0x38c554=_0x38c554-0x0;var _0xaccc5a=_0x2f5b[_0x38c554];return _0xaccc5a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb2f5('0x0'));var zipdir=require(_0xb2f5('0x1'));var jsonpatch=require(_0xb2f5('0x2'));var rp=require(_0xb2f5('0x3'));var moment=require(_0xb2f5('0x4'));var BPromise=require(_0xb2f5('0x5'));var Mustache=require(_0xb2f5('0x6'));var util=require(_0xb2f5('0x7'));var path=require(_0xb2f5('0x8'));var sox=require(_0xb2f5('0x9'));var csv=require(_0xb2f5('0xa'));var ejs=require(_0xb2f5('0xb'));var fs=require('fs');var fs_extra=require(_0xb2f5('0xc'));var _=require(_0xb2f5('0xd'));var squel=require(_0xb2f5('0xe'));var crypto=require(_0xb2f5('0xf'));var jsforce=require(_0xb2f5('0x10'));var deskjs=require(_0xb2f5('0x11'));var toCsv=require(_0xb2f5('0xa'));var querystring=require(_0xb2f5('0x12'));var Papa=require(_0xb2f5('0x13'));var Redis=require(_0xb2f5('0x14'));var authService=require(_0xb2f5('0x15'));var qs=require(_0xb2f5('0x16'));var as=require(_0xb2f5('0x17'));var hardwareService=require(_0xb2f5('0x18'));var logger=require(_0xb2f5('0x19'))(_0xb2f5('0x1a'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb2f5('0x1b'));var db=require(_0xb2f5('0x1c'))['db'];function respondWithStatusCode(_0x2c44f1,_0x2795e7){_0x2795e7=_0x2795e7||0xcc;return function(_0x5caf98){if(_0x5caf98){return _0x2c44f1[_0xb2f5('0x1d')](_0x2795e7);}return _0x2c44f1[_0xb2f5('0x1e')](_0x2795e7)[_0xb2f5('0x1f')]();};}function respondWithResult(_0xdf7f7,_0x320da0){_0x320da0=_0x320da0||0xc8;return function(_0x5a022a){if(_0x5a022a){return _0xdf7f7['status'](_0x320da0)['json'](_0x5a022a);}};}function respondWithFilteredResult(_0x415ffa,_0x458e92){return function(_0x266d39){if(_0x266d39){var _0x19e0a3=typeof _0x458e92[_0xb2f5('0x20')]===_0xb2f5('0x21')&&typeof _0x458e92[_0xb2f5('0x22')]==='undefined';var _0x2f5ccf=_0x266d39[_0xb2f5('0x23')];var _0x4dc118=_0x19e0a3?0x0:_0x458e92[_0xb2f5('0x20')];var _0x46c8b4=_0x19e0a3?_0x266d39[_0xb2f5('0x23')]:_0x458e92[_0xb2f5('0x20')]+_0x458e92[_0xb2f5('0x22')];var _0x387049;if(_0x46c8b4>=_0x2f5ccf){_0x46c8b4=_0x2f5ccf;_0x387049=0xc8;}else{_0x387049=0xce;}_0x415ffa['status'](_0x387049);return _0x415ffa[_0xb2f5('0x24')](_0xb2f5('0x25'),_0x4dc118+'-'+_0x46c8b4+'/'+_0x2f5ccf)['json'](_0x266d39);}return null;};}function patchUpdates(_0x231c33){return function(_0x446983){try{jsonpatch[_0xb2f5('0x26')](_0x446983,_0x231c33,!![]);}catch(_0x37ec4b){return BPromise['reject'](_0x37ec4b);}return _0x446983[_0xb2f5('0x27')]();};}function saveUpdates(_0x4f7ba6,_0x2fe8cc){return function(_0xbde439){if(_0xbde439){return _0xbde439[_0xb2f5('0x28')](_0x4f7ba6)[_0xb2f5('0x29')](function(_0xe47b42){return _0xe47b42;});}return null;};}function removeEntity(_0xe56247,_0x471c39){return function(_0x2c3f49){if(_0x2c3f49){return _0x2c3f49[_0xb2f5('0x2a')]()[_0xb2f5('0x29')](function(){_0xe56247[_0xb2f5('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x376e37,_0x400fed){return function(_0x43596b){if(!_0x43596b){_0x376e37[_0xb2f5('0x1d')](0x194);}return _0x43596b;};}function handleError(_0x5d3710,_0x54706e){_0x54706e=_0x54706e||0x1f4;return function(_0x1213c0){logger['error'](_0x1213c0[_0xb2f5('0x2b')]);if(_0x1213c0[_0xb2f5('0x2c')]){delete _0x1213c0[_0xb2f5('0x2c')];}_0x5d3710['status'](_0x54706e)['send'](_0x1213c0);};}exports[_0xb2f5('0x2d')]=function(_0x4190b3,_0x226109){var _0x18b33f={},_0x42b69f={},_0x8fc875={'count':0x0,'rows':[]};var _0x31e655=_[_0xb2f5('0x2e')](db[_0xb2f5('0x2f')][_0xb2f5('0x30')],function(_0x5cc568){return{'name':_0x5cc568[_0xb2f5('0x31')],'type':_0x5cc568['type'][_0xb2f5('0x32')]};});_0x42b69f[_0xb2f5('0x33')]=_['map'](_0x31e655,_0xb2f5('0x2c'));_0x42b69f['query']=_[_0xb2f5('0x34')](_0x4190b3[_0xb2f5('0x35')]);_0x42b69f[_0xb2f5('0x36')]=_['intersection'](_0x42b69f[_0xb2f5('0x33')],_0x42b69f[_0xb2f5('0x35')]);_0x18b33f[_0xb2f5('0x37')]=_['intersection'](_0x42b69f['model'],qs[_0xb2f5('0x38')](_0x4190b3[_0xb2f5('0x35')][_0xb2f5('0x38')]));_0x18b33f[_0xb2f5('0x37')]=_0x18b33f['attributes'][_0xb2f5('0x39')]?_0x18b33f[_0xb2f5('0x37')]:_0x42b69f[_0xb2f5('0x33')];if(!_0x4190b3[_0xb2f5('0x35')][_0xb2f5('0x3a')](_0xb2f5('0x3b'))){_0x18b33f[_0xb2f5('0x22')]=qs[_0xb2f5('0x22')](_0x4190b3[_0xb2f5('0x35')][_0xb2f5('0x22')]);_0x18b33f[_0xb2f5('0x20')]=qs['offset'](_0x4190b3[_0xb2f5('0x35')][_0xb2f5('0x20')]);}_0x18b33f[_0xb2f5('0x3c')]=qs[_0xb2f5('0x3d')](_0x4190b3[_0xb2f5('0x35')]['sort']);_0x18b33f[_0xb2f5('0x3e')]=qs['filters'](_[_0xb2f5('0x3f')](_0x4190b3['query'],_0x42b69f[_0xb2f5('0x36')]),_0x31e655);if(_0x4190b3[_0xb2f5('0x35')][_0xb2f5('0x40')]){_0x18b33f[_0xb2f5('0x3e')]=_[_0xb2f5('0x41')](_0x18b33f['where'],{'$or':_[_0xb2f5('0x2e')](_0x31e655,function(_0x56f9d0){if(_0x56f9d0['type']!==_0xb2f5('0x42')){var _0x59f16c={};_0x59f16c[_0x56f9d0['name']]={'$like':'%'+_0x4190b3[_0xb2f5('0x35')][_0xb2f5('0x40')]+'%'};return _0x59f16c;}})});}_0x18b33f=_[_0xb2f5('0x41')]({},_0x18b33f,_0x4190b3[_0xb2f5('0x43')]);var _0x1a26a2={'where':_0x18b33f[_0xb2f5('0x3e')]};return db[_0xb2f5('0x2f')][_0xb2f5('0x23')](_0x1a26a2)[_0xb2f5('0x29')](function(_0x37eac8){_0x8fc875[_0xb2f5('0x23')]=_0x37eac8;if(_0x4190b3[_0xb2f5('0x35')][_0xb2f5('0x44')]){_0x18b33f[_0xb2f5('0x45')]=[{'all':!![]}];}return db[_0xb2f5('0x2f')][_0xb2f5('0x46')](_0x18b33f);})['then'](function(_0x24e661){_0x8fc875[_0xb2f5('0x47')]=_0x24e661;return _0x8fc875;})[_0xb2f5('0x29')](respondWithFilteredResult(_0x226109,_0x18b33f))['catch'](handleError(_0x226109,null));};exports['show']=function(_0x32440a,_0x5959f6){var _0x4b3e6b={'raw':![],'where':{'id':_0x32440a['params']['id']}},_0x235914={};_0x235914['model']=_[_0xb2f5('0x34')](db['ZendeskConfiguration'][_0xb2f5('0x30')]);_0x235914[_0xb2f5('0x35')]=_[_0xb2f5('0x34')](_0x32440a[_0xb2f5('0x35')]);_0x235914[_0xb2f5('0x36')]=_[_0xb2f5('0x48')](_0x235914['model'],_0x235914['query']);_0x4b3e6b[_0xb2f5('0x37')]=_[_0xb2f5('0x48')](_0x235914[_0xb2f5('0x33')],qs[_0xb2f5('0x38')](_0x32440a[_0xb2f5('0x35')][_0xb2f5('0x38')]));_0x4b3e6b[_0xb2f5('0x37')]=_0x4b3e6b[_0xb2f5('0x37')][_0xb2f5('0x39')]?_0x4b3e6b[_0xb2f5('0x37')]:_0x235914[_0xb2f5('0x33')];if(_0x32440a['query'][_0xb2f5('0x44')]){_0x4b3e6b[_0xb2f5('0x45')]=[{'all':!![]}];}_0x4b3e6b=_[_0xb2f5('0x41')]({},_0x4b3e6b,_0x32440a[_0xb2f5('0x43')]);return db[_0xb2f5('0x2f')][_0xb2f5('0x49')](_0x4b3e6b)['then'](handleEntityNotFound(_0x5959f6,null))[_0xb2f5('0x29')](respondWithResult(_0x5959f6,null))[_0xb2f5('0x4a')](handleError(_0x5959f6,null));};exports[_0xb2f5('0x4b')]=function(_0x1a0895,_0x48288a){return db[_0xb2f5('0x2f')][_0xb2f5('0x4b')](_0x1a0895[_0xb2f5('0x4c')],{})[_0xb2f5('0x29')](respondWithResult(_0x48288a,0xc9))['catch'](handleError(_0x48288a,null));};exports[_0xb2f5('0x28')]=function(_0x13cacf,_0x21464d){if(_0x13cacf[_0xb2f5('0x4c')]['id']){delete _0x13cacf[_0xb2f5('0x4c')]['id'];}return db['ZendeskConfiguration'][_0xb2f5('0x49')]({'where':{'id':_0x13cacf[_0xb2f5('0x4d')]['id']}})['then'](handleEntityNotFound(_0x21464d,null))['then'](saveUpdates(_0x13cacf['body'],null))[_0xb2f5('0x29')](respondWithResult(_0x21464d,null))[_0xb2f5('0x4a')](handleError(_0x21464d,null));};exports[_0xb2f5('0x2a')]=function(_0x4b7f83,_0x3cc682){return db[_0xb2f5('0x2f')]['find']({'where':{'id':_0x4b7f83['params']['id']}})['then'](handleEntityNotFound(_0x3cc682,null))[_0xb2f5('0x29')](removeEntity(_0x3cc682,null))[_0xb2f5('0x4a')](handleError(_0x3cc682,null));};exports[_0xb2f5('0x4e')]=function(_0x2ca60f,_0x2891a0,_0x58b591){var _0x678504={};var _0x496d1c={};var _0x1795f8;var _0x2b79db;return db[_0xb2f5('0x2f')][_0xb2f5('0x4f')]({'where':{'id':_0x2ca60f[_0xb2f5('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2891a0,null))[_0xb2f5('0x29')](function(_0x5e6dfb){if(_0x5e6dfb){_0x1795f8=_0x5e6dfb;_0x496d1c[_0xb2f5('0x33')]=_['keys'](db[_0xb2f5('0x50')][_0xb2f5('0x30')]);_0x496d1c['query']=_[_0xb2f5('0x34')](_0x2ca60f[_0xb2f5('0x35')]);_0x496d1c[_0xb2f5('0x36')]=_['intersection'](_0x496d1c[_0xb2f5('0x33')],_0x496d1c[_0xb2f5('0x35')]);_0x678504[_0xb2f5('0x37')]=_[_0xb2f5('0x48')](_0x496d1c[_0xb2f5('0x33')],qs[_0xb2f5('0x38')](_0x2ca60f[_0xb2f5('0x35')][_0xb2f5('0x38')]));_0x678504[_0xb2f5('0x37')]=_0x678504['attributes']['length']?_0x678504[_0xb2f5('0x37')]:_0x496d1c['model'];_0x678504[_0xb2f5('0x3c')]=qs[_0xb2f5('0x3d')](_0x2ca60f[_0xb2f5('0x35')]['sort']);_0x678504[_0xb2f5('0x3e')]=qs[_0xb2f5('0x36')](_[_0xb2f5('0x3f')](_0x2ca60f['query'],_0x496d1c[_0xb2f5('0x36')]));if(_0x2ca60f[_0xb2f5('0x35')]['filter']){_0x678504[_0xb2f5('0x3e')]=_[_0xb2f5('0x41')](_0x678504[_0xb2f5('0x3e')],{'$or':_[_0xb2f5('0x2e')](_0x678504[_0xb2f5('0x37')],function(_0x4e1aec){var _0x333ebe={};_0x333ebe[_0x4e1aec]={'$like':'%'+_0x2ca60f[_0xb2f5('0x35')]['filter']+'%'};return _0x333ebe;})});}_0x678504=_[_0xb2f5('0x41')]({},_0x678504,_0x2ca60f['options']);return _0x1795f8['getFields'](_0x678504);}})[_0xb2f5('0x29')](function(_0x5b11b2){if(_0x5b11b2){_0x2b79db=_0x5b11b2['length'];if(!_0x2ca60f[_0xb2f5('0x35')][_0xb2f5('0x3a')](_0xb2f5('0x3b'))){_0x678504[_0xb2f5('0x22')]=qs[_0xb2f5('0x22')](_0x2ca60f['query'][_0xb2f5('0x22')]);_0x678504[_0xb2f5('0x20')]=qs[_0xb2f5('0x20')](_0x2ca60f['query'][_0xb2f5('0x20')]);}return _0x1795f8[_0xb2f5('0x4e')](_0x678504);}})[_0xb2f5('0x29')](function(_0x33b203){if(_0x33b203){return _0x33b203?{'count':_0x2b79db,'rows':_0x33b203}:null;}})[_0xb2f5('0x29')](respondWithResult(_0x2891a0,null))[_0xb2f5('0x4a')](handleError(_0x2891a0,null));};exports['getSubjects']=function(_0x44f0df,_0x34acd2,_0x47ce53){var _0x1ea54c={};var _0x414c08={};var _0x1d7464;var _0xaf36ad;return db['ZendeskConfiguration'][_0xb2f5('0x4f')]({'where':{'id':_0x44f0df[_0xb2f5('0x4d')]['id']}})[_0xb2f5('0x29')](handleEntityNotFound(_0x34acd2,null))['then'](function(_0x1e24db){if(_0x1e24db){_0x1d7464=_0x1e24db;_0x414c08[_0xb2f5('0x33')]=_[_0xb2f5('0x34')](db[_0xb2f5('0x50')][_0xb2f5('0x30')]);_0x414c08['query']=_[_0xb2f5('0x34')](_0x44f0df[_0xb2f5('0x35')]);_0x414c08[_0xb2f5('0x36')]=_[_0xb2f5('0x48')](_0x414c08[_0xb2f5('0x33')],_0x414c08[_0xb2f5('0x35')]);_0x1ea54c['attributes']=_[_0xb2f5('0x48')](_0x414c08[_0xb2f5('0x33')],qs['fields'](_0x44f0df[_0xb2f5('0x35')][_0xb2f5('0x38')]));_0x1ea54c[_0xb2f5('0x37')]=_0x1ea54c[_0xb2f5('0x37')][_0xb2f5('0x39')]?_0x1ea54c[_0xb2f5('0x37')]:_0x414c08[_0xb2f5('0x33')];_0x1ea54c[_0xb2f5('0x3c')]=qs['sort'](_0x44f0df[_0xb2f5('0x35')][_0xb2f5('0x3d')]);_0x1ea54c[_0xb2f5('0x3e')]=qs[_0xb2f5('0x36')](_[_0xb2f5('0x3f')](_0x44f0df[_0xb2f5('0x35')],_0x414c08[_0xb2f5('0x36')]));if(_0x44f0df[_0xb2f5('0x35')][_0xb2f5('0x40')]){_0x1ea54c[_0xb2f5('0x3e')]=_['merge'](_0x1ea54c['where'],{'$or':_[_0xb2f5('0x2e')](_0x1ea54c[_0xb2f5('0x37')],function(_0x4be45e){var _0x4976e6={};_0x4976e6[_0x4be45e]={'$like':'%'+_0x44f0df[_0xb2f5('0x35')][_0xb2f5('0x40')]+'%'};return _0x4976e6;})});}_0x1ea54c=_[_0xb2f5('0x41')]({},_0x1ea54c,_0x44f0df['options']);return _0x1d7464[_0xb2f5('0x51')](_0x1ea54c);}})[_0xb2f5('0x29')](function(_0x3d11a9){if(_0x3d11a9){_0xaf36ad=_0x3d11a9[_0xb2f5('0x39')];if(!_0x44f0df[_0xb2f5('0x35')][_0xb2f5('0x3a')](_0xb2f5('0x3b'))){_0x1ea54c[_0xb2f5('0x22')]=qs[_0xb2f5('0x22')](_0x44f0df['query']['limit']);_0x1ea54c[_0xb2f5('0x20')]=qs[_0xb2f5('0x20')](_0x44f0df[_0xb2f5('0x35')][_0xb2f5('0x20')]);}return _0x1d7464['getSubjects'](_0x1ea54c);}})[_0xb2f5('0x29')](function(_0x145174){if(_0x145174){return _0x145174?{'count':_0xaf36ad,'rows':_0x145174}:null;}})['then'](respondWithResult(_0x34acd2,null))[_0xb2f5('0x4a')](handleError(_0x34acd2,null));};exports[_0xb2f5('0x52')]=function(_0x508eda,_0x2edf8a,_0x173a06){var _0x3fd419={};var _0x118327={};var _0x39eb79;var _0x31b4f8;return db[_0xb2f5('0x2f')]['findOne']({'where':{'id':_0x508eda[_0xb2f5('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2edf8a,null))[_0xb2f5('0x29')](function(_0x5863df){if(_0x5863df){_0x39eb79=_0x5863df;_0x118327[_0xb2f5('0x33')]=_[_0xb2f5('0x34')](db['ZendeskField'][_0xb2f5('0x30')]);_0x118327['query']=_[_0xb2f5('0x34')](_0x508eda[_0xb2f5('0x35')]);_0x118327[_0xb2f5('0x36')]=_[_0xb2f5('0x48')](_0x118327[_0xb2f5('0x33')],_0x118327[_0xb2f5('0x35')]);_0x3fd419[_0xb2f5('0x37')]=_['intersection'](_0x118327[_0xb2f5('0x33')],qs[_0xb2f5('0x38')](_0x508eda[_0xb2f5('0x35')]['fields']));_0x3fd419[_0xb2f5('0x37')]=_0x3fd419[_0xb2f5('0x37')][_0xb2f5('0x39')]?_0x3fd419[_0xb2f5('0x37')]:_0x118327[_0xb2f5('0x33')];_0x3fd419[_0xb2f5('0x3c')]=qs[_0xb2f5('0x3d')](_0x508eda[_0xb2f5('0x35')]['sort']);_0x3fd419[_0xb2f5('0x3e')]=qs['filters'](_[_0xb2f5('0x3f')](_0x508eda[_0xb2f5('0x35')],_0x118327[_0xb2f5('0x36')]));if(_0x508eda[_0xb2f5('0x35')][_0xb2f5('0x40')]){_0x3fd419[_0xb2f5('0x3e')]=_['merge'](_0x3fd419[_0xb2f5('0x3e')],{'$or':_[_0xb2f5('0x2e')](_0x3fd419[_0xb2f5('0x37')],function(_0x3d5e92){var _0x178617={};_0x178617[_0x3d5e92]={'$like':'%'+_0x508eda[_0xb2f5('0x35')][_0xb2f5('0x40')]+'%'};return _0x178617;})});}_0x3fd419=_[_0xb2f5('0x41')]({},_0x3fd419,_0x508eda[_0xb2f5('0x43')]);return _0x39eb79['getDescriptions'](_0x3fd419);}})[_0xb2f5('0x29')](function(_0x5ee8ce){if(_0x5ee8ce){_0x31b4f8=_0x5ee8ce[_0xb2f5('0x39')];if(!_0x508eda[_0xb2f5('0x35')][_0xb2f5('0x3a')](_0xb2f5('0x3b'))){_0x3fd419[_0xb2f5('0x22')]=qs[_0xb2f5('0x22')](_0x508eda['query'][_0xb2f5('0x22')]);_0x3fd419[_0xb2f5('0x20')]=qs[_0xb2f5('0x20')](_0x508eda[_0xb2f5('0x35')][_0xb2f5('0x20')]);}return _0x39eb79[_0xb2f5('0x52')](_0x3fd419);}})['then'](function(_0x4a539b){if(_0x4a539b){return _0x4a539b?{'count':_0x31b4f8,'rows':_0x4a539b}:null;}})[_0xb2f5('0x29')](respondWithResult(_0x2edf8a,null))[_0xb2f5('0x4a')](handleError(_0x2edf8a,null));};exports[_0xb2f5('0x53')]=function(_0x2b7305,_0x44ad7a,_0x897f9f){var _0x237982={};var _0x2501bd={};var _0x44fb87;var _0x422692;return db[_0xb2f5('0x2f')][_0xb2f5('0x4f')]({'where':{'id':_0x2b7305[_0xb2f5('0x4d')]['id']}})[_0xb2f5('0x29')](handleEntityNotFound(_0x44ad7a,null))['then'](function(_0x3b54d5){if(_0x3b54d5){_0x44fb87=_0x3b54d5;_0x2501bd[_0xb2f5('0x33')]=_['keys'](db[_0xb2f5('0x54')][_0xb2f5('0x30')]);_0x2501bd[_0xb2f5('0x35')]=_[_0xb2f5('0x34')](_0x2b7305['query']);_0x2501bd[_0xb2f5('0x36')]=_[_0xb2f5('0x48')](_0x2501bd[_0xb2f5('0x33')],_0x2501bd[_0xb2f5('0x35')]);_0x237982[_0xb2f5('0x37')]=_[_0xb2f5('0x48')](_0x2501bd[_0xb2f5('0x33')],qs['fields'](_0x2b7305[_0xb2f5('0x35')][_0xb2f5('0x38')]));_0x237982['attributes']=_0x237982['attributes'][_0xb2f5('0x39')]?_0x237982['attributes']:_0x2501bd[_0xb2f5('0x33')];_0x237982[_0xb2f5('0x3c')]=qs[_0xb2f5('0x3d')](_0x2b7305[_0xb2f5('0x35')]['sort']);_0x237982[_0xb2f5('0x3e')]=qs[_0xb2f5('0x36')](_[_0xb2f5('0x3f')](_0x2b7305[_0xb2f5('0x35')],_0x2501bd[_0xb2f5('0x36')]));if(_0x2b7305['query'][_0xb2f5('0x40')]){_0x237982['where']=_[_0xb2f5('0x41')](_0x237982[_0xb2f5('0x3e')],{'$or':_['map'](_0x237982[_0xb2f5('0x37')],function(_0x48b1bf){var _0x6563b7={};_0x6563b7[_0x48b1bf]={'$like':'%'+_0x2b7305[_0xb2f5('0x35')]['filter']+'%'};return _0x6563b7;})});}_0x237982=_[_0xb2f5('0x41')]({},_0x237982,_0x2b7305['options']);return _0x44fb87['getTags'](_0x237982);}})[_0xb2f5('0x29')](function(_0x5a0ae3){if(_0x5a0ae3){_0x422692=_0x5a0ae3['length'];if(!_0x2b7305[_0xb2f5('0x35')][_0xb2f5('0x3a')]('nolimit')){_0x237982[_0xb2f5('0x22')]=qs['limit'](_0x2b7305[_0xb2f5('0x35')][_0xb2f5('0x22')]);_0x237982[_0xb2f5('0x20')]=qs['offset'](_0x2b7305['query'][_0xb2f5('0x20')]);}return _0x44fb87[_0xb2f5('0x53')](_0x237982);}})[_0xb2f5('0x29')](function(_0x2abfac){if(_0x2abfac){return _0x2abfac?{'count':_0x422692,'rows':_0x2abfac}:null;}})[_0xb2f5('0x29')](respondWithResult(_0x44ad7a,null))[_0xb2f5('0x4a')](handleError(_0x44ad7a,null));};exports['setTags']=function(_0x3f44fe,_0x20fc88,_0x6223e1){if(_0x3f44fe[_0xb2f5('0x4c')]['id']){delete _0x3f44fe[_0xb2f5('0x4c')]['id'];}return db[_0xb2f5('0x2f')][_0xb2f5('0x4f')]({'where':{'id':_0x3f44fe[_0xb2f5('0x4d')]['id']}})['then'](handleEntityNotFound(_0x20fc88,null))[_0xb2f5('0x29')](function(_0x18008a){if(_0x18008a){return _0x18008a[_0xb2f5('0x55')](_0x3f44fe[_0xb2f5('0x4c')][_0xb2f5('0x56')]||[]);}return null;})['then'](respondWithResult(_0x20fc88,null))[_0xb2f5('0x4a')](handleError(_0x20fc88,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 9982469..f18365f 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 _0xd7d1=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x2d6525,_0x22f8a7){_0x2d6525=_0x2d6525-0x0;var _0x13f98d=_0xd7d1[_0x2d6525];return _0x13f98d;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var logger=require(_0x1d7d('0x2'))(_0x1d7d('0x3'));var moment=require(_0x1d7d('0x4'));var BPromise=require(_0x1d7d('0x5'));var rp=require(_0x1d7d('0x6'));var fs=require('fs');var path=require(_0x1d7d('0x7'));var rimraf=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var attributes=require(_0x1d7d('0xa'));module[_0x1d7d('0xb')]=function(_0x14b2b9,_0x5a8cf3){return _0x14b2b9[_0x1d7d('0xc')](_0x1d7d('0xd'),attributes,{'tableName':_0x1d7d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe820=['exports','define','ZendeskConfiguration','lodash','../../config/logger','bluebird','request-promise','path','../../config/environment'];(function(_0xf174fc,_0x14536b){var _0xf4102c=function(_0x567417){while(--_0x567417){_0xf174fc['push'](_0xf174fc['shift']());}};_0xf4102c(++_0x14536b);}(_0xe820,0xd2));var _0x0e82=function(_0x15a8d7,_0x2fa57f){_0x15a8d7=_0x15a8d7-0x0;var _0x40aada=_0xe820[_0x15a8d7];return _0x40aada;};'use strict';var _=require(_0x0e82('0x0'));var util=require('util');var logger=require(_0x0e82('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0e82('0x2'));var rp=require(_0x0e82('0x3'));var fs=require('fs');var path=require(_0x0e82('0x4'));var rimraf=require('rimraf');var config=require(_0x0e82('0x5'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x0e82('0x6')]=function(_0x105e3c,_0x69e27f){return _0x105e3c[_0x0e82('0x7')](_0x0e82('0x8'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 29f10bd..fb33889 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 _0xe59a=['request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xe59a,0x87));var _0xae59=function(_0x53c9d6,_0x290137){_0x53c9d6=_0x53c9d6-0x0;var _0x232069=_0xe59a[_0x53c9d6];return _0x232069;};'use strict';var _=require('lodash');var util=require(_0xae59('0x0'));var moment=require(_0xae59('0x1'));var BPromise=require(_0xae59('0x2'));var rs=require(_0xae59('0x3'));var fs=require('fs');var Redis=require(_0xae59('0x4'));var db=require(_0xae59('0x5'))['db'];var utils=require(_0xae59('0x6'));var logger=require(_0xae59('0x7'))(_0xae59('0x8'));var config=require(_0xae59('0x9'));var jayson=require(_0xae59('0xa'));var client=jayson['client'][_0xae59('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f6e21,_0x4c6a5a,_0xb0cef2){return new BPromise(function(_0x32ef35,_0x36aa32){return client[_0xae59('0xc')](_0x3f6e21,_0xb0cef2)[_0xae59('0xd')](function(_0x5bfb91){logger[_0xae59('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4c6a5a,_0xae59('0xf'));logger[_0xae59('0x10')](_0xae59('0x11'),_0x4c6a5a,_0xae59('0xf'),JSON[_0xae59('0x12')](_0x5bfb91));if(_0x5bfb91[_0xae59('0x13')]){if(_0x5bfb91[_0xae59('0x13')][_0xae59('0x14')]===0x1f4){logger[_0xae59('0x13')](_0xae59('0x15'),_0x4c6a5a,_0x5bfb91[_0xae59('0x13')][_0xae59('0x16')]);return _0x36aa32(_0x5bfb91[_0xae59('0x13')]['message']);}logger[_0xae59('0x13')](_0xae59('0x15'),_0x4c6a5a,_0x5bfb91['error'][_0xae59('0x16')]);return _0x32ef35(_0x5bfb91['error']['message']);}else{logger['info'](_0xae59('0x15'),_0x4c6a5a,_0xae59('0xf'));_0x32ef35(_0x5bfb91[_0xae59('0x17')][_0xae59('0x16')]);}})[_0xae59('0x18')](function(_0xef4003){logger[_0xae59('0x13')](_0xae59('0x15'),_0x4c6a5a,_0xef4003);_0x36aa32(_0xef4003);});});} \ No newline at end of file +var _0x7fdb=['jayson/promise','client','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x5244d1,_0x4f5669){var _0x260c47=function(_0x5902b0){while(--_0x5902b0){_0x5244d1['push'](_0x5244d1['shift']());}};_0x260c47(++_0x4f5669);}(_0x7fdb,0x196));var _0xb7fd=function(_0x2418e0,_0x7215b0){_0x2418e0=_0x2418e0-0x0;var _0x55ffbf=_0x7fdb[_0x2418e0];return _0x55ffbf;};'use strict';var _=require(_0xb7fd('0x0'));var util=require(_0xb7fd('0x1'));var moment=require(_0xb7fd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb7fd('0x3'));var db=require(_0xb7fd('0x4'))['db'];var utils=require(_0xb7fd('0x5'));var logger=require('../../config/logger')(_0xb7fd('0x6'));var config=require(_0xb7fd('0x7'));var jayson=require(_0xb7fd('0x8'));var client=jayson[_0xb7fd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16a77a,_0x2e91ea,_0x4bd1e7){return new BPromise(function(_0x331475,_0x31aaeb){return client[_0xb7fd('0xa')](_0x16a77a,_0x4bd1e7)[_0xb7fd('0xb')](function(_0x50d2b6){logger['info'](_0xb7fd('0xc'),_0x2e91ea,_0xb7fd('0xd'));logger[_0xb7fd('0xe')](_0xb7fd('0xf'),_0x2e91ea,_0xb7fd('0xd'),JSON[_0xb7fd('0x10')](_0x50d2b6));if(_0x50d2b6[_0xb7fd('0x11')]){if(_0x50d2b6['error'][_0xb7fd('0x12')]===0x1f4){logger[_0xb7fd('0x11')](_0xb7fd('0xc'),_0x2e91ea,_0x50d2b6[_0xb7fd('0x11')][_0xb7fd('0x13')]);return _0x31aaeb(_0x50d2b6[_0xb7fd('0x11')][_0xb7fd('0x13')]);}logger[_0xb7fd('0x11')](_0xb7fd('0xc'),_0x2e91ea,_0x50d2b6[_0xb7fd('0x11')]['message']);return _0x331475(_0x50d2b6[_0xb7fd('0x11')][_0xb7fd('0x13')]);}else{logger[_0xb7fd('0x14')](_0xb7fd('0xc'),_0x2e91ea,_0xb7fd('0xd'));_0x331475(_0x50d2b6[_0xb7fd('0x15')][_0xb7fd('0x13')]);}})[_0xb7fd('0x16')](function(_0x275e19){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x2e91ea,_0x275e19);_0x31aaeb(_0x275e19);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 8e2dc67..d21691b 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 _0xb8d0=['/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get'];(function(_0x1ee4bd,_0x2f77ab){var _0x82073f=function(_0x5ac3ac){while(--_0x5ac3ac){_0x1ee4bd['push'](_0x1ee4bd['shift']());}};_0x82073f(++_0x2f77ab);}(_0xb8d0,0xa9));var _0x0b8d=function(_0xe7d981,_0x5cb832){_0xe7d981=_0xe7d981-0x0;var _0x42381f=_0xb8d0[_0xe7d981];return _0x42381f;};'use strict';var multer=require(_0x0b8d('0x0'));var util=require('util');var path=require(_0x0b8d('0x1'));var timeout=require(_0x0b8d('0x2'));var express=require(_0x0b8d('0x3'));var router=express[_0x0b8d('0x4')]();var fs_extra=require(_0x0b8d('0x5'));var auth=require(_0x0b8d('0x6'));var interaction=require(_0x0b8d('0x7'));var config=require(_0x0b8d('0x8'));var controller=require(_0x0b8d('0x9'));router[_0x0b8d('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0b8d('0xa')](_0x0b8d('0xb'),auth[_0x0b8d('0xc')](),controller[_0x0b8d('0xd')]);router[_0x0b8d('0xe')]('/',auth['isAuthenticated'](),controller[_0x0b8d('0xf')]);router['put'](_0x0b8d('0xb'),auth[_0x0b8d('0xc')](),controller[_0x0b8d('0x10')]);router[_0x0b8d('0x11')](_0x0b8d('0xb'),auth[_0x0b8d('0xc')](),controller[_0x0b8d('0x12')]);module[_0x0b8d('0x13')]=router; \ No newline at end of file +var _0x4e45=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','/:id','post','create','put','update','delete','exports','multer'];(function(_0x1e437f,_0x54b968){var _0x2d7f63=function(_0x4f12d3){while(--_0x4f12d3){_0x1e437f['push'](_0x1e437f['shift']());}};_0x2d7f63(++_0x54b968);}(_0x4e45,0x1a8));var _0x54e4=function(_0x4c995f,_0x295efc){_0x4c995f=_0x4c995f-0x0;var _0x5ec2e6=_0x4e45[_0x4c995f];return _0x5ec2e6;};'use strict';var multer=require(_0x54e4('0x0'));var util=require('util');var path=require(_0x54e4('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x54e4('0x2')]();var fs_extra=require(_0x54e4('0x3'));var auth=require(_0x54e4('0x4'));var interaction=require(_0x54e4('0x5'));var config=require(_0x54e4('0x6'));var controller=require(_0x54e4('0x7'));router[_0x54e4('0x8')]('/',auth[_0x54e4('0x9')](),controller['index']);router[_0x54e4('0x8')](_0x54e4('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x54e4('0xb')]('/',auth[_0x54e4('0x9')](),controller[_0x54e4('0xc')]);router[_0x54e4('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x54e4('0xe')]);router[_0x54e4('0xf')](_0x54e4('0xa'),auth[_0x54e4('0x9')](),controller['destroy']);module[_0x54e4('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index a63b5a2..fcdbf0a 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 _0xea1a=['BOOLEAN','sequelize','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x289aa0,_0x299061){var _0xfd0f3d=function(_0x4d9831){while(--_0x4d9831){_0x289aa0['push'](_0x289aa0['shift']());}};_0xfd0f3d(++_0x299061);}(_0xea1a,0x69));var _0xaea1=function(_0x35d5c0,_0x1dc0fb){_0x35d5c0=_0x35d5c0-0x0;var _0x10d90f=_0xea1a[_0x35d5c0];return _0x10d90f;};'use strict';var Sequelize=require(_0xaea1('0x0'));module['exports']={'type':{'type':Sequelize[_0xaea1('0x1')](_0xaea1('0x2'),_0xaea1('0x3'),_0xaea1('0x4'),'keyValue',_0xaea1('0x5')),'defaultValue':_0xaea1('0x2')},'content':{'type':Sequelize[_0xaea1('0x6')]},'key':{'type':Sequelize[_0xaea1('0x6')]},'keyType':{'type':Sequelize[_0xaea1('0x1')](_0xaea1('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xaea1('0x6')]},'idField':{'type':Sequelize[_0xaea1('0x6')]},'nameField':{'type':Sequelize[_0xaea1('0x6')]},'customField':{'type':Sequelize[_0xaea1('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xaea1('0x6')]}}; \ No newline at end of file +var _0x0120=['customVariable','BOOLEAN','sequelize','string','picklist','STRING','ENUM'];(function(_0x45b100,_0x29a4b1){var _0x1b41f8=function(_0x5a48b4){while(--_0x5a48b4){_0x45b100['push'](_0x45b100['shift']());}};_0x1b41f8(++_0x29a4b1);}(_0x0120,0x10c));var _0x0012=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x0120[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0x0012('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x0012('0x1'),'variable','customVariable','keyValue',_0x0012('0x2')),'defaultValue':_0x0012('0x1')},'content':{'type':Sequelize[_0x0012('0x3')]},'key':{'type':Sequelize[_0x0012('0x3')]},'keyType':{'type':Sequelize[_0x0012('0x4')](_0x0012('0x1'),'variable',_0x0012('0x5'))},'keyContent':{'type':Sequelize[_0x0012('0x3')]},'idField':{'type':Sequelize[_0x0012('0x3')]},'nameField':{'type':Sequelize[_0x0012('0x3')]},'customField':{'type':Sequelize[_0x0012('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 56e100a..9e6d24d 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 _0x5223=['zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','reject','save','update','then','error','stack','name','send','index','map','ZendeskField','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','create','body','find','destroy','rimraf'];(function(_0x3e1122,_0x1c458a){var _0x3da9a2=function(_0x193a5e){while(--_0x193a5e){_0x3e1122['push'](_0x3e1122['shift']());}};_0x3da9a2(++_0x1c458a);}(_0x5223,0x11f));var _0x3522=function(_0x278790,_0x46cb89){_0x278790=_0x278790-0x0;var _0x17a6c5=_0x5223[_0x278790];return _0x17a6c5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3522('0x0'));var zipdir=require(_0x3522('0x1'));var jsonpatch=require(_0x3522('0x2'));var rp=require('request-promise');var moment=require(_0x3522('0x3'));var BPromise=require(_0x3522('0x4'));var Mustache=require(_0x3522('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3522('0x6'));var csv=require(_0x3522('0x7'));var ejs=require(_0x3522('0x8'));var fs=require('fs');var fs_extra=require(_0x3522('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3522('0xa'));var jsforce=require(_0x3522('0xb'));var deskjs=require(_0x3522('0xc'));var toCsv=require(_0x3522('0x7'));var querystring=require('querystring');var Papa=require(_0x3522('0xd'));var Redis=require(_0x3522('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3522('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3522('0x10'));var logger=require(_0x3522('0x11'))(_0x3522('0x12'));var utils=require(_0x3522('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3522('0x14'));var db=require(_0x3522('0x15'))['db'];function respondWithStatusCode(_0x481dbb,_0x42ea3e){_0x42ea3e=_0x42ea3e||0xcc;return function(_0x1dc6c1){if(_0x1dc6c1){return _0x481dbb[_0x3522('0x16')](_0x42ea3e);}return _0x481dbb[_0x3522('0x17')](_0x42ea3e)[_0x3522('0x18')]();};}function respondWithResult(_0x4582f4,_0x31f1cd){_0x31f1cd=_0x31f1cd||0xc8;return function(_0x23c220){if(_0x23c220){return _0x4582f4['status'](_0x31f1cd)['json'](_0x23c220);}};}function respondWithFilteredResult(_0x88a907,_0x284982){return function(_0x4365f5){if(_0x4365f5){var _0x5cf5d7=typeof _0x284982[_0x3522('0x19')]==='undefined'&&typeof _0x284982[_0x3522('0x1a')]===_0x3522('0x1b');var _0x117ffb=_0x4365f5[_0x3522('0x1c')];var _0x24eab0=_0x5cf5d7?0x0:_0x284982[_0x3522('0x19')];var _0x183568=_0x5cf5d7?_0x4365f5[_0x3522('0x1c')]:_0x284982['offset']+_0x284982[_0x3522('0x1a')];var _0x3f09a4;if(_0x183568>=_0x117ffb){_0x183568=_0x117ffb;_0x3f09a4=0xc8;}else{_0x3f09a4=0xce;}_0x88a907[_0x3522('0x17')](_0x3f09a4);return _0x88a907['set'](_0x3522('0x1d'),_0x24eab0+'-'+_0x183568+'/'+_0x117ffb)[_0x3522('0x1e')](_0x4365f5);}return null;};}function patchUpdates(_0x318b92){return function(_0x4d43d4){try{jsonpatch['apply'](_0x4d43d4,_0x318b92,!![]);}catch(_0x397a75){return BPromise[_0x3522('0x1f')](_0x397a75);}return _0x4d43d4[_0x3522('0x20')]();};}function saveUpdates(_0x4b3770,_0x333034){return function(_0x424c21){if(_0x424c21){return _0x424c21[_0x3522('0x21')](_0x4b3770)[_0x3522('0x22')](function(_0x2210f8){return _0x2210f8;});}return null;};}function removeEntity(_0x43af92,_0x2f51b7){return function(_0x341e80){if(_0x341e80){return _0x341e80['destroy']()[_0x3522('0x22')](function(){_0x43af92[_0x3522('0x17')](0xcc)[_0x3522('0x18')]();});}};}function handleEntityNotFound(_0x54d477,_0xc27ac9){return function(_0x3c367e){if(!_0x3c367e){_0x54d477[_0x3522('0x16')](0x194);}return _0x3c367e;};}function handleError(_0x562231,_0x176d10){_0x176d10=_0x176d10||0x1f4;return function(_0x5a8aa4){logger[_0x3522('0x23')](_0x5a8aa4[_0x3522('0x24')]);if(_0x5a8aa4[_0x3522('0x25')]){delete _0x5a8aa4[_0x3522('0x25')];}_0x562231[_0x3522('0x17')](_0x176d10)[_0x3522('0x26')](_0x5a8aa4);};}exports[_0x3522('0x27')]=function(_0x3ef62e,_0x44e16d){var _0x5715ab={},_0xbee8d9={},_0x1aea8f={'count':0x0,'rows':[]};var _0x491b65=_[_0x3522('0x28')](db[_0x3522('0x29')][_0x3522('0x2a')],function(_0x585680){return{'name':_0x585680['fieldName'],'type':_0x585680[_0x3522('0x2b')]['key']};});_0xbee8d9[_0x3522('0x2c')]=_[_0x3522('0x28')](_0x491b65,_0x3522('0x25'));_0xbee8d9[_0x3522('0x2d')]=_[_0x3522('0x2e')](_0x3ef62e[_0x3522('0x2d')]);_0xbee8d9[_0x3522('0x2f')]=_[_0x3522('0x30')](_0xbee8d9['model'],_0xbee8d9[_0x3522('0x2d')]);_0x5715ab['attributes']=_[_0x3522('0x30')](_0xbee8d9[_0x3522('0x2c')],qs[_0x3522('0x31')](_0x3ef62e[_0x3522('0x2d')][_0x3522('0x31')]));_0x5715ab['attributes']=_0x5715ab[_0x3522('0x32')][_0x3522('0x33')]?_0x5715ab['attributes']:_0xbee8d9[_0x3522('0x2c')];if(!_0x3ef62e['query'][_0x3522('0x34')](_0x3522('0x35'))){_0x5715ab[_0x3522('0x1a')]=qs['limit'](_0x3ef62e[_0x3522('0x2d')][_0x3522('0x1a')]);_0x5715ab[_0x3522('0x19')]=qs[_0x3522('0x19')](_0x3ef62e[_0x3522('0x2d')]['offset']);}_0x5715ab[_0x3522('0x36')]=qs[_0x3522('0x37')](_0x3ef62e[_0x3522('0x2d')][_0x3522('0x37')]);_0x5715ab[_0x3522('0x38')]=qs[_0x3522('0x2f')](_[_0x3522('0x39')](_0x3ef62e['query'],_0xbee8d9['filters']),_0x491b65);if(_0x3ef62e[_0x3522('0x2d')]['filter']){_0x5715ab[_0x3522('0x38')]=_['merge'](_0x5715ab[_0x3522('0x38')],{'$or':_[_0x3522('0x28')](_0x491b65,function(_0x310190){if(_0x310190[_0x3522('0x2b')]!==_0x3522('0x3a')){var _0x5cabba={};_0x5cabba[_0x310190[_0x3522('0x25')]]={'$like':'%'+_0x3ef62e[_0x3522('0x2d')]['filter']+'%'};return _0x5cabba;}})});}_0x5715ab=_[_0x3522('0x3b')]({},_0x5715ab,_0x3ef62e[_0x3522('0x3c')]);var _0x112944={'where':_0x5715ab[_0x3522('0x38')]};return db[_0x3522('0x29')][_0x3522('0x1c')](_0x112944)[_0x3522('0x22')](function(_0xa4f33e){_0x1aea8f['count']=_0xa4f33e;if(_0x3ef62e[_0x3522('0x2d')]['includeAll']){_0x5715ab[_0x3522('0x3d')]=[{'all':!![]}];}return db[_0x3522('0x29')][_0x3522('0x3e')](_0x5715ab);})[_0x3522('0x22')](function(_0x110c02){_0x1aea8f[_0x3522('0x3f')]=_0x110c02;return _0x1aea8f;})['then'](respondWithFilteredResult(_0x44e16d,_0x5715ab))[_0x3522('0x40')](handleError(_0x44e16d,null));};exports[_0x3522('0x41')]=function(_0x1a5a55,_0x406531){var _0x2798db={'raw':!![],'where':{'id':_0x1a5a55[_0x3522('0x42')]['id']}},_0x46427b={};_0x46427b[_0x3522('0x2c')]=_[_0x3522('0x2e')](db[_0x3522('0x29')]['rawAttributes']);_0x46427b['query']=_['keys'](_0x1a5a55[_0x3522('0x2d')]);_0x46427b[_0x3522('0x2f')]=_['intersection'](_0x46427b[_0x3522('0x2c')],_0x46427b['query']);_0x2798db['attributes']=_[_0x3522('0x30')](_0x46427b[_0x3522('0x2c')],qs[_0x3522('0x31')](_0x1a5a55['query']['fields']));_0x2798db[_0x3522('0x32')]=_0x2798db['attributes'][_0x3522('0x33')]?_0x2798db[_0x3522('0x32')]:_0x46427b['model'];if(_0x1a5a55['query'][_0x3522('0x43')]){_0x2798db[_0x3522('0x3d')]=[{'all':!![]}];}_0x2798db=_[_0x3522('0x3b')]({},_0x2798db,_0x1a5a55['options']);return db[_0x3522('0x29')]['find'](_0x2798db)[_0x3522('0x22')](handleEntityNotFound(_0x406531,null))[_0x3522('0x22')](respondWithResult(_0x406531,null))[_0x3522('0x40')](handleError(_0x406531,null));};exports[_0x3522('0x44')]=function(_0x490536,_0x51f6d2){return db[_0x3522('0x29')][_0x3522('0x44')](_0x490536['body'],{})['then'](respondWithResult(_0x51f6d2,0xc9))[_0x3522('0x40')](handleError(_0x51f6d2,null));};exports[_0x3522('0x21')]=function(_0x213471,_0x264ebc){if(_0x213471[_0x3522('0x45')]['id']){delete _0x213471[_0x3522('0x45')]['id'];}return db[_0x3522('0x29')][_0x3522('0x46')]({'where':{'id':_0x213471[_0x3522('0x42')]['id']}})[_0x3522('0x22')](handleEntityNotFound(_0x264ebc,null))['then'](saveUpdates(_0x213471['body'],null))[_0x3522('0x22')](respondWithResult(_0x264ebc,null))[_0x3522('0x40')](handleError(_0x264ebc,null));};exports[_0x3522('0x47')]=function(_0x204f1b,_0x47b765){return db['ZendeskField'][_0x3522('0x46')]({'where':{'id':_0x204f1b['params']['id']}})[_0x3522('0x22')](handleEntityNotFound(_0x47b765,null))[_0x3522('0x22')](removeEntity(_0x47b765,null))['catch'](handleError(_0x47b765,null));}; \ No newline at end of file +var _0xb16b=['attributes','model','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','find','create','body','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','destroy','then','error','send','map','ZendeskField','fieldName','type','name','keys','filters','intersection','query'];(function(_0x54606b,_0x487803){var _0x4ba8a5=function(_0x351595){while(--_0x351595){_0x54606b['push'](_0x54606b['shift']());}};_0x4ba8a5(++_0x487803);}(_0xb16b,0x1ea));var _0xbb16=function(_0x88249c,_0x24124e){_0x88249c=_0x88249c-0x0;var _0x951993=_0xb16b[_0x88249c];return _0x951993;};'use strict';var emlformat=require(_0xbb16('0x0'));var rimraf=require(_0xbb16('0x1'));var zipdir=require(_0xbb16('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbb16('0x3'));var moment=require(_0xbb16('0x4'));var BPromise=require(_0xbb16('0x5'));var Mustache=require(_0xbb16('0x6'));var util=require('util');var path=require(_0xbb16('0x7'));var sox=require(_0xbb16('0x8'));var csv=require(_0xbb16('0x9'));var ejs=require(_0xbb16('0xa'));var fs=require('fs');var fs_extra=require(_0xbb16('0xb'));var _=require('lodash');var squel=require(_0xbb16('0xc'));var crypto=require(_0xbb16('0xd'));var jsforce=require(_0xbb16('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbb16('0x9'));var querystring=require(_0xbb16('0xf'));var Papa=require(_0xbb16('0x10'));var Redis=require(_0xbb16('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb16('0x12'));var logger=require(_0xbb16('0x13'))('api');var utils=require(_0xbb16('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbb16('0x15'))['db'];function respondWithStatusCode(_0x4c773d,_0x26ba7f){_0x26ba7f=_0x26ba7f||0xcc;return function(_0x39845e){if(_0x39845e){return _0x4c773d[_0xbb16('0x16')](_0x26ba7f);}return _0x4c773d['status'](_0x26ba7f)[_0xbb16('0x17')]();};}function respondWithResult(_0x341dfd,_0xeb05ce){_0xeb05ce=_0xeb05ce||0xc8;return function(_0x1bd7c8){if(_0x1bd7c8){return _0x341dfd[_0xbb16('0x18')](_0xeb05ce)[_0xbb16('0x19')](_0x1bd7c8);}};}function respondWithFilteredResult(_0x5c53d1,_0x35c902){return function(_0x57bdcc){if(_0x57bdcc){var _0x563675=typeof _0x35c902[_0xbb16('0x1a')]===_0xbb16('0x1b')&&typeof _0x35c902[_0xbb16('0x1c')]===_0xbb16('0x1b');var _0x583c1b=_0x57bdcc[_0xbb16('0x1d')];var _0x21ff83=_0x563675?0x0:_0x35c902['offset'];var _0x31a2b2=_0x563675?_0x57bdcc[_0xbb16('0x1d')]:_0x35c902[_0xbb16('0x1a')]+_0x35c902[_0xbb16('0x1c')];var _0x38386d;if(_0x31a2b2>=_0x583c1b){_0x31a2b2=_0x583c1b;_0x38386d=0xc8;}else{_0x38386d=0xce;}_0x5c53d1[_0xbb16('0x18')](_0x38386d);return _0x5c53d1[_0xbb16('0x1e')](_0xbb16('0x1f'),_0x21ff83+'-'+_0x31a2b2+'/'+_0x583c1b)[_0xbb16('0x19')](_0x57bdcc);}return null;};}function patchUpdates(_0x1bd37b){return function(_0x3816c4){try{jsonpatch[_0xbb16('0x20')](_0x3816c4,_0x1bd37b,!![]);}catch(_0x50094f){return BPromise['reject'](_0x50094f);}return _0x3816c4['save']();};}function saveUpdates(_0x1207c4,_0x4924aa){return function(_0x2347ce){if(_0x2347ce){return _0x2347ce['update'](_0x1207c4)['then'](function(_0x258aac){return _0x258aac;});}return null;};}function removeEntity(_0x206112,_0x236077){return function(_0x16b9c5){if(_0x16b9c5){return _0x16b9c5[_0xbb16('0x21')]()[_0xbb16('0x22')](function(){_0x206112[_0xbb16('0x18')](0xcc)[_0xbb16('0x17')]();});}};}function handleEntityNotFound(_0x17e124,_0x307fe2){return function(_0x47d756){if(!_0x47d756){_0x17e124[_0xbb16('0x16')](0x194);}return _0x47d756;};}function handleError(_0xf7c4e7,_0x188fd5){_0x188fd5=_0x188fd5||0x1f4;return function(_0x24f2b0){logger[_0xbb16('0x23')](_0x24f2b0['stack']);if(_0x24f2b0['name']){delete _0x24f2b0['name'];}_0xf7c4e7['status'](_0x188fd5)[_0xbb16('0x24')](_0x24f2b0);};}exports['index']=function(_0x45b10f,_0x18f1b5){var _0x28830b={},_0x2249ad={},_0x26f5f7={'count':0x0,'rows':[]};var _0x54c56d=_[_0xbb16('0x25')](db[_0xbb16('0x26')]['rawAttributes'],function(_0x139c41){return{'name':_0x139c41[_0xbb16('0x27')],'type':_0x139c41[_0xbb16('0x28')]['key']};});_0x2249ad['model']=_[_0xbb16('0x25')](_0x54c56d,_0xbb16('0x29'));_0x2249ad['query']=_[_0xbb16('0x2a')](_0x45b10f['query']);_0x2249ad[_0xbb16('0x2b')]=_[_0xbb16('0x2c')](_0x2249ad['model'],_0x2249ad[_0xbb16('0x2d')]);_0x28830b[_0xbb16('0x2e')]=_['intersection'](_0x2249ad[_0xbb16('0x2f')],qs[_0xbb16('0x30')](_0x45b10f['query'][_0xbb16('0x30')]));_0x28830b[_0xbb16('0x2e')]=_0x28830b[_0xbb16('0x2e')][_0xbb16('0x31')]?_0x28830b[_0xbb16('0x2e')]:_0x2249ad[_0xbb16('0x2f')];if(!_0x45b10f['query']['hasOwnProperty'](_0xbb16('0x32'))){_0x28830b['limit']=qs[_0xbb16('0x1c')](_0x45b10f[_0xbb16('0x2d')][_0xbb16('0x1c')]);_0x28830b[_0xbb16('0x1a')]=qs[_0xbb16('0x1a')](_0x45b10f[_0xbb16('0x2d')]['offset']);}_0x28830b['order']=qs[_0xbb16('0x33')](_0x45b10f[_0xbb16('0x2d')][_0xbb16('0x33')]);_0x28830b[_0xbb16('0x34')]=qs['filters'](_['pick'](_0x45b10f['query'],_0x2249ad[_0xbb16('0x2b')]),_0x54c56d);if(_0x45b10f[_0xbb16('0x2d')][_0xbb16('0x35')]){_0x28830b[_0xbb16('0x34')]=_[_0xbb16('0x36')](_0x28830b[_0xbb16('0x34')],{'$or':_[_0xbb16('0x25')](_0x54c56d,function(_0x337745){if(_0x337745[_0xbb16('0x28')]!==_0xbb16('0x37')){var _0x906c2e={};_0x906c2e[_0x337745['name']]={'$like':'%'+_0x45b10f['query'][_0xbb16('0x35')]+'%'};return _0x906c2e;}})});}_0x28830b=_[_0xbb16('0x36')]({},_0x28830b,_0x45b10f[_0xbb16('0x38')]);var _0x1c9baf={'where':_0x28830b[_0xbb16('0x34')]};return db['ZendeskField'][_0xbb16('0x1d')](_0x1c9baf)[_0xbb16('0x22')](function(_0xe567ff){_0x26f5f7['count']=_0xe567ff;if(_0x45b10f[_0xbb16('0x2d')][_0xbb16('0x39')]){_0x28830b['include']=[{'all':!![]}];}return db[_0xbb16('0x26')][_0xbb16('0x3a')](_0x28830b);})[_0xbb16('0x22')](function(_0x1ada28){_0x26f5f7[_0xbb16('0x3b')]=_0x1ada28;return _0x26f5f7;})[_0xbb16('0x22')](respondWithFilteredResult(_0x18f1b5,_0x28830b))[_0xbb16('0x3c')](handleError(_0x18f1b5,null));};exports['show']=function(_0x4e3422,_0x502d34){var _0x25e068={'raw':!![],'where':{'id':_0x4e3422[_0xbb16('0x3d')]['id']}},_0x248036={};_0x248036['model']=_[_0xbb16('0x2a')](db['ZendeskField'][_0xbb16('0x3e')]);_0x248036[_0xbb16('0x2d')]=_[_0xbb16('0x2a')](_0x4e3422[_0xbb16('0x2d')]);_0x248036['filters']=_[_0xbb16('0x2c')](_0x248036[_0xbb16('0x2f')],_0x248036['query']);_0x25e068[_0xbb16('0x2e')]=_['intersection'](_0x248036[_0xbb16('0x2f')],qs[_0xbb16('0x30')](_0x4e3422[_0xbb16('0x2d')][_0xbb16('0x30')]));_0x25e068[_0xbb16('0x2e')]=_0x25e068[_0xbb16('0x2e')]['length']?_0x25e068[_0xbb16('0x2e')]:_0x248036[_0xbb16('0x2f')];if(_0x4e3422[_0xbb16('0x2d')]['includeAll']){_0x25e068['include']=[{'all':!![]}];}_0x25e068=_[_0xbb16('0x36')]({},_0x25e068,_0x4e3422[_0xbb16('0x38')]);return db[_0xbb16('0x26')][_0xbb16('0x3f')](_0x25e068)['then'](handleEntityNotFound(_0x502d34,null))[_0xbb16('0x22')](respondWithResult(_0x502d34,null))['catch'](handleError(_0x502d34,null));};exports[_0xbb16('0x40')]=function(_0x3830b9,_0x61a460){return db[_0xbb16('0x26')]['create'](_0x3830b9[_0xbb16('0x41')],{})[_0xbb16('0x22')](respondWithResult(_0x61a460,0xc9))['catch'](handleError(_0x61a460,null));};exports[_0xbb16('0x42')]=function(_0x10f100,_0x1770ce){if(_0x10f100['body']['id']){delete _0x10f100[_0xbb16('0x41')]['id'];}return db[_0xbb16('0x26')][_0xbb16('0x3f')]({'where':{'id':_0x10f100['params']['id']}})[_0xbb16('0x22')](handleEntityNotFound(_0x1770ce,null))[_0xbb16('0x22')](saveUpdates(_0x10f100[_0xbb16('0x41')],null))[_0xbb16('0x22')](respondWithResult(_0x1770ce,null))['catch'](handleError(_0x1770ce,null));};exports[_0xbb16('0x21')]=function(_0x2cf6d7,_0x38f8c8){return db[_0xbb16('0x26')][_0xbb16('0x3f')]({'where':{'id':_0x2cf6d7[_0xbb16('0x3d')]['id']}})['then'](handleEntityNotFound(_0x38f8c8,null))[_0xbb16('0x22')](removeEntity(_0x38f8c8,null))[_0xbb16('0x3c')](handleError(_0x38f8c8,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 720bbce..a14293a 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 _0x73d8=['FieldId','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ZendeskField','int_zendesk_fields','idField'];(function(_0xb13b04,_0x3d6e1d){var _0x507954=function(_0x532b80){while(--_0x532b80){_0xb13b04['push'](_0xb13b04['shift']());}};_0x507954(++_0x3d6e1d);}(_0x73d8,0x194));var _0x873d=function(_0x1cadff,_0x268dd1){_0x1cadff=_0x1cadff-0x0;var _0x4ef14b=_0x73d8[_0x1cadff];return _0x4ef14b;};'use strict';var _=require(_0x873d('0x0'));var util=require(_0x873d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x873d('0x2'));var BPromise=require(_0x873d('0x3'));var rp=require(_0x873d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x873d('0x5'));var config=require(_0x873d('0x6'));var attributes=require('./intZendeskField.attributes');module[_0x873d('0x7')]=function(_0x32efca,_0x1f8e6a){return _0x32efca[_0x873d('0x8')](_0x873d('0x9'),attributes,{'tableName':_0x873d('0xa'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x873d('0xb'),_0x873d('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x233b=['zendesk_unique_index','idField','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields'];(function(_0x1ab8bd,_0x314b4b){var _0x17a7f7=function(_0x20e6bb){while(--_0x20e6bb){_0x1ab8bd['push'](_0x1ab8bd['shift']());}};_0x17a7f7(++_0x314b4b);}(_0x233b,0x6b));var _0xb233=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x233b[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0xb233('0x0'));var util=require(_0xb233('0x1'));var logger=require(_0xb233('0x2'))(_0xb233('0x3'));var moment=require('moment');var BPromise=require(_0xb233('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb233('0x5'));var rimraf=require(_0xb233('0x6'));var config=require(_0xb233('0x7'));var attributes=require(_0xb233('0x8'));module[_0xb233('0x9')]=function(_0x36f141,_0x5b17f6){return _0x36f141[_0xb233('0xa')](_0xb233('0xb'),attributes,{'tableName':_0xb233('0xc'),'paranoid':![],'indexes':[{'name':_0xb233('0xd'),'fields':[_0xb233('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 89d80cb..5ad9875 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 _0x45a6=['../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ZendeskField,\x20%s,\x20%s','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x45a6,0xeb));var _0x645a=function(_0x7d27ea,_0x3b459b){_0x7d27ea=_0x7d27ea-0x0;var _0x1cc23d=_0x45a6[_0x7d27ea];return _0x1cc23d;};'use strict';var _=require(_0x645a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x645a('0x1'));var rs=require(_0x645a('0x2'));var fs=require('fs');var Redis=require(_0x645a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x645a('0x4'));var logger=require(_0x645a('0x5'))(_0x645a('0x6'));var config=require(_0x645a('0x7'));var jayson=require(_0x645a('0x8'));var client=jayson['client'][_0x645a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x271bf4,_0x1e7ca4,_0x22f422){return new BPromise(function(_0x4bbb6a,_0x25dea0){return client['request'](_0x271bf4,_0x22f422)[_0x645a('0xa')](function(_0x2eb724){logger[_0x645a('0xb')](_0x645a('0xc'),_0x1e7ca4,'request\x20sent');logger['debug'](_0x645a('0xd'),_0x1e7ca4,_0x645a('0xe'),JSON[_0x645a('0xf')](_0x2eb724));if(_0x2eb724[_0x645a('0x10')]){if(_0x2eb724['error'][_0x645a('0x11')]===0x1f4){logger['error'](_0x645a('0xc'),_0x1e7ca4,_0x2eb724[_0x645a('0x10')][_0x645a('0x12')]);return _0x25dea0(_0x2eb724[_0x645a('0x10')]['message']);}logger[_0x645a('0x10')]('ZendeskField,\x20%s,\x20%s',_0x1e7ca4,_0x2eb724['error']['message']);return _0x4bbb6a(_0x2eb724[_0x645a('0x10')][_0x645a('0x12')]);}else{logger[_0x645a('0xb')](_0x645a('0xc'),_0x1e7ca4,_0x645a('0xe'));_0x4bbb6a(_0x2eb724['result'][_0x645a('0x12')]);}})[_0x645a('0x13')](function(_0x15850a){logger['error'](_0x645a('0xc'),_0x1e7ca4,_0x15850a);_0x25dea0(_0x15850a);});});} \ No newline at end of file +var _0x9aa1=['then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x9aa1,0xfa));var _0x19aa=function(_0x1f0ab2,_0x3c1839){_0x1f0ab2=_0x1f0ab2-0x0;var _0x49b45f=_0x9aa1[_0x1f0ab2];return _0x49b45f;};'use strict';var _=require(_0x19aa('0x0'));var util=require(_0x19aa('0x1'));var moment=require(_0x19aa('0x2'));var BPromise=require('bluebird');var rs=require(_0x19aa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x19aa('0x4'));var logger=require(_0x19aa('0x5'))(_0x19aa('0x6'));var config=require(_0x19aa('0x7'));var jayson=require(_0x19aa('0x8'));var client=jayson[_0x19aa('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6c6db1,_0xed7634,_0x309e3b){return new BPromise(function(_0x25c8ca,_0x36a50c){return client['request'](_0x6c6db1,_0x309e3b)[_0x19aa('0xa')](function(_0xcb1251){logger[_0x19aa('0xb')](_0x19aa('0xc'),_0xed7634,_0x19aa('0xd'));logger[_0x19aa('0xe')](_0x19aa('0xf'),_0xed7634,_0x19aa('0xd'),JSON[_0x19aa('0x10')](_0xcb1251));if(_0xcb1251[_0x19aa('0x11')]){if(_0xcb1251[_0x19aa('0x11')][_0x19aa('0x12')]===0x1f4){logger[_0x19aa('0x11')]('ZendeskField,\x20%s,\x20%s',_0xed7634,_0xcb1251['error'][_0x19aa('0x13')]);return _0x36a50c(_0xcb1251[_0x19aa('0x11')]['message']);}logger[_0x19aa('0x11')](_0x19aa('0xc'),_0xed7634,_0xcb1251[_0x19aa('0x11')][_0x19aa('0x13')]);return _0x25c8ca(_0xcb1251[_0x19aa('0x11')][_0x19aa('0x13')]);}else{logger[_0x19aa('0xb')]('ZendeskField,\x20%s,\x20%s',_0xed7634,_0x19aa('0xd'));_0x25c8ca(_0xcb1251['result']['message']);}})['catch'](function(_0x1ab071){logger['error'](_0x19aa('0xc'),_0xed7634,_0x1ab071);_0x36a50c(_0x1ab071);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index d757df3..08d9621 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 _0xb5c9=['delete','multer','util','path','express','../../components/auth/service','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update'];(function(_0x16a202,_0x3b81f6){var _0x5f106e=function(_0x559778){while(--_0x559778){_0x16a202['push'](_0x16a202['shift']());}};_0x5f106e(++_0x3b81f6);}(_0xb5c9,0x141));var _0x9b5c=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xb5c9[_0x18ab2a];return _0x16dcee;};'use strict';var multer=require(_0x9b5c('0x0'));var util=require(_0x9b5c('0x1'));var path=require(_0x9b5c('0x2'));var timeout=require('connect-timeout');var express=require(_0x9b5c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9b5c('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9b5c('0x5'));router[_0x9b5c('0x6')]('/',auth[_0x9b5c('0x7')](),controller[_0x9b5c('0x8')]);router[_0x9b5c('0x6')](_0x9b5c('0x9'),auth[_0x9b5c('0x7')](),controller[_0x9b5c('0xa')]);router[_0x9b5c('0x6')](_0x9b5c('0xb'),auth['isAuthenticated'](),controller[_0x9b5c('0xc')]);router[_0x9b5c('0x6')](_0x9b5c('0xd'),auth[_0x9b5c('0x7')](),controller[_0x9b5c('0xe')]);router[_0x9b5c('0xf')]('/',auth[_0x9b5c('0x7')](),controller[_0x9b5c('0x10')]);router['post'](_0x9b5c('0xb'),auth[_0x9b5c('0x7')](),controller['addConfiguration']);router[_0x9b5c('0x11')](_0x9b5c('0x9'),auth[_0x9b5c('0x7')](),controller[_0x9b5c('0x12')]);router[_0x9b5c('0x13')](_0x9b5c('0x9'),auth[_0x9b5c('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x156b=['/:id/fields','getFields','post','create','addConfiguration','put','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/configurations'];(function(_0x528697,_0xf42860){var _0x467482=function(_0x377449){while(--_0x377449){_0x528697['push'](_0x528697['shift']());}};_0x467482(++_0xf42860);}(_0x156b,0x143));var _0xb156=function(_0x8ec916,_0x39b8b1){_0x8ec916=_0x8ec916-0x0;var _0x18097a=_0x156b[_0x8ec916];return _0x18097a;};'use strict';var multer=require(_0xb156('0x0'));var util=require(_0xb156('0x1'));var path=require('path');var timeout=require(_0xb156('0x2'));var express=require(_0xb156('0x3'));var router=express[_0xb156('0x4')]();var fs_extra=require(_0xb156('0x5'));var auth=require(_0xb156('0x6'));var interaction=require(_0xb156('0x7'));var config=require(_0xb156('0x8'));var controller=require('./intZohoAccount.controller');router[_0xb156('0x9')]('/',auth[_0xb156('0xa')](),controller['index']);router[_0xb156('0x9')](_0xb156('0xb'),auth[_0xb156('0xa')](),controller['show']);router[_0xb156('0x9')](_0xb156('0xc'),auth[_0xb156('0xa')](),controller['getConfigurations']);router[_0xb156('0x9')](_0xb156('0xd'),auth['isAuthenticated'](),controller[_0xb156('0xe')]);router[_0xb156('0xf')]('/',auth['isAuthenticated'](),controller[_0xb156('0x10')]);router[_0xb156('0xf')](_0xb156('0xc'),auth[_0xb156('0xa')](),controller[_0xb156('0x11')]);router[_0xb156('0x12')]('/:id',auth[_0xb156('0xa')](),controller[_0xb156('0x13')]);router['delete'](_0xb156('0xb'),auth[_0xb156('0xa')](),controller['destroy']);module[_0xb156('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index c07b700..c5c9daa 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 _0x6f0d=['exports','STRING'];(function(_0xd22fe5,_0x51b065){var _0x22fef8=function(_0x48a9f5){while(--_0x48a9f5){_0xd22fe5['push'](_0xd22fe5['shift']());}};_0x22fef8(++_0x51b065);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x3e3d35,_0x54f590){_0x3e3d35=_0x3e3d35-0x0;var _0x2e6376=_0x6f0d[_0x3e3d35];return _0x2e6376;};'use strict';var Sequelize=require('sequelize');module[_0xd6f0('0x0')]={'name':{'type':Sequelize[_0xd6f0('0x1')]},'description':{'type':Sequelize[_0xd6f0('0x1')]},'host':{'type':Sequelize[_0xd6f0('0x1')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xd6f0('0x1')]},'clientSecret':{'type':Sequelize[_0xd6f0('0x1')]},'serverUrl':{'type':Sequelize[_0xd6f0('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xd6f0('0x1')]},'refreshToken':{'type':Sequelize[_0xd6f0('0x1')]}}; \ No newline at end of file +var _0xbec5=['STRING','sequelize','exports'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xbec5,0xe5));var _0x5bec=function(_0x1b76e6,_0x598520){_0x1b76e6=_0x1b76e6-0x0;var _0x333b53=_0xbec5[_0x1b76e6];return _0x333b53;};'use strict';var Sequelize=require(_0x5bec('0x0'));module[_0x5bec('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5bec('0x2')]},'host':{'type':Sequelize[_0x5bec('0x2')]},'zone':{'type':Sequelize[_0x5bec('0x2')]},'clientId':{'type':Sequelize[_0x5bec('0x2')]},'clientSecret':{'type':Sequelize[_0x5bec('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize[_0x5bec('0x2')]},'refreshToken':{'type':Sequelize[_0x5bec('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index e68e91f..9c8993d 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 _0xc289=['getFields','host','zone','zoho.eu','com','serverUrl','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','error','message','Owner','Subject','WhoId','Call_Result','Call_Start_Time','Call_Type','includes','api_name','system_mandatory','push','display_label','custom_field','picklist','pick_list_values','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','squel','crypto','desk.js','to-csv','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ZohoAccount','then','includeAll','findAll','rows','catch','params','include','create','body','update','find','destroy','findOne','ZohoConfiguration','getConfigurations','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZohoField','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','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token'];(function(_0x20f4d0,_0x2e5bb9){var _0x4548cd=function(_0x4f1632){while(--_0x4f1632){_0x20f4d0['push'](_0x20f4d0['shift']());}};_0x4548cd(++_0x2e5bb9);}(_0xc289,0x1a4));var _0x9c28=function(_0x5e057e,_0x181d75){_0x5e057e=_0x5e057e-0x0;var _0x27a260=_0xc289[_0x5e057e];return _0x27a260;};'use strict';var emlformat=require(_0x9c28('0x0'));var rimraf=require(_0x9c28('0x1'));var zipdir=require(_0x9c28('0x2'));var jsonpatch=require(_0x9c28('0x3'));var rp=require(_0x9c28('0x4'));var moment=require(_0x9c28('0x5'));var BPromise=require(_0x9c28('0x6'));var Mustache=require('mustache');var util=require(_0x9c28('0x7'));var path=require(_0x9c28('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9c28('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9c28('0xa'));var crypto=require(_0x9c28('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9c28('0xc'));var toCsv=require(_0x9c28('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9c28('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9c28('0xf'));var hardwareService=require(_0x9c28('0x10'));var logger=require('../../config/logger')(_0x9c28('0x11'));var utils=require(_0x9c28('0x12'));var config=require(_0x9c28('0x13'));var licenseUtil=require(_0x9c28('0x14'));var db=require(_0x9c28('0x15'))['db'];var integrations=require(_0x9c28('0x16'));function respondWithStatusCode(_0x591399,_0xc27d42){_0xc27d42=_0xc27d42||0xcc;return function(_0x38542d){if(_0x38542d){return _0x591399['sendStatus'](_0xc27d42);}return _0x591399['status'](_0xc27d42)[_0x9c28('0x17')]();};}function respondWithResult(_0x3cdd16,_0x49ae58){_0x49ae58=_0x49ae58||0xc8;return function(_0x1056a9){if(_0x1056a9){return _0x3cdd16[_0x9c28('0x18')](_0x49ae58)[_0x9c28('0x19')](_0x1056a9);}};}function respondWithFilteredResult(_0x4aac16,_0x498d9f){return function(_0x330398){if(_0x330398){var _0x27e188=typeof _0x498d9f[_0x9c28('0x1a')]===_0x9c28('0x1b')&&typeof _0x498d9f[_0x9c28('0x1c')]==='undefined';var _0x34c81e=_0x330398['count'];var _0x4c97c7=_0x27e188?0x0:_0x498d9f[_0x9c28('0x1a')];var _0x5c6da5=_0x27e188?_0x330398[_0x9c28('0x1d')]:_0x498d9f[_0x9c28('0x1a')]+_0x498d9f['limit'];var _0x11a577;if(_0x5c6da5>=_0x34c81e){_0x5c6da5=_0x34c81e;_0x11a577=0xc8;}else{_0x11a577=0xce;}_0x4aac16['status'](_0x11a577);return _0x4aac16[_0x9c28('0x1e')](_0x9c28('0x1f'),_0x4c97c7+'-'+_0x5c6da5+'/'+_0x34c81e)[_0x9c28('0x19')](_0x330398);}return null;};}function patchUpdates(_0x4a3071){return function(_0x469334){try{jsonpatch[_0x9c28('0x20')](_0x469334,_0x4a3071,!![]);}catch(_0x418a98){return BPromise[_0x9c28('0x21')](_0x418a98);}return _0x469334['save']();};}function saveUpdates(_0x59f4ad,_0x491f78){return function(_0x913b9f){if(_0x913b9f){return _0x913b9f['update'](_0x59f4ad)['then'](function(_0x48a4d4){return _0x48a4d4;});}return null;};}function removeEntity(_0x30fa69,_0x2b3f87){return function(_0x11430d){if(_0x11430d){return _0x11430d['destroy']()['then'](function(){_0x30fa69['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x17007d,_0x3e9d57){return function(_0x191613){if(!_0x191613){_0x17007d[_0x9c28('0x22')](0x194);}return _0x191613;};}function handleError(_0x54a89a,_0x51bb2a){_0x51bb2a=_0x51bb2a||0x1f4;return function(_0x1a7186){logger['error'](_0x1a7186[_0x9c28('0x23')]);if(_0x1a7186[_0x9c28('0x24')]){delete _0x1a7186['name'];}_0x54a89a['status'](_0x51bb2a)[_0x9c28('0x25')](_0x1a7186);};}exports[_0x9c28('0x26')]=function(_0x19b2dd,_0x407638){var _0x2291fb={},_0x47e6be={},_0x16a9a4={'count':0x0,'rows':[]};var _0x5034c3=_[_0x9c28('0x27')](db['ZohoAccount'][_0x9c28('0x28')],function(_0x1bd2c0){return{'name':_0x1bd2c0[_0x9c28('0x29')],'type':_0x1bd2c0[_0x9c28('0x2a')][_0x9c28('0x2b')]};});_0x47e6be[_0x9c28('0x2c')]=_[_0x9c28('0x27')](_0x5034c3,_0x9c28('0x24'));_0x47e6be['query']=_[_0x9c28('0x2d')](_0x19b2dd['query']);_0x47e6be[_0x9c28('0x2e')]=_[_0x9c28('0x2f')](_0x47e6be[_0x9c28('0x2c')],_0x47e6be[_0x9c28('0x30')]);_0x2291fb[_0x9c28('0x31')]=_['intersection'](_0x47e6be[_0x9c28('0x2c')],qs[_0x9c28('0x32')](_0x19b2dd['query'][_0x9c28('0x32')]));_0x2291fb[_0x9c28('0x31')]=_0x2291fb[_0x9c28('0x31')][_0x9c28('0x33')]?_0x2291fb[_0x9c28('0x31')]:_0x47e6be['model'];if(!_0x19b2dd[_0x9c28('0x30')][_0x9c28('0x34')](_0x9c28('0x35'))){_0x2291fb[_0x9c28('0x1c')]=qs[_0x9c28('0x1c')](_0x19b2dd[_0x9c28('0x30')][_0x9c28('0x1c')]);_0x2291fb['offset']=qs['offset'](_0x19b2dd['query'][_0x9c28('0x1a')]);}_0x2291fb[_0x9c28('0x36')]=qs['sort'](_0x19b2dd[_0x9c28('0x30')][_0x9c28('0x37')]);_0x2291fb[_0x9c28('0x38')]=qs[_0x9c28('0x2e')](_[_0x9c28('0x39')](_0x19b2dd[_0x9c28('0x30')],_0x47e6be[_0x9c28('0x2e')]),_0x5034c3);if(_0x19b2dd[_0x9c28('0x30')][_0x9c28('0x3a')]){_0x2291fb['where']=_[_0x9c28('0x3b')](_0x2291fb[_0x9c28('0x38')],{'$or':_['map'](_0x5034c3,function(_0x43d293){if(_0x43d293['type']!==_0x9c28('0x3c')){var _0x4ea2dd={};_0x4ea2dd[_0x43d293[_0x9c28('0x24')]]={'$like':'%'+_0x19b2dd[_0x9c28('0x30')][_0x9c28('0x3a')]+'%'};return _0x4ea2dd;}})});}_0x2291fb=_[_0x9c28('0x3b')]({},_0x2291fb,_0x19b2dd[_0x9c28('0x3d')]);var _0x5a329a={'where':_0x2291fb['where']};return db[_0x9c28('0x3e')][_0x9c28('0x1d')](_0x5a329a)[_0x9c28('0x3f')](function(_0xc27e2c){_0x16a9a4[_0x9c28('0x1d')]=_0xc27e2c;if(_0x19b2dd[_0x9c28('0x30')][_0x9c28('0x40')]){_0x2291fb['include']=[{'all':!![]}];}return db[_0x9c28('0x3e')][_0x9c28('0x41')](_0x2291fb);})['then'](function(_0x1f8a64){_0x16a9a4[_0x9c28('0x42')]=_0x1f8a64;return _0x16a9a4;})[_0x9c28('0x3f')](respondWithFilteredResult(_0x407638,_0x2291fb))[_0x9c28('0x43')](handleError(_0x407638,null));};exports['show']=function(_0x52876b,_0xbf92e0){var _0x324f29={'raw':![],'where':{'id':_0x52876b[_0x9c28('0x44')]['id']}},_0x9b8669={};_0x9b8669[_0x9c28('0x2c')]=_[_0x9c28('0x2d')](db[_0x9c28('0x3e')]['rawAttributes']);_0x9b8669['query']=_['keys'](_0x52876b['query']);_0x9b8669[_0x9c28('0x2e')]=_['intersection'](_0x9b8669[_0x9c28('0x2c')],_0x9b8669[_0x9c28('0x30')]);_0x324f29['attributes']=_[_0x9c28('0x2f')](_0x9b8669[_0x9c28('0x2c')],qs[_0x9c28('0x32')](_0x52876b[_0x9c28('0x30')][_0x9c28('0x32')]));_0x324f29[_0x9c28('0x31')]=_0x324f29[_0x9c28('0x31')][_0x9c28('0x33')]?_0x324f29[_0x9c28('0x31')]:_0x9b8669[_0x9c28('0x2c')];if(_0x52876b['query']['includeAll']){_0x324f29[_0x9c28('0x45')]=[{'all':!![]}];}_0x324f29=_[_0x9c28('0x3b')]({},_0x324f29,_0x52876b['options']);return db[_0x9c28('0x3e')]['find'](_0x324f29)[_0x9c28('0x3f')](handleEntityNotFound(_0xbf92e0,null))[_0x9c28('0x3f')](respondWithResult(_0xbf92e0,null))[_0x9c28('0x43')](handleError(_0xbf92e0,null));};exports[_0x9c28('0x46')]=function(_0x28eee3,_0x381d6a){return db[_0x9c28('0x3e')][_0x9c28('0x46')](_0x28eee3[_0x9c28('0x47')],{})['then'](respondWithResult(_0x381d6a,0xc9))[_0x9c28('0x43')](handleError(_0x381d6a,null));};exports[_0x9c28('0x48')]=function(_0x32d328,_0x5e020d){if(_0x32d328['body']['id']){delete _0x32d328[_0x9c28('0x47')]['id'];}return db['ZohoAccount'][_0x9c28('0x49')]({'where':{'id':_0x32d328[_0x9c28('0x44')]['id']}})['then'](handleEntityNotFound(_0x5e020d,null))[_0x9c28('0x3f')](saveUpdates(_0x32d328[_0x9c28('0x47')],null))[_0x9c28('0x3f')](respondWithResult(_0x5e020d,null))['catch'](handleError(_0x5e020d,null));};exports[_0x9c28('0x4a')]=function(_0x20f5a6,_0x4a4170){return db[_0x9c28('0x3e')][_0x9c28('0x49')]({'where':{'id':_0x20f5a6[_0x9c28('0x44')]['id']}})['then'](handleEntityNotFound(_0x4a4170,null))['then'](removeEntity(_0x4a4170,null))[_0x9c28('0x43')](handleError(_0x4a4170,null));};exports['getConfigurations']=function(_0x5d3777,_0xc5815f,_0x208668){var _0x11a0dd={};var _0x288c11={};var _0x35c9a3;var _0x2680e7;return db[_0x9c28('0x3e')][_0x9c28('0x4b')]({'where':{'id':_0x5d3777['params']['id']}})[_0x9c28('0x3f')](handleEntityNotFound(_0xc5815f,null))[_0x9c28('0x3f')](function(_0x51cf14){if(_0x51cf14){_0x35c9a3=_0x51cf14;_0x288c11[_0x9c28('0x2c')]=_[_0x9c28('0x2d')](db[_0x9c28('0x4c')][_0x9c28('0x28')]);_0x288c11[_0x9c28('0x30')]=_[_0x9c28('0x2d')](_0x5d3777[_0x9c28('0x30')]);_0x288c11['filters']=_['intersection'](_0x288c11[_0x9c28('0x2c')],_0x288c11['query']);_0x11a0dd[_0x9c28('0x31')]=_[_0x9c28('0x2f')](_0x288c11[_0x9c28('0x2c')],qs[_0x9c28('0x32')](_0x5d3777[_0x9c28('0x30')][_0x9c28('0x32')]));_0x11a0dd[_0x9c28('0x31')]=_0x11a0dd[_0x9c28('0x31')][_0x9c28('0x33')]?_0x11a0dd[_0x9c28('0x31')]:_0x288c11[_0x9c28('0x2c')];_0x11a0dd['order']=qs[_0x9c28('0x37')](_0x5d3777[_0x9c28('0x30')][_0x9c28('0x37')]);_0x11a0dd[_0x9c28('0x38')]=qs[_0x9c28('0x2e')](_[_0x9c28('0x39')](_0x5d3777['query'],_0x288c11['filters']));if(_0x5d3777['query'][_0x9c28('0x3a')]){_0x11a0dd['where']=_[_0x9c28('0x3b')](_0x11a0dd['where'],{'$or':_[_0x9c28('0x27')](_0x11a0dd[_0x9c28('0x31')],function(_0x36be19){var _0x5241a4={};_0x5241a4[_0x36be19]={'$like':'%'+_0x5d3777[_0x9c28('0x30')][_0x9c28('0x3a')]+'%'};return _0x5241a4;})});}_0x11a0dd=_[_0x9c28('0x3b')]({},_0x11a0dd,_0x5d3777['options']);return _0x35c9a3[_0x9c28('0x4d')](_0x11a0dd);}})[_0x9c28('0x3f')](function(_0x20b35e){if(_0x20b35e){_0x2680e7=_0x20b35e['length'];if(!_0x5d3777['query']['hasOwnProperty'](_0x9c28('0x35'))){_0x11a0dd[_0x9c28('0x1c')]=qs[_0x9c28('0x1c')](_0x5d3777[_0x9c28('0x30')][_0x9c28('0x1c')]);_0x11a0dd[_0x9c28('0x1a')]=qs[_0x9c28('0x1a')](_0x5d3777[_0x9c28('0x30')][_0x9c28('0x1a')]);}return _0x35c9a3[_0x9c28('0x4d')](_0x11a0dd);}})[_0x9c28('0x3f')](function(_0x309c95){if(_0x309c95){return _0x309c95?{'count':_0x2680e7,'rows':_0x309c95}:null;}})['then'](respondWithResult(_0xc5815f,null))[_0x9c28('0x43')](handleError(_0xc5815f,null));};exports['addConfiguration']=function(_0x34fcf3,_0x339e67,_0x46402a){if(_0x34fcf3[_0x9c28('0x47')]['id']){delete _0x34fcf3[_0x9c28('0x47')]['id'];}return db[_0x9c28('0x3e')]['findOne']({'where':{'id':_0x34fcf3['params']['id']}})[_0x9c28('0x3f')](handleEntityNotFound(_0x339e67,null))['then'](function(_0x5487ae){if(_0x5487ae){_0x34fcf3['body'][_0x9c28('0x4e')]=_0x5487ae['id'];_0x34fcf3[_0x9c28('0x47')][_0x9c28('0x4f')]=integrations[_0x9c28('0x50')](_0x34fcf3[_0x9c28('0x47')]['channel'],_0x34fcf3[_0x9c28('0x47')][_0x9c28('0x2a')]);_0x34fcf3[_0x9c28('0x47')][_0x9c28('0x51')]=integrations[_0x9c28('0x52')](_0x34fcf3[_0x9c28('0x47')][_0x9c28('0x53')],_0x34fcf3[_0x9c28('0x47')]['type']);return db[_0x9c28('0x4c')][_0x9c28('0x46')](_0x34fcf3['body'],{'include':[{'model':db[_0x9c28('0x54')],'as':'Subjects'},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x339e67,null))[_0x9c28('0x43')](handleError(_0x339e67,null));};function getAccessToken(_0x58bcf0){return new Promise(function(_0x1eb6d1,_0x2663f6){var _0xf86693;switch(_0x58bcf0['zone']){case'US':_0xf86693='https://accounts.zoho.com';break;case'AU':_0xf86693=_0x9c28('0x55');break;case'EU':_0xf86693=_0x9c28('0x56');break;case'IN':_0xf86693=_0x9c28('0x57');break;case'CN':_0xf86693=_0x9c28('0x58');break;default:_0xf86693=_0x9c28('0x56');break;}var _0xa236ea={'method':_0x9c28('0x59'),'uri':_0xf86693+_0x9c28('0x5a'),'qs':{'refresh_token':_0x58bcf0[_0x9c28('0x5b')],'client_id':_0x58bcf0[_0x9c28('0x5c')],'client_secret':_0x58bcf0[_0x9c28('0x5d')],'grant_type':'refresh_token'},'json':!![]};return rp(_0xa236ea)[_0x9c28('0x3f')](function(_0x4e8faa){if(_0x4e8faa[_0x9c28('0x5e')]){_0x1eb6d1(_0x4e8faa[_0x9c28('0x5e')]);}else{_0x2663f6(_0x9c28('0x5f'));}})[_0x9c28('0x43')](function(_0x404973){_0x2663f6(_0x404973);});});}exports[_0x9c28('0x60')]=function(_0x5ee55d,_0xc6f19c,_0x598aec){var _0x6ee055,_0x119d71,_0x540a1b,_0x1c73c6,_0x3775ff;return db['ZohoAccount'][_0x9c28('0x4b')]({'where':{'id':_0x5ee55d['params']['id']},'attributes':['id',_0x9c28('0x61'),_0x9c28('0x62'),_0x9c28('0x5c'),'clientSecret','serverUrl','code',_0x9c28('0x5b')]})['then'](handleEntityNotFound(_0xc6f19c,null))[_0x9c28('0x3f')](function(_0x52bc95){_0x3775ff=_0x52bc95;_0x6ee055=_0x3775ff['host'];_0x119d71=_0x6ee055===_0x9c28('0x63')?'eu':_0x9c28('0x64');_0x540a1b=_0x3775ff[_0x9c28('0x65')];var _0x5521be=_0x540a1b['slice'](-0x1);if(_0x5521be==='/'||_0x5521be==='\x5c'||_0x5521be===':'){_0x540a1b=_0x540a1b[_0x9c28('0x66')](0x0,_0x540a1b[_0x9c28('0x67')](_0x5521be));}if(!_0x3775ff[_0x9c28('0x5b')]){throw new Error(_0x9c28('0x68'));}return getAccessToken(_0x3775ff);})[_0x9c28('0x3f')](function(_0x41ae08){if(_0x41ae08){return rp({'method':_0x9c28('0x69'),'uri':util[_0x9c28('0x6a')](_0x9c28('0x6b'),_0x119d71),'qs':{'module':_0x9c28('0x6c')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x41ae08},'json':!![]});}})[_0x9c28('0x3f')](function(_0x1e6cf0){if(_0x1e6cf0){if(_0x1e6cf0[_0x9c28('0x6d')]&&_0x1e6cf0['response'][_0x9c28('0x6e')]){throw new Error(_0x1e6cf0['response'][_0x9c28('0x6e')][_0x9c28('0x6f')]);}var _0x285bcb=[];var _0x4286d4=[];var _0x1cbf33=[_0x9c28('0x70'),_0x9c28('0x71'),'Description',_0x9c28('0x72'),'Call_Duration',_0x9c28('0x73'),_0x9c28('0x74'),_0x9c28('0x75')];_0x4286d4=_['remove'](_0x1e6cf0['fields'],function(_0x2de6b4){return _0x1cbf33[_0x9c28('0x76')](_0x2de6b4[_0x9c28('0x77')]);});for(var _0x53a0cf=0x0;_0x53a0cf<_0x4286d4[_0x9c28('0x33')];_0x53a0cf++){if(_0x4286d4[_0x53a0cf][_0x9c28('0x78')]===![]){_0x285bcb[_0x9c28('0x79')]({'id':_0x4286d4[_0x53a0cf]['id'],'name':_0x4286d4[_0x53a0cf][_0x9c28('0x7a')],'custom':_0x4286d4[_0x53a0cf][_0x9c28('0x7b')],'options':_0x4286d4[_0x53a0cf]['data_type']===_0x9c28('0x7c')&&_0x4286d4[_0x53a0cf]['pick_list_values'][_0x9c28('0x33')]>-0x1?_[_0x9c28('0x27')](_0x4286d4[_0x53a0cf][_0x9c28('0x7d')],function(_0x2d4ff7){return{'name':_0x2d4ff7,'value':_0x2d4ff7};}):[]});}}return{'count':_0x285bcb[_0x9c28('0x33')],'rows':_0x285bcb};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0xc6f19c,null))[_0x9c28('0x43')](function(_0x1f2d78){var _0x43aa17=_0x5ee55d[_0x9c28('0x30')]['test']?0x1f4:_0x1f2d78['statusCode']||0x1f4;logger[_0x9c28('0x6e')](_0x9c28('0x7e'),'getFields',_0x43aa17,JSON[_0x9c28('0x7f')](_0x1f2d78));delete _0x1f2d78[_0x9c28('0x24')];if(_0x43aa17===0x191){_0x43aa17=0x190;}_0xc6f19c[_0x9c28('0x18')](_0x43aa17)[_0x9c28('0x25')](_0x5ee55d[_0x9c28('0x30')][_0x9c28('0x80')]?{'message':'Wrong\x20credentials','statusCode':_0x1f2d78['statusCode']}:_0x1f2d78);});}; \ No newline at end of file +var _0xc23f=['../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','send','ZohoAccount','rawAttributes','model','name','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','map','type','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','include','find','create','body','ZohoConfiguration','order','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','serverUrl','code','refreshToken','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','system_mandatory','push','data_type','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xc23f,0x175));var _0xfc23=function(_0x4e7619,_0x2c522c){_0x4e7619=_0x4e7619-0x0;var _0x2e8a2f=_0xc23f[_0x4e7619];return _0x2e8a2f;};'use strict';var emlformat=require(_0xfc23('0x0'));var rimraf=require(_0xfc23('0x1'));var zipdir=require(_0xfc23('0x2'));var jsonpatch=require(_0xfc23('0x3'));var rp=require(_0xfc23('0x4'));var moment=require(_0xfc23('0x5'));var BPromise=require(_0xfc23('0x6'));var Mustache=require(_0xfc23('0x7'));var util=require(_0xfc23('0x8'));var path=require('path');var sox=require(_0xfc23('0x9'));var csv=require(_0xfc23('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfc23('0xb'));var squel=require('squel');var crypto=require(_0xfc23('0xc'));var jsforce=require(_0xfc23('0xd'));var deskjs=require(_0xfc23('0xe'));var toCsv=require('to-csv');var querystring=require(_0xfc23('0xf'));var Papa=require(_0xfc23('0x10'));var Redis=require('ioredis');var authService=require(_0xfc23('0x11'));var qs=require(_0xfc23('0x12'));var as=require(_0xfc23('0x13'));var hardwareService=require(_0xfc23('0x14'));var logger=require(_0xfc23('0x15'))(_0xfc23('0x16'));var utils=require(_0xfc23('0x17'));var config=require(_0xfc23('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xfc23('0x19'))['db'];var integrations=require(_0xfc23('0x1a'));function respondWithStatusCode(_0x5362aa,_0x2ef1e){_0x2ef1e=_0x2ef1e||0xcc;return function(_0x3eb8ee){if(_0x3eb8ee){return _0x5362aa[_0xfc23('0x1b')](_0x2ef1e);}return _0x5362aa[_0xfc23('0x1c')](_0x2ef1e)[_0xfc23('0x1d')]();};}function respondWithResult(_0x57bb32,_0x29a3eb){_0x29a3eb=_0x29a3eb||0xc8;return function(_0x2c47d4){if(_0x2c47d4){return _0x57bb32[_0xfc23('0x1c')](_0x29a3eb)[_0xfc23('0x1e')](_0x2c47d4);}};}function respondWithFilteredResult(_0x17e95d,_0x116bef){return function(_0x14c28b){if(_0x14c28b){var _0x2f594f=typeof _0x116bef[_0xfc23('0x1f')]===_0xfc23('0x20')&&typeof _0x116bef['limit']===_0xfc23('0x20');var _0x18e428=_0x14c28b[_0xfc23('0x21')];var _0x30bea7=_0x2f594f?0x0:_0x116bef[_0xfc23('0x1f')];var _0x5c25c5=_0x2f594f?_0x14c28b[_0xfc23('0x21')]:_0x116bef[_0xfc23('0x1f')]+_0x116bef[_0xfc23('0x22')];var _0x306370;if(_0x5c25c5>=_0x18e428){_0x5c25c5=_0x18e428;_0x306370=0xc8;}else{_0x306370=0xce;}_0x17e95d[_0xfc23('0x1c')](_0x306370);return _0x17e95d[_0xfc23('0x23')](_0xfc23('0x24'),_0x30bea7+'-'+_0x5c25c5+'/'+_0x18e428)[_0xfc23('0x1e')](_0x14c28b);}return null;};}function patchUpdates(_0x423446){return function(_0x3b8efa){try{jsonpatch['apply'](_0x3b8efa,_0x423446,!![]);}catch(_0x5a0418){return BPromise[_0xfc23('0x25')](_0x5a0418);}return _0x3b8efa[_0xfc23('0x26')]();};}function saveUpdates(_0x4e8c28,_0x37413b){return function(_0x6ceac5){if(_0x6ceac5){return _0x6ceac5[_0xfc23('0x27')](_0x4e8c28)[_0xfc23('0x28')](function(_0x436a2a){return _0x436a2a;});}return null;};}function removeEntity(_0x247663,_0x4fedf0){return function(_0x1cb5bf){if(_0x1cb5bf){return _0x1cb5bf[_0xfc23('0x29')]()[_0xfc23('0x28')](function(){_0x247663[_0xfc23('0x1c')](0xcc)[_0xfc23('0x1d')]();});}};}function handleEntityNotFound(_0x4c330d,_0x38e234){return function(_0x3c9fc3){if(!_0x3c9fc3){_0x4c330d[_0xfc23('0x1b')](0x194);}return _0x3c9fc3;};}function handleError(_0x310d19,_0x119453){_0x119453=_0x119453||0x1f4;return function(_0x350ea8){logger[_0xfc23('0x2a')](_0x350ea8['stack']);if(_0x350ea8['name']){delete _0x350ea8['name'];}_0x310d19[_0xfc23('0x1c')](_0x119453)[_0xfc23('0x2b')](_0x350ea8);};}exports['index']=function(_0x3e92fe,_0x98805a){var _0x39fcfc={},_0x23baec={},_0x2ee02f={'count':0x0,'rows':[]};var _0x5c0812=_['map'](db[_0xfc23('0x2c')][_0xfc23('0x2d')],function(_0x14bf38){return{'name':_0x14bf38['fieldName'],'type':_0x14bf38['type']['key']};});_0x23baec[_0xfc23('0x2e')]=_['map'](_0x5c0812,_0xfc23('0x2f'));_0x23baec['query']=_[_0xfc23('0x30')](_0x3e92fe[_0xfc23('0x31')]);_0x23baec[_0xfc23('0x32')]=_[_0xfc23('0x33')](_0x23baec[_0xfc23('0x2e')],_0x23baec[_0xfc23('0x31')]);_0x39fcfc[_0xfc23('0x34')]=_[_0xfc23('0x33')](_0x23baec['model'],qs['fields'](_0x3e92fe[_0xfc23('0x31')][_0xfc23('0x35')]));_0x39fcfc[_0xfc23('0x34')]=_0x39fcfc[_0xfc23('0x34')][_0xfc23('0x36')]?_0x39fcfc[_0xfc23('0x34')]:_0x23baec[_0xfc23('0x2e')];if(!_0x3e92fe[_0xfc23('0x31')]['hasOwnProperty'](_0xfc23('0x37'))){_0x39fcfc[_0xfc23('0x22')]=qs['limit'](_0x3e92fe[_0xfc23('0x31')]['limit']);_0x39fcfc[_0xfc23('0x1f')]=qs[_0xfc23('0x1f')](_0x3e92fe[_0xfc23('0x31')]['offset']);}_0x39fcfc['order']=qs[_0xfc23('0x38')](_0x3e92fe['query'][_0xfc23('0x38')]);_0x39fcfc[_0xfc23('0x39')]=qs['filters'](_[_0xfc23('0x3a')](_0x3e92fe[_0xfc23('0x31')],_0x23baec['filters']),_0x5c0812);if(_0x3e92fe['query']['filter']){_0x39fcfc[_0xfc23('0x39')]=_[_0xfc23('0x3b')](_0x39fcfc[_0xfc23('0x39')],{'$or':_[_0xfc23('0x3c')](_0x5c0812,function(_0xfd026){if(_0xfd026[_0xfc23('0x3d')]!==_0xfc23('0x3e')){var _0x2c689d={};_0x2c689d[_0xfd026[_0xfc23('0x2f')]]={'$like':'%'+_0x3e92fe[_0xfc23('0x31')][_0xfc23('0x3f')]+'%'};return _0x2c689d;}})});}_0x39fcfc=_[_0xfc23('0x3b')]({},_0x39fcfc,_0x3e92fe[_0xfc23('0x40')]);var _0x16e191={'where':_0x39fcfc['where']};return db[_0xfc23('0x2c')][_0xfc23('0x21')](_0x16e191)[_0xfc23('0x28')](function(_0x28d6ae){_0x2ee02f['count']=_0x28d6ae;if(_0x3e92fe['query'][_0xfc23('0x41')]){_0x39fcfc['include']=[{'all':!![]}];}return db['ZohoAccount'][_0xfc23('0x42')](_0x39fcfc);})[_0xfc23('0x28')](function(_0x5bc4d5){_0x2ee02f['rows']=_0x5bc4d5;return _0x2ee02f;})[_0xfc23('0x28')](respondWithFilteredResult(_0x98805a,_0x39fcfc))[_0xfc23('0x43')](handleError(_0x98805a,null));};exports[_0xfc23('0x44')]=function(_0x4cce39,_0x802c44){var _0x32f1be={'raw':![],'where':{'id':_0x4cce39[_0xfc23('0x45')]['id']}},_0x4127d4={};_0x4127d4['model']=_[_0xfc23('0x30')](db['ZohoAccount'][_0xfc23('0x2d')]);_0x4127d4[_0xfc23('0x31')]=_['keys'](_0x4cce39['query']);_0x4127d4[_0xfc23('0x32')]=_[_0xfc23('0x33')](_0x4127d4[_0xfc23('0x2e')],_0x4127d4[_0xfc23('0x31')]);_0x32f1be['attributes']=_[_0xfc23('0x33')](_0x4127d4[_0xfc23('0x2e')],qs[_0xfc23('0x35')](_0x4cce39[_0xfc23('0x31')][_0xfc23('0x35')]));_0x32f1be[_0xfc23('0x34')]=_0x32f1be[_0xfc23('0x34')][_0xfc23('0x36')]?_0x32f1be[_0xfc23('0x34')]:_0x4127d4['model'];if(_0x4cce39[_0xfc23('0x31')][_0xfc23('0x41')]){_0x32f1be[_0xfc23('0x46')]=[{'all':!![]}];}_0x32f1be=_[_0xfc23('0x3b')]({},_0x32f1be,_0x4cce39['options']);return db['ZohoAccount'][_0xfc23('0x47')](_0x32f1be)[_0xfc23('0x28')](handleEntityNotFound(_0x802c44,null))[_0xfc23('0x28')](respondWithResult(_0x802c44,null))['catch'](handleError(_0x802c44,null));};exports[_0xfc23('0x48')]=function(_0x2ded54,_0x48ebe3){return db[_0xfc23('0x2c')][_0xfc23('0x48')](_0x2ded54[_0xfc23('0x49')],{})[_0xfc23('0x28')](respondWithResult(_0x48ebe3,0xc9))[_0xfc23('0x43')](handleError(_0x48ebe3,null));};exports['update']=function(_0x5539f1,_0x503b18){if(_0x5539f1[_0xfc23('0x49')]['id']){delete _0x5539f1[_0xfc23('0x49')]['id'];}return db[_0xfc23('0x2c')]['find']({'where':{'id':_0x5539f1['params']['id']}})['then'](handleEntityNotFound(_0x503b18,null))[_0xfc23('0x28')](saveUpdates(_0x5539f1[_0xfc23('0x49')],null))[_0xfc23('0x28')](respondWithResult(_0x503b18,null))[_0xfc23('0x43')](handleError(_0x503b18,null));};exports[_0xfc23('0x29')]=function(_0x430d32,_0x2f99b5){return db[_0xfc23('0x2c')][_0xfc23('0x47')]({'where':{'id':_0x430d32[_0xfc23('0x45')]['id']}})[_0xfc23('0x28')](handleEntityNotFound(_0x2f99b5,null))[_0xfc23('0x28')](removeEntity(_0x2f99b5,null))['catch'](handleError(_0x2f99b5,null));};exports['getConfigurations']=function(_0x4a78a1,_0x5a4e25,_0x539cd0){var _0x1a5753={};var _0x580c3e={};var _0x2b8e6d;var _0x4788c1;return db[_0xfc23('0x2c')]['findOne']({'where':{'id':_0x4a78a1['params']['id']}})[_0xfc23('0x28')](handleEntityNotFound(_0x5a4e25,null))[_0xfc23('0x28')](function(_0x56da9f){if(_0x56da9f){_0x2b8e6d=_0x56da9f;_0x580c3e[_0xfc23('0x2e')]=_[_0xfc23('0x30')](db[_0xfc23('0x4a')]['rawAttributes']);_0x580c3e[_0xfc23('0x31')]=_[_0xfc23('0x30')](_0x4a78a1[_0xfc23('0x31')]);_0x580c3e['filters']=_[_0xfc23('0x33')](_0x580c3e['model'],_0x580c3e[_0xfc23('0x31')]);_0x1a5753[_0xfc23('0x34')]=_[_0xfc23('0x33')](_0x580c3e['model'],qs['fields'](_0x4a78a1[_0xfc23('0x31')][_0xfc23('0x35')]));_0x1a5753['attributes']=_0x1a5753[_0xfc23('0x34')]['length']?_0x1a5753[_0xfc23('0x34')]:_0x580c3e['model'];_0x1a5753[_0xfc23('0x4b')]=qs[_0xfc23('0x38')](_0x4a78a1[_0xfc23('0x31')][_0xfc23('0x38')]);_0x1a5753[_0xfc23('0x39')]=qs[_0xfc23('0x32')](_['pick'](_0x4a78a1[_0xfc23('0x31')],_0x580c3e[_0xfc23('0x32')]));if(_0x4a78a1['query'][_0xfc23('0x3f')]){_0x1a5753['where']=_['merge'](_0x1a5753[_0xfc23('0x39')],{'$or':_[_0xfc23('0x3c')](_0x1a5753[_0xfc23('0x34')],function(_0x16389f){var _0x48ac3a={};_0x48ac3a[_0x16389f]={'$like':'%'+_0x4a78a1['query'][_0xfc23('0x3f')]+'%'};return _0x48ac3a;})});}_0x1a5753=_[_0xfc23('0x3b')]({},_0x1a5753,_0x4a78a1[_0xfc23('0x40')]);return _0x2b8e6d[_0xfc23('0x4c')](_0x1a5753);}})['then'](function(_0xa9eb28){if(_0xa9eb28){_0x4788c1=_0xa9eb28['length'];if(!_0x4a78a1[_0xfc23('0x31')]['hasOwnProperty'](_0xfc23('0x37'))){_0x1a5753[_0xfc23('0x22')]=qs[_0xfc23('0x22')](_0x4a78a1[_0xfc23('0x31')][_0xfc23('0x22')]);_0x1a5753[_0xfc23('0x1f')]=qs[_0xfc23('0x1f')](_0x4a78a1['query'][_0xfc23('0x1f')]);}return _0x2b8e6d[_0xfc23('0x4c')](_0x1a5753);}})[_0xfc23('0x28')](function(_0xb0a81){if(_0xb0a81){return _0xb0a81?{'count':_0x4788c1,'rows':_0xb0a81}:null;}})[_0xfc23('0x28')](respondWithResult(_0x5a4e25,null))[_0xfc23('0x43')](handleError(_0x5a4e25,null));};exports[_0xfc23('0x4d')]=function(_0x25807a,_0x4b8586,_0x10be47){if(_0x25807a[_0xfc23('0x49')]['id']){delete _0x25807a[_0xfc23('0x49')]['id'];}return db['ZohoAccount'][_0xfc23('0x4e')]({'where':{'id':_0x25807a[_0xfc23('0x45')]['id']}})[_0xfc23('0x28')](handleEntityNotFound(_0x4b8586,null))[_0xfc23('0x28')](function(_0x2b762d){if(_0x2b762d){_0x25807a[_0xfc23('0x49')][_0xfc23('0x4f')]=_0x2b762d['id'];_0x25807a['body'][_0xfc23('0x50')]=integrations[_0xfc23('0x51')](_0x25807a[_0xfc23('0x49')][_0xfc23('0x52')],_0x25807a[_0xfc23('0x49')]['type']);_0x25807a[_0xfc23('0x49')][_0xfc23('0x53')]=integrations['getDescriptions'](_0x25807a[_0xfc23('0x49')][_0xfc23('0x52')],_0x25807a[_0xfc23('0x49')][_0xfc23('0x3d')]);return db[_0xfc23('0x4a')][_0xfc23('0x48')](_0x25807a[_0xfc23('0x49')],{'include':[{'model':db[_0xfc23('0x54')],'as':'Subjects'},{'model':db[_0xfc23('0x54')],'as':'Descriptions'}]});}return null;})[_0xfc23('0x28')](respondWithResult(_0x4b8586,null))[_0xfc23('0x43')](handleError(_0x4b8586,null));};function getAccessToken(_0x32d4d4){return new Promise(function(_0x4eee9d,_0x441cd6){var _0x55778b;switch(_0x32d4d4['zone']){case'US':_0x55778b=_0xfc23('0x55');break;case'AU':_0x55778b=_0xfc23('0x56');break;case'EU':_0x55778b=_0xfc23('0x57');break;case'IN':_0x55778b=_0xfc23('0x58');break;case'CN':_0x55778b=_0xfc23('0x59');break;default:_0x55778b=_0xfc23('0x57');break;}var _0x59c90d={'method':_0xfc23('0x5a'),'uri':_0x55778b+'/oauth/v2/token','qs':{'refresh_token':_0x32d4d4['refreshToken'],'client_id':_0x32d4d4[_0xfc23('0x5b')],'client_secret':_0x32d4d4[_0xfc23('0x5c')],'grant_type':_0xfc23('0x5d')},'json':!![]};return rp(_0x59c90d)['then'](function(_0x4409e5){if(_0x4409e5['access_token']){_0x4eee9d(_0x4409e5[_0xfc23('0x5e')]);}else{_0x441cd6(_0xfc23('0x5f'));}})['catch'](function(_0x16f635){_0x441cd6(_0x16f635);});});}exports[_0xfc23('0x60')]=function(_0x4f554a,_0x241fdf,_0x54e3c4){var _0x3d09e5,_0xbd9b22,_0x40c34b,_0xccf7d2,_0x160d62;return db[_0xfc23('0x2c')][_0xfc23('0x4e')]({'where':{'id':_0x4f554a['params']['id']},'attributes':['id',_0xfc23('0x61'),_0xfc23('0x62'),_0xfc23('0x5b'),_0xfc23('0x5c'),_0xfc23('0x63'),_0xfc23('0x64'),_0xfc23('0x65')]})[_0xfc23('0x28')](handleEntityNotFound(_0x241fdf,null))[_0xfc23('0x28')](function(_0x1114ec){_0x160d62=_0x1114ec;_0x3d09e5=_0x160d62[_0xfc23('0x61')];_0xbd9b22=_0x3d09e5===_0xfc23('0x66')?'eu':_0xfc23('0x67');_0x40c34b=_0x160d62[_0xfc23('0x63')];var _0x72293d=_0x40c34b[_0xfc23('0x68')](-0x1);if(_0x72293d==='/'||_0x72293d==='\x5c'||_0x72293d===':'){_0x40c34b=_0x40c34b[_0xfc23('0x69')](0x0,_0x40c34b[_0xfc23('0x6a')](_0x72293d));}if(!_0x160d62[_0xfc23('0x65')]){throw new Error(_0xfc23('0x6b'));}return getAccessToken(_0x160d62);})[_0xfc23('0x28')](function(_0x4acd37){if(_0x4acd37){return rp({'method':_0xfc23('0x6c'),'uri':util[_0xfc23('0x6d')](_0xfc23('0x6e'),_0xbd9b22),'qs':{'module':_0xfc23('0x6f')},'headers':{'Authorization':_0xfc23('0x70')+_0x4acd37},'json':!![]});}})['then'](function(_0x5b4dfd){if(_0x5b4dfd){if(_0x5b4dfd[_0xfc23('0x71')]&&_0x5b4dfd[_0xfc23('0x71')][_0xfc23('0x2a')]){throw new Error(_0x5b4dfd[_0xfc23('0x71')][_0xfc23('0x2a')]['message']);}var _0xe01958=[];var _0x1adfd7=[];var _0x3ce322=[_0xfc23('0x72'),_0xfc23('0x73'),_0xfc23('0x74'),_0xfc23('0x75'),_0xfc23('0x76'),_0xfc23('0x77'),_0xfc23('0x78'),_0xfc23('0x79')];_0x1adfd7=_[_0xfc23('0x7a')](_0x5b4dfd[_0xfc23('0x35')],function(_0x5475ee){return _0x3ce322[_0xfc23('0x7b')](_0x5475ee['api_name']);});for(var _0x48d813=0x0;_0x48d813<_0x1adfd7[_0xfc23('0x36')];_0x48d813++){if(_0x1adfd7[_0x48d813][_0xfc23('0x7c')]===![]){_0xe01958[_0xfc23('0x7d')]({'id':_0x1adfd7[_0x48d813]['id'],'name':_0x1adfd7[_0x48d813]['display_label'],'custom':_0x1adfd7[_0x48d813]['custom_field'],'options':_0x1adfd7[_0x48d813][_0xfc23('0x7e')]==='picklist'&&_0x1adfd7[_0x48d813][_0xfc23('0x7f')][_0xfc23('0x36')]>-0x1?_[_0xfc23('0x3c')](_0x1adfd7[_0x48d813]['pick_list_values'],function(_0x1fc619){return{'name':_0x1fc619,'value':_0x1fc619};}):[]});}}return{'count':_0xe01958['length'],'rows':_0xe01958};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x241fdf,null))[_0xfc23('0x43')](function(_0xfb415a){var _0x1cbc31=_0x4f554a[_0xfc23('0x31')]['test']?0x1f4:_0xfb415a[_0xfc23('0x80')]||0x1f4;logger[_0xfc23('0x2a')](_0xfc23('0x81'),_0xfc23('0x60'),_0x1cbc31,JSON[_0xfc23('0x82')](_0xfb415a));delete _0xfb415a[_0xfc23('0x2f')];if(_0x1cbc31===0x191){_0x1cbc31=0x190;}_0x241fdf[_0xfc23('0x1c')](_0x1cbc31)['send'](_0x4f554a[_0xfc23('0x31')][_0xfc23('0x83')]?{'message':_0xfc23('0x84'),'statusCode':_0xfb415a[_0xfc23('0x80')]}:_0xfb415a);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 79afc60..e6df0f5 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 _0x0a39=['lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','code','https://accounts.zoho.in','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','clientId','clientSecret','host','serverUrl','slice','substring'];(function(_0x258b88,_0x1cf90d){var _0x2c843f=function(_0x5cb803){while(--_0x5cb803){_0x258b88['push'](_0x258b88['shift']());}};_0x2c843f(++_0x1cf90d);}(_0x0a39,0x176));var _0x90a3=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x0a39[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x90a3('0x0'));var util=require('util');var logger=require(_0x90a3('0x1'))(_0x90a3('0x2'));var moment=require('moment');var BPromise=require(_0x90a3('0x3'));var rp=require(_0x90a3('0x4'));var fs=require('fs');var path=require(_0x90a3('0x5'));var rimraf=require(_0x90a3('0x6'));var config=require(_0x90a3('0x7'));var attributes=require(_0x90a3('0x8'));var integrations=require(_0x90a3('0x9'));module[_0x90a3('0xa')]=function(_0x40d5a0,_0x111d57){return _0x40d5a0[_0x90a3('0xb')](_0x90a3('0xc'),attributes,{'tableName':_0x90a3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x546581,_0x14666e,_0x394a83){if(_0x546581[_0x90a3('0xe')](_0x90a3('0xf'))||_0x546581[_0x90a3('0xe')]('serverUrl')||_0x546581['changed'](_0x90a3('0x10'))||_0x546581[_0x90a3('0xe')](_0x90a3('0x11'))||_0x546581['changed']('code')||_0x546581[_0x90a3('0xe')](_0x90a3('0x12'))){var _0x341697,_0x34e9f9;_0x341697=_0x546581[_0x90a3('0x13')];var _0x3457c1=_0x341697[_0x90a3('0x14')](-0x1);if(_0x3457c1==='/'||_0x3457c1==='\x5c'||_0x3457c1===':'){_0x341697=_0x341697[_0x90a3('0x15')](0x0,_0x341697[_0x90a3('0x16')](_0x3457c1));}switch(_0x546581[_0x90a3('0xf')]){case'US':_0x34e9f9=_0x90a3('0x17');break;case'AU':_0x34e9f9=_0x90a3('0x18');break;case'IN':_0x34e9f9='https://accounts.zoho.in';break;case'CN':_0x34e9f9=_0x90a3('0x19');break;default:_0x34e9f9=_0x90a3('0x1a');break;}var _0x29f56a={'method':_0x90a3('0x1b'),'uri':_0x34e9f9+_0x90a3('0x1c'),'form':{'grant_type':_0x90a3('0x1d'),'client_id':_0x546581['clientId'],'client_secret':_0x546581['clientSecret'],'redirect_uri':_0x546581['serverUrl'],'code':_0x546581['code']},'headers':{'Content-Type':_0x90a3('0x1e')}};return rp(_0x29f56a)[_0x90a3('0x1f')](function(_0x3d2504){var _0x1220e4=JSON[_0x90a3('0x20')](_0x3d2504);if(_0x1220e4[_0x90a3('0x21')]){_0x546581[_0x90a3('0x22')]=_0x1220e4[_0x90a3('0x21')];logger[_0x90a3('0x23')](util[_0x90a3('0x24')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x546581[_0x90a3('0x25')],_0x546581['id']));}else{logger[_0x90a3('0x26')](util['format'](_0x90a3('0x27'),_0x546581[_0x90a3('0x25')],_0x546581['id']),util['inspect'](_0x1220e4,{'showHidden':![],'depth':null}));}return _0x394a83(null,_0x14666e);})['catch'](function(_0x202b88){logger[_0x90a3('0x26')](util[_0x90a3('0x24')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x546581[_0x90a3('0x25')],_0x546581['id']),util[_0x90a3('0x28')](parsedResult,{'showHidden':![],'depth':null}));return _0x394a83(_0x202b88);});}else{return _0x394a83(null,_0x14666e);}},'beforeUpdate':function(_0x45315a,_0x39fe52,_0x5629c2){if(_0x45315a['changed']('zone')||_0x45315a[_0x90a3('0xe')](_0x90a3('0x13'))||_0x45315a['changed']('clientId')||_0x45315a['changed'](_0x90a3('0x11'))||_0x45315a['changed'](_0x90a3('0x29'))||_0x45315a['changed']('host')){var _0x587f5f,_0x3238ce;_0x587f5f=_0x45315a[_0x90a3('0x13')];var _0x521391=_0x587f5f['slice'](-0x1);if(_0x521391==='/'||_0x521391==='\x5c'||_0x521391===':'){_0x587f5f=_0x587f5f[_0x90a3('0x15')](0x0,_0x587f5f['lastIndexOf'](_0x521391));}switch(_0x45315a[_0x90a3('0xf')]){case'US':_0x3238ce='https://accounts.zoho.com';break;case'AU':_0x3238ce=_0x90a3('0x18');break;case'IN':_0x3238ce=_0x90a3('0x2a');break;case'CN':_0x3238ce='https://accounts.zoho.com.cn';break;default:_0x3238ce=_0x90a3('0x1a');break;}var _0x215564={'method':_0x90a3('0x1b'),'uri':_0x3238ce+_0x90a3('0x1c'),'form':{'grant_type':_0x90a3('0x1d'),'client_id':_0x45315a['clientId'],'client_secret':_0x45315a[_0x90a3('0x11')],'redirect_uri':_0x45315a[_0x90a3('0x13')],'code':_0x45315a['code']},'headers':{'Content-Type':_0x90a3('0x1e')}};return rp(_0x215564)[_0x90a3('0x1f')](function(_0x53cd05){var _0x3a5325=JSON[_0x90a3('0x20')](_0x53cd05);if(_0x3a5325[_0x90a3('0x21')]){_0x45315a[_0x90a3('0x22')]=_0x3a5325[_0x90a3('0x21')];logger[_0x90a3('0x23')](util[_0x90a3('0x24')](_0x90a3('0x2b'),_0x45315a[_0x90a3('0x25')],_0x45315a['id']));}else{logger['error'](util[_0x90a3('0x24')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x45315a[_0x90a3('0x25')],_0x45315a['id']),util[_0x90a3('0x28')](_0x3a5325,{'showHidden':![],'depth':null}));}return _0x5629c2(null,_0x39fe52);})['catch'](function(_0x6e7ba){logger[_0x90a3('0x26')](util['format'](_0x90a3('0x27'),_0x45315a[_0x90a3('0x25')],_0x45315a['id']),util[_0x90a3('0x28')](parsedResult,{'showHidden':![],'depth':null}));return _0x5629c2(_0x6e7ba);});}else{return _0x5629c2(null,_0x39fe52);}}}});}; \ No newline at end of file +var _0x17dc=['ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientSecret','host','slice','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','clientId','code','application/x-www-form-urlencoded','then','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','https://accounts.zoho.com','authorization_code','parse','refresh_token','refreshToken','lodash','util','api','moment','bluebird','path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x18ab96,_0x30495a){var _0x55c0e4=function(_0x288943){while(--_0x288943){_0x18ab96['push'](_0x18ab96['shift']());}};_0x55c0e4(++_0x30495a);}(_0x17dc,0x79));var _0xc17d=function(_0x5874d1,_0x5a1195){_0x5874d1=_0x5874d1-0x0;var _0x1222c5=_0x17dc[_0x5874d1];return _0x1222c5;};'use strict';var _=require(_0xc17d('0x0'));var util=require(_0xc17d('0x1'));var logger=require('../../config/logger')(_0xc17d('0x2'));var moment=require(_0xc17d('0x3'));var BPromise=require(_0xc17d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc17d('0x5'));var rimraf=require(_0xc17d('0x6'));var config=require('../../config/environment');var attributes=require(_0xc17d('0x7'));var integrations=require(_0xc17d('0x8'));module[_0xc17d('0x9')]=function(_0x391e5d,_0x5d6545){return _0x391e5d[_0xc17d('0xa')](_0xc17d('0xb'),attributes,{'tableName':_0xc17d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x6ebb47,_0x44a7ff,_0x1cf244){if(_0x6ebb47[_0xc17d('0xd')](_0xc17d('0xe'))||_0x6ebb47[_0xc17d('0xd')](_0xc17d('0xf'))||_0x6ebb47[_0xc17d('0xd')]('clientId')||_0x6ebb47[_0xc17d('0xd')](_0xc17d('0x10'))||_0x6ebb47['changed']('code')||_0x6ebb47['changed'](_0xc17d('0x11'))){var _0x35afb8,_0x286556;_0x35afb8=_0x6ebb47[_0xc17d('0xf')];var _0x19f967=_0x35afb8[_0xc17d('0x12')](-0x1);if(_0x19f967==='/'||_0x19f967==='\x5c'||_0x19f967===':'){_0x35afb8=_0x35afb8[_0xc17d('0x13')](0x0,_0x35afb8[_0xc17d('0x14')](_0x19f967));}switch(_0x6ebb47[_0xc17d('0xe')]){case'US':_0x286556='https://accounts.zoho.com';break;case'AU':_0x286556=_0xc17d('0x15');break;case'IN':_0x286556=_0xc17d('0x16');break;case'CN':_0x286556=_0xc17d('0x17');break;default:_0x286556=_0xc17d('0x18');break;}var _0x38d4ea={'method':_0xc17d('0x19'),'uri':_0x286556+_0xc17d('0x1a'),'form':{'grant_type':'authorization_code','client_id':_0x6ebb47[_0xc17d('0x1b')],'client_secret':_0x6ebb47[_0xc17d('0x10')],'redirect_uri':_0x6ebb47[_0xc17d('0xf')],'code':_0x6ebb47[_0xc17d('0x1c')]},'headers':{'Content-Type':_0xc17d('0x1d')}};return rp(_0x38d4ea)[_0xc17d('0x1e')](function(_0x592fea){var _0x55f221=JSON['parse'](_0x592fea);if(_0x55f221['refresh_token']){_0x6ebb47['refreshToken']=_0x55f221['refresh_token'];logger[_0xc17d('0x1f')](util[_0xc17d('0x20')](_0xc17d('0x21'),_0x6ebb47[_0xc17d('0x22')],_0x6ebb47['id']));}else{logger[_0xc17d('0x23')](util[_0xc17d('0x20')](_0xc17d('0x24'),_0x6ebb47[_0xc17d('0x22')],_0x6ebb47['id']),util[_0xc17d('0x25')](_0x55f221,{'showHidden':![],'depth':null}));}return _0x1cf244(null,_0x44a7ff);})[_0xc17d('0x26')](function(_0x4e85df){logger[_0xc17d('0x23')](util[_0xc17d('0x20')](_0xc17d('0x24'),_0x6ebb47[_0xc17d('0x22')],_0x6ebb47['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x1cf244(_0x4e85df);});}else{return _0x1cf244(null,_0x44a7ff);}},'beforeUpdate':function(_0x3825f7,_0x3bbb10,_0x243134){if(_0x3825f7[_0xc17d('0xd')](_0xc17d('0xe'))||_0x3825f7['changed'](_0xc17d('0xf'))||_0x3825f7[_0xc17d('0xd')](_0xc17d('0x1b'))||_0x3825f7[_0xc17d('0xd')](_0xc17d('0x10'))||_0x3825f7[_0xc17d('0xd')](_0xc17d('0x1c'))||_0x3825f7[_0xc17d('0xd')]('host')){var _0x157145,_0x1be781;_0x157145=_0x3825f7[_0xc17d('0xf')];var _0x7b1d71=_0x157145[_0xc17d('0x12')](-0x1);if(_0x7b1d71==='/'||_0x7b1d71==='\x5c'||_0x7b1d71===':'){_0x157145=_0x157145['substring'](0x0,_0x157145[_0xc17d('0x14')](_0x7b1d71));}switch(_0x3825f7[_0xc17d('0xe')]){case'US':_0x1be781=_0xc17d('0x27');break;case'AU':_0x1be781='https://accounts.zoho.com.au';break;case'IN':_0x1be781=_0xc17d('0x16');break;case'CN':_0x1be781='https://accounts.zoho.com.cn';break;default:_0x1be781=_0xc17d('0x18');break;}var _0x1f57c1={'method':'POST','uri':_0x1be781+_0xc17d('0x1a'),'form':{'grant_type':_0xc17d('0x28'),'client_id':_0x3825f7['clientId'],'client_secret':_0x3825f7[_0xc17d('0x10')],'redirect_uri':_0x3825f7[_0xc17d('0xf')],'code':_0x3825f7[_0xc17d('0x1c')]},'headers':{'Content-Type':_0xc17d('0x1d')}};return rp(_0x1f57c1)[_0xc17d('0x1e')](function(_0x584bb3){var _0x458dda=JSON[_0xc17d('0x29')](_0x584bb3);if(_0x458dda[_0xc17d('0x2a')]){_0x3825f7[_0xc17d('0x2b')]=_0x458dda[_0xc17d('0x2a')];logger[_0xc17d('0x1f')](util[_0xc17d('0x20')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3825f7['name'],_0x3825f7['id']));}else{logger[_0xc17d('0x23')](util[_0xc17d('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3825f7[_0xc17d('0x22')],_0x3825f7['id']),util[_0xc17d('0x25')](_0x458dda,{'showHidden':![],'depth':null}));}return _0x243134(null,_0x3bbb10);})[_0xc17d('0x26')](function(_0x37ef18){logger[_0xc17d('0x23')](util['format'](_0xc17d('0x24'),_0x3825f7[_0xc17d('0x22')],_0x3825f7['id']),util[_0xc17d('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x243134(_0x37ef18);});}else{return _0x243134(null,_0x3bbb10);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index b2ce472..25f4dd8 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 _0x6f83=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ZohoAccount','findAll','options','raw','where','attributes','limit','map','include','model','then','GetZohoAccount','ShowZohoAccount','find'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0x6f83,0x72));var _0x36f8=function(_0x3950f4,_0x3d05b5){_0x3950f4=_0x3950f4-0x0;var _0x2f46e2=_0x6f83[_0x3950f4];return _0x2f46e2;};'use strict';var _=require('lodash');var util=require(_0x36f8('0x0'));var moment=require(_0x36f8('0x1'));var BPromise=require('bluebird');var rs=require(_0x36f8('0x2'));var fs=require('fs');var Redis=require(_0x36f8('0x3'));var db=require(_0x36f8('0x4'))['db'];var utils=require(_0x36f8('0x5'));var logger=require(_0x36f8('0x6'))(_0x36f8('0x7'));var config=require(_0x36f8('0x8'));var jayson=require(_0x36f8('0x9'));var client=jayson[_0x36f8('0xa')][_0x36f8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27d94b,_0x2c0367,_0x370a97){return new BPromise(function(_0x3fe644,_0x22b992){return client[_0x36f8('0xc')](_0x27d94b,_0x370a97)['then'](function(_0x48c7b2){logger['info'](_0x36f8('0xd'),_0x2c0367,_0x36f8('0xe'));logger[_0x36f8('0xf')](_0x36f8('0x10'),_0x2c0367,_0x36f8('0xe'),JSON[_0x36f8('0x11')](_0x48c7b2));if(_0x48c7b2[_0x36f8('0x12')]){if(_0x48c7b2[_0x36f8('0x12')][_0x36f8('0x13')]===0x1f4){logger['error'](_0x36f8('0xd'),_0x2c0367,_0x48c7b2[_0x36f8('0x12')][_0x36f8('0x14')]);return _0x22b992(_0x48c7b2[_0x36f8('0x12')]['message']);}logger[_0x36f8('0x12')](_0x36f8('0xd'),_0x2c0367,_0x48c7b2[_0x36f8('0x12')]['message']);return _0x3fe644(_0x48c7b2[_0x36f8('0x12')][_0x36f8('0x14')]);}else{logger[_0x36f8('0x15')]('ZohoAccount,\x20%s,\x20%s',_0x2c0367,_0x36f8('0xe'));_0x3fe644(_0x48c7b2[_0x36f8('0x16')][_0x36f8('0x14')]);}})[_0x36f8('0x17')](function(_0x5ec545){logger['error'](_0x36f8('0xd'),_0x2c0367,_0x5ec545);_0x22b992(_0x5ec545);});});}exports['GetZohoAccount']=function(_0x517cba){var _0x3db780=this;return new Promise(function(_0x3d6a3c,_0x4dcce6){return db[_0x36f8('0x18')][_0x36f8('0x19')]({'raw':_0x517cba[_0x36f8('0x1a')]?_0x517cba[_0x36f8('0x1a')][_0x36f8('0x1b')]===undefined?!![]:![]:!![],'where':_0x517cba[_0x36f8('0x1a')]?_0x517cba[_0x36f8('0x1a')][_0x36f8('0x1c')]||null:null,'attributes':_0x517cba[_0x36f8('0x1a')]?_0x517cba[_0x36f8('0x1a')][_0x36f8('0x1d')]||null:null,'limit':_0x517cba[_0x36f8('0x1a')]?_0x517cba['options'][_0x36f8('0x1e')]||null:null,'include':_0x517cba[_0x36f8('0x1a')]?_0x517cba[_0x36f8('0x1a')]['include']?_[_0x36f8('0x1f')](_0x517cba['options'][_0x36f8('0x20')],function(_0x206075){return{'model':db[_0x206075['model']],'as':_0x206075['as'],'attributes':_0x206075[_0x36f8('0x1d')],'include':_0x206075['include']?_[_0x36f8('0x1f')](_0x206075[_0x36f8('0x20')],function(_0xb2acc5){return{'model':db[_0xb2acc5[_0x36f8('0x21')]],'as':_0xb2acc5['as'],'attributes':_0xb2acc5[_0x36f8('0x1d')],'include':_0xb2acc5[_0x36f8('0x20')]?_['map'](_0xb2acc5[_0x36f8('0x20')],function(_0xb2bbfd){return{'model':db[_0xb2bbfd[_0x36f8('0x21')]],'as':_0xb2bbfd['as'],'attributes':_0xb2bbfd[_0x36f8('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x36f8('0x22')](function(_0x1a4fed){logger[_0x36f8('0x15')](_0x36f8('0x23'),_0x517cba);logger[_0x36f8('0xf')]('GetZohoAccount',_0x517cba,JSON[_0x36f8('0x11')](_0x1a4fed));_0x3d6a3c(_0x1a4fed);})[_0x36f8('0x17')](function(_0x3f01a6){logger[_0x36f8('0x12')](_0x36f8('0x23'),_0x3f01a6[_0x36f8('0x14')],_0x517cba);_0x4dcce6(_0x3db780['error'](0x1f4,_0x3f01a6[_0x36f8('0x14')]));});});};exports[_0x36f8('0x24')]=function(_0x151803){var _0x208d06=this;return new Promise(function(_0x23ddfb,_0x22a673){return db[_0x36f8('0x18')][_0x36f8('0x25')]({'raw':_0x151803[_0x36f8('0x1a')]?_0x151803[_0x36f8('0x1a')][_0x36f8('0x1b')]===undefined?!![]:![]:!![],'where':_0x151803['options']?_0x151803['options']['where']||null:null,'attributes':_0x151803[_0x36f8('0x1a')]?_0x151803[_0x36f8('0x1a')][_0x36f8('0x1d')]||null:null,'include':_0x151803['options']?_0x151803[_0x36f8('0x1a')][_0x36f8('0x20')]?_[_0x36f8('0x1f')](_0x151803[_0x36f8('0x1a')][_0x36f8('0x20')],function(_0x120ef0){return{'model':db[_0x120ef0[_0x36f8('0x21')]],'as':_0x120ef0['as'],'attributes':_0x120ef0[_0x36f8('0x1d')],'include':_0x120ef0[_0x36f8('0x20')]?_[_0x36f8('0x1f')](_0x120ef0['include'],function(_0x95d533){return{'model':db[_0x95d533[_0x36f8('0x21')]],'as':_0x95d533['as'],'attributes':_0x95d533[_0x36f8('0x1d')],'include':_0x95d533[_0x36f8('0x20')]?_[_0x36f8('0x1f')](_0x95d533['include'],function(_0x194b74){return{'model':db[_0x194b74[_0x36f8('0x21')]],'as':_0x194b74['as'],'attributes':_0x194b74[_0x36f8('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd332ed){logger[_0x36f8('0x15')](_0x36f8('0x24'),_0x151803);logger[_0x36f8('0xf')]('ShowZohoAccount',_0x151803,JSON['stringify'](_0xd332ed));_0x23ddfb(_0xd332ed);})[_0x36f8('0x17')](function(_0x1e7132){logger[_0x36f8('0x12')](_0x36f8('0x24'),_0x1e7132[_0x36f8('0x14')],_0x151803);_0x22a673(_0x208d06[_0x36f8('0x12')](0x1f4,_0x1e7132[_0x36f8('0x14')]));});});}; \ No newline at end of file +var _0x9f0e=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','limit','include','map','model','attributes','ShowZohoAccount','find','where','lodash','util'];(function(_0x598ffd,_0x414e5d){var _0x226328=function(_0xf722a8){while(--_0xf722a8){_0x598ffd['push'](_0x598ffd['shift']());}};_0x226328(++_0x414e5d);}(_0x9f0e,0x116));var _0xe9f0=function(_0x32ab95,_0x45dd93){_0x32ab95=_0x32ab95-0x0;var _0x4830be=_0x9f0e[_0x32ab95];return _0x4830be;};'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')]('ZohoAccount,\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')]({'raw':_0x2ab12b['options']?_0x2ab12b[_0xe9f0('0x19')][_0xe9f0('0x1a')]===undefined?!![]:![]:!![],'where':_0x2ab12b[_0xe9f0('0x19')]?_0x2ab12b[_0xe9f0('0x19')]['where']||null:null,'attributes':_0x2ab12b[_0xe9f0('0x19')]?_0x2ab12b[_0xe9f0('0x19')]['attributes']||null:null,'limit':_0x2ab12b['options']?_0x2ab12b['options'][_0xe9f0('0x1b')]||null:null,'include':_0x2ab12b[_0xe9f0('0x19')]?_0x2ab12b[_0xe9f0('0x19')][_0xe9f0('0x1c')]?_[_0xe9f0('0x1d')](_0x2ab12b['options'][_0xe9f0('0x1c')],function(_0x38b7ee){return{'model':db[_0x38b7ee[_0xe9f0('0x1e')]],'as':_0x38b7ee['as'],'attributes':_0x38b7ee[_0xe9f0('0x1f')],'include':_0x38b7ee[_0xe9f0('0x1c')]?_[_0xe9f0('0x1d')](_0x38b7ee[_0xe9f0('0x1c')],function(_0x1321bb){return{'model':db[_0x1321bb[_0xe9f0('0x1e')]],'as':_0x1321bb['as'],'attributes':_0x1321bb[_0xe9f0('0x1f')],'include':_0x1321bb['include']?_[_0xe9f0('0x1d')](_0x1321bb[_0xe9f0('0x1c')],function(_0x2ddfba){return{'model':db[_0x2ddfba[_0xe9f0('0x1e')]],'as':_0x2ddfba['as'],'attributes':_0x2ddfba['attributes']};}):[]};}):[]};}):[]:[]})[_0xe9f0('0xb')](function(_0x2613fd){logger[_0xe9f0('0xc')](_0xe9f0('0x16'),_0x2ab12b);logger[_0xe9f0('0xf')]('GetZohoAccount',_0x2ab12b,JSON[_0xe9f0('0x11')](_0x2613fd));_0x59bf5a(_0x2613fd);})[_0xe9f0('0x15')](function(_0x44fb5b){logger[_0xe9f0('0x12')](_0xe9f0('0x16'),_0x44fb5b[_0xe9f0('0x13')],_0x2ab12b);_0x15a33b(_0x3da237[_0xe9f0('0x12')](0x1f4,_0x44fb5b[_0xe9f0('0x13')]));});});};exports[_0xe9f0('0x20')]=function(_0x3dbe49){var _0x22806c=this;return new Promise(function(_0x617ad3,_0x445ad0){return db[_0xe9f0('0x17')][_0xe9f0('0x21')]({'raw':_0x3dbe49[_0xe9f0('0x19')]?_0x3dbe49[_0xe9f0('0x19')][_0xe9f0('0x1a')]===undefined?!![]:![]:!![],'where':_0x3dbe49[_0xe9f0('0x19')]?_0x3dbe49[_0xe9f0('0x19')][_0xe9f0('0x22')]||null:null,'attributes':_0x3dbe49[_0xe9f0('0x19')]?_0x3dbe49[_0xe9f0('0x19')][_0xe9f0('0x1f')]||null:null,'include':_0x3dbe49['options']?_0x3dbe49['options']['include']?_[_0xe9f0('0x1d')](_0x3dbe49['options'][_0xe9f0('0x1c')],function(_0xc5fa13){return{'model':db[_0xc5fa13['model']],'as':_0xc5fa13['as'],'attributes':_0xc5fa13[_0xe9f0('0x1f')],'include':_0xc5fa13['include']?_['map'](_0xc5fa13['include'],function(_0x165440){return{'model':db[_0x165440[_0xe9f0('0x1e')]],'as':_0x165440['as'],'attributes':_0x165440['attributes'],'include':_0x165440[_0xe9f0('0x1c')]?_[_0xe9f0('0x1d')](_0x165440[_0xe9f0('0x1c')],function(_0x4d4186){return{'model':db[_0x4d4186['model']],'as':_0x4d4186['as'],'attributes':_0x4d4186[_0xe9f0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe9f0('0xb')](function(_0x1917c8){logger['info'](_0xe9f0('0x20'),_0x3dbe49);logger[_0xe9f0('0xf')](_0xe9f0('0x20'),_0x3dbe49,JSON[_0xe9f0('0x11')](_0x1917c8));_0x617ad3(_0x1917c8);})[_0xe9f0('0x15')](function(_0x552ec2){logger[_0xe9f0('0x12')](_0xe9f0('0x20'),_0x552ec2[_0xe9f0('0x13')],_0x3dbe49);_0x445ad0(_0x22806c['error'](0x1f4,_0x552ec2[_0xe9f0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 15cc336..e4afff6 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 _0xafbe=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xafbe,0x1c7));var _0xeafb=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0xafbe[_0x45bf86];return _0x1f02b7;};'use strict';var multer=require(_0xeafb('0x0'));var util=require(_0xeafb('0x1'));var path=require(_0xeafb('0x2'));var timeout=require(_0xeafb('0x3'));var express=require(_0xeafb('0x4'));var router=express['Router']();var fs_extra=require(_0xeafb('0x5'));var auth=require(_0xeafb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xeafb('0x7'));var controller=require('./intZohoConfiguration.controller');router[_0xeafb('0x8')]('/',auth[_0xeafb('0x9')](),controller['index']);router['get'](_0xeafb('0xa'),auth[_0xeafb('0x9')](),controller['show']);router[_0xeafb('0x8')](_0xeafb('0xb'),auth[_0xeafb('0x9')](),controller['getFields']);router[_0xeafb('0x8')](_0xeafb('0xc'),auth[_0xeafb('0x9')](),controller['getSubjects']);router[_0xeafb('0x8')](_0xeafb('0xd'),auth[_0xeafb('0x9')](),controller[_0xeafb('0xe')]);router[_0xeafb('0xf')]('/',auth[_0xeafb('0x9')](),controller['create']);router[_0xeafb('0x10')](_0xeafb('0xa'),auth[_0xeafb('0x9')](),controller[_0xeafb('0x11')]);router['delete'](_0xeafb('0xa'),auth[_0xeafb('0x9')](),controller[_0xeafb('0x12')]);module[_0xeafb('0x13')]=router; \ No newline at end of file +var _0xb3d7=['post','put','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x280700,_0x44beb4){var _0x4eede8=function(_0x8a0306){while(--_0x8a0306){_0x280700['push'](_0x280700['shift']());}};_0x4eede8(++_0x44beb4);}(_0xb3d7,0xb7));var _0x7b3d=function(_0x183cf5,_0x26c74a){_0x183cf5=_0x183cf5-0x0;var _0x1b1b63=_0xb3d7[_0x183cf5];return _0x1b1b63;};'use strict';var multer=require(_0x7b3d('0x0'));var util=require(_0x7b3d('0x1'));var path=require(_0x7b3d('0x2'));var timeout=require(_0x7b3d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7b3d('0x4'));var auth=require(_0x7b3d('0x5'));var interaction=require(_0x7b3d('0x6'));var config=require(_0x7b3d('0x7'));var controller=require(_0x7b3d('0x8'));router[_0x7b3d('0x9')]('/',auth[_0x7b3d('0xa')](),controller[_0x7b3d('0xb')]);router[_0x7b3d('0x9')](_0x7b3d('0xc'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/fields',auth[_0x7b3d('0xa')](),controller['getFields']);router['get'](_0x7b3d('0xd'),auth['isAuthenticated'](),controller[_0x7b3d('0xe')]);router['get'](_0x7b3d('0xf'),auth[_0x7b3d('0xa')](),controller[_0x7b3d('0x10')]);router[_0x7b3d('0x11')]('/',auth[_0x7b3d('0xa')](),controller['create']);router[_0x7b3d('0x12')]('/:id',auth[_0x7b3d('0xa')](),controller['update']);router['delete'](_0x7b3d('0xc'),auth[_0x7b3d('0xa')](),controller['destroy']);module[_0x7b3d('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index dde6052..c23acb3 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 _0x9957=['nothing','lead','contact_lead','sequelize','exports','STRING','ENUM','contact'];(function(_0x3493ee,_0x4d5226){var _0x2ecec0=function(_0x5c6e86){while(--_0x5c6e86){_0x3493ee['push'](_0x3493ee['shift']());}};_0x2ecec0(++_0x4d5226);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')]},'moduleCreate':{'type':Sequelize[_0x7995('0x3')]('lead',_0x7995('0x4'),_0x7995('0x5')),'defaultValue':_0x7995('0x6')},'moduleSearch':{'type':Sequelize[_0x7995('0x3')]('contact_lead',_0x7995('0x4'),_0x7995('0x6')),'defaultValue':_0x7995('0x7')},'description':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x5ee0=['ENUM','lead','contact','nothing','sequelize','exports','STRING'];(function(_0x11ca04,_0x46a1a1){var _0x19e4d9=function(_0x23060c){while(--_0x23060c){_0x11ca04['push'](_0x11ca04['shift']());}};_0x19e4d9(++_0x46a1a1);}(_0x5ee0,0x17e));var _0x05ee=function(_0x1b7b88,_0x29236a){_0x1b7b88=_0x1b7b88-0x0;var _0xe0382b=_0x5ee0[_0x1b7b88];return _0xe0382b;};'use strict';var Sequelize=require(_0x05ee('0x0'));module[_0x05ee('0x1')]={'name':{'type':Sequelize[_0x05ee('0x2')]},'moduleCreate':{'type':Sequelize[_0x05ee('0x3')](_0x05ee('0x4'),_0x05ee('0x5'),_0x05ee('0x6')),'defaultValue':_0x05ee('0x4')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead','contact','lead'),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x05ee('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 4851325..cf5f7d3 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 _0x02aa=['create','body','find','getFields','ZohoField','getSubjects','getDescriptions','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','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','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','ZohoConfiguration','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','then','includeAll','include','findAll','catch','show','params'];(function(_0x186984,_0x624f77){var _0x5b30f7=function(_0x1e0da2){while(--_0x1e0da2){_0x186984['push'](_0x186984['shift']());}};_0x5b30f7(++_0x624f77);}(_0x02aa,0x198));var _0xa02a=function(_0x325743,_0x139dd6){_0x325743=_0x325743-0x0;var _0xf742b9=_0x02aa[_0x325743];return _0xf742b9;};'use strict';var emlformat=require(_0xa02a('0x0'));var rimraf=require(_0xa02a('0x1'));var zipdir=require(_0xa02a('0x2'));var jsonpatch=require(_0xa02a('0x3'));var rp=require(_0xa02a('0x4'));var moment=require('moment');var BPromise=require(_0xa02a('0x5'));var Mustache=require(_0xa02a('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa02a('0x7'));var csv=require(_0xa02a('0x8'));var ejs=require(_0xa02a('0x9'));var fs=require('fs');var fs_extra=require(_0xa02a('0xa'));var _=require(_0xa02a('0xb'));var squel=require(_0xa02a('0xc'));var crypto=require(_0xa02a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa02a('0xe'));var Papa=require('papaparse');var Redis=require(_0xa02a('0xf'));var authService=require(_0xa02a('0x10'));var qs=require(_0xa02a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa02a('0x12'));var logger=require(_0xa02a('0x13'))(_0xa02a('0x14'));var utils=require(_0xa02a('0x15'));var config=require(_0xa02a('0x16'));var licenseUtil=require(_0xa02a('0x17'));var db=require(_0xa02a('0x18'))['db'];function respondWithStatusCode(_0x17342f,_0x5d9a82){_0x5d9a82=_0x5d9a82||0xcc;return function(_0x26a213){if(_0x26a213){return _0x17342f[_0xa02a('0x19')](_0x5d9a82);}return _0x17342f[_0xa02a('0x1a')](_0x5d9a82)[_0xa02a('0x1b')]();};}function respondWithResult(_0x10393c,_0x2e1fbc){_0x2e1fbc=_0x2e1fbc||0xc8;return function(_0x1aa788){if(_0x1aa788){return _0x10393c[_0xa02a('0x1a')](_0x2e1fbc)[_0xa02a('0x1c')](_0x1aa788);}};}function respondWithFilteredResult(_0x51c9dd,_0x539928){return function(_0x46868a){if(_0x46868a){var _0x46c15a=typeof _0x539928[_0xa02a('0x1d')]===_0xa02a('0x1e')&&typeof _0x539928[_0xa02a('0x1f')]===_0xa02a('0x1e');var _0x719bf4=_0x46868a[_0xa02a('0x20')];var _0x3c6db4=_0x46c15a?0x0:_0x539928[_0xa02a('0x1d')];var _0x2be87f=_0x46c15a?_0x46868a[_0xa02a('0x20')]:_0x539928['offset']+_0x539928[_0xa02a('0x1f')];var _0x411f3d;if(_0x2be87f>=_0x719bf4){_0x2be87f=_0x719bf4;_0x411f3d=0xc8;}else{_0x411f3d=0xce;}_0x51c9dd[_0xa02a('0x1a')](_0x411f3d);return _0x51c9dd[_0xa02a('0x21')](_0xa02a('0x22'),_0x3c6db4+'-'+_0x2be87f+'/'+_0x719bf4)['json'](_0x46868a);}return null;};}function patchUpdates(_0x377434){return function(_0x4685d8){try{jsonpatch[_0xa02a('0x23')](_0x4685d8,_0x377434,!![]);}catch(_0x4209e0){return BPromise[_0xa02a('0x24')](_0x4209e0);}return _0x4685d8[_0xa02a('0x25')]();};}function saveUpdates(_0x389cfb,_0x395490){return function(_0x4a9a6b){if(_0x4a9a6b){return _0x4a9a6b[_0xa02a('0x26')](_0x389cfb)['then'](function(_0x37bc03){return _0x37bc03;});}return null;};}function removeEntity(_0xec0f60,_0x305a63){return function(_0x24e87e){if(_0x24e87e){return _0x24e87e['destroy']()['then'](function(){_0xec0f60[_0xa02a('0x1a')](0xcc)[_0xa02a('0x1b')]();});}};}function handleEntityNotFound(_0x16650d,_0x800777){return function(_0x266d8a){if(!_0x266d8a){_0x16650d[_0xa02a('0x19')](0x194);}return _0x266d8a;};}function handleError(_0xb61cae,_0xacc892){_0xacc892=_0xacc892||0x1f4;return function(_0x1ea067){logger[_0xa02a('0x27')](_0x1ea067[_0xa02a('0x28')]);if(_0x1ea067[_0xa02a('0x29')]){delete _0x1ea067['name'];}_0xb61cae[_0xa02a('0x1a')](_0xacc892)[_0xa02a('0x2a')](_0x1ea067);};}exports['index']=function(_0x3e0e21,_0x35694e){var _0x5889cd={},_0x3023b9={},_0x5ecae1={'count':0x0,'rows':[]};var _0x198cee=_[_0xa02a('0x2b')](db[_0xa02a('0x2c')][_0xa02a('0x2d')],function(_0x4d12b5){return{'name':_0x4d12b5[_0xa02a('0x2e')],'type':_0x4d12b5['type']['key']};});_0x3023b9[_0xa02a('0x2f')]=_['map'](_0x198cee,_0xa02a('0x29'));_0x3023b9[_0xa02a('0x30')]=_[_0xa02a('0x31')](_0x3e0e21[_0xa02a('0x30')]);_0x3023b9[_0xa02a('0x32')]=_[_0xa02a('0x33')](_0x3023b9[_0xa02a('0x2f')],_0x3023b9[_0xa02a('0x30')]);_0x5889cd[_0xa02a('0x34')]=_[_0xa02a('0x33')](_0x3023b9[_0xa02a('0x2f')],qs[_0xa02a('0x35')](_0x3e0e21[_0xa02a('0x30')]['fields']));_0x5889cd[_0xa02a('0x34')]=_0x5889cd[_0xa02a('0x34')][_0xa02a('0x36')]?_0x5889cd['attributes']:_0x3023b9[_0xa02a('0x2f')];if(!_0x3e0e21[_0xa02a('0x30')]['hasOwnProperty'](_0xa02a('0x37'))){_0x5889cd[_0xa02a('0x1f')]=qs[_0xa02a('0x1f')](_0x3e0e21['query']['limit']);_0x5889cd[_0xa02a('0x1d')]=qs[_0xa02a('0x1d')](_0x3e0e21[_0xa02a('0x30')][_0xa02a('0x1d')]);}_0x5889cd[_0xa02a('0x38')]=qs[_0xa02a('0x39')](_0x3e0e21['query'][_0xa02a('0x39')]);_0x5889cd[_0xa02a('0x3a')]=qs[_0xa02a('0x32')](_[_0xa02a('0x3b')](_0x3e0e21[_0xa02a('0x30')],_0x3023b9[_0xa02a('0x32')]),_0x198cee);if(_0x3e0e21[_0xa02a('0x30')]['filter']){_0x5889cd[_0xa02a('0x3a')]=_[_0xa02a('0x3c')](_0x5889cd['where'],{'$or':_[_0xa02a('0x2b')](_0x198cee,function(_0x52ff39){if(_0x52ff39[_0xa02a('0x3d')]!==_0xa02a('0x3e')){var _0x3a0524={};_0x3a0524[_0x52ff39['name']]={'$like':'%'+_0x3e0e21[_0xa02a('0x30')][_0xa02a('0x3f')]+'%'};return _0x3a0524;}})});}_0x5889cd=_[_0xa02a('0x3c')]({},_0x5889cd,_0x3e0e21[_0xa02a('0x40')]);var _0x26f860={'where':_0x5889cd[_0xa02a('0x3a')]};return db[_0xa02a('0x2c')][_0xa02a('0x20')](_0x26f860)[_0xa02a('0x41')](function(_0x53a5cd){_0x5ecae1[_0xa02a('0x20')]=_0x53a5cd;if(_0x3e0e21['query'][_0xa02a('0x42')]){_0x5889cd[_0xa02a('0x43')]=[{'all':!![]}];}return db[_0xa02a('0x2c')][_0xa02a('0x44')](_0x5889cd);})[_0xa02a('0x41')](function(_0x154bff){_0x5ecae1['rows']=_0x154bff;return _0x5ecae1;})[_0xa02a('0x41')](respondWithFilteredResult(_0x35694e,_0x5889cd))[_0xa02a('0x45')](handleError(_0x35694e,null));};exports[_0xa02a('0x46')]=function(_0x2eda46,_0x23b990){var _0x4b4447={'raw':![],'where':{'id':_0x2eda46[_0xa02a('0x47')]['id']}},_0xd308bc={};_0xd308bc[_0xa02a('0x2f')]=_[_0xa02a('0x31')](db[_0xa02a('0x2c')][_0xa02a('0x2d')]);_0xd308bc['query']=_[_0xa02a('0x31')](_0x2eda46['query']);_0xd308bc[_0xa02a('0x32')]=_[_0xa02a('0x33')](_0xd308bc['model'],_0xd308bc['query']);_0x4b4447[_0xa02a('0x34')]=_[_0xa02a('0x33')](_0xd308bc[_0xa02a('0x2f')],qs[_0xa02a('0x35')](_0x2eda46[_0xa02a('0x30')][_0xa02a('0x35')]));_0x4b4447[_0xa02a('0x34')]=_0x4b4447[_0xa02a('0x34')][_0xa02a('0x36')]?_0x4b4447[_0xa02a('0x34')]:_0xd308bc[_0xa02a('0x2f')];if(_0x2eda46[_0xa02a('0x30')]['includeAll']){_0x4b4447[_0xa02a('0x43')]=[{'all':!![]}];}_0x4b4447=_[_0xa02a('0x3c')]({},_0x4b4447,_0x2eda46[_0xa02a('0x40')]);return db[_0xa02a('0x2c')]['find'](_0x4b4447)[_0xa02a('0x41')](handleEntityNotFound(_0x23b990,null))[_0xa02a('0x41')](respondWithResult(_0x23b990,null))['catch'](handleError(_0x23b990,null));};exports[_0xa02a('0x48')]=function(_0x531b77,_0x19872e){return db['ZohoConfiguration'][_0xa02a('0x48')](_0x531b77[_0xa02a('0x49')],{})['then'](respondWithResult(_0x19872e,0xc9))[_0xa02a('0x45')](handleError(_0x19872e,null));};exports[_0xa02a('0x26')]=function(_0x5c8ccc,_0x4ca67d){if(_0x5c8ccc['body']['id']){delete _0x5c8ccc[_0xa02a('0x49')]['id'];}return db[_0xa02a('0x2c')][_0xa02a('0x4a')]({'where':{'id':_0x5c8ccc[_0xa02a('0x47')]['id']}})[_0xa02a('0x41')](handleEntityNotFound(_0x4ca67d,null))[_0xa02a('0x41')](saveUpdates(_0x5c8ccc[_0xa02a('0x49')],null))[_0xa02a('0x41')](respondWithResult(_0x4ca67d,null))[_0xa02a('0x45')](handleError(_0x4ca67d,null));};exports['destroy']=function(_0x50d280,_0x2e9c0a){return db[_0xa02a('0x2c')][_0xa02a('0x4a')]({'where':{'id':_0x50d280['params']['id']}})[_0xa02a('0x41')](handleEntityNotFound(_0x2e9c0a,null))['then'](removeEntity(_0x2e9c0a,null))[_0xa02a('0x45')](handleError(_0x2e9c0a,null));};exports[_0xa02a('0x4b')]=function(_0x1a797c,_0x2042c7,_0x13ede2){var _0x11862a={};var _0x5b2d7b={};var _0x3cb9ae;var _0x39300e;return db[_0xa02a('0x2c')]['findOne']({'where':{'id':_0x1a797c[_0xa02a('0x47')]['id']}})[_0xa02a('0x41')](handleEntityNotFound(_0x2042c7,null))[_0xa02a('0x41')](function(_0xbe25b3){if(_0xbe25b3){_0x3cb9ae=_0xbe25b3;_0x5b2d7b[_0xa02a('0x2f')]=_[_0xa02a('0x31')](db[_0xa02a('0x4c')]['rawAttributes']);_0x5b2d7b[_0xa02a('0x30')]=_['keys'](_0x1a797c[_0xa02a('0x30')]);_0x5b2d7b['filters']=_[_0xa02a('0x33')](_0x5b2d7b[_0xa02a('0x2f')],_0x5b2d7b[_0xa02a('0x30')]);_0x11862a[_0xa02a('0x34')]=_[_0xa02a('0x33')](_0x5b2d7b[_0xa02a('0x2f')],qs['fields'](_0x1a797c[_0xa02a('0x30')]['fields']));_0x11862a[_0xa02a('0x34')]=_0x11862a[_0xa02a('0x34')][_0xa02a('0x36')]?_0x11862a[_0xa02a('0x34')]:_0x5b2d7b[_0xa02a('0x2f')];_0x11862a[_0xa02a('0x38')]=qs[_0xa02a('0x39')](_0x1a797c[_0xa02a('0x30')][_0xa02a('0x39')]);_0x11862a['where']=qs[_0xa02a('0x32')](_[_0xa02a('0x3b')](_0x1a797c['query'],_0x5b2d7b[_0xa02a('0x32')]));if(_0x1a797c[_0xa02a('0x30')][_0xa02a('0x3f')]){_0x11862a[_0xa02a('0x3a')]=_[_0xa02a('0x3c')](_0x11862a[_0xa02a('0x3a')],{'$or':_[_0xa02a('0x2b')](_0x11862a[_0xa02a('0x34')],function(_0x186860){var _0x239d5b={};_0x239d5b[_0x186860]={'$like':'%'+_0x1a797c['query'][_0xa02a('0x3f')]+'%'};return _0x239d5b;})});}_0x11862a=_[_0xa02a('0x3c')]({},_0x11862a,_0x1a797c[_0xa02a('0x40')]);return _0x3cb9ae[_0xa02a('0x4b')](_0x11862a);}})[_0xa02a('0x41')](function(_0x414447){if(_0x414447){_0x39300e=_0x414447[_0xa02a('0x36')];if(!_0x1a797c[_0xa02a('0x30')]['hasOwnProperty'](_0xa02a('0x37'))){_0x11862a[_0xa02a('0x1f')]=qs[_0xa02a('0x1f')](_0x1a797c[_0xa02a('0x30')][_0xa02a('0x1f')]);_0x11862a[_0xa02a('0x1d')]=qs[_0xa02a('0x1d')](_0x1a797c['query'][_0xa02a('0x1d')]);}return _0x3cb9ae[_0xa02a('0x4b')](_0x11862a);}})['then'](function(_0x38d179){if(_0x38d179){return _0x38d179?{'count':_0x39300e,'rows':_0x38d179}:null;}})[_0xa02a('0x41')](respondWithResult(_0x2042c7,null))[_0xa02a('0x45')](handleError(_0x2042c7,null));};exports['getSubjects']=function(_0x34fce5,_0x238aaf,_0x3e89e5){var _0x431d58={};var _0x5738de={};var _0x27d7a8;var _0x2d0eee;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x34fce5['params']['id']}})[_0xa02a('0x41')](handleEntityNotFound(_0x238aaf,null))[_0xa02a('0x41')](function(_0x270bdf){if(_0x270bdf){_0x27d7a8=_0x270bdf;_0x5738de[_0xa02a('0x2f')]=_[_0xa02a('0x31')](db['ZohoField'][_0xa02a('0x2d')]);_0x5738de[_0xa02a('0x30')]=_[_0xa02a('0x31')](_0x34fce5['query']);_0x5738de[_0xa02a('0x32')]=_[_0xa02a('0x33')](_0x5738de[_0xa02a('0x2f')],_0x5738de[_0xa02a('0x30')]);_0x431d58['attributes']=_[_0xa02a('0x33')](_0x5738de['model'],qs[_0xa02a('0x35')](_0x34fce5['query'][_0xa02a('0x35')]));_0x431d58[_0xa02a('0x34')]=_0x431d58['attributes']['length']?_0x431d58['attributes']:_0x5738de['model'];_0x431d58['order']=qs[_0xa02a('0x39')](_0x34fce5[_0xa02a('0x30')][_0xa02a('0x39')]);_0x431d58[_0xa02a('0x3a')]=qs['filters'](_[_0xa02a('0x3b')](_0x34fce5[_0xa02a('0x30')],_0x5738de[_0xa02a('0x32')]));if(_0x34fce5[_0xa02a('0x30')][_0xa02a('0x3f')]){_0x431d58[_0xa02a('0x3a')]=_[_0xa02a('0x3c')](_0x431d58[_0xa02a('0x3a')],{'$or':_[_0xa02a('0x2b')](_0x431d58[_0xa02a('0x34')],function(_0x39ec10){var _0x31fd97={};_0x31fd97[_0x39ec10]={'$like':'%'+_0x34fce5[_0xa02a('0x30')]['filter']+'%'};return _0x31fd97;})});}_0x431d58=_[_0xa02a('0x3c')]({},_0x431d58,_0x34fce5[_0xa02a('0x40')]);return _0x27d7a8[_0xa02a('0x4d')](_0x431d58);}})[_0xa02a('0x41')](function(_0x1039bb){if(_0x1039bb){_0x2d0eee=_0x1039bb['length'];if(!_0x34fce5['query']['hasOwnProperty'](_0xa02a('0x37'))){_0x431d58[_0xa02a('0x1f')]=qs[_0xa02a('0x1f')](_0x34fce5[_0xa02a('0x30')][_0xa02a('0x1f')]);_0x431d58['offset']=qs[_0xa02a('0x1d')](_0x34fce5[_0xa02a('0x30')]['offset']);}return _0x27d7a8[_0xa02a('0x4d')](_0x431d58);}})[_0xa02a('0x41')](function(_0x51bc1a){if(_0x51bc1a){return _0x51bc1a?{'count':_0x2d0eee,'rows':_0x51bc1a}:null;}})[_0xa02a('0x41')](respondWithResult(_0x238aaf,null))[_0xa02a('0x45')](handleError(_0x238aaf,null));};exports[_0xa02a('0x4e')]=function(_0x1bb985,_0x334cd0,_0xa03a84){var _0x581b8c={};var _0x2a3736={};var _0x787dff;var _0x113648;return db[_0xa02a('0x2c')]['findOne']({'where':{'id':_0x1bb985[_0xa02a('0x47')]['id']}})[_0xa02a('0x41')](handleEntityNotFound(_0x334cd0,null))[_0xa02a('0x41')](function(_0x1b6c8b){if(_0x1b6c8b){_0x787dff=_0x1b6c8b;_0x2a3736[_0xa02a('0x2f')]=_[_0xa02a('0x31')](db[_0xa02a('0x4c')][_0xa02a('0x2d')]);_0x2a3736[_0xa02a('0x30')]=_['keys'](_0x1bb985['query']);_0x2a3736['filters']=_[_0xa02a('0x33')](_0x2a3736[_0xa02a('0x2f')],_0x2a3736[_0xa02a('0x30')]);_0x581b8c[_0xa02a('0x34')]=_[_0xa02a('0x33')](_0x2a3736[_0xa02a('0x2f')],qs[_0xa02a('0x35')](_0x1bb985['query'][_0xa02a('0x35')]));_0x581b8c['attributes']=_0x581b8c[_0xa02a('0x34')][_0xa02a('0x36')]?_0x581b8c[_0xa02a('0x34')]:_0x2a3736[_0xa02a('0x2f')];_0x581b8c['order']=qs[_0xa02a('0x39')](_0x1bb985[_0xa02a('0x30')][_0xa02a('0x39')]);_0x581b8c[_0xa02a('0x3a')]=qs['filters'](_[_0xa02a('0x3b')](_0x1bb985[_0xa02a('0x30')],_0x2a3736[_0xa02a('0x32')]));if(_0x1bb985['query'][_0xa02a('0x3f')]){_0x581b8c[_0xa02a('0x3a')]=_[_0xa02a('0x3c')](_0x581b8c['where'],{'$or':_[_0xa02a('0x2b')](_0x581b8c[_0xa02a('0x34')],function(_0x3e3d29){var _0x22e1c9={};_0x22e1c9[_0x3e3d29]={'$like':'%'+_0x1bb985[_0xa02a('0x30')][_0xa02a('0x3f')]+'%'};return _0x22e1c9;})});}_0x581b8c=_[_0xa02a('0x3c')]({},_0x581b8c,_0x1bb985[_0xa02a('0x40')]);return _0x787dff['getDescriptions'](_0x581b8c);}})[_0xa02a('0x41')](function(_0x46b049){if(_0x46b049){_0x113648=_0x46b049['length'];if(!_0x1bb985[_0xa02a('0x30')][_0xa02a('0x4f')](_0xa02a('0x37'))){_0x581b8c['limit']=qs['limit'](_0x1bb985['query'][_0xa02a('0x1f')]);_0x581b8c['offset']=qs['offset'](_0x1bb985['query'][_0xa02a('0x1d')]);}return _0x787dff[_0xa02a('0x4e')](_0x581b8c);}})['then'](function(_0x26c9fd){if(_0x26c9fd){return _0x26c9fd?{'count':_0x113648,'rows':_0x26c9fd}:null;}})[_0xa02a('0x41')](respondWithResult(_0x334cd0,null))[_0xa02a('0x45')](handleError(_0x334cd0,null));}; \ No newline at end of file +var _0xed39=['find','create','body','getFields','findOne','ZohoField','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','error','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','then','includeAll','include','findAll','rows','catch','show','params','length','options'];(function(_0x29941f,_0x187d20){var _0x453246=function(_0x762c5e){while(--_0x762c5e){_0x29941f['push'](_0x29941f['shift']());}};_0x453246(++_0x187d20);}(_0xed39,0x103));var _0x9ed3=function(_0x8d1ee8,_0x533aa8){_0x8d1ee8=_0x8d1ee8-0x0;var _0x53921e=_0xed39[_0x8d1ee8];return _0x53921e;};'use strict';var emlformat=require(_0x9ed3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9ed3('0x1'));var jsonpatch=require(_0x9ed3('0x2'));var rp=require(_0x9ed3('0x3'));var moment=require(_0x9ed3('0x4'));var BPromise=require(_0x9ed3('0x5'));var Mustache=require(_0x9ed3('0x6'));var util=require('util');var path=require('path');var sox=require(_0x9ed3('0x7'));var csv=require(_0x9ed3('0x8'));var ejs=require(_0x9ed3('0x9'));var fs=require('fs');var fs_extra=require(_0x9ed3('0xa'));var _=require('lodash');var squel=require(_0x9ed3('0xb'));var crypto=require(_0x9ed3('0xc'));var jsforce=require(_0x9ed3('0xd'));var deskjs=require(_0x9ed3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9ed3('0xf'));var Papa=require(_0x9ed3('0x10'));var Redis=require(_0x9ed3('0x11'));var authService=require(_0x9ed3('0x12'));var qs=require(_0x9ed3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9ed3('0x14'));var logger=require(_0x9ed3('0x15'))(_0x9ed3('0x16'));var utils=require(_0x9ed3('0x17'));var config=require(_0x9ed3('0x18'));var licenseUtil=require(_0x9ed3('0x19'));var db=require(_0x9ed3('0x1a'))['db'];function respondWithStatusCode(_0x57cd2a,_0x294ad7){_0x294ad7=_0x294ad7||0xcc;return function(_0x24dd6c){if(_0x24dd6c){return _0x57cd2a[_0x9ed3('0x1b')](_0x294ad7);}return _0x57cd2a[_0x9ed3('0x1c')](_0x294ad7)[_0x9ed3('0x1d')]();};}function respondWithResult(_0x451eea,_0x21c1bf){_0x21c1bf=_0x21c1bf||0xc8;return function(_0x5664ff){if(_0x5664ff){return _0x451eea[_0x9ed3('0x1c')](_0x21c1bf)[_0x9ed3('0x1e')](_0x5664ff);}};}function respondWithFilteredResult(_0x11a6f3,_0x2fed37){return function(_0x1c7ce7){if(_0x1c7ce7){var _0xb7efb6=typeof _0x2fed37[_0x9ed3('0x1f')]===_0x9ed3('0x20')&&typeof _0x2fed37['limit']===_0x9ed3('0x20');var _0x1aad1b=_0x1c7ce7[_0x9ed3('0x21')];var _0x5b5dad=_0xb7efb6?0x0:_0x2fed37[_0x9ed3('0x1f')];var _0xf634dd=_0xb7efb6?_0x1c7ce7[_0x9ed3('0x21')]:_0x2fed37[_0x9ed3('0x1f')]+_0x2fed37[_0x9ed3('0x22')];var _0x3abede;if(_0xf634dd>=_0x1aad1b){_0xf634dd=_0x1aad1b;_0x3abede=0xc8;}else{_0x3abede=0xce;}_0x11a6f3[_0x9ed3('0x1c')](_0x3abede);return _0x11a6f3[_0x9ed3('0x23')](_0x9ed3('0x24'),_0x5b5dad+'-'+_0xf634dd+'/'+_0x1aad1b)[_0x9ed3('0x1e')](_0x1c7ce7);}return null;};}function patchUpdates(_0x99a453){return function(_0x4a116b){try{jsonpatch[_0x9ed3('0x25')](_0x4a116b,_0x99a453,!![]);}catch(_0x4389df){return BPromise[_0x9ed3('0x26')](_0x4389df);}return _0x4a116b[_0x9ed3('0x27')]();};}function saveUpdates(_0x95b41d,_0x5aa0c3){return function(_0x149a71){if(_0x149a71){return _0x149a71[_0x9ed3('0x28')](_0x95b41d)['then'](function(_0x4fba16){return _0x4fba16;});}return null;};}function removeEntity(_0x57aa88,_0x1f5c7e){return function(_0x26684a){if(_0x26684a){return _0x26684a[_0x9ed3('0x29')]()['then'](function(){_0x57aa88['status'](0xcc)[_0x9ed3('0x1d')]();});}};}function handleEntityNotFound(_0x5995e3,_0x9fabae){return function(_0x245196){if(!_0x245196){_0x5995e3[_0x9ed3('0x1b')](0x194);}return _0x245196;};}function handleError(_0x422fec,_0x42394d){_0x42394d=_0x42394d||0x1f4;return function(_0x2e9d2b){logger[_0x9ed3('0x2a')](_0x2e9d2b['stack']);if(_0x2e9d2b[_0x9ed3('0x2b')]){delete _0x2e9d2b[_0x9ed3('0x2b')];}_0x422fec[_0x9ed3('0x1c')](_0x42394d)[_0x9ed3('0x2c')](_0x2e9d2b);};}exports[_0x9ed3('0x2d')]=function(_0x20765a,_0x2d1f18){var _0x55b44a={},_0x1864a3={},_0x46da0c={'count':0x0,'rows':[]};var _0x13fc42=_[_0x9ed3('0x2e')](db[_0x9ed3('0x2f')][_0x9ed3('0x30')],function(_0x3ca5ec){return{'name':_0x3ca5ec[_0x9ed3('0x31')],'type':_0x3ca5ec[_0x9ed3('0x32')][_0x9ed3('0x33')]};});_0x1864a3[_0x9ed3('0x34')]=_[_0x9ed3('0x2e')](_0x13fc42,'name');_0x1864a3[_0x9ed3('0x35')]=_[_0x9ed3('0x36')](_0x20765a[_0x9ed3('0x35')]);_0x1864a3[_0x9ed3('0x37')]=_[_0x9ed3('0x38')](_0x1864a3[_0x9ed3('0x34')],_0x1864a3[_0x9ed3('0x35')]);_0x55b44a[_0x9ed3('0x39')]=_[_0x9ed3('0x38')](_0x1864a3[_0x9ed3('0x34')],qs[_0x9ed3('0x3a')](_0x20765a[_0x9ed3('0x35')][_0x9ed3('0x3a')]));_0x55b44a[_0x9ed3('0x39')]=_0x55b44a[_0x9ed3('0x39')]['length']?_0x55b44a['attributes']:_0x1864a3[_0x9ed3('0x34')];if(!_0x20765a[_0x9ed3('0x35')][_0x9ed3('0x3b')](_0x9ed3('0x3c'))){_0x55b44a[_0x9ed3('0x22')]=qs['limit'](_0x20765a[_0x9ed3('0x35')]['limit']);_0x55b44a['offset']=qs['offset'](_0x20765a['query'][_0x9ed3('0x1f')]);}_0x55b44a[_0x9ed3('0x3d')]=qs[_0x9ed3('0x3e')](_0x20765a[_0x9ed3('0x35')][_0x9ed3('0x3e')]);_0x55b44a[_0x9ed3('0x3f')]=qs[_0x9ed3('0x37')](_[_0x9ed3('0x40')](_0x20765a['query'],_0x1864a3[_0x9ed3('0x37')]),_0x13fc42);if(_0x20765a[_0x9ed3('0x35')][_0x9ed3('0x41')]){_0x55b44a[_0x9ed3('0x3f')]=_[_0x9ed3('0x42')](_0x55b44a[_0x9ed3('0x3f')],{'$or':_['map'](_0x13fc42,function(_0x50bdce){if(_0x50bdce['type']!=='VIRTUAL'){var _0x748bed={};_0x748bed[_0x50bdce[_0x9ed3('0x2b')]]={'$like':'%'+_0x20765a[_0x9ed3('0x35')][_0x9ed3('0x41')]+'%'};return _0x748bed;}})});}_0x55b44a=_['merge']({},_0x55b44a,_0x20765a['options']);var _0x829603={'where':_0x55b44a[_0x9ed3('0x3f')]};return db[_0x9ed3('0x2f')][_0x9ed3('0x21')](_0x829603)[_0x9ed3('0x43')](function(_0x2aa6e8){_0x46da0c['count']=_0x2aa6e8;if(_0x20765a[_0x9ed3('0x35')][_0x9ed3('0x44')]){_0x55b44a[_0x9ed3('0x45')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x9ed3('0x46')](_0x55b44a);})[_0x9ed3('0x43')](function(_0x1ca66a){_0x46da0c[_0x9ed3('0x47')]=_0x1ca66a;return _0x46da0c;})['then'](respondWithFilteredResult(_0x2d1f18,_0x55b44a))[_0x9ed3('0x48')](handleError(_0x2d1f18,null));};exports[_0x9ed3('0x49')]=function(_0x34306c,_0x13107f){var _0x57a2cf={'raw':![],'where':{'id':_0x34306c[_0x9ed3('0x4a')]['id']}},_0x38ec63={};_0x38ec63[_0x9ed3('0x34')]=_[_0x9ed3('0x36')](db[_0x9ed3('0x2f')][_0x9ed3('0x30')]);_0x38ec63['query']=_[_0x9ed3('0x36')](_0x34306c[_0x9ed3('0x35')]);_0x38ec63[_0x9ed3('0x37')]=_['intersection'](_0x38ec63['model'],_0x38ec63['query']);_0x57a2cf[_0x9ed3('0x39')]=_[_0x9ed3('0x38')](_0x38ec63[_0x9ed3('0x34')],qs[_0x9ed3('0x3a')](_0x34306c['query']['fields']));_0x57a2cf['attributes']=_0x57a2cf[_0x9ed3('0x39')][_0x9ed3('0x4b')]?_0x57a2cf[_0x9ed3('0x39')]:_0x38ec63[_0x9ed3('0x34')];if(_0x34306c[_0x9ed3('0x35')][_0x9ed3('0x44')]){_0x57a2cf['include']=[{'all':!![]}];}_0x57a2cf=_[_0x9ed3('0x42')]({},_0x57a2cf,_0x34306c[_0x9ed3('0x4c')]);return db[_0x9ed3('0x2f')][_0x9ed3('0x4d')](_0x57a2cf)[_0x9ed3('0x43')](handleEntityNotFound(_0x13107f,null))[_0x9ed3('0x43')](respondWithResult(_0x13107f,null))[_0x9ed3('0x48')](handleError(_0x13107f,null));};exports[_0x9ed3('0x4e')]=function(_0x286364,_0x199831){return db[_0x9ed3('0x2f')][_0x9ed3('0x4e')](_0x286364['body'],{})[_0x9ed3('0x43')](respondWithResult(_0x199831,0xc9))[_0x9ed3('0x48')](handleError(_0x199831,null));};exports['update']=function(_0x218cbc,_0x5b7793){if(_0x218cbc[_0x9ed3('0x4f')]['id']){delete _0x218cbc[_0x9ed3('0x4f')]['id'];}return db[_0x9ed3('0x2f')]['find']({'where':{'id':_0x218cbc[_0x9ed3('0x4a')]['id']}})[_0x9ed3('0x43')](handleEntityNotFound(_0x5b7793,null))[_0x9ed3('0x43')](saveUpdates(_0x218cbc[_0x9ed3('0x4f')],null))[_0x9ed3('0x43')](respondWithResult(_0x5b7793,null))[_0x9ed3('0x48')](handleError(_0x5b7793,null));};exports[_0x9ed3('0x29')]=function(_0x234a5f,_0x5158c4){return db[_0x9ed3('0x2f')][_0x9ed3('0x4d')]({'where':{'id':_0x234a5f['params']['id']}})[_0x9ed3('0x43')](handleEntityNotFound(_0x5158c4,null))['then'](removeEntity(_0x5158c4,null))[_0x9ed3('0x48')](handleError(_0x5158c4,null));};exports['getFields']=function(_0x4fb5ed,_0x487d15,_0x2da2d5){var _0x3ba348={};var _0xf906a5={};var _0x162985;var _0x4c2e72;return db[_0x9ed3('0x2f')]['findOne']({'where':{'id':_0x4fb5ed[_0x9ed3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x487d15,null))[_0x9ed3('0x43')](function(_0x537c68){if(_0x537c68){_0x162985=_0x537c68;_0xf906a5[_0x9ed3('0x34')]=_[_0x9ed3('0x36')](db['ZohoField']['rawAttributes']);_0xf906a5['query']=_[_0x9ed3('0x36')](_0x4fb5ed[_0x9ed3('0x35')]);_0xf906a5[_0x9ed3('0x37')]=_[_0x9ed3('0x38')](_0xf906a5['model'],_0xf906a5[_0x9ed3('0x35')]);_0x3ba348['attributes']=_[_0x9ed3('0x38')](_0xf906a5[_0x9ed3('0x34')],qs['fields'](_0x4fb5ed[_0x9ed3('0x35')][_0x9ed3('0x3a')]));_0x3ba348['attributes']=_0x3ba348[_0x9ed3('0x39')][_0x9ed3('0x4b')]?_0x3ba348[_0x9ed3('0x39')]:_0xf906a5[_0x9ed3('0x34')];_0x3ba348[_0x9ed3('0x3d')]=qs[_0x9ed3('0x3e')](_0x4fb5ed[_0x9ed3('0x35')][_0x9ed3('0x3e')]);_0x3ba348[_0x9ed3('0x3f')]=qs[_0x9ed3('0x37')](_[_0x9ed3('0x40')](_0x4fb5ed[_0x9ed3('0x35')],_0xf906a5[_0x9ed3('0x37')]));if(_0x4fb5ed[_0x9ed3('0x35')][_0x9ed3('0x41')]){_0x3ba348['where']=_[_0x9ed3('0x42')](_0x3ba348[_0x9ed3('0x3f')],{'$or':_[_0x9ed3('0x2e')](_0x3ba348['attributes'],function(_0x63aa94){var _0x16db5c={};_0x16db5c[_0x63aa94]={'$like':'%'+_0x4fb5ed['query'][_0x9ed3('0x41')]+'%'};return _0x16db5c;})});}_0x3ba348=_[_0x9ed3('0x42')]({},_0x3ba348,_0x4fb5ed['options']);return _0x162985[_0x9ed3('0x50')](_0x3ba348);}})['then'](function(_0x5c4330){if(_0x5c4330){_0x4c2e72=_0x5c4330[_0x9ed3('0x4b')];if(!_0x4fb5ed[_0x9ed3('0x35')]['hasOwnProperty'](_0x9ed3('0x3c'))){_0x3ba348[_0x9ed3('0x22')]=qs[_0x9ed3('0x22')](_0x4fb5ed[_0x9ed3('0x35')][_0x9ed3('0x22')]);_0x3ba348[_0x9ed3('0x1f')]=qs[_0x9ed3('0x1f')](_0x4fb5ed[_0x9ed3('0x35')][_0x9ed3('0x1f')]);}return _0x162985[_0x9ed3('0x50')](_0x3ba348);}})[_0x9ed3('0x43')](function(_0x3961f6){if(_0x3961f6){return _0x3961f6?{'count':_0x4c2e72,'rows':_0x3961f6}:null;}})['then'](respondWithResult(_0x487d15,null))['catch'](handleError(_0x487d15,null));};exports['getSubjects']=function(_0x2530be,_0x409f06,_0x50e173){var _0x18f9a5={};var _0x89c10b={};var _0x18d0b5;var _0x4ec353;return db['ZohoConfiguration'][_0x9ed3('0x51')]({'where':{'id':_0x2530be[_0x9ed3('0x4a')]['id']}})[_0x9ed3('0x43')](handleEntityNotFound(_0x409f06,null))[_0x9ed3('0x43')](function(_0x1c2253){if(_0x1c2253){_0x18d0b5=_0x1c2253;_0x89c10b[_0x9ed3('0x34')]=_['keys'](db[_0x9ed3('0x52')][_0x9ed3('0x30')]);_0x89c10b[_0x9ed3('0x35')]=_[_0x9ed3('0x36')](_0x2530be[_0x9ed3('0x35')]);_0x89c10b[_0x9ed3('0x37')]=_[_0x9ed3('0x38')](_0x89c10b[_0x9ed3('0x34')],_0x89c10b[_0x9ed3('0x35')]);_0x18f9a5[_0x9ed3('0x39')]=_[_0x9ed3('0x38')](_0x89c10b[_0x9ed3('0x34')],qs['fields'](_0x2530be[_0x9ed3('0x35')]['fields']));_0x18f9a5[_0x9ed3('0x39')]=_0x18f9a5[_0x9ed3('0x39')][_0x9ed3('0x4b')]?_0x18f9a5['attributes']:_0x89c10b[_0x9ed3('0x34')];_0x18f9a5[_0x9ed3('0x3d')]=qs[_0x9ed3('0x3e')](_0x2530be[_0x9ed3('0x35')]['sort']);_0x18f9a5[_0x9ed3('0x3f')]=qs[_0x9ed3('0x37')](_['pick'](_0x2530be['query'],_0x89c10b[_0x9ed3('0x37')]));if(_0x2530be[_0x9ed3('0x35')][_0x9ed3('0x41')]){_0x18f9a5[_0x9ed3('0x3f')]=_['merge'](_0x18f9a5['where'],{'$or':_['map'](_0x18f9a5[_0x9ed3('0x39')],function(_0x6f7437){var _0x25e5c5={};_0x25e5c5[_0x6f7437]={'$like':'%'+_0x2530be[_0x9ed3('0x35')][_0x9ed3('0x41')]+'%'};return _0x25e5c5;})});}_0x18f9a5=_[_0x9ed3('0x42')]({},_0x18f9a5,_0x2530be[_0x9ed3('0x4c')]);return _0x18d0b5['getSubjects'](_0x18f9a5);}})['then'](function(_0x5a5bbe){if(_0x5a5bbe){_0x4ec353=_0x5a5bbe[_0x9ed3('0x4b')];if(!_0x2530be[_0x9ed3('0x35')][_0x9ed3('0x3b')]('nolimit')){_0x18f9a5[_0x9ed3('0x22')]=qs[_0x9ed3('0x22')](_0x2530be['query']['limit']);_0x18f9a5['offset']=qs[_0x9ed3('0x1f')](_0x2530be['query'][_0x9ed3('0x1f')]);}return _0x18d0b5['getSubjects'](_0x18f9a5);}})[_0x9ed3('0x43')](function(_0x460c55){if(_0x460c55){return _0x460c55?{'count':_0x4ec353,'rows':_0x460c55}:null;}})[_0x9ed3('0x43')](respondWithResult(_0x409f06,null))['catch'](handleError(_0x409f06,null));};exports[_0x9ed3('0x53')]=function(_0x100103,_0xa51204,_0x354c06){var _0x5655d2={};var _0x367aaf={};var _0x43f484;var _0xcc3879;return db[_0x9ed3('0x2f')][_0x9ed3('0x51')]({'where':{'id':_0x100103[_0x9ed3('0x4a')]['id']}})[_0x9ed3('0x43')](handleEntityNotFound(_0xa51204,null))[_0x9ed3('0x43')](function(_0x48cd05){if(_0x48cd05){_0x43f484=_0x48cd05;_0x367aaf['model']=_[_0x9ed3('0x36')](db[_0x9ed3('0x52')][_0x9ed3('0x30')]);_0x367aaf[_0x9ed3('0x35')]=_[_0x9ed3('0x36')](_0x100103[_0x9ed3('0x35')]);_0x367aaf['filters']=_[_0x9ed3('0x38')](_0x367aaf[_0x9ed3('0x34')],_0x367aaf[_0x9ed3('0x35')]);_0x5655d2['attributes']=_[_0x9ed3('0x38')](_0x367aaf[_0x9ed3('0x34')],qs[_0x9ed3('0x3a')](_0x100103['query'][_0x9ed3('0x3a')]));_0x5655d2['attributes']=_0x5655d2[_0x9ed3('0x39')][_0x9ed3('0x4b')]?_0x5655d2['attributes']:_0x367aaf[_0x9ed3('0x34')];_0x5655d2[_0x9ed3('0x3d')]=qs[_0x9ed3('0x3e')](_0x100103['query']['sort']);_0x5655d2[_0x9ed3('0x3f')]=qs[_0x9ed3('0x37')](_['pick'](_0x100103['query'],_0x367aaf[_0x9ed3('0x37')]));if(_0x100103[_0x9ed3('0x35')][_0x9ed3('0x41')]){_0x5655d2[_0x9ed3('0x3f')]=_[_0x9ed3('0x42')](_0x5655d2['where'],{'$or':_[_0x9ed3('0x2e')](_0x5655d2['attributes'],function(_0x1096a1){var _0x322c61={};_0x322c61[_0x1096a1]={'$like':'%'+_0x100103[_0x9ed3('0x35')]['filter']+'%'};return _0x322c61;})});}_0x5655d2=_[_0x9ed3('0x42')]({},_0x5655d2,_0x100103[_0x9ed3('0x4c')]);return _0x43f484['getDescriptions'](_0x5655d2);}})[_0x9ed3('0x43')](function(_0x40ab6c){if(_0x40ab6c){_0xcc3879=_0x40ab6c[_0x9ed3('0x4b')];if(!_0x100103['query']['hasOwnProperty'](_0x9ed3('0x3c'))){_0x5655d2['limit']=qs[_0x9ed3('0x22')](_0x100103[_0x9ed3('0x35')][_0x9ed3('0x22')]);_0x5655d2[_0x9ed3('0x1f')]=qs['offset'](_0x100103[_0x9ed3('0x35')][_0x9ed3('0x1f')]);}return _0x43f484[_0x9ed3('0x53')](_0x5655d2);}})[_0x9ed3('0x43')](function(_0x2f6193){if(_0x2f6193){return _0x2f6193?{'count':_0xcc3879,'rows':_0x2f6193}:null;}})[_0x9ed3('0x43')](respondWithResult(_0xa51204,null))['catch'](handleError(_0xa51204,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 913d438..f273897 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 _0x49b2=['rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','ZohoConfiguration','int_zoho_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4f648c,_0x225c0a){var _0x28a555=function(_0x147933){while(--_0x147933){_0x4f648c['push'](_0x4f648c['shift']());}};_0x28a555(++_0x225c0a);}(_0x49b2,0x7b));var _0x249b=function(_0x260689,_0xfaaaf6){_0x260689=_0x260689-0x0;var _0x47f754=_0x49b2[_0x260689];return _0x47f754;};'use strict';var _=require(_0x249b('0x0'));var util=require('util');var logger=require(_0x249b('0x1'))(_0x249b('0x2'));var moment=require(_0x249b('0x3'));var BPromise=require(_0x249b('0x4'));var rp=require(_0x249b('0x5'));var fs=require('fs');var path=require(_0x249b('0x6'));var rimraf=require(_0x249b('0x7'));var config=require(_0x249b('0x8'));var attributes=require(_0x249b('0x9'));module[_0x249b('0xa')]=function(_0x4795c1,_0x3415fc){return _0x4795c1['define'](_0x249b('0xb'),attributes,{'tableName':_0x249b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x12a5=['define','ZohoConfiguration','int_zoho_configurations','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports'];(function(_0x343e70,_0xe5f373){var _0x2742fd=function(_0x27e56e){while(--_0x27e56e){_0x343e70['push'](_0x343e70['shift']());}};_0x2742fd(++_0xe5f373);}(_0x12a5,0x107));var _0x512a=function(_0x3bb698,_0x49ab50){_0x3bb698=_0x3bb698-0x0;var _0x2a6926=_0x12a5[_0x3bb698];return _0x2a6926;};'use strict';var _=require(_0x512a('0x0'));var util=require('util');var logger=require(_0x512a('0x1'))(_0x512a('0x2'));var moment=require('moment');var BPromise=require(_0x512a('0x3'));var rp=require(_0x512a('0x4'));var fs=require('fs');var path=require(_0x512a('0x5'));var rimraf=require(_0x512a('0x6'));var config=require(_0x512a('0x7'));var attributes=require(_0x512a('0x8'));module[_0x512a('0x9')]=function(_0x4b7a8f,_0x29cc81){return _0x4b7a8f[_0x512a('0xa')](_0x512a('0xb'),attributes,{'tableName':_0x512a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index a67b243..47aa47c 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 _0x1681=['info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','then'];(function(_0x117f85,_0x5afa65){var _0x1c61a7=function(_0x5be223){while(--_0x5be223){_0x117f85['push'](_0x117f85['shift']());}};_0x1c61a7(++_0x5afa65);}(_0x1681,0x10d));var _0x1168=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1681[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1168('0x0'));var util=require(_0x1168('0x1'));var moment=require(_0x1168('0x2'));var BPromise=require(_0x1168('0x3'));var rs=require(_0x1168('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1168('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1168('0x6'));var config=require('../../config/environment');var jayson=require(_0x1168('0x7'));var client=jayson[_0x1168('0x8')][_0x1168('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f6f5a,_0x5f543c,_0x35225a){return new BPromise(function(_0x3fd5e8,_0x57ea9b){return client['request'](_0x4f6f5a,_0x35225a)[_0x1168('0xa')](function(_0x544e50){logger[_0x1168('0xb')](_0x1168('0xc'),_0x5f543c,_0x1168('0xd'));logger[_0x1168('0xe')](_0x1168('0xf'),_0x5f543c,_0x1168('0xd'),JSON[_0x1168('0x10')](_0x544e50));if(_0x544e50[_0x1168('0x11')]){if(_0x544e50['error'][_0x1168('0x12')]===0x1f4){logger[_0x1168('0x11')](_0x1168('0xc'),_0x5f543c,_0x544e50[_0x1168('0x11')][_0x1168('0x13')]);return _0x57ea9b(_0x544e50[_0x1168('0x11')][_0x1168('0x13')]);}logger[_0x1168('0x11')](_0x1168('0xc'),_0x5f543c,_0x544e50[_0x1168('0x11')][_0x1168('0x13')]);return _0x3fd5e8(_0x544e50[_0x1168('0x11')]['message']);}else{logger[_0x1168('0xb')](_0x1168('0xc'),_0x5f543c,_0x1168('0xd'));_0x3fd5e8(_0x544e50['result']['message']);}})['catch'](function(_0x491b65){logger[_0x1168('0x11')](_0x1168('0xc'),_0x5f543c,_0x491b65);_0x57ea9b(_0x491b65);});});} \ No newline at end of file +var _0x87f7=['stringify','error','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x87f7,0xea));var _0x787f=function(_0x4e9472,_0x37478f){_0x4e9472=_0x4e9472-0x0;var _0x4d011c=_0x87f7[_0x4e9472];return _0x4d011c;};'use strict';var _=require(_0x787f('0x0'));var util=require('util');var moment=require(_0x787f('0x1'));var BPromise=require('bluebird');var rs=require(_0x787f('0x2'));var fs=require('fs');var Redis=require(_0x787f('0x3'));var db=require(_0x787f('0x4'))['db'];var utils=require(_0x787f('0x5'));var logger=require(_0x787f('0x6'))(_0x787f('0x7'));var config=require(_0x787f('0x8'));var jayson=require(_0x787f('0x9'));var client=jayson[_0x787f('0xa')][_0x787f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3af868,_0x4aa234,_0x5165e7){return new BPromise(function(_0x51f837,_0x116c0c){return client[_0x787f('0xc')](_0x3af868,_0x5165e7)[_0x787f('0xd')](function(_0x1e9df6){logger[_0x787f('0xe')](_0x787f('0xf'),_0x4aa234,_0x787f('0x10'));logger[_0x787f('0x11')](_0x787f('0x12'),_0x4aa234,_0x787f('0x10'),JSON[_0x787f('0x13')](_0x1e9df6));if(_0x1e9df6[_0x787f('0x14')]){if(_0x1e9df6[_0x787f('0x14')]['code']===0x1f4){logger['error'](_0x787f('0xf'),_0x4aa234,_0x1e9df6[_0x787f('0x14')][_0x787f('0x15')]);return _0x116c0c(_0x1e9df6[_0x787f('0x14')][_0x787f('0x15')]);}logger[_0x787f('0x14')](_0x787f('0xf'),_0x4aa234,_0x1e9df6['error']['message']);return _0x51f837(_0x1e9df6[_0x787f('0x14')][_0x787f('0x15')]);}else{logger[_0x787f('0xe')](_0x787f('0xf'),_0x4aa234,'request\x20sent');_0x51f837(_0x1e9df6[_0x787f('0x16')][_0x787f('0x15')]);}})['catch'](function(_0x1b6cc6){logger[_0x787f('0x14')](_0x787f('0xf'),_0x4aa234,_0x1b6cc6);_0x116c0c(_0x1b6cc6);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 897c402..bf2cb5e 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 _0xaa0b=['show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','/:id'];(function(_0x2431d6,_0x25189a){var _0x4d0f9b=function(_0x52cd84){while(--_0x52cd84){_0x2431d6['push'](_0x2431d6['shift']());}};_0x4d0f9b(++_0x25189a);}(_0xaa0b,0xd9));var _0xbaa0=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xaa0b[_0x243b59];return _0x3e1676;};'use strict';var multer=require(_0xbaa0('0x0'));var util=require(_0xbaa0('0x1'));var path=require(_0xbaa0('0x2'));var timeout=require(_0xbaa0('0x3'));var express=require(_0xbaa0('0x4'));var router=express[_0xbaa0('0x5')]();var fs_extra=require(_0xbaa0('0x6'));var auth=require(_0xbaa0('0x7'));var interaction=require(_0xbaa0('0x8'));var config=require(_0xbaa0('0x9'));var controller=require(_0xbaa0('0xa'));router[_0xbaa0('0xb')]('/',auth[_0xbaa0('0xc')](),controller['index']);router[_0xbaa0('0xb')](_0xbaa0('0xd'),auth[_0xbaa0('0xc')](),controller[_0xbaa0('0xe')]);router[_0xbaa0('0xf')]('/',auth['isAuthenticated'](),controller[_0xbaa0('0x10')]);router[_0xbaa0('0x11')]('/:id',auth[_0xbaa0('0xc')](),controller['update']);router[_0xbaa0('0x12')](_0xbaa0('0xd'),auth['isAuthenticated'](),controller[_0xbaa0('0x13')]);module[_0xbaa0('0x14')]=router; \ No newline at end of file +var _0x1ebd=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','util'];(function(_0x5c318d,_0x31c5dd){var _0x24ab8e=function(_0xd8ef60){while(--_0xd8ef60){_0x5c318d['push'](_0x5c318d['shift']());}};_0x24ab8e(++_0x31c5dd);}(_0x1ebd,0xd6));var _0xd1eb=function(_0x1c1e01,_0x45e662){_0x1c1e01=_0x1c1e01-0x0;var _0x30577c=_0x1ebd[_0x1c1e01];return _0x30577c;};'use strict';var multer=require(_0xd1eb('0x0'));var util=require(_0xd1eb('0x1'));var path=require('path');var timeout=require(_0xd1eb('0x2'));var express=require(_0xd1eb('0x3'));var router=express[_0xd1eb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd1eb('0x5'));var interaction=require(_0xd1eb('0x6'));var config=require('../../config/environment');var controller=require(_0xd1eb('0x7'));router[_0xd1eb('0x8')]('/',auth[_0xd1eb('0x9')](),controller[_0xd1eb('0xa')]);router['get'](_0xd1eb('0xb'),auth['isAuthenticated'](),controller[_0xd1eb('0xc')]);router[_0xd1eb('0xd')]('/',auth[_0xd1eb('0x9')](),controller[_0xd1eb('0xe')]);router[_0xd1eb('0xf')]('/:id',auth[_0xd1eb('0x9')](),controller[_0xd1eb('0x10')]);router['delete'](_0xd1eb('0xb'),auth[_0xd1eb('0x9')](),controller['destroy']);module[_0xd1eb('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 74b6e57..9e5d466 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 _0xaa46=['BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue','picklist','STRING','customVariable'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xaa46,0xab));var _0x6aa4=function(_0x8f2b45,_0x54a119){_0x8f2b45=_0x8f2b45-0x0;var _0x664c5c=_0xaa46[_0x8f2b45];return _0x664c5c;};'use strict';var Sequelize=require(_0x6aa4('0x0'));module[_0x6aa4('0x1')]={'type':{'type':Sequelize[_0x6aa4('0x2')](_0x6aa4('0x3'),_0x6aa4('0x4'),'customVariable',_0x6aa4('0x5'),_0x6aa4('0x6')),'defaultValue':_0x6aa4('0x3')},'content':{'type':Sequelize[_0x6aa4('0x7')]},'key':{'type':Sequelize[_0x6aa4('0x7')]},'keyType':{'type':Sequelize[_0x6aa4('0x2')](_0x6aa4('0x3'),_0x6aa4('0x4'),_0x6aa4('0x8'))},'keyContent':{'type':Sequelize[_0x6aa4('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6aa4('0x7')]},'customField':{'type':Sequelize[_0x6aa4('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6aa4('0x7')]}}; \ No newline at end of file +var _0xf99b=['BOOLEAN','sequelize','ENUM','string','variable','keyValue','picklist','STRING','customVariable'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xf99b,0x1cc));var _0xbf99=function(_0xac0472,_0x58b19f){_0xac0472=_0xac0472-0x0;var _0x524e67=_0xf99b[_0xac0472];return _0x524e67;};'use strict';var Sequelize=require(_0xbf99('0x0'));module['exports']={'type':{'type':Sequelize[_0xbf99('0x1')](_0xbf99('0x2'),_0xbf99('0x3'),'customVariable',_0xbf99('0x4'),_0xbf99('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xbf99('0x6')]},'key':{'type':Sequelize[_0xbf99('0x6')]},'keyType':{'type':Sequelize[_0xbf99('0x1')]('string',_0xbf99('0x3'),_0xbf99('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xbf99('0x6')]},'customField':{'type':Sequelize[_0xbf99('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbf99('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index f71dc94..0b567f3 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 _0xebf5=['squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','ZohoField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash'];(function(_0x40803e,_0x336e8f){var _0x369326=function(_0x5267a3){while(--_0x5267a3){_0x40803e['push'](_0x40803e['shift']());}};_0x369326(++_0x336e8f);}(_0xebf5,0x1ab));var _0x5ebf=function(_0x1936f6,_0x47a125){_0x1936f6=_0x1936f6-0x0;var _0x32e727=_0xebf5[_0x1936f6];return _0x32e727;};'use strict';var emlformat=require(_0x5ebf('0x0'));var rimraf=require(_0x5ebf('0x1'));var zipdir=require(_0x5ebf('0x2'));var jsonpatch=require(_0x5ebf('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5ebf('0x4'));var Mustache=require(_0x5ebf('0x5'));var util=require(_0x5ebf('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x5ebf('0x7'));var ejs=require(_0x5ebf('0x8'));var fs=require('fs');var fs_extra=require(_0x5ebf('0x9'));var _=require(_0x5ebf('0xa'));var squel=require(_0x5ebf('0xb'));var crypto=require('crypto');var jsforce=require(_0x5ebf('0xc'));var deskjs=require(_0x5ebf('0xd'));var toCsv=require(_0x5ebf('0x7'));var querystring=require(_0x5ebf('0xe'));var Papa=require(_0x5ebf('0xf'));var Redis=require(_0x5ebf('0x10'));var authService=require(_0x5ebf('0x11'));var qs=require(_0x5ebf('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ebf('0x13'));var logger=require('../../config/logger')(_0x5ebf('0x14'));var utils=require(_0x5ebf('0x15'));var config=require(_0x5ebf('0x16'));var licenseUtil=require(_0x5ebf('0x17'));var db=require(_0x5ebf('0x18'))['db'];function respondWithStatusCode(_0x55663d,_0x5b63fe){_0x5b63fe=_0x5b63fe||0xcc;return function(_0x1a2e63){if(_0x1a2e63){return _0x55663d['sendStatus'](_0x5b63fe);}return _0x55663d['status'](_0x5b63fe)[_0x5ebf('0x19')]();};}function respondWithResult(_0x261417,_0x5846d6){_0x5846d6=_0x5846d6||0xc8;return function(_0x3c850a){if(_0x3c850a){return _0x261417[_0x5ebf('0x1a')](_0x5846d6)[_0x5ebf('0x1b')](_0x3c850a);}};}function respondWithFilteredResult(_0x8c795f,_0x14598b){return function(_0x533f46){if(_0x533f46){var _0x431f8c=typeof _0x14598b[_0x5ebf('0x1c')]===_0x5ebf('0x1d')&&typeof _0x14598b[_0x5ebf('0x1e')]===_0x5ebf('0x1d');var _0x1c530e=_0x533f46[_0x5ebf('0x1f')];var _0x90dc32=_0x431f8c?0x0:_0x14598b[_0x5ebf('0x1c')];var _0x340a23=_0x431f8c?_0x533f46[_0x5ebf('0x1f')]:_0x14598b[_0x5ebf('0x1c')]+_0x14598b[_0x5ebf('0x1e')];var _0x54c5b2;if(_0x340a23>=_0x1c530e){_0x340a23=_0x1c530e;_0x54c5b2=0xc8;}else{_0x54c5b2=0xce;}_0x8c795f[_0x5ebf('0x1a')](_0x54c5b2);return _0x8c795f[_0x5ebf('0x20')](_0x5ebf('0x21'),_0x90dc32+'-'+_0x340a23+'/'+_0x1c530e)[_0x5ebf('0x1b')](_0x533f46);}return null;};}function patchUpdates(_0x59ffd4){return function(_0x430bb5){try{jsonpatch[_0x5ebf('0x22')](_0x430bb5,_0x59ffd4,!![]);}catch(_0x3decf3){return BPromise['reject'](_0x3decf3);}return _0x430bb5[_0x5ebf('0x23')]();};}function saveUpdates(_0x4ff40d,_0x5b7d96){return function(_0x5a6f5b){if(_0x5a6f5b){return _0x5a6f5b[_0x5ebf('0x24')](_0x4ff40d)[_0x5ebf('0x25')](function(_0x42035d){return _0x42035d;});}return null;};}function removeEntity(_0x142896,_0x44b959){return function(_0x33ae7b){if(_0x33ae7b){return _0x33ae7b[_0x5ebf('0x26')]()[_0x5ebf('0x25')](function(){_0x142896['status'](0xcc)[_0x5ebf('0x19')]();});}};}function handleEntityNotFound(_0x31e8c7,_0x2d3411){return function(_0x2821bf){if(!_0x2821bf){_0x31e8c7['sendStatus'](0x194);}return _0x2821bf;};}function handleError(_0x1b64f5,_0x40d410){_0x40d410=_0x40d410||0x1f4;return function(_0x1338e8){logger[_0x5ebf('0x27')](_0x1338e8[_0x5ebf('0x28')]);if(_0x1338e8[_0x5ebf('0x29')]){delete _0x1338e8[_0x5ebf('0x29')];}_0x1b64f5[_0x5ebf('0x1a')](_0x40d410)[_0x5ebf('0x2a')](_0x1338e8);};}exports['index']=function(_0x47520b,_0xea454e){var _0x2f2de9={},_0x3d79b8={},_0x18971c={'count':0x0,'rows':[]};var _0x66b177=_[_0x5ebf('0x2b')](db[_0x5ebf('0x2c')][_0x5ebf('0x2d')],function(_0xf7eb96){return{'name':_0xf7eb96[_0x5ebf('0x2e')],'type':_0xf7eb96['type'][_0x5ebf('0x2f')]};});_0x3d79b8[_0x5ebf('0x30')]=_['map'](_0x66b177,_0x5ebf('0x29'));_0x3d79b8[_0x5ebf('0x31')]=_[_0x5ebf('0x32')](_0x47520b['query']);_0x3d79b8[_0x5ebf('0x33')]=_[_0x5ebf('0x34')](_0x3d79b8[_0x5ebf('0x30')],_0x3d79b8[_0x5ebf('0x31')]);_0x2f2de9[_0x5ebf('0x35')]=_[_0x5ebf('0x34')](_0x3d79b8[_0x5ebf('0x30')],qs[_0x5ebf('0x36')](_0x47520b['query'][_0x5ebf('0x36')]));_0x2f2de9[_0x5ebf('0x35')]=_0x2f2de9[_0x5ebf('0x35')][_0x5ebf('0x37')]?_0x2f2de9[_0x5ebf('0x35')]:_0x3d79b8[_0x5ebf('0x30')];if(!_0x47520b['query']['hasOwnProperty']('nolimit')){_0x2f2de9['limit']=qs[_0x5ebf('0x1e')](_0x47520b['query'][_0x5ebf('0x1e')]);_0x2f2de9['offset']=qs['offset'](_0x47520b[_0x5ebf('0x31')]['offset']);}_0x2f2de9[_0x5ebf('0x38')]=qs[_0x5ebf('0x39')](_0x47520b[_0x5ebf('0x31')][_0x5ebf('0x39')]);_0x2f2de9[_0x5ebf('0x3a')]=qs[_0x5ebf('0x33')](_['pick'](_0x47520b[_0x5ebf('0x31')],_0x3d79b8[_0x5ebf('0x33')]),_0x66b177);if(_0x47520b[_0x5ebf('0x31')]['filter']){_0x2f2de9[_0x5ebf('0x3a')]=_['merge'](_0x2f2de9[_0x5ebf('0x3a')],{'$or':_['map'](_0x66b177,function(_0x13d82e){if(_0x13d82e[_0x5ebf('0x3b')]!==_0x5ebf('0x3c')){var _0x52cedf={};_0x52cedf[_0x13d82e[_0x5ebf('0x29')]]={'$like':'%'+_0x47520b[_0x5ebf('0x31')][_0x5ebf('0x3d')]+'%'};return _0x52cedf;}})});}_0x2f2de9=_[_0x5ebf('0x3e')]({},_0x2f2de9,_0x47520b[_0x5ebf('0x3f')]);var _0x23981b={'where':_0x2f2de9['where']};return db[_0x5ebf('0x2c')][_0x5ebf('0x1f')](_0x23981b)['then'](function(_0x347f66){_0x18971c['count']=_0x347f66;if(_0x47520b['query'][_0x5ebf('0x40')]){_0x2f2de9[_0x5ebf('0x41')]=[{'all':!![]}];}return db[_0x5ebf('0x2c')]['findAll'](_0x2f2de9);})[_0x5ebf('0x25')](function(_0x317fed){_0x18971c[_0x5ebf('0x42')]=_0x317fed;return _0x18971c;})[_0x5ebf('0x25')](respondWithFilteredResult(_0xea454e,_0x2f2de9))[_0x5ebf('0x43')](handleError(_0xea454e,null));};exports[_0x5ebf('0x44')]=function(_0x4b4863,_0x2f25a3){var _0x464cf9={'raw':!![],'where':{'id':_0x4b4863[_0x5ebf('0x45')]['id']}},_0x14c6ea={};_0x14c6ea['model']=_[_0x5ebf('0x32')](db[_0x5ebf('0x2c')][_0x5ebf('0x2d')]);_0x14c6ea[_0x5ebf('0x31')]=_['keys'](_0x4b4863[_0x5ebf('0x31')]);_0x14c6ea[_0x5ebf('0x33')]=_[_0x5ebf('0x34')](_0x14c6ea['model'],_0x14c6ea[_0x5ebf('0x31')]);_0x464cf9[_0x5ebf('0x35')]=_['intersection'](_0x14c6ea['model'],qs[_0x5ebf('0x36')](_0x4b4863[_0x5ebf('0x31')][_0x5ebf('0x36')]));_0x464cf9[_0x5ebf('0x35')]=_0x464cf9[_0x5ebf('0x35')][_0x5ebf('0x37')]?_0x464cf9['attributes']:_0x14c6ea[_0x5ebf('0x30')];if(_0x4b4863[_0x5ebf('0x31')][_0x5ebf('0x40')]){_0x464cf9['include']=[{'all':!![]}];}_0x464cf9=_[_0x5ebf('0x3e')]({},_0x464cf9,_0x4b4863[_0x5ebf('0x3f')]);return db[_0x5ebf('0x2c')][_0x5ebf('0x46')](_0x464cf9)[_0x5ebf('0x25')](handleEntityNotFound(_0x2f25a3,null))[_0x5ebf('0x25')](respondWithResult(_0x2f25a3,null))[_0x5ebf('0x43')](handleError(_0x2f25a3,null));};exports[_0x5ebf('0x47')]=function(_0x56c312,_0x14e062){return db['ZohoField']['create'](_0x56c312[_0x5ebf('0x48')],{})[_0x5ebf('0x25')](respondWithResult(_0x14e062,0xc9))['catch'](handleError(_0x14e062,null));};exports['update']=function(_0x3e296c,_0x33b1e0){if(_0x3e296c[_0x5ebf('0x48')]['id']){delete _0x3e296c['body']['id'];}return db[_0x5ebf('0x2c')][_0x5ebf('0x46')]({'where':{'id':_0x3e296c['params']['id']}})[_0x5ebf('0x25')](handleEntityNotFound(_0x33b1e0,null))['then'](saveUpdates(_0x3e296c[_0x5ebf('0x48')],null))[_0x5ebf('0x25')](respondWithResult(_0x33b1e0,null))[_0x5ebf('0x43')](handleError(_0x33b1e0,null));};exports[_0x5ebf('0x26')]=function(_0x3668de,_0x36c341){return db[_0x5ebf('0x2c')]['find']({'where':{'id':_0x3668de[_0x5ebf('0x45')]['id']}})[_0x5ebf('0x25')](handleEntityNotFound(_0x36c341,null))[_0x5ebf('0x25')](removeEntity(_0x36c341,null))[_0x5ebf('0x43')](handleError(_0x36c341,null));}; \ No newline at end of file +var _0xaeff=['send','map','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','ZohoField','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','fs-extra','squel','desk.js','to-csv','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','set','apply','reject','save','then','destroy','sendStatus','error','stack','name'];(function(_0x3840e4,_0x24d215){var _0x4eae9f=function(_0x299e55){while(--_0x299e55){_0x3840e4['push'](_0x3840e4['shift']());}};_0x4eae9f(++_0x24d215);}(_0xaeff,0x179));var _0xfaef=function(_0x3ccede,_0x1585bf){_0x3ccede=_0x3ccede-0x0;var _0x20c175=_0xaeff[_0x3ccede];return _0x20c175;};'use strict';var emlformat=require(_0xfaef('0x0'));var rimraf=require(_0xfaef('0x1'));var zipdir=require(_0xfaef('0x2'));var jsonpatch=require(_0xfaef('0x3'));var rp=require(_0xfaef('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfaef('0x5'));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(_0xfaef('0x6'));var _=require('lodash');var squel=require(_0xfaef('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfaef('0x8'));var toCsv=require(_0xfaef('0x9'));var querystring=require(_0xfaef('0xa'));var Papa=require(_0xfaef('0xb'));var Redis=require('ioredis');var authService=require(_0xfaef('0xc'));var qs=require(_0xfaef('0xd'));var as=require(_0xfaef('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfaef('0xf'))(_0xfaef('0x10'));var utils=require(_0xfaef('0x11'));var config=require(_0xfaef('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xfaef('0x13'))['db'];function respondWithStatusCode(_0x1d0f5c,_0x11503c){_0x11503c=_0x11503c||0xcc;return function(_0x37da48){if(_0x37da48){return _0x1d0f5c['sendStatus'](_0x11503c);}return _0x1d0f5c[_0xfaef('0x14')](_0x11503c)[_0xfaef('0x15')]();};}function respondWithResult(_0x26f261,_0x4c4177){_0x4c4177=_0x4c4177||0xc8;return function(_0x580eeb){if(_0x580eeb){return _0x26f261[_0xfaef('0x14')](_0x4c4177)[_0xfaef('0x16')](_0x580eeb);}};}function respondWithFilteredResult(_0xa54b7b,_0x7fa963){return function(_0x46cb97){if(_0x46cb97){var _0x595cfe=typeof _0x7fa963[_0xfaef('0x17')]===_0xfaef('0x18')&&typeof _0x7fa963[_0xfaef('0x19')]===_0xfaef('0x18');var _0xb8590e=_0x46cb97['count'];var _0x1a3db7=_0x595cfe?0x0:_0x7fa963[_0xfaef('0x17')];var _0xa7e3b4=_0x595cfe?_0x46cb97[_0xfaef('0x1a')]:_0x7fa963[_0xfaef('0x17')]+_0x7fa963[_0xfaef('0x19')];var _0x28e043;if(_0xa7e3b4>=_0xb8590e){_0xa7e3b4=_0xb8590e;_0x28e043=0xc8;}else{_0x28e043=0xce;}_0xa54b7b['status'](_0x28e043);return _0xa54b7b[_0xfaef('0x1b')]('Content-Range',_0x1a3db7+'-'+_0xa7e3b4+'/'+_0xb8590e)['json'](_0x46cb97);}return null;};}function patchUpdates(_0x4725bd){return function(_0x3b2238){try{jsonpatch[_0xfaef('0x1c')](_0x3b2238,_0x4725bd,!![]);}catch(_0x326ea0){return BPromise[_0xfaef('0x1d')](_0x326ea0);}return _0x3b2238[_0xfaef('0x1e')]();};}function saveUpdates(_0x213d94,_0x90e2b){return function(_0x27010c){if(_0x27010c){return _0x27010c['update'](_0x213d94)[_0xfaef('0x1f')](function(_0x21795e){return _0x21795e;});}return null;};}function removeEntity(_0x1835ae,_0x49928c){return function(_0x39d4b4){if(_0x39d4b4){return _0x39d4b4[_0xfaef('0x20')]()['then'](function(){_0x1835ae['status'](0xcc)[_0xfaef('0x15')]();});}};}function handleEntityNotFound(_0x2cca4f,_0x53c98e){return function(_0x18b3f3){if(!_0x18b3f3){_0x2cca4f[_0xfaef('0x21')](0x194);}return _0x18b3f3;};}function handleError(_0x3e0051,_0x48963c){_0x48963c=_0x48963c||0x1f4;return function(_0x2b84c6){logger[_0xfaef('0x22')](_0x2b84c6[_0xfaef('0x23')]);if(_0x2b84c6[_0xfaef('0x24')]){delete _0x2b84c6[_0xfaef('0x24')];}_0x3e0051[_0xfaef('0x14')](_0x48963c)[_0xfaef('0x25')](_0x2b84c6);};}exports['index']=function(_0x4604db,_0x51b0d5){var _0x2b2360={},_0x230723={},_0x21a1ff={'count':0x0,'rows':[]};var _0x50ab33=_[_0xfaef('0x26')](db['ZohoField']['rawAttributes'],function(_0x5817d6){return{'name':_0x5817d6[_0xfaef('0x27')],'type':_0x5817d6[_0xfaef('0x28')]['key']};});_0x230723[_0xfaef('0x29')]=_[_0xfaef('0x26')](_0x50ab33,_0xfaef('0x24'));_0x230723['query']=_['keys'](_0x4604db[_0xfaef('0x2a')]);_0x230723['filters']=_[_0xfaef('0x2b')](_0x230723[_0xfaef('0x29')],_0x230723[_0xfaef('0x2a')]);_0x2b2360[_0xfaef('0x2c')]=_['intersection'](_0x230723[_0xfaef('0x29')],qs[_0xfaef('0x2d')](_0x4604db['query']['fields']));_0x2b2360[_0xfaef('0x2c')]=_0x2b2360[_0xfaef('0x2c')][_0xfaef('0x2e')]?_0x2b2360[_0xfaef('0x2c')]:_0x230723[_0xfaef('0x29')];if(!_0x4604db[_0xfaef('0x2a')][_0xfaef('0x2f')](_0xfaef('0x30'))){_0x2b2360[_0xfaef('0x19')]=qs[_0xfaef('0x19')](_0x4604db[_0xfaef('0x2a')][_0xfaef('0x19')]);_0x2b2360['offset']=qs[_0xfaef('0x17')](_0x4604db['query'][_0xfaef('0x17')]);}_0x2b2360[_0xfaef('0x31')]=qs[_0xfaef('0x32')](_0x4604db['query'][_0xfaef('0x32')]);_0x2b2360[_0xfaef('0x33')]=qs[_0xfaef('0x34')](_['pick'](_0x4604db[_0xfaef('0x2a')],_0x230723[_0xfaef('0x34')]),_0x50ab33);if(_0x4604db['query'][_0xfaef('0x35')]){_0x2b2360[_0xfaef('0x33')]=_[_0xfaef('0x36')](_0x2b2360[_0xfaef('0x33')],{'$or':_[_0xfaef('0x26')](_0x50ab33,function(_0x17af03){if(_0x17af03['type']!=='VIRTUAL'){var _0x3246c1={};_0x3246c1[_0x17af03[_0xfaef('0x24')]]={'$like':'%'+_0x4604db[_0xfaef('0x2a')][_0xfaef('0x35')]+'%'};return _0x3246c1;}})});}_0x2b2360=_[_0xfaef('0x36')]({},_0x2b2360,_0x4604db[_0xfaef('0x37')]);var _0x12e498={'where':_0x2b2360['where']};return db[_0xfaef('0x38')][_0xfaef('0x1a')](_0x12e498)[_0xfaef('0x1f')](function(_0x2f0035){_0x21a1ff[_0xfaef('0x1a')]=_0x2f0035;if(_0x4604db[_0xfaef('0x2a')][_0xfaef('0x39')]){_0x2b2360[_0xfaef('0x3a')]=[{'all':!![]}];}return db[_0xfaef('0x38')][_0xfaef('0x3b')](_0x2b2360);})[_0xfaef('0x1f')](function(_0xd01e93){_0x21a1ff[_0xfaef('0x3c')]=_0xd01e93;return _0x21a1ff;})[_0xfaef('0x1f')](respondWithFilteredResult(_0x51b0d5,_0x2b2360))[_0xfaef('0x3d')](handleError(_0x51b0d5,null));};exports[_0xfaef('0x3e')]=function(_0x1ea185,_0x7268cf){var _0x5717de={'raw':!![],'where':{'id':_0x1ea185[_0xfaef('0x3f')]['id']}},_0x1da8f4={};_0x1da8f4[_0xfaef('0x29')]=_[_0xfaef('0x40')](db[_0xfaef('0x38')][_0xfaef('0x41')]);_0x1da8f4['query']=_[_0xfaef('0x40')](_0x1ea185[_0xfaef('0x2a')]);_0x1da8f4[_0xfaef('0x34')]=_['intersection'](_0x1da8f4[_0xfaef('0x29')],_0x1da8f4[_0xfaef('0x2a')]);_0x5717de[_0xfaef('0x2c')]=_['intersection'](_0x1da8f4[_0xfaef('0x29')],qs[_0xfaef('0x2d')](_0x1ea185[_0xfaef('0x2a')][_0xfaef('0x2d')]));_0x5717de['attributes']=_0x5717de[_0xfaef('0x2c')]['length']?_0x5717de[_0xfaef('0x2c')]:_0x1da8f4['model'];if(_0x1ea185[_0xfaef('0x2a')][_0xfaef('0x39')]){_0x5717de['include']=[{'all':!![]}];}_0x5717de=_[_0xfaef('0x36')]({},_0x5717de,_0x1ea185[_0xfaef('0x37')]);return db[_0xfaef('0x38')]['find'](_0x5717de)['then'](handleEntityNotFound(_0x7268cf,null))[_0xfaef('0x1f')](respondWithResult(_0x7268cf,null))[_0xfaef('0x3d')](handleError(_0x7268cf,null));};exports[_0xfaef('0x42')]=function(_0x596fbf,_0x3850d7){return db[_0xfaef('0x38')][_0xfaef('0x42')](_0x596fbf[_0xfaef('0x43')],{})[_0xfaef('0x1f')](respondWithResult(_0x3850d7,0xc9))['catch'](handleError(_0x3850d7,null));};exports['update']=function(_0x526907,_0x5cbe48){if(_0x526907[_0xfaef('0x43')]['id']){delete _0x526907['body']['id'];}return db['ZohoField'][_0xfaef('0x44')]({'where':{'id':_0x526907[_0xfaef('0x3f')]['id']}})[_0xfaef('0x1f')](handleEntityNotFound(_0x5cbe48,null))[_0xfaef('0x1f')](saveUpdates(_0x526907[_0xfaef('0x43')],null))[_0xfaef('0x1f')](respondWithResult(_0x5cbe48,null))[_0xfaef('0x3d')](handleError(_0x5cbe48,null));};exports[_0xfaef('0x20')]=function(_0x9542bf,_0x115c56){return db[_0xfaef('0x38')][_0xfaef('0x44')]({'where':{'id':_0x9542bf[_0xfaef('0x3f')]['id']}})[_0xfaef('0x1f')](handleEntityNotFound(_0x115c56,null))[_0xfaef('0x1f')](removeEntity(_0x115c56,null))[_0xfaef('0x3d')](handleError(_0x115c56,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index a619a47..dab8f74 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 _0xc2c7=['bluebird','request-promise','path','rimraf','exports','zoho_unique_index','idField','FieldId','util','../../config/logger','api','moment'];(function(_0x5db59c,_0x11cc79){var _0x2a1f41=function(_0x35cfa4){while(--_0x35cfa4){_0x5db59c['push'](_0x5db59c['shift']());}};_0x2a1f41(++_0x11cc79);}(_0xc2c7,0x134));var _0x7c2c=function(_0x1dbda8,_0x1ee36a){_0x1dbda8=_0x1dbda8-0x0;var _0x34aa15=_0xc2c7[_0x1dbda8];return _0x34aa15;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var logger=require(_0x7c2c('0x1'))(_0x7c2c('0x2'));var moment=require(_0x7c2c('0x3'));var BPromise=require(_0x7c2c('0x4'));var rp=require(_0x7c2c('0x5'));var fs=require('fs');var path=require(_0x7c2c('0x6'));var rimraf=require(_0x7c2c('0x7'));var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module[_0x7c2c('0x8')]=function(_0x42ecc9,_0x23c038){return _0x42ecc9['define']('ZohoField',attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x7c2c('0x9'),'fields':[_0x7c2c('0xa'),_0x7c2c('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x01d9=['define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var logger=require(_0x901d('0x2'))(_0x901d('0x3'));var moment=require('moment');var BPromise=require(_0x901d('0x4'));var rp=require(_0x901d('0x5'));var fs=require('fs');var path=require(_0x901d('0x6'));var rimraf=require(_0x901d('0x7'));var config=require(_0x901d('0x8'));var attributes=require(_0x901d('0x9'));module[_0x901d('0xa')]=function(_0x4e7842,_0x1e5d7d){return _0x4e7842[_0x901d('0xb')](_0x901d('0xc'),attributes,{'tableName':_0x901d('0xd'),'paranoid':![],'indexes':[{'name':_0x901d('0xe'),'fields':[_0x901d('0xf'),_0x901d('0x10')],'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 0fbc751..0c36975 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 _0x3c8a=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','ZohoField,\x20%s,\x20%s','message','result'];(function(_0x2c4ba3,_0x55dc5e){var _0x4b5d70=function(_0xea8837){while(--_0xea8837){_0x2c4ba3['push'](_0x2c4ba3['shift']());}};_0x4b5d70(++_0x55dc5e);}(_0x3c8a,0x1e3));var _0xa3c8=function(_0x6c9b2c,_0x2e1e98){_0x6c9b2c=_0x6c9b2c-0x0;var _0x2dbb9c=_0x3c8a[_0x6c9b2c];return _0x2dbb9c;};'use strict';var _=require(_0xa3c8('0x0'));var util=require(_0xa3c8('0x1'));var moment=require('moment');var BPromise=require(_0xa3c8('0x2'));var rs=require(_0xa3c8('0x3'));var fs=require('fs');var Redis=require(_0xa3c8('0x4'));var db=require(_0xa3c8('0x5'))['db'];var utils=require(_0xa3c8('0x6'));var logger=require(_0xa3c8('0x7'))(_0xa3c8('0x8'));var config=require(_0xa3c8('0x9'));var jayson=require(_0xa3c8('0xa'));var client=jayson[_0xa3c8('0xb')][_0xa3c8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4bd479,_0x549752,_0x5a7aec){return new BPromise(function(_0x2c14d3,_0xd3f1bc){return client['request'](_0x4bd479,_0x5a7aec)[_0xa3c8('0xd')](function(_0x39b98e){logger[_0xa3c8('0xe')]('ZohoField,\x20%s,\x20%s',_0x549752,_0xa3c8('0xf'));logger[_0xa3c8('0x10')](_0xa3c8('0x11'),_0x549752,_0xa3c8('0xf'),JSON['stringify'](_0x39b98e));if(_0x39b98e[_0xa3c8('0x12')]){if(_0x39b98e[_0xa3c8('0x12')][_0xa3c8('0x13')]===0x1f4){logger[_0xa3c8('0x12')](_0xa3c8('0x14'),_0x549752,_0x39b98e[_0xa3c8('0x12')][_0xa3c8('0x15')]);return _0xd3f1bc(_0x39b98e[_0xa3c8('0x12')]['message']);}logger[_0xa3c8('0x12')](_0xa3c8('0x14'),_0x549752,_0x39b98e[_0xa3c8('0x12')][_0xa3c8('0x15')]);return _0x2c14d3(_0x39b98e[_0xa3c8('0x12')]['message']);}else{logger['info'](_0xa3c8('0x14'),_0x549752,_0xa3c8('0xf'));_0x2c14d3(_0x39b98e[_0xa3c8('0x16')]['message']);}})['catch'](function(_0x422d46){logger[_0xa3c8('0x12')]('ZohoField,\x20%s,\x20%s',_0x549752,_0x422d46);_0xd3f1bc(_0x422d46);});});} \ No newline at end of file +var _0x180a=['result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x15ea40,_0x5e8e26){var _0x36ae60=function(_0xe42f30){while(--_0xe42f30){_0x15ea40['push'](_0x15ea40['shift']());}};_0x36ae60(++_0x5e8e26);}(_0x180a,0x6f));var _0xa180=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x180a[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0xa180('0x0'));var util=require(_0xa180('0x1'));var moment=require(_0xa180('0x2'));var BPromise=require(_0xa180('0x3'));var rs=require(_0xa180('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa180('0x5'))['db'];var utils=require(_0xa180('0x6'));var logger=require(_0xa180('0x7'))(_0xa180('0x8'));var config=require(_0xa180('0x9'));var jayson=require(_0xa180('0xa'));var client=jayson['client'][_0xa180('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3973fa,_0x5dd467,_0x874d51){return new BPromise(function(_0x2a623a,_0x16a341){return client[_0xa180('0xc')](_0x3973fa,_0x874d51)['then'](function(_0x183297){logger['info'](_0xa180('0xd'),_0x5dd467,_0xa180('0xe'));logger[_0xa180('0xf')](_0xa180('0x10'),_0x5dd467,_0xa180('0xe'),JSON['stringify'](_0x183297));if(_0x183297[_0xa180('0x11')]){if(_0x183297[_0xa180('0x11')][_0xa180('0x12')]===0x1f4){logger[_0xa180('0x11')](_0xa180('0xd'),_0x5dd467,_0x183297[_0xa180('0x11')][_0xa180('0x13')]);return _0x16a341(_0x183297[_0xa180('0x11')]['message']);}logger[_0xa180('0x11')](_0xa180('0xd'),_0x5dd467,_0x183297[_0xa180('0x11')][_0xa180('0x13')]);return _0x2a623a(_0x183297[_0xa180('0x11')][_0xa180('0x13')]);}else{logger[_0xa180('0x14')](_0xa180('0xd'),_0x5dd467,_0xa180('0xe'));_0x2a623a(_0x183297[_0xa180('0x15')][_0xa180('0x13')]);}})['catch'](function(_0x3da382){logger[_0xa180('0x11')](_0xa180('0xd'),_0x5dd467,_0x3da382);_0x16a341(_0x3da382);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 581ae77..495b4a7 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(_0x50e98a,_0x4e87e1){var _0x346839=function(_0x5e0d91){while(--_0x5e0d91){_0x50e98a['push'](_0x50e98a['shift']());}};_0x346839(++_0x4e87e1);}(_0xe706,0xa3));var _0x6e70=function(_0x2db146,_0x509cc5){_0x2db146=_0x2db146-0x0;var _0x524bcb=_0xe706[_0x2db146];return _0x524bcb;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3b8306,_0x1e39a1){var _0x2060ac=function(_0x104ead){while(--_0x104ead){_0x3b8306['push'](_0x3b8306['shift']());}};_0x2060ac(++_0x1e39a1);}(_0x70e0,0x17b));var _0x070e=function(_0x49beef,_0x103b21){_0x49beef=_0x49beef-0x0;var _0x159000=_0x70e0[_0x49beef];return _0x159000;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index ca16312..5d7f55b 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 _0xd46e=['STRING','unique_name_and_version','INTEGER','BOOLEAN','state','sequelize'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xd46e,0x1a3));var _0xed46=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd46e[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xed46('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0xed46('0x1')],'allowNull':![],'unique':_0xed46('0x2')},'main':{'type':Sequelize[_0xed46('0x1')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0xed46('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xed46('0x1')]},'size':{'type':Sequelize[_0xed46('0x3')]},'active':{'type':Sequelize[_0xed46('0x4')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xed46('0x1')]},'state':{'type':Sequelize[_0xed46('0x1')],'unique':_0xed46('0x5')},'description':{'type':Sequelize[_0xed46('0x1')]},'title':{'type':Sequelize[_0xed46('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0xed46('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0xdaac=['app.js','INTEGER','BOOLEAN','sequelize','exports','STRING','unique_name_and_version'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdaac,0xf1));var _0xcdaa=function(_0x3e0dda,_0x358363){_0x3e0dda=_0x3e0dda-0x0;var _0x29976b=_0xdaac[_0x3e0dda];return _0x29976b;};'use strict';var Sequelize=require(_0xcdaa('0x0'));module[_0xcdaa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0xcdaa('0x2')],'allowNull':![],'unique':_0xcdaa('0x3')},'main':{'type':Sequelize[_0xcdaa('0x2')],'defaultValue':_0xcdaa('0x4')},'filename':{'type':Sequelize[_0xcdaa('0x2')]},'path':{'type':Sequelize[_0xcdaa('0x2')]},'type':{'type':Sequelize[_0xcdaa('0x2')]},'size':{'type':Sequelize[_0xcdaa('0x5')]},'active':{'type':Sequelize[_0xcdaa('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xcdaa('0x2')]},'logo':{'type':Sequelize[_0xcdaa('0x2')]},'state':{'type':Sequelize[_0xcdaa('0x2')],'unique':'state'},'description':{'type':Sequelize[_0xcdaa('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xcdaa('0x2')]},'link':{'type':Sequelize[_0xcdaa('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 926a092..c37256e 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 _0x430c=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','then','destroy','error','stack','name','send','index','Integration','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','update','find','eml-format','fast-json-patch','request-promise','moment','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x5b5f70,_0xc951e6){var _0x3affc7=function(_0x449708){while(--_0x449708){_0x5b5f70['push'](_0x5b5f70['shift']());}};_0x3affc7(++_0xc951e6);}(_0x430c,0x1a1));var _0xc430=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x430c[_0x5a9c0c];return _0x53c77d;};'use strict';var emlformat=require(_0xc430('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc430('0x1'));var rp=require(_0xc430('0x2'));var moment=require(_0xc430('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc430('0x4'));var csv=require(_0xc430('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc430('0x6'));var _=require('lodash');var squel=require(_0xc430('0x7'));var crypto=require(_0xc430('0x8'));var jsforce=require(_0xc430('0x9'));var deskjs=require(_0xc430('0xa'));var toCsv=require(_0xc430('0x5'));var querystring=require(_0xc430('0xb'));var Papa=require(_0xc430('0xc'));var Redis=require(_0xc430('0xd'));var authService=require(_0xc430('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc430('0xf'));var hardwareService=require(_0xc430('0x10'));var logger=require('../../config/logger')(_0xc430('0x11'));var utils=require('../../config/utils');var config=require(_0xc430('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc430('0x13'))['db'];function respondWithStatusCode(_0x8aa2e6,_0xc5f92){_0xc5f92=_0xc5f92||0xcc;return function(_0x1fb8ce){if(_0x1fb8ce){return _0x8aa2e6[_0xc430('0x14')](_0xc5f92);}return _0x8aa2e6[_0xc430('0x15')](_0xc5f92)[_0xc430('0x16')]();};}function respondWithResult(_0x54d851,_0x4e9134){_0x4e9134=_0x4e9134||0xc8;return function(_0x3f359c){if(_0x3f359c){return _0x54d851[_0xc430('0x15')](_0x4e9134)[_0xc430('0x17')](_0x3f359c);}};}function respondWithFilteredResult(_0x2ef538,_0x31d3b7){return function(_0x55cc6c){if(_0x55cc6c){var _0x111598=typeof _0x31d3b7['offset']==='undefined'&&typeof _0x31d3b7[_0xc430('0x18')]===_0xc430('0x19');var _0x2327c5=_0x55cc6c['count'];var _0x5d3acc=_0x111598?0x0:_0x31d3b7[_0xc430('0x1a')];var _0x4c1937=_0x111598?_0x55cc6c[_0xc430('0x1b')]:_0x31d3b7['offset']+_0x31d3b7['limit'];var _0x2f3203;if(_0x4c1937>=_0x2327c5){_0x4c1937=_0x2327c5;_0x2f3203=0xc8;}else{_0x2f3203=0xce;}_0x2ef538['status'](_0x2f3203);return _0x2ef538[_0xc430('0x1c')](_0xc430('0x1d'),_0x5d3acc+'-'+_0x4c1937+'/'+_0x2327c5)[_0xc430('0x17')](_0x55cc6c);}return null;};}function patchUpdates(_0x1f90bb){return function(_0x2a1ea1){try{jsonpatch['apply'](_0x2a1ea1,_0x1f90bb,!![]);}catch(_0x388a2f){return BPromise['reject'](_0x388a2f);}return _0x2a1ea1['save']();};}function saveUpdates(_0x3b7c3d,_0x2ea352){return function(_0x3c7afa){if(_0x3c7afa){return _0x3c7afa['update'](_0x3b7c3d)[_0xc430('0x1e')](function(_0x57d26e){return _0x57d26e;});}return null;};}function removeEntity(_0x23425d,_0x22ebfb){return function(_0x4efecd){if(_0x4efecd){return _0x4efecd[_0xc430('0x1f')]()[_0xc430('0x1e')](function(){_0x23425d['status'](0xcc)[_0xc430('0x16')]();});}};}function handleEntityNotFound(_0x59c498,_0x3aa85e){return function(_0x4b5280){if(!_0x4b5280){_0x59c498[_0xc430('0x14')](0x194);}return _0x4b5280;};}function handleError(_0x21e28a,_0x50110b){_0x50110b=_0x50110b||0x1f4;return function(_0x33433f){logger[_0xc430('0x20')](_0x33433f[_0xc430('0x21')]);if(_0x33433f[_0xc430('0x22')]){delete _0x33433f[_0xc430('0x22')];}_0x21e28a['status'](_0x50110b)[_0xc430('0x23')](_0x33433f);};}exports[_0xc430('0x24')]=function(_0x1c1da9,_0x1591e3){var _0x542cba={},_0x1f8086={},_0x4cf56c={'count':0x0,'rows':[]};var _0x1d65ee=_['map'](db[_0xc430('0x25')][_0xc430('0x26')],function(_0xfc8767){return{'name':_0xfc8767[_0xc430('0x27')],'type':_0xfc8767['type'][_0xc430('0x28')]};});_0x1f8086[_0xc430('0x29')]=_[_0xc430('0x2a')](_0x1d65ee,_0xc430('0x22'));_0x1f8086['query']=_[_0xc430('0x2b')](_0x1c1da9[_0xc430('0x2c')]);_0x1f8086['filters']=_[_0xc430('0x2d')](_0x1f8086['model'],_0x1f8086['query']);_0x542cba[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x1f8086[_0xc430('0x29')],qs[_0xc430('0x2f')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x2f')]));_0x542cba[_0xc430('0x2e')]=_0x542cba[_0xc430('0x2e')]['length']?_0x542cba[_0xc430('0x2e')]:_0x1f8086['model'];if(!_0x1c1da9[_0xc430('0x2c')][_0xc430('0x30')](_0xc430('0x31'))){_0x542cba[_0xc430('0x18')]=qs['limit'](_0x1c1da9[_0xc430('0x2c')]['limit']);_0x542cba['offset']=qs[_0xc430('0x1a')](_0x1c1da9[_0xc430('0x2c')]['offset']);}_0x542cba[_0xc430('0x32')]=qs[_0xc430('0x33')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x33')]);_0x542cba[_0xc430('0x34')]=qs[_0xc430('0x35')](_[_0xc430('0x36')](_0x1c1da9[_0xc430('0x2c')],_0x1f8086[_0xc430('0x35')]),_0x1d65ee);if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x37')]){_0x542cba[_0xc430('0x34')]=_[_0xc430('0x38')](_0x542cba[_0xc430('0x34')],{'$or':_[_0xc430('0x2a')](_0x1d65ee,function(_0x537e4c){if(_0x537e4c[_0xc430('0x39')]!==_0xc430('0x3a')){var _0x24363b={};_0x24363b[_0x537e4c[_0xc430('0x22')]]={'$like':'%'+_0x1c1da9['query'][_0xc430('0x37')]+'%'};return _0x24363b;}})});}_0x542cba=_[_0xc430('0x38')]({},_0x542cba,_0x1c1da9[_0xc430('0x3b')]);var _0x45b3dc={'where':_0x542cba[_0xc430('0x34')]};return db[_0xc430('0x25')]['count'](_0x45b3dc)[_0xc430('0x1e')](function(_0x348f2f){_0x4cf56c[_0xc430('0x1b')]=_0x348f2f;if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x3c')]){_0x542cba[_0xc430('0x3d')]=[{'all':!![]}];}return db[_0xc430('0x25')][_0xc430('0x3e')](_0x542cba);})[_0xc430('0x1e')](function(_0x4174d2){_0x4cf56c[_0xc430('0x3f')]=_0x4174d2;return _0x4cf56c;})[_0xc430('0x1e')](respondWithFilteredResult(_0x1591e3,_0x542cba))[_0xc430('0x40')](handleError(_0x1591e3,null));};exports[_0xc430('0x41')]=function(_0x5a9c4b,_0x47edb0){var _0x4983e0={'raw':![],'where':{'id':_0x5a9c4b[_0xc430('0x42')]['id']}},_0x262063={};_0x262063[_0xc430('0x29')]=_[_0xc430('0x2b')](db[_0xc430('0x25')][_0xc430('0x26')]);_0x262063[_0xc430('0x2c')]=_[_0xc430('0x2b')](_0x5a9c4b[_0xc430('0x2c')]);_0x262063[_0xc430('0x35')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],_0x262063[_0xc430('0x2c')]);_0x4983e0[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],qs['fields'](_0x5a9c4b[_0xc430('0x2c')][_0xc430('0x2f')]));_0x4983e0[_0xc430('0x2e')]=_0x4983e0[_0xc430('0x2e')][_0xc430('0x43')]?_0x4983e0[_0xc430('0x2e')]:_0x262063[_0xc430('0x29')];if(_0x5a9c4b[_0xc430('0x2c')]['includeAll']){_0x4983e0[_0xc430('0x3d')]=[{'all':!![]}];}_0x4983e0=_['merge']({},_0x4983e0,_0x5a9c4b[_0xc430('0x3b')]);return db[_0xc430('0x25')]['find'](_0x4983e0)['then'](handleEntityNotFound(_0x47edb0,null))[_0xc430('0x1e')](respondWithResult(_0x47edb0,null))['catch'](handleError(_0x47edb0,null));};exports['create']=function(_0x10db27,_0x4eafae){return db[_0xc430('0x25')][_0xc430('0x44')](_0x10db27[_0xc430('0x45')],{})['then'](respondWithResult(_0x4eafae,0xc9))[_0xc430('0x40')](handleError(_0x4eafae,null));};exports[_0xc430('0x46')]=function(_0x19e563,_0x549400){if(_0x19e563[_0xc430('0x45')]['id']){delete _0x19e563[_0xc430('0x45')]['id'];}return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x19e563[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x549400,null))[_0xc430('0x1e')](saveUpdates(_0x19e563['body'],null))[_0xc430('0x1e')](respondWithResult(_0x549400,null))[_0xc430('0x40')](handleError(_0x549400,null));};exports[_0xc430('0x1f')]=function(_0x4e9aff,_0x23cb41){return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x4e9aff[_0xc430('0x42')]['id']}})['then'](handleEntityNotFound(_0x23cb41,null))[_0xc430('0x1e')](removeEntity(_0x23cb41,null))['catch'](handleError(_0x23cb41,null));}; \ No newline at end of file +var _0x524e=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','destroy','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','Integration','then','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x524e,0x15e));var _0xe524=function(_0x12be1c,_0x52f39b){_0x12be1c=_0x12be1c-0x0;var _0x380df4=_0x524e[_0x12be1c];return _0x380df4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];function respondWithStatusCode(_0x5077c1,_0x4b0f51){_0x4b0f51=_0x4b0f51||0xcc;return function(_0xfdc2a5){if(_0xfdc2a5){return _0x5077c1[_0xe524('0x1c')](_0x4b0f51);}return _0x5077c1[_0xe524('0x1d')](_0x4b0f51)[_0xe524('0x1e')]();};}function respondWithResult(_0x20a852,_0x57c1b6){_0x57c1b6=_0x57c1b6||0xc8;return function(_0x12ff75){if(_0x12ff75){return _0x20a852['status'](_0x57c1b6)[_0xe524('0x1f')](_0x12ff75);}};}function respondWithFilteredResult(_0x1b0af6,_0x48165e){return function(_0x569660){if(_0x569660){var _0x488fce=typeof _0x48165e[_0xe524('0x20')]==='undefined'&&typeof _0x48165e[_0xe524('0x21')]==='undefined';var _0x5c8736=_0x569660['count'];var _0x3a4027=_0x488fce?0x0:_0x48165e['offset'];var _0x11b2a1=_0x488fce?_0x569660[_0xe524('0x22')]:_0x48165e[_0xe524('0x20')]+_0x48165e[_0xe524('0x21')];var _0x5d7b17;if(_0x11b2a1>=_0x5c8736){_0x11b2a1=_0x5c8736;_0x5d7b17=0xc8;}else{_0x5d7b17=0xce;}_0x1b0af6[_0xe524('0x1d')](_0x5d7b17);return _0x1b0af6[_0xe524('0x23')]('Content-Range',_0x3a4027+'-'+_0x11b2a1+'/'+_0x5c8736)[_0xe524('0x1f')](_0x569660);}return null;};}function patchUpdates(_0x309f85){return function(_0x43a4f9){try{jsonpatch[_0xe524('0x24')](_0x43a4f9,_0x309f85,!![]);}catch(_0x1c4194){return BPromise[_0xe524('0x25')](_0x1c4194);}return _0x43a4f9[_0xe524('0x26')]();};}function saveUpdates(_0x375219,_0x7dfe97){return function(_0x5c4d21){if(_0x5c4d21){return _0x5c4d21[_0xe524('0x27')](_0x375219)['then'](function(_0x577d1f){return _0x577d1f;});}return null;};}function removeEntity(_0x2d2f83,_0x23df5e){return function(_0x1ad106){if(_0x1ad106){return _0x1ad106[_0xe524('0x28')]()['then'](function(){_0x2d2f83[_0xe524('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e245,_0xcf5db){return function(_0xd62772){if(!_0xd62772){_0x17e245[_0xe524('0x1c')](0x194);}return _0xd62772;};}function handleError(_0x4102d9,_0xfd5965){_0xfd5965=_0xfd5965||0x1f4;return function(_0x2141db){logger['error'](_0x2141db['stack']);if(_0x2141db[_0xe524('0x29')]){delete _0x2141db[_0xe524('0x29')];}_0x4102d9[_0xe524('0x1d')](_0xfd5965)[_0xe524('0x2a')](_0x2141db);};}exports[_0xe524('0x2b')]=function(_0x5405e4,_0x52f140){var _0x4b1ff={},_0x25e7a7={},_0x3aedd9={'count':0x0,'rows':[]};var _0x8070e4=_[_0xe524('0x2c')](db['Integration'][_0xe524('0x2d')],function(_0x9a7e98){return{'name':_0x9a7e98['fieldName'],'type':_0x9a7e98['type'][_0xe524('0x2e')]};});_0x25e7a7[_0xe524('0x2f')]=_['map'](_0x8070e4,_0xe524('0x29'));_0x25e7a7['query']=_[_0xe524('0x30')](_0x5405e4['query']);_0x25e7a7[_0xe524('0x31')]=_[_0xe524('0x32')](_0x25e7a7[_0xe524('0x2f')],_0x25e7a7['query']);_0x4b1ff[_0xe524('0x33')]=_['intersection'](_0x25e7a7[_0xe524('0x2f')],qs[_0xe524('0x34')](_0x5405e4[_0xe524('0x35')]['fields']));_0x4b1ff[_0xe524('0x33')]=_0x4b1ff[_0xe524('0x33')]['length']?_0x4b1ff[_0xe524('0x33')]:_0x25e7a7[_0xe524('0x2f')];if(!_0x5405e4[_0xe524('0x35')][_0xe524('0x36')]('nolimit')){_0x4b1ff[_0xe524('0x21')]=qs[_0xe524('0x21')](_0x5405e4[_0xe524('0x35')][_0xe524('0x21')]);_0x4b1ff[_0xe524('0x20')]=qs[_0xe524('0x20')](_0x5405e4[_0xe524('0x35')][_0xe524('0x20')]);}_0x4b1ff['order']=qs[_0xe524('0x37')](_0x5405e4['query'][_0xe524('0x37')]);_0x4b1ff[_0xe524('0x38')]=qs['filters'](_[_0xe524('0x39')](_0x5405e4['query'],_0x25e7a7[_0xe524('0x31')]),_0x8070e4);if(_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]){_0x4b1ff[_0xe524('0x38')]=_[_0xe524('0x3b')](_0x4b1ff[_0xe524('0x38')],{'$or':_[_0xe524('0x2c')](_0x8070e4,function(_0x13762c){if(_0x13762c['type']!==_0xe524('0x3c')){var _0x940c05={};_0x940c05[_0x13762c[_0xe524('0x29')]]={'$like':'%'+_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]+'%'};return _0x940c05;}})});}_0x4b1ff=_[_0xe524('0x3b')]({},_0x4b1ff,_0x5405e4[_0xe524('0x3d')]);var _0x158d45={'where':_0x4b1ff['where']};return db[_0xe524('0x3e')][_0xe524('0x22')](_0x158d45)[_0xe524('0x3f')](function(_0x59781b){_0x3aedd9[_0xe524('0x22')]=_0x59781b;if(_0x5405e4['query'][_0xe524('0x40')]){_0x4b1ff[_0xe524('0x41')]=[{'all':!![]}];}return db[_0xe524('0x3e')][_0xe524('0x42')](_0x4b1ff);})[_0xe524('0x3f')](function(_0x4746cd){_0x3aedd9[_0xe524('0x43')]=_0x4746cd;return _0x3aedd9;})['then'](respondWithFilteredResult(_0x52f140,_0x4b1ff))[_0xe524('0x44')](handleError(_0x52f140,null));};exports[_0xe524('0x45')]=function(_0x13c54c,_0x376505){var _0x438962={'raw':![],'where':{'id':_0x13c54c['params']['id']}},_0x1ae283={};_0x1ae283[_0xe524('0x2f')]=_[_0xe524('0x30')](db[_0xe524('0x3e')]['rawAttributes']);_0x1ae283[_0xe524('0x35')]=_['keys'](_0x13c54c['query']);_0x1ae283[_0xe524('0x31')]=_[_0xe524('0x32')](_0x1ae283['model'],_0x1ae283[_0xe524('0x35')]);_0x438962[_0xe524('0x33')]=_[_0xe524('0x32')](_0x1ae283[_0xe524('0x2f')],qs['fields'](_0x13c54c['query'][_0xe524('0x34')]));_0x438962[_0xe524('0x33')]=_0x438962['attributes'][_0xe524('0x46')]?_0x438962['attributes']:_0x1ae283[_0xe524('0x2f')];if(_0x13c54c[_0xe524('0x35')][_0xe524('0x40')]){_0x438962[_0xe524('0x41')]=[{'all':!![]}];}_0x438962=_[_0xe524('0x3b')]({},_0x438962,_0x13c54c[_0xe524('0x3d')]);return db[_0xe524('0x3e')][_0xe524('0x47')](_0x438962)[_0xe524('0x3f')](handleEntityNotFound(_0x376505,null))[_0xe524('0x3f')](respondWithResult(_0x376505,null))[_0xe524('0x44')](handleError(_0x376505,null));};exports[_0xe524('0x48')]=function(_0x3d7ab7,_0x33b1c8){return db[_0xe524('0x3e')]['create'](_0x3d7ab7[_0xe524('0x49')],{})['then'](respondWithResult(_0x33b1c8,0xc9))['catch'](handleError(_0x33b1c8,null));};exports[_0xe524('0x27')]=function(_0x59fe6b,_0x232cf0){if(_0x59fe6b[_0xe524('0x49')]['id']){delete _0x59fe6b['body']['id'];}return db[_0xe524('0x3e')]['find']({'where':{'id':_0x59fe6b['params']['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x232cf0,null))[_0xe524('0x3f')](saveUpdates(_0x59fe6b[_0xe524('0x49')],null))['then'](respondWithResult(_0x232cf0,null))['catch'](handleError(_0x232cf0,null));};exports['destroy']=function(_0x4e9c3b,_0x4f7a64){return db['Integration'][_0xe524('0x47')]({'where':{'id':_0x4e9c3b[_0xe524('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4f7a64,null))[_0xe524('0x3f')](removeEntity(_0x4f7a64,null))[_0xe524('0x44')](handleError(_0x4f7a64,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 7a43ebb..33a8bee 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 _0x31a4=['exports','Integration','integrations','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./integration.attributes'];(function(_0x4ddb0e,_0x501ce){var _0x66aca2=function(_0x1a5dc0){while(--_0x1a5dc0){_0x4ddb0e['push'](_0x4ddb0e['shift']());}};_0x66aca2(++_0x501ce);}(_0x31a4,0x7b));var _0x431a=function(_0x491c31,_0x5c2012){_0x491c31=_0x491c31-0x0;var _0x24e383=_0x31a4[_0x491c31];return _0x24e383;};'use strict';var _=require(_0x431a('0x0'));var util=require(_0x431a('0x1'));var logger=require(_0x431a('0x2'))(_0x431a('0x3'));var moment=require(_0x431a('0x4'));var BPromise=require('bluebird');var rp=require(_0x431a('0x5'));var fs=require('fs');var path=require(_0x431a('0x6'));var rimraf=require('rimraf');var config=require(_0x431a('0x7'));var attributes=require(_0x431a('0x8'));module[_0x431a('0x9')]=function(_0x108f31,_0x5574e3){return _0x108f31['define'](_0x431a('0xa'),attributes,{'tableName':_0x431a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x484a=['request-promise','path','rimraf','../../config/environment','exports','define','Integration','util','api','moment'];(function(_0x1a0016,_0x3d80e1){var _0x2945df=function(_0x2e82b2){while(--_0x2e82b2){_0x1a0016['push'](_0x1a0016['shift']());}};_0x2945df(++_0x3d80e1);}(_0x484a,0x1f1));var _0xa484=function(_0x510879,_0x249b75){_0x510879=_0x510879-0x0;var _0x108441=_0x484a[_0x510879];return _0x108441;};'use strict';var _=require('lodash');var util=require(_0xa484('0x0'));var logger=require('../../config/logger')(_0xa484('0x1'));var moment=require(_0xa484('0x2'));var BPromise=require('bluebird');var rp=require(_0xa484('0x3'));var fs=require('fs');var path=require(_0xa484('0x4'));var rimraf=require(_0xa484('0x5'));var config=require(_0xa484('0x6'));var attributes=require('./integration.attributes');module[_0xa484('0x7')]=function(_0x247f8d,_0x2a38eb){return _0x247f8d[_0xa484('0x8')](_0xa484('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 2d75e81..dd060a4 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 _0x7a54=['info','Integration,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x1ca758,_0x3c7837){_0x1ca758=_0x1ca758-0x0;var _0x317005=_0x7a54[_0x1ca758];return _0x317005;};'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')]('Integration,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','Integration,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x1c7090,_0xef86f3){var _0x556788=function(_0x38f678){while(--_0x38f678){_0x1c7090['push'](_0x1c7090['shift']());}};_0x556788(++_0xef86f3);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2c730f,_0x1aa6a6){_0x2c730f=_0x2c730f-0x0;var _0x4127e7=_0x5f2f[_0x2c730f];return _0x4127e7;};'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')]('Integration,\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/integrationReport/index.js b/server/api/integrationReport/index.js index 8fc60a8..40ab1b3 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 _0x2ef3=['express','Router','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x2a321b,_0x4e661b){var _0x2ec2e4=function(_0x30460a){while(--_0x30460a){_0x2a321b['push'](_0x2a321b['shift']());}};_0x2ec2e4(++_0x4e661b);}(_0x2ef3,0xba));var _0x32ef=function(_0x1c6efb,_0x244a7e){_0x1c6efb=_0x1c6efb-0x0;var _0x2d9ea3=_0x2ef3[_0x1c6efb];return _0x2d9ea3;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0xf')]('/',auth[_0x32ef('0xb')](),controller['create']);router['put'](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x10')]);router[_0x32ef('0x11')]('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x12')]=router; \ No newline at end of file +var _0xc2c7=['/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe'];(function(_0x25f69e,_0x329a3a){var _0x377c53=function(_0x183a7c){while(--_0x183a7c){_0x25f69e['push'](_0x25f69e['shift']());}};_0x377c53(++_0x329a3a);}(_0xc2c7,0x134));var _0x7c2c=function(_0x11a61c,_0x436c9d){_0x11a61c=_0x11a61c-0x0;var _0x169392=_0xc2c7[_0x11a61c];return _0x169392;};'use strict';var multer=require('multer');var util=require(_0x7c2c('0x0'));var path=require(_0x7c2c('0x1'));var timeout=require(_0x7c2c('0x2'));var express=require(_0x7c2c('0x3'));var router=express[_0x7c2c('0x4')]();var fs_extra=require(_0x7c2c('0x5'));var auth=require(_0x7c2c('0x6'));var interaction=require(_0x7c2c('0x7'));var config=require('../../config/environment');var controller=require('./integrationReport.controller');router[_0x7c2c('0x8')]('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x7c2c('0xb')]);router[_0x7c2c('0x8')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xd')]);router['post']('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xe')]);router[_0x7c2c('0xf')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x10')]);router[_0x7c2c('0x11')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x12')]);module[_0x7c2c('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index b5e7c86..6a6d62b 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 _0x0b11=['INTEGER','TEXT','ENUM','SENT','SENDING','sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0b11,0xaf));var _0x10b1=function(_0x3da299,_0x5f0503){_0x3da299=_0x3da299-0x0;var _0x177257=_0x0b11[_0x3da299];return _0x177257;};'use strict';var Sequelize=require(_0x10b1('0x0'));module[_0x10b1('0x1')]={'integration':{'type':Sequelize[_0x10b1('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x10b1('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x10b1('0x2')]},'uniqueid':{'type':Sequelize[_0x10b1('0x2')]},'calleridnum':{'type':Sequelize[_0x10b1('0x2')]},'calleridname':{'type':Sequelize[_0x10b1('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x10b1('0x2')]},'membername':{'type':Sequelize[_0x10b1('0x2')]},'agentcalledAt':{'type':Sequelize[_0x10b1('0x3')]},'agentconnectAt':{'type':Sequelize[_0x10b1('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x10b1('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x10b1('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x10b1('0x5')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x10b1('0x3')]},'agentdump':{'type':Sequelize[_0x10b1('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x10b1('0x3')]},'lastevent':{'type':Sequelize[_0x10b1('0x2')]},'channel':{'type':Sequelize[_0x10b1('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x10b1('0x2')]},'connectedlinenum':{'type':Sequelize[_0x10b1('0x2')]},'connectedlinename':{'type':Sequelize[_0x10b1('0x2')]},'language':{'type':Sequelize[_0x10b1('0x2')]},'accountcode':{'type':Sequelize[_0x10b1('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x10b1('0x2')]},'priority':{'type':Sequelize[_0x10b1('0x2')]},'destchannel':{'type':Sequelize[_0x10b1('0x2')]},'destchannelstate':{'type':Sequelize[_0x10b1('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x10b1('0x2')]},'destcalleridnum':{'type':Sequelize[_0x10b1('0x2')]},'destcalleridname':{'type':Sequelize[_0x10b1('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x10b1('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x10b1('0x2')]},'destlanguage':{'type':Sequelize[_0x10b1('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x10b1('0x2')]},'destexten':{'type':Sequelize[_0x10b1('0x2')]},'destpriority':{'type':Sequelize[_0x10b1('0x2')]},'destuniqueid':{'type':Sequelize[_0x10b1('0x2')]},'messageId':{'type':Sequelize[_0x10b1('0x2')]},'inReplyTo':{'type':Sequelize[_0x10b1('0x2')]},'subject':{'type':Sequelize[_0x10b1('0x2')]},'from':{'type':Sequelize[_0x10b1('0x2')]},'to':{'type':Sequelize[_0x10b1('0x2')]},'cc':{'type':Sequelize[_0x10b1('0x2')]},'attachment':{'type':Sequelize[_0x10b1('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x10b1('0x6')]},'status':{'type':Sequelize[_0x10b1('0x7')](_0x10b1('0x8'),_0x10b1('0x9'),'RECEIVED','FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x10b1('0x2')]},'appdata':{'type':Sequelize[_0x10b1('0x2')]},'projectId':{'type':Sequelize[_0x10b1('0x5')]}}; \ No newline at end of file +var _0x6482=['RECEIVED','FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x6482,0x19c));var _0x2648=function(_0x418982,_0x15b4b5){_0x418982=_0x418982-0x0;var _0x1d95f3=_0x6482[_0x418982];return _0x1d95f3;};'use strict';var Sequelize=require('sequelize');module[_0x2648('0x0')]={'integration':{'type':Sequelize[_0x2648('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x2648('0x1')]},'ticketId':{'type':Sequelize[_0x2648('0x1')]},'integrationId':{'type':Sequelize[_0x2648('0x2')]},'contacts':{'type':Sequelize[_0x2648('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x2648('0x1')]},'calleridname':{'type':Sequelize[_0x2648('0x1')]},'queue':{'type':Sequelize[_0x2648('0x1')]},'interface':{'type':Sequelize[_0x2648('0x1')]},'membername':{'type':Sequelize[_0x2648('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x2648('0x2')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x2648('0x3')]},'talktime':{'type':Sequelize[_0x2648('0x2')]},'agentacw':{'type':Sequelize[_0x2648('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x2648('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x2648('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x2648('0x3')]},'lastevent':{'type':Sequelize[_0x2648('0x1')]},'channel':{'type':Sequelize[_0x2648('0x1')]},'channelstate':{'type':Sequelize[_0x2648('0x2')]},'channelstatedesc':{'type':Sequelize[_0x2648('0x1')]},'connectedlinenum':{'type':Sequelize[_0x2648('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x2648('0x1')]},'accountcode':{'type':Sequelize[_0x2648('0x1')]},'context':{'type':Sequelize[_0x2648('0x1')]},'exten':{'type':Sequelize[_0x2648('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x2648('0x1')]},'destchannelstate':{'type':Sequelize[_0x2648('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x2648('0x1')]},'destcalleridnum':{'type':Sequelize[_0x2648('0x1')]},'destcalleridname':{'type':Sequelize[_0x2648('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x2648('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x2648('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x2648('0x1')]},'destpriority':{'type':Sequelize[_0x2648('0x1')]},'destuniqueid':{'type':Sequelize[_0x2648('0x1')]},'messageId':{'type':Sequelize[_0x2648('0x1')]},'inReplyTo':{'type':Sequelize[_0x2648('0x1')]},'subject':{'type':Sequelize[_0x2648('0x1')]},'from':{'type':Sequelize[_0x2648('0x1')]},'to':{'type':Sequelize[_0x2648('0x1')]},'cc':{'type':Sequelize[_0x2648('0x1')]},'attachment':{'type':Sequelize[_0x2648('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x2648('0x6')](_0x2648('0x7'),'SENDING',_0x2648('0x8'),_0x2648('0x9'))},'url':{'type':Sequelize[_0x2648('0x1')]},'app':{'type':Sequelize[_0x2648('0x1')]},'appdata':{'type':Sequelize[_0x2648('0x1')]},'projectId':{'type':Sequelize[_0x2648('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index f09839c..cd7a902 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 _0xd6f3=['error','stack','name','index','map','IntegrationReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','findAll','rows','catch','params','includeAll','include','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x3356d5,_0x4251df){var _0x256908=function(_0x462454){while(--_0x462454){_0x3356d5['push'](_0x3356d5['shift']());}};_0x256908(++_0x4251df);}(_0xd6f3,0x72));var _0x3d6f=function(_0x1d05c8,_0x5677ec){_0x1d05c8=_0x1d05c8-0x0;var _0x2ce8ee=_0xd6f3[_0x1d05c8];return _0x2ce8ee;};'use strict';var emlformat=require(_0x3d6f('0x0'));var rimraf=require(_0x3d6f('0x1'));var zipdir=require(_0x3d6f('0x2'));var jsonpatch=require(_0x3d6f('0x3'));var rp=require(_0x3d6f('0x4'));var moment=require(_0x3d6f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3d6f('0x6'));var util=require(_0x3d6f('0x7'));var path=require(_0x3d6f('0x8'));var sox=require(_0x3d6f('0x9'));var csv=require(_0x3d6f('0xa'));var ejs=require(_0x3d6f('0xb'));var fs=require('fs');var fs_extra=require(_0x3d6f('0xc'));var _=require(_0x3d6f('0xd'));var squel=require('squel');var crypto=require(_0x3d6f('0xe'));var jsforce=require(_0x3d6f('0xf'));var deskjs=require(_0x3d6f('0x10'));var toCsv=require('to-csv');var querystring=require(_0x3d6f('0x11'));var Papa=require(_0x3d6f('0x12'));var Redis=require(_0x3d6f('0x13'));var authService=require(_0x3d6f('0x14'));var qs=require(_0x3d6f('0x15'));var as=require(_0x3d6f('0x16'));var hardwareService=require(_0x3d6f('0x17'));var logger=require(_0x3d6f('0x18'))(_0x3d6f('0x19'));var utils=require(_0x3d6f('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x3d6f('0x1b'));var db=require(_0x3d6f('0x1c'))['db'];function respondWithStatusCode(_0xde6a37,_0x16ad2b){_0x16ad2b=_0x16ad2b||0xcc;return function(_0x3913b4){if(_0x3913b4){return _0xde6a37[_0x3d6f('0x1d')](_0x16ad2b);}return _0xde6a37['status'](_0x16ad2b)[_0x3d6f('0x1e')]();};}function respondWithResult(_0x44c1db,_0x43d785){_0x43d785=_0x43d785||0xc8;return function(_0x2bc2dc){if(_0x2bc2dc){return _0x44c1db['status'](_0x43d785)[_0x3d6f('0x1f')](_0x2bc2dc);}};}function respondWithFilteredResult(_0xb9344a,_0x4e826a){return function(_0x1aa3cf){if(_0x1aa3cf){var _0x588b3d=typeof _0x4e826a[_0x3d6f('0x20')]===_0x3d6f('0x21')&&typeof _0x4e826a[_0x3d6f('0x22')]===_0x3d6f('0x21');var _0x84c21c=_0x1aa3cf['count'];var _0x3185b2=_0x588b3d?0x0:_0x4e826a[_0x3d6f('0x20')];var _0x55065c=_0x588b3d?_0x1aa3cf[_0x3d6f('0x23')]:_0x4e826a[_0x3d6f('0x20')]+_0x4e826a[_0x3d6f('0x22')];var _0x391707;if(_0x55065c>=_0x84c21c){_0x55065c=_0x84c21c;_0x391707=0xc8;}else{_0x391707=0xce;}_0xb9344a[_0x3d6f('0x24')](_0x391707);return _0xb9344a['set'](_0x3d6f('0x25'),_0x3185b2+'-'+_0x55065c+'/'+_0x84c21c)[_0x3d6f('0x1f')](_0x1aa3cf);}return null;};}function patchUpdates(_0x665277){return function(_0x1c64c4){try{jsonpatch[_0x3d6f('0x26')](_0x1c64c4,_0x665277,!![]);}catch(_0x554f42){return BPromise[_0x3d6f('0x27')](_0x554f42);}return _0x1c64c4[_0x3d6f('0x28')]();};}function saveUpdates(_0x39730b,_0x5b48eb){return function(_0x5a9470){if(_0x5a9470){return _0x5a9470[_0x3d6f('0x29')](_0x39730b)[_0x3d6f('0x2a')](function(_0x297f31){return _0x297f31;});}return null;};}function removeEntity(_0x2af01a,_0x3721f8){return function(_0x5ee0bd){if(_0x5ee0bd){return _0x5ee0bd[_0x3d6f('0x2b')]()[_0x3d6f('0x2a')](function(){_0x2af01a[_0x3d6f('0x24')](0xcc)[_0x3d6f('0x1e')]();});}};}function handleEntityNotFound(_0x205773,_0x377f21){return function(_0x1e5e89){if(!_0x1e5e89){_0x205773['sendStatus'](0x194);}return _0x1e5e89;};}function handleError(_0x4ed419,_0xfe302b){_0xfe302b=_0xfe302b||0x1f4;return function(_0x569d92){logger[_0x3d6f('0x2c')](_0x569d92[_0x3d6f('0x2d')]);if(_0x569d92[_0x3d6f('0x2e')]){delete _0x569d92[_0x3d6f('0x2e')];}_0x4ed419[_0x3d6f('0x24')](_0xfe302b)['send'](_0x569d92);};}exports[_0x3d6f('0x2f')]=function(_0x21a5a2,_0x5a7def){var _0x28e229={},_0x4c5ec0={},_0x326c2d={'count':0x0,'rows':[]};var _0x2d4329=_[_0x3d6f('0x30')](db[_0x3d6f('0x31')][_0x3d6f('0x32')],function(_0x8128f6){return{'name':_0x8128f6[_0x3d6f('0x33')],'type':_0x8128f6['type']['key']};});_0x4c5ec0[_0x3d6f('0x34')]=_[_0x3d6f('0x30')](_0x2d4329,'name');_0x4c5ec0[_0x3d6f('0x35')]=_[_0x3d6f('0x36')](_0x21a5a2['query']);_0x4c5ec0[_0x3d6f('0x37')]=_[_0x3d6f('0x38')](_0x4c5ec0[_0x3d6f('0x34')],_0x4c5ec0[_0x3d6f('0x35')]);_0x28e229[_0x3d6f('0x39')]=_[_0x3d6f('0x38')](_0x4c5ec0['model'],qs[_0x3d6f('0x3a')](_0x21a5a2[_0x3d6f('0x35')][_0x3d6f('0x3a')]));_0x28e229[_0x3d6f('0x39')]=_0x28e229[_0x3d6f('0x39')][_0x3d6f('0x3b')]?_0x28e229[_0x3d6f('0x39')]:_0x4c5ec0[_0x3d6f('0x34')];if(!_0x21a5a2['query'][_0x3d6f('0x3c')](_0x3d6f('0x3d'))){_0x28e229['limit']=qs[_0x3d6f('0x22')](_0x21a5a2[_0x3d6f('0x35')]['limit']);_0x28e229[_0x3d6f('0x20')]=qs[_0x3d6f('0x20')](_0x21a5a2[_0x3d6f('0x35')]['offset']);}_0x28e229[_0x3d6f('0x3e')]=qs['sort'](_0x21a5a2['query']['sort']);_0x28e229[_0x3d6f('0x3f')]=qs[_0x3d6f('0x37')](_[_0x3d6f('0x40')](_0x21a5a2[_0x3d6f('0x35')],_0x4c5ec0[_0x3d6f('0x37')]),_0x2d4329);if(_0x21a5a2[_0x3d6f('0x35')][_0x3d6f('0x41')]){_0x28e229[_0x3d6f('0x3f')]=_[_0x3d6f('0x42')](_0x28e229[_0x3d6f('0x3f')],{'$or':_[_0x3d6f('0x30')](_0x2d4329,function(_0x5f38a8){if(_0x5f38a8[_0x3d6f('0x43')]!==_0x3d6f('0x44')){var _0x2d0592={};_0x2d0592[_0x5f38a8[_0x3d6f('0x2e')]]={'$like':'%'+_0x21a5a2['query'][_0x3d6f('0x41')]+'%'};return _0x2d0592;}})});}_0x28e229=_[_0x3d6f('0x42')]({},_0x28e229,_0x21a5a2[_0x3d6f('0x45')]);var _0x1a770a={'where':_0x28e229[_0x3d6f('0x3f')]};return db[_0x3d6f('0x31')]['count'](_0x1a770a)['then'](function(_0x475071){_0x326c2d[_0x3d6f('0x23')]=_0x475071;if(_0x21a5a2[_0x3d6f('0x35')]['includeAll']){_0x28e229['include']=[{'all':!![]}];}return db[_0x3d6f('0x31')][_0x3d6f('0x46')](_0x28e229);})[_0x3d6f('0x2a')](function(_0x26bac6){_0x326c2d[_0x3d6f('0x47')]=_0x26bac6;return _0x326c2d;})[_0x3d6f('0x2a')](respondWithFilteredResult(_0x5a7def,_0x28e229))[_0x3d6f('0x48')](handleError(_0x5a7def,null));};exports['show']=function(_0x2938a3,_0x20c496){var _0x45c4f5={'raw':![],'where':{'id':_0x2938a3[_0x3d6f('0x49')]['id']}},_0x5e0408={};_0x5e0408[_0x3d6f('0x34')]=_[_0x3d6f('0x36')](db[_0x3d6f('0x31')]['rawAttributes']);_0x5e0408[_0x3d6f('0x35')]=_[_0x3d6f('0x36')](_0x2938a3[_0x3d6f('0x35')]);_0x5e0408[_0x3d6f('0x37')]=_[_0x3d6f('0x38')](_0x5e0408[_0x3d6f('0x34')],_0x5e0408['query']);_0x45c4f5[_0x3d6f('0x39')]=_[_0x3d6f('0x38')](_0x5e0408[_0x3d6f('0x34')],qs[_0x3d6f('0x3a')](_0x2938a3[_0x3d6f('0x35')][_0x3d6f('0x3a')]));_0x45c4f5['attributes']=_0x45c4f5[_0x3d6f('0x39')][_0x3d6f('0x3b')]?_0x45c4f5[_0x3d6f('0x39')]:_0x5e0408['model'];if(_0x2938a3[_0x3d6f('0x35')][_0x3d6f('0x4a')]){_0x45c4f5[_0x3d6f('0x4b')]=[{'all':!![]}];}_0x45c4f5=_[_0x3d6f('0x42')]({},_0x45c4f5,_0x2938a3[_0x3d6f('0x45')]);return db[_0x3d6f('0x31')]['find'](_0x45c4f5)[_0x3d6f('0x2a')](handleEntityNotFound(_0x20c496,null))[_0x3d6f('0x2a')](respondWithResult(_0x20c496,null))['catch'](handleError(_0x20c496,null));};exports['create']=function(_0x4e2b0d,_0x256e65){return db[_0x3d6f('0x31')][_0x3d6f('0x4c')](_0x4e2b0d['body'],{})[_0x3d6f('0x2a')](respondWithResult(_0x256e65,0xc9))[_0x3d6f('0x48')](handleError(_0x256e65,null));};exports[_0x3d6f('0x29')]=function(_0x46db3b,_0x5f1be1){if(_0x46db3b[_0x3d6f('0x4d')]['id']){delete _0x46db3b[_0x3d6f('0x4d')]['id'];}return db[_0x3d6f('0x31')]['find']({'where':{'id':_0x46db3b[_0x3d6f('0x49')]['id']}})[_0x3d6f('0x2a')](handleEntityNotFound(_0x5f1be1,null))[_0x3d6f('0x2a')](saveUpdates(_0x46db3b[_0x3d6f('0x4d')],null))['then'](respondWithResult(_0x5f1be1,null))[_0x3d6f('0x48')](handleError(_0x5f1be1,null));};exports[_0x3d6f('0x2b')]=function(_0x2f5c5b,_0x360d26){return db[_0x3d6f('0x31')][_0x3d6f('0x4e')]({'where':{'id':_0x2f5c5b[_0x3d6f('0x49')]['id']}})[_0x3d6f('0x2a')](handleEntityNotFound(_0x360d26,null))[_0x3d6f('0x2a')](removeEntity(_0x360d26,null))[_0x3d6f('0x48')](handleError(_0x360d26,null));};exports['describe']=function(_0x3b818d,_0x34ecce){return db[_0x3d6f('0x31')]['describe']()['then'](respondWithResult(_0x34ecce,null))[_0x3d6f('0x48')](handleError(_0x34ecce,null));}; \ No newline at end of file +var _0xd7c2=['to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','destroy','then','error','stack','name','index','map','IntegrationReport','rawAttributes','key','query','keys','intersection','attributes','model','fields','length','nolimit','sort','where','pick','filters','filter','type','options','includeAll','rows','show','params','include','merge','find','catch','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x1fb50a,_0x56c543){var _0x43a2a0=function(_0x4e3b3a){while(--_0x4e3b3a){_0x1fb50a['push'](_0x1fb50a['shift']());}};_0x43a2a0(++_0x56c543);}(_0xd7c2,0x1c4));var _0x2d7c=function(_0x263c87,_0x18388c){_0x263c87=_0x263c87-0x0;var _0x153535=_0xd7c2[_0x263c87];return _0x153535;};'use strict';var emlformat=require(_0x2d7c('0x0'));var rimraf=require(_0x2d7c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d7c('0x2'));var rp=require(_0x2d7c('0x3'));var moment=require(_0x2d7c('0x4'));var BPromise=require(_0x2d7c('0x5'));var Mustache=require(_0x2d7c('0x6'));var util=require(_0x2d7c('0x7'));var path=require(_0x2d7c('0x8'));var sox=require(_0x2d7c('0x9'));var csv=require(_0x2d7c('0xa'));var ejs=require(_0x2d7c('0xb'));var fs=require('fs');var fs_extra=require(_0x2d7c('0xc'));var _=require('lodash');var squel=require(_0x2d7c('0xd'));var crypto=require(_0x2d7c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2d7c('0xf'));var toCsv=require(_0x2d7c('0xa'));var querystring=require(_0x2d7c('0x10'));var Papa=require(_0x2d7c('0x11'));var Redis=require(_0x2d7c('0x12'));var authService=require(_0x2d7c('0x13'));var qs=require(_0x2d7c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2d7c('0x15'));var logger=require(_0x2d7c('0x16'))(_0x2d7c('0x17'));var utils=require(_0x2d7c('0x18'));var config=require(_0x2d7c('0x19'));var licenseUtil=require(_0x2d7c('0x1a'));var db=require(_0x2d7c('0x1b'))['db'];function respondWithStatusCode(_0x431b87,_0x2f129d){_0x2f129d=_0x2f129d||0xcc;return function(_0x5b75bb){if(_0x5b75bb){return _0x431b87[_0x2d7c('0x1c')](_0x2f129d);}return _0x431b87['status'](_0x2f129d)[_0x2d7c('0x1d')]();};}function respondWithResult(_0x3398fb,_0x407228){_0x407228=_0x407228||0xc8;return function(_0x524e57){if(_0x524e57){return _0x3398fb[_0x2d7c('0x1e')](_0x407228)[_0x2d7c('0x1f')](_0x524e57);}};}function respondWithFilteredResult(_0x190eb2,_0x3a26e1){return function(_0x5956aa){if(_0x5956aa){var _0x49aa90=typeof _0x3a26e1[_0x2d7c('0x20')]==='undefined'&&typeof _0x3a26e1['limit']===_0x2d7c('0x21');var _0x257114=_0x5956aa[_0x2d7c('0x22')];var _0x25e084=_0x49aa90?0x0:_0x3a26e1[_0x2d7c('0x20')];var _0x27586c=_0x49aa90?_0x5956aa['count']:_0x3a26e1[_0x2d7c('0x20')]+_0x3a26e1[_0x2d7c('0x23')];var _0x4edb75;if(_0x27586c>=_0x257114){_0x27586c=_0x257114;_0x4edb75=0xc8;}else{_0x4edb75=0xce;}_0x190eb2[_0x2d7c('0x1e')](_0x4edb75);return _0x190eb2[_0x2d7c('0x24')](_0x2d7c('0x25'),_0x25e084+'-'+_0x27586c+'/'+_0x257114)[_0x2d7c('0x1f')](_0x5956aa);}return null;};}function patchUpdates(_0x38d370){return function(_0x216820){try{jsonpatch[_0x2d7c('0x26')](_0x216820,_0x38d370,!![]);}catch(_0x1bf99f){return BPromise[_0x2d7c('0x27')](_0x1bf99f);}return _0x216820['save']();};}function saveUpdates(_0x53c42e,_0x5d2ce9){return function(_0x4f46fb){if(_0x4f46fb){return _0x4f46fb['update'](_0x53c42e)['then'](function(_0x3b1e99){return _0x3b1e99;});}return null;};}function removeEntity(_0x13d647,_0x555d34){return function(_0x39513e){if(_0x39513e){return _0x39513e[_0x2d7c('0x28')]()[_0x2d7c('0x29')](function(){_0x13d647[_0x2d7c('0x1e')](0xcc)[_0x2d7c('0x1d')]();});}};}function handleEntityNotFound(_0x1cfc6a,_0x23dd3d){return function(_0x1a1cf4){if(!_0x1a1cf4){_0x1cfc6a[_0x2d7c('0x1c')](0x194);}return _0x1a1cf4;};}function handleError(_0x2ee2b8,_0x220b26){_0x220b26=_0x220b26||0x1f4;return function(_0x17d8cf){logger[_0x2d7c('0x2a')](_0x17d8cf[_0x2d7c('0x2b')]);if(_0x17d8cf[_0x2d7c('0x2c')]){delete _0x17d8cf[_0x2d7c('0x2c')];}_0x2ee2b8['status'](_0x220b26)['send'](_0x17d8cf);};}exports[_0x2d7c('0x2d')]=function(_0x1eb932,_0x25eb10){var _0x27767a={},_0x2a801b={},_0x4cd731={'count':0x0,'rows':[]};var _0x490e9c=_[_0x2d7c('0x2e')](db[_0x2d7c('0x2f')][_0x2d7c('0x30')],function(_0x30116f){return{'name':_0x30116f['fieldName'],'type':_0x30116f['type'][_0x2d7c('0x31')]};});_0x2a801b['model']=_[_0x2d7c('0x2e')](_0x490e9c,_0x2d7c('0x2c'));_0x2a801b[_0x2d7c('0x32')]=_[_0x2d7c('0x33')](_0x1eb932['query']);_0x2a801b['filters']=_[_0x2d7c('0x34')](_0x2a801b['model'],_0x2a801b[_0x2d7c('0x32')]);_0x27767a[_0x2d7c('0x35')]=_[_0x2d7c('0x34')](_0x2a801b[_0x2d7c('0x36')],qs['fields'](_0x1eb932[_0x2d7c('0x32')][_0x2d7c('0x37')]));_0x27767a[_0x2d7c('0x35')]=_0x27767a[_0x2d7c('0x35')][_0x2d7c('0x38')]?_0x27767a[_0x2d7c('0x35')]:_0x2a801b[_0x2d7c('0x36')];if(!_0x1eb932['query']['hasOwnProperty'](_0x2d7c('0x39'))){_0x27767a[_0x2d7c('0x23')]=qs['limit'](_0x1eb932['query'][_0x2d7c('0x23')]);_0x27767a['offset']=qs[_0x2d7c('0x20')](_0x1eb932[_0x2d7c('0x32')][_0x2d7c('0x20')]);}_0x27767a['order']=qs[_0x2d7c('0x3a')](_0x1eb932[_0x2d7c('0x32')][_0x2d7c('0x3a')]);_0x27767a[_0x2d7c('0x3b')]=qs['filters'](_[_0x2d7c('0x3c')](_0x1eb932[_0x2d7c('0x32')],_0x2a801b[_0x2d7c('0x3d')]),_0x490e9c);if(_0x1eb932['query'][_0x2d7c('0x3e')]){_0x27767a[_0x2d7c('0x3b')]=_['merge'](_0x27767a[_0x2d7c('0x3b')],{'$or':_[_0x2d7c('0x2e')](_0x490e9c,function(_0x5bffdd){if(_0x5bffdd[_0x2d7c('0x3f')]!=='VIRTUAL'){var _0x7cbb4e={};_0x7cbb4e[_0x5bffdd[_0x2d7c('0x2c')]]={'$like':'%'+_0x1eb932[_0x2d7c('0x32')][_0x2d7c('0x3e')]+'%'};return _0x7cbb4e;}})});}_0x27767a=_['merge']({},_0x27767a,_0x1eb932[_0x2d7c('0x40')]);var _0x490fc1={'where':_0x27767a[_0x2d7c('0x3b')]};return db['IntegrationReport']['count'](_0x490fc1)[_0x2d7c('0x29')](function(_0x118287){_0x4cd731[_0x2d7c('0x22')]=_0x118287;if(_0x1eb932[_0x2d7c('0x32')][_0x2d7c('0x41')]){_0x27767a['include']=[{'all':!![]}];}return db['IntegrationReport']['findAll'](_0x27767a);})['then'](function(_0x221465){_0x4cd731[_0x2d7c('0x42')]=_0x221465;return _0x4cd731;})[_0x2d7c('0x29')](respondWithFilteredResult(_0x25eb10,_0x27767a))['catch'](handleError(_0x25eb10,null));};exports[_0x2d7c('0x43')]=function(_0x2c06df,_0x29baec){var _0x2cd455={'raw':![],'where':{'id':_0x2c06df[_0x2d7c('0x44')]['id']}},_0x11524b={};_0x11524b[_0x2d7c('0x36')]=_[_0x2d7c('0x33')](db[_0x2d7c('0x2f')][_0x2d7c('0x30')]);_0x11524b[_0x2d7c('0x32')]=_[_0x2d7c('0x33')](_0x2c06df[_0x2d7c('0x32')]);_0x11524b[_0x2d7c('0x3d')]=_['intersection'](_0x11524b['model'],_0x11524b[_0x2d7c('0x32')]);_0x2cd455[_0x2d7c('0x35')]=_[_0x2d7c('0x34')](_0x11524b[_0x2d7c('0x36')],qs['fields'](_0x2c06df['query'][_0x2d7c('0x37')]));_0x2cd455[_0x2d7c('0x35')]=_0x2cd455[_0x2d7c('0x35')][_0x2d7c('0x38')]?_0x2cd455['attributes']:_0x11524b[_0x2d7c('0x36')];if(_0x2c06df['query'][_0x2d7c('0x41')]){_0x2cd455[_0x2d7c('0x45')]=[{'all':!![]}];}_0x2cd455=_[_0x2d7c('0x46')]({},_0x2cd455,_0x2c06df['options']);return db[_0x2d7c('0x2f')][_0x2d7c('0x47')](_0x2cd455)['then'](handleEntityNotFound(_0x29baec,null))[_0x2d7c('0x29')](respondWithResult(_0x29baec,null))[_0x2d7c('0x48')](handleError(_0x29baec,null));};exports[_0x2d7c('0x49')]=function(_0x15b3b9,_0x1aec19){return db[_0x2d7c('0x2f')][_0x2d7c('0x49')](_0x15b3b9[_0x2d7c('0x4a')],{})[_0x2d7c('0x29')](respondWithResult(_0x1aec19,0xc9))[_0x2d7c('0x48')](handleError(_0x1aec19,null));};exports[_0x2d7c('0x4b')]=function(_0x258102,_0x1c94ae){if(_0x258102[_0x2d7c('0x4a')]['id']){delete _0x258102[_0x2d7c('0x4a')]['id'];}return db[_0x2d7c('0x2f')][_0x2d7c('0x47')]({'where':{'id':_0x258102['params']['id']}})['then'](handleEntityNotFound(_0x1c94ae,null))[_0x2d7c('0x29')](saveUpdates(_0x258102[_0x2d7c('0x4a')],null))[_0x2d7c('0x29')](respondWithResult(_0x1c94ae,null))[_0x2d7c('0x48')](handleError(_0x1c94ae,null));};exports[_0x2d7c('0x28')]=function(_0x2b533f,_0x46ef3c){return db[_0x2d7c('0x2f')][_0x2d7c('0x47')]({'where':{'id':_0x2b533f[_0x2d7c('0x44')]['id']}})[_0x2d7c('0x29')](handleEntityNotFound(_0x46ef3c,null))[_0x2d7c('0x29')](removeEntity(_0x46ef3c,null))[_0x2d7c('0x48')](handleError(_0x46ef3c,null));};exports[_0x2d7c('0x4c')]=function(_0x4291b4,_0x2386bd){return db[_0x2d7c('0x2f')][_0x2d7c('0x4c')]()[_0x2d7c('0x29')](respondWithResult(_0x2386bd,null))[_0x2d7c('0x48')](handleError(_0x2386bd,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index af378b4..25e7a67 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 _0x5946=['./integrationReport.attributes','define','IntegrationReport','report_integration','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment'];(function(_0x578f67,_0x3e14d0){var _0x5cddf6=function(_0x361ce7){while(--_0x361ce7){_0x578f67['push'](_0x578f67['shift']());}};_0x5cddf6(++_0x3e14d0);}(_0x5946,0x7d));var _0x6594=function(_0x18a436,_0x1dbe06){_0x18a436=_0x18a436-0x0;var _0x5c2cf8=_0x5946[_0x18a436];return _0x5c2cf8;};'use strict';var _=require(_0x6594('0x0'));var util=require(_0x6594('0x1'));var logger=require(_0x6594('0x2'))('api');var moment=require(_0x6594('0x3'));var BPromise=require(_0x6594('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6594('0x5'));var rimraf=require('rimraf');var config=require(_0x6594('0x6'));var attributes=require(_0x6594('0x7'));module['exports']=function(_0x101726,_0x3843eb){return _0x101726[_0x6594('0x8')](_0x6594('0x9'),attributes,{'tableName':_0x6594('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x711d=['IntegrationReport','report_integration','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x711d,0x199));var _0xd711=function(_0x5c9388,_0xb344b0){_0x5c9388=_0x5c9388-0x0;var _0x4c909d=_0x711d[_0x5c9388];return _0x4c909d;};'use strict';var _=require(_0xd711('0x0'));var util=require(_0xd711('0x1'));var logger=require(_0xd711('0x2'))(_0xd711('0x3'));var moment=require('moment');var BPromise=require(_0xd711('0x4'));var rp=require(_0xd711('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd711('0x6'));var config=require(_0xd711('0x7'));var attributes=require('./integrationReport.attributes');module[_0xd711('0x8')]=function(_0x3f9dc0,_0x206c5b){return _0x3f9dc0['define'](_0xd711('0x9'),attributes,{'tableName':_0xd711('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 4d9688b..78213ea 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x3b69e4,_0x43c52d){var _0x147d15=function(_0x20ab8f){while(--_0x20ab8f){_0x3b69e4['push'](_0x3b69e4['shift']());}};_0x147d15(++_0x43c52d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xc4aa[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file +var _0x7a54=['info','IntegrationReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7a54,0x106));var _0x47a5=function(_0x1cf939,_0x2504dc){_0x1cf939=_0x1cf939-0x0;var _0x4f9e39=_0x7a54[_0x1cf939];return _0x4f9e39;};'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')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index f95637d..f7295bb 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 _0x8ef6=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./interval.controller','get','/:id','isAuthenticated','/:id/sub_intervals','getIntervals','post','create','addInterval','addIntervals','put','update','destroy'];(function(_0x17ebae,_0x7da3){var _0x8cbe7d=function(_0x4cfdd5){while(--_0x4cfdd5){_0x17ebae['push'](_0x17ebae['shift']());}};_0x8cbe7d(++_0x7da3);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2c93ad,_0x28f926){_0x2c93ad=_0x2c93ad-0x0;var _0x43cb95=_0x8ef6[_0x2c93ad];return _0x43cb95;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['show']);router[_0x68ef('0xa')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xf')]('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0xf')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x11')]);router[_0x68ef('0xf')]('/:id/sub_intervals/create_many',auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router[_0x68ef('0x13')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);router['delete'](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x15')]);module['exports']=router; \ No newline at end of file +var _0x0c75=['index','/:id','isAuthenticated','show','getIntervals','post','create','/:id/sub_intervals','/:id/sub_intervals/create_many','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x22bef8,_0x2e19e7){var _0x4e0144=function(_0xee4c4b){while(--_0xee4c4b){_0x22bef8['push'](_0x22bef8['shift']());}};_0x4e0144(++_0x2e19e7);}(_0x0c75,0x6a));var _0x50c7=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0c75[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0x50c7('0x0'));var path=require('path');var timeout=require(_0x50c7('0x1'));var express=require(_0x50c7('0x2'));var router=express[_0x50c7('0x3')]();var fs_extra=require(_0x50c7('0x4'));var auth=require(_0x50c7('0x5'));var interaction=require(_0x50c7('0x6'));var config=require(_0x50c7('0x7'));var controller=require('./interval.controller');router[_0x50c7('0x8')]('/',auth['isAuthenticated'](),controller[_0x50c7('0x9')]);router['get'](_0x50c7('0xa'),auth[_0x50c7('0xb')](),controller[_0x50c7('0xc')]);router['get']('/:id/sub_intervals',auth[_0x50c7('0xb')](),controller[_0x50c7('0xd')]);router[_0x50c7('0xe')]('/',auth[_0x50c7('0xb')](),controller[_0x50c7('0xf')]);router[_0x50c7('0xe')](_0x50c7('0x10'),auth['isAuthenticated'](),controller['addInterval']);router[_0x50c7('0xe')](_0x50c7('0x11'),auth[_0x50c7('0xb')](),controller['addIntervals']);router[_0x50c7('0x12')](_0x50c7('0xa'),auth[_0x50c7('0xb')](),controller[_0x50c7('0x13')]);router[_0x50c7('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x50c7('0x15')]);module[_0x50c7('0x16')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 31b0f97..4532c85 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 _0x7d18=['STRING','sequelize'];(function(_0x56b346,_0x545800){var _0x281eb5=function(_0x29dbda){while(--_0x29dbda){_0x56b346['push'](_0x56b346['shift']());}};_0x281eb5(++_0x545800);}(_0x7d18,0xa1));var _0x87d1=function(_0x454165,_0x1f3e74){_0x454165=_0x454165-0x0;var _0x56db53=_0x7d18[_0x454165];return _0x56db53;};'use strict';var Sequelize=require(_0x87d1('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x87d1('0x1')]},'interval':{'type':Sequelize[_0x87d1('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x1b98=['STRING'];(function(_0x45aa1b,_0x263ff5){var _0x22bdeb=function(_0x18d607){while(--_0x18d607){_0x45aa1b['push'](_0x45aa1b['shift']());}};_0x22bdeb(++_0x263ff5);}(_0x1b98,0x146));var _0x81b9=function(_0x225963,_0x5bc068){_0x225963=_0x225963-0x0;var _0x21c9cd=_0x1b98[_0x225963];return _0x21c9cd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x81b9('0x0')]},'description':{'type':Sequelize[_0x81b9('0x0')]},'interval':{'type':Sequelize[_0x81b9('0x0')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 08643d9..42b5d9a 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 _0x23b9=['findOne','pick','options','addIntervals','sequelize','transaction','bulkCreate','request-promise','moment','util','path','sox','ejs','fs-extra','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','../../components/extensions/rewrite','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','Interval','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Intervals','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','IntervalId','getIntervals'];(function(_0x2a7c2a,_0x37cc9e){var _0x195732=function(_0x4d3902){while(--_0x4d3902){_0x2a7c2a['push'](_0x2a7c2a['shift']());}};_0x195732(++_0x37cc9e);}(_0x23b9,0xbb));var _0x923b=function(_0x2fb5a6,_0x2b78b9){_0x2fb5a6=_0x2fb5a6-0x0;var _0x25c776=_0x23b9[_0x2fb5a6];return _0x25c776;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x923b('0x0'));var moment=require(_0x923b('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x923b('0x2'));var path=require(_0x923b('0x3'));var sox=require(_0x923b('0x4'));var csv=require('to-csv');var ejs=require(_0x923b('0x5'));var fs=require('fs');var fs_extra=require(_0x923b('0x6'));var _=require('lodash');var squel=require(_0x923b('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x923b('0x8'));var toCsv=require(_0x923b('0x9'));var querystring=require(_0x923b('0xa'));var Papa=require(_0x923b('0xb'));var Redis=require(_0x923b('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x923b('0xd'));var as=require(_0x923b('0xe'));var hardwareService=require(_0x923b('0xf'));var logger=require(_0x923b('0x10'))(_0x923b('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x923b('0x12'))['db'];var extensions=require(_0x923b('0x13'));function respondWithStatusCode(_0x1e113e,_0x1d83a1){_0x1d83a1=_0x1d83a1||0xcc;return function(_0x4ceb85){if(_0x4ceb85){return _0x1e113e['sendStatus'](_0x1d83a1);}return _0x1e113e[_0x923b('0x14')](_0x1d83a1)[_0x923b('0x15')]();};}function respondWithResult(_0x5a2b5f,_0x929b1a){_0x929b1a=_0x929b1a||0xc8;return function(_0xbe05e9){if(_0xbe05e9){return _0x5a2b5f[_0x923b('0x14')](_0x929b1a)[_0x923b('0x16')](_0xbe05e9);}};}function respondWithFilteredResult(_0x2e8970,_0x20c288){return function(_0x2d97b8){if(_0x2d97b8){var _0x2c1576=typeof _0x20c288[_0x923b('0x17')]===_0x923b('0x18')&&typeof _0x20c288[_0x923b('0x19')]==='undefined';var _0x314112=_0x2d97b8[_0x923b('0x1a')];var _0x218822=_0x2c1576?0x0:_0x20c288[_0x923b('0x17')];var _0x18d255=_0x2c1576?_0x2d97b8['count']:_0x20c288[_0x923b('0x17')]+_0x20c288[_0x923b('0x19')];var _0x23df5d;if(_0x18d255>=_0x314112){_0x18d255=_0x314112;_0x23df5d=0xc8;}else{_0x23df5d=0xce;}_0x2e8970['status'](_0x23df5d);return _0x2e8970[_0x923b('0x1b')](_0x923b('0x1c'),_0x218822+'-'+_0x18d255+'/'+_0x314112)[_0x923b('0x16')](_0x2d97b8);}return null;};}function patchUpdates(_0x2052ea){return function(_0x575514){try{jsonpatch['apply'](_0x575514,_0x2052ea,!![]);}catch(_0x3d5f14){return BPromise[_0x923b('0x1d')](_0x3d5f14);}return _0x575514[_0x923b('0x1e')]();};}function saveUpdates(_0x647a08,_0x57dd34){return function(_0x159341){if(_0x159341){return _0x159341['update'](_0x647a08)[_0x923b('0x1f')](function(_0x58a2b7){return _0x58a2b7;});}return null;};}function removeEntity(_0x409848,_0x4281f2){return function(_0x4eb509){if(_0x4eb509){return _0x4eb509[_0x923b('0x20')]()[_0x923b('0x1f')](function(){var _0x150140=_0x4eb509[_0x923b('0x21')]({'plain':!![]});var _0x327af6='Intervals';return db[_0x923b('0x22')][_0x923b('0x20')]({'where':{'type':_0x327af6,'resourceId':_0x150140['id']}})[_0x923b('0x1f')](function(){return _0x4eb509;});})[_0x923b('0x1f')](function(){_0x409848[_0x923b('0x14')](0xcc)[_0x923b('0x15')]();});}};}function handleEntityNotFound(_0x3c3a29,_0x589725){return function(_0x3ed86a){if(!_0x3ed86a){_0x3c3a29[_0x923b('0x23')](0x194);}return _0x3ed86a;};}function handleError(_0xb03b60,_0x446b8b){_0x446b8b=_0x446b8b||0x1f4;return function(_0x35689d){logger[_0x923b('0x24')](_0x35689d[_0x923b('0x25')]);if(_0x35689d[_0x923b('0x26')]){delete _0x35689d[_0x923b('0x26')];}_0xb03b60[_0x923b('0x14')](_0x446b8b)[_0x923b('0x27')](_0x35689d);};}exports[_0x923b('0x28')]=function(_0x595915,_0xa47c96){var _0x866e16={},_0x5414db={},_0x539af7={'count':0x0,'rows':[]};var _0x460e87=_[_0x923b('0x29')](db['Interval']['rawAttributes'],function(_0x16bf87){return{'name':_0x16bf87[_0x923b('0x2a')],'type':_0x16bf87[_0x923b('0x2b')][_0x923b('0x2c')]};});_0x5414db[_0x923b('0x2d')]=_[_0x923b('0x29')](_0x460e87,_0x923b('0x26'));_0x5414db['query']=_[_0x923b('0x2e')](_0x595915['query']);_0x5414db[_0x923b('0x2f')]=_[_0x923b('0x30')](_0x5414db[_0x923b('0x2d')],_0x5414db['query']);_0x866e16['attributes']=_[_0x923b('0x30')](_0x5414db[_0x923b('0x2d')],qs['fields'](_0x595915[_0x923b('0x31')][_0x923b('0x32')]));_0x866e16[_0x923b('0x33')]=_0x866e16[_0x923b('0x33')][_0x923b('0x34')]?_0x866e16['attributes']:_0x5414db[_0x923b('0x2d')];if(!_0x595915[_0x923b('0x31')][_0x923b('0x35')](_0x923b('0x36'))){_0x866e16[_0x923b('0x19')]=qs[_0x923b('0x19')](_0x595915['query'][_0x923b('0x19')]);_0x866e16[_0x923b('0x17')]=qs['offset'](_0x595915[_0x923b('0x31')][_0x923b('0x17')]);}_0x866e16[_0x923b('0x37')]=qs[_0x923b('0x38')](_0x595915[_0x923b('0x31')][_0x923b('0x38')]);_0x866e16['where']=qs['filters'](_['pick'](_0x595915['query'],_0x5414db[_0x923b('0x2f')]),_0x460e87);if(_0x595915[_0x923b('0x31')][_0x923b('0x39')]){_0x866e16[_0x923b('0x3a')]=_[_0x923b('0x3b')](_0x866e16[_0x923b('0x3a')],{'$or':_[_0x923b('0x29')](_0x460e87,function(_0x2ff6a0){if(_0x2ff6a0[_0x923b('0x2b')]!==_0x923b('0x3c')){var _0x541c4b={};_0x541c4b[_0x2ff6a0[_0x923b('0x26')]]={'$like':'%'+_0x595915[_0x923b('0x31')][_0x923b('0x39')]+'%'};return _0x541c4b;}})});}_0x866e16=_['merge']({},_0x866e16,_0x595915['options']);var _0x847d84={'where':_0x866e16['where']};return db[_0x923b('0x3d')]['count'](_0x847d84)[_0x923b('0x1f')](function(_0x47c238){_0x539af7['count']=_0x47c238;if(_0x595915[_0x923b('0x31')][_0x923b('0x3e')]){_0x866e16[_0x923b('0x3f')]=[{'all':!![]}];}return db[_0x923b('0x3d')][_0x923b('0x40')](_0x866e16);})[_0x923b('0x1f')](function(_0x58a77b){_0x539af7[_0x923b('0x41')]=_0x58a77b;return _0x539af7;})[_0x923b('0x1f')](respondWithFilteredResult(_0xa47c96,_0x866e16))[_0x923b('0x42')](handleError(_0xa47c96,null));};exports[_0x923b('0x43')]=function(_0x4a73ea,_0x269d37){var _0x2c36fe={'raw':!![],'where':{'id':_0x4a73ea['params']['id']}},_0x3ce746={};_0x3ce746[_0x923b('0x2d')]=_[_0x923b('0x2e')](db['Interval'][_0x923b('0x44')]);_0x3ce746['query']=_[_0x923b('0x2e')](_0x4a73ea[_0x923b('0x31')]);_0x3ce746[_0x923b('0x2f')]=_[_0x923b('0x30')](_0x3ce746[_0x923b('0x2d')],_0x3ce746[_0x923b('0x31')]);_0x2c36fe[_0x923b('0x33')]=_[_0x923b('0x30')](_0x3ce746[_0x923b('0x2d')],qs[_0x923b('0x32')](_0x4a73ea[_0x923b('0x31')][_0x923b('0x32')]));_0x2c36fe[_0x923b('0x33')]=_0x2c36fe[_0x923b('0x33')][_0x923b('0x34')]?_0x2c36fe[_0x923b('0x33')]:_0x3ce746[_0x923b('0x2d')];if(_0x4a73ea['query']['includeAll']){_0x2c36fe[_0x923b('0x3f')]=[{'all':!![]}];}_0x2c36fe=_['merge']({},_0x2c36fe,_0x4a73ea['options']);return db[_0x923b('0x3d')][_0x923b('0x45')](_0x2c36fe)[_0x923b('0x1f')](handleEntityNotFound(_0x269d37,null))[_0x923b('0x1f')](respondWithResult(_0x269d37,null))[_0x923b('0x42')](handleError(_0x269d37,null));};exports[_0x923b('0x46')]=function(_0x507b3a,_0x445273){return db[_0x923b('0x3d')][_0x923b('0x46')](_0x507b3a['body'],{})[_0x923b('0x1f')](function(_0x15f40e){var _0x18bb97=_0x507b3a[_0x923b('0x47')][_0x923b('0x21')]({'plain':!![]});if(!_0x18bb97)throw new Error(_0x923b('0x48'));if(_0x18bb97[_0x923b('0x49')]===_0x923b('0x47')){var _0x48b750=_0x15f40e[_0x923b('0x21')]({'plain':!![]});var _0x522e50=_0x923b('0x4a');return db[_0x923b('0x4b')][_0x923b('0x45')]({'where':{'name':_0x522e50,'userProfileId':_0x18bb97['userProfileId']},'raw':!![]})['then'](function(_0x114cc0){if(_0x114cc0&&_0x114cc0[_0x923b('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x48b750[_0x923b('0x26')],'resourceId':_0x48b750['id'],'type':_0x114cc0['name'],'sectionId':_0x114cc0['id']},{})[_0x923b('0x1f')](function(){return _0x15f40e;});}else{return _0x15f40e;}})[_0x923b('0x42')](function(_0x110e55){logger['error'](_0x923b('0x4d'),_0x110e55);throw _0x110e55;});}return _0x15f40e;})[_0x923b('0x1f')](respondWithResult(_0x445273,0xc9))[_0x923b('0x42')](handleError(_0x445273,null));};exports[_0x923b('0x4e')]=function(_0x379df5,_0x50b01){if(_0x379df5[_0x923b('0x4f')]['id']){delete _0x379df5[_0x923b('0x4f')]['id'];}return db[_0x923b('0x3d')][_0x923b('0x45')]({'where':{'id':_0x379df5['params']['id']}})[_0x923b('0x1f')](handleEntityNotFound(_0x50b01,null))[_0x923b('0x1f')](saveUpdates(_0x379df5[_0x923b('0x4f')],null))[_0x923b('0x1f')](respondWithResult(_0x50b01,null))[_0x923b('0x42')](handleError(_0x50b01,null));};exports['destroy']=function(_0x20264a,_0x16f896){return db['Interval'][_0x923b('0x45')]({'where':{'id':_0x20264a[_0x923b('0x50')]['id']}})[_0x923b('0x1f')](handleEntityNotFound(_0x16f896,null))[_0x923b('0x1f')](removeEntity(_0x16f896,null))[_0x923b('0x42')](handleError(_0x16f896,null));};exports['addInterval']=function(_0x4ac980,_0x5c1eb3,_0x37366b){if(_0x4ac980[_0x923b('0x4f')]['id']){delete _0x4ac980[_0x923b('0x4f')]['id'];}return db['Interval'][_0x923b('0x45')]({'where':{'id':_0x4ac980[_0x923b('0x50')]['id']}})['then'](handleEntityNotFound(_0x5c1eb3,null))[_0x923b('0x1f')](function(_0x29e79c){if(_0x29e79c){_0x4ac980[_0x923b('0x4f')][_0x923b('0x51')]=_0x29e79c['id'];return db[_0x923b('0x3d')]['create'](_0x4ac980[_0x923b('0x4f')]);}})[_0x923b('0x1f')](respondWithResult(_0x5c1eb3,null))[_0x923b('0x42')](handleError(_0x5c1eb3,null));};exports[_0x923b('0x52')]=function(_0x1b1933,_0x13db07,_0x5515ee){var _0x222325={};var _0x3020da={};var _0xbc3aa7;var _0x5664ce;return db['Interval'][_0x923b('0x53')]({'where':{'id':_0x1b1933[_0x923b('0x50')]['id']}})['then'](handleEntityNotFound(_0x13db07,null))[_0x923b('0x1f')](function(_0x294fcc){if(_0x294fcc){_0xbc3aa7=_0x294fcc;_0x3020da['model']=_[_0x923b('0x2e')](db[_0x923b('0x3d')][_0x923b('0x44')]);_0x3020da[_0x923b('0x31')]=_[_0x923b('0x2e')](_0x1b1933['query']);_0x3020da[_0x923b('0x2f')]=_[_0x923b('0x30')](_0x3020da[_0x923b('0x2d')],_0x3020da[_0x923b('0x31')]);_0x222325[_0x923b('0x33')]=_['intersection'](_0x3020da[_0x923b('0x2d')],qs[_0x923b('0x32')](_0x1b1933['query']['fields']));_0x222325[_0x923b('0x33')]=_0x222325['attributes'][_0x923b('0x34')]?_0x222325[_0x923b('0x33')]:_0x3020da['model'];_0x222325['order']=qs[_0x923b('0x38')](_0x1b1933[_0x923b('0x31')][_0x923b('0x38')]);_0x222325[_0x923b('0x3a')]=qs[_0x923b('0x2f')](_[_0x923b('0x54')](_0x1b1933[_0x923b('0x31')],_0x3020da['filters']));if(_0x1b1933[_0x923b('0x31')]['filter']){_0x222325[_0x923b('0x3a')]=_[_0x923b('0x3b')](_0x222325['where'],{'$or':_[_0x923b('0x29')](_0x222325[_0x923b('0x33')],function(_0x3f27b7){var _0x5c3cc9={};_0x5c3cc9[_0x3f27b7]={'$like':'%'+_0x1b1933[_0x923b('0x31')][_0x923b('0x39')]+'%'};return _0x5c3cc9;})});}_0x222325=_[_0x923b('0x3b')]({},_0x222325,_0x1b1933[_0x923b('0x55')]);return _0xbc3aa7[_0x923b('0x52')](_0x222325);}})[_0x923b('0x1f')](function(_0x280f0d){if(_0x280f0d){_0x5664ce=_0x280f0d[_0x923b('0x34')];if(!_0x1b1933['query']['hasOwnProperty'](_0x923b('0x36'))){_0x222325[_0x923b('0x19')]=qs[_0x923b('0x19')](_0x1b1933[_0x923b('0x31')]['limit']);_0x222325['offset']=qs['offset'](_0x1b1933[_0x923b('0x31')][_0x923b('0x17')]);}return _0xbc3aa7[_0x923b('0x52')](_0x222325);}})['then'](function(_0x40a9a0){if(_0x40a9a0){return _0x40a9a0?{'count':_0x5664ce,'rows':_0x40a9a0}:null;}})[_0x923b('0x1f')](respondWithResult(_0x13db07,null))[_0x923b('0x42')](handleError(_0x13db07,null));};exports[_0x923b('0x56')]=function(_0x28f8b4,_0x3f2fde,_0x2efde3){return db[_0x923b('0x3d')]['findOne']({'where':{'id':_0x28f8b4['params']['id']}})['then'](handleEntityNotFound(_0x3f2fde,null))[_0x923b('0x1f')](function(_0x18cd39){if(_0x18cd39){return db[_0x923b('0x57')][_0x923b('0x58')](function(_0x4f8c28){return db[_0x923b('0x3d')][_0x923b('0x20')]({'where':{'IntervalId':_0x28f8b4[_0x923b('0x50')]['id']},'transaction':_0x4f8c28})['then'](function(_0x1abd1b){var _0xbcb307=_[_0x923b('0x29')](_0x28f8b4[_0x923b('0x4f')],function(_0xdc4465){delete _0xdc4465['id'];_0xdc4465[_0x923b('0x51')]=_0x28f8b4[_0x923b('0x50')]['id'];return _0xdc4465;});return db[_0x923b('0x3d')][_0x923b('0x59')](_0xbcb307,{'transaction':_0x4f8c28});});})[_0x923b('0x1f')](function(){return db[_0x923b('0x3d')][_0x923b('0x40')]({'where':{'IntervalId':_0x28f8b4['params']['id']}});});}})[_0x923b('0x1f')](respondWithResult(_0x3f2fde,null))[_0x923b('0x42')](handleError(_0x3f2fde,null));}; \ No newline at end of file +var _0xf887=['model','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','show','rawAttributes','keys','length','find','create','body','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addInterval','getIntervals','findOne','addIntervals','sequelize','transaction','bulkCreate','findAll','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','Intervals','UserProfileResource','end','error','stack','name','send','index','map','Interval','type','key'];(function(_0x184cc6,_0x4961ee){var _0x3f7435=function(_0x448fed){while(--_0x448fed){_0x184cc6['push'](_0x184cc6['shift']());}};_0x3f7435(++_0x4961ee);}(_0xf887,0x186));var _0x7f88=function(_0x3d1cb0,_0x159821){_0x3d1cb0=_0x3d1cb0-0x0;var _0x415afe=_0xf887[_0x3d1cb0];return _0x415afe;};'use strict';var emlformat=require(_0x7f88('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7f88('0x1'));var jsonpatch=require(_0x7f88('0x2'));var rp=require('request-promise');var moment=require(_0x7f88('0x3'));var BPromise=require(_0x7f88('0x4'));var Mustache=require('mustache');var util=require(_0x7f88('0x5'));var path=require(_0x7f88('0x6'));var sox=require(_0x7f88('0x7'));var csv=require(_0x7f88('0x8'));var ejs=require(_0x7f88('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7f88('0xa'));var jsforce=require(_0x7f88('0xb'));var deskjs=require(_0x7f88('0xc'));var toCsv=require(_0x7f88('0x8'));var querystring=require(_0x7f88('0xd'));var Papa=require(_0x7f88('0xe'));var Redis=require(_0x7f88('0xf'));var authService=require(_0x7f88('0x10'));var qs=require(_0x7f88('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7f88('0x12'));var config=require(_0x7f88('0x13'));var licenseUtil=require(_0x7f88('0x14'));var db=require(_0x7f88('0x15'))['db'];var extensions=require(_0x7f88('0x16'));function respondWithStatusCode(_0x231cca,_0x5b6ed7){_0x5b6ed7=_0x5b6ed7||0xcc;return function(_0x209450){if(_0x209450){return _0x231cca[_0x7f88('0x17')](_0x5b6ed7);}return _0x231cca['status'](_0x5b6ed7)['end']();};}function respondWithResult(_0x5cd3ea,_0x306059){_0x306059=_0x306059||0xc8;return function(_0x2ac6db){if(_0x2ac6db){return _0x5cd3ea[_0x7f88('0x18')](_0x306059)[_0x7f88('0x19')](_0x2ac6db);}};}function respondWithFilteredResult(_0x49db43,_0x4af25f){return function(_0x545b40){if(_0x545b40){var _0x3167b0=typeof _0x4af25f[_0x7f88('0x1a')]===_0x7f88('0x1b')&&typeof _0x4af25f['limit']==='undefined';var _0xaa1bc2=_0x545b40[_0x7f88('0x1c')];var _0x2fa9a0=_0x3167b0?0x0:_0x4af25f[_0x7f88('0x1a')];var _0x295984=_0x3167b0?_0x545b40[_0x7f88('0x1c')]:_0x4af25f['offset']+_0x4af25f[_0x7f88('0x1d')];var _0x1bd4c3;if(_0x295984>=_0xaa1bc2){_0x295984=_0xaa1bc2;_0x1bd4c3=0xc8;}else{_0x1bd4c3=0xce;}_0x49db43[_0x7f88('0x18')](_0x1bd4c3);return _0x49db43[_0x7f88('0x1e')](_0x7f88('0x1f'),_0x2fa9a0+'-'+_0x295984+'/'+_0xaa1bc2)[_0x7f88('0x19')](_0x545b40);}return null;};}function patchUpdates(_0x4e32ab){return function(_0x2fec35){try{jsonpatch[_0x7f88('0x20')](_0x2fec35,_0x4e32ab,!![]);}catch(_0x136198){return BPromise[_0x7f88('0x21')](_0x136198);}return _0x2fec35['save']();};}function saveUpdates(_0x17caf1,_0x5728ff){return function(_0x1db93d){if(_0x1db93d){return _0x1db93d[_0x7f88('0x22')](_0x17caf1)[_0x7f88('0x23')](function(_0x39aa16){return _0x39aa16;});}return null;};}function removeEntity(_0x23c5d4,_0x55691b){return function(_0x197801){if(_0x197801){return _0x197801[_0x7f88('0x24')]()[_0x7f88('0x23')](function(){var _0x9804c5=_0x197801[_0x7f88('0x25')]({'plain':!![]});var _0x12b1f7=_0x7f88('0x26');return db[_0x7f88('0x27')][_0x7f88('0x24')]({'where':{'type':_0x12b1f7,'resourceId':_0x9804c5['id']}})[_0x7f88('0x23')](function(){return _0x197801;});})[_0x7f88('0x23')](function(){_0x23c5d4[_0x7f88('0x18')](0xcc)[_0x7f88('0x28')]();});}};}function handleEntityNotFound(_0x3f4cbf,_0x593b4d){return function(_0x123fea){if(!_0x123fea){_0x3f4cbf[_0x7f88('0x17')](0x194);}return _0x123fea;};}function handleError(_0x558178,_0x1bfb8e){_0x1bfb8e=_0x1bfb8e||0x1f4;return function(_0x5f1732){logger[_0x7f88('0x29')](_0x5f1732[_0x7f88('0x2a')]);if(_0x5f1732[_0x7f88('0x2b')]){delete _0x5f1732[_0x7f88('0x2b')];}_0x558178[_0x7f88('0x18')](_0x1bfb8e)[_0x7f88('0x2c')](_0x5f1732);};}exports[_0x7f88('0x2d')]=function(_0x538d8d,_0x478dbf){var _0x5506dd={},_0x592ce6={},_0x38bfe7={'count':0x0,'rows':[]};var _0x29b039=_[_0x7f88('0x2e')](db[_0x7f88('0x2f')]['rawAttributes'],function(_0x13c45e){return{'name':_0x13c45e['fieldName'],'type':_0x13c45e[_0x7f88('0x30')][_0x7f88('0x31')]};});_0x592ce6[_0x7f88('0x32')]=_[_0x7f88('0x2e')](_0x29b039,_0x7f88('0x2b'));_0x592ce6['query']=_['keys'](_0x538d8d['query']);_0x592ce6[_0x7f88('0x33')]=_[_0x7f88('0x34')](_0x592ce6[_0x7f88('0x32')],_0x592ce6[_0x7f88('0x35')]);_0x5506dd['attributes']=_[_0x7f88('0x34')](_0x592ce6[_0x7f88('0x32')],qs[_0x7f88('0x36')](_0x538d8d['query'][_0x7f88('0x36')]));_0x5506dd[_0x7f88('0x37')]=_0x5506dd[_0x7f88('0x37')]['length']?_0x5506dd['attributes']:_0x592ce6[_0x7f88('0x32')];if(!_0x538d8d['query'][_0x7f88('0x38')](_0x7f88('0x39'))){_0x5506dd[_0x7f88('0x1d')]=qs[_0x7f88('0x1d')](_0x538d8d[_0x7f88('0x35')]['limit']);_0x5506dd[_0x7f88('0x1a')]=qs[_0x7f88('0x1a')](_0x538d8d[_0x7f88('0x35')][_0x7f88('0x1a')]);}_0x5506dd[_0x7f88('0x3a')]=qs[_0x7f88('0x3b')](_0x538d8d[_0x7f88('0x35')][_0x7f88('0x3b')]);_0x5506dd[_0x7f88('0x3c')]=qs[_0x7f88('0x33')](_[_0x7f88('0x3d')](_0x538d8d[_0x7f88('0x35')],_0x592ce6['filters']),_0x29b039);if(_0x538d8d[_0x7f88('0x35')][_0x7f88('0x3e')]){_0x5506dd[_0x7f88('0x3c')]=_[_0x7f88('0x3f')](_0x5506dd[_0x7f88('0x3c')],{'$or':_[_0x7f88('0x2e')](_0x29b039,function(_0x4d9a17){if(_0x4d9a17['type']!=='VIRTUAL'){var _0x449e75={};_0x449e75[_0x4d9a17[_0x7f88('0x2b')]]={'$like':'%'+_0x538d8d[_0x7f88('0x35')]['filter']+'%'};return _0x449e75;}})});}_0x5506dd=_[_0x7f88('0x3f')]({},_0x5506dd,_0x538d8d[_0x7f88('0x40')]);var _0x24be1a={'where':_0x5506dd[_0x7f88('0x3c')]};return db[_0x7f88('0x2f')]['count'](_0x24be1a)[_0x7f88('0x23')](function(_0x3897e2){_0x38bfe7[_0x7f88('0x1c')]=_0x3897e2;if(_0x538d8d[_0x7f88('0x35')][_0x7f88('0x41')]){_0x5506dd[_0x7f88('0x42')]=[{'all':!![]}];}return db[_0x7f88('0x2f')]['findAll'](_0x5506dd);})[_0x7f88('0x23')](function(_0xe74dff){_0x38bfe7['rows']=_0xe74dff;return _0x38bfe7;})[_0x7f88('0x23')](respondWithFilteredResult(_0x478dbf,_0x5506dd))[_0x7f88('0x43')](handleError(_0x478dbf,null));};exports[_0x7f88('0x44')]=function(_0x15ef27,_0x185795){var _0x21127d={'raw':!![],'where':{'id':_0x15ef27['params']['id']}},_0x3d7293={};_0x3d7293[_0x7f88('0x32')]=_['keys'](db[_0x7f88('0x2f')][_0x7f88('0x45')]);_0x3d7293[_0x7f88('0x35')]=_[_0x7f88('0x46')](_0x15ef27[_0x7f88('0x35')]);_0x3d7293[_0x7f88('0x33')]=_[_0x7f88('0x34')](_0x3d7293['model'],_0x3d7293['query']);_0x21127d[_0x7f88('0x37')]=_[_0x7f88('0x34')](_0x3d7293['model'],qs[_0x7f88('0x36')](_0x15ef27[_0x7f88('0x35')][_0x7f88('0x36')]));_0x21127d[_0x7f88('0x37')]=_0x21127d['attributes'][_0x7f88('0x47')]?_0x21127d['attributes']:_0x3d7293['model'];if(_0x15ef27[_0x7f88('0x35')][_0x7f88('0x41')]){_0x21127d['include']=[{'all':!![]}];}_0x21127d=_[_0x7f88('0x3f')]({},_0x21127d,_0x15ef27[_0x7f88('0x40')]);return db[_0x7f88('0x2f')][_0x7f88('0x48')](_0x21127d)[_0x7f88('0x23')](handleEntityNotFound(_0x185795,null))[_0x7f88('0x23')](respondWithResult(_0x185795,null))['catch'](handleError(_0x185795,null));};exports['create']=function(_0x4f4f74,_0x569c66){return db[_0x7f88('0x2f')][_0x7f88('0x49')](_0x4f4f74[_0x7f88('0x4a')],{})[_0x7f88('0x23')](function(_0x1a5a85){var _0x3cc177=_0x4f4f74['user']['get']({'plain':!![]});if(!_0x3cc177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3cc177[_0x7f88('0x4b')]===_0x7f88('0x4c')){var _0x3be194=_0x1a5a85[_0x7f88('0x25')]({'plain':!![]});var _0x5b99b4=_0x7f88('0x26');return db[_0x7f88('0x4d')][_0x7f88('0x48')]({'where':{'name':_0x5b99b4,'userProfileId':_0x3cc177['userProfileId']},'raw':!![]})[_0x7f88('0x23')](function(_0x95a720){if(_0x95a720&&_0x95a720['autoAssociation']===0x0){return db[_0x7f88('0x27')][_0x7f88('0x49')]({'name':_0x3be194[_0x7f88('0x2b')],'resourceId':_0x3be194['id'],'type':_0x95a720['name'],'sectionId':_0x95a720['id']},{})['then'](function(){return _0x1a5a85;});}else{return _0x1a5a85;}})[_0x7f88('0x43')](function(_0x4aa008){logger['error'](_0x7f88('0x4e'),_0x4aa008);throw _0x4aa008;});}return _0x1a5a85;})[_0x7f88('0x23')](respondWithResult(_0x569c66,0xc9))[_0x7f88('0x43')](handleError(_0x569c66,null));};exports[_0x7f88('0x22')]=function(_0x1faab5,_0x34283c){if(_0x1faab5['body']['id']){delete _0x1faab5['body']['id'];}return db[_0x7f88('0x2f')][_0x7f88('0x48')]({'where':{'id':_0x1faab5[_0x7f88('0x4f')]['id']}})[_0x7f88('0x23')](handleEntityNotFound(_0x34283c,null))['then'](saveUpdates(_0x1faab5[_0x7f88('0x4a')],null))[_0x7f88('0x23')](respondWithResult(_0x34283c,null))[_0x7f88('0x43')](handleError(_0x34283c,null));};exports[_0x7f88('0x24')]=function(_0x3030c1,_0xf7e454){return db['Interval'][_0x7f88('0x48')]({'where':{'id':_0x3030c1['params']['id']}})[_0x7f88('0x23')](handleEntityNotFound(_0xf7e454,null))[_0x7f88('0x23')](removeEntity(_0xf7e454,null))[_0x7f88('0x43')](handleError(_0xf7e454,null));};exports[_0x7f88('0x50')]=function(_0x23ceba,_0x43a407,_0x4d2e9d){if(_0x23ceba[_0x7f88('0x4a')]['id']){delete _0x23ceba[_0x7f88('0x4a')]['id'];}return db['Interval']['find']({'where':{'id':_0x23ceba[_0x7f88('0x4f')]['id']}})['then'](handleEntityNotFound(_0x43a407,null))[_0x7f88('0x23')](function(_0x305dda){if(_0x305dda){_0x23ceba[_0x7f88('0x4a')]['IntervalId']=_0x305dda['id'];return db[_0x7f88('0x2f')]['create'](_0x23ceba[_0x7f88('0x4a')]);}})[_0x7f88('0x23')](respondWithResult(_0x43a407,null))[_0x7f88('0x43')](handleError(_0x43a407,null));};exports[_0x7f88('0x51')]=function(_0xce3496,_0x3f42b7,_0x46a42e){var _0x365f42={};var _0x59e602={};var _0x36225e;var _0x5bf5c4;return db[_0x7f88('0x2f')][_0x7f88('0x52')]({'where':{'id':_0xce3496[_0x7f88('0x4f')]['id']}})[_0x7f88('0x23')](handleEntityNotFound(_0x3f42b7,null))[_0x7f88('0x23')](function(_0x3b23da){if(_0x3b23da){_0x36225e=_0x3b23da;_0x59e602[_0x7f88('0x32')]=_[_0x7f88('0x46')](db['Interval'][_0x7f88('0x45')]);_0x59e602[_0x7f88('0x35')]=_[_0x7f88('0x46')](_0xce3496['query']);_0x59e602[_0x7f88('0x33')]=_['intersection'](_0x59e602[_0x7f88('0x32')],_0x59e602[_0x7f88('0x35')]);_0x365f42['attributes']=_[_0x7f88('0x34')](_0x59e602[_0x7f88('0x32')],qs['fields'](_0xce3496[_0x7f88('0x35')][_0x7f88('0x36')]));_0x365f42[_0x7f88('0x37')]=_0x365f42['attributes'][_0x7f88('0x47')]?_0x365f42[_0x7f88('0x37')]:_0x59e602[_0x7f88('0x32')];_0x365f42['order']=qs[_0x7f88('0x3b')](_0xce3496[_0x7f88('0x35')][_0x7f88('0x3b')]);_0x365f42[_0x7f88('0x3c')]=qs[_0x7f88('0x33')](_[_0x7f88('0x3d')](_0xce3496['query'],_0x59e602[_0x7f88('0x33')]));if(_0xce3496[_0x7f88('0x35')]['filter']){_0x365f42[_0x7f88('0x3c')]=_[_0x7f88('0x3f')](_0x365f42[_0x7f88('0x3c')],{'$or':_[_0x7f88('0x2e')](_0x365f42[_0x7f88('0x37')],function(_0xb8f4d7){var _0x308d02={};_0x308d02[_0xb8f4d7]={'$like':'%'+_0xce3496[_0x7f88('0x35')]['filter']+'%'};return _0x308d02;})});}_0x365f42=_[_0x7f88('0x3f')]({},_0x365f42,_0xce3496[_0x7f88('0x40')]);return _0x36225e[_0x7f88('0x51')](_0x365f42);}})['then'](function(_0x1b096a){if(_0x1b096a){_0x5bf5c4=_0x1b096a[_0x7f88('0x47')];if(!_0xce3496[_0x7f88('0x35')]['hasOwnProperty']('nolimit')){_0x365f42[_0x7f88('0x1d')]=qs['limit'](_0xce3496[_0x7f88('0x35')]['limit']);_0x365f42[_0x7f88('0x1a')]=qs['offset'](_0xce3496[_0x7f88('0x35')][_0x7f88('0x1a')]);}return _0x36225e['getIntervals'](_0x365f42);}})[_0x7f88('0x23')](function(_0x1413fe){if(_0x1413fe){return _0x1413fe?{'count':_0x5bf5c4,'rows':_0x1413fe}:null;}})['then'](respondWithResult(_0x3f42b7,null))[_0x7f88('0x43')](handleError(_0x3f42b7,null));};exports[_0x7f88('0x53')]=function(_0x55ca59,_0x5729d0,_0x477278){return db[_0x7f88('0x2f')][_0x7f88('0x52')]({'where':{'id':_0x55ca59[_0x7f88('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5729d0,null))[_0x7f88('0x23')](function(_0x331b01){if(_0x331b01){return db[_0x7f88('0x54')][_0x7f88('0x55')](function(_0x4b93ff){return db[_0x7f88('0x2f')]['destroy']({'where':{'IntervalId':_0x55ca59['params']['id']},'transaction':_0x4b93ff})[_0x7f88('0x23')](function(_0x5b51b6){var _0x2f6abc=_[_0x7f88('0x2e')](_0x55ca59[_0x7f88('0x4a')],function(_0x568536){delete _0x568536['id'];_0x568536['IntervalId']=_0x55ca59[_0x7f88('0x4f')]['id'];return _0x568536;});return db[_0x7f88('0x2f')][_0x7f88('0x56')](_0x2f6abc,{'transaction':_0x4b93ff});});})[_0x7f88('0x23')](function(){return db['Interval'][_0x7f88('0x57')]({'where':{'IntervalId':_0x55ca59['params']['id']}});});}})['then'](respondWithResult(_0x5729d0,null))['catch'](handleError(_0x5729d0,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 30831f1..83211e3 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 _0x534e=['request-promise','path','rimraf','../../config/environment','../../components/extensions/rewrite','exports','define','rewrite','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x576ab9,_0x2e6eef){var _0x4fcf15=function(_0x366831){while(--_0x366831){_0x576ab9['push'](_0x576ab9['shift']());}};_0x4fcf15(++_0x2e6eef);}(_0x534e,0x1c8));var _0xe534=function(_0x284506,_0x191316){_0x284506=_0x284506-0x0;var _0x1e9ee5=_0x534e[_0x284506];return _0x1e9ee5;};'use strict';var _=require(_0xe534('0x0'));var util=require(_0xe534('0x1'));var logger=require(_0xe534('0x2'))(_0xe534('0x3'));var moment=require(_0xe534('0x4'));var BPromise=require(_0xe534('0x5'));var rp=require(_0xe534('0x6'));var fs=require('fs');var path=require(_0xe534('0x7'));var rimraf=require(_0xe534('0x8'));var config=require(_0xe534('0x9'));var attributes=require('./interval.attributes');var extensions=require(_0xe534('0xa'));module[_0xe534('0xb')]=function(_0x37cccd,_0x5e71b1){return _0x37cccd[_0xe534('0xc')]('Interval',attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3aa940,_0x3a5874){extensions['rewrite'](_0x37cccd,_0x3aa940);},'afterBulkCreate':function(_0x3a1fc0,_0x57048c,_0x37d451){_0x37d451();extensions[_0xe534('0xd')](_0x37cccd,_0x3a1fc0[0x0]);},'afterUpdate':function(_0x1b4c5d,_0x4a39c5){extensions[_0xe534('0xd')](_0x37cccd,_0x1b4c5d);},'afterDestroy':function(_0x303d91,_0x1714c9){extensions['rewrite'](_0x37cccd,_0x303d91);}}});}; \ No newline at end of file +var _0xf9d8=['rewrite','lodash','util','../../config/logger','api','path','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals'];(function(_0x4392b5,_0x2b0e7d){var _0x2d7292=function(_0x149bf1){while(--_0x149bf1){_0x4392b5['push'](_0x4392b5['shift']());}};_0x2d7292(++_0x2b0e7d);}(_0xf9d8,0xc4));var _0x8f9d=function(_0x426d71,_0x4b3f7f){_0x426d71=_0x426d71-0x0;var _0x195003=_0xf9d8[_0x426d71];return _0x195003;};'use strict';var _=require(_0x8f9d('0x0'));var util=require(_0x8f9d('0x1'));var logger=require(_0x8f9d('0x2'))(_0x8f9d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8f9d('0x4'));var rimraf=require('rimraf');var config=require(_0x8f9d('0x5'));var attributes=require(_0x8f9d('0x6'));var extensions=require(_0x8f9d('0x7'));module[_0x8f9d('0x8')]=function(_0x8398ca,_0x4f736d){return _0x8398ca[_0x8f9d('0x9')](_0x8f9d('0xa'),attributes,{'tableName':_0x8f9d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x585484,_0x1be306){extensions['rewrite'](_0x8398ca,_0x585484);},'afterBulkCreate':function(_0x38c6d2,_0x117a65,_0x8c3ce0){_0x8c3ce0();extensions[_0x8f9d('0xc')](_0x8398ca,_0x38c6d2[0x0]);},'afterUpdate':function(_0x461fc8,_0x417a83){extensions[_0x8f9d('0xc')](_0x8398ca,_0x461fc8);},'afterDestroy':function(_0x4d3967,_0x386383){extensions[_0x8f9d('0xc')](_0x8398ca,_0x4d3967);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index dc3b09d..087b350 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(_0x5774be,_0x2259d3){var _0x4914b4=function(_0x1eebc3){while(--_0x1eebc3){_0x5774be['push'](_0x5774be['shift']());}};_0x4914b4(++_0x2259d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0x2b8077,_0x453634){var _0x308091=function(_0x426df7){while(--_0x426df7){_0x2b8077['push'](_0x2b8077['shift']());}};_0x308091(++_0x453634);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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 4c682d0..5e5e055 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(_0xadd002,_0x1f575c){var _0x38fcc0=function(_0x65652){while(--_0x65652){_0xadd002['push'](_0xadd002['shift']());}};_0x38fcc0(++_0x1f575c);}(_0x2032,0xd9));var _0x2203=function(_0x1ffa8b,_0xfae2e9){_0x1ffa8b=_0x1ffa8b-0x0;var _0x332dfd=_0x2032[_0x1ffa8b];return _0x332dfd;};'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 _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x0b0e,0x187));var _0xe0b0=function(_0x426076,_0xfdf5d2){_0x426076=_0x426076-0x0;var _0x1e9565=_0x0b0e[_0x426076];return _0x1e9565;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 8aa9b46..534d64f 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 _0x6940=['base64','setEncoding','utf8','data','end','status','statusCode','json','parse','write','openIssue','send','body','headers','x-forwarded-for','connection','socket','remoteAddress','https','../../config/logger','api','support','key','MOTGUI','Report','\x20from\x20','stringify','issuetype','fields','customfield_11501','oldToken','customfield_11502','customfield_11503','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','toString'];(function(_0x1f60e6,_0x2f53ab){var _0x43ada7=function(_0x466aae){while(--_0x466aae){_0x1f60e6['push'](_0x1f60e6['shift']());}};_0x43ada7(++_0x2f53ab);}(_0x6940,0xb6));var _0x0694=function(_0x58c297,_0x101245){_0x58c297=_0x58c297-0x0;var _0x51a103=_0x6940[_0x58c297];return _0x51a103;};'use strict';var BPromise=require('bluebird');var https=require(_0x0694('0x0'));var logger=require(_0x0694('0x1'))(_0x0694('0x2'));var USERNAME=_0x0694('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0x2d48a7,_0x23623c){var _0x367ed3={'fields':{'project':{'key':_0x2d48a7[_0x0694('0x4')]||_0x0694('0x5')},'summary':(_0x2d48a7['summary']||_0x0694('0x6'))+_0x0694('0x7')+_0x2d48a7['ip'],'description':_0x2d48a7['description']||JSON[_0x0694('0x8')](_0x2d48a7),'issuetype':{'name':_0x2d48a7[_0x0694('0x9')]||'Bug'}}};_0x367ed3[_0x0694('0xa')]['customfield_11500']=_0x2d48a7['email'];_0x367ed3['fields'][_0x0694('0xb')]=_0x2d48a7[_0x0694('0xc')];_0x367ed3[_0x0694('0xa')][_0x0694('0xd')]=_0x2d48a7['newToken'];_0x367ed3[_0x0694('0xa')][_0x0694('0xe')]=_0x2d48a7['name'];_0x367ed3[_0x0694('0xa')][_0x0694('0xf')]=_0x2d48a7[_0x0694('0x10')];_0x367ed3['fields'][_0x0694('0x11')]=_0x2d48a7['ip'];var _0x2f42ae={'host':_0x0694('0x12'),'port':0x1bb,'path':_0x0694('0x13'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x0694('0x14'),'Authorization':_0x0694('0x15')+new Buffer(USERNAME+':'+PASSWORD)[_0x0694('0x16')](_0x0694('0x17'))}};var _0x43af0b=JSON[_0x0694('0x8')](_0x367ed3);var _0x213761=https['request'](_0x2f42ae,function(_0x11d0fb){_0x11d0fb[_0x0694('0x18')](_0x0694('0x19'));var _0xded093='';_0x11d0fb['on'](_0x0694('0x1a'),function(_0x2d1701){_0xded093+=_0x2d1701;});_0x11d0fb['on'](_0x0694('0x1b'),function(){if(_0x23623c){return _0x23623c[_0x0694('0x1c')](_0x11d0fb[_0x0694('0x1d')])[_0x0694('0x1e')](JSON[_0x0694('0x1f')](_0xded093));}});});_0x213761['on']('error',function(_0x43cbb1){if(_0x23623c){return _0x23623c['status'](0x1f4)[_0x0694('0x1e')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':'api.jira'}]});}});_0x213761[_0x0694('0x20')](_0x43af0b);_0x213761[_0x0694('0x1b')]();}exports[_0x0694('0x21')]=openIssue;exports[_0x0694('0x22')]=function(_0x3777b3,_0x2e76bf){_0x3777b3[_0x0694('0x23')]['ip']=_0x3777b3[_0x0694('0x24')][_0x0694('0x25')]||_0x3777b3[_0x0694('0x26')]['remoteAddress']||_0x3777b3[_0x0694('0x27')][_0x0694('0x28')]||_0x3777b3['connection'][_0x0694('0x27')][_0x0694('0x28')];return openIssue(_0x3777b3['body'],_0x2e76bf);}; \ No newline at end of file +var _0xb140=['headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','\x20from\x20','description','stringify','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','Basic\x20','toString','base64','request','utf8','status','statusCode','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','end','send','body'];(function(_0x4d2d73,_0x5498aa){var _0x113547=function(_0x3bb6e2){while(--_0x3bb6e2){_0x4d2d73['push'](_0x4d2d73['shift']());}};_0x113547(++_0x5498aa);}(_0xb140,0x1b3));var _0x0b14=function(_0x5dd351,_0x19ebc5){_0x5dd351=_0x5dd351-0x0;var _0x1fbdba=_0xb140[_0x5dd351];return _0x1fbdba;};'use strict';var BPromise=require(_0x0b14('0x0'));var https=require('https');var logger=require(_0x0b14('0x1'))(_0x0b14('0x2'));var USERNAME=_0x0b14('0x3');var PASSWORD=_0x0b14('0x4');function openIssue(_0x3625fb,_0x1501f6){var _0x20069d={'fields':{'project':{'key':_0x3625fb[_0x0b14('0x5')]||_0x0b14('0x6')},'summary':(_0x3625fb['summary']||'Report')+_0x0b14('0x7')+_0x3625fb['ip'],'description':_0x3625fb[_0x0b14('0x8')]||JSON[_0x0b14('0x9')](_0x3625fb),'issuetype':{'name':_0x3625fb['issuetype']||'Bug'}}};_0x20069d[_0x0b14('0xa')][_0x0b14('0xb')]=_0x3625fb[_0x0b14('0xc')];_0x20069d[_0x0b14('0xa')][_0x0b14('0xd')]=_0x3625fb[_0x0b14('0xe')];_0x20069d[_0x0b14('0xa')][_0x0b14('0xf')]=_0x3625fb[_0x0b14('0x10')];_0x20069d[_0x0b14('0xa')][_0x0b14('0x11')]=_0x3625fb[_0x0b14('0x12')];_0x20069d['fields'][_0x0b14('0x13')]=_0x3625fb[_0x0b14('0x14')];_0x20069d[_0x0b14('0xa')][_0x0b14('0x15')]=_0x3625fb['ip'];var _0x5f3b5f={'host':_0x0b14('0x16'),'port':0x1bb,'path':_0x0b14('0x17'),'method':_0x0b14('0x18'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x0b14('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0x0b14('0x1a')](_0x0b14('0x1b'))}};var _0x2c0cbb=JSON[_0x0b14('0x9')](_0x20069d);var _0x97dd49=https[_0x0b14('0x1c')](_0x5f3b5f,function(_0x12d5c4){_0x12d5c4['setEncoding'](_0x0b14('0x1d'));var _0x375139='';_0x12d5c4['on']('data',function(_0x54712f){_0x375139+=_0x54712f;});_0x12d5c4['on']('end',function(){if(_0x1501f6){return _0x1501f6[_0x0b14('0x1e')](_0x12d5c4[_0x0b14('0x1f')])['json'](JSON['parse'](_0x375139));}});});_0x97dd49['on'](_0x0b14('0x20'),function(_0x3c9d40){if(_0x1501f6){return _0x1501f6['status'](0x1f4)['json']({'errors':[{'message':_0x0b14('0x21'),'type':_0x0b14('0x22')}]});}});_0x97dd49['write'](_0x2c0cbb);_0x97dd49[_0x0b14('0x23')]();}exports['openIssue']=openIssue;exports[_0x0b14('0x24')]=function(_0x51d58b,_0x22a750){_0x51d58b[_0x0b14('0x25')]['ip']=_0x51d58b[_0x0b14('0x26')][_0x0b14('0x27')]||_0x51d58b[_0x0b14('0x28')][_0x0b14('0x29')]||_0x51d58b[_0x0b14('0x2a')][_0x0b14('0x29')]||_0x51d58b[_0x0b14('0x28')]['socket'][_0x0b14('0x29')];return openIssue(_0x51d58b[_0x0b14('0x25')],_0x22a750);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index c06e677..26566b0 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 _0x91a7=['Router','../../components/auth/service','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout'];(function(_0xeb54bb,_0x2d8002){var _0x4d430f=function(_0x16bdd3){while(--_0x16bdd3){_0xeb54bb['push'](_0xeb54bb['shift']());}};_0x4d430f(++_0x2d8002);}(_0x91a7,0xe7));var _0x791a=function(_0x2e70af,_0x472b9c){_0x2e70af=_0x2e70af-0x0;var _0x3c5a4d=_0x91a7[_0x2e70af];return _0x3c5a4d;};'use strict';var multer=require('multer');var util=require(_0x791a('0x0'));var path=require(_0x791a('0x1'));var timeout=require(_0x791a('0x2'));var express=require('express');var router=express[_0x791a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x791a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x791a('0x5'));router[_0x791a('0x6')]('/',auth['isAuthenticated'](),controller[_0x791a('0x7')]);router['get'](_0x791a('0x8'),auth[_0x791a('0x9')](),controller['describe']);router[_0x791a('0x6')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0xb')]);router[_0x791a('0xc')]('/',auth['isAuthenticated'](),controller[_0x791a('0xd')]);router[_0x791a('0xe')]('/:id',auth[_0x791a('0x9')](),controller[_0x791a('0xf')]);router[_0x791a('0x10')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0x11')]);module['exports']=router; \ No newline at end of file +var _0xee5b=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router'];(function(_0x519190,_0x5acc86){var _0x23a22a=function(_0xd3aca6){while(--_0xd3aca6){_0x519190['push'](_0x519190['shift']());}};_0x23a22a(++_0x5acc86);}(_0xee5b,0x1f4));var _0xbee5=function(_0x20b8d7,_0x4cc451){_0x20b8d7=_0x20b8d7-0x0;var _0x360fcd=_0xee5b[_0x20b8d7];return _0x360fcd;};'use strict';var multer=require(_0xbee5('0x0'));var util=require('util');var path=require(_0xbee5('0x1'));var timeout=require(_0xbee5('0x2'));var express=require('express');var router=express[_0xbee5('0x3')]();var fs_extra=require(_0xbee5('0x4'));var auth=require(_0xbee5('0x5'));var interaction=require(_0xbee5('0x6'));var config=require('../../config/environment');var controller=require('./jscriptyAnswerReport.controller');router[_0xbee5('0x7')]('/',auth[_0xbee5('0x8')](),controller[_0xbee5('0x9')]);router[_0xbee5('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xbee5('0x8')](),controller[_0xbee5('0xa')]);router[_0xbee5('0xb')]('/',auth[_0xbee5('0x8')](),controller['create']);router[_0xbee5('0xc')](_0xbee5('0xd'),auth[_0xbee5('0x8')](),controller[_0xbee5('0xe')]);router[_0xbee5('0xf')](_0xbee5('0xd'),auth[_0xbee5('0x8')](),controller[_0xbee5('0x10')]);module[_0xbee5('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index ec2f54e..a00c48a 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(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x7a54,0x106));var _0x47a5=function(_0x20902e,_0x4729ec){_0x20902e=_0x20902e-0x0;var _0xf96a9f=_0x7a54[_0x20902e];return _0xf96a9f;};'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(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x7a54,0x106));var _0x47a5=function(_0x3f3903,_0x30c362){_0x3f3903=_0x3f3903-0x0;var _0x2ff413=_0x7a54[_0x3f3903];return _0x2ff413;};'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 324ebed..22788d0 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 _0x93bb=['includeAll','find','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','end','json','undefined','count','offset','limit','set','Content-Range','then','destroy','error','stack','name','send','map','JscriptyAnswerReport','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','keys'];(function(_0x4a2fde,_0x190c2f){var _0x52ab47=function(_0x28f4d5){while(--_0x28f4d5){_0x4a2fde['push'](_0x4a2fde['shift']());}};_0x52ab47(++_0x190c2f);}(_0x93bb,0x135));var _0xb93b=function(_0x2ab828,_0xcd717d){_0x2ab828=_0x2ab828-0x0;var _0x27f283=_0x93bb[_0x2ab828];return _0x27f283;};'use strict';var emlformat=require(_0xb93b('0x0'));var rimraf=require(_0xb93b('0x1'));var zipdir=require(_0xb93b('0x2'));var jsonpatch=require(_0xb93b('0x3'));var rp=require(_0xb93b('0x4'));var moment=require(_0xb93b('0x5'));var BPromise=require(_0xb93b('0x6'));var Mustache=require(_0xb93b('0x7'));var util=require(_0xb93b('0x8'));var path=require(_0xb93b('0x9'));var sox=require('sox');var csv=require(_0xb93b('0xa'));var ejs=require(_0xb93b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb93b('0xc'));var squel=require(_0xb93b('0xd'));var crypto=require('crypto');var jsforce=require(_0xb93b('0xe'));var deskjs=require(_0xb93b('0xf'));var toCsv=require(_0xb93b('0xa'));var querystring=require(_0xb93b('0x10'));var Papa=require(_0xb93b('0x11'));var Redis=require(_0xb93b('0x12'));var authService=require(_0xb93b('0x13'));var qs=require(_0xb93b('0x14'));var as=require(_0xb93b('0x15'));var hardwareService=require(_0xb93b('0x16'));var logger=require(_0xb93b('0x17'))('api');var utils=require(_0xb93b('0x18'));var config=require(_0xb93b('0x19'));var licenseUtil=require(_0xb93b('0x1a'));var db=require(_0xb93b('0x1b'))['db'];function respondWithStatusCode(_0x5ccabd,_0x44291c){_0x44291c=_0x44291c||0xcc;return function(_0x17f7b0){if(_0x17f7b0){return _0x5ccabd[_0xb93b('0x1c')](_0x44291c);}return _0x5ccabd[_0xb93b('0x1d')](_0x44291c)[_0xb93b('0x1e')]();};}function respondWithResult(_0x29d02e,_0x12ce38){_0x12ce38=_0x12ce38||0xc8;return function(_0x58c73b){if(_0x58c73b){return _0x29d02e[_0xb93b('0x1d')](_0x12ce38)[_0xb93b('0x1f')](_0x58c73b);}};}function respondWithFilteredResult(_0x4281b6,_0x1f6c4b){return function(_0x9e9479){if(_0x9e9479){var _0x1debd0=typeof _0x1f6c4b['offset']===_0xb93b('0x20')&&typeof _0x1f6c4b['limit']===_0xb93b('0x20');var _0x1f4300=_0x9e9479[_0xb93b('0x21')];var _0x11f85b=_0x1debd0?0x0:_0x1f6c4b[_0xb93b('0x22')];var _0x385100=_0x1debd0?_0x9e9479['count']:_0x1f6c4b[_0xb93b('0x22')]+_0x1f6c4b[_0xb93b('0x23')];var _0x3567cf;if(_0x385100>=_0x1f4300){_0x385100=_0x1f4300;_0x3567cf=0xc8;}else{_0x3567cf=0xce;}_0x4281b6[_0xb93b('0x1d')](_0x3567cf);return _0x4281b6[_0xb93b('0x24')](_0xb93b('0x25'),_0x11f85b+'-'+_0x385100+'/'+_0x1f4300)['json'](_0x9e9479);}return null;};}function patchUpdates(_0x57adc7){return function(_0x50f944){try{jsonpatch['apply'](_0x50f944,_0x57adc7,!![]);}catch(_0x1add64){return BPromise['reject'](_0x1add64);}return _0x50f944['save']();};}function saveUpdates(_0xdcf20c,_0x3e57aa){return function(_0x295c61){if(_0x295c61){return _0x295c61['update'](_0xdcf20c)[_0xb93b('0x26')](function(_0x31166b){return _0x31166b;});}return null;};}function removeEntity(_0x5beca0,_0x2cab58){return function(_0x2c6505){if(_0x2c6505){return _0x2c6505[_0xb93b('0x27')]()[_0xb93b('0x26')](function(){_0x5beca0[_0xb93b('0x1d')](0xcc)[_0xb93b('0x1e')]();});}};}function handleEntityNotFound(_0x4e4e16,_0x452483){return function(_0x13d5ad){if(!_0x13d5ad){_0x4e4e16[_0xb93b('0x1c')](0x194);}return _0x13d5ad;};}function handleError(_0x474928,_0x53c665){_0x53c665=_0x53c665||0x1f4;return function(_0x394d37){logger[_0xb93b('0x28')](_0x394d37[_0xb93b('0x29')]);if(_0x394d37[_0xb93b('0x2a')]){delete _0x394d37[_0xb93b('0x2a')];}_0x474928[_0xb93b('0x1d')](_0x53c665)[_0xb93b('0x2b')](_0x394d37);};}exports['index']=function(_0xb79c23,_0x5a9182){var _0x3d835a={},_0x41f593={},_0x60c609={'count':0x0,'rows':[]};var _0x2b31b1=_[_0xb93b('0x2c')](db[_0xb93b('0x2d')][_0xb93b('0x2e')],function(_0x42ee85){return{'name':_0x42ee85[_0xb93b('0x2f')],'type':_0x42ee85['type']['key']};});_0x41f593[_0xb93b('0x30')]=_[_0xb93b('0x2c')](_0x2b31b1,_0xb93b('0x2a'));_0x41f593['query']=_['keys'](_0xb79c23[_0xb93b('0x31')]);_0x41f593[_0xb93b('0x32')]=_[_0xb93b('0x33')](_0x41f593['model'],_0x41f593['query']);_0x3d835a[_0xb93b('0x34')]=_[_0xb93b('0x33')](_0x41f593[_0xb93b('0x30')],qs[_0xb93b('0x35')](_0xb79c23[_0xb93b('0x31')][_0xb93b('0x35')]));_0x3d835a[_0xb93b('0x34')]=_0x3d835a['attributes'][_0xb93b('0x36')]?_0x3d835a[_0xb93b('0x34')]:_0x41f593[_0xb93b('0x30')];if(!_0xb79c23[_0xb93b('0x31')][_0xb93b('0x37')](_0xb93b('0x38'))){_0x3d835a[_0xb93b('0x23')]=qs['limit'](_0xb79c23[_0xb93b('0x31')][_0xb93b('0x23')]);_0x3d835a[_0xb93b('0x22')]=qs[_0xb93b('0x22')](_0xb79c23[_0xb93b('0x31')][_0xb93b('0x22')]);}_0x3d835a[_0xb93b('0x39')]=qs['sort'](_0xb79c23[_0xb93b('0x31')][_0xb93b('0x3a')]);_0x3d835a[_0xb93b('0x3b')]=qs[_0xb93b('0x32')](_[_0xb93b('0x3c')](_0xb79c23[_0xb93b('0x31')],_0x41f593[_0xb93b('0x32')]),_0x2b31b1);if(_0xb79c23[_0xb93b('0x31')][_0xb93b('0x3d')]){_0x3d835a[_0xb93b('0x3b')]=_[_0xb93b('0x3e')](_0x3d835a[_0xb93b('0x3b')],{'$or':_[_0xb93b('0x2c')](_0x2b31b1,function(_0x2adc47){if(_0x2adc47['type']!==_0xb93b('0x3f')){var _0x1462d4={};_0x1462d4[_0x2adc47['name']]={'$like':'%'+_0xb79c23[_0xb93b('0x31')][_0xb93b('0x3d')]+'%'};return _0x1462d4;}})});}_0x3d835a=_[_0xb93b('0x3e')]({},_0x3d835a,_0xb79c23[_0xb93b('0x40')]);var _0x8f34e9={'where':_0x3d835a[_0xb93b('0x3b')]};return db['JscriptyAnswerReport'][_0xb93b('0x21')](_0x8f34e9)[_0xb93b('0x26')](function(_0x10ad42){_0x60c609[_0xb93b('0x21')]=_0x10ad42;if(_0xb79c23['query']['includeAll']){_0x3d835a[_0xb93b('0x41')]=[{'all':!![]}];}return db[_0xb93b('0x2d')][_0xb93b('0x42')](_0x3d835a);})[_0xb93b('0x26')](function(_0x53aaaa){_0x60c609[_0xb93b('0x43')]=_0x53aaaa;return _0x60c609;})['then'](respondWithFilteredResult(_0x5a9182,_0x3d835a))[_0xb93b('0x44')](handleError(_0x5a9182,null));};exports['show']=function(_0x382261,_0x6f9464){var _0x159d3b={'raw':!![],'where':{'id':_0x382261[_0xb93b('0x45')]['id']}},_0x3b1617={};_0x3b1617[_0xb93b('0x30')]=_[_0xb93b('0x46')](db['JscriptyAnswerReport'][_0xb93b('0x2e')]);_0x3b1617['query']=_[_0xb93b('0x46')](_0x382261['query']);_0x3b1617['filters']=_[_0xb93b('0x33')](_0x3b1617[_0xb93b('0x30')],_0x3b1617[_0xb93b('0x31')]);_0x159d3b[_0xb93b('0x34')]=_[_0xb93b('0x33')](_0x3b1617['model'],qs['fields'](_0x382261[_0xb93b('0x31')][_0xb93b('0x35')]));_0x159d3b[_0xb93b('0x34')]=_0x159d3b['attributes'][_0xb93b('0x36')]?_0x159d3b[_0xb93b('0x34')]:_0x3b1617['model'];if(_0x382261[_0xb93b('0x31')][_0xb93b('0x47')]){_0x159d3b[_0xb93b('0x41')]=[{'all':!![]}];}_0x159d3b=_[_0xb93b('0x3e')]({},_0x159d3b,_0x382261['options']);return db[_0xb93b('0x2d')][_0xb93b('0x48')](_0x159d3b)['then'](handleEntityNotFound(_0x6f9464,null))[_0xb93b('0x26')](respondWithResult(_0x6f9464,null))[_0xb93b('0x44')](handleError(_0x6f9464,null));};exports['create']=function(_0x4951fe,_0x31bd33){return db[_0xb93b('0x2d')]['create'](_0x4951fe[_0xb93b('0x49')],{})[_0xb93b('0x26')](respondWithResult(_0x31bd33,0xc9))[_0xb93b('0x44')](handleError(_0x31bd33,null));};exports[_0xb93b('0x4a')]=function(_0x1b3ca9,_0x2b47d4){if(_0x1b3ca9['body']['id']){delete _0x1b3ca9[_0xb93b('0x49')]['id'];}return db[_0xb93b('0x2d')]['find']({'where':{'id':_0x1b3ca9[_0xb93b('0x45')]['id']}})['then'](handleEntityNotFound(_0x2b47d4,null))[_0xb93b('0x26')](saveUpdates(_0x1b3ca9[_0xb93b('0x49')],null))[_0xb93b('0x26')](respondWithResult(_0x2b47d4,null))[_0xb93b('0x44')](handleError(_0x2b47d4,null));};exports[_0xb93b('0x27')]=function(_0x536890,_0x56f7ea){return db[_0xb93b('0x2d')][_0xb93b('0x48')]({'where':{'id':_0x536890[_0xb93b('0x45')]['id']}})[_0xb93b('0x26')](handleEntityNotFound(_0x56f7ea,null))[_0xb93b('0x26')](removeEntity(_0x56f7ea,null))[_0xb93b('0x44')](handleError(_0x56f7ea,null));};exports[_0xb93b('0x4b')]=function(_0x49797b,_0x48c2df){return db['JscriptyAnswerReport'][_0xb93b('0x4b')]()['then'](respondWithResult(_0x48c2df,null))['catch'](handleError(_0x48c2df,null));}; \ No newline at end of file +var _0x2e8a=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','end','error','name','send','map','JscriptyAnswerReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','rimraf','zip-dir','request-promise','moment','mustache','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service'];(function(_0x4ab796,_0x5058f0){var _0x2f6041=function(_0x10cab5){while(--_0x10cab5){_0x4ab796['push'](_0x4ab796['shift']());}};_0x2f6041(++_0x5058f0);}(_0x2e8a,0xc7));var _0xa2e8=function(_0x118653,_0x50ef26){_0x118653=_0x118653-0x0;var _0xc11fa6=_0x2e8a[_0x118653];return _0xc11fa6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa2e8('0x0'));var zipdir=require(_0xa2e8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa2e8('0x2'));var moment=require(_0xa2e8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa2e8('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa2e8('0x5'));var fs=require('fs');var fs_extra=require(_0xa2e8('0x6'));var _=require(_0xa2e8('0x7'));var squel=require('squel');var crypto=require(_0xa2e8('0x8'));var jsforce=require(_0xa2e8('0x9'));var deskjs=require(_0xa2e8('0xa'));var toCsv=require(_0xa2e8('0xb'));var querystring=require('querystring');var Papa=require(_0xa2e8('0xc'));var Redis=require('ioredis');var authService=require(_0xa2e8('0xd'));var qs=require(_0xa2e8('0xe'));var as=require(_0xa2e8('0xf'));var hardwareService=require(_0xa2e8('0x10'));var logger=require(_0xa2e8('0x11'))('api');var utils=require(_0xa2e8('0x12'));var config=require(_0xa2e8('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xa2e8('0x14'))['db'];function respondWithStatusCode(_0x4e985d,_0x38abcb){_0x38abcb=_0x38abcb||0xcc;return function(_0x1dfccb){if(_0x1dfccb){return _0x4e985d[_0xa2e8('0x15')](_0x38abcb);}return _0x4e985d['status'](_0x38abcb)['end']();};}function respondWithResult(_0x5e3a2b,_0x469c1e){_0x469c1e=_0x469c1e||0xc8;return function(_0x517d54){if(_0x517d54){return _0x5e3a2b[_0xa2e8('0x16')](_0x469c1e)['json'](_0x517d54);}};}function respondWithFilteredResult(_0x5a99bf,_0x29cd40){return function(_0x41161f){if(_0x41161f){var _0x79aba2=typeof _0x29cd40[_0xa2e8('0x17')]===_0xa2e8('0x18')&&typeof _0x29cd40['limit']===_0xa2e8('0x18');var _0x53ca1f=_0x41161f['count'];var _0x1a7583=_0x79aba2?0x0:_0x29cd40[_0xa2e8('0x17')];var _0x21e869=_0x79aba2?_0x41161f[_0xa2e8('0x19')]:_0x29cd40[_0xa2e8('0x17')]+_0x29cd40['limit'];var _0x523bfd;if(_0x21e869>=_0x53ca1f){_0x21e869=_0x53ca1f;_0x523bfd=0xc8;}else{_0x523bfd=0xce;}_0x5a99bf[_0xa2e8('0x16')](_0x523bfd);return _0x5a99bf[_0xa2e8('0x1a')](_0xa2e8('0x1b'),_0x1a7583+'-'+_0x21e869+'/'+_0x53ca1f)[_0xa2e8('0x1c')](_0x41161f);}return null;};}function patchUpdates(_0xd8f70){return function(_0x280a87){try{jsonpatch['apply'](_0x280a87,_0xd8f70,!![]);}catch(_0x31e0f3){return BPromise[_0xa2e8('0x1d')](_0x31e0f3);}return _0x280a87[_0xa2e8('0x1e')]();};}function saveUpdates(_0x1ba92a,_0x51e9a9){return function(_0x527a3f){if(_0x527a3f){return _0x527a3f[_0xa2e8('0x1f')](_0x1ba92a)[_0xa2e8('0x20')](function(_0x5941c4){return _0x5941c4;});}return null;};}function removeEntity(_0x518532,_0x520545){return function(_0x32758e){if(_0x32758e){return _0x32758e[_0xa2e8('0x21')]()[_0xa2e8('0x20')](function(){_0x518532[_0xa2e8('0x16')](0xcc)[_0xa2e8('0x22')]();});}};}function handleEntityNotFound(_0x2b50cb,_0x107963){return function(_0x18d684){if(!_0x18d684){_0x2b50cb[_0xa2e8('0x15')](0x194);}return _0x18d684;};}function handleError(_0x3e42ff,_0x475cba){_0x475cba=_0x475cba||0x1f4;return function(_0x63fe5e){logger[_0xa2e8('0x23')](_0x63fe5e['stack']);if(_0x63fe5e[_0xa2e8('0x24')]){delete _0x63fe5e[_0xa2e8('0x24')];}_0x3e42ff[_0xa2e8('0x16')](_0x475cba)[_0xa2e8('0x25')](_0x63fe5e);};}exports['index']=function(_0x54775c,_0x2dbb3a){var _0x14558f={},_0x5367c6={},_0x6f918f={'count':0x0,'rows':[]};var _0xdf0f7f=_[_0xa2e8('0x26')](db[_0xa2e8('0x27')][_0xa2e8('0x28')],function(_0x1142e2){return{'name':_0x1142e2[_0xa2e8('0x29')],'type':_0x1142e2['type']['key']};});_0x5367c6[_0xa2e8('0x2a')]=_[_0xa2e8('0x26')](_0xdf0f7f,_0xa2e8('0x24'));_0x5367c6[_0xa2e8('0x2b')]=_[_0xa2e8('0x2c')](_0x54775c[_0xa2e8('0x2b')]);_0x5367c6[_0xa2e8('0x2d')]=_[_0xa2e8('0x2e')](_0x5367c6['model'],_0x5367c6[_0xa2e8('0x2b')]);_0x14558f[_0xa2e8('0x2f')]=_[_0xa2e8('0x2e')](_0x5367c6['model'],qs[_0xa2e8('0x30')](_0x54775c[_0xa2e8('0x2b')][_0xa2e8('0x30')]));_0x14558f[_0xa2e8('0x2f')]=_0x14558f[_0xa2e8('0x2f')][_0xa2e8('0x31')]?_0x14558f[_0xa2e8('0x2f')]:_0x5367c6[_0xa2e8('0x2a')];if(!_0x54775c[_0xa2e8('0x2b')][_0xa2e8('0x32')](_0xa2e8('0x33'))){_0x14558f[_0xa2e8('0x34')]=qs['limit'](_0x54775c[_0xa2e8('0x2b')][_0xa2e8('0x34')]);_0x14558f[_0xa2e8('0x17')]=qs[_0xa2e8('0x17')](_0x54775c[_0xa2e8('0x2b')][_0xa2e8('0x17')]);}_0x14558f[_0xa2e8('0x35')]=qs['sort'](_0x54775c['query']['sort']);_0x14558f['where']=qs[_0xa2e8('0x2d')](_[_0xa2e8('0x36')](_0x54775c[_0xa2e8('0x2b')],_0x5367c6[_0xa2e8('0x2d')]),_0xdf0f7f);if(_0x54775c['query'][_0xa2e8('0x37')]){_0x14558f[_0xa2e8('0x38')]=_['merge'](_0x14558f[_0xa2e8('0x38')],{'$or':_[_0xa2e8('0x26')](_0xdf0f7f,function(_0xccbb19){if(_0xccbb19[_0xa2e8('0x39')]!==_0xa2e8('0x3a')){var _0x3faec4={};_0x3faec4[_0xccbb19[_0xa2e8('0x24')]]={'$like':'%'+_0x54775c[_0xa2e8('0x2b')][_0xa2e8('0x37')]+'%'};return _0x3faec4;}})});}_0x14558f=_[_0xa2e8('0x3b')]({},_0x14558f,_0x54775c[_0xa2e8('0x3c')]);var _0x2c0e31={'where':_0x14558f[_0xa2e8('0x38')]};return db['JscriptyAnswerReport'][_0xa2e8('0x19')](_0x2c0e31)[_0xa2e8('0x20')](function(_0x129d7d){_0x6f918f[_0xa2e8('0x19')]=_0x129d7d;if(_0x54775c['query'][_0xa2e8('0x3d')]){_0x14558f[_0xa2e8('0x3e')]=[{'all':!![]}];}return db[_0xa2e8('0x27')][_0xa2e8('0x3f')](_0x14558f);})['then'](function(_0x2b24ad){_0x6f918f[_0xa2e8('0x40')]=_0x2b24ad;return _0x6f918f;})[_0xa2e8('0x20')](respondWithFilteredResult(_0x2dbb3a,_0x14558f))[_0xa2e8('0x41')](handleError(_0x2dbb3a,null));};exports['show']=function(_0xf3a6df,_0x2fc282){var _0x596c77={'raw':!![],'where':{'id':_0xf3a6df[_0xa2e8('0x42')]['id']}},_0x415671={};_0x415671[_0xa2e8('0x2a')]=_[_0xa2e8('0x2c')](db[_0xa2e8('0x27')][_0xa2e8('0x28')]);_0x415671['query']=_['keys'](_0xf3a6df['query']);_0x415671['filters']=_[_0xa2e8('0x2e')](_0x415671[_0xa2e8('0x2a')],_0x415671[_0xa2e8('0x2b')]);_0x596c77[_0xa2e8('0x2f')]=_[_0xa2e8('0x2e')](_0x415671[_0xa2e8('0x2a')],qs['fields'](_0xf3a6df[_0xa2e8('0x2b')][_0xa2e8('0x30')]));_0x596c77['attributes']=_0x596c77['attributes'][_0xa2e8('0x31')]?_0x596c77['attributes']:_0x415671[_0xa2e8('0x2a')];if(_0xf3a6df['query']['includeAll']){_0x596c77[_0xa2e8('0x3e')]=[{'all':!![]}];}_0x596c77=_[_0xa2e8('0x3b')]({},_0x596c77,_0xf3a6df[_0xa2e8('0x3c')]);return db[_0xa2e8('0x27')][_0xa2e8('0x43')](_0x596c77)[_0xa2e8('0x20')](handleEntityNotFound(_0x2fc282,null))[_0xa2e8('0x20')](respondWithResult(_0x2fc282,null))[_0xa2e8('0x41')](handleError(_0x2fc282,null));};exports['create']=function(_0x2d79fa,_0x9c4023){return db[_0xa2e8('0x27')][_0xa2e8('0x44')](_0x2d79fa[_0xa2e8('0x45')],{})[_0xa2e8('0x20')](respondWithResult(_0x9c4023,0xc9))['catch'](handleError(_0x9c4023,null));};exports[_0xa2e8('0x1f')]=function(_0x4dfa8c,_0x4721fd){if(_0x4dfa8c[_0xa2e8('0x45')]['id']){delete _0x4dfa8c[_0xa2e8('0x45')]['id'];}return db[_0xa2e8('0x27')]['find']({'where':{'id':_0x4dfa8c[_0xa2e8('0x42')]['id']}})[_0xa2e8('0x20')](handleEntityNotFound(_0x4721fd,null))[_0xa2e8('0x20')](saveUpdates(_0x4dfa8c[_0xa2e8('0x45')],null))[_0xa2e8('0x20')](respondWithResult(_0x4721fd,null))[_0xa2e8('0x41')](handleError(_0x4721fd,null));};exports[_0xa2e8('0x21')]=function(_0x88e2f8,_0x470912){return db[_0xa2e8('0x27')]['find']({'where':{'id':_0x88e2f8[_0xa2e8('0x42')]['id']}})[_0xa2e8('0x20')](handleEntityNotFound(_0x470912,null))[_0xa2e8('0x20')](removeEntity(_0x470912,null))[_0xa2e8('0x41')](handleError(_0x470912,null));};exports[_0xa2e8('0x46')]=function(_0x585a40,_0x75b60f){return db[_0xa2e8('0x27')][_0xa2e8('0x46')]()[_0xa2e8('0x20')](respondWithResult(_0x75b60f,null))['catch'](handleError(_0x75b60f,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 6ffcb96..f9413e9 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 _0x8e9a=['../../config/environment','exports','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3f54a2,_0x11b664){var _0x290c19=function(_0x3a3f8b){while(--_0x3a3f8b){_0x3f54a2['push'](_0x3f54a2['shift']());}};_0x290c19(++_0x11b664);}(_0x8e9a,0x154));var _0xa8e9=function(_0x5bbdeb,_0x539552){_0x5bbdeb=_0x5bbdeb-0x0;var _0x5b956a=_0x8e9a[_0x5bbdeb];return _0x5b956a;};'use strict';var _=require('lodash');var util=require(_0xa8e9('0x0'));var logger=require(_0xa8e9('0x1'))(_0xa8e9('0x2'));var moment=require(_0xa8e9('0x3'));var BPromise=require(_0xa8e9('0x4'));var rp=require(_0xa8e9('0x5'));var fs=require('fs');var path=require(_0xa8e9('0x6'));var rimraf=require(_0xa8e9('0x7'));var config=require(_0xa8e9('0x8'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xa8e9('0x9')]=function(_0x1b8f2a,_0x2d27c2){return _0x1b8f2a['define'](_0xa8e9('0xa'),attributes,{'tableName':_0xa8e9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea16=['moment','bluebird','request-promise','../../config/environment','exports','define','JscriptyAnswerReport','lodash'];(function(_0x4735f3,_0x1c1903){var _0x2dd627=function(_0x4dfd3d){while(--_0x4dfd3d){_0x4735f3['push'](_0x4735f3['shift']());}};_0x2dd627(++_0x1c1903);}(_0xea16,0x1c7));var _0x6ea1=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xea16[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x6ea1('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x6ea1('0x1'));var BPromise=require(_0x6ea1('0x2'));var rp=require(_0x6ea1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6ea1('0x4'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x6ea1('0x5')]=function(_0x3c285c,_0x5c43de){return _0x3c285c[_0x6ea1('0x6')](_0x6ea1('0x7'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 4f841fe..aa58015 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 _0x27e3=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x2b7748,_0x256db9){var _0x45f027=function(_0x28e272){while(--_0x28e272){_0x2b7748['push'](_0x2b7748['shift']());}};_0x45f027(++_0x256db9);}(_0x27e3,0x16e));var _0x327e=function(_0x5bf3b8,_0x51be9b){_0x5bf3b8=_0x5bf3b8-0x0;var _0x4b8044=_0x27e3[_0x5bf3b8];return _0x4b8044;};'use strict';var _=require(_0x327e('0x0'));var util=require(_0x327e('0x1'));var moment=require(_0x327e('0x2'));var BPromise=require(_0x327e('0x3'));var rs=require(_0x327e('0x4'));var fs=require('fs');var Redis=require(_0x327e('0x5'));var db=require(_0x327e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x327e('0x7'))('rpc');var config=require(_0x327e('0x8'));var jayson=require(_0x327e('0x9'));var client=jayson['client'][_0x327e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x505f53,_0x47c4f4,_0x3c80e8){return new BPromise(function(_0x108ebc,_0x5e16d7){return client[_0x327e('0xb')](_0x505f53,_0x3c80e8)[_0x327e('0xc')](function(_0x53f752){logger[_0x327e('0xd')](_0x327e('0xe'),_0x47c4f4,_0x327e('0xf'));logger[_0x327e('0x10')](_0x327e('0x11'),_0x47c4f4,_0x327e('0xf'),JSON[_0x327e('0x12')](_0x53f752));if(_0x53f752[_0x327e('0x13')]){if(_0x53f752['error'][_0x327e('0x14')]===0x1f4){logger[_0x327e('0x13')](_0x327e('0xe'),_0x47c4f4,_0x53f752[_0x327e('0x13')][_0x327e('0x15')]);return _0x5e16d7(_0x53f752[_0x327e('0x13')][_0x327e('0x15')]);}logger[_0x327e('0x13')](_0x327e('0xe'),_0x47c4f4,_0x53f752[_0x327e('0x13')][_0x327e('0x15')]);return _0x108ebc(_0x53f752['error'][_0x327e('0x15')]);}else{logger[_0x327e('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x47c4f4,_0x327e('0xf'));_0x108ebc(_0x53f752[_0x327e('0x16')][_0x327e('0x15')]);}})['catch'](function(_0x5f0893){logger[_0x327e('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x47c4f4,_0x5f0893);_0x5e16d7(_0x5f0893);});});} \ No newline at end of file +var _0xbf90=['request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','catch','lodash','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xbf90,0x13a));var _0x0bf9=function(_0x31247a,_0x2c0f0b){_0x31247a=_0x31247a-0x0;var _0x4cc2b3=_0xbf90[_0x31247a];return _0x4cc2b3;};'use strict';var _=require(_0x0bf9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0bf9('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0bf9('0x2'));var logger=require(_0x0bf9('0x3'))(_0x0bf9('0x4'));var config=require(_0x0bf9('0x5'));var jayson=require(_0x0bf9('0x6'));var client=jayson['client'][_0x0bf9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x22606f,_0x49e52f,_0x44fd85){return new BPromise(function(_0x57a0be,_0x3205a7){return client['request'](_0x22606f,_0x44fd85)[_0x0bf9('0x8')](function(_0x2f7170){logger[_0x0bf9('0x9')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x49e52f,_0x0bf9('0xa'));logger['debug'](_0x0bf9('0xb'),_0x49e52f,_0x0bf9('0xa'),JSON[_0x0bf9('0xc')](_0x2f7170));if(_0x2f7170[_0x0bf9('0xd')]){if(_0x2f7170[_0x0bf9('0xd')][_0x0bf9('0xe')]===0x1f4){logger['error'](_0x0bf9('0xf'),_0x49e52f,_0x2f7170[_0x0bf9('0xd')]['message']);return _0x3205a7(_0x2f7170[_0x0bf9('0xd')][_0x0bf9('0x10')]);}logger[_0x0bf9('0xd')](_0x0bf9('0xf'),_0x49e52f,_0x2f7170[_0x0bf9('0xd')][_0x0bf9('0x10')]);return _0x57a0be(_0x2f7170[_0x0bf9('0xd')][_0x0bf9('0x10')]);}else{logger[_0x0bf9('0x9')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x49e52f,_0x0bf9('0xa'));_0x57a0be(_0x2f7170['result'][_0x0bf9('0x10')]);}})[_0x0bf9('0x11')](function(_0x1a543b){logger[_0x0bf9('0xd')](_0x0bf9('0xf'),_0x49e52f,_0x1a543b);_0x3205a7(_0x1a543b);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 0c3bb83..fa518a3 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 _0x4e66=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get','/:id','isAuthenticated','show','/:id/sessions','getSessions','/:id/answers','getAnswers','30s','getSummary','post','/:id/clone','clone','put','update','destroy'];(function(_0x38233a,_0x371550){var _0x5e28ae=function(_0x4b9750){while(--_0x4b9750){_0x38233a['push'](_0x38233a['shift']());}};_0x5e28ae(++_0x371550);}(_0x4e66,0x145));var _0x64e6=function(_0x26c4d4,_0x200a38){_0x26c4d4=_0x26c4d4-0x0;var _0x1d2aa0=_0x4e66[_0x26c4d4];return _0x1d2aa0;};'use strict';var multer=require(_0x64e6('0x0'));var util=require(_0x64e6('0x1'));var path=require(_0x64e6('0x2'));var timeout=require('connect-timeout');var express=require(_0x64e6('0x3'));var router=express[_0x64e6('0x4')]();var fs_extra=require(_0x64e6('0x5'));var auth=require(_0x64e6('0x6'));var interaction=require(_0x64e6('0x7'));var config=require('../../config/environment');var controller=require(_0x64e6('0x8'));router[_0x64e6('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x64e6('0x9')](_0x64e6('0xa'),auth[_0x64e6('0xb')](),controller[_0x64e6('0xc')]);router[_0x64e6('0x9')](_0x64e6('0xd'),auth[_0x64e6('0xb')](),controller[_0x64e6('0xe')]);router[_0x64e6('0x9')](_0x64e6('0xf'),auth[_0x64e6('0xb')](),controller[_0x64e6('0x10')]);router[_0x64e6('0x9')]('/:id/summary',auth[_0x64e6('0xb')](),timeout(_0x64e6('0x11')),controller[_0x64e6('0x12')]);router[_0x64e6('0x13')]('/',auth[_0x64e6('0xb')](),controller['create']);router['post'](_0x64e6('0x14'),auth['isAuthenticated'](),controller[_0x64e6('0x15')]);router[_0x64e6('0x16')](_0x64e6('0xa'),auth[_0x64e6('0xb')](),controller[_0x64e6('0x17')]);router['delete']('/:id',auth[_0x64e6('0xb')](),controller[_0x64e6('0x18')]);module['exports']=router; \ No newline at end of file +var _0x31b5=['clone','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','index','get','/:id','isAuthenticated','show','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone'];(function(_0x4b0995,_0xa5ed19){var _0x39e843=function(_0x15efe5){while(--_0x15efe5){_0x4b0995['push'](_0x4b0995['shift']());}};_0x39e843(++_0xa5ed19);}(_0x31b5,0x91));var _0x531b=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x31b5[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x531b('0x0'));var util=require(_0x531b('0x1'));var path=require('path');var timeout=require(_0x531b('0x2'));var express=require(_0x531b('0x3'));var router=express[_0x531b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x531b('0x5'));var interaction=require(_0x531b('0x6'));var config=require(_0x531b('0x7'));var controller=require(_0x531b('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x531b('0x9')]);router[_0x531b('0xa')](_0x531b('0xb'),auth[_0x531b('0xc')](),controller[_0x531b('0xd')]);router['get']('/:id/sessions',auth['isAuthenticated'](),controller[_0x531b('0xe')]);router[_0x531b('0xa')](_0x531b('0xf'),auth[_0x531b('0xc')](),controller[_0x531b('0x10')]);router[_0x531b('0xa')](_0x531b('0x11'),auth[_0x531b('0xc')](),timeout(_0x531b('0x12')),controller[_0x531b('0x13')]);router[_0x531b('0x14')]('/',auth[_0x531b('0xc')](),controller[_0x531b('0x15')]);router[_0x531b('0x14')](_0x531b('0x16'),auth[_0x531b('0xc')](),controller[_0x531b('0x17')]);router[_0x531b('0x18')](_0x531b('0xb'),auth[_0x531b('0xc')](),controller['update']);router[_0x531b('0x19')](_0x531b('0xb'),auth[_0x531b('0xc')](),controller[_0x531b('0x1a')]);module[_0x531b('0x1b')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 67edf21..f5b0fb1 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 _0xe6c8=['stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData'];(function(_0x483ab9,_0x419148){var _0x35043b=function(_0x3453a3){while(--_0x3453a3){_0x483ab9['push'](_0x483ab9['shift']());}};_0x35043b(++_0x419148);}(_0xe6c8,0x1f4));var _0x8e6c=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xe6c8[_0x1d9aa0];return _0x226868;};'use strict';var Sequelize=require(_0x8e6c('0x0'));var _=require(_0x8e6c('0x1'));var util=require('util');module[_0x8e6c('0x2')]={'name':{'type':Sequelize[_0x8e6c('0x3')],'unique':_0x8e6c('0x4')},'description':{'type':Sequelize[_0x8e6c('0x3')]},'formData':{'type':Sequelize[_0x8e6c('0x5')](_0x8e6c('0x6')),'set':function(_0x1c5a00){if(_[_0x8e6c('0x7')](_0x1c5a00)){this[_0x8e6c('0x8')](_0x8e6c('0x9'),JSON[_0x8e6c('0xa')](_0x1c5a00));}else if(_[_0x8e6c('0xb')](_0x1c5a00)){this[_0x8e6c('0x8')](_0x8e6c('0x9'),_0x1c5a00);}else{this[_0x8e6c('0x8')](_0x8e6c('0x9'),util[_0x8e6c('0xc')](_0x8e6c('0xd'),this[_0x8e6c('0xe')](_0x8e6c('0x4'))||'',this[_0x8e6c('0xe')](_0x8e6c('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x8e6c('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x8e6c('0x10')],'defaultValue':![]}}; \ No newline at end of file +var _0x3a1c=['format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','description','BOOLEAN','sequelize','lodash','util','exports','STRING','TEXT','long','setDataValue','formData','stringify','isString'];(function(_0x2c5e18,_0x4e4e1a){var _0x481831=function(_0x150122){while(--_0x150122){_0x2c5e18['push'](_0x2c5e18['shift']());}};_0x481831(++_0x4e4e1a);}(_0x3a1c,0x1af));var _0xc3a1=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x3a1c[_0x342baa];return _0x1208f3;};'use strict';var Sequelize=require(_0xc3a1('0x0'));var _=require(_0xc3a1('0x1'));var util=require(_0xc3a1('0x2'));module[_0xc3a1('0x3')]={'name':{'type':Sequelize[_0xc3a1('0x4')],'unique':'name'},'description':{'type':Sequelize[_0xc3a1('0x4')]},'formData':{'type':Sequelize[_0xc3a1('0x5')](_0xc3a1('0x6')),'set':function(_0x24c43b){if(_['isObjectLike'](_0x24c43b)){this[_0xc3a1('0x7')](_0xc3a1('0x8'),JSON[_0xc3a1('0x9')](_0x24c43b));}else if(_[_0xc3a1('0xa')](_0x24c43b)){this['setDataValue'](_0xc3a1('0x8'),_0x24c43b);}else{this['setDataValue'](_0xc3a1('0x8'),util[_0xc3a1('0xb')](_0xc3a1('0xc'),this[_0xc3a1('0xd')](_0xc3a1('0xe'))||'',this['getDataValue'](_0xc3a1('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xc3a1('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index e3d395a..c0ad914 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 _0x85f8=['set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','query','keys','intersection','model','attributes','fields','length','nolimit','sort','where','filters','pick','type','VIRTUAL','filter','merge','includeAll','include','findAll','catch','params','options','find','create','user','UserProfileSection','userProfileId','autoAssociation','error','clone','omit','createdAt','updatedAt','body','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','findOne','JscriptySessionReport','order','ProjectId','rows','getAnswers','JscriptyAnswerReport','hasOwnProperty','fromCharCode','indexOf','toString','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x4630e2,_0x5a81e6){var _0x5b03fe=function(_0x36ed05){while(--_0x36ed05){_0x4630e2['push'](_0x4630e2['shift']());}};_0x5b03fe(++_0x5a81e6);}(_0x85f8,0xd7));var _0x885f=function(_0x247cbe,_0x10e77b){_0x247cbe=_0x247cbe-0x0;var _0x41be9d=_0x85f8[_0x247cbe];return _0x41be9d;};'use strict';var emlformat=require(_0x885f('0x0'));var rimraf=require(_0x885f('0x1'));var zipdir=require(_0x885f('0x2'));var jsonpatch=require(_0x885f('0x3'));var rp=require(_0x885f('0x4'));var moment=require(_0x885f('0x5'));var BPromise=require(_0x885f('0x6'));var Mustache=require(_0x885f('0x7'));var util=require('util');var path=require(_0x885f('0x8'));var sox=require(_0x885f('0x9'));var csv=require(_0x885f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x885f('0xb'));var _=require(_0x885f('0xc'));var squel=require(_0x885f('0xd'));var crypto=require(_0x885f('0xe'));var jsforce=require(_0x885f('0xf'));var deskjs=require(_0x885f('0x10'));var toCsv=require(_0x885f('0xa'));var querystring=require(_0x885f('0x11'));var Papa=require(_0x885f('0x12'));var Redis=require(_0x885f('0x13'));var authService=require(_0x885f('0x14'));var qs=require(_0x885f('0x15'));var as=require(_0x885f('0x16'));var hardwareService=require(_0x885f('0x17'));var logger=require('../../config/logger')(_0x885f('0x18'));var utils=require(_0x885f('0x19'));var config=require(_0x885f('0x1a'));var licenseUtil=require(_0x885f('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49000e,_0x5c117b){_0x5c117b=_0x5c117b||0xcc;return function(_0x3608ac){if(_0x3608ac){return _0x49000e[_0x885f('0x1c')](_0x5c117b);}return _0x49000e[_0x885f('0x1d')](_0x5c117b)['end']();};}function respondWithResult(_0x40b206,_0x42f3bb){_0x42f3bb=_0x42f3bb||0xc8;return function(_0x7b4cd6){if(_0x7b4cd6){return _0x40b206[_0x885f('0x1d')](_0x42f3bb)[_0x885f('0x1e')](_0x7b4cd6);}};}function respondWithFilteredResult(_0x2a0dd1,_0x1ce697){return function(_0x47f988){if(_0x47f988){var _0x3d9ba8=typeof _0x1ce697[_0x885f('0x1f')]===_0x885f('0x20')&&typeof _0x1ce697[_0x885f('0x21')]===_0x885f('0x20');var _0x3a4615=_0x47f988[_0x885f('0x22')];var _0x52e6cb=_0x3d9ba8?0x0:_0x1ce697[_0x885f('0x1f')];var _0x4fc668=_0x3d9ba8?_0x47f988[_0x885f('0x22')]:_0x1ce697[_0x885f('0x1f')]+_0x1ce697[_0x885f('0x21')];var _0x5513b1;if(_0x4fc668>=_0x3a4615){_0x4fc668=_0x3a4615;_0x5513b1=0xc8;}else{_0x5513b1=0xce;}_0x2a0dd1['status'](_0x5513b1);return _0x2a0dd1[_0x885f('0x23')](_0x885f('0x24'),_0x52e6cb+'-'+_0x4fc668+'/'+_0x3a4615)['json'](_0x47f988);}return null;};}function patchUpdates(_0x3b7230){return function(_0x2c8d9a){try{jsonpatch[_0x885f('0x25')](_0x2c8d9a,_0x3b7230,!![]);}catch(_0x59fcc6){return BPromise[_0x885f('0x26')](_0x59fcc6);}return _0x2c8d9a[_0x885f('0x27')]();};}function saveUpdates(_0x53cd9f,_0x43ce83){return function(_0xd550f0){if(_0xd550f0){return _0xd550f0[_0x885f('0x28')](_0x53cd9f)[_0x885f('0x29')](function(_0x458ff3){return _0x458ff3;});}return null;};}function removeEntity(_0x599bf8,_0x3bc09c){return function(_0x573c8c){if(_0x573c8c){return _0x573c8c[_0x885f('0x2a')]()[_0x885f('0x29')](function(){var _0x59da94=_0x573c8c[_0x885f('0x2b')]({'plain':!![]});var _0x535233='Projects';return db[_0x885f('0x2c')][_0x885f('0x2a')]({'where':{'type':_0x535233,'resourceId':_0x59da94['id']}})[_0x885f('0x29')](function(){return _0x573c8c;});})[_0x885f('0x29')](function(){_0x599bf8[_0x885f('0x1d')](0xcc)[_0x885f('0x2d')]();});}};}function handleEntityNotFound(_0x5b08a7,_0xc13dda){return function(_0x22f657){if(!_0x22f657){_0x5b08a7['sendStatus'](0x194);}return _0x22f657;};}function handleError(_0x35a1ce,_0x342cf2){_0x342cf2=_0x342cf2||0x1f4;return function(_0x2d6d89){logger['error'](_0x2d6d89[_0x885f('0x2e')]);if(_0x2d6d89[_0x885f('0x2f')]){delete _0x2d6d89[_0x885f('0x2f')];}_0x35a1ce[_0x885f('0x1d')](_0x342cf2)[_0x885f('0x30')](_0x2d6d89);};}exports[_0x885f('0x31')]=function(_0x4989ab,_0x1be6a8){var _0x41eb17={},_0x34b1a4={},_0x4f62ec={'count':0x0,'rows':[]};var _0x49d61f=_[_0x885f('0x32')](db[_0x885f('0x33')][_0x885f('0x34')],function(_0x4527f6){return{'name':_0x4527f6[_0x885f('0x35')],'type':_0x4527f6['type']['key']};});_0x34b1a4['model']=_['map'](_0x49d61f,_0x885f('0x2f'));_0x34b1a4[_0x885f('0x36')]=_[_0x885f('0x37')](_0x4989ab['query']);_0x34b1a4['filters']=_[_0x885f('0x38')](_0x34b1a4[_0x885f('0x39')],_0x34b1a4[_0x885f('0x36')]);_0x41eb17[_0x885f('0x3a')]=_[_0x885f('0x38')](_0x34b1a4[_0x885f('0x39')],qs[_0x885f('0x3b')](_0x4989ab[_0x885f('0x36')][_0x885f('0x3b')]));_0x41eb17[_0x885f('0x3a')]=_0x41eb17[_0x885f('0x3a')][_0x885f('0x3c')]?_0x41eb17['attributes']:_0x34b1a4['model'];if(!_0x4989ab[_0x885f('0x36')]['hasOwnProperty'](_0x885f('0x3d'))){_0x41eb17['limit']=qs['limit'](_0x4989ab[_0x885f('0x36')]['limit']);_0x41eb17[_0x885f('0x1f')]=qs[_0x885f('0x1f')](_0x4989ab[_0x885f('0x36')][_0x885f('0x1f')]);}_0x41eb17['order']=qs[_0x885f('0x3e')](_0x4989ab[_0x885f('0x36')]['sort']);_0x41eb17[_0x885f('0x3f')]=qs[_0x885f('0x40')](_[_0x885f('0x41')](_0x4989ab[_0x885f('0x36')],_0x34b1a4[_0x885f('0x40')]),_0x49d61f);if(_0x4989ab['query']['filter']){_0x41eb17[_0x885f('0x3f')]=_['merge'](_0x41eb17['where'],{'$or':_[_0x885f('0x32')](_0x49d61f,function(_0x3fa5fd){if(_0x3fa5fd[_0x885f('0x42')]!==_0x885f('0x43')){var _0x3e9df0={};_0x3e9df0[_0x3fa5fd[_0x885f('0x2f')]]={'$like':'%'+_0x4989ab[_0x885f('0x36')][_0x885f('0x44')]+'%'};return _0x3e9df0;}})});}_0x41eb17=_[_0x885f('0x45')]({},_0x41eb17,_0x4989ab['options']);var _0x1bb561={'where':_0x41eb17[_0x885f('0x3f')]};return db[_0x885f('0x33')][_0x885f('0x22')](_0x1bb561)[_0x885f('0x29')](function(_0x1df829){_0x4f62ec[_0x885f('0x22')]=_0x1df829;if(_0x4989ab['query'][_0x885f('0x46')]){_0x41eb17[_0x885f('0x47')]=[{'all':!![]}];}return db['JscriptyProject'][_0x885f('0x48')](_0x41eb17);})[_0x885f('0x29')](function(_0x1a25d2){_0x4f62ec['rows']=_0x1a25d2;return _0x4f62ec;})[_0x885f('0x29')](respondWithFilteredResult(_0x1be6a8,_0x41eb17))[_0x885f('0x49')](handleError(_0x1be6a8,null));};exports['show']=function(_0x3c144e,_0x262356){var _0x4d0830={'raw':![],'where':{'id':_0x3c144e[_0x885f('0x4a')]['id']}},_0x180086={};_0x180086[_0x885f('0x39')]=_[_0x885f('0x37')](db['JscriptyProject'][_0x885f('0x34')]);_0x180086[_0x885f('0x36')]=_[_0x885f('0x37')](_0x3c144e[_0x885f('0x36')]);_0x180086['filters']=_['intersection'](_0x180086[_0x885f('0x39')],_0x180086[_0x885f('0x36')]);_0x4d0830[_0x885f('0x3a')]=_[_0x885f('0x38')](_0x180086['model'],qs['fields'](_0x3c144e[_0x885f('0x36')][_0x885f('0x3b')]));_0x4d0830[_0x885f('0x3a')]=_0x4d0830[_0x885f('0x3a')][_0x885f('0x3c')]?_0x4d0830['attributes']:_0x180086[_0x885f('0x39')];if(_0x3c144e[_0x885f('0x36')][_0x885f('0x46')]){_0x4d0830[_0x885f('0x47')]=[{'all':!![]}];}_0x4d0830=_[_0x885f('0x45')]({},_0x4d0830,_0x3c144e[_0x885f('0x4b')]);return db['JscriptyProject'][_0x885f('0x4c')](_0x4d0830)[_0x885f('0x29')](handleEntityNotFound(_0x262356,null))['then'](respondWithResult(_0x262356,null))[_0x885f('0x49')](handleError(_0x262356,null));};exports[_0x885f('0x4d')]=function(_0x5123c9,_0x502f03){return db[_0x885f('0x33')][_0x885f('0x4d')](_0x5123c9['body'],{})[_0x885f('0x29')](function(_0x3eac1c){var _0x5e7278=_0x5123c9[_0x885f('0x4e')]['get']({'plain':!![]});if(!_0x5e7278)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e7278['role']==='user'){var _0x4c3d54=_0x3eac1c[_0x885f('0x2b')]({'plain':!![]});var _0x254490='Projects';return db[_0x885f('0x4f')][_0x885f('0x4c')]({'where':{'name':_0x254490,'userProfileId':_0x5e7278[_0x885f('0x50')]},'raw':!![]})['then'](function(_0xe513eb){if(_0xe513eb&&_0xe513eb[_0x885f('0x51')]===0x0){return db[_0x885f('0x2c')][_0x885f('0x4d')]({'name':_0x4c3d54['name'],'resourceId':_0x4c3d54['id'],'type':_0xe513eb[_0x885f('0x2f')],'sectionId':_0xe513eb['id']},{})['then'](function(){return _0x3eac1c;});}else{return _0x3eac1c;}})['catch'](function(_0x1bcf60){logger[_0x885f('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1bcf60);throw _0x1bcf60;});}return _0x3eac1c;})[_0x885f('0x29')](respondWithResult(_0x502f03,0xc9))['catch'](handleError(_0x502f03,null));};exports[_0x885f('0x53')]=function(_0x394242,_0x8b2efb){var _0x495d22={'where':{'id':_0x394242[_0x885f('0x4a')]['id']}},_0xf84aca={};_0xf84aca[_0x885f('0x39')]=_['keys'](db['JscriptyProject'][_0x885f('0x34')]);_0x495d22['attributes']=_[_0x885f('0x38')](_0xf84aca[_0x885f('0x39')],qs['fields'](_0x394242[_0x885f('0x36')][_0x885f('0x3b')]));_0x495d22[_0x885f('0x3a')]=_0x495d22[_0x885f('0x3a')][_0x885f('0x3c')]?_0x495d22[_0x885f('0x3a')]:_0xf84aca[_0x885f('0x39')];if(_0x394242[_0x885f('0x36')][_0x885f('0x46')]){_0x495d22[_0x885f('0x47')]=[{'all':!![]}];}_0x495d22=_[_0x885f('0x45')]({},_0x495d22,_0x394242['options']);return db['JscriptyProject'][_0x885f('0x4c')](_0x495d22)['then'](handleEntityNotFound(_0x8b2efb,null))[_0x885f('0x29')](function(_0x400fe5){if(_0x400fe5){var _0x1a8cb2=_0x400fe5['get']({'plain':!![]});_0x1a8cb2=qs[_0x885f('0x54')](_0x1a8cb2,['id',_0x885f('0x55'),_0x885f('0x56')]);_0x394242['body']=_[_0x885f('0x54')](_0x394242[_0x885f('0x57')],['id',_0x885f('0x55'),'updatedAt']);return db[_0x885f('0x33')]['create'](_[_0x885f('0x45')](_0x1a8cb2,_0x394242[_0x885f('0x57')]),{'include':_0x394242['query'][_0x885f('0x46')]?[{'all':!![]}]:undefined})[_0x885f('0x29')](function(_0xa0b9cf){var _0x1253fe=_0x394242['user'][_0x885f('0x2b')]({'plain':!![]});if(!_0x1253fe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1253fe[_0x885f('0x58')]===_0x885f('0x4e')){var _0x345bd1=_0xa0b9cf['get']({'plain':!![]});var _0x518093='Projects';return db['UserProfileSection'][_0x885f('0x4c')]({'where':{'name':_0x518093,'userProfileId':_0x1253fe[_0x885f('0x50')]},'raw':!![]})['then'](function(_0xd575c5){if(_0xd575c5&&_0xd575c5[_0x885f('0x51')]===0x0){return db['UserProfileResource'][_0x885f('0x4d')]({'name':_0x345bd1[_0x885f('0x2f')],'resourceId':_0x345bd1['id'],'type':_0xd575c5[_0x885f('0x2f')],'sectionId':_0xd575c5['id']},{})[_0x885f('0x29')](function(){return _0xa0b9cf;});}else{return _0xa0b9cf;}})['catch'](function(_0x540083){logger['error'](_0x885f('0x59'),_0x540083);throw _0x540083;});}return _0xa0b9cf;});}})['then'](respondWithResult(_0x8b2efb,0xc9))[_0x885f('0x49')](handleError(_0x8b2efb,null));};exports['update']=function(_0x25ea57,_0xe8fe51){if(_0x25ea57[_0x885f('0x57')]['id']){delete _0x25ea57[_0x885f('0x57')]['id'];}return db['JscriptyProject'][_0x885f('0x4c')]({'where':{'id':_0x25ea57[_0x885f('0x4a')]['id']}})[_0x885f('0x29')](handleEntityNotFound(_0xe8fe51,null))[_0x885f('0x29')](saveUpdates(_0x25ea57[_0x885f('0x57')],null))[_0x885f('0x29')](respondWithResult(_0xe8fe51,null))[_0x885f('0x49')](handleError(_0xe8fe51,null));};exports[_0x885f('0x2a')]=function(_0x1cbb77,_0x11d7d6){return db['JscriptyProject'][_0x885f('0x4c')]({'where':{'id':_0x1cbb77[_0x885f('0x4a')]['id']}})[_0x885f('0x29')](handleEntityNotFound(_0x11d7d6,null))[_0x885f('0x29')](removeEntity(_0x11d7d6,null))['catch'](handleError(_0x11d7d6,null));};exports[_0x885f('0x5a')]=function(_0x466b69,_0x3a93b8,_0x4e59de){var _0x40a4e1={'raw':!![],'where':{}};var _0x10e079={};var _0x1423bb={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x885f('0x5b')]({'where':{'id':_0x466b69[_0x885f('0x4a')]['id']}})[_0x885f('0x29')](handleEntityNotFound(_0x3a93b8,null))[_0x885f('0x29')](function(_0x143c7c){if(_0x143c7c){_0x10e079[_0x885f('0x39')]=_[_0x885f('0x37')](db[_0x885f('0x5c')][_0x885f('0x34')]);_0x10e079[_0x885f('0x36')]=_['keys'](_0x466b69[_0x885f('0x36')]);_0x10e079['filters']=_[_0x885f('0x38')](_0x10e079[_0x885f('0x39')],_0x10e079[_0x885f('0x36')]);_0x40a4e1['attributes']=_[_0x885f('0x38')](_0x10e079[_0x885f('0x39')],qs[_0x885f('0x3b')](_0x466b69['query'][_0x885f('0x3b')]));_0x40a4e1['attributes']=_0x40a4e1[_0x885f('0x3a')][_0x885f('0x3c')]?_0x40a4e1[_0x885f('0x3a')]:_0x10e079['model'];if(!_0x466b69[_0x885f('0x36')]['hasOwnProperty'](_0x885f('0x3d'))){_0x40a4e1[_0x885f('0x21')]=qs[_0x885f('0x21')](_0x466b69[_0x885f('0x36')][_0x885f('0x21')]);_0x40a4e1[_0x885f('0x1f')]=qs['offset'](_0x466b69['query']['offset']);}_0x40a4e1[_0x885f('0x5d')]=qs['sort'](_0x466b69['query']['sort']);_0x40a4e1[_0x885f('0x3f')]=qs[_0x885f('0x40')](_[_0x885f('0x41')](_0x466b69[_0x885f('0x36')],_0x10e079[_0x885f('0x40')]));_0x40a4e1[_0x885f('0x3f')][_0x885f('0x5e')]=_0x143c7c['id'];if(_0x466b69['query'][_0x885f('0x44')]){_0x40a4e1[_0x885f('0x3f')]=_[_0x885f('0x45')](_0x40a4e1['where'],{'$or':_[_0x885f('0x32')](_0x40a4e1[_0x885f('0x3a')],function(_0x200cd7){var _0x361dff={};_0x361dff[_0x200cd7]={'$like':'%'+_0x466b69[_0x885f('0x36')][_0x885f('0x44')]+'%'};return _0x361dff;})});}_0x40a4e1=_[_0x885f('0x45')]({},_0x40a4e1,_0x466b69['options']);return db['JscriptySessionReport'][_0x885f('0x22')]({'where':_0x40a4e1['where']})[_0x885f('0x29')](function(_0x385a42){_0x1423bb[_0x885f('0x22')]=_0x385a42;if(_0x466b69[_0x885f('0x36')][_0x885f('0x46')]){_0x40a4e1[_0x885f('0x47')]=[{'all':!![]}];}return db[_0x885f('0x5c')][_0x885f('0x48')](_0x40a4e1);})[_0x885f('0x29')](function(_0x474d42){_0x1423bb[_0x885f('0x5f')]=_0x474d42;return _0x1423bb;});}})[_0x885f('0x29')](respondWithFilteredResult(_0x3a93b8,_0x40a4e1))[_0x885f('0x49')](handleError(_0x3a93b8,null));};exports[_0x885f('0x60')]=function(_0x100a18,_0x45386e,_0x43be67){var _0x43643a={'raw':!![],'where':{}};var _0x2e8738={};var _0x3c08f5={'count':0x0,'rows':[]};return db[_0x885f('0x33')][_0x885f('0x5b')]({'where':{'id':_0x100a18[_0x885f('0x4a')]['id']}})[_0x885f('0x29')](handleEntityNotFound(_0x45386e,null))[_0x885f('0x29')](function(_0x2b2bab){if(_0x2b2bab){_0x2e8738['model']=_[_0x885f('0x37')](db[_0x885f('0x61')]['rawAttributes']);_0x2e8738['query']=_[_0x885f('0x37')](_0x100a18[_0x885f('0x36')]);_0x2e8738[_0x885f('0x40')]=_[_0x885f('0x38')](_0x2e8738[_0x885f('0x39')],_0x2e8738[_0x885f('0x36')]);_0x43643a['attributes']=_[_0x885f('0x38')](_0x2e8738[_0x885f('0x39')],qs[_0x885f('0x3b')](_0x100a18[_0x885f('0x36')]['fields']));_0x43643a[_0x885f('0x3a')]=_0x43643a[_0x885f('0x3a')][_0x885f('0x3c')]?_0x43643a[_0x885f('0x3a')]:_0x2e8738[_0x885f('0x39')];if(!_0x100a18[_0x885f('0x36')][_0x885f('0x62')](_0x885f('0x3d'))){_0x43643a[_0x885f('0x21')]=qs['limit'](_0x100a18[_0x885f('0x36')][_0x885f('0x21')]);_0x43643a['offset']=qs[_0x885f('0x1f')](_0x100a18['query']['offset']);}_0x43643a[_0x885f('0x5d')]=qs['sort'](_0x100a18['query'][_0x885f('0x3e')]);_0x43643a[_0x885f('0x3f')]=qs['filters'](_['pick'](_0x100a18['query'],_0x2e8738[_0x885f('0x40')]));_0x43643a[_0x885f('0x3f')][_0x885f('0x5e')]=_0x2b2bab['id'];if(_0x100a18[_0x885f('0x36')]['filter']){_0x43643a['where']=_[_0x885f('0x45')](_0x43643a[_0x885f('0x3f')],{'$or':_[_0x885f('0x32')](_0x43643a[_0x885f('0x3a')],function(_0x508c75){var _0x32570b={};_0x32570b[_0x508c75]={'$like':'%'+_0x100a18[_0x885f('0x36')][_0x885f('0x44')]+'%'};return _0x32570b;})});}_0x43643a=_['merge']({},_0x43643a,_0x100a18[_0x885f('0x4b')]);return db[_0x885f('0x61')][_0x885f('0x22')]({'where':_0x43643a[_0x885f('0x3f')]})[_0x885f('0x29')](function(_0x66de91){_0x3c08f5[_0x885f('0x22')]=_0x66de91;if(_0x100a18[_0x885f('0x36')][_0x885f('0x46')]){_0x43643a['include']=[{'all':!![]}];}return db[_0x885f('0x61')][_0x885f('0x48')](_0x43643a);})['then'](function(_0x32f9f6){_0x3c08f5['rows']=_0x32f9f6;return _0x3c08f5;});}})[_0x885f('0x29')](respondWithFilteredResult(_0x45386e,_0x43643a))[_0x885f('0x49')](handleError(_0x45386e,null));};function char(_0xaf236d){return'number'===typeof _0xaf236d?String[_0x885f('0x63')][_0x885f('0x25')](null,arguments):_0xaf236d;}function needsEncapsulation(_0x91f139){return!!_0x91f139&&(_0x91f139['toString']()[_0x885f('0x64')](char(0xd))>=0x0||_0x91f139[_0x885f('0x65')]()[_0x885f('0x64')](char(0xa))>=0x0||_0x91f139[_0x885f('0x65')]()[_0x885f('0x64')](char(0x2c))>=0x0||_0x91f139[_0x885f('0x65')]()[_0x885f('0x64')](char(0x22))>=0x0);}function encapsulate(_0x5b7ff1){var _0xfcbbb4=char(0x22),_0x3a4dd0='\x5c'+char(0x22),_0x23f713=_0x5b7ff1[_0x885f('0x65')]()[_0x885f('0x66')](new RegExp(_0xfcbbb4,'g'),_0x3a4dd0);return _0xfcbbb4+_0x23f713+_0xfcbbb4;}exports[_0x885f('0x67')]=function(_0x364745,_0x4d4d89,_0x5842f1){var _0x2a150a,_0x304c9e;var _0x33ad16={'where':{'ProjectId':_0x364745[_0x885f('0x4a')]['id']}};if(_0x364745['query'][_0x885f('0x68')]){_0x33ad16[_0x885f('0x3f')][_0x885f('0x69')]=JSON[_0x885f('0x6a')](_0x364745[_0x885f('0x36')][_0x885f('0x68')]);}return db['JscriptySessionReport'][_0x885f('0x48')](_0x33ad16)[_0x885f('0x29')](handleEntityNotFound(_0x4d4d89,null))[_0x885f('0x29')](function(_0x550636){if(_0x550636){_0x2a150a=_0x550636;return db[_0x885f('0x6b')][_0x885f('0x48')]({'where':{'SessionId':{'$in':_[_0x885f('0x32')](_0x2a150a,'id')},'ProjectId':_0x364745['params']['id']},'order':_0x885f('0x6c')});}})[_0x885f('0x29')](handleEntityNotFound(_0x4d4d89,null))[_0x885f('0x29')](function(_0x5edea4){if(_0x5edea4){_0x304c9e=_0x5edea4;var _0x349a6f={};for(var _0x4716c0=0x0,_0x2d5c65=_0x304c9e['length'];_0x4716c0<_0x2d5c65;_0x4716c0++){if(!_0x349a6f['hasOwnProperty'](_0x304c9e[_0x4716c0][_0x885f('0x6d')])){_0x349a6f[_0x304c9e[_0x4716c0][_0x885f('0x6d')]]=needsEncapsulation(_0x304c9e[_0x4716c0][_0x885f('0x6e')])?encapsulate(_0x304c9e[_0x4716c0][_0x885f('0x6e')]):_0x304c9e[_0x4716c0]['question'];}}var _0x555af6=[],_0x20e5d2={};for(var _0x3604ed=0x0,_0x2db905=_0x2a150a['length'];_0x3604ed<_0x2db905;_0x3604ed++){_0x20e5d2={'ProjectId':_0x364745[_0x885f('0x4a')]['id'],'SessionId':_0x2a150a[_0x3604ed]['id'],'StartTime':moment(_0x2a150a[_0x3604ed][_0x885f('0x69')])[_0x885f('0x6f')](_0x885f('0x70'))};for(var _0x121264=0x0,_0x19e60e=_0x304c9e[_0x885f('0x3c')];_0x121264<_0x19e60e;_0x121264++){if(_0x304c9e[_0x121264]['SessionId']==_0x2a150a[_0x3604ed]['id']&&_0x349a6f[_0x885f('0x62')](_0x304c9e[_0x121264][_0x885f('0x6d')])){_0x20e5d2[_0x349a6f[_0x304c9e[_0x121264][_0x885f('0x6d')]]]=_0x304c9e[_0x121264]['answer'];}}for(var _0x5888ed in _0x349a6f){if(!_0x20e5d2[_0x885f('0x62')](_0x349a6f[_0x5888ed])){_0x20e5d2[_0x349a6f[_0x5888ed]]=null;}}_0x555af6[_0x885f('0x71')](_0x20e5d2);}return _0x555af6;}})[_0x885f('0x29')](function(_0x4e7b36){if(!_[_0x885f('0x72')](_0x4e7b36)){var _0x356c4f=toCsv(_0x4e7b36);var _0x555178=Date[_0x885f('0x73')]();fs[_0x885f('0x74')](util['format'](_0x885f('0x75'),_0x364745[_0x885f('0x4a')]['id'],_0x555178),_0x356c4f);_0x4d4d89[_0x885f('0x76')](_0x885f('0x77'),_0x885f('0x78')+util[_0x885f('0x6f')](_0x885f('0x79'),_0x364745['params']['id'],_0x555178));_0x4d4d89[_0x885f('0x76')](_0x885f('0x7a'),_0x885f('0x7b'));return _0x4d4d89[_0x885f('0x7c')](util[_0x885f('0x6f')](_0x885f('0x75'),_0x364745[_0x885f('0x4a')]['id'],_0x555178));}else{return _0x4d4d89[_0x885f('0x1c')](0xcc);}})[_0x885f('0x49')](handleError(_0x4d4d89,null));}; \ No newline at end of file +var _0x20a3=['push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','text/csv','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','status','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','includeAll','include','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Projects','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','merge','omit','createdAt','updatedAt','role','autoAssociation','getSessions','findOne','JscriptySessionReport','hasOwnProperty','JscriptyAnswerReport','ProjectId','findAll','rows','toString','indexOf','getSummary','startTime','starttime','JscriptyQuestionReport','questionId','question','format','answer'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x20a3,0x15b));var _0x320a=function(_0x342fca,_0x572bdf){_0x342fca=_0x342fca-0x0;var _0x59c1a2=_0x20a3[_0x342fca];return _0x59c1a2;};'use strict';var emlformat=require(_0x320a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x320a('0x1'));var jsonpatch=require(_0x320a('0x2'));var rp=require(_0x320a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x320a('0x4'));var path=require(_0x320a('0x5'));var sox=require(_0x320a('0x6'));var csv=require(_0x320a('0x7'));var ejs=require(_0x320a('0x8'));var fs=require('fs');var fs_extra=require(_0x320a('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x320a('0xa'));var jsforce=require(_0x320a('0xb'));var deskjs=require(_0x320a('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x320a('0xd'));var Redis=require('ioredis');var authService=require(_0x320a('0xe'));var qs=require(_0x320a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x320a('0x10'));var logger=require(_0x320a('0x11'))('api');var utils=require(_0x320a('0x12'));var config=require(_0x320a('0x13'));var licenseUtil=require(_0x320a('0x14'));var db=require(_0x320a('0x15'))['db'];function respondWithStatusCode(_0x570693,_0x3a6cb0){_0x3a6cb0=_0x3a6cb0||0xcc;return function(_0x42b8dc){if(_0x42b8dc){return _0x570693[_0x320a('0x16')](_0x3a6cb0);}return _0x570693['status'](_0x3a6cb0)[_0x320a('0x17')]();};}function respondWithResult(_0x35ec33,_0x4d1ab9){_0x4d1ab9=_0x4d1ab9||0xc8;return function(_0x1cbd26){if(_0x1cbd26){return _0x35ec33['status'](_0x4d1ab9)[_0x320a('0x18')](_0x1cbd26);}};}function respondWithFilteredResult(_0x2e8124,_0xfe4b71){return function(_0x44a628){if(_0x44a628){var _0x501cd2=typeof _0xfe4b71[_0x320a('0x19')]==='undefined'&&typeof _0xfe4b71['limit']===_0x320a('0x1a');var _0x59733d=_0x44a628[_0x320a('0x1b')];var _0x3a1911=_0x501cd2?0x0:_0xfe4b71[_0x320a('0x19')];var _0x45bb6b=_0x501cd2?_0x44a628[_0x320a('0x1b')]:_0xfe4b71['offset']+_0xfe4b71[_0x320a('0x1c')];var _0x147c7f;if(_0x45bb6b>=_0x59733d){_0x45bb6b=_0x59733d;_0x147c7f=0xc8;}else{_0x147c7f=0xce;}_0x2e8124['status'](_0x147c7f);return _0x2e8124[_0x320a('0x1d')](_0x320a('0x1e'),_0x3a1911+'-'+_0x45bb6b+'/'+_0x59733d)[_0x320a('0x18')](_0x44a628);}return null;};}function patchUpdates(_0x37b0ae){return function(_0x18514b){try{jsonpatch[_0x320a('0x1f')](_0x18514b,_0x37b0ae,!![]);}catch(_0x1471aa){return BPromise[_0x320a('0x20')](_0x1471aa);}return _0x18514b[_0x320a('0x21')]();};}function saveUpdates(_0x4e5c99,_0x9001c0){return function(_0x20f59d){if(_0x20f59d){return _0x20f59d[_0x320a('0x22')](_0x4e5c99)['then'](function(_0x3974bd){return _0x3974bd;});}return null;};}function removeEntity(_0x207748,_0x3981d5){return function(_0x17fd84){if(_0x17fd84){return _0x17fd84[_0x320a('0x23')]()[_0x320a('0x24')](function(){var _0x40af50=_0x17fd84[_0x320a('0x25')]({'plain':!![]});var _0x8b4862='Projects';return db[_0x320a('0x26')][_0x320a('0x23')]({'where':{'type':_0x8b4862,'resourceId':_0x40af50['id']}})[_0x320a('0x24')](function(){return _0x17fd84;});})[_0x320a('0x24')](function(){_0x207748[_0x320a('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x536f35,_0x560173){return function(_0x8457e3){if(!_0x8457e3){_0x536f35[_0x320a('0x16')](0x194);}return _0x8457e3;};}function handleError(_0x225f02,_0x64bbda){_0x64bbda=_0x64bbda||0x1f4;return function(_0x213b4e){logger[_0x320a('0x28')](_0x213b4e[_0x320a('0x29')]);if(_0x213b4e['name']){delete _0x213b4e[_0x320a('0x2a')];}_0x225f02[_0x320a('0x27')](_0x64bbda)[_0x320a('0x2b')](_0x213b4e);};}exports[_0x320a('0x2c')]=function(_0x5dbdca,_0x5cd3cc){var _0x43fe81={},_0x33e764={},_0x13565f={'count':0x0,'rows':[]};var _0x4bfd3a=_[_0x320a('0x2d')](db[_0x320a('0x2e')][_0x320a('0x2f')],function(_0x16d2f6){return{'name':_0x16d2f6[_0x320a('0x30')],'type':_0x16d2f6[_0x320a('0x31')][_0x320a('0x32')]};});_0x33e764[_0x320a('0x33')]=_['map'](_0x4bfd3a,'name');_0x33e764[_0x320a('0x34')]=_[_0x320a('0x35')](_0x5dbdca[_0x320a('0x34')]);_0x33e764['filters']=_[_0x320a('0x36')](_0x33e764[_0x320a('0x33')],_0x33e764[_0x320a('0x34')]);_0x43fe81[_0x320a('0x37')]=_[_0x320a('0x36')](_0x33e764['model'],qs['fields'](_0x5dbdca['query'][_0x320a('0x38')]));_0x43fe81[_0x320a('0x37')]=_0x43fe81[_0x320a('0x37')][_0x320a('0x39')]?_0x43fe81[_0x320a('0x37')]:_0x33e764[_0x320a('0x33')];if(!_0x5dbdca[_0x320a('0x34')]['hasOwnProperty'](_0x320a('0x3a'))){_0x43fe81['limit']=qs[_0x320a('0x1c')](_0x5dbdca[_0x320a('0x34')][_0x320a('0x1c')]);_0x43fe81[_0x320a('0x19')]=qs['offset'](_0x5dbdca[_0x320a('0x34')][_0x320a('0x19')]);}_0x43fe81[_0x320a('0x3b')]=qs['sort'](_0x5dbdca[_0x320a('0x34')][_0x320a('0x3c')]);_0x43fe81[_0x320a('0x3d')]=qs[_0x320a('0x3e')](_[_0x320a('0x3f')](_0x5dbdca[_0x320a('0x34')],_0x33e764[_0x320a('0x3e')]),_0x4bfd3a);if(_0x5dbdca[_0x320a('0x34')][_0x320a('0x40')]){_0x43fe81['where']=_['merge'](_0x43fe81['where'],{'$or':_['map'](_0x4bfd3a,function(_0x742cb3){if(_0x742cb3[_0x320a('0x31')]!==_0x320a('0x41')){var _0xe86caf={};_0xe86caf[_0x742cb3[_0x320a('0x2a')]]={'$like':'%'+_0x5dbdca[_0x320a('0x34')]['filter']+'%'};return _0xe86caf;}})});}_0x43fe81=_['merge']({},_0x43fe81,_0x5dbdca['options']);var _0x3e39af={'where':_0x43fe81[_0x320a('0x3d')]};return db[_0x320a('0x2e')][_0x320a('0x1b')](_0x3e39af)[_0x320a('0x24')](function(_0x1f9ce6){_0x13565f[_0x320a('0x1b')]=_0x1f9ce6;if(_0x5dbdca['query'][_0x320a('0x42')]){_0x43fe81[_0x320a('0x43')]=[{'all':!![]}];}return db[_0x320a('0x2e')]['findAll'](_0x43fe81);})[_0x320a('0x24')](function(_0x44dabf){_0x13565f['rows']=_0x44dabf;return _0x13565f;})['then'](respondWithFilteredResult(_0x5cd3cc,_0x43fe81))[_0x320a('0x44')](handleError(_0x5cd3cc,null));};exports[_0x320a('0x45')]=function(_0x25fb77,_0x581372){var _0x3a68de={'raw':![],'where':{'id':_0x25fb77[_0x320a('0x46')]['id']}},_0x139d4c={};_0x139d4c[_0x320a('0x33')]=_[_0x320a('0x35')](db[_0x320a('0x2e')][_0x320a('0x2f')]);_0x139d4c[_0x320a('0x34')]=_[_0x320a('0x35')](_0x25fb77[_0x320a('0x34')]);_0x139d4c[_0x320a('0x3e')]=_[_0x320a('0x36')](_0x139d4c[_0x320a('0x33')],_0x139d4c['query']);_0x3a68de[_0x320a('0x37')]=_[_0x320a('0x36')](_0x139d4c[_0x320a('0x33')],qs[_0x320a('0x38')](_0x25fb77[_0x320a('0x34')]['fields']));_0x3a68de[_0x320a('0x37')]=_0x3a68de[_0x320a('0x37')][_0x320a('0x39')]?_0x3a68de[_0x320a('0x37')]:_0x139d4c[_0x320a('0x33')];if(_0x25fb77['query'][_0x320a('0x42')]){_0x3a68de['include']=[{'all':!![]}];}_0x3a68de=_['merge']({},_0x3a68de,_0x25fb77[_0x320a('0x47')]);return db[_0x320a('0x2e')][_0x320a('0x48')](_0x3a68de)[_0x320a('0x24')](handleEntityNotFound(_0x581372,null))[_0x320a('0x24')](respondWithResult(_0x581372,null))[_0x320a('0x44')](handleError(_0x581372,null));};exports[_0x320a('0x49')]=function(_0x465d26,_0x236158){return db['JscriptyProject'][_0x320a('0x49')](_0x465d26[_0x320a('0x4a')],{})[_0x320a('0x24')](function(_0x2010fc){var _0x4ed622=_0x465d26['user'][_0x320a('0x25')]({'plain':!![]});if(!_0x4ed622)throw new Error(_0x320a('0x4b'));if(_0x4ed622['role']===_0x320a('0x4c')){var _0x42afe0=_0x2010fc['get']({'plain':!![]});var _0x839c0d=_0x320a('0x4d');return db[_0x320a('0x4e')]['find']({'where':{'name':_0x839c0d,'userProfileId':_0x4ed622[_0x320a('0x4f')]},'raw':!![]})['then'](function(_0x2b927d){if(_0x2b927d&&_0x2b927d['autoAssociation']===0x0){return db[_0x320a('0x26')]['create']({'name':_0x42afe0['name'],'resourceId':_0x42afe0['id'],'type':_0x2b927d[_0x320a('0x2a')],'sectionId':_0x2b927d['id']},{})['then'](function(){return _0x2010fc;});}else{return _0x2010fc;}})[_0x320a('0x44')](function(_0x36c65e){logger[_0x320a('0x28')](_0x320a('0x50'),_0x36c65e);throw _0x36c65e;});}return _0x2010fc;})[_0x320a('0x24')](respondWithResult(_0x236158,0xc9))['catch'](handleError(_0x236158,null));};exports['clone']=function(_0x13cbca,_0x21d02f){var _0x4bb56b={'where':{'id':_0x13cbca['params']['id']}},_0x4deb6b={};_0x4deb6b['model']=_[_0x320a('0x35')](db[_0x320a('0x2e')][_0x320a('0x2f')]);_0x4bb56b[_0x320a('0x37')]=_[_0x320a('0x36')](_0x4deb6b[_0x320a('0x33')],qs[_0x320a('0x38')](_0x13cbca[_0x320a('0x34')][_0x320a('0x38')]));_0x4bb56b['attributes']=_0x4bb56b['attributes']['length']?_0x4bb56b[_0x320a('0x37')]:_0x4deb6b[_0x320a('0x33')];if(_0x13cbca['query'][_0x320a('0x42')]){_0x4bb56b[_0x320a('0x43')]=[{'all':!![]}];}_0x4bb56b=_[_0x320a('0x51')]({},_0x4bb56b,_0x13cbca[_0x320a('0x47')]);return db[_0x320a('0x2e')]['find'](_0x4bb56b)[_0x320a('0x24')](handleEntityNotFound(_0x21d02f,null))[_0x320a('0x24')](function(_0x208a56){if(_0x208a56){var _0x279227=_0x208a56[_0x320a('0x25')]({'plain':!![]});_0x279227=qs[_0x320a('0x52')](_0x279227,['id',_0x320a('0x53'),'updatedAt']);_0x13cbca[_0x320a('0x4a')]=_[_0x320a('0x52')](_0x13cbca['body'],['id',_0x320a('0x53'),_0x320a('0x54')]);return db[_0x320a('0x2e')][_0x320a('0x49')](_[_0x320a('0x51')](_0x279227,_0x13cbca[_0x320a('0x4a')]),{'include':_0x13cbca['query'][_0x320a('0x42')]?[{'all':!![]}]:undefined})[_0x320a('0x24')](function(_0x514b22){var _0x5cfbcd=_0x13cbca[_0x320a('0x4c')][_0x320a('0x25')]({'plain':!![]});if(!_0x5cfbcd)throw new Error(_0x320a('0x4b'));if(_0x5cfbcd[_0x320a('0x55')]==='user'){var _0x3e6119=_0x514b22[_0x320a('0x25')]({'plain':!![]});var _0x29b207=_0x320a('0x4d');return db['UserProfileSection'][_0x320a('0x48')]({'where':{'name':_0x29b207,'userProfileId':_0x5cfbcd[_0x320a('0x4f')]},'raw':!![]})['then'](function(_0x409961){if(_0x409961&&_0x409961[_0x320a('0x56')]===0x0){return db[_0x320a('0x26')]['create']({'name':_0x3e6119[_0x320a('0x2a')],'resourceId':_0x3e6119['id'],'type':_0x409961[_0x320a('0x2a')],'sectionId':_0x409961['id']},{})['then'](function(){return _0x514b22;});}else{return _0x514b22;}})[_0x320a('0x44')](function(_0x406e78){logger['error'](_0x320a('0x50'),_0x406e78);throw _0x406e78;});}return _0x514b22;});}})[_0x320a('0x24')](respondWithResult(_0x21d02f,0xc9))[_0x320a('0x44')](handleError(_0x21d02f,null));};exports[_0x320a('0x22')]=function(_0x30769c,_0x5c57da){if(_0x30769c[_0x320a('0x4a')]['id']){delete _0x30769c[_0x320a('0x4a')]['id'];}return db[_0x320a('0x2e')][_0x320a('0x48')]({'where':{'id':_0x30769c[_0x320a('0x46')]['id']}})['then'](handleEntityNotFound(_0x5c57da,null))[_0x320a('0x24')](saveUpdates(_0x30769c[_0x320a('0x4a')],null))[_0x320a('0x24')](respondWithResult(_0x5c57da,null))[_0x320a('0x44')](handleError(_0x5c57da,null));};exports[_0x320a('0x23')]=function(_0x16dd77,_0x37ba87){return db[_0x320a('0x2e')][_0x320a('0x48')]({'where':{'id':_0x16dd77[_0x320a('0x46')]['id']}})[_0x320a('0x24')](handleEntityNotFound(_0x37ba87,null))[_0x320a('0x24')](removeEntity(_0x37ba87,null))[_0x320a('0x44')](handleError(_0x37ba87,null));};exports[_0x320a('0x57')]=function(_0x261eb8,_0x42aa05,_0x2373e1){var _0x50a700={'raw':!![],'where':{}};var _0x5618f3={};var _0x265204={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x320a('0x58')]({'where':{'id':_0x261eb8[_0x320a('0x46')]['id']}})[_0x320a('0x24')](handleEntityNotFound(_0x42aa05,null))['then'](function(_0x51193d){if(_0x51193d){_0x5618f3[_0x320a('0x33')]=_['keys'](db[_0x320a('0x59')]['rawAttributes']);_0x5618f3[_0x320a('0x34')]=_[_0x320a('0x35')](_0x261eb8['query']);_0x5618f3[_0x320a('0x3e')]=_[_0x320a('0x36')](_0x5618f3[_0x320a('0x33')],_0x5618f3['query']);_0x50a700[_0x320a('0x37')]=_['intersection'](_0x5618f3[_0x320a('0x33')],qs[_0x320a('0x38')](_0x261eb8[_0x320a('0x34')]['fields']));_0x50a700['attributes']=_0x50a700[_0x320a('0x37')][_0x320a('0x39')]?_0x50a700['attributes']:_0x5618f3['model'];if(!_0x261eb8[_0x320a('0x34')][_0x320a('0x5a')](_0x320a('0x3a'))){_0x50a700[_0x320a('0x1c')]=qs[_0x320a('0x1c')](_0x261eb8[_0x320a('0x34')][_0x320a('0x1c')]);_0x50a700[_0x320a('0x19')]=qs[_0x320a('0x19')](_0x261eb8[_0x320a('0x34')][_0x320a('0x19')]);}_0x50a700[_0x320a('0x3b')]=qs['sort'](_0x261eb8[_0x320a('0x34')][_0x320a('0x3c')]);_0x50a700[_0x320a('0x3d')]=qs[_0x320a('0x3e')](_['pick'](_0x261eb8[_0x320a('0x34')],_0x5618f3['filters']));_0x50a700[_0x320a('0x3d')]['ProjectId']=_0x51193d['id'];if(_0x261eb8['query'][_0x320a('0x40')]){_0x50a700[_0x320a('0x3d')]=_[_0x320a('0x51')](_0x50a700[_0x320a('0x3d')],{'$or':_[_0x320a('0x2d')](_0x50a700[_0x320a('0x37')],function(_0xc30f24){var _0x2e1a4e={};_0x2e1a4e[_0xc30f24]={'$like':'%'+_0x261eb8[_0x320a('0x34')]['filter']+'%'};return _0x2e1a4e;})});}_0x50a700=_[_0x320a('0x51')]({},_0x50a700,_0x261eb8[_0x320a('0x47')]);return db['JscriptySessionReport']['count']({'where':_0x50a700[_0x320a('0x3d')]})[_0x320a('0x24')](function(_0x280235){_0x265204[_0x320a('0x1b')]=_0x280235;if(_0x261eb8[_0x320a('0x34')][_0x320a('0x42')]){_0x50a700['include']=[{'all':!![]}];}return db[_0x320a('0x59')]['findAll'](_0x50a700);})[_0x320a('0x24')](function(_0x120268){_0x265204['rows']=_0x120268;return _0x265204;});}})[_0x320a('0x24')](respondWithFilteredResult(_0x42aa05,_0x50a700))['catch'](handleError(_0x42aa05,null));};exports['getAnswers']=function(_0x1e4080,_0xdd2b5e,_0x155894){var _0x3b239d={'raw':!![],'where':{}};var _0x3f94={};var _0x19a2d6={'count':0x0,'rows':[]};return db[_0x320a('0x2e')][_0x320a('0x58')]({'where':{'id':_0x1e4080[_0x320a('0x46')]['id']}})[_0x320a('0x24')](handleEntityNotFound(_0xdd2b5e,null))[_0x320a('0x24')](function(_0x2b6471){if(_0x2b6471){_0x3f94[_0x320a('0x33')]=_[_0x320a('0x35')](db[_0x320a('0x5b')][_0x320a('0x2f')]);_0x3f94[_0x320a('0x34')]=_['keys'](_0x1e4080[_0x320a('0x34')]);_0x3f94['filters']=_['intersection'](_0x3f94['model'],_0x3f94[_0x320a('0x34')]);_0x3b239d[_0x320a('0x37')]=_['intersection'](_0x3f94['model'],qs['fields'](_0x1e4080[_0x320a('0x34')][_0x320a('0x38')]));_0x3b239d[_0x320a('0x37')]=_0x3b239d[_0x320a('0x37')][_0x320a('0x39')]?_0x3b239d[_0x320a('0x37')]:_0x3f94[_0x320a('0x33')];if(!_0x1e4080[_0x320a('0x34')][_0x320a('0x5a')](_0x320a('0x3a'))){_0x3b239d[_0x320a('0x1c')]=qs[_0x320a('0x1c')](_0x1e4080[_0x320a('0x34')][_0x320a('0x1c')]);_0x3b239d[_0x320a('0x19')]=qs[_0x320a('0x19')](_0x1e4080[_0x320a('0x34')][_0x320a('0x19')]);}_0x3b239d[_0x320a('0x3b')]=qs[_0x320a('0x3c')](_0x1e4080[_0x320a('0x34')][_0x320a('0x3c')]);_0x3b239d[_0x320a('0x3d')]=qs[_0x320a('0x3e')](_[_0x320a('0x3f')](_0x1e4080[_0x320a('0x34')],_0x3f94[_0x320a('0x3e')]));_0x3b239d[_0x320a('0x3d')][_0x320a('0x5c')]=_0x2b6471['id'];if(_0x1e4080[_0x320a('0x34')][_0x320a('0x40')]){_0x3b239d['where']=_[_0x320a('0x51')](_0x3b239d[_0x320a('0x3d')],{'$or':_[_0x320a('0x2d')](_0x3b239d[_0x320a('0x37')],function(_0x404c34){var _0x4383fb={};_0x4383fb[_0x404c34]={'$like':'%'+_0x1e4080[_0x320a('0x34')][_0x320a('0x40')]+'%'};return _0x4383fb;})});}_0x3b239d=_['merge']({},_0x3b239d,_0x1e4080[_0x320a('0x47')]);return db[_0x320a('0x5b')]['count']({'where':_0x3b239d[_0x320a('0x3d')]})[_0x320a('0x24')](function(_0x2bf93b){_0x19a2d6[_0x320a('0x1b')]=_0x2bf93b;if(_0x1e4080['query'][_0x320a('0x42')]){_0x3b239d[_0x320a('0x43')]=[{'all':!![]}];}return db[_0x320a('0x5b')][_0x320a('0x5d')](_0x3b239d);})[_0x320a('0x24')](function(_0x2635b9){_0x19a2d6[_0x320a('0x5e')]=_0x2635b9;return _0x19a2d6;});}})['then'](respondWithFilteredResult(_0xdd2b5e,_0x3b239d))[_0x320a('0x44')](handleError(_0xdd2b5e,null));};function char(_0x9ab07a){return'number'===typeof _0x9ab07a?String['fromCharCode'][_0x320a('0x1f')](null,arguments):_0x9ab07a;}function needsEncapsulation(_0x4fdfe1){return!!_0x4fdfe1&&(_0x4fdfe1[_0x320a('0x5f')]()[_0x320a('0x60')](char(0xd))>=0x0||_0x4fdfe1[_0x320a('0x5f')]()['indexOf'](char(0xa))>=0x0||_0x4fdfe1[_0x320a('0x5f')]()[_0x320a('0x60')](char(0x2c))>=0x0||_0x4fdfe1[_0x320a('0x5f')]()[_0x320a('0x60')](char(0x22))>=0x0);}function encapsulate(_0x1bbef3){var _0x31109f=char(0x22),_0x40a5eb='\x5c'+char(0x22),_0x276405=_0x1bbef3[_0x320a('0x5f')]()['replace'](new RegExp(_0x31109f,'g'),_0x40a5eb);return _0x31109f+_0x276405+_0x31109f;}exports[_0x320a('0x61')]=function(_0x14585f,_0x3bf753,_0x2cf1b3){var _0x31f0cc,_0x224672;var _0x1cc4f3={'where':{'ProjectId':_0x14585f[_0x320a('0x46')]['id']}};if(_0x14585f[_0x320a('0x34')][_0x320a('0x62')]){_0x1cc4f3[_0x320a('0x3d')][_0x320a('0x63')]=JSON['parse'](_0x14585f[_0x320a('0x34')][_0x320a('0x62')]);}return db[_0x320a('0x59')][_0x320a('0x5d')](_0x1cc4f3)[_0x320a('0x24')](handleEntityNotFound(_0x3bf753,null))[_0x320a('0x24')](function(_0x28b906){if(_0x28b906){_0x31f0cc=_0x28b906;return db[_0x320a('0x64')][_0x320a('0x5d')]({'where':{'SessionId':{'$in':_['map'](_0x31f0cc,'id')},'ProjectId':_0x14585f['params']['id']},'order':'-createdAt'});}})['then'](handleEntityNotFound(_0x3bf753,null))['then'](function(_0x153406){if(_0x153406){_0x224672=_0x153406;var _0x9ec34f={};for(var _0x352d26=0x0,_0x3f0193=_0x224672[_0x320a('0x39')];_0x352d26<_0x3f0193;_0x352d26++){if(!_0x9ec34f['hasOwnProperty'](_0x224672[_0x352d26][_0x320a('0x65')])){_0x9ec34f[_0x224672[_0x352d26]['questionId']]=needsEncapsulation(_0x224672[_0x352d26][_0x320a('0x66')])?encapsulate(_0x224672[_0x352d26][_0x320a('0x66')]):_0x224672[_0x352d26]['question'];}}var _0x5812f8=[],_0xfa3dce={};for(var _0x2ab664=0x0,_0x45b6ed=_0x31f0cc[_0x320a('0x39')];_0x2ab664<_0x45b6ed;_0x2ab664++){_0xfa3dce={'ProjectId':_0x14585f['params']['id'],'SessionId':_0x31f0cc[_0x2ab664]['id'],'StartTime':moment(_0x31f0cc[_0x2ab664][_0x320a('0x63')])[_0x320a('0x67')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x564c38=0x0,_0x5de9dd=_0x224672[_0x320a('0x39')];_0x564c38<_0x5de9dd;_0x564c38++){if(_0x224672[_0x564c38]['SessionId']==_0x31f0cc[_0x2ab664]['id']&&_0x9ec34f[_0x320a('0x5a')](_0x224672[_0x564c38][_0x320a('0x65')])){_0xfa3dce[_0x9ec34f[_0x224672[_0x564c38][_0x320a('0x65')]]]=_0x224672[_0x564c38][_0x320a('0x68')];}}for(var _0x3e9574 in _0x9ec34f){if(!_0xfa3dce[_0x320a('0x5a')](_0x9ec34f[_0x3e9574])){_0xfa3dce[_0x9ec34f[_0x3e9574]]=null;}}_0x5812f8[_0x320a('0x69')](_0xfa3dce);}return _0x5812f8;}})[_0x320a('0x24')](function(_0x2ed3fd){if(!_[_0x320a('0x6a')](_0x2ed3fd)){var _0x22a61a=toCsv(_0x2ed3fd);var _0x2adea6=Date[_0x320a('0x6b')]();fs['writeFileSync'](util[_0x320a('0x67')](_0x320a('0x6c'),_0x14585f[_0x320a('0x46')]['id'],_0x2adea6),_0x22a61a);_0x3bf753[_0x320a('0x6d')](_0x320a('0x6e'),'attachment;\x20filename='+util[_0x320a('0x67')](_0x320a('0x6f'),_0x14585f[_0x320a('0x46')]['id'],_0x2adea6));_0x3bf753['setHeader']('Content-type',_0x320a('0x70'));return _0x3bf753['download'](util[_0x320a('0x67')](_0x320a('0x6c'),_0x14585f[_0x320a('0x46')]['id'],_0x2adea6));}else{return _0x3bf753['sendStatus'](0xcc);}})[_0x320a('0x44')](handleError(_0x3bf753,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 0e39f84..97cb61a 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 _0x038b=['jscripty_projects','util','../../config/logger','api','bluebird','path','rimraf','./jscriptyProject.attributes','exports','define','JscriptyProject'];(function(_0x178f98,_0x54d424){var _0x70a913=function(_0xdff6ad){while(--_0xdff6ad){_0x178f98['push'](_0x178f98['shift']());}};_0x70a913(++_0x54d424);}(_0x038b,0x114));var _0xb038=function(_0x4e6278,_0xc407f6){_0x4e6278=_0x4e6278-0x0;var _0x4ab67f=_0x038b[_0x4e6278];return _0x4ab67f;};'use strict';var _=require('lodash');var util=require(_0xb038('0x0'));var logger=require(_0xb038('0x1'))(_0xb038('0x2'));var moment=require('moment');var BPromise=require(_0xb038('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb038('0x4'));var rimraf=require(_0xb038('0x5'));var config=require('../../config/environment');var attributes=require(_0xb038('0x6'));module[_0xb038('0x7')]=function(_0x4fe092,_0x54e1e7){return _0x4fe092[_0xb038('0x8')](_0xb038('0x9'),attributes,{'tableName':_0xb038('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4873=['rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','jscripty_projects','lodash','util','../../config/logger','moment','path'];(function(_0x430fb8,_0x16c1f5){var _0x588598=function(_0x343cfc){while(--_0x343cfc){_0x430fb8['push'](_0x430fb8['shift']());}};_0x588598(++_0x16c1f5);}(_0x4873,0x1df));var _0x3487=function(_0x4222b1,_0x37f6a0){_0x4222b1=_0x4222b1-0x0;var _0x55e4c1=_0x4873[_0x4222b1];return _0x55e4c1;};'use strict';var _=require(_0x3487('0x0'));var util=require(_0x3487('0x1'));var logger=require(_0x3487('0x2'))('api');var moment=require(_0x3487('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3487('0x4'));var rimraf=require(_0x3487('0x5'));var config=require(_0x3487('0x6'));var attributes=require(_0x3487('0x7'));module[_0x3487('0x8')]=function(_0xbe12a4,_0x2611dc){return _0xbe12a4[_0x3487('0x9')]('JscriptyProject',attributes,{'tableName':_0x3487('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index d8daf7c..0989f1e 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 _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x5a594d,_0x5cd018){var _0x45a07e=function(_0x3a63de){while(--_0x3a63de){_0x5a594d['push'](_0x5a594d['shift']());}};_0x45a07e(++_0x5cd018);}(_0xaa88,0x137));var _0x8aa8=function(_0x216d45,_0x4989fe){_0x216d45=_0x216d45-0x0;var _0xbaac0b=_0xaa88[_0x216d45];return _0xbaac0b;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file +var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0xb7a459,_0xc13228){var _0x104ab5=function(_0x186a0e){while(--_0x186a0e){_0xb7a459['push'](_0xb7a459['shift']());}};_0x104ab5(++_0xc13228);}(_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 moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 94934ff..683419e 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 _0x5a80=['exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy'];(function(_0x4c7690,_0x4dc6b8){var _0x185d59=function(_0x28e6c7){while(--_0x28e6c7){_0x4c7690['push'](_0x4c7690['shift']());}};_0x185d59(++_0x4dc6b8);}(_0x5a80,0x17d));var _0x05a8=function(_0x38a2ab,_0x3bc65f){_0x38a2ab=_0x38a2ab-0x0;var _0x5e78e9=_0x5a80[_0x38a2ab];return _0x5e78e9;};'use strict';var multer=require('multer');var util=require(_0x05a8('0x0'));var path=require('path');var timeout=require(_0x05a8('0x1'));var express=require(_0x05a8('0x2'));var router=express[_0x05a8('0x3')]();var fs_extra=require(_0x05a8('0x4'));var auth=require(_0x05a8('0x5'));var interaction=require(_0x05a8('0x6'));var config=require(_0x05a8('0x7'));var controller=require(_0x05a8('0x8'));router[_0x05a8('0x9')]('/',auth[_0x05a8('0xa')](),controller[_0x05a8('0xb')]);router[_0x05a8('0x9')]('/describe',auth[_0x05a8('0xa')](),controller['describe']);router[_0x05a8('0x9')](_0x05a8('0xc'),auth[_0x05a8('0xa')](),controller[_0x05a8('0xd')]);router[_0x05a8('0xe')]('/',auth[_0x05a8('0xa')](),controller[_0x05a8('0xf')]);router[_0x05a8('0x10')]('/:id',auth[_0x05a8('0xa')](),controller['update']);router['delete']('/:id',auth[_0x05a8('0xa')](),controller[_0x05a8('0x11')]);module[_0x05a8('0x12')]=router; \ No newline at end of file +var _0xb7d9=['exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','./jscriptyQuestionReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0xc86f87,_0x4de03c){var _0x46db38=function(_0x59258b){while(--_0x59258b){_0xc86f87['push'](_0xc86f87['shift']());}};_0x46db38(++_0x4de03c);}(_0xb7d9,0x12d));var _0x9b7d=function(_0x1580f7,_0xf2b31c){_0x1580f7=_0x1580f7-0x0;var _0x2a5b4f=_0xb7d9[_0x1580f7];return _0x2a5b4f;};'use strict';var multer=require(_0x9b7d('0x0'));var util=require(_0x9b7d('0x1'));var path=require(_0x9b7d('0x2'));var timeout=require(_0x9b7d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9b7d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9b7d('0x5'));var config=require('../../config/environment');var controller=require(_0x9b7d('0x6'));router[_0x9b7d('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9b7d('0x7')](_0x9b7d('0x8'),auth[_0x9b7d('0x9')](),controller[_0x9b7d('0xa')]);router[_0x9b7d('0x7')](_0x9b7d('0xb'),auth[_0x9b7d('0x9')](),controller[_0x9b7d('0xc')]);router[_0x9b7d('0xd')]('/',auth[_0x9b7d('0x9')](),controller[_0x9b7d('0xe')]);router[_0x9b7d('0xf')](_0x9b7d('0xb'),auth[_0x9b7d('0x9')](),controller[_0x9b7d('0x10')]);router[_0x9b7d('0x11')]('/:id',auth[_0x9b7d('0x9')](),controller[_0x9b7d('0x12')]);module[_0x9b7d('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 8af07c7..8e170e3 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x7a54,0x106));var _0x47a5=function(_0x5ed7fd,_0x4f394a){_0x5ed7fd=_0x5ed7fd-0x0;var _0x50f00e=_0x7a54[_0x5ed7fd];return _0x50f00e;};'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(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x7a54,0x106));var _0x47a5=function(_0x3e3537,_0x4d9b52){_0x3e3537=_0x3e3537-0x0;var _0xb195dd=_0x7a54[_0x3e3537];return _0xb195dd;};'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 b7a7a32..0e20eac 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 _0xfcd8=['describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','apply','reject','save','update','destroy','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','sort','filters','pick','filter','where','merge','VIRTUAL','options','JscriptyQuestionReport','findAll','catch','show','keys','includeAll','body','find','params'];(function(_0x3f8759,_0x3fe6fb){var _0x2d33ca=function(_0x39b5c9){while(--_0x39b5c9){_0x3f8759['push'](_0x3f8759['shift']());}};_0x2d33ca(++_0x3fe6fb);}(_0xfcd8,0x131));var _0x8fcd=function(_0x2617b3,_0x388fc5){_0x2617b3=_0x2617b3-0x0;var _0x42ad66=_0xfcd8[_0x2617b3];return _0x42ad66;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8fcd('0x0'));var zipdir=require(_0x8fcd('0x1'));var jsonpatch=require(_0x8fcd('0x2'));var rp=require(_0x8fcd('0x3'));var moment=require(_0x8fcd('0x4'));var BPromise=require(_0x8fcd('0x5'));var Mustache=require(_0x8fcd('0x6'));var util=require(_0x8fcd('0x7'));var path=require(_0x8fcd('0x8'));var sox=require(_0x8fcd('0x9'));var csv=require('to-csv');var ejs=require(_0x8fcd('0xa'));var fs=require('fs');var fs_extra=require(_0x8fcd('0xb'));var _=require('lodash');var squel=require(_0x8fcd('0xc'));var crypto=require(_0x8fcd('0xd'));var jsforce=require(_0x8fcd('0xe'));var deskjs=require(_0x8fcd('0xf'));var toCsv=require(_0x8fcd('0x10'));var querystring=require(_0x8fcd('0x11'));var Papa=require('papaparse');var Redis=require(_0x8fcd('0x12'));var authService=require(_0x8fcd('0x13'));var qs=require(_0x8fcd('0x14'));var as=require(_0x8fcd('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8fcd('0x16'))(_0x8fcd('0x17'));var utils=require(_0x8fcd('0x18'));var config=require(_0x8fcd('0x19'));var licenseUtil=require(_0x8fcd('0x1a'));var db=require(_0x8fcd('0x1b'))['db'];function respondWithStatusCode(_0x3573d9,_0x90d136){_0x90d136=_0x90d136||0xcc;return function(_0x323371){if(_0x323371){return _0x3573d9[_0x8fcd('0x1c')](_0x90d136);}return _0x3573d9['status'](_0x90d136)['end']();};}function respondWithResult(_0x8dbc4f,_0x5e3e20){_0x5e3e20=_0x5e3e20||0xc8;return function(_0x3d44c2){if(_0x3d44c2){return _0x8dbc4f[_0x8fcd('0x1d')](_0x5e3e20)[_0x8fcd('0x1e')](_0x3d44c2);}};}function respondWithFilteredResult(_0x58a407,_0x5c036b){return function(_0x5aa63e){if(_0x5aa63e){var _0x82f968=typeof _0x5c036b['offset']===_0x8fcd('0x1f')&&typeof _0x5c036b['limit']===_0x8fcd('0x1f');var _0x508912=_0x5aa63e['count'];var _0x39dbed=_0x82f968?0x0:_0x5c036b['offset'];var _0x7dd9af=_0x82f968?_0x5aa63e[_0x8fcd('0x20')]:_0x5c036b[_0x8fcd('0x21')]+_0x5c036b[_0x8fcd('0x22')];var _0x1a28d2;if(_0x7dd9af>=_0x508912){_0x7dd9af=_0x508912;_0x1a28d2=0xc8;}else{_0x1a28d2=0xce;}_0x58a407[_0x8fcd('0x1d')](_0x1a28d2);return _0x58a407[_0x8fcd('0x23')]('Content-Range',_0x39dbed+'-'+_0x7dd9af+'/'+_0x508912)[_0x8fcd('0x1e')](_0x5aa63e);}return null;};}function patchUpdates(_0x51f6d1){return function(_0x3323fe){try{jsonpatch[_0x8fcd('0x24')](_0x3323fe,_0x51f6d1,!![]);}catch(_0x9cdc47){return BPromise[_0x8fcd('0x25')](_0x9cdc47);}return _0x3323fe[_0x8fcd('0x26')]();};}function saveUpdates(_0x4f8759,_0x5a8e27){return function(_0x110a52){if(_0x110a52){return _0x110a52[_0x8fcd('0x27')](_0x4f8759)['then'](function(_0x959a5d){return _0x959a5d;});}return null;};}function removeEntity(_0x556d9d,_0x1e479d){return function(_0x1b53d9){if(_0x1b53d9){return _0x1b53d9[_0x8fcd('0x28')]()[_0x8fcd('0x29')](function(){_0x556d9d[_0x8fcd('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x327c4b,_0x1a4a02){return function(_0x239520){if(!_0x239520){_0x327c4b[_0x8fcd('0x1c')](0x194);}return _0x239520;};}function handleError(_0x56a8,_0x3c055d){_0x3c055d=_0x3c055d||0x1f4;return function(_0x14d5da){logger[_0x8fcd('0x2a')](_0x14d5da[_0x8fcd('0x2b')]);if(_0x14d5da[_0x8fcd('0x2c')]){delete _0x14d5da['name'];}_0x56a8[_0x8fcd('0x1d')](_0x3c055d)['send'](_0x14d5da);};}exports[_0x8fcd('0x2d')]=function(_0x3a6d76,_0x2ea821){var _0x3ab769={},_0x1d57c1={},_0x56d361={'count':0x0,'rows':[]};var _0x4419bd=_[_0x8fcd('0x2e')](db['JscriptyQuestionReport'][_0x8fcd('0x2f')],function(_0x2245cc){return{'name':_0x2245cc[_0x8fcd('0x30')],'type':_0x2245cc[_0x8fcd('0x31')][_0x8fcd('0x32')]};});_0x1d57c1[_0x8fcd('0x33')]=_[_0x8fcd('0x2e')](_0x4419bd,_0x8fcd('0x2c'));_0x1d57c1[_0x8fcd('0x34')]=_['keys'](_0x3a6d76['query']);_0x1d57c1['filters']=_[_0x8fcd('0x35')](_0x1d57c1['model'],_0x1d57c1[_0x8fcd('0x34')]);_0x3ab769['attributes']=_[_0x8fcd('0x35')](_0x1d57c1['model'],qs[_0x8fcd('0x36')](_0x3a6d76[_0x8fcd('0x34')]['fields']));_0x3ab769[_0x8fcd('0x37')]=_0x3ab769[_0x8fcd('0x37')][_0x8fcd('0x38')]?_0x3ab769[_0x8fcd('0x37')]:_0x1d57c1[_0x8fcd('0x33')];if(!_0x3a6d76[_0x8fcd('0x34')][_0x8fcd('0x39')]('nolimit')){_0x3ab769['limit']=qs[_0x8fcd('0x22')](_0x3a6d76[_0x8fcd('0x34')]['limit']);_0x3ab769[_0x8fcd('0x21')]=qs[_0x8fcd('0x21')](_0x3a6d76['query'][_0x8fcd('0x21')]);}_0x3ab769['order']=qs[_0x8fcd('0x3a')](_0x3a6d76['query']['sort']);_0x3ab769['where']=qs[_0x8fcd('0x3b')](_[_0x8fcd('0x3c')](_0x3a6d76[_0x8fcd('0x34')],_0x1d57c1[_0x8fcd('0x3b')]),_0x4419bd);if(_0x3a6d76[_0x8fcd('0x34')][_0x8fcd('0x3d')]){_0x3ab769[_0x8fcd('0x3e')]=_[_0x8fcd('0x3f')](_0x3ab769['where'],{'$or':_['map'](_0x4419bd,function(_0xad09f3){if(_0xad09f3['type']!==_0x8fcd('0x40')){var _0x409055={};_0x409055[_0xad09f3[_0x8fcd('0x2c')]]={'$like':'%'+_0x3a6d76[_0x8fcd('0x34')][_0x8fcd('0x3d')]+'%'};return _0x409055;}})});}_0x3ab769=_[_0x8fcd('0x3f')]({},_0x3ab769,_0x3a6d76[_0x8fcd('0x41')]);var _0x205215={'where':_0x3ab769[_0x8fcd('0x3e')]};return db['JscriptyQuestionReport'][_0x8fcd('0x20')](_0x205215)[_0x8fcd('0x29')](function(_0x5d0dcd){_0x56d361[_0x8fcd('0x20')]=_0x5d0dcd;if(_0x3a6d76[_0x8fcd('0x34')]['includeAll']){_0x3ab769['include']=[{'all':!![]}];}return db[_0x8fcd('0x42')][_0x8fcd('0x43')](_0x3ab769);})[_0x8fcd('0x29')](function(_0x3c2000){_0x56d361['rows']=_0x3c2000;return _0x56d361;})[_0x8fcd('0x29')](respondWithFilteredResult(_0x2ea821,_0x3ab769))[_0x8fcd('0x44')](handleError(_0x2ea821,null));};exports[_0x8fcd('0x45')]=function(_0x2162b1,_0x5440c7){var _0x2b379a={'raw':!![],'where':{'id':_0x2162b1['params']['id']}},_0x527ff6={};_0x527ff6[_0x8fcd('0x33')]=_[_0x8fcd('0x46')](db['JscriptyQuestionReport']['rawAttributes']);_0x527ff6[_0x8fcd('0x34')]=_[_0x8fcd('0x46')](_0x2162b1[_0x8fcd('0x34')]);_0x527ff6[_0x8fcd('0x3b')]=_['intersection'](_0x527ff6[_0x8fcd('0x33')],_0x527ff6[_0x8fcd('0x34')]);_0x2b379a[_0x8fcd('0x37')]=_[_0x8fcd('0x35')](_0x527ff6[_0x8fcd('0x33')],qs['fields'](_0x2162b1[_0x8fcd('0x34')][_0x8fcd('0x36')]));_0x2b379a[_0x8fcd('0x37')]=_0x2b379a['attributes'][_0x8fcd('0x38')]?_0x2b379a[_0x8fcd('0x37')]:_0x527ff6[_0x8fcd('0x33')];if(_0x2162b1['query'][_0x8fcd('0x47')]){_0x2b379a['include']=[{'all':!![]}];}_0x2b379a=_[_0x8fcd('0x3f')]({},_0x2b379a,_0x2162b1['options']);return db[_0x8fcd('0x42')]['find'](_0x2b379a)[_0x8fcd('0x29')](handleEntityNotFound(_0x5440c7,null))[_0x8fcd('0x29')](respondWithResult(_0x5440c7,null))['catch'](handleError(_0x5440c7,null));};exports['create']=function(_0xad07b0,_0x2546e2){return db['JscriptyQuestionReport']['create'](_0xad07b0['body'],{})[_0x8fcd('0x29')](respondWithResult(_0x2546e2,0xc9))[_0x8fcd('0x44')](handleError(_0x2546e2,null));};exports['update']=function(_0x4c4cdd,_0x18ebf4){if(_0x4c4cdd[_0x8fcd('0x48')]['id']){delete _0x4c4cdd[_0x8fcd('0x48')]['id'];}return db['JscriptyQuestionReport']['find']({'where':{'id':_0x4c4cdd['params']['id']}})['then'](handleEntityNotFound(_0x18ebf4,null))['then'](saveUpdates(_0x4c4cdd[_0x8fcd('0x48')],null))[_0x8fcd('0x29')](respondWithResult(_0x18ebf4,null))['catch'](handleError(_0x18ebf4,null));};exports[_0x8fcd('0x28')]=function(_0x31bff6,_0x18fdf8){return db['JscriptyQuestionReport'][_0x8fcd('0x49')]({'where':{'id':_0x31bff6[_0x8fcd('0x4a')]['id']}})[_0x8fcd('0x29')](handleEntityNotFound(_0x18fdf8,null))['then'](removeEntity(_0x18fdf8,null))[_0x8fcd('0x44')](handleError(_0x18fdf8,null));};exports['describe']=function(_0x5b909b,_0x495a){return db['JscriptyQuestionReport'][_0x8fcd('0x4b')]()[_0x8fcd('0x29')](respondWithResult(_0x495a,null))[_0x8fcd('0x44')](handleError(_0x495a,null));}; \ No newline at end of file +var _0x4d12=['jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','map','JscriptyQuestionReport','rawAttributes','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','show','include','options','find','create','body','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x1b1bea,_0x129080){var _0x4702b6=function(_0x26d904){while(--_0x26d904){_0x1b1bea['push'](_0x1b1bea['shift']());}};_0x4702b6(++_0x129080);}(_0x4d12,0x86));var _0x24d1=function(_0x39cf65,_0x4f3270){_0x39cf65=_0x39cf65-0x0;var _0x41a5c0=_0x4d12[_0x39cf65];return _0x41a5c0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x24d1('0x0'));var jsonpatch=require(_0x24d1('0x1'));var rp=require(_0x24d1('0x2'));var moment=require(_0x24d1('0x3'));var BPromise=require(_0x24d1('0x4'));var Mustache=require('mustache');var util=require(_0x24d1('0x5'));var path=require('path');var sox=require(_0x24d1('0x6'));var csv=require(_0x24d1('0x7'));var ejs=require(_0x24d1('0x8'));var fs=require('fs');var fs_extra=require(_0x24d1('0x9'));var _=require(_0x24d1('0xa'));var squel=require(_0x24d1('0xb'));var crypto=require('crypto');var jsforce=require(_0x24d1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x24d1('0x7'));var querystring=require(_0x24d1('0xd'));var Papa=require(_0x24d1('0xe'));var Redis=require('ioredis');var authService=require(_0x24d1('0xf'));var qs=require(_0x24d1('0x10'));var as=require(_0x24d1('0x11'));var hardwareService=require(_0x24d1('0x12'));var logger=require(_0x24d1('0x13'))(_0x24d1('0x14'));var utils=require('../../config/utils');var config=require(_0x24d1('0x15'));var licenseUtil=require(_0x24d1('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2eab66,_0x3d46e3){_0x3d46e3=_0x3d46e3||0xcc;return function(_0x10c31e){if(_0x10c31e){return _0x2eab66[_0x24d1('0x17')](_0x3d46e3);}return _0x2eab66[_0x24d1('0x18')](_0x3d46e3)[_0x24d1('0x19')]();};}function respondWithResult(_0x11bcee,_0x5eaab5){_0x5eaab5=_0x5eaab5||0xc8;return function(_0x4dac62){if(_0x4dac62){return _0x11bcee['status'](_0x5eaab5)[_0x24d1('0x1a')](_0x4dac62);}};}function respondWithFilteredResult(_0x2651bb,_0xd65349){return function(_0x1e26e2){if(_0x1e26e2){var _0x40f196=typeof _0xd65349[_0x24d1('0x1b')]===_0x24d1('0x1c')&&typeof _0xd65349[_0x24d1('0x1d')]===_0x24d1('0x1c');var _0x44cc23=_0x1e26e2[_0x24d1('0x1e')];var _0x34386c=_0x40f196?0x0:_0xd65349[_0x24d1('0x1b')];var _0xadadd2=_0x40f196?_0x1e26e2[_0x24d1('0x1e')]:_0xd65349[_0x24d1('0x1b')]+_0xd65349[_0x24d1('0x1d')];var _0x264905;if(_0xadadd2>=_0x44cc23){_0xadadd2=_0x44cc23;_0x264905=0xc8;}else{_0x264905=0xce;}_0x2651bb['status'](_0x264905);return _0x2651bb[_0x24d1('0x1f')](_0x24d1('0x20'),_0x34386c+'-'+_0xadadd2+'/'+_0x44cc23)[_0x24d1('0x1a')](_0x1e26e2);}return null;};}function patchUpdates(_0x3e6f96){return function(_0x3768be){try{jsonpatch[_0x24d1('0x21')](_0x3768be,_0x3e6f96,!![]);}catch(_0x4ab78c){return BPromise[_0x24d1('0x22')](_0x4ab78c);}return _0x3768be[_0x24d1('0x23')]();};}function saveUpdates(_0x2e693b,_0xf7d007){return function(_0x1c6e77){if(_0x1c6e77){return _0x1c6e77[_0x24d1('0x24')](_0x2e693b)[_0x24d1('0x25')](function(_0x356f58){return _0x356f58;});}return null;};}function removeEntity(_0x196b7e,_0x601769){return function(_0x223e6b){if(_0x223e6b){return _0x223e6b[_0x24d1('0x26')]()['then'](function(){_0x196b7e['status'](0xcc)[_0x24d1('0x19')]();});}};}function handleEntityNotFound(_0x3ac8e1,_0x4a254e){return function(_0x1f7867){if(!_0x1f7867){_0x3ac8e1[_0x24d1('0x17')](0x194);}return _0x1f7867;};}function handleError(_0x162ba9,_0x2bcc69){_0x2bcc69=_0x2bcc69||0x1f4;return function(_0x1bd90b){logger['error'](_0x1bd90b[_0x24d1('0x27')]);if(_0x1bd90b[_0x24d1('0x28')]){delete _0x1bd90b[_0x24d1('0x28')];}_0x162ba9[_0x24d1('0x18')](_0x2bcc69)['send'](_0x1bd90b);};}exports['index']=function(_0x2a09ce,_0x3a87f6){var _0x5a853d={},_0x86f4e9={},_0x2087cf={'count':0x0,'rows':[]};var _0x32f134=_[_0x24d1('0x29')](db[_0x24d1('0x2a')][_0x24d1('0x2b')],function(_0x269ff4){return{'name':_0x269ff4['fieldName'],'type':_0x269ff4[_0x24d1('0x2c')][_0x24d1('0x2d')]};});_0x86f4e9['model']=_[_0x24d1('0x29')](_0x32f134,'name');_0x86f4e9[_0x24d1('0x2e')]=_[_0x24d1('0x2f')](_0x2a09ce[_0x24d1('0x2e')]);_0x86f4e9[_0x24d1('0x30')]=_[_0x24d1('0x31')](_0x86f4e9['model'],_0x86f4e9[_0x24d1('0x2e')]);_0x5a853d[_0x24d1('0x32')]=_[_0x24d1('0x31')](_0x86f4e9[_0x24d1('0x33')],qs[_0x24d1('0x34')](_0x2a09ce['query'][_0x24d1('0x34')]));_0x5a853d[_0x24d1('0x32')]=_0x5a853d[_0x24d1('0x32')][_0x24d1('0x35')]?_0x5a853d[_0x24d1('0x32')]:_0x86f4e9[_0x24d1('0x33')];if(!_0x2a09ce['query'][_0x24d1('0x36')](_0x24d1('0x37'))){_0x5a853d[_0x24d1('0x1d')]=qs[_0x24d1('0x1d')](_0x2a09ce[_0x24d1('0x2e')][_0x24d1('0x1d')]);_0x5a853d[_0x24d1('0x1b')]=qs['offset'](_0x2a09ce['query']['offset']);}_0x5a853d['order']=qs[_0x24d1('0x38')](_0x2a09ce[_0x24d1('0x2e')]['sort']);_0x5a853d[_0x24d1('0x39')]=qs[_0x24d1('0x30')](_[_0x24d1('0x3a')](_0x2a09ce[_0x24d1('0x2e')],_0x86f4e9['filters']),_0x32f134);if(_0x2a09ce[_0x24d1('0x2e')][_0x24d1('0x3b')]){_0x5a853d[_0x24d1('0x39')]=_[_0x24d1('0x3c')](_0x5a853d[_0x24d1('0x39')],{'$or':_['map'](_0x32f134,function(_0x2bc507){if(_0x2bc507[_0x24d1('0x2c')]!=='VIRTUAL'){var _0x4ebda8={};_0x4ebda8[_0x2bc507[_0x24d1('0x28')]]={'$like':'%'+_0x2a09ce[_0x24d1('0x2e')][_0x24d1('0x3b')]+'%'};return _0x4ebda8;}})});}_0x5a853d=_['merge']({},_0x5a853d,_0x2a09ce['options']);var _0x1d45a9={'where':_0x5a853d['where']};return db[_0x24d1('0x2a')][_0x24d1('0x1e')](_0x1d45a9)[_0x24d1('0x25')](function(_0x4fa575){_0x2087cf['count']=_0x4fa575;if(_0x2a09ce[_0x24d1('0x2e')][_0x24d1('0x3d')]){_0x5a853d['include']=[{'all':!![]}];}return db[_0x24d1('0x2a')][_0x24d1('0x3e')](_0x5a853d);})[_0x24d1('0x25')](function(_0x4ada7f){_0x2087cf[_0x24d1('0x3f')]=_0x4ada7f;return _0x2087cf;})['then'](respondWithFilteredResult(_0x3a87f6,_0x5a853d))[_0x24d1('0x40')](handleError(_0x3a87f6,null));};exports[_0x24d1('0x41')]=function(_0x499d38,_0x495584){var _0x40d54c={'raw':!![],'where':{'id':_0x499d38['params']['id']}},_0x5ea345={};_0x5ea345[_0x24d1('0x33')]=_[_0x24d1('0x2f')](db[_0x24d1('0x2a')][_0x24d1('0x2b')]);_0x5ea345[_0x24d1('0x2e')]=_[_0x24d1('0x2f')](_0x499d38[_0x24d1('0x2e')]);_0x5ea345[_0x24d1('0x30')]=_[_0x24d1('0x31')](_0x5ea345[_0x24d1('0x33')],_0x5ea345['query']);_0x40d54c['attributes']=_[_0x24d1('0x31')](_0x5ea345[_0x24d1('0x33')],qs[_0x24d1('0x34')](_0x499d38['query'][_0x24d1('0x34')]));_0x40d54c[_0x24d1('0x32')]=_0x40d54c[_0x24d1('0x32')][_0x24d1('0x35')]?_0x40d54c[_0x24d1('0x32')]:_0x5ea345[_0x24d1('0x33')];if(_0x499d38[_0x24d1('0x2e')]['includeAll']){_0x40d54c[_0x24d1('0x42')]=[{'all':!![]}];}_0x40d54c=_[_0x24d1('0x3c')]({},_0x40d54c,_0x499d38[_0x24d1('0x43')]);return db['JscriptyQuestionReport'][_0x24d1('0x44')](_0x40d54c)['then'](handleEntityNotFound(_0x495584,null))[_0x24d1('0x25')](respondWithResult(_0x495584,null))['catch'](handleError(_0x495584,null));};exports[_0x24d1('0x45')]=function(_0x16d815,_0x2f00e2){return db['JscriptyQuestionReport'][_0x24d1('0x45')](_0x16d815['body'],{})[_0x24d1('0x25')](respondWithResult(_0x2f00e2,0xc9))[_0x24d1('0x40')](handleError(_0x2f00e2,null));};exports[_0x24d1('0x24')]=function(_0xaa63d6,_0x12c8f6){if(_0xaa63d6[_0x24d1('0x46')]['id']){delete _0xaa63d6[_0x24d1('0x46')]['id'];}return db[_0x24d1('0x2a')]['find']({'where':{'id':_0xaa63d6[_0x24d1('0x47')]['id']}})['then'](handleEntityNotFound(_0x12c8f6,null))['then'](saveUpdates(_0xaa63d6[_0x24d1('0x46')],null))[_0x24d1('0x25')](respondWithResult(_0x12c8f6,null))[_0x24d1('0x40')](handleError(_0x12c8f6,null));};exports[_0x24d1('0x26')]=function(_0x411c26,_0xa134f){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x411c26[_0x24d1('0x47')]['id']}})[_0x24d1('0x25')](handleEntityNotFound(_0xa134f,null))[_0x24d1('0x25')](removeEntity(_0xa134f,null))['catch'](handleError(_0xa134f,null));};exports[_0x24d1('0x48')]=function(_0x3a4c4f,_0x1da30b){return db['JscriptyQuestionReport'][_0x24d1('0x48')]()[_0x24d1('0x25')](respondWithResult(_0x1da30b,null))[_0x24d1('0x40')](handleError(_0x1da30b,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index f4f8962..e4693fc 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 _0xd632=['../../config/logger','moment','request-promise','path','exports','define','lodash','util'];(function(_0x5baeb4,_0x39d34d){var _0x32fc63=function(_0x284b2f){while(--_0x284b2f){_0x5baeb4['push'](_0x5baeb4['shift']());}};_0x32fc63(++_0x39d34d);}(_0xd632,0x166));var _0x2d63=function(_0x3f32e4,_0x4681c7){_0x3f32e4=_0x3f32e4-0x0;var _0x18fbef=_0xd632[_0x3f32e4];return _0x18fbef;};'use strict';var _=require(_0x2d63('0x0'));var util=require(_0x2d63('0x1'));var logger=require(_0x2d63('0x2'))('api');var moment=require(_0x2d63('0x3'));var BPromise=require('bluebird');var rp=require(_0x2d63('0x4'));var fs=require('fs');var path=require(_0x2d63('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./jscriptyQuestionReport.attributes');module[_0x2d63('0x6')]=function(_0x5d94bc,_0x319cd9){return _0x5d94bc[_0x2d63('0x7')]('JscriptyQuestionReport',attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe59=['exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes'];(function(_0x55e5b7,_0x5759de){var _0x2f6f00=function(_0x19815d){while(--_0x19815d){_0x55e5b7['push'](_0x55e5b7['shift']());}};_0x2f6f00(++_0x5759de);}(_0xbe59,0x6c));var _0x9be5=function(_0x3e3877,_0x134f16){_0x3e3877=_0x3e3877-0x0;var _0x41c2d1=_0xbe59[_0x3e3877];return _0x41c2d1;};'use strict';var _=require(_0x9be5('0x0'));var util=require(_0x9be5('0x1'));var logger=require(_0x9be5('0x2'))('api');var moment=require(_0x9be5('0x3'));var BPromise=require(_0x9be5('0x4'));var rp=require(_0x9be5('0x5'));var fs=require('fs');var path=require(_0x9be5('0x6'));var rimraf=require('rimraf');var config=require(_0x9be5('0x7'));var attributes=require(_0x9be5('0x8'));module[_0x9be5('0x9')]=function(_0x112166,_0x104b92){return _0x112166[_0x9be5('0xa')](_0x9be5('0xb'),attributes,{'tableName':_0x9be5('0xc'),'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 4c28d8b..a8fb51e 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 _0x3afd=['request\x20sent','debug','stringify','error','code','result','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s'];(function(_0x30af1b,_0x4c9d2e){var _0x53b77b=function(_0x589a36){while(--_0x589a36){_0x30af1b['push'](_0x30af1b['shift']());}};_0x53b77b(++_0x4c9d2e);}(_0x3afd,0xa9));var _0xd3af=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x3afd[_0x556927];return _0x5f1235;};'use strict';var _=require(_0xd3af('0x0'));var util=require(_0xd3af('0x1'));var moment=require(_0xd3af('0x2'));var BPromise=require(_0xd3af('0x3'));var rs=require(_0xd3af('0x4'));var fs=require('fs');var Redis=require(_0xd3af('0x5'));var db=require(_0xd3af('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd3af('0x7'))(_0xd3af('0x8'));var config=require('../../config/environment');var jayson=require(_0xd3af('0x9'));var client=jayson[_0xd3af('0xa')][_0xd3af('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x567935,_0x3a320d,_0x2b0d4f){return new BPromise(function(_0x75ad0a,_0x2ee18d){return client['request'](_0x567935,_0x2b0d4f)[_0xd3af('0xc')](function(_0x5d5fbd){logger[_0xd3af('0xd')](_0xd3af('0xe'),_0x3a320d,_0xd3af('0xf'));logger[_0xd3af('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x3a320d,'request\x20sent',JSON[_0xd3af('0x11')](_0x5d5fbd));if(_0x5d5fbd[_0xd3af('0x12')]){if(_0x5d5fbd[_0xd3af('0x12')][_0xd3af('0x13')]===0x1f4){logger['error'](_0xd3af('0xe'),_0x3a320d,_0x5d5fbd[_0xd3af('0x12')]['message']);return _0x2ee18d(_0x5d5fbd[_0xd3af('0x12')]['message']);}logger[_0xd3af('0x12')](_0xd3af('0xe'),_0x3a320d,_0x5d5fbd['error']['message']);return _0x75ad0a(_0x5d5fbd['error']['message']);}else{logger[_0xd3af('0xd')](_0xd3af('0xe'),_0x3a320d,_0xd3af('0xf'));_0x75ad0a(_0x5d5fbd[_0xd3af('0x14')][_0xd3af('0x15')]);}})[_0xd3af('0x16')](function(_0x13b235){logger[_0xd3af('0x12')](_0xd3af('0xe'),_0x3a320d,_0x13b235);_0x2ee18d(_0x13b235);});});} \ No newline at end of file +var _0xa012=['http','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa012,0xc8));var _0x2a01=function(_0x18ac44,_0x5e525e){_0x18ac44=_0x18ac44-0x0;var _0x521d09=_0xa012[_0x18ac44];return _0x521d09;};'use strict';var _=require(_0x2a01('0x0'));var util=require(_0x2a01('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2a01('0x2'));var db=require(_0x2a01('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2a01('0x4'))(_0x2a01('0x5'));var config=require(_0x2a01('0x6'));var jayson=require(_0x2a01('0x7'));var client=jayson[_0x2a01('0x8')][_0x2a01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd66da7,_0x4d480c,_0x2ba86c){return new BPromise(function(_0x3e0567,_0x2f0f21){return client['request'](_0xd66da7,_0x2ba86c)['then'](function(_0x134eb3){logger['info'](_0x2a01('0xa'),_0x4d480c,_0x2a01('0xb'));logger[_0x2a01('0xc')](_0x2a01('0xd'),_0x4d480c,'request\x20sent',JSON[_0x2a01('0xe')](_0x134eb3));if(_0x134eb3['error']){if(_0x134eb3[_0x2a01('0xf')]['code']===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x4d480c,_0x134eb3['error'][_0x2a01('0x10')]);return _0x2f0f21(_0x134eb3[_0x2a01('0xf')][_0x2a01('0x10')]);}logger[_0x2a01('0xf')](_0x2a01('0xa'),_0x4d480c,_0x134eb3[_0x2a01('0xf')]['message']);return _0x3e0567(_0x134eb3[_0x2a01('0xf')][_0x2a01('0x10')]);}else{logger[_0x2a01('0x11')](_0x2a01('0xa'),_0x4d480c,_0x2a01('0xb'));_0x3e0567(_0x134eb3['result'][_0x2a01('0x10')]);}})[_0x2a01('0x12')](function(_0x8372a5){logger['error'](_0x2a01('0xa'),_0x4d480c,_0x8372a5);_0x2f0f21(_0x8372a5);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index aafe4fb..bbc8b54 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 _0x16e4=['isAuthenticated','index','/:id','show','/:id/questions','getQuestions','post','create','put','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get'];(function(_0x4250dc,_0x1ab5a8){var _0x2e5276=function(_0x7d55bb){while(--_0x7d55bb){_0x4250dc['push'](_0x4250dc['shift']());}};_0x2e5276(++_0x1ab5a8);}(_0x16e4,0x11c));var _0x416e=function(_0x27a022,_0x5b61ba){_0x27a022=_0x27a022-0x0;var _0x4b709c=_0x16e4[_0x27a022];return _0x4b709c;};'use strict';var multer=require(_0x416e('0x0'));var util=require(_0x416e('0x1'));var path=require(_0x416e('0x2'));var timeout=require(_0x416e('0x3'));var express=require('express');var router=express[_0x416e('0x4')]();var fs_extra=require(_0x416e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x416e('0x6'));var config=require(_0x416e('0x7'));var controller=require(_0x416e('0x8'));router[_0x416e('0x9')]('/',auth[_0x416e('0xa')](),controller[_0x416e('0xb')]);router[_0x416e('0x9')]('/describe',auth[_0x416e('0xa')](),controller['describe']);router[_0x416e('0x9')](_0x416e('0xc'),auth[_0x416e('0xa')](),controller[_0x416e('0xd')]);router[_0x416e('0x9')](_0x416e('0xe'),auth[_0x416e('0xa')](),controller[_0x416e('0xf')]);router[_0x416e('0x10')]('/',auth[_0x416e('0xa')](),controller[_0x416e('0x11')]);router[_0x416e('0x12')](_0x416e('0xc'),auth[_0x416e('0xa')](),controller[_0x416e('0x13')]);router[_0x416e('0x14')](_0x416e('0xc'),auth[_0x416e('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1f67=['util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','describe','/:id','show','getQuestions','post','update','delete','destroy','exports','multer'];(function(_0x12e687,_0xbd3f35){var _0x17eb3f=function(_0x3fe916){while(--_0x3fe916){_0x12e687['push'](_0x12e687['shift']());}};_0x17eb3f(++_0xbd3f35);}(_0x1f67,0x13f));var _0x71f6=function(_0xf0486e,_0x4f09a9){_0xf0486e=_0xf0486e-0x0;var _0x413522=_0x1f67[_0xf0486e];return _0x413522;};'use strict';var multer=require(_0x71f6('0x0'));var util=require(_0x71f6('0x1'));var path=require(_0x71f6('0x2'));var timeout=require(_0x71f6('0x3'));var express=require(_0x71f6('0x4'));var router=express[_0x71f6('0x5')]();var fs_extra=require(_0x71f6('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x71f6('0x7'));var controller=require(_0x71f6('0x8'));router[_0x71f6('0x9')]('/',auth[_0x71f6('0xa')](),controller['index']);router[_0x71f6('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x71f6('0xb')]);router['get'](_0x71f6('0xc'),auth[_0x71f6('0xa')](),controller[_0x71f6('0xd')]);router[_0x71f6('0x9')]('/:id/questions',auth[_0x71f6('0xa')](),controller[_0x71f6('0xe')]);router[_0x71f6('0xf')]('/',auth[_0x71f6('0xa')](),controller['create']);router['put'](_0x71f6('0xc'),auth['isAuthenticated'](),controller[_0x71f6('0x10')]);router[_0x71f6('0x11')](_0x71f6('0xc'),auth[_0x71f6('0xa')](),controller[_0x71f6('0x12')]);module[_0x71f6('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index c4e8f10..b0b21a1 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 _0x8388=['DATE','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize'];(function(_0x26b180,_0x52d861){var _0x28e7f4=function(_0x2060f8){while(--_0x2060f8){_0x26b180['push'](_0x26b180['shift']());}};_0x28e7f4(++_0x52d861);}(_0x8388,0x178));var _0x8838=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x8388[_0x20c9b2];return _0x2c6030;};'use strict';var moment=require(_0x8838('0x0'));var Sequelize=require(_0x8838('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x8838('0x2')],'set':function(_0xfc52b6){this['setDataValue']('starttime',_0xfc52b6);this[_0x8838('0x3')](_0x8838('0x4'),moment()[_0x8838('0x5')](_0x8838('0x6')));}},'endtime':{'type':Sequelize[_0x8838('0x2')]},'membername':{'type':Sequelize[_0x8838('0x7')]},'projectname':{'type':Sequelize[_0x8838('0x7')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8838('0x7')]},'calleridname':{'type':Sequelize[_0x8838('0x7')]},'calleridnum':{'type':Sequelize[_0x8838('0x7')]},'completed':{'type':Sequelize[_0x8838('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0xe0bf=['format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','exports','DATE','setDataValue','starttime','endtime'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe0bf,0x123));var _0xfe0b=function(_0x1c7ec9,_0x304d7d){_0x1c7ec9=_0x1c7ec9-0x0;var _0x3dfa80=_0xe0bf[_0x1c7ec9];return _0x3dfa80;};'use strict';var moment=require(_0xfe0b('0x0'));var Sequelize=require('sequelize');module[_0xfe0b('0x1')]={'starttime':{'type':Sequelize[_0xfe0b('0x2')],'set':function(_0x27ee74){this[_0xfe0b('0x3')](_0xfe0b('0x4'),_0x27ee74);this[_0xfe0b('0x3')](_0xfe0b('0x5'),moment()[_0xfe0b('0x6')](_0xfe0b('0x7')));}},'endtime':{'type':Sequelize[_0xfe0b('0x2')]},'membername':{'type':Sequelize[_0xfe0b('0x8')]},'projectname':{'type':Sequelize[_0xfe0b('0x8')]},'queue':{'type':Sequelize[_0xfe0b('0x8')]},'uniqueid':{'type':Sequelize[_0xfe0b('0x8')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'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 e34c84d..59417ae 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 _0x78a1=['json','offset','undefined','limit','count','set','Content-Range','update','destroy','error','stack','name','send','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','JscriptySessionReport','then','rows','params','fields','includeAll','find','catch','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','findAll','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x78a1,0x119));var _0x178a=function(_0x4c28bc,_0x686271){_0x4c28bc=_0x4c28bc-0x0;var _0x3e17eb=_0x78a1[_0x4c28bc];return _0x3e17eb;};'use strict';var emlformat=require(_0x178a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x178a('0x1'));var jsonpatch=require(_0x178a('0x2'));var rp=require(_0x178a('0x3'));var moment=require('moment');var BPromise=require(_0x178a('0x4'));var Mustache=require('mustache');var util=require(_0x178a('0x5'));var path=require(_0x178a('0x6'));var sox=require(_0x178a('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x178a('0x8'));var _=require(_0x178a('0x9'));var squel=require(_0x178a('0xa'));var crypto=require(_0x178a('0xb'));var jsforce=require(_0x178a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x178a('0xd'));var querystring=require(_0x178a('0xe'));var Papa=require(_0x178a('0xf'));var Redis=require('ioredis');var authService=require(_0x178a('0x10'));var qs=require(_0x178a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x178a('0x12'));var logger=require('../../config/logger')(_0x178a('0x13'));var utils=require(_0x178a('0x14'));var config=require(_0x178a('0x15'));var licenseUtil=require(_0x178a('0x16'));var db=require(_0x178a('0x17'))['db'];function respondWithStatusCode(_0x40728f,_0x50c1b3){_0x50c1b3=_0x50c1b3||0xcc;return function(_0x298ae8){if(_0x298ae8){return _0x40728f[_0x178a('0x18')](_0x50c1b3);}return _0x40728f[_0x178a('0x19')](_0x50c1b3)[_0x178a('0x1a')]();};}function respondWithResult(_0x219561,_0x51e5c9){_0x51e5c9=_0x51e5c9||0xc8;return function(_0x2c4118){if(_0x2c4118){return _0x219561[_0x178a('0x19')](_0x51e5c9)[_0x178a('0x1b')](_0x2c4118);}};}function respondWithFilteredResult(_0x47f75c,_0x3de5fe){return function(_0x161b44){if(_0x161b44){var _0x417805=typeof _0x3de5fe[_0x178a('0x1c')]===_0x178a('0x1d')&&typeof _0x3de5fe[_0x178a('0x1e')]===_0x178a('0x1d');var _0x49ed53=_0x161b44[_0x178a('0x1f')];var _0x1bbe34=_0x417805?0x0:_0x3de5fe[_0x178a('0x1c')];var _0x580764=_0x417805?_0x161b44[_0x178a('0x1f')]:_0x3de5fe[_0x178a('0x1c')]+_0x3de5fe['limit'];var _0x1584f1;if(_0x580764>=_0x49ed53){_0x580764=_0x49ed53;_0x1584f1=0xc8;}else{_0x1584f1=0xce;}_0x47f75c['status'](_0x1584f1);return _0x47f75c[_0x178a('0x20')](_0x178a('0x21'),_0x1bbe34+'-'+_0x580764+'/'+_0x49ed53)[_0x178a('0x1b')](_0x161b44);}return null;};}function patchUpdates(_0x16a909){return function(_0x236834){try{jsonpatch['apply'](_0x236834,_0x16a909,!![]);}catch(_0x2a431f){return BPromise['reject'](_0x2a431f);}return _0x236834['save']();};}function saveUpdates(_0x16bf8a,_0x12e120){return function(_0x3ab14c){if(_0x3ab14c){return _0x3ab14c[_0x178a('0x22')](_0x16bf8a)['then'](function(_0x4671e2){return _0x4671e2;});}return null;};}function removeEntity(_0x1fe599,_0x1aa1bc){return function(_0x50b350){if(_0x50b350){return _0x50b350[_0x178a('0x23')]()['then'](function(){_0x1fe599['status'](0xcc)[_0x178a('0x1a')]();});}};}function handleEntityNotFound(_0x5e1860,_0x448d66){return function(_0x4bf55a){if(!_0x4bf55a){_0x5e1860[_0x178a('0x18')](0x194);}return _0x4bf55a;};}function handleError(_0x51e637,_0x1b0ed5){_0x1b0ed5=_0x1b0ed5||0x1f4;return function(_0xd4d997){logger[_0x178a('0x24')](_0xd4d997[_0x178a('0x25')]);if(_0xd4d997[_0x178a('0x26')]){delete _0xd4d997[_0x178a('0x26')];}_0x51e637[_0x178a('0x19')](_0x1b0ed5)[_0x178a('0x27')](_0xd4d997);};}exports['index']=function(_0x299e34,_0x1eb10e){var _0x31d030={},_0x236655={},_0x5ad5ae={'count':0x0,'rows':[]};var _0x1ee747=_[_0x178a('0x28')](db['JscriptySessionReport'][_0x178a('0x29')],function(_0x1f6057){return{'name':_0x1f6057['fieldName'],'type':_0x1f6057[_0x178a('0x2a')][_0x178a('0x2b')]};});_0x236655[_0x178a('0x2c')]=_[_0x178a('0x28')](_0x1ee747,_0x178a('0x26'));_0x236655['query']=_[_0x178a('0x2d')](_0x299e34[_0x178a('0x2e')]);_0x236655[_0x178a('0x2f')]=_[_0x178a('0x30')](_0x236655[_0x178a('0x2c')],_0x236655['query']);_0x31d030[_0x178a('0x31')]=_[_0x178a('0x30')](_0x236655[_0x178a('0x2c')],qs['fields'](_0x299e34[_0x178a('0x2e')]['fields']));_0x31d030['attributes']=_0x31d030[_0x178a('0x31')][_0x178a('0x32')]?_0x31d030[_0x178a('0x31')]:_0x236655[_0x178a('0x2c')];if(!_0x299e34['query']['hasOwnProperty'](_0x178a('0x33'))){_0x31d030['limit']=qs[_0x178a('0x1e')](_0x299e34[_0x178a('0x2e')][_0x178a('0x1e')]);_0x31d030[_0x178a('0x1c')]=qs[_0x178a('0x1c')](_0x299e34[_0x178a('0x2e')][_0x178a('0x1c')]);}_0x31d030[_0x178a('0x34')]=qs[_0x178a('0x35')](_0x299e34['query'][_0x178a('0x35')]);_0x31d030[_0x178a('0x36')]=qs[_0x178a('0x2f')](_[_0x178a('0x37')](_0x299e34['query'],_0x236655['filters']),_0x1ee747);if(_0x299e34['query']['filter']){_0x31d030[_0x178a('0x36')]=_[_0x178a('0x38')](_0x31d030['where'],{'$or':_['map'](_0x1ee747,function(_0xbc2aad){if(_0xbc2aad[_0x178a('0x2a')]!==_0x178a('0x39')){var _0x3059e5={};_0x3059e5[_0xbc2aad[_0x178a('0x26')]]={'$like':'%'+_0x299e34['query'][_0x178a('0x3a')]+'%'};return _0x3059e5;}})});}_0x31d030=_['merge']({},_0x31d030,_0x299e34[_0x178a('0x3b')]);var _0x10c3ad={'where':_0x31d030[_0x178a('0x36')]};return db['JscriptySessionReport'][_0x178a('0x1f')](_0x10c3ad)['then'](function(_0x526b46){_0x5ad5ae['count']=_0x526b46;if(_0x299e34[_0x178a('0x2e')]['includeAll']){_0x31d030[_0x178a('0x3c')]=[{'all':!![]}];}return db[_0x178a('0x3d')]['findAll'](_0x31d030);})[_0x178a('0x3e')](function(_0x309051){_0x5ad5ae[_0x178a('0x3f')]=_0x309051;return _0x5ad5ae;})[_0x178a('0x3e')](respondWithFilteredResult(_0x1eb10e,_0x31d030))['catch'](handleError(_0x1eb10e,null));};exports['show']=function(_0x39002d,_0xc8aa06){var _0x1a2e8d={'raw':!![],'where':{'id':_0x39002d[_0x178a('0x40')]['id']}},_0x8a163d={};_0x8a163d['model']=_[_0x178a('0x2d')](db['JscriptySessionReport'][_0x178a('0x29')]);_0x8a163d[_0x178a('0x2e')]=_[_0x178a('0x2d')](_0x39002d[_0x178a('0x2e')]);_0x8a163d[_0x178a('0x2f')]=_[_0x178a('0x30')](_0x8a163d[_0x178a('0x2c')],_0x8a163d[_0x178a('0x2e')]);_0x1a2e8d[_0x178a('0x31')]=_[_0x178a('0x30')](_0x8a163d[_0x178a('0x2c')],qs[_0x178a('0x41')](_0x39002d[_0x178a('0x2e')][_0x178a('0x41')]));_0x1a2e8d['attributes']=_0x1a2e8d[_0x178a('0x31')][_0x178a('0x32')]?_0x1a2e8d[_0x178a('0x31')]:_0x8a163d[_0x178a('0x2c')];if(_0x39002d[_0x178a('0x2e')][_0x178a('0x42')]){_0x1a2e8d[_0x178a('0x3c')]=[{'all':!![]}];}_0x1a2e8d=_[_0x178a('0x38')]({},_0x1a2e8d,_0x39002d[_0x178a('0x3b')]);return db[_0x178a('0x3d')][_0x178a('0x43')](_0x1a2e8d)[_0x178a('0x3e')](handleEntityNotFound(_0xc8aa06,null))[_0x178a('0x3e')](respondWithResult(_0xc8aa06,null))[_0x178a('0x44')](handleError(_0xc8aa06,null));};exports['create']=function(_0x369884,_0x3c9cb9){return db[_0x178a('0x3d')][_0x178a('0x45')](_0x369884[_0x178a('0x46')],{})[_0x178a('0x3e')](respondWithResult(_0x3c9cb9,0xc9))[_0x178a('0x44')](handleError(_0x3c9cb9,null));};exports['update']=function(_0x4f3a8b,_0x101822){if(_0x4f3a8b['body']['id']){delete _0x4f3a8b[_0x178a('0x46')]['id'];}return db[_0x178a('0x3d')][_0x178a('0x43')]({'where':{'id':_0x4f3a8b[_0x178a('0x40')]['id']}})[_0x178a('0x3e')](handleEntityNotFound(_0x101822,null))[_0x178a('0x3e')](saveUpdates(_0x4f3a8b[_0x178a('0x46')],null))[_0x178a('0x3e')](respondWithResult(_0x101822,null))[_0x178a('0x44')](handleError(_0x101822,null));};exports[_0x178a('0x23')]=function(_0x1863b5,_0x510c64){return db[_0x178a('0x3d')]['find']({'where':{'id':_0x1863b5[_0x178a('0x40')]['id']}})[_0x178a('0x3e')](handleEntityNotFound(_0x510c64,null))['then'](removeEntity(_0x510c64,null))[_0x178a('0x44')](handleError(_0x510c64,null));};exports[_0x178a('0x47')]=function(_0x140f1a,_0x5a6101){return db[_0x178a('0x3d')][_0x178a('0x47')]()[_0x178a('0x3e')](respondWithResult(_0x5a6101,null))[_0x178a('0x44')](handleError(_0x5a6101,null));};exports[_0x178a('0x48')]=function(_0x1eb480,_0xa34b1c,_0x1c5a3a){var _0x1ca562={'raw':!![],'where':{}};var _0x39180d={};var _0x485826={'count':0x0,'rows':[]};return db[_0x178a('0x3d')][_0x178a('0x49')]({'where':{'id':_0x1eb480[_0x178a('0x40')]['id']}})[_0x178a('0x3e')](handleEntityNotFound(_0xa34b1c,null))['then'](function(_0xa38dba){if(_0xa38dba){_0x39180d[_0x178a('0x2c')]=_[_0x178a('0x2d')](db[_0x178a('0x4a')][_0x178a('0x29')]);_0x39180d[_0x178a('0x2e')]=_[_0x178a('0x2d')](_0x1eb480[_0x178a('0x2e')]);_0x39180d['filters']=_[_0x178a('0x30')](_0x39180d[_0x178a('0x2c')],_0x39180d[_0x178a('0x2e')]);_0x1ca562['attributes']=_[_0x178a('0x30')](_0x39180d[_0x178a('0x2c')],qs[_0x178a('0x41')](_0x1eb480[_0x178a('0x2e')][_0x178a('0x41')]));_0x1ca562['attributes']=_0x1ca562['attributes']['length']?_0x1ca562[_0x178a('0x31')]:_0x39180d[_0x178a('0x2c')];if(!_0x1eb480['query'][_0x178a('0x4b')](_0x178a('0x33'))){_0x1ca562[_0x178a('0x1e')]=qs[_0x178a('0x1e')](_0x1eb480[_0x178a('0x2e')]['limit']);_0x1ca562['offset']=qs[_0x178a('0x1c')](_0x1eb480[_0x178a('0x2e')][_0x178a('0x1c')]);}_0x1ca562[_0x178a('0x34')]=qs[_0x178a('0x35')](_0x1eb480[_0x178a('0x2e')][_0x178a('0x35')]);_0x1ca562[_0x178a('0x36')]=qs['filters'](_[_0x178a('0x37')](_0x1eb480[_0x178a('0x2e')],_0x39180d[_0x178a('0x2f')]));_0x1ca562[_0x178a('0x36')]['SessionId']=_0xa38dba['id'];if(_0x1eb480[_0x178a('0x2e')][_0x178a('0x3a')]){_0x1ca562[_0x178a('0x36')]=_[_0x178a('0x38')](_0x1ca562['where'],{'$or':_['map'](_0x1ca562['attributes'],function(_0x403c5d){var _0x15c899={};_0x15c899[_0x403c5d]={'$like':'%'+_0x1eb480[_0x178a('0x2e')][_0x178a('0x3a')]+'%'};return _0x15c899;})});}_0x1ca562=_['merge']({},_0x1ca562,_0x1eb480[_0x178a('0x3b')]);return db[_0x178a('0x4a')]['count']({'where':_0x1ca562[_0x178a('0x36')]})[_0x178a('0x3e')](function(_0x50ca01){_0x485826['count']=_0x50ca01;if(_0x1eb480['query'][_0x178a('0x42')]){_0x1ca562['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x178a('0x4c')](_0x1ca562);})[_0x178a('0x3e')](function(_0x419142){_0x485826[_0x178a('0x3f')]=_0x419142;return _0x485826;});}})[_0x178a('0x3e')](respondWithFilteredResult(_0xa34b1c,_0x1ca562))[_0x178a('0x44')](handleError(_0xa34b1c,null));}; \ No newline at end of file +var _0x25be=['path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','error','name','send','map','JscriptySessionReport','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','destroy','describe','findOne','SessionId','JscriptyQuestionReport','rows','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x447f8a,_0x83426e){var _0x491a66=function(_0x371c1e){while(--_0x371c1e){_0x447f8a['push'](_0x447f8a['shift']());}};_0x491a66(++_0x83426e);}(_0x25be,0xe0));var _0xe25b=function(_0x549daf,_0x22ae61){_0x549daf=_0x549daf-0x0;var _0x513d31=_0x25be[_0x549daf];return _0x513d31;};'use strict';var emlformat=require(_0xe25b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe25b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe25b('0x2'));var moment=require(_0xe25b('0x3'));var BPromise=require(_0xe25b('0x4'));var Mustache=require(_0xe25b('0x5'));var util=require(_0xe25b('0x6'));var path=require(_0xe25b('0x7'));var sox=require('sox');var csv=require(_0xe25b('0x8'));var ejs=require(_0xe25b('0x9'));var fs=require('fs');var fs_extra=require(_0xe25b('0xa'));var _=require(_0xe25b('0xb'));var squel=require('squel');var crypto=require(_0xe25b('0xc'));var jsforce=require(_0xe25b('0xd'));var deskjs=require(_0xe25b('0xe'));var toCsv=require(_0xe25b('0x8'));var querystring=require(_0xe25b('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe25b('0x10'));var as=require(_0xe25b('0x11'));var hardwareService=require(_0xe25b('0x12'));var logger=require('../../config/logger')(_0xe25b('0x13'));var utils=require(_0xe25b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe25b('0x15'));var db=require(_0xe25b('0x16'))['db'];function respondWithStatusCode(_0xb02bc1,_0x1a2beb){_0x1a2beb=_0x1a2beb||0xcc;return function(_0x2e9a04){if(_0x2e9a04){return _0xb02bc1[_0xe25b('0x17')](_0x1a2beb);}return _0xb02bc1['status'](_0x1a2beb)[_0xe25b('0x18')]();};}function respondWithResult(_0x5f5752,_0x419fc4){_0x419fc4=_0x419fc4||0xc8;return function(_0x545658){if(_0x545658){return _0x5f5752[_0xe25b('0x19')](_0x419fc4)[_0xe25b('0x1a')](_0x545658);}};}function respondWithFilteredResult(_0x500007,_0x128757){return function(_0x4d6d2e){if(_0x4d6d2e){var _0x3e8403=typeof _0x128757[_0xe25b('0x1b')]===_0xe25b('0x1c')&&typeof _0x128757['limit']===_0xe25b('0x1c');var _0x576622=_0x4d6d2e[_0xe25b('0x1d')];var _0x36bc4e=_0x3e8403?0x0:_0x128757[_0xe25b('0x1b')];var _0x2adae2=_0x3e8403?_0x4d6d2e[_0xe25b('0x1d')]:_0x128757[_0xe25b('0x1b')]+_0x128757[_0xe25b('0x1e')];var _0x205888;if(_0x2adae2>=_0x576622){_0x2adae2=_0x576622;_0x205888=0xc8;}else{_0x205888=0xce;}_0x500007[_0xe25b('0x19')](_0x205888);return _0x500007['set'](_0xe25b('0x1f'),_0x36bc4e+'-'+_0x2adae2+'/'+_0x576622)[_0xe25b('0x1a')](_0x4d6d2e);}return null;};}function patchUpdates(_0x708235){return function(_0x15da7c){try{jsonpatch[_0xe25b('0x20')](_0x15da7c,_0x708235,!![]);}catch(_0x4c2e39){return BPromise[_0xe25b('0x21')](_0x4c2e39);}return _0x15da7c['save']();};}function saveUpdates(_0xb5e45c,_0x4b62cc){return function(_0x101a58){if(_0x101a58){return _0x101a58[_0xe25b('0x22')](_0xb5e45c)[_0xe25b('0x23')](function(_0x28bd76){return _0x28bd76;});}return null;};}function removeEntity(_0x403825,_0x114524){return function(_0x48cf8b){if(_0x48cf8b){return _0x48cf8b['destroy']()[_0xe25b('0x23')](function(){_0x403825[_0xe25b('0x19')](0xcc)[_0xe25b('0x18')]();});}};}function handleEntityNotFound(_0x1ef9e,_0x8c2455){return function(_0x2e5839){if(!_0x2e5839){_0x1ef9e[_0xe25b('0x17')](0x194);}return _0x2e5839;};}function handleError(_0x249433,_0x32978b){_0x32978b=_0x32978b||0x1f4;return function(_0x2386b4){logger[_0xe25b('0x24')](_0x2386b4['stack']);if(_0x2386b4[_0xe25b('0x25')]){delete _0x2386b4[_0xe25b('0x25')];}_0x249433[_0xe25b('0x19')](_0x32978b)[_0xe25b('0x26')](_0x2386b4);};}exports['index']=function(_0x4f9624,_0x1f9b6c){var _0x1060e0={},_0x40b728={},_0xb39135={'count':0x0,'rows':[]};var _0x174d56=_[_0xe25b('0x27')](db[_0xe25b('0x28')][_0xe25b('0x29')],function(_0x2c37af){return{'name':_0x2c37af['fieldName'],'type':_0x2c37af[_0xe25b('0x2a')][_0xe25b('0x2b')]};});_0x40b728['model']=_[_0xe25b('0x27')](_0x174d56,_0xe25b('0x25'));_0x40b728[_0xe25b('0x2c')]=_[_0xe25b('0x2d')](_0x4f9624[_0xe25b('0x2c')]);_0x40b728[_0xe25b('0x2e')]=_[_0xe25b('0x2f')](_0x40b728[_0xe25b('0x30')],_0x40b728[_0xe25b('0x2c')]);_0x1060e0['attributes']=_[_0xe25b('0x2f')](_0x40b728[_0xe25b('0x30')],qs[_0xe25b('0x31')](_0x4f9624[_0xe25b('0x2c')][_0xe25b('0x31')]));_0x1060e0['attributes']=_0x1060e0[_0xe25b('0x32')][_0xe25b('0x33')]?_0x1060e0[_0xe25b('0x32')]:_0x40b728['model'];if(!_0x4f9624['query'][_0xe25b('0x34')](_0xe25b('0x35'))){_0x1060e0[_0xe25b('0x1e')]=qs[_0xe25b('0x1e')](_0x4f9624[_0xe25b('0x2c')][_0xe25b('0x1e')]);_0x1060e0[_0xe25b('0x1b')]=qs[_0xe25b('0x1b')](_0x4f9624['query'][_0xe25b('0x1b')]);}_0x1060e0[_0xe25b('0x36')]=qs[_0xe25b('0x37')](_0x4f9624['query'][_0xe25b('0x37')]);_0x1060e0[_0xe25b('0x38')]=qs[_0xe25b('0x2e')](_[_0xe25b('0x39')](_0x4f9624['query'],_0x40b728[_0xe25b('0x2e')]),_0x174d56);if(_0x4f9624['query']['filter']){_0x1060e0[_0xe25b('0x38')]=_[_0xe25b('0x3a')](_0x1060e0[_0xe25b('0x38')],{'$or':_[_0xe25b('0x27')](_0x174d56,function(_0x23d28b){if(_0x23d28b[_0xe25b('0x2a')]!==_0xe25b('0x3b')){var _0xe3ce49={};_0xe3ce49[_0x23d28b[_0xe25b('0x25')]]={'$like':'%'+_0x4f9624[_0xe25b('0x2c')][_0xe25b('0x3c')]+'%'};return _0xe3ce49;}})});}_0x1060e0=_['merge']({},_0x1060e0,_0x4f9624[_0xe25b('0x3d')]);var _0x4d0fd7={'where':_0x1060e0[_0xe25b('0x38')]};return db[_0xe25b('0x28')][_0xe25b('0x1d')](_0x4d0fd7)[_0xe25b('0x23')](function(_0x5b7071){_0xb39135[_0xe25b('0x1d')]=_0x5b7071;if(_0x4f9624[_0xe25b('0x2c')][_0xe25b('0x3e')]){_0x1060e0[_0xe25b('0x3f')]=[{'all':!![]}];}return db[_0xe25b('0x28')][_0xe25b('0x40')](_0x1060e0);})[_0xe25b('0x23')](function(_0x22466f){_0xb39135['rows']=_0x22466f;return _0xb39135;})[_0xe25b('0x23')](respondWithFilteredResult(_0x1f9b6c,_0x1060e0))[_0xe25b('0x41')](handleError(_0x1f9b6c,null));};exports[_0xe25b('0x42')]=function(_0x3ddeb8,_0x29a7cd){var _0x16d957={'raw':!![],'where':{'id':_0x3ddeb8[_0xe25b('0x43')]['id']}},_0x40e0fd={};_0x40e0fd[_0xe25b('0x30')]=_[_0xe25b('0x2d')](db[_0xe25b('0x28')][_0xe25b('0x29')]);_0x40e0fd['query']=_['keys'](_0x3ddeb8[_0xe25b('0x2c')]);_0x40e0fd['filters']=_[_0xe25b('0x2f')](_0x40e0fd[_0xe25b('0x30')],_0x40e0fd[_0xe25b('0x2c')]);_0x16d957[_0xe25b('0x32')]=_[_0xe25b('0x2f')](_0x40e0fd['model'],qs[_0xe25b('0x31')](_0x3ddeb8[_0xe25b('0x2c')][_0xe25b('0x31')]));_0x16d957[_0xe25b('0x32')]=_0x16d957[_0xe25b('0x32')][_0xe25b('0x33')]?_0x16d957['attributes']:_0x40e0fd['model'];if(_0x3ddeb8[_0xe25b('0x2c')]['includeAll']){_0x16d957[_0xe25b('0x3f')]=[{'all':!![]}];}_0x16d957=_['merge']({},_0x16d957,_0x3ddeb8['options']);return db[_0xe25b('0x28')][_0xe25b('0x44')](_0x16d957)[_0xe25b('0x23')](handleEntityNotFound(_0x29a7cd,null))[_0xe25b('0x23')](respondWithResult(_0x29a7cd,null))['catch'](handleError(_0x29a7cd,null));};exports['create']=function(_0x53c85f,_0x563e1f){return db[_0xe25b('0x28')][_0xe25b('0x45')](_0x53c85f[_0xe25b('0x46')],{})[_0xe25b('0x23')](respondWithResult(_0x563e1f,0xc9))['catch'](handleError(_0x563e1f,null));};exports[_0xe25b('0x22')]=function(_0x5475df,_0x5efdc3){if(_0x5475df[_0xe25b('0x46')]['id']){delete _0x5475df['body']['id'];}return db[_0xe25b('0x28')][_0xe25b('0x44')]({'where':{'id':_0x5475df[_0xe25b('0x43')]['id']}})[_0xe25b('0x23')](handleEntityNotFound(_0x5efdc3,null))[_0xe25b('0x23')](saveUpdates(_0x5475df['body'],null))[_0xe25b('0x23')](respondWithResult(_0x5efdc3,null))[_0xe25b('0x41')](handleError(_0x5efdc3,null));};exports[_0xe25b('0x47')]=function(_0x1645d5,_0x2a8ee3){return db[_0xe25b('0x28')][_0xe25b('0x44')]({'where':{'id':_0x1645d5['params']['id']}})[_0xe25b('0x23')](handleEntityNotFound(_0x2a8ee3,null))[_0xe25b('0x23')](removeEntity(_0x2a8ee3,null))[_0xe25b('0x41')](handleError(_0x2a8ee3,null));};exports[_0xe25b('0x48')]=function(_0x1bdca5,_0x35e7fd){return db['JscriptySessionReport'][_0xe25b('0x48')]()[_0xe25b('0x23')](respondWithResult(_0x35e7fd,null))[_0xe25b('0x41')](handleError(_0x35e7fd,null));};exports['getQuestions']=function(_0x31f6d4,_0x222b97,_0x4636d9){var _0x1b69f7={'raw':!![],'where':{}};var _0x7d84f2={};var _0x399794={'count':0x0,'rows':[]};return db[_0xe25b('0x28')][_0xe25b('0x49')]({'where':{'id':_0x31f6d4[_0xe25b('0x43')]['id']}})[_0xe25b('0x23')](handleEntityNotFound(_0x222b97,null))[_0xe25b('0x23')](function(_0x13e0dd){if(_0x13e0dd){_0x7d84f2[_0xe25b('0x30')]=_[_0xe25b('0x2d')](db['JscriptyQuestionReport'][_0xe25b('0x29')]);_0x7d84f2[_0xe25b('0x2c')]=_[_0xe25b('0x2d')](_0x31f6d4[_0xe25b('0x2c')]);_0x7d84f2[_0xe25b('0x2e')]=_[_0xe25b('0x2f')](_0x7d84f2['model'],_0x7d84f2[_0xe25b('0x2c')]);_0x1b69f7[_0xe25b('0x32')]=_['intersection'](_0x7d84f2[_0xe25b('0x30')],qs[_0xe25b('0x31')](_0x31f6d4['query'][_0xe25b('0x31')]));_0x1b69f7[_0xe25b('0x32')]=_0x1b69f7[_0xe25b('0x32')][_0xe25b('0x33')]?_0x1b69f7[_0xe25b('0x32')]:_0x7d84f2[_0xe25b('0x30')];if(!_0x31f6d4['query'][_0xe25b('0x34')]('nolimit')){_0x1b69f7[_0xe25b('0x1e')]=qs[_0xe25b('0x1e')](_0x31f6d4[_0xe25b('0x2c')]['limit']);_0x1b69f7[_0xe25b('0x1b')]=qs[_0xe25b('0x1b')](_0x31f6d4[_0xe25b('0x2c')][_0xe25b('0x1b')]);}_0x1b69f7[_0xe25b('0x36')]=qs[_0xe25b('0x37')](_0x31f6d4[_0xe25b('0x2c')]['sort']);_0x1b69f7[_0xe25b('0x38')]=qs[_0xe25b('0x2e')](_[_0xe25b('0x39')](_0x31f6d4['query'],_0x7d84f2[_0xe25b('0x2e')]));_0x1b69f7[_0xe25b('0x38')][_0xe25b('0x4a')]=_0x13e0dd['id'];if(_0x31f6d4['query'][_0xe25b('0x3c')]){_0x1b69f7[_0xe25b('0x38')]=_['merge'](_0x1b69f7['where'],{'$or':_[_0xe25b('0x27')](_0x1b69f7[_0xe25b('0x32')],function(_0x1a00c6){var _0x27d77e={};_0x27d77e[_0x1a00c6]={'$like':'%'+_0x31f6d4[_0xe25b('0x2c')][_0xe25b('0x3c')]+'%'};return _0x27d77e;})});}_0x1b69f7=_[_0xe25b('0x3a')]({},_0x1b69f7,_0x31f6d4['options']);return db[_0xe25b('0x4b')][_0xe25b('0x1d')]({'where':_0x1b69f7[_0xe25b('0x38')]})['then'](function(_0x23515e){_0x399794[_0xe25b('0x1d')]=_0x23515e;if(_0x31f6d4[_0xe25b('0x2c')]['includeAll']){_0x1b69f7[_0xe25b('0x3f')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xe25b('0x40')](_0x1b69f7);})[_0xe25b('0x23')](function(_0x2952d9){_0x399794[_0xe25b('0x4c')]=_0x2952d9;return _0x399794;});}})[_0xe25b('0x23')](respondWithFilteredResult(_0x222b97,_0x1b69f7))[_0xe25b('0x41')](handleError(_0x222b97,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index c1b592a..7757e31 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 _0x7ee1=['report_jscripty_sessions','lodash','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define'];(function(_0x4c4b35,_0x37e665){var _0xd5bbac=function(_0x32c754){while(--_0x32c754){_0x4c4b35['push'](_0x4c4b35['shift']());}};_0xd5bbac(++_0x37e665);}(_0x7ee1,0x8d));var _0x17ee=function(_0x4a780c,_0x3f48df){_0x4a780c=_0x4a780c-0x0;var _0x39c5fa=_0x7ee1[_0x4a780c];return _0x39c5fa;};'use strict';var _=require(_0x17ee('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x17ee('0x1'));var BPromise=require(_0x17ee('0x2'));var rp=require(_0x17ee('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x17ee('0x4'));var config=require(_0x17ee('0x5'));var attributes=require(_0x17ee('0x6'));module[_0x17ee('0x7')]=function(_0x5c0617,_0x52b1db){return _0x5c0617[_0x17ee('0x8')]('JscriptySessionReport',attributes,{'tableName':_0x17ee('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ee1=['report_jscripty_sessions','lodash','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define'];(function(_0x7f9777,_0xe52bab){var _0x4dc780=function(_0x2d662b){while(--_0x2d662b){_0x7f9777['push'](_0x7f9777['shift']());}};_0x4dc780(++_0xe52bab);}(_0x7ee1,0x8d));var _0x17ee=function(_0xc841db,_0x1529cf){_0xc841db=_0xc841db-0x0;var _0xff1d6e=_0x7ee1[_0xc841db];return _0xff1d6e;};'use strict';var _=require(_0x17ee('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x17ee('0x1'));var BPromise=require(_0x17ee('0x2'));var rp=require(_0x17ee('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x17ee('0x4'));var config=require(_0x17ee('0x5'));var attributes=require(_0x17ee('0x6'));module[_0x17ee('0x7')]=function(_0x5c0617,_0x52b1db){return _0x5c0617[_0x17ee('0x8')]('JscriptySessionReport',attributes,{'tableName':_0x17ee('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 2b7e183..d7f1b56 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb091=['JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','request','then','info'];(function(_0x224d5e,_0x27de6b){var _0x4e7c72=function(_0x4f32ee){while(--_0x4f32ee){_0x224d5e['push'](_0x224d5e['shift']());}};_0x4e7c72(++_0x27de6b);}(_0xb091,0x16e));var _0x1b09=function(_0x5c9939,_0x3c21b3){_0x5c9939=_0x5c9939-0x0;var _0x781711=_0xb091[_0x5c9939];return _0x781711;};'use strict';var _=require('lodash');var util=require(_0x1b09('0x0'));var moment=require(_0x1b09('0x1'));var BPromise=require(_0x1b09('0x2'));var rs=require(_0x1b09('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b09('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1b09('0x5'));var config=require(_0x1b09('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1b09('0x7')][_0x1b09('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2bf4f6,_0x5ce726,_0x142c33){return new BPromise(function(_0x8c26a5,_0x2f359f){return client[_0x1b09('0x9')](_0x2bf4f6,_0x142c33)[_0x1b09('0xa')](function(_0x3362e4){logger[_0x1b09('0xb')](_0x1b09('0xc'),_0x5ce726,_0x1b09('0xd'));logger[_0x1b09('0xe')](_0x1b09('0xf'),_0x5ce726,'request\x20sent',JSON[_0x1b09('0x10')](_0x3362e4));if(_0x3362e4[_0x1b09('0x11')]){if(_0x3362e4['error']['code']===0x1f4){logger[_0x1b09('0x11')](_0x1b09('0xc'),_0x5ce726,_0x3362e4[_0x1b09('0x11')][_0x1b09('0x12')]);return _0x2f359f(_0x3362e4[_0x1b09('0x11')][_0x1b09('0x12')]);}logger[_0x1b09('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x5ce726,_0x3362e4[_0x1b09('0x11')]['message']);return _0x8c26a5(_0x3362e4[_0x1b09('0x11')][_0x1b09('0x12')]);}else{logger[_0x1b09('0xb')](_0x1b09('0xc'),_0x5ce726,_0x1b09('0xd'));_0x8c26a5(_0x3362e4[_0x1b09('0x13')][_0x1b09('0x12')]);}})[_0x1b09('0x14')](function(_0x1196b2){logger[_0x1b09('0x11')](_0x1b09('0xc'),_0x5ce726,_0x1196b2);_0x2f359f(_0x1196b2);});});} \ No newline at end of file +var _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(_0x3a0f06,_0x3a74a6){var _0x5401e6=function(_0x4bcd29){while(--_0x4bcd29){_0x3a0f06['push'](_0x3a0f06['shift']());}};_0x5401e6(++_0x3a74a6);}(_0xdb28,0x106));var _0x8db2=function(_0x5acf30,_0x2b1e37){_0x5acf30=_0x5acf30-0x0;var _0x2fc765=_0xdb28[_0x5acf30];return _0x2fc765;};'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 diff --git a/server/api/license/index.js b/server/api/license/index.js index 646b948..5b932ad 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 _0xe181=['./license.controller','put','/:id','isAuthenticated','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xf99093,_0x2c80de){var _0x483611=function(_0x2949c6){while(--_0x2949c6){_0xf99093['push'](_0xf99093['shift']());}};_0x483611(++_0x2c80de);}(_0xe181,0x68));var _0x1e18=function(_0x4c3ffe,_0x457374){_0x4c3ffe=_0x4c3ffe-0x0;var _0x28d3eb=_0xe181[_0x4c3ffe];return _0x28d3eb;};'use strict';var multer=require(_0x1e18('0x0'));var util=require('util');var path=require(_0x1e18('0x1'));var timeout=require(_0x1e18('0x2'));var express=require(_0x1e18('0x3'));var router=express[_0x1e18('0x4')]();var fs_extra=require(_0x1e18('0x5'));var auth=require(_0x1e18('0x6'));var interaction=require(_0x1e18('0x7'));var config=require('../../config/environment');var controller=require(_0x1e18('0x8'));router['get']('/',controller['index']);router[_0x1e18('0x9')](_0x1e18('0xa'),auth[_0x1e18('0xb')](),controller[_0x1e18('0xc')]);module[_0x1e18('0xd')]=router; \ No newline at end of file +var _0x81ef=['isAuthenticated','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./license.controller','get','index','put','/:id'];(function(_0x3eda41,_0x2c0af9){var _0x1f92f0=function(_0x42f84e){while(--_0x42f84e){_0x3eda41['push'](_0x3eda41['shift']());}};_0x1f92f0(++_0x2c0af9);}(_0x81ef,0xc3));var _0xf81e=function(_0x2c2a56,_0x326c66){_0x2c2a56=_0x2c2a56-0x0;var _0x801b1a=_0x81ef[_0x2c2a56];return _0x801b1a;};'use strict';var multer=require(_0xf81e('0x0'));var util=require(_0xf81e('0x1'));var path=require(_0xf81e('0x2'));var timeout=require(_0xf81e('0x3'));var express=require(_0xf81e('0x4'));var router=express[_0xf81e('0x5')]();var fs_extra=require(_0xf81e('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf81e('0x7'));var controller=require(_0xf81e('0x8'));router[_0xf81e('0x9')]('/',controller[_0xf81e('0xa')]);router[_0xf81e('0xb')](_0xf81e('0xc'),auth[_0xf81e('0xd')](),controller[_0xf81e('0xe')]);module[_0xf81e('0xf')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 9cb5d06..39c6775 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 _0x8e1c=['STRING','sequelize','exports'];(function(_0x14fe6c,_0x378d4c){var _0x5a38dc=function(_0x5cc57e){while(--_0x5cc57e){_0x14fe6c['push'](_0x14fe6c['shift']());}};_0x5a38dc(++_0x378d4c);}(_0x8e1c,0x16c));var _0xc8e1=function(_0x3ce0fd,_0xf4188d){_0x3ce0fd=_0x3ce0fd-0x0;var _0x245db6=_0x8e1c[_0x3ce0fd];return _0x245db6;};'use strict';var Sequelize=require(_0xc8e1('0x0'));module[_0xc8e1('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xc8e1('0x2')]},'data2':{'type':Sequelize[_0xc8e1('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xd564=['exports','TEXT','STRING','sequelize'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0xd564,0xef));var _0x4d56=function(_0xac0cf5,_0x548f3f){_0xac0cf5=_0xac0cf5-0x0;var _0x48522d=_0xd564[_0xac0cf5];return _0x48522d;};'use strict';var Sequelize=require(_0x4d56('0x0'));module[_0x4d56('0x1')]={'license':{'type':Sequelize[_0x4d56('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x4d56('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index c3e814a..5ab54bd 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 _0x326f=['sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','stack','name','send','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','options','getLicense','catch','body','License','find','checkLicense','key','demo','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x326f,0xd1));var _0xf326=function(_0x3a7e67,_0x595133){_0x3a7e67=_0x3a7e67-0x0;var _0x863f98=_0x326f[_0x3a7e67];return _0x863f98;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3162f9,_0x9ed463){_0x9ed463=_0x9ed463||0xcc;return function(_0x4b3966){if(_0x4b3966){return _0x3162f9[_0xf326('0x17')](_0x9ed463);}return _0x3162f9[_0xf326('0x18')](_0x9ed463)[_0xf326('0x19')]();};}function respondWithResult(_0x17a098,_0x5c8483){_0x5c8483=_0x5c8483||0xc8;return function(_0x45c1b6){if(_0x45c1b6){return _0x17a098['status'](_0x5c8483)['json'](_0x45c1b6);}};}function respondWithFilteredResult(_0xdf21d9,_0x11f6d2){return function(_0x1f2e5a){if(_0x1f2e5a){var _0xa63d1a=typeof _0x11f6d2[_0xf326('0x1a')]===_0xf326('0x1b')&&typeof _0x11f6d2[_0xf326('0x1c')]===_0xf326('0x1b');var _0x5a682a=_0x1f2e5a[_0xf326('0x1d')];var _0x453100=_0xa63d1a?0x0:_0x11f6d2[_0xf326('0x1a')];var _0x31ffb9=_0xa63d1a?_0x1f2e5a[_0xf326('0x1d')]:_0x11f6d2[_0xf326('0x1a')]+_0x11f6d2['limit'];var _0x4a5b6c;if(_0x31ffb9>=_0x5a682a){_0x31ffb9=_0x5a682a;_0x4a5b6c=0xc8;}else{_0x4a5b6c=0xce;}_0xdf21d9['status'](_0x4a5b6c);return _0xdf21d9[_0xf326('0x1e')](_0xf326('0x1f'),_0x453100+'-'+_0x31ffb9+'/'+_0x5a682a)['json'](_0x1f2e5a);}return null;};}function patchUpdates(_0x4cabce){return function(_0x128c68){try{jsonpatch['apply'](_0x128c68,_0x4cabce,!![]);}catch(_0x5b6d3c){return BPromise[_0xf326('0x20')](_0x5b6d3c);}return _0x128c68[_0xf326('0x21')]();};}function saveUpdates(_0x549b46,_0x5aa184){return function(_0x19b8ba){if(_0x19b8ba){return _0x19b8ba[_0xf326('0x22')](_0x549b46)['then'](function(_0x337ed5){return _0x337ed5;});}return null;};}function removeEntity(_0x1b9039,_0x43c53e){return function(_0x295752){if(_0x295752){return _0x295752[_0xf326('0x23')]()[_0xf326('0x24')](function(){_0x1b9039['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f31f6,_0x520d85){return function(_0x1a2c4e){if(!_0x1a2c4e){_0x4f31f6[_0xf326('0x17')](0x194);}return _0x1a2c4e;};}function handleError(_0x1ff2b5,_0x148953){_0x148953=_0x148953||0x1f4;return function(_0x410237){logger['error'](_0x410237[_0xf326('0x25')]);if(_0x410237[_0xf326('0x26')]){delete _0x410237[_0xf326('0x26')];}_0x1ff2b5['status'](_0x148953)[_0xf326('0x27')](_0x410237);};}var utilLicense=require('../../config/license/util');exports['index']=function(_0x6a8e89,_0x1ae23a){var _0x2fa28e={'raw':!![],'where':{'id':0x1}},_0x5dbe63={};_0x5dbe63[_0xf326('0x28')]=_[_0xf326('0x29')](db['License'][_0xf326('0x2a')]);_0x5dbe63[_0xf326('0x2b')]=_[_0xf326('0x29')](_0x6a8e89[_0xf326('0x2b')]);_0x5dbe63[_0xf326('0x2c')]=_[_0xf326('0x2d')](_0x5dbe63[_0xf326('0x28')],_0x5dbe63[_0xf326('0x2b')]);_0x2fa28e[_0xf326('0x2e')]=_[_0xf326('0x2d')](_0x5dbe63['model'],qs[_0xf326('0x2f')](_0x6a8e89[_0xf326('0x2b')][_0xf326('0x2f')]));_0x2fa28e['attributes']=_0x2fa28e[_0xf326('0x2e')][_0xf326('0x30')]?_0x2fa28e[_0xf326('0x2e')]:_0x5dbe63['model'];_0x2fa28e=_['merge']({},_0x2fa28e,_0x6a8e89[_0xf326('0x31')]);return utilLicense[_0xf326('0x32')](_0x2fa28e)[_0xf326('0x24')](respondWithResult(_0x1ae23a,null))[_0xf326('0x33')](handleError(_0x1ae23a,null));};exports[_0xf326('0x22')]=function(_0x2e8a64,_0x62585a){if(_0x2e8a64[_0xf326('0x34')]['id']){delete _0x2e8a64['body']['id'];}return db[_0xf326('0x35')][_0xf326('0x36')]({'where':{'id':_0x2e8a64['params']['id']}})[_0xf326('0x24')](handleEntityNotFound(_0x62585a,null))['then'](function(_0xce1cbb){var _0x481b64=_0xce1cbb['get']({'plain':!![]});return utilLicense[_0xf326('0x37')](_0x481b64,_0x2e8a64['body'][_0xf326('0x38')]);})['then'](function(_0x310dbb){if(!_0x310dbb[_0xf326('0x39')]){return saveUpdates(_0x2e8a64[_0xf326('0x34')],null);}return _0x310dbb;})['then'](respondWithResult(_0x62585a,null))[_0xf326('0x33')](handleError(_0x62585a,null));}; \ No newline at end of file +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(_0x2ceb68,_0x1f112b){var _0x5408ba=function(_0x218fb2){while(--_0x218fb2){_0x2ceb68['push'](_0x2ceb68['shift']());}};_0x5408ba(++_0x1f112b);}(_0x1261,0x144));var _0x1126=function(_0x1c2aeb,_0x48433c){_0x1c2aeb=_0x1c2aeb-0x0;var _0x783379=_0x1261[_0x1c2aeb];return _0x783379;};'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 diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 30eb8f7..4d88581 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 _0x6ace=['bluebird','request-promise','path','rimraf','define','License','license','lodash','util','../../config/logger','api'];(function(_0x325bc0,_0x606ee0){var _0x535311=function(_0x18d712){while(--_0x18d712){_0x325bc0['push'](_0x325bc0['shift']());}};_0x535311(++_0x606ee0);}(_0x6ace,0x13b));var _0xe6ac=function(_0x591d44,_0x2b43a3){_0x591d44=_0x591d44-0x0;var _0x41dd26=_0x6ace[_0x591d44];return _0x41dd26;};'use strict';var _=require(_0xe6ac('0x0'));var util=require(_0xe6ac('0x1'));var logger=require(_0xe6ac('0x2'))(_0xe6ac('0x3'));var moment=require('moment');var BPromise=require(_0xe6ac('0x4'));var rp=require(_0xe6ac('0x5'));var fs=require('fs');var path=require(_0xe6ac('0x6'));var rimraf=require(_0xe6ac('0x7'));var config=require('../../config/environment');var attributes=require('./license.attributes');module['exports']=function(_0x3ff384,_0x4772e9){return _0x3ff384[_0xe6ac('0x8')](_0xe6ac('0x9'),attributes,{'tableName':_0xe6ac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d49=['moment','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','util','../../config/logger','api'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3d49,0x151));var _0x93d4=function(_0x248bf0,_0x29a685){_0x248bf0=_0x248bf0-0x0;var _0x455c00=_0x3d49[_0x248bf0];return _0x455c00;};'use strict';var _=require('lodash');var util=require(_0x93d4('0x0'));var logger=require(_0x93d4('0x1'))(_0x93d4('0x2'));var moment=require(_0x93d4('0x3'));var BPromise=require('bluebird');var rp=require(_0x93d4('0x4'));var fs=require('fs');var path=require(_0x93d4('0x5'));var rimraf=require(_0x93d4('0x6'));var config=require(_0x93d4('0x7'));var attributes=require(_0x93d4('0x8'));module[_0x93d4('0x9')]=function(_0x4b91a8,_0x577079){return _0x4b91a8['define']('License',attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 1143fcf..a7076f6 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 _0xbc8b=['License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x5d1a90,_0x44ad7d){var _0x4a1dfc=function(_0x10e4d6){while(--_0x10e4d6){_0x5d1a90['push'](_0x5d1a90['shift']());}};_0x4a1dfc(++_0x44ad7d);}(_0xbc8b,0x11d));var _0xbbc8=function(_0x55ff3e,_0x41077f){_0x55ff3e=_0x55ff3e-0x0;var _0x2709eb=_0xbc8b[_0x55ff3e];return _0x2709eb;};'use strict';var _=require(_0xbbc8('0x0'));var util=require(_0xbbc8('0x1'));var moment=require(_0xbbc8('0x2'));var BPromise=require(_0xbbc8('0x3'));var rs=require(_0xbbc8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbbc8('0x5'))['db'];var utils=require(_0xbbc8('0x6'));var logger=require(_0xbbc8('0x7'))(_0xbbc8('0x8'));var config=require(_0xbbc8('0x9'));var jayson=require(_0xbbc8('0xa'));var client=jayson['client'][_0xbbc8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x232b8c,_0x2e6806,_0x49027d){return new BPromise(function(_0x3a4ba8,_0x2e7f77){return client[_0xbbc8('0xc')](_0x232b8c,_0x49027d)[_0xbbc8('0xd')](function(_0x539c04){logger[_0xbbc8('0xe')](_0xbbc8('0xf'),_0x2e6806,_0xbbc8('0x10'));logger[_0xbbc8('0x11')](_0xbbc8('0x12'),_0x2e6806,_0xbbc8('0x10'),JSON[_0xbbc8('0x13')](_0x539c04));if(_0x539c04[_0xbbc8('0x14')]){if(_0x539c04[_0xbbc8('0x14')][_0xbbc8('0x15')]===0x1f4){logger[_0xbbc8('0x14')](_0xbbc8('0xf'),_0x2e6806,_0x539c04[_0xbbc8('0x14')][_0xbbc8('0x16')]);return _0x2e7f77(_0x539c04[_0xbbc8('0x14')][_0xbbc8('0x16')]);}logger['error'](_0xbbc8('0xf'),_0x2e6806,_0x539c04['error']['message']);return _0x3a4ba8(_0x539c04[_0xbbc8('0x14')][_0xbbc8('0x16')]);}else{logger[_0xbbc8('0xe')](_0xbbc8('0xf'),_0x2e6806,_0xbbc8('0x10'));_0x3a4ba8(_0x539c04[_0xbbc8('0x17')][_0xbbc8('0x16')]);}})[_0xbbc8('0x18')](function(_0x38e776){logger[_0xbbc8('0x14')](_0xbbc8('0xf'),_0x2e6806,_0x38e776);_0x2e7f77(_0x38e776);});});} \ No newline at end of file +var _0x3bb9=['result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','http','request','info','License,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x3bb9,0x17d));var _0x93bb=function(_0x5b4262,_0x1c7016){_0x5b4262=_0x5b4262-0x0;var _0x10f948=_0x3bb9[_0x5b4262];return _0x10f948;};'use strict';var _=require(_0x93bb('0x0'));var util=require(_0x93bb('0x1'));var moment=require(_0x93bb('0x2'));var BPromise=require(_0x93bb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x93bb('0x4'));var db=require(_0x93bb('0x5'))['db'];var utils=require(_0x93bb('0x6'));var logger=require('../../config/logger')(_0x93bb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x93bb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x21607c,_0x2a7855,_0x47c47f){return new BPromise(function(_0x11e862,_0x1901fd){return client[_0x93bb('0x9')](_0x21607c,_0x47c47f)['then'](function(_0x5304b4){logger[_0x93bb('0xa')](_0x93bb('0xb'),_0x2a7855,_0x93bb('0xc'));logger[_0x93bb('0xd')]('License,\x20%s,\x20%s,\x20%s',_0x2a7855,_0x93bb('0xc'),JSON[_0x93bb('0xe')](_0x5304b4));if(_0x5304b4[_0x93bb('0xf')]){if(_0x5304b4[_0x93bb('0xf')][_0x93bb('0x10')]===0x1f4){logger[_0x93bb('0xf')]('License,\x20%s,\x20%s',_0x2a7855,_0x5304b4[_0x93bb('0xf')][_0x93bb('0x11')]);return _0x1901fd(_0x5304b4[_0x93bb('0xf')][_0x93bb('0x11')]);}logger[_0x93bb('0xf')]('License,\x20%s,\x20%s',_0x2a7855,_0x5304b4[_0x93bb('0xf')]['message']);return _0x11e862(_0x5304b4[_0x93bb('0xf')]['message']);}else{logger[_0x93bb('0xa')](_0x93bb('0xb'),_0x2a7855,_0x93bb('0xc'));_0x11e862(_0x5304b4[_0x93bb('0x12')][_0x93bb('0x11')]);}})['catch'](function(_0xc993b4){logger[_0x93bb('0xf')]('License,\x20%s,\x20%s',_0x2a7855,_0xc993b4);_0x1901fd(_0xc993b4);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 56d01b0..74927fd 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 _0xe357=['destroy','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/out_servers','getSmtp','getInteractions','/:id/applications','getApplications','getMessages','/:id/verify','getAgents','post','addAnswer','create','/:id/in_servers','addImap','addSmtp','/:id/interactions','addApplications','/:id/send','send','addAgents','put','delete','removeDispositions','removeAnswers','removeImap','removeSmtp'];(function(_0x268441,_0x1cb6c1){var _0x50f25d=function(_0xce2231){while(--_0xce2231){_0x268441['push'](_0x268441['shift']());}};_0x50f25d(++_0x1cb6c1);}(_0xe357,0x1a2));var _0x7e35=function(_0x271a80,_0x268bac){_0x271a80=_0x271a80-0x0;var _0xf8233e=_0xe357[_0x271a80];return _0xf8233e;};'use strict';var multer=require(_0x7e35('0x0'));var util=require('util');var path=require(_0x7e35('0x1'));var timeout=require(_0x7e35('0x2'));var express=require(_0x7e35('0x3'));var router=express['Router']();var fs_extra=require(_0x7e35('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7e35('0x5'));var config=require(_0x7e35('0x6'));var controller=require(_0x7e35('0x7'));router[_0x7e35('0x8')]('/',auth[_0x7e35('0x9')](),controller[_0x7e35('0xa')]);router[_0x7e35('0x8')](_0x7e35('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x7e35('0xc'),auth[_0x7e35('0x9')](),controller[_0x7e35('0xd')]);router[_0x7e35('0x8')](_0x7e35('0xe'),auth[_0x7e35('0x9')](),controller[_0x7e35('0xf')]);router[_0x7e35('0x8')](_0x7e35('0x10'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x7e35('0x8')]('/:id/in_servers',auth['isAuthenticated'](),controller['getImap']);router[_0x7e35('0x8')](_0x7e35('0x11'),auth[_0x7e35('0x9')](),controller[_0x7e35('0x12')]);router[_0x7e35('0x8')]('/:id/interactions',auth[_0x7e35('0x9')](),controller[_0x7e35('0x13')]);router[_0x7e35('0x8')](_0x7e35('0x14'),auth[_0x7e35('0x9')](),controller[_0x7e35('0x15')]);router[_0x7e35('0x8')]('/:id/messages',auth[_0x7e35('0x9')](),controller[_0x7e35('0x16')]);router['get'](_0x7e35('0x17'),auth[_0x7e35('0x9')](),controller['verifySmtp']);router[_0x7e35('0x8')]('/:id/users',auth[_0x7e35('0x9')](),controller[_0x7e35('0x18')]);router[_0x7e35('0x19')]('/:id/dispositions',auth[_0x7e35('0x9')](),controller['addDisposition']);router[_0x7e35('0x19')](_0x7e35('0x10'),auth[_0x7e35('0x9')](),controller[_0x7e35('0x1a')]);router[_0x7e35('0x19')]('/',auth[_0x7e35('0x9')](),controller[_0x7e35('0x1b')]);router['post'](_0x7e35('0x1c'),auth[_0x7e35('0x9')](),controller[_0x7e35('0x1d')]);router[_0x7e35('0x19')](_0x7e35('0x11'),auth[_0x7e35('0x9')](),controller[_0x7e35('0x1e')]);router['post'](_0x7e35('0x1f'),auth[_0x7e35('0x9')](),controller['addInteraction']);router[_0x7e35('0x19')](_0x7e35('0x14'),auth[_0x7e35('0x9')](),controller[_0x7e35('0x20')]);router[_0x7e35('0x19')](_0x7e35('0x21'),auth['isAuthenticated'](),controller[_0x7e35('0x22')]);router[_0x7e35('0x19')]('/:id/users',auth[_0x7e35('0x9')](),controller[_0x7e35('0x23')]);router[_0x7e35('0x24')](_0x7e35('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x7e35('0x25')](_0x7e35('0xe'),auth[_0x7e35('0x9')](),controller[_0x7e35('0x26')]);router[_0x7e35('0x25')]('/:id/canned_answers',auth[_0x7e35('0x9')](),controller[_0x7e35('0x27')]);router[_0x7e35('0x25')](_0x7e35('0x1c'),auth['isAuthenticated'](),controller[_0x7e35('0x28')]);router[_0x7e35('0x25')]('/:id/out_servers',auth[_0x7e35('0x9')](),controller[_0x7e35('0x29')]);router['delete'](_0x7e35('0xc'),auth[_0x7e35('0x9')](),controller[_0x7e35('0x2a')]);router['delete'](_0x7e35('0x2b'),auth[_0x7e35('0x9')](),controller[_0x7e35('0x2c')]);module[_0x7e35('0x2d')]=router; \ No newline at end of file +var _0x5cef=['/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','addDisposition','post','create','addImap','addSmtp','addInteraction','/:id/send','send','put','update','delete','removeImap','exports','multer','path','express','Router','fs-extra','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications'];(function(_0x447809,_0x1530cd){var _0x557e01=function(_0x5e38d0){while(--_0x5e38d0){_0x447809['push'](_0x447809['shift']());}};_0x557e01(++_0x1530cd);}(_0x5cef,0x1c1));var _0xf5ce=function(_0x4ce32f,_0x296fac){_0x4ce32f=_0x4ce32f-0x0;var _0xd1431b=_0x5cef[_0x4ce32f];return _0xd1431b;};'use strict';var multer=require(_0xf5ce('0x0'));var util=require('util');var path=require(_0xf5ce('0x1'));var timeout=require('connect-timeout');var express=require(_0xf5ce('0x2'));var router=express[_0xf5ce('0x3')]();var fs_extra=require(_0xf5ce('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf5ce('0x5'));var controller=require(_0xf5ce('0x6'));router[_0xf5ce('0x7')]('/',auth[_0xf5ce('0x8')](),controller[_0xf5ce('0x9')]);router[_0xf5ce('0x7')](_0xf5ce('0xa'),auth[_0xf5ce('0x8')](),controller[_0xf5ce('0xb')]);router['get'](_0xf5ce('0xc'),auth[_0xf5ce('0x8')](),controller['show']);router[_0xf5ce('0x7')](_0xf5ce('0xd'),auth[_0xf5ce('0x8')](),controller[_0xf5ce('0xe')]);router[_0xf5ce('0x7')](_0xf5ce('0xf'),auth['isAuthenticated'](),controller[_0xf5ce('0x10')]);router[_0xf5ce('0x7')](_0xf5ce('0x11'),auth['isAuthenticated'](),controller['getImap']);router[_0xf5ce('0x7')](_0xf5ce('0x12'),auth[_0xf5ce('0x8')](),controller[_0xf5ce('0x13')]);router['get'](_0xf5ce('0x14'),auth['isAuthenticated'](),controller[_0xf5ce('0x15')]);router[_0xf5ce('0x7')](_0xf5ce('0x16'),auth[_0xf5ce('0x8')](),controller[_0xf5ce('0x17')]);router['get'](_0xf5ce('0x18'),auth['isAuthenticated'](),controller[_0xf5ce('0x19')]);router[_0xf5ce('0x7')](_0xf5ce('0x1a'),auth['isAuthenticated'](),controller[_0xf5ce('0x1b')]);router['get'](_0xf5ce('0x1c'),auth['isAuthenticated'](),controller[_0xf5ce('0x1d')]);router['post'](_0xf5ce('0xd'),auth[_0xf5ce('0x8')](),controller[_0xf5ce('0x1e')]);router[_0xf5ce('0x1f')](_0xf5ce('0xf'),auth[_0xf5ce('0x8')](),controller['addAnswer']);router[_0xf5ce('0x1f')]('/',auth['isAuthenticated'](),controller[_0xf5ce('0x20')]);router['post'](_0xf5ce('0x11'),auth['isAuthenticated'](),controller[_0xf5ce('0x21')]);router[_0xf5ce('0x1f')](_0xf5ce('0x12'),auth[_0xf5ce('0x8')](),controller[_0xf5ce('0x22')]);router[_0xf5ce('0x1f')](_0xf5ce('0x14'),auth['isAuthenticated'](),controller[_0xf5ce('0x23')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router['post'](_0xf5ce('0x24'),auth[_0xf5ce('0x8')](),controller[_0xf5ce('0x25')]);router[_0xf5ce('0x1f')](_0xf5ce('0x1c'),auth['isAuthenticated'](),controller['addAgents']);router[_0xf5ce('0x26')]('/:id',auth[_0xf5ce('0x8')](),controller[_0xf5ce('0x27')]);router[_0xf5ce('0x28')](_0xf5ce('0xd'),auth[_0xf5ce('0x8')](),controller['removeDispositions']);router[_0xf5ce('0x28')](_0xf5ce('0xf'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0xf5ce('0x28')](_0xf5ce('0x11'),auth[_0xf5ce('0x8')](),controller[_0xf5ce('0x29')]);router[_0xf5ce('0x28')](_0xf5ce('0x12'),auth['isAuthenticated'](),controller['removeSmtp']);router['delete'](_0xf5ce('0xc'),auth[_0xf5ce('0x8')](),controller['destroy']);router[_0xf5ce('0x28')](_0xf5ce('0x1c'),auth[_0xf5ce('0x8')](),controller['removeAgents']);module[_0xf5ce('0x2a')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 2ed20e5..c677909 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 _0x5577=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','STRING','BOOLEAN','TEXT','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(_0x487496,_0x249683){var _0x539dc8=function(_0x2c38e1){while(--_0x2c38e1){_0x487496['push'](_0x487496['shift']());}};_0x539dc8(++_0x249683);}(_0x5577,0x1b4));var _0x7557=function(_0x48daab,_0x460ed0){_0x48daab=_0x48daab-0x0;var _0x1dda11=_0x5577[_0x48daab];return _0x1dda11;};'use strict';var Sequelize=require(_0x7557('0x0'));module['exports']={'description':{'type':Sequelize[_0x7557('0x1')]},'name':{'type':Sequelize[_0x7557('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x7557('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x7557('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x7557('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x7557('0x3')]},'markAsUnread':{'type':Sequelize[_0x7557('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x7557('0x1')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x7557('0x4')](0x2)[_0x7557('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x7557('0x3')],'defaultValue':function(){return _0x7557('0x6');}},'notificationSound':{'type':Sequelize[_0x7557('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7557('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7557('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7557('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7557('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7557('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7557('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7557('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x7557('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x7557('0x2')],'defaultValue':![],'comment':_0x7557('0x8'),'set':function(_0x5b6d12){if(!_0x5b6d12)this['setDataValue'](_0x7557('0x9'),null);this[_0x7557('0xa')](_0x7557('0xb'),_0x5b6d12);}}}; \ No newline at end of file +var _0x9221=['exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x58fb5a,_0x4b6a97){var _0x11ecf0=function(_0x475407){while(--_0x475407){_0x58fb5a['push'](_0x58fb5a['shift']());}};_0x11ecf0(++_0x4b6a97);}(_0x9221,0x64));var _0x1922=function(_0x1ea5e2,_0x382cec){_0x1ea5e2=_0x1ea5e2-0x0;var _0x39380c=_0x9221[_0x1ea5e2];return _0x39380c;};'use strict';var Sequelize=require('sequelize');module[_0x1922('0x0')]={'description':{'type':Sequelize[_0x1922('0x1')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x1922('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x1922('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x1922('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x1922('0x3')]},'markAsUnread':{'type':Sequelize[_0x1922('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x1922('0x1')],'allowNull':![],'defaultValue':_0x1922('0x4')},'fontSize':{'type':Sequelize[_0x1922('0x5')](0x2)[_0x1922('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x1922('0x7');}},'notificationSound':{'type':Sequelize[_0x1922('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1922('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1922('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1922('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1922('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1922('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x1922('0x2')],'defaultValue':![],'comment':_0x1922('0x8'),'set':function(_0x5c488f){if(!_0x5c488f)this[_0x1922('0x9')]('mandatoryDispositionPauseId',null);this[_0x1922('0x9')]('mandatoryDisposition',_0x5c488f);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 7bc3b84..52ad68a 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 _0x4f68=['finally','send','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','true','CmList','List','Contacts','%s\x20<%s>','email','attachments','join','server/files/attachments','basename','service','auth','secure','SendMail','sendMail','List\x20not\x20found','CmContact','messageId','from','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','omit','spread','emit','removeAgents','isArray','userMailAccount:remove','getAgents','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./mailAccount.socket','register','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','destroy','get','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','catch','show','params','MailServerIn','Imap','MailServerOut','Smtp','includeAll','find','update','body','describe','addDisposition','Disposition','create','getDispositions','findOne','MailAccountId','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rows','removeAnswers','ListId','isNil','active','description','cauthentication','user','cuser','pass','authentication','host','port','cservice','password','Unable\x20to\x20retrieve\x20the\x20current\x20user','MailAccounts','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','setImap','getSmtp','addSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','Contact','User','Owner','internal','Tag','Tags','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','MailApplication','bulkCreate','priority'];(function(_0x576b33,_0x2115ea){var _0x46834d=function(_0x38c45a){while(--_0x38c45a){_0x576b33['push'](_0x576b33['shift']());}};_0x46834d(++_0x2115ea);}(_0x4f68,0x1b8));var _0x84f6=function(_0x16e74f,_0x571f41){_0x16e74f=_0x16e74f-0x0;var _0x2a6aed=_0x4f68[_0x16e74f];return _0x2a6aed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x84f6('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x84f6('0x1'));var moment=require(_0x84f6('0x2'));var BPromise=require(_0x84f6('0x3'));var Mustache=require(_0x84f6('0x4'));var util=require(_0x84f6('0x5'));var path=require(_0x84f6('0x6'));var sox=require(_0x84f6('0x7'));var csv=require(_0x84f6('0x8'));var ejs=require(_0x84f6('0x9'));var fs=require('fs');var fs_extra=require(_0x84f6('0xa'));var _=require(_0x84f6('0xb'));var squel=require(_0x84f6('0xc'));var crypto=require(_0x84f6('0xd'));var jsforce=require(_0x84f6('0xe'));var deskjs=require(_0x84f6('0xf'));var toCsv=require(_0x84f6('0x8'));var querystring=require('querystring');var Papa=require(_0x84f6('0x10'));var htmlToText=require(_0x84f6('0x11'));var juice=require('juice');var Redis=require(_0x84f6('0x12'));var authService=require(_0x84f6('0x13'));var qs=require(_0x84f6('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x84f6('0x15'));var logger=require(_0x84f6('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x84f6('0x17'));var licenseUtil=require(_0x84f6('0x18'));var db=require(_0x84f6('0x19'))['db'];config['redis']=_[_0x84f6('0x1a')](config['redis'],{'host':_0x84f6('0x1b'),'port':0x18eb});var socket=require(_0x84f6('0x1c'))(new Redis(config[_0x84f6('0x1d')]));require(_0x84f6('0x1e'))[_0x84f6('0x1f')](socket);var jayson=require(_0x84f6('0x20'));var client=jayson['client'][_0x84f6('0x21')]({'port':0x232b});function respondWithRpcPromise(_0x5b86af,_0x20ec2f,_0x2b9014,_0x13c3c0){return new BPromise(function(_0xc0ce1,_0x2fdea5){var _0x3a2c3f=_0x13c3c0||client;return _0x3a2c3f[_0x84f6('0x22')](_0x5b86af,_0x2b9014)[_0x84f6('0x23')](function(_0x3a5ef0){logger[_0x84f6('0x24')]('MailAccount,\x20%s,\x20%s',_0x20ec2f,_0x84f6('0x25'));logger[_0x84f6('0x26')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x20ec2f,_0x84f6('0x25'),JSON[_0x84f6('0x27')](_0x3a5ef0));if(_0x3a5ef0[_0x84f6('0x28')]){if(_0x3a5ef0[_0x84f6('0x28')][_0x84f6('0x29')]===0x1f4){logger['error'](_0x84f6('0x2a'),_0x20ec2f,_0x3a5ef0[_0x84f6('0x28')][_0x84f6('0x2b')]);return _0x2fdea5(_0x3a5ef0['error']['message']);}logger[_0x84f6('0x28')](_0x84f6('0x2a'),_0x20ec2f,_0x3a5ef0[_0x84f6('0x28')][_0x84f6('0x2b')]);return _0xc0ce1(_0x3a5ef0[_0x84f6('0x28')][_0x84f6('0x2b')]);}else{logger[_0x84f6('0x24')](_0x84f6('0x2a'),_0x20ec2f,_0x84f6('0x25'));_0xc0ce1(_0x3a5ef0[_0x84f6('0x2c')][_0x84f6('0x2b')]);}})['catch'](function(_0x38abd3){logger[_0x84f6('0x28')](_0x84f6('0x2a'),_0x20ec2f,_0x38abd3);_0x2fdea5(_0x38abd3);});});}function respondWithStatusCode(_0x483b24,_0x3cb734){_0x3cb734=_0x3cb734||0xcc;return function(_0x71db6b){if(_0x71db6b){return _0x483b24[_0x84f6('0x2d')](_0x3cb734);}return _0x483b24[_0x84f6('0x2e')](_0x3cb734)[_0x84f6('0x2f')]();};}function respondWithResult(_0xe899c5,_0x4eede7){_0x4eede7=_0x4eede7||0xc8;return function(_0x3bf05d){if(_0x3bf05d){return _0xe899c5['status'](_0x4eede7)['json'](_0x3bf05d);}};}function respondWithFilteredResult(_0x29878b,_0x3ae363){return function(_0x4ccd3a){if(_0x4ccd3a){var _0x2a012a=typeof _0x3ae363[_0x84f6('0x30')]===_0x84f6('0x31')&&typeof _0x3ae363[_0x84f6('0x32')]===_0x84f6('0x31');var _0x329676=_0x4ccd3a['count'];var _0x3100ce=_0x2a012a?0x0:_0x3ae363[_0x84f6('0x30')];var _0x4c82a7=_0x2a012a?_0x4ccd3a[_0x84f6('0x33')]:_0x3ae363[_0x84f6('0x30')]+_0x3ae363['limit'];var _0x25fee5;if(_0x4c82a7>=_0x329676){_0x4c82a7=_0x329676;_0x25fee5=0xc8;}else{_0x25fee5=0xce;}_0x29878b[_0x84f6('0x2e')](_0x25fee5);return _0x29878b['set'](_0x84f6('0x34'),_0x3100ce+'-'+_0x4c82a7+'/'+_0x329676)[_0x84f6('0x35')](_0x4ccd3a);}return null;};}function patchUpdates(_0x42f244){return function(_0x5f24fc){try{jsonpatch[_0x84f6('0x36')](_0x5f24fc,_0x42f244,!![]);}catch(_0xbc51ad){return BPromise[_0x84f6('0x37')](_0xbc51ad);}return _0x5f24fc[_0x84f6('0x38')]();};}function saveUpdates(_0x511abc,_0x431eeb){return function(_0x5d7bfe){if(_0x5d7bfe){return _0x5d7bfe['update'](_0x511abc)[_0x84f6('0x23')](function(_0xdb647c){return _0xdb647c;});}return null;};}function removeEntity(_0x90e3fa,_0x278565){return function(_0x176717){if(_0x176717){return _0x176717[_0x84f6('0x39')]()[_0x84f6('0x23')](function(){var _0x277d28=_0x176717[_0x84f6('0x3a')]({'plain':!![]});var _0x1a3170='MailAccounts';return db[_0x84f6('0x3b')][_0x84f6('0x39')]({'where':{'type':_0x1a3170,'resourceId':_0x277d28['id']}})[_0x84f6('0x23')](function(){return _0x176717;});})['then'](function(){_0x90e3fa[_0x84f6('0x2e')](0xcc)[_0x84f6('0x2f')]();});}};}function handleEntityNotFound(_0x14fbd0,_0x4befb0){return function(_0xe0ab3f){if(!_0xe0ab3f){_0x14fbd0[_0x84f6('0x2d')](0x194);}return _0xe0ab3f;};}function handleError(_0x459dca,_0x1b6359){_0x1b6359=_0x1b6359||0x1f4;return function(_0x4e5064){logger[_0x84f6('0x28')](_0x4e5064[_0x84f6('0x3c')]);if(_0x4e5064['name']){delete _0x4e5064[_0x84f6('0x3d')];}_0x459dca[_0x84f6('0x2e')](_0x1b6359)['send'](_0x4e5064);};}exports[_0x84f6('0x3e')]=function(_0x2224e0,_0x3179bb){var _0x450482={'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x84f6('0x3f')],'as':_0x84f6('0x40')}]},_0x4a1e7c={},_0x5eb108={'count':0x0,'rows':[]};var _0x1a57b4=_[_0x84f6('0x41')](db[_0x84f6('0x42')][_0x84f6('0x43')],function(_0x3c31d9){return{'name':_0x3c31d9[_0x84f6('0x44')],'type':_0x3c31d9[_0x84f6('0x45')]['key']};});_0x4a1e7c[_0x84f6('0x46')]=_[_0x84f6('0x41')](_0x1a57b4,_0x84f6('0x3d'));_0x4a1e7c[_0x84f6('0x47')]=_[_0x84f6('0x48')](_0x2224e0[_0x84f6('0x47')]);_0x4a1e7c[_0x84f6('0x49')]=_['intersection'](_0x4a1e7c[_0x84f6('0x46')],_0x4a1e7c['query']);_0x450482[_0x84f6('0x4a')]=_[_0x84f6('0x4b')](_0x4a1e7c['model'],qs[_0x84f6('0x4c')](_0x2224e0[_0x84f6('0x47')][_0x84f6('0x4c')]));_0x450482['attributes']=_0x450482['attributes'][_0x84f6('0x4d')]?_0x450482[_0x84f6('0x4a')]:_0x4a1e7c[_0x84f6('0x46')];if(!_0x2224e0[_0x84f6('0x47')][_0x84f6('0x4e')](_0x84f6('0x4f'))){_0x450482[_0x84f6('0x32')]=qs['limit'](_0x2224e0[_0x84f6('0x47')][_0x84f6('0x32')]);_0x450482['offset']=qs[_0x84f6('0x30')](_0x2224e0['query'][_0x84f6('0x30')]);}_0x450482[_0x84f6('0x50')]=qs['sort'](_0x2224e0[_0x84f6('0x47')][_0x84f6('0x51')]);_0x450482[_0x84f6('0x52')]=qs[_0x84f6('0x49')](_[_0x84f6('0x53')](_0x2224e0['query'],_0x4a1e7c[_0x84f6('0x49')]),_0x1a57b4);if(_0x2224e0[_0x84f6('0x47')][_0x84f6('0x54')]){_0x450482[_0x84f6('0x52')]=_[_0x84f6('0x55')](_0x450482[_0x84f6('0x52')],{'$or':_[_0x84f6('0x41')](_0x1a57b4,function(_0x259e59){if(_0x259e59[_0x84f6('0x45')]!==_0x84f6('0x56')){var _0x4a946a={};_0x4a946a[_0x259e59[_0x84f6('0x3d')]]={'$like':'%'+_0x2224e0[_0x84f6('0x47')]['filter']+'%'};return _0x4a946a;}})});}_0x450482=_[_0x84f6('0x55')]({},_0x450482,_0x2224e0[_0x84f6('0x57')]);var _0x43faaa={'where':_0x450482[_0x84f6('0x52')]};return db['MailAccount'][_0x84f6('0x33')](_0x43faaa)[_0x84f6('0x23')](function(_0x5cb46a){_0x5eb108['count']=_0x5cb46a;if(_0x2224e0[_0x84f6('0x47')]['includeAll']){_0x450482['include']=[{'all':!![]}];}return db[_0x84f6('0x42')][_0x84f6('0x58')](_0x450482);})[_0x84f6('0x23')](function(_0x4b32ac){_0x5eb108['rows']=_0x4b32ac;return _0x5eb108;})[_0x84f6('0x23')](respondWithFilteredResult(_0x3179bb,_0x450482))[_0x84f6('0x59')](handleError(_0x3179bb,null));};exports[_0x84f6('0x5a')]=function(_0x451e2f,_0x4f1a00){var _0x3ff4be={'raw':![],'where':{'id':_0x451e2f[_0x84f6('0x5b')]['id']},'include':[{'model':db[_0x84f6('0x5c')],'as':_0x84f6('0x5d')},{'model':db[_0x84f6('0x5e')],'as':_0x84f6('0x5f')},{'model':db[_0x84f6('0x3f')],'as':'mandatoryDispositionPause'}]},_0x287f88={};_0x287f88[_0x84f6('0x46')]=_['keys'](db[_0x84f6('0x42')][_0x84f6('0x43')]);_0x287f88['query']=_[_0x84f6('0x48')](_0x451e2f[_0x84f6('0x47')]);_0x287f88[_0x84f6('0x49')]=_[_0x84f6('0x4b')](_0x287f88[_0x84f6('0x46')],_0x287f88[_0x84f6('0x47')]);_0x3ff4be['attributes']=_['intersection'](_0x287f88[_0x84f6('0x46')],qs['fields'](_0x451e2f[_0x84f6('0x47')]['fields']));_0x3ff4be[_0x84f6('0x4a')]=_0x3ff4be[_0x84f6('0x4a')][_0x84f6('0x4d')]?_0x3ff4be[_0x84f6('0x4a')]:_0x287f88[_0x84f6('0x46')];if(_0x451e2f[_0x84f6('0x47')][_0x84f6('0x60')]){_0x3ff4be['include']=[{'all':!![]}];}_0x3ff4be=_[_0x84f6('0x55')]({},_0x3ff4be,_0x451e2f['options']);return db['MailAccount'][_0x84f6('0x61')](_0x3ff4be)[_0x84f6('0x23')](handleEntityNotFound(_0x4f1a00,null))[_0x84f6('0x23')](respondWithResult(_0x4f1a00,null))[_0x84f6('0x59')](handleError(_0x4f1a00,null));};exports[_0x84f6('0x62')]=function(_0xd42873,_0x423963){if(_0xd42873[_0x84f6('0x63')]['id']){delete _0xd42873[_0x84f6('0x63')]['id'];}return db['MailAccount'][_0x84f6('0x61')]({'where':{'id':_0xd42873[_0x84f6('0x5b')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x84f6('0x5d')},{'model':db[_0x84f6('0x5e')],'as':_0x84f6('0x5f')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x84f6('0x23')](handleEntityNotFound(_0x423963,null))[_0x84f6('0x23')](saveUpdates(_0xd42873['body'],null))[_0x84f6('0x23')](function(_0x24e7fe){if(_0x24e7fe&&_0xd42873[_0x84f6('0x63')]['Imap']){return db['MailServerIn'][_0x84f6('0x62')](_0xd42873[_0x84f6('0x63')]['Imap'],{'where':{'MailAccountId':_0x24e7fe['id']}})['then'](function(){return _0x24e7fe;});}return _0x24e7fe;})[_0x84f6('0x23')](function(_0x87835c){if(_0x87835c&&_0xd42873[_0x84f6('0x63')]['Smtp']){return db[_0x84f6('0x5e')][_0x84f6('0x62')](_0xd42873[_0x84f6('0x63')][_0x84f6('0x5f')],{'where':{'MailAccountId':_0x87835c['id']}})[_0x84f6('0x23')](function(){return _0x87835c;});}return _0x87835c;})[_0x84f6('0x23')](respondWithResult(_0x423963,null))[_0x84f6('0x59')](handleError(_0x423963,null));};exports[_0x84f6('0x64')]=function(_0x22b5f8,_0x27ab18){return db['MailAccount'][_0x84f6('0x64')]()[_0x84f6('0x23')](respondWithResult(_0x27ab18,null))[_0x84f6('0x59')](handleError(_0x27ab18,null));};exports[_0x84f6('0x65')]=function(_0x2bc3e0,_0x11544e,_0x11f9d3){if(_0x2bc3e0[_0x84f6('0x63')]['id']){delete _0x2bc3e0['body']['id'];}return db[_0x84f6('0x42')][_0x84f6('0x61')]({'where':{'id':_0x2bc3e0['params']['id']}})[_0x84f6('0x23')](handleEntityNotFound(_0x11544e,null))[_0x84f6('0x23')](function(_0x229d4f){if(_0x229d4f){_0x2bc3e0[_0x84f6('0x63')]['MailAccountId']=_0x229d4f['id'];return db[_0x84f6('0x66')][_0x84f6('0x67')](_0x2bc3e0[_0x84f6('0x63')]);}})[_0x84f6('0x23')](respondWithResult(_0x11544e,null))[_0x84f6('0x59')](handleError(_0x11544e,null));};exports[_0x84f6('0x68')]=function(_0x2a9bf6,_0x1c9703,_0x261cae){var _0x2661a0={'raw':![],'where':{}};var _0x1fcd07={};var _0x5d51ff={'count':0x0,'rows':[]};return db[_0x84f6('0x42')][_0x84f6('0x69')]({'where':{'id':_0x2a9bf6[_0x84f6('0x5b')]['id']}})[_0x84f6('0x23')](handleEntityNotFound(_0x1c9703,null))[_0x84f6('0x23')](function(_0x129915){if(_0x129915){_0x1fcd07[_0x84f6('0x46')]=_[_0x84f6('0x48')](db['Disposition'][_0x84f6('0x43')]);_0x1fcd07[_0x84f6('0x47')]=_[_0x84f6('0x48')](_0x2a9bf6[_0x84f6('0x47')]);_0x1fcd07['filters']=_['intersection'](_0x1fcd07[_0x84f6('0x46')],_0x1fcd07['query']);_0x2661a0['attributes']=_['intersection'](_0x1fcd07[_0x84f6('0x46')],qs['fields'](_0x2a9bf6['query']['fields']));_0x2661a0[_0x84f6('0x4a')]=_0x2661a0['attributes'][_0x84f6('0x4d')]?_0x2661a0[_0x84f6('0x4a')]:_0x1fcd07[_0x84f6('0x46')];if(!_0x2a9bf6['query'][_0x84f6('0x4e')](_0x84f6('0x4f'))){_0x2661a0[_0x84f6('0x32')]=qs['limit'](_0x2a9bf6[_0x84f6('0x47')]['limit']);_0x2661a0[_0x84f6('0x30')]=qs[_0x84f6('0x30')](_0x2a9bf6['query'][_0x84f6('0x30')]);}_0x2661a0[_0x84f6('0x50')]=qs['sort'](_0x2a9bf6[_0x84f6('0x47')][_0x84f6('0x51')]);_0x2661a0[_0x84f6('0x52')]=qs[_0x84f6('0x49')](_['pick'](_0x2a9bf6[_0x84f6('0x47')],_0x1fcd07['filters']));_0x2661a0[_0x84f6('0x52')][_0x84f6('0x6a')]=_0x129915['id'];if(_0x2a9bf6['query'][_0x84f6('0x54')]){_0x2661a0['where']=_['merge'](_0x2661a0[_0x84f6('0x52')],{'$or':_[_0x84f6('0x41')](_0x2661a0[_0x84f6('0x4a')],function(_0x536d12){var _0x53056d={};_0x53056d[_0x536d12]={'$like':'%'+_0x2a9bf6['query'][_0x84f6('0x54')]+'%'};return _0x53056d;})});}_0x2661a0=_[_0x84f6('0x55')]({},_0x2661a0,_0x2a9bf6[_0x84f6('0x57')]);return db[_0x84f6('0x66')][_0x84f6('0x33')]({'where':_0x2661a0['where']})[_0x84f6('0x23')](function(_0x115b43){_0x5d51ff[_0x84f6('0x33')]=_0x115b43;if(_0x2a9bf6['query'][_0x84f6('0x60')]){_0x2661a0[_0x84f6('0x6b')]=[{'all':!![]}];}return db[_0x84f6('0x66')][_0x84f6('0x58')](_0x2661a0);})['then'](function(_0x386ab6){_0x5d51ff['rows']=_0x386ab6;return _0x5d51ff;});}})[_0x84f6('0x23')](respondWithFilteredResult(_0x1c9703,_0x2661a0))['catch'](handleError(_0x1c9703,null));};exports[_0x84f6('0x6c')]=function(_0x47d232,_0x5efede,_0x2e5f7a){return db[_0x84f6('0x42')][_0x84f6('0x61')]({'where':{'id':_0x47d232[_0x84f6('0x5b')]['id']}})[_0x84f6('0x23')](handleEntityNotFound(_0x5efede,null))['then'](function(_0x13d5fb){if(_0x13d5fb){return _0x13d5fb[_0x84f6('0x6c')](_0x47d232[_0x84f6('0x47')][_0x84f6('0x6d')]);}})[_0x84f6('0x23')](respondWithStatusCode(_0x5efede,null))[_0x84f6('0x59')](handleError(_0x5efede,null));};exports[_0x84f6('0x6e')]=function(_0x25f66b,_0x24b3c6,_0x11a2d9){if(_0x25f66b[_0x84f6('0x63')]['id']){delete _0x25f66b['body']['id'];}return db[_0x84f6('0x42')][_0x84f6('0x61')]({'where':{'id':_0x25f66b['params']['id']}})[_0x84f6('0x23')](handleEntityNotFound(_0x24b3c6,null))['then'](function(_0x5178bd){if(_0x5178bd){_0x25f66b[_0x84f6('0x63')]['MailAccountId']=_0x5178bd['id'];return db[_0x84f6('0x6f')]['create'](_0x25f66b[_0x84f6('0x63')]);}})[_0x84f6('0x23')](respondWithResult(_0x24b3c6,null))[_0x84f6('0x59')](handleError(_0x24b3c6,null));};exports[_0x84f6('0x70')]=function(_0xa0bcf5,_0x77fa2c,_0x4b25cd){var _0xbaa99e={'raw':![],'where':{}};var _0x145c7c={};var _0x563bd2={'count':0x0,'rows':[]};return db[_0x84f6('0x42')][_0x84f6('0x69')]({'where':{'id':_0xa0bcf5[_0x84f6('0x5b')]['id']}})['then'](handleEntityNotFound(_0x77fa2c,null))[_0x84f6('0x23')](function(_0x3d617f){if(_0x3d617f){_0x145c7c[_0x84f6('0x46')]=_['keys'](db[_0x84f6('0x6f')][_0x84f6('0x43')]);_0x145c7c[_0x84f6('0x47')]=_[_0x84f6('0x48')](_0xa0bcf5[_0x84f6('0x47')]);_0x145c7c[_0x84f6('0x49')]=_['intersection'](_0x145c7c[_0x84f6('0x46')],_0x145c7c[_0x84f6('0x47')]);_0xbaa99e[_0x84f6('0x4a')]=_[_0x84f6('0x4b')](_0x145c7c['model'],qs[_0x84f6('0x4c')](_0xa0bcf5[_0x84f6('0x47')][_0x84f6('0x4c')]));_0xbaa99e[_0x84f6('0x4a')]=_0xbaa99e[_0x84f6('0x4a')][_0x84f6('0x4d')]?_0xbaa99e[_0x84f6('0x4a')]:_0x145c7c[_0x84f6('0x46')];if(!_0xa0bcf5[_0x84f6('0x47')][_0x84f6('0x4e')](_0x84f6('0x4f'))){_0xbaa99e[_0x84f6('0x32')]=qs['limit'](_0xa0bcf5[_0x84f6('0x47')][_0x84f6('0x32')]);_0xbaa99e['offset']=qs[_0x84f6('0x30')](_0xa0bcf5[_0x84f6('0x47')][_0x84f6('0x30')]);}_0xbaa99e[_0x84f6('0x50')]=qs[_0x84f6('0x51')](_0xa0bcf5['query']['sort']);_0xbaa99e[_0x84f6('0x52')]=qs['filters'](_['pick'](_0xa0bcf5[_0x84f6('0x47')],_0x145c7c[_0x84f6('0x49')]));_0xbaa99e[_0x84f6('0x52')][_0x84f6('0x6a')]=_0x3d617f['id'];if(_0xa0bcf5[_0x84f6('0x47')]['filter']){_0xbaa99e[_0x84f6('0x52')]=_[_0x84f6('0x55')](_0xbaa99e[_0x84f6('0x52')],{'$or':_[_0x84f6('0x41')](_0xbaa99e[_0x84f6('0x4a')],function(_0x21a9ce){var _0x5c65e5={};_0x5c65e5[_0x21a9ce]={'$like':'%'+_0xa0bcf5[_0x84f6('0x47')][_0x84f6('0x54')]+'%'};return _0x5c65e5;})});}_0xbaa99e=_[_0x84f6('0x55')]({},_0xbaa99e,_0xa0bcf5[_0x84f6('0x57')]);return db['CannedAnswer'][_0x84f6('0x33')]({'where':_0xbaa99e[_0x84f6('0x52')]})[_0x84f6('0x23')](function(_0x35ae92){_0x563bd2[_0x84f6('0x33')]=_0x35ae92;if(_0xa0bcf5[_0x84f6('0x47')]['includeAll']){_0xbaa99e[_0x84f6('0x6b')]=[{'all':!![]}];}return db[_0x84f6('0x6f')][_0x84f6('0x58')](_0xbaa99e);})[_0x84f6('0x23')](function(_0x5c88da){_0x563bd2[_0x84f6('0x71')]=_0x5c88da;return _0x563bd2;});}})[_0x84f6('0x23')](respondWithFilteredResult(_0x77fa2c,_0xbaa99e))[_0x84f6('0x59')](handleError(_0x77fa2c,null));};exports['removeAnswers']=function(_0x1644b4,_0x914b9c,_0xd111f5){return db['MailAccount']['find']({'where':{'id':_0x1644b4[_0x84f6('0x5b')]['id']}})[_0x84f6('0x23')](handleEntityNotFound(_0x914b9c,null))[_0x84f6('0x23')](function(_0x13656a){if(_0x13656a){return _0x13656a[_0x84f6('0x72')](_0x1644b4[_0x84f6('0x47')][_0x84f6('0x6d')]);}})[_0x84f6('0x23')](respondWithStatusCode(_0x914b9c,null))['catch'](handleError(_0x914b9c,null));};exports[_0x84f6('0x67')]=function(_0x3f14ef,_0x2fad69){var _0x25956a={'name':_0x3f14ef['body']['name'],'key':_0x3f14ef[_0x84f6('0x63')]['key'],'email':_0x3f14ef[_0x84f6('0x63')]['email'],'ListId':_0x3f14ef[_0x84f6('0x63')][_0x84f6('0x73')],'active':!_[_0x84f6('0x74')](_0x3f14ef[_0x84f6('0x63')][_0x84f6('0x75')])?_0x3f14ef[_0x84f6('0x63')][_0x84f6('0x75')]:!![],'description':_0x3f14ef[_0x84f6('0x63')][_0x84f6('0x76')]||null,'Imap':{},'Smtp':{}};if(_[_0x84f6('0x74')](_0x3f14ef[_0x84f6('0x63')]['cservice'])){if(_0x3f14ef[_0x84f6('0x63')][_0x84f6('0x77')]){_0x25956a[_0x84f6('0x5d')][_0x84f6('0x78')]=_0x25956a[_0x84f6('0x5f')]['user']=_0x3f14ef['body'][_0x84f6('0x79')];_0x25956a[_0x84f6('0x5d')]['password']=_0x25956a[_0x84f6('0x5f')][_0x84f6('0x7a')]=_0x3f14ef['body']['cpassword'];}else{_0x25956a[_0x84f6('0x5d')]['authentication']=_0x25956a[_0x84f6('0x5f')][_0x84f6('0x7b')]=![];}_0x25956a[_0x84f6('0x5d')][_0x84f6('0x7c')]=_0x3f14ef[_0x84f6('0x63')][_0x84f6('0x5d')][_0x84f6('0x7c')];_0x25956a[_0x84f6('0x5d')][_0x84f6('0x7d')]=_0x3f14ef[_0x84f6('0x63')][_0x84f6('0x5d')][_0x84f6('0x7d')];_0x25956a[_0x84f6('0x5f')][_0x84f6('0x7c')]=_0x3f14ef['body'][_0x84f6('0x5f')][_0x84f6('0x7c')];_0x25956a[_0x84f6('0x5f')][_0x84f6('0x7d')]=_0x3f14ef[_0x84f6('0x63')][_0x84f6('0x5f')][_0x84f6('0x7d')];}else{_0x25956a['Imap']['service']=_0x25956a[_0x84f6('0x5f')]['service']=_0x3f14ef[_0x84f6('0x63')][_0x84f6('0x7e')];_0x25956a['Imap'][_0x84f6('0x78')]=_0x25956a['Smtp'][_0x84f6('0x78')]=_0x3f14ef['body'][_0x84f6('0x79')];_0x25956a[_0x84f6('0x5d')][_0x84f6('0x7f')]=_0x25956a[_0x84f6('0x5f')][_0x84f6('0x7a')]=_0x3f14ef[_0x84f6('0x63')]['cpassword'];}return db[_0x84f6('0x42')][_0x84f6('0x67')](_0x25956a,{'include':[{'model':db['MailServerOut'],'as':_0x84f6('0x5f')},{'model':db[_0x84f6('0x5c')],'as':'Imap'}]})[_0x84f6('0x23')](function(_0x3081a0){var _0x9f1704=_0x3f14ef[_0x84f6('0x78')][_0x84f6('0x3a')]({'plain':!![]});if(!_0x9f1704)throw new Error(_0x84f6('0x80'));if(_0x9f1704['role']===_0x84f6('0x78')){var _0x5c2035=_0x3081a0[_0x84f6('0x3a')]({'plain':!![]});return db['UserProfileSection'][_0x84f6('0x61')]({'where':{'name':_0x84f6('0x81'),'userProfileId':_0x9f1704[_0x84f6('0x82')]},'raw':!![]})[_0x84f6('0x23')](function(_0x586b08){if(_0x586b08&&_0x586b08['autoAssociation']===0x0){return db[_0x84f6('0x3b')][_0x84f6('0x67')]({'name':_0x5c2035['name'],'resourceId':_0x5c2035['id'],'type':_0x586b08[_0x84f6('0x3d')],'sectionId':_0x586b08['id']},{})[_0x84f6('0x23')](function(){return _0x3081a0;});}else{return _0x3081a0;}})[_0x84f6('0x59')](function(_0x5cf716){logger['error'](_0x84f6('0x83'),_0x5cf716);throw _0x5cf716;});}return _0x3081a0;})['then'](respondWithResult(_0x2fad69,0xc9))[_0x84f6('0x59')](handleError(_0x2fad69,null));};exports[_0x84f6('0x84')]=function(_0x2a1a45,_0x481f8d,_0x1c474e){return db['MailAccount'][_0x84f6('0x69')]({'where':{'id':_0x2a1a45[_0x84f6('0x5b')]['id']}})[_0x84f6('0x23')](handleEntityNotFound(_0x481f8d,null))[_0x84f6('0x23')](function(_0x5155d0){if(_0x5155d0){return _0x5155d0['getImap']();}return null;})[_0x84f6('0x23')](respondWithResult(_0x481f8d,null))[_0x84f6('0x59')](handleError(_0x481f8d,null));};exports['addImap']=function(_0xcbf78f,_0x13eff5,_0x3a7849){if(_0xcbf78f[_0x84f6('0x63')]['id']){delete _0xcbf78f[_0x84f6('0x63')]['id'];}return db[_0x84f6('0x42')][_0x84f6('0x61')]({'where':{'id':_0xcbf78f[_0x84f6('0x5b')]['id']}})[_0x84f6('0x23')](handleEntityNotFound(_0x13eff5,null))[_0x84f6('0x23')](function(_0x52fe43){if(_0x52fe43){_0xcbf78f[_0x84f6('0x63')][_0x84f6('0x6a')]=_0x52fe43['id'];return db['MailServerIn'][_0x84f6('0x67')](_0xcbf78f['body']);}})[_0x84f6('0x23')](respondWithResult(_0x13eff5,null))[_0x84f6('0x59')](handleError(_0x13eff5,null));};exports['removeImap']=function(_0x37121e,_0x574022,_0x14eb47){return db[_0x84f6('0x42')][_0x84f6('0x69')]({'where':{'id':_0x37121e['params']['id']}})[_0x84f6('0x23')](handleEntityNotFound(_0x574022,null))[_0x84f6('0x23')](function(_0x12feec){if(_0x12feec){return _0x12feec[_0x84f6('0x85')](null);}return null;})[_0x84f6('0x23')](respondWithStatusCode(_0x574022,null))[_0x84f6('0x59')](handleError(_0x574022,null));};exports[_0x84f6('0x86')]=function(_0x1ea9f4,_0x419a3e,_0x361f8f){return db[_0x84f6('0x42')][_0x84f6('0x69')]({'where':{'id':_0x1ea9f4['params']['id']}})[_0x84f6('0x23')](handleEntityNotFound(_0x419a3e,null))['then'](function(_0x8aef81){if(_0x8aef81){return _0x8aef81[_0x84f6('0x86')]();}return null;})[_0x84f6('0x23')](respondWithResult(_0x419a3e,null))['catch'](handleError(_0x419a3e,null));};exports[_0x84f6('0x87')]=function(_0x398d18,_0x53a938,_0x59cf0c){if(_0x398d18[_0x84f6('0x63')]['id']){delete _0x398d18[_0x84f6('0x63')]['id'];}return db[_0x84f6('0x42')][_0x84f6('0x61')]({'where':{'id':_0x398d18['params']['id']}})['then'](handleEntityNotFound(_0x53a938,null))['then'](function(_0x102bc3){if(_0x102bc3){_0x398d18[_0x84f6('0x63')]['MailAccountId']=_0x102bc3['id'];return db[_0x84f6('0x5e')]['create'](_0x398d18[_0x84f6('0x63')]);}})['then'](respondWithResult(_0x53a938,null))[_0x84f6('0x59')](handleError(_0x53a938,null));};exports['removeSmtp']=function(_0x219148,_0x299742,_0x3e0dba){return db[_0x84f6('0x42')]['findOne']({'where':{'id':_0x219148[_0x84f6('0x5b')]['id']}})[_0x84f6('0x23')](handleEntityNotFound(_0x299742,null))[_0x84f6('0x23')](function(_0x4cc90e){if(_0x4cc90e){return _0x4cc90e[_0x84f6('0x88')](null);}return null;})['then'](respondWithStatusCode(_0x299742,null))[_0x84f6('0x59')](handleError(_0x299742,null));};exports[_0x84f6('0x89')]=function(_0x2afecb,_0x45e75e,_0x31bca5){return db[_0x84f6('0x8a')][_0x84f6('0x61')]({'where':{'id':_0x2afecb[_0x84f6('0x5b')]['id']}})[_0x84f6('0x23')](handleEntityNotFound(_0x45e75e,null))[_0x84f6('0x23')](function(_0x5715a8){if(_0x5715a8){return _0x5715a8[_0x84f6('0x89')](_0x2afecb['body'][_0x84f6('0x6d')],_['omit'](_0x2afecb[_0x84f6('0x63')],['ids','id'])||{});}})[_0x84f6('0x23')](respondWithResult(_0x45e75e,null))[_0x84f6('0x59')](handleError(_0x45e75e,null));};exports[_0x84f6('0x8b')]=function(_0x5678df,_0x2b0eb4,_0x34a4a2){var _0xffcd={'raw':![],'where':{}};var _0x21522f={};var _0x444109={'count':0x0,'rows':[]};return db[_0x84f6('0x42')][_0x84f6('0x69')]({'where':{'id':_0x5678df[_0x84f6('0x5b')]['id']}})[_0x84f6('0x23')](handleEntityNotFound(_0x2b0eb4,null))[_0x84f6('0x23')](function(_0x4f5074){if(_0x4f5074){_0x21522f[_0x84f6('0x46')]=_['keys'](db[_0x84f6('0x8a')][_0x84f6('0x43')]);_0x21522f['query']=_['keys'](_0x5678df[_0x84f6('0x47')]);_0x21522f['filters']=_['intersection'](_0x21522f[_0x84f6('0x46')],_0x21522f['query']);_0xffcd['attributes']=_[_0x84f6('0x4b')](_0x21522f[_0x84f6('0x46')],qs['fields'](_0x5678df[_0x84f6('0x47')][_0x84f6('0x4c')]));_0xffcd['attributes']=_0xffcd[_0x84f6('0x4a')]['length']?_0xffcd[_0x84f6('0x4a')]:_0x21522f[_0x84f6('0x46')];if(!_0x5678df[_0x84f6('0x47')][_0x84f6('0x4e')](_0x84f6('0x4f'))){_0xffcd['limit']=qs[_0x84f6('0x32')](_0x5678df[_0x84f6('0x47')]['limit']);_0xffcd[_0x84f6('0x30')]=qs[_0x84f6('0x30')](_0x5678df[_0x84f6('0x47')][_0x84f6('0x30')]);}_0xffcd[_0x84f6('0x50')]=qs[_0x84f6('0x51')](_0x5678df['query'][_0x84f6('0x51')]);_0xffcd[_0x84f6('0x52')]=qs[_0x84f6('0x49')](_[_0x84f6('0x53')](_0x5678df[_0x84f6('0x47')],_0x21522f['filters']));_0xffcd[_0x84f6('0x52')][_0x84f6('0x6a')]=_0x4f5074['id'];if(_0x5678df[_0x84f6('0x47')]['filter']){_0xffcd['where']=_[_0x84f6('0x55')](_0xffcd[_0x84f6('0x52')],{'$or':_[_0x84f6('0x41')](_0xffcd[_0x84f6('0x4a')],function(_0xa8abe0){var _0x246efd={};_0x246efd[_0xa8abe0]={'$like':'%'+_0x5678df[_0x84f6('0x47')][_0x84f6('0x54')]+'%'};return _0x246efd;})});}_0xffcd=_['merge']({},_0xffcd,_0x5678df[_0x84f6('0x57')]);return db[_0x84f6('0x8a')][_0x84f6('0x33')]({'where':_0xffcd['where']})[_0x84f6('0x23')](function(_0x36fd16){_0x444109[_0x84f6('0x33')]=_0x36fd16;if(_0x5678df[_0x84f6('0x47')][_0x84f6('0x60')]){_0xffcd[_0x84f6('0x6b')]=[{'model':db['CmContact'],'as':_0x84f6('0x8c'),'required':![]},{'model':db[_0x84f6('0x8d')],'as':_0x84f6('0x8e'),'attributes':[_0x84f6('0x3d'),'fullname',_0x84f6('0x8f')],'required':![]},{'model':db[_0x84f6('0x90')],'as':_0x84f6('0x91'),'attributes':['id','name','color'],'where':_0x5678df[_0x84f6('0x47')][_0x84f6('0x92')]?{'id':_0x5678df[_0x84f6('0x47')][_0x84f6('0x92')]}:undefined,'required':_0x5678df[_0x84f6('0x47')][_0x84f6('0x92')]?!![]:![]}];}return db[_0x84f6('0x8a')][_0x84f6('0x58')](_0xffcd);})[_0x84f6('0x23')](function(_0x3a3377){_0x444109[_0x84f6('0x71')]=_0x3a3377;return _0x444109;});}})[_0x84f6('0x23')](respondWithFilteredResult(_0x2b0eb4,_0xffcd))['catch'](handleError(_0x2b0eb4,null));};exports[_0x84f6('0x93')]=function addApplications(_0x27bc97,_0x67100a){var _0x5eb86f=_0x27bc97['params']['id'];var _0xe69826=_0x27bc97[_0x84f6('0x63')];var _0x390e55=0xc8;var _0x16a7d2=null;return db[_0x84f6('0x94')][_0x84f6('0x95')]({'isolationLevel':db[_0x84f6('0x94')]['Transaction'][_0x84f6('0x96')]['READ_COMMITTED']},function(_0x59c9fc){return db[_0x84f6('0x42')]['findOne']({'where':{'id':_0x5eb86f},'transaction':_0x59c9fc})[_0x84f6('0x23')](function(_0x2d6921){if(_0x2d6921){return db[_0x84f6('0x97')]['destroy']({'where':{'MailAccountId':_0x5eb86f},'transaction':_0x59c9fc})['then'](function(){var _0x2f3e12=_[_0x84f6('0x41')](_0xe69826,function(_0x56235b){_0x56235b[_0x84f6('0x6a')]=_0x5eb86f;return _0x56235b;});return db['MailApplication'][_0x84f6('0x98')](_0x2f3e12,{'transaction':_0x59c9fc});});}else{_0x390e55=0x194;_0x16a7d2=[];}});})[_0x84f6('0x23')](function(){if(_0x390e55!==0x194){return db[_0x84f6('0x97')]['findAndCountAll']({'where':{'MailAccountId':_0x5eb86f},'order':_0x84f6('0x99')})[_0x84f6('0x23')](function(_0x484b5a){_0x16a7d2=_0x484b5a;});}})[_0x84f6('0x59')](function(_0x29286f){_0x390e55=0x1f4;logger[_0x84f6('0x28')](_0x29286f[_0x84f6('0x3c')]);if(_0x29286f[_0x84f6('0x3d')]){delete _0x29286f[_0x84f6('0x3d')];}_0x16a7d2=_0x29286f;})[_0x84f6('0x9a')](function(){if(_0x16a7d2===null){_0x67100a[_0x84f6('0x2d')](_0x390e55);}else{if(_0x390e55===0x1f4){_0x67100a[_0x84f6('0x2e')](_0x390e55)[_0x84f6('0x9b')](_0x16a7d2);}else{_0x67100a[_0x84f6('0x2e')](_0x390e55)[_0x84f6('0x35')](_0x16a7d2);}}});};exports[_0x84f6('0x9c')]=function(_0x58d7f2,_0x596187,_0x37979a){var _0x3e52ba={};var _0x1f3b73={};var _0x4395b4;var _0x51a6ae;return db['MailAccount'][_0x84f6('0x69')]({'where':{'id':_0x58d7f2[_0x84f6('0x5b')]['id']}})['then'](handleEntityNotFound(_0x596187,null))[_0x84f6('0x23')](function(_0x2584ed){if(_0x2584ed){_0x4395b4=_0x2584ed;_0x1f3b73[_0x84f6('0x46')]=_['keys'](db[_0x84f6('0x97')][_0x84f6('0x43')]);_0x1f3b73[_0x84f6('0x47')]=_[_0x84f6('0x48')](_0x58d7f2[_0x84f6('0x47')]);_0x1f3b73[_0x84f6('0x49')]=_[_0x84f6('0x4b')](_0x1f3b73[_0x84f6('0x46')],_0x1f3b73[_0x84f6('0x47')]);_0x3e52ba[_0x84f6('0x4a')]=_['intersection'](_0x1f3b73[_0x84f6('0x46')],qs[_0x84f6('0x4c')](_0x58d7f2['query'][_0x84f6('0x4c')]));_0x3e52ba[_0x84f6('0x4a')]=_0x3e52ba[_0x84f6('0x4a')][_0x84f6('0x4d')]?_0x3e52ba['attributes']:_0x1f3b73[_0x84f6('0x46')];_0x3e52ba[_0x84f6('0x50')]=qs[_0x84f6('0x51')](_0x58d7f2['query'][_0x84f6('0x51')]);_0x3e52ba[_0x84f6('0x52')]=qs[_0x84f6('0x49')](_[_0x84f6('0x53')](_0x58d7f2['query'],_0x1f3b73[_0x84f6('0x49')]));if(_0x58d7f2['query']['filter']){_0x3e52ba[_0x84f6('0x52')]=_[_0x84f6('0x55')](_0x3e52ba['where'],{'$or':_['map'](_0x3e52ba[_0x84f6('0x4a')],function(_0x16083b){var _0x51f7ba={};_0x51f7ba[_0x16083b]={'$like':'%'+_0x58d7f2[_0x84f6('0x47')][_0x84f6('0x54')]+'%'};return _0x51f7ba;})});}_0x3e52ba=_[_0x84f6('0x55')]({},_0x3e52ba,_0x58d7f2[_0x84f6('0x57')]);return _0x4395b4['getApplications'](_0x3e52ba);}})[_0x84f6('0x23')](function(_0x562b4b){if(_0x562b4b){_0x51a6ae=_0x562b4b[_0x84f6('0x4d')];if(!_0x58d7f2[_0x84f6('0x47')][_0x84f6('0x4e')](_0x84f6('0x4f'))){_0x3e52ba[_0x84f6('0x32')]=qs['limit'](_0x58d7f2[_0x84f6('0x47')][_0x84f6('0x32')]);_0x3e52ba[_0x84f6('0x30')]=qs[_0x84f6('0x30')](_0x58d7f2[_0x84f6('0x47')][_0x84f6('0x30')]);}return _0x4395b4['getApplications'](_0x3e52ba);}})[_0x84f6('0x23')](function(_0x1d9ec1){if(_0x1d9ec1){return _0x1d9ec1?{'count':_0x51a6ae,'rows':_0x1d9ec1}:null;}})[_0x84f6('0x23')](respondWithResult(_0x596187,null))[_0x84f6('0x59')](handleError(_0x596187,null));};exports[_0x84f6('0x9d')]=function(_0x38d488,_0x3c3548,_0x54c348){var _0x3d96ab={'raw':!![],'where':{}};var _0x3a6285={};var _0x55375d={'count':0x0,'rows':[]};return db[_0x84f6('0x42')][_0x84f6('0x69')]({'where':{'id':_0x38d488[_0x84f6('0x5b')]['id']}})[_0x84f6('0x23')](handleEntityNotFound(_0x3c3548,null))['then'](function(_0x403b8b){if(_0x403b8b){_0x3a6285[_0x84f6('0x46')]=_[_0x84f6('0x48')](db[_0x84f6('0x9e')][_0x84f6('0x43')]);_0x3a6285['query']=_['keys'](_0x38d488[_0x84f6('0x47')]);_0x3a6285[_0x84f6('0x49')]=_[_0x84f6('0x4b')](_0x3a6285[_0x84f6('0x46')],_0x3a6285[_0x84f6('0x47')]);_0x3d96ab[_0x84f6('0x4a')]=_[_0x84f6('0x4b')](_0x3a6285[_0x84f6('0x46')],qs[_0x84f6('0x4c')](_0x38d488['query'][_0x84f6('0x4c')]));_0x3d96ab[_0x84f6('0x4a')]=_0x3d96ab['attributes'][_0x84f6('0x4d')]?_0x3d96ab[_0x84f6('0x4a')]:_0x3a6285[_0x84f6('0x46')];if(!_0x38d488['query'][_0x84f6('0x4e')](_0x84f6('0x4f'))){_0x3d96ab['limit']=qs[_0x84f6('0x32')](_0x38d488[_0x84f6('0x47')][_0x84f6('0x32')]);_0x3d96ab['offset']=qs[_0x84f6('0x30')](_0x38d488['query']['offset']);}_0x3d96ab[_0x84f6('0x50')]=qs[_0x84f6('0x51')](_0x38d488[_0x84f6('0x47')][_0x84f6('0x51')]);_0x3d96ab[_0x84f6('0x52')]=qs[_0x84f6('0x49')](_[_0x84f6('0x53')](_0x38d488['query'],_0x3a6285[_0x84f6('0x49')]));_0x3d96ab[_0x84f6('0x52')]['MailAccountId']=_0x403b8b['id'];if(_0x38d488['query']['filter']){_0x3d96ab[_0x84f6('0x52')]=_['merge'](_0x3d96ab[_0x84f6('0x52')],{'$or':_[_0x84f6('0x41')](_0x3d96ab[_0x84f6('0x4a')],function(_0x21b362){var _0x4cc09a={};_0x4cc09a[_0x21b362]={'$like':'%'+_0x38d488[_0x84f6('0x47')][_0x84f6('0x54')]+'%'};return _0x4cc09a;})});}if(_0x38d488['query'][_0x84f6('0x9f')]){var _0x52833e=_0x38d488['query'][_0x84f6('0x9f')][_0x84f6('0xa0')](',');var _0x2b9653={};_0x2b9653[_0x52833e[0x0]]={'$gte':moment(_0x52833e[0x1])[_0x84f6('0xa1')](_0x84f6('0xa2'))};_0x3d96ab[_0x84f6('0x52')]=_['merge'](_0x3d96ab[_0x84f6('0x52')],_0x2b9653);}_0x3d96ab=_[_0x84f6('0x55')]({},_0x3d96ab,_0x38d488['options']);return db[_0x84f6('0x9e')][_0x84f6('0x33')]({'where':_0x3d96ab[_0x84f6('0x52')]})[_0x84f6('0x23')](function(_0x167bb5){_0x55375d[_0x84f6('0x33')]=_0x167bb5;if(_0x38d488[_0x84f6('0x47')][_0x84f6('0x60')]){_0x3d96ab[_0x84f6('0x6b')]=[{'all':!![]}];}return db[_0x84f6('0x9e')]['findAll'](_0x3d96ab);})['then'](function(_0x23265c){if(_0x38d488[_0x84f6('0x47')]['inlineCss']===_0x84f6('0xa3')){for(var _0x11343c=0x0;_0x11343c<_0x23265c['length'];_0x11343c++){_0x23265c[_0x11343c]['body']=juice(_0x23265c[_0x11343c][_0x84f6('0x63')]);}}_0x55375d[_0x84f6('0x71')]=_0x23265c;return _0x55375d;});}})[_0x84f6('0x23')](respondWithFilteredResult(_0x3c3548,_0x3d96ab))['catch'](handleError(_0x3c3548,null));};exports[_0x84f6('0x9b')]=function(_0x24f76d,_0x4e7538,_0x58c33e){var _0x58014d,_0x588d6d={},_0x4f52eb;if(_0x24f76d['body']['to']){_0x4f52eb=_0x24f76d[_0x84f6('0x63')]['to'][_0x84f6('0xa0')](',')[0x0];}return db[_0x84f6('0x42')]['find']({'where':{'id':_0x24f76d[_0x84f6('0x5b')]['id']},'include':[{'model':db[_0x84f6('0xa4')],'as':_0x84f6('0xa5'),'include':[{'model':db['CmContact'],'as':_0x84f6('0xa6'),'where':{'email':_0x4f52eb},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x84f6('0x5e')],'as':'Smtp','raw':!![]}]})[_0x84f6('0x23')](handleEntityNotFound(_0x4e7538,null))[_0x84f6('0x23')](function(_0x565941){if(_0x565941){_0x58014d=_0x565941;if(_0x565941[_0x84f6('0x5f')]){if(_[_0x84f6('0x74')](_0x24f76d['body']['from'])){_0x24f76d[_0x84f6('0x63')]['from']=util[_0x84f6('0xa1')](_0x84f6('0xa7'),_0x565941['name'],_0x565941[_0x84f6('0xa8')]||_0x565941[_0x84f6('0x5f')][_0x84f6('0x78')]);}if(_0x24f76d[_0x84f6('0x63')][_0x84f6('0xa9')]&&_0x24f76d[_0x84f6('0x63')]['attachments']['length']){for(var _0x35a90b=0x0;_0x35a90b<_0x24f76d[_0x84f6('0x63')][_0x84f6('0xa9')][_0x84f6('0x4d')];_0x35a90b+=0x1){_0x24f76d[_0x84f6('0x63')]['attachments'][_0x35a90b]={'filename':_0x24f76d['body']['attachments'][_0x35a90b]['name'],'path':path[_0x84f6('0xaa')](config['root'],_0x84f6('0xab'),_0x24f76d[_0x84f6('0x63')][_0x84f6('0xa9')][_0x35a90b][_0x84f6('0xac')])};}}var _0x291a42={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x565941[_0x84f6('0x5f')][_0x84f6('0xad')])){if(_0x565941[_0x84f6('0x5f')][_0x84f6('0x7b')]){_0x291a42[_0x84f6('0xae')]={'user':_0x565941['Smtp'][_0x84f6('0x78')],'pass':_0x565941['Smtp'][_0x84f6('0x7a')]};}_0x291a42[_0x84f6('0x7c')]=_0x565941[_0x84f6('0x5f')][_0x84f6('0x7c')];_0x291a42[_0x84f6('0x7d')]=_0x565941[_0x84f6('0x5f')][_0x84f6('0x7d')];_0x291a42[_0x84f6('0xaf')]=_0x565941[_0x84f6('0x5f')]['secure'];}else{_0x291a42['service']=_0x565941[_0x84f6('0x5f')]['service'];_0x291a42[_0x84f6('0xae')]={'user':_0x565941[_0x84f6('0x5f')][_0x84f6('0x78')],'pass':_0x565941['Smtp']['pass']};}return respondWithRpcPromise(_0x84f6('0xb0'),_0x84f6('0xb1'),{'account':_0x291a42,'message':_0x24f76d[_0x84f6('0x63')]});}else{throw new Error(_0x84f6('0xb2'));}}})[_0x84f6('0x23')](function(_0xc54f3f){if(_0xc54f3f){_0x588d6d=_0xc54f3f;if(_0x58014d['List']){if(_0x58014d['List'][_0x84f6('0xa6')][_0x84f6('0x4d')]){return _0x58014d[_0x84f6('0xa5')][_0x84f6('0xa6')][0x0];}else{return db[_0x84f6('0xb3')][_0x84f6('0x67')](_[_0x84f6('0x1a')](_0x24f76d['body'],{'firstName':_0x24f76d[_0x84f6('0x63')]['to'],'email':_0x24f76d[_0x84f6('0x63')]['to'],'phone':_0x24f76d['body']['to'],'ListId':_0x58014d[_0x84f6('0x73')]}));}}else{throw new Error(_0x84f6('0xb2'));}}})[_0x84f6('0x23')](function(_0x11bca3){if(_0x11bca3){var _0x59ebf4={'UserId':_0x24f76d['user']['id'],'ContactId':_0x11bca3['id'],'MailAccountId':_0x58014d['id'],'inReplyTo':_0x588d6d[_0x84f6('0xb4')],'to':_0x24f76d[_0x84f6('0x63')][_0x84f6('0xb5')],'cc':_0x24f76d[_0x84f6('0x63')]['cc'],'subject':_0x24f76d[_0x84f6('0x63')][_0x84f6('0xb6')],'attach':_0x24f76d[_0x84f6('0x63')][_0x84f6('0xb7')],'firstMsgDirection':_0x84f6('0xb8'),'lastMsgAt':moment()[_0x84f6('0xa1')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x84f6('0xb8'),'Messages':[_['merge'](_0x24f76d['body'],{'messageId':_0x588d6d[_0x84f6('0xb4')],'sentAt':moment()[_0x84f6('0xa1')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x58014d['id'],'UserId':_0x24f76d[_0x84f6('0x78')]['id'],'ContactId':_0x11bca3['id']})]};if(_0x24f76d[_0x84f6('0x63')][_0x84f6('0xb9')]){_0x59ebf4=_[_0x84f6('0x55')](_0x59ebf4,_0x24f76d[_0x84f6('0x63')][_0x84f6('0xb9')]);}return db[_0x84f6('0x8a')][_0x84f6('0x67')](_0x59ebf4,{'include':[{'model':db[_0x84f6('0x9e')],'as':_0x84f6('0xba')}]});}})[_0x84f6('0x23')](respondWithResult(_0x4e7538,null))[_0x84f6('0x59')](handleError(_0x4e7538,null));};exports[_0x84f6('0xbb')]=function(_0x1656cc,_0x34a624,_0x352282){return db[_0x84f6('0x42')]['find']({'where':{'id':_0x1656cc[_0x84f6('0x5b')]['id']},'include':[{'model':db[_0x84f6('0x5e')],'as':_0x84f6('0x5f'),'raw':!![]}]})[_0x84f6('0x23')](handleEntityNotFound(_0x34a624,null))[_0x84f6('0x23')](function(_0x17fe40){if(_0x17fe40&&_0x17fe40['Smtp']){var _0x2a108a={'id':_0x17fe40['id'],'tls':{'rejectUnauthorized':![]}};if(_0x17fe40[_0x84f6('0x5f')][_0x84f6('0xad')]){_0x2a108a[_0x84f6('0xad')]=_0x17fe40[_0x84f6('0x5f')][_0x84f6('0xad')];}else{_0x2a108a[_0x84f6('0x7c')]=_0x17fe40['Smtp']['host'];_0x2a108a[_0x84f6('0x7d')]=_0x17fe40[_0x84f6('0x5f')]['port'];_0x2a108a[_0x84f6('0xaf')]=_0x17fe40[_0x84f6('0x5f')]['secure'];}if(_0x17fe40[_0x84f6('0x5f')][_0x84f6('0x7b')]){_0x2a108a[_0x84f6('0xae')]={'user':_0x17fe40[_0x84f6('0x5f')][_0x84f6('0x78')],'pass':_0x17fe40[_0x84f6('0x5f')][_0x84f6('0x7a')]};}return respondWithRpcPromise(_0x84f6('0xbc'),_0x84f6('0xbb'),{'account':_0x2a108a});}})[_0x84f6('0x23')](respondWithResult(_0x34a624,null))['catch'](handleError(_0x34a624,null));};exports[_0x84f6('0x39')]=function(_0x576871,_0x16e848){return db[_0x84f6('0x42')][_0x84f6('0x61')]({'where':{'id':_0x576871['params']['id']}})[_0x84f6('0x23')](handleEntityNotFound(_0x16e848,null))[_0x84f6('0x23')](function(_0x19d00a){if(_0x19d00a&&_0x19d00a[_0x84f6('0xad')]){throw new db['Sequelize'][(_0x84f6('0xbd'))](_0x84f6('0xbe'));}return _0x19d00a;})[_0x84f6('0x23')](removeEntity(_0x16e848,null))[_0x84f6('0x59')](handleError(_0x16e848,null));};exports['addAgents']=function(_0x18f045,_0x26c1e2,_0x2a71da){return db['MailAccount'][_0x84f6('0x61')]({'where':{'id':_0x18f045[_0x84f6('0x5b')]['id']}})[_0x84f6('0x23')](handleEntityNotFound(_0x26c1e2,null))[_0x84f6('0x23')](function(_0x1ef4ae){if(_0x1ef4ae){return _0x1ef4ae['addAgents'](_0x18f045[_0x84f6('0x63')][_0x84f6('0x6d')],_[_0x84f6('0xbf')](_0x18f045[_0x84f6('0x63')],['ids','id'])||{})[_0x84f6('0xc0')](function(_0x34b9f3){for(var _0x5dfe65=0x0;_0x5dfe65<_0x18f045[_0x84f6('0x63')][_0x84f6('0x6d')][_0x84f6('0x4d')];_0x5dfe65+=0x1){socket[_0x84f6('0xc1')]('userMailAccount:save',{'UserId':Number(_0x18f045[_0x84f6('0x63')][_0x84f6('0x6d')][_0x5dfe65]),'MailAccountId':Number(_0x18f045[_0x84f6('0x5b')]['id'])});}return _0x34b9f3;});}})[_0x84f6('0x23')](respondWithResult(_0x26c1e2,null))['catch'](handleError(_0x26c1e2,null));};exports[_0x84f6('0xc2')]=function(_0x314f63,_0x420908,_0x45b446){return db['MailAccount'][_0x84f6('0x61')]({'where':{'id':_0x314f63[_0x84f6('0x5b')]['id']}})[_0x84f6('0x23')](handleEntityNotFound(_0x420908,null))[_0x84f6('0x23')](function(_0x5cc699){if(_0x5cc699){return _0x5cc699['removeAgents'](_0x314f63[_0x84f6('0x47')]['ids'])[_0x84f6('0x23')](function(){if(_[_0x84f6('0xc3')](_0x314f63[_0x84f6('0x47')][_0x84f6('0x6d')])){for(var _0x304392=0x0;_0x304392<_0x314f63[_0x84f6('0x47')]['ids'][_0x84f6('0x4d')];_0x304392+=0x1){socket[_0x84f6('0xc1')](_0x84f6('0xc4'),{'UserId':Number(_0x314f63[_0x84f6('0x47')][_0x84f6('0x6d')][_0x304392]),'MailAccountId':Number(_0x314f63[_0x84f6('0x5b')]['id'])});}}else{socket[_0x84f6('0xc1')](_0x84f6('0xc4'),{'UserId':Number(_0x314f63[_0x84f6('0x47')][_0x84f6('0x6d')]),'MailAccountId':Number(_0x314f63[_0x84f6('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x420908,null))[_0x84f6('0x59')](handleError(_0x420908,null));};exports[_0x84f6('0xc5')]=function(_0x3c843d,_0x39785d,_0x5cbebe){var _0x40cfc4={};var _0xaeda11={};var _0x3311f7;var _0x1e5c40;return db[_0x84f6('0x42')][_0x84f6('0x69')]({'where':{'id':_0x3c843d['params']['id']}})[_0x84f6('0x23')](handleEntityNotFound(_0x39785d,null))[_0x84f6('0x23')](function(_0x41940a){if(_0x41940a){_0x3311f7=_0x41940a;_0xaeda11[_0x84f6('0x46')]=_[_0x84f6('0x48')](db['User'][_0x84f6('0x43')]);_0xaeda11[_0x84f6('0x47')]=_[_0x84f6('0x48')](_0x3c843d['query']);_0xaeda11['filters']=_[_0x84f6('0x4b')](_0xaeda11[_0x84f6('0x46')],_0xaeda11[_0x84f6('0x47')]);_0x40cfc4['attributes']=_[_0x84f6('0x4b')](_0xaeda11[_0x84f6('0x46')],qs['fields'](_0x3c843d['query'][_0x84f6('0x4c')]));_0x40cfc4[_0x84f6('0x4a')]=_0x40cfc4[_0x84f6('0x4a')][_0x84f6('0x4d')]?_0x40cfc4[_0x84f6('0x4a')]:_0xaeda11['model'];_0x40cfc4[_0x84f6('0x50')]=qs[_0x84f6('0x51')](_0x3c843d[_0x84f6('0x47')][_0x84f6('0x51')]);_0x40cfc4['where']=qs[_0x84f6('0x49')](_[_0x84f6('0x53')](_0x3c843d[_0x84f6('0x47')],_0xaeda11[_0x84f6('0x49')]));if(_0x3c843d[_0x84f6('0x47')][_0x84f6('0x54')]){_0x40cfc4[_0x84f6('0x52')]=_[_0x84f6('0x55')](_0x40cfc4[_0x84f6('0x52')],{'$or':_['map'](_0x40cfc4['attributes'],function(_0x2bff31){var _0x350377={};_0x350377[_0x2bff31]={'$like':'%'+_0x3c843d[_0x84f6('0x47')][_0x84f6('0x54')]+'%'};return _0x350377;})});}_0x40cfc4=_[_0x84f6('0x55')]({},_0x40cfc4,_0x3c843d[_0x84f6('0x57')]);return _0x3311f7['getAgents'](_0x40cfc4);}})[_0x84f6('0x23')](function(_0xac0612){if(_0xac0612){_0x1e5c40=_0xac0612[_0x84f6('0x4d')];if(!_0x3c843d[_0x84f6('0x47')][_0x84f6('0x4e')]('nolimit')){_0x40cfc4[_0x84f6('0x32')]=qs[_0x84f6('0x32')](_0x3c843d[_0x84f6('0x47')]['limit']);_0x40cfc4[_0x84f6('0x30')]=qs[_0x84f6('0x30')](_0x3c843d['query'][_0x84f6('0x30')]);}return _0x3311f7['getAgents'](_0x40cfc4);}})[_0x84f6('0x23')](function(_0x1d6804){if(_0x1d6804){return _0x1d6804?{'count':_0x1e5c40,'rows':_0x1d6804}:null;}})['then'](respondWithResult(_0x39785d,null))['catch'](handleError(_0x39785d,null));}; \ No newline at end of file +var _0xb97d=['html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','UserProfileResource','end','sendStatus','name','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','options','MailAccount','includeAll','include','findAll','rows','catch','show','params','length','merge','find','body','MailServerIn','describe','addDisposition','Disposition','create','getDispositions','findOne','pick','removeDispositions','ids','addAnswer','MailAccountId','CannedAnswer','removeAnswers','email','ListId','isNil','active','description','cservice','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','getSmtp','addSmtp','removeSmtp','MailInteraction','addInteraction','CmContact','Tag','Tags','color','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','MailApplication','priority','stack','finally','send','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','root','secure','SendMail','sendMail','List','List\x20not\x20found','messageId','subject','attach','out','Interaction','auth','VerifySmtp','verifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','papaparse'];(function(_0x301dab,_0x38050a){var _0x2500a2=function(_0x4d3dff){while(--_0x4d3dff){_0x301dab['push'](_0x301dab['shift']());}};_0x2500a2(++_0x38050a);}(_0xb97d,0xb3));var _0xdb97=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xb97d[_0xf0bcac];return _0x4e4c65;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdb97('0x0'));var zipdir=require(_0xdb97('0x1'));var jsonpatch=require(_0xdb97('0x2'));var rp=require(_0xdb97('0x3'));var moment=require(_0xdb97('0x4'));var BPromise=require(_0xdb97('0x5'));var Mustache=require(_0xdb97('0x6'));var util=require(_0xdb97('0x7'));var path=require(_0xdb97('0x8'));var sox=require(_0xdb97('0x9'));var csv=require(_0xdb97('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb97('0xb'));var _=require(_0xdb97('0xc'));var squel=require(_0xdb97('0xd'));var crypto=require(_0xdb97('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdb97('0xa'));var querystring=require('querystring');var Papa=require(_0xdb97('0xf'));var htmlToText=require(_0xdb97('0x10'));var juice=require(_0xdb97('0x11'));var Redis=require(_0xdb97('0x12'));var authService=require(_0xdb97('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xdb97('0x14'));var hardwareService=require(_0xdb97('0x15'));var logger=require(_0xdb97('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xdb97('0x17'));var licenseUtil=require(_0xdb97('0x18'));var db=require(_0xdb97('0x19'))['db'];config[_0xdb97('0x1a')]=_[_0xdb97('0x1b')](config[_0xdb97('0x1a')],{'host':_0xdb97('0x1c'),'port':0x18eb});var socket=require(_0xdb97('0x1d'))(new Redis(config[_0xdb97('0x1a')]));require('./mailAccount.socket')[_0xdb97('0x1e')](socket);var jayson=require(_0xdb97('0x1f'));var client=jayson[_0xdb97('0x20')][_0xdb97('0x21')]({'port':0x232b});function respondWithRpcPromise(_0x14f089,_0x3967b0,_0x40f07b,_0x263b08){return new BPromise(function(_0x29f844,_0x13a092){var _0x38edec=_0x263b08||client;return _0x38edec[_0xdb97('0x22')](_0x14f089,_0x40f07b)[_0xdb97('0x23')](function(_0x2ddd28){logger[_0xdb97('0x24')](_0xdb97('0x25'),_0x3967b0,_0xdb97('0x26'));logger[_0xdb97('0x27')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x3967b0,'request\x20sent',JSON[_0xdb97('0x28')](_0x2ddd28));if(_0x2ddd28['error']){if(_0x2ddd28[_0xdb97('0x29')][_0xdb97('0x2a')]===0x1f4){logger[_0xdb97('0x29')](_0xdb97('0x25'),_0x3967b0,_0x2ddd28['error'][_0xdb97('0x2b')]);return _0x13a092(_0x2ddd28['error'][_0xdb97('0x2b')]);}logger[_0xdb97('0x29')]('MailAccount,\x20%s,\x20%s',_0x3967b0,_0x2ddd28[_0xdb97('0x29')][_0xdb97('0x2b')]);return _0x29f844(_0x2ddd28[_0xdb97('0x29')]['message']);}else{logger[_0xdb97('0x24')](_0xdb97('0x25'),_0x3967b0,'request\x20sent');_0x29f844(_0x2ddd28[_0xdb97('0x2c')][_0xdb97('0x2b')]);}})['catch'](function(_0x64ca5d){logger[_0xdb97('0x29')](_0xdb97('0x25'),_0x3967b0,_0x64ca5d);_0x13a092(_0x64ca5d);});});}function respondWithStatusCode(_0x4e0683,_0x331339){_0x331339=_0x331339||0xcc;return function(_0x2ec467){if(_0x2ec467){return _0x4e0683['sendStatus'](_0x331339);}return _0x4e0683[_0xdb97('0x2d')](_0x331339)['end']();};}function respondWithResult(_0x3fe3f7,_0xbeb147){_0xbeb147=_0xbeb147||0xc8;return function(_0x186fdc){if(_0x186fdc){return _0x3fe3f7['status'](_0xbeb147)[_0xdb97('0x2e')](_0x186fdc);}};}function respondWithFilteredResult(_0x3a367c,_0x38af9e){return function(_0x22d581){if(_0x22d581){var _0x25695d=typeof _0x38af9e['offset']===_0xdb97('0x2f')&&typeof _0x38af9e[_0xdb97('0x30')]===_0xdb97('0x2f');var _0xe6ed4b=_0x22d581[_0xdb97('0x31')];var _0x320eff=_0x25695d?0x0:_0x38af9e['offset'];var _0x51b937=_0x25695d?_0x22d581[_0xdb97('0x31')]:_0x38af9e[_0xdb97('0x32')]+_0x38af9e[_0xdb97('0x30')];var _0x3c7d15;if(_0x51b937>=_0xe6ed4b){_0x51b937=_0xe6ed4b;_0x3c7d15=0xc8;}else{_0x3c7d15=0xce;}_0x3a367c[_0xdb97('0x2d')](_0x3c7d15);return _0x3a367c[_0xdb97('0x33')](_0xdb97('0x34'),_0x320eff+'-'+_0x51b937+'/'+_0xe6ed4b)['json'](_0x22d581);}return null;};}function patchUpdates(_0xedc1da){return function(_0xb4a808){try{jsonpatch[_0xdb97('0x35')](_0xb4a808,_0xedc1da,!![]);}catch(_0x249f6d){return BPromise[_0xdb97('0x36')](_0x249f6d);}return _0xb4a808[_0xdb97('0x37')]();};}function saveUpdates(_0x4e4c29,_0x35478d){return function(_0x25d64d){if(_0x25d64d){return _0x25d64d[_0xdb97('0x38')](_0x4e4c29)[_0xdb97('0x23')](function(_0x127a4b){return _0x127a4b;});}return null;};}function removeEntity(_0x3ce67c,_0xd21e1){return function(_0xa43d76){if(_0xa43d76){return _0xa43d76[_0xdb97('0x39')]()['then'](function(){var _0x481aab=_0xa43d76['get']({'plain':!![]});var _0x5cc7ad='MailAccounts';return db[_0xdb97('0x3a')]['destroy']({'where':{'type':_0x5cc7ad,'resourceId':_0x481aab['id']}})[_0xdb97('0x23')](function(){return _0xa43d76;});})[_0xdb97('0x23')](function(){_0x3ce67c[_0xdb97('0x2d')](0xcc)[_0xdb97('0x3b')]();});}};}function handleEntityNotFound(_0x12bd6a,_0x517170){return function(_0x1edfaa){if(!_0x1edfaa){_0x12bd6a[_0xdb97('0x3c')](0x194);}return _0x1edfaa;};}function handleError(_0x2816d8,_0x596e58){_0x596e58=_0x596e58||0x1f4;return function(_0x1151f6){logger['error'](_0x1151f6['stack']);if(_0x1151f6[_0xdb97('0x3d')]){delete _0x1151f6['name'];}_0x2816d8['status'](_0x596e58)['send'](_0x1151f6);};}exports['index']=function(_0x1d50ce,_0x3cbd39){var _0x19ed62={'include':[{'model':db['MailServerIn'],'as':_0xdb97('0x3e')},{'model':db[_0xdb97('0x3f')],'as':_0xdb97('0x40')},{'model':db[_0xdb97('0x41')],'as':_0xdb97('0x42')}]},_0x756c74={},_0x38a0d6={'count':0x0,'rows':[]};var _0x377508=_[_0xdb97('0x43')](db['MailAccount'][_0xdb97('0x44')],function(_0x597aa2){return{'name':_0x597aa2[_0xdb97('0x45')],'type':_0x597aa2[_0xdb97('0x46')][_0xdb97('0x47')]};});_0x756c74[_0xdb97('0x48')]=_['map'](_0x377508,'name');_0x756c74[_0xdb97('0x49')]=_[_0xdb97('0x4a')](_0x1d50ce['query']);_0x756c74['filters']=_['intersection'](_0x756c74['model'],_0x756c74['query']);_0x19ed62[_0xdb97('0x4b')]=_[_0xdb97('0x4c')](_0x756c74['model'],qs[_0xdb97('0x4d')](_0x1d50ce['query'][_0xdb97('0x4d')]));_0x19ed62[_0xdb97('0x4b')]=_0x19ed62['attributes']['length']?_0x19ed62[_0xdb97('0x4b')]:_0x756c74[_0xdb97('0x48')];if(!_0x1d50ce[_0xdb97('0x49')][_0xdb97('0x4e')](_0xdb97('0x4f'))){_0x19ed62[_0xdb97('0x30')]=qs[_0xdb97('0x30')](_0x1d50ce['query'][_0xdb97('0x30')]);_0x19ed62['offset']=qs['offset'](_0x1d50ce[_0xdb97('0x49')]['offset']);}_0x19ed62[_0xdb97('0x50')]=qs['sort'](_0x1d50ce[_0xdb97('0x49')][_0xdb97('0x51')]);_0x19ed62[_0xdb97('0x52')]=qs[_0xdb97('0x53')](_['pick'](_0x1d50ce['query'],_0x756c74[_0xdb97('0x53')]),_0x377508);if(_0x1d50ce[_0xdb97('0x49')][_0xdb97('0x54')]){_0x19ed62['where']=_['merge'](_0x19ed62['where'],{'$or':_[_0xdb97('0x43')](_0x377508,function(_0x5892b9){if(_0x5892b9[_0xdb97('0x46')]!=='VIRTUAL'){var _0x248be4={};_0x248be4[_0x5892b9['name']]={'$like':'%'+_0x1d50ce[_0xdb97('0x49')][_0xdb97('0x54')]+'%'};return _0x248be4;}})});}_0x19ed62=_['merge']({},_0x19ed62,_0x1d50ce[_0xdb97('0x55')]);var _0x4f6ddb={'where':_0x19ed62[_0xdb97('0x52')]};return db[_0xdb97('0x56')]['count'](_0x4f6ddb)['then'](function(_0xe07345){_0x38a0d6[_0xdb97('0x31')]=_0xe07345;if(_0x1d50ce[_0xdb97('0x49')][_0xdb97('0x57')]){_0x19ed62[_0xdb97('0x58')]=[{'all':!![]}];}return db[_0xdb97('0x56')][_0xdb97('0x59')](_0x19ed62);})[_0xdb97('0x23')](function(_0x2dd0ed){_0x38a0d6[_0xdb97('0x5a')]=_0x2dd0ed;return _0x38a0d6;})[_0xdb97('0x23')](respondWithFilteredResult(_0x3cbd39,_0x19ed62))[_0xdb97('0x5b')](handleError(_0x3cbd39,null));};exports[_0xdb97('0x5c')]=function(_0x33d15c,_0x538b6c){var _0x380abd={'raw':![],'where':{'id':_0x33d15c[_0xdb97('0x5d')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0xdb97('0x3f')],'as':_0xdb97('0x40')},{'model':db[_0xdb97('0x41')],'as':_0xdb97('0x42')}]},_0x4ab1e6={};_0x4ab1e6[_0xdb97('0x48')]=_['keys'](db['MailAccount'][_0xdb97('0x44')]);_0x4ab1e6[_0xdb97('0x49')]=_['keys'](_0x33d15c[_0xdb97('0x49')]);_0x4ab1e6[_0xdb97('0x53')]=_[_0xdb97('0x4c')](_0x4ab1e6[_0xdb97('0x48')],_0x4ab1e6[_0xdb97('0x49')]);_0x380abd[_0xdb97('0x4b')]=_[_0xdb97('0x4c')](_0x4ab1e6[_0xdb97('0x48')],qs['fields'](_0x33d15c['query']['fields']));_0x380abd[_0xdb97('0x4b')]=_0x380abd[_0xdb97('0x4b')][_0xdb97('0x5e')]?_0x380abd[_0xdb97('0x4b')]:_0x4ab1e6[_0xdb97('0x48')];if(_0x33d15c[_0xdb97('0x49')][_0xdb97('0x57')]){_0x380abd['include']=[{'all':!![]}];}_0x380abd=_[_0xdb97('0x5f')]({},_0x380abd,_0x33d15c['options']);return db[_0xdb97('0x56')][_0xdb97('0x60')](_0x380abd)[_0xdb97('0x23')](handleEntityNotFound(_0x538b6c,null))[_0xdb97('0x23')](respondWithResult(_0x538b6c,null))[_0xdb97('0x5b')](handleError(_0x538b6c,null));};exports[_0xdb97('0x38')]=function(_0xf9311,_0x39f2d2){if(_0xf9311[_0xdb97('0x61')]['id']){delete _0xf9311[_0xdb97('0x61')]['id'];}return db[_0xdb97('0x56')][_0xdb97('0x60')]({'where':{'id':_0xf9311[_0xdb97('0x5d')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xdb97('0x3e')},{'model':db[_0xdb97('0x3f')],'as':'Smtp'},{'model':db['Pause'],'as':_0xdb97('0x42')}]})[_0xdb97('0x23')](handleEntityNotFound(_0x39f2d2,null))[_0xdb97('0x23')](saveUpdates(_0xf9311[_0xdb97('0x61')],null))[_0xdb97('0x23')](function(_0x4845fb){if(_0x4845fb&&_0xf9311[_0xdb97('0x61')][_0xdb97('0x3e')]){return db[_0xdb97('0x62')][_0xdb97('0x38')](_0xf9311[_0xdb97('0x61')]['Imap'],{'where':{'MailAccountId':_0x4845fb['id']}})[_0xdb97('0x23')](function(){return _0x4845fb;});}return _0x4845fb;})[_0xdb97('0x23')](function(_0x1c48ca){if(_0x1c48ca&&_0xf9311['body'][_0xdb97('0x40')]){return db[_0xdb97('0x3f')][_0xdb97('0x38')](_0xf9311['body']['Smtp'],{'where':{'MailAccountId':_0x1c48ca['id']}})[_0xdb97('0x23')](function(){return _0x1c48ca;});}return _0x1c48ca;})[_0xdb97('0x23')](respondWithResult(_0x39f2d2,null))[_0xdb97('0x5b')](handleError(_0x39f2d2,null));};exports['describe']=function(_0x4d528b,_0x1dda45){return db[_0xdb97('0x56')][_0xdb97('0x63')]()[_0xdb97('0x23')](respondWithResult(_0x1dda45,null))['catch'](handleError(_0x1dda45,null));};exports[_0xdb97('0x64')]=function(_0x32c58f,_0x4db7ab,_0x1e6583){if(_0x32c58f[_0xdb97('0x61')]['id']){delete _0x32c58f[_0xdb97('0x61')]['id'];}return db[_0xdb97('0x56')][_0xdb97('0x60')]({'where':{'id':_0x32c58f[_0xdb97('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4db7ab,null))[_0xdb97('0x23')](function(_0x394189){if(_0x394189){_0x32c58f[_0xdb97('0x61')]['MailAccountId']=_0x394189['id'];return db[_0xdb97('0x65')][_0xdb97('0x66')](_0x32c58f[_0xdb97('0x61')]);}})[_0xdb97('0x23')](respondWithResult(_0x4db7ab,null))[_0xdb97('0x5b')](handleError(_0x4db7ab,null));};exports[_0xdb97('0x67')]=function(_0x3f56fb,_0x227026,_0x2f4122){var _0x3662cf={'raw':![],'where':{}};var _0x4aea2b={};var _0x2f971e={'count':0x0,'rows':[]};return db['MailAccount'][_0xdb97('0x68')]({'where':{'id':_0x3f56fb[_0xdb97('0x5d')]['id']}})['then'](handleEntityNotFound(_0x227026,null))[_0xdb97('0x23')](function(_0x2ea980){if(_0x2ea980){_0x4aea2b[_0xdb97('0x48')]=_[_0xdb97('0x4a')](db['Disposition'][_0xdb97('0x44')]);_0x4aea2b[_0xdb97('0x49')]=_[_0xdb97('0x4a')](_0x3f56fb['query']);_0x4aea2b[_0xdb97('0x53')]=_[_0xdb97('0x4c')](_0x4aea2b['model'],_0x4aea2b[_0xdb97('0x49')]);_0x3662cf[_0xdb97('0x4b')]=_[_0xdb97('0x4c')](_0x4aea2b['model'],qs['fields'](_0x3f56fb[_0xdb97('0x49')][_0xdb97('0x4d')]));_0x3662cf[_0xdb97('0x4b')]=_0x3662cf[_0xdb97('0x4b')][_0xdb97('0x5e')]?_0x3662cf[_0xdb97('0x4b')]:_0x4aea2b[_0xdb97('0x48')];if(!_0x3f56fb[_0xdb97('0x49')][_0xdb97('0x4e')](_0xdb97('0x4f'))){_0x3662cf[_0xdb97('0x30')]=qs[_0xdb97('0x30')](_0x3f56fb['query'][_0xdb97('0x30')]);_0x3662cf['offset']=qs['offset'](_0x3f56fb['query'][_0xdb97('0x32')]);}_0x3662cf[_0xdb97('0x50')]=qs['sort'](_0x3f56fb[_0xdb97('0x49')]['sort']);_0x3662cf[_0xdb97('0x52')]=qs[_0xdb97('0x53')](_[_0xdb97('0x69')](_0x3f56fb[_0xdb97('0x49')],_0x4aea2b[_0xdb97('0x53')]));_0x3662cf[_0xdb97('0x52')]['MailAccountId']=_0x2ea980['id'];if(_0x3f56fb[_0xdb97('0x49')][_0xdb97('0x54')]){_0x3662cf['where']=_[_0xdb97('0x5f')](_0x3662cf[_0xdb97('0x52')],{'$or':_[_0xdb97('0x43')](_0x3662cf['attributes'],function(_0x4bd705){var _0x194b84={};_0x194b84[_0x4bd705]={'$like':'%'+_0x3f56fb[_0xdb97('0x49')]['filter']+'%'};return _0x194b84;})});}_0x3662cf=_['merge']({},_0x3662cf,_0x3f56fb['options']);return db[_0xdb97('0x65')][_0xdb97('0x31')]({'where':_0x3662cf[_0xdb97('0x52')]})[_0xdb97('0x23')](function(_0x3e575f){_0x2f971e[_0xdb97('0x31')]=_0x3e575f;if(_0x3f56fb[_0xdb97('0x49')][_0xdb97('0x57')]){_0x3662cf[_0xdb97('0x58')]=[{'all':!![]}];}return db[_0xdb97('0x65')]['findAll'](_0x3662cf);})[_0xdb97('0x23')](function(_0x2c7ca6){_0x2f971e[_0xdb97('0x5a')]=_0x2c7ca6;return _0x2f971e;});}})['then'](respondWithFilteredResult(_0x227026,_0x3662cf))[_0xdb97('0x5b')](handleError(_0x227026,null));};exports[_0xdb97('0x6a')]=function(_0x134c33,_0xee2248,_0x51a705){return db[_0xdb97('0x56')][_0xdb97('0x60')]({'where':{'id':_0x134c33[_0xdb97('0x5d')]['id']}})[_0xdb97('0x23')](handleEntityNotFound(_0xee2248,null))[_0xdb97('0x23')](function(_0x4cf2ab){if(_0x4cf2ab){return _0x4cf2ab['removeDispositions'](_0x134c33[_0xdb97('0x49')][_0xdb97('0x6b')]);}})[_0xdb97('0x23')](respondWithStatusCode(_0xee2248,null))['catch'](handleError(_0xee2248,null));};exports[_0xdb97('0x6c')]=function(_0x3f5b04,_0x1cb264,_0x3b7ea7){if(_0x3f5b04[_0xdb97('0x61')]['id']){delete _0x3f5b04[_0xdb97('0x61')]['id'];}return db[_0xdb97('0x56')][_0xdb97('0x60')]({'where':{'id':_0x3f5b04['params']['id']}})[_0xdb97('0x23')](handleEntityNotFound(_0x1cb264,null))[_0xdb97('0x23')](function(_0x1f4aa7){if(_0x1f4aa7){_0x3f5b04[_0xdb97('0x61')][_0xdb97('0x6d')]=_0x1f4aa7['id'];return db['CannedAnswer'][_0xdb97('0x66')](_0x3f5b04[_0xdb97('0x61')]);}})[_0xdb97('0x23')](respondWithResult(_0x1cb264,null))[_0xdb97('0x5b')](handleError(_0x1cb264,null));};exports['getAnswers']=function(_0x147c21,_0x3c2bc3,_0x5a8aa2){var _0x450f32={'raw':![],'where':{}};var _0x82b437={};var _0x184421={'count':0x0,'rows':[]};return db[_0xdb97('0x56')]['findOne']({'where':{'id':_0x147c21[_0xdb97('0x5d')]['id']}})[_0xdb97('0x23')](handleEntityNotFound(_0x3c2bc3,null))[_0xdb97('0x23')](function(_0x56d655){if(_0x56d655){_0x82b437[_0xdb97('0x48')]=_[_0xdb97('0x4a')](db['CannedAnswer']['rawAttributes']);_0x82b437[_0xdb97('0x49')]=_[_0xdb97('0x4a')](_0x147c21['query']);_0x82b437[_0xdb97('0x53')]=_[_0xdb97('0x4c')](_0x82b437['model'],_0x82b437[_0xdb97('0x49')]);_0x450f32[_0xdb97('0x4b')]=_[_0xdb97('0x4c')](_0x82b437['model'],qs[_0xdb97('0x4d')](_0x147c21[_0xdb97('0x49')]['fields']));_0x450f32['attributes']=_0x450f32[_0xdb97('0x4b')]['length']?_0x450f32['attributes']:_0x82b437[_0xdb97('0x48')];if(!_0x147c21[_0xdb97('0x49')]['hasOwnProperty'](_0xdb97('0x4f'))){_0x450f32['limit']=qs['limit'](_0x147c21[_0xdb97('0x49')][_0xdb97('0x30')]);_0x450f32[_0xdb97('0x32')]=qs['offset'](_0x147c21[_0xdb97('0x49')][_0xdb97('0x32')]);}_0x450f32[_0xdb97('0x50')]=qs['sort'](_0x147c21[_0xdb97('0x49')][_0xdb97('0x51')]);_0x450f32[_0xdb97('0x52')]=qs[_0xdb97('0x53')](_[_0xdb97('0x69')](_0x147c21[_0xdb97('0x49')],_0x82b437['filters']));_0x450f32[_0xdb97('0x52')]['MailAccountId']=_0x56d655['id'];if(_0x147c21[_0xdb97('0x49')][_0xdb97('0x54')]){_0x450f32['where']=_['merge'](_0x450f32[_0xdb97('0x52')],{'$or':_[_0xdb97('0x43')](_0x450f32['attributes'],function(_0x4a4be4){var _0x994660={};_0x994660[_0x4a4be4]={'$like':'%'+_0x147c21[_0xdb97('0x49')]['filter']+'%'};return _0x994660;})});}_0x450f32=_['merge']({},_0x450f32,_0x147c21[_0xdb97('0x55')]);return db[_0xdb97('0x6e')][_0xdb97('0x31')]({'where':_0x450f32[_0xdb97('0x52')]})['then'](function(_0x45dbea){_0x184421[_0xdb97('0x31')]=_0x45dbea;if(_0x147c21[_0xdb97('0x49')][_0xdb97('0x57')]){_0x450f32[_0xdb97('0x58')]=[{'all':!![]}];}return db[_0xdb97('0x6e')][_0xdb97('0x59')](_0x450f32);})['then'](function(_0x328890){_0x184421[_0xdb97('0x5a')]=_0x328890;return _0x184421;});}})[_0xdb97('0x23')](respondWithFilteredResult(_0x3c2bc3,_0x450f32))[_0xdb97('0x5b')](handleError(_0x3c2bc3,null));};exports[_0xdb97('0x6f')]=function(_0x5530e2,_0x3ea1b1,_0x56ac0a){return db['MailAccount'][_0xdb97('0x60')]({'where':{'id':_0x5530e2[_0xdb97('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3ea1b1,null))[_0xdb97('0x23')](function(_0x4a809b){if(_0x4a809b){return _0x4a809b['removeAnswers'](_0x5530e2[_0xdb97('0x49')][_0xdb97('0x6b')]);}})[_0xdb97('0x23')](respondWithStatusCode(_0x3ea1b1,null))[_0xdb97('0x5b')](handleError(_0x3ea1b1,null));};exports[_0xdb97('0x66')]=function(_0x22e1b8,_0x48420e){var _0x3ee76c={'name':_0x22e1b8[_0xdb97('0x61')][_0xdb97('0x3d')],'key':_0x22e1b8['body']['key'],'email':_0x22e1b8[_0xdb97('0x61')][_0xdb97('0x70')],'ListId':_0x22e1b8[_0xdb97('0x61')][_0xdb97('0x71')],'active':!_[_0xdb97('0x72')](_0x22e1b8['body'][_0xdb97('0x73')])?_0x22e1b8['body'][_0xdb97('0x73')]:!![],'description':_0x22e1b8[_0xdb97('0x61')][_0xdb97('0x74')]||null,'Imap':{},'Smtp':{}};if(_[_0xdb97('0x72')](_0x22e1b8[_0xdb97('0x61')][_0xdb97('0x75')])){if(_0x22e1b8[_0xdb97('0x61')][_0xdb97('0x76')]){_0x3ee76c[_0xdb97('0x3e')][_0xdb97('0x77')]=_0x3ee76c[_0xdb97('0x40')]['user']=_0x22e1b8['body'][_0xdb97('0x78')];_0x3ee76c['Imap'][_0xdb97('0x79')]=_0x3ee76c[_0xdb97('0x40')][_0xdb97('0x7a')]=_0x22e1b8['body'][_0xdb97('0x7b')];}else{_0x3ee76c['Imap'][_0xdb97('0x7c')]=_0x3ee76c[_0xdb97('0x40')]['authentication']=![];}_0x3ee76c[_0xdb97('0x3e')][_0xdb97('0x7d')]=_0x22e1b8[_0xdb97('0x61')]['Imap'][_0xdb97('0x7d')];_0x3ee76c['Imap'][_0xdb97('0x7e')]=_0x22e1b8[_0xdb97('0x61')]['Imap'][_0xdb97('0x7e')];_0x3ee76c[_0xdb97('0x40')][_0xdb97('0x7d')]=_0x22e1b8[_0xdb97('0x61')]['Smtp'][_0xdb97('0x7d')];_0x3ee76c['Smtp'][_0xdb97('0x7e')]=_0x22e1b8['body'][_0xdb97('0x40')][_0xdb97('0x7e')];}else{_0x3ee76c['Imap'][_0xdb97('0x7f')]=_0x3ee76c[_0xdb97('0x40')]['service']=_0x22e1b8[_0xdb97('0x61')][_0xdb97('0x75')];_0x3ee76c[_0xdb97('0x3e')][_0xdb97('0x77')]=_0x3ee76c[_0xdb97('0x40')]['user']=_0x22e1b8['body'][_0xdb97('0x78')];_0x3ee76c[_0xdb97('0x3e')][_0xdb97('0x79')]=_0x3ee76c[_0xdb97('0x40')][_0xdb97('0x7a')]=_0x22e1b8[_0xdb97('0x61')]['cpassword'];}return db[_0xdb97('0x56')]['create'](_0x3ee76c,{'include':[{'model':db['MailServerOut'],'as':_0xdb97('0x40')},{'model':db[_0xdb97('0x62')],'as':_0xdb97('0x3e')}]})[_0xdb97('0x23')](function(_0xdb0638){var _0x26b564=_0x22e1b8[_0xdb97('0x77')][_0xdb97('0x80')]({'plain':!![]});if(!_0x26b564)throw new Error(_0xdb97('0x81'));if(_0x26b564[_0xdb97('0x82')]===_0xdb97('0x77')){var _0x96006b=_0xdb0638['get']({'plain':!![]});return db[_0xdb97('0x83')]['find']({'where':{'name':_0xdb97('0x84'),'userProfileId':_0x26b564[_0xdb97('0x85')]},'raw':!![]})[_0xdb97('0x23')](function(_0x10a591){if(_0x10a591&&_0x10a591['autoAssociation']===0x0){return db[_0xdb97('0x3a')][_0xdb97('0x66')]({'name':_0x96006b[_0xdb97('0x3d')],'resourceId':_0x96006b['id'],'type':_0x10a591[_0xdb97('0x3d')],'sectionId':_0x10a591['id']},{})[_0xdb97('0x23')](function(){return _0xdb0638;});}else{return _0xdb0638;}})[_0xdb97('0x5b')](function(_0x539e56){logger['error'](_0xdb97('0x86'),_0x539e56);throw _0x539e56;});}return _0xdb0638;})[_0xdb97('0x23')](respondWithResult(_0x48420e,0xc9))['catch'](handleError(_0x48420e,null));};exports[_0xdb97('0x87')]=function(_0x4adb70,_0x18cdf6,_0x11044f){return db[_0xdb97('0x56')][_0xdb97('0x68')]({'where':{'id':_0x4adb70[_0xdb97('0x5d')]['id']}})[_0xdb97('0x23')](handleEntityNotFound(_0x18cdf6,null))[_0xdb97('0x23')](function(_0x4b8366){if(_0x4b8366){return _0x4b8366[_0xdb97('0x87')]();}return null;})[_0xdb97('0x23')](respondWithResult(_0x18cdf6,null))[_0xdb97('0x5b')](handleError(_0x18cdf6,null));};exports['addImap']=function(_0x5cd44d,_0x5dab3e,_0x3ee768){if(_0x5cd44d[_0xdb97('0x61')]['id']){delete _0x5cd44d['body']['id'];}return db[_0xdb97('0x56')][_0xdb97('0x60')]({'where':{'id':_0x5cd44d[_0xdb97('0x5d')]['id']}})[_0xdb97('0x23')](handleEntityNotFound(_0x5dab3e,null))[_0xdb97('0x23')](function(_0x11ddc1){if(_0x11ddc1){_0x5cd44d[_0xdb97('0x61')][_0xdb97('0x6d')]=_0x11ddc1['id'];return db[_0xdb97('0x62')][_0xdb97('0x66')](_0x5cd44d[_0xdb97('0x61')]);}})[_0xdb97('0x23')](respondWithResult(_0x5dab3e,null))[_0xdb97('0x5b')](handleError(_0x5dab3e,null));};exports['removeImap']=function(_0x32b3af,_0x249ff6,_0x374856){return db[_0xdb97('0x56')]['findOne']({'where':{'id':_0x32b3af[_0xdb97('0x5d')]['id']}})['then'](handleEntityNotFound(_0x249ff6,null))[_0xdb97('0x23')](function(_0xb3031b){if(_0xb3031b){return _0xb3031b['setImap'](null);}return null;})[_0xdb97('0x23')](respondWithStatusCode(_0x249ff6,null))[_0xdb97('0x5b')](handleError(_0x249ff6,null));};exports[_0xdb97('0x88')]=function(_0x32536d,_0x5c5dd9,_0xbb6af0){return db[_0xdb97('0x56')][_0xdb97('0x68')]({'where':{'id':_0x32536d['params']['id']}})['then'](handleEntityNotFound(_0x5c5dd9,null))[_0xdb97('0x23')](function(_0x114a04){if(_0x114a04){return _0x114a04['getSmtp']();}return null;})['then'](respondWithResult(_0x5c5dd9,null))[_0xdb97('0x5b')](handleError(_0x5c5dd9,null));};exports[_0xdb97('0x89')]=function(_0x2baea5,_0x3b04fe,_0x32e9c4){if(_0x2baea5[_0xdb97('0x61')]['id']){delete _0x2baea5[_0xdb97('0x61')]['id'];}return db[_0xdb97('0x56')][_0xdb97('0x60')]({'where':{'id':_0x2baea5[_0xdb97('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3b04fe,null))['then'](function(_0x1e02d8){if(_0x1e02d8){_0x2baea5[_0xdb97('0x61')][_0xdb97('0x6d')]=_0x1e02d8['id'];return db['MailServerOut'][_0xdb97('0x66')](_0x2baea5[_0xdb97('0x61')]);}})[_0xdb97('0x23')](respondWithResult(_0x3b04fe,null))[_0xdb97('0x5b')](handleError(_0x3b04fe,null));};exports[_0xdb97('0x8a')]=function(_0x332219,_0xb79bea,_0x7f3569){return db[_0xdb97('0x56')]['findOne']({'where':{'id':_0x332219[_0xdb97('0x5d')]['id']}})[_0xdb97('0x23')](handleEntityNotFound(_0xb79bea,null))[_0xdb97('0x23')](function(_0x1f7992){if(_0x1f7992){return _0x1f7992['setSmtp'](null);}return null;})[_0xdb97('0x23')](respondWithStatusCode(_0xb79bea,null))['catch'](handleError(_0xb79bea,null));};exports['addInteraction']=function(_0x4702d6,_0x3eb15a,_0xe8c626){return db[_0xdb97('0x8b')][_0xdb97('0x60')]({'where':{'id':_0x4702d6['params']['id']}})[_0xdb97('0x23')](handleEntityNotFound(_0x3eb15a,null))[_0xdb97('0x23')](function(_0x48aec1){if(_0x48aec1){return _0x48aec1[_0xdb97('0x8c')](_0x4702d6['body']['ids'],_['omit'](_0x4702d6[_0xdb97('0x61')],[_0xdb97('0x6b'),'id'])||{});}})[_0xdb97('0x23')](respondWithResult(_0x3eb15a,null))[_0xdb97('0x5b')](handleError(_0x3eb15a,null));};exports['getInteractions']=function(_0x4f4151,_0x48171,_0x29b657){var _0x5b2fb5={'raw':![],'where':{}};var _0x8ae7d4={};var _0x3f33f8={'count':0x0,'rows':[]};return db['MailAccount'][_0xdb97('0x68')]({'where':{'id':_0x4f4151['params']['id']}})[_0xdb97('0x23')](handleEntityNotFound(_0x48171,null))[_0xdb97('0x23')](function(_0x30561a){if(_0x30561a){_0x8ae7d4[_0xdb97('0x48')]=_[_0xdb97('0x4a')](db[_0xdb97('0x8b')]['rawAttributes']);_0x8ae7d4[_0xdb97('0x49')]=_[_0xdb97('0x4a')](_0x4f4151[_0xdb97('0x49')]);_0x8ae7d4[_0xdb97('0x53')]=_['intersection'](_0x8ae7d4['model'],_0x8ae7d4[_0xdb97('0x49')]);_0x5b2fb5[_0xdb97('0x4b')]=_[_0xdb97('0x4c')](_0x8ae7d4[_0xdb97('0x48')],qs[_0xdb97('0x4d')](_0x4f4151['query'][_0xdb97('0x4d')]));_0x5b2fb5[_0xdb97('0x4b')]=_0x5b2fb5[_0xdb97('0x4b')][_0xdb97('0x5e')]?_0x5b2fb5[_0xdb97('0x4b')]:_0x8ae7d4[_0xdb97('0x48')];if(!_0x4f4151['query']['hasOwnProperty'](_0xdb97('0x4f'))){_0x5b2fb5[_0xdb97('0x30')]=qs[_0xdb97('0x30')](_0x4f4151['query']['limit']);_0x5b2fb5['offset']=qs[_0xdb97('0x32')](_0x4f4151[_0xdb97('0x49')][_0xdb97('0x32')]);}_0x5b2fb5['order']=qs[_0xdb97('0x51')](_0x4f4151[_0xdb97('0x49')][_0xdb97('0x51')]);_0x5b2fb5[_0xdb97('0x52')]=qs['filters'](_[_0xdb97('0x69')](_0x4f4151[_0xdb97('0x49')],_0x8ae7d4[_0xdb97('0x53')]));_0x5b2fb5[_0xdb97('0x52')][_0xdb97('0x6d')]=_0x30561a['id'];if(_0x4f4151['query'][_0xdb97('0x54')]){_0x5b2fb5[_0xdb97('0x52')]=_[_0xdb97('0x5f')](_0x5b2fb5[_0xdb97('0x52')],{'$or':_[_0xdb97('0x43')](_0x5b2fb5[_0xdb97('0x4b')],function(_0x2e26aa){var _0x320d52={};_0x320d52[_0x2e26aa]={'$like':'%'+_0x4f4151[_0xdb97('0x49')][_0xdb97('0x54')]+'%'};return _0x320d52;})});}_0x5b2fb5=_[_0xdb97('0x5f')]({},_0x5b2fb5,_0x4f4151['options']);return db[_0xdb97('0x8b')][_0xdb97('0x31')]({'where':_0x5b2fb5[_0xdb97('0x52')]})['then'](function(_0x1d4c79){_0x3f33f8[_0xdb97('0x31')]=_0x1d4c79;if(_0x4f4151['query'][_0xdb97('0x57')]){_0x5b2fb5[_0xdb97('0x58')]=[{'model':db[_0xdb97('0x8d')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xdb97('0x3d'),'fullname','internal'],'required':![]},{'model':db[_0xdb97('0x8e')],'as':_0xdb97('0x8f'),'attributes':['id',_0xdb97('0x3d'),_0xdb97('0x90')],'where':_0x4f4151[_0xdb97('0x49')][_0xdb97('0x91')]?{'id':_0x4f4151[_0xdb97('0x49')][_0xdb97('0x91')]}:undefined,'required':_0x4f4151['query']['tag']?!![]:![]}];}return db[_0xdb97('0x8b')][_0xdb97('0x59')](_0x5b2fb5);})[_0xdb97('0x23')](function(_0x22ae98){_0x3f33f8[_0xdb97('0x5a')]=_0x22ae98;return _0x3f33f8;});}})['then'](respondWithFilteredResult(_0x48171,_0x5b2fb5))[_0xdb97('0x5b')](handleError(_0x48171,null));};exports['addApplications']=function addApplications(_0x4d6b87,_0x52fd10){var _0x557d36=_0x4d6b87['params']['id'];var _0x3a4265=_0x4d6b87[_0xdb97('0x61')];var _0x4b22e3=0xc8;var _0x3284d8=null;return db[_0xdb97('0x92')][_0xdb97('0x93')]({'isolationLevel':db[_0xdb97('0x92')][_0xdb97('0x94')][_0xdb97('0x95')]['READ_COMMITTED']},function(_0x4bac00){return db['MailAccount'][_0xdb97('0x68')]({'where':{'id':_0x557d36},'transaction':_0x4bac00})[_0xdb97('0x23')](function(_0x1f7f7c){if(_0x1f7f7c){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0x557d36},'transaction':_0x4bac00})[_0xdb97('0x23')](function(){var _0x236cc9=_[_0xdb97('0x43')](_0x3a4265,function(_0x2d8af6){_0x2d8af6[_0xdb97('0x6d')]=_0x557d36;return _0x2d8af6;});return db[_0xdb97('0x96')]['bulkCreate'](_0x236cc9,{'transaction':_0x4bac00});});}else{_0x4b22e3=0x194;_0x3284d8=[];}});})[_0xdb97('0x23')](function(){if(_0x4b22e3!==0x194){return db[_0xdb97('0x96')]['findAndCountAll']({'where':{'MailAccountId':_0x557d36},'order':_0xdb97('0x97')})[_0xdb97('0x23')](function(_0x691229){_0x3284d8=_0x691229;});}})[_0xdb97('0x5b')](function(_0x5c3f32){_0x4b22e3=0x1f4;logger[_0xdb97('0x29')](_0x5c3f32[_0xdb97('0x98')]);if(_0x5c3f32[_0xdb97('0x3d')]){delete _0x5c3f32['name'];}_0x3284d8=_0x5c3f32;})[_0xdb97('0x99')](function(){if(_0x3284d8===null){_0x52fd10[_0xdb97('0x3c')](_0x4b22e3);}else{if(_0x4b22e3===0x1f4){_0x52fd10[_0xdb97('0x2d')](_0x4b22e3)[_0xdb97('0x9a')](_0x3284d8);}else{_0x52fd10[_0xdb97('0x2d')](_0x4b22e3)[_0xdb97('0x2e')](_0x3284d8);}}});};exports['getApplications']=function(_0x3574d0,_0x2104f5,_0x46abb2){var _0xe6e1c1={};var _0x3c306f={};var _0x14fe5a;var _0x4519aa;return db[_0xdb97('0x56')][_0xdb97('0x68')]({'where':{'id':_0x3574d0[_0xdb97('0x5d')]['id']}})[_0xdb97('0x23')](handleEntityNotFound(_0x2104f5,null))['then'](function(_0x541776){if(_0x541776){_0x14fe5a=_0x541776;_0x3c306f['model']=_[_0xdb97('0x4a')](db[_0xdb97('0x96')][_0xdb97('0x44')]);_0x3c306f[_0xdb97('0x49')]=_[_0xdb97('0x4a')](_0x3574d0['query']);_0x3c306f[_0xdb97('0x53')]=_[_0xdb97('0x4c')](_0x3c306f[_0xdb97('0x48')],_0x3c306f['query']);_0xe6e1c1[_0xdb97('0x4b')]=_[_0xdb97('0x4c')](_0x3c306f[_0xdb97('0x48')],qs[_0xdb97('0x4d')](_0x3574d0[_0xdb97('0x49')]['fields']));_0xe6e1c1[_0xdb97('0x4b')]=_0xe6e1c1['attributes'][_0xdb97('0x5e')]?_0xe6e1c1[_0xdb97('0x4b')]:_0x3c306f['model'];_0xe6e1c1['order']=qs[_0xdb97('0x51')](_0x3574d0[_0xdb97('0x49')][_0xdb97('0x51')]);_0xe6e1c1[_0xdb97('0x52')]=qs['filters'](_[_0xdb97('0x69')](_0x3574d0['query'],_0x3c306f[_0xdb97('0x53')]));if(_0x3574d0[_0xdb97('0x49')][_0xdb97('0x54')]){_0xe6e1c1['where']=_[_0xdb97('0x5f')](_0xe6e1c1['where'],{'$or':_[_0xdb97('0x43')](_0xe6e1c1['attributes'],function(_0x44f55a){var _0x363278={};_0x363278[_0x44f55a]={'$like':'%'+_0x3574d0[_0xdb97('0x49')][_0xdb97('0x54')]+'%'};return _0x363278;})});}_0xe6e1c1=_[_0xdb97('0x5f')]({},_0xe6e1c1,_0x3574d0[_0xdb97('0x55')]);return _0x14fe5a[_0xdb97('0x9b')](_0xe6e1c1);}})[_0xdb97('0x23')](function(_0x4f7bab){if(_0x4f7bab){_0x4519aa=_0x4f7bab[_0xdb97('0x5e')];if(!_0x3574d0[_0xdb97('0x49')]['hasOwnProperty'](_0xdb97('0x4f'))){_0xe6e1c1[_0xdb97('0x30')]=qs[_0xdb97('0x30')](_0x3574d0[_0xdb97('0x49')][_0xdb97('0x30')]);_0xe6e1c1[_0xdb97('0x32')]=qs[_0xdb97('0x32')](_0x3574d0[_0xdb97('0x49')][_0xdb97('0x32')]);}return _0x14fe5a[_0xdb97('0x9b')](_0xe6e1c1);}})[_0xdb97('0x23')](function(_0x52cd10){if(_0x52cd10){return _0x52cd10?{'count':_0x4519aa,'rows':_0x52cd10}:null;}})[_0xdb97('0x23')](respondWithResult(_0x2104f5,null))[_0xdb97('0x5b')](handleError(_0x2104f5,null));};exports[_0xdb97('0x9c')]=function(_0x558feb,_0x5eb81e,_0x16fdf2){var _0x2b5809={'raw':!![],'where':{}};var _0x325c01={};var _0x4e0c4d={'count':0x0,'rows':[]};return db[_0xdb97('0x56')]['findOne']({'where':{'id':_0x558feb[_0xdb97('0x5d')]['id']}})['then'](handleEntityNotFound(_0x5eb81e,null))['then'](function(_0x2f7b3a){if(_0x2f7b3a){_0x325c01[_0xdb97('0x48')]=_[_0xdb97('0x4a')](db[_0xdb97('0x9d')][_0xdb97('0x44')]);_0x325c01['query']=_[_0xdb97('0x4a')](_0x558feb['query']);_0x325c01['filters']=_[_0xdb97('0x4c')](_0x325c01[_0xdb97('0x48')],_0x325c01['query']);_0x2b5809[_0xdb97('0x4b')]=_[_0xdb97('0x4c')](_0x325c01['model'],qs[_0xdb97('0x4d')](_0x558feb[_0xdb97('0x49')][_0xdb97('0x4d')]));_0x2b5809[_0xdb97('0x4b')]=_0x2b5809[_0xdb97('0x4b')][_0xdb97('0x5e')]?_0x2b5809[_0xdb97('0x4b')]:_0x325c01[_0xdb97('0x48')];if(!_0x558feb[_0xdb97('0x49')]['hasOwnProperty'](_0xdb97('0x4f'))){_0x2b5809[_0xdb97('0x30')]=qs[_0xdb97('0x30')](_0x558feb[_0xdb97('0x49')][_0xdb97('0x30')]);_0x2b5809[_0xdb97('0x32')]=qs[_0xdb97('0x32')](_0x558feb[_0xdb97('0x49')][_0xdb97('0x32')]);}_0x2b5809[_0xdb97('0x50')]=qs[_0xdb97('0x51')](_0x558feb[_0xdb97('0x49')][_0xdb97('0x51')]);_0x2b5809[_0xdb97('0x52')]=qs[_0xdb97('0x53')](_[_0xdb97('0x69')](_0x558feb[_0xdb97('0x49')],_0x325c01[_0xdb97('0x53')]));_0x2b5809[_0xdb97('0x52')][_0xdb97('0x6d')]=_0x2f7b3a['id'];if(_0x558feb[_0xdb97('0x49')][_0xdb97('0x54')]){_0x2b5809[_0xdb97('0x52')]=_[_0xdb97('0x5f')](_0x2b5809[_0xdb97('0x52')],{'$or':_[_0xdb97('0x43')](_0x2b5809['attributes'],function(_0x1aae16){var _0x23658e={};_0x23658e[_0x1aae16]={'$like':'%'+_0x558feb[_0xdb97('0x49')][_0xdb97('0x54')]+'%'};return _0x23658e;})});}if(_0x558feb[_0xdb97('0x49')][_0xdb97('0x9e')]){var _0x1e4e2d=_0x558feb[_0xdb97('0x49')]['$gte'][_0xdb97('0x9f')](',');var _0x1303e8={};_0x1303e8[_0x1e4e2d[0x0]]={'$gte':moment(_0x1e4e2d[0x1])[_0xdb97('0xa0')](_0xdb97('0xa1'))};_0x2b5809[_0xdb97('0x52')]=_[_0xdb97('0x5f')](_0x2b5809[_0xdb97('0x52')],_0x1303e8);}_0x2b5809=_[_0xdb97('0x5f')]({},_0x2b5809,_0x558feb[_0xdb97('0x55')]);return db[_0xdb97('0x9d')][_0xdb97('0x31')]({'where':_0x2b5809[_0xdb97('0x52')]})[_0xdb97('0x23')](function(_0x1e2c1f){_0x4e0c4d['count']=_0x1e2c1f;if(_0x558feb[_0xdb97('0x49')][_0xdb97('0x57')]){_0x2b5809[_0xdb97('0x58')]=[{'all':!![]}];}return db[_0xdb97('0x9d')][_0xdb97('0x59')](_0x2b5809);})['then'](function(_0x5c0151){if(_0x558feb[_0xdb97('0x49')][_0xdb97('0xa2')]===_0xdb97('0xa3')){for(var _0x2f9873=0x0;_0x2f9873<_0x5c0151[_0xdb97('0x5e')];_0x2f9873++){_0x5c0151[_0x2f9873][_0xdb97('0x61')]=juice(_0x5c0151[_0x2f9873][_0xdb97('0x61')]);}}_0x4e0c4d[_0xdb97('0x5a')]=_0x5c0151;return _0x4e0c4d;});}})['then'](respondWithFilteredResult(_0x5eb81e,_0x2b5809))[_0xdb97('0x5b')](handleError(_0x5eb81e,null));};exports['send']=function(_0x1f90a2,_0x3a22c3,_0x621166){var _0x19b3d1,_0x59f2b0={},_0x281258;if(_0x1f90a2[_0xdb97('0x61')]['to']){_0x281258=_0x1f90a2[_0xdb97('0x61')]['to'][_0xdb97('0x9f')](',')[0x0];}return db[_0xdb97('0x56')]['find']({'where':{'id':_0x1f90a2[_0xdb97('0x5d')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xdb97('0x8d')],'as':_0xdb97('0xa4'),'where':{'email':_0x281258},'limit':0x1,'order':[[_0xdb97('0xa5'),_0xdb97('0xa6')]]}]},{'model':db[_0xdb97('0x3f')],'as':_0xdb97('0x40'),'raw':!![]}]})[_0xdb97('0x23')](handleEntityNotFound(_0x3a22c3,null))[_0xdb97('0x23')](function(_0x6c082){if(_0x6c082){_0x19b3d1=_0x6c082;if(_0x6c082[_0xdb97('0x40')]){if(_[_0xdb97('0x72')](_0x1f90a2['body'][_0xdb97('0xa7')])){_0x1f90a2[_0xdb97('0x61')][_0xdb97('0xa7')]=util['format'](_0xdb97('0xa8'),_0x6c082[_0xdb97('0x3d')],_0x6c082[_0xdb97('0x70')]||_0x6c082[_0xdb97('0x40')][_0xdb97('0x77')]);}if(_0x1f90a2[_0xdb97('0x61')]['attachments']&&_0x1f90a2['body'][_0xdb97('0xa9')][_0xdb97('0x5e')]){for(var _0x49d6be=0x0;_0x49d6be<_0x1f90a2[_0xdb97('0x61')][_0xdb97('0xa9')][_0xdb97('0x5e')];_0x49d6be+=0x1){_0x1f90a2['body']['attachments'][_0x49d6be]={'filename':_0x1f90a2[_0xdb97('0x61')][_0xdb97('0xa9')][_0x49d6be][_0xdb97('0x3d')],'path':path['join'](config[_0xdb97('0xaa')],'server/files/attachments',_0x1f90a2['body'][_0xdb97('0xa9')][_0x49d6be]['basename'])};}}var _0x4d4725={'tls':{'rejectUnauthorized':![]}};if(_[_0xdb97('0x72')](_0x6c082[_0xdb97('0x40')][_0xdb97('0x7f')])){if(_0x6c082['Smtp'][_0xdb97('0x7c')]){_0x4d4725['auth']={'user':_0x6c082[_0xdb97('0x40')]['user'],'pass':_0x6c082[_0xdb97('0x40')][_0xdb97('0x7a')]};}_0x4d4725['host']=_0x6c082['Smtp'][_0xdb97('0x7d')];_0x4d4725[_0xdb97('0x7e')]=_0x6c082[_0xdb97('0x40')][_0xdb97('0x7e')];_0x4d4725['secure']=_0x6c082[_0xdb97('0x40')][_0xdb97('0xab')];}else{_0x4d4725[_0xdb97('0x7f')]=_0x6c082[_0xdb97('0x40')]['service'];_0x4d4725['auth']={'user':_0x6c082[_0xdb97('0x40')][_0xdb97('0x77')],'pass':_0x6c082[_0xdb97('0x40')][_0xdb97('0x7a')]};}return respondWithRpcPromise(_0xdb97('0xac'),_0xdb97('0xad'),{'account':_0x4d4725,'message':_0x1f90a2[_0xdb97('0x61')]});}else{throw new Error('List\x20not\x20found');}}})[_0xdb97('0x23')](function(_0x238559){if(_0x238559){_0x59f2b0=_0x238559;if(_0x19b3d1['List']){if(_0x19b3d1[_0xdb97('0xae')][_0xdb97('0xa4')][_0xdb97('0x5e')]){return _0x19b3d1['List'][_0xdb97('0xa4')][0x0];}else{return db[_0xdb97('0x8d')]['create'](_[_0xdb97('0x1b')](_0x1f90a2['body'],{'firstName':_0x1f90a2[_0xdb97('0x61')]['to'],'email':_0x1f90a2['body']['to'],'phone':_0x1f90a2[_0xdb97('0x61')]['to'],'ListId':_0x19b3d1[_0xdb97('0x71')]}));}}else{throw new Error(_0xdb97('0xaf'));}}})['then'](function(_0x17b9c7){if(_0x17b9c7){var _0x4d6078={'UserId':_0x1f90a2[_0xdb97('0x77')]['id'],'ContactId':_0x17b9c7['id'],'MailAccountId':_0x19b3d1['id'],'inReplyTo':_0x59f2b0[_0xdb97('0xb0')],'to':_0x1f90a2[_0xdb97('0x61')][_0xdb97('0xa7')],'cc':_0x1f90a2[_0xdb97('0x61')]['cc'],'subject':_0x1f90a2[_0xdb97('0x61')][_0xdb97('0xb1')],'attach':_0x1f90a2[_0xdb97('0x61')][_0xdb97('0xb2')],'firstMsgDirection':_0xdb97('0xb3'),'lastMsgAt':moment()[_0xdb97('0xa0')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xdb97('0xb3'),'Messages':[_[_0xdb97('0x5f')](_0x1f90a2[_0xdb97('0x61')],{'messageId':_0x59f2b0[_0xdb97('0xb0')],'sentAt':moment()['format'](_0xdb97('0xa1')),'read':!![],'MailAccountId':_0x19b3d1['id'],'UserId':_0x1f90a2['user']['id'],'ContactId':_0x17b9c7['id']})]};if(_0x1f90a2['body']['Interaction']){_0x4d6078=_[_0xdb97('0x5f')](_0x4d6078,_0x1f90a2[_0xdb97('0x61')][_0xdb97('0xb4')]);}return db[_0xdb97('0x8b')][_0xdb97('0x66')](_0x4d6078,{'include':[{'model':db[_0xdb97('0x9d')],'as':'Messages'}]});}})['then'](respondWithResult(_0x3a22c3,null))['catch'](handleError(_0x3a22c3,null));};exports['verifySmtp']=function(_0x43addb,_0x22b04a,_0x173b5b){return db[_0xdb97('0x56')][_0xdb97('0x60')]({'where':{'id':_0x43addb[_0xdb97('0x5d')]['id']},'include':[{'model':db[_0xdb97('0x3f')],'as':_0xdb97('0x40'),'raw':!![]}]})[_0xdb97('0x23')](handleEntityNotFound(_0x22b04a,null))[_0xdb97('0x23')](function(_0x3c227d){if(_0x3c227d&&_0x3c227d['Smtp']){var _0x10119c={'id':_0x3c227d['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3c227d[_0xdb97('0x40')][_0xdb97('0x7f')]){_0x10119c[_0xdb97('0x7f')]=_0x3c227d[_0xdb97('0x40')][_0xdb97('0x7f')];}else{_0x10119c['host']=_0x3c227d[_0xdb97('0x40')][_0xdb97('0x7d')];_0x10119c[_0xdb97('0x7e')]=_0x3c227d[_0xdb97('0x40')][_0xdb97('0x7e')];_0x10119c[_0xdb97('0xab')]=_0x3c227d[_0xdb97('0x40')][_0xdb97('0xab')];}if(_0x3c227d[_0xdb97('0x40')]['authentication']){_0x10119c[_0xdb97('0xb5')]={'user':_0x3c227d[_0xdb97('0x40')][_0xdb97('0x77')],'pass':_0x3c227d[_0xdb97('0x40')][_0xdb97('0x7a')]};}return respondWithRpcPromise(_0xdb97('0xb6'),_0xdb97('0xb7'),{'account':_0x10119c});}})[_0xdb97('0x23')](respondWithResult(_0x22b04a,null))[_0xdb97('0x5b')](handleError(_0x22b04a,null));};exports['destroy']=function(_0x4b030b,_0x1a3989){return db[_0xdb97('0x56')]['find']({'where':{'id':_0x4b030b[_0xdb97('0x5d')]['id']}})[_0xdb97('0x23')](handleEntityNotFound(_0x1a3989,null))['then'](function(_0x522f27){if(_0x522f27&&_0x522f27[_0xdb97('0x7f')]){throw new db['Sequelize'][(_0xdb97('0xb8'))](_0xdb97('0xb9'));}return _0x522f27;})[_0xdb97('0x23')](removeEntity(_0x1a3989,null))[_0xdb97('0x5b')](handleError(_0x1a3989,null));};exports[_0xdb97('0xba')]=function(_0x2688e5,_0x1046cc,_0x3af246){return db[_0xdb97('0x56')][_0xdb97('0x60')]({'where':{'id':_0x2688e5[_0xdb97('0x5d')]['id']}})[_0xdb97('0x23')](handleEntityNotFound(_0x1046cc,null))[_0xdb97('0x23')](function(_0x4ef0df){if(_0x4ef0df){return _0x4ef0df[_0xdb97('0xba')](_0x2688e5[_0xdb97('0x61')][_0xdb97('0x6b')],_[_0xdb97('0xbb')](_0x2688e5[_0xdb97('0x61')],[_0xdb97('0x6b'),'id'])||{})[_0xdb97('0xbc')](function(_0x2c658e){for(var _0x452507=0x0;_0x452507<_0x2688e5[_0xdb97('0x61')][_0xdb97('0x6b')][_0xdb97('0x5e')];_0x452507+=0x1){socket[_0xdb97('0xbd')](_0xdb97('0xbe'),{'UserId':Number(_0x2688e5[_0xdb97('0x61')][_0xdb97('0x6b')][_0x452507]),'MailAccountId':Number(_0x2688e5[_0xdb97('0x5d')]['id'])});}return _0x2c658e;});}})[_0xdb97('0x23')](respondWithResult(_0x1046cc,null))[_0xdb97('0x5b')](handleError(_0x1046cc,null));};exports[_0xdb97('0xbf')]=function(_0x24d65f,_0x3317dd,_0x4b2763){return db[_0xdb97('0x56')][_0xdb97('0x60')]({'where':{'id':_0x24d65f[_0xdb97('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3317dd,null))['then'](function(_0x5121db){if(_0x5121db){return _0x5121db[_0xdb97('0xbf')](_0x24d65f[_0xdb97('0x49')][_0xdb97('0x6b')])[_0xdb97('0x23')](function(){if(_[_0xdb97('0xc0')](_0x24d65f[_0xdb97('0x49')]['ids'])){for(var _0x520619=0x0;_0x520619<_0x24d65f[_0xdb97('0x49')]['ids'][_0xdb97('0x5e')];_0x520619+=0x1){socket['emit'](_0xdb97('0xc1'),{'UserId':Number(_0x24d65f[_0xdb97('0x49')][_0xdb97('0x6b')][_0x520619]),'MailAccountId':Number(_0x24d65f['params']['id'])});}}else{socket['emit'](_0xdb97('0xc1'),{'UserId':Number(_0x24d65f[_0xdb97('0x49')][_0xdb97('0x6b')]),'MailAccountId':Number(_0x24d65f[_0xdb97('0x5d')]['id'])});}});}})[_0xdb97('0x23')](respondWithStatusCode(_0x3317dd,null))['catch'](handleError(_0x3317dd,null));};exports[_0xdb97('0xc2')]=function(_0x2bdf2b,_0x2d8956,_0xe5a79b){var _0x13505c={};var _0x4edae4={};var _0x1af150;var _0x22a3ae;return db[_0xdb97('0x56')][_0xdb97('0x68')]({'where':{'id':_0x2bdf2b['params']['id']}})[_0xdb97('0x23')](handleEntityNotFound(_0x2d8956,null))[_0xdb97('0x23')](function(_0x257351){if(_0x257351){_0x1af150=_0x257351;_0x4edae4[_0xdb97('0x48')]=_[_0xdb97('0x4a')](db['User'][_0xdb97('0x44')]);_0x4edae4[_0xdb97('0x49')]=_[_0xdb97('0x4a')](_0x2bdf2b[_0xdb97('0x49')]);_0x4edae4[_0xdb97('0x53')]=_[_0xdb97('0x4c')](_0x4edae4[_0xdb97('0x48')],_0x4edae4[_0xdb97('0x49')]);_0x13505c['attributes']=_[_0xdb97('0x4c')](_0x4edae4[_0xdb97('0x48')],qs[_0xdb97('0x4d')](_0x2bdf2b['query']['fields']));_0x13505c[_0xdb97('0x4b')]=_0x13505c[_0xdb97('0x4b')][_0xdb97('0x5e')]?_0x13505c['attributes']:_0x4edae4[_0xdb97('0x48')];_0x13505c['order']=qs[_0xdb97('0x51')](_0x2bdf2b[_0xdb97('0x49')]['sort']);_0x13505c[_0xdb97('0x52')]=qs[_0xdb97('0x53')](_[_0xdb97('0x69')](_0x2bdf2b[_0xdb97('0x49')],_0x4edae4[_0xdb97('0x53')]));if(_0x2bdf2b['query'][_0xdb97('0x54')]){_0x13505c[_0xdb97('0x52')]=_[_0xdb97('0x5f')](_0x13505c[_0xdb97('0x52')],{'$or':_[_0xdb97('0x43')](_0x13505c[_0xdb97('0x4b')],function(_0x17c1c8){var _0x3d37d0={};_0x3d37d0[_0x17c1c8]={'$like':'%'+_0x2bdf2b[_0xdb97('0x49')][_0xdb97('0x54')]+'%'};return _0x3d37d0;})});}_0x13505c=_[_0xdb97('0x5f')]({},_0x13505c,_0x2bdf2b['options']);return _0x1af150[_0xdb97('0xc2')](_0x13505c);}})[_0xdb97('0x23')](function(_0x23acbc){if(_0x23acbc){_0x22a3ae=_0x23acbc['length'];if(!_0x2bdf2b[_0xdb97('0x49')]['hasOwnProperty']('nolimit')){_0x13505c['limit']=qs[_0xdb97('0x30')](_0x2bdf2b['query'][_0xdb97('0x30')]);_0x13505c[_0xdb97('0x32')]=qs['offset'](_0x2bdf2b['query']['offset']);}return _0x1af150[_0xdb97('0xc2')](_0x13505c);}})['then'](function(_0xcec041){if(_0xcec041){return _0xcec041?{'count':_0x22a3ae,'rows':_0xcec041}:null;}})['then'](respondWithResult(_0x2d8956,null))[_0xdb97('0x5b')](handleError(_0x2d8956,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 34120ab..6154076 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 _0xa8f3=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','save'];(function(_0x387987,_0xd3c5a1){var _0x523042=function(_0x562167){while(--_0x562167){_0x387987['push'](_0x387987['shift']());}};_0x523042(++_0xd3c5a1);}(_0xa8f3,0xc1));var _0x3a8f=function(_0xb36288,_0x102f2e){_0xb36288=_0xb36288-0x0;var _0x28f1b6=_0xa8f3[_0xb36288];return _0x28f1b6;};'use strict';var EventEmitter=require(_0x3a8f('0x0'));var MailAccount=require(_0x3a8f('0x1'))['db'][_0x3a8f('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x3a8f('0x3')](0x0);var events={'afterCreate':_0x3a8f('0x4'),'afterUpdate':_0x3a8f('0x5'),'afterDestroy':_0x3a8f('0x6')};function emitEvent(_0x16c044){return function(_0x14bd62,_0x341a8f,_0x714540){MailAccountEvents[_0x3a8f('0x7')](_0x16c044+':'+_0x14bd62['id'],_0x14bd62);MailAccountEvents[_0x3a8f('0x7')](_0x16c044,_0x14bd62);_0x714540(null);};}for(var e in events){if(events[_0x3a8f('0x8')](e)){var event=events[e];MailAccount[_0x3a8f('0x9')](e,emitEvent(event));}}module[_0x3a8f('0xa')]=MailAccountEvents; \ No newline at end of file +var _0x3d41=['../../mysqldb','MailAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x3d41,0xea));var _0x13d4=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x3d41[_0x465028];return _0xb783d4;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x13d4('0x0'))['db'][_0x13d4('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x13d4('0x2')](0x0);var events={'afterCreate':_0x13d4('0x3'),'afterUpdate':_0x13d4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4bfcac){return function(_0x1162f2,_0x2c05f1,_0x52bd3e){MailAccountEvents[_0x13d4('0x5')](_0x4bfcac+':'+_0x1162f2['id'],_0x1162f2);MailAccountEvents[_0x13d4('0x5')](_0x4bfcac,_0x1162f2);_0x52bd3e(null);};}for(var e in events){if(events[_0x13d4('0x6')](e)){var event=events[e];MailAccount[_0x13d4('0x7')](e,emitEvent(event));}}module[_0x13d4('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 2eb2c7c..2e12ca2 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 _0xa002=['moment','request-promise','rimraf','../../config/environment','define','mail_accounts','lodash','util','api'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xa002,0xc3));var _0x2a00=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xa002[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x2a00('0x0'));var util=require(_0x2a00('0x1'));var logger=require('../../config/logger')(_0x2a00('0x2'));var moment=require(_0x2a00('0x3'));var BPromise=require('bluebird');var rp=require(_0x2a00('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a00('0x5'));var config=require(_0x2a00('0x6'));var attributes=require('./mailAccount.attributes');module['exports']=function(_0x22f1bc,_0x4a65fe){return _0x22f1bc[_0x2a00('0x7')]('MailAccount',attributes,{'tableName':_0x2a00('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5975=['mail_accounts','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x516ffb,_0x5b5b42){var _0x319667=function(_0x250098){while(--_0x250098){_0x516ffb['push'](_0x516ffb['shift']());}};_0x319667(++_0x5b5b42);}(_0x5975,0x191));var _0x5597=function(_0x310f6b,_0x188bfa){_0x310f6b=_0x310f6b-0x0;var _0x2a645b=_0x5975[_0x310f6b];return _0x2a645b;};'use strict';var _=require(_0x5597('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5597('0x1'));var moment=require('moment');var BPromise=require(_0x5597('0x2'));var rp=require(_0x5597('0x3'));var fs=require('fs');var path=require(_0x5597('0x4'));var rimraf=require(_0x5597('0x5'));var config=require(_0x5597('0x6'));var attributes=require('./mailAccount.attributes');module[_0x5597('0x7')]=function(_0x2a84fc,_0x273b4d){return _0x2a84fc[_0x5597('0x8')]('MailAccount',attributes,{'tableName':_0x5597('0x9'),'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 2a890a2..16d06dc 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 _0xa9fd=['request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','model','stringify','ShowMailAccount','find','map','debug','body','mail','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','CmList','List','CmContact','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','omit','applications','list','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','MailInteraction','MailMessage','Messages','inReplyTo','update','YYYY-MM-DD\x20HH:mm:ss','interaction','get','created','attachments','originTo','bcc','ChatWebsiteId','originChannel','Email','Attachment','Attachments','User','name','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','defaults','./mailAccount.socket','register','then','info','MailAccount,\x20%s,\x20%s'];(function(_0x5e5ff4,_0x535669){var _0x1e640e=function(_0x85c3c2){while(--_0x85c3c2){_0x5e5ff4['push'](_0x5e5ff4['shift']());}};_0x1e640e(++_0x535669);}(_0xa9fd,0xc5));var _0xda9f=function(_0x203211,_0xff152f){_0x203211=_0x203211-0x0;var _0x644339=_0xa9fd[_0x203211];return _0x644339;};'use strict';var _=require(_0xda9f('0x0'));var util=require(_0xda9f('0x1'));var moment=require(_0xda9f('0x2'));var BPromise=require(_0xda9f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda9f('0x4'));var db=require(_0xda9f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xda9f('0x6'))(_0xda9f('0x7'));var config=require('../../config/environment');var jayson=require(_0xda9f('0x8'));var client=jayson[_0xda9f('0x9')]['http']({'port':0x232c});config[_0xda9f('0xa')]=_[_0xda9f('0xb')](config[_0xda9f('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xda9f('0xc'))[_0xda9f('0xd')](socket);function respondWithRpcPromise(_0x508861,_0x443b28,_0x3ce439){return new BPromise(function(_0x1d02a8,_0x28f9b5){return client['request'](_0x508861,_0x3ce439)[_0xda9f('0xe')](function(_0xee7e55){logger[_0xda9f('0xf')](_0xda9f('0x10'),_0x443b28,_0xda9f('0x11'));logger['debug'](_0xda9f('0x12'),_0x443b28,_0xda9f('0x11'),JSON['stringify'](_0xee7e55));if(_0xee7e55[_0xda9f('0x13')]){if(_0xee7e55[_0xda9f('0x13')][_0xda9f('0x14')]===0x1f4){logger[_0xda9f('0x13')]('MailAccount,\x20%s,\x20%s',_0x443b28,_0xee7e55[_0xda9f('0x13')][_0xda9f('0x15')]);return _0x28f9b5(_0xee7e55['error'][_0xda9f('0x15')]);}logger[_0xda9f('0x13')]('MailAccount,\x20%s,\x20%s',_0x443b28,_0xee7e55[_0xda9f('0x13')][_0xda9f('0x15')]);return _0x1d02a8(_0xee7e55[_0xda9f('0x13')]['message']);}else{logger['info'](_0xda9f('0x10'),_0x443b28,_0xda9f('0x11'));_0x1d02a8(_0xee7e55[_0xda9f('0x16')][_0xda9f('0x15')]);}})[_0xda9f('0x17')](function(_0x3bbb72){logger['error'](_0xda9f('0x10'),_0x443b28,_0x3bbb72);_0x28f9b5(_0x3bbb72);});});}exports[_0xda9f('0x18')]=function(_0x2cf170){var _0x5f29ff=this;return new Promise(function(_0x35a7fb,_0x5739bb){return db[_0xda9f('0x19')][_0xda9f('0x1a')]({'raw':_0x2cf170['options']?_0x2cf170[_0xda9f('0x1b')][_0xda9f('0x1c')]===undefined?!![]:![]:!![],'where':_0x2cf170[_0xda9f('0x1b')]?_0x2cf170[_0xda9f('0x1b')][_0xda9f('0x1d')]||null:null,'attributes':_0x2cf170[_0xda9f('0x1b')]?_0x2cf170[_0xda9f('0x1b')][_0xda9f('0x1e')]||null:null,'limit':_0x2cf170[_0xda9f('0x1b')]?_0x2cf170[_0xda9f('0x1b')][_0xda9f('0x1f')]||null:null,'include':_0x2cf170[_0xda9f('0x1b')]?_0x2cf170[_0xda9f('0x1b')][_0xda9f('0x20')]?_['map'](_0x2cf170[_0xda9f('0x1b')][_0xda9f('0x20')],function(_0x421104){return{'model':db[_0x421104[_0xda9f('0x21')]],'as':_0x421104['as'],'attributes':_0x421104[_0xda9f('0x1e')],'include':_0x421104[_0xda9f('0x20')]?_['map'](_0x421104[_0xda9f('0x20')],function(_0x5d5fea){return{'model':db[_0x5d5fea[_0xda9f('0x21')]],'as':_0x5d5fea['as'],'attributes':_0x5d5fea[_0xda9f('0x1e')],'include':_0x5d5fea[_0xda9f('0x20')]?_['map'](_0x5d5fea['include'],function(_0x10c538){return{'model':db[_0x10c538[_0xda9f('0x21')]],'as':_0x10c538['as'],'attributes':_0x10c538['attributes']};}):[]};}):[]};}):[]:[]})[_0xda9f('0xe')](function(_0xa6064d){logger['info']('GetMailAccount',_0x2cf170);logger['debug'](_0xda9f('0x18'),_0x2cf170,JSON[_0xda9f('0x22')](_0xa6064d));_0x35a7fb(_0xa6064d);})[_0xda9f('0x17')](function(_0x15d27e){logger[_0xda9f('0x13')](_0xda9f('0x18'),_0x15d27e[_0xda9f('0x15')],_0x2cf170);_0x5739bb(_0x5f29ff[_0xda9f('0x13')](0x1f4,_0x15d27e[_0xda9f('0x15')]));});});};exports[_0xda9f('0x23')]=function(_0x152816){var _0x5db6c3=this;return new Promise(function(_0xbb96ea,_0x18596b){return db[_0xda9f('0x19')][_0xda9f('0x24')]({'raw':_0x152816[_0xda9f('0x1b')]?_0x152816['options']['raw']===undefined?!![]:![]:!![],'where':_0x152816[_0xda9f('0x1b')]?_0x152816[_0xda9f('0x1b')][_0xda9f('0x1d')]||null:null,'attributes':_0x152816['options']?_0x152816[_0xda9f('0x1b')][_0xda9f('0x1e')]||null:null,'include':_0x152816[_0xda9f('0x1b')]?_0x152816[_0xda9f('0x1b')]['include']?_[_0xda9f('0x25')](_0x152816[_0xda9f('0x1b')][_0xda9f('0x20')],function(_0x1de143){return{'model':db[_0x1de143[_0xda9f('0x21')]],'as':_0x1de143['as'],'attributes':_0x1de143[_0xda9f('0x1e')],'include':_0x1de143[_0xda9f('0x20')]?_[_0xda9f('0x25')](_0x1de143[_0xda9f('0x20')],function(_0x15a27e){return{'model':db[_0x15a27e[_0xda9f('0x21')]],'as':_0x15a27e['as'],'attributes':_0x15a27e[_0xda9f('0x1e')],'include':_0x15a27e[_0xda9f('0x20')]?_[_0xda9f('0x25')](_0x15a27e[_0xda9f('0x20')],function(_0x3d0851){return{'model':db[_0x3d0851['model']],'as':_0x3d0851['as'],'attributes':_0x3d0851[_0xda9f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xda9f('0xe')](function(_0x2007bf){logger[_0xda9f('0xf')](_0xda9f('0x23'),_0x152816);logger[_0xda9f('0x26')](_0xda9f('0x23'),_0x152816,JSON[_0xda9f('0x22')](_0x2007bf));_0xbb96ea(_0x2007bf);})[_0xda9f('0x17')](function(_0x52eee1){logger[_0xda9f('0x13')](_0xda9f('0x23'),_0x52eee1['message'],_0x152816);_0x18596b(_0x5db6c3[_0xda9f('0x13')](0x1f4,_0x52eee1['message']));});});};exports['NotifyMailAccount']=function(_0x728460){var _0x2be886=this;return new Promise(function(_0x1f7563,_0x5208d7){var _0x1c9ae5={'body':_0x728460[_0xda9f('0x27')],'channel':_0xda9f('0x28')};var _0x49dea0=_[_0xda9f('0x29')](_['keys'](db['CmContact']['rawAttributes']),[_0xda9f('0x2a'),_0xda9f('0x2b'),_0xda9f('0x2c'),_0xda9f('0x2d')]);var _0xc7c3d5=![];if(_0x728460['body']['id']){delete _0x728460['body']['id'];}if(_['isNil'](_0x728460[_0xda9f('0x27')]['from'])){return _0x5208d7(_0x2be886['error'](0x1f4,_0xda9f('0x2e')));}if(_[_0xda9f('0x2f')](_0x728460[_0xda9f('0x27')][_0xda9f('0x27')])||_0x728460[_0xda9f('0x27')][_0xda9f('0x27')]===''){return _0x5208d7(_0x2be886['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xda9f('0x2f')](_0x728460[_0xda9f('0x27')]['mapKey'])){return _0x5208d7(_0x2be886[_0xda9f('0x13')](0x1f4,_0xda9f('0x30')+_0x49dea0));}if(!_[_0xda9f('0x31')](_0x49dea0,_0x728460[_0xda9f('0x27')][_0xda9f('0x32')])){return _0x5208d7(_0x2be886[_0xda9f('0x13')](0x1f4,_0xda9f('0x33')+_0x49dea0));}var _0x1e313e={};_0x1e313e[_0x728460[_0xda9f('0x27')][_0xda9f('0x32')]]=_0x728460[_0xda9f('0x27')][_0xda9f('0x34')];return db['MailAccount'][_0xda9f('0x24')]({'where':{'id':_0x728460[_0xda9f('0x35')]['id']},'include':[{'model':db[_0xda9f('0x36')],'as':_0xda9f('0x37'),'include':[{'model':db[_0xda9f('0x38')],'as':_0xda9f('0x39'),'where':_0x1e313e,'limit':0x1,'order':[[_0xda9f('0x2b'),_0xda9f('0x3a')]]}]},{'model':db[_0xda9f('0x3b')],'as':_0xda9f('0x3c')},{'model':db[_0xda9f('0x3d')],'as':_0xda9f('0x3e')}]})[_0xda9f('0xe')](function(_0x5a61e2){if(_0x5a61e2&&_0x5a61e2[_0xda9f('0x37')]){var _0x457cc1=_0x5a61e2['get']({'plain':!![]});_0x1c9ae5['account']=_[_0xda9f('0x3f')](_0x457cc1,[_0xda9f('0x3c'),'List']);_0x1c9ae5[_0xda9f('0x40')]=_0x457cc1['Applications'];_0x1c9ae5[_0xda9f('0x41')]=_0x457cc1[_0xda9f('0x37')];_0x1c9ae5[_0xda9f('0x40')]=_[_0xda9f('0x42')](_0x1c9ae5['applications'],[_0xda9f('0x43')],[_0xda9f('0x44')]);if(_0x1c9ae5['account']&&_0x1c9ae5[_0xda9f('0x35')][_0xda9f('0x45')]){_0x1c9ae5[_0xda9f('0x40')][_0xda9f('0x46')]({'id':0x0,'priority':_0x1c9ae5['applications'][_0xda9f('0x47')]+0x1,'app':_0xda9f('0x48'),'appdata':_0xda9f('0x45'),'interval':_0xda9f('0x49')});}if(_0x1c9ae5[_0xda9f('0x35')][_0xda9f('0x3c')]){delete _0x1c9ae5[_0xda9f('0x35')][_0xda9f('0x3c')];}if(_0x1c9ae5['account'][_0xda9f('0x37')]){delete _0x1c9ae5[_0xda9f('0x35')][_0xda9f('0x37')];}if(_0x457cc1[_0xda9f('0x37')][_0xda9f('0x39')]['length']){return _0x457cc1[_0xda9f('0x37')][_0xda9f('0x39')][0x0];}var _0x35237c=_[_0xda9f('0xb')](_0x728460[_0xda9f('0x27')],{'firstName':_0x728460[_0xda9f('0x27')][_0xda9f('0x34')],'ListId':_0x457cc1[_0xda9f('0x2d')]});_0x35237c[_0x728460[_0xda9f('0x27')][_0xda9f('0x32')]]=_0x728460[_0xda9f('0x27')][_0xda9f('0x34')];return db[_0xda9f('0x38')][_0xda9f('0x4a')](_0x35237c);}else{throw new Error(_0xda9f('0x4b'));}})['then'](function(_0x4fa810){_0x1c9ae5[_0xda9f('0x4c')]=_0x4fa810;if(_0x4fa810){if(!_0x728460[_0xda9f('0x27')][_0xda9f('0x15')][_0xda9f('0x4d')]){_0x728460['body']['message'][_0xda9f('0x4d')]=rs[_0xda9f('0x4e')]()+'\x20'+_0x728460['body']['message'][_0xda9f('0x34')];}var _0x36c2df={'ContactId':_0x4fa810['id'],'MailAccountId':_0x728460['account']['id'],'inReplyTo':_0x728460['body']['message'][_0xda9f('0x4d')],'to':_0x728460[_0xda9f('0x27')][_0xda9f('0x15')][_0xda9f('0x34')],'cc':_0x728460[_0xda9f('0x27')]['message']['cc'],'subject':_0x728460[_0xda9f('0x27')][_0xda9f('0x15')][_0xda9f('0x4f')],'attach':_0x728460[_0xda9f('0x27')][_0xda9f('0x15')][_0xda9f('0x50')],'lastMsgAt':moment()[_0xda9f('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0xda9f('0x52')][_0xda9f('0x24')]({'where':{'closed':![],'MailAccountId':_0x728460[_0xda9f('0x35')]['id']},'include':[{'model':db[_0xda9f('0x53')],'as':_0xda9f('0x54'),'attributes':[_0xda9f('0x4d')],'where':{'messageId':_0x728460[_0xda9f('0x27')][_0xda9f('0x15')][_0xda9f('0x55')]}}]})[_0xda9f('0xe')](function(_0x14b470){if(_0x14b470){return[_0x14b470,![]];}return db[_0xda9f('0x52')]['create'](_0x36c2df)['then'](function(_0x347d51){return[_0x347d51,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x14100d,_0x4439f3){if(_0x14100d){_0xc7c3d5=_0x4439f3;if(!_0x4439f3){return _0x14100d[_0xda9f('0x56')]({'inReplyTo':_0x728460[_0xda9f('0x27')][_0xda9f('0x15')]['messageId'],'to':_0x728460[_0xda9f('0x27')]['message'][_0xda9f('0x34')],'cc':_0x728460[_0xda9f('0x27')]['message']['cc'],'subject':_0x728460[_0xda9f('0x27')][_0xda9f('0x15')][_0xda9f('0x4f')],'attach':_0x14100d[_0xda9f('0x50')]?_0x14100d[_0xda9f('0x50')]:_0x728460[_0xda9f('0x27')][_0xda9f('0x15')][_0xda9f('0x50')],'substatus':null,'substatusAt':moment()['format'](_0xda9f('0x57')),'lastMsgAt':moment()[_0xda9f('0x51')](_0xda9f('0x57')),'lastMsgDirection':'in'});}else{return _0x14100d;}}})['then'](function(_0x28bcff){_0x1c9ae5[_0xda9f('0x58')]=_0x28bcff[_0xda9f('0x59')]({'plain':!![]});_0x1c9ae5[_0xda9f('0x58')][_0xda9f('0x5a')]=_0xc7c3d5;return db['MailMessage'][_0xda9f('0x4a')]({'body':_0x728460[_0xda9f('0x27')]['body'],'MailAccountId':_0x728460['account']['id'],'MailInteractionId':_0x28bcff['id'],'direction':'in','ContactId':_0x1c9ae5[_0xda9f('0x4c')]['id'],'messageId':_0x728460['body'][_0xda9f('0x15')][_0xda9f('0x4d')],'from':_0x728460['body'][_0xda9f('0x15')][_0xda9f('0x34')],'to':_0x728460[_0xda9f('0x27')][_0xda9f('0x15')]['to'],'cc':_0x728460[_0xda9f('0x27')]['message']['cc'],'subject':_0x728460[_0xda9f('0x27')][_0xda9f('0x15')][_0xda9f('0x4f')],'attach':_0x728460[_0xda9f('0x27')][_0xda9f('0x15')]['attach'],'Attachments':_0x728460[_0xda9f('0x27')]['message'][_0xda9f('0x5b')],'originTo':_0x728460[_0xda9f('0x27')]['message'][_0xda9f('0x5c')],'originCc':_0x728460[_0xda9f('0x27')][_0xda9f('0x15')]['originCc'],'bcc':_0x728460['body'][_0xda9f('0x15')][_0xda9f('0x5d')],'ChatWebsiteId':_0x728460[_0xda9f('0x27')][_0xda9f('0x15')][_0xda9f('0x5e')]||null,'originChannel':_0x728460[_0xda9f('0x27')]['message'][_0xda9f('0x5f')]||_0xda9f('0x60'),'ChatOfflineMessageId':_0x728460[_0xda9f('0x27')]['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xda9f('0x61')],'as':_0xda9f('0x62')}]});})[_0xda9f('0xe')](function(_0x1d5fe9){_0x1c9ae5[_0xda9f('0x15')]=_0x1d5fe9;if(_0x1c9ae5[_0xda9f('0x58')]['UserId']){return db[_0xda9f('0x63')][_0xda9f('0x24')]({'attributes':['id',_0xda9f('0x64')],'where':{'id':_0x1c9ae5['interaction'][_0xda9f('0x65')]}})['then'](function(_0x52f7f6){if(_0x52f7f6){_0x1c9ae5['applications'][_0xda9f('0x66')]({'id':0x0,'priority':0x0,'app':_0xda9f('0x67'),'appdata':_0x52f7f6[_0xda9f('0x64')]+','+(_0x1c9ae5[_0xda9f('0x35')][_0xda9f('0x68')]||0xa),'interval':_0xda9f('0x49')});}return respondWithRpcPromise(_0xda9f('0x69'),_0xda9f('0x6a'),_0x1c9ae5);});}return respondWithRpcPromise(_0xda9f('0x69'),'startRouting',_0x1c9ae5);})[_0xda9f('0xe')](function(_0x6a3a8c){_0x1f7563(_0x6a3a8c);})[_0xda9f('0x17')](function(_0x1125af){_0x5208d7(_0x2be886[_0xda9f('0x13')](0x1f4,_0x1125af['message']));});});}; \ No newline at end of file +var _0x2eee=['YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','update','format','interaction','attachments','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMailAccount','options','raw','where','attributes','limit','include','map','model','debug','MailAccount','find','ShowMailAccount','body','mail','keys','CmContact','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','MailApplication','Applications','MailServerOut','get','omit','list','applications','orderBy','priority','autoclose','length','close','Contacts','create','contact','messageId','subject','attach'];(function(_0x11b6bb,_0x22b49a){var _0x3ac70b=function(_0x1b2e46){while(--_0x1b2e46){_0x11b6bb['push'](_0x11b6bb['shift']());}};_0x3ac70b(++_0x22b49a);}(_0x2eee,0x135));var _0xe2ee=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x2eee[_0x409353];return _0x4f4b59;};'use strict';var _=require(_0xe2ee('0x0'));var util=require(_0xe2ee('0x1'));var moment=require(_0xe2ee('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe2ee('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe2ee('0x4'));var logger=require(_0xe2ee('0x5'))('rpc');var config=require(_0xe2ee('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe2ee('0x7')]({'port':0x232c});config[_0xe2ee('0x8')]=_[_0xe2ee('0x9')](config[_0xe2ee('0x8')],{'host':_0xe2ee('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe2ee('0x8')]));require(_0xe2ee('0xb'))[_0xe2ee('0xc')](socket);function respondWithRpcPromise(_0x413bbc,_0xba1e1e,_0x16569d){return new BPromise(function(_0x31f200,_0x4a6bbf){return client[_0xe2ee('0xd')](_0x413bbc,_0x16569d)[_0xe2ee('0xe')](function(_0x8771f3){logger[_0xe2ee('0xf')](_0xe2ee('0x10'),_0xba1e1e,_0xe2ee('0x11'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0xba1e1e,_0xe2ee('0x11'),JSON[_0xe2ee('0x12')](_0x8771f3));if(_0x8771f3[_0xe2ee('0x13')]){if(_0x8771f3[_0xe2ee('0x13')][_0xe2ee('0x14')]===0x1f4){logger[_0xe2ee('0x13')](_0xe2ee('0x10'),_0xba1e1e,_0x8771f3[_0xe2ee('0x13')]['message']);return _0x4a6bbf(_0x8771f3[_0xe2ee('0x13')]['message']);}logger[_0xe2ee('0x13')]('MailAccount,\x20%s,\x20%s',_0xba1e1e,_0x8771f3['error'][_0xe2ee('0x15')]);return _0x31f200(_0x8771f3[_0xe2ee('0x13')][_0xe2ee('0x15')]);}else{logger[_0xe2ee('0xf')](_0xe2ee('0x10'),_0xba1e1e,'request\x20sent');_0x31f200(_0x8771f3[_0xe2ee('0x16')][_0xe2ee('0x15')]);}})[_0xe2ee('0x17')](function(_0x535fa7){logger[_0xe2ee('0x13')](_0xe2ee('0x10'),_0xba1e1e,_0x535fa7);_0x4a6bbf(_0x535fa7);});});}exports[_0xe2ee('0x18')]=function(_0x1bcab1){var _0x272d93=this;return new Promise(function(_0x15171a,_0x18993a){return db['MailAccount']['findAll']({'raw':_0x1bcab1[_0xe2ee('0x19')]?_0x1bcab1[_0xe2ee('0x19')][_0xe2ee('0x1a')]===undefined?!![]:![]:!![],'where':_0x1bcab1[_0xe2ee('0x19')]?_0x1bcab1[_0xe2ee('0x19')][_0xe2ee('0x1b')]||null:null,'attributes':_0x1bcab1[_0xe2ee('0x19')]?_0x1bcab1[_0xe2ee('0x19')][_0xe2ee('0x1c')]||null:null,'limit':_0x1bcab1['options']?_0x1bcab1[_0xe2ee('0x19')][_0xe2ee('0x1d')]||null:null,'include':_0x1bcab1[_0xe2ee('0x19')]?_0x1bcab1[_0xe2ee('0x19')][_0xe2ee('0x1e')]?_[_0xe2ee('0x1f')](_0x1bcab1[_0xe2ee('0x19')][_0xe2ee('0x1e')],function(_0x49e136){return{'model':db[_0x49e136[_0xe2ee('0x20')]],'as':_0x49e136['as'],'attributes':_0x49e136[_0xe2ee('0x1c')],'include':_0x49e136[_0xe2ee('0x1e')]?_[_0xe2ee('0x1f')](_0x49e136[_0xe2ee('0x1e')],function(_0x531142){return{'model':db[_0x531142[_0xe2ee('0x20')]],'as':_0x531142['as'],'attributes':_0x531142[_0xe2ee('0x1c')],'include':_0x531142[_0xe2ee('0x1e')]?_['map'](_0x531142[_0xe2ee('0x1e')],function(_0x1bf9f4){return{'model':db[_0x1bf9f4['model']],'as':_0x1bf9f4['as'],'attributes':_0x1bf9f4[_0xe2ee('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47bce1){logger['info'](_0xe2ee('0x18'),_0x1bcab1);logger[_0xe2ee('0x21')](_0xe2ee('0x18'),_0x1bcab1,JSON[_0xe2ee('0x12')](_0x47bce1));_0x15171a(_0x47bce1);})[_0xe2ee('0x17')](function(_0x6c33d2){logger[_0xe2ee('0x13')](_0xe2ee('0x18'),_0x6c33d2[_0xe2ee('0x15')],_0x1bcab1);_0x18993a(_0x272d93[_0xe2ee('0x13')](0x1f4,_0x6c33d2[_0xe2ee('0x15')]));});});};exports['ShowMailAccount']=function(_0x267dbd){var _0x3ea7a2=this;return new Promise(function(_0x244e0d,_0x1cd987){return db[_0xe2ee('0x22')][_0xe2ee('0x23')]({'raw':_0x267dbd[_0xe2ee('0x19')]?_0x267dbd[_0xe2ee('0x19')][_0xe2ee('0x1a')]===undefined?!![]:![]:!![],'where':_0x267dbd[_0xe2ee('0x19')]?_0x267dbd[_0xe2ee('0x19')]['where']||null:null,'attributes':_0x267dbd[_0xe2ee('0x19')]?_0x267dbd['options'][_0xe2ee('0x1c')]||null:null,'include':_0x267dbd[_0xe2ee('0x19')]?_0x267dbd[_0xe2ee('0x19')][_0xe2ee('0x1e')]?_[_0xe2ee('0x1f')](_0x267dbd[_0xe2ee('0x19')]['include'],function(_0x500abf){return{'model':db[_0x500abf[_0xe2ee('0x20')]],'as':_0x500abf['as'],'attributes':_0x500abf[_0xe2ee('0x1c')],'include':_0x500abf[_0xe2ee('0x1e')]?_[_0xe2ee('0x1f')](_0x500abf['include'],function(_0x33735e){return{'model':db[_0x33735e[_0xe2ee('0x20')]],'as':_0x33735e['as'],'attributes':_0x33735e[_0xe2ee('0x1c')],'include':_0x33735e[_0xe2ee('0x1e')]?_[_0xe2ee('0x1f')](_0x33735e['include'],function(_0x5dd554){return{'model':db[_0x5dd554['model']],'as':_0x5dd554['as'],'attributes':_0x5dd554[_0xe2ee('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe2ee('0xe')](function(_0x1db450){logger['info'](_0xe2ee('0x24'),_0x267dbd);logger[_0xe2ee('0x21')](_0xe2ee('0x24'),_0x267dbd,JSON[_0xe2ee('0x12')](_0x1db450));_0x244e0d(_0x1db450);})[_0xe2ee('0x17')](function(_0x1d9efe){logger[_0xe2ee('0x13')](_0xe2ee('0x24'),_0x1d9efe[_0xe2ee('0x15')],_0x267dbd);_0x1cd987(_0x3ea7a2[_0xe2ee('0x13')](0x1f4,_0x1d9efe[_0xe2ee('0x15')]));});});};exports['NotifyMailAccount']=function(_0x2ac22b){var _0x262431=this;return new Promise(function(_0x1e1c05,_0x5ba28b){var _0x493028={'body':_0x2ac22b[_0xe2ee('0x25')],'channel':_0xe2ee('0x26')};var _0x123fcc=_['difference'](_[_0xe2ee('0x27')](db[_0xe2ee('0x28')]['rawAttributes']),['createdAt',_0xe2ee('0x29'),_0xe2ee('0x2a'),_0xe2ee('0x2b')]);var _0x3ffdde=![];if(_0x2ac22b['body']['id']){delete _0x2ac22b[_0xe2ee('0x25')]['id'];}if(_[_0xe2ee('0x2c')](_0x2ac22b[_0xe2ee('0x25')][_0xe2ee('0x2d')])){return _0x5ba28b(_0x262431[_0xe2ee('0x13')](0x1f4,_0xe2ee('0x2e')));}if(_[_0xe2ee('0x2c')](_0x2ac22b[_0xe2ee('0x25')][_0xe2ee('0x25')])||_0x2ac22b[_0xe2ee('0x25')]['body']===''){return _0x5ba28b(_0x262431[_0xe2ee('0x13')](0x1f4,_0xe2ee('0x2f')));}if(_[_0xe2ee('0x2c')](_0x2ac22b[_0xe2ee('0x25')]['mapKey'])){return _0x5ba28b(_0x262431[_0xe2ee('0x13')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x123fcc));}if(!_[_0xe2ee('0x30')](_0x123fcc,_0x2ac22b['body'][_0xe2ee('0x31')])){return _0x5ba28b(_0x262431[_0xe2ee('0x13')](0x1f4,_0xe2ee('0x32')+_0x123fcc));}var _0x4f92b3={};_0x4f92b3[_0x2ac22b['body'][_0xe2ee('0x31')]]=_0x2ac22b['body'][_0xe2ee('0x2d')];return db[_0xe2ee('0x22')][_0xe2ee('0x23')]({'where':{'id':_0x2ac22b[_0xe2ee('0x33')]['id']},'include':[{'model':db['CmList'],'as':_0xe2ee('0x34'),'include':[{'model':db[_0xe2ee('0x28')],'as':'Contacts','where':_0x4f92b3,'limit':0x1,'order':[[_0xe2ee('0x29'),'DESC']]}]},{'model':db[_0xe2ee('0x35')],'as':_0xe2ee('0x36')},{'model':db[_0xe2ee('0x37')],'as':'Smtp'}]})['then'](function(_0xffbd16){if(_0xffbd16&&_0xffbd16[_0xe2ee('0x34')]){var _0xd8b8c=_0xffbd16[_0xe2ee('0x38')]({'plain':!![]});_0x493028[_0xe2ee('0x33')]=_[_0xe2ee('0x39')](_0xd8b8c,[_0xe2ee('0x36'),_0xe2ee('0x34')]);_0x493028['applications']=_0xd8b8c['Applications'];_0x493028[_0xe2ee('0x3a')]=_0xd8b8c[_0xe2ee('0x34')];_0x493028[_0xe2ee('0x3b')]=_[_0xe2ee('0x3c')](_0x493028[_0xe2ee('0x3b')],[_0xe2ee('0x3d')],['asc']);if(_0x493028[_0xe2ee('0x33')]&&_0x493028[_0xe2ee('0x33')][_0xe2ee('0x3e')]){_0x493028['applications']['push']({'id':0x0,'priority':_0x493028['applications'][_0xe2ee('0x3f')]+0x1,'app':_0xe2ee('0x40'),'appdata':'autoclose','interval':'*,*,*,*'});}if(_0x493028[_0xe2ee('0x33')][_0xe2ee('0x36')]){delete _0x493028[_0xe2ee('0x33')][_0xe2ee('0x36')];}if(_0x493028[_0xe2ee('0x33')][_0xe2ee('0x34')]){delete _0x493028[_0xe2ee('0x33')]['List'];}if(_0xd8b8c[_0xe2ee('0x34')][_0xe2ee('0x41')][_0xe2ee('0x3f')]){return _0xd8b8c[_0xe2ee('0x34')][_0xe2ee('0x41')][0x0];}var _0x22b241=_[_0xe2ee('0x9')](_0x2ac22b[_0xe2ee('0x25')],{'firstName':_0x2ac22b[_0xe2ee('0x25')]['from'],'ListId':_0xd8b8c[_0xe2ee('0x2b')]});_0x22b241[_0x2ac22b[_0xe2ee('0x25')][_0xe2ee('0x31')]]=_0x2ac22b['body'][_0xe2ee('0x2d')];return db['CmContact'][_0xe2ee('0x42')](_0x22b241);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0x5cb1ca){_0x493028[_0xe2ee('0x43')]=_0x5cb1ca;if(_0x5cb1ca){if(!_0x2ac22b[_0xe2ee('0x25')][_0xe2ee('0x15')][_0xe2ee('0x44')]){_0x2ac22b[_0xe2ee('0x25')]['message'][_0xe2ee('0x44')]=rs['generate']()+'\x20'+_0x2ac22b[_0xe2ee('0x25')]['message'][_0xe2ee('0x2d')];}var _0xa6adb9={'ContactId':_0x5cb1ca['id'],'MailAccountId':_0x2ac22b[_0xe2ee('0x33')]['id'],'inReplyTo':_0x2ac22b[_0xe2ee('0x25')][_0xe2ee('0x15')]['messageId'],'to':_0x2ac22b[_0xe2ee('0x25')][_0xe2ee('0x15')]['from'],'cc':_0x2ac22b[_0xe2ee('0x25')][_0xe2ee('0x15')]['cc'],'subject':_0x2ac22b['body']['message'][_0xe2ee('0x45')],'attach':_0x2ac22b['body'][_0xe2ee('0x15')][_0xe2ee('0x46')],'lastMsgAt':moment()['format'](_0xe2ee('0x47')),'lastMsgDirection':'in'};return db[_0xe2ee('0x48')][_0xe2ee('0x23')]({'where':{'closed':![],'MailAccountId':_0x2ac22b['account']['id']},'include':[{'model':db[_0xe2ee('0x49')],'as':_0xe2ee('0x4a'),'attributes':[_0xe2ee('0x44')],'where':{'messageId':_0x2ac22b[_0xe2ee('0x25')]['message'][_0xe2ee('0x4b')]}}]})[_0xe2ee('0xe')](function(_0x4b804f){if(_0x4b804f){return[_0x4b804f,![]];}return db[_0xe2ee('0x48')][_0xe2ee('0x42')](_0xa6adb9)[_0xe2ee('0xe')](function(_0x1d4041){return[_0x1d4041,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x4b30a3,_0x44d824){if(_0x4b30a3){_0x3ffdde=_0x44d824;if(!_0x44d824){return _0x4b30a3[_0xe2ee('0x4c')]({'inReplyTo':_0x2ac22b[_0xe2ee('0x25')][_0xe2ee('0x15')]['messageId'],'to':_0x2ac22b[_0xe2ee('0x25')]['message'][_0xe2ee('0x2d')],'cc':_0x2ac22b[_0xe2ee('0x25')][_0xe2ee('0x15')]['cc'],'subject':_0x2ac22b[_0xe2ee('0x25')][_0xe2ee('0x15')][_0xe2ee('0x45')],'attach':_0x4b30a3[_0xe2ee('0x46')]?_0x4b30a3[_0xe2ee('0x46')]:_0x2ac22b['body'][_0xe2ee('0x15')][_0xe2ee('0x46')],'substatus':null,'substatusAt':moment()[_0xe2ee('0x4d')](_0xe2ee('0x47')),'lastMsgAt':moment()[_0xe2ee('0x4d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x4b30a3;}}})[_0xe2ee('0xe')](function(_0x5c9c55){_0x493028[_0xe2ee('0x4e')]=_0x5c9c55['get']({'plain':!![]});_0x493028[_0xe2ee('0x4e')]['created']=_0x3ffdde;return db[_0xe2ee('0x49')][_0xe2ee('0x42')]({'body':_0x2ac22b[_0xe2ee('0x25')][_0xe2ee('0x25')],'MailAccountId':_0x2ac22b[_0xe2ee('0x33')]['id'],'MailInteractionId':_0x5c9c55['id'],'direction':'in','ContactId':_0x493028[_0xe2ee('0x43')]['id'],'messageId':_0x2ac22b[_0xe2ee('0x25')]['message'][_0xe2ee('0x44')],'from':_0x2ac22b[_0xe2ee('0x25')][_0xe2ee('0x15')]['from'],'to':_0x2ac22b['body'][_0xe2ee('0x15')]['to'],'cc':_0x2ac22b[_0xe2ee('0x25')][_0xe2ee('0x15')]['cc'],'subject':_0x2ac22b[_0xe2ee('0x25')][_0xe2ee('0x15')][_0xe2ee('0x45')],'attach':_0x2ac22b['body'][_0xe2ee('0x15')][_0xe2ee('0x46')],'Attachments':_0x2ac22b[_0xe2ee('0x25')][_0xe2ee('0x15')][_0xe2ee('0x4f')],'originTo':_0x2ac22b[_0xe2ee('0x25')][_0xe2ee('0x15')]['originTo'],'originCc':_0x2ac22b[_0xe2ee('0x25')][_0xe2ee('0x15')]['originCc'],'bcc':_0x2ac22b[_0xe2ee('0x25')]['message'][_0xe2ee('0x50')],'ChatWebsiteId':_0x2ac22b[_0xe2ee('0x25')][_0xe2ee('0x15')][_0xe2ee('0x51')]||null,'originChannel':_0x2ac22b[_0xe2ee('0x25')][_0xe2ee('0x15')]['originChannel']||_0xe2ee('0x52'),'ChatOfflineMessageId':_0x2ac22b['body']['message'][_0xe2ee('0x53')]||null},{'include':[{'model':db[_0xe2ee('0x54')],'as':_0xe2ee('0x55')}]});})[_0xe2ee('0xe')](function(_0x363288){_0x493028[_0xe2ee('0x15')]=_0x363288;if(_0x493028[_0xe2ee('0x4e')][_0xe2ee('0x56')]){return db[_0xe2ee('0x57')][_0xe2ee('0x23')]({'attributes':['id',_0xe2ee('0x58')],'where':{'id':_0x493028[_0xe2ee('0x4e')]['UserId']}})[_0xe2ee('0xe')](function(_0x217194){if(_0x217194){_0x493028[_0xe2ee('0x3b')][_0xe2ee('0x59')]({'id':0x0,'priority':0x0,'app':_0xe2ee('0x5a'),'appdata':_0x217194['name']+','+(_0x493028[_0xe2ee('0x33')][_0xe2ee('0x5b')]||0xa),'interval':_0xe2ee('0x5c')});}return respondWithRpcPromise(_0xe2ee('0x5d'),_0xe2ee('0x5e'),_0x493028);});}return respondWithRpcPromise('Start',_0xe2ee('0x5e'),_0x493028);})[_0xe2ee('0xe')](function(_0x1ee951){_0x1e1c05(_0x1ee951);})[_0xe2ee('0x17')](function(_0x46314b){_0x5ba28b(_0x262431[_0xe2ee('0x13')](0x1f4,_0x46314b[_0xe2ee('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 9812016..1e18e5a 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 _0x9fa9=['emit','removeListener','length','mailAccount:','save','remove'];(function(_0x195686,_0xd329df){var _0xaf27a1=function(_0x5a3ba8){while(--_0x5a3ba8){_0x195686['push'](_0x195686['shift']());}};_0xaf27a1(++_0xd329df);}(_0x9fa9,0xb2));var _0x99fa=function(_0x53928a,_0x36b0bb){_0x53928a=_0x53928a-0x0;var _0x1543f5=_0x9fa9[_0x53928a];return _0x1543f5;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x99fa('0x0'),_0x99fa('0x1'),'update'];function createListener(_0x20acaf,_0x4c3050){return function(_0x255b2b){_0x4c3050[_0x99fa('0x2')](_0x20acaf,_0x255b2b);};}function removeListener(_0x1314bd,_0x3528f9){return function(){MailAccountEvents[_0x99fa('0x3')](_0x1314bd,_0x3528f9);};}exports['register']=function(_0x4b1eba){for(var _0x2c67b2=0x0,_0x44062b=events[_0x99fa('0x4')];_0x2c67b2<_0x44062b;_0x2c67b2++){var _0x607b16=events[_0x2c67b2];var _0x50be2d=createListener(_0x99fa('0x5')+_0x607b16,_0x4b1eba);MailAccountEvents['on'](_0x607b16,_0x50be2d);}}; \ No newline at end of file +var _0x205d=['mailAccount:','save','remove','update','emit','removeListener','register','length'];(function(_0x5da049,_0x3ae079){var _0x29292b=function(_0x1857d0){while(--_0x1857d0){_0x5da049['push'](_0x5da049['shift']());}};_0x29292b(++_0x3ae079);}(_0x205d,0x1f1));var _0xd205=function(_0x1ea6eb,_0x33d3d4){_0x1ea6eb=_0x1ea6eb-0x0;var _0x127200=_0x205d[_0x1ea6eb];return _0x127200;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0xd205('0x0'),_0xd205('0x1'),_0xd205('0x2')];function createListener(_0x5bfe5b,_0x39b080){return function(_0x38b674){_0x39b080[_0xd205('0x3')](_0x5bfe5b,_0x38b674);};}function removeListener(_0x305da1,_0x25e4dd){return function(){MailAccountEvents[_0xd205('0x4')](_0x305da1,_0x25e4dd);};}exports[_0xd205('0x5')]=function(_0x3c5535){for(var _0x1387d1=0x0,_0x37dd0e=events[_0xd205('0x6')];_0x1387d1<_0x37dd0e;_0x1387d1++){var _0x2e84ff=events[_0x1387d1];var _0x31f437=createListener(_0xd205('0x7')+_0x2e84ff,_0x3c5535);MailAccountEvents['on'](_0x2e84ff,_0x31f437);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 5b26710..87c1366 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 _0x00ec=['./mailApplication.controller','get','/:id','isAuthenticated','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x00ec,0x129));var _0xc00e=function(_0x493720,_0x2e7724){_0x493720=_0x493720-0x0;var _0x3cfc8e=_0x00ec[_0x493720];return _0x3cfc8e;};'use strict';var multer=require(_0xc00e('0x0'));var util=require('util');var path=require(_0xc00e('0x1'));var timeout=require(_0xc00e('0x2'));var express=require(_0xc00e('0x3'));var router=express[_0xc00e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc00e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc00e('0x6'));var controller=require(_0xc00e('0x7'));router[_0xc00e('0x8')](_0xc00e('0x9'),auth[_0xc00e('0xa')](),controller['show']);router[_0xc00e('0xb')]('/:id',auth[_0xc00e('0xa')](),controller[_0xc00e('0xc')]);router[_0xc00e('0xd')](_0xc00e('0x9'),auth[_0xc00e('0xa')](),controller[_0xc00e('0xe')]);module[_0xc00e('0xf')]=router; \ No newline at end of file +var _0x6eab=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy'];(function(_0x5d7ffa,_0x198e30){var _0x45e6a0=function(_0x278db3){while(--_0x278db3){_0x5d7ffa['push'](_0x5d7ffa['shift']());}};_0x45e6a0(++_0x198e30);}(_0x6eab,0x111));var _0xb6ea=function(_0x4b4844,_0x2f0dfb){_0x4b4844=_0x4b4844-0x0;var _0x575192=_0x6eab[_0x4b4844];return _0x575192;};'use strict';var multer=require(_0xb6ea('0x0'));var util=require(_0xb6ea('0x1'));var path=require(_0xb6ea('0x2'));var timeout=require(_0xb6ea('0x3'));var express=require('express');var router=express[_0xb6ea('0x4')]();var fs_extra=require(_0xb6ea('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb6ea('0x6'));var controller=require(_0xb6ea('0x7'));router[_0xb6ea('0x8')](_0xb6ea('0x9'),auth[_0xb6ea('0xa')](),controller[_0xb6ea('0xb')]);router[_0xb6ea('0xc')](_0xb6ea('0x9'),auth[_0xb6ea('0xa')](),controller[_0xb6ea('0xd')]);router[_0xb6ea('0xe')](_0xb6ea('0x9'),auth[_0xb6ea('0xa')](),controller[_0xb6ea('0xf')]);module[_0xb6ea('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 8a45b1d..de6ca81 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 _0x494d=['INTEGER','STRING','TEXT','*,*,*,*','sequelize'];(function(_0x3f7c5a,_0x199dcc){var _0x5b248e=function(_0x1fd031){while(--_0x1fd031){_0x3f7c5a['push'](_0x3f7c5a['shift']());}};_0x5b248e(++_0x199dcc);}(_0x494d,0x103));var _0xd494=function(_0x305aa8,_0x538a81){_0x305aa8=_0x305aa8-0x0;var _0x160102=_0x494d[_0x305aa8];return _0x160102;};'use strict';var Sequelize=require(_0xd494('0x0'));module['exports']={'priority':{'type':Sequelize[_0xd494('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xd494('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xd494('0x3')]()},'description':{'type':Sequelize[_0xd494('0x2')]},'interval':{'type':Sequelize[_0xd494('0x2')],'defaultValue':_0xd494('0x4')}}; \ No newline at end of file +var _0xe0f1=['*,*,*,*','STRING','noop'];(function(_0x55c859,_0x77c09c){var _0x515002=function(_0x3de18f){while(--_0x3de18f){_0x55c859['push'](_0x55c859['shift']());}};_0x515002(++_0x77c09c);}(_0xe0f1,0x106));var _0x1e0f=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xe0f1[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x1e0f('0x0')],'allowNull':![],'defaultValue':_0x1e0f('0x1')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x1e0f('0x2')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 56432c9..ceb3fa5 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 _0xe706=['limit','count','offset','set','Content-Range','json','apply','save','update','then','end','name','send','show','params','model','keys','MailApplication','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','body','catch','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined'];(function(_0x5d983c,_0x57b322){var _0x45d2f8=function(_0x4fb48d){while(--_0x4fb48d){_0x5d983c['push'](_0x5d983c['shift']());}};_0x45d2f8(++_0x57b322);}(_0xe706,0xa3));var _0x6e70=function(_0x3f4f3b,_0x2d7be2){_0x3f4f3b=_0x3f4f3b-0x0;var _0xfc6f02=_0xe706[_0x3f4f3b];return _0xfc6f02;};'use strict';var emlformat=require(_0x6e70('0x0'));var rimraf=require(_0x6e70('0x1'));var zipdir=require(_0x6e70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e70('0x3'));var moment=require(_0x6e70('0x4'));var BPromise=require(_0x6e70('0x5'));var Mustache=require(_0x6e70('0x6'));var util=require(_0x6e70('0x7'));var path=require(_0x6e70('0x8'));var sox=require(_0x6e70('0x9'));var csv=require(_0x6e70('0xa'));var ejs=require(_0x6e70('0xb'));var fs=require('fs');var fs_extra=require(_0x6e70('0xc'));var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xa'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var licenseUtil=require(_0x6e70('0x1b'));var db=require(_0x6e70('0x1c'))['db'];function respondWithStatusCode(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xcc;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x1d')](_0x3b38f3);}return _0x27dd9b[_0x6e70('0x1e')](_0x3b38f3)['end']();};}function respondWithResult(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0xc8;return function(_0x257e81){if(_0x257e81){return _0x52737e['status'](_0x48bc72)['json'](_0x257e81);}};}function respondWithFilteredResult(_0x304716,_0x22c50c){return function(_0x5d9263){if(_0x5d9263){var _0x24f3ac=typeof _0x22c50c['offset']===_0x6e70('0x1f')&&typeof _0x22c50c[_0x6e70('0x20')]==='undefined';var _0x49029f=_0x5d9263[_0x6e70('0x21')];var _0x5ea7a5=_0x24f3ac?0x0:_0x22c50c[_0x6e70('0x22')];var _0x173afe=_0x24f3ac?_0x5d9263['count']:_0x22c50c['offset']+_0x22c50c[_0x6e70('0x20')];var _0x208e21;if(_0x173afe>=_0x49029f){_0x173afe=_0x49029f;_0x208e21=0xc8;}else{_0x208e21=0xce;}_0x304716[_0x6e70('0x1e')](_0x208e21);return _0x304716[_0x6e70('0x23')](_0x6e70('0x24'),_0x5ea7a5+'-'+_0x173afe+'/'+_0x49029f)[_0x6e70('0x25')](_0x5d9263);}return null;};}function patchUpdates(_0x1b2453){return function(_0x44a49f){try{jsonpatch[_0x6e70('0x26')](_0x44a49f,_0x1b2453,!![]);}catch(_0xb29a2a){return BPromise['reject'](_0xb29a2a);}return _0x44a49f[_0x6e70('0x27')]();};}function saveUpdates(_0x344b65,_0x27b294){return function(_0x502b2d){if(_0x502b2d){return _0x502b2d[_0x6e70('0x28')](_0x344b65)[_0x6e70('0x29')](function(_0x3337a6){return _0x3337a6;});}return null;};}function removeEntity(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(_0x538b9c){return _0x538b9c['destroy']()['then'](function(){_0x50da2c[_0x6e70('0x1e')](0xcc)[_0x6e70('0x2a')]();});}};}function handleEntityNotFound(_0x51d292,_0x3ecdf1){return function(_0x1196ed){if(!_0x1196ed){_0x51d292['sendStatus'](0x194);}return _0x1196ed;};}function handleError(_0x338ad6,_0x67fb43){_0x67fb43=_0x67fb43||0x1f4;return function(_0x2bb231){logger['error'](_0x2bb231['stack']);if(_0x2bb231[_0x6e70('0x2b')]){delete _0x2bb231[_0x6e70('0x2b')];}_0x338ad6[_0x6e70('0x1e')](_0x67fb43)[_0x6e70('0x2c')](_0x2bb231);};}exports[_0x6e70('0x2d')]=function(_0x5d772a,_0x1952ea){var _0x406f29={'raw':!![],'where':{'id':_0x5d772a[_0x6e70('0x2e')]['id']}},_0xecf336={};_0xecf336[_0x6e70('0x2f')]=_[_0x6e70('0x30')](db[_0x6e70('0x31')][_0x6e70('0x32')]);_0xecf336[_0x6e70('0x33')]=_[_0x6e70('0x30')](_0x5d772a['query']);_0xecf336[_0x6e70('0x34')]=_['intersection'](_0xecf336[_0x6e70('0x2f')],_0xecf336['query']);_0x406f29[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0xecf336[_0x6e70('0x2f')],qs['fields'](_0x5d772a[_0x6e70('0x33')][_0x6e70('0x37')]));_0x406f29['attributes']=_0x406f29[_0x6e70('0x35')][_0x6e70('0x38')]?_0x406f29['attributes']:_0xecf336[_0x6e70('0x2f')];if(_0x5d772a[_0x6e70('0x33')][_0x6e70('0x39')]){_0x406f29[_0x6e70('0x3a')]=[{'all':!![]}];}_0x406f29=_[_0x6e70('0x3b')]({},_0x406f29,_0x5d772a[_0x6e70('0x3c')]);return db[_0x6e70('0x31')][_0x6e70('0x3d')](_0x406f29)[_0x6e70('0x29')](handleEntityNotFound(_0x1952ea,null))[_0x6e70('0x29')](respondWithResult(_0x1952ea,null))['catch'](handleError(_0x1952ea,null));};exports[_0x6e70('0x28')]=function(_0x4795a0,_0x23cd1a){if(_0x4795a0[_0x6e70('0x3e')]['id']){delete _0x4795a0[_0x6e70('0x3e')]['id'];}return db[_0x6e70('0x31')][_0x6e70('0x3d')]({'where':{'id':_0x4795a0[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x23cd1a,null))[_0x6e70('0x29')](saveUpdates(_0x4795a0[_0x6e70('0x3e')],null))[_0x6e70('0x29')](respondWithResult(_0x23cd1a,null))[_0x6e70('0x3f')](handleError(_0x23cd1a,null));};exports[_0x6e70('0x40')]=function(_0x5594d3,_0x501b53){return db['MailApplication']['find']({'where':{'id':_0x5594d3[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x501b53,null))[_0x6e70('0x29')](removeEntity(_0x501b53,null))[_0x6e70('0x3f')](handleError(_0x501b53,null));}; \ No newline at end of file +var _0xedd9=['query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','show','params','keys','MailApplication','rawAttributes'];(function(_0x16db8b,_0xca7d28){var _0x5ba017=function(_0x35b933){while(--_0x35b933){_0x16db8b['push'](_0x16db8b['shift']());}};_0x5ba017(++_0xca7d28);}(_0xedd9,0xfc));var _0x9edd=function(_0x4849d5,_0x40fe94){_0x4849d5=_0x4849d5-0x0;var _0xfe3822=_0xedd9[_0x4849d5];return _0xfe3822;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={'raw':!![],'where':{'id':_0x52746a[_0x9edd('0x27')]['id']}},_0x2ae8dd={};_0x2ae8dd['model']=_[_0x9edd('0x28')](db[_0x9edd('0x29')][_0x9edd('0x2a')]);_0x2ae8dd[_0x9edd('0x2b')]=_[_0x9edd('0x28')](_0x52746a[_0x9edd('0x2b')]);_0x2ae8dd[_0x9edd('0x2c')]=_[_0x9edd('0x2d')](_0x2ae8dd[_0x9edd('0x2e')],_0x2ae8dd[_0x9edd('0x2b')]);_0x28cfae[_0x9edd('0x2f')]=_[_0x9edd('0x2d')](_0x2ae8dd[_0x9edd('0x2e')],qs[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2b')]['fields']));_0x28cfae[_0x9edd('0x2f')]=_0x28cfae[_0x9edd('0x2f')][_0x9edd('0x31')]?_0x28cfae['attributes']:_0x2ae8dd[_0x9edd('0x2e')];if(_0x52746a[_0x9edd('0x2b')][_0x9edd('0x32')]){_0x28cfae[_0x9edd('0x33')]=[{'all':!![]}];}_0x28cfae=_[_0x9edd('0x34')]({},_0x28cfae,_0x52746a[_0x9edd('0x35')]);return db[_0x9edd('0x29')][_0x9edd('0x36')](_0x28cfae)[_0x9edd('0x21')](handleEntityNotFound(_0x238b22,null))[_0x9edd('0x21')](respondWithResult(_0x238b22,null))[_0x9edd('0x37')](handleError(_0x238b22,null));};exports[_0x9edd('0x38')]=function(_0x27eb7e,_0x14f780){if(_0x27eb7e['body']['id']){delete _0x27eb7e[_0x9edd('0x39')]['id'];}return db['MailApplication'][_0x9edd('0x36')]({'where':{'id':_0x27eb7e[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x14f780,null))[_0x9edd('0x21')](saveUpdates(_0x27eb7e[_0x9edd('0x39')],null))['then'](respondWithResult(_0x14f780,null))[_0x9edd('0x37')](handleError(_0x14f780,null));};exports[_0x9edd('0x3a')]=function(_0x2b3469,_0x38e9be){return db[_0x9edd('0x29')][_0x9edd('0x36')]({'where':{'id':_0x2b3469[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x38e9be,null))[_0x9edd('0x21')](removeEntity(_0x38e9be,null))[_0x9edd('0x37')](handleError(_0x38e9be,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index cee694c..9811512 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 _0xe39a=['moment','bluebird','request-promise','path','../../config/environment','./mailApplication.attributes','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api'];(function(_0x66ff82,_0xabdb1c){var _0x318053=function(_0x4b43cb){while(--_0x4b43cb){_0x66ff82['push'](_0x66ff82['shift']());}};_0x318053(++_0xabdb1c);}(_0xe39a,0x184));var _0xae39=function(_0x2d4819,_0x4f8c08){_0x2d4819=_0x2d4819-0x0;var _0x1572b0=_0xe39a[_0x2d4819];return _0x1572b0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xae39('0x0'))(_0xae39('0x1'));var moment=require(_0xae39('0x2'));var BPromise=require(_0xae39('0x3'));var rp=require(_0xae39('0x4'));var fs=require('fs');var path=require(_0xae39('0x5'));var rimraf=require('rimraf');var config=require(_0xae39('0x6'));var attributes=require(_0xae39('0x7'));module['exports']=function(_0x3a5ee1,_0x2c014e){return _0x3a5ee1[_0xae39('0x8')](_0xae39('0x9'),attributes,{'tableName':_0xae39('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xae39('0xb'),'collate':_0xae39('0xc')});}; \ No newline at end of file +var _0x6dee=['request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x29f8b7,_0x1be952){var _0x224e07=function(_0x5d6b58){while(--_0x5d6b58){_0x29f8b7['push'](_0x29f8b7['shift']());}};_0x224e07(++_0x1be952);}(_0x6dee,0x174));var _0xe6de=function(_0x11f0c8,_0x476d8a){_0x11f0c8=_0x11f0c8-0x0;var _0x249b94=_0x6dee[_0x11f0c8];return _0x249b94;};'use strict';var _=require(_0xe6de('0x0'));var util=require(_0xe6de('0x1'));var logger=require(_0xe6de('0x2'))(_0xe6de('0x3'));var moment=require(_0xe6de('0x4'));var BPromise=require('bluebird');var rp=require(_0xe6de('0x5'));var fs=require('fs');var path=require(_0xe6de('0x6'));var rimraf=require(_0xe6de('0x7'));var config=require(_0xe6de('0x8'));var attributes=require(_0xe6de('0x9'));module['exports']=function(_0x2b71b3,_0x2da13c){return _0x2b71b3[_0xe6de('0xa')]('MailApplication',attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe6de('0xb'),'collate':_0xe6de('0xc')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 3db0a87..42fae33 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 _0xbf43=['error','code','message','UpdateMailApplication','MailApplication','update','body','options','raw','limit','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x2d3b4f,_0x343a96){var _0x5b4b01=function(_0x1ee8af){while(--_0x1ee8af){_0x2d3b4f['push'](_0x2d3b4f['shift']());}};_0x5b4b01(++_0x343a96);}(_0xbf43,0x107));var _0x3bf4=function(_0x494b6d,_0x18fbea){_0x494b6d=_0x494b6d-0x0;var _0x4cbbee=_0xbf43[_0x494b6d];return _0x4cbbee;};'use strict';var _=require(_0x3bf4('0x0'));var util=require(_0x3bf4('0x1'));var moment=require('moment');var BPromise=require(_0x3bf4('0x2'));var rs=require(_0x3bf4('0x3'));var fs=require('fs');var Redis=require(_0x3bf4('0x4'));var db=require(_0x3bf4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3bf4('0x6'))(_0x3bf4('0x7'));var config=require(_0x3bf4('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3bf4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a250d,_0x199bb9,_0x38ec89){return new BPromise(function(_0x3abb6b,_0x44744e){return client[_0x3bf4('0xa')](_0x4a250d,_0x38ec89)[_0x3bf4('0xb')](function(_0x38fa79){logger[_0x3bf4('0xc')](_0x3bf4('0xd'),_0x199bb9,_0x3bf4('0xe'));logger[_0x3bf4('0xf')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x199bb9,_0x3bf4('0xe'),JSON[_0x3bf4('0x10')](_0x38fa79));if(_0x38fa79[_0x3bf4('0x11')]){if(_0x38fa79[_0x3bf4('0x11')][_0x3bf4('0x12')]===0x1f4){logger[_0x3bf4('0x11')]('MailApplication,\x20%s,\x20%s',_0x199bb9,_0x38fa79[_0x3bf4('0x11')][_0x3bf4('0x13')]);return _0x44744e(_0x38fa79[_0x3bf4('0x11')]['message']);}logger[_0x3bf4('0x11')]('MailApplication,\x20%s,\x20%s',_0x199bb9,_0x38fa79[_0x3bf4('0x11')][_0x3bf4('0x13')]);return _0x3abb6b(_0x38fa79[_0x3bf4('0x11')][_0x3bf4('0x13')]);}else{logger[_0x3bf4('0xc')](_0x3bf4('0xd'),_0x199bb9,_0x3bf4('0xe'));_0x3abb6b(_0x38fa79['result']['message']);}})['catch'](function(_0x464c5a){logger[_0x3bf4('0x11')]('MailApplication,\x20%s,\x20%s',_0x199bb9,_0x464c5a);_0x44744e(_0x464c5a);});});}exports[_0x3bf4('0x14')]=function(_0x3a95e4){var _0x4c6cbd=this;return new Promise(function(_0x52a28a,_0x1cabc0){return db[_0x3bf4('0x15')][_0x3bf4('0x16')](_0x3a95e4[_0x3bf4('0x17')],{'raw':_0x3a95e4[_0x3bf4('0x18')]?_0x3a95e4[_0x3bf4('0x18')][_0x3bf4('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a95e4['options']?_0x3a95e4[_0x3bf4('0x18')]['where']||null:null,'attributes':_0x3a95e4[_0x3bf4('0x18')]?_0x3a95e4[_0x3bf4('0x18')]['attributes']||null:null,'limit':_0x3a95e4[_0x3bf4('0x18')]?_0x3a95e4[_0x3bf4('0x18')][_0x3bf4('0x1a')]||null:null})[_0x3bf4('0xb')](function(_0x50aae){logger[_0x3bf4('0xc')](_0x3bf4('0x14'),_0x3a95e4);logger[_0x3bf4('0xf')](_0x3bf4('0x14'),_0x3a95e4,JSON[_0x3bf4('0x10')](_0x50aae));_0x52a28a(_0x50aae);})[_0x3bf4('0x1b')](function(_0x12c36f){logger['error'](_0x3bf4('0x14'),_0x12c36f['message'],_0x3a95e4);_0x1cabc0(_0x4c6cbd['error'](0x1f4,_0x12c36f[_0x3bf4('0x13')]));});});}; \ No newline at end of file +var _0xc720=['../../config/utils','rpc','jayson/promise','client','http','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailApplication','body','options','raw','limit','then','UpdateMailApplication','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x425791,_0x514555){var _0x1ee864=function(_0xc87c10){while(--_0xc87c10){_0x425791['push'](_0x425791['shift']());}};_0x1ee864(++_0x514555);}(_0xc720,0x1da));var _0x0c72=function(_0x2a7750,_0x43f402){_0x2a7750=_0x2a7750-0x0;var _0x4c8591=_0xc720[_0x2a7750];return _0x4c8591;};'use strict';var _=require(_0x0c72('0x0'));var util=require('util');var moment=require(_0x0c72('0x1'));var BPromise=require(_0x0c72('0x2'));var rs=require(_0x0c72('0x3'));var fs=require('fs');var Redis=require(_0x0c72('0x4'));var db=require(_0x0c72('0x5'))['db'];var utils=require(_0x0c72('0x6'));var logger=require('../../config/logger')(_0x0c72('0x7'));var config=require('../../config/environment');var jayson=require(_0x0c72('0x8'));var client=jayson[_0x0c72('0x9')][_0x0c72('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x351cb1,_0x5e4341,_0x5b2740){return new BPromise(function(_0x168a3b,_0x4503fd){return client[_0x0c72('0xb')](_0x351cb1,_0x5b2740)['then'](function(_0x301d91){logger[_0x0c72('0xc')](_0x0c72('0xd'),_0x5e4341,_0x0c72('0xe'));logger[_0x0c72('0xf')](_0x0c72('0x10'),_0x5e4341,_0x0c72('0xe'),JSON[_0x0c72('0x11')](_0x301d91));if(_0x301d91[_0x0c72('0x12')]){if(_0x301d91['error'][_0x0c72('0x13')]===0x1f4){logger[_0x0c72('0x12')]('MailApplication,\x20%s,\x20%s',_0x5e4341,_0x301d91['error'][_0x0c72('0x14')]);return _0x4503fd(_0x301d91[_0x0c72('0x12')]['message']);}logger[_0x0c72('0x12')]('MailApplication,\x20%s,\x20%s',_0x5e4341,_0x301d91[_0x0c72('0x12')]['message']);return _0x168a3b(_0x301d91[_0x0c72('0x12')][_0x0c72('0x14')]);}else{logger['info'](_0x0c72('0xd'),_0x5e4341,_0x0c72('0xe'));_0x168a3b(_0x301d91[_0x0c72('0x15')]['message']);}})[_0x0c72('0x16')](function(_0x100ff4){logger['error']('MailApplication,\x20%s,\x20%s',_0x5e4341,_0x100ff4);_0x4503fd(_0x100ff4);});});}exports['UpdateMailApplication']=function(_0xa91cd8){var _0x232c32=this;return new Promise(function(_0x1ea1bb,_0x5e0f2a){return db[_0x0c72('0x17')]['update'](_0xa91cd8[_0x0c72('0x18')],{'raw':_0xa91cd8[_0x0c72('0x19')]?_0xa91cd8['options'][_0x0c72('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa91cd8[_0x0c72('0x19')]?_0xa91cd8['options']['where']||null:null,'attributes':_0xa91cd8[_0x0c72('0x19')]?_0xa91cd8[_0x0c72('0x19')]['attributes']||null:null,'limit':_0xa91cd8[_0x0c72('0x19')]?_0xa91cd8[_0x0c72('0x19')][_0x0c72('0x1b')]||null:null})[_0x0c72('0x1c')](function(_0x2efbfe){logger['info'](_0x0c72('0x1d'),_0xa91cd8);logger[_0x0c72('0xf')](_0x0c72('0x1d'),_0xa91cd8,JSON[_0x0c72('0x11')](_0x2efbfe));_0x1ea1bb(_0x2efbfe);})[_0x0c72('0x16')](function(_0x40ff19){logger[_0x0c72('0x12')](_0x0c72('0x1d'),_0x40ff19[_0x0c72('0x14')],_0xa91cd8);_0x5e0f2a(_0x232c32[_0x0c72('0x12')](0x1f4,_0x40ff19['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 99db9d3..f9e89f4 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 _0xfa08=['delete','mailinteraction:destroy','destroy','removeTags','exports','express','Router','../../components/auth/service','./mailInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','post','create','/:id/tags','tracked','mailinteraction:addtags','addTags','put','mail','mailinteraction:update','update'];(function(_0x25ddbd,_0x47e65a){var _0x424386=function(_0x357c1b){while(--_0x357c1b){_0x25ddbd['push'](_0x25ddbd['shift']());}};_0x424386(++_0x47e65a);}(_0xfa08,0x101));var _0x8fa0=function(_0x59a14d,_0x36beea){_0x59a14d=_0x59a14d-0x0;var _0x31381a=_0xfa08[_0x59a14d];return _0x31381a;};'use strict';var express=require(_0x8fa0('0x0'));var router=express[_0x8fa0('0x1')]();var auth=require(_0x8fa0('0x2'));var interaction=require('../../components/interaction/service');var controller=require(_0x8fa0('0x3'));router[_0x8fa0('0x4')]('/',auth['isAuthenticated'](),controller[_0x8fa0('0x5')]);router[_0x8fa0('0x4')](_0x8fa0('0x6'),auth[_0x8fa0('0x7')](),controller[_0x8fa0('0x8')]);router[_0x8fa0('0x4')](_0x8fa0('0x9'),auth[_0x8fa0('0x7')](),controller[_0x8fa0('0xa')]);router[_0x8fa0('0x4')]('/:id/messages',auth[_0x8fa0('0x7')](),controller['getMessages']);router[_0x8fa0('0x4')](_0x8fa0('0xb'),auth['isAuthenticated'](),controller[_0x8fa0('0xc')]);router[_0x8fa0('0xd')]('/',auth[_0x8fa0('0x7')](),controller[_0x8fa0('0xe')]);router[_0x8fa0('0xd')]('/:id/messages',auth[_0x8fa0('0x7')](),controller['addMessage']);router[_0x8fa0('0xd')](_0x8fa0('0xf'),auth[_0x8fa0('0x7')](),interaction[_0x8fa0('0x10')]('mail',_0x8fa0('0x11')),controller[_0x8fa0('0x12')]);router[_0x8fa0('0x13')]('/:id',auth[_0x8fa0('0x7')](),interaction[_0x8fa0('0x10')](_0x8fa0('0x14'),_0x8fa0('0x15')),controller[_0x8fa0('0x16')]);router[_0x8fa0('0x17')](_0x8fa0('0x9'),auth[_0x8fa0('0x7')](),interaction[_0x8fa0('0x10')](_0x8fa0('0x14'),_0x8fa0('0x18')),controller[_0x8fa0('0x19')]);router[_0x8fa0('0x17')]('/:id/tags',auth['isAuthenticated'](),controller[_0x8fa0('0x1a')]);module[_0x8fa0('0x1b')]=router; \ No newline at end of file +var _0x0fbe=['/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','update','delete','mailinteraction:destroy','destroy','removeTags','express','Router','../../components/interaction/service','get','isAuthenticated','/describe','describe'];(function(_0x2d1067,_0x84fa8c){var _0x4ca52f=function(_0x2c18fe){while(--_0x2c18fe){_0x2d1067['push'](_0x2d1067['shift']());}};_0x4ca52f(++_0x84fa8c);}(_0x0fbe,0x1dc));var _0xe0fb=function(_0x1b3eda,_0x4084a2){_0x1b3eda=_0x1b3eda-0x0;var _0x48812c=_0x0fbe[_0x1b3eda];return _0x48812c;};'use strict';var express=require(_0xe0fb('0x0'));var router=express[_0xe0fb('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0xe0fb('0x2'));var controller=require('./mailInteraction.controller');router[_0xe0fb('0x3')]('/',auth[_0xe0fb('0x4')](),controller['index']);router[_0xe0fb('0x3')](_0xe0fb('0x5'),auth[_0xe0fb('0x4')](),controller[_0xe0fb('0x6')]);router[_0xe0fb('0x3')](_0xe0fb('0x7'),auth[_0xe0fb('0x4')](),controller[_0xe0fb('0x8')]);router[_0xe0fb('0x3')](_0xe0fb('0x9'),auth[_0xe0fb('0x4')](),controller[_0xe0fb('0xa')]);router[_0xe0fb('0x3')](_0xe0fb('0xb'),auth[_0xe0fb('0x4')](),controller[_0xe0fb('0xc')]);router['post']('/',auth[_0xe0fb('0x4')](),controller[_0xe0fb('0xd')]);router[_0xe0fb('0xe')]('/:id/messages',auth[_0xe0fb('0x4')](),controller[_0xe0fb('0xf')]);router[_0xe0fb('0xe')](_0xe0fb('0x10'),auth[_0xe0fb('0x4')](),interaction[_0xe0fb('0x11')]('mail','mailinteraction:addtags'),controller['addTags']);router['put']('/:id',auth['isAuthenticated'](),interaction[_0xe0fb('0x11')]('mail','mailinteraction:update'),controller[_0xe0fb('0x12')]);router[_0xe0fb('0x13')](_0xe0fb('0x7'),auth['isAuthenticated'](),interaction[_0xe0fb('0x11')]('mail',_0xe0fb('0x14')),controller[_0xe0fb('0x15')]);router[_0xe0fb('0x13')]('/:id/tags',auth['isAuthenticated'](),controller[_0xe0fb('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index d895d47..62a6e51 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 _0x2d4a=['sequelize','exports','BOOLEAN','DATE','STRING','long','TEXT','ENUM','out'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x2d4a,0xd8));var _0xa2d4=function(_0x3f8082,_0x285ed6){_0x3f8082=_0x3f8082-0x0;var _0x3b3fd8=_0x2d4a[_0x3f8082];return _0x3b3fd8;};'use strict';var Sequelize=require(_0xa2d4('0x0'));var iconv=require('iconv');module[_0xa2d4('0x1')]={'closed':{'type':Sequelize[_0xa2d4('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa2d4('0x3')]},'disposition':{'type':Sequelize[_0xa2d4('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xa2d4('0x4')]},'note':{'type':Sequelize[_0xa2d4('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xa2d4('0x4')]},'cc':{'type':Sequelize['TEXT'](_0xa2d4('0x5'))},'subject':{'type':Sequelize[_0xa2d4('0x6')]()},'attach':{'type':Sequelize[_0xa2d4('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0xa2d4('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xa2d4('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xa2d4('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa2d4('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xa2d4('0x7')]('in',_0xa2d4('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xa2d4('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xb761=['STRING','long','TEXT','ENUM','out','sequelize','iconv','exports','BOOLEAN','DATE'];(function(_0x2b3eca,_0x494147){var _0x56812b=function(_0xffe5b2){while(--_0xffe5b2){_0x2b3eca['push'](_0x2b3eca['shift']());}};_0x56812b(++_0x494147);}(_0xb761,0x113));var _0x1b76=function(_0x2e53e1,_0x12aed1){_0x2e53e1=_0x2e53e1-0x0;var _0x3a23de=_0xb761[_0x2e53e1];return _0x3a23de;};'use strict';var Sequelize=require(_0x1b76('0x0'));var iconv=require(_0x1b76('0x1'));module[_0x1b76('0x2')]={'closed':{'type':Sequelize[_0x1b76('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1b76('0x4')]},'disposition':{'type':Sequelize[_0x1b76('0x5')]},'secondDisposition':{'type':Sequelize[_0x1b76('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT'](_0x1b76('0x6'))},'subject':{'type':Sequelize[_0x1b76('0x7')]()},'attach':{'type':Sequelize[_0x1b76('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x1b76('0x4')]},'substatus':{'type':Sequelize[_0x1b76('0x5')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x1b76('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1b76('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x1b76('0x8')]('in',_0x1b76('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1b76('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 54da585..75803be 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 _0x9931=['destroy','error','stack','name','send','fullname','Tags','TagIds','split','forEach','push','MailMessage','findOne','out','plainBody','lastMsgText','trimStart','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','map','MailInteraction','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','select','field','from','tools_tags','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_messages','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','text','some','isEmpty','MailAccountId','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','c.email\x20LIKE\x20?','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','QueryTypes','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.updatedAt','i.closedAt','i.lastMsgDirection','i.secondDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.lastName','Contact.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.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','enableEmailPreview','all','params','rawAttributes','includeAll','include','options','create','body','update','describe','addMessage','ids','omit','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','rows','addTags','setTags','spread','color','removeTags','join','root','server','tmp','transcript-%d-%s.zip','attachments','Attachments','Messages','bcc','get','each','subject','decode','headers','Bcc','basename','existsSync','readFileSync','build','message%d.eml','download','unlinkSync','rimraf','moment','bluebird','util','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then'];(function(_0x1a2fb0,_0x54af73){var _0x50f574=function(_0x170543){while(--_0x170543){_0x1a2fb0['push'](_0x1a2fb0['shift']());}};_0x50f574(++_0x54af73);}(_0x9931,0x1b6));var _0x1993=function(_0x4b21b0,_0xa7f9e0){_0x4b21b0=_0x4b21b0-0x0;var _0xc1117a=_0x9931[_0x4b21b0];return _0xc1117a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1993('0x0'));var zipdir=require('zip-dir');var moment=require(_0x1993('0x1'));var BPromise=require(_0x1993('0x2'));var util=require(_0x1993('0x3'));var path=require(_0x1993('0x4'));var fs=require('fs');var _=require(_0x1993('0x5'));var squel=require(_0x1993('0x6'));var juice=require(_0x1993('0x7'));var Redis=require(_0x1993('0x8'));var qs=require(_0x1993('0x9'));var as=require(_0x1993('0xa'));var logger=require(_0x1993('0xb'))(_0x1993('0xc'));var config=require(_0x1993('0xd'));var db=require(_0x1993('0xe'))['db'];var htmlEntities=require(_0x1993('0xf'));config[_0x1993('0x10')]=_[_0x1993('0x11')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1993('0x12'))(new Redis(config[_0x1993('0x10')]));require(_0x1993('0x13'))[_0x1993('0x14')](socket);function respondWithStatusCode(_0x4179f4,_0x1b7419){_0x1b7419=_0x1b7419||0xcc;return function(_0x1b0480){if(_0x1b0480){return _0x4179f4[_0x1993('0x15')](_0x1b7419);}return _0x4179f4[_0x1993('0x16')](_0x1b7419)[_0x1993('0x17')]();};}function respondWithResult(_0x3c85d9,_0x336f62){_0x336f62=_0x336f62||0xc8;return function(_0x5aad93){if(_0x5aad93){return _0x3c85d9['status'](_0x336f62)[_0x1993('0x18')](_0x5aad93);}};}function respondWithFilteredResult(_0x73c803,_0x1c0fb4){return function(_0x30b908){if(_0x30b908){var _0x4ba1fb=typeof _0x1c0fb4[_0x1993('0x19')]===_0x1993('0x1a')&&typeof _0x1c0fb4[_0x1993('0x1b')]===_0x1993('0x1a');var _0x306ce2=_0x30b908[_0x1993('0x1c')];var _0x9c0ac5=_0x4ba1fb?0x0:_0x1c0fb4['offset'];var _0xadc21=_0x4ba1fb?_0x30b908['count']:_0x1c0fb4[_0x1993('0x19')]+_0x1c0fb4[_0x1993('0x1b')];var _0x54fca4;if(_0xadc21>=_0x306ce2){_0xadc21=_0x306ce2;_0x54fca4=0xc8;}else{_0x54fca4=0xce;}_0x73c803[_0x1993('0x16')](_0x54fca4);return _0x73c803[_0x1993('0x1d')](_0x1993('0x1e'),_0x9c0ac5+'-'+_0xadc21+'/'+_0x306ce2)[_0x1993('0x18')](_0x30b908);}return null;};}function saveUpdates(_0x17a94f){return function(_0xeaba5e){if(_0xeaba5e){return _0xeaba5e['update'](_0x17a94f)[_0x1993('0x1f')](function(_0x13e96d){return _0x13e96d;});}return null;};}function removeEntity(_0x404b8f){return function(_0x598a4b){if(_0x598a4b){return _0x598a4b[_0x1993('0x20')]()[_0x1993('0x1f')](function(){_0x404b8f[_0x1993('0x16')](0xcc)[_0x1993('0x17')]();});}};}function handleEntityNotFound(_0x4eca98){return function(_0x460c03){if(!_0x460c03){_0x4eca98[_0x1993('0x15')](0x194);}return _0x460c03;};}function handleError(_0x9b2a2a,_0x3ce344){_0x3ce344=_0x3ce344||0x1f4;return function(_0x1d4dae){logger[_0x1993('0x21')](_0x1d4dae[_0x1993('0x22')]);if(_0x1d4dae[_0x1993('0x23')]){delete _0x1d4dae[_0x1993('0x23')];}_0x9b2a2a[_0x1993('0x16')](_0x3ce344)[_0x1993('0x24')](_0x1d4dae);};}function getInteractionUsers(_0x50e8d4,_0x5002ce){return new BPromise(function(_0x130ffa,_0x2e046b){try{if(_0x5002ce[_0x50e8d4['id']]){_0x50e8d4['Users']=_['map'](_0x5002ce[_0x50e8d4['id']],function(_0x317bbc){return{'id':_0x317bbc['id'],'fullname':_0x317bbc[_0x1993('0x25')]};});}}catch(_0x31baaa){_0x2e046b(_0x31baaa);}_0x130ffa(_0x50e8d4);});}function getInteractionTags(_0x6ef2b8,_0x1ee545){return new BPromise(function(_0x472773,_0x4a8b57){try{if(_0x6ef2b8['TagIds']){_0x6ef2b8[_0x1993('0x26')]=[];_0x6ef2b8[_0x1993('0x27')][_0x1993('0x28')](',')[_0x1993('0x29')](function(_0x998e7e){_0x6ef2b8[_0x1993('0x26')][_0x1993('0x2a')](_0x1ee545[_0x998e7e]);});}delete _0x6ef2b8[_0x1993('0x27')];}catch(_0x1c3250){_0x4a8b57(_0x1c3250);}_0x472773(_0x6ef2b8);});}function getLastMessageText(_0xca1d58){return new BPromise(function(_0x51ee82,_0x226e29){return db[_0x1993('0x2b')][_0x1993('0x2c')]({'where':{'$and':[{'MailInteractionId':_0xca1d58['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x1993('0x2d')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':'-id','raw':!![]})[_0x1993('0x1f')](function(_0x208e79){if(_0x208e79&&_0x208e79[_0x1993('0x2e')]){_0xca1d58[_0x1993('0x2f')]=_[_0x1993('0x30')](_0x208e79['plainBody']);}_0x51ee82(_0xca1d58);})['catch'](function(_0x52e44f){_0x226e29(_0x52e44f);});});}function updateMailInteraction(_0x2a9c6a,_0x21fc68,_0x5913c9,_0x493fc7){return new BPromise(function(_0x56f6c7,_0x523ec7){return getInteractionUsers(_0x2a9c6a,_0x5913c9)['then'](function(_0x4f95e1){return getInteractionTags(_0x4f95e1,_0x21fc68);})[_0x1993('0x1f')](function(_0x22d1c8){return getStateInteraction(_0x22d1c8);})[_0x1993('0x1f')](function(_0x3878b2){if(_0x493fc7){_0x56f6c7(getLastMessageText(_0x3878b2));}else{_0x56f6c7(_0x3878b2);}})[_0x1993('0x31')](function(_0x66fb8a){_0x523ec7(_0x66fb8a);});});}function getStateInteraction(_0x292733){return new BPromise(function(_0x403d56){_0x292733[_0x1993('0x32')]=0x0;_0x292733[_0x1993('0x33')]=0x0;_0x292733[_0x1993('0x34')]=0x0;_0x292733[_0x1993('0x35')]=0x0;_0x292733[_0x1993('0x36')]=0x0;if(!_0x292733[_0x1993('0x37')]&&!_0x292733[_0x1993('0x38')]){_0x292733[_0x1993('0x32')]+=0x1;}if(!_0x292733[_0x1993('0x37')]&&_0x292733[_0x1993('0x38')]){_0x292733[_0x1993('0x33')]+=0x1;if(_0x292733[_0x1993('0x32')]){_0x292733[_0x1993('0x32')]-=0x1;}}if(_0x292733[_0x1993('0x37')]&&_0x292733['UserId']){_0x292733['answered']+=0x1;if(_0x292733['talking']){_0x292733['talking']-=0x1;}}if(_0x292733[_0x1993('0x37')]&&!_0x292733[_0x1993('0x38')]){_0x292733[_0x1993('0x35')]+=0x1;if(_0x292733[_0x1993('0x32')]){_0x292733[_0x1993('0x32')]-=0x1;}}_0x292733[_0x1993('0x36')]+=0x1;_0x403d56(_0x292733);});}exports[_0x1993('0x39')]=function(_0x407efd,_0x4f1a62){var _0x8ef296={},_0x47ff7a={},_0x4138e2={'count':0x0,'rows':[]};var _0x12278c=_[_0x1993('0x3a')](db[_0x1993('0x3b')]['rawAttributes'],function(_0x2ab9d0){return{'name':_0x2ab9d0[_0x1993('0x3c')],'type':_0x2ab9d0[_0x1993('0x3d')][_0x1993('0x3e')]};});_0x47ff7a[_0x1993('0x3f')]=_[_0x1993('0x3a')](_0x12278c,'name');_0x47ff7a[_0x1993('0x40')]=_[_0x1993('0x41')](_0x407efd[_0x1993('0x40')]);_0x47ff7a['filters']=_[_0x1993('0x42')](_0x47ff7a[_0x1993('0x3f')],_0x47ff7a['query']);_0x8ef296[_0x1993('0x43')]=_[_0x1993('0x42')](_0x47ff7a[_0x1993('0x3f')],qs[_0x1993('0x44')](_0x407efd[_0x1993('0x40')][_0x1993('0x44')]));_0x8ef296[_0x1993('0x43')]=_0x8ef296[_0x1993('0x43')][_0x1993('0x45')]?_0x8ef296[_0x1993('0x43')]:_0x47ff7a[_0x1993('0x3f')];if(!_0x407efd[_0x1993('0x40')][_0x1993('0x46')](_0x1993('0x47'))){_0x8ef296[_0x1993('0x1b')]=qs[_0x1993('0x1b')](_0x407efd[_0x1993('0x40')][_0x1993('0x1b')]);_0x8ef296[_0x1993('0x19')]=qs['offset'](_0x407efd[_0x1993('0x40')][_0x1993('0x19')]);}_0x8ef296[_0x1993('0x48')]=qs['sort'](_0x407efd[_0x1993('0x40')][_0x1993('0x49')]);_0x8ef296['where']=qs[_0x1993('0x4a')](_[_0x1993('0x4b')](_0x407efd[_0x1993('0x40')],_0x47ff7a[_0x1993('0x4a')]),_0x12278c);var _0x958fbc=[];var _0x132bbd=squel[_0x1993('0x4c')]()['field']('id')[_0x1993('0x4d')](_0x1993('0x23'))['field']('color')[_0x1993('0x4e')](_0x1993('0x4f'));var _0xfb2c18=squel['select']()[_0x1993('0x4d')]('u.id')['field'](_0x1993('0x50'))[_0x1993('0x4d')](_0x1993('0x51'))[_0x1993('0x4e')](_0x1993('0x52'),'ui')[_0x1993('0x53')](_0x1993('0x54'),'u',_0x1993('0x55'));var _0x46959e=squel[_0x1993('0x4c')]()[_0x1993('0x4e')](_0x1993('0x56'),'i')[_0x1993('0x53')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x1993('0x53')](_0x1993('0x54'),'o',_0x1993('0x57'))['left_join']('mail_accounts','a',_0x1993('0x58'))['left_join'](_0x1993('0x59'),'me','me.MailInteractionId\x20=\x20i.id')[_0x1993('0x53')](_0x1993('0x5a'),'it',_0x1993('0x5b'))[_0x1993('0x53')](_0x1993('0x4f'),'t',_0x1993('0x5c'));var _0x1b8a4b=squel[_0x1993('0x5d')]();var _0x1c847d=[];var _0x2ad40b=squel[_0x1993('0x5d')]();var _0x443bdf;if(_0x407efd[_0x1993('0x40')][_0x1993('0x5e')]){_0x443bdf=as[_0x1993('0x5f')](_0x407efd[_0x1993('0x40')][_0x1993('0x5e')]);var _0x37cbf5=_0x443bdf[_0x1993('0x60')];for(var _0x16ad9e=0x0;_0x16ad9e<_0x443bdf[_0x1993('0x61')][_0x1993('0x45')];_0x16ad9e++){var _0x1fd7ef=_0x443bdf[_0x1993('0x61')][_0x16ad9e];var _0x46859f='i';var _0x418928=_[_0x1993('0x62')](_0x12278c,[_0x1993('0x23'),_0x1fd7ef[_0x1993('0x4d')]]);if(!_0x418928){switch(_0x1fd7ef[_0x1993('0x4d')]){case _0x1993('0x63'):if(_0x1fd7ef[_0x1993('0x64')]==0x1){_0x46959e['having']('`'+_0x1fd7ef[_0x1993('0x4d')]+_0x1993('0x65'));}else{_0x46959e[_0x1993('0x66')]('`'+_0x1fd7ef[_0x1993('0x4d')]+'`\x20>\x200');}break;case _0x1993('0x67'):if(_0x1fd7ef[_0x1993('0x68')]===_0x1993('0x69')){if(_0x1fd7ef['value'][_0x1993('0x28')]('\x20')[_0x1993('0x45')]>0x1){_0x1b8a4b[_0x37cbf5](_0x1993('0x6a'),qs[_0x1993('0x6b')](_0x1fd7ef[_0x1993('0x64')]),null);}else{var _0x55cc11='%'+_0x1fd7ef['value']+'%';_0x1b8a4b[_0x37cbf5](_0x1993('0x6c'),_0x55cc11,_0x55cc11,_0x55cc11);}}else{_0x418928=_[_0x1993('0x62')](_0x12278c,[_0x1993('0x23'),'ContactId']);_0x1fd7ef['field']=_0x1993('0x6d');_0x3f7e72=as[_0x1993('0x6e')](_0x46859f,_0x418928[_0x1993('0x3d')],_0x1fd7ef);_0x1b8a4b[_0x37cbf5](_0x3f7e72['text'],_0x3f7e72[_0x1993('0x64')][_0x1993('0x6f')],_0x3f7e72[_0x1993('0x64')][_0x1993('0x17')]);}break;case _0x1993('0x70'):var _0xee089e=_0x1fd7ef[_0x1993('0x64')][_0x1993('0x28')](',')[_0x1993('0x3a')](function(_0x859f8d){return Number(_0x859f8d);});_0xee089e['forEach'](function(_0x52419a){_0x2ad40b['or'](_0x1993('0x71'),'%,'+_0x52419a+',%');});_0x1c847d=_[_0x1993('0x72')](_0x1c847d,_0xee089e);break;case'User':if(_0x1fd7ef['operator']===_0x1993('0x69')){_0x1b8a4b[_0x37cbf5]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x1fd7ef[_0x1993('0x64')]+'%',null);}else{_0x418928=_['find'](_0x12278c,['name',_0x1993('0x38')]);_0x1fd7ef[_0x1993('0x4d')]=_0x1993('0x38');_0x3f7e72=as[_0x1993('0x6e')](_0x46859f,_0x418928[_0x1993('0x3d')],_0x1fd7ef);_0x1b8a4b[_0x37cbf5](_0x3f7e72['text'],_0x3f7e72['value'][_0x1993('0x6f')],_0x3f7e72['value'][_0x1993('0x17')]);}break;case _0x1993('0x2e'):_0x3f7e72=as[_0x1993('0x6e')]('me',null,_0x1fd7ef);_0x1b8a4b[_0x37cbf5](_0x3f7e72[_0x1993('0x73')],_0x3f7e72[_0x1993('0x64')]['start'],_0x3f7e72[_0x1993('0x64')]['end']);break;}}else{var _0x3f7e72=as[_0x1993('0x6e')](_0x46859f,_0x418928[_0x1993('0x3d')],_0x1fd7ef);_0x1b8a4b[_0x37cbf5](_0x3f7e72[_0x1993('0x73')],_0x3f7e72['value'][_0x1993('0x6f')],_0x3f7e72[_0x1993('0x64')][_0x1993('0x17')]);}}}else{var _0x2f0383=_(_0x407efd[_0x1993('0x40')])[_0x1993('0x41')]()[_0x1993('0x3a')](function(_0x99006e){return _[_0x1993('0x74')](_0x12278c,[_0x1993('0x23'),_0x99006e])?_0x99006e:undefined;})['compact']()['value']();if(!_[_0x1993('0x75')](_0x2f0383)){_0x2f0383[_0x1993('0x29')](function(_0x47e657){if(_0x47e657===_0x1993('0x76')){_0x46959e[_0x1993('0x77')](_0x1993('0x78'),[][_0x1993('0x79')](_0x407efd[_0x1993('0x40')][_0x47e657]));}else if(_0x47e657===_0x1993('0x7a')){var _0x98006e=JSON[_0x1993('0x7b')](_0x407efd[_0x1993('0x40')][_0x47e657])['$gte'];var _0x56bde7=JSON[_0x1993('0x7b')](_0x407efd['query'][_0x47e657])[_0x1993('0x7c')];_0x46959e[_0x1993('0x77')](_0x1993('0x7d'),_0x98006e,_0x56bde7);}else{if(_0x407efd[_0x1993('0x40')][_0x47e657]===_0x1993('0x7e')){_0x46959e[_0x1993('0x77')]('i.'+_0x47e657+'\x20IS\x20NULL');}else{_0x46959e[_0x1993('0x77')]('i.'+_0x47e657+'\x20=\x20?',_0x407efd[_0x1993('0x40')][_0x47e657]);}}});}if(_0x407efd[_0x1993('0x40')][_0x1993('0x7f')]){if(_0x407efd[_0x1993('0x40')][_0x1993('0x7f')]==0x1){_0x46959e[_0x1993('0x66')](_0x1993('0x80'));}else{_0x46959e['having'](_0x1993('0x81'));}}if(_0x407efd['query'][_0x1993('0x82')]){_0x1c847d=_[_0x1993('0x83')](_0x407efd['query']['tag'])?_0x407efd[_0x1993('0x40')][_0x1993('0x82')]:new Array(_0x407efd[_0x1993('0x40')][_0x1993('0x82')]);_0x1c847d['forEach'](function(_0x5b155d){_0x2ad40b['or'](_0x1993('0x71'),'%,'+_0x5b155d+',%');});}if(_0x407efd[_0x1993('0x40')][_0x1993('0x84')]){var _0x4b1eb2=_0x407efd['query'][_0x1993('0x84')][_0x1993('0x85')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x1993('0x86')](_0x4b1eb2)){_0x1b8a4b['or']('i.id\x20LIKE\x20?',_0x4b1eb2+'%');}else if(qs[_0x1993('0x87')](_0x4b1eb2)){_0x1b8a4b['or'](_0x1993('0x88'),_0x4b1eb2+'%');}else{_0x1b8a4b['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x1993('0x6b')](_0x4b1eb2))['or'](_0x1993('0x89'),qs[_0x1993('0x6b')](_0x4b1eb2));}}}_0x46959e[_0x1993('0x77')](_0x1b8a4b);_0x46959e[_0x1993('0x8a')]('i.id');var _0x325bb3={'type':db[_0x1993('0x8b')][_0x1993('0x8c')]['SELECT'],'raw':!![]};var _0x569fb8=_0x46959e['clone']();_0x569fb8[_0x1993('0x4d')](_0x1993('0x8d'));_0x569fb8['field'](_0x1993('0x8e'),_0x1993('0x63'));if(_0x8ef296[_0x1993('0x48')]){_0x8ef296[_0x1993('0x48')][_0x1993('0x29')](function(_0x9cc3b3){var _0x2bf635=_0x9cc3b3[0x0]===_0x1993('0x8f')?_0x9cc3b3[0x0]:'i.'+_0x9cc3b3[0x0];_0x46959e[_0x1993('0x48')](_0x2bf635,_0x9cc3b3[0x1]===_0x1993('0x90')?![]:!![]);});}if(!_[_0x1993('0x75')](_0x1c847d)){_0x46959e[_0x1993('0x66')](_0x2ad40b);_0x569fb8[_0x1993('0x77')](_0x1993('0x91'),_0x1c847d);}BPromise[_0x1993('0x92')]()['then'](function(){if(!_0x443bdf){if(_0x407efd['query'][_0x1993('0x76')])return;_0x569fb8[_0x1993('0x77')](_0x1993('0x93'));_0x46959e[_0x1993('0x77')](_0x1993('0x93'));return;}if(_0x407efd['user'][_0x1993('0x94')]!==_0x1993('0x95'))return;return _0x407efd[_0x1993('0x96')][_0x1993('0x97')]({'attributes':['id'],'raw':!![]})[_0x1993('0x1f')](function(_0x4a6be7){if(_[_0x1993('0x75')](_0x4a6be7)){_0x569fb8['where'](_0x1993('0x98'));_0x46959e[_0x1993('0x77')](_0x1993('0x98'));}else{_0x569fb8['where'](_0x1993('0x78'),_[_0x1993('0x3a')](_0x4a6be7,'id'));_0x46959e[_0x1993('0x77')](_0x1993('0x78'),_[_0x1993('0x3a')](_0x4a6be7,'id'));}});})[_0x1993('0x1f')](function(){if(_0x407efd[_0x1993('0x96')][_0x1993('0x94')]===_0x1993('0x95')&&!_0x443bdf&&!_0x407efd[_0x1993('0x40')][_0x1993('0x76')])return[];return db[_0x1993('0x99')][_0x1993('0x40')](_0x569fb8[_0x1993('0x9a')](),_0x325bb3);})[_0x1993('0x1f')](function(_0x4a7eef){_0x4138e2[_0x1993('0x1c')]=_0x4a7eef['length'];if(_0x4138e2[_0x1993('0x1c')]===0x0)return[];return db['sequelize'][_0x1993('0x40')](_0x132bbd['toString'](),_0x325bb3)['then'](function(_0x26773e){_0x958fbc=_[_0x1993('0x9b')](_0x26773e,'id');_0x325bb3=_[_0x1993('0x9c')](_0x325bb3,{'model':db[_0x1993('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x407efd[_0x1993('0x40')][_0x1993('0x44')]){_0x8ef296['attributes'][_0x1993('0x29')](function(_0x3717fe){_0x46959e[_0x1993('0x4d')]('i.'+_0x3717fe);});}else{_0x46959e[_0x1993('0x4d')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x46959e['field']('a.key',_0x1993('0x9d'));_0x46959e['field'](_0x1993('0x9e'),_0x1993('0x9f'));_0x46959e[_0x1993('0x4d')](_0x1993('0xa0'),'contactName');_0x46959e[_0x1993('0x4d')]('i.id');_0x46959e['field']('i.createdAt');_0x46959e[_0x1993('0x4d')](_0x1993('0xa1'));_0x46959e['field']('i.closed');_0x46959e[_0x1993('0x4d')](_0x1993('0xa2'));_0x46959e['field']('i.attach');_0x46959e[_0x1993('0x4d')]('i.lastMsgAt');_0x46959e[_0x1993('0x4d')](_0x1993('0xa3'));_0x46959e[_0x1993('0x4d')]('i.subject');_0x46959e[_0x1993('0x4d')]('i.disposition');_0x46959e['field'](_0x1993('0xa4'));_0x46959e['field']('i.thirdDisposition');_0x46959e[_0x1993('0x4d')](_0x1993('0xa5'));_0x46959e['field'](_0x1993('0xa6'));_0x46959e[_0x1993('0x4d')](_0x1993('0xa7'));_0x46959e['field'](_0x1993('0xa8'));_0x46959e[_0x1993('0x4d')](_0x1993('0xa9'));_0x46959e['field'](_0x1993('0xaa'),'Contact.firstName');_0x46959e[_0x1993('0x4d')]('c.lastName',_0x1993('0xab'));_0x46959e[_0x1993('0x4d')]('c.email',_0x1993('0xac'));_0x46959e[_0x1993('0x4d')](_0x1993('0xad'),_0x1993('0xae'));_0x46959e[_0x1993('0x4d')](_0x1993('0xaf'),_0x1993('0xb0'));_0x46959e[_0x1993('0x4d')](_0x1993('0xb1'),_0x1993('0xb2'));_0x46959e[_0x1993('0x4d')](_0x1993('0xb3'),_0x1993('0xb4'));_0x46959e[_0x1993('0x4d')](_0x1993('0xb5'),'Owner.internal');_0x46959e[_0x1993('0x4d')](_0x1993('0xb6'),_0x1993('0x27'));}if(_0x8ef296[_0x1993('0x1b')])_0x46959e[_0x1993('0x1b')](_0x8ef296[_0x1993('0x1b')]);if(_0x8ef296['offset'])_0x46959e[_0x1993('0x19')](_0x8ef296[_0x1993('0x19')]);return db[_0x1993('0x99')]['query'](_0x46959e['toString'](),_0x325bb3);})[_0x1993('0x1f')](function(_0x361ff1){if(_0x361ff1[_0x1993('0x45')]>0x0)_0xfb2c18[_0x1993('0x77')](_0x1993('0xb7'),_[_0x1993('0x3a')](_0x361ff1,'id'));return db['sequelize'][_0x1993('0x40')](_0xfb2c18[_0x1993('0x9a')](),_0x325bb3)[_0x1993('0x1f')](function(_0x3c1a0d){var _0x20e814=_[_0x1993('0xb8')](_0x3c1a0d,_0x1993('0xb9'));var _0x1e659e=[];return db['Setting'][_0x1993('0x2c')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0x1993('0x1f')](function(_0x5cb244){var _0x594b10=_0x5cb244[_0x1993('0xba')];_0x361ff1[_0x1993('0x29')](function(_0x23b14c){_0x1e659e[_0x1993('0x2a')](updateMailInteraction(_0x23b14c,_0x958fbc,_0x20e814,_0x594b10));});return BPromise[_0x1993('0xbb')](_0x1e659e);});});});})[_0x1993('0x1f')](function(_0x44d05b){_0x4138e2['rows']=_0x44d05b;return _0x4138e2;})['then'](respondWithFilteredResult(_0x4f1a62,_0x8ef296))[_0x1993('0x31')](handleError(_0x4f1a62,null));};exports['show']=function(_0x46da53,_0x3abdba){var _0x113b96={'raw':![],'where':{'id':_0x46da53[_0x1993('0xbc')]['id']}},_0x4528be={};_0x4528be[_0x1993('0x3f')]=_['keys'](db[_0x1993('0x3b')][_0x1993('0xbd')]);_0x4528be['query']=_[_0x1993('0x41')](_0x46da53[_0x1993('0x40')]);_0x4528be[_0x1993('0x4a')]=_[_0x1993('0x42')](_0x4528be[_0x1993('0x3f')],_0x4528be[_0x1993('0x40')]);_0x113b96[_0x1993('0x43')]=_[_0x1993('0x42')](_0x4528be['model'],qs['fields'](_0x46da53[_0x1993('0x40')][_0x1993('0x44')]));_0x113b96['attributes']=_0x113b96[_0x1993('0x43')][_0x1993('0x45')]?_0x113b96[_0x1993('0x43')]:_0x4528be['model'];if(_0x46da53['query'][_0x1993('0xbe')]){_0x113b96[_0x1993('0xbf')]=[{'all':!![]}];}_0x113b96=_['merge']({},_0x113b96,_0x46da53[_0x1993('0xc0')]);return db[_0x1993('0x3b')]['find'](_0x113b96)[_0x1993('0x1f')](handleEntityNotFound(_0x3abdba,null))['then'](respondWithResult(_0x3abdba,null))[_0x1993('0x31')](handleError(_0x3abdba,null));};exports['create']=function(_0xd60c58,_0x3b5aad){return db[_0x1993('0x3b')][_0x1993('0xc1')](_0xd60c58[_0x1993('0xc2')],{})['then'](respondWithResult(_0x3b5aad,0xc9))[_0x1993('0x31')](handleError(_0x3b5aad,null));};exports[_0x1993('0xc3')]=function(_0x2e8174,_0x404cc3){if(_0x2e8174[_0x1993('0xc2')]['id']){delete _0x2e8174[_0x1993('0xc2')]['id'];}return db[_0x1993('0x3b')][_0x1993('0x62')]({'where':{'id':_0x2e8174[_0x1993('0xbc')]['id']}})['then'](handleEntityNotFound(_0x404cc3,null))[_0x1993('0x1f')](saveUpdates(_0x2e8174[_0x1993('0xc2')],null))[_0x1993('0x1f')](respondWithResult(_0x404cc3,null))[_0x1993('0x31')](handleError(_0x404cc3,null));};exports['destroy']=function(_0x4ed2e5,_0x410d0d){return db[_0x1993('0x3b')][_0x1993('0x62')]({'where':{'id':_0x4ed2e5[_0x1993('0xbc')]['id']}})[_0x1993('0x1f')](handleEntityNotFound(_0x410d0d,null))[_0x1993('0x1f')](removeEntity(_0x410d0d,null))['catch'](handleError(_0x410d0d,null));};exports[_0x1993('0xc4')]=function(_0x40632c,_0x3d598e){return db[_0x1993('0x3b')]['describe']()[_0x1993('0x1f')](respondWithResult(_0x3d598e,null))[_0x1993('0x31')](handleError(_0x3d598e,null));};exports[_0x1993('0xc5')]=function(_0x1d7b12,_0x594658){return db[_0x1993('0x2b')][_0x1993('0x62')]({'where':{'id':_0x1d7b12[_0x1993('0xbc')]['id']}})[_0x1993('0x1f')](handleEntityNotFound(_0x594658,null))[_0x1993('0x1f')](function(_0x194111){if(_0x194111){return _0x194111[_0x1993('0xc5')](_0x1d7b12[_0x1993('0xc2')][_0x1993('0xc6')],_[_0x1993('0xc7')](_0x1d7b12[_0x1993('0xc2')],['ids','id'])||{});}})['then'](respondWithResult(_0x594658,null))[_0x1993('0x31')](handleError(_0x594658,null));};exports[_0x1993('0xc8')]=function(_0x403eff,_0x579ad7){var _0x4cd799={'raw':![],'where':{}};var _0x3fd23e={};var _0x167858={'count':0x0,'rows':[]};return db[_0x1993('0x3b')]['findOne']({'where':{'id':_0x403eff['params']['id']}})['then'](handleEntityNotFound(_0x579ad7,null))[_0x1993('0x1f')](function(_0xb73446){if(_0xb73446){_0x3fd23e['model']=_[_0x1993('0x41')](db['MailMessage'][_0x1993('0xbd')]);_0x3fd23e['query']=_[_0x1993('0x41')](_0x403eff['query']);_0x3fd23e['filters']=_[_0x1993('0x42')](_0x3fd23e[_0x1993('0x3f')],_0x3fd23e[_0x1993('0x40')]);_0x4cd799['attributes']=_[_0x1993('0x42')](_0x3fd23e[_0x1993('0x3f')],qs[_0x1993('0x44')](_0x403eff[_0x1993('0x40')]['fields']));_0x4cd799[_0x1993('0x43')]=_0x4cd799[_0x1993('0x43')]['length']?_0x4cd799[_0x1993('0x43')]:_0x3fd23e[_0x1993('0x3f')];if(!_0x403eff['query'][_0x1993('0x46')](_0x1993('0x47'))){_0x4cd799[_0x1993('0x1b')]=qs['limit'](_0x403eff[_0x1993('0x40')][_0x1993('0x1b')]);_0x4cd799[_0x1993('0x19')]=qs['offset'](_0x403eff['query']['offset']);}_0x4cd799[_0x1993('0x48')]=qs['sort'](_0x403eff[_0x1993('0x40')][_0x1993('0x49')]);_0x4cd799[_0x1993('0x77')]=qs['filters'](_['pick'](_0x403eff[_0x1993('0x40')],_0x3fd23e[_0x1993('0x4a')]));_0x4cd799['where']['MailInteractionId']=_0xb73446['id'];if(_0x403eff[_0x1993('0x40')][_0x1993('0x84')]){_0x4cd799['where']=_[_0x1993('0x9c')](_0x4cd799['where'],{'$or':_[_0x1993('0x3a')](_0x4cd799[_0x1993('0x43')],function(_0x5c8cbf){var _0xde2e45={};_0xde2e45[_0x5c8cbf]={'$like':'%'+_0x403eff[_0x1993('0x40')][_0x1993('0x84')]+'%'};return _0xde2e45;})});}if(_0x403eff[_0x1993('0x40')][_0x1993('0xc9')]){var _0x411ba9=_0x403eff[_0x1993('0x40')][_0x1993('0xc9')][_0x1993('0x28')](',');var _0x23d72c={};_0x23d72c[_0x411ba9[0x0]]={'$gte':moment(_0x411ba9[0x1])[_0x1993('0xca')](_0x1993('0xcb'))};_0x4cd799[_0x1993('0x77')]=_['merge'](_0x4cd799[_0x1993('0x77')],_0x23d72c);}_0x4cd799=_[_0x1993('0x9c')]({},_0x4cd799,_0x403eff[_0x1993('0xc0')]);return db[_0x1993('0x2b')]['count']({'where':_0x4cd799['where']})[_0x1993('0x1f')](function(_0x39c3fb){_0x167858[_0x1993('0x1c')]=_0x39c3fb;if(_0x403eff['query'][_0x1993('0xbe')]){_0x4cd799[_0x1993('0xbf')]=[{'all':!![]}];}return db['MailMessage'][_0x1993('0xcc')](_0x4cd799);})[_0x1993('0x1f')](function(_0x470a67){if(_0x403eff[_0x1993('0x40')][_0x1993('0xcd')]===_0x1993('0xce')){for(var _0x4bda90=0x0;_0x4bda90<_0x470a67['length'];_0x4bda90++){_0x470a67[_0x4bda90][_0x1993('0xc2')]=juice(_0x470a67[_0x4bda90][_0x1993('0xc2')]);}}_0x167858[_0x1993('0xcf')]=_0x470a67;return _0x167858;});}})[_0x1993('0x1f')](respondWithFilteredResult(_0x579ad7,_0x4cd799))['catch'](handleError(_0x579ad7,null));};exports[_0x1993('0xd0')]=function(_0x30bb37,_0x5d3d9e){return db[_0x1993('0x3b')]['find']({'where':{'id':_0x30bb37[_0x1993('0xbc')]['id']}})[_0x1993('0x1f')](handleEntityNotFound(_0x5d3d9e,null))[_0x1993('0x1f')](function(_0x2bd905){if(_0x2bd905){return _0x2bd905[_0x1993('0xd1')](_0x30bb37[_0x1993('0xc2')][_0x1993('0xc6')],_['omit'](_0x30bb37[_0x1993('0xc2')],['ids','id'])||{})[_0x1993('0xd2')](function(){return db[_0x1993('0x70')]['findAll']({'attributes':['id',_0x1993('0x23'),_0x1993('0xd3')],'where':{'id':_0x30bb37['body']['ids']}});})[_0x1993('0x1f')](function(_0x2122df){socket['emit']('mailInteractionTags:save',{'id':Number(_0x30bb37[_0x1993('0xbc')]['id']),'tags':_0x2122df||[]});return{'id':Number(_0x30bb37['params']['id']),'tags':_0x2122df||[]};});}})[_0x1993('0x1f')](respondWithResult(_0x5d3d9e,null))['catch'](handleError(_0x5d3d9e,null));};exports[_0x1993('0xd4')]=function(_0x3c1f5c,_0x208cf7){return db[_0x1993('0x3b')][_0x1993('0x62')]({'where':{'id':_0x3c1f5c[_0x1993('0xbc')]['id']}})[_0x1993('0x1f')](handleEntityNotFound(_0x208cf7,null))['then'](function(_0x4ef34e){if(_0x4ef34e){return _0x4ef34e['removeTags'](_0x3c1f5c[_0x1993('0x40')][_0x1993('0xc6')]);}})['then'](respondWithStatusCode(_0x208cf7,null))[_0x1993('0x31')](handleError(_0x208cf7,null));};exports['download']=function(_0x24be14,_0x4b111e){var _0xa113d4=moment()['unix']()[_0x1993('0x9a')]();var _0x18c047=path[_0x1993('0xd5')](config[_0x1993('0xd6')],_0x1993('0xd7'),'files',_0x1993('0xd8'));var _0x4a473a=path['join'](config[_0x1993('0xd6')],_0x1993('0xd7'),'files','attachments');var _0x5e78f9=path[_0x1993('0xd5')](_0x18c047,_0xa113d4);var _0x218e9c=util[_0x1993('0xca')](_0x1993('0xd9'),_0x24be14[_0x1993('0xbc')]['id'],_0xa113d4);var _0x361cf4=path[_0x1993('0xd5')](_0x18c047,_0x218e9c);var _0x57a7e7=[];if(_0x24be14[_0x1993('0x40')][_0x1993('0xda')]){_0x57a7e7[_0x1993('0x2a')]({'model':db['Attachment'],'as':_0x1993('0xdb'),'raw':!![]});}var _0x3656f4=[{'model':db[_0x1993('0x2b')],'as':_0x1993('0xdc'),'attributes':['id','body',_0x1993('0x4e'),'to','cc',_0x1993('0xdd'),'subject',_0x1993('0x7a')],'where':{'secret':![]},'order':qs[_0x1993('0x49')]('id'),'include':_0x57a7e7}];return db[_0x1993('0x3b')][_0x1993('0x62')]({'where':{'id':_0x24be14[_0x1993('0xbc')]['id']},'include':_0x3656f4})['then'](handleEntityNotFound(_0x4b111e,null))[_0x1993('0x1f')](function(_0x406949){if(_0x406949&&_0x406949['Messages']){var _0x2ff314=_0x406949[_0x1993('0xde')]({'plain':!![]});fs['mkdirSync'](_0x5e78f9);return BPromise[_0x1993('0xdf')](_0x2ff314[_0x1993('0xdc')],function(_0x96983d,_0x5857a2){var _0x466c4c={'from':_0x96983d[_0x1993('0x4e')],'to':_0x96983d['to'],'subject':_0x96983d[_0x1993('0xe0')],'html':htmlEntities[_0x1993('0xe1')](_0x96983d[_0x1993('0xc2')]),'headers':{'Date':moment(_0x96983d[_0x1993('0x7a')])[_0x1993('0xca')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x96983d['cc']){_0x466c4c[_0x1993('0xe2')]['Cc']=_0x96983d['cc'];}if(_0x96983d[_0x1993('0xdd')]){_0x466c4c[_0x1993('0xe2')][_0x1993('0xe3')]=_0x96983d[_0x1993('0xdd')];}return new BPromise(function(_0x3e704c,_0x50946b){if(_0x96983d[_0x1993('0xdb')]){for(var _0x1499d3=0x0;_0x1499d3<_0x96983d[_0x1993('0xdb')][_0x1993('0x45')];_0x1499d3++){var _0x36c8cc=_0x96983d[_0x1993('0xdb')][_0x1499d3];var _0x5dff6f=path['join'](_0x4a473a,_0x36c8cc[_0x1993('0xe4')]);if(fs[_0x1993('0xe5')](_0x5dff6f)){_0x466c4c[_0x1993('0xda')][_0x1993('0x2a')]({'name':_0x36c8cc[_0x1993('0x23')],'contentType':_0x36c8cc[_0x1993('0x3d')],'data':fs[_0x1993('0xe6')](_0x5dff6f)});}}}emlformat[_0x1993('0xe7')](_0x466c4c,function(_0x3d01fb,_0x4ab893){if(_0x3d01fb)return _0x50946b(_0x3d01fb);fs['writeFileSync'](path[_0x1993('0xd5')](_0x5e78f9,util['format'](_0x1993('0xe8'),_0x5857a2)),_0x4ab893);return _0x3e704c(_0x4ab893);});});})['then'](function(){return new BPromise(function(_0x17a715,_0x28f754){zipdir(_0x5e78f9,{'saveTo':_0x361cf4},function(_0x279205,_0x4b5810){if(_0x279205)return _0x28f754(_0x279205);return _0x17a715(_0x4b5810);});})['then'](function(){return new BPromise(function(_0xcb8c8f,_0x14dcfd){rimraf(_0x5e78f9,function(_0x339632){if(_0x339632)_0x14dcfd(_0x339632);return _0xcb8c8f();});});})[_0x1993('0x1f')](function(){return _0x4b111e[_0x1993('0xe9')](_0x361cf4,_0x218e9c,function(_0x1587d7){if(!_0x1587d7)fs[_0x1993('0xea')](_0x361cf4);});});});}else{return _0x4b111e[_0x1993('0x15')](0xc8);}})[_0x1993('0x31')](handleError(_0x4b111e,null));}; \ No newline at end of file +var _0xa8a0=['select','field','color','from','tools_tags','ui.MailInteractionId','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','value','having','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','isEmpty','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','i.MailAccountId\x20IS\x20NULL','role','agent','sequelize','toString','unreadMessages','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.closed','i.attach','i.lastMsgAt','i.lastMsgDirection','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.UserId','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','all','show','params','rawAttributes','includeAll','include','merge','create','body','destroy','describe','addMessage','ids','omit','nolimit','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','inlineCss','true','rows','spread','emit','mailInteractionTags:save','removeTags','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','get','mkdirSync','each','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','readFileSync','build','writeFileSync','message%d.eml','download','unlinkSync','eml-format','rimraf','moment','path','squel','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','error','stack','name','send','Users','map','fullname','TagIds','split','forEach','push','MailMessage','findOne','out','plainBody','-id','lastMsgText','catch','waiting','talking','answered','unmanaged','total','closed','UserId','index','MailInteraction','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick'];(function(_0x3ff488,_0x4b2a72){var _0x1c61f6=function(_0x2b0d40){while(--_0x2b0d40){_0x3ff488['push'](_0x3ff488['shift']());}};_0x1c61f6(++_0x4b2a72);}(_0xa8a0,0x9e));var _0x0a8a=function(_0x439f24,_0x4c949b){_0x439f24=_0x439f24-0x0;var _0x352b6e=_0xa8a0[_0x439f24];return _0x352b6e;};'use strict';var emlformat=require(_0x0a8a('0x0'));var rimraf=require(_0x0a8a('0x1'));var zipdir=require('zip-dir');var moment=require(_0x0a8a('0x2'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x0a8a('0x3'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0a8a('0x4'));var juice=require(_0x0a8a('0x5'));var Redis=require(_0x0a8a('0x6'));var qs=require(_0x0a8a('0x7'));var as=require(_0x0a8a('0x8'));var logger=require(_0x0a8a('0x9'))(_0x0a8a('0xa'));var config=require(_0x0a8a('0xb'));var db=require(_0x0a8a('0xc'))['db'];var htmlEntities=require(_0x0a8a('0xd'));config[_0x0a8a('0xe')]=_['defaults'](config[_0x0a8a('0xe')],{'host':_0x0a8a('0xf'),'port':0x18eb});var socket=require(_0x0a8a('0x10'))(new Redis(config['redis']));require('./mailInteraction.socket')[_0x0a8a('0x11')](socket);function respondWithStatusCode(_0x167cac,_0x56881c){_0x56881c=_0x56881c||0xcc;return function(_0x5d6d51){if(_0x5d6d51){return _0x167cac[_0x0a8a('0x12')](_0x56881c);}return _0x167cac[_0x0a8a('0x13')](_0x56881c)[_0x0a8a('0x14')]();};}function respondWithResult(_0x1b5a09,_0x4a102f){_0x4a102f=_0x4a102f||0xc8;return function(_0x176a88){if(_0x176a88){return _0x1b5a09[_0x0a8a('0x13')](_0x4a102f)[_0x0a8a('0x15')](_0x176a88);}};}function respondWithFilteredResult(_0x2adf3a,_0x123802){return function(_0x2102a4){if(_0x2102a4){var _0x373fba=typeof _0x123802[_0x0a8a('0x16')]===_0x0a8a('0x17')&&typeof _0x123802[_0x0a8a('0x18')]===_0x0a8a('0x17');var _0x970dd9=_0x2102a4[_0x0a8a('0x19')];var _0x4e5f49=_0x373fba?0x0:_0x123802[_0x0a8a('0x16')];var _0x114369=_0x373fba?_0x2102a4[_0x0a8a('0x19')]:_0x123802['offset']+_0x123802[_0x0a8a('0x18')];var _0x41923d;if(_0x114369>=_0x970dd9){_0x114369=_0x970dd9;_0x41923d=0xc8;}else{_0x41923d=0xce;}_0x2adf3a[_0x0a8a('0x13')](_0x41923d);return _0x2adf3a[_0x0a8a('0x1a')]('Content-Range',_0x4e5f49+'-'+_0x114369+'/'+_0x970dd9)[_0x0a8a('0x15')](_0x2102a4);}return null;};}function saveUpdates(_0x41ca5c){return function(_0x8b6a4f){if(_0x8b6a4f){return _0x8b6a4f[_0x0a8a('0x1b')](_0x41ca5c)[_0x0a8a('0x1c')](function(_0xbd70ae){return _0xbd70ae;});}return null;};}function removeEntity(_0x464742){return function(_0x303aa0){if(_0x303aa0){return _0x303aa0['destroy']()['then'](function(){_0x464742[_0x0a8a('0x13')](0xcc)[_0x0a8a('0x14')]();});}};}function handleEntityNotFound(_0x4c0df7){return function(_0x3066fc){if(!_0x3066fc){_0x4c0df7['sendStatus'](0x194);}return _0x3066fc;};}function handleError(_0x4b6cdb,_0x389b4b){_0x389b4b=_0x389b4b||0x1f4;return function(_0x47be1e){logger[_0x0a8a('0x1d')](_0x47be1e[_0x0a8a('0x1e')]);if(_0x47be1e[_0x0a8a('0x1f')]){delete _0x47be1e['name'];}_0x4b6cdb['status'](_0x389b4b)[_0x0a8a('0x20')](_0x47be1e);};}function getInteractionUsers(_0x53fad0,_0x25ae49){return new BPromise(function(_0x2c18a3,_0x3a4173){try{if(_0x25ae49[_0x53fad0['id']]){_0x53fad0[_0x0a8a('0x21')]=_[_0x0a8a('0x22')](_0x25ae49[_0x53fad0['id']],function(_0x15b6fd){return{'id':_0x15b6fd['id'],'fullname':_0x15b6fd[_0x0a8a('0x23')]};});}}catch(_0x2fa90c){_0x3a4173(_0x2fa90c);}_0x2c18a3(_0x53fad0);});}function getInteractionTags(_0x2ccea4,_0x4f526d){return new BPromise(function(_0x4231a6,_0x186262){try{if(_0x2ccea4['TagIds']){_0x2ccea4['Tags']=[];_0x2ccea4[_0x0a8a('0x24')][_0x0a8a('0x25')](',')[_0x0a8a('0x26')](function(_0xb08928){_0x2ccea4['Tags'][_0x0a8a('0x27')](_0x4f526d[_0xb08928]);});}delete _0x2ccea4[_0x0a8a('0x24')];}catch(_0x12d44e){_0x186262(_0x12d44e);}_0x4231a6(_0x2ccea4);});}function getLastMessageText(_0x25d2a3){return new BPromise(function(_0x3e786e,_0x56d0d7){return db[_0x0a8a('0x28')][_0x0a8a('0x29')]({'where':{'$and':[{'MailInteractionId':_0x25d2a3['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x0a8a('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x0a8a('0x2b')],'order':_0x0a8a('0x2c'),'raw':!![]})['then'](function(_0x3ec9b1){if(_0x3ec9b1&&_0x3ec9b1[_0x0a8a('0x2b')]){_0x25d2a3[_0x0a8a('0x2d')]=_['trimStart'](_0x3ec9b1[_0x0a8a('0x2b')]);}_0x3e786e(_0x25d2a3);})[_0x0a8a('0x2e')](function(_0x2f66de){_0x56d0d7(_0x2f66de);});});}function updateMailInteraction(_0xebed3b,_0x36d939,_0x5b2bb8,_0x5d3d56){return new BPromise(function(_0x197b05,_0x3c8f27){return getInteractionUsers(_0xebed3b,_0x5b2bb8)[_0x0a8a('0x1c')](function(_0x16eb41){return getInteractionTags(_0x16eb41,_0x36d939);})['then'](function(_0x24424a){return getStateInteraction(_0x24424a);})[_0x0a8a('0x1c')](function(_0x37c3e7){if(_0x5d3d56){_0x197b05(getLastMessageText(_0x37c3e7));}else{_0x197b05(_0x37c3e7);}})['catch'](function(_0x1fc4ac){_0x3c8f27(_0x1fc4ac);});});}function getStateInteraction(_0x56ccd8){return new BPromise(function(_0x133104){_0x56ccd8[_0x0a8a('0x2f')]=0x0;_0x56ccd8[_0x0a8a('0x30')]=0x0;_0x56ccd8[_0x0a8a('0x31')]=0x0;_0x56ccd8[_0x0a8a('0x32')]=0x0;_0x56ccd8[_0x0a8a('0x33')]=0x0;if(!_0x56ccd8[_0x0a8a('0x34')]&&!_0x56ccd8[_0x0a8a('0x35')]){_0x56ccd8['waiting']+=0x1;}if(!_0x56ccd8[_0x0a8a('0x34')]&&_0x56ccd8['UserId']){_0x56ccd8[_0x0a8a('0x30')]+=0x1;if(_0x56ccd8['waiting']){_0x56ccd8[_0x0a8a('0x2f')]-=0x1;}}if(_0x56ccd8[_0x0a8a('0x34')]&&_0x56ccd8[_0x0a8a('0x35')]){_0x56ccd8[_0x0a8a('0x31')]+=0x1;if(_0x56ccd8['talking']){_0x56ccd8[_0x0a8a('0x30')]-=0x1;}}if(_0x56ccd8[_0x0a8a('0x34')]&&!_0x56ccd8[_0x0a8a('0x35')]){_0x56ccd8[_0x0a8a('0x32')]+=0x1;if(_0x56ccd8[_0x0a8a('0x2f')]){_0x56ccd8['waiting']-=0x1;}}_0x56ccd8['total']+=0x1;_0x133104(_0x56ccd8);});}exports[_0x0a8a('0x36')]=function(_0x3486ea,_0x4e7abe){var _0xba70bb={},_0x82f4fa={},_0x2f35ad={'count':0x0,'rows':[]};var _0x40d154=_[_0x0a8a('0x22')](db[_0x0a8a('0x37')]['rawAttributes'],function(_0x47094c){return{'name':_0x47094c[_0x0a8a('0x38')],'type':_0x47094c['type'][_0x0a8a('0x39')]};});_0x82f4fa[_0x0a8a('0x3a')]=_[_0x0a8a('0x22')](_0x40d154,_0x0a8a('0x1f'));_0x82f4fa['query']=_[_0x0a8a('0x3b')](_0x3486ea[_0x0a8a('0x3c')]);_0x82f4fa[_0x0a8a('0x3d')]=_[_0x0a8a('0x3e')](_0x82f4fa[_0x0a8a('0x3a')],_0x82f4fa[_0x0a8a('0x3c')]);_0xba70bb[_0x0a8a('0x3f')]=_['intersection'](_0x82f4fa[_0x0a8a('0x3a')],qs[_0x0a8a('0x40')](_0x3486ea[_0x0a8a('0x3c')][_0x0a8a('0x40')]));_0xba70bb[_0x0a8a('0x3f')]=_0xba70bb['attributes'][_0x0a8a('0x41')]?_0xba70bb['attributes']:_0x82f4fa[_0x0a8a('0x3a')];if(!_0x3486ea[_0x0a8a('0x3c')][_0x0a8a('0x42')]('nolimit')){_0xba70bb['limit']=qs[_0x0a8a('0x18')](_0x3486ea[_0x0a8a('0x3c')][_0x0a8a('0x18')]);_0xba70bb[_0x0a8a('0x16')]=qs['offset'](_0x3486ea[_0x0a8a('0x3c')][_0x0a8a('0x16')]);}_0xba70bb[_0x0a8a('0x43')]=qs['sort'](_0x3486ea[_0x0a8a('0x3c')][_0x0a8a('0x44')]);_0xba70bb[_0x0a8a('0x45')]=qs[_0x0a8a('0x3d')](_[_0x0a8a('0x46')](_0x3486ea['query'],_0x82f4fa['filters']),_0x40d154);var _0x3d7da7=[];var _0x2cf201=squel[_0x0a8a('0x47')]()[_0x0a8a('0x48')]('id')[_0x0a8a('0x48')]('name')[_0x0a8a('0x48')](_0x0a8a('0x49'))[_0x0a8a('0x4a')](_0x0a8a('0x4b'));var _0x48902a=squel[_0x0a8a('0x47')]()[_0x0a8a('0x48')]('u.id')[_0x0a8a('0x48')]('u.fullname')['field'](_0x0a8a('0x4c'))[_0x0a8a('0x4a')]('user_has_mail_interactions','ui')[_0x0a8a('0x4d')](_0x0a8a('0x4e'),'u',_0x0a8a('0x4f'));var _0x5444d2=squel[_0x0a8a('0x47')]()[_0x0a8a('0x4a')](_0x0a8a('0x50'),'i')[_0x0a8a('0x4d')](_0x0a8a('0x51'),'c',_0x0a8a('0x52'))[_0x0a8a('0x4d')]('users','o',_0x0a8a('0x53'))[_0x0a8a('0x4d')]('mail_accounts','a',_0x0a8a('0x54'))[_0x0a8a('0x4d')]('mail_messages','me','me.MailInteractionId\x20=\x20i.id')['left_join']('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id')[_0x0a8a('0x4d')](_0x0a8a('0x4b'),'t',_0x0a8a('0x55'));var _0x17bd72=squel[_0x0a8a('0x56')]();var _0x203920=[];var _0x22ca96=squel[_0x0a8a('0x56')]();var _0xb68e80;if(_0x3486ea[_0x0a8a('0x3c')]['search']){_0xb68e80=as['parseSearch'](_0x3486ea[_0x0a8a('0x3c')][_0x0a8a('0x57')]);var _0x33bc9e=_0xb68e80[_0x0a8a('0x58')];for(var _0x165d88=0x0;_0x165d88<_0xb68e80['conditions'][_0x0a8a('0x41')];_0x165d88++){var _0x34f52a=_0xb68e80[_0x0a8a('0x59')][_0x165d88];var _0x21889d='i';var _0xa6745d=_[_0x0a8a('0x5a')](_0x40d154,[_0x0a8a('0x1f'),_0x34f52a[_0x0a8a('0x48')]]);if(!_0xa6745d){switch(_0x34f52a[_0x0a8a('0x48')]){case'unreadMessages':if(_0x34f52a[_0x0a8a('0x5b')]==0x1){_0x5444d2['having']('`'+_0x34f52a[_0x0a8a('0x48')]+'`\x20=\x200');}else{_0x5444d2[_0x0a8a('0x5c')]('`'+_0x34f52a[_0x0a8a('0x48')]+'`\x20>\x200');}break;case'Contact':if(_0x34f52a[_0x0a8a('0x5d')]===_0x0a8a('0x5e')){if(_0x34f52a[_0x0a8a('0x5b')][_0x0a8a('0x25')]('\x20')['length']>0x1){_0x17bd72[_0x33bc9e]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0a8a('0x5f')](_0x34f52a['value']),null);}else{var _0x3c4e76='%'+_0x34f52a[_0x0a8a('0x5b')]+'%';_0x17bd72[_0x33bc9e](_0x0a8a('0x60'),_0x3c4e76,_0x3c4e76,_0x3c4e76);}}else{_0xa6745d=_[_0x0a8a('0x5a')](_0x40d154,[_0x0a8a('0x1f'),_0x0a8a('0x61')]);_0x34f52a[_0x0a8a('0x48')]=_0x0a8a('0x61');_0x188570=as[_0x0a8a('0x62')](_0x21889d,_0xa6745d[_0x0a8a('0x63')],_0x34f52a);_0x17bd72[_0x33bc9e](_0x188570['text'],_0x188570['value'][_0x0a8a('0x64')],_0x188570['value']['end']);}break;case _0x0a8a('0x65'):var _0x265d1a=_0x34f52a[_0x0a8a('0x5b')][_0x0a8a('0x25')](',')['map'](function(_0x37ac25){return Number(_0x37ac25);});_0x265d1a[_0x0a8a('0x26')](function(_0x20a84b){_0x22ca96['or'](_0x0a8a('0x66'),'%,'+_0x20a84b+',%');});_0x203920=_['union'](_0x203920,_0x265d1a);break;case _0x0a8a('0x67'):if(_0x34f52a[_0x0a8a('0x5d')]==='$substring'){_0x17bd72[_0x33bc9e](_0x0a8a('0x68'),'%'+_0x34f52a[_0x0a8a('0x5b')]+'%',null);}else{_0xa6745d=_[_0x0a8a('0x5a')](_0x40d154,[_0x0a8a('0x1f'),_0x0a8a('0x35')]);_0x34f52a[_0x0a8a('0x48')]=_0x0a8a('0x35');_0x188570=as[_0x0a8a('0x62')](_0x21889d,_0xa6745d[_0x0a8a('0x63')],_0x34f52a);_0x17bd72[_0x33bc9e](_0x188570[_0x0a8a('0x69')],_0x188570[_0x0a8a('0x5b')][_0x0a8a('0x64')],_0x188570['value']['end']);}break;case _0x0a8a('0x2b'):_0x188570=as[_0x0a8a('0x62')]('me',null,_0x34f52a);_0x17bd72[_0x33bc9e](_0x188570[_0x0a8a('0x69')],_0x188570[_0x0a8a('0x5b')][_0x0a8a('0x64')],_0x188570['value'][_0x0a8a('0x14')]);break;}}else{var _0x188570=as[_0x0a8a('0x62')](_0x21889d,_0xa6745d[_0x0a8a('0x63')],_0x34f52a);_0x17bd72[_0x33bc9e](_0x188570[_0x0a8a('0x69')],_0x188570[_0x0a8a('0x5b')][_0x0a8a('0x64')],_0x188570[_0x0a8a('0x5b')]['end']);}}}else{var _0x552a0f=_(_0x3486ea[_0x0a8a('0x3c')])[_0x0a8a('0x3b')]()[_0x0a8a('0x22')](function(_0x5b55d8){return _['some'](_0x40d154,[_0x0a8a('0x1f'),_0x5b55d8])?_0x5b55d8:undefined;})['compact']()[_0x0a8a('0x5b')]();if(!_['isEmpty'](_0x552a0f)){_0x552a0f[_0x0a8a('0x26')](function(_0x3597a0){if(_0x3597a0===_0x0a8a('0x6a')){_0x5444d2[_0x0a8a('0x45')](_0x0a8a('0x6b'),[][_0x0a8a('0x6c')](_0x3486ea[_0x0a8a('0x3c')][_0x3597a0]));}else if(_0x3597a0===_0x0a8a('0x6d')){var _0x51bab2=JSON[_0x0a8a('0x6e')](_0x3486ea[_0x0a8a('0x3c')][_0x3597a0])['$gte'];var _0x4f84ce=JSON['parse'](_0x3486ea['query'][_0x3597a0])['$lte'];_0x5444d2[_0x0a8a('0x45')](_0x0a8a('0x6f'),_0x51bab2,_0x4f84ce);}else{if(_0x3486ea['query'][_0x3597a0]==='null'){_0x5444d2[_0x0a8a('0x45')]('i.'+_0x3597a0+_0x0a8a('0x70'));}else{_0x5444d2[_0x0a8a('0x45')]('i.'+_0x3597a0+_0x0a8a('0x71'),_0x3486ea[_0x0a8a('0x3c')][_0x3597a0]);}}});}if(_0x3486ea[_0x0a8a('0x3c')][_0x0a8a('0x72')]){if(_0x3486ea[_0x0a8a('0x3c')][_0x0a8a('0x72')]==0x1){_0x5444d2['having']('`unreadMessages`\x20=\x200');}else{_0x5444d2[_0x0a8a('0x5c')]('`unreadMessages`\x20>\x200');}}if(_0x3486ea[_0x0a8a('0x3c')][_0x0a8a('0x73')]){_0x203920=_[_0x0a8a('0x74')](_0x3486ea[_0x0a8a('0x3c')][_0x0a8a('0x73')])?_0x3486ea[_0x0a8a('0x3c')][_0x0a8a('0x73')]:new Array(_0x3486ea[_0x0a8a('0x3c')][_0x0a8a('0x73')]);_0x203920[_0x0a8a('0x26')](function(_0x4412cd){_0x22ca96['or'](_0x0a8a('0x66'),'%,'+_0x4412cd+',%');});}if(_0x3486ea[_0x0a8a('0x3c')][_0x0a8a('0x75')]){var _0x3dca2e=_0x3486ea[_0x0a8a('0x3c')][_0x0a8a('0x75')][_0x0a8a('0x76')]('\x5c','\x5c\x5c')[_0x0a8a('0x76')](/'/g,'\x27\x27');if(qs[_0x0a8a('0x77')](_0x3dca2e)){_0x17bd72['or'](_0x0a8a('0x78'),_0x3dca2e+'%');}else if(qs['isEmail'](_0x3dca2e)){_0x17bd72['or'](_0x0a8a('0x79'),_0x3dca2e+'%');}else{_0x17bd72['or'](_0x0a8a('0x7a'),qs[_0x0a8a('0x5f')](_0x3dca2e))['or'](_0x0a8a('0x7b'),qs[_0x0a8a('0x5f')](_0x3dca2e));}}}_0x5444d2[_0x0a8a('0x45')](_0x17bd72);_0x5444d2[_0x0a8a('0x7c')](_0x0a8a('0x7d'));var _0x256ba5={'type':db[_0x0a8a('0x7e')][_0x0a8a('0x7f')][_0x0a8a('0x80')],'raw':!![]};var _0x39220e=_0x5444d2['clone']();_0x39220e[_0x0a8a('0x48')](_0x0a8a('0x7d'));_0x39220e[_0x0a8a('0x48')](_0x0a8a('0x81'),'unreadMessages');if(_0xba70bb[_0x0a8a('0x43')]){_0xba70bb[_0x0a8a('0x43')]['forEach'](function(_0x47aade){var _0x4001fd=_0x47aade[0x0]===_0x0a8a('0x82')?_0x47aade[0x0]:'i.'+_0x47aade[0x0];_0x5444d2[_0x0a8a('0x43')](_0x4001fd,_0x47aade[0x1]==='DESC'?![]:!![]);});}if(!_[_0x0a8a('0x83')](_0x203920)){_0x5444d2[_0x0a8a('0x5c')](_0x22ca96);_0x39220e[_0x0a8a('0x45')](_0x0a8a('0x84'),_0x203920);}BPromise[_0x0a8a('0x85')]()[_0x0a8a('0x1c')](function(){if(!_0xb68e80){if(_0x3486ea[_0x0a8a('0x3c')][_0x0a8a('0x6a')])return;_0x39220e['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x5444d2[_0x0a8a('0x45')](_0x0a8a('0x86'));return;}if(_0x3486ea[_0x0a8a('0x87')]['role']!=='agent')return;return _0x3486ea['user']['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0x0a8a('0x1c')](function(_0x523ddf){if(_[_0x0a8a('0x83')](_0x523ddf)){_0x39220e[_0x0a8a('0x45')](_0x0a8a('0x88'));_0x5444d2[_0x0a8a('0x45')]('i.MailAccountId\x20IS\x20NULL');}else{_0x39220e[_0x0a8a('0x45')](_0x0a8a('0x6b'),_['map'](_0x523ddf,'id'));_0x5444d2[_0x0a8a('0x45')](_0x0a8a('0x6b'),_['map'](_0x523ddf,'id'));}});})[_0x0a8a('0x1c')](function(){if(_0x3486ea[_0x0a8a('0x87')][_0x0a8a('0x89')]===_0x0a8a('0x8a')&&!_0xb68e80&&!_0x3486ea[_0x0a8a('0x3c')]['MailAccountId'])return[];return db[_0x0a8a('0x8b')][_0x0a8a('0x3c')](_0x39220e[_0x0a8a('0x8c')](),_0x256ba5);})['then'](function(_0x600356){_0x2f35ad[_0x0a8a('0x19')]=_0x600356[_0x0a8a('0x41')];if(_0x2f35ad[_0x0a8a('0x19')]===0x0)return[];return db[_0x0a8a('0x8b')]['query'](_0x2cf201['toString'](),_0x256ba5)['then'](function(_0x3bfe58){_0x3d7da7=_['keyBy'](_0x3bfe58,'id');_0x256ba5=_['merge'](_0x256ba5,{'model':db[_0x0a8a('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3486ea[_0x0a8a('0x3c')][_0x0a8a('0x40')]){_0xba70bb[_0x0a8a('0x3f')]['forEach'](function(_0x19a3bc){_0x5444d2['field']('i.'+_0x19a3bc);});}else{_0x5444d2['field'](_0x0a8a('0x81'),_0x0a8a('0x8d'));_0x5444d2[_0x0a8a('0x48')](_0x0a8a('0x8e'),_0x0a8a('0x8f'));_0x5444d2[_0x0a8a('0x48')](_0x0a8a('0x90'),'Account.mandatoryDisposition');_0x5444d2[_0x0a8a('0x48')](_0x0a8a('0x91'),_0x0a8a('0x82'));_0x5444d2['field'](_0x0a8a('0x7d'));_0x5444d2['field'](_0x0a8a('0x92'));_0x5444d2[_0x0a8a('0x48')]('i.updatedAt');_0x5444d2[_0x0a8a('0x48')](_0x0a8a('0x93'));_0x5444d2['field']('i.closedAt');_0x5444d2['field'](_0x0a8a('0x94'));_0x5444d2['field'](_0x0a8a('0x95'));_0x5444d2[_0x0a8a('0x48')](_0x0a8a('0x96'));_0x5444d2[_0x0a8a('0x48')]('i.subject');_0x5444d2[_0x0a8a('0x48')]('i.disposition');_0x5444d2[_0x0a8a('0x48')](_0x0a8a('0x97'));_0x5444d2[_0x0a8a('0x48')](_0x0a8a('0x98'));_0x5444d2[_0x0a8a('0x48')](_0x0a8a('0x99'));_0x5444d2[_0x0a8a('0x48')](_0x0a8a('0x9a'));_0x5444d2[_0x0a8a('0x48')]('i.ContactId');_0x5444d2['field']('i.MailAccountId');_0x5444d2['field'](_0x0a8a('0x9b'));_0x5444d2[_0x0a8a('0x48')](_0x0a8a('0x9c'),'Contact.firstName');_0x5444d2[_0x0a8a('0x48')](_0x0a8a('0x9d'),_0x0a8a('0x9e'));_0x5444d2[_0x0a8a('0x48')](_0x0a8a('0x9f'),_0x0a8a('0xa0'));_0x5444d2[_0x0a8a('0x48')](_0x0a8a('0xa1'),_0x0a8a('0xa2'));_0x5444d2[_0x0a8a('0x48')](_0x0a8a('0xa3'),_0x0a8a('0xa4'));_0x5444d2['field']('c.fax','Contact.fax');_0x5444d2['field'](_0x0a8a('0xa5'),_0x0a8a('0xa6'));_0x5444d2[_0x0a8a('0x48')](_0x0a8a('0xa7'),_0x0a8a('0xa8'));_0x5444d2['field'](_0x0a8a('0xa9'),_0x0a8a('0x24'));}if(_0xba70bb[_0x0a8a('0x18')])_0x5444d2[_0x0a8a('0x18')](_0xba70bb['limit']);if(_0xba70bb[_0x0a8a('0x16')])_0x5444d2[_0x0a8a('0x16')](_0xba70bb['offset']);return db['sequelize'][_0x0a8a('0x3c')](_0x5444d2[_0x0a8a('0x8c')](),_0x256ba5);})[_0x0a8a('0x1c')](function(_0x318a5d){if(_0x318a5d['length']>0x0)_0x48902a[_0x0a8a('0x45')](_0x0a8a('0xaa'),_[_0x0a8a('0x22')](_0x318a5d,'id'));return db[_0x0a8a('0x8b')][_0x0a8a('0x3c')](_0x48902a[_0x0a8a('0x8c')](),_0x256ba5)['then'](function(_0x32d9cb){var _0x197b0f=_[_0x0a8a('0xab')](_0x32d9cb,_0x0a8a('0xac'));var _0x186e20=[];return db[_0x0a8a('0xad')][_0x0a8a('0x29')]({'attributes':[_0x0a8a('0xae')],'raw':!![]})[_0x0a8a('0x1c')](function(_0x526138){var _0x3bc761=_0x526138[_0x0a8a('0xae')];_0x318a5d['forEach'](function(_0x259c1d){_0x186e20[_0x0a8a('0x27')](updateMailInteraction(_0x259c1d,_0x3d7da7,_0x197b0f,_0x3bc761));});return BPromise[_0x0a8a('0xaf')](_0x186e20);});});});})['then'](function(_0x311189){_0x2f35ad['rows']=_0x311189;return _0x2f35ad;})['then'](respondWithFilteredResult(_0x4e7abe,_0xba70bb))[_0x0a8a('0x2e')](handleError(_0x4e7abe,null));};exports[_0x0a8a('0xb0')]=function(_0xbeb263,_0x40295e){var _0x42c6e4={'raw':![],'where':{'id':_0xbeb263[_0x0a8a('0xb1')]['id']}},_0x50441e={};_0x50441e[_0x0a8a('0x3a')]=_[_0x0a8a('0x3b')](db['MailInteraction'][_0x0a8a('0xb2')]);_0x50441e[_0x0a8a('0x3c')]=_[_0x0a8a('0x3b')](_0xbeb263[_0x0a8a('0x3c')]);_0x50441e[_0x0a8a('0x3d')]=_[_0x0a8a('0x3e')](_0x50441e[_0x0a8a('0x3a')],_0x50441e[_0x0a8a('0x3c')]);_0x42c6e4['attributes']=_[_0x0a8a('0x3e')](_0x50441e[_0x0a8a('0x3a')],qs[_0x0a8a('0x40')](_0xbeb263[_0x0a8a('0x3c')]['fields']));_0x42c6e4[_0x0a8a('0x3f')]=_0x42c6e4[_0x0a8a('0x3f')][_0x0a8a('0x41')]?_0x42c6e4[_0x0a8a('0x3f')]:_0x50441e['model'];if(_0xbeb263[_0x0a8a('0x3c')][_0x0a8a('0xb3')]){_0x42c6e4[_0x0a8a('0xb4')]=[{'all':!![]}];}_0x42c6e4=_[_0x0a8a('0xb5')]({},_0x42c6e4,_0xbeb263['options']);return db['MailInteraction'][_0x0a8a('0x5a')](_0x42c6e4)[_0x0a8a('0x1c')](handleEntityNotFound(_0x40295e,null))[_0x0a8a('0x1c')](respondWithResult(_0x40295e,null))[_0x0a8a('0x2e')](handleError(_0x40295e,null));};exports[_0x0a8a('0xb6')]=function(_0x273cb6,_0x594dde){return db[_0x0a8a('0x37')][_0x0a8a('0xb6')](_0x273cb6['body'],{})[_0x0a8a('0x1c')](respondWithResult(_0x594dde,0xc9))[_0x0a8a('0x2e')](handleError(_0x594dde,null));};exports[_0x0a8a('0x1b')]=function(_0xad393f,_0x2e1a4e){if(_0xad393f[_0x0a8a('0xb7')]['id']){delete _0xad393f[_0x0a8a('0xb7')]['id'];}return db[_0x0a8a('0x37')][_0x0a8a('0x5a')]({'where':{'id':_0xad393f[_0x0a8a('0xb1')]['id']}})[_0x0a8a('0x1c')](handleEntityNotFound(_0x2e1a4e,null))[_0x0a8a('0x1c')](saveUpdates(_0xad393f[_0x0a8a('0xb7')],null))[_0x0a8a('0x1c')](respondWithResult(_0x2e1a4e,null))[_0x0a8a('0x2e')](handleError(_0x2e1a4e,null));};exports[_0x0a8a('0xb8')]=function(_0x425680,_0x38c658){return db[_0x0a8a('0x37')][_0x0a8a('0x5a')]({'where':{'id':_0x425680[_0x0a8a('0xb1')]['id']}})[_0x0a8a('0x1c')](handleEntityNotFound(_0x38c658,null))[_0x0a8a('0x1c')](removeEntity(_0x38c658,null))[_0x0a8a('0x2e')](handleError(_0x38c658,null));};exports[_0x0a8a('0xb9')]=function(_0x5d86ec,_0x53f867){return db[_0x0a8a('0x37')][_0x0a8a('0xb9')]()[_0x0a8a('0x1c')](respondWithResult(_0x53f867,null))[_0x0a8a('0x2e')](handleError(_0x53f867,null));};exports[_0x0a8a('0xba')]=function(_0x4c2708,_0x5ac79a){return db[_0x0a8a('0x28')][_0x0a8a('0x5a')]({'where':{'id':_0x4c2708['params']['id']}})[_0x0a8a('0x1c')](handleEntityNotFound(_0x5ac79a,null))[_0x0a8a('0x1c')](function(_0x4566ce){if(_0x4566ce){return _0x4566ce[_0x0a8a('0xba')](_0x4c2708[_0x0a8a('0xb7')][_0x0a8a('0xbb')],_[_0x0a8a('0xbc')](_0x4c2708[_0x0a8a('0xb7')],['ids','id'])||{});}})['then'](respondWithResult(_0x5ac79a,null))['catch'](handleError(_0x5ac79a,null));};exports['getMessages']=function(_0x35e435,_0x1c043b){var _0x291cfa={'raw':![],'where':{}};var _0xef0c37={};var _0x1f97ff={'count':0x0,'rows':[]};return db[_0x0a8a('0x37')][_0x0a8a('0x29')]({'where':{'id':_0x35e435[_0x0a8a('0xb1')]['id']}})[_0x0a8a('0x1c')](handleEntityNotFound(_0x1c043b,null))[_0x0a8a('0x1c')](function(_0x2fe102){if(_0x2fe102){_0xef0c37['model']=_[_0x0a8a('0x3b')](db[_0x0a8a('0x28')][_0x0a8a('0xb2')]);_0xef0c37[_0x0a8a('0x3c')]=_['keys'](_0x35e435['query']);_0xef0c37[_0x0a8a('0x3d')]=_['intersection'](_0xef0c37[_0x0a8a('0x3a')],_0xef0c37['query']);_0x291cfa[_0x0a8a('0x3f')]=_[_0x0a8a('0x3e')](_0xef0c37[_0x0a8a('0x3a')],qs[_0x0a8a('0x40')](_0x35e435[_0x0a8a('0x3c')][_0x0a8a('0x40')]));_0x291cfa[_0x0a8a('0x3f')]=_0x291cfa['attributes']['length']?_0x291cfa['attributes']:_0xef0c37[_0x0a8a('0x3a')];if(!_0x35e435[_0x0a8a('0x3c')][_0x0a8a('0x42')](_0x0a8a('0xbd'))){_0x291cfa['limit']=qs[_0x0a8a('0x18')](_0x35e435[_0x0a8a('0x3c')][_0x0a8a('0x18')]);_0x291cfa[_0x0a8a('0x16')]=qs[_0x0a8a('0x16')](_0x35e435[_0x0a8a('0x3c')][_0x0a8a('0x16')]);}_0x291cfa[_0x0a8a('0x43')]=qs['sort'](_0x35e435[_0x0a8a('0x3c')][_0x0a8a('0x44')]);_0x291cfa[_0x0a8a('0x45')]=qs[_0x0a8a('0x3d')](_['pick'](_0x35e435['query'],_0xef0c37[_0x0a8a('0x3d')]));_0x291cfa['where'][_0x0a8a('0xac')]=_0x2fe102['id'];if(_0x35e435[_0x0a8a('0x3c')][_0x0a8a('0x75')]){_0x291cfa[_0x0a8a('0x45')]=_[_0x0a8a('0xb5')](_0x291cfa[_0x0a8a('0x45')],{'$or':_[_0x0a8a('0x22')](_0x291cfa[_0x0a8a('0x3f')],function(_0x2fb9ce){var _0x34696c={};_0x34696c[_0x2fb9ce]={'$like':'%'+_0x35e435[_0x0a8a('0x3c')]['filter']+'%'};return _0x34696c;})});}if(_0x35e435[_0x0a8a('0x3c')][_0x0a8a('0xbe')]){var _0x36db13=_0x35e435[_0x0a8a('0x3c')][_0x0a8a('0xbe')][_0x0a8a('0x25')](',');var _0x5d00f5={};_0x5d00f5[_0x36db13[0x0]]={'$gte':moment(_0x36db13[0x1])[_0x0a8a('0xbf')](_0x0a8a('0xc0'))};_0x291cfa[_0x0a8a('0x45')]=_[_0x0a8a('0xb5')](_0x291cfa[_0x0a8a('0x45')],_0x5d00f5);}_0x291cfa=_[_0x0a8a('0xb5')]({},_0x291cfa,_0x35e435[_0x0a8a('0xc1')]);return db[_0x0a8a('0x28')][_0x0a8a('0x19')]({'where':_0x291cfa['where']})['then'](function(_0xd15ece){_0x1f97ff[_0x0a8a('0x19')]=_0xd15ece;if(_0x35e435[_0x0a8a('0x3c')][_0x0a8a('0xb3')]){_0x291cfa[_0x0a8a('0xb4')]=[{'all':!![]}];}return db[_0x0a8a('0x28')][_0x0a8a('0xc2')](_0x291cfa);})['then'](function(_0x394091){if(_0x35e435[_0x0a8a('0x3c')][_0x0a8a('0xc3')]===_0x0a8a('0xc4')){for(var _0x2f9f26=0x0;_0x2f9f26<_0x394091[_0x0a8a('0x41')];_0x2f9f26++){_0x394091[_0x2f9f26][_0x0a8a('0xb7')]=juice(_0x394091[_0x2f9f26][_0x0a8a('0xb7')]);}}_0x1f97ff[_0x0a8a('0xc5')]=_0x394091;return _0x1f97ff;});}})[_0x0a8a('0x1c')](respondWithFilteredResult(_0x1c043b,_0x291cfa))['catch'](handleError(_0x1c043b,null));};exports['addTags']=function(_0x5c6176,_0x1b36a0){return db['MailInteraction'][_0x0a8a('0x5a')]({'where':{'id':_0x5c6176['params']['id']}})[_0x0a8a('0x1c')](handleEntityNotFound(_0x1b36a0,null))['then'](function(_0x142851){if(_0x142851){return _0x142851['setTags'](_0x5c6176[_0x0a8a('0xb7')]['ids'],_[_0x0a8a('0xbc')](_0x5c6176[_0x0a8a('0xb7')],[_0x0a8a('0xbb'),'id'])||{})[_0x0a8a('0xc6')](function(){return db['Tag'][_0x0a8a('0xc2')]({'attributes':['id','name','color'],'where':{'id':_0x5c6176[_0x0a8a('0xb7')]['ids']}});})['then'](function(_0x3c0375){socket[_0x0a8a('0xc7')](_0x0a8a('0xc8'),{'id':Number(_0x5c6176[_0x0a8a('0xb1')]['id']),'tags':_0x3c0375||[]});return{'id':Number(_0x5c6176[_0x0a8a('0xb1')]['id']),'tags':_0x3c0375||[]};});}})[_0x0a8a('0x1c')](respondWithResult(_0x1b36a0,null))['catch'](handleError(_0x1b36a0,null));};exports[_0x0a8a('0xc9')]=function(_0x398b7b,_0x4bbaca){return db['MailInteraction']['find']({'where':{'id':_0x398b7b['params']['id']}})[_0x0a8a('0x1c')](handleEntityNotFound(_0x4bbaca,null))['then'](function(_0x4f813a){if(_0x4f813a){return _0x4f813a[_0x0a8a('0xc9')](_0x398b7b['query'][_0x0a8a('0xbb')]);}})[_0x0a8a('0x1c')](respondWithStatusCode(_0x4bbaca,null))['catch'](handleError(_0x4bbaca,null));};exports['download']=function(_0x4320f6,_0x329ec8){var _0x33fcc2=moment()[_0x0a8a('0xca')]()[_0x0a8a('0x8c')]();var _0x6676a6=path[_0x0a8a('0xcb')](config[_0x0a8a('0xcc')],_0x0a8a('0xcd'),_0x0a8a('0xce'),_0x0a8a('0xcf'));var _0x3f65af=path[_0x0a8a('0xcb')](config[_0x0a8a('0xcc')],_0x0a8a('0xcd'),_0x0a8a('0xce'),_0x0a8a('0xd0'));var _0x109c1d=path[_0x0a8a('0xcb')](_0x6676a6,_0x33fcc2);var _0x1c65d9=util['format'](_0x0a8a('0xd1'),_0x4320f6[_0x0a8a('0xb1')]['id'],_0x33fcc2);var _0x5b2c18=path[_0x0a8a('0xcb')](_0x6676a6,_0x1c65d9);var _0xa1a4cf=[];if(_0x4320f6[_0x0a8a('0x3c')][_0x0a8a('0xd0')]){_0xa1a4cf[_0x0a8a('0x27')]({'model':db[_0x0a8a('0xd2')],'as':_0x0a8a('0xd3'),'raw':!![]});}var _0x31d998=[{'model':db['MailMessage'],'as':_0x0a8a('0xd4'),'attributes':['id',_0x0a8a('0xb7'),_0x0a8a('0x4a'),'to','cc',_0x0a8a('0xd5'),'subject','createdAt'],'where':{'secret':![]},'order':qs[_0x0a8a('0x44')]('id'),'include':_0xa1a4cf}];return db[_0x0a8a('0x37')]['find']({'where':{'id':_0x4320f6[_0x0a8a('0xb1')]['id']},'include':_0x31d998})[_0x0a8a('0x1c')](handleEntityNotFound(_0x329ec8,null))['then'](function(_0x2ba0f0){if(_0x2ba0f0&&_0x2ba0f0['Messages']){var _0x3ce4fc=_0x2ba0f0[_0x0a8a('0xd6')]({'plain':!![]});fs[_0x0a8a('0xd7')](_0x109c1d);return BPromise[_0x0a8a('0xd8')](_0x3ce4fc[_0x0a8a('0xd4')],function(_0x3370f0,_0x1372f1){var _0x44f715={'from':_0x3370f0[_0x0a8a('0x4a')],'to':_0x3370f0['to'],'subject':_0x3370f0[_0x0a8a('0xd9')],'html':htmlEntities[_0x0a8a('0xda')](_0x3370f0['body']),'headers':{'Date':moment(_0x3370f0[_0x0a8a('0x6d')])['format'](_0x0a8a('0xdb'))},'attachments':[]};if(_0x3370f0['cc']){_0x44f715[_0x0a8a('0xdc')]['Cc']=_0x3370f0['cc'];}if(_0x3370f0[_0x0a8a('0xd5')]){_0x44f715[_0x0a8a('0xdc')][_0x0a8a('0xdd')]=_0x3370f0[_0x0a8a('0xd5')];}return new BPromise(function(_0x2c52f7,_0x358a5e){if(_0x3370f0['Attachments']){for(var _0x3779b2=0x0;_0x3779b2<_0x3370f0[_0x0a8a('0xd3')][_0x0a8a('0x41')];_0x3779b2++){var _0x21e8ec=_0x3370f0[_0x0a8a('0xd3')][_0x3779b2];var _0x48a8e1=path['join'](_0x3f65af,_0x21e8ec[_0x0a8a('0xde')]);if(fs['existsSync'](_0x48a8e1)){_0x44f715[_0x0a8a('0xd0')]['push']({'name':_0x21e8ec[_0x0a8a('0x1f')],'contentType':_0x21e8ec[_0x0a8a('0x63')],'data':fs[_0x0a8a('0xdf')](_0x48a8e1)});}}}emlformat[_0x0a8a('0xe0')](_0x44f715,function(_0x51f075,_0x2b940b){if(_0x51f075)return _0x358a5e(_0x51f075);fs[_0x0a8a('0xe1')](path[_0x0a8a('0xcb')](_0x109c1d,util[_0x0a8a('0xbf')](_0x0a8a('0xe2'),_0x1372f1)),_0x2b940b);return _0x2c52f7(_0x2b940b);});});})['then'](function(){return new BPromise(function(_0x3771fb,_0x2c5b4e){zipdir(_0x109c1d,{'saveTo':_0x5b2c18},function(_0x8b6d11,_0x5d7830){if(_0x8b6d11)return _0x2c5b4e(_0x8b6d11);return _0x3771fb(_0x5d7830);});})[_0x0a8a('0x1c')](function(){return new BPromise(function(_0x58fba4,_0x40cd0d){rimraf(_0x109c1d,function(_0x3c260f){if(_0x3c260f)_0x40cd0d(_0x3c260f);return _0x58fba4();});});})[_0x0a8a('0x1c')](function(){return _0x329ec8[_0x0a8a('0xe3')](_0x5b2c18,_0x1c65d9,function(_0x3fef60){if(!_0x3fef60)fs[_0x0a8a('0xe4')](_0x5b2c18);});});});}else{return _0x329ec8['sendStatus'](0xc8);}})[_0x0a8a('0x2e')](handleError(_0x329ec8,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 5d60e4b..1192785 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 _0x9114=['update','getUsers','then','setDataValue','map','findAll','length','hasOwnProperty','hook','exports','events','setMaxListeners','save'];(function(_0x5deae9,_0x2b077a){var _0x3c24ed=function(_0x408bae){while(--_0x408bae){_0x5deae9['push'](_0x5deae9['shift']());}};_0x3c24ed(++_0x2b077a);}(_0x9114,0x135));var _0x4911=function(_0x42ee55,_0x521e4d){_0x42ee55=_0x42ee55-0x0;var _0x33cdd7=_0x9114[_0x42ee55];return _0x33cdd7;};'use strict';var EventEmitter=require(_0x4911('0x0'));var MailInteraction=require('../../mysqldb')['db']['MailInteraction'];var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x4911('0x1')](0x0);var events={'afterCreate':_0x4911('0x2'),'afterUpdate':_0x4911('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1e6752){return function(_0x36079b,_0x1ab702,_0x4f84ed){_0x36079b[_0x4911('0x4')]({'attributes':['id'],'raw':!![]})[_0x4911('0x5')](function(_0xcd7c8b){_0x36079b[_0x4911('0x6')]('Users',_0xcd7c8b[_0x4911('0x7')](function(_0x23a6bb){return{'id':_0x23a6bb['id']};}));return MailMessage[_0x4911('0x8')]({'where':{'MailInteractionId':_0x36079b['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x51e303){_0x36079b['setDataValue']('unreadMessages',_0x51e303[_0x4911('0x9')]);MailInteractionEvents['emit'](_0x1e6752+':'+_0x36079b['id'],_0x36079b);MailInteractionEvents['emit'](_0x1e6752,_0x36079b);_0x4f84ed(null);})['catch'](_0x4f84ed(null));};}for(var e in events){if(events[_0x4911('0xa')](e)){var event=events[e];MailInteraction[_0x4911('0xb')](e,emitEvent(event));}}module[_0x4911('0xc')]=MailInteractionEvents; \ No newline at end of file +var _0x67b6=['setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','exports','../../mysqldb','setMaxListeners','save','update','then'];(function(_0x29f31c,_0x46bbdf){var _0x3b6b8a=function(_0x557471){while(--_0x557471){_0x29f31c['push'](_0x29f31c['shift']());}};_0x3b6b8a(++_0x46bbdf);}(_0x67b6,0x1d7));var _0x667b=function(_0x51cd56,_0x554ac8){_0x51cd56=_0x51cd56-0x0;var _0x580ccc=_0x67b6[_0x51cd56];return _0x580ccc;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x667b('0x0'))['db']['MailInteraction'];var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x667b('0x1')](0x0);var events={'afterCreate':_0x667b('0x2'),'afterUpdate':_0x667b('0x3'),'afterDestroy':'remove'};function emitEvent(_0x35f7e7){return function(_0x5a9400,_0x4eecef,_0x18d138){_0x5a9400['getUsers']({'attributes':['id'],'raw':!![]})[_0x667b('0x4')](function(_0x321dbf){_0x5a9400[_0x667b('0x5')](_0x667b('0x6'),_0x321dbf[_0x667b('0x7')](function(_0x594ab4){return{'id':_0x594ab4['id']};}));return MailMessage[_0x667b('0x8')]({'where':{'MailInteractionId':_0x5a9400['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x27a59){_0x5a9400[_0x667b('0x5')]('unreadMessages',_0x27a59[_0x667b('0x9')]);MailInteractionEvents[_0x667b('0xa')](_0x35f7e7+':'+_0x5a9400['id'],_0x5a9400);MailInteractionEvents[_0x667b('0xa')](_0x35f7e7,_0x5a9400);_0x18d138(null);})[_0x667b('0xb')](_0x18d138(null));};}for(var e in events){if(events[_0x667b('0xc')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x667b('0xd')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 4e1334f..7e393e6 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 _0xec66=['FULLTEXT','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatus','format','models','get','MailMessage','update','then','catch','utf8mb4_unicode_ci','lodash','api','bluebird','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','subject'];(function(_0x4ac74e,_0x14a007){var _0x1cd3ed=function(_0x25b747){while(--_0x25b747){_0x4ac74e['push'](_0x4ac74e['shift']());}};_0x1cd3ed(++_0x14a007);}(_0xec66,0x15f));var _0x6ec6=function(_0x22ffbf,_0x16f31e){_0x22ffbf=_0x22ffbf-0x0;var _0x360c17=_0xec66[_0x22ffbf];return _0x360c17;};'use strict';var _=require(_0x6ec6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6ec6('0x1'));var moment=require('moment');var BPromise=require(_0x6ec6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6ec6('0x3'));var attributes=require(_0x6ec6('0x4'));module[_0x6ec6('0x5')]=function(_0x3e0e39,_0x563f18){return _0x3e0e39[_0x6ec6('0x6')](_0x6ec6('0x7'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x6ec6('0x8'),'to'],'type':_0x6ec6('0x9')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4cef54,_0x2b630c,_0x5486b6){if(_0x4cef54['substatus']){_0x4cef54[_0x6ec6('0xa')]=moment()['format'](_0x6ec6('0xb'));}if(_0x4cef54[_0x6ec6('0xc')]){_0x4cef54[_0x6ec6('0xd')]=moment()['format'](_0x6ec6('0xb'));}_0x5486b6(null,_0x2b630c);},'beforeUpdate':function(_0x2681fd,_0x5e5008,_0x1cc2bc){if(_0x2681fd[_0x6ec6('0xe')](_0x6ec6('0xf'))){_0x2681fd['substatusAt']=_0x2681fd[_0x6ec6('0xf')]?moment()[_0x6ec6('0x10')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x2681fd['changed'](_0x6ec6('0xc'))){_0x2681fd['closedAt']=moment()['format'](_0x6ec6('0xb'));_0x2681fd[_0x6ec6('0xf')]=null;_0x2681fd[_0x6ec6('0xa')]=null;}_0x1cc2bc(null,_0x2681fd);},'afterUpdate':function(_0x1c48de,_0x59fc2f,_0x4d389f){var _0x2b991a=_0x3e0e39[_0x6ec6('0x11')];var _0x414077=_0x1c48de[_0x6ec6('0x12')]({'plain':!![]});if(_0x414077[_0x6ec6('0xc')]){return _0x2b991a[_0x6ec6('0x13')][_0x6ec6('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x414077['id']}})[_0x6ec6('0x15')](function(){_0x4d389f();})[_0x6ec6('0x16')](function(_0x1a88c7){_0x4d389f(_0x1a88c7);});}else{_0x4d389f();}}},'charset':'utf8mb4','collate':_0x6ec6('0x17')});}; \ No newline at end of file +var _0x6700=['MailMessage','update','then','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','MailInteraction','mail_interactions','subject','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','format','changed','closed','closedAt','models','get'];(function(_0x5861c4,_0x237aaa){var _0x122261=function(_0xc0818c){while(--_0xc0818c){_0x5861c4['push'](_0x5861c4['shift']());}};_0x122261(++_0x237aaa);}(_0x6700,0x10a));var _0x0670=function(_0x45f8dc,_0x23ba5b){_0x45f8dc=_0x45f8dc-0x0;var _0x53201a=_0x6700[_0x45f8dc];return _0x53201a;};'use strict';var _=require(_0x0670('0x0'));var util=require(_0x0670('0x1'));var logger=require(_0x0670('0x2'))(_0x0670('0x3'));var moment=require(_0x0670('0x4'));var BPromise=require(_0x0670('0x5'));var rp=require(_0x0670('0x6'));var fs=require('fs');var path=require(_0x0670('0x7'));var rimraf=require(_0x0670('0x8'));var config=require(_0x0670('0x9'));var attributes=require(_0x0670('0xa'));module['exports']=function(_0x355b83,_0x25ac7f){return _0x355b83['define'](_0x0670('0xb'),attributes,{'tableName':_0x0670('0xc'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x0670('0xd'),'to'],'type':_0x0670('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3471a6,_0x5bb2fb,_0x5692ff){if(_0x3471a6[_0x0670('0xf')]){_0x3471a6[_0x0670('0x10')]=moment()['format'](_0x0670('0x11'));}if(_0x3471a6['closed']){_0x3471a6['closedAt']=moment()[_0x0670('0x12')](_0x0670('0x11'));}_0x5692ff(null,_0x5bb2fb);},'beforeUpdate':function(_0x5b5413,_0x130db1,_0x5d7432){if(_0x5b5413[_0x0670('0x13')](_0x0670('0xf'))){_0x5b5413['substatusAt']=_0x5b5413[_0x0670('0xf')]?moment()['format'](_0x0670('0x11')):null;}if(_0x5b5413['changed'](_0x0670('0x14'))){_0x5b5413[_0x0670('0x15')]=moment()[_0x0670('0x12')](_0x0670('0x11'));_0x5b5413['substatus']=null;_0x5b5413[_0x0670('0x10')]=null;}_0x5d7432(null,_0x5b5413);},'afterUpdate':function(_0x14f692,_0x10cf16,_0xa6dfb0){var _0x29c937=_0x355b83[_0x0670('0x16')];var _0x52c6ad=_0x14f692[_0x0670('0x17')]({'plain':!![]});if(_0x52c6ad['closed']){return _0x29c937[_0x0670('0x18')][_0x0670('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x52c6ad['id']}})[_0x0670('0x1a')](function(){_0xa6dfb0();})['catch'](function(_0x2260a2){_0xa6dfb0(_0x2260a2);});}else{_0xa6dfb0();}}},'charset':_0x0670('0x1b'),'collate':_0x0670('0x1c')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index abfe409..93565e5 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 _0xde97=['spread','AddTags','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','UpdateMailInteraction','MailInteraction','update','raw','options','where','attributes','limit','catch','find','addTags','ids','omit','body'];(function(_0x356485,_0x20d89b){var _0x480c5a=function(_0x560913){while(--_0x560913){_0x356485['push'](_0x356485['shift']());}};_0x480c5a(++_0x20d89b);}(_0xde97,0x192));var _0x7de9=function(_0x15942a,_0x13b58c){_0x15942a=_0x15942a-0x0;var _0x36a9fb=_0xde97[_0x15942a];return _0x36a9fb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7de9('0x0'));var BPromise=require('bluebird');var rs=require(_0x7de9('0x1'));var fs=require('fs');var Redis=require(_0x7de9('0x2'));var db=require(_0x7de9('0x3'))['db'];var utils=require(_0x7de9('0x4'));var logger=require('../../config/logger')(_0x7de9('0x5'));var config=require(_0x7de9('0x6'));var jayson=require(_0x7de9('0x7'));var client=jayson[_0x7de9('0x8')][_0x7de9('0x9')]({'port':0x232a});config[_0x7de9('0xa')]=_[_0x7de9('0xb')](config['redis'],{'host':_0x7de9('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7de9('0xa')]));require(_0x7de9('0xd'))[_0x7de9('0xe')](socket);function respondWithRpcPromise(_0x237b30,_0x21179a,_0x1c4d6d){return new BPromise(function(_0x575362,_0x15d85d){return client['request'](_0x237b30,_0x1c4d6d)[_0x7de9('0xf')](function(_0x2e2a06){logger[_0x7de9('0x10')](_0x7de9('0x11'),_0x21179a,_0x7de9('0x12'));logger[_0x7de9('0x13')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x21179a,'request\x20sent',JSON[_0x7de9('0x14')](_0x2e2a06));if(_0x2e2a06[_0x7de9('0x15')]){if(_0x2e2a06[_0x7de9('0x15')][_0x7de9('0x16')]===0x1f4){logger[_0x7de9('0x15')](_0x7de9('0x11'),_0x21179a,_0x2e2a06[_0x7de9('0x15')]['message']);return _0x15d85d(_0x2e2a06[_0x7de9('0x15')]['message']);}logger[_0x7de9('0x15')](_0x7de9('0x11'),_0x21179a,_0x2e2a06[_0x7de9('0x15')]['message']);return _0x575362(_0x2e2a06[_0x7de9('0x15')]['message']);}else{logger['info'](_0x7de9('0x11'),_0x21179a,'request\x20sent');_0x575362(_0x2e2a06['result'][_0x7de9('0x17')]);}})['catch'](function(_0x43e4a0){logger[_0x7de9('0x15')](_0x7de9('0x11'),_0x21179a,_0x43e4a0);_0x15d85d(_0x43e4a0);});});}exports[_0x7de9('0x18')]=function(_0x1a7769){var _0xd5f0e9=this;return new Promise(function(_0x5a1e1a,_0x5b0ee5){return db[_0x7de9('0x19')][_0x7de9('0x1a')](_0x1a7769['body'],{'raw':_0x1a7769['options']?_0x1a7769['options'][_0x7de9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a7769[_0x7de9('0x1c')]?_0x1a7769['options'][_0x7de9('0x1d')]||null:null,'attributes':_0x1a7769[_0x7de9('0x1c')]?_0x1a7769[_0x7de9('0x1c')][_0x7de9('0x1e')]||null:null,'limit':_0x1a7769[_0x7de9('0x1c')]?_0x1a7769[_0x7de9('0x1c')][_0x7de9('0x1f')]||null:null})[_0x7de9('0xf')](function(_0x115a93){logger[_0x7de9('0x10')](_0x7de9('0x18'),_0x1a7769);logger[_0x7de9('0x13')](_0x7de9('0x18'),_0x1a7769,JSON['stringify'](_0x115a93));_0x5a1e1a(_0x115a93);})[_0x7de9('0x20')](function(_0x18777d){logger['error'](_0x7de9('0x18'),_0x18777d['message'],_0x1a7769);_0x5b0ee5(_0xd5f0e9[_0x7de9('0x15')](0x1f4,_0x18777d['message']));});});};exports['AddTagsToMailInteraction']=function(_0x22ef7d){return new Promise(function(_0x5c7990,_0x4e6250){return db['MailInteraction'][_0x7de9('0x21')]({'where':_0x22ef7d[_0x7de9('0x1c')]?_0x22ef7d[_0x7de9('0x1c')]['where']||null:null})[_0x7de9('0xf')](function(_0x15cd91){if(_0x15cd91){return _0x15cd91[_0x7de9('0x22')](_0x22ef7d['body'][_0x7de9('0x23')],_[_0x7de9('0x24')](_0x22ef7d[_0x7de9('0x25')],[_0x7de9('0x23'),'id'])||{});}})[_0x7de9('0x26')](function(_0x227d0c){logger[_0x7de9('0x10')]('AddTags',_0x22ef7d);logger[_0x7de9('0x13')](_0x7de9('0x27'),_0x22ef7d,JSON[_0x7de9('0x14')](_0x227d0c));_0x5c7990(_0x227d0c);})[_0x7de9('0x20')](function(_0xe107c4){logger[_0x7de9('0x15')](_0x7de9('0x27'),_0xe107c4[_0x7de9('0x17')],_0x22ef7d);_0x4e6250(_this['error'](0x1f4,_0xe107c4['message']));});});}; \ No newline at end of file +var _0xd668=['catch','AddTagsToMailInteraction','find','addTags','body','ids','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','client','http','defaults','localhost','socket.io-emitter','redis','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateMailInteraction','MailInteraction','update','options','raw','where','attributes'];(function(_0x416045,_0x26d0e8){var _0x1e50b2=function(_0x305049){while(--_0x305049){_0x416045['push'](_0x416045['shift']());}};_0x1e50b2(++_0x26d0e8);}(_0xd668,0x18e));var _0x8d66=function(_0x2bf1d5,_0xf33049){_0x2bf1d5=_0x2bf1d5-0x0;var _0x3a58f8=_0xd668[_0x2bf1d5];return _0x3a58f8;};'use strict';var _=require(_0x8d66('0x0'));var util=require('util');var moment=require(_0x8d66('0x1'));var BPromise=require(_0x8d66('0x2'));var rs=require(_0x8d66('0x3'));var fs=require('fs');var Redis=require(_0x8d66('0x4'));var db=require(_0x8d66('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8d66('0x6')][_0x8d66('0x7')]({'port':0x232a});config['redis']=_[_0x8d66('0x8')](config['redis'],{'host':_0x8d66('0x9'),'port':0x18eb});var socket=require(_0x8d66('0xa'))(new Redis(config[_0x8d66('0xb')]));require(_0x8d66('0xc'))['register'](socket);function respondWithRpcPromise(_0x249a43,_0x42030d,_0x41269c){return new BPromise(function(_0x30aed0,_0x933002){return client[_0x8d66('0xd')](_0x249a43,_0x41269c)[_0x8d66('0xe')](function(_0x47d025){logger[_0x8d66('0xf')](_0x8d66('0x10'),_0x42030d,_0x8d66('0x11'));logger[_0x8d66('0x12')](_0x8d66('0x13'),_0x42030d,_0x8d66('0x11'),JSON[_0x8d66('0x14')](_0x47d025));if(_0x47d025[_0x8d66('0x15')]){if(_0x47d025[_0x8d66('0x15')]['code']===0x1f4){logger[_0x8d66('0x15')]('MailInteraction,\x20%s,\x20%s',_0x42030d,_0x47d025[_0x8d66('0x15')][_0x8d66('0x16')]);return _0x933002(_0x47d025[_0x8d66('0x15')][_0x8d66('0x16')]);}logger[_0x8d66('0x15')](_0x8d66('0x10'),_0x42030d,_0x47d025[_0x8d66('0x15')]['message']);return _0x30aed0(_0x47d025['error'][_0x8d66('0x16')]);}else{logger[_0x8d66('0xf')]('MailInteraction,\x20%s,\x20%s',_0x42030d,'request\x20sent');_0x30aed0(_0x47d025[_0x8d66('0x17')]['message']);}})['catch'](function(_0x4df3a6){logger[_0x8d66('0x15')](_0x8d66('0x10'),_0x42030d,_0x4df3a6);_0x933002(_0x4df3a6);});});}exports[_0x8d66('0x18')]=function(_0x2857ab){var _0x176798=this;return new Promise(function(_0x313a79,_0x68e927){return db[_0x8d66('0x19')][_0x8d66('0x1a')](_0x2857ab['body'],{'raw':_0x2857ab[_0x8d66('0x1b')]?_0x2857ab[_0x8d66('0x1b')][_0x8d66('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2857ab[_0x8d66('0x1b')]?_0x2857ab[_0x8d66('0x1b')][_0x8d66('0x1d')]||null:null,'attributes':_0x2857ab[_0x8d66('0x1b')]?_0x2857ab[_0x8d66('0x1b')][_0x8d66('0x1e')]||null:null,'limit':_0x2857ab[_0x8d66('0x1b')]?_0x2857ab[_0x8d66('0x1b')]['limit']||null:null})[_0x8d66('0xe')](function(_0x1a0128){logger[_0x8d66('0xf')](_0x8d66('0x18'),_0x2857ab);logger[_0x8d66('0x12')]('UpdateMailInteraction',_0x2857ab,JSON[_0x8d66('0x14')](_0x1a0128));_0x313a79(_0x1a0128);})[_0x8d66('0x1f')](function(_0x232c6e){logger[_0x8d66('0x15')](_0x8d66('0x18'),_0x232c6e[_0x8d66('0x16')],_0x2857ab);_0x68e927(_0x176798[_0x8d66('0x15')](0x1f4,_0x232c6e[_0x8d66('0x16')]));});});};exports[_0x8d66('0x20')]=function(_0x2b6638){return new Promise(function(_0x313ec0,_0x1a2a57){return db[_0x8d66('0x19')][_0x8d66('0x21')]({'where':_0x2b6638[_0x8d66('0x1b')]?_0x2b6638['options']['where']||null:null})['then'](function(_0x42eb28){if(_0x42eb28){return _0x42eb28[_0x8d66('0x22')](_0x2b6638[_0x8d66('0x23')]['ids'],_['omit'](_0x2b6638[_0x8d66('0x23')],[_0x8d66('0x24'),'id'])||{});}})[_0x8d66('0x25')](function(_0x32cd02){logger[_0x8d66('0xf')]('AddTags',_0x2b6638);logger[_0x8d66('0x12')](_0x8d66('0x26'),_0x2b6638,JSON[_0x8d66('0x14')](_0x32cd02));_0x313ec0(_0x32cd02);})[_0x8d66('0x1f')](function(_0x1b263a){logger['error'](_0x8d66('0x26'),_0x1b263a['message'],_0x2b6638);_0x1a2a57(_this[_0x8d66('0x15')](0x1f4,_0x1b263a[_0x8d66('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 0063595..846467a 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 _0x01dd=['remove','update','register','mailInteraction:','./mailInteraction.events','save'];(function(_0x2c49d4,_0x1ddb09){var _0x417772=function(_0x3cfec2){while(--_0x3cfec2){_0x2c49d4['push'](_0x2c49d4['shift']());}};_0x417772(++_0x1ddb09);}(_0x01dd,0x172));var _0xd01d=function(_0x2c27ed,_0x5c50f0){_0x2c27ed=_0x2c27ed-0x0;var _0x597bd1=_0x01dd[_0x2c27ed];return _0x597bd1;};'use strict';var MailInteractionEvents=require(_0xd01d('0x0'));var events=[_0xd01d('0x1'),_0xd01d('0x2'),_0xd01d('0x3')];function createListener(_0x28cf3b,_0x3ccc7b){return function(_0x4e4915){_0x3ccc7b['emit'](_0x28cf3b,_0x4e4915);};}function removeListener(_0x18b6f4,_0x5d4c50){return function(){MailInteractionEvents['removeListener'](_0x18b6f4,_0x5d4c50);};}exports[_0xd01d('0x4')]=function(_0x23d972){for(var _0x31f354=0x0,_0x37472c=events['length'];_0x31f354<_0x37472c;_0x31f354++){var _0x5877ca=events[_0x31f354];var _0x4838cb=createListener(_0xd01d('0x5')+_0x5877ca,_0x23d972);MailInteractionEvents['on'](_0x5877ca,_0x4838cb);}}; \ No newline at end of file +var _0x3c71=['mailInteraction:','./mailInteraction.events','save','remove','update','emit','removeListener','register','length'];(function(_0x3f0b15,_0x29a0c6){var _0x371196=function(_0x39ea4e){while(--_0x39ea4e){_0x3f0b15['push'](_0x3f0b15['shift']());}};_0x371196(++_0x29a0c6);}(_0x3c71,0x133));var _0x13c7=function(_0x352404,_0x5d1870){_0x352404=_0x352404-0x0;var _0x5f4288=_0x3c71[_0x352404];return _0x5f4288;};'use strict';var MailInteractionEvents=require(_0x13c7('0x0'));var events=[_0x13c7('0x1'),_0x13c7('0x2'),_0x13c7('0x3')];function createListener(_0x4a1dda,_0x285de7){return function(_0x46d5a3){_0x285de7[_0x13c7('0x4')](_0x4a1dda,_0x46d5a3);};}function removeListener(_0x40000b,_0x2ac07b){return function(){MailInteractionEvents[_0x13c7('0x5')](_0x40000b,_0x2ac07b);};}exports[_0x13c7('0x6')]=function(_0xc22e23){for(var _0x2b49d0=0x0,_0x16f31d=events[_0x13c7('0x7')];_0x2b49d0<_0x16f31d;_0x2b49d0++){var _0x25d0b0=events[_0x2b49d0];var _0x3efdfc=createListener(_0x13c7('0x8')+_0x25d0b0,_0xc22e23);MailInteractionEvents['on'](_0x25d0b0,_0x3efdfc);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 1fefba2..8c6d1dc 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 _0x4e83=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','show','download','post','tracked','mailmessage:create','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','util','path','connect-timeout','express'];(function(_0x2505a8,_0x1c51dc){var _0x3f5bda=function(_0x58e3e1){while(--_0x58e3e1){_0x2505a8['push'](_0x2505a8['shift']());}};_0x3f5bda(++_0x1c51dc);}(_0x4e83,0x88));var _0x34e8=function(_0x58fbb0,_0xe497b5){_0x58fbb0=_0x58fbb0-0x0;var _0x1783d2=_0x4e83[_0x58fbb0];return _0x1783d2;};'use strict';var multer=require('multer');var util=require(_0x34e8('0x0'));var path=require(_0x34e8('0x1'));var timeout=require(_0x34e8('0x2'));var express=require(_0x34e8('0x3'));var router=express['Router']();var fs_extra=require(_0x34e8('0x4'));var auth=require(_0x34e8('0x5'));var interaction=require(_0x34e8('0x6'));var config=require(_0x34e8('0x7'));var controller=require(_0x34e8('0x8'));router[_0x34e8('0x9')]('/',auth[_0x34e8('0xa')](),controller[_0x34e8('0xb')]);router[_0x34e8('0x9')](_0x34e8('0xc'),auth[_0x34e8('0xa')](),controller[_0x34e8('0xd')]);router[_0x34e8('0x9')]('/:id',auth[_0x34e8('0xa')](),controller[_0x34e8('0xe')]);router[_0x34e8('0x9')]('/:id/download',auth[_0x34e8('0xa')](),controller[_0x34e8('0xf')]);router[_0x34e8('0x10')]('/',auth[_0x34e8('0xa')](),interaction[_0x34e8('0x11')]('mail',_0x34e8('0x12')),controller['create']);router[_0x34e8('0x13')](_0x34e8('0x14'),auth[_0x34e8('0xa')](),controller[_0x34e8('0x15')]);router[_0x34e8('0x13')](_0x34e8('0x16'),auth['isAuthenticated'](),controller[_0x34e8('0x17')]);router['put'](_0x34e8('0x18'),auth['isAuthenticated'](),controller[_0x34e8('0x19')]);router[_0x34e8('0x1a')](_0x34e8('0x14'),auth['isAuthenticated'](),controller[_0x34e8('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x4ffe=['./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','tracked','mail','mailmessage:create','create','put','update','/:id/accept','accept','reject','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x277e35,_0x1b7a1b){var _0x22ff17=function(_0x5b17b1){while(--_0x5b17b1){_0x277e35['push'](_0x277e35['shift']());}};_0x22ff17(++_0x1b7a1b);}(_0x4ffe,0x172));var _0xe4ff=function(_0x22382f,_0x5c2e54){_0x22382f=_0x22382f-0x0;var _0x35213b=_0x4ffe[_0x22382f];return _0x35213b;};'use strict';var multer=require(_0xe4ff('0x0'));var util=require(_0xe4ff('0x1'));var path=require(_0xe4ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xe4ff('0x3'));var router=express[_0xe4ff('0x4')]();var fs_extra=require(_0xe4ff('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe4ff('0x6'));var config=require(_0xe4ff('0x7'));var controller=require(_0xe4ff('0x8'));router[_0xe4ff('0x9')]('/',auth[_0xe4ff('0xa')](),controller['index']);router[_0xe4ff('0x9')](_0xe4ff('0xb'),auth[_0xe4ff('0xa')](),controller[_0xe4ff('0xc')]);router['get'](_0xe4ff('0xd'),auth['isAuthenticated'](),controller[_0xe4ff('0xe')]);router[_0xe4ff('0x9')](_0xe4ff('0xf'),auth[_0xe4ff('0xa')](),controller['download']);router['post']('/',auth[_0xe4ff('0xa')](),interaction[_0xe4ff('0x10')](_0xe4ff('0x11'),_0xe4ff('0x12')),controller[_0xe4ff('0x13')]);router[_0xe4ff('0x14')]('/:id',auth[_0xe4ff('0xa')](),controller[_0xe4ff('0x15')]);router['put'](_0xe4ff('0x16'),auth['isAuthenticated'](),controller[_0xe4ff('0x17')]);router[_0xe4ff('0x14')]('/:id/reject',auth[_0xe4ff('0xa')](),controller[_0xe4ff('0x18')]);router[_0xe4ff('0x19')](_0xe4ff('0xd'),auth[_0xe4ff('0xa')](),controller[_0xe4ff('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index a4d81c9..f0a711d 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 _0xcf80=['DATE','INTEGER','Chat','Email','sequelize','TEXT','long','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x2284e0,_0x4ef2c3){var _0x2efb1a=function(_0x4bfbdf){while(--_0x4bfbdf){_0x2284e0['push'](_0x2284e0['shift']());}};_0x2efb1a(++_0x4ef2c3);}(_0xcf80,0x1e4));var _0x0cf8=function(_0xc97dac,_0x24dec5){_0xc97dac=_0xc97dac-0x0;var _0x387a6a=_0xcf80[_0xc97dac];return _0x387a6a;};'use strict';var Sequelize=require(_0x0cf8('0x0'));var _=require('lodash');module['exports']={'body':{'type':Sequelize[_0x0cf8('0x1')](_0x0cf8('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x0cf8('0x1')](_0x0cf8('0x3'))},'read':{'type':Sequelize[_0x0cf8('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0cf8('0x5')]('in',_0x0cf8('0x6')),'defaultValue':_0x0cf8('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x0cf8('0x7')]},'to':{'type':Sequelize[_0x0cf8('0x1')](_0x0cf8('0x2'))},'cc':{'type':Sequelize[_0x0cf8('0x1')]('long')},'bcc':{'type':Sequelize[_0x0cf8('0x1')](_0x0cf8('0x2'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x0cf8('0x8')]},'attach':{'type':Sequelize[_0x0cf8('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x0cf8('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x0cf8('0x8')]},'originTo':{'type':Sequelize[_0x0cf8('0x1')](_0x0cf8('0x2'))},'originCc':{'type':Sequelize['TEXT'](_0x0cf8('0x2'))},'originChannel':{'type':Sequelize[_0x0cf8('0x5')]('Email',_0x0cf8('0xa')),'defaultValue':_0x0cf8('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0xb84f=['Email','sequelize','TEXT','long','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x3f6474,_0x4836ae){var _0xbeb7c0=function(_0xc0cc89){while(--_0xc0cc89){_0x3f6474['push'](_0x3f6474['shift']());}};_0xbeb7c0(++_0x4836ae);}(_0xb84f,0xf4));var _0xfb84=function(_0x58f67e,_0x211b11){_0x58f67e=_0x58f67e-0x0;var _0x5e245a=_0xb84f[_0x58f67e];return _0x5e245a;};'use strict';var Sequelize=require(_0xfb84('0x0'));var _=require('lodash');module['exports']={'body':{'type':Sequelize[_0xfb84('0x1')](_0xfb84('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xfb84('0x1')]('medium')},'read':{'type':Sequelize[_0xfb84('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfb84('0x4')]('in',_0xfb84('0x5')),'defaultValue':_0xfb84('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xfb84('0x6')](0x1fe)},'from':{'type':Sequelize[_0xfb84('0x6')]},'to':{'type':Sequelize['TEXT'](_0xfb84('0x2'))},'cc':{'type':Sequelize['TEXT']('long')},'bcc':{'type':Sequelize[_0xfb84('0x1')](_0xfb84('0x2'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xfb84('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xfb84('0x7')]},'originTo':{'type':Sequelize[_0xfb84('0x1')]('long')},'originCc':{'type':Sequelize[_0xfb84('0x1')](_0xfb84('0x2'))},'originChannel':{'type':Sequelize['ENUM'](_0xfb84('0x8'),'Chat'),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 5fd3b6c..9c36ca1 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 _0x683d=['merge','VIRTUAL','options','count','include','findAll','rows','show','params','rawAttributes','includeAll','body','find','destroy','describe','create','direction','out','secret','split','findOne','MailAccountId','List','CmContact','updatedAt','MailServerOut','Smtp','isNil','service','host','port','authentication','auth','pass','secure','attachments','length','root','basename','Contacts','List\x20not\x20found','SendMail','sendMail','messageId','format','accept','read','readAt','UserId','agent','get','MailInteraction','MailInteractionId','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','fromString','EventManager','acceptmessage','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','email','event','reject','rejectmessage','download','toString','join','server','files','tmp','from','bcc','subject','createdAt','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','readFileSync','build','writeFileSync','moment','path','ioredis','html-to-text','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','limit','set','Content-Range','update','then','end','sendStatus','stack','name','send','index','map','MailMessage','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter'];(function(_0x27ee78,_0x32695c){var _0x54a0dd=function(_0x243cbb){while(--_0x243cbb){_0x27ee78['push'](_0x27ee78['shift']());}};_0x54a0dd(++_0x32695c);}(_0x683d,0x66));var _0xd683=function(_0x2d2ca2,_0x51873f){_0x2d2ca2=_0x2d2ca2-0x0;var _0x48489d=_0x683d[_0x2d2ca2];return _0x48489d;};'use strict';var emlformat=require('eml-format');var moment=require(_0xd683('0x0'));var BPromise=require('bluebird');var util=require('util');var path=require(_0xd683('0x1'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xd683('0x2'));var htmlToText=require(_0xd683('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0xd683('0x4'))(_0xd683('0x5'));var interaction_log=require(_0xd683('0x4'))('mail-interactions');var config=require(_0xd683('0x6'));var db=require(_0xd683('0x7'))['db'];config[_0xd683('0x8')]=_[_0xd683('0x9')](config[_0xd683('0x8')],{'host':_0xd683('0xa'),'port':0x18eb});var socket=require(_0xd683('0xb'))(new Redis(config[_0xd683('0x8')]));var htmlEntities=require(_0xd683('0xc'));require(_0xd683('0xd'))[_0xd683('0xe')](socket);var jayson=require(_0xd683('0xf'));var client=jayson[_0xd683('0x10')][_0xd683('0x11')]({'port':0x232c});var client9003=jayson[_0xd683('0x10')][_0xd683('0x11')]({'port':0x232b});var client9002=jayson[_0xd683('0x10')][_0xd683('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x113c25,_0x20aa4f,_0x4ca799,_0x38e3bc){return new BPromise(function(_0x3aaf67,_0x3eba09){var _0x2c3687=_0x38e3bc||client;return _0x2c3687['request'](_0x113c25,_0x4ca799)['then'](function(_0x356165){logger[_0xd683('0x12')]('MailMessage,\x20%s,\x20%s',_0x20aa4f,_0xd683('0x13'));logger[_0xd683('0x14')](_0xd683('0x15'),_0x20aa4f,'request\x20sent',JSON[_0xd683('0x16')](_0x356165));if(_0x356165[_0xd683('0x17')]){if(_0x356165[_0xd683('0x17')][_0xd683('0x18')]===0x1f4){logger['error'](_0xd683('0x19'),_0x20aa4f,_0x356165[_0xd683('0x17')][_0xd683('0x1a')]);return _0x3eba09(_0x356165[_0xd683('0x17')][_0xd683('0x1a')]);}logger['error'](_0xd683('0x19'),_0x20aa4f,_0x356165[_0xd683('0x17')][_0xd683('0x1a')]);return _0x3aaf67(_0x356165[_0xd683('0x17')][_0xd683('0x1a')]);}else{logger[_0xd683('0x12')](_0xd683('0x19'),_0x20aa4f,_0xd683('0x13'));_0x3aaf67(_0x356165[_0xd683('0x1b')][_0xd683('0x1a')]);}})[_0xd683('0x1c')](function(_0x4e76f1){logger['error'](_0xd683('0x19'),_0x20aa4f,_0x4e76f1);_0x3eba09(_0x4e76f1);});});}function respondWithResult(_0x217b99,_0x560277){_0x560277=_0x560277||0xc8;return function(_0x3abd2c){if(_0x3abd2c){return _0x217b99[_0xd683('0x1d')](_0x560277)[_0xd683('0x1e')](_0x3abd2c);}};}function respondWithFilteredResult(_0x5407b3,_0x10f43b){return function(_0x465499){if(_0x465499){var _0x5c6693=typeof _0x10f43b[_0xd683('0x1f')]===_0xd683('0x20')&&typeof _0x10f43b['limit']===_0xd683('0x20');var _0x1d8f38=_0x465499['count'];var _0x1bc7ec=_0x5c6693?0x0:_0x10f43b[_0xd683('0x1f')];var _0x132c13=_0x5c6693?_0x465499['count']:_0x10f43b[_0xd683('0x1f')]+_0x10f43b[_0xd683('0x21')];var _0x345c09;if(_0x132c13>=_0x1d8f38){_0x132c13=_0x1d8f38;_0x345c09=0xc8;}else{_0x345c09=0xce;}_0x5407b3['status'](_0x345c09);return _0x5407b3[_0xd683('0x22')](_0xd683('0x23'),_0x1bc7ec+'-'+_0x132c13+'/'+_0x1d8f38)[_0xd683('0x1e')](_0x465499);}return null;};}function saveUpdates(_0x9d0b3c){return function(_0x411eb4){if(_0x411eb4){return _0x411eb4[_0xd683('0x24')](_0x9d0b3c)[_0xd683('0x25')](function(_0x2045a3){return _0x2045a3;});}return null;};}function removeEntity(_0x176207){return function(_0x4d2f2e){if(_0x4d2f2e){return _0x4d2f2e['destroy']()['then'](function(){_0x176207['status'](0xcc)[_0xd683('0x26')]();});}};}function handleEntityNotFound(_0x2ab68c){return function(_0x100f7c){if(!_0x100f7c){_0x2ab68c[_0xd683('0x27')](0x194);}return _0x100f7c;};}function handleError(_0x547d40,_0xac5482){_0xac5482=_0xac5482||0x1f4;return function(_0x33c19c){logger[_0xd683('0x17')](_0x33c19c[_0xd683('0x28')]);if(_0x33c19c[_0xd683('0x29')]){delete _0x33c19c['name'];}_0x547d40[_0xd683('0x1d')](_0xac5482)[_0xd683('0x2a')](_0x33c19c);};}exports[_0xd683('0x2b')]=function(_0x2a11da,_0x1f5195){var _0x105637={},_0x5bdc79={},_0x5eb27b={'count':0x0,'rows':[]};var _0x408c96=_[_0xd683('0x2c')](db[_0xd683('0x2d')]['rawAttributes'],function(_0xd6392b){return{'name':_0xd6392b[_0xd683('0x2e')],'type':_0xd6392b[_0xd683('0x2f')]['key']};});_0x5bdc79[_0xd683('0x30')]=_['map'](_0x408c96,'name');_0x5bdc79[_0xd683('0x31')]=_[_0xd683('0x32')](_0x2a11da['query']);_0x5bdc79[_0xd683('0x33')]=_[_0xd683('0x34')](_0x5bdc79[_0xd683('0x30')],_0x5bdc79['query']);_0x105637[_0xd683('0x35')]=_['intersection'](_0x5bdc79[_0xd683('0x30')],qs[_0xd683('0x36')](_0x2a11da[_0xd683('0x31')]['fields']));_0x105637['attributes']=_0x105637[_0xd683('0x35')]['length']?_0x105637['attributes']:_0x5bdc79[_0xd683('0x30')];if(!_0x2a11da[_0xd683('0x31')][_0xd683('0x37')]('nolimit')){_0x105637['limit']=qs['limit'](_0x2a11da[_0xd683('0x31')][_0xd683('0x21')]);_0x105637[_0xd683('0x1f')]=qs[_0xd683('0x1f')](_0x2a11da[_0xd683('0x31')][_0xd683('0x1f')]);}_0x105637['order']=qs[_0xd683('0x38')](_0x2a11da[_0xd683('0x31')]['sort']);_0x105637[_0xd683('0x39')]=qs[_0xd683('0x33')](_[_0xd683('0x3a')](_0x2a11da[_0xd683('0x31')],_0x5bdc79['filters']),_0x408c96);if(_0x2a11da[_0xd683('0x31')][_0xd683('0x3b')]){_0x105637[_0xd683('0x39')]=_[_0xd683('0x3c')](_0x105637[_0xd683('0x39')],{'$or':_[_0xd683('0x2c')](_0x408c96,function(_0x589230){if(_0x589230[_0xd683('0x2f')]!==_0xd683('0x3d')){var _0x4678f0={};_0x4678f0[_0x589230[_0xd683('0x29')]]={'$like':'%'+_0x2a11da[_0xd683('0x31')]['filter']+'%'};return _0x4678f0;}})});}_0x105637=_[_0xd683('0x3c')]({},_0x105637,_0x2a11da[_0xd683('0x3e')]);var _0x12c679={'where':_0x105637[_0xd683('0x39')]};return db[_0xd683('0x2d')]['count'](_0x12c679)[_0xd683('0x25')](function(_0xc81b49){_0x5eb27b[_0xd683('0x3f')]=_0xc81b49;if(_0x2a11da[_0xd683('0x31')]['includeAll']){_0x105637[_0xd683('0x40')]=[{'all':!![]}];}return db['MailMessage'][_0xd683('0x41')](_0x105637);})[_0xd683('0x25')](function(_0x25cecb){_0x5eb27b[_0xd683('0x42')]=_0x25cecb;return _0x5eb27b;})[_0xd683('0x25')](respondWithFilteredResult(_0x1f5195,_0x105637))[_0xd683('0x1c')](handleError(_0x1f5195,null));};exports[_0xd683('0x43')]=function(_0x29942a,_0x3971a2){var _0x497de5={'raw':!![],'where':{'id':_0x29942a[_0xd683('0x44')]['id']}},_0x373411={};_0x373411[_0xd683('0x30')]=_['keys'](db[_0xd683('0x2d')][_0xd683('0x45')]);_0x373411[_0xd683('0x31')]=_['keys'](_0x29942a['query']);_0x373411['filters']=_[_0xd683('0x34')](_0x373411[_0xd683('0x30')],_0x373411[_0xd683('0x31')]);_0x497de5['attributes']=_[_0xd683('0x34')](_0x373411[_0xd683('0x30')],qs[_0xd683('0x36')](_0x29942a['query'][_0xd683('0x36')]));_0x497de5[_0xd683('0x35')]=_0x497de5[_0xd683('0x35')]['length']?_0x497de5['attributes']:_0x373411[_0xd683('0x30')];if(_0x29942a[_0xd683('0x31')][_0xd683('0x46')]){_0x497de5[_0xd683('0x40')]=[{'all':!![]}];}_0x497de5=_[_0xd683('0x3c')]({},_0x497de5,_0x29942a['options']);return db[_0xd683('0x2d')]['find'](_0x497de5)['then'](handleEntityNotFound(_0x3971a2,null))['then'](respondWithResult(_0x3971a2,null))[_0xd683('0x1c')](handleError(_0x3971a2,null));};exports[_0xd683('0x24')]=function(_0x267c79,_0x638519){if(_0x267c79[_0xd683('0x47')]['id']){delete _0x267c79[_0xd683('0x47')]['id'];}return db['MailMessage'][_0xd683('0x48')]({'where':{'id':_0x267c79[_0xd683('0x44')]['id']}})[_0xd683('0x25')](handleEntityNotFound(_0x638519,null))[_0xd683('0x25')](saveUpdates(_0x267c79[_0xd683('0x47')],null))[_0xd683('0x25')](respondWithResult(_0x638519,null))[_0xd683('0x1c')](handleError(_0x638519,null));};exports[_0xd683('0x49')]=function(_0x11dc4c,_0xc0c597){return db[_0xd683('0x2d')][_0xd683('0x48')]({'where':{'id':_0x11dc4c[_0xd683('0x44')]['id']}})['then'](handleEntityNotFound(_0xc0c597,null))['then'](removeEntity(_0xc0c597,null))[_0xd683('0x1c')](handleError(_0xc0c597,null));};exports['describe']=function(_0xa547cb,_0x2a1b77){return db['MailMessage'][_0xd683('0x4a')]()[_0xd683('0x25')](respondWithResult(_0x2a1b77,null))[_0xd683('0x1c')](handleError(_0x2a1b77,null));};exports['create']=function(_0x4e9d3e,_0x236777){return db[_0xd683('0x2d')][_0xd683('0x4b')](_0x4e9d3e[_0xd683('0x47')])[_0xd683('0x25')](function(_0x2cd642){if(_0x2cd642){if(_0x2cd642[_0xd683('0x4c')]===_0xd683('0x4d')&&!_0x2cd642[_0xd683('0x4e')]){var _0x168de3,_0x216ea6,_0x2cd9cb;if(_0x4e9d3e[_0xd683('0x47')]['to']){_0x216ea6=_0x4e9d3e[_0xd683('0x47')]['to'][_0xd683('0x4f')](',')[0x0];}return db['MailAccount'][_0xd683('0x50')]({'where':{'id':_0x2cd642[_0xd683('0x51')]},'include':[{'model':db['CmList'],'as':_0xd683('0x52'),'include':[{'model':db[_0xd683('0x53')],'as':'Contacts','where':{'email':_0x216ea6},'limit':0x1,'order':[[_0xd683('0x54'),'DESC']]}]},{'model':db[_0xd683('0x55')],'as':_0xd683('0x56'),'raw':!![]}]})[_0xd683('0x25')](function(_0x4383fe){_0x168de3=_0x4383fe;if(_0x168de3&&_0x168de3[_0xd683('0x56')]){var _0x5d17fd={'tls':{'rejectUnauthorized':![]}};if(_[_0xd683('0x57')](_0x168de3[_0xd683('0x56')][_0xd683('0x58')])){_0x5d17fd['host']=_0x168de3[_0xd683('0x56')][_0xd683('0x59')];_0x5d17fd[_0xd683('0x5a')]=_0x168de3['Smtp'][_0xd683('0x5a')];_0x5d17fd['secure']=_0x168de3['Smtp']['secure'];if(_0x168de3[_0xd683('0x56')][_0xd683('0x5b')]){_0x5d17fd[_0xd683('0x5c')]={'user':_0x168de3[_0xd683('0x56')]['user'],'pass':_0x168de3['Smtp'][_0xd683('0x5d')]};}}else{_0x5d17fd[_0xd683('0x58')]=_0x168de3[_0xd683('0x56')][_0xd683('0x58')];_0x5d17fd[_0xd683('0x5c')]={'user':_0x168de3[_0xd683('0x56')]['user'],'pass':_0x168de3[_0xd683('0x56')][_0xd683('0x5d')]};_0x5d17fd[_0xd683('0x5e')]=_0x168de3['Smtp']['secure'];}if(_0x4e9d3e[_0xd683('0x47')][_0xd683('0x5f')]&&_0x4e9d3e[_0xd683('0x47')][_0xd683('0x5f')][_0xd683('0x60')]){for(var _0x4aceba=0x0;_0x4aceba<_0x4e9d3e[_0xd683('0x47')][_0xd683('0x5f')][_0xd683('0x60')];_0x4aceba+=0x1){_0x4e9d3e[_0xd683('0x47')][_0xd683('0x5f')][_0x4aceba]={'filename':_0x4e9d3e[_0xd683('0x47')][_0xd683('0x5f')][_0x4aceba]['name'],'path':path['join'](config[_0xd683('0x61')],'server/files/attachments',_0x4e9d3e['body'][_0xd683('0x5f')][_0x4aceba][_0xd683('0x62')])};}}_0x2cd9cb={'account':_0x5d17fd,'message':_0x4e9d3e[_0xd683('0x47')]};return;}})[_0xd683('0x25')](function(){if(_0x168de3[_0xd683('0x52')]){if(_0x168de3['List'][_0xd683('0x63')]['length']){return _0x168de3[_0xd683('0x52')]['Contacts'][0x0];}else{return db['CmContact'][_0xd683('0x4b')](_[_0xd683('0x9')](_0x4e9d3e[_0xd683('0x47')],{'firstName':_0x4e9d3e[_0xd683('0x47')]['to'],'email':_0x4e9d3e[_0xd683('0x47')]['to'],'phone':_0x4e9d3e['body']['to'],'ListId':_0x168de3['ListId']}));}}else{throw new Error(_0xd683('0x64'));}})['then'](function(){if(_0x2cd9cb){return respondWithRpcPromise(_0xd683('0x65'),_0xd683('0x66'),_0x2cd9cb,client9003)['then'](function(_0x1b7831){return _0x2cd642['update']({'read':!![],'messageId':_0x1b7831[_0xd683('0x67')],'sentAt':moment()[_0xd683('0x68')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xd683('0x1c')](function(_0xa1e05e){logger['error']('%s',JSON['stringify'](_0xa1e05e));return _0x2cd642;});}return _0x2cd642;});}return _0x2cd642;}})[_0xd683('0x25')](respondWithResult(_0x236777,0xc9))[_0xd683('0x1c')](handleError(_0x236777,null));};exports[_0xd683('0x69')]=function(_0x58fc71,_0x5348ee){var _0x3c83d7={'agent':{},'channel':'mail'};if(_0x58fc71['body']['id']){delete _0x58fc71[_0xd683('0x47')]['id'];}_0x58fc71['body'][_0xd683('0x6a')]=!![];_0x58fc71['body'][_0xd683('0x6b')]=moment()[_0xd683('0x68')]('YYYY-MM-DD\x20HH:mm:ss');_0x58fc71['body']['UserId']=_0x58fc71[_0xd683('0x47')][_0xd683('0x6c')]||_0x58fc71['user']['id'];_0x3c83d7[_0xd683('0x6d')]['id']=_0x58fc71[_0xd683('0x47')][_0xd683('0x6c')];return db[_0xd683('0x2d')]['find']({'where':{'id':_0x58fc71[_0xd683('0x44')]['id'],'UserId':null}})[_0xd683('0x25')](handleEntityNotFound(_0x5348ee,null))[_0xd683('0x25')](saveUpdates(_0x58fc71['body'],null))[_0xd683('0x25')](function(_0xd0c158){if(_0xd0c158){_0x3c83d7['message']=_0xd0c158[_0xd683('0x6e')]({'plain':!![]});return db[_0xd683('0x6f')]['find']({'where':{'id':_0xd0c158[_0xd683('0x70')]}});}return null;})[_0xd683('0x25')](handleEntityNotFound(_0x5348ee,null))[_0xd683('0x25')](function(_0x3814c4){if(_0x3814c4){return _0x3814c4[_0xd683('0x24')]({'UserId':_0x58fc71[_0xd683('0x47')][_0xd683('0x6c')],'read1stAt':_['isNil'](_0x3814c4[_0xd683('0x71')])?moment()[_0xd683('0x68')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x24ca89){if(_0x24ca89){_0x3c83d7['interaction']=_0x24ca89[_0xd683('0x6e')]({'plain':!![]});interaction_log[_0xd683('0x12')](_0xd683('0x72'),_0x58fc71['user']['id'],_0x58fc71[_0xd683('0x73')][_0xd683('0x29')],_0x58fc71[_0xd683('0x73')][_0xd683('0x74')],_0x3c83d7[_0xd683('0x75')]['id'],_0x58fc71[_0xd683('0x47')]?JSON['stringify'](_0x58fc71[_0xd683('0x47')]):'null');return respondWithRpcPromise(_0xd683('0x76'),_0xd683('0x77'),_0x3c83d7);}return null;})['then'](function(_0x4febce){var _0x33306b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4febce['message'][_0xd683('0x78')];return db[_0xd683('0x79')][_0xd683('0x31')](_0x33306b,{'type':db[_0xd683('0x7a')][_0xd683('0x7b')][_0xd683('0x7c')],'raw':!![]})['then'](function(_0x32a7c1){return _0x32a7c1;});})[_0xd683('0x25')](function(_0x5eb539){if(_0x5eb539){_0x3c83d7[_0xd683('0x1a')][_0xd683('0x7d')]=_0x5eb539[0x0];if(!_0x58fc71[_0xd683('0x47')][_0xd683('0x6c')])return;return db[_0xd683('0x7e')]['find']({'where':{'id':_0x58fc71['body'][_0xd683('0x6c')],'role':_0xd683('0x6d')},'attributes':['id','name',_0xd683('0x7f'),'email',_0xd683('0x80')],'raw':!![]});}return null;})[_0xd683('0x25')](function(_0x35c6b5){if(!_0x35c6b5)return null;_0x3c83d7[_0xd683('0x1a')][_0xd683('0x6d')]=_0x35c6b5;return _0x3c83d7;})[_0xd683('0x25')](function(_0x49627a){if(_0x49627a){if(_0x58fc71[_0xd683('0x47')][_0xd683('0x81')]){_0x3c83d7[_0xd683('0x1a')][_0xd683('0x82')]=util[_0xd683('0x68')](_0xd683('0x83'),_0x58fc71[_0xd683('0x73')]['name']);_0x3c83d7[_0xd683('0x1a')][_0xd683('0x84')]=_0x3c83d7[_0xd683('0x84')];_0x3c83d7[_0xd683('0x1a')][_0xd683('0x85')]=_0x3c83d7[_0xd683('0x84')];_0x3c83d7[_0xd683('0x1a')]['event']=_0xd683('0x69');_0x3c83d7[_0xd683('0x1a')]['body']=htmlToText[_0xd683('0x86')](_0x3c83d7[_0xd683('0x1a')][_0xd683('0x47')]);return respondWithRpcPromise(_0xd683('0x87'),_0xd683('0x87'),{'event':_0xd683('0x88'),'message':_0x3c83d7['message']},client9002)[_0xd683('0x25')](function(){return _0x3c83d7;});}return _0x3c83d7;}return null;})[_0xd683('0x25')](respondWithResult(_0x5348ee,null))['catch'](handleError(_0x5348ee,null));};exports['reject']=function(_0x134804,_0x152044){var _0x20429a={'agent':{},'channel':'mail'};if(_0x134804[_0xd683('0x47')]['id']){delete _0x134804[_0xd683('0x47')]['id'];}_0x134804[_0xd683('0x47')][_0xd683('0x6c')]=_0x134804['body']['UserId']||_0x134804[_0xd683('0x73')]['id'];_0x20429a[_0xd683('0x6d')]['id']=_0x134804[_0xd683('0x47')][_0xd683('0x6c')];return db['MailMessage'][_0xd683('0x48')]({'where':{'id':_0x134804['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x152044,null))[_0xd683('0x25')](function(_0x348827){if(_0x348827){_0x20429a[_0xd683('0x1a')]=_0x348827['get']({'plain':!![]});return db[_0xd683('0x6f')][_0xd683('0x48')]({'where':{'id':_0x348827[_0xd683('0x70')]}});}return null;})['then'](handleEntityNotFound(_0x152044,null))[_0xd683('0x25')](function(_0x5b04f8){if(_0x5b04f8){_0x20429a['interaction']=_0x5b04f8[_0xd683('0x6e')]({'plain':!![]});interaction_log[_0xd683('0x12')](_0xd683('0x89'),_0x134804[_0xd683('0x73')]['id'],_0x134804[_0xd683('0x73')][_0xd683('0x29')],_0x134804[_0xd683('0x73')][_0xd683('0x74')],_0x20429a['interaction']['id'],_0x134804[_0xd683('0x47')]?JSON[_0xd683('0x16')](_0x134804[_0xd683('0x47')]):_0xd683('0x8a'));return respondWithRpcPromise('RejectMessage',_0xd683('0x8b'),_0x20429a);}return null;})[_0xd683('0x25')](function(_0x11adc0){var _0x5d153a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x11adc0['message'][_0xd683('0x78')];return db['sequelize']['query'](_0x5d153a,{'type':db[_0xd683('0x7a')][_0xd683('0x7b')][_0xd683('0x7c')],'raw':!![]})[_0xd683('0x25')](function(_0x5400a8){return _0x5400a8;});})[_0xd683('0x25')](function(_0x56f10b){if(_0x56f10b){_0x20429a['message'][_0xd683('0x7d')]=_0x56f10b[0x0];if(!_0x134804[_0xd683('0x47')][_0xd683('0x6c')])return;return db[_0xd683('0x7e')][_0xd683('0x48')]({'where':{'id':_0x134804['body']['UserId'],'role':'agent'},'attributes':['id',_0xd683('0x29'),_0xd683('0x7f'),_0xd683('0x8c'),_0xd683('0x80')],'raw':!![]});}return null;})['then'](function(_0x13711c){if(!_0x13711c)return null;_0x20429a[_0xd683('0x1a')][_0xd683('0x6d')]=_0x13711c;return _0x20429a;})[_0xd683('0x25')](function(_0x3f65ea){if(_0x3f65ea){_0x3f65ea[_0xd683('0x1a')][_0xd683('0x82')]=util[_0xd683('0x68')](_0xd683('0x83'),_0x134804['user'][_0xd683('0x29')]);_0x3f65ea[_0xd683('0x1a')]['channel']=_0x20429a[_0xd683('0x84')];_0x3f65ea['message'][_0xd683('0x85')]=_0x20429a[_0xd683('0x84')];_0x3f65ea[_0xd683('0x1a')][_0xd683('0x8d')]=_0xd683('0x8e');_0x3f65ea['message'][_0xd683('0x47')]=htmlToText['fromString'](_0x20429a[_0xd683('0x1a')][_0xd683('0x47')]);respondWithRpcPromise('EventManager',_0xd683('0x87'),{'event':_0xd683('0x8f'),'message':_0x3f65ea[_0xd683('0x1a')]},client9002);return _0x20429a;}return null;})[_0xd683('0x25')](respondWithResult(_0x152044,null))[_0xd683('0x1c')](handleError(_0x152044,null));};exports[_0xd683('0x90')]=function(_0x3751f0,_0x380d2a){var _0x5629a9=moment()['unix']()[_0xd683('0x91')]();var _0x2d40f8=path[_0xd683('0x92')](config[_0xd683('0x61')],_0xd683('0x93'),_0xd683('0x94'),_0xd683('0x95'));var _0x172bd4=path[_0xd683('0x92')](config[_0xd683('0x61')],_0xd683('0x93'),_0xd683('0x94'),_0xd683('0x5f'));var _0x45beca=util['format']('message-%s.eml',_0x5629a9);return db[_0xd683('0x2d')][_0xd683('0x48')]({'where':{'id':_0x3751f0[_0xd683('0x44')]['id']},'attributes':['id','body',_0xd683('0x96'),'to','cc',_0xd683('0x97'),_0xd683('0x98'),_0xd683('0x99')],'include':_0x3751f0[_0xd683('0x31')]['attachments']?[{'model':db['Attachment'],'as':_0xd683('0x9a')}]:undefined})[_0xd683('0x25')](handleEntityNotFound(_0x380d2a,null))[_0xd683('0x25')](function(_0x101415){if(_0x101415){var _0x44edf9=_0x101415;var _0x113d3b={'from':_0x44edf9['from'],'to':_0x44edf9['to'],'subject':_0x44edf9['subject'],'html':htmlEntities[_0xd683('0x9b')](_0x44edf9[_0xd683('0x47')]),'headers':{'Date':moment(_0x44edf9['createdAt'])['format'](_0xd683('0x9c'))},'attachments':[]};if(_0x101415['cc']){_0x113d3b[_0xd683('0x9d')]['Cc']=_0x101415['cc'];}if(_0x101415[_0xd683('0x97')]){_0x113d3b[_0xd683('0x9d')][_0xd683('0x9e')]=_0x101415[_0xd683('0x97')];}return new BPromise(function(_0x4a88c7,_0x3c8c3d){if(_0x101415['Attachments']){for(var _0x21c1f9=0x0;_0x21c1f9<_0x101415[_0xd683('0x9a')][_0xd683('0x60')];_0x21c1f9++){var _0x48282d=_0x101415[_0xd683('0x9a')][_0x21c1f9];var _0x4997e3=path['join'](_0x172bd4,_0x48282d[_0xd683('0x62')]);if(fs['existsSync'](_0x4997e3)){_0x113d3b['attachments']['push']({'name':_0x48282d['name'],'contentType':_0x48282d['type'],'data':fs[_0xd683('0x9f')](_0x4997e3)});}}}emlformat[_0xd683('0xa0')](_0x113d3b,function(_0x59ba9c,_0x440169){if(_0x59ba9c)return _0x3c8c3d(_0x59ba9c);fs[_0xd683('0xa1')](path[_0xd683('0x92')](_0x2d40f8,_0x45beca),_0x440169);return _0x4a88c7(_0x440169);});});}})[_0xd683('0x25')](function(_0x253b51){if(_0x253b51){return _0x380d2a[_0xd683('0x90')](path[_0xd683('0x92')](_0x2d40f8,_0x45beca),_0x45beca,function(_0x5b208d){if(!_0x5b208d)fs['unlinkSync'](path['join'](_0x2d40f8,_0x45beca));});}})[_0xd683('0x1c')](handleError(_0x380d2a,null));}; \ No newline at end of file +var _0x22a6=['AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','internal','interface','SIP/%s','channel','motionChannel','fromString','reject','mail','null','rejectMessage','fullname','email','event','EventManager','rejectmessage','download','unix','toString','join','root','files','server','from','bcc','subject','createdAt','Attachment','Attachments','decode','headers','Bcc','existsSync','push','build','writeFileSync','eml-format','moment','path','ioredis','../../components/parsers/qs','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','html-entities','register','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','sendStatus','stack','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','MailMessage','includeAll','include','findAll','rows','show','options','body','params','describe','create','direction','secret','split','MailAccount','findOne','MailAccountId','updatedAt','DESC','Smtp','isNil','host','port','secure','authentication','auth','pass','service','user','attachments','name','server/files/attachments','basename','List','Contacts','CmContact','ListId','List\x20not\x20found','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','read','readAt','format','UserId','find','MailInteraction','MailInteractionId','interaction','get','role'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x22a6,0x172));var _0x622a=function(_0x585ee5,_0x1c9dba){_0x585ee5=_0x585ee5-0x0;var _0x470808=_0x22a6[_0x585ee5];return _0x470808;};'use strict';var emlformat=require(_0x622a('0x0'));var moment=require(_0x622a('0x1'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x622a('0x2'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x622a('0x3'));var htmlToText=require('html-to-text');var qs=require(_0x622a('0x4'));var logger=require(_0x622a('0x5'))('api');var interaction_log=require(_0x622a('0x5'))(_0x622a('0x6'));var config=require(_0x622a('0x7'));var db=require(_0x622a('0x8'))['db'];config[_0x622a('0x9')]=_[_0x622a('0xa')](config['redis'],{'host':_0x622a('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x622a('0x9')]));var htmlEntities=require(_0x622a('0xc'));require('./mailMessage.socket')[_0x622a('0xd')](socket);var jayson=require('jayson/promise');var client=jayson[_0x622a('0xe')][_0x622a('0xf')]({'port':0x232c});var client9003=jayson[_0x622a('0xe')]['http']({'port':0x232b});var client9002=jayson[_0x622a('0xe')][_0x622a('0xf')]({'port':0x232a});function respondWithRpcPromise(_0x533d23,_0x258968,_0x5c9134,_0x131b30){return new BPromise(function(_0x13a95f,_0xbfb445){var _0x380ce1=_0x131b30||client;return _0x380ce1[_0x622a('0x10')](_0x533d23,_0x5c9134)[_0x622a('0x11')](function(_0x3c29f5){logger[_0x622a('0x12')](_0x622a('0x13'),_0x258968,_0x622a('0x14'));logger[_0x622a('0x15')](_0x622a('0x16'),_0x258968,_0x622a('0x14'),JSON[_0x622a('0x17')](_0x3c29f5));if(_0x3c29f5[_0x622a('0x18')]){if(_0x3c29f5['error'][_0x622a('0x19')]===0x1f4){logger[_0x622a('0x18')]('MailMessage,\x20%s,\x20%s',_0x258968,_0x3c29f5['error'][_0x622a('0x1a')]);return _0xbfb445(_0x3c29f5[_0x622a('0x18')][_0x622a('0x1a')]);}logger['error'](_0x622a('0x13'),_0x258968,_0x3c29f5[_0x622a('0x18')][_0x622a('0x1a')]);return _0x13a95f(_0x3c29f5[_0x622a('0x18')][_0x622a('0x1a')]);}else{logger[_0x622a('0x12')](_0x622a('0x13'),_0x258968,_0x622a('0x14'));_0x13a95f(_0x3c29f5[_0x622a('0x1b')][_0x622a('0x1a')]);}})[_0x622a('0x1c')](function(_0x219855){logger[_0x622a('0x18')](_0x622a('0x13'),_0x258968,_0x219855);_0xbfb445(_0x219855);});});}function respondWithResult(_0x18f0c6,_0x135061){_0x135061=_0x135061||0xc8;return function(_0x4719fc){if(_0x4719fc){return _0x18f0c6[_0x622a('0x1d')](_0x135061)[_0x622a('0x1e')](_0x4719fc);}};}function respondWithFilteredResult(_0x515916,_0x36fe75){return function(_0x39f4c7){if(_0x39f4c7){var _0x566904=typeof _0x36fe75[_0x622a('0x1f')]===_0x622a('0x20')&&typeof _0x36fe75[_0x622a('0x21')]==='undefined';var _0x51fb08=_0x39f4c7['count'];var _0x59be4f=_0x566904?0x0:_0x36fe75['offset'];var _0x2eba73=_0x566904?_0x39f4c7[_0x622a('0x22')]:_0x36fe75[_0x622a('0x1f')]+_0x36fe75[_0x622a('0x21')];var _0x2ea608;if(_0x2eba73>=_0x51fb08){_0x2eba73=_0x51fb08;_0x2ea608=0xc8;}else{_0x2ea608=0xce;}_0x515916[_0x622a('0x1d')](_0x2ea608);return _0x515916[_0x622a('0x23')](_0x622a('0x24'),_0x59be4f+'-'+_0x2eba73+'/'+_0x51fb08)[_0x622a('0x1e')](_0x39f4c7);}return null;};}function saveUpdates(_0x19f02){return function(_0x4be34a){if(_0x4be34a){return _0x4be34a[_0x622a('0x25')](_0x19f02)['then'](function(_0x36e421){return _0x36e421;});}return null;};}function removeEntity(_0x34f429){return function(_0x4bc14d){if(_0x4bc14d){return _0x4bc14d[_0x622a('0x26')]()['then'](function(){_0x34f429[_0x622a('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x172cc5){return function(_0x30f860){if(!_0x30f860){_0x172cc5[_0x622a('0x27')](0x194);}return _0x30f860;};}function handleError(_0x3e9a6f,_0x4eaae9){_0x4eaae9=_0x4eaae9||0x1f4;return function(_0x1059bb){logger[_0x622a('0x18')](_0x1059bb[_0x622a('0x28')]);if(_0x1059bb['name']){delete _0x1059bb['name'];}_0x3e9a6f[_0x622a('0x1d')](_0x4eaae9)[_0x622a('0x29')](_0x1059bb);};}exports[_0x622a('0x2a')]=function(_0x2e8cf9,_0x41a744){var _0x2d9205={},_0x39e2ae={},_0x429ba3={'count':0x0,'rows':[]};var _0x3a78c2=_[_0x622a('0x2b')](db['MailMessage'][_0x622a('0x2c')],function(_0x384084){return{'name':_0x384084[_0x622a('0x2d')],'type':_0x384084[_0x622a('0x2e')][_0x622a('0x2f')]};});_0x39e2ae['model']=_[_0x622a('0x2b')](_0x3a78c2,'name');_0x39e2ae[_0x622a('0x30')]=_[_0x622a('0x31')](_0x2e8cf9[_0x622a('0x30')]);_0x39e2ae[_0x622a('0x32')]=_['intersection'](_0x39e2ae[_0x622a('0x33')],_0x39e2ae[_0x622a('0x30')]);_0x2d9205[_0x622a('0x34')]=_[_0x622a('0x35')](_0x39e2ae[_0x622a('0x33')],qs['fields'](_0x2e8cf9['query'][_0x622a('0x36')]));_0x2d9205[_0x622a('0x34')]=_0x2d9205[_0x622a('0x34')][_0x622a('0x37')]?_0x2d9205[_0x622a('0x34')]:_0x39e2ae[_0x622a('0x33')];if(!_0x2e8cf9[_0x622a('0x30')][_0x622a('0x38')](_0x622a('0x39'))){_0x2d9205[_0x622a('0x21')]=qs['limit'](_0x2e8cf9['query'][_0x622a('0x21')]);_0x2d9205[_0x622a('0x1f')]=qs['offset'](_0x2e8cf9[_0x622a('0x30')][_0x622a('0x1f')]);}_0x2d9205[_0x622a('0x3a')]=qs[_0x622a('0x3b')](_0x2e8cf9[_0x622a('0x30')][_0x622a('0x3b')]);_0x2d9205[_0x622a('0x3c')]=qs[_0x622a('0x32')](_[_0x622a('0x3d')](_0x2e8cf9[_0x622a('0x30')],_0x39e2ae[_0x622a('0x32')]),_0x3a78c2);if(_0x2e8cf9['query']['filter']){_0x2d9205[_0x622a('0x3c')]=_[_0x622a('0x3e')](_0x2d9205['where'],{'$or':_[_0x622a('0x2b')](_0x3a78c2,function(_0x5def38){if(_0x5def38[_0x622a('0x2e')]!==_0x622a('0x3f')){var _0x152c62={};_0x152c62[_0x5def38['name']]={'$like':'%'+_0x2e8cf9[_0x622a('0x30')][_0x622a('0x40')]+'%'};return _0x152c62;}})});}_0x2d9205=_[_0x622a('0x3e')]({},_0x2d9205,_0x2e8cf9['options']);var _0x112925={'where':_0x2d9205[_0x622a('0x3c')]};return db[_0x622a('0x41')][_0x622a('0x22')](_0x112925)[_0x622a('0x11')](function(_0x2c4229){_0x429ba3[_0x622a('0x22')]=_0x2c4229;if(_0x2e8cf9[_0x622a('0x30')][_0x622a('0x42')]){_0x2d9205[_0x622a('0x43')]=[{'all':!![]}];}return db[_0x622a('0x41')][_0x622a('0x44')](_0x2d9205);})[_0x622a('0x11')](function(_0x192a00){_0x429ba3[_0x622a('0x45')]=_0x192a00;return _0x429ba3;})[_0x622a('0x11')](respondWithFilteredResult(_0x41a744,_0x2d9205))[_0x622a('0x1c')](handleError(_0x41a744,null));};exports[_0x622a('0x46')]=function(_0x2d5915,_0x568be3){var _0x3811d7={'raw':!![],'where':{'id':_0x2d5915['params']['id']}},_0x1402b8={};_0x1402b8[_0x622a('0x33')]=_[_0x622a('0x31')](db[_0x622a('0x41')]['rawAttributes']);_0x1402b8[_0x622a('0x30')]=_[_0x622a('0x31')](_0x2d5915['query']);_0x1402b8['filters']=_['intersection'](_0x1402b8['model'],_0x1402b8[_0x622a('0x30')]);_0x3811d7[_0x622a('0x34')]=_['intersection'](_0x1402b8[_0x622a('0x33')],qs[_0x622a('0x36')](_0x2d5915[_0x622a('0x30')]['fields']));_0x3811d7[_0x622a('0x34')]=_0x3811d7['attributes'][_0x622a('0x37')]?_0x3811d7[_0x622a('0x34')]:_0x1402b8[_0x622a('0x33')];if(_0x2d5915[_0x622a('0x30')][_0x622a('0x42')]){_0x3811d7[_0x622a('0x43')]=[{'all':!![]}];}_0x3811d7=_[_0x622a('0x3e')]({},_0x3811d7,_0x2d5915[_0x622a('0x47')]);return db[_0x622a('0x41')]['find'](_0x3811d7)[_0x622a('0x11')](handleEntityNotFound(_0x568be3,null))[_0x622a('0x11')](respondWithResult(_0x568be3,null))[_0x622a('0x1c')](handleError(_0x568be3,null));};exports[_0x622a('0x25')]=function(_0x11a2db,_0x31d9ef){if(_0x11a2db[_0x622a('0x48')]['id']){delete _0x11a2db[_0x622a('0x48')]['id'];}return db[_0x622a('0x41')]['find']({'where':{'id':_0x11a2db[_0x622a('0x49')]['id']}})[_0x622a('0x11')](handleEntityNotFound(_0x31d9ef,null))[_0x622a('0x11')](saveUpdates(_0x11a2db[_0x622a('0x48')],null))[_0x622a('0x11')](respondWithResult(_0x31d9ef,null))[_0x622a('0x1c')](handleError(_0x31d9ef,null));};exports[_0x622a('0x26')]=function(_0x580d15,_0x290f62){return db[_0x622a('0x41')]['find']({'where':{'id':_0x580d15[_0x622a('0x49')]['id']}})[_0x622a('0x11')](handleEntityNotFound(_0x290f62,null))[_0x622a('0x11')](removeEntity(_0x290f62,null))['catch'](handleError(_0x290f62,null));};exports[_0x622a('0x4a')]=function(_0x312670,_0xc6d26e){return db[_0x622a('0x41')][_0x622a('0x4a')]()[_0x622a('0x11')](respondWithResult(_0xc6d26e,null))['catch'](handleError(_0xc6d26e,null));};exports[_0x622a('0x4b')]=function(_0x327173,_0x29875a){return db[_0x622a('0x41')][_0x622a('0x4b')](_0x327173['body'])[_0x622a('0x11')](function(_0x3c8c95){if(_0x3c8c95){if(_0x3c8c95[_0x622a('0x4c')]==='out'&&!_0x3c8c95[_0x622a('0x4d')]){var _0x3ba35e,_0x529c81,_0x34278b;if(_0x327173['body']['to']){_0x529c81=_0x327173[_0x622a('0x48')]['to'][_0x622a('0x4e')](',')[0x0];}return db[_0x622a('0x4f')][_0x622a('0x50')]({'where':{'id':_0x3c8c95[_0x622a('0x51')]},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x529c81},'limit':0x1,'order':[[_0x622a('0x52'),_0x622a('0x53')]]}]},{'model':db['MailServerOut'],'as':_0x622a('0x54'),'raw':!![]}]})[_0x622a('0x11')](function(_0x3c395b){_0x3ba35e=_0x3c395b;if(_0x3ba35e&&_0x3ba35e[_0x622a('0x54')]){var _0x395c51={'tls':{'rejectUnauthorized':![]}};if(_[_0x622a('0x55')](_0x3ba35e[_0x622a('0x54')]['service'])){_0x395c51[_0x622a('0x56')]=_0x3ba35e[_0x622a('0x54')][_0x622a('0x56')];_0x395c51['port']=_0x3ba35e[_0x622a('0x54')][_0x622a('0x57')];_0x395c51[_0x622a('0x58')]=_0x3ba35e['Smtp']['secure'];if(_0x3ba35e[_0x622a('0x54')][_0x622a('0x59')]){_0x395c51[_0x622a('0x5a')]={'user':_0x3ba35e[_0x622a('0x54')]['user'],'pass':_0x3ba35e[_0x622a('0x54')][_0x622a('0x5b')]};}}else{_0x395c51[_0x622a('0x5c')]=_0x3ba35e[_0x622a('0x54')][_0x622a('0x5c')];_0x395c51['auth']={'user':_0x3ba35e['Smtp'][_0x622a('0x5d')],'pass':_0x3ba35e[_0x622a('0x54')][_0x622a('0x5b')]};_0x395c51['secure']=_0x3ba35e[_0x622a('0x54')]['secure'];}if(_0x327173['body'][_0x622a('0x5e')]&&_0x327173[_0x622a('0x48')][_0x622a('0x5e')][_0x622a('0x37')]){for(var _0x42597f=0x0;_0x42597f<_0x327173[_0x622a('0x48')]['attachments'][_0x622a('0x37')];_0x42597f+=0x1){_0x327173[_0x622a('0x48')]['attachments'][_0x42597f]={'filename':_0x327173[_0x622a('0x48')][_0x622a('0x5e')][_0x42597f][_0x622a('0x5f')],'path':path['join'](config['root'],_0x622a('0x60'),_0x327173['body'][_0x622a('0x5e')][_0x42597f][_0x622a('0x61')])};}}_0x34278b={'account':_0x395c51,'message':_0x327173[_0x622a('0x48')]};return;}})['then'](function(){if(_0x3ba35e[_0x622a('0x62')]){if(_0x3ba35e[_0x622a('0x62')][_0x622a('0x63')][_0x622a('0x37')]){return _0x3ba35e[_0x622a('0x62')][_0x622a('0x63')][0x0];}else{return db[_0x622a('0x64')][_0x622a('0x4b')](_[_0x622a('0xa')](_0x327173['body'],{'firstName':_0x327173[_0x622a('0x48')]['to'],'email':_0x327173[_0x622a('0x48')]['to'],'phone':_0x327173['body']['to'],'ListId':_0x3ba35e[_0x622a('0x65')]}));}}else{throw new Error(_0x622a('0x66'));}})['then'](function(){if(_0x34278b){return respondWithRpcPromise('SendMail','sendMail',_0x34278b,client9003)['then'](function(_0x410f71){return _0x3c8c95[_0x622a('0x25')]({'read':!![],'messageId':_0x410f71[_0x622a('0x67')],'sentAt':moment()['format'](_0x622a('0x68'))});})[_0x622a('0x1c')](function(_0x482dd4){logger[_0x622a('0x18')]('%s',JSON[_0x622a('0x17')](_0x482dd4));return _0x3c8c95;});}return _0x3c8c95;});}return _0x3c8c95;}})[_0x622a('0x11')](respondWithResult(_0x29875a,0xc9))[_0x622a('0x1c')](handleError(_0x29875a,null));};exports[_0x622a('0x69')]=function(_0x12d0fd,_0x1dfc1e){var _0x51fc36={'agent':{},'channel':'mail'};if(_0x12d0fd['body']['id']){delete _0x12d0fd[_0x622a('0x48')]['id'];}_0x12d0fd[_0x622a('0x48')][_0x622a('0x6a')]=!![];_0x12d0fd[_0x622a('0x48')][_0x622a('0x6b')]=moment()[_0x622a('0x6c')](_0x622a('0x68'));_0x12d0fd['body'][_0x622a('0x6d')]=_0x12d0fd[_0x622a('0x48')][_0x622a('0x6d')]||_0x12d0fd['user']['id'];_0x51fc36['agent']['id']=_0x12d0fd[_0x622a('0x48')][_0x622a('0x6d')];return db[_0x622a('0x41')][_0x622a('0x6e')]({'where':{'id':_0x12d0fd[_0x622a('0x49')]['id'],'UserId':null}})[_0x622a('0x11')](handleEntityNotFound(_0x1dfc1e,null))[_0x622a('0x11')](saveUpdates(_0x12d0fd[_0x622a('0x48')],null))[_0x622a('0x11')](function(_0x594c76){if(_0x594c76){_0x51fc36[_0x622a('0x1a')]=_0x594c76['get']({'plain':!![]});return db[_0x622a('0x6f')][_0x622a('0x6e')]({'where':{'id':_0x594c76[_0x622a('0x70')]}});}return null;})[_0x622a('0x11')](handleEntityNotFound(_0x1dfc1e,null))[_0x622a('0x11')](function(_0x4b66a1){if(_0x4b66a1){return _0x4b66a1[_0x622a('0x25')]({'UserId':_0x12d0fd['body'][_0x622a('0x6d')],'read1stAt':_[_0x622a('0x55')](_0x4b66a1['read1stAt'])?moment()[_0x622a('0x6c')](_0x622a('0x68')):undefined});}return null;})['then'](function(_0x384f2b){if(_0x384f2b){_0x51fc36[_0x622a('0x71')]=_0x384f2b[_0x622a('0x72')]({'plain':!![]});interaction_log[_0x622a('0x12')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x12d0fd[_0x622a('0x5d')]['id'],_0x12d0fd[_0x622a('0x5d')][_0x622a('0x5f')],_0x12d0fd[_0x622a('0x5d')][_0x622a('0x73')],_0x51fc36[_0x622a('0x71')]['id'],_0x12d0fd['body']?JSON[_0x622a('0x17')](_0x12d0fd[_0x622a('0x48')]):'null');return respondWithRpcPromise(_0x622a('0x74'),_0x622a('0x75'),_0x51fc36);}return null;})['then'](function(_0x2fd39d){var _0x43fad0=_0x622a('0x76')+_0x2fd39d[_0x622a('0x1a')][_0x622a('0x77')];return db[_0x622a('0x78')][_0x622a('0x30')](_0x43fad0,{'type':db[_0x622a('0x79')][_0x622a('0x7a')][_0x622a('0x7b')],'raw':!![]})[_0x622a('0x11')](function(_0x2dec57){return _0x2dec57;});})[_0x622a('0x11')](function(_0x35fbae){if(_0x35fbae){_0x51fc36[_0x622a('0x1a')][_0x622a('0x7c')]=_0x35fbae[0x0];if(!_0x12d0fd[_0x622a('0x48')][_0x622a('0x6d')])return;return db[_0x622a('0x7d')][_0x622a('0x6e')]({'where':{'id':_0x12d0fd[_0x622a('0x48')]['UserId'],'role':_0x622a('0x7e')},'attributes':['id',_0x622a('0x5f'),'fullname','email',_0x622a('0x7f')],'raw':!![]});}return null;})[_0x622a('0x11')](function(_0x237bca){if(!_0x237bca)return null;_0x51fc36[_0x622a('0x1a')][_0x622a('0x7e')]=_0x237bca;return _0x51fc36;})[_0x622a('0x11')](function(_0x2e9666){if(_0x2e9666){if(_0x12d0fd[_0x622a('0x48')]['manual']){_0x51fc36[_0x622a('0x1a')][_0x622a('0x80')]=util[_0x622a('0x6c')](_0x622a('0x81'),_0x12d0fd[_0x622a('0x5d')][_0x622a('0x5f')]);_0x51fc36[_0x622a('0x1a')][_0x622a('0x82')]=_0x51fc36[_0x622a('0x82')];_0x51fc36['message'][_0x622a('0x83')]=_0x51fc36[_0x622a('0x82')];_0x51fc36[_0x622a('0x1a')]['event']=_0x622a('0x69');_0x51fc36[_0x622a('0x1a')][_0x622a('0x48')]=htmlToText[_0x622a('0x84')](_0x51fc36['message'][_0x622a('0x48')]);return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x51fc36[_0x622a('0x1a')]},client9002)[_0x622a('0x11')](function(){return _0x51fc36;});}return _0x51fc36;}return null;})['then'](respondWithResult(_0x1dfc1e,null))[_0x622a('0x1c')](handleError(_0x1dfc1e,null));};exports[_0x622a('0x85')]=function(_0x140178,_0x45bf91){var _0x58db6e={'agent':{},'channel':_0x622a('0x86')};if(_0x140178['body']['id']){delete _0x140178[_0x622a('0x48')]['id'];}_0x140178[_0x622a('0x48')][_0x622a('0x6d')]=_0x140178['body'][_0x622a('0x6d')]||_0x140178[_0x622a('0x5d')]['id'];_0x58db6e['agent']['id']=_0x140178[_0x622a('0x48')][_0x622a('0x6d')];return db['MailMessage'][_0x622a('0x6e')]({'where':{'id':_0x140178['params']['id'],'UserId':null}})[_0x622a('0x11')](handleEntityNotFound(_0x45bf91,null))[_0x622a('0x11')](function(_0x2ce41a){if(_0x2ce41a){_0x58db6e[_0x622a('0x1a')]=_0x2ce41a['get']({'plain':!![]});return db[_0x622a('0x6f')][_0x622a('0x6e')]({'where':{'id':_0x2ce41a['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x45bf91,null))[_0x622a('0x11')](function(_0x11af37){if(_0x11af37){_0x58db6e['interaction']=_0x11af37[_0x622a('0x72')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x140178[_0x622a('0x5d')]['id'],_0x140178['user'][_0x622a('0x5f')],_0x140178[_0x622a('0x5d')][_0x622a('0x73')],_0x58db6e[_0x622a('0x71')]['id'],_0x140178['body']?JSON['stringify'](_0x140178[_0x622a('0x48')]):_0x622a('0x87'));return respondWithRpcPromise('RejectMessage',_0x622a('0x88'),_0x58db6e);}return null;})[_0x622a('0x11')](function(_0x286c75){var _0x490021=_0x622a('0x76')+_0x286c75[_0x622a('0x1a')][_0x622a('0x77')];return db[_0x622a('0x78')][_0x622a('0x30')](_0x490021,{'type':db[_0x622a('0x79')]['QueryTypes'][_0x622a('0x7b')],'raw':!![]})[_0x622a('0x11')](function(_0x2c7a63){return _0x2c7a63;});})[_0x622a('0x11')](function(_0x5873f3){if(_0x5873f3){_0x58db6e[_0x622a('0x1a')][_0x622a('0x7c')]=_0x5873f3[0x0];if(!_0x140178[_0x622a('0x48')][_0x622a('0x6d')])return;return db[_0x622a('0x7d')][_0x622a('0x6e')]({'where':{'id':_0x140178[_0x622a('0x48')][_0x622a('0x6d')],'role':'agent'},'attributes':['id',_0x622a('0x5f'),_0x622a('0x89'),_0x622a('0x8a'),'internal'],'raw':!![]});}return null;})['then'](function(_0x8fb039){if(!_0x8fb039)return null;_0x58db6e[_0x622a('0x1a')][_0x622a('0x7e')]=_0x8fb039;return _0x58db6e;})[_0x622a('0x11')](function(_0x57a05e){if(_0x57a05e){_0x57a05e[_0x622a('0x1a')]['interface']=util[_0x622a('0x6c')](_0x622a('0x81'),_0x140178['user'][_0x622a('0x5f')]);_0x57a05e[_0x622a('0x1a')]['channel']=_0x58db6e[_0x622a('0x82')];_0x57a05e[_0x622a('0x1a')][_0x622a('0x83')]=_0x58db6e[_0x622a('0x82')];_0x57a05e[_0x622a('0x1a')][_0x622a('0x8b')]=_0x622a('0x85');_0x57a05e[_0x622a('0x1a')]['body']=htmlToText['fromString'](_0x58db6e[_0x622a('0x1a')]['body']);respondWithRpcPromise(_0x622a('0x8c'),_0x622a('0x8c'),{'event':_0x622a('0x8d'),'message':_0x57a05e[_0x622a('0x1a')]},client9002);return _0x58db6e;}return null;})[_0x622a('0x11')](respondWithResult(_0x45bf91,null))[_0x622a('0x1c')](handleError(_0x45bf91,null));};exports[_0x622a('0x8e')]=function(_0x250f35,_0x6ccae6){var _0x46e0d4=moment()[_0x622a('0x8f')]()[_0x622a('0x90')]();var _0x32d417=path[_0x622a('0x91')](config[_0x622a('0x92')],'server',_0x622a('0x93'),'tmp');var _0x37b969=path[_0x622a('0x91')](config[_0x622a('0x92')],_0x622a('0x94'),_0x622a('0x93'),_0x622a('0x5e'));var _0x3aac41=util[_0x622a('0x6c')]('message-%s.eml',_0x46e0d4);return db[_0x622a('0x41')]['find']({'where':{'id':_0x250f35[_0x622a('0x49')]['id']},'attributes':['id',_0x622a('0x48'),_0x622a('0x95'),'to','cc',_0x622a('0x96'),_0x622a('0x97'),_0x622a('0x98')],'include':_0x250f35[_0x622a('0x30')][_0x622a('0x5e')]?[{'model':db[_0x622a('0x99')],'as':_0x622a('0x9a')}]:undefined})[_0x622a('0x11')](handleEntityNotFound(_0x6ccae6,null))[_0x622a('0x11')](function(_0x11b3d3){if(_0x11b3d3){var _0x1f1fc3=_0x11b3d3;var _0x5f3e3f={'from':_0x1f1fc3[_0x622a('0x95')],'to':_0x1f1fc3['to'],'subject':_0x1f1fc3['subject'],'html':htmlEntities[_0x622a('0x9b')](_0x1f1fc3[_0x622a('0x48')]),'headers':{'Date':moment(_0x1f1fc3[_0x622a('0x98')])[_0x622a('0x6c')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x11b3d3['cc']){_0x5f3e3f[_0x622a('0x9c')]['Cc']=_0x11b3d3['cc'];}if(_0x11b3d3[_0x622a('0x96')]){_0x5f3e3f['headers'][_0x622a('0x9d')]=_0x11b3d3[_0x622a('0x96')];}return new BPromise(function(_0x2e794a,_0xf76b6b){if(_0x11b3d3[_0x622a('0x9a')]){for(var _0x246d1f=0x0;_0x246d1f<_0x11b3d3[_0x622a('0x9a')][_0x622a('0x37')];_0x246d1f++){var _0xf613de=_0x11b3d3[_0x622a('0x9a')][_0x246d1f];var _0x423bae=path[_0x622a('0x91')](_0x37b969,_0xf613de['basename']);if(fs[_0x622a('0x9e')](_0x423bae)){_0x5f3e3f['attachments'][_0x622a('0x9f')]({'name':_0xf613de['name'],'contentType':_0xf613de[_0x622a('0x2e')],'data':fs['readFileSync'](_0x423bae)});}}}emlformat[_0x622a('0xa0')](_0x5f3e3f,function(_0x69d85e,_0x250d7a){if(_0x69d85e)return _0xf76b6b(_0x69d85e);fs[_0x622a('0xa1')](path[_0x622a('0x91')](_0x32d417,_0x3aac41),_0x250d7a);return _0x2e794a(_0x250d7a);});});}})[_0x622a('0x11')](function(_0x144a13){if(_0x144a13){return _0x6ccae6[_0x622a('0x8e')](path['join'](_0x32d417,_0x3aac41),_0x3aac41,function(_0x2aed29){if(!_0x2aed29)fs['unlinkSync'](path[_0x622a('0x91')](_0x32d417,_0x3aac41));});}})[_0x622a('0x1c')](handleError(_0x6ccae6,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 7f696a9..c794c14 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 _0xb263=['remove','emit','hasOwnProperty','exports','../../mysqldb','MailMessage','save','update'];(function(_0x199b1f,_0x4ed849){var _0x267ac9=function(_0x184ac6){while(--_0x184ac6){_0x199b1f['push'](_0x199b1f['shift']());}};_0x267ac9(++_0x4ed849);}(_0xb263,0xe4));var _0x3b26=function(_0x16367d,_0x3a3437){_0x16367d=_0x16367d-0x0;var _0x20cfc8=_0xb263[_0x16367d];return _0x20cfc8;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x3b26('0x0'))['db'][_0x3b26('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3b26('0x2'),'afterUpdate':_0x3b26('0x3'),'afterDestroy':_0x3b26('0x4')};function emitEvent(_0x6a0f5c){return function(_0x175807,_0x5b23bb,_0x2edc19){MailMessageEvents[_0x3b26('0x5')](_0x6a0f5c+':'+_0x175807['id'],_0x175807);MailMessageEvents[_0x3b26('0x5')](_0x6a0f5c,_0x175807);_0x2edc19(null);};}for(var e in events){if(events[_0x3b26('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x3b26('0x7')]=MailMessageEvents; \ No newline at end of file +var _0xd6fa=['exports','events','MailMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd6fa,0x64));var _0xad6f=function(_0x426706,_0x5a7138){_0x426706=_0x426706-0x0;var _0x2288d1=_0xd6fa[_0x426706];return _0x2288d1;};'use strict';var EventEmitter=require(_0xad6f('0x0'));var MailMessage=require('../../mysqldb')['db'][_0xad6f('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xad6f('0x2')](0x0);var events={'afterCreate':_0xad6f('0x3'),'afterUpdate':_0xad6f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3724a5){return function(_0x3afd1e,_0x2c9d45,_0x15694a){MailMessageEvents['emit'](_0x3724a5+':'+_0x3afd1e['id'],_0x3afd1e);MailMessageEvents[_0xad6f('0x5')](_0x3724a5,_0x3afd1e);_0x15694a(null);};}for(var e in events){if(events[_0xad6f('0x6')](e)){var event=events[e];MailMessage[_0xad6f('0x7')](e,emitEvent(event));}}module[_0xad6f('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 75eec2f..9cd4c00 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 _0xa064=['mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','models','get','toLowerCase','direction','out','secret','UserId','MailInteraction','findOne','MailInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','exports','MailMessage'];(function(_0x5851d9,_0x4b68c7){var _0x38a4ac=function(_0x1f7e65){while(--_0x1f7e65){_0x5851d9['push'](_0x5851d9['shift']());}};_0x38a4ac(++_0x4b68c7);}(_0xa064,0xdd));var _0x4a06=function(_0x1d0948,_0x29a5ad){_0x1d0948=_0x1d0948-0x0;var _0x405614=_0xa064[_0x1d0948];return _0x405614;};'use strict';var _=require(_0x4a06('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4a06('0x1'));var BPromise=require(_0x4a06('0x2'));var rp=require(_0x4a06('0x3'));var htmlToText=require(_0x4a06('0x4'));var fs=require('fs');var path=require(_0x4a06('0x5'));var rimraf=require(_0x4a06('0x6'));var config=require(_0x4a06('0x7'));var attributes=require('./mailMessage.attributes');module[_0x4a06('0x8')]=function(_0x257d20,_0x1861ec){return _0x257d20['define'](_0x4a06('0x9'),attributes,{'tableName':_0x4a06('0xa'),'paranoid':![],'indexes':[{'name':_0x4a06('0xb'),'fields':['messageId']},{'name':_0x4a06('0xc'),'fields':[_0x4a06('0xd'),_0x4a06('0xe')],'type':_0x4a06('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4a6cb4,_0x178469,_0x4b2168){if(_0x4a6cb4[_0x4a06('0x10')]){_0x4a6cb4[_0x4a06('0xd')]=htmlToText['fromString'](_0x4a6cb4['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4b2168(null,_0x178469);},'afterCreate':function(_0x4eed36,_0x15d069,_0x2a5a32){var _0x45d612=_0x257d20[_0x4a06('0x11')];var _0x5d7d9e=_0x4eed36[_0x4a06('0x12')]({'plain':!![]});if(_0x5d7d9e['direction'][_0x4a06('0x13')]()==='in'||_0x5d7d9e[_0x4a06('0x14')]['toLowerCase']()===_0x4a06('0x15')&&!_0x5d7d9e[_0x4a06('0x16')]&&!_['isNil'](_0x5d7d9e[_0x4a06('0x17')])){_0x45d612[_0x4a06('0x18')][_0x4a06('0x19')]({'where':{'id':_0x5d7d9e[_0x4a06('0x1a')]}})[_0x4a06('0x1b')](function(_0x40c86f){if(_0x40c86f){_0x40c86f['update']({'lastMsgAt':_0x5d7d9e[_0x4a06('0x1c')],'lastMsgDirection':_0x5d7d9e[_0x4a06('0x14')][_0x4a06('0x13')]()});}})[_0x4a06('0x1d')](function(_0x359700){console[_0x4a06('0x1e')](_0x359700);});}_0x2a5a32();}},'charset':_0x4a06('0x1f'),'collate':_0x4a06('0x20')});}; \ No newline at end of file +var _0x58fd=['update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','./mailMessage.attributes','exports','define','MailMessage','messageId','fti_mail_messages','body','models','direction','toLowerCase','out','isNil','UserId','MailInteraction','findOne','then'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x58fd,0x1d7));var _0xd58f=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x58fd[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0xd58f('0x0'));var util=require('util');var logger=require(_0xd58f('0x1'))(_0xd58f('0x2'));var moment=require(_0xd58f('0x3'));var BPromise=require(_0xd58f('0x4'));var rp=require(_0xd58f('0x5'));var htmlToText=require(_0xd58f('0x6'));var fs=require('fs');var path=require(_0xd58f('0x7'));var rimraf=require(_0xd58f('0x8'));var config=require('../../config/environment');var attributes=require(_0xd58f('0x9'));module[_0xd58f('0xa')]=function(_0x12486f,_0x6fb333){return _0x12486f[_0xd58f('0xb')](_0xd58f('0xc'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xd58f('0xd'),'fields':[_0xd58f('0xd')]},{'name':_0xd58f('0xe'),'fields':['plainBody','subject'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1c51e5,_0x2e8bcf,_0x5f4812){if(_0x1c51e5[_0xd58f('0xf')]){_0x1c51e5['plainBody']=htmlToText['fromString'](_0x1c51e5[_0xd58f('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5f4812(null,_0x2e8bcf);},'afterCreate':function(_0x4d3d99,_0x46609d,_0x43bdf4){var _0x2836e7=_0x12486f[_0xd58f('0x10')];var _0x2d9b60=_0x4d3d99['get']({'plain':!![]});if(_0x2d9b60[_0xd58f('0x11')][_0xd58f('0x12')]()==='in'||_0x2d9b60[_0xd58f('0x11')][_0xd58f('0x12')]()===_0xd58f('0x13')&&!_0x2d9b60['secret']&&!_[_0xd58f('0x14')](_0x2d9b60[_0xd58f('0x15')])){_0x2836e7[_0xd58f('0x16')][_0xd58f('0x17')]({'where':{'id':_0x2d9b60['MailInteractionId']}})[_0xd58f('0x18')](function(_0x3b6a77){if(_0x3b6a77){_0x3b6a77[_0xd58f('0x19')]({'lastMsgAt':_0x2d9b60[_0xd58f('0x1a')],'lastMsgDirection':_0x2d9b60[_0xd58f('0x11')][_0xd58f('0x12')]()});}})[_0xd58f('0x1b')](function(_0x512a2a){console[_0xd58f('0x1c')](_0x512a2a);});}_0x43bdf4();}},'charset':_0xd58f('0x1d'),'collate':_0xd58f('0x1e')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 0a2d103..1727067 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 _0x896e=['request\x20sent','debug','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','options','raw','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./mailMessage.socket','register','request','then','MailMessage,\x20%s,\x20%s'];(function(_0x3a5a1b,_0x4a34a8){var _0x10927d=function(_0x4f6679){while(--_0x4f6679){_0x3a5a1b['push'](_0x3a5a1b['shift']());}};_0x10927d(++_0x4a34a8);}(_0x896e,0x1e9));var _0xe896=function(_0x5bf8c0,_0x228ecb){_0x5bf8c0=_0x5bf8c0-0x0;var _0x3b03cd=_0x896e[_0x5bf8c0];return _0x3b03cd;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});config[_0xe896('0xd')]=_[_0xe896('0xe')](config[_0xe896('0xd')],{'host':_0xe896('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe896('0xd')]));require(_0xe896('0x10'))[_0xe896('0x11')](socket);function respondWithRpcPromise(_0x4afd3f,_0x305616,_0x48251e){return new BPromise(function(_0x45b15b,_0x5be679){return client[_0xe896('0x12')](_0x4afd3f,_0x48251e)[_0xe896('0x13')](function(_0xa00ae9){logger['info'](_0xe896('0x14'),_0x305616,_0xe896('0x15'));logger[_0xe896('0x16')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x305616,_0xe896('0x15'),JSON[_0xe896('0x17')](_0xa00ae9));if(_0xa00ae9[_0xe896('0x18')]){if(_0xa00ae9['error'][_0xe896('0x19')]===0x1f4){logger[_0xe896('0x18')](_0xe896('0x14'),_0x305616,_0xa00ae9['error']['message']);return _0x5be679(_0xa00ae9[_0xe896('0x18')][_0xe896('0x1a')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x305616,_0xa00ae9[_0xe896('0x18')][_0xe896('0x1a')]);return _0x45b15b(_0xa00ae9['error'][_0xe896('0x1a')]);}else{logger['info'](_0xe896('0x14'),_0x305616,_0xe896('0x15'));_0x45b15b(_0xa00ae9[_0xe896('0x1b')]['message']);}})[_0xe896('0x1c')](function(_0x9714f1){logger[_0xe896('0x18')](_0xe896('0x14'),_0x305616,_0x9714f1);_0x5be679(_0x9714f1);});});}exports[_0xe896('0x1d')]=function(_0x3ac8b8){var _0x388c2e=this;return new Promise(function(_0x32d3d3,_0x49547b){return db[_0xe896('0x1e')]['create'](_0x3ac8b8['body'],{'raw':_0x3ac8b8[_0xe896('0x1f')]?_0x3ac8b8[_0xe896('0x1f')][_0xe896('0x20')]===undefined?!![]:![]:!![]})[_0xe896('0x13')](function(_0x498469){logger[_0xe896('0x21')]('CreateMailMessage',_0x3ac8b8);logger['debug'](_0xe896('0x1d'),_0x3ac8b8,JSON[_0xe896('0x17')](_0x498469));_0x32d3d3(_0x498469);})[_0xe896('0x1c')](function(_0x2e2c10){logger[_0xe896('0x18')](_0xe896('0x1d'),_0x2e2c10[_0xe896('0x1a')],_0x3ac8b8);_0x49547b(_0x388c2e['error'](0x1f4,_0x2e2c10[_0xe896('0x1a')]));});});}; \ No newline at end of file +var _0x160f=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','create','options','raw'];(function(_0x57db49,_0x288094){var _0xd0636f=function(_0x227787){while(--_0x227787){_0x57db49['push'](_0x57db49['shift']());}};_0xd0636f(++_0x288094);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var moment=require(_0xf160('0x2'));var BPromise=require(_0xf160('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf160('0x4'));var db=require(_0xf160('0x5'))['db'];var utils=require(_0xf160('0x6'));var logger=require(_0xf160('0x7'))(_0xf160('0x8'));var config=require(_0xf160('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf160('0xa')][_0xf160('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xf160('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf160('0xd'))[_0xf160('0xe')](socket);function respondWithRpcPromise(_0x393f70,_0x2736b8,_0x5e09c6){return new BPromise(function(_0x4a0639,_0xf8ec3d){return client[_0xf160('0xf')](_0x393f70,_0x5e09c6)[_0xf160('0x10')](function(_0x56072f){logger[_0xf160('0x11')](_0xf160('0x12'),_0x2736b8,_0xf160('0x13'));logger[_0xf160('0x14')](_0xf160('0x15'),_0x2736b8,'request\x20sent',JSON[_0xf160('0x16')](_0x56072f));if(_0x56072f['error']){if(_0x56072f[_0xf160('0x17')][_0xf160('0x18')]===0x1f4){logger[_0xf160('0x17')](_0xf160('0x12'),_0x2736b8,_0x56072f[_0xf160('0x17')][_0xf160('0x19')]);return _0xf8ec3d(_0x56072f[_0xf160('0x17')][_0xf160('0x19')]);}logger[_0xf160('0x17')]('MailMessage,\x20%s,\x20%s',_0x2736b8,_0x56072f[_0xf160('0x17')][_0xf160('0x19')]);return _0x4a0639(_0x56072f[_0xf160('0x17')][_0xf160('0x19')]);}else{logger['info'](_0xf160('0x12'),_0x2736b8,'request\x20sent');_0x4a0639(_0x56072f[_0xf160('0x1a')][_0xf160('0x19')]);}})[_0xf160('0x1b')](function(_0x1e09f3){logger[_0xf160('0x17')](_0xf160('0x12'),_0x2736b8,_0x1e09f3);_0xf8ec3d(_0x1e09f3);});});}exports[_0xf160('0x1c')]=function(_0x2a8cb4){var _0x1fdb38=this;return new Promise(function(_0x4a58d9,_0x40ccf0){return db[_0xf160('0x1d')][_0xf160('0x1e')](_0x2a8cb4['body'],{'raw':_0x2a8cb4[_0xf160('0x1f')]?_0x2a8cb4[_0xf160('0x1f')][_0xf160('0x20')]===undefined?!![]:![]:!![]})[_0xf160('0x10')](function(_0x2e03c8){logger[_0xf160('0x11')](_0xf160('0x1c'),_0x2a8cb4);logger['debug'](_0xf160('0x1c'),_0x2a8cb4,JSON[_0xf160('0x16')](_0x2e03c8));_0x4a58d9(_0x2e03c8);})[_0xf160('0x1b')](function(_0x49bb5c){logger['error'](_0xf160('0x1c'),_0x49bb5c[_0xf160('0x19')],_0x2a8cb4);_0x40ccf0(_0x1fdb38['error'](0x1f4,_0x49bb5c['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 5dc6c34..edb5b0d 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 _0x0662=['emit','removeListener','register','length','mailMessage:','save','remove','update'];(function(_0x55da92,_0x35b33d){var _0x5e993e=function(_0x132cfd){while(--_0x132cfd){_0x55da92['push'](_0x55da92['shift']());}};_0x5e993e(++_0x35b33d);}(_0x0662,0x175));var _0x2066=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x0662[_0x30ae5e];return _0x1f2e93;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x2066('0x0'),_0x2066('0x1'),_0x2066('0x2')];function createListener(_0x1b67e3,_0x58c10d){return function(_0x2cd9bf){_0x58c10d[_0x2066('0x3')](_0x1b67e3,_0x2cd9bf);};}function removeListener(_0x782930,_0x278653){return function(){MailMessageEvents[_0x2066('0x4')](_0x782930,_0x278653);};}exports[_0x2066('0x5')]=function(_0x444968){for(var _0x3e2d2e=0x0,_0x38e656=events[_0x2066('0x6')];_0x3e2d2e<_0x38e656;_0x3e2d2e++){var _0x2999ed=events[_0x3e2d2e];var _0x510675=createListener(_0x2066('0x7')+_0x2999ed,_0x444968);MailMessageEvents['on'](_0x2999ed,_0x510675);}}; \ No newline at end of file +var _0x6da3=['register','length','mailMessage:','./mailMessage.events','save','remove'];(function(_0x45c574,_0x497848){var _0x2fa16a=function(_0x1e903a){while(--_0x1e903a){_0x45c574['push'](_0x45c574['shift']());}};_0x2fa16a(++_0x497848);}(_0x6da3,0xf9));var _0x36da=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6da3[_0x17d9e3];return _0x14192d;};'use strict';var MailMessageEvents=require(_0x36da('0x0'));var events=[_0x36da('0x1'),_0x36da('0x2'),'update'];function createListener(_0x3dc309,_0x28e999){return function(_0x2eac1f){_0x28e999['emit'](_0x3dc309,_0x2eac1f);};}function removeListener(_0x5d4432,_0x1da2d4){return function(){MailMessageEvents['removeListener'](_0x5d4432,_0x1da2d4);};}exports[_0x36da('0x3')]=function(_0x25c4fd){for(var _0x3eb004=0x0,_0x5d078d=events[_0x36da('0x4')];_0x3eb004<_0x5d078d;_0x3eb004++){var _0x2d7488=events[_0x3eb004];var _0x46083a=createListener(_0x36da('0x5')+_0x2d7488,_0x25c4fd);MailMessageEvents['on'](_0x2d7488,_0x46083a);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index e88848e..c520deb 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 _0xbfa3=['/:id/users','addAgents','update','delete','destroy','removeAgents','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','index','/describe','get','/:id','show','/:id/members','isAuthenticated','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams'];(function(_0x11f328,_0x5e833a){var _0x3a3d39=function(_0x1db884){while(--_0x1db884){_0x11f328['push'](_0x11f328['shift']());}};_0x3a3d39(++_0x5e833a);}(_0xbfa3,0x14a));var _0x3bfa=function(_0x39d0d5,_0xcd43b4){_0x39d0d5=_0x39d0d5-0x0;var _0x4e4d18=_0xbfa3[_0x39d0d5];return _0x4e4d18;};'use strict';var multer=require(_0x3bfa('0x0'));var util=require('util');var path=require(_0x3bfa('0x1'));var timeout=require('connect-timeout');var express=require(_0x3bfa('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3bfa('0x3'));var interaction=require(_0x3bfa('0x4'));var config=require(_0x3bfa('0x5'));var controller=require(_0x3bfa('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x3bfa('0x7')]);router['get'](_0x3bfa('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x3bfa('0x9')](_0x3bfa('0xa'),auth['isAuthenticated'](),controller[_0x3bfa('0xb')]);router['get'](_0x3bfa('0xc'),auth[_0x3bfa('0xd')](),controller[_0x3bfa('0xe')]);router[_0x3bfa('0x9')](_0x3bfa('0xf'),auth[_0x3bfa('0xd')](),controller[_0x3bfa('0x10')]);router[_0x3bfa('0x9')]('/:id/users',auth[_0x3bfa('0xd')](),controller[_0x3bfa('0x11')]);router[_0x3bfa('0x12')]('/',auth[_0x3bfa('0xd')](),controller[_0x3bfa('0x13')]);router[_0x3bfa('0x12')](_0x3bfa('0xf'),auth['isAuthenticated'](),controller[_0x3bfa('0x14')]);router['post'](_0x3bfa('0x15'),auth[_0x3bfa('0xd')](),controller[_0x3bfa('0x16')]);router['put'](_0x3bfa('0xa'),auth['isAuthenticated'](),controller[_0x3bfa('0x17')]);router[_0x3bfa('0x18')](_0x3bfa('0xa'),auth[_0x3bfa('0xd')](),controller[_0x3bfa('0x19')]);router[_0x3bfa('0x18')]('/:id/teams',auth[_0x3bfa('0xd')](),controller['removeTeams']);router['delete'](_0x3bfa('0x15'),auth[_0x3bfa('0xd')](),controller[_0x3bfa('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xfb7a=['index','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','put','delete','destroy','/:id/teams','removeTeams','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x1b6889,_0x4dd733){var _0x36f95d=function(_0x584241){while(--_0x584241){_0x1b6889['push'](_0x1b6889['shift']());}};_0x36f95d(++_0x4dd733);}(_0xfb7a,0x79));var _0xafb7=function(_0xc18ce1,_0x329f9b){_0xc18ce1=_0xc18ce1-0x0;var _0x12ea8b=_0xfb7a[_0xc18ce1];return _0x12ea8b;};'use strict';var multer=require(_0xafb7('0x0'));var util=require(_0xafb7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xafb7('0x2'));var router=express[_0xafb7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xafb7('0x4'));var interaction=require(_0xafb7('0x5'));var config=require(_0xafb7('0x6'));var controller=require('./mailQueue.controller');router[_0xafb7('0x7')]('/',auth[_0xafb7('0x8')](),controller[_0xafb7('0x9')]);router[_0xafb7('0x7')]('/describe',auth[_0xafb7('0x8')](),controller['describe']);router[_0xafb7('0x7')](_0xafb7('0xa'),auth['isAuthenticated'](),controller[_0xafb7('0xb')]);router[_0xafb7('0x7')](_0xafb7('0xc'),auth[_0xafb7('0x8')](),controller[_0xafb7('0xd')]);router[_0xafb7('0x7')]('/:id/teams',auth[_0xafb7('0x8')](),controller[_0xafb7('0xe')]);router['get'](_0xafb7('0xf'),auth[_0xafb7('0x8')](),controller[_0xafb7('0x10')]);router[_0xafb7('0x11')]('/',auth[_0xafb7('0x8')](),controller[_0xafb7('0x12')]);router[_0xafb7('0x11')]('/:id/teams',auth[_0xafb7('0x8')](),controller[_0xafb7('0x13')]);router[_0xafb7('0x11')](_0xafb7('0xf'),auth[_0xafb7('0x8')](),controller['addAgents']);router[_0xafb7('0x14')]('/:id',auth[_0xafb7('0x8')](),controller['update']);router[_0xafb7('0x15')](_0xafb7('0xa'),auth[_0xafb7('0x8')](),controller[_0xafb7('0x16')]);router['delete'](_0xafb7('0x17'),auth[_0xafb7('0x8')](),controller[_0xafb7('0x18')]);router[_0xafb7('0x15')](_0xafb7('0xf'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xafb7('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 98ecc7c..b4ab25a 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 _0x4b4a=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','exports','STRING'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x4b4a,0xd6));var _0xa4b4=function(_0x799123,_0x4e7fbc){_0x799123=_0x799123-0x0;var _0x46d7bc=_0x4b4a[_0x799123];return _0x46d7bc;};'use strict';var Sequelize=require('sequelize');module[_0xa4b4('0x0')]={'name':{'type':Sequelize[_0xa4b4('0x1')],'unique':_0xa4b4('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xa4b4('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa4b4('0x4')](_0xa4b4('0x5'),_0xa4b4('0x6'),_0xa4b4('0x7'))}}; \ No newline at end of file +var _0x842c=['name','INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports'];(function(_0x457bf8,_0x209a0a){var _0x919f94=function(_0x4fc50c){while(--_0x4fc50c){_0x457bf8['push'](_0x457bf8['shift']());}};_0x919f94(++_0x209a0a);}(_0x842c,0x6e));var _0xc842=function(_0x394b7c,_0x592b20){_0x394b7c=_0x394b7c-0x0;var _0x32ce67=_0x842c[_0x394b7c];return _0x32ce67;};'use strict';var Sequelize=require(_0xc842('0x0'));module[_0xc842('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc842('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xc842('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc842('0x4')](_0xc842('0x5'),'beepall',_0xc842('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 510a135..cee4852 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 _0xf323=['describe','findOne','UserMailQueue','MailQueueId','User','UserId','agent','mailPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','findOrCreate','forEach','userMailQueue:save','removeTeams','select','field','tq.TeamId','join','user_has_teams','MailQueueId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','includes','all','union','compact','transaction','removeAgents','emit','userMailQueue:remove','addAgents','omit','isArray','getAgents','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','UserProfileResource','error','name','send','map','MailQueue','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0xdb45f5,_0x145dc1){var _0x14e689=function(_0x15d9e8){while(--_0x15d9e8){_0xdb45f5['push'](_0xdb45f5['shift']());}};_0x14e689(++_0x145dc1);}(_0xf323,0x1c6));var _0x3f32=function(_0x5553e5,_0xe75f20){_0x5553e5=_0x5553e5-0x0;var _0x57c848=_0xf323[_0x5553e5];return _0x57c848;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3f32('0x0'));var jsonpatch=require(_0x3f32('0x1'));var rp=require('request-promise');var moment=require(_0x3f32('0x2'));var BPromise=require(_0x3f32('0x3'));var Mustache=require(_0x3f32('0x4'));var util=require(_0x3f32('0x5'));var path=require(_0x3f32('0x6'));var sox=require('sox');var csv=require(_0x3f32('0x7'));var ejs=require(_0x3f32('0x8'));var fs=require('fs');var fs_extra=require(_0x3f32('0x9'));var _=require(_0x3f32('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3f32('0xb'));var deskjs=require(_0x3f32('0xc'));var toCsv=require(_0x3f32('0x7'));var querystring=require(_0x3f32('0xd'));var Papa=require(_0x3f32('0xe'));var Redis=require(_0x3f32('0xf'));var authService=require(_0x3f32('0x10'));var qs=require(_0x3f32('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3f32('0x12'));var logger=require(_0x3f32('0x13'))(_0x3f32('0x14'));var utils=require('../../config/utils');var config=require(_0x3f32('0x15'));var licenseUtil=require(_0x3f32('0x16'));var db=require(_0x3f32('0x17'))['db'];config[_0x3f32('0x18')]=_['defaults'](config['redis'],{'host':_0x3f32('0x19'),'port':0x18eb});var socket=require(_0x3f32('0x1a'))(new Redis(config['redis']));require(_0x3f32('0x1b'))[_0x3f32('0x1c')](socket);function respondWithStatusCode(_0xc68dd5,_0x5d230e){_0x5d230e=_0x5d230e||0xcc;return function(_0x5e176c){if(_0x5e176c){return _0xc68dd5[_0x3f32('0x1d')](_0x5d230e);}return _0xc68dd5[_0x3f32('0x1e')](_0x5d230e)[_0x3f32('0x1f')]();};}function respondWithResult(_0x219d91,_0x54eb23){_0x54eb23=_0x54eb23||0xc8;return function(_0x56a802){if(_0x56a802){return _0x219d91[_0x3f32('0x1e')](_0x54eb23)[_0x3f32('0x20')](_0x56a802);}};}function respondWithFilteredResult(_0x3a8e7b,_0x510f9c){return function(_0x5c36d9){if(_0x5c36d9){var _0x1697c9=typeof _0x510f9c[_0x3f32('0x21')]===_0x3f32('0x22')&&typeof _0x510f9c[_0x3f32('0x23')]===_0x3f32('0x22');var _0x517e49=_0x5c36d9[_0x3f32('0x24')];var _0x43cf6a=_0x1697c9?0x0:_0x510f9c[_0x3f32('0x21')];var _0x3a92a7=_0x1697c9?_0x5c36d9[_0x3f32('0x24')]:_0x510f9c[_0x3f32('0x21')]+_0x510f9c['limit'];var _0x1e2d85;if(_0x3a92a7>=_0x517e49){_0x3a92a7=_0x517e49;_0x1e2d85=0xc8;}else{_0x1e2d85=0xce;}_0x3a8e7b[_0x3f32('0x1e')](_0x1e2d85);return _0x3a8e7b['set'](_0x3f32('0x25'),_0x43cf6a+'-'+_0x3a92a7+'/'+_0x517e49)[_0x3f32('0x20')](_0x5c36d9);}return null;};}function patchUpdates(_0x3ddf25){return function(_0x3d17b0){try{jsonpatch['apply'](_0x3d17b0,_0x3ddf25,!![]);}catch(_0x1ea58b){return BPromise[_0x3f32('0x26')](_0x1ea58b);}return _0x3d17b0['save']();};}function saveUpdates(_0x416015,_0x12db83){return function(_0x16fa4d){if(_0x16fa4d){return _0x16fa4d[_0x3f32('0x27')](_0x416015)[_0x3f32('0x28')](function(_0x11f4ab){return _0x11f4ab;});}return null;};}function removeEntity(_0x28bff4,_0x38de66){return function(_0x3066bb){if(_0x3066bb){return _0x3066bb[_0x3f32('0x29')]()[_0x3f32('0x28')](function(){var _0x5b5e9d=_0x3066bb[_0x3f32('0x2a')]({'plain':!![]});var _0x353137='MailQueues';return db[_0x3f32('0x2b')]['destroy']({'where':{'type':_0x353137,'resourceId':_0x5b5e9d['id']}})['then'](function(){return _0x3066bb;});})[_0x3f32('0x28')](function(){_0x28bff4[_0x3f32('0x1e')](0xcc)[_0x3f32('0x1f')]();});}};}function handleEntityNotFound(_0x320972,_0x20b333){return function(_0x36623c){if(!_0x36623c){_0x320972[_0x3f32('0x1d')](0x194);}return _0x36623c;};}function handleError(_0x2dcace,_0x6920a0){_0x6920a0=_0x6920a0||0x1f4;return function(_0x256e73){logger[_0x3f32('0x2c')](_0x256e73['stack']);if(_0x256e73[_0x3f32('0x2d')]){delete _0x256e73[_0x3f32('0x2d')];}_0x2dcace[_0x3f32('0x1e')](_0x6920a0)[_0x3f32('0x2e')](_0x256e73);};}exports['index']=function(_0x5ba4ef,_0x4fd7e2){var _0x173b92={},_0x1eb0eb={},_0x408ed7={'count':0x0,'rows':[]};var _0x43fe5b=_[_0x3f32('0x2f')](db[_0x3f32('0x30')][_0x3f32('0x31')],function(_0x118935){return{'name':_0x118935[_0x3f32('0x32')],'type':_0x118935['type'][_0x3f32('0x33')]};});_0x1eb0eb[_0x3f32('0x34')]=_['map'](_0x43fe5b,'name');_0x1eb0eb[_0x3f32('0x35')]=_[_0x3f32('0x36')](_0x5ba4ef[_0x3f32('0x35')]);_0x1eb0eb['filters']=_['intersection'](_0x1eb0eb[_0x3f32('0x34')],_0x1eb0eb[_0x3f32('0x35')]);_0x173b92[_0x3f32('0x37')]=_[_0x3f32('0x38')](_0x1eb0eb['model'],qs[_0x3f32('0x39')](_0x5ba4ef['query'][_0x3f32('0x39')]));_0x173b92[_0x3f32('0x37')]=_0x173b92['attributes'][_0x3f32('0x3a')]?_0x173b92[_0x3f32('0x37')]:_0x1eb0eb[_0x3f32('0x34')];if(!_0x5ba4ef[_0x3f32('0x35')][_0x3f32('0x3b')](_0x3f32('0x3c'))){_0x173b92[_0x3f32('0x23')]=qs[_0x3f32('0x23')](_0x5ba4ef['query']['limit']);_0x173b92[_0x3f32('0x21')]=qs[_0x3f32('0x21')](_0x5ba4ef[_0x3f32('0x35')][_0x3f32('0x21')]);}_0x173b92[_0x3f32('0x3d')]=qs[_0x3f32('0x3e')](_0x5ba4ef[_0x3f32('0x35')][_0x3f32('0x3e')]);_0x173b92[_0x3f32('0x3f')]=qs['filters'](_[_0x3f32('0x40')](_0x5ba4ef[_0x3f32('0x35')],_0x1eb0eb[_0x3f32('0x41')]),_0x43fe5b);if(_0x5ba4ef['query'][_0x3f32('0x42')]){_0x173b92[_0x3f32('0x3f')]=_['merge'](_0x173b92[_0x3f32('0x3f')],{'$or':_[_0x3f32('0x2f')](_0x43fe5b,function(_0xf600f1){if(_0xf600f1[_0x3f32('0x43')]!==_0x3f32('0x44')){var _0x2caa38={};_0x2caa38[_0xf600f1[_0x3f32('0x2d')]]={'$like':'%'+_0x5ba4ef['query']['filter']+'%'};return _0x2caa38;}})});}_0x173b92=_[_0x3f32('0x45')]({},_0x173b92,_0x5ba4ef[_0x3f32('0x46')]);var _0x5c23b0={'where':_0x173b92[_0x3f32('0x3f')]};return db[_0x3f32('0x30')][_0x3f32('0x24')](_0x5c23b0)[_0x3f32('0x28')](function(_0x21a803){_0x408ed7[_0x3f32('0x24')]=_0x21a803;if(_0x5ba4ef[_0x3f32('0x35')]['includeAll']){_0x173b92[_0x3f32('0x47')]=[{'all':!![]}];}return db[_0x3f32('0x30')][_0x3f32('0x48')](_0x173b92);})[_0x3f32('0x28')](function(_0xb9a757){_0x408ed7[_0x3f32('0x49')]=_0xb9a757;return _0x408ed7;})[_0x3f32('0x28')](respondWithFilteredResult(_0x4fd7e2,_0x173b92))[_0x3f32('0x4a')](handleError(_0x4fd7e2,null));};exports[_0x3f32('0x4b')]=function(_0x50faa4,_0x27a2e3){var _0x101222={'raw':!![],'where':{'id':_0x50faa4[_0x3f32('0x4c')]['id']}},_0xc852a1={};_0xc852a1[_0x3f32('0x34')]=_['keys'](db['MailQueue'][_0x3f32('0x31')]);_0xc852a1[_0x3f32('0x35')]=_[_0x3f32('0x36')](_0x50faa4['query']);_0xc852a1[_0x3f32('0x41')]=_['intersection'](_0xc852a1[_0x3f32('0x34')],_0xc852a1[_0x3f32('0x35')]);_0x101222[_0x3f32('0x37')]=_[_0x3f32('0x38')](_0xc852a1[_0x3f32('0x34')],qs['fields'](_0x50faa4[_0x3f32('0x35')][_0x3f32('0x39')]));_0x101222[_0x3f32('0x37')]=_0x101222['attributes']['length']?_0x101222[_0x3f32('0x37')]:_0xc852a1['model'];if(_0x50faa4[_0x3f32('0x35')][_0x3f32('0x4d')]){_0x101222[_0x3f32('0x47')]=[{'all':!![]}];}_0x101222=_[_0x3f32('0x45')]({},_0x101222,_0x50faa4[_0x3f32('0x46')]);return db['MailQueue'][_0x3f32('0x4e')](_0x101222)[_0x3f32('0x28')](handleEntityNotFound(_0x27a2e3,null))[_0x3f32('0x28')](respondWithResult(_0x27a2e3,null))[_0x3f32('0x4a')](handleError(_0x27a2e3,null));};exports[_0x3f32('0x4f')]=function(_0x51bb3b,_0x310b15){return db[_0x3f32('0x30')]['create'](_0x51bb3b[_0x3f32('0x50')],{})[_0x3f32('0x28')](function(_0x2c6160){var _0x1a5568=_0x51bb3b['user'][_0x3f32('0x2a')]({'plain':!![]});if(!_0x1a5568)throw new Error(_0x3f32('0x51'));if(_0x1a5568[_0x3f32('0x52')]===_0x3f32('0x53')){var _0x1b7cdc=_0x2c6160[_0x3f32('0x2a')]({'plain':!![]});var _0x9f14d8='MailQueues';return db['UserProfileSection'][_0x3f32('0x4e')]({'where':{'name':_0x9f14d8,'userProfileId':_0x1a5568[_0x3f32('0x54')]},'raw':!![]})['then'](function(_0x28bb41){if(_0x28bb41&&_0x28bb41['autoAssociation']===0x0){return db[_0x3f32('0x2b')][_0x3f32('0x4f')]({'name':_0x1b7cdc[_0x3f32('0x2d')],'resourceId':_0x1b7cdc['id'],'type':_0x28bb41[_0x3f32('0x2d')],'sectionId':_0x28bb41['id']},{})[_0x3f32('0x28')](function(){return _0x2c6160;});}else{return _0x2c6160;}})[_0x3f32('0x4a')](function(_0x2e767c){logger['error'](_0x3f32('0x55'),_0x2e767c);throw _0x2e767c;});}return _0x2c6160;})[_0x3f32('0x28')](respondWithResult(_0x310b15,0xc9))[_0x3f32('0x4a')](handleError(_0x310b15,null));};exports[_0x3f32('0x27')]=function(_0xc73fea,_0x1e988a){if(_0xc73fea['body']['id']){delete _0xc73fea[_0x3f32('0x50')]['id'];}return db[_0x3f32('0x30')][_0x3f32('0x4e')]({'where':{'id':_0xc73fea['params']['id']}})[_0x3f32('0x28')](handleEntityNotFound(_0x1e988a,null))[_0x3f32('0x28')](saveUpdates(_0xc73fea[_0x3f32('0x50')],null))[_0x3f32('0x28')](respondWithResult(_0x1e988a,null))[_0x3f32('0x4a')](handleError(_0x1e988a,null));};exports['destroy']=function(_0x47f420,_0x1ebb4a){return db[_0x3f32('0x30')][_0x3f32('0x4e')]({'where':{'id':_0x47f420['params']['id']}})[_0x3f32('0x28')](handleEntityNotFound(_0x1ebb4a,null))[_0x3f32('0x28')](removeEntity(_0x1ebb4a,null))[_0x3f32('0x4a')](handleError(_0x1ebb4a,null));};exports[_0x3f32('0x56')]=function(_0x147756,_0x532f9b){return db[_0x3f32('0x30')][_0x3f32('0x56')]()[_0x3f32('0x28')](respondWithResult(_0x532f9b,null))['catch'](handleError(_0x532f9b,null));};exports['getMembers']=function(_0x3fc162,_0x5dfd74,_0x56bc7f){var _0x43ebf0={'raw':!![],'where':{}},_0x1aed02={},_0xe0429b;return db[_0x3f32('0x30')][_0x3f32('0x57')]({'where':{'id':_0x3fc162['params']['id']}})['then'](handleEntityNotFound(_0x5dfd74,null))['then'](function(_0x447a13){if(_0x447a13){_0xe0429b=_0x447a13[_0x3f32('0x2a')]({'plain':!![]});_0x1aed02['model']=_[_0x3f32('0x36')](db[_0x3f32('0x58')][_0x3f32('0x31')]);_0x1aed02[_0x3f32('0x35')]=_['keys'](_0x3fc162[_0x3f32('0x35')]);_0x1aed02[_0x3f32('0x41')]=_[_0x3f32('0x38')](_0x1aed02[_0x3f32('0x34')],_0x1aed02[_0x3f32('0x35')]);_0x43ebf0['attributes']=_['intersection'](_0x1aed02[_0x3f32('0x34')],qs[_0x3f32('0x39')](_0x3fc162[_0x3f32('0x35')]['fields']));_0x43ebf0[_0x3f32('0x37')]=_0x43ebf0['attributes']['length']?_0x43ebf0[_0x3f32('0x37')]:_0x1aed02[_0x3f32('0x34')];if(!_0x3fc162[_0x3f32('0x35')][_0x3f32('0x3b')](_0x3f32('0x3c'))){_0x43ebf0[_0x3f32('0x23')]=qs[_0x3f32('0x23')](_0x3fc162[_0x3f32('0x35')][_0x3f32('0x23')]);_0x43ebf0['offset']=qs[_0x3f32('0x21')](_0x3fc162[_0x3f32('0x35')]['offset']);}_0x43ebf0[_0x3f32('0x3d')]=qs['sort'](_0x3fc162[_0x3f32('0x35')]['sort']);_0x43ebf0[_0x3f32('0x3f')]=qs[_0x3f32('0x41')](_[_0x3f32('0x40')](_0x3fc162[_0x3f32('0x35')],_0x1aed02[_0x3f32('0x41')]));_0x43ebf0['where'][_0x3f32('0x59')]=_0x447a13['id'];if(_0x3fc162[_0x3f32('0x35')][_0x3f32('0x42')]){_0x43ebf0[_0x3f32('0x3f')]=_['merge'](_0x43ebf0[_0x3f32('0x3f')],{'$or':_[_0x3f32('0x2f')](_0x43ebf0[_0x3f32('0x37')],function(_0x374b87){var _0x354415={};_0x354415[_0x374b87]={'$like':'%'+_0x3fc162[_0x3f32('0x35')]['filter']+'%'};return _0x354415;})});}_0x43ebf0=_[_0x3f32('0x45')]({},_0x43ebf0,_0x3fc162['options']);return db[_0x3f32('0x58')]['findAll'](_0x43ebf0);}})[_0x3f32('0x28')](function(_0x2bd371){if(_0x2bd371){return db[_0x3f32('0x5a')]['findAndCountAll']({'where':{'id':_[_0x3f32('0x2f')](_0x2bd371,_0x3f32('0x5b')),'role':_0x3f32('0x5c')},'attributes':['id','name',_0x3f32('0x5d'),'updatedAt',_0x3f32('0x5e')]});}})[_0x3f32('0x28')](function(_0x23b51a){if(_0x23b51a){return{'count':_0x23b51a[_0x3f32('0x24')],'rows':_[_0x3f32('0x2f')](_0x23b51a[_0x3f32('0x49')],function(_0x4517dd){return{'membername':_0x4517dd[_0x3f32('0x2d')],'UserId':_0x4517dd['id'],'queue_name':_0xe0429b[_0x3f32('0x2d')],'MailQueueId':_0xe0429b['id'],'interface':util[_0x3f32('0x5f')](_0x3f32('0x60'),_0x3f32('0x61'),_0x4517dd[_0x3f32('0x2d')]),'penalty':0x0,'paused':_0x4517dd[_0x3f32('0x5d')],'createdAt':_0x4517dd['createdAt'],'updatedAt':_0x4517dd[_0x3f32('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3f32('0x28')](respondWithFilteredResult(_0x5dfd74,_0x43ebf0))['catch'](handleError(_0x5dfd74,null));};exports[_0x3f32('0x63')]=function(_0x52fc2a,_0x133e7f,_0x364c3a){var _0xeb6cfe={};var _0x2fa22f={};var _0x151d90;var _0x4fb686;return db[_0x3f32('0x30')][_0x3f32('0x57')]({'where':{'id':_0x52fc2a['params']['id']}})[_0x3f32('0x28')](handleEntityNotFound(_0x133e7f,null))['then'](function(_0x2973d6){if(_0x2973d6){_0x151d90=_0x2973d6;_0x2fa22f[_0x3f32('0x34')]=_[_0x3f32('0x36')](db['Team']['rawAttributes']);_0x2fa22f[_0x3f32('0x35')]=_[_0x3f32('0x36')](_0x52fc2a[_0x3f32('0x35')]);_0x2fa22f[_0x3f32('0x41')]=_[_0x3f32('0x38')](_0x2fa22f[_0x3f32('0x34')],_0x2fa22f[_0x3f32('0x35')]);_0xeb6cfe[_0x3f32('0x37')]=_[_0x3f32('0x38')](_0x2fa22f[_0x3f32('0x34')],qs[_0x3f32('0x39')](_0x52fc2a['query'][_0x3f32('0x39')]));_0xeb6cfe[_0x3f32('0x37')]=_0xeb6cfe[_0x3f32('0x37')][_0x3f32('0x3a')]?_0xeb6cfe['attributes']:_0x2fa22f[_0x3f32('0x34')];_0xeb6cfe[_0x3f32('0x3d')]=qs[_0x3f32('0x3e')](_0x52fc2a[_0x3f32('0x35')][_0x3f32('0x3e')]);_0xeb6cfe[_0x3f32('0x3f')]=qs[_0x3f32('0x41')](_[_0x3f32('0x40')](_0x52fc2a[_0x3f32('0x35')],_0x2fa22f[_0x3f32('0x41')]));if(_0x52fc2a[_0x3f32('0x35')][_0x3f32('0x42')]){_0xeb6cfe[_0x3f32('0x3f')]=_[_0x3f32('0x45')](_0xeb6cfe['where'],{'$or':_['map'](_0xeb6cfe[_0x3f32('0x37')],function(_0x3a1a39){var _0x1a3ba6={};_0x1a3ba6[_0x3a1a39]={'$like':'%'+_0x52fc2a[_0x3f32('0x35')]['filter']+'%'};return _0x1a3ba6;})});}_0xeb6cfe=_[_0x3f32('0x45')]({},_0xeb6cfe,_0x52fc2a[_0x3f32('0x46')]);return _0x151d90[_0x3f32('0x63')](_0xeb6cfe);}})[_0x3f32('0x28')](function(_0x3e5c6f){if(_0x3e5c6f){_0x4fb686=_0x3e5c6f['length'];if(!_0x52fc2a[_0x3f32('0x35')][_0x3f32('0x3b')](_0x3f32('0x3c'))){_0xeb6cfe[_0x3f32('0x23')]=qs['limit'](_0x52fc2a[_0x3f32('0x35')][_0x3f32('0x23')]);_0xeb6cfe['offset']=qs[_0x3f32('0x21')](_0x52fc2a['query']['offset']);}return _0x151d90[_0x3f32('0x63')](_0xeb6cfe);}})[_0x3f32('0x28')](function(_0x464931){if(_0x464931){return _0x464931?{'count':_0x4fb686,'rows':_0x464931}:null;}})[_0x3f32('0x28')](respondWithResult(_0x133e7f,null))[_0x3f32('0x4a')](handleError(_0x133e7f,null));};exports[_0x3f32('0x64')]=function(_0x18ba4d,_0x36d197,_0x5b1d9b){var _0x420fbd=_0x18ba4d[_0x3f32('0x50')][_0x3f32('0x65')];return db[_0x3f32('0x66')][_0x3f32('0x48')]({'where':{'id':_0x420fbd},'attributes':['id'],'include':[{'model':db[_0x3f32('0x5a')],'as':_0x3f32('0x67'),'attributes':['id','name',_0x3f32('0x68'),_0x3f32('0x69'),_0x3f32('0x6a')],'raw':!![]}]})[_0x3f32('0x28')](function(_0x1fdcbf){if(_0x1fdcbf){var _0x273667=_['flatMap'](_0x1fdcbf,function(_0x408358){var _0x53c87c=_0x408358['get']({'plain':!![]});return _0x53c87c[_0x3f32('0x67')];});return db['MailQueue'][_0x3f32('0x4e')]({'where':{'id':_0x18ba4d[_0x3f32('0x4c')]['id']}})[_0x3f32('0x28')](function(_0x3e05fb){return db['sequelize']['transaction'](function(_0x230c28){return _0x3e05fb[_0x3f32('0x64')](_0x420fbd,{'transaction':_0x230c28})[_0x3f32('0x28')](function(){return BPromise['each'](_0x273667,function(_0x2730ea){return db[_0x3f32('0x58')][_0x3f32('0x6b')]({'where':{'UserId':_0x2730ea['id'],'MailQueueId':_0x18ba4d[_0x3f32('0x4c')]['id']},'transaction':_0x230c28});});})[_0x3f32('0x28')](function(){_0x273667[_0x3f32('0x6c')](function(_0x3220ce){socket['emit'](_0x3f32('0x6d'),{'UserId':_0x3220ce['id'],'MailQueueId':_0x3e05fb['id']});});});});});}})[_0x3f32('0x28')](respondWithStatusCode(_0x36d197,null))['catch'](handleError(_0x36d197,null));};exports[_0x3f32('0x6e')]=function(_0x3ed5d9,_0x2691f3,_0x402eea){return db['Team'][_0x3f32('0x48')]({'where':{'id':_0x3ed5d9[_0x3f32('0x35')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x3f32('0x28')](handleEntityNotFound(_0x2691f3,null))[_0x3f32('0x28')](function(_0x149c19){var _0x5ac898=_['map'](_0x149c19,'id');var _0x224e67=[];var _0x4b6047=[];var _0x2bbbb2=squel[_0x3f32('0x6f')]();_0x2bbbb2[_0x3f32('0x70')](_0x3f32('0x71'))['from']('team_has_mail_queues','tq')[_0x3f32('0x72')](_0x3f32('0x73'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3f32('0x3f')](_0x3f32('0x74'),_0x3ed5d9[_0x3f32('0x4c')]['id']);for(var _0x494b01=0x0;_0x494b01<_0x149c19['length'];_0x494b01+=0x1){let _0x2bdcf7=_0x149c19[_0x494b01];for(var _0x1cd4b4=0x0;_0x1cd4b4<_0x2bdcf7[_0x3f32('0x67')][_0x3f32('0x3a')];_0x1cd4b4+=0x1){let _0x25e533=_0x2bdcf7[_0x3f32('0x67')][_0x1cd4b4];var _0x53169e=_0x2bbbb2['clone']();_0x53169e['where']('ut.UserId\x20=\x20?',_0x25e533['id']);_0x4b6047[_0x3f32('0x75')](db['sequelize'][_0x3f32('0x35')](_0x53169e[_0x3f32('0x76')](),{'type':db[_0x3f32('0x77')][_0x3f32('0x78')][_0x3f32('0x79')]})[_0x3f32('0x28')](function(_0x2e2714){if(_0x2e2714[_0x3f32('0x3a')]===0x1){return _0x25e533['id'];}else{var _0x567a02=_[_0x3f32('0x7a')](_[_0x3f32('0x2f')](_0x2e2714,'TeamId'),function(_0x4065d3){return _[_0x3f32('0x7b')](_0x5ac898,_0x4065d3);});if(_0x567a02){return _0x25e533['id'];}}}));}}return BPromise[_0x3f32('0x7c')](_0x4b6047)[_0x3f32('0x28')](function(_0x1e6443){_0x224e67=_(_0x224e67)[_0x3f32('0x7d')](_0x1e6443)[_0x3f32('0x7e')]()['value']();return db[_0x3f32('0x30')]['find']({'where':{'id':_0x3ed5d9[_0x3f32('0x4c')]['id']}})[_0x3f32('0x28')](function(_0x5ab0d4){return db[_0x3f32('0x77')][_0x3f32('0x7f')](function(_0x218a46){return _0x5ab0d4[_0x3f32('0x6e')](_0x3ed5d9['query'][_0x3f32('0x65')],{'transaction':_0x218a46})[_0x3f32('0x28')](function(){if(!_['isEmpty'](_0x224e67)){return _0x5ab0d4[_0x3f32('0x80')](_0x224e67,{'transaction':_0x218a46});}})[_0x3f32('0x28')](function(){_0x224e67[_0x3f32('0x6c')](function(_0xc64e6a){socket[_0x3f32('0x81')](_0x3f32('0x82'),{'UserId':_0xc64e6a,'MailQueueId':_0x5ab0d4['id']});});});});});});})[_0x3f32('0x28')](respondWithStatusCode(_0x2691f3,null))[_0x3f32('0x4a')](handleError(_0x2691f3,null));};exports[_0x3f32('0x83')]=function(_0x4bb1c9,_0x2689f9,_0x54d14a){return db[_0x3f32('0x30')]['find']({'where':{'id':_0x4bb1c9[_0x3f32('0x4c')]['id']}})[_0x3f32('0x28')](handleEntityNotFound(_0x2689f9,null))[_0x3f32('0x28')](function(_0x1fc406){if(_0x1fc406){return _0x1fc406[_0x3f32('0x83')](_0x4bb1c9[_0x3f32('0x50')]['ids'],_[_0x3f32('0x84')](_0x4bb1c9[_0x3f32('0x50')],[_0x3f32('0x65'),'id'])||{})['spread'](function(_0x21583c){for(var _0x3d0f1b=0x0;_0x3d0f1b<_0x4bb1c9[_0x3f32('0x50')]['ids'][_0x3f32('0x3a')];_0x3d0f1b+=0x1){socket[_0x3f32('0x81')]('userMailQueue:save',{'UserId':Number(_0x4bb1c9[_0x3f32('0x50')]['ids'][_0x3d0f1b]),'MailQueueId':Number(_0x4bb1c9[_0x3f32('0x4c')]['id'])});}return _0x21583c;});}})['then'](respondWithResult(_0x2689f9,null))[_0x3f32('0x4a')](handleError(_0x2689f9,null));};exports[_0x3f32('0x80')]=function(_0x1ab582,_0x2158ff,_0x27db98){return db[_0x3f32('0x30')][_0x3f32('0x4e')]({'where':{'id':_0x1ab582[_0x3f32('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2158ff,null))[_0x3f32('0x28')](function(_0x2f7f56){if(_0x2f7f56){return _0x2f7f56[_0x3f32('0x80')](_0x1ab582[_0x3f32('0x35')][_0x3f32('0x65')])[_0x3f32('0x28')](function(){if(_[_0x3f32('0x85')](_0x1ab582['query'][_0x3f32('0x65')])){for(var _0x291b1e=0x0;_0x291b1e<_0x1ab582['query']['ids'][_0x3f32('0x3a')];_0x291b1e+=0x1){socket[_0x3f32('0x81')](_0x3f32('0x82'),{'UserId':Number(_0x1ab582[_0x3f32('0x35')]['ids'][_0x291b1e]),'MailQueueId':Number(_0x1ab582[_0x3f32('0x4c')]['id'])});}}else{socket[_0x3f32('0x81')](_0x3f32('0x82'),{'UserId':Number(_0x1ab582[_0x3f32('0x35')][_0x3f32('0x65')]),'MailQueueId':Number(_0x1ab582[_0x3f32('0x4c')]['id'])});}});}})[_0x3f32('0x28')](respondWithStatusCode(_0x2158ff,null))['catch'](handleError(_0x2158ff,null));};exports[_0x3f32('0x86')]=function(_0x1f8fce,_0x1b9b63,_0x471580){var _0x33cfd4={};var _0x19a4b2={};var _0x41dcf8;var _0x1b186e;return db[_0x3f32('0x30')][_0x3f32('0x57')]({'where':{'id':_0x1f8fce['params']['id']}})[_0x3f32('0x28')](handleEntityNotFound(_0x1b9b63,null))[_0x3f32('0x28')](function(_0x308d32){if(_0x308d32){_0x41dcf8=_0x308d32;_0x19a4b2[_0x3f32('0x34')]=_[_0x3f32('0x36')](db[_0x3f32('0x5a')][_0x3f32('0x31')]);_0x19a4b2[_0x3f32('0x35')]=_[_0x3f32('0x36')](_0x1f8fce[_0x3f32('0x35')]);_0x19a4b2[_0x3f32('0x41')]=_[_0x3f32('0x38')](_0x19a4b2[_0x3f32('0x34')],_0x19a4b2[_0x3f32('0x35')]);_0x33cfd4[_0x3f32('0x37')]=_[_0x3f32('0x38')](_0x19a4b2[_0x3f32('0x34')],qs[_0x3f32('0x39')](_0x1f8fce[_0x3f32('0x35')][_0x3f32('0x39')]));_0x33cfd4[_0x3f32('0x37')]=_0x33cfd4[_0x3f32('0x37')][_0x3f32('0x3a')]?_0x33cfd4[_0x3f32('0x37')]:_0x19a4b2[_0x3f32('0x34')];_0x33cfd4[_0x3f32('0x3d')]=qs[_0x3f32('0x3e')](_0x1f8fce[_0x3f32('0x35')][_0x3f32('0x3e')]);_0x33cfd4[_0x3f32('0x3f')]=qs[_0x3f32('0x41')](_['pick'](_0x1f8fce[_0x3f32('0x35')],_0x19a4b2[_0x3f32('0x41')]));if(_0x1f8fce[_0x3f32('0x35')][_0x3f32('0x42')]){_0x33cfd4[_0x3f32('0x3f')]=_['merge'](_0x33cfd4['where'],{'$or':_['map'](_0x33cfd4[_0x3f32('0x37')],function(_0x100312){var _0x393e79={};_0x393e79[_0x100312]={'$like':'%'+_0x1f8fce[_0x3f32('0x35')][_0x3f32('0x42')]+'%'};return _0x393e79;})});}_0x33cfd4=_[_0x3f32('0x45')]({},_0x33cfd4,_0x1f8fce[_0x3f32('0x46')]);return _0x41dcf8['getAgents'](_0x33cfd4);}})[_0x3f32('0x28')](function(_0x359605){if(_0x359605){_0x1b186e=_0x359605[_0x3f32('0x3a')];if(!_0x1f8fce[_0x3f32('0x35')][_0x3f32('0x3b')](_0x3f32('0x3c'))){_0x33cfd4[_0x3f32('0x23')]=qs['limit'](_0x1f8fce[_0x3f32('0x35')][_0x3f32('0x23')]);_0x33cfd4[_0x3f32('0x21')]=qs['offset'](_0x1f8fce[_0x3f32('0x35')][_0x3f32('0x21')]);}return _0x41dcf8[_0x3f32('0x86')](_0x33cfd4);}})[_0x3f32('0x28')](function(_0x5c6830){if(_0x5c6830){return _0x5c6830?{'count':_0x1b186e,'rows':_0x5c6830}:null;}})['then'](respondWithResult(_0x1b9b63,null))[_0x3f32('0x4a')](handleError(_0x1b9b63,null));}; \ No newline at end of file +var _0xae53=['count','set','Content-Range','apply','reject','save','update','then','destroy','get','MailQueues','error','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','MailQueue','rows','catch','show','params','keys','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','body','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','removeTeams','findAll','ids','select','tq.TeamId','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x3f987d,_0x209b84){var _0x925a65=function(_0x5277ca){while(--_0x5277ca){_0x3f987d['push'](_0x3f987d['shift']());}};_0x925a65(++_0x209b84);}(_0xae53,0xf7));var _0x3ae5=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xae53[_0x36884e];return _0x1cc367;};'use strict';var emlformat=require(_0x3ae5('0x0'));var rimraf=require(_0x3ae5('0x1'));var zipdir=require(_0x3ae5('0x2'));var jsonpatch=require(_0x3ae5('0x3'));var rp=require('request-promise');var moment=require(_0x3ae5('0x4'));var BPromise=require(_0x3ae5('0x5'));var Mustache=require(_0x3ae5('0x6'));var util=require(_0x3ae5('0x7'));var path=require(_0x3ae5('0x8'));var sox=require(_0x3ae5('0x9'));var csv=require('to-csv');var ejs=require(_0x3ae5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3ae5('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3ae5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3ae5('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3ae5('0xe'));var authService=require(_0x3ae5('0xf'));var qs=require(_0x3ae5('0x10'));var as=require(_0x3ae5('0x11'));var hardwareService=require(_0x3ae5('0x12'));var logger=require(_0x3ae5('0x13'))('api');var utils=require(_0x3ae5('0x14'));var config=require(_0x3ae5('0x15'));var licenseUtil=require(_0x3ae5('0x16'));var db=require(_0x3ae5('0x17'))['db'];config[_0x3ae5('0x18')]=_[_0x3ae5('0x19')](config[_0x3ae5('0x18')],{'host':_0x3ae5('0x1a'),'port':0x18eb});var socket=require(_0x3ae5('0x1b'))(new Redis(config[_0x3ae5('0x18')]));require(_0x3ae5('0x1c'))[_0x3ae5('0x1d')](socket);function respondWithStatusCode(_0x1fc10,_0x576584){_0x576584=_0x576584||0xcc;return function(_0x2fc658){if(_0x2fc658){return _0x1fc10[_0x3ae5('0x1e')](_0x576584);}return _0x1fc10[_0x3ae5('0x1f')](_0x576584)[_0x3ae5('0x20')]();};}function respondWithResult(_0x1f664f,_0x126bd0){_0x126bd0=_0x126bd0||0xc8;return function(_0xd62f7e){if(_0xd62f7e){return _0x1f664f[_0x3ae5('0x1f')](_0x126bd0)[_0x3ae5('0x21')](_0xd62f7e);}};}function respondWithFilteredResult(_0x1ef4b8,_0x145157){return function(_0x5c8e26){if(_0x5c8e26){var _0x171f48=typeof _0x145157[_0x3ae5('0x22')]===_0x3ae5('0x23')&&typeof _0x145157[_0x3ae5('0x24')]===_0x3ae5('0x23');var _0x3afcff=_0x5c8e26[_0x3ae5('0x25')];var _0xe2e61a=_0x171f48?0x0:_0x145157[_0x3ae5('0x22')];var _0x11ea7d=_0x171f48?_0x5c8e26['count']:_0x145157[_0x3ae5('0x22')]+_0x145157[_0x3ae5('0x24')];var _0x2eb57a;if(_0x11ea7d>=_0x3afcff){_0x11ea7d=_0x3afcff;_0x2eb57a=0xc8;}else{_0x2eb57a=0xce;}_0x1ef4b8['status'](_0x2eb57a);return _0x1ef4b8[_0x3ae5('0x26')](_0x3ae5('0x27'),_0xe2e61a+'-'+_0x11ea7d+'/'+_0x3afcff)[_0x3ae5('0x21')](_0x5c8e26);}return null;};}function patchUpdates(_0x4ebe28){return function(_0x26045e){try{jsonpatch[_0x3ae5('0x28')](_0x26045e,_0x4ebe28,!![]);}catch(_0xe8ae78){return BPromise[_0x3ae5('0x29')](_0xe8ae78);}return _0x26045e[_0x3ae5('0x2a')]();};}function saveUpdates(_0x16eed0,_0x17ca2f){return function(_0x89abdc){if(_0x89abdc){return _0x89abdc[_0x3ae5('0x2b')](_0x16eed0)[_0x3ae5('0x2c')](function(_0x107dd6){return _0x107dd6;});}return null;};}function removeEntity(_0x1ef098,_0x396f47){return function(_0x477223){if(_0x477223){return _0x477223[_0x3ae5('0x2d')]()[_0x3ae5('0x2c')](function(){var _0x4e8dc2=_0x477223[_0x3ae5('0x2e')]({'plain':!![]});var _0x12497f=_0x3ae5('0x2f');return db['UserProfileResource']['destroy']({'where':{'type':_0x12497f,'resourceId':_0x4e8dc2['id']}})[_0x3ae5('0x2c')](function(){return _0x477223;});})['then'](function(){_0x1ef098[_0x3ae5('0x1f')](0xcc)[_0x3ae5('0x20')]();});}};}function handleEntityNotFound(_0x441055,_0x3b0add){return function(_0x5e8f19){if(!_0x5e8f19){_0x441055[_0x3ae5('0x1e')](0x194);}return _0x5e8f19;};}function handleError(_0x128cc3,_0x105f94){_0x105f94=_0x105f94||0x1f4;return function(_0x3ff882){logger[_0x3ae5('0x30')](_0x3ff882['stack']);if(_0x3ff882[_0x3ae5('0x31')]){delete _0x3ff882[_0x3ae5('0x31')];}_0x128cc3[_0x3ae5('0x1f')](_0x105f94)[_0x3ae5('0x32')](_0x3ff882);};}exports['index']=function(_0x1bab08,_0x4e6241){var _0x3a50f8={},_0x3f2912={},_0x85fc4={'count':0x0,'rows':[]};var _0x859064=_[_0x3ae5('0x33')](db['MailQueue'][_0x3ae5('0x34')],function(_0x4b267f){return{'name':_0x4b267f[_0x3ae5('0x35')],'type':_0x4b267f[_0x3ae5('0x36')][_0x3ae5('0x37')]};});_0x3f2912[_0x3ae5('0x38')]=_['map'](_0x859064,'name');_0x3f2912[_0x3ae5('0x39')]=_['keys'](_0x1bab08[_0x3ae5('0x39')]);_0x3f2912[_0x3ae5('0x3a')]=_[_0x3ae5('0x3b')](_0x3f2912[_0x3ae5('0x38')],_0x3f2912[_0x3ae5('0x39')]);_0x3a50f8[_0x3ae5('0x3c')]=_[_0x3ae5('0x3b')](_0x3f2912['model'],qs[_0x3ae5('0x3d')](_0x1bab08[_0x3ae5('0x39')]['fields']));_0x3a50f8[_0x3ae5('0x3c')]=_0x3a50f8['attributes'][_0x3ae5('0x3e')]?_0x3a50f8[_0x3ae5('0x3c')]:_0x3f2912[_0x3ae5('0x38')];if(!_0x1bab08[_0x3ae5('0x39')]['hasOwnProperty'](_0x3ae5('0x3f'))){_0x3a50f8['limit']=qs['limit'](_0x1bab08[_0x3ae5('0x39')][_0x3ae5('0x24')]);_0x3a50f8[_0x3ae5('0x22')]=qs[_0x3ae5('0x22')](_0x1bab08[_0x3ae5('0x39')]['offset']);}_0x3a50f8[_0x3ae5('0x40')]=qs[_0x3ae5('0x41')](_0x1bab08[_0x3ae5('0x39')][_0x3ae5('0x41')]);_0x3a50f8['where']=qs[_0x3ae5('0x3a')](_[_0x3ae5('0x42')](_0x1bab08['query'],_0x3f2912['filters']),_0x859064);if(_0x1bab08[_0x3ae5('0x39')][_0x3ae5('0x43')]){_0x3a50f8['where']=_[_0x3ae5('0x44')](_0x3a50f8[_0x3ae5('0x45')],{'$or':_[_0x3ae5('0x33')](_0x859064,function(_0x103d5d){if(_0x103d5d[_0x3ae5('0x36')]!==_0x3ae5('0x46')){var _0x449c3f={};_0x449c3f[_0x103d5d['name']]={'$like':'%'+_0x1bab08[_0x3ae5('0x39')][_0x3ae5('0x43')]+'%'};return _0x449c3f;}})});}_0x3a50f8=_[_0x3ae5('0x44')]({},_0x3a50f8,_0x1bab08[_0x3ae5('0x47')]);var _0x4d6be3={'where':_0x3a50f8[_0x3ae5('0x45')]};return db['MailQueue'][_0x3ae5('0x25')](_0x4d6be3)[_0x3ae5('0x2c')](function(_0x3c3730){_0x85fc4[_0x3ae5('0x25')]=_0x3c3730;if(_0x1bab08[_0x3ae5('0x39')][_0x3ae5('0x48')]){_0x3a50f8[_0x3ae5('0x49')]=[{'all':!![]}];}return db[_0x3ae5('0x4a')]['findAll'](_0x3a50f8);})['then'](function(_0x2efb27){_0x85fc4[_0x3ae5('0x4b')]=_0x2efb27;return _0x85fc4;})['then'](respondWithFilteredResult(_0x4e6241,_0x3a50f8))[_0x3ae5('0x4c')](handleError(_0x4e6241,null));};exports[_0x3ae5('0x4d')]=function(_0x307aaf,_0x3829e0){var _0x327b4b={'raw':!![],'where':{'id':_0x307aaf[_0x3ae5('0x4e')]['id']}},_0x333cc3={};_0x333cc3[_0x3ae5('0x38')]=_[_0x3ae5('0x4f')](db[_0x3ae5('0x4a')]['rawAttributes']);_0x333cc3[_0x3ae5('0x39')]=_['keys'](_0x307aaf[_0x3ae5('0x39')]);_0x333cc3[_0x3ae5('0x3a')]=_['intersection'](_0x333cc3[_0x3ae5('0x38')],_0x333cc3[_0x3ae5('0x39')]);_0x327b4b[_0x3ae5('0x3c')]=_[_0x3ae5('0x3b')](_0x333cc3['model'],qs[_0x3ae5('0x3d')](_0x307aaf[_0x3ae5('0x39')]['fields']));_0x327b4b['attributes']=_0x327b4b[_0x3ae5('0x3c')][_0x3ae5('0x3e')]?_0x327b4b[_0x3ae5('0x3c')]:_0x333cc3['model'];if(_0x307aaf[_0x3ae5('0x39')][_0x3ae5('0x48')]){_0x327b4b[_0x3ae5('0x49')]=[{'all':!![]}];}_0x327b4b=_['merge']({},_0x327b4b,_0x307aaf[_0x3ae5('0x47')]);return db['MailQueue'][_0x3ae5('0x50')](_0x327b4b)[_0x3ae5('0x2c')](handleEntityNotFound(_0x3829e0,null))[_0x3ae5('0x2c')](respondWithResult(_0x3829e0,null))[_0x3ae5('0x4c')](handleError(_0x3829e0,null));};exports['create']=function(_0x24a591,_0x236678){return db['MailQueue']['create'](_0x24a591['body'],{})['then'](function(_0x120b1c){var _0x5dbd97=_0x24a591['user'][_0x3ae5('0x2e')]({'plain':!![]});if(!_0x5dbd97)throw new Error(_0x3ae5('0x51'));if(_0x5dbd97[_0x3ae5('0x52')]===_0x3ae5('0x53')){var _0x31e74d=_0x120b1c['get']({'plain':!![]});var _0x4fa94e=_0x3ae5('0x2f');return db[_0x3ae5('0x54')][_0x3ae5('0x50')]({'where':{'name':_0x4fa94e,'userProfileId':_0x5dbd97[_0x3ae5('0x55')]},'raw':!![]})['then'](function(_0x4217bb){if(_0x4217bb&&_0x4217bb[_0x3ae5('0x56')]===0x0){return db[_0x3ae5('0x57')][_0x3ae5('0x58')]({'name':_0x31e74d[_0x3ae5('0x31')],'resourceId':_0x31e74d['id'],'type':_0x4217bb['name'],'sectionId':_0x4217bb['id']},{})[_0x3ae5('0x2c')](function(){return _0x120b1c;});}else{return _0x120b1c;}})[_0x3ae5('0x4c')](function(_0x46f075){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46f075);throw _0x46f075;});}return _0x120b1c;})['then'](respondWithResult(_0x236678,0xc9))['catch'](handleError(_0x236678,null));};exports['update']=function(_0x1aadf1,_0x1fddcd){if(_0x1aadf1[_0x3ae5('0x59')]['id']){delete _0x1aadf1[_0x3ae5('0x59')]['id'];}return db[_0x3ae5('0x4a')][_0x3ae5('0x50')]({'where':{'id':_0x1aadf1[_0x3ae5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1fddcd,null))[_0x3ae5('0x2c')](saveUpdates(_0x1aadf1[_0x3ae5('0x59')],null))[_0x3ae5('0x2c')](respondWithResult(_0x1fddcd,null))[_0x3ae5('0x4c')](handleError(_0x1fddcd,null));};exports[_0x3ae5('0x2d')]=function(_0x512076,_0x1ad0aa){return db[_0x3ae5('0x4a')]['find']({'where':{'id':_0x512076['params']['id']}})['then'](handleEntityNotFound(_0x1ad0aa,null))[_0x3ae5('0x2c')](removeEntity(_0x1ad0aa,null))[_0x3ae5('0x4c')](handleError(_0x1ad0aa,null));};exports[_0x3ae5('0x5a')]=function(_0xd75a3,_0x513c27){return db['MailQueue'][_0x3ae5('0x5a')]()[_0x3ae5('0x2c')](respondWithResult(_0x513c27,null))['catch'](handleError(_0x513c27,null));};exports[_0x3ae5('0x5b')]=function(_0x2a4868,_0x65fa69,_0x25c006){var _0x3c3e77={'raw':!![],'where':{}},_0x2dbee6={},_0x2c9f8a;return db['MailQueue'][_0x3ae5('0x5c')]({'where':{'id':_0x2a4868[_0x3ae5('0x4e')]['id']}})[_0x3ae5('0x2c')](handleEntityNotFound(_0x65fa69,null))[_0x3ae5('0x2c')](function(_0x4b8676){if(_0x4b8676){_0x2c9f8a=_0x4b8676['get']({'plain':!![]});_0x2dbee6[_0x3ae5('0x38')]=_[_0x3ae5('0x4f')](db[_0x3ae5('0x5d')]['rawAttributes']);_0x2dbee6[_0x3ae5('0x39')]=_[_0x3ae5('0x4f')](_0x2a4868[_0x3ae5('0x39')]);_0x2dbee6['filters']=_[_0x3ae5('0x3b')](_0x2dbee6[_0x3ae5('0x38')],_0x2dbee6[_0x3ae5('0x39')]);_0x3c3e77[_0x3ae5('0x3c')]=_['intersection'](_0x2dbee6[_0x3ae5('0x38')],qs[_0x3ae5('0x3d')](_0x2a4868[_0x3ae5('0x39')][_0x3ae5('0x3d')]));_0x3c3e77[_0x3ae5('0x3c')]=_0x3c3e77[_0x3ae5('0x3c')]['length']?_0x3c3e77[_0x3ae5('0x3c')]:_0x2dbee6[_0x3ae5('0x38')];if(!_0x2a4868[_0x3ae5('0x39')][_0x3ae5('0x5e')](_0x3ae5('0x3f'))){_0x3c3e77[_0x3ae5('0x24')]=qs['limit'](_0x2a4868[_0x3ae5('0x39')][_0x3ae5('0x24')]);_0x3c3e77[_0x3ae5('0x22')]=qs['offset'](_0x2a4868['query'][_0x3ae5('0x22')]);}_0x3c3e77[_0x3ae5('0x40')]=qs[_0x3ae5('0x41')](_0x2a4868['query'][_0x3ae5('0x41')]);_0x3c3e77[_0x3ae5('0x45')]=qs[_0x3ae5('0x3a')](_[_0x3ae5('0x42')](_0x2a4868[_0x3ae5('0x39')],_0x2dbee6[_0x3ae5('0x3a')]));_0x3c3e77[_0x3ae5('0x45')]['MailQueueId']=_0x4b8676['id'];if(_0x2a4868[_0x3ae5('0x39')][_0x3ae5('0x43')]){_0x3c3e77[_0x3ae5('0x45')]=_[_0x3ae5('0x44')](_0x3c3e77[_0x3ae5('0x45')],{'$or':_[_0x3ae5('0x33')](_0x3c3e77[_0x3ae5('0x3c')],function(_0x305ece){var _0x427fea={};_0x427fea[_0x305ece]={'$like':'%'+_0x2a4868['query'][_0x3ae5('0x43')]+'%'};return _0x427fea;})});}_0x3c3e77=_[_0x3ae5('0x44')]({},_0x3c3e77,_0x2a4868[_0x3ae5('0x47')]);return db['UserMailQueue']['findAll'](_0x3c3e77);}})['then'](function(_0x511d4c){if(_0x511d4c){return db[_0x3ae5('0x5f')][_0x3ae5('0x60')]({'where':{'id':_[_0x3ae5('0x33')](_0x511d4c,_0x3ae5('0x61')),'role':_0x3ae5('0x62')},'attributes':['id',_0x3ae5('0x31'),_0x3ae5('0x63'),_0x3ae5('0x64'),_0x3ae5('0x65')]});}})[_0x3ae5('0x2c')](function(_0x548371){if(_0x548371){return{'count':_0x548371[_0x3ae5('0x25')],'rows':_[_0x3ae5('0x33')](_0x548371[_0x3ae5('0x4b')],function(_0x83153){return{'membername':_0x83153[_0x3ae5('0x31')],'UserId':_0x83153['id'],'queue_name':_0x2c9f8a[_0x3ae5('0x31')],'MailQueueId':_0x2c9f8a['id'],'interface':util[_0x3ae5('0x66')]('%s/%s',_0x3ae5('0x67'),_0x83153[_0x3ae5('0x31')]),'penalty':0x0,'paused':_0x83153[_0x3ae5('0x63')],'createdAt':_0x83153[_0x3ae5('0x65')],'updatedAt':_0x83153['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x3ae5('0x2c')](respondWithFilteredResult(_0x65fa69,_0x3c3e77))[_0x3ae5('0x4c')](handleError(_0x65fa69,null));};exports[_0x3ae5('0x68')]=function(_0x17f9b6,_0x149107,_0x134e87){var _0x4178ef={};var _0x4fa950={};var _0x42e9b0;var _0xfc517a;return db['MailQueue'][_0x3ae5('0x5c')]({'where':{'id':_0x17f9b6['params']['id']}})[_0x3ae5('0x2c')](handleEntityNotFound(_0x149107,null))[_0x3ae5('0x2c')](function(_0x16053b){if(_0x16053b){_0x42e9b0=_0x16053b;_0x4fa950[_0x3ae5('0x38')]=_[_0x3ae5('0x4f')](db[_0x3ae5('0x69')][_0x3ae5('0x34')]);_0x4fa950['query']=_[_0x3ae5('0x4f')](_0x17f9b6[_0x3ae5('0x39')]);_0x4fa950['filters']=_[_0x3ae5('0x3b')](_0x4fa950[_0x3ae5('0x38')],_0x4fa950[_0x3ae5('0x39')]);_0x4178ef[_0x3ae5('0x3c')]=_[_0x3ae5('0x3b')](_0x4fa950[_0x3ae5('0x38')],qs['fields'](_0x17f9b6[_0x3ae5('0x39')][_0x3ae5('0x3d')]));_0x4178ef['attributes']=_0x4178ef[_0x3ae5('0x3c')]['length']?_0x4178ef[_0x3ae5('0x3c')]:_0x4fa950[_0x3ae5('0x38')];_0x4178ef['order']=qs[_0x3ae5('0x41')](_0x17f9b6[_0x3ae5('0x39')]['sort']);_0x4178ef[_0x3ae5('0x45')]=qs['filters'](_[_0x3ae5('0x42')](_0x17f9b6[_0x3ae5('0x39')],_0x4fa950[_0x3ae5('0x3a')]));if(_0x17f9b6[_0x3ae5('0x39')][_0x3ae5('0x43')]){_0x4178ef['where']=_[_0x3ae5('0x44')](_0x4178ef['where'],{'$or':_[_0x3ae5('0x33')](_0x4178ef[_0x3ae5('0x3c')],function(_0x7587e4){var _0x2f4a94={};_0x2f4a94[_0x7587e4]={'$like':'%'+_0x17f9b6['query'][_0x3ae5('0x43')]+'%'};return _0x2f4a94;})});}_0x4178ef=_['merge']({},_0x4178ef,_0x17f9b6[_0x3ae5('0x47')]);return _0x42e9b0[_0x3ae5('0x68')](_0x4178ef);}})['then'](function(_0x42581d){if(_0x42581d){_0xfc517a=_0x42581d[_0x3ae5('0x3e')];if(!_0x17f9b6[_0x3ae5('0x39')]['hasOwnProperty'](_0x3ae5('0x3f'))){_0x4178ef['limit']=qs[_0x3ae5('0x24')](_0x17f9b6[_0x3ae5('0x39')][_0x3ae5('0x24')]);_0x4178ef[_0x3ae5('0x22')]=qs['offset'](_0x17f9b6[_0x3ae5('0x39')][_0x3ae5('0x22')]);}return _0x42e9b0[_0x3ae5('0x68')](_0x4178ef);}})['then'](function(_0x46b72c){if(_0x46b72c){return _0x46b72c?{'count':_0xfc517a,'rows':_0x46b72c}:null;}})[_0x3ae5('0x2c')](respondWithResult(_0x149107,null))[_0x3ae5('0x4c')](handleError(_0x149107,null));};exports[_0x3ae5('0x6a')]=function(_0x1ac94f,_0x2badf4,_0x4e967f){var _0x37190e=_0x1ac94f[_0x3ae5('0x59')]['ids'];return db[_0x3ae5('0x69')]['findAll']({'where':{'id':_0x37190e},'attributes':['id'],'include':[{'model':db[_0x3ae5('0x5f')],'as':_0x3ae5('0x6b'),'attributes':['id',_0x3ae5('0x31'),'online',_0x3ae5('0x6c'),_0x3ae5('0x6d')],'raw':!![]}]})[_0x3ae5('0x2c')](function(_0x5506ac){if(_0x5506ac){var _0xaa8c1f=_[_0x3ae5('0x6e')](_0x5506ac,function(_0x5abc98){var _0x3a2115=_0x5abc98[_0x3ae5('0x2e')]({'plain':!![]});return _0x3a2115[_0x3ae5('0x6b')];});return db[_0x3ae5('0x4a')][_0x3ae5('0x50')]({'where':{'id':_0x1ac94f['params']['id']}})[_0x3ae5('0x2c')](function(_0x5768a2){return db[_0x3ae5('0x6f')][_0x3ae5('0x70')](function(_0x139eb3){return _0x5768a2[_0x3ae5('0x6a')](_0x37190e,{'transaction':_0x139eb3})[_0x3ae5('0x2c')](function(){return BPromise[_0x3ae5('0x71')](_0xaa8c1f,function(_0x3b666d){return db[_0x3ae5('0x5d')][_0x3ae5('0x72')]({'where':{'UserId':_0x3b666d['id'],'MailQueueId':_0x1ac94f[_0x3ae5('0x4e')]['id']},'transaction':_0x139eb3});});})[_0x3ae5('0x2c')](function(){_0xaa8c1f[_0x3ae5('0x73')](function(_0x171fe0){socket['emit']('userMailQueue:save',{'UserId':_0x171fe0['id'],'MailQueueId':_0x5768a2['id']});});});});});}})[_0x3ae5('0x2c')](respondWithStatusCode(_0x2badf4,null))[_0x3ae5('0x4c')](handleError(_0x2badf4,null));};exports[_0x3ae5('0x74')]=function(_0x46f847,_0x3ae8a2,_0x118436){return db['Team'][_0x3ae5('0x75')]({'where':{'id':_0x46f847[_0x3ae5('0x39')][_0x3ae5('0x76')]},'attributes':['id'],'include':[{'model':db[_0x3ae5('0x5f')],'as':_0x3ae5('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x3ae5('0x2c')](handleEntityNotFound(_0x3ae8a2,null))[_0x3ae5('0x2c')](function(_0x3c6933){var _0x1c5bc2=_['map'](_0x3c6933,'id');var _0x1c8578=[];var _0x4721f3=[];var _0x540bc9=squel[_0x3ae5('0x77')]();_0x540bc9['field'](_0x3ae5('0x78'))['from'](_0x3ae5('0x79'),'tq')['join'](_0x3ae5('0x7a'),'ut',_0x3ae5('0x7b'))[_0x3ae5('0x45')]('MailQueueId\x20=\x20?',_0x46f847['params']['id']);for(var _0x4218ee=0x0;_0x4218ee<_0x3c6933[_0x3ae5('0x3e')];_0x4218ee+=0x1){let _0x2e2e08=_0x3c6933[_0x4218ee];for(var _0x2fafbf=0x0;_0x2fafbf<_0x2e2e08[_0x3ae5('0x6b')]['length'];_0x2fafbf+=0x1){let _0x3483cc=_0x2e2e08[_0x3ae5('0x6b')][_0x2fafbf];var _0x2035e0=_0x540bc9['clone']();_0x2035e0[_0x3ae5('0x45')]('ut.UserId\x20=\x20?',_0x3483cc['id']);_0x4721f3[_0x3ae5('0x7c')](db[_0x3ae5('0x6f')]['query'](_0x2035e0['toString'](),{'type':db['sequelize'][_0x3ae5('0x7d')][_0x3ae5('0x7e')]})[_0x3ae5('0x2c')](function(_0x14f53a){if(_0x14f53a['length']===0x1){return _0x3483cc['id'];}else{var _0x16949c=_[_0x3ae5('0x7f')](_[_0x3ae5('0x33')](_0x14f53a,'TeamId'),function(_0xcfe05f){return _[_0x3ae5('0x80')](_0x1c5bc2,_0xcfe05f);});if(_0x16949c){return _0x3483cc['id'];}}}));}}return BPromise[_0x3ae5('0x81')](_0x4721f3)[_0x3ae5('0x2c')](function(_0x2d4588){_0x1c8578=_(_0x1c8578)[_0x3ae5('0x82')](_0x2d4588)[_0x3ae5('0x83')]()[_0x3ae5('0x84')]();return db[_0x3ae5('0x4a')][_0x3ae5('0x50')]({'where':{'id':_0x46f847['params']['id']}})['then'](function(_0x43bada){return db[_0x3ae5('0x6f')][_0x3ae5('0x70')](function(_0x262135){return _0x43bada['removeTeams'](_0x46f847[_0x3ae5('0x39')]['ids'],{'transaction':_0x262135})['then'](function(){if(!_[_0x3ae5('0x85')](_0x1c8578)){return _0x43bada[_0x3ae5('0x86')](_0x1c8578,{'transaction':_0x262135});}})[_0x3ae5('0x2c')](function(){_0x1c8578[_0x3ae5('0x73')](function(_0x2d6fc6){socket[_0x3ae5('0x87')](_0x3ae5('0x88'),{'UserId':_0x2d6fc6,'MailQueueId':_0x43bada['id']});});});});});});})[_0x3ae5('0x2c')](respondWithStatusCode(_0x3ae8a2,null))[_0x3ae5('0x4c')](handleError(_0x3ae8a2,null));};exports[_0x3ae5('0x89')]=function(_0x421142,_0x255dae,_0x30b6a7){return db[_0x3ae5('0x4a')][_0x3ae5('0x50')]({'where':{'id':_0x421142[_0x3ae5('0x4e')]['id']}})[_0x3ae5('0x2c')](handleEntityNotFound(_0x255dae,null))[_0x3ae5('0x2c')](function(_0x2333f4){if(_0x2333f4){return _0x2333f4[_0x3ae5('0x89')](_0x421142[_0x3ae5('0x59')][_0x3ae5('0x76')],_[_0x3ae5('0x8a')](_0x421142['body'],[_0x3ae5('0x76'),'id'])||{})[_0x3ae5('0x8b')](function(_0x554c5c){for(var _0x529814=0x0;_0x529814<_0x421142[_0x3ae5('0x59')]['ids']['length'];_0x529814+=0x1){socket[_0x3ae5('0x87')]('userMailQueue:save',{'UserId':Number(_0x421142['body']['ids'][_0x529814]),'MailQueueId':Number(_0x421142[_0x3ae5('0x4e')]['id'])});}return _0x554c5c;});}})['then'](respondWithResult(_0x255dae,null))[_0x3ae5('0x4c')](handleError(_0x255dae,null));};exports[_0x3ae5('0x86')]=function(_0x597302,_0x373d96,_0x5a391e){return db[_0x3ae5('0x4a')][_0x3ae5('0x50')]({'where':{'id':_0x597302[_0x3ae5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x373d96,null))[_0x3ae5('0x2c')](function(_0xf14505){if(_0xf14505){return _0xf14505[_0x3ae5('0x86')](_0x597302[_0x3ae5('0x39')][_0x3ae5('0x76')])[_0x3ae5('0x2c')](function(){if(_[_0x3ae5('0x8c')](_0x597302[_0x3ae5('0x39')][_0x3ae5('0x76')])){for(var _0x86f315=0x0;_0x86f315<_0x597302[_0x3ae5('0x39')][_0x3ae5('0x76')][_0x3ae5('0x3e')];_0x86f315+=0x1){socket[_0x3ae5('0x87')](_0x3ae5('0x88'),{'UserId':Number(_0x597302['query'][_0x3ae5('0x76')][_0x86f315]),'MailQueueId':Number(_0x597302[_0x3ae5('0x4e')]['id'])});}}else{socket[_0x3ae5('0x87')](_0x3ae5('0x88'),{'UserId':Number(_0x597302[_0x3ae5('0x39')][_0x3ae5('0x76')]),'MailQueueId':Number(_0x597302[_0x3ae5('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0x373d96,null))['catch'](handleError(_0x373d96,null));};exports['getAgents']=function(_0x26e22e,_0x3f4026,_0x2d96b0){var _0x9d6f7={};var _0x2a6198={};var _0x19ec74;var _0xdbc555;return db[_0x3ae5('0x4a')][_0x3ae5('0x5c')]({'where':{'id':_0x26e22e[_0x3ae5('0x4e')]['id']}})[_0x3ae5('0x2c')](handleEntityNotFound(_0x3f4026,null))[_0x3ae5('0x2c')](function(_0x4812b1){if(_0x4812b1){_0x19ec74=_0x4812b1;_0x2a6198['model']=_['keys'](db[_0x3ae5('0x5f')][_0x3ae5('0x34')]);_0x2a6198[_0x3ae5('0x39')]=_[_0x3ae5('0x4f')](_0x26e22e[_0x3ae5('0x39')]);_0x2a6198[_0x3ae5('0x3a')]=_['intersection'](_0x2a6198[_0x3ae5('0x38')],_0x2a6198['query']);_0x9d6f7[_0x3ae5('0x3c')]=_[_0x3ae5('0x3b')](_0x2a6198['model'],qs[_0x3ae5('0x3d')](_0x26e22e[_0x3ae5('0x39')][_0x3ae5('0x3d')]));_0x9d6f7['attributes']=_0x9d6f7['attributes'][_0x3ae5('0x3e')]?_0x9d6f7[_0x3ae5('0x3c')]:_0x2a6198['model'];_0x9d6f7[_0x3ae5('0x40')]=qs[_0x3ae5('0x41')](_0x26e22e[_0x3ae5('0x39')]['sort']);_0x9d6f7[_0x3ae5('0x45')]=qs[_0x3ae5('0x3a')](_[_0x3ae5('0x42')](_0x26e22e['query'],_0x2a6198['filters']));if(_0x26e22e[_0x3ae5('0x39')]['filter']){_0x9d6f7[_0x3ae5('0x45')]=_[_0x3ae5('0x44')](_0x9d6f7['where'],{'$or':_[_0x3ae5('0x33')](_0x9d6f7[_0x3ae5('0x3c')],function(_0x367556){var _0x3afa96={};_0x3afa96[_0x367556]={'$like':'%'+_0x26e22e[_0x3ae5('0x39')][_0x3ae5('0x43')]+'%'};return _0x3afa96;})});}_0x9d6f7=_[_0x3ae5('0x44')]({},_0x9d6f7,_0x26e22e[_0x3ae5('0x47')]);return _0x19ec74[_0x3ae5('0x8d')](_0x9d6f7);}})[_0x3ae5('0x2c')](function(_0x5c82f5){if(_0x5c82f5){_0xdbc555=_0x5c82f5[_0x3ae5('0x3e')];if(!_0x26e22e['query'][_0x3ae5('0x5e')]('nolimit')){_0x9d6f7[_0x3ae5('0x24')]=qs[_0x3ae5('0x24')](_0x26e22e[_0x3ae5('0x39')][_0x3ae5('0x24')]);_0x9d6f7[_0x3ae5('0x22')]=qs[_0x3ae5('0x22')](_0x26e22e['query']['offset']);}return _0x19ec74[_0x3ae5('0x8d')](_0x9d6f7);}})[_0x3ae5('0x2c')](function(_0x1aa55a){if(_0x1aa55a){return _0x1aa55a?{'count':_0xdbc555,'rows':_0x1aa55a}:null;}})[_0x3ae5('0x2c')](respondWithResult(_0x3f4026,null))[_0x3ae5('0x4c')](handleError(_0x3f4026,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index f7b5708..f0b3625 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 _0x0b9a=['exports','../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x498dca,_0xc0ae5d){var _0x3d511e=function(_0x1ca083){while(--_0x1ca083){_0x498dca['push'](_0x498dca['shift']());}};_0x3d511e(++_0xc0ae5d);}(_0x0b9a,0x119));var _0xa0b9=function(_0x41a804,_0xcde371){_0x41a804=_0x41a804-0x0;var _0x26870d=_0x0b9a[_0x41a804];return _0x26870d;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xa0b9('0x0'))['db'][_0xa0b9('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xa0b9('0x2')](0x0);var events={'afterCreate':_0xa0b9('0x3'),'afterUpdate':_0xa0b9('0x4'),'afterDestroy':_0xa0b9('0x5')};function emitEvent(_0x3ffc5f){return function(_0x4d6fa3,_0x57cf6f,_0xdf4c1f){MailQueueEvents[_0xa0b9('0x6')](_0x3ffc5f+':'+_0x4d6fa3['id'],_0x4d6fa3);MailQueueEvents[_0xa0b9('0x6')](_0x3ffc5f,_0x4d6fa3);_0xdf4c1f(null);};}for(var e in events){if(events[_0xa0b9('0x7')](e)){var event=events[e];MailQueue[_0xa0b9('0x8')](e,emitEvent(event));}}module[_0xa0b9('0x9')]=MailQueueEvents; \ No newline at end of file +var _0x2ddf=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','update','remove'];(function(_0x20845e,_0x211e78){var _0x28cf2b=function(_0x31d613){while(--_0x31d613){_0x20845e['push'](_0x20845e['shift']());}};_0x28cf2b(++_0x211e78);}(_0x2ddf,0x1ac));var _0xf2dd=function(_0xf2ee1d,_0x21796d){_0xf2ee1d=_0xf2ee1d-0x0;var _0x250b14=_0x2ddf[_0xf2ee1d];return _0x250b14;};'use strict';var EventEmitter=require(_0xf2dd('0x0'));var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xf2dd('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf2dd('0x2'),'afterDestroy':_0xf2dd('0x3')};function emitEvent(_0x368d8a){return function(_0xf94feb,_0x2d52d9,_0x45fc0c){MailQueueEvents[_0xf2dd('0x4')](_0x368d8a+':'+_0xf94feb['id'],_0xf94feb);MailQueueEvents[_0xf2dd('0x4')](_0x368d8a,_0xf94feb);_0x45fc0c(null);};}for(var e in events){if(events[_0xf2dd('0x5')](e)){var event=events[e];MailQueue[_0xf2dd('0x6')](e,emitEvent(event));}}module[_0xf2dd('0x7')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 04b7553..e0979ee 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 _0xab55=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','define','mail_queues','lodash','util'];(function(_0x3ba5c0,_0x227fc6){var _0x186b66=function(_0x4a81e0){while(--_0x4a81e0){_0x3ba5c0['push'](_0x3ba5c0['shift']());}};_0x186b66(++_0x227fc6);}(_0xab55,0xa7));var _0x5ab5=function(_0x2bb1e8,_0x170447){_0x2bb1e8=_0x2bb1e8-0x0;var _0x3b699f=_0xab55[_0x2bb1e8];return _0x3b699f;};'use strict';var _=require(_0x5ab5('0x0'));var util=require(_0x5ab5('0x1'));var logger=require(_0x5ab5('0x2'))('api');var moment=require(_0x5ab5('0x3'));var BPromise=require(_0x5ab5('0x4'));var rp=require(_0x5ab5('0x5'));var fs=require('fs');var path=require(_0x5ab5('0x6'));var rimraf=require(_0x5ab5('0x7'));var config=require(_0x5ab5('0x8'));var attributes=require(_0x5ab5('0x9'));module[_0x5ab5('0xa')]=function(_0x30eaf6,_0x24d05d){return _0x30eaf6[_0x5ab5('0xb')]('MailQueue',attributes,{'tableName':_0x5ab5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3915=['../../config/logger','api','bluebird','path','../../config/environment','./mailQueue.attributes','exports','MailQueue','mail_queues','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3915,0xa3));var _0x5391=function(_0x2ab76b,_0x176579){_0x2ab76b=_0x2ab76b-0x0;var _0x201126=_0x3915[_0x2ab76b];return _0x201126;};'use strict';var _=require(_0x5391('0x0'));var util=require(_0x5391('0x1'));var logger=require(_0x5391('0x2'))(_0x5391('0x3'));var moment=require('moment');var BPromise=require(_0x5391('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5391('0x5'));var rimraf=require('rimraf');var config=require(_0x5391('0x6'));var attributes=require(_0x5391('0x7'));module[_0x5391('0x8')]=function(_0x1c527a,_0x471ac4){return _0x1c527a['define'](_0x5391('0x9'),attributes,{'tableName':_0x5391('0xa'),'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 8cacec6..bbed275 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 _0xd752=['ShowMailQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','request','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','where','attributes','include','map','model','then','info','find','raw'];(function(_0x493b35,_0xbc6238){var _0x2d23ad=function(_0x1d3e70){while(--_0x1d3e70){_0x493b35['push'](_0x493b35['shift']());}};_0x2d23ad(++_0xbc6238);}(_0xd752,0x7c));var _0x2d75=function(_0x27604f,_0x5ae336){_0x27604f=_0x27604f-0x0;var _0x40d189=_0xd752[_0x27604f];return _0x40d189;};'use strict';var _=require(_0x2d75('0x0'));var util=require(_0x2d75('0x1'));var moment=require(_0x2d75('0x2'));var BPromise=require(_0x2d75('0x3'));var rs=require(_0x2d75('0x4'));var fs=require('fs');var Redis=require(_0x2d75('0x5'));var db=require(_0x2d75('0x6'))['db'];var utils=require(_0x2d75('0x7'));var logger=require(_0x2d75('0x8'))(_0x2d75('0x9'));var config=require(_0x2d75('0xa'));var jayson=require(_0x2d75('0xb'));var client=jayson['client']['http']({'port':0x232a});config[_0x2d75('0xc')]=_[_0x2d75('0xd')](config[_0x2d75('0xc')],{'host':_0x2d75('0xe'),'port':0x18eb});var socket=require(_0x2d75('0xf'))(new Redis(config[_0x2d75('0xc')]));require(_0x2d75('0x10'))['register'](socket);function respondWithRpcPromise(_0x2564dc,_0x498bcc,_0x4de873){return new BPromise(function(_0x7e513b,_0x31cabc){return client[_0x2d75('0x11')](_0x2564dc,_0x4de873)['then'](function(_0xcc64da){logger['info'](_0x2d75('0x12'),_0x498bcc,_0x2d75('0x13'));logger[_0x2d75('0x14')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x498bcc,'request\x20sent',JSON[_0x2d75('0x15')](_0xcc64da));if(_0xcc64da[_0x2d75('0x16')]){if(_0xcc64da[_0x2d75('0x16')][_0x2d75('0x17')]===0x1f4){logger['error'](_0x2d75('0x12'),_0x498bcc,_0xcc64da[_0x2d75('0x16')]['message']);return _0x31cabc(_0xcc64da[_0x2d75('0x16')][_0x2d75('0x18')]);}logger['error'](_0x2d75('0x12'),_0x498bcc,_0xcc64da['error'][_0x2d75('0x18')]);return _0x7e513b(_0xcc64da['error'][_0x2d75('0x18')]);}else{logger['info'](_0x2d75('0x12'),_0x498bcc,_0x2d75('0x13'));_0x7e513b(_0xcc64da[_0x2d75('0x19')]['message']);}})[_0x2d75('0x1a')](function(_0x4b59ed){logger[_0x2d75('0x16')](_0x2d75('0x12'),_0x498bcc,_0x4b59ed);_0x31cabc(_0x4b59ed);});});}exports[_0x2d75('0x1b')]=function(_0x261219){var _0x598879=this;return new Promise(function(_0x459712,_0x40ee39){return db[_0x2d75('0x1c')][_0x2d75('0x1d')]({'raw':_0x261219[_0x2d75('0x1e')]?_0x261219[_0x2d75('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x261219['options']?_0x261219[_0x2d75('0x1e')][_0x2d75('0x1f')]||null:null,'attributes':_0x261219[_0x2d75('0x1e')]?_0x261219[_0x2d75('0x1e')][_0x2d75('0x20')]||null:null,'limit':_0x261219[_0x2d75('0x1e')]?_0x261219[_0x2d75('0x1e')]['limit']||null:null,'include':_0x261219['options']?_0x261219[_0x2d75('0x1e')][_0x2d75('0x21')]?_[_0x2d75('0x22')](_0x261219['options']['include'],function(_0x16a969){return{'model':db[_0x16a969[_0x2d75('0x23')]],'as':_0x16a969['as'],'attributes':_0x16a969[_0x2d75('0x20')],'include':_0x16a969[_0x2d75('0x21')]?_[_0x2d75('0x22')](_0x16a969['include'],function(_0x356b5a){return{'model':db[_0x356b5a['model']],'as':_0x356b5a['as'],'attributes':_0x356b5a[_0x2d75('0x20')],'include':_0x356b5a['include']?_[_0x2d75('0x22')](_0x356b5a[_0x2d75('0x21')],function(_0x582d9a){return{'model':db[_0x582d9a['model']],'as':_0x582d9a['as'],'attributes':_0x582d9a[_0x2d75('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2d75('0x24')](function(_0x8beed6){logger[_0x2d75('0x25')](_0x2d75('0x1b'),_0x261219);logger[_0x2d75('0x14')](_0x2d75('0x1b'),_0x261219,JSON[_0x2d75('0x15')](_0x8beed6));_0x459712(_0x8beed6);})[_0x2d75('0x1a')](function(_0x18955e){logger['error'](_0x2d75('0x1b'),_0x18955e[_0x2d75('0x18')],_0x261219);_0x40ee39(_0x598879['error'](0x1f4,_0x18955e['message']));});});};exports['ShowMailQueue']=function(_0x1b4e8d){var _0x5a8e56=this;return new Promise(function(_0x217efb,_0x46e22a){return db[_0x2d75('0x1c')][_0x2d75('0x26')]({'raw':_0x1b4e8d[_0x2d75('0x1e')]?_0x1b4e8d['options'][_0x2d75('0x27')]===undefined?!![]:![]:!![],'where':_0x1b4e8d['options']?_0x1b4e8d[_0x2d75('0x1e')][_0x2d75('0x1f')]||null:null,'attributes':_0x1b4e8d[_0x2d75('0x1e')]?_0x1b4e8d[_0x2d75('0x1e')]['attributes']||null:null,'include':_0x1b4e8d[_0x2d75('0x1e')]?_0x1b4e8d['options']['include']?_[_0x2d75('0x22')](_0x1b4e8d[_0x2d75('0x1e')]['include'],function(_0x10938e){return{'model':db[_0x10938e[_0x2d75('0x23')]],'as':_0x10938e['as'],'attributes':_0x10938e['attributes'],'include':_0x10938e[_0x2d75('0x21')]?_[_0x2d75('0x22')](_0x10938e[_0x2d75('0x21')],function(_0x367072){return{'model':db[_0x367072['model']],'as':_0x367072['as'],'attributes':_0x367072[_0x2d75('0x20')],'include':_0x367072['include']?_[_0x2d75('0x22')](_0x367072[_0x2d75('0x21')],function(_0x4bf9a2){return{'model':db[_0x4bf9a2['model']],'as':_0x4bf9a2['as'],'attributes':_0x4bf9a2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x57a7c2){logger[_0x2d75('0x25')](_0x2d75('0x28'),_0x1b4e8d);logger['debug'](_0x2d75('0x28'),_0x1b4e8d,JSON[_0x2d75('0x15')](_0x57a7c2));_0x217efb(_0x57a7c2);})['catch'](function(_0x5f4a7b){logger[_0x2d75('0x16')](_0x2d75('0x28'),_0x5f4a7b[_0x2d75('0x18')],_0x1b4e8d);_0x46e22a(_0x5a8e56[_0x2d75('0x16')](0x1f4,_0x5f4a7b[_0x2d75('0x18')]));});});}; \ No newline at end of file +var _0x3e0b=['request','info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','error','message','catch','MailQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','GetMailQueue','stringify','ShowMailQueue','find','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailQueue.socket','register'];(function(_0x3c7f43,_0x538110){var _0x4e2e94=function(_0x161c0a){while(--_0x161c0a){_0x3c7f43['push'](_0x3c7f43['shift']());}};_0x4e2e94(++_0x538110);}(_0x3e0b,0x16e));var _0xb3e0=function(_0x1f6fde,_0x3efffd){_0x1f6fde=_0x1f6fde-0x0;var _0x4b1500=_0x3e0b[_0x1f6fde];return _0x4b1500;};'use strict';var _=require('lodash');var util=require(_0xb3e0('0x0'));var moment=require('moment');var BPromise=require(_0xb3e0('0x1'));var rs=require(_0xb3e0('0x2'));var fs=require('fs');var Redis=require(_0xb3e0('0x3'));var db=require(_0xb3e0('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xb3e0('0x5'));var jayson=require(_0xb3e0('0x6'));var client=jayson[_0xb3e0('0x7')][_0xb3e0('0x8')]({'port':0x232a});config[_0xb3e0('0x9')]=_[_0xb3e0('0xa')](config[_0xb3e0('0x9')],{'host':_0xb3e0('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb3e0('0x9')]));require(_0xb3e0('0xc'))[_0xb3e0('0xd')](socket);function respondWithRpcPromise(_0x83267a,_0x5f40c9,_0x2636a0){return new BPromise(function(_0x4abe2d,_0x474fe7){return client[_0xb3e0('0xe')](_0x83267a,_0x2636a0)['then'](function(_0xa70691){logger[_0xb3e0('0xf')](_0xb3e0('0x10'),_0x5f40c9,_0xb3e0('0x11'));logger['debug'](_0xb3e0('0x12'),_0x5f40c9,'request\x20sent',JSON['stringify'](_0xa70691));if(_0xa70691[_0xb3e0('0x13')]){if(_0xa70691[_0xb3e0('0x13')]['code']===0x1f4){logger[_0xb3e0('0x13')]('MailQueue,\x20%s,\x20%s',_0x5f40c9,_0xa70691['error']['message']);return _0x474fe7(_0xa70691[_0xb3e0('0x13')][_0xb3e0('0x14')]);}logger[_0xb3e0('0x13')](_0xb3e0('0x10'),_0x5f40c9,_0xa70691['error'][_0xb3e0('0x14')]);return _0x4abe2d(_0xa70691[_0xb3e0('0x13')][_0xb3e0('0x14')]);}else{logger[_0xb3e0('0xf')](_0xb3e0('0x10'),_0x5f40c9,_0xb3e0('0x11'));_0x4abe2d(_0xa70691['result'][_0xb3e0('0x14')]);}})[_0xb3e0('0x15')](function(_0x50ac19){logger['error'](_0xb3e0('0x10'),_0x5f40c9,_0x50ac19);_0x474fe7(_0x50ac19);});});}exports['GetMailQueue']=function(_0x1627f1){var _0x565bf6=this;return new Promise(function(_0xed276a,_0x9969f5){return db[_0xb3e0('0x16')][_0xb3e0('0x17')]({'raw':_0x1627f1['options']?_0x1627f1[_0xb3e0('0x18')][_0xb3e0('0x19')]===undefined?!![]:![]:!![],'where':_0x1627f1['options']?_0x1627f1[_0xb3e0('0x18')][_0xb3e0('0x1a')]||null:null,'attributes':_0x1627f1[_0xb3e0('0x18')]?_0x1627f1[_0xb3e0('0x18')][_0xb3e0('0x1b')]||null:null,'limit':_0x1627f1[_0xb3e0('0x18')]?_0x1627f1['options'][_0xb3e0('0x1c')]||null:null,'include':_0x1627f1[_0xb3e0('0x18')]?_0x1627f1[_0xb3e0('0x18')][_0xb3e0('0x1d')]?_[_0xb3e0('0x1e')](_0x1627f1[_0xb3e0('0x18')][_0xb3e0('0x1d')],function(_0x5f1db8){return{'model':db[_0x5f1db8[_0xb3e0('0x1f')]],'as':_0x5f1db8['as'],'attributes':_0x5f1db8[_0xb3e0('0x1b')],'include':_0x5f1db8[_0xb3e0('0x1d')]?_['map'](_0x5f1db8[_0xb3e0('0x1d')],function(_0x3ba4ef){return{'model':db[_0x3ba4ef[_0xb3e0('0x1f')]],'as':_0x3ba4ef['as'],'attributes':_0x3ba4ef[_0xb3e0('0x1b')],'include':_0x3ba4ef['include']?_[_0xb3e0('0x1e')](_0x3ba4ef[_0xb3e0('0x1d')],function(_0x1b0f53){return{'model':db[_0x1b0f53['model']],'as':_0x1b0f53['as'],'attributes':_0x1b0f53[_0xb3e0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb3e0('0x20')](function(_0xbf8641){logger[_0xb3e0('0xf')]('GetMailQueue',_0x1627f1);logger[_0xb3e0('0x21')](_0xb3e0('0x22'),_0x1627f1,JSON[_0xb3e0('0x23')](_0xbf8641));_0xed276a(_0xbf8641);})[_0xb3e0('0x15')](function(_0x2b2e0c){logger[_0xb3e0('0x13')](_0xb3e0('0x22'),_0x2b2e0c[_0xb3e0('0x14')],_0x1627f1);_0x9969f5(_0x565bf6[_0xb3e0('0x13')](0x1f4,_0x2b2e0c['message']));});});};exports[_0xb3e0('0x24')]=function(_0x5d5d92){var _0x19e374=this;return new Promise(function(_0x328286,_0x20bd91){return db[_0xb3e0('0x16')][_0xb3e0('0x25')]({'raw':_0x5d5d92[_0xb3e0('0x18')]?_0x5d5d92[_0xb3e0('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5d5d92['options']?_0x5d5d92[_0xb3e0('0x18')]['where']||null:null,'attributes':_0x5d5d92[_0xb3e0('0x18')]?_0x5d5d92[_0xb3e0('0x18')][_0xb3e0('0x1b')]||null:null,'include':_0x5d5d92[_0xb3e0('0x18')]?_0x5d5d92['options'][_0xb3e0('0x1d')]?_['map'](_0x5d5d92['options'][_0xb3e0('0x1d')],function(_0x111aea){return{'model':db[_0x111aea[_0xb3e0('0x1f')]],'as':_0x111aea['as'],'attributes':_0x111aea[_0xb3e0('0x1b')],'include':_0x111aea[_0xb3e0('0x1d')]?_['map'](_0x111aea[_0xb3e0('0x1d')],function(_0x53484f){return{'model':db[_0x53484f[_0xb3e0('0x1f')]],'as':_0x53484f['as'],'attributes':_0x53484f[_0xb3e0('0x1b')],'include':_0x53484f[_0xb3e0('0x1d')]?_['map'](_0x53484f[_0xb3e0('0x1d')],function(_0x56034b){return{'model':db[_0x56034b[_0xb3e0('0x1f')]],'as':_0x56034b['as'],'attributes':_0x56034b[_0xb3e0('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36c45b){logger['info'](_0xb3e0('0x24'),_0x5d5d92);logger['debug'](_0xb3e0('0x24'),_0x5d5d92,JSON[_0xb3e0('0x23')](_0x36c45b));_0x328286(_0x36c45b);})[_0xb3e0('0x15')](function(_0x463f6f){logger[_0xb3e0('0x13')](_0xb3e0('0x24'),_0x463f6f[_0xb3e0('0x14')],_0x5d5d92);_0x20bd91(_0x19e374[_0xb3e0('0x13')](0x1f4,_0x463f6f['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 881cd24..cca8cdf 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 _0xeacb=['length','mailQueue:','save','remove','removeListener'];(function(_0x341a71,_0x3ef97b){var _0x55b7d7=function(_0x3899fe){while(--_0x3899fe){_0x341a71['push'](_0x341a71['shift']());}};_0x55b7d7(++_0x3ef97b);}(_0xeacb,0xcf));var _0xbeac=function(_0x15d991,_0x2cd561){_0x15d991=_0x15d991-0x0;var _0x4f2aec=_0xeacb[_0x15d991];return _0x4f2aec;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xbeac('0x0'),_0xbeac('0x1'),'update'];function createListener(_0x4aed29,_0x4c7f34){return function(_0x2c5fcd){_0x4c7f34['emit'](_0x4aed29,_0x2c5fcd);};}function removeListener(_0x45860c,_0x403e9a){return function(){MailQueueEvents[_0xbeac('0x2')](_0x45860c,_0x403e9a);};}exports['register']=function(_0x1005d4){for(var _0x1985e1=0x0,_0x320d54=events[_0xbeac('0x3')];_0x1985e1<_0x320d54;_0x1985e1++){var _0xe11c5e=events[_0x1985e1];var _0xc7cbfa=createListener(_0xbeac('0x4')+_0xe11c5e,_0x1005d4);MailQueueEvents['on'](_0xe11c5e,_0xc7cbfa);}}; \ No newline at end of file +var _0xaa1b=['emit','register','mailQueue:','./mailQueue.events','save','remove'];(function(_0x15653a,_0x54d78d){var _0x433cda=function(_0x29d2c5){while(--_0x29d2c5){_0x15653a['push'](_0x15653a['shift']());}};_0x433cda(++_0x54d78d);}(_0xaa1b,0x123));var _0xbaa1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa1b[_0x20a584];return _0x4b41a8;};'use strict';var MailQueueEvents=require(_0xbaa1('0x0'));var events=[_0xbaa1('0x1'),_0xbaa1('0x2'),'update'];function createListener(_0x1258d9,_0x51926c){return function(_0x2593cc){_0x51926c[_0xbaa1('0x3')](_0x1258d9,_0x2593cc);};}function removeListener(_0x4b125f,_0x5f145a){return function(){MailQueueEvents['removeListener'](_0x4b125f,_0x5f145a);};}exports[_0xbaa1('0x4')]=function(_0x27b99c){for(var _0x4a5735=0x0,_0x22516a=events['length'];_0x4a5735<_0x22516a;_0x4a5735++){var _0x364ce9=events[_0x4a5735];var _0x15b968=createListener(_0xbaa1('0x5')+_0x364ce9,_0x27b99c);MailQueueEvents['on'](_0x364ce9,_0x15b968);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index b2261bb..2250671 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 _0x4bbb=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','update','delete','multer','path','connect-timeout','Router'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x4bbb,0x13f));var _0xb4bb=function(_0x2d4b37,_0x4b9db7){_0x2d4b37=_0x2d4b37-0x0;var _0x71683c=_0x4bbb[_0x2d4b37];return _0x71683c;};'use strict';var multer=require(_0xb4bb('0x0'));var util=require('util');var path=require(_0xb4bb('0x1'));var timeout=require(_0xb4bb('0x2'));var express=require('express');var router=express[_0xb4bb('0x3')]();var fs_extra=require(_0xb4bb('0x4'));var auth=require(_0xb4bb('0x5'));var interaction=require(_0xb4bb('0x6'));var config=require(_0xb4bb('0x7'));var controller=require(_0xb4bb('0x8'));router[_0xb4bb('0x9')]('/',auth[_0xb4bb('0xa')](),controller[_0xb4bb('0xb')]);router[_0xb4bb('0x9')](_0xb4bb('0xc'),auth['isAuthenticated'](),controller[_0xb4bb('0xd')]);router['get'](_0xb4bb('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xb4bb('0xf')]);router[_0xb4bb('0x10')]('/:id',auth[_0xb4bb('0xa')](),controller[_0xb4bb('0x11')]);router[_0xb4bb('0x12')]('/:id',auth[_0xb4bb('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd972=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','index','/describe','isAuthenticated','describe','show','create','/:id','update','delete','destroy','multer','util','connect-timeout'];(function(_0x37c0e9,_0x272b52){var _0x7e5197=function(_0x550111){while(--_0x550111){_0x37c0e9['push'](_0x37c0e9['shift']());}};_0x7e5197(++_0x272b52);}(_0xd972,0x1cb));var _0x2d97=function(_0x1e3f47,_0x52c43a){_0x1e3f47=_0x1e3f47-0x0;var _0x4c99f0=_0xd972[_0x1e3f47];return _0x4c99f0;};'use strict';var multer=require(_0x2d97('0x0'));var util=require(_0x2d97('0x1'));var path=require('path');var timeout=require(_0x2d97('0x2'));var express=require(_0x2d97('0x3'));var router=express[_0x2d97('0x4')]();var fs_extra=require(_0x2d97('0x5'));var auth=require(_0x2d97('0x6'));var interaction=require(_0x2d97('0x7'));var config=require(_0x2d97('0x8'));var controller=require(_0x2d97('0x9'));router[_0x2d97('0xa')]('/',auth['isAuthenticated'](),controller[_0x2d97('0xb')]);router['get'](_0x2d97('0xc'),auth[_0x2d97('0xd')](),controller[_0x2d97('0xe')]);router['get']('/:id',auth[_0x2d97('0xd')](),controller[_0x2d97('0xf')]);router['post']('/',auth[_0x2d97('0xd')](),controller[_0x2d97('0x10')]);router['put'](_0x2d97('0x11'),auth[_0x2d97('0xd')](),controller[_0x2d97('0x12')]);router[_0x2d97('0x13')]('/:id',auth[_0x2d97('0xd')](),controller[_0x2d97('0x14')]);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 d4311d3..05b903f 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 _0x1019=['exports','STRING','DATE','moment','sequelize'];(function(_0x47d5af,_0x1e2ffc){var _0x3ebc0e=function(_0x15a1a9){while(--_0x15a1a9){_0x47d5af['push'](_0x47d5af['shift']());}};_0x3ebc0e(++_0x1e2ffc);}(_0x1019,0xee));var _0x9101=function(_0x50fc90,_0x5ea05f){_0x50fc90=_0x50fc90-0x0;var _0x1b1eef=_0x1019[_0x50fc90];return _0x1b1eef;};'use strict';var moment=require(_0x9101('0x0'));var Sequelize=require(_0x9101('0x1'));module[_0x9101('0x2')]={'uniqueid':{'type':Sequelize[_0x9101('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9101('0x3')]},'joinAt':{'type':Sequelize[_0x9101('0x4')]},'leaveAt':{'type':Sequelize[_0x9101('0x4')]},'acceptAt':{'type':Sequelize[_0x9101('0x4')]},'exitAt':{'type':Sequelize[_0x9101('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x26aa=['STRING','DATE','sequelize','exports'];(function(_0x2cd011,_0x37aa42){var _0x3fa4b8=function(_0x2e49b4){while(--_0x2e49b4){_0x2cd011['push'](_0x2cd011['shift']());}};_0x3fa4b8(++_0x37aa42);}(_0x26aa,0xa2));var _0xa26a=function(_0x11b951,_0x44e3bb){_0x11b951=_0x11b951-0x0;var _0x1b5ccb=_0x26aa[_0x11b951];return _0x1b5ccb;};'use strict';var moment=require('moment');var Sequelize=require(_0xa26a('0x0'));module[_0xa26a('0x1')]={'uniqueid':{'type':Sequelize[_0xa26a('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xa26a('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xa26a('0x3')]},'acceptAt':{'type':Sequelize[_0xa26a('0x3')]},'exitAt':{'type':Sequelize[_0xa26a('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index f69e94e..17f0942 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 _0x896e=['hasOwnProperty','nolimit','order','sort','where','merge','filter','MailQueueReport','includeAll','include','findAll','rows','catch','keys','length','options','find','create','body','params','describe','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','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','then','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x896e,0x1e9));var _0xe896=function(_0x12bdf4,_0x4e17a8){_0x12bdf4=_0x12bdf4-0x0;var _0xc9851=_0x896e[_0x12bdf4];return _0xc9851;};'use strict';var emlformat=require(_0xe896('0x0'));var rimraf=require(_0xe896('0x1'));var zipdir=require(_0xe896('0x2'));var jsonpatch=require(_0xe896('0x3'));var rp=require(_0xe896('0x4'));var moment=require(_0xe896('0x5'));var BPromise=require(_0xe896('0x6'));var Mustache=require(_0xe896('0x7'));var util=require(_0xe896('0x8'));var path=require(_0xe896('0x9'));var sox=require(_0xe896('0xa'));var csv=require(_0xe896('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe896('0xc'));var _=require(_0xe896('0xd'));var squel=require(_0xe896('0xe'));var crypto=require(_0xe896('0xf'));var jsforce=require(_0xe896('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe896('0xb'));var querystring=require(_0xe896('0x11'));var Papa=require(_0xe896('0x12'));var Redis=require('ioredis');var authService=require(_0xe896('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe896('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe896('0x15'))(_0xe896('0x16'));var utils=require(_0xe896('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe896('0x18'));var db=require(_0xe896('0x19'))['db'];function respondWithStatusCode(_0x3e8ac9,_0x580aac){_0x580aac=_0x580aac||0xcc;return function(_0x2aa522){if(_0x2aa522){return _0x3e8ac9[_0xe896('0x1a')](_0x580aac);}return _0x3e8ac9[_0xe896('0x1b')](_0x580aac)['end']();};}function respondWithResult(_0x2d0e46,_0x7dcf8a){_0x7dcf8a=_0x7dcf8a||0xc8;return function(_0x1e7ef8){if(_0x1e7ef8){return _0x2d0e46['status'](_0x7dcf8a)['json'](_0x1e7ef8);}};}function respondWithFilteredResult(_0x446ce2,_0x25606b){return function(_0x51e7b7){if(_0x51e7b7){var _0x5e78d6=typeof _0x25606b[_0xe896('0x1c')]===_0xe896('0x1d')&&typeof _0x25606b['limit']===_0xe896('0x1d');var _0x4e062a=_0x51e7b7[_0xe896('0x1e')];var _0x32f86d=_0x5e78d6?0x0:_0x25606b[_0xe896('0x1c')];var _0x5dc89d=_0x5e78d6?_0x51e7b7[_0xe896('0x1e')]:_0x25606b[_0xe896('0x1c')]+_0x25606b[_0xe896('0x1f')];var _0xbebbe1;if(_0x5dc89d>=_0x4e062a){_0x5dc89d=_0x4e062a;_0xbebbe1=0xc8;}else{_0xbebbe1=0xce;}_0x446ce2[_0xe896('0x1b')](_0xbebbe1);return _0x446ce2[_0xe896('0x20')](_0xe896('0x21'),_0x32f86d+'-'+_0x5dc89d+'/'+_0x4e062a)[_0xe896('0x22')](_0x51e7b7);}return null;};}function patchUpdates(_0x49547b){return function(_0x180d46){try{jsonpatch['apply'](_0x180d46,_0x49547b,!![]);}catch(_0x5d2c8d){return BPromise[_0xe896('0x23')](_0x5d2c8d);}return _0x180d46[_0xe896('0x24')]();};}function saveUpdates(_0x40502b,_0xeeec7c){return function(_0x498469){if(_0x498469){return _0x498469[_0xe896('0x25')](_0x40502b)['then'](function(_0x5001f7){return _0x5001f7;});}return null;};}function removeEntity(_0x45dd49,_0x41e689){return function(_0x1e952a){if(_0x1e952a){return _0x1e952a[_0xe896('0x26')]()[_0xe896('0x27')](function(){_0x45dd49[_0xe896('0x1b')](0xcc)[_0xe896('0x28')]();});}};}function handleEntityNotFound(_0x4b71cc,_0x390128){return function(_0x163a75){if(!_0x163a75){_0x4b71cc[_0xe896('0x1a')](0x194);}return _0x163a75;};}function handleError(_0x569d5f,_0x26635e){_0x26635e=_0x26635e||0x1f4;return function(_0xd50fe2){logger[_0xe896('0x29')](_0xd50fe2[_0xe896('0x2a')]);if(_0xd50fe2[_0xe896('0x2b')]){delete _0xd50fe2[_0xe896('0x2b')];}_0x569d5f['status'](_0x26635e)[_0xe896('0x2c')](_0xd50fe2);};}exports[_0xe896('0x2d')]=function(_0x201653,_0xbfb15b){var _0xace03f={},_0x5e0d9b={},_0x47c268={'count':0x0,'rows':[]};var _0x5c7dae=_['map'](db['MailQueueReport'][_0xe896('0x2e')],function(_0x29a18e){return{'name':_0x29a18e[_0xe896('0x2f')],'type':_0x29a18e[_0xe896('0x30')][_0xe896('0x31')]};});_0x5e0d9b[_0xe896('0x32')]=_[_0xe896('0x33')](_0x5c7dae,_0xe896('0x2b'));_0x5e0d9b['query']=_['keys'](_0x201653[_0xe896('0x34')]);_0x5e0d9b[_0xe896('0x35')]=_[_0xe896('0x36')](_0x5e0d9b[_0xe896('0x32')],_0x5e0d9b['query']);_0xace03f[_0xe896('0x37')]=_['intersection'](_0x5e0d9b['model'],qs[_0xe896('0x38')](_0x201653[_0xe896('0x34')][_0xe896('0x38')]));_0xace03f['attributes']=_0xace03f['attributes']['length']?_0xace03f[_0xe896('0x37')]:_0x5e0d9b[_0xe896('0x32')];if(!_0x201653[_0xe896('0x34')][_0xe896('0x39')](_0xe896('0x3a'))){_0xace03f['limit']=qs[_0xe896('0x1f')](_0x201653[_0xe896('0x34')][_0xe896('0x1f')]);_0xace03f[_0xe896('0x1c')]=qs[_0xe896('0x1c')](_0x201653[_0xe896('0x34')][_0xe896('0x1c')]);}_0xace03f[_0xe896('0x3b')]=qs['sort'](_0x201653[_0xe896('0x34')][_0xe896('0x3c')]);_0xace03f['where']=qs[_0xe896('0x35')](_['pick'](_0x201653[_0xe896('0x34')],_0x5e0d9b['filters']),_0x5c7dae);if(_0x201653[_0xe896('0x34')]['filter']){_0xace03f[_0xe896('0x3d')]=_[_0xe896('0x3e')](_0xace03f[_0xe896('0x3d')],{'$or':_[_0xe896('0x33')](_0x5c7dae,function(_0xeb9bbf){if(_0xeb9bbf['type']!=='VIRTUAL'){var _0x203aea={};_0x203aea[_0xeb9bbf[_0xe896('0x2b')]]={'$like':'%'+_0x201653[_0xe896('0x34')][_0xe896('0x3f')]+'%'};return _0x203aea;}})});}_0xace03f=_[_0xe896('0x3e')]({},_0xace03f,_0x201653['options']);var _0x5b8131={'where':_0xace03f[_0xe896('0x3d')]};return db[_0xe896('0x40')]['count'](_0x5b8131)['then'](function(_0x19d2fd){_0x47c268[_0xe896('0x1e')]=_0x19d2fd;if(_0x201653[_0xe896('0x34')][_0xe896('0x41')]){_0xace03f[_0xe896('0x42')]=[{'all':!![]}];}return db[_0xe896('0x40')][_0xe896('0x43')](_0xace03f);})[_0xe896('0x27')](function(_0x372c71){_0x47c268[_0xe896('0x44')]=_0x372c71;return _0x47c268;})[_0xe896('0x27')](respondWithFilteredResult(_0xbfb15b,_0xace03f))[_0xe896('0x45')](handleError(_0xbfb15b,null));};exports['show']=function(_0x1e5434,_0x143ad4){var _0x59b97f={'raw':!![],'where':{'id':_0x1e5434['params']['id']}},_0x57366b={};_0x57366b[_0xe896('0x32')]=_[_0xe896('0x46')](db[_0xe896('0x40')]['rawAttributes']);_0x57366b[_0xe896('0x34')]=_[_0xe896('0x46')](_0x1e5434['query']);_0x57366b['filters']=_['intersection'](_0x57366b[_0xe896('0x32')],_0x57366b[_0xe896('0x34')]);_0x59b97f[_0xe896('0x37')]=_[_0xe896('0x36')](_0x57366b[_0xe896('0x32')],qs[_0xe896('0x38')](_0x1e5434['query'][_0xe896('0x38')]));_0x59b97f[_0xe896('0x37')]=_0x59b97f['attributes'][_0xe896('0x47')]?_0x59b97f[_0xe896('0x37')]:_0x57366b[_0xe896('0x32')];if(_0x1e5434[_0xe896('0x34')]['includeAll']){_0x59b97f[_0xe896('0x42')]=[{'all':!![]}];}_0x59b97f=_[_0xe896('0x3e')]({},_0x59b97f,_0x1e5434[_0xe896('0x48')]);return db[_0xe896('0x40')][_0xe896('0x49')](_0x59b97f)[_0xe896('0x27')](handleEntityNotFound(_0x143ad4,null))['then'](respondWithResult(_0x143ad4,null))[_0xe896('0x45')](handleError(_0x143ad4,null));};exports['create']=function(_0x234a22,_0x1c6ae1){return db[_0xe896('0x40')][_0xe896('0x4a')](_0x234a22[_0xe896('0x4b')],{})[_0xe896('0x27')](respondWithResult(_0x1c6ae1,0xc9))['catch'](handleError(_0x1c6ae1,null));};exports[_0xe896('0x25')]=function(_0x206ad3,_0x4818cd){if(_0x206ad3[_0xe896('0x4b')]['id']){delete _0x206ad3[_0xe896('0x4b')]['id'];}return db['MailQueueReport'][_0xe896('0x49')]({'where':{'id':_0x206ad3['params']['id']}})[_0xe896('0x27')](handleEntityNotFound(_0x4818cd,null))[_0xe896('0x27')](saveUpdates(_0x206ad3[_0xe896('0x4b')],null))[_0xe896('0x27')](respondWithResult(_0x4818cd,null))[_0xe896('0x45')](handleError(_0x4818cd,null));};exports['destroy']=function(_0x1fa3fd,_0x819c8a){return db[_0xe896('0x40')]['find']({'where':{'id':_0x1fa3fd[_0xe896('0x4c')]['id']}})['then'](handleEntityNotFound(_0x819c8a,null))['then'](removeEntity(_0x819c8a,null))[_0xe896('0x45')](handleError(_0x819c8a,null));};exports[_0xe896('0x4d')]=function(_0x57aed3,_0x343adb){return db[_0xe896('0x40')]['describe']()['then'](respondWithResult(_0x343adb,null))[_0xe896('0x45')](handleError(_0x343adb,null));}; \ No newline at end of file +var _0x5f66=['bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','MailQueueReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body','update','catch','describe','rimraf','fast-json-patch','request-promise','moment'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x5f66,0x1a0));var _0x65f6=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x5f66[_0xefd519];return _0x4bb882;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':!![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['MailQueueReport'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));};exports[_0x65f6('0x45')]=function(_0x3b241f,_0x1ca67e){return db['MailQueueReport'][_0x65f6('0x45')]()[_0x65f6('0x21')](respondWithResult(_0x1ca67e,null))['catch'](handleError(_0x1ca67e,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 4f49eb4..d7e98e5 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 _0x99f3=['path','rimraf','../../config/environment','exports','define','report_mail_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x48e1ec,_0x35f468){var _0x3b33eb=function(_0x507bf9){while(--_0x507bf9){_0x48e1ec['push'](_0x48e1ec['shift']());}};_0x3b33eb(++_0x35f468);}(_0x99f3,0xbd));var _0x399f=function(_0x803ae0,_0x5c5f30){_0x803ae0=_0x803ae0-0x0;var _0x3c38b1=_0x99f3[_0x803ae0];return _0x3c38b1;};'use strict';var _=require('lodash');var util=require(_0x399f('0x0'));var logger=require(_0x399f('0x1'))(_0x399f('0x2'));var moment=require(_0x399f('0x3'));var BPromise=require(_0x399f('0x4'));var rp=require(_0x399f('0x5'));var fs=require('fs');var path=require(_0x399f('0x6'));var rimraf=require(_0x399f('0x7'));var config=require(_0x399f('0x8'));var attributes=require('./mailQueueReport.attributes');module[_0x399f('0x9')]=function(_0xb36e97,_0x250ef8){return _0xb36e97[_0x399f('0xa')]('MailQueueReport',attributes,{'tableName':_0x399f('0xb'),'paranoid':![],'indexes':[{'name':_0x399f('0xc'),'fields':[_0x399f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5c4f=['request-promise','path','rimraf','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','bluebird'];(function(_0x4090cd,_0x2aa3a8){var _0x2003a4=function(_0x4a5499){while(--_0x4a5499){_0x4090cd['push'](_0x4090cd['shift']());}};_0x2003a4(++_0x2aa3a8);}(_0x5c4f,0x64));var _0xf5c4=function(_0x3440ab,_0x44b193){_0x3440ab=_0x3440ab-0x0;var _0x1f62f6=_0x5c4f[_0x3440ab];return _0x1f62f6;};'use strict';var _=require(_0xf5c4('0x0'));var util=require(_0xf5c4('0x1'));var logger=require(_0xf5c4('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf5c4('0x3'));var rp=require(_0xf5c4('0x4'));var fs=require('fs');var path=require(_0xf5c4('0x5'));var rimraf=require(_0xf5c4('0x6'));var config=require('../../config/environment');var attributes=require(_0xf5c4('0x7'));module[_0xf5c4('0x8')]=function(_0x35e939,_0x359cba){return _0x35e939[_0xf5c4('0x9')](_0xf5c4('0xa'),attributes,{'tableName':_0xf5c4('0xb'),'paranoid':![],'indexes':[{'name':_0xf5c4('0xc'),'fields':[_0xf5c4('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index d17ad0d..854c66d 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 _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x522687,_0x270d4f){var _0x5558ed=function(_0x8adf51){while(--_0x8adf51){_0x522687['push'](_0x522687['shift']());}};_0x5558ed(++_0x270d4f);}(_0x326f,0xd1));var _0xf326=function(_0x317188,_0x5047c2){_0x317188=_0x317188-0x0;var _0x158843=_0x326f[_0x317188];return _0x158843;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});}; \ No newline at end of file +var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x5477f2,_0x1a375b){var _0x438901=function(_0x46c7dc){while(--_0x46c7dc){_0x5477f2['push'](_0x5477f2['shift']());}};_0x438901(++_0x1a375b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xc4aa[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 8e4e696..68123b4 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1112c7,_0xc7e6ae){var _0x513788=function(_0x3f1a27){while(--_0x3f1a27){_0x1112c7['push'](_0x1112c7['shift']());}};_0x513788(++_0xc7e6ae);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2d91c6,_0x10ae0e){_0x2d91c6=_0x2d91c6-0x0;var _0x3a8d19=_0xcb91[_0x2d91c6];return _0x3a8d19;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3ac475,_0xb279cf){var _0x970784=function(_0x47ea76){while(--_0x47ea76){_0x3ac475['push'](_0x3ac475['shift']());}};_0x970784(++_0xb279cf);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xcb91[_0x4b369d];return _0x571a98;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index a7a1e34..feb5deb 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 _0x8f59=['BOOLEAN','INTEGER','INBOX','sequelize','exports','STRING'];(function(_0x2c671c,_0x16a12c){var _0x276d78=function(_0x4e2881){while(--_0x4e2881){_0x2c671c['push'](_0x2c671c['shift']());}};_0x276d78(++_0x16a12c);}(_0x8f59,0x11d));var _0x98f5=function(_0x483e4a,_0x32aa45){_0x483e4a=_0x483e4a-0x0;var _0x31fba5=_0x8f59[_0x483e4a];return _0x31fba5;};'use strict';var Sequelize=require(_0x98f5('0x0'));module[_0x98f5('0x1')]={'description':{'type':Sequelize[_0x98f5('0x2')]},'host':{'type':Sequelize[_0x98f5('0x2')]},'authentication':{'type':Sequelize[_0x98f5('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x98f5('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x98f5('0x4')]},'tls':{'type':Sequelize[_0x98f5('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x98f5('0x2')],'defaultValue':_0x98f5('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x98f5('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x98f5('0x2')]}}; \ No newline at end of file +var _0xc36d=['exports','STRING','BOOLEAN','INTEGER','INBOX','sequelize'];(function(_0x4873a8,_0x42202f){var _0x3f850d=function(_0x1f4c73){while(--_0x1f4c73){_0x4873a8['push'](_0x4873a8['shift']());}};_0x3f850d(++_0x42202f);}(_0xc36d,0x7d));var _0xdc36=function(_0x3ee9b2,_0xa090bb){_0x3ee9b2=_0x3ee9b2-0x0;var _0x51ac3e=_0xc36d[_0x3ee9b2];return _0x51ac3e;};'use strict';var Sequelize=require(_0xdc36('0x0'));module[_0xdc36('0x1')]={'description':{'type':Sequelize[_0xdc36('0x2')]},'host':{'type':Sequelize[_0xdc36('0x2')]},'authentication':{'type':Sequelize[_0xdc36('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xdc36('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xdc36('0x4')]},'tls':{'type':Sequelize[_0xdc36('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xdc36('0x5')},'connTimeout':{'type':Sequelize[_0xdc36('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xdc36('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xdc36('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index a36fc03..8f3388a 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 _0x68a9=['mail_servers_in','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn'];(function(_0x471fed,_0x815c59){var _0x55e0ab=function(_0x30e222){while(--_0x30e222){_0x471fed['push'](_0x471fed['shift']());}};_0x55e0ab(++_0x815c59);}(_0x68a9,0x11e));var _0x968a=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x68a9[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require(_0x968a('0x0'));var util=require(_0x968a('0x1'));var logger=require(_0x968a('0x2'))(_0x968a('0x3'));var moment=require(_0x968a('0x4'));var BPromise=require(_0x968a('0x5'));var rp=require(_0x968a('0x6'));var fs=require('fs');var path=require(_0x968a('0x7'));var rimraf=require(_0x968a('0x8'));var config=require(_0x968a('0x9'));var attributes=require(_0x968a('0xa'));module[_0x968a('0xb')]=function(_0x4fe4de,_0x4650f8){return _0x4fe4de[_0x968a('0xc')](_0x968a('0xd'),attributes,{'tableName':_0x968a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a59=['./mailServerIn.attributes','exports','define','MailServerIn','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x315f77,_0xd66d2a){var _0x1a97cd=function(_0x205e93){while(--_0x205e93){_0x315f77['push'](_0x315f77['shift']());}};_0x1a97cd(++_0xd66d2a);}(_0x8a59,0x70));var _0x98a5=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x8a59[_0xbb091];return _0x467a04;};'use strict';var _=require('lodash');var util=require(_0x98a5('0x0'));var logger=require(_0x98a5('0x1'))(_0x98a5('0x2'));var moment=require('moment');var BPromise=require(_0x98a5('0x3'));var rp=require(_0x98a5('0x4'));var fs=require('fs');var path=require(_0x98a5('0x5'));var rimraf=require(_0x98a5('0x6'));var config=require(_0x98a5('0x7'));var attributes=require(_0x98a5('0x8'));module[_0x98a5('0x9')]=function(_0x18d698,_0x3d6934){return _0x18d698[_0x98a5('0xa')](_0x98a5('0xb'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index ca86a3f..1529032 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 _0x8ec1=['request\x20sent','debug','stringify','error','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','attributes','limit','map','include','model','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','info','MailServerIn,\x20%s,\x20%s'];(function(_0x46bce5,_0x2664f5){var _0x555f74=function(_0x41472d){while(--_0x41472d){_0x46bce5['push'](_0x46bce5['shift']());}};_0x555f74(++_0x2664f5);}(_0x8ec1,0x1e3));var _0x18ec=function(_0x7655ab,_0x18066f){_0x7655ab=_0x7655ab-0x0;var _0x2b0e88=_0x8ec1[_0x7655ab];return _0x2b0e88;};'use strict';var _=require('lodash');var util=require(_0x18ec('0x0'));var moment=require(_0x18ec('0x1'));var BPromise=require(_0x18ec('0x2'));var rs=require(_0x18ec('0x3'));var fs=require('fs');var Redis=require(_0x18ec('0x4'));var db=require(_0x18ec('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x18ec('0x6'));var config=require(_0x18ec('0x7'));var jayson=require(_0x18ec('0x8'));var client=jayson['client'][_0x18ec('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17e4f3,_0x342fb2,_0x1c8f34){return new BPromise(function(_0x2c4be2,_0x238d10){return client[_0x18ec('0xa')](_0x17e4f3,_0x1c8f34)['then'](function(_0x19dc98){logger[_0x18ec('0xb')](_0x18ec('0xc'),_0x342fb2,_0x18ec('0xd'));logger[_0x18ec('0xe')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x342fb2,'request\x20sent',JSON[_0x18ec('0xf')](_0x19dc98));if(_0x19dc98[_0x18ec('0x10')]){if(_0x19dc98[_0x18ec('0x10')]['code']===0x1f4){logger[_0x18ec('0x10')]('MailServerIn,\x20%s,\x20%s',_0x342fb2,_0x19dc98[_0x18ec('0x10')]['message']);return _0x238d10(_0x19dc98['error']['message']);}logger[_0x18ec('0x10')](_0x18ec('0xc'),_0x342fb2,_0x19dc98[_0x18ec('0x10')][_0x18ec('0x11')]);return _0x2c4be2(_0x19dc98[_0x18ec('0x10')][_0x18ec('0x11')]);}else{logger[_0x18ec('0xb')]('MailServerIn,\x20%s,\x20%s',_0x342fb2,'request\x20sent');_0x2c4be2(_0x19dc98[_0x18ec('0x12')][_0x18ec('0x11')]);}})[_0x18ec('0x13')](function(_0x5d872e){logger[_0x18ec('0x10')](_0x18ec('0xc'),_0x342fb2,_0x5d872e);_0x238d10(_0x5d872e);});});}exports[_0x18ec('0x14')]=function(_0x53f9ce){var _0x43de91=this;return new Promise(function(_0x5c4bed,_0x1edbe0){return db[_0x18ec('0x15')][_0x18ec('0x16')]({'raw':_0x53f9ce[_0x18ec('0x17')]?_0x53f9ce[_0x18ec('0x17')][_0x18ec('0x18')]===undefined?!![]:![]:!![],'where':_0x53f9ce[_0x18ec('0x17')]?_0x53f9ce[_0x18ec('0x17')]['where']||null:null,'attributes':_0x53f9ce[_0x18ec('0x17')]?_0x53f9ce[_0x18ec('0x17')][_0x18ec('0x19')]||null:null,'limit':_0x53f9ce[_0x18ec('0x17')]?_0x53f9ce[_0x18ec('0x17')][_0x18ec('0x1a')]||null:null,'include':_0x53f9ce[_0x18ec('0x17')]?_0x53f9ce['options']['include']?_[_0x18ec('0x1b')](_0x53f9ce[_0x18ec('0x17')][_0x18ec('0x1c')],function(_0x2caf29){return{'model':db[_0x2caf29['model']],'as':_0x2caf29['as'],'attributes':_0x2caf29[_0x18ec('0x19')],'include':_0x2caf29['include']?_[_0x18ec('0x1b')](_0x2caf29[_0x18ec('0x1c')],function(_0x4a395c){return{'model':db[_0x4a395c[_0x18ec('0x1d')]],'as':_0x4a395c['as'],'attributes':_0x4a395c[_0x18ec('0x19')],'include':_0x4a395c[_0x18ec('0x1c')]?_[_0x18ec('0x1b')](_0x4a395c[_0x18ec('0x1c')],function(_0x2f701a){return{'model':db[_0x2f701a[_0x18ec('0x1d')]],'as':_0x2f701a['as'],'attributes':_0x2f701a['attributes']};}):[]};}):[]};}):[]:[]})[_0x18ec('0x1e')](function(_0x4ec03d){logger[_0x18ec('0xb')](_0x18ec('0x14'),_0x53f9ce);logger[_0x18ec('0xe')](_0x18ec('0x14'),_0x53f9ce,JSON[_0x18ec('0xf')](_0x4ec03d));_0x5c4bed(_0x4ec03d);})[_0x18ec('0x13')](function(_0x33f151){logger[_0x18ec('0x10')]('GetMailServerIn',_0x33f151[_0x18ec('0x11')],_0x53f9ce);_0x1edbe0(_0x43de91[_0x18ec('0x10')](0x1f4,_0x33f151[_0x18ec('0x11')]));});});}; \ No newline at end of file +var _0xf2a9=['../../config/utils','../../config/logger','rpc','jayson/promise','request','then','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','MailServerIn,\x20%s,\x20%s','findAll','options','raw','where','attributes','model','include','map','GetMailServerIn','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x3e0763,_0x3d12be){var _0x351ca2=function(_0x9beae7){while(--_0x9beae7){_0x3e0763['push'](_0x3e0763['shift']());}};_0x351ca2(++_0x3d12be);}(_0xf2a9,0x77));var _0x9f2a=function(_0x1f53c1,_0x3519da){_0x1f53c1=_0x1f53c1-0x0;var _0x553fe3=_0xf2a9[_0x1f53c1];return _0x553fe3;};'use strict';var _=require('lodash');var util=require(_0x9f2a('0x0'));var moment=require(_0x9f2a('0x1'));var BPromise=require(_0x9f2a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9f2a('0x3'));var db=require(_0x9f2a('0x4'))['db'];var utils=require(_0x9f2a('0x5'));var logger=require(_0x9f2a('0x6'))(_0x9f2a('0x7'));var config=require('../../config/environment');var jayson=require(_0x9f2a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4592ae,_0x4d37e5,_0x294244){return new BPromise(function(_0x236eee,_0x46fb11){return client[_0x9f2a('0x9')](_0x4592ae,_0x294244)[_0x9f2a('0xa')](function(_0x32a607){logger['info']('MailServerIn,\x20%s,\x20%s',_0x4d37e5,_0x9f2a('0xb'));logger[_0x9f2a('0xc')](_0x9f2a('0xd'),_0x4d37e5,'request\x20sent',JSON[_0x9f2a('0xe')](_0x32a607));if(_0x32a607[_0x9f2a('0xf')]){if(_0x32a607[_0x9f2a('0xf')][_0x9f2a('0x10')]===0x1f4){logger[_0x9f2a('0xf')]('MailServerIn,\x20%s,\x20%s',_0x4d37e5,_0x32a607[_0x9f2a('0xf')][_0x9f2a('0x11')]);return _0x46fb11(_0x32a607[_0x9f2a('0xf')][_0x9f2a('0x11')]);}logger['error']('MailServerIn,\x20%s,\x20%s',_0x4d37e5,_0x32a607['error'][_0x9f2a('0x11')]);return _0x236eee(_0x32a607[_0x9f2a('0xf')][_0x9f2a('0x11')]);}else{logger[_0x9f2a('0x12')]('MailServerIn,\x20%s,\x20%s',_0x4d37e5,_0x9f2a('0xb'));_0x236eee(_0x32a607[_0x9f2a('0x13')][_0x9f2a('0x11')]);}})[_0x9f2a('0x14')](function(_0x204fde){logger[_0x9f2a('0xf')](_0x9f2a('0x15'),_0x4d37e5,_0x204fde);_0x46fb11(_0x204fde);});});}exports['GetMailServerIn']=function(_0x1ca43d){var _0xe9ad0b=this;return new Promise(function(_0x22937a,_0x21fd6a){return db['MailServerIn'][_0x9f2a('0x16')]({'raw':_0x1ca43d[_0x9f2a('0x17')]?_0x1ca43d[_0x9f2a('0x17')][_0x9f2a('0x18')]===undefined?!![]:![]:!![],'where':_0x1ca43d[_0x9f2a('0x17')]?_0x1ca43d[_0x9f2a('0x17')][_0x9f2a('0x19')]||null:null,'attributes':_0x1ca43d['options']?_0x1ca43d['options'][_0x9f2a('0x1a')]||null:null,'limit':_0x1ca43d[_0x9f2a('0x17')]?_0x1ca43d[_0x9f2a('0x17')]['limit']||null:null,'include':_0x1ca43d[_0x9f2a('0x17')]?_0x1ca43d['options']['include']?_['map'](_0x1ca43d[_0x9f2a('0x17')]['include'],function(_0x5bcda3){return{'model':db[_0x5bcda3[_0x9f2a('0x1b')]],'as':_0x5bcda3['as'],'attributes':_0x5bcda3[_0x9f2a('0x1a')],'include':_0x5bcda3[_0x9f2a('0x1c')]?_[_0x9f2a('0x1d')](_0x5bcda3[_0x9f2a('0x1c')],function(_0x451782){return{'model':db[_0x451782[_0x9f2a('0x1b')]],'as':_0x451782['as'],'attributes':_0x451782['attributes'],'include':_0x451782[_0x9f2a('0x1c')]?_['map'](_0x451782[_0x9f2a('0x1c')],function(_0x51d8f8){return{'model':db[_0x51d8f8[_0x9f2a('0x1b')]],'as':_0x51d8f8['as'],'attributes':_0x51d8f8[_0x9f2a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9f2a('0xa')](function(_0x3427e1){logger[_0x9f2a('0x12')]('GetMailServerIn',_0x1ca43d);logger[_0x9f2a('0xc')](_0x9f2a('0x1e'),_0x1ca43d,JSON[_0x9f2a('0xe')](_0x3427e1));_0x22937a(_0x3427e1);})[_0x9f2a('0x14')](function(_0x165bb3){logger[_0x9f2a('0xf')](_0x9f2a('0x1e'),_0x165bb3[_0x9f2a('0x11')],_0x1ca43d);_0x21fd6a(_0xe9ad0b[_0x9f2a('0xf')](0x1f4,_0x165bb3['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index be8adeb..cbcc895 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(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x7a54,0x106));var _0x47a5=function(_0x5d96bd,_0x429bd3){_0x5d96bd=_0x5d96bd-0x0;var _0x1fa20b=_0x7a54[_0x5d96bd];return _0x1fa20b;};'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 f80d403..41f7427 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 _0xfc23=['STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x1b7b10,_0x1e3c3e){var _0x59357d=function(_0x1ed9dd){while(--_0x1ed9dd){_0x1b7b10['push'](_0x1b7b10['shift']());}};_0x59357d(++_0x1e3c3e);}(_0xfc23,0x10f));var _0x3fc2=function(_0x5c45ac,_0x171f70){_0x5c45ac=_0x5c45ac-0x0;var _0x17082e=_0xfc23[_0x5c45ac];return _0x17082e;};'use strict';var Sequelize=require(_0x3fc2('0x0'));module['exports']={'description':{'type':Sequelize[_0x3fc2('0x1')]},'host':{'type':Sequelize[_0x3fc2('0x1')]},'user':{'type':Sequelize[_0x3fc2('0x1')]},'pass':{'type':Sequelize[_0x3fc2('0x1')]},'port':{'type':Sequelize[_0x3fc2('0x2')]},'secure':{'type':Sequelize[_0x3fc2('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x3fc2('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x62a8=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x545b2f,_0x12c3bf){var _0x591f3f=function(_0x1c44c0){while(--_0x1c44c0){_0x545b2f['push'](_0x545b2f['shift']());}};_0x591f3f(++_0x12c3bf);}(_0x62a8,0x16b));var _0x862a=function(_0x26b6c5,_0x2aa2d7){_0x26b6c5=_0x26b6c5-0x0;var _0x1a5403=_0x62a8[_0x26b6c5];return _0x1a5403;};'use strict';var Sequelize=require(_0x862a('0x0'));module[_0x862a('0x1')]={'description':{'type':Sequelize[_0x862a('0x2')]},'host':{'type':Sequelize[_0x862a('0x2')]},'user':{'type':Sequelize[_0x862a('0x2')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x862a('0x3')]},'secure':{'type':Sequelize[_0x862a('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x862a('0x4')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 01e0c99..b2dcfe8 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 _0x903f=['filters','pick','merge','VIRTUAL','filter','include','rows','show','params','keys','options','find','catch','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x58ba23,_0x5d7631){var _0x1fc6af=function(_0x2acdfd){while(--_0x2acdfd){_0x58ba23['push'](_0x58ba23['shift']());}};_0x1fc6af(++_0x5d7631);}(_0x903f,0x1cc));var _0xf903=function(_0x26e996,_0x3fc7f9){_0x26e996=_0x26e996-0x0;var _0x4f2b6d=_0x903f[_0x26e996];return _0x4f2b6d;};'use strict';var emlformat=require(_0xf903('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf903('0x1'));var jsonpatch=require(_0xf903('0x2'));var rp=require(_0xf903('0x3'));var moment=require(_0xf903('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf903('0x5'));var util=require(_0xf903('0x6'));var path=require('path');var sox=require(_0xf903('0x7'));var csv=require(_0xf903('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf903('0x9'));var squel=require(_0xf903('0xa'));var crypto=require(_0xf903('0xb'));var jsforce=require(_0xf903('0xc'));var deskjs=require(_0xf903('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf903('0xe'));var Papa=require(_0xf903('0xf'));var Redis=require('ioredis');var authService=require(_0xf903('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf903('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf903('0x12'))(_0xf903('0x13'));var utils=require(_0xf903('0x14'));var config=require(_0xf903('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf903('0x16'))['db'];function respondWithStatusCode(_0x120dde,_0x6d9e11){_0x6d9e11=_0x6d9e11||0xcc;return function(_0x1fa344){if(_0x1fa344){return _0x120dde[_0xf903('0x17')](_0x6d9e11);}return _0x120dde['status'](_0x6d9e11)[_0xf903('0x18')]();};}function respondWithResult(_0x7d29db,_0x2a3b7c){_0x2a3b7c=_0x2a3b7c||0xc8;return function(_0x21ecca){if(_0x21ecca){return _0x7d29db['status'](_0x2a3b7c)[_0xf903('0x19')](_0x21ecca);}};}function respondWithFilteredResult(_0x2a9e18,_0x30fec2){return function(_0x48bc9d){if(_0x48bc9d){var _0x13bb7a=typeof _0x30fec2[_0xf903('0x1a')]===_0xf903('0x1b')&&typeof _0x30fec2[_0xf903('0x1c')]==='undefined';var _0x28d704=_0x48bc9d[_0xf903('0x1d')];var _0x3db8e4=_0x13bb7a?0x0:_0x30fec2[_0xf903('0x1a')];var _0xcfee2a=_0x13bb7a?_0x48bc9d['count']:_0x30fec2[_0xf903('0x1a')]+_0x30fec2['limit'];var _0x3d32f0;if(_0xcfee2a>=_0x28d704){_0xcfee2a=_0x28d704;_0x3d32f0=0xc8;}else{_0x3d32f0=0xce;}_0x2a9e18[_0xf903('0x1e')](_0x3d32f0);return _0x2a9e18[_0xf903('0x1f')](_0xf903('0x20'),_0x3db8e4+'-'+_0xcfee2a+'/'+_0x28d704)[_0xf903('0x19')](_0x48bc9d);}return null;};}function patchUpdates(_0x17e3cd){return function(_0x4e9e5e){try{jsonpatch[_0xf903('0x21')](_0x4e9e5e,_0x17e3cd,!![]);}catch(_0x186b45){return BPromise[_0xf903('0x22')](_0x186b45);}return _0x4e9e5e[_0xf903('0x23')]();};}function saveUpdates(_0x5d2272,_0x589706){return function(_0x1162d1){if(_0x1162d1){return _0x1162d1[_0xf903('0x24')](_0x5d2272)[_0xf903('0x25')](function(_0x15bd1c){return _0x15bd1c;});}return null;};}function removeEntity(_0x2c7073,_0x1e5b8d){return function(_0x35e5ba){if(_0x35e5ba){return _0x35e5ba['destroy']()[_0xf903('0x25')](function(){_0x2c7073[_0xf903('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x419f41,_0x1982c2){return function(_0x26822b){if(!_0x26822b){_0x419f41[_0xf903('0x17')](0x194);}return _0x26822b;};}function handleError(_0x4c6a14,_0x19ae6c){_0x19ae6c=_0x19ae6c||0x1f4;return function(_0x57fb03){logger['error'](_0x57fb03['stack']);if(_0x57fb03['name']){delete _0x57fb03[_0xf903('0x26')];}_0x4c6a14[_0xf903('0x1e')](_0x19ae6c)[_0xf903('0x27')](_0x57fb03);};}exports[_0xf903('0x28')]=function(_0x374e2d,_0x175f7f){var _0x4fd91d={},_0x355528={},_0x2adfa7={'count':0x0,'rows':[]};var _0x44595d=_[_0xf903('0x29')](db[_0xf903('0x2a')][_0xf903('0x2b')],function(_0x3a2c87){return{'name':_0x3a2c87[_0xf903('0x2c')],'type':_0x3a2c87[_0xf903('0x2d')][_0xf903('0x2e')]};});_0x355528[_0xf903('0x2f')]=_['map'](_0x44595d,'name');_0x355528[_0xf903('0x30')]=_['keys'](_0x374e2d[_0xf903('0x30')]);_0x355528['filters']=_[_0xf903('0x31')](_0x355528[_0xf903('0x2f')],_0x355528[_0xf903('0x30')]);_0x4fd91d[_0xf903('0x32')]=_[_0xf903('0x31')](_0x355528['model'],qs[_0xf903('0x33')](_0x374e2d['query'][_0xf903('0x33')]));_0x4fd91d[_0xf903('0x32')]=_0x4fd91d[_0xf903('0x32')][_0xf903('0x34')]?_0x4fd91d['attributes']:_0x355528[_0xf903('0x2f')];if(!_0x374e2d[_0xf903('0x30')][_0xf903('0x35')](_0xf903('0x36'))){_0x4fd91d[_0xf903('0x1c')]=qs[_0xf903('0x1c')](_0x374e2d[_0xf903('0x30')]['limit']);_0x4fd91d[_0xf903('0x1a')]=qs[_0xf903('0x1a')](_0x374e2d[_0xf903('0x30')][_0xf903('0x1a')]);}_0x4fd91d[_0xf903('0x37')]=qs[_0xf903('0x38')](_0x374e2d['query']['sort']);_0x4fd91d[_0xf903('0x39')]=qs[_0xf903('0x3a')](_[_0xf903('0x3b')](_0x374e2d['query'],_0x355528['filters']),_0x44595d);if(_0x374e2d['query']['filter']){_0x4fd91d[_0xf903('0x39')]=_[_0xf903('0x3c')](_0x4fd91d[_0xf903('0x39')],{'$or':_[_0xf903('0x29')](_0x44595d,function(_0x10ab5c){if(_0x10ab5c[_0xf903('0x2d')]!==_0xf903('0x3d')){var _0x536eba={};_0x536eba[_0x10ab5c[_0xf903('0x26')]]={'$like':'%'+_0x374e2d[_0xf903('0x30')][_0xf903('0x3e')]+'%'};return _0x536eba;}})});}_0x4fd91d=_[_0xf903('0x3c')]({},_0x4fd91d,_0x374e2d['options']);var _0x1aa540={'where':_0x4fd91d[_0xf903('0x39')]};return db[_0xf903('0x2a')][_0xf903('0x1d')](_0x1aa540)[_0xf903('0x25')](function(_0x37d6e3){_0x2adfa7[_0xf903('0x1d')]=_0x37d6e3;if(_0x374e2d['query']['includeAll']){_0x4fd91d[_0xf903('0x3f')]=[{'all':!![]}];}return db['MailServerOut']['findAll'](_0x4fd91d);})['then'](function(_0x2c5d26){_0x2adfa7[_0xf903('0x40')]=_0x2c5d26;return _0x2adfa7;})[_0xf903('0x25')](respondWithFilteredResult(_0x175f7f,_0x4fd91d))['catch'](handleError(_0x175f7f,null));};exports[_0xf903('0x41')]=function(_0x35830e,_0x11c0ea){var _0x4a25c3={'raw':!![],'where':{'id':_0x35830e[_0xf903('0x42')]['id']}},_0x47973c={};_0x47973c[_0xf903('0x2f')]=_['keys'](db[_0xf903('0x2a')][_0xf903('0x2b')]);_0x47973c['query']=_[_0xf903('0x43')](_0x35830e[_0xf903('0x30')]);_0x47973c[_0xf903('0x3a')]=_['intersection'](_0x47973c[_0xf903('0x2f')],_0x47973c[_0xf903('0x30')]);_0x4a25c3[_0xf903('0x32')]=_[_0xf903('0x31')](_0x47973c[_0xf903('0x2f')],qs[_0xf903('0x33')](_0x35830e[_0xf903('0x30')]['fields']));_0x4a25c3[_0xf903('0x32')]=_0x4a25c3[_0xf903('0x32')]['length']?_0x4a25c3['attributes']:_0x47973c[_0xf903('0x2f')];if(_0x35830e['query']['includeAll']){_0x4a25c3[_0xf903('0x3f')]=[{'all':!![]}];}_0x4a25c3=_[_0xf903('0x3c')]({},_0x4a25c3,_0x35830e[_0xf903('0x44')]);return db[_0xf903('0x2a')][_0xf903('0x45')](_0x4a25c3)[_0xf903('0x25')](handleEntityNotFound(_0x11c0ea,null))['then'](respondWithResult(_0x11c0ea,null))[_0xf903('0x46')](handleError(_0x11c0ea,null));};exports[_0xf903('0x47')]=function(_0x1bd22b,_0x469eb7){return db[_0xf903('0x2a')]['create'](_0x1bd22b['body'],{})[_0xf903('0x25')](respondWithResult(_0x469eb7,0xc9))[_0xf903('0x46')](handleError(_0x469eb7,null));};exports[_0xf903('0x24')]=function(_0x14e857,_0xae858a){if(_0x14e857['body']['id']){delete _0x14e857[_0xf903('0x48')]['id'];}return db[_0xf903('0x2a')]['find']({'where':{'id':_0x14e857[_0xf903('0x42')]['id']}})[_0xf903('0x25')](handleEntityNotFound(_0xae858a,null))[_0xf903('0x25')](saveUpdates(_0x14e857[_0xf903('0x48')],null))[_0xf903('0x25')](respondWithResult(_0xae858a,null))[_0xf903('0x46')](handleError(_0xae858a,null));};exports[_0xf903('0x49')]=function(_0x748241,_0x4c98c2){return db[_0xf903('0x2a')]['find']({'where':{'id':_0x748241[_0xf903('0x42')]['id']}})[_0xf903('0x25')](handleEntityNotFound(_0x4c98c2,null))[_0xf903('0x25')](removeEntity(_0x4c98c2,null))[_0xf903('0x46')](handleError(_0x4c98c2,null));}; \ No newline at end of file +var _0x66fb=['lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','MailServerOut','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','rows','show','params','rawAttributes','include','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x66fb,0x90));var _0xb66f=function(_0x4ef153,_0x269ab7){_0x4ef153=_0x4ef153-0x0;var _0x213c3b=_0x66fb[_0x4ef153];return _0x213c3b;};'use strict';var emlformat=require(_0xb66f('0x0'));var rimraf=require(_0xb66f('0x1'));var zipdir=require(_0xb66f('0x2'));var jsonpatch=require(_0xb66f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb66f('0x4'));var Mustache=require(_0xb66f('0x5'));var util=require('util');var path=require(_0xb66f('0x6'));var sox=require(_0xb66f('0x7'));var csv=require(_0xb66f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb66f('0x9'));var _=require(_0xb66f('0xa'));var squel=require(_0xb66f('0xb'));var crypto=require('crypto');var jsforce=require(_0xb66f('0xc'));var deskjs=require(_0xb66f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb66f('0xe'));var Papa=require(_0xb66f('0xf'));var Redis=require(_0xb66f('0x10'));var authService=require(_0xb66f('0x11'));var qs=require(_0xb66f('0x12'));var as=require(_0xb66f('0x13'));var hardwareService=require(_0xb66f('0x14'));var logger=require(_0xb66f('0x15'))(_0xb66f('0x16'));var utils=require(_0xb66f('0x17'));var config=require(_0xb66f('0x18'));var licenseUtil=require(_0xb66f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1bb39b,_0x35f308){_0x35f308=_0x35f308||0xcc;return function(_0x4ec07e){if(_0x4ec07e){return _0x1bb39b[_0xb66f('0x1a')](_0x35f308);}return _0x1bb39b['status'](_0x35f308)[_0xb66f('0x1b')]();};}function respondWithResult(_0x4c7af6,_0x17d35d){_0x17d35d=_0x17d35d||0xc8;return function(_0x2f41e4){if(_0x2f41e4){return _0x4c7af6['status'](_0x17d35d)[_0xb66f('0x1c')](_0x2f41e4);}};}function respondWithFilteredResult(_0x208825,_0x1cfeb5){return function(_0xdbc805){if(_0xdbc805){var _0x264758=typeof _0x1cfeb5[_0xb66f('0x1d')]===_0xb66f('0x1e')&&typeof _0x1cfeb5[_0xb66f('0x1f')]===_0xb66f('0x1e');var _0xa98254=_0xdbc805[_0xb66f('0x20')];var _0x953a81=_0x264758?0x0:_0x1cfeb5['offset'];var _0x49d143=_0x264758?_0xdbc805['count']:_0x1cfeb5[_0xb66f('0x1d')]+_0x1cfeb5[_0xb66f('0x1f')];var _0x252230;if(_0x49d143>=_0xa98254){_0x49d143=_0xa98254;_0x252230=0xc8;}else{_0x252230=0xce;}_0x208825[_0xb66f('0x21')](_0x252230);return _0x208825[_0xb66f('0x22')](_0xb66f('0x23'),_0x953a81+'-'+_0x49d143+'/'+_0xa98254)[_0xb66f('0x1c')](_0xdbc805);}return null;};}function patchUpdates(_0x38ed25){return function(_0x1d62eb){try{jsonpatch[_0xb66f('0x24')](_0x1d62eb,_0x38ed25,!![]);}catch(_0x42e1c3){return BPromise[_0xb66f('0x25')](_0x42e1c3);}return _0x1d62eb[_0xb66f('0x26')]();};}function saveUpdates(_0x27b511,_0x3d6f9c){return function(_0x1abeac){if(_0x1abeac){return _0x1abeac[_0xb66f('0x27')](_0x27b511)[_0xb66f('0x28')](function(_0x2932f3){return _0x2932f3;});}return null;};}function removeEntity(_0x3a9f28,_0x53ae62){return function(_0x45a199){if(_0x45a199){return _0x45a199[_0xb66f('0x29')]()[_0xb66f('0x28')](function(){_0x3a9f28[_0xb66f('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2424b6,_0x4475d5){return function(_0xb876d2){if(!_0xb876d2){_0x2424b6[_0xb66f('0x1a')](0x194);}return _0xb876d2;};}function handleError(_0x2a2229,_0x52896d){_0x52896d=_0x52896d||0x1f4;return function(_0x2cef71){logger[_0xb66f('0x2a')](_0x2cef71[_0xb66f('0x2b')]);if(_0x2cef71[_0xb66f('0x2c')]){delete _0x2cef71[_0xb66f('0x2c')];}_0x2a2229['status'](_0x52896d)[_0xb66f('0x2d')](_0x2cef71);};}exports['index']=function(_0x207662,_0x4e675d){var _0x579569={},_0x1eb003={},_0xa1b325={'count':0x0,'rows':[]};var _0x1f07b5=_[_0xb66f('0x2e')](db[_0xb66f('0x2f')]['rawAttributes'],function(_0x179afc){return{'name':_0x179afc[_0xb66f('0x30')],'type':_0x179afc['type'][_0xb66f('0x31')]};});_0x1eb003[_0xb66f('0x32')]=_[_0xb66f('0x2e')](_0x1f07b5,_0xb66f('0x2c'));_0x1eb003['query']=_[_0xb66f('0x33')](_0x207662[_0xb66f('0x34')]);_0x1eb003[_0xb66f('0x35')]=_[_0xb66f('0x36')](_0x1eb003['model'],_0x1eb003['query']);_0x579569[_0xb66f('0x37')]=_[_0xb66f('0x36')](_0x1eb003['model'],qs[_0xb66f('0x38')](_0x207662[_0xb66f('0x34')]['fields']));_0x579569[_0xb66f('0x37')]=_0x579569[_0xb66f('0x37')][_0xb66f('0x39')]?_0x579569[_0xb66f('0x37')]:_0x1eb003[_0xb66f('0x32')];if(!_0x207662[_0xb66f('0x34')][_0xb66f('0x3a')](_0xb66f('0x3b'))){_0x579569[_0xb66f('0x1f')]=qs[_0xb66f('0x1f')](_0x207662[_0xb66f('0x34')]['limit']);_0x579569[_0xb66f('0x1d')]=qs['offset'](_0x207662[_0xb66f('0x34')]['offset']);}_0x579569['order']=qs['sort'](_0x207662[_0xb66f('0x34')][_0xb66f('0x3c')]);_0x579569[_0xb66f('0x3d')]=qs[_0xb66f('0x35')](_[_0xb66f('0x3e')](_0x207662['query'],_0x1eb003[_0xb66f('0x35')]),_0x1f07b5);if(_0x207662['query'][_0xb66f('0x3f')]){_0x579569['where']=_['merge'](_0x579569[_0xb66f('0x3d')],{'$or':_['map'](_0x1f07b5,function(_0x879c73){if(_0x879c73['type']!==_0xb66f('0x40')){var _0x4eef2c={};_0x4eef2c[_0x879c73[_0xb66f('0x2c')]]={'$like':'%'+_0x207662[_0xb66f('0x34')][_0xb66f('0x3f')]+'%'};return _0x4eef2c;}})});}_0x579569=_[_0xb66f('0x41')]({},_0x579569,_0x207662[_0xb66f('0x42')]);var _0x473d5e={'where':_0x579569[_0xb66f('0x3d')]};return db[_0xb66f('0x2f')][_0xb66f('0x20')](_0x473d5e)[_0xb66f('0x28')](function(_0x5a900a){_0xa1b325['count']=_0x5a900a;if(_0x207662[_0xb66f('0x34')][_0xb66f('0x43')]){_0x579569['include']=[{'all':!![]}];}return db[_0xb66f('0x2f')]['findAll'](_0x579569);})[_0xb66f('0x28')](function(_0x150fed){_0xa1b325[_0xb66f('0x44')]=_0x150fed;return _0xa1b325;})[_0xb66f('0x28')](respondWithFilteredResult(_0x4e675d,_0x579569))['catch'](handleError(_0x4e675d,null));};exports[_0xb66f('0x45')]=function(_0x1a0faa,_0x235e58){var _0x378b93={'raw':!![],'where':{'id':_0x1a0faa[_0xb66f('0x46')]['id']}},_0x3ae53a={};_0x3ae53a[_0xb66f('0x32')]=_[_0xb66f('0x33')](db['MailServerOut'][_0xb66f('0x47')]);_0x3ae53a[_0xb66f('0x34')]=_['keys'](_0x1a0faa['query']);_0x3ae53a[_0xb66f('0x35')]=_['intersection'](_0x3ae53a['model'],_0x3ae53a[_0xb66f('0x34')]);_0x378b93['attributes']=_[_0xb66f('0x36')](_0x3ae53a[_0xb66f('0x32')],qs[_0xb66f('0x38')](_0x1a0faa[_0xb66f('0x34')]['fields']));_0x378b93['attributes']=_0x378b93[_0xb66f('0x37')][_0xb66f('0x39')]?_0x378b93[_0xb66f('0x37')]:_0x3ae53a[_0xb66f('0x32')];if(_0x1a0faa['query'][_0xb66f('0x43')]){_0x378b93[_0xb66f('0x48')]=[{'all':!![]}];}_0x378b93=_['merge']({},_0x378b93,_0x1a0faa[_0xb66f('0x42')]);return db['MailServerOut'][_0xb66f('0x49')](_0x378b93)[_0xb66f('0x28')](handleEntityNotFound(_0x235e58,null))[_0xb66f('0x28')](respondWithResult(_0x235e58,null))[_0xb66f('0x4a')](handleError(_0x235e58,null));};exports['create']=function(_0x67f665,_0x4aa0cc){return db['MailServerOut'][_0xb66f('0x4b')](_0x67f665[_0xb66f('0x4c')],{})[_0xb66f('0x28')](respondWithResult(_0x4aa0cc,0xc9))[_0xb66f('0x4a')](handleError(_0x4aa0cc,null));};exports[_0xb66f('0x27')]=function(_0x26cef5,_0x55b7c9){if(_0x26cef5[_0xb66f('0x4c')]['id']){delete _0x26cef5[_0xb66f('0x4c')]['id'];}return db[_0xb66f('0x2f')][_0xb66f('0x49')]({'where':{'id':_0x26cef5[_0xb66f('0x46')]['id']}})[_0xb66f('0x28')](handleEntityNotFound(_0x55b7c9,null))[_0xb66f('0x28')](saveUpdates(_0x26cef5[_0xb66f('0x4c')],null))[_0xb66f('0x28')](respondWithResult(_0x55b7c9,null))[_0xb66f('0x4a')](handleError(_0x55b7c9,null));};exports[_0xb66f('0x29')]=function(_0x4faee2,_0x3a065a){return db[_0xb66f('0x2f')][_0xb66f('0x49')]({'where':{'id':_0x4faee2['params']['id']}})['then'](handleEntityNotFound(_0x3a065a,null))['then'](removeEntity(_0x3a065a,null))[_0xb66f('0x4a')](handleError(_0x3a065a,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 792ef53..ed2af65 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 _0x458f=['path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x20ac14,_0x26cdc9){var _0x1f9e71=function(_0x5f182f){while(--_0x5f182f){_0x20ac14['push'](_0x20ac14['shift']());}};_0x1f9e71(++_0x26cdc9);}(_0x458f,0xbb));var _0xf458=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x458f[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xf458('0x0'));var util=require(_0xf458('0x1'));var logger=require(_0xf458('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf458('0x3'));var rp=require(_0xf458('0x4'));var fs=require('fs');var path=require(_0xf458('0x5'));var rimraf=require(_0xf458('0x6'));var config=require(_0xf458('0x7'));var attributes=require(_0xf458('0x8'));module[_0xf458('0x9')]=function(_0x5d67e7,_0x1bd9bb){return _0x5d67e7[_0xf458('0xa')](_0xf458('0xb'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47ea=['define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./mailServerOut.attributes'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x47ea,0x1a5));var _0xa47e=function(_0x19691f,_0x159737){_0x19691f=_0x19691f-0x0;var _0x5677b6=_0x47ea[_0x19691f];return _0x5677b6;};'use strict';var _=require(_0xa47e('0x0'));var util=require(_0xa47e('0x1'));var logger=require(_0xa47e('0x2'))('api');var moment=require(_0xa47e('0x3'));var BPromise=require(_0xa47e('0x4'));var rp=require(_0xa47e('0x5'));var fs=require('fs');var path=require(_0xa47e('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa47e('0x7'));module['exports']=function(_0xca2ff2,_0xfcaf02){return _0xca2ff2[_0xa47e('0x8')](_0xa47e('0x9'),attributes,{'tableName':_0xa47e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 28680a2..9b23883 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3f4bb3,_0x54f0de){var _0x1cb73a=function(_0x5bac64){while(--_0x5bac64){_0x3f4bb3['push'](_0x3f4bb3['shift']());}};_0x1cb73a(++_0x54f0de);}(_0xadb5,0xad));var _0x5adb=function(_0x1c8a58,_0x48eabf){_0x1c8a58=_0x1c8a58-0x0;var _0x3e2b4c=_0xadb5[_0x1c8a58];return _0x3e2b4c;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x19e1a5,_0x49c686){var _0x4dfc21=function(_0x560377){while(--_0x560377){_0x19e1a5['push'](_0x19e1a5['shift']());}};_0x4dfc21(++_0x49c686);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xc4aa[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index a1f7bc0..b7e0886 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 _0xdcb3=['../../components/interaction/service','../../config/environment','./mailSubstatus.controller','index','get','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x572288,_0x2e495b){var _0x493d00=function(_0x559ab1){while(--_0x559ab1){_0x572288['push'](_0x572288['shift']());}};_0x493d00(++_0x2e495b);}(_0xdcb3,0x1b2));var _0x3dcb=function(_0x4d5308,_0x268d72){_0x4d5308=_0x4d5308-0x0;var _0x56635a=_0xdcb3[_0x4d5308];return _0x56635a;};'use strict';var multer=require(_0x3dcb('0x0'));var util=require(_0x3dcb('0x1'));var path=require(_0x3dcb('0x2'));var timeout=require(_0x3dcb('0x3'));var express=require(_0x3dcb('0x4'));var router=express['Router']();var fs_extra=require(_0x3dcb('0x5'));var auth=require(_0x3dcb('0x6'));var interaction=require(_0x3dcb('0x7'));var config=require(_0x3dcb('0x8'));var controller=require(_0x3dcb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x3dcb('0xa')]);router[_0x3dcb('0xb')]('/describe',auth[_0x3dcb('0xc')](),controller[_0x3dcb('0xd')]);router[_0x3dcb('0xb')](_0x3dcb('0xe'),auth['isAuthenticated'](),controller[_0x3dcb('0xf')]);router[_0x3dcb('0x10')]('/',auth[_0x3dcb('0xc')](),controller[_0x3dcb('0x11')]);router[_0x3dcb('0x12')]('/:id',auth[_0x3dcb('0xc')](),controller['update']);router[_0x3dcb('0x13')](_0x3dcb('0xe'),auth[_0x3dcb('0xc')](),controller[_0x3dcb('0x14')]);module['exports']=router; \ No newline at end of file +var _0xc1ba=['exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','/:id','post','create','destroy'];(function(_0x284531,_0x345bdb){var _0x28cd85=function(_0x5b7632){while(--_0x5b7632){_0x284531['push'](_0x284531['shift']());}};_0x28cd85(++_0x345bdb);}(_0xc1ba,0x187));var _0xac1b=function(_0x5ece1b,_0x3e5f24){_0x5ece1b=_0x5ece1b-0x0;var _0x4247f8=_0xc1ba[_0x5ece1b];return _0x4247f8;};'use strict';var multer=require('multer');var util=require(_0xac1b('0x0'));var path=require(_0xac1b('0x1'));var timeout=require(_0xac1b('0x2'));var express=require(_0xac1b('0x3'));var router=express['Router']();var fs_extra=require(_0xac1b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xac1b('0x5'));var config=require(_0xac1b('0x6'));var controller=require('./mailSubstatus.controller');router['get']('/',auth[_0xac1b('0x7')](),controller['index']);router[_0xac1b('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xac1b('0x9')]);router[_0xac1b('0x8')](_0xac1b('0xa'),auth[_0xac1b('0x7')](),controller['show']);router[_0xac1b('0xb')]('/',auth['isAuthenticated'](),controller[_0xac1b('0xc')]);router['put'](_0xac1b('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xac1b('0xa'),auth['isAuthenticated'](),controller[_0xac1b('0xd')]);module[_0xac1b('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 2991572..93e5c54 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 _0x49c1=['STRING','name','sequelize'];(function(_0x3b1caf,_0x8a35c5){var _0x416b17=function(_0x105e1b){while(--_0x105e1b){_0x3b1caf['push'](_0x3b1caf['shift']());}};_0x416b17(++_0x8a35c5);}(_0x49c1,0xef));var _0x149c=function(_0x5c5989,_0x28485e){_0x5c5989=_0x5c5989-0x0;var _0xebfad7=_0x49c1[_0x5c5989];return _0xebfad7;};'use strict';var Sequelize=require(_0x149c('0x0'));module['exports']={'name':{'type':Sequelize[_0x149c('0x1')],'unique':_0x149c('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x149c('0x1')]}}; \ No newline at end of file +var _0x8ace=['sequelize','exports','STRING','name'];(function(_0xf719a5,_0x3ff442){var _0x26c135=function(_0x16f4ea){while(--_0x16f4ea){_0xf719a5['push'](_0xf719a5['shift']());}};_0x26c135(++_0x3ff442);}(_0x8ace,0x1bc));var _0xe8ac=function(_0xed4881,_0x45771c){_0xed4881=_0xed4881-0x0;var _0x7fcbd5=_0x8ace[_0xed4881];return _0x7fcbd5;};'use strict';var Sequelize=require(_0xe8ac('0x0'));module[_0xe8ac('0x1')]={'name':{'type':Sequelize[_0xe8ac('0x2')],'unique':_0xe8ac('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe8ac('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 252d4c3..3a1c7a9 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 _0xf7fa=['send','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','options','MailSubstatus','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name'];(function(_0x783d10,_0x2a44a9){var _0x5cbd9a=function(_0x348088){while(--_0x348088){_0x783d10['push'](_0x783d10['shift']());}};_0x5cbd9a(++_0x2a44a9);}(_0xf7fa,0x14d));var _0xaf7f=function(_0x414c13,_0x5ea3d9){_0x414c13=_0x414c13-0x0;var _0x1fdb1f=_0xf7fa[_0x414c13];return _0x1fdb1f;};'use strict';var emlformat=require(_0xaf7f('0x0'));var rimraf=require(_0xaf7f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaf7f('0x2'));var rp=require(_0xaf7f('0x3'));var moment=require(_0xaf7f('0x4'));var BPromise=require(_0xaf7f('0x5'));var Mustache=require('mustache');var util=require(_0xaf7f('0x6'));var path=require(_0xaf7f('0x7'));var sox=require(_0xaf7f('0x8'));var csv=require(_0xaf7f('0x9'));var ejs=require(_0xaf7f('0xa'));var fs=require('fs');var fs_extra=require(_0xaf7f('0xb'));var _=require(_0xaf7f('0xc'));var squel=require(_0xaf7f('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaf7f('0xe'));var toCsv=require(_0xaf7f('0x9'));var querystring=require(_0xaf7f('0xf'));var Papa=require('papaparse');var Redis=require(_0xaf7f('0x10'));var authService=require(_0xaf7f('0x11'));var qs=require(_0xaf7f('0x12'));var as=require(_0xaf7f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf7f('0x14'))(_0xaf7f('0x15'));var utils=require(_0xaf7f('0x16'));var config=require(_0xaf7f('0x17'));var licenseUtil=require(_0xaf7f('0x18'));var db=require(_0xaf7f('0x19'))['db'];function respondWithStatusCode(_0x13a5cc,_0x5e49cc){_0x5e49cc=_0x5e49cc||0xcc;return function(_0x25d7e4){if(_0x25d7e4){return _0x13a5cc['sendStatus'](_0x5e49cc);}return _0x13a5cc[_0xaf7f('0x1a')](_0x5e49cc)[_0xaf7f('0x1b')]();};}function respondWithResult(_0x538819,_0x1c50d1){_0x1c50d1=_0x1c50d1||0xc8;return function(_0x5ec452){if(_0x5ec452){return _0x538819[_0xaf7f('0x1a')](_0x1c50d1)[_0xaf7f('0x1c')](_0x5ec452);}};}function respondWithFilteredResult(_0x681878,_0x5a5e45){return function(_0x1759f9){if(_0x1759f9){var _0x103898=typeof _0x5a5e45[_0xaf7f('0x1d')]===_0xaf7f('0x1e')&&typeof _0x5a5e45['limit']===_0xaf7f('0x1e');var _0x15a26c=_0x1759f9[_0xaf7f('0x1f')];var _0x27c448=_0x103898?0x0:_0x5a5e45[_0xaf7f('0x1d')];var _0x1cb64e=_0x103898?_0x1759f9[_0xaf7f('0x1f')]:_0x5a5e45[_0xaf7f('0x1d')]+_0x5a5e45['limit'];var _0x17b02f;if(_0x1cb64e>=_0x15a26c){_0x1cb64e=_0x15a26c;_0x17b02f=0xc8;}else{_0x17b02f=0xce;}_0x681878[_0xaf7f('0x1a')](_0x17b02f);return _0x681878['set'](_0xaf7f('0x20'),_0x27c448+'-'+_0x1cb64e+'/'+_0x15a26c)[_0xaf7f('0x1c')](_0x1759f9);}return null;};}function patchUpdates(_0x37a741){return function(_0x4f8d6d){try{jsonpatch[_0xaf7f('0x21')](_0x4f8d6d,_0x37a741,!![]);}catch(_0x50bc35){return BPromise[_0xaf7f('0x22')](_0x50bc35);}return _0x4f8d6d['save']();};}function saveUpdates(_0x1322a7,_0x1ea969){return function(_0x428860){if(_0x428860){return _0x428860[_0xaf7f('0x23')](_0x1322a7)[_0xaf7f('0x24')](function(_0x5dffc2){return _0x5dffc2;});}return null;};}function removeEntity(_0x30f8bb,_0x284d0){return function(_0x4b9c76){if(_0x4b9c76){return _0x4b9c76[_0xaf7f('0x25')]()[_0xaf7f('0x24')](function(){_0x30f8bb[_0xaf7f('0x1a')](0xcc)[_0xaf7f('0x1b')]();});}};}function handleEntityNotFound(_0x17834f,_0x2281d6){return function(_0x130c29){if(!_0x130c29){_0x17834f[_0xaf7f('0x26')](0x194);}return _0x130c29;};}function handleError(_0x462b5d,_0x582809){_0x582809=_0x582809||0x1f4;return function(_0x126eb8){logger[_0xaf7f('0x27')](_0x126eb8[_0xaf7f('0x28')]);if(_0x126eb8[_0xaf7f('0x29')]){delete _0x126eb8[_0xaf7f('0x29')];}_0x462b5d[_0xaf7f('0x1a')](_0x582809)[_0xaf7f('0x2a')](_0x126eb8);};}exports['index']=function(_0x413088,_0x287894){var _0x375234={},_0x2b0279={},_0x1c2ded={'count':0x0,'rows':[]};var _0x430ed8=_[_0xaf7f('0x2b')](db['MailSubstatus']['rawAttributes'],function(_0x5b5f46){return{'name':_0x5b5f46[_0xaf7f('0x2c')],'type':_0x5b5f46[_0xaf7f('0x2d')][_0xaf7f('0x2e')]};});_0x2b0279[_0xaf7f('0x2f')]=_[_0xaf7f('0x2b')](_0x430ed8,_0xaf7f('0x29'));_0x2b0279[_0xaf7f('0x30')]=_[_0xaf7f('0x31')](_0x413088[_0xaf7f('0x30')]);_0x2b0279[_0xaf7f('0x32')]=_[_0xaf7f('0x33')](_0x2b0279['model'],_0x2b0279[_0xaf7f('0x30')]);_0x375234['attributes']=_[_0xaf7f('0x33')](_0x2b0279[_0xaf7f('0x2f')],qs[_0xaf7f('0x34')](_0x413088[_0xaf7f('0x30')][_0xaf7f('0x34')]));_0x375234['attributes']=_0x375234[_0xaf7f('0x35')]['length']?_0x375234['attributes']:_0x2b0279[_0xaf7f('0x2f')];if(!_0x413088[_0xaf7f('0x30')][_0xaf7f('0x36')](_0xaf7f('0x37'))){_0x375234[_0xaf7f('0x38')]=qs['limit'](_0x413088['query'][_0xaf7f('0x38')]);_0x375234[_0xaf7f('0x1d')]=qs[_0xaf7f('0x1d')](_0x413088[_0xaf7f('0x30')]['offset']);}_0x375234[_0xaf7f('0x39')]=qs[_0xaf7f('0x3a')](_0x413088[_0xaf7f('0x30')]['sort']);_0x375234[_0xaf7f('0x3b')]=qs[_0xaf7f('0x32')](_['pick'](_0x413088[_0xaf7f('0x30')],_0x2b0279[_0xaf7f('0x32')]),_0x430ed8);if(_0x413088[_0xaf7f('0x30')][_0xaf7f('0x3c')]){_0x375234[_0xaf7f('0x3b')]=_[_0xaf7f('0x3d')](_0x375234[_0xaf7f('0x3b')],{'$or':_[_0xaf7f('0x2b')](_0x430ed8,function(_0x3751d9){if(_0x3751d9[_0xaf7f('0x2d')]!=='VIRTUAL'){var _0x67c726={};_0x67c726[_0x3751d9[_0xaf7f('0x29')]]={'$like':'%'+_0x413088['query'][_0xaf7f('0x3c')]+'%'};return _0x67c726;}})});}_0x375234=_[_0xaf7f('0x3d')]({},_0x375234,_0x413088[_0xaf7f('0x3e')]);var _0x238c94={'where':_0x375234['where']};return db[_0xaf7f('0x3f')][_0xaf7f('0x1f')](_0x238c94)[_0xaf7f('0x24')](function(_0x5b20c9){_0x1c2ded[_0xaf7f('0x1f')]=_0x5b20c9;if(_0x413088[_0xaf7f('0x30')][_0xaf7f('0x40')]){_0x375234[_0xaf7f('0x41')]=[{'all':!![]}];}return db['MailSubstatus'][_0xaf7f('0x42')](_0x375234);})[_0xaf7f('0x24')](function(_0x5da5a8){_0x1c2ded[_0xaf7f('0x43')]=_0x5da5a8;return _0x1c2ded;})[_0xaf7f('0x24')](respondWithFilteredResult(_0x287894,_0x375234))[_0xaf7f('0x44')](handleError(_0x287894,null));};exports[_0xaf7f('0x45')]=function(_0x47ccca,_0x265e29){var _0x420b0e={'raw':!![],'where':{'id':_0x47ccca[_0xaf7f('0x46')]['id']}},_0xafd59c={};_0xafd59c[_0xaf7f('0x2f')]=_[_0xaf7f('0x31')](db[_0xaf7f('0x3f')]['rawAttributes']);_0xafd59c['query']=_[_0xaf7f('0x31')](_0x47ccca[_0xaf7f('0x30')]);_0xafd59c[_0xaf7f('0x32')]=_[_0xaf7f('0x33')](_0xafd59c['model'],_0xafd59c[_0xaf7f('0x30')]);_0x420b0e[_0xaf7f('0x35')]=_[_0xaf7f('0x33')](_0xafd59c[_0xaf7f('0x2f')],qs['fields'](_0x47ccca[_0xaf7f('0x30')][_0xaf7f('0x34')]));_0x420b0e[_0xaf7f('0x35')]=_0x420b0e['attributes']['length']?_0x420b0e[_0xaf7f('0x35')]:_0xafd59c['model'];if(_0x47ccca['query']['includeAll']){_0x420b0e[_0xaf7f('0x41')]=[{'all':!![]}];}_0x420b0e=_[_0xaf7f('0x3d')]({},_0x420b0e,_0x47ccca[_0xaf7f('0x3e')]);return db['MailSubstatus'][_0xaf7f('0x47')](_0x420b0e)[_0xaf7f('0x24')](handleEntityNotFound(_0x265e29,null))[_0xaf7f('0x24')](respondWithResult(_0x265e29,null))[_0xaf7f('0x44')](handleError(_0x265e29,null));};exports['create']=function(_0x18a575,_0x4cc81a){return db['MailSubstatus'][_0xaf7f('0x48')](_0x18a575[_0xaf7f('0x49')],{})[_0xaf7f('0x24')](respondWithResult(_0x4cc81a,0xc9))[_0xaf7f('0x44')](handleError(_0x4cc81a,null));};exports[_0xaf7f('0x23')]=function(_0x1f8eed,_0x18999d){if(_0x1f8eed[_0xaf7f('0x49')]['id']){delete _0x1f8eed['body']['id'];}return db['MailSubstatus'][_0xaf7f('0x47')]({'where':{'id':_0x1f8eed[_0xaf7f('0x46')]['id']}})[_0xaf7f('0x24')](handleEntityNotFound(_0x18999d,null))['then'](saveUpdates(_0x1f8eed[_0xaf7f('0x49')],null))[_0xaf7f('0x24')](respondWithResult(_0x18999d,null))[_0xaf7f('0x44')](handleError(_0x18999d,null));};exports[_0xaf7f('0x25')]=function(_0x5d30b1,_0x335c64){return db[_0xaf7f('0x3f')]['find']({'where':{'id':_0x5d30b1[_0xaf7f('0x46')]['id']}})[_0xaf7f('0x24')](handleEntityNotFound(_0x335c64,null))['then'](removeEntity(_0x335c64,null))[_0xaf7f('0x44')](handleError(_0x335c64,null));};exports[_0xaf7f('0x4a')]=function(_0x8b3de7,_0x2ed894){return db[_0xaf7f('0x3f')][_0xaf7f('0x4a')]()[_0xaf7f('0x24')](respondWithResult(_0x2ed894,null))[_0xaf7f('0x44')](handleError(_0x2ed894,null));}; \ No newline at end of file +var _0x828f=['json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','MailSubstatus','rawAttributes','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','map','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','intersection','include','find','create','describe','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x2e1f31,_0x4ca6f5){var _0x41ebfe=function(_0x38495e){while(--_0x38495e){_0x2e1f31['push'](_0x2e1f31['shift']());}};_0x41ebfe(++_0x4ca6f5);}(_0x828f,0xc1));var _0xf828=function(_0x1d50f2,_0x3c3ec6){_0x1d50f2=_0x1d50f2-0x0;var _0x3769b8=_0x828f[_0x1d50f2];return _0x3769b8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf828('0x0'));var rp=require('request-promise');var moment=require(_0xf828('0x1'));var BPromise=require(_0xf828('0x2'));var Mustache=require(_0xf828('0x3'));var util=require(_0xf828('0x4'));var path=require(_0xf828('0x5'));var sox=require(_0xf828('0x6'));var csv=require(_0xf828('0x7'));var ejs=require(_0xf828('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf828('0x9'));var squel=require(_0xf828('0xa'));var crypto=require(_0xf828('0xb'));var jsforce=require(_0xf828('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf828('0xd'));var Papa=require(_0xf828('0xe'));var Redis=require(_0xf828('0xf'));var authService=require(_0xf828('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf828('0x11'));var hardwareService=require(_0xf828('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xf828('0x13'));var config=require(_0xf828('0x14'));var licenseUtil=require(_0xf828('0x15'));var db=require(_0xf828('0x16'))['db'];function respondWithStatusCode(_0x5beff0,_0x3fff70){_0x3fff70=_0x3fff70||0xcc;return function(_0x4fd7b6){if(_0x4fd7b6){return _0x5beff0[_0xf828('0x17')](_0x3fff70);}return _0x5beff0['status'](_0x3fff70)[_0xf828('0x18')]();};}function respondWithResult(_0x2ede68,_0xda5be3){_0xda5be3=_0xda5be3||0xc8;return function(_0x1d8b5d){if(_0x1d8b5d){return _0x2ede68[_0xf828('0x19')](_0xda5be3)[_0xf828('0x1a')](_0x1d8b5d);}};}function respondWithFilteredResult(_0x396884,_0x18459e){return function(_0x39375d){if(_0x39375d){var _0x2170a1=typeof _0x18459e[_0xf828('0x1b')]==='undefined'&&typeof _0x18459e[_0xf828('0x1c')]===_0xf828('0x1d');var _0x41d567=_0x39375d['count'];var _0x3f4234=_0x2170a1?0x0:_0x18459e['offset'];var _0x26716a=_0x2170a1?_0x39375d[_0xf828('0x1e')]:_0x18459e[_0xf828('0x1b')]+_0x18459e[_0xf828('0x1c')];var _0x1eeb1c;if(_0x26716a>=_0x41d567){_0x26716a=_0x41d567;_0x1eeb1c=0xc8;}else{_0x1eeb1c=0xce;}_0x396884[_0xf828('0x19')](_0x1eeb1c);return _0x396884[_0xf828('0x1f')](_0xf828('0x20'),_0x3f4234+'-'+_0x26716a+'/'+_0x41d567)[_0xf828('0x1a')](_0x39375d);}return null;};}function patchUpdates(_0x10eb5b){return function(_0x13193a){try{jsonpatch[_0xf828('0x21')](_0x13193a,_0x10eb5b,!![]);}catch(_0x2efaee){return BPromise[_0xf828('0x22')](_0x2efaee);}return _0x13193a[_0xf828('0x23')]();};}function saveUpdates(_0xb263b8,_0x402170){return function(_0x45d380){if(_0x45d380){return _0x45d380[_0xf828('0x24')](_0xb263b8)[_0xf828('0x25')](function(_0x514272){return _0x514272;});}return null;};}function removeEntity(_0x2e8108,_0x1c31ea){return function(_0x488b59){if(_0x488b59){return _0x488b59[_0xf828('0x26')]()[_0xf828('0x25')](function(){_0x2e8108[_0xf828('0x19')](0xcc)[_0xf828('0x18')]();});}};}function handleEntityNotFound(_0x110d35,_0x12454f){return function(_0x161f5a){if(!_0x161f5a){_0x110d35['sendStatus'](0x194);}return _0x161f5a;};}function handleError(_0x1fb9fe,_0x47e3e5){_0x47e3e5=_0x47e3e5||0x1f4;return function(_0xa4997e){logger[_0xf828('0x27')](_0xa4997e['stack']);if(_0xa4997e[_0xf828('0x28')]){delete _0xa4997e[_0xf828('0x28')];}_0x1fb9fe['status'](_0x47e3e5)[_0xf828('0x29')](_0xa4997e);};}exports['index']=function(_0x259758,_0xbb0915){var _0x1886b7={},_0x587899={},_0x48d9f1={'count':0x0,'rows':[]};var _0x431800=_['map'](db[_0xf828('0x2a')][_0xf828('0x2b')],function(_0x1c1f4c){return{'name':_0x1c1f4c['fieldName'],'type':_0x1c1f4c['type'][_0xf828('0x2c')]};});_0x587899[_0xf828('0x2d')]=_['map'](_0x431800,_0xf828('0x28'));_0x587899[_0xf828('0x2e')]=_[_0xf828('0x2f')](_0x259758['query']);_0x587899['filters']=_['intersection'](_0x587899['model'],_0x587899[_0xf828('0x2e')]);_0x1886b7[_0xf828('0x30')]=_['intersection'](_0x587899[_0xf828('0x2d')],qs[_0xf828('0x31')](_0x259758['query'][_0xf828('0x31')]));_0x1886b7[_0xf828('0x30')]=_0x1886b7['attributes'][_0xf828('0x32')]?_0x1886b7['attributes']:_0x587899[_0xf828('0x2d')];if(!_0x259758[_0xf828('0x2e')][_0xf828('0x33')](_0xf828('0x34'))){_0x1886b7[_0xf828('0x1c')]=qs[_0xf828('0x1c')](_0x259758[_0xf828('0x2e')][_0xf828('0x1c')]);_0x1886b7['offset']=qs['offset'](_0x259758[_0xf828('0x2e')][_0xf828('0x1b')]);}_0x1886b7[_0xf828('0x35')]=qs[_0xf828('0x36')](_0x259758[_0xf828('0x2e')][_0xf828('0x36')]);_0x1886b7[_0xf828('0x37')]=qs[_0xf828('0x38')](_['pick'](_0x259758[_0xf828('0x2e')],_0x587899[_0xf828('0x38')]),_0x431800);if(_0x259758[_0xf828('0x2e')]['filter']){_0x1886b7[_0xf828('0x37')]=_[_0xf828('0x39')](_0x1886b7[_0xf828('0x37')],{'$or':_[_0xf828('0x3a')](_0x431800,function(_0x447a83){if(_0x447a83['type']!==_0xf828('0x3b')){var _0x29b968={};_0x29b968[_0x447a83['name']]={'$like':'%'+_0x259758[_0xf828('0x2e')][_0xf828('0x3c')]+'%'};return _0x29b968;}})});}_0x1886b7=_[_0xf828('0x39')]({},_0x1886b7,_0x259758[_0xf828('0x3d')]);var _0xfa3821={'where':_0x1886b7['where']};return db[_0xf828('0x2a')][_0xf828('0x1e')](_0xfa3821)[_0xf828('0x25')](function(_0x5b1f56){_0x48d9f1[_0xf828('0x1e')]=_0x5b1f56;if(_0x259758[_0xf828('0x2e')][_0xf828('0x3e')]){_0x1886b7['include']=[{'all':!![]}];}return db[_0xf828('0x2a')][_0xf828('0x3f')](_0x1886b7);})[_0xf828('0x25')](function(_0x42f55b){_0x48d9f1[_0xf828('0x40')]=_0x42f55b;return _0x48d9f1;})[_0xf828('0x25')](respondWithFilteredResult(_0xbb0915,_0x1886b7))[_0xf828('0x41')](handleError(_0xbb0915,null));};exports[_0xf828('0x42')]=function(_0x241c70,_0x5a9354){var _0x3b6b79={'raw':!![],'where':{'id':_0x241c70[_0xf828('0x43')]['id']}},_0x5b1268={};_0x5b1268[_0xf828('0x2d')]=_['keys'](db[_0xf828('0x2a')][_0xf828('0x2b')]);_0x5b1268['query']=_[_0xf828('0x2f')](_0x241c70['query']);_0x5b1268[_0xf828('0x38')]=_[_0xf828('0x44')](_0x5b1268[_0xf828('0x2d')],_0x5b1268['query']);_0x3b6b79['attributes']=_[_0xf828('0x44')](_0x5b1268[_0xf828('0x2d')],qs[_0xf828('0x31')](_0x241c70[_0xf828('0x2e')][_0xf828('0x31')]));_0x3b6b79['attributes']=_0x3b6b79[_0xf828('0x30')][_0xf828('0x32')]?_0x3b6b79['attributes']:_0x5b1268[_0xf828('0x2d')];if(_0x241c70[_0xf828('0x2e')][_0xf828('0x3e')]){_0x3b6b79[_0xf828('0x45')]=[{'all':!![]}];}_0x3b6b79=_['merge']({},_0x3b6b79,_0x241c70[_0xf828('0x3d')]);return db[_0xf828('0x2a')][_0xf828('0x46')](_0x3b6b79)[_0xf828('0x25')](handleEntityNotFound(_0x5a9354,null))['then'](respondWithResult(_0x5a9354,null))[_0xf828('0x41')](handleError(_0x5a9354,null));};exports[_0xf828('0x47')]=function(_0x315e9f,_0x34bbcc){return db['MailSubstatus'][_0xf828('0x47')](_0x315e9f['body'],{})[_0xf828('0x25')](respondWithResult(_0x34bbcc,0xc9))[_0xf828('0x41')](handleError(_0x34bbcc,null));};exports['update']=function(_0x1475e4,_0x23a8e1){if(_0x1475e4['body']['id']){delete _0x1475e4['body']['id'];}return db[_0xf828('0x2a')][_0xf828('0x46')]({'where':{'id':_0x1475e4[_0xf828('0x43')]['id']}})[_0xf828('0x25')](handleEntityNotFound(_0x23a8e1,null))['then'](saveUpdates(_0x1475e4['body'],null))[_0xf828('0x25')](respondWithResult(_0x23a8e1,null))[_0xf828('0x41')](handleError(_0x23a8e1,null));};exports[_0xf828('0x26')]=function(_0x3b3a5b,_0x466227){return db[_0xf828('0x2a')][_0xf828('0x46')]({'where':{'id':_0x3b3a5b['params']['id']}})['then'](handleEntityNotFound(_0x466227,null))['then'](removeEntity(_0x466227,null))['catch'](handleError(_0x466227,null));};exports[_0xf828('0x48')]=function(_0x47de55,_0x526f48){return db[_0xf828('0x2a')][_0xf828('0x48')]()[_0xf828('0x25')](respondWithResult(_0x526f48,null))[_0xf828('0x41')](handleError(_0x526f48,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 0a8502a..62ddeba 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 _0xe845=['events','../../mysqldb','MailSubstatus','setMaxListeners','update','emit','hook','exports'];(function(_0x22d81b,_0x17039a){var _0xba37c5=function(_0x5b29c8){while(--_0x5b29c8){_0x22d81b['push'](_0x22d81b['shift']());}};_0xba37c5(++_0x17039a);}(_0xe845,0x1b8));var _0x5e84=function(_0x342bc9,_0x4a7fe2){_0x342bc9=_0x342bc9-0x0;var _0xc2f264=_0xe845[_0x342bc9];return _0xc2f264;};'use strict';var EventEmitter=require(_0x5e84('0x0'));var MailSubstatus=require(_0x5e84('0x1'))['db'][_0x5e84('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x5e84('0x3')](0x0);var events={'afterUpdate':_0x5e84('0x4')};function emitEvent(_0x266c14){return function(_0x4aa855,_0x2dd017,_0x5e2949){MailSubstatusEvents['emit'](_0x266c14+':'+_0x4aa855['id'],_0x4aa855);MailSubstatusEvents[_0x5e84('0x5')](_0x266c14,_0x4aa855);_0x5e2949(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x5e84('0x6')](e,emitEvent(event));}}module[_0x5e84('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0x3173=['exports','events','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x5d3010,_0x16f627){var _0x40a2f3=function(_0x367a5f){while(--_0x367a5f){_0x5d3010['push'](_0x5d3010['shift']());}};_0x40a2f3(++_0x16f627);}(_0x3173,0x149));var _0x3317=function(_0x397786,_0x20cc3b){_0x397786=_0x397786-0x0;var _0x73df93=_0x3173[_0x397786];return _0x73df93;};'use strict';var EventEmitter=require(_0x3317('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0x3317('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x3317('0x2')](0x0);var events={'afterUpdate':_0x3317('0x3')};function emitEvent(_0x1f8f54){return function(_0xfd67bf,_0x341b38,_0x399819){MailSubstatusEvents['emit'](_0x1f8f54+':'+_0xfd67bf['id'],_0xfd67bf);MailSubstatusEvents[_0x3317('0x4')](_0x1f8f54,_0xfd67bf);_0x399819(null);};}for(var e in events){if(events[_0x3317('0x5')](e)){var event=events[e];MailSubstatus[_0x3317('0x6')](e,emitEvent(event));}}module[_0x3317('0x7')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 4155e8b..11c1008 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 _0x1e87=['update','name','mailSubstatus','then','exports','models','define','MailSubstatus','mail_substatuses','Condition'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x1e87,0x162));var _0x71e8=function(_0x24b66b,_0x149f2a){_0x24b66b=_0x24b66b-0x0;var _0x1eac23=_0x1e87[_0x24b66b];return _0x1eac23;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0x71e8('0x0')]=function(_0x4da8ac){var _0x5ea654=_0x4da8ac[_0x71e8('0x1')];return _0x4da8ac[_0x71e8('0x2')](_0x71e8('0x3'),attributes,{'tableName':_0x71e8('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x3c28a9,_0x9c2823,_0x2ddef4){return _0x5ea654[_0x71e8('0x5')][_0x71e8('0x6')]({'value':_0x3c28a9[_0x71e8('0x7')]},{'where':{'field':_0x71e8('0x8'),'value':_0x3c28a9['_previousDataValues'][_0x71e8('0x7')]}})[_0x71e8('0x9')](function(){_0x2ddef4();})['catch'](function(_0x230130){_0x2ddef4(_0x230130);});}}});}; \ No newline at end of file +var _0x44fa=['update','name','mailSubstatus','then','catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses'];(function(_0x3d343b,_0xe235){var _0x4b6fe0=function(_0x43f6e6){while(--_0x43f6e6){_0x3d343b['push'](_0x3d343b['shift']());}};_0x4b6fe0(++_0xe235);}(_0x44fa,0x68));var _0xa44f=function(_0x1705be,_0x45cd2f){_0x1705be=_0x1705be-0x0;var _0x343a9b=_0x44fa[_0x1705be];return _0x343a9b;};'use strict';var attributes=require(_0xa44f('0x0'));module[_0xa44f('0x1')]=function(_0x21a0b4){var _0x37d3c3=_0x21a0b4[_0xa44f('0x2')];return _0x21a0b4[_0xa44f('0x3')](_0xa44f('0x4'),attributes,{'tableName':_0xa44f('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x5d371b,_0x2e81cb,_0x5e1794){return _0x37d3c3['Condition'][_0xa44f('0x6')]({'value':_0x5d371b[_0xa44f('0x7')]},{'where':{'field':_0xa44f('0x8'),'value':_0x5d371b['_previousDataValues'][_0xa44f('0x7')]}})[_0xa44f('0x9')](function(){_0x5e1794();})[_0xa44f('0xa')](function(_0x5bb6b9){_0x5e1794(_0x5bb6b9);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index b2da7e3..5f255c9 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 _0xaa86=['code','MailSubstatus,\x20%s,\x20%s','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xaa86,0x97));var _0x6aa8=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xaa86[_0x45e98e];return _0x374dba;};'use strict';var _=require('lodash');var util=require(_0x6aa8('0x0'));var moment=require(_0x6aa8('0x1'));var BPromise=require(_0x6aa8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6aa8('0x3'));var db=require(_0x6aa8('0x4'))['db'];var utils=require(_0x6aa8('0x5'));var logger=require(_0x6aa8('0x6'))('rpc');var config=require(_0x6aa8('0x7'));var jayson=require(_0x6aa8('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xe3d069,_0x14b3c3,_0x261979){return new BPromise(function(_0x31b6c2,_0x3c8017){return client[_0x6aa8('0x9')](_0xe3d069,_0x261979)[_0x6aa8('0xa')](function(_0x407b92){logger[_0x6aa8('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x14b3c3,_0x6aa8('0xc'));logger[_0x6aa8('0xd')](_0x6aa8('0xe'),_0x14b3c3,'request\x20sent',JSON[_0x6aa8('0xf')](_0x407b92));if(_0x407b92[_0x6aa8('0x10')]){if(_0x407b92[_0x6aa8('0x10')][_0x6aa8('0x11')]===0x1f4){logger[_0x6aa8('0x10')](_0x6aa8('0x12'),_0x14b3c3,_0x407b92[_0x6aa8('0x10')]['message']);return _0x3c8017(_0x407b92['error'][_0x6aa8('0x13')]);}logger['error'](_0x6aa8('0x12'),_0x14b3c3,_0x407b92[_0x6aa8('0x10')]['message']);return _0x31b6c2(_0x407b92[_0x6aa8('0x10')][_0x6aa8('0x13')]);}else{logger[_0x6aa8('0xb')](_0x6aa8('0x12'),_0x14b3c3,'request\x20sent');_0x31b6c2(_0x407b92['result']['message']);}})[_0x6aa8('0x14')](function(_0x199595){logger[_0x6aa8('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x14b3c3,_0x199595);_0x3c8017(_0x199595);});});} \ No newline at end of file +var _0x8945=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','util'];(function(_0x240cab,_0x461e97){var _0x1fbff2=function(_0x2cbc5a){while(--_0x2cbc5a){_0x240cab['push'](_0x240cab['shift']());}};_0x1fbff2(++_0x461e97);}(_0x8945,0xd0));var _0x5894=function(_0x58b1e2,_0x1886b4){_0x58b1e2=_0x58b1e2-0x0;var _0x3b0b94=_0x8945[_0x58b1e2];return _0x3b0b94;};'use strict';var _=require('lodash');var util=require(_0x5894('0x0'));var moment=require('moment');var BPromise=require(_0x5894('0x1'));var rs=require(_0x5894('0x2'));var fs=require('fs');var Redis=require(_0x5894('0x3'));var db=require(_0x5894('0x4'))['db'];var utils=require(_0x5894('0x5'));var logger=require(_0x5894('0x6'))(_0x5894('0x7'));var config=require('../../config/environment');var jayson=require(_0x5894('0x8'));var client=jayson['client'][_0x5894('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x151dd9,_0x4f3945,_0x4dcbe6){return new BPromise(function(_0x35a249,_0xc4e070){return client[_0x5894('0xa')](_0x151dd9,_0x4dcbe6)[_0x5894('0xb')](function(_0x454bc3){logger[_0x5894('0xc')](_0x5894('0xd'),_0x4f3945,_0x5894('0xe'));logger['debug']('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x4f3945,_0x5894('0xe'),JSON[_0x5894('0xf')](_0x454bc3));if(_0x454bc3[_0x5894('0x10')]){if(_0x454bc3['error']['code']===0x1f4){logger[_0x5894('0x10')](_0x5894('0xd'),_0x4f3945,_0x454bc3[_0x5894('0x10')][_0x5894('0x11')]);return _0xc4e070(_0x454bc3[_0x5894('0x10')][_0x5894('0x11')]);}logger[_0x5894('0x10')](_0x5894('0xd'),_0x4f3945,_0x454bc3[_0x5894('0x10')][_0x5894('0x11')]);return _0x35a249(_0x454bc3[_0x5894('0x10')][_0x5894('0x11')]);}else{logger[_0x5894('0xc')](_0x5894('0xd'),_0x4f3945,_0x5894('0xe'));_0x35a249(_0x454bc3[_0x5894('0x12')][_0x5894('0x11')]);}})['catch'](function(_0xf21c9d){logger[_0x5894('0x10')](_0x5894('0xd'),_0x4f3945,_0xf21c9d);_0xc4e070(_0xf21c9d);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index d6a826e..224e72e 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 _0x1aa4=['/describe','create','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index'];(function(_0x21ae22,_0x54911f){var _0x1e610a=function(_0x1d2cef){while(--_0x1d2cef){_0x21ae22['push'](_0x21ae22['shift']());}};_0x1e610a(++_0x54911f);}(_0x1aa4,0x1e7));var _0x41aa=function(_0x28901e,_0x33157a){_0x28901e=_0x28901e-0x0;var _0x2c351b=_0x1aa4[_0x28901e];return _0x2c351b;};'use strict';var multer=require(_0x41aa('0x0'));var util=require('util');var path=require(_0x41aa('0x1'));var timeout=require(_0x41aa('0x2'));var express=require(_0x41aa('0x3'));var router=express[_0x41aa('0x4')]();var fs_extra=require(_0x41aa('0x5'));var auth=require(_0x41aa('0x6'));var interaction=require(_0x41aa('0x7'));var config=require(_0x41aa('0x8'));var controller=require(_0x41aa('0x9'));router[_0x41aa('0xa')]('/',auth[_0x41aa('0xb')](),controller[_0x41aa('0xc')]);router[_0x41aa('0xa')](_0x41aa('0xd'),auth[_0x41aa('0xb')](),controller['describe']);router['get']('/:id',auth[_0x41aa('0xb')](),controller['show']);router['post']('/',auth[_0x41aa('0xb')](),controller[_0x41aa('0xe')]);router[_0x41aa('0xf')](_0x41aa('0x10'),auth[_0x41aa('0xb')](),controller[_0x41aa('0x11')]);router[_0x41aa('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x41aa('0x13')]);module['exports']=router; \ No newline at end of file +var _0xe79f=['fs-extra','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','put','update','delete','multer','util','path','connect-timeout','express'];(function(_0x5f53c2,_0xf5d5c3){var _0x273ce2=function(_0x9fa326){while(--_0x9fa326){_0x5f53c2['push'](_0x5f53c2['shift']());}};_0x273ce2(++_0xf5d5c3);}(_0xe79f,0x151));var _0xfe79=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe79f[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xfe79('0x0'));var util=require(_0xfe79('0x1'));var path=require(_0xfe79('0x2'));var timeout=require(_0xfe79('0x3'));var express=require(_0xfe79('0x4'));var router=express['Router']();var fs_extra=require(_0xfe79('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfe79('0x6'));var controller=require(_0xfe79('0x7'));router[_0xfe79('0x8')]('/',auth[_0xfe79('0x9')](),controller[_0xfe79('0xa')]);router[_0xfe79('0x8')]('/describe',auth[_0xfe79('0x9')](),controller[_0xfe79('0xb')]);router[_0xfe79('0x8')](_0xfe79('0xc'),auth['isAuthenticated'](),controller[_0xfe79('0xd')]);router[_0xfe79('0xe')]('/',auth[_0xfe79('0x9')](),controller['create']);router[_0xfe79('0xf')](_0xfe79('0xc'),auth[_0xfe79('0x9')](),controller[_0xfe79('0x10')]);router[_0xfe79('0x11')]('/:id',auth[_0xfe79('0x9')](),controller['destroy']);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 ad798a2..fa6485e 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x4f5f0c,_0x107da3){var _0x638b08=function(_0x4db3ba){while(--_0x4db3ba){_0x4f5f0c['push'](_0x4f5f0c['shift']());}};_0x638b08(++_0x107da3);}(_0xf3cd,0xfe));var _0xdf3c=function(_0xb0b922,_0x183826){_0xb0b922=_0xb0b922-0x0;var _0x5dc41e=_0xf3cd[_0xb0b922];return _0x5dc41e;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x270093,_0xb2478b){var _0x53584e=function(_0x2b8c0e){while(--_0x2b8c0e){_0x270093['push'](_0x270093['shift']());}};_0x53584e(++_0xb2478b);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x280bb5,_0x4a1aff){_0x280bb5=_0x280bb5-0x0;var _0x2b760c=_0xf3cd[_0x280bb5];return _0x2b760c;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index c19afe7..b3f26f2 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 _0xdf64=['VIRTUAL','options','include','findAll','rows','catch','params','keys','includeAll','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','error','stack','name','send','index','MailTransferReport','rawAttributes','fieldName','type','model','map','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge'];(function(_0xdd0313,_0x251c2b){var _0x2bd7e8=function(_0x340f1f){while(--_0x340f1f){_0xdd0313['push'](_0xdd0313['shift']());}};_0x2bd7e8(++_0x251c2b);}(_0xdf64,0xe4));var _0x4df6=function(_0x38b887,_0xb71329){_0x38b887=_0x38b887-0x0;var _0x4844ca=_0xdf64[_0x38b887];return _0x4844ca;};'use strict';var emlformat=require(_0x4df6('0x0'));var rimraf=require(_0x4df6('0x1'));var zipdir=require(_0x4df6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4df6('0x3'));var moment=require('moment');var BPromise=require(_0x4df6('0x4'));var Mustache=require(_0x4df6('0x5'));var util=require(_0x4df6('0x6'));var path=require(_0x4df6('0x7'));var sox=require(_0x4df6('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4df6('0x9'));var crypto=require(_0x4df6('0xa'));var jsforce=require(_0x4df6('0xb'));var deskjs=require(_0x4df6('0xc'));var toCsv=require(_0x4df6('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4df6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4df6('0xf'));var as=require(_0x4df6('0x10'));var hardwareService=require(_0x4df6('0x11'));var logger=require('../../config/logger')(_0x4df6('0x12'));var utils=require('../../config/utils');var config=require(_0x4df6('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4055ca,_0x50db94){_0x50db94=_0x50db94||0xcc;return function(_0x2cd76d){if(_0x2cd76d){return _0x4055ca[_0x4df6('0x14')](_0x50db94);}return _0x4055ca[_0x4df6('0x15')](_0x50db94)[_0x4df6('0x16')]();};}function respondWithResult(_0x9020d9,_0x4a8ef2){_0x4a8ef2=_0x4a8ef2||0xc8;return function(_0x177dc7){if(_0x177dc7){return _0x9020d9[_0x4df6('0x15')](_0x4a8ef2)[_0x4df6('0x17')](_0x177dc7);}};}function respondWithFilteredResult(_0x592306,_0x496b78){return function(_0x4d4f44){if(_0x4d4f44){var _0x272621=typeof _0x496b78[_0x4df6('0x18')]===_0x4df6('0x19')&&typeof _0x496b78[_0x4df6('0x1a')]===_0x4df6('0x19');var _0x42fbef=_0x4d4f44[_0x4df6('0x1b')];var _0x2941db=_0x272621?0x0:_0x496b78[_0x4df6('0x18')];var _0x21db4e=_0x272621?_0x4d4f44[_0x4df6('0x1b')]:_0x496b78['offset']+_0x496b78[_0x4df6('0x1a')];var _0x562cac;if(_0x21db4e>=_0x42fbef){_0x21db4e=_0x42fbef;_0x562cac=0xc8;}else{_0x562cac=0xce;}_0x592306[_0x4df6('0x15')](_0x562cac);return _0x592306[_0x4df6('0x1c')]('Content-Range',_0x2941db+'-'+_0x21db4e+'/'+_0x42fbef)[_0x4df6('0x17')](_0x4d4f44);}return null;};}function patchUpdates(_0x116e4a){return function(_0x9e1d8){try{jsonpatch[_0x4df6('0x1d')](_0x9e1d8,_0x116e4a,!![]);}catch(_0x409c66){return BPromise['reject'](_0x409c66);}return _0x9e1d8[_0x4df6('0x1e')]();};}function saveUpdates(_0x18a061,_0x23b2e6){return function(_0x2a4bee){if(_0x2a4bee){return _0x2a4bee['update'](_0x18a061)['then'](function(_0x48065e){return _0x48065e;});}return null;};}function removeEntity(_0x41b4ac,_0x3976f0){return function(_0x9c48c9){if(_0x9c48c9){return _0x9c48c9['destroy']()[_0x4df6('0x1f')](function(){_0x41b4ac[_0x4df6('0x15')](0xcc)[_0x4df6('0x16')]();});}};}function handleEntityNotFound(_0x418b68,_0x2cc0e1){return function(_0x725623){if(!_0x725623){_0x418b68[_0x4df6('0x14')](0x194);}return _0x725623;};}function handleError(_0x43a278,_0x516f44){_0x516f44=_0x516f44||0x1f4;return function(_0xe5ba02){logger[_0x4df6('0x20')](_0xe5ba02[_0x4df6('0x21')]);if(_0xe5ba02[_0x4df6('0x22')]){delete _0xe5ba02[_0x4df6('0x22')];}_0x43a278[_0x4df6('0x15')](_0x516f44)[_0x4df6('0x23')](_0xe5ba02);};}exports[_0x4df6('0x24')]=function(_0x732993,_0x206085){var _0x314931={},_0x1d5c90={},_0x2ef369={'count':0x0,'rows':[]};var _0x181bd4=_['map'](db[_0x4df6('0x25')][_0x4df6('0x26')],function(_0xaeeb9c){return{'name':_0xaeeb9c[_0x4df6('0x27')],'type':_0xaeeb9c[_0x4df6('0x28')]['key']};});_0x1d5c90[_0x4df6('0x29')]=_[_0x4df6('0x2a')](_0x181bd4,_0x4df6('0x22'));_0x1d5c90[_0x4df6('0x2b')]=_['keys'](_0x732993[_0x4df6('0x2b')]);_0x1d5c90['filters']=_['intersection'](_0x1d5c90[_0x4df6('0x29')],_0x1d5c90[_0x4df6('0x2b')]);_0x314931[_0x4df6('0x2c')]=_[_0x4df6('0x2d')](_0x1d5c90[_0x4df6('0x29')],qs[_0x4df6('0x2e')](_0x732993[_0x4df6('0x2b')][_0x4df6('0x2e')]));_0x314931[_0x4df6('0x2c')]=_0x314931[_0x4df6('0x2c')][_0x4df6('0x2f')]?_0x314931[_0x4df6('0x2c')]:_0x1d5c90['model'];if(!_0x732993['query'][_0x4df6('0x30')](_0x4df6('0x31'))){_0x314931[_0x4df6('0x1a')]=qs['limit'](_0x732993[_0x4df6('0x2b')]['limit']);_0x314931[_0x4df6('0x18')]=qs[_0x4df6('0x18')](_0x732993[_0x4df6('0x2b')]['offset']);}_0x314931['order']=qs['sort'](_0x732993[_0x4df6('0x2b')][_0x4df6('0x32')]);_0x314931['where']=qs[_0x4df6('0x33')](_[_0x4df6('0x34')](_0x732993['query'],_0x1d5c90[_0x4df6('0x33')]),_0x181bd4);if(_0x732993[_0x4df6('0x2b')][_0x4df6('0x35')]){_0x314931[_0x4df6('0x36')]=_[_0x4df6('0x37')](_0x314931['where'],{'$or':_[_0x4df6('0x2a')](_0x181bd4,function(_0x10c3be){if(_0x10c3be[_0x4df6('0x28')]!==_0x4df6('0x38')){var _0x1495d1={};_0x1495d1[_0x10c3be['name']]={'$like':'%'+_0x732993['query'][_0x4df6('0x35')]+'%'};return _0x1495d1;}})});}_0x314931=_[_0x4df6('0x37')]({},_0x314931,_0x732993[_0x4df6('0x39')]);var _0x34900d={'where':_0x314931[_0x4df6('0x36')]};return db[_0x4df6('0x25')][_0x4df6('0x1b')](_0x34900d)[_0x4df6('0x1f')](function(_0x2eda82){_0x2ef369['count']=_0x2eda82;if(_0x732993['query']['includeAll']){_0x314931[_0x4df6('0x3a')]=[{'all':!![]}];}return db[_0x4df6('0x25')][_0x4df6('0x3b')](_0x314931);})['then'](function(_0x30ec08){_0x2ef369[_0x4df6('0x3c')]=_0x30ec08;return _0x2ef369;})['then'](respondWithFilteredResult(_0x206085,_0x314931))[_0x4df6('0x3d')](handleError(_0x206085,null));};exports['show']=function(_0x3af8f3,_0x1b7b2a){var _0x31fb26={'raw':!![],'where':{'id':_0x3af8f3[_0x4df6('0x3e')]['id']}},_0x8751e5={};_0x8751e5[_0x4df6('0x29')]=_[_0x4df6('0x3f')](db[_0x4df6('0x25')][_0x4df6('0x26')]);_0x8751e5[_0x4df6('0x2b')]=_['keys'](_0x3af8f3['query']);_0x8751e5[_0x4df6('0x33')]=_['intersection'](_0x8751e5[_0x4df6('0x29')],_0x8751e5['query']);_0x31fb26[_0x4df6('0x2c')]=_[_0x4df6('0x2d')](_0x8751e5[_0x4df6('0x29')],qs[_0x4df6('0x2e')](_0x3af8f3[_0x4df6('0x2b')][_0x4df6('0x2e')]));_0x31fb26['attributes']=_0x31fb26[_0x4df6('0x2c')][_0x4df6('0x2f')]?_0x31fb26['attributes']:_0x8751e5[_0x4df6('0x29')];if(_0x3af8f3['query'][_0x4df6('0x40')]){_0x31fb26['include']=[{'all':!![]}];}_0x31fb26=_[_0x4df6('0x37')]({},_0x31fb26,_0x3af8f3[_0x4df6('0x39')]);return db['MailTransferReport'][_0x4df6('0x41')](_0x31fb26)[_0x4df6('0x1f')](handleEntityNotFound(_0x1b7b2a,null))[_0x4df6('0x1f')](respondWithResult(_0x1b7b2a,null))[_0x4df6('0x3d')](handleError(_0x1b7b2a,null));};exports[_0x4df6('0x42')]=function(_0x2d15d6,_0x79f297){return db[_0x4df6('0x25')]['create'](_0x2d15d6[_0x4df6('0x43')],{})[_0x4df6('0x1f')](respondWithResult(_0x79f297,0xc9))[_0x4df6('0x3d')](handleError(_0x79f297,null));};exports[_0x4df6('0x44')]=function(_0x4c8200,_0x53486e){if(_0x4c8200[_0x4df6('0x43')]['id']){delete _0x4c8200[_0x4df6('0x43')]['id'];}return db[_0x4df6('0x25')][_0x4df6('0x41')]({'where':{'id':_0x4c8200[_0x4df6('0x3e')]['id']}})[_0x4df6('0x1f')](handleEntityNotFound(_0x53486e,null))[_0x4df6('0x1f')](saveUpdates(_0x4c8200[_0x4df6('0x43')],null))[_0x4df6('0x1f')](respondWithResult(_0x53486e,null))['catch'](handleError(_0x53486e,null));};exports[_0x4df6('0x45')]=function(_0x1a43be,_0x1d0b79){return db[_0x4df6('0x25')]['find']({'where':{'id':_0x1a43be[_0x4df6('0x3e')]['id']}})[_0x4df6('0x1f')](handleEntityNotFound(_0x1d0b79,null))[_0x4df6('0x1f')](removeEntity(_0x1d0b79,null))[_0x4df6('0x3d')](handleError(_0x1d0b79,null));};exports[_0x4df6('0x46')]=function(_0x3f705d,_0x5bf3ec){return db[_0x4df6('0x25')][_0x4df6('0x46')]()[_0x4df6('0x1f')](respondWithResult(_0x5bf3ec,null))['catch'](handleError(_0x5bf3ec,null));}; \ No newline at end of file +var _0x88b1=['index','query','keys','filters','intersection','model','fields','attributes','length','order','where','pick','filter','merge','map','type','options','MailTransferReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send'];(function(_0x2389fb,_0x17cb72){var _0xac4fc8=function(_0x3df43f){while(--_0x3df43f){_0x2389fb['push'](_0x2389fb['shift']());}};_0xac4fc8(++_0x17cb72);}(_0x88b1,0x136));var _0x188b=function(_0x12063d,_0x1ad834){_0x12063d=_0x12063d-0x0;var _0x306a78=_0x88b1[_0x12063d];return _0x306a78;};'use strict';var emlformat=require(_0x188b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x188b('0x1'));var jsonpatch=require(_0x188b('0x2'));var rp=require('request-promise');var moment=require(_0x188b('0x3'));var BPromise=require(_0x188b('0x4'));var Mustache=require(_0x188b('0x5'));var util=require(_0x188b('0x6'));var path=require('path');var sox=require(_0x188b('0x7'));var csv=require('to-csv');var ejs=require(_0x188b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x188b('0x9'));var crypto=require('crypto');var jsforce=require(_0x188b('0xa'));var deskjs=require(_0x188b('0xb'));var toCsv=require(_0x188b('0xc'));var querystring=require('querystring');var Papa=require(_0x188b('0xd'));var Redis=require(_0x188b('0xe'));var authService=require(_0x188b('0xf'));var qs=require(_0x188b('0x10'));var as=require(_0x188b('0x11'));var hardwareService=require(_0x188b('0x12'));var logger=require(_0x188b('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x188b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x188b('0x15'))['db'];function respondWithStatusCode(_0x4eb967,_0x273e07){_0x273e07=_0x273e07||0xcc;return function(_0x514f02){if(_0x514f02){return _0x4eb967['sendStatus'](_0x273e07);}return _0x4eb967[_0x188b('0x16')](_0x273e07)[_0x188b('0x17')]();};}function respondWithResult(_0x25648d,_0x34ba6d){_0x34ba6d=_0x34ba6d||0xc8;return function(_0x419161){if(_0x419161){return _0x25648d['status'](_0x34ba6d)[_0x188b('0x18')](_0x419161);}};}function respondWithFilteredResult(_0x57cda7,_0x1330e4){return function(_0x4af45e){if(_0x4af45e){var _0x5dbf0e=typeof _0x1330e4[_0x188b('0x19')]===_0x188b('0x1a')&&typeof _0x1330e4[_0x188b('0x1b')]===_0x188b('0x1a');var _0x1b2e03=_0x4af45e[_0x188b('0x1c')];var _0x48932f=_0x5dbf0e?0x0:_0x1330e4['offset'];var _0x12927c=_0x5dbf0e?_0x4af45e['count']:_0x1330e4[_0x188b('0x19')]+_0x1330e4[_0x188b('0x1b')];var _0x56f4a1;if(_0x12927c>=_0x1b2e03){_0x12927c=_0x1b2e03;_0x56f4a1=0xc8;}else{_0x56f4a1=0xce;}_0x57cda7[_0x188b('0x16')](_0x56f4a1);return _0x57cda7['set'](_0x188b('0x1d'),_0x48932f+'-'+_0x12927c+'/'+_0x1b2e03)[_0x188b('0x18')](_0x4af45e);}return null;};}function patchUpdates(_0x2d4ee6){return function(_0x35cb6c){try{jsonpatch[_0x188b('0x1e')](_0x35cb6c,_0x2d4ee6,!![]);}catch(_0xc1971e){return BPromise['reject'](_0xc1971e);}return _0x35cb6c[_0x188b('0x1f')]();};}function saveUpdates(_0x391b7d,_0x28a900){return function(_0x41eb0e){if(_0x41eb0e){return _0x41eb0e[_0x188b('0x20')](_0x391b7d)[_0x188b('0x21')](function(_0x4efa94){return _0x4efa94;});}return null;};}function removeEntity(_0x55cda3,_0x23785b){return function(_0x2d6a){if(_0x2d6a){return _0x2d6a[_0x188b('0x22')]()[_0x188b('0x21')](function(){_0x55cda3[_0x188b('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a613c,_0xe33091){return function(_0x458745){if(!_0x458745){_0x2a613c[_0x188b('0x23')](0x194);}return _0x458745;};}function handleError(_0x1b96a5,_0x3cbff3){_0x3cbff3=_0x3cbff3||0x1f4;return function(_0x1fccd5){logger[_0x188b('0x24')](_0x1fccd5[_0x188b('0x25')]);if(_0x1fccd5[_0x188b('0x26')]){delete _0x1fccd5[_0x188b('0x26')];}_0x1b96a5['status'](_0x3cbff3)[_0x188b('0x27')](_0x1fccd5);};}exports[_0x188b('0x28')]=function(_0x26214f,_0x501bdd){var _0x1431aa={},_0x31ec15={},_0xcff4a7={'count':0x0,'rows':[]};var _0x24aca7=_['map'](db['MailTransferReport']['rawAttributes'],function(_0x11fd47){return{'name':_0x11fd47['fieldName'],'type':_0x11fd47['type']['key']};});_0x31ec15['model']=_['map'](_0x24aca7,_0x188b('0x26'));_0x31ec15[_0x188b('0x29')]=_[_0x188b('0x2a')](_0x26214f[_0x188b('0x29')]);_0x31ec15[_0x188b('0x2b')]=_[_0x188b('0x2c')](_0x31ec15['model'],_0x31ec15[_0x188b('0x29')]);_0x1431aa['attributes']=_[_0x188b('0x2c')](_0x31ec15[_0x188b('0x2d')],qs[_0x188b('0x2e')](_0x26214f[_0x188b('0x29')][_0x188b('0x2e')]));_0x1431aa[_0x188b('0x2f')]=_0x1431aa[_0x188b('0x2f')][_0x188b('0x30')]?_0x1431aa['attributes']:_0x31ec15[_0x188b('0x2d')];if(!_0x26214f[_0x188b('0x29')]['hasOwnProperty']('nolimit')){_0x1431aa[_0x188b('0x1b')]=qs[_0x188b('0x1b')](_0x26214f[_0x188b('0x29')][_0x188b('0x1b')]);_0x1431aa['offset']=qs['offset'](_0x26214f[_0x188b('0x29')][_0x188b('0x19')]);}_0x1431aa[_0x188b('0x31')]=qs['sort'](_0x26214f[_0x188b('0x29')]['sort']);_0x1431aa[_0x188b('0x32')]=qs[_0x188b('0x2b')](_[_0x188b('0x33')](_0x26214f['query'],_0x31ec15[_0x188b('0x2b')]),_0x24aca7);if(_0x26214f[_0x188b('0x29')][_0x188b('0x34')]){_0x1431aa[_0x188b('0x32')]=_[_0x188b('0x35')](_0x1431aa[_0x188b('0x32')],{'$or':_[_0x188b('0x36')](_0x24aca7,function(_0x2da4a7){if(_0x2da4a7[_0x188b('0x37')]!=='VIRTUAL'){var _0x24310e={};_0x24310e[_0x2da4a7[_0x188b('0x26')]]={'$like':'%'+_0x26214f[_0x188b('0x29')][_0x188b('0x34')]+'%'};return _0x24310e;}})});}_0x1431aa=_[_0x188b('0x35')]({},_0x1431aa,_0x26214f[_0x188b('0x38')]);var _0x9e7ac5={'where':_0x1431aa[_0x188b('0x32')]};return db[_0x188b('0x39')][_0x188b('0x1c')](_0x9e7ac5)[_0x188b('0x21')](function(_0x16396c){_0xcff4a7[_0x188b('0x1c')]=_0x16396c;if(_0x26214f[_0x188b('0x29')][_0x188b('0x3a')]){_0x1431aa[_0x188b('0x3b')]=[{'all':!![]}];}return db['MailTransferReport'][_0x188b('0x3c')](_0x1431aa);})[_0x188b('0x21')](function(_0xc9d29b){_0xcff4a7[_0x188b('0x3d')]=_0xc9d29b;return _0xcff4a7;})[_0x188b('0x21')](respondWithFilteredResult(_0x501bdd,_0x1431aa))[_0x188b('0x3e')](handleError(_0x501bdd,null));};exports[_0x188b('0x3f')]=function(_0x1e044d,_0x4632d2){var _0x5dfe19={'raw':!![],'where':{'id':_0x1e044d[_0x188b('0x40')]['id']}},_0x4d2433={};_0x4d2433[_0x188b('0x2d')]=_[_0x188b('0x2a')](db[_0x188b('0x39')][_0x188b('0x41')]);_0x4d2433[_0x188b('0x29')]=_[_0x188b('0x2a')](_0x1e044d[_0x188b('0x29')]);_0x4d2433[_0x188b('0x2b')]=_[_0x188b('0x2c')](_0x4d2433[_0x188b('0x2d')],_0x4d2433['query']);_0x5dfe19[_0x188b('0x2f')]=_[_0x188b('0x2c')](_0x4d2433[_0x188b('0x2d')],qs[_0x188b('0x2e')](_0x1e044d['query'][_0x188b('0x2e')]));_0x5dfe19['attributes']=_0x5dfe19['attributes'][_0x188b('0x30')]?_0x5dfe19[_0x188b('0x2f')]:_0x4d2433[_0x188b('0x2d')];if(_0x1e044d[_0x188b('0x29')][_0x188b('0x3a')]){_0x5dfe19['include']=[{'all':!![]}];}_0x5dfe19=_['merge']({},_0x5dfe19,_0x1e044d[_0x188b('0x38')]);return db[_0x188b('0x39')][_0x188b('0x42')](_0x5dfe19)[_0x188b('0x21')](handleEntityNotFound(_0x4632d2,null))[_0x188b('0x21')](respondWithResult(_0x4632d2,null))['catch'](handleError(_0x4632d2,null));};exports[_0x188b('0x43')]=function(_0x1431fc,_0x233bf8){return db[_0x188b('0x39')]['create'](_0x1431fc[_0x188b('0x44')],{})[_0x188b('0x21')](respondWithResult(_0x233bf8,0xc9))[_0x188b('0x3e')](handleError(_0x233bf8,null));};exports['update']=function(_0x38a139,_0x4c10f5){if(_0x38a139['body']['id']){delete _0x38a139['body']['id'];}return db[_0x188b('0x39')][_0x188b('0x42')]({'where':{'id':_0x38a139[_0x188b('0x40')]['id']}})[_0x188b('0x21')](handleEntityNotFound(_0x4c10f5,null))[_0x188b('0x21')](saveUpdates(_0x38a139[_0x188b('0x44')],null))[_0x188b('0x21')](respondWithResult(_0x4c10f5,null))[_0x188b('0x3e')](handleError(_0x4c10f5,null));};exports[_0x188b('0x22')]=function(_0x736812,_0x38298d){return db[_0x188b('0x39')][_0x188b('0x42')]({'where':{'id':_0x736812[_0x188b('0x40')]['id']}})[_0x188b('0x21')](handleEntityNotFound(_0x38298d,null))['then'](removeEntity(_0x38298d,null))[_0x188b('0x3e')](handleError(_0x38298d,null));};exports[_0x188b('0x45')]=function(_0x207f41,_0x14e7e5){return db[_0x188b('0x39')][_0x188b('0x45')]()['then'](respondWithResult(_0x14e7e5,null))[_0x188b('0x3e')](handleError(_0x14e7e5,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index b6752c4..97400b0 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 _0x78b7=['bluebird','request-promise','path','./mailTransferReport.attributes','exports','define','MailTransferReport','uniqueid','lodash','util','api','moment'];(function(_0x28dd54,_0x42d4fd){var _0x977b10=function(_0x5526ef){while(--_0x5526ef){_0x28dd54['push'](_0x28dd54['shift']());}};_0x977b10(++_0x42d4fd);}(_0x78b7,0x194));var _0x778b=function(_0x44fd81,_0x4003db){_0x44fd81=_0x44fd81-0x0;var _0x32d50c=_0x78b7[_0x44fd81];return _0x32d50c;};'use strict';var _=require(_0x778b('0x0'));var util=require(_0x778b('0x1'));var logger=require('../../config/logger')(_0x778b('0x2'));var moment=require(_0x778b('0x3'));var BPromise=require(_0x778b('0x4'));var rp=require(_0x778b('0x5'));var fs=require('fs');var path=require(_0x778b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x778b('0x7'));module[_0x778b('0x8')]=function(_0x11b624,_0xb6f0af){return _0x11b624[_0x778b('0x9')](_0x778b('0xa'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x778b('0xb'),'fields':[_0x778b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf50a=['util','api','bluebird','request-promise','path','../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer','uniqueid'];(function(_0xe7e834,_0x57e2da){var _0x38d48d=function(_0x4296b2){while(--_0x4296b2){_0xe7e834['push'](_0xe7e834['shift']());}};_0x38d48d(++_0x57e2da);}(_0xf50a,0x1b8));var _0xaf50=function(_0x54f060,_0x1de751){_0x54f060=_0x54f060-0x0;var _0xb2b587=_0xf50a[_0x54f060];return _0xb2b587;};'use strict';var _=require('lodash');var util=require(_0xaf50('0x0'));var logger=require('../../config/logger')(_0xaf50('0x1'));var moment=require('moment');var BPromise=require(_0xaf50('0x2'));var rp=require(_0xaf50('0x3'));var fs=require('fs');var path=require(_0xaf50('0x4'));var rimraf=require('rimraf');var config=require(_0xaf50('0x5'));var attributes=require(_0xaf50('0x6'));module['exports']=function(_0x6b142f,_0x55abcd){return _0x6b142f[_0xaf50('0x7')](_0xaf50('0x8'),attributes,{'tableName':_0xaf50('0x9'),'paranoid':![],'indexes':[{'name':_0xaf50('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index e568032..4f3472f 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 _0x8c54=['info','MailTransferReport,\x20%s,\x20%s','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0xb106c7,_0x1e0c90){var _0x24a91e=function(_0x3805b6){while(--_0x3805b6){_0xb106c7['push'](_0xb106c7['shift']());}};_0x24a91e(++_0x1e0c90);}(_0x8c54,0x1aa));var _0x48c5=function(_0x53c6cb,_0xefbc9b){_0x53c6cb=_0x53c6cb-0x0;var _0x5a68bc=_0x8c54[_0x53c6cb];return _0x5a68bc;};'use strict';var _=require(_0x48c5('0x0'));var util=require(_0x48c5('0x1'));var moment=require(_0x48c5('0x2'));var BPromise=require(_0x48c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x48c5('0x4'));var db=require(_0x48c5('0x5'))['db'];var utils=require(_0x48c5('0x6'));var logger=require(_0x48c5('0x7'))(_0x48c5('0x8'));var config=require('../../config/environment');var jayson=require(_0x48c5('0x9'));var client=jayson[_0x48c5('0xa')][_0x48c5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38895c,_0x3aedf4,_0x382ab6){return new BPromise(function(_0x255213,_0x5b0007){return client[_0x48c5('0xc')](_0x38895c,_0x382ab6)[_0x48c5('0xd')](function(_0x227faf){logger[_0x48c5('0xe')](_0x48c5('0xf'),_0x3aedf4,'request\x20sent');logger['debug'](_0x48c5('0x10'),_0x3aedf4,_0x48c5('0x11'),JSON['stringify'](_0x227faf));if(_0x227faf[_0x48c5('0x12')]){if(_0x227faf['error']['code']===0x1f4){logger[_0x48c5('0x12')](_0x48c5('0xf'),_0x3aedf4,_0x227faf[_0x48c5('0x12')][_0x48c5('0x13')]);return _0x5b0007(_0x227faf[_0x48c5('0x12')]['message']);}logger[_0x48c5('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x3aedf4,_0x227faf[_0x48c5('0x12')]['message']);return _0x255213(_0x227faf[_0x48c5('0x12')]['message']);}else{logger['info'](_0x48c5('0xf'),_0x3aedf4,_0x48c5('0x11'));_0x255213(_0x227faf[_0x48c5('0x14')]['message']);}})[_0x48c5('0x15')](function(_0x400e66){logger['error'](_0x48c5('0xf'),_0x3aedf4,_0x400e66);_0x5b0007(_0x400e66);});});} \ No newline at end of file +var _0xf2a1=['bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','moment'];(function(_0x37a609,_0x10a0b9){var _0x57dbbb=function(_0x27cb49){while(--_0x27cb49){_0x37a609['push'](_0x37a609['shift']());}};_0x57dbbb(++_0x10a0b9);}(_0xf2a1,0xa8));var _0x1f2a=function(_0x64a381,_0xcbbbeb){_0x64a381=_0x64a381-0x0;var _0x356a29=_0xf2a1[_0x64a381];return _0x356a29;};'use strict';var _=require(_0x1f2a('0x0'));var util=require(_0x1f2a('0x1'));var moment=require(_0x1f2a('0x2'));var BPromise=require(_0x1f2a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1f2a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1f2a('0x5'))(_0x1f2a('0x6'));var config=require(_0x1f2a('0x7'));var jayson=require(_0x1f2a('0x8'));var client=jayson[_0x1f2a('0x9')][_0x1f2a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa564a1,_0x3adf45,_0x4803eb){return new BPromise(function(_0x39a3e8,_0x3d863e){return client[_0x1f2a('0xb')](_0xa564a1,_0x4803eb)['then'](function(_0x460faf){logger[_0x1f2a('0xc')](_0x1f2a('0xd'),_0x3adf45,_0x1f2a('0xe'));logger['debug'](_0x1f2a('0xf'),_0x3adf45,_0x1f2a('0xe'),JSON['stringify'](_0x460faf));if(_0x460faf[_0x1f2a('0x10')]){if(_0x460faf[_0x1f2a('0x10')][_0x1f2a('0x11')]===0x1f4){logger[_0x1f2a('0x10')](_0x1f2a('0xd'),_0x3adf45,_0x460faf[_0x1f2a('0x10')][_0x1f2a('0x12')]);return _0x3d863e(_0x460faf[_0x1f2a('0x10')][_0x1f2a('0x12')]);}logger[_0x1f2a('0x10')](_0x1f2a('0xd'),_0x3adf45,_0x460faf[_0x1f2a('0x10')]['message']);return _0x39a3e8(_0x460faf[_0x1f2a('0x10')][_0x1f2a('0x12')]);}else{logger[_0x1f2a('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x3adf45,_0x1f2a('0xe'));_0x39a3e8(_0x460faf['result']['message']);}})['catch'](function(_0x220600){logger[_0x1f2a('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x3adf45,_0x220600);_0x3d863e(_0x220600);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 6aad9c7..647b096 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 _0x09ba=['put','update','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x593ad1,_0x5b068f){var _0x57f46e=function(_0x327d20){while(--_0x327d20){_0x593ad1['push'](_0x593ad1['shift']());}};_0x57f46e(++_0x5b068f);}(_0x09ba,0x124));var _0xa09b=function(_0x16017e,_0xf8154b){_0x16017e=_0x16017e-0x0;var _0x365023=_0x09ba[_0x16017e];return _0x365023;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xa09b('0x0'));var express=require(_0xa09b('0x1'));var router=express[_0xa09b('0x2')]();var fs_extra=require(_0xa09b('0x3'));var auth=require(_0xa09b('0x4'));var interaction=require(_0xa09b('0x5'));var config=require(_0xa09b('0x6'));var controller=require(_0xa09b('0x7'));router[_0xa09b('0x8')]('/',auth[_0xa09b('0x9')](),controller['index']);router[_0xa09b('0x8')](_0xa09b('0xa'),auth[_0xa09b('0x9')](),controller['describe']);router[_0xa09b('0x8')](_0xa09b('0xb'),auth[_0xa09b('0x9')](),controller['show']);router[_0xa09b('0xc')]('/',auth[_0xa09b('0x9')](),controller[_0xa09b('0xd')]);router[_0xa09b('0xe')](_0xa09b('0xb'),auth[_0xa09b('0x9')](),controller[_0xa09b('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xa09b('0x10')]=router; \ No newline at end of file +var _0x2a9b=['util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports'];(function(_0x4ee3d1,_0x1a1f67){var _0x2cad62=function(_0x759833){while(--_0x759833){_0x4ee3d1['push'](_0x4ee3d1['shift']());}};_0x2cad62(++_0x1a1f67);}(_0x2a9b,0xfc));var _0xb2a9=function(_0x2694ec,_0x35026c){_0x2694ec=_0x2694ec-0x0;var _0x25c06a=_0x2a9b[_0x2694ec];return _0x25c06a;};'use strict';var multer=require('multer');var util=require(_0xb2a9('0x0'));var path=require(_0xb2a9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb2a9('0x2')]();var fs_extra=require(_0xb2a9('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb2a9('0x4'));var config=require(_0xb2a9('0x5'));var controller=require('./memberReport.controller');router['get']('/',auth[_0xb2a9('0x6')](),controller[_0xb2a9('0x7')]);router['get'](_0xb2a9('0x8'),auth[_0xb2a9('0x6')](),controller[_0xb2a9('0x9')]);router['get'](_0xb2a9('0xa'),auth[_0xb2a9('0x6')](),controller[_0xb2a9('0xb')]);router[_0xb2a9('0xc')]('/',auth[_0xb2a9('0x6')](),controller['create']);router[_0xb2a9('0xd')](_0xb2a9('0xa'),auth[_0xb2a9('0x6')](),controller[_0xb2a9('0xe')]);router[_0xb2a9('0xf')](_0xb2a9('0xa'),auth[_0xb2a9('0x6')](),controller[_0xb2a9('0x10')]);module[_0xb2a9('0x11')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index b678954..95178e0 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 _0xc6f2=['sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','diff','exitAt','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]'];(function(_0x3f7830,_0x2ef515){var _0x392bcf=function(_0x495eb3){while(--_0x495eb3){_0x3f7830['push'](_0x3f7830['shift']());}};_0x392bcf(++_0x2ef515);}(_0xc6f2,0xdd));var _0x2c6f=function(_0x4ab274,_0x1fa068){_0x4ab274=_0x4ab274-0x0;var _0x5ef03b=_0xc6f2[_0x4ab274];return _0x5ef03b;};'use strict';var Sequelize=require(_0x2c6f('0x0'));var moment=require(_0x2c6f('0x1'));module[_0x2c6f('0x2')]={'channel':{'type':Sequelize[_0x2c6f('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x2c6f('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x2c6f('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x2c6f('0x5')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x2c6f('0x6')],'set':function(_0x3ef2d7){var _0x5c9306=moment(_0x3ef2d7);var _0x5ac1da=moment(this[_0x2c6f('0x7')]('enterAt'));var _0x1987df=_0x5c9306[_0x2c6f('0x8')](_0x5ac1da,'seconds');this['setDataValue'](_0x2c6f('0x9'),_0x3ef2d7);this[_0x2c6f('0xa')](_0x2c6f('0xb'),_0x1987df>=0x0?_0x1987df:null);}},'data1':{'type':Sequelize[_0x2c6f('0x3')],'comment':_0x2c6f('0xc')},'data2':{'type':Sequelize[_0x2c6f('0x3')],'comment':_0x2c6f('0xd')},'data3':{'type':Sequelize[_0x2c6f('0x3')],'comment':_0x2c6f('0xe')},'data4':{'type':Sequelize['STRING'],'comment':_0x2c6f('0xf')},'data5':{'type':Sequelize[_0x2c6f('0x3')],'comment':_0x2c6f('0x10')},'role':{'type':Sequelize[_0x2c6f('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x2c6f('0x3')]}}; \ No newline at end of file +var _0xab7a=['talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','getDataValue','enterAt','seconds','exitAt','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]'];(function(_0x337e68,_0x4f659d){var _0x40c149=function(_0x1d01c4){while(--_0x1d01c4){_0x337e68['push'](_0x337e68['shift']());}};_0x40c149(++_0x4f659d);}(_0xab7a,0x19a));var _0xaab7=function(_0x2aedd1,_0x1c21c5){_0x2aedd1=_0x2aedd1-0x0;var _0x53d33f=_0xab7a[_0x2aedd1];return _0x53d33f;};'use strict';var Sequelize=require(_0xaab7('0x0'));var moment=require(_0xaab7('0x1'));module[_0xaab7('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xaab7('0x3')]},'interface':{'type':Sequelize[_0xaab7('0x3')]},'type':{'type':Sequelize[_0xaab7('0x3')],'defaultValue':_0xaab7('0x4'),'comment':_0xaab7('0x5')},'duration':{'type':Sequelize[_0xaab7('0x6')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x5df553){var _0x362455=moment(_0x5df553);var _0x5a35dd=moment(this[_0xaab7('0x7')](_0xaab7('0x8')));var _0x5ced25=_0x362455['diff'](_0x5a35dd,_0xaab7('0x9'));this['setDataValue'](_0xaab7('0xa'),_0x5df553);this[_0xaab7('0xb')](_0xaab7('0xc'),_0x5ced25>=0x0?_0x5ced25:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xaab7('0xd')},'data2':{'type':Sequelize[_0xaab7('0x3')],'comment':_0xaab7('0xe')},'data3':{'type':Sequelize[_0xaab7('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':_0xaab7('0xf')},'data5':{'type':Sequelize[_0xaab7('0x3')],'comment':_0xaab7('0x10')},'role':{'type':Sequelize[_0xaab7('0x3')]},'internal':{'type':Sequelize[_0xaab7('0x6')]},'uniqueid':{'type':Sequelize[_0xaab7('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 42d1675..869fb92 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 _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x384c01,_0x1e0dc5){var _0x300793=function(_0x32bb86){while(--_0x32bb86){_0x384c01['push'](_0x384c01['shift']());}};_0x300793(++_0x1e0dc5);}(_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['MemberReport']['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['MemberReport'][_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['MemberReport'][_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('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file +var _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x4057ca,_0xbe5390){var _0x20f2ea=function(_0x2f89ec){while(--_0x2f89ec){_0x4057ca['push'](_0x4057ca['shift']());}};_0x20f2ea(++_0xbe5390);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['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['MemberReport'][_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['MemberReport'][_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('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 86f0b4c..67efaec 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 _0x8e84=['../../config/environment','exports','define','report_member','interface','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x402082,_0xdba255){var _0x423879=function(_0xd904e){while(--_0xd904e){_0x402082['push'](_0x402082['shift']());}};_0x423879(++_0xdba255);}(_0x8e84,0x1b2));var _0x48e8=function(_0x335553,_0x2cdac2){_0x335553=_0x335553-0x0;var _0x1cfd50=_0x8e84[_0x335553];return _0x1cfd50;};'use strict';var _=require('lodash');var util=require(_0x48e8('0x0'));var logger=require(_0x48e8('0x1'))(_0x48e8('0x2'));var moment=require(_0x48e8('0x3'));var BPromise=require(_0x48e8('0x4'));var rp=require(_0x48e8('0x5'));var fs=require('fs');var path=require(_0x48e8('0x6'));var rimraf=require(_0x48e8('0x7'));var config=require(_0x48e8('0x8'));var attributes=require('./memberReport.attributes');module[_0x48e8('0x9')]=function(_0x380a93,_0x20f334){return _0x380a93[_0x48e8('0xa')]('MemberReport',attributes,{'tableName':_0x48e8('0xb'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername',_0x48e8('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0e1c=['define','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x53e597,_0xdedb92){var _0x34244e=function(_0x2092da){while(--_0x2092da){_0x53e597['push'](_0x53e597['shift']());}};_0x34244e(++_0xdedb92);}(_0x0e1c,0x140));var _0xc0e1=function(_0x15a855,_0x31605a){_0x15a855=_0x15a855-0x0;var _0x5cdf22=_0x0e1c[_0x15a855];return _0x5cdf22;};'use strict';var _=require(_0xc0e1('0x0'));var util=require(_0xc0e1('0x1'));var logger=require(_0xc0e1('0x2'))('api');var moment=require(_0xc0e1('0x3'));var BPromise=require(_0xc0e1('0x4'));var rp=require(_0xc0e1('0x5'));var fs=require('fs');var path=require(_0xc0e1('0x6'));var rimraf=require(_0xc0e1('0x7'));var config=require(_0xc0e1('0x8'));var attributes=require('./memberReport.attributes');module[_0xc0e1('0x9')]=function(_0x538266,_0xcfdb23){return _0x538266[_0xc0e1('0xa')]('MemberReport',attributes,{'tableName':_0xc0e1('0xb'),'paranoid':![],'indexes':[{'name':_0xc0e1('0xc'),'fields':[_0xc0e1('0xd'),_0xc0e1('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index b9260e0..65e0e56 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 _0xf8bb=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','MemberReport','findAll','options','raw','where','limit','map','model','attributes','include','then','GetMemberReport','CreateMemberReport','body','UpdateMemberReport','update'];(function(_0x3ffe48,_0x893fc1){var _0x14fac7=function(_0x574e28){while(--_0x574e28){_0x3ffe48['push'](_0x3ffe48['shift']());}};_0x14fac7(++_0x893fc1);}(_0xf8bb,0x111));var _0xbf8b=function(_0x5c897f,_0x1608b1){_0x5c897f=_0x5c897f-0x0;var _0x399efc=_0xf8bb[_0x5c897f];return _0x399efc;};'use strict';var _=require(_0xbf8b('0x0'));var util=require(_0xbf8b('0x1'));var moment=require(_0xbf8b('0x2'));var BPromise=require('bluebird');var rs=require(_0xbf8b('0x3'));var fs=require('fs');var Redis=require(_0xbf8b('0x4'));var db=require(_0xbf8b('0x5'))['db'];var utils=require(_0xbf8b('0x6'));var logger=require(_0xbf8b('0x7'))(_0xbf8b('0x8'));var config=require(_0xbf8b('0x9'));var jayson=require(_0xbf8b('0xa'));var client=jayson[_0xbf8b('0xb')][_0xbf8b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3b5f9e,_0x2dbd86,_0xd17f35){return new BPromise(function(_0x4b554f,_0x36692f){return client['request'](_0x3b5f9e,_0xd17f35)['then'](function(_0x69a492){logger['info'](_0xbf8b('0xd'),_0x2dbd86,'request\x20sent');logger[_0xbf8b('0xe')](_0xbf8b('0xf'),_0x2dbd86,_0xbf8b('0x10'),JSON[_0xbf8b('0x11')](_0x69a492));if(_0x69a492[_0xbf8b('0x12')]){if(_0x69a492[_0xbf8b('0x12')][_0xbf8b('0x13')]===0x1f4){logger[_0xbf8b('0x12')]('MemberReport,\x20%s,\x20%s',_0x2dbd86,_0x69a492[_0xbf8b('0x12')][_0xbf8b('0x14')]);return _0x36692f(_0x69a492['error'][_0xbf8b('0x14')]);}logger[_0xbf8b('0x12')](_0xbf8b('0xd'),_0x2dbd86,_0x69a492[_0xbf8b('0x12')][_0xbf8b('0x14')]);return _0x4b554f(_0x69a492[_0xbf8b('0x12')][_0xbf8b('0x14')]);}else{logger[_0xbf8b('0x15')](_0xbf8b('0xd'),_0x2dbd86,_0xbf8b('0x10'));_0x4b554f(_0x69a492['result'][_0xbf8b('0x14')]);}})[_0xbf8b('0x16')](function(_0x3d605b){logger[_0xbf8b('0x12')](_0xbf8b('0xd'),_0x2dbd86,_0x3d605b);_0x36692f(_0x3d605b);});});}exports['GetMemberReport']=function(_0x3bab93){var _0x12b08c=this;return new Promise(function(_0x460f3d,_0x507350){return db[_0xbf8b('0x17')][_0xbf8b('0x18')]({'raw':_0x3bab93[_0xbf8b('0x19')]?_0x3bab93['options'][_0xbf8b('0x1a')]===undefined?!![]:![]:!![],'where':_0x3bab93[_0xbf8b('0x19')]?_0x3bab93[_0xbf8b('0x19')][_0xbf8b('0x1b')]||null:null,'attributes':_0x3bab93[_0xbf8b('0x19')]?_0x3bab93[_0xbf8b('0x19')]['attributes']||null:null,'limit':_0x3bab93['options']?_0x3bab93['options'][_0xbf8b('0x1c')]||null:null,'include':_0x3bab93['options']?_0x3bab93[_0xbf8b('0x19')]['include']?_[_0xbf8b('0x1d')](_0x3bab93['options']['include'],function(_0x3be6ef){return{'model':db[_0x3be6ef[_0xbf8b('0x1e')]],'as':_0x3be6ef['as'],'attributes':_0x3be6ef[_0xbf8b('0x1f')],'include':_0x3be6ef[_0xbf8b('0x20')]?_[_0xbf8b('0x1d')](_0x3be6ef[_0xbf8b('0x20')],function(_0x34089d){return{'model':db[_0x34089d[_0xbf8b('0x1e')]],'as':_0x34089d['as'],'attributes':_0x34089d['attributes'],'include':_0x34089d[_0xbf8b('0x20')]?_[_0xbf8b('0x1d')](_0x34089d[_0xbf8b('0x20')],function(_0x18d1d5){return{'model':db[_0x18d1d5['model']],'as':_0x18d1d5['as'],'attributes':_0x18d1d5[_0xbf8b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xbf8b('0x21')](function(_0x5534ce){logger[_0xbf8b('0x15')](_0xbf8b('0x22'),_0x3bab93);logger[_0xbf8b('0xe')](_0xbf8b('0x22'),_0x3bab93,JSON[_0xbf8b('0x11')](_0x5534ce));_0x460f3d(_0x5534ce);})[_0xbf8b('0x16')](function(_0xc14007){logger[_0xbf8b('0x12')](_0xbf8b('0x22'),_0xc14007[_0xbf8b('0x14')],_0x3bab93);_0x507350(_0x12b08c[_0xbf8b('0x12')](0x1f4,_0xc14007[_0xbf8b('0x14')]));});});};exports[_0xbf8b('0x23')]=function(_0x5519a1){var _0x22aa17=this;return new Promise(function(_0x6b24f6,_0x224d45){return db[_0xbf8b('0x17')]['create'](_0x5519a1[_0xbf8b('0x24')],{'raw':_0x5519a1[_0xbf8b('0x19')]?_0x5519a1[_0xbf8b('0x19')][_0xbf8b('0x1a')]===undefined?!![]:![]:!![]})[_0xbf8b('0x21')](function(_0x18476d){logger[_0xbf8b('0x15')](_0xbf8b('0x23'),_0x5519a1);logger[_0xbf8b('0xe')](_0xbf8b('0x23'),_0x5519a1,JSON[_0xbf8b('0x11')](_0x18476d));_0x6b24f6(_0x18476d);})[_0xbf8b('0x16')](function(_0x520d4e){logger[_0xbf8b('0x12')]('CreateMemberReport',_0x520d4e['message'],_0x5519a1);_0x224d45(_0x22aa17[_0xbf8b('0x12')](0x1f4,_0x520d4e[_0xbf8b('0x14')]));});});};exports[_0xbf8b('0x25')]=function(_0x38dd6d){var _0x4738b2=this;return new Promise(function(_0x4f1732,_0x492ae6){return db[_0xbf8b('0x17')][_0xbf8b('0x26')](_0x38dd6d[_0xbf8b('0x24')],{'raw':_0x38dd6d[_0xbf8b('0x19')]?_0x38dd6d[_0xbf8b('0x19')][_0xbf8b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38dd6d[_0xbf8b('0x19')]?_0x38dd6d[_0xbf8b('0x19')][_0xbf8b('0x1b')]||null:null,'attributes':_0x38dd6d[_0xbf8b('0x19')]?_0x38dd6d['options'][_0xbf8b('0x1f')]||null:null,'limit':_0x38dd6d[_0xbf8b('0x19')]?_0x38dd6d['options'][_0xbf8b('0x1c')]||null:null})[_0xbf8b('0x21')](function(_0x13822b){logger[_0xbf8b('0x15')](_0xbf8b('0x25'),_0x38dd6d);logger['debug'](_0xbf8b('0x25'),_0x38dd6d,JSON[_0xbf8b('0x11')](_0x13822b));_0x4f1732(_0x13822b);})[_0xbf8b('0x16')](function(_0x259775){logger[_0xbf8b('0x12')](_0xbf8b('0x25'),_0x259775[_0xbf8b('0x14')],_0x38dd6d);_0x492ae6(_0x4738b2[_0xbf8b('0x12')](0x1f4,_0x259775[_0xbf8b('0x14')]));});});}; \ No newline at end of file +var _0x553a=['bluebird','randomstring','ioredis','../../config/logger','jayson/promise','then','info','debug','request\x20sent','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','GetMemberReport','findAll','options','raw','where','limit','include','model','attributes','map','CreateMemberReport','MemberReport','body','catch','UpdateMemberReport','util'];(function(_0x49d248,_0x1f0fff){var _0x28291e=function(_0x2a8eb5){while(--_0x2a8eb5){_0x49d248['push'](_0x49d248['shift']());}};_0x28291e(++_0x1f0fff);}(_0x553a,0x192));var _0xa553=function(_0x454bd3,_0x3e4d94){_0x454bd3=_0x454bd3-0x0;var _0x4eb066=_0x553a[_0x454bd3];return _0x4eb066;};'use strict';var _=require('lodash');var util=require(_0xa553('0x0'));var moment=require('moment');var BPromise=require(_0xa553('0x1'));var rs=require(_0xa553('0x2'));var fs=require('fs');var Redis=require(_0xa553('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa553('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa553('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x18da5d,_0x3da5c7,_0xaae97){return new BPromise(function(_0x48f7d2,_0x25bbb7){return client['request'](_0x18da5d,_0xaae97)[_0xa553('0x6')](function(_0xf6e0db){logger[_0xa553('0x7')]('MemberReport,\x20%s,\x20%s',_0x3da5c7,'request\x20sent');logger[_0xa553('0x8')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x3da5c7,_0xa553('0x9'),JSON[_0xa553('0xa')](_0xf6e0db));if(_0xf6e0db[_0xa553('0xb')]){if(_0xf6e0db['error'][_0xa553('0xc')]===0x1f4){logger[_0xa553('0xb')](_0xa553('0xd'),_0x3da5c7,_0xf6e0db['error'][_0xa553('0xe')]);return _0x25bbb7(_0xf6e0db[_0xa553('0xb')][_0xa553('0xe')]);}logger['error']('MemberReport,\x20%s,\x20%s',_0x3da5c7,_0xf6e0db[_0xa553('0xb')][_0xa553('0xe')]);return _0x48f7d2(_0xf6e0db[_0xa553('0xb')][_0xa553('0xe')]);}else{logger['info'](_0xa553('0xd'),_0x3da5c7,'request\x20sent');_0x48f7d2(_0xf6e0db[_0xa553('0xf')]['message']);}})['catch'](function(_0x1d0f4e){logger['error'](_0xa553('0xd'),_0x3da5c7,_0x1d0f4e);_0x25bbb7(_0x1d0f4e);});});}exports[_0xa553('0x10')]=function(_0x30d91e){var _0x54a9f9=this;return new Promise(function(_0x102ef5,_0x7331f3){return db['MemberReport'][_0xa553('0x11')]({'raw':_0x30d91e[_0xa553('0x12')]?_0x30d91e['options'][_0xa553('0x13')]===undefined?!![]:![]:!![],'where':_0x30d91e['options']?_0x30d91e[_0xa553('0x12')][_0xa553('0x14')]||null:null,'attributes':_0x30d91e[_0xa553('0x12')]?_0x30d91e[_0xa553('0x12')]['attributes']||null:null,'limit':_0x30d91e[_0xa553('0x12')]?_0x30d91e[_0xa553('0x12')][_0xa553('0x15')]||null:null,'include':_0x30d91e['options']?_0x30d91e[_0xa553('0x12')]['include']?_['map'](_0x30d91e[_0xa553('0x12')][_0xa553('0x16')],function(_0x478efb){return{'model':db[_0x478efb[_0xa553('0x17')]],'as':_0x478efb['as'],'attributes':_0x478efb[_0xa553('0x18')],'include':_0x478efb[_0xa553('0x16')]?_['map'](_0x478efb[_0xa553('0x16')],function(_0x28fa86){return{'model':db[_0x28fa86[_0xa553('0x17')]],'as':_0x28fa86['as'],'attributes':_0x28fa86[_0xa553('0x18')],'include':_0x28fa86[_0xa553('0x16')]?_[_0xa553('0x19')](_0x28fa86[_0xa553('0x16')],function(_0x10c08b){return{'model':db[_0x10c08b['model']],'as':_0x10c08b['as'],'attributes':_0x10c08b['attributes']};}):[]};}):[]};}):[]:[]})[_0xa553('0x6')](function(_0xa63ae2){logger[_0xa553('0x7')](_0xa553('0x10'),_0x30d91e);logger[_0xa553('0x8')](_0xa553('0x10'),_0x30d91e,JSON[_0xa553('0xa')](_0xa63ae2));_0x102ef5(_0xa63ae2);})['catch'](function(_0x3c029d){logger[_0xa553('0xb')](_0xa553('0x10'),_0x3c029d[_0xa553('0xe')],_0x30d91e);_0x7331f3(_0x54a9f9[_0xa553('0xb')](0x1f4,_0x3c029d[_0xa553('0xe')]));});});};exports[_0xa553('0x1a')]=function(_0x2325a5){var _0x3f9351=this;return new Promise(function(_0x6f7ebd,_0x5bb6aa){return db[_0xa553('0x1b')]['create'](_0x2325a5[_0xa553('0x1c')],{'raw':_0x2325a5['options']?_0x2325a5['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x20830f){logger[_0xa553('0x7')](_0xa553('0x1a'),_0x2325a5);logger[_0xa553('0x8')](_0xa553('0x1a'),_0x2325a5,JSON['stringify'](_0x20830f));_0x6f7ebd(_0x20830f);})[_0xa553('0x1d')](function(_0x568201){logger[_0xa553('0xb')](_0xa553('0x1a'),_0x568201['message'],_0x2325a5);_0x5bb6aa(_0x3f9351['error'](0x1f4,_0x568201[_0xa553('0xe')]));});});};exports[_0xa553('0x1e')]=function(_0x2c0760){var _0x25f311=this;return new Promise(function(_0x162451,_0x3d85fa){return db['MemberReport']['update'](_0x2c0760[_0xa553('0x1c')],{'raw':_0x2c0760['options']?_0x2c0760['options'][_0xa553('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c0760[_0xa553('0x12')]?_0x2c0760[_0xa553('0x12')][_0xa553('0x14')]||null:null,'attributes':_0x2c0760[_0xa553('0x12')]?_0x2c0760[_0xa553('0x12')][_0xa553('0x18')]||null:null,'limit':_0x2c0760[_0xa553('0x12')]?_0x2c0760[_0xa553('0x12')][_0xa553('0x15')]||null:null})[_0xa553('0x6')](function(_0x29ff17){logger[_0xa553('0x7')](_0xa553('0x1e'),_0x2c0760);logger[_0xa553('0x8')](_0xa553('0x1e'),_0x2c0760,JSON[_0xa553('0xa')](_0x29ff17));_0x162451(_0x29ff17);})[_0xa553('0x1d')](function(_0x3484b3){logger[_0xa553('0xb')](_0xa553('0x1e'),_0x3484b3[_0xa553('0xe')],_0x2c0760);_0x3d85fa(_0x25f311['error'](0x1f4,_0x3484b3[_0xa553('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 86c9feb..d5147bb 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 _0xd09e=['multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports'];(function(_0x4ff6a3,_0x158529){var _0x4d08a1=function(_0x26f7f4){while(--_0x26f7f4){_0x4ff6a3['push'](_0x4ff6a3['shift']());}};_0x4d08a1(++_0x158529);}(_0xd09e,0x79));var _0xed09=function(_0x32b5bc,_0x5eaed4){_0x32b5bc=_0x32b5bc-0x0;var _0x1bf477=_0xd09e[_0x32b5bc];return _0x1bf477;};'use strict';var multer=require(_0xed09('0x0'));var util=require(_0xed09('0x1'));var path=require('path');var timeout=require(_0xed09('0x2'));var express=require(_0xed09('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xed09('0x4'));var interaction=require(_0xed09('0x5'));var config=require(_0xed09('0x6'));var controller=require(_0xed09('0x7'));router[_0xed09('0x8')]('/',controller[_0xed09('0x9')]);module[_0xed09('0xa')]=router; \ No newline at end of file +var _0xfdf6=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer','util','connect-timeout','express','Router'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xfdf6,0x97));var _0x6fdf=function(_0x2e5ac0,_0x3a669b){_0x2e5ac0=_0x2e5ac0-0x0;var _0x1a33bc=_0xfdf6[_0x2e5ac0];return _0x1a33bc;};'use strict';var multer=require(_0x6fdf('0x0'));var util=require(_0x6fdf('0x1'));var path=require('path');var timeout=require(_0x6fdf('0x2'));var express=require(_0x6fdf('0x3'));var router=express[_0x6fdf('0x4')]();var fs_extra=require(_0x6fdf('0x5'));var auth=require(_0x6fdf('0x6'));var interaction=require(_0x6fdf('0x7'));var config=require(_0x6fdf('0x8'));var controller=require(_0x6fdf('0x9'));router[_0x6fdf('0xa')]('/',controller[_0x6fdf('0xb')]);module[_0x6fdf('0xc')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 589148b..56e4c56 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 _0xc12d=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc12d,0x1e9));var _0xdc12=function(_0x7cd85e,_0x307068){_0x7cd85e=_0x7cd85e-0x0;var _0x35c0c1=_0xc12d[_0x7cd85e];return _0x35c0c1;};'use strict';var Sequelize=require(_0xdc12('0x0'));module[_0xdc12('0x1')]={'version':{'type':Sequelize[_0xdc12('0x2')],'unique':'version'}}; \ No newline at end of file +var _0xf36f=['sequelize'];(function(_0x154a2b,_0x253064){var _0x3bdb5f=function(_0x1cfe46){while(--_0x1cfe46){_0x154a2b['push'](_0x154a2b['shift']());}};_0x3bdb5f(++_0x253064);}(_0xf36f,0x131));var _0xff36=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf36f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xff36('0x0'));module['exports']={'version':{'type':Sequelize['STRING'],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 1de746b..96f6b91 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 _0x7055=['key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','Migration','include','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','destroy','error','stack','name','send','index','map','type'];(function(_0x1ac075,_0x3caa05){var _0x428aba=function(_0x2351a8){while(--_0x2351a8){_0x1ac075['push'](_0x1ac075['shift']());}};_0x428aba(++_0x3caa05);}(_0x7055,0x126));var _0x5705=function(_0x3cb3ca,_0x44d697){_0x3cb3ca=_0x3cb3ca-0x0;var _0x214366=_0x7055[_0x3cb3ca];return _0x214366;};'use strict';var emlformat=require(_0x5705('0x0'));var rimraf=require(_0x5705('0x1'));var zipdir=require(_0x5705('0x2'));var jsonpatch=require(_0x5705('0x3'));var rp=require(_0x5705('0x4'));var moment=require('moment');var BPromise=require(_0x5705('0x5'));var Mustache=require('mustache');var util=require(_0x5705('0x6'));var path=require(_0x5705('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5705('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5705('0x9'));var squel=require(_0x5705('0xa'));var crypto=require(_0x5705('0xb'));var jsforce=require(_0x5705('0xc'));var deskjs=require(_0x5705('0xd'));var toCsv=require(_0x5705('0xe'));var querystring=require(_0x5705('0xf'));var Papa=require(_0x5705('0x10'));var Redis=require(_0x5705('0x11'));var authService=require(_0x5705('0x12'));var qs=require(_0x5705('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5705('0x14'))(_0x5705('0x15'));var utils=require(_0x5705('0x16'));var config=require(_0x5705('0x17'));var licenseUtil=require(_0x5705('0x18'));var db=require(_0x5705('0x19'))['db'];function respondWithStatusCode(_0x170ae9,_0x14482e){_0x14482e=_0x14482e||0xcc;return function(_0x942bea){if(_0x942bea){return _0x170ae9[_0x5705('0x1a')](_0x14482e);}return _0x170ae9[_0x5705('0x1b')](_0x14482e)[_0x5705('0x1c')]();};}function respondWithResult(_0x21c8b3,_0x149007){_0x149007=_0x149007||0xc8;return function(_0x3d0e21){if(_0x3d0e21){return _0x21c8b3[_0x5705('0x1b')](_0x149007)[_0x5705('0x1d')](_0x3d0e21);}};}function respondWithFilteredResult(_0x4faa23,_0xb4ef81){return function(_0x6e2a49){if(_0x6e2a49){var _0x52aa7a=typeof _0xb4ef81[_0x5705('0x1e')]===_0x5705('0x1f')&&typeof _0xb4ef81[_0x5705('0x20')]===_0x5705('0x1f');var _0x2562cb=_0x6e2a49['count'];var _0x520562=_0x52aa7a?0x0:_0xb4ef81['offset'];var _0x24a112=_0x52aa7a?_0x6e2a49[_0x5705('0x21')]:_0xb4ef81[_0x5705('0x1e')]+_0xb4ef81[_0x5705('0x20')];var _0x483408;if(_0x24a112>=_0x2562cb){_0x24a112=_0x2562cb;_0x483408=0xc8;}else{_0x483408=0xce;}_0x4faa23[_0x5705('0x1b')](_0x483408);return _0x4faa23['set']('Content-Range',_0x520562+'-'+_0x24a112+'/'+_0x2562cb)[_0x5705('0x1d')](_0x6e2a49);}return null;};}function patchUpdates(_0x4de25e){return function(_0x357d92){try{jsonpatch[_0x5705('0x22')](_0x357d92,_0x4de25e,!![]);}catch(_0x7cffbd){return BPromise[_0x5705('0x23')](_0x7cffbd);}return _0x357d92['save']();};}function saveUpdates(_0x4ecc32,_0x4af0b7){return function(_0xe96c52){if(_0xe96c52){return _0xe96c52[_0x5705('0x24')](_0x4ecc32)[_0x5705('0x25')](function(_0x3bf596){return _0x3bf596;});}return null;};}function removeEntity(_0xba8f01,_0xb392dc){return function(_0x2f0ac6){if(_0x2f0ac6){return _0x2f0ac6[_0x5705('0x26')]()[_0x5705('0x25')](function(){_0xba8f01[_0x5705('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c23c6,_0x3af378){return function(_0x48e781){if(!_0x48e781){_0x5c23c6[_0x5705('0x1a')](0x194);}return _0x48e781;};}function handleError(_0x52171a,_0x377c70){_0x377c70=_0x377c70||0x1f4;return function(_0x235a03){logger[_0x5705('0x27')](_0x235a03[_0x5705('0x28')]);if(_0x235a03[_0x5705('0x29')]){delete _0x235a03['name'];}_0x52171a[_0x5705('0x1b')](_0x377c70)[_0x5705('0x2a')](_0x235a03);};}exports[_0x5705('0x2b')]=function(_0x1166f3,_0x34d187){var _0x236720={},_0x54342b={},_0x389f84={'count':0x0,'rows':[]};var _0x3eebdd=_[_0x5705('0x2c')](db['Migration']['rawAttributes'],function(_0x207312){return{'name':_0x207312['fieldName'],'type':_0x207312[_0x5705('0x2d')][_0x5705('0x2e')]};});_0x54342b[_0x5705('0x2f')]=_[_0x5705('0x2c')](_0x3eebdd,_0x5705('0x29'));_0x54342b['query']=_[_0x5705('0x30')](_0x1166f3[_0x5705('0x31')]);_0x54342b[_0x5705('0x32')]=_[_0x5705('0x33')](_0x54342b[_0x5705('0x2f')],_0x54342b[_0x5705('0x31')]);_0x236720['attributes']=_[_0x5705('0x33')](_0x54342b[_0x5705('0x2f')],qs[_0x5705('0x34')](_0x1166f3[_0x5705('0x31')][_0x5705('0x34')]));_0x236720['attributes']=_0x236720[_0x5705('0x35')]['length']?_0x236720[_0x5705('0x35')]:_0x54342b[_0x5705('0x2f')];if(!_0x1166f3[_0x5705('0x31')][_0x5705('0x36')](_0x5705('0x37'))){_0x236720[_0x5705('0x20')]=qs[_0x5705('0x20')](_0x1166f3[_0x5705('0x31')]['limit']);_0x236720['offset']=qs[_0x5705('0x1e')](_0x1166f3['query']['offset']);}_0x236720['order']=qs['sort'](_0x1166f3[_0x5705('0x31')][_0x5705('0x38')]);_0x236720['where']=qs[_0x5705('0x32')](_[_0x5705('0x39')](_0x1166f3[_0x5705('0x31')],_0x54342b[_0x5705('0x32')]),_0x3eebdd);if(_0x1166f3['query'][_0x5705('0x3a')]){_0x236720[_0x5705('0x3b')]=_[_0x5705('0x3c')](_0x236720[_0x5705('0x3b')],{'$or':_[_0x5705('0x2c')](_0x3eebdd,function(_0x52159b){if(_0x52159b[_0x5705('0x2d')]!==_0x5705('0x3d')){var _0x1ebcab={};_0x1ebcab[_0x52159b['name']]={'$like':'%'+_0x1166f3['query'][_0x5705('0x3a')]+'%'};return _0x1ebcab;}})});}_0x236720=_[_0x5705('0x3c')]({},_0x236720,_0x1166f3[_0x5705('0x3e')]);var _0x560dfa={'where':_0x236720[_0x5705('0x3b')]};return db[_0x5705('0x3f')][_0x5705('0x21')](_0x560dfa)[_0x5705('0x25')](function(_0x4561ee){_0x389f84[_0x5705('0x21')]=_0x4561ee;if(_0x1166f3[_0x5705('0x31')]['includeAll']){_0x236720[_0x5705('0x40')]=[{'all':!![]}];}return db[_0x5705('0x3f')][_0x5705('0x41')](_0x236720);})['then'](function(_0x34df72){_0x389f84[_0x5705('0x42')]=_0x34df72;return _0x389f84;})['then'](respondWithFilteredResult(_0x34d187,_0x236720))[_0x5705('0x43')](handleError(_0x34d187,null));}; \ No newline at end of file +var _0xf22a=['lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','reject','save','then','destroy','name','send','index','map','Migration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','catch','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs'];(function(_0x58a35c,_0x41aed5){var _0x4fea04=function(_0x236b6c){while(--_0x236b6c){_0x58a35c['push'](_0x58a35c['shift']());}};_0x4fea04(++_0x41aed5);}(_0xf22a,0x160));var _0xaf22=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xf22a[_0x255d5b];return _0x3e141a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaf22('0x0'));var rp=require(_0xaf22('0x1'));var moment=require(_0xaf22('0x2'));var BPromise=require(_0xaf22('0x3'));var Mustache=require(_0xaf22('0x4'));var util=require(_0xaf22('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xaf22('0x6'));var ejs=require(_0xaf22('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaf22('0x8'));var squel=require(_0xaf22('0x9'));var crypto=require(_0xaf22('0xa'));var jsforce=require(_0xaf22('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xaf22('0x6'));var querystring=require('querystring');var Papa=require(_0xaf22('0xc'));var Redis=require('ioredis');var authService=require(_0xaf22('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xaf22('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaf22('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xaf22('0x10'));var db=require(_0xaf22('0x11'))['db'];function respondWithStatusCode(_0x45f7e0,_0x44840f){_0x44840f=_0x44840f||0xcc;return function(_0x2d497c){if(_0x2d497c){return _0x45f7e0[_0xaf22('0x12')](_0x44840f);}return _0x45f7e0[_0xaf22('0x13')](_0x44840f)[_0xaf22('0x14')]();};}function respondWithResult(_0xe10699,_0x5d0158){_0x5d0158=_0x5d0158||0xc8;return function(_0x554bba){if(_0x554bba){return _0xe10699['status'](_0x5d0158)[_0xaf22('0x15')](_0x554bba);}};}function respondWithFilteredResult(_0xeef898,_0x3b7cfc){return function(_0x5488b8){if(_0x5488b8){var _0x44becb=typeof _0x3b7cfc[_0xaf22('0x16')]===_0xaf22('0x17')&&typeof _0x3b7cfc[_0xaf22('0x18')]===_0xaf22('0x17');var _0x4aa76d=_0x5488b8['count'];var _0x567846=_0x44becb?0x0:_0x3b7cfc['offset'];var _0xbd05d3=_0x44becb?_0x5488b8['count']:_0x3b7cfc[_0xaf22('0x16')]+_0x3b7cfc[_0xaf22('0x18')];var _0x40f33d;if(_0xbd05d3>=_0x4aa76d){_0xbd05d3=_0x4aa76d;_0x40f33d=0xc8;}else{_0x40f33d=0xce;}_0xeef898[_0xaf22('0x13')](_0x40f33d);return _0xeef898['set'](_0xaf22('0x19'),_0x567846+'-'+_0xbd05d3+'/'+_0x4aa76d)['json'](_0x5488b8);}return null;};}function patchUpdates(_0x2f143e){return function(_0x43248e){try{jsonpatch['apply'](_0x43248e,_0x2f143e,!![]);}catch(_0x3a05cf){return BPromise[_0xaf22('0x1a')](_0x3a05cf);}return _0x43248e[_0xaf22('0x1b')]();};}function saveUpdates(_0x50051e,_0x35ed04){return function(_0xf7d18d){if(_0xf7d18d){return _0xf7d18d['update'](_0x50051e)[_0xaf22('0x1c')](function(_0x1e1701){return _0x1e1701;});}return null;};}function removeEntity(_0x41f75b,_0x2a2158){return function(_0x3c43d3){if(_0x3c43d3){return _0x3c43d3[_0xaf22('0x1d')]()[_0xaf22('0x1c')](function(){_0x41f75b[_0xaf22('0x13')](0xcc)[_0xaf22('0x14')]();});}};}function handleEntityNotFound(_0x4f4fee,_0x5e7610){return function(_0x3ae836){if(!_0x3ae836){_0x4f4fee[_0xaf22('0x12')](0x194);}return _0x3ae836;};}function handleError(_0x24da9b,_0x87710f){_0x87710f=_0x87710f||0x1f4;return function(_0x41b4c0){logger['error'](_0x41b4c0['stack']);if(_0x41b4c0['name']){delete _0x41b4c0[_0xaf22('0x1e')];}_0x24da9b['status'](_0x87710f)[_0xaf22('0x1f')](_0x41b4c0);};}exports[_0xaf22('0x20')]=function(_0x153b34,_0x3f6d54){var _0x146e01={},_0x17761d={},_0x211e8a={'count':0x0,'rows':[]};var _0x4e2803=_[_0xaf22('0x21')](db[_0xaf22('0x22')][_0xaf22('0x23')],function(_0x385245){return{'name':_0x385245[_0xaf22('0x24')],'type':_0x385245[_0xaf22('0x25')][_0xaf22('0x26')]};});_0x17761d[_0xaf22('0x27')]=_[_0xaf22('0x21')](_0x4e2803,_0xaf22('0x1e'));_0x17761d[_0xaf22('0x28')]=_[_0xaf22('0x29')](_0x153b34[_0xaf22('0x28')]);_0x17761d[_0xaf22('0x2a')]=_[_0xaf22('0x2b')](_0x17761d[_0xaf22('0x27')],_0x17761d['query']);_0x146e01['attributes']=_['intersection'](_0x17761d[_0xaf22('0x27')],qs[_0xaf22('0x2c')](_0x153b34[_0xaf22('0x28')][_0xaf22('0x2c')]));_0x146e01[_0xaf22('0x2d')]=_0x146e01[_0xaf22('0x2d')][_0xaf22('0x2e')]?_0x146e01[_0xaf22('0x2d')]:_0x17761d['model'];if(!_0x153b34['query'][_0xaf22('0x2f')](_0xaf22('0x30'))){_0x146e01[_0xaf22('0x18')]=qs['limit'](_0x153b34[_0xaf22('0x28')][_0xaf22('0x18')]);_0x146e01[_0xaf22('0x16')]=qs[_0xaf22('0x16')](_0x153b34[_0xaf22('0x28')][_0xaf22('0x16')]);}_0x146e01['order']=qs['sort'](_0x153b34[_0xaf22('0x28')]['sort']);_0x146e01[_0xaf22('0x31')]=qs[_0xaf22('0x2a')](_[_0xaf22('0x32')](_0x153b34[_0xaf22('0x28')],_0x17761d['filters']),_0x4e2803);if(_0x153b34[_0xaf22('0x28')][_0xaf22('0x33')]){_0x146e01[_0xaf22('0x31')]=_[_0xaf22('0x34')](_0x146e01[_0xaf22('0x31')],{'$or':_['map'](_0x4e2803,function(_0x502a9b){if(_0x502a9b[_0xaf22('0x25')]!==_0xaf22('0x35')){var _0x512846={};_0x512846[_0x502a9b[_0xaf22('0x1e')]]={'$like':'%'+_0x153b34['query'][_0xaf22('0x33')]+'%'};return _0x512846;}})});}_0x146e01=_[_0xaf22('0x34')]({},_0x146e01,_0x153b34[_0xaf22('0x36')]);var _0x2dc597={'where':_0x146e01['where']};return db[_0xaf22('0x22')][_0xaf22('0x37')](_0x2dc597)[_0xaf22('0x1c')](function(_0x5dd3ce){_0x211e8a[_0xaf22('0x37')]=_0x5dd3ce;if(_0x153b34[_0xaf22('0x28')][_0xaf22('0x38')]){_0x146e01[_0xaf22('0x39')]=[{'all':!![]}];}return db[_0xaf22('0x22')]['findAll'](_0x146e01);})[_0xaf22('0x1c')](function(_0x402f44){_0x211e8a[_0xaf22('0x3a')]=_0x402f44;return _0x211e8a;})['then'](respondWithFilteredResult(_0x3f6d54,_0x146e01))[_0xaf22('0x3b')](handleError(_0x3f6d54,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 87ff79c..d413c8c 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 _0x0fec=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','define','Migration','migrations'];(function(_0x356d1b,_0x2a9fb7){var _0x4c2ca4=function(_0x4bf366){while(--_0x4bf366){_0x356d1b['push'](_0x356d1b['shift']());}};_0x4c2ca4(++_0x2a9fb7);}(_0x0fec,0xdc));var _0xc0fe=function(_0x47e872,_0x32e050){_0x47e872=_0x47e872-0x0;var _0xc272b7=_0x0fec[_0x47e872];return _0xc272b7;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc0fe('0x0'));var moment=require(_0xc0fe('0x1'));var BPromise=require(_0xc0fe('0x2'));var rp=require(_0xc0fe('0x3'));var fs=require('fs');var path=require(_0xc0fe('0x4'));var rimraf=require(_0xc0fe('0x5'));var config=require(_0xc0fe('0x6'));var attributes=require(_0xc0fe('0x7'));module['exports']=function(_0x12ebc6,_0x3625e7){return _0x12ebc6[_0xc0fe('0x8')](_0xc0fe('0x9'),attributes,{'tableName':_0xc0fe('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7922=['api','moment','bluebird','request-promise','path','./migration.attributes','exports','Migration','lodash','util','../../config/logger'];(function(_0xa62163,_0x4a26fb){var _0x46b4fb=function(_0x3a1382){while(--_0x3a1382){_0xa62163['push'](_0xa62163['shift']());}};_0x46b4fb(++_0x4a26fb);}(_0x7922,0x189));var _0x2792=function(_0x381821,_0x37547e){_0x381821=_0x381821-0x0;var _0x1cc70d=_0x7922[_0x381821];return _0x1cc70d;};'use strict';var _=require(_0x2792('0x0'));var util=require(_0x2792('0x1'));var logger=require(_0x2792('0x2'))(_0x2792('0x3'));var moment=require(_0x2792('0x4'));var BPromise=require(_0x2792('0x5'));var rp=require(_0x2792('0x6'));var fs=require('fs');var path=require(_0x2792('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2792('0x8'));module[_0x2792('0x9')]=function(_0x4f098a,_0x54cd97){return _0x4f098a['define'](_0x2792('0xa'),attributes,{'tableName':'migrations','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 5e726d9..21c9beb 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 _0x69af=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','util'];(function(_0x2c3aed,_0xa4011f){var _0x473dc4=function(_0x2a4ffc){while(--_0x2a4ffc){_0x2c3aed['push'](_0x2c3aed['shift']());}};_0x473dc4(++_0xa4011f);}(_0x69af,0x17b));var _0xf69a=function(_0x7e69fe,_0x3ae989){_0x7e69fe=_0x7e69fe-0x0;var _0x9d5d97=_0x69af[_0x7e69fe];return _0x9d5d97;};'use strict';var _=require('lodash');var util=require(_0xf69a('0x0'));var moment=require(_0xf69a('0x1'));var BPromise=require(_0xf69a('0x2'));var rs=require(_0xf69a('0x3'));var fs=require('fs');var Redis=require(_0xf69a('0x4'));var db=require(_0xf69a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf69a('0x6'))(_0xf69a('0x7'));var config=require(_0xf69a('0x8'));var jayson=require(_0xf69a('0x9'));var client=jayson[_0xf69a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10c1b0,_0x3669ef,_0xb0233d){return new BPromise(function(_0x4ffe11,_0x4a3496){return client[_0xf69a('0xb')](_0x10c1b0,_0xb0233d)[_0xf69a('0xc')](function(_0x16a06e){logger[_0xf69a('0xd')](_0xf69a('0xe'),_0x3669ef,'request\x20sent');logger['debug']('Migration,\x20%s,\x20%s,\x20%s',_0x3669ef,_0xf69a('0xf'),JSON[_0xf69a('0x10')](_0x16a06e));if(_0x16a06e[_0xf69a('0x11')]){if(_0x16a06e[_0xf69a('0x11')]['code']===0x1f4){logger[_0xf69a('0x11')](_0xf69a('0xe'),_0x3669ef,_0x16a06e[_0xf69a('0x11')][_0xf69a('0x12')]);return _0x4a3496(_0x16a06e[_0xf69a('0x11')][_0xf69a('0x12')]);}logger[_0xf69a('0x11')](_0xf69a('0xe'),_0x3669ef,_0x16a06e[_0xf69a('0x11')][_0xf69a('0x12')]);return _0x4ffe11(_0x16a06e['error'][_0xf69a('0x12')]);}else{logger[_0xf69a('0xd')](_0xf69a('0xe'),_0x3669ef,_0xf69a('0xf'));_0x4ffe11(_0x16a06e['result'][_0xf69a('0x12')]);}})[_0xf69a('0x13')](function(_0x17660b){logger[_0xf69a('0x11')](_0xf69a('0xe'),_0x3669ef,_0x17660b);_0x4a3496(_0x17660b);});});} \ No newline at end of file +var _0x1752=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','error','message','result','catch','util','moment','bluebird'];(function(_0x4d3083,_0x459193){var _0x5b0420=function(_0x23062d){while(--_0x23062d){_0x4d3083['push'](_0x4d3083['shift']());}};_0x5b0420(++_0x459193);}(_0x1752,0xa5));var _0x2175=function(_0x177a57,_0x54c185){_0x177a57=_0x177a57-0x0;var _0x34c314=_0x1752[_0x177a57];return _0x34c314;};'use strict';var _=require('lodash');var util=require(_0x2175('0x0'));var moment=require(_0x2175('0x1'));var BPromise=require(_0x2175('0x2'));var rs=require(_0x2175('0x3'));var fs=require('fs');var Redis=require(_0x2175('0x4'));var db=require(_0x2175('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2175('0x6'))(_0x2175('0x7'));var config=require(_0x2175('0x8'));var jayson=require(_0x2175('0x9'));var client=jayson[_0x2175('0xa')][_0x2175('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19ca87,_0x1bd937,_0x339e4d){return new BPromise(function(_0x672ff1,_0x516ccc){return client[_0x2175('0xc')](_0x19ca87,_0x339e4d)[_0x2175('0xd')](function(_0x407a71){logger[_0x2175('0xe')](_0x2175('0xf'),_0x1bd937,'request\x20sent');logger['debug']('Migration,\x20%s,\x20%s,\x20%s',_0x1bd937,_0x2175('0x10'),JSON['stringify'](_0x407a71));if(_0x407a71['error']){if(_0x407a71['error']['code']===0x1f4){logger[_0x2175('0x11')]('Migration,\x20%s,\x20%s',_0x1bd937,_0x407a71[_0x2175('0x11')][_0x2175('0x12')]);return _0x516ccc(_0x407a71['error'][_0x2175('0x12')]);}logger[_0x2175('0x11')](_0x2175('0xf'),_0x1bd937,_0x407a71[_0x2175('0x11')][_0x2175('0x12')]);return _0x672ff1(_0x407a71[_0x2175('0x11')][_0x2175('0x12')]);}else{logger[_0x2175('0xe')]('Migration,\x20%s,\x20%s',_0x1bd937,'request\x20sent');_0x672ff1(_0x407a71[_0x2175('0x13')][_0x2175('0x12')]);}})[_0x2175('0x14')](function(_0x4e7cf1){logger['error']('Migration,\x20%s,\x20%s',_0x1bd937,_0x4e7cf1);_0x516ccc(_0x4e7cf1);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 0b5de64..7995671 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 _0x3fc6=['show','post','isAuthenticated','create','put','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id'];(function(_0x95753e,_0x3b4ea4){var _0x2dd2b0=function(_0x19e576){while(--_0x19e576){_0x95753e['push'](_0x95753e['shift']());}};_0x2dd2b0(++_0x3b4ea4);}(_0x3fc6,0x115));var _0x63fc=function(_0x19975c,_0x2d0e4d){_0x19975c=_0x19975c-0x0;var _0x5adc9a=_0x3fc6[_0x19975c];return _0x5adc9a;};'use strict';var multer=require(_0x63fc('0x0'));var util=require('util');var path=require(_0x63fc('0x1'));var timeout=require(_0x63fc('0x2'));var express=require(_0x63fc('0x3'));var router=express[_0x63fc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x63fc('0x5'));var interaction=require(_0x63fc('0x6'));var config=require(_0x63fc('0x7'));var controller=require('./network.controller');router[_0x63fc('0x8')]('/',auth['isAuthenticated'](),controller[_0x63fc('0x9')]);router[_0x63fc('0x8')](_0x63fc('0xa'),auth['isAuthenticated'](),controller[_0x63fc('0xb')]);router[_0x63fc('0xc')]('/',auth[_0x63fc('0xd')](),controller[_0x63fc('0xe')]);router[_0x63fc('0xf')]('/:id',auth[_0x63fc('0xd')](),controller['update']);router['delete'](_0x63fc('0xa'),auth[_0x63fc('0xd')](),controller[_0x63fc('0x10')]);module[_0x63fc('0x11')]=router; \ No newline at end of file +var _0xdf5d=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports'];(function(_0xb31209,_0x5d4200){var _0x531276=function(_0x2ee4ab){while(--_0x2ee4ab){_0xb31209['push'](_0xb31209['shift']());}};_0x531276(++_0x5d4200);}(_0xdf5d,0x126));var _0xddf5=function(_0x2a96a9,_0x10ec26){_0x2a96a9=_0x2a96a9-0x0;var _0x3bb7ad=_0xdf5d[_0x2a96a9];return _0x3bb7ad;};'use strict';var multer=require(_0xddf5('0x0'));var util=require(_0xddf5('0x1'));var path=require(_0xddf5('0x2'));var timeout=require(_0xddf5('0x3'));var express=require(_0xddf5('0x4'));var router=express[_0xddf5('0x5')]();var fs_extra=require(_0xddf5('0x6'));var auth=require(_0xddf5('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xddf5('0x8'));var controller=require(_0xddf5('0x9'));router[_0xddf5('0xa')]('/',auth[_0xddf5('0xb')](),controller[_0xddf5('0xc')]);router[_0xddf5('0xa')](_0xddf5('0xd'),auth[_0xddf5('0xb')](),controller[_0xddf5('0xe')]);router[_0xddf5('0xf')]('/',auth[_0xddf5('0xb')](),controller[_0xddf5('0x10')]);router[_0xddf5('0x11')](_0xddf5('0xd'),auth[_0xddf5('0xb')](),controller[_0xddf5('0x12')]);router['delete'](_0xddf5('0xd'),auth[_0xddf5('0xb')](),controller[_0xddf5('0x13')]);module[_0xddf5('0x14')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 7d905b4..719035d 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 _0x42ed=['ENUM','localnet','externip','turn','STRING','sequelize','exports'];(function(_0x5376a2,_0x23e471){var _0x29a3a0=function(_0x12c5cb){while(--_0x12c5cb){_0x5376a2['push'](_0x5376a2['shift']());}};_0x29a3a0(++_0x23e471);}(_0x42ed,0xb4));var _0xd42e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x42ed[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd42e('0x0'));module[_0xd42e('0x1')]={'type':{'type':Sequelize[_0xd42e('0x2')](_0xd42e('0x3'),_0xd42e('0x4'),'stun',_0xd42e('0x5'))},'value':{'type':Sequelize[_0xd42e('0x6')]},'username':{'type':Sequelize[_0xd42e('0x6')]},'password':{'type':Sequelize[_0xd42e('0x6')]}}; \ No newline at end of file +var _0xa11f=['externip','turn','STRING','sequelize','exports','ENUM','localnet'];(function(_0x30c8e0,_0x215b56){var _0x50e2b5=function(_0x1f4074){while(--_0x1f4074){_0x30c8e0['push'](_0x30c8e0['shift']());}};_0x50e2b5(++_0x215b56);}(_0xa11f,0x168));var _0xfa11=function(_0x9b5bb2,_0x5db315){_0x9b5bb2=_0x9b5bb2-0x0;var _0x2e1e92=_0xa11f[_0x9b5bb2];return _0x2e1e92;};'use strict';var Sequelize=require(_0xfa11('0x0'));module[_0xfa11('0x1')]={'type':{'type':Sequelize[_0xfa11('0x2')](_0xfa11('0x3'),_0xfa11('0x4'),'stun',_0xfa11('0x5'))},'value':{'type':Sequelize[_0xfa11('0x6')]},'username':{'type':Sequelize[_0xfa11('0x6')]},'password':{'type':Sequelize[_0xfa11('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 9588086..3c3da29 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 _0x28eb=['utf8','Reload','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','STUN','TURN','/etc/asterisk/turn_xcally.conf','root','server/files/templates/network.ejs','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','end','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','options','Network','include','findAll','rows','catch','show','params','keys','find','create','sequelize','transaction','body','toUpperCase','readFileSync','join','server/files/templates/stun_multiple.ejs','render','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','server/files/templates/turn_multiple.ejs'];(function(_0x285e72,_0x23021a){var _0x44ee56=function(_0x4e05d2){while(--_0x4e05d2){_0x285e72['push'](_0x285e72['shift']());}};_0x44ee56(++_0x23021a);}(_0x28eb,0x19e));var _0xb28e=function(_0x2e4a66,_0x391269){_0x2e4a66=_0x2e4a66-0x0;var _0x5a137e=_0x28eb[_0x2e4a66];return _0x5a137e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb28e('0x0'));var jsonpatch=require(_0xb28e('0x1'));var rp=require('request-promise');var moment=require(_0xb28e('0x2'));var BPromise=require(_0xb28e('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb28e('0x4'));var sox=require(_0xb28e('0x5'));var csv=require(_0xb28e('0x6'));var ejs=require(_0xb28e('0x7'));var fs=require('fs');var fs_extra=require(_0xb28e('0x8'));var _=require(_0xb28e('0x9'));var squel=require(_0xb28e('0xa'));var crypto=require('crypto');var jsforce=require(_0xb28e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb28e('0x6'));var querystring=require(_0xb28e('0xc'));var Papa=require(_0xb28e('0xd'));var Redis=require(_0xb28e('0xe'));var authService=require(_0xb28e('0xf'));var qs=require(_0xb28e('0x10'));var as=require(_0xb28e('0x11'));var hardwareService=require(_0xb28e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xb28e('0x13'));var licenseUtil=require(_0xb28e('0x14'));var db=require(_0xb28e('0x15'))['db'];var jayson=require(_0xb28e('0x16'));var client=jayson[_0xb28e('0x17')][_0xb28e('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x48bfa7,_0x2d0681,_0x151200,_0x2fd7ea){return new BPromise(function(_0x55af7d,_0x3d4137){var _0x61d1b3=_0x2fd7ea||client;return _0x61d1b3[_0xb28e('0x19')](_0x48bfa7,_0x151200)[_0xb28e('0x1a')](function(_0x299b18){logger[_0xb28e('0x1b')](_0xb28e('0x1c'),_0x2d0681,_0xb28e('0x1d'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x2d0681,'request\x20sent',JSON[_0xb28e('0x1e')](_0x299b18));if(_0x299b18[_0xb28e('0x1f')]){if(_0x299b18[_0xb28e('0x1f')]['code']===0x1f4){logger['error'](_0xb28e('0x1c'),_0x2d0681,_0x299b18[_0xb28e('0x1f')][_0xb28e('0x20')]);return _0x3d4137(_0x299b18[_0xb28e('0x1f')][_0xb28e('0x20')]);}logger['error']('Network,\x20%s,\x20%s',_0x2d0681,_0x299b18[_0xb28e('0x1f')][_0xb28e('0x20')]);return _0x55af7d(_0x299b18['error'][_0xb28e('0x20')]);}else{logger[_0xb28e('0x1b')](_0xb28e('0x1c'),_0x2d0681,_0xb28e('0x1d'));_0x55af7d(_0x299b18[_0xb28e('0x21')][_0xb28e('0x20')]);}})['catch'](function(_0x14a95d){logger['error'](_0xb28e('0x1c'),_0x2d0681,_0x14a95d);_0x3d4137(_0x14a95d);});});}function respondWithStatusCode(_0x47d72a,_0x1013bb){_0x1013bb=_0x1013bb||0xcc;return function(_0x3ae047){if(_0x3ae047){return _0x47d72a[_0xb28e('0x22')](_0x1013bb);}return _0x47d72a[_0xb28e('0x23')](_0x1013bb)['end']();};}function respondWithResult(_0x1ed3e0,_0x58ce2a){_0x58ce2a=_0x58ce2a||0xc8;return function(_0x426a84){if(_0x426a84){return _0x1ed3e0[_0xb28e('0x23')](_0x58ce2a)[_0xb28e('0x24')](_0x426a84);}};}function respondWithFilteredResult(_0x4cf86e,_0x120b5c){return function(_0x2fac08){if(_0x2fac08){var _0x27122f=typeof _0x120b5c[_0xb28e('0x25')]===_0xb28e('0x26')&&typeof _0x120b5c[_0xb28e('0x27')]==='undefined';var _0xfd28f2=_0x2fac08[_0xb28e('0x28')];var _0x55b668=_0x27122f?0x0:_0x120b5c[_0xb28e('0x25')];var _0x5ad2d1=_0x27122f?_0x2fac08['count']:_0x120b5c[_0xb28e('0x25')]+_0x120b5c[_0xb28e('0x27')];var _0x218ad4;if(_0x5ad2d1>=_0xfd28f2){_0x5ad2d1=_0xfd28f2;_0x218ad4=0xc8;}else{_0x218ad4=0xce;}_0x4cf86e[_0xb28e('0x23')](_0x218ad4);return _0x4cf86e[_0xb28e('0x29')](_0xb28e('0x2a'),_0x55b668+'-'+_0x5ad2d1+'/'+_0xfd28f2)[_0xb28e('0x24')](_0x2fac08);}return null;};}function patchUpdates(_0x50968c){return function(_0x51dde3){try{jsonpatch[_0xb28e('0x2b')](_0x51dde3,_0x50968c,!![]);}catch(_0x470f17){return BPromise[_0xb28e('0x2c')](_0x470f17);}return _0x51dde3['save']();};}function saveUpdates(_0x23a640,_0x8b03db){return function(_0x22a930){if(_0x22a930){return _0x22a930[_0xb28e('0x2d')](_0x23a640)['then'](function(_0x157b49){return _0x157b49;});}return null;};}function removeEntity(_0x38dad4,_0x52153b){return function(_0x4a7044){if(_0x4a7044){return _0x4a7044[_0xb28e('0x2e')]()[_0xb28e('0x1a')](function(){_0x38dad4['status'](0xcc)[_0xb28e('0x2f')]();});}};}function handleEntityNotFound(_0x2c5e8d,_0x7d6e17){return function(_0x10d8fc){if(!_0x10d8fc){_0x2c5e8d['sendStatus'](0x194);}return _0x10d8fc;};}function handleError(_0x5cb9f0,_0x25973f){_0x25973f=_0x25973f||0x1f4;return function(_0x4e6e7f){logger['error'](_0x4e6e7f[_0xb28e('0x30')]);if(_0x4e6e7f['name']){delete _0x4e6e7f[_0xb28e('0x31')];}_0x5cb9f0[_0xb28e('0x23')](_0x25973f)[_0xb28e('0x32')](_0x4e6e7f);};}exports['index']=function(_0x192a0e,_0x2f9f1b){var _0x685e32={},_0xa0ccd0={},_0x525f88={'count':0x0,'rows':[]};var _0x4f850c=_[_0xb28e('0x33')](db['Network'][_0xb28e('0x34')],function(_0x506818){return{'name':_0x506818[_0xb28e('0x35')],'type':_0x506818[_0xb28e('0x36')][_0xb28e('0x37')]};});_0xa0ccd0[_0xb28e('0x38')]=_[_0xb28e('0x33')](_0x4f850c,_0xb28e('0x31'));_0xa0ccd0[_0xb28e('0x39')]=_['keys'](_0x192a0e[_0xb28e('0x39')]);_0xa0ccd0[_0xb28e('0x3a')]=_[_0xb28e('0x3b')](_0xa0ccd0[_0xb28e('0x38')],_0xa0ccd0[_0xb28e('0x39')]);_0x685e32[_0xb28e('0x3c')]=_['intersection'](_0xa0ccd0[_0xb28e('0x38')],qs[_0xb28e('0x3d')](_0x192a0e['query'][_0xb28e('0x3d')]));_0x685e32[_0xb28e('0x3c')]=_0x685e32[_0xb28e('0x3c')]['length']?_0x685e32['attributes']:_0xa0ccd0[_0xb28e('0x38')];if(!_0x192a0e[_0xb28e('0x39')]['hasOwnProperty']('nolimit')){_0x685e32[_0xb28e('0x27')]=qs[_0xb28e('0x27')](_0x192a0e[_0xb28e('0x39')][_0xb28e('0x27')]);_0x685e32['offset']=qs['offset'](_0x192a0e['query'][_0xb28e('0x25')]);}_0x685e32[_0xb28e('0x3e')]=qs['sort'](_0x192a0e[_0xb28e('0x39')][_0xb28e('0x3f')]);_0x685e32[_0xb28e('0x40')]=qs[_0xb28e('0x3a')](_[_0xb28e('0x41')](_0x192a0e['query'],_0xa0ccd0[_0xb28e('0x3a')]),_0x4f850c);if(_0x192a0e[_0xb28e('0x39')][_0xb28e('0x42')]){_0x685e32[_0xb28e('0x40')]=_['merge'](_0x685e32[_0xb28e('0x40')],{'$or':_[_0xb28e('0x33')](_0x4f850c,function(_0x49d4ee){if(_0x49d4ee['type']!=='VIRTUAL'){var _0x55c105={};_0x55c105[_0x49d4ee[_0xb28e('0x31')]]={'$like':'%'+_0x192a0e['query'][_0xb28e('0x42')]+'%'};return _0x55c105;}})});}_0x685e32=_[_0xb28e('0x43')]({},_0x685e32,_0x192a0e[_0xb28e('0x44')]);var _0x432786={'where':_0x685e32[_0xb28e('0x40')]};return db[_0xb28e('0x45')]['count'](_0x432786)['then'](function(_0x2d1c99){_0x525f88[_0xb28e('0x28')]=_0x2d1c99;if(_0x192a0e['query']['includeAll']){_0x685e32[_0xb28e('0x46')]=[{'all':!![]}];}return db[_0xb28e('0x45')][_0xb28e('0x47')](_0x685e32);})['then'](function(_0x3b6747){_0x525f88[_0xb28e('0x48')]=_0x3b6747;return _0x525f88;})[_0xb28e('0x1a')](respondWithFilteredResult(_0x2f9f1b,_0x685e32))[_0xb28e('0x49')](handleError(_0x2f9f1b,null));};exports[_0xb28e('0x4a')]=function(_0x5db232,_0x5688c3){var _0x388e9c={'raw':!![],'where':{'id':_0x5db232[_0xb28e('0x4b')]['id']}},_0x19ed9d={};_0x19ed9d['model']=_[_0xb28e('0x4c')](db['Network'][_0xb28e('0x34')]);_0x19ed9d[_0xb28e('0x39')]=_['keys'](_0x5db232[_0xb28e('0x39')]);_0x19ed9d[_0xb28e('0x3a')]=_['intersection'](_0x19ed9d[_0xb28e('0x38')],_0x19ed9d[_0xb28e('0x39')]);_0x388e9c['attributes']=_[_0xb28e('0x3b')](_0x19ed9d['model'],qs[_0xb28e('0x3d')](_0x5db232[_0xb28e('0x39')][_0xb28e('0x3d')]));_0x388e9c['attributes']=_0x388e9c['attributes']['length']?_0x388e9c[_0xb28e('0x3c')]:_0x19ed9d[_0xb28e('0x38')];if(_0x5db232[_0xb28e('0x39')]['includeAll']){_0x388e9c[_0xb28e('0x46')]=[{'all':!![]}];}_0x388e9c=_[_0xb28e('0x43')]({},_0x388e9c,_0x5db232[_0xb28e('0x44')]);return db['Network'][_0xb28e('0x4d')](_0x388e9c)['then'](handleEntityNotFound(_0x5688c3,null))[_0xb28e('0x1a')](respondWithResult(_0x5688c3,null))['catch'](handleError(_0x5688c3,null));};exports[_0xb28e('0x4e')]=function(_0x308c40,_0x3c90d1,_0x265567){var _0xd422ac;return db[_0xb28e('0x4f')][_0xb28e('0x50')](function(_0x34430c){return db['Network'][_0xb28e('0x4e')](_0x308c40[_0xb28e('0x51')],{'raw':!![]})[_0xb28e('0x1a')](function(_0xa55957){_0xd422ac=_0xa55957;return db[_0xb28e('0x45')]['findAll']({'where':{'type':_0x308c40[_0xb28e('0x51')][_0xb28e('0x36')]},'raw':!![]});})[_0xb28e('0x1a')](function(_0x2e42ff){if(_0xd422ac[_0xb28e('0x36')][_0xb28e('0x52')]()=='STUN'){var _0x40b397=fs[_0xb28e('0x53')](path[_0xb28e('0x54')](config['root'],_0xb28e('0x55')),'utf8');var _0x2f6e54=ejs[_0xb28e('0x56')](_0x40b397,{'networks':_0x2e42ff||[]});fs[_0xb28e('0x57')](_0xb28e('0x58'),_0x2f6e54);return respondWithRpcPromise('Reload',_0xb28e('0x4e'),{'module':_0xb28e('0x59')});}else if(_0xd422ac[_0xb28e('0x36')][_0xb28e('0x52')]()=='TURN'){var _0xa92398=fs[_0xb28e('0x53')](path[_0xb28e('0x54')](config['root'],_0xb28e('0x5a')),_0xb28e('0x5b'));var _0xb53887=ejs[_0xb28e('0x56')](_0xa92398,{'networks':_0x2e42ff||[]});fs[_0xb28e('0x57')]('/etc/asterisk/turn_xcally.conf',_0xb53887);return respondWithRpcPromise(_0xb28e('0x5c'),_0xb28e('0x4e'),{'module':_0xb28e('0x59')});}else{var _0xe230cb=fs[_0xb28e('0x53')](path[_0xb28e('0x54')](config['root'],'server/files/templates/network.ejs'),_0xb28e('0x5b'));var _0x5da183=ejs[_0xb28e('0x56')](_0xe230cb,{'networks':_0x2e42ff||[]});fs[_0xb28e('0x57')](util[_0xb28e('0x5d')](_0xb28e('0x5e'),_0x308c40[_0xb28e('0x51')]['type']['toLowerCase']()),_0x5da183);return respondWithRpcPromise(_0xb28e('0x5c'),_0xb28e('0x4e'),{'module':_0xb28e('0x5f')});}return null;})[_0xb28e('0x1a')](function(){return _0xd422ac;});})[_0xb28e('0x1a')](respondWithResult(_0x3c90d1,0xc9))['catch'](handleError(_0x3c90d1,null));};exports['update']=function(_0x4c7da9,_0x25d7a4,_0xa58355){var _0x46b162;return db[_0xb28e('0x4f')]['transaction'](function(_0x39fcd4){return db[_0xb28e('0x45')][_0xb28e('0x4d')]({'where':{'id':_0x4c7da9[_0xb28e('0x4b')]['id']}})[_0xb28e('0x1a')](handleEntityNotFound(_0x25d7a4,null))[_0xb28e('0x1a')](saveUpdates(_0x4c7da9[_0xb28e('0x51')],null))[_0xb28e('0x1a')](function(_0x3701af){if(_0x3701af){_0x46b162=_0x3701af;return db['Network']['findAll']({'where':{'type':_0x46b162[_0xb28e('0x36')]},'raw':!![]});}return null;})[_0xb28e('0x1a')](function(_0x1d59a5){if(_0x46b162[_0xb28e('0x36')][_0xb28e('0x52')]()==_0xb28e('0x60')){var _0x51f7df=fs['readFileSync'](path[_0xb28e('0x54')](config['root'],_0xb28e('0x55')),_0xb28e('0x5b'));var _0x124a8e=ejs[_0xb28e('0x56')](_0x51f7df,{'networks':_0x1d59a5||[]});fs[_0xb28e('0x57')](_0xb28e('0x58'),_0x124a8e);return respondWithRpcPromise(_0xb28e('0x5c'),_0xb28e('0x2d'),{'module':'res_stun_monitor.so'});}else if(_0x46b162[_0xb28e('0x36')][_0xb28e('0x52')]()==_0xb28e('0x61')){var _0x1f99ac=fs[_0xb28e('0x53')](path['join'](config['root'],_0xb28e('0x5a')),_0xb28e('0x5b'));var _0x3b85d1=ejs[_0xb28e('0x56')](_0x1f99ac,{'networks':_0x1d59a5||[]});fs[_0xb28e('0x57')](_0xb28e('0x62'),_0x3b85d1);return respondWithRpcPromise(_0xb28e('0x5c'),_0xb28e('0x2d'),{'module':_0xb28e('0x59')});}else{var _0x26824f=fs[_0xb28e('0x53')](path[_0xb28e('0x54')](config['root'],'server/files/templates/network.ejs'),_0xb28e('0x5b'));var _0x2a4690=ejs[_0xb28e('0x56')](_0x26824f,{'networks':_0x1d59a5||[]});fs[_0xb28e('0x57')](util[_0xb28e('0x5d')](_0xb28e('0x5e'),_0x4c7da9['body']['type']['toLowerCase']()),_0x2a4690);return respondWithRpcPromise('Reload',_0xb28e('0x2d'),{'module':_0xb28e('0x5f')});}return null;})['then'](function(_0x1b7466){if(_0x1b7466){return _0x46b162;}return null;});})['then'](respondWithResult(_0x25d7a4,null))['catch'](handleError(_0x25d7a4,null));};exports['destroy']=function(_0x5436de,_0x193441,_0x53d469){var _0x47f50e;return db['Network']['find']({'where':{'id':_0x5436de[_0xb28e('0x4b')]['id']}})[_0xb28e('0x1a')](function(_0x3dde5c){_0x47f50e=_0x3dde5c;return _0x3dde5c;})[_0xb28e('0x1a')](handleEntityNotFound(_0x193441,null))[_0xb28e('0x1a')](removeEntity(_0x193441,null))['then'](function(){if(_0x47f50e){return db[_0xb28e('0x45')][_0xb28e('0x47')]({'where':{'type':_0x47f50e[_0xb28e('0x36')]},'raw':!![]});}})[_0xb28e('0x1a')](function(_0x6e9dbd){if(_0x47f50e[_0xb28e('0x36')][_0xb28e('0x52')]()==_0xb28e('0x60')){var _0xa6367f=fs[_0xb28e('0x53')](path['join'](config[_0xb28e('0x63')],_0xb28e('0x55')),_0xb28e('0x5b'));var _0x505f6=ejs[_0xb28e('0x56')](_0xa6367f,{'networks':_0x6e9dbd||[]});fs[_0xb28e('0x57')](_0xb28e('0x58'),_0x505f6);return respondWithRpcPromise(_0xb28e('0x5c'),_0xb28e('0x2e'),{'module':_0xb28e('0x59')});}else if(_0x47f50e[_0xb28e('0x36')][_0xb28e('0x52')]()==_0xb28e('0x61')){var _0x26937b=fs['readFileSync'](path[_0xb28e('0x54')](config[_0xb28e('0x63')],_0xb28e('0x5a')),_0xb28e('0x5b'));var _0x2c051c=ejs[_0xb28e('0x56')](_0x26937b,{'networks':_0x6e9dbd||[]});fs[_0xb28e('0x57')](_0xb28e('0x62'),_0x2c051c);return respondWithRpcPromise(_0xb28e('0x5c'),_0xb28e('0x2e'),{'module':_0xb28e('0x59')});}else{var _0x74dff3=fs[_0xb28e('0x53')](path[_0xb28e('0x54')](config[_0xb28e('0x63')],_0xb28e('0x64')),_0xb28e('0x5b'));var _0x22cb5a=ejs[_0xb28e('0x56')](_0x74dff3,{'networks':_0x6e9dbd||[]});fs['writeFileSync'](util[_0xb28e('0x5d')](_0xb28e('0x5e'),_0x5436de['body'][_0xb28e('0x36')]['toLowerCase']()),_0x22cb5a);return respondWithRpcPromise(_0xb28e('0x5c'),_0xb28e('0x2e'),{'module':_0xb28e('0x5f')});}return null;})[_0xb28e('0x49')](handleError(_0x193441,null));}; \ No newline at end of file +var _0x2ae0=['sort','where','filter','include','show','includeAll','merge','create','sequelize','transaction','findAll','body','toUpperCase','STUN','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','find','params','server/files/templates/stun_multiple.ejs','update','format','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','request','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','json','undefined','limit','offset','count','status','set','Content-Range','apply','reject','save','destroy','end','sendStatus','stack','name','send','map','Network','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0xb02e40,_0x60f040){var _0x1525da=function(_0x587db2){while(--_0x587db2){_0xb02e40['push'](_0xb02e40['shift']());}};_0x1525da(++_0x60f040);}(_0x2ae0,0x161));var _0x02ae=function(_0x1ba901,_0x20da33){_0x1ba901=_0x1ba901-0x0;var _0x3108b2=_0x2ae0[_0x1ba901];return _0x3108b2;};'use strict';var emlformat=require(_0x02ae('0x0'));var rimraf=require(_0x02ae('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x02ae('0x2'));var moment=require(_0x02ae('0x3'));var BPromise=require(_0x02ae('0x4'));var Mustache=require(_0x02ae('0x5'));var util=require('util');var path=require(_0x02ae('0x6'));var sox=require(_0x02ae('0x7'));var csv=require(_0x02ae('0x8'));var ejs=require(_0x02ae('0x9'));var fs=require('fs');var fs_extra=require(_0x02ae('0xa'));var _=require(_0x02ae('0xb'));var squel=require(_0x02ae('0xc'));var crypto=require(_0x02ae('0xd'));var jsforce=require(_0x02ae('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x02ae('0x8'));var querystring=require('querystring');var Papa=require(_0x02ae('0xf'));var Redis=require(_0x02ae('0x10'));var authService=require(_0x02ae('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x02ae('0x12'));var hardwareService=require(_0x02ae('0x13'));var logger=require('../../config/logger')(_0x02ae('0x14'));var utils=require(_0x02ae('0x15'));var config=require(_0x02ae('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x02ae('0x17'))['db'];var jayson=require(_0x02ae('0x18'));var client=jayson[_0x02ae('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c59b4,_0x478c61,_0x154bb2,_0x4394f4){return new BPromise(function(_0x4d0585,_0x260db4){var _0x2febc7=_0x4394f4||client;return _0x2febc7[_0x02ae('0x1a')](_0x5c59b4,_0x154bb2)[_0x02ae('0x1b')](function(_0x43d309){logger[_0x02ae('0x1c')](_0x02ae('0x1d'),_0x478c61,'request\x20sent');logger[_0x02ae('0x1e')](_0x02ae('0x1f'),_0x478c61,_0x02ae('0x20'),JSON['stringify'](_0x43d309));if(_0x43d309['error']){if(_0x43d309['error']['code']===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x478c61,_0x43d309[_0x02ae('0x21')][_0x02ae('0x22')]);return _0x260db4(_0x43d309[_0x02ae('0x21')][_0x02ae('0x22')]);}logger[_0x02ae('0x21')]('Network,\x20%s,\x20%s',_0x478c61,_0x43d309[_0x02ae('0x21')][_0x02ae('0x22')]);return _0x4d0585(_0x43d309['error'][_0x02ae('0x22')]);}else{logger[_0x02ae('0x1c')]('Network,\x20%s,\x20%s',_0x478c61,_0x02ae('0x20'));_0x4d0585(_0x43d309[_0x02ae('0x23')]['message']);}})[_0x02ae('0x24')](function(_0x4b8bc4){logger['error'](_0x02ae('0x1d'),_0x478c61,_0x4b8bc4);_0x260db4(_0x4b8bc4);});});}function respondWithStatusCode(_0x4be9a4,_0x429a29){_0x429a29=_0x429a29||0xcc;return function(_0x1af2c7){if(_0x1af2c7){return _0x4be9a4['sendStatus'](_0x429a29);}return _0x4be9a4['status'](_0x429a29)['end']();};}function respondWithResult(_0x23b49c,_0x48c35f){_0x48c35f=_0x48c35f||0xc8;return function(_0x278ef5){if(_0x278ef5){return _0x23b49c['status'](_0x48c35f)[_0x02ae('0x25')](_0x278ef5);}};}function respondWithFilteredResult(_0x49a628,_0x18595a){return function(_0x1006e0){if(_0x1006e0){var _0x372c69=typeof _0x18595a['offset']===_0x02ae('0x26')&&typeof _0x18595a[_0x02ae('0x27')]==='undefined';var _0x1d755d=_0x1006e0['count'];var _0x4526af=_0x372c69?0x0:_0x18595a[_0x02ae('0x28')];var _0x52d756=_0x372c69?_0x1006e0[_0x02ae('0x29')]:_0x18595a[_0x02ae('0x28')]+_0x18595a[_0x02ae('0x27')];var _0xd27d9a;if(_0x52d756>=_0x1d755d){_0x52d756=_0x1d755d;_0xd27d9a=0xc8;}else{_0xd27d9a=0xce;}_0x49a628[_0x02ae('0x2a')](_0xd27d9a);return _0x49a628[_0x02ae('0x2b')](_0x02ae('0x2c'),_0x4526af+'-'+_0x52d756+'/'+_0x1d755d)[_0x02ae('0x25')](_0x1006e0);}return null;};}function patchUpdates(_0x143d7f){return function(_0x16dbc2){try{jsonpatch[_0x02ae('0x2d')](_0x16dbc2,_0x143d7f,!![]);}catch(_0x1fac3b){return BPromise[_0x02ae('0x2e')](_0x1fac3b);}return _0x16dbc2[_0x02ae('0x2f')]();};}function saveUpdates(_0xaf8b9f,_0x16d07f){return function(_0x12818f){if(_0x12818f){return _0x12818f['update'](_0xaf8b9f)[_0x02ae('0x1b')](function(_0x28e682){return _0x28e682;});}return null;};}function removeEntity(_0xed36ea,_0x6ab4fe){return function(_0x2e4247){if(_0x2e4247){return _0x2e4247[_0x02ae('0x30')]()['then'](function(){_0xed36ea[_0x02ae('0x2a')](0xcc)[_0x02ae('0x31')]();});}};}function handleEntityNotFound(_0xb5f925,_0x3e2d00){return function(_0x1e3a72){if(!_0x1e3a72){_0xb5f925[_0x02ae('0x32')](0x194);}return _0x1e3a72;};}function handleError(_0x173734,_0x143451){_0x143451=_0x143451||0x1f4;return function(_0x58452b){logger[_0x02ae('0x21')](_0x58452b[_0x02ae('0x33')]);if(_0x58452b[_0x02ae('0x34')]){delete _0x58452b[_0x02ae('0x34')];}_0x173734['status'](_0x143451)[_0x02ae('0x35')](_0x58452b);};}exports['index']=function(_0x27f2c6,_0x185d57){var _0xf633f7={},_0x112160={},_0x24f08e={'count':0x0,'rows':[]};var _0x3f8a60=_[_0x02ae('0x36')](db[_0x02ae('0x37')][_0x02ae('0x38')],function(_0x14edf1){return{'name':_0x14edf1[_0x02ae('0x39')],'type':_0x14edf1[_0x02ae('0x3a')][_0x02ae('0x3b')]};});_0x112160[_0x02ae('0x3c')]=_[_0x02ae('0x36')](_0x3f8a60,_0x02ae('0x34'));_0x112160[_0x02ae('0x3d')]=_[_0x02ae('0x3e')](_0x27f2c6['query']);_0x112160[_0x02ae('0x3f')]=_[_0x02ae('0x40')](_0x112160[_0x02ae('0x3c')],_0x112160[_0x02ae('0x3d')]);_0xf633f7['attributes']=_[_0x02ae('0x40')](_0x112160[_0x02ae('0x3c')],qs[_0x02ae('0x41')](_0x27f2c6[_0x02ae('0x3d')][_0x02ae('0x41')]));_0xf633f7[_0x02ae('0x42')]=_0xf633f7[_0x02ae('0x42')][_0x02ae('0x43')]?_0xf633f7[_0x02ae('0x42')]:_0x112160[_0x02ae('0x3c')];if(!_0x27f2c6[_0x02ae('0x3d')][_0x02ae('0x44')](_0x02ae('0x45'))){_0xf633f7[_0x02ae('0x27')]=qs[_0x02ae('0x27')](_0x27f2c6['query'][_0x02ae('0x27')]);_0xf633f7['offset']=qs[_0x02ae('0x28')](_0x27f2c6['query'][_0x02ae('0x28')]);}_0xf633f7[_0x02ae('0x46')]=qs[_0x02ae('0x47')](_0x27f2c6[_0x02ae('0x3d')]['sort']);_0xf633f7[_0x02ae('0x48')]=qs[_0x02ae('0x3f')](_['pick'](_0x27f2c6[_0x02ae('0x3d')],_0x112160['filters']),_0x3f8a60);if(_0x27f2c6[_0x02ae('0x3d')][_0x02ae('0x49')]){_0xf633f7['where']=_['merge'](_0xf633f7[_0x02ae('0x48')],{'$or':_['map'](_0x3f8a60,function(_0x324026){if(_0x324026[_0x02ae('0x3a')]!=='VIRTUAL'){var _0x19920a={};_0x19920a[_0x324026['name']]={'$like':'%'+_0x27f2c6[_0x02ae('0x3d')][_0x02ae('0x49')]+'%'};return _0x19920a;}})});}_0xf633f7=_['merge']({},_0xf633f7,_0x27f2c6['options']);var _0x45e690={'where':_0xf633f7[_0x02ae('0x48')]};return db[_0x02ae('0x37')][_0x02ae('0x29')](_0x45e690)[_0x02ae('0x1b')](function(_0x1f6b02){_0x24f08e[_0x02ae('0x29')]=_0x1f6b02;if(_0x27f2c6[_0x02ae('0x3d')]['includeAll']){_0xf633f7[_0x02ae('0x4a')]=[{'all':!![]}];}return db[_0x02ae('0x37')]['findAll'](_0xf633f7);})[_0x02ae('0x1b')](function(_0x43205c){_0x24f08e['rows']=_0x43205c;return _0x24f08e;})['then'](respondWithFilteredResult(_0x185d57,_0xf633f7))['catch'](handleError(_0x185d57,null));};exports[_0x02ae('0x4b')]=function(_0x194046,_0x5e5914){var _0x156684={'raw':!![],'where':{'id':_0x194046['params']['id']}},_0x7dc99a={};_0x7dc99a['model']=_[_0x02ae('0x3e')](db[_0x02ae('0x37')]['rawAttributes']);_0x7dc99a[_0x02ae('0x3d')]=_['keys'](_0x194046[_0x02ae('0x3d')]);_0x7dc99a[_0x02ae('0x3f')]=_['intersection'](_0x7dc99a[_0x02ae('0x3c')],_0x7dc99a[_0x02ae('0x3d')]);_0x156684[_0x02ae('0x42')]=_[_0x02ae('0x40')](_0x7dc99a[_0x02ae('0x3c')],qs[_0x02ae('0x41')](_0x194046[_0x02ae('0x3d')][_0x02ae('0x41')]));_0x156684[_0x02ae('0x42')]=_0x156684['attributes']['length']?_0x156684[_0x02ae('0x42')]:_0x7dc99a[_0x02ae('0x3c')];if(_0x194046[_0x02ae('0x3d')][_0x02ae('0x4c')]){_0x156684[_0x02ae('0x4a')]=[{'all':!![]}];}_0x156684=_[_0x02ae('0x4d')]({},_0x156684,_0x194046['options']);return db[_0x02ae('0x37')]['find'](_0x156684)[_0x02ae('0x1b')](handleEntityNotFound(_0x5e5914,null))[_0x02ae('0x1b')](respondWithResult(_0x5e5914,null))[_0x02ae('0x24')](handleError(_0x5e5914,null));};exports[_0x02ae('0x4e')]=function(_0x47ed61,_0x3eb6fe,_0x2da858){var _0x48cc08;return db[_0x02ae('0x4f')][_0x02ae('0x50')](function(_0x9f2a18){return db[_0x02ae('0x37')][_0x02ae('0x4e')](_0x47ed61['body'],{'raw':!![]})['then'](function(_0x45c954){_0x48cc08=_0x45c954;return db[_0x02ae('0x37')][_0x02ae('0x51')]({'where':{'type':_0x47ed61[_0x02ae('0x52')][_0x02ae('0x3a')]},'raw':!![]});})[_0x02ae('0x1b')](function(_0x151a7f){if(_0x48cc08[_0x02ae('0x3a')][_0x02ae('0x53')]()==_0x02ae('0x54')){var _0x1c17d4=fs[_0x02ae('0x55')](path[_0x02ae('0x56')](config[_0x02ae('0x57')],'server/files/templates/stun_multiple.ejs'),_0x02ae('0x58'));var _0x4afa2b=ejs[_0x02ae('0x59')](_0x1c17d4,{'networks':_0x151a7f||[]});fs[_0x02ae('0x5a')](_0x02ae('0x5b'),_0x4afa2b);return respondWithRpcPromise('Reload',_0x02ae('0x4e'),{'module':'res_stun_monitor.so'});}else if(_0x48cc08[_0x02ae('0x3a')][_0x02ae('0x53')]()==_0x02ae('0x5c')){var _0x97ca=fs[_0x02ae('0x55')](path[_0x02ae('0x56')](config[_0x02ae('0x57')],_0x02ae('0x5d')),_0x02ae('0x58'));var _0x3bf718=ejs[_0x02ae('0x59')](_0x97ca,{'networks':_0x151a7f||[]});fs[_0x02ae('0x5a')](_0x02ae('0x5e'),_0x3bf718);return respondWithRpcPromise('Reload',_0x02ae('0x4e'),{'module':_0x02ae('0x5f')});}else{var _0x2bcd0b=fs[_0x02ae('0x55')](path[_0x02ae('0x56')](config[_0x02ae('0x57')],_0x02ae('0x60')),_0x02ae('0x58'));var _0x3b5760=ejs['render'](_0x2bcd0b,{'networks':_0x151a7f||[]});fs[_0x02ae('0x5a')](util['format'](_0x02ae('0x61'),_0x47ed61['body'][_0x02ae('0x3a')][_0x02ae('0x62')]()),_0x3b5760);return respondWithRpcPromise(_0x02ae('0x63'),_0x02ae('0x4e'),{'module':_0x02ae('0x64')});}return null;})[_0x02ae('0x1b')](function(){return _0x48cc08;});})[_0x02ae('0x1b')](respondWithResult(_0x3eb6fe,0xc9))[_0x02ae('0x24')](handleError(_0x3eb6fe,null));};exports['update']=function(_0x5eac29,_0x23c242,_0x432f6a){var _0x3d573b;return db['sequelize'][_0x02ae('0x50')](function(_0x55585c){return db['Network'][_0x02ae('0x65')]({'where':{'id':_0x5eac29[_0x02ae('0x66')]['id']}})[_0x02ae('0x1b')](handleEntityNotFound(_0x23c242,null))[_0x02ae('0x1b')](saveUpdates(_0x5eac29[_0x02ae('0x52')],null))[_0x02ae('0x1b')](function(_0x51fbe3){if(_0x51fbe3){_0x3d573b=_0x51fbe3;return db[_0x02ae('0x37')][_0x02ae('0x51')]({'where':{'type':_0x3d573b[_0x02ae('0x3a')]},'raw':!![]});}return null;})[_0x02ae('0x1b')](function(_0xaac3fb){if(_0x3d573b['type'][_0x02ae('0x53')]()==_0x02ae('0x54')){var _0x33ef36=fs[_0x02ae('0x55')](path['join'](config[_0x02ae('0x57')],_0x02ae('0x67')),_0x02ae('0x58'));var _0x53625b=ejs['render'](_0x33ef36,{'networks':_0xaac3fb||[]});fs[_0x02ae('0x5a')](_0x02ae('0x5b'),_0x53625b);return respondWithRpcPromise(_0x02ae('0x63'),'update',{'module':'res_stun_monitor.so'});}else if(_0x3d573b[_0x02ae('0x3a')][_0x02ae('0x53')]()==_0x02ae('0x5c')){var _0x41dfe5=fs['readFileSync'](path[_0x02ae('0x56')](config[_0x02ae('0x57')],_0x02ae('0x5d')),_0x02ae('0x58'));var _0x362f9c=ejs[_0x02ae('0x59')](_0x41dfe5,{'networks':_0xaac3fb||[]});fs[_0x02ae('0x5a')](_0x02ae('0x5e'),_0x362f9c);return respondWithRpcPromise(_0x02ae('0x63'),_0x02ae('0x68'),{'module':'res_stun_monitor.so'});}else{var _0x59c71b=fs[_0x02ae('0x55')](path['join'](config[_0x02ae('0x57')],_0x02ae('0x60')),_0x02ae('0x58'));var _0xc3b959=ejs[_0x02ae('0x59')](_0x59c71b,{'networks':_0xaac3fb||[]});fs[_0x02ae('0x5a')](util[_0x02ae('0x69')](_0x02ae('0x61'),_0x5eac29[_0x02ae('0x52')][_0x02ae('0x3a')][_0x02ae('0x62')]()),_0xc3b959);return respondWithRpcPromise(_0x02ae('0x63'),_0x02ae('0x68'),{'module':_0x02ae('0x64')});}return null;})[_0x02ae('0x1b')](function(_0x587f16){if(_0x587f16){return _0x3d573b;}return null;});})[_0x02ae('0x1b')](respondWithResult(_0x23c242,null))[_0x02ae('0x24')](handleError(_0x23c242,null));};exports[_0x02ae('0x30')]=function(_0x290c81,_0x24d997,_0x32af1e){var _0x59a9d4;return db[_0x02ae('0x37')][_0x02ae('0x65')]({'where':{'id':_0x290c81['params']['id']}})['then'](function(_0x329170){_0x59a9d4=_0x329170;return _0x329170;})[_0x02ae('0x1b')](handleEntityNotFound(_0x24d997,null))[_0x02ae('0x1b')](removeEntity(_0x24d997,null))[_0x02ae('0x1b')](function(){if(_0x59a9d4){return db[_0x02ae('0x37')][_0x02ae('0x51')]({'where':{'type':_0x59a9d4[_0x02ae('0x3a')]},'raw':!![]});}})[_0x02ae('0x1b')](function(_0x5d1921){if(_0x59a9d4['type'][_0x02ae('0x53')]()=='STUN'){var _0x3fa199=fs[_0x02ae('0x55')](path[_0x02ae('0x56')](config[_0x02ae('0x57')],_0x02ae('0x67')),_0x02ae('0x58'));var _0x48e393=ejs[_0x02ae('0x59')](_0x3fa199,{'networks':_0x5d1921||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x48e393);return respondWithRpcPromise(_0x02ae('0x63'),'destroy',{'module':_0x02ae('0x5f')});}else if(_0x59a9d4['type'][_0x02ae('0x53')]()==_0x02ae('0x5c')){var _0x10f9a5=fs[_0x02ae('0x55')](path[_0x02ae('0x56')](config[_0x02ae('0x57')],_0x02ae('0x5d')),_0x02ae('0x58'));var _0x10dc5b=ejs[_0x02ae('0x59')](_0x10f9a5,{'networks':_0x5d1921||[]});fs[_0x02ae('0x5a')](_0x02ae('0x5e'),_0x10dc5b);return respondWithRpcPromise(_0x02ae('0x63'),'destroy',{'module':_0x02ae('0x5f')});}else{var _0x24431e=fs[_0x02ae('0x55')](path[_0x02ae('0x56')](config[_0x02ae('0x57')],_0x02ae('0x60')),_0x02ae('0x58'));var _0x14c918=ejs[_0x02ae('0x59')](_0x24431e,{'networks':_0x5d1921||[]});fs['writeFileSync'](util[_0x02ae('0x69')](_0x02ae('0x61'),_0x290c81[_0x02ae('0x52')]['type'][_0x02ae('0x62')]()),_0x14c918);return respondWithRpcPromise('Reload','destroy',{'module':_0x02ae('0x64')});}return null;})[_0x02ae('0x24')](handleError(_0x24d997,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index c9d9720..af6bf84 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 _0x4ea3=['Network','network','lodash','util','../../config/logger','api','bluebird','path','./network.attributes','exports','define'];(function(_0x5933fb,_0x9115ad){var _0x44d988=function(_0x295228){while(--_0x295228){_0x5933fb['push'](_0x5933fb['shift']());}};_0x44d988(++_0x9115ad);}(_0x4ea3,0x70));var _0x34ea=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x4ea3[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var logger=require(_0x34ea('0x2'))(_0x34ea('0x3'));var moment=require('moment');var BPromise=require(_0x34ea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x34ea('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x34ea('0x6'));module[_0x34ea('0x7')]=function(_0x962596,_0x123d48){return _0x962596[_0x34ea('0x8')](_0x34ea('0x9'),attributes,{'tableName':_0x34ea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe739=['Network','lodash','../../config/logger','api','moment','rimraf','../../config/environment','./network.attributes','exports','define'];(function(_0x12533e,_0x22e83d){var _0x4a3143=function(_0x3e4fd0){while(--_0x3e4fd0){_0x12533e['push'](_0x12533e['shift']());}};_0x4a3143(++_0x22e83d);}(_0xe739,0x105));var _0x9e73=function(_0x169906,_0x1e1e95){_0x169906=_0x169906-0x0;var _0x8cb22d=_0xe739[_0x169906];return _0x8cb22d;};'use strict';var _=require(_0x9e73('0x0'));var util=require('util');var logger=require(_0x9e73('0x1'))(_0x9e73('0x2'));var moment=require(_0x9e73('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9e73('0x4'));var config=require(_0x9e73('0x5'));var attributes=require(_0x9e73('0x6'));module[_0x9e73('0x7')]=function(_0x4cb2ed,_0x3db8fa){return _0x4cb2ed[_0x9e73('0x8')](_0x9e73('0x9'),attributes,{'tableName':'network','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 c4495f9..e95c942 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x47da88,_0x75a310){_0x47da88=_0x47da88-0x0;var _0x33f7b7=_0x7a54[_0x47da88];return _0x33f7b7;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1d919b,_0x3188f8){var _0x233c28=function(_0x37927a){while(--_0x37927a){_0x1d919b['push'](_0x1d919b['shift']());}};_0x233c28(++_0x3188f8);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 2f989f6..0fc2848 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 _0x01de=['removeAnswers','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','addDisposition','addAnswer','notify','addApplications','addAgents','/:id/send','send','put','update','delete','destroy','removeDispositions'];(function(_0x21f498,_0xf161c4){var _0x4c9c94=function(_0x2a8b0b){while(--_0x2a8b0b){_0x21f498['push'](_0x21f498['shift']());}};_0x4c9c94(++_0xf161c4);}(_0x01de,0x16b));var _0xe01d=function(_0x67357e,_0x988165){_0x67357e=_0x67357e-0x0;var _0x3901d8=_0x01de[_0x67357e];return _0x3901d8;};'use strict';var multer=require(_0xe01d('0x0'));var util=require(_0xe01d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe01d('0x2'));var router=express[_0xe01d('0x3')]();var fs_extra=require(_0xe01d('0x4'));var auth=require(_0xe01d('0x5'));var interaction=require(_0xe01d('0x6'));var config=require(_0xe01d('0x7'));var controller=require('./openchannelAccount.controller');router['get']('/',auth[_0xe01d('0x8')](),controller[_0xe01d('0x9')]);router[_0xe01d('0xa')](_0xe01d('0xb'),auth[_0xe01d('0x8')](),controller[_0xe01d('0xc')]);router[_0xe01d('0xa')](_0xe01d('0xd'),auth[_0xe01d('0x8')](),controller[_0xe01d('0xe')]);router[_0xe01d('0xa')](_0xe01d('0xf'),auth[_0xe01d('0x8')](),controller[_0xe01d('0x10')]);router[_0xe01d('0xa')]('/:id/canned_answers',auth[_0xe01d('0x8')](),controller[_0xe01d('0x11')]);router['get'](_0xe01d('0x12'),auth[_0xe01d('0x8')](),controller[_0xe01d('0x13')]);router[_0xe01d('0xa')](_0xe01d('0x14'),auth['isAuthenticated'](),controller[_0xe01d('0x15')]);router[_0xe01d('0xa')](_0xe01d('0x16'),auth[_0xe01d('0x8')](),controller[_0xe01d('0x17')]);router[_0xe01d('0x18')]('/',auth[_0xe01d('0x8')](),controller['create']);router[_0xe01d('0x18')](_0xe01d('0xf'),auth[_0xe01d('0x8')](),controller[_0xe01d('0x19')]);router[_0xe01d('0x18')]('/:id/canned_answers',auth[_0xe01d('0x8')](),controller[_0xe01d('0x1a')]);router[_0xe01d('0x18')]('/:id/notify',controller[_0xe01d('0x1b')]);router[_0xe01d('0x18')](_0xe01d('0x12'),auth['isAuthenticated'](),controller[_0xe01d('0x1c')]);router['post']('/:id/users',auth[_0xe01d('0x8')](),controller[_0xe01d('0x1d')]);router['post'](_0xe01d('0x1e'),auth[_0xe01d('0x8')](),controller[_0xe01d('0x1f')]);router[_0xe01d('0x20')](_0xe01d('0xd'),auth['isAuthenticated'](),controller[_0xe01d('0x21')]);router[_0xe01d('0x22')]('/:id',auth[_0xe01d('0x8')](),controller[_0xe01d('0x23')]);router[_0xe01d('0x22')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xe01d('0x24')]);router[_0xe01d('0x22')]('/:id/canned_answers',auth[_0xe01d('0x8')](),controller[_0xe01d('0x25')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xe01d('0x26')]);module[_0xe01d('0x27')]=router; \ No newline at end of file +var _0xe1fb=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','get','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','/:id/users','getAgents','post','create','addDisposition','/:id/notify','notify','addApplications','addAgents','send','put','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router'];(function(_0xbc27d1,_0x19301c){var _0x3d148e=function(_0x14ba69){while(--_0x14ba69){_0xbc27d1['push'](_0xbc27d1['shift']());}};_0x3d148e(++_0x19301c);}(_0xe1fb,0x1ce));var _0xbe1f=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xe1fb[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0xbe1f('0x0'));var util=require(_0xbe1f('0x1'));var path=require(_0xbe1f('0x2'));var timeout=require(_0xbe1f('0x3'));var express=require(_0xbe1f('0x4'));var router=express[_0xbe1f('0x5')]();var fs_extra=require(_0xbe1f('0x6'));var auth=require(_0xbe1f('0x7'));var interaction=require(_0xbe1f('0x8'));var config=require(_0xbe1f('0x9'));var controller=require(_0xbe1f('0xa'));router['get']('/',auth[_0xbe1f('0xb')](),controller['index']);router[_0xbe1f('0xc')]('/describe',auth['isAuthenticated'](),controller[_0xbe1f('0xd')]);router['get'](_0xbe1f('0xe'),auth[_0xbe1f('0xb')](),controller[_0xbe1f('0xf')]);router[_0xbe1f('0xc')](_0xbe1f('0x10'),auth['isAuthenticated'](),controller[_0xbe1f('0x11')]);router[_0xbe1f('0xc')](_0xbe1f('0x12'),auth['isAuthenticated'](),controller[_0xbe1f('0x13')]);router[_0xbe1f('0xc')](_0xbe1f('0x14'),auth[_0xbe1f('0xb')](),controller[_0xbe1f('0x15')]);router[_0xbe1f('0xc')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xbe1f('0x16')]);router[_0xbe1f('0xc')](_0xbe1f('0x17'),auth[_0xbe1f('0xb')](),controller[_0xbe1f('0x18')]);router[_0xbe1f('0x19')]('/',auth[_0xbe1f('0xb')](),controller[_0xbe1f('0x1a')]);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xbe1f('0x1b')]);router[_0xbe1f('0x19')]('/:id/canned_answers',auth[_0xbe1f('0xb')](),controller['addAnswer']);router[_0xbe1f('0x19')](_0xbe1f('0x1c'),controller[_0xbe1f('0x1d')]);router[_0xbe1f('0x19')](_0xbe1f('0x14'),auth[_0xbe1f('0xb')](),controller[_0xbe1f('0x1e')]);router[_0xbe1f('0x19')](_0xbe1f('0x17'),auth[_0xbe1f('0xb')](),controller[_0xbe1f('0x1f')]);router[_0xbe1f('0x19')]('/:id/send',auth[_0xbe1f('0xb')](),controller[_0xbe1f('0x20')]);router[_0xbe1f('0x21')](_0xbe1f('0xe'),auth[_0xbe1f('0xb')](),controller['update']);router[_0xbe1f('0x22')](_0xbe1f('0xe'),auth[_0xbe1f('0xb')](),controller[_0xbe1f('0x23')]);router[_0xbe1f('0x22')](_0xbe1f('0x10'),auth[_0xbe1f('0xb')](),controller[_0xbe1f('0x24')]);router[_0xbe1f('0x22')](_0xbe1f('0x12'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0xbe1f('0x22')](_0xbe1f('0x17'),auth['isAuthenticated'](),controller[_0xbe1f('0x25')]);module[_0xbe1f('0x26')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 308fffb..6334f58 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 _0xa3bd=['mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x42a282,_0x16f0e1){var _0x46148e=function(_0x1e954e){while(--_0x1e954e){_0x42a282['push'](_0x42a282['shift']());}};_0x46148e(++_0x16f0e1);}(_0xa3bd,0x17d));var _0xda3b=function(_0x2ea784,_0x528b2a){_0x2ea784=_0x2ea784-0x0;var _0x128ea3=_0xa3bd[_0x2ea784];return _0x128ea3;};'use strict';var Sequelize=require(_0xda3b('0x0'));var rs=require(_0xda3b('0x1'));module[_0xda3b('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xda3b('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xda3b('0x4')]},'token':{'type':Sequelize[_0xda3b('0x4')],'defaultValue':function(){return rs[_0xda3b('0x5')]();}},'replyUri':{'type':Sequelize[_0xda3b('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xda3b('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xda3b('0x6')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xda3b('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xda3b('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xda3b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0xda3b('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xda3b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xda3b('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xda3b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xda3b('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xda3b('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xda3b('0x7')],'defaultValue':![],'comment':_0xda3b('0xa'),'set':function(_0x406606){if(!_0x406606)this['setDataValue'](_0xda3b('0xb'),null);this[_0xda3b('0xc')](_0xda3b('0xd'),_0x406606);}}}; \ No newline at end of file +var _0x6f44=['sequelize','randomstring','STRING','name','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x2f51ac,_0x4489bf){var _0x3aa859=function(_0x4209ea){while(--_0x4209ea){_0x2f51ac['push'](_0x2f51ac['shift']());}};_0x3aa859(++_0x4489bf);}(_0x6f44,0x1ec));var _0x46f4=function(_0x4065b1,_0xb610c4){_0x4065b1=_0x4065b1-0x0;var _0x3a112c=_0x6f44[_0x4065b1];return _0x3a112c;};'use strict';var Sequelize=require(_0x46f4('0x0'));var rs=require(_0x46f4('0x1'));module['exports']={'name':{'type':Sequelize[_0x46f4('0x2')],'unique':_0x46f4('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x46f4('0x2')]},'token':{'type':Sequelize[_0x46f4('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x46f4('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x46f4('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x46f4('0x4')],'defaultValue':function(){return _0x46f4('0x5');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x46f4('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x46f4('0x2')]},'queueTransfer':{'type':Sequelize[_0x46f4('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x46f4('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x46f4('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x46f4('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x46f4('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x46f4('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x46f4('0x9'),'set':function(_0x2f969f){if(!_0x2f969f)this[_0x46f4('0xa')](_0x46f4('0xb'),null);this[_0x46f4('0xa')]('mandatoryDisposition',_0x2f969f);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index d5b62e6..630caf2 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 _0xba62=['register','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','mandatoryDispositionPause','map','OpenchannelAccount','type','key','model','query','keys','intersection','attributes','fields','nolimit','sort','pick','filters','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','catch','show','Pause','rawAttributes','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','removeAnswers','openchannel','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','isNil','from','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','OpenchannelApplication','Applications','List','account','applications','orderBy','priority','ListId','contact','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','firstName','lastName','messageId','interaction','created','push','close','*,*,*,*','OpenchannelMessage','UserId','unshift','agent','Start','startRouting','EventManager','notify','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','send','getApplications','getInteractions','Contact','User','fullname','Tags','tag','addAgents','omit','emit','removeAgents','userOpenchannelAccount:remove','getAgents','Messages','dataValues','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket'];(function(_0x10d45f,_0x2b37eb){var _0x262c4b=function(_0x319efc){while(--_0x319efc){_0x10d45f['push'](_0x10d45f['shift']());}};_0x262c4b(++_0x2b37eb);}(_0xba62,0x9d));var _0x2ba6=function(_0x5a9017,_0x4312fc){_0x5a9017=_0x5a9017-0x0;var _0x596e52=_0xba62[_0x5a9017];return _0x596e52;};'use strict';var emlformat=require(_0x2ba6('0x0'));var rimraf=require(_0x2ba6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2ba6('0x2'));var rp=require('request-promise');var moment=require(_0x2ba6('0x3'));var BPromise=require(_0x2ba6('0x4'));var Mustache=require(_0x2ba6('0x5'));var util=require(_0x2ba6('0x6'));var path=require('path');var sox=require(_0x2ba6('0x7'));var csv=require(_0x2ba6('0x8'));var ejs=require(_0x2ba6('0x9'));var fs=require('fs');var fs_extra=require(_0x2ba6('0xa'));var _=require('lodash');var squel=require(_0x2ba6('0xb'));var crypto=require(_0x2ba6('0xc'));var jsforce=require(_0x2ba6('0xd'));var deskjs=require(_0x2ba6('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2ba6('0xf'));var Papa=require(_0x2ba6('0x10'));var Redis=require(_0x2ba6('0x11'));var authService=require(_0x2ba6('0x12'));var qs=require(_0x2ba6('0x13'));var as=require(_0x2ba6('0x14'));var hardwareService=require(_0x2ba6('0x15'));var logger=require(_0x2ba6('0x16'))('api');var utils=require(_0x2ba6('0x17'));var config=require(_0x2ba6('0x18'));var licenseUtil=require(_0x2ba6('0x19'));var db=require(_0x2ba6('0x1a'))['db'];config[_0x2ba6('0x1b')]=_[_0x2ba6('0x1c')](config['redis'],{'host':_0x2ba6('0x1d'),'port':0x18eb});var socket=require(_0x2ba6('0x1e'))(new Redis(config[_0x2ba6('0x1b')]));require(_0x2ba6('0x1f'))[_0x2ba6('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2ba6('0x21')][_0x2ba6('0x22')]({'port':0x232c});var client9002=jayson['client'][_0x2ba6('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x2fbaad,_0x1db9d9,_0x30cc1e,_0x55ca69){return new BPromise(function(_0x418a61,_0x29a2af){var _0xdcc7de=_0x55ca69||client;return _0xdcc7de[_0x2ba6('0x23')](_0x2fbaad,_0x30cc1e)[_0x2ba6('0x24')](function(_0x2feef3){logger[_0x2ba6('0x25')](_0x2ba6('0x26'),_0x1db9d9,'request\x20sent');logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x1db9d9,_0x2ba6('0x27'),JSON[_0x2ba6('0x28')](_0x2feef3));if(_0x2feef3['error']){if(_0x2feef3[_0x2ba6('0x29')][_0x2ba6('0x2a')]===0x1f4){logger[_0x2ba6('0x29')](_0x2ba6('0x26'),_0x1db9d9,_0x2feef3['error'][_0x2ba6('0x2b')]);return _0x29a2af(_0x2feef3[_0x2ba6('0x29')][_0x2ba6('0x2b')]);}logger[_0x2ba6('0x29')](_0x2ba6('0x26'),_0x1db9d9,_0x2feef3[_0x2ba6('0x29')][_0x2ba6('0x2b')]);return _0x418a61(_0x2feef3['error'][_0x2ba6('0x2b')]);}else{logger[_0x2ba6('0x25')](_0x2ba6('0x26'),_0x1db9d9,_0x2ba6('0x27'));_0x418a61(_0x2feef3[_0x2ba6('0x2c')][_0x2ba6('0x2b')]);}})['catch'](function(_0x398add){logger['error'](_0x2ba6('0x26'),_0x1db9d9,_0x398add);_0x29a2af(_0x398add);});});}function respondWithStatusCode(_0x493b22,_0x4219d6){_0x4219d6=_0x4219d6||0xcc;return function(_0x16844a){if(_0x16844a){return _0x493b22[_0x2ba6('0x2d')](_0x4219d6);}return _0x493b22[_0x2ba6('0x2e')](_0x4219d6)[_0x2ba6('0x2f')]();};}function respondWithResult(_0x4cbd57,_0x906896){_0x906896=_0x906896||0xc8;return function(_0x3b20ef){if(_0x3b20ef){return _0x4cbd57[_0x2ba6('0x2e')](_0x906896)['json'](_0x3b20ef);}};}function respondWithFilteredResult(_0x2acd0d,_0x2fd99b){return function(_0x1260f6){if(_0x1260f6){var _0x1b4ed9=typeof _0x2fd99b[_0x2ba6('0x30')]===_0x2ba6('0x31')&&typeof _0x2fd99b[_0x2ba6('0x32')]===_0x2ba6('0x31');var _0x5c791f=_0x1260f6[_0x2ba6('0x33')];var _0x3ba4f7=_0x1b4ed9?0x0:_0x2fd99b['offset'];var _0x3d0cba=_0x1b4ed9?_0x1260f6['count']:_0x2fd99b[_0x2ba6('0x30')]+_0x2fd99b[_0x2ba6('0x32')];var _0x3df3b2;if(_0x3d0cba>=_0x5c791f){_0x3d0cba=_0x5c791f;_0x3df3b2=0xc8;}else{_0x3df3b2=0xce;}_0x2acd0d[_0x2ba6('0x2e')](_0x3df3b2);return _0x2acd0d[_0x2ba6('0x34')](_0x2ba6('0x35'),_0x3ba4f7+'-'+_0x3d0cba+'/'+_0x5c791f)[_0x2ba6('0x36')](_0x1260f6);}return null;};}function patchUpdates(_0x382e52){return function(_0xaef7f4){try{jsonpatch[_0x2ba6('0x37')](_0xaef7f4,_0x382e52,!![]);}catch(_0x553eb1){return BPromise[_0x2ba6('0x38')](_0x553eb1);}return _0xaef7f4[_0x2ba6('0x39')]();};}function saveUpdates(_0x560bf0,_0x2662c0){return function(_0x590906){if(_0x590906){return _0x590906[_0x2ba6('0x3a')](_0x560bf0)['then'](function(_0x20527a){return _0x20527a;});}return null;};}function removeEntity(_0x287af2,_0x5d401f){return function(_0x1efdf0){if(_0x1efdf0){return _0x1efdf0[_0x2ba6('0x3b')]()['then'](function(){var _0x28d41a=_0x1efdf0[_0x2ba6('0x3c')]({'plain':!![]});var _0x306488=_0x2ba6('0x3d');return db[_0x2ba6('0x3e')][_0x2ba6('0x3b')]({'where':{'type':_0x306488,'resourceId':_0x28d41a['id']}})[_0x2ba6('0x24')](function(){return _0x1efdf0;});})[_0x2ba6('0x24')](function(){_0x287af2['status'](0xcc)[_0x2ba6('0x2f')]();});}};}function handleEntityNotFound(_0x55c886,_0x2f9861){return function(_0x36ebbd){if(!_0x36ebbd){_0x55c886[_0x2ba6('0x2d')](0x194);}return _0x36ebbd;};}function handleError(_0x2af1a4,_0xf9e6ce){_0xf9e6ce=_0xf9e6ce||0x1f4;return function(_0x19977f){logger['error'](_0x19977f[_0x2ba6('0x3f')]);if(_0x19977f[_0x2ba6('0x40')]){delete _0x19977f[_0x2ba6('0x40')];}_0x2af1a4['status'](_0xf9e6ce)['send'](_0x19977f);};}exports['index']=function(_0x35b1c5,_0x5ca72a){var _0x2d5f12={'include':[{'model':db['Pause'],'as':_0x2ba6('0x41')}]},_0x90c1ee={},_0x1e7a4f={'count':0x0,'rows':[]};var _0x4e8004=_[_0x2ba6('0x42')](db[_0x2ba6('0x43')]['rawAttributes'],function(_0x42c353){return{'name':_0x42c353['fieldName'],'type':_0x42c353[_0x2ba6('0x44')][_0x2ba6('0x45')]};});_0x90c1ee[_0x2ba6('0x46')]=_[_0x2ba6('0x42')](_0x4e8004,_0x2ba6('0x40'));_0x90c1ee[_0x2ba6('0x47')]=_[_0x2ba6('0x48')](_0x35b1c5[_0x2ba6('0x47')]);_0x90c1ee['filters']=_[_0x2ba6('0x49')](_0x90c1ee[_0x2ba6('0x46')],_0x90c1ee['query']);_0x2d5f12[_0x2ba6('0x4a')]=_[_0x2ba6('0x49')](_0x90c1ee[_0x2ba6('0x46')],qs[_0x2ba6('0x4b')](_0x35b1c5[_0x2ba6('0x47')][_0x2ba6('0x4b')]));_0x2d5f12[_0x2ba6('0x4a')]=_0x2d5f12[_0x2ba6('0x4a')]['length']?_0x2d5f12[_0x2ba6('0x4a')]:_0x90c1ee['model'];if(!_0x35b1c5[_0x2ba6('0x47')]['hasOwnProperty'](_0x2ba6('0x4c'))){_0x2d5f12[_0x2ba6('0x32')]=qs[_0x2ba6('0x32')](_0x35b1c5[_0x2ba6('0x47')]['limit']);_0x2d5f12[_0x2ba6('0x30')]=qs[_0x2ba6('0x30')](_0x35b1c5[_0x2ba6('0x47')][_0x2ba6('0x30')]);}_0x2d5f12['order']=qs[_0x2ba6('0x4d')](_0x35b1c5[_0x2ba6('0x47')]['sort']);_0x2d5f12['where']=qs['filters'](_[_0x2ba6('0x4e')](_0x35b1c5['query'],_0x90c1ee[_0x2ba6('0x4f')]),_0x4e8004);if(_0x35b1c5[_0x2ba6('0x47')][_0x2ba6('0x50')]){_0x2d5f12['where']=_[_0x2ba6('0x51')](_0x2d5f12[_0x2ba6('0x52')],{'$or':_[_0x2ba6('0x42')](_0x4e8004,function(_0x345513){if(_0x345513[_0x2ba6('0x44')]!==_0x2ba6('0x53')){var _0x55ffdc={};_0x55ffdc[_0x345513['name']]={'$like':'%'+_0x35b1c5['query']['filter']+'%'};return _0x55ffdc;}})});}_0x2d5f12=_[_0x2ba6('0x51')]({},_0x2d5f12,_0x35b1c5['options']);var _0xafb5f0={'where':_0x2d5f12[_0x2ba6('0x52')]};return db[_0x2ba6('0x43')][_0x2ba6('0x33')](_0xafb5f0)['then'](function(_0x470ce8){_0x1e7a4f[_0x2ba6('0x33')]=_0x470ce8;if(_0x35b1c5[_0x2ba6('0x47')][_0x2ba6('0x54')]){_0x2d5f12[_0x2ba6('0x55')]=[{'all':!![]}];}return db[_0x2ba6('0x43')][_0x2ba6('0x56')](_0x2d5f12);})['then'](function(_0x37e469){_0x1e7a4f[_0x2ba6('0x57')]=_0x37e469;return _0x1e7a4f;})[_0x2ba6('0x24')](respondWithFilteredResult(_0x5ca72a,_0x2d5f12))[_0x2ba6('0x58')](handleError(_0x5ca72a,null));};exports[_0x2ba6('0x59')]=function(_0x32a6fb,_0x4627cf){var _0x283048={'raw':![],'where':{'id':_0x32a6fb['params']['id']},'include':[{'model':db[_0x2ba6('0x5a')],'as':_0x2ba6('0x41')}]},_0x304c5c={};_0x304c5c[_0x2ba6('0x46')]=_['keys'](db[_0x2ba6('0x43')][_0x2ba6('0x5b')]);_0x304c5c['query']=_[_0x2ba6('0x48')](_0x32a6fb[_0x2ba6('0x47')]);_0x304c5c[_0x2ba6('0x4f')]=_[_0x2ba6('0x49')](_0x304c5c[_0x2ba6('0x46')],_0x304c5c[_0x2ba6('0x47')]);_0x283048[_0x2ba6('0x4a')]=_['intersection'](_0x304c5c[_0x2ba6('0x46')],qs[_0x2ba6('0x4b')](_0x32a6fb[_0x2ba6('0x47')][_0x2ba6('0x4b')]));_0x283048[_0x2ba6('0x4a')]=_0x283048[_0x2ba6('0x4a')][_0x2ba6('0x5c')]?_0x283048[_0x2ba6('0x4a')]:_0x304c5c['model'];if(_0x32a6fb[_0x2ba6('0x47')][_0x2ba6('0x54')]){_0x283048[_0x2ba6('0x55')]=[{'all':!![]}];}_0x283048=_[_0x2ba6('0x51')]({},_0x283048,_0x32a6fb[_0x2ba6('0x5d')]);return db[_0x2ba6('0x43')][_0x2ba6('0x5e')](_0x283048)['then'](handleEntityNotFound(_0x4627cf,null))[_0x2ba6('0x24')](respondWithResult(_0x4627cf,null))[_0x2ba6('0x58')](handleError(_0x4627cf,null));};exports[_0x2ba6('0x5f')]=function(_0x232827,_0x2f4b86){return db[_0x2ba6('0x43')]['create'](_0x232827[_0x2ba6('0x60')],{})['then'](function(_0x29d6c4){var _0x1cdbc0=_0x232827[_0x2ba6('0x61')][_0x2ba6('0x3c')]({'plain':!![]});if(!_0x1cdbc0)throw new Error(_0x2ba6('0x62'));if(_0x1cdbc0['role']===_0x2ba6('0x61')){var _0x100467=_0x29d6c4[_0x2ba6('0x3c')]({'plain':!![]});var _0x2b6f3d=_0x2ba6('0x3d');return db[_0x2ba6('0x63')][_0x2ba6('0x5e')]({'where':{'name':_0x2b6f3d,'userProfileId':_0x1cdbc0['userProfileId']},'raw':!![]})['then'](function(_0x1335fe){if(_0x1335fe&&_0x1335fe['autoAssociation']===0x0){return db[_0x2ba6('0x3e')]['create']({'name':_0x100467[_0x2ba6('0x40')],'resourceId':_0x100467['id'],'type':_0x1335fe[_0x2ba6('0x40')],'sectionId':_0x1335fe['id']},{})[_0x2ba6('0x24')](function(){return _0x29d6c4;});}else{return _0x29d6c4;}})[_0x2ba6('0x58')](function(_0x5e3032){logger[_0x2ba6('0x29')](_0x2ba6('0x64'),_0x5e3032);throw _0x5e3032;});}return _0x29d6c4;})[_0x2ba6('0x24')](respondWithResult(_0x2f4b86,0xc9))[_0x2ba6('0x58')](handleError(_0x2f4b86,null));};exports[_0x2ba6('0x3a')]=function(_0x552444,_0x2cd019){if(_0x552444['body']['id']){delete _0x552444['body']['id'];}return db[_0x2ba6('0x43')][_0x2ba6('0x5e')]({'where':{'id':_0x552444[_0x2ba6('0x65')]['id']},'include':[{'model':db[_0x2ba6('0x5a')],'as':'mandatoryDispositionPause'}]})[_0x2ba6('0x24')](handleEntityNotFound(_0x2cd019,null))['then'](saveUpdates(_0x552444[_0x2ba6('0x60')],null))[_0x2ba6('0x24')](respondWithResult(_0x2cd019,null))[_0x2ba6('0x58')](handleError(_0x2cd019,null));};exports[_0x2ba6('0x3b')]=function(_0x3739ce,_0x42ec83){return db[_0x2ba6('0x43')][_0x2ba6('0x5e')]({'where':{'id':_0x3739ce['params']['id']}})[_0x2ba6('0x24')](handleEntityNotFound(_0x42ec83,null))[_0x2ba6('0x24')](removeEntity(_0x42ec83,null))[_0x2ba6('0x58')](handleError(_0x42ec83,null));};exports['describe']=function(_0x99b89f,_0x2cea1d){return db[_0x2ba6('0x43')][_0x2ba6('0x66')]()[_0x2ba6('0x24')](respondWithResult(_0x2cea1d,null))[_0x2ba6('0x58')](handleError(_0x2cea1d,null));};exports[_0x2ba6('0x67')]=function(_0x20aeb2,_0x40bfc6,_0x49b7bb){if(_0x20aeb2[_0x2ba6('0x60')]['id']){delete _0x20aeb2['body']['id'];}return db[_0x2ba6('0x43')][_0x2ba6('0x5e')]({'where':{'id':_0x20aeb2[_0x2ba6('0x65')]['id']}})[_0x2ba6('0x24')](handleEntityNotFound(_0x40bfc6,null))[_0x2ba6('0x24')](function(_0x39e17a){if(_0x39e17a){_0x20aeb2[_0x2ba6('0x60')][_0x2ba6('0x68')]=_0x39e17a['id'];return db['Disposition'][_0x2ba6('0x5f')](_0x20aeb2[_0x2ba6('0x60')]);}})['then'](respondWithResult(_0x40bfc6,null))['catch'](handleError(_0x40bfc6,null));};exports[_0x2ba6('0x69')]=function(_0x28b48a,_0x180f62,_0x2c5824){var _0x153678={'raw':![],'where':{}};var _0x1be58b={};var _0x1342e1={'count':0x0,'rows':[]};return db[_0x2ba6('0x43')][_0x2ba6('0x6a')]({'where':{'id':_0x28b48a[_0x2ba6('0x65')]['id']}})['then'](handleEntityNotFound(_0x180f62,null))['then'](function(_0x37bfa2){if(_0x37bfa2){_0x1be58b['model']=_[_0x2ba6('0x48')](db[_0x2ba6('0x6b')][_0x2ba6('0x5b')]);_0x1be58b[_0x2ba6('0x47')]=_[_0x2ba6('0x48')](_0x28b48a[_0x2ba6('0x47')]);_0x1be58b[_0x2ba6('0x4f')]=_[_0x2ba6('0x49')](_0x1be58b[_0x2ba6('0x46')],_0x1be58b[_0x2ba6('0x47')]);_0x153678[_0x2ba6('0x4a')]=_['intersection'](_0x1be58b[_0x2ba6('0x46')],qs['fields'](_0x28b48a[_0x2ba6('0x47')][_0x2ba6('0x4b')]));_0x153678[_0x2ba6('0x4a')]=_0x153678[_0x2ba6('0x4a')][_0x2ba6('0x5c')]?_0x153678[_0x2ba6('0x4a')]:_0x1be58b[_0x2ba6('0x46')];if(!_0x28b48a[_0x2ba6('0x47')][_0x2ba6('0x6c')](_0x2ba6('0x4c'))){_0x153678[_0x2ba6('0x32')]=qs[_0x2ba6('0x32')](_0x28b48a[_0x2ba6('0x47')][_0x2ba6('0x32')]);_0x153678[_0x2ba6('0x30')]=qs['offset'](_0x28b48a[_0x2ba6('0x47')]['offset']);}_0x153678['order']=qs[_0x2ba6('0x4d')](_0x28b48a['query']['sort']);_0x153678[_0x2ba6('0x52')]=qs[_0x2ba6('0x4f')](_[_0x2ba6('0x4e')](_0x28b48a[_0x2ba6('0x47')],_0x1be58b[_0x2ba6('0x4f')]));_0x153678[_0x2ba6('0x52')][_0x2ba6('0x68')]=_0x37bfa2['id'];if(_0x28b48a[_0x2ba6('0x47')][_0x2ba6('0x50')]){_0x153678['where']=_['merge'](_0x153678[_0x2ba6('0x52')],{'$or':_[_0x2ba6('0x42')](_0x153678['attributes'],function(_0x3754c3){var _0x1ea3d2={};_0x1ea3d2[_0x3754c3]={'$like':'%'+_0x28b48a[_0x2ba6('0x47')]['filter']+'%'};return _0x1ea3d2;})});}_0x153678=_[_0x2ba6('0x51')]({},_0x153678,_0x28b48a[_0x2ba6('0x5d')]);return db[_0x2ba6('0x6b')][_0x2ba6('0x33')]({'where':_0x153678[_0x2ba6('0x52')]})[_0x2ba6('0x24')](function(_0x180735){_0x1342e1[_0x2ba6('0x33')]=_0x180735;if(_0x28b48a[_0x2ba6('0x47')][_0x2ba6('0x54')]){_0x153678[_0x2ba6('0x55')]=[{'all':!![]}];}return db[_0x2ba6('0x6b')]['findAll'](_0x153678);})[_0x2ba6('0x24')](function(_0x116aa2){_0x1342e1[_0x2ba6('0x57')]=_0x116aa2;return _0x1342e1;});}})[_0x2ba6('0x24')](respondWithFilteredResult(_0x180f62,_0x153678))[_0x2ba6('0x58')](handleError(_0x180f62,null));};exports[_0x2ba6('0x6d')]=function(_0x1d66bb,_0xca7916,_0x483b1f){return db['OpenchannelAccount']['find']({'where':{'id':_0x1d66bb[_0x2ba6('0x65')]['id']}})[_0x2ba6('0x24')](handleEntityNotFound(_0xca7916,null))['then'](function(_0x475f19){if(_0x475f19){return _0x475f19[_0x2ba6('0x6d')](_0x1d66bb[_0x2ba6('0x47')][_0x2ba6('0x6e')]);}})[_0x2ba6('0x24')](respondWithStatusCode(_0xca7916,null))[_0x2ba6('0x58')](handleError(_0xca7916,null));};exports[_0x2ba6('0x6f')]=function(_0x50783b,_0x1bc03b,_0xb54bd){if(_0x50783b[_0x2ba6('0x60')]['id']){delete _0x50783b['body']['id'];}return db[_0x2ba6('0x43')][_0x2ba6('0x5e')]({'where':{'id':_0x50783b['params']['id']}})[_0x2ba6('0x24')](handleEntityNotFound(_0x1bc03b,null))['then'](function(_0x5c8ed7){if(_0x5c8ed7){_0x50783b[_0x2ba6('0x60')][_0x2ba6('0x68')]=_0x5c8ed7['id'];return db[_0x2ba6('0x70')][_0x2ba6('0x5f')](_0x50783b[_0x2ba6('0x60')]);}})[_0x2ba6('0x24')](respondWithResult(_0x1bc03b,null))['catch'](handleError(_0x1bc03b,null));};exports[_0x2ba6('0x71')]=function(_0x6900b9,_0x4085a2,_0x475fb4){var _0x444395={'raw':![],'where':{}};var _0x27a6d5={};var _0x911a87={'count':0x0,'rows':[]};return db[_0x2ba6('0x43')][_0x2ba6('0x6a')]({'where':{'id':_0x6900b9[_0x2ba6('0x65')]['id']}})[_0x2ba6('0x24')](handleEntityNotFound(_0x4085a2,null))[_0x2ba6('0x24')](function(_0xa6eef1){if(_0xa6eef1){_0x27a6d5[_0x2ba6('0x46')]=_['keys'](db[_0x2ba6('0x70')][_0x2ba6('0x5b')]);_0x27a6d5['query']=_[_0x2ba6('0x48')](_0x6900b9['query']);_0x27a6d5[_0x2ba6('0x4f')]=_[_0x2ba6('0x49')](_0x27a6d5['model'],_0x27a6d5[_0x2ba6('0x47')]);_0x444395[_0x2ba6('0x4a')]=_[_0x2ba6('0x49')](_0x27a6d5[_0x2ba6('0x46')],qs['fields'](_0x6900b9[_0x2ba6('0x47')][_0x2ba6('0x4b')]));_0x444395[_0x2ba6('0x4a')]=_0x444395['attributes'][_0x2ba6('0x5c')]?_0x444395[_0x2ba6('0x4a')]:_0x27a6d5[_0x2ba6('0x46')];if(!_0x6900b9[_0x2ba6('0x47')]['hasOwnProperty'](_0x2ba6('0x4c'))){_0x444395[_0x2ba6('0x32')]=qs[_0x2ba6('0x32')](_0x6900b9[_0x2ba6('0x47')][_0x2ba6('0x32')]);_0x444395[_0x2ba6('0x30')]=qs[_0x2ba6('0x30')](_0x6900b9[_0x2ba6('0x47')][_0x2ba6('0x30')]);}_0x444395[_0x2ba6('0x72')]=qs[_0x2ba6('0x4d')](_0x6900b9[_0x2ba6('0x47')][_0x2ba6('0x4d')]);_0x444395[_0x2ba6('0x52')]=qs[_0x2ba6('0x4f')](_[_0x2ba6('0x4e')](_0x6900b9['query'],_0x27a6d5['filters']));_0x444395[_0x2ba6('0x52')]['OpenchannelAccountId']=_0xa6eef1['id'];if(_0x6900b9[_0x2ba6('0x47')][_0x2ba6('0x50')]){_0x444395['where']=_[_0x2ba6('0x51')](_0x444395[_0x2ba6('0x52')],{'$or':_[_0x2ba6('0x42')](_0x444395[_0x2ba6('0x4a')],function(_0x5958d3){var _0x3181f2={};_0x3181f2[_0x5958d3]={'$like':'%'+_0x6900b9[_0x2ba6('0x47')]['filter']+'%'};return _0x3181f2;})});}_0x444395=_['merge']({},_0x444395,_0x6900b9['options']);return db['CannedAnswer'][_0x2ba6('0x33')]({'where':_0x444395[_0x2ba6('0x52')]})[_0x2ba6('0x24')](function(_0x21a041){_0x911a87['count']=_0x21a041;if(_0x6900b9[_0x2ba6('0x47')][_0x2ba6('0x54')]){_0x444395['include']=[{'all':!![]}];}return db[_0x2ba6('0x70')][_0x2ba6('0x56')](_0x444395);})[_0x2ba6('0x24')](function(_0x4c27ec){_0x911a87['rows']=_0x4c27ec;return _0x911a87;});}})[_0x2ba6('0x24')](respondWithFilteredResult(_0x4085a2,_0x444395))[_0x2ba6('0x58')](handleError(_0x4085a2,null));};exports['removeAnswers']=function(_0x5ec989,_0x2ba928,_0xc23642){return db[_0x2ba6('0x43')][_0x2ba6('0x5e')]({'where':{'id':_0x5ec989[_0x2ba6('0x65')]['id']}})[_0x2ba6('0x24')](handleEntityNotFound(_0x2ba928,null))[_0x2ba6('0x24')](function(_0x30252d){if(_0x30252d){return _0x30252d[_0x2ba6('0x73')](_0x5ec989[_0x2ba6('0x47')][_0x2ba6('0x6e')]);}})['then'](respondWithStatusCode(_0x2ba928,null))[_0x2ba6('0x58')](handleError(_0x2ba928,null));};exports['notify']=function(_0x14aae5,_0x2e9ee,_0x7e244d){var _0x23a817={'body':_0x14aae5[_0x2ba6('0x60')],'channel':_0x2ba6('0x74')};var _0x43d5ca=[];var _0x471794=[];var _0x30c2ea={};var _0x5b0e53=![];return db['CmContact'][_0x2ba6('0x66')]()[_0x2ba6('0x24')](function(_0x21e552){if(!_0x21e552){throw new db['Sequelize']['ValidationError'](_0x2ba6('0x75'));}_0x43d5ca=_[_0x2ba6('0x76')](_[_0x2ba6('0x48')](_0x21e552),['createdAt',_0x2ba6('0x77')]);_0x471794=_[_0x2ba6('0x76')](_[_0x2ba6('0x48')](_0x21e552),[_0x2ba6('0x78'),_0x2ba6('0x77'),_0x2ba6('0x79'),'ListId']);if(_0x14aae5[_0x2ba6('0x60')]['id']){delete _0x14aae5[_0x2ba6('0x60')]['id'];}if(_[_0x2ba6('0x7a')](_0x14aae5[_0x2ba6('0x60')][_0x2ba6('0x7b')])){throw new db[(_0x2ba6('0x7c'))][(_0x2ba6('0x7d'))](_0x2ba6('0x7e'));}if(_[_0x2ba6('0x7a')](_0x14aae5[_0x2ba6('0x60')][_0x2ba6('0x60')])||_0x14aae5['body'][_0x2ba6('0x60')]===''){throw new db['Sequelize'][(_0x2ba6('0x7d'))](_0x2ba6('0x7f'));}if(_['isNil'](_0x14aae5['body'][_0x2ba6('0x80')])){throw new db[(_0x2ba6('0x7c'))][(_0x2ba6('0x7d'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x471794);}if(!_[_0x2ba6('0x81')](_0x471794,_0x14aae5[_0x2ba6('0x60')][_0x2ba6('0x80')])){throw new db['Sequelize'][(_0x2ba6('0x7d'))](_0x2ba6('0x82')+_0x471794);}_0x30c2ea[_0x14aae5[_0x2ba6('0x60')]['mapKey']]=_0x14aae5['body'][_0x2ba6('0x7b')];})[_0x2ba6('0x24')](function(){return db['OpenchannelAccount'][_0x2ba6('0x5e')]({'where':{'id':_0x14aae5[_0x2ba6('0x65')]['id']},'include':[{'model':db[_0x2ba6('0x83')],'as':'List','include':[{'model':db[_0x2ba6('0x84')],'as':_0x2ba6('0x85'),'where':_0x30c2ea,'limit':0x1,'order':[[_0x2ba6('0x77'),_0x2ba6('0x86')]]}]},{'model':db[_0x2ba6('0x87')],'as':_0x2ba6('0x88')}]});})['then'](handleEntityNotFound(_0x2e9ee,null))[_0x2ba6('0x24')](function(_0x109a9e){if(_0x109a9e&&_0x109a9e[_0x2ba6('0x89')]){_0x23a817[_0x2ba6('0x8a')]=_0x109a9e;_0x23a817[_0x2ba6('0x8b')]=_0x109a9e['Applications'];_0x23a817['list']=_0x109a9e[_0x2ba6('0x89')];_0x23a817[_0x2ba6('0x8b')]=_[_0x2ba6('0x8c')](_0x23a817[_0x2ba6('0x8b')],[_0x2ba6('0x8d')],['asc']);if(_0x23a817[_0x2ba6('0x8a')][_0x2ba6('0x88')]){delete _0x23a817[_0x2ba6('0x8a')][_0x2ba6('0x88')];}if(_0x23a817[_0x2ba6('0x8a')][_0x2ba6('0x89')]&&_0x23a817[_0x2ba6('0x8a')]['List'][_0x2ba6('0x85')]['length']){return _0x23a817[_0x2ba6('0x8a')][_0x2ba6('0x89')][_0x2ba6('0x85')][0x0];}var _0x42ac16=_[_0x2ba6('0x1c')](_0x14aae5[_0x2ba6('0x60')],{'firstName':_0x14aae5['body'][_0x2ba6('0x7b')],'ListId':_0x109a9e[_0x2ba6('0x8e')]});_0x42ac16[_0x14aae5[_0x2ba6('0x60')][_0x2ba6('0x80')]]=_0x14aae5[_0x2ba6('0x60')][_0x2ba6('0x7b')];return db[_0x2ba6('0x84')][_0x2ba6('0x5f')](_0x42ac16,{'fields':_0x43d5ca,'raw':!![]});}})[_0x2ba6('0x24')](handleEntityNotFound(_0x2e9ee,null))[_0x2ba6('0x24')](function(_0x4d41cb){_0x23a817[_0x2ba6('0x8f')]=_0x4d41cb;if(_0x4d41cb){var _0x30c777={'ContactId':_0x4d41cb['id'],'OpenchannelAccountId':_0x14aae5[_0x2ba6('0x65')]['id'],'from':(_0x4d41cb['firstName']||'')+'\x20'+(_0x4d41cb['lastName']||'')};var _0x14e4a5={'OpenchannelAccountId':_0x14aae5['params']['id'],'closed':![]};if(_0x14aae5[_0x2ba6('0x60')][_0x2ba6('0x90')]){_0x14e4a5[_0x2ba6('0x90')]=_0x14aae5[_0x2ba6('0x60')][_0x2ba6('0x90')];return db[_0x2ba6('0x91')][_0x2ba6('0x5e')]({'where':_0x14e4a5})['then'](function(_0x3595ee){if(_0x3595ee){return[_0x3595ee,![]];}_0x30c777[_0x2ba6('0x90')]=_0x14aae5[_0x2ba6('0x60')][_0x2ba6('0x90')];_0x30c777[_0x2ba6('0x92')]=_0x14aae5[_0x2ba6('0x60')][_0x2ba6('0x92')];return db[_0x2ba6('0x91')][_0x2ba6('0x5f')](_0x30c777)['then'](function(_0x682bab){return[_0x682bab,!![]];});});}else{_0x14e4a5[_0x2ba6('0x90')]=null;}_0x14e4a5[_0x2ba6('0x93')]=_0x4d41cb['id'];return db[_0x2ba6('0x91')][_0x2ba6('0x5e')]({'where':_0x14e4a5})[_0x2ba6('0x24')](function(_0x226592){if(_0x226592){return[_0x226592,![]];}return db[_0x2ba6('0x91')][_0x2ba6('0x5f')](_0x30c777)[_0x2ba6('0x24')](function(_0x2095e){return[_0x2095e,!![]];});});}})[_0x2ba6('0x94')](function(_0x105635,_0x38a60f){if(_0x105635){_0x5b0e53=_0x38a60f;if(!_0x38a60f){var _0x5dab03={'from':(_0x23a817[_0x2ba6('0x8f')][_0x2ba6('0x95')]||'')+'\x20'+(_0x23a817['contact'][_0x2ba6('0x96')]||'')};if(_0x14aae5[_0x2ba6('0x60')][_0x2ba6('0x90')]&&_0x14aae5[_0x2ba6('0x60')][_0x2ba6('0x97')]&&_0x14aae5['body'][_0x2ba6('0x90')]!=_0x14aae5[_0x2ba6('0x60')][_0x2ba6('0x97')]){_0x5dab03[_0x2ba6('0x90')]=_0x14aae5[_0x2ba6('0x60')][_0x2ba6('0x97')];}return _0x105635['update'](_0x5dab03);}else{return _0x105635;}}})[_0x2ba6('0x24')](function(_0x1a1244){_0x23a817[_0x2ba6('0x98')]=_0x1a1244[_0x2ba6('0x3c')]({'plain':!![]});_0x23a817['interaction'][_0x2ba6('0x99')]=_0x5b0e53;if(_0x23a817[_0x2ba6('0x98')][_0x2ba6('0x99')]){if(_0x23a817[_0x2ba6('0x8a')]['autoclose']){_0x23a817[_0x2ba6('0x8b')][_0x2ba6('0x9a')]({'id':0x0,'priority':_0x23a817[_0x2ba6('0x8b')][_0x2ba6('0x5c')]+0x1,'app':_0x2ba6('0x9b'),'appdata':'unmanaged','interval':_0x2ba6('0x9c')});}}return db[_0x2ba6('0x9d')]['create']({'body':_0x14aae5[_0x2ba6('0x60')][_0x2ba6('0x60')],'OpenchannelAccountId':_0x14aae5[_0x2ba6('0x65')]['id'],'OpenchannelInteractionId':_0x1a1244['id'],'direction':'in','ContactId':_0x23a817[_0x2ba6('0x8f')]['id'],'AttachmentId':_0x14aae5[_0x2ba6('0x60')]['AttachmentId']});})[_0x2ba6('0x24')](function(_0x10bbac){_0x23a817[_0x2ba6('0x2b')]=_0x10bbac;if(_0x23a817[_0x2ba6('0x98')][_0x2ba6('0x9e')]){return db['User'][_0x2ba6('0x5e')]({'attributes':['id',_0x2ba6('0x40')],'where':{'id':_0x23a817[_0x2ba6('0x98')][_0x2ba6('0x9e')]}})[_0x2ba6('0x24')](function(_0x5490ae){if(_0x5490ae){_0x23a817[_0x2ba6('0x8b')][_0x2ba6('0x9f')]({'id':0x0,'priority':0x0,'app':_0x2ba6('0xa0'),'appdata':_0x5490ae[_0x2ba6('0x40')]+','+(_0x23a817['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x23a817['forcedOwnership']=![];}return respondWithRpcPromise('Start','startRouting',_0x23a817);});}return respondWithRpcPromise(_0x2ba6('0xa1'),_0x2ba6('0xa2'),_0x23a817);})[_0x2ba6('0x24')](function(_0x555417){respondWithRpcPromise(_0x2ba6('0xa3'),'EventManager',{'event':_0x2ba6('0xa4'),'message':_0x555417},client9002);return _0x555417;})[_0x2ba6('0x24')](respondWithResult(_0x2e9ee,null))[_0x2ba6('0x58')](handleError(_0x2e9ee,null));};exports[_0x2ba6('0xa5')]=function(_0xff7c04,_0x2356d9){var _0x56bdc8=_0xff7c04['params']['id'];var _0x4999ef=_0xff7c04[_0x2ba6('0x60')];var _0xa24142=0xc8;var _0x30b828=null;return db[_0x2ba6('0xa6')][_0x2ba6('0xa7')]({'isolationLevel':db[_0x2ba6('0xa6')][_0x2ba6('0xa8')][_0x2ba6('0xa9')][_0x2ba6('0xaa')]},function(_0x23b5a1){return db[_0x2ba6('0x43')][_0x2ba6('0x6a')]({'where':{'id':_0x56bdc8},'transaction':_0x23b5a1})[_0x2ba6('0x24')](function(_0x147ccf){if(_0x147ccf){return db['OpenchannelApplication'][_0x2ba6('0x3b')]({'where':{'OpenchannelAccountId':_0x56bdc8},'transaction':_0x23b5a1})['then'](function(){var _0x3029fd=_['map'](_0x4999ef,function(_0x44dd7c){_0x44dd7c[_0x2ba6('0x68')]=_0x56bdc8;return _0x44dd7c;});return db[_0x2ba6('0x87')]['bulkCreate'](_0x3029fd,{'transaction':_0x23b5a1});});}else{_0xa24142=0x194;_0x30b828=[];}});})['then'](function(){if(_0xa24142!==0x194){return db['OpenchannelApplication'][_0x2ba6('0xab')]({'where':{'OpenchannelAccountId':_0x56bdc8},'order':_0x2ba6('0x8d')})['then'](function(_0x5872a6){_0x30b828=_0x5872a6;});}})[_0x2ba6('0x58')](function(_0x175b87){_0xa24142=0x1f4;logger[_0x2ba6('0x29')](_0x175b87[_0x2ba6('0x3f')]);if(_0x175b87['name']){delete _0x175b87[_0x2ba6('0x40')];}_0x30b828=_0x175b87;})[_0x2ba6('0xac')](function(){if(_0x30b828===null){_0x2356d9[_0x2ba6('0x2d')](_0xa24142);}else{if(_0xa24142===0x1f4){_0x2356d9[_0x2ba6('0x2e')](_0xa24142)[_0x2ba6('0xad')](_0x30b828);}else{_0x2356d9[_0x2ba6('0x2e')](_0xa24142)['json'](_0x30b828);}}});};exports[_0x2ba6('0xae')]=function(_0x5779c5,_0x3065b9,_0x37923e){var _0x7c8758={};var _0x3b9eca={};var _0x122411;var _0x36e433;return db['OpenchannelAccount'][_0x2ba6('0x6a')]({'where':{'id':_0x5779c5[_0x2ba6('0x65')]['id']}})[_0x2ba6('0x24')](handleEntityNotFound(_0x3065b9,null))[_0x2ba6('0x24')](function(_0x3d2f29){if(_0x3d2f29){_0x122411=_0x3d2f29;_0x3b9eca[_0x2ba6('0x46')]=_[_0x2ba6('0x48')](db[_0x2ba6('0x87')]['rawAttributes']);_0x3b9eca['query']=_[_0x2ba6('0x48')](_0x5779c5[_0x2ba6('0x47')]);_0x3b9eca['filters']=_[_0x2ba6('0x49')](_0x3b9eca[_0x2ba6('0x46')],_0x3b9eca['query']);_0x7c8758['attributes']=_[_0x2ba6('0x49')](_0x3b9eca['model'],qs[_0x2ba6('0x4b')](_0x5779c5[_0x2ba6('0x47')]['fields']));_0x7c8758[_0x2ba6('0x4a')]=_0x7c8758[_0x2ba6('0x4a')][_0x2ba6('0x5c')]?_0x7c8758[_0x2ba6('0x4a')]:_0x3b9eca[_0x2ba6('0x46')];_0x7c8758[_0x2ba6('0x72')]=qs[_0x2ba6('0x4d')](_0x5779c5[_0x2ba6('0x47')][_0x2ba6('0x4d')]);_0x7c8758[_0x2ba6('0x52')]=qs['filters'](_['pick'](_0x5779c5[_0x2ba6('0x47')],_0x3b9eca[_0x2ba6('0x4f')]));if(_0x5779c5[_0x2ba6('0x47')][_0x2ba6('0x50')]){_0x7c8758[_0x2ba6('0x52')]=_['merge'](_0x7c8758[_0x2ba6('0x52')],{'$or':_[_0x2ba6('0x42')](_0x7c8758[_0x2ba6('0x4a')],function(_0x194112){var _0x411ecd={};_0x411ecd[_0x194112]={'$like':'%'+_0x5779c5[_0x2ba6('0x47')][_0x2ba6('0x50')]+'%'};return _0x411ecd;})});}_0x7c8758=_[_0x2ba6('0x51')]({},_0x7c8758,_0x5779c5[_0x2ba6('0x5d')]);return _0x122411['getApplications'](_0x7c8758);}})[_0x2ba6('0x24')](function(_0xa5da20){if(_0xa5da20){_0x36e433=_0xa5da20[_0x2ba6('0x5c')];if(!_0x5779c5[_0x2ba6('0x47')][_0x2ba6('0x6c')](_0x2ba6('0x4c'))){_0x7c8758[_0x2ba6('0x32')]=qs[_0x2ba6('0x32')](_0x5779c5[_0x2ba6('0x47')][_0x2ba6('0x32')]);_0x7c8758[_0x2ba6('0x30')]=qs[_0x2ba6('0x30')](_0x5779c5[_0x2ba6('0x47')][_0x2ba6('0x30')]);}return _0x122411['getApplications'](_0x7c8758);}})[_0x2ba6('0x24')](function(_0x1e4137){if(_0x1e4137){return _0x1e4137?{'count':_0x36e433,'rows':_0x1e4137}:null;}})[_0x2ba6('0x24')](respondWithResult(_0x3065b9,null))[_0x2ba6('0x58')](handleError(_0x3065b9,null));};exports[_0x2ba6('0xaf')]=function(_0x4fd429,_0x39c226,_0xae55f6){var _0x33b27a={'raw':![],'where':{}};var _0x213ba9={};var _0x4bad1a={'count':0x0,'rows':[]};return db[_0x2ba6('0x43')][_0x2ba6('0x6a')]({'where':{'id':_0x4fd429[_0x2ba6('0x65')]['id']}})[_0x2ba6('0x24')](handleEntityNotFound(_0x39c226,null))[_0x2ba6('0x24')](function(_0x54a87f){if(_0x54a87f){_0x213ba9[_0x2ba6('0x46')]=_['keys'](db[_0x2ba6('0x91')][_0x2ba6('0x5b')]);_0x213ba9[_0x2ba6('0x47')]=_[_0x2ba6('0x48')](_0x4fd429[_0x2ba6('0x47')]);_0x213ba9['filters']=_['intersection'](_0x213ba9['model'],_0x213ba9[_0x2ba6('0x47')]);_0x33b27a[_0x2ba6('0x4a')]=_[_0x2ba6('0x49')](_0x213ba9[_0x2ba6('0x46')],qs[_0x2ba6('0x4b')](_0x4fd429['query'][_0x2ba6('0x4b')]));_0x33b27a[_0x2ba6('0x4a')]=_0x33b27a[_0x2ba6('0x4a')][_0x2ba6('0x5c')]?_0x33b27a['attributes']:_0x213ba9[_0x2ba6('0x46')];if(!_0x4fd429[_0x2ba6('0x47')][_0x2ba6('0x6c')](_0x2ba6('0x4c'))){_0x33b27a['limit']=qs[_0x2ba6('0x32')](_0x4fd429[_0x2ba6('0x47')][_0x2ba6('0x32')]);_0x33b27a[_0x2ba6('0x30')]=qs[_0x2ba6('0x30')](_0x4fd429[_0x2ba6('0x47')][_0x2ba6('0x30')]);}_0x33b27a[_0x2ba6('0x72')]=qs[_0x2ba6('0x4d')](_0x4fd429[_0x2ba6('0x47')][_0x2ba6('0x4d')]);_0x33b27a[_0x2ba6('0x52')]=qs[_0x2ba6('0x4f')](_[_0x2ba6('0x4e')](_0x4fd429[_0x2ba6('0x47')],_0x213ba9[_0x2ba6('0x4f')]));_0x33b27a[_0x2ba6('0x52')][_0x2ba6('0x68')]=_0x54a87f['id'];if(_0x4fd429[_0x2ba6('0x47')][_0x2ba6('0x50')]){_0x33b27a[_0x2ba6('0x52')]=_['merge'](_0x33b27a['where'],{'$or':_[_0x2ba6('0x42')](_0x33b27a[_0x2ba6('0x4a')],function(_0x4640d0){var _0x2a4a68={};_0x2a4a68[_0x4640d0]={'$like':'%'+_0x4fd429[_0x2ba6('0x47')]['filter']+'%'};return _0x2a4a68;})});}_0x33b27a=_['merge']({},_0x33b27a,_0x4fd429[_0x2ba6('0x5d')]);return db[_0x2ba6('0x91')]['count']({'where':_0x33b27a[_0x2ba6('0x52')]})[_0x2ba6('0x24')](function(_0x112a5c){_0x4bad1a['count']=_0x112a5c;if(_0x4fd429[_0x2ba6('0x47')][_0x2ba6('0x54')]){_0x33b27a[_0x2ba6('0x55')]=[{'model':db[_0x2ba6('0x84')],'as':_0x2ba6('0xb0'),'required':![]},{'model':db[_0x2ba6('0xb1')],'as':'Owner','attributes':[_0x2ba6('0x40'),_0x2ba6('0xb2'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x2ba6('0xb3'),'attributes':['id',_0x2ba6('0x40'),'color'],'where':_0x4fd429['query'][_0x2ba6('0xb4')]?{'id':_0x4fd429[_0x2ba6('0x47')][_0x2ba6('0xb4')]}:undefined,'required':_0x4fd429[_0x2ba6('0x47')][_0x2ba6('0xb4')]?!![]:![]}];}return db['OpenchannelInteraction']['findAll'](_0x33b27a);})[_0x2ba6('0x24')](function(_0x49b823){_0x4bad1a[_0x2ba6('0x57')]=_0x49b823;return _0x4bad1a;});}})[_0x2ba6('0x24')](respondWithFilteredResult(_0x39c226,_0x33b27a))['catch'](handleError(_0x39c226,null));};exports['addAgents']=function(_0x54f301,_0x2a2a0d,_0x486a7a){return db['OpenchannelAccount'][_0x2ba6('0x5e')]({'where':{'id':_0x54f301[_0x2ba6('0x65')]['id']}})[_0x2ba6('0x24')](handleEntityNotFound(_0x2a2a0d,null))[_0x2ba6('0x24')](function(_0x39b619){if(_0x39b619){return _0x39b619[_0x2ba6('0xb5')](_0x54f301[_0x2ba6('0x60')][_0x2ba6('0x6e')],_[_0x2ba6('0xb6')](_0x54f301[_0x2ba6('0x60')],['ids','id'])||{})[_0x2ba6('0x94')](function(_0x1024d6){for(var _0x190903=0x0;_0x190903<_0x54f301[_0x2ba6('0x60')][_0x2ba6('0x6e')][_0x2ba6('0x5c')];_0x190903+=0x1){socket[_0x2ba6('0xb7')]('userOpenchannelAccount:save',{'UserId':Number(_0x54f301[_0x2ba6('0x60')][_0x2ba6('0x6e')][_0x190903]),'OpenchannelAccountId':Number(_0x54f301['params']['id'])});}return _0x1024d6;});}})['then'](respondWithResult(_0x2a2a0d,null))[_0x2ba6('0x58')](handleError(_0x2a2a0d,null));};exports[_0x2ba6('0xb8')]=function(_0x517e7c,_0x3d08f2,_0x4726be){return db[_0x2ba6('0x43')]['find']({'where':{'id':_0x517e7c[_0x2ba6('0x65')]['id']}})['then'](handleEntityNotFound(_0x3d08f2,null))[_0x2ba6('0x24')](function(_0x5b1fc0){if(_0x5b1fc0){return _0x5b1fc0[_0x2ba6('0xb8')](_0x517e7c['query'][_0x2ba6('0x6e')])['then'](function(){if(_['isArray'](_0x517e7c['query'][_0x2ba6('0x6e')])){for(var _0x29eda3=0x0;_0x29eda3<_0x517e7c[_0x2ba6('0x47')][_0x2ba6('0x6e')][_0x2ba6('0x5c')];_0x29eda3+=0x1){socket[_0x2ba6('0xb7')](_0x2ba6('0xb9'),{'UserId':Number(_0x517e7c[_0x2ba6('0x47')][_0x2ba6('0x6e')][_0x29eda3]),'OpenchannelAccountId':Number(_0x517e7c[_0x2ba6('0x65')]['id'])});}}else{socket[_0x2ba6('0xb7')](_0x2ba6('0xb9'),{'UserId':Number(_0x517e7c[_0x2ba6('0x47')]['ids']),'OpenchannelAccountId':Number(_0x517e7c['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3d08f2,null))[_0x2ba6('0x58')](handleError(_0x3d08f2,null));};exports['getAgents']=function(_0x2396ce,_0x1f25ab,_0x1f52f5){var _0x289f2b={};var _0x17f1d0={};var _0x308fb0;var _0x1d34c8;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x2396ce[_0x2ba6('0x65')]['id']}})['then'](handleEntityNotFound(_0x1f25ab,null))[_0x2ba6('0x24')](function(_0x39fcea){if(_0x39fcea){_0x308fb0=_0x39fcea;_0x17f1d0[_0x2ba6('0x46')]=_[_0x2ba6('0x48')](db[_0x2ba6('0xb1')]['rawAttributes']);_0x17f1d0['query']=_[_0x2ba6('0x48')](_0x2396ce[_0x2ba6('0x47')]);_0x17f1d0[_0x2ba6('0x4f')]=_[_0x2ba6('0x49')](_0x17f1d0[_0x2ba6('0x46')],_0x17f1d0[_0x2ba6('0x47')]);_0x289f2b[_0x2ba6('0x4a')]=_['intersection'](_0x17f1d0['model'],qs[_0x2ba6('0x4b')](_0x2396ce[_0x2ba6('0x47')]['fields']));_0x289f2b[_0x2ba6('0x4a')]=_0x289f2b['attributes'][_0x2ba6('0x5c')]?_0x289f2b['attributes']:_0x17f1d0[_0x2ba6('0x46')];_0x289f2b[_0x2ba6('0x72')]=qs[_0x2ba6('0x4d')](_0x2396ce[_0x2ba6('0x47')][_0x2ba6('0x4d')]);_0x289f2b[_0x2ba6('0x52')]=qs[_0x2ba6('0x4f')](_['pick'](_0x2396ce[_0x2ba6('0x47')],_0x17f1d0[_0x2ba6('0x4f')]));if(_0x2396ce[_0x2ba6('0x47')]['filter']){_0x289f2b[_0x2ba6('0x52')]=_[_0x2ba6('0x51')](_0x289f2b['where'],{'$or':_['map'](_0x289f2b['attributes'],function(_0x58a550){var _0x1337e3={};_0x1337e3[_0x58a550]={'$like':'%'+_0x2396ce[_0x2ba6('0x47')][_0x2ba6('0x50')]+'%'};return _0x1337e3;})});}_0x289f2b=_[_0x2ba6('0x51')]({},_0x289f2b,_0x2396ce['options']);return _0x308fb0[_0x2ba6('0xba')](_0x289f2b);}})[_0x2ba6('0x24')](function(_0xb096a4){if(_0xb096a4){_0x1d34c8=_0xb096a4['length'];if(!_0x2396ce[_0x2ba6('0x47')][_0x2ba6('0x6c')]('nolimit')){_0x289f2b[_0x2ba6('0x32')]=qs[_0x2ba6('0x32')](_0x2396ce[_0x2ba6('0x47')][_0x2ba6('0x32')]);_0x289f2b[_0x2ba6('0x30')]=qs['offset'](_0x2396ce['query'][_0x2ba6('0x30')]);}return _0x308fb0[_0x2ba6('0xba')](_0x289f2b);}})[_0x2ba6('0x24')](function(_0x57b5c7){if(_0x57b5c7){return _0x57b5c7?{'count':_0x1d34c8,'rows':_0x57b5c7}:null;}})[_0x2ba6('0x24')](respondWithResult(_0x1f25ab,null))[_0x2ba6('0x58')](handleError(_0x1f25ab,null));};exports['send']=function(_0x53dde9,_0x48a909,_0x1b69cb){var _0x5d1458,_0x37fbc5,_0x3fd150;if(_[_0x2ba6('0x7a')](_0x53dde9[_0x2ba6('0x60')][_0x2ba6('0x60')])||_0x53dde9['body'][_0x2ba6('0x60')]===''){throw new db[(_0x2ba6('0x7c'))][(_0x2ba6('0x7d'))](_0x2ba6('0x7f'));}if(_[_0x2ba6('0x7a')](_0x53dde9[_0x2ba6('0x60')]['to'])){}_0x5d1458=_0x53dde9[_0x2ba6('0x60')]['to'];return db[_0x2ba6('0x43')]['findOne']({'where':{'id':_0x53dde9[_0x2ba6('0x65')]['id']}})[_0x2ba6('0x24')](handleEntityNotFound(_0x48a909,null))['then'](function(_0x549354){if(_0x549354){return db[_0x2ba6('0x43')][_0x2ba6('0x5e')]({'where':{'id':_0x549354['id']},'include':[{'model':db[_0x2ba6('0x83')],'as':_0x2ba6('0x89'),'include':[{'model':db[_0x2ba6('0x84')],'as':_0x2ba6('0x85'),'where':{[_0x549354['mapKey']]:_0x5d1458},'limit':0x1,'order':[[_0x2ba6('0x77'),'DESC']]}]}]})[_0x2ba6('0x24')](handleEntityNotFound(_0x48a909,null))['then'](function(_0x53d3dd){if(_0x53d3dd&&_0x53d3dd[_0x2ba6('0x89')]){_0x37fbc5=_0x53d3dd[_0x2ba6('0x3c')]({'plain':!![]});if(_0x37fbc5[_0x2ba6('0x89')]&&_0x37fbc5[_0x2ba6('0x89')]['Contacts'][_0x2ba6('0x5c')]){return _0x37fbc5[_0x2ba6('0x89')][_0x2ba6('0x85')][0x0];}return db[_0x2ba6('0x84')][_0x2ba6('0x5f')](_['defaults'](_0x53dde9[_0x2ba6('0x60')],{'firstName':_0x5d1458,[_0x53d3dd[_0x2ba6('0x80')]]:_0x5d1458,'phone':_0x5d1458,'ListId':_0x37fbc5[_0x2ba6('0x8e')]}));}})[_0x2ba6('0x24')](handleEntityNotFound(_0x48a909,null))[_0x2ba6('0x24')](function(_0x4dc943){if(_0x4dc943){_0x3fd150=_0x4dc943;return db[_0x2ba6('0x91')][_0x2ba6('0x5e')]({'where':{'ContactId':_0x3fd150['id'],'closed':![],'OpenchannelAccountId':_0x37fbc5['id']}})[_0x2ba6('0x24')](function(_0xb8965){if(_0xb8965){return[_0xb8965,![]];}return db[_0x2ba6('0x91')]['create']({'UserId':_0x53dde9['user']['id'],'ContactId':_0x3fd150['id'],'OpenchannelAccountId':_0x37fbc5['id'],'lastMsgDirection':'out','Messages':[_[_0x2ba6('0x51')](_0x53dde9[_0x2ba6('0x60')],{'read':![],'body':_0x53dde9[_0x2ba6('0x60')][_0x2ba6('0x60')],'OpenchannelAccountId':_0x37fbc5['id'],'UserId':_0x53dde9['user']['id'],'ContactId':_0x3fd150['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x2ba6('0xbb')}]})[_0x2ba6('0x24')](function(_0x5745e3){return[_0x5745e3,!![]];});});}})['spread'](function(_0x3fea8f,_0x59bfe9){if(_0x59bfe9){return _0x3fea8f;}return db['OpenchannelMessage']['create'](_[_0x2ba6('0x51')](_0x53dde9[_0x2ba6('0x60')],{'read':![],'body':_0x53dde9[_0x2ba6('0x60')]['body'],'OpenchannelAccountId':_0x37fbc5['id'],'OpenchannelInteractionId':_0x3fea8f['id'],'UserId':_0x53dde9[_0x2ba6('0x61')]['id'],'ContactId':_0x3fd150['id']}))[_0x2ba6('0x24')](function(_0x2104c6){_0x3fea8f[_0x2ba6('0xbc')][_0x2ba6('0xbb')]=[];_0x3fea8f['dataValues']['Messages']['push'](_0x2104c6[_0x2ba6('0xbc')]);return _0x3fea8f;});});}})[_0x2ba6('0x24')](respondWithResult(_0x48a909,null))[_0x2ba6('0x58')](handleError(_0x48a909,null));}; \ No newline at end of file +var _0x89a9=['emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','rimraf','zip-dir','fast-json-patch','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','register','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','get','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','OpenchannelAccount','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','include','rows','show','params','Pause','mandatoryDispositionPause','options','find','body','user','role','OpenchannelAccounts','UserProfileSection','userProfileId','create','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','notify','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','mapKey','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','messageId','created','interaction','autoclose','push','close','unmanaged','OpenchannelMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit'];(function(_0x59a3e9,_0x27fb38){var _0x5179ac=function(_0x5a9b1c){while(--_0x5a9b1c){_0x59a3e9['push'](_0x59a3e9['shift']());}};_0x5179ac(++_0x27fb38);}(_0x89a9,0xc7));var _0x989a=function(_0x1958e5,_0x567bc4){_0x1958e5=_0x1958e5-0x0;var _0x26cacb=_0x89a9[_0x1958e5];return _0x26cacb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x989a('0x0'));var zipdir=require(_0x989a('0x1'));var jsonpatch=require(_0x989a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x989a('0x3'));var Mustache=require(_0x989a('0x4'));var util=require(_0x989a('0x5'));var path=require(_0x989a('0x6'));var sox=require(_0x989a('0x7'));var csv=require(_0x989a('0x8'));var ejs=require(_0x989a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x989a('0xa'));var squel=require(_0x989a('0xb'));var crypto=require(_0x989a('0xc'));var jsforce=require(_0x989a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x989a('0x8'));var querystring=require(_0x989a('0xe'));var Papa=require(_0x989a('0xf'));var Redis=require(_0x989a('0x10'));var authService=require(_0x989a('0x11'));var qs=require(_0x989a('0x12'));var as=require(_0x989a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x989a('0x14'))(_0x989a('0x15'));var utils=require(_0x989a('0x16'));var config=require(_0x989a('0x17'));var licenseUtil=require(_0x989a('0x18'));var db=require(_0x989a('0x19'))['db'];config[_0x989a('0x1a')]=_[_0x989a('0x1b')](config[_0x989a('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x989a('0x1a')]));require('./openchannelAccount.socket')[_0x989a('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x989a('0x1d')][_0x989a('0x1e')]({'port':0x232c});var client9002=jayson[_0x989a('0x1d')][_0x989a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x39129d,_0x351403,_0x32e2a4,_0x42a82){return new BPromise(function(_0x4f47aa,_0x861ea0){var _0x19cbf3=_0x42a82||client;return _0x19cbf3[_0x989a('0x1f')](_0x39129d,_0x32e2a4)[_0x989a('0x20')](function(_0xca805b){logger[_0x989a('0x21')](_0x989a('0x22'),_0x351403,_0x989a('0x23'));logger[_0x989a('0x24')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x351403,_0x989a('0x23'),JSON[_0x989a('0x25')](_0xca805b));if(_0xca805b[_0x989a('0x26')]){if(_0xca805b['error'][_0x989a('0x27')]===0x1f4){logger[_0x989a('0x26')](_0x989a('0x22'),_0x351403,_0xca805b[_0x989a('0x26')][_0x989a('0x28')]);return _0x861ea0(_0xca805b[_0x989a('0x26')]['message']);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x351403,_0xca805b[_0x989a('0x26')][_0x989a('0x28')]);return _0x4f47aa(_0xca805b[_0x989a('0x26')]['message']);}else{logger[_0x989a('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x351403,_0x989a('0x23'));_0x4f47aa(_0xca805b['result']['message']);}})[_0x989a('0x29')](function(_0x4e6d1f){logger[_0x989a('0x26')]('OpenchannelAccount,\x20%s,\x20%s',_0x351403,_0x4e6d1f);_0x861ea0(_0x4e6d1f);});});}function respondWithStatusCode(_0x5cc445,_0x5da1ab){_0x5da1ab=_0x5da1ab||0xcc;return function(_0x5571cf){if(_0x5571cf){return _0x5cc445['sendStatus'](_0x5da1ab);}return _0x5cc445[_0x989a('0x2a')](_0x5da1ab)['end']();};}function respondWithResult(_0x1d2ea6,_0x220dc4){_0x220dc4=_0x220dc4||0xc8;return function(_0x712804){if(_0x712804){return _0x1d2ea6[_0x989a('0x2a')](_0x220dc4)['json'](_0x712804);}};}function respondWithFilteredResult(_0x24ea11,_0x1384bf){return function(_0x5ef753){if(_0x5ef753){var _0x5b0bcd=typeof _0x1384bf[_0x989a('0x2b')]===_0x989a('0x2c')&&typeof _0x1384bf['limit']==='undefined';var _0x171303=_0x5ef753[_0x989a('0x2d')];var _0x5e25b5=_0x5b0bcd?0x0:_0x1384bf['offset'];var _0x497971=_0x5b0bcd?_0x5ef753[_0x989a('0x2d')]:_0x1384bf[_0x989a('0x2b')]+_0x1384bf[_0x989a('0x2e')];var _0x27f22e;if(_0x497971>=_0x171303){_0x497971=_0x171303;_0x27f22e=0xc8;}else{_0x27f22e=0xce;}_0x24ea11['status'](_0x27f22e);return _0x24ea11[_0x989a('0x2f')](_0x989a('0x30'),_0x5e25b5+'-'+_0x497971+'/'+_0x171303)[_0x989a('0x31')](_0x5ef753);}return null;};}function patchUpdates(_0x2b1a0b){return function(_0x1a2990){try{jsonpatch[_0x989a('0x32')](_0x1a2990,_0x2b1a0b,!![]);}catch(_0x54d38f){return BPromise[_0x989a('0x33')](_0x54d38f);}return _0x1a2990['save']();};}function saveUpdates(_0x4e4377,_0x5e6b74){return function(_0x2707b2){if(_0x2707b2){return _0x2707b2[_0x989a('0x34')](_0x4e4377)[_0x989a('0x20')](function(_0x5c8c30){return _0x5c8c30;});}return null;};}function removeEntity(_0xe04ea4,_0xdeea1f){return function(_0xe8fdc5){if(_0xe8fdc5){return _0xe8fdc5['destroy']()[_0x989a('0x20')](function(){var _0x2992b7=_0xe8fdc5[_0x989a('0x35')]({'plain':!![]});var _0x284ef6='OpenchannelAccounts';return db[_0x989a('0x36')][_0x989a('0x37')]({'where':{'type':_0x284ef6,'resourceId':_0x2992b7['id']}})[_0x989a('0x20')](function(){return _0xe8fdc5;});})['then'](function(){_0xe04ea4[_0x989a('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d506f,_0x4b3ecc){return function(_0x72d542){if(!_0x72d542){_0x1d506f[_0x989a('0x38')](0x194);}return _0x72d542;};}function handleError(_0x4b390c,_0x331a20){_0x331a20=_0x331a20||0x1f4;return function(_0x593c76){logger[_0x989a('0x26')](_0x593c76[_0x989a('0x39')]);if(_0x593c76[_0x989a('0x3a')]){delete _0x593c76[_0x989a('0x3a')];}_0x4b390c[_0x989a('0x2a')](_0x331a20)[_0x989a('0x3b')](_0x593c76);};}exports[_0x989a('0x3c')]=function(_0x2da33e,_0x32e15d){var _0x159b1d={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x44aef5={},_0x22463f={'count':0x0,'rows':[]};var _0x47a275=_[_0x989a('0x3d')](db[_0x989a('0x3e')][_0x989a('0x3f')],function(_0x130214){return{'name':_0x130214[_0x989a('0x40')],'type':_0x130214[_0x989a('0x41')]['key']};});_0x44aef5[_0x989a('0x42')]=_[_0x989a('0x3d')](_0x47a275,_0x989a('0x3a'));_0x44aef5['query']=_[_0x989a('0x43')](_0x2da33e[_0x989a('0x44')]);_0x44aef5['filters']=_[_0x989a('0x45')](_0x44aef5[_0x989a('0x42')],_0x44aef5[_0x989a('0x44')]);_0x159b1d[_0x989a('0x46')]=_['intersection'](_0x44aef5['model'],qs[_0x989a('0x47')](_0x2da33e[_0x989a('0x44')]['fields']));_0x159b1d[_0x989a('0x46')]=_0x159b1d[_0x989a('0x46')][_0x989a('0x48')]?_0x159b1d[_0x989a('0x46')]:_0x44aef5[_0x989a('0x42')];if(!_0x2da33e[_0x989a('0x44')][_0x989a('0x49')](_0x989a('0x4a'))){_0x159b1d['limit']=qs[_0x989a('0x2e')](_0x2da33e[_0x989a('0x44')][_0x989a('0x2e')]);_0x159b1d[_0x989a('0x2b')]=qs[_0x989a('0x2b')](_0x2da33e[_0x989a('0x44')]['offset']);}_0x159b1d[_0x989a('0x4b')]=qs[_0x989a('0x4c')](_0x2da33e['query'][_0x989a('0x4c')]);_0x159b1d[_0x989a('0x4d')]=qs['filters'](_[_0x989a('0x4e')](_0x2da33e[_0x989a('0x44')],_0x44aef5[_0x989a('0x4f')]),_0x47a275);if(_0x2da33e[_0x989a('0x44')][_0x989a('0x50')]){_0x159b1d['where']=_[_0x989a('0x51')](_0x159b1d[_0x989a('0x4d')],{'$or':_[_0x989a('0x3d')](_0x47a275,function(_0x16120f){if(_0x16120f[_0x989a('0x41')]!==_0x989a('0x52')){var _0x46a476={};_0x46a476[_0x16120f[_0x989a('0x3a')]]={'$like':'%'+_0x2da33e[_0x989a('0x44')]['filter']+'%'};return _0x46a476;}})});}_0x159b1d=_[_0x989a('0x51')]({},_0x159b1d,_0x2da33e['options']);var _0x58162b={'where':_0x159b1d[_0x989a('0x4d')]};return db['OpenchannelAccount']['count'](_0x58162b)[_0x989a('0x20')](function(_0x2e6bc9){_0x22463f['count']=_0x2e6bc9;if(_0x2da33e[_0x989a('0x44')][_0x989a('0x53')]){_0x159b1d[_0x989a('0x54')]=[{'all':!![]}];}return db[_0x989a('0x3e')]['findAll'](_0x159b1d);})[_0x989a('0x20')](function(_0x4c3f97){_0x22463f[_0x989a('0x55')]=_0x4c3f97;return _0x22463f;})[_0x989a('0x20')](respondWithFilteredResult(_0x32e15d,_0x159b1d))[_0x989a('0x29')](handleError(_0x32e15d,null));};exports[_0x989a('0x56')]=function(_0x64593c,_0x30405a){var _0x49e70f={'raw':![],'where':{'id':_0x64593c[_0x989a('0x57')]['id']},'include':[{'model':db[_0x989a('0x58')],'as':_0x989a('0x59')}]},_0x4284b4={};_0x4284b4['model']=_['keys'](db[_0x989a('0x3e')][_0x989a('0x3f')]);_0x4284b4[_0x989a('0x44')]=_[_0x989a('0x43')](_0x64593c[_0x989a('0x44')]);_0x4284b4[_0x989a('0x4f')]=_['intersection'](_0x4284b4[_0x989a('0x42')],_0x4284b4[_0x989a('0x44')]);_0x49e70f['attributes']=_[_0x989a('0x45')](_0x4284b4[_0x989a('0x42')],qs[_0x989a('0x47')](_0x64593c[_0x989a('0x44')][_0x989a('0x47')]));_0x49e70f[_0x989a('0x46')]=_0x49e70f[_0x989a('0x46')][_0x989a('0x48')]?_0x49e70f[_0x989a('0x46')]:_0x4284b4['model'];if(_0x64593c[_0x989a('0x44')]['includeAll']){_0x49e70f[_0x989a('0x54')]=[{'all':!![]}];}_0x49e70f=_[_0x989a('0x51')]({},_0x49e70f,_0x64593c[_0x989a('0x5a')]);return db['OpenchannelAccount'][_0x989a('0x5b')](_0x49e70f)['then'](handleEntityNotFound(_0x30405a,null))[_0x989a('0x20')](respondWithResult(_0x30405a,null))[_0x989a('0x29')](handleError(_0x30405a,null));};exports['create']=function(_0x7685f1,_0x37ae01){return db['OpenchannelAccount']['create'](_0x7685f1[_0x989a('0x5c')],{})[_0x989a('0x20')](function(_0x2f2042){var _0x1903a6=_0x7685f1[_0x989a('0x5d')]['get']({'plain':!![]});if(!_0x1903a6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1903a6[_0x989a('0x5e')]===_0x989a('0x5d')){var _0xc267e2=_0x2f2042[_0x989a('0x35')]({'plain':!![]});var _0x59ac9c=_0x989a('0x5f');return db[_0x989a('0x60')][_0x989a('0x5b')]({'where':{'name':_0x59ac9c,'userProfileId':_0x1903a6[_0x989a('0x61')]},'raw':!![]})[_0x989a('0x20')](function(_0x199298){if(_0x199298&&_0x199298['autoAssociation']===0x0){return db['UserProfileResource'][_0x989a('0x62')]({'name':_0xc267e2[_0x989a('0x3a')],'resourceId':_0xc267e2['id'],'type':_0x199298[_0x989a('0x3a')],'sectionId':_0x199298['id']},{})[_0x989a('0x20')](function(){return _0x2f2042;});}else{return _0x2f2042;}})[_0x989a('0x29')](function(_0x49bcea){logger[_0x989a('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49bcea);throw _0x49bcea;});}return _0x2f2042;})[_0x989a('0x20')](respondWithResult(_0x37ae01,0xc9))[_0x989a('0x29')](handleError(_0x37ae01,null));};exports['update']=function(_0x8c14c0,_0x39d7e1){if(_0x8c14c0[_0x989a('0x5c')]['id']){delete _0x8c14c0['body']['id'];}return db[_0x989a('0x3e')][_0x989a('0x5b')]({'where':{'id':_0x8c14c0[_0x989a('0x57')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x989a('0x20')](handleEntityNotFound(_0x39d7e1,null))[_0x989a('0x20')](saveUpdates(_0x8c14c0[_0x989a('0x5c')],null))[_0x989a('0x20')](respondWithResult(_0x39d7e1,null))[_0x989a('0x29')](handleError(_0x39d7e1,null));};exports[_0x989a('0x37')]=function(_0x6fb6a8,_0x4d3fd5){return db[_0x989a('0x3e')][_0x989a('0x5b')]({'where':{'id':_0x6fb6a8[_0x989a('0x57')]['id']}})[_0x989a('0x20')](handleEntityNotFound(_0x4d3fd5,null))['then'](removeEntity(_0x4d3fd5,null))['catch'](handleError(_0x4d3fd5,null));};exports[_0x989a('0x63')]=function(_0x1e7363,_0x4d1e49){return db[_0x989a('0x3e')]['describe']()['then'](respondWithResult(_0x4d1e49,null))[_0x989a('0x29')](handleError(_0x4d1e49,null));};exports[_0x989a('0x64')]=function(_0x20abd1,_0x189ca3,_0x21ce79){if(_0x20abd1[_0x989a('0x5c')]['id']){delete _0x20abd1[_0x989a('0x5c')]['id'];}return db[_0x989a('0x3e')]['find']({'where':{'id':_0x20abd1[_0x989a('0x57')]['id']}})[_0x989a('0x20')](handleEntityNotFound(_0x189ca3,null))[_0x989a('0x20')](function(_0x28cc43){if(_0x28cc43){_0x20abd1['body'][_0x989a('0x65')]=_0x28cc43['id'];return db[_0x989a('0x66')][_0x989a('0x62')](_0x20abd1[_0x989a('0x5c')]);}})['then'](respondWithResult(_0x189ca3,null))[_0x989a('0x29')](handleError(_0x189ca3,null));};exports[_0x989a('0x67')]=function(_0x562959,_0xabd612,_0x4f6e93){var _0x554c9d={'raw':![],'where':{}};var _0x36bddf={};var _0x5f4384={'count':0x0,'rows':[]};return db[_0x989a('0x3e')][_0x989a('0x68')]({'where':{'id':_0x562959[_0x989a('0x57')]['id']}})[_0x989a('0x20')](handleEntityNotFound(_0xabd612,null))[_0x989a('0x20')](function(_0x466986){if(_0x466986){_0x36bddf[_0x989a('0x42')]=_[_0x989a('0x43')](db[_0x989a('0x66')][_0x989a('0x3f')]);_0x36bddf[_0x989a('0x44')]=_['keys'](_0x562959[_0x989a('0x44')]);_0x36bddf[_0x989a('0x4f')]=_[_0x989a('0x45')](_0x36bddf[_0x989a('0x42')],_0x36bddf[_0x989a('0x44')]);_0x554c9d['attributes']=_[_0x989a('0x45')](_0x36bddf['model'],qs[_0x989a('0x47')](_0x562959[_0x989a('0x44')][_0x989a('0x47')]));_0x554c9d[_0x989a('0x46')]=_0x554c9d[_0x989a('0x46')]['length']?_0x554c9d[_0x989a('0x46')]:_0x36bddf[_0x989a('0x42')];if(!_0x562959[_0x989a('0x44')]['hasOwnProperty'](_0x989a('0x4a'))){_0x554c9d[_0x989a('0x2e')]=qs['limit'](_0x562959[_0x989a('0x44')][_0x989a('0x2e')]);_0x554c9d['offset']=qs[_0x989a('0x2b')](_0x562959['query'][_0x989a('0x2b')]);}_0x554c9d[_0x989a('0x4b')]=qs[_0x989a('0x4c')](_0x562959['query'][_0x989a('0x4c')]);_0x554c9d['where']=qs[_0x989a('0x4f')](_[_0x989a('0x4e')](_0x562959['query'],_0x36bddf[_0x989a('0x4f')]));_0x554c9d[_0x989a('0x4d')][_0x989a('0x65')]=_0x466986['id'];if(_0x562959[_0x989a('0x44')]['filter']){_0x554c9d[_0x989a('0x4d')]=_[_0x989a('0x51')](_0x554c9d[_0x989a('0x4d')],{'$or':_[_0x989a('0x3d')](_0x554c9d[_0x989a('0x46')],function(_0x48aceb){var _0xdbb33f={};_0xdbb33f[_0x48aceb]={'$like':'%'+_0x562959[_0x989a('0x44')][_0x989a('0x50')]+'%'};return _0xdbb33f;})});}_0x554c9d=_['merge']({},_0x554c9d,_0x562959[_0x989a('0x5a')]);return db['Disposition']['count']({'where':_0x554c9d[_0x989a('0x4d')]})[_0x989a('0x20')](function(_0x25fec1){_0x5f4384[_0x989a('0x2d')]=_0x25fec1;if(_0x562959[_0x989a('0x44')][_0x989a('0x53')]){_0x554c9d['include']=[{'all':!![]}];}return db['Disposition'][_0x989a('0x69')](_0x554c9d);})[_0x989a('0x20')](function(_0x59f38b){_0x5f4384[_0x989a('0x55')]=_0x59f38b;return _0x5f4384;});}})[_0x989a('0x20')](respondWithFilteredResult(_0xabd612,_0x554c9d))[_0x989a('0x29')](handleError(_0xabd612,null));};exports[_0x989a('0x6a')]=function(_0x2b176c,_0x4d7cea,_0x45328e){return db[_0x989a('0x3e')][_0x989a('0x5b')]({'where':{'id':_0x2b176c[_0x989a('0x57')]['id']}})[_0x989a('0x20')](handleEntityNotFound(_0x4d7cea,null))[_0x989a('0x20')](function(_0x31ccf8){if(_0x31ccf8){return _0x31ccf8[_0x989a('0x6a')](_0x2b176c['query'][_0x989a('0x6b')]);}})['then'](respondWithStatusCode(_0x4d7cea,null))[_0x989a('0x29')](handleError(_0x4d7cea,null));};exports['addAnswer']=function(_0x7cc7fe,_0x28979e,_0x1c182d){if(_0x7cc7fe['body']['id']){delete _0x7cc7fe[_0x989a('0x5c')]['id'];}return db['OpenchannelAccount'][_0x989a('0x5b')]({'where':{'id':_0x7cc7fe['params']['id']}})[_0x989a('0x20')](handleEntityNotFound(_0x28979e,null))['then'](function(_0x33aa66){if(_0x33aa66){_0x7cc7fe['body'][_0x989a('0x65')]=_0x33aa66['id'];return db[_0x989a('0x6c')][_0x989a('0x62')](_0x7cc7fe[_0x989a('0x5c')]);}})[_0x989a('0x20')](respondWithResult(_0x28979e,null))[_0x989a('0x29')](handleError(_0x28979e,null));};exports[_0x989a('0x6d')]=function(_0x3a84c7,_0x557afb,_0x209f90){var _0x5b77df={'raw':![],'where':{}};var _0x22372b={};var _0x56bddf={'count':0x0,'rows':[]};return db[_0x989a('0x3e')]['findOne']({'where':{'id':_0x3a84c7['params']['id']}})[_0x989a('0x20')](handleEntityNotFound(_0x557afb,null))[_0x989a('0x20')](function(_0x3c5017){if(_0x3c5017){_0x22372b[_0x989a('0x42')]=_[_0x989a('0x43')](db[_0x989a('0x6c')][_0x989a('0x3f')]);_0x22372b[_0x989a('0x44')]=_[_0x989a('0x43')](_0x3a84c7['query']);_0x22372b['filters']=_[_0x989a('0x45')](_0x22372b['model'],_0x22372b[_0x989a('0x44')]);_0x5b77df['attributes']=_[_0x989a('0x45')](_0x22372b['model'],qs['fields'](_0x3a84c7[_0x989a('0x44')][_0x989a('0x47')]));_0x5b77df[_0x989a('0x46')]=_0x5b77df['attributes'][_0x989a('0x48')]?_0x5b77df['attributes']:_0x22372b['model'];if(!_0x3a84c7[_0x989a('0x44')]['hasOwnProperty'](_0x989a('0x4a'))){_0x5b77df[_0x989a('0x2e')]=qs['limit'](_0x3a84c7[_0x989a('0x44')][_0x989a('0x2e')]);_0x5b77df['offset']=qs['offset'](_0x3a84c7[_0x989a('0x44')][_0x989a('0x2b')]);}_0x5b77df[_0x989a('0x4b')]=qs[_0x989a('0x4c')](_0x3a84c7[_0x989a('0x44')][_0x989a('0x4c')]);_0x5b77df['where']=qs[_0x989a('0x4f')](_['pick'](_0x3a84c7[_0x989a('0x44')],_0x22372b['filters']));_0x5b77df['where'][_0x989a('0x65')]=_0x3c5017['id'];if(_0x3a84c7[_0x989a('0x44')][_0x989a('0x50')]){_0x5b77df[_0x989a('0x4d')]=_['merge'](_0x5b77df[_0x989a('0x4d')],{'$or':_[_0x989a('0x3d')](_0x5b77df[_0x989a('0x46')],function(_0xf0a952){var _0x491b3f={};_0x491b3f[_0xf0a952]={'$like':'%'+_0x3a84c7[_0x989a('0x44')][_0x989a('0x50')]+'%'};return _0x491b3f;})});}_0x5b77df=_[_0x989a('0x51')]({},_0x5b77df,_0x3a84c7[_0x989a('0x5a')]);return db[_0x989a('0x6c')]['count']({'where':_0x5b77df[_0x989a('0x4d')]})[_0x989a('0x20')](function(_0x4e4ac4){_0x56bddf[_0x989a('0x2d')]=_0x4e4ac4;if(_0x3a84c7[_0x989a('0x44')][_0x989a('0x53')]){_0x5b77df[_0x989a('0x54')]=[{'all':!![]}];}return db[_0x989a('0x6c')][_0x989a('0x69')](_0x5b77df);})[_0x989a('0x20')](function(_0x3be4e7){_0x56bddf['rows']=_0x3be4e7;return _0x56bddf;});}})['then'](respondWithFilteredResult(_0x557afb,_0x5b77df))['catch'](handleError(_0x557afb,null));};exports['removeAnswers']=function(_0x1d302e,_0x5f4354,_0x2b263b){return db[_0x989a('0x3e')][_0x989a('0x5b')]({'where':{'id':_0x1d302e[_0x989a('0x57')]['id']}})[_0x989a('0x20')](handleEntityNotFound(_0x5f4354,null))[_0x989a('0x20')](function(_0x1aa61c){if(_0x1aa61c){return _0x1aa61c[_0x989a('0x6e')](_0x1d302e['query']['ids']);}})[_0x989a('0x20')](respondWithStatusCode(_0x5f4354,null))[_0x989a('0x29')](handleError(_0x5f4354,null));};exports[_0x989a('0x6f')]=function(_0x26c07f,_0x242e56,_0x22b032){var _0x45f125={'body':_0x26c07f[_0x989a('0x5c')],'channel':'openchannel'};var _0x4afc25=[];var _0x50366b=[];var _0x4cd203={};var _0x23c5d0=![];return db[_0x989a('0x70')][_0x989a('0x63')]()[_0x989a('0x20')](function(_0x3f88e7){if(!_0x3f88e7){throw new db[(_0x989a('0x71'))][(_0x989a('0x72'))]('no\x20available\x20attributes');}_0x4afc25=_[_0x989a('0x73')](_[_0x989a('0x43')](_0x3f88e7),[_0x989a('0x74'),_0x989a('0x75')]);_0x50366b=_['difference'](_[_0x989a('0x43')](_0x3f88e7),[_0x989a('0x74'),_0x989a('0x75'),'CompanyId',_0x989a('0x76')]);if(_0x26c07f['body']['id']){delete _0x26c07f[_0x989a('0x5c')]['id'];}if(_[_0x989a('0x77')](_0x26c07f['body'][_0x989a('0x78')])){throw new db[(_0x989a('0x71'))][(_0x989a('0x72'))](_0x989a('0x79'));}if(_[_0x989a('0x77')](_0x26c07f[_0x989a('0x5c')][_0x989a('0x5c')])||_0x26c07f[_0x989a('0x5c')]['body']===''){throw new db['Sequelize'][(_0x989a('0x72'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x989a('0x77')](_0x26c07f[_0x989a('0x5c')]['mapKey'])){throw new db[(_0x989a('0x71'))][(_0x989a('0x72'))](_0x989a('0x7a')+_0x50366b);}if(!_[_0x989a('0x7b')](_0x50366b,_0x26c07f[_0x989a('0x5c')]['mapKey'])){throw new db['Sequelize'][(_0x989a('0x72'))](_0x989a('0x7c')+_0x50366b);}_0x4cd203[_0x26c07f[_0x989a('0x5c')]['mapKey']]=_0x26c07f[_0x989a('0x5c')][_0x989a('0x78')];})[_0x989a('0x20')](function(){return db['OpenchannelAccount'][_0x989a('0x5b')]({'where':{'id':_0x26c07f['params']['id']},'include':[{'model':db[_0x989a('0x7d')],'as':_0x989a('0x7e'),'include':[{'model':db[_0x989a('0x70')],'as':_0x989a('0x7f'),'where':_0x4cd203,'limit':0x1,'order':[[_0x989a('0x75'),_0x989a('0x80')]]}]},{'model':db[_0x989a('0x81')],'as':_0x989a('0x82')}]});})[_0x989a('0x20')](handleEntityNotFound(_0x242e56,null))[_0x989a('0x20')](function(_0x32b10f){if(_0x32b10f&&_0x32b10f['List']){_0x45f125[_0x989a('0x83')]=_0x32b10f;_0x45f125[_0x989a('0x84')]=_0x32b10f[_0x989a('0x82')];_0x45f125[_0x989a('0x85')]=_0x32b10f[_0x989a('0x7e')];_0x45f125['applications']=_[_0x989a('0x86')](_0x45f125[_0x989a('0x84')],[_0x989a('0x87')],[_0x989a('0x88')]);if(_0x45f125[_0x989a('0x83')][_0x989a('0x82')]){delete _0x45f125[_0x989a('0x83')][_0x989a('0x82')];}if(_0x45f125['account'][_0x989a('0x7e')]&&_0x45f125['account']['List'][_0x989a('0x7f')][_0x989a('0x48')]){return _0x45f125[_0x989a('0x83')][_0x989a('0x7e')][_0x989a('0x7f')][0x0];}var _0x1ce146=_[_0x989a('0x1b')](_0x26c07f[_0x989a('0x5c')],{'firstName':_0x26c07f['body']['from'],'ListId':_0x32b10f[_0x989a('0x76')]});_0x1ce146[_0x26c07f[_0x989a('0x5c')][_0x989a('0x89')]]=_0x26c07f[_0x989a('0x5c')][_0x989a('0x78')];return db[_0x989a('0x70')][_0x989a('0x62')](_0x1ce146,{'fields':_0x4afc25,'raw':!![]});}})[_0x989a('0x20')](handleEntityNotFound(_0x242e56,null))[_0x989a('0x20')](function(_0x414c3c){_0x45f125['contact']=_0x414c3c;if(_0x414c3c){var _0x43f151={'ContactId':_0x414c3c['id'],'OpenchannelAccountId':_0x26c07f[_0x989a('0x57')]['id'],'from':(_0x414c3c[_0x989a('0x8a')]||'')+'\x20'+(_0x414c3c['lastName']||'')};var _0x301a95={'OpenchannelAccountId':_0x26c07f[_0x989a('0x57')]['id'],'closed':![]};if(_0x26c07f[_0x989a('0x5c')][_0x989a('0x8b')]){_0x301a95[_0x989a('0x8b')]=_0x26c07f['body'][_0x989a('0x8b')];return db[_0x989a('0x8c')][_0x989a('0x5b')]({'where':_0x301a95})['then'](function(_0x4f6055){if(_0x4f6055){return[_0x4f6055,![]];}_0x43f151[_0x989a('0x8b')]=_0x26c07f[_0x989a('0x5c')][_0x989a('0x8b')];_0x43f151[_0x989a('0x8d')]=_0x26c07f[_0x989a('0x5c')][_0x989a('0x8d')];return db[_0x989a('0x8c')][_0x989a('0x62')](_0x43f151)['then'](function(_0x331969){return[_0x331969,!![]];});});}else{_0x301a95[_0x989a('0x8b')]=null;}_0x301a95[_0x989a('0x8e')]=_0x414c3c['id'];return db[_0x989a('0x8c')]['find']({'where':_0x301a95})[_0x989a('0x20')](function(_0x45c571){if(_0x45c571){return[_0x45c571,![]];}return db[_0x989a('0x8c')]['create'](_0x43f151)[_0x989a('0x20')](function(_0x33e892){return[_0x33e892,!![]];});});}})[_0x989a('0x8f')](function(_0x17574c,_0x3d1b79){if(_0x17574c){_0x23c5d0=_0x3d1b79;if(!_0x3d1b79){var _0xc74abf={'from':(_0x45f125['contact'][_0x989a('0x8a')]||'')+'\x20'+(_0x45f125[_0x989a('0x90')]['lastName']||'')};if(_0x26c07f[_0x989a('0x5c')][_0x989a('0x8b')]&&_0x26c07f[_0x989a('0x5c')][_0x989a('0x91')]&&_0x26c07f[_0x989a('0x5c')][_0x989a('0x8b')]!=_0x26c07f[_0x989a('0x5c')][_0x989a('0x91')]){_0xc74abf[_0x989a('0x8b')]=_0x26c07f['body']['messageId'];}return _0x17574c[_0x989a('0x34')](_0xc74abf);}else{return _0x17574c;}}})[_0x989a('0x20')](function(_0x2ed394){_0x45f125['interaction']=_0x2ed394['get']({'plain':!![]});_0x45f125['interaction'][_0x989a('0x92')]=_0x23c5d0;if(_0x45f125[_0x989a('0x93')]['created']){if(_0x45f125[_0x989a('0x83')][_0x989a('0x94')]){_0x45f125[_0x989a('0x84')][_0x989a('0x95')]({'id':0x0,'priority':_0x45f125[_0x989a('0x84')][_0x989a('0x48')]+0x1,'app':_0x989a('0x96'),'appdata':_0x989a('0x97'),'interval':'*,*,*,*'});}}return db[_0x989a('0x98')]['create']({'body':_0x26c07f[_0x989a('0x5c')][_0x989a('0x5c')],'OpenchannelAccountId':_0x26c07f[_0x989a('0x57')]['id'],'OpenchannelInteractionId':_0x2ed394['id'],'direction':'in','ContactId':_0x45f125['contact']['id'],'AttachmentId':_0x26c07f[_0x989a('0x5c')][_0x989a('0x99')]});})['then'](function(_0x1710b8){_0x45f125[_0x989a('0x28')]=_0x1710b8;if(_0x45f125[_0x989a('0x93')][_0x989a('0x9a')]){return db['User']['find']({'attributes':['id',_0x989a('0x3a')],'where':{'id':_0x45f125[_0x989a('0x93')][_0x989a('0x9a')]}})[_0x989a('0x20')](function(_0x432088){if(_0x432088){_0x45f125[_0x989a('0x84')][_0x989a('0x9b')]({'id':0x0,'priority':0x0,'app':_0x989a('0x9c'),'appdata':_0x432088[_0x989a('0x3a')]+','+(_0x45f125[_0x989a('0x83')][_0x989a('0x9d')]||0xa),'interval':'*,*,*,*'});_0x45f125[_0x989a('0x9e')]=![];}return respondWithRpcPromise(_0x989a('0x9f'),_0x989a('0xa0'),_0x45f125);});}return respondWithRpcPromise(_0x989a('0x9f'),_0x989a('0xa0'),_0x45f125);})[_0x989a('0x20')](function(_0x3878f4){respondWithRpcPromise(_0x989a('0xa1'),'EventManager',{'event':_0x989a('0x6f'),'message':_0x3878f4},client9002);return _0x3878f4;})[_0x989a('0x20')](respondWithResult(_0x242e56,null))['catch'](handleError(_0x242e56,null));};exports[_0x989a('0xa2')]=function(_0x473495,_0x2f280d){var _0x1b1486=_0x473495['params']['id'];var _0x4f2c77=_0x473495[_0x989a('0x5c')];var _0x5b9b23=0xc8;var _0xa35e3=null;return db[_0x989a('0xa3')][_0x989a('0xa4')]({'isolationLevel':db[_0x989a('0xa3')][_0x989a('0xa5')][_0x989a('0xa6')][_0x989a('0xa7')]},function(_0x28795f){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x1b1486},'transaction':_0x28795f})[_0x989a('0x20')](function(_0x52ed84){if(_0x52ed84){return db[_0x989a('0x81')][_0x989a('0x37')]({'where':{'OpenchannelAccountId':_0x1b1486},'transaction':_0x28795f})[_0x989a('0x20')](function(){var _0x884e07=_['map'](_0x4f2c77,function(_0x5c0c96){_0x5c0c96[_0x989a('0x65')]=_0x1b1486;return _0x5c0c96;});return db[_0x989a('0x81')][_0x989a('0xa8')](_0x884e07,{'transaction':_0x28795f});});}else{_0x5b9b23=0x194;_0xa35e3=[];}});})[_0x989a('0x20')](function(){if(_0x5b9b23!==0x194){return db[_0x989a('0x81')][_0x989a('0xa9')]({'where':{'OpenchannelAccountId':_0x1b1486},'order':'priority'})[_0x989a('0x20')](function(_0x1c9033){_0xa35e3=_0x1c9033;});}})[_0x989a('0x29')](function(_0x3b70ed){_0x5b9b23=0x1f4;logger['error'](_0x3b70ed[_0x989a('0x39')]);if(_0x3b70ed[_0x989a('0x3a')]){delete _0x3b70ed[_0x989a('0x3a')];}_0xa35e3=_0x3b70ed;})['finally'](function(){if(_0xa35e3===null){_0x2f280d[_0x989a('0x38')](_0x5b9b23);}else{if(_0x5b9b23===0x1f4){_0x2f280d[_0x989a('0x2a')](_0x5b9b23)['send'](_0xa35e3);}else{_0x2f280d['status'](_0x5b9b23)[_0x989a('0x31')](_0xa35e3);}}});};exports[_0x989a('0xaa')]=function(_0x4c745e,_0x568ade,_0x3fd22d){var _0x465617={};var _0x5f1153={};var _0x3addb1;var _0x5589a1;return db[_0x989a('0x3e')]['findOne']({'where':{'id':_0x4c745e[_0x989a('0x57')]['id']}})[_0x989a('0x20')](handleEntityNotFound(_0x568ade,null))[_0x989a('0x20')](function(_0x27d6ce){if(_0x27d6ce){_0x3addb1=_0x27d6ce;_0x5f1153[_0x989a('0x42')]=_[_0x989a('0x43')](db[_0x989a('0x81')][_0x989a('0x3f')]);_0x5f1153[_0x989a('0x44')]=_['keys'](_0x4c745e['query']);_0x5f1153[_0x989a('0x4f')]=_[_0x989a('0x45')](_0x5f1153['model'],_0x5f1153[_0x989a('0x44')]);_0x465617['attributes']=_[_0x989a('0x45')](_0x5f1153[_0x989a('0x42')],qs[_0x989a('0x47')](_0x4c745e['query'][_0x989a('0x47')]));_0x465617['attributes']=_0x465617[_0x989a('0x46')][_0x989a('0x48')]?_0x465617[_0x989a('0x46')]:_0x5f1153[_0x989a('0x42')];_0x465617[_0x989a('0x4b')]=qs['sort'](_0x4c745e['query'][_0x989a('0x4c')]);_0x465617[_0x989a('0x4d')]=qs[_0x989a('0x4f')](_['pick'](_0x4c745e[_0x989a('0x44')],_0x5f1153[_0x989a('0x4f')]));if(_0x4c745e[_0x989a('0x44')][_0x989a('0x50')]){_0x465617[_0x989a('0x4d')]=_[_0x989a('0x51')](_0x465617['where'],{'$or':_[_0x989a('0x3d')](_0x465617[_0x989a('0x46')],function(_0x2fac32){var _0x143ab1={};_0x143ab1[_0x2fac32]={'$like':'%'+_0x4c745e[_0x989a('0x44')][_0x989a('0x50')]+'%'};return _0x143ab1;})});}_0x465617=_['merge']({},_0x465617,_0x4c745e[_0x989a('0x5a')]);return _0x3addb1[_0x989a('0xaa')](_0x465617);}})[_0x989a('0x20')](function(_0x33b390){if(_0x33b390){_0x5589a1=_0x33b390[_0x989a('0x48')];if(!_0x4c745e[_0x989a('0x44')]['hasOwnProperty']('nolimit')){_0x465617['limit']=qs[_0x989a('0x2e')](_0x4c745e['query']['limit']);_0x465617['offset']=qs[_0x989a('0x2b')](_0x4c745e[_0x989a('0x44')]['offset']);}return _0x3addb1[_0x989a('0xaa')](_0x465617);}})['then'](function(_0x595d83){if(_0x595d83){return _0x595d83?{'count':_0x5589a1,'rows':_0x595d83}:null;}})[_0x989a('0x20')](respondWithResult(_0x568ade,null))['catch'](handleError(_0x568ade,null));};exports[_0x989a('0xab')]=function(_0x184c28,_0x14ba13,_0x56a001){var _0x4acd63={'raw':![],'where':{}};var _0x54149d={};var _0x1ad882={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x989a('0x68')]({'where':{'id':_0x184c28[_0x989a('0x57')]['id']}})['then'](handleEntityNotFound(_0x14ba13,null))['then'](function(_0x44072b){if(_0x44072b){_0x54149d[_0x989a('0x42')]=_['keys'](db[_0x989a('0x8c')]['rawAttributes']);_0x54149d['query']=_[_0x989a('0x43')](_0x184c28['query']);_0x54149d[_0x989a('0x4f')]=_[_0x989a('0x45')](_0x54149d['model'],_0x54149d['query']);_0x4acd63[_0x989a('0x46')]=_[_0x989a('0x45')](_0x54149d[_0x989a('0x42')],qs['fields'](_0x184c28[_0x989a('0x44')][_0x989a('0x47')]));_0x4acd63[_0x989a('0x46')]=_0x4acd63['attributes'][_0x989a('0x48')]?_0x4acd63[_0x989a('0x46')]:_0x54149d[_0x989a('0x42')];if(!_0x184c28[_0x989a('0x44')][_0x989a('0x49')](_0x989a('0x4a'))){_0x4acd63[_0x989a('0x2e')]=qs[_0x989a('0x2e')](_0x184c28[_0x989a('0x44')]['limit']);_0x4acd63['offset']=qs[_0x989a('0x2b')](_0x184c28[_0x989a('0x44')]['offset']);}_0x4acd63[_0x989a('0x4b')]=qs[_0x989a('0x4c')](_0x184c28[_0x989a('0x44')][_0x989a('0x4c')]);_0x4acd63[_0x989a('0x4d')]=qs[_0x989a('0x4f')](_[_0x989a('0x4e')](_0x184c28[_0x989a('0x44')],_0x54149d[_0x989a('0x4f')]));_0x4acd63[_0x989a('0x4d')]['OpenchannelAccountId']=_0x44072b['id'];if(_0x184c28[_0x989a('0x44')][_0x989a('0x50')]){_0x4acd63[_0x989a('0x4d')]=_[_0x989a('0x51')](_0x4acd63[_0x989a('0x4d')],{'$or':_[_0x989a('0x3d')](_0x4acd63[_0x989a('0x46')],function(_0x1af737){var _0x47eaa0={};_0x47eaa0[_0x1af737]={'$like':'%'+_0x184c28[_0x989a('0x44')][_0x989a('0x50')]+'%'};return _0x47eaa0;})});}_0x4acd63=_[_0x989a('0x51')]({},_0x4acd63,_0x184c28[_0x989a('0x5a')]);return db[_0x989a('0x8c')][_0x989a('0x2d')]({'where':_0x4acd63[_0x989a('0x4d')]})[_0x989a('0x20')](function(_0x39c341){_0x1ad882['count']=_0x39c341;if(_0x184c28[_0x989a('0x44')][_0x989a('0x53')]){_0x4acd63['include']=[{'model':db[_0x989a('0x70')],'as':_0x989a('0xac'),'required':![]},{'model':db[_0x989a('0xad')],'as':_0x989a('0xae'),'attributes':['name',_0x989a('0xaf'),_0x989a('0xb0')],'required':![]},{'model':db[_0x989a('0xb1')],'as':_0x989a('0xb2'),'attributes':['id',_0x989a('0x3a'),_0x989a('0xb3')],'where':_0x184c28[_0x989a('0x44')][_0x989a('0xb4')]?{'id':_0x184c28[_0x989a('0x44')]['tag']}:undefined,'required':_0x184c28[_0x989a('0x44')][_0x989a('0xb4')]?!![]:![]}];}return db[_0x989a('0x8c')]['findAll'](_0x4acd63);})[_0x989a('0x20')](function(_0xbebb0d){_0x1ad882[_0x989a('0x55')]=_0xbebb0d;return _0x1ad882;});}})['then'](respondWithFilteredResult(_0x14ba13,_0x4acd63))[_0x989a('0x29')](handleError(_0x14ba13,null));};exports[_0x989a('0xb5')]=function(_0x1bb1e2,_0x15cdb8,_0xb54b9b){return db[_0x989a('0x3e')][_0x989a('0x5b')]({'where':{'id':_0x1bb1e2[_0x989a('0x57')]['id']}})[_0x989a('0x20')](handleEntityNotFound(_0x15cdb8,null))['then'](function(_0x453a72){if(_0x453a72){return _0x453a72[_0x989a('0xb5')](_0x1bb1e2['body'][_0x989a('0x6b')],_[_0x989a('0xb6')](_0x1bb1e2[_0x989a('0x5c')],[_0x989a('0x6b'),'id'])||{})['spread'](function(_0x47c830){for(var _0x32577c=0x0;_0x32577c<_0x1bb1e2[_0x989a('0x5c')][_0x989a('0x6b')][_0x989a('0x48')];_0x32577c+=0x1){socket[_0x989a('0xb7')]('userOpenchannelAccount:save',{'UserId':Number(_0x1bb1e2[_0x989a('0x5c')]['ids'][_0x32577c]),'OpenchannelAccountId':Number(_0x1bb1e2['params']['id'])});}return _0x47c830;});}})[_0x989a('0x20')](respondWithResult(_0x15cdb8,null))[_0x989a('0x29')](handleError(_0x15cdb8,null));};exports['removeAgents']=function(_0x2d73b9,_0x188423,_0x2a54fa){return db[_0x989a('0x3e')][_0x989a('0x5b')]({'where':{'id':_0x2d73b9['params']['id']}})[_0x989a('0x20')](handleEntityNotFound(_0x188423,null))['then'](function(_0x5af76a){if(_0x5af76a){return _0x5af76a[_0x989a('0xb8')](_0x2d73b9[_0x989a('0x44')][_0x989a('0x6b')])[_0x989a('0x20')](function(){if(_[_0x989a('0xb9')](_0x2d73b9['query'][_0x989a('0x6b')])){for(var _0x2d2c05=0x0;_0x2d2c05<_0x2d73b9[_0x989a('0x44')]['ids'][_0x989a('0x48')];_0x2d2c05+=0x1){socket['emit'](_0x989a('0xba'),{'UserId':Number(_0x2d73b9[_0x989a('0x44')][_0x989a('0x6b')][_0x2d2c05]),'OpenchannelAccountId':Number(_0x2d73b9[_0x989a('0x57')]['id'])});}}else{socket[_0x989a('0xb7')]('userOpenchannelAccount:remove',{'UserId':Number(_0x2d73b9[_0x989a('0x44')][_0x989a('0x6b')]),'OpenchannelAccountId':Number(_0x2d73b9['params']['id'])});}});}})[_0x989a('0x20')](respondWithStatusCode(_0x188423,null))[_0x989a('0x29')](handleError(_0x188423,null));};exports[_0x989a('0xbb')]=function(_0x5ae0b3,_0xc4c01d,_0xbe98d){var _0x50f95c={};var _0x2ce773={};var _0x18d25f;var _0x3590ee;return db[_0x989a('0x3e')][_0x989a('0x68')]({'where':{'id':_0x5ae0b3['params']['id']}})[_0x989a('0x20')](handleEntityNotFound(_0xc4c01d,null))['then'](function(_0x55d032){if(_0x55d032){_0x18d25f=_0x55d032;_0x2ce773['model']=_[_0x989a('0x43')](db[_0x989a('0xad')]['rawAttributes']);_0x2ce773['query']=_[_0x989a('0x43')](_0x5ae0b3['query']);_0x2ce773[_0x989a('0x4f')]=_[_0x989a('0x45')](_0x2ce773[_0x989a('0x42')],_0x2ce773['query']);_0x50f95c[_0x989a('0x46')]=_['intersection'](_0x2ce773[_0x989a('0x42')],qs[_0x989a('0x47')](_0x5ae0b3[_0x989a('0x44')][_0x989a('0x47')]));_0x50f95c[_0x989a('0x46')]=_0x50f95c['attributes'][_0x989a('0x48')]?_0x50f95c['attributes']:_0x2ce773['model'];_0x50f95c[_0x989a('0x4b')]=qs['sort'](_0x5ae0b3[_0x989a('0x44')][_0x989a('0x4c')]);_0x50f95c[_0x989a('0x4d')]=qs[_0x989a('0x4f')](_[_0x989a('0x4e')](_0x5ae0b3['query'],_0x2ce773[_0x989a('0x4f')]));if(_0x5ae0b3[_0x989a('0x44')]['filter']){_0x50f95c[_0x989a('0x4d')]=_[_0x989a('0x51')](_0x50f95c[_0x989a('0x4d')],{'$or':_[_0x989a('0x3d')](_0x50f95c['attributes'],function(_0x4c7779){var _0x11e420={};_0x11e420[_0x4c7779]={'$like':'%'+_0x5ae0b3[_0x989a('0x44')][_0x989a('0x50')]+'%'};return _0x11e420;})});}_0x50f95c=_[_0x989a('0x51')]({},_0x50f95c,_0x5ae0b3[_0x989a('0x5a')]);return _0x18d25f[_0x989a('0xbb')](_0x50f95c);}})[_0x989a('0x20')](function(_0x1037d5){if(_0x1037d5){_0x3590ee=_0x1037d5[_0x989a('0x48')];if(!_0x5ae0b3[_0x989a('0x44')][_0x989a('0x49')](_0x989a('0x4a'))){_0x50f95c['limit']=qs[_0x989a('0x2e')](_0x5ae0b3[_0x989a('0x44')][_0x989a('0x2e')]);_0x50f95c['offset']=qs[_0x989a('0x2b')](_0x5ae0b3[_0x989a('0x44')][_0x989a('0x2b')]);}return _0x18d25f[_0x989a('0xbb')](_0x50f95c);}})['then'](function(_0x43e244){if(_0x43e244){return _0x43e244?{'count':_0x3590ee,'rows':_0x43e244}:null;}})['then'](respondWithResult(_0xc4c01d,null))['catch'](handleError(_0xc4c01d,null));};exports[_0x989a('0x3b')]=function(_0x5c8f89,_0x5bf51a,_0x235092){var _0x534a2e,_0x2d64eb,_0x4e6c0b;if(_['isNil'](_0x5c8f89[_0x989a('0x5c')][_0x989a('0x5c')])||_0x5c8f89['body'][_0x989a('0x5c')]===''){throw new db[(_0x989a('0x71'))][(_0x989a('0x72'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x989a('0x77')](_0x5c8f89[_0x989a('0x5c')]['to'])){}_0x534a2e=_0x5c8f89[_0x989a('0x5c')]['to'];return db[_0x989a('0x3e')]['findOne']({'where':{'id':_0x5c8f89[_0x989a('0x57')]['id']}})['then'](handleEntityNotFound(_0x5bf51a,null))[_0x989a('0x20')](function(_0xea5a9){if(_0xea5a9){return db[_0x989a('0x3e')][_0x989a('0x5b')]({'where':{'id':_0xea5a9['id']},'include':[{'model':db[_0x989a('0x7d')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{[_0xea5a9['mapKey']]:_0x534a2e},'limit':0x1,'order':[[_0x989a('0x75'),_0x989a('0x80')]]}]}]})[_0x989a('0x20')](handleEntityNotFound(_0x5bf51a,null))[_0x989a('0x20')](function(_0x4aba84){if(_0x4aba84&&_0x4aba84[_0x989a('0x7e')]){_0x2d64eb=_0x4aba84[_0x989a('0x35')]({'plain':!![]});if(_0x2d64eb[_0x989a('0x7e')]&&_0x2d64eb[_0x989a('0x7e')][_0x989a('0x7f')]['length']){return _0x2d64eb[_0x989a('0x7e')][_0x989a('0x7f')][0x0];}return db[_0x989a('0x70')]['create'](_[_0x989a('0x1b')](_0x5c8f89[_0x989a('0x5c')],{'firstName':_0x534a2e,[_0x4aba84[_0x989a('0x89')]]:_0x534a2e,'phone':_0x534a2e,'ListId':_0x2d64eb[_0x989a('0x76')]}));}})[_0x989a('0x20')](handleEntityNotFound(_0x5bf51a,null))[_0x989a('0x20')](function(_0x3da6a2){if(_0x3da6a2){_0x4e6c0b=_0x3da6a2;return db[_0x989a('0x8c')][_0x989a('0x5b')]({'where':{'ContactId':_0x4e6c0b['id'],'closed':![],'OpenchannelAccountId':_0x2d64eb['id']}})['then'](function(_0x325bd1){if(_0x325bd1){return[_0x325bd1,![]];}return db[_0x989a('0x8c')][_0x989a('0x62')]({'UserId':_0x5c8f89[_0x989a('0x5d')]['id'],'ContactId':_0x4e6c0b['id'],'OpenchannelAccountId':_0x2d64eb['id'],'lastMsgDirection':_0x989a('0xbc'),'Messages':[_[_0x989a('0x51')](_0x5c8f89[_0x989a('0x5c')],{'read':![],'body':_0x5c8f89['body'][_0x989a('0x5c')],'OpenchannelAccountId':_0x2d64eb['id'],'UserId':_0x5c8f89[_0x989a('0x5d')]['id'],'ContactId':_0x4e6c0b['id']})]},{'include':[{'model':db[_0x989a('0x98')],'as':_0x989a('0xbd')}]})[_0x989a('0x20')](function(_0x37fb24){return[_0x37fb24,!![]];});});}})[_0x989a('0x8f')](function(_0x3503e0,_0x13e4ad){if(_0x13e4ad){return _0x3503e0;}return db[_0x989a('0x98')][_0x989a('0x62')](_[_0x989a('0x51')](_0x5c8f89['body'],{'read':![],'body':_0x5c8f89[_0x989a('0x5c')][_0x989a('0x5c')],'OpenchannelAccountId':_0x2d64eb['id'],'OpenchannelInteractionId':_0x3503e0['id'],'UserId':_0x5c8f89['user']['id'],'ContactId':_0x4e6c0b['id']}))['then'](function(_0x590685){_0x3503e0[_0x989a('0xbe')][_0x989a('0xbd')]=[];_0x3503e0['dataValues']['Messages'][_0x989a('0x95')](_0x590685[_0x989a('0xbe')]);return _0x3503e0;});});}})[_0x989a('0x20')](respondWithResult(_0x5bf51a,null))[_0x989a('0x29')](handleError(_0x5bf51a,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 72d9d83..78c5dd3 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 _0x3c81=['hook','exports','events','../../mysqldb','setMaxListeners','save','emit','hasOwnProperty'];(function(_0xd58823,_0x15c483){var _0x249c0a=function(_0x4b8b67){while(--_0x4b8b67){_0xd58823['push'](_0xd58823['shift']());}};_0x249c0a(++_0x15c483);}(_0x3c81,0x102));var _0x13c8=function(_0x240a83,_0xa8f76d){_0x240a83=_0x240a83-0x0;var _0x3a65e8=_0x3c81[_0x240a83];return _0x3a65e8;};'use strict';var EventEmitter=require(_0x13c8('0x0'));var OpenchannelAccount=require(_0x13c8('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x13c8('0x2')](0x0);var events={'afterCreate':_0x13c8('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5c3ba4){return function(_0x548599,_0x101d4f,_0x3ec886){OpenchannelAccountEvents[_0x13c8('0x4')](_0x5c3ba4+':'+_0x548599['id'],_0x548599);OpenchannelAccountEvents[_0x13c8('0x4')](_0x5c3ba4,_0x548599);_0x3ec886(null);};}for(var e in events){if(events[_0x13c8('0x5')](e)){var event=events[e];OpenchannelAccount[_0x13c8('0x6')](e,emitEvent(event));}}module[_0x13c8('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xa75b=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x508961,_0x3adcfb){var _0x57c034=function(_0x52098f){while(--_0x52098f){_0x508961['push'](_0x508961['shift']());}};_0x57c034(++_0x3adcfb);}(_0xa75b,0x170));var _0xba75=function(_0x266544,_0x2561d9){_0x266544=_0x266544-0x0;var _0x54f4c1=_0xa75b[_0x266544];return _0x54f4c1;};'use strict';var EventEmitter=require(_0xba75('0x0'));var OpenchannelAccount=require('../../mysqldb')['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xba75('0x1')](0x0);var events={'afterCreate':_0xba75('0x2'),'afterUpdate':_0xba75('0x3'),'afterDestroy':_0xba75('0x4')};function emitEvent(_0x1760c0){return function(_0x336606,_0x152269,_0x398bd5){OpenchannelAccountEvents[_0xba75('0x5')](_0x1760c0+':'+_0x336606['id'],_0x336606);OpenchannelAccountEvents[_0xba75('0x5')](_0x1760c0,_0x336606);_0x398bd5(null);};}for(var e in events){if(events[_0xba75('0x6')](e)){var event=events[e];OpenchannelAccount[_0xba75('0x7')](e,emitEvent(event));}}module[_0xba75('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 5a3b00f..ef2ab0d 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(_0xe6b9bf,_0x34445b){var _0x3c6f85=function(_0x189847){while(--_0x189847){_0xe6b9bf['push'](_0xe6b9bf['shift']());}};_0x3c6f85(++_0x34445b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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(_0x5e18ac,_0x497ab6){var _0x1df6d7=function(_0x2afedd){while(--_0x2afedd){_0x5e18ac['push'](_0x5e18ac['shift']());}};_0x1df6d7(++_0x497ab6);}(_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 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 efa9e1d..35e1b12 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 _0x1d2d=['localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x162224,_0x138f58){var _0x4e449d=function(_0x42e7d2){while(--_0x42e7d2){_0x162224['push'](_0x162224['shift']());}};_0x4e449d(++_0x138f58);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x3a6016,_0x21cf8d){_0x3a6016=_0x3a6016-0x0;var _0x2f3c25=_0x1d2d[_0x3a6016];return _0x2f3c25;};'use strict';var _=require(_0xd1d2('0x0'));var util=require(_0xd1d2('0x1'));var moment=require(_0xd1d2('0x2'));var BPromise=require(_0xd1d2('0x3'));var rs=require(_0xd1d2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd1d2('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd1d2('0x6'));var config=require(_0xd1d2('0x7'));var jayson=require(_0xd1d2('0x8'));var client=jayson[_0xd1d2('0x9')][_0xd1d2('0xa')]({'port':0x232a});config[_0xd1d2('0xb')]=_['defaults'](config[_0xd1d2('0xb')],{'host':_0xd1d2('0xc'),'port':0x18eb});var socket=require(_0xd1d2('0xd'))(new Redis(config[_0xd1d2('0xb')]));require(_0xd1d2('0xe'))[_0xd1d2('0xf')](socket);function respondWithRpcPromise(_0x1dc683,_0x1a6ca4,_0x3ac8c4){return new BPromise(function(_0x353f9b,_0x900ec){return client[_0xd1d2('0x10')](_0x1dc683,_0x3ac8c4)[_0xd1d2('0x11')](function(_0x5b21f4){logger[_0xd1d2('0x12')](_0xd1d2('0x13'),_0x1a6ca4,_0xd1d2('0x14'));logger[_0xd1d2('0x15')](_0xd1d2('0x16'),_0x1a6ca4,_0xd1d2('0x14'),JSON[_0xd1d2('0x17')](_0x5b21f4));if(_0x5b21f4[_0xd1d2('0x18')]){if(_0x5b21f4[_0xd1d2('0x18')][_0xd1d2('0x19')]===0x1f4){logger['error'](_0xd1d2('0x13'),_0x1a6ca4,_0x5b21f4[_0xd1d2('0x18')][_0xd1d2('0x1a')]);return _0x900ec(_0x5b21f4['error'][_0xd1d2('0x1a')]);}logger[_0xd1d2('0x18')](_0xd1d2('0x13'),_0x1a6ca4,_0x5b21f4[_0xd1d2('0x18')][_0xd1d2('0x1a')]);return _0x353f9b(_0x5b21f4[_0xd1d2('0x18')][_0xd1d2('0x1a')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x1a6ca4,_0xd1d2('0x14'));_0x353f9b(_0x5b21f4['result'][_0xd1d2('0x1a')]);}})[_0xd1d2('0x1b')](function(_0x3102c4){logger[_0xd1d2('0x18')]('OpenchannelAccount,\x20%s,\x20%s',_0x1a6ca4,_0x3102c4);_0x900ec(_0x3102c4);});});} \ No newline at end of file +var _0xcecc=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash'];(function(_0x42f840,_0x1aa32e){var _0x47539f=function(_0x390a4b){while(--_0x390a4b){_0x42f840['push'](_0x42f840['shift']());}};_0x47539f(++_0x1aa32e);}(_0xcecc,0x186));var _0xccec=function(_0x162cf4,_0x245525){_0x162cf4=_0x162cf4-0x0;var _0x405924=_0xcecc[_0x162cf4];return _0x405924;};'use strict';var _=require(_0xccec('0x0'));var util=require('util');var moment=require(_0xccec('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xccec('0x2'));var db=require(_0xccec('0x3'))['db'];var utils=require(_0xccec('0x4'));var logger=require(_0xccec('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xccec('0x6'));var client=jayson['client'][_0xccec('0x7')]({'port':0x232a});config[_0xccec('0x8')]=_[_0xccec('0x9')](config['redis'],{'host':_0xccec('0xa'),'port':0x18eb});var socket=require(_0xccec('0xb'))(new Redis(config['redis']));require(_0xccec('0xc'))[_0xccec('0xd')](socket);function respondWithRpcPromise(_0x45ba32,_0x108788,_0x4a936c){return new BPromise(function(_0x49ad58,_0x5d94a5){return client[_0xccec('0xe')](_0x45ba32,_0x4a936c)[_0xccec('0xf')](function(_0x547e6e){logger[_0xccec('0x10')](_0xccec('0x11'),_0x108788,_0xccec('0x12'));logger['debug'](_0xccec('0x13'),_0x108788,_0xccec('0x12'),JSON[_0xccec('0x14')](_0x547e6e));if(_0x547e6e[_0xccec('0x15')]){if(_0x547e6e[_0xccec('0x15')]['code']===0x1f4){logger[_0xccec('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x108788,_0x547e6e['error']['message']);return _0x5d94a5(_0x547e6e[_0xccec('0x15')][_0xccec('0x16')]);}logger[_0xccec('0x15')](_0xccec('0x11'),_0x108788,_0x547e6e[_0xccec('0x15')][_0xccec('0x16')]);return _0x49ad58(_0x547e6e[_0xccec('0x15')][_0xccec('0x16')]);}else{logger[_0xccec('0x10')]('OpenchannelAccount,\x20%s,\x20%s',_0x108788,'request\x20sent');_0x49ad58(_0x547e6e['result'][_0xccec('0x16')]);}})['catch'](function(_0x76b9fd){logger[_0xccec('0x15')](_0xccec('0x11'),_0x108788,_0x76b9fd);_0x5d94a5(_0x76b9fd);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 86877e0..96b4368 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 _0x175e=['emit','removeListener','register','length','openchannelAccount:','./openchannelAccount.events','save','remove','update'];(function(_0x1019ea,_0x20254d){var _0x39a574=function(_0x37773b){while(--_0x37773b){_0x1019ea['push'](_0x1019ea['shift']());}};_0x39a574(++_0x20254d);}(_0x175e,0xe6));var _0xe175=function(_0xf0f7ba,_0x48be70){_0xf0f7ba=_0xf0f7ba-0x0;var _0x44382c=_0x175e[_0xf0f7ba];return _0x44382c;};'use strict';var OpenchannelAccountEvents=require(_0xe175('0x0'));var events=[_0xe175('0x1'),_0xe175('0x2'),_0xe175('0x3')];function createListener(_0x449d97,_0x5bec43){return function(_0x4d2bfc){_0x5bec43[_0xe175('0x4')](_0x449d97,_0x4d2bfc);};}function removeListener(_0x3c493c,_0x3fd951){return function(){OpenchannelAccountEvents[_0xe175('0x5')](_0x3c493c,_0x3fd951);};}exports[_0xe175('0x6')]=function(_0x278a8d){for(var _0x7eba=0x0,_0xbe8cd=events[_0xe175('0x7')];_0x7eba<_0xbe8cd;_0x7eba++){var _0x2e1356=events[_0x7eba];var _0x345531=createListener(_0xe175('0x8')+_0x2e1356,_0x278a8d);OpenchannelAccountEvents['on'](_0x2e1356,_0x345531);}}; \ No newline at end of file +var _0x90db=['save','remove','update','removeListener','register','length','openchannelAccount:'];(function(_0x2e76a7,_0x23871a){var _0x454cde=function(_0x51724d){while(--_0x51724d){_0x2e76a7['push'](_0x2e76a7['shift']());}};_0x454cde(++_0x23871a);}(_0x90db,0x1c0));var _0xb90d=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x90db[_0x4ea69d];return _0x5318e0;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0xb90d('0x0'),_0xb90d('0x1'),_0xb90d('0x2')];function createListener(_0x5050f4,_0x4fc4c2){return function(_0x4faf3d){_0x4fc4c2['emit'](_0x5050f4,_0x4faf3d);};}function removeListener(_0x4aaef1,_0x17e9b9){return function(){OpenchannelAccountEvents[_0xb90d('0x3')](_0x4aaef1,_0x17e9b9);};}exports[_0xb90d('0x4')]=function(_0x380149){for(var _0x1e7a52=0x0,_0x2d8398=events[_0xb90d('0x5')];_0x1e7a52<_0x2d8398;_0x1e7a52++){var _0x126e17=events[_0x1e7a52];var _0x2ef5e6=createListener(_0xb90d('0x6')+_0x126e17,_0x380149);OpenchannelAccountEvents['on'](_0x126e17,_0x2ef5e6);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 72bc0ab..59f144b 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 _0x7f75=['get','index','/:id','isAuthenticated','show','post','create','update','destroy','exports','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller'];(function(_0x3acaf7,_0x3b22a6){var _0x3762ca=function(_0x5c9d64){while(--_0x5c9d64){_0x3acaf7['push'](_0x3acaf7['shift']());}};_0x3762ca(++_0x3b22a6);}(_0x7f75,0x9a));var _0x57f7=function(_0x81e21,_0x431bf6){_0x81e21=_0x81e21-0x0;var _0x5f3f42=_0x7f75[_0x81e21];return _0x5f3f42;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x57f7('0x0'));var express=require(_0x57f7('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x57f7('0x2'));var interaction=require(_0x57f7('0x3'));var config=require(_0x57f7('0x4'));var controller=require(_0x57f7('0x5'));router[_0x57f7('0x6')]('/',auth['isAuthenticated'](),controller[_0x57f7('0x7')]);router[_0x57f7('0x6')](_0x57f7('0x8'),auth[_0x57f7('0x9')](),controller[_0x57f7('0xa')]);router[_0x57f7('0xb')]('/',auth[_0x57f7('0x9')](),controller[_0x57f7('0xc')]);router['put']('/:id',auth[_0x57f7('0x9')](),controller[_0x57f7('0xd')]);router['delete']('/:id',auth[_0x57f7('0x9')](),controller[_0x57f7('0xe')]);module[_0x57f7('0xf')]=router; \ No newline at end of file +var _0xb25d=['/:id','show','post','create','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index'];(function(_0x2b8211,_0x5e19db){var _0x454af9=function(_0x291eee){while(--_0x291eee){_0x2b8211['push'](_0x2b8211['shift']());}};_0x454af9(++_0x5e19db);}(_0xb25d,0xd8));var _0xdb25=function(_0x1cc328,_0x546f96){_0x1cc328=_0x1cc328-0x0;var _0x31e35b=_0xb25d[_0x1cc328];return _0x31e35b;};'use strict';var multer=require(_0xdb25('0x0'));var util=require(_0xdb25('0x1'));var path=require(_0xdb25('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdb25('0x3')]();var fs_extra=require(_0xdb25('0x4'));var auth=require(_0xdb25('0x5'));var interaction=require(_0xdb25('0x6'));var config=require(_0xdb25('0x7'));var controller=require(_0xdb25('0x8'));router[_0xdb25('0x9')]('/',auth[_0xdb25('0xa')](),controller[_0xdb25('0xb')]);router['get'](_0xdb25('0xc'),auth['isAuthenticated'](),controller[_0xdb25('0xd')]);router[_0xdb25('0xe')]('/',auth[_0xdb25('0xa')](),controller[_0xdb25('0xf')]);router['put'](_0xdb25('0xc'),auth[_0xdb25('0xa')](),controller[_0xdb25('0x10')]);router[_0xdb25('0x11')]('/:id',auth[_0xdb25('0xa')](),controller['destroy']);module[_0xdb25('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index bb2bad5..4c1b3c9 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 _0x764d=['TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x764d,0x150));var _0xd764=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x764d[_0x166742];return _0xb7814a;};'use strict';var Sequelize=require(_0xd764('0x0'));module[_0xd764('0x1')]={'priority':{'type':Sequelize[_0xd764('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd764('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xd764('0x4')]()},'description':{'type':Sequelize[_0xd764('0x3')]},'interval':{'type':Sequelize[_0xd764('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x0b73=['*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x0b73,0xba));var _0x30b7=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x0b73[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x30b7('0x0'));module['exports']={'priority':{'type':Sequelize[_0x30b7('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x30b7('0x2')],'allowNull':![],'defaultValue':_0x30b7('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x30b7('0x2')],'defaultValue':_0x30b7('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index abaa6c2..dada9fa 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 _0xfec7=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','error','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','catch','show','params','create','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel'];(function(_0x246fcf,_0x5bb888){var _0x382f90=function(_0x151291){while(--_0x151291){_0x246fcf['push'](_0x246fcf['shift']());}};_0x382f90(++_0x5bb888);}(_0xfec7,0x166));var _0x7fec=function(_0x505410,_0x422ce4){_0x505410=_0x505410-0x0;var _0x4aee30=_0xfec7[_0x505410];return _0x4aee30;};'use strict';var emlformat=require(_0x7fec('0x0'));var rimraf=require(_0x7fec('0x1'));var zipdir=require(_0x7fec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7fec('0x3'));var moment=require(_0x7fec('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7fec('0x5'));var util=require('util');var path=require(_0x7fec('0x6'));var sox=require(_0x7fec('0x7'));var csv=require(_0x7fec('0x8'));var ejs=require(_0x7fec('0x9'));var fs=require('fs');var fs_extra=require(_0x7fec('0xa'));var _=require('lodash');var squel=require(_0x7fec('0xb'));var crypto=require(_0x7fec('0xc'));var jsforce=require(_0x7fec('0xd'));var deskjs=require(_0x7fec('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7fec('0xf'));var Papa=require(_0x7fec('0x10'));var Redis=require(_0x7fec('0x11'));var authService=require(_0x7fec('0x12'));var qs=require(_0x7fec('0x13'));var as=require(_0x7fec('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7fec('0x15'));var config=require(_0x7fec('0x16'));var licenseUtil=require(_0x7fec('0x17'));var db=require(_0x7fec('0x18'))['db'];function respondWithStatusCode(_0x1d260e,_0x5ea748){_0x5ea748=_0x5ea748||0xcc;return function(_0x129219){if(_0x129219){return _0x1d260e[_0x7fec('0x19')](_0x5ea748);}return _0x1d260e[_0x7fec('0x1a')](_0x5ea748)['end']();};}function respondWithResult(_0x30a88d,_0x47f742){_0x47f742=_0x47f742||0xc8;return function(_0x2ac217){if(_0x2ac217){return _0x30a88d[_0x7fec('0x1a')](_0x47f742)[_0x7fec('0x1b')](_0x2ac217);}};}function respondWithFilteredResult(_0x2c4c77,_0x471fa4){return function(_0x3249b7){if(_0x3249b7){var _0xfd0667=typeof _0x471fa4[_0x7fec('0x1c')]==='undefined'&&typeof _0x471fa4[_0x7fec('0x1d')]===_0x7fec('0x1e');var _0x30d408=_0x3249b7[_0x7fec('0x1f')];var _0x35904a=_0xfd0667?0x0:_0x471fa4[_0x7fec('0x1c')];var _0x1f3d70=_0xfd0667?_0x3249b7['count']:_0x471fa4['offset']+_0x471fa4['limit'];var _0x479509;if(_0x1f3d70>=_0x30d408){_0x1f3d70=_0x30d408;_0x479509=0xc8;}else{_0x479509=0xce;}_0x2c4c77['status'](_0x479509);return _0x2c4c77[_0x7fec('0x20')](_0x7fec('0x21'),_0x35904a+'-'+_0x1f3d70+'/'+_0x30d408)[_0x7fec('0x1b')](_0x3249b7);}return null;};}function patchUpdates(_0x135043){return function(_0x55fa03){try{jsonpatch['apply'](_0x55fa03,_0x135043,!![]);}catch(_0xbbf81a){return BPromise[_0x7fec('0x22')](_0xbbf81a);}return _0x55fa03[_0x7fec('0x23')]();};}function saveUpdates(_0x11cefa,_0x2e5257){return function(_0x22a431){if(_0x22a431){return _0x22a431[_0x7fec('0x24')](_0x11cefa)['then'](function(_0x510bc9){return _0x510bc9;});}return null;};}function removeEntity(_0x3aa6a2,_0x4c874e){return function(_0x55c2b4){if(_0x55c2b4){return _0x55c2b4[_0x7fec('0x25')]()['then'](function(){_0x3aa6a2[_0x7fec('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x482acb,_0x5c7b47){return function(_0x8978d6){if(!_0x8978d6){_0x482acb[_0x7fec('0x19')](0x194);}return _0x8978d6;};}function handleError(_0x337a2b,_0x53835e){_0x53835e=_0x53835e||0x1f4;return function(_0x349ad1){logger[_0x7fec('0x26')](_0x349ad1['stack']);if(_0x349ad1[_0x7fec('0x27')]){delete _0x349ad1[_0x7fec('0x27')];}_0x337a2b[_0x7fec('0x1a')](_0x53835e)[_0x7fec('0x28')](_0x349ad1);};}exports[_0x7fec('0x29')]=function(_0x26fc25,_0x4596e1){var _0x3ae709={},_0x500d95={},_0x2786db={'count':0x0,'rows':[]};var _0x4152f2=_[_0x7fec('0x2a')](db[_0x7fec('0x2b')][_0x7fec('0x2c')],function(_0x16c254){return{'name':_0x16c254[_0x7fec('0x2d')],'type':_0x16c254[_0x7fec('0x2e')]['key']};});_0x500d95[_0x7fec('0x2f')]=_[_0x7fec('0x2a')](_0x4152f2,_0x7fec('0x27'));_0x500d95[_0x7fec('0x30')]=_[_0x7fec('0x31')](_0x26fc25[_0x7fec('0x30')]);_0x500d95[_0x7fec('0x32')]=_[_0x7fec('0x33')](_0x500d95[_0x7fec('0x2f')],_0x500d95[_0x7fec('0x30')]);_0x3ae709[_0x7fec('0x34')]=_[_0x7fec('0x33')](_0x500d95[_0x7fec('0x2f')],qs[_0x7fec('0x35')](_0x26fc25[_0x7fec('0x30')][_0x7fec('0x35')]));_0x3ae709[_0x7fec('0x34')]=_0x3ae709[_0x7fec('0x34')][_0x7fec('0x36')]?_0x3ae709['attributes']:_0x500d95[_0x7fec('0x2f')];if(!_0x26fc25['query']['hasOwnProperty'](_0x7fec('0x37'))){_0x3ae709['limit']=qs[_0x7fec('0x1d')](_0x26fc25['query'][_0x7fec('0x1d')]);_0x3ae709[_0x7fec('0x1c')]=qs[_0x7fec('0x1c')](_0x26fc25[_0x7fec('0x30')][_0x7fec('0x1c')]);}_0x3ae709[_0x7fec('0x38')]=qs[_0x7fec('0x39')](_0x26fc25[_0x7fec('0x30')][_0x7fec('0x39')]);_0x3ae709[_0x7fec('0x3a')]=qs[_0x7fec('0x32')](_[_0x7fec('0x3b')](_0x26fc25[_0x7fec('0x30')],_0x500d95[_0x7fec('0x32')]),_0x4152f2);if(_0x26fc25[_0x7fec('0x30')][_0x7fec('0x3c')]){_0x3ae709[_0x7fec('0x3a')]=_['merge'](_0x3ae709['where'],{'$or':_[_0x7fec('0x2a')](_0x4152f2,function(_0xe2eee){if(_0xe2eee[_0x7fec('0x2e')]!==_0x7fec('0x3d')){var _0x1b6096={};_0x1b6096[_0xe2eee[_0x7fec('0x27')]]={'$like':'%'+_0x26fc25[_0x7fec('0x30')][_0x7fec('0x3c')]+'%'};return _0x1b6096;}})});}_0x3ae709=_[_0x7fec('0x3e')]({},_0x3ae709,_0x26fc25[_0x7fec('0x3f')]);var _0x568641={'where':_0x3ae709[_0x7fec('0x3a')]};return db['OpenchannelApplication']['count'](_0x568641)[_0x7fec('0x40')](function(_0x1f5683){_0x2786db['count']=_0x1f5683;if(_0x26fc25[_0x7fec('0x30')][_0x7fec('0x41')]){_0x3ae709[_0x7fec('0x42')]=[{'all':!![]}];}return db[_0x7fec('0x2b')][_0x7fec('0x43')](_0x3ae709);})['then'](function(_0x566b0d){_0x2786db[_0x7fec('0x44')]=_0x566b0d;return _0x2786db;})[_0x7fec('0x40')](respondWithFilteredResult(_0x4596e1,_0x3ae709))[_0x7fec('0x45')](handleError(_0x4596e1,null));};exports[_0x7fec('0x46')]=function(_0x3c8870,_0x564734){var _0x4eed84={'raw':!![],'where':{'id':_0x3c8870[_0x7fec('0x47')]['id']}},_0x19e65c={};_0x19e65c[_0x7fec('0x2f')]=_[_0x7fec('0x31')](db[_0x7fec('0x2b')][_0x7fec('0x2c')]);_0x19e65c['query']=_[_0x7fec('0x31')](_0x3c8870[_0x7fec('0x30')]);_0x19e65c[_0x7fec('0x32')]=_['intersection'](_0x19e65c[_0x7fec('0x2f')],_0x19e65c[_0x7fec('0x30')]);_0x4eed84[_0x7fec('0x34')]=_['intersection'](_0x19e65c[_0x7fec('0x2f')],qs['fields'](_0x3c8870[_0x7fec('0x30')][_0x7fec('0x35')]));_0x4eed84['attributes']=_0x4eed84[_0x7fec('0x34')]['length']?_0x4eed84[_0x7fec('0x34')]:_0x19e65c[_0x7fec('0x2f')];if(_0x3c8870[_0x7fec('0x30')]['includeAll']){_0x4eed84[_0x7fec('0x42')]=[{'all':!![]}];}_0x4eed84=_[_0x7fec('0x3e')]({},_0x4eed84,_0x3c8870[_0x7fec('0x3f')]);return db[_0x7fec('0x2b')]['find'](_0x4eed84)[_0x7fec('0x40')](handleEntityNotFound(_0x564734,null))[_0x7fec('0x40')](respondWithResult(_0x564734,null))[_0x7fec('0x45')](handleError(_0x564734,null));};exports[_0x7fec('0x48')]=function(_0x1adfd6,_0x547dd2){return db[_0x7fec('0x2b')][_0x7fec('0x48')](_0x1adfd6[_0x7fec('0x49')],{})[_0x7fec('0x40')](respondWithResult(_0x547dd2,0xc9))[_0x7fec('0x45')](handleError(_0x547dd2,null));};exports['update']=function(_0x2da016,_0x2aa325){if(_0x2da016['body']['id']){delete _0x2da016['body']['id'];}return db[_0x7fec('0x2b')]['find']({'where':{'id':_0x2da016['params']['id']}})['then'](handleEntityNotFound(_0x2aa325,null))[_0x7fec('0x40')](saveUpdates(_0x2da016[_0x7fec('0x49')],null))[_0x7fec('0x40')](respondWithResult(_0x2aa325,null))[_0x7fec('0x45')](handleError(_0x2aa325,null));};exports[_0x7fec('0x25')]=function(_0xd980da,_0x565973){return db[_0x7fec('0x2b')]['find']({'where':{'id':_0xd980da['params']['id']}})['then'](handleEntityNotFound(_0x565973,null))[_0x7fec('0x40')](removeEntity(_0x565973,null))['catch'](handleError(_0x565973,null));}; \ No newline at end of file +var _0x5dae=['limit','count','set','apply','reject','then','destroy','error','stack','name','send','index','OpenchannelApplication','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','keys','rawAttributes','includeAll','find','create','body','update','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x230697,_0x7bf740){var _0x393137=function(_0x26c36c){while(--_0x26c36c){_0x230697['push'](_0x230697['shift']());}};_0x393137(++_0x7bf740);}(_0x5dae,0x14b));var _0xe5da=function(_0x395890,_0x4e81a6){_0x395890=_0x395890-0x0;var _0xf5606c=_0x5dae[_0x395890];return _0xf5606c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe5da('0x0'));var zipdir=require(_0xe5da('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe5da('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe5da('0x3'));var util=require(_0xe5da('0x4'));var path=require(_0xe5da('0x5'));var sox=require(_0xe5da('0x6'));var csv=require(_0xe5da('0x7'));var ejs=require(_0xe5da('0x8'));var fs=require('fs');var fs_extra=require(_0xe5da('0x9'));var _=require('lodash');var squel=require(_0xe5da('0xa'));var crypto=require(_0xe5da('0xb'));var jsforce=require(_0xe5da('0xc'));var deskjs=require(_0xe5da('0xd'));var toCsv=require(_0xe5da('0x7'));var querystring=require(_0xe5da('0xe'));var Papa=require(_0xe5da('0xf'));var Redis=require(_0xe5da('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe5da('0x11'));var as=require(_0xe5da('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe5da('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xe5da('0x14'));var licenseUtil=require(_0xe5da('0x15'));var db=require(_0xe5da('0x16'))['db'];function respondWithStatusCode(_0x5b3474,_0xea3042){_0xea3042=_0xea3042||0xcc;return function(_0x3cfdbf){if(_0x3cfdbf){return _0x5b3474[_0xe5da('0x17')](_0xea3042);}return _0x5b3474[_0xe5da('0x18')](_0xea3042)[_0xe5da('0x19')]();};}function respondWithResult(_0x3f649f,_0x3f9ceb){_0x3f9ceb=_0x3f9ceb||0xc8;return function(_0x4ac60f){if(_0x4ac60f){return _0x3f649f[_0xe5da('0x18')](_0x3f9ceb)[_0xe5da('0x1a')](_0x4ac60f);}};}function respondWithFilteredResult(_0x5ae435,_0x4ab40b){return function(_0x34f569){if(_0x34f569){var _0x58bac2=typeof _0x4ab40b[_0xe5da('0x1b')]===_0xe5da('0x1c')&&typeof _0x4ab40b[_0xe5da('0x1d')]===_0xe5da('0x1c');var _0x1b97c3=_0x34f569[_0xe5da('0x1e')];var _0x1f9259=_0x58bac2?0x0:_0x4ab40b[_0xe5da('0x1b')];var _0x44c897=_0x58bac2?_0x34f569['count']:_0x4ab40b[_0xe5da('0x1b')]+_0x4ab40b[_0xe5da('0x1d')];var _0x4ef35f;if(_0x44c897>=_0x1b97c3){_0x44c897=_0x1b97c3;_0x4ef35f=0xc8;}else{_0x4ef35f=0xce;}_0x5ae435[_0xe5da('0x18')](_0x4ef35f);return _0x5ae435[_0xe5da('0x1f')]('Content-Range',_0x1f9259+'-'+_0x44c897+'/'+_0x1b97c3)[_0xe5da('0x1a')](_0x34f569);}return null;};}function patchUpdates(_0x476965){return function(_0x2bded3){try{jsonpatch[_0xe5da('0x20')](_0x2bded3,_0x476965,!![]);}catch(_0x303a4b){return BPromise[_0xe5da('0x21')](_0x303a4b);}return _0x2bded3['save']();};}function saveUpdates(_0x50eee1,_0x6a674f){return function(_0x151cc7){if(_0x151cc7){return _0x151cc7['update'](_0x50eee1)[_0xe5da('0x22')](function(_0x33cd76){return _0x33cd76;});}return null;};}function removeEntity(_0x35e6e9,_0x28da21){return function(_0x299d35){if(_0x299d35){return _0x299d35[_0xe5da('0x23')]()['then'](function(){_0x35e6e9['status'](0xcc)[_0xe5da('0x19')]();});}};}function handleEntityNotFound(_0x1cb333,_0x50969d){return function(_0x18758b){if(!_0x18758b){_0x1cb333[_0xe5da('0x17')](0x194);}return _0x18758b;};}function handleError(_0x50c8ad,_0x459f4b){_0x459f4b=_0x459f4b||0x1f4;return function(_0x7b367e){logger[_0xe5da('0x24')](_0x7b367e[_0xe5da('0x25')]);if(_0x7b367e[_0xe5da('0x26')]){delete _0x7b367e[_0xe5da('0x26')];}_0x50c8ad[_0xe5da('0x18')](_0x459f4b)[_0xe5da('0x27')](_0x7b367e);};}exports[_0xe5da('0x28')]=function(_0x402014,_0xe5fd9c){var _0x95c858={},_0x20984f={},_0x21f301={'count':0x0,'rows':[]};var _0x14fe7f=_['map'](db[_0xe5da('0x29')]['rawAttributes'],function(_0xb9a458){return{'name':_0xb9a458['fieldName'],'type':_0xb9a458['type'][_0xe5da('0x2a')]};});_0x20984f[_0xe5da('0x2b')]=_['map'](_0x14fe7f,_0xe5da('0x26'));_0x20984f[_0xe5da('0x2c')]=_['keys'](_0x402014['query']);_0x20984f[_0xe5da('0x2d')]=_[_0xe5da('0x2e')](_0x20984f[_0xe5da('0x2b')],_0x20984f[_0xe5da('0x2c')]);_0x95c858[_0xe5da('0x2f')]=_[_0xe5da('0x2e')](_0x20984f[_0xe5da('0x2b')],qs[_0xe5da('0x30')](_0x402014[_0xe5da('0x2c')][_0xe5da('0x30')]));_0x95c858[_0xe5da('0x2f')]=_0x95c858['attributes'][_0xe5da('0x31')]?_0x95c858[_0xe5da('0x2f')]:_0x20984f[_0xe5da('0x2b')];if(!_0x402014[_0xe5da('0x2c')][_0xe5da('0x32')](_0xe5da('0x33'))){_0x95c858[_0xe5da('0x1d')]=qs[_0xe5da('0x1d')](_0x402014[_0xe5da('0x2c')][_0xe5da('0x1d')]);_0x95c858['offset']=qs[_0xe5da('0x1b')](_0x402014[_0xe5da('0x2c')][_0xe5da('0x1b')]);}_0x95c858[_0xe5da('0x34')]=qs[_0xe5da('0x35')](_0x402014[_0xe5da('0x2c')][_0xe5da('0x35')]);_0x95c858[_0xe5da('0x36')]=qs[_0xe5da('0x2d')](_[_0xe5da('0x37')](_0x402014['query'],_0x20984f['filters']),_0x14fe7f);if(_0x402014[_0xe5da('0x2c')]['filter']){_0x95c858[_0xe5da('0x36')]=_[_0xe5da('0x38')](_0x95c858[_0xe5da('0x36')],{'$or':_['map'](_0x14fe7f,function(_0x4cb2b2){if(_0x4cb2b2['type']!==_0xe5da('0x39')){var _0x449243={};_0x449243[_0x4cb2b2[_0xe5da('0x26')]]={'$like':'%'+_0x402014[_0xe5da('0x2c')][_0xe5da('0x3a')]+'%'};return _0x449243;}})});}_0x95c858=_[_0xe5da('0x38')]({},_0x95c858,_0x402014[_0xe5da('0x3b')]);var _0x37f3a1={'where':_0x95c858[_0xe5da('0x36')]};return db[_0xe5da('0x29')]['count'](_0x37f3a1)[_0xe5da('0x22')](function(_0x3508b7){_0x21f301['count']=_0x3508b7;if(_0x402014[_0xe5da('0x2c')]['includeAll']){_0x95c858[_0xe5da('0x3c')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0xe5da('0x3d')](_0x95c858);})[_0xe5da('0x22')](function(_0x4f190b){_0x21f301[_0xe5da('0x3e')]=_0x4f190b;return _0x21f301;})[_0xe5da('0x22')](respondWithFilteredResult(_0xe5fd9c,_0x95c858))[_0xe5da('0x3f')](handleError(_0xe5fd9c,null));};exports['show']=function(_0x15dfdd,_0x4c8731){var _0x4160d7={'raw':!![],'where':{'id':_0x15dfdd[_0xe5da('0x40')]['id']}},_0x55e466={};_0x55e466[_0xe5da('0x2b')]=_[_0xe5da('0x41')](db[_0xe5da('0x29')][_0xe5da('0x42')]);_0x55e466[_0xe5da('0x2c')]=_[_0xe5da('0x41')](_0x15dfdd['query']);_0x55e466[_0xe5da('0x2d')]=_['intersection'](_0x55e466[_0xe5da('0x2b')],_0x55e466['query']);_0x4160d7[_0xe5da('0x2f')]=_['intersection'](_0x55e466[_0xe5da('0x2b')],qs[_0xe5da('0x30')](_0x15dfdd['query'][_0xe5da('0x30')]));_0x4160d7[_0xe5da('0x2f')]=_0x4160d7['attributes'][_0xe5da('0x31')]?_0x4160d7[_0xe5da('0x2f')]:_0x55e466[_0xe5da('0x2b')];if(_0x15dfdd[_0xe5da('0x2c')][_0xe5da('0x43')]){_0x4160d7[_0xe5da('0x3c')]=[{'all':!![]}];}_0x4160d7=_[_0xe5da('0x38')]({},_0x4160d7,_0x15dfdd['options']);return db['OpenchannelApplication'][_0xe5da('0x44')](_0x4160d7)['then'](handleEntityNotFound(_0x4c8731,null))[_0xe5da('0x22')](respondWithResult(_0x4c8731,null))[_0xe5da('0x3f')](handleError(_0x4c8731,null));};exports['create']=function(_0x132e6e,_0x404cc3){return db[_0xe5da('0x29')][_0xe5da('0x45')](_0x132e6e[_0xe5da('0x46')],{})[_0xe5da('0x22')](respondWithResult(_0x404cc3,0xc9))[_0xe5da('0x3f')](handleError(_0x404cc3,null));};exports[_0xe5da('0x47')]=function(_0x470e6a,_0x2875c0){if(_0x470e6a[_0xe5da('0x46')]['id']){delete _0x470e6a['body']['id'];}return db[_0xe5da('0x29')][_0xe5da('0x44')]({'where':{'id':_0x470e6a[_0xe5da('0x40')]['id']}})[_0xe5da('0x22')](handleEntityNotFound(_0x2875c0,null))[_0xe5da('0x22')](saveUpdates(_0x470e6a[_0xe5da('0x46')],null))['then'](respondWithResult(_0x2875c0,null))[_0xe5da('0x3f')](handleError(_0x2875c0,null));};exports['destroy']=function(_0x401939,_0x2345a1){return db['OpenchannelApplication'][_0xe5da('0x44')]({'where':{'id':_0x401939[_0xe5da('0x40')]['id']}})[_0xe5da('0x22')](handleEntityNotFound(_0x2345a1,null))[_0xe5da('0x22')](removeEntity(_0x2345a1,null))[_0xe5da('0x3f')](handleError(_0x2345a1,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 3349b11..7bcda65 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 _0xdd76=['utf8mb4','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','openchannel_applications'];(function(_0x49c057,_0xc808ed){var _0xd8f0e6=function(_0x5b9042){while(--_0x5b9042){_0x49c057['push'](_0x49c057['shift']());}};_0xd8f0e6(++_0xc808ed);}(_0xdd76,0x181));var _0x6dd7=function(_0x5794d7,_0x4b83e1){_0x5794d7=_0x5794d7-0x0;var _0x294ef3=_0xdd76[_0x5794d7];return _0x294ef3;};'use strict';var _=require(_0x6dd7('0x0'));var util=require('util');var logger=require(_0x6dd7('0x1'))('api');var moment=require(_0x6dd7('0x2'));var BPromise=require(_0x6dd7('0x3'));var rp=require(_0x6dd7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6dd7('0x5'));var config=require(_0x6dd7('0x6'));var attributes=require(_0x6dd7('0x7'));module[_0x6dd7('0x8')]=function(_0x2965e6,_0x5c1b87){return _0x2965e6[_0x6dd7('0x9')]('OpenchannelApplication',attributes,{'tableName':_0x6dd7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6dd7('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7999=['exports','define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x202331,_0x538eb1){var _0x1a2f07=function(_0x5df626){while(--_0x5df626){_0x202331['push'](_0x202331['shift']());}};_0x1a2f07(++_0x538eb1);}(_0x7999,0x1e1));var _0x9799=function(_0x22ad2d,_0x5172c6){_0x22ad2d=_0x22ad2d-0x0;var _0x5638f8=_0x7999[_0x22ad2d];return _0x5638f8;};'use strict';var _=require(_0x9799('0x0'));var util=require(_0x9799('0x1'));var logger=require(_0x9799('0x2'))(_0x9799('0x3'));var moment=require(_0x9799('0x4'));var BPromise=require(_0x9799('0x5'));var rp=require(_0x9799('0x6'));var fs=require('fs');var path=require(_0x9799('0x7'));var rimraf=require(_0x9799('0x8'));var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module[_0x9799('0x9')]=function(_0x8221ec,_0x12657b){return _0x8221ec[_0x9799('0xa')](_0x9799('0xb'),attributes,{'tableName':_0x9799('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9799('0xd')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 8b336bd..bb49be9 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 _0x6954=['then','info','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','update','body','options','raw','where','limit','UpdateOpenchannelApplication','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x4bf4c3,_0x199b5c){var _0x3f3357=function(_0x388c26){while(--_0x388c26){_0x4bf4c3['push'](_0x4bf4c3['shift']());}};_0x3f3357(++_0x199b5c);}(_0x6954,0x82));var _0x4695=function(_0x3f3a1b,_0x39081e){_0x3f3a1b=_0x3f3a1b-0x0;var _0x40f834=_0x6954[_0x3f3a1b];return _0x40f834;};'use strict';var _=require('lodash');var util=require(_0x4695('0x0'));var moment=require(_0x4695('0x1'));var BPromise=require('bluebird');var rs=require(_0x4695('0x2'));var fs=require('fs');var Redis=require(_0x4695('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4695('0x4'))(_0x4695('0x5'));var config=require(_0x4695('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4695('0x7')][_0x4695('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x56a7b2,_0x18da8c,_0x5ae5fb){return new BPromise(function(_0x4c993c,_0x3cb5f2){return client[_0x4695('0x9')](_0x56a7b2,_0x5ae5fb)[_0x4695('0xa')](function(_0x42771c){logger[_0x4695('0xb')](_0x4695('0xc'),_0x18da8c,'request\x20sent');logger[_0x4695('0xd')](_0x4695('0xe'),_0x18da8c,'request\x20sent',JSON[_0x4695('0xf')](_0x42771c));if(_0x42771c[_0x4695('0x10')]){if(_0x42771c[_0x4695('0x10')]['code']===0x1f4){logger['error'](_0x4695('0xc'),_0x18da8c,_0x42771c[_0x4695('0x10')]['message']);return _0x3cb5f2(_0x42771c[_0x4695('0x10')][_0x4695('0x11')]);}logger['error'](_0x4695('0xc'),_0x18da8c,_0x42771c[_0x4695('0x10')][_0x4695('0x11')]);return _0x4c993c(_0x42771c['error']['message']);}else{logger['info'](_0x4695('0xc'),_0x18da8c,_0x4695('0x12'));_0x4c993c(_0x42771c[_0x4695('0x13')]['message']);}})[_0x4695('0x14')](function(_0x1455b6){logger[_0x4695('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x18da8c,_0x1455b6);_0x3cb5f2(_0x1455b6);});});}exports['UpdateOpenchannelApplication']=function(_0xdd282){var _0x4aad51=this;return new Promise(function(_0x17b8ef,_0x1c0073){return db['OpenchannelApplication'][_0x4695('0x15')](_0xdd282[_0x4695('0x16')],{'raw':_0xdd282[_0x4695('0x17')]?_0xdd282[_0x4695('0x17')][_0x4695('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdd282[_0x4695('0x17')]?_0xdd282[_0x4695('0x17')][_0x4695('0x19')]||null:null,'attributes':_0xdd282['options']?_0xdd282[_0x4695('0x17')]['attributes']||null:null,'limit':_0xdd282[_0x4695('0x17')]?_0xdd282[_0x4695('0x17')][_0x4695('0x1a')]||null:null})['then'](function(_0x1fffa4){logger[_0x4695('0xb')](_0x4695('0x1b'),_0xdd282);logger[_0x4695('0xd')]('UpdateOpenchannelApplication',_0xdd282,JSON[_0x4695('0xf')](_0x1fffa4));_0x17b8ef(_0x1fffa4);})[_0x4695('0x14')](function(_0x311f70){logger['error'](_0x4695('0x1b'),_0x311f70[_0x4695('0x11')],_0xdd282);_0x1c0073(_0x4aad51[_0x4695('0x10')](0x1f4,_0x311f70[_0x4695('0x11')]));});});}; \ No newline at end of file +var _0x4d5a=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','stringify','lodash'];(function(_0x38d499,_0x1cbb6b){var _0x274b18=function(_0x488d64){while(--_0x488d64){_0x38d499['push'](_0x38d499['shift']());}};_0x274b18(++_0x1cbb6b);}(_0x4d5a,0x9f));var _0xa4d5=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x4d5a[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0xa4d5('0x0'));var util=require(_0xa4d5('0x1'));var moment=require(_0xa4d5('0x2'));var BPromise=require(_0xa4d5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa4d5('0x4'));var db=require(_0xa4d5('0x5'))['db'];var utils=require(_0xa4d5('0x6'));var logger=require('../../config/logger')(_0xa4d5('0x7'));var config=require(_0xa4d5('0x8'));var jayson=require(_0xa4d5('0x9'));var client=jayson[_0xa4d5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b8600,_0x1ec283,_0x5b954c){return new BPromise(function(_0xd89212,_0x3dd54a){return client[_0xa4d5('0xb')](_0x5b8600,_0x5b954c)[_0xa4d5('0xc')](function(_0x28da51){logger[_0xa4d5('0xd')](_0xa4d5('0xe'),_0x1ec283,'request\x20sent');logger[_0xa4d5('0xf')](_0xa4d5('0x10'),_0x1ec283,_0xa4d5('0x11'),JSON['stringify'](_0x28da51));if(_0x28da51[_0xa4d5('0x12')]){if(_0x28da51[_0xa4d5('0x12')][_0xa4d5('0x13')]===0x1f4){logger[_0xa4d5('0x12')](_0xa4d5('0xe'),_0x1ec283,_0x28da51[_0xa4d5('0x12')][_0xa4d5('0x14')]);return _0x3dd54a(_0x28da51[_0xa4d5('0x12')][_0xa4d5('0x14')]);}logger[_0xa4d5('0x12')](_0xa4d5('0xe'),_0x1ec283,_0x28da51[_0xa4d5('0x12')][_0xa4d5('0x14')]);return _0xd89212(_0x28da51[_0xa4d5('0x12')][_0xa4d5('0x14')]);}else{logger[_0xa4d5('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x1ec283,'request\x20sent');_0xd89212(_0x28da51[_0xa4d5('0x15')]['message']);}})[_0xa4d5('0x16')](function(_0x4f9e75){logger[_0xa4d5('0x12')](_0xa4d5('0xe'),_0x1ec283,_0x4f9e75);_0x3dd54a(_0x4f9e75);});});}exports[_0xa4d5('0x17')]=function(_0x5c1221){var _0x161f8d=this;return new Promise(function(_0x182de8,_0x37b75e){return db[_0xa4d5('0x18')][_0xa4d5('0x19')](_0x5c1221['body'],{'raw':_0x5c1221[_0xa4d5('0x1a')]?_0x5c1221[_0xa4d5('0x1a')][_0xa4d5('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c1221['options']?_0x5c1221[_0xa4d5('0x1a')][_0xa4d5('0x1c')]||null:null,'attributes':_0x5c1221[_0xa4d5('0x1a')]?_0x5c1221[_0xa4d5('0x1a')][_0xa4d5('0x1d')]||null:null,'limit':_0x5c1221['options']?_0x5c1221[_0xa4d5('0x1a')][_0xa4d5('0x1e')]||null:null})[_0xa4d5('0xc')](function(_0x17cd06){logger[_0xa4d5('0xd')](_0xa4d5('0x17'),_0x5c1221);logger[_0xa4d5('0xf')](_0xa4d5('0x17'),_0x5c1221,JSON[_0xa4d5('0x1f')](_0x17cd06));_0x182de8(_0x17cd06);})[_0xa4d5('0x16')](function(_0x3bff8b){logger['error'](_0xa4d5('0x17'),_0x3bff8b[_0xa4d5('0x14')],_0x5c1221);_0x37b75e(_0x161f8d['error'](0x1f4,_0x3bff8b[_0xa4d5('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index d2cdd0c..9f9d38e 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 _0xc262=['isAuthenticated','index','/describe','describe','/:id','getMessages','/:id/download','download','post','/:id/messages','addMessage','/:id/tags','tracked','addTags','put','delete','openchannel','openchannelinteraction:destroy','removeTags','exports','multer','util','Router','fs-extra','../../components/interaction/service','get'];(function(_0x36fbef,_0x4ffc84){var _0x45e270=function(_0x32dd95){while(--_0x32dd95){_0x36fbef['push'](_0x36fbef['shift']());}};_0x45e270(++_0x4ffc84);}(_0xc262,0x19a));var _0x2c26=function(_0x5ccf1,_0x28a9ed){_0x5ccf1=_0x5ccf1-0x0;var _0x2d6b4d=_0xc262[_0x5ccf1];return _0x2d6b4d;};'use strict';var multer=require(_0x2c26('0x0'));var util=require(_0x2c26('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2c26('0x2')]();var fs_extra=require(_0x2c26('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2c26('0x4'));var config=require('../../config/environment');var controller=require('./openchannelInteraction.controller');router[_0x2c26('0x5')]('/',auth[_0x2c26('0x6')](),controller[_0x2c26('0x7')]);router[_0x2c26('0x5')](_0x2c26('0x8'),auth[_0x2c26('0x6')](),controller[_0x2c26('0x9')]);router['get'](_0x2c26('0xa'),auth[_0x2c26('0x6')](),controller['show']);router[_0x2c26('0x5')]('/:id/messages',auth['isAuthenticated'](),controller[_0x2c26('0xb')]);router['get'](_0x2c26('0xc'),auth[_0x2c26('0x6')](),controller[_0x2c26('0xd')]);router[_0x2c26('0xe')]('/',auth[_0x2c26('0x6')](),controller['create']);router[_0x2c26('0xe')](_0x2c26('0xf'),auth[_0x2c26('0x6')](),controller[_0x2c26('0x10')]);router['post'](_0x2c26('0x11'),auth['isAuthenticated'](),interaction[_0x2c26('0x12')]('openchannel','openchannelinteraction:addtags'),controller[_0x2c26('0x13')]);router[_0x2c26('0x14')](_0x2c26('0xa'),auth[_0x2c26('0x6')](),interaction[_0x2c26('0x12')]('openchannel','openchannelinteraction:update'),controller['update']);router[_0x2c26('0x15')](_0x2c26('0xa'),auth[_0x2c26('0x6')](),interaction[_0x2c26('0x12')](_0x2c26('0x16'),_0x2c26('0x17')),controller['destroy']);router[_0x2c26('0x15')]('/:id/tags',auth[_0x2c26('0x6')](),controller[_0x2c26('0x18')]);module[_0x2c26('0x19')]=router; \ No newline at end of file +var _0xc36a=['tracked','openchannelinteraction:addtags','addTags','put','openchannel','openchannelinteraction:update','update','delete','/:id/tags','removeTags','multer','util','connect-timeout','fs-extra','../../components/interaction/service','./openchannelInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage'];(function(_0x4e1d7d,_0x5a7761){var _0x53f086=function(_0x3bd510){while(--_0x3bd510){_0x4e1d7d['push'](_0x4e1d7d['shift']());}};_0x53f086(++_0x5a7761);}(_0xc36a,0xb8));var _0xac36=function(_0x5171ae,_0xe88724){_0x5171ae=_0x5171ae-0x0;var _0x3f43bc=_0xc36a[_0x5171ae];return _0x3f43bc;};'use strict';var multer=require(_0xac36('0x0'));var util=require(_0xac36('0x1'));var path=require('path');var timeout=require(_0xac36('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xac36('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xac36('0x4'));var config=require('../../config/environment');var controller=require(_0xac36('0x5'));router['get']('/',auth[_0xac36('0x6')](),controller[_0xac36('0x7')]);router[_0xac36('0x8')](_0xac36('0x9'),auth[_0xac36('0x6')](),controller[_0xac36('0xa')]);router['get'](_0xac36('0xb'),auth[_0xac36('0x6')](),controller[_0xac36('0xc')]);router['get'](_0xac36('0xd'),auth[_0xac36('0x6')](),controller[_0xac36('0xe')]);router[_0xac36('0x8')]('/:id/download',auth[_0xac36('0x6')](),controller[_0xac36('0xf')]);router[_0xac36('0x10')]('/',auth[_0xac36('0x6')](),controller[_0xac36('0x11')]);router[_0xac36('0x10')](_0xac36('0xd'),auth[_0xac36('0x6')](),controller[_0xac36('0x12')]);router[_0xac36('0x10')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xac36('0x13')]('openchannel',_0xac36('0x14')),controller[_0xac36('0x15')]);router[_0xac36('0x16')](_0xac36('0xb'),auth[_0xac36('0x6')](),interaction[_0xac36('0x13')](_0xac36('0x17'),_0xac36('0x18')),controller[_0xac36('0x19')]);router['delete'](_0xac36('0xb'),auth[_0xac36('0x6')](),interaction['tracked'](_0xac36('0x17'),'openchannelinteraction:destroy'),controller['destroy']);router[_0xac36('0x1a')](_0xac36('0x1b'),auth['isAuthenticated'](),controller[_0xac36('0x1c')]);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 f682975..4bde11f 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 _0x0f16=['ENUM','out','BOOLEAN','sequelize','exports','DATE','STRING'];(function(_0x5c3821,_0xb835ba){var _0x397642=function(_0x2aba84){while(--_0x2aba84){_0x5c3821['push'](_0x5c3821['shift']());}};_0x397642(++_0xb835ba);}(_0x0f16,0x192));var _0x60f1=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0f16[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x60f1('0x0'));module[_0x60f1('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x60f1('0x2')]},'disposition':{'type':Sequelize[_0x60f1('0x3')]},'secondDisposition':{'type':Sequelize[_0x60f1('0x3')]},'thirdDisposition':{'type':Sequelize[_0x60f1('0x3')]},'note':{'type':Sequelize[_0x60f1('0x3')]},'read1stAt':{'type':Sequelize[_0x60f1('0x2')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x60f1('0x3')]},'lastMsgAt':{'type':Sequelize[_0x60f1('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x60f1('0x4')]('in',_0x60f1('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x60f1('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x60f1('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x5826=['BOOLEAN','STRING','DATE','ENUM','out'];(function(_0xeadc11,_0x27e378){var _0x4257b6=function(_0x38bb40){while(--_0x38bb40){_0xeadc11['push'](_0xeadc11['shift']());}};_0x4257b6(++_0x27e378);}(_0x5826,0x1ea));var _0x6582=function(_0x38400b,_0x5dc014){_0x38400b=_0x38400b-0x0;var _0x4e2695=_0x5826[_0x38400b];return _0x4e2695;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x6582('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x6582('0x1')]},'thirdDisposition':{'type':Sequelize[_0x6582('0x1')]},'note':{'type':Sequelize[_0x6582('0x1')]},'read1stAt':{'type':Sequelize[_0x6582('0x2')]},'threadId':{'type':Sequelize[_0x6582('0x1')]},'externalUrl':{'type':Sequelize[_0x6582('0x1')]},'lastMsgAt':{'type':Sequelize[_0x6582('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x6582('0x3')]('in',_0x6582('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x6582('0x1')]},'autoreplyExecuted':{'type':Sequelize[_0x6582('0x0')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 8f44567..bc24536 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 _0xa10c=['catch','waiting','talking','answered','unmanaged','closed','UserId','index','map','type','key','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','select','field','color','from','tools_tags','u.id','u.fullname','user_has_openchannel_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','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','end','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','keys','compact','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','SELECT','clone','i.id','order','contactName','DESC','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','agent','getOpenchannelAccounts','isEmpty','i.OpenchannelAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','OpenchannelInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','all','rows','show','params','rawAttributes','include','create','body','destroy','describe','addMessage','ids','omit','getMessages','findOne','format','options','OpenchannelMessage','setTags','spread','findAll','emit','removeTags','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','lastName','Attachment','Messages','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','YYYY-MM-DD\x20HH:mm:ss','disposition','Private','basename','createReadStream','pipe','createWriteStream','direction','out','firstName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','status','offset','undefined','limit','count','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','Users','fullname','Tags','TagIds','split','push'];(function(_0x1575f2,_0x3d6544){var _0xd54646=function(_0x3f94d5){while(--_0x3f94d5){_0x1575f2['push'](_0x1575f2['shift']());}};_0xd54646(++_0x3d6544);}(_0xa10c,0xc0));var _0xca10=function(_0x3db492,_0x2db3e2){_0x3db492=_0x3db492-0x0;var _0x3033b9=_0xa10c[_0x3db492];return _0x3033b9;};'use strict';var emlformat=require(_0xca10('0x0'));var rimraf=require(_0xca10('0x1'));var zipdir=require(_0xca10('0x2'));var jsonpatch=require(_0xca10('0x3'));var rp=require(_0xca10('0x4'));var moment=require(_0xca10('0x5'));var BPromise=require(_0xca10('0x6'));var Mustache=require(_0xca10('0x7'));var util=require('util');var path=require('path');var sox=require(_0xca10('0x8'));var csv=require(_0xca10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca10('0xa'));var _=require(_0xca10('0xb'));var squel=require('squel');var crypto=require(_0xca10('0xc'));var jsforce=require(_0xca10('0xd'));var deskjs=require(_0xca10('0xe'));var toCsv=require(_0xca10('0x9'));var querystring=require('querystring');var Papa=require(_0xca10('0xf'));var Redis=require(_0xca10('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0xca10('0x11'));var logger=require(_0xca10('0x12'))(_0xca10('0x13'));var utils=require(_0xca10('0x14'));var config=require(_0xca10('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xca10('0x16')]=_[_0xca10('0x17')](config[_0xca10('0x16')],{'host':_0xca10('0x18'),'port':0x18eb});var socket=require(_0xca10('0x19'))(new Redis(config[_0xca10('0x16')]));require('./openchannelInteraction.socket')[_0xca10('0x1a')](socket);function respondWithStatusCode(_0x5c3909,_0x14400f){_0x14400f=_0x14400f||0xcc;return function(_0xb452f8){if(_0xb452f8){return _0x5c3909['sendStatus'](_0x14400f);}return _0x5c3909[_0xca10('0x1b')](_0x14400f)['end']();};}function respondWithResult(_0x568389,_0x55f4fa){_0x55f4fa=_0x55f4fa||0xc8;return function(_0x131f76){if(_0x131f76){return _0x568389[_0xca10('0x1b')](_0x55f4fa)['json'](_0x131f76);}};}function respondWithFilteredResult(_0x5533fc,_0x196eb6){return function(_0x18a24f){if(_0x18a24f){var _0x23dd0f=typeof _0x196eb6[_0xca10('0x1c')]===_0xca10('0x1d')&&typeof _0x196eb6[_0xca10('0x1e')]===_0xca10('0x1d');var _0x30c5eb=_0x18a24f[_0xca10('0x1f')];var _0x2c6f1d=_0x23dd0f?0x0:_0x196eb6[_0xca10('0x1c')];var _0x5b6ec7=_0x23dd0f?_0x18a24f['count']:_0x196eb6[_0xca10('0x1c')]+_0x196eb6[_0xca10('0x1e')];var _0x42bd65;if(_0x5b6ec7>=_0x30c5eb){_0x5b6ec7=_0x30c5eb;_0x42bd65=0xc8;}else{_0x42bd65=0xce;}_0x5533fc['status'](_0x42bd65);return _0x5533fc['set'](_0xca10('0x20'),_0x2c6f1d+'-'+_0x5b6ec7+'/'+_0x30c5eb)['json'](_0x18a24f);}return null;};}function patchUpdates(_0x5afa03){return function(_0x273f26){try{jsonpatch[_0xca10('0x21')](_0x273f26,_0x5afa03,!![]);}catch(_0x58695e){return BPromise[_0xca10('0x22')](_0x58695e);}return _0x273f26['save']();};}function saveUpdates(_0x3c6e75,_0x50da2a){return function(_0x19978c){if(_0x19978c){return _0x19978c[_0xca10('0x23')](_0x3c6e75)[_0xca10('0x24')](function(_0x30eb9){return _0x30eb9;});}return null;};}function removeEntity(_0x2c77a1,_0x31d9c5){return function(_0x3c5bb9){if(_0x3c5bb9){return _0x3c5bb9['destroy']()['then'](function(){_0x2c77a1[_0xca10('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x485192,_0x3d78da){return function(_0xf30b00){if(!_0xf30b00){_0x485192[_0xca10('0x25')](0x194);}return _0xf30b00;};}function handleError(_0x4beabb,_0x2fe696){_0x2fe696=_0x2fe696||0x1f4;return function(_0x823435){logger[_0xca10('0x26')](_0x823435[_0xca10('0x27')]);if(_0x823435[_0xca10('0x28')]){delete _0x823435['name'];}_0x4beabb['status'](_0x2fe696)['send'](_0x823435);};}function getInteractionUsers(_0x32890b,_0x15bac4){return new BPromise(function(_0x28f3e2,_0x268899){try{if(_0x15bac4[_0x32890b['id']]){_0x32890b[_0xca10('0x29')]=_['map'](_0x15bac4[_0x32890b['id']],function(_0x46319c){return{'id':_0x46319c['id'],'fullname':_0x46319c[_0xca10('0x2a')]};});}}catch(_0xc19fff){_0x268899(_0xc19fff);}_0x28f3e2(_0x32890b);});}function getInteractionTags(_0x482f65,_0x5b1d04){return new BPromise(function(_0x46ced5,_0x209956){try{if(_0x482f65['TagIds']){_0x482f65[_0xca10('0x2b')]=[];_0x482f65[_0xca10('0x2c')][_0xca10('0x2d')](',')['forEach'](function(_0x4c6930){_0x482f65[_0xca10('0x2b')][_0xca10('0x2e')](_0x5b1d04[_0x4c6930]);});}delete _0x482f65['TagIds'];}catch(_0x203f55){_0x209956(_0x203f55);}_0x46ced5(_0x482f65);});}function updateOpenchannelInteraction(_0x35b0e4,_0x51e06f,_0x301792){return new BPromise(function(_0x1963a4,_0x594ec5){return getInteractionUsers(_0x35b0e4,_0x301792)['then'](function(_0x33b852){return getInteractionTags(_0x33b852,_0x51e06f);})[_0xca10('0x24')](function(_0xa8f69){return getStateInteraction(_0xa8f69);})[_0xca10('0x24')](function(_0x52ae50){_0x1963a4(_0x52ae50);})[_0xca10('0x2f')](function(_0xe21fd7){_0x594ec5(_0xe21fd7);});});}function getStateInteraction(_0x113423){return new BPromise(function(_0x5f0bed){_0x113423[_0xca10('0x30')]=0x0;_0x113423[_0xca10('0x31')]=0x0;_0x113423[_0xca10('0x32')]=0x0;_0x113423[_0xca10('0x33')]=0x0;_0x113423['total']=0x0;if(!_0x113423[_0xca10('0x34')]&&!_0x113423[_0xca10('0x35')]){_0x113423['waiting']+=0x1;}if(!_0x113423['closed']&&_0x113423['UserId']){_0x113423[_0xca10('0x31')]+=0x1;ids[_0xca10('0x2e')](_0x113423['id']);if(_0x113423[_0xca10('0x30')]){_0x113423[_0xca10('0x30')]-=0x1;}}if(_0x113423[_0xca10('0x34')]&&_0x113423[_0xca10('0x35')]){_0x113423[_0xca10('0x32')]+=0x1;if(_0x113423['talking']){_0x113423[_0xca10('0x31')]-=0x1;}}if(_0x113423['closed']&&!_0x113423[_0xca10('0x35')]){_0x113423[_0xca10('0x33')]+=0x1;if(_0x113423['waiting']){_0x113423['waiting']-=0x1;}}_0x113423['total']+=0x1;_0x5f0bed(_0x113423);});}exports[_0xca10('0x36')]=function(_0x5cdb34,_0x4cdb91){var _0x48c3ce={},_0x198dcc={},_0x3d1692={'count':0x0,'rows':[]};var _0x1163d9=_[_0xca10('0x37')](db['OpenchannelInteraction']['rawAttributes'],function(_0xd422a7){return{'name':_0xd422a7['fieldName'],'type':_0xd422a7[_0xca10('0x38')][_0xca10('0x39')]};});_0x198dcc['model']=_[_0xca10('0x37')](_0x1163d9,'name');_0x198dcc[_0xca10('0x3a')]=_['keys'](_0x5cdb34[_0xca10('0x3a')]);_0x198dcc['filters']=_[_0xca10('0x3b')](_0x198dcc['model'],_0x198dcc[_0xca10('0x3a')]);_0x48c3ce[_0xca10('0x3c')]=_[_0xca10('0x3b')](_0x198dcc[_0xca10('0x3d')],qs[_0xca10('0x3e')](_0x5cdb34['query'][_0xca10('0x3e')]));_0x48c3ce[_0xca10('0x3c')]=_0x48c3ce[_0xca10('0x3c')][_0xca10('0x3f')]?_0x48c3ce[_0xca10('0x3c')]:_0x198dcc[_0xca10('0x3d')];if(!_0x5cdb34[_0xca10('0x3a')][_0xca10('0x40')](_0xca10('0x41'))){_0x48c3ce['limit']=qs['limit'](_0x5cdb34[_0xca10('0x3a')][_0xca10('0x1e')]);_0x48c3ce[_0xca10('0x1c')]=qs['offset'](_0x5cdb34[_0xca10('0x3a')][_0xca10('0x1c')]);}_0x48c3ce['order']=qs[_0xca10('0x42')](_0x5cdb34[_0xca10('0x3a')][_0xca10('0x42')]);_0x48c3ce[_0xca10('0x43')]=qs['filters'](_[_0xca10('0x44')](_0x5cdb34[_0xca10('0x3a')],_0x198dcc[_0xca10('0x45')]),_0x1163d9);var _0x428082=[];var _0x5cbc4b=squel[_0xca10('0x46')]()[_0xca10('0x47')]('id')[_0xca10('0x47')](_0xca10('0x28'))['field'](_0xca10('0x48'))[_0xca10('0x49')](_0xca10('0x4a'));var _0x6bff85=squel['select']()[_0xca10('0x47')](_0xca10('0x4b'))[_0xca10('0x47')](_0xca10('0x4c'))['field']('ui.OpenchannelInteractionId')[_0xca10('0x49')](_0xca10('0x4d'),'ui')[_0xca10('0x4e')]('users','u',_0xca10('0x4f'));var _0x5d4985=squel[_0xca10('0x46')]()[_0xca10('0x49')]('openchannel_interactions','i')[_0xca10('0x4e')](_0xca10('0x50'),'c',_0xca10('0x51'))[_0xca10('0x4e')](_0xca10('0x52'),'o',_0xca10('0x53'))[_0xca10('0x4e')](_0xca10('0x54'),'a',_0xca10('0x55'))['left_join'](_0xca10('0x56'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0xca10('0x4e')]('openchannel_interaction_has_tags','it',_0xca10('0x57'))['left_join'](_0xca10('0x4a'),'t',_0xca10('0x58'));var _0x3efe76=squel['expr']();var _0x3b121f=[];var _0x1f0649=squel[_0xca10('0x59')]();var _0x5dfa15;if(_0x5cdb34[_0xca10('0x3a')][_0xca10('0x5a')]){_0x5dfa15=as[_0xca10('0x5b')](_0x5cdb34[_0xca10('0x3a')][_0xca10('0x5a')]);var _0x1772a0=_0x5dfa15[_0xca10('0x5c')];for(var _0x2e773a=0x0;_0x2e773a<_0x5dfa15[_0xca10('0x5d')]['length'];_0x2e773a++){var _0x301ba0=_0x5dfa15[_0xca10('0x5d')][_0x2e773a];var _0x5226e3='i';var _0x25dc15=_['find'](_0x1163d9,[_0xca10('0x28'),_0x301ba0['field']]);if(!_0x25dc15){switch(_0x301ba0[_0xca10('0x47')]){case _0xca10('0x5e'):if(_0x301ba0[_0xca10('0x5f')]==0x1){_0x5d4985['having']('`'+_0x301ba0[_0xca10('0x47')]+_0xca10('0x60'));}else{_0x5d4985[_0xca10('0x61')]('`'+_0x301ba0['field']+_0xca10('0x62'));}break;case _0xca10('0x63'):if(_0x301ba0[_0xca10('0x64')]===_0xca10('0x65')){if(_0x301ba0[_0xca10('0x5f')][_0xca10('0x2d')]('\x20')[_0xca10('0x3f')]>0x1){_0x3efe76[_0x1772a0](_0xca10('0x66'),qs[_0xca10('0x67')](_0x301ba0[_0xca10('0x5f')]),null);}else{var _0x459de7='%'+_0x301ba0[_0xca10('0x5f')]+'%';_0x3efe76[_0x1772a0](_0xca10('0x68'),_0x459de7,_0x459de7,_0x459de7);}}else{_0x25dc15=_[_0xca10('0x69')](_0x1163d9,['name','ContactId']);_0x301ba0[_0xca10('0x47')]=_0xca10('0x6a');_0x405fe8=as[_0xca10('0x6b')](_0x5226e3,_0x25dc15[_0xca10('0x38')],_0x301ba0);_0x3efe76[_0x1772a0](_0x405fe8[_0xca10('0x6c')],_0x405fe8[_0xca10('0x5f')][_0xca10('0x6d')],_0x405fe8[_0xca10('0x5f')][_0xca10('0x6e')]);}break;case _0xca10('0x6f'):var _0x3bc5e2=_0x301ba0[_0xca10('0x5f')]['split'](',')['map'](function(_0x583af4){return Number(_0x583af4);});_0x3bc5e2[_0xca10('0x70')](function(_0x4ab862){_0x1f0649['or'](_0xca10('0x71'),'%,'+_0x4ab862+',%');});_0x3b121f=_[_0xca10('0x72')](_0x3b121f,_0x3bc5e2);break;case _0xca10('0x73'):if(_0x301ba0['operator']===_0xca10('0x65')){_0x3efe76[_0x1772a0](_0xca10('0x74'),'%'+_0x301ba0[_0xca10('0x5f')]+'%',null);}else{_0x25dc15=_[_0xca10('0x69')](_0x1163d9,['name',_0xca10('0x35')]);_0x301ba0[_0xca10('0x47')]=_0xca10('0x35');_0x405fe8=as['buildExpression'](_0x5226e3,_0x25dc15[_0xca10('0x38')],_0x301ba0);_0x3efe76[_0x1772a0](_0x405fe8[_0xca10('0x6c')],_0x405fe8[_0xca10('0x5f')][_0xca10('0x6d')],_0x405fe8['value'][_0xca10('0x6e')]);}break;case'body':_0x405fe8=as[_0xca10('0x6b')]('me',null,_0x301ba0);_0x3efe76[_0x1772a0](_0x405fe8[_0xca10('0x6c')],_0x405fe8[_0xca10('0x5f')][_0xca10('0x6d')],_0x405fe8['value'][_0xca10('0x6e')]);break;}}else{var _0x405fe8=as[_0xca10('0x6b')](_0x5226e3,_0x25dc15[_0xca10('0x38')],_0x301ba0);_0x3efe76[_0x1772a0](_0x405fe8[_0xca10('0x6c')],_0x405fe8[_0xca10('0x5f')][_0xca10('0x6d')],_0x405fe8[_0xca10('0x5f')][_0xca10('0x6e')]);}}}else{var _0x27b1f2=_(_0x5cdb34[_0xca10('0x3a')])[_0xca10('0x75')]()[_0xca10('0x37')](function(_0x4c786a){return _['some'](_0x1163d9,[_0xca10('0x28'),_0x4c786a])?_0x4c786a:undefined;})[_0xca10('0x76')]()[_0xca10('0x5f')]();if(!_['isEmpty'](_0x27b1f2)){_0x27b1f2[_0xca10('0x70')](function(_0x2b8ce9){if(_0x2b8ce9===_0xca10('0x77')){_0x5d4985[_0xca10('0x43')](_0xca10('0x78'),[]['concat'](_0x5cdb34[_0xca10('0x3a')][_0x2b8ce9]));}else if(_0x2b8ce9===_0xca10('0x79')){var _0x2eb192=JSON[_0xca10('0x7a')](_0x5cdb34['query'][_0x2b8ce9])[_0xca10('0x7b')];var _0x2f9bad=JSON[_0xca10('0x7a')](_0x5cdb34[_0xca10('0x3a')][_0x2b8ce9])[_0xca10('0x7c')];_0x5d4985[_0xca10('0x43')](_0xca10('0x7d'),_0x2eb192,_0x2f9bad);}else{if(_0x5cdb34['query'][_0x2b8ce9]===_0xca10('0x7e')){_0x5d4985['where']('i.'+_0x2b8ce9+_0xca10('0x7f'));}else{_0x5d4985[_0xca10('0x43')]('i.'+_0x2b8ce9+'\x20=\x20?',_0x5cdb34[_0xca10('0x3a')][_0x2b8ce9]);}}});}if(_0x5cdb34['query'][_0xca10('0x80')]){if(_0x5cdb34[_0xca10('0x3a')][_0xca10('0x80')]==0x1){_0x5d4985[_0xca10('0x61')]('`unreadMessages`\x20=\x200');}else{_0x5d4985[_0xca10('0x61')]('`unreadMessages`\x20>\x200');}}if(_0x5cdb34[_0xca10('0x3a')][_0xca10('0x81')]){_0x3b121f=_[_0xca10('0x82')](_0x5cdb34[_0xca10('0x3a')][_0xca10('0x81')])?_0x5cdb34[_0xca10('0x3a')][_0xca10('0x81')]:new Array(_0x5cdb34[_0xca10('0x3a')][_0xca10('0x81')]);_0x3b121f[_0xca10('0x70')](function(_0x3c76f1){_0x1f0649['or'](_0xca10('0x71'),'%,'+_0x3c76f1+',%');});}if(_0x5cdb34['query'][_0xca10('0x83')]){var _0x64edc=_0x5cdb34[_0xca10('0x3a')][_0xca10('0x83')][_0xca10('0x84')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xca10('0x85')](_0x64edc)){_0x3efe76['or'](_0xca10('0x86'),_0x64edc+'%');}else{_0x3efe76['or'](_0xca10('0x87'),qs[_0xca10('0x67')](_0x64edc))['or']('i.from\x20LIKE\x20?',_0x64edc+'%')['or'](_0xca10('0x88'),_0x64edc+'%');}}}_0x5d4985[_0xca10('0x43')](_0x3efe76);_0x5d4985[_0xca10('0x89')]('i.id');var _0x24a12c={'type':db[_0xca10('0x8a')]['QueryTypes'][_0xca10('0x8b')],'raw':!![]};var _0x4c0a90=_0x5d4985[_0xca10('0x8c')]();_0x4c0a90[_0xca10('0x47')](_0xca10('0x8d'));_0x4c0a90[_0xca10('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xca10('0x5e'));if(_0x48c3ce[_0xca10('0x8e')]){_0x48c3ce[_0xca10('0x8e')][_0xca10('0x70')](function(_0x3d856f){var _0x12655d=_0x3d856f[0x0]===_0xca10('0x8f')?_0x3d856f[0x0]:'i.'+_0x3d856f[0x0];_0x5d4985['order'](_0x12655d,_0x3d856f[0x1]===_0xca10('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x3b121f)){_0x5d4985[_0xca10('0x61')](_0x1f0649);_0x4c0a90[_0xca10('0x43')]('t.id\x20IN\x20?',_0x3b121f);}BPromise[_0xca10('0x91')]()[_0xca10('0x24')](function(){if(!_0x5dfa15){if(_0x5cdb34['query'][_0xca10('0x77')])return;_0x4c0a90[_0xca10('0x43')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x5d4985[_0xca10('0x43')](_0xca10('0x92'));return;}if(_0x5cdb34[_0xca10('0x93')]['role']!==_0xca10('0x94'))return;return _0x5cdb34[_0xca10('0x93')][_0xca10('0x95')]({'attributes':['id'],'raw':!![]})['then'](function(_0x116898){if(_[_0xca10('0x96')](_0x116898)){_0x4c0a90[_0xca10('0x43')](_0xca10('0x97'));_0x5d4985[_0xca10('0x43')](_0xca10('0x97'));}else{_0x4c0a90[_0xca10('0x43')](_0xca10('0x78'),_[_0xca10('0x37')](_0x116898,'id'));_0x5d4985['where'](_0xca10('0x78'),_[_0xca10('0x37')](_0x116898,'id'));}});})[_0xca10('0x24')](function(){if(_0x5cdb34['user'][_0xca10('0x98')]===_0xca10('0x94')&&!_0x5dfa15&&!_0x5cdb34[_0xca10('0x3a')][_0xca10('0x77')])return[];return db[_0xca10('0x99')][_0xca10('0x3a')](_0x4c0a90[_0xca10('0x9a')](),_0x24a12c);})[_0xca10('0x24')](function(_0x29bdf0){_0x3d1692[_0xca10('0x1f')]=_0x29bdf0[_0xca10('0x3f')];if(_0x3d1692[_0xca10('0x1f')]===0x0)return[];return db[_0xca10('0x99')][_0xca10('0x3a')](_0x5cbc4b[_0xca10('0x9a')](),_0x24a12c)[_0xca10('0x24')](function(_0x344a41){_0x428082=_[_0xca10('0x9b')](_0x344a41,'id');_0x24a12c=_[_0xca10('0x9c')](_0x24a12c,{'model':db[_0xca10('0x9d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5cdb34[_0xca10('0x3a')][_0xca10('0x3e')]){_0x48c3ce['attributes'][_0xca10('0x70')](function(_0x3ea947){_0x5d4985[_0xca10('0x47')]('i.'+_0x3ea947);});}else{_0x5d4985[_0xca10('0x47')](_0xca10('0x9e'),_0xca10('0x5e'));_0x5d4985[_0xca10('0x47')]('a.key',_0xca10('0x9f'));_0x5d4985[_0xca10('0x47')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x5d4985['field'](_0xca10('0xa0'),_0xca10('0x8f'));_0x5d4985[_0xca10('0x47')]('i.*');_0x5d4985[_0xca10('0x47')](_0xca10('0xa1'),_0xca10('0xa2'));_0x5d4985[_0xca10('0x47')](_0xca10('0xa3'),_0xca10('0xa4'));_0x5d4985[_0xca10('0x47')](_0xca10('0xa5'),_0xca10('0xa6'));_0x5d4985[_0xca10('0x47')]('c.phone',_0xca10('0xa7'));_0x5d4985[_0xca10('0x47')](_0xca10('0xa8'),_0xca10('0xa9'));_0x5d4985[_0xca10('0x47')](_0xca10('0xaa'),_0xca10('0xab'));_0x5d4985[_0xca10('0x47')](_0xca10('0xac'),_0xca10('0xad'));_0x5d4985[_0xca10('0x47')](_0xca10('0xae'),_0xca10('0xaf'));_0x5d4985[_0xca10('0x47')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x48c3ce['limit'])_0x5d4985[_0xca10('0x1e')](_0x48c3ce[_0xca10('0x1e')]);if(_0x48c3ce[_0xca10('0x1c')])_0x5d4985[_0xca10('0x1c')](_0x48c3ce[_0xca10('0x1c')]);return db[_0xca10('0x99')][_0xca10('0x3a')](_0x5d4985[_0xca10('0x9a')](),_0x24a12c);})[_0xca10('0x24')](function(_0x255013){if(_0x255013['length']>0x0)_0x6bff85[_0xca10('0x43')](_0xca10('0xb0'),_[_0xca10('0x37')](_0x255013,'id'));return db[_0xca10('0x99')][_0xca10('0x3a')](_0x6bff85[_0xca10('0x9a')](),_0x24a12c)[_0xca10('0x24')](function(_0x591cfd){var _0x1254a6=_['groupBy'](_0x591cfd,_0xca10('0xb1'));var _0x2b2e1c=[];_0x255013['forEach'](function(_0x3e229d){_0x2b2e1c['push'](updateOpenchannelInteraction(_0x3e229d,_0x428082,_0x1254a6));});return BPromise[_0xca10('0xb2')](_0x2b2e1c);});});})['then'](function(_0x2f216d){_0x3d1692[_0xca10('0xb3')]=_0x2f216d;return _0x3d1692;})[_0xca10('0x24')](respondWithFilteredResult(_0x4cdb91,_0x48c3ce))['catch'](handleError(_0x4cdb91,null));};exports[_0xca10('0xb4')]=function(_0x278be9,_0x24da3e){var _0x45e249={};if(_0x278be9[_0xca10('0x3a')][_0xca10('0x38')]&&_0x278be9[_0xca10('0x3a')][_0xca10('0x38')]==='from'){_0x45e249[_0xca10('0x49')]=_0x278be9[_0xca10('0xb5')]['id'];}else{_0x45e249['id']=_0x278be9['params']['id'];}var _0x16897f={'raw':![],'where':_0x45e249},_0x5a01ba={};_0x5a01ba['model']=_[_0xca10('0x75')](db[_0xca10('0x9d')][_0xca10('0xb6')]);_0x5a01ba[_0xca10('0x3a')]=_[_0xca10('0x75')](_0x278be9[_0xca10('0x3a')]);_0x5a01ba[_0xca10('0x45')]=_[_0xca10('0x3b')](_0x5a01ba[_0xca10('0x3d')],_0x5a01ba[_0xca10('0x3a')]);_0x16897f['attributes']=_[_0xca10('0x3b')](_0x5a01ba[_0xca10('0x3d')],qs[_0xca10('0x3e')](_0x278be9[_0xca10('0x3a')][_0xca10('0x3e')]));_0x16897f[_0xca10('0x3c')]=_0x16897f['attributes'][_0xca10('0x3f')]?_0x16897f[_0xca10('0x3c')]:_0x5a01ba['model'];if(_0x278be9[_0xca10('0x3a')]['includeAll']){_0x16897f[_0xca10('0xb7')]=[{'all':!![]}];}_0x16897f=_[_0xca10('0x9c')]({},_0x16897f,_0x278be9['options']);return db[_0xca10('0x9d')]['find'](_0x16897f)[_0xca10('0x24')](handleEntityNotFound(_0x24da3e,null))['then'](respondWithResult(_0x24da3e,null))[_0xca10('0x2f')](handleError(_0x24da3e,null));};exports[_0xca10('0xb8')]=function(_0x260f5a,_0x3c02fd){return db[_0xca10('0x9d')][_0xca10('0xb8')](_0x260f5a[_0xca10('0xb9')],{})[_0xca10('0x24')](respondWithResult(_0x3c02fd,0xc9))[_0xca10('0x2f')](handleError(_0x3c02fd,null));};exports[_0xca10('0x23')]=function(_0x4303db,_0x16a9f3){if(_0x4303db[_0xca10('0xb9')]['id']){delete _0x4303db[_0xca10('0xb9')]['id'];}return db[_0xca10('0x9d')]['find']({'where':{'id':_0x4303db[_0xca10('0xb5')]['id']}})[_0xca10('0x24')](handleEntityNotFound(_0x16a9f3,null))[_0xca10('0x24')](saveUpdates(_0x4303db['body'],null))[_0xca10('0x24')](respondWithResult(_0x16a9f3,null))[_0xca10('0x2f')](handleError(_0x16a9f3,null));};exports[_0xca10('0xba')]=function(_0x6c2788,_0xe1afa9){return db[_0xca10('0x9d')]['find']({'where':{'id':_0x6c2788['params']['id']}})[_0xca10('0x24')](handleEntityNotFound(_0xe1afa9,null))[_0xca10('0x24')](removeEntity(_0xe1afa9,null))[_0xca10('0x2f')](handleError(_0xe1afa9,null));};exports[_0xca10('0xbb')]=function(_0x35d10e,_0x572e5d){return db[_0xca10('0x9d')][_0xca10('0xbb')]()['then'](respondWithResult(_0x572e5d,null))[_0xca10('0x2f')](handleError(_0x572e5d,null));};exports[_0xca10('0xbc')]=function(_0x576565,_0x39f2bf,_0x2571be){return db['OpenchannelMessage'][_0xca10('0x69')]({'where':{'id':_0x576565[_0xca10('0xb5')]['id']}})[_0xca10('0x24')](handleEntityNotFound(_0x39f2bf,null))[_0xca10('0x24')](function(_0x23b136){if(_0x23b136){return _0x23b136[_0xca10('0xbc')](_0x576565[_0xca10('0xb9')][_0xca10('0xbd')],_[_0xca10('0xbe')](_0x576565[_0xca10('0xb9')],[_0xca10('0xbd'),'id'])||{});}})[_0xca10('0x24')](respondWithResult(_0x39f2bf,null))[_0xca10('0x2f')](handleError(_0x39f2bf,null));};exports[_0xca10('0xbf')]=function(_0x543f82,_0x49664f,_0x56f1a9){var _0x31734d={'raw':![],'where':{}};var _0x5429dc={};var _0x307565={'count':0x0,'rows':[]};return db[_0xca10('0x9d')][_0xca10('0xc0')]({'where':{'id':_0x543f82[_0xca10('0xb5')]['id']}})['then'](handleEntityNotFound(_0x49664f,null))[_0xca10('0x24')](function(_0x2d9b7a){if(_0x2d9b7a){_0x5429dc[_0xca10('0x3d')]=_[_0xca10('0x75')](db['OpenchannelMessage'][_0xca10('0xb6')]);_0x5429dc[_0xca10('0x3a')]=_['keys'](_0x543f82['query']);_0x5429dc[_0xca10('0x45')]=_[_0xca10('0x3b')](_0x5429dc[_0xca10('0x3d')],_0x5429dc['query']);_0x31734d[_0xca10('0x3c')]=_[_0xca10('0x3b')](_0x5429dc[_0xca10('0x3d')],qs[_0xca10('0x3e')](_0x543f82[_0xca10('0x3a')][_0xca10('0x3e')]));_0x31734d[_0xca10('0x3c')]=_0x31734d[_0xca10('0x3c')]['length']?_0x31734d['attributes']:_0x5429dc[_0xca10('0x3d')];if(!_0x543f82[_0xca10('0x3a')][_0xca10('0x40')](_0xca10('0x41'))){_0x31734d[_0xca10('0x1e')]=qs[_0xca10('0x1e')](_0x543f82[_0xca10('0x3a')][_0xca10('0x1e')]);_0x31734d['offset']=qs['offset'](_0x543f82[_0xca10('0x3a')]['offset']);}_0x31734d[_0xca10('0x8e')]=qs[_0xca10('0x42')](_0x543f82[_0xca10('0x3a')][_0xca10('0x42')]);_0x31734d[_0xca10('0x43')]=qs['filters'](_['pick'](_0x543f82[_0xca10('0x3a')],_0x5429dc['filters']));_0x31734d['where'][_0xca10('0xb1')]=_0x2d9b7a['id'];if(_0x543f82['query'][_0xca10('0x83')]){_0x31734d[_0xca10('0x43')]=_[_0xca10('0x9c')](_0x31734d['where'],{'$or':_[_0xca10('0x37')](_0x31734d['attributes'],function(_0x3a38e6){var _0x973a0={};_0x973a0[_0x3a38e6]={'$like':'%'+_0x543f82[_0xca10('0x3a')]['filter']+'%'};return _0x973a0;})});}if(_0x543f82[_0xca10('0x3a')][_0xca10('0x7b')]){var _0x474589=_0x543f82[_0xca10('0x3a')][_0xca10('0x7b')][_0xca10('0x2d')](',');var _0x395929={};_0x395929[_0x474589[0x0]]={'$gte':moment(_0x474589[0x1])[_0xca10('0xc1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x31734d[_0xca10('0x43')]=_[_0xca10('0x9c')](_0x31734d['where'],_0x395929);}_0x31734d=_[_0xca10('0x9c')]({},_0x31734d,_0x543f82[_0xca10('0xc2')]);return db[_0xca10('0xc3')][_0xca10('0x1f')]({'where':_0x31734d[_0xca10('0x43')]})[_0xca10('0x24')](function(_0xc74b60){_0x307565['count']=_0xc74b60;if(_0x543f82['query']['includeAll']){_0x31734d[_0xca10('0xb7')]=[{'all':!![]}];}return db[_0xca10('0xc3')]['findAll'](_0x31734d);})[_0xca10('0x24')](function(_0x2ef503){_0x307565[_0xca10('0xb3')]=_0x2ef503;return _0x307565;});}})[_0xca10('0x24')](respondWithFilteredResult(_0x49664f,_0x31734d))[_0xca10('0x2f')](handleError(_0x49664f,null));};exports['addTags']=function(_0x454007,_0x59bcb5,_0x5a0bca){return db['OpenchannelInteraction'][_0xca10('0x69')]({'where':{'id':_0x454007['params']['id']}})['then'](handleEntityNotFound(_0x59bcb5,null))[_0xca10('0x24')](function(_0x36fe79){if(_0x36fe79){return _0x36fe79[_0xca10('0xc4')](_0x454007[_0xca10('0xb9')][_0xca10('0xbd')],_[_0xca10('0xbe')](_0x454007[_0xca10('0xb9')],[_0xca10('0xbd'),'id'])||{})[_0xca10('0xc5')](function(){return db[_0xca10('0x6f')][_0xca10('0xc6')]({'attributes':['id',_0xca10('0x28'),_0xca10('0x48')],'where':{'id':_0x454007['body'][_0xca10('0xbd')]}});})[_0xca10('0x24')](function(_0x47d67c){socket[_0xca10('0xc7')]('openchannelInteractionTags:save',{'id':Number(_0x454007[_0xca10('0xb5')]['id']),'tags':_0x47d67c||[]});return{'id':Number(_0x454007[_0xca10('0xb5')]['id']),'tags':_0x47d67c||[]};});}})['then'](respondWithResult(_0x59bcb5,null))['catch'](handleError(_0x59bcb5,null));};exports[_0xca10('0xc8')]=function(_0x30de2f,_0x28e563,_0x2c6942){return db[_0xca10('0x9d')]['find']({'where':{'id':_0x30de2f[_0xca10('0xb5')]['id']}})[_0xca10('0x24')](handleEntityNotFound(_0x28e563,null))[_0xca10('0x24')](function(_0x2fdf25){if(_0x2fdf25){return _0x2fdf25[_0xca10('0xc8')](_0x30de2f[_0xca10('0x3a')][_0xca10('0xbd')]);}})[_0xca10('0x24')](respondWithStatusCode(_0x28e563,null))[_0xca10('0x2f')](handleError(_0x28e563,null));};exports['download']=function(_0x2fba6a,_0x3682e3){var _0x22aa40=moment()[_0xca10('0xc9')]()[_0xca10('0x9a')]();var _0x421065=path[_0xca10('0xca')](config[_0xca10('0xcb')],_0xca10('0xcc'),_0xca10('0xcd'),_0xca10('0xce'));var _0x307396=path['join'](config[_0xca10('0xcb')],'server','files',_0xca10('0xcf'));var _0xf270ae=path[_0xca10('0xca')](_0x421065,_0x22aa40);var _0x1fe322=util['format'](_0xca10('0xd0'),_0x2fba6a[_0xca10('0xb5')]['id'],_0x22aa40);var _0x5a6823=path[_0xca10('0xca')](_0x421065,_0x1fe322);var _0x2115e5=[];_0x2115e5['push']({'model':db[_0xca10('0x73')],'as':'User','attributes':['id',_0xca10('0x2a')],'raw':!![]});_0x2115e5[_0xca10('0x2e')]({'model':db[_0xca10('0xd1')],'as':'Contact','attributes':['id','firstName',_0xca10('0xd2')],'raw':!![]});if(_0x2fba6a[_0xca10('0x3a')]['attachments']){_0x2115e5[_0xca10('0x2e')]({'model':db[_0xca10('0xd3')],'as':_0xca10('0xd3'),'raw':!![]});}var _0x9757fd=[{'model':db[_0xca10('0xc3')],'as':_0xca10('0xd4'),'attributes':['id',_0xca10('0xb9'),_0xca10('0x79'),'direction',_0xca10('0xd5'),'read'],'include':_0x2115e5}];_0x9757fd[_0xca10('0x2e')]({'model':db[_0xca10('0xd6')],'as':_0xca10('0xd7'),'attributes':['id','name']});_0x9757fd[_0xca10('0x2e')]({'model':db['User'],'as':_0xca10('0xd8'),'attributes':['id','fullname']});return db[_0xca10('0x9d')][_0xca10('0x69')]({'where':{'id':_0x2fba6a['params']['id']},'include':_0x9757fd})['then'](handleEntityNotFound(_0x3682e3,null))['then'](function(_0x4073b1){if(_0x4073b1){var _0x32afe8=_0x4073b1[_0xca10('0xd9')]({'plain':!![]});fs[_0xca10('0xda')](_0xf270ae);var _0xc38a80={'channel':_0xca10('0xdb'),'account':_0x32afe8['Account'][_0xca10('0x28')],'agent':_0x32afe8[_0xca10('0xd8')]?_0x32afe8[_0xca10('0xd8')]['fullname']:_0xca10('0xdc'),'createdAt':moment(_0x32afe8[_0xca10('0x79')])[_0xca10('0xc1')](_0xca10('0xdd'))[_0xca10('0x9a')](),'closedAt':_0x32afe8[_0xca10('0x34')]?moment(_0x32afe8['closedAt'])[_0xca10('0xc1')]('YYYY-MM-DD\x20HH:mm:ss')[_0xca10('0x9a')]():'','disposition':_0x32afe8[_0xca10('0xde')],'visibility':_0x32afe8['threadId']?'Public':_0xca10('0xdf'),'messages':_(_0x32afe8[_0xca10('0xd4')])[_0xca10('0x83')]({'secret':![]})[_0xca10('0x37')](function(_0x21ba8b){if(_0x21ba8b[_0xca10('0xd3')]){var _0x18004c=path[_0xca10('0xca')](_0x307396,_0x21ba8b[_0xca10('0xd3')][_0xca10('0xe0')]);if(fs['existsSync'](_0x18004c)){fs[_0xca10('0xe1')](_0x18004c)[_0xca10('0xe2')](fs[_0xca10('0xe3')](path[_0xca10('0xca')](_0xf270ae,_0x21ba8b[_0xca10('0xd3')][_0xca10('0xe0')])));}}return{'date':moment(_0x21ba8b['createdAt'])['format'](_0xca10('0xdd'))['toString'](),'sender':_0x21ba8b[_0xca10('0xe4')]===_0xca10('0xe5')?_0x21ba8b[_0xca10('0x73')]?_0x21ba8b[_0xca10('0x73')][_0xca10('0x2a')]:'System':_0x21ba8b[_0xca10('0x63')][_0xca10('0xe6')]+(_0x21ba8b['Contact']['lastName']?'\x20'+_0x21ba8b[_0xca10('0x63')]['lastName']:''),'body':_0x21ba8b[_0xca10('0xd3')]?_0x21ba8b['Attachment'][_0xca10('0xe0')]:_0x21ba8b['body'],'direction':_0x21ba8b[_0xca10('0xe4')]===_0xca10('0xe5')?'A':'C','secret':_0x21ba8b['secret'],'read':_0x21ba8b[_0xca10('0x80')],'attachment':_0x21ba8b[_0xca10('0xd3')]};})[_0xca10('0x5f')]()};return ejs[_0xca10('0xe7')](path[_0xca10('0xca')](config[_0xca10('0xcb')],_0xca10('0xcc'),_0xca10('0xe8'),_0xca10('0xe9')),{'interaction':_0xc38a80})[_0xca10('0x24')](function(_0x59ccde){var _0x365954=path['join'](_0xf270ae,_0xca10('0xea')+_0x32afe8['id']+'-'+_0x22aa40+_0xca10('0xeb'));var _0x499f4e={'path':_0x365954,'channel':_0xca10('0xdb'),'interactionId':_0x32afe8['id']};return pdf[_0xca10('0xec')](_0x59ccde,_0x499f4e);})[_0xca10('0x24')](function(){return new BPromise(function(_0x2db37f,_0x209b49){zipdir(_0xf270ae,{'saveTo':_0x5a6823},function(_0x47463c,_0x428ee1){if(_0x47463c)return _0x209b49(_0x47463c);return _0x2db37f(_0x428ee1);});})[_0xca10('0x24')](function(){return new BPromise(function(_0x157a0a,_0x4f670d){rimraf(_0xf270ae,function(_0xb225d4){if(_0xb225d4)_0x4f670d(_0xb225d4);return _0x157a0a();});});})['then'](function(){return _0x3682e3['download'](_0x5a6823,_0x1fe322,function(_0x4bd099){if(_0x4bd099){console[_0xca10('0xed')]('err',_0x4bd099);}else{fs[_0xca10('0xee')](_0x5a6823);}});});});}else{return _0x3682e3[_0xca10('0x25')](0xc8);}})['catch'](handleError(_0x3682e3,null));}; \ No newline at end of file +var _0xf1ed=['length','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','start','body','some','compact','isEmpty','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','t.id\x20IN\x20?','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','toString','sequelize','keyBy','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','Contact.phone','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','show','include','options','create','params','describe','addMessage','OpenchannelMessage','omit','ids','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','spread','emit','openchannelInteractionTags:save','removeTags','download','join','root','files','server','attachments','User','fullname','firstName','Attachment','Messages','OpenchannelAccount','Account','Owner','get','mkdirSync','N.A.','closedAt','disposition','threadId','basename','existsSync','pipe','createWriteStream','direction','out','System','lastName','renderFile','views','.pdf','Openchannel','createPdfFromHTML','log','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','TagIds','split','forEach','Tags','push','catch','waiting','answered','unmanaged','total','UserId','talking','closed','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','from','user_has_openchannel_interactions','left_join','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','openchannel_accounts','openchannel_messages','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions'];(function(_0x177dc7,_0x13501c){var _0x19b7dc=function(_0x1b1437){while(--_0x1b1437){_0x177dc7['push'](_0x177dc7['shift']());}};_0x19b7dc(++_0x13501c);}(_0xf1ed,0x87));var _0xdf1e=function(_0x3d9649,_0x5e2c50){_0x3d9649=_0x3d9649-0x0;var _0x2170c6=_0xf1ed[_0x3d9649];return _0x2170c6;};'use strict';var emlformat=require(_0xdf1e('0x0'));var rimraf=require(_0xdf1e('0x1'));var zipdir=require(_0xdf1e('0x2'));var jsonpatch=require(_0xdf1e('0x3'));var rp=require(_0xdf1e('0x4'));var moment=require(_0xdf1e('0x5'));var BPromise=require(_0xdf1e('0x6'));var Mustache=require('mustache');var util=require(_0xdf1e('0x7'));var path=require(_0xdf1e('0x8'));var sox=require('sox');var csv=require(_0xdf1e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdf1e('0xa'));var crypto=require(_0xdf1e('0xb'));var jsforce=require(_0xdf1e('0xc'));var deskjs=require(_0xdf1e('0xd'));var toCsv=require(_0xdf1e('0x9'));var querystring=require('querystring');var Papa=require(_0xdf1e('0xe'));var Redis=require(_0xdf1e('0xf'));var authService=require(_0xdf1e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xdf1e('0x11'));var pdf=require(_0xdf1e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdf1e('0x13'))('api');var utils=require(_0xdf1e('0x14'));var config=require(_0xdf1e('0x15'));var licenseUtil=require(_0xdf1e('0x16'));var db=require(_0xdf1e('0x17'))['db'];config[_0xdf1e('0x18')]=_[_0xdf1e('0x19')](config[_0xdf1e('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xdf1e('0x1a'))(new Redis(config[_0xdf1e('0x18')]));require(_0xdf1e('0x1b'))['register'](socket);function respondWithStatusCode(_0x446271,_0x18da89){_0x18da89=_0x18da89||0xcc;return function(_0x4f5058){if(_0x4f5058){return _0x446271[_0xdf1e('0x1c')](_0x18da89);}return _0x446271[_0xdf1e('0x1d')](_0x18da89)[_0xdf1e('0x1e')]();};}function respondWithResult(_0x44bd87,_0x8f2bdb){_0x8f2bdb=_0x8f2bdb||0xc8;return function(_0x510db8){if(_0x510db8){return _0x44bd87[_0xdf1e('0x1d')](_0x8f2bdb)[_0xdf1e('0x1f')](_0x510db8);}};}function respondWithFilteredResult(_0xe80b,_0x54eb11){return function(_0x190809){if(_0x190809){var _0x6bff25=typeof _0x54eb11[_0xdf1e('0x20')]==='undefined'&&typeof _0x54eb11[_0xdf1e('0x21')]===_0xdf1e('0x22');var _0x2af730=_0x190809[_0xdf1e('0x23')];var _0x8960c0=_0x6bff25?0x0:_0x54eb11[_0xdf1e('0x20')];var _0x20f3ac=_0x6bff25?_0x190809[_0xdf1e('0x23')]:_0x54eb11['offset']+_0x54eb11['limit'];var _0x2f093d;if(_0x20f3ac>=_0x2af730){_0x20f3ac=_0x2af730;_0x2f093d=0xc8;}else{_0x2f093d=0xce;}_0xe80b[_0xdf1e('0x1d')](_0x2f093d);return _0xe80b[_0xdf1e('0x24')](_0xdf1e('0x25'),_0x8960c0+'-'+_0x20f3ac+'/'+_0x2af730)[_0xdf1e('0x1f')](_0x190809);}return null;};}function patchUpdates(_0xd1e53a){return function(_0x4261d0){try{jsonpatch['apply'](_0x4261d0,_0xd1e53a,!![]);}catch(_0x2f75ec){return BPromise[_0xdf1e('0x26')](_0x2f75ec);}return _0x4261d0[_0xdf1e('0x27')]();};}function saveUpdates(_0x2a341f,_0x21fad5){return function(_0x19c6b5){if(_0x19c6b5){return _0x19c6b5[_0xdf1e('0x28')](_0x2a341f)[_0xdf1e('0x29')](function(_0x492ff6){return _0x492ff6;});}return null;};}function removeEntity(_0x200472,_0x5db91c){return function(_0x494ab4){if(_0x494ab4){return _0x494ab4[_0xdf1e('0x2a')]()[_0xdf1e('0x29')](function(){_0x200472[_0xdf1e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b3b36,_0x5a5433){return function(_0x5a5a94){if(!_0x5a5a94){_0x4b3b36['sendStatus'](0x194);}return _0x5a5a94;};}function handleError(_0x2741ae,_0x2ecdb8){_0x2ecdb8=_0x2ecdb8||0x1f4;return function(_0x55736f){logger[_0xdf1e('0x2b')](_0x55736f[_0xdf1e('0x2c')]);if(_0x55736f[_0xdf1e('0x2d')]){delete _0x55736f[_0xdf1e('0x2d')];}_0x2741ae[_0xdf1e('0x1d')](_0x2ecdb8)['send'](_0x55736f);};}function getInteractionUsers(_0x4539e3,_0x11bbba){return new BPromise(function(_0x3504ab,_0x5a0a49){try{if(_0x11bbba[_0x4539e3['id']]){_0x4539e3['Users']=_['map'](_0x11bbba[_0x4539e3['id']],function(_0x4e365d){return{'id':_0x4e365d['id'],'fullname':_0x4e365d['fullname']};});}}catch(_0x2651cd){_0x5a0a49(_0x2651cd);}_0x3504ab(_0x4539e3);});}function getInteractionTags(_0x40bd92,_0x3bcac4){return new BPromise(function(_0x2c5ea9,_0x5c8b44){try{if(_0x40bd92[_0xdf1e('0x2e')]){_0x40bd92['Tags']=[];_0x40bd92['TagIds'][_0xdf1e('0x2f')](',')[_0xdf1e('0x30')](function(_0x56d406){_0x40bd92[_0xdf1e('0x31')][_0xdf1e('0x32')](_0x3bcac4[_0x56d406]);});}delete _0x40bd92[_0xdf1e('0x2e')];}catch(_0xdcd33a){_0x5c8b44(_0xdcd33a);}_0x2c5ea9(_0x40bd92);});}function updateOpenchannelInteraction(_0x2436e4,_0x1755f8,_0x10cd28){return new BPromise(function(_0x58e14b,_0x3fab29){return getInteractionUsers(_0x2436e4,_0x10cd28)[_0xdf1e('0x29')](function(_0x468e99){return getInteractionTags(_0x468e99,_0x1755f8);})[_0xdf1e('0x29')](function(_0x4f52da){return getStateInteraction(_0x4f52da);})[_0xdf1e('0x29')](function(_0x3dca5e){_0x58e14b(_0x3dca5e);})[_0xdf1e('0x33')](function(_0x351ca0){_0x3fab29(_0x351ca0);});});}function getStateInteraction(_0x272808){return new BPromise(function(_0x5bf737){_0x272808[_0xdf1e('0x34')]=0x0;_0x272808['talking']=0x0;_0x272808[_0xdf1e('0x35')]=0x0;_0x272808[_0xdf1e('0x36')]=0x0;_0x272808[_0xdf1e('0x37')]=0x0;if(!_0x272808['closed']&&!_0x272808[_0xdf1e('0x38')]){_0x272808[_0xdf1e('0x34')]+=0x1;}if(!_0x272808['closed']&&_0x272808['UserId']){_0x272808[_0xdf1e('0x39')]+=0x1;ids[_0xdf1e('0x32')](_0x272808['id']);if(_0x272808[_0xdf1e('0x34')]){_0x272808[_0xdf1e('0x34')]-=0x1;}}if(_0x272808[_0xdf1e('0x3a')]&&_0x272808['UserId']){_0x272808[_0xdf1e('0x35')]+=0x1;if(_0x272808[_0xdf1e('0x39')]){_0x272808['talking']-=0x1;}}if(_0x272808['closed']&&!_0x272808[_0xdf1e('0x38')]){_0x272808[_0xdf1e('0x36')]+=0x1;if(_0x272808[_0xdf1e('0x34')]){_0x272808['waiting']-=0x1;}}_0x272808['total']+=0x1;_0x5bf737(_0x272808);});}exports['index']=function(_0x14b9be,_0x80c761){var _0x306403={},_0x39643d={},_0x814331={'count':0x0,'rows':[]};var _0x581f1b=_[_0xdf1e('0x3b')](db[_0xdf1e('0x3c')][_0xdf1e('0x3d')],function(_0x470c05){return{'name':_0x470c05[_0xdf1e('0x3e')],'type':_0x470c05[_0xdf1e('0x3f')][_0xdf1e('0x40')]};});_0x39643d[_0xdf1e('0x41')]=_['map'](_0x581f1b,'name');_0x39643d[_0xdf1e('0x42')]=_[_0xdf1e('0x43')](_0x14b9be[_0xdf1e('0x42')]);_0x39643d[_0xdf1e('0x44')]=_[_0xdf1e('0x45')](_0x39643d[_0xdf1e('0x41')],_0x39643d[_0xdf1e('0x42')]);_0x306403[_0xdf1e('0x46')]=_[_0xdf1e('0x45')](_0x39643d[_0xdf1e('0x41')],qs[_0xdf1e('0x47')](_0x14b9be[_0xdf1e('0x42')]['fields']));_0x306403['attributes']=_0x306403['attributes']['length']?_0x306403['attributes']:_0x39643d[_0xdf1e('0x41')];if(!_0x14b9be[_0xdf1e('0x42')][_0xdf1e('0x48')](_0xdf1e('0x49'))){_0x306403[_0xdf1e('0x21')]=qs[_0xdf1e('0x21')](_0x14b9be[_0xdf1e('0x42')][_0xdf1e('0x21')]);_0x306403[_0xdf1e('0x20')]=qs['offset'](_0x14b9be['query'][_0xdf1e('0x20')]);}_0x306403[_0xdf1e('0x4a')]=qs[_0xdf1e('0x4b')](_0x14b9be[_0xdf1e('0x42')][_0xdf1e('0x4b')]);_0x306403[_0xdf1e('0x4c')]=qs[_0xdf1e('0x44')](_[_0xdf1e('0x4d')](_0x14b9be[_0xdf1e('0x42')],_0x39643d[_0xdf1e('0x44')]),_0x581f1b);var _0x159dc2=[];var _0x50ec0b=squel[_0xdf1e('0x4e')]()['field']('id')[_0xdf1e('0x4f')](_0xdf1e('0x2d'))[_0xdf1e('0x4f')](_0xdf1e('0x50'))['from'](_0xdf1e('0x51'));var _0x444841=squel[_0xdf1e('0x4e')]()[_0xdf1e('0x4f')](_0xdf1e('0x52'))[_0xdf1e('0x4f')](_0xdf1e('0x53'))[_0xdf1e('0x4f')](_0xdf1e('0x54'))[_0xdf1e('0x55')](_0xdf1e('0x56'),'ui')[_0xdf1e('0x57')]('users','u',_0xdf1e('0x58'));var _0x1b55f3=squel[_0xdf1e('0x4e')]()[_0xdf1e('0x55')](_0xdf1e('0x59'),'i')[_0xdf1e('0x57')](_0xdf1e('0x5a'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xdf1e('0x57')](_0xdf1e('0x5b'),'o',_0xdf1e('0x5c'))[_0xdf1e('0x57')](_0xdf1e('0x5d'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0xdf1e('0x57')](_0xdf1e('0x5e'),'me','me.OpenchannelInteractionId\x20=\x20i.id')['left_join'](_0xdf1e('0x5f'),'it',_0xdf1e('0x60'))['left_join'](_0xdf1e('0x51'),'t',_0xdf1e('0x61'));var _0x5050a0=squel[_0xdf1e('0x62')]();var _0x9e10da=[];var _0x40d472=squel[_0xdf1e('0x62')]();var _0x19f8de;if(_0x14b9be[_0xdf1e('0x42')][_0xdf1e('0x63')]){_0x19f8de=as[_0xdf1e('0x64')](_0x14b9be[_0xdf1e('0x42')]['search']);var _0x149363=_0x19f8de[_0xdf1e('0x65')];for(var _0xf56f6=0x0;_0xf56f6<_0x19f8de[_0xdf1e('0x66')][_0xdf1e('0x67')];_0xf56f6++){var _0x5b652c=_0x19f8de['conditions'][_0xf56f6];var _0x51b8bb='i';var _0x5e5022=_['find'](_0x581f1b,['name',_0x5b652c[_0xdf1e('0x4f')]]);if(!_0x5e5022){switch(_0x5b652c[_0xdf1e('0x4f')]){case'unreadMessages':if(_0x5b652c[_0xdf1e('0x68')]==0x1){_0x1b55f3[_0xdf1e('0x69')]('`'+_0x5b652c[_0xdf1e('0x4f')]+_0xdf1e('0x6a'));}else{_0x1b55f3[_0xdf1e('0x69')]('`'+_0x5b652c[_0xdf1e('0x4f')]+_0xdf1e('0x6b'));}break;case _0xdf1e('0x6c'):if(_0x5b652c[_0xdf1e('0x6d')]==='$substring'){if(_0x5b652c[_0xdf1e('0x68')][_0xdf1e('0x2f')]('\x20')[_0xdf1e('0x67')]>0x1){_0x5050a0[_0x149363]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5b652c[_0xdf1e('0x68')]),null);}else{var _0x134b8b='%'+_0x5b652c[_0xdf1e('0x68')]+'%';_0x5050a0[_0x149363](_0xdf1e('0x6e'),_0x134b8b,_0x134b8b,_0x134b8b);}}else{_0x5e5022=_[_0xdf1e('0x6f')](_0x581f1b,[_0xdf1e('0x2d'),_0xdf1e('0x70')]);_0x5b652c['field']=_0xdf1e('0x70');_0x44d2c4=as['buildExpression'](_0x51b8bb,_0x5e5022[_0xdf1e('0x3f')],_0x5b652c);_0x5050a0[_0x149363](_0x44d2c4[_0xdf1e('0x71')],_0x44d2c4[_0xdf1e('0x68')]['start'],_0x44d2c4['value'][_0xdf1e('0x1e')]);}break;case _0xdf1e('0x72'):var _0x503870=_0x5b652c[_0xdf1e('0x68')]['split'](',')['map'](function(_0x590306){return Number(_0x590306);});_0x503870[_0xdf1e('0x30')](function(_0x45db4c){_0x40d472['or'](_0xdf1e('0x73'),'%,'+_0x45db4c+',%');});_0x9e10da=_['union'](_0x9e10da,_0x503870);break;case'User':if(_0x5b652c['operator']===_0xdf1e('0x74')){_0x5050a0[_0x149363](_0xdf1e('0x75'),'%'+_0x5b652c[_0xdf1e('0x68')]+'%',null);}else{_0x5e5022=_[_0xdf1e('0x6f')](_0x581f1b,['name',_0xdf1e('0x38')]);_0x5b652c['field']=_0xdf1e('0x38');_0x44d2c4=as[_0xdf1e('0x76')](_0x51b8bb,_0x5e5022['type'],_0x5b652c);_0x5050a0[_0x149363](_0x44d2c4['text'],_0x44d2c4[_0xdf1e('0x68')][_0xdf1e('0x77')],_0x44d2c4['value']['end']);}break;case _0xdf1e('0x78'):_0x44d2c4=as[_0xdf1e('0x76')]('me',null,_0x5b652c);_0x5050a0[_0x149363](_0x44d2c4[_0xdf1e('0x71')],_0x44d2c4[_0xdf1e('0x68')]['start'],_0x44d2c4[_0xdf1e('0x68')]['end']);break;}}else{var _0x44d2c4=as[_0xdf1e('0x76')](_0x51b8bb,_0x5e5022[_0xdf1e('0x3f')],_0x5b652c);_0x5050a0[_0x149363](_0x44d2c4['text'],_0x44d2c4[_0xdf1e('0x68')][_0xdf1e('0x77')],_0x44d2c4['value']['end']);}}}else{var _0x3d7e44=_(_0x14b9be[_0xdf1e('0x42')])[_0xdf1e('0x43')]()[_0xdf1e('0x3b')](function(_0x3f492f){return _[_0xdf1e('0x79')](_0x581f1b,[_0xdf1e('0x2d'),_0x3f492f])?_0x3f492f:undefined;})[_0xdf1e('0x7a')]()[_0xdf1e('0x68')]();if(!_[_0xdf1e('0x7b')](_0x3d7e44)){_0x3d7e44[_0xdf1e('0x30')](function(_0x4b8bc9){if(_0x4b8bc9==='OpenchannelAccountId'){_0x1b55f3[_0xdf1e('0x4c')](_0xdf1e('0x7c'),[][_0xdf1e('0x7d')](_0x14b9be[_0xdf1e('0x42')][_0x4b8bc9]));}else if(_0x4b8bc9===_0xdf1e('0x7e')){var _0xc116e2=JSON[_0xdf1e('0x7f')](_0x14b9be['query'][_0x4b8bc9])[_0xdf1e('0x80')];var _0x5ae0ad=JSON[_0xdf1e('0x7f')](_0x14b9be[_0xdf1e('0x42')][_0x4b8bc9])[_0xdf1e('0x81')];_0x1b55f3['where'](_0xdf1e('0x82'),_0xc116e2,_0x5ae0ad);}else{if(_0x14b9be[_0xdf1e('0x42')][_0x4b8bc9]==='null'){_0x1b55f3[_0xdf1e('0x4c')]('i.'+_0x4b8bc9+_0xdf1e('0x83'));}else{_0x1b55f3['where']('i.'+_0x4b8bc9+'\x20=\x20?',_0x14b9be[_0xdf1e('0x42')][_0x4b8bc9]);}}});}if(_0x14b9be[_0xdf1e('0x42')][_0xdf1e('0x84')]){if(_0x14b9be[_0xdf1e('0x42')]['read']==0x1){_0x1b55f3[_0xdf1e('0x69')](_0xdf1e('0x85'));}else{_0x1b55f3['having'](_0xdf1e('0x86'));}}if(_0x14b9be[_0xdf1e('0x42')][_0xdf1e('0x87')]){_0x9e10da=_[_0xdf1e('0x88')](_0x14b9be[_0xdf1e('0x42')]['tag'])?_0x14b9be[_0xdf1e('0x42')][_0xdf1e('0x87')]:new Array(_0x14b9be['query'][_0xdf1e('0x87')]);_0x9e10da[_0xdf1e('0x30')](function(_0x22f154){_0x40d472['or'](_0xdf1e('0x73'),'%,'+_0x22f154+',%');});}if(_0x14b9be[_0xdf1e('0x42')][_0xdf1e('0x89')]){var _0x49ab43=_0x14b9be['query'][_0xdf1e('0x89')]['replace']('\x5c','\x5c\x5c')[_0xdf1e('0x8a')](/'/g,'\x27\x27');if(qs[_0xdf1e('0x8b')](_0x49ab43)){_0x5050a0['or']('i.id\x20LIKE\x20?',_0x49ab43+'%');}else{_0x5050a0['or'](_0xdf1e('0x8c'),qs['getFullTextValue'](_0x49ab43))['or']('i.from\x20LIKE\x20?',_0x49ab43+'%')['or'](_0xdf1e('0x8d'),_0x49ab43+'%');}}}_0x1b55f3[_0xdf1e('0x4c')](_0x5050a0);_0x1b55f3[_0xdf1e('0x8e')]('i.id');var _0x20cf79={'type':db[_0xdf1e('0x8f')][_0xdf1e('0x90')]['SELECT'],'raw':!![]};var _0x209364=_0x1b55f3[_0xdf1e('0x91')]();_0x209364[_0xdf1e('0x4f')](_0xdf1e('0x92'));_0x209364[_0xdf1e('0x4f')](_0xdf1e('0x93'),_0xdf1e('0x94'));if(_0x306403[_0xdf1e('0x4a')]){_0x306403['order'][_0xdf1e('0x30')](function(_0x257c0a){var _0x36ae15=_0x257c0a[0x0]===_0xdf1e('0x95')?_0x257c0a[0x0]:'i.'+_0x257c0a[0x0];_0x1b55f3['order'](_0x36ae15,_0x257c0a[0x1]==='DESC'?![]:!![]);});}if(!_[_0xdf1e('0x7b')](_0x9e10da)){_0x1b55f3[_0xdf1e('0x69')](_0x40d472);_0x209364[_0xdf1e('0x4c')](_0xdf1e('0x96'),_0x9e10da);}BPromise[_0xdf1e('0x97')]()[_0xdf1e('0x29')](function(){if(!_0x19f8de){if(_0x14b9be[_0xdf1e('0x42')][_0xdf1e('0x98')])return;_0x209364[_0xdf1e('0x4c')](_0xdf1e('0x99'));_0x1b55f3['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x14b9be['user'][_0xdf1e('0x9a')]!==_0xdf1e('0x9b'))return;return _0x14b9be[_0xdf1e('0x9c')][_0xdf1e('0x9d')]({'attributes':['id'],'raw':!![]})[_0xdf1e('0x29')](function(_0x3f21dc){if(_[_0xdf1e('0x7b')](_0x3f21dc)){_0x209364[_0xdf1e('0x4c')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x1b55f3['where'](_0xdf1e('0x9e'));}else{_0x209364[_0xdf1e('0x4c')]('i.OpenchannelAccountId\x20IN\x20?',_[_0xdf1e('0x3b')](_0x3f21dc,'id'));_0x1b55f3[_0xdf1e('0x4c')](_0xdf1e('0x7c'),_[_0xdf1e('0x3b')](_0x3f21dc,'id'));}});})[_0xdf1e('0x29')](function(){if(_0x14b9be[_0xdf1e('0x9c')][_0xdf1e('0x9a')]===_0xdf1e('0x9b')&&!_0x19f8de&&!_0x14b9be[_0xdf1e('0x42')][_0xdf1e('0x98')])return[];return db['sequelize'][_0xdf1e('0x42')](_0x209364[_0xdf1e('0x9f')](),_0x20cf79);})[_0xdf1e('0x29')](function(_0x174d12){_0x814331[_0xdf1e('0x23')]=_0x174d12[_0xdf1e('0x67')];if(_0x814331['count']===0x0)return[];return db[_0xdf1e('0xa0')]['query'](_0x50ec0b[_0xdf1e('0x9f')](),_0x20cf79)[_0xdf1e('0x29')](function(_0x47e092){_0x159dc2=_[_0xdf1e('0xa1')](_0x47e092,'id');_0x20cf79=_[_0xdf1e('0xa2')](_0x20cf79,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x14b9be['query'][_0xdf1e('0x47')]){_0x306403[_0xdf1e('0x46')][_0xdf1e('0x30')](function(_0x299740){_0x1b55f3[_0xdf1e('0x4f')]('i.'+_0x299740);});}else{_0x1b55f3[_0xdf1e('0x4f')](_0xdf1e('0x93'),_0xdf1e('0x94'));_0x1b55f3[_0xdf1e('0x4f')]('a.key',_0xdf1e('0xa3'));_0x1b55f3[_0xdf1e('0x4f')](_0xdf1e('0xa4'),_0xdf1e('0xa5'));_0x1b55f3[_0xdf1e('0x4f')]('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',_0xdf1e('0x95'));_0x1b55f3[_0xdf1e('0x4f')](_0xdf1e('0xa6'));_0x1b55f3['field'](_0xdf1e('0xa7'),_0xdf1e('0xa8'));_0x1b55f3[_0xdf1e('0x4f')]('c.lastName',_0xdf1e('0xa9'));_0x1b55f3[_0xdf1e('0x4f')]('c.email','Contact.email');_0x1b55f3[_0xdf1e('0x4f')]('c.phone',_0xdf1e('0xaa'));_0x1b55f3[_0xdf1e('0x4f')]('c.mobile',_0xdf1e('0xab'));_0x1b55f3['field'](_0xdf1e('0xac'),_0xdf1e('0xad'));_0x1b55f3[_0xdf1e('0x4f')]('o.fullname',_0xdf1e('0xae'));_0x1b55f3[_0xdf1e('0x4f')](_0xdf1e('0xaf'),_0xdf1e('0xb0'));_0x1b55f3[_0xdf1e('0x4f')](_0xdf1e('0xb1'),_0xdf1e('0x2e'));}if(_0x306403['limit'])_0x1b55f3['limit'](_0x306403[_0xdf1e('0x21')]);if(_0x306403[_0xdf1e('0x20')])_0x1b55f3['offset'](_0x306403[_0xdf1e('0x20')]);return db[_0xdf1e('0xa0')][_0xdf1e('0x42')](_0x1b55f3[_0xdf1e('0x9f')](),_0x20cf79);})[_0xdf1e('0x29')](function(_0x55b48a){if(_0x55b48a[_0xdf1e('0x67')]>0x0)_0x444841[_0xdf1e('0x4c')](_0xdf1e('0xb2'),_[_0xdf1e('0x3b')](_0x55b48a,'id'));return db[_0xdf1e('0xa0')]['query'](_0x444841[_0xdf1e('0x9f')](),_0x20cf79)[_0xdf1e('0x29')](function(_0x249bde){var _0x857b68=_[_0xdf1e('0xb3')](_0x249bde,_0xdf1e('0xb4'));var _0x19f1eb=[];_0x55b48a[_0xdf1e('0x30')](function(_0x2b5726){_0x19f1eb[_0xdf1e('0x32')](updateOpenchannelInteraction(_0x2b5726,_0x159dc2,_0x857b68));});return BPromise[_0xdf1e('0xb5')](_0x19f1eb);});});})[_0xdf1e('0x29')](function(_0x13fc39){_0x814331[_0xdf1e('0xb6')]=_0x13fc39;return _0x814331;})[_0xdf1e('0x29')](respondWithFilteredResult(_0x80c761,_0x306403))[_0xdf1e('0x33')](handleError(_0x80c761,null));};exports[_0xdf1e('0xb7')]=function(_0x19cbe8,_0x26d3ab){var _0x5a34e0={};if(_0x19cbe8[_0xdf1e('0x42')][_0xdf1e('0x3f')]&&_0x19cbe8[_0xdf1e('0x42')][_0xdf1e('0x3f')]==='from'){_0x5a34e0[_0xdf1e('0x55')]=_0x19cbe8['params']['id'];}else{_0x5a34e0['id']=_0x19cbe8['params']['id'];}var _0x2668d7={'raw':![],'where':_0x5a34e0},_0x188963={};_0x188963[_0xdf1e('0x41')]=_['keys'](db[_0xdf1e('0x3c')]['rawAttributes']);_0x188963[_0xdf1e('0x42')]=_[_0xdf1e('0x43')](_0x19cbe8['query']);_0x188963['filters']=_[_0xdf1e('0x45')](_0x188963[_0xdf1e('0x41')],_0x188963[_0xdf1e('0x42')]);_0x2668d7[_0xdf1e('0x46')]=_[_0xdf1e('0x45')](_0x188963[_0xdf1e('0x41')],qs[_0xdf1e('0x47')](_0x19cbe8[_0xdf1e('0x42')]['fields']));_0x2668d7[_0xdf1e('0x46')]=_0x2668d7[_0xdf1e('0x46')][_0xdf1e('0x67')]?_0x2668d7[_0xdf1e('0x46')]:_0x188963['model'];if(_0x19cbe8[_0xdf1e('0x42')]['includeAll']){_0x2668d7[_0xdf1e('0xb8')]=[{'all':!![]}];}_0x2668d7=_[_0xdf1e('0xa2')]({},_0x2668d7,_0x19cbe8[_0xdf1e('0xb9')]);return db[_0xdf1e('0x3c')]['find'](_0x2668d7)[_0xdf1e('0x29')](handleEntityNotFound(_0x26d3ab,null))[_0xdf1e('0x29')](respondWithResult(_0x26d3ab,null))[_0xdf1e('0x33')](handleError(_0x26d3ab,null));};exports[_0xdf1e('0xba')]=function(_0x2d0cc8,_0x2650c6){return db[_0xdf1e('0x3c')][_0xdf1e('0xba')](_0x2d0cc8[_0xdf1e('0x78')],{})['then'](respondWithResult(_0x2650c6,0xc9))[_0xdf1e('0x33')](handleError(_0x2650c6,null));};exports['update']=function(_0x477167,_0x18da36){if(_0x477167['body']['id']){delete _0x477167[_0xdf1e('0x78')]['id'];}return db[_0xdf1e('0x3c')][_0xdf1e('0x6f')]({'where':{'id':_0x477167['params']['id']}})['then'](handleEntityNotFound(_0x18da36,null))[_0xdf1e('0x29')](saveUpdates(_0x477167[_0xdf1e('0x78')],null))[_0xdf1e('0x29')](respondWithResult(_0x18da36,null))[_0xdf1e('0x33')](handleError(_0x18da36,null));};exports['destroy']=function(_0x1af586,_0x180dfb){return db[_0xdf1e('0x3c')]['find']({'where':{'id':_0x1af586[_0xdf1e('0xbb')]['id']}})['then'](handleEntityNotFound(_0x180dfb,null))[_0xdf1e('0x29')](removeEntity(_0x180dfb,null))['catch'](handleError(_0x180dfb,null));};exports[_0xdf1e('0xbc')]=function(_0x435a6b,_0xcfb3bb){return db[_0xdf1e('0x3c')][_0xdf1e('0xbc')]()[_0xdf1e('0x29')](respondWithResult(_0xcfb3bb,null))[_0xdf1e('0x33')](handleError(_0xcfb3bb,null));};exports[_0xdf1e('0xbd')]=function(_0x4402a1,_0x1d1eeb,_0x18268f){return db[_0xdf1e('0xbe')][_0xdf1e('0x6f')]({'where':{'id':_0x4402a1['params']['id']}})['then'](handleEntityNotFound(_0x1d1eeb,null))[_0xdf1e('0x29')](function(_0xa657e2){if(_0xa657e2){return _0xa657e2['addMessage'](_0x4402a1[_0xdf1e('0x78')]['ids'],_[_0xdf1e('0xbf')](_0x4402a1[_0xdf1e('0x78')],[_0xdf1e('0xc0'),'id'])||{});}})[_0xdf1e('0x29')](respondWithResult(_0x1d1eeb,null))[_0xdf1e('0x33')](handleError(_0x1d1eeb,null));};exports[_0xdf1e('0xc1')]=function(_0x3ef053,_0x52244e,_0x47aec6){var _0x597a8c={'raw':![],'where':{}};var _0x474b6c={};var _0x4f4cc2={'count':0x0,'rows':[]};return db[_0xdf1e('0x3c')]['findOne']({'where':{'id':_0x3ef053[_0xdf1e('0xbb')]['id']}})[_0xdf1e('0x29')](handleEntityNotFound(_0x52244e,null))[_0xdf1e('0x29')](function(_0x249b06){if(_0x249b06){_0x474b6c[_0xdf1e('0x41')]=_['keys'](db['OpenchannelMessage']['rawAttributes']);_0x474b6c[_0xdf1e('0x42')]=_[_0xdf1e('0x43')](_0x3ef053[_0xdf1e('0x42')]);_0x474b6c[_0xdf1e('0x44')]=_[_0xdf1e('0x45')](_0x474b6c[_0xdf1e('0x41')],_0x474b6c[_0xdf1e('0x42')]);_0x597a8c['attributes']=_[_0xdf1e('0x45')](_0x474b6c[_0xdf1e('0x41')],qs[_0xdf1e('0x47')](_0x3ef053[_0xdf1e('0x42')]['fields']));_0x597a8c['attributes']=_0x597a8c[_0xdf1e('0x46')][_0xdf1e('0x67')]?_0x597a8c[_0xdf1e('0x46')]:_0x474b6c['model'];if(!_0x3ef053[_0xdf1e('0x42')][_0xdf1e('0x48')](_0xdf1e('0x49'))){_0x597a8c[_0xdf1e('0x21')]=qs['limit'](_0x3ef053[_0xdf1e('0x42')]['limit']);_0x597a8c[_0xdf1e('0x20')]=qs[_0xdf1e('0x20')](_0x3ef053[_0xdf1e('0x42')]['offset']);}_0x597a8c[_0xdf1e('0x4a')]=qs[_0xdf1e('0x4b')](_0x3ef053[_0xdf1e('0x42')][_0xdf1e('0x4b')]);_0x597a8c[_0xdf1e('0x4c')]=qs['filters'](_[_0xdf1e('0x4d')](_0x3ef053[_0xdf1e('0x42')],_0x474b6c['filters']));_0x597a8c['where'][_0xdf1e('0xb4')]=_0x249b06['id'];if(_0x3ef053[_0xdf1e('0x42')][_0xdf1e('0x89')]){_0x597a8c['where']=_[_0xdf1e('0xa2')](_0x597a8c[_0xdf1e('0x4c')],{'$or':_['map'](_0x597a8c[_0xdf1e('0x46')],function(_0x443ae0){var _0x467487={};_0x467487[_0x443ae0]={'$like':'%'+_0x3ef053[_0xdf1e('0x42')]['filter']+'%'};return _0x467487;})});}if(_0x3ef053[_0xdf1e('0x42')][_0xdf1e('0x80')]){var _0x12522b=_0x3ef053[_0xdf1e('0x42')][_0xdf1e('0x80')][_0xdf1e('0x2f')](',');var _0x7b9d22={};_0x7b9d22[_0x12522b[0x0]]={'$gte':moment(_0x12522b[0x1])[_0xdf1e('0xc2')](_0xdf1e('0xc3'))};_0x597a8c[_0xdf1e('0x4c')]=_[_0xdf1e('0xa2')](_0x597a8c['where'],_0x7b9d22);}_0x597a8c=_[_0xdf1e('0xa2')]({},_0x597a8c,_0x3ef053['options']);return db[_0xdf1e('0xbe')][_0xdf1e('0x23')]({'where':_0x597a8c[_0xdf1e('0x4c')]})[_0xdf1e('0x29')](function(_0x4fa429){_0x4f4cc2[_0xdf1e('0x23')]=_0x4fa429;if(_0x3ef053[_0xdf1e('0x42')][_0xdf1e('0xc4')]){_0x597a8c['include']=[{'all':!![]}];}return db[_0xdf1e('0xbe')][_0xdf1e('0xc5')](_0x597a8c);})[_0xdf1e('0x29')](function(_0x5e9b62){_0x4f4cc2['rows']=_0x5e9b62;return _0x4f4cc2;});}})[_0xdf1e('0x29')](respondWithFilteredResult(_0x52244e,_0x597a8c))[_0xdf1e('0x33')](handleError(_0x52244e,null));};exports[_0xdf1e('0xc6')]=function(_0x2ffb94,_0x450297,_0xbcc21f){return db['OpenchannelInteraction'][_0xdf1e('0x6f')]({'where':{'id':_0x2ffb94[_0xdf1e('0xbb')]['id']}})[_0xdf1e('0x29')](handleEntityNotFound(_0x450297,null))['then'](function(_0x232980){if(_0x232980){return _0x232980[_0xdf1e('0xc7')](_0x2ffb94['body'][_0xdf1e('0xc0')],_['omit'](_0x2ffb94[_0xdf1e('0x78')],[_0xdf1e('0xc0'),'id'])||{})[_0xdf1e('0xc8')](function(){return db[_0xdf1e('0x72')][_0xdf1e('0xc5')]({'attributes':['id','name',_0xdf1e('0x50')],'where':{'id':_0x2ffb94[_0xdf1e('0x78')][_0xdf1e('0xc0')]}});})['then'](function(_0x281ae6){socket[_0xdf1e('0xc9')](_0xdf1e('0xca'),{'id':Number(_0x2ffb94[_0xdf1e('0xbb')]['id']),'tags':_0x281ae6||[]});return{'id':Number(_0x2ffb94[_0xdf1e('0xbb')]['id']),'tags':_0x281ae6||[]};});}})[_0xdf1e('0x29')](respondWithResult(_0x450297,null))['catch'](handleError(_0x450297,null));};exports[_0xdf1e('0xcb')]=function(_0x3516d6,_0x54e826,_0x14b2bc){return db[_0xdf1e('0x3c')]['find']({'where':{'id':_0x3516d6[_0xdf1e('0xbb')]['id']}})[_0xdf1e('0x29')](handleEntityNotFound(_0x54e826,null))[_0xdf1e('0x29')](function(_0x486970){if(_0x486970){return _0x486970['removeTags'](_0x3516d6[_0xdf1e('0x42')][_0xdf1e('0xc0')]);}})[_0xdf1e('0x29')](respondWithStatusCode(_0x54e826,null))['catch'](handleError(_0x54e826,null));};exports[_0xdf1e('0xcc')]=function(_0x5ee190,_0x294b98){var _0x16e07c=moment()['unix']()['toString']();var _0x1143b2=path[_0xdf1e('0xcd')](config[_0xdf1e('0xce')],'server',_0xdf1e('0xcf'),'tmp');var _0x4ee35f=path['join'](config[_0xdf1e('0xce')],_0xdf1e('0xd0'),_0xdf1e('0xcf'),_0xdf1e('0xd1'));var _0xc1318c=path[_0xdf1e('0xcd')](_0x1143b2,_0x16e07c);var _0x4cd271=util[_0xdf1e('0xc2')]('transcript-%d-%s.zip',_0x5ee190[_0xdf1e('0xbb')]['id'],_0x16e07c);var _0x31ec5b=path[_0xdf1e('0xcd')](_0x1143b2,_0x4cd271);var _0x5940a6=[];_0x5940a6[_0xdf1e('0x32')]({'model':db[_0xdf1e('0xd2')],'as':_0xdf1e('0xd2'),'attributes':['id',_0xdf1e('0xd3')],'raw':!![]});_0x5940a6[_0xdf1e('0x32')]({'model':db['CmContact'],'as':_0xdf1e('0x6c'),'attributes':['id',_0xdf1e('0xd4'),'lastName'],'raw':!![]});if(_0x5ee190[_0xdf1e('0x42')][_0xdf1e('0xd1')]){_0x5940a6[_0xdf1e('0x32')]({'model':db[_0xdf1e('0xd5')],'as':_0xdf1e('0xd5'),'raw':!![]});}var _0xaa7a6a=[{'model':db[_0xdf1e('0xbe')],'as':_0xdf1e('0xd6'),'attributes':['id',_0xdf1e('0x78'),'createdAt','direction','secret',_0xdf1e('0x84')],'include':_0x5940a6}];_0xaa7a6a['push']({'model':db[_0xdf1e('0xd7')],'as':_0xdf1e('0xd8'),'attributes':['id',_0xdf1e('0x2d')]});_0xaa7a6a[_0xdf1e('0x32')]({'model':db[_0xdf1e('0xd2')],'as':_0xdf1e('0xd9'),'attributes':['id',_0xdf1e('0xd3')]});return db[_0xdf1e('0x3c')][_0xdf1e('0x6f')]({'where':{'id':_0x5ee190[_0xdf1e('0xbb')]['id']},'include':_0xaa7a6a})[_0xdf1e('0x29')](handleEntityNotFound(_0x294b98,null))[_0xdf1e('0x29')](function(_0x1d1804){if(_0x1d1804){var _0x5819e7=_0x1d1804[_0xdf1e('0xda')]({'plain':!![]});fs[_0xdf1e('0xdb')](_0xc1318c);var _0x392be9={'channel':'Openchannel','account':_0x5819e7[_0xdf1e('0xd8')][_0xdf1e('0x2d')],'agent':_0x5819e7[_0xdf1e('0xd9')]?_0x5819e7['Owner'][_0xdf1e('0xd3')]:_0xdf1e('0xdc'),'createdAt':moment(_0x5819e7[_0xdf1e('0x7e')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xdf1e('0x9f')](),'closedAt':_0x5819e7['closed']?moment(_0x5819e7[_0xdf1e('0xdd')])[_0xdf1e('0xc2')](_0xdf1e('0xc3'))[_0xdf1e('0x9f')]():'','disposition':_0x5819e7[_0xdf1e('0xde')],'visibility':_0x5819e7[_0xdf1e('0xdf')]?'Public':'Private','messages':_(_0x5819e7[_0xdf1e('0xd6')])[_0xdf1e('0x89')]({'secret':![]})[_0xdf1e('0x3b')](function(_0x5bc0c5){if(_0x5bc0c5[_0xdf1e('0xd5')]){var _0x301871=path[_0xdf1e('0xcd')](_0x4ee35f,_0x5bc0c5[_0xdf1e('0xd5')][_0xdf1e('0xe0')]);if(fs[_0xdf1e('0xe1')](_0x301871)){fs['createReadStream'](_0x301871)[_0xdf1e('0xe2')](fs[_0xdf1e('0xe3')](path[_0xdf1e('0xcd')](_0xc1318c,_0x5bc0c5[_0xdf1e('0xd5')]['basename'])));}}return{'date':moment(_0x5bc0c5['createdAt'])[_0xdf1e('0xc2')](_0xdf1e('0xc3'))[_0xdf1e('0x9f')](),'sender':_0x5bc0c5[_0xdf1e('0xe4')]===_0xdf1e('0xe5')?_0x5bc0c5[_0xdf1e('0xd2')]?_0x5bc0c5['User'][_0xdf1e('0xd3')]:_0xdf1e('0xe6'):_0x5bc0c5[_0xdf1e('0x6c')][_0xdf1e('0xd4')]+(_0x5bc0c5[_0xdf1e('0x6c')][_0xdf1e('0xe7')]?'\x20'+_0x5bc0c5[_0xdf1e('0x6c')]['lastName']:''),'body':_0x5bc0c5[_0xdf1e('0xd5')]?_0x5bc0c5[_0xdf1e('0xd5')][_0xdf1e('0xe0')]:_0x5bc0c5[_0xdf1e('0x78')],'direction':_0x5bc0c5['direction']===_0xdf1e('0xe5')?'A':'C','secret':_0x5bc0c5['secret'],'read':_0x5bc0c5['read'],'attachment':_0x5bc0c5[_0xdf1e('0xd5')]};})[_0xdf1e('0x68')]()};return ejs[_0xdf1e('0xe8')](path[_0xdf1e('0xcd')](config[_0xdf1e('0xce')],_0xdf1e('0xd0'),_0xdf1e('0xe9'),'downloadInteraction.ejs'),{'interaction':_0x392be9})[_0xdf1e('0x29')](function(_0x45c368){var _0x5a5a49=path[_0xdf1e('0xcd')](_0xc1318c,'transcript-'+_0x5819e7['id']+'-'+_0x16e07c+_0xdf1e('0xea'));var _0x2156da={'path':_0x5a5a49,'channel':_0xdf1e('0xeb'),'interactionId':_0x5819e7['id']};return pdf[_0xdf1e('0xec')](_0x45c368,_0x2156da);})[_0xdf1e('0x29')](function(){return new BPromise(function(_0x367a71,_0x28971f){zipdir(_0xc1318c,{'saveTo':_0x31ec5b},function(_0x17bcbb,_0x16a996){if(_0x17bcbb)return _0x28971f(_0x17bcbb);return _0x367a71(_0x16a996);});})['then'](function(){return new BPromise(function(_0x12a612,_0x448caf){rimraf(_0xc1318c,function(_0x9b0b93){if(_0x9b0b93)_0x448caf(_0x9b0b93);return _0x12a612();});});})['then'](function(){return _0x294b98[_0xdf1e('0xcc')](_0x31ec5b,_0x4cd271,function(_0x5ece17){if(_0x5ece17){console[_0xdf1e('0xed')]('err',_0x5ece17);}else{fs['unlinkSync'](_0x31ec5b);}});});});}else{return _0x294b98[_0xdf1e('0x1c')](0xc8);}})[_0xdf1e('0x33')](handleError(_0x294b98,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 52159f6..3f3ec2a 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 _0x2415=['getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','remove'];(function(_0x13e551,_0x1740de){var _0x597f09=function(_0x218c76){while(--_0x218c76){_0x13e551['push'](_0x13e551['shift']());}};_0x597f09(++_0x1740de);}(_0x2415,0x9c));var _0x5241=function(_0x3babdc,_0xbecced){_0x3babdc=_0x3babdc-0x0;var _0x560465=_0x2415[_0x3babdc];return _0x560465;};'use strict';var EventEmitter=require(_0x5241('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x5241('0x1'))['db'][_0x5241('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x5241('0x3')](0x0);var events={'afterCreate':_0x5241('0x4'),'afterUpdate':'update','afterDestroy':_0x5241('0x5')};function emitEvent(_0x5a4ec0){return function(_0x4f2e25,_0x4163b1,_0x21d97d){_0x4f2e25[_0x5241('0x6')]({'attributes':['id'],'raw':!![]})[_0x5241('0x7')](function(_0x2cc75d){_0x4f2e25[_0x5241('0x8')](_0x5241('0x9'),_0x2cc75d[_0x5241('0xa')](function(_0x4bccce){return{'id':_0x4bccce['id']};}));return OpenchannelMessage[_0x5241('0xb')]({'where':{'OpenchannelInteractionId':_0x4f2e25['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5241('0x7')](function(_0x59933c){_0x4f2e25[_0x5241('0x8')](_0x5241('0xc'),_0x59933c[_0x5241('0xd')]);OpenchannelInteractionEvents[_0x5241('0xe')](_0x5a4ec0+':'+_0x4f2e25['id'],_0x4f2e25);OpenchannelInteractionEvents[_0x5241('0xe')](_0x5a4ec0,_0x4f2e25);_0x21d97d(null);})['catch'](_0x21d97d(null));};}for(var e in events){if(events[_0x5241('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x5241('0x10')](e,emitEvent(event));}}module[_0x5241('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x49e7=['hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','setDataValue','Users','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x5c2ee3,_0x345da4){var _0x1160ab=function(_0x222487){while(--_0x222487){_0x5c2ee3['push'](_0x5c2ee3['shift']());}};_0x1160ab(++_0x345da4);}(_0x49e7,0x8a));var _0x749e=function(_0x288ca8,_0x1dd482){_0x288ca8=_0x288ca8-0x0;var _0x5894f6=_0x49e7[_0x288ca8];return _0x5894f6;};'use strict';var EventEmitter=require(_0x749e('0x0'));var OpenchannelInteraction=require(_0x749e('0x1'))['db'][_0x749e('0x2')];var OpenchannelMessage=require(_0x749e('0x1'))['db'][_0x749e('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x749e('0x4')](0x0);var events={'afterCreate':_0x749e('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x764739){return function(_0x73f0f,_0x45b7bf,_0x3b328b){_0x73f0f['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x2c8e99){_0x73f0f[_0x749e('0x6')](_0x749e('0x7'),_0x2c8e99['map'](function(_0x5e2d09){return{'id':_0x5e2d09['id']};}));return OpenchannelMessage[_0x749e('0x8')]({'where':{'OpenchannelInteractionId':_0x73f0f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x749e('0x9')](function(_0x5223a5){_0x73f0f[_0x749e('0x6')](_0x749e('0xa'),_0x5223a5[_0x749e('0xb')]);OpenchannelInteractionEvents[_0x749e('0xc')](_0x764739+':'+_0x73f0f['id'],_0x73f0f);OpenchannelInteractionEvents[_0x749e('0xc')](_0x764739,_0x73f0f);_0x3b328b(null);})[_0x749e('0xd')](_0x3b328b(null));};}for(var e in events){if(events[_0x749e('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x749e('0xf')](e,emitEvent(event));}}module[_0x749e('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 105e935..ac89464 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 _0x650c=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','utf8mb4_unicode_ci','changed'];(function(_0x25616a,_0x1161ff){var _0x5bb255=function(_0x442e77){while(--_0x442e77){_0x25616a['push'](_0x25616a['shift']());}};_0x5bb255(++_0x1161ff);}(_0x650c,0xcf));var _0xc650=function(_0x1913a5,_0x18c610){_0x1913a5=_0x1913a5-0x0;var _0x58b6af=_0x650c[_0x1913a5];return _0x58b6af;};'use strict';var _=require(_0xc650('0x0'));var util=require(_0xc650('0x1'));var logger=require(_0xc650('0x2'))(_0xc650('0x3'));var moment=require(_0xc650('0x4'));var BPromise=require(_0xc650('0x5'));var rp=require(_0xc650('0x6'));var fs=require('fs');var path=require(_0xc650('0x7'));var rimraf=require(_0xc650('0x8'));var config=require(_0xc650('0x9'));var attributes=require(_0xc650('0xa'));module[_0xc650('0xb')]=function(_0x309d15,_0xc0554e){return _0x309d15['define']('OpenchannelInteraction',attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc650('0xc'),'hooks':{'beforeUpdate':function(_0x359a3c,_0x1df7ac,_0x14f2a8){if(_0x359a3c[_0xc650('0xd')]('closed')){_0x359a3c[_0xc650('0xe')]=moment()[_0xc650('0xf')](_0xc650('0x10'));}_0x14f2a8(null,_0x359a3c);}}});}; \ No newline at end of file +var _0xdb26=['openchannel_interactions','utf8mb4','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports'];(function(_0x59ce3c,_0x4c3975){var _0x144780=function(_0x1f5768){while(--_0x1f5768){_0x59ce3c['push'](_0x59ce3c['shift']());}};_0x144780(++_0x4c3975);}(_0xdb26,0x86));var _0x6db2=function(_0x285c9,_0x53c6a8){_0x285c9=_0x285c9-0x0;var _0x1f4d83=_0xdb26[_0x285c9];return _0x1f4d83;};'use strict';var _=require('lodash');var util=require(_0x6db2('0x0'));var logger=require(_0x6db2('0x1'))('api');var moment=require(_0x6db2('0x2'));var BPromise=require(_0x6db2('0x3'));var rp=require(_0x6db2('0x4'));var fs=require('fs');var path=require(_0x6db2('0x5'));var rimraf=require(_0x6db2('0x6'));var config=require(_0x6db2('0x7'));var attributes=require(_0x6db2('0x8'));module[_0x6db2('0x9')]=function(_0x41c9ad,_0x559e9e){return _0x41c9ad['define']('OpenchannelInteraction',attributes,{'tableName':_0x6db2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6db2('0xb'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x521c28,_0x48caca,_0x4f5381){if(_0x521c28['changed'](_0x6db2('0xc'))){_0x521c28[_0x6db2('0xd')]=moment()[_0x6db2('0xe')](_0x6db2('0xf'));}_0x4f5381(null,_0x521c28);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 3bc0697..d4c6b17 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 _0xc76e=['raw','options','where','attributes','limit','UpdateOpenchannelInteraction','find','then','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','request','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','OpenchannelInteraction','update'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc76e,0x1f2));var _0xec76=function(_0x27c514,_0x52df7c){_0x27c514=_0x27c514-0x0;var _0x18a426=_0xc76e[_0x27c514];return _0x18a426;};'use strict';var _=require(_0xec76('0x0'));var util=require(_0xec76('0x1'));var moment=require(_0xec76('0x2'));var BPromise=require(_0xec76('0x3'));var rs=require(_0xec76('0x4'));var fs=require('fs');var Redis=require(_0xec76('0x5'));var db=require(_0xec76('0x6'))['db'];var utils=require(_0xec76('0x7'));var logger=require(_0xec76('0x8'))('rpc');var config=require(_0xec76('0x9'));var jayson=require(_0xec76('0xa'));var client=jayson[_0xec76('0xb')][_0xec76('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xec76('0xd')],{'host':_0xec76('0xe'),'port':0x18eb});var socket=require(_0xec76('0xf'))(new Redis(config[_0xec76('0xd')]));require(_0xec76('0x10'))['register'](socket);function respondWithRpcPromise(_0xa564b4,_0x3d0c6f,_0xf3f054){return new BPromise(function(_0x66493b,_0xcea045){return client[_0xec76('0x11')](_0xa564b4,_0xf3f054)['then'](function(_0x3a673e){logger['info'](_0xec76('0x12'),_0x3d0c6f,_0xec76('0x13'));logger[_0xec76('0x14')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x3d0c6f,_0xec76('0x13'),JSON[_0xec76('0x15')](_0x3a673e));if(_0x3a673e['error']){if(_0x3a673e[_0xec76('0x16')][_0xec76('0x17')]===0x1f4){logger[_0xec76('0x16')](_0xec76('0x12'),_0x3d0c6f,_0x3a673e['error']['message']);return _0xcea045(_0x3a673e['error'][_0xec76('0x18')]);}logger[_0xec76('0x16')](_0xec76('0x12'),_0x3d0c6f,_0x3a673e[_0xec76('0x16')]['message']);return _0x66493b(_0x3a673e['error'][_0xec76('0x18')]);}else{logger[_0xec76('0x19')](_0xec76('0x12'),_0x3d0c6f,_0xec76('0x13'));_0x66493b(_0x3a673e[_0xec76('0x1a')][_0xec76('0x18')]);}})[_0xec76('0x1b')](function(_0x5834d2){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x3d0c6f,_0x5834d2);_0xcea045(_0x5834d2);});});}exports['UpdateOpenchannelInteraction']=function(_0x3720dd){var _0x103cf4=this;return new Promise(function(_0x235932,_0x38ebfd){return db[_0xec76('0x1c')][_0xec76('0x1d')](_0x3720dd['body'],{'raw':_0x3720dd['options']?_0x3720dd['options'][_0xec76('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3720dd[_0xec76('0x1f')]?_0x3720dd[_0xec76('0x1f')][_0xec76('0x20')]||null:null,'attributes':_0x3720dd[_0xec76('0x1f')]?_0x3720dd['options'][_0xec76('0x21')]||null:null,'limit':_0x3720dd[_0xec76('0x1f')]?_0x3720dd[_0xec76('0x1f')][_0xec76('0x22')]||null:null})['then'](function(_0x3c5926){logger['info'](_0xec76('0x23'),_0x3720dd);logger['debug'](_0xec76('0x23'),_0x3720dd,JSON[_0xec76('0x15')](_0x3c5926));_0x235932(_0x3c5926);})['catch'](function(_0x258cec){logger[_0xec76('0x16')](_0xec76('0x23'),_0x258cec[_0xec76('0x18')],_0x3720dd);_0x38ebfd(_0x103cf4[_0xec76('0x16')](0x1f4,_0x258cec[_0xec76('0x18')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x41cd5d){return new Promise(function(_0x5fb6b9,_0xbe50b4){return db[_0xec76('0x1c')][_0xec76('0x24')]({'where':_0x41cd5d[_0xec76('0x1f')]?_0x41cd5d['options'][_0xec76('0x20')]||null:null})[_0xec76('0x25')](function(_0xce20f8){if(_0xce20f8){return _0xce20f8[_0xec76('0x26')](_0x41cd5d[_0xec76('0x27')][_0xec76('0x28')],_[_0xec76('0x29')](_0x41cd5d['body'],[_0xec76('0x28'),'id'])||{});}})[_0xec76('0x2a')](function(_0xb47b57){logger[_0xec76('0x19')](_0xec76('0x2b'),_0x41cd5d);logger['debug']('AddTags',_0x41cd5d,JSON[_0xec76('0x15')](_0xb47b57));_0x5fb6b9(_0xb47b57);})[_0xec76('0x1b')](function(_0x4fb8c0){logger[_0xec76('0x16')]('AddTags',_0x4fb8c0[_0xec76('0x18')],_0x41cd5d);_0xbe50b4(_this[_0xec76('0x16')](0x1f4,_0x4fb8c0[_0xec76('0x18')]));});});}; \ No newline at end of file +var _0x6a32=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','./openchannelInteraction.socket','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateOpenchannelInteraction','body','options','raw','where','attributes','limit','debug','OpenchannelInteraction','find','ids','omit','spread','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x6a32,0x15a));var _0x26a3=function(_0x500729,_0x32ed4a){_0x500729=_0x500729-0x0;var _0x2d2ab4=_0x6a32[_0x500729];return _0x2d2ab4;};'use strict';var _=require(_0x26a3('0x0'));var util=require('util');var moment=require(_0x26a3('0x1'));var BPromise=require(_0x26a3('0x2'));var rs=require(_0x26a3('0x3'));var fs=require('fs');var Redis=require(_0x26a3('0x4'));var db=require(_0x26a3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x26a3('0x6'))(_0x26a3('0x7'));var config=require('../../config/environment');var jayson=require(_0x26a3('0x8'));var client=jayson[_0x26a3('0x9')][_0x26a3('0xa')]({'port':0x232a});config['redis']=_[_0x26a3('0xb')](config[_0x26a3('0xc')],{'host':_0x26a3('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x26a3('0xc')]));require(_0x26a3('0xe'))[_0x26a3('0xf')](socket);function respondWithRpcPromise(_0x3e26ef,_0x16589c,_0x58cf4a){return new BPromise(function(_0xd87601,_0x1731f){return client['request'](_0x3e26ef,_0x58cf4a)[_0x26a3('0x10')](function(_0x1479b4){logger[_0x26a3('0x11')](_0x26a3('0x12'),_0x16589c,_0x26a3('0x13'));logger['debug'](_0x26a3('0x14'),_0x16589c,_0x26a3('0x13'),JSON[_0x26a3('0x15')](_0x1479b4));if(_0x1479b4['error']){if(_0x1479b4[_0x26a3('0x16')][_0x26a3('0x17')]===0x1f4){logger['error'](_0x26a3('0x12'),_0x16589c,_0x1479b4[_0x26a3('0x16')][_0x26a3('0x18')]);return _0x1731f(_0x1479b4[_0x26a3('0x16')][_0x26a3('0x18')]);}logger[_0x26a3('0x16')](_0x26a3('0x12'),_0x16589c,_0x1479b4['error'][_0x26a3('0x18')]);return _0xd87601(_0x1479b4[_0x26a3('0x16')]['message']);}else{logger[_0x26a3('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x16589c,_0x26a3('0x13'));_0xd87601(_0x1479b4['result']['message']);}})[_0x26a3('0x19')](function(_0x5b9b68){logger['error'](_0x26a3('0x12'),_0x16589c,_0x5b9b68);_0x1731f(_0x5b9b68);});});}exports[_0x26a3('0x1a')]=function(_0x31ed54){var _0x28b454=this;return new Promise(function(_0x5442a8,_0x1819a8){return db['OpenchannelInteraction']['update'](_0x31ed54[_0x26a3('0x1b')],{'raw':_0x31ed54[_0x26a3('0x1c')]?_0x31ed54[_0x26a3('0x1c')][_0x26a3('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31ed54['options']?_0x31ed54[_0x26a3('0x1c')][_0x26a3('0x1e')]||null:null,'attributes':_0x31ed54[_0x26a3('0x1c')]?_0x31ed54['options'][_0x26a3('0x1f')]||null:null,'limit':_0x31ed54['options']?_0x31ed54[_0x26a3('0x1c')][_0x26a3('0x20')]||null:null})[_0x26a3('0x10')](function(_0x563c02){logger[_0x26a3('0x11')](_0x26a3('0x1a'),_0x31ed54);logger[_0x26a3('0x21')](_0x26a3('0x1a'),_0x31ed54,JSON[_0x26a3('0x15')](_0x563c02));_0x5442a8(_0x563c02);})['catch'](function(_0x5b31a8){logger[_0x26a3('0x16')](_0x26a3('0x1a'),_0x5b31a8['message'],_0x31ed54);_0x1819a8(_0x28b454[_0x26a3('0x16')](0x1f4,_0x5b31a8[_0x26a3('0x18')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x5c0479){return new Promise(function(_0x2167ce,_0x41b6f8){return db[_0x26a3('0x22')][_0x26a3('0x23')]({'where':_0x5c0479['options']?_0x5c0479[_0x26a3('0x1c')][_0x26a3('0x1e')]||null:null})[_0x26a3('0x10')](function(_0x458445){if(_0x458445){return _0x458445['addTags'](_0x5c0479[_0x26a3('0x1b')][_0x26a3('0x24')],_[_0x26a3('0x25')](_0x5c0479['body'],[_0x26a3('0x24'),'id'])||{});}})[_0x26a3('0x26')](function(_0x1f1a69){logger['info']('AddTags',_0x5c0479);logger[_0x26a3('0x21')]('AddTags',_0x5c0479,JSON[_0x26a3('0x15')](_0x1f1a69));_0x2167ce(_0x1f1a69);})[_0x26a3('0x19')](function(_0x1430ba){logger[_0x26a3('0x16')]('AddTags',_0x1430ba[_0x26a3('0x18')],_0x5c0479);_0x41b6f8(_this[_0x26a3('0x16')](0x1f4,_0x1430ba[_0x26a3('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index fd14471..af7506f 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 _0x6569=['remove','update','emit','register','length','openchannelInteraction:','./openchannelInteraction.events','save'];(function(_0x37f2d0,_0x3af109){var _0x476a86=function(_0x419d21){while(--_0x419d21){_0x37f2d0['push'](_0x37f2d0['shift']());}};_0x476a86(++_0x3af109);}(_0x6569,0x116));var _0x9656=function(_0x489404,_0x34eabb){_0x489404=_0x489404-0x0;var _0x2adb1a=_0x6569[_0x489404];return _0x2adb1a;};'use strict';var OpenchannelInteractionEvents=require(_0x9656('0x0'));var events=[_0x9656('0x1'),_0x9656('0x2'),_0x9656('0x3')];function createListener(_0x450961,_0x30df58){return function(_0x58b79){_0x30df58[_0x9656('0x4')](_0x450961,_0x58b79);};}function removeListener(_0x26970b,_0x282f00){return function(){OpenchannelInteractionEvents['removeListener'](_0x26970b,_0x282f00);};}exports[_0x9656('0x5')]=function(_0x394a41){for(var _0x218505=0x0,_0x4e803b=events[_0x9656('0x6')];_0x218505<_0x4e803b;_0x218505++){var _0x53b423=events[_0x218505];var _0x176f79=createListener(_0x9656('0x7')+_0x53b423,_0x394a41);OpenchannelInteractionEvents['on'](_0x53b423,_0x176f79);}}; \ No newline at end of file +var _0x719a=['update','emit','register','length','openchannelInteraction:'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x719a,0xb4));var _0xa719=function(_0x49965b,_0x58e1d8){_0x49965b=_0x49965b-0x0;var _0x9a8397=_0x719a[_0x49965b];return _0x9a8397;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=['save','remove',_0xa719('0x0')];function createListener(_0x29d42b,_0xe45129){return function(_0x49c6af){_0xe45129[_0xa719('0x1')](_0x29d42b,_0x49c6af);};}function removeListener(_0x2dc7d2,_0x4ba30a){return function(){OpenchannelInteractionEvents['removeListener'](_0x2dc7d2,_0x4ba30a);};}exports[_0xa719('0x2')]=function(_0x2b9c9f){for(var _0x25abc0=0x0,_0x1e5cd=events[_0xa719('0x3')];_0x25abc0<_0x1e5cd;_0x25abc0++){var _0x4dfcb1=events[_0x25abc0];var _0x1d8f59=createListener(_0xa719('0x4')+_0x4dfcb1,_0x2b9c9f);OpenchannelInteractionEvents['on'](_0x4dfcb1,_0x1d8f59);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 222b704..84f57db 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 _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0x1b2781,_0x50b74d){var _0x226750=function(_0x3f46a1){while(--_0x3f46a1){_0x1b2781['push'](_0x1b2781['shift']());}};_0x226750(++_0x50b74d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x30d87a,_0xf3a07f){_0x30d87a=_0x30d87a-0x0;var _0x48f64b=_0xcb91[_0x30d87a];return _0x48f64b;};'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');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router; \ No newline at end of file +var _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x54b892,_0x2a3009){var _0x1256e1=function(_0x32278b){while(--_0x32278b){_0x54b892['push'](_0x54b892['shift']());}};_0x1256e1(++_0x2a3009);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 8b063dd..1b76c8e 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 _0xfd6f=['medium','BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT'];(function(_0x424e31,_0x3ee68a){var _0x40ec94=function(_0x5c58e5){while(--_0x5c58e5){_0x424e31['push'](_0x424e31['shift']());}};_0x40ec94(++_0x3ee68a);}(_0xfd6f,0x19d));var _0xffd6=function(_0x1bfc34,_0x48a787){_0x1bfc34=_0x1bfc34-0x0;var _0x3e3d4c=_0xfd6f[_0x1bfc34];return _0x3e3d4c;};'use strict';var Sequelize=require(_0xffd6('0x0'));module[_0xffd6('0x1')]={'body':{'type':Sequelize[_0xffd6('0x2')](_0xffd6('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xffd6('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xffd6('0x5')]('in',_0xffd6('0x6')),'defaultValue':_0xffd6('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xffd6('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xffd6('0x2')]}}; \ No newline at end of file +var _0x7be1=['BOOLEAN','ENUM','out','sequelize','exports','TEXT'];(function(_0xface13,_0x466c2c){var _0x50d99b=function(_0x486144){while(--_0x486144){_0xface13['push'](_0xface13['shift']());}};_0x50d99b(++_0x466c2c);}(_0x7be1,0x165));var _0x17be=function(_0x5fa520,_0xaf0e7d){_0x5fa520=_0x5fa520-0x0;var _0x1bf6c4=_0x7be1[_0x5fa520];return _0x1bf6c4;};'use strict';var Sequelize=require(_0x17be('0x0'));module[_0x17be('0x1')]={'body':{'type':Sequelize[_0x17be('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x17be('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x17be('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x17be('0x4')]('in',_0x17be('0x5')),'defaultValue':_0x17be('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 71c0cfa..124385d 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 _0xeb9a=['../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./openchannelMessage.socket','jayson/promise','client','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','fields','includeAll','find','create','body','params','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','get','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','agent','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','../../config/logger','RejectMessage','SELECT','User','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils'];(function(_0x5690a4,_0x572d64){var _0x170f91=function(_0x5458c1){while(--_0x5458c1){_0x5690a4['push'](_0x5690a4['shift']());}};_0x170f91(++_0x572d64);}(_0xeb9a,0x178));var _0xaeb9=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0xeb9a[_0x58e469];return _0x4c01c5;};'use strict';var emlformat=require(_0xaeb9('0x0'));var rimraf=require(_0xaeb9('0x1'));var zipdir=require(_0xaeb9('0x2'));var jsonpatch=require(_0xaeb9('0x3'));var rp=require('request-promise');var moment=require(_0xaeb9('0x4'));var BPromise=require(_0xaeb9('0x5'));var Mustache=require('mustache');var util=require(_0xaeb9('0x6'));var path=require(_0xaeb9('0x7'));var sox=require(_0xaeb9('0x8'));var csv=require(_0xaeb9('0x9'));var ejs=require(_0xaeb9('0xa'));var fs=require('fs');var fs_extra=require(_0xaeb9('0xb'));var _=require(_0xaeb9('0xc'));var squel=require(_0xaeb9('0xd'));var crypto=require(_0xaeb9('0xe'));var jsforce=require(_0xaeb9('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xaeb9('0x10'));var Redis=require(_0xaeb9('0x11'));var authService=require(_0xaeb9('0x12'));var qs=require(_0xaeb9('0x13'));var as=require(_0xaeb9('0x14'));var hardwareService=require(_0xaeb9('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xaeb9('0x16'));var config=require(_0xaeb9('0x17'));var licenseUtil=require(_0xaeb9('0x18'));var db=require(_0xaeb9('0x19'))['db'];config[_0xaeb9('0x1a')]=_['defaults'](config[_0xaeb9('0x1a')],{'host':_0xaeb9('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaeb9('0x1a')]));require(_0xaeb9('0x1c'))['register'](socket);var jayson=require(_0xaeb9('0x1d'));var client=jayson[_0xaeb9('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0xaeb9('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c1be9,_0x585f05,_0x4cee45,_0x21148e){return new BPromise(function(_0x237451,_0xe2fbba){var _0x4de008=_0x21148e||client;return _0x4de008[_0xaeb9('0x1f')](_0x2c1be9,_0x4cee45)[_0xaeb9('0x20')](function(_0x4196cf){logger['info'](_0xaeb9('0x21'),_0x585f05,_0xaeb9('0x22'));logger[_0xaeb9('0x23')](_0xaeb9('0x24'),_0x585f05,_0xaeb9('0x22'),JSON[_0xaeb9('0x25')](_0x4196cf));if(_0x4196cf[_0xaeb9('0x26')]){if(_0x4196cf[_0xaeb9('0x26')]['code']===0x1f4){logger[_0xaeb9('0x26')](_0xaeb9('0x21'),_0x585f05,_0x4196cf[_0xaeb9('0x26')][_0xaeb9('0x27')]);return _0xe2fbba(_0x4196cf['error'][_0xaeb9('0x27')]);}logger[_0xaeb9('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x585f05,_0x4196cf['error'][_0xaeb9('0x27')]);return _0x237451(_0x4196cf['error'][_0xaeb9('0x27')]);}else{logger[_0xaeb9('0x28')](_0xaeb9('0x21'),_0x585f05,_0xaeb9('0x22'));_0x237451(_0x4196cf['result'][_0xaeb9('0x27')]);}})[_0xaeb9('0x29')](function(_0x11258b){logger[_0xaeb9('0x26')](_0xaeb9('0x21'),_0x585f05,_0x11258b);_0xe2fbba(_0x11258b);});});}function respondWithStatusCode(_0x323f52,_0x51c163){_0x51c163=_0x51c163||0xcc;return function(_0x2737a1){if(_0x2737a1){return _0x323f52[_0xaeb9('0x2a')](_0x51c163);}return _0x323f52[_0xaeb9('0x2b')](_0x51c163)[_0xaeb9('0x2c')]();};}function respondWithResult(_0x341f79,_0x11833f){_0x11833f=_0x11833f||0xc8;return function(_0x16f173){if(_0x16f173){return _0x341f79[_0xaeb9('0x2b')](_0x11833f)[_0xaeb9('0x2d')](_0x16f173);}};}function respondWithFilteredResult(_0x12bcb2,_0x1b801b){return function(_0x55a3fd){if(_0x55a3fd){var _0xb5d492=typeof _0x1b801b['offset']===_0xaeb9('0x2e')&&typeof _0x1b801b[_0xaeb9('0x2f')]===_0xaeb9('0x2e');var _0x359013=_0x55a3fd[_0xaeb9('0x30')];var _0x2cece1=_0xb5d492?0x0:_0x1b801b[_0xaeb9('0x31')];var _0x4652c9=_0xb5d492?_0x55a3fd['count']:_0x1b801b[_0xaeb9('0x31')]+_0x1b801b[_0xaeb9('0x2f')];var _0x34cd8e;if(_0x4652c9>=_0x359013){_0x4652c9=_0x359013;_0x34cd8e=0xc8;}else{_0x34cd8e=0xce;}_0x12bcb2['status'](_0x34cd8e);return _0x12bcb2[_0xaeb9('0x32')](_0xaeb9('0x33'),_0x2cece1+'-'+_0x4652c9+'/'+_0x359013)[_0xaeb9('0x2d')](_0x55a3fd);}return null;};}function patchUpdates(_0x484dad){return function(_0x7fc0a8){try{jsonpatch[_0xaeb9('0x34')](_0x7fc0a8,_0x484dad,!![]);}catch(_0x2f76cc){return BPromise[_0xaeb9('0x35')](_0x2f76cc);}return _0x7fc0a8[_0xaeb9('0x36')]();};}function saveUpdates(_0x4d8b1b,_0x3ae23b){return function(_0xa6a734){if(_0xa6a734){return _0xa6a734[_0xaeb9('0x37')](_0x4d8b1b)[_0xaeb9('0x20')](function(_0x2661d3){return _0x2661d3;});}return null;};}function removeEntity(_0x2cd6d4,_0x3977ac){return function(_0x151bf2){if(_0x151bf2){return _0x151bf2[_0xaeb9('0x38')]()['then'](function(){_0x2cd6d4['status'](0xcc)[_0xaeb9('0x2c')]();});}};}function handleEntityNotFound(_0x2f7b71,_0x3d8ab3){return function(_0x415446){if(!_0x415446){_0x2f7b71[_0xaeb9('0x2a')](0x194);}return _0x415446;};}function handleError(_0x454d26,_0x56705f){_0x56705f=_0x56705f||0x1f4;return function(_0x17d892){logger[_0xaeb9('0x26')](_0x17d892[_0xaeb9('0x39')]);if(_0x17d892['name']){delete _0x17d892[_0xaeb9('0x3a')];}_0x454d26[_0xaeb9('0x2b')](_0x56705f)[_0xaeb9('0x3b')](_0x17d892);};}exports[_0xaeb9('0x3c')]=function(_0x13d64b,_0x27e7c3){var _0xf1b7be={},_0x19e5d1={},_0x19eb21={'count':0x0,'rows':[]};var _0x4fdf40=_[_0xaeb9('0x3d')](db[_0xaeb9('0x3e')][_0xaeb9('0x3f')],function(_0x488bf5){return{'name':_0x488bf5[_0xaeb9('0x40')],'type':_0x488bf5['type'][_0xaeb9('0x41')]};});_0x19e5d1[_0xaeb9('0x42')]=_['map'](_0x4fdf40,'name');_0x19e5d1[_0xaeb9('0x43')]=_[_0xaeb9('0x44')](_0x13d64b[_0xaeb9('0x43')]);_0x19e5d1[_0xaeb9('0x45')]=_[_0xaeb9('0x46')](_0x19e5d1[_0xaeb9('0x42')],_0x19e5d1['query']);_0xf1b7be[_0xaeb9('0x47')]=_[_0xaeb9('0x46')](_0x19e5d1[_0xaeb9('0x42')],qs['fields'](_0x13d64b[_0xaeb9('0x43')]['fields']));_0xf1b7be[_0xaeb9('0x47')]=_0xf1b7be['attributes'][_0xaeb9('0x48')]?_0xf1b7be['attributes']:_0x19e5d1[_0xaeb9('0x42')];if(!_0x13d64b['query'][_0xaeb9('0x49')](_0xaeb9('0x4a'))){_0xf1b7be[_0xaeb9('0x2f')]=qs['limit'](_0x13d64b[_0xaeb9('0x43')]['limit']);_0xf1b7be[_0xaeb9('0x31')]=qs[_0xaeb9('0x31')](_0x13d64b['query']['offset']);}_0xf1b7be[_0xaeb9('0x4b')]=qs[_0xaeb9('0x4c')](_0x13d64b[_0xaeb9('0x43')][_0xaeb9('0x4c')]);_0xf1b7be[_0xaeb9('0x4d')]=qs[_0xaeb9('0x45')](_['pick'](_0x13d64b[_0xaeb9('0x43')],_0x19e5d1[_0xaeb9('0x45')]),_0x4fdf40);if(_0x13d64b[_0xaeb9('0x43')][_0xaeb9('0x4e')]){_0xf1b7be[_0xaeb9('0x4d')]=_[_0xaeb9('0x4f')](_0xf1b7be[_0xaeb9('0x4d')],{'$or':_[_0xaeb9('0x3d')](_0x4fdf40,function(_0x4c329){if(_0x4c329[_0xaeb9('0x50')]!==_0xaeb9('0x51')){var _0x1bf799={};_0x1bf799[_0x4c329[_0xaeb9('0x3a')]]={'$like':'%'+_0x13d64b['query']['filter']+'%'};return _0x1bf799;}})});}_0xf1b7be=_['merge']({},_0xf1b7be,_0x13d64b[_0xaeb9('0x52')]);var _0x1dbe2e={'where':_0xf1b7be[_0xaeb9('0x4d')]};return db[_0xaeb9('0x3e')][_0xaeb9('0x30')](_0x1dbe2e)[_0xaeb9('0x20')](function(_0x41097a){_0x19eb21[_0xaeb9('0x30')]=_0x41097a;if(_0x13d64b[_0xaeb9('0x43')]['includeAll']){_0xf1b7be[_0xaeb9('0x53')]=[{'all':!![]}];}return db[_0xaeb9('0x3e')][_0xaeb9('0x54')](_0xf1b7be);})[_0xaeb9('0x20')](function(_0x2d0bae){_0x19eb21[_0xaeb9('0x55')]=_0x2d0bae;return _0x19eb21;})[_0xaeb9('0x20')](respondWithFilteredResult(_0x27e7c3,_0xf1b7be))[_0xaeb9('0x29')](handleError(_0x27e7c3,null));};exports[_0xaeb9('0x56')]=function(_0x18617b,_0x47b9db){var _0x49ecfe={'raw':!![],'where':{'id':_0x18617b['params']['id']}},_0x39e44d={};_0x39e44d[_0xaeb9('0x42')]=_[_0xaeb9('0x44')](db[_0xaeb9('0x3e')]['rawAttributes']);_0x39e44d[_0xaeb9('0x43')]=_[_0xaeb9('0x44')](_0x18617b[_0xaeb9('0x43')]);_0x39e44d['filters']=_[_0xaeb9('0x46')](_0x39e44d[_0xaeb9('0x42')],_0x39e44d[_0xaeb9('0x43')]);_0x49ecfe['attributes']=_['intersection'](_0x39e44d[_0xaeb9('0x42')],qs[_0xaeb9('0x57')](_0x18617b[_0xaeb9('0x43')][_0xaeb9('0x57')]));_0x49ecfe[_0xaeb9('0x47')]=_0x49ecfe[_0xaeb9('0x47')]['length']?_0x49ecfe[_0xaeb9('0x47')]:_0x39e44d['model'];if(_0x18617b[_0xaeb9('0x43')][_0xaeb9('0x58')]){_0x49ecfe[_0xaeb9('0x53')]=[{'all':!![]}];}_0x49ecfe=_['merge']({},_0x49ecfe,_0x18617b['options']);return db[_0xaeb9('0x3e')][_0xaeb9('0x59')](_0x49ecfe)[_0xaeb9('0x20')](handleEntityNotFound(_0x47b9db,null))['then'](respondWithResult(_0x47b9db,null))[_0xaeb9('0x29')](handleError(_0x47b9db,null));};exports[_0xaeb9('0x5a')]=function(_0x54f750,_0x5d3ccc){return db[_0xaeb9('0x3e')][_0xaeb9('0x5a')](_0x54f750[_0xaeb9('0x5b')],{})[_0xaeb9('0x20')](respondWithResult(_0x5d3ccc,0xc9))['catch'](handleError(_0x5d3ccc,null));};exports[_0xaeb9('0x37')]=function(_0x14a050,_0x1c1256){if(_0x14a050[_0xaeb9('0x5b')]['id']){delete _0x14a050[_0xaeb9('0x5b')]['id'];}return db[_0xaeb9('0x3e')][_0xaeb9('0x59')]({'where':{'id':_0x14a050[_0xaeb9('0x5c')]['id']}})[_0xaeb9('0x20')](handleEntityNotFound(_0x1c1256,null))[_0xaeb9('0x20')](saveUpdates(_0x14a050['body'],null))['then'](respondWithResult(_0x1c1256,null))[_0xaeb9('0x29')](handleError(_0x1c1256,null));};exports[_0xaeb9('0x38')]=function(_0x13b538,_0x1aadbf){return db[_0xaeb9('0x3e')][_0xaeb9('0x59')]({'where':{'id':_0x13b538[_0xaeb9('0x5c')]['id']}})[_0xaeb9('0x20')](handleEntityNotFound(_0x1aadbf,null))[_0xaeb9('0x20')](removeEntity(_0x1aadbf,null))[_0xaeb9('0x29')](handleError(_0x1aadbf,null));};exports['describe']=function(_0x30d3c5,_0xb169db){return db['OpenchannelMessage'][_0xaeb9('0x5d')]()[_0xaeb9('0x20')](respondWithResult(_0xb169db,null))[_0xaeb9('0x29')](handleError(_0xb169db,null));};var interaction_log=require('../../config/logger')(_0xaeb9('0x5e'));exports[_0xaeb9('0x5f')]=function(_0x3fe6b3,_0x53588a,_0x2180c5){var _0x122f1a={'agent':{},'channel':_0xaeb9('0x60')};if(_0x3fe6b3[_0xaeb9('0x5b')]['id']){delete _0x3fe6b3[_0xaeb9('0x5b')]['id'];}_0x3fe6b3[_0xaeb9('0x5b')][_0xaeb9('0x61')]=!![];_0x3fe6b3[_0xaeb9('0x5b')][_0xaeb9('0x62')]=moment()[_0xaeb9('0x63')](_0xaeb9('0x64'));_0x3fe6b3[_0xaeb9('0x5b')][_0xaeb9('0x65')]=_0x3fe6b3[_0xaeb9('0x5b')][_0xaeb9('0x65')]||_0x3fe6b3[_0xaeb9('0x66')]['id'];_0x122f1a['agent']['id']=_0x3fe6b3[_0xaeb9('0x5b')][_0xaeb9('0x65')];return db[_0xaeb9('0x3e')]['find']({'where':{'id':_0x3fe6b3['params']['id'],'UserId':null}})[_0xaeb9('0x20')](handleEntityNotFound(_0x53588a,null))[_0xaeb9('0x20')](saveUpdates(_0x3fe6b3[_0xaeb9('0x5b')],null))[_0xaeb9('0x20')](function(_0x4b3890){if(_0x4b3890){_0x122f1a[_0xaeb9('0x27')]=_0x4b3890['get']({'plain':!![]});return db[_0xaeb9('0x67')][_0xaeb9('0x59')]({'where':{'id':_0x4b3890[_0xaeb9('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x53588a,null))['then'](function(_0x51faf5){if(_0x51faf5){return _0x51faf5['update']({'UserId':_0x3fe6b3['body'][_0xaeb9('0x65')],'read1stAt':_[_0xaeb9('0x69')](_0x51faf5[_0xaeb9('0x6a')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xaeb9('0x20')](function(_0x291d8a){if(_0x291d8a){_0x122f1a[_0xaeb9('0x6b')]=_0x291d8a[_0xaeb9('0x6c')]({'plain':!![]});interaction_log[_0xaeb9('0x28')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3fe6b3[_0xaeb9('0x66')]['id'],_0x3fe6b3[_0xaeb9('0x66')][_0xaeb9('0x3a')],_0x3fe6b3['user'][_0xaeb9('0x6d')],_0x122f1a[_0xaeb9('0x6b')]['id'],_0x3fe6b3[_0xaeb9('0x5b')]?JSON['stringify'](_0x3fe6b3[_0xaeb9('0x5b')]):_0xaeb9('0x6e'));return respondWithRpcPromise(_0xaeb9('0x6f'),_0xaeb9('0x70'),_0x122f1a);}return null;})[_0xaeb9('0x20')](function(_0x95cb75){var _0xb6e331=_0xaeb9('0x71')+_0x95cb75['message'][_0xaeb9('0x72')];return db[_0xaeb9('0x73')][_0xaeb9('0x43')](_0xb6e331,{'type':db[_0xaeb9('0x74')][_0xaeb9('0x75')]['SELECT'],'raw':!![]})[_0xaeb9('0x20')](function(_0x32adc7){return _0x32adc7;});})[_0xaeb9('0x20')](function(_0x78e882){if(_0x78e882){_0x122f1a[_0xaeb9('0x27')][_0xaeb9('0x76')]=_0x78e882[0x0];if(!_0x3fe6b3[_0xaeb9('0x5b')][_0xaeb9('0x65')])return;return db['User'][_0xaeb9('0x59')]({'where':{'id':_0x3fe6b3['body']['UserId'],'role':_0xaeb9('0x77')},'attributes':['id',_0xaeb9('0x3a'),_0xaeb9('0x78'),_0xaeb9('0x79'),_0xaeb9('0x7a')],'raw':!![]});}return null;})[_0xaeb9('0x20')](function(_0x748834){if(!_0x748834)return null;_0x122f1a[_0xaeb9('0x27')][_0xaeb9('0x77')]=_0x748834;return _0x122f1a;})[_0xaeb9('0x20')](function(_0x8f7378){if(_0x8f7378){if(_0x3fe6b3[_0xaeb9('0x5b')]['manual']){_0x122f1a[_0xaeb9('0x27')][_0xaeb9('0x7b')]=util['format'](_0xaeb9('0x7c'),_0x3fe6b3[_0xaeb9('0x66')][_0xaeb9('0x3a')]);_0x122f1a[_0xaeb9('0x27')][_0xaeb9('0x7d')]=_0x122f1a[_0xaeb9('0x7d')];_0x122f1a[_0xaeb9('0x27')][_0xaeb9('0x7e')]=_0x122f1a[_0xaeb9('0x7d')];_0x122f1a['message'][_0xaeb9('0x7f')]=_0xaeb9('0x5f');return respondWithRpcPromise(_0xaeb9('0x80'),_0xaeb9('0x80'),{'event':'acceptmessage','message':_0x122f1a[_0xaeb9('0x27')]},client9002)[_0xaeb9('0x20')](function(){return _0x122f1a;});}return _0x122f1a;}return null;})[_0xaeb9('0x20')](respondWithResult(_0x53588a,null))[_0xaeb9('0x29')](handleError(_0x53588a,null));};var interaction_log=require(_0xaeb9('0x81'))('openchannel-interactions');exports[_0xaeb9('0x35')]=function(_0xf19ad7,_0x5e547d,_0x3cbcf9){var _0x497202={'agent':{},'channel':_0xaeb9('0x60')};if(_0xf19ad7[_0xaeb9('0x5b')]['id']){delete _0xf19ad7[_0xaeb9('0x5b')]['id'];}_0xf19ad7['body'][_0xaeb9('0x65')]=_0xf19ad7[_0xaeb9('0x5b')][_0xaeb9('0x65')]||_0xf19ad7[_0xaeb9('0x66')]['id'];_0x497202[_0xaeb9('0x77')]['id']=_0xf19ad7[_0xaeb9('0x5b')][_0xaeb9('0x65')];return db['OpenchannelMessage'][_0xaeb9('0x59')]({'where':{'id':_0xf19ad7[_0xaeb9('0x5c')]['id'],'UserId':null}})[_0xaeb9('0x20')](handleEntityNotFound(_0x5e547d,null))[_0xaeb9('0x20')](function(_0x36b403){if(_0x36b403){_0x497202['message']=_0x36b403[_0xaeb9('0x6c')]({'plain':!![]});return db['OpenchannelInteraction'][_0xaeb9('0x59')]({'where':{'id':_0x36b403[_0xaeb9('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x5e547d,null))['then'](function(_0x596bd6){if(_0x596bd6){_0x497202[_0xaeb9('0x6b')]=_0x596bd6['get']({'plain':!![]});interaction_log[_0xaeb9('0x28')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xf19ad7[_0xaeb9('0x66')]['id'],_0xf19ad7[_0xaeb9('0x66')][_0xaeb9('0x3a')],_0xf19ad7['user'][_0xaeb9('0x6d')],_0x497202['interaction']['id'],_0xf19ad7[_0xaeb9('0x5b')]?JSON[_0xaeb9('0x25')](_0xf19ad7[_0xaeb9('0x5b')]):_0xaeb9('0x6e'));return respondWithRpcPromise(_0xaeb9('0x82'),'rejectMessage',_0x497202);}return null;})[_0xaeb9('0x20')](function(_0x359826){var _0x131c8d=_0xaeb9('0x71')+_0x359826[_0xaeb9('0x27')]['ContactId'];return db[_0xaeb9('0x73')][_0xaeb9('0x43')](_0x131c8d,{'type':db[_0xaeb9('0x74')][_0xaeb9('0x75')][_0xaeb9('0x83')],'raw':!![]})[_0xaeb9('0x20')](function(_0x30d077){return _0x30d077;});})[_0xaeb9('0x20')](function(_0x548420){if(_0x548420){_0x497202[_0xaeb9('0x27')][_0xaeb9('0x76')]=_0x548420[0x0];if(!_0xf19ad7['body'][_0xaeb9('0x65')])return;return db[_0xaeb9('0x84')]['find']({'where':{'id':_0xf19ad7[_0xaeb9('0x5b')][_0xaeb9('0x65')],'role':_0xaeb9('0x77')},'attributes':['id',_0xaeb9('0x3a'),_0xaeb9('0x78'),_0xaeb9('0x79'),_0xaeb9('0x7a')],'raw':!![]});}return null;})[_0xaeb9('0x20')](function(_0x275436){if(!_0x275436)return null;_0x497202['message'][_0xaeb9('0x77')]=_0x275436;return _0x497202;})[_0xaeb9('0x20')](function(_0x1689d1){if(_0x1689d1){_0x1689d1['message'][_0xaeb9('0x7b')]=util[_0xaeb9('0x63')]('SIP/%s',_0xf19ad7[_0xaeb9('0x66')][_0xaeb9('0x3a')]);_0x1689d1[_0xaeb9('0x27')][_0xaeb9('0x7d')]=_0x497202['channel'];_0x1689d1[_0xaeb9('0x27')][_0xaeb9('0x7e')]=_0x497202[_0xaeb9('0x7d')];_0x1689d1[_0xaeb9('0x27')][_0xaeb9('0x7f')]=_0xaeb9('0x35');respondWithRpcPromise(_0xaeb9('0x80'),_0xaeb9('0x80'),{'event':'rejectmessage','message':_0x1689d1[_0xaeb9('0x27')]},client9002);return _0x497202;}return null;})['then'](respondWithResult(_0x5e547d,null))['catch'](handleError(_0x5e547d,null));}; \ No newline at end of file +var _0xa49e=['catch','status','end','json','offset','undefined','limit','set','apply','save','update','destroy','sendStatus','stack','name','send','index','map','OpenchannelMessage','fieldName','query','filters','model','attributes','fields','length','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','count','includeAll','rows','params','keys','rawAttributes','intersection','include','body','find','describe','openchannel','read','readAt','format','UserId','user','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','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','contact','agent','fullname','email','internal','interface','channel','motionChannel','event','accept','EventManager','openchannel-interactions','reject','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','User','SIP/%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','client','http','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result'];(function(_0x745056,_0x17ad23){var _0x161786=function(_0x3529b1){while(--_0x3529b1){_0x745056['push'](_0x745056['shift']());}};_0x161786(++_0x17ad23);}(_0xa49e,0x1de));var _0xea49=function(_0x4595c7,_0x1dfd25){_0x4595c7=_0x4595c7-0x0;var _0x506697=_0xa49e[_0x4595c7];return _0x506697;};'use strict';var emlformat=require(_0xea49('0x0'));var rimraf=require(_0xea49('0x1'));var zipdir=require(_0xea49('0x2'));var jsonpatch=require(_0xea49('0x3'));var rp=require(_0xea49('0x4'));var moment=require(_0xea49('0x5'));var BPromise=require(_0xea49('0x6'));var Mustache=require(_0xea49('0x7'));var util=require('util');var path=require(_0xea49('0x8'));var sox=require(_0xea49('0x9'));var csv=require(_0xea49('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xea49('0xb'));var _=require(_0xea49('0xc'));var squel=require(_0xea49('0xd'));var crypto=require(_0xea49('0xe'));var jsforce=require(_0xea49('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xea49('0xa'));var querystring=require('querystring');var Papa=require(_0xea49('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xea49('0x11'));var hardwareService=require(_0xea49('0x12'));var logger=require(_0xea49('0x13'))(_0xea49('0x14'));var utils=require(_0xea49('0x15'));var config=require(_0xea49('0x16'));var licenseUtil=require(_0xea49('0x17'));var db=require(_0xea49('0x18'))['db'];config[_0xea49('0x19')]=_[_0xea49('0x1a')](config[_0xea49('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xea49('0x1b'))(new Redis(config[_0xea49('0x19')]));require(_0xea49('0x1c'))[_0xea49('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xea49('0x1e')][_0xea49('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0xea49('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x415114,_0x20a73d,_0x41a010,_0x5265a3){return new BPromise(function(_0x538efa,_0x427386){var _0x5ba281=_0x5265a3||client;return _0x5ba281[_0xea49('0x20')](_0x415114,_0x41a010)[_0xea49('0x21')](function(_0x27d0a2){logger['info'](_0xea49('0x22'),_0x20a73d,_0xea49('0x23'));logger[_0xea49('0x24')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x20a73d,_0xea49('0x23'),JSON['stringify'](_0x27d0a2));if(_0x27d0a2[_0xea49('0x25')]){if(_0x27d0a2[_0xea49('0x25')][_0xea49('0x26')]===0x1f4){logger[_0xea49('0x25')](_0xea49('0x22'),_0x20a73d,_0x27d0a2[_0xea49('0x25')][_0xea49('0x27')]);return _0x427386(_0x27d0a2[_0xea49('0x25')]['message']);}logger[_0xea49('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0x20a73d,_0x27d0a2[_0xea49('0x25')][_0xea49('0x27')]);return _0x538efa(_0x27d0a2[_0xea49('0x25')][_0xea49('0x27')]);}else{logger[_0xea49('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x20a73d,_0xea49('0x23'));_0x538efa(_0x27d0a2[_0xea49('0x29')][_0xea49('0x27')]);}})[_0xea49('0x2a')](function(_0xb13981){logger['error'](_0xea49('0x22'),_0x20a73d,_0xb13981);_0x427386(_0xb13981);});});}function respondWithStatusCode(_0x920b59,_0x2dc11b){_0x2dc11b=_0x2dc11b||0xcc;return function(_0xfd82fe){if(_0xfd82fe){return _0x920b59['sendStatus'](_0x2dc11b);}return _0x920b59[_0xea49('0x2b')](_0x2dc11b)[_0xea49('0x2c')]();};}function respondWithResult(_0x2c5f8d,_0x180d2b){_0x180d2b=_0x180d2b||0xc8;return function(_0x406332){if(_0x406332){return _0x2c5f8d['status'](_0x180d2b)[_0xea49('0x2d')](_0x406332);}};}function respondWithFilteredResult(_0x440af9,_0x2a753e){return function(_0x170898){if(_0x170898){var _0x1ed0d4=typeof _0x2a753e[_0xea49('0x2e')]===_0xea49('0x2f')&&typeof _0x2a753e[_0xea49('0x30')]===_0xea49('0x2f');var _0x4795d0=_0x170898['count'];var _0x1e63a2=_0x1ed0d4?0x0:_0x2a753e[_0xea49('0x2e')];var _0x9d2618=_0x1ed0d4?_0x170898['count']:_0x2a753e[_0xea49('0x2e')]+_0x2a753e['limit'];var _0x4e7bd6;if(_0x9d2618>=_0x4795d0){_0x9d2618=_0x4795d0;_0x4e7bd6=0xc8;}else{_0x4e7bd6=0xce;}_0x440af9[_0xea49('0x2b')](_0x4e7bd6);return _0x440af9[_0xea49('0x31')]('Content-Range',_0x1e63a2+'-'+_0x9d2618+'/'+_0x4795d0)[_0xea49('0x2d')](_0x170898);}return null;};}function patchUpdates(_0x4cd235){return function(_0x11d773){try{jsonpatch[_0xea49('0x32')](_0x11d773,_0x4cd235,!![]);}catch(_0xe41ea){return BPromise['reject'](_0xe41ea);}return _0x11d773[_0xea49('0x33')]();};}function saveUpdates(_0x99a2a4,_0x3cf9cc){return function(_0x42894e){if(_0x42894e){return _0x42894e[_0xea49('0x34')](_0x99a2a4)[_0xea49('0x21')](function(_0x108e17){return _0x108e17;});}return null;};}function removeEntity(_0x22bdb9,_0xa7dee5){return function(_0x502026){if(_0x502026){return _0x502026[_0xea49('0x35')]()[_0xea49('0x21')](function(){_0x22bdb9[_0xea49('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b9517,_0x219b6e){return function(_0xf9e98){if(!_0xf9e98){_0x2b9517[_0xea49('0x36')](0x194);}return _0xf9e98;};}function handleError(_0x5d771a,_0x4079c8){_0x4079c8=_0x4079c8||0x1f4;return function(_0x10a21c){logger[_0xea49('0x25')](_0x10a21c[_0xea49('0x37')]);if(_0x10a21c[_0xea49('0x38')]){delete _0x10a21c[_0xea49('0x38')];}_0x5d771a[_0xea49('0x2b')](_0x4079c8)[_0xea49('0x39')](_0x10a21c);};}exports[_0xea49('0x3a')]=function(_0x3548f9,_0x273a58){var _0x424dfb={},_0x318293={},_0x5e34ae={'count':0x0,'rows':[]};var _0x5cc46d=_[_0xea49('0x3b')](db[_0xea49('0x3c')]['rawAttributes'],function(_0x3026db){return{'name':_0x3026db[_0xea49('0x3d')],'type':_0x3026db['type']['key']};});_0x318293['model']=_[_0xea49('0x3b')](_0x5cc46d,_0xea49('0x38'));_0x318293[_0xea49('0x3e')]=_['keys'](_0x3548f9[_0xea49('0x3e')]);_0x318293[_0xea49('0x3f')]=_['intersection'](_0x318293[_0xea49('0x40')],_0x318293[_0xea49('0x3e')]);_0x424dfb[_0xea49('0x41')]=_['intersection'](_0x318293[_0xea49('0x40')],qs[_0xea49('0x42')](_0x3548f9[_0xea49('0x3e')][_0xea49('0x42')]));_0x424dfb['attributes']=_0x424dfb[_0xea49('0x41')][_0xea49('0x43')]?_0x424dfb[_0xea49('0x41')]:_0x318293[_0xea49('0x40')];if(!_0x3548f9[_0xea49('0x3e')]['hasOwnProperty'](_0xea49('0x44'))){_0x424dfb[_0xea49('0x30')]=qs['limit'](_0x3548f9[_0xea49('0x3e')]['limit']);_0x424dfb[_0xea49('0x2e')]=qs['offset'](_0x3548f9[_0xea49('0x3e')]['offset']);}_0x424dfb['order']=qs[_0xea49('0x45')](_0x3548f9['query'][_0xea49('0x45')]);_0x424dfb[_0xea49('0x46')]=qs[_0xea49('0x3f')](_[_0xea49('0x47')](_0x3548f9['query'],_0x318293['filters']),_0x5cc46d);if(_0x3548f9['query']['filter']){_0x424dfb[_0xea49('0x46')]=_[_0xea49('0x48')](_0x424dfb[_0xea49('0x46')],{'$or':_[_0xea49('0x3b')](_0x5cc46d,function(_0x9bf79){if(_0x9bf79[_0xea49('0x49')]!==_0xea49('0x4a')){var _0x18430d={};_0x18430d[_0x9bf79[_0xea49('0x38')]]={'$like':'%'+_0x3548f9[_0xea49('0x3e')][_0xea49('0x4b')]+'%'};return _0x18430d;}})});}_0x424dfb=_[_0xea49('0x48')]({},_0x424dfb,_0x3548f9[_0xea49('0x4c')]);var _0x127d06={'where':_0x424dfb[_0xea49('0x46')]};return db[_0xea49('0x3c')]['count'](_0x127d06)[_0xea49('0x21')](function(_0x1fb3bd){_0x5e34ae[_0xea49('0x4d')]=_0x1fb3bd;if(_0x3548f9['query'][_0xea49('0x4e')]){_0x424dfb['include']=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x424dfb);})[_0xea49('0x21')](function(_0x1c10c9){_0x5e34ae[_0xea49('0x4f')]=_0x1c10c9;return _0x5e34ae;})['then'](respondWithFilteredResult(_0x273a58,_0x424dfb))[_0xea49('0x2a')](handleError(_0x273a58,null));};exports['show']=function(_0x132b4a,_0x5ec9d9){var _0x67bd74={'raw':!![],'where':{'id':_0x132b4a[_0xea49('0x50')]['id']}},_0xfc818c={};_0xfc818c[_0xea49('0x40')]=_[_0xea49('0x51')](db[_0xea49('0x3c')][_0xea49('0x52')]);_0xfc818c['query']=_[_0xea49('0x51')](_0x132b4a[_0xea49('0x3e')]);_0xfc818c[_0xea49('0x3f')]=_[_0xea49('0x53')](_0xfc818c[_0xea49('0x40')],_0xfc818c[_0xea49('0x3e')]);_0x67bd74['attributes']=_['intersection'](_0xfc818c[_0xea49('0x40')],qs[_0xea49('0x42')](_0x132b4a[_0xea49('0x3e')][_0xea49('0x42')]));_0x67bd74[_0xea49('0x41')]=_0x67bd74['attributes'][_0xea49('0x43')]?_0x67bd74[_0xea49('0x41')]:_0xfc818c[_0xea49('0x40')];if(_0x132b4a[_0xea49('0x3e')][_0xea49('0x4e')]){_0x67bd74[_0xea49('0x54')]=[{'all':!![]}];}_0x67bd74=_[_0xea49('0x48')]({},_0x67bd74,_0x132b4a['options']);return db['OpenchannelMessage']['find'](_0x67bd74)['then'](handleEntityNotFound(_0x5ec9d9,null))[_0xea49('0x21')](respondWithResult(_0x5ec9d9,null))[_0xea49('0x2a')](handleError(_0x5ec9d9,null));};exports['create']=function(_0x6ffac6,_0x27851b){return db['OpenchannelMessage']['create'](_0x6ffac6[_0xea49('0x55')],{})[_0xea49('0x21')](respondWithResult(_0x27851b,0xc9))[_0xea49('0x2a')](handleError(_0x27851b,null));};exports[_0xea49('0x34')]=function(_0x1c9921,_0x55a176){if(_0x1c9921[_0xea49('0x55')]['id']){delete _0x1c9921[_0xea49('0x55')]['id'];}return db[_0xea49('0x3c')][_0xea49('0x56')]({'where':{'id':_0x1c9921['params']['id']}})[_0xea49('0x21')](handleEntityNotFound(_0x55a176,null))[_0xea49('0x21')](saveUpdates(_0x1c9921[_0xea49('0x55')],null))['then'](respondWithResult(_0x55a176,null))[_0xea49('0x2a')](handleError(_0x55a176,null));};exports[_0xea49('0x35')]=function(_0x3f3322,_0x3bf87a){return db[_0xea49('0x3c')][_0xea49('0x56')]({'where':{'id':_0x3f3322[_0xea49('0x50')]['id']}})[_0xea49('0x21')](handleEntityNotFound(_0x3bf87a,null))['then'](removeEntity(_0x3bf87a,null))[_0xea49('0x2a')](handleError(_0x3bf87a,null));};exports[_0xea49('0x57')]=function(_0x7714b,_0xe4f77c){return db[_0xea49('0x3c')]['describe']()[_0xea49('0x21')](respondWithResult(_0xe4f77c,null))['catch'](handleError(_0xe4f77c,null));};var interaction_log=require(_0xea49('0x13'))('openchannel-interactions');exports['accept']=function(_0x117b7d,_0x37cca8,_0x207d80){var _0x483ca7={'agent':{},'channel':_0xea49('0x58')};if(_0x117b7d[_0xea49('0x55')]['id']){delete _0x117b7d[_0xea49('0x55')]['id'];}_0x117b7d[_0xea49('0x55')][_0xea49('0x59')]=!![];_0x117b7d[_0xea49('0x55')][_0xea49('0x5a')]=moment()[_0xea49('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x117b7d['body'][_0xea49('0x5c')]=_0x117b7d[_0xea49('0x55')][_0xea49('0x5c')]||_0x117b7d[_0xea49('0x5d')]['id'];_0x483ca7['agent']['id']=_0x117b7d[_0xea49('0x55')][_0xea49('0x5c')];return db[_0xea49('0x3c')][_0xea49('0x56')]({'where':{'id':_0x117b7d[_0xea49('0x50')]['id'],'UserId':null}})[_0xea49('0x21')](handleEntityNotFound(_0x37cca8,null))['then'](saveUpdates(_0x117b7d[_0xea49('0x55')],null))['then'](function(_0x1adca8){if(_0x1adca8){_0x483ca7[_0xea49('0x27')]=_0x1adca8[_0xea49('0x5e')]({'plain':!![]});return db[_0xea49('0x5f')][_0xea49('0x56')]({'where':{'id':_0x1adca8[_0xea49('0x60')]}});}return null;})[_0xea49('0x21')](handleEntityNotFound(_0x37cca8,null))[_0xea49('0x21')](function(_0x1ebfe7){if(_0x1ebfe7){return _0x1ebfe7[_0xea49('0x34')]({'UserId':_0x117b7d['body'][_0xea49('0x5c')],'read1stAt':_['isNil'](_0x1ebfe7[_0xea49('0x61')])?moment()['format'](_0xea49('0x62')):undefined});}return null;})[_0xea49('0x21')](function(_0x546c66){if(_0x546c66){_0x483ca7[_0xea49('0x63')]=_0x546c66[_0xea49('0x5e')]({'plain':!![]});interaction_log[_0xea49('0x28')](_0xea49('0x64'),_0x117b7d['user']['id'],_0x117b7d[_0xea49('0x5d')]['name'],_0x117b7d[_0xea49('0x5d')][_0xea49('0x65')],_0x483ca7[_0xea49('0x63')]['id'],_0x117b7d[_0xea49('0x55')]?JSON[_0xea49('0x66')](_0x117b7d[_0xea49('0x55')]):_0xea49('0x67'));return respondWithRpcPromise(_0xea49('0x68'),_0xea49('0x69'),_0x483ca7);}return null;})[_0xea49('0x21')](function(_0x47e4cc){var _0x618b2a=_0xea49('0x6a')+_0x47e4cc['message'][_0xea49('0x6b')];return db[_0xea49('0x6c')][_0xea49('0x3e')](_0x618b2a,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0xe9fba4){return _0xe9fba4;});})[_0xea49('0x21')](function(_0x17c679){if(_0x17c679){_0x483ca7[_0xea49('0x27')][_0xea49('0x6d')]=_0x17c679[0x0];if(!_0x117b7d[_0xea49('0x55')][_0xea49('0x5c')])return;return db['User'][_0xea49('0x56')]({'where':{'id':_0x117b7d[_0xea49('0x55')][_0xea49('0x5c')],'role':_0xea49('0x6e')},'attributes':['id',_0xea49('0x38'),_0xea49('0x6f'),_0xea49('0x70'),_0xea49('0x71')],'raw':!![]});}return null;})['then'](function(_0x2ef95f){if(!_0x2ef95f)return null;_0x483ca7[_0xea49('0x27')]['agent']=_0x2ef95f;return _0x483ca7;})[_0xea49('0x21')](function(_0x4d3600){if(_0x4d3600){if(_0x117b7d['body']['manual']){_0x483ca7[_0xea49('0x27')][_0xea49('0x72')]=util['format']('SIP/%s',_0x117b7d[_0xea49('0x5d')][_0xea49('0x38')]);_0x483ca7[_0xea49('0x27')]['channel']=_0x483ca7[_0xea49('0x73')];_0x483ca7['message'][_0xea49('0x74')]=_0x483ca7[_0xea49('0x73')];_0x483ca7[_0xea49('0x27')][_0xea49('0x75')]=_0xea49('0x76');return respondWithRpcPromise(_0xea49('0x77'),_0xea49('0x77'),{'event':'acceptmessage','message':_0x483ca7[_0xea49('0x27')]},client9002)[_0xea49('0x21')](function(){return _0x483ca7;});}return _0x483ca7;}return null;})[_0xea49('0x21')](respondWithResult(_0x37cca8,null))['catch'](handleError(_0x37cca8,null));};var interaction_log=require(_0xea49('0x13'))(_0xea49('0x78'));exports[_0xea49('0x79')]=function(_0x55e207,_0x193561,_0x42b24f){var _0x40a950={'agent':{},'channel':'openchannel'};if(_0x55e207['body']['id']){delete _0x55e207[_0xea49('0x55')]['id'];}_0x55e207['body'][_0xea49('0x5c')]=_0x55e207[_0xea49('0x55')]['UserId']||_0x55e207[_0xea49('0x5d')]['id'];_0x40a950['agent']['id']=_0x55e207['body'][_0xea49('0x5c')];return db[_0xea49('0x3c')]['find']({'where':{'id':_0x55e207[_0xea49('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x193561,null))[_0xea49('0x21')](function(_0xe18012){if(_0xe18012){_0x40a950[_0xea49('0x27')]=_0xe18012[_0xea49('0x5e')]({'plain':!![]});return db[_0xea49('0x5f')][_0xea49('0x56')]({'where':{'id':_0xe18012[_0xea49('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x193561,null))[_0xea49('0x21')](function(_0x594405){if(_0x594405){_0x40a950[_0xea49('0x63')]=_0x594405[_0xea49('0x5e')]({'plain':!![]});interaction_log['info'](_0xea49('0x7a'),_0x55e207['user']['id'],_0x55e207[_0xea49('0x5d')][_0xea49('0x38')],_0x55e207['user'][_0xea49('0x65')],_0x40a950['interaction']['id'],_0x55e207[_0xea49('0x55')]?JSON[_0xea49('0x66')](_0x55e207[_0xea49('0x55')]):_0xea49('0x67'));return respondWithRpcPromise(_0xea49('0x7b'),_0xea49('0x7c'),_0x40a950);}return null;})[_0xea49('0x21')](function(_0x405ad1){var _0x184428=_0xea49('0x6a')+_0x405ad1[_0xea49('0x27')][_0xea49('0x6b')];return db[_0xea49('0x6c')][_0xea49('0x3e')](_0x184428,{'type':db[_0xea49('0x7d')][_0xea49('0x7e')][_0xea49('0x7f')],'raw':!![]})['then'](function(_0xc5b380){return _0xc5b380;});})[_0xea49('0x21')](function(_0x55a51b){if(_0x55a51b){_0x40a950[_0xea49('0x27')][_0xea49('0x6d')]=_0x55a51b[0x0];if(!_0x55e207[_0xea49('0x55')][_0xea49('0x5c')])return;return db[_0xea49('0x80')][_0xea49('0x56')]({'where':{'id':_0x55e207['body'][_0xea49('0x5c')],'role':_0xea49('0x6e')},'attributes':['id',_0xea49('0x38'),_0xea49('0x6f'),_0xea49('0x70'),_0xea49('0x71')],'raw':!![]});}return null;})['then'](function(_0x4948dc){if(!_0x4948dc)return null;_0x40a950[_0xea49('0x27')][_0xea49('0x6e')]=_0x4948dc;return _0x40a950;})[_0xea49('0x21')](function(_0x59235f){if(_0x59235f){_0x59235f['message']['interface']=util[_0xea49('0x5b')](_0xea49('0x81'),_0x55e207[_0xea49('0x5d')][_0xea49('0x38')]);_0x59235f[_0xea49('0x27')]['channel']=_0x40a950[_0xea49('0x73')];_0x59235f['message'][_0xea49('0x74')]=_0x40a950[_0xea49('0x73')];_0x59235f['message'][_0xea49('0x75')]=_0xea49('0x79');respondWithRpcPromise(_0xea49('0x77'),_0xea49('0x77'),{'event':'rejectmessage','message':_0x59235f[_0xea49('0x27')]},client9002);return _0x40a950;}return null;})[_0xea49('0x21')](respondWithResult(_0x193561,null))[_0xea49('0x2a')](handleError(_0x193561,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index db8696e..20837e1 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 _0xc893=['emit','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove'];(function(_0x1bd1f3,_0x570fd9){var _0x463a13=function(_0x169bde){while(--_0x169bde){_0x1bd1f3['push'](_0x1bd1f3['shift']());}};_0x463a13(++_0x570fd9);}(_0xc893,0x1e1));var _0x3c89=function(_0x1c5df3,_0x3a9f79){_0x1c5df3=_0x1c5df3-0x0;var _0x19d8b5=_0xc893[_0x1c5df3];return _0x19d8b5;};'use strict';var EventEmitter=require(_0x3c89('0x0'));var OpenchannelMessage=require(_0x3c89('0x1'))['db'][_0x3c89('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x3c89('0x3')](0x0);var events={'afterCreate':_0x3c89('0x4'),'afterUpdate':_0x3c89('0x5'),'afterDestroy':_0x3c89('0x6')};function emitEvent(_0x5d908b){return function(_0x40a023,_0x3d779f,_0x53dc93){OpenchannelMessageEvents['emit'](_0x5d908b+':'+_0x40a023['id'],_0x40a023);OpenchannelMessageEvents[_0x3c89('0x7')](_0x5d908b,_0x40a023);_0x53dc93(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0xacc7=['hasOwnProperty','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit'];(function(_0x248838,_0x4283e6){var _0x22b691=function(_0xd6feeb){while(--_0xd6feeb){_0x248838['push'](_0x248838['shift']());}};_0x22b691(++_0x4283e6);}(_0xacc7,0x13c));var _0x7acc=function(_0x3a23d3,_0x4088d8){_0x3a23d3=_0x3a23d3-0x0;var _0x10803b=_0xacc7[_0x3a23d3];return _0x10803b;};'use strict';var EventEmitter=require(_0x7acc('0x0'));var OpenchannelMessage=require(_0x7acc('0x1'))['db'][_0x7acc('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x7acc('0x3')](0x0);var events={'afterCreate':_0x7acc('0x4'),'afterUpdate':_0x7acc('0x5'),'afterDestroy':_0x7acc('0x6')};function emitEvent(_0x5647f7){return function(_0xa34679,_0x3151cb,_0x1aa389){OpenchannelMessageEvents[_0x7acc('0x7')](_0x5647f7+':'+_0xa34679['id'],_0xa34679);OpenchannelMessageEvents[_0x7acc('0x7')](_0x5647f7,_0xa34679);_0x1aa389(null);};}for(var e in events){if(events[_0x7acc('0x8')](e)){var event=events[e];OpenchannelMessage['hook'](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 7594d74..ec3570c 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 _0x2032=['body','models','direction','out','secret','then','createdAt','toLowerCase','catch','error','describe','OpenchannelAccount','find','OpenchannelInteraction','OpenchannelInteractionId','CmContact','Contact','keys','replyUri','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','omit','POST','method','GET','OpenchannelMessage,\x20%s,\x20%s','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages'];(function(_0x7c6489,_0x5deb7b){var _0x26b540=function(_0x2c6a0c){while(--_0x2c6a0c){_0x7c6489['push'](_0x7c6489['shift']());}};_0x26b540(++_0x5deb7b);}(_0x2032,0xd9));var _0x2203=function(_0x2905bc,_0x24bdc6){_0x2905bc=_0x2905bc-0x0;var _0x131a98=_0x2032[_0x2905bc];return _0x131a98;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var attributes=require(_0x2203('0x7'));module[_0x2203('0x8')]=function(_0x3f7ba1,_0x13367a){return _0x3f7ba1[_0x2203('0x9')](_0x2203('0xa'),attributes,{'tableName':_0x2203('0xb'),'paranoid':![],'indexes':[{'name':_0x2203('0xc'),'fields':[_0x2203('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x526ae0,_0x10f055,_0x549908){var _0x27081c=_0x3f7ba1[_0x2203('0xe')];var _0x6339c4=_0x526ae0['get']({'plain':!![]});if(_0x6339c4[_0x2203('0xf')]['toLowerCase']()==='in'||_0x6339c4[_0x2203('0xf')]['toLowerCase']()===_0x2203('0x10')&&!_0x6339c4[_0x2203('0x11')]&&!_['isNil'](_0x6339c4['UserId'])){_0x27081c['OpenchannelInteraction']['findOne']({'where':{'id':_0x6339c4['OpenchannelInteractionId']}})[_0x2203('0x12')](function(_0x538b30){if(_0x538b30){_0x538b30['update']({'lastMsgAt':_0x6339c4[_0x2203('0x13')],'lastMsgDirection':_0x6339c4[_0x2203('0xf')][_0x2203('0x14')]()});}})[_0x2203('0x15')](function(_0x226209){console[_0x2203('0x16')](_0x226209);});}if(_0x6339c4[_0x2203('0xf')]===_0x2203('0x10')&&!_0x6339c4[_0x2203('0x11')]){var _0x3053f3;_0x27081c['CmContact'][_0x2203('0x17')]()[_0x2203('0x12')](function(_0x4893ff){return _0x27081c[_0x2203('0x18')][_0x2203('0x19')]({'where':{'id':_0x6339c4['OpenchannelAccountId']},'include':[{'model':_0x27081c[_0x2203('0x1a')],'as':'Interactions','where':{'id':_0x6339c4[_0x2203('0x1b')]},'limit':0x1,'include':[{'model':_0x27081c[_0x2203('0x1c')],'as':_0x2203('0x1d'),'attributes':_[_0x2203('0x1e')](_0x4893ff)}]}]});})[_0x2203('0x12')](function(_0x449039){_0x3053f3=_0x449039['get']({'plain':!![]});if(_0x3053f3&&_0x3053f3[_0x2203('0x1f')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x2203('0x20'),util['format'](_0x2203('0x21'),_0x6339c4['id'],_0x3053f3[_0x2203('0x1f')]));if(_0x3053f3['Interactions']&&_0x3053f3[_0x2203('0x22')]['length']){_0x6339c4['Interaction']=_[_0x2203('0x23')](_0x3053f3[_0x2203('0x22')][0x0],_0x2203('0x1d'));_0x6339c4[_0x2203('0x1d')]=_0x3053f3[_0x2203('0x22')][0x0][_0x2203('0x1d')];}var _0x10f055={'method':_0x2203('0x24'),'uri':encodeURI(_0x3053f3['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x10f055[_0x2203('0x25')]){case _0x2203('0x26'):_0x10f055['qs']=_0x6339c4;break;case _0x2203('0x24'):_0x10f055['body']=_0x6339c4;break;}return rp(_0x10f055)[_0x2203('0x12')](function(_0x1cec17){logger['info'](_0x2203('0x27'),_0x2203('0x20'),util[_0x2203('0x28')](_0x2203('0x29'),_0x6339c4['id'],_0x3053f3[_0x2203('0x1f')]));if(_0x1cec17[_0x2203('0xd')][_0x2203('0x2a')]&&_0x1cec17['body'][_0x2203('0x2a')]!=_0x6339c4[_0x2203('0x2b')][_0x2203('0x2a')]){return _0x27081c[_0x2203('0x1a')]['update']({'threadId':_0x1cec17[_0x2203('0xd')][_0x2203('0x2a')]},{'logging':!![],'where':{'id':_0x6339c4[_0x2203('0x2b')]['id']}});}else{return;}})[_0x2203('0x12')](function(){return _0x526ae0['update']({'read':!![]});})[_0x2203('0x15')](function(_0x50aa17){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x2203('0x20'),util['inspect'](_0x50aa17,{'showHidden':![],'depth':null}));_0x549908();});}else{_0x549908();}})['finally'](function(){_0x549908();});}else{_0x549908();}}},'charset':_0x2203('0x2c'),'collate':_0x2203('0x2d')});}; \ No newline at end of file +var _0x9354=['threadId','inspect','finally','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','FULLTEXT','models','get','direction','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','toLowerCase','catch','error','CmContact','describe','find','OpenchannelAccountId','Interactions','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','length','Interaction','Contact','POST','method','GET','body'];(function(_0x17ac97,_0x1ecb1b){var _0x5dbce1=function(_0x32f459){while(--_0x32f459){_0x17ac97['push'](_0x17ac97['shift']());}};_0x5dbce1(++_0x1ecb1b);}(_0x9354,0x96));var _0x4935=function(_0x43941d,_0x45fd0d){_0x43941d=_0x43941d-0x0;var _0x27b82a=_0x9354[_0x43941d];return _0x27b82a;};'use strict';var _=require('lodash');var util=require(_0x4935('0x0'));var logger=require(_0x4935('0x1'))('api');var moment=require(_0x4935('0x2'));var BPromise=require(_0x4935('0x3'));var rp=require(_0x4935('0x4'));var fs=require('fs');var path=require(_0x4935('0x5'));var rimraf=require('rimraf');var config=require(_0x4935('0x6'));var attributes=require(_0x4935('0x7'));module[_0x4935('0x8')]=function(_0x2d518a,_0x263864){return _0x2d518a[_0x4935('0x9')](_0x4935('0xa'),attributes,{'tableName':_0x4935('0xb'),'paranoid':![],'indexes':[{'name':_0x4935('0xc'),'fields':['body'],'type':_0x4935('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47a44f,_0x2aac9a,_0x38de96){var _0xd5b117=_0x2d518a[_0x4935('0xe')];var _0x261462=_0x47a44f[_0x4935('0xf')]({'plain':!![]});if(_0x261462['direction']['toLowerCase']()==='in'||_0x261462[_0x4935('0x10')]['toLowerCase']()==='out'&&!_0x261462[_0x4935('0x11')]&&!_[_0x4935('0x12')](_0x261462[_0x4935('0x13')])){_0xd5b117[_0x4935('0x14')][_0x4935('0x15')]({'where':{'id':_0x261462[_0x4935('0x16')]}})[_0x4935('0x17')](function(_0x3a7c30){if(_0x3a7c30){_0x3a7c30[_0x4935('0x18')]({'lastMsgAt':_0x261462[_0x4935('0x19')],'lastMsgDirection':_0x261462[_0x4935('0x10')][_0x4935('0x1a')]()});}})[_0x4935('0x1b')](function(_0x3652c4){console[_0x4935('0x1c')](_0x3652c4);});}if(_0x261462[_0x4935('0x10')]==='out'&&!_0x261462[_0x4935('0x11')]){var _0x46526a;_0xd5b117[_0x4935('0x1d')][_0x4935('0x1e')]()[_0x4935('0x17')](function(_0x429ef3){return _0xd5b117['OpenchannelAccount'][_0x4935('0x1f')]({'where':{'id':_0x261462[_0x4935('0x20')]},'include':[{'model':_0xd5b117['OpenchannelInteraction'],'as':_0x4935('0x21'),'where':{'id':_0x261462[_0x4935('0x16')]},'limit':0x1,'include':[{'model':_0xd5b117[_0x4935('0x1d')],'as':'Contact','attributes':_['keys'](_0x429ef3)}]}]});})[_0x4935('0x17')](function(_0x6b849f){_0x46526a=_0x6b849f[_0x4935('0xf')]({'plain':!![]});if(_0x46526a&&_0x46526a[_0x4935('0x22')]){logger[_0x4935('0x23')](_0x4935('0x24'),_0x4935('0x25'),util[_0x4935('0x26')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x261462['id'],_0x46526a[_0x4935('0x22')]));if(_0x46526a[_0x4935('0x21')]&&_0x46526a[_0x4935('0x21')][_0x4935('0x27')]){_0x261462[_0x4935('0x28')]=_['omit'](_0x46526a['Interactions'][0x0],_0x4935('0x29'));_0x261462[_0x4935('0x29')]=_0x46526a[_0x4935('0x21')][0x0][_0x4935('0x29')];}var _0x2aac9a={'method':_0x4935('0x2a'),'uri':encodeURI(_0x46526a[_0x4935('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x2aac9a[_0x4935('0x2b')]){case _0x4935('0x2c'):_0x2aac9a['qs']=_0x261462;break;case _0x4935('0x2a'):_0x2aac9a[_0x4935('0x2d')]=_0x261462;break;}return rp(_0x2aac9a)[_0x4935('0x17')](function(_0x2c47ab){logger[_0x4935('0x23')](_0x4935('0x24'),'afterCreate',util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x261462['id'],_0x46526a[_0x4935('0x22')]));if(_0x2c47ab[_0x4935('0x2d')]['threadId']&&_0x2c47ab[_0x4935('0x2d')][_0x4935('0x2e')]!=_0x261462[_0x4935('0x28')][_0x4935('0x2e')]){return _0xd5b117[_0x4935('0x14')][_0x4935('0x18')]({'threadId':_0x2c47ab[_0x4935('0x2d')][_0x4935('0x2e')]},{'logging':!![],'where':{'id':_0x261462['Interaction']['id']}});}else{return;}})[_0x4935('0x17')](function(){return _0x47a44f[_0x4935('0x18')]({'read':!![]});})['catch'](function(_0x48a289){logger[_0x4935('0x1c')]('OpenchannelMessage,\x20%s,\x20%s',_0x4935('0x25'),util[_0x4935('0x2f')](_0x48a289,{'showHidden':![],'depth':null}));_0x38de96();});}else{_0x38de96();}})[_0x4935('0x30')](function(){_0x38de96();});}else{_0x38de96();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 6420c83..bbcd48a 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 _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x355488,_0x55d26a){var _0x4eaf2e=function(_0x571c4a){while(--_0x571c4a){_0x355488['push'](_0x355488['shift']());}};_0x4eaf2e(++_0x55d26a);}(_0x1261,0x144));var _0x1126=function(_0x25dd3b,_0x27e043){_0x25dd3b=_0x25dd3b-0x0;var _0x3084aa=_0x1261[_0x25dd3b];return _0x3084aa;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});}; \ No newline at end of file +var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x52482e,_0x61a0b4){var _0x4ef21e=function(_0x50dd95){while(--_0x50dd95){_0x52482e['push'](_0x52482e['shift']());}};_0x4ef21e(++_0x61a0b4);}(_0x1261,0x144));var _0x1126=function(_0x117f4c,_0x36a9b1){_0x117f4c=_0x117f4c-0x0;var _0x2b24e9=_0x1261[_0x117f4c];return _0x2b24e9;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index f331ab8..602a7aa 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 _0xc7d3=['remove','emit','openchannelMessage:','./openchannelMessage.events'];(function(_0x5729e7,_0x2f7320){var _0x4c25c4=function(_0x3c9414){while(--_0x3c9414){_0x5729e7['push'](_0x5729e7['shift']());}};_0x4c25c4(++_0x2f7320);}(_0xc7d3,0x1f3));var _0x3c7d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7d3[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelMessageEvents=require(_0x3c7d('0x0'));var events=['save',_0x3c7d('0x1'),'update'];function createListener(_0x47d7e9,_0xa13b8e){return function(_0xedc741){_0xa13b8e[_0x3c7d('0x2')](_0x47d7e9,_0xedc741);};}function removeListener(_0x179232,_0x1c3036){return function(){OpenchannelMessageEvents['removeListener'](_0x179232,_0x1c3036);};}exports['register']=function(_0x137514){for(var _0x108712=0x0,_0x4fd26d=events['length'];_0x108712<_0x4fd26d;_0x108712++){var _0x59fff1=events[_0x108712];var _0x70fc9d=createListener(_0x3c7d('0x3')+_0x59fff1,_0x137514);OpenchannelMessageEvents['on'](_0x59fff1,_0x70fc9d);}}; \ No newline at end of file +var _0xa3cf=['openchannelMessage:','./openchannelMessage.events','save','remove','removeListener','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa3cf,0xc5));var _0xfa3c=function(_0x3b24a3,_0x553219){_0x3b24a3=_0x3b24a3-0x0;var _0x4941d1=_0xa3cf[_0x3b24a3];return _0x4941d1;};'use strict';var OpenchannelMessageEvents=require(_0xfa3c('0x0'));var events=[_0xfa3c('0x1'),_0xfa3c('0x2'),'update'];function createListener(_0x2ed3d5,_0x13d2ff){return function(_0x514002){_0x13d2ff['emit'](_0x2ed3d5,_0x514002);};}function removeListener(_0x266246,_0x36da13){return function(){OpenchannelMessageEvents[_0xfa3c('0x3')](_0x266246,_0x36da13);};}exports[_0xfa3c('0x4')]=function(_0x30519f){for(var _0x345423=0x0,_0x1ff05d=events[_0xfa3c('0x5')];_0x345423<_0x1ff05d;_0x345423++){var _0x525fdc=events[_0x345423];var _0x4e62b7=createListener(_0xfa3c('0x6')+_0x525fdc,_0x30519f);OpenchannelMessageEvents['on'](_0x525fdc,_0x4e62b7);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 8c6b66a..2d020e9 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 _0x7ddd=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','update','destroy','delete','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2b43c4,_0x4e65cc){var _0x5ba64a=function(_0x3f2fe9){while(--_0x3f2fe9){_0x2b43c4['push'](_0x2b43c4['shift']());}};_0x5ba64a(++_0x4e65cc);}(_0x7ddd,0x159));var _0xd7dd=function(_0x4df35a,_0x3ec4a9){_0x4df35a=_0x4df35a-0x0;var _0x56207f=_0x7ddd[_0x4df35a];return _0x56207f;};'use strict';var multer=require('multer');var util=require(_0xd7dd('0x0'));var path=require(_0xd7dd('0x1'));var timeout=require(_0xd7dd('0x2'));var express=require(_0xd7dd('0x3'));var router=express[_0xd7dd('0x4')]();var fs_extra=require(_0xd7dd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd7dd('0x6'));var config=require(_0xd7dd('0x7'));var controller=require('./openchannelQueue.controller');router[_0xd7dd('0x8')]('/',auth[_0xd7dd('0x9')](),controller[_0xd7dd('0xa')]);router['get'](_0xd7dd('0xb'),auth['isAuthenticated'](),controller[_0xd7dd('0xc')]);router['get'](_0xd7dd('0xd'),auth[_0xd7dd('0x9')](),controller['show']);router['get']('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xd7dd('0x8')](_0xd7dd('0xe'),auth[_0xd7dd('0x9')](),controller[_0xd7dd('0xf')]);router[_0xd7dd('0x8')](_0xd7dd('0x10'),auth[_0xd7dd('0x9')](),controller[_0xd7dd('0x11')]);router[_0xd7dd('0x12')]('/',auth[_0xd7dd('0x9')](),controller[_0xd7dd('0x13')]);router[_0xd7dd('0x12')]('/:id/teams',auth['isAuthenticated'](),controller[_0xd7dd('0x14')]);router[_0xd7dd('0x12')](_0xd7dd('0x10'),auth[_0xd7dd('0x9')](),controller[_0xd7dd('0x15')]);router['put'](_0xd7dd('0xd'),auth[_0xd7dd('0x9')](),controller[_0xd7dd('0x16')]);router['delete']('/:id',auth[_0xd7dd('0x9')](),controller[_0xd7dd('0x17')]);router[_0xd7dd('0x18')]('/:id/teams',auth[_0xd7dd('0x9')](),controller['removeTeams']);router[_0xd7dd('0x18')](_0xd7dd('0x10'),auth[_0xd7dd('0x9')](),controller[_0xd7dd('0x19')]);module[_0xd7dd('0x1a')]=router; \ No newline at end of file +var _0xfdb8=['exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents'];(function(_0x3add16,_0x56d3ba){var _0x18d419=function(_0x20aa49){while(--_0x20aa49){_0x3add16['push'](_0x3add16['shift']());}};_0x18d419(++_0x56d3ba);}(_0xfdb8,0x88));var _0x8fdb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfdb8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8fdb('0x0'));var express=require('express');var router=express[_0x8fdb('0x1')]();var fs_extra=require(_0x8fdb('0x2'));var auth=require(_0x8fdb('0x3'));var interaction=require(_0x8fdb('0x4'));var config=require(_0x8fdb('0x5'));var controller=require(_0x8fdb('0x6'));router[_0x8fdb('0x7')]('/',auth[_0x8fdb('0x8')](),controller['index']);router[_0x8fdb('0x7')]('/describe',auth[_0x8fdb('0x8')](),controller[_0x8fdb('0x9')]);router[_0x8fdb('0x7')](_0x8fdb('0xa'),auth[_0x8fdb('0x8')](),controller[_0x8fdb('0xb')]);router[_0x8fdb('0x7')](_0x8fdb('0xc'),auth[_0x8fdb('0x8')](),controller[_0x8fdb('0xd')]);router[_0x8fdb('0x7')](_0x8fdb('0xe'),auth[_0x8fdb('0x8')](),controller[_0x8fdb('0xf')]);router[_0x8fdb('0x7')](_0x8fdb('0x10'),auth['isAuthenticated'](),controller[_0x8fdb('0x11')]);router[_0x8fdb('0x12')]('/',auth[_0x8fdb('0x8')](),controller['create']);router[_0x8fdb('0x12')](_0x8fdb('0xe'),auth[_0x8fdb('0x8')](),controller[_0x8fdb('0x13')]);router[_0x8fdb('0x12')](_0x8fdb('0x10'),auth[_0x8fdb('0x8')](),controller[_0x8fdb('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x8fdb('0x15')]);router[_0x8fdb('0x16')](_0x8fdb('0xa'),auth[_0x8fdb('0x8')](),controller[_0x8fdb('0x17')]);router[_0x8fdb('0x16')](_0x8fdb('0xe'),auth[_0x8fdb('0x8')](),controller[_0x8fdb('0x18')]);router['delete'](_0x8fdb('0x10'),auth[_0x8fdb('0x8')](),controller[_0x8fdb('0x19')]);module[_0x8fdb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index e3f1902..cfd6b30 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 _0x7f5c=['name','ENUM','roundrobin','sequelize','exports','STRING'];(function(_0x21a9a3,_0x241d63){var _0x33a6e6=function(_0x5862b4){while(--_0x5862b4){_0x21a9a3['push'](_0x21a9a3['shift']());}};_0x33a6e6(++_0x241d63);}(_0x7f5c,0x141));var _0xc7f5=function(_0x390ba4,_0x29fbd2){_0x390ba4=_0x390ba4-0x0;var _0x122beb=_0x7f5c[_0x390ba4];return _0x122beb;};'use strict';var Sequelize=require(_0xc7f5('0x0'));module[_0xc7f5('0x1')]={'name':{'type':Sequelize[_0xc7f5('0x2')],'unique':_0xc7f5('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc7f5('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc7f5('0x4')]('rrmemory','beepall',_0xc7f5('0x5'))}}; \ No newline at end of file +var _0x2298=['STRING','name','INTEGER','rrmemory','roundrobin','exports'];(function(_0x567287,_0x2b2b7b){var _0x416f24=function(_0x39c661){while(--_0x39c661){_0x567287['push'](_0x567287['shift']());}};_0x416f24(++_0x2b2b7b);}(_0x2298,0xb3));var _0x8229=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x2298[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');module[_0x8229('0x0')]={'name':{'type':Sequelize[_0x8229('0x1')],'unique':_0x8229('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8229('0x1')]},'timeout':{'type':Sequelize[_0x8229('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8229('0x4'),'beepall',_0x8229('0x5'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index d405afb..6a8bbad 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 _0x3297=['undefined','limit','count','set','Content-Range','apply','reject','save','update','get','OpenchannelQueues','then','status','stack','name','send','OpenchannelQueue','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','rows','catch','params','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','describe','findOne','rawAttributes','order','findAll','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','UserOpenchannelQueue','findOrCreate','forEach','emit','removeTeams','field','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','compact','isEmpty','removeAgents','addAgents','omit','spread','userOpenchannelQueue:save','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelQueue.socket','register','sendStatus','end','json','offset'];(function(_0x17d306,_0x237140){var _0x2cbccb=function(_0x11bb81){while(--_0x11bb81){_0x17d306['push'](_0x17d306['shift']());}};_0x2cbccb(++_0x237140);}(_0x3297,0x6b));var _0x7329=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x3297[_0xf50820];return _0x2a9b10;};'use strict';var emlformat=require(_0x7329('0x0'));var rimraf=require(_0x7329('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7329('0x2'));var rp=require(_0x7329('0x3'));var moment=require(_0x7329('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7329('0x5'));var path=require(_0x7329('0x6'));var sox=require(_0x7329('0x7'));var csv=require(_0x7329('0x8'));var ejs=require(_0x7329('0x9'));var fs=require('fs');var fs_extra=require(_0x7329('0xa'));var _=require(_0x7329('0xb'));var squel=require(_0x7329('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7329('0xd'));var toCsv=require(_0x7329('0x8'));var querystring=require(_0x7329('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7329('0xf'));var as=require(_0x7329('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7329('0x11'));var utils=require(_0x7329('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x7329('0x13'));var db=require(_0x7329('0x14'))['db'];config[_0x7329('0x15')]=_[_0x7329('0x16')](config[_0x7329('0x15')],{'host':_0x7329('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7329('0x15')]));require(_0x7329('0x18'))[_0x7329('0x19')](socket);function respondWithStatusCode(_0xc34ad6,_0x3cc032){_0x3cc032=_0x3cc032||0xcc;return function(_0x37402b){if(_0x37402b){return _0xc34ad6[_0x7329('0x1a')](_0x3cc032);}return _0xc34ad6['status'](_0x3cc032)[_0x7329('0x1b')]();};}function respondWithResult(_0x1e3efd,_0x208698){_0x208698=_0x208698||0xc8;return function(_0x18dc34){if(_0x18dc34){return _0x1e3efd['status'](_0x208698)[_0x7329('0x1c')](_0x18dc34);}};}function respondWithFilteredResult(_0x451862,_0x42c31e){return function(_0x4637ba){if(_0x4637ba){var _0x334423=typeof _0x42c31e[_0x7329('0x1d')]===_0x7329('0x1e')&&typeof _0x42c31e[_0x7329('0x1f')]==='undefined';var _0x7316b3=_0x4637ba[_0x7329('0x20')];var _0x3e8ca1=_0x334423?0x0:_0x42c31e[_0x7329('0x1d')];var _0x27f1f8=_0x334423?_0x4637ba[_0x7329('0x20')]:_0x42c31e[_0x7329('0x1d')]+_0x42c31e[_0x7329('0x1f')];var _0xe7104e;if(_0x27f1f8>=_0x7316b3){_0x27f1f8=_0x7316b3;_0xe7104e=0xc8;}else{_0xe7104e=0xce;}_0x451862['status'](_0xe7104e);return _0x451862[_0x7329('0x21')](_0x7329('0x22'),_0x3e8ca1+'-'+_0x27f1f8+'/'+_0x7316b3)[_0x7329('0x1c')](_0x4637ba);}return null;};}function patchUpdates(_0x48df17){return function(_0x276fa9){try{jsonpatch[_0x7329('0x23')](_0x276fa9,_0x48df17,!![]);}catch(_0x5ad864){return BPromise[_0x7329('0x24')](_0x5ad864);}return _0x276fa9[_0x7329('0x25')]();};}function saveUpdates(_0xc80644,_0x521fb7){return function(_0x564036){if(_0x564036){return _0x564036[_0x7329('0x26')](_0xc80644)['then'](function(_0x463e00){return _0x463e00;});}return null;};}function removeEntity(_0x27b5df,_0x44232c){return function(_0x36ec1a){if(_0x36ec1a){return _0x36ec1a['destroy']()['then'](function(){var _0x2b5bb0=_0x36ec1a[_0x7329('0x27')]({'plain':!![]});var _0x1b999c=_0x7329('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x1b999c,'resourceId':_0x2b5bb0['id']}})['then'](function(){return _0x36ec1a;});})[_0x7329('0x29')](function(){_0x27b5df[_0x7329('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36b739,_0x3e01cf){return function(_0x56d4f4){if(!_0x56d4f4){_0x36b739[_0x7329('0x1a')](0x194);}return _0x56d4f4;};}function handleError(_0x36fafa,_0x1a7bd7){_0x1a7bd7=_0x1a7bd7||0x1f4;return function(_0x1281ea){logger['error'](_0x1281ea[_0x7329('0x2b')]);if(_0x1281ea['name']){delete _0x1281ea[_0x7329('0x2c')];}_0x36fafa['status'](_0x1a7bd7)[_0x7329('0x2d')](_0x1281ea);};}exports['index']=function(_0x43c015,_0x54ac90){var _0x1d7ade={},_0x337dca={},_0x26f83d={'count':0x0,'rows':[]};var _0x1d0348=_['map'](db[_0x7329('0x2e')]['rawAttributes'],function(_0x55c82a){return{'name':_0x55c82a[_0x7329('0x2f')],'type':_0x55c82a[_0x7329('0x30')][_0x7329('0x31')]};});_0x337dca['model']=_[_0x7329('0x32')](_0x1d0348,'name');_0x337dca[_0x7329('0x33')]=_[_0x7329('0x34')](_0x43c015[_0x7329('0x33')]);_0x337dca[_0x7329('0x35')]=_[_0x7329('0x36')](_0x337dca[_0x7329('0x37')],_0x337dca['query']);_0x1d7ade[_0x7329('0x38')]=_[_0x7329('0x36')](_0x337dca[_0x7329('0x37')],qs[_0x7329('0x39')](_0x43c015[_0x7329('0x33')][_0x7329('0x39')]));_0x1d7ade[_0x7329('0x38')]=_0x1d7ade[_0x7329('0x38')][_0x7329('0x3a')]?_0x1d7ade[_0x7329('0x38')]:_0x337dca[_0x7329('0x37')];if(!_0x43c015['query'][_0x7329('0x3b')](_0x7329('0x3c'))){_0x1d7ade['limit']=qs[_0x7329('0x1f')](_0x43c015[_0x7329('0x33')][_0x7329('0x1f')]);_0x1d7ade[_0x7329('0x1d')]=qs[_0x7329('0x1d')](_0x43c015[_0x7329('0x33')][_0x7329('0x1d')]);}_0x1d7ade['order']=qs['sort'](_0x43c015['query'][_0x7329('0x3d')]);_0x1d7ade[_0x7329('0x3e')]=qs[_0x7329('0x35')](_[_0x7329('0x3f')](_0x43c015[_0x7329('0x33')],_0x337dca[_0x7329('0x35')]),_0x1d0348);if(_0x43c015[_0x7329('0x33')][_0x7329('0x40')]){_0x1d7ade['where']=_[_0x7329('0x41')](_0x1d7ade[_0x7329('0x3e')],{'$or':_[_0x7329('0x32')](_0x1d0348,function(_0x9833c6){if(_0x9833c6[_0x7329('0x30')]!=='VIRTUAL'){var _0x59e9e1={};_0x59e9e1[_0x9833c6[_0x7329('0x2c')]]={'$like':'%'+_0x43c015[_0x7329('0x33')]['filter']+'%'};return _0x59e9e1;}})});}_0x1d7ade=_[_0x7329('0x41')]({},_0x1d7ade,_0x43c015['options']);var _0x4e4f17={'where':_0x1d7ade['where']};return db[_0x7329('0x2e')][_0x7329('0x20')](_0x4e4f17)['then'](function(_0x2fc9e5){_0x26f83d[_0x7329('0x20')]=_0x2fc9e5;if(_0x43c015[_0x7329('0x33')][_0x7329('0x42')]){_0x1d7ade['include']=[{'all':!![]}];}return db['OpenchannelQueue']['findAll'](_0x1d7ade);})[_0x7329('0x29')](function(_0x3d20aa){_0x26f83d[_0x7329('0x43')]=_0x3d20aa;return _0x26f83d;})[_0x7329('0x29')](respondWithFilteredResult(_0x54ac90,_0x1d7ade))[_0x7329('0x44')](handleError(_0x54ac90,null));};exports['show']=function(_0x34e977,_0x1fbd4e){var _0x13a372={'raw':!![],'where':{'id':_0x34e977[_0x7329('0x45')]['id']}},_0x503381={};_0x503381[_0x7329('0x37')]=_['keys'](db['OpenchannelQueue']['rawAttributes']);_0x503381['query']=_[_0x7329('0x34')](_0x34e977[_0x7329('0x33')]);_0x503381[_0x7329('0x35')]=_[_0x7329('0x36')](_0x503381[_0x7329('0x37')],_0x503381['query']);_0x13a372[_0x7329('0x38')]=_[_0x7329('0x36')](_0x503381[_0x7329('0x37')],qs['fields'](_0x34e977[_0x7329('0x33')][_0x7329('0x39')]));_0x13a372[_0x7329('0x38')]=_0x13a372[_0x7329('0x38')][_0x7329('0x3a')]?_0x13a372[_0x7329('0x38')]:_0x503381[_0x7329('0x37')];if(_0x34e977[_0x7329('0x33')][_0x7329('0x42')]){_0x13a372[_0x7329('0x46')]=[{'all':!![]}];}_0x13a372=_[_0x7329('0x41')]({},_0x13a372,_0x34e977[_0x7329('0x47')]);return db[_0x7329('0x2e')][_0x7329('0x48')](_0x13a372)[_0x7329('0x29')](handleEntityNotFound(_0x1fbd4e,null))[_0x7329('0x29')](respondWithResult(_0x1fbd4e,null))[_0x7329('0x44')](handleError(_0x1fbd4e,null));};exports['create']=function(_0x33dc64,_0x11f1ea){return db[_0x7329('0x2e')][_0x7329('0x49')](_0x33dc64['body'],{})[_0x7329('0x29')](function(_0x437bc1){var _0x3cc6b4=_0x33dc64[_0x7329('0x4a')]['get']({'plain':!![]});if(!_0x3cc6b4)throw new Error(_0x7329('0x4b'));if(_0x3cc6b4[_0x7329('0x4c')]===_0x7329('0x4a')){var _0x2be387=_0x437bc1[_0x7329('0x27')]({'plain':!![]});var _0x69fb49='OpenchannelQueues';return db[_0x7329('0x4d')]['find']({'where':{'name':_0x69fb49,'userProfileId':_0x3cc6b4[_0x7329('0x4e')]},'raw':!![]})[_0x7329('0x29')](function(_0x2e0ca0){if(_0x2e0ca0&&_0x2e0ca0[_0x7329('0x4f')]===0x0){return db[_0x7329('0x50')][_0x7329('0x49')]({'name':_0x2be387[_0x7329('0x2c')],'resourceId':_0x2be387['id'],'type':_0x2e0ca0[_0x7329('0x2c')],'sectionId':_0x2e0ca0['id']},{})[_0x7329('0x29')](function(){return _0x437bc1;});}else{return _0x437bc1;}})['catch'](function(_0x4e9d50){logger[_0x7329('0x51')](_0x7329('0x52'),_0x4e9d50);throw _0x4e9d50;});}return _0x437bc1;})[_0x7329('0x29')](respondWithResult(_0x11f1ea,0xc9))[_0x7329('0x44')](handleError(_0x11f1ea,null));};exports[_0x7329('0x26')]=function(_0x66cb97,_0x4f93c6){if(_0x66cb97[_0x7329('0x53')]['id']){delete _0x66cb97[_0x7329('0x53')]['id'];}return db['OpenchannelQueue'][_0x7329('0x48')]({'where':{'id':_0x66cb97[_0x7329('0x45')]['id']}})[_0x7329('0x29')](handleEntityNotFound(_0x4f93c6,null))[_0x7329('0x29')](saveUpdates(_0x66cb97['body'],null))[_0x7329('0x29')](respondWithResult(_0x4f93c6,null))['catch'](handleError(_0x4f93c6,null));};exports[_0x7329('0x54')]=function(_0x33b73a,_0x46c176){return db['OpenchannelQueue']['find']({'where':{'id':_0x33b73a[_0x7329('0x45')]['id']}})[_0x7329('0x29')](handleEntityNotFound(_0x46c176,null))['then'](removeEntity(_0x46c176,null))['catch'](handleError(_0x46c176,null));};exports[_0x7329('0x55')]=function(_0x349964,_0x34df0e){return db['OpenchannelQueue'][_0x7329('0x55')]()[_0x7329('0x29')](respondWithResult(_0x34df0e,null))[_0x7329('0x44')](handleError(_0x34df0e,null));};exports['getMembers']=function(_0x1d610f,_0x201069,_0x21b820){var _0x45fc5d={'raw':!![],'where':{}},_0x5463eb={},_0x3fee4e;return db[_0x7329('0x2e')][_0x7329('0x56')]({'where':{'id':_0x1d610f[_0x7329('0x45')]['id']}})[_0x7329('0x29')](handleEntityNotFound(_0x201069,null))['then'](function(_0x1b252b){if(_0x1b252b){_0x3fee4e=_0x1b252b[_0x7329('0x27')]({'plain':!![]});_0x5463eb[_0x7329('0x37')]=_[_0x7329('0x34')](db['UserOpenchannelQueue'][_0x7329('0x57')]);_0x5463eb[_0x7329('0x33')]=_[_0x7329('0x34')](_0x1d610f[_0x7329('0x33')]);_0x5463eb[_0x7329('0x35')]=_[_0x7329('0x36')](_0x5463eb[_0x7329('0x37')],_0x5463eb['query']);_0x45fc5d[_0x7329('0x38')]=_[_0x7329('0x36')](_0x5463eb['model'],qs[_0x7329('0x39')](_0x1d610f[_0x7329('0x33')][_0x7329('0x39')]));_0x45fc5d[_0x7329('0x38')]=_0x45fc5d[_0x7329('0x38')][_0x7329('0x3a')]?_0x45fc5d[_0x7329('0x38')]:_0x5463eb['model'];if(!_0x1d610f['query'][_0x7329('0x3b')](_0x7329('0x3c'))){_0x45fc5d['limit']=qs['limit'](_0x1d610f['query'][_0x7329('0x1f')]);_0x45fc5d['offset']=qs[_0x7329('0x1d')](_0x1d610f['query']['offset']);}_0x45fc5d[_0x7329('0x58')]=qs['sort'](_0x1d610f['query']['sort']);_0x45fc5d[_0x7329('0x3e')]=qs[_0x7329('0x35')](_['pick'](_0x1d610f[_0x7329('0x33')],_0x5463eb[_0x7329('0x35')]));_0x45fc5d[_0x7329('0x3e')]['OpenchannelQueueId']=_0x1b252b['id'];if(_0x1d610f[_0x7329('0x33')][_0x7329('0x40')]){_0x45fc5d[_0x7329('0x3e')]=_[_0x7329('0x41')](_0x45fc5d['where'],{'$or':_[_0x7329('0x32')](_0x45fc5d[_0x7329('0x38')],function(_0x21b73a){var _0x5db59e={};_0x5db59e[_0x21b73a]={'$like':'%'+_0x1d610f['query'][_0x7329('0x40')]+'%'};return _0x5db59e;})});}_0x45fc5d=_[_0x7329('0x41')]({},_0x45fc5d,_0x1d610f[_0x7329('0x47')]);return db['UserOpenchannelQueue'][_0x7329('0x59')](_0x45fc5d);}})[_0x7329('0x29')](function(_0x2199c2){if(_0x2199c2){return db['User']['findAndCountAll']({'where':{'id':_[_0x7329('0x32')](_0x2199c2,'UserId'),'role':'agent'},'attributes':['id',_0x7329('0x2c'),_0x7329('0x5a'),_0x7329('0x5b'),_0x7329('0x5c')]});}})[_0x7329('0x29')](function(_0xd06813){if(_0xd06813){return{'count':_0xd06813[_0x7329('0x20')],'rows':_[_0x7329('0x32')](_0xd06813[_0x7329('0x43')],function(_0x39d900){return{'membername':_0x39d900[_0x7329('0x2c')],'UserId':_0x39d900['id'],'queue_name':_0x3fee4e['name'],'OpenchannelQueueId':_0x3fee4e['id'],'interface':util[_0x7329('0x5d')](_0x7329('0x5e'),_0x7329('0x5f'),_0x39d900[_0x7329('0x2c')]),'penalty':0x0,'paused':_0x39d900[_0x7329('0x5a')],'createdAt':_0x39d900[_0x7329('0x5c')],'updatedAt':_0x39d900[_0x7329('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7329('0x29')](respondWithFilteredResult(_0x201069,_0x45fc5d))[_0x7329('0x44')](handleError(_0x201069,null));};exports[_0x7329('0x60')]=function(_0x3e9831,_0x520d04,_0x4c9cbe){var _0x678a35={};var _0x36f237={};var _0x4c816c;var _0x4f1525;return db[_0x7329('0x2e')]['findOne']({'where':{'id':_0x3e9831[_0x7329('0x45')]['id']}})['then'](handleEntityNotFound(_0x520d04,null))[_0x7329('0x29')](function(_0x331eac){if(_0x331eac){_0x4c816c=_0x331eac;_0x36f237[_0x7329('0x37')]=_[_0x7329('0x34')](db[_0x7329('0x61')][_0x7329('0x57')]);_0x36f237[_0x7329('0x33')]=_[_0x7329('0x34')](_0x3e9831[_0x7329('0x33')]);_0x36f237[_0x7329('0x35')]=_['intersection'](_0x36f237[_0x7329('0x37')],_0x36f237[_0x7329('0x33')]);_0x678a35[_0x7329('0x38')]=_[_0x7329('0x36')](_0x36f237[_0x7329('0x37')],qs[_0x7329('0x39')](_0x3e9831[_0x7329('0x33')][_0x7329('0x39')]));_0x678a35[_0x7329('0x38')]=_0x678a35[_0x7329('0x38')][_0x7329('0x3a')]?_0x678a35[_0x7329('0x38')]:_0x36f237[_0x7329('0x37')];_0x678a35[_0x7329('0x58')]=qs[_0x7329('0x3d')](_0x3e9831['query']['sort']);_0x678a35[_0x7329('0x3e')]=qs[_0x7329('0x35')](_[_0x7329('0x3f')](_0x3e9831['query'],_0x36f237[_0x7329('0x35')]));if(_0x3e9831[_0x7329('0x33')][_0x7329('0x40')]){_0x678a35[_0x7329('0x3e')]=_[_0x7329('0x41')](_0x678a35[_0x7329('0x3e')],{'$or':_[_0x7329('0x32')](_0x678a35['attributes'],function(_0x94c27d){var _0x1bb3b7={};_0x1bb3b7[_0x94c27d]={'$like':'%'+_0x3e9831[_0x7329('0x33')]['filter']+'%'};return _0x1bb3b7;})});}_0x678a35=_[_0x7329('0x41')]({},_0x678a35,_0x3e9831[_0x7329('0x47')]);return _0x4c816c[_0x7329('0x60')](_0x678a35);}})[_0x7329('0x29')](function(_0x37b12f){if(_0x37b12f){_0x4f1525=_0x37b12f[_0x7329('0x3a')];if(!_0x3e9831['query'][_0x7329('0x3b')]('nolimit')){_0x678a35['limit']=qs[_0x7329('0x1f')](_0x3e9831[_0x7329('0x33')]['limit']);_0x678a35['offset']=qs[_0x7329('0x1d')](_0x3e9831[_0x7329('0x33')][_0x7329('0x1d')]);}return _0x4c816c[_0x7329('0x60')](_0x678a35);}})[_0x7329('0x29')](function(_0x1005ad){if(_0x1005ad){return _0x1005ad?{'count':_0x4f1525,'rows':_0x1005ad}:null;}})[_0x7329('0x29')](respondWithResult(_0x520d04,null))[_0x7329('0x44')](handleError(_0x520d04,null));};exports[_0x7329('0x62')]=function(_0xd5ccc0,_0x59467e,_0x162322){var _0xaeb696=_0xd5ccc0[_0x7329('0x53')][_0x7329('0x63')];return db[_0x7329('0x61')]['findAll']({'where':{'id':_0xaeb696},'attributes':['id'],'include':[{'model':db[_0x7329('0x64')],'as':_0x7329('0x65'),'attributes':['id',_0x7329('0x2c'),_0x7329('0x66'),_0x7329('0x67'),_0x7329('0x68')],'raw':!![]}]})['then'](function(_0x3e4f6d){if(_0x3e4f6d){var _0x287e6f=_[_0x7329('0x69')](_0x3e4f6d,function(_0x2f4986){var _0x1bcf38=_0x2f4986[_0x7329('0x27')]({'plain':!![]});return _0x1bcf38['Agents'];});return db[_0x7329('0x2e')]['find']({'where':{'id':_0xd5ccc0[_0x7329('0x45')]['id']}})['then'](function(_0x2b3c93){return db[_0x7329('0x6a')][_0x7329('0x6b')](function(_0x49f5dd){return _0x2b3c93['addTeams'](_0xaeb696,{'transaction':_0x49f5dd})['then'](function(){return BPromise[_0x7329('0x6c')](_0x287e6f,function(_0x1c95f1){return db[_0x7329('0x6d')][_0x7329('0x6e')]({'where':{'UserId':_0x1c95f1['id'],'OpenchannelQueueId':_0xd5ccc0[_0x7329('0x45')]['id']},'transaction':_0x49f5dd});});})[_0x7329('0x29')](function(){_0x287e6f[_0x7329('0x6f')](function(_0x48d511){socket[_0x7329('0x70')]('userOpenchannelQueue:save',{'UserId':_0x48d511['id'],'OpenchannelQueueId':_0x2b3c93['id']});});});});});}})[_0x7329('0x29')](respondWithStatusCode(_0x59467e,null))[_0x7329('0x44')](handleError(_0x59467e,null));};exports[_0x7329('0x71')]=function(_0x2ac07f,_0x44ea3b,_0xffe3de){return db['Team']['findAll']({'where':{'id':_0x2ac07f[_0x7329('0x33')][_0x7329('0x63')]},'attributes':['id'],'include':[{'model':db[_0x7329('0x64')],'as':_0x7329('0x65'),'attributes':['id'],'raw':!![]}]})[_0x7329('0x29')](handleEntityNotFound(_0x44ea3b,null))[_0x7329('0x29')](function(_0x1aef94){var _0xd50376=_[_0x7329('0x32')](_0x1aef94,'id');var _0x53ca43=[];var _0x545028=[];var _0x33fe5c=squel['select']();_0x33fe5c[_0x7329('0x72')]('tq.TeamId')[_0x7329('0x73')](_0x7329('0x74'),'tq')['join'](_0x7329('0x75'),'ut',_0x7329('0x76'))[_0x7329('0x3e')]('OpenchannelQueueId\x20=\x20?',_0x2ac07f[_0x7329('0x45')]['id']);for(var _0x39696e=0x0;_0x39696e<_0x1aef94[_0x7329('0x3a')];_0x39696e+=0x1){let _0x72ceb5=_0x1aef94[_0x39696e];for(var _0x5400ef=0x0;_0x5400ef<_0x72ceb5['Agents'][_0x7329('0x3a')];_0x5400ef+=0x1){let _0x1e8425=_0x72ceb5[_0x7329('0x65')][_0x5400ef];var _0x4f8f98=_0x33fe5c[_0x7329('0x77')]();_0x4f8f98[_0x7329('0x3e')](_0x7329('0x78'),_0x1e8425['id']);_0x545028[_0x7329('0x79')](db[_0x7329('0x6a')][_0x7329('0x33')](_0x4f8f98[_0x7329('0x7a')](),{'type':db[_0x7329('0x6a')][_0x7329('0x7b')][_0x7329('0x7c')]})[_0x7329('0x29')](function(_0x1146d4){if(_0x1146d4[_0x7329('0x3a')]===0x1){return _0x1e8425['id'];}else{var _0x31e92d=_['every'](_['map'](_0x1146d4,_0x7329('0x7d')),function(_0x96be7a){return _[_0x7329('0x7e')](_0xd50376,_0x96be7a);});if(_0x31e92d){return _0x1e8425['id'];}}}));}}return BPromise[_0x7329('0x7f')](_0x545028)[_0x7329('0x29')](function(_0x8336d6){_0x53ca43=_(_0x53ca43)['union'](_0x8336d6)[_0x7329('0x80')]()['value']();return db[_0x7329('0x2e')][_0x7329('0x48')]({'where':{'id':_0x2ac07f['params']['id']}})[_0x7329('0x29')](function(_0x4e36ef){return db['sequelize']['transaction'](function(_0x24947d){return _0x4e36ef[_0x7329('0x71')](_0x2ac07f['query'][_0x7329('0x63')],{'transaction':_0x24947d})[_0x7329('0x29')](function(){if(!_[_0x7329('0x81')](_0x53ca43)){return _0x4e36ef[_0x7329('0x82')](_0x53ca43,{'transaction':_0x24947d});}})[_0x7329('0x29')](function(){_0x53ca43['forEach'](function(_0x2de2af){socket['emit']('userOpenchannelQueue:remove',{'UserId':_0x2de2af,'OpenchannelQueueId':_0x4e36ef['id']});});});});});});})[_0x7329('0x29')](respondWithStatusCode(_0x44ea3b,null))[_0x7329('0x44')](handleError(_0x44ea3b,null));};exports[_0x7329('0x83')]=function(_0x383fd2,_0x5a72ec,_0xeb4f13){return db['OpenchannelQueue'][_0x7329('0x48')]({'where':{'id':_0x383fd2['params']['id']}})[_0x7329('0x29')](handleEntityNotFound(_0x5a72ec,null))[_0x7329('0x29')](function(_0x5acdf3){if(_0x5acdf3){return _0x5acdf3[_0x7329('0x83')](_0x383fd2[_0x7329('0x53')][_0x7329('0x63')],_[_0x7329('0x84')](_0x383fd2['body'],[_0x7329('0x63'),'id'])||{})[_0x7329('0x85')](function(_0x2e065d){for(var _0x5f4fa3=0x0;_0x5f4fa3<_0x383fd2['body'][_0x7329('0x63')][_0x7329('0x3a')];_0x5f4fa3+=0x1){socket[_0x7329('0x70')](_0x7329('0x86'),{'UserId':Number(_0x383fd2[_0x7329('0x53')]['ids'][_0x5f4fa3]),'OpenchannelQueueId':Number(_0x383fd2[_0x7329('0x45')]['id'])});}return _0x2e065d;});}})[_0x7329('0x29')](respondWithResult(_0x5a72ec,null))[_0x7329('0x44')](handleError(_0x5a72ec,null));};exports['removeAgents']=function(_0x1460c7,_0x24f830,_0x2beec4){return db[_0x7329('0x2e')][_0x7329('0x48')]({'where':{'id':_0x1460c7[_0x7329('0x45')]['id']}})[_0x7329('0x29')](handleEntityNotFound(_0x24f830,null))[_0x7329('0x29')](function(_0x1ab8e5){if(_0x1ab8e5){return _0x1ab8e5[_0x7329('0x82')](_0x1460c7['query'][_0x7329('0x63')])[_0x7329('0x29')](function(){if(_['isArray'](_0x1460c7[_0x7329('0x33')][_0x7329('0x63')])){for(var _0x2f3cc1=0x0;_0x2f3cc1<_0x1460c7['query'][_0x7329('0x63')]['length'];_0x2f3cc1+=0x1){socket[_0x7329('0x70')](_0x7329('0x87'),{'UserId':Number(_0x1460c7[_0x7329('0x33')][_0x7329('0x63')][_0x2f3cc1]),'OpenchannelQueueId':Number(_0x1460c7[_0x7329('0x45')]['id'])});}}else{socket[_0x7329('0x70')](_0x7329('0x87'),{'UserId':Number(_0x1460c7[_0x7329('0x33')][_0x7329('0x63')]),'OpenchannelQueueId':Number(_0x1460c7['params']['id'])});}});}})['then'](respondWithStatusCode(_0x24f830,null))[_0x7329('0x44')](handleError(_0x24f830,null));};exports[_0x7329('0x88')]=function(_0x3c1960,_0x236e45,_0x580dc3){var _0x2c1689={};var _0x232d0b={};var _0x3539f6;var _0x4ce991;return db[_0x7329('0x2e')][_0x7329('0x56')]({'where':{'id':_0x3c1960[_0x7329('0x45')]['id']}})['then'](handleEntityNotFound(_0x236e45,null))[_0x7329('0x29')](function(_0x3287e6){if(_0x3287e6){_0x3539f6=_0x3287e6;_0x232d0b[_0x7329('0x37')]=_['keys'](db[_0x7329('0x64')][_0x7329('0x57')]);_0x232d0b[_0x7329('0x33')]=_[_0x7329('0x34')](_0x3c1960[_0x7329('0x33')]);_0x232d0b[_0x7329('0x35')]=_[_0x7329('0x36')](_0x232d0b[_0x7329('0x37')],_0x232d0b[_0x7329('0x33')]);_0x2c1689['attributes']=_[_0x7329('0x36')](_0x232d0b['model'],qs['fields'](_0x3c1960['query'][_0x7329('0x39')]));_0x2c1689[_0x7329('0x38')]=_0x2c1689['attributes'][_0x7329('0x3a')]?_0x2c1689[_0x7329('0x38')]:_0x232d0b[_0x7329('0x37')];_0x2c1689[_0x7329('0x58')]=qs['sort'](_0x3c1960[_0x7329('0x33')][_0x7329('0x3d')]);_0x2c1689['where']=qs['filters'](_[_0x7329('0x3f')](_0x3c1960[_0x7329('0x33')],_0x232d0b[_0x7329('0x35')]));if(_0x3c1960[_0x7329('0x33')]['filter']){_0x2c1689['where']=_[_0x7329('0x41')](_0x2c1689[_0x7329('0x3e')],{'$or':_['map'](_0x2c1689['attributes'],function(_0x2607d4){var _0x33cba7={};_0x33cba7[_0x2607d4]={'$like':'%'+_0x3c1960['query'][_0x7329('0x40')]+'%'};return _0x33cba7;})});}_0x2c1689=_[_0x7329('0x41')]({},_0x2c1689,_0x3c1960[_0x7329('0x47')]);return _0x3539f6['getAgents'](_0x2c1689);}})[_0x7329('0x29')](function(_0x43e83e){if(_0x43e83e){_0x4ce991=_0x43e83e[_0x7329('0x3a')];if(!_0x3c1960[_0x7329('0x33')][_0x7329('0x3b')](_0x7329('0x3c'))){_0x2c1689[_0x7329('0x1f')]=qs[_0x7329('0x1f')](_0x3c1960[_0x7329('0x33')]['limit']);_0x2c1689[_0x7329('0x1d')]=qs[_0x7329('0x1d')](_0x3c1960[_0x7329('0x33')][_0x7329('0x1d')]);}return _0x3539f6[_0x7329('0x88')](_0x2c1689);}})[_0x7329('0x29')](function(_0xf94aeb){if(_0xf94aeb){return _0xf94aeb?{'count':_0x4ce991,'rows':_0xf94aeb}:null;}})[_0x7329('0x29')](respondWithResult(_0x236e45,null))[_0x7329('0x44')](handleError(_0x236e45,null));}; \ No newline at end of file +var _0xb9e2=['OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','to-csv','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','undefined','limit','count','offset','Content-Range','reject','then','get','OpenchannelQueues','UserProfileResource','destroy','end','error','stack','name','send','index','map','OpenchannelQueue','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','rawAttributes','length','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','order','User','findAndCountAll','agent','openchannelPause','createdAt','format','%s/%s','SIP','updatedAt','Team','getTeams','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb9e2,0x9c));var _0x2b9e=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0xb9e2[_0x1b5aea];return _0x15cfc6;};'use strict';var emlformat=require(_0x2b9e('0x0'));var rimraf=require(_0x2b9e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2b9e('0x2'));var rp=require(_0x2b9e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2b9e('0x4'));var util=require('util');var path=require(_0x2b9e('0x5'));var sox=require('sox');var csv=require(_0x2b9e('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2b9e('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2b9e('0x8'));var jsforce=require(_0x2b9e('0x9'));var deskjs=require(_0x2b9e('0xa'));var toCsv=require(_0x2b9e('0x6'));var querystring=require('querystring');var Papa=require(_0x2b9e('0xb'));var Redis=require('ioredis');var authService=require(_0x2b9e('0xc'));var qs=require(_0x2b9e('0xd'));var as=require(_0x2b9e('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2b9e('0xf'))(_0x2b9e('0x10'));var utils=require(_0x2b9e('0x11'));var config=require(_0x2b9e('0x12'));var licenseUtil=require(_0x2b9e('0x13'));var db=require(_0x2b9e('0x14'))['db'];config[_0x2b9e('0x15')]=_[_0x2b9e('0x16')](config['redis'],{'host':_0x2b9e('0x17'),'port':0x18eb});var socket=require(_0x2b9e('0x18'))(new Redis(config['redis']));require(_0x2b9e('0x19'))[_0x2b9e('0x1a')](socket);function respondWithStatusCode(_0x3e4710,_0x411372){_0x411372=_0x411372||0xcc;return function(_0x288101){if(_0x288101){return _0x3e4710[_0x2b9e('0x1b')](_0x411372);}return _0x3e4710[_0x2b9e('0x1c')](_0x411372)['end']();};}function respondWithResult(_0x5d1c15,_0x4dddc8){_0x4dddc8=_0x4dddc8||0xc8;return function(_0x16e85f){if(_0x16e85f){return _0x5d1c15['status'](_0x4dddc8)[_0x2b9e('0x1d')](_0x16e85f);}};}function respondWithFilteredResult(_0x32bb0e,_0x2082d1){return function(_0xc63f83){if(_0xc63f83){var _0xf18eed=typeof _0x2082d1['offset']===_0x2b9e('0x1e')&&typeof _0x2082d1[_0x2b9e('0x1f')]===_0x2b9e('0x1e');var _0x2f2ab8=_0xc63f83[_0x2b9e('0x20')];var _0x5978e9=_0xf18eed?0x0:_0x2082d1[_0x2b9e('0x21')];var _0x105b4e=_0xf18eed?_0xc63f83['count']:_0x2082d1[_0x2b9e('0x21')]+_0x2082d1[_0x2b9e('0x1f')];var _0x87db37;if(_0x105b4e>=_0x2f2ab8){_0x105b4e=_0x2f2ab8;_0x87db37=0xc8;}else{_0x87db37=0xce;}_0x32bb0e[_0x2b9e('0x1c')](_0x87db37);return _0x32bb0e['set'](_0x2b9e('0x22'),_0x5978e9+'-'+_0x105b4e+'/'+_0x2f2ab8)['json'](_0xc63f83);}return null;};}function patchUpdates(_0xf71c90){return function(_0xc35a70){try{jsonpatch['apply'](_0xc35a70,_0xf71c90,!![]);}catch(_0x596154){return BPromise[_0x2b9e('0x23')](_0x596154);}return _0xc35a70['save']();};}function saveUpdates(_0xdc2ec2,_0x26ac38){return function(_0x49b52c){if(_0x49b52c){return _0x49b52c['update'](_0xdc2ec2)[_0x2b9e('0x24')](function(_0xa599b9){return _0xa599b9;});}return null;};}function removeEntity(_0x1ad4b7,_0x2bc1de){return function(_0x1688e8){if(_0x1688e8){return _0x1688e8['destroy']()[_0x2b9e('0x24')](function(){var _0x5505fe=_0x1688e8[_0x2b9e('0x25')]({'plain':!![]});var _0x29c67e=_0x2b9e('0x26');return db[_0x2b9e('0x27')][_0x2b9e('0x28')]({'where':{'type':_0x29c67e,'resourceId':_0x5505fe['id']}})[_0x2b9e('0x24')](function(){return _0x1688e8;});})[_0x2b9e('0x24')](function(){_0x1ad4b7[_0x2b9e('0x1c')](0xcc)[_0x2b9e('0x29')]();});}};}function handleEntityNotFound(_0x525aee,_0x4fc251){return function(_0x46913e){if(!_0x46913e){_0x525aee[_0x2b9e('0x1b')](0x194);}return _0x46913e;};}function handleError(_0x5933f8,_0x1b3258){_0x1b3258=_0x1b3258||0x1f4;return function(_0x15c233){logger[_0x2b9e('0x2a')](_0x15c233[_0x2b9e('0x2b')]);if(_0x15c233[_0x2b9e('0x2c')]){delete _0x15c233[_0x2b9e('0x2c')];}_0x5933f8[_0x2b9e('0x1c')](_0x1b3258)[_0x2b9e('0x2d')](_0x15c233);};}exports[_0x2b9e('0x2e')]=function(_0x4e9b97,_0x56f797){var _0x444563={},_0x137f6b={},_0x56558e={'count':0x0,'rows':[]};var _0x34185a=_[_0x2b9e('0x2f')](db[_0x2b9e('0x30')]['rawAttributes'],function(_0x3e0ade){return{'name':_0x3e0ade[_0x2b9e('0x31')],'type':_0x3e0ade['type'][_0x2b9e('0x32')]};});_0x137f6b[_0x2b9e('0x33')]=_[_0x2b9e('0x2f')](_0x34185a,_0x2b9e('0x2c'));_0x137f6b[_0x2b9e('0x34')]=_[_0x2b9e('0x35')](_0x4e9b97[_0x2b9e('0x34')]);_0x137f6b['filters']=_[_0x2b9e('0x36')](_0x137f6b[_0x2b9e('0x33')],_0x137f6b['query']);_0x444563[_0x2b9e('0x37')]=_[_0x2b9e('0x36')](_0x137f6b[_0x2b9e('0x33')],qs[_0x2b9e('0x38')](_0x4e9b97[_0x2b9e('0x34')]['fields']));_0x444563[_0x2b9e('0x37')]=_0x444563[_0x2b9e('0x37')]['length']?_0x444563[_0x2b9e('0x37')]:_0x137f6b[_0x2b9e('0x33')];if(!_0x4e9b97[_0x2b9e('0x34')][_0x2b9e('0x39')](_0x2b9e('0x3a'))){_0x444563[_0x2b9e('0x1f')]=qs[_0x2b9e('0x1f')](_0x4e9b97['query'][_0x2b9e('0x1f')]);_0x444563[_0x2b9e('0x21')]=qs[_0x2b9e('0x21')](_0x4e9b97[_0x2b9e('0x34')][_0x2b9e('0x21')]);}_0x444563['order']=qs[_0x2b9e('0x3b')](_0x4e9b97[_0x2b9e('0x34')][_0x2b9e('0x3b')]);_0x444563[_0x2b9e('0x3c')]=qs[_0x2b9e('0x3d')](_[_0x2b9e('0x3e')](_0x4e9b97[_0x2b9e('0x34')],_0x137f6b[_0x2b9e('0x3d')]),_0x34185a);if(_0x4e9b97[_0x2b9e('0x34')][_0x2b9e('0x3f')]){_0x444563['where']=_[_0x2b9e('0x40')](_0x444563[_0x2b9e('0x3c')],{'$or':_[_0x2b9e('0x2f')](_0x34185a,function(_0x2d47d0){if(_0x2d47d0['type']!==_0x2b9e('0x41')){var _0x383864={};_0x383864[_0x2d47d0['name']]={'$like':'%'+_0x4e9b97[_0x2b9e('0x34')][_0x2b9e('0x3f')]+'%'};return _0x383864;}})});}_0x444563=_['merge']({},_0x444563,_0x4e9b97[_0x2b9e('0x42')]);var _0x30c89b={'where':_0x444563['where']};return db['OpenchannelQueue']['count'](_0x30c89b)[_0x2b9e('0x24')](function(_0x1adc00){_0x56558e[_0x2b9e('0x20')]=_0x1adc00;if(_0x4e9b97[_0x2b9e('0x34')]['includeAll']){_0x444563['include']=[{'all':!![]}];}return db[_0x2b9e('0x30')][_0x2b9e('0x43')](_0x444563);})['then'](function(_0x9dbe2e){_0x56558e[_0x2b9e('0x44')]=_0x9dbe2e;return _0x56558e;})[_0x2b9e('0x24')](respondWithFilteredResult(_0x56f797,_0x444563))[_0x2b9e('0x45')](handleError(_0x56f797,null));};exports[_0x2b9e('0x46')]=function(_0x512112,_0x3ee374){var _0x523211={'raw':!![],'where':{'id':_0x512112[_0x2b9e('0x47')]['id']}},_0x5445f2={};_0x5445f2[_0x2b9e('0x33')]=_[_0x2b9e('0x35')](db['OpenchannelQueue'][_0x2b9e('0x48')]);_0x5445f2[_0x2b9e('0x34')]=_['keys'](_0x512112[_0x2b9e('0x34')]);_0x5445f2[_0x2b9e('0x3d')]=_[_0x2b9e('0x36')](_0x5445f2[_0x2b9e('0x33')],_0x5445f2[_0x2b9e('0x34')]);_0x523211['attributes']=_[_0x2b9e('0x36')](_0x5445f2[_0x2b9e('0x33')],qs[_0x2b9e('0x38')](_0x512112['query']['fields']));_0x523211[_0x2b9e('0x37')]=_0x523211[_0x2b9e('0x37')][_0x2b9e('0x49')]?_0x523211[_0x2b9e('0x37')]:_0x5445f2['model'];if(_0x512112['query']['includeAll']){_0x523211[_0x2b9e('0x4a')]=[{'all':!![]}];}_0x523211=_[_0x2b9e('0x40')]({},_0x523211,_0x512112[_0x2b9e('0x42')]);return db['OpenchannelQueue'][_0x2b9e('0x4b')](_0x523211)[_0x2b9e('0x24')](handleEntityNotFound(_0x3ee374,null))['then'](respondWithResult(_0x3ee374,null))[_0x2b9e('0x45')](handleError(_0x3ee374,null));};exports[_0x2b9e('0x4c')]=function(_0x5c2d9c,_0x5f4f9f){return db[_0x2b9e('0x30')]['create'](_0x5c2d9c[_0x2b9e('0x4d')],{})[_0x2b9e('0x24')](function(_0xacfa04){var _0x41dd50=_0x5c2d9c['user'][_0x2b9e('0x25')]({'plain':!![]});if(!_0x41dd50)throw new Error(_0x2b9e('0x4e'));if(_0x41dd50[_0x2b9e('0x4f')]===_0x2b9e('0x50')){var _0x335a3=_0xacfa04['get']({'plain':!![]});var _0x5613d9=_0x2b9e('0x26');return db['UserProfileSection'][_0x2b9e('0x4b')]({'where':{'name':_0x5613d9,'userProfileId':_0x41dd50['userProfileId']},'raw':!![]})[_0x2b9e('0x24')](function(_0xabc99e){if(_0xabc99e&&_0xabc99e[_0x2b9e('0x51')]===0x0){return db[_0x2b9e('0x27')][_0x2b9e('0x4c')]({'name':_0x335a3[_0x2b9e('0x2c')],'resourceId':_0x335a3['id'],'type':_0xabc99e['name'],'sectionId':_0xabc99e['id']},{})['then'](function(){return _0xacfa04;});}else{return _0xacfa04;}})[_0x2b9e('0x45')](function(_0x377fb7){logger[_0x2b9e('0x2a')](_0x2b9e('0x52'),_0x377fb7);throw _0x377fb7;});}return _0xacfa04;})['then'](respondWithResult(_0x5f4f9f,0xc9))[_0x2b9e('0x45')](handleError(_0x5f4f9f,null));};exports['update']=function(_0x3061a,_0x37336d){if(_0x3061a[_0x2b9e('0x4d')]['id']){delete _0x3061a[_0x2b9e('0x4d')]['id'];}return db[_0x2b9e('0x30')][_0x2b9e('0x4b')]({'where':{'id':_0x3061a[_0x2b9e('0x47')]['id']}})[_0x2b9e('0x24')](handleEntityNotFound(_0x37336d,null))[_0x2b9e('0x24')](saveUpdates(_0x3061a[_0x2b9e('0x4d')],null))[_0x2b9e('0x24')](respondWithResult(_0x37336d,null))[_0x2b9e('0x45')](handleError(_0x37336d,null));};exports['destroy']=function(_0x381e12,_0x353cd0){return db[_0x2b9e('0x30')][_0x2b9e('0x4b')]({'where':{'id':_0x381e12['params']['id']}})[_0x2b9e('0x24')](handleEntityNotFound(_0x353cd0,null))['then'](removeEntity(_0x353cd0,null))[_0x2b9e('0x45')](handleError(_0x353cd0,null));};exports[_0x2b9e('0x53')]=function(_0x2cccb8,_0x1c92df){return db['OpenchannelQueue']['describe']()[_0x2b9e('0x24')](respondWithResult(_0x1c92df,null))[_0x2b9e('0x45')](handleError(_0x1c92df,null));};exports[_0x2b9e('0x54')]=function(_0xbcecf9,_0x2767b2,_0x3c9ee3){var _0xc570df={'raw':!![],'where':{}},_0x2b86a3={},_0x467098;return db[_0x2b9e('0x30')][_0x2b9e('0x55')]({'where':{'id':_0xbcecf9[_0x2b9e('0x47')]['id']}})[_0x2b9e('0x24')](handleEntityNotFound(_0x2767b2,null))[_0x2b9e('0x24')](function(_0x164728){if(_0x164728){_0x467098=_0x164728[_0x2b9e('0x25')]({'plain':!![]});_0x2b86a3[_0x2b9e('0x33')]=_[_0x2b9e('0x35')](db[_0x2b9e('0x56')][_0x2b9e('0x48')]);_0x2b86a3[_0x2b9e('0x34')]=_[_0x2b9e('0x35')](_0xbcecf9['query']);_0x2b86a3[_0x2b9e('0x3d')]=_[_0x2b9e('0x36')](_0x2b86a3[_0x2b9e('0x33')],_0x2b86a3[_0x2b9e('0x34')]);_0xc570df[_0x2b9e('0x37')]=_[_0x2b9e('0x36')](_0x2b86a3[_0x2b9e('0x33')],qs[_0x2b9e('0x38')](_0xbcecf9[_0x2b9e('0x34')][_0x2b9e('0x38')]));_0xc570df[_0x2b9e('0x37')]=_0xc570df[_0x2b9e('0x37')][_0x2b9e('0x49')]?_0xc570df['attributes']:_0x2b86a3[_0x2b9e('0x33')];if(!_0xbcecf9['query'][_0x2b9e('0x39')](_0x2b9e('0x3a'))){_0xc570df['limit']=qs[_0x2b9e('0x1f')](_0xbcecf9[_0x2b9e('0x34')]['limit']);_0xc570df['offset']=qs[_0x2b9e('0x21')](_0xbcecf9[_0x2b9e('0x34')][_0x2b9e('0x21')]);}_0xc570df[_0x2b9e('0x57')]=qs[_0x2b9e('0x3b')](_0xbcecf9[_0x2b9e('0x34')][_0x2b9e('0x3b')]);_0xc570df[_0x2b9e('0x3c')]=qs['filters'](_['pick'](_0xbcecf9[_0x2b9e('0x34')],_0x2b86a3['filters']));_0xc570df[_0x2b9e('0x3c')]['OpenchannelQueueId']=_0x164728['id'];if(_0xbcecf9[_0x2b9e('0x34')][_0x2b9e('0x3f')]){_0xc570df[_0x2b9e('0x3c')]=_['merge'](_0xc570df['where'],{'$or':_[_0x2b9e('0x2f')](_0xc570df[_0x2b9e('0x37')],function(_0x1f677d){var _0x251a0d={};_0x251a0d[_0x1f677d]={'$like':'%'+_0xbcecf9['query'][_0x2b9e('0x3f')]+'%'};return _0x251a0d;})});}_0xc570df=_['merge']({},_0xc570df,_0xbcecf9[_0x2b9e('0x42')]);return db[_0x2b9e('0x56')][_0x2b9e('0x43')](_0xc570df);}})[_0x2b9e('0x24')](function(_0x5e7b82){if(_0x5e7b82){return db[_0x2b9e('0x58')][_0x2b9e('0x59')]({'where':{'id':_[_0x2b9e('0x2f')](_0x5e7b82,'UserId'),'role':_0x2b9e('0x5a')},'attributes':['id',_0x2b9e('0x2c'),_0x2b9e('0x5b'),'updatedAt',_0x2b9e('0x5c')]});}})['then'](function(_0x381e95){if(_0x381e95){return{'count':_0x381e95[_0x2b9e('0x20')],'rows':_['map'](_0x381e95[_0x2b9e('0x44')],function(_0x454fbf){return{'membername':_0x454fbf[_0x2b9e('0x2c')],'UserId':_0x454fbf['id'],'queue_name':_0x467098[_0x2b9e('0x2c')],'OpenchannelQueueId':_0x467098['id'],'interface':util[_0x2b9e('0x5d')](_0x2b9e('0x5e'),_0x2b9e('0x5f'),_0x454fbf['name']),'penalty':0x0,'paused':_0x454fbf[_0x2b9e('0x5b')],'createdAt':_0x454fbf[_0x2b9e('0x5c')],'updatedAt':_0x454fbf[_0x2b9e('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2b9e('0x24')](respondWithFilteredResult(_0x2767b2,_0xc570df))[_0x2b9e('0x45')](handleError(_0x2767b2,null));};exports['getTeams']=function(_0x55f1bb,_0x8771c4,_0x1d69da){var _0x5d6980={};var _0x27a744={};var _0x3b87d5;var _0x16957b;return db[_0x2b9e('0x30')][_0x2b9e('0x55')]({'where':{'id':_0x55f1bb['params']['id']}})['then'](handleEntityNotFound(_0x8771c4,null))[_0x2b9e('0x24')](function(_0x2d43d9){if(_0x2d43d9){_0x3b87d5=_0x2d43d9;_0x27a744['model']=_[_0x2b9e('0x35')](db[_0x2b9e('0x61')][_0x2b9e('0x48')]);_0x27a744['query']=_['keys'](_0x55f1bb['query']);_0x27a744[_0x2b9e('0x3d')]=_[_0x2b9e('0x36')](_0x27a744[_0x2b9e('0x33')],_0x27a744[_0x2b9e('0x34')]);_0x5d6980[_0x2b9e('0x37')]=_['intersection'](_0x27a744[_0x2b9e('0x33')],qs[_0x2b9e('0x38')](_0x55f1bb[_0x2b9e('0x34')][_0x2b9e('0x38')]));_0x5d6980[_0x2b9e('0x37')]=_0x5d6980[_0x2b9e('0x37')]['length']?_0x5d6980['attributes']:_0x27a744[_0x2b9e('0x33')];_0x5d6980[_0x2b9e('0x57')]=qs[_0x2b9e('0x3b')](_0x55f1bb[_0x2b9e('0x34')]['sort']);_0x5d6980[_0x2b9e('0x3c')]=qs['filters'](_[_0x2b9e('0x3e')](_0x55f1bb['query'],_0x27a744['filters']));if(_0x55f1bb[_0x2b9e('0x34')]['filter']){_0x5d6980[_0x2b9e('0x3c')]=_[_0x2b9e('0x40')](_0x5d6980['where'],{'$or':_[_0x2b9e('0x2f')](_0x5d6980[_0x2b9e('0x37')],function(_0x939b19){var _0x53f2b3={};_0x53f2b3[_0x939b19]={'$like':'%'+_0x55f1bb[_0x2b9e('0x34')][_0x2b9e('0x3f')]+'%'};return _0x53f2b3;})});}_0x5d6980=_[_0x2b9e('0x40')]({},_0x5d6980,_0x55f1bb[_0x2b9e('0x42')]);return _0x3b87d5[_0x2b9e('0x62')](_0x5d6980);}})[_0x2b9e('0x24')](function(_0x44b41e){if(_0x44b41e){_0x16957b=_0x44b41e['length'];if(!_0x55f1bb[_0x2b9e('0x34')][_0x2b9e('0x39')](_0x2b9e('0x3a'))){_0x5d6980[_0x2b9e('0x1f')]=qs[_0x2b9e('0x1f')](_0x55f1bb[_0x2b9e('0x34')][_0x2b9e('0x1f')]);_0x5d6980[_0x2b9e('0x21')]=qs['offset'](_0x55f1bb[_0x2b9e('0x34')]['offset']);}return _0x3b87d5[_0x2b9e('0x62')](_0x5d6980);}})[_0x2b9e('0x24')](function(_0x4bc49c){if(_0x4bc49c){return _0x4bc49c?{'count':_0x16957b,'rows':_0x4bc49c}:null;}})[_0x2b9e('0x24')](respondWithResult(_0x8771c4,null))[_0x2b9e('0x45')](handleError(_0x8771c4,null));};exports[_0x2b9e('0x63')]=function(_0xa3f495,_0x250d75,_0x56a22c){var _0x855ec0=_0xa3f495[_0x2b9e('0x4d')][_0x2b9e('0x64')];return db[_0x2b9e('0x61')][_0x2b9e('0x43')]({'where':{'id':_0x855ec0},'attributes':['id'],'include':[{'model':db[_0x2b9e('0x58')],'as':_0x2b9e('0x65'),'attributes':['id',_0x2b9e('0x2c'),_0x2b9e('0x66'),'voicePause',_0x2b9e('0x67')],'raw':!![]}]})[_0x2b9e('0x24')](function(_0x90021b){if(_0x90021b){var _0x14957a=_[_0x2b9e('0x68')](_0x90021b,function(_0x2cd66f){var _0x2b0b79=_0x2cd66f[_0x2b9e('0x25')]({'plain':!![]});return _0x2b0b79['Agents'];});return db[_0x2b9e('0x30')]['find']({'where':{'id':_0xa3f495['params']['id']}})[_0x2b9e('0x24')](function(_0x4cde7c){return db[_0x2b9e('0x69')][_0x2b9e('0x6a')](function(_0x5ed8ea){return _0x4cde7c[_0x2b9e('0x63')](_0x855ec0,{'transaction':_0x5ed8ea})[_0x2b9e('0x24')](function(){return BPromise['each'](_0x14957a,function(_0x1ce0ed){return db[_0x2b9e('0x56')]['findOrCreate']({'where':{'UserId':_0x1ce0ed['id'],'OpenchannelQueueId':_0xa3f495[_0x2b9e('0x47')]['id']},'transaction':_0x5ed8ea});});})[_0x2b9e('0x24')](function(){_0x14957a[_0x2b9e('0x6b')](function(_0x262afe){socket[_0x2b9e('0x6c')](_0x2b9e('0x6d'),{'UserId':_0x262afe['id'],'OpenchannelQueueId':_0x4cde7c['id']});});});});});}})[_0x2b9e('0x24')](respondWithStatusCode(_0x250d75,null))[_0x2b9e('0x45')](handleError(_0x250d75,null));};exports[_0x2b9e('0x6e')]=function(_0x3fbf94,_0x5a5701,_0x28a432){return db[_0x2b9e('0x61')][_0x2b9e('0x43')]({'where':{'id':_0x3fbf94['query'][_0x2b9e('0x64')]},'attributes':['id'],'include':[{'model':db[_0x2b9e('0x58')],'as':_0x2b9e('0x65'),'attributes':['id'],'raw':!![]}]})[_0x2b9e('0x24')](handleEntityNotFound(_0x5a5701,null))[_0x2b9e('0x24')](function(_0x13e2a7){var _0x3e0b53=_[_0x2b9e('0x2f')](_0x13e2a7,'id');var _0x4e80c9=[];var _0x22a62d=[];var _0x12c8ac=squel[_0x2b9e('0x6f')]();_0x12c8ac[_0x2b9e('0x70')](_0x2b9e('0x71'))[_0x2b9e('0x72')](_0x2b9e('0x73'),'tq')[_0x2b9e('0x74')]('user_has_teams','ut',_0x2b9e('0x75'))['where'](_0x2b9e('0x76'),_0x3fbf94[_0x2b9e('0x47')]['id']);for(var _0xafc93a=0x0;_0xafc93a<_0x13e2a7[_0x2b9e('0x49')];_0xafc93a+=0x1){let _0x310bcc=_0x13e2a7[_0xafc93a];for(var _0x3d30c2=0x0;_0x3d30c2<_0x310bcc[_0x2b9e('0x65')][_0x2b9e('0x49')];_0x3d30c2+=0x1){let _0x5aa1e9=_0x310bcc[_0x2b9e('0x65')][_0x3d30c2];var _0x53fe83=_0x12c8ac[_0x2b9e('0x77')]();_0x53fe83['where'](_0x2b9e('0x78'),_0x5aa1e9['id']);_0x22a62d['push'](db[_0x2b9e('0x69')][_0x2b9e('0x34')](_0x53fe83['toString'](),{'type':db[_0x2b9e('0x69')][_0x2b9e('0x79')]['SELECT']})[_0x2b9e('0x24')](function(_0x2d1f9a){if(_0x2d1f9a[_0x2b9e('0x49')]===0x1){return _0x5aa1e9['id'];}else{var _0x5bbeef=_[_0x2b9e('0x7a')](_[_0x2b9e('0x2f')](_0x2d1f9a,_0x2b9e('0x7b')),function(_0xd37989){return _[_0x2b9e('0x7c')](_0x3e0b53,_0xd37989);});if(_0x5bbeef){return _0x5aa1e9['id'];}}}));}}return BPromise[_0x2b9e('0x7d')](_0x22a62d)[_0x2b9e('0x24')](function(_0x2a7b4d){_0x4e80c9=_(_0x4e80c9)[_0x2b9e('0x7e')](_0x2a7b4d)[_0x2b9e('0x7f')]()[_0x2b9e('0x80')]();return db[_0x2b9e('0x30')]['find']({'where':{'id':_0x3fbf94[_0x2b9e('0x47')]['id']}})[_0x2b9e('0x24')](function(_0x462478){return db[_0x2b9e('0x69')][_0x2b9e('0x6a')](function(_0x1dbb42){return _0x462478[_0x2b9e('0x6e')](_0x3fbf94[_0x2b9e('0x34')][_0x2b9e('0x64')],{'transaction':_0x1dbb42})[_0x2b9e('0x24')](function(){if(!_[_0x2b9e('0x81')](_0x4e80c9)){return _0x462478[_0x2b9e('0x82')](_0x4e80c9,{'transaction':_0x1dbb42});}})['then'](function(){_0x4e80c9[_0x2b9e('0x6b')](function(_0x3fdb12){socket[_0x2b9e('0x6c')](_0x2b9e('0x83'),{'UserId':_0x3fdb12,'OpenchannelQueueId':_0x462478['id']});});});});});});})[_0x2b9e('0x24')](respondWithStatusCode(_0x5a5701,null))[_0x2b9e('0x45')](handleError(_0x5a5701,null));};exports[_0x2b9e('0x84')]=function(_0x3735e4,_0x573a37,_0x470dce){return db[_0x2b9e('0x30')][_0x2b9e('0x4b')]({'where':{'id':_0x3735e4[_0x2b9e('0x47')]['id']}})[_0x2b9e('0x24')](handleEntityNotFound(_0x573a37,null))['then'](function(_0x221856){if(_0x221856){return _0x221856[_0x2b9e('0x84')](_0x3735e4['body'][_0x2b9e('0x64')],_[_0x2b9e('0x85')](_0x3735e4['body'],[_0x2b9e('0x64'),'id'])||{})[_0x2b9e('0x86')](function(_0x557058){for(var _0x32764c=0x0;_0x32764c<_0x3735e4['body']['ids'][_0x2b9e('0x49')];_0x32764c+=0x1){socket[_0x2b9e('0x6c')](_0x2b9e('0x6d'),{'UserId':Number(_0x3735e4[_0x2b9e('0x4d')][_0x2b9e('0x64')][_0x32764c]),'OpenchannelQueueId':Number(_0x3735e4[_0x2b9e('0x47')]['id'])});}return _0x557058;});}})[_0x2b9e('0x24')](respondWithResult(_0x573a37,null))['catch'](handleError(_0x573a37,null));};exports['removeAgents']=function(_0xebe910,_0x59a2ea,_0x239486){return db[_0x2b9e('0x30')][_0x2b9e('0x4b')]({'where':{'id':_0xebe910[_0x2b9e('0x47')]['id']}})[_0x2b9e('0x24')](handleEntityNotFound(_0x59a2ea,null))[_0x2b9e('0x24')](function(_0x3cbbe7){if(_0x3cbbe7){return _0x3cbbe7[_0x2b9e('0x82')](_0xebe910['query'][_0x2b9e('0x64')])[_0x2b9e('0x24')](function(){if(_[_0x2b9e('0x87')](_0xebe910[_0x2b9e('0x34')][_0x2b9e('0x64')])){for(var _0x3c3d23=0x0;_0x3c3d23<_0xebe910[_0x2b9e('0x34')][_0x2b9e('0x64')][_0x2b9e('0x49')];_0x3c3d23+=0x1){socket[_0x2b9e('0x6c')](_0x2b9e('0x83'),{'UserId':Number(_0xebe910[_0x2b9e('0x34')][_0x2b9e('0x64')][_0x3c3d23]),'OpenchannelQueueId':Number(_0xebe910[_0x2b9e('0x47')]['id'])});}}else{socket[_0x2b9e('0x6c')]('userOpenchannelQueue:remove',{'UserId':Number(_0xebe910[_0x2b9e('0x34')][_0x2b9e('0x64')]),'OpenchannelQueueId':Number(_0xebe910[_0x2b9e('0x47')]['id'])});}});}})[_0x2b9e('0x24')](respondWithStatusCode(_0x59a2ea,null))[_0x2b9e('0x45')](handleError(_0x59a2ea,null));};exports[_0x2b9e('0x88')]=function(_0x22dc0e,_0x4816f9,_0x28a635){var _0x1d9113={};var _0x535288={};var _0x152241;var _0xc6f2af;return db[_0x2b9e('0x30')][_0x2b9e('0x55')]({'where':{'id':_0x22dc0e[_0x2b9e('0x47')]['id']}})[_0x2b9e('0x24')](handleEntityNotFound(_0x4816f9,null))['then'](function(_0x2df811){if(_0x2df811){_0x152241=_0x2df811;_0x535288[_0x2b9e('0x33')]=_[_0x2b9e('0x35')](db[_0x2b9e('0x58')][_0x2b9e('0x48')]);_0x535288['query']=_['keys'](_0x22dc0e['query']);_0x535288['filters']=_[_0x2b9e('0x36')](_0x535288[_0x2b9e('0x33')],_0x535288[_0x2b9e('0x34')]);_0x1d9113[_0x2b9e('0x37')]=_['intersection'](_0x535288[_0x2b9e('0x33')],qs[_0x2b9e('0x38')](_0x22dc0e[_0x2b9e('0x34')][_0x2b9e('0x38')]));_0x1d9113[_0x2b9e('0x37')]=_0x1d9113['attributes'][_0x2b9e('0x49')]?_0x1d9113[_0x2b9e('0x37')]:_0x535288[_0x2b9e('0x33')];_0x1d9113[_0x2b9e('0x57')]=qs['sort'](_0x22dc0e[_0x2b9e('0x34')][_0x2b9e('0x3b')]);_0x1d9113[_0x2b9e('0x3c')]=qs[_0x2b9e('0x3d')](_[_0x2b9e('0x3e')](_0x22dc0e[_0x2b9e('0x34')],_0x535288[_0x2b9e('0x3d')]));if(_0x22dc0e[_0x2b9e('0x34')][_0x2b9e('0x3f')]){_0x1d9113['where']=_[_0x2b9e('0x40')](_0x1d9113['where'],{'$or':_['map'](_0x1d9113[_0x2b9e('0x37')],function(_0x30eb02){var _0x11bbdf={};_0x11bbdf[_0x30eb02]={'$like':'%'+_0x22dc0e[_0x2b9e('0x34')][_0x2b9e('0x3f')]+'%'};return _0x11bbdf;})});}_0x1d9113=_[_0x2b9e('0x40')]({},_0x1d9113,_0x22dc0e[_0x2b9e('0x42')]);return _0x152241['getAgents'](_0x1d9113);}})[_0x2b9e('0x24')](function(_0x56d700){if(_0x56d700){_0xc6f2af=_0x56d700['length'];if(!_0x22dc0e[_0x2b9e('0x34')]['hasOwnProperty'](_0x2b9e('0x3a'))){_0x1d9113[_0x2b9e('0x1f')]=qs[_0x2b9e('0x1f')](_0x22dc0e[_0x2b9e('0x34')][_0x2b9e('0x1f')]);_0x1d9113['offset']=qs[_0x2b9e('0x21')](_0x22dc0e[_0x2b9e('0x34')][_0x2b9e('0x21')]);}return _0x152241[_0x2b9e('0x88')](_0x1d9113);}})[_0x2b9e('0x24')](function(_0x40c954){if(_0x40c954){return _0x40c954?{'count':_0xc6f2af,'rows':_0x40c954}:null;}})[_0x2b9e('0x24')](respondWithResult(_0x4816f9,null))[_0x2b9e('0x45')](handleError(_0x4816f9,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index e0e530c..982b15d 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 _0xdf9a=['update','remove','emit','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xdf9a,0x1b3));var _0xadf9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdf9a[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xadf9('0x0'));var OpenchannelQueue=require(_0xadf9('0x1'))['db'][_0xadf9('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xadf9('0x3')](0x0);var events={'afterCreate':_0xadf9('0x4'),'afterUpdate':_0xadf9('0x5'),'afterDestroy':_0xadf9('0x6')};function emitEvent(_0x4ef246){return function(_0x11a2a2,_0x56e844,_0x514a4e){OpenchannelQueueEvents[_0xadf9('0x7')](_0x4ef246+':'+_0x11a2a2['id'],_0x11a2a2);OpenchannelQueueEvents['emit'](_0x4ef246,_0x11a2a2);_0x514a4e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xadf9('0x8')](e,emitEvent(event));}}module[_0xadf9('0x9')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x18a9=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save'];(function(_0x3f2360,_0xe2994f){var _0x5a56e0=function(_0x1d175f){while(--_0x1d175f){_0x3f2360['push'](_0x3f2360['shift']());}};_0x5a56e0(++_0xe2994f);}(_0x18a9,0x1a8));var _0x918a=function(_0x393725,_0x2c4d40){_0x393725=_0x393725-0x0;var _0x5bb005=_0x18a9[_0x393725];return _0x5bb005;};'use strict';var EventEmitter=require(_0x918a('0x0'));var OpenchannelQueue=require(_0x918a('0x1'))['db'][_0x918a('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x918a('0x3')](0x0);var events={'afterCreate':_0x918a('0x4'),'afterUpdate':_0x918a('0x5'),'afterDestroy':_0x918a('0x6')};function emitEvent(_0xdd94ad){return function(_0xc84084,_0x8529dc,_0x1f37f7){OpenchannelQueueEvents['emit'](_0xdd94ad+':'+_0xc84084['id'],_0xc84084);OpenchannelQueueEvents[_0x918a('0x7')](_0xdd94ad,_0xc84084);_0x1f37f7(null);};}for(var e in events){if(events[_0x918a('0x8')](e)){var event=events[e];OpenchannelQueue[_0x918a('0x9')](e,emitEvent(event));}}module[_0x918a('0xa')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 699c7ec..fdff18e 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 _0xb444=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','openchannel_queues','lodash'];(function(_0x25d164,_0x2774f4){var _0x325c01=function(_0x28bd13){while(--_0x28bd13){_0x25d164['push'](_0x25d164['shift']());}};_0x325c01(++_0x2774f4);}(_0xb444,0xa8));var _0x4b44=function(_0x123385,_0x8d8555){_0x123385=_0x123385-0x0;var _0x3e2113=_0xb444[_0x123385];return _0x3e2113;};'use strict';var _=require(_0x4b44('0x0'));var util=require(_0x4b44('0x1'));var logger=require(_0x4b44('0x2'))(_0x4b44('0x3'));var moment=require(_0x4b44('0x4'));var BPromise=require(_0x4b44('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b44('0x6'));var rimraf=require(_0x4b44('0x7'));var config=require(_0x4b44('0x8'));var attributes=require(_0x4b44('0x9'));module['exports']=function(_0x14dd54,_0x33f61b){return _0x14dd54[_0x4b44('0xa')](_0x4b44('0xb'),attributes,{'tableName':_0x4b44('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc13c=['api','moment','bluebird','path','rimraf','../../config/environment','exports','define','OpenchannelQueue','util','../../config/logger'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xc13c,0xb9));var _0xcc13=function(_0x29ef48,_0x5bfb9f){_0x29ef48=_0x29ef48-0x0;var _0x38c117=_0xc13c[_0x29ef48];return _0x38c117;};'use strict';var _=require('lodash');var util=require(_0xcc13('0x0'));var logger=require(_0xcc13('0x1'))(_0xcc13('0x2'));var moment=require(_0xcc13('0x3'));var BPromise=require(_0xcc13('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc13('0x5'));var rimraf=require(_0xcc13('0x6'));var config=require(_0xcc13('0x7'));var attributes=require('./openchannelQueue.attributes');module[_0xcc13('0x8')]=function(_0x381105,_0x1eff4c){return _0x381105[_0xcc13('0x9')](_0xcc13('0xa'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index ddf93e3..c152083 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 _0x9a51=['OpenchannelQueue','options','raw','where','attributes','limit','include','map','model','debug','ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetOpenchannelQueue'];(function(_0x4160e0,_0x4807c3){var _0x5711c6=function(_0x42b504){while(--_0x42b504){_0x4160e0['push'](_0x4160e0['shift']());}};_0x5711c6(++_0x4807c3);}(_0x9a51,0x146));var _0x19a5=function(_0x3bc298,_0x583d14){_0x3bc298=_0x3bc298-0x0;var _0x31bf58=_0x9a51[_0x3bc298];return _0x31bf58;};'use strict';var _=require(_0x19a5('0x0'));var util=require(_0x19a5('0x1'));var moment=require(_0x19a5('0x2'));var BPromise=require(_0x19a5('0x3'));var rs=require(_0x19a5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x19a5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x19a5('0x6'));var config=require(_0x19a5('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x19a5('0x8')]({'port':0x232a});config[_0x19a5('0x9')]=_[_0x19a5('0xa')](config['redis'],{'host':_0x19a5('0xb'),'port':0x18eb});var socket=require(_0x19a5('0xc'))(new Redis(config[_0x19a5('0x9')]));require('./openchannelQueue.socket')['register'](socket);function respondWithRpcPromise(_0xb891af,_0x2fd81b,_0x33b80f){return new BPromise(function(_0x2450c1,_0x391a23){return client['request'](_0xb891af,_0x33b80f)[_0x19a5('0xd')](function(_0x222399){logger[_0x19a5('0xe')](_0x19a5('0xf'),_0x2fd81b,_0x19a5('0x10'));logger['debug'](_0x19a5('0x11'),_0x2fd81b,_0x19a5('0x10'),JSON[_0x19a5('0x12')](_0x222399));if(_0x222399[_0x19a5('0x13')]){if(_0x222399[_0x19a5('0x13')][_0x19a5('0x14')]===0x1f4){logger[_0x19a5('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x2fd81b,_0x222399[_0x19a5('0x13')][_0x19a5('0x15')]);return _0x391a23(_0x222399[_0x19a5('0x13')][_0x19a5('0x15')]);}logger['error'](_0x19a5('0xf'),_0x2fd81b,_0x222399['error'][_0x19a5('0x15')]);return _0x2450c1(_0x222399[_0x19a5('0x13')][_0x19a5('0x15')]);}else{logger[_0x19a5('0xe')](_0x19a5('0xf'),_0x2fd81b,'request\x20sent');_0x2450c1(_0x222399['result']['message']);}})[_0x19a5('0x16')](function(_0x2bbe1f){logger['error'](_0x19a5('0xf'),_0x2fd81b,_0x2bbe1f);_0x391a23(_0x2bbe1f);});});}exports[_0x19a5('0x17')]=function(_0x19be94){var _0x5d3d2e=this;return new Promise(function(_0x1eb3aa,_0x104b17){return db[_0x19a5('0x18')]['findAll']({'raw':_0x19be94['options']?_0x19be94[_0x19a5('0x19')][_0x19a5('0x1a')]===undefined?!![]:![]:!![],'where':_0x19be94['options']?_0x19be94['options'][_0x19a5('0x1b')]||null:null,'attributes':_0x19be94[_0x19a5('0x19')]?_0x19be94['options'][_0x19a5('0x1c')]||null:null,'limit':_0x19be94[_0x19a5('0x19')]?_0x19be94[_0x19a5('0x19')][_0x19a5('0x1d')]||null:null,'include':_0x19be94['options']?_0x19be94[_0x19a5('0x19')][_0x19a5('0x1e')]?_[_0x19a5('0x1f')](_0x19be94['options'][_0x19a5('0x1e')],function(_0x5b11c7){return{'model':db[_0x5b11c7[_0x19a5('0x20')]],'as':_0x5b11c7['as'],'attributes':_0x5b11c7[_0x19a5('0x1c')],'include':_0x5b11c7[_0x19a5('0x1e')]?_[_0x19a5('0x1f')](_0x5b11c7[_0x19a5('0x1e')],function(_0x1d5776){return{'model':db[_0x1d5776[_0x19a5('0x20')]],'as':_0x1d5776['as'],'attributes':_0x1d5776[_0x19a5('0x1c')],'include':_0x1d5776[_0x19a5('0x1e')]?_[_0x19a5('0x1f')](_0x1d5776['include'],function(_0xf83dfa){return{'model':db[_0xf83dfa[_0x19a5('0x20')]],'as':_0xf83dfa['as'],'attributes':_0xf83dfa[_0x19a5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x19a5('0xd')](function(_0x3493e1){logger['info'](_0x19a5('0x17'),_0x19be94);logger[_0x19a5('0x21')](_0x19a5('0x17'),_0x19be94,JSON['stringify'](_0x3493e1));_0x1eb3aa(_0x3493e1);})['catch'](function(_0x4263ac){logger[_0x19a5('0x13')](_0x19a5('0x17'),_0x4263ac[_0x19a5('0x15')],_0x19be94);_0x104b17(_0x5d3d2e[_0x19a5('0x13')](0x1f4,_0x4263ac[_0x19a5('0x15')]));});});};exports[_0x19a5('0x22')]=function(_0xbf0ca4){var _0x4ba691=this;return new Promise(function(_0x58d5cf,_0x5daf98){return db['OpenchannelQueue']['find']({'raw':_0xbf0ca4['options']?_0xbf0ca4['options'][_0x19a5('0x1a')]===undefined?!![]:![]:!![],'where':_0xbf0ca4[_0x19a5('0x19')]?_0xbf0ca4['options'][_0x19a5('0x1b')]||null:null,'attributes':_0xbf0ca4['options']?_0xbf0ca4[_0x19a5('0x19')][_0x19a5('0x1c')]||null:null,'include':_0xbf0ca4['options']?_0xbf0ca4['options'][_0x19a5('0x1e')]?_[_0x19a5('0x1f')](_0xbf0ca4[_0x19a5('0x19')][_0x19a5('0x1e')],function(_0x2ec118){return{'model':db[_0x2ec118[_0x19a5('0x20')]],'as':_0x2ec118['as'],'attributes':_0x2ec118[_0x19a5('0x1c')],'include':_0x2ec118['include']?_['map'](_0x2ec118[_0x19a5('0x1e')],function(_0x13975e){return{'model':db[_0x13975e['model']],'as':_0x13975e['as'],'attributes':_0x13975e[_0x19a5('0x1c')],'include':_0x13975e['include']?_[_0x19a5('0x1f')](_0x13975e[_0x19a5('0x1e')],function(_0x57ed0b){return{'model':db[_0x57ed0b['model']],'as':_0x57ed0b['as'],'attributes':_0x57ed0b['attributes']};}):[]};}):[]};}):[]:[]})[_0x19a5('0xd')](function(_0x12a2b4){logger[_0x19a5('0xe')]('ShowOpenchannelQueue',_0xbf0ca4);logger[_0x19a5('0x21')](_0x19a5('0x22'),_0xbf0ca4,JSON[_0x19a5('0x12')](_0x12a2b4));_0x58d5cf(_0x12a2b4);})[_0x19a5('0x16')](function(_0x5193f2){logger[_0x19a5('0x13')](_0x19a5('0x22'),_0x5193f2[_0x19a5('0x15')],_0xbf0ca4);_0x5daf98(_0x4ba691['error'](0x1f4,_0x5193f2['message']));});});}; \ No newline at end of file +var _0x6469=['find','map','ShowOpenchannelQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','./openchannelQueue.socket','register','then','info','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','model','GetOpenchannelQueue'];(function(_0x26342f,_0x3b98c0){var _0x5711e2=function(_0x503d21){while(--_0x503d21){_0x26342f['push'](_0x26342f['shift']());}};_0x5711e2(++_0x3b98c0);}(_0x6469,0xc6));var _0x9646=function(_0x1a0351,_0x25201f){_0x1a0351=_0x1a0351-0x0;var _0x4ca27b=_0x6469[_0x1a0351];return _0x4ca27b;};'use strict';var _=require('lodash');var util=require(_0x9646('0x0'));var moment=require(_0x9646('0x1'));var BPromise=require(_0x9646('0x2'));var rs=require(_0x9646('0x3'));var fs=require('fs');var Redis=require(_0x9646('0x4'));var db=require(_0x9646('0x5'))['db'];var utils=require(_0x9646('0x6'));var logger=require(_0x9646('0x7'))('rpc');var config=require(_0x9646('0x8'));var jayson=require(_0x9646('0x9'));var client=jayson[_0x9646('0xa')][_0x9646('0xb')]({'port':0x232a});config[_0x9646('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9646('0xd'))[_0x9646('0xe')](socket);function respondWithRpcPromise(_0x165a3b,_0x3dab99,_0x25fd07){return new BPromise(function(_0x434378,_0x47e927){return client['request'](_0x165a3b,_0x25fd07)[_0x9646('0xf')](function(_0xd44b16){logger[_0x9646('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x3dab99,'request\x20sent');logger[_0x9646('0x11')](_0x9646('0x12'),_0x3dab99,_0x9646('0x13'),JSON['stringify'](_0xd44b16));if(_0xd44b16[_0x9646('0x14')]){if(_0xd44b16[_0x9646('0x14')][_0x9646('0x15')]===0x1f4){logger[_0x9646('0x14')](_0x9646('0x16'),_0x3dab99,_0xd44b16['error'][_0x9646('0x17')]);return _0x47e927(_0xd44b16['error'][_0x9646('0x17')]);}logger[_0x9646('0x14')](_0x9646('0x16'),_0x3dab99,_0xd44b16[_0x9646('0x14')]['message']);return _0x434378(_0xd44b16['error']['message']);}else{logger[_0x9646('0x10')](_0x9646('0x16'),_0x3dab99,_0x9646('0x13'));_0x434378(_0xd44b16[_0x9646('0x18')]['message']);}})[_0x9646('0x19')](function(_0x2e3af6){logger[_0x9646('0x14')](_0x9646('0x16'),_0x3dab99,_0x2e3af6);_0x47e927(_0x2e3af6);});});}exports['GetOpenchannelQueue']=function(_0x201e6){var _0x5b2af3=this;return new Promise(function(_0x4d6ee5,_0x23da47){return db[_0x9646('0x1a')][_0x9646('0x1b')]({'raw':_0x201e6[_0x9646('0x1c')]?_0x201e6[_0x9646('0x1c')][_0x9646('0x1d')]===undefined?!![]:![]:!![],'where':_0x201e6['options']?_0x201e6[_0x9646('0x1c')][_0x9646('0x1e')]||null:null,'attributes':_0x201e6[_0x9646('0x1c')]?_0x201e6[_0x9646('0x1c')][_0x9646('0x1f')]||null:null,'limit':_0x201e6[_0x9646('0x1c')]?_0x201e6[_0x9646('0x1c')][_0x9646('0x20')]||null:null,'include':_0x201e6[_0x9646('0x1c')]?_0x201e6[_0x9646('0x1c')][_0x9646('0x21')]?_['map'](_0x201e6['options']['include'],function(_0x50663b){return{'model':db[_0x50663b['model']],'as':_0x50663b['as'],'attributes':_0x50663b[_0x9646('0x1f')],'include':_0x50663b['include']?_['map'](_0x50663b[_0x9646('0x21')],function(_0x5a9f12){return{'model':db[_0x5a9f12[_0x9646('0x22')]],'as':_0x5a9f12['as'],'attributes':_0x5a9f12[_0x9646('0x1f')],'include':_0x5a9f12[_0x9646('0x21')]?_['map'](_0x5a9f12['include'],function(_0x2cd5ff){return{'model':db[_0x2cd5ff[_0x9646('0x22')]],'as':_0x2cd5ff['as'],'attributes':_0x2cd5ff['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x407485){logger[_0x9646('0x10')](_0x9646('0x23'),_0x201e6);logger[_0x9646('0x11')]('GetOpenchannelQueue',_0x201e6,JSON['stringify'](_0x407485));_0x4d6ee5(_0x407485);})[_0x9646('0x19')](function(_0xe3564c){logger[_0x9646('0x14')](_0x9646('0x23'),_0xe3564c[_0x9646('0x17')],_0x201e6);_0x23da47(_0x5b2af3[_0x9646('0x14')](0x1f4,_0xe3564c[_0x9646('0x17')]));});});};exports['ShowOpenchannelQueue']=function(_0xb183c7){var _0x26a8ce=this;return new Promise(function(_0x3394f2,_0x585e7c){return db['OpenchannelQueue'][_0x9646('0x24')]({'raw':_0xb183c7[_0x9646('0x1c')]?_0xb183c7[_0x9646('0x1c')][_0x9646('0x1d')]===undefined?!![]:![]:!![],'where':_0xb183c7['options']?_0xb183c7[_0x9646('0x1c')][_0x9646('0x1e')]||null:null,'attributes':_0xb183c7[_0x9646('0x1c')]?_0xb183c7[_0x9646('0x1c')]['attributes']||null:null,'include':_0xb183c7['options']?_0xb183c7[_0x9646('0x1c')]['include']?_['map'](_0xb183c7[_0x9646('0x1c')]['include'],function(_0x684ee2){return{'model':db[_0x684ee2['model']],'as':_0x684ee2['as'],'attributes':_0x684ee2[_0x9646('0x1f')],'include':_0x684ee2['include']?_[_0x9646('0x25')](_0x684ee2[_0x9646('0x21')],function(_0x22f7dc){return{'model':db[_0x22f7dc[_0x9646('0x22')]],'as':_0x22f7dc['as'],'attributes':_0x22f7dc[_0x9646('0x1f')],'include':_0x22f7dc[_0x9646('0x21')]?_[_0x9646('0x25')](_0x22f7dc[_0x9646('0x21')],function(_0x78c6d6){return{'model':db[_0x78c6d6[_0x9646('0x22')]],'as':_0x78c6d6['as'],'attributes':_0x78c6d6[_0x9646('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9646('0xf')](function(_0x3cf617){logger[_0x9646('0x10')]('ShowOpenchannelQueue',_0xb183c7);logger['debug'](_0x9646('0x26'),_0xb183c7,JSON['stringify'](_0x3cf617));_0x3394f2(_0x3cf617);})[_0x9646('0x19')](function(_0x1011b2){logger['error']('ShowOpenchannelQueue',_0x1011b2['message'],_0xb183c7);_0x585e7c(_0x26a8ce[_0x9646('0x14')](0x1f4,_0x1011b2[_0x9646('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 57753f9..a4fcf44 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 _0x24ed=['update','emit','register','length','./openchannelQueue.events','save','remove'];(function(_0x4119c4,_0x3b9c46){var _0x23e9ca=function(_0x1d80a8){while(--_0x1d80a8){_0x4119c4['push'](_0x4119c4['shift']());}};_0x23e9ca(++_0x3b9c46);}(_0x24ed,0x154));var _0xd24e=function(_0x2a7788,_0x4dcfbd){_0x2a7788=_0x2a7788-0x0;var _0x5c5ab1=_0x24ed[_0x2a7788];return _0x5c5ab1;};'use strict';var OpenchannelQueueEvents=require(_0xd24e('0x0'));var events=[_0xd24e('0x1'),_0xd24e('0x2'),_0xd24e('0x3')];function createListener(_0x1fd836,_0x4155ff){return function(_0x514a23){_0x4155ff[_0xd24e('0x4')](_0x1fd836,_0x514a23);};}function removeListener(_0x506afa,_0x1fd69f){return function(){OpenchannelQueueEvents['removeListener'](_0x506afa,_0x1fd69f);};}exports[_0xd24e('0x5')]=function(_0x166d4b){for(var _0x1f4b57=0x0,_0x17ae84=events[_0xd24e('0x6')];_0x1f4b57<_0x17ae84;_0x1f4b57++){var _0x557c23=events[_0x1f4b57];var _0xcc5962=createListener('openchannelQueue:'+_0x557c23,_0x166d4b);OpenchannelQueueEvents['on'](_0x557c23,_0xcc5962);}}; \ No newline at end of file +var _0xed57=['save','update','emit','removeListener','register','openchannelQueue:','./openchannelQueue.events'];(function(_0x38bbe2,_0x44c86c){var _0x5ac5b4=function(_0x13de57){while(--_0x13de57){_0x38bbe2['push'](_0x38bbe2['shift']());}};_0x5ac5b4(++_0x44c86c);}(_0xed57,0x133));var _0x7ed5=function(_0x1a921c,_0x530418){_0x1a921c=_0x1a921c-0x0;var _0x4b0690=_0xed57[_0x1a921c];return _0x4b0690;};'use strict';var OpenchannelQueueEvents=require(_0x7ed5('0x0'));var events=[_0x7ed5('0x1'),'remove',_0x7ed5('0x2')];function createListener(_0x2ec1ee,_0x1ec472){return function(_0x27b884){_0x1ec472[_0x7ed5('0x3')](_0x2ec1ee,_0x27b884);};}function removeListener(_0x4828c5,_0x386c40){return function(){OpenchannelQueueEvents[_0x7ed5('0x4')](_0x4828c5,_0x386c40);};}exports[_0x7ed5('0x5')]=function(_0x55745c){for(var _0x1df343=0x0,_0x285d1c=events['length'];_0x1df343<_0x285d1c;_0x1df343++){var _0x5dff72=events[_0x1df343];var _0x1d0f03=createListener(_0x7ed5('0x6')+_0x5dff72,_0x55745c);OpenchannelQueueEvents['on'](_0x5dff72,_0x1d0f03);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 5d50f22..297bf7f 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 _0x1f62=['fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','show','put','/:id','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f62,0x13c));var _0x21f6=function(_0x4a2266,_0x53e92f){_0x4a2266=_0x4a2266-0x0;var _0x1d7b9f=_0x1f62[_0x4a2266];return _0x1d7b9f;};'use strict';var multer=require(_0x21f6('0x0'));var util=require('util');var path=require(_0x21f6('0x1'));var timeout=require(_0x21f6('0x2'));var express=require(_0x21f6('0x3'));var router=express['Router']();var fs_extra=require(_0x21f6('0x4'));var auth=require(_0x21f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x21f6('0x6'));var controller=require('./openchannelQueueReport.controller');router['get']('/',auth[_0x21f6('0x7')](),controller[_0x21f6('0x8')]);router[_0x21f6('0x9')]('/describe',auth[_0x21f6('0x7')](),controller['describe']);router[_0x21f6('0x9')]('/:id',auth[_0x21f6('0x7')](),controller[_0x21f6('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x21f6('0xb')](_0x21f6('0xc'),auth[_0x21f6('0x7')](),controller['update']);router[_0x21f6('0xd')](_0x21f6('0xc'),auth[_0x21f6('0x7')](),controller[_0x21f6('0xe')]);module[_0x21f6('0xf')]=router; \ No newline at end of file +var _0x03cd=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','get','/describe','describe','/:id','post','create','put','update','delete','destroy','path','connect-timeout'];(function(_0x309458,_0xba6e63){var _0x3306ee=function(_0x47e10c){while(--_0x47e10c){_0x309458['push'](_0x309458['shift']());}};_0x3306ee(++_0xba6e63);}(_0x03cd,0x17a));var _0xd03c=function(_0x5687fb,_0x4ef446){_0x5687fb=_0x5687fb-0x0;var _0x2b2a46=_0x03cd[_0x5687fb];return _0x2b2a46;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd03c('0x0'));var timeout=require(_0xd03c('0x1'));var express=require('express');var router=express[_0xd03c('0x2')]();var fs_extra=require(_0xd03c('0x3'));var auth=require(_0xd03c('0x4'));var interaction=require(_0xd03c('0x5'));var config=require(_0xd03c('0x6'));var controller=require(_0xd03c('0x7'));router['get']('/',auth[_0xd03c('0x8')](),controller['index']);router[_0xd03c('0x9')](_0xd03c('0xa'),auth[_0xd03c('0x8')](),controller[_0xd03c('0xb')]);router[_0xd03c('0x9')](_0xd03c('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xd03c('0xd')]('/',auth['isAuthenticated'](),controller[_0xd03c('0xe')]);router[_0xd03c('0xf')](_0xd03c('0xc'),auth['isAuthenticated'](),controller[_0xd03c('0x10')]);router[_0xd03c('0x11')](_0xd03c('0xc'),auth[_0xd03c('0x8')](),controller[_0xd03c('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 267c781..4936564 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 _0x5c83=['exports','STRING','DATE','moment','sequelize'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x5c83,0xb2));var _0x35c8=function(_0x5235dd,_0x3f91cf){_0x5235dd=_0x5235dd-0x0;var _0x13059d=_0x5c83[_0x5235dd];return _0x13059d;};'use strict';var moment=require(_0x35c8('0x0'));var Sequelize=require(_0x35c8('0x1'));module[_0x35c8('0x2')]={'uniqueid':{'type':Sequelize[_0x35c8('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x35c8('0x3')]},'joinAt':{'type':Sequelize[_0x35c8('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x35c8('0x4')]},'exitAt':{'type':Sequelize[_0x35c8('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9dc0=['DATE','exports','STRING'];(function(_0x37fcda,_0x2f5aa1){var _0xf5ed91=function(_0x3c3241){while(--_0x3c3241){_0x37fcda['push'](_0x37fcda['shift']());}};_0xf5ed91(++_0x2f5aa1);}(_0x9dc0,0xd6));var _0x09dc=function(_0x14bf63,_0xdbd373){_0x14bf63=_0x14bf63-0x0;var _0x410d22=_0x9dc0[_0x14bf63];return _0x410d22;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x09dc('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x09dc('0x1')]},'joinAt':{'type':Sequelize[_0x09dc('0x2')]},'leaveAt':{'type':Sequelize[_0x09dc('0x2')]},'acceptAt':{'type':Sequelize[_0x09dc('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x09dc('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index e2adb23..3444bee 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 _0x0597=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','OpenchannelQueueReport','includeAll','include','rows','catch','params','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','model','keys'];(function(_0x278a45,_0x55e0ee){var _0x436c8b=function(_0x45dba5){while(--_0x45dba5){_0x278a45['push'](_0x278a45['shift']());}};_0x436c8b(++_0x55e0ee);}(_0x0597,0x144));var _0x7059=function(_0x29fdaf,_0x55c4fb){_0x29fdaf=_0x29fdaf-0x0;var _0x59404e=_0x0597[_0x29fdaf];return _0x59404e;};'use strict';var emlformat=require(_0x7059('0x0'));var rimraf=require(_0x7059('0x1'));var zipdir=require(_0x7059('0x2'));var jsonpatch=require(_0x7059('0x3'));var rp=require('request-promise');var moment=require(_0x7059('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7059('0x5'));var util=require(_0x7059('0x6'));var path=require(_0x7059('0x7'));var sox=require('sox');var csv=require(_0x7059('0x8'));var ejs=require(_0x7059('0x9'));var fs=require('fs');var fs_extra=require(_0x7059('0xa'));var _=require(_0x7059('0xb'));var squel=require(_0x7059('0xc'));var crypto=require(_0x7059('0xd'));var jsforce=require(_0x7059('0xe'));var deskjs=require(_0x7059('0xf'));var toCsv=require(_0x7059('0x8'));var querystring=require(_0x7059('0x10'));var Papa=require(_0x7059('0x11'));var Redis=require(_0x7059('0x12'));var authService=require(_0x7059('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7059('0x14'));var hardwareService=require(_0x7059('0x15'));var logger=require(_0x7059('0x16'))(_0x7059('0x17'));var utils=require(_0x7059('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7059('0x19'))['db'];function respondWithStatusCode(_0x2cb70e,_0xe9303){_0xe9303=_0xe9303||0xcc;return function(_0x1dad24){if(_0x1dad24){return _0x2cb70e[_0x7059('0x1a')](_0xe9303);}return _0x2cb70e[_0x7059('0x1b')](_0xe9303)[_0x7059('0x1c')]();};}function respondWithResult(_0x346191,_0xe26ea0){_0xe26ea0=_0xe26ea0||0xc8;return function(_0x20f5f3){if(_0x20f5f3){return _0x346191[_0x7059('0x1b')](_0xe26ea0)[_0x7059('0x1d')](_0x20f5f3);}};}function respondWithFilteredResult(_0x237eee,_0x2a4fbe){return function(_0x13dbb0){if(_0x13dbb0){var _0x490d78=typeof _0x2a4fbe['offset']===_0x7059('0x1e')&&typeof _0x2a4fbe['limit']===_0x7059('0x1e');var _0x4971ac=_0x13dbb0[_0x7059('0x1f')];var _0x1e5352=_0x490d78?0x0:_0x2a4fbe[_0x7059('0x20')];var _0x5f4854=_0x490d78?_0x13dbb0[_0x7059('0x1f')]:_0x2a4fbe['offset']+_0x2a4fbe[_0x7059('0x21')];var _0xca0620;if(_0x5f4854>=_0x4971ac){_0x5f4854=_0x4971ac;_0xca0620=0xc8;}else{_0xca0620=0xce;}_0x237eee[_0x7059('0x1b')](_0xca0620);return _0x237eee[_0x7059('0x22')]('Content-Range',_0x1e5352+'-'+_0x5f4854+'/'+_0x4971ac)[_0x7059('0x1d')](_0x13dbb0);}return null;};}function patchUpdates(_0x5a2fba){return function(_0x366e79){try{jsonpatch[_0x7059('0x23')](_0x366e79,_0x5a2fba,!![]);}catch(_0x59be8e){return BPromise[_0x7059('0x24')](_0x59be8e);}return _0x366e79[_0x7059('0x25')]();};}function saveUpdates(_0x142459,_0x13538e){return function(_0x3b7559){if(_0x3b7559){return _0x3b7559[_0x7059('0x26')](_0x142459)[_0x7059('0x27')](function(_0x2a6e85){return _0x2a6e85;});}return null;};}function removeEntity(_0x41ec22,_0x3281eb){return function(_0x26f17e){if(_0x26f17e){return _0x26f17e[_0x7059('0x28')]()[_0x7059('0x27')](function(){_0x41ec22[_0x7059('0x1b')](0xcc)[_0x7059('0x1c')]();});}};}function handleEntityNotFound(_0x2cc591,_0x3dcb3d){return function(_0x4360e0){if(!_0x4360e0){_0x2cc591[_0x7059('0x1a')](0x194);}return _0x4360e0;};}function handleError(_0x26272b,_0x558166){_0x558166=_0x558166||0x1f4;return function(_0x4f1d1d){logger[_0x7059('0x29')](_0x4f1d1d['stack']);if(_0x4f1d1d[_0x7059('0x2a')]){delete _0x4f1d1d['name'];}_0x26272b[_0x7059('0x1b')](_0x558166)[_0x7059('0x2b')](_0x4f1d1d);};}exports[_0x7059('0x2c')]=function(_0x14abc7,_0x27dd21){var _0x19ea8a={},_0x54e4e0={},_0x209f21={'count':0x0,'rows':[]};var _0x2aceb1=_[_0x7059('0x2d')](db['OpenchannelQueueReport'][_0x7059('0x2e')],function(_0x1ac018){return{'name':_0x1ac018[_0x7059('0x2f')],'type':_0x1ac018['type'][_0x7059('0x30')]};});_0x54e4e0[_0x7059('0x31')]=_[_0x7059('0x2d')](_0x2aceb1,_0x7059('0x2a'));_0x54e4e0['query']=_[_0x7059('0x32')](_0x14abc7[_0x7059('0x33')]);_0x54e4e0[_0x7059('0x34')]=_[_0x7059('0x35')](_0x54e4e0[_0x7059('0x31')],_0x54e4e0[_0x7059('0x33')]);_0x19ea8a[_0x7059('0x36')]=_['intersection'](_0x54e4e0['model'],qs['fields'](_0x14abc7[_0x7059('0x33')][_0x7059('0x37')]));_0x19ea8a[_0x7059('0x36')]=_0x19ea8a[_0x7059('0x36')][_0x7059('0x38')]?_0x19ea8a['attributes']:_0x54e4e0[_0x7059('0x31')];if(!_0x14abc7['query'][_0x7059('0x39')](_0x7059('0x3a'))){_0x19ea8a[_0x7059('0x21')]=qs[_0x7059('0x21')](_0x14abc7[_0x7059('0x33')][_0x7059('0x21')]);_0x19ea8a[_0x7059('0x20')]=qs[_0x7059('0x20')](_0x14abc7[_0x7059('0x33')]['offset']);}_0x19ea8a[_0x7059('0x3b')]=qs[_0x7059('0x3c')](_0x14abc7[_0x7059('0x33')][_0x7059('0x3c')]);_0x19ea8a[_0x7059('0x3d')]=qs['filters'](_[_0x7059('0x3e')](_0x14abc7[_0x7059('0x33')],_0x54e4e0['filters']),_0x2aceb1);if(_0x14abc7[_0x7059('0x33')][_0x7059('0x3f')]){_0x19ea8a[_0x7059('0x3d')]=_[_0x7059('0x40')](_0x19ea8a[_0x7059('0x3d')],{'$or':_[_0x7059('0x2d')](_0x2aceb1,function(_0x4895b9){if(_0x4895b9['type']!=='VIRTUAL'){var _0x3366b={};_0x3366b[_0x4895b9[_0x7059('0x2a')]]={'$like':'%'+_0x14abc7[_0x7059('0x33')]['filter']+'%'};return _0x3366b;}})});}_0x19ea8a=_[_0x7059('0x40')]({},_0x19ea8a,_0x14abc7[_0x7059('0x41')]);var _0x16cfbf={'where':_0x19ea8a['where']};return db[_0x7059('0x42')][_0x7059('0x1f')](_0x16cfbf)[_0x7059('0x27')](function(_0x580dc7){_0x209f21[_0x7059('0x1f')]=_0x580dc7;if(_0x14abc7[_0x7059('0x33')][_0x7059('0x43')]){_0x19ea8a[_0x7059('0x44')]=[{'all':!![]}];}return db[_0x7059('0x42')]['findAll'](_0x19ea8a);})[_0x7059('0x27')](function(_0x174e8e){_0x209f21[_0x7059('0x45')]=_0x174e8e;return _0x209f21;})[_0x7059('0x27')](respondWithFilteredResult(_0x27dd21,_0x19ea8a))[_0x7059('0x46')](handleError(_0x27dd21,null));};exports['show']=function(_0x2fb6e4,_0x2c9016){var _0xf16b3b={'raw':!![],'where':{'id':_0x2fb6e4[_0x7059('0x47')]['id']}},_0x34b41a={};_0x34b41a[_0x7059('0x31')]=_[_0x7059('0x32')](db[_0x7059('0x42')][_0x7059('0x2e')]);_0x34b41a[_0x7059('0x33')]=_[_0x7059('0x32')](_0x2fb6e4[_0x7059('0x33')]);_0x34b41a[_0x7059('0x34')]=_[_0x7059('0x35')](_0x34b41a['model'],_0x34b41a[_0x7059('0x33')]);_0xf16b3b['attributes']=_['intersection'](_0x34b41a['model'],qs[_0x7059('0x37')](_0x2fb6e4[_0x7059('0x33')][_0x7059('0x37')]));_0xf16b3b[_0x7059('0x36')]=_0xf16b3b[_0x7059('0x36')]['length']?_0xf16b3b[_0x7059('0x36')]:_0x34b41a[_0x7059('0x31')];if(_0x2fb6e4[_0x7059('0x33')][_0x7059('0x43')]){_0xf16b3b[_0x7059('0x44')]=[{'all':!![]}];}_0xf16b3b=_['merge']({},_0xf16b3b,_0x2fb6e4['options']);return db['OpenchannelQueueReport']['find'](_0xf16b3b)[_0x7059('0x27')](handleEntityNotFound(_0x2c9016,null))['then'](respondWithResult(_0x2c9016,null))['catch'](handleError(_0x2c9016,null));};exports[_0x7059('0x48')]=function(_0x4302a5,_0x34e535){return db['OpenchannelQueueReport'][_0x7059('0x48')](_0x4302a5['body'],{})['then'](respondWithResult(_0x34e535,0xc9))['catch'](handleError(_0x34e535,null));};exports[_0x7059('0x26')]=function(_0x4516b1,_0x31f78c){if(_0x4516b1[_0x7059('0x49')]['id']){delete _0x4516b1['body']['id'];}return db['OpenchannelQueueReport']['find']({'where':{'id':_0x4516b1[_0x7059('0x47')]['id']}})[_0x7059('0x27')](handleEntityNotFound(_0x31f78c,null))[_0x7059('0x27')](saveUpdates(_0x4516b1['body'],null))['then'](respondWithResult(_0x31f78c,null))['catch'](handleError(_0x31f78c,null));};exports[_0x7059('0x28')]=function(_0x5c257f,_0x2a59f2){return db[_0x7059('0x42')]['find']({'where':{'id':_0x5c257f['params']['id']}})['then'](handleEntityNotFound(_0x2a59f2,null))[_0x7059('0x27')](removeEntity(_0x2a59f2,null))['catch'](handleError(_0x2a59f2,null));};exports[_0x7059('0x4a')]=function(_0x3192ea,_0x35ba8d){return db[_0x7059('0x42')][_0x7059('0x4a')]()['then'](respondWithResult(_0x35ba8d,null))[_0x7059('0x46')](handleError(_0x35ba8d,null));}; \ No newline at end of file +var _0x1f95=['../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','update','then','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','query','keys','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','options','includeAll','catch','show','merge','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment'];(function(_0x214341,_0x55c32e){var _0x1fb214=function(_0x186c94){while(--_0x186c94){_0x214341['push'](_0x214341['shift']());}};_0x1fb214(++_0x55c32e);}(_0x1f95,0x1cf));var _0x51f9=function(_0x5a7e6a,_0x376810){_0x5a7e6a=_0x5a7e6a-0x0;var _0x15e913=_0x1f95[_0x5a7e6a];return _0x15e913;};'use strict';var emlformat=require(_0x51f9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x51f9('0x1'));var jsonpatch=require(_0x51f9('0x2'));var rp=require(_0x51f9('0x3'));var moment=require(_0x51f9('0x4'));var BPromise=require(_0x51f9('0x5'));var Mustache=require(_0x51f9('0x6'));var util=require(_0x51f9('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x51f9('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x51f9('0x9'));var deskjs=require(_0x51f9('0xa'));var toCsv=require(_0x51f9('0xb'));var querystring=require(_0x51f9('0xc'));var Papa=require(_0x51f9('0xd'));var Redis=require(_0x51f9('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x51f9('0xf'));var as=require(_0x51f9('0x10'));var hardwareService=require(_0x51f9('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x51f9('0x12'));var config=require(_0x51f9('0x13'));var licenseUtil=require(_0x51f9('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa3ef9d,_0x5b2bd0){_0x5b2bd0=_0x5b2bd0||0xcc;return function(_0x490890){if(_0x490890){return _0xa3ef9d[_0x51f9('0x15')](_0x5b2bd0);}return _0xa3ef9d['status'](_0x5b2bd0)[_0x51f9('0x16')]();};}function respondWithResult(_0x137d23,_0x56423b){_0x56423b=_0x56423b||0xc8;return function(_0x58e7f8){if(_0x58e7f8){return _0x137d23[_0x51f9('0x17')](_0x56423b)[_0x51f9('0x18')](_0x58e7f8);}};}function respondWithFilteredResult(_0xfb8c37,_0x37a7b7){return function(_0x237568){if(_0x237568){var _0x3cb61b=typeof _0x37a7b7[_0x51f9('0x19')]===_0x51f9('0x1a')&&typeof _0x37a7b7[_0x51f9('0x1b')]===_0x51f9('0x1a');var _0x907d65=_0x237568[_0x51f9('0x1c')];var _0x3e816e=_0x3cb61b?0x0:_0x37a7b7[_0x51f9('0x19')];var _0x30b211=_0x3cb61b?_0x237568[_0x51f9('0x1c')]:_0x37a7b7[_0x51f9('0x19')]+_0x37a7b7[_0x51f9('0x1b')];var _0x4a3ddc;if(_0x30b211>=_0x907d65){_0x30b211=_0x907d65;_0x4a3ddc=0xc8;}else{_0x4a3ddc=0xce;}_0xfb8c37[_0x51f9('0x17')](_0x4a3ddc);return _0xfb8c37['set']('Content-Range',_0x3e816e+'-'+_0x30b211+'/'+_0x907d65)['json'](_0x237568);}return null;};}function patchUpdates(_0x2188b4){return function(_0x45d977){try{jsonpatch[_0x51f9('0x1d')](_0x45d977,_0x2188b4,!![]);}catch(_0x13c2a6){return BPromise[_0x51f9('0x1e')](_0x13c2a6);}return _0x45d977[_0x51f9('0x1f')]();};}function saveUpdates(_0x415a9f,_0x4ea1c9){return function(_0x32de2f){if(_0x32de2f){return _0x32de2f[_0x51f9('0x20')](_0x415a9f)[_0x51f9('0x21')](function(_0x8d4009){return _0x8d4009;});}return null;};}function removeEntity(_0x2f033b,_0x1449b1){return function(_0x5cbb5e){if(_0x5cbb5e){return _0x5cbb5e['destroy']()[_0x51f9('0x21')](function(){_0x2f033b[_0x51f9('0x17')](0xcc)[_0x51f9('0x16')]();});}};}function handleEntityNotFound(_0x46e442,_0x64082d){return function(_0x3dee0a){if(!_0x3dee0a){_0x46e442[_0x51f9('0x15')](0x194);}return _0x3dee0a;};}function handleError(_0x3eea33,_0x42ef10){_0x42ef10=_0x42ef10||0x1f4;return function(_0xb7555c){logger['error'](_0xb7555c[_0x51f9('0x22')]);if(_0xb7555c[_0x51f9('0x23')]){delete _0xb7555c[_0x51f9('0x23')];}_0x3eea33[_0x51f9('0x17')](_0x42ef10)[_0x51f9('0x24')](_0xb7555c);};}exports[_0x51f9('0x25')]=function(_0xd92206,_0x12d8b7){var _0x41b241={},_0x89574e={},_0x3fdd20={'count':0x0,'rows':[]};var _0xb29a6a=_[_0x51f9('0x26')](db[_0x51f9('0x27')][_0x51f9('0x28')],function(_0xfb5db8){return{'name':_0xfb5db8[_0x51f9('0x29')],'type':_0xfb5db8[_0x51f9('0x2a')][_0x51f9('0x2b')]};});_0x89574e['model']=_[_0x51f9('0x26')](_0xb29a6a,'name');_0x89574e[_0x51f9('0x2c')]=_[_0x51f9('0x2d')](_0xd92206[_0x51f9('0x2c')]);_0x89574e['filters']=_['intersection'](_0x89574e['model'],_0x89574e[_0x51f9('0x2c')]);_0x41b241[_0x51f9('0x2e')]=_[_0x51f9('0x2f')](_0x89574e['model'],qs[_0x51f9('0x30')](_0xd92206[_0x51f9('0x2c')]['fields']));_0x41b241[_0x51f9('0x2e')]=_0x41b241[_0x51f9('0x2e')][_0x51f9('0x31')]?_0x41b241['attributes']:_0x89574e[_0x51f9('0x32')];if(!_0xd92206[_0x51f9('0x2c')][_0x51f9('0x33')](_0x51f9('0x34'))){_0x41b241['limit']=qs['limit'](_0xd92206[_0x51f9('0x2c')][_0x51f9('0x1b')]);_0x41b241[_0x51f9('0x19')]=qs[_0x51f9('0x19')](_0xd92206[_0x51f9('0x2c')][_0x51f9('0x19')]);}_0x41b241[_0x51f9('0x35')]=qs['sort'](_0xd92206[_0x51f9('0x2c')][_0x51f9('0x36')]);_0x41b241[_0x51f9('0x37')]=qs[_0x51f9('0x38')](_[_0x51f9('0x39')](_0xd92206[_0x51f9('0x2c')],_0x89574e[_0x51f9('0x38')]),_0xb29a6a);if(_0xd92206[_0x51f9('0x2c')][_0x51f9('0x3a')]){_0x41b241[_0x51f9('0x37')]=_['merge'](_0x41b241[_0x51f9('0x37')],{'$or':_[_0x51f9('0x26')](_0xb29a6a,function(_0x44e7aa){if(_0x44e7aa[_0x51f9('0x2a')]!=='VIRTUAL'){var _0x1bdcf5={};_0x1bdcf5[_0x44e7aa[_0x51f9('0x23')]]={'$like':'%'+_0xd92206[_0x51f9('0x2c')]['filter']+'%'};return _0x1bdcf5;}})});}_0x41b241=_['merge']({},_0x41b241,_0xd92206[_0x51f9('0x3b')]);var _0x590d39={'where':_0x41b241['where']};return db['OpenchannelQueueReport'][_0x51f9('0x1c')](_0x590d39)[_0x51f9('0x21')](function(_0x33a9ee){_0x3fdd20[_0x51f9('0x1c')]=_0x33a9ee;if(_0xd92206[_0x51f9('0x2c')][_0x51f9('0x3c')]){_0x41b241['include']=[{'all':!![]}];}return db[_0x51f9('0x27')]['findAll'](_0x41b241);})[_0x51f9('0x21')](function(_0x4cf1e3){_0x3fdd20['rows']=_0x4cf1e3;return _0x3fdd20;})[_0x51f9('0x21')](respondWithFilteredResult(_0x12d8b7,_0x41b241))[_0x51f9('0x3d')](handleError(_0x12d8b7,null));};exports[_0x51f9('0x3e')]=function(_0xcca5eb,_0x141ce0){var _0x49b68e={'raw':!![],'where':{'id':_0xcca5eb['params']['id']}},_0x5f3387={};_0x5f3387[_0x51f9('0x32')]=_[_0x51f9('0x2d')](db[_0x51f9('0x27')][_0x51f9('0x28')]);_0x5f3387[_0x51f9('0x2c')]=_[_0x51f9('0x2d')](_0xcca5eb[_0x51f9('0x2c')]);_0x5f3387[_0x51f9('0x38')]=_[_0x51f9('0x2f')](_0x5f3387[_0x51f9('0x32')],_0x5f3387[_0x51f9('0x2c')]);_0x49b68e[_0x51f9('0x2e')]=_['intersection'](_0x5f3387[_0x51f9('0x32')],qs[_0x51f9('0x30')](_0xcca5eb[_0x51f9('0x2c')][_0x51f9('0x30')]));_0x49b68e['attributes']=_0x49b68e[_0x51f9('0x2e')][_0x51f9('0x31')]?_0x49b68e[_0x51f9('0x2e')]:_0x5f3387[_0x51f9('0x32')];if(_0xcca5eb['query']['includeAll']){_0x49b68e['include']=[{'all':!![]}];}_0x49b68e=_[_0x51f9('0x3f')]({},_0x49b68e,_0xcca5eb[_0x51f9('0x3b')]);return db[_0x51f9('0x27')][_0x51f9('0x40')](_0x49b68e)[_0x51f9('0x21')](handleEntityNotFound(_0x141ce0,null))[_0x51f9('0x21')](respondWithResult(_0x141ce0,null))[_0x51f9('0x3d')](handleError(_0x141ce0,null));};exports['create']=function(_0x2c09ba,_0x2c78e1){return db[_0x51f9('0x27')][_0x51f9('0x41')](_0x2c09ba[_0x51f9('0x42')],{})[_0x51f9('0x21')](respondWithResult(_0x2c78e1,0xc9))['catch'](handleError(_0x2c78e1,null));};exports[_0x51f9('0x20')]=function(_0x1d8a7d,_0x3f9dde){if(_0x1d8a7d[_0x51f9('0x42')]['id']){delete _0x1d8a7d[_0x51f9('0x42')]['id'];}return db[_0x51f9('0x27')]['find']({'where':{'id':_0x1d8a7d[_0x51f9('0x43')]['id']}})[_0x51f9('0x21')](handleEntityNotFound(_0x3f9dde,null))[_0x51f9('0x21')](saveUpdates(_0x1d8a7d[_0x51f9('0x42')],null))[_0x51f9('0x21')](respondWithResult(_0x3f9dde,null))[_0x51f9('0x3d')](handleError(_0x3f9dde,null));};exports['destroy']=function(_0x1150e0,_0x5f49de){return db[_0x51f9('0x27')]['find']({'where':{'id':_0x1150e0[_0x51f9('0x43')]['id']}})[_0x51f9('0x21')](handleEntityNotFound(_0x5f49de,null))[_0x51f9('0x21')](removeEntity(_0x5f49de,null))[_0x51f9('0x3d')](handleError(_0x5f49de,null));};exports[_0x51f9('0x44')]=function(_0x57a5ce,_0x30faf7){return db['OpenchannelQueueReport']['describe']()[_0x51f9('0x21')](respondWithResult(_0x30faf7,null))[_0x51f9('0x3d')](handleError(_0x30faf7,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index f31ee94..dbb5789 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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0x814b,0x1a2));var _0xb814=function(_0x1417c6,_0x194309){_0x1417c6=_0x1417c6-0x0;var _0x44db97=_0x814b[_0x1417c6];return _0x44db97;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x5544db,_0x589168){var _0x206c36=function(_0x4e1d5d){while(--_0x4e1d5d){_0x5544db['push'](_0x5544db['shift']());}};_0x206c36(++_0x589168);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xc4aa[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index a8462db..0202421 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 _0x958a=['http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x4b1d12,_0x20a9f0){var _0x47b7e2=function(_0x5c8dd0){while(--_0x5c8dd0){_0x4b1d12['push'](_0x4b1d12['shift']());}};_0x47b7e2(++_0x20a9f0);}(_0x958a,0x128));var _0xa958=function(_0xc1331d,_0xa05e3e){_0xc1331d=_0xc1331d-0x0;var _0x2ded82=_0x958a[_0xc1331d];return _0x2ded82;};'use strict';var _=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var moment=require('moment');var BPromise=require(_0xa958('0x2'));var rs=require(_0xa958('0x3'));var fs=require('fs');var Redis=require(_0xa958('0x4'));var db=require(_0xa958('0x5'))['db'];var utils=require(_0xa958('0x6'));var logger=require('../../config/logger')(_0xa958('0x7'));var config=require('../../config/environment');var jayson=require(_0xa958('0x8'));var client=jayson[_0xa958('0x9')][_0xa958('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ddaa9,_0x3ca01f,_0x3b2693){return new BPromise(function(_0x1895da,_0x54c0e0){return client['request'](_0x3ddaa9,_0x3b2693)[_0xa958('0xb')](function(_0x249764){logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));logger[_0xa958('0xf')](_0xa958('0x10'),_0x3ca01f,_0xa958('0xe'),JSON[_0xa958('0x11')](_0x249764));if(_0x249764[_0xa958('0x12')]){if(_0x249764[_0xa958('0x12')][_0xa958('0x13')]===0x1f4){logger[_0xa958('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3ca01f,_0x249764['error']['message']);return _0x54c0e0(_0x249764[_0xa958('0x12')][_0xa958('0x14')]);}logger[_0xa958('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3ca01f,_0x249764[_0xa958('0x12')]['message']);return _0x1895da(_0x249764['error']['message']);}else{logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));_0x1895da(_0x249764[_0xa958('0x15')][_0xa958('0x14')]);}})[_0xa958('0x16')](function(_0x23736f){logger[_0xa958('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3ca01f,_0x23736f);_0x54c0e0(_0x23736f);});});}exports[_0xa958('0x17')]=function(_0x4eadc9){var _0x3a053f=this;return new Promise(function(_0x70d13e,_0x52a184){return db[_0xa958('0x18')][_0xa958('0x19')](_0x4eadc9[_0xa958('0x1a')],{'raw':_0x4eadc9[_0xa958('0x1b')]?_0x4eadc9[_0xa958('0x1b')][_0xa958('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x4a90c2){logger[_0xa958('0xc')](_0xa958('0x17'),_0x4eadc9);logger[_0xa958('0xf')]('CreateOpenchannelQueueReport',_0x4eadc9,JSON[_0xa958('0x11')](_0x4a90c2));_0x70d13e(_0x4a90c2);})[_0xa958('0x16')](function(_0x5c091a){logger[_0xa958('0x12')](_0xa958('0x17'),_0x5c091a['message'],_0x4eadc9);_0x52a184(_0x3a053f['error'](0x1f4,_0x5c091a[_0xa958('0x14')]));});});};exports[_0xa958('0x1d')]=function(_0x50b3c3){var _0x25f461=this;return new Promise(function(_0x27097a,_0x2f03df){return db[_0xa958('0x18')][_0xa958('0x1e')](_0x50b3c3[_0xa958('0x1a')],{'raw':_0x50b3c3['options']?_0x50b3c3[_0xa958('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50b3c3[_0xa958('0x1b')]?_0x50b3c3[_0xa958('0x1b')][_0xa958('0x1f')]||null:null,'attributes':_0x50b3c3[_0xa958('0x1b')]?_0x50b3c3[_0xa958('0x1b')][_0xa958('0x20')]||null:null,'limit':_0x50b3c3[_0xa958('0x1b')]?_0x50b3c3[_0xa958('0x1b')][_0xa958('0x21')]||null:null})[_0xa958('0xb')](function(_0x4c4c37){logger['info'](_0xa958('0x1d'),_0x50b3c3);logger['debug'](_0xa958('0x1d'),_0x50b3c3,JSON[_0xa958('0x11')](_0x4c4c37));_0x27097a(_0x4c4c37);})['catch'](function(_0x23bdbf){logger[_0xa958('0x12')](_0xa958('0x1d'),_0x23bdbf[_0xa958('0x14')],_0x50b3c3);_0x2f03df(_0x25f461[_0xa958('0x12')](0x1f4,_0x23bdbf['message']));});});}; \ No newline at end of file +var _0x5204=['debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','UpdateOpenchannelQueueReport','update','raw','where','attributes','then','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1e1795,_0x393c37){var _0x78c7ff=function(_0x287ec9){while(--_0x287ec9){_0x1e1795['push'](_0x1e1795['shift']());}};_0x78c7ff(++_0x393c37);}(_0x5204,0xdf));var _0x4520=function(_0x25cd2c,_0x57498e){_0x25cd2c=_0x25cd2c-0x0;var _0x1e364c=_0x5204[_0x25cd2c];return _0x1e364c;};'use strict';var _=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var moment=require('moment');var BPromise=require(_0x4520('0x2'));var rs=require(_0x4520('0x3'));var fs=require('fs');var Redis=require(_0x4520('0x4'));var db=require(_0x4520('0x5'))['db'];var utils=require(_0x4520('0x6'));var logger=require('../../config/logger')(_0x4520('0x7'));var config=require('../../config/environment');var jayson=require(_0x4520('0x8'));var client=jayson[_0x4520('0x9')][_0x4520('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe741c2,_0x396d29,_0x446dc9){return new BPromise(function(_0x27890f,_0x55b44f){return client[_0x4520('0xb')](_0xe741c2,_0x446dc9)['then'](function(_0x168e62){logger[_0x4520('0xc')](_0x4520('0xd'),_0x396d29,_0x4520('0xe'));logger[_0x4520('0xf')](_0x4520('0x10'),_0x396d29,_0x4520('0xe'),JSON[_0x4520('0x11')](_0x168e62));if(_0x168e62[_0x4520('0x12')]){if(_0x168e62[_0x4520('0x12')][_0x4520('0x13')]===0x1f4){logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);return _0x55b44f(_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);}logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);return _0x27890f(_0x168e62['error'][_0x4520('0x14')]);}else{logger[_0x4520('0xc')](_0x4520('0xd'),_0x396d29,_0x4520('0xe'));_0x27890f(_0x168e62[_0x4520('0x15')]['message']);}})[_0x4520('0x16')](function(_0x33ac29){logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x33ac29);_0x55b44f(_0x33ac29);});});}exports[_0x4520('0x17')]=function(_0x2e00f4){var _0x1dcf51=this;return new Promise(function(_0x4ba69f,_0x3791b6){return db[_0x4520('0x18')][_0x4520('0x19')](_0x2e00f4[_0x4520('0x1a')],{'raw':_0x2e00f4['options']?_0x2e00f4[_0x4520('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4c46c5){logger[_0x4520('0xc')]('CreateOpenchannelQueueReport',_0x2e00f4);logger[_0x4520('0xf')](_0x4520('0x17'),_0x2e00f4,JSON[_0x4520('0x11')](_0x4c46c5));_0x4ba69f(_0x4c46c5);})['catch'](function(_0x3199a9){logger[_0x4520('0x12')](_0x4520('0x17'),_0x3199a9['message'],_0x2e00f4);_0x3791b6(_0x1dcf51[_0x4520('0x12')](0x1f4,_0x3199a9[_0x4520('0x14')]));});});};exports[_0x4520('0x1c')]=function(_0x3a4680){var _0x2a8528=this;return new Promise(function(_0x552da1,_0x3774bd){return db[_0x4520('0x18')][_0x4520('0x1d')](_0x3a4680[_0x4520('0x1a')],{'raw':_0x3a4680['options']?_0x3a4680[_0x4520('0x1b')][_0x4520('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a4680[_0x4520('0x1b')]?_0x3a4680[_0x4520('0x1b')][_0x4520('0x1f')]||null:null,'attributes':_0x3a4680[_0x4520('0x1b')]?_0x3a4680[_0x4520('0x1b')][_0x4520('0x20')]||null:null,'limit':_0x3a4680[_0x4520('0x1b')]?_0x3a4680[_0x4520('0x1b')]['limit']||null:null})[_0x4520('0x21')](function(_0x5c1a0b){logger[_0x4520('0xc')](_0x4520('0x1c'),_0x3a4680);logger[_0x4520('0xf')](_0x4520('0x1c'),_0x3a4680,JSON[_0x4520('0x11')](_0x5c1a0b));_0x552da1(_0x5c1a0b);})[_0x4520('0x16')](function(_0x5bb163){logger[_0x4520('0x12')]('UpdateOpenchannelQueueReport',_0x5bb163[_0x4520('0x14')],_0x3a4680);_0x3774bd(_0x2a8528['error'](0x1f4,_0x5bb163[_0x4520('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index fc4dc17..a128d8c 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 _0xe8e3=['util','path','connect-timeout','Router','../../components/interaction/service','get','isAuthenticated','describe','show','post','put','delete','/:id','destroy','exports','multer'];(function(_0x35b735,_0x85b668){var _0x44dd5e=function(_0x1f8eb0){while(--_0x1f8eb0){_0x35b735['push'](_0x35b735['shift']());}};_0x44dd5e(++_0x85b668);}(_0xe8e3,0x14f));var _0x3e8e=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xe8e3[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x3e8e('0x0'));var util=require(_0x3e8e('0x1'));var path=require(_0x3e8e('0x2'));var timeout=require(_0x3e8e('0x3'));var express=require('express');var router=express[_0x3e8e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3e8e('0x5'));var config=require('../../config/environment');var controller=require('./openchannelTransferReport.controller');router[_0x3e8e('0x6')]('/',auth[_0x3e8e('0x7')](),controller['index']);router[_0x3e8e('0x6')]('/describe',auth[_0x3e8e('0x7')](),controller[_0x3e8e('0x8')]);router[_0x3e8e('0x6')]('/:id',auth[_0x3e8e('0x7')](),controller[_0x3e8e('0x9')]);router[_0x3e8e('0xa')]('/',auth[_0x3e8e('0x7')](),controller['create']);router[_0x3e8e('0xb')]('/:id',auth[_0x3e8e('0x7')](),controller['update']);router[_0x3e8e('0xc')](_0x3e8e('0xd'),auth[_0x3e8e('0x7')](),controller[_0x3e8e('0xe')]);module[_0x3e8e('0xf')]=router; \ No newline at end of file +var _0xefe9=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id'];(function(_0xa99513,_0x13b308){var _0x577bfc=function(_0x4dc3a5){while(--_0x4dc3a5){_0xa99513['push'](_0xa99513['shift']());}};_0x577bfc(++_0x13b308);}(_0xefe9,0xcb));var _0x9efe=function(_0x21ea07,_0xdf4ce4){_0x21ea07=_0x21ea07-0x0;var _0x3441d2=_0xefe9[_0x21ea07];return _0x3441d2;};'use strict';var multer=require(_0x9efe('0x0'));var util=require(_0x9efe('0x1'));var path=require(_0x9efe('0x2'));var timeout=require(_0x9efe('0x3'));var express=require(_0x9efe('0x4'));var router=express[_0x9efe('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9efe('0x6'));var interaction=require(_0x9efe('0x7'));var config=require(_0x9efe('0x8'));var controller=require('./openchannelTransferReport.controller');router[_0x9efe('0x9')]('/',auth[_0x9efe('0xa')](),controller[_0x9efe('0xb')]);router[_0x9efe('0x9')]('/describe',auth[_0x9efe('0xa')](),controller['describe']);router[_0x9efe('0x9')]('/:id',auth[_0x9efe('0xa')](),controller[_0x9efe('0xc')]);router[_0x9efe('0xd')]('/',auth[_0x9efe('0xa')](),controller[_0x9efe('0xe')]);router[_0x9efe('0xf')](_0x9efe('0x10'),auth[_0x9efe('0xa')](),controller[_0x9efe('0x11')]);router['delete'](_0x9efe('0x10'),auth[_0x9efe('0xa')](),controller[_0x9efe('0x12')]);module[_0x9efe('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 4d8039f..ff8d8ea 100644 --- a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js +++ b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x35262b,_0x3182e1){var _0x3f1c95=function(_0x3327e9){while(--_0x3327e9){_0x35262b['push'](_0x35262b['shift']());}};_0x3f1c95(++_0x3182e1);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5c1edc,_0x1e8174){_0x5c1edc=_0x5c1edc-0x0;var _0x12627f=_0xf4eb[_0x5c1edc];return _0x12627f;};'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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x49bad7,_0x10a3ad){var _0x4fdc74=function(_0x3dc2a0){while(--_0x3dc2a0){_0x49bad7['push'](_0x49bad7['shift']());}};_0x4fdc74(++_0x10a3ad);}(_0x00bb,0x1d8));var _0xb00b=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x00bb[_0x29b609];return _0x54c952;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index a9829fa..78c5803 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 _0x6fbc=['merge','where','VIRTUAL','filter','options','include','findAll','rows','catch','show','find','create','body','update','params','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','then','stack','name','send','index','OpenchannelTransferReport','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick'];(function(_0x43305f,_0x320675){var _0x32a65f=function(_0x3497f9){while(--_0x3497f9){_0x43305f['push'](_0x43305f['shift']());}};_0x32a65f(++_0x320675);}(_0x6fbc,0x1d3));var _0xc6fb=function(_0x31496a,_0x2d5790){_0x31496a=_0x31496a-0x0;var _0x4ff13c=_0x6fbc[_0x31496a];return _0x4ff13c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc6fb('0x0'));var zipdir=require(_0xc6fb('0x1'));var jsonpatch=require(_0xc6fb('0x2'));var rp=require(_0xc6fb('0x3'));var moment=require('moment');var BPromise=require(_0xc6fb('0x4'));var Mustache=require(_0xc6fb('0x5'));var util=require('util');var path=require(_0xc6fb('0x6'));var sox=require(_0xc6fb('0x7'));var csv=require(_0xc6fb('0x8'));var ejs=require(_0xc6fb('0x9'));var fs=require('fs');var fs_extra=require(_0xc6fb('0xa'));var _=require(_0xc6fb('0xb'));var squel=require('squel');var crypto=require(_0xc6fb('0xc'));var jsforce=require(_0xc6fb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc6fb('0xe'));var Redis=require('ioredis');var authService=require(_0xc6fb('0xf'));var qs=require(_0xc6fb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc6fb('0x11'));var logger=require(_0xc6fb('0x12'))(_0xc6fb('0x13'));var utils=require(_0xc6fb('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc6fb('0x15'));var db=require(_0xc6fb('0x16'))['db'];function respondWithStatusCode(_0x409e50,_0x5ee4dc){_0x5ee4dc=_0x5ee4dc||0xcc;return function(_0x369e76){if(_0x369e76){return _0x409e50[_0xc6fb('0x17')](_0x5ee4dc);}return _0x409e50[_0xc6fb('0x18')](_0x5ee4dc)[_0xc6fb('0x19')]();};}function respondWithResult(_0x612cd8,_0x9fcede){_0x9fcede=_0x9fcede||0xc8;return function(_0xd702ec){if(_0xd702ec){return _0x612cd8[_0xc6fb('0x18')](_0x9fcede)['json'](_0xd702ec);}};}function respondWithFilteredResult(_0x5d13cc,_0x1e7488){return function(_0x580213){if(_0x580213){var _0xaee165=typeof _0x1e7488['offset']===_0xc6fb('0x1a')&&typeof _0x1e7488['limit']===_0xc6fb('0x1a');var _0x465133=_0x580213[_0xc6fb('0x1b')];var _0x15d9ec=_0xaee165?0x0:_0x1e7488[_0xc6fb('0x1c')];var _0x45cee6=_0xaee165?_0x580213[_0xc6fb('0x1b')]:_0x1e7488[_0xc6fb('0x1c')]+_0x1e7488[_0xc6fb('0x1d')];var _0x1d5bde;if(_0x45cee6>=_0x465133){_0x45cee6=_0x465133;_0x1d5bde=0xc8;}else{_0x1d5bde=0xce;}_0x5d13cc[_0xc6fb('0x18')](_0x1d5bde);return _0x5d13cc[_0xc6fb('0x1e')](_0xc6fb('0x1f'),_0x15d9ec+'-'+_0x45cee6+'/'+_0x465133)[_0xc6fb('0x20')](_0x580213);}return null;};}function patchUpdates(_0x27a5bd){return function(_0x4e5c0d){try{jsonpatch[_0xc6fb('0x21')](_0x4e5c0d,_0x27a5bd,!![]);}catch(_0x796a87){return BPromise[_0xc6fb('0x22')](_0x796a87);}return _0x4e5c0d[_0xc6fb('0x23')]();};}function saveUpdates(_0x17f45f,_0x443146){return function(_0x34dc06){if(_0x34dc06){return _0x34dc06['update'](_0x17f45f)[_0xc6fb('0x24')](function(_0x253edb){return _0x253edb;});}return null;};}function removeEntity(_0x4f8b67,_0xf65985){return function(_0x99fd25){if(_0x99fd25){return _0x99fd25['destroy']()[_0xc6fb('0x24')](function(){_0x4f8b67[_0xc6fb('0x18')](0xcc)[_0xc6fb('0x19')]();});}};}function handleEntityNotFound(_0x167e51,_0x51dbc5){return function(_0x3d0d5b){if(!_0x3d0d5b){_0x167e51[_0xc6fb('0x17')](0x194);}return _0x3d0d5b;};}function handleError(_0x25818e,_0x1c9ca6){_0x1c9ca6=_0x1c9ca6||0x1f4;return function(_0x3af3c2){logger['error'](_0x3af3c2[_0xc6fb('0x25')]);if(_0x3af3c2[_0xc6fb('0x26')]){delete _0x3af3c2['name'];}_0x25818e[_0xc6fb('0x18')](_0x1c9ca6)[_0xc6fb('0x27')](_0x3af3c2);};}exports[_0xc6fb('0x28')]=function(_0x4ea078,_0x2e0ed7){var _0x1512fa={},_0x1b1b76={},_0x1c4f40={'count':0x0,'rows':[]};var _0x44d680=_['map'](db[_0xc6fb('0x29')]['rawAttributes'],function(_0x4ea9f9){return{'name':_0x4ea9f9[_0xc6fb('0x2a')],'type':_0x4ea9f9[_0xc6fb('0x2b')][_0xc6fb('0x2c')]};});_0x1b1b76[_0xc6fb('0x2d')]=_[_0xc6fb('0x2e')](_0x44d680,_0xc6fb('0x26'));_0x1b1b76[_0xc6fb('0x2f')]=_[_0xc6fb('0x30')](_0x4ea078[_0xc6fb('0x2f')]);_0x1b1b76[_0xc6fb('0x31')]=_[_0xc6fb('0x32')](_0x1b1b76[_0xc6fb('0x2d')],_0x1b1b76[_0xc6fb('0x2f')]);_0x1512fa[_0xc6fb('0x33')]=_['intersection'](_0x1b1b76[_0xc6fb('0x2d')],qs[_0xc6fb('0x34')](_0x4ea078[_0xc6fb('0x2f')][_0xc6fb('0x34')]));_0x1512fa[_0xc6fb('0x33')]=_0x1512fa['attributes'][_0xc6fb('0x35')]?_0x1512fa['attributes']:_0x1b1b76[_0xc6fb('0x2d')];if(!_0x4ea078[_0xc6fb('0x2f')][_0xc6fb('0x36')](_0xc6fb('0x37'))){_0x1512fa[_0xc6fb('0x1d')]=qs['limit'](_0x4ea078[_0xc6fb('0x2f')][_0xc6fb('0x1d')]);_0x1512fa['offset']=qs['offset'](_0x4ea078[_0xc6fb('0x2f')][_0xc6fb('0x1c')]);}_0x1512fa['order']=qs[_0xc6fb('0x38')](_0x4ea078[_0xc6fb('0x2f')][_0xc6fb('0x38')]);_0x1512fa['where']=qs[_0xc6fb('0x31')](_[_0xc6fb('0x39')](_0x4ea078['query'],_0x1b1b76[_0xc6fb('0x31')]),_0x44d680);if(_0x4ea078[_0xc6fb('0x2f')]['filter']){_0x1512fa['where']=_[_0xc6fb('0x3a')](_0x1512fa[_0xc6fb('0x3b')],{'$or':_[_0xc6fb('0x2e')](_0x44d680,function(_0x457a8b){if(_0x457a8b[_0xc6fb('0x2b')]!==_0xc6fb('0x3c')){var _0x800762={};_0x800762[_0x457a8b['name']]={'$like':'%'+_0x4ea078[_0xc6fb('0x2f')][_0xc6fb('0x3d')]+'%'};return _0x800762;}})});}_0x1512fa=_[_0xc6fb('0x3a')]({},_0x1512fa,_0x4ea078[_0xc6fb('0x3e')]);var _0x2fbdc8={'where':_0x1512fa[_0xc6fb('0x3b')]};return db[_0xc6fb('0x29')]['count'](_0x2fbdc8)['then'](function(_0x477ca9){_0x1c4f40[_0xc6fb('0x1b')]=_0x477ca9;if(_0x4ea078[_0xc6fb('0x2f')]['includeAll']){_0x1512fa[_0xc6fb('0x3f')]=[{'all':!![]}];}return db[_0xc6fb('0x29')][_0xc6fb('0x40')](_0x1512fa);})[_0xc6fb('0x24')](function(_0x1ec024){_0x1c4f40[_0xc6fb('0x41')]=_0x1ec024;return _0x1c4f40;})['then'](respondWithFilteredResult(_0x2e0ed7,_0x1512fa))[_0xc6fb('0x42')](handleError(_0x2e0ed7,null));};exports[_0xc6fb('0x43')]=function(_0x5cf32f,_0x5cf561){var _0x179ecf={'raw':!![],'where':{'id':_0x5cf32f['params']['id']}},_0x1b3459={};_0x1b3459[_0xc6fb('0x2d')]=_[_0xc6fb('0x30')](db['OpenchannelTransferReport']['rawAttributes']);_0x1b3459[_0xc6fb('0x2f')]=_['keys'](_0x5cf32f[_0xc6fb('0x2f')]);_0x1b3459['filters']=_['intersection'](_0x1b3459[_0xc6fb('0x2d')],_0x1b3459[_0xc6fb('0x2f')]);_0x179ecf[_0xc6fb('0x33')]=_['intersection'](_0x1b3459['model'],qs[_0xc6fb('0x34')](_0x5cf32f['query'][_0xc6fb('0x34')]));_0x179ecf[_0xc6fb('0x33')]=_0x179ecf[_0xc6fb('0x33')]['length']?_0x179ecf[_0xc6fb('0x33')]:_0x1b3459[_0xc6fb('0x2d')];if(_0x5cf32f[_0xc6fb('0x2f')]['includeAll']){_0x179ecf[_0xc6fb('0x3f')]=[{'all':!![]}];}_0x179ecf=_[_0xc6fb('0x3a')]({},_0x179ecf,_0x5cf32f[_0xc6fb('0x3e')]);return db[_0xc6fb('0x29')][_0xc6fb('0x44')](_0x179ecf)[_0xc6fb('0x24')](handleEntityNotFound(_0x5cf561,null))[_0xc6fb('0x24')](respondWithResult(_0x5cf561,null))['catch'](handleError(_0x5cf561,null));};exports[_0xc6fb('0x45')]=function(_0x118c5b,_0x549cd6){return db['OpenchannelTransferReport'][_0xc6fb('0x45')](_0x118c5b[_0xc6fb('0x46')],{})['then'](respondWithResult(_0x549cd6,0xc9))[_0xc6fb('0x42')](handleError(_0x549cd6,null));};exports[_0xc6fb('0x47')]=function(_0x4c16d5,_0x1c6c73){if(_0x4c16d5['body']['id']){delete _0x4c16d5[_0xc6fb('0x46')]['id'];}return db[_0xc6fb('0x29')][_0xc6fb('0x44')]({'where':{'id':_0x4c16d5[_0xc6fb('0x48')]['id']}})[_0xc6fb('0x24')](handleEntityNotFound(_0x1c6c73,null))[_0xc6fb('0x24')](saveUpdates(_0x4c16d5['body'],null))[_0xc6fb('0x24')](respondWithResult(_0x1c6c73,null))[_0xc6fb('0x42')](handleError(_0x1c6c73,null));};exports[_0xc6fb('0x49')]=function(_0x3b656c,_0x1a765c){return db[_0xc6fb('0x29')][_0xc6fb('0x44')]({'where':{'id':_0x3b656c[_0xc6fb('0x48')]['id']}})[_0xc6fb('0x24')](handleEntityNotFound(_0x1a765c,null))['then'](removeEntity(_0x1a765c,null))[_0xc6fb('0x42')](handleError(_0x1a765c,null));};exports[_0xc6fb('0x4a')]=function(_0x3b632c,_0x8b3b4a){return db[_0xc6fb('0x29')]['describe']()[_0xc6fb('0x24')](respondWithResult(_0x8b3b4a,null))[_0xc6fb('0x42')](handleError(_0x8b3b4a,null));}; \ No newline at end of file +var _0x8121=['sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','error','stack','name','send','map','OpenchannelTransferReport','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','catch','show','params','keys','filters','fields','create','body','find','describe','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8121,0x7a));var _0x1812=function(_0x19bd40,_0x5a410a){_0x19bd40=_0x19bd40-0x0;var _0x433f99=_0x8121[_0x19bd40];return _0x433f99;};'use strict';var emlformat=require(_0x1812('0x0'));var rimraf=require(_0x1812('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1812('0x2'));var BPromise=require(_0x1812('0x3'));var Mustache=require(_0x1812('0x4'));var util=require(_0x1812('0x5'));var path=require(_0x1812('0x6'));var sox=require(_0x1812('0x7'));var csv=require(_0x1812('0x8'));var ejs=require(_0x1812('0x9'));var fs=require('fs');var fs_extra=require(_0x1812('0xa'));var _=require(_0x1812('0xb'));var squel=require(_0x1812('0xc'));var crypto=require('crypto');var jsforce=require(_0x1812('0xd'));var deskjs=require(_0x1812('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1812('0xf'));var Papa=require(_0x1812('0x10'));var Redis=require(_0x1812('0x11'));var authService=require(_0x1812('0x12'));var qs=require(_0x1812('0x13'));var as=require(_0x1812('0x14'));var hardwareService=require(_0x1812('0x15'));var logger=require('../../config/logger')(_0x1812('0x16'));var utils=require('../../config/utils');var config=require(_0x1812('0x17'));var licenseUtil=require(_0x1812('0x18'));var db=require(_0x1812('0x19'))['db'];function respondWithStatusCode(_0x2943e6,_0x584ef3){_0x584ef3=_0x584ef3||0xcc;return function(_0x1c4564){if(_0x1c4564){return _0x2943e6[_0x1812('0x1a')](_0x584ef3);}return _0x2943e6[_0x1812('0x1b')](_0x584ef3)[_0x1812('0x1c')]();};}function respondWithResult(_0xd9a660,_0x48d71f){_0x48d71f=_0x48d71f||0xc8;return function(_0x2d76ef){if(_0x2d76ef){return _0xd9a660[_0x1812('0x1b')](_0x48d71f)[_0x1812('0x1d')](_0x2d76ef);}};}function respondWithFilteredResult(_0x144eb8,_0x46c1e5){return function(_0xe29fcb){if(_0xe29fcb){var _0x463a63=typeof _0x46c1e5[_0x1812('0x1e')]===_0x1812('0x1f')&&typeof _0x46c1e5['limit']===_0x1812('0x1f');var _0x16071c=_0xe29fcb['count'];var _0xafd79c=_0x463a63?0x0:_0x46c1e5['offset'];var _0x4e7b11=_0x463a63?_0xe29fcb[_0x1812('0x20')]:_0x46c1e5['offset']+_0x46c1e5[_0x1812('0x21')];var _0x8af27b;if(_0x4e7b11>=_0x16071c){_0x4e7b11=_0x16071c;_0x8af27b=0xc8;}else{_0x8af27b=0xce;}_0x144eb8[_0x1812('0x1b')](_0x8af27b);return _0x144eb8['set']('Content-Range',_0xafd79c+'-'+_0x4e7b11+'/'+_0x16071c)[_0x1812('0x1d')](_0xe29fcb);}return null;};}function patchUpdates(_0x1feec8){return function(_0x3827ac){try{jsonpatch[_0x1812('0x22')](_0x3827ac,_0x1feec8,!![]);}catch(_0x4dc42f){return BPromise[_0x1812('0x23')](_0x4dc42f);}return _0x3827ac[_0x1812('0x24')]();};}function saveUpdates(_0x22a362,_0x21b49f){return function(_0x283545){if(_0x283545){return _0x283545[_0x1812('0x25')](_0x22a362)[_0x1812('0x26')](function(_0x28e60e){return _0x28e60e;});}return null;};}function removeEntity(_0x246f9b,_0x5a3ea5){return function(_0x25b422){if(_0x25b422){return _0x25b422[_0x1812('0x27')]()['then'](function(){_0x246f9b[_0x1812('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x69b087,_0x5d5189){return function(_0x1aa2f7){if(!_0x1aa2f7){_0x69b087[_0x1812('0x1a')](0x194);}return _0x1aa2f7;};}function handleError(_0x36c8dc,_0x4300f2){_0x4300f2=_0x4300f2||0x1f4;return function(_0xfe01b7){logger[_0x1812('0x28')](_0xfe01b7[_0x1812('0x29')]);if(_0xfe01b7[_0x1812('0x2a')]){delete _0xfe01b7['name'];}_0x36c8dc[_0x1812('0x1b')](_0x4300f2)[_0x1812('0x2b')](_0xfe01b7);};}exports['index']=function(_0x202dce,_0x2c0eff){var _0x43b186={},_0x3e337a={},_0x200aac={'count':0x0,'rows':[]};var _0x48e55e=_[_0x1812('0x2c')](db[_0x1812('0x2d')][_0x1812('0x2e')],function(_0x52a741){return{'name':_0x52a741['fieldName'],'type':_0x52a741[_0x1812('0x2f')][_0x1812('0x30')]};});_0x3e337a[_0x1812('0x31')]=_[_0x1812('0x2c')](_0x48e55e,_0x1812('0x2a'));_0x3e337a[_0x1812('0x32')]=_['keys'](_0x202dce[_0x1812('0x32')]);_0x3e337a['filters']=_[_0x1812('0x33')](_0x3e337a[_0x1812('0x31')],_0x3e337a['query']);_0x43b186[_0x1812('0x34')]=_[_0x1812('0x33')](_0x3e337a['model'],qs['fields'](_0x202dce[_0x1812('0x32')]['fields']));_0x43b186['attributes']=_0x43b186[_0x1812('0x34')][_0x1812('0x35')]?_0x43b186[_0x1812('0x34')]:_0x3e337a['model'];if(!_0x202dce[_0x1812('0x32')][_0x1812('0x36')]('nolimit')){_0x43b186['limit']=qs[_0x1812('0x21')](_0x202dce['query'][_0x1812('0x21')]);_0x43b186['offset']=qs['offset'](_0x202dce['query'][_0x1812('0x1e')]);}_0x43b186[_0x1812('0x37')]=qs[_0x1812('0x38')](_0x202dce[_0x1812('0x32')][_0x1812('0x38')]);_0x43b186[_0x1812('0x39')]=qs['filters'](_[_0x1812('0x3a')](_0x202dce['query'],_0x3e337a['filters']),_0x48e55e);if(_0x202dce[_0x1812('0x32')][_0x1812('0x3b')]){_0x43b186[_0x1812('0x39')]=_[_0x1812('0x3c')](_0x43b186[_0x1812('0x39')],{'$or':_['map'](_0x48e55e,function(_0x5e49f6){if(_0x5e49f6['type']!=='VIRTUAL'){var _0x8d9188={};_0x8d9188[_0x5e49f6[_0x1812('0x2a')]]={'$like':'%'+_0x202dce[_0x1812('0x32')][_0x1812('0x3b')]+'%'};return _0x8d9188;}})});}_0x43b186=_[_0x1812('0x3c')]({},_0x43b186,_0x202dce[_0x1812('0x3d')]);var _0x4bc644={'where':_0x43b186[_0x1812('0x39')]};return db['OpenchannelTransferReport'][_0x1812('0x20')](_0x4bc644)[_0x1812('0x26')](function(_0x532755){_0x200aac[_0x1812('0x20')]=_0x532755;if(_0x202dce[_0x1812('0x32')][_0x1812('0x3e')]){_0x43b186[_0x1812('0x3f')]=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0x43b186);})[_0x1812('0x26')](function(_0x41d472){_0x200aac['rows']=_0x41d472;return _0x200aac;})[_0x1812('0x26')](respondWithFilteredResult(_0x2c0eff,_0x43b186))[_0x1812('0x40')](handleError(_0x2c0eff,null));};exports[_0x1812('0x41')]=function(_0x1023e4,_0x43781b){var _0x43a99d={'raw':!![],'where':{'id':_0x1023e4[_0x1812('0x42')]['id']}},_0x20c7e6={};_0x20c7e6[_0x1812('0x31')]=_[_0x1812('0x43')](db[_0x1812('0x2d')][_0x1812('0x2e')]);_0x20c7e6[_0x1812('0x32')]=_['keys'](_0x1023e4['query']);_0x20c7e6[_0x1812('0x44')]=_[_0x1812('0x33')](_0x20c7e6[_0x1812('0x31')],_0x20c7e6[_0x1812('0x32')]);_0x43a99d[_0x1812('0x34')]=_[_0x1812('0x33')](_0x20c7e6['model'],qs[_0x1812('0x45')](_0x1023e4['query'][_0x1812('0x45')]));_0x43a99d[_0x1812('0x34')]=_0x43a99d[_0x1812('0x34')][_0x1812('0x35')]?_0x43a99d[_0x1812('0x34')]:_0x20c7e6[_0x1812('0x31')];if(_0x1023e4[_0x1812('0x32')][_0x1812('0x3e')]){_0x43a99d[_0x1812('0x3f')]=[{'all':!![]}];}_0x43a99d=_['merge']({},_0x43a99d,_0x1023e4[_0x1812('0x3d')]);return db[_0x1812('0x2d')]['find'](_0x43a99d)[_0x1812('0x26')](handleEntityNotFound(_0x43781b,null))[_0x1812('0x26')](respondWithResult(_0x43781b,null))[_0x1812('0x40')](handleError(_0x43781b,null));};exports['create']=function(_0x5e5a78,_0x5c2061){return db[_0x1812('0x2d')][_0x1812('0x46')](_0x5e5a78['body'],{})[_0x1812('0x26')](respondWithResult(_0x5c2061,0xc9))[_0x1812('0x40')](handleError(_0x5c2061,null));};exports[_0x1812('0x25')]=function(_0x30d14c,_0x48c5cb){if(_0x30d14c['body']['id']){delete _0x30d14c[_0x1812('0x47')]['id'];}return db[_0x1812('0x2d')][_0x1812('0x48')]({'where':{'id':_0x30d14c['params']['id']}})[_0x1812('0x26')](handleEntityNotFound(_0x48c5cb,null))[_0x1812('0x26')](saveUpdates(_0x30d14c['body'],null))[_0x1812('0x26')](respondWithResult(_0x48c5cb,null))[_0x1812('0x40')](handleError(_0x48c5cb,null));};exports[_0x1812('0x27')]=function(_0x278db8,_0x391d37){return db['OpenchannelTransferReport'][_0x1812('0x48')]({'where':{'id':_0x278db8[_0x1812('0x42')]['id']}})[_0x1812('0x26')](handleEntityNotFound(_0x391d37,null))[_0x1812('0x26')](removeEntity(_0x391d37,null))[_0x1812('0x40')](handleError(_0x391d37,null));};exports[_0x1812('0x49')]=function(_0x1a027a,_0x1c52c8){return db['OpenchannelTransferReport']['describe']()['then'](respondWithResult(_0x1c52c8,null))['catch'](handleError(_0x1c52c8,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 7b023a4..022f401 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 _0xbf42=['report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport'];(function(_0x4e1ce5,_0x285ce8){var _0x42b11a=function(_0x515020){while(--_0x515020){_0x4e1ce5['push'](_0x4e1ce5['shift']());}};_0x42b11a(++_0x285ce8);}(_0xbf42,0x64));var _0x2bf4=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xbf42[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0x2bf4('0x0'));var util=require(_0x2bf4('0x1'));var logger=require(_0x2bf4('0x2'))(_0x2bf4('0x3'));var moment=require('moment');var BPromise=require(_0x2bf4('0x4'));var rp=require(_0x2bf4('0x5'));var fs=require('fs');var path=require(_0x2bf4('0x6'));var rimraf=require('rimraf');var config=require(_0x2bf4('0x7'));var attributes=require(_0x2bf4('0x8'));module[_0x2bf4('0x9')]=function(_0x36009e,_0x338fc){return _0x36009e[_0x2bf4('0xa')](_0x2bf4('0xb'),attributes,{'tableName':_0x2bf4('0xc'),'paranoid':![],'indexes':[{'name':_0x2bf4('0xd'),'fields':[_0x2bf4('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x728a=['report_openchannel_transfer','uniqueid','../../config/logger','api','bluebird','request-promise','path','rimraf','define'];(function(_0x393b41,_0x7973a3){var _0x5d738a=function(_0x3b4078){while(--_0x3b4078){_0x393b41['push'](_0x393b41['shift']());}};_0x5d738a(++_0x7973a3);}(_0x728a,0x173));var _0xa728=function(_0x38c5a4,_0x71f480){_0x38c5a4=_0x38c5a4-0x0;var _0x15977b=_0x728a[_0x38c5a4];return _0x15977b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa728('0x0'))(_0xa728('0x1'));var moment=require('moment');var BPromise=require(_0xa728('0x2'));var rp=require(_0xa728('0x3'));var fs=require('fs');var path=require(_0xa728('0x4'));var rimraf=require(_0xa728('0x5'));var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0xbb2fd7,_0x74f047){return _0xbb2fd7[_0xa728('0x6')]('OpenchannelTransferReport',attributes,{'tableName':_0xa728('0x7'),'paranoid':![],'indexes':[{'name':_0xa728('0x8'),'fields':[_0xa728('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index d9c6b8a..7d4aa2d 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 _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','OpenchannelTransferReport,\x20%s,\x20%s','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x103454,_0x5ec6c2){var _0x5ca54f=function(_0x40d2b6){while(--_0x40d2b6){_0x103454['push'](_0x103454['shift']());}};_0x5ca54f(++_0x5ec6c2);}(_0xe14b,0x93));var _0xbe14=function(_0x1ec49b,_0x2ab4b1){_0x1ec49b=_0x1ec49b-0x0;var _0x1fc3f1=_0xe14b[_0x1ec49b];return _0x1fc3f1;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file +var _0x9fc5=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment'];(function(_0x1212cf,_0x34fcd8){var _0x443478=function(_0x407adb){while(--_0x407adb){_0x1212cf['push'](_0x1212cf['shift']());}};_0x443478(++_0x34fcd8);}(_0x9fc5,0xb6));var _0x59fc=function(_0x7ad6cb,_0xffee6c){_0x7ad6cb=_0x7ad6cb-0x0;var _0x22a0ba=_0x9fc5[_0x7ad6cb];return _0x22a0ba;};'use strict';var _=require('lodash');var util=require(_0x59fc('0x0'));var moment=require(_0x59fc('0x1'));var BPromise=require('bluebird');var rs=require(_0x59fc('0x2'));var fs=require('fs');var Redis=require(_0x59fc('0x3'));var db=require(_0x59fc('0x4'))['db'];var utils=require(_0x59fc('0x5'));var logger=require(_0x59fc('0x6'))(_0x59fc('0x7'));var config=require(_0x59fc('0x8'));var jayson=require(_0x59fc('0x9'));var client=jayson['client'][_0x59fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13897f,_0x2c47fb,_0x55fa6d){return new BPromise(function(_0xdd2bb9,_0x313063){return client[_0x59fc('0xb')](_0x13897f,_0x55fa6d)[_0x59fc('0xc')](function(_0x39bc72){logger[_0x59fc('0xd')](_0x59fc('0xe'),_0x2c47fb,'request\x20sent');logger[_0x59fc('0xf')](_0x59fc('0x10'),_0x2c47fb,_0x59fc('0x11'),JSON[_0x59fc('0x12')](_0x39bc72));if(_0x39bc72[_0x59fc('0x13')]){if(_0x39bc72[_0x59fc('0x13')][_0x59fc('0x14')]===0x1f4){logger['error'](_0x59fc('0xe'),_0x2c47fb,_0x39bc72[_0x59fc('0x13')][_0x59fc('0x15')]);return _0x313063(_0x39bc72[_0x59fc('0x13')][_0x59fc('0x15')]);}logger[_0x59fc('0x13')](_0x59fc('0xe'),_0x2c47fb,_0x39bc72[_0x59fc('0x13')][_0x59fc('0x15')]);return _0xdd2bb9(_0x39bc72[_0x59fc('0x13')][_0x59fc('0x15')]);}else{logger['info'](_0x59fc('0xe'),_0x2c47fb,_0x59fc('0x11'));_0xdd2bb9(_0x39bc72['result'][_0x59fc('0x15')]);}})[_0x59fc('0x16')](function(_0x4162c4){logger[_0x59fc('0x13')](_0x59fc('0xe'),_0x2c47fb,_0x4162c4);_0x313063(_0x4162c4);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index c61e913..aebbbae 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 _0x3caa=['util','connect-timeout','express','Router','./pause.controller','get','isAuthenticated','/:id','create','put','delete','destroy','exports','multer'];(function(_0x5c1d8c,_0x300a32){var _0x5e455b=function(_0x1be60e){while(--_0x1be60e){_0x5c1d8c['push'](_0x5c1d8c['shift']());}};_0x5e455b(++_0x300a32);}(_0x3caa,0x99));var _0xa3ca=function(_0x39f441,_0x49f1bd){_0x39f441=_0x39f441-0x0;var _0x2fdf7c=_0x3caa[_0x39f441];return _0x2fdf7c;};'use strict';var multer=require(_0xa3ca('0x0'));var util=require(_0xa3ca('0x1'));var path=require('path');var timeout=require(_0xa3ca('0x2'));var express=require(_0xa3ca('0x3'));var router=express[_0xa3ca('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa3ca('0x5'));router[_0xa3ca('0x6')]('/',auth[_0xa3ca('0x7')](),controller['index']);router[_0xa3ca('0x6')](_0xa3ca('0x8'),auth[_0xa3ca('0x7')](),controller['show']);router['post']('/',auth[_0xa3ca('0x7')](),controller[_0xa3ca('0x9')]);router[_0xa3ca('0xa')](_0xa3ca('0x8'),auth[_0xa3ca('0x7')](),controller['update']);router[_0xa3ca('0xb')](_0xa3ca('0x8'),auth[_0xa3ca('0x7')](),controller[_0xa3ca('0xc')]);module[_0xa3ca('0xd')]=router; \ No newline at end of file +var _0x2b30=['./pause.controller','get','index','/:id','isAuthenticated','show','create','update','delete','exports','multer','util','path','express','Router','fs-extra','../../config/environment'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x2b30,0x1b3));var _0x02b3=function(_0x55bce1,_0x6cecac){_0x55bce1=_0x55bce1-0x0;var _0x371921=_0x2b30[_0x55bce1];return _0x371921;};'use strict';var multer=require(_0x02b3('0x0'));var util=require(_0x02b3('0x1'));var path=require(_0x02b3('0x2'));var timeout=require('connect-timeout');var express=require(_0x02b3('0x3'));var router=express[_0x02b3('0x4')]();var fs_extra=require(_0x02b3('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x02b3('0x6'));var controller=require(_0x02b3('0x7'));router[_0x02b3('0x8')]('/',auth['isAuthenticated'](),controller[_0x02b3('0x9')]);router[_0x02b3('0x8')](_0x02b3('0xa'),auth[_0x02b3('0xb')](),controller[_0x02b3('0xc')]);router['post']('/',auth[_0x02b3('0xb')](),controller[_0x02b3('0xd')]);router['put'](_0x02b3('0xa'),auth[_0x02b3('0xb')](),controller[_0x02b3('0xe')]);router[_0x02b3('0xf')](_0x02b3('0xa'),auth[_0x02b3('0xb')](),controller['destroy']);module[_0x02b3('0x10')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 7fdcc7a..b05ba01 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 _0xcaf6=['name','sequelize','exports','STRING'];(function(_0x594248,_0x36ec9f){var _0x1720a7=function(_0x1275b3){while(--_0x1275b3){_0x594248['push'](_0x594248['shift']());}};_0x1720a7(++_0x36ec9f);}(_0xcaf6,0x1e1));var _0x6caf=function(_0x32cce8,_0x18762f){_0x32cce8=_0x32cce8-0x0;var _0x4a732b=_0xcaf6[_0x32cce8];return _0x4a732b;};'use strict';var Sequelize=require(_0x6caf('0x0'));module[_0x6caf('0x1')]={'name':{'type':Sequelize[_0x6caf('0x2')],'unique':_0x6caf('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x6caf('0x2')]}}; \ No newline at end of file +var _0x100d=['sequelize','exports','STRING','name'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x100d,0x180));var _0xd100=function(_0x458396,_0xa924d0){_0x458396=_0x458396-0x0;var _0x115b55=_0x100d[_0x458396];return _0x115b55;};'use strict';var Sequelize=require(_0xd100('0x0'));module[_0xd100('0x1')]={'name':{'type':Sequelize[_0xd100('0x2')],'unique':_0xd100('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xd100('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index e2ff6fc..bad614c 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 _0x6705=['name','send','index','map','Pause','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','filter','where','VIRTUAL','includeAll','include','findAll','rows','params','rawAttributes','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','offset','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','get','Pauses','UserProfileResource','stack'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x6705,0xd8));var _0x5670=function(_0x5f4709,_0x2b81ea){_0x5f4709=_0x5f4709-0x0;var _0x63f21=_0x6705[_0x5f4709];return _0x63f21;};'use strict';var emlformat=require(_0x5670('0x0'));var rimraf=require(_0x5670('0x1'));var zipdir=require(_0x5670('0x2'));var jsonpatch=require(_0x5670('0x3'));var rp=require(_0x5670('0x4'));var moment=require(_0x5670('0x5'));var BPromise=require(_0x5670('0x6'));var Mustache=require(_0x5670('0x7'));var util=require(_0x5670('0x8'));var path=require(_0x5670('0x9'));var sox=require(_0x5670('0xa'));var csv=require(_0x5670('0xb'));var ejs=require(_0x5670('0xc'));var fs=require('fs');var fs_extra=require(_0x5670('0xd'));var _=require(_0x5670('0xe'));var squel=require(_0x5670('0xf'));var crypto=require('crypto');var jsforce=require(_0x5670('0x10'));var deskjs=require(_0x5670('0x11'));var toCsv=require('to-csv');var querystring=require(_0x5670('0x12'));var Papa=require(_0x5670('0x13'));var Redis=require(_0x5670('0x14'));var authService=require(_0x5670('0x15'));var qs=require(_0x5670('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5670('0x17'));var logger=require('../../config/logger')(_0x5670('0x18'));var utils=require('../../config/utils');var config=require(_0x5670('0x19'));var licenseUtil=require(_0x5670('0x1a'));var db=require(_0x5670('0x1b'))['db'];function respondWithStatusCode(_0x5312c9,_0x2a398d){_0x2a398d=_0x2a398d||0xcc;return function(_0xc94a3e){if(_0xc94a3e){return _0x5312c9[_0x5670('0x1c')](_0x2a398d);}return _0x5312c9[_0x5670('0x1d')](_0x2a398d)[_0x5670('0x1e')]();};}function respondWithResult(_0x268b16,_0x31f1de){_0x31f1de=_0x31f1de||0xc8;return function(_0x58b2d9){if(_0x58b2d9){return _0x268b16[_0x5670('0x1d')](_0x31f1de)['json'](_0x58b2d9);}};}function respondWithFilteredResult(_0x2108ad,_0x24d9ce){return function(_0x15f5ad){if(_0x15f5ad){var _0x3ed9ff=typeof _0x24d9ce['offset']===_0x5670('0x1f')&&typeof _0x24d9ce['limit']===_0x5670('0x1f');var _0x33f05d=_0x15f5ad['count'];var _0x4d80b8=_0x3ed9ff?0x0:_0x24d9ce[_0x5670('0x20')];var _0x292090=_0x3ed9ff?_0x15f5ad[_0x5670('0x21')]:_0x24d9ce[_0x5670('0x20')]+_0x24d9ce[_0x5670('0x22')];var _0x118ce6;if(_0x292090>=_0x33f05d){_0x292090=_0x33f05d;_0x118ce6=0xc8;}else{_0x118ce6=0xce;}_0x2108ad[_0x5670('0x1d')](_0x118ce6);return _0x2108ad[_0x5670('0x23')](_0x5670('0x24'),_0x4d80b8+'-'+_0x292090+'/'+_0x33f05d)[_0x5670('0x25')](_0x15f5ad);}return null;};}function patchUpdates(_0x5f0d06){return function(_0x25f095){try{jsonpatch[_0x5670('0x26')](_0x25f095,_0x5f0d06,!![]);}catch(_0x231dd5){return BPromise[_0x5670('0x27')](_0x231dd5);}return _0x25f095[_0x5670('0x28')]();};}function saveUpdates(_0xac867f,_0x3c28ae){return function(_0x567e80){if(_0x567e80){return _0x567e80[_0x5670('0x29')](_0xac867f)['then'](function(_0x2c00b9){return _0x2c00b9;});}return null;};}function removeEntity(_0x42c868,_0x199042){return function(_0x2ba461){if(_0x2ba461){return _0x2ba461[_0x5670('0x2a')]()[_0x5670('0x2b')](function(){var _0x1a1a5d=_0x2ba461[_0x5670('0x2c')]({'plain':!![]});var _0x2ef98e=_0x5670('0x2d');return db[_0x5670('0x2e')][_0x5670('0x2a')]({'where':{'type':_0x2ef98e,'resourceId':_0x1a1a5d['id']}})[_0x5670('0x2b')](function(){return _0x2ba461;});})[_0x5670('0x2b')](function(){_0x42c868['status'](0xcc)[_0x5670('0x1e')]();});}};}function handleEntityNotFound(_0x114b8b,_0x41236c){return function(_0x3e6059){if(!_0x3e6059){_0x114b8b[_0x5670('0x1c')](0x194);}return _0x3e6059;};}function handleError(_0x3110c1,_0x24d09f){_0x24d09f=_0x24d09f||0x1f4;return function(_0x58f634){logger['error'](_0x58f634[_0x5670('0x2f')]);if(_0x58f634[_0x5670('0x30')]){delete _0x58f634[_0x5670('0x30')];}_0x3110c1[_0x5670('0x1d')](_0x24d09f)[_0x5670('0x31')](_0x58f634);};}exports[_0x5670('0x32')]=function(_0x1b75bf,_0x4f3ace){var _0x5af874={},_0x4baa2a={},_0x13ba68={'count':0x0,'rows':[]};var _0x3bdde5=_[_0x5670('0x33')](db[_0x5670('0x34')]['rawAttributes'],function(_0x58dd76){return{'name':_0x58dd76[_0x5670('0x35')],'type':_0x58dd76[_0x5670('0x36')][_0x5670('0x37')]};});_0x4baa2a[_0x5670('0x38')]=_[_0x5670('0x33')](_0x3bdde5,_0x5670('0x30'));_0x4baa2a[_0x5670('0x39')]=_[_0x5670('0x3a')](_0x1b75bf['query']);_0x4baa2a[_0x5670('0x3b')]=_[_0x5670('0x3c')](_0x4baa2a[_0x5670('0x38')],_0x4baa2a[_0x5670('0x39')]);_0x5af874[_0x5670('0x3d')]=_[_0x5670('0x3c')](_0x4baa2a[_0x5670('0x38')],qs[_0x5670('0x3e')](_0x1b75bf[_0x5670('0x39')]['fields']));_0x5af874[_0x5670('0x3d')]=_0x5af874[_0x5670('0x3d')][_0x5670('0x3f')]?_0x5af874[_0x5670('0x3d')]:_0x4baa2a[_0x5670('0x38')];if(!_0x1b75bf[_0x5670('0x39')][_0x5670('0x40')]('nolimit')){_0x5af874[_0x5670('0x22')]=qs[_0x5670('0x22')](_0x1b75bf['query']['limit']);_0x5af874[_0x5670('0x20')]=qs[_0x5670('0x20')](_0x1b75bf['query'][_0x5670('0x20')]);}_0x5af874['order']=qs[_0x5670('0x41')](_0x1b75bf[_0x5670('0x39')]['sort']);_0x5af874['where']=qs['filters'](_['pick'](_0x1b75bf[_0x5670('0x39')],_0x4baa2a[_0x5670('0x3b')]),_0x3bdde5);if(_0x1b75bf['query'][_0x5670('0x42')]){_0x5af874[_0x5670('0x43')]=_['merge'](_0x5af874[_0x5670('0x43')],{'$or':_[_0x5670('0x33')](_0x3bdde5,function(_0x1958d3){if(_0x1958d3[_0x5670('0x36')]!==_0x5670('0x44')){var _0x3222a2={};_0x3222a2[_0x1958d3[_0x5670('0x30')]]={'$like':'%'+_0x1b75bf[_0x5670('0x39')][_0x5670('0x42')]+'%'};return _0x3222a2;}})});}_0x5af874=_['merge']({},_0x5af874,_0x1b75bf['options']);var _0x56bb67={'where':_0x5af874['where']};return db[_0x5670('0x34')][_0x5670('0x21')](_0x56bb67)[_0x5670('0x2b')](function(_0x423ab9){_0x13ba68['count']=_0x423ab9;if(_0x1b75bf['query'][_0x5670('0x45')]){_0x5af874[_0x5670('0x46')]=[{'all':!![]}];}return db[_0x5670('0x34')][_0x5670('0x47')](_0x5af874);})[_0x5670('0x2b')](function(_0x5235fd){_0x13ba68[_0x5670('0x48')]=_0x5235fd;return _0x13ba68;})[_0x5670('0x2b')](respondWithFilteredResult(_0x4f3ace,_0x5af874))['catch'](handleError(_0x4f3ace,null));};exports['show']=function(_0x389d0f,_0x302e8b){var _0x26fc44={'raw':!![],'where':{'id':_0x389d0f[_0x5670('0x49')]['id']}},_0x2a9be8={};_0x2a9be8['model']=_[_0x5670('0x3a')](db['Pause'][_0x5670('0x4a')]);_0x2a9be8['query']=_['keys'](_0x389d0f[_0x5670('0x39')]);_0x2a9be8['filters']=_[_0x5670('0x3c')](_0x2a9be8[_0x5670('0x38')],_0x2a9be8['query']);_0x26fc44[_0x5670('0x3d')]=_[_0x5670('0x3c')](_0x2a9be8['model'],qs['fields'](_0x389d0f[_0x5670('0x39')][_0x5670('0x3e')]));_0x26fc44['attributes']=_0x26fc44[_0x5670('0x3d')][_0x5670('0x3f')]?_0x26fc44[_0x5670('0x3d')]:_0x2a9be8[_0x5670('0x38')];if(_0x389d0f[_0x5670('0x39')]['includeAll']){_0x26fc44[_0x5670('0x46')]=[{'all':!![]}];}_0x26fc44=_['merge']({},_0x26fc44,_0x389d0f[_0x5670('0x4b')]);return db[_0x5670('0x34')][_0x5670('0x4c')](_0x26fc44)['then'](handleEntityNotFound(_0x302e8b,null))[_0x5670('0x2b')](respondWithResult(_0x302e8b,null))[_0x5670('0x4d')](handleError(_0x302e8b,null));};exports[_0x5670('0x4e')]=function(_0x4540af,_0xae3fbd){return db[_0x5670('0x34')][_0x5670('0x4e')](_0x4540af[_0x5670('0x4f')],{})['then'](function(_0x3be9d3){var _0x41ff48=_0x4540af[_0x5670('0x50')][_0x5670('0x2c')]({'plain':!![]});if(!_0x41ff48)throw new Error(_0x5670('0x51'));if(_0x41ff48[_0x5670('0x52')]===_0x5670('0x50')){var _0xa4c516=_0x3be9d3[_0x5670('0x2c')]({'plain':!![]});var _0x5e26b8='Pauses';return db[_0x5670('0x53')][_0x5670('0x4c')]({'where':{'name':_0x5e26b8,'userProfileId':_0x41ff48[_0x5670('0x54')]},'raw':!![]})[_0x5670('0x2b')](function(_0x52d2d2){if(_0x52d2d2&&_0x52d2d2[_0x5670('0x55')]===0x0){return db['UserProfileResource'][_0x5670('0x4e')]({'name':_0xa4c516[_0x5670('0x30')],'resourceId':_0xa4c516['id'],'type':_0x52d2d2[_0x5670('0x30')],'sectionId':_0x52d2d2['id']},{})[_0x5670('0x2b')](function(){return _0x3be9d3;});}else{return _0x3be9d3;}})['catch'](function(_0x28e3d8){logger[_0x5670('0x56')](_0x5670('0x57'),_0x28e3d8);throw _0x28e3d8;});}return _0x3be9d3;})['then'](respondWithResult(_0xae3fbd,0xc9))[_0x5670('0x4d')](handleError(_0xae3fbd,null));};exports[_0x5670('0x29')]=function(_0x50653a,_0x53777c){if(_0x50653a[_0x5670('0x4f')]['id']){delete _0x50653a['body']['id'];}return db[_0x5670('0x34')][_0x5670('0x4c')]({'where':{'id':_0x50653a['params']['id']}})['then'](handleEntityNotFound(_0x53777c,null))[_0x5670('0x2b')](saveUpdates(_0x50653a[_0x5670('0x4f')],null))[_0x5670('0x2b')](respondWithResult(_0x53777c,null))[_0x5670('0x4d')](handleError(_0x53777c,null));};exports[_0x5670('0x2a')]=function(_0x20e948,_0x21176a){return db['Pause'][_0x5670('0x4c')]({'where':{'id':_0x20e948[_0x5670('0x49')]['id']}})[_0x5670('0x2b')](handleEntityNotFound(_0x21176a,null))['then'](removeEntity(_0x21176a,null))[_0x5670('0x4d')](handleError(_0x21176a,null));}; \ No newline at end of file +var _0x79aa=['end','offset','limit','undefined','count','set','Content-Range','json','apply','save','then','get','Pauses','error','stack','name','send','Pause','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','map','VIRTUAL','filter','options','findAll','rows','show','includeAll','include','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x79aa,0x134));var _0xa79a=function(_0x19a72c,_0x2229cb){_0x19a72c=_0x19a72c-0x0;var _0x3c6199=_0x79aa[_0x19a72c];return _0x3c6199;};'use strict';var emlformat=require(_0xa79a('0x0'));var rimraf=require(_0xa79a('0x1'));var zipdir=require(_0xa79a('0x2'));var jsonpatch=require(_0xa79a('0x3'));var rp=require('request-promise');var moment=require(_0xa79a('0x4'));var BPromise=require(_0xa79a('0x5'));var Mustache=require(_0xa79a('0x6'));var util=require(_0xa79a('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xa79a('0x8'));var ejs=require(_0xa79a('0x9'));var fs=require('fs');var fs_extra=require(_0xa79a('0xa'));var _=require(_0xa79a('0xb'));var squel=require(_0xa79a('0xc'));var crypto=require('crypto');var jsforce=require(_0xa79a('0xd'));var deskjs=require(_0xa79a('0xe'));var toCsv=require(_0xa79a('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa79a('0xf'));var authService=require(_0xa79a('0x10'));var qs=require(_0xa79a('0x11'));var as=require(_0xa79a('0x12'));var hardwareService=require(_0xa79a('0x13'));var logger=require(_0xa79a('0x14'))(_0xa79a('0x15'));var utils=require(_0xa79a('0x16'));var config=require(_0xa79a('0x17'));var licenseUtil=require(_0xa79a('0x18'));var db=require(_0xa79a('0x19'))['db'];function respondWithStatusCode(_0x30fe6a,_0x56c14f){_0x56c14f=_0x56c14f||0xcc;return function(_0x3056cd){if(_0x3056cd){return _0x30fe6a[_0xa79a('0x1a')](_0x56c14f);}return _0x30fe6a[_0xa79a('0x1b')](_0x56c14f)[_0xa79a('0x1c')]();};}function respondWithResult(_0x231de3,_0x372d08){_0x372d08=_0x372d08||0xc8;return function(_0x5e9c05){if(_0x5e9c05){return _0x231de3[_0xa79a('0x1b')](_0x372d08)['json'](_0x5e9c05);}};}function respondWithFilteredResult(_0x1e1a02,_0x4cded1){return function(_0x1deec5){if(_0x1deec5){var _0x421f72=typeof _0x4cded1[_0xa79a('0x1d')]==='undefined'&&typeof _0x4cded1[_0xa79a('0x1e')]===_0xa79a('0x1f');var _0x4201da=_0x1deec5[_0xa79a('0x20')];var _0xe53520=_0x421f72?0x0:_0x4cded1[_0xa79a('0x1d')];var _0x3f8dbf=_0x421f72?_0x1deec5['count']:_0x4cded1[_0xa79a('0x1d')]+_0x4cded1[_0xa79a('0x1e')];var _0x4f2a7c;if(_0x3f8dbf>=_0x4201da){_0x3f8dbf=_0x4201da;_0x4f2a7c=0xc8;}else{_0x4f2a7c=0xce;}_0x1e1a02['status'](_0x4f2a7c);return _0x1e1a02[_0xa79a('0x21')](_0xa79a('0x22'),_0xe53520+'-'+_0x3f8dbf+'/'+_0x4201da)[_0xa79a('0x23')](_0x1deec5);}return null;};}function patchUpdates(_0x22f699){return function(_0x24abec){try{jsonpatch[_0xa79a('0x24')](_0x24abec,_0x22f699,!![]);}catch(_0x5db236){return BPromise['reject'](_0x5db236);}return _0x24abec[_0xa79a('0x25')]();};}function saveUpdates(_0x2cb897,_0x2fbc7d){return function(_0x5bc028){if(_0x5bc028){return _0x5bc028['update'](_0x2cb897)[_0xa79a('0x26')](function(_0x2f9e5a){return _0x2f9e5a;});}return null;};}function removeEntity(_0x1bfc9b,_0x3bfbdc){return function(_0xf7649b){if(_0xf7649b){return _0xf7649b['destroy']()[_0xa79a('0x26')](function(){var _0x4a3383=_0xf7649b[_0xa79a('0x27')]({'plain':!![]});var _0x349952=_0xa79a('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x349952,'resourceId':_0x4a3383['id']}})[_0xa79a('0x26')](function(){return _0xf7649b;});})[_0xa79a('0x26')](function(){_0x1bfc9b['status'](0xcc)[_0xa79a('0x1c')]();});}};}function handleEntityNotFound(_0x59985c,_0xf3c38d){return function(_0x33917b){if(!_0x33917b){_0x59985c['sendStatus'](0x194);}return _0x33917b;};}function handleError(_0x37326c,_0x157f78){_0x157f78=_0x157f78||0x1f4;return function(_0x352d5a){logger[_0xa79a('0x29')](_0x352d5a[_0xa79a('0x2a')]);if(_0x352d5a[_0xa79a('0x2b')]){delete _0x352d5a[_0xa79a('0x2b')];}_0x37326c[_0xa79a('0x1b')](_0x157f78)[_0xa79a('0x2c')](_0x352d5a);};}exports['index']=function(_0x5717b2,_0x7dad0b){var _0x5b351b={},_0x2d0fbd={},_0x5dac27={'count':0x0,'rows':[]};var _0x2dc2b2=_['map'](db[_0xa79a('0x2d')][_0xa79a('0x2e')],function(_0x582a3e){return{'name':_0x582a3e['fieldName'],'type':_0x582a3e[_0xa79a('0x2f')][_0xa79a('0x30')]};});_0x2d0fbd[_0xa79a('0x31')]=_['map'](_0x2dc2b2,_0xa79a('0x2b'));_0x2d0fbd[_0xa79a('0x32')]=_[_0xa79a('0x33')](_0x5717b2[_0xa79a('0x32')]);_0x2d0fbd['filters']=_[_0xa79a('0x34')](_0x2d0fbd[_0xa79a('0x31')],_0x2d0fbd[_0xa79a('0x32')]);_0x5b351b[_0xa79a('0x35')]=_[_0xa79a('0x34')](_0x2d0fbd[_0xa79a('0x31')],qs[_0xa79a('0x36')](_0x5717b2['query']['fields']));_0x5b351b[_0xa79a('0x35')]=_0x5b351b[_0xa79a('0x35')][_0xa79a('0x37')]?_0x5b351b[_0xa79a('0x35')]:_0x2d0fbd[_0xa79a('0x31')];if(!_0x5717b2[_0xa79a('0x32')][_0xa79a('0x38')](_0xa79a('0x39'))){_0x5b351b['limit']=qs[_0xa79a('0x1e')](_0x5717b2[_0xa79a('0x32')][_0xa79a('0x1e')]);_0x5b351b[_0xa79a('0x1d')]=qs[_0xa79a('0x1d')](_0x5717b2[_0xa79a('0x32')][_0xa79a('0x1d')]);}_0x5b351b[_0xa79a('0x3a')]=qs[_0xa79a('0x3b')](_0x5717b2[_0xa79a('0x32')]['sort']);_0x5b351b['where']=qs[_0xa79a('0x3c')](_['pick'](_0x5717b2[_0xa79a('0x32')],_0x2d0fbd['filters']),_0x2dc2b2);if(_0x5717b2[_0xa79a('0x32')]['filter']){_0x5b351b[_0xa79a('0x3d')]=_[_0xa79a('0x3e')](_0x5b351b[_0xa79a('0x3d')],{'$or':_[_0xa79a('0x3f')](_0x2dc2b2,function(_0x4cec6f){if(_0x4cec6f[_0xa79a('0x2f')]!==_0xa79a('0x40')){var _0x4ed679={};_0x4ed679[_0x4cec6f[_0xa79a('0x2b')]]={'$like':'%'+_0x5717b2['query'][_0xa79a('0x41')]+'%'};return _0x4ed679;}})});}_0x5b351b=_['merge']({},_0x5b351b,_0x5717b2[_0xa79a('0x42')]);var _0x19d247={'where':_0x5b351b[_0xa79a('0x3d')]};return db[_0xa79a('0x2d')][_0xa79a('0x20')](_0x19d247)[_0xa79a('0x26')](function(_0x5dca60){_0x5dac27[_0xa79a('0x20')]=_0x5dca60;if(_0x5717b2[_0xa79a('0x32')]['includeAll']){_0x5b351b['include']=[{'all':!![]}];}return db[_0xa79a('0x2d')][_0xa79a('0x43')](_0x5b351b);})[_0xa79a('0x26')](function(_0x59e8ab){_0x5dac27[_0xa79a('0x44')]=_0x59e8ab;return _0x5dac27;})[_0xa79a('0x26')](respondWithFilteredResult(_0x7dad0b,_0x5b351b))['catch'](handleError(_0x7dad0b,null));};exports[_0xa79a('0x45')]=function(_0x4658c2,_0x587a97){var _0x5157d8={'raw':!![],'where':{'id':_0x4658c2['params']['id']}},_0x17e08a={};_0x17e08a[_0xa79a('0x31')]=_['keys'](db[_0xa79a('0x2d')][_0xa79a('0x2e')]);_0x17e08a[_0xa79a('0x32')]=_[_0xa79a('0x33')](_0x4658c2[_0xa79a('0x32')]);_0x17e08a['filters']=_[_0xa79a('0x34')](_0x17e08a[_0xa79a('0x31')],_0x17e08a[_0xa79a('0x32')]);_0x5157d8['attributes']=_['intersection'](_0x17e08a[_0xa79a('0x31')],qs[_0xa79a('0x36')](_0x4658c2[_0xa79a('0x32')][_0xa79a('0x36')]));_0x5157d8[_0xa79a('0x35')]=_0x5157d8[_0xa79a('0x35')][_0xa79a('0x37')]?_0x5157d8['attributes']:_0x17e08a[_0xa79a('0x31')];if(_0x4658c2['query'][_0xa79a('0x46')]){_0x5157d8[_0xa79a('0x47')]=[{'all':!![]}];}_0x5157d8=_[_0xa79a('0x3e')]({},_0x5157d8,_0x4658c2[_0xa79a('0x42')]);return db['Pause'][_0xa79a('0x48')](_0x5157d8)[_0xa79a('0x26')](handleEntityNotFound(_0x587a97,null))['then'](respondWithResult(_0x587a97,null))['catch'](handleError(_0x587a97,null));};exports[_0xa79a('0x49')]=function(_0x1a608f,_0x5de25e){return db['Pause'][_0xa79a('0x49')](_0x1a608f[_0xa79a('0x4a')],{})[_0xa79a('0x26')](function(_0x32345c){var _0x50b6c1=_0x1a608f[_0xa79a('0x4b')][_0xa79a('0x27')]({'plain':!![]});if(!_0x50b6c1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x50b6c1['role']===_0xa79a('0x4b')){var _0x3bc54f=_0x32345c[_0xa79a('0x27')]({'plain':!![]});var _0x5e9b99=_0xa79a('0x28');return db[_0xa79a('0x4c')][_0xa79a('0x48')]({'where':{'name':_0x5e9b99,'userProfileId':_0x50b6c1[_0xa79a('0x4d')]},'raw':!![]})['then'](function(_0x5d639a){if(_0x5d639a&&_0x5d639a[_0xa79a('0x4e')]===0x0){return db[_0xa79a('0x4f')][_0xa79a('0x49')]({'name':_0x3bc54f[_0xa79a('0x2b')],'resourceId':_0x3bc54f['id'],'type':_0x5d639a[_0xa79a('0x2b')],'sectionId':_0x5d639a['id']},{})['then'](function(){return _0x32345c;});}else{return _0x32345c;}})[_0xa79a('0x50')](function(_0x45e474){logger[_0xa79a('0x29')](_0xa79a('0x51'),_0x45e474);throw _0x45e474;});}return _0x32345c;})[_0xa79a('0x26')](respondWithResult(_0x5de25e,0xc9))['catch'](handleError(_0x5de25e,null));};exports['update']=function(_0x38388b,_0x1ad6e0){if(_0x38388b[_0xa79a('0x4a')]['id']){delete _0x38388b['body']['id'];}return db['Pause'][_0xa79a('0x48')]({'where':{'id':_0x38388b[_0xa79a('0x52')]['id']}})[_0xa79a('0x26')](handleEntityNotFound(_0x1ad6e0,null))[_0xa79a('0x26')](saveUpdates(_0x38388b['body'],null))[_0xa79a('0x26')](respondWithResult(_0x1ad6e0,null))[_0xa79a('0x50')](handleError(_0x1ad6e0,null));};exports[_0xa79a('0x53')]=function(_0x31d9ac,_0x3b289a){return db[_0xa79a('0x2d')][_0xa79a('0x48')]({'where':{'id':_0x31d9ac[_0xa79a('0x52')]['id']}})[_0xa79a('0x26')](handleEntityNotFound(_0x3b289a,null))['then'](removeEntity(_0x3b289a,null))[_0xa79a('0x50')](handleError(_0x3b289a,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index ed7503f..2d23549 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 _0x9957=['exports','define','Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./pause.attributes'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 +var _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','tools_pauses','lodash'];(function(_0x4dfe3c,_0x257e4e){var _0x518ce5=function(_0xcffd44){while(--_0xcffd44){_0x4dfe3c['push'](_0x4dfe3c['shift']());}};_0x518ce5(++_0x257e4e);}(_0xabce,0x103));var _0xeabc=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0xabce[_0x3de8a4];return _0x4635cf;};'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 diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 4e34c7c..ae129b1 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x41704f,_0x5e17ce){var _0x271d77=function(_0x4382df){while(--_0x4382df){_0x41704f['push'](_0x41704f['shift']());}};_0x271d77(++_0x5e17ce);}(_0x7a54,0x106));var _0x47a5=function(_0x4068bc,_0x53a872){_0x4068bc=_0x4068bc-0x0;var _0x66ca45=_0x7a54[_0x4068bc];return _0x66ca45;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x4e5569,_0xed19c5){var _0x572f6b=function(_0x25c8df){while(--_0x25c8df){_0x4e5569['push'](_0x4e5569['shift']());}};_0x572f6b(++_0xed19c5);}(_0xb10b,0x12a));var _0xbb10=function(_0x3ae1c8,_0x4f1c21){_0x3ae1c8=_0x3ae1c8-0x0;var _0x5a2621=_0xb10b[_0x3ae1c8];return _0x5a2621;};'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 7e6a450..19539f9 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 _0x1cc7=['path','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/webhook','webhookGet','/:id','show','/:id/download','join','server/files/plugins','originalname','replace','format','%s-%s%s','basename','now','extname','post','single','file','webhookPost','put','delete','exports','multer','util'];(function(_0x169d18,_0x4bb3dd){var _0x37fe3c=function(_0x12bdf1){while(--_0x12bdf1){_0x169d18['push'](_0x169d18['shift']());}};_0x37fe3c(++_0x4bb3dd);}(_0x1cc7,0x15a));var _0x71cc=function(_0x8e7d1f,_0x3103ab){_0x8e7d1f=_0x8e7d1f-0x0;var _0x459348=_0x1cc7[_0x8e7d1f];return _0x459348;};'use strict';var multer=require(_0x71cc('0x0'));var util=require(_0x71cc('0x1'));var path=require(_0x71cc('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x71cc('0x3'));var auth=require(_0x71cc('0x4'));var interaction=require(_0x71cc('0x5'));var config=require('../../config/environment');var controller=require('./plugin.controller');router['get']('/',auth[_0x71cc('0x6')](),controller['index']);router[_0x71cc('0x7')](_0x71cc('0x8'),controller[_0x71cc('0x9')]);router[_0x71cc('0x7')](_0x71cc('0xa'),auth['isAuthenticated'](),controller[_0x71cc('0xb')]);router[_0x71cc('0x7')](_0x71cc('0xc'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4b7514,_0xeb4747,_0x2db190){_0x2db190(null,path[_0x71cc('0xd')](config['root'],_0x71cc('0xe')));},'filename':function(_0x550b3c,_0x1aad83,_0x4f9c5c){_0x1aad83[_0x71cc('0xf')]=_0x1aad83['originalname'][_0x71cc('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4f9c5c(null,util[_0x71cc('0x11')](_0x71cc('0x12'),path[_0x71cc('0x13')](_0x1aad83[_0x71cc('0xf')],path['extname'](_0x1aad83[_0x71cc('0xf')])),Date[_0x71cc('0x14')](),path[_0x71cc('0x15')](_0x1aad83[_0x71cc('0xf')])));}})});router[_0x71cc('0x16')]('/',upload[_0x71cc('0x17')](_0x71cc('0x18')),controller['upload']);router[_0x71cc('0x16')](_0x71cc('0x8'),controller[_0x71cc('0x19')]);router[_0x71cc('0x1a')](_0x71cc('0xa'),auth[_0x71cc('0x6')](),controller['update']);router[_0x71cc('0x1b')](_0x71cc('0xa'),auth['isAuthenticated'](),controller['delete']);module[_0x71cc('0x1c')]=router; \ No newline at end of file +var _0x6aa7=['isAuthenticated','get','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','extname','now','post','file','webhookPost','put','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3ea749,_0x1e5289){var _0x5d169b=function(_0x2001ed){while(--_0x2001ed){_0x3ea749['push'](_0x3ea749['shift']());}};_0x5d169b(++_0x1e5289);}(_0x6aa7,0x178));var _0x76aa=function(_0x51040c,_0xab5912){_0x51040c=_0x51040c-0x0;var _0x54d42a=_0x6aa7[_0x51040c];return _0x54d42a;};'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('./plugin.controller');router['get']('/',auth[_0x76aa('0x8')](),controller['index']);router[_0x76aa('0x9')](_0x76aa('0xa'),controller[_0x76aa('0xb')]);router['get'](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router['get'](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);var upload=multer({'storage':multer[_0x76aa('0x10')]({'destination':function(_0x37f1ab,_0x128435,_0x2c5075){_0x2c5075(null,path[_0x76aa('0x11')](config[_0x76aa('0x12')],_0x76aa('0x13')));},'filename':function(_0x5e5f47,_0x112c39,_0x5df49c){_0x112c39[_0x76aa('0x14')]=_0x112c39[_0x76aa('0x14')][_0x76aa('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5df49c(null,util[_0x76aa('0x16')](_0x76aa('0x17'),path['basename'](_0x112c39['originalname'],path[_0x76aa('0x18')](_0x112c39['originalname'])),Date[_0x76aa('0x19')](),path[_0x76aa('0x18')](_0x112c39['originalname'])));}})});router[_0x76aa('0x1a')]('/',upload['single'](_0x76aa('0x1b')),controller['upload']);router[_0x76aa('0x1a')](_0x76aa('0xa'),controller[_0x76aa('0x1c')]);router[_0x76aa('0x1d')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller['update']);router['delete'](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1e')]);module[_0x76aa('0x1f')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index e78febf..71d9cc5 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 _0x81d6=['script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM'];(function(_0xc2656a,_0x58994a){var _0x4f8267=function(_0x5ebbe6){while(--_0x5ebbe6){_0xc2656a['push'](_0xc2656a['shift']());}};_0x4f8267(++_0x58994a);}(_0x81d6,0x15c));var _0x681d=function(_0x580fd7,_0x2a1952){_0x580fd7=_0x580fd7-0x0;var _0x58e564=_0x81d6[_0x580fd7];return _0x58e564;};'use strict';var Sequelize=require(_0x681d('0x0'));module[_0x681d('0x1')]={'name':{'type':Sequelize[_0x681d('0x2')]},'type':{'type':Sequelize[_0x681d('0x3')]('html',_0x681d('0x4'))},'description':{'type':Sequelize[_0x681d('0x5')]},'version':{'type':Sequelize[_0x681d('0x5')]},'path':{'type':Sequelize[_0x681d('0x2')],'comment':_0x681d('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x681d('0x7')},'sidebar':{'type':Sequelize[_0x681d('0x3')](_0x681d('0x8'),'agentOnly',_0x681d('0x9'),'never'),'defaultValue':'always','comment':_0x681d('0xa')},'icon':{'type':Sequelize[_0x681d('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x681d('0x2')]},'scriptPath':{'type':Sequelize[_0x681d('0x2')]}}; \ No newline at end of file +var _0xe929=['sequelize','html','script','TEXT','STRING','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xe929,0x78));var _0x9e92=function(_0xe0b81f,_0x1fb734){_0xe0b81f=_0xe0b81f-0x0;var _0x290e5e=_0xe929[_0xe0b81f];return _0x290e5e;};'use strict';var Sequelize=require(_0x9e92('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x9e92('0x1'),_0x9e92('0x2'))},'description':{'type':Sequelize[_0x9e92('0x3')]},'version':{'type':Sequelize[_0x9e92('0x3')]},'path':{'type':Sequelize[_0x9e92('0x4')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x9e92('0x5')],'defaultValue':0x0,'comment':_0x9e92('0x6')},'sidebar':{'type':Sequelize['ENUM'](_0x9e92('0x7'),_0x9e92('0x8'),_0x9e92('0x9'),_0x9e92('0xa')),'defaultValue':_0x9e92('0x9'),'comment':_0x9e92('0xb')},'icon':{'type':Sequelize[_0x9e92('0x4')]},'adminUrl':{'type':Sequelize[_0x9e92('0x4')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x9e92('0x4')]},'scriptPath':{'type':Sequelize[_0x9e92('0x4')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 1485b1e..868b7b3 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 _0x4abe=['index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','include','Plugin','findAll','catch','show','params','includeAll','find','download','join','root','server/files/plugins','basename','path','createWriteStream','zip','warning','ENOENT','Error\x20while\x20generating\x20the\x20zip\x20archive','error','Sequelize','Error','pipe','glob','node_modules/**/*','attachments/**/*','finalize','close','Plugin\x20not\x20found','format','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','icon-apps','version','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','%s%s','headers','content-length','content-type','set','endsWith','statusCode','webhookPost','http://localhost:','method','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','to-csv','querystring','extract-zip','archiver','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','end','status','json','undefined','count','offset','limit','apply','reject','save','update','then','destroy','get','Plugins','UserProfileResource','stack','name','send'];(function(_0x135101,_0x47ad30){var _0x12556e=function(_0x43ff44){while(--_0x43ff44){_0x135101['push'](_0x135101['shift']());}};_0x12556e(++_0x47ad30);}(_0x4abe,0x1c8));var _0xe4ab=function(_0x2ac1ae,_0x214104){_0x2ac1ae=_0x2ac1ae-0x0;var _0x333495=_0x4abe[_0x2ac1ae];return _0x333495;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe4ab('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe4ab('0x1'));var rp=require(_0xe4ab('0x2'));var moment=require(_0xe4ab('0x3'));var BPromise=require(_0xe4ab('0x4'));var Mustache=require(_0xe4ab('0x5'));var util=require(_0xe4ab('0x6'));var path=require('path');var sox=require(_0xe4ab('0x7'));var csv=require('to-csv');var ejs=require(_0xe4ab('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe4ab('0x9'));var crypto=require(_0xe4ab('0xa'));var jsforce=require(_0xe4ab('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe4ab('0xc'));var querystring=require(_0xe4ab('0xd'));var Papa=require('papaparse');var extract=require(_0xe4ab('0xe'));var rimraf=require(_0xe4ab('0x0'));var archiver=require(_0xe4ab('0xf'));var Redis=require('ioredis');var authService=require(_0xe4ab('0x10'));var qs=require(_0xe4ab('0x11'));var as=require(_0xe4ab('0x12'));var hardwareService=require(_0xe4ab('0x13'));var logger=require('../../config/logger')(_0xe4ab('0x14'));var utils=require(_0xe4ab('0x15'));var config=require(_0xe4ab('0x16'));var licenseUtil=require(_0xe4ab('0x17'));var db=require(_0xe4ab('0x18'))['db'];config[_0xe4ab('0x19')]=_[_0xe4ab('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe4ab('0x1b'))(new Redis(config[_0xe4ab('0x19')]));require('./plugin.socket')['register'](socket);function respondWithStatusCode(_0x27576f,_0x2b5ee5){_0x2b5ee5=_0x2b5ee5||0xcc;return function(_0x418861){if(_0x418861){return _0x27576f[_0xe4ab('0x1c')](_0x2b5ee5);}return _0x27576f['status'](_0x2b5ee5)[_0xe4ab('0x1d')]();};}function respondWithResult(_0x5e9dd0,_0xb60261){_0xb60261=_0xb60261||0xc8;return function(_0x425114){if(_0x425114){return _0x5e9dd0[_0xe4ab('0x1e')](_0xb60261)[_0xe4ab('0x1f')](_0x425114);}};}function respondWithFilteredResult(_0x51e681,_0x42c3a3){return function(_0x3a1641){if(_0x3a1641){var _0x2c730a=typeof _0x42c3a3['offset']===_0xe4ab('0x20')&&typeof _0x42c3a3['limit']==='undefined';var _0xf18d78=_0x3a1641[_0xe4ab('0x21')];var _0x20c734=_0x2c730a?0x0:_0x42c3a3[_0xe4ab('0x22')];var _0x5bcae0=_0x2c730a?_0x3a1641[_0xe4ab('0x21')]:_0x42c3a3[_0xe4ab('0x22')]+_0x42c3a3[_0xe4ab('0x23')];var _0x29a31d;if(_0x5bcae0>=_0xf18d78){_0x5bcae0=_0xf18d78;_0x29a31d=0xc8;}else{_0x29a31d=0xce;}_0x51e681[_0xe4ab('0x1e')](_0x29a31d);return _0x51e681['set']('Content-Range',_0x20c734+'-'+_0x5bcae0+'/'+_0xf18d78)[_0xe4ab('0x1f')](_0x3a1641);}return null;};}function patchUpdates(_0x3e9fca){return function(_0x485799){try{jsonpatch[_0xe4ab('0x24')](_0x485799,_0x3e9fca,!![]);}catch(_0x507245){return BPromise[_0xe4ab('0x25')](_0x507245);}return _0x485799[_0xe4ab('0x26')]();};}function saveUpdates(_0x44441a,_0x4488f6){return function(_0x3dfcfe){if(_0x3dfcfe){return _0x3dfcfe[_0xe4ab('0x27')](_0x44441a)[_0xe4ab('0x28')](function(_0x35ef73){return _0x35ef73;});}return null;};}function removeEntity(_0x190c6c,_0x2778d2){return function(_0x20fded){if(_0x20fded){return _0x20fded[_0xe4ab('0x29')]()[_0xe4ab('0x28')](function(){var _0x40d4b3=_0x20fded[_0xe4ab('0x2a')]({'plain':!![]});var _0x4f10a5=_0xe4ab('0x2b');return db[_0xe4ab('0x2c')]['destroy']({'where':{'type':_0x4f10a5,'resourceId':_0x40d4b3['id']}})[_0xe4ab('0x28')](function(){return _0x20fded;});})[_0xe4ab('0x28')](function(){_0x190c6c[_0xe4ab('0x1e')](0xcc)[_0xe4ab('0x1d')]();});}};}function handleEntityNotFound(_0x412122,_0x5d4dca){return function(_0x5052f9){if(!_0x5052f9){_0x412122[_0xe4ab('0x1c')](0x194);}return _0x5052f9;};}function handleError(_0x6750f3,_0x2c9ba0){_0x2c9ba0=_0x2c9ba0||0x1f4;return function(_0x36d894){logger['error'](_0x36d894[_0xe4ab('0x2d')]);if(_0x36d894['name']){delete _0x36d894[_0xe4ab('0x2e')];}_0x6750f3[_0xe4ab('0x1e')](_0x2c9ba0)[_0xe4ab('0x2f')](_0x36d894);};}exports[_0xe4ab('0x30')]=function(_0x215cdc,_0x19697d){var _0x3b1695={},_0x30963a={},_0x343286={'count':0x0,'rows':[]};var _0x5ee83a=_[_0xe4ab('0x31')](db['Plugin'][_0xe4ab('0x32')],function(_0x53d6fa){return{'name':_0x53d6fa[_0xe4ab('0x33')],'type':_0x53d6fa[_0xe4ab('0x34')][_0xe4ab('0x35')]};});_0x30963a['model']=_[_0xe4ab('0x31')](_0x5ee83a,_0xe4ab('0x2e'));_0x30963a[_0xe4ab('0x36')]=_[_0xe4ab('0x37')](_0x215cdc['query']);_0x30963a[_0xe4ab('0x38')]=_[_0xe4ab('0x39')](_0x30963a[_0xe4ab('0x3a')],_0x30963a[_0xe4ab('0x36')]);_0x3b1695[_0xe4ab('0x3b')]=_[_0xe4ab('0x39')](_0x30963a[_0xe4ab('0x3a')],qs['fields'](_0x215cdc[_0xe4ab('0x36')][_0xe4ab('0x3c')]));_0x3b1695[_0xe4ab('0x3b')]=_0x3b1695['attributes'][_0xe4ab('0x3d')]?_0x3b1695[_0xe4ab('0x3b')]:_0x30963a[_0xe4ab('0x3a')];if(!_0x215cdc[_0xe4ab('0x36')][_0xe4ab('0x3e')]('nolimit')){_0x3b1695[_0xe4ab('0x23')]=qs[_0xe4ab('0x23')](_0x215cdc[_0xe4ab('0x36')][_0xe4ab('0x23')]);_0x3b1695['offset']=qs[_0xe4ab('0x22')](_0x215cdc[_0xe4ab('0x36')]['offset']);}_0x3b1695['order']=qs[_0xe4ab('0x3f')](_0x215cdc[_0xe4ab('0x36')][_0xe4ab('0x3f')]);_0x3b1695[_0xe4ab('0x40')]=qs[_0xe4ab('0x38')](_[_0xe4ab('0x41')](_0x215cdc[_0xe4ab('0x36')],_0x30963a[_0xe4ab('0x38')]),_0x5ee83a);if(_0x215cdc[_0xe4ab('0x36')][_0xe4ab('0x42')]){_0x3b1695['where']=_['merge'](_0x3b1695[_0xe4ab('0x40')],{'$or':_[_0xe4ab('0x31')](_0x5ee83a,function(_0x509a11){if(_0x509a11[_0xe4ab('0x34')]!==_0xe4ab('0x43')){var _0x216635={};_0x216635[_0x509a11[_0xe4ab('0x2e')]]={'$like':'%'+_0x215cdc['query'][_0xe4ab('0x42')]+'%'};return _0x216635;}})});}_0x3b1695=_[_0xe4ab('0x44')]({},_0x3b1695,_0x215cdc[_0xe4ab('0x45')]);var _0x27dc23={'where':_0x3b1695[_0xe4ab('0x40')]};return db['Plugin'][_0xe4ab('0x21')](_0x27dc23)[_0xe4ab('0x28')](function(_0x375201){_0x343286['count']=_0x375201;if(_0x215cdc[_0xe4ab('0x36')]['includeAll']){_0x3b1695[_0xe4ab('0x46')]=[{'all':!![]}];}return db[_0xe4ab('0x47')][_0xe4ab('0x48')](_0x3b1695);})[_0xe4ab('0x28')](function(_0x34afeb){_0x343286['rows']=_0x34afeb;return _0x343286;})['then'](respondWithFilteredResult(_0x19697d,_0x3b1695))[_0xe4ab('0x49')](handleError(_0x19697d,null));};exports[_0xe4ab('0x4a')]=function(_0x3f0e8d,_0x575bfc){var _0x586ed6={'raw':!![],'where':{'id':_0x3f0e8d[_0xe4ab('0x4b')]['id']}},_0x2b2035={};_0x2b2035[_0xe4ab('0x3a')]=_[_0xe4ab('0x37')](db[_0xe4ab('0x47')][_0xe4ab('0x32')]);_0x2b2035[_0xe4ab('0x36')]=_[_0xe4ab('0x37')](_0x3f0e8d[_0xe4ab('0x36')]);_0x2b2035[_0xe4ab('0x38')]=_[_0xe4ab('0x39')](_0x2b2035[_0xe4ab('0x3a')],_0x2b2035[_0xe4ab('0x36')]);_0x586ed6[_0xe4ab('0x3b')]=_[_0xe4ab('0x39')](_0x2b2035[_0xe4ab('0x3a')],qs['fields'](_0x3f0e8d[_0xe4ab('0x36')][_0xe4ab('0x3c')]));_0x586ed6[_0xe4ab('0x3b')]=_0x586ed6[_0xe4ab('0x3b')][_0xe4ab('0x3d')]?_0x586ed6[_0xe4ab('0x3b')]:_0x2b2035[_0xe4ab('0x3a')];if(_0x3f0e8d['query'][_0xe4ab('0x4c')]){_0x586ed6[_0xe4ab('0x46')]=[{'all':!![]}];}_0x586ed6=_['merge']({},_0x586ed6,_0x3f0e8d[_0xe4ab('0x45')]);return db[_0xe4ab('0x47')][_0xe4ab('0x4d')](_0x586ed6)[_0xe4ab('0x28')](handleEntityNotFound(_0x575bfc,null))[_0xe4ab('0x28')](respondWithResult(_0x575bfc,null))[_0xe4ab('0x49')](handleError(_0x575bfc,null));};exports[_0xe4ab('0x4e')]=function(_0x207621,_0x55f1e5,_0x5a6e31){return db[_0xe4ab('0x47')][_0xe4ab('0x4d')]({'where':{'id':_0x207621[_0xe4ab('0x4b')]['id']},'attributes':['name','path'],'raw':!![]})[_0xe4ab('0x28')](handleEntityNotFound(_0x55f1e5,null))[_0xe4ab('0x28')](function(_0x1d1373){if(_0x1d1373){var _0x4568ff=path[_0xe4ab('0x4f')](config[_0xe4ab('0x50')],_0xe4ab('0x51'),util['format']('%s.zip',path[_0xe4ab('0x52')](_0x1d1373[_0xe4ab('0x53')])));var _0x3b0d60=fs[_0xe4ab('0x54')](_0x4568ff);var _0x4bc230=archiver(_0xe4ab('0x55'),{'zlib':{'level':0x9}});_0x4bc230['on'](_0xe4ab('0x56'),function(_0x2547bb){if(_0x2547bb['code']===_0xe4ab('0x57')){logger['error'](_0x2547bb);}else{throw new db['Sequelize']['Error'](_0xe4ab('0x58'));}});_0x4bc230['on'](_0xe4ab('0x59'),function(_0x3af9d4){throw new db[(_0xe4ab('0x5a'))][(_0xe4ab('0x5b'))](_0xe4ab('0x58'));});_0x4bc230[_0xe4ab('0x5c')](_0x3b0d60);_0x4bc230[_0xe4ab('0x5d')]('**/*',{'cwd':path[_0xe4ab('0x4f')](config['root'],_0xe4ab('0x51'),path['dirname'](_0x1d1373[_0xe4ab('0x53')])),'ignore':[path['join'](path['basename'](_0x1d1373[_0xe4ab('0x53')]),_0xe4ab('0x5e')),path[_0xe4ab('0x4f')](path[_0xe4ab('0x52')](_0x1d1373['path']),_0xe4ab('0x5f'))],'nodir':!![]})[_0xe4ab('0x60')]();_0x3b0d60['on'](_0xe4ab('0x61'),function(){if(!fs['existsSync'](_0x4568ff)){throw new db[(_0xe4ab('0x5a'))]['Error'](_0xe4ab('0x62'));}return _0x55f1e5[_0xe4ab('0x4e')](_0x4568ff,util[_0xe4ab('0x63')]('%s.zip',path['basename'](_0x1d1373[_0xe4ab('0x53')])),function(_0x2b5eb6){if(_0x2b5eb6){throw new db[(_0xe4ab('0x5a'))][(_0xe4ab('0x5b'))](_0xe4ab('0x64'));}fs['unlinkSync'](_0x4568ff);logger[_0xe4ab('0x65')](_0xe4ab('0x66'));logger[_0xe4ab('0x65')](_0xe4ab('0x67'));});});}return null;})[_0xe4ab('0x49')](handleError(_0x55f1e5,null));};exports[_0xe4ab('0x68')]=function(_0x55d6de,_0x2d2a32,_0x280d00){var _0x25fe99=path[_0xe4ab('0x52')](_0x55d6de['file'][_0xe4ab('0x69')],path[_0xe4ab('0x6a')](_0x55d6de['file'][_0xe4ab('0x69')]));var _0x37e40a=path[_0xe4ab('0x4f')](config[_0xe4ab('0x50')],'server/files/plugins',_0x55d6de[_0xe4ab('0x6b')][_0xe4ab('0x69')]);var _0x1ed321=path[_0xe4ab('0x4f')](config[_0xe4ab('0x50')],_0xe4ab('0x51'),_0x25fe99);logger[_0xe4ab('0x65')](_0xe4ab('0x6c'),_0x37e40a);logger[_0xe4ab('0x65')](_0xe4ab('0x6d'),_0x1ed321);try{fs[_0xe4ab('0x6e')](_0x37e40a,parseInt('0777',0x8));extract(_0x37e40a,{'dir':_0x1ed321},function(_0x3499eb){if(_0x3499eb){logger[_0xe4ab('0x59')](_0x3499eb);handleError(_0x3499eb,!![]);};var _0x5a5052=fs[_0xe4ab('0x6f')](_0x1ed321);if(_0x5a5052[_0xe4ab('0x3d')]>0x1){removeReferences(_0x37e40a,_0x1ed321);logger[_0xe4ab('0x59')](_0xe4ab('0x70'));return _0x280d00(new Error('Invalid\x20plugin\x20structure'));}var _0x28a73f=fs['lstatSync'](path[_0xe4ab('0x4f')](_0x1ed321,_0x5a5052[0x0]));if(_0x28a73f[_0xe4ab('0x71')]()){removeReferences(_0x37e40a,_0x1ed321);logger['error'](_0xe4ab('0x70'));return _0x280d00(new Error(_0xe4ab('0x70')));}if(_0x28a73f[_0xe4ab('0x72')]()){var _0x101019=fs[_0xe4ab('0x6f')](path[_0xe4ab('0x4f')](_0x1ed321,_0x5a5052[0x0]));if(_0x101019[_0xe4ab('0x3d')]===0x0){removeReferences(_0x37e40a,_0x1ed321);logger[_0xe4ab('0x59')](_0xe4ab('0x70'));return _0x280d00(new Error(_0xe4ab('0x70')));}var _0x5c2e38=_0x101019[_0xe4ab('0x73')](function(_0x4ab314){return _0x4ab314===_0xe4ab('0x74');});if(!_0x5c2e38){return _0x280d00(new Error(_0xe4ab('0x75')));}var _0x24e4f4=fs[_0xe4ab('0x76')](path['join'](_0x1ed321,_0x5a5052[0x0],_0xe4ab('0x74')));var _0x326c7a=JSON['parse'](_0x24e4f4);if('undefined'==typeof _0x326c7a['name']){return _0x280d00(new Error(_0xe4ab('0x77')));}if(_0xe4ab('0x20')==typeof _0x326c7a[_0xe4ab('0x34')]){return _0x280d00(new Error(_0xe4ab('0x78')));}if(_0xe4ab('0x20')==typeof _0x326c7a['version']){return _0x280d00(new Error(_0xe4ab('0x79')));}if(_0xe4ab('0x20')==typeof _0x326c7a[_0xe4ab('0x7a')]){return _0x280d00(new Error(_0xe4ab('0x7b')));}if(_0x326c7a['type']===_0xe4ab('0x7c')){if(_0xe4ab('0x20')==typeof _0x326c7a[_0xe4ab('0x7a')][_0xe4ab('0x7d')]){return _0x280d00(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0xe4ab('0x20')==typeof _0x326c7a[_0xe4ab('0x7a')][_0xe4ab('0x7d')]['admin']&&_0xe4ab('0x20')==typeof _0x326c7a[_0xe4ab('0x7a')][_0xe4ab('0x7d')][_0xe4ab('0x7e')]){return _0x280d00(new Error(_0xe4ab('0x7f')));}}else if(_0x326c7a[_0xe4ab('0x34')]===_0xe4ab('0x80')){if(_0xe4ab('0x20')==typeof _0x326c7a[_0xe4ab('0x7a')][_0xe4ab('0x81')]){return _0x280d00(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xe4ab('0x20')==typeof _0x326c7a[_0xe4ab('0x7a')][_0xe4ab('0x82')]){return _0x280d00(new Error(_0xe4ab('0x83')));}}else{return _0x280d00(new Error(_0xe4ab('0x84')));}var _0x4f45d8=_0x326c7a[_0xe4ab('0x2e')];var _0x78d1f3=_0x326c7a[_0xe4ab('0x85')];var _0x56cbac=_0x326c7a[_0xe4ab('0x34')];var _0x180320=_0x326c7a[_0xe4ab('0x86')]?_0x326c7a[_0xe4ab('0x86')]:'always';var _0x1567af=_0x326c7a[_0xe4ab('0x87')]?_0x326c7a[_0xe4ab('0x87')]:_0xe4ab('0x88');var _0x3962af='';var _0xb8a067='';var _0x40a3f2='';var _0xd8a0f2='';var _0x86bfcd=_0x326c7a[_0xe4ab('0x89')];if(_0x56cbac===_0xe4ab('0x7c')){if(_0xe4ab('0x20')!=typeof _0x326c7a[_0xe4ab('0x7a')][_0xe4ab('0x7d')][_0xe4ab('0x8a')]){var _0x3786d8=_0x326c7a[_0xe4ab('0x7a')][_0xe4ab('0x7d')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xe4ab('0x8b')](_0x3786d8)){_0x3962af=path[_0xe4ab('0x4f')](_0xe4ab('0x8c'),_0x25fe99,_0x5a5052[0x0],_0x3786d8);}else{_0x3962af=_0x3786d8;}}else{logger[_0xe4ab('0x65')](_0xe4ab('0x8d'));}if('undefined'!=typeof _0x326c7a[_0xe4ab('0x7a')][_0xe4ab('0x7d')][_0xe4ab('0x7e')]){var _0xab16d5=_0x326c7a[_0xe4ab('0x7a')][_0xe4ab('0x7d')][_0xe4ab('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0xe4ab('0x8b')](_0xab16d5)){_0xb8a067=path[_0xe4ab('0x4f')](_0xe4ab('0x8c'),_0x25fe99,_0x5a5052[0x0],_0xab16d5);}else{_0xb8a067=_0xab16d5;}}else{logger[_0xe4ab('0x65')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x56cbac==='script'){_0x40a3f2=_0x326c7a[_0xe4ab('0x7a')]['scriptName'];_0xd8a0f2=_0x326c7a[_0xe4ab('0x7a')][_0xe4ab('0x82')];if('undefined'!=typeof _0x326c7a[_0xe4ab('0x7a')][_0xe4ab('0x7d')]){if(_0xe4ab('0x20')!=typeof _0x326c7a[_0xe4ab('0x7a')][_0xe4ab('0x7d')][_0xe4ab('0x8a')]){var _0x3786d8=_0x326c7a[_0xe4ab('0x7a')]['views'][_0xe4ab('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0xe4ab('0x8b')](_0x3786d8)){_0x3962af=path['join'](_0xe4ab('0x8c'),_0x25fe99,_0x5a5052[0x0],_0x3786d8);}else{_0x3962af=_0x3786d8;}}if(_0xe4ab('0x20')!=typeof _0x326c7a[_0xe4ab('0x7a')][_0xe4ab('0x7d')][_0xe4ab('0x7e')]){var _0xab16d5=_0x326c7a[_0xe4ab('0x7a')][_0xe4ab('0x7d')][_0xe4ab('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0xe4ab('0x8b')](_0xab16d5)){_0xb8a067=path[_0xe4ab('0x4f')]('plugins',_0x25fe99,_0x5a5052[0x0],_0xab16d5);}else{_0xb8a067=_0xab16d5;}}}}var _0x37a58d={'name':_0x4f45d8,'description':_0x78d1f3,'path':path[_0xe4ab('0x4f')](_0x25fe99,_0x5a5052[0x0]),'type':_0x56cbac,'sidebar':_0x180320,'icon':_0x1567af,'adminUrl':_0x3962af,'agentUrl':_0xb8a067,'scriptName':_0x40a3f2,'scriptPath':_0xd8a0f2,'version':_0x86bfcd};removeReferences(_0x37e40a,null);return db['Plugin'][_0xe4ab('0x8e')](_0x37a58d)[_0xe4ab('0x28')](function(_0x2d01e8){var _0x239d6c={'role':_0x55d6de[_0xe4ab('0x8f')]['role'],'userProfileId':_0x55d6de[_0xe4ab('0x8f')][_0xe4ab('0x90')]};if(!_0x239d6c)throw new Error(_0xe4ab('0x91'));if(_0x239d6c['role']===_0xe4ab('0x92')){var _0x18eff5=_0x2d01e8['get']({'plain':!![]});return db['UserProfileSection'][_0xe4ab('0x4d')]({'where':{'name':'Plugins','userProfileId':_0x239d6c['userProfileId']},'raw':!![]})[_0xe4ab('0x28')](function(_0x4dddc7){if(_0x4dddc7&&_0x4dddc7[_0xe4ab('0x93')]===0x0){return db[_0xe4ab('0x2c')][_0xe4ab('0x8e')]({'name':_0x18eff5[_0xe4ab('0x2e')],'resourceId':_0x18eff5['id'],'type':_0x4dddc7[_0xe4ab('0x2e')],'sectionId':_0x4dddc7['id']},{})[_0xe4ab('0x28')](function(){return _0x2d01e8;});}else{return _0x2d01e8;}})[_0xe4ab('0x49')](function(_0x101f9){logger[_0xe4ab('0x59')](_0xe4ab('0x94'),_0x101f9);throw _0x101f9;});}return _0x2d01e8;})[_0xe4ab('0x28')](respondWithResult(_0x2d2a32,null))['catch'](handleError(_0x2d2a32,null));}});}catch(_0x366eb9){_0x2d2a32['status'](0x1f4)[_0xe4ab('0x2f')](_0x366eb9);}};function removeReferences(_0x369ff3,_0x3f546d){try{if(_0x369ff3){fs[_0xe4ab('0x95')](_0x369ff3);logger['info'](_0xe4ab('0x96'));}if(_0x3f546d){rimraf(_0x3f546d,function(){});logger[_0xe4ab('0x65')](_0xe4ab('0x97'));}}catch(_0x3cbf21){logger[_0xe4ab('0x59')](_0x3cbf21);}}exports[_0xe4ab('0x27')]=function(_0x3da261,_0x5e04ce,_0x5e0fa3){return db[_0xe4ab('0x47')][_0xe4ab('0x4d')]({'where':{'id':_0x3da261['params']['id']}})['then'](handleEntityNotFound(_0x5e04ce,null))[_0xe4ab('0x28')](saveUpdates(_0x3da261[_0xe4ab('0x8f')],null))[_0xe4ab('0x28')](respondWithResult(_0x5e04ce,null))[_0xe4ab('0x49')](handleError(_0x5e04ce,null));};exports['delete']=function(_0x4ae7c5,_0x126272,_0x4a4fb8){return db['Plugin'][_0xe4ab('0x4d')]({'where':{'id':_0x4ae7c5[_0xe4ab('0x4b')]['id']}})['then'](function(_0x4267c1){if(_0x4267c1){return _0x4267c1[_0xe4ab('0x29')]();}})['then'](function(_0x8aabc7){rimraf(path[_0xe4ab('0x4f')](config['root'],_0xe4ab('0x51'),path['dirname'](_0x8aabc7[_0xe4ab('0x53')])),function(){});return _0x8aabc7;})[_0xe4ab('0x28')](handleEntityNotFound(_0x126272,null))[_0xe4ab('0x28')](respondWithStatusCode(_0x126272,null))['catch'](handleError(_0x126272,null));};exports[_0xe4ab('0x98')]=function(_0x23366b,_0x2788fd,_0x2d1b88){return BPromise['resolve']()['then'](function(){if(!_0x23366b[_0xe4ab('0x36')][_0xe4ab('0x53')]){throw new Error(_0xe4ab('0x99'));}if(!_0x23366b['query'][_0xe4ab('0x9a')]){throw new Error(_0xe4ab('0x9b'));}var _0x445ddf=_0x23366b[_0xe4ab('0x36')][_0xe4ab('0x9c')]?_0x23366b[_0xe4ab('0x36')]['hostname']+':'+_0x23366b[_0xe4ab('0x36')][_0xe4ab('0x9a')]:'http://localhost:'+_0x23366b[_0xe4ab('0x36')][_0xe4ab('0x9a')];var _0x2022c9=_0x23366b[_0xe4ab('0x36')][_0xe4ab('0x1f')]?_0x23366b['query'][_0xe4ab('0x1f')]:!![];var _0x5ee07e=_0x23366b[_0xe4ab('0x36')]['encoding']?_0x23366b['query'][_0xe4ab('0x9d')]:null;var _0x3a79e7={'method':_0x23366b['method'],'uri':util[_0xe4ab('0x63')](_0xe4ab('0x9e'),_0x445ddf,_0x23366b['query'][_0xe4ab('0x53')]),'json':_0x2022c9,'resolveWithFullResponse':!![],'encoding':_0x5ee07e,'qs':_0x23366b[_0xe4ab('0x36')]};if(_0x23366b[_0xe4ab('0x9f')]){_0x3a79e7[_0xe4ab('0x9f')]=_0x23366b['headers'];if(_0x3a79e7[_0xe4ab('0x9f')][_0xe4ab('0xa0')]){delete _0x3a79e7[_0xe4ab('0x9f')][_0xe4ab('0xa0')];}}if(_0x3a79e7['headers'][_0xe4ab('0xa1')]){delete _0x3a79e7[_0xe4ab('0x9f')]['content-type'];}return rp(_0x3a79e7);})[_0xe4ab('0x28')](function(_0x422b18){if(_0x422b18){_0x2788fd[_0xe4ab('0xa2')](_0x422b18[_0xe4ab('0x9f')]);logger[_0xe4ab('0x65')](_0x422b18[_0xe4ab('0x8f')]);if(_[_0xe4ab('0xa3')](_0x23366b[_0xe4ab('0x36')][_0xe4ab('0x53')],_0xe4ab('0x4e'))&&_0x422b18['statusCode']==0x1f4){return _0x2788fd[_0xe4ab('0x1c')](_0x422b18[_0xe4ab('0xa4')]);}else{return _0x2788fd[_0xe4ab('0x1e')](_0x422b18[_0xe4ab('0xa4')])[_0xe4ab('0x2f')](_0x422b18[_0xe4ab('0x8f')]);}}else{return _0x2788fd[_0xe4ab('0x1c')](0xc8);}})[_0xe4ab('0x49')](handleError(_0x2788fd,null));};exports[_0xe4ab('0xa5')]=function(_0x5c4f5d,_0x3f196f,_0x14595a){return BPromise['resolve']()[_0xe4ab('0x28')](function(){if(!_0x5c4f5d[_0xe4ab('0x36')][_0xe4ab('0x53')]){throw new Error(_0xe4ab('0x99'));}if(!_0x5c4f5d['query'][_0xe4ab('0x9a')]){throw new Error(_0xe4ab('0x9b'));}var _0x3e46b0=_0x5c4f5d['query'][_0xe4ab('0x9c')]?_0x5c4f5d[_0xe4ab('0x36')][_0xe4ab('0x9c')]+':'+_0x5c4f5d['query'][_0xe4ab('0x9a')]:_0xe4ab('0xa6')+_0x5c4f5d[_0xe4ab('0x36')][_0xe4ab('0x9a')];var _0x1f5704=_0x5c4f5d[_0xe4ab('0x36')]['json']?_0x5c4f5d[_0xe4ab('0x36')]['json']:!![];var _0x32be8b=_0x5c4f5d[_0xe4ab('0x36')]['encoding']?_0x5c4f5d[_0xe4ab('0x36')][_0xe4ab('0x9d')]:null;var _0x2c281a={'method':_0x5c4f5d[_0xe4ab('0xa7')],'uri':util[_0xe4ab('0x63')](_0xe4ab('0x9e'),_0x3e46b0,_0x5c4f5d[_0xe4ab('0x36')][_0xe4ab('0x53')]),'json':_0x1f5704,'resolveWithFullResponse':!![],'encoding':_0x32be8b,'body':_0x5c4f5d[_0xe4ab('0x8f')]};if(_0x5c4f5d[_0xe4ab('0x9f')]){_0x2c281a[_0xe4ab('0x9f')]=_0x5c4f5d[_0xe4ab('0x9f')];if(_0x2c281a[_0xe4ab('0x9f')][_0xe4ab('0xa0')]){delete _0x2c281a[_0xe4ab('0x9f')]['content-length'];}}if(_0x2c281a[_0xe4ab('0x9f')][_0xe4ab('0xa1')]){delete _0x2c281a[_0xe4ab('0x9f')]['content-type'];}return rp(_0x2c281a);})[_0xe4ab('0x28')](function(_0x4202ed){if(_0x4202ed){_0x3f196f['set'](_0x4202ed['headers']);logger[_0xe4ab('0x65')](_0x4202ed['body']);return _0x3f196f['status'](_0x4202ed['statusCode'])[_0xe4ab('0x2f')](_0x4202ed[_0xe4ab('0x8f')]);}else{return _0x3f196f[_0xe4ab('0x1c')](0xc8);}})[_0xe4ab('0x49')](handleError(_0x3f196f,null));}; \ No newline at end of file +var _0x53a1=['params','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-type','set','endsWith','statusCode','content-length','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','fs-extra','lodash','squel','jsforce','papaparse','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./plugin.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','get','Plugins','UserProfileResource','destroy','stack','name','index','Plugin','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','keys','find','path','root','server/files/plugins','format','%s.zip','createWriteStream','zip','ENOENT','Sequelize','Error','error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','join','dirname','basename','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','info','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','Plugin\x20manifest\x20missing','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','html','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','test','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','update'];(function(_0x14c360,_0x25c14d){var _0x2e3578=function(_0x529d0b){while(--_0x529d0b){_0x14c360['push'](_0x14c360['shift']());}};_0x2e3578(++_0x25c14d);}(_0x53a1,0xbd));var _0x153a=function(_0x318339,_0x4f1425){_0x318339=_0x318339-0x0;var _0x46c15c=_0x53a1[_0x318339];return _0x46c15c;};'use strict';var emlformat=require(_0x153a('0x0'));var rimraf=require(_0x153a('0x1'));var zipdir=require(_0x153a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x153a('0x3'));var moment=require(_0x153a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x153a('0x5'));var util=require(_0x153a('0x6'));var path=require('path');var sox=require(_0x153a('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x153a('0x8'));var _=require(_0x153a('0x9'));var squel=require(_0x153a('0xa'));var crypto=require('crypto');var jsforce=require(_0x153a('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x153a('0xc'));var extract=require('extract-zip');var rimraf=require(_0x153a('0x1'));var archiver=require(_0x153a('0xd'));var Redis=require(_0x153a('0xe'));var authService=require(_0x153a('0xf'));var qs=require(_0x153a('0x10'));var as=require(_0x153a('0x11'));var hardwareService=require(_0x153a('0x12'));var logger=require(_0x153a('0x13'))('api');var utils=require(_0x153a('0x14'));var config=require(_0x153a('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x153a('0x16'))['db'];config['redis']=_[_0x153a('0x17')](config[_0x153a('0x18')],{'host':_0x153a('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x153a('0x18')]));require(_0x153a('0x1a'))[_0x153a('0x1b')](socket);function respondWithStatusCode(_0xe3fc16,_0x4bba69){_0x4bba69=_0x4bba69||0xcc;return function(_0x1f76bd){if(_0x1f76bd){return _0xe3fc16[_0x153a('0x1c')](_0x4bba69);}return _0xe3fc16['status'](_0x4bba69)[_0x153a('0x1d')]();};}function respondWithResult(_0x33ad84,_0x33e7cf){_0x33e7cf=_0x33e7cf||0xc8;return function(_0x1fe88b){if(_0x1fe88b){return _0x33ad84[_0x153a('0x1e')](_0x33e7cf)[_0x153a('0x1f')](_0x1fe88b);}};}function respondWithFilteredResult(_0x291bbc,_0x4f686c){return function(_0x12c774){if(_0x12c774){var _0x383eab=typeof _0x4f686c[_0x153a('0x20')]===_0x153a('0x21')&&typeof _0x4f686c[_0x153a('0x22')]===_0x153a('0x21');var _0x4a1c52=_0x12c774[_0x153a('0x23')];var _0x1bb2c6=_0x383eab?0x0:_0x4f686c[_0x153a('0x20')];var _0x57d757=_0x383eab?_0x12c774['count']:_0x4f686c[_0x153a('0x20')]+_0x4f686c['limit'];var _0x382363;if(_0x57d757>=_0x4a1c52){_0x57d757=_0x4a1c52;_0x382363=0xc8;}else{_0x382363=0xce;}_0x291bbc[_0x153a('0x1e')](_0x382363);return _0x291bbc['set'](_0x153a('0x24'),_0x1bb2c6+'-'+_0x57d757+'/'+_0x4a1c52)['json'](_0x12c774);}return null;};}function patchUpdates(_0x4d14dc){return function(_0x8bc92a){try{jsonpatch[_0x153a('0x25')](_0x8bc92a,_0x4d14dc,!![]);}catch(_0x54dd48){return BPromise[_0x153a('0x26')](_0x54dd48);}return _0x8bc92a[_0x153a('0x27')]();};}function saveUpdates(_0x256b7d,_0x1f4e94){return function(_0x433464){if(_0x433464){return _0x433464['update'](_0x256b7d)[_0x153a('0x28')](function(_0xaa6481){return _0xaa6481;});}return null;};}function removeEntity(_0x1df540,_0x506ffc){return function(_0x23daa7){if(_0x23daa7){return _0x23daa7['destroy']()['then'](function(){var _0x3dfc25=_0x23daa7[_0x153a('0x29')]({'plain':!![]});var _0x5a3112=_0x153a('0x2a');return db[_0x153a('0x2b')][_0x153a('0x2c')]({'where':{'type':_0x5a3112,'resourceId':_0x3dfc25['id']}})[_0x153a('0x28')](function(){return _0x23daa7;});})[_0x153a('0x28')](function(){_0x1df540['status'](0xcc)[_0x153a('0x1d')]();});}};}function handleEntityNotFound(_0x5990dc,_0x6fc6f7){return function(_0x51d4ec){if(!_0x51d4ec){_0x5990dc['sendStatus'](0x194);}return _0x51d4ec;};}function handleError(_0x180e65,_0x51893e){_0x51893e=_0x51893e||0x1f4;return function(_0x17e093){logger['error'](_0x17e093[_0x153a('0x2d')]);if(_0x17e093[_0x153a('0x2e')]){delete _0x17e093['name'];}_0x180e65['status'](_0x51893e)['send'](_0x17e093);};}exports[_0x153a('0x2f')]=function(_0x1140d5,_0x98b2ef){var _0x186e2c={},_0x1cca82={},_0x3a9118={'count':0x0,'rows':[]};var _0x320e6e=_['map'](db[_0x153a('0x30')]['rawAttributes'],function(_0x5b8e30){return{'name':_0x5b8e30['fieldName'],'type':_0x5b8e30['type'][_0x153a('0x31')]};});_0x1cca82[_0x153a('0x32')]=_[_0x153a('0x33')](_0x320e6e,'name');_0x1cca82[_0x153a('0x34')]=_['keys'](_0x1140d5[_0x153a('0x34')]);_0x1cca82[_0x153a('0x35')]=_[_0x153a('0x36')](_0x1cca82['model'],_0x1cca82[_0x153a('0x34')]);_0x186e2c[_0x153a('0x37')]=_[_0x153a('0x36')](_0x1cca82[_0x153a('0x32')],qs[_0x153a('0x38')](_0x1140d5[_0x153a('0x34')][_0x153a('0x38')]));_0x186e2c['attributes']=_0x186e2c[_0x153a('0x37')][_0x153a('0x39')]?_0x186e2c[_0x153a('0x37')]:_0x1cca82[_0x153a('0x32')];if(!_0x1140d5[_0x153a('0x34')]['hasOwnProperty'](_0x153a('0x3a'))){_0x186e2c[_0x153a('0x22')]=qs[_0x153a('0x22')](_0x1140d5[_0x153a('0x34')][_0x153a('0x22')]);_0x186e2c['offset']=qs[_0x153a('0x20')](_0x1140d5['query'][_0x153a('0x20')]);}_0x186e2c[_0x153a('0x3b')]=qs[_0x153a('0x3c')](_0x1140d5[_0x153a('0x34')][_0x153a('0x3c')]);_0x186e2c['where']=qs['filters'](_[_0x153a('0x3d')](_0x1140d5['query'],_0x1cca82['filters']),_0x320e6e);if(_0x1140d5[_0x153a('0x34')]['filter']){_0x186e2c[_0x153a('0x3e')]=_[_0x153a('0x3f')](_0x186e2c[_0x153a('0x3e')],{'$or':_['map'](_0x320e6e,function(_0x5bcb0f){if(_0x5bcb0f[_0x153a('0x40')]!==_0x153a('0x41')){var _0x15a442={};_0x15a442[_0x5bcb0f[_0x153a('0x2e')]]={'$like':'%'+_0x1140d5['query'][_0x153a('0x42')]+'%'};return _0x15a442;}})});}_0x186e2c=_['merge']({},_0x186e2c,_0x1140d5[_0x153a('0x43')]);var _0x1684d9={'where':_0x186e2c[_0x153a('0x3e')]};return db[_0x153a('0x30')][_0x153a('0x23')](_0x1684d9)[_0x153a('0x28')](function(_0x15ac03){_0x3a9118[_0x153a('0x23')]=_0x15ac03;if(_0x1140d5[_0x153a('0x34')][_0x153a('0x44')]){_0x186e2c['include']=[{'all':!![]}];}return db[_0x153a('0x30')][_0x153a('0x45')](_0x186e2c);})[_0x153a('0x28')](function(_0xf16e98){_0x3a9118[_0x153a('0x46')]=_0xf16e98;return _0x3a9118;})[_0x153a('0x28')](respondWithFilteredResult(_0x98b2ef,_0x186e2c))[_0x153a('0x47')](handleError(_0x98b2ef,null));};exports[_0x153a('0x48')]=function(_0x2e3f4b,_0x4da7fd){var _0x4ad98c={'raw':!![],'where':{'id':_0x2e3f4b['params']['id']}},_0x2ab9cc={};_0x2ab9cc[_0x153a('0x32')]=_[_0x153a('0x49')](db[_0x153a('0x30')]['rawAttributes']);_0x2ab9cc[_0x153a('0x34')]=_[_0x153a('0x49')](_0x2e3f4b[_0x153a('0x34')]);_0x2ab9cc['filters']=_[_0x153a('0x36')](_0x2ab9cc['model'],_0x2ab9cc[_0x153a('0x34')]);_0x4ad98c[_0x153a('0x37')]=_[_0x153a('0x36')](_0x2ab9cc[_0x153a('0x32')],qs[_0x153a('0x38')](_0x2e3f4b[_0x153a('0x34')]['fields']));_0x4ad98c[_0x153a('0x37')]=_0x4ad98c[_0x153a('0x37')][_0x153a('0x39')]?_0x4ad98c['attributes']:_0x2ab9cc[_0x153a('0x32')];if(_0x2e3f4b['query'][_0x153a('0x44')]){_0x4ad98c['include']=[{'all':!![]}];}_0x4ad98c=_['merge']({},_0x4ad98c,_0x2e3f4b[_0x153a('0x43')]);return db['Plugin'][_0x153a('0x4a')](_0x4ad98c)[_0x153a('0x28')](handleEntityNotFound(_0x4da7fd,null))[_0x153a('0x28')](respondWithResult(_0x4da7fd,null))['catch'](handleError(_0x4da7fd,null));};exports['download']=function(_0x597693,_0x2c678b,_0x43cde8){return db['Plugin'][_0x153a('0x4a')]({'where':{'id':_0x597693['params']['id']},'attributes':[_0x153a('0x2e'),_0x153a('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x2c678b,null))[_0x153a('0x28')](function(_0x5afc5e){if(_0x5afc5e){var _0x2a58f3=path['join'](config[_0x153a('0x4c')],_0x153a('0x4d'),util[_0x153a('0x4e')](_0x153a('0x4f'),path['basename'](_0x5afc5e[_0x153a('0x4b')])));var _0x401a5b=fs[_0x153a('0x50')](_0x2a58f3);var _0x247d3e=archiver(_0x153a('0x51'),{'zlib':{'level':0x9}});_0x247d3e['on']('warning',function(_0x4287b2){if(_0x4287b2['code']===_0x153a('0x52')){logger['error'](_0x4287b2);}else{throw new db[(_0x153a('0x53'))][(_0x153a('0x54'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x247d3e['on'](_0x153a('0x55'),function(_0x22fb72){throw new db['Sequelize'][(_0x153a('0x54'))](_0x153a('0x56'));});_0x247d3e[_0x153a('0x57')](_0x401a5b);_0x247d3e[_0x153a('0x58')](_0x153a('0x59'),{'cwd':path[_0x153a('0x5a')](config[_0x153a('0x4c')],_0x153a('0x4d'),path[_0x153a('0x5b')](_0x5afc5e[_0x153a('0x4b')])),'ignore':[path[_0x153a('0x5a')](path[_0x153a('0x5c')](_0x5afc5e[_0x153a('0x4b')]),_0x153a('0x5d')),path[_0x153a('0x5a')](path[_0x153a('0x5c')](_0x5afc5e[_0x153a('0x4b')]),_0x153a('0x5e'))],'nodir':!![]})[_0x153a('0x5f')]();_0x401a5b['on'](_0x153a('0x60'),function(){if(!fs[_0x153a('0x61')](_0x2a58f3)){throw new db[(_0x153a('0x53'))][(_0x153a('0x54'))](_0x153a('0x62'));}return _0x2c678b[_0x153a('0x63')](_0x2a58f3,util[_0x153a('0x4e')](_0x153a('0x4f'),path[_0x153a('0x5c')](_0x5afc5e[_0x153a('0x4b')])),function(_0x5d88d9){if(_0x5d88d9){throw new db[(_0x153a('0x53'))]['Error'](_0x153a('0x64'));}fs['unlinkSync'](_0x2a58f3);logger[_0x153a('0x65')]('Download\x20completed');logger[_0x153a('0x65')]('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x2c678b,null));};exports[_0x153a('0x66')]=function(_0x8ff28c,_0x209378,_0x1a65f4){var _0x266c9d=path[_0x153a('0x5c')](_0x8ff28c[_0x153a('0x67')][_0x153a('0x68')],path[_0x153a('0x69')](_0x8ff28c[_0x153a('0x67')]['filename']));var _0x1aa234=path[_0x153a('0x5a')](config[_0x153a('0x4c')],_0x153a('0x4d'),_0x8ff28c['file'][_0x153a('0x68')]);var _0x32be32=path[_0x153a('0x5a')](config[_0x153a('0x4c')],'server/files/plugins',_0x266c9d);logger[_0x153a('0x65')](_0x153a('0x6a'),_0x1aa234);logger[_0x153a('0x65')](_0x153a('0x6b'),_0x32be32);try{fs[_0x153a('0x6c')](_0x1aa234,parseInt(_0x153a('0x6d'),0x8));extract(_0x1aa234,{'dir':_0x32be32},function(_0x2cb802){if(_0x2cb802){logger['error'](_0x2cb802);handleError(_0x2cb802,!![]);};var _0x41c889=fs[_0x153a('0x6e')](_0x32be32);if(_0x41c889[_0x153a('0x39')]>0x1){removeReferences(_0x1aa234,_0x32be32);logger['error'](_0x153a('0x6f'));return _0x1a65f4(new Error(_0x153a('0x6f')));}var _0x574a00=fs[_0x153a('0x70')](path[_0x153a('0x5a')](_0x32be32,_0x41c889[0x0]));if(_0x574a00[_0x153a('0x71')]()){removeReferences(_0x1aa234,_0x32be32);logger[_0x153a('0x55')](_0x153a('0x6f'));return _0x1a65f4(new Error(_0x153a('0x6f')));}if(_0x574a00[_0x153a('0x72')]()){var _0x570e1a=fs['readdirSync'](path[_0x153a('0x5a')](_0x32be32,_0x41c889[0x0]));if(_0x570e1a['length']===0x0){removeReferences(_0x1aa234,_0x32be32);logger[_0x153a('0x55')](_0x153a('0x6f'));return _0x1a65f4(new Error(_0x153a('0x6f')));}var _0x509021=_0x570e1a[_0x153a('0x73')](function(_0x5ec7b8){return _0x5ec7b8==='manifest.json';});if(!_0x509021){return _0x1a65f4(new Error(_0x153a('0x74')));}var _0x25ac3f=fs['readFileSync'](path[_0x153a('0x5a')](_0x32be32,_0x41c889[0x0],_0x153a('0x75')));var _0xc15eb9=JSON[_0x153a('0x76')](_0x25ac3f);if(_0x153a('0x21')==typeof _0xc15eb9[_0x153a('0x2e')]){return _0x1a65f4(new Error(_0x153a('0x77')));}if(_0x153a('0x21')==typeof _0xc15eb9[_0x153a('0x40')]){return _0x1a65f4(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x153a('0x21')==typeof _0xc15eb9[_0x153a('0x78')]){return _0x1a65f4(new Error(_0x153a('0x79')));}if(_0x153a('0x21')==typeof _0xc15eb9[_0x153a('0x7a')]){return _0x1a65f4(new Error(_0x153a('0x7b')));}if(_0xc15eb9[_0x153a('0x40')]==='html'){if('undefined'==typeof _0xc15eb9['parameters']['views']){return _0x1a65f4(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x153a('0x21')==typeof _0xc15eb9['parameters'][_0x153a('0x7c')][_0x153a('0x7d')]&&'undefined'==typeof _0xc15eb9[_0x153a('0x7a')][_0x153a('0x7c')][_0x153a('0x7e')]){return _0x1a65f4(new Error(_0x153a('0x7f')));}}else if(_0xc15eb9['type']===_0x153a('0x80')){if(_0x153a('0x21')==typeof _0xc15eb9[_0x153a('0x7a')][_0x153a('0x81')]){return _0x1a65f4(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0xc15eb9[_0x153a('0x7a')][_0x153a('0x82')]){return _0x1a65f4(new Error(_0x153a('0x83')));}}else{return _0x1a65f4(new Error(_0x153a('0x84')));}var _0x466ad0=_0xc15eb9[_0x153a('0x2e')];var _0x2dcf8e=_0xc15eb9[_0x153a('0x85')];var _0x390865=_0xc15eb9[_0x153a('0x40')];var _0x5eaf0=_0xc15eb9[_0x153a('0x86')]?_0xc15eb9[_0x153a('0x86')]:_0x153a('0x87');var _0x44ffcf=_0xc15eb9['icon']?_0xc15eb9[_0x153a('0x88')]:_0x153a('0x89');var _0x342192='';var _0xcda0de='';var _0x549fa5='';var _0x324a1e='';var _0x42cc9d=_0xc15eb9[_0x153a('0x78')];if(_0x390865===_0x153a('0x8a')){if(_0x153a('0x21')!=typeof _0xc15eb9[_0x153a('0x7a')][_0x153a('0x7c')][_0x153a('0x7d')]){var _0x2c780c=_0xc15eb9[_0x153a('0x7a')][_0x153a('0x7c')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x2c780c)){_0x342192=path[_0x153a('0x5a')](_0x153a('0x8b'),_0x266c9d,_0x41c889[0x0],_0x2c780c);}else{_0x342192=_0x2c780c;}}else{logger[_0x153a('0x65')](_0x153a('0x8c'));}if(_0x153a('0x21')!=typeof _0xc15eb9[_0x153a('0x7a')][_0x153a('0x7c')][_0x153a('0x7e')]){var _0x1be83f=_0xc15eb9[_0x153a('0x7a')][_0x153a('0x7c')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x1be83f)){_0xcda0de=path[_0x153a('0x5a')](_0x153a('0x8b'),_0x266c9d,_0x41c889[0x0],_0x1be83f);}else{_0xcda0de=_0x1be83f;}}else{logger[_0x153a('0x65')](_0x153a('0x8d'));}}else if(_0x390865===_0x153a('0x80')){_0x549fa5=_0xc15eb9[_0x153a('0x7a')]['scriptName'];_0x324a1e=_0xc15eb9[_0x153a('0x7a')][_0x153a('0x82')];if(_0x153a('0x21')!=typeof _0xc15eb9[_0x153a('0x7a')][_0x153a('0x7c')]){if(_0x153a('0x21')!=typeof _0xc15eb9[_0x153a('0x7a')]['views'][_0x153a('0x7d')]){var _0x2c780c=_0xc15eb9[_0x153a('0x7a')][_0x153a('0x7c')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x153a('0x8e')](_0x2c780c)){_0x342192=path[_0x153a('0x5a')](_0x153a('0x8b'),_0x266c9d,_0x41c889[0x0],_0x2c780c);}else{_0x342192=_0x2c780c;}}if('undefined'!=typeof _0xc15eb9[_0x153a('0x7a')][_0x153a('0x7c')][_0x153a('0x7e')]){var _0x1be83f=_0xc15eb9[_0x153a('0x7a')][_0x153a('0x7c')][_0x153a('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x153a('0x8e')](_0x1be83f)){_0xcda0de=path['join'](_0x153a('0x8b'),_0x266c9d,_0x41c889[0x0],_0x1be83f);}else{_0xcda0de=_0x1be83f;}}}}var _0x19afa0={'name':_0x466ad0,'description':_0x2dcf8e,'path':path[_0x153a('0x5a')](_0x266c9d,_0x41c889[0x0]),'type':_0x390865,'sidebar':_0x5eaf0,'icon':_0x44ffcf,'adminUrl':_0x342192,'agentUrl':_0xcda0de,'scriptName':_0x549fa5,'scriptPath':_0x324a1e,'version':_0x42cc9d};removeReferences(_0x1aa234,null);return db[_0x153a('0x30')]['create'](_0x19afa0)[_0x153a('0x28')](function(_0x3d5b07){var _0x5c1d94={'role':_0x8ff28c[_0x153a('0x8f')]['role'],'userProfileId':_0x8ff28c['body'][_0x153a('0x90')]};if(!_0x5c1d94)throw new Error(_0x153a('0x91'));if(_0x5c1d94[_0x153a('0x92')]===_0x153a('0x93')){var _0x282810=_0x3d5b07[_0x153a('0x29')]({'plain':!![]});return db[_0x153a('0x94')][_0x153a('0x4a')]({'where':{'name':_0x153a('0x2a'),'userProfileId':_0x5c1d94[_0x153a('0x90')]},'raw':!![]})['then'](function(_0x327af2){if(_0x327af2&&_0x327af2['autoAssociation']===0x0){return db[_0x153a('0x2b')][_0x153a('0x95')]({'name':_0x282810[_0x153a('0x2e')],'resourceId':_0x282810['id'],'type':_0x327af2[_0x153a('0x2e')],'sectionId':_0x327af2['id']},{})[_0x153a('0x28')](function(){return _0x3d5b07;});}else{return _0x3d5b07;}})[_0x153a('0x47')](function(_0x2df687){logger['error'](_0x153a('0x96'),_0x2df687);throw _0x2df687;});}return _0x3d5b07;})[_0x153a('0x28')](respondWithResult(_0x209378,null))[_0x153a('0x47')](handleError(_0x209378,null));}});}catch(_0x795571){_0x209378['status'](0x1f4)[_0x153a('0x97')](_0x795571);}};function removeReferences(_0x42fba3,_0x54af37){try{if(_0x42fba3){fs['unlinkSync'](_0x42fba3);logger[_0x153a('0x65')]('Zip\x20archive\x20removed');}if(_0x54af37){rimraf(_0x54af37,function(){});logger['info']('Extracted\x20folder\x20removed');}}catch(_0x5c4a67){logger[_0x153a('0x55')](_0x5c4a67);}}exports[_0x153a('0x98')]=function(_0x44d269,_0x3170d2,_0x11ffa5){return db[_0x153a('0x30')][_0x153a('0x4a')]({'where':{'id':_0x44d269[_0x153a('0x99')]['id']}})[_0x153a('0x28')](handleEntityNotFound(_0x3170d2,null))['then'](saveUpdates(_0x44d269[_0x153a('0x8f')],null))['then'](respondWithResult(_0x3170d2,null))['catch'](handleError(_0x3170d2,null));};exports[_0x153a('0x9a')]=function(_0x26d8a2,_0x8c9d9,_0x39efad){return db['Plugin']['find']({'where':{'id':_0x26d8a2['params']['id']}})['then'](function(_0x5c5c22){if(_0x5c5c22){return _0x5c5c22['destroy']();}})['then'](function(_0x38247b){rimraf(path[_0x153a('0x5a')](config[_0x153a('0x4c')],_0x153a('0x4d'),path[_0x153a('0x5b')](_0x38247b['path'])),function(){});return _0x38247b;})[_0x153a('0x28')](handleEntityNotFound(_0x8c9d9,null))[_0x153a('0x28')](respondWithStatusCode(_0x8c9d9,null))[_0x153a('0x47')](handleError(_0x8c9d9,null));};exports[_0x153a('0x9b')]=function(_0x3dc2c8,_0x1c4873,_0x33c1ea){return BPromise[_0x153a('0x9c')]()[_0x153a('0x28')](function(){if(!_0x3dc2c8[_0x153a('0x34')][_0x153a('0x4b')]){throw new Error(_0x153a('0x9d'));}if(!_0x3dc2c8[_0x153a('0x34')]['port']){throw new Error(_0x153a('0x9e'));}var _0x1408c6=_0x3dc2c8[_0x153a('0x34')][_0x153a('0x9f')]?_0x3dc2c8[_0x153a('0x34')][_0x153a('0x9f')]+':'+_0x3dc2c8[_0x153a('0x34')][_0x153a('0xa0')]:_0x153a('0xa1')+_0x3dc2c8[_0x153a('0x34')][_0x153a('0xa0')];var _0xa30236=_0x3dc2c8[_0x153a('0x34')][_0x153a('0x1f')]?_0x3dc2c8[_0x153a('0x34')][_0x153a('0x1f')]:!![];var _0x2a315d=_0x3dc2c8[_0x153a('0x34')][_0x153a('0xa2')]?_0x3dc2c8[_0x153a('0x34')][_0x153a('0xa2')]:null;var _0x1ab417={'method':_0x3dc2c8[_0x153a('0xa3')],'uri':util[_0x153a('0x4e')](_0x153a('0xa4'),_0x1408c6,_0x3dc2c8[_0x153a('0x34')][_0x153a('0x4b')]),'json':_0xa30236,'resolveWithFullResponse':!![],'encoding':_0x2a315d,'qs':_0x3dc2c8[_0x153a('0x34')]};if(_0x3dc2c8['headers']){_0x1ab417[_0x153a('0xa5')]=_0x3dc2c8[_0x153a('0xa5')];if(_0x1ab417[_0x153a('0xa5')]['content-length']){delete _0x1ab417[_0x153a('0xa5')]['content-length'];}}if(_0x1ab417[_0x153a('0xa5')][_0x153a('0xa6')]){delete _0x1ab417[_0x153a('0xa5')]['content-type'];}return rp(_0x1ab417);})[_0x153a('0x28')](function(_0x1ff2b9){if(_0x1ff2b9){_0x1c4873[_0x153a('0xa7')](_0x1ff2b9[_0x153a('0xa5')]);logger['info'](_0x1ff2b9[_0x153a('0x8f')]);if(_[_0x153a('0xa8')](_0x3dc2c8['query'][_0x153a('0x4b')],_0x153a('0x63'))&&_0x1ff2b9[_0x153a('0xa9')]==0x1f4){return _0x1c4873['sendStatus'](_0x1ff2b9['statusCode']);}else{return _0x1c4873[_0x153a('0x1e')](_0x1ff2b9[_0x153a('0xa9')])['send'](_0x1ff2b9[_0x153a('0x8f')]);}}else{return _0x1c4873[_0x153a('0x1c')](0xc8);}})[_0x153a('0x47')](handleError(_0x1c4873,null));};exports['webhookPost']=function(_0x2ab866,_0x523387,_0x515a71){return BPromise[_0x153a('0x9c')]()[_0x153a('0x28')](function(){if(!_0x2ab866[_0x153a('0x34')][_0x153a('0x4b')]){throw new Error(_0x153a('0x9d'));}if(!_0x2ab866[_0x153a('0x34')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x2ac790=_0x2ab866['query']['hostname']?_0x2ab866['query'][_0x153a('0x9f')]+':'+_0x2ab866[_0x153a('0x34')][_0x153a('0xa0')]:_0x153a('0xa1')+_0x2ab866[_0x153a('0x34')][_0x153a('0xa0')];var _0xe5014=_0x2ab866[_0x153a('0x34')][_0x153a('0x1f')]?_0x2ab866['query'][_0x153a('0x1f')]:!![];var _0x55065d=_0x2ab866[_0x153a('0x34')][_0x153a('0xa2')]?_0x2ab866[_0x153a('0x34')]['encoding']:null;var _0x83973e={'method':_0x2ab866[_0x153a('0xa3')],'uri':util[_0x153a('0x4e')](_0x153a('0xa4'),_0x2ac790,_0x2ab866[_0x153a('0x34')][_0x153a('0x4b')]),'json':_0xe5014,'resolveWithFullResponse':!![],'encoding':_0x55065d,'body':_0x2ab866['body']};if(_0x2ab866[_0x153a('0xa5')]){_0x83973e[_0x153a('0xa5')]=_0x2ab866[_0x153a('0xa5')];if(_0x83973e[_0x153a('0xa5')][_0x153a('0xaa')]){delete _0x83973e[_0x153a('0xa5')][_0x153a('0xaa')];}}if(_0x83973e[_0x153a('0xa5')]['content-type']){delete _0x83973e[_0x153a('0xa5')]['content-type'];}return rp(_0x83973e);})['then'](function(_0x438306){if(_0x438306){_0x523387[_0x153a('0xa7')](_0x438306[_0x153a('0xa5')]);logger['info'](_0x438306[_0x153a('0x8f')]);return _0x523387[_0x153a('0x1e')](_0x438306[_0x153a('0xa9')])[_0x153a('0x97')](_0x438306[_0x153a('0x8f')]);}else{return _0x523387[_0x153a('0x1c')](0xc8);}})[_0x153a('0x47')](handleError(_0x523387,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 0360da0..feed4f7 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 _0xb422=['emit','hasOwnProperty','hook','setMaxListeners','remove'];(function(_0x4f3cf6,_0x1d8c0b){var _0x26309f=function(_0x5031c5){while(--_0x5031c5){_0x4f3cf6['push'](_0x4f3cf6['shift']());}};_0x26309f(++_0x1d8c0b);}(_0xb422,0x85));var _0x2b42=function(_0x2d959a,_0x4d8b26){_0x2d959a=_0x2d959a-0x0;var _0x2fa8d6=_0xb422[_0x2d959a];return _0x2fa8d6;};'use strict';var EventEmitter=require('events');var Plugin=require('../../mysqldb')['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x2b42('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2b42('0x1')};function emitEvent(_0x5a42d2){return function(_0x14330f,_0x5df2d3,_0x1b469f){PluginEvents['emit'](_0x5a42d2+':'+_0x14330f['id'],_0x14330f);PluginEvents[_0x2b42('0x2')](_0x5a42d2,_0x14330f);_0x1b469f(null);};}for(var e in events){if(events[_0x2b42('0x3')](e)){var event=events[e];Plugin[_0x2b42('0x4')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x323f=['save','update','remove','emit','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x1eb913,_0x2c0598){var _0x257e42=function(_0x5c29af){while(--_0x5c29af){_0x1eb913['push'](_0x1eb913['shift']());}};_0x257e42(++_0x2c0598);}(_0x323f,0x1ee));var _0xf323=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x323f[_0x484e36];return _0xafc85d;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xf323('0x0'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0xf323('0x1')](0x0);var events={'afterCreate':_0xf323('0x2'),'afterUpdate':_0xf323('0x3'),'afterDestroy':_0xf323('0x4')};function emitEvent(_0x111042){return function(_0x2c9d35,_0xb4caa8,_0x2d4750){PluginEvents[_0xf323('0x5')](_0x111042+':'+_0x2c9d35['id'],_0x2c9d35);PluginEvents[_0xf323('0x5')](_0x111042,_0x2c9d35);_0x2d4750(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0xf323('0x6')](e,emitEvent(event));}}module[_0xf323('0x7')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 122ce09..88b6c28 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 _0x0abf=['../../config/logger','bluebird','request-promise','path','../../config/environment','./plugin.attributes','exports','Plugin','plugins','util'];(function(_0x1195ab,_0x408c1f){var _0x4352e9=function(_0x52b1f4){while(--_0x52b1f4){_0x1195ab['push'](_0x1195ab['shift']());}};_0x4352e9(++_0x408c1f);}(_0x0abf,0x13f));var _0xf0ab=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x0abf[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0xf0ab('0x0'));var logger=require(_0xf0ab('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf0ab('0x2'));var rp=require(_0xf0ab('0x3'));var fs=require('fs');var path=require(_0xf0ab('0x4'));var rimraf=require('rimraf');var config=require(_0xf0ab('0x5'));var attributes=require(_0xf0ab('0x6'));module[_0xf0ab('0x7')]=function(_0x1744b4,_0x1cb00a){return _0x1744b4['define'](_0xf0ab('0x8'),attributes,{'tableName':_0xf0ab('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc99b=['rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0xc99b,0x192));var _0xbc99=function(_0x36665f,_0x4f9488){_0x36665f=_0x36665f-0x0;var _0x481d25=_0xc99b[_0x36665f];return _0x481d25;};'use strict';var _=require(_0xbc99('0x0'));var util=require('util');var logger=require(_0xbc99('0x1'))('api');var moment=require(_0xbc99('0x2'));var BPromise=require(_0xbc99('0x3'));var rp=require(_0xbc99('0x4'));var fs=require('fs');var path=require(_0xbc99('0x5'));var rimraf=require(_0xbc99('0x6'));var config=require(_0xbc99('0x7'));var attributes=require(_0xbc99('0x8'));module[_0xbc99('0x9')]=function(_0x4977b1,_0xbdce80){return _0x4977b1[_0xbc99('0xa')](_0xbc99('0xb'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index c18cf0d..54968ef 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 _0xd47f=['Plugin','body','options','raw','CreatePlugin','lodash','util','moment','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./plugin.socket','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x5877b7,_0x57d044){var _0x3a22af=function(_0x44961b){while(--_0x44961b){_0x5877b7['push'](_0x5877b7['shift']());}};_0x3a22af(++_0x57d044);}(_0xd47f,0xb9));var _0xfd47=function(_0x361805,_0x39bf7b){_0x361805=_0x361805-0x0;var _0x2066b0=_0xd47f[_0x361805];return _0x2066b0;};'use strict';var _=require(_0xfd47('0x0'));var util=require(_0xfd47('0x1'));var moment=require(_0xfd47('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfd47('0x3'));var logger=require('../../config/logger')(_0xfd47('0x4'));var config=require(_0xfd47('0x5'));var jayson=require(_0xfd47('0x6'));var client=jayson[_0xfd47('0x7')]['http']({'port':0x232a});config[_0xfd47('0x8')]=_[_0xfd47('0x9')](config[_0xfd47('0x8')],{'host':_0xfd47('0xa'),'port':0x18eb});var socket=require(_0xfd47('0xb'))(new Redis(config['redis']));require(_0xfd47('0xc'))['register'](socket);function respondWithRpcPromise(_0x13b02d,_0x38d379,_0x11fcb9){return new BPromise(function(_0x16bca0,_0x4a3a1b){return client[_0xfd47('0xd')](_0x13b02d,_0x11fcb9)[_0xfd47('0xe')](function(_0x38c5ac){logger[_0xfd47('0xf')](_0xfd47('0x10'),_0x38d379,_0xfd47('0x11'));logger[_0xfd47('0x12')]('Plugin,\x20%s,\x20%s,\x20%s',_0x38d379,_0xfd47('0x11'),JSON[_0xfd47('0x13')](_0x38c5ac));if(_0x38c5ac['error']){if(_0x38c5ac[_0xfd47('0x14')][_0xfd47('0x15')]===0x1f4){logger[_0xfd47('0x14')](_0xfd47('0x10'),_0x38d379,_0x38c5ac['error'][_0xfd47('0x16')]);return _0x4a3a1b(_0x38c5ac[_0xfd47('0x14')]['message']);}logger['error'](_0xfd47('0x10'),_0x38d379,_0x38c5ac[_0xfd47('0x14')][_0xfd47('0x16')]);return _0x16bca0(_0x38c5ac['error'][_0xfd47('0x16')]);}else{logger[_0xfd47('0xf')]('Plugin,\x20%s,\x20%s',_0x38d379,_0xfd47('0x11'));_0x16bca0(_0x38c5ac[_0xfd47('0x17')][_0xfd47('0x16')]);}})[_0xfd47('0x18')](function(_0x126e11){logger[_0xfd47('0x14')](_0xfd47('0x10'),_0x38d379,_0x126e11);_0x4a3a1b(_0x126e11);});});}exports['CreatePlugin']=function(_0x43cefe){var _0x41788b=this;return new Promise(function(_0xe764c4,_0x4d7198){return db[_0xfd47('0x19')]['create'](_0x43cefe[_0xfd47('0x1a')],{'raw':_0x43cefe[_0xfd47('0x1b')]?_0x43cefe[_0xfd47('0x1b')][_0xfd47('0x1c')]===undefined?!![]:![]:!![]})[_0xfd47('0xe')](function(_0x2d4d7e){logger[_0xfd47('0xf')](_0xfd47('0x1d'),_0x43cefe);logger[_0xfd47('0x12')](_0xfd47('0x1d'),_0x43cefe,JSON['stringify'](_0x2d4d7e));_0xe764c4(_0x2d4d7e);})[_0xfd47('0x18')](function(_0xb9bf0a){logger[_0xfd47('0x14')]('CreatePlugin',_0xb9bf0a['message'],_0x43cefe);_0x4d7198(_0x41788b[_0xfd47('0x14')](0x1f4,_0xb9bf0a['message']));});});}; \ No newline at end of file +var _0x7c9a=['error','code','Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','Plugin','create','body','raw','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./plugin.socket','register','request','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2b522e,_0xf42ddc){var _0x3ade0e=function(_0x4f5028){while(--_0x4f5028){_0x2b522e['push'](_0x2b522e['shift']());}};_0x3ade0e(++_0xf42ddc);}(_0x7c9a,0x1c5));var _0xa7c9=function(_0x280b04,_0x4af410){_0x280b04=_0x280b04-0x0;var _0x44da43=_0x7c9a[_0x280b04];return _0x44da43;};'use strict';var _=require(_0xa7c9('0x0'));var util=require(_0xa7c9('0x1'));var moment=require(_0xa7c9('0x2'));var BPromise=require('bluebird');var rs=require(_0xa7c9('0x3'));var fs=require('fs');var Redis=require(_0xa7c9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa7c9('0x5'));var logger=require(_0xa7c9('0x6'))('rpc');var config=require(_0xa7c9('0x7'));var jayson=require(_0xa7c9('0x8'));var client=jayson[_0xa7c9('0x9')][_0xa7c9('0xa')]({'port':0x232a});config[_0xa7c9('0xb')]=_[_0xa7c9('0xc')](config[_0xa7c9('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xa7c9('0xd'))(new Redis(config[_0xa7c9('0xb')]));require(_0xa7c9('0xe'))[_0xa7c9('0xf')](socket);function respondWithRpcPromise(_0x5ef5d6,_0x1ca777,_0x8d5a1e){return new BPromise(function(_0x397612,_0x3a09ec){return client[_0xa7c9('0x10')](_0x5ef5d6,_0x8d5a1e)[_0xa7c9('0x11')](function(_0x538a26){logger[_0xa7c9('0x12')]('Plugin,\x20%s,\x20%s',_0x1ca777,_0xa7c9('0x13'));logger[_0xa7c9('0x14')](_0xa7c9('0x15'),_0x1ca777,'request\x20sent',JSON[_0xa7c9('0x16')](_0x538a26));if(_0x538a26['error']){if(_0x538a26[_0xa7c9('0x17')][_0xa7c9('0x18')]===0x1f4){logger[_0xa7c9('0x17')](_0xa7c9('0x19'),_0x1ca777,_0x538a26[_0xa7c9('0x17')][_0xa7c9('0x1a')]);return _0x3a09ec(_0x538a26[_0xa7c9('0x17')][_0xa7c9('0x1a')]);}logger[_0xa7c9('0x17')](_0xa7c9('0x19'),_0x1ca777,_0x538a26['error'][_0xa7c9('0x1a')]);return _0x397612(_0x538a26['error'][_0xa7c9('0x1a')]);}else{logger[_0xa7c9('0x12')]('Plugin,\x20%s,\x20%s',_0x1ca777,_0xa7c9('0x13'));_0x397612(_0x538a26[_0xa7c9('0x1b')][_0xa7c9('0x1a')]);}})[_0xa7c9('0x1c')](function(_0x4d93c4){logger[_0xa7c9('0x17')](_0xa7c9('0x19'),_0x1ca777,_0x4d93c4);_0x3a09ec(_0x4d93c4);});});}exports[_0xa7c9('0x1d')]=function(_0x3faf30){var _0x5b4698=this;return new Promise(function(_0x12910a,_0x5a3a7f){return db[_0xa7c9('0x1e')][_0xa7c9('0x1f')](_0x3faf30[_0xa7c9('0x20')],{'raw':_0x3faf30['options']?_0x3faf30['options'][_0xa7c9('0x21')]===undefined?!![]:![]:!![]})[_0xa7c9('0x11')](function(_0x3a5e49){logger[_0xa7c9('0x12')]('CreatePlugin',_0x3faf30);logger[_0xa7c9('0x14')]('CreatePlugin',_0x3faf30,JSON[_0xa7c9('0x16')](_0x3a5e49));_0x12910a(_0x3a5e49);})[_0xa7c9('0x1c')](function(_0x256d8f){logger[_0xa7c9('0x17')](_0xa7c9('0x1d'),_0x256d8f[_0xa7c9('0x1a')],_0x3faf30);_0x5a3a7f(_0x5b4698[_0xa7c9('0x17')](0x1f4,_0x256d8f[_0xa7c9('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 157550a..e3a0960 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 _0x578d=['removeListener','register','length','./plugin.events','remove','update','emit'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x578d,0xb2));var _0xd578=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x578d[_0x3dd15e];return _0x231fd0;};'use strict';var PluginEvents=require(_0xd578('0x0'));var events=['save',_0xd578('0x1'),_0xd578('0x2')];function createListener(_0x380767,_0x3b43fb){return function(_0x3b34f5){_0x3b43fb[_0xd578('0x3')](_0x380767,_0x3b34f5);};}function removeListener(_0x30c44c,_0x1b42c6){return function(){PluginEvents[_0xd578('0x4')](_0x30c44c,_0x1b42c6);};}exports[_0xd578('0x5')]=function(_0xd03b5e){for(var _0x27779a=0x0,_0x25311e=events[_0xd578('0x6')];_0x27779a<_0x25311e;_0x27779a++){var _0x126e80=events[_0x27779a];var _0x2089e1=createListener('plugin:'+_0x126e80,_0xd03b5e);PluginEvents['on'](_0x126e80,_0x2089e1);}}; \ No newline at end of file +var _0x91bc=['./plugin.events','remove','emit','removeListener','register','length','plugin:'];(function(_0x151315,_0x21e510){var _0xa01d92=function(_0x5cc58e){while(--_0x5cc58e){_0x151315['push'](_0x151315['shift']());}};_0xa01d92(++_0x21e510);}(_0x91bc,0x1dc));var _0xc91b=function(_0xba8ce1,_0x2201a8){_0xba8ce1=_0xba8ce1-0x0;var _0x83abda=_0x91bc[_0xba8ce1];return _0x83abda;};'use strict';var PluginEvents=require(_0xc91b('0x0'));var events=['save',_0xc91b('0x1'),'update'];function createListener(_0xd96486,_0x292415){return function(_0x1d680d){_0x292415[_0xc91b('0x2')](_0xd96486,_0x1d680d);};}function removeListener(_0x29395c,_0xf01eca){return function(){PluginEvents[_0xc91b('0x3')](_0x29395c,_0xf01eca);};}exports[_0xc91b('0x4')]=function(_0x57f092){for(var _0x21c5a5=0x0,_0x5aa8d5=events[_0xc91b('0x5')];_0x21c5a5<_0x5aa8d5;_0x21c5a5++){var _0xa34fc2=events[_0x21c5a5];var _0x5b2b7d=createListener(_0xc91b('0x6')+_0xa34fc2,_0x57f092);PluginEvents['on'](_0xa34fc2,_0x5b2b7d);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 8780fb4..f8db67d 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(_0x284921,_0x491ac1){var _0x2f4ade=function(_0xe892ab){while(--_0xe892ab){_0x284921['push'](_0x284921['shift']());}};_0x2f4ade(++_0x491ac1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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(_0x5f421e,_0x2ffeb8){var _0x60645=function(_0x33b2e9){while(--_0x33b2e9){_0x5f421e['push'](_0x5f421e['shift']());}};_0x60645(++_0x2ffeb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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 86cbeee..f016087 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 _0xcea2=['then','express','motion2','length','catch','show','describe','params','create','body','script','join','../../files/plugins','cwd','chdir','dump','update','restart','stop','Unknown\x20status','delete','Unknown\x20id','lodash','../../config/logger','path','child_process','exec','status','json','stack','name','send','npm\x20install','info','index','list'];(function(_0x2b10b5,_0x5c1f2e){var _0x545669=function(_0x4208be){while(--_0x4208be){_0x2b10b5['push'](_0x2b10b5['shift']());}};_0x545669(++_0x5c1f2e);}(_0xcea2,0x15a));var _0x2cea=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xcea2[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x2cea('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x2cea('0x1'))('api');var path=require(_0x2cea('0x2'));var exec=require(_0x2cea('0x3'))[_0x2cea('0x4')];var BPromise=require('bluebird');function handleEntityNotFound(_0x3ff73f,_0x46060b){return function(_0x11596e){if(!_0x11596e){_0x3ff73f['sendStatus'](0x194);;}return _0x11596e;};}function respondWithResult(_0x34f0f2,_0x485c26){_0x485c26=_0x485c26||0xc8;return function(_0x2d69ff){if(_0x2d69ff){return _0x34f0f2[_0x2cea('0x5')](_0x485c26)[_0x2cea('0x6')](_0x2d69ff);}return null;};}function handleError(_0x160cca,_0x11c5c0){_0x11c5c0=_0x11c5c0||0x1f4;return function(_0x1519f6){logger['error'](_0x1519f6[_0x2cea('0x7')]);if(_0x1519f6[_0x2cea('0x8')]){delete _0x1519f6[_0x2cea('0x8')];}_0x160cca[_0x2cea('0x5')](_0x11c5c0)[_0x2cea('0x9')](_0x1519f6);};}function execChildProcess(){return new BPromise(function(_0x439c4d,_0x4298a4){exec(_0x2cea('0xa'),function(_0x58a102,_0x5724b0,_0x2fe9cd){logger[_0x2cea('0xb')](_0x5724b0);logger['info'](_0x2fe9cd);if(_0x58a102){logger['error'](_0x58a102);return _0x4298a4(_0x58a102);}return _0x439c4d(_0x5724b0);});});}exports[_0x2cea('0xc')]=function(_0x4e0da7,_0xa4ce3d){return pm2[_0x2cea('0xd')]()[_0x2cea('0xe')](function(_0x5cf805){if(_0x5cf805){var _0x4d7f8b=_['reject'](_0x5cf805,function(_0x369c72){return _0x369c72['name']===_0x2cea('0xf')||_0x369c72[_0x2cea('0x8')]===_0x2cea('0x10');});return{'rows':_0x4d7f8b,'count':_0x4d7f8b[_0x2cea('0x11')]};}return null;})[_0x2cea('0xe')](respondWithResult(_0xa4ce3d,null))[_0x2cea('0x12')](handleError(_0xa4ce3d,null));};exports[_0x2cea('0x13')]=function(_0x1ead4c,_0x5eee09){return pm2[_0x2cea('0x14')](_0x1ead4c[_0x2cea('0x15')]['id'])[_0x2cea('0xe')](respondWithResult(_0x5eee09,null))[_0x2cea('0xe')](handleEntityNotFound(_0x5eee09,null))[_0x2cea('0x12')](handleError(_0x5eee09,null));};exports[_0x2cea('0x16')]=function(_0x5d75c4,_0x27375b){if(_0x5d75c4['body'][_0x2cea('0x8')]&&_0x5d75c4[_0x2cea('0x17')][_0x2cea('0x18')]){var _0x4fd3d5=path[_0x2cea('0x19')](__dirname,_0x2cea('0x1a'),_0x5d75c4[_0x2cea('0x17')][_0x2cea('0x18')]);var _0x3246bc=process[_0x2cea('0x1b')]();process[_0x2cea('0x1c')](path['dirname'](_0x4fd3d5));return execChildProcess()[_0x2cea('0xe')](function(_0x5e5b46){process[_0x2cea('0x1c')](_0x3246bc);return pm2['start']({'name':_0x5d75c4[_0x2cea('0x17')][_0x2cea('0x8')],'script':_0x4fd3d5});})['then'](function(_0x41d272){pm2[_0x2cea('0x1d')]();return _0x41d272[0x0];})[_0x2cea('0xe')](respondWithResult(_0x27375b,0xc9))[_0x2cea('0x12')](handleError(_0x27375b,null));}else{return _0x27375b[_0x2cea('0x5')](0x1f4)[_0x2cea('0x9')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x2cea('0x1e')]=function(_0x32b6a3,_0x2bbe9b){if(_0x32b6a3[_0x2cea('0x17')]['id']){delete _0x32b6a3[_0x2cea('0x17')]['id'];}var _0x3ea40c={'online':_0x2cea('0x1f'),'stopped':_0x2cea('0x20')};if(_0x3ea40c['hasOwnProperty'](_0x32b6a3[_0x2cea('0x17')][_0x2cea('0x5')])){return pm2[_0x3ea40c[_0x32b6a3['body'][_0x2cea('0x5')]]](_0x32b6a3[_0x2cea('0x15')]['id'])[_0x2cea('0xe')](respondWithResult(_0x2bbe9b,0xc8))[_0x2cea('0x12')](handleError(_0x2bbe9b,null));}else{return _0x2bbe9b['status'](0x1f4)[_0x2cea('0x9')]({'message':_0x2cea('0x21')});}};exports['destroy']=function(_0x2bf4e9,_0x2e3d44){if(_0x2bf4e9[_0x2cea('0x17')]['id']){delete _0x2bf4e9[_0x2cea('0x17')]['id'];}if(_0x2bf4e9[_0x2cea('0x15')]['id']){return pm2[_0x2cea('0x22')](_0x2bf4e9[_0x2cea('0x15')]['id'])[_0x2cea('0xe')](function(_0x2e1cd6){pm2[_0x2cea('0x1d')]();return _0x2e1cd6[0x0];})[_0x2cea('0xe')](respondWithResult(_0x2e3d44,null))['catch'](handleError(_0x2e3d44,null));}else{return _0x2e3d44[_0x2cea('0x5')](0x1f4)[_0x2cea('0x9')]({'message':_0x2cea('0x23')});}}; \ No newline at end of file +var _0xee5b=['exec','bluebird','sendStatus','error','stack','name','send','npm\x20install','info','index','list','then','reject','motion2','length','catch','show','describe','params','create','body','script','join','cwd','chdir','dirname','start','status','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','dump','Unknown\x20id','lodash','../../config/logger','api','child_process'];(function(_0x357cb8,_0x23750a){var _0x5cdb5f=function(_0x2ef643){while(--_0x2ef643){_0x357cb8['push'](_0x357cb8['shift']());}};_0x5cdb5f(++_0x23750a);}(_0xee5b,0x1f4));var _0xbee5=function(_0x578bca,_0x372f35){_0x578bca=_0x578bca-0x0;var _0x4e1c17=_0xee5b[_0x578bca];return _0x4e1c17;};'use strict';var _=require(_0xbee5('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xbee5('0x1'))(_0xbee5('0x2'));var path=require('path');var exec=require(_0xbee5('0x3'))[_0xbee5('0x4')];var BPromise=require(_0xbee5('0x5'));function handleEntityNotFound(_0x210159,_0x4bd202){return function(_0x5200b1){if(!_0x5200b1){_0x210159[_0xbee5('0x6')](0x194);;}return _0x5200b1;};}function respondWithResult(_0x2c0bde,_0xab6e4d){_0xab6e4d=_0xab6e4d||0xc8;return function(_0x804ab8){if(_0x804ab8){return _0x2c0bde['status'](_0xab6e4d)['json'](_0x804ab8);}return null;};}function handleError(_0x53d5b9,_0x5baf5c){_0x5baf5c=_0x5baf5c||0x1f4;return function(_0x5536bd){logger[_0xbee5('0x7')](_0x5536bd[_0xbee5('0x8')]);if(_0x5536bd[_0xbee5('0x9')]){delete _0x5536bd[_0xbee5('0x9')];}_0x53d5b9['status'](_0x5baf5c)[_0xbee5('0xa')](_0x5536bd);};}function execChildProcess(){return new BPromise(function(_0x305921,_0x9b3d3b){exec(_0xbee5('0xb'),function(_0x16377d,_0x1509c7,_0x105e16){logger[_0xbee5('0xc')](_0x1509c7);logger[_0xbee5('0xc')](_0x105e16);if(_0x16377d){logger['error'](_0x16377d);return _0x9b3d3b(_0x16377d);}return _0x305921(_0x1509c7);});});}exports[_0xbee5('0xd')]=function(_0x532a78,_0x183877){return pm2[_0xbee5('0xe')]()[_0xbee5('0xf')](function(_0x593ecb){if(_0x593ecb){var _0x5092f2=_[_0xbee5('0x10')](_0x593ecb,function(_0x4cf5a8){return _0x4cf5a8[_0xbee5('0x9')]==='express'||_0x4cf5a8[_0xbee5('0x9')]===_0xbee5('0x11');});return{'rows':_0x5092f2,'count':_0x5092f2[_0xbee5('0x12')]};}return null;})['then'](respondWithResult(_0x183877,null))[_0xbee5('0x13')](handleError(_0x183877,null));};exports[_0xbee5('0x14')]=function(_0x5a0ae5,_0x254dd3){return pm2[_0xbee5('0x15')](_0x5a0ae5[_0xbee5('0x16')]['id'])[_0xbee5('0xf')](respondWithResult(_0x254dd3,null))[_0xbee5('0xf')](handleEntityNotFound(_0x254dd3,null))[_0xbee5('0x13')](handleError(_0x254dd3,null));};exports[_0xbee5('0x17')]=function(_0xa50ec9,_0x20cf52){if(_0xa50ec9[_0xbee5('0x18')][_0xbee5('0x9')]&&_0xa50ec9[_0xbee5('0x18')][_0xbee5('0x19')]){var _0x40a06=path[_0xbee5('0x1a')](__dirname,'../../files/plugins',_0xa50ec9['body'][_0xbee5('0x19')]);var _0x48bfb5=process[_0xbee5('0x1b')]();process[_0xbee5('0x1c')](path[_0xbee5('0x1d')](_0x40a06));return execChildProcess()[_0xbee5('0xf')](function(_0x3f23c5){process[_0xbee5('0x1c')](_0x48bfb5);return pm2[_0xbee5('0x1e')]({'name':_0xa50ec9[_0xbee5('0x18')][_0xbee5('0x9')],'script':_0x40a06});})['then'](function(_0x5b43b3){pm2['dump']();return _0x5b43b3[0x0];})['then'](respondWithResult(_0x20cf52,0xc9))['catch'](handleError(_0x20cf52,null));}else{return _0x20cf52[_0xbee5('0x1f')](0x1f4)[_0xbee5('0xa')]({'message':_0xbee5('0x20')});}};exports[_0xbee5('0x21')]=function(_0x169042,_0x20e7e8){if(_0x169042[_0xbee5('0x18')]['id']){delete _0x169042['body']['id'];}var _0x36b50f={'online':_0xbee5('0x22'),'stopped':_0xbee5('0x23')};if(_0x36b50f[_0xbee5('0x24')](_0x169042[_0xbee5('0x18')]['status'])){return pm2[_0x36b50f[_0x169042[_0xbee5('0x18')][_0xbee5('0x1f')]]](_0x169042[_0xbee5('0x16')]['id'])[_0xbee5('0xf')](respondWithResult(_0x20e7e8,0xc8))[_0xbee5('0x13')](handleError(_0x20e7e8,null));}else{return _0x20e7e8[_0xbee5('0x1f')](0x1f4)[_0xbee5('0xa')]({'message':_0xbee5('0x25')});}};exports[_0xbee5('0x26')]=function(_0x59c2e4,_0x22df5f){if(_0x59c2e4['body']['id']){delete _0x59c2e4[_0xbee5('0x18')]['id'];}if(_0x59c2e4['params']['id']){return pm2[_0xbee5('0x27')](_0x59c2e4['params']['id'])[_0xbee5('0xf')](function(_0x5c1109){pm2[_0xbee5('0x28')]();return _0x5c1109[0x0];})[_0xbee5('0xf')](respondWithResult(_0x22df5f,null))[_0xbee5('0x13')](handleError(_0x22df5f,null));}else{return _0x22df5f[_0xbee5('0x1f')](0x1f4)['send']({'message':_0xbee5('0x29')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index dc8304f..0c9771c 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 _0x1659=['getQueues','exports','express','Router','../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','getAgents','/queues'];(function(_0x519865,_0x1dd1a3){var _0x370f22=function(_0xd65b6d){while(--_0xd65b6d){_0x519865['push'](_0x519865['shift']());}};_0x370f22(++_0x1dd1a3);}(_0x1659,0x162));var _0x9165=function(_0x1bcec3,_0x279312){_0x1bcec3=_0x1bcec3-0x0;var _0x39e8a4=_0x1659[_0x1bcec3];return _0x39e8a4;};'use strict';var express=require(_0x9165('0x0'));var router=express[_0x9165('0x1')]();var auth=require(_0x9165('0x2'));var controller=require(_0x9165('0x3'));router[_0x9165('0x4')](_0x9165('0x5'),auth[_0x9165('0x6')](),controller[_0x9165('0x7')]);router[_0x9165('0x4')](_0x9165('0x8'),auth[_0x9165('0x6')](),controller[_0x9165('0x9')]);module[_0x9165('0xa')]=router; \ No newline at end of file +var _0xcc43=['/agents','getAgents','isAuthenticated','exports','express','Router','../../components/auth/service','./realtime.controller','get'];(function(_0x1e1cf9,_0x47fdc3){var _0x314674=function(_0x29777e){while(--_0x29777e){_0x1e1cf9['push'](_0x1e1cf9['shift']());}};_0x314674(++_0x47fdc3);}(_0xcc43,0x1a2));var _0x3cc4=function(_0x301942,_0x4a7ada){_0x301942=_0x301942-0x0;var _0x2d9798=_0xcc43[_0x301942];return _0x2d9798;};'use strict';var express=require(_0x3cc4('0x0'));var router=express[_0x3cc4('0x1')]();var auth=require(_0x3cc4('0x2'));var controller=require(_0x3cc4('0x3'));router[_0x3cc4('0x4')](_0x3cc4('0x5'),auth['isAuthenticated'](),controller[_0x3cc4('0x6')]);router[_0x3cc4('0x4')]('/queues',auth[_0x3cc4('0x7')](),controller['getQueues']);module[_0x3cc4('0x8')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 50888bc..35c1519 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 _0x1620=['whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','mailStatus','whatsappStatus','openchannelStatusTime','mailStatusTime','whatsappStatusTime','voiceStatusTime','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','sort','query','includes','globalStatus','resolve','User','fieldName','key','agent','getOptions','raw','user','role','userProfileId','nolimit','UserProfile','getResources','findAndCountAll','rows','orderBy','desc','asc','globalStatusFilter','pauseTypeFilter','mail','chat','sms','fax','channel','toLowerCase','Invalid\x20channel','rawAttributes','type','outbound','QueueCampaigns','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','http','undefined','limit','count','offset','status','set','Content-Range','json','error','name','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','voice','startCase','Queues','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','paused','push','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','loggedInDb','talking','pick','filter','queue','busy','some','internal','toString','find','getMembers','length','UserId','voiceStatus','online','agents','findAll','QueueId','idle','unknown','unavailable','isNil','faxPause','mailPause','openchannelPause','smsPause','whatsappPause','every','voicePause','pause','chatStatus','faxStatus','openchannelStatus','smsStatus','getAgents','userpic','lastLoginAt','lastPauseAt','chatPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity'];(function(_0xc09773,_0x4562bc){var _0x257a9f=function(_0x56b285){while(--_0x56b285){_0xc09773['push'](_0xc09773['shift']());}};_0x257a9f(++_0x4562bc);}(_0x1620,0xcb));var _0x0162=function(_0x5be048,_0x44a87c){_0x5be048=_0x5be048-0x0;var _0x43c86f=_0x1620[_0x5be048];return _0x43c86f;};'use strict';var util=require(_0x0162('0x0'));var _=require(_0x0162('0x1'));var jayson=require(_0x0162('0x2'));var qs=require(_0x0162('0x3'));var logger=require(_0x0162('0x4'))(_0x0162('0x5'));var db=require(_0x0162('0x6'))['db'];var amiClient=jayson['client'][_0x0162('0x7')]({'port':0x232a});var routingClient=jayson['client'][_0x0162('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x4bc51f,_0x410692){return function(_0x595e08){if(_0x595e08){var _0x57b685=typeof _0x410692['offset']===_0x0162('0x8')&&typeof _0x410692[_0x0162('0x9')]===_0x0162('0x8');var _0x327bfc=_0x595e08[_0x0162('0xa')];var _0xbdc650=_0x57b685?0x0:_0x410692['offset'];var _0x18ccd5=_0x57b685?_0x595e08[_0x0162('0xa')]:_0x410692[_0x0162('0xb')]+_0x410692[_0x0162('0x9')];var _0x194ab1;if(_0x18ccd5>=_0x327bfc){_0x18ccd5=_0x327bfc;_0x194ab1=0xc8;}else{_0x194ab1=0xce;}_0x4bc51f[_0x0162('0xc')](_0x194ab1);return _0x4bc51f[_0x0162('0xd')](_0x0162('0xe'),_0xbdc650+'-'+_0x18ccd5+'/'+_0x327bfc)[_0x0162('0xf')](_0x595e08);}return null;};}function handleError(_0x4f78d4,_0x412e54){_0x412e54=_0x412e54||0x1f4;return function(_0x57590c){logger[_0x0162('0x10')](_0x57590c['stack']);if(_0x57590c[_0x0162('0x11')]){delete _0x57590c[_0x0162('0x11')];}_0x4f78d4[_0x0162('0xc')](_0x412e54)['send'](_0x57590c);};}function getRealtimeAgents(){return new Promise(function(_0x867b06,_0x4b8726){return amiClient[_0x0162('0x12')](_0x0162('0x13'),{})[_0x0162('0x14')](function(_0x23cc79){if(_0x23cc79['error'])throw new Error(_0x0162('0x15'));var _0x3dc984=_0x23cc79[_0x0162('0x16')];return routingClient['request'](_0x0162('0x13'),{})[_0x0162('0x14')](function(_0x1dceff){if(_0x1dceff[_0x0162('0x10')])throw new Error(_0x0162('0x17'));var _0x51a2eb=_0x1dceff[_0x0162('0x16')];return _0x867b06(_[_0x0162('0x18')]({},_0x3dc984,_0x51a2eb));});})[_0x0162('0x19')](function(_0x43a6c6){_0x4b8726(_0x43a6c6);});});}function getRealtimeQueues(_0x2ce2b1,_0x114514){return new Promise(function(_0x5c5434,_0x175429){var _0x433081=_0x114514===_0x0162('0x1a')?amiClient:routingClient;return _0x433081[_0x0162('0x12')](_[_0x0162('0x1b')](_0x114514)+_0x0162('0x1c'),_0x2ce2b1)[_0x0162('0x14')](function(_0x4984a8){if(_0x4984a8['error'])throw new Error(util['format'](_0x0162('0x1d'),_0x114514));return _0x5c5434(_0x4984a8[_0x0162('0x16')]);})['catch'](function(_0x1e9afb){_0x175429(_0x1e9afb);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x4ffa9b,_0x1d5234){return amiClient[_0x0162('0x12')](_0x0162('0x1e'),{})[_0x0162('0x14')](function(_0x4ee7e1){if(_0x4ee7e1['error'])throw new Error(_0x0162('0x1f'));return _0x4ffa9b(_0x4ee7e1[_0x0162('0x16')]);})[_0x0162('0x19')](function(_0x4e3901){_0x1d5234(_0x4e3901);});});}function initializeQueues(_0x24e178,_0x4b8b66,_0x5882cd,_0x1ffc05){var _0x3bc1e5=[_0x0162('0x20'),_0x0162('0x21'),_0x0162('0x22'),'talking',_0x0162('0x23')];if(_0x5882cd===_0x0162('0x1a')&&_0x1ffc05==='outbound'){_0x3bc1e5[_0x0162('0x24')]('pTalking',_0x0162('0x25'),_0x0162('0x26'),_0x0162('0x27'),_0x0162('0x28'),_0x0162('0x29'),_0x0162('0x2a'),_0x0162('0x2b'),_0x0162('0x2c'),_0x0162('0x2d'),'erlangAbandonmentRate','erlangBusyFactor',_0x0162('0x2e'),_0x0162('0x2f'),_0x0162('0x30'),_0x0162('0x31'),_0x0162('0x32'),_0x0162('0x33'),_0x0162('0x34'),_0x0162('0x35'),_0x0162('0x36'),_0x0162('0x37'));}return _0x24e178[_0x0162('0x38')](function(_0x56bbe5){var _0xa4211=_0x56bbe5[_0x0162('0x39')]({'plain':!![]});_0xa4211['agents']=[];_0xa4211['paused']=0x0;_0xa4211[_0x0162('0x3a')]=0x0;_0xa4211['loggedIn']=0x0;_0xa4211[_0x0162('0x21')]=0x0;_0xa4211['waiting']=0x0;if(_0x5882cd===_0x0162('0x1a')){_0xa4211[_0x0162('0x3b')]=0x0;_0xa4211['busy']=0x0;if(_0x1ffc05==='outbound'){_0xa4211['pTalking']=0x0;_0xa4211['originated']=0x0;}}var _0x37a65d=_['find'](_0x4b8b66,['id',_0xa4211['id']]);if(_0x37a65d)_['merge'](_0xa4211,_[_0x0162('0x3c')](_0x37a65d,_0x3bc1e5));return _0xa4211;});}function updateAgentVoiceStatus(_0x3c4831,_0x36951d,_0x169906){var _0x2dda0a=_[_0x0162('0x3d')](_0x169906,[_0x0162('0x3e'),_0x36951d[_0x0162('0x11')]]);if(_0x2dda0a['length']===0x0)return _0x3c4831[_0x0162('0x3f')]=!![];if(_[_0x0162('0x40')](_0x2dda0a,['connectedlinenum',_0x3c4831[_0x0162('0x41')][_0x0162('0x42')]()]))return _0x3c4831[_0x0162('0x3b')]=!![];if(!_0x3c4831[_0x0162('0x3b')])return _0x3c4831['busy']=!![];}function getVoiceQueueAgents(_0x370953,_0x1e90fc,_0x8087c8,_0x3693cc){var _0x15fd3a=_[_0x0162('0x43')](_0x1e90fc,['id',_0x370953['id']]);if(!_0x15fd3a)return _0x370953;return _0x15fd3a[_0x0162('0x44')]({'raw':!![]})['then'](function(_0x376fed){for(var _0x51b42e=0x0;_0x51b42e<_0x376fed[_0x0162('0x45')];_0x51b42e++){var _0x16dde5=_[_0x0162('0x43')](_0x8087c8,['id',_0x376fed[_0x51b42e]['UserId']]);if(!_0x16dde5){_0x16dde5={'id':_0x376fed[_0x51b42e][_0x0162('0x46')],'name':_0x376fed[_0x51b42e][_0x0162('0x46')],'accountcode':'','online':![]};}var _0x5706c2={'id':_0x16dde5['id'],'name':_0x16dde5['name'],'internal':_0x16dde5['accountcode'],'online':Boolean(_0x16dde5['online']),'paused':Boolean(_0x376fed[_0x51b42e][_0x0162('0x23')])};if(_0x16dde5[_0x0162('0x47')]===_0x0162('0x3b'))updateAgentVoiceStatus(_0x5706c2,_0x370953,_0x3693cc);if(_0x5706c2[_0x0162('0x48')])_0x370953[_0x0162('0x3a')]++;if(_0x5706c2[_0x0162('0x3f')])_0x370953[_0x0162('0x3f')]++;if(_0x5706c2[_0x0162('0x23')]&&!_0x5706c2[_0x0162('0x3f')]&&!_0x5706c2[_0x0162('0x3b')])_0x370953['paused']++;_0x370953[_0x0162('0x49')][_0x0162('0x24')](_0x5706c2);}return _0x370953;});}function getQueueAgents(_0x5a7089,_0x3a05be,_0x29f3a3){var _0x24d60a='User'+_[_0x0162('0x1b')](_0x29f3a3)+'Queue';var _0x10c75f=_0x29f3a3+'Pause';return db[_0x24d60a][_0x0162('0x4a')]({'where':{[_[_0x0162('0x1b')](_0x29f3a3)+_0x0162('0x4b')]:_0x5a7089['id']},'raw':!![]})[_0x0162('0x14')](function(_0x2a95b5){for(var _0x575f01=0x0;_0x575f01<_0x2a95b5[_0x0162('0x45')];_0x575f01++){var _0x2db9ea=_[_0x0162('0x43')](_0x3a05be,['id',_0x2a95b5[_0x575f01]['UserId']]);if(!_0x2db9ea){_0x2db9ea={'id':_0x2a95b5[_0x575f01][_0x0162('0x46')],'name':_0x2a95b5[_0x575f01][_0x0162('0x46')],'online':![],['pauseField']:![]};}var _0x34a6f5={'id':_0x2db9ea['id'],'name':_0x2db9ea[_0x0162('0x11')],'online':Boolean(_0x2db9ea[_0x0162('0x48')]),'paused':Boolean(_0x2db9ea[_0x10c75f])};if(_0x34a6f5[_0x0162('0x48')])_0x5a7089['loggedInDb']++;_0x5a7089['agents']['push'](_0x34a6f5);}return _0x5a7089;});}function isIdle(_0x362ae1){return _0x362ae1===_0x0162('0x4c')||_0x362ae1===_0x0162('0x4d')||_0x362ae1===_0x0162('0x4e')||_0x362ae1==='ringing'||_[_0x0162('0x4f')](_0x362ae1);}function isAgentPaused(_0x2004e7,_0x3cc3bb){var _0x2005fa=[_0x2004e7['chatPause'],_0x2004e7[_0x0162('0x50')],_0x2004e7[_0x0162('0x51')],_0x2004e7[_0x0162('0x52')],_0x2004e7[_0x0162('0x53')],_0x2004e7['voicePause'],_0x2004e7[_0x0162('0x54')]];if(!_0x3cc3bb)return _[_0x0162('0x55')](_0x2005fa);var _0x212a8a=_[_0x0162('0x3d')](_0x2005fa);return _0x212a8a['length']>0x0&&_0x212a8a[_0x0162('0x45')]<_0x2005fa[_0x0162('0x45')]?!![]:![];}function isAgentIdle(_0x99ef93){if(_0x99ef93['voiceStatus']!==_0x0162('0x4c')&&_0x99ef93[_0x0162('0x56')]){_0x99ef93[_0x0162('0x47')]=_0x0162('0x57');return![];}return _[_0x0162('0x55')]([_0x99ef93[_0x0162('0x58')],_0x99ef93[_0x0162('0x59')],_0x99ef93['mailStatus'],_0x99ef93[_0x0162('0x5a')],_0x99ef93[_0x0162('0x5b')],_0x99ef93[_0x0162('0x47')],_0x99ef93['whatsappStatus']],isIdle);}function getAgentStatus(_0x181071){var _0x465b57='unknown';if(isAgentPaused(_0x181071))_0x465b57=_0x0162('0x57');else if(isAgentPaused(_0x181071,!![]))_0x465b57='*pause';else if(isAgentIdle(_0x181071))_0x465b57=_0x0162('0x4c');else _0x465b57=_0x0162('0x3f');return _0x465b57;}exports[_0x0162('0x5c')]=function(_0xd6dada,_0x195063){var _0x5019fd='';var _0x465fce={'count':0x0,'rows':[]},_0x5e970f={},_0x5b0959,_0x4e104c,_0x1a68de=[_0x0162('0x5d'),_0x0162('0x48'),_0x0162('0x5e'),_0x0162('0x5f'),'pauseType','lastPauseAt','internal','address',_0x0162('0x60'),_0x0162('0x52'),_0x0162('0x51'),_0x0162('0x53'),_0x0162('0x54'),_0x0162('0x50'),'voicePause',_0x0162('0x61'),_0x0162('0x62'),_0x0162('0x63'),_0x0162('0x64'),_0x0162('0x65'),_0x0162('0x66'),_0x0162('0x67'),_0x0162('0x68'),_0x0162('0x69'),_0x0162('0x6a'),'whatsappCurrentCapacity',_0x0162('0x6b'),_0x0162('0x58'),'openchannelStatus',_0x0162('0x6c'),_0x0162('0x5b'),_0x0162('0x6d'),_0x0162('0x59'),'voiceStatus','chatStatusTime',_0x0162('0x6e'),_0x0162('0x6f'),'smsStatusTime',_0x0162('0x70'),'faxStatusTime',_0x0162('0x71'),_0x0162('0x3e'),_0x0162('0x72'),'screenrecording',_0x0162('0x73'),_0x0162('0x74'),'routealias'],_0x965973=[_0x0162('0x60'),_0x0162('0x52'),'mailPause','smsPause',_0x0162('0x54'),'faxPause',_0x0162('0x56'),_0x0162('0x48')];if(_0xd6dada['query'][_0x0162('0x75')]&&_0xd6dada[_0x0162('0x76')]['sort'][_0x0162('0x77')](_0x0162('0x78'))){_0x5019fd=_0xd6dada['query'][_0x0162('0x75')];_0xd6dada[_0x0162('0x76')]['sort']='';}Promise[_0x0162('0x79')]()[_0x0162('0x14')](function(){var _0x1a77b2=_[_0x0162('0x38')](db[_0x0162('0x7a')]['rawAttributes'],function(_0x420cca){return{'name':_0x420cca[_0x0162('0x7b')],'type':_0x420cca['type'][_0x0162('0x7c')]};});_0xd6dada[_0x0162('0x76')]['role']=_0x0162('0x7d');_0xd6dada[_0x0162('0x76')][_0x0162('0x48')]=!![];_0x5e970f=qs[_0x0162('0x7e')](_0x1a77b2,_0xd6dada);_0x5e970f[_0x0162('0x7f')]=!![];if(_0xd6dada[_0x0162('0x80')][_0x0162('0x81')]===_0x0162('0x80')){var _0x27318c={'params':{'id':_0xd6dada[_0x0162('0x80')][_0x0162('0x82')]},'query':{'section':_0x0162('0x13'),'role':_0x0162('0x7d'),'online':!![],'nolimit':_0xd6dada[_0x0162('0x76')][_0x0162('0x83')],'sort':_0xd6dada[_0x0162('0x76')][_0x0162('0x75')],'filter':_0xd6dada[_0x0162('0x76')][_0x0162('0x3d')]},'raw':!![]};return db[_0x0162('0x84')][_0x0162('0x85')](_0x27318c);}return db[_0x0162('0x7a')][_0x0162('0x86')](_0x5e970f);})[_0x0162('0x14')](function(_0x1613b3){_0x465fce[_0x0162('0xa')]=_0x1613b3[_0x0162('0xa')];_0x5b0959=_0x1613b3[_0x0162('0x87')];return getRealtimeAgents();})[_0x0162('0x14')](function(_0x2a8750){_0x4e104c=_0x2a8750['rows'];return _0x5b0959[_0x0162('0x38')](function(_0x297f23){var _0x58f4e2=_['find'](_0x4e104c,['id',_0x297f23['id']]);if(_0x58f4e2)_[_0x0162('0x18')](_0x297f23,_[_0x0162('0x3c')](_['omit'](_0x58f4e2,_0x965973),_0x1a68de));_0x297f23['globalStatus']=getAgentStatus(_0x297f23);return _0x297f23;});})[_0x0162('0x14')](function(_0x518a70){if(_0x5019fd[_0x0162('0x77')]('globalStatus')){var _0x5c4301;if(_0x5019fd['includes']('-'))_0x5c4301=_[_0x0162('0x88')](_0x518a70,_0x0162('0x78'),_0x0162('0x89'));else _0x5c4301=_[_0x0162('0x88')](_0x518a70,_0x0162('0x78'),_0x0162('0x8a'));return _0x5c4301;}return _0x518a70;})['then'](function(_0x2889c9){if(_0xd6dada[_0x0162('0x76')][_0x0162('0x8b')]){var _0x19273a=_['filter'](_0x2889c9,['globalStatus',_0xd6dada[_0x0162('0x76')]['globalStatusFilter']]);if(_0xd6dada[_0x0162('0x76')][_0x0162('0x8c')]){_0x19273a=_[_0x0162('0x3d')](_0x19273a,['pauseType',_0xd6dada[_0x0162('0x76')]['pauseTypeFilter']]);}}_0x465fce[_0x0162('0x87')]=_0x19273a||_0x2889c9;return _0x465fce;})['then'](respondWithFilteredResult(_0x195063,_0x5e970f))[_0x0162('0x19')](handleError(_0x195063,null));};exports['getQueues']=function(_0x43da41,_0x11c1de){var _0x26478f=[_0x0162('0x8d'),_0x0162('0x8e'),_0x0162('0x8f'),'openchannel',_0x0162('0x90'),'whatsapp','voice'];var _0x16d5f4={'count':0x0,'rows':[]},_0x2ba954={},_0x3d42e1,_0x483d11,_0xcc66ac,_0x284874,_0x10ab97;Promise[_0x0162('0x79')]()[_0x0162('0x14')](function(){if(_0x43da41[_0x0162('0x76')][_0x0162('0x91')]){if(!_[_0x0162('0x77')](_0x26478f,_0x43da41[_0x0162('0x76')][_0x0162('0x91')][_0x0162('0x92')]()))throw new Error(_0x0162('0x93'));_0x3d42e1=_0x43da41[_0x0162('0x76')][_0x0162('0x91')][_0x0162('0x92')]();}var _0x7c514c=_[_0x0162('0x1b')](_0x3d42e1)+'Queue';var _0x599ba2=_[_0x0162('0x38')](db[_0x7c514c][_0x0162('0x94')],function(_0x3701c8){return{'name':_0x3701c8[_0x0162('0x7b')],'type':_0x3701c8[_0x0162('0x95')][_0x0162('0x7c')]};});_0x2ba954=qs['getOptions'](_0x599ba2,_0x43da41);if(_0x43da41[_0x0162('0x80')][_0x0162('0x81')]==='user'){var _0x1fa881={'params':{'id':_0x43da41[_0x0162('0x80')][_0x0162('0x82')]},'query':{'section':_0x3d42e1==='voice'&&_0x43da41[_0x0162('0x76')][_0x0162('0x95')]===_0x0162('0x96')?_0x0162('0x97'):_[_0x0162('0x1b')](_0x3d42e1)+_0x0162('0x1c'),'type':_0x43da41[_0x0162('0x76')][_0x0162('0x95')],'nolimit':!![],'sort':_0x0162('0x11'),'filter':_0x43da41[_0x0162('0x76')]['filter']}};return db['UserProfile'][_0x0162('0x85')](_0x1fa881);}return db[_0x7c514c]['findAndCountAll'](_0x2ba954);})[_0x0162('0x14')](function(_0x3ad047){_0x16d5f4[_0x0162('0xa')]=_0x3ad047[_0x0162('0xa')];_0x483d11=_0x3ad047[_0x0162('0x87')];return getRealtimeQueues(_0x43da41,_0x3d42e1);})[_0x0162('0x14')](function(_0x1fe7d0){_0x284874=_0x1fe7d0['rows'];return getRealtimeAgents();})[_0x0162('0x14')](function(_0x55dfac){_0xcc66ac=_0x55dfac[_0x0162('0x87')];if(_0x3d42e1!=_0x0162('0x1a'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x4cc684){_0x10ab97=_0x4cc684?_0x4cc684[_0x0162('0x87')]:[];return initializeQueues(_0x483d11,_0x284874,_0x3d42e1,_0x43da41['query'][_0x0162('0x95')]);})[_0x0162('0x14')](function(_0x284b38){var _0x222c68=_0x284b38[_0x0162('0x38')](function(_0x551da3){if(_0x3d42e1===_0x0162('0x1a'))return getVoiceQueueAgents(_0x551da3,_0x483d11,_0xcc66ac,_0x10ab97);else return getQueueAgents(_0x551da3,_0xcc66ac,_0x3d42e1);});return Promise['all'](_0x222c68);})[_0x0162('0x14')](function(_0x11f94f){_0x16d5f4[_0x0162('0x87')]=_0x11f94f;return _0x16d5f4;})[_0x0162('0x14')](respondWithFilteredResult(_0x11c1de,_0x2ba954))[_0x0162('0x19')](handleError(_0x11c1de,null));}; \ No newline at end of file +var _0x24d2=['then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','voice','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','talking','paused','outbound','push','pTalking','originated','message','dialActive','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','map','get','agents','loggedInDb','busy','pick','filter','queue','length','some','connectedlinenum','internal','toString','find','getMembers','UserId','accountcode','online','voiceStatus','User','Queue','Pause','QueueId','unavailable','ringing','isNil','faxPause','mailPause','openchannelPause','voicePause','whatsappPause','every','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','pause','*pause','idle','userpic','lastLoginAt','lastPauseAt','address','chatPause','smsPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','faxCapacity','openchannelCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','query','sort','globalStatus','resolve','rawAttributes','fieldName','key','agent','getOptions','raw','user','userProfileId','nolimit','getResources','findAndCountAll','rows','omit','includes','orderBy','desc','globalStatusFilter','pauseTypeFilter','pauseType','mail','sms','openchannel','fax','whatsapp','channel','toLowerCase','Invalid\x20channel','role','type','QueueCampaigns','all','util','lodash','../../config/logger','api','client','http','undefined','count','offset','limit','set','json','stack','name','send','request','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Agents'];(function(_0x29c3b2,_0x3c12ac){var _0x4b3aa7=function(_0x622a9d){while(--_0x622a9d){_0x29c3b2['push'](_0x29c3b2['shift']());}};_0x4b3aa7(++_0x3c12ac);}(_0x24d2,0x1bb));var _0x224d=function(_0x5f400e,_0x25f103){_0x5f400e=_0x5f400e-0x0;var _0x1aba09=_0x24d2[_0x5f400e];return _0x1aba09;};'use strict';var util=require(_0x224d('0x0'));var _=require(_0x224d('0x1'));var jayson=require('jayson/promise');var qs=require('../../components/parsers/qs');var logger=require(_0x224d('0x2'))(_0x224d('0x3'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x224d('0x4')][_0x224d('0x5')]({'port':0x232a});var routingClient=jayson['client'][_0x224d('0x5')]({'port':0x232c});function respondWithFilteredResult(_0x290354,_0x1c699e){return function(_0x26f9e0){if(_0x26f9e0){var _0xac0d45=typeof _0x1c699e['offset']===_0x224d('0x6')&&typeof _0x1c699e['limit']==='undefined';var _0x1a1655=_0x26f9e0[_0x224d('0x7')];var _0x5f46c7=_0xac0d45?0x0:_0x1c699e[_0x224d('0x8')];var _0x4f3c32=_0xac0d45?_0x26f9e0[_0x224d('0x7')]:_0x1c699e[_0x224d('0x8')]+_0x1c699e[_0x224d('0x9')];var _0x76e91f;if(_0x4f3c32>=_0x1a1655){_0x4f3c32=_0x1a1655;_0x76e91f=0xc8;}else{_0x76e91f=0xce;}_0x290354['status'](_0x76e91f);return _0x290354[_0x224d('0xa')]('Content-Range',_0x5f46c7+'-'+_0x4f3c32+'/'+_0x1a1655)[_0x224d('0xb')](_0x26f9e0);}return null;};}function handleError(_0x157453,_0x22df51){_0x22df51=_0x22df51||0x1f4;return function(_0x2219d1){logger['error'](_0x2219d1[_0x224d('0xc')]);if(_0x2219d1[_0x224d('0xd')]){delete _0x2219d1[_0x224d('0xd')];}_0x157453['status'](_0x22df51)[_0x224d('0xe')](_0x2219d1);};}function getRealtimeAgents(){return new Promise(function(_0x4713a4,_0x4e1794){return amiClient[_0x224d('0xf')]('Agents',{})['then'](function(_0x522e14){if(_0x522e14[_0x224d('0x10')])throw new Error(_0x224d('0x11'));var _0x35c23d=_0x522e14['result'];return routingClient[_0x224d('0xf')](_0x224d('0x12'),{})[_0x224d('0x13')](function(_0x7a789b){if(_0x7a789b[_0x224d('0x10')])throw new Error(_0x224d('0x14'));var _0x28af08=_0x7a789b['result'];return _0x4713a4(_[_0x224d('0x15')]({},_0x35c23d,_0x28af08));});})[_0x224d('0x16')](function(_0x5558c7){_0x4e1794(_0x5558c7);});});}function getRealtimeQueues(_0xe81cd9,_0x519f2b){return new Promise(function(_0x4a40b9,_0x4554db){var _0x194a93=_0x519f2b===_0x224d('0x17')?amiClient:routingClient;return _0x194a93[_0x224d('0xf')](_[_0x224d('0x18')](_0x519f2b)+_0x224d('0x19'),_0xe81cd9)[_0x224d('0x13')](function(_0x4cf988){if(_0x4cf988[_0x224d('0x10')])throw new Error(util[_0x224d('0x1a')](_0x224d('0x1b'),_0x519f2b));return _0x4a40b9(_0x4cf988[_0x224d('0x1c')]);})[_0x224d('0x16')](function(_0x127f59){_0x4554db(_0x127f59);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x38cd0d,_0x596cdb){return amiClient[_0x224d('0xf')](_0x224d('0x1d'),{})[_0x224d('0x13')](function(_0x252677){if(_0x252677['error'])throw new Error(_0x224d('0x1e'));return _0x38cd0d(_0x252677[_0x224d('0x1c')]);})[_0x224d('0x16')](function(_0x3db7b3){_0x596cdb(_0x3db7b3);});});}function initializeQueues(_0x547d15,_0x4f386d,_0x55fa70,_0x32057d){var _0x1f5251=[_0x224d('0x1f'),_0x224d('0x20'),_0x224d('0x21'),_0x224d('0x22'),_0x224d('0x23')];if(_0x55fa70==='voice'&&_0x32057d===_0x224d('0x24')){_0x1f5251[_0x224d('0x25')](_0x224d('0x26'),_0x224d('0x27'),_0x224d('0x28'),_0x224d('0x29'),'dialMethod',_0x224d('0x2a'),'startPredictive',_0x224d('0x2b'),_0x224d('0x2c'),_0x224d('0x2d'),_0x224d('0x2e'),'erlangBusyFactor',_0x224d('0x2f'),_0x224d('0x30'),_0x224d('0x31'),_0x224d('0x32'),_0x224d('0x33'),_0x224d('0x34'),_0x224d('0x35'),_0x224d('0x36'),_0x224d('0x37'),'predictiveIntervalAvgTalktime');}return _0x547d15[_0x224d('0x38')](function(_0x5916cc){var _0x3e6332=_0x5916cc[_0x224d('0x39')]({'plain':!![]});_0x3e6332[_0x224d('0x3a')]=[];_0x3e6332[_0x224d('0x23')]=0x0;_0x3e6332[_0x224d('0x3b')]=0x0;_0x3e6332['loggedIn']=0x0;_0x3e6332[_0x224d('0x20')]=0x0;_0x3e6332[_0x224d('0x21')]=0x0;if(_0x55fa70===_0x224d('0x17')){_0x3e6332[_0x224d('0x22')]=0x0;_0x3e6332[_0x224d('0x3c')]=0x0;if(_0x32057d===_0x224d('0x24')){_0x3e6332[_0x224d('0x26')]=0x0;_0x3e6332['originated']=0x0;}}var _0x2bd864=_['find'](_0x4f386d,['id',_0x3e6332['id']]);if(_0x2bd864)_[_0x224d('0x15')](_0x3e6332,_[_0x224d('0x3d')](_0x2bd864,_0x1f5251));return _0x3e6332;});}function updateAgentVoiceStatus(_0x128cdf,_0x2ee352,_0x21f037){var _0x213afe=_[_0x224d('0x3e')](_0x21f037,[_0x224d('0x3f'),_0x2ee352['name']]);if(_0x213afe[_0x224d('0x40')]===0x0)return _0x128cdf[_0x224d('0x3c')]=!![];if(_[_0x224d('0x41')](_0x213afe,[_0x224d('0x42'),_0x128cdf[_0x224d('0x43')][_0x224d('0x44')]()]))return _0x128cdf[_0x224d('0x22')]=!![];if(!_0x128cdf[_0x224d('0x22')])return _0x128cdf[_0x224d('0x3c')]=!![];}function getVoiceQueueAgents(_0x5c0b9a,_0x5dc9aa,_0x199171,_0x5bb02e){var _0x44e435=_[_0x224d('0x45')](_0x5dc9aa,['id',_0x5c0b9a['id']]);if(!_0x44e435)return _0x5c0b9a;return _0x44e435[_0x224d('0x46')]({'raw':!![]})[_0x224d('0x13')](function(_0x49307b){for(var _0x27f62d=0x0;_0x27f62d<_0x49307b['length'];_0x27f62d++){var _0x580dc5=_[_0x224d('0x45')](_0x199171,['id',_0x49307b[_0x27f62d]['UserId']]);if(!_0x580dc5){_0x580dc5={'id':_0x49307b[_0x27f62d][_0x224d('0x47')],'name':_0x49307b[_0x27f62d][_0x224d('0x47')],'accountcode':'','online':![]};}var _0x461397={'id':_0x580dc5['id'],'name':_0x580dc5[_0x224d('0xd')],'internal':_0x580dc5[_0x224d('0x48')],'online':Boolean(_0x580dc5[_0x224d('0x49')]),'paused':Boolean(_0x49307b[_0x27f62d][_0x224d('0x23')])};if(_0x580dc5[_0x224d('0x4a')]===_0x224d('0x22'))updateAgentVoiceStatus(_0x461397,_0x5c0b9a,_0x5bb02e);if(_0x461397[_0x224d('0x49')])_0x5c0b9a['loggedInDb']++;if(_0x461397[_0x224d('0x3c')])_0x5c0b9a[_0x224d('0x3c')]++;if(_0x461397['paused']&&!_0x461397[_0x224d('0x3c')]&&!_0x461397[_0x224d('0x22')])_0x5c0b9a[_0x224d('0x23')]++;_0x5c0b9a['agents'][_0x224d('0x25')](_0x461397);}return _0x5c0b9a;});}function getQueueAgents(_0x7003ec,_0x8f2ab3,_0x4d4051){var _0x2039f6=_0x224d('0x4b')+_[_0x224d('0x18')](_0x4d4051)+_0x224d('0x4c');var _0xf6bc51=_0x4d4051+_0x224d('0x4d');return db[_0x2039f6]['findAll']({'where':{[_[_0x224d('0x18')](_0x4d4051)+_0x224d('0x4e')]:_0x7003ec['id']},'raw':!![]})['then'](function(_0x5d836d){for(var _0x2eeb48=0x0;_0x2eeb48<_0x5d836d[_0x224d('0x40')];_0x2eeb48++){var _0x3942a9=_[_0x224d('0x45')](_0x8f2ab3,['id',_0x5d836d[_0x2eeb48]['UserId']]);if(!_0x3942a9){_0x3942a9={'id':_0x5d836d[_0x2eeb48][_0x224d('0x47')],'name':_0x5d836d[_0x2eeb48]['UserId'],'online':![],['pauseField']:![]};}var _0x6be49d={'id':_0x3942a9['id'],'name':_0x3942a9[_0x224d('0xd')],'online':Boolean(_0x3942a9[_0x224d('0x49')]),'paused':Boolean(_0x3942a9[_0xf6bc51])};if(_0x6be49d[_0x224d('0x49')])_0x7003ec[_0x224d('0x3b')]++;_0x7003ec[_0x224d('0x3a')][_0x224d('0x25')](_0x6be49d);}return _0x7003ec;});}function isIdle(_0x19fddd){return _0x19fddd==='idle'||_0x19fddd==='unknown'||_0x19fddd===_0x224d('0x4f')||_0x19fddd===_0x224d('0x50')||_[_0x224d('0x51')](_0x19fddd);}function isAgentPaused(_0x5aeb27,_0x26c94e){var _0x1b6dde=[_0x5aeb27['chatPause'],_0x5aeb27[_0x224d('0x52')],_0x5aeb27[_0x224d('0x53')],_0x5aeb27[_0x224d('0x54')],_0x5aeb27['smsPause'],_0x5aeb27[_0x224d('0x55')],_0x5aeb27[_0x224d('0x56')]];if(!_0x26c94e)return _[_0x224d('0x57')](_0x1b6dde);var _0x1d0f02=_['filter'](_0x1b6dde);return _0x1d0f02[_0x224d('0x40')]>0x0&&_0x1d0f02['length']<_0x1b6dde[_0x224d('0x40')]?!![]:![];}function isAgentIdle(_0x5b575f){if(_0x5b575f[_0x224d('0x4a')]!=='idle'&&_0x5b575f['voicePause']){_0x5b575f[_0x224d('0x4a')]='pause';return![];}return _[_0x224d('0x57')]([_0x5b575f[_0x224d('0x58')],_0x5b575f[_0x224d('0x59')],_0x5b575f[_0x224d('0x5a')],_0x5b575f[_0x224d('0x5b')],_0x5b575f[_0x224d('0x5c')],_0x5b575f[_0x224d('0x4a')],_0x5b575f[_0x224d('0x5d')]],isIdle);}function getAgentStatus(_0x5678db){var _0xea9288='unknown';if(isAgentPaused(_0x5678db))_0xea9288=_0x224d('0x5e');else if(isAgentPaused(_0x5678db,!![]))_0xea9288=_0x224d('0x5f');else if(isAgentIdle(_0x5678db))_0xea9288=_0x224d('0x60');else _0xea9288=_0x224d('0x3c');return _0xea9288;}exports['getAgents']=function(_0x214bca,_0x105dee){var _0x29498a='';var _0x2d78a2={'count':0x0,'rows':[]},_0x56b308={},_0x2629c7,_0x12d2a5,_0x400234=[_0x224d('0x61'),_0x224d('0x49'),_0x224d('0x62'),_0x224d('0x63'),'pauseType',_0x224d('0x63'),_0x224d('0x43'),_0x224d('0x64'),_0x224d('0x65'),_0x224d('0x54'),_0x224d('0x53'),_0x224d('0x66'),'whatsappPause',_0x224d('0x52'),'voicePause',_0x224d('0x67'),_0x224d('0x68'),_0x224d('0x69'),_0x224d('0x6a'),'whatsappCapacity',_0x224d('0x6b'),'chatCurrentCapacity',_0x224d('0x6c'),'mailCurrentCapacity','smsCurrentCapacity',_0x224d('0x6d'),_0x224d('0x6e'),'chatStatus',_0x224d('0x5b'),_0x224d('0x5a'),_0x224d('0x5c'),_0x224d('0x5d'),_0x224d('0x59'),_0x224d('0x4a'),_0x224d('0x6f'),_0x224d('0x70'),_0x224d('0x71'),'smsStatusTime',_0x224d('0x72'),_0x224d('0x73'),'voiceStatusTime',_0x224d('0x3f'),_0x224d('0x74'),'screenrecording',_0x224d('0x75'),_0x224d('0x76'),'routealias'],_0x1be9bd=[_0x224d('0x65'),'openchannelPause',_0x224d('0x53'),_0x224d('0x66'),_0x224d('0x56'),_0x224d('0x52'),_0x224d('0x55'),_0x224d('0x49')];if(_0x214bca['query']['sort']&&_0x214bca[_0x224d('0x77')][_0x224d('0x78')]['includes'](_0x224d('0x79'))){_0x29498a=_0x214bca[_0x224d('0x77')][_0x224d('0x78')];_0x214bca[_0x224d('0x77')][_0x224d('0x78')]='';}Promise[_0x224d('0x7a')]()[_0x224d('0x13')](function(){var _0x257115=_[_0x224d('0x38')](db[_0x224d('0x4b')][_0x224d('0x7b')],function(_0x377d8a){return{'name':_0x377d8a[_0x224d('0x7c')],'type':_0x377d8a['type'][_0x224d('0x7d')]};});_0x214bca[_0x224d('0x77')]['role']=_0x224d('0x7e');_0x214bca[_0x224d('0x77')]['online']=!![];_0x56b308=qs[_0x224d('0x7f')](_0x257115,_0x214bca);_0x56b308[_0x224d('0x80')]=!![];if(_0x214bca[_0x224d('0x81')]['role']==='user'){var _0x8c04c4={'params':{'id':_0x214bca[_0x224d('0x81')][_0x224d('0x82')]},'query':{'section':_0x224d('0x12'),'role':_0x224d('0x7e'),'online':!![],'nolimit':_0x214bca[_0x224d('0x77')][_0x224d('0x83')],'sort':_0x214bca[_0x224d('0x77')]['sort'],'filter':_0x214bca[_0x224d('0x77')][_0x224d('0x3e')]},'raw':!![]};return db['UserProfile'][_0x224d('0x84')](_0x8c04c4);}return db[_0x224d('0x4b')][_0x224d('0x85')](_0x56b308);})[_0x224d('0x13')](function(_0x2e2e96){_0x2d78a2['count']=_0x2e2e96[_0x224d('0x7')];_0x2629c7=_0x2e2e96[_0x224d('0x86')];return getRealtimeAgents();})[_0x224d('0x13')](function(_0x1314d0){_0x12d2a5=_0x1314d0[_0x224d('0x86')];return _0x2629c7[_0x224d('0x38')](function(_0xe446d9){var _0x2f2a50=_['find'](_0x12d2a5,['id',_0xe446d9['id']]);if(_0x2f2a50)_[_0x224d('0x15')](_0xe446d9,_[_0x224d('0x3d')](_[_0x224d('0x87')](_0x2f2a50,_0x1be9bd),_0x400234));_0xe446d9['globalStatus']=getAgentStatus(_0xe446d9);return _0xe446d9;});})[_0x224d('0x13')](function(_0xd7e6df){if(_0x29498a[_0x224d('0x88')]('globalStatus')){var _0x26be35;if(_0x29498a[_0x224d('0x88')]('-'))_0x26be35=_[_0x224d('0x89')](_0xd7e6df,_0x224d('0x79'),_0x224d('0x8a'));else _0x26be35=_[_0x224d('0x89')](_0xd7e6df,'globalStatus','asc');return _0x26be35;}return _0xd7e6df;})[_0x224d('0x13')](function(_0x3b04e2){if(_0x214bca[_0x224d('0x77')][_0x224d('0x8b')]){var _0x40c468=_['filter'](_0x3b04e2,[_0x224d('0x79'),_0x214bca[_0x224d('0x77')][_0x224d('0x8b')]]);if(_0x214bca[_0x224d('0x77')][_0x224d('0x8c')]){_0x40c468=_[_0x224d('0x3e')](_0x40c468,[_0x224d('0x8d'),_0x214bca[_0x224d('0x77')][_0x224d('0x8c')]]);}}_0x2d78a2['rows']=_0x40c468||_0x3b04e2;return _0x2d78a2;})[_0x224d('0x13')](respondWithFilteredResult(_0x105dee,_0x56b308))[_0x224d('0x16')](handleError(_0x105dee,null));};exports['getQueues']=function(_0x437516,_0x18e81b){var _0xf8e728=[_0x224d('0x8e'),'chat',_0x224d('0x8f'),_0x224d('0x90'),_0x224d('0x91'),_0x224d('0x92'),_0x224d('0x17')];var _0x3f3135={'count':0x0,'rows':[]},_0x15005a={},_0x1b780e,_0x5a80e3,_0x5390e8,_0x10c8f9,_0x312e77;Promise[_0x224d('0x7a')]()[_0x224d('0x13')](function(){if(_0x437516[_0x224d('0x77')][_0x224d('0x93')]){if(!_[_0x224d('0x88')](_0xf8e728,_0x437516[_0x224d('0x77')][_0x224d('0x93')][_0x224d('0x94')]()))throw new Error(_0x224d('0x95'));_0x1b780e=_0x437516['query'][_0x224d('0x93')][_0x224d('0x94')]();}var _0x5a16e4=_['startCase'](_0x1b780e)+'Queue';var _0x1413b8=_[_0x224d('0x38')](db[_0x5a16e4]['rawAttributes'],function(_0x4ebf74){return{'name':_0x4ebf74[_0x224d('0x7c')],'type':_0x4ebf74['type']['key']};});_0x15005a=qs[_0x224d('0x7f')](_0x1413b8,_0x437516);if(_0x437516[_0x224d('0x81')][_0x224d('0x96')]===_0x224d('0x81')){var _0x5d8f43={'params':{'id':_0x437516[_0x224d('0x81')][_0x224d('0x82')]},'query':{'section':_0x1b780e===_0x224d('0x17')&&_0x437516['query'][_0x224d('0x97')]===_0x224d('0x24')?_0x224d('0x98'):_[_0x224d('0x18')](_0x1b780e)+_0x224d('0x19'),'type':_0x437516['query'][_0x224d('0x97')],'nolimit':!![],'sort':'name','filter':_0x437516['query'][_0x224d('0x3e')]}};return db['UserProfile'][_0x224d('0x84')](_0x5d8f43);}return db[_0x5a16e4]['findAndCountAll'](_0x15005a);})[_0x224d('0x13')](function(_0x186ca4){_0x3f3135[_0x224d('0x7')]=_0x186ca4[_0x224d('0x7')];_0x5a80e3=_0x186ca4['rows'];return getRealtimeQueues(_0x437516,_0x1b780e);})['then'](function(_0x147ed8){_0x10c8f9=_0x147ed8[_0x224d('0x86')];return getRealtimeAgents();})[_0x224d('0x13')](function(_0x1e81aa){_0x5390e8=_0x1e81aa['rows'];if(_0x1b780e!=_0x224d('0x17'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x1a87ef){_0x312e77=_0x1a87ef?_0x1a87ef[_0x224d('0x86')]:[];return initializeQueues(_0x5a80e3,_0x10c8f9,_0x1b780e,_0x437516[_0x224d('0x77')][_0x224d('0x97')]);})[_0x224d('0x13')](function(_0x36bd98){var _0x3ffd5d=_0x36bd98['map'](function(_0x1aae7c){if(_0x1b780e===_0x224d('0x17'))return getVoiceQueueAgents(_0x1aae7c,_0x5a80e3,_0x5390e8,_0x312e77);else return getQueueAgents(_0x1aae7c,_0x5390e8,_0x1b780e);});return Promise[_0x224d('0x99')](_0x3ffd5d);})['then'](function(_0x200f84){_0x3f3135['rows']=_0x200f84;return _0x3f3135;})[_0x224d('0x13')](respondWithFilteredResult(_0x18e81b,_0x15005a))[_0x224d('0x16')](handleError(_0x18e81b,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 3d2a984..12c9d17 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x347826,_0x57f63c){var _0x1696de=function(_0x257081){while(--_0x257081){_0x347826['push'](_0x347826['shift']());}};_0x1696de(++_0x57f63c);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4b33b6,_0xd654bb){var _0x93fd0b=function(_0x55495f){while(--_0x55495f){_0x4b33b6['push'](_0x4b33b6['shift']());}};_0x93fd0b(++_0xd654bb);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 15970c1..e232c95 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 _0x4489=['sequelize','exports','STRING','DATE'];(function(_0xc2a1f1,_0xdf09cb){var _0x59a83b=function(_0x7a9aac){while(--_0x7a9aac){_0xc2a1f1['push'](_0xc2a1f1['shift']());}};_0x59a83b(++_0xdf09cb);}(_0x4489,0x164));var _0x9448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4489[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9448('0x0'));module[_0x9448('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x9448('0x2')]},'scheduledat':{'type':Sequelize[_0x9448('0x3')]},'uniqueid':{'type':Sequelize[_0x9448('0x2')]},'starttime':{'type':Sequelize[_0x9448('0x3')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfa9f=['INTEGER','STRING','DATE','exports'];(function(_0x51ca92,_0x5952f2){var _0x45767e=function(_0x4a6e82){while(--_0x4a6e82){_0x51ca92['push'](_0x51ca92['shift']());}};_0x45767e(++_0x5952f2);}(_0xfa9f,0x93));var _0xffa9=function(_0x17b0d4,_0x377add){_0x17b0d4=_0x17b0d4-0x0;var _0x2d02c7=_0xfa9f[_0x17b0d4];return _0x2d02c7;};'use strict';var Sequelize=require('sequelize');module[_0xffa9('0x0')]={'state':{'type':Sequelize[_0xffa9('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xffa9('0x2')]},'scheduledat':{'type':Sequelize[_0xffa9('0x3')]},'uniqueid':{'type':Sequelize[_0xffa9('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xffa9('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xffa9('0x2')]},'campaigntype':{'type':Sequelize[_0xffa9('0x2')]},'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 04b04ec..6229019 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 _0x4300=['moment','bluebird','request-promise','rimraf','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util'];(function(_0x187279,_0x26d152){var _0x3da59d=function(_0x41c808){while(--_0x41c808){_0x187279['push'](_0x187279['shift']());}};_0x3da59d(++_0x26d152);}(_0x4300,0x1d7));var _0x0430=function(_0x4f9ac2,_0x179f5f){_0x4f9ac2=_0x4f9ac2-0x0;var _0x4b8752=_0x4300[_0x4f9ac2];return _0x4b8752;};'use strict';var _=require(_0x0430('0x0'));var util=require(_0x0430('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0430('0x2'));var BPromise=require(_0x0430('0x3'));var rp=require(_0x0430('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0430('0x5'));var config=require('../../config/environment');var attributes=require(_0x0430('0x6'));module[_0x0430('0x7')]=function(_0x306fed,_0x444ed3){return _0x306fed[_0x0430('0x8')](_0x0430('0x9'),attributes,{'tableName':_0x0430('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b9a=['ReportAgentPreview','report_agent_preview','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x7422fb,_0xcab560){var _0x464c98=function(_0x41383e){while(--_0x41383e){_0x7422fb['push'](_0x7422fb['shift']());}};_0x464c98(++_0xcab560);}(_0x0b9a,0x12b));var _0xa0b9=function(_0x174583,_0x468485){_0x174583=_0x174583-0x0;var _0x14e46f=_0x0b9a[_0x174583];return _0x14e46f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xa0b9('0x0'));var moment=require(_0xa0b9('0x1'));var BPromise=require(_0xa0b9('0x2'));var rp=require(_0xa0b9('0x3'));var fs=require('fs');var path=require(_0xa0b9('0x4'));var rimraf=require(_0xa0b9('0x5'));var config=require(_0xa0b9('0x6'));var attributes=require('./reportAgentPreview.attributes');module[_0xa0b9('0x7')]=function(_0x383c65,_0xfb93df){return _0x383c65[_0xa0b9('0x8')](_0xa0b9('0x9'),attributes,{'tableName':_0xa0b9('0xa'),'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 9c62d45..93ba701 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 _0x4f75=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ReportAgentPreview,\x20%s,\x20%s','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','then','lodash','util','moment'];(function(_0x2c42d3,_0xc3c393){var _0x47bb5c=function(_0x548253){while(--_0x548253){_0x2c42d3['push'](_0x2c42d3['shift']());}};_0x47bb5c(++_0xc3c393);}(_0x4f75,0xf5));var _0x54f7=function(_0x206c3b,_0xf10949){_0x206c3b=_0x206c3b-0x0;var _0x5ce3a0=_0x4f75[_0x206c3b];return _0x5ce3a0;};'use strict';var _=require(_0x54f7('0x0'));var util=require(_0x54f7('0x1'));var moment=require(_0x54f7('0x2'));var BPromise=require(_0x54f7('0x3'));var rs=require(_0x54f7('0x4'));var fs=require('fs');var Redis=require(_0x54f7('0x5'));var db=require(_0x54f7('0x6'))['db'];var utils=require(_0x54f7('0x7'));var logger=require('../../config/logger')(_0x54f7('0x8'));var config=require(_0x54f7('0x9'));var jayson=require(_0x54f7('0xa'));var client=jayson[_0x54f7('0xb')][_0x54f7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2df075,_0x125a71,_0x92d5e6){return new BPromise(function(_0x153e1d,_0x22649e){return client[_0x54f7('0xd')](_0x2df075,_0x92d5e6)['then'](function(_0x368435){logger[_0x54f7('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x125a71,'request\x20sent');logger[_0x54f7('0xf')](_0x54f7('0x10'),_0x125a71,_0x54f7('0x11'),JSON[_0x54f7('0x12')](_0x368435));if(_0x368435[_0x54f7('0x13')]){if(_0x368435[_0x54f7('0x13')]['code']===0x1f4){logger['error'](_0x54f7('0x14'),_0x125a71,_0x368435[_0x54f7('0x13')][_0x54f7('0x15')]);return _0x22649e(_0x368435['error']['message']);}logger[_0x54f7('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x125a71,_0x368435['error'][_0x54f7('0x15')]);return _0x153e1d(_0x368435[_0x54f7('0x13')][_0x54f7('0x15')]);}else{logger[_0x54f7('0xe')](_0x54f7('0x14'),_0x125a71,_0x54f7('0x11'));_0x153e1d(_0x368435[_0x54f7('0x16')][_0x54f7('0x15')]);}})[_0x54f7('0x17')](function(_0x57d771){logger[_0x54f7('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x125a71,_0x57d771);_0x22649e(_0x57d771);});});}exports[_0x54f7('0x18')]=function(_0x336d30){var _0x22ac65=this;return new Promise(function(_0x4e6aad,_0x41a97a){return db[_0x54f7('0x19')][_0x54f7('0x1a')](_0x336d30[_0x54f7('0x1b')],{'raw':_0x336d30['options']?_0x336d30[_0x54f7('0x1c')][_0x54f7('0x1d')]===undefined?!![]:![]:!![]})[_0x54f7('0x1e')](function(_0x133001){logger[_0x54f7('0xe')](_0x54f7('0x18'),_0x336d30);logger['debug'](_0x54f7('0x18'),_0x336d30,JSON[_0x54f7('0x12')](_0x133001));_0x4e6aad(_0x133001);})[_0x54f7('0x17')](function(_0x3fca04){logger[_0x54f7('0x13')]('CreateReportAgentPreview',_0x3fca04[_0x54f7('0x15')],_0x336d30);_0x41a97a(_0x22ac65[_0x54f7('0x13')](0x1f4,_0x3fca04[_0x54f7('0x15')]));});});}; \ No newline at end of file +var _0xe715=['ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','create','options','raw','then','info','CreateReportAgentPreview','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x4cfd78,_0x52355e){var _0xf4a95a=function(_0x5c2d5b){while(--_0x5c2d5b){_0x4cfd78['push'](_0x4cfd78['shift']());}};_0xf4a95a(++_0x52355e);}(_0xe715,0x153));var _0x5e71=function(_0x3d2c56,_0x29c242){_0x3d2c56=_0x3d2c56-0x0;var _0x32a153=_0xe715[_0x3d2c56];return _0x32a153;};'use strict';var _=require(_0x5e71('0x0'));var util=require('util');var moment=require(_0x5e71('0x1'));var BPromise=require(_0x5e71('0x2'));var rs=require(_0x5e71('0x3'));var fs=require('fs');var Redis=require(_0x5e71('0x4'));var db=require(_0x5e71('0x5'))['db'];var utils=require(_0x5e71('0x6'));var logger=require(_0x5e71('0x7'))(_0x5e71('0x8'));var config=require(_0x5e71('0x9'));var jayson=require(_0x5e71('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2f7eeb,_0x1a4088,_0x1afe1f){return new BPromise(function(_0x56e158,_0x613d68){return client[_0x5e71('0xb')](_0x2f7eeb,_0x1afe1f)['then'](function(_0x12b2dd){logger['info'](_0x5e71('0xc'),_0x1a4088,_0x5e71('0xd'));logger[_0x5e71('0xe')](_0x5e71('0xf'),_0x1a4088,_0x5e71('0xd'),JSON[_0x5e71('0x10')](_0x12b2dd));if(_0x12b2dd[_0x5e71('0x11')]){if(_0x12b2dd['error'][_0x5e71('0x12')]===0x1f4){logger[_0x5e71('0x11')](_0x5e71('0xc'),_0x1a4088,_0x12b2dd['error'][_0x5e71('0x13')]);return _0x613d68(_0x12b2dd['error'][_0x5e71('0x13')]);}logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x1a4088,_0x12b2dd['error'][_0x5e71('0x13')]);return _0x56e158(_0x12b2dd[_0x5e71('0x11')]['message']);}else{logger['info'](_0x5e71('0xc'),_0x1a4088,'request\x20sent');_0x56e158(_0x12b2dd['result'][_0x5e71('0x13')]);}})[_0x5e71('0x14')](function(_0x5e3130){logger['error'](_0x5e71('0xc'),_0x1a4088,_0x5e3130);_0x613d68(_0x5e3130);});});}exports['CreateReportAgentPreview']=function(_0x1fb1fa){var _0x5bc11a=this;return new Promise(function(_0x203109,_0x3aa1f1){return db['ReportAgentPreview'][_0x5e71('0x15')](_0x1fb1fa['body'],{'raw':_0x1fb1fa[_0x5e71('0x16')]?_0x1fb1fa['options'][_0x5e71('0x17')]===undefined?!![]:![]:!![]})[_0x5e71('0x18')](function(_0x9886b0){logger[_0x5e71('0x19')](_0x5e71('0x1a'),_0x1fb1fa);logger[_0x5e71('0xe')](_0x5e71('0x1a'),_0x1fb1fa,JSON[_0x5e71('0x10')](_0x9886b0));_0x203109(_0x9886b0);})[_0x5e71('0x14')](function(_0x556150){logger[_0x5e71('0x11')](_0x5e71('0x1a'),_0x556150['message'],_0x1fb1fa);_0x3aa1f1(_0x5bc11a['error'](0x1f4,_0x556150['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 87860dc..1481f55 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 _0x5ed8=['/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions'];(function(_0x29e3ec,_0x138a18){var _0x25727e=function(_0x2bea0d){while(--_0x2bea0d){_0x29e3ec['push'](_0x29e3ec['shift']());}};_0x25727e(++_0x138a18);}(_0x5ed8,0xcf));var _0x85ed=function(_0x4e5e6c,_0x959eb4){_0x4e5e6c=_0x4e5e6c-0x0;var _0xcf9053=_0x5ed8[_0x4e5e6c];return _0xcf9053;};'use strict';var multer=require(_0x85ed('0x0'));var util=require(_0x85ed('0x1'));var path=require(_0x85ed('0x2'));var express=require(_0x85ed('0x3'));var router=express[_0x85ed('0x4')]();var auth=require(_0x85ed('0x5'));var controller=require(_0x85ed('0x6'));router[_0x85ed('0x7')](_0x85ed('0x8'),auth[_0x85ed('0x9')](),controller[_0x85ed('0xa')]);router[_0x85ed('0x7')](_0x85ed('0xb'),auth[_0x85ed('0x9')](),controller[_0x85ed('0xc')]);router[_0x85ed('0x7')]('/voice/channels/:uniqueid/stopmixmonitor',auth['isAuthenticated'](),controller[_0x85ed('0xd')]);router[_0x85ed('0x7')](_0x85ed('0xe'),auth['isAuthenticated'](),controller[_0x85ed('0xf')]);router[_0x85ed('0x7')](_0x85ed('0x10'),auth[_0x85ed('0x9')](),controller[_0x85ed('0x11')]);router[_0x85ed('0x7')](_0x85ed('0x12'),auth['isAuthenticated'](),controller['mailQueues']);router['get'](_0x85ed('0x13'),auth[_0x85ed('0x9')](),controller[_0x85ed('0x14')]);router[_0x85ed('0x7')](_0x85ed('0x15'),auth[_0x85ed('0x9')](),controller[_0x85ed('0x16')]);router['get']('/sms/queues',auth[_0x85ed('0x9')](),controller[_0x85ed('0x17')]);router[_0x85ed('0x7')](_0x85ed('0x18'),auth[_0x85ed('0x9')](),controller[_0x85ed('0x19')]);router[_0x85ed('0x7')](_0x85ed('0x1a'),auth[_0x85ed('0x9')](),controller[_0x85ed('0x1b')]);router[_0x85ed('0x7')](_0x85ed('0x1c'),auth[_0x85ed('0x9')](),controller[_0x85ed('0x1d')]);router['get'](_0x85ed('0x1e'),auth['isAuthenticated'](),controller[_0x85ed('0x1f')]);router[_0x85ed('0x7')](_0x85ed('0x20'),auth['isAuthenticated'](),controller[_0x85ed('0x21')]);router[_0x85ed('0x7')](_0x85ed('0x22'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0x85ed('0x7')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x85ed('0x9')](),controller[_0x85ed('0x23')]);router[_0x85ed('0x7')](_0x85ed('0x24'),auth['isAuthenticated'](),controller[_0x85ed('0x25')]);router[_0x85ed('0x26')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0x85ed('0x27')]);router[_0x85ed('0x7')](_0x85ed('0x28'),auth['isAuthenticated'](),controller[_0x85ed('0x29')]);router[_0x85ed('0x7')](_0x85ed('0x2a'),auth[_0x85ed('0x9')](),controller[_0x85ed('0x2b')]);router[_0x85ed('0x7')](_0x85ed('0x2c'),auth['isAuthenticated'](),controller[_0x85ed('0x2d')]);router[_0x85ed('0x26')]('/agents/:id/capacity',auth[_0x85ed('0x9')](),controller['agentCapacity']);router[_0x85ed('0x7')](_0x85ed('0x2e'),auth[_0x85ed('0x9')](),controller['telephones']);router[_0x85ed('0x7')](_0x85ed('0x2f'),auth[_0x85ed('0x9')](),controller[_0x85ed('0x30')]);router[_0x85ed('0x7')](_0x85ed('0x31'),auth['isAuthenticated'](),controller[_0x85ed('0x32')]);router[_0x85ed('0x7')](_0x85ed('0x33'),auth[_0x85ed('0x9')](),controller[_0x85ed('0x34')]);router['get'](_0x85ed('0x35'),auth['isAuthenticated'](),controller[_0x85ed('0x36')]);router['get'](_0x85ed('0x37'),auth[_0x85ed('0x9')](),controller[_0x85ed('0x38')]);router[_0x85ed('0x7')](_0x85ed('0x39'),auth[_0x85ed('0x9')](),controller['openchannelQueuesWaitingInteractions']);router[_0x85ed('0x7')](_0x85ed('0x3a'),auth[_0x85ed('0x9')](),controller[_0x85ed('0x3b')]);router[_0x85ed('0x7')](_0x85ed('0x3c'),auth[_0x85ed('0x9')](),controller[_0x85ed('0x3d')]);router['get']('/whatsapp/queues/waitinginteractions',auth[_0x85ed('0x9')](),controller[_0x85ed('0x3e')]);router[_0x85ed('0x7')](_0x85ed('0x3f'),auth[_0x85ed('0x9')](),controller[_0x85ed('0x40')]);router[_0x85ed('0x41')](_0x85ed('0x42'),auth[_0x85ed('0x9')](),controller[_0x85ed('0x43')](_0x85ed('0x44')));router['get'](_0x85ed('0x45'),auth[_0x85ed('0x9')](),controller[_0x85ed('0x46')]);router[_0x85ed('0x41')]('/chat/queues/:id/notify',auth[_0x85ed('0x9')](),controller['queueNotify'](_0x85ed('0x47')));router['get'](_0x85ed('0x48'),auth[_0x85ed('0x9')](),controller[_0x85ed('0x49')]);router[_0x85ed('0x41')](_0x85ed('0x4a'),auth[_0x85ed('0x9')](),controller[_0x85ed('0x43')](_0x85ed('0x4b')));router['get'](_0x85ed('0x4c'),auth[_0x85ed('0x9')](),controller[_0x85ed('0x4d')]);router[_0x85ed('0x41')](_0x85ed('0x4e'),auth[_0x85ed('0x9')](),controller['queueNotify'](_0x85ed('0x4f')));router[_0x85ed('0x7')](_0x85ed('0x50'),auth[_0x85ed('0x9')](),controller[_0x85ed('0x51')]);router[_0x85ed('0x41')](_0x85ed('0x52'),auth['isAuthenticated'](),controller[_0x85ed('0x43')]('sms'));router[_0x85ed('0x41')]('/whatsapp/queues/:id/notify',auth[_0x85ed('0x9')](),controller[_0x85ed('0x43')]('whatsapp'));router['get']('/sms/queues/:id',auth[_0x85ed('0x9')](),controller['showSmsQueues']);router[_0x85ed('0x7')](_0x85ed('0x53'),auth['isAuthenticated'](),controller[_0x85ed('0x54')]);router[_0x85ed('0x41')](_0x85ed('0x55'),auth[_0x85ed('0x9')](),controller[_0x85ed('0x56')]);module[_0x85ed('0x57')]=router; \ No newline at end of file +var _0x2725=['whatsappQueues','/fax/queues','faxQueues','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound','outboundChannels','agents','/agents/:id/capacity','/telephones','telephones','trunks','/campaigns','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','/chat/queues/:id/notify','queueNotify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','whatsapp','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','multer','util','path','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','isAuthenticated','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues'];(function(_0x4d1dca,_0x50e832){var _0x58bcb2=function(_0x32ce59){while(--_0x32ce59){_0x4d1dca['push'](_0x4d1dca['shift']());}};_0x58bcb2(++_0x50e832);}(_0x2725,0x85));var _0x5272=function(_0x484c03,_0x13c1d2){_0x484c03=_0x484c03-0x0;var _0x294127=_0x2725[_0x484c03];return _0x294127;};'use strict';var multer=require(_0x5272('0x0'));var util=require(_0x5272('0x1'));var path=require(_0x5272('0x2'));var express=require('express');var router=express[_0x5272('0x3')]();var auth=require(_0x5272('0x4'));var controller=require(_0x5272('0x5'));router[_0x5272('0x6')](_0x5272('0x7'),auth['isAuthenticated'](),controller[_0x5272('0x8')]);router[_0x5272('0x6')](_0x5272('0x9'),auth['isAuthenticated'](),controller['voiceChannelMixMonitor']);router[_0x5272('0x6')](_0x5272('0xa'),auth['isAuthenticated'](),controller[_0x5272('0xb')]);router['get'](_0x5272('0xc'),auth[_0x5272('0xd')](),controller[_0x5272('0xe')]);router[_0x5272('0x6')](_0x5272('0xf'),auth[_0x5272('0xd')](),controller[_0x5272('0x10')]);router['get'](_0x5272('0x11'),auth[_0x5272('0xd')](),controller[_0x5272('0x12')]);router['get']('/mail/accounts',auth[_0x5272('0xd')](),controller['mailAccounts']);router[_0x5272('0x6')](_0x5272('0x13'),auth[_0x5272('0xd')](),controller[_0x5272('0x14')]);router['get'](_0x5272('0x15'),auth[_0x5272('0xd')](),controller[_0x5272('0x16')]);router[_0x5272('0x6')]('/whatsapp/queues',auth['isAuthenticated'](),controller[_0x5272('0x17')]);router[_0x5272('0x6')](_0x5272('0x18'),auth[_0x5272('0xd')](),controller[_0x5272('0x19')]);router[_0x5272('0x6')]('/voice/queues/preview/:id',auth[_0x5272('0xd')](),controller['voiceQueuesPreview']);router['get']('/voice/queues/channels',auth[_0x5272('0xd')](),controller[_0x5272('0x1a')]);router[_0x5272('0x6')](_0x5272('0x1b'),auth[_0x5272('0xd')](),controller[_0x5272('0x1c')]);router[_0x5272('0x6')](_0x5272('0x1d'),auth[_0x5272('0xd')](),controller[_0x5272('0x1e')]);router['get'](_0x5272('0x1f'),auth[_0x5272('0xd')](),controller['voiceQueuesChannelRedirect']);router[_0x5272('0x6')](_0x5272('0x20'),auth[_0x5272('0xd')](),controller[_0x5272('0x21')]);router['put'](_0x5272('0x20'),auth['isAuthenticated'](),controller[_0x5272('0x22')]);router[_0x5272('0x6')](_0x5272('0x23'),auth['isAuthenticated'](),controller['outbound']);router[_0x5272('0x6')]('/outbound/channels',auth[_0x5272('0xd')](),controller[_0x5272('0x24')]);router[_0x5272('0x6')]('/agents',auth[_0x5272('0xd')](),controller[_0x5272('0x25')]);router['put'](_0x5272('0x26'),auth[_0x5272('0xd')](),controller['agentCapacity']);router['get'](_0x5272('0x27'),auth[_0x5272('0xd')](),controller[_0x5272('0x28')]);router[_0x5272('0x6')]('/trunks',auth[_0x5272('0xd')](),controller[_0x5272('0x29')]);router[_0x5272('0x6')](_0x5272('0x2a'),auth[_0x5272('0xd')](),controller['campaigns']);router[_0x5272('0x6')]('/fax/accounts',auth[_0x5272('0xd')](),controller[_0x5272('0x2b')]);router['get'](_0x5272('0x2c'),auth[_0x5272('0xd')](),controller['chatQueuesWaitingInteractions']);router[_0x5272('0x6')](_0x5272('0x2d'),auth['isAuthenticated'](),controller[_0x5272('0x2e')]);router[_0x5272('0x6')](_0x5272('0x2f'),auth[_0x5272('0xd')](),controller['openchannelQueuesWaitingInteractions']);router[_0x5272('0x6')](_0x5272('0x30'),auth[_0x5272('0xd')](),controller[_0x5272('0x31')]);router[_0x5272('0x6')](_0x5272('0x32'),auth[_0x5272('0xd')](),controller[_0x5272('0x33')]);router[_0x5272('0x6')](_0x5272('0x34'),auth[_0x5272('0xd')](),controller[_0x5272('0x35')]);router[_0x5272('0x6')](_0x5272('0x36'),auth[_0x5272('0xd')](),controller[_0x5272('0x37')]);router[_0x5272('0x38')](_0x5272('0x39'),auth[_0x5272('0xd')](),controller['queueNotify'](_0x5272('0x3a')));router[_0x5272('0x6')](_0x5272('0x3b'),auth[_0x5272('0xd')](),controller['showMailQueues']);router[_0x5272('0x38')](_0x5272('0x3c'),auth[_0x5272('0xd')](),controller[_0x5272('0x3d')]('chat'));router[_0x5272('0x6')](_0x5272('0x3e'),auth['isAuthenticated'](),controller[_0x5272('0x3f')]);router['post'](_0x5272('0x40'),auth['isAuthenticated'](),controller['queueNotify'](_0x5272('0x41')));router[_0x5272('0x6')]('/fax/queues/:id',auth[_0x5272('0xd')](),controller['showFaxQueues']);router[_0x5272('0x38')](_0x5272('0x42'),auth[_0x5272('0xd')](),controller['queueNotify'](_0x5272('0x43')));router[_0x5272('0x6')](_0x5272('0x44'),auth[_0x5272('0xd')](),controller[_0x5272('0x45')]);router[_0x5272('0x38')](_0x5272('0x46'),auth[_0x5272('0xd')](),controller['queueNotify'](_0x5272('0x47')));router[_0x5272('0x38')]('/whatsapp/queues/:id/notify',auth[_0x5272('0xd')](),controller[_0x5272('0x3d')](_0x5272('0x48')));router[_0x5272('0x6')]('/sms/queues/:id',auth['isAuthenticated'](),controller[_0x5272('0x49')]);router[_0x5272('0x6')](_0x5272('0x4a'),auth[_0x5272('0xd')](),controller[_0x5272('0x4b')]);router[_0x5272('0x38')]('/agents/:id/notify',auth['isAuthenticated'](),controller[_0x5272('0x4c')]);module[_0x5272('0x4d')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 18ec094..a49afad 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 _0x7c09=['update','MessageId','agent','agentTransferTimeout','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','error','message','result','catch','status','json','sendStatus','name','send','isNil','find','rows','voiceChannels','VoiceChannels','query','then','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','VoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','interface','SIP/%s','AgentCapacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','Account','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','InteractionId','From','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User'];(function(_0x27161d,_0x1d4a9d){var _0x50eec0=function(_0x39d399){while(--_0x39d399){_0x27161d['push'](_0x27161d['shift']());}};_0x50eec0(++_0x1d4a9d);}(_0x7c09,0x102));var _0x97c0=function(_0x4a6702,_0x4305c7){_0x4a6702=_0x4a6702-0x0;var _0x5a89dc=_0x7c09[_0x4a6702];return _0x5a89dc;};'use strict';var BPromise=require('bluebird');var moment=require(_0x97c0('0x0'));var _=require(_0x97c0('0x1'));var util=require('util');var db=require(_0x97c0('0x2'))['db'];var logger=require(_0x97c0('0x3'))(_0x97c0('0x4'));var jayson=require(_0x97c0('0x5'));var amiClient=jayson[_0x97c0('0x6')][_0x97c0('0x7')]({'port':0x232a});var mailClient=jayson[_0x97c0('0x6')]['http']({'port':0x232b});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x46fdd9,_0x42c6c7,_0x2c19fa){return new BPromise(function(_0x109bc8,_0x293785){var _0x57661a=_0x2c19fa?_0x2c19fa:amiClient;return _0x57661a[_0x97c0('0x8')](_0x46fdd9,_0x42c6c7)['then'](function(_0x2d5507){if(_0x2d5507[_0x97c0('0x9')]){if(_0x2d5507['error']['code']===0x1f4){return _0x293785(_0x2d5507[_0x97c0('0x9')][_0x97c0('0xa')]);}return _0x109bc8(_0x2d5507[_0x97c0('0x9')][_0x97c0('0xa')]);}else{_0x109bc8(_0x2d5507[_0x97c0('0xb')]);}})[_0x97c0('0xc')](function(_0x7fc93){_0x293785(_0x7fc93);});});}function respondWithResult(_0x39a3b4,_0x9ca3c1){_0x9ca3c1=_0x9ca3c1||0xc8;return function(_0x2ecf34){if(_0x2ecf34){return _0x39a3b4[_0x97c0('0xd')](_0x9ca3c1)[_0x97c0('0xe')](_0x2ecf34);}return _0x39a3b4[_0x97c0('0xf')](0x194);};}function handleError(_0x514782,_0x3f2fc2){_0x3f2fc2=_0x3f2fc2||0x1f4;return function(_0x15b336){logger[_0x97c0('0x9')](_0x15b336['stack']);if(_0x15b336[_0x97c0('0x10')]){delete _0x15b336[_0x97c0('0x10')];}_0x514782[_0x97c0('0xd')](_0x3f2fc2)[_0x97c0('0x11')](_0x15b336);};}function findById(_0x482be5){return function(_0x13d46e){if(!_['isNil'](_0x482be5)&&!_[_0x97c0('0x12')](_0x13d46e)&&!_[_0x97c0('0x12')](_0x13d46e['rows'])){return _[_0x97c0('0x13')](_0x13d46e[_0x97c0('0x14')],function(_0x179d43){return _0x179d43['id']==_0x482be5;});}return null;};}exports[_0x97c0('0x15')]=function(_0x183e2e,_0x3e7a52){return respondWithRpcPromise(_0x97c0('0x16'),_0x183e2e[_0x97c0('0x17')])[_0x97c0('0x18')](respondWithResult(_0x3e7a52,null))[_0x97c0('0xc')](handleError(_0x3e7a52,null));};exports['voiceChannelMixMonitor']=function(_0x554122,_0x2b74a2){return respondWithRpcPromise(_0x97c0('0x19'),_[_0x97c0('0x1a')](_0x554122['query'],_0x554122[_0x97c0('0x1b')]))[_0x97c0('0x18')](respondWithResult(_0x2b74a2,null))[_0x97c0('0xc')](handleError(_0x2b74a2,null));};exports[_0x97c0('0x1c')]=function(_0x30fba2,_0x3a0bfb){return respondWithRpcPromise(_0x97c0('0x1d'),_['merge'](_0x30fba2[_0x97c0('0x17')],_0x30fba2[_0x97c0('0x1b')]))[_0x97c0('0x18')](respondWithResult(_0x3a0bfb,null))[_0x97c0('0xc')](handleError(_0x3a0bfb,null));};exports['voiceQueues']=function(_0x2bda6c,_0x14cada){return respondWithRpcPromise('VoiceQueues',_0x2bda6c[_0x97c0('0x17')])[_0x97c0('0x18')](respondWithResult(_0x14cada,null))[_0x97c0('0xc')](handleError(_0x14cada,null));};exports['showVoiceQueues']=function(_0x4f11ba,_0x51f258){return respondWithRpcPromise(_0x97c0('0x1e'),_0x4f11ba[_0x97c0('0x17')])[_0x97c0('0x18')](findById(_0x4f11ba[_0x97c0('0x1b')]['id']))[_0x97c0('0x18')](respondWithResult(_0x51f258,null))[_0x97c0('0xc')](handleError(_0x51f258,null));};exports['updateVoiceQueue']=function(_0x10e47e,_0x1c183f){return respondWithRpcPromise(_0x97c0('0x1f'),_['merge'](_0x10e47e[_0x97c0('0x20')],_0x10e47e[_0x97c0('0x1b')]))[_0x97c0('0x18')](respondWithResult(_0x1c183f,null))[_0x97c0('0xc')](handleError(_0x1c183f,null));};exports[_0x97c0('0x21')]=function(_0x5c4e4e,_0x59abbb){return respondWithRpcPromise(_0x97c0('0x22'),_[_0x97c0('0x1a')](_0x5c4e4e[_0x97c0('0x17')],_0x5c4e4e['params']))[_0x97c0('0x18')](respondWithResult(_0x59abbb,null))[_0x97c0('0xc')](handleError(_0x59abbb,null));};exports['voiceQueuesChannels']=function(_0x30147b,_0x22833e){return respondWithRpcPromise(_0x97c0('0x23'),_0x30147b[_0x97c0('0x17')])[_0x97c0('0x18')](respondWithResult(_0x22833e,null))[_0x97c0('0xc')](handleError(_0x22833e,null));};exports[_0x97c0('0x24')]=function(_0x1a6c4b,_0x30b927){return respondWithRpcPromise(_0x97c0('0x25'),_[_0x97c0('0x1a')](_0x1a6c4b[_0x97c0('0x17')],_0x1a6c4b[_0x97c0('0x1b')]))[_0x97c0('0x18')](respondWithResult(_0x30b927,null))[_0x97c0('0xc')](handleError(_0x30b927,null));};exports['voiceQueuesChannelHangup']=function(_0x292560,_0x1548b6){return respondWithRpcPromise(_0x97c0('0x26'),_[_0x97c0('0x1a')](_0x292560[_0x97c0('0x17')],_0x292560[_0x97c0('0x1b')]))[_0x97c0('0x18')](respondWithResult(_0x1548b6,null))[_0x97c0('0xc')](handleError(_0x1548b6,null));};exports['voiceQueuesChannelRedirect']=function(_0xd72d47,_0x4bf42a){return respondWithRpcPromise(_0x97c0('0x27'),_[_0x97c0('0x1a')](_0xd72d47[_0x97c0('0x17')],_0xd72d47[_0x97c0('0x1b')]))[_0x97c0('0x18')](respondWithResult(_0x4bf42a,null))[_0x97c0('0xc')](handleError(_0x4bf42a,null));};exports[_0x97c0('0x28')]=function(_0x225ca4,_0x38f37a){return respondWithRpcPromise(_0x97c0('0x29'),_0x225ca4[_0x97c0('0x17')])['then'](respondWithResult(_0x38f37a,null))[_0x97c0('0xc')](handleError(_0x38f37a,null));};exports[_0x97c0('0x2a')]=function(_0x4d47b1,_0x137ee1){return respondWithRpcPromise(_0x97c0('0x2b'),_0x4d47b1[_0x97c0('0x17')])[_0x97c0('0x18')](respondWithResult(_0x137ee1,null))['catch'](handleError(_0x137ee1,null));};exports[_0x97c0('0x2c')]=function(_0x4f1629,_0x1acf31){var _0x64cfcd;return respondWithRpcPromise('Agents',_0x4f1629[_0x97c0('0x17')])[_0x97c0('0x18')](function(_0xd728dd){_0x64cfcd=_0xd728dd;return respondWithRpcPromise(_0x97c0('0x2d'),_0x4f1629[_0x97c0('0x17')],routingClient);})[_0x97c0('0x18')](function(_0x36b3d0){return _[_0x97c0('0x1a')]({},_0x36b3d0,_0x64cfcd);})[_0x97c0('0x18')](respondWithResult(_0x1acf31,null))[_0x97c0('0xc')](handleError(_0x1acf31,null));};exports[_0x97c0('0x2e')]=function(_0x2cca4c,_0x1351d2){if(_0x2cca4c['body']&&_0x2cca4c[_0x97c0('0x20')][_0x97c0('0x2f')]&&_0x2cca4c[_0x97c0('0x30')]&&_0x2cca4c[_0x97c0('0x30')][_0x97c0('0x10')]){for(var _0x375ebc in _0x2cca4c[_0x97c0('0x20')]['interaction']){if(_0x2cca4c['body'][_0x97c0('0x2f')][_0x97c0('0x31')](_0x375ebc)){db[_0x97c0('0x32')][_0x97c0('0x33')]({'where':{'channel':_0x375ebc,'membername':_0x2cca4c[_0x97c0('0x30')]['name'],'type':'INTERACTION','exitAt':null,'uniqueid':_0x2cca4c['body'][_0x97c0('0x2f')][_0x375ebc]&&_0x2cca4c['body']['interaction'][_0x375ebc][_0x97c0('0x34')]?{'$notIn':_0x2cca4c[_0x97c0('0x20')][_0x97c0('0x2f')][_0x375ebc]}:{'$ne':null}}})[_0x97c0('0x18')](function(_0x2f538b){var _0x483656=moment()[_0x97c0('0x35')](_0x97c0('0x36'));for(var _0x342eeb=0x0,_0x10a8ea=_0x2f538b[_0x97c0('0x34')];_0x342eeb<_0x10a8ea;_0x342eeb+=0x1){_0x2f538b[_0x342eeb][_0x97c0('0x37')]({'exitAt':_0x483656});}});for(var _0x444e41=0x0;_0x444e41<_0x2cca4c[_0x97c0('0x20')][_0x97c0('0x2f')][_0x375ebc][_0x97c0('0x34')];_0x444e41+=0x1){db['MemberReport'][_0x97c0('0x38')]({'where':{'channel':_0x375ebc,'membername':_0x2cca4c[_0x97c0('0x30')][_0x97c0('0x10')],'type':_0x97c0('0x39'),'uniqueid':_0x2cca4c['body']['interaction'][_0x375ebc][_0x444e41],'exitAt':null},'defaults':{'channel':_0x375ebc,'membername':_0x2cca4c[_0x97c0('0x30')][_0x97c0('0x10')],'interface':_[_0x97c0('0x12')](_0x2cca4c['user'][_0x97c0('0x3a')])?util[_0x97c0('0x35')](_0x97c0('0x3b'),_0x2cca4c[_0x97c0('0x30')][_0x97c0('0x10')]):_0x2cca4c['user'][_0x97c0('0x3a')],'type':_0x97c0('0x39'),'enterAt':moment()[_0x97c0('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x2cca4c[_0x97c0('0x30')]['internal'],'uniqueid':_0x2cca4c['body'][_0x97c0('0x2f')][_0x375ebc][_0x444e41]}});}}}}return respondWithRpcPromise(_0x97c0('0x3c'),{'id':_0x2cca4c[_0x97c0('0x1b')]['id'],'capacity':_0x2cca4c['body']['capacity']},routingClient)['then'](respondWithResult(_0x1351d2,null))[_0x97c0('0xc')](handleError(_0x1351d2,null));};exports[_0x97c0('0x3d')]=function(_0x3afef4,_0xdb2767){return respondWithRpcPromise(_0x97c0('0x3e'),_0x3afef4[_0x97c0('0x17')])[_0x97c0('0x18')](respondWithResult(_0xdb2767,null))['catch'](handleError(_0xdb2767,null));};exports[_0x97c0('0x3f')]=function(_0x3f074b,_0x20cd9c){return respondWithRpcPromise(_0x97c0('0x40'),_0x3f074b[_0x97c0('0x17')])[_0x97c0('0x18')](respondWithResult(_0x20cd9c,null))['catch'](handleError(_0x20cd9c,null));};exports[_0x97c0('0x41')]=function(_0x86a497,_0x4fbc1e){return respondWithRpcPromise(_0x97c0('0x42'),_0x86a497[_0x97c0('0x17')])[_0x97c0('0x18')](respondWithResult(_0x4fbc1e,null))[_0x97c0('0xc')](handleError(_0x4fbc1e,null));};exports[_0x97c0('0x43')]=function(_0x18992d,_0x47298f){return respondWithRpcPromise('ChatQueues',_0x18992d[_0x97c0('0x17')],routingClient)[_0x97c0('0x18')](respondWithResult(_0x47298f,null))[_0x97c0('0xc')](handleError(_0x47298f,null));};exports[_0x97c0('0x44')]=function(_0x154317,_0x2f1571){return respondWithRpcPromise(_0x97c0('0x45'),_0x154317[_0x97c0('0x17')],routingClient)[_0x97c0('0x18')](findById(_0x154317[_0x97c0('0x1b')]['id']))[_0x97c0('0x18')](respondWithResult(_0x2f1571,null))[_0x97c0('0xc')](handleError(_0x2f1571,null));};exports[_0x97c0('0x46')]=function(_0x57766f,_0x771495){return respondWithRpcPromise(_0x97c0('0x47'),_0x57766f[_0x97c0('0x17')],routingClient)[_0x97c0('0x18')](respondWithResult(_0x771495,null))[_0x97c0('0xc')](handleError(_0x771495,null));};exports[_0x97c0('0x48')]=function(_0x481f5b,_0x18a6c0){return respondWithRpcPromise(_0x97c0('0x47'),_0x481f5b['query'],routingClient)[_0x97c0('0x18')](findById(_0x481f5b[_0x97c0('0x1b')]['id']))[_0x97c0('0x18')](respondWithResult(_0x18a6c0,null))['catch'](handleError(_0x18a6c0,null));};exports[_0x97c0('0x49')]=function(_0x4c4fb2,_0x25c750){return respondWithRpcPromise(_0x97c0('0x4a'),_0x4c4fb2[_0x97c0('0x17')],mailClient)[_0x97c0('0x18')](respondWithResult(_0x25c750,null))[_0x97c0('0xc')](handleError(_0x25c750,null));};exports[_0x97c0('0x4b')]=function(_0x52643e,_0x3349df){return respondWithRpcPromise(_0x97c0('0x4c'),_0x52643e[_0x97c0('0x17')],routingClient)[_0x97c0('0x18')](respondWithResult(_0x3349df,null))['catch'](handleError(_0x3349df,null));};exports[_0x97c0('0x4d')]=function(_0x3795db,_0x102f68){return respondWithRpcPromise(_0x97c0('0x4c'),_0x3795db['query'],routingClient)[_0x97c0('0x18')](findById(_0x3795db[_0x97c0('0x1b')]['id']))[_0x97c0('0x18')](respondWithResult(_0x102f68,null))[_0x97c0('0xc')](handleError(_0x102f68,null));};exports['smsQueues']=function(_0x32881c,_0x3c4c27){return respondWithRpcPromise(_0x97c0('0x4e'),_0x32881c['query'],routingClient)[_0x97c0('0x18')](respondWithResult(_0x3c4c27,null))[_0x97c0('0xc')](handleError(_0x3c4c27,null));};exports[_0x97c0('0x4f')]=function(_0x32e392,_0x373c34){return respondWithRpcPromise(_0x97c0('0x4e'),_0x32e392[_0x97c0('0x17')],routingClient)['then'](findById(_0x32e392['params']['id']))[_0x97c0('0x18')](respondWithResult(_0x373c34,null))[_0x97c0('0xc')](handleError(_0x373c34,null));};exports['whatsappQueues']=function(_0x366a01,_0x5a4738){return respondWithRpcPromise('WhatsappQueues',_0x366a01[_0x97c0('0x17')],routingClient)['then'](respondWithResult(_0x5a4738,null))[_0x97c0('0xc')](handleError(_0x5a4738,null));};exports[_0x97c0('0x50')]=function(_0x56be23,_0x496336){return respondWithRpcPromise('WhatsappQueues',_0x56be23[_0x97c0('0x17')],routingClient)['then'](findById(_0x56be23[_0x97c0('0x1b')]['id']))[_0x97c0('0x18')](respondWithResult(_0x496336,null))[_0x97c0('0xc')](handleError(_0x496336,null));};exports[_0x97c0('0x51')]=function(_0x400a8d,_0x321460){return respondWithRpcPromise(_0x97c0('0x52'),_0x400a8d[_0x97c0('0x17')],routingClient)[_0x97c0('0x18')](respondWithResult(_0x321460,null))[_0x97c0('0xc')](handleError(_0x321460,null));};exports[_0x97c0('0x53')]=function(_0x536f72,_0x1c1182){return respondWithRpcPromise(_0x97c0('0x52'),_0x536f72[_0x97c0('0x17')],routingClient)[_0x97c0('0x18')](findById(_0x536f72[_0x97c0('0x1b')]['id']))['then'](respondWithResult(_0x1c1182,null))[_0x97c0('0xc')](handleError(_0x1c1182,null));};exports[_0x97c0('0x54')]=function(_0x579f54,_0x4116c9){return respondWithRpcPromise(_0x97c0('0x55'),_0x579f54[_0x97c0('0x17')])['then'](respondWithResult(_0x4116c9,null))[_0x97c0('0xc')](handleError(_0x4116c9,null));};exports[_0x97c0('0x56')]=function(_0x10f1aa,_0x165c72){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x10f1aa['query'],routingClient)['then'](respondWithResult(_0x165c72,null))[_0x97c0('0xc')](handleError(_0x165c72,null));};exports[_0x97c0('0x57')]=function(_0x442bba,_0x41f8e7){return respondWithRpcPromise(_0x97c0('0x58'),_0x442bba[_0x97c0('0x17')],routingClient)[_0x97c0('0x18')](respondWithResult(_0x41f8e7,null))[_0x97c0('0xc')](handleError(_0x41f8e7,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x52d9d9,_0x199abc){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x52d9d9['query'],routingClient)['then'](respondWithResult(_0x199abc,null))[_0x97c0('0xc')](handleError(_0x199abc,null));};exports[_0x97c0('0x59')]=function(_0x123a99,_0x30968e){return respondWithRpcPromise(_0x97c0('0x5a'),_0x123a99['query'],routingClient)['then'](function(_0x35ced3){if(_0x123a99[_0x97c0('0x17')][_0x97c0('0x5b')]!==undefined){var _0x3a8ac0=_(_0x35ced3['rows'])[_0x97c0('0x5c')]([_0x123a99['query'][_0x97c0('0x5b')],_0x123a99[_0x97c0('0x1b')]['id']])[_0x97c0('0x5d')](_0x97c0('0x5e'))[_0x97c0('0x5f')]()[_0x97c0('0x60')]();return _0x35ced3[_0x97c0('0x14')][_0x97c0('0x5c')](function(_0x465a92){return _0x3a8ac0[_0x97c0('0x61')](_0x465a92['queue_id'])>-0x1;});}else{return _0x35ced3[_0x97c0('0x14')]['filter'](function(_0x5b8ebd){return _0x5b8ebd[_0x97c0('0x5e')]===parseInt(_0x123a99[_0x97c0('0x1b')]['id']);});}})['then'](respondWithResult(_0x30968e,null))[_0x97c0('0xc')](handleError(_0x30968e,null));};exports['smsQueuesWaitingInteractions']=function(_0x1f2380,_0x24a81c){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x1f2380[_0x97c0('0x17')],routingClient)['then'](respondWithResult(_0x24a81c,null))['catch'](handleError(_0x24a81c,null));};exports['whatsappQueuesWaitingInteractions']=function(_0xab71f4,_0x12bb6e){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0xab71f4[_0x97c0('0x17')],routingClient)[_0x97c0('0x18')](respondWithResult(_0x12bb6e,null))[_0x97c0('0xc')](handleError(_0x12bb6e,null));};exports[_0x97c0('0x62')]=function(_0x41b864,_0x11db50){return respondWithRpcPromise(_0x97c0('0x63'),_0x41b864[_0x97c0('0x17')],routingClient)['then'](respondWithResult(_0x11db50,null))[_0x97c0('0xc')](handleError(_0x11db50,null));};exports['queueNotify']=function(_0x597cd1){return function(_0x4062f8,_0x4f9307){var _0x3f69a6,_0x15f953;var _0x567e15=_[_0x97c0('0x64')](_0x597cd1);var _0x344d5f=_0x597cd1===_0x97c0('0x65')?_0x97c0('0x66'):_0x97c0('0x67');return db[_0x567e15+'Queue'][_0x97c0('0x68')]({'raw':!![],'where':{'id':_0x4062f8[_0x97c0('0x1b')]['id']}})[_0x97c0('0x18')](function(_0x58e7c0){if(_[_0x97c0('0x12')](_0x58e7c0)){throw new Error(_0x567e15+_0x97c0('0x69'));}_0x3f69a6=_0x58e7c0;return db[_0x567e15+_0x97c0('0x6a')][_0x97c0('0x68')]({'where':{'id':_0x4062f8['body'][_0x97c0('0x6b')]},'include':[{'model':db[_0x567e15+_0x97c0('0x6c')],'as':_0x97c0('0x6c')},{'model':db[_0x567e15+_0x344d5f],'as':_0x97c0('0x67')}]});})[_0x97c0('0x18')](function(_0x5828f7){if(_[_0x97c0('0x12')](_0x5828f7)){throw new Error(_0x567e15+_0x97c0('0x6d'));}_0x15f953=_0x5828f7;return _0x5828f7['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x372415={'uniqueid':_0x597cd1+'.'+_0x15f953['id']+'.'+_0x15f953[_0x97c0('0x6c')]['id'],'FromUserId':_0x4062f8[_0x97c0('0x30')]['id'],'type':'queue'};_0x372415[_0x567e15+'MessageId']=_0x15f953['id'];_0x372415[_0x567e15+_0x97c0('0x6e')]=_0x15f953['Interaction']['id'];_0x372415[_0x97c0('0x6f')+_0x567e15+_0x344d5f+'Id']=_0x15f953[_0x97c0('0x67')]['id'];_0x372415['To'+_0x567e15+_0x97c0('0x70')]=_0x3f69a6['id'];return db[_0x567e15+_0x97c0('0x71')][_0x97c0('0x72')](_0x372415);})[_0x97c0('0x18')](function(){return respondWithRpcPromise(_0x97c0('0x73'),{'channel':_0x597cd1,'interaction':_0x15f953['Interaction'],'message':_0x15f953,'account':_0x15f953[_0x97c0('0x67')],'applications':[{'id':0x0,'priority':0x1,'app':_0x97c0('0x74'),'appdata':_0x3f69a6[_0x97c0('0x10')]+','+(_0x15f953[_0x97c0('0x67')][_0x97c0('0x75')]||0x12c),'interval':_0x97c0('0x76')}]},routingClient);})[_0x97c0('0x18')](respondWithResult(_0x4f9307,null))[_0x97c0('0xc')](handleError(_0x4f9307,null));};};exports[_0x97c0('0x77')]=function(_0x15b27f,_0x1cc32c){var _0x1b2e52,_0x3c4c8e;if(_[_0x97c0('0x12')](_0x15b27f['body'][_0x97c0('0x78')])){throw new Error(_0x97c0('0x79'));}var _0x2f9ffe=_0x15b27f[_0x97c0('0x20')]['channel'];var _0x1eb0c7=_[_0x97c0('0x64')](_0x2f9ffe);var _0x6b955=_0x2f9ffe===_0x97c0('0x65')?_0x97c0('0x66'):_0x97c0('0x67');return db[_0x97c0('0x7a')]['findOne']({'raw':!![],'where':{'id':_0x15b27f[_0x97c0('0x1b')]['id'],'role':'agent'}})[_0x97c0('0x18')](function(_0x1822b5){if(_[_0x97c0('0x12')](_0x1822b5)){throw new Error('Agent\x20not\x20found');}_0x1b2e52=_0x1822b5;return db[_0x1eb0c7+_0x97c0('0x6a')][_0x97c0('0x68')]({'where':{'id':_0x15b27f[_0x97c0('0x20')][_0x97c0('0x6b')]},'include':[{'model':db[_0x1eb0c7+_0x97c0('0x6c')],'as':'Interaction'},{'model':db[_0x1eb0c7+_0x6b955],'as':_0x97c0('0x67')}]});})['then'](function(_0x2db5b0){if(_[_0x97c0('0x12')](_0x2db5b0)){throw new Error(_0x1eb0c7+'\x20Message\x20not\x20found');}_0x3c4c8e=_0x2db5b0;return _0x2db5b0[_0x97c0('0x7b')]({'read':0x0,'readAt':null,'UserId':null});})[_0x97c0('0x18')](function(){var _0x1419cd={'uniqueid':_0x2f9ffe+'.'+_0x3c4c8e['id']+'.'+_0x3c4c8e[_0x97c0('0x6c')]['id'],'FromUserId':_0x15b27f[_0x97c0('0x30')]['id'],'type':_0x97c0('0x74'),'ToUserId':_0x1b2e52['id']};_0x1419cd[_0x1eb0c7+_0x97c0('0x7c')]=_0x3c4c8e['id'];_0x1419cd[_0x1eb0c7+_0x97c0('0x6e')]=_0x3c4c8e['Interaction']['id'];_0x1419cd[_0x97c0('0x6f')+_0x1eb0c7+_0x6b955+'Id']=_0x3c4c8e[_0x97c0('0x67')]['id'];return db[_0x1eb0c7+_0x97c0('0x71')]['create'](_0x1419cd);})['then'](function(){return respondWithRpcPromise(_0x97c0('0x73'),{'channel':_0x2f9ffe,'interaction':_0x3c4c8e[_0x97c0('0x6c')],'message':_0x3c4c8e,'account':_0x3c4c8e[_0x97c0('0x67')],'applications':[{'id':0x0,'priority':0x1,'app':_0x97c0('0x7d'),'appdata':_0x1b2e52[_0x97c0('0x10')]+','+(_0x3c4c8e[_0x97c0('0x67')][_0x97c0('0x7e')]||0x12c),'interval':_0x97c0('0x76')}]},routingClient);})[_0x97c0('0x18')](respondWithResult(_0x1cc32c,null))[_0x97c0('0xc')](handleError(_0x1cc32c,null));}; \ No newline at end of file +var _0x7bae=['agent','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','rows','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','InteractionId','QueueId','TransferReport','queue','queueTransferTimeout','Channel\x20field\x20is\x20mandatory','channel','User','Agent\x20not\x20found','MessageId','From','Start','agentTransferTimeout','*,*,*,*','lodash','util','../../config/logger','jayson/promise','client','http','request','error','code','message','result','status','json','sendStatus','stack','name','isNil','voiceChannels','VoiceChannels','then','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','query','showVoiceQueues','VoiceQueues','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','outbound','Outbound','outboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','MemberReport','findOrCreate','interface','SIP/%s'];(function(_0x58d09b,_0x45fe92){var _0xc81a62=function(_0x595183){while(--_0x595183){_0x58d09b['push'](_0x58d09b['shift']());}};_0xc81a62(++_0x45fe92);}(_0x7bae,0x13b));var _0xe7ba=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x7bae[_0x455c6c];return _0x488242;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0xe7ba('0x0'));var util=require(_0xe7ba('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0xe7ba('0x2'))('api');var jayson=require(_0xe7ba('0x3'));var amiClient=jayson[_0xe7ba('0x4')][_0xe7ba('0x5')]({'port':0x232a});var mailClient=jayson[_0xe7ba('0x4')][_0xe7ba('0x5')]({'port':0x232b});var routingClient=jayson[_0xe7ba('0x4')][_0xe7ba('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x3c5e59,_0x10b307,_0x34fb18){return new BPromise(function(_0x160565,_0x27b1d5){var _0x41c39d=_0x34fb18?_0x34fb18:amiClient;return _0x41c39d[_0xe7ba('0x6')](_0x3c5e59,_0x10b307)['then'](function(_0x3df8bf){if(_0x3df8bf[_0xe7ba('0x7')]){if(_0x3df8bf[_0xe7ba('0x7')][_0xe7ba('0x8')]===0x1f4){return _0x27b1d5(_0x3df8bf[_0xe7ba('0x7')][_0xe7ba('0x9')]);}return _0x160565(_0x3df8bf[_0xe7ba('0x7')][_0xe7ba('0x9')]);}else{_0x160565(_0x3df8bf[_0xe7ba('0xa')]);}})['catch'](function(_0xf4fcb0){_0x27b1d5(_0xf4fcb0);});});}function respondWithResult(_0x588c8b,_0x602b1){_0x602b1=_0x602b1||0xc8;return function(_0x45229c){if(_0x45229c){return _0x588c8b[_0xe7ba('0xb')](_0x602b1)[_0xe7ba('0xc')](_0x45229c);}return _0x588c8b[_0xe7ba('0xd')](0x194);};}function handleError(_0x41369f,_0x561dbb){_0x561dbb=_0x561dbb||0x1f4;return function(_0x561c48){logger[_0xe7ba('0x7')](_0x561c48[_0xe7ba('0xe')]);if(_0x561c48[_0xe7ba('0xf')]){delete _0x561c48['name'];}_0x41369f[_0xe7ba('0xb')](_0x561dbb)['send'](_0x561c48);};}function findById(_0x590bab){return function(_0x5e9176){if(!_[_0xe7ba('0x10')](_0x590bab)&&!_['isNil'](_0x5e9176)&&!_[_0xe7ba('0x10')](_0x5e9176['rows'])){return _['find'](_0x5e9176['rows'],function(_0x3f326a){return _0x3f326a['id']==_0x590bab;});}return null;};}exports[_0xe7ba('0x11')]=function(_0x39ca38,_0x3c06c3){return respondWithRpcPromise(_0xe7ba('0x12'),_0x39ca38['query'])[_0xe7ba('0x13')](respondWithResult(_0x3c06c3,null))[_0xe7ba('0x14')](handleError(_0x3c06c3,null));};exports[_0xe7ba('0x15')]=function(_0x136ec6,_0x4aaf35){return respondWithRpcPromise(_0xe7ba('0x16'),_[_0xe7ba('0x17')](_0x136ec6['query'],_0x136ec6[_0xe7ba('0x18')]))[_0xe7ba('0x13')](respondWithResult(_0x4aaf35,null))[_0xe7ba('0x14')](handleError(_0x4aaf35,null));};exports[_0xe7ba('0x19')]=function(_0x394b69,_0x2acfc2){return respondWithRpcPromise(_0xe7ba('0x1a'),_[_0xe7ba('0x17')](_0x394b69[_0xe7ba('0x1b')],_0x394b69[_0xe7ba('0x18')]))['then'](respondWithResult(_0x2acfc2,null))['catch'](handleError(_0x2acfc2,null));};exports['voiceQueues']=function(_0x4cd124,_0x4363a8){return respondWithRpcPromise('VoiceQueues',_0x4cd124['query'])['then'](respondWithResult(_0x4363a8,null))[_0xe7ba('0x14')](handleError(_0x4363a8,null));};exports[_0xe7ba('0x1c')]=function(_0xe32862,_0x2ea78a){return respondWithRpcPromise(_0xe7ba('0x1d'),_0xe32862[_0xe7ba('0x1b')])[_0xe7ba('0x13')](findById(_0xe32862[_0xe7ba('0x18')]['id']))['then'](respondWithResult(_0x2ea78a,null))[_0xe7ba('0x14')](handleError(_0x2ea78a,null));};exports['updateVoiceQueue']=function(_0x102925,_0x92fe7){return respondWithRpcPromise(_0xe7ba('0x1e'),_['merge'](_0x102925['body'],_0x102925[_0xe7ba('0x18')]))[_0xe7ba('0x13')](respondWithResult(_0x92fe7,null))[_0xe7ba('0x14')](handleError(_0x92fe7,null));};exports[_0xe7ba('0x1f')]=function(_0x268308,_0x5279dd){return respondWithRpcPromise(_0xe7ba('0x20'),_[_0xe7ba('0x17')](_0x268308['query'],_0x268308[_0xe7ba('0x18')]))['then'](respondWithResult(_0x5279dd,null))['catch'](handleError(_0x5279dd,null));};exports[_0xe7ba('0x21')]=function(_0x134f21,_0x1be947){return respondWithRpcPromise('VoiceQueuesChannels',_0x134f21[_0xe7ba('0x1b')])['then'](respondWithResult(_0x1be947,null))[_0xe7ba('0x14')](handleError(_0x1be947,null));};exports[_0xe7ba('0x22')]=function(_0x3b0a69,_0x27a8d4){return respondWithRpcPromise(_0xe7ba('0x23'),_['merge'](_0x3b0a69[_0xe7ba('0x1b')],_0x3b0a69[_0xe7ba('0x18')]))['then'](respondWithResult(_0x27a8d4,null))[_0xe7ba('0x14')](handleError(_0x27a8d4,null));};exports[_0xe7ba('0x24')]=function(_0x499d3b,_0x524726){return respondWithRpcPromise(_0xe7ba('0x25'),_[_0xe7ba('0x17')](_0x499d3b['query'],_0x499d3b[_0xe7ba('0x18')]))[_0xe7ba('0x13')](respondWithResult(_0x524726,null))[_0xe7ba('0x14')](handleError(_0x524726,null));};exports['voiceQueuesChannelRedirect']=function(_0x3e6eb7,_0x43b313){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xe7ba('0x17')](_0x3e6eb7[_0xe7ba('0x1b')],_0x3e6eb7[_0xe7ba('0x18')]))['then'](respondWithResult(_0x43b313,null))['catch'](handleError(_0x43b313,null));};exports[_0xe7ba('0x26')]=function(_0x2ebb27,_0x58d2a){return respondWithRpcPromise(_0xe7ba('0x27'),_0x2ebb27[_0xe7ba('0x1b')])['then'](respondWithResult(_0x58d2a,null))[_0xe7ba('0x14')](handleError(_0x58d2a,null));};exports[_0xe7ba('0x28')]=function(_0x3139a6,_0x23a912){return respondWithRpcPromise('OutboundChannels',_0x3139a6[_0xe7ba('0x1b')])[_0xe7ba('0x13')](respondWithResult(_0x23a912,null))[_0xe7ba('0x14')](handleError(_0x23a912,null));};exports[_0xe7ba('0x29')]=function(_0x35a5f3,_0x3793c6){var _0x124cc4;return respondWithRpcPromise('Agents',_0x35a5f3[_0xe7ba('0x1b')])[_0xe7ba('0x13')](function(_0x359a4d){_0x124cc4=_0x359a4d;return respondWithRpcPromise(_0xe7ba('0x2a'),_0x35a5f3[_0xe7ba('0x1b')],routingClient);})[_0xe7ba('0x13')](function(_0x220c3b){return _[_0xe7ba('0x17')]({},_0x220c3b,_0x124cc4);})[_0xe7ba('0x13')](respondWithResult(_0x3793c6,null))['catch'](handleError(_0x3793c6,null));};exports[_0xe7ba('0x2b')]=function(_0x417734,_0x5d4be2){if(_0x417734['body']&&_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')]&&_0x417734[_0xe7ba('0x2e')]&&_0x417734['user'][_0xe7ba('0xf')]){for(var _0x82246e in _0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')]){if(_0x417734[_0xe7ba('0x2c')]['interaction'][_0xe7ba('0x2f')](_0x82246e)){db['MemberReport'][_0xe7ba('0x30')]({'where':{'channel':_0x82246e,'membername':_0x417734[_0xe7ba('0x2e')][_0xe7ba('0xf')],'type':_0xe7ba('0x31'),'exitAt':null,'uniqueid':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e]&&_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e]['length']?{'$notIn':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e]}:{'$ne':null}}})[_0xe7ba('0x13')](function(_0x37dcaa){var _0x3620bc=moment()[_0xe7ba('0x32')](_0xe7ba('0x33'));for(var _0x2c54ac=0x0,_0x45f49a=_0x37dcaa[_0xe7ba('0x34')];_0x2c54ac<_0x45f49a;_0x2c54ac+=0x1){_0x37dcaa[_0x2c54ac]['updateAttributes']({'exitAt':_0x3620bc});}});for(var _0x19ccde=0x0;_0x19ccde<_0x417734['body'][_0xe7ba('0x2d')][_0x82246e][_0xe7ba('0x34')];_0x19ccde+=0x1){db[_0xe7ba('0x35')][_0xe7ba('0x36')]({'where':{'channel':_0x82246e,'membername':_0x417734[_0xe7ba('0x2e')][_0xe7ba('0xf')],'type':'INTERACTION','uniqueid':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e][_0x19ccde],'exitAt':null},'defaults':{'channel':_0x82246e,'membername':_0x417734[_0xe7ba('0x2e')][_0xe7ba('0xf')],'interface':_[_0xe7ba('0x10')](_0x417734[_0xe7ba('0x2e')][_0xe7ba('0x37')])?util[_0xe7ba('0x32')](_0xe7ba('0x38'),_0x417734[_0xe7ba('0x2e')][_0xe7ba('0xf')]):_0x417734['user'][_0xe7ba('0x37')],'type':_0xe7ba('0x31'),'enterAt':moment()[_0xe7ba('0x32')](_0xe7ba('0x33')),'role':_0xe7ba('0x39'),'internal':_0x417734[_0xe7ba('0x2e')]['internal'],'uniqueid':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e][_0x19ccde]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x417734[_0xe7ba('0x18')]['id'],'capacity':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x3a')]},routingClient)[_0xe7ba('0x13')](respondWithResult(_0x5d4be2,null))['catch'](handleError(_0x5d4be2,null));};exports['telephones']=function(_0xa80cf,_0x2cfdc3){return respondWithRpcPromise(_0xe7ba('0x3b'),_0xa80cf['query'])[_0xe7ba('0x13')](respondWithResult(_0x2cfdc3,null))[_0xe7ba('0x14')](handleError(_0x2cfdc3,null));};exports[_0xe7ba('0x3c')]=function(_0x45bcbd,_0x14beb3){return respondWithRpcPromise(_0xe7ba('0x3d'),_0x45bcbd[_0xe7ba('0x1b')])['then'](respondWithResult(_0x14beb3,null))[_0xe7ba('0x14')](handleError(_0x14beb3,null));};exports[_0xe7ba('0x3e')]=function(_0x316b51,_0x5863c8){return respondWithRpcPromise(_0xe7ba('0x3f'),_0x316b51[_0xe7ba('0x1b')])['then'](respondWithResult(_0x5863c8,null))[_0xe7ba('0x14')](handleError(_0x5863c8,null));};exports[_0xe7ba('0x40')]=function(_0x4da728,_0x3b4ae4){return respondWithRpcPromise('ChatQueues',_0x4da728[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x3b4ae4,null))[_0xe7ba('0x14')](handleError(_0x3b4ae4,null));};exports['showChatQueues']=function(_0x38829a,_0x1128be){return respondWithRpcPromise(_0xe7ba('0x41'),_0x38829a[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x38829a['params']['id']))[_0xe7ba('0x13')](respondWithResult(_0x1128be,null))[_0xe7ba('0x14')](handleError(_0x1128be,null));};exports[_0xe7ba('0x42')]=function(_0x19159c,_0x435dee){return respondWithRpcPromise('MailQueues',_0x19159c[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x435dee,null))[_0xe7ba('0x14')](handleError(_0x435dee,null));};exports[_0xe7ba('0x43')]=function(_0x57b23e,_0x3e31c1){return respondWithRpcPromise(_0xe7ba('0x44'),_0x57b23e[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x57b23e[_0xe7ba('0x18')]['id']))[_0xe7ba('0x13')](respondWithResult(_0x3e31c1,null))['catch'](handleError(_0x3e31c1,null));};exports[_0xe7ba('0x45')]=function(_0x103762,_0x3bd82f){return respondWithRpcPromise('MailAccounts',_0x103762[_0xe7ba('0x1b')],mailClient)[_0xe7ba('0x13')](respondWithResult(_0x3bd82f,null))[_0xe7ba('0x14')](handleError(_0x3bd82f,null));};exports[_0xe7ba('0x46')]=function(_0x45fb0f,_0x162d7f){return respondWithRpcPromise(_0xe7ba('0x47'),_0x45fb0f[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x162d7f,null))[_0xe7ba('0x14')](handleError(_0x162d7f,null));};exports[_0xe7ba('0x48')]=function(_0x27422d,_0x4a5c8c){return respondWithRpcPromise(_0xe7ba('0x47'),_0x27422d[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x27422d['params']['id']))[_0xe7ba('0x13')](respondWithResult(_0x4a5c8c,null))['catch'](handleError(_0x4a5c8c,null));};exports[_0xe7ba('0x49')]=function(_0x194dff,_0x781e04){return respondWithRpcPromise('SmsQueues',_0x194dff['query'],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x781e04,null))[_0xe7ba('0x14')](handleError(_0x781e04,null));};exports[_0xe7ba('0x4a')]=function(_0x4de4c9,_0x3ba4fd){return respondWithRpcPromise(_0xe7ba('0x4b'),_0x4de4c9[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x4de4c9[_0xe7ba('0x18')]['id']))['then'](respondWithResult(_0x3ba4fd,null))[_0xe7ba('0x14')](handleError(_0x3ba4fd,null));};exports[_0xe7ba('0x4c')]=function(_0x70ce9c,_0x50cc8b){return respondWithRpcPromise(_0xe7ba('0x4d'),_0x70ce9c[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x50cc8b,null))[_0xe7ba('0x14')](handleError(_0x50cc8b,null));};exports[_0xe7ba('0x4e')]=function(_0x29c046,_0x6c8738){return respondWithRpcPromise(_0xe7ba('0x4d'),_0x29c046[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x29c046['params']['id']))[_0xe7ba('0x13')](respondWithResult(_0x6c8738,null))[_0xe7ba('0x14')](handleError(_0x6c8738,null));};exports[_0xe7ba('0x4f')]=function(_0xa6da9e,_0x4d8773){return respondWithRpcPromise('FaxQueues',_0xa6da9e[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x4d8773,null))[_0xe7ba('0x14')](handleError(_0x4d8773,null));};exports['showFaxQueues']=function(_0x53ebd1,_0x5561cc){return respondWithRpcPromise(_0xe7ba('0x50'),_0x53ebd1[_0xe7ba('0x1b')],routingClient)['then'](findById(_0x53ebd1[_0xe7ba('0x18')]['id']))['then'](respondWithResult(_0x5561cc,null))[_0xe7ba('0x14')](handleError(_0x5561cc,null));};exports['faxAccounts']=function(_0x11aded,_0x4ebe4a){return respondWithRpcPromise('FaxAccounts',_0x11aded[_0xe7ba('0x1b')])[_0xe7ba('0x13')](respondWithResult(_0x4ebe4a,null))[_0xe7ba('0x14')](handleError(_0x4ebe4a,null));};exports[_0xe7ba('0x51')]=function(_0x157d41,_0x35b755){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x157d41['query'],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x35b755,null))[_0xe7ba('0x14')](handleError(_0x35b755,null));};exports[_0xe7ba('0x52')]=function(_0x2e6e90,_0x18f23e){return respondWithRpcPromise(_0xe7ba('0x53'),_0x2e6e90[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x18f23e,null))[_0xe7ba('0x14')](handleError(_0x18f23e,null));};exports[_0xe7ba('0x54')]=function(_0x325ecb,_0x246f91){return respondWithRpcPromise(_0xe7ba('0x55'),_0x325ecb[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x246f91,null))['catch'](handleError(_0x246f91,null));};exports[_0xe7ba('0x56')]=function(_0x3acb1a,_0x5e16f1){return respondWithRpcPromise(_0xe7ba('0x55'),_0x3acb1a[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](function(_0x2471c8){if(_0x3acb1a[_0xe7ba('0x1b')][_0xe7ba('0x57')]!==undefined){var _0x24c94a=_(_0x2471c8[_0xe7ba('0x58')])[_0xe7ba('0x59')]([_0x3acb1a['query'][_0xe7ba('0x57')],_0x3acb1a['params']['id']])[_0xe7ba('0x5a')](_0xe7ba('0x5b'))[_0xe7ba('0x5c')]()['value']();return _0x2471c8[_0xe7ba('0x58')][_0xe7ba('0x59')](function(_0x2f1938){return _0x24c94a[_0xe7ba('0x5d')](_0x2f1938['queue_id'])>-0x1;});}else{return _0x2471c8[_0xe7ba('0x58')][_0xe7ba('0x59')](function(_0x433644){return _0x433644[_0xe7ba('0x5b')]===parseInt(_0x3acb1a['params']['id']);});}})[_0xe7ba('0x13')](respondWithResult(_0x5e16f1,null))[_0xe7ba('0x14')](handleError(_0x5e16f1,null));};exports[_0xe7ba('0x5e')]=function(_0x1bfb80,_0x16af73){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x1bfb80['query'],routingClient)['then'](respondWithResult(_0x16af73,null))[_0xe7ba('0x14')](handleError(_0x16af73,null));};exports[_0xe7ba('0x5f')]=function(_0x41a346,_0x27e7a5){return respondWithRpcPromise(_0xe7ba('0x60'),_0x41a346[_0xe7ba('0x1b')],routingClient)['then'](respondWithResult(_0x27e7a5,null))[_0xe7ba('0x14')](handleError(_0x27e7a5,null));};exports['faxQueuesWaitingInteractions']=function(_0x439c96,_0x2e3e28){return respondWithRpcPromise(_0xe7ba('0x61'),_0x439c96[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x2e3e28,null))[_0xe7ba('0x14')](handleError(_0x2e3e28,null));};exports['queueNotify']=function(_0x44563b){return function(_0x4904d2,_0x8cba2c){var _0x18e715,_0x1d3035;var _0x5e70d9=_[_0xe7ba('0x62')](_0x44563b);var _0x52d73a=_0x44563b===_0xe7ba('0x63')?_0xe7ba('0x64'):_0xe7ba('0x65');return db[_0x5e70d9+_0xe7ba('0x66')][_0xe7ba('0x67')]({'raw':!![],'where':{'id':_0x4904d2[_0xe7ba('0x18')]['id']}})[_0xe7ba('0x13')](function(_0x3bf6b8){if(_[_0xe7ba('0x10')](_0x3bf6b8)){throw new Error(_0x5e70d9+_0xe7ba('0x68'));}_0x18e715=_0x3bf6b8;return db[_0x5e70d9+_0xe7ba('0x69')][_0xe7ba('0x67')]({'where':{'id':_0x4904d2[_0xe7ba('0x2c')][_0xe7ba('0x6a')]},'include':[{'model':db[_0x5e70d9+_0xe7ba('0x6b')],'as':_0xe7ba('0x6b')},{'model':db[_0x5e70d9+_0x52d73a],'as':_0xe7ba('0x65')}]});})[_0xe7ba('0x13')](function(_0x691f8c){if(_[_0xe7ba('0x10')](_0x691f8c)){throw new Error(_0x5e70d9+_0xe7ba('0x6c'));}_0x1d3035=_0x691f8c;return _0x691f8c[_0xe7ba('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xe7ba('0x13')](function(){var _0x36cf6d={'uniqueid':_0x44563b+'.'+_0x1d3035['id']+'.'+_0x1d3035[_0xe7ba('0x6b')]['id'],'FromUserId':_0x4904d2['user']['id'],'type':'queue'};_0x36cf6d[_0x5e70d9+'MessageId']=_0x1d3035['id'];_0x36cf6d[_0x5e70d9+_0xe7ba('0x6e')]=_0x1d3035[_0xe7ba('0x6b')]['id'];_0x36cf6d['From'+_0x5e70d9+_0x52d73a+'Id']=_0x1d3035['Account']['id'];_0x36cf6d['To'+_0x5e70d9+_0xe7ba('0x6f')]=_0x18e715['id'];return db[_0x5e70d9+_0xe7ba('0x70')]['create'](_0x36cf6d);})[_0xe7ba('0x13')](function(){return respondWithRpcPromise('Start',{'channel':_0x44563b,'interaction':_0x1d3035['Interaction'],'message':_0x1d3035,'account':_0x1d3035['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xe7ba('0x71'),'appdata':_0x18e715[_0xe7ba('0xf')]+','+(_0x1d3035[_0xe7ba('0x65')][_0xe7ba('0x72')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xe7ba('0x13')](respondWithResult(_0x8cba2c,null))[_0xe7ba('0x14')](handleError(_0x8cba2c,null));};};exports['agentNotify']=function(_0x575170,_0x459b0c){var _0x5d5722,_0x40ae10;if(_[_0xe7ba('0x10')](_0x575170[_0xe7ba('0x2c')]['channel'])){throw new Error(_0xe7ba('0x73'));}var _0x17391f=_0x575170[_0xe7ba('0x2c')][_0xe7ba('0x74')];var _0x34b5d8=_[_0xe7ba('0x62')](_0x17391f);var _0x44c657=_0x17391f===_0xe7ba('0x63')?_0xe7ba('0x64'):_0xe7ba('0x65');return db[_0xe7ba('0x75')][_0xe7ba('0x67')]({'raw':!![],'where':{'id':_0x575170[_0xe7ba('0x18')]['id'],'role':_0xe7ba('0x39')}})[_0xe7ba('0x13')](function(_0x16b3df){if(_[_0xe7ba('0x10')](_0x16b3df)){throw new Error(_0xe7ba('0x76'));}_0x5d5722=_0x16b3df;return db[_0x34b5d8+_0xe7ba('0x69')][_0xe7ba('0x67')]({'where':{'id':_0x575170[_0xe7ba('0x2c')]['messageId']},'include':[{'model':db[_0x34b5d8+'Interaction'],'as':'Interaction'},{'model':db[_0x34b5d8+_0x44c657],'as':_0xe7ba('0x65')}]});})[_0xe7ba('0x13')](function(_0x34f0f9){if(_[_0xe7ba('0x10')](_0x34f0f9)){throw new Error(_0x34b5d8+_0xe7ba('0x6c'));}_0x40ae10=_0x34f0f9;return _0x34f0f9['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x2c86d2={'uniqueid':_0x17391f+'.'+_0x40ae10['id']+'.'+_0x40ae10['Interaction']['id'],'FromUserId':_0x575170[_0xe7ba('0x2e')]['id'],'type':_0xe7ba('0x71'),'ToUserId':_0x5d5722['id']};_0x2c86d2[_0x34b5d8+_0xe7ba('0x77')]=_0x40ae10['id'];_0x2c86d2[_0x34b5d8+_0xe7ba('0x6e')]=_0x40ae10[_0xe7ba('0x6b')]['id'];_0x2c86d2[_0xe7ba('0x78')+_0x34b5d8+_0x44c657+'Id']=_0x40ae10[_0xe7ba('0x65')]['id'];return db[_0x34b5d8+_0xe7ba('0x70')]['create'](_0x2c86d2);})[_0xe7ba('0x13')](function(){return respondWithRpcPromise(_0xe7ba('0x79'),{'channel':_0x17391f,'interaction':_0x40ae10[_0xe7ba('0x6b')],'message':_0x40ae10,'account':_0x40ae10['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x5d5722[_0xe7ba('0xf')]+','+(_0x40ae10[_0xe7ba('0x65')][_0xe7ba('0x7a')]||0x12c),'interval':_0xe7ba('0x7b')}]},routingClient);})['then'](respondWithResult(_0x459b0c,null))[_0xe7ba('0x14')](handleError(_0x459b0c,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index d997a6e..f5ac6c5 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 _0x2806=['put','update','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/run','run','post','create'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x2806,0x115));var _0x6280=function(_0x447448,_0x5cc8a8){_0x447448=_0x447448-0x0;var _0xde110f=_0x2806[_0x447448];return _0xde110f;};'use strict';var multer=require(_0x6280('0x0'));var util=require(_0x6280('0x1'));var path=require(_0x6280('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6280('0x3')]();var fs_extra=require(_0x6280('0x4'));var auth=require(_0x6280('0x5'));var interaction=require(_0x6280('0x6'));var config=require(_0x6280('0x7'));var controller=require('./schedule.controller');router[_0x6280('0x8')]('/',auth['isAuthenticated'](),controller[_0x6280('0x9')]);router[_0x6280('0x8')](_0x6280('0xa'),auth[_0x6280('0xb')](),controller[_0x6280('0xc')]);router[_0x6280('0x8')](_0x6280('0xd'),auth['isAuthenticated'](),controller[_0x6280('0xe')]);router[_0x6280('0xf')]('/',auth[_0x6280('0xb')](),controller[_0x6280('0x10')]);router[_0x6280('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x6280('0x12')]);router['delete']('/:id',auth[_0x6280('0xb')](),controller[_0x6280('0x13')]);module[_0x6280('0x14')]=router; \ No newline at end of file +var _0xd385=['/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./schedule.controller','get','isAuthenticated','index','/:id/run','run','post','put','update','delete'];(function(_0x2731f0,_0x126b1b){var _0x36a180=function(_0x44d1a9){while(--_0x44d1a9){_0x2731f0['push'](_0x2731f0['shift']());}};_0x36a180(++_0x126b1b);}(_0xd385,0xf5));var _0x5d38=function(_0x1a1e57,_0x2cb6fd){_0x1a1e57=_0x1a1e57-0x0;var _0x177217=_0xd385[_0x1a1e57];return _0x177217;};'use strict';var multer=require(_0x5d38('0x0'));var util=require(_0x5d38('0x1'));var path=require(_0x5d38('0x2'));var timeout=require(_0x5d38('0x3'));var express=require(_0x5d38('0x4'));var router=express[_0x5d38('0x5')]();var fs_extra=require(_0x5d38('0x6'));var auth=require(_0x5d38('0x7'));var interaction=require(_0x5d38('0x8'));var config=require('../../config/environment');var controller=require(_0x5d38('0x9'));router[_0x5d38('0xa')]('/',auth[_0x5d38('0xb')](),controller[_0x5d38('0xc')]);router[_0x5d38('0xa')]('/:id',auth[_0x5d38('0xb')](),controller['show']);router[_0x5d38('0xa')](_0x5d38('0xd'),auth[_0x5d38('0xb')](),controller[_0x5d38('0xe')]);router[_0x5d38('0xf')]('/',auth[_0x5d38('0xb')](),controller['create']);router[_0x5d38('0x10')]('/:id',auth[_0x5d38('0xb')](),controller[_0x5d38('0x11')]);router[_0x5d38('0x12')](_0x5d38('0x13'),auth[_0x5d38('0xb')](),controller[_0x5d38('0x14')]);module[_0x5d38('0x15')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 9a635b3..52d053e 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 _0xc728=['DATE','INTEGER','ENUM','years','days','csv','pdf','xlsx','custom','TEXT','sequelize','exports','STRING','BOOLEAN'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xc728,0x1f4));var _0x8c72=function(_0x5b369e,_0x464e97){_0x5b369e=_0x5b369e-0x0;var _0x287870=_0xc728[_0x5b369e];return _0x287870;};'use strict';var Sequelize=require(_0x8c72('0x0'));module[_0x8c72('0x1')]={'name':{'type':Sequelize[_0x8c72('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8c72('0x2')]},'active':{'type':Sequelize[_0x8c72('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x8c72('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x8c72('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x8c72('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x8c72('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x8c72('0x6')](_0x8c72('0x7'),'quarters','months','weeks',_0x8c72('0x8'),'hours','minutes'),'allowNull':![],'defaultValue':_0x8c72('0x8')},'output':{'type':Sequelize[_0x8c72('0x6')](_0x8c72('0x9'),_0x8c72('0xa'),_0x8c72('0xb')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x8c72('0x6')](_0x8c72('0xc'),'default'),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x8c72('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x8c72('0xd')]},'sendIfEmpty':{'type':Sequelize[_0x8c72('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x10cd=['months','weeks','hours','minutes','csv','pdf','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x10cd,0x1dd));var _0xd10c=function(_0x5065f9,_0x495cfe){_0x5065f9=_0x5065f9-0x0;var _0x294656=_0x10cd[_0x5065f9];return _0x294656;};'use strict';var Sequelize=require(_0xd10c('0x0'));module[_0xd10c('0x1')]={'name':{'type':Sequelize[_0xd10c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd10c('0x2')]},'active':{'type':Sequelize[_0xd10c('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd10c('0x4')},'startAt':{'type':Sequelize[_0xd10c('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0xd10c('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xd10c('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xd10c('0x7')](_0xd10c('0x8'),'quarters',_0xd10c('0x9'),_0xd10c('0xa'),'days',_0xd10c('0xb'),_0xd10c('0xc')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize['ENUM'](_0xd10c('0xd'),_0xd10c('0xe'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize['ENUM'](_0xd10c('0xf'),_0xd10c('0x10')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xd10c('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xd10c('0x2')]},'cc':{'type':Sequelize[_0xd10c('0x11')]},'bcc':{'type':Sequelize[_0xd10c('0x11')]},'sendIfEmpty':{'type':Sequelize[_0xd10c('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 6d11016..c3cf6f3 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 _0xe355=['squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','error','stack','name','send','map','Schedule','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','limit','order','sort','pick','filter','merge','where','includeAll','findAll','rows','include','options','catch','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xe355,0x142));var _0x5e35=function(_0x57bff9,_0x45d676){_0x57bff9=_0x57bff9-0x0;var _0x4a2422=_0xe355[_0x57bff9];return _0x4a2422;};'use strict';var emlformat=require(_0x5e35('0x0'));var rimraf=require(_0x5e35('0x1'));var zipdir=require(_0x5e35('0x2'));var jsonpatch=require(_0x5e35('0x3'));var rp=require(_0x5e35('0x4'));var moment=require(_0x5e35('0x5'));var BPromise=require(_0x5e35('0x6'));var Mustache=require(_0x5e35('0x7'));var util=require(_0x5e35('0x8'));var path=require('path');var sox=require(_0x5e35('0x9'));var csv=require(_0x5e35('0xa'));var ejs=require(_0x5e35('0xb'));var fs=require('fs');var fs_extra=require(_0x5e35('0xc'));var _=require(_0x5e35('0xd'));var squel=require(_0x5e35('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5e35('0xf'));var toCsv=require(_0x5e35('0xa'));var querystring=require(_0x5e35('0x10'));var Papa=require(_0x5e35('0x11'));var Redis=require('ioredis');var authService=require(_0x5e35('0x12'));var qs=require(_0x5e35('0x13'));var as=require(_0x5e35('0x14'));var hardwareService=require(_0x5e35('0x15'));var logger=require('../../config/logger')(_0x5e35('0x16'));var utils=require(_0x5e35('0x17'));var config=require(_0x5e35('0x18'));var licenseUtil=require(_0x5e35('0x19'));var db=require(_0x5e35('0x1a'))['db'];function respondWithStatusCode(_0x316cad,_0x5781b3){_0x5781b3=_0x5781b3||0xcc;return function(_0x2f6ca0){if(_0x2f6ca0){return _0x316cad[_0x5e35('0x1b')](_0x5781b3);}return _0x316cad[_0x5e35('0x1c')](_0x5781b3)[_0x5e35('0x1d')]();};}function respondWithResult(_0x2217dc,_0x3572f8){_0x3572f8=_0x3572f8||0xc8;return function(_0x49936f){if(_0x49936f){return _0x2217dc[_0x5e35('0x1c')](_0x3572f8)['json'](_0x49936f);}};}function respondWithFilteredResult(_0x2ef046,_0x2f1d55){return function(_0xd353e1){if(_0xd353e1){var _0x567d54=typeof _0x2f1d55[_0x5e35('0x1e')]===_0x5e35('0x1f')&&typeof _0x2f1d55['limit']===_0x5e35('0x1f');var _0x3602c2=_0xd353e1[_0x5e35('0x20')];var _0x3706ef=_0x567d54?0x0:_0x2f1d55['offset'];var _0x4e6550=_0x567d54?_0xd353e1['count']:_0x2f1d55['offset']+_0x2f1d55['limit'];var _0x2ec9b0;if(_0x4e6550>=_0x3602c2){_0x4e6550=_0x3602c2;_0x2ec9b0=0xc8;}else{_0x2ec9b0=0xce;}_0x2ef046['status'](_0x2ec9b0);return _0x2ef046[_0x5e35('0x21')](_0x5e35('0x22'),_0x3706ef+'-'+_0x4e6550+'/'+_0x3602c2)['json'](_0xd353e1);}return null;};}function patchUpdates(_0x4eaae9){return function(_0xc303ca){try{jsonpatch['apply'](_0xc303ca,_0x4eaae9,!![]);}catch(_0x5747ba){return BPromise[_0x5e35('0x23')](_0x5747ba);}return _0xc303ca[_0x5e35('0x24')]();};}function saveUpdates(_0x351b3c,_0x2d465c){return function(_0xcc233f){if(_0xcc233f){return _0xcc233f[_0x5e35('0x25')](_0x351b3c)[_0x5e35('0x26')](function(_0x3d6243){return _0x3d6243;});}return null;};}function removeEntity(_0x597761,_0x461c47){return function(_0x473755){if(_0x473755){return _0x473755[_0x5e35('0x27')]()[_0x5e35('0x26')](function(){var _0x568a96=_0x473755[_0x5e35('0x28')]({'plain':!![]});var _0x3c6f14=_0x5e35('0x29');return db[_0x5e35('0x2a')]['destroy']({'where':{'type':_0x3c6f14,'resourceId':_0x568a96['id']}})[_0x5e35('0x26')](function(){return _0x473755;});})[_0x5e35('0x26')](function(){_0x597761['status'](0xcc)[_0x5e35('0x1d')]();});}};}function handleEntityNotFound(_0x453d69,_0x364ec0){return function(_0xa7993e){if(!_0xa7993e){_0x453d69[_0x5e35('0x1b')](0x194);}return _0xa7993e;};}function handleError(_0x3dc009,_0x4ef0c0){_0x4ef0c0=_0x4ef0c0||0x1f4;return function(_0xde5723){logger[_0x5e35('0x2b')](_0xde5723[_0x5e35('0x2c')]);if(_0xde5723['name']){delete _0xde5723[_0x5e35('0x2d')];}_0x3dc009[_0x5e35('0x1c')](_0x4ef0c0)[_0x5e35('0x2e')](_0xde5723);};}exports['index']=function(_0x28697a,_0x406cfc){var _0x4fcdf9={},_0xeea446={},_0x1d2ae4={'count':0x0,'rows':[]};var _0x3489fe=_[_0x5e35('0x2f')](db[_0x5e35('0x30')][_0x5e35('0x31')],function(_0x186c44){return{'name':_0x186c44[_0x5e35('0x32')],'type':_0x186c44[_0x5e35('0x33')][_0x5e35('0x34')]};});_0xeea446[_0x5e35('0x35')]=_['map'](_0x3489fe,_0x5e35('0x2d'));_0xeea446[_0x5e35('0x36')]=_[_0x5e35('0x37')](_0x28697a['query']);_0xeea446[_0x5e35('0x38')]=_['intersection'](_0xeea446[_0x5e35('0x35')],_0xeea446[_0x5e35('0x36')]);_0x4fcdf9[_0x5e35('0x39')]=_[_0x5e35('0x3a')](_0xeea446[_0x5e35('0x35')],qs[_0x5e35('0x3b')](_0x28697a[_0x5e35('0x36')][_0x5e35('0x3b')]));_0x4fcdf9[_0x5e35('0x39')]=_0x4fcdf9[_0x5e35('0x39')][_0x5e35('0x3c')]?_0x4fcdf9[_0x5e35('0x39')]:_0xeea446[_0x5e35('0x35')];if(!_0x28697a['query']['hasOwnProperty']('nolimit')){_0x4fcdf9[_0x5e35('0x3d')]=qs[_0x5e35('0x3d')](_0x28697a[_0x5e35('0x36')][_0x5e35('0x3d')]);_0x4fcdf9['offset']=qs[_0x5e35('0x1e')](_0x28697a['query'][_0x5e35('0x1e')]);}_0x4fcdf9[_0x5e35('0x3e')]=qs[_0x5e35('0x3f')](_0x28697a[_0x5e35('0x36')][_0x5e35('0x3f')]);_0x4fcdf9['where']=qs[_0x5e35('0x38')](_[_0x5e35('0x40')](_0x28697a[_0x5e35('0x36')],_0xeea446['filters']),_0x3489fe);if(_0x28697a[_0x5e35('0x36')][_0x5e35('0x41')]){_0x4fcdf9['where']=_[_0x5e35('0x42')](_0x4fcdf9[_0x5e35('0x43')],{'$or':_[_0x5e35('0x2f')](_0x3489fe,function(_0x48d980){if(_0x48d980[_0x5e35('0x33')]!=='VIRTUAL'){var _0x3cbb26={};_0x3cbb26[_0x48d980[_0x5e35('0x2d')]]={'$like':'%'+_0x28697a[_0x5e35('0x36')][_0x5e35('0x41')]+'%'};return _0x3cbb26;}})});}_0x4fcdf9=_[_0x5e35('0x42')]({},_0x4fcdf9,_0x28697a['options']);var _0x1dc0a2={'where':_0x4fcdf9[_0x5e35('0x43')]};return db['Schedule']['count'](_0x1dc0a2)[_0x5e35('0x26')](function(_0x4e7393){_0x1d2ae4[_0x5e35('0x20')]=_0x4e7393;if(_0x28697a['query'][_0x5e35('0x44')]){_0x4fcdf9['include']=[{'all':!![]}];}return db['Schedule'][_0x5e35('0x45')](_0x4fcdf9);})[_0x5e35('0x26')](function(_0x78f6e7){_0x1d2ae4[_0x5e35('0x46')]=_0x78f6e7;return _0x1d2ae4;})[_0x5e35('0x26')](respondWithFilteredResult(_0x406cfc,_0x4fcdf9))['catch'](handleError(_0x406cfc,null));};exports['show']=function(_0x321934,_0x514bcd){var _0x11046c={'raw':![],'where':{'id':_0x321934['params']['id']}},_0xb9fa23={};_0xb9fa23[_0x5e35('0x35')]=_['keys'](db[_0x5e35('0x30')]['rawAttributes']);_0xb9fa23[_0x5e35('0x36')]=_[_0x5e35('0x37')](_0x321934[_0x5e35('0x36')]);_0xb9fa23[_0x5e35('0x38')]=_[_0x5e35('0x3a')](_0xb9fa23[_0x5e35('0x35')],_0xb9fa23[_0x5e35('0x36')]);_0x11046c[_0x5e35('0x39')]=_[_0x5e35('0x3a')](_0xb9fa23[_0x5e35('0x35')],qs['fields'](_0x321934[_0x5e35('0x36')][_0x5e35('0x3b')]));_0x11046c[_0x5e35('0x39')]=_0x11046c[_0x5e35('0x39')][_0x5e35('0x3c')]?_0x11046c[_0x5e35('0x39')]:_0xb9fa23['model'];if(_0x321934[_0x5e35('0x36')]['includeAll']){_0x11046c[_0x5e35('0x47')]=[{'all':!![]}];}_0x11046c=_['merge']({},_0x11046c,_0x321934[_0x5e35('0x48')]);return db[_0x5e35('0x30')]['find'](_0x11046c)['then'](handleEntityNotFound(_0x514bcd,null))[_0x5e35('0x26')](respondWithResult(_0x514bcd,null))[_0x5e35('0x49')](handleError(_0x514bcd,null));};exports[_0x5e35('0x4a')]=function(_0x2f2da8,_0x49908a){return db[_0x5e35('0x30')][_0x5e35('0x4a')](_0x2f2da8[_0x5e35('0x4b')],{})[_0x5e35('0x26')](function(_0x4a67ac){var _0x35e366=_0x2f2da8['user'][_0x5e35('0x28')]({'plain':!![]});if(!_0x35e366)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35e366['role']===_0x5e35('0x4c')){var _0x594741=_0x4a67ac[_0x5e35('0x28')]({'plain':!![]});var _0x17065f=_0x5e35('0x29');return db[_0x5e35('0x4d')][_0x5e35('0x4e')]({'where':{'name':_0x17065f,'userProfileId':_0x35e366[_0x5e35('0x4f')]},'raw':!![]})[_0x5e35('0x26')](function(_0x595a38){if(_0x595a38&&_0x595a38[_0x5e35('0x50')]===0x0){return db[_0x5e35('0x2a')][_0x5e35('0x4a')]({'name':_0x594741['name'],'resourceId':_0x594741['id'],'type':_0x595a38[_0x5e35('0x2d')],'sectionId':_0x595a38['id']},{})['then'](function(){return _0x4a67ac;});}else{return _0x4a67ac;}})[_0x5e35('0x49')](function(_0x3602e0){logger[_0x5e35('0x2b')](_0x5e35('0x51'),_0x3602e0);throw _0x3602e0;});}return _0x4a67ac;})[_0x5e35('0x26')](respondWithResult(_0x49908a,0xc9))[_0x5e35('0x49')](handleError(_0x49908a,null));};exports['update']=function(_0x4cea91,_0x24e44a){if(_0x4cea91['body']['id']){delete _0x4cea91['body']['id'];}return db[_0x5e35('0x30')][_0x5e35('0x4e')]({'where':{'id':_0x4cea91[_0x5e35('0x52')]['id']}})[_0x5e35('0x26')](handleEntityNotFound(_0x24e44a,null))[_0x5e35('0x26')](saveUpdates(_0x4cea91[_0x5e35('0x4b')],null))['then'](respondWithResult(_0x24e44a,null))[_0x5e35('0x49')](handleError(_0x24e44a,null));};exports[_0x5e35('0x27')]=function(_0x305966,_0x499bff){return db[_0x5e35('0x30')][_0x5e35('0x4e')]({'where':{'id':_0x305966[_0x5e35('0x52')]['id']}})[_0x5e35('0x26')](handleEntityNotFound(_0x499bff,null))['then'](removeEntity(_0x499bff,null))['catch'](handleError(_0x499bff,null));};exports[_0x5e35('0x53')]=function(_0x2d46b1,_0x9216f3,_0x3ba3dd){var _0x23c323=require('../../config/schedule');return db[_0x5e35('0x30')][_0x5e35('0x4e')]({'where':{'id':_0x2d46b1[_0x5e35('0x52')]['id']},'raw':!![]})[_0x5e35('0x26')](handleEntityNotFound(_0x9216f3,null))[_0x5e35('0x26')](function(){_0x23c323['run'](_0x2d46b1[_0x5e35('0x52')]['id']);})[_0x5e35('0x26')](respondWithStatusCode(_0x9216f3,null))['catch'](handleError(_0x9216f3,null));}; \ No newline at end of file +var _0x28e6=['length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','get','Scheduler','UserProfileResource','stack','name','send','index','map','Schedule','rawAttributes','type','key','model','query','keys','intersection','attributes','fields'];(function(_0x4080dd,_0x5b595d){var _0x4ecf85=function(_0x5d281a){while(--_0x5d281a){_0x4080dd['push'](_0x4080dd['shift']());}};_0x4ecf85(++_0x5b595d);}(_0x28e6,0x1dc));var _0x628e=function(_0x2dd1c2,_0x2ac452){_0x2dd1c2=_0x2dd1c2-0x0;var _0x5328ea=_0x28e6[_0x2dd1c2];return _0x5328ea;};'use strict';var emlformat=require(_0x628e('0x0'));var rimraf=require(_0x628e('0x1'));var zipdir=require(_0x628e('0x2'));var jsonpatch=require(_0x628e('0x3'));var rp=require('request-promise');var moment=require(_0x628e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x628e('0x5'));var util=require('util');var path=require(_0x628e('0x6'));var sox=require(_0x628e('0x7'));var csv=require(_0x628e('0x8'));var ejs=require(_0x628e('0x9'));var fs=require('fs');var fs_extra=require(_0x628e('0xa'));var _=require(_0x628e('0xb'));var squel=require(_0x628e('0xc'));var crypto=require(_0x628e('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x628e('0xe'));var Papa=require(_0x628e('0xf'));var Redis=require(_0x628e('0x10'));var authService=require(_0x628e('0x11'));var qs=require(_0x628e('0x12'));var as=require(_0x628e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x628e('0x14'))(_0x628e('0x15'));var utils=require('../../config/utils');var config=require(_0x628e('0x16'));var licenseUtil=require(_0x628e('0x17'));var db=require(_0x628e('0x18'))['db'];function respondWithStatusCode(_0x5d24db,_0xbf4a5){_0xbf4a5=_0xbf4a5||0xcc;return function(_0x454d03){if(_0x454d03){return _0x5d24db[_0x628e('0x19')](_0xbf4a5);}return _0x5d24db[_0x628e('0x1a')](_0xbf4a5)[_0x628e('0x1b')]();};}function respondWithResult(_0x12d5bb,_0x28b848){_0x28b848=_0x28b848||0xc8;return function(_0x578851){if(_0x578851){return _0x12d5bb[_0x628e('0x1a')](_0x28b848)['json'](_0x578851);}};}function respondWithFilteredResult(_0x35296c,_0x5330d5){return function(_0x89adc8){if(_0x89adc8){var _0x3d185d=typeof _0x5330d5[_0x628e('0x1c')]===_0x628e('0x1d')&&typeof _0x5330d5[_0x628e('0x1e')]===_0x628e('0x1d');var _0x5eb713=_0x89adc8['count'];var _0x2eefc7=_0x3d185d?0x0:_0x5330d5[_0x628e('0x1c')];var _0x5d46e3=_0x3d185d?_0x89adc8[_0x628e('0x1f')]:_0x5330d5['offset']+_0x5330d5[_0x628e('0x1e')];var _0x10fd0b;if(_0x5d46e3>=_0x5eb713){_0x5d46e3=_0x5eb713;_0x10fd0b=0xc8;}else{_0x10fd0b=0xce;}_0x35296c[_0x628e('0x1a')](_0x10fd0b);return _0x35296c[_0x628e('0x20')](_0x628e('0x21'),_0x2eefc7+'-'+_0x5d46e3+'/'+_0x5eb713)[_0x628e('0x22')](_0x89adc8);}return null;};}function patchUpdates(_0x1acf6){return function(_0x5de5e2){try{jsonpatch[_0x628e('0x23')](_0x5de5e2,_0x1acf6,!![]);}catch(_0x4579ca){return BPromise[_0x628e('0x24')](_0x4579ca);}return _0x5de5e2['save']();};}function saveUpdates(_0x23b138,_0x305a7a){return function(_0x27ee31){if(_0x27ee31){return _0x27ee31[_0x628e('0x25')](_0x23b138)['then'](function(_0x4aeb08){return _0x4aeb08;});}return null;};}function removeEntity(_0x42641a,_0x37edf6){return function(_0x4c9710){if(_0x4c9710){return _0x4c9710[_0x628e('0x26')]()[_0x628e('0x27')](function(){var _0x5bee8a=_0x4c9710[_0x628e('0x28')]({'plain':!![]});var _0x36db76=_0x628e('0x29');return db[_0x628e('0x2a')][_0x628e('0x26')]({'where':{'type':_0x36db76,'resourceId':_0x5bee8a['id']}})[_0x628e('0x27')](function(){return _0x4c9710;});})[_0x628e('0x27')](function(){_0x42641a[_0x628e('0x1a')](0xcc)[_0x628e('0x1b')]();});}};}function handleEntityNotFound(_0x34c1ca,_0x449b45){return function(_0x15e7c1){if(!_0x15e7c1){_0x34c1ca[_0x628e('0x19')](0x194);}return _0x15e7c1;};}function handleError(_0x4e36d9,_0x3f489f){_0x3f489f=_0x3f489f||0x1f4;return function(_0x4eb434){logger['error'](_0x4eb434[_0x628e('0x2b')]);if(_0x4eb434[_0x628e('0x2c')]){delete _0x4eb434[_0x628e('0x2c')];}_0x4e36d9[_0x628e('0x1a')](_0x3f489f)[_0x628e('0x2d')](_0x4eb434);};}exports[_0x628e('0x2e')]=function(_0x3b5c6a,_0x3a8d12){var _0x22bc20={},_0x3954e2={},_0x43daf9={'count':0x0,'rows':[]};var _0x76e220=_[_0x628e('0x2f')](db[_0x628e('0x30')][_0x628e('0x31')],function(_0x250f80){return{'name':_0x250f80['fieldName'],'type':_0x250f80[_0x628e('0x32')][_0x628e('0x33')]};});_0x3954e2[_0x628e('0x34')]=_[_0x628e('0x2f')](_0x76e220,'name');_0x3954e2[_0x628e('0x35')]=_[_0x628e('0x36')](_0x3b5c6a[_0x628e('0x35')]);_0x3954e2['filters']=_[_0x628e('0x37')](_0x3954e2['model'],_0x3954e2[_0x628e('0x35')]);_0x22bc20[_0x628e('0x38')]=_[_0x628e('0x37')](_0x3954e2['model'],qs[_0x628e('0x39')](_0x3b5c6a[_0x628e('0x35')][_0x628e('0x39')]));_0x22bc20[_0x628e('0x38')]=_0x22bc20[_0x628e('0x38')][_0x628e('0x3a')]?_0x22bc20[_0x628e('0x38')]:_0x3954e2[_0x628e('0x34')];if(!_0x3b5c6a['query'][_0x628e('0x3b')](_0x628e('0x3c'))){_0x22bc20[_0x628e('0x1e')]=qs[_0x628e('0x1e')](_0x3b5c6a[_0x628e('0x35')][_0x628e('0x1e')]);_0x22bc20[_0x628e('0x1c')]=qs[_0x628e('0x1c')](_0x3b5c6a[_0x628e('0x35')][_0x628e('0x1c')]);}_0x22bc20[_0x628e('0x3d')]=qs[_0x628e('0x3e')](_0x3b5c6a[_0x628e('0x35')][_0x628e('0x3e')]);_0x22bc20[_0x628e('0x3f')]=qs[_0x628e('0x40')](_[_0x628e('0x41')](_0x3b5c6a[_0x628e('0x35')],_0x3954e2['filters']),_0x76e220);if(_0x3b5c6a[_0x628e('0x35')][_0x628e('0x42')]){_0x22bc20[_0x628e('0x3f')]=_[_0x628e('0x43')](_0x22bc20['where'],{'$or':_[_0x628e('0x2f')](_0x76e220,function(_0x55ca87){if(_0x55ca87[_0x628e('0x32')]!==_0x628e('0x44')){var _0x558309={};_0x558309[_0x55ca87[_0x628e('0x2c')]]={'$like':'%'+_0x3b5c6a['query'][_0x628e('0x42')]+'%'};return _0x558309;}})});}_0x22bc20=_[_0x628e('0x43')]({},_0x22bc20,_0x3b5c6a[_0x628e('0x45')]);var _0x50a324={'where':_0x22bc20[_0x628e('0x3f')]};return db[_0x628e('0x30')]['count'](_0x50a324)[_0x628e('0x27')](function(_0x87ff5f){_0x43daf9[_0x628e('0x1f')]=_0x87ff5f;if(_0x3b5c6a[_0x628e('0x35')][_0x628e('0x46')]){_0x22bc20[_0x628e('0x47')]=[{'all':!![]}];}return db['Schedule'][_0x628e('0x48')](_0x22bc20);})[_0x628e('0x27')](function(_0x333216){_0x43daf9[_0x628e('0x49')]=_0x333216;return _0x43daf9;})[_0x628e('0x27')](respondWithFilteredResult(_0x3a8d12,_0x22bc20))['catch'](handleError(_0x3a8d12,null));};exports[_0x628e('0x4a')]=function(_0x339974,_0x581f2b){var _0x27520b={'raw':![],'where':{'id':_0x339974['params']['id']}},_0x26d3fb={};_0x26d3fb['model']=_[_0x628e('0x36')](db[_0x628e('0x30')][_0x628e('0x31')]);_0x26d3fb[_0x628e('0x35')]=_['keys'](_0x339974['query']);_0x26d3fb[_0x628e('0x40')]=_[_0x628e('0x37')](_0x26d3fb[_0x628e('0x34')],_0x26d3fb['query']);_0x27520b[_0x628e('0x38')]=_[_0x628e('0x37')](_0x26d3fb[_0x628e('0x34')],qs['fields'](_0x339974['query'][_0x628e('0x39')]));_0x27520b[_0x628e('0x38')]=_0x27520b[_0x628e('0x38')][_0x628e('0x3a')]?_0x27520b['attributes']:_0x26d3fb['model'];if(_0x339974['query'][_0x628e('0x46')]){_0x27520b['include']=[{'all':!![]}];}_0x27520b=_[_0x628e('0x43')]({},_0x27520b,_0x339974['options']);return db[_0x628e('0x30')][_0x628e('0x4b')](_0x27520b)[_0x628e('0x27')](handleEntityNotFound(_0x581f2b,null))[_0x628e('0x27')](respondWithResult(_0x581f2b,null))[_0x628e('0x4c')](handleError(_0x581f2b,null));};exports['create']=function(_0x180529,_0x2c095a){return db['Schedule'][_0x628e('0x4d')](_0x180529[_0x628e('0x4e')],{})[_0x628e('0x27')](function(_0x2ff15b){var _0x486013=_0x180529[_0x628e('0x4f')][_0x628e('0x28')]({'plain':!![]});if(!_0x486013)throw new Error(_0x628e('0x50'));if(_0x486013[_0x628e('0x51')]==='user'){var _0x5a4dbe=_0x2ff15b[_0x628e('0x28')]({'plain':!![]});var _0x4458bf=_0x628e('0x29');return db[_0x628e('0x52')][_0x628e('0x4b')]({'where':{'name':_0x4458bf,'userProfileId':_0x486013[_0x628e('0x53')]},'raw':!![]})[_0x628e('0x27')](function(_0x4f2532){if(_0x4f2532&&_0x4f2532[_0x628e('0x54')]===0x0){return db[_0x628e('0x2a')][_0x628e('0x4d')]({'name':_0x5a4dbe[_0x628e('0x2c')],'resourceId':_0x5a4dbe['id'],'type':_0x4f2532[_0x628e('0x2c')],'sectionId':_0x4f2532['id']},{})[_0x628e('0x27')](function(){return _0x2ff15b;});}else{return _0x2ff15b;}})[_0x628e('0x4c')](function(_0x158f17){logger['error'](_0x628e('0x55'),_0x158f17);throw _0x158f17;});}return _0x2ff15b;})[_0x628e('0x27')](respondWithResult(_0x2c095a,0xc9))[_0x628e('0x4c')](handleError(_0x2c095a,null));};exports[_0x628e('0x25')]=function(_0x30fea4,_0xd8d5a5){if(_0x30fea4[_0x628e('0x4e')]['id']){delete _0x30fea4[_0x628e('0x4e')]['id'];}return db[_0x628e('0x30')][_0x628e('0x4b')]({'where':{'id':_0x30fea4[_0x628e('0x56')]['id']}})[_0x628e('0x27')](handleEntityNotFound(_0xd8d5a5,null))[_0x628e('0x27')](saveUpdates(_0x30fea4['body'],null))['then'](respondWithResult(_0xd8d5a5,null))[_0x628e('0x4c')](handleError(_0xd8d5a5,null));};exports['destroy']=function(_0x2574e5,_0xb2ae1a){return db[_0x628e('0x30')][_0x628e('0x4b')]({'where':{'id':_0x2574e5[_0x628e('0x56')]['id']}})[_0x628e('0x27')](handleEntityNotFound(_0xb2ae1a,null))[_0x628e('0x27')](removeEntity(_0xb2ae1a,null))[_0x628e('0x4c')](handleError(_0xb2ae1a,null));};exports[_0x628e('0x57')]=function(_0x4532fc,_0x502baa,_0x5a329c){var _0x4d6500=require(_0x628e('0x58'));return db['Schedule'][_0x628e('0x4b')]({'where':{'id':_0x4532fc[_0x628e('0x56')]['id']},'raw':!![]})[_0x628e('0x27')](handleEntityNotFound(_0x502baa,null))['then'](function(){_0x4d6500['run'](_0x4532fc[_0x628e('0x56')]['id']);})[_0x628e('0x27')](respondWithStatusCode(_0x502baa,null))['catch'](handleError(_0x502baa,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index d89e68f..ca2bae9 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 _0x3159=['rimraf','../../config/environment','exports','Schedule','tools_schedules','util','api','moment','request-promise','path'];(function(_0x2a53ad,_0x234135){var _0x31b3b6=function(_0x141ec6){while(--_0x141ec6){_0x2a53ad['push'](_0x2a53ad['shift']());}};_0x31b3b6(++_0x234135);}(_0x3159,0x145));var _0x9315=function(_0x23ff31,_0x51c117){_0x23ff31=_0x23ff31-0x0;var _0x27ecee=_0x3159[_0x23ff31];return _0x27ecee;};'use strict';var _=require('lodash');var util=require(_0x9315('0x0'));var logger=require('../../config/logger')(_0x9315('0x1'));var moment=require(_0x9315('0x2'));var BPromise=require('bluebird');var rp=require(_0x9315('0x3'));var fs=require('fs');var path=require(_0x9315('0x4'));var rimraf=require(_0x9315('0x5'));var config=require(_0x9315('0x6'));var attributes=require('./schedule.attributes');module[_0x9315('0x7')]=function(_0x42d7f6,_0x1cb4a9){return _0x42d7f6['define'](_0x9315('0x8'),attributes,{'tableName':_0x9315('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbfb2=['moment','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define','tools_schedules','lodash','util','../../config/logger','api'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xbfb2,0xcc));var _0x2bfb=function(_0x489529,_0x50d1af){_0x489529=_0x489529-0x0;var _0x5562d1=_0xbfb2[_0x489529];return _0x5562d1;};'use strict';var _=require(_0x2bfb('0x0'));var util=require(_0x2bfb('0x1'));var logger=require(_0x2bfb('0x2'))(_0x2bfb('0x3'));var moment=require(_0x2bfb('0x4'));var BPromise=require('bluebird');var rp=require(_0x2bfb('0x5'));var fs=require('fs');var path=require(_0x2bfb('0x6'));var rimraf=require(_0x2bfb('0x7'));var config=require(_0x2bfb('0x8'));var attributes=require(_0x2bfb('0x9'));module[_0x2bfb('0xa')]=function(_0x676f10,_0x4b2aae){return _0x676f10[_0x2bfb('0xb')]('Schedule',attributes,{'tableName':_0x2bfb('0xc'),'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 b95c191..07f9a39 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 _0x3ab8=['code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x6c0833,_0x59e073){var _0x25d75b=function(_0x40833a){while(--_0x40833a){_0x6c0833['push'](_0x6c0833['shift']());}};_0x25d75b(++_0x59e073);}(_0x3ab8,0x1d0));var _0x83ab=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x3ab8[_0x4d613c];return _0x301fe3;};'use strict';var _=require('lodash');var util=require(_0x83ab('0x0'));var moment=require('moment');var BPromise=require(_0x83ab('0x1'));var rs=require(_0x83ab('0x2'));var fs=require('fs');var Redis=require(_0x83ab('0x3'));var db=require(_0x83ab('0x4'))['db'];var utils=require(_0x83ab('0x5'));var logger=require(_0x83ab('0x6'))(_0x83ab('0x7'));var config=require(_0x83ab('0x8'));var jayson=require(_0x83ab('0x9'));var client=jayson[_0x83ab('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a4f01,_0x2157a0,_0xffe7fe){return new BPromise(function(_0x13a29d,_0x3f7fa9){return client['request'](_0x2a4f01,_0xffe7fe)[_0x83ab('0xb')](function(_0x2e9c04){logger[_0x83ab('0xc')](_0x83ab('0xd'),_0x2157a0,_0x83ab('0xe'));logger[_0x83ab('0xf')](_0x83ab('0x10'),_0x2157a0,'request\x20sent',JSON[_0x83ab('0x11')](_0x2e9c04));if(_0x2e9c04['error']){if(_0x2e9c04[_0x83ab('0x12')][_0x83ab('0x13')]===0x1f4){logger[_0x83ab('0x12')](_0x83ab('0xd'),_0x2157a0,_0x2e9c04[_0x83ab('0x12')][_0x83ab('0x14')]);return _0x3f7fa9(_0x2e9c04[_0x83ab('0x12')][_0x83ab('0x14')]);}logger['error'](_0x83ab('0xd'),_0x2157a0,_0x2e9c04['error'][_0x83ab('0x14')]);return _0x13a29d(_0x2e9c04['error']['message']);}else{logger['info'](_0x83ab('0xd'),_0x2157a0,_0x83ab('0xe'));_0x13a29d(_0x2e9c04[_0x83ab('0x15')][_0x83ab('0x14')]);}})[_0x83ab('0x16')](function(_0x2e3440){logger[_0x83ab('0x12')](_0x83ab('0xd'),_0x2157a0,_0x2e3440);_0x3f7fa9(_0x2e3440);});});} \ No newline at end of file +var _0xbf93=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','error','code','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x381372,_0xf0a5a){var _0x4e959a=function(_0x25a897){while(--_0x25a897){_0x381372['push'](_0x381372['shift']());}};_0x4e959a(++_0xf0a5a);}(_0xbf93,0x1b0));var _0x3bf9=function(_0x9dea0a,_0x1aac5f){_0x9dea0a=_0x9dea0a-0x0;var _0x3a69d6=_0xbf93[_0x9dea0a];return _0x3a69d6;};'use strict';var _=require(_0x3bf9('0x0'));var util=require(_0x3bf9('0x1'));var moment=require(_0x3bf9('0x2'));var BPromise=require('bluebird');var rs=require(_0x3bf9('0x3'));var fs=require('fs');var Redis=require(_0x3bf9('0x4'));var db=require(_0x3bf9('0x5'))['db'];var utils=require(_0x3bf9('0x6'));var logger=require(_0x3bf9('0x7'))(_0x3bf9('0x8'));var config=require(_0x3bf9('0x9'));var jayson=require(_0x3bf9('0xa'));var client=jayson[_0x3bf9('0xb')][_0x3bf9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4d2968,_0x419b2a,_0x3afcb2){return new BPromise(function(_0x73f723,_0x5ec408){return client[_0x3bf9('0xd')](_0x4d2968,_0x3afcb2)[_0x3bf9('0xe')](function(_0x54196c){logger[_0x3bf9('0xf')](_0x3bf9('0x10'),_0x419b2a,_0x3bf9('0x11'));logger[_0x3bf9('0x12')]('Schedule,\x20%s,\x20%s,\x20%s',_0x419b2a,_0x3bf9('0x11'),JSON['stringify'](_0x54196c));if(_0x54196c[_0x3bf9('0x13')]){if(_0x54196c[_0x3bf9('0x13')][_0x3bf9('0x14')]===0x1f4){logger[_0x3bf9('0x13')](_0x3bf9('0x10'),_0x419b2a,_0x54196c[_0x3bf9('0x13')][_0x3bf9('0x15')]);return _0x5ec408(_0x54196c[_0x3bf9('0x13')]['message']);}logger['error']('Schedule,\x20%s,\x20%s',_0x419b2a,_0x54196c[_0x3bf9('0x13')][_0x3bf9('0x15')]);return _0x73f723(_0x54196c[_0x3bf9('0x13')]['message']);}else{logger['info'](_0x3bf9('0x10'),_0x419b2a,'request\x20sent');_0x73f723(_0x54196c['result'][_0x3bf9('0x15')]);}})['catch'](function(_0x44118c){logger[_0x3bf9('0x13')]('Schedule,\x20%s,\x20%s',_0x419b2a,_0x44118c);_0x5ec408(_0x44118c);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 87ba56f..02f8c03 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 _0xff83=['express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','show','download','post','create','put','delete','/:id','exports','util','path'];(function(_0x59bcb1,_0x5a4b6c){var _0x4a737f=function(_0x546a49){while(--_0x546a49){_0x59bcb1['push'](_0x59bcb1['shift']());}};_0x4a737f(++_0x5a4b6c);}(_0xff83,0xee));var _0x3ff8=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xff83[_0x2cfb58];return _0xd99951;};'use strict';var multer=require('multer');var util=require(_0x3ff8('0x0'));var path=require(_0x3ff8('0x1'));var timeout=require('connect-timeout');var express=require(_0x3ff8('0x2'));var router=express[_0x3ff8('0x3')]();var fs_extra=require(_0x3ff8('0x4'));var auth=require(_0x3ff8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3ff8('0x6'));var controller=require('./screenRecording.controller');router['get']('/',auth[_0x3ff8('0x7')](),controller[_0x3ff8('0x8')]);router[_0x3ff8('0x9')](_0x3ff8('0xa'),auth[_0x3ff8('0x7')](),controller[_0x3ff8('0xb')]);router[_0x3ff8('0x9')]('/:id',auth[_0x3ff8('0x7')](),controller[_0x3ff8('0xc')]);router['get']('/:id/download',auth[_0x3ff8('0x7')](),controller[_0x3ff8('0xd')]);router[_0x3ff8('0xe')]('/',auth[_0x3ff8('0x7')](),controller[_0x3ff8('0xf')]);router[_0x3ff8('0x10')]('/:id',auth[_0x3ff8('0x7')](),controller['update']);router[_0x3ff8('0x11')](_0x3ff8('0x12'),auth[_0x3ff8('0x7')](),controller['destroy']);module[_0x3ff8('0x13')]=router; \ No newline at end of file +var _0x7cde=['download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download'];(function(_0x2d1605,_0x1e5465){var _0x17d805=function(_0x52c53c){while(--_0x52c53c){_0x2d1605['push'](_0x2d1605['shift']());}};_0x17d805(++_0x1e5465);}(_0x7cde,0x1dc));var _0xe7cd=function(_0x26587e,_0x2f8166){_0x26587e=_0x26587e-0x0;var _0x1622f7=_0x7cde[_0x26587e];return _0x1622f7;};'use strict';var multer=require(_0xe7cd('0x0'));var util=require(_0xe7cd('0x1'));var path=require(_0xe7cd('0x2'));var timeout=require(_0xe7cd('0x3'));var express=require(_0xe7cd('0x4'));var router=express[_0xe7cd('0x5')]();var fs_extra=require(_0xe7cd('0x6'));var auth=require(_0xe7cd('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe7cd('0x8'));var controller=require(_0xe7cd('0x9'));router[_0xe7cd('0xa')]('/',auth[_0xe7cd('0xb')](),controller[_0xe7cd('0xc')]);router['get'](_0xe7cd('0xd'),auth[_0xe7cd('0xb')](),controller[_0xe7cd('0xe')]);router[_0xe7cd('0xa')](_0xe7cd('0xf'),auth[_0xe7cd('0xb')](),controller[_0xe7cd('0x10')]);router[_0xe7cd('0xa')](_0xe7cd('0x11'),auth[_0xe7cd('0xb')](),controller[_0xe7cd('0x12')]);router[_0xe7cd('0x13')]('/',auth[_0xe7cd('0xb')](),controller[_0xe7cd('0x14')]);router[_0xe7cd('0x15')](_0xe7cd('0xf'),auth[_0xe7cd('0xb')](),controller[_0xe7cd('0x16')]);router[_0xe7cd('0x17')](_0xe7cd('0xf'),auth[_0xe7cd('0xb')](),controller[_0xe7cd('0x18')]);module[_0xe7cd('0x19')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 4a72304..0749a37 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 _0xf960=['toString','format','createdAt','updatedAt','sequelize','path','exports','VIRTUAL','value','STRING','setDataValue','INTEGER','subtract','closedAt','duration','DATE','getDataValue','startedAt','MM-DD-YYYY\x20HH:mm'];(function(_0xf951ef,_0x111d3c){var _0x25357b=function(_0x3b9330){while(--_0x3b9330){_0xf951ef['push'](_0xf951ef['shift']());}};_0x25357b(++_0x111d3c);}(_0xf960,0x193));var _0x0f96=function(_0x383dbb,_0x17d41b){_0x383dbb=_0x383dbb-0x0;var _0x6e8bde=_0xf960[_0x383dbb];return _0x6e8bde;};'use strict';var Sequelize=require(_0x0f96('0x0'));var moment=require('moment');var path=require(_0x0f96('0x1'));var config=require('../../config/environment');module[_0x0f96('0x2')]={'format':{'type':Sequelize[_0x0f96('0x3')],'get':function(){return this['getDataValue'](_0x0f96('0x4'))?path['extname'](this['getDataValue'](_0x0f96('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0x0f96('0x5')]},'channel':{'type':Sequelize[_0x0f96('0x5')]},'value':{'type':Sequelize[_0x0f96('0x5')],'set':function(_0x765dfe){var _0x5c61f0=_0x765dfe['replace'](/\\/g,'/');this[_0x0f96('0x6')](_0x0f96('0x4'),_0x5c61f0);}},'rating':{'type':Sequelize[_0x0f96('0x7')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x0f96('0x7')],'set':function(_0x1eb762){this[_0x0f96('0x6')]('startedAt',moment()[_0x0f96('0x8')](_0x1eb762,'ms'));this['setDataValue'](_0x0f96('0x9'),moment());this['setDataValue'](_0x0f96('0xa'),_0x1eb762);}},'startedAt':{'type':Sequelize[_0x0f96('0xb')],'get':function(){return moment(this[_0x0f96('0xc')](_0x0f96('0xd')))['format'](_0x0f96('0xe'))[_0x0f96('0xf')]();}},'closedAt':{'type':Sequelize[_0x0f96('0xb')],'get':function(){return moment(this[_0x0f96('0xc')]('closedAt'))[_0x0f96('0x10')](_0x0f96('0xe'))[_0x0f96('0xf')]();}},'createdAt':{'type':Sequelize[_0x0f96('0xb')],'get':function(){return moment(this[_0x0f96('0xc')](_0x0f96('0x11')))['format'](_0x0f96('0xe'))['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0f96('0xc')](_0x0f96('0x12')))[_0x0f96('0x10')](_0x0f96('0xe'))[_0x0f96('0xf')]();}}}; \ No newline at end of file +var _0x34bd=['duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','updatedAt','sequelize','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt'];(function(_0x242566,_0x4ec88d){var _0x1bc410=function(_0x2996fa){while(--_0x2996fa){_0x242566['push'](_0x242566['shift']());}};_0x1bc410(++_0x4ec88d);}(_0x34bd,0x1d2));var _0xd34b=function(_0x4a0801,_0x55b298){_0x4a0801=_0x4a0801-0x0;var _0x47306d=_0x34bd[_0x4a0801];return _0x47306d;};'use strict';var Sequelize=require(_0xd34b('0x0'));var moment=require('moment');var path=require('path');var config=require(_0xd34b('0x1'));module[_0xd34b('0x2')]={'format':{'type':Sequelize[_0xd34b('0x3')],'get':function(){return this[_0xd34b('0x4')](_0xd34b('0x5'))?path[_0xd34b('0x6')](this[_0xd34b('0x4')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0xd34b('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0x56e3eb){var _0x30d93b=_0x56e3eb[_0xd34b('0x8')](/\\/g,'/');this[_0xd34b('0x9')](_0xd34b('0x5'),_0x30d93b);}},'rating':{'type':Sequelize[_0xd34b('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xd34b('0xa')],'set':function(_0x738328){this[_0xd34b('0x9')](_0xd34b('0xb'),moment()[_0xd34b('0xc')](_0x738328,'ms'));this[_0xd34b('0x9')](_0xd34b('0xd'),moment());this['setDataValue'](_0xd34b('0xe'),_0x738328);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xd34b('0x4')](_0xd34b('0xb')))[_0xd34b('0xf')](_0xd34b('0x10'))[_0xd34b('0x11')]();}},'closedAt':{'type':Sequelize[_0xd34b('0x12')],'get':function(){return moment(this['getDataValue'](_0xd34b('0xd')))[_0xd34b('0xf')]('MM-DD-YYYY\x20HH:mm')[_0xd34b('0x11')]();}},'createdAt':{'type':Sequelize[_0xd34b('0x12')],'get':function(){return moment(this[_0xd34b('0x4')]('createdAt'))[_0xd34b('0xf')](_0xd34b('0x10'))['toString']();}},'updatedAt':{'type':Sequelize[_0xd34b('0x12')],'get':function(){return moment(this['getDataValue'](_0xd34b('0x13')))[_0xd34b('0xf')](_0xd34b('0x10'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 1fc41c5..4db4187 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 _0x8958=['pick','merge','VIRTUAL','filter','options','ScreenRecording','include','findAll','params','rawAttributes','includeAll','create','catch','body','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','find','value','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','destroy','rimraf','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','error','name','send','index','map','fieldName','type','key','model','format','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x1345ed,_0x40188c){var _0x402673=function(_0x44892d){while(--_0x44892d){_0x1345ed['push'](_0x1345ed['shift']());}};_0x402673(++_0x40188c);}(_0x8958,0x93));var _0x8895=function(_0x99c2c8,_0x43fcc2){_0x99c2c8=_0x99c2c8-0x0;var _0x55eb1c=_0x8958[_0x99c2c8];return _0x55eb1c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8895('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8895('0x1'));var Mustache=require('mustache');var util=require(_0x8895('0x2'));var path=require(_0x8895('0x3'));var sox=require(_0x8895('0x4'));var csv=require('to-csv');var ejs=require(_0x8895('0x5'));var fs=require('fs');var fs_extra=require(_0x8895('0x6'));var _=require(_0x8895('0x7'));var squel=require(_0x8895('0x8'));var crypto=require(_0x8895('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x8895('0xa'));var toCsv=require(_0x8895('0xb'));var querystring=require(_0x8895('0xc'));var Papa=require(_0x8895('0xd'));var Redis=require(_0x8895('0xe'));var authService=require(_0x8895('0xf'));var qs=require(_0x8895('0x10'));var as=require(_0x8895('0x11'));var hardwareService=require(_0x8895('0x12'));var logger=require(_0x8895('0x13'))('api');var utils=require(_0x8895('0x14'));var config=require(_0x8895('0x15'));var licenseUtil=require(_0x8895('0x16'));var db=require(_0x8895('0x17'))['db'];function respondWithStatusCode(_0x446e1a,_0xaf93bc){_0xaf93bc=_0xaf93bc||0xcc;return function(_0x5af0ef){if(_0x5af0ef){return _0x446e1a[_0x8895('0x18')](_0xaf93bc);}return _0x446e1a[_0x8895('0x19')](_0xaf93bc)[_0x8895('0x1a')]();};}function respondWithResult(_0x57d40a,_0x47b9fe){_0x47b9fe=_0x47b9fe||0xc8;return function(_0x9191b8){if(_0x9191b8){return _0x57d40a['status'](_0x47b9fe)[_0x8895('0x1b')](_0x9191b8);}};}function respondWithFilteredResult(_0x337101,_0x195789){return function(_0x3d7b59){if(_0x3d7b59){var _0x2c9d40=typeof _0x195789['offset']===_0x8895('0x1c')&&typeof _0x195789[_0x8895('0x1d')]===_0x8895('0x1c');var _0xcdd661=_0x3d7b59[_0x8895('0x1e')];var _0x1b5c82=_0x2c9d40?0x0:_0x195789[_0x8895('0x1f')];var _0x26cee0=_0x2c9d40?_0x3d7b59[_0x8895('0x1e')]:_0x195789[_0x8895('0x1f')]+_0x195789[_0x8895('0x1d')];var _0x6b8a16;if(_0x26cee0>=_0xcdd661){_0x26cee0=_0xcdd661;_0x6b8a16=0xc8;}else{_0x6b8a16=0xce;}_0x337101[_0x8895('0x19')](_0x6b8a16);return _0x337101['set']('Content-Range',_0x1b5c82+'-'+_0x26cee0+'/'+_0xcdd661)['json'](_0x3d7b59);}return null;};}function patchUpdates(_0x3daf43){return function(_0x456282){try{jsonpatch[_0x8895('0x20')](_0x456282,_0x3daf43,!![]);}catch(_0x29449a){return BPromise[_0x8895('0x21')](_0x29449a);}return _0x456282[_0x8895('0x22')]();};}function saveUpdates(_0x461346,_0xc1ce17){return function(_0x5219ca){if(_0x5219ca){return _0x5219ca[_0x8895('0x23')](_0x461346)[_0x8895('0x24')](function(_0x2a403){return _0x2a403;});}return null;};}function removeEntity(_0x1f71f3,_0x29223d){return function(_0x4d092d){if(_0x4d092d){return _0x4d092d['destroy']()[_0x8895('0x24')](function(){_0x1f71f3[_0x8895('0x19')](0xcc)[_0x8895('0x1a')]();});}};}function handleEntityNotFound(_0x24a376,_0x4fc150){return function(_0x25da11){if(!_0x25da11){_0x24a376[_0x8895('0x18')](0x194);}return _0x25da11;};}function handleError(_0x187a15,_0x5486a6){_0x5486a6=_0x5486a6||0x1f4;return function(_0x4aee03){logger[_0x8895('0x25')](_0x4aee03['stack']);if(_0x4aee03[_0x8895('0x26')]){delete _0x4aee03[_0x8895('0x26')];}_0x187a15[_0x8895('0x19')](_0x5486a6)[_0x8895('0x27')](_0x4aee03);};}exports[_0x8895('0x28')]=function(_0x5c03ea,_0x4d567a){var _0x6e449d={},_0x37ac3a={},_0x3fc4cc={'count':0x0,'rows':[]};var _0x16b65b=_[_0x8895('0x29')](db['ScreenRecording']['rawAttributes'],function(_0x46ae32){return{'name':_0x46ae32[_0x8895('0x2a')],'type':_0x46ae32[_0x8895('0x2b')][_0x8895('0x2c')]};});_0x37ac3a[_0x8895('0x2d')]=_['differenceBy'](_[_0x8895('0x29')](_0x16b65b,'name'),[_0x8895('0x2e')]);_0x37ac3a['query']=_[_0x8895('0x2f')](_0x5c03ea[_0x8895('0x30')]);_0x37ac3a[_0x8895('0x31')]=_[_0x8895('0x32')](_0x37ac3a[_0x8895('0x2d')],_0x37ac3a['query']);_0x6e449d[_0x8895('0x33')]=_[_0x8895('0x32')](_0x37ac3a[_0x8895('0x2d')],qs[_0x8895('0x34')](_0x5c03ea[_0x8895('0x30')]['fields']));_0x6e449d[_0x8895('0x33')]=_0x6e449d['attributes'][_0x8895('0x35')]?_0x6e449d['attributes']:_0x37ac3a[_0x8895('0x2d')];if(!_0x5c03ea[_0x8895('0x30')][_0x8895('0x36')](_0x8895('0x37'))){_0x6e449d[_0x8895('0x1d')]=qs['limit'](_0x5c03ea[_0x8895('0x30')]['limit']);_0x6e449d[_0x8895('0x1f')]=qs[_0x8895('0x1f')](_0x5c03ea[_0x8895('0x30')][_0x8895('0x1f')]);}_0x6e449d[_0x8895('0x38')]=qs[_0x8895('0x39')](_0x5c03ea['query'][_0x8895('0x39')]);_0x6e449d[_0x8895('0x3a')]=qs['filters'](_[_0x8895('0x3b')](_0x5c03ea['query'],_0x37ac3a[_0x8895('0x31')]),_0x16b65b);if(_0x5c03ea[_0x8895('0x30')]['filter']){_0x6e449d[_0x8895('0x3a')]=_[_0x8895('0x3c')](_0x6e449d['where'],{'$or':_['map'](_0x16b65b,function(_0x202130){if(_0x202130[_0x8895('0x2b')]!==_0x8895('0x3d')){var _0x331a9e={};_0x331a9e[_0x202130[_0x8895('0x26')]]={'$like':'%'+_0x5c03ea['query'][_0x8895('0x3e')]+'%'};return _0x331a9e;}})});}_0x6e449d=_[_0x8895('0x3c')]({},_0x6e449d,_0x5c03ea[_0x8895('0x3f')]);var _0x10005f={'where':_0x6e449d[_0x8895('0x3a')]};return db[_0x8895('0x40')]['count'](_0x10005f)[_0x8895('0x24')](function(_0x5ebfc4){_0x3fc4cc[_0x8895('0x1e')]=_0x5ebfc4;if(_0x5c03ea[_0x8895('0x30')]['includeAll']){_0x6e449d[_0x8895('0x41')]=[{'all':!![]}];}return db['ScreenRecording'][_0x8895('0x42')](_0x6e449d);})['then'](function(_0x4af3b1){_0x3fc4cc['rows']=_0x4af3b1;return _0x3fc4cc;})['then'](respondWithFilteredResult(_0x4d567a,_0x6e449d))['catch'](handleError(_0x4d567a,null));};exports['show']=function(_0x447ed6,_0x206f57){var _0x596531={'raw':![],'where':{'id':_0x447ed6[_0x8895('0x43')]['id']}},_0x4835d7={};_0x4835d7[_0x8895('0x2d')]=_['keys'](db[_0x8895('0x40')][_0x8895('0x44')]);_0x4835d7[_0x8895('0x30')]=_[_0x8895('0x2f')](_0x447ed6[_0x8895('0x30')]);_0x4835d7['filters']=_['intersection'](_0x4835d7['model'],_0x4835d7[_0x8895('0x30')]);_0x596531['attributes']=_[_0x8895('0x32')](_0x4835d7[_0x8895('0x2d')],qs[_0x8895('0x34')](_0x447ed6[_0x8895('0x30')]['fields']));_0x596531[_0x8895('0x33')]=_0x596531[_0x8895('0x33')][_0x8895('0x35')]?_0x596531[_0x8895('0x33')]:_0x4835d7[_0x8895('0x2d')];if(_0x447ed6[_0x8895('0x30')][_0x8895('0x45')]){_0x596531[_0x8895('0x41')]=[{'all':!![]}];}_0x596531=_['merge']({},_0x596531,_0x447ed6[_0x8895('0x3f')]);return db[_0x8895('0x40')]['find'](_0x596531)[_0x8895('0x24')](handleEntityNotFound(_0x206f57,null))['then'](respondWithResult(_0x206f57,null))['catch'](handleError(_0x206f57,null));};exports[_0x8895('0x46')]=function(_0x337a9f,_0x130018){return db['ScreenRecording'][_0x8895('0x46')](_0x337a9f['body'],{})[_0x8895('0x24')](respondWithResult(_0x130018,0xc9))[_0x8895('0x47')](handleError(_0x130018,null));};exports[_0x8895('0x23')]=function(_0x1ca539,_0x2f3bf1){if(_0x1ca539[_0x8895('0x48')]['id']){delete _0x1ca539[_0x8895('0x48')]['id'];}delete _0x1ca539['body']['duration'];delete _0x1ca539[_0x8895('0x48')][_0x8895('0x49')];delete _0x1ca539['body'][_0x8895('0x4a')];delete _0x1ca539['body']['value'];return db[_0x8895('0x40')]['find']({'where':{'id':_0x1ca539[_0x8895('0x43')]['id']}})[_0x8895('0x24')](handleEntityNotFound(_0x2f3bf1,null))[_0x8895('0x24')](saveUpdates(_0x1ca539[_0x8895('0x48')],null))[_0x8895('0x24')](respondWithResult(_0x2f3bf1,null))[_0x8895('0x47')](handleError(_0x2f3bf1,null));};exports[_0x8895('0x4b')]=function(_0x38d6ae,_0x583419){return db[_0x8895('0x40')][_0x8895('0x4b')]()[_0x8895('0x24')](respondWithResult(_0x583419,null))['catch'](handleError(_0x583419,null));};exports[_0x8895('0x4c')]=function(_0x3935fd,_0xd7ffeb,_0x14e769){var _0x1e264a=require(_0x8895('0x4d'));var _0x434ab8=![];var _0x216e6e={};if(_0x3935fd[_0x8895('0x30')][_0x8895('0x2b')]&&_0x3935fd['query'][_0x8895('0x2b')]===_0x8895('0x4e')){_0x216e6e[_0x8895('0x4e')]=_0x3935fd[_0x8895('0x43')]['id'];}else{_0x216e6e['id']=_0x3935fd[_0x8895('0x43')]['id'];}return db['ScreenRecording'][_0x8895('0x4f')]({'where':_0x216e6e,'attributes':['id',_0x8895('0x50')],'raw':!![]})[_0x8895('0x24')](handleEntityNotFound(_0xd7ffeb,null))[_0x8895('0x24')](function(_0x37a7b4){if(_0x37a7b4){var _0x58dd6c=path[_0x8895('0x51')](config[_0x8895('0x52')],_0x8895('0x53'),_0x37a7b4['value']);var _0x20422f=util[_0x8895('0x2e')](_0x8895('0x54'),_0x58dd6c);if(fs['existsSync'](_0x20422f)){_0x434ab8=!![];return _0x1e264a[_0x8895('0x55')](_0x20422f,_0x58dd6c,config[_0x8895('0x56')]['recording'])[_0x8895('0x24')](function(){return _0x37a7b4;});}return _0x37a7b4;}})[_0x8895('0x24')](function(_0x5198f8){if(_0x5198f8){var _0x2f990a=path[_0x8895('0x51')](config[_0x8895('0x52')],_0x8895('0x53'),_0x5198f8['value']);if(!fs['existsSync'](_0x2f990a)){throw new db[(_0x8895('0x57'))][(_0x8895('0x58'))](_0x8895('0x59'));}if(_0x5198f8['filename']){return _0xd7ffeb[_0x8895('0x4c')](_0x2f990a,_0x5198f8[_0x8895('0x5a')]+path['extname'](_0x2f990a),function(){if(_0x434ab8){fs[_0x8895('0x5b')](_0x2f990a);}});}else{return _0xd7ffeb['download'](_0x2f990a,function(_0x435e36){if(_0x434ab8){fs[_0x8895('0x5b')](_0x2f990a);}});}}})[_0x8895('0x47')](function(_0x14f8a4){if(_0x14f8a4[_0x8895('0x5c')]==='ScreenRecording\x20not\x20found'){_0xd7ffeb['status'](0x194)[_0x8895('0x27')](_0x8895('0x5d'));}else{return handleError(_0xd7ffeb,null);}});};exports['destroy']=function(_0x46f8ae,_0x131476){return db[_0x8895('0x40')][_0x8895('0x4f')]({'where':{'id':_0x46f8ae['params']['id']}})[_0x8895('0x24')](function(_0x2d2bf9){if(_[_0x8895('0x5e')](_0x2d2bf9)){throw new ReferenceError(_0x8895('0x5f'));}return _0x2d2bf9;})[_0x8895('0x24')](function(_0x41a2fe){var _0x261d4b=path[_0x8895('0x51')](config[_0x8895('0x52')],_0x8895('0x53'),_0x41a2fe[_0x8895('0x50')]);logger[_0x8895('0x60')](_0x8895('0x61'),_0x261d4b);if(!_[_0x8895('0x5e')](_0x41a2fe[_0x8895('0x50')])&&fs['existsSync'](_0x261d4b)){logger['info']('File:\x20\x22'+_0x261d4b+_0x8895('0x62'));fs[_0x8895('0x63')](_0x261d4b);}_0x261d4b=_0x261d4b+_0x8895('0x64');if(!_[_0x8895('0x5e')](_0x41a2fe[_0x8895('0x50')])&&fs['existsSync'](_0x261d4b)){logger[_0x8895('0x60')](_0x8895('0x65')+_0x261d4b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x8895('0x63')](_0x261d4b);}return _0x41a2fe;})[_0x8895('0x24')](function(_0xf51f48){if(!_0xf51f48)throw new InternalError();return _0xf51f48[_0x8895('0x66')]();})[_0x8895('0x24')](function(){_0x131476['status'](0xcc)[_0x8895('0x1a')]();})[_0x8895('0x47')](handleError(_0x131476,null));}; \ No newline at end of file +var _0x84ab=['describe','download','join','existsSync','decryptFile','secrets','recording','Sequelize','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','server/files/screen_recordings','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','rawAttributes','type','key','model','differenceBy','map','format','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','ScreenRecording','rows','params','keys','intersection','find','catch','body','createdAt','value'];(function(_0x4221b7,_0x2200c3){var _0x47346c=function(_0x1f7bae){while(--_0x1f7bae){_0x4221b7['push'](_0x4221b7['shift']());}};_0x47346c(++_0x2200c3);}(_0x84ab,0x12f));var _0xb84a=function(_0x462999,_0x24d200){_0x462999=_0x462999-0x0;var _0x4b1366=_0x84ab[_0x462999];return _0x4b1366;};'use strict';var emlformat=require(_0xb84a('0x0'));var rimraf=require(_0xb84a('0x1'));var zipdir=require(_0xb84a('0x2'));var jsonpatch=require(_0xb84a('0x3'));var rp=require(_0xb84a('0x4'));var moment=require('moment');var BPromise=require(_0xb84a('0x5'));var Mustache=require(_0xb84a('0x6'));var util=require('util');var path=require(_0xb84a('0x7'));var sox=require(_0xb84a('0x8'));var csv=require(_0xb84a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb84a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb84a('0xb'));var deskjs=require(_0xb84a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84a('0xe'));var authService=require(_0xb84a('0xf'));var qs=require(_0xb84a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb84a('0x11'));var utils=require(_0xb84a('0x12'));var config=require(_0xb84a('0x13'));var licenseUtil=require(_0xb84a('0x14'));var db=require(_0xb84a('0x15'))['db'];function respondWithStatusCode(_0x4d3758,_0x83444e){_0x83444e=_0x83444e||0xcc;return function(_0x4777dc){if(_0x4777dc){return _0x4d3758[_0xb84a('0x16')](_0x83444e);}return _0x4d3758[_0xb84a('0x17')](_0x83444e)[_0xb84a('0x18')]();};}function respondWithResult(_0x11dfe9,_0x12ccab){_0x12ccab=_0x12ccab||0xc8;return function(_0x475b){if(_0x475b){return _0x11dfe9[_0xb84a('0x17')](_0x12ccab)[_0xb84a('0x19')](_0x475b);}};}function respondWithFilteredResult(_0xc0b2e0,_0x1251ec){return function(_0x5716bd){if(_0x5716bd){var _0x11dd4d=typeof _0x1251ec[_0xb84a('0x1a')]===_0xb84a('0x1b')&&typeof _0x1251ec[_0xb84a('0x1c')]===_0xb84a('0x1b');var _0x1be87a=_0x5716bd[_0xb84a('0x1d')];var _0x34d82f=_0x11dd4d?0x0:_0x1251ec[_0xb84a('0x1a')];var _0x3f7437=_0x11dd4d?_0x5716bd[_0xb84a('0x1d')]:_0x1251ec[_0xb84a('0x1a')]+_0x1251ec[_0xb84a('0x1c')];var _0x200289;if(_0x3f7437>=_0x1be87a){_0x3f7437=_0x1be87a;_0x200289=0xc8;}else{_0x200289=0xce;}_0xc0b2e0['status'](_0x200289);return _0xc0b2e0[_0xb84a('0x1e')](_0xb84a('0x1f'),_0x34d82f+'-'+_0x3f7437+'/'+_0x1be87a)['json'](_0x5716bd);}return null;};}function patchUpdates(_0xac76d3){return function(_0x61ef03){try{jsonpatch[_0xb84a('0x20')](_0x61ef03,_0xac76d3,!![]);}catch(_0x19f637){return BPromise['reject'](_0x19f637);}return _0x61ef03['save']();};}function saveUpdates(_0x1466ae,_0x19097d){return function(_0x2d70fd){if(_0x2d70fd){return _0x2d70fd[_0xb84a('0x21')](_0x1466ae)[_0xb84a('0x22')](function(_0x3b8fb2){return _0x3b8fb2;});}return null;};}function removeEntity(_0x8b28cd,_0x21d0d3){return function(_0x3aa06f){if(_0x3aa06f){return _0x3aa06f[_0xb84a('0x23')]()[_0xb84a('0x22')](function(){_0x8b28cd[_0xb84a('0x17')](0xcc)[_0xb84a('0x18')]();});}};}function handleEntityNotFound(_0x409df0,_0x19bdfa){return function(_0x3258a9){if(!_0x3258a9){_0x409df0[_0xb84a('0x16')](0x194);}return _0x3258a9;};}function handleError(_0x3ff0bc,_0x3b6805){_0x3b6805=_0x3b6805||0x1f4;return function(_0xd468c3){logger[_0xb84a('0x24')](_0xd468c3[_0xb84a('0x25')]);if(_0xd468c3[_0xb84a('0x26')]){delete _0xd468c3[_0xb84a('0x26')];}_0x3ff0bc[_0xb84a('0x17')](_0x3b6805)[_0xb84a('0x27')](_0xd468c3);};}exports['index']=function(_0x582954,_0x4608ce){var _0x2c30b0={},_0x4dab4e={},_0x1f690a={'count':0x0,'rows':[]};var _0x36b4f4=_['map'](db['ScreenRecording'][_0xb84a('0x28')],function(_0x8e9319){return{'name':_0x8e9319['fieldName'],'type':_0x8e9319[_0xb84a('0x29')][_0xb84a('0x2a')]};});_0x4dab4e[_0xb84a('0x2b')]=_[_0xb84a('0x2c')](_[_0xb84a('0x2d')](_0x36b4f4,_0xb84a('0x26')),[_0xb84a('0x2e')]);_0x4dab4e[_0xb84a('0x2f')]=_['keys'](_0x582954[_0xb84a('0x2f')]);_0x4dab4e['filters']=_['intersection'](_0x4dab4e[_0xb84a('0x2b')],_0x4dab4e[_0xb84a('0x2f')]);_0x2c30b0['attributes']=_['intersection'](_0x4dab4e[_0xb84a('0x2b')],qs[_0xb84a('0x30')](_0x582954[_0xb84a('0x2f')][_0xb84a('0x30')]));_0x2c30b0[_0xb84a('0x31')]=_0x2c30b0[_0xb84a('0x31')][_0xb84a('0x32')]?_0x2c30b0[_0xb84a('0x31')]:_0x4dab4e['model'];if(!_0x582954[_0xb84a('0x2f')][_0xb84a('0x33')](_0xb84a('0x34'))){_0x2c30b0[_0xb84a('0x1c')]=qs[_0xb84a('0x1c')](_0x582954[_0xb84a('0x2f')][_0xb84a('0x1c')]);_0x2c30b0['offset']=qs[_0xb84a('0x1a')](_0x582954['query'][_0xb84a('0x1a')]);}_0x2c30b0[_0xb84a('0x35')]=qs[_0xb84a('0x36')](_0x582954['query']['sort']);_0x2c30b0[_0xb84a('0x37')]=qs[_0xb84a('0x38')](_[_0xb84a('0x39')](_0x582954[_0xb84a('0x2f')],_0x4dab4e[_0xb84a('0x38')]),_0x36b4f4);if(_0x582954['query'][_0xb84a('0x3a')]){_0x2c30b0[_0xb84a('0x37')]=_['merge'](_0x2c30b0[_0xb84a('0x37')],{'$or':_[_0xb84a('0x2d')](_0x36b4f4,function(_0x19634b){if(_0x19634b[_0xb84a('0x29')]!=='VIRTUAL'){var _0x57a1a8={};_0x57a1a8[_0x19634b['name']]={'$like':'%'+_0x582954[_0xb84a('0x2f')][_0xb84a('0x3a')]+'%'};return _0x57a1a8;}})});}_0x2c30b0=_[_0xb84a('0x3b')]({},_0x2c30b0,_0x582954[_0xb84a('0x3c')]);var _0x55b0b8={'where':_0x2c30b0[_0xb84a('0x37')]};return db['ScreenRecording'][_0xb84a('0x1d')](_0x55b0b8)['then'](function(_0x48db18){_0x1f690a['count']=_0x48db18;if(_0x582954[_0xb84a('0x2f')][_0xb84a('0x3d')]){_0x2c30b0[_0xb84a('0x3e')]=[{'all':!![]}];}return db[_0xb84a('0x3f')]['findAll'](_0x2c30b0);})[_0xb84a('0x22')](function(_0x42f0b6){_0x1f690a[_0xb84a('0x40')]=_0x42f0b6;return _0x1f690a;})[_0xb84a('0x22')](respondWithFilteredResult(_0x4608ce,_0x2c30b0))['catch'](handleError(_0x4608ce,null));};exports['show']=function(_0x15a621,_0x1f3e04){var _0x541cc4={'raw':![],'where':{'id':_0x15a621[_0xb84a('0x41')]['id']}},_0x1045ee={};_0x1045ee[_0xb84a('0x2b')]=_[_0xb84a('0x42')](db[_0xb84a('0x3f')][_0xb84a('0x28')]);_0x1045ee[_0xb84a('0x2f')]=_[_0xb84a('0x42')](_0x15a621[_0xb84a('0x2f')]);_0x1045ee[_0xb84a('0x38')]=_[_0xb84a('0x43')](_0x1045ee[_0xb84a('0x2b')],_0x1045ee[_0xb84a('0x2f')]);_0x541cc4[_0xb84a('0x31')]=_[_0xb84a('0x43')](_0x1045ee['model'],qs[_0xb84a('0x30')](_0x15a621[_0xb84a('0x2f')][_0xb84a('0x30')]));_0x541cc4[_0xb84a('0x31')]=_0x541cc4[_0xb84a('0x31')][_0xb84a('0x32')]?_0x541cc4['attributes']:_0x1045ee[_0xb84a('0x2b')];if(_0x15a621['query'][_0xb84a('0x3d')]){_0x541cc4[_0xb84a('0x3e')]=[{'all':!![]}];}_0x541cc4=_[_0xb84a('0x3b')]({},_0x541cc4,_0x15a621[_0xb84a('0x3c')]);return db['ScreenRecording'][_0xb84a('0x44')](_0x541cc4)[_0xb84a('0x22')](handleEntityNotFound(_0x1f3e04,null))[_0xb84a('0x22')](respondWithResult(_0x1f3e04,null))['catch'](handleError(_0x1f3e04,null));};exports['create']=function(_0x385986,_0x10b0cc){return db[_0xb84a('0x3f')]['create'](_0x385986['body'],{})['then'](respondWithResult(_0x10b0cc,0xc9))[_0xb84a('0x45')](handleError(_0x10b0cc,null));};exports[_0xb84a('0x21')]=function(_0x38f329,_0x4476bc){if(_0x38f329[_0xb84a('0x46')]['id']){delete _0x38f329['body']['id'];}delete _0x38f329['body']['duration'];delete _0x38f329['body'][_0xb84a('0x47')];delete _0x38f329[_0xb84a('0x46')]['closedAt'];delete _0x38f329[_0xb84a('0x46')][_0xb84a('0x48')];return db[_0xb84a('0x3f')][_0xb84a('0x44')]({'where':{'id':_0x38f329[_0xb84a('0x41')]['id']}})[_0xb84a('0x22')](handleEntityNotFound(_0x4476bc,null))['then'](saveUpdates(_0x38f329['body'],null))[_0xb84a('0x22')](respondWithResult(_0x4476bc,null))['catch'](handleError(_0x4476bc,null));};exports[_0xb84a('0x49')]=function(_0x4d1a29,_0x575908){return db['ScreenRecording'][_0xb84a('0x49')]()[_0xb84a('0x22')](respondWithResult(_0x575908,null))[_0xb84a('0x45')](handleError(_0x575908,null));};exports[_0xb84a('0x4a')]=function(_0x33adfc,_0x46f7eb,_0x37ca26){var _0x29ff35=require('../../components/encryptor');var _0x5afdd0=![];var _0x4c5bdf={};if(_0x33adfc[_0xb84a('0x2f')][_0xb84a('0x29')]&&_0x33adfc['query'][_0xb84a('0x29')]==='uniqueid'){_0x4c5bdf['uniqueid']=_0x33adfc['params']['id'];}else{_0x4c5bdf['id']=_0x33adfc[_0xb84a('0x41')]['id'];}return db[_0xb84a('0x3f')][_0xb84a('0x44')]({'where':_0x4c5bdf,'attributes':['id','value'],'raw':!![]})[_0xb84a('0x22')](handleEntityNotFound(_0x46f7eb,null))[_0xb84a('0x22')](function(_0x136d61){if(_0x136d61){var _0x505994=path[_0xb84a('0x4b')](config['root'],'server/files/screen_recordings',_0x136d61[_0xb84a('0x48')]);var _0x47a8a2=util[_0xb84a('0x2e')]('%s.cypher',_0x505994);if(fs[_0xb84a('0x4c')](_0x47a8a2)){_0x5afdd0=!![];return _0x29ff35[_0xb84a('0x4d')](_0x47a8a2,_0x505994,config[_0xb84a('0x4e')][_0xb84a('0x4f')])['then'](function(){return _0x136d61;});}return _0x136d61;}})['then'](function(_0x4fc998){if(_0x4fc998){var _0x40b392=path[_0xb84a('0x4b')](config['root'],'server/files/screen_recordings',_0x4fc998[_0xb84a('0x48')]);if(!fs[_0xb84a('0x4c')](_0x40b392)){throw new db[(_0xb84a('0x50'))]['ValidationError'](_0xb84a('0x51'));}if(_0x4fc998[_0xb84a('0x52')]){return _0x46f7eb['download'](_0x40b392,_0x4fc998[_0xb84a('0x52')]+path[_0xb84a('0x53')](_0x40b392),function(){if(_0x5afdd0){fs[_0xb84a('0x54')](_0x40b392);}});}else{return _0x46f7eb[_0xb84a('0x4a')](_0x40b392,function(_0x3bbc69){if(_0x5afdd0){fs[_0xb84a('0x54')](_0x40b392);}});}}})[_0xb84a('0x45')](function(_0x47c27f){if(_0x47c27f[_0xb84a('0x55')]===_0xb84a('0x51')){_0x46f7eb['status'](0x194)[_0xb84a('0x27')](_0xb84a('0x56'));}else{return handleError(_0x46f7eb,null);}});};exports[_0xb84a('0x23')]=function(_0x3e16d8,_0x347998){return db[_0xb84a('0x3f')][_0xb84a('0x44')]({'where':{'id':_0x3e16d8[_0xb84a('0x41')]['id']}})[_0xb84a('0x22')](function(_0x5dd660){if(_[_0xb84a('0x57')](_0x5dd660)){throw new ReferenceError('Entity\x20not\x20found');}return _0x5dd660;})['then'](function(_0x19d635){var _0x5e11c8=path[_0xb84a('0x4b')](config['root'],_0xb84a('0x58'),_0x19d635[_0xb84a('0x48')]);logger['info'](_0xb84a('0x59'),_0x5e11c8);if(!_[_0xb84a('0x57')](_0x19d635[_0xb84a('0x48')])&&fs[_0xb84a('0x4c')](_0x5e11c8)){logger[_0xb84a('0x5a')](_0xb84a('0x5b')+_0x5e11c8+_0xb84a('0x5c'));fs['unlinkSync'](_0x5e11c8);}_0x5e11c8=_0x5e11c8+_0xb84a('0x5d');if(!_['isNil'](_0x19d635['value'])&&fs[_0xb84a('0x4c')](_0x5e11c8)){logger[_0xb84a('0x5a')](_0xb84a('0x5b')+_0x5e11c8+_0xb84a('0x5c'));fs['unlinkSync'](_0x5e11c8);}return _0x19d635;})['then'](function(_0x43031f){if(!_0x43031f)throw new InternalError();return _0x43031f[_0xb84a('0x23')]();})[_0xb84a('0x22')](function(){_0x347998[_0xb84a('0x17')](0xcc)['end']();})[_0xb84a('0x45')](handleError(_0x347998,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index da0e692..487b7a4 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 _0xb862=['interactionid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ScreenRecording','screen_recordings'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb862,0x1a5));var _0x2b86=function(_0x204073,_0x350740){_0x204073=_0x204073-0x0;var _0x3e6236=_0xb862[_0x204073];return _0x3e6236;};'use strict';var _=require(_0x2b86('0x0'));var util=require(_0x2b86('0x1'));var logger=require('../../config/logger')(_0x2b86('0x2'));var moment=require(_0x2b86('0x3'));var BPromise=require(_0x2b86('0x4'));var rp=require(_0x2b86('0x5'));var fs=require('fs');var path=require(_0x2b86('0x6'));var rimraf=require(_0x2b86('0x7'));var config=require(_0x2b86('0x8'));var attributes=require('./screenRecording.attributes');module[_0x2b86('0x9')]=function(_0x141354,_0x5624c3){return _0x141354[_0x2b86('0xa')](_0x2b86('0xb'),attributes,{'tableName':_0x2b86('0xc'),'paranoid':![],'indexes':[{'name':_0x2b86('0xd'),'fields':[_0x2b86('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1366=['bluebird','request-promise','path','../../config/environment','./screenRecording.attributes','exports','ScreenRecording','screen_recordings','interactionid','util','../../config/logger'];(function(_0x52d0b,_0x1fdd38){var _0x131949=function(_0x4a251c){while(--_0x4a251c){_0x52d0b['push'](_0x52d0b['shift']());}};_0x131949(++_0x1fdd38);}(_0x1366,0xf0));var _0x6136=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x1366[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0x6136('0x0'));var logger=require(_0x6136('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6136('0x2'));var rp=require(_0x6136('0x3'));var fs=require('fs');var path=require(_0x6136('0x4'));var rimraf=require('rimraf');var config=require(_0x6136('0x5'));var attributes=require(_0x6136('0x6'));module[_0x6136('0x7')]=function(_0x1b4ec6,_0xab5f48){return _0x1b4ec6['define'](_0x6136('0x8'),attributes,{'tableName':_0x6136('0x9'),'paranoid':![],'indexes':[{'name':_0x6136('0xa'),'fields':[_0x6136('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 89a57fd..2ff6db4 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 _0x900b=['../../config/environment','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x18a1a9,_0x44c45d){var _0x1fb0e3=function(_0x58e083){while(--_0x58e083){_0x18a1a9['push'](_0x18a1a9['shift']());}};_0x1fb0e3(++_0x44c45d);}(_0x900b,0x6a));var _0xb900=function(_0x22c023,_0xb6dc66){_0x22c023=_0x22c023-0x0;var _0x3774cc=_0x900b[_0x22c023];return _0x3774cc;};'use strict';var _=require(_0xb900('0x0'));var util=require(_0xb900('0x1'));var moment=require(_0xb900('0x2'));var BPromise=require(_0xb900('0x3'));var rs=require(_0xb900('0x4'));var fs=require('fs');var Redis=require(_0xb900('0x5'));var db=require(_0xb900('0x6'))['db'];var utils=require(_0xb900('0x7'));var logger=require(_0xb900('0x8'))('rpc');var config=require(_0xb900('0x9'));var jayson=require(_0xb900('0xa'));var client=jayson[_0xb900('0xb')][_0xb900('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4a4dad,_0x134089,_0xf93f0e){return new BPromise(function(_0x22cdc8,_0x21a142){return client[_0xb900('0xd')](_0x4a4dad,_0xf93f0e)[_0xb900('0xe')](function(_0x21c046){logger[_0xb900('0xf')](_0xb900('0x10'),_0x134089,_0xb900('0x11'));logger[_0xb900('0x12')](_0xb900('0x13'),_0x134089,_0xb900('0x11'),JSON['stringify'](_0x21c046));if(_0x21c046[_0xb900('0x14')]){if(_0x21c046[_0xb900('0x14')]['code']===0x1f4){logger[_0xb900('0x14')]('ScreenRecording,\x20%s,\x20%s',_0x134089,_0x21c046[_0xb900('0x14')][_0xb900('0x15')]);return _0x21a142(_0x21c046[_0xb900('0x14')][_0xb900('0x15')]);}logger['error'](_0xb900('0x10'),_0x134089,_0x21c046[_0xb900('0x14')][_0xb900('0x15')]);return _0x22cdc8(_0x21c046[_0xb900('0x14')][_0xb900('0x15')]);}else{logger['info'](_0xb900('0x10'),_0x134089,_0xb900('0x11'));_0x22cdc8(_0x21c046['result']['message']);}})[_0xb900('0x16')](function(_0x3f231b){logger[_0xb900('0x14')]('ScreenRecording,\x20%s,\x20%s',_0x134089,_0x3f231b);_0x21a142(_0x3f231b);});});} \ No newline at end of file +var _0x35c8=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x35c8,0x95));var _0x835c=function(_0xaa7079,_0xb873c8){_0xaa7079=_0xaa7079-0x0;var _0x5a1455=_0x35c8[_0xaa7079];return _0x5a1455;};'use strict';var _=require(_0x835c('0x0'));var util=require(_0x835c('0x1'));var moment=require(_0x835c('0x2'));var BPromise=require(_0x835c('0x3'));var rs=require(_0x835c('0x4'));var fs=require('fs');var Redis=require(_0x835c('0x5'));var db=require(_0x835c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x835c('0x7'))(_0x835c('0x8'));var config=require(_0x835c('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x835c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b2408,_0x1f3242,_0x22d606){return new BPromise(function(_0x444709,_0x38205c){return client[_0x835c('0xb')](_0x4b2408,_0x22d606)[_0x835c('0xc')](function(_0x2b7e89){logger[_0x835c('0xd')](_0x835c('0xe'),_0x1f3242,_0x835c('0xf'));logger['debug']('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x1f3242,_0x835c('0xf'),JSON[_0x835c('0x10')](_0x2b7e89));if(_0x2b7e89[_0x835c('0x11')]){if(_0x2b7e89[_0x835c('0x11')]['code']===0x1f4){logger['error'](_0x835c('0xe'),_0x1f3242,_0x2b7e89['error'][_0x835c('0x12')]);return _0x38205c(_0x2b7e89[_0x835c('0x11')][_0x835c('0x12')]);}logger[_0x835c('0x11')](_0x835c('0xe'),_0x1f3242,_0x2b7e89[_0x835c('0x11')][_0x835c('0x12')]);return _0x444709(_0x2b7e89[_0x835c('0x11')][_0x835c('0x12')]);}else{logger['info'](_0x835c('0xe'),_0x1f3242,'request\x20sent');_0x444709(_0x2b7e89[_0x835c('0x13')][_0x835c('0x12')]);}})[_0x835c('0x14')](function(_0x5c9386){logger['error'](_0x835c('0xe'),_0x1f3242,_0x5c9386);_0x38205c(_0x5c9386);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 2d96348..64887b0 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 _0x2524=['./setting.controller','get','index','/now','getDate','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','getFavicon','diskStorage','root','server/files/images/logos/','format','%s%s','originalname','post','/:id/logo','file','addLogo','join','extname','single','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','/:id','isAuthenticated','exports','multer','connect-timeout','express'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x2524,0xe1));var _0x4252=function(_0x51e7a,_0x3b390b){_0x51e7a=_0x51e7a-0x0;var _0x36510e=_0x2524[_0x51e7a];return _0x36510e;};'use strict';var multer=require(_0x4252('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4252('0x1'));var express=require(_0x4252('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4252('0x3'));router[_0x4252('0x4')]('/',auth['isAuthenticated'](),controller[_0x4252('0x5')]);router[_0x4252('0x4')](_0x4252('0x6'),controller[_0x4252('0x7')]);router[_0x4252('0x4')]('/:id',controller['show']);router[_0x4252('0x4')]('/:id/logo',controller[_0x4252('0x8')]);router[_0x4252('0x4')](_0x4252('0x9'),controller[_0x4252('0xa')]);router[_0x4252('0x4')](_0x4252('0xb'),controller[_0x4252('0xc')]);router['get'](_0x4252('0xd'),controller['getPreferred']);router['get'](_0x4252('0xe'),controller[_0x4252('0xf')]);var upload=multer({'storage':multer[_0x4252('0x10')]({'destination':function(_0x2a6d95,_0x30e684,_0x3e9007){_0x3e9007(null,path['join'](config[_0x4252('0x11')],_0x4252('0x12')));},'filename':function(_0xfd83ff,_0x4ce840,_0x2d593e){_0x2d593e(null,util[_0x4252('0x13')](_0x4252('0x14'),'logo',path['extname'](_0x4ce840[_0x4252('0x15')])));}})});router[_0x4252('0x16')](_0x4252('0x17'),upload['single'](_0x4252('0x18')),controller[_0x4252('0x19')]);var upload=multer({'storage':multer[_0x4252('0x10')]({'destination':function(_0x2e8a9f,_0x445dab,_0x18487e){_0x18487e(null,path[_0x4252('0x1a')](config[_0x4252('0x11')],_0x4252('0x12')));},'filename':function(_0x445f2c,_0x3ee02a,_0x1dfd55){_0x1dfd55(null,util[_0x4252('0x13')]('%s%s','logologin',path[_0x4252('0x1b')](_0x3ee02a[_0x4252('0x15')])));}})});router['post'](_0x4252('0x9'),upload[_0x4252('0x1c')](_0x4252('0x18')),controller[_0x4252('0x1d')]);var upload=multer({'storage':multer[_0x4252('0x10')]({'destination':function(_0x2d1e4c,_0x2b5a5a,_0x3436b5){_0x3436b5(null,path['join'](config[_0x4252('0x11')],_0x4252('0x12')));},'filename':function(_0x272f60,_0x487259,_0x6726d4){_0x6726d4(null,util[_0x4252('0x13')](_0x4252('0x14'),_0x4252('0x1e'),path[_0x4252('0x1b')](_0x487259[_0x4252('0x15')])));}})});router[_0x4252('0x16')](_0x4252('0xd'),upload[_0x4252('0x1c')](_0x4252('0x18')),controller[_0x4252('0x1f')]);var upload=multer({'storage':multer[_0x4252('0x10')]({'destination':function(_0x2371fd,_0x395575,_0x6a54cc){_0x6a54cc(null,path[_0x4252('0x1a')](config[_0x4252('0x11')],_0x4252('0x12')));},'filename':function(_0x318d7b,_0x4885b1,_0x56cffa){_0x56cffa(null,util[_0x4252('0x13')](_0x4252('0x14'),_0x4252('0x20'),path[_0x4252('0x1b')](_0x4885b1[_0x4252('0x15')])));}})});router['post']('/:id/favicon',upload[_0x4252('0x1c')]('file'),controller[_0x4252('0x21')]);router[_0x4252('0x22')](_0x4252('0x23'),auth[_0x4252('0x24')](),controller['update']);module[_0x4252('0x25')]=router; \ No newline at end of file +var _0xe44e=['logologin','originalname','/:id/logo_login','join','preferred','addPreferred','favicon','addFavicon','put','update','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','/:id','show','/:id/logo','getLogo','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','getFavicon','diskStorage','root','server/files/images/logos/','format','%s%s','logo','extname','post','single','file','addLogo'];(function(_0x416c50,_0x974ac7){var _0x596d03=function(_0x12fc10){while(--_0x12fc10){_0x416c50['push'](_0x416c50['shift']());}};_0x596d03(++_0x974ac7);}(_0xe44e,0x8b));var _0xee44=function(_0x21163c,_0x195ef1){_0x21163c=_0x21163c-0x0;var _0x129845=_0xe44e[_0x21163c];return _0x129845;};'use strict';var multer=require('multer');var util=require(_0xee44('0x0'));var path=require(_0xee44('0x1'));var timeout=require('connect-timeout');var express=require(_0xee44('0x2'));var router=express[_0xee44('0x3')]();var fs_extra=require(_0xee44('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xee44('0x5'));var config=require(_0xee44('0x6'));var controller=require(_0xee44('0x7'));router[_0xee44('0x8')]('/',auth[_0xee44('0x9')](),controller[_0xee44('0xa')]);router['get'](_0xee44('0xb'),controller['getDate']);router[_0xee44('0x8')](_0xee44('0xc'),controller[_0xee44('0xd')]);router['get'](_0xee44('0xe'),controller[_0xee44('0xf')]);router[_0xee44('0x8')]('/:id/logo_login',controller[_0xee44('0x10')]);router[_0xee44('0x8')](_0xee44('0x11'),controller[_0xee44('0x12')]);router['get'](_0xee44('0x13'),controller['getPreferred']);router['get'](_0xee44('0x14'),controller[_0xee44('0x15')]);var upload=multer({'storage':multer[_0xee44('0x16')]({'destination':function(_0x592c44,_0x3a91e8,_0x1e2f47){_0x1e2f47(null,path['join'](config[_0xee44('0x17')],_0xee44('0x18')));},'filename':function(_0x34916a,_0x36f7f6,_0x5adb2c){_0x5adb2c(null,util[_0xee44('0x19')](_0xee44('0x1a'),_0xee44('0x1b'),path[_0xee44('0x1c')](_0x36f7f6['originalname'])));}})});router[_0xee44('0x1d')](_0xee44('0xe'),upload[_0xee44('0x1e')](_0xee44('0x1f')),controller[_0xee44('0x20')]);var upload=multer({'storage':multer[_0xee44('0x16')]({'destination':function(_0x3d9e18,_0x2921fb,_0x511ef4){_0x511ef4(null,path['join'](config[_0xee44('0x17')],'server/files/images/logos/'));},'filename':function(_0x53aa1d,_0x27e419,_0x7e2d36){_0x7e2d36(null,util[_0xee44('0x19')](_0xee44('0x1a'),_0xee44('0x21'),path['extname'](_0x27e419[_0xee44('0x22')])));}})});router['post'](_0xee44('0x23'),upload[_0xee44('0x1e')](_0xee44('0x1f')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xee44('0x16')]({'destination':function(_0x341cec,_0x508b1e,_0x3933a7){_0x3933a7(null,path[_0xee44('0x24')](config[_0xee44('0x17')],_0xee44('0x18')));},'filename':function(_0x3eb909,_0x66db75,_0x1bab1d){_0x1bab1d(null,util[_0xee44('0x19')](_0xee44('0x1a'),_0xee44('0x25'),path[_0xee44('0x1c')](_0x66db75[_0xee44('0x22')])));}})});router[_0xee44('0x1d')](_0xee44('0x13'),upload['single']('file'),controller[_0xee44('0x26')]);var upload=multer({'storage':multer[_0xee44('0x16')]({'destination':function(_0x6578d0,_0x4cb098,_0x884884){_0x884884(null,path[_0xee44('0x24')](config['root'],_0xee44('0x18')));},'filename':function(_0x527ed3,_0x522fe6,_0x24dfdf){_0x24dfdf(null,util[_0xee44('0x19')](_0xee44('0x1a'),_0xee44('0x27'),path[_0xee44('0x1c')](_0x522fe6[_0xee44('0x22')])));}})});router['post']('/:id/favicon',upload[_0xee44('0x1e')](_0xee44('0x1f')),controller[_0xee44('0x28')]);router[_0xee44('0x29')](_0xee44('0xc'),auth[_0xee44('0x9')](),controller[_0xee44('0x2a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 1a61738..c501099 100644 --- a/server/api/setting/setting.attributes.js +++ b/server/api/setting/setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x4d5cfd,_0x5b5c6c){var _0x442f17=function(_0x32a375){while(--_0x32a375){_0x4d5cfd['push'](_0x4d5cfd['shift']());}};_0x442f17(++_0x5b5c6c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x5b3f61,_0x5bdade){var _0x246e19=function(_0x44b484){while(--_0x44b484){_0x5b3f61['push'](_0x5b3f61['shift']());}};_0x246e19(++_0x5bdade);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 2c637af..1df2901 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 _0x75fb=['util','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','Setting,\x20%s,\x20%s','message','result','catch','end','json','offset','limit','count','status','set','Content-Range','reject','destroy','then','stack','name','send','index','map','Setting','fieldName','key','keys','filters','intersection','model','query','attributes','fields','length','nolimit','order','sort','where','pick','type','VIRTUAL','includeAll','include','findAll','show','params','merge','find','update','body','file','filename','loginLogo','getLogo','server/files/images/logos','logo','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','join','root','toLower','default_logo.svg','custom','Sequelize','ValidationError','upperFirst','\x20not\x20found','download','getLogoLogin','getLicense','preferred','favicon','defaultFavicon','default_loginLogo.svg','gdpr','securePassword','getPreferred','default_preferred.png','default','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x477575,_0xf4784b){var _0x3b3751=function(_0x7074d6){while(--_0x7074d6){_0x477575['push'](_0x477575['shift']());}};_0x3b3751(++_0xf4784b);}(_0x75fb,0x162));var _0xb75f=function(_0x19bc21,_0x268495){_0x19bc21=_0x19bc21-0x0;var _0x5a8e77=_0x75fb[_0x19bc21];return _0x5a8e77;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb75f('0x0'));var zipdir=require(_0xb75f('0x1'));var jsonpatch=require(_0xb75f('0x2'));var rp=require(_0xb75f('0x3'));var moment=require('moment');var BPromise=require(_0xb75f('0x4'));var Mustache=require(_0xb75f('0x5'));var util=require(_0xb75f('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xb75f('0x7'));var ejs=require(_0xb75f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb75f('0x9'));var squel=require(_0xb75f('0xa'));var crypto=require(_0xb75f('0xb'));var jsforce=require(_0xb75f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb75f('0x7'));var querystring=require(_0xb75f('0xd'));var Papa=require(_0xb75f('0xe'));var Redis=require(_0xb75f('0xf'));var authService=require(_0xb75f('0x10'));var qs=require(_0xb75f('0x11'));var as=require(_0xb75f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb75f('0x13'))(_0xb75f('0x14'));var utils=require(_0xb75f('0x15'));var config=require(_0xb75f('0x16'));var licenseUtil=require(_0xb75f('0x17'));var db=require(_0xb75f('0x18'))['db'];var jayson=require(_0xb75f('0x19'));var client=jayson[_0xb75f('0x1a')][_0xb75f('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x52d827,_0x166121,_0x1b3d1e,_0x3827fb){return new BPromise(function(_0x404eac,_0x1e0ea1){var _0x267f93=_0x3827fb||client;return _0x267f93[_0xb75f('0x1c')](_0x52d827,_0x1b3d1e)['then'](function(_0x2e951c){logger[_0xb75f('0x1d')]('Setting,\x20%s,\x20%s',_0x166121,_0xb75f('0x1e'));logger[_0xb75f('0x1f')](_0xb75f('0x20'),_0x166121,_0xb75f('0x1e'),JSON[_0xb75f('0x21')](_0x2e951c));if(_0x2e951c[_0xb75f('0x22')]){if(_0x2e951c['error']['code']===0x1f4){logger[_0xb75f('0x22')](_0xb75f('0x23'),_0x166121,_0x2e951c[_0xb75f('0x22')][_0xb75f('0x24')]);return _0x1e0ea1(_0x2e951c['error']['message']);}logger[_0xb75f('0x22')](_0xb75f('0x23'),_0x166121,_0x2e951c['error'][_0xb75f('0x24')]);return _0x404eac(_0x2e951c[_0xb75f('0x22')][_0xb75f('0x24')]);}else{logger['info'](_0xb75f('0x23'),_0x166121,_0xb75f('0x1e'));_0x404eac(_0x2e951c[_0xb75f('0x25')][_0xb75f('0x24')]);}})[_0xb75f('0x26')](function(_0x20ce2f){logger['error']('Setting,\x20%s,\x20%s',_0x166121,_0x20ce2f);_0x1e0ea1(_0x20ce2f);});});}function respondWithStatusCode(_0x5a718e,_0x99fa11){_0x99fa11=_0x99fa11||0xcc;return function(_0x241880){if(_0x241880){return _0x5a718e['sendStatus'](_0x99fa11);}return _0x5a718e['status'](_0x99fa11)[_0xb75f('0x27')]();};}function respondWithResult(_0x249d73,_0x405fa1){_0x405fa1=_0x405fa1||0xc8;return function(_0x25adea){if(_0x25adea){return _0x249d73['status'](_0x405fa1)[_0xb75f('0x28')](_0x25adea);}};}function respondWithFilteredResult(_0x38bf45,_0x1ac4fb){return function(_0xb630fb){if(_0xb630fb){var _0x4fd6ce=typeof _0x1ac4fb[_0xb75f('0x29')]==='undefined'&&typeof _0x1ac4fb[_0xb75f('0x2a')]==='undefined';var _0x2c94d6=_0xb630fb[_0xb75f('0x2b')];var _0x31e19b=_0x4fd6ce?0x0:_0x1ac4fb[_0xb75f('0x29')];var _0xa03b0e=_0x4fd6ce?_0xb630fb[_0xb75f('0x2b')]:_0x1ac4fb[_0xb75f('0x29')]+_0x1ac4fb[_0xb75f('0x2a')];var _0xa0b536;if(_0xa03b0e>=_0x2c94d6){_0xa03b0e=_0x2c94d6;_0xa0b536=0xc8;}else{_0xa0b536=0xce;}_0x38bf45[_0xb75f('0x2c')](_0xa0b536);return _0x38bf45[_0xb75f('0x2d')](_0xb75f('0x2e'),_0x31e19b+'-'+_0xa03b0e+'/'+_0x2c94d6)[_0xb75f('0x28')](_0xb630fb);}return null;};}function patchUpdates(_0x2565f8){return function(_0x5171cd){try{jsonpatch['apply'](_0x5171cd,_0x2565f8,!![]);}catch(_0x48ba68){return BPromise[_0xb75f('0x2f')](_0x48ba68);}return _0x5171cd['save']();};}function saveUpdates(_0x149ac4,_0x47af09){return function(_0x4bdbc6){if(_0x4bdbc6){return _0x4bdbc6['update'](_0x149ac4)['then'](function(_0x10a174){return _0x10a174;});}return null;};}function removeEntity(_0xa087c8,_0x5ed9b6){return function(_0x433b66){if(_0x433b66){return _0x433b66[_0xb75f('0x30')]()[_0xb75f('0x31')](function(){_0xa087c8[_0xb75f('0x2c')](0xcc)[_0xb75f('0x27')]();});}};}function handleEntityNotFound(_0x35f837,_0x19e848){return function(_0x266b3d){if(!_0x266b3d){_0x35f837['sendStatus'](0x194);}return _0x266b3d;};}function handleError(_0x1a0df0,_0x2b2885){_0x2b2885=_0x2b2885||0x1f4;return function(_0x3cf289){logger[_0xb75f('0x22')](_0x3cf289[_0xb75f('0x32')]);if(_0x3cf289['name']){delete _0x3cf289[_0xb75f('0x33')];}_0x1a0df0[_0xb75f('0x2c')](_0x2b2885)[_0xb75f('0x34')](_0x3cf289);};}exports[_0xb75f('0x35')]=function(_0x31e9be,_0x5bdb58){var _0x65fa6f={},_0x5c75e9={},_0x405902={'count':0x0,'rows':[]};var _0x4b575b=_[_0xb75f('0x36')](db[_0xb75f('0x37')]['rawAttributes'],function(_0x1e1eed){return{'name':_0x1e1eed[_0xb75f('0x38')],'type':_0x1e1eed['type'][_0xb75f('0x39')]};});_0x5c75e9['model']=_[_0xb75f('0x36')](_0x4b575b,_0xb75f('0x33'));_0x5c75e9['query']=_[_0xb75f('0x3a')](_0x31e9be['query']);_0x5c75e9[_0xb75f('0x3b')]=_[_0xb75f('0x3c')](_0x5c75e9[_0xb75f('0x3d')],_0x5c75e9[_0xb75f('0x3e')]);_0x65fa6f[_0xb75f('0x3f')]=_[_0xb75f('0x3c')](_0x5c75e9['model'],qs[_0xb75f('0x40')](_0x31e9be[_0xb75f('0x3e')]['fields']));_0x65fa6f[_0xb75f('0x3f')]=_0x65fa6f[_0xb75f('0x3f')][_0xb75f('0x41')]?_0x65fa6f[_0xb75f('0x3f')]:_0x5c75e9[_0xb75f('0x3d')];if(!_0x31e9be['query']['hasOwnProperty'](_0xb75f('0x42'))){_0x65fa6f[_0xb75f('0x2a')]=qs['limit'](_0x31e9be[_0xb75f('0x3e')]['limit']);_0x65fa6f[_0xb75f('0x29')]=qs[_0xb75f('0x29')](_0x31e9be[_0xb75f('0x3e')][_0xb75f('0x29')]);}_0x65fa6f[_0xb75f('0x43')]=qs[_0xb75f('0x44')](_0x31e9be[_0xb75f('0x3e')][_0xb75f('0x44')]);_0x65fa6f[_0xb75f('0x45')]=qs[_0xb75f('0x3b')](_[_0xb75f('0x46')](_0x31e9be[_0xb75f('0x3e')],_0x5c75e9[_0xb75f('0x3b')]),_0x4b575b);if(_0x31e9be[_0xb75f('0x3e')]['filter']){_0x65fa6f[_0xb75f('0x45')]=_['merge'](_0x65fa6f[_0xb75f('0x45')],{'$or':_[_0xb75f('0x36')](_0x4b575b,function(_0x44e0c0){if(_0x44e0c0[_0xb75f('0x47')]!==_0xb75f('0x48')){var _0x31fb5b={};_0x31fb5b[_0x44e0c0[_0xb75f('0x33')]]={'$like':'%'+_0x31e9be['query']['filter']+'%'};return _0x31fb5b;}})});}_0x65fa6f=_['merge']({},_0x65fa6f,_0x31e9be['options']);var _0x881ff={'where':_0x65fa6f[_0xb75f('0x45')]};return db['Setting'][_0xb75f('0x2b')](_0x881ff)[_0xb75f('0x31')](function(_0x1d7df6){_0x405902[_0xb75f('0x2b')]=_0x1d7df6;if(_0x31e9be[_0xb75f('0x3e')][_0xb75f('0x49')]){_0x65fa6f[_0xb75f('0x4a')]=[{'all':!![]}];}return db[_0xb75f('0x37')][_0xb75f('0x4b')](_0x65fa6f);})[_0xb75f('0x31')](function(_0x12a8fb){_0x405902['rows']=_0x12a8fb;return _0x405902;})[_0xb75f('0x31')](respondWithFilteredResult(_0x5bdb58,_0x65fa6f))[_0xb75f('0x26')](handleError(_0x5bdb58,null));};exports[_0xb75f('0x4c')]=function(_0x3db1a1,_0x540be3){var _0x188e0d={'raw':![],'where':{'id':_0x3db1a1[_0xb75f('0x4d')]['id']}},_0x5d28fd={};_0x5d28fd[_0xb75f('0x3d')]=_[_0xb75f('0x3a')](db['Setting']['rawAttributes']);_0x5d28fd[_0xb75f('0x3e')]=_[_0xb75f('0x3a')](_0x3db1a1[_0xb75f('0x3e')]);_0x5d28fd[_0xb75f('0x3b')]=_[_0xb75f('0x3c')](_0x5d28fd['model'],_0x5d28fd['query']);_0x188e0d[_0xb75f('0x3f')]=_[_0xb75f('0x3c')](_0x5d28fd[_0xb75f('0x3d')],qs['fields'](_0x3db1a1[_0xb75f('0x3e')]['fields']));_0x188e0d[_0xb75f('0x3f')]=_0x188e0d[_0xb75f('0x3f')][_0xb75f('0x41')]?_0x188e0d[_0xb75f('0x3f')]:_0x5d28fd[_0xb75f('0x3d')];if(_0x3db1a1[_0xb75f('0x3e')][_0xb75f('0x49')]){_0x188e0d[_0xb75f('0x4a')]=[{'all':!![]}];}_0x188e0d=_[_0xb75f('0x4e')]({},_0x188e0d,_0x3db1a1['options']);return db[_0xb75f('0x37')][_0xb75f('0x4f')](_0x188e0d)[_0xb75f('0x31')](handleEntityNotFound(_0x540be3,null))[_0xb75f('0x31')](respondWithResult(_0x540be3,null))[_0xb75f('0x26')](handleError(_0x540be3,null));};exports[_0xb75f('0x50')]=function(_0x1fbb3c,_0x2ce823){if(_0x1fbb3c[_0xb75f('0x51')]['id']){delete _0x1fbb3c['body']['id'];}return db[_0xb75f('0x37')][_0xb75f('0x4f')]({'where':{'id':_0x1fbb3c[_0xb75f('0x4d')]['id']}})[_0xb75f('0x31')](handleEntityNotFound(_0x2ce823,null))[_0xb75f('0x31')](saveUpdates(_0x1fbb3c[_0xb75f('0x51')],null))['then'](respondWithResult(_0x2ce823,null))[_0xb75f('0x26')](handleError(_0x2ce823,null));};exports['addLogo']=function(_0x31c07f,_0x39bdc1,_0x44d59e){if(_0x31c07f[_0xb75f('0x52')]&&_0x31c07f[_0xb75f('0x52')]['filename']){_0x31c07f[_0xb75f('0x51')]['logo']=_0x31c07f['file'][_0xb75f('0x53')];}return db[_0xb75f('0x37')][_0xb75f('0x4f')]({'where':{'id':_0x31c07f['params']['id']}})[_0xb75f('0x31')](handleEntityNotFound(_0x39bdc1,null))[_0xb75f('0x31')](saveUpdates(_0x31c07f['body'],null))[_0xb75f('0x31')](respondWithResult(_0x39bdc1,null))['catch'](handleError(_0x39bdc1,null));};exports['addLogoLogin']=function(_0x2330b4,_0x1ea06c,_0x38ef02){if(_0x2330b4[_0xb75f('0x52')]&&_0x2330b4[_0xb75f('0x52')][_0xb75f('0x53')]){_0x2330b4[_0xb75f('0x51')][_0xb75f('0x54')]=_0x2330b4[_0xb75f('0x52')]['filename'];}return db[_0xb75f('0x37')][_0xb75f('0x4f')]({'where':{'id':_0x2330b4[_0xb75f('0x4d')]['id']}})[_0xb75f('0x31')](handleEntityNotFound(_0x1ea06c,null))[_0xb75f('0x31')](saveUpdates(_0x2330b4[_0xb75f('0x51')],null))[_0xb75f('0x31')](respondWithResult(_0x1ea06c,null))[_0xb75f('0x26')](handleError(_0x1ea06c,null));};var utilLicense=require(_0xb75f('0x17'));exports[_0xb75f('0x55')]=function(_0x4bd015,_0x561ddb,_0x1bbf52){var _0x5044c2=_0xb75f('0x56');var _0x2e2e49={'custom':![]};return utilLicense['getLicense']()[_0xb75f('0x31')](function(_0x22ce90){if(_0x22ce90){_0x2e2e49=_0x22ce90;}return db[_0xb75f('0x37')][_0xb75f('0x4f')]({'where':{'id':_0x4bd015[_0xb75f('0x4d')]['id']},'attributes':[_0xb75f('0x57'),_0xb75f('0x54'),'preferred','favicon',_0xb75f('0x58'),_0xb75f('0x59'),_0xb75f('0x5a'),'defaultFavicon'],'raw':!![]});})[_0xb75f('0x31')](handleEntityNotFound(_0x561ddb,null))[_0xb75f('0x31')](function(_0x234fdc){if(_0x234fdc){var _0x422365=_0x234fdc[_0xb75f('0x57')]&&fs[_0xb75f('0x5b')](path[_0xb75f('0x5c')](config[_0xb75f('0x5d')],_0x5044c2,_['toLower'](_0x234fdc['logo'])))?path[_0xb75f('0x5c')](config[_0xb75f('0x5d')],_0x5044c2,_[_0xb75f('0x5e')](_0x234fdc[_0xb75f('0x57')])):path[_0xb75f('0x5c')](config['root'],_0x5044c2,_[_0xb75f('0x5e')](_0xb75f('0x5f')));var _0x51974d='default'+_['upperFirst'](_0xb75f('0x57'));if(_0x234fdc[_0x51974d]||!_0x2e2e49[_0xb75f('0x60')]){_0x422365=path[_0xb75f('0x5c')](config['root'],_0x5044c2,_[_0xb75f('0x5e')](_0xb75f('0x5f')));}if(!fs[_0xb75f('0x5b')](_0x422365)){throw new db[(_0xb75f('0x61'))][(_0xb75f('0x62'))](_[_0xb75f('0x63')](_0xb75f('0x57'))+_0xb75f('0x64'));}return _0x561ddb[_0xb75f('0x65')](_0x422365);}})[_0xb75f('0x26')](handleError(_0x561ddb,null));};var utilLicense=require(_0xb75f('0x17'));exports[_0xb75f('0x66')]=function(_0x2fd996,_0x23256f,_0x2734e9){var _0x437b63=_0xb75f('0x56');var _0xef327b={'custom':![]};return utilLicense[_0xb75f('0x67')]()['then'](function(_0xee5e0d){if(_0xee5e0d){_0xef327b=_0xee5e0d;}return db[_0xb75f('0x37')]['find']({'where':{'id':_0x2fd996[_0xb75f('0x4d')]['id']},'attributes':['logo','loginLogo',_0xb75f('0x68'),_0xb75f('0x69'),_0xb75f('0x58'),_0xb75f('0x59'),_0xb75f('0x5a'),_0xb75f('0x6a')],'raw':!![]});})['then'](handleEntityNotFound(_0x23256f,null))[_0xb75f('0x31')](function(_0x315ddf){if(_0x315ddf){var _0x322535=_0x315ddf[_0xb75f('0x54')]&&fs['existsSync'](path[_0xb75f('0x5c')](config[_0xb75f('0x5d')],_0x437b63,_[_0xb75f('0x5e')](_0x315ddf[_0xb75f('0x54')])))?path[_0xb75f('0x5c')](config[_0xb75f('0x5d')],_0x437b63,_[_0xb75f('0x5e')](_0x315ddf[_0xb75f('0x54')])):path['join'](config[_0xb75f('0x5d')],_0x437b63,_[_0xb75f('0x5e')](_0xb75f('0x6b')));var _0x4ad62e='default'+_[_0xb75f('0x63')](_0xb75f('0x54'));if(_0x315ddf[_0x4ad62e]||!_0xef327b[_0xb75f('0x60')]){_0x322535=path[_0xb75f('0x5c')](config[_0xb75f('0x5d')],_0x437b63,_['toLower'](_0xb75f('0x6b')));}if(!fs['existsSync'](_0x322535)){throw new db[(_0xb75f('0x61'))]['ValidationError'](_['upperFirst']('loginLogo')+_0xb75f('0x64'));}return _0x23256f[_0xb75f('0x65')](_0x322535);}})['catch'](handleError(_0x23256f,null));};exports[_0xb75f('0x6c')]=function(_0x343509,_0x4a2010){return db[_0xb75f('0x37')][_0xb75f('0x4f')]({'where':{'id':_0x343509[_0xb75f('0x4d')]['id']},'attributes':[_0xb75f('0x6d')]})[_0xb75f('0x31')](respondWithResult(_0x4a2010,null))['catch'](handleError(_0x4a2010,null));};exports['addPreferred']=function(_0x22779c,_0x2da5e5,_0x54104a){if(_0x22779c[_0xb75f('0x52')]&&_0x22779c[_0xb75f('0x52')][_0xb75f('0x53')]){_0x22779c[_0xb75f('0x51')][_0xb75f('0x68')]=_0x22779c[_0xb75f('0x52')][_0xb75f('0x53')];}return db['Setting'][_0xb75f('0x4f')]({'where':{'id':_0x22779c[_0xb75f('0x4d')]['id']}})[_0xb75f('0x31')](handleEntityNotFound(_0x2da5e5,null))[_0xb75f('0x31')](saveUpdates(_0x22779c[_0xb75f('0x51')],null))[_0xb75f('0x31')](respondWithResult(_0x2da5e5,null))[_0xb75f('0x26')](handleError(_0x2da5e5,null));};var utilLicense=require('../../config/license/util');exports[_0xb75f('0x6e')]=function(_0x5d80a8,_0x83eabd,_0x36447d){var _0x564f46=_0xb75f('0x56');var _0xe96df9={'custom':![]};return utilLicense['getLicense']()[_0xb75f('0x31')](function(_0x4978c1){if(_0x4978c1){_0xe96df9=_0x4978c1;}return db[_0xb75f('0x37')]['find']({'where':{'id':_0x5d80a8['params']['id']},'attributes':[_0xb75f('0x57'),_0xb75f('0x54'),'preferred','favicon',_0xb75f('0x58'),_0xb75f('0x59'),_0xb75f('0x5a'),_0xb75f('0x6a')],'raw':!![]});})['then'](handleEntityNotFound(_0x83eabd,null))[_0xb75f('0x31')](function(_0x214d86){if(_0x214d86){var _0x3c1f6c=_0x214d86[_0xb75f('0x68')]&&fs[_0xb75f('0x5b')](path[_0xb75f('0x5c')](config[_0xb75f('0x5d')],_0x564f46,_[_0xb75f('0x5e')](_0x214d86[_0xb75f('0x68')])))?path[_0xb75f('0x5c')](config[_0xb75f('0x5d')],_0x564f46,_[_0xb75f('0x5e')](_0x214d86['preferred'])):path[_0xb75f('0x5c')](config[_0xb75f('0x5d')],_0x564f46,_['toLower'](_0xb75f('0x6f')));var _0x4a1d88=_0xb75f('0x70')+_[_0xb75f('0x63')]('preferred');if(_0x214d86[_0x4a1d88]||!_0xe96df9[_0xb75f('0x60')]||!_0xe96df9[_0xb75f('0x68')]){_0x3c1f6c=path[_0xb75f('0x5c')](config[_0xb75f('0x5d')],_0x564f46,_[_0xb75f('0x5e')]('default_preferred.png'));}if(!fs[_0xb75f('0x5b')](_0x3c1f6c)){throw new db[(_0xb75f('0x61'))][(_0xb75f('0x62'))](_[_0xb75f('0x63')](_0xb75f('0x68'))+'\x20not\x20found');}return _0x83eabd[_0xb75f('0x65')](_0x3c1f6c);}})['catch'](handleError(_0x83eabd,null));};exports[_0xb75f('0x71')]=function(_0x4cf743,_0x52d21e,_0x20c579){if(_0x4cf743[_0xb75f('0x52')]&&_0x4cf743[_0xb75f('0x52')]['filename']){_0x4cf743[_0xb75f('0x51')]['favicon']=_0x4cf743[_0xb75f('0x52')][_0xb75f('0x53')];}return db[_0xb75f('0x37')]['find']({'where':{'id':_0x4cf743['params']['id']}})[_0xb75f('0x31')](handleEntityNotFound(_0x52d21e,null))[_0xb75f('0x31')](saveUpdates(_0x4cf743['body'],null))[_0xb75f('0x31')](respondWithResult(_0x52d21e,null))[_0xb75f('0x26')](handleError(_0x52d21e,null));};var utilLicense=require(_0xb75f('0x17'));exports[_0xb75f('0x72')]=function(_0x5a62e9,_0x5199cd,_0x2b7558){var _0x423072=_0xb75f('0x56');var _0x1e7a03={'custom':![]};return utilLicense[_0xb75f('0x67')]()[_0xb75f('0x31')](function(_0x5c5d8f){if(_0x5c5d8f){_0x1e7a03=_0x5c5d8f;}return db[_0xb75f('0x37')]['find']({'where':{'id':_0x5a62e9[_0xb75f('0x4d')]['id']},'attributes':[_0xb75f('0x57'),_0xb75f('0x54'),_0xb75f('0x68'),_0xb75f('0x69'),_0xb75f('0x58'),_0xb75f('0x59'),_0xb75f('0x5a'),_0xb75f('0x6a')],'raw':!![]});})[_0xb75f('0x31')](handleEntityNotFound(_0x5199cd,null))[_0xb75f('0x31')](function(_0x1f44f1){if(_0x1f44f1){var _0xca6176=_0x1f44f1[_0xb75f('0x69')]&&fs['existsSync'](path[_0xb75f('0x5c')](config['root'],_0x423072,_[_0xb75f('0x5e')](_0x1f44f1[_0xb75f('0x69')])))?path[_0xb75f('0x5c')](config['root'],_0x423072,_['toLower'](_0x1f44f1['favicon'])):path[_0xb75f('0x5c')](config['root'],_0x423072,_[_0xb75f('0x5e')](_0xb75f('0x73')));var _0x3983e6=_0xb75f('0x70')+_[_0xb75f('0x63')]('favicon');if(_0x1f44f1[_0x3983e6]||!_0x1e7a03[_0xb75f('0x60')]){_0xca6176=path[_0xb75f('0x5c')](config[_0xb75f('0x5d')],_0x423072,_[_0xb75f('0x5e')]('default_favicon.ico'));}if(!fs[_0xb75f('0x5b')](_0xca6176)){throw new db[(_0xb75f('0x61'))][(_0xb75f('0x62'))](_[_0xb75f('0x63')](_0xb75f('0x69'))+_0xb75f('0x64'));}return _0x5199cd[_0xb75f('0x65')](_0xca6176);}})[_0xb75f('0x26')](handleError(_0x5199cd,null));};exports[_0xb75f('0x74')]=function(_0x683d8b,_0x59f87f){var _0x38efa8={'offset':moment()[_0xb75f('0x75')]()};_0x38efa8[_0xb75f('0x76')]=moment()[_0xb75f('0x75')](_0x38efa8[_0xb75f('0x29')])['format'](_0xb75f('0x77'));return _0x59f87f[_0xb75f('0x2c')](0xc8)['send'](_0x38efa8);}; \ No newline at end of file +var _0xee1f=['include','findAll','rows','show','rawAttributes','find','body','params','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','favicon','defaultLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default','custom','Sequelize','ValidationError','upperFirst','\x20not\x20found','download','getLogoLogin','preferred','defaultLoginLogo','default_loginLogo.svg','gdpr','getPreferred','default_preferred.png','addFavicon','default_favicon.ico','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','destroy','end','name','index','map','Setting','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xee1f,0x198));var _0xfee1=function(_0x14261a,_0x55b5cc){_0x14261a=_0x14261a-0x0;var _0x3f3154=_0xee1f[_0x14261a];return _0x3f3154;};'use strict';var emlformat=require(_0xfee1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfee1('0x1'));var rp=require(_0xfee1('0x2'));var moment=require(_0xfee1('0x3'));var BPromise=require(_0xfee1('0x4'));var Mustache=require(_0xfee1('0x5'));var util=require('util');var path=require(_0xfee1('0x6'));var sox=require(_0xfee1('0x7'));var csv=require(_0xfee1('0x8'));var ejs=require(_0xfee1('0x9'));var fs=require('fs');var fs_extra=require(_0xfee1('0xa'));var _=require(_0xfee1('0xb'));var squel=require(_0xfee1('0xc'));var crypto=require(_0xfee1('0xd'));var jsforce=require(_0xfee1('0xe'));var deskjs=require(_0xfee1('0xf'));var toCsv=require(_0xfee1('0x8'));var querystring=require('querystring');var Papa=require(_0xfee1('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfee1('0x11'));var as=require(_0xfee1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfee1('0x13'))(_0xfee1('0x14'));var utils=require(_0xfee1('0x15'));var config=require(_0xfee1('0x16'));var licenseUtil=require(_0xfee1('0x17'));var db=require(_0xfee1('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xfee1('0x19')][_0xfee1('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x3cf188,_0x36db20,_0x4c5663,_0x56b11c){return new BPromise(function(_0x152b8f,_0x557288){var _0x4fb6e3=_0x56b11c||client;return _0x4fb6e3[_0xfee1('0x1b')](_0x3cf188,_0x4c5663)[_0xfee1('0x1c')](function(_0x1efb98){logger[_0xfee1('0x1d')](_0xfee1('0x1e'),_0x36db20,'request\x20sent');logger[_0xfee1('0x1f')](_0xfee1('0x20'),_0x36db20,_0xfee1('0x21'),JSON['stringify'](_0x1efb98));if(_0x1efb98[_0xfee1('0x22')]){if(_0x1efb98[_0xfee1('0x22')][_0xfee1('0x23')]===0x1f4){logger[_0xfee1('0x22')](_0xfee1('0x1e'),_0x36db20,_0x1efb98[_0xfee1('0x22')][_0xfee1('0x24')]);return _0x557288(_0x1efb98['error'][_0xfee1('0x24')]);}logger['error'](_0xfee1('0x1e'),_0x36db20,_0x1efb98[_0xfee1('0x22')][_0xfee1('0x24')]);return _0x152b8f(_0x1efb98['error']['message']);}else{logger[_0xfee1('0x1d')]('Setting,\x20%s,\x20%s',_0x36db20,_0xfee1('0x21'));_0x152b8f(_0x1efb98[_0xfee1('0x25')][_0xfee1('0x24')]);}})[_0xfee1('0x26')](function(_0x33b587){logger[_0xfee1('0x22')]('Setting,\x20%s,\x20%s',_0x36db20,_0x33b587);_0x557288(_0x33b587);});});}function respondWithStatusCode(_0x8f35c6,_0x2108c7){_0x2108c7=_0x2108c7||0xcc;return function(_0x24d5af){if(_0x24d5af){return _0x8f35c6[_0xfee1('0x27')](_0x2108c7);}return _0x8f35c6[_0xfee1('0x28')](_0x2108c7)['end']();};}function respondWithResult(_0x696115,_0xae95e1){_0xae95e1=_0xae95e1||0xc8;return function(_0x4fd4fb){if(_0x4fd4fb){return _0x696115[_0xfee1('0x28')](_0xae95e1)[_0xfee1('0x29')](_0x4fd4fb);}};}function respondWithFilteredResult(_0x493388,_0x13e23d){return function(_0x4fb12f){if(_0x4fb12f){var _0xdfe5c5=typeof _0x13e23d[_0xfee1('0x2a')]===_0xfee1('0x2b')&&typeof _0x13e23d[_0xfee1('0x2c')]===_0xfee1('0x2b');var _0x29012e=_0x4fb12f[_0xfee1('0x2d')];var _0xd0fc84=_0xdfe5c5?0x0:_0x13e23d[_0xfee1('0x2a')];var _0x186391=_0xdfe5c5?_0x4fb12f[_0xfee1('0x2d')]:_0x13e23d[_0xfee1('0x2a')]+_0x13e23d[_0xfee1('0x2c')];var _0x567825;if(_0x186391>=_0x29012e){_0x186391=_0x29012e;_0x567825=0xc8;}else{_0x567825=0xce;}_0x493388[_0xfee1('0x28')](_0x567825);return _0x493388[_0xfee1('0x2e')]('Content-Range',_0xd0fc84+'-'+_0x186391+'/'+_0x29012e)[_0xfee1('0x29')](_0x4fb12f);}return null;};}function patchUpdates(_0xa4a3ce){return function(_0x445e6c){try{jsonpatch['apply'](_0x445e6c,_0xa4a3ce,!![]);}catch(_0x227092){return BPromise[_0xfee1('0x2f')](_0x227092);}return _0x445e6c[_0xfee1('0x30')]();};}function saveUpdates(_0x2c4ef8,_0x7ea9db){return function(_0x73ecc2){if(_0x73ecc2){return _0x73ecc2['update'](_0x2c4ef8)[_0xfee1('0x1c')](function(_0x2f8210){return _0x2f8210;});}return null;};}function removeEntity(_0x50cdba,_0x20dd18){return function(_0x5e94f2){if(_0x5e94f2){return _0x5e94f2[_0xfee1('0x31')]()['then'](function(){_0x50cdba[_0xfee1('0x28')](0xcc)[_0xfee1('0x32')]();});}};}function handleEntityNotFound(_0x3b7225,_0x11d57c){return function(_0x2cc5bb){if(!_0x2cc5bb){_0x3b7225[_0xfee1('0x27')](0x194);}return _0x2cc5bb;};}function handleError(_0x2558aa,_0x4b28f6){_0x4b28f6=_0x4b28f6||0x1f4;return function(_0x19e02a){logger[_0xfee1('0x22')](_0x19e02a['stack']);if(_0x19e02a[_0xfee1('0x33')]){delete _0x19e02a[_0xfee1('0x33')];}_0x2558aa[_0xfee1('0x28')](_0x4b28f6)['send'](_0x19e02a);};}exports[_0xfee1('0x34')]=function(_0x2a1297,_0x620518){var _0x163ee5={},_0x587a61={},_0x4ca5ef={'count':0x0,'rows':[]};var _0x263c40=_[_0xfee1('0x35')](db[_0xfee1('0x36')]['rawAttributes'],function(_0x2fef48){return{'name':_0x2fef48[_0xfee1('0x37')],'type':_0x2fef48['type'][_0xfee1('0x38')]};});_0x587a61[_0xfee1('0x39')]=_[_0xfee1('0x35')](_0x263c40,_0xfee1('0x33'));_0x587a61[_0xfee1('0x3a')]=_[_0xfee1('0x3b')](_0x2a1297['query']);_0x587a61[_0xfee1('0x3c')]=_[_0xfee1('0x3d')](_0x587a61['model'],_0x587a61[_0xfee1('0x3a')]);_0x163ee5[_0xfee1('0x3e')]=_['intersection'](_0x587a61[_0xfee1('0x39')],qs['fields'](_0x2a1297[_0xfee1('0x3a')][_0xfee1('0x3f')]));_0x163ee5[_0xfee1('0x3e')]=_0x163ee5[_0xfee1('0x3e')][_0xfee1('0x40')]?_0x163ee5[_0xfee1('0x3e')]:_0x587a61[_0xfee1('0x39')];if(!_0x2a1297['query'][_0xfee1('0x41')](_0xfee1('0x42'))){_0x163ee5[_0xfee1('0x2c')]=qs[_0xfee1('0x2c')](_0x2a1297[_0xfee1('0x3a')][_0xfee1('0x2c')]);_0x163ee5['offset']=qs[_0xfee1('0x2a')](_0x2a1297['query'][_0xfee1('0x2a')]);}_0x163ee5[_0xfee1('0x43')]=qs[_0xfee1('0x44')](_0x2a1297[_0xfee1('0x3a')][_0xfee1('0x44')]);_0x163ee5[_0xfee1('0x45')]=qs[_0xfee1('0x3c')](_['pick'](_0x2a1297[_0xfee1('0x3a')],_0x587a61[_0xfee1('0x3c')]),_0x263c40);if(_0x2a1297[_0xfee1('0x3a')][_0xfee1('0x46')]){_0x163ee5[_0xfee1('0x45')]=_[_0xfee1('0x47')](_0x163ee5[_0xfee1('0x45')],{'$or':_[_0xfee1('0x35')](_0x263c40,function(_0x3e1d12){if(_0x3e1d12[_0xfee1('0x48')]!==_0xfee1('0x49')){var _0x391359={};_0x391359[_0x3e1d12[_0xfee1('0x33')]]={'$like':'%'+_0x2a1297['query'][_0xfee1('0x46')]+'%'};return _0x391359;}})});}_0x163ee5=_[_0xfee1('0x47')]({},_0x163ee5,_0x2a1297[_0xfee1('0x4a')]);var _0x26f4d4={'where':_0x163ee5[_0xfee1('0x45')]};return db[_0xfee1('0x36')][_0xfee1('0x2d')](_0x26f4d4)[_0xfee1('0x1c')](function(_0x3a0c8f){_0x4ca5ef[_0xfee1('0x2d')]=_0x3a0c8f;if(_0x2a1297[_0xfee1('0x3a')][_0xfee1('0x4b')]){_0x163ee5[_0xfee1('0x4c')]=[{'all':!![]}];}return db[_0xfee1('0x36')][_0xfee1('0x4d')](_0x163ee5);})[_0xfee1('0x1c')](function(_0x357fcc){_0x4ca5ef[_0xfee1('0x4e')]=_0x357fcc;return _0x4ca5ef;})[_0xfee1('0x1c')](respondWithFilteredResult(_0x620518,_0x163ee5))['catch'](handleError(_0x620518,null));};exports[_0xfee1('0x4f')]=function(_0x545e83,_0x3a522a){var _0x597779={'raw':![],'where':{'id':_0x545e83['params']['id']}},_0x552ae3={};_0x552ae3[_0xfee1('0x39')]=_['keys'](db[_0xfee1('0x36')][_0xfee1('0x50')]);_0x552ae3[_0xfee1('0x3a')]=_[_0xfee1('0x3b')](_0x545e83[_0xfee1('0x3a')]);_0x552ae3[_0xfee1('0x3c')]=_[_0xfee1('0x3d')](_0x552ae3[_0xfee1('0x39')],_0x552ae3[_0xfee1('0x3a')]);_0x597779[_0xfee1('0x3e')]=_[_0xfee1('0x3d')](_0x552ae3[_0xfee1('0x39')],qs[_0xfee1('0x3f')](_0x545e83[_0xfee1('0x3a')][_0xfee1('0x3f')]));_0x597779[_0xfee1('0x3e')]=_0x597779[_0xfee1('0x3e')][_0xfee1('0x40')]?_0x597779['attributes']:_0x552ae3[_0xfee1('0x39')];if(_0x545e83['query'][_0xfee1('0x4b')]){_0x597779[_0xfee1('0x4c')]=[{'all':!![]}];}_0x597779=_[_0xfee1('0x47')]({},_0x597779,_0x545e83[_0xfee1('0x4a')]);return db[_0xfee1('0x36')][_0xfee1('0x51')](_0x597779)[_0xfee1('0x1c')](handleEntityNotFound(_0x3a522a,null))[_0xfee1('0x1c')](respondWithResult(_0x3a522a,null))[_0xfee1('0x26')](handleError(_0x3a522a,null));};exports['update']=function(_0xa92bf2,_0x5ada6b){if(_0xa92bf2[_0xfee1('0x52')]['id']){delete _0xa92bf2[_0xfee1('0x52')]['id'];}return db[_0xfee1('0x36')][_0xfee1('0x51')]({'where':{'id':_0xa92bf2[_0xfee1('0x53')]['id']}})[_0xfee1('0x1c')](handleEntityNotFound(_0x5ada6b,null))['then'](saveUpdates(_0xa92bf2[_0xfee1('0x52')],null))[_0xfee1('0x1c')](respondWithResult(_0x5ada6b,null))[_0xfee1('0x26')](handleError(_0x5ada6b,null));};exports[_0xfee1('0x54')]=function(_0x1c1e5b,_0x25d1f3,_0x181d55){if(_0x1c1e5b[_0xfee1('0x55')]&&_0x1c1e5b[_0xfee1('0x55')][_0xfee1('0x56')]){_0x1c1e5b[_0xfee1('0x52')][_0xfee1('0x57')]=_0x1c1e5b[_0xfee1('0x55')][_0xfee1('0x56')];}return db[_0xfee1('0x36')][_0xfee1('0x51')]({'where':{'id':_0x1c1e5b[_0xfee1('0x53')]['id']}})[_0xfee1('0x1c')](handleEntityNotFound(_0x25d1f3,null))[_0xfee1('0x1c')](saveUpdates(_0x1c1e5b['body'],null))[_0xfee1('0x1c')](respondWithResult(_0x25d1f3,null))['catch'](handleError(_0x25d1f3,null));};exports[_0xfee1('0x58')]=function(_0x13f3d0,_0x147009,_0x80081a){if(_0x13f3d0[_0xfee1('0x55')]&&_0x13f3d0[_0xfee1('0x55')][_0xfee1('0x56')]){_0x13f3d0[_0xfee1('0x52')][_0xfee1('0x59')]=_0x13f3d0[_0xfee1('0x55')][_0xfee1('0x56')];}return db[_0xfee1('0x36')]['find']({'where':{'id':_0x13f3d0['params']['id']}})['then'](handleEntityNotFound(_0x147009,null))[_0xfee1('0x1c')](saveUpdates(_0x13f3d0['body'],null))[_0xfee1('0x1c')](respondWithResult(_0x147009,null))[_0xfee1('0x26')](handleError(_0x147009,null));};var utilLicense=require(_0xfee1('0x17'));exports[_0xfee1('0x5a')]=function(_0x59a83c,_0x116fdd,_0x254f39){var _0x147699=_0xfee1('0x5b');var _0x1f94b4={'custom':![]};return utilLicense[_0xfee1('0x5c')]()['then'](function(_0xf14316){if(_0xf14316){_0x1f94b4=_0xf14316;}return db[_0xfee1('0x36')][_0xfee1('0x51')]({'where':{'id':_0x59a83c[_0xfee1('0x53')]['id']},'attributes':[_0xfee1('0x57'),_0xfee1('0x59'),'preferred',_0xfee1('0x5d'),_0xfee1('0x5e'),'defaultLoginLogo',_0xfee1('0x5f'),_0xfee1('0x60')],'raw':!![]});})[_0xfee1('0x1c')](handleEntityNotFound(_0x116fdd,null))[_0xfee1('0x1c')](function(_0x42948a){if(_0x42948a){var _0x1fa2e6=_0x42948a[_0xfee1('0x57')]&&fs[_0xfee1('0x61')](path[_0xfee1('0x62')](config[_0xfee1('0x63')],_0x147699,_[_0xfee1('0x64')](_0x42948a[_0xfee1('0x57')])))?path[_0xfee1('0x62')](config['root'],_0x147699,_[_0xfee1('0x64')](_0x42948a[_0xfee1('0x57')])):path[_0xfee1('0x62')](config[_0xfee1('0x63')],_0x147699,_[_0xfee1('0x64')]('default_logo.svg'));var _0x33ae3c=_0xfee1('0x65')+_['upperFirst'](_0xfee1('0x57'));if(_0x42948a[_0x33ae3c]||!_0x1f94b4[_0xfee1('0x66')]){_0x1fa2e6=path[_0xfee1('0x62')](config[_0xfee1('0x63')],_0x147699,_[_0xfee1('0x64')]('default_logo.svg'));}if(!fs[_0xfee1('0x61')](_0x1fa2e6)){throw new db[(_0xfee1('0x67'))][(_0xfee1('0x68'))](_[_0xfee1('0x69')]('logo')+_0xfee1('0x6a'));}return _0x116fdd[_0xfee1('0x6b')](_0x1fa2e6);}})[_0xfee1('0x26')](handleError(_0x116fdd,null));};var utilLicense=require(_0xfee1('0x17'));exports[_0xfee1('0x6c')]=function(_0x16e46c,_0x51a471,_0x1b06d1){var _0x3ee3c2=_0xfee1('0x5b');var _0x5df9d8={'custom':![]};return utilLicense[_0xfee1('0x5c')]()[_0xfee1('0x1c')](function(_0x2d414e){if(_0x2d414e){_0x5df9d8=_0x2d414e;}return db[_0xfee1('0x36')][_0xfee1('0x51')]({'where':{'id':_0x16e46c[_0xfee1('0x53')]['id']},'attributes':[_0xfee1('0x57'),_0xfee1('0x59'),_0xfee1('0x6d'),'favicon',_0xfee1('0x5e'),_0xfee1('0x6e'),_0xfee1('0x5f'),_0xfee1('0x60')],'raw':!![]});})[_0xfee1('0x1c')](handleEntityNotFound(_0x51a471,null))[_0xfee1('0x1c')](function(_0x582de9){if(_0x582de9){var _0x43e742=_0x582de9['loginLogo']&&fs[_0xfee1('0x61')](path['join'](config['root'],_0x3ee3c2,_['toLower'](_0x582de9[_0xfee1('0x59')])))?path[_0xfee1('0x62')](config[_0xfee1('0x63')],_0x3ee3c2,_[_0xfee1('0x64')](_0x582de9[_0xfee1('0x59')])):path[_0xfee1('0x62')](config[_0xfee1('0x63')],_0x3ee3c2,_[_0xfee1('0x64')]('default_loginLogo.svg'));var _0x5255f0='default'+_[_0xfee1('0x69')](_0xfee1('0x59'));if(_0x582de9[_0x5255f0]||!_0x5df9d8['custom']){_0x43e742=path['join'](config[_0xfee1('0x63')],_0x3ee3c2,_[_0xfee1('0x64')](_0xfee1('0x6f')));}if(!fs[_0xfee1('0x61')](_0x43e742)){throw new db[(_0xfee1('0x67'))][(_0xfee1('0x68'))](_['upperFirst'](_0xfee1('0x59'))+_0xfee1('0x6a'));}return _0x51a471[_0xfee1('0x6b')](_0x43e742);}})[_0xfee1('0x26')](handleError(_0x51a471,null));};exports[_0xfee1('0x70')]=function(_0x428aa6,_0x2f645f){return db[_0xfee1('0x36')][_0xfee1('0x51')]({'where':{'id':_0x428aa6[_0xfee1('0x53')]['id']},'attributes':['securePassword']})[_0xfee1('0x1c')](respondWithResult(_0x2f645f,null))[_0xfee1('0x26')](handleError(_0x2f645f,null));};exports['addPreferred']=function(_0x1e1e64,_0x5d9633,_0x249379){if(_0x1e1e64[_0xfee1('0x55')]&&_0x1e1e64['file'][_0xfee1('0x56')]){_0x1e1e64[_0xfee1('0x52')][_0xfee1('0x6d')]=_0x1e1e64[_0xfee1('0x55')]['filename'];}return db[_0xfee1('0x36')]['find']({'where':{'id':_0x1e1e64[_0xfee1('0x53')]['id']}})[_0xfee1('0x1c')](handleEntityNotFound(_0x5d9633,null))['then'](saveUpdates(_0x1e1e64[_0xfee1('0x52')],null))[_0xfee1('0x1c')](respondWithResult(_0x5d9633,null))[_0xfee1('0x26')](handleError(_0x5d9633,null));};var utilLicense=require(_0xfee1('0x17'));exports[_0xfee1('0x71')]=function(_0xd7e678,_0x4817a8,_0xf32a1e){var _0x58fd04='server/files/images/logos';var _0x3cba35={'custom':![]};return utilLicense[_0xfee1('0x5c')]()['then'](function(_0x1a0002){if(_0x1a0002){_0x3cba35=_0x1a0002;}return db[_0xfee1('0x36')][_0xfee1('0x51')]({'where':{'id':_0xd7e678[_0xfee1('0x53')]['id']},'attributes':[_0xfee1('0x57'),_0xfee1('0x59'),_0xfee1('0x6d'),'favicon','defaultLogo',_0xfee1('0x6e'),'defaultPreferred',_0xfee1('0x60')],'raw':!![]});})[_0xfee1('0x1c')](handleEntityNotFound(_0x4817a8,null))['then'](function(_0x2bfd56){if(_0x2bfd56){var _0x20772d=_0x2bfd56[_0xfee1('0x6d')]&&fs[_0xfee1('0x61')](path[_0xfee1('0x62')](config[_0xfee1('0x63')],_0x58fd04,_[_0xfee1('0x64')](_0x2bfd56[_0xfee1('0x6d')])))?path[_0xfee1('0x62')](config[_0xfee1('0x63')],_0x58fd04,_['toLower'](_0x2bfd56['preferred'])):path[_0xfee1('0x62')](config[_0xfee1('0x63')],_0x58fd04,_[_0xfee1('0x64')](_0xfee1('0x72')));var _0x52f72a=_0xfee1('0x65')+_[_0xfee1('0x69')](_0xfee1('0x6d'));if(_0x2bfd56[_0x52f72a]||!_0x3cba35[_0xfee1('0x66')]||!_0x3cba35[_0xfee1('0x6d')]){_0x20772d=path[_0xfee1('0x62')](config[_0xfee1('0x63')],_0x58fd04,_[_0xfee1('0x64')](_0xfee1('0x72')));}if(!fs[_0xfee1('0x61')](_0x20772d)){throw new db[(_0xfee1('0x67'))][(_0xfee1('0x68'))](_[_0xfee1('0x69')]('preferred')+_0xfee1('0x6a'));}return _0x4817a8[_0xfee1('0x6b')](_0x20772d);}})[_0xfee1('0x26')](handleError(_0x4817a8,null));};exports[_0xfee1('0x73')]=function(_0x5d0f66,_0x1b3b51,_0x13e08f){if(_0x5d0f66[_0xfee1('0x55')]&&_0x5d0f66['file'][_0xfee1('0x56')]){_0x5d0f66[_0xfee1('0x52')]['favicon']=_0x5d0f66['file']['filename'];}return db[_0xfee1('0x36')]['find']({'where':{'id':_0x5d0f66[_0xfee1('0x53')]['id']}})[_0xfee1('0x1c')](handleEntityNotFound(_0x1b3b51,null))['then'](saveUpdates(_0x5d0f66[_0xfee1('0x52')],null))['then'](respondWithResult(_0x1b3b51,null))[_0xfee1('0x26')](handleError(_0x1b3b51,null));};var utilLicense=require(_0xfee1('0x17'));exports['getFavicon']=function(_0x2af94e,_0x431014,_0x293237){var _0x38be2e=_0xfee1('0x5b');var _0x5adab4={'custom':![]};return utilLicense[_0xfee1('0x5c')]()['then'](function(_0x58a84b){if(_0x58a84b){_0x5adab4=_0x58a84b;}return db['Setting'][_0xfee1('0x51')]({'where':{'id':_0x2af94e[_0xfee1('0x53')]['id']},'attributes':[_0xfee1('0x57'),_0xfee1('0x59'),_0xfee1('0x6d'),_0xfee1('0x5d'),'defaultLogo',_0xfee1('0x6e'),_0xfee1('0x5f'),_0xfee1('0x60')],'raw':!![]});})['then'](handleEntityNotFound(_0x431014,null))[_0xfee1('0x1c')](function(_0x56b042){if(_0x56b042){var _0x23e425=_0x56b042[_0xfee1('0x5d')]&&fs[_0xfee1('0x61')](path[_0xfee1('0x62')](config[_0xfee1('0x63')],_0x38be2e,_[_0xfee1('0x64')](_0x56b042[_0xfee1('0x5d')])))?path[_0xfee1('0x62')](config[_0xfee1('0x63')],_0x38be2e,_[_0xfee1('0x64')](_0x56b042[_0xfee1('0x5d')])):path[_0xfee1('0x62')](config[_0xfee1('0x63')],_0x38be2e,_[_0xfee1('0x64')]('default_favicon.ico'));var _0x2dd84b=_0xfee1('0x65')+_[_0xfee1('0x69')]('favicon');if(_0x56b042[_0x2dd84b]||!_0x5adab4[_0xfee1('0x66')]){_0x23e425=path[_0xfee1('0x62')](config[_0xfee1('0x63')],_0x38be2e,_[_0xfee1('0x64')](_0xfee1('0x74')));}if(!fs[_0xfee1('0x61')](_0x23e425)){throw new db[(_0xfee1('0x67'))]['ValidationError'](_[_0xfee1('0x69')](_0xfee1('0x5d'))+_0xfee1('0x6a'));}return _0x431014[_0xfee1('0x6b')](_0x23e425);}})[_0xfee1('0x26')](handleError(_0x431014,null));};exports['getDate']=function(_0x2c66cb,_0x19ad6d){var _0x430cf1={'offset':moment()[_0xfee1('0x75')]()};_0x430cf1['now']=moment()[_0xfee1('0x75')](_0x430cf1['offset'])[_0xfee1('0x76')](_0xfee1('0x77'));return _0x19ad6d[_0xfee1('0x28')](0xc8)[_0xfee1('0x78')](_0x430cf1);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 8779c09..eb061a0 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 _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x23c827,_0x37332a){var _0x3d7f1f=function(_0x3ff0f2){while(--_0x3ff0f2){_0x23c827['push'](_0x23c827['shift']());}};_0x3d7f1f(++_0x37332a);}(_0x3e74,0x175));var _0x43e7=function(_0x36aadd,_0x1ef607){_0x36aadd=_0x36aadd-0x0;var _0x256437=_0x3e74[_0x36aadd];return _0x256437;};'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 _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 7fd3e51..70c7c55 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 _0x231c=['message','result','ShowSetting','Setting','options','where','attributes','model','include','map','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2475fb,_0x238ba5){var _0x5a879a=function(_0x997461){while(--_0x997461){_0x2475fb['push'](_0x2475fb['shift']());}};_0x5a879a(++_0x238ba5);}(_0x231c,0x1ab));var _0xc231=function(_0x313677,_0x357e0c){_0x313677=_0x313677-0x0;var _0x23c64e=_0x231c[_0x313677];return _0x23c64e;};'use strict';var _=require(_0xc231('0x0'));var util=require('util');var moment=require(_0xc231('0x1'));var BPromise=require(_0xc231('0x2'));var rs=require(_0xc231('0x3'));var fs=require('fs');var Redis=require(_0xc231('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc231('0x5'));var logger=require(_0xc231('0x6'))(_0xc231('0x7'));var config=require(_0xc231('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc231('0x9')][_0xc231('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4996a1,_0x5578ec,_0x2ec46e){return new BPromise(function(_0x3ec26e,_0x1b95b7){return client[_0xc231('0xb')](_0x4996a1,_0x2ec46e)[_0xc231('0xc')](function(_0x44f4e2){logger[_0xc231('0xd')](_0xc231('0xe'),_0x5578ec,_0xc231('0xf'));logger[_0xc231('0x10')](_0xc231('0x11'),_0x5578ec,_0xc231('0xf'),JSON[_0xc231('0x12')](_0x44f4e2));if(_0x44f4e2[_0xc231('0x13')]){if(_0x44f4e2[_0xc231('0x13')][_0xc231('0x14')]===0x1f4){logger['error'](_0xc231('0xe'),_0x5578ec,_0x44f4e2[_0xc231('0x13')]['message']);return _0x1b95b7(_0x44f4e2[_0xc231('0x13')]['message']);}logger[_0xc231('0x13')](_0xc231('0xe'),_0x5578ec,_0x44f4e2[_0xc231('0x13')]['message']);return _0x3ec26e(_0x44f4e2[_0xc231('0x13')][_0xc231('0x15')]);}else{logger[_0xc231('0xd')]('Setting,\x20%s,\x20%s',_0x5578ec,_0xc231('0xf'));_0x3ec26e(_0x44f4e2[_0xc231('0x16')][_0xc231('0x15')]);}})['catch'](function(_0x5cb43c){logger[_0xc231('0x13')]('Setting,\x20%s,\x20%s',_0x5578ec,_0x5cb43c);_0x1b95b7(_0x5cb43c);});});}exports[_0xc231('0x17')]=function(_0x5d410e){var _0x349724=this;return new Promise(function(_0x306183,_0x3253ce){return db[_0xc231('0x18')]['find']({'raw':_0x5d410e[_0xc231('0x19')]?_0x5d410e[_0xc231('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5d410e['options']?_0x5d410e[_0xc231('0x19')][_0xc231('0x1a')]||null:null,'attributes':_0x5d410e['options']?_0x5d410e['options'][_0xc231('0x1b')]||null:null,'include':_0x5d410e[_0xc231('0x19')]?_0x5d410e[_0xc231('0x19')]['include']?_['map'](_0x5d410e[_0xc231('0x19')]['include'],function(_0x3b5912){return{'model':db[_0x3b5912[_0xc231('0x1c')]],'as':_0x3b5912['as'],'attributes':_0x3b5912[_0xc231('0x1b')],'include':_0x3b5912['include']?_['map'](_0x3b5912[_0xc231('0x1d')],function(_0x3a3d7e){return{'model':db[_0x3a3d7e[_0xc231('0x1c')]],'as':_0x3a3d7e['as'],'attributes':_0x3a3d7e[_0xc231('0x1b')],'include':_0x3a3d7e[_0xc231('0x1d')]?_[_0xc231('0x1e')](_0x3a3d7e[_0xc231('0x1d')],function(_0x361fa0){return{'model':db[_0x361fa0[_0xc231('0x1c')]],'as':_0x361fa0['as'],'attributes':_0x361fa0[_0xc231('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b6626){logger[_0xc231('0xd')](_0xc231('0x17'),_0x5d410e);logger['debug'](_0xc231('0x17'),_0x5d410e,JSON[_0xc231('0x12')](_0x3b6626));_0x306183(_0x3b6626);})[_0xc231('0x1f')](function(_0xc12579){logger[_0xc231('0x13')]('ShowSetting',_0xc12579[_0xc231('0x15')],_0x5d410e);_0x3253ce(_0x349724['error'](0x1f4,_0xc12579[_0xc231('0x15')]));});});}; \ No newline at end of file +var _0x6b0d=['raw','where','attributes','include','map','model','then','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','ShowSetting','options'];(function(_0x2e6def,_0x4e05cd){var _0xae8f63=function(_0x1b6615){while(--_0x1b6615){_0x2e6def['push'](_0x2e6def['shift']());}};_0xae8f63(++_0x4e05cd);}(_0x6b0d,0x1b9));var _0xd6b0=function(_0x564abe,_0x444fc0){_0x564abe=_0x564abe-0x0;var _0x3b7327=_0x6b0d[_0x564abe];return _0x3b7327;};'use strict';var _=require('lodash');var util=require(_0xd6b0('0x0'));var moment=require(_0xd6b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xd6b0('0x2'));var fs=require('fs');var Redis=require(_0xd6b0('0x3'));var db=require(_0xd6b0('0x4'))['db'];var utils=require(_0xd6b0('0x5'));var logger=require(_0xd6b0('0x6'))(_0xd6b0('0x7'));var config=require(_0xd6b0('0x8'));var jayson=require(_0xd6b0('0x9'));var client=jayson[_0xd6b0('0xa')][_0xd6b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ec7be,_0x1ec250,_0x49e20f){return new BPromise(function(_0x7d265c,_0x157151){return client[_0xd6b0('0xc')](_0x5ec7be,_0x49e20f)['then'](function(_0x839cb4){logger[_0xd6b0('0xd')](_0xd6b0('0xe'),_0x1ec250,'request\x20sent');logger[_0xd6b0('0xf')]('Setting,\x20%s,\x20%s,\x20%s',_0x1ec250,_0xd6b0('0x10'),JSON[_0xd6b0('0x11')](_0x839cb4));if(_0x839cb4[_0xd6b0('0x12')]){if(_0x839cb4['error']['code']===0x1f4){logger[_0xd6b0('0x12')]('Setting,\x20%s,\x20%s',_0x1ec250,_0x839cb4[_0xd6b0('0x12')]['message']);return _0x157151(_0x839cb4[_0xd6b0('0x12')]['message']);}logger[_0xd6b0('0x12')](_0xd6b0('0xe'),_0x1ec250,_0x839cb4[_0xd6b0('0x12')]['message']);return _0x7d265c(_0x839cb4['error'][_0xd6b0('0x13')]);}else{logger[_0xd6b0('0xd')](_0xd6b0('0xe'),_0x1ec250,_0xd6b0('0x10'));_0x7d265c(_0x839cb4[_0xd6b0('0x14')][_0xd6b0('0x13')]);}})[_0xd6b0('0x15')](function(_0x22ba57){logger[_0xd6b0('0x12')](_0xd6b0('0xe'),_0x1ec250,_0x22ba57);_0x157151(_0x22ba57);});});}exports[_0xd6b0('0x16')]=function(_0x569a16){var _0x483433=this;return new Promise(function(_0x9a232,_0x50d610){return db['Setting']['find']({'raw':_0x569a16[_0xd6b0('0x17')]?_0x569a16[_0xd6b0('0x17')][_0xd6b0('0x18')]===undefined?!![]:![]:!![],'where':_0x569a16[_0xd6b0('0x17')]?_0x569a16[_0xd6b0('0x17')][_0xd6b0('0x19')]||null:null,'attributes':_0x569a16[_0xd6b0('0x17')]?_0x569a16[_0xd6b0('0x17')][_0xd6b0('0x1a')]||null:null,'include':_0x569a16[_0xd6b0('0x17')]?_0x569a16['options'][_0xd6b0('0x1b')]?_[_0xd6b0('0x1c')](_0x569a16[_0xd6b0('0x17')][_0xd6b0('0x1b')],function(_0x1d8967){return{'model':db[_0x1d8967[_0xd6b0('0x1d')]],'as':_0x1d8967['as'],'attributes':_0x1d8967['attributes'],'include':_0x1d8967[_0xd6b0('0x1b')]?_[_0xd6b0('0x1c')](_0x1d8967['include'],function(_0x5f2946){return{'model':db[_0x5f2946[_0xd6b0('0x1d')]],'as':_0x5f2946['as'],'attributes':_0x5f2946[_0xd6b0('0x1a')],'include':_0x5f2946[_0xd6b0('0x1b')]?_['map'](_0x5f2946[_0xd6b0('0x1b')],function(_0x34869c){return{'model':db[_0x34869c['model']],'as':_0x34869c['as'],'attributes':_0x34869c[_0xd6b0('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd6b0('0x1e')](function(_0x546256){logger[_0xd6b0('0xd')](_0xd6b0('0x16'),_0x569a16);logger['debug'](_0xd6b0('0x16'),_0x569a16,JSON[_0xd6b0('0x11')](_0x546256));_0x9a232(_0x546256);})['catch'](function(_0x194a5a){logger[_0xd6b0('0x12')](_0xd6b0('0x16'),_0x194a5a[_0xd6b0('0x13')],_0x569a16);_0x50d610(_0x483433[_0xd6b0('0x12')](0x1f4,_0x194a5a[_0xd6b0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index f06547c..a8c8921 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 _0x5fab=['create','post','/:id/dispositions','addAnswer','/:id/notify','notify','addApplications','status','addAgents','put','update','delete','removeDispositions','removeAnswers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users'];(function(_0x4152fb,_0x382ecb){var _0x53b04d=function(_0x500c33){while(--_0x500c33){_0x4152fb['push'](_0x4152fb['shift']());}};_0x53b04d(++_0x382ecb);}(_0x5fab,0x177));var _0xb5fa=function(_0xdcda3,_0x4252fb){_0xdcda3=_0xdcda3-0x0;var _0x2bec82=_0x5fab[_0xdcda3];return _0x2bec82;};'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/dispositions',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['getApplications']);router[_0xb5fa('0xa')](_0xb5fa('0x14'),auth['isAuthenticated'](),controller[_0xb5fa('0x15')]);router['get'](_0xb5fa('0x16'),controller[_0xb5fa('0x17')]);router[_0xb5fa('0xa')](_0xb5fa('0x18'),auth[_0xb5fa('0xb')](),controller['getAgents']);router['post']('/',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x19')]);router[_0xb5fa('0x1a')](_0xb5fa('0x1b'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xb5fa('0x1a')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x1c')]);router[_0xb5fa('0x1a')](_0xb5fa('0x1d'),controller[_0xb5fa('0x1e')]);router[_0xb5fa('0x1a')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x1f')]);router[_0xb5fa('0x1a')]('/:id/send',auth[_0xb5fa('0xb')](),controller['send']);router[_0xb5fa('0x1a')]('/:id/status',controller[_0xb5fa('0x20')]);router[_0xb5fa('0x1a')]('/:id/users',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x21')]);router[_0xb5fa('0x22')]('/:id',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x23')]);router[_0xb5fa('0x24')]('/:id',auth[_0xb5fa('0xb')](),controller['destroy']);router[_0xb5fa('0x24')](_0xb5fa('0x1b'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x25')]);router[_0xb5fa('0x24')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x26')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xb5fa('0x27')]=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(_0x2bc747,_0x16edda){var _0x70bebc=function(_0x30dbba){while(--_0x30dbba){_0x2bc747['push'](_0x2bc747['shift']());}};_0x70bebc(++_0x16edda);}(_0x6aa7,0x178));var _0x76aa=function(_0x18a6ba,_0x156e2e){_0x18a6ba=_0x18a6ba-0x0;var _0x22912d=_0x6aa7[_0x18a6ba];return _0x22912d;};'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 aac6301..651646b 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 _0x02f8=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','twilio','connectel','clicksend','plivo','bandwidth','csc','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','setDataValue'];(function(_0x1d474f,_0x5a63cc){var _0x2440e1=function(_0x386541){while(--_0x386541){_0x1d474f['push'](_0x1d474f['shift']());}};_0x2440e1(++_0x5a63cc);}(_0x02f8,0x18e));var _0x802f=function(_0x507f9e,_0x308d20){_0x507f9e=_0x507f9e-0x0;var _0x250f7e=_0x02f8[_0x507f9e];return _0x250f7e;};'use strict';var Sequelize=require(_0x802f('0x0'));var rs=require(_0x802f('0x1'));module[_0x802f('0x2')]={'name':{'type':Sequelize[_0x802f('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x802f('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x802f('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x802f('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x802f('0x3')]},'type':{'type':Sequelize['ENUM'](_0x802f('0x4'),'skebby',_0x802f('0x5'),_0x802f('0x6'),_0x802f('0x7'),'clickatell',_0x802f('0x8'),_0x802f('0x9'),'infobip',_0x802f('0xa'))},'accountSid':{'type':Sequelize[_0x802f('0x3')]},'authId':{'type':Sequelize[_0x802f('0x3')]},'authToken':{'type':Sequelize[_0x802f('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x802f('0x3')]},'password':{'type':Sequelize[_0x802f('0x3')]},'apiKey':{'type':Sequelize[_0x802f('0x3')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x802f('0x3')]},'deliveryReport':{'type':Sequelize[_0x802f('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0x802f('0x3')]},'notificationTemplate':{'type':Sequelize[_0x802f('0xc')],'defaultValue':function(){return _0x802f('0xd');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x802f('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x802f('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x802f('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x802f('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x802f('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x802f('0xb')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x446d28){if(!_0x446d28)this[_0x802f('0xf')](_0x802f('0x10'),null);this['setDataValue'](_0x802f('0x11'),_0x446d28);}}}; \ No newline at end of file +var _0x2707=['plivo','clickatell','csc','infobip','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','clicksend'];(function(_0x267ec8,_0x12ad4f){var _0x1473b4=function(_0xd24ca6){while(--_0xd24ca6){_0x267ec8['push'](_0x267ec8['shift']());}};_0x1473b4(++_0x12ad4f);}(_0x2707,0x160));var _0x7270=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0x2707[_0x4ed520];return _0x4415a6;};'use strict';var Sequelize=require(_0x7270('0x0'));var rs=require(_0x7270('0x1'));module[_0x7270('0x2')]={'name':{'type':Sequelize[_0x7270('0x3')],'unique':_0x7270('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x7270('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x7270('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x7270('0x5')]();}},'phone':{'type':Sequelize[_0x7270('0x3')]},'type':{'type':Sequelize[_0x7270('0x6')](_0x7270('0x7'),'skebby','connectel',_0x7270('0x8'),_0x7270('0x9'),_0x7270('0xa'),'bandwidth',_0x7270('0xb'),_0x7270('0xc'),'intelepeer')},'accountSid':{'type':Sequelize[_0x7270('0x3')]},'authId':{'type':Sequelize[_0x7270('0x3')]},'authToken':{'type':Sequelize[_0x7270('0x3')]},'smsMethod':{'type':Sequelize[_0x7270('0x6')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x7270('0x3')]},'apiKey':{'type':Sequelize[_0x7270('0x3')]},'applicationId':{'type':Sequelize[_0x7270('0x3')]},'accountId':{'type':Sequelize[_0x7270('0x3')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x7270('0xd')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x7270('0xe');}},'notificationSound':{'type':Sequelize[_0x7270('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7270('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7270('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7270('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7270('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x7270('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7270('0xf')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x7270('0xd')],'defaultValue':![],'comment':_0x7270('0x10'),'set':function(_0x2f855b){if(!_0x2f855b)this[_0x7270('0x11')]('mandatoryDispositionPauseId',null);this[_0x7270('0x11')](_0x7270('0x12'),_0x2f855b);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 060d403..18c3167 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 _0x89b9=['request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','SmsAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','intersection','attributes','model','fields','length','query','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getDispositions','order','Disposition','removeDispositions','ids','addAnswer','SmsAccountId','CannedAnswer','getAnswers','findOne','removeAnswers','sms','SmsApplication','Applications','account','orderBy','priority','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','from','Body','MessageSid','sender','text','connectel','clicksend','messageId','message_id','plivo','From','Text','MessageUUID','infobip','results','originatingAddress','clickatell','fromNumber','replyMessageId','bandwidth','refid','isNil','ValidationError','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','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','push','applications','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','getApplications','getInteractions','Contact','fullname','Tag','Tags','tag','to\x20is\x20mandatory','List','out','SmsMessage','dataValues','Messages','inspect','skebby','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','error_code','message-delivered','intelepeer','DELIVRD','ACCEPTD','received\x20delivery\x20report\x20from','csc','message-id','state','addAgents','removeAgents','isArray','userSmsAccount:remove','emit','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./smsAccount.socket','register','client','http','info','SmsAccount,\x20%s,\x20%s'];(function(_0x5bdb53,_0x1ad583){var _0x5975be=function(_0x13df58){while(--_0x13df58){_0x5bdb53['push'](_0x5bdb53['shift']());}};_0x5975be(++_0x1ad583);}(_0x89b9,0xc8));var _0x989b=function(_0x241d98,_0x3227fd){_0x241d98=_0x241d98-0x0;var _0x43662b=_0x89b9[_0x241d98];return _0x43662b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x989b('0x0'));var jsonpatch=require(_0x989b('0x1'));var rp=require(_0x989b('0x2'));var moment=require(_0x989b('0x3'));var BPromise=require(_0x989b('0x4'));var Mustache=require('mustache');var util=require(_0x989b('0x5'));var path=require(_0x989b('0x6'));var sox=require(_0x989b('0x7'));var csv=require(_0x989b('0x8'));var ejs=require(_0x989b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x989b('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x989b('0xb'));var toCsv=require(_0x989b('0x8'));var querystring=require(_0x989b('0xc'));var Papa=require(_0x989b('0xd'));var Redis=require(_0x989b('0xe'));var authService=require(_0x989b('0xf'));var qs=require(_0x989b('0x10'));var as=require(_0x989b('0x11'));var hardwareService=require(_0x989b('0x12'));var logger=require(_0x989b('0x13'))(_0x989b('0x14'));var utils=require(_0x989b('0x15'));var config=require(_0x989b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x989b('0x17'))['db'];config[_0x989b('0x18')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x989b('0x19'))(new Redis(config[_0x989b('0x18')]));require(_0x989b('0x1a'))[_0x989b('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x989b('0x1c')][_0x989b('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x1a3359,_0x518c66,_0x119f1b,_0x5ddad0){return new BPromise(function(_0x222dc1,_0x268d4b){var _0x2cd75e=_0x5ddad0||client;return _0x2cd75e['request'](_0x1a3359,_0x119f1b)['then'](function(_0x184460){logger[_0x989b('0x1e')](_0x989b('0x1f'),_0x518c66,_0x989b('0x20'));logger[_0x989b('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x518c66,'request\x20sent',JSON[_0x989b('0x22')](_0x184460));if(_0x184460[_0x989b('0x23')]){if(_0x184460[_0x989b('0x23')][_0x989b('0x24')]===0x1f4){logger[_0x989b('0x23')](_0x989b('0x1f'),_0x518c66,_0x184460['error']['message']);return _0x268d4b(_0x184460[_0x989b('0x23')][_0x989b('0x25')]);}logger[_0x989b('0x23')]('SmsAccount,\x20%s,\x20%s',_0x518c66,_0x184460[_0x989b('0x23')][_0x989b('0x25')]);return _0x222dc1(_0x184460[_0x989b('0x23')][_0x989b('0x25')]);}else{logger[_0x989b('0x1e')](_0x989b('0x1f'),_0x518c66,_0x989b('0x20'));_0x222dc1(_0x184460[_0x989b('0x26')][_0x989b('0x25')]);}})[_0x989b('0x27')](function(_0x371935){logger[_0x989b('0x23')](_0x989b('0x1f'),_0x518c66,_0x371935);_0x268d4b(_0x371935);});});}function respondWithStatusCode(_0x43cd1e,_0x31cb2e){_0x31cb2e=_0x31cb2e||0xcc;return function(_0x3be148){if(_0x3be148){return _0x43cd1e[_0x989b('0x28')](_0x31cb2e);}return _0x43cd1e[_0x989b('0x29')](_0x31cb2e)[_0x989b('0x2a')]();};}function respondWithResult(_0x451b8e,_0x37d776){_0x37d776=_0x37d776||0xc8;return function(_0x4f3a86){if(_0x4f3a86){return _0x451b8e[_0x989b('0x29')](_0x37d776)[_0x989b('0x2b')](_0x4f3a86);}};}function respondWithFilteredResult(_0x20686a,_0x3c1b07){return function(_0x34f553){if(_0x34f553){var _0x3b1ac9=typeof _0x3c1b07[_0x989b('0x2c')]===_0x989b('0x2d')&&typeof _0x3c1b07[_0x989b('0x2e')]===_0x989b('0x2d');var _0x4fe197=_0x34f553[_0x989b('0x2f')];var _0x2a4b37=_0x3b1ac9?0x0:_0x3c1b07[_0x989b('0x2c')];var _0x46b225=_0x3b1ac9?_0x34f553[_0x989b('0x2f')]:_0x3c1b07[_0x989b('0x2c')]+_0x3c1b07[_0x989b('0x2e')];var _0x3cc97d;if(_0x46b225>=_0x4fe197){_0x46b225=_0x4fe197;_0x3cc97d=0xc8;}else{_0x3cc97d=0xce;}_0x20686a[_0x989b('0x29')](_0x3cc97d);return _0x20686a[_0x989b('0x30')](_0x989b('0x31'),_0x2a4b37+'-'+_0x46b225+'/'+_0x4fe197)[_0x989b('0x2b')](_0x34f553);}return null;};}function patchUpdates(_0x2dea20){return function(_0x1bb03f){try{jsonpatch['apply'](_0x1bb03f,_0x2dea20,!![]);}catch(_0x1b8389){return BPromise[_0x989b('0x32')](_0x1b8389);}return _0x1bb03f[_0x989b('0x33')]();};}function saveUpdates(_0x4316ad,_0x41cab9){return function(_0x2d1890){if(_0x2d1890){return _0x2d1890[_0x989b('0x34')](_0x4316ad)[_0x989b('0x35')](function(_0x523db4){return _0x523db4;});}return null;};}function removeEntity(_0xc5a8bb,_0x54893b){return function(_0x10f324){if(_0x10f324){return _0x10f324[_0x989b('0x36')]()[_0x989b('0x35')](function(){var _0x5006e1=_0x10f324[_0x989b('0x37')]({'plain':!![]});var _0x530705=_0x989b('0x38');return db['UserProfileResource'][_0x989b('0x36')]({'where':{'type':_0x530705,'resourceId':_0x5006e1['id']}})[_0x989b('0x35')](function(){return _0x10f324;});})[_0x989b('0x35')](function(){_0xc5a8bb[_0x989b('0x29')](0xcc)[_0x989b('0x2a')]();});}};}function handleEntityNotFound(_0x4ba1a1,_0x472107){return function(_0x2acf40){if(!_0x2acf40){_0x4ba1a1[_0x989b('0x28')](0x194);}return _0x2acf40;};}function handleError(_0x52cdfa,_0x4ef613){_0x4ef613=_0x4ef613||0x1f4;return function(_0xe88daf){logger['error'](_0xe88daf[_0x989b('0x39')]);if(_0xe88daf[_0x989b('0x3a')]){delete _0xe88daf[_0x989b('0x3a')];}_0x52cdfa[_0x989b('0x29')](_0x4ef613)[_0x989b('0x3b')](_0xe88daf);};}exports[_0x989b('0x3c')]=function(_0x55db55,_0x2875d1){var _0x3ac683={'include':[{'model':db[_0x989b('0x3d')],'as':_0x989b('0x3e')}]},_0x36a995={},_0x167c28={'count':0x0,'rows':[]};var _0x463755=_[_0x989b('0x3f')](db[_0x989b('0x40')][_0x989b('0x41')],function(_0x112189){return{'name':_0x112189[_0x989b('0x42')],'type':_0x112189[_0x989b('0x43')][_0x989b('0x44')]};});_0x36a995['model']=_[_0x989b('0x3f')](_0x463755,_0x989b('0x3a'));_0x36a995['query']=_['keys'](_0x55db55['query']);_0x36a995['filters']=_[_0x989b('0x45')](_0x36a995['model'],_0x36a995['query']);_0x3ac683[_0x989b('0x46')]=_[_0x989b('0x45')](_0x36a995[_0x989b('0x47')],qs['fields'](_0x55db55['query'][_0x989b('0x48')]));_0x3ac683[_0x989b('0x46')]=_0x3ac683[_0x989b('0x46')][_0x989b('0x49')]?_0x3ac683[_0x989b('0x46')]:_0x36a995[_0x989b('0x47')];if(!_0x55db55[_0x989b('0x4a')][_0x989b('0x4b')](_0x989b('0x4c'))){_0x3ac683[_0x989b('0x2e')]=qs[_0x989b('0x2e')](_0x55db55[_0x989b('0x4a')][_0x989b('0x2e')]);_0x3ac683['offset']=qs[_0x989b('0x2c')](_0x55db55[_0x989b('0x4a')][_0x989b('0x2c')]);}_0x3ac683['order']=qs[_0x989b('0x4d')](_0x55db55['query'][_0x989b('0x4d')]);_0x3ac683['where']=qs[_0x989b('0x4e')](_[_0x989b('0x4f')](_0x55db55[_0x989b('0x4a')],_0x36a995['filters']),_0x463755);if(_0x55db55[_0x989b('0x4a')][_0x989b('0x50')]){_0x3ac683[_0x989b('0x51')]=_[_0x989b('0x52')](_0x3ac683[_0x989b('0x51')],{'$or':_[_0x989b('0x3f')](_0x463755,function(_0x478b31){if(_0x478b31[_0x989b('0x43')]!==_0x989b('0x53')){var _0x518053={};_0x518053[_0x478b31[_0x989b('0x3a')]]={'$like':'%'+_0x55db55['query'][_0x989b('0x50')]+'%'};return _0x518053;}})});}_0x3ac683=_[_0x989b('0x52')]({},_0x3ac683,_0x55db55[_0x989b('0x54')]);var _0x197f30={'where':_0x3ac683[_0x989b('0x51')]};return db[_0x989b('0x40')][_0x989b('0x2f')](_0x197f30)[_0x989b('0x35')](function(_0xe05955){_0x167c28[_0x989b('0x2f')]=_0xe05955;if(_0x55db55['query'][_0x989b('0x55')]){_0x3ac683['include']=[{'all':!![]}];}return db[_0x989b('0x40')][_0x989b('0x56')](_0x3ac683);})['then'](function(_0x14c64a){_0x167c28[_0x989b('0x57')]=_0x14c64a;return _0x167c28;})['then'](respondWithFilteredResult(_0x2875d1,_0x3ac683))[_0x989b('0x27')](handleError(_0x2875d1,null));};exports[_0x989b('0x58')]=function(_0x3f2b08,_0x6524df){var _0x4f2616={'raw':![],'where':{'id':_0x3f2b08[_0x989b('0x59')]['id']},'include':[{'model':db[_0x989b('0x3d')],'as':_0x989b('0x3e')}]},_0x3e10d4={};_0x3e10d4[_0x989b('0x47')]=_[_0x989b('0x5a')](db['SmsAccount'][_0x989b('0x41')]);_0x3e10d4[_0x989b('0x4a')]=_['keys'](_0x3f2b08[_0x989b('0x4a')]);_0x3e10d4[_0x989b('0x4e')]=_[_0x989b('0x45')](_0x3e10d4[_0x989b('0x47')],_0x3e10d4[_0x989b('0x4a')]);_0x4f2616[_0x989b('0x46')]=_[_0x989b('0x45')](_0x3e10d4[_0x989b('0x47')],qs[_0x989b('0x48')](_0x3f2b08[_0x989b('0x4a')][_0x989b('0x48')]));_0x4f2616[_0x989b('0x46')]=_0x4f2616['attributes']['length']?_0x4f2616[_0x989b('0x46')]:_0x3e10d4[_0x989b('0x47')];if(_0x3f2b08['query'][_0x989b('0x55')]){_0x4f2616[_0x989b('0x5b')]=[{'all':!![]}];}_0x4f2616=_['merge']({},_0x4f2616,_0x3f2b08[_0x989b('0x54')]);return db[_0x989b('0x40')][_0x989b('0x5c')](_0x4f2616)[_0x989b('0x35')](handleEntityNotFound(_0x6524df,null))[_0x989b('0x35')](respondWithResult(_0x6524df,null))[_0x989b('0x27')](handleError(_0x6524df,null));};exports[_0x989b('0x5d')]=function(_0x3096ff,_0x15bf0a){return db[_0x989b('0x40')][_0x989b('0x5d')](_0x3096ff[_0x989b('0x5e')],{})[_0x989b('0x35')](function(_0x5f2293){var _0x208100=_0x3096ff[_0x989b('0x5f')]['get']({'plain':!![]});if(!_0x208100)throw new Error(_0x989b('0x60'));if(_0x208100[_0x989b('0x61')]===_0x989b('0x5f')){var _0x42004e=_0x5f2293[_0x989b('0x37')]({'plain':!![]});var _0x4b7b04=_0x989b('0x38');return db[_0x989b('0x62')]['find']({'where':{'name':_0x4b7b04,'userProfileId':_0x208100[_0x989b('0x63')]},'raw':!![]})['then'](function(_0x35b2e3){if(_0x35b2e3&&_0x35b2e3[_0x989b('0x64')]===0x0){return db[_0x989b('0x65')]['create']({'name':_0x42004e['name'],'resourceId':_0x42004e['id'],'type':_0x35b2e3[_0x989b('0x3a')],'sectionId':_0x35b2e3['id']},{})['then'](function(){return _0x5f2293;});}else{return _0x5f2293;}})['catch'](function(_0xe6f27e){logger[_0x989b('0x23')](_0x989b('0x66'),_0xe6f27e);throw _0xe6f27e;});}return _0x5f2293;})[_0x989b('0x35')](respondWithResult(_0x15bf0a,0xc9))[_0x989b('0x27')](handleError(_0x15bf0a,null));};exports['update']=function(_0x1344b1,_0x310209){if(_0x1344b1['body']['id']){delete _0x1344b1['body']['id'];}return db[_0x989b('0x40')][_0x989b('0x5c')]({'where':{'id':_0x1344b1[_0x989b('0x59')]['id']},'include':[{'model':db[_0x989b('0x3d')],'as':_0x989b('0x3e')}]})['then'](handleEntityNotFound(_0x310209,null))[_0x989b('0x35')](saveUpdates(_0x1344b1[_0x989b('0x5e')],null))[_0x989b('0x35')](respondWithResult(_0x310209,null))[_0x989b('0x27')](handleError(_0x310209,null));};exports['destroy']=function(_0x96fe13,_0x24f1ca){return db[_0x989b('0x40')][_0x989b('0x5c')]({'where':{'id':_0x96fe13['params']['id']}})[_0x989b('0x35')](handleEntityNotFound(_0x24f1ca,null))[_0x989b('0x35')](removeEntity(_0x24f1ca,null))[_0x989b('0x27')](handleError(_0x24f1ca,null));};exports[_0x989b('0x67')]=function(_0x2be0d3,_0x1ed7a0){return db[_0x989b('0x40')][_0x989b('0x67')]()['then'](respondWithResult(_0x1ed7a0,null))['catch'](handleError(_0x1ed7a0,null));};exports['addDisposition']=function(_0x5d5849,_0x1ba072,_0x5708b8){if(_0x5d5849['body']['id']){delete _0x5d5849['body']['id'];}return db['SmsAccount'][_0x989b('0x5c')]({'where':{'id':_0x5d5849[_0x989b('0x59')]['id']}})[_0x989b('0x35')](handleEntityNotFound(_0x1ba072,null))[_0x989b('0x35')](function(_0x241642){if(_0x241642){_0x5d5849[_0x989b('0x5e')]['SmsAccountId']=_0x241642['id'];return db['Disposition'][_0x989b('0x5d')](_0x5d5849[_0x989b('0x5e')]);}})[_0x989b('0x35')](respondWithResult(_0x1ba072,null))['catch'](handleError(_0x1ba072,null));};exports[_0x989b('0x68')]=function(_0x421fbb,_0x38fc4b,_0xb77e38){var _0x1c5e3e={'raw':![],'where':{}};var _0x200990={};var _0xa64cca={'count':0x0,'rows':[]};return db[_0x989b('0x40')]['findOne']({'where':{'id':_0x421fbb[_0x989b('0x59')]['id']}})[_0x989b('0x35')](handleEntityNotFound(_0x38fc4b,null))['then'](function(_0x3fb573){if(_0x3fb573){_0x200990[_0x989b('0x47')]=_[_0x989b('0x5a')](db['Disposition'][_0x989b('0x41')]);_0x200990[_0x989b('0x4a')]=_['keys'](_0x421fbb[_0x989b('0x4a')]);_0x200990[_0x989b('0x4e')]=_[_0x989b('0x45')](_0x200990[_0x989b('0x47')],_0x200990[_0x989b('0x4a')]);_0x1c5e3e[_0x989b('0x46')]=_[_0x989b('0x45')](_0x200990[_0x989b('0x47')],qs['fields'](_0x421fbb[_0x989b('0x4a')][_0x989b('0x48')]));_0x1c5e3e[_0x989b('0x46')]=_0x1c5e3e[_0x989b('0x46')][_0x989b('0x49')]?_0x1c5e3e[_0x989b('0x46')]:_0x200990[_0x989b('0x47')];if(!_0x421fbb['query']['hasOwnProperty'](_0x989b('0x4c'))){_0x1c5e3e[_0x989b('0x2e')]=qs['limit'](_0x421fbb[_0x989b('0x4a')]['limit']);_0x1c5e3e[_0x989b('0x2c')]=qs[_0x989b('0x2c')](_0x421fbb['query'][_0x989b('0x2c')]);}_0x1c5e3e[_0x989b('0x69')]=qs['sort'](_0x421fbb['query'][_0x989b('0x4d')]);_0x1c5e3e[_0x989b('0x51')]=qs[_0x989b('0x4e')](_[_0x989b('0x4f')](_0x421fbb['query'],_0x200990[_0x989b('0x4e')]));_0x1c5e3e[_0x989b('0x51')]['SmsAccountId']=_0x3fb573['id'];if(_0x421fbb[_0x989b('0x4a')][_0x989b('0x50')]){_0x1c5e3e[_0x989b('0x51')]=_[_0x989b('0x52')](_0x1c5e3e['where'],{'$or':_[_0x989b('0x3f')](_0x1c5e3e['attributes'],function(_0x3d4807){var _0x12069c={};_0x12069c[_0x3d4807]={'$like':'%'+_0x421fbb[_0x989b('0x4a')][_0x989b('0x50')]+'%'};return _0x12069c;})});}_0x1c5e3e=_[_0x989b('0x52')]({},_0x1c5e3e,_0x421fbb[_0x989b('0x54')]);return db['Disposition']['count']({'where':_0x1c5e3e['where']})[_0x989b('0x35')](function(_0x2462bf){_0xa64cca['count']=_0x2462bf;if(_0x421fbb[_0x989b('0x4a')][_0x989b('0x55')]){_0x1c5e3e[_0x989b('0x5b')]=[{'all':!![]}];}return db[_0x989b('0x6a')][_0x989b('0x56')](_0x1c5e3e);})[_0x989b('0x35')](function(_0x46a43e){_0xa64cca[_0x989b('0x57')]=_0x46a43e;return _0xa64cca;});}})[_0x989b('0x35')](respondWithFilteredResult(_0x38fc4b,_0x1c5e3e))['catch'](handleError(_0x38fc4b,null));};exports['removeDispositions']=function(_0x3c6c0a,_0x10cf9f,_0x20e0fb){return db[_0x989b('0x40')][_0x989b('0x5c')]({'where':{'id':_0x3c6c0a[_0x989b('0x59')]['id']}})[_0x989b('0x35')](handleEntityNotFound(_0x10cf9f,null))[_0x989b('0x35')](function(_0xc4b115){if(_0xc4b115){return _0xc4b115[_0x989b('0x6b')](_0x3c6c0a['query'][_0x989b('0x6c')]);}})[_0x989b('0x35')](respondWithStatusCode(_0x10cf9f,null))[_0x989b('0x27')](handleError(_0x10cf9f,null));};exports[_0x989b('0x6d')]=function(_0x131197,_0x50c776,_0x5e49ad){if(_0x131197[_0x989b('0x5e')]['id']){delete _0x131197[_0x989b('0x5e')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x131197['params']['id']}})[_0x989b('0x35')](handleEntityNotFound(_0x50c776,null))[_0x989b('0x35')](function(_0x2a4232){if(_0x2a4232){_0x131197[_0x989b('0x5e')][_0x989b('0x6e')]=_0x2a4232['id'];return db[_0x989b('0x6f')][_0x989b('0x5d')](_0x131197['body']);}})[_0x989b('0x35')](respondWithResult(_0x50c776,null))[_0x989b('0x27')](handleError(_0x50c776,null));};exports[_0x989b('0x70')]=function(_0x5d8b32,_0x4919ef,_0x448636){var _0x1ce83d={'raw':![],'where':{}};var _0x287838={};var _0x3e6e59={'count':0x0,'rows':[]};return db[_0x989b('0x40')][_0x989b('0x71')]({'where':{'id':_0x5d8b32[_0x989b('0x59')]['id']}})['then'](handleEntityNotFound(_0x4919ef,null))[_0x989b('0x35')](function(_0x17b4a3){if(_0x17b4a3){_0x287838[_0x989b('0x47')]=_[_0x989b('0x5a')](db[_0x989b('0x6f')][_0x989b('0x41')]);_0x287838[_0x989b('0x4a')]=_[_0x989b('0x5a')](_0x5d8b32[_0x989b('0x4a')]);_0x287838[_0x989b('0x4e')]=_[_0x989b('0x45')](_0x287838[_0x989b('0x47')],_0x287838['query']);_0x1ce83d[_0x989b('0x46')]=_['intersection'](_0x287838[_0x989b('0x47')],qs[_0x989b('0x48')](_0x5d8b32['query'][_0x989b('0x48')]));_0x1ce83d[_0x989b('0x46')]=_0x1ce83d['attributes'][_0x989b('0x49')]?_0x1ce83d['attributes']:_0x287838[_0x989b('0x47')];if(!_0x5d8b32['query'][_0x989b('0x4b')](_0x989b('0x4c'))){_0x1ce83d[_0x989b('0x2e')]=qs[_0x989b('0x2e')](_0x5d8b32[_0x989b('0x4a')][_0x989b('0x2e')]);_0x1ce83d[_0x989b('0x2c')]=qs[_0x989b('0x2c')](_0x5d8b32[_0x989b('0x4a')][_0x989b('0x2c')]);}_0x1ce83d[_0x989b('0x69')]=qs[_0x989b('0x4d')](_0x5d8b32[_0x989b('0x4a')][_0x989b('0x4d')]);_0x1ce83d[_0x989b('0x51')]=qs[_0x989b('0x4e')](_['pick'](_0x5d8b32[_0x989b('0x4a')],_0x287838[_0x989b('0x4e')]));_0x1ce83d[_0x989b('0x51')]['SmsAccountId']=_0x17b4a3['id'];if(_0x5d8b32[_0x989b('0x4a')][_0x989b('0x50')]){_0x1ce83d[_0x989b('0x51')]=_['merge'](_0x1ce83d[_0x989b('0x51')],{'$or':_[_0x989b('0x3f')](_0x1ce83d[_0x989b('0x46')],function(_0x4cd1a2){var _0x5ce390={};_0x5ce390[_0x4cd1a2]={'$like':'%'+_0x5d8b32[_0x989b('0x4a')][_0x989b('0x50')]+'%'};return _0x5ce390;})});}_0x1ce83d=_[_0x989b('0x52')]({},_0x1ce83d,_0x5d8b32['options']);return db[_0x989b('0x6f')]['count']({'where':_0x1ce83d[_0x989b('0x51')]})[_0x989b('0x35')](function(_0x138a69){_0x3e6e59[_0x989b('0x2f')]=_0x138a69;if(_0x5d8b32[_0x989b('0x4a')][_0x989b('0x55')]){_0x1ce83d[_0x989b('0x5b')]=[{'all':!![]}];}return db['CannedAnswer'][_0x989b('0x56')](_0x1ce83d);})[_0x989b('0x35')](function(_0xf1dd8e){_0x3e6e59[_0x989b('0x57')]=_0xf1dd8e;return _0x3e6e59;});}})[_0x989b('0x35')](respondWithFilteredResult(_0x4919ef,_0x1ce83d))[_0x989b('0x27')](handleError(_0x4919ef,null));};exports[_0x989b('0x72')]=function(_0x57e4e1,_0x4b8f58,_0x26f8a9){return db['SmsAccount']['find']({'where':{'id':_0x57e4e1['params']['id']}})[_0x989b('0x35')](handleEntityNotFound(_0x4b8f58,null))[_0x989b('0x35')](function(_0x5ad45e){if(_0x5ad45e){return _0x5ad45e[_0x989b('0x72')](_0x57e4e1[_0x989b('0x4a')][_0x989b('0x6c')]);}})[_0x989b('0x35')](respondWithStatusCode(_0x4b8f58,null))[_0x989b('0x27')](handleError(_0x4b8f58,null));};exports['notify']=function(_0x3f1b5f,_0x21d95f,_0x44621a){var _0xb84a75={'channel':_0x989b('0x73')};var _0x29c4ee=[];var _0x2e55b0=[];var _0xfac34d={};return db[_0x989b('0x40')]['find']({'where':{'id':_0x3f1b5f[_0x989b('0x59')]['id']},'include':[{'model':db[_0x989b('0x74')],'as':_0x989b('0x75')}]})['then'](handleEntityNotFound(_0x21d95f,null))[_0x989b('0x35')](function(_0x1dc0b1){_0xb84a75[_0x989b('0x76')]=_0x1dc0b1;_0xb84a75['applications']=_[_0x989b('0x77')](_0x1dc0b1[_0x989b('0x75')],[_0x989b('0x78')],[_0x989b('0x79')]);if(_0xb84a75[_0x989b('0x76')][_0x989b('0x75')]){delete _0xb84a75['account'][_0x989b('0x75')];}return db[_0x989b('0x7a')]['describe']();})['then'](function(_0xd096a1){if(!_0xd096a1){throw new db[(_0x989b('0x7b'))]['ValidationError'](_0x989b('0x7c'));}_0x29c4ee=_[_0x989b('0x7d')](_[_0x989b('0x5a')](_0xd096a1),[_0x989b('0x7e'),_0x989b('0x7f')]);_0x2e55b0=_['difference'](_[_0x989b('0x5a')](_0xd096a1),[_0x989b('0x7e'),_0x989b('0x7f'),_0x989b('0x80'),_0x989b('0x81')]);_0xb84a75[_0x989b('0x5e')]={'mapKey':'mobile'};if(_0xb84a75['account']['type']){switch(_0xb84a75[_0x989b('0x76')]['type']){case _0x989b('0x82'):_0xb84a75['body'][_0x989b('0x83')]=_0x3f1b5f[_0x989b('0x5e')]['From'];_0xb84a75[_0x989b('0x5e')][_0x989b('0x5e')]=_0x3f1b5f['body'][_0x989b('0x84')];_0xb84a75['body']['messageId']=_0x3f1b5f[_0x989b('0x5e')][_0x989b('0x85')];break;case'skebby':_0xb84a75[_0x989b('0x5e')][_0x989b('0x83')]='+'+_0x3f1b5f[_0x989b('0x5e')][_0x989b('0x86')];_0xb84a75[_0x989b('0x5e')][_0x989b('0x5e')]=_0x3f1b5f[_0x989b('0x5e')][_0x989b('0x87')];break;case _0x989b('0x88'):_0xb84a75['body']['from']=_0x3f1b5f[_0x989b('0x5e')][_0x989b('0x83')];_0xb84a75['body'][_0x989b('0x5e')]=_0x3f1b5f['body']['message'];break;case _0x989b('0x89'):_0xb84a75[_0x989b('0x5e')][_0x989b('0x83')]=_0x3f1b5f[_0x989b('0x5e')][_0x989b('0x83')];_0xb84a75[_0x989b('0x5e')][_0x989b('0x5e')]=_0x3f1b5f[_0x989b('0x5e')][_0x989b('0x5e')];_0xb84a75[_0x989b('0x5e')][_0x989b('0x8a')]=_0x3f1b5f[_0x989b('0x5e')][_0x989b('0x8b')];break;case _0x989b('0x8c'):_0xb84a75['body'][_0x989b('0x83')]=_0x3f1b5f['body'][_0x989b('0x8d')];_0xb84a75[_0x989b('0x5e')]['body']=_0x3f1b5f[_0x989b('0x5e')][_0x989b('0x8e')];_0xb84a75['body'][_0x989b('0x8a')]=_0x3f1b5f[_0x989b('0x5e')][_0x989b('0x8f')];break;case _0x989b('0x90'):_0xb84a75[_0x989b('0x5e')][_0x989b('0x83')]='+'+_0x3f1b5f[_0x989b('0x5e')]['results'][0x0][_0x989b('0x83')];_0xb84a75[_0x989b('0x5e')][_0x989b('0x5e')]=_0x3f1b5f[_0x989b('0x5e')][_0x989b('0x91')][0x0][_0x989b('0x87')];_0xb84a75[_0x989b('0x5e')][_0x989b('0x8a')]=_0x3f1b5f[_0x989b('0x5e')][_0x989b('0x91')][0x0][_0x989b('0x8a')];break;case'csc':_0xb84a75['body'][_0x989b('0x83')]=_0x3f1b5f[_0x989b('0x5e')][_0x989b('0x92')];_0xb84a75['body'][_0x989b('0x5e')]=_0x3f1b5f[_0x989b('0x5e')]['segmentedMessage'][_0x989b('0x25')];break;case _0x989b('0x93'):_0xb84a75[_0x989b('0x5e')][_0x989b('0x83')]=_0x3f1b5f[_0x989b('0x5e')][_0x989b('0x94')];_0xb84a75[_0x989b('0x5e')][_0x989b('0x5e')]=_0x3f1b5f[_0x989b('0x5e')][_0x989b('0x87')];_0xb84a75[_0x989b('0x5e')][_0x989b('0x8a')]=_0x3f1b5f[_0x989b('0x5e')][_0x989b('0x95')];break;case _0x989b('0x96'):_0xb84a75['body'][_0x989b('0x8a')]=_0x3f1b5f[_0x989b('0x5e')][0x0][_0x989b('0x25')]['id'];_0xb84a75[_0x989b('0x5e')][_0x989b('0x83')]=_0x3f1b5f[_0x989b('0x5e')][0x0][_0x989b('0x25')][_0x989b('0x83')];_0xb84a75[_0x989b('0x5e')][_0x989b('0x5e')]=_0x3f1b5f[_0x989b('0x5e')][0x0][_0x989b('0x25')][_0x989b('0x87')];break;case'intelepeer':_0xb84a75['body'][_0x989b('0x83')]=_0x3f1b5f[_0x989b('0x5e')]['from'];_0xb84a75[_0x989b('0x5e')]['body']=_0x3f1b5f[_0x989b('0x5e')]['message'];_0xb84a75[_0x989b('0x5e')][_0x989b('0x8a')]=_0x3f1b5f['body'][_0x989b('0x97')];break;}}if(_0xb84a75[_0x989b('0x5e')]['id']){delete _0xb84a75[_0x989b('0x5e')]['id'];}if(_[_0x989b('0x98')](_0xb84a75[_0x989b('0x5e')][_0x989b('0x83')])){throw new db[(_0x989b('0x7b'))][(_0x989b('0x99'))](_0x989b('0x9a'));}if(_[_0x989b('0x98')](_0xb84a75[_0x989b('0x5e')][_0x989b('0x5e')])||_0xb84a75[_0x989b('0x5e')][_0x989b('0x5e')]===''){throw new db[(_0x989b('0x7b'))][(_0x989b('0x99'))](_0x989b('0x9b'));}if(_['isNil'](_0xb84a75[_0x989b('0x5e')][_0x989b('0x9c')])){throw new db['Sequelize']['ValidationError'](_0x989b('0x9d')+_0x2e55b0);}if(!_[_0x989b('0x9e')](_0x2e55b0,_0xb84a75[_0x989b('0x5e')][_0x989b('0x9c')])){throw new db[(_0x989b('0x7b'))][(_0x989b('0x99'))](_0x989b('0x9f')+_0x2e55b0);}_0xfac34d[_0xb84a75['body'][_0x989b('0x9c')]]=_0xb84a75[_0x989b('0x5e')]['from'];return db[_0x989b('0xa0')][_0x989b('0x5c')]({'where':{'id':_0xb84a75['account'][_0x989b('0x81')]},'include':[{'model':db[_0x989b('0x7a')],'as':_0x989b('0xa1'),'where':_0xfac34d,'limit':0x1,'order':[['updatedAt',_0x989b('0xa2')]]}]});})[_0x989b('0x35')](handleEntityNotFound(_0x21d95f,null))[_0x989b('0x35')](function(_0x12d4fd){if(_0x12d4fd){_0xb84a75[_0x989b('0xa3')]=_[_0x989b('0xa4')](_0x12d4fd,[_0x989b('0xa1')]);if(_0x12d4fd[_0x989b('0xa1')][_0x989b('0x49')]){return _0x12d4fd[_0x989b('0xa1')][0x0];}var _0x3439ea=_['defaults'](_0xb84a75['body'],{'firstName':_0xb84a75[_0x989b('0x5e')][_0x989b('0x83')],'ListId':_0x12d4fd['id']});_0x3439ea[_0xb84a75[_0x989b('0x5e')][_0x989b('0x9c')]]=_0xb84a75['body'][_0x989b('0x83')];return db[_0x989b('0x7a')][_0x989b('0x5d')](_0x3439ea,{'fields':_0x29c4ee,'raw':!![]});}})[_0x989b('0x35')](handleEntityNotFound(_0x21d95f,null))[_0x989b('0x35')](function(_0x1b8d8c){if(_0x1b8d8c){_0xb84a75[_0x989b('0xa5')]=_0x1b8d8c;var _0x4ce8a2={'ContactId':_0x1b8d8c['id'],'phone':_0xb84a75[_0x989b('0x5e')][_0x989b('0x83')],'SmsAccountId':_0x3f1b5f[_0x989b('0x59')]['id']};var _0x4ad79e={'ContactId':_0x1b8d8c['id'],'SmsAccountId':_0x3f1b5f[_0x989b('0x59')]['id'],'closed':![]};return db[_0x989b('0xa6')][_0x989b('0x5c')]({'where':_0x4ad79e})['then'](function(_0x49195f){if(_0x49195f){return[_0x49195f,![]];}return db[_0x989b('0xa6')][_0x989b('0x5d')](_0x4ce8a2)[_0x989b('0x35')](function(_0x388abf){return[_0x388abf,!![]];});});}})[_0x989b('0xa7')](function(_0x34161d,_0x266cac){_0xb84a75[_0x989b('0xa8')]=_0x34161d[_0x989b('0x37')]({'plain':!![]});_0xb84a75[_0x989b('0xa8')][_0x989b('0xa9')]=![];if(_0x266cac){if(_0xb84a75[_0x989b('0x76')][_0x989b('0xaa')]){_0xb84a75['applications'][_0x989b('0xab')]({'id':0x0,'priority':_0xb84a75[_0x989b('0xac')][_0x989b('0x49')]+0x1,'app':_0x989b('0xad'),'appdata':_0x989b('0xae'),'interval':_0x989b('0xaf')});}_0xb84a75['interaction'][_0x989b('0xa9')]=!![];}return db['SmsMessage']['create']({'phone':_0xb84a75['body'][_0x989b('0x83')],'messageId':_0xb84a75[_0x989b('0x5e')]['messageId'],'body':_0xb84a75[_0x989b('0x5e')][_0x989b('0x5e')],'SmsAccountId':_0x3f1b5f[_0x989b('0x59')]['id'],'SmsInteractionId':_0x34161d['id'],'direction':'in','ContactId':_0x34161d[_0x989b('0xb0')],'AttachmentId':_0xb84a75[_0x989b('0x5e')][_0x989b('0xb1')]});})['then'](function(_0x1d930f){_0xb84a75[_0x989b('0x25')]=_0x1d930f;if(_0xb84a75['interaction'][_0x989b('0xb2')]){return db[_0x989b('0xb3')]['find']({'attributes':['id',_0x989b('0x3a')],'where':{'id':_0xb84a75['interaction'][_0x989b('0xb2')]}})[_0x989b('0x35')](function(_0x100ed6){if(_0x100ed6){_0xb84a75['applications'][_0x989b('0xb4')]({'id':0x0,'priority':0x0,'app':_0x989b('0xb5'),'appdata':_0x100ed6[_0x989b('0x3a')]+','+(_0xb84a75[_0x989b('0x76')][_0x989b('0xb6')]||0xa),'interval':_0x989b('0xaf')});}return respondWithRpcPromise(_0x989b('0xb7'),_0x989b('0xb8'),_0xb84a75);});}return respondWithRpcPromise(_0x989b('0xb7'),'startRouting',_0xb84a75);})[_0x989b('0x35')](function(_0x4e5d92){if(_0x4e5d92){var _0x5ebf6f=0xc8;var _0x1bc9c8=_0x989b('0xb9');logger['info'](_0x989b('0xba'),_0x1bc9c8,_0x5ebf6f,_0x989b('0xbb'));logger[_0x989b('0x21')](_0x989b('0xbc'),_0x1bc9c8,_0x5ebf6f,_0x989b('0xbb'),JSON[_0x989b('0x22')](_0x4e5d92));if(_0xb84a75[_0x989b('0x76')]['type']===_0x989b('0x82')){return _0x21d95f[_0x989b('0x29')](_0x5ebf6f)['set'](_0x989b('0xbd'),'text/xml')['send']('\x0a');}else{return _0x21d95f['status'](_0x5ebf6f)[_0x989b('0x2b')](_0x4e5d92);}}})[_0x989b('0x27')](handleError(_0x21d95f,null));};exports[_0x989b('0xbe')]=function(_0x2694e7,_0x210f4a){var _0x5c18d2=_0x2694e7[_0x989b('0x59')]['id'];var _0xf88c52=_0x2694e7[_0x989b('0x5e')];var _0x464509=0xc8;var _0x2e98ce=null;return db[_0x989b('0xbf')][_0x989b('0xc0')]({'isolationLevel':db[_0x989b('0xbf')]['Transaction'][_0x989b('0xc1')][_0x989b('0xc2')]},function(_0x472a4f){return db[_0x989b('0x40')][_0x989b('0x71')]({'where':{'id':_0x5c18d2},'transaction':_0x472a4f})[_0x989b('0x35')](function(_0x1b4633){if(_0x1b4633){return db[_0x989b('0x74')][_0x989b('0x36')]({'where':{'SmsAccountId':_0x5c18d2},'transaction':_0x472a4f})['then'](function(){var _0x3438ae=_['map'](_0xf88c52,function(_0x2d9aef){_0x2d9aef['SmsAccountId']=_0x5c18d2;return _0x2d9aef;});return db[_0x989b('0x74')]['bulkCreate'](_0x3438ae,{'transaction':_0x472a4f});});}else{_0x464509=0x194;_0x2e98ce=[];}});})[_0x989b('0x35')](function(){if(_0x464509!==0x194){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x5c18d2},'order':_0x989b('0x78')})['then'](function(_0x34e8f0){_0x2e98ce=_0x34e8f0;});}})[_0x989b('0x27')](function(_0x6bd032){_0x464509=0x1f4;logger[_0x989b('0x23')](_0x6bd032[_0x989b('0x39')]);if(_0x6bd032[_0x989b('0x3a')]){delete _0x6bd032['name'];}_0x2e98ce=_0x6bd032;})['finally'](function(){if(_0x2e98ce===null){_0x210f4a[_0x989b('0x28')](_0x464509);}else{if(_0x464509===0x1f4){_0x210f4a[_0x989b('0x29')](_0x464509)['send'](_0x2e98ce);}else{_0x210f4a['status'](_0x464509)['json'](_0x2e98ce);}}});};exports[_0x989b('0xc3')]=function(_0x4c482e,_0x2ab6d8,_0x5a5ff6){var _0x565e82={};var _0x106657={};var _0x1a7bdd;var _0x485a41;return db[_0x989b('0x40')]['findOne']({'where':{'id':_0x4c482e[_0x989b('0x59')]['id']}})['then'](handleEntityNotFound(_0x2ab6d8,null))[_0x989b('0x35')](function(_0x41b6c0){if(_0x41b6c0){_0x1a7bdd=_0x41b6c0;_0x106657['model']=_['keys'](db[_0x989b('0x74')]['rawAttributes']);_0x106657[_0x989b('0x4a')]=_[_0x989b('0x5a')](_0x4c482e[_0x989b('0x4a')]);_0x106657[_0x989b('0x4e')]=_['intersection'](_0x106657[_0x989b('0x47')],_0x106657['query']);_0x565e82['attributes']=_['intersection'](_0x106657['model'],qs['fields'](_0x4c482e[_0x989b('0x4a')]['fields']));_0x565e82[_0x989b('0x46')]=_0x565e82[_0x989b('0x46')][_0x989b('0x49')]?_0x565e82[_0x989b('0x46')]:_0x106657[_0x989b('0x47')];_0x565e82['order']=qs['sort'](_0x4c482e[_0x989b('0x4a')]['sort']);_0x565e82[_0x989b('0x51')]=qs[_0x989b('0x4e')](_[_0x989b('0x4f')](_0x4c482e[_0x989b('0x4a')],_0x106657[_0x989b('0x4e')]));if(_0x4c482e[_0x989b('0x4a')][_0x989b('0x50')]){_0x565e82[_0x989b('0x51')]=_['merge'](_0x565e82['where'],{'$or':_['map'](_0x565e82[_0x989b('0x46')],function(_0x2af10c){var _0x47aba7={};_0x47aba7[_0x2af10c]={'$like':'%'+_0x4c482e[_0x989b('0x4a')][_0x989b('0x50')]+'%'};return _0x47aba7;})});}_0x565e82=_[_0x989b('0x52')]({},_0x565e82,_0x4c482e[_0x989b('0x54')]);return _0x1a7bdd['getApplications'](_0x565e82);}})[_0x989b('0x35')](function(_0x166432){if(_0x166432){_0x485a41=_0x166432['length'];if(!_0x4c482e[_0x989b('0x4a')][_0x989b('0x4b')](_0x989b('0x4c'))){_0x565e82[_0x989b('0x2e')]=qs[_0x989b('0x2e')](_0x4c482e[_0x989b('0x4a')][_0x989b('0x2e')]);_0x565e82[_0x989b('0x2c')]=qs[_0x989b('0x2c')](_0x4c482e[_0x989b('0x4a')][_0x989b('0x2c')]);}return _0x1a7bdd[_0x989b('0xc3')](_0x565e82);}})[_0x989b('0x35')](function(_0x18663b){if(_0x18663b){return _0x18663b?{'count':_0x485a41,'rows':_0x18663b}:null;}})['then'](respondWithResult(_0x2ab6d8,null))[_0x989b('0x27')](handleError(_0x2ab6d8,null));};exports[_0x989b('0xc4')]=function(_0x29f128,_0x1b103d,_0x47da6b){var _0x3e0204={'raw':![],'where':{}};var _0x1eef88={};var _0x2c2d43={'count':0x0,'rows':[]};return db[_0x989b('0x40')][_0x989b('0x71')]({'where':{'id':_0x29f128[_0x989b('0x59')]['id']}})['then'](handleEntityNotFound(_0x1b103d,null))[_0x989b('0x35')](function(_0x25707c){if(_0x25707c){_0x1eef88[_0x989b('0x47')]=_[_0x989b('0x5a')](db[_0x989b('0xa6')][_0x989b('0x41')]);_0x1eef88['query']=_[_0x989b('0x5a')](_0x29f128[_0x989b('0x4a')]);_0x1eef88[_0x989b('0x4e')]=_[_0x989b('0x45')](_0x1eef88[_0x989b('0x47')],_0x1eef88['query']);_0x3e0204[_0x989b('0x46')]=_[_0x989b('0x45')](_0x1eef88[_0x989b('0x47')],qs[_0x989b('0x48')](_0x29f128['query'][_0x989b('0x48')]));_0x3e0204['attributes']=_0x3e0204[_0x989b('0x46')][_0x989b('0x49')]?_0x3e0204[_0x989b('0x46')]:_0x1eef88[_0x989b('0x47')];if(!_0x29f128['query'][_0x989b('0x4b')](_0x989b('0x4c'))){_0x3e0204[_0x989b('0x2e')]=qs[_0x989b('0x2e')](_0x29f128['query'][_0x989b('0x2e')]);_0x3e0204['offset']=qs[_0x989b('0x2c')](_0x29f128[_0x989b('0x4a')]['offset']);}_0x3e0204['order']=qs[_0x989b('0x4d')](_0x29f128['query'][_0x989b('0x4d')]);_0x3e0204[_0x989b('0x51')]=qs[_0x989b('0x4e')](_['pick'](_0x29f128['query'],_0x1eef88['filters']));_0x3e0204['where'][_0x989b('0x6e')]=_0x25707c['id'];if(_0x29f128['query']['filter']){_0x3e0204['where']=_[_0x989b('0x52')](_0x3e0204[_0x989b('0x51')],{'$or':_[_0x989b('0x3f')](_0x3e0204[_0x989b('0x46')],function(_0x4380f9){var _0x95aad0={};_0x95aad0[_0x4380f9]={'$like':'%'+_0x29f128['query'][_0x989b('0x50')]+'%'};return _0x95aad0;})});}_0x3e0204=_[_0x989b('0x52')]({},_0x3e0204,_0x29f128[_0x989b('0x54')]);return db[_0x989b('0xa6')]['count']({'where':_0x3e0204['where']})['then'](function(_0x3aa996){_0x2c2d43[_0x989b('0x2f')]=_0x3aa996;if(_0x29f128['query'][_0x989b('0x55')]){_0x3e0204[_0x989b('0x5b')]=[{'model':db[_0x989b('0x7a')],'as':_0x989b('0xc5'),'required':![]},{'model':db[_0x989b('0xb3')],'as':'Owner','attributes':[_0x989b('0x3a'),_0x989b('0xc6'),'internal'],'required':![]},{'model':db[_0x989b('0xc7')],'as':_0x989b('0xc8'),'attributes':['id','name','color'],'where':_0x29f128[_0x989b('0x4a')][_0x989b('0xc9')]?{'id':_0x29f128[_0x989b('0x4a')][_0x989b('0xc9')]}:undefined,'required':_0x29f128[_0x989b('0x4a')][_0x989b('0xc9')]?!![]:![]}];}return db['SmsInteraction'][_0x989b('0x56')](_0x3e0204);})[_0x989b('0x35')](function(_0x232673){_0x2c2d43[_0x989b('0x57')]=_0x232673;return _0x2c2d43;});}})[_0x989b('0x35')](respondWithFilteredResult(_0x1b103d,_0x3e0204))[_0x989b('0x27')](handleError(_0x1b103d,null));};exports[_0x989b('0x3b')]=function(_0x21156f,_0x1e44be,_0x1f1104){var _0x2310e6,_0x3c170a,_0x270a06;if(_['isNil'](_0x21156f[_0x989b('0x5e')][_0x989b('0x5e')])||_0x21156f[_0x989b('0x5e')][_0x989b('0x5e')]===''){throw new db['Sequelize'][(_0x989b('0x99'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x989b('0x98')](_0x21156f[_0x989b('0x5e')]['to'])){throw new db[(_0x989b('0x7b'))][(_0x989b('0x99'))](_0x989b('0xca'));}_0x2310e6=_0x21156f['body']['to'];return db['SmsAccount'][_0x989b('0x5c')]({'where':{'id':_0x21156f[_0x989b('0x59')]['id']},'include':[{'model':db[_0x989b('0xa0')],'as':_0x989b('0xcb'),'include':[{'model':db['CmContact'],'as':_0x989b('0xa1'),'where':{'mobile':_0x2310e6},'limit':0x1,'order':[[_0x989b('0x7f'),_0x989b('0xa2')]]}]}]})[_0x989b('0x35')](handleEntityNotFound(_0x1e44be,null))[_0x989b('0x35')](function(_0x59384a){if(_0x59384a&&_0x59384a[_0x989b('0xcb')]){_0x3c170a=_0x59384a[_0x989b('0x37')]({'plain':!![]});if(_0x3c170a[_0x989b('0xcb')]&&_0x3c170a['List'][_0x989b('0xa1')][_0x989b('0x49')]){return _0x3c170a[_0x989b('0xcb')]['Contacts'][0x0];}return db['CmContact']['create'](_['defaults'](_0x21156f['body'],{'firstName':_0x2310e6,'mobile':_0x2310e6,'phone':_0x2310e6,'ListId':_0x3c170a[_0x989b('0x81')]}));}})[_0x989b('0x35')](handleEntityNotFound(_0x1e44be,null))[_0x989b('0x35')](function(_0x533490){if(_0x533490){_0x270a06=_0x533490;return db['SmsInteraction'][_0x989b('0x5c')]({'where':{'ContactId':_0x270a06['id'],'closed':![],'SmsAccountId':_0x3c170a['id']}})['then'](function(_0x341765){if(_0x341765){return[_0x341765,![]];}return db[_0x989b('0xa6')]['create']({'UserId':_0x21156f[_0x989b('0x5f')]['id'],'ContactId':_0x270a06['id'],'SmsAccountId':_0x3c170a['id'],'phone':_0x2310e6,'firstMsgDirection':_0x989b('0xcc'),'Messages':[_[_0x989b('0x52')](_0x21156f['body'],{'read':![],'body':_0x21156f['body'][_0x989b('0x5e')],'phone':_0x2310e6,'SmsAccountId':_0x3c170a['id'],'UserId':_0x21156f[_0x989b('0x5f')]['id'],'ContactId':_0x270a06['id']})]},{'include':[{'model':db[_0x989b('0xcd')],'as':'Messages'}]})[_0x989b('0x35')](function(_0x1f7ec2){return[_0x1f7ec2,!![]];});});}})[_0x989b('0xa7')](function(_0x2a73ef,_0x53df89){if(_0x53df89){return _0x2a73ef;}return db[_0x989b('0xcd')][_0x989b('0x5d')](_[_0x989b('0x52')](_0x21156f[_0x989b('0x5e')],{'read':![],'body':_0x21156f[_0x989b('0x5e')][_0x989b('0x5e')],'phone':_0x2310e6,'SmsAccountId':_0x3c170a['id'],'SmsInteractionId':_0x2a73ef['id'],'UserId':_0x21156f[_0x989b('0x5f')]['id'],'ContactId':_0x270a06['id']}))['then'](function(_0x58e211){_0x2a73ef[_0x989b('0xce')][_0x989b('0xcf')]=[];_0x2a73ef['dataValues']['Messages'][_0x989b('0xab')](_0x58e211['dataValues']);return _0x2a73ef;});})['then'](respondWithResult(_0x1e44be,null))[_0x989b('0x27')](handleError(_0x1e44be,null));};exports['status']=function(_0x4878ba,_0x48ad52,_0x305da2){if(_0x4878ba['body']['id']){delete _0x4878ba[_0x989b('0x5e')]['id'];}var _0x2bd4d6,_0x549b02,_0x53d85a;return db[_0x989b('0x40')][_0x989b('0x5c')]({'where':{'id':_0x4878ba['params']['id']}})[_0x989b('0x35')](handleEntityNotFound(_0x48ad52,null))[_0x989b('0x35')](function(_0x8caebb){if(_0x8caebb){_0x53d85a=_0x8caebb;logger[_0x989b('0x21')](_0x989b('0xba'),_0x989b('0x29'),'received\x20delivery\x20report\x20from',_0x8caebb[_0x989b('0x43')],util[_0x989b('0xd0')](_0x4878ba[_0x989b('0x5e')],{'showHidden':![],'depth':null}));switch(_0x8caebb[_0x989b('0x43')]){case _0x989b('0xd1'):if(_0x4878ba['body'][_0x989b('0xd2')]&&_0x4878ba[_0x989b('0x5e')][_0x989b('0x29')]){_0x549b02=_0x4878ba[_0x989b('0x5e')][_0x989b('0x29')];return db[_0x989b('0xcd')]['find']({'where':{'messageId':_0x4878ba[_0x989b('0x5e')][_0x989b('0xd2')]}});}break;case _0x989b('0x88'):if(_0x4878ba[_0x989b('0x5e')][_0x989b('0xd3')]&&_0x4878ba[_0x989b('0x5e')][_0x989b('0xd4')]){_0x549b02=_0x4878ba[_0x989b('0x5e')][_0x989b('0xd4')];return db['SmsMessage'][_0x989b('0x5c')]({'where':{'messageId':_0x4878ba[_0x989b('0x5e')][_0x989b('0xd3')]}});}break;case'clicksend':if(_0x4878ba['body'][_0x989b('0x8b')]&&_0x4878ba['body'][_0x989b('0xd5')]){_0x549b02=_0x4878ba[_0x989b('0x5e')][_0x989b('0xd5')];return db[_0x989b('0xcd')][_0x989b('0x5c')]({'where':{'messageId':_0x4878ba[_0x989b('0x5e')][_0x989b('0x8b')]}});}break;case _0x989b('0x90'):var _0xc42100=_0x4878ba[_0x989b('0x5e')][_0x989b('0x91')][0x0];if(_0xc42100[_0x989b('0x8a')]&&_0xc42100[_0x989b('0x29')][_0x989b('0xd6')]===_0x989b('0xd7')){_0x549b02=_0xc42100[_0x989b('0x29')][_0x989b('0xd6')];return db[_0x989b('0xcd')]['find']({'where':{'messageId':_0xc42100[_0x989b('0x8a')]}});}break;case _0x989b('0x93'):if(_0x4878ba['body'][_0x989b('0x8a')]&&_0x4878ba[_0x989b('0x5e')]['status']){_0x549b02=_0x4878ba[_0x989b('0x5e')][_0x989b('0x29')];return db[_0x989b('0xcd')][_0x989b('0x5c')]({'where':{'messageId':_0x4878ba[_0x989b('0x5e')][_0x989b('0x8a')]}});}break;case _0x989b('0x96'):if(_0x4878ba[_0x989b('0x5e')][0x0]['message']['id']){_0x549b02=_0x4878ba[_0x989b('0x5e')][0x0][_0x989b('0x43')];return db[_0x989b('0xcd')][_0x989b('0x5c')]({'where':{'messageId':_0x4878ba[_0x989b('0x5e')][0x0][_0x989b('0x25')]['id']}});}break;case'intelepeer':if(_0x4878ba[_0x989b('0x5e')][_0x989b('0xd8')]&&_0x4878ba['body'][_0x989b('0x29')]){_0x549b02=_0x4878ba[_0x989b('0x5e')][_0x989b('0x29')];return db[_0x989b('0xcd')]['find']({'where':{'messageId':_0x4878ba['body'][_0x989b('0xd8')]}});}break;}}})[_0x989b('0x35')](handleEntityNotFound(_0x48ad52,null))[_0x989b('0x35')](function(_0x27872b){if(_0x27872b){_0x2bd4d6=_0x27872b;switch(_0x53d85a[_0x989b('0x43')]){case _0x989b('0xd1'):if(_0x549b02===_0x989b('0xd7')){return _0x2bd4d6[_0x989b('0x34')]({'read':!![]});}else{logger[_0x989b('0x23')](_0x989b('0xba'),_0x989b('0x29'),'skebby',util[_0x989b('0xd0')](_0x4878ba[_0x989b('0x5e')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x549b02==='1'){return _0x2bd4d6[_0x989b('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x989b('0x29'),_0x989b('0xd1'),util[_0x989b('0xd0')](_0x4878ba[_0x989b('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x989b('0x89'):if(!_0x4878ba[_0x989b('0x5e')][_0x989b('0xd9')]&&_0x549b02>=0xc8&&_0x549b02<=0xce){return _0x2bd4d6[_0x989b('0x34')]({'read':!![]});}else{logger[_0x989b('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x989b('0x29'),_0x989b('0x89'),util['inspect'](_0x4878ba[_0x989b('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x989b('0x90'):var _0x4ea4e0=_0x4878ba[_0x989b('0x5e')][_0x989b('0x91')][0x0];if(_0x4ea4e0[_0x989b('0x29')]['groupName']===_0x989b('0xd7')){return _0x2bd4d6[_0x989b('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x989b('0x29'),_0x989b('0x90'),util[_0x989b('0xd0')](_0x4878ba[_0x989b('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x989b('0x93'):if(_0x549b02=='DELIVERED_TO_GATEWAY'||_0x549b02=='RECEIVED_BY_RECIPIENT'){return _0x2bd4d6[_0x989b('0x34')]({'read':!![]});}else{logger[_0x989b('0x23')](_0x989b('0xba'),_0x989b('0x29'),_0x989b('0x93'),util[_0x989b('0xd0')](_0x4878ba['body'],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x549b02==_0x989b('0xda')){return _0x2bd4d6[_0x989b('0x34')]({'read':!![]});}else{logger[_0x989b('0x23')](_0x989b('0xba'),_0x989b('0x29'),_0x989b('0x96'),util[_0x989b('0xd0')](_0x4878ba[_0x989b('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x989b('0xdb'):if(_0x549b02===_0x989b('0xdc')||_0x549b02===_0x989b('0xdd')){return _0x2bd4d6['update']({'read':!![]});}else{logger[_0x989b('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x989b('0x29'),'intelepeer',util[_0x989b('0xd0')](_0x4878ba['body'],{'showHidden':![],'depth':null}));}break;}return _0x2bd4d6;}})[_0x989b('0x35')](respondWithResult(_0x48ad52,null))[_0x989b('0x27')](handleError(_0x48ad52,null));};exports['statusGet']=function(_0x133b9c,_0x3b01ca,_0x383127){var _0xf17f3c,_0x407bb0,_0x36092e;return db[_0x989b('0x40')][_0x989b('0x5c')]({'where':{'id':_0x133b9c['params']['id']}})[_0x989b('0x35')](handleEntityNotFound(_0x3b01ca,null))['then'](function(_0x364d32){if(_0x364d32){_0x36092e=_0x364d32;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x989b('0x29'),_0x989b('0xde'),_0x364d32[_0x989b('0x43')],util['inspect'](_0x133b9c[_0x989b('0x4a')],{'showHidden':![],'depth':null}));switch(_0x364d32[_0x989b('0x43')]){case _0x989b('0xdf'):if(_0x133b9c[_0x989b('0x4a')][_0x989b('0xe0')]&&_0x133b9c[_0x989b('0x4a')][_0x989b('0xe1')]){_0x407bb0=_0x133b9c[_0x989b('0x4a')][_0x989b('0xe1')];return db[_0x989b('0xcd')][_0x989b('0x5c')]({'where':{'messageId':_0x133b9c[_0x989b('0x4a')][_0x989b('0xe0')]}});}break;}}})['then'](handleEntityNotFound(_0x3b01ca,null))[_0x989b('0x35')](function(_0x15cba8){if(_0x15cba8){_0xf17f3c=_0x15cba8;switch(_0x36092e[_0x989b('0x43')]){case _0x989b('0xdf'):if(_0x407bb0==='2'||_0x407bb0==='6'){return _0xf17f3c[_0x989b('0x34')]({'read':!![]});}else{logger[_0x989b('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x989b('0x29'),_0x989b('0xdf'),util[_0x989b('0xd0')](_0x133b9c[_0x989b('0x4a')],{'showHidden':![],'depth':null}));};break;}return _0xf17f3c;}})[_0x989b('0x35')](respondWithResult(_0x3b01ca,null))['catch'](handleError(_0x3b01ca,null));};exports[_0x989b('0xe2')]=function(_0xb9f41f,_0x3eb339,_0x355b14){return db['SmsAccount']['find']({'where':{'id':_0xb9f41f[_0x989b('0x59')]['id']}})['then'](handleEntityNotFound(_0x3eb339,null))[_0x989b('0x35')](function(_0xf987a7){if(_0xf987a7){return _0xf987a7[_0x989b('0xe2')](_0xb9f41f[_0x989b('0x5e')][_0x989b('0x6c')],_[_0x989b('0xa4')](_0xb9f41f['body'],[_0x989b('0x6c'),'id'])||{})['spread'](function(_0x5e7929){for(var _0x273223=0x0;_0x273223<_0xb9f41f['body'][_0x989b('0x6c')][_0x989b('0x49')];_0x273223+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0xb9f41f[_0x989b('0x5e')][_0x989b('0x6c')][_0x273223]),'SmsAccountId':Number(_0xb9f41f[_0x989b('0x59')]['id'])});}return _0x5e7929;});}})[_0x989b('0x35')](respondWithResult(_0x3eb339,null))['catch'](handleError(_0x3eb339,null));};exports['removeAgents']=function(_0x19af61,_0x2d8761,_0x13ac09){return db['SmsAccount']['find']({'where':{'id':_0x19af61[_0x989b('0x59')]['id']}})[_0x989b('0x35')](handleEntityNotFound(_0x2d8761,null))[_0x989b('0x35')](function(_0x5174c6){if(_0x5174c6){return _0x5174c6[_0x989b('0xe3')](_0x19af61['query'][_0x989b('0x6c')])[_0x989b('0x35')](function(){if(_[_0x989b('0xe4')](_0x19af61[_0x989b('0x4a')][_0x989b('0x6c')])){for(var _0x462047=0x0;_0x462047<_0x19af61[_0x989b('0x4a')][_0x989b('0x6c')][_0x989b('0x49')];_0x462047+=0x1){socket['emit'](_0x989b('0xe5'),{'UserId':Number(_0x19af61['query']['ids'][_0x462047]),'SmsAccountId':Number(_0x19af61[_0x989b('0x59')]['id'])});}}else{socket[_0x989b('0xe6')](_0x989b('0xe5'),{'UserId':Number(_0x19af61[_0x989b('0x4a')][_0x989b('0x6c')]),'SmsAccountId':Number(_0x19af61[_0x989b('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x2d8761,null))[_0x989b('0x27')](handleError(_0x2d8761,null));};exports[_0x989b('0xe7')]=function(_0x12e036,_0xed8f07,_0x4ac0b4){var _0x1bdab9={};var _0x20da00={};var _0x2bf7d5;var _0x32557c;return db[_0x989b('0x40')][_0x989b('0x71')]({'where':{'id':_0x12e036[_0x989b('0x59')]['id']}})[_0x989b('0x35')](handleEntityNotFound(_0xed8f07,null))[_0x989b('0x35')](function(_0x5d4166){if(_0x5d4166){_0x2bf7d5=_0x5d4166;_0x20da00['model']=_[_0x989b('0x5a')](db['User']['rawAttributes']);_0x20da00[_0x989b('0x4a')]=_['keys'](_0x12e036[_0x989b('0x4a')]);_0x20da00['filters']=_['intersection'](_0x20da00[_0x989b('0x47')],_0x20da00[_0x989b('0x4a')]);_0x1bdab9[_0x989b('0x46')]=_[_0x989b('0x45')](_0x20da00['model'],qs['fields'](_0x12e036['query']['fields']));_0x1bdab9[_0x989b('0x46')]=_0x1bdab9['attributes'][_0x989b('0x49')]?_0x1bdab9[_0x989b('0x46')]:_0x20da00[_0x989b('0x47')];_0x1bdab9[_0x989b('0x69')]=qs[_0x989b('0x4d')](_0x12e036[_0x989b('0x4a')][_0x989b('0x4d')]);_0x1bdab9['where']=qs[_0x989b('0x4e')](_[_0x989b('0x4f')](_0x12e036[_0x989b('0x4a')],_0x20da00[_0x989b('0x4e')]));if(_0x12e036[_0x989b('0x4a')][_0x989b('0x50')]){_0x1bdab9['where']=_[_0x989b('0x52')](_0x1bdab9[_0x989b('0x51')],{'$or':_[_0x989b('0x3f')](_0x1bdab9[_0x989b('0x46')],function(_0x54106b){var _0x158d1d={};_0x158d1d[_0x54106b]={'$like':'%'+_0x12e036['query'][_0x989b('0x50')]+'%'};return _0x158d1d;})});}_0x1bdab9=_['merge']({},_0x1bdab9,_0x12e036[_0x989b('0x54')]);return _0x2bf7d5['getAgents'](_0x1bdab9);}})[_0x989b('0x35')](function(_0x23bf00){if(_0x23bf00){_0x32557c=_0x23bf00[_0x989b('0x49')];if(!_0x12e036[_0x989b('0x4a')]['hasOwnProperty'](_0x989b('0x4c'))){_0x1bdab9[_0x989b('0x2e')]=qs['limit'](_0x12e036['query'][_0x989b('0x2e')]);_0x1bdab9[_0x989b('0x2c')]=qs['offset'](_0x12e036[_0x989b('0x4a')]['offset']);}return _0x2bf7d5[_0x989b('0xe7')](_0x1bdab9);}})['then'](function(_0x3eeea8){if(_0x3eeea8){return _0x3eeea8?{'count':_0x32557c,'rows':_0x3eeea8}:null;}})['then'](respondWithResult(_0xed8f07,null))[_0x989b('0x27')](handleError(_0xed8f07,null));}; \ No newline at end of file +var _0xe052=['Disposition','findOne','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','applications','orderBy','Applications','priority','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','from','From','MessageSid','skebby','sender','text','connectel','messageId','message_id','plivo','Text','MessageUUID','infobip','originatingAddress','segmentedMessage','clickatell','replyMessageId','bandwidth','intelepeer','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','CmList','DESC','Contacts','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Owner','fullname','internal','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','requestid','statusInt','status_code','results','groupName','redif','DELIVERED','inspect','clicksend','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','statusGet','message-id','state','csc','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','apply','save','update','get','destroy','end','stack','name','send','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','SmsAccounts','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','SmsAccountId'];(function(_0x15f218,_0x5114f3){var _0x1607e5=function(_0x1932c0){while(--_0x1932c0){_0x15f218['push'](_0x15f218['shift']());}};_0x1607e5(++_0x5114f3);}(_0xe052,0x80));var _0x2e05=function(_0x33da1d,_0xdaa2ae){_0x33da1d=_0x33da1d-0x0;var _0x4bc816=_0xe052[_0x33da1d];return _0x4bc816;};'use strict';var emlformat=require(_0x2e05('0x0'));var rimraf=require(_0x2e05('0x1'));var zipdir=require(_0x2e05('0x2'));var jsonpatch=require(_0x2e05('0x3'));var rp=require('request-promise');var moment=require(_0x2e05('0x4'));var BPromise=require(_0x2e05('0x5'));var Mustache=require('mustache');var util=require(_0x2e05('0x6'));var path=require(_0x2e05('0x7'));var sox=require(_0x2e05('0x8'));var csv=require('to-csv');var ejs=require(_0x2e05('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2e05('0xa'));var squel=require('squel');var crypto=require(_0x2e05('0xb'));var jsforce=require(_0x2e05('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2e05('0xd'));var Papa=require('papaparse');var Redis=require(_0x2e05('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2e05('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2e05('0x10'))['db'];config[_0x2e05('0x11')]=_[_0x2e05('0x12')](config['redis'],{'host':_0x2e05('0x13'),'port':0x18eb});var socket=require(_0x2e05('0x14'))(new Redis(config[_0x2e05('0x11')]));require('./smsAccount.socket')[_0x2e05('0x15')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2e05('0x16')][_0x2e05('0x17')]({'port':0x232c});function respondWithRpcPromise(_0x187374,_0x46a39a,_0x275b90,_0x114801){return new BPromise(function(_0x1f5514,_0x29bcc2){var _0x3f310d=_0x114801||client;return _0x3f310d[_0x2e05('0x18')](_0x187374,_0x275b90)[_0x2e05('0x19')](function(_0x67bb6){logger[_0x2e05('0x1a')]('SmsAccount,\x20%s,\x20%s',_0x46a39a,_0x2e05('0x1b'));logger[_0x2e05('0x1c')](_0x2e05('0x1d'),_0x46a39a,_0x2e05('0x1b'),JSON[_0x2e05('0x1e')](_0x67bb6));if(_0x67bb6[_0x2e05('0x1f')]){if(_0x67bb6[_0x2e05('0x1f')][_0x2e05('0x20')]===0x1f4){logger[_0x2e05('0x1f')](_0x2e05('0x21'),_0x46a39a,_0x67bb6[_0x2e05('0x1f')][_0x2e05('0x22')]);return _0x29bcc2(_0x67bb6[_0x2e05('0x1f')][_0x2e05('0x22')]);}logger[_0x2e05('0x1f')](_0x2e05('0x21'),_0x46a39a,_0x67bb6['error'][_0x2e05('0x22')]);return _0x1f5514(_0x67bb6['error'][_0x2e05('0x22')]);}else{logger[_0x2e05('0x1a')]('SmsAccount,\x20%s,\x20%s',_0x46a39a,'request\x20sent');_0x1f5514(_0x67bb6[_0x2e05('0x23')][_0x2e05('0x22')]);}})[_0x2e05('0x24')](function(_0x5c3690){logger[_0x2e05('0x1f')](_0x2e05('0x21'),_0x46a39a,_0x5c3690);_0x29bcc2(_0x5c3690);});});}function respondWithStatusCode(_0xe85e60,_0x129e41){_0x129e41=_0x129e41||0xcc;return function(_0x451386){if(_0x451386){return _0xe85e60[_0x2e05('0x25')](_0x129e41);}return _0xe85e60['status'](_0x129e41)['end']();};}function respondWithResult(_0x5a2df0,_0x35d3a6){_0x35d3a6=_0x35d3a6||0xc8;return function(_0x3c1d19){if(_0x3c1d19){return _0x5a2df0[_0x2e05('0x26')](_0x35d3a6)[_0x2e05('0x27')](_0x3c1d19);}};}function respondWithFilteredResult(_0x293a4d,_0x3a7c44){return function(_0x5b486f){if(_0x5b486f){var _0x13eb48=typeof _0x3a7c44['offset']===_0x2e05('0x28')&&typeof _0x3a7c44[_0x2e05('0x29')]===_0x2e05('0x28');var _0x135f4f=_0x5b486f[_0x2e05('0x2a')];var _0x3b9431=_0x13eb48?0x0:_0x3a7c44[_0x2e05('0x2b')];var _0x2ea2d8=_0x13eb48?_0x5b486f[_0x2e05('0x2a')]:_0x3a7c44['offset']+_0x3a7c44[_0x2e05('0x29')];var _0x7dee60;if(_0x2ea2d8>=_0x135f4f){_0x2ea2d8=_0x135f4f;_0x7dee60=0xc8;}else{_0x7dee60=0xce;}_0x293a4d[_0x2e05('0x26')](_0x7dee60);return _0x293a4d['set']('Content-Range',_0x3b9431+'-'+_0x2ea2d8+'/'+_0x135f4f)['json'](_0x5b486f);}return null;};}function patchUpdates(_0x417eb4){return function(_0x4c9748){try{jsonpatch[_0x2e05('0x2c')](_0x4c9748,_0x417eb4,!![]);}catch(_0x5f24ac){return BPromise['reject'](_0x5f24ac);}return _0x4c9748[_0x2e05('0x2d')]();};}function saveUpdates(_0x420c9e,_0x4365e6){return function(_0x52370c){if(_0x52370c){return _0x52370c[_0x2e05('0x2e')](_0x420c9e)[_0x2e05('0x19')](function(_0x2df538){return _0x2df538;});}return null;};}function removeEntity(_0x2d7654,_0x206d2b){return function(_0x26377b){if(_0x26377b){return _0x26377b['destroy']()[_0x2e05('0x19')](function(){var _0x5dba69=_0x26377b[_0x2e05('0x2f')]({'plain':!![]});var _0x3c8ab0='SmsAccounts';return db['UserProfileResource'][_0x2e05('0x30')]({'where':{'type':_0x3c8ab0,'resourceId':_0x5dba69['id']}})[_0x2e05('0x19')](function(){return _0x26377b;});})['then'](function(){_0x2d7654['status'](0xcc)[_0x2e05('0x31')]();});}};}function handleEntityNotFound(_0x5cfef0,_0x3d6c38){return function(_0x43af45){if(!_0x43af45){_0x5cfef0[_0x2e05('0x25')](0x194);}return _0x43af45;};}function handleError(_0x4c5972,_0x59a2eb){_0x59a2eb=_0x59a2eb||0x1f4;return function(_0x5445a8){logger['error'](_0x5445a8[_0x2e05('0x32')]);if(_0x5445a8[_0x2e05('0x33')]){delete _0x5445a8[_0x2e05('0x33')];}_0x4c5972['status'](_0x59a2eb)[_0x2e05('0x34')](_0x5445a8);};}exports['index']=function(_0x2c1c8a,_0x37139d){var _0x220013={'include':[{'model':db[_0x2e05('0x35')],'as':_0x2e05('0x36')}]},_0x4ba4d4={},_0x5a6b7d={'count':0x0,'rows':[]};var _0x26e374=_[_0x2e05('0x37')](db[_0x2e05('0x38')][_0x2e05('0x39')],function(_0x5e5360){return{'name':_0x5e5360[_0x2e05('0x3a')],'type':_0x5e5360[_0x2e05('0x3b')]['key']};});_0x4ba4d4[_0x2e05('0x3c')]=_[_0x2e05('0x37')](_0x26e374,_0x2e05('0x33'));_0x4ba4d4[_0x2e05('0x3d')]=_[_0x2e05('0x3e')](_0x2c1c8a['query']);_0x4ba4d4[_0x2e05('0x3f')]=_[_0x2e05('0x40')](_0x4ba4d4[_0x2e05('0x3c')],_0x4ba4d4['query']);_0x220013[_0x2e05('0x41')]=_[_0x2e05('0x40')](_0x4ba4d4['model'],qs[_0x2e05('0x42')](_0x2c1c8a[_0x2e05('0x3d')][_0x2e05('0x42')]));_0x220013[_0x2e05('0x41')]=_0x220013['attributes'][_0x2e05('0x43')]?_0x220013[_0x2e05('0x41')]:_0x4ba4d4[_0x2e05('0x3c')];if(!_0x2c1c8a[_0x2e05('0x3d')][_0x2e05('0x44')](_0x2e05('0x45'))){_0x220013['limit']=qs[_0x2e05('0x29')](_0x2c1c8a[_0x2e05('0x3d')][_0x2e05('0x29')]);_0x220013[_0x2e05('0x2b')]=qs[_0x2e05('0x2b')](_0x2c1c8a[_0x2e05('0x3d')]['offset']);}_0x220013[_0x2e05('0x46')]=qs[_0x2e05('0x47')](_0x2c1c8a[_0x2e05('0x3d')]['sort']);_0x220013[_0x2e05('0x48')]=qs[_0x2e05('0x3f')](_[_0x2e05('0x49')](_0x2c1c8a['query'],_0x4ba4d4[_0x2e05('0x3f')]),_0x26e374);if(_0x2c1c8a[_0x2e05('0x3d')][_0x2e05('0x4a')]){_0x220013[_0x2e05('0x48')]=_[_0x2e05('0x4b')](_0x220013['where'],{'$or':_['map'](_0x26e374,function(_0x3d64d1){if(_0x3d64d1[_0x2e05('0x3b')]!==_0x2e05('0x4c')){var _0x5a3036={};_0x5a3036[_0x3d64d1[_0x2e05('0x33')]]={'$like':'%'+_0x2c1c8a[_0x2e05('0x3d')][_0x2e05('0x4a')]+'%'};return _0x5a3036;}})});}_0x220013=_[_0x2e05('0x4b')]({},_0x220013,_0x2c1c8a[_0x2e05('0x4d')]);var _0x1a2fea={'where':_0x220013[_0x2e05('0x48')]};return db[_0x2e05('0x38')][_0x2e05('0x2a')](_0x1a2fea)[_0x2e05('0x19')](function(_0x8b4a9a){_0x5a6b7d[_0x2e05('0x2a')]=_0x8b4a9a;if(_0x2c1c8a[_0x2e05('0x3d')][_0x2e05('0x4e')]){_0x220013[_0x2e05('0x4f')]=[{'all':!![]}];}return db[_0x2e05('0x38')][_0x2e05('0x50')](_0x220013);})[_0x2e05('0x19')](function(_0x3dba75){_0x5a6b7d['rows']=_0x3dba75;return _0x5a6b7d;})[_0x2e05('0x19')](respondWithFilteredResult(_0x37139d,_0x220013))[_0x2e05('0x24')](handleError(_0x37139d,null));};exports[_0x2e05('0x51')]=function(_0x95031e,_0x39cfb9){var _0x56a42e={'raw':![],'where':{'id':_0x95031e[_0x2e05('0x52')]['id']},'include':[{'model':db['Pause'],'as':_0x2e05('0x36')}]},_0x19a308={};_0x19a308[_0x2e05('0x3c')]=_[_0x2e05('0x3e')](db[_0x2e05('0x38')][_0x2e05('0x39')]);_0x19a308['query']=_['keys'](_0x95031e['query']);_0x19a308[_0x2e05('0x3f')]=_[_0x2e05('0x40')](_0x19a308[_0x2e05('0x3c')],_0x19a308[_0x2e05('0x3d')]);_0x56a42e[_0x2e05('0x41')]=_[_0x2e05('0x40')](_0x19a308[_0x2e05('0x3c')],qs[_0x2e05('0x42')](_0x95031e[_0x2e05('0x3d')][_0x2e05('0x42')]));_0x56a42e['attributes']=_0x56a42e['attributes'][_0x2e05('0x43')]?_0x56a42e[_0x2e05('0x41')]:_0x19a308['model'];if(_0x95031e[_0x2e05('0x3d')][_0x2e05('0x4e')]){_0x56a42e['include']=[{'all':!![]}];}_0x56a42e=_['merge']({},_0x56a42e,_0x95031e[_0x2e05('0x4d')]);return db[_0x2e05('0x38')][_0x2e05('0x53')](_0x56a42e)[_0x2e05('0x19')](handleEntityNotFound(_0x39cfb9,null))[_0x2e05('0x19')](respondWithResult(_0x39cfb9,null))[_0x2e05('0x24')](handleError(_0x39cfb9,null));};exports['create']=function(_0x5bad88,_0x464760){return db[_0x2e05('0x38')][_0x2e05('0x54')](_0x5bad88['body'],{})['then'](function(_0x178e8f){var _0x52ff6a=_0x5bad88[_0x2e05('0x55')][_0x2e05('0x2f')]({'plain':!![]});if(!_0x52ff6a)throw new Error(_0x2e05('0x56'));if(_0x52ff6a['role']==='user'){var _0xf00320=_0x178e8f[_0x2e05('0x2f')]({'plain':!![]});var _0x35a1f7=_0x2e05('0x57');return db['UserProfileSection'][_0x2e05('0x53')]({'where':{'name':_0x35a1f7,'userProfileId':_0x52ff6a[_0x2e05('0x58')]},'raw':!![]})[_0x2e05('0x19')](function(_0x108334){if(_0x108334&&_0x108334['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xf00320[_0x2e05('0x33')],'resourceId':_0xf00320['id'],'type':_0x108334['name'],'sectionId':_0x108334['id']},{})[_0x2e05('0x19')](function(){return _0x178e8f;});}else{return _0x178e8f;}})[_0x2e05('0x24')](function(_0x8d399d){logger['error'](_0x2e05('0x59'),_0x8d399d);throw _0x8d399d;});}return _0x178e8f;})['then'](respondWithResult(_0x464760,0xc9))['catch'](handleError(_0x464760,null));};exports[_0x2e05('0x2e')]=function(_0x101163,_0x57438a){if(_0x101163[_0x2e05('0x5a')]['id']){delete _0x101163[_0x2e05('0x5a')]['id'];}return db[_0x2e05('0x38')]['find']({'where':{'id':_0x101163[_0x2e05('0x52')]['id']},'include':[{'model':db[_0x2e05('0x35')],'as':_0x2e05('0x36')}]})[_0x2e05('0x19')](handleEntityNotFound(_0x57438a,null))[_0x2e05('0x19')](saveUpdates(_0x101163['body'],null))[_0x2e05('0x19')](respondWithResult(_0x57438a,null))[_0x2e05('0x24')](handleError(_0x57438a,null));};exports[_0x2e05('0x30')]=function(_0x46709c,_0x4d4288){return db[_0x2e05('0x38')][_0x2e05('0x53')]({'where':{'id':_0x46709c[_0x2e05('0x52')]['id']}})[_0x2e05('0x19')](handleEntityNotFound(_0x4d4288,null))[_0x2e05('0x19')](removeEntity(_0x4d4288,null))[_0x2e05('0x24')](handleError(_0x4d4288,null));};exports[_0x2e05('0x5b')]=function(_0x5c7ffb,_0x4cdf78){return db['SmsAccount'][_0x2e05('0x5b')]()[_0x2e05('0x19')](respondWithResult(_0x4cdf78,null))[_0x2e05('0x24')](handleError(_0x4cdf78,null));};exports[_0x2e05('0x5c')]=function(_0x538a46,_0x5f0b00,_0x3c7313){if(_0x538a46['body']['id']){delete _0x538a46[_0x2e05('0x5a')]['id'];}return db[_0x2e05('0x38')][_0x2e05('0x53')]({'where':{'id':_0x538a46[_0x2e05('0x52')]['id']}})['then'](handleEntityNotFound(_0x5f0b00,null))['then'](function(_0x2d6943){if(_0x2d6943){_0x538a46[_0x2e05('0x5a')][_0x2e05('0x5d')]=_0x2d6943['id'];return db[_0x2e05('0x5e')]['create'](_0x538a46[_0x2e05('0x5a')]);}})[_0x2e05('0x19')](respondWithResult(_0x5f0b00,null))[_0x2e05('0x24')](handleError(_0x5f0b00,null));};exports['getDispositions']=function(_0x54cb4f,_0x4b7c9e,_0x169cf2){var _0x3c52c7={'raw':![],'where':{}};var _0x4d640a={};var _0x5cd9b8={'count':0x0,'rows':[]};return db[_0x2e05('0x38')][_0x2e05('0x5f')]({'where':{'id':_0x54cb4f[_0x2e05('0x52')]['id']}})[_0x2e05('0x19')](handleEntityNotFound(_0x4b7c9e,null))[_0x2e05('0x19')](function(_0x22e439){if(_0x22e439){_0x4d640a[_0x2e05('0x3c')]=_['keys'](db[_0x2e05('0x5e')][_0x2e05('0x39')]);_0x4d640a[_0x2e05('0x3d')]=_[_0x2e05('0x3e')](_0x54cb4f[_0x2e05('0x3d')]);_0x4d640a['filters']=_[_0x2e05('0x40')](_0x4d640a[_0x2e05('0x3c')],_0x4d640a[_0x2e05('0x3d')]);_0x3c52c7[_0x2e05('0x41')]=_[_0x2e05('0x40')](_0x4d640a[_0x2e05('0x3c')],qs[_0x2e05('0x42')](_0x54cb4f[_0x2e05('0x3d')]['fields']));_0x3c52c7['attributes']=_0x3c52c7['attributes']['length']?_0x3c52c7['attributes']:_0x4d640a[_0x2e05('0x3c')];if(!_0x54cb4f[_0x2e05('0x3d')]['hasOwnProperty'](_0x2e05('0x45'))){_0x3c52c7[_0x2e05('0x29')]=qs['limit'](_0x54cb4f[_0x2e05('0x3d')][_0x2e05('0x29')]);_0x3c52c7['offset']=qs[_0x2e05('0x2b')](_0x54cb4f[_0x2e05('0x3d')][_0x2e05('0x2b')]);}_0x3c52c7[_0x2e05('0x46')]=qs[_0x2e05('0x47')](_0x54cb4f[_0x2e05('0x3d')][_0x2e05('0x47')]);_0x3c52c7[_0x2e05('0x48')]=qs[_0x2e05('0x3f')](_[_0x2e05('0x49')](_0x54cb4f[_0x2e05('0x3d')],_0x4d640a[_0x2e05('0x3f')]));_0x3c52c7['where'][_0x2e05('0x5d')]=_0x22e439['id'];if(_0x54cb4f['query'][_0x2e05('0x4a')]){_0x3c52c7[_0x2e05('0x48')]=_[_0x2e05('0x4b')](_0x3c52c7[_0x2e05('0x48')],{'$or':_[_0x2e05('0x37')](_0x3c52c7[_0x2e05('0x41')],function(_0xf462b9){var _0x3d8421={};_0x3d8421[_0xf462b9]={'$like':'%'+_0x54cb4f[_0x2e05('0x3d')][_0x2e05('0x4a')]+'%'};return _0x3d8421;})});}_0x3c52c7=_['merge']({},_0x3c52c7,_0x54cb4f[_0x2e05('0x4d')]);return db[_0x2e05('0x5e')][_0x2e05('0x2a')]({'where':_0x3c52c7[_0x2e05('0x48')]})[_0x2e05('0x19')](function(_0x219fdb){_0x5cd9b8[_0x2e05('0x2a')]=_0x219fdb;if(_0x54cb4f[_0x2e05('0x3d')][_0x2e05('0x4e')]){_0x3c52c7[_0x2e05('0x4f')]=[{'all':!![]}];}return db['Disposition'][_0x2e05('0x50')](_0x3c52c7);})[_0x2e05('0x19')](function(_0x43dede){_0x5cd9b8[_0x2e05('0x60')]=_0x43dede;return _0x5cd9b8;});}})[_0x2e05('0x19')](respondWithFilteredResult(_0x4b7c9e,_0x3c52c7))[_0x2e05('0x24')](handleError(_0x4b7c9e,null));};exports[_0x2e05('0x61')]=function(_0x12ab98,_0x4e3047,_0x461eeb){return db[_0x2e05('0x38')]['find']({'where':{'id':_0x12ab98[_0x2e05('0x52')]['id']}})[_0x2e05('0x19')](handleEntityNotFound(_0x4e3047,null))[_0x2e05('0x19')](function(_0x213430){if(_0x213430){return _0x213430[_0x2e05('0x61')](_0x12ab98[_0x2e05('0x3d')][_0x2e05('0x62')]);}})['then'](respondWithStatusCode(_0x4e3047,null))[_0x2e05('0x24')](handleError(_0x4e3047,null));};exports[_0x2e05('0x63')]=function(_0x4f2d70,_0x288cd2,_0x2fd804){if(_0x4f2d70['body']['id']){delete _0x4f2d70[_0x2e05('0x5a')]['id'];}return db['SmsAccount'][_0x2e05('0x53')]({'where':{'id':_0x4f2d70[_0x2e05('0x52')]['id']}})['then'](handleEntityNotFound(_0x288cd2,null))[_0x2e05('0x19')](function(_0x53ca20){if(_0x53ca20){_0x4f2d70['body']['SmsAccountId']=_0x53ca20['id'];return db[_0x2e05('0x64')][_0x2e05('0x54')](_0x4f2d70[_0x2e05('0x5a')]);}})[_0x2e05('0x19')](respondWithResult(_0x288cd2,null))[_0x2e05('0x24')](handleError(_0x288cd2,null));};exports[_0x2e05('0x65')]=function(_0x494d83,_0x1bdb1f,_0x2f503c){var _0x3872ea={'raw':![],'where':{}};var _0x3af7c7={};var _0x3d1119={'count':0x0,'rows':[]};return db[_0x2e05('0x38')][_0x2e05('0x5f')]({'where':{'id':_0x494d83[_0x2e05('0x52')]['id']}})[_0x2e05('0x19')](handleEntityNotFound(_0x1bdb1f,null))['then'](function(_0x55409c){if(_0x55409c){_0x3af7c7[_0x2e05('0x3c')]=_[_0x2e05('0x3e')](db[_0x2e05('0x64')][_0x2e05('0x39')]);_0x3af7c7[_0x2e05('0x3d')]=_[_0x2e05('0x3e')](_0x494d83[_0x2e05('0x3d')]);_0x3af7c7[_0x2e05('0x3f')]=_['intersection'](_0x3af7c7['model'],_0x3af7c7[_0x2e05('0x3d')]);_0x3872ea['attributes']=_['intersection'](_0x3af7c7[_0x2e05('0x3c')],qs[_0x2e05('0x42')](_0x494d83[_0x2e05('0x3d')][_0x2e05('0x42')]));_0x3872ea[_0x2e05('0x41')]=_0x3872ea[_0x2e05('0x41')][_0x2e05('0x43')]?_0x3872ea['attributes']:_0x3af7c7[_0x2e05('0x3c')];if(!_0x494d83[_0x2e05('0x3d')]['hasOwnProperty'](_0x2e05('0x45'))){_0x3872ea['limit']=qs['limit'](_0x494d83[_0x2e05('0x3d')][_0x2e05('0x29')]);_0x3872ea[_0x2e05('0x2b')]=qs[_0x2e05('0x2b')](_0x494d83[_0x2e05('0x3d')][_0x2e05('0x2b')]);}_0x3872ea[_0x2e05('0x46')]=qs['sort'](_0x494d83[_0x2e05('0x3d')][_0x2e05('0x47')]);_0x3872ea['where']=qs['filters'](_[_0x2e05('0x49')](_0x494d83[_0x2e05('0x3d')],_0x3af7c7[_0x2e05('0x3f')]));_0x3872ea['where'][_0x2e05('0x5d')]=_0x55409c['id'];if(_0x494d83[_0x2e05('0x3d')]['filter']){_0x3872ea[_0x2e05('0x48')]=_[_0x2e05('0x4b')](_0x3872ea[_0x2e05('0x48')],{'$or':_[_0x2e05('0x37')](_0x3872ea[_0x2e05('0x41')],function(_0x13eed6){var _0x5d28af={};_0x5d28af[_0x13eed6]={'$like':'%'+_0x494d83['query']['filter']+'%'};return _0x5d28af;})});}_0x3872ea=_[_0x2e05('0x4b')]({},_0x3872ea,_0x494d83['options']);return db['CannedAnswer'][_0x2e05('0x2a')]({'where':_0x3872ea[_0x2e05('0x48')]})[_0x2e05('0x19')](function(_0x3ac963){_0x3d1119['count']=_0x3ac963;if(_0x494d83['query'][_0x2e05('0x4e')]){_0x3872ea['include']=[{'all':!![]}];}return db[_0x2e05('0x64')][_0x2e05('0x50')](_0x3872ea);})['then'](function(_0x4c707b){_0x3d1119[_0x2e05('0x60')]=_0x4c707b;return _0x3d1119;});}})[_0x2e05('0x19')](respondWithFilteredResult(_0x1bdb1f,_0x3872ea))[_0x2e05('0x24')](handleError(_0x1bdb1f,null));};exports[_0x2e05('0x66')]=function(_0x4e0287,_0x2fa84e,_0x1e5db1){return db[_0x2e05('0x38')][_0x2e05('0x53')]({'where':{'id':_0x4e0287['params']['id']}})[_0x2e05('0x19')](handleEntityNotFound(_0x2fa84e,null))[_0x2e05('0x19')](function(_0x18d849){if(_0x18d849){return _0x18d849[_0x2e05('0x66')](_0x4e0287[_0x2e05('0x3d')]['ids']);}})[_0x2e05('0x19')](respondWithStatusCode(_0x2fa84e,null))[_0x2e05('0x24')](handleError(_0x2fa84e,null));};exports[_0x2e05('0x67')]=function(_0x28baed,_0x421d81,_0x317886){var _0x24c968={'channel':_0x2e05('0x68')};var _0x3f8484=[];var _0xd4e6e2=[];var _0x51a7f2={};return db[_0x2e05('0x38')][_0x2e05('0x53')]({'where':{'id':_0x28baed['params']['id']},'include':[{'model':db[_0x2e05('0x69')],'as':'Applications'}]})[_0x2e05('0x19')](handleEntityNotFound(_0x421d81,null))[_0x2e05('0x19')](function(_0x24b181){_0x24c968['account']=_0x24b181;_0x24c968[_0x2e05('0x6a')]=_[_0x2e05('0x6b')](_0x24b181[_0x2e05('0x6c')],[_0x2e05('0x6d')],[_0x2e05('0x6e')]);if(_0x24c968[_0x2e05('0x6f')][_0x2e05('0x6c')]){delete _0x24c968[_0x2e05('0x6f')][_0x2e05('0x6c')];}return db[_0x2e05('0x70')][_0x2e05('0x5b')]();})[_0x2e05('0x19')](function(_0x572d5a){if(!_0x572d5a){throw new db[(_0x2e05('0x71'))][(_0x2e05('0x72'))](_0x2e05('0x73'));}_0x3f8484=_[_0x2e05('0x74')](_[_0x2e05('0x3e')](_0x572d5a),['createdAt',_0x2e05('0x75')]);_0xd4e6e2=_[_0x2e05('0x74')](_[_0x2e05('0x3e')](_0x572d5a),[_0x2e05('0x76'),'updatedAt',_0x2e05('0x77'),_0x2e05('0x78')]);_0x24c968[_0x2e05('0x5a')]={'mapKey':_0x2e05('0x79')};if(_0x24c968[_0x2e05('0x6f')][_0x2e05('0x3b')]){switch(_0x24c968[_0x2e05('0x6f')]['type']){case _0x2e05('0x7a'):_0x24c968[_0x2e05('0x5a')][_0x2e05('0x7b')]=_0x28baed[_0x2e05('0x5a')][_0x2e05('0x7c')];_0x24c968['body'][_0x2e05('0x5a')]=_0x28baed[_0x2e05('0x5a')]['Body'];_0x24c968[_0x2e05('0x5a')]['messageId']=_0x28baed[_0x2e05('0x5a')][_0x2e05('0x7d')];break;case _0x2e05('0x7e'):_0x24c968[_0x2e05('0x5a')][_0x2e05('0x7b')]='+'+_0x28baed[_0x2e05('0x5a')][_0x2e05('0x7f')];_0x24c968[_0x2e05('0x5a')][_0x2e05('0x5a')]=_0x28baed['body'][_0x2e05('0x80')];break;case _0x2e05('0x81'):_0x24c968[_0x2e05('0x5a')][_0x2e05('0x7b')]=_0x28baed[_0x2e05('0x5a')][_0x2e05('0x7b')];_0x24c968[_0x2e05('0x5a')]['body']=_0x28baed['body'][_0x2e05('0x22')];break;case'clicksend':_0x24c968['body'][_0x2e05('0x7b')]=_0x28baed['body'][_0x2e05('0x7b')];_0x24c968[_0x2e05('0x5a')][_0x2e05('0x5a')]=_0x28baed['body'][_0x2e05('0x5a')];_0x24c968[_0x2e05('0x5a')][_0x2e05('0x82')]=_0x28baed['body'][_0x2e05('0x83')];break;case _0x2e05('0x84'):_0x24c968[_0x2e05('0x5a')][_0x2e05('0x7b')]=_0x28baed[_0x2e05('0x5a')][_0x2e05('0x7c')];_0x24c968['body'][_0x2e05('0x5a')]=_0x28baed[_0x2e05('0x5a')][_0x2e05('0x85')];_0x24c968[_0x2e05('0x5a')]['messageId']=_0x28baed[_0x2e05('0x5a')][_0x2e05('0x86')];break;case _0x2e05('0x87'):_0x24c968[_0x2e05('0x5a')]['from']='+'+_0x28baed['body']['results'][0x0][_0x2e05('0x7b')];_0x24c968[_0x2e05('0x5a')][_0x2e05('0x5a')]=_0x28baed['body']['results'][0x0][_0x2e05('0x80')];_0x24c968[_0x2e05('0x5a')][_0x2e05('0x82')]=_0x28baed[_0x2e05('0x5a')]['results'][0x0][_0x2e05('0x82')];break;case'csc':_0x24c968[_0x2e05('0x5a')][_0x2e05('0x7b')]=_0x28baed[_0x2e05('0x5a')][_0x2e05('0x88')];_0x24c968[_0x2e05('0x5a')][_0x2e05('0x5a')]=_0x28baed[_0x2e05('0x5a')][_0x2e05('0x89')][_0x2e05('0x22')];break;case _0x2e05('0x8a'):_0x24c968[_0x2e05('0x5a')][_0x2e05('0x7b')]=_0x28baed['body']['fromNumber'];_0x24c968[_0x2e05('0x5a')][_0x2e05('0x5a')]=_0x28baed[_0x2e05('0x5a')][_0x2e05('0x80')];_0x24c968['body']['messageId']=_0x28baed[_0x2e05('0x5a')][_0x2e05('0x8b')];break;case _0x2e05('0x8c'):_0x24c968[_0x2e05('0x5a')][_0x2e05('0x82')]=_0x28baed[_0x2e05('0x5a')][0x0][_0x2e05('0x22')]['id'];_0x24c968[_0x2e05('0x5a')][_0x2e05('0x7b')]=_0x28baed[_0x2e05('0x5a')][0x0][_0x2e05('0x22')]['from'];_0x24c968[_0x2e05('0x5a')][_0x2e05('0x5a')]=_0x28baed[_0x2e05('0x5a')][0x0][_0x2e05('0x22')][_0x2e05('0x80')];break;case _0x2e05('0x8d'):_0x24c968[_0x2e05('0x5a')]['from']=_0x28baed[_0x2e05('0x5a')][_0x2e05('0x7b')];_0x24c968['body'][_0x2e05('0x5a')]=_0x28baed[_0x2e05('0x5a')][_0x2e05('0x22')];_0x24c968[_0x2e05('0x5a')][_0x2e05('0x82')]=_0x28baed[_0x2e05('0x5a')]['refid'];break;}}if(_0x24c968[_0x2e05('0x5a')]['id']){delete _0x24c968['body']['id'];}if(_[_0x2e05('0x8e')](_0x24c968['body']['from'])){throw new db[(_0x2e05('0x71'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x2e05('0x8e')](_0x24c968[_0x2e05('0x5a')][_0x2e05('0x5a')])||_0x24c968[_0x2e05('0x5a')][_0x2e05('0x5a')]===''){throw new db[(_0x2e05('0x71'))][(_0x2e05('0x72'))](_0x2e05('0x8f'));}if(_[_0x2e05('0x8e')](_0x24c968[_0x2e05('0x5a')]['mapKey'])){throw new db[(_0x2e05('0x71'))][(_0x2e05('0x72'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xd4e6e2);}if(!_[_0x2e05('0x90')](_0xd4e6e2,_0x24c968[_0x2e05('0x5a')][_0x2e05('0x91')])){throw new db[(_0x2e05('0x71'))][(_0x2e05('0x72'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xd4e6e2);}_0x51a7f2[_0x24c968['body']['mapKey']]=_0x24c968[_0x2e05('0x5a')][_0x2e05('0x7b')];return db[_0x2e05('0x92')][_0x2e05('0x53')]({'where':{'id':_0x24c968[_0x2e05('0x6f')][_0x2e05('0x78')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x51a7f2,'limit':0x1,'order':[[_0x2e05('0x75'),_0x2e05('0x93')]]}]});})['then'](handleEntityNotFound(_0x421d81,null))[_0x2e05('0x19')](function(_0x1cfde2){if(_0x1cfde2){_0x24c968['list']=_['omit'](_0x1cfde2,['Contacts']);if(_0x1cfde2['Contacts'][_0x2e05('0x43')]){return _0x1cfde2[_0x2e05('0x94')][0x0];}var _0x5a4f6c=_[_0x2e05('0x12')](_0x24c968[_0x2e05('0x5a')],{'firstName':_0x24c968[_0x2e05('0x5a')][_0x2e05('0x7b')],'ListId':_0x1cfde2['id']});_0x5a4f6c[_0x24c968['body'][_0x2e05('0x91')]]=_0x24c968['body'][_0x2e05('0x7b')];return db[_0x2e05('0x70')][_0x2e05('0x54')](_0x5a4f6c,{'fields':_0x3f8484,'raw':!![]});}})[_0x2e05('0x19')](handleEntityNotFound(_0x421d81,null))[_0x2e05('0x19')](function(_0x41aac5){if(_0x41aac5){_0x24c968[_0x2e05('0x95')]=_0x41aac5;var _0x192bb6={'ContactId':_0x41aac5['id'],'phone':_0x24c968[_0x2e05('0x5a')][_0x2e05('0x7b')],'SmsAccountId':_0x28baed[_0x2e05('0x52')]['id']};var _0x522faf={'ContactId':_0x41aac5['id'],'SmsAccountId':_0x28baed[_0x2e05('0x52')]['id'],'closed':![]};return db['SmsInteraction']['find']({'where':_0x522faf})[_0x2e05('0x19')](function(_0x170ee4){if(_0x170ee4){return[_0x170ee4,![]];}return db[_0x2e05('0x96')][_0x2e05('0x54')](_0x192bb6)[_0x2e05('0x19')](function(_0x1c71f7){return[_0x1c71f7,!![]];});});}})[_0x2e05('0x97')](function(_0x370119,_0x11b739){_0x24c968[_0x2e05('0x98')]=_0x370119[_0x2e05('0x2f')]({'plain':!![]});_0x24c968[_0x2e05('0x98')][_0x2e05('0x99')]=![];if(_0x11b739){if(_0x24c968[_0x2e05('0x6f')][_0x2e05('0x9a')]){_0x24c968[_0x2e05('0x6a')][_0x2e05('0x9b')]({'id':0x0,'priority':_0x24c968[_0x2e05('0x6a')][_0x2e05('0x43')]+0x1,'app':_0x2e05('0x9c'),'appdata':_0x2e05('0x9d'),'interval':_0x2e05('0x9e')});}_0x24c968['interaction'][_0x2e05('0x99')]=!![];}return db[_0x2e05('0x9f')][_0x2e05('0x54')]({'phone':_0x24c968[_0x2e05('0x5a')]['from'],'messageId':_0x24c968[_0x2e05('0x5a')][_0x2e05('0x82')],'body':_0x24c968['body'][_0x2e05('0x5a')],'SmsAccountId':_0x28baed[_0x2e05('0x52')]['id'],'SmsInteractionId':_0x370119['id'],'direction':'in','ContactId':_0x370119['ContactId'],'AttachmentId':_0x24c968[_0x2e05('0x5a')][_0x2e05('0xa0')]});})[_0x2e05('0x19')](function(_0x262881){_0x24c968[_0x2e05('0x22')]=_0x262881;if(_0x24c968[_0x2e05('0x98')][_0x2e05('0xa1')]){return db[_0x2e05('0xa2')][_0x2e05('0x53')]({'attributes':['id',_0x2e05('0x33')],'where':{'id':_0x24c968[_0x2e05('0x98')][_0x2e05('0xa1')]}})['then'](function(_0x1750fe){if(_0x1750fe){_0x24c968['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x2e05('0xa3'),'appdata':_0x1750fe['name']+','+(_0x24c968[_0x2e05('0x6f')][_0x2e05('0xa4')]||0xa),'interval':_0x2e05('0x9e')});}return respondWithRpcPromise(_0x2e05('0xa5'),_0x2e05('0xa6'),_0x24c968);});}return respondWithRpcPromise(_0x2e05('0xa5'),_0x2e05('0xa6'),_0x24c968);})[_0x2e05('0x19')](function(_0x495ef6){if(_0x495ef6){var _0xeb9f80=0xc8;var _0x49070b=_0x2e05('0xa7');logger[_0x2e05('0x1a')](_0x2e05('0x1d'),_0x49070b,_0xeb9f80,_0x2e05('0xa8'));logger[_0x2e05('0x1c')](_0x2e05('0xa9'),_0x49070b,_0xeb9f80,_0x2e05('0xa8'),JSON[_0x2e05('0x1e')](_0x495ef6));if(_0x24c968[_0x2e05('0x6f')][_0x2e05('0x3b')]===_0x2e05('0x7a')){return _0x421d81[_0x2e05('0x26')](_0xeb9f80)[_0x2e05('0xaa')](_0x2e05('0xab'),_0x2e05('0xac'))[_0x2e05('0x34')](_0x2e05('0xad'));}else{return _0x421d81['status'](_0xeb9f80)[_0x2e05('0x27')](_0x495ef6);}}})['catch'](handleError(_0x421d81,null));};exports[_0x2e05('0xae')]=function(_0x1d2cda,_0x215cdf){var _0x38fd9f=_0x1d2cda[_0x2e05('0x52')]['id'];var _0x2d577e=_0x1d2cda['body'];var _0x78ed00=0xc8;var _0x6d25bd=null;return db[_0x2e05('0xaf')][_0x2e05('0xb0')]({'isolationLevel':db[_0x2e05('0xaf')][_0x2e05('0xb1')]['ISOLATION_LEVELS'][_0x2e05('0xb2')]},function(_0x5cb30b){return db[_0x2e05('0x38')][_0x2e05('0x5f')]({'where':{'id':_0x38fd9f},'transaction':_0x5cb30b})['then'](function(_0x482e33){if(_0x482e33){return db['SmsApplication']['destroy']({'where':{'SmsAccountId':_0x38fd9f},'transaction':_0x5cb30b})[_0x2e05('0x19')](function(){var _0x4e2ac5=_['map'](_0x2d577e,function(_0x591224){_0x591224[_0x2e05('0x5d')]=_0x38fd9f;return _0x591224;});return db[_0x2e05('0x69')][_0x2e05('0xb3')](_0x4e2ac5,{'transaction':_0x5cb30b});});}else{_0x78ed00=0x194;_0x6d25bd=[];}});})[_0x2e05('0x19')](function(){if(_0x78ed00!==0x194){return db[_0x2e05('0x69')][_0x2e05('0xb4')]({'where':{'SmsAccountId':_0x38fd9f},'order':_0x2e05('0x6d')})[_0x2e05('0x19')](function(_0x39012f){_0x6d25bd=_0x39012f;});}})[_0x2e05('0x24')](function(_0x55fa16){_0x78ed00=0x1f4;logger[_0x2e05('0x1f')](_0x55fa16[_0x2e05('0x32')]);if(_0x55fa16['name']){delete _0x55fa16['name'];}_0x6d25bd=_0x55fa16;})[_0x2e05('0xb5')](function(){if(_0x6d25bd===null){_0x215cdf[_0x2e05('0x25')](_0x78ed00);}else{if(_0x78ed00===0x1f4){_0x215cdf[_0x2e05('0x26')](_0x78ed00)[_0x2e05('0x34')](_0x6d25bd);}else{_0x215cdf['status'](_0x78ed00)['json'](_0x6d25bd);}}});};exports[_0x2e05('0xb6')]=function(_0x126165,_0x4cf717,_0x451c73){var _0x34386e={};var _0x1d9b61={};var _0x41c8ff;var _0x2fb4f3;return db[_0x2e05('0x38')][_0x2e05('0x5f')]({'where':{'id':_0x126165[_0x2e05('0x52')]['id']}})[_0x2e05('0x19')](handleEntityNotFound(_0x4cf717,null))[_0x2e05('0x19')](function(_0x36f7fe){if(_0x36f7fe){_0x41c8ff=_0x36f7fe;_0x1d9b61[_0x2e05('0x3c')]=_[_0x2e05('0x3e')](db['SmsApplication'][_0x2e05('0x39')]);_0x1d9b61[_0x2e05('0x3d')]=_[_0x2e05('0x3e')](_0x126165['query']);_0x1d9b61[_0x2e05('0x3f')]=_[_0x2e05('0x40')](_0x1d9b61[_0x2e05('0x3c')],_0x1d9b61['query']);_0x34386e[_0x2e05('0x41')]=_['intersection'](_0x1d9b61[_0x2e05('0x3c')],qs[_0x2e05('0x42')](_0x126165[_0x2e05('0x3d')][_0x2e05('0x42')]));_0x34386e[_0x2e05('0x41')]=_0x34386e['attributes'][_0x2e05('0x43')]?_0x34386e[_0x2e05('0x41')]:_0x1d9b61[_0x2e05('0x3c')];_0x34386e[_0x2e05('0x46')]=qs[_0x2e05('0x47')](_0x126165[_0x2e05('0x3d')]['sort']);_0x34386e['where']=qs[_0x2e05('0x3f')](_[_0x2e05('0x49')](_0x126165[_0x2e05('0x3d')],_0x1d9b61['filters']));if(_0x126165['query'][_0x2e05('0x4a')]){_0x34386e['where']=_[_0x2e05('0x4b')](_0x34386e['where'],{'$or':_[_0x2e05('0x37')](_0x34386e['attributes'],function(_0x227db4){var _0x5ef53f={};_0x5ef53f[_0x227db4]={'$like':'%'+_0x126165[_0x2e05('0x3d')][_0x2e05('0x4a')]+'%'};return _0x5ef53f;})});}_0x34386e=_[_0x2e05('0x4b')]({},_0x34386e,_0x126165[_0x2e05('0x4d')]);return _0x41c8ff[_0x2e05('0xb6')](_0x34386e);}})[_0x2e05('0x19')](function(_0x275c17){if(_0x275c17){_0x2fb4f3=_0x275c17[_0x2e05('0x43')];if(!_0x126165[_0x2e05('0x3d')]['hasOwnProperty'](_0x2e05('0x45'))){_0x34386e[_0x2e05('0x29')]=qs[_0x2e05('0x29')](_0x126165[_0x2e05('0x3d')][_0x2e05('0x29')]);_0x34386e[_0x2e05('0x2b')]=qs[_0x2e05('0x2b')](_0x126165['query'][_0x2e05('0x2b')]);}return _0x41c8ff[_0x2e05('0xb6')](_0x34386e);}})['then'](function(_0x4d8c42){if(_0x4d8c42){return _0x4d8c42?{'count':_0x2fb4f3,'rows':_0x4d8c42}:null;}})[_0x2e05('0x19')](respondWithResult(_0x4cf717,null))[_0x2e05('0x24')](handleError(_0x4cf717,null));};exports[_0x2e05('0xb7')]=function(_0x4e0783,_0x3103b0,_0x4142f0){var _0x6ff0bc={'raw':![],'where':{}};var _0x1059d8={};var _0x4e8da9={'count':0x0,'rows':[]};return db['SmsAccount'][_0x2e05('0x5f')]({'where':{'id':_0x4e0783[_0x2e05('0x52')]['id']}})[_0x2e05('0x19')](handleEntityNotFound(_0x3103b0,null))[_0x2e05('0x19')](function(_0x5884dd){if(_0x5884dd){_0x1059d8[_0x2e05('0x3c')]=_[_0x2e05('0x3e')](db[_0x2e05('0x96')]['rawAttributes']);_0x1059d8[_0x2e05('0x3d')]=_['keys'](_0x4e0783[_0x2e05('0x3d')]);_0x1059d8[_0x2e05('0x3f')]=_[_0x2e05('0x40')](_0x1059d8[_0x2e05('0x3c')],_0x1059d8[_0x2e05('0x3d')]);_0x6ff0bc[_0x2e05('0x41')]=_[_0x2e05('0x40')](_0x1059d8['model'],qs[_0x2e05('0x42')](_0x4e0783[_0x2e05('0x3d')][_0x2e05('0x42')]));_0x6ff0bc[_0x2e05('0x41')]=_0x6ff0bc['attributes'][_0x2e05('0x43')]?_0x6ff0bc[_0x2e05('0x41')]:_0x1059d8[_0x2e05('0x3c')];if(!_0x4e0783[_0x2e05('0x3d')][_0x2e05('0x44')]('nolimit')){_0x6ff0bc['limit']=qs[_0x2e05('0x29')](_0x4e0783['query'][_0x2e05('0x29')]);_0x6ff0bc[_0x2e05('0x2b')]=qs[_0x2e05('0x2b')](_0x4e0783['query'][_0x2e05('0x2b')]);}_0x6ff0bc[_0x2e05('0x46')]=qs[_0x2e05('0x47')](_0x4e0783['query']['sort']);_0x6ff0bc[_0x2e05('0x48')]=qs[_0x2e05('0x3f')](_[_0x2e05('0x49')](_0x4e0783['query'],_0x1059d8[_0x2e05('0x3f')]));_0x6ff0bc[_0x2e05('0x48')]['SmsAccountId']=_0x5884dd['id'];if(_0x4e0783[_0x2e05('0x3d')][_0x2e05('0x4a')]){_0x6ff0bc[_0x2e05('0x48')]=_[_0x2e05('0x4b')](_0x6ff0bc[_0x2e05('0x48')],{'$or':_['map'](_0x6ff0bc['attributes'],function(_0x62c56a){var _0x5e1b69={};_0x5e1b69[_0x62c56a]={'$like':'%'+_0x4e0783['query'][_0x2e05('0x4a')]+'%'};return _0x5e1b69;})});}_0x6ff0bc=_[_0x2e05('0x4b')]({},_0x6ff0bc,_0x4e0783[_0x2e05('0x4d')]);return db[_0x2e05('0x96')][_0x2e05('0x2a')]({'where':_0x6ff0bc['where']})[_0x2e05('0x19')](function(_0x4b2c15){_0x4e8da9[_0x2e05('0x2a')]=_0x4b2c15;if(_0x4e0783[_0x2e05('0x3d')][_0x2e05('0x4e')]){_0x6ff0bc[_0x2e05('0x4f')]=[{'model':db[_0x2e05('0x70')],'as':'Contact','required':![]},{'model':db[_0x2e05('0xa2')],'as':_0x2e05('0xb8'),'attributes':['name',_0x2e05('0xb9'),_0x2e05('0xba')],'required':![]},{'model':db['Tag'],'as':_0x2e05('0xbb'),'attributes':['id',_0x2e05('0x33'),_0x2e05('0xbc')],'where':_0x4e0783['query'][_0x2e05('0xbd')]?{'id':_0x4e0783[_0x2e05('0x3d')]['tag']}:undefined,'required':_0x4e0783[_0x2e05('0x3d')][_0x2e05('0xbd')]?!![]:![]}];}return db[_0x2e05('0x96')][_0x2e05('0x50')](_0x6ff0bc);})['then'](function(_0x24c95a){_0x4e8da9[_0x2e05('0x60')]=_0x24c95a;return _0x4e8da9;});}})[_0x2e05('0x19')](respondWithFilteredResult(_0x3103b0,_0x6ff0bc))[_0x2e05('0x24')](handleError(_0x3103b0,null));};exports[_0x2e05('0x34')]=function(_0x3a2a68,_0xdf7dc9,_0x8aea29){var _0x18ef6f,_0x10e391,_0x571426;if(_[_0x2e05('0x8e')](_0x3a2a68[_0x2e05('0x5a')][_0x2e05('0x5a')])||_0x3a2a68[_0x2e05('0x5a')]['body']===''){throw new db[(_0x2e05('0x71'))][(_0x2e05('0x72'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x2e05('0x8e')](_0x3a2a68[_0x2e05('0x5a')]['to'])){throw new db['Sequelize']['ValidationError'](_0x2e05('0xbe'));}_0x18ef6f=_0x3a2a68[_0x2e05('0x5a')]['to'];return db[_0x2e05('0x38')][_0x2e05('0x53')]({'where':{'id':_0x3a2a68['params']['id']},'include':[{'model':db[_0x2e05('0x92')],'as':_0x2e05('0xbf'),'include':[{'model':db['CmContact'],'as':_0x2e05('0x94'),'where':{'mobile':_0x18ef6f},'limit':0x1,'order':[[_0x2e05('0x75'),_0x2e05('0x93')]]}]}]})[_0x2e05('0x19')](handleEntityNotFound(_0xdf7dc9,null))[_0x2e05('0x19')](function(_0x417ca8){if(_0x417ca8&&_0x417ca8[_0x2e05('0xbf')]){_0x10e391=_0x417ca8[_0x2e05('0x2f')]({'plain':!![]});if(_0x10e391['List']&&_0x10e391[_0x2e05('0xbf')][_0x2e05('0x94')]['length']){return _0x10e391[_0x2e05('0xbf')][_0x2e05('0x94')][0x0];}return db[_0x2e05('0x70')][_0x2e05('0x54')](_['defaults'](_0x3a2a68[_0x2e05('0x5a')],{'firstName':_0x18ef6f,'mobile':_0x18ef6f,'phone':_0x18ef6f,'ListId':_0x10e391[_0x2e05('0x78')]}));}})[_0x2e05('0x19')](handleEntityNotFound(_0xdf7dc9,null))[_0x2e05('0x19')](function(_0x5617d7){if(_0x5617d7){_0x571426=_0x5617d7;return db['SmsInteraction'][_0x2e05('0x53')]({'where':{'ContactId':_0x571426['id'],'closed':![],'SmsAccountId':_0x10e391['id']}})[_0x2e05('0x19')](function(_0x190049){if(_0x190049){return[_0x190049,![]];}return db[_0x2e05('0x96')][_0x2e05('0x54')]({'UserId':_0x3a2a68['user']['id'],'ContactId':_0x571426['id'],'SmsAccountId':_0x10e391['id'],'phone':_0x18ef6f,'firstMsgDirection':_0x2e05('0xc0'),'Messages':[_['merge'](_0x3a2a68[_0x2e05('0x5a')],{'read':![],'body':_0x3a2a68[_0x2e05('0x5a')][_0x2e05('0x5a')],'phone':_0x18ef6f,'SmsAccountId':_0x10e391['id'],'UserId':_0x3a2a68[_0x2e05('0x55')]['id'],'ContactId':_0x571426['id']})]},{'include':[{'model':db[_0x2e05('0x9f')],'as':_0x2e05('0xc1')}]})['then'](function(_0x41fd8c){return[_0x41fd8c,!![]];});});}})['spread'](function(_0x41be46,_0x22d471){if(_0x22d471){return _0x41be46;}return db[_0x2e05('0x9f')][_0x2e05('0x54')](_[_0x2e05('0x4b')](_0x3a2a68['body'],{'read':![],'body':_0x3a2a68[_0x2e05('0x5a')][_0x2e05('0x5a')],'phone':_0x18ef6f,'SmsAccountId':_0x10e391['id'],'SmsInteractionId':_0x41be46['id'],'UserId':_0x3a2a68[_0x2e05('0x55')]['id'],'ContactId':_0x571426['id']}))['then'](function(_0x519741){_0x41be46[_0x2e05('0xc2')][_0x2e05('0xc1')]=[];_0x41be46[_0x2e05('0xc2')][_0x2e05('0xc1')][_0x2e05('0x9b')](_0x519741[_0x2e05('0xc2')]);return _0x41be46;});})[_0x2e05('0x19')](respondWithResult(_0xdf7dc9,null))[_0x2e05('0x24')](handleError(_0xdf7dc9,null));};exports[_0x2e05('0x26')]=function(_0x54c25a,_0x1d6c72,_0x10898e){if(_0x54c25a[_0x2e05('0x5a')]['id']){delete _0x54c25a[_0x2e05('0x5a')]['id'];}var _0x4f8fae,_0x4d80c2,_0x11a9aa;return db[_0x2e05('0x38')][_0x2e05('0x53')]({'where':{'id':_0x54c25a[_0x2e05('0x52')]['id']}})[_0x2e05('0x19')](handleEntityNotFound(_0x1d6c72,null))['then'](function(_0x5ede4b){if(_0x5ede4b){_0x11a9aa=_0x5ede4b;logger['debug'](_0x2e05('0x1d'),_0x2e05('0x26'),_0x2e05('0xc3'),_0x5ede4b[_0x2e05('0x3b')],util['inspect'](_0x54c25a[_0x2e05('0x5a')],{'showHidden':![],'depth':null}));switch(_0x5ede4b[_0x2e05('0x3b')]){case'skebby':if(_0x54c25a['body']['skebby_dispatch_id']&&_0x54c25a[_0x2e05('0x5a')]['status']){_0x4d80c2=_0x54c25a[_0x2e05('0x5a')][_0x2e05('0x26')];return db[_0x2e05('0x9f')][_0x2e05('0x53')]({'where':{'messageId':_0x54c25a[_0x2e05('0x5a')]['skebby_dispatch_id']}});}break;case'connectel':if(_0x54c25a[_0x2e05('0x5a')][_0x2e05('0xc4')]&&_0x54c25a[_0x2e05('0x5a')][_0x2e05('0xc5')]){_0x4d80c2=_0x54c25a[_0x2e05('0x5a')]['statusInt'];return db[_0x2e05('0x9f')]['find']({'where':{'messageId':_0x54c25a[_0x2e05('0x5a')][_0x2e05('0xc4')]}});}break;case'clicksend':if(_0x54c25a[_0x2e05('0x5a')][_0x2e05('0x83')]&&_0x54c25a[_0x2e05('0x5a')]['status_code']){_0x4d80c2=_0x54c25a[_0x2e05('0x5a')][_0x2e05('0xc6')];return db[_0x2e05('0x9f')][_0x2e05('0x53')]({'where':{'messageId':_0x54c25a[_0x2e05('0x5a')][_0x2e05('0x83')]}});}break;case _0x2e05('0x87'):var _0x2ba70f=_0x54c25a['body'][_0x2e05('0xc7')][0x0];if(_0x2ba70f[_0x2e05('0x82')]&&_0x2ba70f[_0x2e05('0x26')][_0x2e05('0xc8')]==='DELIVERED'){_0x4d80c2=_0x2ba70f[_0x2e05('0x26')][_0x2e05('0xc8')];return db[_0x2e05('0x9f')][_0x2e05('0x53')]({'where':{'messageId':_0x2ba70f[_0x2e05('0x82')]}});}break;case _0x2e05('0x8a'):if(_0x54c25a[_0x2e05('0x5a')][_0x2e05('0x82')]&&_0x54c25a['body'][_0x2e05('0x26')]){_0x4d80c2=_0x54c25a[_0x2e05('0x5a')]['status'];return db[_0x2e05('0x9f')][_0x2e05('0x53')]({'where':{'messageId':_0x54c25a[_0x2e05('0x5a')][_0x2e05('0x82')]}});}break;case _0x2e05('0x8c'):if(_0x54c25a[_0x2e05('0x5a')][0x0]['message']['id']){_0x4d80c2=_0x54c25a['body'][0x0][_0x2e05('0x3b')];return db['SmsMessage'][_0x2e05('0x53')]({'where':{'messageId':_0x54c25a[_0x2e05('0x5a')][0x0]['message']['id']}});}break;case _0x2e05('0x8d'):if(_0x54c25a[_0x2e05('0x5a')][_0x2e05('0xc9')]&&_0x54c25a['body'][_0x2e05('0x26')]){_0x4d80c2=_0x54c25a[_0x2e05('0x5a')]['status'];return db[_0x2e05('0x9f')][_0x2e05('0x53')]({'where':{'messageId':_0x54c25a['body'][_0x2e05('0xc9')]}});}break;}}})[_0x2e05('0x19')](handleEntityNotFound(_0x1d6c72,null))[_0x2e05('0x19')](function(_0x97940a){if(_0x97940a){_0x4f8fae=_0x97940a;switch(_0x11a9aa[_0x2e05('0x3b')]){case _0x2e05('0x7e'):if(_0x4d80c2===_0x2e05('0xca')){return _0x4f8fae[_0x2e05('0x2e')]({'read':!![]});}else{logger[_0x2e05('0x1f')](_0x2e05('0x1d'),_0x2e05('0x26'),_0x2e05('0x7e'),util[_0x2e05('0xcb')](_0x54c25a[_0x2e05('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x2e05('0x81'):if(_0x4d80c2==='1'){return _0x4f8fae[_0x2e05('0x2e')]({'read':!![]});}else{logger['error'](_0x2e05('0x1d'),_0x2e05('0x26'),'skebby',util[_0x2e05('0xcb')](_0x54c25a[_0x2e05('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x2e05('0xcc'):if(!_0x54c25a[_0x2e05('0x5a')][_0x2e05('0xcd')]&&_0x4d80c2>=0xc8&&_0x4d80c2<=0xce){return _0x4f8fae[_0x2e05('0x2e')]({'read':!![]});}else{logger[_0x2e05('0x1f')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2e05('0x26'),_0x2e05('0xcc'),util['inspect'](_0x54c25a[_0x2e05('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x2e05('0x87'):var _0x31e386=_0x54c25a['body']['results'][0x0];if(_0x31e386[_0x2e05('0x26')][_0x2e05('0xc8')]==='DELIVERED'){return _0x4f8fae['update']({'read':!![]});}else{logger[_0x2e05('0x1f')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2e05('0x26'),_0x2e05('0x87'),util[_0x2e05('0xcb')](_0x54c25a[_0x2e05('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x2e05('0x8a'):if(_0x4d80c2==_0x2e05('0xce')||_0x4d80c2==_0x2e05('0xcf')){return _0x4f8fae[_0x2e05('0x2e')]({'read':!![]});}else{logger[_0x2e05('0x1f')](_0x2e05('0x1d'),'status',_0x2e05('0x8a'),util['inspect'](_0x54c25a['body'],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x4d80c2==_0x2e05('0xd0')){return _0x4f8fae[_0x2e05('0x2e')]({'read':!![]});}else{logger[_0x2e05('0x1f')](_0x2e05('0x1d'),_0x2e05('0x26'),_0x2e05('0x8c'),util['inspect'](_0x54c25a[_0x2e05('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x2e05('0x8d'):if(_0x4d80c2==='DELIVRD'||_0x4d80c2===_0x2e05('0xd1')){return _0x4f8fae[_0x2e05('0x2e')]({'read':!![]});}else{logger['error'](_0x2e05('0x1d'),_0x2e05('0x26'),'intelepeer',util['inspect'](_0x54c25a[_0x2e05('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x4f8fae;}})[_0x2e05('0x19')](respondWithResult(_0x1d6c72,null))[_0x2e05('0x24')](handleError(_0x1d6c72,null));};exports[_0x2e05('0xd2')]=function(_0x11608c,_0x332872,_0xf6577e){var _0x5ce067,_0x3aa37a,_0xca81fd;return db[_0x2e05('0x38')][_0x2e05('0x53')]({'where':{'id':_0x11608c[_0x2e05('0x52')]['id']}})['then'](handleEntityNotFound(_0x332872,null))[_0x2e05('0x19')](function(_0x138e6c){if(_0x138e6c){_0xca81fd=_0x138e6c;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2e05('0x26'),_0x2e05('0xc3'),_0x138e6c[_0x2e05('0x3b')],util[_0x2e05('0xcb')](_0x11608c[_0x2e05('0x3d')],{'showHidden':![],'depth':null}));switch(_0x138e6c[_0x2e05('0x3b')]){case'csc':if(_0x11608c[_0x2e05('0x3d')][_0x2e05('0xd3')]&&_0x11608c['query'][_0x2e05('0xd4')]){_0x3aa37a=_0x11608c[_0x2e05('0x3d')][_0x2e05('0xd4')];return db[_0x2e05('0x9f')][_0x2e05('0x53')]({'where':{'messageId':_0x11608c[_0x2e05('0x3d')]['message-id']}});}break;}}})[_0x2e05('0x19')](handleEntityNotFound(_0x332872,null))[_0x2e05('0x19')](function(_0x35023a){if(_0x35023a){_0x5ce067=_0x35023a;switch(_0xca81fd[_0x2e05('0x3b')]){case'csc':if(_0x3aa37a==='2'||_0x3aa37a==='6'){return _0x5ce067['update']({'read':!![]});}else{logger['error'](_0x2e05('0x1d'),'status',_0x2e05('0xd5'),util[_0x2e05('0xcb')](_0x11608c[_0x2e05('0x3d')],{'showHidden':![],'depth':null}));};break;}return _0x5ce067;}})[_0x2e05('0x19')](respondWithResult(_0x332872,null))[_0x2e05('0x24')](handleError(_0x332872,null));};exports['addAgents']=function(_0x1130f9,_0x10cc5b,_0x398688){return db['SmsAccount'][_0x2e05('0x53')]({'where':{'id':_0x1130f9[_0x2e05('0x52')]['id']}})[_0x2e05('0x19')](handleEntityNotFound(_0x10cc5b,null))[_0x2e05('0x19')](function(_0x533e77){if(_0x533e77){return _0x533e77[_0x2e05('0xd6')](_0x1130f9[_0x2e05('0x5a')][_0x2e05('0x62')],_[_0x2e05('0xd7')](_0x1130f9[_0x2e05('0x5a')],[_0x2e05('0x62'),'id'])||{})[_0x2e05('0x97')](function(_0x15cdb8){for(var _0x399066=0x0;_0x399066<_0x1130f9['body'][_0x2e05('0x62')][_0x2e05('0x43')];_0x399066+=0x1){socket[_0x2e05('0xd8')](_0x2e05('0xd9'),{'UserId':Number(_0x1130f9[_0x2e05('0x5a')][_0x2e05('0x62')][_0x399066]),'SmsAccountId':Number(_0x1130f9[_0x2e05('0x52')]['id'])});}return _0x15cdb8;});}})[_0x2e05('0x19')](respondWithResult(_0x10cc5b,null))[_0x2e05('0x24')](handleError(_0x10cc5b,null));};exports[_0x2e05('0xda')]=function(_0x48ae8b,_0x1723f0,_0x7d7499){return db[_0x2e05('0x38')][_0x2e05('0x53')]({'where':{'id':_0x48ae8b[_0x2e05('0x52')]['id']}})[_0x2e05('0x19')](handleEntityNotFound(_0x1723f0,null))['then'](function(_0x16bbce){if(_0x16bbce){return _0x16bbce['removeAgents'](_0x48ae8b['query'][_0x2e05('0x62')])['then'](function(){if(_[_0x2e05('0xdb')](_0x48ae8b[_0x2e05('0x3d')][_0x2e05('0x62')])){for(var _0x2c970c=0x0;_0x2c970c<_0x48ae8b[_0x2e05('0x3d')][_0x2e05('0x62')][_0x2e05('0x43')];_0x2c970c+=0x1){socket[_0x2e05('0xd8')](_0x2e05('0xdc'),{'UserId':Number(_0x48ae8b[_0x2e05('0x3d')][_0x2e05('0x62')][_0x2c970c]),'SmsAccountId':Number(_0x48ae8b['params']['id'])});}}else{socket[_0x2e05('0xd8')](_0x2e05('0xdc'),{'UserId':Number(_0x48ae8b[_0x2e05('0x3d')]['ids']),'SmsAccountId':Number(_0x48ae8b[_0x2e05('0x52')]['id'])});}});}})[_0x2e05('0x19')](respondWithStatusCode(_0x1723f0,null))[_0x2e05('0x24')](handleError(_0x1723f0,null));};exports[_0x2e05('0xdd')]=function(_0x2259c3,_0x45ed7e,_0x2c7499){var _0x2841d6={};var _0x25b6c7={};var _0x142b75;var _0x4323fc;return db[_0x2e05('0x38')][_0x2e05('0x5f')]({'where':{'id':_0x2259c3[_0x2e05('0x52')]['id']}})[_0x2e05('0x19')](handleEntityNotFound(_0x45ed7e,null))['then'](function(_0x2eaba5){if(_0x2eaba5){_0x142b75=_0x2eaba5;_0x25b6c7['model']=_['keys'](db[_0x2e05('0xa2')][_0x2e05('0x39')]);_0x25b6c7['query']=_[_0x2e05('0x3e')](_0x2259c3[_0x2e05('0x3d')]);_0x25b6c7[_0x2e05('0x3f')]=_[_0x2e05('0x40')](_0x25b6c7[_0x2e05('0x3c')],_0x25b6c7[_0x2e05('0x3d')]);_0x2841d6['attributes']=_[_0x2e05('0x40')](_0x25b6c7[_0x2e05('0x3c')],qs[_0x2e05('0x42')](_0x2259c3[_0x2e05('0x3d')][_0x2e05('0x42')]));_0x2841d6[_0x2e05('0x41')]=_0x2841d6['attributes'][_0x2e05('0x43')]?_0x2841d6[_0x2e05('0x41')]:_0x25b6c7[_0x2e05('0x3c')];_0x2841d6[_0x2e05('0x46')]=qs[_0x2e05('0x47')](_0x2259c3[_0x2e05('0x3d')]['sort']);_0x2841d6[_0x2e05('0x48')]=qs[_0x2e05('0x3f')](_[_0x2e05('0x49')](_0x2259c3['query'],_0x25b6c7[_0x2e05('0x3f')]));if(_0x2259c3[_0x2e05('0x3d')][_0x2e05('0x4a')]){_0x2841d6[_0x2e05('0x48')]=_[_0x2e05('0x4b')](_0x2841d6[_0x2e05('0x48')],{'$or':_[_0x2e05('0x37')](_0x2841d6[_0x2e05('0x41')],function(_0x3f6fef){var _0x340b15={};_0x340b15[_0x3f6fef]={'$like':'%'+_0x2259c3['query'][_0x2e05('0x4a')]+'%'};return _0x340b15;})});}_0x2841d6=_[_0x2e05('0x4b')]({},_0x2841d6,_0x2259c3[_0x2e05('0x4d')]);return _0x142b75['getAgents'](_0x2841d6);}})[_0x2e05('0x19')](function(_0x3a9786){if(_0x3a9786){_0x4323fc=_0x3a9786[_0x2e05('0x43')];if(!_0x2259c3[_0x2e05('0x3d')][_0x2e05('0x44')](_0x2e05('0x45'))){_0x2841d6['limit']=qs[_0x2e05('0x29')](_0x2259c3[_0x2e05('0x3d')][_0x2e05('0x29')]);_0x2841d6[_0x2e05('0x2b')]=qs[_0x2e05('0x2b')](_0x2259c3[_0x2e05('0x3d')][_0x2e05('0x2b')]);}return _0x142b75['getAgents'](_0x2841d6);}})[_0x2e05('0x19')](function(_0x6f4795){if(_0x6f4795){return _0x6f4795?{'count':_0x4323fc,'rows':_0x6f4795}:null;}})[_0x2e05('0x19')](respondWithResult(_0x45ed7e,null))['catch'](handleError(_0x45ed7e,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index f1bf070..bf57c73 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 _0xabad=['exports','events','../../mysqldb','SmsAccount','update','emit','hasOwnProperty','hook'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xabad,0x111));var _0xdaba=function(_0x3977dc,_0x18499a){_0x3977dc=_0x3977dc-0x0;var _0x40e46e=_0xabad[_0x3977dc];return _0x40e46e;};'use strict';var EventEmitter=require(_0xdaba('0x0'));var SmsAccount=require(_0xdaba('0x1'))['db'][_0xdaba('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xdaba('0x3'),'afterDestroy':'remove'};function emitEvent(_0x58ed7e){return function(_0x505543,_0x416aaf,_0x30271c){SmsAccountEvents[_0xdaba('0x4')](_0x58ed7e+':'+_0x505543['id'],_0x505543);SmsAccountEvents[_0xdaba('0x4')](_0x58ed7e,_0x505543);_0x30271c(null);};}for(var e in events){if(events[_0xdaba('0x5')](e)){var event=events[e];SmsAccount[_0xdaba('0x6')](e,emitEvent(event));}}module[_0xdaba('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0xd9f9=['hook','../../mysqldb','SmsAccount','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x4ae506,_0x5a97ed){var _0x18e3a1=function(_0x3995a2){while(--_0x3995a2){_0x4ae506['push'](_0x4ae506['shift']());}};_0x18e3a1(++_0x5a97ed);}(_0xd9f9,0x1e1));var _0x9d9f=function(_0x29a498,_0x461c2f){_0x29a498=_0x29a498-0x0;var _0x28fce0=_0xd9f9[_0x29a498];return _0x28fce0;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x9d9f('0x0'))['db'][_0x9d9f('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x9d9f('0x2')](0x0);var events={'afterCreate':_0x9d9f('0x3'),'afterUpdate':'update','afterDestroy':_0x9d9f('0x4')};function emitEvent(_0x5198f4){return function(_0x56de60,_0x2aeacf,_0x2f442c){SmsAccountEvents[_0x9d9f('0x5')](_0x5198f4+':'+_0x56de60['id'],_0x56de60);SmsAccountEvents[_0x9d9f('0x5')](_0x5198f4,_0x56de60);_0x2f442c(null);};}for(var e in events){if(events[_0x9d9f('0x6')](e)){var event=events[e];SmsAccount[_0x9d9f('0x7')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index b171441..f9a26fb 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 _0x8864=['request-promise','rimraf','../../config/environment','./smsAccount.attributes','exports','define','lodash','../../config/logger','moment'];(function(_0x3115c7,_0xb8b818){var _0x4b1804=function(_0x58cacd){while(--_0x58cacd){_0x3115c7['push'](_0x3115c7['shift']());}};_0x4b1804(++_0xb8b818);}(_0x8864,0x1ad));var _0x4886=function(_0x300b26,_0x3a9b67){_0x300b26=_0x300b26-0x0;var _0x5cb1ae=_0x8864[_0x300b26];return _0x5cb1ae;};'use strict';var _=require(_0x4886('0x0'));var util=require('util');var logger=require(_0x4886('0x1'))('api');var moment=require(_0x4886('0x2'));var BPromise=require('bluebird');var rp=require(_0x4886('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4886('0x4'));var config=require(_0x4886('0x5'));var attributes=require(_0x4886('0x6'));module[_0x4886('0x7')]=function(_0x4b3fbd,_0x18d8e6){return _0x4b3fbd[_0x4886('0x8')]('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x317f=['../../config/environment','exports','SmsAccount','sms_accounts','util','../../config/logger','api','bluebird','request-promise'];(function(_0x126a88,_0x3ea1fd){var _0x24ee76=function(_0x57142b){while(--_0x57142b){_0x126a88['push'](_0x126a88['shift']());}};_0x24ee76(++_0x3ea1fd);}(_0x317f,0x17e));var _0xf317=function(_0x55795a,_0x53d9b5){_0x55795a=_0x55795a-0x0;var _0x26ffa5=_0x317f[_0x55795a];return _0x26ffa5;};'use strict';var _=require('lodash');var util=require(_0xf317('0x0'));var logger=require(_0xf317('0x1'))(_0xf317('0x2'));var moment=require('moment');var BPromise=require(_0xf317('0x3'));var rp=require(_0xf317('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf317('0x5'));var attributes=require('./smsAccount.attributes');module[_0xf317('0x6')]=function(_0x5d4102,_0x1a409c){return _0x5d4102['define'](_0xf317('0x7'),attributes,{'tableName':_0xf317('0x8'),'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 f114a3d..f027fbf 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 _0xc7d4=['message','result','catch','ShowSmsAccount','SmsAccount','options','raw','where','include','map','model','attributes','stringify','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','defaults','localhost','socket.io-emitter','redis','./smsAccount.socket','register','request','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','code','error','SmsAccount,\x20%s,\x20%s'];(function(_0xb32d73,_0x4dd8c4){var _0x38ac19=function(_0x42dfda){while(--_0x42dfda){_0xb32d73['push'](_0xb32d73['shift']());}};_0x38ac19(++_0x4dd8c4);}(_0xc7d4,0xeb));var _0x4c7d=function(_0x361dec,_0x38ea85){_0x361dec=_0x361dec-0x0;var _0x5e3e05=_0xc7d4[_0x361dec];return _0x5e3e05;};'use strict';var _=require(_0x4c7d('0x0'));var util=require('util');var moment=require(_0x4c7d('0x1'));var BPromise=require(_0x4c7d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c7d('0x3'));var db=require(_0x4c7d('0x4'))['db'];var utils=require(_0x4c7d('0x5'));var logger=require(_0x4c7d('0x6'))('rpc');var config=require(_0x4c7d('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4c7d('0x8')]({'port':0x232a});config['redis']=_[_0x4c7d('0x9')](config['redis'],{'host':_0x4c7d('0xa'),'port':0x18eb});var socket=require(_0x4c7d('0xb'))(new Redis(config[_0x4c7d('0xc')]));require(_0x4c7d('0xd'))[_0x4c7d('0xe')](socket);function respondWithRpcPromise(_0x42d5cc,_0x1295cc,_0x11e4ee){return new BPromise(function(_0x89b10a,_0x8ab047){return client[_0x4c7d('0xf')](_0x42d5cc,_0x11e4ee)[_0x4c7d('0x10')](function(_0x352ba1){logger[_0x4c7d('0x11')]('SmsAccount,\x20%s,\x20%s',_0x1295cc,_0x4c7d('0x12'));logger[_0x4c7d('0x13')](_0x4c7d('0x14'),_0x1295cc,_0x4c7d('0x12'),JSON['stringify'](_0x352ba1));if(_0x352ba1['error']){if(_0x352ba1['error'][_0x4c7d('0x15')]===0x1f4){logger[_0x4c7d('0x16')](_0x4c7d('0x17'),_0x1295cc,_0x352ba1[_0x4c7d('0x16')][_0x4c7d('0x18')]);return _0x8ab047(_0x352ba1[_0x4c7d('0x16')][_0x4c7d('0x18')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x1295cc,_0x352ba1[_0x4c7d('0x16')]['message']);return _0x89b10a(_0x352ba1[_0x4c7d('0x16')][_0x4c7d('0x18')]);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x1295cc,_0x4c7d('0x12'));_0x89b10a(_0x352ba1[_0x4c7d('0x19')][_0x4c7d('0x18')]);}})[_0x4c7d('0x1a')](function(_0x160b34){logger['error'](_0x4c7d('0x17'),_0x1295cc,_0x160b34);_0x8ab047(_0x160b34);});});}exports[_0x4c7d('0x1b')]=function(_0x22f8cf){var _0x1fa0c2=this;return new Promise(function(_0x53f482,_0x45e581){return db[_0x4c7d('0x1c')]['find']({'raw':_0x22f8cf[_0x4c7d('0x1d')]?_0x22f8cf[_0x4c7d('0x1d')][_0x4c7d('0x1e')]===undefined?!![]:![]:!![],'where':_0x22f8cf['options']?_0x22f8cf[_0x4c7d('0x1d')][_0x4c7d('0x1f')]||null:null,'attributes':_0x22f8cf[_0x4c7d('0x1d')]?_0x22f8cf[_0x4c7d('0x1d')]['attributes']||null:null,'include':_0x22f8cf[_0x4c7d('0x1d')]?_0x22f8cf[_0x4c7d('0x1d')][_0x4c7d('0x20')]?_[_0x4c7d('0x21')](_0x22f8cf[_0x4c7d('0x1d')][_0x4c7d('0x20')],function(_0x2b1f2e){return{'model':db[_0x2b1f2e[_0x4c7d('0x22')]],'as':_0x2b1f2e['as'],'attributes':_0x2b1f2e[_0x4c7d('0x23')],'include':_0x2b1f2e[_0x4c7d('0x20')]?_[_0x4c7d('0x21')](_0x2b1f2e['include'],function(_0x5a6241){return{'model':db[_0x5a6241[_0x4c7d('0x22')]],'as':_0x5a6241['as'],'attributes':_0x5a6241[_0x4c7d('0x23')],'include':_0x5a6241['include']?_[_0x4c7d('0x21')](_0x5a6241[_0x4c7d('0x20')],function(_0x5d0a98){return{'model':db[_0x5d0a98[_0x4c7d('0x22')]],'as':_0x5d0a98['as'],'attributes':_0x5d0a98[_0x4c7d('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4eb575){logger[_0x4c7d('0x11')](_0x4c7d('0x1b'),_0x22f8cf);logger[_0x4c7d('0x13')](_0x4c7d('0x1b'),_0x22f8cf,JSON[_0x4c7d('0x24')](_0x4eb575));_0x53f482(_0x4eb575);})[_0x4c7d('0x1a')](function(_0x57257a){logger[_0x4c7d('0x16')](_0x4c7d('0x1b'),_0x57257a[_0x4c7d('0x18')],_0x22f8cf);_0x45e581(_0x1fa0c2[_0x4c7d('0x16')](0x1f4,_0x57257a['message']));});});}; \ No newline at end of file +var _0xd0f9=['../../config/environment','client','defaults','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsAccount,\x20%s,\x20%s','result','catch','SmsAccount','options','where','attributes','include','model','map','debug','ShowSmsAccount','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xd0f9,0x160));var _0x9d0f=function(_0x86b219,_0x43038f){_0x86b219=_0x86b219-0x0;var _0x1f320c=_0xd0f9[_0x86b219];return _0x1f320c;};'use strict';var _=require(_0x9d0f('0x0'));var util=require(_0x9d0f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9d0f('0x2'));var fs=require('fs');var Redis=require(_0x9d0f('0x3'));var db=require(_0x9d0f('0x4'))['db'];var utils=require(_0x9d0f('0x5'));var logger=require(_0x9d0f('0x6'))(_0x9d0f('0x7'));var config=require(_0x9d0f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9d0f('0x9')]['http']({'port':0x232a});config['redis']=_[_0x9d0f('0xa')](config[_0x9d0f('0xb')],{'host':_0x9d0f('0xc'),'port':0x18eb});var socket=require(_0x9d0f('0xd'))(new Redis(config['redis']));require('./smsAccount.socket')[_0x9d0f('0xe')](socket);function respondWithRpcPromise(_0x2984af,_0x20f210,_0x171d32){return new BPromise(function(_0xda48be,_0x18863c){return client[_0x9d0f('0xf')](_0x2984af,_0x171d32)[_0x9d0f('0x10')](function(_0x57e864){logger[_0x9d0f('0x11')]('SmsAccount,\x20%s,\x20%s',_0x20f210,_0x9d0f('0x12'));logger['debug'](_0x9d0f('0x13'),_0x20f210,'request\x20sent',JSON[_0x9d0f('0x14')](_0x57e864));if(_0x57e864['error']){if(_0x57e864[_0x9d0f('0x15')][_0x9d0f('0x16')]===0x1f4){logger[_0x9d0f('0x15')]('SmsAccount,\x20%s,\x20%s',_0x20f210,_0x57e864[_0x9d0f('0x15')][_0x9d0f('0x17')]);return _0x18863c(_0x57e864[_0x9d0f('0x15')][_0x9d0f('0x17')]);}logger[_0x9d0f('0x15')](_0x9d0f('0x18'),_0x20f210,_0x57e864[_0x9d0f('0x15')][_0x9d0f('0x17')]);return _0xda48be(_0x57e864[_0x9d0f('0x15')][_0x9d0f('0x17')]);}else{logger[_0x9d0f('0x11')]('SmsAccount,\x20%s,\x20%s',_0x20f210,_0x9d0f('0x12'));_0xda48be(_0x57e864[_0x9d0f('0x19')][_0x9d0f('0x17')]);}})[_0x9d0f('0x1a')](function(_0x2c9044){logger[_0x9d0f('0x15')](_0x9d0f('0x18'),_0x20f210,_0x2c9044);_0x18863c(_0x2c9044);});});}exports['ShowSmsAccount']=function(_0x3b42b7){var _0x41b53a=this;return new Promise(function(_0x13e147,_0x405119){return db[_0x9d0f('0x1b')]['find']({'raw':_0x3b42b7['options']?_0x3b42b7[_0x9d0f('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3b42b7[_0x9d0f('0x1c')]?_0x3b42b7['options'][_0x9d0f('0x1d')]||null:null,'attributes':_0x3b42b7[_0x9d0f('0x1c')]?_0x3b42b7['options'][_0x9d0f('0x1e')]||null:null,'include':_0x3b42b7[_0x9d0f('0x1c')]?_0x3b42b7[_0x9d0f('0x1c')]['include']?_['map'](_0x3b42b7[_0x9d0f('0x1c')][_0x9d0f('0x1f')],function(_0x5cc717){return{'model':db[_0x5cc717[_0x9d0f('0x20')]],'as':_0x5cc717['as'],'attributes':_0x5cc717['attributes'],'include':_0x5cc717['include']?_[_0x9d0f('0x21')](_0x5cc717['include'],function(_0x597a7c){return{'model':db[_0x597a7c[_0x9d0f('0x20')]],'as':_0x597a7c['as'],'attributes':_0x597a7c[_0x9d0f('0x1e')],'include':_0x597a7c['include']?_[_0x9d0f('0x21')](_0x597a7c[_0x9d0f('0x1f')],function(_0x20fac1){return{'model':db[_0x20fac1[_0x9d0f('0x20')]],'as':_0x20fac1['as'],'attributes':_0x20fac1[_0x9d0f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9d0f('0x10')](function(_0x2686d5){logger[_0x9d0f('0x11')]('ShowSmsAccount',_0x3b42b7);logger[_0x9d0f('0x22')](_0x9d0f('0x23'),_0x3b42b7,JSON[_0x9d0f('0x14')](_0x2686d5));_0x13e147(_0x2686d5);})[_0x9d0f('0x1a')](function(_0x3b267b){logger[_0x9d0f('0x15')](_0x9d0f('0x23'),_0x3b267b[_0x9d0f('0x17')],_0x3b42b7);_0x405119(_0x41b53a[_0x9d0f('0x15')](0x1f4,_0x3b267b[_0x9d0f('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index c290a72..aa785e6 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 2e4c3dd..9521fd9 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 _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(_0xe55502,_0x191e78){var _0x3c4de0=function(_0x7e0f21){while(--_0x7e0f21){_0xe55502['push'](_0xe55502['shift']());}};_0x3c4de0(++_0x191e78);}(_0x7217,0x19e));var _0x7721=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x7217[_0x3a6efd];return _0x487b9a;};'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 +var _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x1ded0f,_0x2c82a9){var _0x1ad47a=function(_0x5b745b){while(--_0x5b745b){_0x1ded0f['push'](_0x1ded0f['shift']());}};_0x1ad47a(++_0x2c82a9);}(_0x3e74,0x175));var _0x43e7=function(_0x501c9d,_0x4c7e7a){_0x501c9d=_0x501c9d-0x0;var _0x33c342=_0x3e74[_0x501c9d];return _0x33c342;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 5928a6e..7be6f79 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 _0x2222=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x43fe8f,_0x5c373d){var _0x1ce39b=function(_0x2eaa99){while(--_0x2eaa99){_0x43fe8f['push'](_0x43fe8f['shift']());}};_0x1ce39b(++_0x5c373d);}(_0x2222,0x1d8));var _0x2222=function(_0x5ea9f7,_0x5931aa){_0x5ea9f7=_0x5ea9f7-0x0;var _0x215230=_0x2222[_0x5ea9f7];return _0x215230;};'use strict';var Sequelize=require(_0x2222('0x0'));module[_0x2222('0x1')]={'priority':{'type':Sequelize[_0x2222('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2222('0x3')],'allowNull':![],'defaultValue':_0x2222('0x4')},'appdata':{'type':Sequelize[_0x2222('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2222('0x3')],'defaultValue':_0x2222('0x6')}}; \ No newline at end of file +var _0x2504=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x262f0f,_0x442751){var _0x5f6d0a=function(_0xcecb08){while(--_0xcecb08){_0x262f0f['push'](_0x262f0f['shift']());}};_0x5f6d0a(++_0x442751);}(_0x2504,0x143));var _0x4250=function(_0x5374a1,_0x4e7ecf){_0x5374a1=_0x5374a1-0x0;var _0x1ea250=_0x2504[_0x5374a1];return _0x1ea250;};'use strict';var Sequelize=require(_0x4250('0x0'));module[_0x4250('0x1')]={'priority':{'type':Sequelize[_0x4250('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4250('0x3')],'allowNull':![],'defaultValue':_0x4250('0x4')},'appdata':{'type':Sequelize[_0x4250('0x5')]()},'description':{'type':Sequelize[_0x4250('0x3')]},'interval':{'type':Sequelize[_0x4250('0x3')],'defaultValue':_0x4250('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 5602635..06b47ff 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 _0xb084=['mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','stack','name','send','rawAttributes','fieldName','type','model','map','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','SmsApplication','includeAll','include','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x3f1ad5,_0x4a1f09){var _0x1be1a2=function(_0x2769ab){while(--_0x2769ab){_0x3f1ad5['push'](_0x3f1ad5['shift']());}};_0x1be1a2(++_0x4a1f09);}(_0xb084,0xcc));var _0x4b08=function(_0x23c33c,_0x552c06){_0x23c33c=_0x23c33c-0x0;var _0x43d122=_0xb084[_0x23c33c];return _0x43d122;};'use strict';var emlformat=require(_0x4b08('0x0'));var rimraf=require(_0x4b08('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4b08('0x2'));var rp=require(_0x4b08('0x3'));var moment=require(_0x4b08('0x4'));var BPromise=require(_0x4b08('0x5'));var Mustache=require(_0x4b08('0x6'));var util=require(_0x4b08('0x7'));var path=require('path');var sox=require(_0x4b08('0x8'));var csv=require(_0x4b08('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b08('0xa'));var _=require(_0x4b08('0xb'));var squel=require(_0x4b08('0xc'));var crypto=require('crypto');var jsforce=require(_0x4b08('0xd'));var deskjs=require(_0x4b08('0xe'));var toCsv=require(_0x4b08('0x9'));var querystring=require(_0x4b08('0xf'));var Papa=require(_0x4b08('0x10'));var Redis=require(_0x4b08('0x11'));var authService=require(_0x4b08('0x12'));var qs=require(_0x4b08('0x13'));var as=require(_0x4b08('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4b08('0x15'));var utils=require('../../config/utils');var config=require(_0x4b08('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31744e,_0x34d230){_0x34d230=_0x34d230||0xcc;return function(_0xc6581){if(_0xc6581){return _0x31744e['sendStatus'](_0x34d230);}return _0x31744e[_0x4b08('0x17')](_0x34d230)[_0x4b08('0x18')]();};}function respondWithResult(_0x158128,_0x1d00df){_0x1d00df=_0x1d00df||0xc8;return function(_0x45acd5){if(_0x45acd5){return _0x158128[_0x4b08('0x17')](_0x1d00df)[_0x4b08('0x19')](_0x45acd5);}};}function respondWithFilteredResult(_0x52ea8b,_0xeab91d){return function(_0x1b4a2f){if(_0x1b4a2f){var _0x29de8e=typeof _0xeab91d[_0x4b08('0x1a')]===_0x4b08('0x1b')&&typeof _0xeab91d[_0x4b08('0x1c')]==='undefined';var _0x52a919=_0x1b4a2f[_0x4b08('0x1d')];var _0x21f7c1=_0x29de8e?0x0:_0xeab91d[_0x4b08('0x1a')];var _0x54fb23=_0x29de8e?_0x1b4a2f['count']:_0xeab91d[_0x4b08('0x1a')]+_0xeab91d[_0x4b08('0x1c')];var _0x3d4335;if(_0x54fb23>=_0x52a919){_0x54fb23=_0x52a919;_0x3d4335=0xc8;}else{_0x3d4335=0xce;}_0x52ea8b['status'](_0x3d4335);return _0x52ea8b[_0x4b08('0x1e')](_0x4b08('0x1f'),_0x21f7c1+'-'+_0x54fb23+'/'+_0x52a919)['json'](_0x1b4a2f);}return null;};}function patchUpdates(_0x174ca7){return function(_0x16e17e){try{jsonpatch['apply'](_0x16e17e,_0x174ca7,!![]);}catch(_0x586d26){return BPromise[_0x4b08('0x20')](_0x586d26);}return _0x16e17e[_0x4b08('0x21')]();};}function saveUpdates(_0x12c149,_0x44bcd8){return function(_0x13b5c4){if(_0x13b5c4){return _0x13b5c4[_0x4b08('0x22')](_0x12c149)[_0x4b08('0x23')](function(_0x19d0d8){return _0x19d0d8;});}return null;};}function removeEntity(_0xe28fc9,_0xc684df){return function(_0x487c09){if(_0x487c09){return _0x487c09['destroy']()[_0x4b08('0x23')](function(){_0xe28fc9[_0x4b08('0x17')](0xcc)[_0x4b08('0x18')]();});}};}function handleEntityNotFound(_0x3e4495,_0x4851b8){return function(_0x541ed6){if(!_0x541ed6){_0x3e4495['sendStatus'](0x194);}return _0x541ed6;};}function handleError(_0x47fa9d,_0x38de4b){_0x38de4b=_0x38de4b||0x1f4;return function(_0x3a9ad7){logger['error'](_0x3a9ad7[_0x4b08('0x24')]);if(_0x3a9ad7['name']){delete _0x3a9ad7[_0x4b08('0x25')];}_0x47fa9d['status'](_0x38de4b)[_0x4b08('0x26')](_0x3a9ad7);};}exports['index']=function(_0x325c9e,_0x5286e1){var _0x2deded={},_0x2cad83={},_0x1103d9={'count':0x0,'rows':[]};var _0x1b398b=_['map'](db['SmsApplication'][_0x4b08('0x27')],function(_0x54efb0){return{'name':_0x54efb0[_0x4b08('0x28')],'type':_0x54efb0[_0x4b08('0x29')]['key']};});_0x2cad83[_0x4b08('0x2a')]=_[_0x4b08('0x2b')](_0x1b398b,'name');_0x2cad83[_0x4b08('0x2c')]=_['keys'](_0x325c9e['query']);_0x2cad83['filters']=_[_0x4b08('0x2d')](_0x2cad83[_0x4b08('0x2a')],_0x2cad83['query']);_0x2deded[_0x4b08('0x2e')]=_[_0x4b08('0x2d')](_0x2cad83['model'],qs['fields'](_0x325c9e['query'][_0x4b08('0x2f')]));_0x2deded['attributes']=_0x2deded[_0x4b08('0x2e')][_0x4b08('0x30')]?_0x2deded[_0x4b08('0x2e')]:_0x2cad83['model'];if(!_0x325c9e['query'][_0x4b08('0x31')]('nolimit')){_0x2deded['limit']=qs[_0x4b08('0x1c')](_0x325c9e[_0x4b08('0x2c')][_0x4b08('0x1c')]);_0x2deded[_0x4b08('0x1a')]=qs[_0x4b08('0x1a')](_0x325c9e[_0x4b08('0x2c')][_0x4b08('0x1a')]);}_0x2deded[_0x4b08('0x32')]=qs[_0x4b08('0x33')](_0x325c9e[_0x4b08('0x2c')][_0x4b08('0x33')]);_0x2deded[_0x4b08('0x34')]=qs[_0x4b08('0x35')](_[_0x4b08('0x36')](_0x325c9e[_0x4b08('0x2c')],_0x2cad83[_0x4b08('0x35')]),_0x1b398b);if(_0x325c9e[_0x4b08('0x2c')][_0x4b08('0x37')]){_0x2deded[_0x4b08('0x34')]=_[_0x4b08('0x38')](_0x2deded[_0x4b08('0x34')],{'$or':_['map'](_0x1b398b,function(_0x3c737f){if(_0x3c737f['type']!==_0x4b08('0x39')){var _0x10aeaa={};_0x10aeaa[_0x3c737f['name']]={'$like':'%'+_0x325c9e[_0x4b08('0x2c')][_0x4b08('0x37')]+'%'};return _0x10aeaa;}})});}_0x2deded=_[_0x4b08('0x38')]({},_0x2deded,_0x325c9e[_0x4b08('0x3a')]);var _0x1d497f={'where':_0x2deded[_0x4b08('0x34')]};return db[_0x4b08('0x3b')][_0x4b08('0x1d')](_0x1d497f)[_0x4b08('0x23')](function(_0x14fdf2){_0x1103d9[_0x4b08('0x1d')]=_0x14fdf2;if(_0x325c9e['query'][_0x4b08('0x3c')]){_0x2deded[_0x4b08('0x3d')]=[{'all':!![]}];}return db[_0x4b08('0x3b')]['findAll'](_0x2deded);})[_0x4b08('0x23')](function(_0x3225aa){_0x1103d9[_0x4b08('0x3e')]=_0x3225aa;return _0x1103d9;})[_0x4b08('0x23')](respondWithFilteredResult(_0x5286e1,_0x2deded))[_0x4b08('0x3f')](handleError(_0x5286e1,null));};exports[_0x4b08('0x40')]=function(_0x33231d,_0x3452c1){var _0x5e40f2={'raw':!![],'where':{'id':_0x33231d[_0x4b08('0x41')]['id']}},_0x3f2c48={};_0x3f2c48[_0x4b08('0x2a')]=_[_0x4b08('0x42')](db[_0x4b08('0x3b')][_0x4b08('0x27')]);_0x3f2c48[_0x4b08('0x2c')]=_[_0x4b08('0x42')](_0x33231d[_0x4b08('0x2c')]);_0x3f2c48[_0x4b08('0x35')]=_[_0x4b08('0x2d')](_0x3f2c48[_0x4b08('0x2a')],_0x3f2c48[_0x4b08('0x2c')]);_0x5e40f2[_0x4b08('0x2e')]=_['intersection'](_0x3f2c48[_0x4b08('0x2a')],qs[_0x4b08('0x2f')](_0x33231d['query'][_0x4b08('0x2f')]));_0x5e40f2[_0x4b08('0x2e')]=_0x5e40f2[_0x4b08('0x2e')][_0x4b08('0x30')]?_0x5e40f2[_0x4b08('0x2e')]:_0x3f2c48[_0x4b08('0x2a')];if(_0x33231d[_0x4b08('0x2c')]['includeAll']){_0x5e40f2[_0x4b08('0x3d')]=[{'all':!![]}];}_0x5e40f2=_[_0x4b08('0x38')]({},_0x5e40f2,_0x33231d[_0x4b08('0x3a')]);return db[_0x4b08('0x3b')][_0x4b08('0x43')](_0x5e40f2)[_0x4b08('0x23')](handleEntityNotFound(_0x3452c1,null))[_0x4b08('0x23')](respondWithResult(_0x3452c1,null))[_0x4b08('0x3f')](handleError(_0x3452c1,null));};exports[_0x4b08('0x44')]=function(_0x5d8631,_0x2fa383){return db['SmsApplication']['create'](_0x5d8631[_0x4b08('0x45')],{})[_0x4b08('0x23')](respondWithResult(_0x2fa383,0xc9))[_0x4b08('0x3f')](handleError(_0x2fa383,null));};exports[_0x4b08('0x22')]=function(_0x57f093,_0x569a7c){if(_0x57f093[_0x4b08('0x45')]['id']){delete _0x57f093[_0x4b08('0x45')]['id'];}return db[_0x4b08('0x3b')][_0x4b08('0x43')]({'where':{'id':_0x57f093[_0x4b08('0x41')]['id']}})[_0x4b08('0x23')](handleEntityNotFound(_0x569a7c,null))[_0x4b08('0x23')](saveUpdates(_0x57f093[_0x4b08('0x45')],null))['then'](respondWithResult(_0x569a7c,null))[_0x4b08('0x3f')](handleError(_0x569a7c,null));};exports['destroy']=function(_0x400d1e,_0x22e754){return db['SmsApplication'][_0x4b08('0x43')]({'where':{'id':_0x400d1e[_0x4b08('0x41')]['id']}})[_0x4b08('0x23')](handleEntityNotFound(_0x22e754,null))[_0x4b08('0x23')](removeEntity(_0x22e754,null))[_0x4b08('0x3f')](handleError(_0x22e754,null));}; \ No newline at end of file +var _0x448a=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','error','stack','name','send','index','map','SmsApplication','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','show','fields','includeAll','find','catch','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x3f5c54,_0x4c602f){var _0xb65451=function(_0x5b76cd){while(--_0x5b76cd){_0x3f5c54['push'](_0x3f5c54['shift']());}};_0xb65451(++_0x4c602f);}(_0x448a,0x1ac));var _0xa448=function(_0x3402da,_0x4c3654){_0x3402da=_0x3402da-0x0;var _0x1acf5f=_0x448a[_0x3402da];return _0x1acf5f;};'use strict';var emlformat=require(_0xa448('0x0'));var rimraf=require(_0xa448('0x1'));var zipdir=require(_0xa448('0x2'));var jsonpatch=require(_0xa448('0x3'));var rp=require('request-promise');var moment=require(_0xa448('0x4'));var BPromise=require(_0xa448('0x5'));var Mustache=require('mustache');var util=require(_0xa448('0x6'));var path=require(_0xa448('0x7'));var sox=require('sox');var csv=require(_0xa448('0x8'));var ejs=require(_0xa448('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa448('0xa'));var squel=require(_0xa448('0xb'));var crypto=require(_0xa448('0xc'));var jsforce=require(_0xa448('0xd'));var deskjs=require(_0xa448('0xe'));var toCsv=require(_0xa448('0x8'));var querystring=require(_0xa448('0xf'));var Papa=require('papaparse');var Redis=require(_0xa448('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa448('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa448('0x12'));var logger=require(_0xa448('0x13'))(_0xa448('0x14'));var utils=require(_0xa448('0x15'));var config=require(_0xa448('0x16'));var licenseUtil=require(_0xa448('0x17'));var db=require(_0xa448('0x18'))['db'];function respondWithStatusCode(_0x59234c,_0x5bf10c){_0x5bf10c=_0x5bf10c||0xcc;return function(_0x2249a6){if(_0x2249a6){return _0x59234c[_0xa448('0x19')](_0x5bf10c);}return _0x59234c[_0xa448('0x1a')](_0x5bf10c)[_0xa448('0x1b')]();};}function respondWithResult(_0x5ab7dd,_0x3da1b4){_0x3da1b4=_0x3da1b4||0xc8;return function(_0x143685){if(_0x143685){return _0x5ab7dd[_0xa448('0x1a')](_0x3da1b4)[_0xa448('0x1c')](_0x143685);}};}function respondWithFilteredResult(_0x543b2c,_0x4f0acc){return function(_0x1ea51a){if(_0x1ea51a){var _0x48498a=typeof _0x4f0acc[_0xa448('0x1d')]===_0xa448('0x1e')&&typeof _0x4f0acc['limit']===_0xa448('0x1e');var _0x4cf3b3=_0x1ea51a[_0xa448('0x1f')];var _0x586fd0=_0x48498a?0x0:_0x4f0acc[_0xa448('0x1d')];var _0x4f484e=_0x48498a?_0x1ea51a[_0xa448('0x1f')]:_0x4f0acc[_0xa448('0x1d')]+_0x4f0acc[_0xa448('0x20')];var _0x1389b0;if(_0x4f484e>=_0x4cf3b3){_0x4f484e=_0x4cf3b3;_0x1389b0=0xc8;}else{_0x1389b0=0xce;}_0x543b2c['status'](_0x1389b0);return _0x543b2c['set']('Content-Range',_0x586fd0+'-'+_0x4f484e+'/'+_0x4cf3b3)[_0xa448('0x1c')](_0x1ea51a);}return null;};}function patchUpdates(_0x157b84){return function(_0x15e951){try{jsonpatch[_0xa448('0x21')](_0x15e951,_0x157b84,!![]);}catch(_0x5be998){return BPromise[_0xa448('0x22')](_0x5be998);}return _0x15e951[_0xa448('0x23')]();};}function saveUpdates(_0x10b478,_0x44ac7d){return function(_0x2b4df4){if(_0x2b4df4){return _0x2b4df4[_0xa448('0x24')](_0x10b478)[_0xa448('0x25')](function(_0x524c0b){return _0x524c0b;});}return null;};}function removeEntity(_0x59f01a,_0x5d9150){return function(_0x9bd961){if(_0x9bd961){return _0x9bd961['destroy']()[_0xa448('0x25')](function(){_0x59f01a[_0xa448('0x1a')](0xcc)[_0xa448('0x1b')]();});}};}function handleEntityNotFound(_0x263674,_0xfed695){return function(_0x4279ef){if(!_0x4279ef){_0x263674[_0xa448('0x19')](0x194);}return _0x4279ef;};}function handleError(_0x3273d7,_0x3fdbf4){_0x3fdbf4=_0x3fdbf4||0x1f4;return function(_0x37fab2){logger[_0xa448('0x26')](_0x37fab2[_0xa448('0x27')]);if(_0x37fab2[_0xa448('0x28')]){delete _0x37fab2['name'];}_0x3273d7['status'](_0x3fdbf4)[_0xa448('0x29')](_0x37fab2);};}exports[_0xa448('0x2a')]=function(_0x5f4789,_0x4c9a2f){var _0x65f0ee={},_0xfc006d={},_0x5cd070={'count':0x0,'rows':[]};var _0x119176=_[_0xa448('0x2b')](db[_0xa448('0x2c')][_0xa448('0x2d')],function(_0x5762d9){return{'name':_0x5762d9['fieldName'],'type':_0x5762d9[_0xa448('0x2e')][_0xa448('0x2f')]};});_0xfc006d[_0xa448('0x30')]=_[_0xa448('0x2b')](_0x119176,_0xa448('0x28'));_0xfc006d[_0xa448('0x31')]=_[_0xa448('0x32')](_0x5f4789[_0xa448('0x31')]);_0xfc006d[_0xa448('0x33')]=_[_0xa448('0x34')](_0xfc006d['model'],_0xfc006d[_0xa448('0x31')]);_0x65f0ee[_0xa448('0x35')]=_[_0xa448('0x34')](_0xfc006d['model'],qs['fields'](_0x5f4789[_0xa448('0x31')]['fields']));_0x65f0ee['attributes']=_0x65f0ee[_0xa448('0x35')][_0xa448('0x36')]?_0x65f0ee[_0xa448('0x35')]:_0xfc006d['model'];if(!_0x5f4789[_0xa448('0x31')][_0xa448('0x37')](_0xa448('0x38'))){_0x65f0ee[_0xa448('0x20')]=qs[_0xa448('0x20')](_0x5f4789['query']['limit']);_0x65f0ee[_0xa448('0x1d')]=qs[_0xa448('0x1d')](_0x5f4789[_0xa448('0x31')]['offset']);}_0x65f0ee[_0xa448('0x39')]=qs[_0xa448('0x3a')](_0x5f4789['query']['sort']);_0x65f0ee[_0xa448('0x3b')]=qs[_0xa448('0x33')](_[_0xa448('0x3c')](_0x5f4789['query'],_0xfc006d['filters']),_0x119176);if(_0x5f4789[_0xa448('0x31')][_0xa448('0x3d')]){_0x65f0ee['where']=_[_0xa448('0x3e')](_0x65f0ee[_0xa448('0x3b')],{'$or':_[_0xa448('0x2b')](_0x119176,function(_0x3a75b1){if(_0x3a75b1[_0xa448('0x2e')]!==_0xa448('0x3f')){var _0x2ca690={};_0x2ca690[_0x3a75b1[_0xa448('0x28')]]={'$like':'%'+_0x5f4789[_0xa448('0x31')][_0xa448('0x3d')]+'%'};return _0x2ca690;}})});}_0x65f0ee=_[_0xa448('0x3e')]({},_0x65f0ee,_0x5f4789[_0xa448('0x40')]);var _0x2078a8={'where':_0x65f0ee[_0xa448('0x3b')]};return db[_0xa448('0x2c')][_0xa448('0x1f')](_0x2078a8)[_0xa448('0x25')](function(_0x17bbf4){_0x5cd070['count']=_0x17bbf4;if(_0x5f4789[_0xa448('0x31')]['includeAll']){_0x65f0ee['include']=[{'all':!![]}];}return db[_0xa448('0x2c')][_0xa448('0x41')](_0x65f0ee);})['then'](function(_0x5580d6){_0x5cd070['rows']=_0x5580d6;return _0x5cd070;})[_0xa448('0x25')](respondWithFilteredResult(_0x4c9a2f,_0x65f0ee))['catch'](handleError(_0x4c9a2f,null));};exports[_0xa448('0x42')]=function(_0x2654f2,_0x219d62){var _0x1b3335={'raw':!![],'where':{'id':_0x2654f2['params']['id']}},_0x43de79={};_0x43de79[_0xa448('0x30')]=_[_0xa448('0x32')](db[_0xa448('0x2c')][_0xa448('0x2d')]);_0x43de79[_0xa448('0x31')]=_[_0xa448('0x32')](_0x2654f2[_0xa448('0x31')]);_0x43de79['filters']=_['intersection'](_0x43de79[_0xa448('0x30')],_0x43de79[_0xa448('0x31')]);_0x1b3335[_0xa448('0x35')]=_[_0xa448('0x34')](_0x43de79['model'],qs[_0xa448('0x43')](_0x2654f2[_0xa448('0x31')]['fields']));_0x1b3335[_0xa448('0x35')]=_0x1b3335[_0xa448('0x35')][_0xa448('0x36')]?_0x1b3335[_0xa448('0x35')]:_0x43de79[_0xa448('0x30')];if(_0x2654f2[_0xa448('0x31')][_0xa448('0x44')]){_0x1b3335['include']=[{'all':!![]}];}_0x1b3335=_[_0xa448('0x3e')]({},_0x1b3335,_0x2654f2[_0xa448('0x40')]);return db['SmsApplication'][_0xa448('0x45')](_0x1b3335)[_0xa448('0x25')](handleEntityNotFound(_0x219d62,null))[_0xa448('0x25')](respondWithResult(_0x219d62,null))[_0xa448('0x46')](handleError(_0x219d62,null));};exports[_0xa448('0x47')]=function(_0x2818f6,_0x44fe37){return db[_0xa448('0x2c')][_0xa448('0x47')](_0x2818f6[_0xa448('0x48')],{})[_0xa448('0x25')](respondWithResult(_0x44fe37,0xc9))[_0xa448('0x46')](handleError(_0x44fe37,null));};exports[_0xa448('0x24')]=function(_0x51546c,_0x5ec43a){if(_0x51546c[_0xa448('0x48')]['id']){delete _0x51546c[_0xa448('0x48')]['id'];}return db[_0xa448('0x2c')]['find']({'where':{'id':_0x51546c[_0xa448('0x49')]['id']}})['then'](handleEntityNotFound(_0x5ec43a,null))[_0xa448('0x25')](saveUpdates(_0x51546c[_0xa448('0x48')],null))['then'](respondWithResult(_0x5ec43a,null))['catch'](handleError(_0x5ec43a,null));};exports[_0xa448('0x4a')]=function(_0x160703,_0x4e98bb){return db['SmsApplication'][_0xa448('0x45')]({'where':{'id':_0x160703[_0xa448('0x49')]['id']}})[_0xa448('0x25')](handleEntityNotFound(_0x4e98bb,null))[_0xa448('0x25')](removeEntity(_0x4e98bb,null))['catch'](handleError(_0x4e98bb,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 37ba81b..a025bb2 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 _0x94b9=['lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x175ee9,_0x5b77cd){var _0x52b9d0=function(_0x231dd2){while(--_0x231dd2){_0x175ee9['push'](_0x175ee9['shift']());}};_0x52b9d0(++_0x5b77cd);}(_0x94b9,0x1ad));var _0x994b=function(_0x2d6049,_0x5c1e34){_0x2d6049=_0x2d6049-0x0;var _0x354a30=_0x94b9[_0x2d6049];return _0x354a30;};'use strict';var _=require(_0x994b('0x0'));var util=require('util');var logger=require(_0x994b('0x1'))(_0x994b('0x2'));var moment=require(_0x994b('0x3'));var BPromise=require('bluebird');var rp=require(_0x994b('0x4'));var fs=require('fs');var path=require(_0x994b('0x5'));var rimraf=require('rimraf');var config=require(_0x994b('0x6'));var attributes=require('./smsApplication.attributes');module[_0x994b('0x7')]=function(_0xfa8dd2,_0x4c3761){return _0xfa8dd2[_0x994b('0x8')](_0x994b('0x9'),attributes,{'tableName':_0x994b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x994b('0xb'),'collate':_0x994b('0xc')});}; \ No newline at end of file +var _0x4104=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','define','SmsApplication','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x54aea3,_0xae7d81){var _0x21ae46=function(_0xe16dbc){while(--_0xe16dbc){_0x54aea3['push'](_0x54aea3['shift']());}};_0x21ae46(++_0xae7d81);}(_0x4104,0x180));var _0x4410=function(_0x4de877,_0x340170){_0x4de877=_0x4de877-0x0;var _0xb2cfeb=_0x4104[_0x4de877];return _0xb2cfeb;};'use strict';var _=require('lodash');var util=require(_0x4410('0x0'));var logger=require(_0x4410('0x1'))('api');var moment=require(_0x4410('0x2'));var BPromise=require(_0x4410('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4410('0x4'));var rimraf=require(_0x4410('0x5'));var config=require(_0x4410('0x6'));var attributes=require('./smsApplication.attributes');module['exports']=function(_0xc20ff7,_0x17d0bc){return _0xc20ff7[_0x4410('0x7')](_0x4410('0x8'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4410('0x9'),'collate':_0x4410('0xa')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index bc8f642..85283c0 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 _0x0120=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x34fe7e,_0x2bb081){var _0x30e547=function(_0x439379){while(--_0x439379){_0x34fe7e['push'](_0x34fe7e['shift']());}};_0x30e547(++_0x2bb081);}(_0x0120,0x6f));var _0x0012=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x0120[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var moment=require(_0x0012('0x2'));var BPromise=require(_0x0012('0x3'));var rs=require(_0x0012('0x4'));var fs=require('fs');var Redis=require(_0x0012('0x5'));var db=require(_0x0012('0x6'))['db'];var utils=require(_0x0012('0x7'));var logger=require(_0x0012('0x8'))(_0x0012('0x9'));var config=require(_0x0012('0xa'));var jayson=require(_0x0012('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59980a,_0x95d441,_0x436af8){return new BPromise(function(_0x3d4c64,_0x30176d){return client[_0x0012('0xc')](_0x59980a,_0x436af8)['then'](function(_0x14991f){logger[_0x0012('0xd')](_0x0012('0xe'),_0x95d441,_0x0012('0xf'));logger['debug'](_0x0012('0x10'),_0x95d441,'request\x20sent',JSON[_0x0012('0x11')](_0x14991f));if(_0x14991f[_0x0012('0x12')]){if(_0x14991f[_0x0012('0x12')][_0x0012('0x13')]===0x1f4){logger[_0x0012('0x12')]('SmsApplication,\x20%s,\x20%s',_0x95d441,_0x14991f[_0x0012('0x12')]['message']);return _0x30176d(_0x14991f['error']['message']);}logger['error'](_0x0012('0xe'),_0x95d441,_0x14991f['error'][_0x0012('0x14')]);return _0x3d4c64(_0x14991f[_0x0012('0x12')]['message']);}else{logger[_0x0012('0xd')](_0x0012('0xe'),_0x95d441,_0x0012('0xf'));_0x3d4c64(_0x14991f[_0x0012('0x15')]['message']);}})['catch'](function(_0x1e7fbe){logger[_0x0012('0x12')](_0x0012('0xe'),_0x95d441,_0x1e7fbe);_0x30176d(_0x1e7fbe);});});} \ No newline at end of file +var _0x7c71=['debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x3fab0f,_0xee2c28){var _0x596d21=function(_0x2ebb24){while(--_0x2ebb24){_0x3fab0f['push'](_0x3fab0f['shift']());}};_0x596d21(++_0xee2c28);}(_0x7c71,0x177));var _0x17c7=function(_0x4d21ff,_0x19d202){_0x4d21ff=_0x4d21ff-0x0;var _0x22b554=_0x7c71[_0x4d21ff];return _0x22b554;};'use strict';var _=require(_0x17c7('0x0'));var util=require(_0x17c7('0x1'));var moment=require(_0x17c7('0x2'));var BPromise=require(_0x17c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x17c7('0x4'));var db=require(_0x17c7('0x5'))['db'];var utils=require(_0x17c7('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x17c7('0x7'));var jayson=require(_0x17c7('0x8'));var client=jayson[_0x17c7('0x9')][_0x17c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c061b,_0xf284a2,_0x1ff4ec){return new BPromise(function(_0x50feb0,_0x13fdad){return client[_0x17c7('0xb')](_0x3c061b,_0x1ff4ec)[_0x17c7('0xc')](function(_0xdb3575){logger[_0x17c7('0xd')](_0x17c7('0xe'),_0xf284a2,_0x17c7('0xf'));logger[_0x17c7('0x10')](_0x17c7('0x11'),_0xf284a2,_0x17c7('0xf'),JSON['stringify'](_0xdb3575));if(_0xdb3575['error']){if(_0xdb3575[_0x17c7('0x12')][_0x17c7('0x13')]===0x1f4){logger['error'](_0x17c7('0xe'),_0xf284a2,_0xdb3575[_0x17c7('0x12')]['message']);return _0x13fdad(_0xdb3575[_0x17c7('0x12')][_0x17c7('0x14')]);}logger['error']('SmsApplication,\x20%s,\x20%s',_0xf284a2,_0xdb3575[_0x17c7('0x12')][_0x17c7('0x14')]);return _0x50feb0(_0xdb3575[_0x17c7('0x12')][_0x17c7('0x14')]);}else{logger[_0x17c7('0xd')](_0x17c7('0xe'),_0xf284a2,_0x17c7('0xf'));_0x50feb0(_0xdb3575[_0x17c7('0x15')][_0x17c7('0x14')]);}})[_0x17c7('0x16')](function(_0x296f9c){logger[_0x17c7('0x12')]('SmsApplication,\x20%s,\x20%s',_0xf284a2,_0x296f9c);_0x13fdad(_0x296f9c);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index bd6559d..cbad3f3 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 _0xea28=['put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','/:id/download','download','create','post','tracked','sms','smsinteraction:addtags','addTags'];(function(_0x57412d,_0x5eafa2){var _0xf911bd=function(_0x5519f4){while(--_0x5519f4){_0x57412d['push'](_0x57412d['shift']());}};_0xf911bd(++_0x5eafa2);}(_0xea28,0x13a));var _0x8ea2=function(_0x2ca82c,_0xe1fc2d){_0x2ca82c=_0x2ca82c-0x0;var _0x36c400=_0xea28[_0x2ca82c];return _0x36c400;};'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['getMessages']);router['get'](_0x8ea2('0x12'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x13')]);router['post']('/',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x14')]);router[_0x8ea2('0x15')](_0x8ea2('0x11'),auth[_0x8ea2('0xd')](),controller['addMessage']);router[_0x8ea2('0x15')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x8ea2('0x18')),controller[_0x8ea2('0x19')]);router[_0x8ea2('0x1a')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),interaction[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x8ea2('0x1b')),controller[_0x8ea2('0x1c')]);router[_0x8ea2('0x1d')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),interaction[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x8ea2('0x1e')),controller[_0x8ea2('0x1f')]);router[_0x8ea2('0x1d')](_0x8ea2('0x20'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x21')]);module['exports']=router; \ No newline at end of file +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(_0x2b6f78,_0x706fcc){var _0x2ecdea=function(_0x22ec72){while(--_0x22ec72){_0x2b6f78['push'](_0x2b6f78['shift']());}};_0x2ecdea(++_0x706fcc);}(_0x3c81,0x102));var _0x13c8=function(_0x1400c9,_0x4d6d41){_0x1400c9=_0x1400c9-0x0;var _0x109a72=_0x3c81[_0x1400c9];return _0x109a72;};'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 diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 2c8bccc..441add2 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 _0xbdb9=['DATE','STRING','ENUM','out','sequelize','moment','exports','BOOLEAN'];(function(_0x5e5088,_0x28cd71){var _0x3de657=function(_0x2a8595){while(--_0x2a8595){_0x5e5088['push'](_0x5e5088['shift']());}};_0x3de657(++_0x28cd71);}(_0xbdb9,0xac));var _0x9bdb=function(_0x594824,_0x28855c){_0x594824=_0x594824-0x0;var _0x837fcc=_0xbdb9[_0x594824];return _0x837fcc;};'use strict';var Sequelize=require(_0x9bdb('0x0'));var moment=require(_0x9bdb('0x1'));module[_0x9bdb('0x2')]={'closed':{'type':Sequelize[_0x9bdb('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9bdb('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9bdb('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x9bdb('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9bdb('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x9bdb('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9bdb('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xbc8d=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x4879b8,_0x55569f){var _0x34abae=function(_0x49b347){while(--_0x49b347){_0x4879b8['push'](_0x4879b8['shift']());}};_0x34abae(++_0x55569f);}(_0xbc8d,0x15b));var _0xdbc8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc8d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xdbc8('0x0'));var moment=require('moment');module[_0xdbc8('0x1')]={'closed':{'type':Sequelize[_0xdbc8('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xdbc8('0x3')]},'disposition':{'type':Sequelize[_0xdbc8('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xdbc8('0x4')]},'note':{'type':Sequelize[_0xdbc8('0x4')]},'phone':{'type':Sequelize[_0xdbc8('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xdbc8('0x5')]('in',_0xdbc8('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xdbc8('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xdbc8('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 8afb480..cdf3d30 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 _0x82a0=['root','server','files','attachments','transcript-%d-%s.zip','CmContact','lastName','createdAt','direction','secret','Owner','mkdirSync','Sms','Account','N.A.','closedAt','disposition','Messages','out','firstName','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','Users','fullname','TagIds','split','forEach','Tags','push','catch','waiting','talking','total','closed','UserId','answered','unmanaged','index','map','SmsInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.id','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','`\x20=\x200','having','`\x20>\x200','Contact','$substring','value','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','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','start','body','some','compact','isEmpty','concat','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','SmsAccountId','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','merge','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.mobile','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','all','rows','show','params','includeAll','include','create','update','describe','addMessage','SmsMessage','ids','getMessages','SmsInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','spread','emit','smsInteractionTags:save','removeTags','download','unix','join'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x82a0,0x109));var _0x082a=function(_0xa45395,_0x5579e6){_0xa45395=_0xa45395-0x0;var _0x3c83d2=_0x82a0[_0xa45395];return _0x3c83d2;};'use strict';var emlformat=require(_0x082a('0x0'));var rimraf=require(_0x082a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x082a('0x2'));var rp=require(_0x082a('0x3'));var moment=require(_0x082a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x082a('0x5'));var util=require('util');var path=require(_0x082a('0x6'));var sox=require(_0x082a('0x7'));var csv=require(_0x082a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x082a('0x9'));var squel=require(_0x082a('0xa'));var crypto=require(_0x082a('0xb'));var jsforce=require(_0x082a('0xc'));var deskjs=require(_0x082a('0xd'));var toCsv=require(_0x082a('0x8'));var querystring=require(_0x082a('0xe'));var Papa=require(_0x082a('0xf'));var Redis=require(_0x082a('0x10'));var authService=require(_0x082a('0x11'));var qs=require(_0x082a('0x12'));var as=require(_0x082a('0x13'));var pdf=require(_0x082a('0x14'));var hardwareService=require(_0x082a('0x15'));var logger=require(_0x082a('0x16'))(_0x082a('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x082a('0x18'));var db=require(_0x082a('0x19'))['db'];config[_0x082a('0x1a')]=_[_0x082a('0x1b')](config['redis'],{'host':_0x082a('0x1c'),'port':0x18eb});var socket=require(_0x082a('0x1d'))(new Redis(config['redis']));require(_0x082a('0x1e'))['register'](socket);function respondWithStatusCode(_0x12fc7a,_0x200a68){_0x200a68=_0x200a68||0xcc;return function(_0x50ee90){if(_0x50ee90){return _0x12fc7a['sendStatus'](_0x200a68);}return _0x12fc7a['status'](_0x200a68)[_0x082a('0x1f')]();};}function respondWithResult(_0x596076,_0x41a0d4){_0x41a0d4=_0x41a0d4||0xc8;return function(_0x208ed6){if(_0x208ed6){return _0x596076[_0x082a('0x20')](_0x41a0d4)['json'](_0x208ed6);}};}function respondWithFilteredResult(_0x52e26a,_0x29a8fa){return function(_0x5d7461){if(_0x5d7461){var _0x17cdc3=typeof _0x29a8fa[_0x082a('0x21')]===_0x082a('0x22')&&typeof _0x29a8fa[_0x082a('0x23')]===_0x082a('0x22');var _0x38b8ad=_0x5d7461[_0x082a('0x24')];var _0x24f2cb=_0x17cdc3?0x0:_0x29a8fa[_0x082a('0x21')];var _0x426914=_0x17cdc3?_0x5d7461[_0x082a('0x24')]:_0x29a8fa[_0x082a('0x21')]+_0x29a8fa['limit'];var _0x3bbb99;if(_0x426914>=_0x38b8ad){_0x426914=_0x38b8ad;_0x3bbb99=0xc8;}else{_0x3bbb99=0xce;}_0x52e26a[_0x082a('0x20')](_0x3bbb99);return _0x52e26a[_0x082a('0x25')](_0x082a('0x26'),_0x24f2cb+'-'+_0x426914+'/'+_0x38b8ad)[_0x082a('0x27')](_0x5d7461);}return null;};}function patchUpdates(_0x5a78c4){return function(_0x2fdd39){try{jsonpatch[_0x082a('0x28')](_0x2fdd39,_0x5a78c4,!![]);}catch(_0x1b9c10){return BPromise[_0x082a('0x29')](_0x1b9c10);}return _0x2fdd39[_0x082a('0x2a')]();};}function saveUpdates(_0x4f76be,_0x2bf60e){return function(_0x3a1fd3){if(_0x3a1fd3){return _0x3a1fd3['update'](_0x4f76be)[_0x082a('0x2b')](function(_0x291775){return _0x291775;});}return null;};}function removeEntity(_0x34f896,_0x5ef341){return function(_0x2898d1){if(_0x2898d1){return _0x2898d1[_0x082a('0x2c')]()[_0x082a('0x2b')](function(){_0x34f896[_0x082a('0x20')](0xcc)[_0x082a('0x1f')]();});}};}function handleEntityNotFound(_0x2214f7,_0x54f471){return function(_0x498c5a){if(!_0x498c5a){_0x2214f7[_0x082a('0x2d')](0x194);}return _0x498c5a;};}function handleError(_0x25bab3,_0x52b58b){_0x52b58b=_0x52b58b||0x1f4;return function(_0x4d8c1c){logger[_0x082a('0x2e')](_0x4d8c1c[_0x082a('0x2f')]);if(_0x4d8c1c[_0x082a('0x30')]){delete _0x4d8c1c[_0x082a('0x30')];}_0x25bab3[_0x082a('0x20')](_0x52b58b)[_0x082a('0x31')](_0x4d8c1c);};}function getInteractionUsers(_0x488067,_0x4e8569){return new BPromise(function(_0x465b2a,_0x7f749d){try{if(_0x4e8569[_0x488067['id']]){_0x488067[_0x082a('0x32')]=_['map'](_0x4e8569[_0x488067['id']],function(_0x391c35){return{'id':_0x391c35['id'],'fullname':_0x391c35[_0x082a('0x33')]};});}}catch(_0x542805){_0x7f749d(_0x542805);}_0x465b2a(_0x488067);});}function getInteractionTags(_0x5ddad4,_0x5304df){return new BPromise(function(_0x41280e,_0x611371){try{if(_0x5ddad4[_0x082a('0x34')]){_0x5ddad4['Tags']=[];_0x5ddad4[_0x082a('0x34')][_0x082a('0x35')](',')[_0x082a('0x36')](function(_0x13c8b9){_0x5ddad4[_0x082a('0x37')][_0x082a('0x38')](_0x5304df[_0x13c8b9]);});}delete _0x5ddad4[_0x082a('0x34')];}catch(_0xdd54f){_0x611371(_0xdd54f);}_0x41280e(_0x5ddad4);});}function updateSmsInteraction(_0x361e90,_0x166d40,_0x4aec1a){return new BPromise(function(_0x57b93a,_0x551300){return getInteractionUsers(_0x361e90,_0x4aec1a)['then'](function(_0x17ae16){return getInteractionTags(_0x17ae16,_0x166d40);})['then'](function(_0x39cae5){return getStateInteraction(_0x39cae5);})[_0x082a('0x2b')](function(_0x961931){_0x57b93a(_0x961931);})[_0x082a('0x39')](function(_0x2a8bb4){_0x551300(_0x2a8bb4);});});}function getStateInteraction(_0x3be96a){return new BPromise(function(_0x1f3179){_0x3be96a[_0x082a('0x3a')]=0x0;_0x3be96a[_0x082a('0x3b')]=0x0;_0x3be96a['answered']=0x0;_0x3be96a['unmanaged']=0x0;_0x3be96a[_0x082a('0x3c')]=0x0;if(!_0x3be96a[_0x082a('0x3d')]&&!_0x3be96a[_0x082a('0x3e')]){_0x3be96a[_0x082a('0x3a')]+=0x1;}if(!_0x3be96a['closed']&&_0x3be96a[_0x082a('0x3e')]){_0x3be96a[_0x082a('0x3b')]+=0x1;if(_0x3be96a[_0x082a('0x3a')]){_0x3be96a['waiting']-=0x1;}}if(_0x3be96a[_0x082a('0x3d')]&&_0x3be96a[_0x082a('0x3e')]){_0x3be96a[_0x082a('0x3f')]+=0x1;if(_0x3be96a[_0x082a('0x3b')]){_0x3be96a[_0x082a('0x3b')]-=0x1;}}if(_0x3be96a[_0x082a('0x3d')]&&!_0x3be96a[_0x082a('0x3e')]){_0x3be96a[_0x082a('0x40')]+=0x1;if(_0x3be96a[_0x082a('0x3a')]){_0x3be96a[_0x082a('0x3a')]-=0x1;}}_0x3be96a['total']+=0x1;_0x1f3179(_0x3be96a);});}exports[_0x082a('0x41')]=function(_0x36979b,_0x3d37bb){var _0x1050a0={},_0x5a57ce={},_0x55be36={'count':0x0,'rows':[]};var _0x12b968=_[_0x082a('0x42')](db[_0x082a('0x43')][_0x082a('0x44')],function(_0x5e59ed){return{'name':_0x5e59ed[_0x082a('0x45')],'type':_0x5e59ed[_0x082a('0x46')][_0x082a('0x47')]};});_0x5a57ce[_0x082a('0x48')]=_['map'](_0x12b968,_0x082a('0x30'));_0x5a57ce[_0x082a('0x49')]=_[_0x082a('0x4a')](_0x36979b[_0x082a('0x49')]);_0x5a57ce[_0x082a('0x4b')]=_['intersection'](_0x5a57ce[_0x082a('0x48')],_0x5a57ce[_0x082a('0x49')]);_0x1050a0['attributes']=_[_0x082a('0x4c')](_0x5a57ce['model'],qs[_0x082a('0x4d')](_0x36979b[_0x082a('0x49')][_0x082a('0x4d')]));_0x1050a0[_0x082a('0x4e')]=_0x1050a0['attributes'][_0x082a('0x4f')]?_0x1050a0['attributes']:_0x5a57ce[_0x082a('0x48')];if(!_0x36979b[_0x082a('0x49')][_0x082a('0x50')](_0x082a('0x51'))){_0x1050a0[_0x082a('0x23')]=qs[_0x082a('0x23')](_0x36979b[_0x082a('0x49')][_0x082a('0x23')]);_0x1050a0[_0x082a('0x21')]=qs[_0x082a('0x21')](_0x36979b[_0x082a('0x49')]['offset']);}_0x1050a0[_0x082a('0x52')]=qs[_0x082a('0x53')](_0x36979b[_0x082a('0x49')]['sort']);_0x1050a0[_0x082a('0x54')]=qs[_0x082a('0x4b')](_[_0x082a('0x55')](_0x36979b[_0x082a('0x49')],_0x5a57ce[_0x082a('0x4b')]),_0x12b968);var _0x4b70=[];var _0x590abb=squel[_0x082a('0x56')]()[_0x082a('0x57')]('id')[_0x082a('0x57')](_0x082a('0x30'))[_0x082a('0x57')](_0x082a('0x58'))['from'](_0x082a('0x59'));var _0x21b363=squel['select']()[_0x082a('0x57')](_0x082a('0x5a'))[_0x082a('0x57')]('u.fullname')['field'](_0x082a('0x5b'))[_0x082a('0x5c')](_0x082a('0x5d'),'ui')[_0x082a('0x5e')](_0x082a('0x5f'),'u',_0x082a('0x60'));var _0xb672e3=squel[_0x082a('0x56')]()[_0x082a('0x5c')](_0x082a('0x61'),'i')[_0x082a('0x5e')](_0x082a('0x62'),'c',_0x082a('0x63'))['left_join'](_0x082a('0x5f'),'o',_0x082a('0x64'))[_0x082a('0x5e')](_0x082a('0x65'),'a',_0x082a('0x66'))[_0x082a('0x5e')](_0x082a('0x67'),'me','me.SmsInteractionId\x20=\x20i.id')[_0x082a('0x5e')](_0x082a('0x68'),'it',_0x082a('0x69'))['left_join'](_0x082a('0x59'),'t',_0x082a('0x6a'));var _0x148f0b=squel[_0x082a('0x6b')]();var _0x401817=[];var _0x389add=squel[_0x082a('0x6b')]();var _0x3b112e;if(_0x36979b[_0x082a('0x49')]['search']){_0x3b112e=as['parseSearch'](_0x36979b[_0x082a('0x49')][_0x082a('0x6c')]);var _0x59211e=_0x3b112e[_0x082a('0x6d')];for(var _0x4da192=0x0;_0x4da192<_0x3b112e['conditions']['length'];_0x4da192++){var _0xb242ff=_0x3b112e[_0x082a('0x6e')][_0x4da192];var _0x462e3b='i';var _0x97f70e=_[_0x082a('0x6f')](_0x12b968,[_0x082a('0x30'),_0xb242ff['field']]);if(!_0x97f70e){switch(_0xb242ff[_0x082a('0x57')]){case'unreadMessages':if(_0xb242ff['value']==0x1){_0xb672e3['having']('`'+_0xb242ff['field']+_0x082a('0x70'));}else{_0xb672e3[_0x082a('0x71')]('`'+_0xb242ff[_0x082a('0x57')]+_0x082a('0x72'));}break;case _0x082a('0x73'):if(_0xb242ff['operator']===_0x082a('0x74')){if(_0xb242ff[_0x082a('0x75')][_0x082a('0x35')]('\x20')[_0x082a('0x4f')]>0x1){_0x148f0b[_0x59211e](_0x082a('0x76'),qs[_0x082a('0x77')](_0xb242ff[_0x082a('0x75')]),null);}else{var _0x3e37a2='%'+_0xb242ff['value']+'%';_0x148f0b[_0x59211e](_0x082a('0x78'),_0x3e37a2,_0x3e37a2,_0x3e37a2);}}else{_0x97f70e=_[_0x082a('0x6f')](_0x12b968,[_0x082a('0x30'),_0x082a('0x79')]);_0xb242ff['field']=_0x082a('0x79');_0x1938f5=as[_0x082a('0x7a')](_0x462e3b,_0x97f70e['type'],_0xb242ff);_0x148f0b[_0x59211e](_0x1938f5['text'],_0x1938f5[_0x082a('0x75')]['start'],_0x1938f5[_0x082a('0x75')][_0x082a('0x1f')]);}break;case _0x082a('0x7b'):var _0x3d5342=_0xb242ff['value'][_0x082a('0x35')](',')['map'](function(_0x2b9f71){return Number(_0x2b9f71);});_0x3d5342[_0x082a('0x36')](function(_0x45a440){_0x389add['or'](_0x082a('0x7c'),'%,'+_0x45a440+',%');});_0x401817=_[_0x082a('0x7d')](_0x401817,_0x3d5342);break;case _0x082a('0x7e'):if(_0xb242ff[_0x082a('0x7f')]===_0x082a('0x74')){_0x148f0b[_0x59211e](_0x082a('0x80'),'%'+_0xb242ff[_0x082a('0x75')]+'%',null);}else{_0x97f70e=_[_0x082a('0x6f')](_0x12b968,[_0x082a('0x30'),_0x082a('0x3e')]);_0xb242ff[_0x082a('0x57')]=_0x082a('0x3e');_0x1938f5=as[_0x082a('0x7a')](_0x462e3b,_0x97f70e[_0x082a('0x46')],_0xb242ff);_0x148f0b[_0x59211e](_0x1938f5[_0x082a('0x81')],_0x1938f5[_0x082a('0x75')][_0x082a('0x82')],_0x1938f5[_0x082a('0x75')][_0x082a('0x1f')]);}break;case _0x082a('0x83'):_0x1938f5=as['buildExpression']('me',null,_0xb242ff);_0x148f0b[_0x59211e](_0x1938f5['text'],_0x1938f5[_0x082a('0x75')][_0x082a('0x82')],_0x1938f5['value'][_0x082a('0x1f')]);break;}}else{var _0x1938f5=as[_0x082a('0x7a')](_0x462e3b,_0x97f70e[_0x082a('0x46')],_0xb242ff);_0x148f0b[_0x59211e](_0x1938f5[_0x082a('0x81')],_0x1938f5[_0x082a('0x75')][_0x082a('0x82')],_0x1938f5['value'][_0x082a('0x1f')]);}}}else{var _0x363dd4=_(_0x36979b[_0x082a('0x49')])['keys']()[_0x082a('0x42')](function(_0x1e1cd1){return _[_0x082a('0x84')](_0x12b968,['name',_0x1e1cd1])?_0x1e1cd1:undefined;})[_0x082a('0x85')]()[_0x082a('0x75')]();if(!_[_0x082a('0x86')](_0x363dd4)){_0x363dd4[_0x082a('0x36')](function(_0x366922){if(_0x366922==='SmsAccountId'){_0xb672e3[_0x082a('0x54')]('i.SmsAccountId\x20IN\x20?',[][_0x082a('0x87')](_0x36979b[_0x082a('0x49')][_0x366922]));}else if(_0x366922==='createdAt'){var _0x3bc481=JSON['parse'](_0x36979b[_0x082a('0x49')][_0x366922])[_0x082a('0x88')];var _0x72345a=JSON['parse'](_0x36979b[_0x082a('0x49')][_0x366922])[_0x082a('0x89')];_0xb672e3[_0x082a('0x54')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3bc481,_0x72345a);}else{if(_0x36979b[_0x082a('0x49')][_0x366922]===_0x082a('0x8a')){_0xb672e3['where']('i.'+_0x366922+_0x082a('0x8b'));}else{_0xb672e3[_0x082a('0x54')]('i.'+_0x366922+_0x082a('0x8c'),_0x36979b[_0x082a('0x49')][_0x366922]);}}});}if(_0x36979b[_0x082a('0x49')][_0x082a('0x8d')]){if(_0x36979b[_0x082a('0x49')]['read']==0x1){_0xb672e3[_0x082a('0x71')](_0x082a('0x8e'));}else{_0xb672e3[_0x082a('0x71')](_0x082a('0x8f'));}}if(_0x36979b[_0x082a('0x49')][_0x082a('0x90')]){_0x401817=_[_0x082a('0x91')](_0x36979b[_0x082a('0x49')][_0x082a('0x90')])?_0x36979b[_0x082a('0x49')][_0x082a('0x90')]:new Array(_0x36979b[_0x082a('0x49')][_0x082a('0x90')]);_0x401817[_0x082a('0x36')](function(_0x5ce502){_0x389add['or'](_0x082a('0x7c'),'%,'+_0x5ce502+',%');});}if(_0x36979b[_0x082a('0x49')][_0x082a('0x92')]){var _0x4b3941=_0x36979b[_0x082a('0x49')][_0x082a('0x92')][_0x082a('0x93')]('\x5c','\x5c\x5c')[_0x082a('0x93')](/'/g,'\x27\x27');if(qs[_0x082a('0x94')](_0x4b3941)){_0x148f0b['or'](_0x082a('0x95'),_0x4b3941+'%')['or'](_0x082a('0x96'),_0x4b3941+'%');}else{_0x148f0b['or'](_0x082a('0x97'),qs[_0x082a('0x77')](_0x4b3941))['or'](_0x082a('0x98'),_0x4b3941+'%');}}}_0xb672e3[_0x082a('0x54')](_0x148f0b);_0xb672e3[_0x082a('0x99')]('i.id');var _0x4678e0={'type':db['Sequelize'][_0x082a('0x9a')][_0x082a('0x9b')],'raw':!![]};var _0x372c57=_0xb672e3['clone']();_0x372c57[_0x082a('0x57')](_0x082a('0x9c'));_0x372c57[_0x082a('0x57')](_0x082a('0x9d'),_0x082a('0x9e'));if(_0x1050a0['order']){_0x1050a0[_0x082a('0x52')]['forEach'](function(_0xac7eba){var _0x20f14a=_0xac7eba[0x0]===_0x082a('0x9f')?_0xac7eba[0x0]:'i.'+_0xac7eba[0x0];_0xb672e3[_0x082a('0x52')](_0x20f14a,_0xac7eba[0x1]===_0x082a('0xa0')?![]:!![]);});}if(!_[_0x082a('0x86')](_0x401817)){_0xb672e3[_0x082a('0x71')](_0x389add);_0x372c57[_0x082a('0x54')](_0x082a('0xa1'),_0x401817);}BPromise[_0x082a('0xa2')]()[_0x082a('0x2b')](function(){if(!_0x3b112e){if(_0x36979b[_0x082a('0x49')][_0x082a('0xa3')])return;_0x372c57[_0x082a('0x54')](_0x082a('0xa4'));_0xb672e3['where'](_0x082a('0xa4'));return;}if(_0x36979b[_0x082a('0xa5')][_0x082a('0xa6')]!==_0x082a('0xa7'))return;return _0x36979b[_0x082a('0xa5')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x082a('0x2b')](function(_0x596a15){if(_[_0x082a('0x86')](_0x596a15)){_0x372c57['where'](_0x082a('0xa8'));_0xb672e3[_0x082a('0x54')](_0x082a('0xa8'));}else{_0x372c57[_0x082a('0x54')](_0x082a('0xa9'),_['map'](_0x596a15,'id'));_0xb672e3[_0x082a('0x54')](_0x082a('0xa9'),_[_0x082a('0x42')](_0x596a15,'id'));}});})['then'](function(){if(_0x36979b[_0x082a('0xa5')][_0x082a('0xa6')]===_0x082a('0xa7')&&!_0x3b112e&&!_0x36979b[_0x082a('0x49')][_0x082a('0xa3')])return[];return db[_0x082a('0xaa')][_0x082a('0x49')](_0x372c57['toString'](),_0x4678e0);})[_0x082a('0x2b')](function(_0x2debde){_0x55be36[_0x082a('0x24')]=_0x2debde[_0x082a('0x4f')];if(_0x55be36[_0x082a('0x24')]===0x0)return[];return db['sequelize'][_0x082a('0x49')](_0x590abb[_0x082a('0xab')](),_0x4678e0)[_0x082a('0x2b')](function(_0x3bb52){_0x4b70=_['keyBy'](_0x3bb52,'id');_0x4678e0=_[_0x082a('0xac')](_0x4678e0,{'model':db[_0x082a('0x43')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x36979b[_0x082a('0x49')]['fields']){_0x1050a0['attributes'][_0x082a('0x36')](function(_0x19a85a){_0xb672e3[_0x082a('0x57')]('i.'+_0x19a85a);});}else{_0xb672e3[_0x082a('0x57')](_0x082a('0x9d'),_0x082a('0x9e'));_0xb672e3[_0x082a('0x57')]('a.key','Account.key');_0xb672e3[_0x082a('0x57')]('a.mandatoryDisposition',_0x082a('0xad'));_0xb672e3['field'](_0x082a('0xae'),_0x082a('0x9f'));_0xb672e3[_0x082a('0x57')](_0x082a('0xaf'));_0xb672e3['field'](_0x082a('0xb0'),_0x082a('0xb1'));_0xb672e3[_0x082a('0x57')](_0x082a('0xb2'),'Contact.lastName');_0xb672e3[_0x082a('0x57')](_0x082a('0xb3'),_0x082a('0xb4'));_0xb672e3[_0x082a('0x57')](_0x082a('0xb5'),'Contact.phone');_0xb672e3[_0x082a('0x57')]('c.mobile',_0x082a('0xb6'));_0xb672e3[_0x082a('0x57')]('c.fax',_0x082a('0xb7'));_0xb672e3[_0x082a('0x57')]('o.fullname',_0x082a('0xb8'));_0xb672e3[_0x082a('0x57')](_0x082a('0xb9'),_0x082a('0xba'));_0xb672e3['field'](_0x082a('0xbb'),_0x082a('0x34'));}if(_0x1050a0[_0x082a('0x23')])_0xb672e3[_0x082a('0x23')](_0x1050a0[_0x082a('0x23')]);if(_0x1050a0[_0x082a('0x21')])_0xb672e3[_0x082a('0x21')](_0x1050a0[_0x082a('0x21')]);return db[_0x082a('0xaa')][_0x082a('0x49')](_0xb672e3['toString'](),_0x4678e0);})[_0x082a('0x2b')](function(_0x5cff42){if(_0x5cff42[_0x082a('0x4f')]>0x0)_0x21b363[_0x082a('0x54')](_0x082a('0xbc'),_[_0x082a('0x42')](_0x5cff42,'id'));return db[_0x082a('0xaa')][_0x082a('0x49')](_0x21b363['toString'](),_0x4678e0)['then'](function(_0x489f9f){var _0x3d6178=_['groupBy'](_0x489f9f,'SmsInteractionId');var _0x3422be=[];_0x5cff42[_0x082a('0x36')](function(_0x435d3a){_0x3422be['push'](updateSmsInteraction(_0x435d3a,_0x4b70,_0x3d6178));});return BPromise[_0x082a('0xbd')](_0x3422be);});});})[_0x082a('0x2b')](function(_0x48afd5){_0x55be36[_0x082a('0xbe')]=_0x48afd5;return _0x55be36;})[_0x082a('0x2b')](respondWithFilteredResult(_0x3d37bb,_0x1050a0))[_0x082a('0x39')](handleError(_0x3d37bb,null));};exports[_0x082a('0xbf')]=function(_0x15262c,_0x3cd61e){var _0x5d888b={'raw':![],'where':{'id':_0x15262c[_0x082a('0xc0')]['id']}},_0x52f001={};_0x52f001[_0x082a('0x48')]=_[_0x082a('0x4a')](db[_0x082a('0x43')][_0x082a('0x44')]);_0x52f001[_0x082a('0x49')]=_['keys'](_0x15262c[_0x082a('0x49')]);_0x52f001[_0x082a('0x4b')]=_[_0x082a('0x4c')](_0x52f001[_0x082a('0x48')],_0x52f001[_0x082a('0x49')]);_0x5d888b[_0x082a('0x4e')]=_['intersection'](_0x52f001[_0x082a('0x48')],qs[_0x082a('0x4d')](_0x15262c['query'][_0x082a('0x4d')]));_0x5d888b[_0x082a('0x4e')]=_0x5d888b[_0x082a('0x4e')][_0x082a('0x4f')]?_0x5d888b[_0x082a('0x4e')]:_0x52f001['model'];if(_0x15262c[_0x082a('0x49')][_0x082a('0xc1')]){_0x5d888b[_0x082a('0xc2')]=[{'all':!![]}];}_0x5d888b=_[_0x082a('0xac')]({},_0x5d888b,_0x15262c['options']);return db['SmsInteraction'][_0x082a('0x6f')](_0x5d888b)[_0x082a('0x2b')](handleEntityNotFound(_0x3cd61e,null))[_0x082a('0x2b')](respondWithResult(_0x3cd61e,null))['catch'](handleError(_0x3cd61e,null));};exports['create']=function(_0x425578,_0x1e876a){return db[_0x082a('0x43')][_0x082a('0xc3')](_0x425578[_0x082a('0x83')],{})[_0x082a('0x2b')](respondWithResult(_0x1e876a,0xc9))[_0x082a('0x39')](handleError(_0x1e876a,null));};exports[_0x082a('0xc4')]=function(_0x49f4e0,_0x3a06f7){if(_0x49f4e0['body']['id']){delete _0x49f4e0[_0x082a('0x83')]['id'];}return db[_0x082a('0x43')][_0x082a('0x6f')]({'where':{'id':_0x49f4e0[_0x082a('0xc0')]['id']}})['then'](handleEntityNotFound(_0x3a06f7,null))[_0x082a('0x2b')](saveUpdates(_0x49f4e0['body'],null))[_0x082a('0x2b')](respondWithResult(_0x3a06f7,null))[_0x082a('0x39')](handleError(_0x3a06f7,null));};exports[_0x082a('0x2c')]=function(_0x3ab410,_0x3f5c65){return db[_0x082a('0x43')]['find']({'where':{'id':_0x3ab410['params']['id']}})[_0x082a('0x2b')](handleEntityNotFound(_0x3f5c65,null))[_0x082a('0x2b')](removeEntity(_0x3f5c65,null))[_0x082a('0x39')](handleError(_0x3f5c65,null));};exports[_0x082a('0xc5')]=function(_0xeeffbc,_0x4541b7){return db['SmsInteraction'][_0x082a('0xc5')]()[_0x082a('0x2b')](respondWithResult(_0x4541b7,null))[_0x082a('0x39')](handleError(_0x4541b7,null));};exports[_0x082a('0xc6')]=function(_0x4c03b4,_0x305400,_0x3a4b14){return db[_0x082a('0xc7')][_0x082a('0x6f')]({'where':{'id':_0x4c03b4['params']['id']}})[_0x082a('0x2b')](handleEntityNotFound(_0x305400,null))[_0x082a('0x2b')](function(_0xf6618a){if(_0xf6618a){return _0xf6618a[_0x082a('0xc6')](_0x4c03b4[_0x082a('0x83')]['ids'],_['omit'](_0x4c03b4['body'],[_0x082a('0xc8'),'id'])||{});}})['then'](respondWithResult(_0x305400,null))[_0x082a('0x39')](handleError(_0x305400,null));};exports[_0x082a('0xc9')]=function(_0x3f035a,_0x18bcfa,_0x4d5b68){var _0xc68c99={'raw':![],'where':{}};var _0xf094c1={};var _0xd67846={'count':0x0,'rows':[]};return db[_0x082a('0x43')]['findOne']({'where':{'id':_0x3f035a[_0x082a('0xc0')]['id']}})['then'](handleEntityNotFound(_0x18bcfa,null))['then'](function(_0x9015f5){if(_0x9015f5){_0xf094c1[_0x082a('0x48')]=_[_0x082a('0x4a')](db[_0x082a('0xc7')][_0x082a('0x44')]);_0xf094c1['query']=_[_0x082a('0x4a')](_0x3f035a[_0x082a('0x49')]);_0xf094c1['filters']=_[_0x082a('0x4c')](_0xf094c1[_0x082a('0x48')],_0xf094c1['query']);_0xc68c99[_0x082a('0x4e')]=_[_0x082a('0x4c')](_0xf094c1[_0x082a('0x48')],qs[_0x082a('0x4d')](_0x3f035a[_0x082a('0x49')][_0x082a('0x4d')]));_0xc68c99[_0x082a('0x4e')]=_0xc68c99[_0x082a('0x4e')][_0x082a('0x4f')]?_0xc68c99[_0x082a('0x4e')]:_0xf094c1[_0x082a('0x48')];if(!_0x3f035a[_0x082a('0x49')][_0x082a('0x50')](_0x082a('0x51'))){_0xc68c99[_0x082a('0x23')]=qs[_0x082a('0x23')](_0x3f035a[_0x082a('0x49')]['limit']);_0xc68c99['offset']=qs[_0x082a('0x21')](_0x3f035a[_0x082a('0x49')]['offset']);}_0xc68c99['order']=qs['sort'](_0x3f035a[_0x082a('0x49')][_0x082a('0x53')]);_0xc68c99[_0x082a('0x54')]=qs[_0x082a('0x4b')](_[_0x082a('0x55')](_0x3f035a[_0x082a('0x49')],_0xf094c1[_0x082a('0x4b')]));_0xc68c99['where'][_0x082a('0xca')]=_0x9015f5['id'];if(_0x3f035a[_0x082a('0x49')][_0x082a('0x92')]){_0xc68c99[_0x082a('0x54')]=_[_0x082a('0xac')](_0xc68c99[_0x082a('0x54')],{'$or':_[_0x082a('0x42')](_0xc68c99[_0x082a('0x4e')],function(_0x12f9f5){var _0x334ce8={};_0x334ce8[_0x12f9f5]={'$like':'%'+_0x3f035a[_0x082a('0x49')]['filter']+'%'};return _0x334ce8;})});}if(_0x3f035a['query'][_0x082a('0x88')]){var _0x1e6f68=_0x3f035a['query'][_0x082a('0x88')][_0x082a('0x35')](',');var _0x229941={};_0x229941[_0x1e6f68[0x0]]={'$gte':moment(_0x1e6f68[0x1])[_0x082a('0xcb')](_0x082a('0xcc'))};_0xc68c99[_0x082a('0x54')]=_[_0x082a('0xac')](_0xc68c99[_0x082a('0x54')],_0x229941);}_0xc68c99=_[_0x082a('0xac')]({},_0xc68c99,_0x3f035a[_0x082a('0xcd')]);return db[_0x082a('0xc7')][_0x082a('0x24')]({'where':_0xc68c99[_0x082a('0x54')]})[_0x082a('0x2b')](function(_0x42281c){_0xd67846[_0x082a('0x24')]=_0x42281c;if(_0x3f035a[_0x082a('0x49')][_0x082a('0xc1')]){_0xc68c99[_0x082a('0xc2')]=[{'all':!![]}];}return db['SmsMessage'][_0x082a('0xce')](_0xc68c99);})[_0x082a('0x2b')](function(_0x1315d5){_0xd67846[_0x082a('0xbe')]=_0x1315d5;return _0xd67846;});}})['then'](respondWithFilteredResult(_0x18bcfa,_0xc68c99))[_0x082a('0x39')](handleError(_0x18bcfa,null));};exports[_0x082a('0xcf')]=function(_0x297d10,_0x3ba0a0,_0x3d00f2){return db[_0x082a('0x43')][_0x082a('0x6f')]({'where':{'id':_0x297d10['params']['id']}})[_0x082a('0x2b')](handleEntityNotFound(_0x3ba0a0,null))[_0x082a('0x2b')](function(_0x35a533){if(_0x35a533){return _0x35a533['setTags'](_0x297d10[_0x082a('0x83')][_0x082a('0xc8')],_['omit'](_0x297d10['body'],['ids','id'])||{})[_0x082a('0xd0')](function(){return db[_0x082a('0x7b')][_0x082a('0xce')]({'attributes':['id','name','color'],'where':{'id':_0x297d10[_0x082a('0x83')][_0x082a('0xc8')]}});})[_0x082a('0x2b')](function(_0x4374a0){socket[_0x082a('0xd1')](_0x082a('0xd2'),{'id':Number(_0x297d10['params']['id']),'tags':_0x4374a0||[]});return{'id':Number(_0x297d10[_0x082a('0xc0')]['id']),'tags':_0x4374a0||[]};});}})[_0x082a('0x2b')](respondWithResult(_0x3ba0a0,null))[_0x082a('0x39')](handleError(_0x3ba0a0,null));};exports[_0x082a('0xd3')]=function(_0xfde8fc,_0x342067,_0x57d444){return db[_0x082a('0x43')][_0x082a('0x6f')]({'where':{'id':_0xfde8fc['params']['id']}})[_0x082a('0x2b')](handleEntityNotFound(_0x342067,null))[_0x082a('0x2b')](function(_0x11175b){if(_0x11175b){return _0x11175b[_0x082a('0xd3')](_0xfde8fc[_0x082a('0x49')][_0x082a('0xc8')]);}})[_0x082a('0x2b')](respondWithStatusCode(_0x342067,null))[_0x082a('0x39')](handleError(_0x342067,null));};exports[_0x082a('0xd4')]=function(_0x2ea2ce,_0x32a47d){var _0x5ee5cf=moment()[_0x082a('0xd5')]()['toString']();var _0x5a95f1=path[_0x082a('0xd6')](config[_0x082a('0xd7')],_0x082a('0xd8'),_0x082a('0xd9'),'tmp');var _0x138a91=path['join'](config['root'],_0x082a('0xd8'),_0x082a('0xd9'),_0x082a('0xda'));var _0x101534=path[_0x082a('0xd6')](_0x5a95f1,_0x5ee5cf);var _0x595362=util[_0x082a('0xcb')](_0x082a('0xdb'),_0x2ea2ce[_0x082a('0xc0')]['id'],_0x5ee5cf);var _0x4e4b10=path[_0x082a('0xd6')](_0x5a95f1,_0x595362);var _0x4ab159=[];_0x4ab159[_0x082a('0x38')]({'model':db[_0x082a('0x7e')],'as':_0x082a('0x7e'),'attributes':['id',_0x082a('0x33')],'raw':!![]});_0x4ab159[_0x082a('0x38')]({'model':db[_0x082a('0xdc')],'as':_0x082a('0x73'),'attributes':['id','firstName',_0x082a('0xdd')],'raw':!![]});var _0x4fcfd8=[{'model':db['SmsMessage'],'as':'Messages','attributes':['id',_0x082a('0x83'),_0x082a('0xde'),_0x082a('0xdf'),_0x082a('0xe0'),'read'],'include':_0x4ab159}];_0x4fcfd8[_0x082a('0x38')]({'model':db['SmsAccount'],'as':'Account','attributes':['id','name']});_0x4fcfd8[_0x082a('0x38')]({'model':db[_0x082a('0x7e')],'as':_0x082a('0xe1'),'attributes':['id',_0x082a('0x33')]});return db[_0x082a('0x43')][_0x082a('0x6f')]({'where':{'id':_0x2ea2ce['params']['id']},'include':_0x4fcfd8})[_0x082a('0x2b')](handleEntityNotFound(_0x32a47d,null))[_0x082a('0x2b')](function(_0x263a6f){if(_0x263a6f){var _0x5805c6=_0x263a6f['get']({'plain':!![]});fs[_0x082a('0xe2')](_0x101534);var _0x1f7021={'channel':_0x082a('0xe3'),'account':_0x5805c6[_0x082a('0xe4')][_0x082a('0x30')],'agent':_0x5805c6['Owner']?_0x5805c6[_0x082a('0xe1')][_0x082a('0x33')]:_0x082a('0xe5'),'createdAt':moment(_0x5805c6[_0x082a('0xde')])['format'](_0x082a('0xcc'))['toString'](),'closedAt':_0x5805c6['closed']?moment(_0x5805c6[_0x082a('0xe6')])[_0x082a('0xcb')](_0x082a('0xcc'))[_0x082a('0xab')]():'','disposition':_0x5805c6[_0x082a('0xe7')],'messages':_(_0x5805c6[_0x082a('0xe8')])['filter']({'secret':![]})['map'](function(_0x4744b8){return{'date':moment(_0x4744b8[_0x082a('0xde')])[_0x082a('0xcb')](_0x082a('0xcc'))['toString'](),'sender':_0x4744b8[_0x082a('0xdf')]===_0x082a('0xe9')?_0x4744b8[_0x082a('0x7e')]?_0x4744b8[_0x082a('0x7e')]['fullname']:'System':_0x4744b8['Contact'][_0x082a('0xea')]+(_0x4744b8[_0x082a('0x73')]['lastName']?'\x20'+_0x4744b8['Contact']['lastName']:''),'body':_0x4744b8['body'],'direction':_0x4744b8[_0x082a('0xdf')]===_0x082a('0xe9')?'A':'C','secret':_0x4744b8[_0x082a('0xe0')],'read':_0x4744b8[_0x082a('0x8d')]};})[_0x082a('0x75')]()};return ejs[_0x082a('0xeb')](path[_0x082a('0xd6')](config[_0x082a('0xd7')],_0x082a('0xd8'),'views',_0x082a('0xec')),{'interaction':_0x1f7021})[_0x082a('0x2b')](function(_0x46cb96){var _0x44f2d7=path[_0x082a('0xd6')](_0x101534,'transcript-'+_0x5805c6['id']+'-'+_0x5ee5cf+_0x082a('0xed'));var _0x2f41c1={'path':_0x44f2d7,'channel':_0x082a('0xe3'),'interactionId':_0x5805c6['id']};return pdf[_0x082a('0xee')](_0x46cb96,_0x2f41c1);})[_0x082a('0x2b')](function(){return new BPromise(function(_0x212136,_0x18d315){zipdir(_0x101534,{'saveTo':_0x4e4b10},function(_0x595054,_0x4676e1){if(_0x595054)return _0x18d315(_0x595054);return _0x212136(_0x4676e1);});})[_0x082a('0x2b')](function(){return new BPromise(function(_0x7f0dc6,_0x1f7122){rimraf(_0x101534,function(_0x26f70e){if(_0x26f70e)_0x1f7122(_0x26f70e);return _0x7f0dc6();});});})[_0x082a('0x2b')](function(){return _0x32a47d[_0x082a('0xd4')](_0x4e4b10,_0x595362,function(_0x162f84){if(_0x162f84){console['log'](_0x082a('0xef'),_0x162f84);}else{fs['unlinkSync'](_0x4e4b10);}});});});}else{return _0x32a47d[_0x082a('0x2d')](0xc8);}})[_0x082a('0x39')](handleError(_0x32a47d,null));}; \ No newline at end of file +var _0x03ba=['talking','total','closed','UserId','answered','unmanaged','index','SmsInteraction','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','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','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','forEach','union','User','body','compact','isEmpty','SmsAccountId','concat','parse','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','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','Sequelize','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','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','SmsInteractionId','rows','catch','includeAll','include','options','create','update','destroy','params','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','Tag','smsInteractionTags:save','removeTags','download','unix','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','firstName','Messages','direction','secret','SmsAccount','Owner','mkdirSync','Sms','Account','N.A.','closedAt','createdAt','out','System','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','../../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','./smsInteraction.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','push','waiting'];(function(_0x31c0e3,_0x3c5cd6){var _0xf34e31=function(_0x312d15){while(--_0x312d15){_0x31c0e3['push'](_0x31c0e3['shift']());}};_0xf34e31(++_0x3c5cd6);}(_0x03ba,0x1a6));var _0xa03b=function(_0x45bc21,_0x394d27){_0x45bc21=_0x45bc21-0x0;var _0x5755bb=_0x03ba[_0x45bc21];return _0x5755bb;};'use strict';var emlformat=require(_0xa03b('0x0'));var rimraf=require(_0xa03b('0x1'));var zipdir=require(_0xa03b('0x2'));var jsonpatch=require(_0xa03b('0x3'));var rp=require(_0xa03b('0x4'));var moment=require(_0xa03b('0x5'));var BPromise=require(_0xa03b('0x6'));var Mustache=require(_0xa03b('0x7'));var util=require('util');var path=require(_0xa03b('0x8'));var sox=require(_0xa03b('0x9'));var csv=require(_0xa03b('0xa'));var ejs=require(_0xa03b('0xb'));var fs=require('fs');var fs_extra=require(_0xa03b('0xc'));var _=require('lodash');var squel=require(_0xa03b('0xd'));var crypto=require('crypto');var jsforce=require(_0xa03b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa03b('0xa'));var querystring=require(_0xa03b('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa03b('0x10'));var as=require(_0xa03b('0x11'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0xa03b('0x12'));var logger=require(_0xa03b('0x13'))(_0xa03b('0x14'));var utils=require(_0xa03b('0x15'));var config=require(_0xa03b('0x16'));var licenseUtil=require(_0xa03b('0x17'));var db=require('../../mysqldb')['db'];config[_0xa03b('0x18')]=_[_0xa03b('0x19')](config[_0xa03b('0x18')],{'host':_0xa03b('0x1a'),'port':0x18eb});var socket=require(_0xa03b('0x1b'))(new Redis(config[_0xa03b('0x18')]));require(_0xa03b('0x1c'))[_0xa03b('0x1d')](socket);function respondWithStatusCode(_0x2fa567,_0x4a58b0){_0x4a58b0=_0x4a58b0||0xcc;return function(_0x2f58b){if(_0x2f58b){return _0x2fa567[_0xa03b('0x1e')](_0x4a58b0);}return _0x2fa567[_0xa03b('0x1f')](_0x4a58b0)[_0xa03b('0x20')]();};}function respondWithResult(_0x225a9a,_0x281e7c){_0x281e7c=_0x281e7c||0xc8;return function(_0x4aaf2c){if(_0x4aaf2c){return _0x225a9a[_0xa03b('0x1f')](_0x281e7c)['json'](_0x4aaf2c);}};}function respondWithFilteredResult(_0x119caa,_0xb02de8){return function(_0x58d9fc){if(_0x58d9fc){var _0x2395c6=typeof _0xb02de8[_0xa03b('0x21')]===_0xa03b('0x22')&&typeof _0xb02de8['limit']===_0xa03b('0x22');var _0x367155=_0x58d9fc[_0xa03b('0x23')];var _0x1cae3e=_0x2395c6?0x0:_0xb02de8['offset'];var _0x328369=_0x2395c6?_0x58d9fc[_0xa03b('0x23')]:_0xb02de8[_0xa03b('0x21')]+_0xb02de8[_0xa03b('0x24')];var _0x1f3ff0;if(_0x328369>=_0x367155){_0x328369=_0x367155;_0x1f3ff0=0xc8;}else{_0x1f3ff0=0xce;}_0x119caa[_0xa03b('0x1f')](_0x1f3ff0);return _0x119caa[_0xa03b('0x25')](_0xa03b('0x26'),_0x1cae3e+'-'+_0x328369+'/'+_0x367155)[_0xa03b('0x27')](_0x58d9fc);}return null;};}function patchUpdates(_0x6d47c8){return function(_0x3e2781){try{jsonpatch[_0xa03b('0x28')](_0x3e2781,_0x6d47c8,!![]);}catch(_0x5376a7){return BPromise[_0xa03b('0x29')](_0x5376a7);}return _0x3e2781[_0xa03b('0x2a')]();};}function saveUpdates(_0xf0291a,_0x28a606){return function(_0x4d4bb3){if(_0x4d4bb3){return _0x4d4bb3['update'](_0xf0291a)[_0xa03b('0x2b')](function(_0x53911e){return _0x53911e;});}return null;};}function removeEntity(_0x2dead2,_0xa67f1){return function(_0x14ca39){if(_0x14ca39){return _0x14ca39['destroy']()['then'](function(){_0x2dead2[_0xa03b('0x1f')](0xcc)[_0xa03b('0x20')]();});}};}function handleEntityNotFound(_0x17c444,_0x1e31ce){return function(_0x12dfa9){if(!_0x12dfa9){_0x17c444['sendStatus'](0x194);}return _0x12dfa9;};}function handleError(_0x4ee931,_0xaef9da){_0xaef9da=_0xaef9da||0x1f4;return function(_0x24604b){logger[_0xa03b('0x2c')](_0x24604b[_0xa03b('0x2d')]);if(_0x24604b[_0xa03b('0x2e')]){delete _0x24604b['name'];}_0x4ee931[_0xa03b('0x1f')](_0xaef9da)[_0xa03b('0x2f')](_0x24604b);};}function getInteractionUsers(_0x4bea77,_0x2a92d2){return new BPromise(function(_0xc8ea46,_0x25a0e5){try{if(_0x2a92d2[_0x4bea77['id']]){_0x4bea77[_0xa03b('0x30')]=_[_0xa03b('0x31')](_0x2a92d2[_0x4bea77['id']],function(_0x3140ca){return{'id':_0x3140ca['id'],'fullname':_0x3140ca[_0xa03b('0x32')]};});}}catch(_0xd13f7f){_0x25a0e5(_0xd13f7f);}_0xc8ea46(_0x4bea77);});}function getInteractionTags(_0x39af82,_0x54a56a){return new BPromise(function(_0x21a6c1,_0x503b1d){try{if(_0x39af82[_0xa03b('0x33')]){_0x39af82[_0xa03b('0x34')]=[];_0x39af82['TagIds'][_0xa03b('0x35')](',')['forEach'](function(_0x4d2a8d){_0x39af82[_0xa03b('0x34')][_0xa03b('0x36')](_0x54a56a[_0x4d2a8d]);});}delete _0x39af82[_0xa03b('0x33')];}catch(_0x2d9443){_0x503b1d(_0x2d9443);}_0x21a6c1(_0x39af82);});}function updateSmsInteraction(_0x1c5115,_0x3de436,_0x2f3372){return new BPromise(function(_0x244f17,_0x7dbdfc){return getInteractionUsers(_0x1c5115,_0x2f3372)[_0xa03b('0x2b')](function(_0x4a21d1){return getInteractionTags(_0x4a21d1,_0x3de436);})[_0xa03b('0x2b')](function(_0x538c60){return getStateInteraction(_0x538c60);})[_0xa03b('0x2b')](function(_0x8daef9){_0x244f17(_0x8daef9);})['catch'](function(_0x5d4490){_0x7dbdfc(_0x5d4490);});});}function getStateInteraction(_0x3b152f){return new BPromise(function(_0x452d07){_0x3b152f[_0xa03b('0x37')]=0x0;_0x3b152f[_0xa03b('0x38')]=0x0;_0x3b152f['answered']=0x0;_0x3b152f['unmanaged']=0x0;_0x3b152f[_0xa03b('0x39')]=0x0;if(!_0x3b152f[_0xa03b('0x3a')]&&!_0x3b152f[_0xa03b('0x3b')]){_0x3b152f['waiting']+=0x1;}if(!_0x3b152f['closed']&&_0x3b152f['UserId']){_0x3b152f[_0xa03b('0x38')]+=0x1;if(_0x3b152f[_0xa03b('0x37')]){_0x3b152f['waiting']-=0x1;}}if(_0x3b152f[_0xa03b('0x3a')]&&_0x3b152f[_0xa03b('0x3b')]){_0x3b152f[_0xa03b('0x3c')]+=0x1;if(_0x3b152f[_0xa03b('0x38')]){_0x3b152f[_0xa03b('0x38')]-=0x1;}}if(_0x3b152f[_0xa03b('0x3a')]&&!_0x3b152f[_0xa03b('0x3b')]){_0x3b152f[_0xa03b('0x3d')]+=0x1;if(_0x3b152f['waiting']){_0x3b152f[_0xa03b('0x37')]-=0x1;}}_0x3b152f[_0xa03b('0x39')]+=0x1;_0x452d07(_0x3b152f);});}exports[_0xa03b('0x3e')]=function(_0x3f752f,_0x249e59){var _0x1b2887={},_0x41b569={},_0xdda455={'count':0x0,'rows':[]};var _0xea9016=_[_0xa03b('0x31')](db[_0xa03b('0x3f')][_0xa03b('0x40')],function(_0x3aff3a){return{'name':_0x3aff3a[_0xa03b('0x41')],'type':_0x3aff3a[_0xa03b('0x42')][_0xa03b('0x43')]};});_0x41b569[_0xa03b('0x44')]=_[_0xa03b('0x31')](_0xea9016,'name');_0x41b569['query']=_[_0xa03b('0x45')](_0x3f752f['query']);_0x41b569[_0xa03b('0x46')]=_[_0xa03b('0x47')](_0x41b569['model'],_0x41b569['query']);_0x1b2887[_0xa03b('0x48')]=_[_0xa03b('0x47')](_0x41b569[_0xa03b('0x44')],qs[_0xa03b('0x49')](_0x3f752f[_0xa03b('0x4a')][_0xa03b('0x49')]));_0x1b2887['attributes']=_0x1b2887['attributes'][_0xa03b('0x4b')]?_0x1b2887['attributes']:_0x41b569[_0xa03b('0x44')];if(!_0x3f752f[_0xa03b('0x4a')][_0xa03b('0x4c')](_0xa03b('0x4d'))){_0x1b2887[_0xa03b('0x24')]=qs['limit'](_0x3f752f[_0xa03b('0x4a')][_0xa03b('0x24')]);_0x1b2887[_0xa03b('0x21')]=qs['offset'](_0x3f752f['query']['offset']);}_0x1b2887[_0xa03b('0x4e')]=qs[_0xa03b('0x4f')](_0x3f752f[_0xa03b('0x4a')][_0xa03b('0x4f')]);_0x1b2887[_0xa03b('0x50')]=qs[_0xa03b('0x46')](_[_0xa03b('0x51')](_0x3f752f[_0xa03b('0x4a')],_0x41b569[_0xa03b('0x46')]),_0xea9016);var _0x3d1a1c=[];var _0x457cc0=squel[_0xa03b('0x52')]()[_0xa03b('0x53')]('id')['field'](_0xa03b('0x2e'))['field'](_0xa03b('0x54'))[_0xa03b('0x55')](_0xa03b('0x56'));var _0x1d587c=squel[_0xa03b('0x52')]()[_0xa03b('0x53')]('u.id')[_0xa03b('0x53')](_0xa03b('0x57'))['field']('ui.SmsInteractionId')[_0xa03b('0x55')]('user_has_sms_interactions','ui')[_0xa03b('0x58')](_0xa03b('0x59'),'u',_0xa03b('0x5a'));var _0x34e41c=squel[_0xa03b('0x52')]()[_0xa03b('0x55')]('sms_interactions','i')[_0xa03b('0x58')]('cm_contacts','c',_0xa03b('0x5b'))[_0xa03b('0x58')]('users','o',_0xa03b('0x5c'))[_0xa03b('0x58')](_0xa03b('0x5d'),'a',_0xa03b('0x5e'))[_0xa03b('0x58')](_0xa03b('0x5f'),'me',_0xa03b('0x60'))['left_join'](_0xa03b('0x61'),'it',_0xa03b('0x62'))['left_join'](_0xa03b('0x56'),'t',_0xa03b('0x63'));var _0x1fda2b=squel[_0xa03b('0x64')]();var _0x511641=[];var _0x23c15c=squel[_0xa03b('0x64')]();var _0x422f98;if(_0x3f752f[_0xa03b('0x4a')]['search']){_0x422f98=as[_0xa03b('0x65')](_0x3f752f['query'][_0xa03b('0x66')]);var _0x36b0fc=_0x422f98['sqlOperator'];for(var _0x586036=0x0;_0x586036<_0x422f98[_0xa03b('0x67')][_0xa03b('0x4b')];_0x586036++){var _0x2d5921=_0x422f98['conditions'][_0x586036];var _0x22fc5a='i';var _0x57c2f8=_[_0xa03b('0x68')](_0xea9016,[_0xa03b('0x2e'),_0x2d5921['field']]);if(!_0x57c2f8){switch(_0x2d5921[_0xa03b('0x53')]){case _0xa03b('0x69'):if(_0x2d5921[_0xa03b('0x6a')]==0x1){_0x34e41c[_0xa03b('0x6b')]('`'+_0x2d5921[_0xa03b('0x53')]+_0xa03b('0x6c'));}else{_0x34e41c[_0xa03b('0x6b')]('`'+_0x2d5921[_0xa03b('0x53')]+_0xa03b('0x6d'));}break;case _0xa03b('0x6e'):if(_0x2d5921[_0xa03b('0x6f')]===_0xa03b('0x70')){if(_0x2d5921['value'][_0xa03b('0x35')]('\x20')[_0xa03b('0x4b')]>0x1){_0x1fda2b[_0x36b0fc](_0xa03b('0x71'),qs[_0xa03b('0x72')](_0x2d5921[_0xa03b('0x6a')]),null);}else{var _0x810d6c='%'+_0x2d5921['value']+'%';_0x1fda2b[_0x36b0fc](_0xa03b('0x73'),_0x810d6c,_0x810d6c,_0x810d6c);}}else{_0x57c2f8=_['find'](_0xea9016,[_0xa03b('0x2e'),'ContactId']);_0x2d5921[_0xa03b('0x53')]=_0xa03b('0x74');_0x33c1a2=as[_0xa03b('0x75')](_0x22fc5a,_0x57c2f8[_0xa03b('0x42')],_0x2d5921);_0x1fda2b[_0x36b0fc](_0x33c1a2[_0xa03b('0x76')],_0x33c1a2['value'][_0xa03b('0x77')],_0x33c1a2[_0xa03b('0x6a')][_0xa03b('0x20')]);}break;case'Tag':var _0x2d8b3f=_0x2d5921['value']['split'](',')[_0xa03b('0x31')](function(_0x139f43){return Number(_0x139f43);});_0x2d8b3f[_0xa03b('0x78')](function(_0x2fcff1){_0x23c15c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2fcff1+',%');});_0x511641=_[_0xa03b('0x79')](_0x511641,_0x2d8b3f);break;case _0xa03b('0x7a'):if(_0x2d5921['operator']===_0xa03b('0x70')){_0x1fda2b[_0x36b0fc]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2d5921[_0xa03b('0x6a')]+'%',null);}else{_0x57c2f8=_['find'](_0xea9016,[_0xa03b('0x2e'),_0xa03b('0x3b')]);_0x2d5921[_0xa03b('0x53')]=_0xa03b('0x3b');_0x33c1a2=as[_0xa03b('0x75')](_0x22fc5a,_0x57c2f8['type'],_0x2d5921);_0x1fda2b[_0x36b0fc](_0x33c1a2[_0xa03b('0x76')],_0x33c1a2[_0xa03b('0x6a')]['start'],_0x33c1a2[_0xa03b('0x6a')][_0xa03b('0x20')]);}break;case _0xa03b('0x7b'):_0x33c1a2=as[_0xa03b('0x75')]('me',null,_0x2d5921);_0x1fda2b[_0x36b0fc](_0x33c1a2['text'],_0x33c1a2['value'][_0xa03b('0x77')],_0x33c1a2[_0xa03b('0x6a')]['end']);break;}}else{var _0x33c1a2=as[_0xa03b('0x75')](_0x22fc5a,_0x57c2f8[_0xa03b('0x42')],_0x2d5921);_0x1fda2b[_0x36b0fc](_0x33c1a2[_0xa03b('0x76')],_0x33c1a2[_0xa03b('0x6a')][_0xa03b('0x77')],_0x33c1a2[_0xa03b('0x6a')][_0xa03b('0x20')]);}}}else{var _0x5c5d25=_(_0x3f752f['query'])[_0xa03b('0x45')]()[_0xa03b('0x31')](function(_0x314a2d){return _['some'](_0xea9016,[_0xa03b('0x2e'),_0x314a2d])?_0x314a2d:undefined;})[_0xa03b('0x7c')]()[_0xa03b('0x6a')]();if(!_[_0xa03b('0x7d')](_0x5c5d25)){_0x5c5d25[_0xa03b('0x78')](function(_0xbb709b){if(_0xbb709b===_0xa03b('0x7e')){_0x34e41c[_0xa03b('0x50')]('i.SmsAccountId\x20IN\x20?',[][_0xa03b('0x7f')](_0x3f752f['query'][_0xbb709b]));}else if(_0xbb709b==='createdAt'){var _0xa7c07b=JSON[_0xa03b('0x80')](_0x3f752f['query'][_0xbb709b])['$gte'];var _0x438083=JSON[_0xa03b('0x80')](_0x3f752f['query'][_0xbb709b])['$lte'];_0x34e41c['where'](_0xa03b('0x81'),_0xa7c07b,_0x438083);}else{if(_0x3f752f[_0xa03b('0x4a')][_0xbb709b]===_0xa03b('0x82')){_0x34e41c['where']('i.'+_0xbb709b+_0xa03b('0x83'));}else{_0x34e41c[_0xa03b('0x50')]('i.'+_0xbb709b+'\x20=\x20?',_0x3f752f[_0xa03b('0x4a')][_0xbb709b]);}}});}if(_0x3f752f['query'][_0xa03b('0x84')]){if(_0x3f752f['query']['read']==0x1){_0x34e41c[_0xa03b('0x6b')](_0xa03b('0x85'));}else{_0x34e41c[_0xa03b('0x6b')]('`unreadMessages`\x20>\x200');}}if(_0x3f752f[_0xa03b('0x4a')]['tag']){_0x511641=_[_0xa03b('0x86')](_0x3f752f[_0xa03b('0x4a')]['tag'])?_0x3f752f[_0xa03b('0x4a')][_0xa03b('0x87')]:new Array(_0x3f752f[_0xa03b('0x4a')][_0xa03b('0x87')]);_0x511641[_0xa03b('0x78')](function(_0x775e62){_0x23c15c['or'](_0xa03b('0x88'),'%,'+_0x775e62+',%');});}if(_0x3f752f[_0xa03b('0x4a')][_0xa03b('0x89')]){var _0x43ba3a=_0x3f752f[_0xa03b('0x4a')][_0xa03b('0x89')][_0xa03b('0x8a')]('\x5c','\x5c\x5c')[_0xa03b('0x8a')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x43ba3a)){_0x1fda2b['or'](_0xa03b('0x8b'),_0x43ba3a+'%')['or']('i.phone\x20LIKE\x20?',_0x43ba3a+'%');}else{_0x1fda2b['or'](_0xa03b('0x8c'),qs[_0xa03b('0x72')](_0x43ba3a))['or'](_0xa03b('0x8d'),_0x43ba3a+'%');}}}_0x34e41c[_0xa03b('0x50')](_0x1fda2b);_0x34e41c['group'](_0xa03b('0x8e'));var _0x5ac4a0={'type':db[_0xa03b('0x8f')]['QueryTypes'][_0xa03b('0x90')],'raw':!![]};var _0x3d9e90=_0x34e41c[_0xa03b('0x91')]();_0x3d9e90[_0xa03b('0x53')](_0xa03b('0x8e'));_0x3d9e90[_0xa03b('0x53')](_0xa03b('0x92'),_0xa03b('0x69'));if(_0x1b2887['order']){_0x1b2887[_0xa03b('0x4e')]['forEach'](function(_0x33a904){var _0x5dc613=_0x33a904[0x0]===_0xa03b('0x93')?_0x33a904[0x0]:'i.'+_0x33a904[0x0];_0x34e41c[_0xa03b('0x4e')](_0x5dc613,_0x33a904[0x1]===_0xa03b('0x94')?![]:!![]);});}if(!_[_0xa03b('0x7d')](_0x511641)){_0x34e41c[_0xa03b('0x6b')](_0x23c15c);_0x3d9e90[_0xa03b('0x50')](_0xa03b('0x95'),_0x511641);}BPromise[_0xa03b('0x96')]()[_0xa03b('0x2b')](function(){if(!_0x422f98){if(_0x3f752f['query'][_0xa03b('0x7e')])return;_0x3d9e90[_0xa03b('0x50')](_0xa03b('0x97'));_0x34e41c[_0xa03b('0x50')](_0xa03b('0x97'));return;}if(_0x3f752f[_0xa03b('0x98')][_0xa03b('0x99')]!==_0xa03b('0x9a'))return;return _0x3f752f[_0xa03b('0x98')][_0xa03b('0x9b')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3e1e0f){if(_[_0xa03b('0x7d')](_0x3e1e0f)){_0x3d9e90[_0xa03b('0x50')](_0xa03b('0x9c'));_0x34e41c['where'](_0xa03b('0x9c'));}else{_0x3d9e90[_0xa03b('0x50')]('i.SmsAccountId\x20IN\x20?',_['map'](_0x3e1e0f,'id'));_0x34e41c[_0xa03b('0x50')](_0xa03b('0x9d'),_[_0xa03b('0x31')](_0x3e1e0f,'id'));}});})[_0xa03b('0x2b')](function(){if(_0x3f752f[_0xa03b('0x98')][_0xa03b('0x99')]===_0xa03b('0x9a')&&!_0x422f98&&!_0x3f752f[_0xa03b('0x4a')][_0xa03b('0x7e')])return[];return db[_0xa03b('0x9e')][_0xa03b('0x4a')](_0x3d9e90[_0xa03b('0x9f')](),_0x5ac4a0);})['then'](function(_0x272a16){_0xdda455[_0xa03b('0x23')]=_0x272a16['length'];if(_0xdda455['count']===0x0)return[];return db[_0xa03b('0x9e')][_0xa03b('0x4a')](_0x457cc0['toString'](),_0x5ac4a0)[_0xa03b('0x2b')](function(_0x46c641){_0x3d1a1c=_[_0xa03b('0xa0')](_0x46c641,'id');_0x5ac4a0=_[_0xa03b('0xa1')](_0x5ac4a0,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3f752f['query']['fields']){_0x1b2887[_0xa03b('0x48')][_0xa03b('0x78')](function(_0xe1a558){_0x34e41c['field']('i.'+_0xe1a558);});}else{_0x34e41c[_0xa03b('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa03b('0x69'));_0x34e41c[_0xa03b('0x53')](_0xa03b('0xa2'),_0xa03b('0xa3'));_0x34e41c['field'](_0xa03b('0xa4'),_0xa03b('0xa5'));_0x34e41c[_0xa03b('0x53')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x34e41c['field'](_0xa03b('0xa6'));_0x34e41c[_0xa03b('0x53')](_0xa03b('0xa7'),_0xa03b('0xa8'));_0x34e41c[_0xa03b('0x53')](_0xa03b('0xa9'),_0xa03b('0xaa'));_0x34e41c[_0xa03b('0x53')](_0xa03b('0xab'),_0xa03b('0xac'));_0x34e41c['field'](_0xa03b('0xad'),_0xa03b('0xae'));_0x34e41c[_0xa03b('0x53')](_0xa03b('0xaf'),'Contact.mobile');_0x34e41c[_0xa03b('0x53')](_0xa03b('0xb0'),_0xa03b('0xb1'));_0x34e41c[_0xa03b('0x53')](_0xa03b('0xb2'),_0xa03b('0xb3'));_0x34e41c['field']('o.internal','Owner.internal');_0x34e41c[_0xa03b('0x53')](_0xa03b('0xb4'),'TagIds');}if(_0x1b2887['limit'])_0x34e41c[_0xa03b('0x24')](_0x1b2887['limit']);if(_0x1b2887[_0xa03b('0x21')])_0x34e41c['offset'](_0x1b2887[_0xa03b('0x21')]);return db['sequelize'][_0xa03b('0x4a')](_0x34e41c[_0xa03b('0x9f')](),_0x5ac4a0);})[_0xa03b('0x2b')](function(_0x31184c){if(_0x31184c[_0xa03b('0x4b')]>0x0)_0x1d587c[_0xa03b('0x50')]('ui.SmsInteractionId\x20IN\x20?',_[_0xa03b('0x31')](_0x31184c,'id'));return db[_0xa03b('0x9e')][_0xa03b('0x4a')](_0x1d587c[_0xa03b('0x9f')](),_0x5ac4a0)[_0xa03b('0x2b')](function(_0x58cfb0){var _0x3c614f=_[_0xa03b('0xb5')](_0x58cfb0,_0xa03b('0xb6'));var _0x869df8=[];_0x31184c[_0xa03b('0x78')](function(_0x2787ea){_0x869df8[_0xa03b('0x36')](updateSmsInteraction(_0x2787ea,_0x3d1a1c,_0x3c614f));});return BPromise['all'](_0x869df8);});});})[_0xa03b('0x2b')](function(_0x2b0901){_0xdda455[_0xa03b('0xb7')]=_0x2b0901;return _0xdda455;})['then'](respondWithFilteredResult(_0x249e59,_0x1b2887))[_0xa03b('0xb8')](handleError(_0x249e59,null));};exports['show']=function(_0x58c9c0,_0x53982b){var _0x2c8068={'raw':![],'where':{'id':_0x58c9c0['params']['id']}},_0x4f2c2d={};_0x4f2c2d[_0xa03b('0x44')]=_[_0xa03b('0x45')](db[_0xa03b('0x3f')]['rawAttributes']);_0x4f2c2d[_0xa03b('0x4a')]=_[_0xa03b('0x45')](_0x58c9c0[_0xa03b('0x4a')]);_0x4f2c2d[_0xa03b('0x46')]=_[_0xa03b('0x47')](_0x4f2c2d[_0xa03b('0x44')],_0x4f2c2d[_0xa03b('0x4a')]);_0x2c8068[_0xa03b('0x48')]=_[_0xa03b('0x47')](_0x4f2c2d[_0xa03b('0x44')],qs[_0xa03b('0x49')](_0x58c9c0[_0xa03b('0x4a')]['fields']));_0x2c8068[_0xa03b('0x48')]=_0x2c8068[_0xa03b('0x48')]['length']?_0x2c8068[_0xa03b('0x48')]:_0x4f2c2d[_0xa03b('0x44')];if(_0x58c9c0[_0xa03b('0x4a')][_0xa03b('0xb9')]){_0x2c8068[_0xa03b('0xba')]=[{'all':!![]}];}_0x2c8068=_['merge']({},_0x2c8068,_0x58c9c0[_0xa03b('0xbb')]);return db['SmsInteraction'][_0xa03b('0x68')](_0x2c8068)['then'](handleEntityNotFound(_0x53982b,null))['then'](respondWithResult(_0x53982b,null))['catch'](handleError(_0x53982b,null));};exports[_0xa03b('0xbc')]=function(_0x4c4f60,_0x296cd3){return db[_0xa03b('0x3f')]['create'](_0x4c4f60[_0xa03b('0x7b')],{})[_0xa03b('0x2b')](respondWithResult(_0x296cd3,0xc9))[_0xa03b('0xb8')](handleError(_0x296cd3,null));};exports[_0xa03b('0xbd')]=function(_0x31bb0b,_0x21bc3c){if(_0x31bb0b[_0xa03b('0x7b')]['id']){delete _0x31bb0b[_0xa03b('0x7b')]['id'];}return db['SmsInteraction'][_0xa03b('0x68')]({'where':{'id':_0x31bb0b['params']['id']}})[_0xa03b('0x2b')](handleEntityNotFound(_0x21bc3c,null))[_0xa03b('0x2b')](saveUpdates(_0x31bb0b[_0xa03b('0x7b')],null))['then'](respondWithResult(_0x21bc3c,null))['catch'](handleError(_0x21bc3c,null));};exports[_0xa03b('0xbe')]=function(_0x20943a,_0x2ad3b7){return db[_0xa03b('0x3f')][_0xa03b('0x68')]({'where':{'id':_0x20943a[_0xa03b('0xbf')]['id']}})['then'](handleEntityNotFound(_0x2ad3b7,null))[_0xa03b('0x2b')](removeEntity(_0x2ad3b7,null))[_0xa03b('0xb8')](handleError(_0x2ad3b7,null));};exports[_0xa03b('0xc0')]=function(_0x396c30,_0x13fe04){return db[_0xa03b('0x3f')]['describe']()[_0xa03b('0x2b')](respondWithResult(_0x13fe04,null))[_0xa03b('0xb8')](handleError(_0x13fe04,null));};exports[_0xa03b('0xc1')]=function(_0x2833b1,_0x2ba92c,_0x527a04){return db[_0xa03b('0xc2')][_0xa03b('0x68')]({'where':{'id':_0x2833b1['params']['id']}})[_0xa03b('0x2b')](handleEntityNotFound(_0x2ba92c,null))[_0xa03b('0x2b')](function(_0xca5b3a){if(_0xca5b3a){return _0xca5b3a[_0xa03b('0xc1')](_0x2833b1[_0xa03b('0x7b')][_0xa03b('0xc3')],_[_0xa03b('0xc4')](_0x2833b1[_0xa03b('0x7b')],['ids','id'])||{});}})[_0xa03b('0x2b')](respondWithResult(_0x2ba92c,null))[_0xa03b('0xb8')](handleError(_0x2ba92c,null));};exports[_0xa03b('0xc5')]=function(_0x27c977,_0x427404,_0x47a7aa){var _0xa2c69={'raw':![],'where':{}};var _0x2e816a={};var _0x2576ef={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xa03b('0xc6')]({'where':{'id':_0x27c977[_0xa03b('0xbf')]['id']}})[_0xa03b('0x2b')](handleEntityNotFound(_0x427404,null))[_0xa03b('0x2b')](function(_0x211286){if(_0x211286){_0x2e816a[_0xa03b('0x44')]=_[_0xa03b('0x45')](db[_0xa03b('0xc2')][_0xa03b('0x40')]);_0x2e816a[_0xa03b('0x4a')]=_[_0xa03b('0x45')](_0x27c977['query']);_0x2e816a[_0xa03b('0x46')]=_[_0xa03b('0x47')](_0x2e816a[_0xa03b('0x44')],_0x2e816a[_0xa03b('0x4a')]);_0xa2c69[_0xa03b('0x48')]=_[_0xa03b('0x47')](_0x2e816a[_0xa03b('0x44')],qs[_0xa03b('0x49')](_0x27c977['query'][_0xa03b('0x49')]));_0xa2c69['attributes']=_0xa2c69[_0xa03b('0x48')][_0xa03b('0x4b')]?_0xa2c69[_0xa03b('0x48')]:_0x2e816a['model'];if(!_0x27c977[_0xa03b('0x4a')][_0xa03b('0x4c')](_0xa03b('0x4d'))){_0xa2c69['limit']=qs['limit'](_0x27c977['query'][_0xa03b('0x24')]);_0xa2c69['offset']=qs['offset'](_0x27c977[_0xa03b('0x4a')][_0xa03b('0x21')]);}_0xa2c69['order']=qs['sort'](_0x27c977['query'][_0xa03b('0x4f')]);_0xa2c69['where']=qs[_0xa03b('0x46')](_[_0xa03b('0x51')](_0x27c977[_0xa03b('0x4a')],_0x2e816a[_0xa03b('0x46')]));_0xa2c69['where'][_0xa03b('0xb6')]=_0x211286['id'];if(_0x27c977[_0xa03b('0x4a')][_0xa03b('0x89')]){_0xa2c69[_0xa03b('0x50')]=_[_0xa03b('0xa1')](_0xa2c69[_0xa03b('0x50')],{'$or':_[_0xa03b('0x31')](_0xa2c69['attributes'],function(_0x305ef4){var _0x24e4b4={};_0x24e4b4[_0x305ef4]={'$like':'%'+_0x27c977['query'][_0xa03b('0x89')]+'%'};return _0x24e4b4;})});}if(_0x27c977['query'][_0xa03b('0xc7')]){var _0x408ab7=_0x27c977[_0xa03b('0x4a')][_0xa03b('0xc7')][_0xa03b('0x35')](',');var _0xfba004={};_0xfba004[_0x408ab7[0x0]]={'$gte':moment(_0x408ab7[0x1])[_0xa03b('0xc8')](_0xa03b('0xc9'))};_0xa2c69[_0xa03b('0x50')]=_['merge'](_0xa2c69[_0xa03b('0x50')],_0xfba004);}_0xa2c69=_[_0xa03b('0xa1')]({},_0xa2c69,_0x27c977[_0xa03b('0xbb')]);return db['SmsMessage'][_0xa03b('0x23')]({'where':_0xa2c69[_0xa03b('0x50')]})['then'](function(_0x4d2bd2){_0x2576ef[_0xa03b('0x23')]=_0x4d2bd2;if(_0x27c977['query']['includeAll']){_0xa2c69[_0xa03b('0xba')]=[{'all':!![]}];}return db[_0xa03b('0xc2')][_0xa03b('0xca')](_0xa2c69);})[_0xa03b('0x2b')](function(_0x33cb81){_0x2576ef[_0xa03b('0xb7')]=_0x33cb81;return _0x2576ef;});}})['then'](respondWithFilteredResult(_0x427404,_0xa2c69))['catch'](handleError(_0x427404,null));};exports[_0xa03b('0xcb')]=function(_0x4b681f,_0x4c424c,_0x5e8c96){return db[_0xa03b('0x3f')][_0xa03b('0x68')]({'where':{'id':_0x4b681f[_0xa03b('0xbf')]['id']}})[_0xa03b('0x2b')](handleEntityNotFound(_0x4c424c,null))[_0xa03b('0x2b')](function(_0x12e2bb){if(_0x12e2bb){return _0x12e2bb[_0xa03b('0xcc')](_0x4b681f[_0xa03b('0x7b')]['ids'],_[_0xa03b('0xc4')](_0x4b681f[_0xa03b('0x7b')],[_0xa03b('0xc3'),'id'])||{})['spread'](function(){return db[_0xa03b('0xcd')][_0xa03b('0xca')]({'attributes':['id','name','color'],'where':{'id':_0x4b681f[_0xa03b('0x7b')][_0xa03b('0xc3')]}});})[_0xa03b('0x2b')](function(_0x386f27){socket['emit'](_0xa03b('0xce'),{'id':Number(_0x4b681f[_0xa03b('0xbf')]['id']),'tags':_0x386f27||[]});return{'id':Number(_0x4b681f['params']['id']),'tags':_0x386f27||[]};});}})[_0xa03b('0x2b')](respondWithResult(_0x4c424c,null))['catch'](handleError(_0x4c424c,null));};exports[_0xa03b('0xcf')]=function(_0x3b274f,_0x3b06b8,_0x583d98){return db['SmsInteraction']['find']({'where':{'id':_0x3b274f[_0xa03b('0xbf')]['id']}})[_0xa03b('0x2b')](handleEntityNotFound(_0x3b06b8,null))[_0xa03b('0x2b')](function(_0x3f2747){if(_0x3f2747){return _0x3f2747['removeTags'](_0x3b274f[_0xa03b('0x4a')]['ids']);}})[_0xa03b('0x2b')](respondWithStatusCode(_0x3b06b8,null))['catch'](handleError(_0x3b06b8,null));};exports[_0xa03b('0xd0')]=function(_0x468518,_0x3ee0d7){var _0x37fd61=moment()[_0xa03b('0xd1')]()[_0xa03b('0x9f')]();var _0x17c7fc=path[_0xa03b('0xd2')](config[_0xa03b('0xd3')],_0xa03b('0xd4'),'files',_0xa03b('0xd5'));var _0x2c5166=path[_0xa03b('0xd2')](config[_0xa03b('0xd3')],_0xa03b('0xd4'),_0xa03b('0xd6'),_0xa03b('0xd7'));var _0x570c90=path[_0xa03b('0xd2')](_0x17c7fc,_0x37fd61);var _0x1d2190=util['format'](_0xa03b('0xd8'),_0x468518['params']['id'],_0x37fd61);var _0x263f8d=path[_0xa03b('0xd2')](_0x17c7fc,_0x1d2190);var _0x35fe9e=[];_0x35fe9e[_0xa03b('0x36')]({'model':db[_0xa03b('0x7a')],'as':'User','attributes':['id',_0xa03b('0x32')],'raw':!![]});_0x35fe9e[_0xa03b('0x36')]({'model':db['CmContact'],'as':_0xa03b('0x6e'),'attributes':['id',_0xa03b('0xd9'),'lastName'],'raw':!![]});var _0xb75a93=[{'model':db['SmsMessage'],'as':_0xa03b('0xda'),'attributes':['id',_0xa03b('0x7b'),'createdAt',_0xa03b('0xdb'),_0xa03b('0xdc'),_0xa03b('0x84')],'include':_0x35fe9e}];_0xb75a93['push']({'model':db[_0xa03b('0xdd')],'as':'Account','attributes':['id',_0xa03b('0x2e')]});_0xb75a93[_0xa03b('0x36')]({'model':db[_0xa03b('0x7a')],'as':_0xa03b('0xde'),'attributes':['id',_0xa03b('0x32')]});return db[_0xa03b('0x3f')]['find']({'where':{'id':_0x468518['params']['id']},'include':_0xb75a93})[_0xa03b('0x2b')](handleEntityNotFound(_0x3ee0d7,null))['then'](function(_0x4c1a93){if(_0x4c1a93){var _0x39a74c=_0x4c1a93['get']({'plain':!![]});fs[_0xa03b('0xdf')](_0x570c90);var _0x145919={'channel':_0xa03b('0xe0'),'account':_0x39a74c[_0xa03b('0xe1')]['name'],'agent':_0x39a74c[_0xa03b('0xde')]?_0x39a74c[_0xa03b('0xde')][_0xa03b('0x32')]:_0xa03b('0xe2'),'createdAt':moment(_0x39a74c['createdAt'])[_0xa03b('0xc8')](_0xa03b('0xc9'))[_0xa03b('0x9f')](),'closedAt':_0x39a74c[_0xa03b('0x3a')]?moment(_0x39a74c[_0xa03b('0xe3')])['format'](_0xa03b('0xc9'))[_0xa03b('0x9f')]():'','disposition':_0x39a74c['disposition'],'messages':_(_0x39a74c['Messages'])[_0xa03b('0x89')]({'secret':![]})[_0xa03b('0x31')](function(_0x5133c2){return{'date':moment(_0x5133c2[_0xa03b('0xe4')])[_0xa03b('0xc8')](_0xa03b('0xc9'))['toString'](),'sender':_0x5133c2[_0xa03b('0xdb')]===_0xa03b('0xe5')?_0x5133c2[_0xa03b('0x7a')]?_0x5133c2[_0xa03b('0x7a')]['fullname']:_0xa03b('0xe6'):_0x5133c2[_0xa03b('0x6e')][_0xa03b('0xd9')]+(_0x5133c2['Contact']['lastName']?'\x20'+_0x5133c2[_0xa03b('0x6e')][_0xa03b('0xe7')]:''),'body':_0x5133c2[_0xa03b('0x7b')],'direction':_0x5133c2[_0xa03b('0xdb')]===_0xa03b('0xe5')?'A':'C','secret':_0x5133c2['secret'],'read':_0x5133c2[_0xa03b('0x84')]};})[_0xa03b('0x6a')]()};return ejs[_0xa03b('0xe8')](path['join'](config['root'],_0xa03b('0xd4'),_0xa03b('0xe9'),_0xa03b('0xea')),{'interaction':_0x145919})['then'](function(_0x2672f0){var _0x3d9fe8=path['join'](_0x570c90,_0xa03b('0xeb')+_0x39a74c['id']+'-'+_0x37fd61+_0xa03b('0xec'));var _0xf7eae8={'path':_0x3d9fe8,'channel':'Sms','interactionId':_0x39a74c['id']};return pdf['createPdfFromHTML'](_0x2672f0,_0xf7eae8);})[_0xa03b('0x2b')](function(){return new BPromise(function(_0xb83eed,_0x174953){zipdir(_0x570c90,{'saveTo':_0x263f8d},function(_0x32b534,_0x14b0e3){if(_0x32b534)return _0x174953(_0x32b534);return _0xb83eed(_0x14b0e3);});})[_0xa03b('0x2b')](function(){return new BPromise(function(_0x2388f4,_0xad5295){rimraf(_0x570c90,function(_0x18204d){if(_0x18204d)_0xad5295(_0x18204d);return _0x2388f4();});});})[_0xa03b('0x2b')](function(){return _0x3ee0d7[_0xa03b('0xd0')](_0x263f8d,_0x1d2190,function(_0xaafdef){if(_0xaafdef){console['log'](_0xa03b('0xed'),_0xaafdef);}else{fs[_0xa03b('0xee')](_0x263f8d);}});});});}else{return _0x3ee0d7[_0xa03b('0x1e')](0xc8);}})['catch'](handleError(_0x3ee0d7,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 26a3722..75812a4 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 _0x8aad=['length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','getUsers','then','setDataValue','Users','map','unreadMessages'];(function(_0x4e0dbd,_0x5eb8a8){var _0xe7d0b4=function(_0x117c49){while(--_0x117c49){_0x4e0dbd['push'](_0x4e0dbd['shift']());}};_0xe7d0b4(++_0x5eb8a8);}(_0x8aad,0x146));var _0xd8aa=function(_0x31f1d5,_0x236130){_0x31f1d5=_0x31f1d5-0x0;var _0x101fd5=_0x8aad[_0x31f1d5];return _0x101fd5;};'use strict';var EventEmitter=require(_0xd8aa('0x0'));var SmsInteraction=require(_0xd8aa('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0xd8aa('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xd8aa('0x2')](0x0);var events={'afterCreate':_0xd8aa('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x401aef){return function(_0x59804a,_0x53248c,_0x16b648){_0x59804a[_0xd8aa('0x4')]({'attributes':['id'],'raw':!![]})[_0xd8aa('0x5')](function(_0x4a4b10){_0x59804a[_0xd8aa('0x6')](_0xd8aa('0x7'),_0x4a4b10[_0xd8aa('0x8')](function(_0x350171){return{'id':_0x350171['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x59804a['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x24f3f1){_0x59804a[_0xd8aa('0x6')](_0xd8aa('0x9'),_0x24f3f1[_0xd8aa('0xa')]);SmsInteractionEvents[_0xd8aa('0xb')](_0x401aef+':'+_0x59804a['id'],_0x59804a);SmsInteractionEvents['emit'](_0x401aef,_0x59804a);_0x16b648(null);})[_0xd8aa('0xc')](_0x16b648(null));};}for(var e in events){if(events[_0xd8aa('0xd')](e)){var event=events[e];SmsInteraction[_0xd8aa('0xe')](e,emitEvent(event));}}module[_0xd8aa('0xf')]=SmsInteractionEvents; \ No newline at end of file +var _0xbbbc=['map','findAll','length','emit','hasOwnProperty','hook','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','remove','then','setDataValue','Users'];(function(_0x2cef86,_0xbae0a6){var _0x46dfd6=function(_0x52e464){while(--_0x52e464){_0x2cef86['push'](_0x2cef86['shift']());}};_0x46dfd6(++_0xbae0a6);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x5b3946,_0x23053c){_0x5b3946=_0x5b3946-0x0;var _0x2bd577=_0xbbbc[_0x5b3946];return _0x2bd577;};'use strict';var EventEmitter=require(_0xcbbb('0x0'));var SmsInteraction=require(_0xcbbb('0x1'))['db'][_0xcbbb('0x2')];var SmsMessage=require(_0xcbbb('0x1'))['db'][_0xcbbb('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xcbbb('0x4')](0x0);var events={'afterCreate':_0xcbbb('0x5'),'afterUpdate':'update','afterDestroy':_0xcbbb('0x6')};function emitEvent(_0x938376){return function(_0x45da04,_0x3ccbf6,_0x43ff05){_0x45da04['getUsers']({'attributes':['id'],'raw':!![]})[_0xcbbb('0x7')](function(_0x1796b4){_0x45da04[_0xcbbb('0x8')](_0xcbbb('0x9'),_0x1796b4[_0xcbbb('0xa')](function(_0x150355){return{'id':_0x150355['id']};}));return SmsMessage[_0xcbbb('0xb')]({'where':{'SmsInteractionId':_0x45da04['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x225156){_0x45da04['setDataValue']('unreadMessages',_0x225156[_0xcbbb('0xc')]);SmsInteractionEvents['emit'](_0x938376+':'+_0x45da04['id'],_0x45da04);SmsInteractionEvents[_0xcbbb('0xd')](_0x938376,_0x45da04);_0x43ff05(null);})['catch'](_0x43ff05(null));};}for(var e in events){if(events[_0xcbbb('0xe')](e)){var event=events[e];SmsInteraction[_0xcbbb('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 7fad1fe..e82dafb 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 _0x0a87=['exports','define','SmsInteraction','changed','closed','closedAt','lodash','util','api','moment','request-promise','path','./smsInteraction.attributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0a87,0x1da));var _0x70a8=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x0a87[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x70a8('0x0'));var util=require(_0x70a8('0x1'));var logger=require('../../config/logger')(_0x70a8('0x2'));var moment=require(_0x70a8('0x3'));var BPromise=require('bluebird');var rp=require(_0x70a8('0x4'));var fs=require('fs');var path=require(_0x70a8('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x70a8('0x6'));module[_0x70a8('0x7')]=function(_0x3e7423,_0xc0576f){return _0x3e7423[_0x70a8('0x8')](_0x70a8('0x9'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4b0936,_0x310d5b,_0x241a2c){if(_0x4b0936[_0x70a8('0xa')](_0x70a8('0xb'))){_0x4b0936[_0x70a8('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x241a2c(null,_0x4b0936);}}});}; \ No newline at end of file +var _0x62b0=['util','api','bluebird','request-promise','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x573706,_0x236d19){var _0x2f329c=function(_0x31473f){while(--_0x31473f){_0x573706['push'](_0x573706['shift']());}};_0x2f329c(++_0x236d19);}(_0x62b0,0xdf));var _0x062b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x62b0[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x062b('0x0'));var util=require(_0x062b('0x1'));var logger=require('../../config/logger')(_0x062b('0x2'));var moment=require('moment');var BPromise=require(_0x062b('0x3'));var rp=require(_0x062b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x062b('0x5'));var config=require(_0x062b('0x6'));var attributes=require(_0x062b('0x7'));module[_0x062b('0x8')]=function(_0x43aa8b,_0x45b23a){return _0x43aa8b[_0x062b('0x9')]('SmsInteraction',attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3c75c5,_0x2b28f2,_0x1e0114){if(_0x3c75c5[_0x062b('0xa')](_0x062b('0xb'))){_0x3c75c5['closedAt']=moment()[_0x062b('0xc')](_0x062b('0xd'));}_0x1e0114(null,_0x3c75c5);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 1aa0197..3bd9ed2 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 _0xee74=['limit','UpdateSmsInteraction','AddTagsToSmsInteraction','addTags','body','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','then','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','catch','SmsInteraction','update','raw','options','where','attributes'];(function(_0x433933,_0x278294){var _0x18dbe7=function(_0xa545e){while(--_0xa545e){_0x433933['push'](_0x433933['shift']());}};_0x18dbe7(++_0x278294);}(_0xee74,0xa9));var _0x4ee7=function(_0xcc1533,_0x2099d2){_0xcc1533=_0xcc1533-0x0;var _0x4523ef=_0xee74[_0xcc1533];return _0x4523ef;};'use strict';var _=require(_0x4ee7('0x0'));var util=require(_0x4ee7('0x1'));var moment=require('moment');var BPromise=require(_0x4ee7('0x2'));var rs=require(_0x4ee7('0x3'));var fs=require('fs');var Redis=require(_0x4ee7('0x4'));var db=require(_0x4ee7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4ee7('0x6'));var config=require(_0x4ee7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4ee7('0x8')]['http']({'port':0x232a});config[_0x4ee7('0x9')]=_[_0x4ee7('0xa')](config[_0x4ee7('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x4ee7('0xb'))(new Redis(config['redis']));require(_0x4ee7('0xc'))[_0x4ee7('0xd')](socket);function respondWithRpcPromise(_0x440845,_0x2862fa,_0x1bd3f9){return new BPromise(function(_0x332886,_0x164c6a){return client['request'](_0x440845,_0x1bd3f9)[_0x4ee7('0xe')](function(_0x32ceed){logger[_0x4ee7('0xf')]('SmsInteraction,\x20%s,\x20%s',_0x2862fa,_0x4ee7('0x10'));logger[_0x4ee7('0x11')](_0x4ee7('0x12'),_0x2862fa,'request\x20sent',JSON[_0x4ee7('0x13')](_0x32ceed));if(_0x32ceed['error']){if(_0x32ceed[_0x4ee7('0x14')][_0x4ee7('0x15')]===0x1f4){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x2862fa,_0x32ceed[_0x4ee7('0x14')]['message']);return _0x164c6a(_0x32ceed['error']['message']);}logger[_0x4ee7('0x14')](_0x4ee7('0x16'),_0x2862fa,_0x32ceed[_0x4ee7('0x14')]['message']);return _0x332886(_0x32ceed[_0x4ee7('0x14')]['message']);}else{logger[_0x4ee7('0xf')](_0x4ee7('0x16'),_0x2862fa,_0x4ee7('0x10'));_0x332886(_0x32ceed['result'][_0x4ee7('0x17')]);}})[_0x4ee7('0x18')](function(_0x3232b0){logger[_0x4ee7('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x2862fa,_0x3232b0);_0x164c6a(_0x3232b0);});});}exports['UpdateSmsInteraction']=function(_0x4cdfa7){var _0x548f57=this;return new Promise(function(_0x44a915,_0x3b1b5b){return db[_0x4ee7('0x19')][_0x4ee7('0x1a')](_0x4cdfa7['body'],{'raw':_0x4cdfa7['options']?_0x4cdfa7['options'][_0x4ee7('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cdfa7[_0x4ee7('0x1c')]?_0x4cdfa7['options'][_0x4ee7('0x1d')]||null:null,'attributes':_0x4cdfa7['options']?_0x4cdfa7['options'][_0x4ee7('0x1e')]||null:null,'limit':_0x4cdfa7[_0x4ee7('0x1c')]?_0x4cdfa7[_0x4ee7('0x1c')][_0x4ee7('0x1f')]||null:null})['then'](function(_0x1d3fe0){logger[_0x4ee7('0xf')](_0x4ee7('0x20'),_0x4cdfa7);logger['debug'](_0x4ee7('0x20'),_0x4cdfa7,JSON['stringify'](_0x1d3fe0));_0x44a915(_0x1d3fe0);})[_0x4ee7('0x18')](function(_0x117dac){logger['error']('UpdateSmsInteraction',_0x117dac[_0x4ee7('0x17')],_0x4cdfa7);_0x3b1b5b(_0x548f57[_0x4ee7('0x14')](0x1f4,_0x117dac['message']));});});};exports[_0x4ee7('0x21')]=function(_0x35879b){return new Promise(function(_0x545a25,_0x47f79e){return db[_0x4ee7('0x19')]['find']({'where':_0x35879b[_0x4ee7('0x1c')]?_0x35879b[_0x4ee7('0x1c')]['where']||null:null})[_0x4ee7('0xe')](function(_0xc1891f){if(_0xc1891f){return _0xc1891f[_0x4ee7('0x22')](_0x35879b[_0x4ee7('0x23')][_0x4ee7('0x24')],_[_0x4ee7('0x25')](_0x35879b[_0x4ee7('0x23')],['ids','id'])||{});}})[_0x4ee7('0x26')](function(_0x36478d){logger['info'](_0x4ee7('0x27'),_0x35879b);logger[_0x4ee7('0x11')](_0x4ee7('0x27'),_0x35879b,JSON[_0x4ee7('0x13')](_0x36478d));_0x545a25(_0x36478d);})[_0x4ee7('0x18')](function(_0x473d47){logger[_0x4ee7('0x14')](_0x4ee7('0x27'),_0x473d47[_0x4ee7('0x17')],_0x35879b);_0x47f79e(_this['error'](0x1f4,_0x473d47[_0x4ee7('0x17')]));});});}; \ No newline at end of file +var _0x6189=['../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','options','raw','where','attributes','limit','stringify','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x5cf766,_0x369914){var _0x135500=function(_0x30c227){while(--_0x30c227){_0x5cf766['push'](_0x5cf766['shift']());}};_0x135500(++_0x369914);}(_0x6189,0x157));var _0x9618=function(_0x3f5ec4,_0x536347){_0x3f5ec4=_0x3f5ec4-0x0;var _0x49922a=_0x6189[_0x3f5ec4];return _0x49922a;};'use strict';var _=require(_0x9618('0x0'));var util=require(_0x9618('0x1'));var moment=require(_0x9618('0x2'));var BPromise=require(_0x9618('0x3'));var rs=require(_0x9618('0x4'));var fs=require('fs');var Redis=require(_0x9618('0x5'));var db=require(_0x9618('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9618('0x7'))(_0x9618('0x8'));var config=require(_0x9618('0x9'));var jayson=require(_0x9618('0xa'));var client=jayson['client'][_0x9618('0xb')]({'port':0x232a});config[_0x9618('0xc')]=_[_0x9618('0xd')](config[_0x9618('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x9618('0xe'))(new Redis(config[_0x9618('0xc')]));require(_0x9618('0xf'))[_0x9618('0x10')](socket);function respondWithRpcPromise(_0x588f9f,_0x59e4df,_0x5b3b92){return new BPromise(function(_0x4a928c,_0x77a71a){return client[_0x9618('0x11')](_0x588f9f,_0x5b3b92)[_0x9618('0x12')](function(_0x5821a3){logger[_0x9618('0x13')](_0x9618('0x14'),_0x59e4df,_0x9618('0x15'));logger[_0x9618('0x16')](_0x9618('0x17'),_0x59e4df,'request\x20sent',JSON['stringify'](_0x5821a3));if(_0x5821a3[_0x9618('0x18')]){if(_0x5821a3['error'][_0x9618('0x19')]===0x1f4){logger['error'](_0x9618('0x14'),_0x59e4df,_0x5821a3['error']['message']);return _0x77a71a(_0x5821a3['error'][_0x9618('0x1a')]);}logger[_0x9618('0x18')](_0x9618('0x14'),_0x59e4df,_0x5821a3[_0x9618('0x18')][_0x9618('0x1a')]);return _0x4a928c(_0x5821a3[_0x9618('0x18')][_0x9618('0x1a')]);}else{logger[_0x9618('0x13')](_0x9618('0x14'),_0x59e4df,_0x9618('0x15'));_0x4a928c(_0x5821a3[_0x9618('0x1b')]['message']);}})[_0x9618('0x1c')](function(_0x45ba9f){logger['error'](_0x9618('0x14'),_0x59e4df,_0x45ba9f);_0x77a71a(_0x45ba9f);});});}exports[_0x9618('0x1d')]=function(_0x5b4c41){var _0x1157cf=this;return new Promise(function(_0x486430,_0x8fe86a){return db[_0x9618('0x1e')][_0x9618('0x1f')](_0x5b4c41['body'],{'raw':_0x5b4c41[_0x9618('0x20')]?_0x5b4c41['options'][_0x9618('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b4c41[_0x9618('0x20')]?_0x5b4c41[_0x9618('0x20')][_0x9618('0x22')]||null:null,'attributes':_0x5b4c41[_0x9618('0x20')]?_0x5b4c41[_0x9618('0x20')][_0x9618('0x23')]||null:null,'limit':_0x5b4c41['options']?_0x5b4c41[_0x9618('0x20')][_0x9618('0x24')]||null:null})['then'](function(_0x498f66){logger[_0x9618('0x13')](_0x9618('0x1d'),_0x5b4c41);logger[_0x9618('0x16')]('UpdateSmsInteraction',_0x5b4c41,JSON[_0x9618('0x25')](_0x498f66));_0x486430(_0x498f66);})['catch'](function(_0x54f098){logger['error']('UpdateSmsInteraction',_0x54f098['message'],_0x5b4c41);_0x8fe86a(_0x1157cf[_0x9618('0x18')](0x1f4,_0x54f098[_0x9618('0x1a')]));});});};exports['AddTagsToSmsInteraction']=function(_0x1ab3c6){return new Promise(function(_0xb9bb54,_0x429ff6){return db[_0x9618('0x1e')]['find']({'where':_0x1ab3c6[_0x9618('0x20')]?_0x1ab3c6[_0x9618('0x20')][_0x9618('0x22')]||null:null})['then'](function(_0x163f53){if(_0x163f53){return _0x163f53[_0x9618('0x26')](_0x1ab3c6[_0x9618('0x27')][_0x9618('0x28')],_[_0x9618('0x29')](_0x1ab3c6[_0x9618('0x27')],[_0x9618('0x28'),'id'])||{});}})[_0x9618('0x2a')](function(_0x231744){logger['info'](_0x9618('0x2b'),_0x1ab3c6);logger[_0x9618('0x16')]('AddTags',_0x1ab3c6,JSON[_0x9618('0x25')](_0x231744));_0xb9bb54(_0x231744);})[_0x9618('0x1c')](function(_0x26b1cc){logger['error']('AddTags',_0x26b1cc[_0x9618('0x1a')],_0x1ab3c6);_0x429ff6(_this[_0x9618('0x18')](0x1f4,_0x26b1cc[_0x9618('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 2106a19..90dfc8d 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 _0x821a=['remove','update','emit','removeListener','register','length','smsInteraction:','./smsInteraction.events','save'];(function(_0x11f9af,_0x2db61c){var _0x13a95=function(_0x2a9631){while(--_0x2a9631){_0x11f9af['push'](_0x11f9af['shift']());}};_0x13a95(++_0x2db61c);}(_0x821a,0x1c0));var _0xa821=function(_0x58e8c0,_0x423a7f){_0x58e8c0=_0x58e8c0-0x0;var _0x35ef81=_0x821a[_0x58e8c0];return _0x35ef81;};'use strict';var SmsInteractionEvents=require(_0xa821('0x0'));var events=[_0xa821('0x1'),_0xa821('0x2'),_0xa821('0x3')];function createListener(_0x2f8089,_0x3930dc){return function(_0x4ecbba){_0x3930dc[_0xa821('0x4')](_0x2f8089,_0x4ecbba);};}function removeListener(_0x2bf65c,_0x65f7eb){return function(){SmsInteractionEvents[_0xa821('0x5')](_0x2bf65c,_0x65f7eb);};}exports[_0xa821('0x6')]=function(_0x45fdac){for(var _0x36c267=0x0,_0x2eccae=events[_0xa821('0x7')];_0x36c267<_0x2eccae;_0x36c267++){var _0x54c02f=events[_0x36c267];var _0x55afaf=createListener(_0xa821('0x8')+_0x54c02f,_0x45fdac);SmsInteractionEvents['on'](_0x54c02f,_0x55afaf);}}; \ No newline at end of file +var _0xfb08=['register','length','smsInteraction:','./smsInteraction.events','save','emit','removeListener'];(function(_0x597484,_0x199340){var _0x218e64=function(_0x390d55){while(--_0x390d55){_0x597484['push'](_0x597484['shift']());}};_0x218e64(++_0x199340);}(_0xfb08,0xc0));var _0x8fb0=function(_0x321476,_0x5c42b8){_0x321476=_0x321476-0x0;var _0x4be33c=_0xfb08[_0x321476];return _0x4be33c;};'use strict';var SmsInteractionEvents=require(_0x8fb0('0x0'));var events=[_0x8fb0('0x1'),'remove','update'];function createListener(_0x48b9f5,_0x3a8bff){return function(_0x40fce9){_0x3a8bff[_0x8fb0('0x2')](_0x48b9f5,_0x40fce9);};}function removeListener(_0x1e8f35,_0xf9a279){return function(){SmsInteractionEvents[_0x8fb0('0x3')](_0x1e8f35,_0xf9a279);};}exports[_0x8fb0('0x4')]=function(_0x433e75){for(var _0x5636da=0x0,_0x2bb796=events[_0x8fb0('0x5')];_0x5636da<_0x2bb796;_0x5636da++){var _0x17775b=events[_0x5636da];var _0x4b5a12=createListener(_0x8fb0('0x6')+_0x17775b,_0x433e75);SmsInteractionEvents['on'](_0x17775b,_0x4b5a12);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 14a8ed0..987eded 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 _0x1dd4=['/describe','describe','show','sms','create','post','/:id/status','put','update','/:id/accept','/:id/reject','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index'];(function(_0x591e16,_0x5aefc1){var _0x543b35=function(_0x81e3be){while(--_0x81e3be){_0x591e16['push'](_0x591e16['shift']());}};_0x543b35(++_0x5aefc1);}(_0x1dd4,0x12a));var _0x41dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dd4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x41dd('0x0'));var timeout=require(_0x41dd('0x1'));var express=require(_0x41dd('0x2'));var router=express['Router']();var fs_extra=require(_0x41dd('0x3'));var auth=require(_0x41dd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x41dd('0x5'));var controller=require(_0x41dd('0x6'));router[_0x41dd('0x7')]('/',auth[_0x41dd('0x8')](),controller[_0x41dd('0x9')]);router[_0x41dd('0x7')](_0x41dd('0xa'),auth[_0x41dd('0x8')](),controller[_0x41dd('0xb')]);router[_0x41dd('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x41dd('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction['tracked'](_0x41dd('0xd'),'smsmessage:create'),controller[_0x41dd('0xe')]);router[_0x41dd('0xf')](_0x41dd('0x10'),controller['status']);router[_0x41dd('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x41dd('0x12')]);router['put'](_0x41dd('0x13'),auth[_0x41dd('0x8')](),controller['accept']);router['put'](_0x41dd('0x14'),auth[_0x41dd('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x41dd('0x8')](),controller['destroy']);module[_0x41dd('0x15')]=router; \ No newline at end of file +var _0x99f5=['describe','/:id','show','post','tracked','smsmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','reject','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x4463a1,_0x501f2a){var _0x1f5c8d=function(_0x3b9874){while(--_0x3b9874){_0x4463a1['push'](_0x4463a1['shift']());}};_0x1f5c8d(++_0x501f2a);}(_0x99f5,0x16d));var _0x599f=function(_0x51a4fc,_0x494cec){_0x51a4fc=_0x51a4fc-0x0;var _0x39bfaf=_0x99f5[_0x51a4fc];return _0x39bfaf;};'use strict';var multer=require('multer');var util=require(_0x599f('0x0'));var path=require(_0x599f('0x1'));var timeout=require(_0x599f('0x2'));var express=require('express');var router=express[_0x599f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x599f('0x4'));var interaction=require(_0x599f('0x5'));var config=require(_0x599f('0x6'));var controller=require('./smsMessage.controller');router[_0x599f('0x7')]('/',auth[_0x599f('0x8')](),controller[_0x599f('0x9')]);router[_0x599f('0x7')]('/describe',auth[_0x599f('0x8')](),controller[_0x599f('0xa')]);router[_0x599f('0x7')](_0x599f('0xb'),auth[_0x599f('0x8')](),controller[_0x599f('0xc')]);router[_0x599f('0xd')]('/',auth[_0x599f('0x8')](),interaction[_0x599f('0xe')]('sms',_0x599f('0xf')),controller[_0x599f('0x10')]);router[_0x599f('0xd')](_0x599f('0x11'),controller[_0x599f('0x12')]);router[_0x599f('0x13')](_0x599f('0xb'),auth[_0x599f('0x8')](),controller[_0x599f('0x14')]);router[_0x599f('0x13')](_0x599f('0x15'),auth[_0x599f('0x8')](),controller[_0x599f('0x16')]);router[_0x599f('0x13')]('/:id/reject',auth[_0x599f('0x8')](),controller[_0x599f('0x17')]);router['delete'](_0x599f('0xb'),auth[_0x599f('0x8')](),controller['destroy']);module[_0x599f('0x18')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 195ba69..54dca8d 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 _0x61d7=['BOOLEAN','ENUM','out','STRING','DATE','exports','TEXT','medium'];(function(_0x43a6cd,_0x503d1a){var _0x5acb36=function(_0x2dd95e){while(--_0x2dd95e){_0x43a6cd['push'](_0x43a6cd['shift']());}};_0x5acb36(++_0x503d1a);}(_0x61d7,0x1dd));var _0x761d=function(_0x163b2b,_0x11874d){_0x163b2b=_0x163b2b-0x0;var _0x5db503=_0x61d7[_0x163b2b];return _0x5db503;};'use strict';var Sequelize=require('sequelize');module[_0x761d('0x0')]={'body':{'type':Sequelize[_0x761d('0x1')](_0x761d('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x761d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x761d('0x4')]('in',_0x761d('0x5')),'defaultValue':_0x761d('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x761d('0x6')](0xbe)},'phone':{'type':Sequelize[_0x761d('0x6')]},'readAt':{'type':Sequelize[_0x761d('0x7')]},'secret':{'type':Sequelize[_0x761d('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x761d('0x6')]},'providerResponse':{'type':Sequelize[_0x761d('0x1')]}}; \ No newline at end of file +var _0x465c=['medium','out','STRING','DATE','BOOLEAN','TEXT','sequelize','exports'];(function(_0x1cf2ee,_0x202623){var _0x4627e8=function(_0x3988f3){while(--_0x3988f3){_0x1cf2ee['push'](_0x1cf2ee['shift']());}};_0x4627e8(++_0x202623);}(_0x465c,0x1ae));var _0xc465=function(_0x55ddf3,_0x54535a){_0x55ddf3=_0x55ddf3-0x0;var _0x4705a0=_0x465c[_0x55ddf3];return _0x4705a0;};'use strict';var Sequelize=require(_0xc465('0x0'));module[_0xc465('0x1')]={'body':{'type':Sequelize['TEXT'](_0xc465('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xc465('0x3')),'defaultValue':_0xc465('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xc465('0x4')](0xbe)},'phone':{'type':Sequelize[_0xc465('0x4')]},'readAt':{'type':Sequelize[_0xc465('0x5')]},'secret':{'type':Sequelize[_0xc465('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xc465('0x4')]},'providerResponse':{'type':Sequelize[_0xc465('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 1ef71f5..e287fd8 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 _0x26b0=['rejectmessage','SmsAccount','SmsAccountId','debug','SmsMessage,\x20%s,\x20%s,\x20%s','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','messageId','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','client','http','SmsMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','end','status','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','name','index','map','SmsMessage','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','SmsInteractionId','isNil','interaction','get','[SMSMESSAGE: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','SELECT','User','fullname','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','QueryTypes','contact','email'];(function(_0x2a6d45,_0x3c9321){var _0x295253=function(_0x51d622){while(--_0x51d622){_0x2a6d45['push'](_0x2a6d45['shift']());}};_0x295253(++_0x3c9321);}(_0x26b0,0x138));var _0x026b=function(_0x3bb43c,_0x5e18f3){_0x3bb43c=_0x3bb43c-0x0;var _0x1c5bf9=_0x26b0[_0x3bb43c];return _0x1c5bf9;};'use strict';var emlformat=require(_0x026b('0x0'));var rimraf=require(_0x026b('0x1'));var zipdir=require(_0x026b('0x2'));var jsonpatch=require(_0x026b('0x3'));var rp=require(_0x026b('0x4'));var moment=require(_0x026b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x026b('0x6'));var util=require(_0x026b('0x7'));var path=require(_0x026b('0x8'));var sox=require(_0x026b('0x9'));var csv=require(_0x026b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x026b('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x026b('0xc'));var deskjs=require(_0x026b('0xd'));var toCsv=require(_0x026b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x026b('0xe'));var authService=require(_0x026b('0xf'));var qs=require(_0x026b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x026b('0x11'));var logger=require(_0x026b('0x12'))(_0x026b('0x13'));var utils=require(_0x026b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x026b('0x15'));var db=require(_0x026b('0x16'))['db'];config[_0x026b('0x17')]=_[_0x026b('0x18')](config[_0x026b('0x17')],{'host':_0x026b('0x19'),'port':0x18eb});var socket=require(_0x026b('0x1a'))(new Redis(config['redis']));require(_0x026b('0x1b'))['register'](socket);var jayson=require(_0x026b('0x1c'));var client=jayson[_0x026b('0x1d')][_0x026b('0x1e')]({'port':0x232c});var client9002=jayson[_0x026b('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x250697,_0x1956a4,_0xe8d12,_0x4c0fca){return new BPromise(function(_0x5117f3,_0x4bd1ff){var _0x43b1a8=_0x4c0fca||client;return _0x43b1a8['request'](_0x250697,_0xe8d12)['then'](function(_0xbb0e24){logger['info'](_0x026b('0x1f'),_0x1956a4,_0x026b('0x20'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1956a4,_0x026b('0x20'),JSON[_0x026b('0x21')](_0xbb0e24));if(_0xbb0e24[_0x026b('0x22')]){if(_0xbb0e24[_0x026b('0x22')][_0x026b('0x23')]===0x1f4){logger['error'](_0x026b('0x1f'),_0x1956a4,_0xbb0e24[_0x026b('0x22')][_0x026b('0x24')]);return _0x4bd1ff(_0xbb0e24['error'][_0x026b('0x24')]);}logger[_0x026b('0x22')](_0x026b('0x1f'),_0x1956a4,_0xbb0e24[_0x026b('0x22')][_0x026b('0x24')]);return _0x5117f3(_0xbb0e24['error'][_0x026b('0x24')]);}else{logger[_0x026b('0x25')](_0x026b('0x1f'),_0x1956a4,_0x026b('0x20'));_0x5117f3(_0xbb0e24[_0x026b('0x26')][_0x026b('0x24')]);}})['catch'](function(_0x4b42b9){logger[_0x026b('0x22')]('SmsMessage,\x20%s,\x20%s',_0x1956a4,_0x4b42b9);_0x4bd1ff(_0x4b42b9);});});}function respondWithStatusCode(_0x27cb59,_0x19b1dc){_0x19b1dc=_0x19b1dc||0xcc;return function(_0x39f344){if(_0x39f344){return _0x27cb59['sendStatus'](_0x19b1dc);}return _0x27cb59['status'](_0x19b1dc)[_0x026b('0x27')]();};}function respondWithResult(_0x3f3999,_0x472191){_0x472191=_0x472191||0xc8;return function(_0x382e51){if(_0x382e51){return _0x3f3999[_0x026b('0x28')](_0x472191)['json'](_0x382e51);}};}function respondWithFilteredResult(_0x2ab365,_0x335463){return function(_0x464667){if(_0x464667){var _0x2bb89f=typeof _0x335463['offset']===_0x026b('0x29')&&typeof _0x335463[_0x026b('0x2a')]==='undefined';var _0x59e9b2=_0x464667[_0x026b('0x2b')];var _0x34fbba=_0x2bb89f?0x0:_0x335463['offset'];var _0x5b9edf=_0x2bb89f?_0x464667['count']:_0x335463[_0x026b('0x2c')]+_0x335463['limit'];var _0x33590f;if(_0x5b9edf>=_0x59e9b2){_0x5b9edf=_0x59e9b2;_0x33590f=0xc8;}else{_0x33590f=0xce;}_0x2ab365[_0x026b('0x28')](_0x33590f);return _0x2ab365[_0x026b('0x2d')](_0x026b('0x2e'),_0x34fbba+'-'+_0x5b9edf+'/'+_0x59e9b2)[_0x026b('0x2f')](_0x464667);}return null;};}function patchUpdates(_0x17bc65){return function(_0x421f43){try{jsonpatch['apply'](_0x421f43,_0x17bc65,!![]);}catch(_0x2d8002){return BPromise[_0x026b('0x30')](_0x2d8002);}return _0x421f43[_0x026b('0x31')]();};}function saveUpdates(_0x5a3781,_0x54df5a){return function(_0x283a18){if(_0x283a18){return _0x283a18[_0x026b('0x32')](_0x5a3781)[_0x026b('0x33')](function(_0x25e02c){return _0x25e02c;});}return null;};}function removeEntity(_0x48fe1c,_0x22d5c6){return function(_0x3ee3dd){if(_0x3ee3dd){return _0x3ee3dd[_0x026b('0x34')]()[_0x026b('0x33')](function(){_0x48fe1c['status'](0xcc)[_0x026b('0x27')]();});}};}function handleEntityNotFound(_0xa3adae,_0x685abe){return function(_0x163dff){if(!_0x163dff){_0xa3adae[_0x026b('0x35')](0x194);}return _0x163dff;};}function handleError(_0xab6df2,_0x862d33){_0x862d33=_0x862d33||0x1f4;return function(_0x339b59){logger[_0x026b('0x22')](_0x339b59['stack']);if(_0x339b59[_0x026b('0x36')]){delete _0x339b59[_0x026b('0x36')];}_0xab6df2[_0x026b('0x28')](_0x862d33)['send'](_0x339b59);};}exports[_0x026b('0x37')]=function(_0x1105cf,_0x3c8d55){var _0x30e072={},_0x27e29d={},_0x400c6f={'count':0x0,'rows':[]};var _0x5bb124=_[_0x026b('0x38')](db[_0x026b('0x39')][_0x026b('0x3a')],function(_0x5811e7){return{'name':_0x5811e7['fieldName'],'type':_0x5811e7[_0x026b('0x3b')]['key']};});_0x27e29d[_0x026b('0x3c')]=_['map'](_0x5bb124,_0x026b('0x36'));_0x27e29d[_0x026b('0x3d')]=_[_0x026b('0x3e')](_0x1105cf[_0x026b('0x3d')]);_0x27e29d['filters']=_[_0x026b('0x3f')](_0x27e29d[_0x026b('0x3c')],_0x27e29d[_0x026b('0x3d')]);_0x30e072[_0x026b('0x40')]=_['intersection'](_0x27e29d[_0x026b('0x3c')],qs[_0x026b('0x41')](_0x1105cf[_0x026b('0x3d')]['fields']));_0x30e072[_0x026b('0x40')]=_0x30e072[_0x026b('0x40')][_0x026b('0x42')]?_0x30e072[_0x026b('0x40')]:_0x27e29d[_0x026b('0x3c')];if(!_0x1105cf[_0x026b('0x3d')][_0x026b('0x43')]('nolimit')){_0x30e072[_0x026b('0x2a')]=qs[_0x026b('0x2a')](_0x1105cf[_0x026b('0x3d')][_0x026b('0x2a')]);_0x30e072[_0x026b('0x2c')]=qs[_0x026b('0x2c')](_0x1105cf[_0x026b('0x3d')]['offset']);}_0x30e072['order']=qs[_0x026b('0x44')](_0x1105cf['query'][_0x026b('0x44')]);_0x30e072['where']=qs[_0x026b('0x45')](_[_0x026b('0x46')](_0x1105cf[_0x026b('0x3d')],_0x27e29d[_0x026b('0x45')]),_0x5bb124);if(_0x1105cf[_0x026b('0x3d')][_0x026b('0x47')]){_0x30e072['where']=_['merge'](_0x30e072[_0x026b('0x48')],{'$or':_[_0x026b('0x38')](_0x5bb124,function(_0x300660){if(_0x300660[_0x026b('0x3b')]!==_0x026b('0x49')){var _0x197847={};_0x197847[_0x300660['name']]={'$like':'%'+_0x1105cf[_0x026b('0x3d')][_0x026b('0x47')]+'%'};return _0x197847;}})});}_0x30e072=_[_0x026b('0x4a')]({},_0x30e072,_0x1105cf[_0x026b('0x4b')]);var _0x4eb458={'where':_0x30e072[_0x026b('0x48')]};return db[_0x026b('0x39')]['count'](_0x4eb458)[_0x026b('0x33')](function(_0x1773eb){_0x400c6f[_0x026b('0x2b')]=_0x1773eb;if(_0x1105cf['query'][_0x026b('0x4c')]){_0x30e072[_0x026b('0x4d')]=[{'all':!![]}];}return db[_0x026b('0x39')][_0x026b('0x4e')](_0x30e072);})[_0x026b('0x33')](function(_0x50ef6f){_0x400c6f[_0x026b('0x4f')]=_0x50ef6f;return _0x400c6f;})[_0x026b('0x33')](respondWithFilteredResult(_0x3c8d55,_0x30e072))[_0x026b('0x50')](handleError(_0x3c8d55,null));};exports['show']=function(_0x43b296,_0x4a3028){var _0x40d424={'raw':!![],'where':{'id':_0x43b296[_0x026b('0x51')]['id']}},_0x2ccc79={};_0x2ccc79[_0x026b('0x3c')]=_[_0x026b('0x3e')](db[_0x026b('0x39')][_0x026b('0x3a')]);_0x2ccc79[_0x026b('0x3d')]=_[_0x026b('0x3e')](_0x43b296[_0x026b('0x3d')]);_0x2ccc79['filters']=_[_0x026b('0x3f')](_0x2ccc79[_0x026b('0x3c')],_0x2ccc79[_0x026b('0x3d')]);_0x40d424['attributes']=_[_0x026b('0x3f')](_0x2ccc79[_0x026b('0x3c')],qs[_0x026b('0x41')](_0x43b296[_0x026b('0x3d')][_0x026b('0x41')]));_0x40d424['attributes']=_0x40d424[_0x026b('0x40')][_0x026b('0x42')]?_0x40d424[_0x026b('0x40')]:_0x2ccc79[_0x026b('0x3c')];if(_0x43b296[_0x026b('0x3d')][_0x026b('0x4c')]){_0x40d424[_0x026b('0x4d')]=[{'all':!![]}];}_0x40d424=_[_0x026b('0x4a')]({},_0x40d424,_0x43b296[_0x026b('0x4b')]);return db[_0x026b('0x39')][_0x026b('0x52')](_0x40d424)['then'](handleEntityNotFound(_0x4a3028,null))[_0x026b('0x33')](respondWithResult(_0x4a3028,null))[_0x026b('0x50')](handleError(_0x4a3028,null));};exports[_0x026b('0x53')]=function(_0x5bb329,_0x495425){return db[_0x026b('0x39')][_0x026b('0x53')](_0x5bb329[_0x026b('0x54')],{})['then'](respondWithResult(_0x495425,0xc9))['catch'](handleError(_0x495425,null));};exports[_0x026b('0x32')]=function(_0x3f8b13,_0xc3bcd0){if(_0x3f8b13[_0x026b('0x54')]['id']){delete _0x3f8b13['body']['id'];}return db[_0x026b('0x39')][_0x026b('0x52')]({'where':{'id':_0x3f8b13['params']['id']}})[_0x026b('0x33')](handleEntityNotFound(_0xc3bcd0,null))[_0x026b('0x33')](saveUpdates(_0x3f8b13[_0x026b('0x54')],null))['then'](respondWithResult(_0xc3bcd0,null))[_0x026b('0x50')](handleError(_0xc3bcd0,null));};exports['destroy']=function(_0x3334e6,_0x416475){return db['SmsMessage'][_0x026b('0x52')]({'where':{'id':_0x3334e6[_0x026b('0x51')]['id']}})['then'](handleEntityNotFound(_0x416475,null))[_0x026b('0x33')](removeEntity(_0x416475,null))[_0x026b('0x50')](handleError(_0x416475,null));};exports['describe']=function(_0x422e38,_0x813477){return db[_0x026b('0x39')]['describe']()[_0x026b('0x33')](respondWithResult(_0x813477,null))[_0x026b('0x50')](handleError(_0x813477,null));};var interaction_log=require(_0x026b('0x12'))(_0x026b('0x55'));exports[_0x026b('0x56')]=function(_0x45b74f,_0x424588,_0x2b64ce){var _0x30a887={'agent':{},'channel':_0x026b('0x57')};if(_0x45b74f[_0x026b('0x54')]['id']){delete _0x45b74f[_0x026b('0x54')]['id'];}_0x45b74f[_0x026b('0x54')][_0x026b('0x58')]=!![];_0x45b74f[_0x026b('0x54')][_0x026b('0x59')]=moment()[_0x026b('0x5a')](_0x026b('0x5b'));_0x45b74f['body']['UserId']=_0x45b74f[_0x026b('0x54')][_0x026b('0x5c')]||_0x45b74f[_0x026b('0x5d')]['id'];_0x30a887[_0x026b('0x5e')]['id']=_0x45b74f[_0x026b('0x54')][_0x026b('0x5c')];return db[_0x026b('0x39')][_0x026b('0x52')]({'where':{'id':_0x45b74f[_0x026b('0x51')]['id'],'UserId':null}})[_0x026b('0x33')](handleEntityNotFound(_0x424588,null))[_0x026b('0x33')](saveUpdates(_0x45b74f['body'],null))[_0x026b('0x33')](function(_0x5e32a1){if(_0x5e32a1){_0x30a887[_0x026b('0x24')]=_0x5e32a1['get']({'plain':!![]});return db[_0x026b('0x5f')][_0x026b('0x52')]({'where':{'id':_0x5e32a1[_0x026b('0x60')]}});}return null;})[_0x026b('0x33')](handleEntityNotFound(_0x424588,null))[_0x026b('0x33')](function(_0x2e8e42){if(_0x2e8e42){return _0x2e8e42[_0x026b('0x32')]({'UserId':_0x45b74f[_0x026b('0x54')][_0x026b('0x5c')],'read1stAt':_[_0x026b('0x61')](_0x2e8e42['read1stAt'])?moment()[_0x026b('0x5a')](_0x026b('0x5b')):undefined});}return null;})['then'](function(_0x391a69){if(_0x391a69){_0x30a887[_0x026b('0x62')]=_0x391a69[_0x026b('0x63')]({'plain':!![]});interaction_log[_0x026b('0x25')](_0x026b('0x64'),_0x45b74f['user']['id'],_0x45b74f[_0x026b('0x5d')]['name'],_0x45b74f[_0x026b('0x5d')]['role'],_0x30a887[_0x026b('0x62')]['id'],_0x45b74f[_0x026b('0x54')]?JSON['stringify'](_0x45b74f[_0x026b('0x54')]):'null');return respondWithRpcPromise(_0x026b('0x65'),_0x026b('0x66'),_0x30a887);}return null;})[_0x026b('0x33')](function(_0x453445){var _0x5c5023=_0x026b('0x67')+_0x453445[_0x026b('0x24')][_0x026b('0x68')];return db[_0x026b('0x69')][_0x026b('0x3d')](_0x5c5023,{'type':db[_0x026b('0x6a')]['QueryTypes'][_0x026b('0x6b')],'raw':!![]})[_0x026b('0x33')](function(_0x119483){return _0x119483;});})[_0x026b('0x33')](function(_0x35baf2){if(_0x35baf2){_0x30a887[_0x026b('0x24')]['contact']=_0x35baf2[0x0];if(!_0x45b74f[_0x026b('0x54')]['UserId'])return;return db[_0x026b('0x6c')][_0x026b('0x52')]({'where':{'id':_0x45b74f['body']['UserId'],'role':_0x026b('0x5e')},'attributes':['id',_0x026b('0x36'),_0x026b('0x6d'),'email',_0x026b('0x6e')],'raw':!![]});}return null;})['then'](function(_0x5b5875){if(!_0x5b5875)return null;_0x30a887['message'][_0x026b('0x5e')]=_0x5b5875;return _0x30a887;})[_0x026b('0x33')](function(_0xd798ac){if(_0xd798ac){if(_0x45b74f[_0x026b('0x54')]['manual']){_0x30a887[_0x026b('0x24')][_0x026b('0x6f')]=util[_0x026b('0x5a')](_0x026b('0x70'),_0x45b74f[_0x026b('0x5d')][_0x026b('0x36')]);_0x30a887['message']['channel']=_0x30a887[_0x026b('0x71')];_0x30a887[_0x026b('0x24')][_0x026b('0x72')]=_0x30a887[_0x026b('0x71')];_0x30a887['message'][_0x026b('0x73')]=_0x026b('0x56');return respondWithRpcPromise(_0x026b('0x74'),_0x026b('0x74'),{'event':_0x026b('0x75'),'message':_0x30a887[_0x026b('0x24')]},client9002)[_0x026b('0x33')](function(){return _0x30a887;});}return _0x30a887;}return null;})[_0x026b('0x33')](respondWithResult(_0x424588,null))[_0x026b('0x50')](handleError(_0x424588,null));};var interaction_log=require('../../config/logger')(_0x026b('0x55'));exports[_0x026b('0x30')]=function(_0x525ea8,_0x52cb12,_0x30d002){var _0x5a5ee3={'agent':{},'channel':'sms'};if(_0x525ea8[_0x026b('0x54')]['id']){delete _0x525ea8[_0x026b('0x54')]['id'];}_0x525ea8[_0x026b('0x54')][_0x026b('0x5c')]=_0x525ea8[_0x026b('0x54')]['UserId']||_0x525ea8['user']['id'];_0x5a5ee3[_0x026b('0x5e')]['id']=_0x525ea8[_0x026b('0x54')]['UserId'];return db[_0x026b('0x39')][_0x026b('0x52')]({'where':{'id':_0x525ea8[_0x026b('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x52cb12,null))[_0x026b('0x33')](function(_0x1c61f2){if(_0x1c61f2){_0x5a5ee3['message']=_0x1c61f2[_0x026b('0x63')]({'plain':!![]});return db[_0x026b('0x5f')][_0x026b('0x52')]({'where':{'id':_0x1c61f2[_0x026b('0x60')]}});}return null;})[_0x026b('0x33')](handleEntityNotFound(_0x52cb12,null))['then'](function(_0x5ec571){if(_0x5ec571){_0x5a5ee3[_0x026b('0x62')]=_0x5ec571[_0x026b('0x63')]({'plain':!![]});interaction_log[_0x026b('0x25')](_0x026b('0x76'),_0x525ea8[_0x026b('0x5d')]['id'],_0x525ea8['user']['name'],_0x525ea8[_0x026b('0x5d')][_0x026b('0x77')],_0x5a5ee3['interaction']['id'],_0x525ea8[_0x026b('0x54')]?JSON['stringify'](_0x525ea8[_0x026b('0x54')]):_0x026b('0x78'));return respondWithRpcPromise(_0x026b('0x79'),_0x026b('0x7a'),_0x5a5ee3);}return null;})[_0x026b('0x33')](function(_0x13883a){var _0x349ff8=_0x026b('0x67')+_0x13883a[_0x026b('0x24')][_0x026b('0x68')];return db[_0x026b('0x69')][_0x026b('0x3d')](_0x349ff8,{'type':db[_0x026b('0x6a')][_0x026b('0x7b')][_0x026b('0x6b')],'raw':!![]})[_0x026b('0x33')](function(_0x14272a){return _0x14272a;});})['then'](function(_0x31a8e8){if(_0x31a8e8){_0x5a5ee3[_0x026b('0x24')][_0x026b('0x7c')]=_0x31a8e8[0x0];if(!_0x525ea8[_0x026b('0x54')][_0x026b('0x5c')])return;return db['User']['find']({'where':{'id':_0x525ea8['body']['UserId'],'role':_0x026b('0x5e')},'attributes':['id',_0x026b('0x36'),_0x026b('0x6d'),_0x026b('0x7d'),_0x026b('0x6e')],'raw':!![]});}return null;})[_0x026b('0x33')](function(_0x31f6f3){if(!_0x31f6f3)return null;_0x5a5ee3[_0x026b('0x24')]['agent']=_0x31f6f3;return _0x5a5ee3;})[_0x026b('0x33')](function(_0x287e03){if(_0x287e03){_0x287e03['message'][_0x026b('0x6f')]=util[_0x026b('0x5a')](_0x026b('0x70'),_0x525ea8['user'][_0x026b('0x36')]);_0x287e03[_0x026b('0x24')][_0x026b('0x71')]=_0x5a5ee3[_0x026b('0x71')];_0x287e03[_0x026b('0x24')][_0x026b('0x72')]=_0x5a5ee3['channel'];_0x287e03[_0x026b('0x24')][_0x026b('0x73')]=_0x026b('0x30');respondWithRpcPromise(_0x026b('0x74'),_0x026b('0x74'),{'event':_0x026b('0x7e'),'message':_0x287e03[_0x026b('0x24')]},client9002);return _0x5a5ee3;}return null;})[_0x026b('0x33')](respondWithResult(_0x52cb12,null))[_0x026b('0x50')](handleError(_0x52cb12,null));};exports[_0x026b('0x28')]=function(_0x578af5,_0x32f151,_0x5a779e){if(_0x578af5[_0x026b('0x54')]['id']){delete _0x578af5[_0x026b('0x54')]['id'];}var _0x269f9c;return db[_0x026b('0x39')][_0x026b('0x52')]({'where':{'id':_0x578af5[_0x026b('0x51')]['id']}})[_0x026b('0x33')](handleEntityNotFound(_0x32f151,null))[_0x026b('0x33')](function(_0x4928eb){if(_0x4928eb){_0x269f9c=_0x4928eb;return db[_0x026b('0x7f')][_0x026b('0x52')]({'where':{'id':_0x4928eb[_0x026b('0x80')]}});}})[_0x026b('0x33')](handleEntityNotFound(_0x32f151,null))[_0x026b('0x33')](function(_0x41722c){if(_0x41722c){logger[_0x026b('0x81')](_0x026b('0x82'),_0x026b('0x28'),'received\x20delivery\x20report\x20from',_0x41722c[_0x026b('0x3b')],util['inspect'](_0x578af5[_0x026b('0x54')],{'showHidden':![],'depth':null}));switch(_0x41722c[_0x026b('0x3b')]){case _0x026b('0x83'):if(_0x578af5['body'][_0x026b('0x84')]&&_0x578af5[_0x026b('0x54')]['MessageSid']===_0x269f9c['messageId']){return _0x269f9c['update']({'read':!![]});}else{logger['error'](_0x026b('0x85'),_0x026b('0x28'),'twilio',util[_0x026b('0x86')](_0x578af5[_0x026b('0x54')],{'showHidden':![],'depth':null}));}break;case _0x026b('0x87'):if(_0x578af5[_0x026b('0x54')][_0x026b('0x88')]&&_0x578af5[_0x026b('0x54')][_0x026b('0x88')]===_0x269f9c[_0x026b('0x89')]&&_[_0x026b('0x8a')]([_0x026b('0x8b'),_0x026b('0x8c')],_0x578af5[_0x026b('0x54')][_0x026b('0x8d')])>=0x0){return _0x269f9c[_0x026b('0x32')]({'read':!![]});}else{logger['error'](_0x026b('0x85'),_0x026b('0x28'),_0x026b('0x8e'),util[_0x026b('0x86')](_0x578af5['body'],{'showHidden':![],'depth':null}));}break;case _0x026b('0x8f'):var _0x6d4d2a=_0x578af5[_0x026b('0x54')][_0x026b('0x90')][0x0];if(_0x6d4d2a[_0x026b('0x28')][_0x026b('0x91')]==='DELIVERED'){return _0x269f9c[_0x026b('0x32')]({'read':!![]});}else{logger[_0x026b('0x22')](_0x026b('0x85'),_0x026b('0x28'),_0x026b('0x8f'),util[_0x026b('0x86')](_0x578af5[_0x026b('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x269f9c;}})['then'](respondWithResult(_0x32f151,null))[_0x026b('0x50')](handleError(_0x32f151,null));}; \ No newline at end of file +var _0x3f96=['twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','messageId','indexOf','delivered','Status','plivio','results','groupName','DELIVERED','infobip','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','http','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','stack','name','send','index','SmsMessage','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','merge','options','findAll','show','params','include','create','body','find','describe','sms-interactions','sms','read','readAt','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','role','interaction','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','email','internal','manual','interface','SIP/%s','user','channel','motionChannel','event','accept','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','fullname','SmsAccount','inspect'];(function(_0x5caf36,_0x12d063){var _0x289ee5=function(_0x23cf9b){while(--_0x23cf9b){_0x5caf36['push'](_0x5caf36['shift']());}};_0x289ee5(++_0x12d063);}(_0x3f96,0x1d3));var _0x63f9=function(_0x139fe8,_0x51f63e){_0x139fe8=_0x139fe8-0x0;var _0x3cad23=_0x3f96[_0x139fe8];return _0x3cad23;};'use strict';var emlformat=require(_0x63f9('0x0'));var rimraf=require(_0x63f9('0x1'));var zipdir=require(_0x63f9('0x2'));var jsonpatch=require(_0x63f9('0x3'));var rp=require(_0x63f9('0x4'));var moment=require('moment');var BPromise=require(_0x63f9('0x5'));var Mustache=require(_0x63f9('0x6'));var util=require(_0x63f9('0x7'));var path=require(_0x63f9('0x8'));var sox=require(_0x63f9('0x9'));var csv=require('to-csv');var ejs=require(_0x63f9('0xa'));var fs=require('fs');var fs_extra=require(_0x63f9('0xb'));var _=require(_0x63f9('0xc'));var squel=require(_0x63f9('0xd'));var crypto=require('crypto');var jsforce=require(_0x63f9('0xe'));var deskjs=require(_0x63f9('0xf'));var toCsv=require(_0x63f9('0x10'));var querystring=require(_0x63f9('0x11'));var Papa=require(_0x63f9('0x12'));var Redis=require(_0x63f9('0x13'));var authService=require(_0x63f9('0x14'));var qs=require(_0x63f9('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x63f9('0x16'));var logger=require(_0x63f9('0x17'))('api');var utils=require(_0x63f9('0x18'));var config=require(_0x63f9('0x19'));var licenseUtil=require(_0x63f9('0x1a'));var db=require('../../mysqldb')['db'];config[_0x63f9('0x1b')]=_[_0x63f9('0x1c')](config[_0x63f9('0x1b')],{'host':_0x63f9('0x1d'),'port':0x18eb});var socket=require(_0x63f9('0x1e'))(new Redis(config[_0x63f9('0x1b')]));require(_0x63f9('0x1f'))['register'](socket);var jayson=require(_0x63f9('0x20'));var client=jayson['client'][_0x63f9('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x63f9('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x1fa6dd,_0x37fc43,_0x352334,_0x100d39){return new BPromise(function(_0x1da33e,_0x40dc35){var _0x5e25ae=_0x100d39||client;return _0x5e25ae[_0x63f9('0x22')](_0x1fa6dd,_0x352334)[_0x63f9('0x23')](function(_0x44c937){logger[_0x63f9('0x24')](_0x63f9('0x25'),_0x37fc43,'request\x20sent');logger[_0x63f9('0x26')](_0x63f9('0x27'),_0x37fc43,_0x63f9('0x28'),JSON['stringify'](_0x44c937));if(_0x44c937[_0x63f9('0x29')]){if(_0x44c937[_0x63f9('0x29')][_0x63f9('0x2a')]===0x1f4){logger[_0x63f9('0x29')](_0x63f9('0x25'),_0x37fc43,_0x44c937['error']['message']);return _0x40dc35(_0x44c937[_0x63f9('0x29')][_0x63f9('0x2b')]);}logger[_0x63f9('0x29')](_0x63f9('0x25'),_0x37fc43,_0x44c937[_0x63f9('0x29')][_0x63f9('0x2b')]);return _0x1da33e(_0x44c937[_0x63f9('0x29')]['message']);}else{logger['info'](_0x63f9('0x25'),_0x37fc43,_0x63f9('0x28'));_0x1da33e(_0x44c937[_0x63f9('0x2c')][_0x63f9('0x2b')]);}})[_0x63f9('0x2d')](function(_0x62c363){logger[_0x63f9('0x29')](_0x63f9('0x25'),_0x37fc43,_0x62c363);_0x40dc35(_0x62c363);});});}function respondWithStatusCode(_0x5637c3,_0x4abbf2){_0x4abbf2=_0x4abbf2||0xcc;return function(_0x5cf43d){if(_0x5cf43d){return _0x5637c3[_0x63f9('0x2e')](_0x4abbf2);}return _0x5637c3[_0x63f9('0x2f')](_0x4abbf2)[_0x63f9('0x30')]();};}function respondWithResult(_0x4bc6fd,_0x1a43e5){_0x1a43e5=_0x1a43e5||0xc8;return function(_0x4c6f08){if(_0x4c6f08){return _0x4bc6fd[_0x63f9('0x2f')](_0x1a43e5)[_0x63f9('0x31')](_0x4c6f08);}};}function respondWithFilteredResult(_0x25f5f0,_0x51c84b){return function(_0x1b56bd){if(_0x1b56bd){var _0x3e6728=typeof _0x51c84b[_0x63f9('0x32')]===_0x63f9('0x33')&&typeof _0x51c84b[_0x63f9('0x34')]===_0x63f9('0x33');var _0x4817bc=_0x1b56bd[_0x63f9('0x35')];var _0x345337=_0x3e6728?0x0:_0x51c84b[_0x63f9('0x32')];var _0x3ca8a6=_0x3e6728?_0x1b56bd[_0x63f9('0x35')]:_0x51c84b[_0x63f9('0x32')]+_0x51c84b[_0x63f9('0x34')];var _0x204c81;if(_0x3ca8a6>=_0x4817bc){_0x3ca8a6=_0x4817bc;_0x204c81=0xc8;}else{_0x204c81=0xce;}_0x25f5f0[_0x63f9('0x2f')](_0x204c81);return _0x25f5f0['set'](_0x63f9('0x36'),_0x345337+'-'+_0x3ca8a6+'/'+_0x4817bc)['json'](_0x1b56bd);}return null;};}function patchUpdates(_0x419ac8){return function(_0xc8819f){try{jsonpatch[_0x63f9('0x37')](_0xc8819f,_0x419ac8,!![]);}catch(_0x387beb){return BPromise[_0x63f9('0x38')](_0x387beb);}return _0xc8819f['save']();};}function saveUpdates(_0xc7d23a,_0x53e06c){return function(_0x49b25d){if(_0x49b25d){return _0x49b25d[_0x63f9('0x39')](_0xc7d23a)[_0x63f9('0x23')](function(_0x100561){return _0x100561;});}return null;};}function removeEntity(_0x5d90ea,_0x27d6da){return function(_0x5e5975){if(_0x5e5975){return _0x5e5975[_0x63f9('0x3a')]()[_0x63f9('0x23')](function(){_0x5d90ea[_0x63f9('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54d2c4,_0xb4e975){return function(_0x276c45){if(!_0x276c45){_0x54d2c4[_0x63f9('0x2e')](0x194);}return _0x276c45;};}function handleError(_0x24e128,_0x55b6bd){_0x55b6bd=_0x55b6bd||0x1f4;return function(_0x133cd6){logger[_0x63f9('0x29')](_0x133cd6[_0x63f9('0x3b')]);if(_0x133cd6[_0x63f9('0x3c')]){delete _0x133cd6['name'];}_0x24e128[_0x63f9('0x2f')](_0x55b6bd)[_0x63f9('0x3d')](_0x133cd6);};}exports[_0x63f9('0x3e')]=function(_0x21a633,_0x313602){var _0x448be1={},_0x36c9fd={},_0x2af5a5={'count':0x0,'rows':[]};var _0xf1515b=_['map'](db[_0x63f9('0x3f')][_0x63f9('0x40')],function(_0x110aa1){return{'name':_0x110aa1[_0x63f9('0x41')],'type':_0x110aa1[_0x63f9('0x42')][_0x63f9('0x43')]};});_0x36c9fd['model']=_[_0x63f9('0x44')](_0xf1515b,_0x63f9('0x3c'));_0x36c9fd[_0x63f9('0x45')]=_[_0x63f9('0x46')](_0x21a633[_0x63f9('0x45')]);_0x36c9fd[_0x63f9('0x47')]=_[_0x63f9('0x48')](_0x36c9fd[_0x63f9('0x49')],_0x36c9fd['query']);_0x448be1['attributes']=_['intersection'](_0x36c9fd['model'],qs[_0x63f9('0x4a')](_0x21a633[_0x63f9('0x45')][_0x63f9('0x4a')]));_0x448be1[_0x63f9('0x4b')]=_0x448be1[_0x63f9('0x4b')][_0x63f9('0x4c')]?_0x448be1[_0x63f9('0x4b')]:_0x36c9fd[_0x63f9('0x49')];if(!_0x21a633[_0x63f9('0x45')]['hasOwnProperty'](_0x63f9('0x4d'))){_0x448be1['limit']=qs[_0x63f9('0x34')](_0x21a633['query'][_0x63f9('0x34')]);_0x448be1[_0x63f9('0x32')]=qs[_0x63f9('0x32')](_0x21a633['query'][_0x63f9('0x32')]);}_0x448be1[_0x63f9('0x4e')]=qs[_0x63f9('0x4f')](_0x21a633['query']['sort']);_0x448be1[_0x63f9('0x50')]=qs[_0x63f9('0x47')](_[_0x63f9('0x51')](_0x21a633[_0x63f9('0x45')],_0x36c9fd[_0x63f9('0x47')]),_0xf1515b);if(_0x21a633[_0x63f9('0x45')]['filter']){_0x448be1[_0x63f9('0x50')]=_[_0x63f9('0x52')](_0x448be1['where'],{'$or':_[_0x63f9('0x44')](_0xf1515b,function(_0x1c701b){if(_0x1c701b[_0x63f9('0x42')]!=='VIRTUAL'){var _0x585202={};_0x585202[_0x1c701b[_0x63f9('0x3c')]]={'$like':'%'+_0x21a633[_0x63f9('0x45')]['filter']+'%'};return _0x585202;}})});}_0x448be1=_[_0x63f9('0x52')]({},_0x448be1,_0x21a633[_0x63f9('0x53')]);var _0x2610ae={'where':_0x448be1[_0x63f9('0x50')]};return db[_0x63f9('0x3f')]['count'](_0x2610ae)[_0x63f9('0x23')](function(_0x991447){_0x2af5a5[_0x63f9('0x35')]=_0x991447;if(_0x21a633['query']['includeAll']){_0x448be1['include']=[{'all':!![]}];}return db['SmsMessage'][_0x63f9('0x54')](_0x448be1);})[_0x63f9('0x23')](function(_0x410bc5){_0x2af5a5['rows']=_0x410bc5;return _0x2af5a5;})['then'](respondWithFilteredResult(_0x313602,_0x448be1))[_0x63f9('0x2d')](handleError(_0x313602,null));};exports[_0x63f9('0x55')]=function(_0x1a91cc,_0x803b18){var _0x3b1047={'raw':!![],'where':{'id':_0x1a91cc[_0x63f9('0x56')]['id']}},_0x32a16f={};_0x32a16f[_0x63f9('0x49')]=_['keys'](db[_0x63f9('0x3f')][_0x63f9('0x40')]);_0x32a16f['query']=_[_0x63f9('0x46')](_0x1a91cc[_0x63f9('0x45')]);_0x32a16f['filters']=_[_0x63f9('0x48')](_0x32a16f['model'],_0x32a16f[_0x63f9('0x45')]);_0x3b1047[_0x63f9('0x4b')]=_[_0x63f9('0x48')](_0x32a16f[_0x63f9('0x49')],qs[_0x63f9('0x4a')](_0x1a91cc[_0x63f9('0x45')]['fields']));_0x3b1047[_0x63f9('0x4b')]=_0x3b1047['attributes'][_0x63f9('0x4c')]?_0x3b1047[_0x63f9('0x4b')]:_0x32a16f['model'];if(_0x1a91cc[_0x63f9('0x45')]['includeAll']){_0x3b1047[_0x63f9('0x57')]=[{'all':!![]}];}_0x3b1047=_[_0x63f9('0x52')]({},_0x3b1047,_0x1a91cc['options']);return db[_0x63f9('0x3f')]['find'](_0x3b1047)[_0x63f9('0x23')](handleEntityNotFound(_0x803b18,null))[_0x63f9('0x23')](respondWithResult(_0x803b18,null))['catch'](handleError(_0x803b18,null));};exports[_0x63f9('0x58')]=function(_0x4601d3,_0x1906c5){return db['SmsMessage']['create'](_0x4601d3[_0x63f9('0x59')],{})[_0x63f9('0x23')](respondWithResult(_0x1906c5,0xc9))['catch'](handleError(_0x1906c5,null));};exports[_0x63f9('0x39')]=function(_0x3d6e70,_0x554e0f){if(_0x3d6e70[_0x63f9('0x59')]['id']){delete _0x3d6e70[_0x63f9('0x59')]['id'];}return db[_0x63f9('0x3f')]['find']({'where':{'id':_0x3d6e70[_0x63f9('0x56')]['id']}})[_0x63f9('0x23')](handleEntityNotFound(_0x554e0f,null))['then'](saveUpdates(_0x3d6e70[_0x63f9('0x59')],null))['then'](respondWithResult(_0x554e0f,null))[_0x63f9('0x2d')](handleError(_0x554e0f,null));};exports['destroy']=function(_0x41a163,_0x3b40ec){return db[_0x63f9('0x3f')][_0x63f9('0x5a')]({'where':{'id':_0x41a163[_0x63f9('0x56')]['id']}})['then'](handleEntityNotFound(_0x3b40ec,null))['then'](removeEntity(_0x3b40ec,null))[_0x63f9('0x2d')](handleError(_0x3b40ec,null));};exports[_0x63f9('0x5b')]=function(_0x3cbdb9,_0x8c8d78){return db['SmsMessage'][_0x63f9('0x5b')]()[_0x63f9('0x23')](respondWithResult(_0x8c8d78,null))['catch'](handleError(_0x8c8d78,null));};var interaction_log=require('../../config/logger')(_0x63f9('0x5c'));exports['accept']=function(_0x40f42c,_0x3726d0,_0x431901){var _0x547590={'agent':{},'channel':_0x63f9('0x5d')};if(_0x40f42c['body']['id']){delete _0x40f42c[_0x63f9('0x59')]['id'];}_0x40f42c[_0x63f9('0x59')][_0x63f9('0x5e')]=!![];_0x40f42c[_0x63f9('0x59')][_0x63f9('0x5f')]=moment()[_0x63f9('0x60')](_0x63f9('0x61'));_0x40f42c[_0x63f9('0x59')][_0x63f9('0x62')]=_0x40f42c['body'][_0x63f9('0x62')]||_0x40f42c['user']['id'];_0x547590[_0x63f9('0x63')]['id']=_0x40f42c[_0x63f9('0x59')][_0x63f9('0x62')];return db[_0x63f9('0x3f')]['find']({'where':{'id':_0x40f42c[_0x63f9('0x56')]['id'],'UserId':null}})[_0x63f9('0x23')](handleEntityNotFound(_0x3726d0,null))['then'](saveUpdates(_0x40f42c[_0x63f9('0x59')],null))[_0x63f9('0x23')](function(_0x18488f){if(_0x18488f){_0x547590['message']=_0x18488f[_0x63f9('0x64')]({'plain':!![]});return db[_0x63f9('0x65')]['find']({'where':{'id':_0x18488f[_0x63f9('0x66')]}});}return null;})[_0x63f9('0x23')](handleEntityNotFound(_0x3726d0,null))[_0x63f9('0x23')](function(_0x317752){if(_0x317752){return _0x317752[_0x63f9('0x39')]({'UserId':_0x40f42c[_0x63f9('0x59')]['UserId'],'read1stAt':_[_0x63f9('0x67')](_0x317752['read1stAt'])?moment()[_0x63f9('0x60')](_0x63f9('0x61')):undefined});}return null;})[_0x63f9('0x23')](function(_0x4fff95){if(_0x4fff95){_0x547590['interaction']=_0x4fff95[_0x63f9('0x64')]({'plain':!![]});interaction_log[_0x63f9('0x24')](_0x63f9('0x68'),_0x40f42c['user']['id'],_0x40f42c['user'][_0x63f9('0x3c')],_0x40f42c['user'][_0x63f9('0x69')],_0x547590[_0x63f9('0x6a')]['id'],_0x40f42c[_0x63f9('0x59')]?JSON[_0x63f9('0x6b')](_0x40f42c[_0x63f9('0x59')]):_0x63f9('0x6c'));return respondWithRpcPromise(_0x63f9('0x6d'),_0x63f9('0x6e'),_0x547590);}return null;})['then'](function(_0x32cc10){var _0x21a516=_0x63f9('0x6f')+_0x32cc10[_0x63f9('0x2b')][_0x63f9('0x70')];return db[_0x63f9('0x71')]['query'](_0x21a516,{'type':db[_0x63f9('0x72')][_0x63f9('0x73')]['SELECT'],'raw':!![]})[_0x63f9('0x23')](function(_0x502d7f){return _0x502d7f;});})[_0x63f9('0x23')](function(_0x3908bf){if(_0x3908bf){_0x547590[_0x63f9('0x2b')][_0x63f9('0x74')]=_0x3908bf[0x0];if(!_0x40f42c[_0x63f9('0x59')][_0x63f9('0x62')])return;return db[_0x63f9('0x75')][_0x63f9('0x5a')]({'where':{'id':_0x40f42c[_0x63f9('0x59')]['UserId'],'role':_0x63f9('0x63')},'attributes':['id',_0x63f9('0x3c'),'fullname',_0x63f9('0x76'),_0x63f9('0x77')],'raw':!![]});}return null;})[_0x63f9('0x23')](function(_0x134063){if(!_0x134063)return null;_0x547590['message'][_0x63f9('0x63')]=_0x134063;return _0x547590;})[_0x63f9('0x23')](function(_0x5ea558){if(_0x5ea558){if(_0x40f42c[_0x63f9('0x59')][_0x63f9('0x78')]){_0x547590[_0x63f9('0x2b')][_0x63f9('0x79')]=util[_0x63f9('0x60')](_0x63f9('0x7a'),_0x40f42c[_0x63f9('0x7b')]['name']);_0x547590[_0x63f9('0x2b')][_0x63f9('0x7c')]=_0x547590[_0x63f9('0x7c')];_0x547590['message'][_0x63f9('0x7d')]=_0x547590['channel'];_0x547590[_0x63f9('0x2b')][_0x63f9('0x7e')]=_0x63f9('0x7f');return respondWithRpcPromise(_0x63f9('0x80'),_0x63f9('0x80'),{'event':_0x63f9('0x81'),'message':_0x547590[_0x63f9('0x2b')]},client9002)[_0x63f9('0x23')](function(){return _0x547590;});}return _0x547590;}return null;})[_0x63f9('0x23')](respondWithResult(_0x3726d0,null))[_0x63f9('0x2d')](handleError(_0x3726d0,null));};var interaction_log=require(_0x63f9('0x17'))(_0x63f9('0x5c'));exports[_0x63f9('0x38')]=function(_0x2274af,_0x1fc23c,_0x25c0c8){var _0x307881={'agent':{},'channel':_0x63f9('0x5d')};if(_0x2274af[_0x63f9('0x59')]['id']){delete _0x2274af[_0x63f9('0x59')]['id'];}_0x2274af[_0x63f9('0x59')]['UserId']=_0x2274af['body'][_0x63f9('0x62')]||_0x2274af['user']['id'];_0x307881['agent']['id']=_0x2274af[_0x63f9('0x59')][_0x63f9('0x62')];return db[_0x63f9('0x3f')][_0x63f9('0x5a')]({'where':{'id':_0x2274af['params']['id'],'UserId':null}})[_0x63f9('0x23')](handleEntityNotFound(_0x1fc23c,null))[_0x63f9('0x23')](function(_0x3f9efe){if(_0x3f9efe){_0x307881[_0x63f9('0x2b')]=_0x3f9efe[_0x63f9('0x64')]({'plain':!![]});return db[_0x63f9('0x65')][_0x63f9('0x5a')]({'where':{'id':_0x3f9efe[_0x63f9('0x66')]}});}return null;})[_0x63f9('0x23')](handleEntityNotFound(_0x1fc23c,null))[_0x63f9('0x23')](function(_0x47833f){if(_0x47833f){_0x307881[_0x63f9('0x6a')]=_0x47833f['get']({'plain':!![]});interaction_log[_0x63f9('0x24')](_0x63f9('0x82'),_0x2274af[_0x63f9('0x7b')]['id'],_0x2274af[_0x63f9('0x7b')][_0x63f9('0x3c')],_0x2274af[_0x63f9('0x7b')][_0x63f9('0x69')],_0x307881[_0x63f9('0x6a')]['id'],_0x2274af[_0x63f9('0x59')]?JSON[_0x63f9('0x6b')](_0x2274af[_0x63f9('0x59')]):_0x63f9('0x6c'));return respondWithRpcPromise(_0x63f9('0x83'),_0x63f9('0x84'),_0x307881);}return null;})[_0x63f9('0x23')](function(_0x2370b5){var _0x36b851=_0x63f9('0x6f')+_0x2370b5[_0x63f9('0x2b')][_0x63f9('0x70')];return db[_0x63f9('0x71')][_0x63f9('0x45')](_0x36b851,{'type':db[_0x63f9('0x72')][_0x63f9('0x73')][_0x63f9('0x85')],'raw':!![]})[_0x63f9('0x23')](function(_0x40c95f){return _0x40c95f;});})[_0x63f9('0x23')](function(_0x24f445){if(_0x24f445){_0x307881[_0x63f9('0x2b')][_0x63f9('0x74')]=_0x24f445[0x0];if(!_0x2274af['body']['UserId'])return;return db['User'][_0x63f9('0x5a')]({'where':{'id':_0x2274af[_0x63f9('0x59')][_0x63f9('0x62')],'role':'agent'},'attributes':['id',_0x63f9('0x3c'),_0x63f9('0x86'),'email',_0x63f9('0x77')],'raw':!![]});}return null;})[_0x63f9('0x23')](function(_0x1a3e1b){if(!_0x1a3e1b)return null;_0x307881[_0x63f9('0x2b')]['agent']=_0x1a3e1b;return _0x307881;})[_0x63f9('0x23')](function(_0x32ab06){if(_0x32ab06){_0x32ab06[_0x63f9('0x2b')]['interface']=util['format'](_0x63f9('0x7a'),_0x2274af[_0x63f9('0x7b')]['name']);_0x32ab06[_0x63f9('0x2b')]['channel']=_0x307881[_0x63f9('0x7c')];_0x32ab06[_0x63f9('0x2b')][_0x63f9('0x7d')]=_0x307881[_0x63f9('0x7c')];_0x32ab06[_0x63f9('0x2b')]['event']=_0x63f9('0x38');respondWithRpcPromise(_0x63f9('0x80'),_0x63f9('0x80'),{'event':'rejectmessage','message':_0x32ab06[_0x63f9('0x2b')]},client9002);return _0x307881;}return null;})['then'](respondWithResult(_0x1fc23c,null))['catch'](handleError(_0x1fc23c,null));};exports[_0x63f9('0x2f')]=function(_0x3633dd,_0x42faf5,_0x587c31){if(_0x3633dd['body']['id']){delete _0x3633dd[_0x63f9('0x59')]['id'];}var _0x5d068c;return db[_0x63f9('0x3f')][_0x63f9('0x5a')]({'where':{'id':_0x3633dd[_0x63f9('0x56')]['id']}})['then'](handleEntityNotFound(_0x42faf5,null))['then'](function(_0x5aacad){if(_0x5aacad){_0x5d068c=_0x5aacad;return db[_0x63f9('0x87')][_0x63f9('0x5a')]({'where':{'id':_0x5aacad['SmsAccountId']}});}})[_0x63f9('0x23')](handleEntityNotFound(_0x42faf5,null))[_0x63f9('0x23')](function(_0x4acfff){if(_0x4acfff){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0x4acfff[_0x63f9('0x42')],util[_0x63f9('0x88')](_0x3633dd[_0x63f9('0x59')],{'showHidden':![],'depth':null}));switch(_0x4acfff[_0x63f9('0x42')]){case _0x63f9('0x89'):if(_0x3633dd['body'][_0x63f9('0x8a')]&&_0x3633dd['body'][_0x63f9('0x8a')]===_0x5d068c['messageId']){return _0x5d068c['update']({'read':!![]});}else{logger[_0x63f9('0x29')](_0x63f9('0x8b'),'status',_0x63f9('0x89'),util[_0x63f9('0x88')](_0x3633dd[_0x63f9('0x59')],{'showHidden':![],'depth':null}));}break;case _0x63f9('0x8c'):if(_0x3633dd[_0x63f9('0x59')][_0x63f9('0x8d')]&&_0x3633dd[_0x63f9('0x59')][_0x63f9('0x8d')]===_0x5d068c[_0x63f9('0x8e')]&&_[_0x63f9('0x8f')](['sent',_0x63f9('0x90')],_0x3633dd['body'][_0x63f9('0x91')])>=0x0){return _0x5d068c['update']({'read':!![]});}else{logger[_0x63f9('0x29')](_0x63f9('0x8b'),'status',_0x63f9('0x92'),util['inspect'](_0x3633dd[_0x63f9('0x59')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x218810=_0x3633dd['body'][_0x63f9('0x93')][0x0];if(_0x218810['status'][_0x63f9('0x94')]===_0x63f9('0x95')){return _0x5d068c[_0x63f9('0x39')]({'read':!![]});}else{logger[_0x63f9('0x29')](_0x63f9('0x8b'),'status',_0x63f9('0x96'),util[_0x63f9('0x88')](_0x3633dd[_0x63f9('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x5d068c;}})[_0x63f9('0x23')](respondWithResult(_0x42faf5,null))[_0x63f9('0x2d')](handleError(_0x42faf5,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 5936b34..e6638a2 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 _0x9070=['setMaxListeners','save','remove','emit','hook','../../mysqldb'];(function(_0x264435,_0x25851d){var _0xa1d681=function(_0x1029bd){while(--_0x1029bd){_0x264435['push'](_0x264435['shift']());}};_0xa1d681(++_0x25851d);}(_0x9070,0xe9));var _0x0907=function(_0x51674a,_0x77ccff){_0x51674a=_0x51674a-0x0;var _0x13fca6=_0x9070[_0x51674a];return _0x13fca6;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x0907('0x0'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x0907('0x1')](0x0);var events={'afterCreate':_0x0907('0x2'),'afterUpdate':'update','afterDestroy':_0x0907('0x3')};function emitEvent(_0x1e921c){return function(_0x45a4e8,_0x13e020,_0x3d05fd){SmsMessageEvents[_0x0907('0x4')](_0x1e921c+':'+_0x45a4e8['id'],_0x45a4e8);SmsMessageEvents[_0x0907('0x4')](_0x1e921c,_0x45a4e8);_0x3d05fd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x0907('0x5')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0x3279=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','save'];(function(_0x49e8f0,_0x36781a){var _0x525645=function(_0x36f692){while(--_0x36f692){_0x49e8f0['push'](_0x49e8f0['shift']());}};_0x525645(++_0x36781a);}(_0x3279,0x1ad));var _0x9327=function(_0x2749e7,_0x365290){_0x2749e7=_0x2749e7-0x0;var _0x26f699=_0x3279[_0x2749e7];return _0x26f699;};'use strict';var EventEmitter=require(_0x9327('0x0'));var SmsMessage=require(_0x9327('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9327('0x2'),'afterUpdate':_0x9327('0x3'),'afterDestroy':_0x9327('0x4')};function emitEvent(_0x4d6a41){return function(_0x32d504,_0x40e66b,_0x33395a){SmsMessageEvents['emit'](_0x4d6a41+':'+_0x32d504['id'],_0x32d504);SmsMessageEvents[_0x9327('0x5')](_0x4d6a41,_0x32d504);_0x33395a(null);};}for(var e in events){if(events[_0x9327('0x6')](e)){var event=events[e];SmsMessage[_0x9327('0x7')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 7c4da4c..5a3bc91 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 _0xcd24=['update','createdAt','error','SmsAccount','SmsAccountId','type','twilio','accountSid','phone','authToken','messages','create','body','/api/sms/messages/','/status?token=','token','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','login?username=','username','&password=','GET','sms','user_key','session_key','total_sent','internal_order_id','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','read','connectel','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','remote','authId','POST','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','infobip','baseUrl','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','apiKey','timestamp','keys','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','csc','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','fti_sms_messages','models','get','direction','toLowerCase','out','secret','SmsInteractionId','SmsInteraction','findOne','then'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcd24,0xdd));var _0x4cd2=function(_0x8d956c,_0x4ec00e){_0x8d956c=_0x8d956c-0x0;var _0x425c39=_0xcd24[_0x8d956c];return _0x425c39;};'use strict';var _=require(_0x4cd2('0x0'));var util=require('util');var logger=require(_0x4cd2('0x1'))(_0x4cd2('0x2'));var moment=require('moment');var BPromise=require(_0x4cd2('0x3'));var rp=require(_0x4cd2('0x4'));var fs=require('fs');var path=require(_0x4cd2('0x5'));var rimraf=require('rimraf');var config=require(_0x4cd2('0x6'));var attributes=require(_0x4cd2('0x7'));module['exports']=function(_0x2fe5c1,_0x51716e){return _0x2fe5c1[_0x4cd2('0x8')](_0x4cd2('0x9'),attributes,{'tableName':_0x4cd2('0xa'),'paranoid':![],'indexes':[{'name':_0x4cd2('0xb'),'fields':[_0x4cd2('0xb')]},{'name':_0x4cd2('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x123ab2,_0x5478e1,_0x4c8dc4){var _0x36af53=_0x2fe5c1[_0x4cd2('0xd')];var _0x591f66=_0x123ab2[_0x4cd2('0xe')]({'plain':!![]});if(_0x591f66[_0x4cd2('0xf')][_0x4cd2('0x10')]()==='in'||_0x591f66['direction'][_0x4cd2('0x10')]()===_0x4cd2('0x11')&&!_0x591f66[_0x4cd2('0x12')]&&!_['isNil'](_0x591f66['UserId'])&&!_['isNil'](_0x591f66[_0x4cd2('0x13')])){_0x36af53[_0x4cd2('0x14')][_0x4cd2('0x15')]({'where':{'id':_0x591f66[_0x4cd2('0x13')]}})[_0x4cd2('0x16')](function(_0x4ab062){if(_0x4ab062){_0x4ab062[_0x4cd2('0x17')]({'lastMsgAt':_0x591f66[_0x4cd2('0x18')],'lastMsgDirection':_0x591f66[_0x4cd2('0xf')][_0x4cd2('0x10')]()});}})['catch'](function(_0x34e9f2){console[_0x4cd2('0x19')](_0x34e9f2);});}if(_0x591f66[_0x4cd2('0xf')]===_0x4cd2('0x11')&&!_0x591f66[_0x4cd2('0x12')]){var _0x27bf20;_0x36af53[_0x4cd2('0x1a')]['find']({'where':{'id':_0x591f66[_0x4cd2('0x1b')]},'raw':!![]})[_0x4cd2('0x16')](function(_0x9411e5){_0x27bf20=_0x9411e5;if(_0x27bf20&&_0x27bf20[_0x4cd2('0x1c')]){switch(_0x27bf20[_0x4cd2('0x1c')]){case _0x4cd2('0x1d'):var _0x36a49b=require(_0x4cd2('0x1d'));if(_0x27bf20[_0x4cd2('0x1e')]&&_0x27bf20['authToken']&&_0x27bf20[_0x4cd2('0x1f')]){var _0x3f6831=new _0x36a49b(_0x27bf20[_0x4cd2('0x1e')],_0x27bf20[_0x4cd2('0x20')]);_0x3f6831[_0x4cd2('0x21')][_0x4cd2('0x22')]({'body':_0x591f66[_0x4cd2('0x23')],'to':_0x591f66[_0x4cd2('0x1f')],'from':_0x27bf20[_0x4cd2('0x1f')],'statusCallback':_0x27bf20['remote']+_0x4cd2('0x24')+_0x591f66['id']+_0x4cd2('0x25')+_0x27bf20[_0x4cd2('0x26')]})[_0x4cd2('0x16')](function(_0x2cb5cd){if(_0x2cb5cd['sid']){return _0x123ab2['update']({'messageId':_0x2cb5cd[_0x4cd2('0x27')]});}})[_0x4cd2('0x28')](function(_0x37622e){logger[_0x4cd2('0x19')](_0x4cd2('0x29'),_0x4cd2('0x2a'),_0x4cd2('0x1d'),util[_0x4cd2('0x2b')](_0x37622e,{'showHidden':![],'depth':null}));});}else{logger[_0x4cd2('0x19')](_0x4cd2('0x29'),'afterCreate',_0x4cd2('0x1d'),_0x4cd2('0x2c'));}break;case _0x4cd2('0x2d'):var _0x331506=_0x4cd2('0x2e');if(_0x27bf20['username']&&_0x27bf20[_0x4cd2('0x2f')]){var _0x31cb89={'recipient':[_0x591f66['phone']],'message':_0x591f66['body'],'message_type':_0x27bf20['smsMethod']};if(_0x27bf20[_0x4cd2('0x30')]&&_0x27bf20[_0x4cd2('0x30')]!=='SI'){_0x31cb89[_0x4cd2('0x31')]=_0x27bf20[_0x4cd2('0x1f')];}var _0xb185a9={'url':_0x331506+_0x4cd2('0x32')+_0x27bf20[_0x4cd2('0x33')]+_0x4cd2('0x34')+_0x27bf20[_0x4cd2('0x2f')],'method':_0x4cd2('0x35')};rp(_0xb185a9)[_0x4cd2('0x16')](function(_0x55b2bd){var _0xc8879d=_0x55b2bd['split'](';');var _0x306e24={'user_key':_0xc8879d[0x0],'session_key':_0xc8879d[0x1]};_0xb185a9={'url':_0x331506+_0x4cd2('0x36'),'method':'POST','headers':{'user_key':_0x306e24[_0x4cd2('0x37')],'Session_key':_0x306e24[_0x4cd2('0x38')]},'json':!![],'body':_0x31cb89};return rp(_0xb185a9);})['then'](function(_0x3ed977){if(_0x3ed977[_0x4cd2('0x39')]>=0x1){var _0xf224e5={'messageId':_0x3ed977[_0x4cd2('0x3a')]};if(_0x27bf20['smsMethod']!=='GP'||!_0x27bf20['deliveryReport']){_0xf224e5['read']=!![];}return _0x123ab2['update'](_0xf224e5);}else{return logger[_0x4cd2('0x19')](_0x4cd2('0x29'),_0x4cd2('0x2a'),_0x4cd2('0x2d'),util[_0x4cd2('0x2b')](_0x3ed977,{'showHidden':![],'depth':null}));}})[_0x4cd2('0x28')](function(_0x387a64){return logger[_0x4cd2('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4cd2('0x2d'),util[_0x4cd2('0x2b')](_0x387a64,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4cd2('0x2a'),_0x4cd2('0x2d'),_0x4cd2('0x3b'));}break;case'connectel':if(_0x27bf20[_0x4cd2('0x20')]){var _0x1299ef={'recipient':_0x591f66[_0x4cd2('0x1f')],'message':_0x591f66[_0x4cd2('0x23')],'sender':_0x27bf20[_0x4cd2('0x3c')]||_0x27bf20[_0x4cd2('0x1f')],'authorization':_0x27bf20[_0x4cd2('0x20')]};var _0x5478e1={'method':'POST','uri':_0x4cd2('0x3d'),'body':_0x1299ef,'json':!![]};rp(_0x5478e1)[_0x4cd2('0x16')](function(_0x52ce2b){var _0x164914={'messageId':_0x52ce2b[_0x4cd2('0x3e')]};if(!_0x27bf20[_0x4cd2('0x3f')]){_0x164914[_0x4cd2('0x40')]=!![];}return _0x123ab2['update'](_0x164914);})[_0x4cd2('0x28')](function(_0x57285d){logger[_0x4cd2('0x19')](_0x4cd2('0x29'),_0x4cd2('0x2a'),_0x4cd2('0x41'),util['inspect'](_0x57285d,{'showHidden':![],'depth':null}));});}else{logger[_0x4cd2('0x19')](_0x4cd2('0x29'),_0x4cd2('0x2a'),'connectel','Missing\x20parameters:\x20authToken');}break;case _0x4cd2('0x42'):if(_0x27bf20[_0x4cd2('0x33')]&&_0x27bf20['password']){var _0x1299ef={'messages':[{'source':_0x4cd2('0x43'),'to':_0x591f66[_0x4cd2('0x1f')],'body':_0x591f66['body'],'from':_0x27bf20['senderString']||_0x27bf20['phone']}]};var _0xebb8df=util[_0x4cd2('0x44')](_0x4cd2('0x45'),_0x27bf20[_0x4cd2('0x33')],_0x27bf20['password']);var _0x5478e1={'method':'POST','uri':_0x4cd2('0x46'),'body':_0x1299ef,'headers':{'Authorization':util[_0x4cd2('0x44')](_0x4cd2('0x47'),new Buffer(_0xebb8df)[_0x4cd2('0x48')](_0x4cd2('0x49')))},'json':!![]};rp(_0x5478e1)[_0x4cd2('0x16')](function(_0x2f3eed){if(_0x2f3eed['http_code']>=0xc8&&_0x2f3eed[_0x4cd2('0x4a')]<=0xce){if(_0x2f3eed[_0x4cd2('0x4b')]&&_0x2f3eed[_0x4cd2('0x4b')][_0x4cd2('0x4c')]>0x0){var _0x155a38=_[_0x4cd2('0x4d')](_0x2f3eed[_0x4cd2('0x4b')][_0x4cd2('0x21')]);var _0x298342={'messageId':_0x155a38[_0x4cd2('0x4e')]};if(!_0x27bf20[_0x4cd2('0x3f')]){_0x298342[_0x4cd2('0x40')]=!![];}return _0x123ab2[_0x4cd2('0x17')](_0x298342);}else{logger[_0x4cd2('0x19')](_0x4cd2('0x29'),_0x4cd2('0x2a'),_0x4cd2('0x4f'),util['inspect'](_0x2f3eed,{'showHidden':![],'depth':null}));}}else{logger[_0x4cd2('0x19')](_0x4cd2('0x29'),_0x4cd2('0x2a'),_0x4cd2('0x4f'),util[_0x4cd2('0x2b')](_0x2f3eed,{'showHidden':![],'depth':null}));}})[_0x4cd2('0x28')](function(_0x2a238b){logger[_0x4cd2('0x19')](_0x4cd2('0x29'),_0x4cd2('0x2a'),_0x4cd2('0x4f'),util[_0x4cd2('0x2b')](_0x2a238b,{'showHidden':![],'depth':null}));});}else{logger[_0x4cd2('0x19')](_0x4cd2('0x29'),'afterCreate','clickSend',_0x4cd2('0x3b'));}break;case _0x4cd2('0x50'):if(_0x27bf20['authId']&&_0x27bf20[_0x4cd2('0x20')]){var _0x1299ef={'dst':_0x591f66[_0x4cd2('0x1f')],'text':_0x591f66[_0x4cd2('0x23')],'src':_0x27bf20[_0x4cd2('0x3c')]||_0x27bf20[_0x4cd2('0x1f')],'url':_0x27bf20[_0x4cd2('0x51')]+_0x4cd2('0x24')+_0x591f66['id']+_0x4cd2('0x25')+_0x27bf20[_0x4cd2('0x26')]};var _0xebb8df=util[_0x4cd2('0x44')](_0x4cd2('0x45'),_0x27bf20[_0x4cd2('0x52')],_0x27bf20['authToken']);var _0x5478e1={'method':_0x4cd2('0x53'),'uri':util['format'](_0x4cd2('0x54'),_0x27bf20['authId']),'body':_0x1299ef,'headers':{'Authorization':util[_0x4cd2('0x44')](_0x4cd2('0x47'),new Buffer(_0xebb8df)[_0x4cd2('0x48')](_0x4cd2('0x49')))},'json':!![]};rp(_0x5478e1)[_0x4cd2('0x16')](function(_0x2de869){var _0x364d9f={'messageId':_0x2de869[_0x4cd2('0x55')][0x0]};return _0x123ab2[_0x4cd2('0x17')](_0x364d9f);})[_0x4cd2('0x28')](function(_0x285639){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4cd2('0x2a'),_0x4cd2('0x50'),util[_0x4cd2('0x2b')](_0x285639,{'showHidden':![],'depth':null}));});}else{logger[_0x4cd2('0x19')](_0x4cd2('0x29'),'afterCreate','plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x4cd2('0x56'):if(_0x27bf20['username']&&_0x27bf20[_0x4cd2('0x2f')]){if(_0x27bf20[_0x4cd2('0x57')]){var _0x28dfcb={'method':_0x4cd2('0x53'),'uri':_0x27bf20[_0x4cd2('0x57')]+'/auth/1/session','body':{'username':_0x27bf20[_0x4cd2('0x33')],'password':_0x27bf20[_0x4cd2('0x2f')]},'json':!![]};return rp(_0x28dfcb)[_0x4cd2('0x16')](function(_0x2d9860){var _0x14ddef={'method':'POST','uri':_0x27bf20[_0x4cd2('0x57')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x27bf20['phone'],'destinations':[{'to':_0x591f66[_0x4cd2('0x1f')]}],'text':_0x591f66[_0x4cd2('0x23')],'notifyUrl':_0x27bf20[_0x4cd2('0x51')]+_0x4cd2('0x24')+_0x591f66['id']+_0x4cd2('0x25')+_0x27bf20[_0x4cd2('0x26')],'notifyContentType':_0x4cd2('0x58'),'callbackData':_0x27bf20[_0x4cd2('0x1f')]+';'+_0x591f66['body']}]},'headers':{'Authorization':_0x4cd2('0x59')+_0x2d9860[_0x4cd2('0x26')]},'json':!![]};return rp(_0x14ddef)['then'](function(_0x198d16){if(_0x198d16['messages']){var _0x2a859f={'messageId':_0x198d16[_0x4cd2('0x21')][0x0][_0x4cd2('0xb')]};if(!_0x27bf20['deliveryReport']){_0x2a859f[_0x4cd2('0x40')]=!![];}return _0x123ab2[_0x4cd2('0x17')](_0x2a859f);}else{return logger['error'](_0x4cd2('0x29'),_0x4cd2('0x2a'),_0x4cd2('0x56'),util[_0x4cd2('0x2b')](_0x198d16,{'showHidden':![],'depth':null}));}});})[_0x4cd2('0x28')](function(_0x1c9eb5){return logger[_0x4cd2('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4cd2('0x2a'),_0x4cd2('0x56'),util[_0x4cd2('0x2b')](_0x1c9eb5,{'showHidden':![],'depth':null}));});}else{logger[_0x4cd2('0x19')](_0x4cd2('0x29'),'afterCreate',_0x4cd2('0x56'),_0x4cd2('0x5a'));}}else{logger[_0x4cd2('0x19')](_0x4cd2('0x29'),_0x4cd2('0x2a'),_0x4cd2('0x56'),_0x4cd2('0x3b'));}break;case'csc':var _0x169893=require(_0x4cd2('0x5b'));if(_0x27bf20[_0x4cd2('0x5c')]){var _0x396408={};_0x396408['login']=_0x27bf20[_0x4cd2('0x33')];_0x396408[_0x4cd2('0x1f')]=_0x591f66['phone'];_0x396408[_0x4cd2('0x31')]=_0x27bf20[_0x4cd2('0x1f')];_0x396408['text']=_0x591f66[_0x4cd2('0x23')];_0x396408[_0x4cd2('0x5d')]=+new Date();var _0x111de9='';var _0x301f0c='';var _0x2e3415=Object[_0x4cd2('0x5e')](_0x396408);_0x2e3415[_0x4cd2('0x5f')]();for(var _0x3de4fb=0x0;_0x3de4fb<_0x2e3415[_0x4cd2('0x60')];_0x3de4fb++){if(_0x111de9!=''){_0x111de9+='&';}_0x111de9+=_0x2e3415[_0x3de4fb]+'='+encodeURIComponent(_0x396408[_0x2e3415[_0x3de4fb]]);_0x301f0c+=_0x396408[_0x2e3415[_0x3de4fb]];}_0x301f0c+=_0x27bf20['apiKey'];_0x301f0c=_0x169893[_0x4cd2('0x61')](_0x4cd2('0x62'))[_0x4cd2('0x17')](_0x301f0c)[_0x4cd2('0x63')](_0x4cd2('0x64'));if(_0x111de9!==''){_0x111de9+='&';}_0x111de9+=_0x4cd2('0x65')+_0x301f0c;var _0xb185a9={'method':_0x4cd2('0x35'),'uri':_0x27bf20[_0x4cd2('0x57')]+_0x4cd2('0x66')+_0x111de9,'json':!![]};return rp(_0xb185a9)[_0x4cd2('0x16')](function(_0x486b77){var _0x1ec509=Object[_0x4cd2('0x5e')](_0x486b77);if(_0x486b77[_0x1ec509[0x0]][_0x4cd2('0x19')]&&parseInt(_0x486b77[_0x1ec509[0x0]][_0x4cd2('0x19')])===0x0){var _0x4bfff8={'messageId':_0x486b77[_0x1ec509[0x0]]['id_sms']};if(!_0x27bf20[_0x4cd2('0x3f')]){_0x4bfff8[_0x4cd2('0x40')]=!![];}return _0x123ab2[_0x4cd2('0x17')](_0x4bfff8);}else{return logger[_0x4cd2('0x19')](_0x4cd2('0x29'),_0x4cd2('0x2a'),_0x4cd2('0x67'),util[_0x4cd2('0x2b')](_0x486b77[_0x4cd2('0x19')],{'showHidden':![],'depth':null}));}})[_0x4cd2('0x28')](function(_0x1a7ffe){return logger[_0x4cd2('0x19')](_0x4cd2('0x29'),_0x4cd2('0x2a'),_0x4cd2('0x67'),util['inspect'](_0x1a7ffe,{'showHidden':![],'depth':null}));});}else{logger[_0x4cd2('0x19')](_0x4cd2('0x29'),_0x4cd2('0x2a'),_0x4cd2('0x67'),_0x4cd2('0x68'));}break;case'clickatell':if(_0x27bf20[_0x4cd2('0x5c')]){var _0x4ce287={'method':'POST','uri':_0x4cd2('0x69'),'headers':{'Authorization':_0x27bf20[_0x4cd2('0x5c')]},'body':{'content':_0x591f66[_0x4cd2('0x23')],'to':[_0x591f66[_0x4cd2('0x1f')]],'from':_0x27bf20['phone'],'binary':![],'clientMessageId':'uuid','charset':_0x4cd2('0x6a')},'json':!![]};rp(_0x4ce287)[_0x4cd2('0x16')](function(_0x3ddc1b){if(!_0x3ddc1b['error']){var _0x28a468={'messageId':_0x3ddc1b[_0x4cd2('0x21')][0x0][_0x4cd2('0x6b')]};if(!_0x27bf20[_0x4cd2('0x3f')]){_0x28a468[_0x4cd2('0x40')]=!![];}return _0x123ab2[_0x4cd2('0x17')](_0x28a468);}else{return logger['error'](_0x4cd2('0x29'),_0x4cd2('0x2a'),'clickatell',util[_0x4cd2('0x2b')](_0x3ddc1b[_0x4cd2('0x19')],{'showHidden':![],'depth':null}));}})[_0x4cd2('0x28')](function(_0x1cded2){return logger[_0x4cd2('0x19')](_0x4cd2('0x29'),_0x4cd2('0x2a'),'clickatell',util['inspect'](_0x1cded2,{'showHidden':![],'depth':null}));});}else{logger[_0x4cd2('0x19')](_0x4cd2('0x29'),_0x4cd2('0x2a'),'clickatell',_0x4cd2('0x68'));}break;case _0x4cd2('0x6c'):if(_0x27bf20[_0x4cd2('0x33')]&&_0x27bf20[_0x4cd2('0x2f')]){var _0xebb8df=util[_0x4cd2('0x44')](_0x4cd2('0x45'),_0x27bf20['username'],_0x27bf20[_0x4cd2('0x2f')]);var _0x5478e1={'method':'POST','uri':_0x4cd2('0x6d')+_0x27bf20[_0x4cd2('0x6e')]+_0x4cd2('0x6f'),'body':{'to':[_0x591f66[_0x4cd2('0x1f')]],'text':_0x591f66[_0x4cd2('0x23')],'from':_0x27bf20[_0x4cd2('0x1f')],'applicationId':_0x27bf20[_0x4cd2('0x70')]},'headers':{'Authorization':util[_0x4cd2('0x44')](_0x4cd2('0x47'),new Buffer(_0xebb8df)[_0x4cd2('0x48')]('base64'))},'json':!![]};rp(_0x5478e1)[_0x4cd2('0x16')](function(_0x39d981){if(_0x39d981['id']){var _0x2cc170={'messageId':_0x39d981['id']};return _0x123ab2['update'](_0x2cc170);}else{logger[_0x4cd2('0x19')](_0x4cd2('0x29'),'afterCreate',_0x4cd2('0x6c'),util[_0x4cd2('0x2b')](_0x39d981,{'showHidden':![],'depth':null}));}})[_0x4cd2('0x28')](function(_0x456a8d){logger[_0x4cd2('0x19')](_0x4cd2('0x29'),'afterCreate',_0x4cd2('0x6c'),util[_0x4cd2('0x2b')](_0x456a8d,{'showHidden':![],'depth':null}));});}else{logger[_0x4cd2('0x19')](_0x4cd2('0x29'),_0x4cd2('0x2a'),_0x4cd2('0x6c'),_0x4cd2('0x3b'));}break;case _0x4cd2('0x71'):if(_0x27bf20['apiKey']){var _0x4ac479={};var _0xb185a9={'method':_0x4cd2('0x53'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':'Bearer\x20'+_0x27bf20['apiKey'],'Content-Type':_0x4cd2('0x58')},'body':{'from':_0x27bf20[_0x4cd2('0x1f')],'to':_0x591f66[_0x4cd2('0x1f')],'text':_0x591f66[_0x4cd2('0x23')]},'json':!![]};return rp(_0xb185a9)['then'](function(_0x5828f8){if(_0x5828f8['code']==0xca){_0x4ac479[_0x4cd2('0x72')]=_0x5828f8;var _0x4d0343={'method':'POST','uri':_0x4cd2('0x73'),'headers':{'Authorization':_0x4cd2('0x74')+_0x27bf20['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0x4ac479[_0x4cd2('0x72')][_0x4cd2('0x75')]},'json':!![]};return rp(_0x4d0343)[_0x4cd2('0x16')](function(_0x420a09){_0x4ac479['status']=_0x420a09;var _0x42fa7b={'messageId':_0x4ac479['message'][_0x4cd2('0x75')],'read':!![]};return _0x123ab2[_0x4cd2('0x17')](_0x42fa7b);});}else{return logger[_0x4cd2('0x19')](_0x4cd2('0x29'),_0x4cd2('0x2a'),_0x4cd2('0x71'),util[_0x4cd2('0x2b')](_0x5828f8,{'showHidden':![],'depth':null}));}})['catch'](function(_0x52cbab){return logger[_0x4cd2('0x19')](_0x4cd2('0x29'),'afterCreate',_0x4cd2('0x71'),util[_0x4cd2('0x2b')](_0x52cbab,{'showHidden':![],'depth':null}));});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4cd2('0x2a'),_0x4cd2('0x71'),_0x4cd2('0x76'));}break;}}})[_0x4cd2('0x77')](function(){_0x4c8dc4();});}else{_0x4c8dc4();}}},'charset':_0x4cd2('0x78'),'collate':_0x4cd2('0x79')});}; \ No newline at end of file +var _0x8d7c=['clicksend','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','http_code','data','queued_count','head','message_id','deliveryReport','clickSend','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','plivo','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','apiKey','login','text','timestamp','keys','length','createHash','md5','digest','hex','signature=','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','UTF-8','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','base64','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','isNil','UserId','SmsInteractionId','findOne','then','update','createdAt','catch','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','username','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','requestid','Missing\x20parameters:\x20authToken'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x8d7c,0x134));var _0xc8d7=function(_0x4504cb,_0x44dc67){_0x4504cb=_0x4504cb-0x0;var _0x26801b=_0x8d7c[_0x4504cb];return _0x26801b;};'use strict';var _=require(_0xc8d7('0x0'));var util=require(_0xc8d7('0x1'));var logger=require(_0xc8d7('0x2'))(_0xc8d7('0x3'));var moment=require(_0xc8d7('0x4'));var BPromise=require(_0xc8d7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc8d7('0x6'));var rimraf=require(_0xc8d7('0x7'));var config=require('../../config/environment');var attributes=require(_0xc8d7('0x8'));module['exports']=function(_0x12ff2d,_0x4618d0){return _0x12ff2d[_0xc8d7('0x9')](_0xc8d7('0xa'),attributes,{'tableName':_0xc8d7('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xc8d7('0xc')]},{'name':_0xc8d7('0xd'),'fields':[_0xc8d7('0xe')],'type':_0xc8d7('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4a5a3a,_0x174fc8,_0x28fe12){var _0x327a4d=_0x12ff2d[_0xc8d7('0x10')];var _0x275e6b=_0x4a5a3a[_0xc8d7('0x11')]({'plain':!![]});if(_0x275e6b['direction'][_0xc8d7('0x12')]()==='in'||_0x275e6b[_0xc8d7('0x13')][_0xc8d7('0x12')]()===_0xc8d7('0x14')&&!_0x275e6b['secret']&&!_[_0xc8d7('0x15')](_0x275e6b[_0xc8d7('0x16')])&&!_[_0xc8d7('0x15')](_0x275e6b[_0xc8d7('0x17')])){_0x327a4d['SmsInteraction'][_0xc8d7('0x18')]({'where':{'id':_0x275e6b[_0xc8d7('0x17')]}})[_0xc8d7('0x19')](function(_0x54f472){if(_0x54f472){_0x54f472[_0xc8d7('0x1a')]({'lastMsgAt':_0x275e6b[_0xc8d7('0x1b')],'lastMsgDirection':_0x275e6b[_0xc8d7('0x13')]['toLowerCase']()});}})[_0xc8d7('0x1c')](function(_0x3f9049){console['error'](_0x3f9049);});}if(_0x275e6b[_0xc8d7('0x13')]===_0xc8d7('0x14')&&!_0x275e6b['secret']){var _0x35ec0b;_0x327a4d[_0xc8d7('0x1d')][_0xc8d7('0x1e')]({'where':{'id':_0x275e6b[_0xc8d7('0x1f')]},'raw':!![]})[_0xc8d7('0x19')](function(_0x12138d){_0x35ec0b=_0x12138d;if(_0x35ec0b&&_0x35ec0b[_0xc8d7('0x20')]){switch(_0x35ec0b[_0xc8d7('0x20')]){case'twilio':var _0x18774c=require(_0xc8d7('0x21'));if(_0x35ec0b[_0xc8d7('0x22')]&&_0x35ec0b[_0xc8d7('0x23')]&&_0x35ec0b[_0xc8d7('0x24')]){var _0xc60505=new _0x18774c(_0x35ec0b['accountSid'],_0x35ec0b[_0xc8d7('0x23')]);_0xc60505[_0xc8d7('0x25')][_0xc8d7('0x26')]({'body':_0x275e6b[_0xc8d7('0xe')],'to':_0x275e6b[_0xc8d7('0x24')],'from':_0x35ec0b[_0xc8d7('0x24')],'statusCallback':_0x35ec0b[_0xc8d7('0x27')]+_0xc8d7('0x28')+_0x275e6b['id']+_0xc8d7('0x29')+_0x35ec0b[_0xc8d7('0x2a')]})['then'](function(_0x36d01c){if(_0x36d01c[_0xc8d7('0x2b')]){return _0x4a5a3a[_0xc8d7('0x1a')]({'messageId':_0x36d01c[_0xc8d7('0x2b')]});}})[_0xc8d7('0x1c')](function(_0x2213c0){logger[_0xc8d7('0x2c')](_0xc8d7('0x2d'),_0xc8d7('0x2e'),'twilio',util['inspect'](_0x2213c0,{'showHidden':![],'depth':null}));});}else{logger[_0xc8d7('0x2c')](_0xc8d7('0x2d'),'afterCreate',_0xc8d7('0x21'),_0xc8d7('0x2f'));}break;case _0xc8d7('0x30'):var _0xdfe7f0=_0xc8d7('0x31');if(_0x35ec0b['username']&&_0x35ec0b[_0xc8d7('0x32')]){var _0x256261={'recipient':[_0x275e6b[_0xc8d7('0x24')]],'message':_0x275e6b['body'],'message_type':_0x35ec0b[_0xc8d7('0x33')]};if(_0x35ec0b[_0xc8d7('0x33')]&&_0x35ec0b['smsMethod']!=='SI'){_0x256261[_0xc8d7('0x34')]=_0x35ec0b[_0xc8d7('0x24')];}var _0x543f73={'url':_0xdfe7f0+'login?username='+_0x35ec0b[_0xc8d7('0x35')]+_0xc8d7('0x36')+_0x35ec0b['password'],'method':_0xc8d7('0x37')};rp(_0x543f73)[_0xc8d7('0x19')](function(_0x2dc076){var _0x5d317a=_0x2dc076[_0xc8d7('0x38')](';');var _0x49c201={'user_key':_0x5d317a[0x0],'session_key':_0x5d317a[0x1]};_0x543f73={'url':_0xdfe7f0+_0xc8d7('0x39'),'method':_0xc8d7('0x3a'),'headers':{'user_key':_0x49c201[_0xc8d7('0x3b')],'Session_key':_0x49c201[_0xc8d7('0x3c')]},'json':!![],'body':_0x256261};return rp(_0x543f73);})[_0xc8d7('0x19')](function(_0x34054d){if(_0x34054d[_0xc8d7('0x3d')]>=0x1){var _0x7451c2={'messageId':_0x34054d[_0xc8d7('0x3e')]};if(_0x35ec0b[_0xc8d7('0x33')]!=='GP'||!_0x35ec0b['deliveryReport']){_0x7451c2[_0xc8d7('0x3f')]=!![];}return _0x4a5a3a[_0xc8d7('0x1a')](_0x7451c2);}else{return logger[_0xc8d7('0x2c')](_0xc8d7('0x2d'),_0xc8d7('0x2e'),_0xc8d7('0x30'),util[_0xc8d7('0x40')](_0x34054d,{'showHidden':![],'depth':null}));}})[_0xc8d7('0x1c')](function(_0x521ce1){return logger['error'](_0xc8d7('0x2d'),'afterCreate',_0xc8d7('0x30'),util[_0xc8d7('0x40')](_0x521ce1,{'showHidden':![],'depth':null}));});}else{logger[_0xc8d7('0x2c')](_0xc8d7('0x2d'),_0xc8d7('0x2e'),_0xc8d7('0x30'),_0xc8d7('0x41'));}break;case _0xc8d7('0x42'):if(_0x35ec0b['authToken']){var _0x32a5a6={'recipient':_0x275e6b['phone'],'message':_0x275e6b[_0xc8d7('0xe')],'sender':_0x35ec0b[_0xc8d7('0x43')]||_0x35ec0b[_0xc8d7('0x24')],'authorization':_0x35ec0b['authToken']};var _0x174fc8={'method':_0xc8d7('0x3a'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x32a5a6,'json':!![]};rp(_0x174fc8)[_0xc8d7('0x19')](function(_0x2aa080){var _0x435413={'messageId':_0x2aa080[_0xc8d7('0x44')]};if(!_0x35ec0b['deliveryReport']){_0x435413[_0xc8d7('0x3f')]=!![];}return _0x4a5a3a[_0xc8d7('0x1a')](_0x435413);})['catch'](function(_0x5d6c86){logger[_0xc8d7('0x2c')](_0xc8d7('0x2d'),_0xc8d7('0x2e'),_0xc8d7('0x42'),util[_0xc8d7('0x40')](_0x5d6c86,{'showHidden':![],'depth':null}));});}else{logger[_0xc8d7('0x2c')](_0xc8d7('0x2d'),'afterCreate',_0xc8d7('0x42'),_0xc8d7('0x45'));}break;case _0xc8d7('0x46'):if(_0x35ec0b[_0xc8d7('0x35')]&&_0x35ec0b[_0xc8d7('0x32')]){var _0x32a5a6={'messages':[{'source':_0xc8d7('0x47'),'to':_0x275e6b[_0xc8d7('0x24')],'body':_0x275e6b[_0xc8d7('0xe')],'from':_0x35ec0b[_0xc8d7('0x43')]||_0x35ec0b[_0xc8d7('0x24')]}]};var _0x163c53=util['format'](_0xc8d7('0x48'),_0x35ec0b[_0xc8d7('0x35')],_0x35ec0b[_0xc8d7('0x32')]);var _0x174fc8={'method':_0xc8d7('0x3a'),'uri':_0xc8d7('0x49'),'body':_0x32a5a6,'headers':{'Authorization':util[_0xc8d7('0x4a')](_0xc8d7('0x4b'),new Buffer(_0x163c53)[_0xc8d7('0x4c')]('base64'))},'json':!![]};rp(_0x174fc8)[_0xc8d7('0x19')](function(_0x22d1b1){if(_0x22d1b1[_0xc8d7('0x4d')]>=0xc8&&_0x22d1b1['http_code']<=0xce){if(_0x22d1b1[_0xc8d7('0x4e')]&&_0x22d1b1[_0xc8d7('0x4e')][_0xc8d7('0x4f')]>0x0){var _0x1432e8=_[_0xc8d7('0x50')](_0x22d1b1[_0xc8d7('0x4e')][_0xc8d7('0x25')]);var _0x2bafee={'messageId':_0x1432e8[_0xc8d7('0x51')]};if(!_0x35ec0b[_0xc8d7('0x52')]){_0x2bafee[_0xc8d7('0x3f')]=!![];}return _0x4a5a3a[_0xc8d7('0x1a')](_0x2bafee);}else{logger[_0xc8d7('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xc8d7('0x53'),util[_0xc8d7('0x40')](_0x22d1b1,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xc8d7('0x2d'),'afterCreate',_0xc8d7('0x53'),util[_0xc8d7('0x40')](_0x22d1b1,{'showHidden':![],'depth':null}));}})[_0xc8d7('0x1c')](function(_0x4652ea){logger[_0xc8d7('0x2c')](_0xc8d7('0x2d'),_0xc8d7('0x2e'),'clickSend',util[_0xc8d7('0x40')](_0x4652ea,{'showHidden':![],'depth':null}));});}else{logger[_0xc8d7('0x2c')](_0xc8d7('0x2d'),_0xc8d7('0x2e'),_0xc8d7('0x53'),_0xc8d7('0x41'));}break;case'plivo':if(_0x35ec0b[_0xc8d7('0x54')]&&_0x35ec0b[_0xc8d7('0x23')]){var _0x32a5a6={'dst':_0x275e6b[_0xc8d7('0x24')],'text':_0x275e6b[_0xc8d7('0xe')],'src':_0x35ec0b[_0xc8d7('0x43')]||_0x35ec0b[_0xc8d7('0x24')],'url':_0x35ec0b[_0xc8d7('0x27')]+'/api/sms/messages/'+_0x275e6b['id']+_0xc8d7('0x29')+_0x35ec0b[_0xc8d7('0x2a')]};var _0x163c53=util[_0xc8d7('0x4a')](_0xc8d7('0x48'),_0x35ec0b[_0xc8d7('0x54')],_0x35ec0b['authToken']);var _0x174fc8={'method':'POST','uri':util[_0xc8d7('0x4a')](_0xc8d7('0x55'),_0x35ec0b[_0xc8d7('0x54')]),'body':_0x32a5a6,'headers':{'Authorization':util['format'](_0xc8d7('0x4b'),new Buffer(_0x163c53)[_0xc8d7('0x4c')]('base64'))},'json':!![]};rp(_0x174fc8)[_0xc8d7('0x19')](function(_0x560d10){var _0xebd883={'messageId':_0x560d10[_0xc8d7('0x56')][0x0]};return _0x4a5a3a[_0xc8d7('0x1a')](_0xebd883);})[_0xc8d7('0x1c')](function(_0x277637){logger[_0xc8d7('0x2c')](_0xc8d7('0x2d'),_0xc8d7('0x2e'),'plivo',util[_0xc8d7('0x40')](_0x277637,{'showHidden':![],'depth':null}));});}else{logger[_0xc8d7('0x2c')](_0xc8d7('0x2d'),_0xc8d7('0x2e'),_0xc8d7('0x57'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xc8d7('0x58'):if(_0x35ec0b[_0xc8d7('0x35')]&&_0x35ec0b['password']){if(_0x35ec0b[_0xc8d7('0x59')]){var _0x233ac6={'method':_0xc8d7('0x3a'),'uri':_0x35ec0b['baseUrl']+_0xc8d7('0x5a'),'body':{'username':_0x35ec0b['username'],'password':_0x35ec0b[_0xc8d7('0x32')]},'json':!![]};return rp(_0x233ac6)[_0xc8d7('0x19')](function(_0x159fda){var _0x1b273b={'method':'POST','uri':_0x35ec0b[_0xc8d7('0x59')]+_0xc8d7('0x5b'),'body':{'messages':[{'from':_0x35ec0b[_0xc8d7('0x24')],'destinations':[{'to':_0x275e6b['phone']}],'text':_0x275e6b['body'],'notifyUrl':_0x35ec0b[_0xc8d7('0x27')]+_0xc8d7('0x28')+_0x275e6b['id']+'/status?token='+_0x35ec0b[_0xc8d7('0x2a')],'notifyContentType':_0xc8d7('0x5c'),'callbackData':_0x35ec0b[_0xc8d7('0x24')]+';'+_0x275e6b[_0xc8d7('0xe')]}]},'headers':{'Authorization':_0xc8d7('0x5d')+_0x159fda[_0xc8d7('0x2a')]},'json':!![]};return rp(_0x1b273b)[_0xc8d7('0x19')](function(_0x506767){if(_0x506767[_0xc8d7('0x25')]){var _0x4d9e1a={'messageId':_0x506767[_0xc8d7('0x25')][0x0][_0xc8d7('0xc')]};if(!_0x35ec0b[_0xc8d7('0x52')]){_0x4d9e1a[_0xc8d7('0x3f')]=!![];}return _0x4a5a3a[_0xc8d7('0x1a')](_0x4d9e1a);}else{return logger[_0xc8d7('0x2c')](_0xc8d7('0x2d'),_0xc8d7('0x2e'),'infobip',util[_0xc8d7('0x40')](_0x506767,{'showHidden':![],'depth':null}));}});})[_0xc8d7('0x1c')](function(_0x20d8ed){return logger[_0xc8d7('0x2c')](_0xc8d7('0x2d'),_0xc8d7('0x2e'),'infobip',util[_0xc8d7('0x40')](_0x20d8ed,{'showHidden':![],'depth':null}));});}else{logger[_0xc8d7('0x2c')](_0xc8d7('0x2d'),_0xc8d7('0x2e'),_0xc8d7('0x58'),_0xc8d7('0x5e'));}}else{logger[_0xc8d7('0x2c')](_0xc8d7('0x2d'),_0xc8d7('0x2e'),_0xc8d7('0x58'),_0xc8d7('0x41'));}break;case'csc':var _0x4155e2=require('crypto');if(_0x35ec0b[_0xc8d7('0x5f')]){var _0x3a4faf={};_0x3a4faf[_0xc8d7('0x60')]=_0x35ec0b[_0xc8d7('0x35')];_0x3a4faf['phone']=_0x275e6b[_0xc8d7('0x24')];_0x3a4faf[_0xc8d7('0x34')]=_0x35ec0b[_0xc8d7('0x24')];_0x3a4faf[_0xc8d7('0x61')]=_0x275e6b[_0xc8d7('0xe')];_0x3a4faf[_0xc8d7('0x62')]=+new Date();var _0x5a3aab='';var _0x32848b='';var _0x4ea1bf=Object[_0xc8d7('0x63')](_0x3a4faf);_0x4ea1bf['sort']();for(var _0x2af2b3=0x0;_0x2af2b3<_0x4ea1bf[_0xc8d7('0x64')];_0x2af2b3++){if(_0x5a3aab!=''){_0x5a3aab+='&';}_0x5a3aab+=_0x4ea1bf[_0x2af2b3]+'='+encodeURIComponent(_0x3a4faf[_0x4ea1bf[_0x2af2b3]]);_0x32848b+=_0x3a4faf[_0x4ea1bf[_0x2af2b3]];}_0x32848b+=_0x35ec0b[_0xc8d7('0x5f')];_0x32848b=_0x4155e2[_0xc8d7('0x65')](_0xc8d7('0x66'))[_0xc8d7('0x1a')](_0x32848b)[_0xc8d7('0x67')](_0xc8d7('0x68'));if(_0x5a3aab!==''){_0x5a3aab+='&';}_0x5a3aab+=_0xc8d7('0x69')+_0x32848b;var _0x543f73={'method':_0xc8d7('0x37'),'uri':_0x35ec0b[_0xc8d7('0x59')]+'/external/get/send.php?'+_0x5a3aab,'json':!![]};return rp(_0x543f73)[_0xc8d7('0x19')](function(_0x540d41){var _0x2b20d5=Object[_0xc8d7('0x63')](_0x540d41);if(_0x540d41[_0x2b20d5[0x0]]['error']&&parseInt(_0x540d41[_0x2b20d5[0x0]][_0xc8d7('0x2c')])===0x0){var _0x4e66de={'messageId':_0x540d41[_0x2b20d5[0x0]][_0xc8d7('0x6a')]};if(!_0x35ec0b['deliveryReport']){_0x4e66de['read']=!![];}return _0x4a5a3a[_0xc8d7('0x1a')](_0x4e66de);}else{return logger['error'](_0xc8d7('0x2d'),_0xc8d7('0x2e'),'csc',util[_0xc8d7('0x40')](_0x540d41['error'],{'showHidden':![],'depth':null}));}})[_0xc8d7('0x1c')](function(_0x183c97){return logger[_0xc8d7('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','csc',util[_0xc8d7('0x40')](_0x183c97,{'showHidden':![],'depth':null}));});}else{logger[_0xc8d7('0x2c')](_0xc8d7('0x2d'),_0xc8d7('0x2e'),_0xc8d7('0x6b'),_0xc8d7('0x6c'));}break;case _0xc8d7('0x6d'):if(_0x35ec0b['apiKey']){var _0x114921={'method':_0xc8d7('0x3a'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x35ec0b[_0xc8d7('0x5f')]},'body':{'content':_0x275e6b[_0xc8d7('0xe')],'to':[_0x275e6b[_0xc8d7('0x24')]],'from':_0x35ec0b[_0xc8d7('0x24')],'binary':![],'clientMessageId':'uuid','charset':_0xc8d7('0x6e')},'json':!![]};rp(_0x114921)[_0xc8d7('0x19')](function(_0x151042){if(!_0x151042['error']){var _0x493ac4={'messageId':_0x151042[_0xc8d7('0x25')][0x0]['apiMessageId']};if(!_0x35ec0b['deliveryReport']){_0x493ac4[_0xc8d7('0x3f')]=!![];}return _0x4a5a3a[_0xc8d7('0x1a')](_0x493ac4);}else{return logger['error'](_0xc8d7('0x2d'),_0xc8d7('0x2e'),_0xc8d7('0x6d'),util['inspect'](_0x151042['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x1cc3c2){return logger[_0xc8d7('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc8d7('0x2e'),'clickatell',util[_0xc8d7('0x40')](_0x1cc3c2,{'showHidden':![],'depth':null}));});}else{logger[_0xc8d7('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xc8d7('0x6d'),_0xc8d7('0x6c'));}break;case _0xc8d7('0x6f'):if(_0x35ec0b[_0xc8d7('0x35')]&&_0x35ec0b['password']){var _0x163c53=util[_0xc8d7('0x4a')](_0xc8d7('0x48'),_0x35ec0b[_0xc8d7('0x35')],_0x35ec0b[_0xc8d7('0x32')]);var _0x174fc8={'method':'POST','uri':_0xc8d7('0x70')+_0x35ec0b[_0xc8d7('0x71')]+'/messages','body':{'to':[_0x275e6b[_0xc8d7('0x24')]],'text':_0x275e6b[_0xc8d7('0xe')],'from':_0x35ec0b[_0xc8d7('0x24')],'applicationId':_0x35ec0b[_0xc8d7('0x72')]},'headers':{'Authorization':util[_0xc8d7('0x4a')](_0xc8d7('0x4b'),new Buffer(_0x163c53)[_0xc8d7('0x4c')](_0xc8d7('0x73')))},'json':!![]};rp(_0x174fc8)[_0xc8d7('0x19')](function(_0x184938){if(_0x184938['id']){var _0x805199={'messageId':_0x184938['id']};return _0x4a5a3a[_0xc8d7('0x1a')](_0x805199);}else{logger[_0xc8d7('0x2c')](_0xc8d7('0x2d'),_0xc8d7('0x2e'),_0xc8d7('0x6f'),util[_0xc8d7('0x40')](_0x184938,{'showHidden':![],'depth':null}));}})[_0xc8d7('0x1c')](function(_0x494411){logger[_0xc8d7('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xc8d7('0x6f'),util[_0xc8d7('0x40')](_0x494411,{'showHidden':![],'depth':null}));});}else{logger[_0xc8d7('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xc8d7('0x6f'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xc8d7('0x74'):if(_0x35ec0b['apiKey']){var _0xe57597={};var _0x543f73={'method':_0xc8d7('0x3a'),'uri':_0xc8d7('0x75'),'headers':{'Authorization':_0xc8d7('0x76')+_0x35ec0b[_0xc8d7('0x5f')],'Content-Type':'application/json'},'body':{'from':_0x35ec0b[_0xc8d7('0x24')],'to':_0x275e6b['phone'],'text':_0x275e6b[_0xc8d7('0xe')]},'json':!![]};return rp(_0x543f73)[_0xc8d7('0x19')](function(_0x10fe39){if(_0x10fe39['code']==0xca){_0xe57597[_0xc8d7('0x77')]=_0x10fe39;var _0x1e4216={'method':_0xc8d7('0x3a'),'uri':_0xc8d7('0x78'),'headers':{'Authorization':_0xc8d7('0x76')+_0x35ec0b[_0xc8d7('0x5f')],'Content-Type':'application/json'},'body':{'refid':_0xe57597[_0xc8d7('0x77')][_0xc8d7('0x79')]},'json':!![]};return rp(_0x1e4216)[_0xc8d7('0x19')](function(_0x1bef98){_0xe57597[_0xc8d7('0x7a')]=_0x1bef98;var _0x3e2a47={'messageId':_0xe57597['message'][_0xc8d7('0x79')],'read':!![]};return _0x4a5a3a[_0xc8d7('0x1a')](_0x3e2a47);});}else{return logger[_0xc8d7('0x2c')](_0xc8d7('0x2d'),_0xc8d7('0x2e'),'intelepeer',util['inspect'](_0x10fe39,{'showHidden':![],'depth':null}));}})['catch'](function(_0x35a81e){return logger[_0xc8d7('0x2c')](_0xc8d7('0x2d'),_0xc8d7('0x2e'),_0xc8d7('0x74'),util[_0xc8d7('0x40')](_0x35a81e,{'showHidden':![],'depth':null}));});}else{return logger[_0xc8d7('0x2c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc8d7('0x2e'),_0xc8d7('0x74'),_0xc8d7('0x7b'));}break;}}})[_0xc8d7('0x7c')](function(){_0x28fe12();});}else{_0x28fe12();}}},'charset':'utf8mb4','collate':_0xc8d7('0x7d')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 26d1777..7ad18e4 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 _0x2914=['SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateSmsMessage','SmsMessage','create','body','options','raw','then','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./smsMessage.socket','register','request','info','SmsMessage,\x20%s,\x20%s','debug'];(function(_0x2cb4a4,_0x2b238b){var _0x500550=function(_0x165a74){while(--_0x165a74){_0x2cb4a4['push'](_0x2cb4a4['shift']());}};_0x500550(++_0x2b238b);}(_0x2914,0x179));var _0x4291=function(_0x14268f,_0xa750a7){_0x14268f=_0x14268f-0x0;var _0x4de669=_0x2914[_0x14268f];return _0x4de669;};'use strict';var _=require('lodash');var util=require(_0x4291('0x0'));var moment=require(_0x4291('0x1'));var BPromise=require('bluebird');var rs=require(_0x4291('0x2'));var fs=require('fs');var Redis=require(_0x4291('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4291('0x4'));var logger=require(_0x4291('0x5'))(_0x4291('0x6'));var config=require(_0x4291('0x7'));var jayson=require(_0x4291('0x8'));var client=jayson['client'][_0x4291('0x9')]({'port':0x232a});config[_0x4291('0xa')]=_[_0x4291('0xb')](config[_0x4291('0xa')],{'host':_0x4291('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4291('0xa')]));require(_0x4291('0xd'))[_0x4291('0xe')](socket);function respondWithRpcPromise(_0x1dd9a8,_0x51d60b,_0x5f2c1c){return new BPromise(function(_0x20718f,_0x552f5a){return client[_0x4291('0xf')](_0x1dd9a8,_0x5f2c1c)['then'](function(_0x229ce5){logger[_0x4291('0x10')](_0x4291('0x11'),_0x51d60b,'request\x20sent');logger[_0x4291('0x12')](_0x4291('0x13'),_0x51d60b,_0x4291('0x14'),JSON[_0x4291('0x15')](_0x229ce5));if(_0x229ce5[_0x4291('0x16')]){if(_0x229ce5[_0x4291('0x16')][_0x4291('0x17')]===0x1f4){logger['error'](_0x4291('0x11'),_0x51d60b,_0x229ce5[_0x4291('0x16')][_0x4291('0x18')]);return _0x552f5a(_0x229ce5[_0x4291('0x16')][_0x4291('0x18')]);}logger[_0x4291('0x16')](_0x4291('0x11'),_0x51d60b,_0x229ce5[_0x4291('0x16')][_0x4291('0x18')]);return _0x20718f(_0x229ce5[_0x4291('0x16')][_0x4291('0x18')]);}else{logger['info'](_0x4291('0x11'),_0x51d60b,_0x4291('0x14'));_0x20718f(_0x229ce5[_0x4291('0x19')][_0x4291('0x18')]);}})['catch'](function(_0x424cf4){logger[_0x4291('0x16')](_0x4291('0x11'),_0x51d60b,_0x424cf4);_0x552f5a(_0x424cf4);});});}exports[_0x4291('0x1a')]=function(_0x42fe92){var _0x51fd67=this;return new Promise(function(_0x344675,_0x187fb9){return db[_0x4291('0x1b')][_0x4291('0x1c')](_0x42fe92[_0x4291('0x1d')],{'raw':_0x42fe92[_0x4291('0x1e')]?_0x42fe92['options'][_0x4291('0x1f')]===undefined?!![]:![]:!![]})[_0x4291('0x20')](function(_0x30b382){logger[_0x4291('0x10')]('CreateSmsMessage',_0x42fe92);logger['debug'](_0x4291('0x1a'),_0x42fe92,JSON[_0x4291('0x15')](_0x30b382));_0x344675(_0x30b382);})['catch'](function(_0x5a9ed7){logger[_0x4291('0x16')]('CreateSmsMessage',_0x5a9ed7[_0x4291('0x18')],_0x42fe92);_0x187fb9(_0x51fd67['error'](0x1f4,_0x5a9ed7[_0x4291('0x18')]));});});}; \ No newline at end of file +var _0x6675=['request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','create','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','redis','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6675,0x9e));var _0x5667=function(_0x175bdc,_0x18d6c7){_0x175bdc=_0x175bdc-0x0;var _0x2d6f88=_0x6675[_0x175bdc];return _0x2d6f88;};'use strict';var _=require(_0x5667('0x0'));var util=require(_0x5667('0x1'));var moment=require('moment');var BPromise=require(_0x5667('0x2'));var rs=require(_0x5667('0x3'));var fs=require('fs');var Redis=require(_0x5667('0x4'));var db=require(_0x5667('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x5667('0x6'));var client=jayson[_0x5667('0x7')]['http']({'port':0x232a});config[_0x5667('0x8')]=_['defaults'](config[_0x5667('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x5667('0x9'))(new Redis(config[_0x5667('0x8')]));require(_0x5667('0xa'))[_0x5667('0xb')](socket);function respondWithRpcPromise(_0x23b2f9,_0x466dda,_0x40f52a){return new BPromise(function(_0x4045fa,_0x5e0fa6){return client[_0x5667('0xc')](_0x23b2f9,_0x40f52a)[_0x5667('0xd')](function(_0x2f3eeb){logger[_0x5667('0xe')](_0x5667('0xf'),_0x466dda,_0x5667('0x10'));logger[_0x5667('0x11')](_0x5667('0x12'),_0x466dda,'request\x20sent',JSON[_0x5667('0x13')](_0x2f3eeb));if(_0x2f3eeb['error']){if(_0x2f3eeb[_0x5667('0x14')][_0x5667('0x15')]===0x1f4){logger['error'](_0x5667('0xf'),_0x466dda,_0x2f3eeb[_0x5667('0x14')][_0x5667('0x16')]);return _0x5e0fa6(_0x2f3eeb['error']['message']);}logger['error'](_0x5667('0xf'),_0x466dda,_0x2f3eeb[_0x5667('0x14')][_0x5667('0x16')]);return _0x4045fa(_0x2f3eeb[_0x5667('0x14')][_0x5667('0x16')]);}else{logger[_0x5667('0xe')]('SmsMessage,\x20%s,\x20%s',_0x466dda,_0x5667('0x10'));_0x4045fa(_0x2f3eeb[_0x5667('0x17')][_0x5667('0x16')]);}})[_0x5667('0x18')](function(_0x523d9f){logger[_0x5667('0x14')]('SmsMessage,\x20%s,\x20%s',_0x466dda,_0x523d9f);_0x5e0fa6(_0x523d9f);});});}exports[_0x5667('0x19')]=function(_0x1688dc){var _0x9de04a=this;return new Promise(function(_0x2f01d9,_0x4b8c72){return db['SmsMessage'][_0x5667('0x1a')](_0x1688dc['body'],{'raw':_0x1688dc[_0x5667('0x1b')]?_0x1688dc[_0x5667('0x1b')][_0x5667('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x5185c7){logger['info'](_0x5667('0x19'),_0x1688dc);logger[_0x5667('0x11')](_0x5667('0x19'),_0x1688dc,JSON[_0x5667('0x13')](_0x5185c7));_0x2f01d9(_0x5185c7);})[_0x5667('0x18')](function(_0x4853c1){logger[_0x5667('0x14')]('CreateSmsMessage',_0x4853c1[_0x5667('0x16')],_0x1688dc);_0x4b8c72(_0x9de04a[_0x5667('0x14')](0x1f4,_0x4853c1[_0x5667('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 6f711e7..b34ab38 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 _0x9d49=['remove','update','emit','removeListener','register','smsMessage:','./smsMessage.events'];(function(_0x3c26a9,_0x299c69){var _0x3bcb98=function(_0x3cca6d){while(--_0x3cca6d){_0x3c26a9['push'](_0x3c26a9['shift']());}};_0x3bcb98(++_0x299c69);}(_0x9d49,0x172));var _0x99d4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9d49[_0x3dd15e];return _0x231fd0;};'use strict';var SmsMessageEvents=require(_0x99d4('0x0'));var events=['save',_0x99d4('0x1'),_0x99d4('0x2')];function createListener(_0x5c9c20,_0x42ae23){return function(_0x51f70f){_0x42ae23[_0x99d4('0x3')](_0x5c9c20,_0x51f70f);};}function removeListener(_0x5650e0,_0x4ea00e){return function(){SmsMessageEvents[_0x99d4('0x4')](_0x5650e0,_0x4ea00e);};}exports[_0x99d4('0x5')]=function(_0x4b4690){for(var _0x5f35d3=0x0,_0x535f73=events['length'];_0x5f35d3<_0x535f73;_0x5f35d3++){var _0x574d8b=events[_0x5f35d3];var _0x38488a=createListener(_0x99d4('0x6')+_0x574d8b,_0x4b4690);SmsMessageEvents['on'](_0x574d8b,_0x38488a);}}; \ No newline at end of file +var _0xec30=['removeListener','register','length','smsMessage:','./smsMessage.events','remove','emit'];(function(_0xde0d73,_0x51e5a6){var _0x384f93=function(_0x13cb49){while(--_0x13cb49){_0xde0d73['push'](_0xde0d73['shift']());}};_0x384f93(++_0x51e5a6);}(_0xec30,0xcf));var _0x0ec3=function(_0x36d7b1,_0x3bda0c){_0x36d7b1=_0x36d7b1-0x0;var _0x2f2d83=_0xec30[_0x36d7b1];return _0x2f2d83;};'use strict';var SmsMessageEvents=require(_0x0ec3('0x0'));var events=['save',_0x0ec3('0x1'),'update'];function createListener(_0x2a4a9c,_0x53a8d0){return function(_0x4f8a21){_0x53a8d0[_0x0ec3('0x2')](_0x2a4a9c,_0x4f8a21);};}function removeListener(_0x2e454c,_0x5a65d5){return function(){SmsMessageEvents[_0x0ec3('0x3')](_0x2e454c,_0x5a65d5);};}exports[_0x0ec3('0x4')]=function(_0x5609a9){for(var _0x1ca0ff=0x0,_0x2a65e5=events[_0x0ec3('0x5')];_0x1ca0ff<_0x2a65e5;_0x1ca0ff++){var _0x517aca=events[_0x1ca0ff];var _0x2c8627=createListener(_0x0ec3('0x6')+_0x517aca,_0x5609a9);SmsMessageEvents['on'](_0x517aca,_0x2c8627);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 351d11e..ac1af94 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 _0x232b=['util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueue.controller','index','get','/describe','isAuthenticated','describe','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','addAgents','put','/:id','update','destroy','delete','removeTeams','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x232b,0xfb));var _0xb232=function(_0x18a529,_0x2bea53){_0x18a529=_0x18a529-0x0;var _0x216fb8=_0x232b[_0x18a529];return _0x216fb8;};'use strict';var multer=require(_0xb232('0x0'));var util=require(_0xb232('0x1'));var path=require('path');var timeout=require(_0xb232('0x2'));var express=require('express');var router=express[_0xb232('0x3')]();var fs_extra=require(_0xb232('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb232('0x5'));var config=require(_0xb232('0x6'));var controller=require(_0xb232('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xb232('0x8')]);router[_0xb232('0x9')](_0xb232('0xa'),auth[_0xb232('0xb')](),controller[_0xb232('0xc')]);router[_0xb232('0x9')]('/:id',auth[_0xb232('0xb')](),controller['show']);router[_0xb232('0x9')](_0xb232('0xd'),auth[_0xb232('0xb')](),controller[_0xb232('0xe')]);router[_0xb232('0x9')](_0xb232('0xf'),auth[_0xb232('0xb')](),controller[_0xb232('0x10')]);router[_0xb232('0x9')](_0xb232('0x11'),auth[_0xb232('0xb')](),controller['getAgents']);router[_0xb232('0x12')]('/',auth[_0xb232('0xb')](),controller['create']);router[_0xb232('0x12')]('/:id/teams',auth[_0xb232('0xb')](),controller[_0xb232('0x13')]);router[_0xb232('0x12')](_0xb232('0x11'),auth[_0xb232('0xb')](),controller[_0xb232('0x14')]);router[_0xb232('0x15')](_0xb232('0x16'),auth[_0xb232('0xb')](),controller[_0xb232('0x17')]);router['delete'](_0xb232('0x16'),auth[_0xb232('0xb')](),controller[_0xb232('0x18')]);router[_0xb232('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0xb232('0x1a')]);router[_0xb232('0x19')](_0xb232('0x11'),auth[_0xb232('0xb')](),controller['removeAgents']);module[_0xb232('0x1b')]=router; \ No newline at end of file +var _0x95a6=['./smsQueue.controller','/describe','isAuthenticated','describe','get','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x31a1d4,_0x54304b){var _0x307e10=function(_0x4f41e1){while(--_0x4f41e1){_0x31a1d4['push'](_0x31a1d4['shift']());}};_0x307e10(++_0x54304b);}(_0x95a6,0xa7));var _0x695a=function(_0x2fc098,_0x59da9b){_0x2fc098=_0x2fc098-0x0;var _0x5c7cc7=_0x95a6[_0x2fc098];return _0x5c7cc7;};'use strict';var multer=require(_0x695a('0x0'));var util=require('util');var path=require(_0x695a('0x1'));var timeout=require('connect-timeout');var express=require(_0x695a('0x2'));var router=express[_0x695a('0x3')]();var fs_extra=require(_0x695a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x695a('0x5'));var config=require(_0x695a('0x6'));var controller=require(_0x695a('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x695a('0x8'),auth[_0x695a('0x9')](),controller[_0x695a('0xa')]);router[_0x695a('0xb')](_0x695a('0xc'),auth[_0x695a('0x9')](),controller['show']);router[_0x695a('0xb')](_0x695a('0xd'),auth[_0x695a('0x9')](),controller[_0x695a('0xe')]);router[_0x695a('0xb')](_0x695a('0xf'),auth[_0x695a('0x9')](),controller[_0x695a('0x10')]);router['get'](_0x695a('0x11'),auth[_0x695a('0x9')](),controller[_0x695a('0x12')]);router['post']('/',auth[_0x695a('0x9')](),controller[_0x695a('0x13')]);router[_0x695a('0x14')](_0x695a('0xf'),auth[_0x695a('0x9')](),controller[_0x695a('0x15')]);router[_0x695a('0x14')](_0x695a('0x11'),auth[_0x695a('0x9')](),controller['addAgents']);router[_0x695a('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x695a('0x17')]);router[_0x695a('0x18')](_0x695a('0xc'),auth[_0x695a('0x9')](),controller[_0x695a('0x19')]);router['delete'](_0x695a('0xf'),auth['isAuthenticated'](),controller[_0x695a('0x1a')]);router[_0x695a('0x18')]('/:id/users',auth[_0x695a('0x9')](),controller[_0x695a('0x1b')]);module[_0x695a('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 4d533c6..30517df 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 _0x4027=['beepall','roundrobin','sequelize','exports','name','INTEGER','ENUM'];(function(_0x9fa2e2,_0x1431d0){var _0x8f4d8d=function(_0x3dd78d){while(--_0x3dd78d){_0x9fa2e2['push'](_0x9fa2e2['shift']());}};_0x8f4d8d(++_0x1431d0);}(_0x4027,0x1b4));var _0x7402=function(_0x4ba821,_0xaba49d){_0x4ba821=_0x4ba821-0x0;var _0xf1ddb8=_0x4027[_0x4ba821];return _0xf1ddb8;};'use strict';var Sequelize=require(_0x7402('0x0'));module[_0x7402('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7402('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7402('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7402('0x4')]('rrmemory',_0x7402('0x5'),_0x7402('0x6'))}}; \ No newline at end of file +var _0x8bf5=['ENUM','roundrobin','sequelize','exports','STRING','name'];(function(_0x56685c,_0x3bf1a7){var _0x57000e=function(_0x2329c8){while(--_0x2329c8){_0x56685c['push'](_0x56685c['shift']());}};_0x57000e(++_0x3bf1a7);}(_0x8bf5,0x170));var _0x58bf=function(_0x52ddc8,_0xada5d6){_0x52ddc8=_0x52ddc8-0x0;var _0x41e9c3=_0x8bf5[_0x52ddc8];return _0x41e9c3;};'use strict';var Sequelize=require(_0x58bf('0x0'));module[_0x58bf('0x1')]={'name':{'type':Sequelize[_0x58bf('0x2')],'unique':_0x58bf('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x58bf('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x58bf('0x4')]('rrmemory','beepall',_0x58bf('0x5'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 8f33f21..5cc8898 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 _0x1a22=['forEach','emit','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','userSmsQueue:remove','addAgents','omit','spread','userSmsQueue:save','removeAgents','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','undefined','Content-Range','reject','save','update','then','destroy','get','stack','name','send','index','map','SmsQueue','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','type','VIRTUAL','options','count','includeAll','findAll','rows','show','params','rawAttributes','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','UserProfileSection','find','error','describe','findOne','UserSmsQueue','SmsQueueId','merge','User','findAndCountAll','UserId','agent','smsPause','updatedAt','format','%s/%s','createdAt','Team','order','getTeams','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','transaction','findOrCreate'];(function(_0x415b51,_0x1a29ee){var _0x1dd82c=function(_0x25afee){while(--_0x25afee){_0x415b51['push'](_0x415b51['shift']());}};_0x1dd82c(++_0x1a29ee);}(_0x1a22,0x125));var _0x21a2=function(_0x53dd63,_0x5e1852){_0x53dd63=_0x53dd63-0x0;var _0x460c0a=_0x1a22[_0x53dd63];return _0x460c0a;};'use strict';var emlformat=require(_0x21a2('0x0'));var rimraf=require(_0x21a2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x21a2('0x2'));var rp=require(_0x21a2('0x3'));var moment=require(_0x21a2('0x4'));var BPromise=require(_0x21a2('0x5'));var Mustache=require(_0x21a2('0x6'));var util=require('util');var path=require('path');var sox=require(_0x21a2('0x7'));var csv=require(_0x21a2('0x8'));var ejs=require(_0x21a2('0x9'));var fs=require('fs');var fs_extra=require(_0x21a2('0xa'));var _=require(_0x21a2('0xb'));var squel=require('squel');var crypto=require(_0x21a2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x21a2('0xd'));var toCsv=require(_0x21a2('0x8'));var querystring=require(_0x21a2('0xe'));var Papa=require(_0x21a2('0xf'));var Redis=require('ioredis');var authService=require(_0x21a2('0x10'));var qs=require(_0x21a2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x21a2('0x12'))(_0x21a2('0x13'));var utils=require(_0x21a2('0x14'));var config=require(_0x21a2('0x15'));var licenseUtil=require(_0x21a2('0x16'));var db=require('../../mysqldb')['db'];config[_0x21a2('0x17')]=_[_0x21a2('0x18')](config[_0x21a2('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x21a2('0x19'))(new Redis(config[_0x21a2('0x17')]));require('./smsQueue.socket')['register'](socket);function respondWithStatusCode(_0x2758f8,_0xe96e52){_0xe96e52=_0xe96e52||0xcc;return function(_0x4421d7){if(_0x4421d7){return _0x2758f8[_0x21a2('0x1a')](_0xe96e52);}return _0x2758f8[_0x21a2('0x1b')](_0xe96e52)[_0x21a2('0x1c')]();};}function respondWithResult(_0xf805fc,_0x2d0bcb){_0x2d0bcb=_0x2d0bcb||0xc8;return function(_0x277431){if(_0x277431){return _0xf805fc['status'](_0x2d0bcb)[_0x21a2('0x1d')](_0x277431);}};}function respondWithFilteredResult(_0x135fcf,_0x3acf95){return function(_0x1c160c){if(_0x1c160c){var _0x368792=typeof _0x3acf95[_0x21a2('0x1e')]===_0x21a2('0x1f')&&typeof _0x3acf95['limit']===_0x21a2('0x1f');var _0x182d46=_0x1c160c['count'];var _0x20ec06=_0x368792?0x0:_0x3acf95[_0x21a2('0x1e')];var _0x398455=_0x368792?_0x1c160c['count']:_0x3acf95['offset']+_0x3acf95['limit'];var _0x25eb8e;if(_0x398455>=_0x182d46){_0x398455=_0x182d46;_0x25eb8e=0xc8;}else{_0x25eb8e=0xce;}_0x135fcf['status'](_0x25eb8e);return _0x135fcf['set'](_0x21a2('0x20'),_0x20ec06+'-'+_0x398455+'/'+_0x182d46)[_0x21a2('0x1d')](_0x1c160c);}return null;};}function patchUpdates(_0x1fd78b){return function(_0x38083f){try{jsonpatch['apply'](_0x38083f,_0x1fd78b,!![]);}catch(_0x126847){return BPromise[_0x21a2('0x21')](_0x126847);}return _0x38083f[_0x21a2('0x22')]();};}function saveUpdates(_0x5e9d61,_0x1c9b17){return function(_0x1c7395){if(_0x1c7395){return _0x1c7395[_0x21a2('0x23')](_0x5e9d61)[_0x21a2('0x24')](function(_0xd62b1b){return _0xd62b1b;});}return null;};}function removeEntity(_0x3776a2,_0x52ce7){return function(_0x143d4b){if(_0x143d4b){return _0x143d4b[_0x21a2('0x25')]()['then'](function(){var _0x5e943d=_0x143d4b[_0x21a2('0x26')]({'plain':!![]});var _0x32b7ed='SmsQueues';return db['UserProfileResource'][_0x21a2('0x25')]({'where':{'type':_0x32b7ed,'resourceId':_0x5e943d['id']}})[_0x21a2('0x24')](function(){return _0x143d4b;});})[_0x21a2('0x24')](function(){_0x3776a2['status'](0xcc)[_0x21a2('0x1c')]();});}};}function handleEntityNotFound(_0x5272f3,_0x95fd19){return function(_0x1752c5){if(!_0x1752c5){_0x5272f3['sendStatus'](0x194);}return _0x1752c5;};}function handleError(_0x3aad32,_0x716230){_0x716230=_0x716230||0x1f4;return function(_0x58d440){logger['error'](_0x58d440[_0x21a2('0x27')]);if(_0x58d440[_0x21a2('0x28')]){delete _0x58d440[_0x21a2('0x28')];}_0x3aad32[_0x21a2('0x1b')](_0x716230)[_0x21a2('0x29')](_0x58d440);};}exports[_0x21a2('0x2a')]=function(_0x57e4dd,_0x408a41){var _0x158a02={},_0x1b79c7={},_0x2778d1={'count':0x0,'rows':[]};var _0x5522f4=_[_0x21a2('0x2b')](db[_0x21a2('0x2c')]['rawAttributes'],function(_0x32d899){return{'name':_0x32d899['fieldName'],'type':_0x32d899['type']['key']};});_0x1b79c7[_0x21a2('0x2d')]=_[_0x21a2('0x2b')](_0x5522f4,_0x21a2('0x28'));_0x1b79c7[_0x21a2('0x2e')]=_[_0x21a2('0x2f')](_0x57e4dd[_0x21a2('0x2e')]);_0x1b79c7[_0x21a2('0x30')]=_[_0x21a2('0x31')](_0x1b79c7[_0x21a2('0x2d')],_0x1b79c7[_0x21a2('0x2e')]);_0x158a02[_0x21a2('0x32')]=_[_0x21a2('0x31')](_0x1b79c7[_0x21a2('0x2d')],qs[_0x21a2('0x33')](_0x57e4dd['query'][_0x21a2('0x33')]));_0x158a02['attributes']=_0x158a02['attributes'][_0x21a2('0x34')]?_0x158a02[_0x21a2('0x32')]:_0x1b79c7[_0x21a2('0x2d')];if(!_0x57e4dd[_0x21a2('0x2e')][_0x21a2('0x35')](_0x21a2('0x36'))){_0x158a02[_0x21a2('0x37')]=qs[_0x21a2('0x37')](_0x57e4dd[_0x21a2('0x2e')][_0x21a2('0x37')]);_0x158a02[_0x21a2('0x1e')]=qs[_0x21a2('0x1e')](_0x57e4dd[_0x21a2('0x2e')]['offset']);}_0x158a02['order']=qs['sort'](_0x57e4dd[_0x21a2('0x2e')][_0x21a2('0x38')]);_0x158a02[_0x21a2('0x39')]=qs[_0x21a2('0x30')](_[_0x21a2('0x3a')](_0x57e4dd[_0x21a2('0x2e')],_0x1b79c7[_0x21a2('0x30')]),_0x5522f4);if(_0x57e4dd[_0x21a2('0x2e')][_0x21a2('0x3b')]){_0x158a02[_0x21a2('0x39')]=_['merge'](_0x158a02[_0x21a2('0x39')],{'$or':_[_0x21a2('0x2b')](_0x5522f4,function(_0x4896c4){if(_0x4896c4[_0x21a2('0x3c')]!==_0x21a2('0x3d')){var _0x5222f8={};_0x5222f8[_0x4896c4[_0x21a2('0x28')]]={'$like':'%'+_0x57e4dd['query'][_0x21a2('0x3b')]+'%'};return _0x5222f8;}})});}_0x158a02=_['merge']({},_0x158a02,_0x57e4dd[_0x21a2('0x3e')]);var _0x5c58a1={'where':_0x158a02[_0x21a2('0x39')]};return db[_0x21a2('0x2c')][_0x21a2('0x3f')](_0x5c58a1)[_0x21a2('0x24')](function(_0x1019cf){_0x2778d1[_0x21a2('0x3f')]=_0x1019cf;if(_0x57e4dd[_0x21a2('0x2e')][_0x21a2('0x40')]){_0x158a02['include']=[{'all':!![]}];}return db[_0x21a2('0x2c')][_0x21a2('0x41')](_0x158a02);})[_0x21a2('0x24')](function(_0x1a1e63){_0x2778d1[_0x21a2('0x42')]=_0x1a1e63;return _0x2778d1;})[_0x21a2('0x24')](respondWithFilteredResult(_0x408a41,_0x158a02))['catch'](handleError(_0x408a41,null));};exports[_0x21a2('0x43')]=function(_0x5ae927,_0x48bb4a){var _0x5e000e={'raw':!![],'where':{'id':_0x5ae927[_0x21a2('0x44')]['id']}},_0x558363={};_0x558363['model']=_[_0x21a2('0x2f')](db['SmsQueue'][_0x21a2('0x45')]);_0x558363[_0x21a2('0x2e')]=_[_0x21a2('0x2f')](_0x5ae927[_0x21a2('0x2e')]);_0x558363[_0x21a2('0x30')]=_[_0x21a2('0x31')](_0x558363[_0x21a2('0x2d')],_0x558363[_0x21a2('0x2e')]);_0x5e000e['attributes']=_[_0x21a2('0x31')](_0x558363[_0x21a2('0x2d')],qs[_0x21a2('0x33')](_0x5ae927[_0x21a2('0x2e')][_0x21a2('0x33')]));_0x5e000e['attributes']=_0x5e000e['attributes']['length']?_0x5e000e['attributes']:_0x558363['model'];if(_0x5ae927['query'][_0x21a2('0x40')]){_0x5e000e['include']=[{'all':!![]}];}_0x5e000e=_['merge']({},_0x5e000e,_0x5ae927['options']);return db['SmsQueue']['find'](_0x5e000e)['then'](handleEntityNotFound(_0x48bb4a,null))[_0x21a2('0x24')](respondWithResult(_0x48bb4a,null))[_0x21a2('0x46')](handleError(_0x48bb4a,null));};exports[_0x21a2('0x47')]=function(_0x6755f,_0x249172){return db['SmsQueue']['create'](_0x6755f[_0x21a2('0x48')],{})[_0x21a2('0x24')](function(_0x223571){var _0x4b1776=_0x6755f[_0x21a2('0x49')]['get']({'plain':!![]});if(!_0x4b1776)throw new Error(_0x21a2('0x4a'));if(_0x4b1776[_0x21a2('0x4b')]===_0x21a2('0x49')){var _0x12a1cd=_0x223571['get']({'plain':!![]});var _0x5f3503=_0x21a2('0x4c');return db[_0x21a2('0x4d')][_0x21a2('0x4e')]({'where':{'name':_0x5f3503,'userProfileId':_0x4b1776['userProfileId']},'raw':!![]})[_0x21a2('0x24')](function(_0x443e5b){if(_0x443e5b&&_0x443e5b['autoAssociation']===0x0){return db['UserProfileResource'][_0x21a2('0x47')]({'name':_0x12a1cd[_0x21a2('0x28')],'resourceId':_0x12a1cd['id'],'type':_0x443e5b[_0x21a2('0x28')],'sectionId':_0x443e5b['id']},{})[_0x21a2('0x24')](function(){return _0x223571;});}else{return _0x223571;}})[_0x21a2('0x46')](function(_0x1f8e91){logger[_0x21a2('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f8e91);throw _0x1f8e91;});}return _0x223571;})[_0x21a2('0x24')](respondWithResult(_0x249172,0xc9))[_0x21a2('0x46')](handleError(_0x249172,null));};exports['update']=function(_0x213431,_0x3e0c76){if(_0x213431[_0x21a2('0x48')]['id']){delete _0x213431[_0x21a2('0x48')]['id'];}return db[_0x21a2('0x2c')][_0x21a2('0x4e')]({'where':{'id':_0x213431[_0x21a2('0x44')]['id']}})[_0x21a2('0x24')](handleEntityNotFound(_0x3e0c76,null))['then'](saveUpdates(_0x213431['body'],null))['then'](respondWithResult(_0x3e0c76,null))[_0x21a2('0x46')](handleError(_0x3e0c76,null));};exports['destroy']=function(_0x4bfb46,_0x370f0a){return db[_0x21a2('0x2c')][_0x21a2('0x4e')]({'where':{'id':_0x4bfb46[_0x21a2('0x44')]['id']}})[_0x21a2('0x24')](handleEntityNotFound(_0x370f0a,null))[_0x21a2('0x24')](removeEntity(_0x370f0a,null))[_0x21a2('0x46')](handleError(_0x370f0a,null));};exports[_0x21a2('0x50')]=function(_0x4d13f8,_0x4dca0f){return db[_0x21a2('0x2c')]['describe']()[_0x21a2('0x24')](respondWithResult(_0x4dca0f,null))[_0x21a2('0x46')](handleError(_0x4dca0f,null));};exports['getMembers']=function(_0x49c47f,_0x4ba875,_0x5c592b){var _0x2ad8a9={'raw':!![],'where':{}},_0x593800={},_0x498194;return db[_0x21a2('0x2c')][_0x21a2('0x51')]({'where':{'id':_0x49c47f[_0x21a2('0x44')]['id']}})[_0x21a2('0x24')](handleEntityNotFound(_0x4ba875,null))[_0x21a2('0x24')](function(_0x5b663f){if(_0x5b663f){_0x498194=_0x5b663f[_0x21a2('0x26')]({'plain':!![]});_0x593800[_0x21a2('0x2d')]=_[_0x21a2('0x2f')](db[_0x21a2('0x52')][_0x21a2('0x45')]);_0x593800['query']=_['keys'](_0x49c47f[_0x21a2('0x2e')]);_0x593800[_0x21a2('0x30')]=_['intersection'](_0x593800[_0x21a2('0x2d')],_0x593800[_0x21a2('0x2e')]);_0x2ad8a9['attributes']=_[_0x21a2('0x31')](_0x593800[_0x21a2('0x2d')],qs[_0x21a2('0x33')](_0x49c47f['query']['fields']));_0x2ad8a9[_0x21a2('0x32')]=_0x2ad8a9['attributes'][_0x21a2('0x34')]?_0x2ad8a9[_0x21a2('0x32')]:_0x593800['model'];if(!_0x49c47f[_0x21a2('0x2e')][_0x21a2('0x35')](_0x21a2('0x36'))){_0x2ad8a9['limit']=qs[_0x21a2('0x37')](_0x49c47f[_0x21a2('0x2e')]['limit']);_0x2ad8a9[_0x21a2('0x1e')]=qs['offset'](_0x49c47f[_0x21a2('0x2e')][_0x21a2('0x1e')]);}_0x2ad8a9['order']=qs['sort'](_0x49c47f[_0x21a2('0x2e')][_0x21a2('0x38')]);_0x2ad8a9[_0x21a2('0x39')]=qs[_0x21a2('0x30')](_[_0x21a2('0x3a')](_0x49c47f[_0x21a2('0x2e')],_0x593800[_0x21a2('0x30')]));_0x2ad8a9['where'][_0x21a2('0x53')]=_0x5b663f['id'];if(_0x49c47f[_0x21a2('0x2e')][_0x21a2('0x3b')]){_0x2ad8a9[_0x21a2('0x39')]=_[_0x21a2('0x54')](_0x2ad8a9['where'],{'$or':_[_0x21a2('0x2b')](_0x2ad8a9[_0x21a2('0x32')],function(_0x3bb574){var _0x179150={};_0x179150[_0x3bb574]={'$like':'%'+_0x49c47f[_0x21a2('0x2e')][_0x21a2('0x3b')]+'%'};return _0x179150;})});}_0x2ad8a9=_['merge']({},_0x2ad8a9,_0x49c47f[_0x21a2('0x3e')]);return db['UserSmsQueue']['findAll'](_0x2ad8a9);}})[_0x21a2('0x24')](function(_0x3c685a){if(_0x3c685a){return db[_0x21a2('0x55')][_0x21a2('0x56')]({'where':{'id':_[_0x21a2('0x2b')](_0x3c685a,_0x21a2('0x57')),'role':_0x21a2('0x58')},'attributes':['id','name',_0x21a2('0x59'),_0x21a2('0x5a'),'createdAt']});}})[_0x21a2('0x24')](function(_0x4e7d39){if(_0x4e7d39){return{'count':_0x4e7d39[_0x21a2('0x3f')],'rows':_[_0x21a2('0x2b')](_0x4e7d39['rows'],function(_0x4228f5){return{'membername':_0x4228f5[_0x21a2('0x28')],'UserId':_0x4228f5['id'],'queue_name':_0x498194[_0x21a2('0x28')],'SmsQueueId':_0x498194['id'],'interface':util[_0x21a2('0x5b')](_0x21a2('0x5c'),'SIP',_0x4228f5[_0x21a2('0x28')]),'penalty':0x0,'paused':_0x4228f5[_0x21a2('0x59')],'createdAt':_0x4228f5[_0x21a2('0x5d')],'updatedAt':_0x4228f5['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x21a2('0x24')](respondWithFilteredResult(_0x4ba875,_0x2ad8a9))[_0x21a2('0x46')](handleError(_0x4ba875,null));};exports['getTeams']=function(_0x412f6c,_0x3149ca,_0x36effd){var _0x148c35={};var _0x310f4d={};var _0x147523;var _0x25603b;return db[_0x21a2('0x2c')][_0x21a2('0x51')]({'where':{'id':_0x412f6c[_0x21a2('0x44')]['id']}})[_0x21a2('0x24')](handleEntityNotFound(_0x3149ca,null))[_0x21a2('0x24')](function(_0x139d25){if(_0x139d25){_0x147523=_0x139d25;_0x310f4d[_0x21a2('0x2d')]=_[_0x21a2('0x2f')](db[_0x21a2('0x5e')][_0x21a2('0x45')]);_0x310f4d[_0x21a2('0x2e')]=_[_0x21a2('0x2f')](_0x412f6c[_0x21a2('0x2e')]);_0x310f4d[_0x21a2('0x30')]=_[_0x21a2('0x31')](_0x310f4d[_0x21a2('0x2d')],_0x310f4d[_0x21a2('0x2e')]);_0x148c35[_0x21a2('0x32')]=_[_0x21a2('0x31')](_0x310f4d[_0x21a2('0x2d')],qs[_0x21a2('0x33')](_0x412f6c[_0x21a2('0x2e')][_0x21a2('0x33')]));_0x148c35['attributes']=_0x148c35[_0x21a2('0x32')][_0x21a2('0x34')]?_0x148c35[_0x21a2('0x32')]:_0x310f4d[_0x21a2('0x2d')];_0x148c35[_0x21a2('0x5f')]=qs[_0x21a2('0x38')](_0x412f6c[_0x21a2('0x2e')][_0x21a2('0x38')]);_0x148c35[_0x21a2('0x39')]=qs['filters'](_[_0x21a2('0x3a')](_0x412f6c[_0x21a2('0x2e')],_0x310f4d[_0x21a2('0x30')]));if(_0x412f6c[_0x21a2('0x2e')][_0x21a2('0x3b')]){_0x148c35[_0x21a2('0x39')]=_[_0x21a2('0x54')](_0x148c35[_0x21a2('0x39')],{'$or':_['map'](_0x148c35[_0x21a2('0x32')],function(_0x1771c6){var _0x11d150={};_0x11d150[_0x1771c6]={'$like':'%'+_0x412f6c[_0x21a2('0x2e')][_0x21a2('0x3b')]+'%'};return _0x11d150;})});}_0x148c35=_[_0x21a2('0x54')]({},_0x148c35,_0x412f6c['options']);return _0x147523['getTeams'](_0x148c35);}})[_0x21a2('0x24')](function(_0x98c0c5){if(_0x98c0c5){_0x25603b=_0x98c0c5['length'];if(!_0x412f6c[_0x21a2('0x2e')][_0x21a2('0x35')]('nolimit')){_0x148c35[_0x21a2('0x37')]=qs[_0x21a2('0x37')](_0x412f6c[_0x21a2('0x2e')][_0x21a2('0x37')]);_0x148c35[_0x21a2('0x1e')]=qs[_0x21a2('0x1e')](_0x412f6c[_0x21a2('0x2e')]['offset']);}return _0x147523[_0x21a2('0x60')](_0x148c35);}})['then'](function(_0x3396d2){if(_0x3396d2){return _0x3396d2?{'count':_0x25603b,'rows':_0x3396d2}:null;}})[_0x21a2('0x24')](respondWithResult(_0x3149ca,null))['catch'](handleError(_0x3149ca,null));};exports[_0x21a2('0x61')]=function(_0x4261c0,_0x3f0d88,_0x1ad52c){var _0x5297df=_0x4261c0[_0x21a2('0x48')][_0x21a2('0x62')];return db['Team'][_0x21a2('0x41')]({'where':{'id':_0x5297df},'attributes':['id'],'include':[{'model':db[_0x21a2('0x55')],'as':_0x21a2('0x63'),'attributes':['id',_0x21a2('0x28'),_0x21a2('0x64'),_0x21a2('0x65'),'interface'],'raw':!![]}]})[_0x21a2('0x24')](function(_0xd6da97){if(_0xd6da97){var _0x3472d1=_[_0x21a2('0x66')](_0xd6da97,function(_0x5014c8){var _0x23e324=_0x5014c8[_0x21a2('0x26')]({'plain':!![]});return _0x23e324['Agents'];});return db[_0x21a2('0x2c')][_0x21a2('0x4e')]({'where':{'id':_0x4261c0[_0x21a2('0x44')]['id']}})[_0x21a2('0x24')](function(_0x29e9ad){return db[_0x21a2('0x67')][_0x21a2('0x68')](function(_0x2c7ba8){return _0x29e9ad[_0x21a2('0x61')](_0x5297df,{'transaction':_0x2c7ba8})['then'](function(){return BPromise['each'](_0x3472d1,function(_0x1c71b4){return db['UserSmsQueue'][_0x21a2('0x69')]({'where':{'UserId':_0x1c71b4['id'],'SmsQueueId':_0x4261c0['params']['id']},'transaction':_0x2c7ba8});});})[_0x21a2('0x24')](function(){_0x3472d1[_0x21a2('0x6a')](function(_0x4d3fb6){socket[_0x21a2('0x6b')]('userSmsQueue:save',{'UserId':_0x4d3fb6['id'],'SmsQueueId':_0x29e9ad['id']});});});});});}})[_0x21a2('0x24')](respondWithStatusCode(_0x3f0d88,null))[_0x21a2('0x46')](handleError(_0x3f0d88,null));};exports['removeTeams']=function(_0x89a828,_0x185ab7,_0x486714){return db['Team'][_0x21a2('0x41')]({'where':{'id':_0x89a828[_0x21a2('0x2e')]['ids']},'attributes':['id'],'include':[{'model':db[_0x21a2('0x55')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x21a2('0x24')](handleEntityNotFound(_0x185ab7,null))[_0x21a2('0x24')](function(_0x1d1724){var _0x5cef08=_['map'](_0x1d1724,'id');var _0xaf50c9=[];var _0xd91fd9=[];var _0x289888=squel['select']();_0x289888[_0x21a2('0x6c')](_0x21a2('0x6d'))['from']('team_has_sms_queues','tq')[_0x21a2('0x6e')](_0x21a2('0x6f'),'ut',_0x21a2('0x70'))['where'](_0x21a2('0x71'),_0x89a828[_0x21a2('0x44')]['id']);for(var _0x482c61=0x0;_0x482c61<_0x1d1724[_0x21a2('0x34')];_0x482c61+=0x1){let _0x21f74f=_0x1d1724[_0x482c61];for(var _0x2f1d64=0x0;_0x2f1d64<_0x21f74f[_0x21a2('0x63')][_0x21a2('0x34')];_0x2f1d64+=0x1){let _0x514be3=_0x21f74f['Agents'][_0x2f1d64];var _0x49eca9=_0x289888['clone']();_0x49eca9[_0x21a2('0x39')](_0x21a2('0x72'),_0x514be3['id']);_0xd91fd9['push'](db[_0x21a2('0x67')]['query'](_0x49eca9[_0x21a2('0x73')](),{'type':db[_0x21a2('0x67')][_0x21a2('0x74')][_0x21a2('0x75')]})[_0x21a2('0x24')](function(_0xd865d6){if(_0xd865d6['length']===0x1){return _0x514be3['id'];}else{var _0x322ada=_['every'](_[_0x21a2('0x2b')](_0xd865d6,_0x21a2('0x76')),function(_0x18dff7){return _[_0x21a2('0x77')](_0x5cef08,_0x18dff7);});if(_0x322ada){return _0x514be3['id'];}}}));}}return BPromise[_0x21a2('0x78')](_0xd91fd9)['then'](function(_0x4aa5d9){_0xaf50c9=_(_0xaf50c9)[_0x21a2('0x79')](_0x4aa5d9)[_0x21a2('0x7a')]()[_0x21a2('0x7b')]();return db[_0x21a2('0x2c')][_0x21a2('0x4e')]({'where':{'id':_0x89a828[_0x21a2('0x44')]['id']}})[_0x21a2('0x24')](function(_0x4e039d){return db[_0x21a2('0x67')]['transaction'](function(_0x29eea2){return _0x4e039d['removeTeams'](_0x89a828[_0x21a2('0x2e')][_0x21a2('0x62')],{'transaction':_0x29eea2})[_0x21a2('0x24')](function(){if(!_[_0x21a2('0x7c')](_0xaf50c9)){return _0x4e039d['removeAgents'](_0xaf50c9,{'transaction':_0x29eea2});}})[_0x21a2('0x24')](function(){_0xaf50c9[_0x21a2('0x6a')](function(_0x5d70ee){socket[_0x21a2('0x6b')](_0x21a2('0x7d'),{'UserId':_0x5d70ee,'SmsQueueId':_0x4e039d['id']});});});});});});})['then'](respondWithStatusCode(_0x185ab7,null))[_0x21a2('0x46')](handleError(_0x185ab7,null));};exports[_0x21a2('0x7e')]=function(_0x4c45df,_0x5cf733,_0x5bb882){return db['SmsQueue'][_0x21a2('0x4e')]({'where':{'id':_0x4c45df[_0x21a2('0x44')]['id']}})['then'](handleEntityNotFound(_0x5cf733,null))[_0x21a2('0x24')](function(_0x1f2a0d){if(_0x1f2a0d){return _0x1f2a0d[_0x21a2('0x7e')](_0x4c45df['body'][_0x21a2('0x62')],_[_0x21a2('0x7f')](_0x4c45df['body'],[_0x21a2('0x62'),'id'])||{})[_0x21a2('0x80')](function(_0x7e2394){for(var _0x4bf248=0x0;_0x4bf248<_0x4c45df[_0x21a2('0x48')][_0x21a2('0x62')]['length'];_0x4bf248+=0x1){socket[_0x21a2('0x6b')](_0x21a2('0x81'),{'UserId':Number(_0x4c45df[_0x21a2('0x48')][_0x21a2('0x62')][_0x4bf248]),'SmsQueueId':Number(_0x4c45df['params']['id'])});}return _0x7e2394;});}})[_0x21a2('0x24')](respondWithResult(_0x5cf733,null))[_0x21a2('0x46')](handleError(_0x5cf733,null));};exports[_0x21a2('0x82')]=function(_0x351aee,_0x59f389,_0x53c71b){return db['SmsQueue'][_0x21a2('0x4e')]({'where':{'id':_0x351aee[_0x21a2('0x44')]['id']}})[_0x21a2('0x24')](handleEntityNotFound(_0x59f389,null))[_0x21a2('0x24')](function(_0x25c997){if(_0x25c997){return _0x25c997[_0x21a2('0x82')](_0x351aee[_0x21a2('0x2e')][_0x21a2('0x62')])['then'](function(){if(_[_0x21a2('0x83')](_0x351aee['query']['ids'])){for(var _0x4e85e1=0x0;_0x4e85e1<_0x351aee[_0x21a2('0x2e')]['ids']['length'];_0x4e85e1+=0x1){socket[_0x21a2('0x6b')](_0x21a2('0x7d'),{'UserId':Number(_0x351aee[_0x21a2('0x2e')][_0x21a2('0x62')][_0x4e85e1]),'SmsQueueId':Number(_0x351aee['params']['id'])});}}else{socket[_0x21a2('0x6b')](_0x21a2('0x7d'),{'UserId':Number(_0x351aee['query']['ids']),'SmsQueueId':Number(_0x351aee[_0x21a2('0x44')]['id'])});}});}})[_0x21a2('0x24')](respondWithStatusCode(_0x59f389,null))[_0x21a2('0x46')](handleError(_0x59f389,null));};exports['getAgents']=function(_0x382468,_0x55c301,_0x160e7d){var _0x314b27={};var _0x3a016a={};var _0x38cd2b;var _0x582766;return db[_0x21a2('0x2c')]['findOne']({'where':{'id':_0x382468['params']['id']}})['then'](handleEntityNotFound(_0x55c301,null))[_0x21a2('0x24')](function(_0x959976){if(_0x959976){_0x38cd2b=_0x959976;_0x3a016a[_0x21a2('0x2d')]=_[_0x21a2('0x2f')](db['User'][_0x21a2('0x45')]);_0x3a016a[_0x21a2('0x2e')]=_[_0x21a2('0x2f')](_0x382468[_0x21a2('0x2e')]);_0x3a016a[_0x21a2('0x30')]=_['intersection'](_0x3a016a['model'],_0x3a016a['query']);_0x314b27[_0x21a2('0x32')]=_[_0x21a2('0x31')](_0x3a016a[_0x21a2('0x2d')],qs[_0x21a2('0x33')](_0x382468[_0x21a2('0x2e')][_0x21a2('0x33')]));_0x314b27[_0x21a2('0x32')]=_0x314b27[_0x21a2('0x32')]['length']?_0x314b27[_0x21a2('0x32')]:_0x3a016a[_0x21a2('0x2d')];_0x314b27[_0x21a2('0x5f')]=qs[_0x21a2('0x38')](_0x382468[_0x21a2('0x2e')][_0x21a2('0x38')]);_0x314b27['where']=qs['filters'](_['pick'](_0x382468['query'],_0x3a016a[_0x21a2('0x30')]));if(_0x382468[_0x21a2('0x2e')]['filter']){_0x314b27['where']=_[_0x21a2('0x54')](_0x314b27['where'],{'$or':_[_0x21a2('0x2b')](_0x314b27[_0x21a2('0x32')],function(_0xdf03c7){var _0x22be42={};_0x22be42[_0xdf03c7]={'$like':'%'+_0x382468[_0x21a2('0x2e')][_0x21a2('0x3b')]+'%'};return _0x22be42;})});}_0x314b27=_[_0x21a2('0x54')]({},_0x314b27,_0x382468[_0x21a2('0x3e')]);return _0x38cd2b[_0x21a2('0x84')](_0x314b27);}})[_0x21a2('0x24')](function(_0x4e7aee){if(_0x4e7aee){_0x582766=_0x4e7aee[_0x21a2('0x34')];if(!_0x382468[_0x21a2('0x2e')][_0x21a2('0x35')](_0x21a2('0x36'))){_0x314b27[_0x21a2('0x37')]=qs[_0x21a2('0x37')](_0x382468['query'][_0x21a2('0x37')]);_0x314b27[_0x21a2('0x1e')]=qs[_0x21a2('0x1e')](_0x382468['query'][_0x21a2('0x1e')]);}return _0x38cd2b['getAgents'](_0x314b27);}})[_0x21a2('0x24')](function(_0x49db14){if(_0x49db14){return _0x49db14?{'count':_0x582766,'rows':_0x49db14}:null;}})[_0x21a2('0x24')](respondWithResult(_0x55c301,null))[_0x21a2('0x46')](handleError(_0x55c301,null));}; \ No newline at end of file +var _0x78d5=['spread','isArray','userSmsQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','defaults','redis','localhost','./smsQueue.socket','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','sendStatus','error','stack','name','send','index','SmsQueue','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','findAll','rows','show','keys','length','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserSmsQueue','pick','findAndCountAll','UserId','updatedAt','createdAt','format','%s/%s','SIP','smsPause','Team','getTeams','addTeams','ids','User','online','voicePause','interface','flatMap','Agents','transaction','findOrCreate','forEach','emit','removeTeams','select','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','TeamId','includes','all','union','compact','removeAgents','addAgents','omit'];(function(_0x2e76a7,_0x23871a){var _0x454cde=function(_0x51724d){while(--_0x51724d){_0x2e76a7['push'](_0x2e76a7['shift']());}};_0x454cde(++_0x23871a);}(_0x78d5,0x1a8));var _0x578d=function(_0x1cc2d8,_0x116f9a){_0x1cc2d8=_0x1cc2d8-0x0;var _0x13abd7=_0x78d5[_0x1cc2d8];return _0x13abd7;};'use strict';var emlformat=require(_0x578d('0x0'));var rimraf=require(_0x578d('0x1'));var zipdir=require(_0x578d('0x2'));var jsonpatch=require(_0x578d('0x3'));var rp=require(_0x578d('0x4'));var moment=require('moment');var BPromise=require(_0x578d('0x5'));var Mustache=require(_0x578d('0x6'));var util=require('util');var path=require(_0x578d('0x7'));var sox=require(_0x578d('0x8'));var csv=require(_0x578d('0x9'));var ejs=require(_0x578d('0xa'));var fs=require('fs');var fs_extra=require(_0x578d('0xb'));var _=require(_0x578d('0xc'));var squel=require(_0x578d('0xd'));var crypto=require('crypto');var jsforce=require(_0x578d('0xe'));var deskjs=require(_0x578d('0xf'));var toCsv=require(_0x578d('0x9'));var querystring=require(_0x578d('0x10'));var Papa=require(_0x578d('0x11'));var Redis=require(_0x578d('0x12'));var authService=require(_0x578d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x578d('0x14'));var hardwareService=require(_0x578d('0x15'));var logger=require(_0x578d('0x16'))(_0x578d('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x578d('0x18')](config[_0x578d('0x19')],{'host':_0x578d('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x578d('0x19')]));require(_0x578d('0x1b'))['register'](socket);function respondWithStatusCode(_0x7b5103,_0x2998c2){_0x2998c2=_0x2998c2||0xcc;return function(_0x4cc941){if(_0x4cc941){return _0x7b5103['sendStatus'](_0x2998c2);}return _0x7b5103[_0x578d('0x1c')](_0x2998c2)[_0x578d('0x1d')]();};}function respondWithResult(_0x49d146,_0x45f575){_0x45f575=_0x45f575||0xc8;return function(_0x287d25){if(_0x287d25){return _0x49d146[_0x578d('0x1c')](_0x45f575)['json'](_0x287d25);}};}function respondWithFilteredResult(_0x454126,_0x348f3a){return function(_0x3c95ed){if(_0x3c95ed){var _0x34b370=typeof _0x348f3a[_0x578d('0x1e')]===_0x578d('0x1f')&&typeof _0x348f3a['limit']===_0x578d('0x1f');var _0x33699c=_0x3c95ed[_0x578d('0x20')];var _0x4524c7=_0x34b370?0x0:_0x348f3a[_0x578d('0x1e')];var _0x6fb7d1=_0x34b370?_0x3c95ed['count']:_0x348f3a[_0x578d('0x1e')]+_0x348f3a[_0x578d('0x21')];var _0x121b6b;if(_0x6fb7d1>=_0x33699c){_0x6fb7d1=_0x33699c;_0x121b6b=0xc8;}else{_0x121b6b=0xce;}_0x454126[_0x578d('0x1c')](_0x121b6b);return _0x454126[_0x578d('0x22')](_0x578d('0x23'),_0x4524c7+'-'+_0x6fb7d1+'/'+_0x33699c)[_0x578d('0x24')](_0x3c95ed);}return null;};}function patchUpdates(_0x412b6a){return function(_0x3c58cb){try{jsonpatch[_0x578d('0x25')](_0x3c58cb,_0x412b6a,!![]);}catch(_0x31fce5){return BPromise[_0x578d('0x26')](_0x31fce5);}return _0x3c58cb[_0x578d('0x27')]();};}function saveUpdates(_0x25ee0b,_0x5dea8f){return function(_0x220c0d){if(_0x220c0d){return _0x220c0d[_0x578d('0x28')](_0x25ee0b)[_0x578d('0x29')](function(_0x396ec7){return _0x396ec7;});}return null;};}function removeEntity(_0x258ae5,_0x470a86){return function(_0x355d3c){if(_0x355d3c){return _0x355d3c[_0x578d('0x2a')]()[_0x578d('0x29')](function(){var _0x46b926=_0x355d3c[_0x578d('0x2b')]({'plain':!![]});var _0x4640ec=_0x578d('0x2c');return db[_0x578d('0x2d')][_0x578d('0x2a')]({'where':{'type':_0x4640ec,'resourceId':_0x46b926['id']}})[_0x578d('0x29')](function(){return _0x355d3c;});})[_0x578d('0x29')](function(){_0x258ae5['status'](0xcc)[_0x578d('0x1d')]();});}};}function handleEntityNotFound(_0x45230a,_0x5f5c60){return function(_0x1972d6){if(!_0x1972d6){_0x45230a[_0x578d('0x2e')](0x194);}return _0x1972d6;};}function handleError(_0xb995b8,_0x1c64b6){_0x1c64b6=_0x1c64b6||0x1f4;return function(_0x5b9d88){logger[_0x578d('0x2f')](_0x5b9d88[_0x578d('0x30')]);if(_0x5b9d88[_0x578d('0x31')]){delete _0x5b9d88[_0x578d('0x31')];}_0xb995b8[_0x578d('0x1c')](_0x1c64b6)[_0x578d('0x32')](_0x5b9d88);};}exports[_0x578d('0x33')]=function(_0x2b551b,_0x244cd4){var _0x57b315={},_0x59c519={},_0x279348={'count':0x0,'rows':[]};var _0x2ecb39=_['map'](db[_0x578d('0x34')][_0x578d('0x35')],function(_0x283ea8){return{'name':_0x283ea8[_0x578d('0x36')],'type':_0x283ea8[_0x578d('0x37')][_0x578d('0x38')]};});_0x59c519[_0x578d('0x39')]=_[_0x578d('0x3a')](_0x2ecb39,_0x578d('0x31'));_0x59c519['query']=_['keys'](_0x2b551b[_0x578d('0x3b')]);_0x59c519[_0x578d('0x3c')]=_['intersection'](_0x59c519['model'],_0x59c519[_0x578d('0x3b')]);_0x57b315[_0x578d('0x3d')]=_[_0x578d('0x3e')](_0x59c519[_0x578d('0x39')],qs[_0x578d('0x3f')](_0x2b551b[_0x578d('0x3b')]['fields']));_0x57b315[_0x578d('0x3d')]=_0x57b315[_0x578d('0x3d')]['length']?_0x57b315[_0x578d('0x3d')]:_0x59c519[_0x578d('0x39')];if(!_0x2b551b[_0x578d('0x3b')][_0x578d('0x40')](_0x578d('0x41'))){_0x57b315[_0x578d('0x21')]=qs[_0x578d('0x21')](_0x2b551b['query']['limit']);_0x57b315['offset']=qs[_0x578d('0x1e')](_0x2b551b[_0x578d('0x3b')][_0x578d('0x1e')]);}_0x57b315[_0x578d('0x42')]=qs[_0x578d('0x43')](_0x2b551b[_0x578d('0x3b')][_0x578d('0x43')]);_0x57b315[_0x578d('0x44')]=qs['filters'](_['pick'](_0x2b551b[_0x578d('0x3b')],_0x59c519[_0x578d('0x3c')]),_0x2ecb39);if(_0x2b551b[_0x578d('0x3b')][_0x578d('0x45')]){_0x57b315[_0x578d('0x44')]=_[_0x578d('0x46')](_0x57b315[_0x578d('0x44')],{'$or':_[_0x578d('0x3a')](_0x2ecb39,function(_0x4395c8){if(_0x4395c8[_0x578d('0x37')]!==_0x578d('0x47')){var _0x1257ba={};_0x1257ba[_0x4395c8[_0x578d('0x31')]]={'$like':'%'+_0x2b551b['query'][_0x578d('0x45')]+'%'};return _0x1257ba;}})});}_0x57b315=_[_0x578d('0x46')]({},_0x57b315,_0x2b551b[_0x578d('0x48')]);var _0x104237={'where':_0x57b315[_0x578d('0x44')]};return db[_0x578d('0x34')][_0x578d('0x20')](_0x104237)[_0x578d('0x29')](function(_0x252057){_0x279348[_0x578d('0x20')]=_0x252057;if(_0x2b551b['query']['includeAll']){_0x57b315['include']=[{'all':!![]}];}return db['SmsQueue'][_0x578d('0x49')](_0x57b315);})[_0x578d('0x29')](function(_0x1ba269){_0x279348[_0x578d('0x4a')]=_0x1ba269;return _0x279348;})[_0x578d('0x29')](respondWithFilteredResult(_0x244cd4,_0x57b315))['catch'](handleError(_0x244cd4,null));};exports[_0x578d('0x4b')]=function(_0x35170d,_0x3e7114){var _0x335cd3={'raw':!![],'where':{'id':_0x35170d['params']['id']}},_0x49b27b={};_0x49b27b[_0x578d('0x39')]=_['keys'](db[_0x578d('0x34')][_0x578d('0x35')]);_0x49b27b['query']=_[_0x578d('0x4c')](_0x35170d[_0x578d('0x3b')]);_0x49b27b['filters']=_['intersection'](_0x49b27b[_0x578d('0x39')],_0x49b27b[_0x578d('0x3b')]);_0x335cd3[_0x578d('0x3d')]=_[_0x578d('0x3e')](_0x49b27b[_0x578d('0x39')],qs[_0x578d('0x3f')](_0x35170d[_0x578d('0x3b')][_0x578d('0x3f')]));_0x335cd3['attributes']=_0x335cd3[_0x578d('0x3d')][_0x578d('0x4d')]?_0x335cd3[_0x578d('0x3d')]:_0x49b27b[_0x578d('0x39')];if(_0x35170d[_0x578d('0x3b')]['includeAll']){_0x335cd3[_0x578d('0x4e')]=[{'all':!![]}];}_0x335cd3=_['merge']({},_0x335cd3,_0x35170d['options']);return db['SmsQueue'][_0x578d('0x4f')](_0x335cd3)[_0x578d('0x29')](handleEntityNotFound(_0x3e7114,null))[_0x578d('0x29')](respondWithResult(_0x3e7114,null))[_0x578d('0x50')](handleError(_0x3e7114,null));};exports[_0x578d('0x51')]=function(_0xc5e633,_0x179488){return db[_0x578d('0x34')][_0x578d('0x51')](_0xc5e633[_0x578d('0x52')],{})[_0x578d('0x29')](function(_0x4c3a7b){var _0x4ba0cb=_0xc5e633[_0x578d('0x53')][_0x578d('0x2b')]({'plain':!![]});if(!_0x4ba0cb)throw new Error(_0x578d('0x54'));if(_0x4ba0cb['role']==='user'){var _0x5b752c=_0x4c3a7b[_0x578d('0x2b')]({'plain':!![]});var _0x5d1f98=_0x578d('0x2c');return db[_0x578d('0x55')][_0x578d('0x4f')]({'where':{'name':_0x5d1f98,'userProfileId':_0x4ba0cb['userProfileId']},'raw':!![]})[_0x578d('0x29')](function(_0x39d624){if(_0x39d624&&_0x39d624['autoAssociation']===0x0){return db['UserProfileResource'][_0x578d('0x51')]({'name':_0x5b752c[_0x578d('0x31')],'resourceId':_0x5b752c['id'],'type':_0x39d624[_0x578d('0x31')],'sectionId':_0x39d624['id']},{})['then'](function(){return _0x4c3a7b;});}else{return _0x4c3a7b;}})[_0x578d('0x50')](function(_0x1f4cdc){logger[_0x578d('0x2f')](_0x578d('0x56'),_0x1f4cdc);throw _0x1f4cdc;});}return _0x4c3a7b;})[_0x578d('0x29')](respondWithResult(_0x179488,0xc9))['catch'](handleError(_0x179488,null));};exports[_0x578d('0x28')]=function(_0x476c3e,_0x155250){if(_0x476c3e['body']['id']){delete _0x476c3e['body']['id'];}return db[_0x578d('0x34')][_0x578d('0x4f')]({'where':{'id':_0x476c3e[_0x578d('0x57')]['id']}})[_0x578d('0x29')](handleEntityNotFound(_0x155250,null))[_0x578d('0x29')](saveUpdates(_0x476c3e['body'],null))[_0x578d('0x29')](respondWithResult(_0x155250,null))[_0x578d('0x50')](handleError(_0x155250,null));};exports[_0x578d('0x2a')]=function(_0x3c0d6a,_0x4018bb){return db[_0x578d('0x34')][_0x578d('0x4f')]({'where':{'id':_0x3c0d6a[_0x578d('0x57')]['id']}})[_0x578d('0x29')](handleEntityNotFound(_0x4018bb,null))['then'](removeEntity(_0x4018bb,null))[_0x578d('0x50')](handleError(_0x4018bb,null));};exports[_0x578d('0x58')]=function(_0x577e4f,_0x19b37e){return db[_0x578d('0x34')][_0x578d('0x58')]()[_0x578d('0x29')](respondWithResult(_0x19b37e,null))[_0x578d('0x50')](handleError(_0x19b37e,null));};exports['getMembers']=function(_0x113654,_0x4670b7,_0x520589){var _0x12fffe={'raw':!![],'where':{}},_0x513fce={},_0x2c35b0;return db[_0x578d('0x34')][_0x578d('0x59')]({'where':{'id':_0x113654[_0x578d('0x57')]['id']}})[_0x578d('0x29')](handleEntityNotFound(_0x4670b7,null))['then'](function(_0x5606ca){if(_0x5606ca){_0x2c35b0=_0x5606ca[_0x578d('0x2b')]({'plain':!![]});_0x513fce['model']=_[_0x578d('0x4c')](db[_0x578d('0x5a')][_0x578d('0x35')]);_0x513fce[_0x578d('0x3b')]=_['keys'](_0x113654['query']);_0x513fce['filters']=_[_0x578d('0x3e')](_0x513fce[_0x578d('0x39')],_0x513fce[_0x578d('0x3b')]);_0x12fffe[_0x578d('0x3d')]=_[_0x578d('0x3e')](_0x513fce[_0x578d('0x39')],qs['fields'](_0x113654[_0x578d('0x3b')][_0x578d('0x3f')]));_0x12fffe['attributes']=_0x12fffe[_0x578d('0x3d')][_0x578d('0x4d')]?_0x12fffe[_0x578d('0x3d')]:_0x513fce[_0x578d('0x39')];if(!_0x113654['query'][_0x578d('0x40')](_0x578d('0x41'))){_0x12fffe['limit']=qs[_0x578d('0x21')](_0x113654[_0x578d('0x3b')][_0x578d('0x21')]);_0x12fffe[_0x578d('0x1e')]=qs[_0x578d('0x1e')](_0x113654[_0x578d('0x3b')][_0x578d('0x1e')]);}_0x12fffe['order']=qs['sort'](_0x113654[_0x578d('0x3b')][_0x578d('0x43')]);_0x12fffe[_0x578d('0x44')]=qs['filters'](_[_0x578d('0x5b')](_0x113654[_0x578d('0x3b')],_0x513fce['filters']));_0x12fffe[_0x578d('0x44')]['SmsQueueId']=_0x5606ca['id'];if(_0x113654[_0x578d('0x3b')]['filter']){_0x12fffe[_0x578d('0x44')]=_['merge'](_0x12fffe[_0x578d('0x44')],{'$or':_['map'](_0x12fffe[_0x578d('0x3d')],function(_0x1f953c){var _0x1b7f11={};_0x1b7f11[_0x1f953c]={'$like':'%'+_0x113654['query'][_0x578d('0x45')]+'%'};return _0x1b7f11;})});}_0x12fffe=_[_0x578d('0x46')]({},_0x12fffe,_0x113654[_0x578d('0x48')]);return db['UserSmsQueue'][_0x578d('0x49')](_0x12fffe);}})[_0x578d('0x29')](function(_0x36e8cf){if(_0x36e8cf){return db['User'][_0x578d('0x5c')]({'where':{'id':_[_0x578d('0x3a')](_0x36e8cf,_0x578d('0x5d')),'role':'agent'},'attributes':['id','name','smsPause',_0x578d('0x5e'),_0x578d('0x5f')]});}})[_0x578d('0x29')](function(_0x311e80){if(_0x311e80){return{'count':_0x311e80[_0x578d('0x20')],'rows':_[_0x578d('0x3a')](_0x311e80['rows'],function(_0x3a3b87){return{'membername':_0x3a3b87[_0x578d('0x31')],'UserId':_0x3a3b87['id'],'queue_name':_0x2c35b0[_0x578d('0x31')],'SmsQueueId':_0x2c35b0['id'],'interface':util[_0x578d('0x60')](_0x578d('0x61'),_0x578d('0x62'),_0x3a3b87[_0x578d('0x31')]),'penalty':0x0,'paused':_0x3a3b87[_0x578d('0x63')],'createdAt':_0x3a3b87[_0x578d('0x5f')],'updatedAt':_0x3a3b87[_0x578d('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x578d('0x29')](respondWithFilteredResult(_0x4670b7,_0x12fffe))[_0x578d('0x50')](handleError(_0x4670b7,null));};exports['getTeams']=function(_0x32239e,_0xda6222,_0x5a2b6b){var _0x37b7dc={};var _0x531b31={};var _0x4b255c;var _0x50f4ea;return db['SmsQueue']['findOne']({'where':{'id':_0x32239e[_0x578d('0x57')]['id']}})[_0x578d('0x29')](handleEntityNotFound(_0xda6222,null))[_0x578d('0x29')](function(_0x41916d){if(_0x41916d){_0x4b255c=_0x41916d;_0x531b31['model']=_[_0x578d('0x4c')](db[_0x578d('0x64')][_0x578d('0x35')]);_0x531b31[_0x578d('0x3b')]=_[_0x578d('0x4c')](_0x32239e['query']);_0x531b31[_0x578d('0x3c')]=_[_0x578d('0x3e')](_0x531b31[_0x578d('0x39')],_0x531b31['query']);_0x37b7dc[_0x578d('0x3d')]=_['intersection'](_0x531b31[_0x578d('0x39')],qs[_0x578d('0x3f')](_0x32239e[_0x578d('0x3b')][_0x578d('0x3f')]));_0x37b7dc['attributes']=_0x37b7dc[_0x578d('0x3d')][_0x578d('0x4d')]?_0x37b7dc['attributes']:_0x531b31[_0x578d('0x39')];_0x37b7dc[_0x578d('0x42')]=qs[_0x578d('0x43')](_0x32239e[_0x578d('0x3b')][_0x578d('0x43')]);_0x37b7dc[_0x578d('0x44')]=qs[_0x578d('0x3c')](_[_0x578d('0x5b')](_0x32239e[_0x578d('0x3b')],_0x531b31[_0x578d('0x3c')]));if(_0x32239e[_0x578d('0x3b')][_0x578d('0x45')]){_0x37b7dc[_0x578d('0x44')]=_[_0x578d('0x46')](_0x37b7dc[_0x578d('0x44')],{'$or':_[_0x578d('0x3a')](_0x37b7dc[_0x578d('0x3d')],function(_0x5b3450){var _0x303a00={};_0x303a00[_0x5b3450]={'$like':'%'+_0x32239e[_0x578d('0x3b')][_0x578d('0x45')]+'%'};return _0x303a00;})});}_0x37b7dc=_[_0x578d('0x46')]({},_0x37b7dc,_0x32239e['options']);return _0x4b255c[_0x578d('0x65')](_0x37b7dc);}})[_0x578d('0x29')](function(_0x48d04b){if(_0x48d04b){_0x50f4ea=_0x48d04b[_0x578d('0x4d')];if(!_0x32239e['query']['hasOwnProperty'](_0x578d('0x41'))){_0x37b7dc[_0x578d('0x21')]=qs[_0x578d('0x21')](_0x32239e[_0x578d('0x3b')][_0x578d('0x21')]);_0x37b7dc['offset']=qs[_0x578d('0x1e')](_0x32239e['query'][_0x578d('0x1e')]);}return _0x4b255c[_0x578d('0x65')](_0x37b7dc);}})['then'](function(_0x571407){if(_0x571407){return _0x571407?{'count':_0x50f4ea,'rows':_0x571407}:null;}})[_0x578d('0x29')](respondWithResult(_0xda6222,null))[_0x578d('0x50')](handleError(_0xda6222,null));};exports[_0x578d('0x66')]=function(_0x54f5fb,_0x280513,_0x1887c3){var _0x370f13=_0x54f5fb['body'][_0x578d('0x67')];return db[_0x578d('0x64')][_0x578d('0x49')]({'where':{'id':_0x370f13},'attributes':['id'],'include':[{'model':db[_0x578d('0x68')],'as':'Agents','attributes':['id',_0x578d('0x31'),_0x578d('0x69'),_0x578d('0x6a'),_0x578d('0x6b')],'raw':!![]}]})[_0x578d('0x29')](function(_0x589586){if(_0x589586){var _0x178372=_[_0x578d('0x6c')](_0x589586,function(_0x1b1732){var _0x59862f=_0x1b1732[_0x578d('0x2b')]({'plain':!![]});return _0x59862f[_0x578d('0x6d')];});return db[_0x578d('0x34')][_0x578d('0x4f')]({'where':{'id':_0x54f5fb[_0x578d('0x57')]['id']}})['then'](function(_0x566cff){return db['sequelize'][_0x578d('0x6e')](function(_0x11e947){return _0x566cff['addTeams'](_0x370f13,{'transaction':_0x11e947})[_0x578d('0x29')](function(){return BPromise['each'](_0x178372,function(_0x4b9986){return db[_0x578d('0x5a')][_0x578d('0x6f')]({'where':{'UserId':_0x4b9986['id'],'SmsQueueId':_0x54f5fb[_0x578d('0x57')]['id']},'transaction':_0x11e947});});})[_0x578d('0x29')](function(){_0x178372[_0x578d('0x70')](function(_0x33f01d){socket[_0x578d('0x71')]('userSmsQueue:save',{'UserId':_0x33f01d['id'],'SmsQueueId':_0x566cff['id']});});});});});}})[_0x578d('0x29')](respondWithStatusCode(_0x280513,null))['catch'](handleError(_0x280513,null));};exports[_0x578d('0x72')]=function(_0x4134d4,_0x1d3eed,_0x449d2d){return db[_0x578d('0x64')]['findAll']({'where':{'id':_0x4134d4['query'][_0x578d('0x67')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x578d('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x578d('0x29')](handleEntityNotFound(_0x1d3eed,null))[_0x578d('0x29')](function(_0x20a954){var _0x465852=_['map'](_0x20a954,'id');var _0x5c7331=[];var _0x55edb1=[];var _0x3b4bdf=squel[_0x578d('0x73')]();_0x3b4bdf[_0x578d('0x74')]('tq.TeamId')[_0x578d('0x75')]('team_has_sms_queues','tq')[_0x578d('0x76')](_0x578d('0x77'),'ut',_0x578d('0x78'))[_0x578d('0x44')](_0x578d('0x79'),_0x4134d4[_0x578d('0x57')]['id']);for(var _0x31ef7d=0x0;_0x31ef7d<_0x20a954['length'];_0x31ef7d+=0x1){let _0x23898f=_0x20a954[_0x31ef7d];for(var _0x210e9f=0x0;_0x210e9f<_0x23898f[_0x578d('0x6d')][_0x578d('0x4d')];_0x210e9f+=0x1){let _0x3c9d88=_0x23898f['Agents'][_0x210e9f];var _0x1b489d=_0x3b4bdf['clone']();_0x1b489d['where'](_0x578d('0x7a'),_0x3c9d88['id']);_0x55edb1[_0x578d('0x7b')](db[_0x578d('0x7c')][_0x578d('0x3b')](_0x1b489d[_0x578d('0x7d')](),{'type':db[_0x578d('0x7c')][_0x578d('0x7e')]['SELECT']})['then'](function(_0x44b967){if(_0x44b967[_0x578d('0x4d')]===0x1){return _0x3c9d88['id'];}else{var _0x30c523=_[_0x578d('0x7f')](_[_0x578d('0x3a')](_0x44b967,_0x578d('0x80')),function(_0x28af19){return _[_0x578d('0x81')](_0x465852,_0x28af19);});if(_0x30c523){return _0x3c9d88['id'];}}}));}}return BPromise[_0x578d('0x82')](_0x55edb1)['then'](function(_0x553066){_0x5c7331=_(_0x5c7331)[_0x578d('0x83')](_0x553066)[_0x578d('0x84')]()['value']();return db['SmsQueue'][_0x578d('0x4f')]({'where':{'id':_0x4134d4[_0x578d('0x57')]['id']}})[_0x578d('0x29')](function(_0x17b1a3){return db[_0x578d('0x7c')][_0x578d('0x6e')](function(_0x5bfd07){return _0x17b1a3[_0x578d('0x72')](_0x4134d4['query'][_0x578d('0x67')],{'transaction':_0x5bfd07})[_0x578d('0x29')](function(){if(!_['isEmpty'](_0x5c7331)){return _0x17b1a3[_0x578d('0x85')](_0x5c7331,{'transaction':_0x5bfd07});}})[_0x578d('0x29')](function(){_0x5c7331[_0x578d('0x70')](function(_0x4975a6){socket[_0x578d('0x71')]('userSmsQueue:remove',{'UserId':_0x4975a6,'SmsQueueId':_0x17b1a3['id']});});});});});});})['then'](respondWithStatusCode(_0x1d3eed,null))[_0x578d('0x50')](handleError(_0x1d3eed,null));};exports[_0x578d('0x86')]=function(_0x2eee5d,_0x42bcc7,_0x2d919e){return db[_0x578d('0x34')][_0x578d('0x4f')]({'where':{'id':_0x2eee5d[_0x578d('0x57')]['id']}})[_0x578d('0x29')](handleEntityNotFound(_0x42bcc7,null))[_0x578d('0x29')](function(_0xe42534){if(_0xe42534){return _0xe42534['addAgents'](_0x2eee5d['body']['ids'],_[_0x578d('0x87')](_0x2eee5d[_0x578d('0x52')],[_0x578d('0x67'),'id'])||{})[_0x578d('0x88')](function(_0x42776e){for(var _0x483796=0x0;_0x483796<_0x2eee5d['body'][_0x578d('0x67')][_0x578d('0x4d')];_0x483796+=0x1){socket[_0x578d('0x71')]('userSmsQueue:save',{'UserId':Number(_0x2eee5d['body'][_0x578d('0x67')][_0x483796]),'SmsQueueId':Number(_0x2eee5d[_0x578d('0x57')]['id'])});}return _0x42776e;});}})[_0x578d('0x29')](respondWithResult(_0x42bcc7,null))[_0x578d('0x50')](handleError(_0x42bcc7,null));};exports['removeAgents']=function(_0x22c98f,_0x21d318,_0x36bfe1){return db[_0x578d('0x34')][_0x578d('0x4f')]({'where':{'id':_0x22c98f['params']['id']}})[_0x578d('0x29')](handleEntityNotFound(_0x21d318,null))[_0x578d('0x29')](function(_0x309351){if(_0x309351){return _0x309351[_0x578d('0x85')](_0x22c98f[_0x578d('0x3b')][_0x578d('0x67')])[_0x578d('0x29')](function(){if(_[_0x578d('0x89')](_0x22c98f[_0x578d('0x3b')]['ids'])){for(var _0xfb1ec7=0x0;_0xfb1ec7<_0x22c98f[_0x578d('0x3b')][_0x578d('0x67')][_0x578d('0x4d')];_0xfb1ec7+=0x1){socket[_0x578d('0x71')](_0x578d('0x8a'),{'UserId':Number(_0x22c98f[_0x578d('0x3b')][_0x578d('0x67')][_0xfb1ec7]),'SmsQueueId':Number(_0x22c98f[_0x578d('0x57')]['id'])});}}else{socket[_0x578d('0x71')](_0x578d('0x8a'),{'UserId':Number(_0x22c98f[_0x578d('0x3b')][_0x578d('0x67')]),'SmsQueueId':Number(_0x22c98f[_0x578d('0x57')]['id'])});}});}})[_0x578d('0x29')](respondWithStatusCode(_0x21d318,null))['catch'](handleError(_0x21d318,null));};exports[_0x578d('0x8b')]=function(_0x27d358,_0x25855,_0x52f3a1){var _0x18f17f={};var _0x3937fe={};var _0x19c1b5;var _0x345d6e;return db[_0x578d('0x34')][_0x578d('0x59')]({'where':{'id':_0x27d358[_0x578d('0x57')]['id']}})[_0x578d('0x29')](handleEntityNotFound(_0x25855,null))['then'](function(_0x50ad8f){if(_0x50ad8f){_0x19c1b5=_0x50ad8f;_0x3937fe['model']=_['keys'](db['User'][_0x578d('0x35')]);_0x3937fe['query']=_['keys'](_0x27d358[_0x578d('0x3b')]);_0x3937fe['filters']=_[_0x578d('0x3e')](_0x3937fe[_0x578d('0x39')],_0x3937fe['query']);_0x18f17f[_0x578d('0x3d')]=_[_0x578d('0x3e')](_0x3937fe[_0x578d('0x39')],qs[_0x578d('0x3f')](_0x27d358[_0x578d('0x3b')][_0x578d('0x3f')]));_0x18f17f[_0x578d('0x3d')]=_0x18f17f[_0x578d('0x3d')]['length']?_0x18f17f['attributes']:_0x3937fe[_0x578d('0x39')];_0x18f17f[_0x578d('0x42')]=qs['sort'](_0x27d358[_0x578d('0x3b')][_0x578d('0x43')]);_0x18f17f[_0x578d('0x44')]=qs[_0x578d('0x3c')](_[_0x578d('0x5b')](_0x27d358[_0x578d('0x3b')],_0x3937fe[_0x578d('0x3c')]));if(_0x27d358[_0x578d('0x3b')][_0x578d('0x45')]){_0x18f17f['where']=_[_0x578d('0x46')](_0x18f17f[_0x578d('0x44')],{'$or':_['map'](_0x18f17f[_0x578d('0x3d')],function(_0x114a44){var _0x2f5afd={};_0x2f5afd[_0x114a44]={'$like':'%'+_0x27d358['query']['filter']+'%'};return _0x2f5afd;})});}_0x18f17f=_[_0x578d('0x46')]({},_0x18f17f,_0x27d358[_0x578d('0x48')]);return _0x19c1b5['getAgents'](_0x18f17f);}})[_0x578d('0x29')](function(_0x75bfa9){if(_0x75bfa9){_0x345d6e=_0x75bfa9[_0x578d('0x4d')];if(!_0x27d358[_0x578d('0x3b')][_0x578d('0x40')](_0x578d('0x41'))){_0x18f17f[_0x578d('0x21')]=qs['limit'](_0x27d358['query'][_0x578d('0x21')]);_0x18f17f[_0x578d('0x1e')]=qs['offset'](_0x27d358[_0x578d('0x3b')]['offset']);}return _0x19c1b5[_0x578d('0x8b')](_0x18f17f);}})[_0x578d('0x29')](function(_0x2b01f3){if(_0x2b01f3){return _0x2b01f3?{'count':_0x345d6e,'rows':_0x2b01f3}:null;}})[_0x578d('0x29')](respondWithResult(_0x25855,null))[_0x578d('0x50')](handleError(_0x25855,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 1022f4a..194b5bc 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 _0xa2d1=['emit','hasOwnProperty','hook','exports','../../mysqldb','SmsQueue','setMaxListeners','remove'];(function(_0x5349f9,_0x306fd3){var _0x526ced=function(_0x39ce84){while(--_0x39ce84){_0x5349f9['push'](_0x5349f9['shift']());}};_0x526ced(++_0x306fd3);}(_0xa2d1,0x94));var _0x1a2d=function(_0x40e854,_0x42f1f6){_0x40e854=_0x40e854-0x0;var _0x1463b3=_0xa2d1[_0x40e854];return _0x1463b3;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x1a2d('0x0'))['db'][_0x1a2d('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x1a2d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1a2d('0x3')};function emitEvent(_0x3adcfe){return function(_0x4c72dd,_0x3a4e8c,_0x2fd57b){SmsQueueEvents[_0x1a2d('0x4')](_0x3adcfe+':'+_0x4c72dd['id'],_0x4c72dd);SmsQueueEvents[_0x1a2d('0x4')](_0x3adcfe,_0x4c72dd);_0x2fd57b(null);};}for(var e in events){if(events[_0x1a2d('0x5')](e)){var event=events[e];SmsQueue[_0x1a2d('0x6')](e,emitEvent(event));}}module[_0x1a2d('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0x81be=['events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit','hook'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x81be,0x6c));var _0xe81b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x81be[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0xe81b('0x0'));var SmsQueue=require(_0xe81b('0x1'))['db'][_0xe81b('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xe81b('0x3')](0x0);var events={'afterCreate':_0xe81b('0x4'),'afterUpdate':_0xe81b('0x5'),'afterDestroy':_0xe81b('0x6')};function emitEvent(_0x24145b){return function(_0x468fe4,_0x2bb787,_0x4ff48e){SmsQueueEvents['emit'](_0x24145b+':'+_0x468fe4['id'],_0x468fe4);SmsQueueEvents[_0xe81b('0x7')](_0x24145b,_0x468fe4);_0x4ff48e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xe81b('0x8')](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 656d907..858a358 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 _0xdd63=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash'];(function(_0x9d73ab,_0x1817de){var _0x1df342=function(_0x46783f){while(--_0x46783f){_0x9d73ab['push'](_0x9d73ab['shift']());}};_0x1df342(++_0x1817de);}(_0xdd63,0x1b1));var _0x3dd6=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xdd63[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0x3dd6('0x0'));var util=require(_0x3dd6('0x1'));var logger=require(_0x3dd6('0x2'))('api');var moment=require(_0x3dd6('0x3'));var BPromise=require(_0x3dd6('0x4'));var rp=require(_0x3dd6('0x5'));var fs=require('fs');var path=require(_0x3dd6('0x6'));var rimraf=require(_0x3dd6('0x7'));var config=require(_0x3dd6('0x8'));var attributes=require(_0x3dd6('0x9'));module[_0x3dd6('0xa')]=function(_0x52f589,_0x4a440e){return _0x52f589[_0x3dd6('0xb')](_0x3dd6('0xc'),attributes,{'tableName':_0x3dd6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x84e6=['util','../../config/logger','api','request-promise','path','../../config/environment','exports','define','SmsQueue','lodash'];(function(_0x602ca8,_0x568e82){var _0x26e8ab=function(_0x3fb700){while(--_0x3fb700){_0x602ca8['push'](_0x602ca8['shift']());}};_0x26e8ab(++_0x568e82);}(_0x84e6,0x1e9));var _0x684e=function(_0x3c62d2,_0x4042d3){_0x3c62d2=_0x3c62d2-0x0;var _0x2b966b=_0x84e6[_0x3c62d2];return _0x2b966b;};'use strict';var _=require(_0x684e('0x0'));var util=require(_0x684e('0x1'));var logger=require(_0x684e('0x2'))(_0x684e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x684e('0x4'));var fs=require('fs');var path=require(_0x684e('0x5'));var rimraf=require('rimraf');var config=require(_0x684e('0x6'));var attributes=require('./smsQueue.attributes');module[_0x684e('0x7')]=function(_0x357d53,_0x24756e){return _0x357d53[_0x684e('0x8')](_0x684e('0x9'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 10bb0fa..e7bc5df 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 _0x8b40=['attributes','map','stringify','ShowSmsQueue','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','then','info','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','limit','include','model'];(function(_0x3c0cd6,_0x5ba428){var _0x4381ec=function(_0x2ab4b3){while(--_0x2ab4b3){_0x3c0cd6['push'](_0x3c0cd6['shift']());}};_0x4381ec(++_0x5ba428);}(_0x8b40,0x124));var _0x08b4=function(_0x2a245c,_0x961888){_0x2a245c=_0x2a245c-0x0;var _0xcafb26=_0x8b40[_0x2a245c];return _0xcafb26;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x08b4('0x0'));var BPromise=require(_0x08b4('0x1'));var rs=require(_0x08b4('0x2'));var fs=require('fs');var Redis=require(_0x08b4('0x3'));var db=require(_0x08b4('0x4'))['db'];var utils=require(_0x08b4('0x5'));var logger=require(_0x08b4('0x6'))(_0x08b4('0x7'));var config=require(_0x08b4('0x8'));var jayson=require(_0x08b4('0x9'));var client=jayson[_0x08b4('0xa')][_0x08b4('0xb')]({'port':0x232a});config[_0x08b4('0xc')]=_[_0x08b4('0xd')](config[_0x08b4('0xc')],{'host':_0x08b4('0xe'),'port':0x18eb});var socket=require(_0x08b4('0xf'))(new Redis(config[_0x08b4('0xc')]));require(_0x08b4('0x10'))['register'](socket);function respondWithRpcPromise(_0x108ffb,_0x2d8513,_0x5e8c84){return new BPromise(function(_0x58d856,_0x197681){return client['request'](_0x108ffb,_0x5e8c84)[_0x08b4('0x11')](function(_0x286c94){logger[_0x08b4('0x12')](_0x08b4('0x13'),_0x2d8513,'request\x20sent');logger[_0x08b4('0x14')](_0x08b4('0x15'),_0x2d8513,'request\x20sent',JSON['stringify'](_0x286c94));if(_0x286c94[_0x08b4('0x16')]){if(_0x286c94[_0x08b4('0x16')][_0x08b4('0x17')]===0x1f4){logger[_0x08b4('0x16')](_0x08b4('0x13'),_0x2d8513,_0x286c94['error'][_0x08b4('0x18')]);return _0x197681(_0x286c94[_0x08b4('0x16')][_0x08b4('0x18')]);}logger[_0x08b4('0x16')]('SmsQueue,\x20%s,\x20%s',_0x2d8513,_0x286c94['error'][_0x08b4('0x18')]);return _0x58d856(_0x286c94[_0x08b4('0x16')][_0x08b4('0x18')]);}else{logger[_0x08b4('0x12')]('SmsQueue,\x20%s,\x20%s',_0x2d8513,_0x08b4('0x19'));_0x58d856(_0x286c94['result'][_0x08b4('0x18')]);}})[_0x08b4('0x1a')](function(_0x335224){logger[_0x08b4('0x16')](_0x08b4('0x13'),_0x2d8513,_0x335224);_0x197681(_0x335224);});});}exports[_0x08b4('0x1b')]=function(_0x52bf2c){var _0x5a5c61=this;return new Promise(function(_0x581940,_0x2e752e){return db[_0x08b4('0x1c')][_0x08b4('0x1d')]({'raw':_0x52bf2c[_0x08b4('0x1e')]?_0x52bf2c[_0x08b4('0x1e')][_0x08b4('0x1f')]===undefined?!![]:![]:!![],'where':_0x52bf2c['options']?_0x52bf2c[_0x08b4('0x1e')][_0x08b4('0x20')]||null:null,'attributes':_0x52bf2c[_0x08b4('0x1e')]?_0x52bf2c[_0x08b4('0x1e')]['attributes']||null:null,'limit':_0x52bf2c[_0x08b4('0x1e')]?_0x52bf2c[_0x08b4('0x1e')][_0x08b4('0x21')]||null:null,'include':_0x52bf2c[_0x08b4('0x1e')]?_0x52bf2c['options']['include']?_['map'](_0x52bf2c[_0x08b4('0x1e')][_0x08b4('0x22')],function(_0x5e2983){return{'model':db[_0x5e2983[_0x08b4('0x23')]],'as':_0x5e2983['as'],'attributes':_0x5e2983[_0x08b4('0x24')],'include':_0x5e2983[_0x08b4('0x22')]?_[_0x08b4('0x25')](_0x5e2983[_0x08b4('0x22')],function(_0x34eafa){return{'model':db[_0x34eafa[_0x08b4('0x23')]],'as':_0x34eafa['as'],'attributes':_0x34eafa[_0x08b4('0x24')],'include':_0x34eafa[_0x08b4('0x22')]?_[_0x08b4('0x25')](_0x34eafa[_0x08b4('0x22')],function(_0x2b0164){return{'model':db[_0x2b0164[_0x08b4('0x23')]],'as':_0x2b0164['as'],'attributes':_0x2b0164['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x59235a){logger[_0x08b4('0x12')]('GetSmsQueue',_0x52bf2c);logger[_0x08b4('0x14')](_0x08b4('0x1b'),_0x52bf2c,JSON[_0x08b4('0x26')](_0x59235a));_0x581940(_0x59235a);})['catch'](function(_0x4af778){logger[_0x08b4('0x16')](_0x08b4('0x1b'),_0x4af778[_0x08b4('0x18')],_0x52bf2c);_0x2e752e(_0x5a5c61[_0x08b4('0x16')](0x1f4,_0x4af778[_0x08b4('0x18')]));});});};exports[_0x08b4('0x27')]=function(_0x1b3ed3){var _0x4b7ece=this;return new Promise(function(_0x5abe65,_0x239871){return db[_0x08b4('0x1c')][_0x08b4('0x28')]({'raw':_0x1b3ed3[_0x08b4('0x1e')]?_0x1b3ed3[_0x08b4('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x1b3ed3['options']?_0x1b3ed3[_0x08b4('0x1e')]['where']||null:null,'attributes':_0x1b3ed3['options']?_0x1b3ed3[_0x08b4('0x1e')][_0x08b4('0x24')]||null:null,'include':_0x1b3ed3[_0x08b4('0x1e')]?_0x1b3ed3['options']['include']?_[_0x08b4('0x25')](_0x1b3ed3[_0x08b4('0x1e')][_0x08b4('0x22')],function(_0x541413){return{'model':db[_0x541413[_0x08b4('0x23')]],'as':_0x541413['as'],'attributes':_0x541413[_0x08b4('0x24')],'include':_0x541413['include']?_['map'](_0x541413[_0x08b4('0x22')],function(_0x1009fb){return{'model':db[_0x1009fb[_0x08b4('0x23')]],'as':_0x1009fb['as'],'attributes':_0x1009fb[_0x08b4('0x24')],'include':_0x1009fb['include']?_[_0x08b4('0x25')](_0x1009fb[_0x08b4('0x22')],function(_0x578abd){return{'model':db[_0x578abd[_0x08b4('0x23')]],'as':_0x578abd['as'],'attributes':_0x578abd[_0x08b4('0x24')]};}):[]};}):[]};}):[]:[]})[_0x08b4('0x11')](function(_0x577124){logger['info']('ShowSmsQueue',_0x1b3ed3);logger[_0x08b4('0x14')](_0x08b4('0x27'),_0x1b3ed3,JSON['stringify'](_0x577124));_0x5abe65(_0x577124);})[_0x08b4('0x1a')](function(_0x6ee728){logger[_0x08b4('0x16')](_0x08b4('0x27'),_0x6ee728[_0x08b4('0x18')],_0x1b3ed3);_0x239871(_0x4b7ece[_0x08b4('0x16')](0x1f4,_0x6ee728[_0x08b4('0x18')]));});});}; \ No newline at end of file +var _0x60fa=['result','catch','GetSmsQueue','SmsQueue','findAll','options','where','attributes','limit','include','model','map','ShowSmsQueue','find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','request','then','info','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x1812ab,_0x59c8b1){var _0x53d416=function(_0x490251){while(--_0x490251){_0x1812ab['push'](_0x1812ab['shift']());}};_0x53d416(++_0x59c8b1);}(_0x60fa,0x127));var _0xa60f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x60fa[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa60f('0x0'));var util=require(_0xa60f('0x1'));var moment=require(_0xa60f('0x2'));var BPromise=require(_0xa60f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa60f('0x4'));var db=require(_0xa60f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xa60f('0x6'));var jayson=require(_0xa60f('0x7'));var client=jayson[_0xa60f('0x8')]['http']({'port':0x232a});config['redis']=_[_0xa60f('0x9')](config[_0xa60f('0xa')],{'host':_0xa60f('0xb'),'port':0x18eb});var socket=require(_0xa60f('0xc'))(new Redis(config[_0xa60f('0xa')]));require('./smsQueue.socket')[_0xa60f('0xd')](socket);function respondWithRpcPromise(_0x1f94ef,_0x3f742e,_0x3d3bac){return new BPromise(function(_0x4f288d,_0x484445){return client[_0xa60f('0xe')](_0x1f94ef,_0x3d3bac)[_0xa60f('0xf')](function(_0x53c8c7){logger[_0xa60f('0x10')](_0xa60f('0x11'),_0x3f742e,'request\x20sent');logger[_0xa60f('0x12')](_0xa60f('0x13'),_0x3f742e,_0xa60f('0x14'),JSON[_0xa60f('0x15')](_0x53c8c7));if(_0x53c8c7['error']){if(_0x53c8c7[_0xa60f('0x16')][_0xa60f('0x17')]===0x1f4){logger[_0xa60f('0x16')](_0xa60f('0x11'),_0x3f742e,_0x53c8c7[_0xa60f('0x16')]['message']);return _0x484445(_0x53c8c7['error'][_0xa60f('0x18')]);}logger[_0xa60f('0x16')](_0xa60f('0x11'),_0x3f742e,_0x53c8c7[_0xa60f('0x16')][_0xa60f('0x18')]);return _0x4f288d(_0x53c8c7[_0xa60f('0x16')][_0xa60f('0x18')]);}else{logger['info']('SmsQueue,\x20%s,\x20%s',_0x3f742e,_0xa60f('0x14'));_0x4f288d(_0x53c8c7[_0xa60f('0x19')][_0xa60f('0x18')]);}})[_0xa60f('0x1a')](function(_0x1ad14d){logger['error'](_0xa60f('0x11'),_0x3f742e,_0x1ad14d);_0x484445(_0x1ad14d);});});}exports[_0xa60f('0x1b')]=function(_0x933844){var _0x3c77aa=this;return new Promise(function(_0x23192a,_0x398c4a){return db[_0xa60f('0x1c')][_0xa60f('0x1d')]({'raw':_0x933844[_0xa60f('0x1e')]?_0x933844[_0xa60f('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x933844[_0xa60f('0x1e')]?_0x933844[_0xa60f('0x1e')][_0xa60f('0x1f')]||null:null,'attributes':_0x933844[_0xa60f('0x1e')]?_0x933844[_0xa60f('0x1e')][_0xa60f('0x20')]||null:null,'limit':_0x933844[_0xa60f('0x1e')]?_0x933844[_0xa60f('0x1e')][_0xa60f('0x21')]||null:null,'include':_0x933844[_0xa60f('0x1e')]?_0x933844[_0xa60f('0x1e')][_0xa60f('0x22')]?_['map'](_0x933844[_0xa60f('0x1e')][_0xa60f('0x22')],function(_0x48fd28){return{'model':db[_0x48fd28[_0xa60f('0x23')]],'as':_0x48fd28['as'],'attributes':_0x48fd28[_0xa60f('0x20')],'include':_0x48fd28[_0xa60f('0x22')]?_[_0xa60f('0x24')](_0x48fd28['include'],function(_0x1ccbf5){return{'model':db[_0x1ccbf5[_0xa60f('0x23')]],'as':_0x1ccbf5['as'],'attributes':_0x1ccbf5[_0xa60f('0x20')],'include':_0x1ccbf5['include']?_[_0xa60f('0x24')](_0x1ccbf5[_0xa60f('0x22')],function(_0x510576){return{'model':db[_0x510576['model']],'as':_0x510576['as'],'attributes':_0x510576['attributes']};}):[]};}):[]};}):[]:[]})[_0xa60f('0xf')](function(_0x17a70d){logger['info'](_0xa60f('0x1b'),_0x933844);logger[_0xa60f('0x12')](_0xa60f('0x1b'),_0x933844,JSON[_0xa60f('0x15')](_0x17a70d));_0x23192a(_0x17a70d);})[_0xa60f('0x1a')](function(_0x5d297b){logger[_0xa60f('0x16')](_0xa60f('0x1b'),_0x5d297b[_0xa60f('0x18')],_0x933844);_0x398c4a(_0x3c77aa[_0xa60f('0x16')](0x1f4,_0x5d297b[_0xa60f('0x18')]));});});};exports[_0xa60f('0x25')]=function(_0x465e82){var _0x1ae3e8=this;return new Promise(function(_0x1d57cd,_0x57e803){return db['SmsQueue'][_0xa60f('0x26')]({'raw':_0x465e82['options']?_0x465e82[_0xa60f('0x1e')][_0xa60f('0x27')]===undefined?!![]:![]:!![],'where':_0x465e82[_0xa60f('0x1e')]?_0x465e82['options']['where']||null:null,'attributes':_0x465e82[_0xa60f('0x1e')]?_0x465e82[_0xa60f('0x1e')]['attributes']||null:null,'include':_0x465e82[_0xa60f('0x1e')]?_0x465e82[_0xa60f('0x1e')][_0xa60f('0x22')]?_[_0xa60f('0x24')](_0x465e82['options']['include'],function(_0x46b473){return{'model':db[_0x46b473[_0xa60f('0x23')]],'as':_0x46b473['as'],'attributes':_0x46b473[_0xa60f('0x20')],'include':_0x46b473['include']?_[_0xa60f('0x24')](_0x46b473['include'],function(_0x40f365){return{'model':db[_0x40f365[_0xa60f('0x23')]],'as':_0x40f365['as'],'attributes':_0x40f365['attributes'],'include':_0x40f365[_0xa60f('0x22')]?_[_0xa60f('0x24')](_0x40f365[_0xa60f('0x22')],function(_0x31535f){return{'model':db[_0x31535f[_0xa60f('0x23')]],'as':_0x31535f['as'],'attributes':_0x31535f[_0xa60f('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa60f('0xf')](function(_0x119ff7){logger[_0xa60f('0x10')]('ShowSmsQueue',_0x465e82);logger[_0xa60f('0x12')](_0xa60f('0x25'),_0x465e82,JSON[_0xa60f('0x15')](_0x119ff7));_0x1d57cd(_0x119ff7);})[_0xa60f('0x1a')](function(_0x4e8049){logger['error'](_0xa60f('0x25'),_0x4e8049['message'],_0x465e82);_0x57e803(_0x1ae3e8[_0xa60f('0x16')](0x1f4,_0x4e8049[_0xa60f('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 67ad678..b699ffc 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 _0xc14e=['emit','removeListener','register','length','smsQueue:','save','remove','update'];(function(_0x296ea1,_0x1d8fb4){var _0x513970=function(_0x467a26){while(--_0x467a26){_0x296ea1['push'](_0x296ea1['shift']());}};_0x513970(++_0x1d8fb4);}(_0xc14e,0x1a5));var _0xec14=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc14e[_0x3dd15e];return _0x231fd0;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xec14('0x0'),_0xec14('0x1'),_0xec14('0x2')];function createListener(_0x41a256,_0x4c7ec0){return function(_0x3d7a5f){_0x4c7ec0[_0xec14('0x3')](_0x41a256,_0x3d7a5f);};}function removeListener(_0x3a5e4d,_0x1aea5e){return function(){SmsQueueEvents[_0xec14('0x4')](_0x3a5e4d,_0x1aea5e);};}exports[_0xec14('0x5')]=function(_0x552ff0){for(var _0x103dda=0x0,_0x511f11=events[_0xec14('0x6')];_0x103dda<_0x511f11;_0x103dda++){var _0x3f370a=events[_0x103dda];var _0x55f0fd=createListener(_0xec14('0x7')+_0x3f370a,_0x552ff0);SmsQueueEvents['on'](_0x3f370a,_0x55f0fd);}}; \ No newline at end of file +var _0x12e9=['smsQueue:','./smsQueue.events','save','remove','removeListener','register','length'];(function(_0x479fe1,_0x5179a8){var _0x58ff8b=function(_0x1822b8){while(--_0x1822b8){_0x479fe1['push'](_0x479fe1['shift']());}};_0x58ff8b(++_0x5179a8);}(_0x12e9,0x119));var _0x912e=function(_0x3a47f8,_0x4c9c27){_0x3a47f8=_0x3a47f8-0x0;var _0x154fbf=_0x12e9[_0x3a47f8];return _0x154fbf;};'use strict';var SmsQueueEvents=require(_0x912e('0x0'));var events=[_0x912e('0x1'),_0x912e('0x2'),'update'];function createListener(_0x3be151,_0x42b3c6){return function(_0x1db06e){_0x42b3c6['emit'](_0x3be151,_0x1db06e);};}function removeListener(_0x241590,_0x256c97){return function(){SmsQueueEvents[_0x912e('0x3')](_0x241590,_0x256c97);};}exports[_0x912e('0x4')]=function(_0x2ab034){for(var _0x10d040=0x0,_0x121293=events[_0x912e('0x5')];_0x10d040<_0x121293;_0x10d040++){var _0x1bdca5=events[_0x10d040];var _0x212c12=createListener(_0x912e('0x6')+_0x1bdca5,_0x2ab034);SmsQueueEvents['on'](_0x1bdca5,_0x212c12);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index c9c9e85..1d0db04 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 _0x01e8=['fs-extra','../../components/interaction/service','./smsQueueReport.controller','get','index','/describe','/:id','show','post','create','put','update','delete','isAuthenticated','destroy','multer','util','path','express'];(function(_0x5ef5b2,_0x24d90d){var _0x3390d7=function(_0x345fcd){while(--_0x345fcd){_0x5ef5b2['push'](_0x5ef5b2['shift']());}};_0x3390d7(++_0x24d90d);}(_0x01e8,0x6e));var _0x801e=function(_0x120f00,_0x3e9268){_0x120f00=_0x120f00-0x0;var _0x5c3ce3=_0x01e8[_0x120f00];return _0x5c3ce3;};'use strict';var multer=require(_0x801e('0x0'));var util=require(_0x801e('0x1'));var path=require(_0x801e('0x2'));var timeout=require('connect-timeout');var express=require(_0x801e('0x3'));var router=express['Router']();var fs_extra=require(_0x801e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x801e('0x5'));var config=require('../../config/environment');var controller=require(_0x801e('0x6'));router[_0x801e('0x7')]('/',auth['isAuthenticated'](),controller[_0x801e('0x8')]);router[_0x801e('0x7')](_0x801e('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x801e('0x7')](_0x801e('0xa'),auth['isAuthenticated'](),controller[_0x801e('0xb')]);router[_0x801e('0xc')]('/',auth['isAuthenticated'](),controller[_0x801e('0xd')]);router[_0x801e('0xe')](_0x801e('0xa'),auth['isAuthenticated'](),controller[_0x801e('0xf')]);router[_0x801e('0x10')](_0x801e('0xa'),auth[_0x801e('0x11')](),controller[_0x801e('0x12')]);module['exports']=router; \ No newline at end of file +var _0xd20e=['/:id','show','post','create','put','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xd20e,0x198));var _0xed20=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xd20e[_0x346737];return _0x1ade2e;};'use strict';var multer=require(_0xed20('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xed20('0x1'));var express=require('express');var router=express[_0xed20('0x2')]();var fs_extra=require(_0xed20('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xed20('0x4'));var config=require(_0xed20('0x5'));var controller=require(_0xed20('0x6'));router[_0xed20('0x7')]('/',auth[_0xed20('0x8')](),controller[_0xed20('0x9')]);router[_0xed20('0x7')](_0xed20('0xa'),auth[_0xed20('0x8')](),controller[_0xed20('0xb')]);router[_0xed20('0x7')](_0xed20('0xc'),auth[_0xed20('0x8')](),controller[_0xed20('0xd')]);router[_0xed20('0xe')]('/',auth[_0xed20('0x8')](),controller[_0xed20('0xf')]);router[_0xed20('0x10')](_0xed20('0xc'),auth[_0xed20('0x8')](),controller['update']);router[_0xed20('0x11')](_0xed20('0xc'),auth[_0xed20('0x8')](),controller[_0xed20('0x12')]);module[_0xed20('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index d47f1bd..d16dcb5 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 _0x2480=['STRING','DATE','moment','sequelize','exports'];(function(_0x172f30,_0x42939a){var _0x401a61=function(_0x2f0060){while(--_0x2f0060){_0x172f30['push'](_0x172f30['shift']());}};_0x401a61(++_0x42939a);}(_0x2480,0x1d8));var _0x0248=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x2480[_0x501510];return _0x1e6ee5;};'use strict';var moment=require(_0x0248('0x0'));var Sequelize=require(_0x0248('0x1'));module[_0x0248('0x2')]={'uniqueid':{'type':Sequelize[_0x0248('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0248('0x3')]},'joinAt':{'type':Sequelize[_0x0248('0x4')]},'leaveAt':{'type':Sequelize[_0x0248('0x4')]},'acceptAt':{'type':Sequelize[_0x0248('0x4')]},'exitAt':{'type':Sequelize[_0x0248('0x4')]},'reason':{'type':Sequelize[_0x0248('0x3')]}}; \ No newline at end of file +var _0x6f37=['exports','STRING','DATE','moment','sequelize'];(function(_0x75ce5b,_0x3b582f){var _0x22195e=function(_0x166668){while(--_0x166668){_0x75ce5b['push'](_0x75ce5b['shift']());}};_0x22195e(++_0x3b582f);}(_0x6f37,0x175));var _0x76f3=function(_0x40cdfa,_0x1cf634){_0x40cdfa=_0x40cdfa-0x0;var _0x2c5e4d=_0x6f37[_0x40cdfa];return _0x2c5e4d;};'use strict';var moment=require(_0x76f3('0x0'));var Sequelize=require(_0x76f3('0x1'));module[_0x76f3('0x2')]={'uniqueid':{'type':Sequelize[_0x76f3('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x76f3('0x3')]},'joinAt':{'type':Sequelize[_0x76f3('0x4')]},'leaveAt':{'type':Sequelize[_0x76f3('0x4')]},'acceptAt':{'type':Sequelize[_0x76f3('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x76f3('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 712d90d..9288fd4 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 _0x9500=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../mysqldb','status','end','json','undefined','limit','count','set','Content-Range','reject','save','update','destroy','sendStatus','stack','name','send','index','map','SmsQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','then','include','findAll','rows','catch','params','length','find','create','body','describe','eml-format'];(function(_0x30f5bb,_0x4db4bd){var _0x1cfc00=function(_0x20f833){while(--_0x20f833){_0x30f5bb['push'](_0x30f5bb['shift']());}};_0x1cfc00(++_0x4db4bd);}(_0x9500,0xda));var _0x0950=function(_0x5f4ec0,_0x429819){_0x5f4ec0=_0x5f4ec0-0x0;var _0x3d5a14=_0x9500[_0x5f4ec0];return _0x3d5a14;};'use strict';var emlformat=require(_0x0950('0x0'));var rimraf=require(_0x0950('0x1'));var zipdir=require(_0x0950('0x2'));var jsonpatch=require(_0x0950('0x3'));var rp=require(_0x0950('0x4'));var moment=require(_0x0950('0x5'));var BPromise=require(_0x0950('0x6'));var Mustache=require(_0x0950('0x7'));var util=require('util');var path=require(_0x0950('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0950('0x9'));var fs=require('fs');var fs_extra=require(_0x0950('0xa'));var _=require(_0x0950('0xb'));var squel=require(_0x0950('0xc'));var crypto=require(_0x0950('0xd'));var jsforce=require(_0x0950('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0950('0xf'));var querystring=require(_0x0950('0x10'));var Papa=require(_0x0950('0x11'));var Redis=require(_0x0950('0x12'));var authService=require(_0x0950('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0950('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0950('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0950('0x16'))['db'];function respondWithStatusCode(_0x24ea5e,_0x8dc7d3){_0x8dc7d3=_0x8dc7d3||0xcc;return function(_0x8fc30d){if(_0x8fc30d){return _0x24ea5e['sendStatus'](_0x8dc7d3);}return _0x24ea5e[_0x0950('0x17')](_0x8dc7d3)[_0x0950('0x18')]();};}function respondWithResult(_0x2c165c,_0x89f24b){_0x89f24b=_0x89f24b||0xc8;return function(_0x10ca67){if(_0x10ca67){return _0x2c165c['status'](_0x89f24b)[_0x0950('0x19')](_0x10ca67);}};}function respondWithFilteredResult(_0x566c11,_0xea9f4a){return function(_0x143521){if(_0x143521){var _0x283fc8=typeof _0xea9f4a['offset']===_0x0950('0x1a')&&typeof _0xea9f4a[_0x0950('0x1b')]===_0x0950('0x1a');var _0x39b898=_0x143521[_0x0950('0x1c')];var _0x3b4b1e=_0x283fc8?0x0:_0xea9f4a['offset'];var _0xb02c4c=_0x283fc8?_0x143521[_0x0950('0x1c')]:_0xea9f4a['offset']+_0xea9f4a[_0x0950('0x1b')];var _0x28a2cd;if(_0xb02c4c>=_0x39b898){_0xb02c4c=_0x39b898;_0x28a2cd=0xc8;}else{_0x28a2cd=0xce;}_0x566c11[_0x0950('0x17')](_0x28a2cd);return _0x566c11[_0x0950('0x1d')](_0x0950('0x1e'),_0x3b4b1e+'-'+_0xb02c4c+'/'+_0x39b898)[_0x0950('0x19')](_0x143521);}return null;};}function patchUpdates(_0x1de92c){return function(_0x17f7e0){try{jsonpatch['apply'](_0x17f7e0,_0x1de92c,!![]);}catch(_0x33c401){return BPromise[_0x0950('0x1f')](_0x33c401);}return _0x17f7e0[_0x0950('0x20')]();};}function saveUpdates(_0x4bd2fc,_0x1b093e){return function(_0x171c5c){if(_0x171c5c){return _0x171c5c[_0x0950('0x21')](_0x4bd2fc)['then'](function(_0x58a046){return _0x58a046;});}return null;};}function removeEntity(_0x134739,_0x52a09a){return function(_0x31a671){if(_0x31a671){return _0x31a671[_0x0950('0x22')]()['then'](function(){_0x134739[_0x0950('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31a829,_0x511522){return function(_0x3865bf){if(!_0x3865bf){_0x31a829[_0x0950('0x23')](0x194);}return _0x3865bf;};}function handleError(_0x4f82d5,_0x416961){_0x416961=_0x416961||0x1f4;return function(_0x26c425){logger['error'](_0x26c425[_0x0950('0x24')]);if(_0x26c425[_0x0950('0x25')]){delete _0x26c425[_0x0950('0x25')];}_0x4f82d5[_0x0950('0x17')](_0x416961)[_0x0950('0x26')](_0x26c425);};}exports[_0x0950('0x27')]=function(_0x51a464,_0x31ea6c){var _0x525193={},_0x4df35f={},_0x281900={'count':0x0,'rows':[]};var _0x47258b=_[_0x0950('0x28')](db[_0x0950('0x29')][_0x0950('0x2a')],function(_0x3e27a0){return{'name':_0x3e27a0['fieldName'],'type':_0x3e27a0[_0x0950('0x2b')][_0x0950('0x2c')]};});_0x4df35f[_0x0950('0x2d')]=_[_0x0950('0x28')](_0x47258b,_0x0950('0x25'));_0x4df35f[_0x0950('0x2e')]=_[_0x0950('0x2f')](_0x51a464[_0x0950('0x2e')]);_0x4df35f[_0x0950('0x30')]=_[_0x0950('0x31')](_0x4df35f[_0x0950('0x2d')],_0x4df35f['query']);_0x525193[_0x0950('0x32')]=_['intersection'](_0x4df35f[_0x0950('0x2d')],qs['fields'](_0x51a464['query'][_0x0950('0x33')]));_0x525193[_0x0950('0x32')]=_0x525193['attributes']['length']?_0x525193['attributes']:_0x4df35f[_0x0950('0x2d')];if(!_0x51a464[_0x0950('0x2e')][_0x0950('0x34')]('nolimit')){_0x525193[_0x0950('0x1b')]=qs[_0x0950('0x1b')](_0x51a464[_0x0950('0x2e')][_0x0950('0x1b')]);_0x525193[_0x0950('0x35')]=qs['offset'](_0x51a464[_0x0950('0x2e')][_0x0950('0x35')]);}_0x525193[_0x0950('0x36')]=qs[_0x0950('0x37')](_0x51a464[_0x0950('0x2e')][_0x0950('0x37')]);_0x525193[_0x0950('0x38')]=qs[_0x0950('0x30')](_[_0x0950('0x39')](_0x51a464[_0x0950('0x2e')],_0x4df35f[_0x0950('0x30')]),_0x47258b);if(_0x51a464[_0x0950('0x2e')][_0x0950('0x3a')]){_0x525193[_0x0950('0x38')]=_[_0x0950('0x3b')](_0x525193['where'],{'$or':_[_0x0950('0x28')](_0x47258b,function(_0x2b629f){if(_0x2b629f[_0x0950('0x2b')]!==_0x0950('0x3c')){var _0x1bfdb5={};_0x1bfdb5[_0x2b629f[_0x0950('0x25')]]={'$like':'%'+_0x51a464[_0x0950('0x2e')][_0x0950('0x3a')]+'%'};return _0x1bfdb5;}})});}_0x525193=_[_0x0950('0x3b')]({},_0x525193,_0x51a464[_0x0950('0x3d')]);var _0x20e199={'where':_0x525193[_0x0950('0x38')]};return db[_0x0950('0x29')][_0x0950('0x1c')](_0x20e199)[_0x0950('0x3e')](function(_0x26aa1e){_0x281900[_0x0950('0x1c')]=_0x26aa1e;if(_0x51a464[_0x0950('0x2e')]['includeAll']){_0x525193[_0x0950('0x3f')]=[{'all':!![]}];}return db[_0x0950('0x29')][_0x0950('0x40')](_0x525193);})['then'](function(_0x3b1843){_0x281900[_0x0950('0x41')]=_0x3b1843;return _0x281900;})[_0x0950('0x3e')](respondWithFilteredResult(_0x31ea6c,_0x525193))[_0x0950('0x42')](handleError(_0x31ea6c,null));};exports['show']=function(_0x13bc33,_0x39191c){var _0xfa7138={'raw':!![],'where':{'id':_0x13bc33[_0x0950('0x43')]['id']}},_0x10122c={};_0x10122c[_0x0950('0x2d')]=_[_0x0950('0x2f')](db[_0x0950('0x29')][_0x0950('0x2a')]);_0x10122c['query']=_['keys'](_0x13bc33[_0x0950('0x2e')]);_0x10122c['filters']=_[_0x0950('0x31')](_0x10122c['model'],_0x10122c[_0x0950('0x2e')]);_0xfa7138['attributes']=_['intersection'](_0x10122c['model'],qs[_0x0950('0x33')](_0x13bc33[_0x0950('0x2e')][_0x0950('0x33')]));_0xfa7138[_0x0950('0x32')]=_0xfa7138[_0x0950('0x32')][_0x0950('0x44')]?_0xfa7138['attributes']:_0x10122c[_0x0950('0x2d')];if(_0x13bc33[_0x0950('0x2e')]['includeAll']){_0xfa7138[_0x0950('0x3f')]=[{'all':!![]}];}_0xfa7138=_['merge']({},_0xfa7138,_0x13bc33['options']);return db[_0x0950('0x29')][_0x0950('0x45')](_0xfa7138)[_0x0950('0x3e')](handleEntityNotFound(_0x39191c,null))['then'](respondWithResult(_0x39191c,null))[_0x0950('0x42')](handleError(_0x39191c,null));};exports[_0x0950('0x46')]=function(_0x4a674e,_0xb6cf7){return db[_0x0950('0x29')][_0x0950('0x46')](_0x4a674e[_0x0950('0x47')],{})[_0x0950('0x3e')](respondWithResult(_0xb6cf7,0xc9))[_0x0950('0x42')](handleError(_0xb6cf7,null));};exports[_0x0950('0x21')]=function(_0x2659b8,_0x16234b){if(_0x2659b8[_0x0950('0x47')]['id']){delete _0x2659b8[_0x0950('0x47')]['id'];}return db[_0x0950('0x29')][_0x0950('0x45')]({'where':{'id':_0x2659b8['params']['id']}})['then'](handleEntityNotFound(_0x16234b,null))[_0x0950('0x3e')](saveUpdates(_0x2659b8[_0x0950('0x47')],null))[_0x0950('0x3e')](respondWithResult(_0x16234b,null))[_0x0950('0x42')](handleError(_0x16234b,null));};exports['destroy']=function(_0x2538dd,_0x53c6c2){return db[_0x0950('0x29')][_0x0950('0x45')]({'where':{'id':_0x2538dd[_0x0950('0x43')]['id']}})[_0x0950('0x3e')](handleEntityNotFound(_0x53c6c2,null))[_0x0950('0x3e')](removeEntity(_0x53c6c2,null))['catch'](handleError(_0x53c6c2,null));};exports[_0x0950('0x48')]=function(_0x2227e4,_0x16996c){return db[_0x0950('0x29')][_0x0950('0x48')]()[_0x0950('0x3e')](respondWithResult(_0x16996c,null))[_0x0950('0x42')](handleError(_0x16996c,null));}; \ No newline at end of file +var _0x8821=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','create','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8821,0x8c));var _0x1882=function(_0x3d38ae,_0x51102b){_0x3d38ae=_0x3d38ae-0x0;var _0x3757ee=_0x8821[_0x3d38ae];return _0x3757ee;};'use strict';var emlformat=require(_0x1882('0x0'));var rimraf=require(_0x1882('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1882('0x2'));var moment=require(_0x1882('0x3'));var BPromise=require(_0x1882('0x4'));var Mustache=require(_0x1882('0x5'));var util=require(_0x1882('0x6'));var path=require(_0x1882('0x7'));var sox=require(_0x1882('0x8'));var csv=require(_0x1882('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1882('0xa'));var _=require(_0x1882('0xb'));var squel=require(_0x1882('0xc'));var crypto=require(_0x1882('0xd'));var jsforce=require(_0x1882('0xe'));var deskjs=require(_0x1882('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1882('0x10'));var authService=require(_0x1882('0x11'));var qs=require(_0x1882('0x12'));var as=require(_0x1882('0x13'));var hardwareService=require(_0x1882('0x14'));var logger=require(_0x1882('0x15'))(_0x1882('0x16'));var utils=require(_0x1882('0x17'));var config=require(_0x1882('0x18'));var licenseUtil=require(_0x1882('0x19'));var db=require(_0x1882('0x1a'))['db'];function respondWithStatusCode(_0x34d8e2,_0x2f88df){_0x2f88df=_0x2f88df||0xcc;return function(_0x80f2f4){if(_0x80f2f4){return _0x34d8e2['sendStatus'](_0x2f88df);}return _0x34d8e2[_0x1882('0x1b')](_0x2f88df)[_0x1882('0x1c')]();};}function respondWithResult(_0xe9739a,_0x36eb4b){_0x36eb4b=_0x36eb4b||0xc8;return function(_0x3c7c42){if(_0x3c7c42){return _0xe9739a['status'](_0x36eb4b)[_0x1882('0x1d')](_0x3c7c42);}};}function respondWithFilteredResult(_0x2b96d5,_0x247bd5){return function(_0x219c8e){if(_0x219c8e){var _0x5ccbc4=typeof _0x247bd5[_0x1882('0x1e')]===_0x1882('0x1f')&&typeof _0x247bd5['limit']===_0x1882('0x1f');var _0x4705b0=_0x219c8e[_0x1882('0x20')];var _0x4cd094=_0x5ccbc4?0x0:_0x247bd5['offset'];var _0x1ceb2c=_0x5ccbc4?_0x219c8e[_0x1882('0x20')]:_0x247bd5[_0x1882('0x1e')]+_0x247bd5['limit'];var _0xd59d58;if(_0x1ceb2c>=_0x4705b0){_0x1ceb2c=_0x4705b0;_0xd59d58=0xc8;}else{_0xd59d58=0xce;}_0x2b96d5[_0x1882('0x1b')](_0xd59d58);return _0x2b96d5[_0x1882('0x21')](_0x1882('0x22'),_0x4cd094+'-'+_0x1ceb2c+'/'+_0x4705b0)[_0x1882('0x1d')](_0x219c8e);}return null;};}function patchUpdates(_0x183e34){return function(_0x3dc090){try{jsonpatch[_0x1882('0x23')](_0x3dc090,_0x183e34,!![]);}catch(_0xd9d27a){return BPromise[_0x1882('0x24')](_0xd9d27a);}return _0x3dc090['save']();};}function saveUpdates(_0x5025ba,_0x41cbf9){return function(_0x388269){if(_0x388269){return _0x388269[_0x1882('0x25')](_0x5025ba)[_0x1882('0x26')](function(_0x3a17bf){return _0x3a17bf;});}return null;};}function removeEntity(_0x5a4687,_0x302666){return function(_0x5d321b){if(_0x5d321b){return _0x5d321b[_0x1882('0x27')]()['then'](function(){_0x5a4687[_0x1882('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9e7f5c,_0x157564){return function(_0x4860f5){if(!_0x4860f5){_0x9e7f5c[_0x1882('0x28')](0x194);}return _0x4860f5;};}function handleError(_0x105638,_0x16df9c){_0x16df9c=_0x16df9c||0x1f4;return function(_0x2e6d30){logger[_0x1882('0x29')](_0x2e6d30[_0x1882('0x2a')]);if(_0x2e6d30[_0x1882('0x2b')]){delete _0x2e6d30['name'];}_0x105638[_0x1882('0x1b')](_0x16df9c)[_0x1882('0x2c')](_0x2e6d30);};}exports[_0x1882('0x2d')]=function(_0x4bcf6c,_0x4e0d1e){var _0x495379={},_0x1a4d6a={},_0x43f2da={'count':0x0,'rows':[]};var _0x47ea35=_[_0x1882('0x2e')](db[_0x1882('0x2f')][_0x1882('0x30')],function(_0x30a71b){return{'name':_0x30a71b[_0x1882('0x31')],'type':_0x30a71b['type'][_0x1882('0x32')]};});_0x1a4d6a[_0x1882('0x33')]=_[_0x1882('0x2e')](_0x47ea35,'name');_0x1a4d6a['query']=_[_0x1882('0x34')](_0x4bcf6c['query']);_0x1a4d6a[_0x1882('0x35')]=_['intersection'](_0x1a4d6a[_0x1882('0x33')],_0x1a4d6a['query']);_0x495379['attributes']=_[_0x1882('0x36')](_0x1a4d6a[_0x1882('0x33')],qs['fields'](_0x4bcf6c[_0x1882('0x37')][_0x1882('0x38')]));_0x495379[_0x1882('0x39')]=_0x495379[_0x1882('0x39')][_0x1882('0x3a')]?_0x495379['attributes']:_0x1a4d6a[_0x1882('0x33')];if(!_0x4bcf6c[_0x1882('0x37')][_0x1882('0x3b')](_0x1882('0x3c'))){_0x495379[_0x1882('0x3d')]=qs[_0x1882('0x3d')](_0x4bcf6c[_0x1882('0x37')][_0x1882('0x3d')]);_0x495379[_0x1882('0x1e')]=qs[_0x1882('0x1e')](_0x4bcf6c[_0x1882('0x37')][_0x1882('0x1e')]);}_0x495379[_0x1882('0x3e')]=qs['sort'](_0x4bcf6c[_0x1882('0x37')][_0x1882('0x3f')]);_0x495379['where']=qs[_0x1882('0x35')](_[_0x1882('0x40')](_0x4bcf6c[_0x1882('0x37')],_0x1a4d6a[_0x1882('0x35')]),_0x47ea35);if(_0x4bcf6c[_0x1882('0x37')]['filter']){_0x495379['where']=_[_0x1882('0x41')](_0x495379[_0x1882('0x42')],{'$or':_[_0x1882('0x2e')](_0x47ea35,function(_0x56292a){if(_0x56292a['type']!==_0x1882('0x43')){var _0x34a319={};_0x34a319[_0x56292a['name']]={'$like':'%'+_0x4bcf6c[_0x1882('0x37')][_0x1882('0x44')]+'%'};return _0x34a319;}})});}_0x495379=_[_0x1882('0x41')]({},_0x495379,_0x4bcf6c[_0x1882('0x45')]);var _0x332ea5={'where':_0x495379[_0x1882('0x42')]};return db[_0x1882('0x2f')][_0x1882('0x20')](_0x332ea5)[_0x1882('0x26')](function(_0x2bf347){_0x43f2da[_0x1882('0x20')]=_0x2bf347;if(_0x4bcf6c[_0x1882('0x37')][_0x1882('0x46')]){_0x495379[_0x1882('0x47')]=[{'all':!![]}];}return db[_0x1882('0x2f')][_0x1882('0x48')](_0x495379);})[_0x1882('0x26')](function(_0x5cb9d4){_0x43f2da[_0x1882('0x49')]=_0x5cb9d4;return _0x43f2da;})['then'](respondWithFilteredResult(_0x4e0d1e,_0x495379))[_0x1882('0x4a')](handleError(_0x4e0d1e,null));};exports['show']=function(_0x202b5e,_0x3e62ab){var _0x205e5c={'raw':!![],'where':{'id':_0x202b5e[_0x1882('0x4b')]['id']}},_0x5ed82b={};_0x5ed82b[_0x1882('0x33')]=_['keys'](db[_0x1882('0x2f')][_0x1882('0x30')]);_0x5ed82b[_0x1882('0x37')]=_[_0x1882('0x34')](_0x202b5e[_0x1882('0x37')]);_0x5ed82b[_0x1882('0x35')]=_['intersection'](_0x5ed82b[_0x1882('0x33')],_0x5ed82b[_0x1882('0x37')]);_0x205e5c['attributes']=_[_0x1882('0x36')](_0x5ed82b[_0x1882('0x33')],qs[_0x1882('0x38')](_0x202b5e[_0x1882('0x37')][_0x1882('0x38')]));_0x205e5c['attributes']=_0x205e5c[_0x1882('0x39')][_0x1882('0x3a')]?_0x205e5c[_0x1882('0x39')]:_0x5ed82b[_0x1882('0x33')];if(_0x202b5e[_0x1882('0x37')]['includeAll']){_0x205e5c[_0x1882('0x47')]=[{'all':!![]}];}_0x205e5c=_[_0x1882('0x41')]({},_0x205e5c,_0x202b5e['options']);return db[_0x1882('0x2f')]['find'](_0x205e5c)[_0x1882('0x26')](handleEntityNotFound(_0x3e62ab,null))[_0x1882('0x26')](respondWithResult(_0x3e62ab,null))[_0x1882('0x4a')](handleError(_0x3e62ab,null));};exports[_0x1882('0x4c')]=function(_0x43173c,_0x3a4629){return db[_0x1882('0x2f')][_0x1882('0x4c')](_0x43173c['body'],{})[_0x1882('0x26')](respondWithResult(_0x3a4629,0xc9))[_0x1882('0x4a')](handleError(_0x3a4629,null));};exports['update']=function(_0x3551be,_0x3b3933){if(_0x3551be[_0x1882('0x4d')]['id']){delete _0x3551be[_0x1882('0x4d')]['id'];}return db[_0x1882('0x2f')][_0x1882('0x4e')]({'where':{'id':_0x3551be[_0x1882('0x4b')]['id']}})[_0x1882('0x26')](handleEntityNotFound(_0x3b3933,null))[_0x1882('0x26')](saveUpdates(_0x3551be[_0x1882('0x4d')],null))['then'](respondWithResult(_0x3b3933,null))[_0x1882('0x4a')](handleError(_0x3b3933,null));};exports[_0x1882('0x27')]=function(_0x2f4b0b,_0x5f03f7){return db[_0x1882('0x2f')][_0x1882('0x4e')]({'where':{'id':_0x2f4b0b[_0x1882('0x4b')]['id']}})[_0x1882('0x26')](handleEntityNotFound(_0x5f03f7,null))[_0x1882('0x26')](removeEntity(_0x5f03f7,null))['catch'](handleError(_0x5f03f7,null));};exports['describe']=function(_0x3b78a2,_0x346144){return db[_0x1882('0x2f')][_0x1882('0x4f')]()[_0x1882('0x26')](respondWithResult(_0x346144,null))['catch'](handleError(_0x346144,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 0ec5068..632b54d 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 _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x3a058d,_0x19965b){var _0x4eb55c=function(_0x430771){while(--_0x430771){_0x3a058d['push'](_0x3a058d['shift']());}};_0x4eb55c(++_0x19965b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0xd72c55,_0x43d66c){var _0xfbf265=function(_0x1718f4){while(--_0x1718f4){_0xd72c55['push'](_0xd72c55['shift']());}};_0xfbf265(++_0x43d66c);}(_0xb7e7,0x121));var _0x7b7e=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xb7e7[_0x13d07a];return _0x5ee0ee;};'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 da24262..84399ab 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 _0xd8d0=['where','attributes','limit','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','debug','code','SmsQueueReport,\x20%s,\x20%s','error','message','info','request\x20sent','catch','CreateSmsQueueReport','create','body','options','raw','then','UpdateSmsQueueReport','update'];(function(_0x4ac6a0,_0x4d28f9){var _0x1d9a5e=function(_0x4e5bdc){while(--_0x4e5bdc){_0x4ac6a0['push'](_0x4ac6a0['shift']());}};_0x1d9a5e(++_0x4d28f9);}(_0xd8d0,0x1f0));var _0x0d8d=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0xd8d0[_0x4b73a2];return _0x383c66;};'use strict';var _=require(_0x0d8d('0x0'));var util=require(_0x0d8d('0x1'));var moment=require(_0x0d8d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8d('0x3'));var db=require(_0x0d8d('0x4'))['db'];var utils=require(_0x0d8d('0x5'));var logger=require('../../config/logger')(_0x0d8d('0x6'));var config=require('../../config/environment');var jayson=require(_0x0d8d('0x7'));var client=jayson[_0x0d8d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ed120,_0x359a93,_0x2c386d){return new BPromise(function(_0x14a2b1,_0x5c0081){return client[_0x0d8d('0x9')](_0x3ed120,_0x2c386d)['then'](function(_0x305ac7){logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x359a93,'request\x20sent');logger[_0x0d8d('0xa')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x359a93,'request\x20sent',JSON['stringify'](_0x305ac7));if(_0x305ac7['error']){if(_0x305ac7['error'][_0x0d8d('0xb')]===0x1f4){logger['error'](_0x0d8d('0xc'),_0x359a93,_0x305ac7[_0x0d8d('0xd')][_0x0d8d('0xe')]);return _0x5c0081(_0x305ac7[_0x0d8d('0xd')]['message']);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x359a93,_0x305ac7[_0x0d8d('0xd')][_0x0d8d('0xe')]);return _0x14a2b1(_0x305ac7[_0x0d8d('0xd')][_0x0d8d('0xe')]);}else{logger[_0x0d8d('0xf')](_0x0d8d('0xc'),_0x359a93,_0x0d8d('0x10'));_0x14a2b1(_0x305ac7['result']['message']);}})[_0x0d8d('0x11')](function(_0x40e5ae){logger[_0x0d8d('0xd')](_0x0d8d('0xc'),_0x359a93,_0x40e5ae);_0x5c0081(_0x40e5ae);});});}exports[_0x0d8d('0x12')]=function(_0x25a839){var _0x42952e=this;return new Promise(function(_0x889485,_0x2686c8){return db['SmsQueueReport'][_0x0d8d('0x13')](_0x25a839[_0x0d8d('0x14')],{'raw':_0x25a839[_0x0d8d('0x15')]?_0x25a839[_0x0d8d('0x15')][_0x0d8d('0x16')]===undefined?!![]:![]:!![]})[_0x0d8d('0x17')](function(_0x52ef95){logger[_0x0d8d('0xf')]('CreateSmsQueueReport',_0x25a839);logger[_0x0d8d('0xa')](_0x0d8d('0x12'),_0x25a839,JSON['stringify'](_0x52ef95));_0x889485(_0x52ef95);})['catch'](function(_0x48ce4d){logger[_0x0d8d('0xd')](_0x0d8d('0x12'),_0x48ce4d[_0x0d8d('0xe')],_0x25a839);_0x2686c8(_0x42952e[_0x0d8d('0xd')](0x1f4,_0x48ce4d[_0x0d8d('0xe')]));});});};exports[_0x0d8d('0x18')]=function(_0x152426){var _0x4adf14=this;return new Promise(function(_0x443371,_0x20ef55){return db['SmsQueueReport'][_0x0d8d('0x19')](_0x152426[_0x0d8d('0x14')],{'raw':_0x152426[_0x0d8d('0x15')]?_0x152426['options'][_0x0d8d('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x152426[_0x0d8d('0x15')]?_0x152426[_0x0d8d('0x15')][_0x0d8d('0x1a')]||null:null,'attributes':_0x152426[_0x0d8d('0x15')]?_0x152426[_0x0d8d('0x15')][_0x0d8d('0x1b')]||null:null,'limit':_0x152426[_0x0d8d('0x15')]?_0x152426[_0x0d8d('0x15')][_0x0d8d('0x1c')]||null:null})['then'](function(_0x49c292){logger['info']('UpdateSmsQueueReport',_0x152426);logger['debug'](_0x0d8d('0x18'),_0x152426,JSON['stringify'](_0x49c292));_0x443371(_0x49c292);})[_0x0d8d('0x11')](function(_0x843cc){logger[_0x0d8d('0xd')](_0x0d8d('0x18'),_0x843cc[_0x0d8d('0xe')],_0x152426);_0x20ef55(_0x4adf14[_0x0d8d('0xd')](0x1f4,_0x843cc[_0x0d8d('0xe')]));});});}; \ No newline at end of file +var _0x906a=['limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSmsQueueReport','SmsQueueReport','create','options','raw','debug','UpdateSmsQueueReport','update','body','attributes'];(function(_0x14cea1,_0x308c8f){var _0x437965=function(_0x2cf080){while(--_0x2cf080){_0x14cea1['push'](_0x14cea1['shift']());}};_0x437965(++_0x308c8f);}(_0x906a,0x129));var _0xa906=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x906a[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0xa906('0x0'));var util=require(_0xa906('0x1'));var moment=require(_0xa906('0x2'));var BPromise=require(_0xa906('0x3'));var rs=require(_0xa906('0x4'));var fs=require('fs');var Redis=require(_0xa906('0x5'));var db=require(_0xa906('0x6'))['db'];var utils=require(_0xa906('0x7'));var logger=require(_0xa906('0x8'))(_0xa906('0x9'));var config=require(_0xa906('0xa'));var jayson=require(_0xa906('0xb'));var client=jayson[_0xa906('0xc')][_0xa906('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5afcb1,_0x5cce97,_0x3d097e){return new BPromise(function(_0x123c31,_0xc361de){return client[_0xa906('0xe')](_0x5afcb1,_0x3d097e)[_0xa906('0xf')](function(_0x1b32d7){logger['info'](_0xa906('0x10'),_0x5cce97,_0xa906('0x11'));logger['debug'](_0xa906('0x12'),_0x5cce97,_0xa906('0x11'),JSON[_0xa906('0x13')](_0x1b32d7));if(_0x1b32d7[_0xa906('0x14')]){if(_0x1b32d7[_0xa906('0x14')][_0xa906('0x15')]===0x1f4){logger[_0xa906('0x14')]('SmsQueueReport,\x20%s,\x20%s',_0x5cce97,_0x1b32d7[_0xa906('0x14')]['message']);return _0xc361de(_0x1b32d7[_0xa906('0x14')]['message']);}logger[_0xa906('0x14')]('SmsQueueReport,\x20%s,\x20%s',_0x5cce97,_0x1b32d7[_0xa906('0x14')]['message']);return _0x123c31(_0x1b32d7['error'][_0xa906('0x16')]);}else{logger[_0xa906('0x17')](_0xa906('0x10'),_0x5cce97,_0xa906('0x11'));_0x123c31(_0x1b32d7[_0xa906('0x18')][_0xa906('0x16')]);}})[_0xa906('0x19')](function(_0x35fc08){logger[_0xa906('0x14')](_0xa906('0x10'),_0x5cce97,_0x35fc08);_0xc361de(_0x35fc08);});});}exports[_0xa906('0x1a')]=function(_0x189a13){var _0x1c876e=this;return new Promise(function(_0x1f9c1b,_0x3f66d9){return db[_0xa906('0x1b')][_0xa906('0x1c')](_0x189a13['body'],{'raw':_0x189a13[_0xa906('0x1d')]?_0x189a13['options'][_0xa906('0x1e')]===undefined?!![]:![]:!![]})[_0xa906('0xf')](function(_0x1124c0){logger[_0xa906('0x17')](_0xa906('0x1a'),_0x189a13);logger[_0xa906('0x1f')](_0xa906('0x1a'),_0x189a13,JSON[_0xa906('0x13')](_0x1124c0));_0x1f9c1b(_0x1124c0);})['catch'](function(_0x4d2b4b){logger['error'](_0xa906('0x1a'),_0x4d2b4b[_0xa906('0x16')],_0x189a13);_0x3f66d9(_0x1c876e[_0xa906('0x14')](0x1f4,_0x4d2b4b[_0xa906('0x16')]));});});};exports[_0xa906('0x20')]=function(_0x1bcc99){var _0x70d9c0=this;return new Promise(function(_0x28b0dc,_0x30a26c){return db[_0xa906('0x1b')][_0xa906('0x21')](_0x1bcc99[_0xa906('0x22')],{'raw':_0x1bcc99[_0xa906('0x1d')]?_0x1bcc99[_0xa906('0x1d')][_0xa906('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bcc99[_0xa906('0x1d')]?_0x1bcc99[_0xa906('0x1d')]['where']||null:null,'attributes':_0x1bcc99['options']?_0x1bcc99[_0xa906('0x1d')][_0xa906('0x23')]||null:null,'limit':_0x1bcc99[_0xa906('0x1d')]?_0x1bcc99[_0xa906('0x1d')][_0xa906('0x24')]||null:null})['then'](function(_0x4197a8){logger[_0xa906('0x17')](_0xa906('0x20'),_0x1bcc99);logger[_0xa906('0x1f')]('UpdateSmsQueueReport',_0x1bcc99,JSON[_0xa906('0x13')](_0x4197a8));_0x28b0dc(_0x4197a8);})[_0xa906('0x19')](function(_0x235fe5){logger[_0xa906('0x14')](_0xa906('0x20'),_0x235fe5[_0xa906('0x16')],_0x1bcc99);_0x30a26c(_0x70d9c0[_0xa906('0x14')](0x1f4,_0x235fe5[_0xa906('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 5ec6ec9..e29bae4 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 _0x9649=['connect-timeout','Router','fs-extra','../../components/interaction/service','./smsTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','put','update','delete','exports','multer','util','path'];(function(_0x5d2581,_0x2b1b80){var _0x5a8ea4=function(_0x214c3c){while(--_0x214c3c){_0x5d2581['push'](_0x5d2581['shift']());}};_0x5a8ea4(++_0x2b1b80);}(_0x9649,0x19f));var _0x9964=function(_0x287f08,_0x530f10){_0x287f08=_0x287f08-0x0;var _0x1cca1a=_0x9649[_0x287f08];return _0x1cca1a;};'use strict';var multer=require(_0x9964('0x0'));var util=require(_0x9964('0x1'));var path=require(_0x9964('0x2'));var timeout=require(_0x9964('0x3'));var express=require('express');var router=express[_0x9964('0x4')]();var fs_extra=require(_0x9964('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9964('0x6'));var config=require('../../config/environment');var controller=require(_0x9964('0x7'));router[_0x9964('0x8')]('/',auth[_0x9964('0x9')](),controller[_0x9964('0xa')]);router[_0x9964('0x8')](_0x9964('0xb'),auth[_0x9964('0x9')](),controller['describe']);router[_0x9964('0x8')](_0x9964('0xc'),auth['isAuthenticated'](),controller[_0x9964('0xd')]);router[_0x9964('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9964('0xf')](_0x9964('0xc'),auth[_0x9964('0x9')](),controller[_0x9964('0x10')]);router[_0x9964('0x11')]('/:id',auth[_0x9964('0x9')](),controller['destroy']);module[_0x9964('0x12')]=router; \ No newline at end of file +var _0x61a5=['describe','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x61a5,0xf0));var _0x561a=function(_0x463697,_0xccfdc4){_0x463697=_0x463697-0x0;var _0x33cfe1=_0x61a5[_0x463697];return _0x33cfe1;};'use strict';var multer=require(_0x561a('0x0'));var util=require('util');var path=require(_0x561a('0x1'));var timeout=require(_0x561a('0x2'));var express=require(_0x561a('0x3'));var router=express[_0x561a('0x4')]();var fs_extra=require(_0x561a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x561a('0x6'));var config=require(_0x561a('0x7'));var controller=require('./smsTransferReport.controller');router[_0x561a('0x8')]('/',auth[_0x561a('0x9')](),controller[_0x561a('0xa')]);router[_0x561a('0x8')](_0x561a('0xb'),auth[_0x561a('0x9')](),controller[_0x561a('0xc')]);router['get'](_0x561a('0xd'),auth['isAuthenticated'](),controller[_0x561a('0xe')]);router[_0x561a('0xf')]('/',auth['isAuthenticated'](),controller[_0x561a('0x10')]);router[_0x561a('0x11')]('/:id',auth[_0x561a('0x9')](),controller['update']);router[_0x561a('0x12')](_0x561a('0xd'),auth[_0x561a('0x9')](),controller[_0x561a('0x13')]);module[_0x561a('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 4d9d64e..dd51d9e 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x37ab08,_0x137af8){var _0xfefc12=function(_0x230edb){while(--_0x230edb){_0x37ab08['push'](_0x37ab08['shift']());}};_0xfefc12(++_0x137af8);}(_0xedd9,0xfc));var _0x9edd=function(_0xcd4050,_0x2e9b73){_0xcd4050=_0xcd4050-0x0;var _0x3e7bce=_0xedd9[_0xcd4050];return _0x3e7bce;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x4ed235,_0xdab06b){var _0x392646=function(_0x33edcf){while(--_0x33edcf){_0x4ed235['push'](_0x4ed235['shift']());}};_0x392646(++_0xdab06b);}(_0xedd9,0xfc));var _0x9edd=function(_0x4500bb,_0x2df5aa){_0x4500bb=_0x4500bb-0x0;var _0x2118e8=_0xedd9[_0x4500bb];return _0x2118e8;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index c1afb18..39c88ac 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 _0x949e=['error','name','send','index','map','SmsTransferReport','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','include','findAll','params','rawAttributes','length','catch','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','end'];(function(_0x50f20c,_0x59f740){var _0x5c1d19=function(_0x105109){while(--_0x105109){_0x50f20c['push'](_0x50f20c['shift']());}};_0x5c1d19(++_0x59f740);}(_0x949e,0xb5));var _0xe949=function(_0x358948,_0x1236a4){_0x358948=_0x358948-0x0;var _0x3814d3=_0x949e[_0x358948];return _0x3814d3;};'use strict';var emlformat=require(_0xe949('0x0'));var rimraf=require(_0xe949('0x1'));var zipdir=require(_0xe949('0x2'));var jsonpatch=require(_0xe949('0x3'));var rp=require('request-promise');var moment=require(_0xe949('0x4'));var BPromise=require(_0xe949('0x5'));var Mustache=require(_0xe949('0x6'));var util=require(_0xe949('0x7'));var path=require(_0xe949('0x8'));var sox=require(_0xe949('0x9'));var csv=require(_0xe949('0xa'));var ejs=require(_0xe949('0xb'));var fs=require('fs');var fs_extra=require(_0xe949('0xc'));var _=require(_0xe949('0xd'));var squel=require('squel');var crypto=require(_0xe949('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe949('0xf'));var toCsv=require(_0xe949('0xa'));var querystring=require(_0xe949('0x10'));var Papa=require(_0xe949('0x11'));var Redis=require(_0xe949('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe949('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe949('0x14'))(_0xe949('0x15'));var utils=require('../../config/utils');var config=require(_0xe949('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe949('0x17'))['db'];function respondWithStatusCode(_0x9c6ce2,_0x4f1d50){_0x4f1d50=_0x4f1d50||0xcc;return function(_0x2cced3){if(_0x2cced3){return _0x9c6ce2[_0xe949('0x18')](_0x4f1d50);}return _0x9c6ce2[_0xe949('0x19')](_0x4f1d50)['end']();};}function respondWithResult(_0x1f339d,_0x441422){_0x441422=_0x441422||0xc8;return function(_0x1cd08b){if(_0x1cd08b){return _0x1f339d[_0xe949('0x19')](_0x441422)[_0xe949('0x1a')](_0x1cd08b);}};}function respondWithFilteredResult(_0x4653ab,_0x5b8620){return function(_0x404f97){if(_0x404f97){var _0x238b83=typeof _0x5b8620[_0xe949('0x1b')]===_0xe949('0x1c')&&typeof _0x5b8620['limit']==='undefined';var _0x4d2aac=_0x404f97[_0xe949('0x1d')];var _0x13f50f=_0x238b83?0x0:_0x5b8620[_0xe949('0x1b')];var _0x2254b5=_0x238b83?_0x404f97[_0xe949('0x1d')]:_0x5b8620[_0xe949('0x1b')]+_0x5b8620[_0xe949('0x1e')];var _0xe76696;if(_0x2254b5>=_0x4d2aac){_0x2254b5=_0x4d2aac;_0xe76696=0xc8;}else{_0xe76696=0xce;}_0x4653ab[_0xe949('0x19')](_0xe76696);return _0x4653ab['set'](_0xe949('0x1f'),_0x13f50f+'-'+_0x2254b5+'/'+_0x4d2aac)[_0xe949('0x1a')](_0x404f97);}return null;};}function patchUpdates(_0x11051d){return function(_0x290378){try{jsonpatch[_0xe949('0x20')](_0x290378,_0x11051d,!![]);}catch(_0x2af8eb){return BPromise[_0xe949('0x21')](_0x2af8eb);}return _0x290378[_0xe949('0x22')]();};}function saveUpdates(_0x34100d,_0x1dbefe){return function(_0x18cb95){if(_0x18cb95){return _0x18cb95[_0xe949('0x23')](_0x34100d)[_0xe949('0x24')](function(_0x5a8d55){return _0x5a8d55;});}return null;};}function removeEntity(_0x5e441f,_0x2d12f6){return function(_0x54ac72){if(_0x54ac72){return _0x54ac72['destroy']()[_0xe949('0x24')](function(){_0x5e441f[_0xe949('0x19')](0xcc)[_0xe949('0x25')]();});}};}function handleEntityNotFound(_0x59421d,_0x352fd7){return function(_0x315aba){if(!_0x315aba){_0x59421d[_0xe949('0x18')](0x194);}return _0x315aba;};}function handleError(_0x45b34f,_0x4dd908){_0x4dd908=_0x4dd908||0x1f4;return function(_0x5cca7b){logger[_0xe949('0x26')](_0x5cca7b['stack']);if(_0x5cca7b[_0xe949('0x27')]){delete _0x5cca7b[_0xe949('0x27')];}_0x45b34f[_0xe949('0x19')](_0x4dd908)[_0xe949('0x28')](_0x5cca7b);};}exports[_0xe949('0x29')]=function(_0x5f145a,_0x8ce5c){var _0x31756d={},_0x33fbf4={},_0x258c2c={'count':0x0,'rows':[]};var _0x3198ae=_[_0xe949('0x2a')](db[_0xe949('0x2b')]['rawAttributes'],function(_0x158ed7){return{'name':_0x158ed7['fieldName'],'type':_0x158ed7['type'][_0xe949('0x2c')]};});_0x33fbf4[_0xe949('0x2d')]=_[_0xe949('0x2a')](_0x3198ae,'name');_0x33fbf4[_0xe949('0x2e')]=_[_0xe949('0x2f')](_0x5f145a[_0xe949('0x2e')]);_0x33fbf4[_0xe949('0x30')]=_[_0xe949('0x31')](_0x33fbf4[_0xe949('0x2d')],_0x33fbf4['query']);_0x31756d[_0xe949('0x32')]=_['intersection'](_0x33fbf4[_0xe949('0x2d')],qs[_0xe949('0x33')](_0x5f145a[_0xe949('0x2e')]['fields']));_0x31756d[_0xe949('0x32')]=_0x31756d[_0xe949('0x32')]['length']?_0x31756d['attributes']:_0x33fbf4[_0xe949('0x2d')];if(!_0x5f145a[_0xe949('0x2e')]['hasOwnProperty'](_0xe949('0x34'))){_0x31756d[_0xe949('0x1e')]=qs[_0xe949('0x1e')](_0x5f145a[_0xe949('0x2e')][_0xe949('0x1e')]);_0x31756d[_0xe949('0x1b')]=qs['offset'](_0x5f145a[_0xe949('0x2e')]['offset']);}_0x31756d[_0xe949('0x35')]=qs[_0xe949('0x36')](_0x5f145a[_0xe949('0x2e')][_0xe949('0x36')]);_0x31756d['where']=qs[_0xe949('0x30')](_[_0xe949('0x37')](_0x5f145a['query'],_0x33fbf4[_0xe949('0x30')]),_0x3198ae);if(_0x5f145a['query'][_0xe949('0x38')]){_0x31756d['where']=_['merge'](_0x31756d[_0xe949('0x39')],{'$or':_[_0xe949('0x2a')](_0x3198ae,function(_0x144045){if(_0x144045[_0xe949('0x3a')]!==_0xe949('0x3b')){var _0x5102fa={};_0x5102fa[_0x144045[_0xe949('0x27')]]={'$like':'%'+_0x5f145a[_0xe949('0x2e')][_0xe949('0x38')]+'%'};return _0x5102fa;}})});}_0x31756d=_[_0xe949('0x3c')]({},_0x31756d,_0x5f145a[_0xe949('0x3d')]);var _0x3e2dbc={'where':_0x31756d[_0xe949('0x39')]};return db[_0xe949('0x2b')]['count'](_0x3e2dbc)[_0xe949('0x24')](function(_0x482768){_0x258c2c['count']=_0x482768;if(_0x5f145a[_0xe949('0x2e')]['includeAll']){_0x31756d[_0xe949('0x3e')]=[{'all':!![]}];}return db['SmsTransferReport'][_0xe949('0x3f')](_0x31756d);})[_0xe949('0x24')](function(_0x50f377){_0x258c2c['rows']=_0x50f377;return _0x258c2c;})['then'](respondWithFilteredResult(_0x8ce5c,_0x31756d))['catch'](handleError(_0x8ce5c,null));};exports['show']=function(_0x5cf02a,_0x55f9bb){var _0x41616c={'raw':!![],'where':{'id':_0x5cf02a[_0xe949('0x40')]['id']}},_0x379109={};_0x379109[_0xe949('0x2d')]=_[_0xe949('0x2f')](db[_0xe949('0x2b')][_0xe949('0x41')]);_0x379109[_0xe949('0x2e')]=_[_0xe949('0x2f')](_0x5cf02a[_0xe949('0x2e')]);_0x379109[_0xe949('0x30')]=_[_0xe949('0x31')](_0x379109[_0xe949('0x2d')],_0x379109[_0xe949('0x2e')]);_0x41616c[_0xe949('0x32')]=_[_0xe949('0x31')](_0x379109[_0xe949('0x2d')],qs['fields'](_0x5cf02a['query']['fields']));_0x41616c[_0xe949('0x32')]=_0x41616c[_0xe949('0x32')][_0xe949('0x42')]?_0x41616c[_0xe949('0x32')]:_0x379109[_0xe949('0x2d')];if(_0x5cf02a[_0xe949('0x2e')]['includeAll']){_0x41616c[_0xe949('0x3e')]=[{'all':!![]}];}_0x41616c=_[_0xe949('0x3c')]({},_0x41616c,_0x5cf02a[_0xe949('0x3d')]);return db[_0xe949('0x2b')]['find'](_0x41616c)[_0xe949('0x24')](handleEntityNotFound(_0x55f9bb,null))[_0xe949('0x24')](respondWithResult(_0x55f9bb,null))[_0xe949('0x43')](handleError(_0x55f9bb,null));};exports[_0xe949('0x44')]=function(_0x554d39,_0x57aff2){return db[_0xe949('0x2b')][_0xe949('0x44')](_0x554d39[_0xe949('0x45')],{})[_0xe949('0x24')](respondWithResult(_0x57aff2,0xc9))[_0xe949('0x43')](handleError(_0x57aff2,null));};exports[_0xe949('0x23')]=function(_0x54625a,_0x242c7a){if(_0x54625a[_0xe949('0x45')]['id']){delete _0x54625a['body']['id'];}return db['SmsTransferReport'][_0xe949('0x46')]({'where':{'id':_0x54625a[_0xe949('0x40')]['id']}})['then'](handleEntityNotFound(_0x242c7a,null))[_0xe949('0x24')](saveUpdates(_0x54625a['body'],null))[_0xe949('0x24')](respondWithResult(_0x242c7a,null))[_0xe949('0x43')](handleError(_0x242c7a,null));};exports[_0xe949('0x47')]=function(_0xee43a3,_0x159110){return db[_0xe949('0x2b')][_0xe949('0x46')]({'where':{'id':_0xee43a3[_0xe949('0x40')]['id']}})[_0xe949('0x24')](handleEntityNotFound(_0x159110,null))['then'](removeEntity(_0x159110,null))['catch'](handleError(_0x159110,null));};exports[_0xe949('0x48')]=function(_0x575963,_0x11403a){return db[_0xe949('0x2b')][_0xe949('0x48')]()[_0xe949('0x24')](respondWithResult(_0x11403a,null))[_0xe949('0x43')](handleError(_0x11403a,null));}; \ No newline at end of file +var _0x0429=['undefined','count','limit','apply','reject','save','update','then','error','stack','name','send','index','SmsTransferReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','params','include','options','find','create','body','catch','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x3fbc09,_0x18d8c9){var _0x4057ba=function(_0x13d367){while(--_0x13d367){_0x3fbc09['push'](_0x3fbc09['shift']());}};_0x4057ba(++_0x18d8c9);}(_0x0429,0x10e));var _0x9042=function(_0x50bbd6,_0x1ad698){_0x50bbd6=_0x50bbd6-0x0;var _0x573817=_0x0429[_0x50bbd6];return _0x573817;};'use strict';var emlformat=require(_0x9042('0x0'));var rimraf=require(_0x9042('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9042('0x2'));var rp=require(_0x9042('0x3'));var moment=require(_0x9042('0x4'));var BPromise=require(_0x9042('0x5'));var Mustache=require(_0x9042('0x6'));var util=require(_0x9042('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x9042('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9042('0x9'));var _=require(_0x9042('0xa'));var squel=require(_0x9042('0xb'));var crypto=require(_0x9042('0xc'));var jsforce=require(_0x9042('0xd'));var deskjs=require(_0x9042('0xe'));var toCsv=require(_0x9042('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9042('0xf'));var authService=require(_0x9042('0x10'));var qs=require(_0x9042('0x11'));var as=require(_0x9042('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9042('0x13'))(_0x9042('0x14'));var utils=require(_0x9042('0x15'));var config=require(_0x9042('0x16'));var licenseUtil=require(_0x9042('0x17'));var db=require(_0x9042('0x18'))['db'];function respondWithStatusCode(_0x420e48,_0x335a5d){_0x335a5d=_0x335a5d||0xcc;return function(_0xcbbffe){if(_0xcbbffe){return _0x420e48[_0x9042('0x19')](_0x335a5d);}return _0x420e48[_0x9042('0x1a')](_0x335a5d)[_0x9042('0x1b')]();};}function respondWithResult(_0x422260,_0x1ddcbc){_0x1ddcbc=_0x1ddcbc||0xc8;return function(_0xfeb0bd){if(_0xfeb0bd){return _0x422260['status'](_0x1ddcbc)[_0x9042('0x1c')](_0xfeb0bd);}};}function respondWithFilteredResult(_0x3e5dd3,_0x56c3bd){return function(_0x40d6e1){if(_0x40d6e1){var _0x45cd42=typeof _0x56c3bd[_0x9042('0x1d')]==='undefined'&&typeof _0x56c3bd['limit']===_0x9042('0x1e');var _0x216cb7=_0x40d6e1[_0x9042('0x1f')];var _0x16aad5=_0x45cd42?0x0:_0x56c3bd['offset'];var _0x373d38=_0x45cd42?_0x40d6e1[_0x9042('0x1f')]:_0x56c3bd[_0x9042('0x1d')]+_0x56c3bd[_0x9042('0x20')];var _0x3857cd;if(_0x373d38>=_0x216cb7){_0x373d38=_0x216cb7;_0x3857cd=0xc8;}else{_0x3857cd=0xce;}_0x3e5dd3[_0x9042('0x1a')](_0x3857cd);return _0x3e5dd3['set']('Content-Range',_0x16aad5+'-'+_0x373d38+'/'+_0x216cb7)[_0x9042('0x1c')](_0x40d6e1);}return null;};}function patchUpdates(_0x36f25d){return function(_0x3f1d5c){try{jsonpatch[_0x9042('0x21')](_0x3f1d5c,_0x36f25d,!![]);}catch(_0x4b6c6d){return BPromise[_0x9042('0x22')](_0x4b6c6d);}return _0x3f1d5c[_0x9042('0x23')]();};}function saveUpdates(_0x5b6fcf,_0x58fc34){return function(_0x474b0c){if(_0x474b0c){return _0x474b0c[_0x9042('0x24')](_0x5b6fcf)[_0x9042('0x25')](function(_0x428f54){return _0x428f54;});}return null;};}function removeEntity(_0x11af9e,_0xb90bd1){return function(_0x3ec7c5){if(_0x3ec7c5){return _0x3ec7c5['destroy']()[_0x9042('0x25')](function(){_0x11af9e[_0x9042('0x1a')](0xcc)[_0x9042('0x1b')]();});}};}function handleEntityNotFound(_0x1c177f,_0x11d84f){return function(_0x54e769){if(!_0x54e769){_0x1c177f[_0x9042('0x19')](0x194);}return _0x54e769;};}function handleError(_0x33ffa1,_0x41a903){_0x41a903=_0x41a903||0x1f4;return function(_0x376a7f){logger[_0x9042('0x26')](_0x376a7f[_0x9042('0x27')]);if(_0x376a7f[_0x9042('0x28')]){delete _0x376a7f[_0x9042('0x28')];}_0x33ffa1['status'](_0x41a903)[_0x9042('0x29')](_0x376a7f);};}exports[_0x9042('0x2a')]=function(_0x2ace64,_0x1a628e){var _0x19e2e9={},_0x412ffe={},_0xa612b5={'count':0x0,'rows':[]};var _0x3d905d=_['map'](db[_0x9042('0x2b')][_0x9042('0x2c')],function(_0x530d0e){return{'name':_0x530d0e[_0x9042('0x2d')],'type':_0x530d0e[_0x9042('0x2e')][_0x9042('0x2f')]};});_0x412ffe[_0x9042('0x30')]=_[_0x9042('0x31')](_0x3d905d,_0x9042('0x28'));_0x412ffe['query']=_[_0x9042('0x32')](_0x2ace64[_0x9042('0x33')]);_0x412ffe[_0x9042('0x34')]=_[_0x9042('0x35')](_0x412ffe['model'],_0x412ffe[_0x9042('0x33')]);_0x19e2e9[_0x9042('0x36')]=_['intersection'](_0x412ffe[_0x9042('0x30')],qs['fields'](_0x2ace64['query'][_0x9042('0x37')]));_0x19e2e9[_0x9042('0x36')]=_0x19e2e9[_0x9042('0x36')][_0x9042('0x38')]?_0x19e2e9['attributes']:_0x412ffe[_0x9042('0x30')];if(!_0x2ace64[_0x9042('0x33')]['hasOwnProperty'](_0x9042('0x39'))){_0x19e2e9[_0x9042('0x20')]=qs['limit'](_0x2ace64[_0x9042('0x33')][_0x9042('0x20')]);_0x19e2e9['offset']=qs[_0x9042('0x1d')](_0x2ace64[_0x9042('0x33')]['offset']);}_0x19e2e9['order']=qs['sort'](_0x2ace64[_0x9042('0x33')][_0x9042('0x3a')]);_0x19e2e9[_0x9042('0x3b')]=qs[_0x9042('0x34')](_[_0x9042('0x3c')](_0x2ace64['query'],_0x412ffe[_0x9042('0x34')]),_0x3d905d);if(_0x2ace64['query'][_0x9042('0x3d')]){_0x19e2e9['where']=_[_0x9042('0x3e')](_0x19e2e9['where'],{'$or':_[_0x9042('0x31')](_0x3d905d,function(_0x4b0684){if(_0x4b0684[_0x9042('0x2e')]!==_0x9042('0x3f')){var _0x27d31f={};_0x27d31f[_0x4b0684[_0x9042('0x28')]]={'$like':'%'+_0x2ace64[_0x9042('0x33')][_0x9042('0x3d')]+'%'};return _0x27d31f;}})});}_0x19e2e9=_['merge']({},_0x19e2e9,_0x2ace64['options']);var _0x37633b={'where':_0x19e2e9[_0x9042('0x3b')]};return db['SmsTransferReport'][_0x9042('0x1f')](_0x37633b)['then'](function(_0x14393e){_0xa612b5[_0x9042('0x1f')]=_0x14393e;if(_0x2ace64[_0x9042('0x33')][_0x9042('0x40')]){_0x19e2e9['include']=[{'all':!![]}];}return db[_0x9042('0x2b')]['findAll'](_0x19e2e9);})[_0x9042('0x25')](function(_0x2a92a5){_0xa612b5[_0x9042('0x41')]=_0x2a92a5;return _0xa612b5;})[_0x9042('0x25')](respondWithFilteredResult(_0x1a628e,_0x19e2e9))['catch'](handleError(_0x1a628e,null));};exports['show']=function(_0xdf5670,_0x1dfbde){var _0x16a89d={'raw':!![],'where':{'id':_0xdf5670[_0x9042('0x42')]['id']}},_0x2baff8={};_0x2baff8[_0x9042('0x30')]=_['keys'](db[_0x9042('0x2b')]['rawAttributes']);_0x2baff8[_0x9042('0x33')]=_[_0x9042('0x32')](_0xdf5670[_0x9042('0x33')]);_0x2baff8[_0x9042('0x34')]=_[_0x9042('0x35')](_0x2baff8['model'],_0x2baff8[_0x9042('0x33')]);_0x16a89d[_0x9042('0x36')]=_[_0x9042('0x35')](_0x2baff8[_0x9042('0x30')],qs[_0x9042('0x37')](_0xdf5670[_0x9042('0x33')][_0x9042('0x37')]));_0x16a89d[_0x9042('0x36')]=_0x16a89d['attributes'][_0x9042('0x38')]?_0x16a89d[_0x9042('0x36')]:_0x2baff8[_0x9042('0x30')];if(_0xdf5670[_0x9042('0x33')][_0x9042('0x40')]){_0x16a89d[_0x9042('0x43')]=[{'all':!![]}];}_0x16a89d=_[_0x9042('0x3e')]({},_0x16a89d,_0xdf5670[_0x9042('0x44')]);return db['SmsTransferReport'][_0x9042('0x45')](_0x16a89d)[_0x9042('0x25')](handleEntityNotFound(_0x1dfbde,null))[_0x9042('0x25')](respondWithResult(_0x1dfbde,null))['catch'](handleError(_0x1dfbde,null));};exports[_0x9042('0x46')]=function(_0x806261,_0xdc3c40){return db[_0x9042('0x2b')][_0x9042('0x46')](_0x806261[_0x9042('0x47')],{})[_0x9042('0x25')](respondWithResult(_0xdc3c40,0xc9))[_0x9042('0x48')](handleError(_0xdc3c40,null));};exports[_0x9042('0x24')]=function(_0x58da91,_0x1a63e7){if(_0x58da91[_0x9042('0x47')]['id']){delete _0x58da91[_0x9042('0x47')]['id'];}return db[_0x9042('0x2b')][_0x9042('0x45')]({'where':{'id':_0x58da91[_0x9042('0x42')]['id']}})['then'](handleEntityNotFound(_0x1a63e7,null))[_0x9042('0x25')](saveUpdates(_0x58da91[_0x9042('0x47')],null))[_0x9042('0x25')](respondWithResult(_0x1a63e7,null))[_0x9042('0x48')](handleError(_0x1a63e7,null));};exports[_0x9042('0x49')]=function(_0x1a5a84,_0xf89655){return db[_0x9042('0x2b')][_0x9042('0x45')]({'where':{'id':_0x1a5a84['params']['id']}})[_0x9042('0x25')](handleEntityNotFound(_0xf89655,null))[_0x9042('0x25')](removeEntity(_0xf89655,null))[_0x9042('0x48')](handleError(_0xf89655,null));};exports[_0x9042('0x4a')]=function(_0x47b738,_0x5296a9){return db[_0x9042('0x2b')][_0x9042('0x4a')]()[_0x9042('0x25')](respondWithResult(_0x5296a9,null))[_0x9042('0x48')](handleError(_0x5296a9,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index fa67c2a..bb7bc23 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 _0xd29c=['moment','bluebird','path','rimraf','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','api'];(function(_0x431ff8,_0x4085dd){var _0x84ccd4=function(_0x1fd1b5){while(--_0x1fd1b5){_0x431ff8['push'](_0x431ff8['shift']());}};_0x84ccd4(++_0x4085dd);}(_0xd29c,0xc9));var _0xcd29=function(_0x231c02,_0x36226c){_0x231c02=_0x231c02-0x0;var _0x4c3606=_0xd29c[_0x231c02];return _0x4c3606;};'use strict';var _=require(_0xcd29('0x0'));var util=require(_0xcd29('0x1'));var logger=require('../../config/logger')(_0xcd29('0x2'));var moment=require(_0xcd29('0x3'));var BPromise=require(_0xcd29('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd29('0x5'));var rimraf=require(_0xcd29('0x6'));var config=require('../../config/environment');var attributes=require('./smsTransferReport.attributes');module[_0xcd29('0x7')]=function(_0x3f03a7,_0x3073f6){return _0x3f03a7[_0xcd29('0x8')](_0xcd29('0x9'),attributes,{'tableName':_0xcd29('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xcd29('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xece0=['moment','request-promise','path','rimraf','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','api'];(function(_0x1ce8fd,_0x1fd875){var _0xd5cdb5=function(_0x1efa4d){while(--_0x1efa4d){_0x1ce8fd['push'](_0x1ce8fd['shift']());}};_0xd5cdb5(++_0x1fd875);}(_0xece0,0xa5));var _0x0ece=function(_0x2b26b1,_0x121949){_0x2b26b1=_0x2b26b1-0x0;var _0x19acbd=_0xece0[_0x2b26b1];return _0x19acbd;};'use strict';var _=require(_0x0ece('0x0'));var util=require(_0x0ece('0x1'));var logger=require('../../config/logger')(_0x0ece('0x2'));var moment=require(_0x0ece('0x3'));var BPromise=require('bluebird');var rp=require(_0x0ece('0x4'));var fs=require('fs');var path=require(_0x0ece('0x5'));var rimraf=require(_0x0ece('0x6'));var config=require('../../config/environment');var attributes=require('./smsTransferReport.attributes');module[_0x0ece('0x7')]=function(_0x3a107d,_0xb736f9){return _0x3a107d[_0x0ece('0x8')](_0x0ece('0x9'),attributes,{'tableName':_0x0ece('0xa'),'paranoid':![],'indexes':[{'name':_0x0ece('0xb'),'fields':[_0x0ece('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 5ce7e4f..6e06907 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 _0x861a=['stringify','error','SmsTransferReport,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug'];(function(_0x2ed95b,_0x166cda){var _0x5af720=function(_0x4d46f0){while(--_0x4d46f0){_0x2ed95b['push'](_0x2ed95b['shift']());}};_0x5af720(++_0x166cda);}(_0x861a,0x194));var _0xa861=function(_0x1299d1,_0x1e929b){_0x1299d1=_0x1299d1-0x0;var _0xc7583d=_0x861a[_0x1299d1];return _0xc7583d;};'use strict';var _=require(_0xa861('0x0'));var util=require('util');var moment=require(_0xa861('0x1'));var BPromise=require(_0xa861('0x2'));var rs=require(_0xa861('0x3'));var fs=require('fs');var Redis=require(_0xa861('0x4'));var db=require(_0xa861('0x5'))['db'];var utils=require(_0xa861('0x6'));var logger=require('../../config/logger')(_0xa861('0x7'));var config=require(_0xa861('0x8'));var jayson=require(_0xa861('0x9'));var client=jayson[_0xa861('0xa')][_0xa861('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bc6cb,_0x2c9016,_0x410918){return new BPromise(function(_0x46e2ce,_0x300ab7){return client[_0xa861('0xc')](_0x5bc6cb,_0x410918)[_0xa861('0xd')](function(_0x24e3ad){logger[_0xa861('0xe')]('SmsTransferReport,\x20%s,\x20%s',_0x2c9016,'request\x20sent');logger[_0xa861('0xf')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x2c9016,'request\x20sent',JSON[_0xa861('0x10')](_0x24e3ad));if(_0x24e3ad[_0xa861('0x11')]){if(_0x24e3ad[_0xa861('0x11')]['code']===0x1f4){logger[_0xa861('0x11')](_0xa861('0x12'),_0x2c9016,_0x24e3ad[_0xa861('0x11')][_0xa861('0x13')]);return _0x300ab7(_0x24e3ad[_0xa861('0x11')]['message']);}logger['error'](_0xa861('0x12'),_0x2c9016,_0x24e3ad['error']['message']);return _0x46e2ce(_0x24e3ad[_0xa861('0x11')][_0xa861('0x13')]);}else{logger[_0xa861('0xe')](_0xa861('0x12'),_0x2c9016,'request\x20sent');_0x46e2ce(_0x24e3ad[_0xa861('0x14')]['message']);}})['catch'](function(_0x5503fd){logger[_0xa861('0x11')](_0xa861('0x12'),_0x2c9016,_0x5503fd);_0x300ab7(_0x5503fd);});});} \ No newline at end of file +var _0xc492=['jayson/promise','http','request','then','info','request\x20sent','error','SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../config/logger','rpc'];(function(_0x1872f2,_0x5d7540){var _0x4017e2=function(_0x2c946d){while(--_0x2c946d){_0x1872f2['push'](_0x1872f2['shift']());}};_0x4017e2(++_0x5d7540);}(_0xc492,0xd7));var _0x2c49=function(_0x46f889,_0x5605b4){_0x46f889=_0x46f889-0x0;var _0x356805=_0xc492[_0x46f889];return _0x356805;};'use strict';var _=require(_0x2c49('0x0'));var util=require(_0x2c49('0x1'));var moment=require(_0x2c49('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c49('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2c49('0x4'))(_0x2c49('0x5'));var config=require('../../config/environment');var jayson=require(_0x2c49('0x6'));var client=jayson['client'][_0x2c49('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x9c10f7,_0x4c76dd,_0xe7b4cb){return new BPromise(function(_0x17f596,_0x26f8c1){return client[_0x2c49('0x8')](_0x9c10f7,_0xe7b4cb)[_0x2c49('0x9')](function(_0x5684e5){logger[_0x2c49('0xa')]('SmsTransferReport,\x20%s,\x20%s',_0x4c76dd,'request\x20sent');logger['debug']('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x4c76dd,_0x2c49('0xb'),JSON['stringify'](_0x5684e5));if(_0x5684e5[_0x2c49('0xc')]){if(_0x5684e5[_0x2c49('0xc')]['code']===0x1f4){logger[_0x2c49('0xc')](_0x2c49('0xd'),_0x4c76dd,_0x5684e5[_0x2c49('0xc')][_0x2c49('0xe')]);return _0x26f8c1(_0x5684e5[_0x2c49('0xc')][_0x2c49('0xe')]);}logger['error'](_0x2c49('0xd'),_0x4c76dd,_0x5684e5[_0x2c49('0xc')][_0x2c49('0xe')]);return _0x17f596(_0x5684e5[_0x2c49('0xc')][_0x2c49('0xe')]);}else{logger['info'](_0x2c49('0xd'),_0x4c76dd,_0x2c49('0xb'));_0x17f596(_0x5684e5[_0x2c49('0xf')][_0x2c49('0xe')]);}})[_0x2c49('0x10')](function(_0x88e972){logger[_0x2c49('0xc')](_0x2c49('0xd'),_0x4c76dd,_0x88e972);_0x26f8c1(_0x88e972);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index e5f63b4..c3fa5a7 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 _0x96b5=['update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id/download','download','diskStorage','join','root','originalname','replace','%s-%s%s','basename','now','extname','post','file','/:id'];(function(_0x411311,_0x1651fb){var _0x1e0525=function(_0x231e8b){while(--_0x231e8b){_0x411311['push'](_0x411311['shift']());}};_0x1e0525(++_0x1651fb);}(_0x96b5,0x1c5));var _0x596b=function(_0x2843ec,_0x1fe6eb){_0x2843ec=_0x2843ec-0x0;var _0x3a09ca=_0x96b5[_0x2843ec];return _0x3a09ca;};'use strict';var multer=require(_0x596b('0x0'));var util=require('util');var path=require(_0x596b('0x1'));var timeout=require(_0x596b('0x2'));var express=require(_0x596b('0x3'));var router=express[_0x596b('0x4')]();var fs_extra=require(_0x596b('0x5'));var auth=require(_0x596b('0x6'));var interaction=require(_0x596b('0x7'));var config=require(_0x596b('0x8'));var controller=require(_0x596b('0x9'));router[_0x596b('0xa')]('/',auth[_0x596b('0xb')](),controller[_0x596b('0xc')]);router[_0x596b('0xa')]('/:id',auth[_0x596b('0xb')](),controller['show']);router[_0x596b('0xa')](_0x596b('0xd'),auth[_0x596b('0xb')](),controller[_0x596b('0xe')]);var upload=multer({'storage':multer[_0x596b('0xf')]({'destination':function(_0x1cf64a,_0x12fd59,_0x50818e){_0x50818e(null,path[_0x596b('0x10')](config[_0x596b('0x11')],'server/files/sounds/original/'));},'filename':function(_0x5e798e,_0x2de45e,_0x35c4dc){_0x2de45e[_0x596b('0x12')]=_0x2de45e[_0x596b('0x12')][_0x596b('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x35c4dc(null,util['format'](_0x596b('0x14'),path[_0x596b('0x15')](_0x2de45e[_0x596b('0x12')],path['extname'](_0x2de45e[_0x596b('0x12')])),Date[_0x596b('0x16')](),path[_0x596b('0x17')](_0x2de45e[_0x596b('0x12')])));}})});router[_0x596b('0x18')]('/',upload['single'](_0x596b('0x19')),controller['create']);router['put'](_0x596b('0x1a'),auth[_0x596b('0xb')](),controller[_0x596b('0x1b')]);router[_0x596b('0x1c')](_0x596b('0x1a'),auth[_0x596b('0xb')](),controller[_0x596b('0x1c')]);module[_0x596b('0x1d')]=router; \ No newline at end of file +var _0x9eb5=['show','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename','extname','now','post','file','put','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./sound.controller','get','isAuthenticated','index','/:id'];(function(_0x152136,_0x4f14f1){var _0x20df44=function(_0x362877){while(--_0x362877){_0x152136['push'](_0x152136['shift']());}};_0x20df44(++_0x4f14f1);}(_0x9eb5,0xb9));var _0x59eb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9eb5[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x59eb('0x0'));var util=require(_0x59eb('0x1'));var path=require(_0x59eb('0x2'));var timeout=require(_0x59eb('0x3'));var express=require(_0x59eb('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x59eb('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x59eb('0x6'));router[_0x59eb('0x7')]('/',auth[_0x59eb('0x8')](),controller[_0x59eb('0x9')]);router['get'](_0x59eb('0xa'),auth['isAuthenticated'](),controller[_0x59eb('0xb')]);router['get']('/:id/download',auth[_0x59eb('0x8')](),controller[_0x59eb('0xc')]);var upload=multer({'storage':multer[_0x59eb('0xd')]({'destination':function(_0x228578,_0x4349d4,_0x4d155c){_0x4d155c(null,path[_0x59eb('0xe')](config[_0x59eb('0xf')],'server/files/sounds/original/'));},'filename':function(_0x2a947a,_0x48c686,_0x4528da){_0x48c686[_0x59eb('0x10')]=_0x48c686['originalname'][_0x59eb('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4528da(null,util[_0x59eb('0x12')](_0x59eb('0x13'),path[_0x59eb('0x14')](_0x48c686['originalname'],path[_0x59eb('0x15')](_0x48c686[_0x59eb('0x10')])),Date[_0x59eb('0x16')](),path['extname'](_0x48c686['originalname'])));}})});router[_0x59eb('0x17')]('/',upload['single'](_0x59eb('0x18')),controller['create']);router[_0x59eb('0x19')](_0x59eb('0xa'),auth[_0x59eb('0x8')](),controller['update']);router[_0x59eb('0x1a')](_0x59eb('0xa'),auth['isAuthenticated'](),controller[_0x59eb('0x1a')]);module[_0x59eb('0x1b')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 718ba47..1896de6 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 _0x1455=['FLOAT','sequelize','exports','STRING','name','BIGINT','INTEGER'];(function(_0x360e73,_0x5cc798){var _0x471a41=function(_0x594b4a){while(--_0x594b4a){_0x360e73['push'](_0x360e73['shift']());}};_0x471a41(++_0x5cc798);}(_0x1455,0x17b));var _0x5145=function(_0x4c2d65,_0x458122){_0x4c2d65=_0x4c2d65-0x0;var _0x5a7438=_0x1455[_0x4c2d65];return _0x5a7438;};'use strict';var Sequelize=require(_0x5145('0x0'));module[_0x5145('0x1')]={'name':{'type':Sequelize[_0x5145('0x2')],'unique':_0x5145('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x5145('0x2')]},'display_name':{'type':Sequelize[_0x5145('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x5145('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x5145('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x5145('0x5')]},'converted_format':{'type':Sequelize[_0x5145('0x2')]},'converted_duration':{'type':Sequelize[_0x5145('0x6')]},'converted_sampleCount':{'type':Sequelize[_0x5145('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x5145('0x5')]}}; \ No newline at end of file +var _0x1001=['name','FLOAT','INTEGER','BIGINT','sequelize','exports','STRING'];(function(_0x30c5c6,_0x43db74){var _0x2aaa31=function(_0x5ccd85){while(--_0x5ccd85){_0x30c5c6['push'](_0x30c5c6['shift']());}};_0x2aaa31(++_0x43db74);}(_0x1001,0xe4));var _0x1100=function(_0x119f76,_0x47d752){_0x119f76=_0x119f76-0x0;var _0x8e5579=_0x1001[_0x119f76];return _0x8e5579;};'use strict';var Sequelize=require(_0x1100('0x0'));module[_0x1100('0x1')]={'name':{'type':Sequelize[_0x1100('0x2')],'unique':_0x1100('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x1100('0x2')]},'display_name':{'type':Sequelize[_0x1100('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x1100('0x2')]},'original_duration':{'type':Sequelize[_0x1100('0x4')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x1100('0x5')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x1100('0x5')]},'converted_format':{'type':Sequelize[_0x1100('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x1100('0x6')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x1100('0x6')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index b7c65da..9e43d35 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 _0x1289=['end','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','description','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','apply','update','then','destroy','get','Sounds','UserProfileResource','stack','name','index','map','Sound','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','download','save_name','converted_format','join','server/files/sounds/converted','ValidationError','Sound\x20not\x20found','root','format','%s.%s','create','basename','file','originalname','filename','extname','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','send','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x1289,0x178));var _0x9128=function(_0x3d547e,_0x497e4b){_0x3d547e=_0x3d547e-0x0;var _0x35ee45=_0x1289[_0x3d547e];return _0x35ee45;};'use strict';var emlformat=require(_0x9128('0x0'));var rimraf=require(_0x9128('0x1'));var zipdir=require(_0x9128('0x2'));var jsonpatch=require(_0x9128('0x3'));var rp=require(_0x9128('0x4'));var moment=require(_0x9128('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9128('0x6'));var util=require(_0x9128('0x7'));var path=require(_0x9128('0x8'));var sox=require(_0x9128('0x9'));var csv=require('to-csv');var ejs=require(_0x9128('0xa'));var fs=require('fs');var fs_extra=require(_0x9128('0xb'));var _=require(_0x9128('0xc'));var squel=require(_0x9128('0xd'));var crypto=require('crypto');var jsforce=require(_0x9128('0xe'));var deskjs=require(_0x9128('0xf'));var toCsv=require(_0x9128('0x10'));var querystring=require('querystring');var Papa=require(_0x9128('0x11'));var Redis=require('ioredis');var authService=require(_0x9128('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9128('0x13'));var hardwareService=require(_0x9128('0x14'));var logger=require('../../config/logger')(_0x9128('0x15'));var utils=require('../../config/utils');var config=require(_0x9128('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f9bad,_0x52a54f){_0x52a54f=_0x52a54f||0xcc;return function(_0x71b752){if(_0x71b752){return _0x2f9bad[_0x9128('0x17')](_0x52a54f);}return _0x2f9bad[_0x9128('0x18')](_0x52a54f)['end']();};}function respondWithResult(_0x24c5e5,_0x45bad6){_0x45bad6=_0x45bad6||0xc8;return function(_0x137ca6){if(_0x137ca6){return _0x24c5e5['status'](_0x45bad6)[_0x9128('0x19')](_0x137ca6);}};}function respondWithFilteredResult(_0x3e4a26,_0x415c31){return function(_0x340be0){if(_0x340be0){var _0x133b37=typeof _0x415c31['offset']===_0x9128('0x1a')&&typeof _0x415c31[_0x9128('0x1b')]===_0x9128('0x1a');var _0x3ad457=_0x340be0[_0x9128('0x1c')];var _0x47611e=_0x133b37?0x0:_0x415c31[_0x9128('0x1d')];var _0x3f8039=_0x133b37?_0x340be0['count']:_0x415c31['offset']+_0x415c31['limit'];var _0x22751c;if(_0x3f8039>=_0x3ad457){_0x3f8039=_0x3ad457;_0x22751c=0xc8;}else{_0x22751c=0xce;}_0x3e4a26[_0x9128('0x18')](_0x22751c);return _0x3e4a26['set']('Content-Range',_0x47611e+'-'+_0x3f8039+'/'+_0x3ad457)[_0x9128('0x19')](_0x340be0);}return null;};}function patchUpdates(_0x5e9fcd){return function(_0x2d7dad){try{jsonpatch[_0x9128('0x1e')](_0x2d7dad,_0x5e9fcd,!![]);}catch(_0x148f56){return BPromise['reject'](_0x148f56);}return _0x2d7dad['save']();};}function saveUpdates(_0x6d2236,_0x49efab){return function(_0x5171b4){if(_0x5171b4){return _0x5171b4[_0x9128('0x1f')](_0x6d2236)[_0x9128('0x20')](function(_0x3b0461){return _0x3b0461;});}return null;};}function removeEntity(_0x2a677c,_0x25c1ec){return function(_0x52b495){if(_0x52b495){return _0x52b495[_0x9128('0x21')]()[_0x9128('0x20')](function(){var _0x594d01=_0x52b495[_0x9128('0x22')]({'plain':!![]});var _0x5a8f92=_0x9128('0x23');return db[_0x9128('0x24')][_0x9128('0x21')]({'where':{'type':_0x5a8f92,'resourceId':_0x594d01['id']}})['then'](function(){return _0x52b495;});})['then'](function(){_0x2a677c[_0x9128('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x76336b,_0x2ba66e){return function(_0x148a89){if(!_0x148a89){_0x76336b[_0x9128('0x17')](0x194);}return _0x148a89;};}function handleError(_0x161936,_0x5edd93){_0x5edd93=_0x5edd93||0x1f4;return function(_0x368978){logger['error'](_0x368978[_0x9128('0x25')]);if(_0x368978[_0x9128('0x26')]){delete _0x368978[_0x9128('0x26')];}_0x161936[_0x9128('0x18')](_0x5edd93)['send'](_0x368978);};}exports[_0x9128('0x27')]=function(_0xfc1bee,_0x292ce7){var _0xc81b74={},_0xedf77={},_0x18a4e9={'count':0x0,'rows':[]};var _0x233476=_[_0x9128('0x28')](db[_0x9128('0x29')]['rawAttributes'],function(_0x1c3e8a){return{'name':_0x1c3e8a[_0x9128('0x2a')],'type':_0x1c3e8a[_0x9128('0x2b')][_0x9128('0x2c')]};});_0xedf77[_0x9128('0x2d')]=_['map'](_0x233476,'name');_0xedf77[_0x9128('0x2e')]=_[_0x9128('0x2f')](_0xfc1bee[_0x9128('0x2e')]);_0xedf77[_0x9128('0x30')]=_['intersection'](_0xedf77['model'],_0xedf77[_0x9128('0x2e')]);_0xc81b74[_0x9128('0x31')]=_['intersection'](_0xedf77[_0x9128('0x2d')],qs[_0x9128('0x32')](_0xfc1bee['query'][_0x9128('0x32')]));_0xc81b74[_0x9128('0x31')]=_0xc81b74[_0x9128('0x31')][_0x9128('0x33')]?_0xc81b74[_0x9128('0x31')]:_0xedf77[_0x9128('0x2d')];if(!_0xfc1bee[_0x9128('0x2e')][_0x9128('0x34')](_0x9128('0x35'))){_0xc81b74[_0x9128('0x1b')]=qs['limit'](_0xfc1bee[_0x9128('0x2e')][_0x9128('0x1b')]);_0xc81b74[_0x9128('0x1d')]=qs['offset'](_0xfc1bee['query'][_0x9128('0x1d')]);}_0xc81b74['order']=qs['sort'](_0xfc1bee[_0x9128('0x2e')][_0x9128('0x36')]);_0xc81b74[_0x9128('0x37')]=qs[_0x9128('0x30')](_['pick'](_0xfc1bee[_0x9128('0x2e')],_0xedf77[_0x9128('0x30')]),_0x233476);if(_0xfc1bee[_0x9128('0x2e')][_0x9128('0x38')]){_0xc81b74[_0x9128('0x37')]=_['merge'](_0xc81b74[_0x9128('0x37')],{'$or':_[_0x9128('0x28')](_0x233476,function(_0x312ff4){if(_0x312ff4[_0x9128('0x2b')]!=='VIRTUAL'){var _0x4c5e52={};_0x4c5e52[_0x312ff4['name']]={'$like':'%'+_0xfc1bee[_0x9128('0x2e')]['filter']+'%'};return _0x4c5e52;}})});}_0xc81b74=_[_0x9128('0x39')]({},_0xc81b74,_0xfc1bee[_0x9128('0x3a')]);var _0x282571={'where':_0xc81b74[_0x9128('0x37')]};return db['Sound'][_0x9128('0x1c')](_0x282571)['then'](function(_0x49be89){_0x18a4e9[_0x9128('0x1c')]=_0x49be89;if(_0xfc1bee[_0x9128('0x2e')][_0x9128('0x3b')]){_0xc81b74[_0x9128('0x3c')]=[{'all':!![]}];}return db[_0x9128('0x29')][_0x9128('0x3d')](_0xc81b74);})[_0x9128('0x20')](function(_0x30a6bb){_0x18a4e9[_0x9128('0x3e')]=_0x30a6bb;return _0x18a4e9;})['then'](respondWithFilteredResult(_0x292ce7,_0xc81b74))[_0x9128('0x3f')](handleError(_0x292ce7,null));};exports[_0x9128('0x40')]=function(_0x137023,_0x4a1c5f){var _0x5d50f1={'raw':!![],'where':{'id':_0x137023[_0x9128('0x41')]['id']}},_0x583b0b={};_0x583b0b[_0x9128('0x2d')]=_[_0x9128('0x2f')](db[_0x9128('0x29')]['rawAttributes']);_0x583b0b[_0x9128('0x2e')]=_['keys'](_0x137023[_0x9128('0x2e')]);_0x583b0b['filters']=_[_0x9128('0x42')](_0x583b0b[_0x9128('0x2d')],_0x583b0b[_0x9128('0x2e')]);_0x5d50f1['attributes']=_['intersection'](_0x583b0b[_0x9128('0x2d')],qs[_0x9128('0x32')](_0x137023['query']['fields']));_0x5d50f1['attributes']=_0x5d50f1[_0x9128('0x31')][_0x9128('0x33')]?_0x5d50f1[_0x9128('0x31')]:_0x583b0b[_0x9128('0x2d')];if(_0x137023['query'][_0x9128('0x3b')]){_0x5d50f1['include']=[{'all':!![]}];}_0x5d50f1=_['merge']({},_0x5d50f1,_0x137023[_0x9128('0x3a')]);return db[_0x9128('0x29')][_0x9128('0x43')](_0x5d50f1)[_0x9128('0x20')](handleEntityNotFound(_0x4a1c5f,null))[_0x9128('0x20')](respondWithResult(_0x4a1c5f,null))[_0x9128('0x3f')](handleError(_0x4a1c5f,null));};exports[_0x9128('0x44')]=function(_0x313371,_0x40e290,_0x20d9c8){return db['Sound']['find']({'where':{'id':_0x313371['params']['id']},'attributes':[_0x9128('0x26'),_0x9128('0x45'),_0x9128('0x46')],'raw':!![]})[_0x9128('0x20')](handleEntityNotFound(_0x40e290,null))['then'](function(_0x1c8dad){if(_0x1c8dad){if(!fs['existsSync'](path[_0x9128('0x47')](config['root'],_0x9128('0x48'),_0x1c8dad[_0x9128('0x45')]+'.'+_0x1c8dad[_0x9128('0x46')]))){throw new db['Sequelize'][(_0x9128('0x49'))](_0x9128('0x4a'));}return _0x40e290[_0x9128('0x44')](path['join'](config[_0x9128('0x4b')],'server/files/sounds/converted',util[_0x9128('0x4c')]('%s.%s',_0x1c8dad[_0x9128('0x45')],_0x1c8dad[_0x9128('0x46')])),util[_0x9128('0x4c')](_0x9128('0x4d'),_0x1c8dad['name'],_0x1c8dad['converted_format']));}return null;})[_0x9128('0x3f')](handleError(_0x40e290,null));};exports[_0x9128('0x4e')]=function(_0x56f6de,_0x18243c,_0x18a256){var _0x1af949={'name':path[_0x9128('0x4f')](_0x56f6de[_0x9128('0x50')][_0x9128('0x51')],path['extname'](_0x56f6de[_0x9128('0x50')][_0x9128('0x51')])),'save_name':path[_0x9128('0x4f')](_0x56f6de[_0x9128('0x50')][_0x9128('0x52')],path[_0x9128('0x53')](_0x56f6de[_0x9128('0x50')][_0x9128('0x52')])),'original_format':path[_0x9128('0x53')](_0x56f6de['file'][_0x9128('0x51')])[_0x9128('0x54')](0x1),'converted_format':_0x9128('0x55')};var _0x110696=path[_0x9128('0x47')](config[_0x9128('0x4b')],_0x9128('0x56'),_0x56f6de['file'][_0x9128('0x52')]);var _0x1b2fcd=path[_0x9128('0x47')](config[_0x9128('0x4b')],_0x9128('0x48'),util[_0x9128('0x4c')]('%s.%s',path[_0x9128('0x4f')](_0x56f6de['file'][_0x9128('0x52')],path['extname'](_0x56f6de[_0x9128('0x50')][_0x9128('0x52')])),_0x1af949[_0x9128('0x46')]));logger[_0x9128('0x57')](_0x9128('0x58'),_0x110696);logger[_0x9128('0x57')](_0x9128('0x59'),_0x1b2fcd);try{fs[_0x9128('0x5a')](_0x110696,parseInt(_0x9128('0x5b'),0x8));var _0x495f49=sox[_0x9128('0x5c')](_0x110696,_0x1b2fcd,{'sampleRate':0x1f40,'format':_0x9128('0x55'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x495f49['on']('error',function(_0x5642ce){fs[_0x9128('0x5d')](_0x110696);_0x18243c[_0x9128('0x18')](0x1f4)[_0x9128('0x5e')](_0x5642ce);});_0x495f49['on'](_0x9128('0x5f'),function(_0x49e06c){_0x1af949['original_duration']=isNaN(_0x49e06c[_0x9128('0x60')])?null:_0x49e06c[_0x9128('0x60')]*0x3e8;_0x1af949[_0x9128('0x61')]=isNaN(_0x49e06c[_0x9128('0x62')])?null:_0x49e06c[_0x9128('0x62')];_0x1af949[_0x9128('0x63')]=isNaN(_0x49e06c[_0x9128('0x64')])?null:_0x49e06c[_0x9128('0x64')];_0x1af949[_0x9128('0x65')]=isNaN(_0x49e06c[_0x9128('0x66')])?null:_0x49e06c[_0x9128('0x66')];_0x1af949['original_sampleRate']=isNaN(_0x49e06c[_0x9128('0x67')])?null:_0x49e06c[_0x9128('0x67')];});_0x495f49['on'](_0x9128('0x68'),function(_0x6baab9){_0x1af949[_0x9128('0x69')]=isNaN(_0x6baab9['duration'])?null:_0x6baab9[_0x9128('0x60')]*0x3e8;_0x1af949[_0x9128('0x6a')]=isNaN(_0x6baab9[_0x9128('0x62')])?null:_0x6baab9[_0x9128('0x62')];_0x1af949['converted_channelCount']=isNaN(_0x6baab9[_0x9128('0x64')])?null:_0x6baab9[_0x9128('0x64')];_0x1af949[_0x9128('0x6b')]=isNaN(_0x6baab9['bitRate'])?null:_0x6baab9[_0x9128('0x66')];_0x1af949['converted_sampleRate']=isNaN(_0x6baab9[_0x9128('0x67')])?null:_0x6baab9[_0x9128('0x67')];});_0x495f49['on'](_0x9128('0x6c'),function(){fs[_0x9128('0x5a')](_0x1b2fcd,parseInt(_0x9128('0x5b'),0x8));return db[_0x9128('0x29')][_0x9128('0x4e')](_0x1af949)[_0x9128('0x20')](function(_0x81802e){var _0x3696e4={'role':_0x56f6de['body'][_0x9128('0x6d')],'userProfileId':_0x56f6de[_0x9128('0x6e')][_0x9128('0x6f')]};if(!_0x3696e4)throw new Error(_0x9128('0x70'));if(_0x3696e4[_0x9128('0x6d')]===_0x9128('0x71')){var _0x110e4d=_0x81802e[_0x9128('0x22')]({'plain':!![]});return db[_0x9128('0x72')]['find']({'where':{'name':_0x9128('0x23'),'userProfileId':_0x3696e4[_0x9128('0x6f')]},'raw':!![]})[_0x9128('0x20')](function(_0x176126){if(_0x176126&&_0x176126[_0x9128('0x73')]===0x0){return db['UserProfileResource'][_0x9128('0x4e')]({'name':_0x110e4d[_0x9128('0x26')],'resourceId':_0x110e4d['id'],'type':_0x176126[_0x9128('0x26')],'sectionId':_0x176126['id']},{})['then'](function(){return _0x81802e;});}else{return _0x81802e;}})['catch'](function(_0x438782){logger[_0x9128('0x74')](_0x9128('0x75'),_0x438782);throw _0x438782;});}return _0x81802e;})[_0x9128('0x20')](respondWithResult(_0x18243c,null))[_0x9128('0x3f')](handleError(_0x18243c,null));});_0x495f49['start']();}catch(_0x387b9f){_0x18243c[_0x9128('0x18')](0x1f4)[_0x9128('0x5e')](_0x387b9f);}};exports[_0x9128('0x1f')]=function(_0x2c93b4,_0x3416e8,_0x7f074f){return db['Sound'][_0x9128('0x43')]({'where':{'id':_0x2c93b4[_0x9128('0x41')]['id']}})['then'](handleEntityNotFound(_0x3416e8,null))['then'](saveUpdates(_[_0x9128('0x76')](_0x2c93b4['body'],['name',_0x9128('0x77')]),null))[_0x9128('0x20')](respondWithResult(_0x3416e8,null))[_0x9128('0x3f')](handleError(_0x3416e8,null));};exports['delete']=function(_0x492eca,_0x21d997,_0x49d3b8){return db[_0x9128('0x29')]['find']({'where':{'id':_0x492eca[_0x9128('0x41')]['id']}})[_0x9128('0x20')](function(_0x534d85){if(_0x534d85){return _0x534d85['destroy']();}})['then'](function(_0x7f664b){var _0x25ce05=path[_0x9128('0x47')](config[_0x9128('0x4b')],_0x9128('0x56'),util[_0x9128('0x4c')](_0x9128('0x4d'),_0x7f664b[_0x9128('0x45')],_0x7f664b[_0x9128('0x78')]));var _0x24c8a6=path[_0x9128('0x47')](config[_0x9128('0x4b')],'server/files/sounds/converted',util['format'](_0x9128('0x4d'),_0x7f664b[_0x9128('0x45')],_0x7f664b['converted_format']));fs[_0x9128('0x5d')](_0x25ce05);fs[_0x9128('0x5d')](_0x24c8a6);return _0x7f664b;})[_0x9128('0x20')](function(_0x4852ab){if(_0x4852ab){return _0x21d997[_0x9128('0x18')](0xcc)[_0x9128('0x6c')]();}})[_0x9128('0x20')](handleEntityNotFound(_0x21d997,null))[_0x9128('0x3f')](handleError(_0x21d997,null));}; \ No newline at end of file +var _0x3120=['original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_sampleRate','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','description','delete','eml-format','fast-json-patch','moment','mustache','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','model','keys','include','find','save_name','converted_format','join','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','download','root','format','%s.%s','create','basename','file','extname','originalname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','transcode','error','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount'];(function(_0x1325d0,_0x2c3fb8){var _0xe6f03a=function(_0x370100){while(--_0x370100){_0x1325d0['push'](_0x1325d0['shift']());}};_0xe6f03a(++_0x2c3fb8);}(_0x3120,0x8c));var _0x0312=function(_0x349563,_0x5a86ae){_0x349563=_0x349563-0x0;var _0x59c40a=_0x3120[_0x349563];return _0x59c40a;};'use strict';var emlformat=require(_0x0312('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0312('0x1'));var rp=require('request-promise');var moment=require(_0x0312('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0312('0x3'));var util=require('util');var path=require(_0x0312('0x4'));var sox=require(_0x0312('0x5'));var csv=require(_0x0312('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0312('0x7'));var _=require(_0x0312('0x8'));var squel=require('squel');var crypto=require(_0x0312('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x0312('0xa'));var toCsv=require(_0x0312('0x6'));var querystring=require(_0x0312('0xb'));var Papa=require('papaparse');var Redis=require(_0x0312('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x0312('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0312('0xe'));var logger=require(_0x0312('0xf'))('api');var utils=require(_0x0312('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x0312('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c3807,_0x49b458){_0x49b458=_0x49b458||0xcc;return function(_0x41e71d){if(_0x41e71d){return _0x1c3807[_0x0312('0x12')](_0x49b458);}return _0x1c3807[_0x0312('0x13')](_0x49b458)[_0x0312('0x14')]();};}function respondWithResult(_0x355279,_0x54b086){_0x54b086=_0x54b086||0xc8;return function(_0x128f8b){if(_0x128f8b){return _0x355279[_0x0312('0x13')](_0x54b086)['json'](_0x128f8b);}};}function respondWithFilteredResult(_0x5af0b4,_0x10fc77){return function(_0x39f3c0){if(_0x39f3c0){var _0x5ae61f=typeof _0x10fc77[_0x0312('0x15')]===_0x0312('0x16')&&typeof _0x10fc77['limit']==='undefined';var _0x5ced31=_0x39f3c0[_0x0312('0x17')];var _0x1cfdeb=_0x5ae61f?0x0:_0x10fc77[_0x0312('0x15')];var _0xcc7fa5=_0x5ae61f?_0x39f3c0[_0x0312('0x17')]:_0x10fc77[_0x0312('0x15')]+_0x10fc77[_0x0312('0x18')];var _0x190873;if(_0xcc7fa5>=_0x5ced31){_0xcc7fa5=_0x5ced31;_0x190873=0xc8;}else{_0x190873=0xce;}_0x5af0b4[_0x0312('0x13')](_0x190873);return _0x5af0b4['set'](_0x0312('0x19'),_0x1cfdeb+'-'+_0xcc7fa5+'/'+_0x5ced31)[_0x0312('0x1a')](_0x39f3c0);}return null;};}function patchUpdates(_0xc5a62){return function(_0x40694c){try{jsonpatch[_0x0312('0x1b')](_0x40694c,_0xc5a62,!![]);}catch(_0x25f935){return BPromise[_0x0312('0x1c')](_0x25f935);}return _0x40694c[_0x0312('0x1d')]();};}function saveUpdates(_0x321992,_0x426fca){return function(_0x262ffe){if(_0x262ffe){return _0x262ffe[_0x0312('0x1e')](_0x321992)[_0x0312('0x1f')](function(_0x4bdd98){return _0x4bdd98;});}return null;};}function removeEntity(_0x3dc86f,_0x4eadf3){return function(_0x42d798){if(_0x42d798){return _0x42d798[_0x0312('0x20')]()[_0x0312('0x1f')](function(){var _0x233b05=_0x42d798[_0x0312('0x21')]({'plain':!![]});var _0x2958c1=_0x0312('0x22');return db[_0x0312('0x23')][_0x0312('0x20')]({'where':{'type':_0x2958c1,'resourceId':_0x233b05['id']}})[_0x0312('0x1f')](function(){return _0x42d798;});})['then'](function(){_0x3dc86f[_0x0312('0x13')](0xcc)[_0x0312('0x14')]();});}};}function handleEntityNotFound(_0x436207,_0x5518a5){return function(_0x7529b1){if(!_0x7529b1){_0x436207['sendStatus'](0x194);}return _0x7529b1;};}function handleError(_0x5c88cb,_0x3754f7){_0x3754f7=_0x3754f7||0x1f4;return function(_0x42f71d){logger['error'](_0x42f71d[_0x0312('0x24')]);if(_0x42f71d['name']){delete _0x42f71d[_0x0312('0x25')];}_0x5c88cb[_0x0312('0x13')](_0x3754f7)[_0x0312('0x26')](_0x42f71d);};}exports[_0x0312('0x27')]=function(_0x27525c,_0x5727f2){var _0x13eff3={},_0x4650d4={},_0x3ed80={'count':0x0,'rows':[]};var _0x1851bc=_[_0x0312('0x28')](db[_0x0312('0x29')][_0x0312('0x2a')],function(_0x5a02ae){return{'name':_0x5a02ae[_0x0312('0x2b')],'type':_0x5a02ae[_0x0312('0x2c')][_0x0312('0x2d')]};});_0x4650d4['model']=_[_0x0312('0x28')](_0x1851bc,_0x0312('0x25'));_0x4650d4[_0x0312('0x2e')]=_['keys'](_0x27525c[_0x0312('0x2e')]);_0x4650d4[_0x0312('0x2f')]=_[_0x0312('0x30')](_0x4650d4['model'],_0x4650d4[_0x0312('0x2e')]);_0x13eff3[_0x0312('0x31')]=_[_0x0312('0x30')](_0x4650d4['model'],qs[_0x0312('0x32')](_0x27525c['query']['fields']));_0x13eff3['attributes']=_0x13eff3[_0x0312('0x31')][_0x0312('0x33')]?_0x13eff3[_0x0312('0x31')]:_0x4650d4['model'];if(!_0x27525c[_0x0312('0x2e')]['hasOwnProperty'](_0x0312('0x34'))){_0x13eff3[_0x0312('0x18')]=qs[_0x0312('0x18')](_0x27525c[_0x0312('0x2e')][_0x0312('0x18')]);_0x13eff3[_0x0312('0x15')]=qs[_0x0312('0x15')](_0x27525c[_0x0312('0x2e')][_0x0312('0x15')]);}_0x13eff3[_0x0312('0x35')]=qs['sort'](_0x27525c['query'][_0x0312('0x36')]);_0x13eff3[_0x0312('0x37')]=qs[_0x0312('0x2f')](_[_0x0312('0x38')](_0x27525c[_0x0312('0x2e')],_0x4650d4[_0x0312('0x2f')]),_0x1851bc);if(_0x27525c['query'][_0x0312('0x39')]){_0x13eff3['where']=_['merge'](_0x13eff3[_0x0312('0x37')],{'$or':_[_0x0312('0x28')](_0x1851bc,function(_0xcda596){if(_0xcda596[_0x0312('0x2c')]!==_0x0312('0x3a')){var _0x1ee439={};_0x1ee439[_0xcda596[_0x0312('0x25')]]={'$like':'%'+_0x27525c[_0x0312('0x2e')][_0x0312('0x39')]+'%'};return _0x1ee439;}})});}_0x13eff3=_[_0x0312('0x3b')]({},_0x13eff3,_0x27525c[_0x0312('0x3c')]);var _0x14a737={'where':_0x13eff3['where']};return db[_0x0312('0x29')]['count'](_0x14a737)[_0x0312('0x1f')](function(_0x412667){_0x3ed80[_0x0312('0x17')]=_0x412667;if(_0x27525c[_0x0312('0x2e')][_0x0312('0x3d')]){_0x13eff3['include']=[{'all':!![]}];}return db['Sound'][_0x0312('0x3e')](_0x13eff3);})[_0x0312('0x1f')](function(_0x43f029){_0x3ed80['rows']=_0x43f029;return _0x3ed80;})['then'](respondWithFilteredResult(_0x5727f2,_0x13eff3))[_0x0312('0x3f')](handleError(_0x5727f2,null));};exports[_0x0312('0x40')]=function(_0xf0e417,_0x487afa){var _0x3deb3c={'raw':!![],'where':{'id':_0xf0e417[_0x0312('0x41')]['id']}},_0x5d2cfd={};_0x5d2cfd[_0x0312('0x42')]=_['keys'](db['Sound'][_0x0312('0x2a')]);_0x5d2cfd[_0x0312('0x2e')]=_[_0x0312('0x43')](_0xf0e417['query']);_0x5d2cfd[_0x0312('0x2f')]=_['intersection'](_0x5d2cfd[_0x0312('0x42')],_0x5d2cfd[_0x0312('0x2e')]);_0x3deb3c[_0x0312('0x31')]=_[_0x0312('0x30')](_0x5d2cfd[_0x0312('0x42')],qs[_0x0312('0x32')](_0xf0e417['query'][_0x0312('0x32')]));_0x3deb3c['attributes']=_0x3deb3c[_0x0312('0x31')][_0x0312('0x33')]?_0x3deb3c[_0x0312('0x31')]:_0x5d2cfd[_0x0312('0x42')];if(_0xf0e417['query'][_0x0312('0x3d')]){_0x3deb3c[_0x0312('0x44')]=[{'all':!![]}];}_0x3deb3c=_['merge']({},_0x3deb3c,_0xf0e417['options']);return db[_0x0312('0x29')][_0x0312('0x45')](_0x3deb3c)[_0x0312('0x1f')](handleEntityNotFound(_0x487afa,null))[_0x0312('0x1f')](respondWithResult(_0x487afa,null))['catch'](handleError(_0x487afa,null));};exports['download']=function(_0x43cf9c,_0x3c0a8c,_0x2e8490){return db[_0x0312('0x29')][_0x0312('0x45')]({'where':{'id':_0x43cf9c['params']['id']},'attributes':['name',_0x0312('0x46'),_0x0312('0x47')],'raw':!![]})[_0x0312('0x1f')](handleEntityNotFound(_0x3c0a8c,null))[_0x0312('0x1f')](function(_0x463ab8){if(_0x463ab8){if(!fs['existsSync'](path[_0x0312('0x48')](config['root'],_0x0312('0x49'),_0x463ab8['save_name']+'.'+_0x463ab8[_0x0312('0x47')]))){throw new db[(_0x0312('0x4a'))][(_0x0312('0x4b'))](_0x0312('0x4c'));}return _0x3c0a8c[_0x0312('0x4d')](path[_0x0312('0x48')](config[_0x0312('0x4e')],_0x0312('0x49'),util[_0x0312('0x4f')](_0x0312('0x50'),_0x463ab8['save_name'],_0x463ab8['converted_format'])),util[_0x0312('0x4f')](_0x0312('0x50'),_0x463ab8[_0x0312('0x25')],_0x463ab8[_0x0312('0x47')]));}return null;})[_0x0312('0x3f')](handleError(_0x3c0a8c,null));};exports[_0x0312('0x51')]=function(_0x4c4499,_0x31af6d,_0x3c40ce){var _0x38950f={'name':path[_0x0312('0x52')](_0x4c4499[_0x0312('0x53')]['originalname'],path[_0x0312('0x54')](_0x4c4499[_0x0312('0x53')][_0x0312('0x55')])),'save_name':path['basename'](_0x4c4499[_0x0312('0x53')][_0x0312('0x56')],path['extname'](_0x4c4499[_0x0312('0x53')][_0x0312('0x56')])),'original_format':path[_0x0312('0x54')](_0x4c4499[_0x0312('0x53')][_0x0312('0x55')])[_0x0312('0x57')](0x1),'converted_format':_0x0312('0x58')};var _0x57769d=path[_0x0312('0x48')](config[_0x0312('0x4e')],_0x0312('0x59'),_0x4c4499[_0x0312('0x53')][_0x0312('0x56')]);var _0x1d9b22=path[_0x0312('0x48')](config[_0x0312('0x4e')],_0x0312('0x49'),util['format']('%s.%s',path[_0x0312('0x52')](_0x4c4499[_0x0312('0x53')][_0x0312('0x56')],path[_0x0312('0x54')](_0x4c4499[_0x0312('0x53')][_0x0312('0x56')])),_0x38950f['converted_format']));logger[_0x0312('0x5a')](_0x0312('0x5b'),_0x57769d);logger['info']('Sound\x20upload\x20destination:\x20%s',_0x1d9b22);try{fs[_0x0312('0x5c')](_0x57769d,parseInt(_0x0312('0x5d'),0x8));var _0x170802=sox[_0x0312('0x5e')](_0x57769d,_0x1d9b22,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x170802['on'](_0x0312('0x5f'),function(_0x250019){fs[_0x0312('0x60')](_0x57769d);_0x31af6d['status'](0x1f4)[_0x0312('0x26')](_0x250019);});_0x170802['on'](_0x0312('0x61'),function(_0x2dffd5){_0x38950f[_0x0312('0x62')]=isNaN(_0x2dffd5[_0x0312('0x63')])?null:_0x2dffd5[_0x0312('0x63')]*0x3e8;_0x38950f[_0x0312('0x64')]=isNaN(_0x2dffd5[_0x0312('0x65')])?null:_0x2dffd5['sampleCount'];_0x38950f[_0x0312('0x66')]=isNaN(_0x2dffd5[_0x0312('0x67')])?null:_0x2dffd5[_0x0312('0x67')];_0x38950f[_0x0312('0x68')]=isNaN(_0x2dffd5[_0x0312('0x69')])?null:_0x2dffd5[_0x0312('0x69')];_0x38950f[_0x0312('0x6a')]=isNaN(_0x2dffd5[_0x0312('0x6b')])?null:_0x2dffd5['sampleRate'];});_0x170802['on'](_0x0312('0x6c'),function(_0x1c58f1){_0x38950f[_0x0312('0x6d')]=isNaN(_0x1c58f1[_0x0312('0x63')])?null:_0x1c58f1[_0x0312('0x63')]*0x3e8;_0x38950f[_0x0312('0x6e')]=isNaN(_0x1c58f1[_0x0312('0x65')])?null:_0x1c58f1[_0x0312('0x65')];_0x38950f[_0x0312('0x6f')]=isNaN(_0x1c58f1[_0x0312('0x67')])?null:_0x1c58f1[_0x0312('0x67')];_0x38950f['converted_bitRate']=isNaN(_0x1c58f1[_0x0312('0x69')])?null:_0x1c58f1[_0x0312('0x69')];_0x38950f[_0x0312('0x70')]=isNaN(_0x1c58f1[_0x0312('0x6b')])?null:_0x1c58f1[_0x0312('0x6b')];});_0x170802['on'](_0x0312('0x14'),function(){fs[_0x0312('0x5c')](_0x1d9b22,parseInt(_0x0312('0x5d'),0x8));return db[_0x0312('0x29')][_0x0312('0x51')](_0x38950f)[_0x0312('0x1f')](function(_0x551dd1){var _0x5a468c={'role':_0x4c4499['body'][_0x0312('0x71')],'userProfileId':_0x4c4499[_0x0312('0x72')][_0x0312('0x73')]};if(!_0x5a468c)throw new Error(_0x0312('0x74'));if(_0x5a468c[_0x0312('0x71')]===_0x0312('0x75')){var _0x4a0281=_0x551dd1[_0x0312('0x21')]({'plain':!![]});return db[_0x0312('0x76')][_0x0312('0x45')]({'where':{'name':_0x0312('0x22'),'userProfileId':_0x5a468c[_0x0312('0x73')]},'raw':!![]})[_0x0312('0x1f')](function(_0x2a9dfc){if(_0x2a9dfc&&_0x2a9dfc[_0x0312('0x77')]===0x0){return db[_0x0312('0x23')]['create']({'name':_0x4a0281[_0x0312('0x25')],'resourceId':_0x4a0281['id'],'type':_0x2a9dfc[_0x0312('0x25')],'sectionId':_0x2a9dfc['id']},{})['then'](function(){return _0x551dd1;});}else{return _0x551dd1;}})[_0x0312('0x3f')](function(_0x4f02b7){logger[_0x0312('0x5f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f02b7);throw _0x4f02b7;});}return _0x551dd1;})['then'](respondWithResult(_0x31af6d,null))['catch'](handleError(_0x31af6d,null));});_0x170802['start']();}catch(_0x373398){_0x31af6d[_0x0312('0x13')](0x1f4)['send'](_0x373398);}};exports[_0x0312('0x1e')]=function(_0x4188d2,_0x514ba7,_0x1198b7){return db['Sound'][_0x0312('0x45')]({'where':{'id':_0x4188d2[_0x0312('0x41')]['id']}})[_0x0312('0x1f')](handleEntityNotFound(_0x514ba7,null))[_0x0312('0x1f')](saveUpdates(_[_0x0312('0x38')](_0x4188d2[_0x0312('0x72')],[_0x0312('0x25'),_0x0312('0x78')]),null))[_0x0312('0x1f')](respondWithResult(_0x514ba7,null))[_0x0312('0x3f')](handleError(_0x514ba7,null));};exports[_0x0312('0x79')]=function(_0x4fc482,_0x310c65,_0xf76af0){return db[_0x0312('0x29')]['find']({'where':{'id':_0x4fc482[_0x0312('0x41')]['id']}})['then'](function(_0x1f906d){if(_0x1f906d){return _0x1f906d[_0x0312('0x20')]();}})[_0x0312('0x1f')](function(_0x48ffc3){var _0x450b4b=path[_0x0312('0x48')](config['root'],_0x0312('0x59'),util[_0x0312('0x4f')]('%s.%s',_0x48ffc3[_0x0312('0x46')],_0x48ffc3['original_format']));var _0x12305e=path[_0x0312('0x48')](config['root'],_0x0312('0x49'),util[_0x0312('0x4f')]('%s.%s',_0x48ffc3[_0x0312('0x46')],_0x48ffc3[_0x0312('0x47')]));fs['unlinkSync'](_0x450b4b);fs[_0x0312('0x60')](_0x12305e);return _0x48ffc3;})['then'](function(_0x1434c0){if(_0x1434c0){return _0x310c65[_0x0312('0x13')](0xcc)[_0x0312('0x14')]();}})[_0x0312('0x1f')](handleEntityNotFound(_0x310c65,null))[_0x0312('0x3f')](handleError(_0x310c65,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 2966ff3..cf7e27e 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 _0x258a=['../../config/environment','./sound.attributes','exports','define','tools_sounds','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x2ddfd9,_0x5877d0){var _0x2668f0=function(_0x70ad6f){while(--_0x70ad6f){_0x2ddfd9['push'](_0x2ddfd9['shift']());}};_0x2668f0(++_0x5877d0);}(_0x258a,0x119));var _0xa258=function(_0x321a50,_0x12e74c){_0x321a50=_0x321a50-0x0;var _0x3b1908=_0x258a[_0x321a50];return _0x3b1908;};'use strict';var _=require('lodash');var util=require(_0xa258('0x0'));var logger=require(_0xa258('0x1'))(_0xa258('0x2'));var moment=require(_0xa258('0x3'));var BPromise=require('bluebird');var rp=require(_0xa258('0x4'));var fs=require('fs');var path=require(_0xa258('0x5'));var rimraf=require(_0xa258('0x6'));var config=require(_0xa258('0x7'));var attributes=require(_0xa258('0x8'));module[_0xa258('0x9')]=function(_0x3e4828,_0xf33231){return _0x3e4828[_0xa258('0xa')]('Sound',attributes,{'tableName':_0xa258('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x196e=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./sound.attributes','exports','define','Sound','tools_sounds','lodash'];(function(_0x2384f6,_0x167775){var _0x370294=function(_0x8f68f4){while(--_0x8f68f4){_0x2384f6['push'](_0x2384f6['shift']());}};_0x370294(++_0x167775);}(_0x196e,0x11d));var _0xe196=function(_0x3a6e4b,_0x118cd9){_0x3a6e4b=_0x3a6e4b-0x0;var _0x36572d=_0x196e[_0x3a6e4b];return _0x36572d;};'use strict';var _=require(_0xe196('0x0'));var util=require(_0xe196('0x1'));var logger=require(_0xe196('0x2'))(_0xe196('0x3'));var moment=require(_0xe196('0x4'));var BPromise=require(_0xe196('0x5'));var rp=require(_0xe196('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe196('0x7'));var config=require('../../config/environment');var attributes=require(_0xe196('0x8'));module[_0xe196('0x9')]=function(_0x2d8c09,_0x3aeafa){return _0x2d8c09[_0xe196('0xa')](_0xe196('0xb'),attributes,{'tableName':_0xe196('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 b9decc3..76269fd 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 _0x0bdf=['map','model','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','error','message','result','ShowSound','Sound','find','options','raw','where','attributes','include'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x0bdf,0x103));var _0xf0bd=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x0bdf[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0xf0bd('0x0'));var util=require(_0xf0bd('0x1'));var moment=require(_0xf0bd('0x2'));var BPromise=require(_0xf0bd('0x3'));var rs=require(_0xf0bd('0x4'));var fs=require('fs');var Redis=require(_0xf0bd('0x5'));var db=require(_0xf0bd('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0bd('0x7'))(_0xf0bd('0x8'));var config=require(_0xf0bd('0x9'));var jayson=require(_0xf0bd('0xa'));var client=jayson[_0xf0bd('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b2356,_0x54cc28,_0x362d75){return new BPromise(function(_0x21fd4b,_0xa2187a){return client[_0xf0bd('0xc')](_0x4b2356,_0x362d75)[_0xf0bd('0xd')](function(_0x407dc3){logger[_0xf0bd('0xe')](_0xf0bd('0xf'),_0x54cc28,_0xf0bd('0x10'));logger['debug'](_0xf0bd('0x11'),_0x54cc28,_0xf0bd('0x10'),JSON['stringify'](_0x407dc3));if(_0x407dc3[_0xf0bd('0x12')]){if(_0x407dc3[_0xf0bd('0x12')]['code']===0x1f4){logger[_0xf0bd('0x12')](_0xf0bd('0xf'),_0x54cc28,_0x407dc3[_0xf0bd('0x12')][_0xf0bd('0x13')]);return _0xa2187a(_0x407dc3[_0xf0bd('0x12')][_0xf0bd('0x13')]);}logger[_0xf0bd('0x12')](_0xf0bd('0xf'),_0x54cc28,_0x407dc3[_0xf0bd('0x12')][_0xf0bd('0x13')]);return _0x21fd4b(_0x407dc3['error'][_0xf0bd('0x13')]);}else{logger['info'](_0xf0bd('0xf'),_0x54cc28,'request\x20sent');_0x21fd4b(_0x407dc3[_0xf0bd('0x14')][_0xf0bd('0x13')]);}})['catch'](function(_0x8edd5f){logger[_0xf0bd('0x12')](_0xf0bd('0xf'),_0x54cc28,_0x8edd5f);_0xa2187a(_0x8edd5f);});});}exports[_0xf0bd('0x15')]=function(_0x3696ba){var _0x4faef6=this;return new Promise(function(_0x229c02,_0x2f433b){return db[_0xf0bd('0x16')][_0xf0bd('0x17')]({'raw':_0x3696ba['options']?_0x3696ba[_0xf0bd('0x18')][_0xf0bd('0x19')]===undefined?!![]:![]:!![],'where':_0x3696ba[_0xf0bd('0x18')]?_0x3696ba[_0xf0bd('0x18')][_0xf0bd('0x1a')]||null:null,'attributes':_0x3696ba[_0xf0bd('0x18')]?_0x3696ba[_0xf0bd('0x18')][_0xf0bd('0x1b')]||null:null,'include':_0x3696ba['options']?_0x3696ba[_0xf0bd('0x18')][_0xf0bd('0x1c')]?_[_0xf0bd('0x1d')](_0x3696ba['options'][_0xf0bd('0x1c')],function(_0x14ef56){return{'model':db[_0x14ef56[_0xf0bd('0x1e')]],'as':_0x14ef56['as'],'attributes':_0x14ef56[_0xf0bd('0x1b')],'include':_0x14ef56[_0xf0bd('0x1c')]?_['map'](_0x14ef56['include'],function(_0x39fc97){return{'model':db[_0x39fc97[_0xf0bd('0x1e')]],'as':_0x39fc97['as'],'attributes':_0x39fc97[_0xf0bd('0x1b')],'include':_0x39fc97[_0xf0bd('0x1c')]?_[_0xf0bd('0x1d')](_0x39fc97[_0xf0bd('0x1c')],function(_0x36dcab){return{'model':db[_0x36dcab['model']],'as':_0x36dcab['as'],'attributes':_0x36dcab['attributes']};}):[]};}):[]};}):[]:[]})[_0xf0bd('0xd')](function(_0x17863a){logger['info'](_0xf0bd('0x15'),_0x3696ba);logger[_0xf0bd('0x1f')](_0xf0bd('0x15'),_0x3696ba,JSON['stringify'](_0x17863a));_0x229c02(_0x17863a);})['catch'](function(_0xacd595){logger['error'](_0xf0bd('0x15'),_0xacd595[_0xf0bd('0x13')],_0x3696ba);_0x2f433b(_0x4faef6[_0xf0bd('0x12')](0x1f4,_0xacd595[_0xf0bd('0x13')]));});});}; \ No newline at end of file +var _0x21f7=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','find','options','raw','attributes','include','map','model','then','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0xd95ef1,_0x3ad820){var _0x32f4c0=function(_0x4733da){while(--_0x4733da){_0xd95ef1['push'](_0xd95ef1['shift']());}};_0x32f4c0(++_0x3ad820);}(_0x21f7,0xf3));var _0x721f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x21f7[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x721f('0x0'));var util=require(_0x721f('0x1'));var moment=require('moment');var BPromise=require(_0x721f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x721f('0x3'));var db=require(_0x721f('0x4'))['db'];var utils=require(_0x721f('0x5'));var logger=require(_0x721f('0x6'))(_0x721f('0x7'));var config=require(_0x721f('0x8'));var jayson=require(_0x721f('0x9'));var client=jayson[_0x721f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3dd9d3,_0x4a440b,_0x29929c){return new BPromise(function(_0x156352,_0x226713){return client[_0x721f('0xb')](_0x3dd9d3,_0x29929c)['then'](function(_0x1d77b1){logger[_0x721f('0xc')](_0x721f('0xd'),_0x4a440b,_0x721f('0xe'));logger['debug'](_0x721f('0xf'),_0x4a440b,_0x721f('0xe'),JSON[_0x721f('0x10')](_0x1d77b1));if(_0x1d77b1[_0x721f('0x11')]){if(_0x1d77b1[_0x721f('0x11')][_0x721f('0x12')]===0x1f4){logger['error'](_0x721f('0xd'),_0x4a440b,_0x1d77b1[_0x721f('0x11')][_0x721f('0x13')]);return _0x226713(_0x1d77b1[_0x721f('0x11')][_0x721f('0x13')]);}logger['error']('Sound,\x20%s,\x20%s',_0x4a440b,_0x1d77b1[_0x721f('0x11')][_0x721f('0x13')]);return _0x156352(_0x1d77b1['error'][_0x721f('0x13')]);}else{logger[_0x721f('0xc')](_0x721f('0xd'),_0x4a440b,_0x721f('0xe'));_0x156352(_0x1d77b1[_0x721f('0x14')][_0x721f('0x13')]);}})[_0x721f('0x15')](function(_0x3ac7ea){logger['error']('Sound,\x20%s,\x20%s',_0x4a440b,_0x3ac7ea);_0x226713(_0x3ac7ea);});});}exports[_0x721f('0x16')]=function(_0x322a62){var _0xed4190=this;return new Promise(function(_0x2f92fa,_0x69f138){return db['Sound'][_0x721f('0x17')]({'raw':_0x322a62[_0x721f('0x18')]?_0x322a62[_0x721f('0x18')][_0x721f('0x19')]===undefined?!![]:![]:!![],'where':_0x322a62[_0x721f('0x18')]?_0x322a62[_0x721f('0x18')]['where']||null:null,'attributes':_0x322a62[_0x721f('0x18')]?_0x322a62['options'][_0x721f('0x1a')]||null:null,'include':_0x322a62['options']?_0x322a62['options'][_0x721f('0x1b')]?_[_0x721f('0x1c')](_0x322a62[_0x721f('0x18')][_0x721f('0x1b')],function(_0x3afe68){return{'model':db[_0x3afe68[_0x721f('0x1d')]],'as':_0x3afe68['as'],'attributes':_0x3afe68[_0x721f('0x1a')],'include':_0x3afe68['include']?_[_0x721f('0x1c')](_0x3afe68['include'],function(_0x2ed55f){return{'model':db[_0x2ed55f[_0x721f('0x1d')]],'as':_0x2ed55f['as'],'attributes':_0x2ed55f[_0x721f('0x1a')],'include':_0x2ed55f[_0x721f('0x1b')]?_['map'](_0x2ed55f['include'],function(_0x4a86a6){return{'model':db[_0x4a86a6[_0x721f('0x1d')]],'as':_0x4a86a6['as'],'attributes':_0x4a86a6[_0x721f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x721f('0x1e')](function(_0x23e86e){logger['info'](_0x721f('0x16'),_0x322a62);logger['debug'](_0x721f('0x16'),_0x322a62,JSON[_0x721f('0x10')](_0x23e86e));_0x2f92fa(_0x23e86e);})[_0x721f('0x15')](function(_0x393eb9){logger[_0x721f('0x11')](_0x721f('0x16'),_0x393eb9[_0x721f('0x13')],_0x322a62);_0x69f138(_0xed4190[_0x721f('0x11')](0x1f4,_0x393eb9['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 93ed78c..4addfd1 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 _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(_0x673722,_0x275d7e){var _0x21249c=function(_0x25b4e7){while(--_0x25b4e7){_0x673722['push'](_0x673722['shift']());}};_0x21249c(++_0x275d7e);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x1df26,_0x618d00){_0x1df26=_0x1df26-0x0;var _0x102076=_0x9ffd[_0x1df26];return _0x102076;};'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 +var _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x45ab2a,_0x2362fd){var _0x2a64ce=function(_0x1a4fd6){while(--_0x1a4fd6){_0x45ab2a['push'](_0x45ab2a['shift']());}};_0x2a64ce(++_0x2362fd);}(_0xda3f,0xec));var _0xfda3=function(_0x5abceb,_0x1eda10){_0x5abceb=_0x5abceb-0x0;var _0x4d4e11=_0xda3f[_0x5abceb];return _0x4d4e11;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./squareMessage.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x9')]('/',auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0xb')](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0xe')]);module[_0xfda3('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 6db1f1c..3eb0f46 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 _0xe183=['ENUM','out','STRING','sequelize','exports','TEXT','medium'];(function(_0x1e4309,_0x40271e){var _0x3e26b6=function(_0x2c57af){while(--_0x2c57af){_0x1e4309['push'](_0x1e4309['shift']());}};_0x3e26b6(++_0x40271e);}(_0xe183,0xc7));var _0x3e18=function(_0x163040,_0x38a58c){_0x163040=_0x163040-0x0;var _0x364667=_0xe183[_0x163040];return _0x364667;};'use strict';var Sequelize=require(_0x3e18('0x0'));module[_0x3e18('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x3e18('0x2')](_0x3e18('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x3e18('0x4')]('in','out'),'defaultValue':_0x3e18('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x3e18('0x6')]},'providerResponse':{'type':Sequelize[_0x3e18('0x2')]}}; \ No newline at end of file +var _0x78d2=['STRING','TEXT','medium','ENUM','out','exports'];(function(_0x191c61,_0x13bc75){var _0x360b7a=function(_0x420c09){while(--_0x420c09){_0x191c61['push'](_0x191c61['shift']());}};_0x360b7a(++_0x13bc75);}(_0x78d2,0x149));var _0x278d=function(_0x19a9b5,_0x198382){_0x19a9b5=_0x19a9b5-0x0;var _0x632733=_0x78d2[_0x19a9b5];return _0x632733;};'use strict';var Sequelize=require('sequelize');module[_0x278d('0x0')]={'uniqueid':{'type':Sequelize[_0x278d('0x1')]},'body':{'type':Sequelize[_0x278d('0x2')](_0x278d('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x278d('0x4')]('in',_0x278d('0x5')),'defaultValue':_0x278d('0x5'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 58beb36..0d833b7 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 _0x717b=['to-csv','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','sendStatus','error','stack','name','index','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','include','findAll','catch','show','params','keys','includeAll','options','find','create','body','destroy','zip-dir','request-promise','bluebird','mustache','util','path','sox'];(function(_0x28c7ac,_0x22173d){var _0x47fcfa=function(_0x4873a2){while(--_0x4873a2){_0x28c7ac['push'](_0x28c7ac['shift']());}};_0x47fcfa(++_0x22173d);}(_0x717b,0x111));var _0xb717=function(_0x2de606,_0x440431){_0x2de606=_0x2de606-0x0;var _0x2a39d5=_0x717b[_0x2de606];return _0x2a39d5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb717('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb717('0x1'));var moment=require('moment');var BPromise=require(_0xb717('0x2'));var Mustache=require(_0xb717('0x3'));var util=require(_0xb717('0x4'));var path=require(_0xb717('0x5'));var sox=require(_0xb717('0x6'));var csv=require(_0xb717('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb717('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb717('0x9'));var jsforce=require(_0xb717('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xb717('0x7'));var querystring=require(_0xb717('0xb'));var Papa=require(_0xb717('0xc'));var Redis=require(_0xb717('0xd'));var authService=require(_0xb717('0xe'));var qs=require(_0xb717('0xf'));var as=require(_0xb717('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb717('0x11'));var utils=require(_0xb717('0x12'));var config=require(_0xb717('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5617a9,_0x29a138){_0x29a138=_0x29a138||0xcc;return function(_0x50704f){if(_0x50704f){return _0x5617a9['sendStatus'](_0x29a138);}return _0x5617a9[_0xb717('0x14')](_0x29a138)[_0xb717('0x15')]();};}function respondWithResult(_0x2a034b,_0x160ec6){_0x160ec6=_0x160ec6||0xc8;return function(_0xefdc6a){if(_0xefdc6a){return _0x2a034b['status'](_0x160ec6)[_0xb717('0x16')](_0xefdc6a);}};}function respondWithFilteredResult(_0xe29f57,_0x2a9042){return function(_0x3663f4){if(_0x3663f4){var _0x126726=typeof _0x2a9042[_0xb717('0x17')]===_0xb717('0x18')&&typeof _0x2a9042[_0xb717('0x19')]===_0xb717('0x18');var _0x4c6b9b=_0x3663f4[_0xb717('0x1a')];var _0x537656=_0x126726?0x0:_0x2a9042[_0xb717('0x17')];var _0x4a2887=_0x126726?_0x3663f4[_0xb717('0x1a')]:_0x2a9042['offset']+_0x2a9042['limit'];var _0x2fceb6;if(_0x4a2887>=_0x4c6b9b){_0x4a2887=_0x4c6b9b;_0x2fceb6=0xc8;}else{_0x2fceb6=0xce;}_0xe29f57[_0xb717('0x14')](_0x2fceb6);return _0xe29f57[_0xb717('0x1b')]('Content-Range',_0x537656+'-'+_0x4a2887+'/'+_0x4c6b9b)[_0xb717('0x16')](_0x3663f4);}return null;};}function patchUpdates(_0x2fc55d){return function(_0x4ca98f){try{jsonpatch[_0xb717('0x1c')](_0x4ca98f,_0x2fc55d,!![]);}catch(_0x46a539){return BPromise['reject'](_0x46a539);}return _0x4ca98f[_0xb717('0x1d')]();};}function saveUpdates(_0x199f3c,_0x2409f1){return function(_0x2c2fbe){if(_0x2c2fbe){return _0x2c2fbe[_0xb717('0x1e')](_0x199f3c)[_0xb717('0x1f')](function(_0xe421b4){return _0xe421b4;});}return null;};}function removeEntity(_0x4a9d00,_0x42e2e8){return function(_0x5916e2){if(_0x5916e2){return _0x5916e2['destroy']()['then'](function(){_0x4a9d00[_0xb717('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf9ca34,_0x1162ac){return function(_0x11bb7b){if(!_0x11bb7b){_0xf9ca34[_0xb717('0x20')](0x194);}return _0x11bb7b;};}function handleError(_0x31ac0d,_0x3ae577){_0x3ae577=_0x3ae577||0x1f4;return function(_0x3afb6c){logger[_0xb717('0x21')](_0x3afb6c[_0xb717('0x22')]);if(_0x3afb6c[_0xb717('0x23')]){delete _0x3afb6c[_0xb717('0x23')];}_0x31ac0d['status'](_0x3ae577)['send'](_0x3afb6c);};}exports[_0xb717('0x24')]=function(_0x330bea,_0x2c7637){var _0x21f714={},_0x367d15={},_0x3a2412={'count':0x0,'rows':[]};var _0x5a5f04=_[_0xb717('0x25')](db[_0xb717('0x26')][_0xb717('0x27')],function(_0x5ad367){return{'name':_0x5ad367[_0xb717('0x28')],'type':_0x5ad367[_0xb717('0x29')][_0xb717('0x2a')]};});_0x367d15[_0xb717('0x2b')]=_[_0xb717('0x25')](_0x5a5f04,'name');_0x367d15[_0xb717('0x2c')]=_['keys'](_0x330bea[_0xb717('0x2c')]);_0x367d15[_0xb717('0x2d')]=_[_0xb717('0x2e')](_0x367d15[_0xb717('0x2b')],_0x367d15[_0xb717('0x2c')]);_0x21f714[_0xb717('0x2f')]=_[_0xb717('0x2e')](_0x367d15['model'],qs[_0xb717('0x30')](_0x330bea['query'][_0xb717('0x30')]));_0x21f714['attributes']=_0x21f714[_0xb717('0x2f')][_0xb717('0x31')]?_0x21f714[_0xb717('0x2f')]:_0x367d15[_0xb717('0x2b')];if(!_0x330bea[_0xb717('0x2c')]['hasOwnProperty'](_0xb717('0x32'))){_0x21f714[_0xb717('0x19')]=qs[_0xb717('0x19')](_0x330bea[_0xb717('0x2c')]['limit']);_0x21f714[_0xb717('0x17')]=qs['offset'](_0x330bea['query'][_0xb717('0x17')]);}_0x21f714[_0xb717('0x33')]=qs[_0xb717('0x34')](_0x330bea['query'][_0xb717('0x34')]);_0x21f714[_0xb717('0x35')]=qs[_0xb717('0x2d')](_[_0xb717('0x36')](_0x330bea[_0xb717('0x2c')],_0x367d15[_0xb717('0x2d')]),_0x5a5f04);if(_0x330bea['query']['filter']){_0x21f714['where']=_['merge'](_0x21f714[_0xb717('0x35')],{'$or':_[_0xb717('0x25')](_0x5a5f04,function(_0x280e16){if(_0x280e16['type']!==_0xb717('0x37')){var _0x3344d5={};_0x3344d5[_0x280e16[_0xb717('0x23')]]={'$like':'%'+_0x330bea[_0xb717('0x2c')][_0xb717('0x38')]+'%'};return _0x3344d5;}})});}_0x21f714=_[_0xb717('0x39')]({},_0x21f714,_0x330bea['options']);var _0x4627ad={'where':_0x21f714[_0xb717('0x35')]};return db['SquareMessage'][_0xb717('0x1a')](_0x4627ad)['then'](function(_0x5bc2b7){_0x3a2412[_0xb717('0x1a')]=_0x5bc2b7;if(_0x330bea[_0xb717('0x2c')]['includeAll']){_0x21f714[_0xb717('0x3a')]=[{'all':!![]}];}return db[_0xb717('0x26')][_0xb717('0x3b')](_0x21f714);})[_0xb717('0x1f')](function(_0x10fbfa){_0x3a2412['rows']=_0x10fbfa;return _0x3a2412;})['then'](respondWithFilteredResult(_0x2c7637,_0x21f714))[_0xb717('0x3c')](handleError(_0x2c7637,null));};exports[_0xb717('0x3d')]=function(_0xa72002,_0x3a4531){var _0x579f4={'raw':!![],'where':{'id':_0xa72002[_0xb717('0x3e')]['id']}},_0x87143b={};_0x87143b[_0xb717('0x2b')]=_[_0xb717('0x3f')](db['SquareMessage'][_0xb717('0x27')]);_0x87143b[_0xb717('0x2c')]=_['keys'](_0xa72002[_0xb717('0x2c')]);_0x87143b['filters']=_[_0xb717('0x2e')](_0x87143b[_0xb717('0x2b')],_0x87143b[_0xb717('0x2c')]);_0x579f4[_0xb717('0x2f')]=_[_0xb717('0x2e')](_0x87143b['model'],qs[_0xb717('0x30')](_0xa72002[_0xb717('0x2c')][_0xb717('0x30')]));_0x579f4[_0xb717('0x2f')]=_0x579f4[_0xb717('0x2f')][_0xb717('0x31')]?_0x579f4['attributes']:_0x87143b[_0xb717('0x2b')];if(_0xa72002[_0xb717('0x2c')][_0xb717('0x40')]){_0x579f4['include']=[{'all':!![]}];}_0x579f4=_['merge']({},_0x579f4,_0xa72002[_0xb717('0x41')]);return db[_0xb717('0x26')][_0xb717('0x42')](_0x579f4)[_0xb717('0x1f')](handleEntityNotFound(_0x3a4531,null))[_0xb717('0x1f')](respondWithResult(_0x3a4531,null))[_0xb717('0x3c')](handleError(_0x3a4531,null));};exports['create']=function(_0x64efde,_0x26c1cb){return db[_0xb717('0x26')][_0xb717('0x43')](_0x64efde[_0xb717('0x44')],{})['then'](respondWithResult(_0x26c1cb,0xc9))[_0xb717('0x3c')](handleError(_0x26c1cb,null));};exports['update']=function(_0x5f056f,_0x15757a){if(_0x5f056f[_0xb717('0x44')]['id']){delete _0x5f056f[_0xb717('0x44')]['id'];}return db[_0xb717('0x26')][_0xb717('0x42')]({'where':{'id':_0x5f056f[_0xb717('0x3e')]['id']}})[_0xb717('0x1f')](handleEntityNotFound(_0x15757a,null))['then'](saveUpdates(_0x5f056f[_0xb717('0x44')],null))[_0xb717('0x1f')](respondWithResult(_0x15757a,null))[_0xb717('0x3c')](handleError(_0x15757a,null));};exports[_0xb717('0x45')]=function(_0x1ff177,_0x23ac89){return db[_0xb717('0x26')][_0xb717('0x42')]({'where':{'id':_0x1ff177['params']['id']}})[_0xb717('0x1f')](handleEntityNotFound(_0x23ac89,null))[_0xb717('0x1f')](removeEntity(_0x23ac89,null))[_0xb717('0x3c')](handleError(_0x23ac89,null));}; \ No newline at end of file +var _0x6059=['VIRTUAL','merge','options','SquareMessage','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','type'];(function(_0x46a634,_0x439b70){var _0x42007a=function(_0x2a9e29){while(--_0x2a9e29){_0x46a634['push'](_0x46a634['shift']());}};_0x42007a(++_0x439b70);}(_0x6059,0x186));var _0x9605=function(_0x43e97d,_0x56a06b){_0x43e97d=_0x43e97d-0x0;var _0x424cd9=_0x6059[_0x43e97d];return _0x424cd9;};'use strict';var emlformat=require(_0x9605('0x0'));var rimraf=require(_0x9605('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9605('0x2'));var rp=require(_0x9605('0x3'));var moment=require(_0x9605('0x4'));var BPromise=require(_0x9605('0x5'));var Mustache=require('mustache');var util=require(_0x9605('0x6'));var path=require(_0x9605('0x7'));var sox=require(_0x9605('0x8'));var csv=require('to-csv');var ejs=require(_0x9605('0x9'));var fs=require('fs');var fs_extra=require(_0x9605('0xa'));var _=require(_0x9605('0xb'));var squel=require('squel');var crypto=require(_0x9605('0xc'));var jsforce=require(_0x9605('0xd'));var deskjs=require(_0x9605('0xe'));var toCsv=require(_0x9605('0xf'));var querystring=require(_0x9605('0x10'));var Papa=require('papaparse');var Redis=require(_0x9605('0x11'));var authService=require(_0x9605('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9605('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9605('0x14'))(_0x9605('0x15'));var utils=require(_0x9605('0x16'));var config=require(_0x9605('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9605('0x18'))['db'];function respondWithStatusCode(_0x3ebab5,_0x14d27c){_0x14d27c=_0x14d27c||0xcc;return function(_0x1201c4){if(_0x1201c4){return _0x3ebab5[_0x9605('0x19')](_0x14d27c);}return _0x3ebab5[_0x9605('0x1a')](_0x14d27c)[_0x9605('0x1b')]();};}function respondWithResult(_0x5d4896,_0x166a39){_0x166a39=_0x166a39||0xc8;return function(_0x1a0a41){if(_0x1a0a41){return _0x5d4896[_0x9605('0x1a')](_0x166a39)[_0x9605('0x1c')](_0x1a0a41);}};}function respondWithFilteredResult(_0x532b1b,_0x1c528c){return function(_0x20af14){if(_0x20af14){var _0x55be57=typeof _0x1c528c['offset']===_0x9605('0x1d')&&typeof _0x1c528c[_0x9605('0x1e')]===_0x9605('0x1d');var _0x38df30=_0x20af14[_0x9605('0x1f')];var _0x449f29=_0x55be57?0x0:_0x1c528c[_0x9605('0x20')];var _0x5d92d2=_0x55be57?_0x20af14[_0x9605('0x1f')]:_0x1c528c[_0x9605('0x20')]+_0x1c528c[_0x9605('0x1e')];var _0x23805b;if(_0x5d92d2>=_0x38df30){_0x5d92d2=_0x38df30;_0x23805b=0xc8;}else{_0x23805b=0xce;}_0x532b1b['status'](_0x23805b);return _0x532b1b[_0x9605('0x21')](_0x9605('0x22'),_0x449f29+'-'+_0x5d92d2+'/'+_0x38df30)[_0x9605('0x1c')](_0x20af14);}return null;};}function patchUpdates(_0x3409c8){return function(_0x2bcd90){try{jsonpatch[_0x9605('0x23')](_0x2bcd90,_0x3409c8,!![]);}catch(_0x5b5242){return BPromise[_0x9605('0x24')](_0x5b5242);}return _0x2bcd90[_0x9605('0x25')]();};}function saveUpdates(_0x336637,_0x2a9973){return function(_0x5604cf){if(_0x5604cf){return _0x5604cf[_0x9605('0x26')](_0x336637)[_0x9605('0x27')](function(_0x25f26a){return _0x25f26a;});}return null;};}function removeEntity(_0xa4ac1d,_0x34f3fc){return function(_0x44a609){if(_0x44a609){return _0x44a609[_0x9605('0x28')]()[_0x9605('0x27')](function(){_0xa4ac1d[_0x9605('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40b86f,_0x399c4d){return function(_0x1d3346){if(!_0x1d3346){_0x40b86f[_0x9605('0x19')](0x194);}return _0x1d3346;};}function handleError(_0x329bb4,_0x43625e){_0x43625e=_0x43625e||0x1f4;return function(_0x451c91){logger['error'](_0x451c91['stack']);if(_0x451c91['name']){delete _0x451c91[_0x9605('0x29')];}_0x329bb4['status'](_0x43625e)[_0x9605('0x2a')](_0x451c91);};}exports[_0x9605('0x2b')]=function(_0x5a0d52,_0x5a4fa8){var _0x3d868e={},_0x43b25a={},_0x191ba2={'count':0x0,'rows':[]};var _0x47aa8c=_[_0x9605('0x2c')](db['SquareMessage']['rawAttributes'],function(_0x29fcf3){return{'name':_0x29fcf3[_0x9605('0x2d')],'type':_0x29fcf3['type']['key']};});_0x43b25a[_0x9605('0x2e')]=_[_0x9605('0x2c')](_0x47aa8c,_0x9605('0x29'));_0x43b25a['query']=_[_0x9605('0x2f')](_0x5a0d52[_0x9605('0x30')]);_0x43b25a[_0x9605('0x31')]=_[_0x9605('0x32')](_0x43b25a[_0x9605('0x2e')],_0x43b25a[_0x9605('0x30')]);_0x3d868e['attributes']=_[_0x9605('0x32')](_0x43b25a[_0x9605('0x2e')],qs[_0x9605('0x33')](_0x5a0d52[_0x9605('0x30')][_0x9605('0x33')]));_0x3d868e['attributes']=_0x3d868e[_0x9605('0x34')][_0x9605('0x35')]?_0x3d868e[_0x9605('0x34')]:_0x43b25a['model'];if(!_0x5a0d52[_0x9605('0x30')][_0x9605('0x36')]('nolimit')){_0x3d868e['limit']=qs[_0x9605('0x1e')](_0x5a0d52[_0x9605('0x30')]['limit']);_0x3d868e['offset']=qs['offset'](_0x5a0d52[_0x9605('0x30')][_0x9605('0x20')]);}_0x3d868e['order']=qs[_0x9605('0x37')](_0x5a0d52['query'][_0x9605('0x37')]);_0x3d868e[_0x9605('0x38')]=qs[_0x9605('0x31')](_[_0x9605('0x39')](_0x5a0d52['query'],_0x43b25a['filters']),_0x47aa8c);if(_0x5a0d52[_0x9605('0x30')][_0x9605('0x3a')]){_0x3d868e[_0x9605('0x38')]=_['merge'](_0x3d868e[_0x9605('0x38')],{'$or':_[_0x9605('0x2c')](_0x47aa8c,function(_0x42218e){if(_0x42218e[_0x9605('0x3b')]!==_0x9605('0x3c')){var _0x102a49={};_0x102a49[_0x42218e[_0x9605('0x29')]]={'$like':'%'+_0x5a0d52[_0x9605('0x30')]['filter']+'%'};return _0x102a49;}})});}_0x3d868e=_[_0x9605('0x3d')]({},_0x3d868e,_0x5a0d52[_0x9605('0x3e')]);var _0xd80a8={'where':_0x3d868e['where']};return db[_0x9605('0x3f')]['count'](_0xd80a8)[_0x9605('0x27')](function(_0xfc280e){_0x191ba2[_0x9605('0x1f')]=_0xfc280e;if(_0x5a0d52[_0x9605('0x30')][_0x9605('0x40')]){_0x3d868e[_0x9605('0x41')]=[{'all':!![]}];}return db[_0x9605('0x3f')][_0x9605('0x42')](_0x3d868e);})[_0x9605('0x27')](function(_0x27df76){_0x191ba2[_0x9605('0x43')]=_0x27df76;return _0x191ba2;})[_0x9605('0x27')](respondWithFilteredResult(_0x5a4fa8,_0x3d868e))[_0x9605('0x44')](handleError(_0x5a4fa8,null));};exports[_0x9605('0x45')]=function(_0x307370,_0x1d0d8f){var _0x5bee92={'raw':!![],'where':{'id':_0x307370['params']['id']}},_0x545368={};_0x545368['model']=_[_0x9605('0x2f')](db[_0x9605('0x3f')][_0x9605('0x46')]);_0x545368['query']=_[_0x9605('0x2f')](_0x307370[_0x9605('0x30')]);_0x545368[_0x9605('0x31')]=_[_0x9605('0x32')](_0x545368['model'],_0x545368[_0x9605('0x30')]);_0x5bee92['attributes']=_['intersection'](_0x545368[_0x9605('0x2e')],qs[_0x9605('0x33')](_0x307370[_0x9605('0x30')][_0x9605('0x33')]));_0x5bee92[_0x9605('0x34')]=_0x5bee92['attributes'][_0x9605('0x35')]?_0x5bee92[_0x9605('0x34')]:_0x545368['model'];if(_0x307370[_0x9605('0x30')][_0x9605('0x40')]){_0x5bee92['include']=[{'all':!![]}];}_0x5bee92=_[_0x9605('0x3d')]({},_0x5bee92,_0x307370['options']);return db[_0x9605('0x3f')][_0x9605('0x47')](_0x5bee92)[_0x9605('0x27')](handleEntityNotFound(_0x1d0d8f,null))[_0x9605('0x27')](respondWithResult(_0x1d0d8f,null))['catch'](handleError(_0x1d0d8f,null));};exports[_0x9605('0x48')]=function(_0x50dfad,_0x3a59f4){return db[_0x9605('0x3f')]['create'](_0x50dfad['body'],{})[_0x9605('0x27')](respondWithResult(_0x3a59f4,0xc9))[_0x9605('0x44')](handleError(_0x3a59f4,null));};exports[_0x9605('0x26')]=function(_0x492194,_0x56d1c3){if(_0x492194[_0x9605('0x49')]['id']){delete _0x492194['body']['id'];}return db[_0x9605('0x3f')]['find']({'where':{'id':_0x492194[_0x9605('0x4a')]['id']}})[_0x9605('0x27')](handleEntityNotFound(_0x56d1c3,null))[_0x9605('0x27')](saveUpdates(_0x492194['body'],null))[_0x9605('0x27')](respondWithResult(_0x56d1c3,null))[_0x9605('0x44')](handleError(_0x56d1c3,null));};exports[_0x9605('0x28')]=function(_0x59d4f3,_0x3a49c0){return db[_0x9605('0x3f')][_0x9605('0x47')]({'where':{'id':_0x59d4f3['params']['id']}})['then'](handleEntityNotFound(_0x3a49c0,null))['then'](removeEntity(_0x3a49c0,null))['catch'](handleError(_0x3a49c0,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index d169eae..5b0f26b 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 _0xd4ee=['SquareMessage','square_messages','lodash','api','bluebird','path','rimraf','../../config/environment','define'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0xd4ee,0xfe));var _0xed4e=function(_0x524811,_0x2cf6d6){_0x524811=_0x524811-0x0;var _0x39e0f9=_0xd4ee[_0x524811];return _0x39e0f9;};'use strict';var _=require(_0xed4e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xed4e('0x1'));var moment=require('moment');var BPromise=require(_0xed4e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed4e('0x3'));var rimraf=require(_0xed4e('0x4'));var config=require(_0xed4e('0x5'));var attributes=require('./squareMessage.attributes');module['exports']=function(_0x3d6a6d,_0x63bcae){return _0x3d6a6d[_0xed4e('0x6')](_0xed4e('0x7'),attributes,{'tableName':_0xed4e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe7d8=['api','moment','request-promise','path','rimraf','./squareMessage.attributes','exports','square_messages','lodash','util','../../config/logger'];(function(_0xe2fbf,_0x4e5f38){var _0x4a0ff2=function(_0x4f1746){while(--_0x4f1746){_0xe2fbf['push'](_0xe2fbf['shift']());}};_0x4a0ff2(++_0x4e5f38);}(_0xe7d8,0x152));var _0x8e7d=function(_0x1fd675,_0x165dfe){_0x1fd675=_0x1fd675-0x0;var _0x16b554=_0xe7d8[_0x1fd675];return _0x16b554;};'use strict';var _=require(_0x8e7d('0x0'));var util=require(_0x8e7d('0x1'));var logger=require(_0x8e7d('0x2'))(_0x8e7d('0x3'));var moment=require(_0x8e7d('0x4'));var BPromise=require('bluebird');var rp=require(_0x8e7d('0x5'));var fs=require('fs');var path=require(_0x8e7d('0x6'));var rimraf=require(_0x8e7d('0x7'));var config=require('../../config/environment');var attributes=require(_0x8e7d('0x8'));module[_0x8e7d('0x9')]=function(_0x5e12e2,_0x3fc4c7){return _0x5e12e2['define']('SquareMessage',attributes,{'tableName':_0x8e7d('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 c2f4f6c..2a05077 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 _0xe2cb=['lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','SquareMessage','create','body','options','raw','CreateSquareMessage','stringify'];(function(_0x5a60ce,_0x48f080){var _0x393e5e=function(_0x1c58fc){while(--_0x1c58fc){_0x5a60ce['push'](_0x5a60ce['shift']());}};_0x393e5e(++_0x48f080);}(_0xe2cb,0x150));var _0xbe2c=function(_0x2f2ecf,_0x1f9302){_0x2f2ecf=_0x2f2ecf-0x0;var _0x3f8130=_0xe2cb[_0x2f2ecf];return _0x3f8130;};'use strict';var _=require(_0xbe2c('0x0'));var util=require(_0xbe2c('0x1'));var moment=require(_0xbe2c('0x2'));var BPromise=require(_0xbe2c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbe2c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbe2c('0x5'))(_0xbe2c('0x6'));var config=require(_0xbe2c('0x7'));var jayson=require(_0xbe2c('0x8'));var client=jayson[_0xbe2c('0x9')][_0xbe2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf21fb,_0x219bc4,_0x3a798d){return new BPromise(function(_0x4205fb,_0x26967b){return client[_0xbe2c('0xb')](_0xf21fb,_0x3a798d)[_0xbe2c('0xc')](function(_0x5ebd83){logger[_0xbe2c('0xd')](_0xbe2c('0xe'),_0x219bc4,_0xbe2c('0xf'));logger[_0xbe2c('0x10')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x219bc4,_0xbe2c('0xf'),JSON['stringify'](_0x5ebd83));if(_0x5ebd83[_0xbe2c('0x11')]){if(_0x5ebd83[_0xbe2c('0x11')][_0xbe2c('0x12')]===0x1f4){logger[_0xbe2c('0x11')](_0xbe2c('0xe'),_0x219bc4,_0x5ebd83[_0xbe2c('0x11')][_0xbe2c('0x13')]);return _0x26967b(_0x5ebd83[_0xbe2c('0x11')][_0xbe2c('0x13')]);}logger[_0xbe2c('0x11')]('SquareMessage,\x20%s,\x20%s',_0x219bc4,_0x5ebd83[_0xbe2c('0x11')][_0xbe2c('0x13')]);return _0x4205fb(_0x5ebd83[_0xbe2c('0x11')]['message']);}else{logger[_0xbe2c('0xd')](_0xbe2c('0xe'),_0x219bc4,_0xbe2c('0xf'));_0x4205fb(_0x5ebd83[_0xbe2c('0x14')][_0xbe2c('0x13')]);}})['catch'](function(_0x14ec40){logger[_0xbe2c('0x11')]('SquareMessage,\x20%s,\x20%s',_0x219bc4,_0x14ec40);_0x26967b(_0x14ec40);});});}exports['CreateSquareMessage']=function(_0x346e0d){var _0x3a86bb=this;return new Promise(function(_0x2b477c,_0x4e440b){return db[_0xbe2c('0x15')][_0xbe2c('0x16')](_0x346e0d[_0xbe2c('0x17')],{'raw':_0x346e0d[_0xbe2c('0x18')]?_0x346e0d[_0xbe2c('0x18')][_0xbe2c('0x19')]===undefined?!![]:![]:!![]})[_0xbe2c('0xc')](function(_0x351fe6){logger['info']('CreateSquareMessage',_0x346e0d);logger[_0xbe2c('0x10')](_0xbe2c('0x1a'),_0x346e0d,JSON[_0xbe2c('0x1b')](_0x351fe6));_0x2b477c(_0x351fe6);})['catch'](function(_0x4e4368){logger[_0xbe2c('0x11')]('CreateSquareMessage',_0x4e4368['message'],_0x346e0d);_0x4e440b(_0x3a86bb['error'](0x1f4,_0x4e4368[_0xbe2c('0x13')]));});});}; \ No newline at end of file +var _0x9e02=['code','SquareMessage,\x20%s,\x20%s','message','result','SquareMessage','create','body','options','raw','CreateSquareMessage','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error'];(function(_0x50d6d6,_0x189c68){var _0x5d9bb4=function(_0x12ba37){while(--_0x12ba37){_0x50d6d6['push'](_0x50d6d6['shift']());}};_0x5d9bb4(++_0x189c68);}(_0x9e02,0x77));var _0x29e0=function(_0x504cbd,_0x24f370){_0x504cbd=_0x504cbd-0x0;var _0xa07ab=_0x9e02[_0x504cbd];return _0xa07ab;};'use strict';var _=require(_0x29e0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x29e0('0x1'));var rs=require(_0x29e0('0x2'));var fs=require('fs');var Redis=require(_0x29e0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x29e0('0x4'));var logger=require(_0x29e0('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x29e0('0x6'));var client=jayson[_0x29e0('0x7')][_0x29e0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x368ea8,_0x395aaa,_0x4d385b){return new BPromise(function(_0x2ef931,_0x31026e){return client[_0x29e0('0x9')](_0x368ea8,_0x4d385b)[_0x29e0('0xa')](function(_0x12984b){logger[_0x29e0('0xb')]('SquareMessage,\x20%s,\x20%s',_0x395aaa,_0x29e0('0xc'));logger[_0x29e0('0xd')](_0x29e0('0xe'),_0x395aaa,'request\x20sent',JSON['stringify'](_0x12984b));if(_0x12984b[_0x29e0('0xf')]){if(_0x12984b[_0x29e0('0xf')][_0x29e0('0x10')]===0x1f4){logger['error'](_0x29e0('0x11'),_0x395aaa,_0x12984b[_0x29e0('0xf')][_0x29e0('0x12')]);return _0x31026e(_0x12984b[_0x29e0('0xf')][_0x29e0('0x12')]);}logger[_0x29e0('0xf')](_0x29e0('0x11'),_0x395aaa,_0x12984b[_0x29e0('0xf')]['message']);return _0x2ef931(_0x12984b[_0x29e0('0xf')][_0x29e0('0x12')]);}else{logger[_0x29e0('0xb')](_0x29e0('0x11'),_0x395aaa,_0x29e0('0xc'));_0x2ef931(_0x12984b[_0x29e0('0x13')]['message']);}})['catch'](function(_0x5f2ea0){logger[_0x29e0('0xf')](_0x29e0('0x11'),_0x395aaa,_0x5f2ea0);_0x31026e(_0x5f2ea0);});});}exports['CreateSquareMessage']=function(_0x4eb0b7){var _0x39142c=this;return new Promise(function(_0x126166,_0x152cb1){return db[_0x29e0('0x14')][_0x29e0('0x15')](_0x4eb0b7[_0x29e0('0x16')],{'raw':_0x4eb0b7['options']?_0x4eb0b7[_0x29e0('0x17')][_0x29e0('0x18')]===undefined?!![]:![]:!![]})[_0x29e0('0xa')](function(_0x229725){logger[_0x29e0('0xb')](_0x29e0('0x19'),_0x4eb0b7);logger[_0x29e0('0xd')](_0x29e0('0x19'),_0x4eb0b7,JSON['stringify'](_0x229725));_0x126166(_0x229725);})[_0x29e0('0x1a')](function(_0x411676){logger[_0x29e0('0xf')](_0x29e0('0x19'),_0x411676[_0x29e0('0x12')],_0x4eb0b7);_0x152cb1(_0x39142c[_0x29e0('0xf')](0x1f4,_0x411676[_0x29e0('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 9546990..83bf129 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 _0x1f67=['/:id','show','/:id/test','15s','test','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller','isAuthenticated','get'];(function(_0x37a79c,_0x2b19f0){var _0x561d89=function(_0x19bee3){while(--_0x19bee3){_0x37a79c['push'](_0x37a79c['shift']());}};_0x561d89(++_0x2b19f0);}(_0x1f67,0xd2));var _0x71f6=function(_0x2e292c,_0x232404){_0x2e292c=_0x2e292c-0x0;var _0x5cf2ff=_0x1f67[_0x2e292c];return _0x5cf2ff;};'use strict';var multer=require('multer');var util=require(_0x71f6('0x0'));var path=require('path');var timeout=require(_0x71f6('0x1'));var express=require(_0x71f6('0x2'));var router=express[_0x71f6('0x3')]();var fs_extra=require(_0x71f6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x71f6('0x5'));var config=require(_0x71f6('0x6'));var controller=require(_0x71f6('0x7'));router['get']('/',auth[_0x71f6('0x8')](),controller['index']);router[_0x71f6('0x9')](_0x71f6('0xa'),auth[_0x71f6('0x8')](),controller[_0x71f6('0xb')]);router[_0x71f6('0x9')](_0x71f6('0xc'),auth[_0x71f6('0x8')](),timeout(_0x71f6('0xd')),controller[_0x71f6('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x71f6('0xf')](_0x71f6('0xa'),auth['isAuthenticated'](),controller[_0x71f6('0x10')]);router[_0x71f6('0x11')](_0x71f6('0xa'),auth[_0x71f6('0x8')](),controller[_0x71f6('0x12')]);module[_0x71f6('0x13')]=router; \ No newline at end of file +var _0x8c2f=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','15s','test','post','create','put','update','delete','destroy'];(function(_0x350b73,_0x51a4af){var _0xef6e99=function(_0x1f9d98){while(--_0x1f9d98){_0x350b73['push'](_0x350b73['shift']());}};_0xef6e99(++_0x51a4af);}(_0x8c2f,0x18d));var _0xf8c2=function(_0x1526a9,_0x48fb64){_0x1526a9=_0x1526a9-0x0;var _0x9f4049=_0x8c2f[_0x1526a9];return _0x9f4049;};'use strict';var multer=require(_0xf8c2('0x0'));var util=require('util');var path=require(_0xf8c2('0x1'));var timeout=require(_0xf8c2('0x2'));var express=require(_0xf8c2('0x3'));var router=express[_0xf8c2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf8c2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf8c2('0x6'));var controller=require(_0xf8c2('0x7'));router[_0xf8c2('0x8')]('/',auth[_0xf8c2('0x9')](),controller[_0xf8c2('0xa')]);router['get'](_0xf8c2('0xb'),auth[_0xf8c2('0x9')](),controller[_0xf8c2('0xc')]);router['get']('/:id/test',auth[_0xf8c2('0x9')](),timeout(_0xf8c2('0xd')),controller[_0xf8c2('0xe')]);router[_0xf8c2('0xf')]('/',auth[_0xf8c2('0x9')](),controller[_0xf8c2('0x10')]);router[_0xf8c2('0x11')]('/:id',auth[_0xf8c2('0x9')](),controller[_0xf8c2('0x12')]);router[_0xf8c2('0x13')](_0xf8c2('0xb'),auth[_0xf8c2('0x9')](),controller[_0xf8c2('0x14')]);module[_0xf8c2('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 43131cc..caf3e43 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 _0x8c9f=['name','exports','STRING'];(function(_0x122d9f,_0x2c9e5b){var _0x41a09e=function(_0x3d9564){while(--_0x3d9564){_0x122d9f['push'](_0x122d9f['shift']());}};_0x41a09e(++_0x2c9e5b);}(_0x8c9f,0x1d5));var _0xf8c9=function(_0x5847d1,_0x1b306f){_0x5847d1=_0x5847d1-0x0;var _0x44b5d8=_0x8c9f[_0x5847d1];return _0x44b5d8;};'use strict';var Sequelize=require('sequelize');module[_0xf8c9('0x0')]={'name':{'type':Sequelize[_0xf8c9('0x1')],'unique':_0xf8c9('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xf8c9('0x1')]},'description':{'type':Sequelize[_0xf8c9('0x1')]}}; \ No newline at end of file +var _0xb3c6=['exports','STRING','sequelize'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xb3c6,0x14c));var _0x6b3c=function(_0x27973c,_0x2d8b16){_0x27973c=_0x27973c-0x0;var _0x2ef123=_0xb3c6[_0x27973c];return _0x2ef123;};'use strict';var Sequelize=require(_0x6b3c('0x0'));module[_0x6b3c('0x1')]={'name':{'type':Sequelize[_0x6b3c('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x6b3c('0x2')]},'description':{'type':Sequelize[_0x6b3c('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index cd437f1..4e7f475 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 _0x9fc9=['hasOwnProperty','order','sort','where','pick','filters','merge','filter','includeAll','include','findAll','catch','params','keys','create','user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','dsn','openSync','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','error','name','send','SquareOdbc','rawAttributes','fieldName','type','key','map','query','intersection','model','fields','attributes','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9fc9,0x114));var _0x99fc=function(_0x28cc66,_0x544802){_0x28cc66=_0x28cc66-0x0;var _0x3c40c1=_0x9fc9[_0x28cc66];return _0x3c40c1;};'use strict';var emlformat=require(_0x99fc('0x0'));var rimraf=require(_0x99fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x99fc('0x2'));var rp=require(_0x99fc('0x3'));var moment=require('moment');var BPromise=require(_0x99fc('0x4'));var Mustache=require('mustache');var util=require(_0x99fc('0x5'));var path=require(_0x99fc('0x6'));var sox=require(_0x99fc('0x7'));var csv=require(_0x99fc('0x8'));var ejs=require(_0x99fc('0x9'));var fs=require('fs');var fs_extra=require(_0x99fc('0xa'));var _=require(_0x99fc('0xb'));var squel=require(_0x99fc('0xc'));var crypto=require(_0x99fc('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x99fc('0x8'));var querystring=require(_0x99fc('0xe'));var Papa=require(_0x99fc('0xf'));var Redis=require(_0x99fc('0x10'));var authService=require(_0x99fc('0x11'));var qs=require(_0x99fc('0x12'));var as=require(_0x99fc('0x13'));var hardwareService=require(_0x99fc('0x14'));var logger=require(_0x99fc('0x15'))(_0x99fc('0x16'));var utils=require('../../config/utils');var config=require(_0x99fc('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39fe18,_0x562890){_0x562890=_0x562890||0xcc;return function(_0x482736){if(_0x482736){return _0x39fe18[_0x99fc('0x18')](_0x562890);}return _0x39fe18[_0x99fc('0x19')](_0x562890)[_0x99fc('0x1a')]();};}function respondWithResult(_0x540a55,_0x2bdc13){_0x2bdc13=_0x2bdc13||0xc8;return function(_0x2d7180){if(_0x2d7180){return _0x540a55[_0x99fc('0x19')](_0x2bdc13)[_0x99fc('0x1b')](_0x2d7180);}};}function respondWithFilteredResult(_0x559676,_0x5c3944){return function(_0x18aa54){if(_0x18aa54){var _0x37e277=typeof _0x5c3944['offset']==='undefined'&&typeof _0x5c3944[_0x99fc('0x1c')]===_0x99fc('0x1d');var _0x6d9aee=_0x18aa54['count'];var _0x50744b=_0x37e277?0x0:_0x5c3944[_0x99fc('0x1e')];var _0x4e94ab=_0x37e277?_0x18aa54[_0x99fc('0x1f')]:_0x5c3944[_0x99fc('0x1e')]+_0x5c3944['limit'];var _0x1ded3a;if(_0x4e94ab>=_0x6d9aee){_0x4e94ab=_0x6d9aee;_0x1ded3a=0xc8;}else{_0x1ded3a=0xce;}_0x559676[_0x99fc('0x19')](_0x1ded3a);return _0x559676[_0x99fc('0x20')](_0x99fc('0x21'),_0x50744b+'-'+_0x4e94ab+'/'+_0x6d9aee)['json'](_0x18aa54);}return null;};}function patchUpdates(_0x3a2bb7){return function(_0x3ae0fa){try{jsonpatch[_0x99fc('0x22')](_0x3ae0fa,_0x3a2bb7,!![]);}catch(_0x102b04){return BPromise[_0x99fc('0x23')](_0x102b04);}return _0x3ae0fa[_0x99fc('0x24')]();};}function saveUpdates(_0x17cc21,_0x26344d){return function(_0xaaf48a){if(_0xaaf48a){return _0xaaf48a[_0x99fc('0x25')](_0x17cc21)[_0x99fc('0x26')](function(_0x421a45){return _0x421a45;});}return null;};}function removeEntity(_0x21c68d,_0x5d8812){return function(_0x27af98){if(_0x27af98){return _0x27af98[_0x99fc('0x27')]()[_0x99fc('0x26')](function(){var _0x41da52=_0x27af98[_0x99fc('0x28')]({'plain':!![]});var _0xfd7dde='ODBC';return db['UserProfileResource'][_0x99fc('0x27')]({'where':{'type':_0xfd7dde,'resourceId':_0x41da52['id']}})['then'](function(){return _0x27af98;});})[_0x99fc('0x26')](function(){_0x21c68d[_0x99fc('0x19')](0xcc)[_0x99fc('0x1a')]();});}};}function handleEntityNotFound(_0x208c7b,_0x14f5a2){return function(_0x5671e5){if(!_0x5671e5){_0x208c7b[_0x99fc('0x18')](0x194);}return _0x5671e5;};}function handleError(_0x26f872,_0x1b0c37){_0x1b0c37=_0x1b0c37||0x1f4;return function(_0x2e956b){logger[_0x99fc('0x29')](_0x2e956b['stack']);if(_0x2e956b[_0x99fc('0x2a')]){delete _0x2e956b[_0x99fc('0x2a')];}_0x26f872[_0x99fc('0x19')](_0x1b0c37)[_0x99fc('0x2b')](_0x2e956b);};}exports['index']=function(_0x373aa3,_0x24dcc5){var _0x3dbd94={},_0x33525a={},_0x748dd4={'count':0x0,'rows':[]};var _0x1f5f3b=_['map'](db[_0x99fc('0x2c')][_0x99fc('0x2d')],function(_0x31f0b){return{'name':_0x31f0b[_0x99fc('0x2e')],'type':_0x31f0b[_0x99fc('0x2f')][_0x99fc('0x30')]};});_0x33525a['model']=_[_0x99fc('0x31')](_0x1f5f3b,_0x99fc('0x2a'));_0x33525a[_0x99fc('0x32')]=_['keys'](_0x373aa3[_0x99fc('0x32')]);_0x33525a['filters']=_[_0x99fc('0x33')](_0x33525a['model'],_0x33525a['query']);_0x3dbd94['attributes']=_['intersection'](_0x33525a[_0x99fc('0x34')],qs['fields'](_0x373aa3[_0x99fc('0x32')][_0x99fc('0x35')]));_0x3dbd94[_0x99fc('0x36')]=_0x3dbd94[_0x99fc('0x36')][_0x99fc('0x37')]?_0x3dbd94[_0x99fc('0x36')]:_0x33525a[_0x99fc('0x34')];if(!_0x373aa3[_0x99fc('0x32')][_0x99fc('0x38')]('nolimit')){_0x3dbd94[_0x99fc('0x1c')]=qs[_0x99fc('0x1c')](_0x373aa3[_0x99fc('0x32')][_0x99fc('0x1c')]);_0x3dbd94[_0x99fc('0x1e')]=qs[_0x99fc('0x1e')](_0x373aa3['query']['offset']);}_0x3dbd94[_0x99fc('0x39')]=qs[_0x99fc('0x3a')](_0x373aa3[_0x99fc('0x32')][_0x99fc('0x3a')]);_0x3dbd94[_0x99fc('0x3b')]=qs['filters'](_[_0x99fc('0x3c')](_0x373aa3[_0x99fc('0x32')],_0x33525a[_0x99fc('0x3d')]),_0x1f5f3b);if(_0x373aa3[_0x99fc('0x32')]['filter']){_0x3dbd94[_0x99fc('0x3b')]=_[_0x99fc('0x3e')](_0x3dbd94[_0x99fc('0x3b')],{'$or':_[_0x99fc('0x31')](_0x1f5f3b,function(_0x4637d7){if(_0x4637d7[_0x99fc('0x2f')]!=='VIRTUAL'){var _0x4040bd={};_0x4040bd[_0x4637d7[_0x99fc('0x2a')]]={'$like':'%'+_0x373aa3[_0x99fc('0x32')][_0x99fc('0x3f')]+'%'};return _0x4040bd;}})});}_0x3dbd94=_[_0x99fc('0x3e')]({},_0x3dbd94,_0x373aa3['options']);var _0x29b73e={'where':_0x3dbd94['where']};return db[_0x99fc('0x2c')][_0x99fc('0x1f')](_0x29b73e)[_0x99fc('0x26')](function(_0x356cdd){_0x748dd4[_0x99fc('0x1f')]=_0x356cdd;if(_0x373aa3[_0x99fc('0x32')][_0x99fc('0x40')]){_0x3dbd94[_0x99fc('0x41')]=[{'all':!![]}];}return db[_0x99fc('0x2c')][_0x99fc('0x42')](_0x3dbd94);})['then'](function(_0x2def66){_0x748dd4['rows']=_0x2def66;return _0x748dd4;})['then'](respondWithFilteredResult(_0x24dcc5,_0x3dbd94))[_0x99fc('0x43')](handleError(_0x24dcc5,null));};exports['show']=function(_0x507a03,_0x128b83){var _0x39796b={'raw':!![],'where':{'id':_0x507a03[_0x99fc('0x44')]['id']}},_0x4d4e6d={};_0x4d4e6d[_0x99fc('0x34')]=_[_0x99fc('0x45')](db[_0x99fc('0x2c')][_0x99fc('0x2d')]);_0x4d4e6d[_0x99fc('0x32')]=_['keys'](_0x507a03[_0x99fc('0x32')]);_0x4d4e6d[_0x99fc('0x3d')]=_[_0x99fc('0x33')](_0x4d4e6d[_0x99fc('0x34')],_0x4d4e6d[_0x99fc('0x32')]);_0x39796b[_0x99fc('0x36')]=_[_0x99fc('0x33')](_0x4d4e6d[_0x99fc('0x34')],qs['fields'](_0x507a03['query'][_0x99fc('0x35')]));_0x39796b['attributes']=_0x39796b['attributes'][_0x99fc('0x37')]?_0x39796b[_0x99fc('0x36')]:_0x4d4e6d[_0x99fc('0x34')];if(_0x507a03[_0x99fc('0x32')]['includeAll']){_0x39796b['include']=[{'all':!![]}];}_0x39796b=_[_0x99fc('0x3e')]({},_0x39796b,_0x507a03['options']);return db['SquareOdbc']['find'](_0x39796b)[_0x99fc('0x26')](handleEntityNotFound(_0x128b83,null))[_0x99fc('0x26')](respondWithResult(_0x128b83,null))['catch'](handleError(_0x128b83,null));};exports['create']=function(_0x4df790,_0x1768cb){return db['SquareOdbc'][_0x99fc('0x46')](_0x4df790['body'],{})[_0x99fc('0x26')](function(_0x4b2d99){var _0xb515d0=_0x4df790[_0x99fc('0x47')][_0x99fc('0x28')]({'plain':!![]});if(!_0xb515d0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb515d0[_0x99fc('0x48')]==='user'){var _0xd8565c=_0x4b2d99[_0x99fc('0x28')]({'plain':!![]});var _0x3b3e8c='ODBC';return db[_0x99fc('0x49')][_0x99fc('0x4a')]({'where':{'name':_0x3b3e8c,'userProfileId':_0xb515d0[_0x99fc('0x4b')]},'raw':!![]})[_0x99fc('0x26')](function(_0x30dc95){if(_0x30dc95&&_0x30dc95[_0x99fc('0x4c')]===0x0){return db[_0x99fc('0x4d')][_0x99fc('0x46')]({'name':_0xd8565c[_0x99fc('0x2a')],'resourceId':_0xd8565c['id'],'type':_0x30dc95[_0x99fc('0x2a')],'sectionId':_0x30dc95['id']},{})['then'](function(){return _0x4b2d99;});}else{return _0x4b2d99;}})[_0x99fc('0x43')](function(_0x49101a){logger[_0x99fc('0x29')](_0x99fc('0x4e'),_0x49101a);throw _0x49101a;});}return _0x4b2d99;})[_0x99fc('0x26')](respondWithResult(_0x1768cb,0xc9))['catch'](handleError(_0x1768cb,null));};exports[_0x99fc('0x25')]=function(_0x209ee2,_0x257c66){if(_0x209ee2[_0x99fc('0x4f')]['id']){delete _0x209ee2['body']['id'];}return db[_0x99fc('0x2c')][_0x99fc('0x4a')]({'where':{'id':_0x209ee2['params']['id']}})[_0x99fc('0x26')](handleEntityNotFound(_0x257c66,null))[_0x99fc('0x26')](saveUpdates(_0x209ee2['body'],null))['then'](respondWithResult(_0x257c66,null))[_0x99fc('0x43')](handleError(_0x257c66,null));};exports[_0x99fc('0x27')]=function(_0x165ab2,_0x516343){return db[_0x99fc('0x2c')][_0x99fc('0x4a')]({'where':{'id':_0x165ab2['params']['id']}})[_0x99fc('0x26')](handleEntityNotFound(_0x516343,null))['then'](removeEntity(_0x516343,null))[_0x99fc('0x43')](handleError(_0x516343,null));};exports[_0x99fc('0x50')]=function(_0x59a771,_0x529e8e,_0x152d54){var _0x24c625;return db[_0x99fc('0x2c')][_0x99fc('0x4a')]({'where':{'id':_0x59a771[_0x99fc('0x44')]['id']},'attributes':['id',_0x99fc('0x51')]})[_0x99fc('0x26')](handleEntityNotFound(_0x529e8e,null))[_0x99fc('0x26')](function(_0x5583df){if(_0x5583df){var _0x5101fc=require('odbc')();_0x5101fc[_0x99fc('0x52')](_0x5583df[_0x99fc('0x51')]);_0x5101fc['closeSync']();return _0x5583df;}})[_0x99fc('0x26')](respondWithResult(_0x529e8e,null))[_0x99fc('0x43')](handleError(_0x529e8e,null));}; \ No newline at end of file +var _0x7e4a=['request-promise','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','update','then','destroy','ODBC','UserProfileResource','error','stack','name','send','index','map','SquareOdbc','rawAttributes','type','key','model','keys','attributes','intersection','fields','query','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x7e4a,0xac));var _0xa7e4=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x7e4a[_0x55e08b];return _0xd1a7ff;};'use strict';var emlformat=require(_0xa7e4('0x0'));var rimraf=require(_0xa7e4('0x1'));var zipdir=require(_0xa7e4('0x2'));var jsonpatch=require(_0xa7e4('0x3'));var rp=require(_0xa7e4('0x4'));var moment=require('moment');var BPromise=require(_0xa7e4('0x5'));var Mustache=require(_0xa7e4('0x6'));var util=require('util');var path=require(_0xa7e4('0x7'));var sox=require(_0xa7e4('0x8'));var csv=require(_0xa7e4('0x9'));var ejs=require(_0xa7e4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa7e4('0xb'));var crypto=require(_0xa7e4('0xc'));var jsforce=require(_0xa7e4('0xd'));var deskjs=require(_0xa7e4('0xe'));var toCsv=require(_0xa7e4('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa7e4('0xf'));var qs=require(_0xa7e4('0x10'));var as=require(_0xa7e4('0x11'));var hardwareService=require(_0xa7e4('0x12'));var logger=require(_0xa7e4('0x13'))(_0xa7e4('0x14'));var utils=require(_0xa7e4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa7e4('0x16'));var db=require(_0xa7e4('0x17'))['db'];function respondWithStatusCode(_0x364219,_0x13a5bb){_0x13a5bb=_0x13a5bb||0xcc;return function(_0x1db7bf){if(_0x1db7bf){return _0x364219[_0xa7e4('0x18')](_0x13a5bb);}return _0x364219['status'](_0x13a5bb)[_0xa7e4('0x19')]();};}function respondWithResult(_0x576f11,_0x39391c){_0x39391c=_0x39391c||0xc8;return function(_0x1a0dcb){if(_0x1a0dcb){return _0x576f11['status'](_0x39391c)[_0xa7e4('0x1a')](_0x1a0dcb);}};}function respondWithFilteredResult(_0x2c57af,_0x29ee46){return function(_0xff1a0a){if(_0xff1a0a){var _0x225ea9=typeof _0x29ee46[_0xa7e4('0x1b')]==='undefined'&&typeof _0x29ee46[_0xa7e4('0x1c')]===_0xa7e4('0x1d');var _0x5696b0=_0xff1a0a['count'];var _0x19a39b=_0x225ea9?0x0:_0x29ee46[_0xa7e4('0x1b')];var _0x52da0a=_0x225ea9?_0xff1a0a[_0xa7e4('0x1e')]:_0x29ee46[_0xa7e4('0x1b')]+_0x29ee46['limit'];var _0x31408a;if(_0x52da0a>=_0x5696b0){_0x52da0a=_0x5696b0;_0x31408a=0xc8;}else{_0x31408a=0xce;}_0x2c57af[_0xa7e4('0x1f')](_0x31408a);return _0x2c57af[_0xa7e4('0x20')](_0xa7e4('0x21'),_0x19a39b+'-'+_0x52da0a+'/'+_0x5696b0)['json'](_0xff1a0a);}return null;};}function patchUpdates(_0x96cfa0){return function(_0x4d2ba1){try{jsonpatch[_0xa7e4('0x22')](_0x4d2ba1,_0x96cfa0,!![]);}catch(_0x32abb3){return BPromise[_0xa7e4('0x23')](_0x32abb3);}return _0x4d2ba1[_0xa7e4('0x24')]();};}function saveUpdates(_0xdce86e,_0x17d796){return function(_0x180062){if(_0x180062){return _0x180062[_0xa7e4('0x25')](_0xdce86e)[_0xa7e4('0x26')](function(_0x448ffe){return _0x448ffe;});}return null;};}function removeEntity(_0x39cb50,_0x1130cf){return function(_0x176485){if(_0x176485){return _0x176485[_0xa7e4('0x27')]()[_0xa7e4('0x26')](function(){var _0x57edb6=_0x176485['get']({'plain':!![]});var _0x36873e=_0xa7e4('0x28');return db[_0xa7e4('0x29')][_0xa7e4('0x27')]({'where':{'type':_0x36873e,'resourceId':_0x57edb6['id']}})[_0xa7e4('0x26')](function(){return _0x176485;});})[_0xa7e4('0x26')](function(){_0x39cb50[_0xa7e4('0x1f')](0xcc)[_0xa7e4('0x19')]();});}};}function handleEntityNotFound(_0x3fad67,_0x270ffd){return function(_0x34caa1){if(!_0x34caa1){_0x3fad67[_0xa7e4('0x18')](0x194);}return _0x34caa1;};}function handleError(_0x240832,_0xe83b0c){_0xe83b0c=_0xe83b0c||0x1f4;return function(_0x3b8773){logger[_0xa7e4('0x2a')](_0x3b8773[_0xa7e4('0x2b')]);if(_0x3b8773[_0xa7e4('0x2c')]){delete _0x3b8773[_0xa7e4('0x2c')];}_0x240832['status'](_0xe83b0c)[_0xa7e4('0x2d')](_0x3b8773);};}exports[_0xa7e4('0x2e')]=function(_0x51fae7,_0x14448a){var _0x18248d={},_0xdc051a={},_0x170e73={'count':0x0,'rows':[]};var _0x808326=_[_0xa7e4('0x2f')](db[_0xa7e4('0x30')][_0xa7e4('0x31')],function(_0x530c15){return{'name':_0x530c15['fieldName'],'type':_0x530c15[_0xa7e4('0x32')][_0xa7e4('0x33')]};});_0xdc051a[_0xa7e4('0x34')]=_[_0xa7e4('0x2f')](_0x808326,_0xa7e4('0x2c'));_0xdc051a['query']=_[_0xa7e4('0x35')](_0x51fae7['query']);_0xdc051a['filters']=_['intersection'](_0xdc051a[_0xa7e4('0x34')],_0xdc051a['query']);_0x18248d[_0xa7e4('0x36')]=_[_0xa7e4('0x37')](_0xdc051a[_0xa7e4('0x34')],qs[_0xa7e4('0x38')](_0x51fae7[_0xa7e4('0x39')]['fields']));_0x18248d[_0xa7e4('0x36')]=_0x18248d[_0xa7e4('0x36')]['length']?_0x18248d['attributes']:_0xdc051a[_0xa7e4('0x34')];if(!_0x51fae7[_0xa7e4('0x39')][_0xa7e4('0x3a')](_0xa7e4('0x3b'))){_0x18248d['limit']=qs['limit'](_0x51fae7[_0xa7e4('0x39')]['limit']);_0x18248d['offset']=qs[_0xa7e4('0x1b')](_0x51fae7['query'][_0xa7e4('0x1b')]);}_0x18248d[_0xa7e4('0x3c')]=qs[_0xa7e4('0x3d')](_0x51fae7[_0xa7e4('0x39')][_0xa7e4('0x3d')]);_0x18248d['where']=qs[_0xa7e4('0x3e')](_[_0xa7e4('0x3f')](_0x51fae7[_0xa7e4('0x39')],_0xdc051a[_0xa7e4('0x3e')]),_0x808326);if(_0x51fae7['query'][_0xa7e4('0x40')]){_0x18248d[_0xa7e4('0x41')]=_[_0xa7e4('0x42')](_0x18248d[_0xa7e4('0x41')],{'$or':_['map'](_0x808326,function(_0xd397e1){if(_0xd397e1[_0xa7e4('0x32')]!=='VIRTUAL'){var _0x13b922={};_0x13b922[_0xd397e1[_0xa7e4('0x2c')]]={'$like':'%'+_0x51fae7[_0xa7e4('0x39')][_0xa7e4('0x40')]+'%'};return _0x13b922;}})});}_0x18248d=_['merge']({},_0x18248d,_0x51fae7[_0xa7e4('0x43')]);var _0x12a93d={'where':_0x18248d[_0xa7e4('0x41')]};return db[_0xa7e4('0x30')][_0xa7e4('0x1e')](_0x12a93d)[_0xa7e4('0x26')](function(_0x496495){_0x170e73[_0xa7e4('0x1e')]=_0x496495;if(_0x51fae7[_0xa7e4('0x39')][_0xa7e4('0x44')]){_0x18248d[_0xa7e4('0x45')]=[{'all':!![]}];}return db[_0xa7e4('0x30')][_0xa7e4('0x46')](_0x18248d);})[_0xa7e4('0x26')](function(_0x3cde35){_0x170e73[_0xa7e4('0x47')]=_0x3cde35;return _0x170e73;})['then'](respondWithFilteredResult(_0x14448a,_0x18248d))[_0xa7e4('0x48')](handleError(_0x14448a,null));};exports[_0xa7e4('0x49')]=function(_0x4c5d1e,_0x89c8f){var _0x58454e={'raw':!![],'where':{'id':_0x4c5d1e[_0xa7e4('0x4a')]['id']}},_0x339e76={};_0x339e76[_0xa7e4('0x34')]=_[_0xa7e4('0x35')](db['SquareOdbc'][_0xa7e4('0x31')]);_0x339e76[_0xa7e4('0x39')]=_[_0xa7e4('0x35')](_0x4c5d1e[_0xa7e4('0x39')]);_0x339e76[_0xa7e4('0x3e')]=_[_0xa7e4('0x37')](_0x339e76[_0xa7e4('0x34')],_0x339e76[_0xa7e4('0x39')]);_0x58454e[_0xa7e4('0x36')]=_[_0xa7e4('0x37')](_0x339e76[_0xa7e4('0x34')],qs[_0xa7e4('0x38')](_0x4c5d1e[_0xa7e4('0x39')]['fields']));_0x58454e[_0xa7e4('0x36')]=_0x58454e[_0xa7e4('0x36')][_0xa7e4('0x4b')]?_0x58454e[_0xa7e4('0x36')]:_0x339e76[_0xa7e4('0x34')];if(_0x4c5d1e[_0xa7e4('0x39')][_0xa7e4('0x44')]){_0x58454e[_0xa7e4('0x45')]=[{'all':!![]}];}_0x58454e=_[_0xa7e4('0x42')]({},_0x58454e,_0x4c5d1e[_0xa7e4('0x43')]);return db[_0xa7e4('0x30')][_0xa7e4('0x4c')](_0x58454e)[_0xa7e4('0x26')](handleEntityNotFound(_0x89c8f,null))[_0xa7e4('0x26')](respondWithResult(_0x89c8f,null))['catch'](handleError(_0x89c8f,null));};exports[_0xa7e4('0x4d')]=function(_0x1b5094,_0xad4d60){return db['SquareOdbc'][_0xa7e4('0x4d')](_0x1b5094[_0xa7e4('0x4e')],{})['then'](function(_0x4d057a){var _0x2b0780=_0x1b5094[_0xa7e4('0x4f')]['get']({'plain':!![]});if(!_0x2b0780)throw new Error(_0xa7e4('0x50'));if(_0x2b0780[_0xa7e4('0x51')]===_0xa7e4('0x4f')){var _0x13e532=_0x4d057a[_0xa7e4('0x52')]({'plain':!![]});var _0x2fadcf=_0xa7e4('0x28');return db['UserProfileSection'][_0xa7e4('0x4c')]({'where':{'name':_0x2fadcf,'userProfileId':_0x2b0780['userProfileId']},'raw':!![]})[_0xa7e4('0x26')](function(_0x5a95e9){if(_0x5a95e9&&_0x5a95e9['autoAssociation']===0x0){return db['UserProfileResource'][_0xa7e4('0x4d')]({'name':_0x13e532[_0xa7e4('0x2c')],'resourceId':_0x13e532['id'],'type':_0x5a95e9[_0xa7e4('0x2c')],'sectionId':_0x5a95e9['id']},{})[_0xa7e4('0x26')](function(){return _0x4d057a;});}else{return _0x4d057a;}})[_0xa7e4('0x48')](function(_0x37a246){logger['error'](_0xa7e4('0x53'),_0x37a246);throw _0x37a246;});}return _0x4d057a;})['then'](respondWithResult(_0xad4d60,0xc9))[_0xa7e4('0x48')](handleError(_0xad4d60,null));};exports[_0xa7e4('0x25')]=function(_0x1c6b6d,_0x169eab){if(_0x1c6b6d[_0xa7e4('0x4e')]['id']){delete _0x1c6b6d[_0xa7e4('0x4e')]['id'];}return db['SquareOdbc'][_0xa7e4('0x4c')]({'where':{'id':_0x1c6b6d[_0xa7e4('0x4a')]['id']}})[_0xa7e4('0x26')](handleEntityNotFound(_0x169eab,null))[_0xa7e4('0x26')](saveUpdates(_0x1c6b6d[_0xa7e4('0x4e')],null))[_0xa7e4('0x26')](respondWithResult(_0x169eab,null))[_0xa7e4('0x48')](handleError(_0x169eab,null));};exports['destroy']=function(_0x3da17e,_0x33f62b){return db[_0xa7e4('0x30')]['find']({'where':{'id':_0x3da17e[_0xa7e4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x33f62b,null))[_0xa7e4('0x26')](removeEntity(_0x33f62b,null))['catch'](handleError(_0x33f62b,null));};exports[_0xa7e4('0x54')]=function(_0x4a3210,_0x2360ad,_0x3a6ea1){var _0x973fe0;return db[_0xa7e4('0x30')][_0xa7e4('0x4c')]({'where':{'id':_0x4a3210[_0xa7e4('0x4a')]['id']},'attributes':['id',_0xa7e4('0x55')]})[_0xa7e4('0x26')](handleEntityNotFound(_0x2360ad,null))[_0xa7e4('0x26')](function(_0x327d3c){if(_0x327d3c){var _0x3868c5=require('odbc')();_0x3868c5[_0xa7e4('0x56')](_0x327d3c[_0xa7e4('0x55')]);_0x3868c5[_0xa7e4('0x57')]();return _0x327d3c;}})['then'](respondWithResult(_0x2360ad,null))[_0xa7e4('0x48')](handleError(_0x2360ad,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index e9a7c9f..1961e58 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 _0x25cb=['moment','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','define','square_odbc','lodash','util','../../config/logger','api'];(function(_0x19b207,_0x402744){var _0x552d99=function(_0xeef96a){while(--_0xeef96a){_0x19b207['push'](_0x19b207['shift']());}};_0x552d99(++_0x402744);}(_0x25cb,0xec));var _0xb25c=function(_0x2f66fe,_0x46be8b){_0x2f66fe=_0x2f66fe-0x0;var _0x1a1d22=_0x25cb[_0x2f66fe];return _0x1a1d22;};'use strict';var _=require(_0xb25c('0x0'));var util=require(_0xb25c('0x1'));var logger=require(_0xb25c('0x2'))(_0xb25c('0x3'));var moment=require(_0xb25c('0x4'));var BPromise=require('bluebird');var rp=require(_0xb25c('0x5'));var fs=require('fs');var path=require(_0xb25c('0x6'));var rimraf=require(_0xb25c('0x7'));var config=require(_0xb25c('0x8'));var attributes=require(_0xb25c('0x9'));module['exports']=function(_0x3cd019,_0x52195e){return _0x3cd019[_0xb25c('0xa')]('SquareOdbc',attributes,{'tableName':_0xb25c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x444e=['moment','bluebird','request-promise','path','rimraf','define','SquareOdbc','square_odbc','lodash','util','api'];(function(_0x1fadea,_0x2639fd){var _0x32e6e8=function(_0x1541f4){while(--_0x1541f4){_0x1fadea['push'](_0x1fadea['shift']());}};_0x32e6e8(++_0x2639fd);}(_0x444e,0x152));var _0xe444=function(_0x5750af,_0x2b41a2){_0x5750af=_0x5750af-0x0;var _0x47ca59=_0x444e[_0x5750af];return _0x47ca59;};'use strict';var _=require(_0xe444('0x0'));var util=require(_0xe444('0x1'));var logger=require('../../config/logger')(_0xe444('0x2'));var moment=require(_0xe444('0x3'));var BPromise=require(_0xe444('0x4'));var rp=require(_0xe444('0x5'));var fs=require('fs');var path=require(_0xe444('0x6'));var rimraf=require(_0xe444('0x7'));var config=require('../../config/environment');var attributes=require('./squareOdbc.attributes');module['exports']=function(_0x34f0d9,_0x4ca5bd){return _0x34f0d9[_0xe444('0x8')](_0xe444('0x9'),attributes,{'tableName':_0xe444('0xa'),'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 d242db5..7eb2f42 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 _0x8010=['info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','ShowSquareOdbc','options','raw','attributes','include','model','map','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then'];(function(_0x435a74,_0x57f3c3){var _0x33ac5f=function(_0x142085){while(--_0x142085){_0x435a74['push'](_0x435a74['shift']());}};_0x33ac5f(++_0x57f3c3);}(_0x8010,0x129));var _0x0801=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8010[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0801('0x0'));var util=require(_0x0801('0x1'));var moment=require('moment');var BPromise=require(_0x0801('0x2'));var rs=require(_0x0801('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0801('0x4'))['db'];var utils=require(_0x0801('0x5'));var logger=require(_0x0801('0x6'))(_0x0801('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0801('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3895a2,_0x4e3042,_0x39fdfb){return new BPromise(function(_0x3068fb,_0x219ad5){return client[_0x0801('0x9')](_0x3895a2,_0x39fdfb)[_0x0801('0xa')](function(_0x1472f4){logger[_0x0801('0xb')](_0x0801('0xc'),_0x4e3042,'request\x20sent');logger[_0x0801('0xd')](_0x0801('0xe'),_0x4e3042,_0x0801('0xf'),JSON['stringify'](_0x1472f4));if(_0x1472f4['error']){if(_0x1472f4['error'][_0x0801('0x10')]===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x4e3042,_0x1472f4[_0x0801('0x11')][_0x0801('0x12')]);return _0x219ad5(_0x1472f4['error'][_0x0801('0x12')]);}logger['error'](_0x0801('0xc'),_0x4e3042,_0x1472f4[_0x0801('0x11')][_0x0801('0x12')]);return _0x3068fb(_0x1472f4[_0x0801('0x11')][_0x0801('0x12')]);}else{logger[_0x0801('0xb')](_0x0801('0xc'),_0x4e3042,'request\x20sent');_0x3068fb(_0x1472f4[_0x0801('0x13')]['message']);}})[_0x0801('0x14')](function(_0x4456dd){logger['error'](_0x0801('0xc'),_0x4e3042,_0x4456dd);_0x219ad5(_0x4456dd);});});}exports[_0x0801('0x15')]=function(_0x5f348b){var _0x3050aa=this;return new Promise(function(_0x442569,_0x259dd1){return db['SquareOdbc']['find']({'raw':_0x5f348b[_0x0801('0x16')]?_0x5f348b['options'][_0x0801('0x17')]===undefined?!![]:![]:!![],'where':_0x5f348b[_0x0801('0x16')]?_0x5f348b[_0x0801('0x16')]['where']||null:null,'attributes':_0x5f348b[_0x0801('0x16')]?_0x5f348b[_0x0801('0x16')][_0x0801('0x18')]||null:null,'include':_0x5f348b['options']?_0x5f348b['options'][_0x0801('0x19')]?_['map'](_0x5f348b[_0x0801('0x16')]['include'],function(_0x45b316){return{'model':db[_0x45b316[_0x0801('0x1a')]],'as':_0x45b316['as'],'attributes':_0x45b316[_0x0801('0x18')],'include':_0x45b316[_0x0801('0x19')]?_['map'](_0x45b316[_0x0801('0x19')],function(_0x34e88c){return{'model':db[_0x34e88c['model']],'as':_0x34e88c['as'],'attributes':_0x34e88c[_0x0801('0x18')],'include':_0x34e88c[_0x0801('0x19')]?_[_0x0801('0x1b')](_0x34e88c[_0x0801('0x19')],function(_0x3ad03f){return{'model':db[_0x3ad03f[_0x0801('0x1a')]],'as':_0x3ad03f['as'],'attributes':_0x3ad03f[_0x0801('0x18')]};}):[]};}):[]};}):[]:[]})[_0x0801('0xa')](function(_0x37a1e2){logger[_0x0801('0xb')]('ShowSquareOdbc',_0x5f348b);logger['debug'](_0x0801('0x15'),_0x5f348b,JSON['stringify'](_0x37a1e2));_0x442569(_0x37a1e2);})['catch'](function(_0x42ea2e){logger[_0x0801('0x11')](_0x0801('0x15'),_0x42ea2e[_0x0801('0x12')],_0x5f348b);_0x259dd1(_0x3050aa[_0x0801('0x11')](0x1f4,_0x42ea2e[_0x0801('0x12')]));});});}; \ No newline at end of file +var _0x67da=['message','result','ShowSquareOdbc','options','where','attributes','include','map','model','debug','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x551f70,_0x21460e){var _0x1de80d=function(_0x140510){while(--_0x140510){_0x551f70['push'](_0x551f70['shift']());}};_0x1de80d(++_0x21460e);}(_0x67da,0x1cb));var _0xa67d=function(_0x343a67,_0x4ae130){_0x343a67=_0x343a67-0x0;var _0x5d1e5a=_0x67da[_0x343a67];return _0x5d1e5a;};'use strict';var _=require('lodash');var util=require(_0xa67d('0x0'));var moment=require('moment');var BPromise=require(_0xa67d('0x1'));var rs=require(_0xa67d('0x2'));var fs=require('fs');var Redis=require(_0xa67d('0x3'));var db=require(_0xa67d('0x4'))['db'];var utils=require(_0xa67d('0x5'));var logger=require(_0xa67d('0x6'))(_0xa67d('0x7'));var config=require(_0xa67d('0x8'));var jayson=require(_0xa67d('0x9'));var client=jayson[_0xa67d('0xa')][_0xa67d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe81869,_0x92b2b7,_0x3e33d8){return new BPromise(function(_0x23cf48,_0x5d4c90){return client[_0xa67d('0xc')](_0xe81869,_0x3e33d8)[_0xa67d('0xd')](function(_0x41e373){logger[_0xa67d('0xe')](_0xa67d('0xf'),_0x92b2b7,'request\x20sent');logger['debug'](_0xa67d('0x10'),_0x92b2b7,_0xa67d('0x11'),JSON[_0xa67d('0x12')](_0x41e373));if(_0x41e373[_0xa67d('0x13')]){if(_0x41e373[_0xa67d('0x13')][_0xa67d('0x14')]===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x92b2b7,_0x41e373[_0xa67d('0x13')][_0xa67d('0x15')]);return _0x5d4c90(_0x41e373[_0xa67d('0x13')][_0xa67d('0x15')]);}logger[_0xa67d('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x92b2b7,_0x41e373[_0xa67d('0x13')]['message']);return _0x23cf48(_0x41e373['error'][_0xa67d('0x15')]);}else{logger['info'](_0xa67d('0xf'),_0x92b2b7,_0xa67d('0x11'));_0x23cf48(_0x41e373[_0xa67d('0x16')]['message']);}})['catch'](function(_0x202a4c){logger[_0xa67d('0x13')](_0xa67d('0xf'),_0x92b2b7,_0x202a4c);_0x5d4c90(_0x202a4c);});});}exports[_0xa67d('0x17')]=function(_0x24e3ed){var _0x4a0d84=this;return new Promise(function(_0x4e72c1,_0x59e184){return db['SquareOdbc']['find']({'raw':_0x24e3ed[_0xa67d('0x18')]?_0x24e3ed[_0xa67d('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x24e3ed[_0xa67d('0x18')]?_0x24e3ed[_0xa67d('0x18')][_0xa67d('0x19')]||null:null,'attributes':_0x24e3ed[_0xa67d('0x18')]?_0x24e3ed['options'][_0xa67d('0x1a')]||null:null,'include':_0x24e3ed[_0xa67d('0x18')]?_0x24e3ed[_0xa67d('0x18')]['include']?_['map'](_0x24e3ed[_0xa67d('0x18')]['include'],function(_0x46ffd6){return{'model':db[_0x46ffd6['model']],'as':_0x46ffd6['as'],'attributes':_0x46ffd6['attributes'],'include':_0x46ffd6[_0xa67d('0x1b')]?_[_0xa67d('0x1c')](_0x46ffd6[_0xa67d('0x1b')],function(_0x5e5b6e){return{'model':db[_0x5e5b6e[_0xa67d('0x1d')]],'as':_0x5e5b6e['as'],'attributes':_0x5e5b6e[_0xa67d('0x1a')],'include':_0x5e5b6e[_0xa67d('0x1b')]?_[_0xa67d('0x1c')](_0x5e5b6e[_0xa67d('0x1b')],function(_0x48fcc2){return{'model':db[_0x48fcc2[_0xa67d('0x1d')]],'as':_0x48fcc2['as'],'attributes':_0x48fcc2[_0xa67d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5bf6b0){logger['info'](_0xa67d('0x17'),_0x24e3ed);logger[_0xa67d('0x1e')]('ShowSquareOdbc',_0x24e3ed,JSON[_0xa67d('0x12')](_0x5bf6b0));_0x4e72c1(_0x5bf6b0);})[_0xa67d('0x1f')](function(_0xe1794c){logger[_0xa67d('0x13')]('ShowSquareOdbc',_0xe1794c[_0xa67d('0x15')],_0x24e3ed);_0x59e184(_0x4a0d84[_0xa67d('0x13')](0x1f4,_0xe1794c[_0xa67d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 55f8bbf..fe69c30 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 _0x7b08=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/users','post','create','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x7b08,0x163));var _0x87b0=function(_0x1724cc,_0x5ec7d5){_0x1724cc=_0x1724cc-0x0;var _0x14013b=_0x7b08[_0x1724cc];return _0x14013b;};'use strict';var multer=require(_0x87b0('0x0'));var util=require('util');var path=require(_0x87b0('0x1'));var timeout=require(_0x87b0('0x2'));var express=require(_0x87b0('0x3'));var router=express['Router']();var fs_extra=require(_0x87b0('0x4'));var auth=require(_0x87b0('0x5'));var interaction=require(_0x87b0('0x6'));var config=require(_0x87b0('0x7'));var controller=require('./squareProject.controller');router[_0x87b0('0x8')]('/',auth[_0x87b0('0x9')](),controller[_0x87b0('0xa')]);router[_0x87b0('0x8')](_0x87b0('0xb'),auth[_0x87b0('0x9')](),controller[_0x87b0('0xc')]);router[_0x87b0('0x8')](_0x87b0('0xd'),auth[_0x87b0('0x9')](),controller['getUsers']);router[_0x87b0('0xe')]('/',auth[_0x87b0('0x9')](),controller[_0x87b0('0xf')]);router[_0x87b0('0xe')](_0x87b0('0xd'),auth[_0x87b0('0x9')](),controller['addUsers']);router['put'](_0x87b0('0xb'),auth[_0x87b0('0x9')](),controller[_0x87b0('0x10')]);router[_0x87b0('0x11')](_0x87b0('0xb'),auth[_0x87b0('0x9')](),controller['destroy']);router[_0x87b0('0x11')](_0x87b0('0xd'),auth['isAuthenticated'](),controller['removeUsers']);module[_0x87b0('0x12')]=router; \ No newline at end of file +var _0x4e52=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','getUsers','post','create','addUsers','put','update','delete','destroy','/:id/users','removeUsers','multer','util','path','connect-timeout','express'];(function(_0x5463e6,_0x4e36cd){var _0x2e5fd0=function(_0x5a3b2e){while(--_0x5a3b2e){_0x5463e6['push'](_0x5463e6['shift']());}};_0x2e5fd0(++_0x4e36cd);}(_0x4e52,0x6e));var _0x24e5=function(_0x5dc5c2,_0x371dd5){_0x5dc5c2=_0x5dc5c2-0x0;var _0x56d6d9=_0x4e52[_0x5dc5c2];return _0x56d6d9;};'use strict';var multer=require(_0x24e5('0x0'));var util=require(_0x24e5('0x1'));var path=require(_0x24e5('0x2'));var timeout=require(_0x24e5('0x3'));var express=require(_0x24e5('0x4'));var router=express['Router']();var fs_extra=require(_0x24e5('0x5'));var auth=require(_0x24e5('0x6'));var interaction=require(_0x24e5('0x7'));var config=require(_0x24e5('0x8'));var controller=require('./squareProject.controller');router[_0x24e5('0x9')]('/',auth[_0x24e5('0xa')](),controller['index']);router[_0x24e5('0x9')](_0x24e5('0xb'),auth[_0x24e5('0xa')](),controller[_0x24e5('0xc')]);router[_0x24e5('0x9')]('/:id/users',auth[_0x24e5('0xa')](),controller[_0x24e5('0xd')]);router[_0x24e5('0xe')]('/',auth[_0x24e5('0xa')](),controller[_0x24e5('0xf')]);router['post']('/:id/users',auth[_0x24e5('0xa')](),controller[_0x24e5('0x10')]);router[_0x24e5('0x11')](_0x24e5('0xb'),auth[_0x24e5('0xa')](),controller[_0x24e5('0x12')]);router[_0x24e5('0x13')](_0x24e5('0xb'),auth['isAuthenticated'](),controller[_0x24e5('0x14')]);router[_0x24e5('0x13')](_0x24e5('0x15'),auth['isAuthenticated'](),controller[_0x24e5('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 1c8ff84..6547324 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 _0x31b5=['preproduction','utf8','production','toString','sequelize','exports','STRING','name','TEXT','long','getDataValue'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x31b5,0x159));var _0x531b=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x31b5[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x531b('0x0'));module[_0x531b('0x1')]={'name':{'type':Sequelize[_0x531b('0x2')],'unique':_0x531b('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x531b('0x2')]},'notes':{'type':Sequelize[_0x531b('0x4')]},'preproduction':{'type':Sequelize['BLOB'](_0x531b('0x5')),'get':function(){if(this[_0x531b('0x6')](_0x531b('0x7'))){return this[_0x531b('0x6')](_0x531b('0x7'))['toString'](_0x531b('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0x531b('0x5')),'get':function(){if(this['getDataValue'](_0x531b('0x9'))){return this[_0x531b('0x6')](_0x531b('0x9'))[_0x531b('0xa')](_0x531b('0x8'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x8561=['exports','STRING','BLOB','getDataValue','preproduction','production','DATE'];(function(_0x34ab65,_0x356d84){var _0x31532c=function(_0x23761b){while(--_0x23761b){_0x34ab65['push'](_0x34ab65['shift']());}};_0x31532c(++_0x356d84);}(_0x8561,0x1b2));var _0x1856=function(_0xb77dfe,_0x39c4c7){_0xb77dfe=_0xb77dfe-0x0;var _0x5e4f5d=_0x8561[_0xb77dfe];return _0x5e4f5d;};'use strict';var Sequelize=require('sequelize');module[_0x1856('0x0')]={'name':{'type':Sequelize[_0x1856('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x1856('0x1')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x1856('0x2')]('long'),'get':function(){if(this[_0x1856('0x3')]('preproduction')){return this[_0x1856('0x3')](_0x1856('0x4'))['toString']('utf8');}}},'production':{'type':Sequelize[_0x1856('0x2')]('long'),'get':function(){if(this['getDataValue'](_0x1856('0x5'))){return this['getDataValue']('production')['toString']('utf8');}}},'savedAt':{'type':Sequelize[_0x1856('0x6')]},'publishedAt':{'type':Sequelize[_0x1856('0x6')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 58396c6..cc464b0 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 _0x9116=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','SquareProjects','UserProfileResource','end','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','SquareProject','includeAll','include','findAll','rows','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addUsers','ids','removeUsers','isArray','emit','userSquareProject:remove','findOne','getUsers','eml-format','request-promise','moment','path','sox','to-csv','fs-extra'];(function(_0x465efe,_0x5494d8){var _0x4af02e=function(_0x172c80){while(--_0x172c80){_0x465efe['push'](_0x465efe['shift']());}};_0x4af02e(++_0x5494d8);}(_0x9116,0x1b6));var _0x6911=function(_0x67655b,_0x15ff31){_0x67655b=_0x67655b-0x0;var _0x71c09d=_0x9116[_0x67655b];return _0x71c09d;};'use strict';var emlformat=require(_0x6911('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6911('0x1'));var moment=require(_0x6911('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6911('0x3'));var sox=require(_0x6911('0x4'));var csv=require(_0x6911('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6911('0x6'));var _=require(_0x6911('0x7'));var squel=require(_0x6911('0x8'));var crypto=require(_0x6911('0x9'));var jsforce=require(_0x6911('0xa'));var deskjs=require(_0x6911('0xb'));var toCsv=require(_0x6911('0x5'));var querystring=require(_0x6911('0xc'));var Papa=require(_0x6911('0xd'));var Redis=require(_0x6911('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6911('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6911('0x10'));var logger=require('../../config/logger')(_0x6911('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6911('0x12'));var db=require(_0x6911('0x13'))['db'];config[_0x6911('0x14')]=_['defaults'](config[_0x6911('0x14')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./squareProject.socket')[_0x6911('0x15')](socket);function respondWithStatusCode(_0x5099e2,_0x4ca29e){_0x4ca29e=_0x4ca29e||0xcc;return function(_0x509ba3){if(_0x509ba3){return _0x5099e2[_0x6911('0x16')](_0x4ca29e);}return _0x5099e2[_0x6911('0x17')](_0x4ca29e)['end']();};}function respondWithResult(_0x2a384f,_0x30dbf3){_0x30dbf3=_0x30dbf3||0xc8;return function(_0x2c484c){if(_0x2c484c){return _0x2a384f['status'](_0x30dbf3)[_0x6911('0x18')](_0x2c484c);}};}function respondWithFilteredResult(_0x22b9e3,_0x569008){return function(_0x1be17e){if(_0x1be17e){var _0x52f9eb=typeof _0x569008[_0x6911('0x19')]===_0x6911('0x1a')&&typeof _0x569008[_0x6911('0x1b')]==='undefined';var _0x364537=_0x1be17e[_0x6911('0x1c')];var _0x583e17=_0x52f9eb?0x0:_0x569008[_0x6911('0x19')];var _0x35aa35=_0x52f9eb?_0x1be17e[_0x6911('0x1c')]:_0x569008[_0x6911('0x19')]+_0x569008[_0x6911('0x1b')];var _0x126a7e;if(_0x35aa35>=_0x364537){_0x35aa35=_0x364537;_0x126a7e=0xc8;}else{_0x126a7e=0xce;}_0x22b9e3[_0x6911('0x17')](_0x126a7e);return _0x22b9e3['set'](_0x6911('0x1d'),_0x583e17+'-'+_0x35aa35+'/'+_0x364537)['json'](_0x1be17e);}return null;};}function patchUpdates(_0x2af620){return function(_0x1eef6a){try{jsonpatch[_0x6911('0x1e')](_0x1eef6a,_0x2af620,!![]);}catch(_0x316639){return BPromise[_0x6911('0x1f')](_0x316639);}return _0x1eef6a['save']();};}function saveUpdates(_0x2f8595,_0xe138e1){return function(_0x56864d){if(_0x56864d){return _0x56864d[_0x6911('0x20')](_0x2f8595)[_0x6911('0x21')](function(_0x4d7c72){return _0x4d7c72;});}return null;};}function removeEntity(_0x568aae,_0x121912){return function(_0x51d851){if(_0x51d851){return _0x51d851[_0x6911('0x22')]()[_0x6911('0x21')](function(){var _0x5be29a=_0x51d851['get']({'plain':!![]});var _0x2e0a9e=_0x6911('0x23');return db[_0x6911('0x24')][_0x6911('0x22')]({'where':{'type':_0x2e0a9e,'resourceId':_0x5be29a['id']}})[_0x6911('0x21')](function(){return _0x51d851;});})['then'](function(){_0x568aae[_0x6911('0x17')](0xcc)[_0x6911('0x25')]();});}};}function handleEntityNotFound(_0x48be14,_0x4bd9b9){return function(_0x4a8b71){if(!_0x4a8b71){_0x48be14[_0x6911('0x16')](0x194);}return _0x4a8b71;};}function handleError(_0x32b5aa,_0x4b8450){_0x4b8450=_0x4b8450||0x1f4;return function(_0x27d775){logger[_0x6911('0x26')](_0x27d775['stack']);if(_0x27d775[_0x6911('0x27')]){delete _0x27d775[_0x6911('0x27')];}_0x32b5aa[_0x6911('0x17')](_0x4b8450)['send'](_0x27d775);};}exports[_0x6911('0x28')]=function(_0x3399ef,_0x20b0e9){var _0x805f21={},_0x3d6554={},_0x85c207={'count':0x0,'rows':[]};var _0x5d3f34=_[_0x6911('0x29')](db['SquareProject'][_0x6911('0x2a')],function(_0x3c59ce){return{'name':_0x3c59ce[_0x6911('0x2b')],'type':_0x3c59ce[_0x6911('0x2c')][_0x6911('0x2d')]};});_0x3d6554[_0x6911('0x2e')]=_[_0x6911('0x29')](_0x5d3f34,'name');_0x3d6554[_0x6911('0x2f')]=_[_0x6911('0x30')](_0x3399ef[_0x6911('0x2f')]);_0x3d6554['filters']=_[_0x6911('0x31')](_0x3d6554[_0x6911('0x2e')],_0x3d6554['query']);_0x805f21[_0x6911('0x32')]=_[_0x6911('0x31')](_0x3d6554[_0x6911('0x2e')],qs[_0x6911('0x33')](_0x3399ef[_0x6911('0x2f')][_0x6911('0x33')]));_0x805f21[_0x6911('0x32')]=_0x805f21[_0x6911('0x32')][_0x6911('0x34')]?_0x805f21[_0x6911('0x32')]:_0x3d6554[_0x6911('0x2e')];if(!_0x3399ef[_0x6911('0x2f')][_0x6911('0x35')]('nolimit')){_0x805f21[_0x6911('0x1b')]=qs[_0x6911('0x1b')](_0x3399ef['query'][_0x6911('0x1b')]);_0x805f21[_0x6911('0x19')]=qs[_0x6911('0x19')](_0x3399ef['query'][_0x6911('0x19')]);}_0x805f21[_0x6911('0x36')]=qs[_0x6911('0x37')](_0x3399ef[_0x6911('0x2f')][_0x6911('0x37')]);_0x805f21['where']=qs[_0x6911('0x38')](_[_0x6911('0x39')](_0x3399ef[_0x6911('0x2f')],_0x3d6554[_0x6911('0x38')]),_0x5d3f34);if(_0x3399ef[_0x6911('0x2f')][_0x6911('0x3a')]){_0x805f21[_0x6911('0x3b')]=_[_0x6911('0x3c')](_0x805f21['where'],{'$or':_[_0x6911('0x29')](_0x5d3f34,function(_0x5c229e){if(_0x5c229e[_0x6911('0x2c')]!==_0x6911('0x3d')){var _0x36eab6={};_0x36eab6[_0x5c229e[_0x6911('0x27')]]={'$like':'%'+_0x3399ef[_0x6911('0x2f')][_0x6911('0x3a')]+'%'};return _0x36eab6;}})});}_0x805f21=_['merge']({},_0x805f21,_0x3399ef[_0x6911('0x3e')]);var _0x310fa9={'where':_0x805f21[_0x6911('0x3b')]};return db[_0x6911('0x3f')][_0x6911('0x1c')](_0x310fa9)[_0x6911('0x21')](function(_0x52468d){_0x85c207['count']=_0x52468d;if(_0x3399ef['query'][_0x6911('0x40')]){_0x805f21[_0x6911('0x41')]=[{'all':!![]}];}return db[_0x6911('0x3f')][_0x6911('0x42')](_0x805f21);})[_0x6911('0x21')](function(_0x38ceb9){_0x85c207[_0x6911('0x43')]=_0x38ceb9;return _0x85c207;})['then'](respondWithFilteredResult(_0x20b0e9,_0x805f21))[_0x6911('0x44')](handleError(_0x20b0e9,null));};exports['show']=function(_0x3863df,_0x4d69f2){var _0x2e4946={'raw':![],'where':{'id':_0x3863df[_0x6911('0x45')]['id']}},_0x49e6b5={};_0x49e6b5[_0x6911('0x2e')]=_['keys'](db['SquareProject'][_0x6911('0x2a')]);_0x49e6b5[_0x6911('0x2f')]=_['keys'](_0x3863df[_0x6911('0x2f')]);_0x49e6b5[_0x6911('0x38')]=_[_0x6911('0x31')](_0x49e6b5[_0x6911('0x2e')],_0x49e6b5['query']);_0x2e4946[_0x6911('0x32')]=_[_0x6911('0x31')](_0x49e6b5[_0x6911('0x2e')],qs[_0x6911('0x33')](_0x3863df[_0x6911('0x2f')][_0x6911('0x33')]));_0x2e4946[_0x6911('0x32')]=_0x2e4946['attributes'][_0x6911('0x34')]?_0x2e4946[_0x6911('0x32')]:_0x49e6b5[_0x6911('0x2e')];if(_0x3863df['query'][_0x6911('0x40')]){_0x2e4946[_0x6911('0x41')]=[{'all':!![]}];}_0x2e4946=_[_0x6911('0x3c')]({},_0x2e4946,_0x3863df[_0x6911('0x3e')]);return db[_0x6911('0x3f')][_0x6911('0x46')](_0x2e4946)[_0x6911('0x21')](handleEntityNotFound(_0x4d69f2,null))['then'](respondWithResult(_0x4d69f2,null))[_0x6911('0x44')](handleError(_0x4d69f2,null));};exports[_0x6911('0x47')]=function(_0x442eb1,_0x4d983b){return db['SquareProject'][_0x6911('0x47')](_0x442eb1['body'],{})['then'](function(_0x99f2c1){var _0x514ce4=_0x442eb1[_0x6911('0x48')]['get']({'plain':!![]});if(!_0x514ce4)throw new Error(_0x6911('0x49'));if(_0x514ce4[_0x6911('0x4a')]===_0x6911('0x48')){var _0x5383ef=_0x99f2c1[_0x6911('0x4b')]({'plain':!![]});var _0xf0d702=_0x6911('0x23');return db[_0x6911('0x4c')][_0x6911('0x46')]({'where':{'name':_0xf0d702,'userProfileId':_0x514ce4[_0x6911('0x4d')]},'raw':!![]})['then'](function(_0x5b9e5e){if(_0x5b9e5e&&_0x5b9e5e[_0x6911('0x4e')]===0x0){return db[_0x6911('0x24')][_0x6911('0x47')]({'name':_0x5383ef[_0x6911('0x27')],'resourceId':_0x5383ef['id'],'type':_0x5b9e5e['name'],'sectionId':_0x5b9e5e['id']},{})[_0x6911('0x21')](function(){return _0x99f2c1;});}else{return _0x99f2c1;}})[_0x6911('0x44')](function(_0x28323b){logger[_0x6911('0x26')](_0x6911('0x4f'),_0x28323b);throw _0x28323b;});}return _0x99f2c1;})[_0x6911('0x21')](respondWithResult(_0x4d983b,0xc9))[_0x6911('0x44')](handleError(_0x4d983b,null));};exports[_0x6911('0x20')]=function(_0x2ef173,_0x1c6b18){if(_0x2ef173[_0x6911('0x50')]['id']){delete _0x2ef173[_0x6911('0x50')]['id'];}return db['SquareProject'][_0x6911('0x46')]({'where':{'id':_0x2ef173[_0x6911('0x45')]['id']}})[_0x6911('0x21')](handleEntityNotFound(_0x1c6b18,null))[_0x6911('0x21')](saveUpdates(_0x2ef173[_0x6911('0x50')],null))[_0x6911('0x21')](respondWithResult(_0x1c6b18,null))[_0x6911('0x44')](handleError(_0x1c6b18,null));};exports['destroy']=function(_0x5d8e9e,_0x2964f1){return db[_0x6911('0x3f')][_0x6911('0x46')]({'where':{'id':_0x5d8e9e['params']['id']}})[_0x6911('0x21')](handleEntityNotFound(_0x2964f1,null))['then'](removeEntity(_0x2964f1,null))[_0x6911('0x44')](handleError(_0x2964f1,null));};exports[_0x6911('0x51')]=function(_0x531a89,_0x4d86de,_0x46b7f2){return db[_0x6911('0x3f')][_0x6911('0x46')]({'where':{'id':_0x531a89['params']['id']}})[_0x6911('0x21')](handleEntityNotFound(_0x4d86de,null))[_0x6911('0x21')](function(_0xeedb71){if(_0xeedb71){return _0xeedb71[_0x6911('0x51')](_0x531a89['body'][_0x6911('0x52')],_['omit'](_0x531a89['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x4d86de,null))[_0x6911('0x44')](handleError(_0x4d86de,null));};exports[_0x6911('0x53')]=function(_0x1fb6ac,_0x2434b9,_0x502cc0){return db[_0x6911('0x3f')][_0x6911('0x46')]({'where':{'id':_0x1fb6ac[_0x6911('0x45')]['id']}})[_0x6911('0x21')](handleEntityNotFound(_0x2434b9,null))[_0x6911('0x21')](function(_0x47bca2){if(_0x47bca2){return _0x47bca2['removeUsers'](_0x1fb6ac[_0x6911('0x2f')]['ids'])[_0x6911('0x21')](function(){if(_[_0x6911('0x54')](_0x1fb6ac[_0x6911('0x2f')][_0x6911('0x52')])){for(var _0x93a788=0x0;_0x93a788<_0x1fb6ac[_0x6911('0x2f')]['ids'][_0x6911('0x34')];_0x93a788+=0x1){socket[_0x6911('0x55')]('userSquareProject:remove',{'UserId':Number(_0x1fb6ac['query'][_0x6911('0x52')][_0x93a788]),'SquareProjectId':Number(_0x1fb6ac[_0x6911('0x45')]['id'])});}}else{socket[_0x6911('0x55')](_0x6911('0x56'),{'UserId':Number(_0x1fb6ac[_0x6911('0x2f')][_0x6911('0x52')]),'SquareProjectId':Number(_0x1fb6ac[_0x6911('0x45')]['id'])});}});}})[_0x6911('0x21')](respondWithStatusCode(_0x2434b9,null))[_0x6911('0x44')](handleError(_0x2434b9,null));};exports['getUsers']=function(_0xcd4deb,_0x586003,_0x1cdf0c){var _0x149435={};var _0x5b2c5a={};var _0x5504fc;var _0x50f131;return db[_0x6911('0x3f')][_0x6911('0x57')]({'where':{'id':_0xcd4deb[_0x6911('0x45')]['id']}})[_0x6911('0x21')](handleEntityNotFound(_0x586003,null))['then'](function(_0x2847ac){if(_0x2847ac){_0x5504fc=_0x2847ac;_0x5b2c5a[_0x6911('0x2e')]=_[_0x6911('0x30')](db['User'][_0x6911('0x2a')]);_0x5b2c5a[_0x6911('0x2f')]=_[_0x6911('0x30')](_0xcd4deb[_0x6911('0x2f')]);_0x5b2c5a[_0x6911('0x38')]=_[_0x6911('0x31')](_0x5b2c5a[_0x6911('0x2e')],_0x5b2c5a['query']);_0x149435[_0x6911('0x32')]=_[_0x6911('0x31')](_0x5b2c5a[_0x6911('0x2e')],qs[_0x6911('0x33')](_0xcd4deb[_0x6911('0x2f')][_0x6911('0x33')]));_0x149435[_0x6911('0x32')]=_0x149435['attributes'][_0x6911('0x34')]?_0x149435[_0x6911('0x32')]:_0x5b2c5a['model'];_0x149435[_0x6911('0x36')]=qs[_0x6911('0x37')](_0xcd4deb[_0x6911('0x2f')][_0x6911('0x37')]);_0x149435[_0x6911('0x3b')]=qs[_0x6911('0x38')](_['pick'](_0xcd4deb[_0x6911('0x2f')],_0x5b2c5a[_0x6911('0x38')]));if(_0xcd4deb[_0x6911('0x2f')][_0x6911('0x3a')]){_0x149435['where']=_[_0x6911('0x3c')](_0x149435[_0x6911('0x3b')],{'$or':_[_0x6911('0x29')](_0x149435[_0x6911('0x32')],function(_0x2b716b){var _0x336ca6={};_0x336ca6[_0x2b716b]={'$like':'%'+_0xcd4deb['query'][_0x6911('0x3a')]+'%'};return _0x336ca6;})});}_0x149435=_[_0x6911('0x3c')]({},_0x149435,_0xcd4deb[_0x6911('0x3e')]);return _0x5504fc[_0x6911('0x58')](_0x149435);}})['then'](function(_0xd5352b){if(_0xd5352b){_0x50f131=_0xd5352b[_0x6911('0x34')];if(!_0xcd4deb['query'][_0x6911('0x35')]('nolimit')){_0x149435[_0x6911('0x1b')]=qs['limit'](_0xcd4deb[_0x6911('0x2f')][_0x6911('0x1b')]);_0x149435['offset']=qs[_0x6911('0x19')](_0xcd4deb[_0x6911('0x2f')][_0x6911('0x19')]);}return _0x5504fc['getUsers'](_0x149435);}})[_0x6911('0x21')](function(_0x4509f2){if(_0x4509f2){return _0x4509f2?{'count':_0x50f131,'rows':_0x4509f2}:null;}})[_0x6911('0x21')](respondWithResult(_0x586003,null))[_0x6911('0x44')](handleError(_0x586003,null));}; \ No newline at end of file +var _0xe072=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','SquareProjects','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addUsers','removeUsers','ids','emit','userSquareProject:remove','getUsers','findOne','User','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','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','defaults','redis','localhost','./squareProject.socket','status','end','json','offset','undefined','limit','count','apply','reject','update','then','destroy','sendStatus','stack','name','send','index','map','SquareProject','rawAttributes','type','model','query','intersection','attributes','fields','nolimit','order','sort','filters','pick','where','filter','merge','includeAll','include','catch','show','keys','length','options','create'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xe072,0xc9));var _0x2e07=function(_0x29f0f1,_0x5fc19b){_0x29f0f1=_0x29f0f1-0x0;var _0x577054=_0xe072[_0x29f0f1];return _0x577054;};'use strict';var emlformat=require(_0x2e07('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2e07('0x1'));var jsonpatch=require(_0x2e07('0x2'));var rp=require('request-promise');var moment=require(_0x2e07('0x3'));var BPromise=require(_0x2e07('0x4'));var Mustache=require(_0x2e07('0x5'));var util=require(_0x2e07('0x6'));var path=require(_0x2e07('0x7'));var sox=require('sox');var csv=require(_0x2e07('0x8'));var ejs=require(_0x2e07('0x9'));var fs=require('fs');var fs_extra=require(_0x2e07('0xa'));var _=require(_0x2e07('0xb'));var squel=require(_0x2e07('0xc'));var crypto=require('crypto');var jsforce=require(_0x2e07('0xd'));var deskjs=require(_0x2e07('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2e07('0xf'));var Papa=require(_0x2e07('0x10'));var Redis=require(_0x2e07('0x11'));var authService=require(_0x2e07('0x12'));var qs=require(_0x2e07('0x13'));var as=require(_0x2e07('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2e07('0x15'))(_0x2e07('0x16'));var utils=require(_0x2e07('0x17'));var config=require(_0x2e07('0x18'));var licenseUtil=require(_0x2e07('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x2e07('0x1a')](config[_0x2e07('0x1b')],{'host':_0x2e07('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2e07('0x1b')]));require(_0x2e07('0x1d'))['register'](socket);function respondWithStatusCode(_0x29c07e,_0x3fd356){_0x3fd356=_0x3fd356||0xcc;return function(_0xd90e73){if(_0xd90e73){return _0x29c07e['sendStatus'](_0x3fd356);}return _0x29c07e[_0x2e07('0x1e')](_0x3fd356)[_0x2e07('0x1f')]();};}function respondWithResult(_0x295d7b,_0x5d23c9){_0x5d23c9=_0x5d23c9||0xc8;return function(_0x5e6e56){if(_0x5e6e56){return _0x295d7b[_0x2e07('0x1e')](_0x5d23c9)[_0x2e07('0x20')](_0x5e6e56);}};}function respondWithFilteredResult(_0x36afc8,_0x172cec){return function(_0x31e592){if(_0x31e592){var _0x1ccdf=typeof _0x172cec[_0x2e07('0x21')]===_0x2e07('0x22')&&typeof _0x172cec[_0x2e07('0x23')]==='undefined';var _0x412a2f=_0x31e592[_0x2e07('0x24')];var _0x45386d=_0x1ccdf?0x0:_0x172cec[_0x2e07('0x21')];var _0x3a9e9f=_0x1ccdf?_0x31e592['count']:_0x172cec[_0x2e07('0x21')]+_0x172cec[_0x2e07('0x23')];var _0x4a5f4d;if(_0x3a9e9f>=_0x412a2f){_0x3a9e9f=_0x412a2f;_0x4a5f4d=0xc8;}else{_0x4a5f4d=0xce;}_0x36afc8[_0x2e07('0x1e')](_0x4a5f4d);return _0x36afc8['set']('Content-Range',_0x45386d+'-'+_0x3a9e9f+'/'+_0x412a2f)['json'](_0x31e592);}return null;};}function patchUpdates(_0x110644){return function(_0x2891dc){try{jsonpatch[_0x2e07('0x25')](_0x2891dc,_0x110644,!![]);}catch(_0x25bfa7){return BPromise[_0x2e07('0x26')](_0x25bfa7);}return _0x2891dc['save']();};}function saveUpdates(_0x4175f7,_0x1c1c96){return function(_0x2a0a05){if(_0x2a0a05){return _0x2a0a05[_0x2e07('0x27')](_0x4175f7)[_0x2e07('0x28')](function(_0x116048){return _0x116048;});}return null;};}function removeEntity(_0x5c8d35,_0x31deb0){return function(_0x455ee6){if(_0x455ee6){return _0x455ee6[_0x2e07('0x29')]()[_0x2e07('0x28')](function(){var _0x310419=_0x455ee6['get']({'plain':!![]});var _0x21184f='SquareProjects';return db['UserProfileResource'][_0x2e07('0x29')]({'where':{'type':_0x21184f,'resourceId':_0x310419['id']}})[_0x2e07('0x28')](function(){return _0x455ee6;});})[_0x2e07('0x28')](function(){_0x5c8d35['status'](0xcc)[_0x2e07('0x1f')]();});}};}function handleEntityNotFound(_0x2bd7d1,_0x412941){return function(_0x34e977){if(!_0x34e977){_0x2bd7d1[_0x2e07('0x2a')](0x194);}return _0x34e977;};}function handleError(_0x4273be,_0x24f5a3){_0x24f5a3=_0x24f5a3||0x1f4;return function(_0x53b9c8){logger['error'](_0x53b9c8[_0x2e07('0x2b')]);if(_0x53b9c8[_0x2e07('0x2c')]){delete _0x53b9c8['name'];}_0x4273be[_0x2e07('0x1e')](_0x24f5a3)[_0x2e07('0x2d')](_0x53b9c8);};}exports[_0x2e07('0x2e')]=function(_0x2fab25,_0x401f3b){var _0x1fbb67={},_0x5c3c3a={},_0x21d051={'count':0x0,'rows':[]};var _0x322feb=_[_0x2e07('0x2f')](db[_0x2e07('0x30')][_0x2e07('0x31')],function(_0x425139){return{'name':_0x425139['fieldName'],'type':_0x425139[_0x2e07('0x32')]['key']};});_0x5c3c3a[_0x2e07('0x33')]=_[_0x2e07('0x2f')](_0x322feb,'name');_0x5c3c3a[_0x2e07('0x34')]=_['keys'](_0x2fab25[_0x2e07('0x34')]);_0x5c3c3a['filters']=_[_0x2e07('0x35')](_0x5c3c3a[_0x2e07('0x33')],_0x5c3c3a[_0x2e07('0x34')]);_0x1fbb67[_0x2e07('0x36')]=_['intersection'](_0x5c3c3a[_0x2e07('0x33')],qs[_0x2e07('0x37')](_0x2fab25['query'][_0x2e07('0x37')]));_0x1fbb67[_0x2e07('0x36')]=_0x1fbb67['attributes']['length']?_0x1fbb67[_0x2e07('0x36')]:_0x5c3c3a[_0x2e07('0x33')];if(!_0x2fab25[_0x2e07('0x34')]['hasOwnProperty'](_0x2e07('0x38'))){_0x1fbb67[_0x2e07('0x23')]=qs['limit'](_0x2fab25[_0x2e07('0x34')][_0x2e07('0x23')]);_0x1fbb67['offset']=qs[_0x2e07('0x21')](_0x2fab25[_0x2e07('0x34')][_0x2e07('0x21')]);}_0x1fbb67[_0x2e07('0x39')]=qs[_0x2e07('0x3a')](_0x2fab25['query']['sort']);_0x1fbb67['where']=qs[_0x2e07('0x3b')](_[_0x2e07('0x3c')](_0x2fab25[_0x2e07('0x34')],_0x5c3c3a['filters']),_0x322feb);if(_0x2fab25['query']['filter']){_0x1fbb67[_0x2e07('0x3d')]=_['merge'](_0x1fbb67['where'],{'$or':_['map'](_0x322feb,function(_0x20c8ed){if(_0x20c8ed['type']!=='VIRTUAL'){var _0x51aff9={};_0x51aff9[_0x20c8ed[_0x2e07('0x2c')]]={'$like':'%'+_0x2fab25[_0x2e07('0x34')][_0x2e07('0x3e')]+'%'};return _0x51aff9;}})});}_0x1fbb67=_[_0x2e07('0x3f')]({},_0x1fbb67,_0x2fab25['options']);var _0x2251a0={'where':_0x1fbb67[_0x2e07('0x3d')]};return db[_0x2e07('0x30')]['count'](_0x2251a0)[_0x2e07('0x28')](function(_0x409594){_0x21d051[_0x2e07('0x24')]=_0x409594;if(_0x2fab25['query'][_0x2e07('0x40')]){_0x1fbb67[_0x2e07('0x41')]=[{'all':!![]}];}return db[_0x2e07('0x30')]['findAll'](_0x1fbb67);})[_0x2e07('0x28')](function(_0x4780de){_0x21d051['rows']=_0x4780de;return _0x21d051;})['then'](respondWithFilteredResult(_0x401f3b,_0x1fbb67))[_0x2e07('0x42')](handleError(_0x401f3b,null));};exports[_0x2e07('0x43')]=function(_0x40e42d,_0x4898a2){var _0x2f09df={'raw':![],'where':{'id':_0x40e42d['params']['id']}},_0x2927b7={};_0x2927b7[_0x2e07('0x33')]=_['keys'](db[_0x2e07('0x30')][_0x2e07('0x31')]);_0x2927b7[_0x2e07('0x34')]=_[_0x2e07('0x44')](_0x40e42d[_0x2e07('0x34')]);_0x2927b7['filters']=_['intersection'](_0x2927b7[_0x2e07('0x33')],_0x2927b7[_0x2e07('0x34')]);_0x2f09df[_0x2e07('0x36')]=_[_0x2e07('0x35')](_0x2927b7[_0x2e07('0x33')],qs[_0x2e07('0x37')](_0x40e42d[_0x2e07('0x34')][_0x2e07('0x37')]));_0x2f09df['attributes']=_0x2f09df[_0x2e07('0x36')][_0x2e07('0x45')]?_0x2f09df[_0x2e07('0x36')]:_0x2927b7['model'];if(_0x40e42d[_0x2e07('0x34')][_0x2e07('0x40')]){_0x2f09df[_0x2e07('0x41')]=[{'all':!![]}];}_0x2f09df=_[_0x2e07('0x3f')]({},_0x2f09df,_0x40e42d[_0x2e07('0x46')]);return db['SquareProject']['find'](_0x2f09df)['then'](handleEntityNotFound(_0x4898a2,null))['then'](respondWithResult(_0x4898a2,null))[_0x2e07('0x42')](handleError(_0x4898a2,null));};exports[_0x2e07('0x47')]=function(_0x5ddd27,_0x39f124){return db[_0x2e07('0x30')][_0x2e07('0x47')](_0x5ddd27[_0x2e07('0x48')],{})[_0x2e07('0x28')](function(_0x1c4d5c){var _0x303466=_0x5ddd27[_0x2e07('0x49')]['get']({'plain':!![]});if(!_0x303466)throw new Error(_0x2e07('0x4a'));if(_0x303466[_0x2e07('0x4b')]===_0x2e07('0x49')){var _0x12eb36=_0x1c4d5c[_0x2e07('0x4c')]({'plain':!![]});var _0x16db56=_0x2e07('0x4d');return db['UserProfileSection'][_0x2e07('0x4e')]({'where':{'name':_0x16db56,'userProfileId':_0x303466[_0x2e07('0x4f')]},'raw':!![]})[_0x2e07('0x28')](function(_0x5e1ef5){if(_0x5e1ef5&&_0x5e1ef5['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x12eb36[_0x2e07('0x2c')],'resourceId':_0x12eb36['id'],'type':_0x5e1ef5[_0x2e07('0x2c')],'sectionId':_0x5e1ef5['id']},{})[_0x2e07('0x28')](function(){return _0x1c4d5c;});}else{return _0x1c4d5c;}})[_0x2e07('0x42')](function(_0x3a5d2b){logger[_0x2e07('0x50')](_0x2e07('0x51'),_0x3a5d2b);throw _0x3a5d2b;});}return _0x1c4d5c;})[_0x2e07('0x28')](respondWithResult(_0x39f124,0xc9))[_0x2e07('0x42')](handleError(_0x39f124,null));};exports['update']=function(_0x42ef52,_0x515f33){if(_0x42ef52['body']['id']){delete _0x42ef52[_0x2e07('0x48')]['id'];}return db[_0x2e07('0x30')]['find']({'where':{'id':_0x42ef52[_0x2e07('0x52')]['id']}})[_0x2e07('0x28')](handleEntityNotFound(_0x515f33,null))[_0x2e07('0x28')](saveUpdates(_0x42ef52['body'],null))[_0x2e07('0x28')](respondWithResult(_0x515f33,null))[_0x2e07('0x42')](handleError(_0x515f33,null));};exports[_0x2e07('0x29')]=function(_0x132e71,_0xeb5ff){return db['SquareProject'][_0x2e07('0x4e')]({'where':{'id':_0x132e71['params']['id']}})[_0x2e07('0x28')](handleEntityNotFound(_0xeb5ff,null))[_0x2e07('0x28')](removeEntity(_0xeb5ff,null))[_0x2e07('0x42')](handleError(_0xeb5ff,null));};exports[_0x2e07('0x53')]=function(_0x17f020,_0x3e9c69,_0xeec3a4){return db[_0x2e07('0x30')][_0x2e07('0x4e')]({'where':{'id':_0x17f020[_0x2e07('0x52')]['id']}})[_0x2e07('0x28')](handleEntityNotFound(_0x3e9c69,null))[_0x2e07('0x28')](function(_0x59bc7e){if(_0x59bc7e){return _0x59bc7e['addUsers'](_0x17f020[_0x2e07('0x48')]['ids'],_['omit'](_0x17f020[_0x2e07('0x48')],['ids','id'])||{});}})[_0x2e07('0x28')](respondWithResult(_0x3e9c69,null))['catch'](handleError(_0x3e9c69,null));};exports[_0x2e07('0x54')]=function(_0x344ff3,_0x43e403,_0x39d22a){return db[_0x2e07('0x30')][_0x2e07('0x4e')]({'where':{'id':_0x344ff3[_0x2e07('0x52')]['id']}})[_0x2e07('0x28')](handleEntityNotFound(_0x43e403,null))[_0x2e07('0x28')](function(_0x319fdb){if(_0x319fdb){return _0x319fdb[_0x2e07('0x54')](_0x344ff3['query'][_0x2e07('0x55')])[_0x2e07('0x28')](function(){if(_['isArray'](_0x344ff3['query'][_0x2e07('0x55')])){for(var _0x5b480d=0x0;_0x5b480d<_0x344ff3[_0x2e07('0x34')][_0x2e07('0x55')][_0x2e07('0x45')];_0x5b480d+=0x1){socket[_0x2e07('0x56')](_0x2e07('0x57'),{'UserId':Number(_0x344ff3[_0x2e07('0x34')][_0x2e07('0x55')][_0x5b480d]),'SquareProjectId':Number(_0x344ff3[_0x2e07('0x52')]['id'])});}}else{socket[_0x2e07('0x56')](_0x2e07('0x57'),{'UserId':Number(_0x344ff3['query'][_0x2e07('0x55')]),'SquareProjectId':Number(_0x344ff3[_0x2e07('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0x43e403,null))[_0x2e07('0x42')](handleError(_0x43e403,null));};exports[_0x2e07('0x58')]=function(_0x51ec7f,_0x4c465f,_0x3ade05){var _0x2c7787={};var _0xd6029={};var _0x2f1573;var _0x7ead4f;return db[_0x2e07('0x30')][_0x2e07('0x59')]({'where':{'id':_0x51ec7f[_0x2e07('0x52')]['id']}})[_0x2e07('0x28')](handleEntityNotFound(_0x4c465f,null))[_0x2e07('0x28')](function(_0x2ef832){if(_0x2ef832){_0x2f1573=_0x2ef832;_0xd6029[_0x2e07('0x33')]=_[_0x2e07('0x44')](db[_0x2e07('0x5a')][_0x2e07('0x31')]);_0xd6029['query']=_['keys'](_0x51ec7f[_0x2e07('0x34')]);_0xd6029[_0x2e07('0x3b')]=_[_0x2e07('0x35')](_0xd6029[_0x2e07('0x33')],_0xd6029['query']);_0x2c7787[_0x2e07('0x36')]=_[_0x2e07('0x35')](_0xd6029[_0x2e07('0x33')],qs['fields'](_0x51ec7f[_0x2e07('0x34')][_0x2e07('0x37')]));_0x2c7787[_0x2e07('0x36')]=_0x2c7787['attributes'][_0x2e07('0x45')]?_0x2c7787[_0x2e07('0x36')]:_0xd6029['model'];_0x2c7787[_0x2e07('0x39')]=qs[_0x2e07('0x3a')](_0x51ec7f[_0x2e07('0x34')][_0x2e07('0x3a')]);_0x2c7787[_0x2e07('0x3d')]=qs[_0x2e07('0x3b')](_[_0x2e07('0x3c')](_0x51ec7f[_0x2e07('0x34')],_0xd6029[_0x2e07('0x3b')]));if(_0x51ec7f[_0x2e07('0x34')][_0x2e07('0x3e')]){_0x2c7787[_0x2e07('0x3d')]=_[_0x2e07('0x3f')](_0x2c7787[_0x2e07('0x3d')],{'$or':_[_0x2e07('0x2f')](_0x2c7787[_0x2e07('0x36')],function(_0x48cfb1){var _0x3afd76={};_0x3afd76[_0x48cfb1]={'$like':'%'+_0x51ec7f[_0x2e07('0x34')][_0x2e07('0x3e')]+'%'};return _0x3afd76;})});}_0x2c7787=_[_0x2e07('0x3f')]({},_0x2c7787,_0x51ec7f[_0x2e07('0x46')]);return _0x2f1573[_0x2e07('0x58')](_0x2c7787);}})[_0x2e07('0x28')](function(_0x193799){if(_0x193799){_0x7ead4f=_0x193799[_0x2e07('0x45')];if(!_0x51ec7f[_0x2e07('0x34')]['hasOwnProperty'](_0x2e07('0x38'))){_0x2c7787[_0x2e07('0x23')]=qs[_0x2e07('0x23')](_0x51ec7f['query'][_0x2e07('0x23')]);_0x2c7787[_0x2e07('0x21')]=qs['offset'](_0x51ec7f[_0x2e07('0x34')][_0x2e07('0x21')]);}return _0x2f1573['getUsers'](_0x2c7787);}})['then'](function(_0x5593d1){if(_0x5593d1){return _0x5593d1?{'count':_0x7ead4f,'rows':_0x5593d1}:null;}})[_0x2e07('0x28')](respondWithResult(_0x4c465f,null))[_0x2e07('0x42')](handleError(_0x4c465f,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 2bb60de..283ac1e 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 _0x0023=['SquareProject','save','update','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0xa2c9ce,_0x2be1ad){var _0x2f82d3=function(_0x5dc703){while(--_0x5dc703){_0xa2c9ce['push'](_0xa2c9ce['shift']());}};_0x2f82d3(++_0x2be1ad);}(_0x0023,0x8e));var _0x3002=function(_0x5ec0ab,_0x42940d){_0x5ec0ab=_0x5ec0ab-0x0;var _0x5bd602=_0x0023[_0x5ec0ab];return _0x5bd602;};'use strict';var EventEmitter=require(_0x3002('0x0'));var SquareProject=require(_0x3002('0x1'))['db'][_0x3002('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3002('0x3'),'afterUpdate':_0x3002('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3e03a2){return function(_0x339aa9,_0x4b13bc,_0x557bfa){SquareProjectEvents[_0x3002('0x5')](_0x3e03a2+':'+_0x339aa9['id'],_0x339aa9);SquareProjectEvents[_0x3002('0x5')](_0x3e03a2,_0x339aa9);_0x557bfa(null);};}for(var e in events){if(events[_0x3002('0x6')](e)){var event=events[e];SquareProject[_0x3002('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0x2a74=['SquareProject','setMaxListeners','save','emit','exports','events','../../mysqldb'];(function(_0x305287,_0x5f2ffb){var _0x7e253=function(_0x25eaee){while(--_0x25eaee){_0x305287['push'](_0x305287['shift']());}};_0x7e253(++_0x5f2ffb);}(_0x2a74,0x1be));var _0x42a7=function(_0x4c9380,_0x2fefc0){_0x4c9380=_0x4c9380-0x0;var _0x49a523=_0x2a74[_0x4c9380];return _0x49a523;};'use strict';var EventEmitter=require(_0x42a7('0x0'));var SquareProject=require(_0x42a7('0x1'))['db'][_0x42a7('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x42a7('0x3')](0x0);var events={'afterCreate':_0x42a7('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x30ba83){return function(_0x8b7e1f,_0x51ffa1,_0x2b9c56){SquareProjectEvents['emit'](_0x30ba83+':'+_0x8b7e1f['id'],_0x8b7e1f);SquareProjectEvents[_0x42a7('0x5')](_0x30ba83,_0x8b7e1f);_0x2b9c56(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x42a7('0x6')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 0dd4a22..c3477eb 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 _0x9b0c=['./squareProject.attributes','define','square_projects','changed','preproduction','format','publishedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x553305,_0x516b34){var _0x3329c6=function(_0x4d42db){while(--_0x4d42db){_0x553305['push'](_0x553305['shift']());}};_0x3329c6(++_0x516b34);}(_0x9b0c,0x1b8));var _0xc9b0=function(_0x589376,_0x284cc9){_0x589376=_0x589376-0x0;var _0x1cf89e=_0x9b0c[_0x589376];return _0x1cf89e;};'use strict';var _=require(_0xc9b0('0x0'));var util=require(_0xc9b0('0x1'));var logger=require(_0xc9b0('0x2'))(_0xc9b0('0x3'));var moment=require(_0xc9b0('0x4'));var BPromise=require(_0xc9b0('0x5'));var rp=require(_0xc9b0('0x6'));var fs=require('fs');var path=require(_0xc9b0('0x7'));var rimraf=require(_0xc9b0('0x8'));var config=require(_0xc9b0('0x9'));var attributes=require(_0xc9b0('0xa'));module['exports']=function(_0x573d87,_0x44889f){return _0x573d87[_0xc9b0('0xb')]('SquareProject',attributes,{'tableName':_0xc9b0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2eccf2,_0x1682f6,_0x5350ac){if(_0x2eccf2[_0xc9b0('0xd')](_0xc9b0('0xe'))){_0x2eccf2['savedAt']=moment()[_0xc9b0('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x2eccf2['changed']('production')){_0x2eccf2[_0xc9b0('0x10')]=moment()['format'](_0xc9b0('0x11'));}_0x5350ac(null,_0x2eccf2);}}});}; \ No newline at end of file +var _0x86ec=['YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','format'];(function(_0x1a8076,_0x270397){var _0x3df2d8=function(_0x22ffb3){while(--_0x22ffb3){_0x1a8076['push'](_0x1a8076['shift']());}};_0x3df2d8(++_0x270397);}(_0x86ec,0x8b));var _0xc86e=function(_0x46513d,_0x4f5e9c){_0x46513d=_0x46513d-0x0;var _0x4e10b8=_0x86ec[_0x46513d];return _0x4e10b8;};'use strict';var _=require('lodash');var util=require(_0xc86e('0x0'));var logger=require(_0xc86e('0x1'))(_0xc86e('0x2'));var moment=require('moment');var BPromise=require(_0xc86e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc86e('0x4'));var config=require(_0xc86e('0x5'));var attributes=require(_0xc86e('0x6'));module[_0xc86e('0x7')]=function(_0x50df31,_0x1a592c){return _0x50df31[_0xc86e('0x8')](_0xc86e('0x9'),attributes,{'tableName':_0xc86e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x45b7ea,_0x2013df,_0x3ada72){if(_0x45b7ea[_0xc86e('0xb')](_0xc86e('0xc'))){_0x45b7ea['savedAt']=moment()[_0xc86e('0xd')](_0xc86e('0xe'));}if(_0x45b7ea[_0xc86e('0xb')](_0xc86e('0xf'))){_0x45b7ea[_0xc86e('0x10')]=moment()[_0xc86e('0xd')](_0xc86e('0xe'));}_0x3ada72(null,_0x45b7ea);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 5b73361..bbc615f 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 _0x75cc=['options','raw','attributes','map','include','model','ShowSquareProject','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./squareProject.socket','register','request','then','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SquareProject'];(function(_0x1e6b81,_0x1eb3ec){var _0x457c87=function(_0x46f35e){while(--_0x46f35e){_0x1e6b81['push'](_0x1e6b81['shift']());}};_0x457c87(++_0x1eb3ec);}(_0x75cc,0x1ab));var _0xc75c=function(_0x5986bd,_0x53139f){_0x5986bd=_0x5986bd-0x0;var _0x329493=_0x75cc[_0x5986bd];return _0x329493;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc75c('0x0'));var BPromise=require(_0xc75c('0x1'));var rs=require(_0xc75c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc75c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc75c('0x4'))(_0xc75c('0x5'));var config=require(_0xc75c('0x6'));var jayson=require(_0xc75c('0x7'));var client=jayson[_0xc75c('0x8')][_0xc75c('0x9')]({'port':0x232a});config[_0xc75c('0xa')]=_['defaults'](config[_0xc75c('0xa')],{'host':_0xc75c('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc75c('0xa')]));require(_0xc75c('0xc'))[_0xc75c('0xd')](socket);function respondWithRpcPromise(_0x557680,_0x1d3859,_0x3c97e1){return new BPromise(function(_0xbd719c,_0x17943b){return client[_0xc75c('0xe')](_0x557680,_0x3c97e1)[_0xc75c('0xf')](function(_0x7dbad2){logger['info'](_0xc75c('0x10'),_0x1d3859,_0xc75c('0x11'));logger[_0xc75c('0x12')](_0xc75c('0x13'),_0x1d3859,_0xc75c('0x11'),JSON[_0xc75c('0x14')](_0x7dbad2));if(_0x7dbad2[_0xc75c('0x15')]){if(_0x7dbad2['error'][_0xc75c('0x16')]===0x1f4){logger[_0xc75c('0x15')](_0xc75c('0x10'),_0x1d3859,_0x7dbad2[_0xc75c('0x15')][_0xc75c('0x17')]);return _0x17943b(_0x7dbad2[_0xc75c('0x15')][_0xc75c('0x17')]);}logger[_0xc75c('0x15')](_0xc75c('0x10'),_0x1d3859,_0x7dbad2[_0xc75c('0x15')][_0xc75c('0x17')]);return _0xbd719c(_0x7dbad2[_0xc75c('0x15')][_0xc75c('0x17')]);}else{logger[_0xc75c('0x18')]('SquareProject,\x20%s,\x20%s',_0x1d3859,'request\x20sent');_0xbd719c(_0x7dbad2[_0xc75c('0x19')][_0xc75c('0x17')]);}})[_0xc75c('0x1a')](function(_0x220fdd){logger[_0xc75c('0x15')](_0xc75c('0x10'),_0x1d3859,_0x220fdd);_0x17943b(_0x220fdd);});});}exports['ShowSquareProject']=function(_0x42e909){var _0x518767=this;return new Promise(function(_0x513143,_0x53d674){return db[_0xc75c('0x1b')]['find']({'raw':_0x42e909[_0xc75c('0x1c')]?_0x42e909['options'][_0xc75c('0x1d')]===undefined?!![]:![]:!![],'where':_0x42e909['options']?_0x42e909['options']['where']||null:null,'attributes':_0x42e909[_0xc75c('0x1c')]?_0x42e909['options'][_0xc75c('0x1e')]||null:null,'include':_0x42e909[_0xc75c('0x1c')]?_0x42e909[_0xc75c('0x1c')]['include']?_[_0xc75c('0x1f')](_0x42e909[_0xc75c('0x1c')][_0xc75c('0x20')],function(_0x47d856){return{'model':db[_0x47d856[_0xc75c('0x21')]],'as':_0x47d856['as'],'attributes':_0x47d856[_0xc75c('0x1e')],'include':_0x47d856['include']?_[_0xc75c('0x1f')](_0x47d856[_0xc75c('0x20')],function(_0x9cae3e){return{'model':db[_0x9cae3e['model']],'as':_0x9cae3e['as'],'attributes':_0x9cae3e[_0xc75c('0x1e')],'include':_0x9cae3e[_0xc75c('0x20')]?_[_0xc75c('0x1f')](_0x9cae3e['include'],function(_0x8e4e2){return{'model':db[_0x8e4e2[_0xc75c('0x21')]],'as':_0x8e4e2['as'],'attributes':_0x8e4e2[_0xc75c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc75c('0xf')](function(_0x6e45f8){logger[_0xc75c('0x18')](_0xc75c('0x22'),_0x42e909);logger[_0xc75c('0x12')]('ShowSquareProject',_0x42e909,JSON['stringify'](_0x6e45f8));_0x513143(_0x6e45f8);})[_0xc75c('0x1a')](function(_0x285795){logger[_0xc75c('0x15')](_0xc75c('0x22'),_0x285795['message'],_0x42e909);_0x53d674(_0x518767[_0xc75c('0x15')](0x1f4,_0x285795['message']));});});}; \ No newline at end of file +var _0xe48e=['SquareProject,\x20%s,\x20%s,\x20%s','error','message','catch','ShowSquareProject','options','raw','where','map','model','attributes','include','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x15e42b,_0x12e566){var _0xce7458=function(_0x1459d2){while(--_0x1459d2){_0x15e42b['push'](_0x15e42b['shift']());}};_0xce7458(++_0x12e566);}(_0xe48e,0xbb));var _0xee48=function(_0x4014fb,_0x373265){_0x4014fb=_0x4014fb-0x0;var _0x10bf20=_0xe48e[_0x4014fb];return _0x10bf20;};'use strict';var _=require(_0xee48('0x0'));var util=require(_0xee48('0x1'));var moment=require(_0xee48('0x2'));var BPromise=require(_0xee48('0x3'));var rs=require(_0xee48('0x4'));var fs=require('fs');var Redis=require(_0xee48('0x5'));var db=require(_0xee48('0x6'))['db'];var utils=require(_0xee48('0x7'));var logger=require('../../config/logger')(_0xee48('0x8'));var config=require(_0xee48('0x9'));var jayson=require(_0xee48('0xa'));var client=jayson[_0xee48('0xb')][_0xee48('0xc')]({'port':0x232a});config['redis']=_[_0xee48('0xd')](config[_0xee48('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xee48('0xe')]));require(_0xee48('0xf'))[_0xee48('0x10')](socket);function respondWithRpcPromise(_0x405ad4,_0x3a5597,_0x326773){return new BPromise(function(_0x4ab567,_0x626689){return client[_0xee48('0x11')](_0x405ad4,_0x326773)[_0xee48('0x12')](function(_0x597ca4){logger[_0xee48('0x13')](_0xee48('0x14'),_0x3a5597,_0xee48('0x15'));logger[_0xee48('0x16')](_0xee48('0x17'),_0x3a5597,_0xee48('0x15'),JSON['stringify'](_0x597ca4));if(_0x597ca4['error']){if(_0x597ca4[_0xee48('0x18')]['code']===0x1f4){logger[_0xee48('0x18')](_0xee48('0x14'),_0x3a5597,_0x597ca4['error'][_0xee48('0x19')]);return _0x626689(_0x597ca4[_0xee48('0x18')][_0xee48('0x19')]);}logger[_0xee48('0x18')](_0xee48('0x14'),_0x3a5597,_0x597ca4[_0xee48('0x18')][_0xee48('0x19')]);return _0x4ab567(_0x597ca4[_0xee48('0x18')]['message']);}else{logger['info'](_0xee48('0x14'),_0x3a5597,_0xee48('0x15'));_0x4ab567(_0x597ca4['result']['message']);}})[_0xee48('0x1a')](function(_0x1b68ee){logger['error']('SquareProject,\x20%s,\x20%s',_0x3a5597,_0x1b68ee);_0x626689(_0x1b68ee);});});}exports[_0xee48('0x1b')]=function(_0x2023c5){var _0x215cca=this;return new Promise(function(_0x4c96bc,_0x1a0911){return db['SquareProject']['find']({'raw':_0x2023c5[_0xee48('0x1c')]?_0x2023c5[_0xee48('0x1c')][_0xee48('0x1d')]===undefined?!![]:![]:!![],'where':_0x2023c5[_0xee48('0x1c')]?_0x2023c5[_0xee48('0x1c')][_0xee48('0x1e')]||null:null,'attributes':_0x2023c5[_0xee48('0x1c')]?_0x2023c5[_0xee48('0x1c')]['attributes']||null:null,'include':_0x2023c5['options']?_0x2023c5['options']['include']?_[_0xee48('0x1f')](_0x2023c5[_0xee48('0x1c')]['include'],function(_0x25eae7){return{'model':db[_0x25eae7[_0xee48('0x20')]],'as':_0x25eae7['as'],'attributes':_0x25eae7[_0xee48('0x21')],'include':_0x25eae7[_0xee48('0x22')]?_[_0xee48('0x1f')](_0x25eae7[_0xee48('0x22')],function(_0x23e646){return{'model':db[_0x23e646[_0xee48('0x20')]],'as':_0x23e646['as'],'attributes':_0x23e646[_0xee48('0x21')],'include':_0x23e646[_0xee48('0x22')]?_['map'](_0x23e646[_0xee48('0x22')],function(_0x2f3ab3){return{'model':db[_0x2f3ab3['model']],'as':_0x2f3ab3['as'],'attributes':_0x2f3ab3[_0xee48('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x313d07){logger[_0xee48('0x13')](_0xee48('0x1b'),_0x2023c5);logger['debug'](_0xee48('0x1b'),_0x2023c5,JSON['stringify'](_0x313d07));_0x4c96bc(_0x313d07);})[_0xee48('0x1a')](function(_0x5113bf){logger[_0xee48('0x18')](_0xee48('0x1b'),_0x5113bf[_0xee48('0x19')],_0x2023c5);_0x1a0911(_0x215cca['error'](0x1f4,_0x5113bf[_0xee48('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index b8efd9f..946d044 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 _0xda53=['emit','removeListener','register','length','./squareProject.events','save'];(function(_0xf2833d,_0x308c9d){var _0x13e6b7=function(_0x39ab68){while(--_0x39ab68){_0xf2833d['push'](_0xf2833d['shift']());}};_0x13e6b7(++_0x308c9d);}(_0xda53,0x13c));var _0x3da5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xda53[_0x3dd15e];return _0x231fd0;};'use strict';var SquareProjectEvents=require(_0x3da5('0x0'));var events=[_0x3da5('0x1'),'remove','update'];function createListener(_0x3c63f1,_0x2cafbd){return function(_0x328f3c){_0x2cafbd[_0x3da5('0x2')](_0x3c63f1,_0x328f3c);};}function removeListener(_0x5b55d0,_0x512053){return function(){SquareProjectEvents[_0x3da5('0x3')](_0x5b55d0,_0x512053);};}exports[_0x3da5('0x4')]=function(_0x3d3b2f){for(var _0x96a3ef=0x0,_0x2a7570=events[_0x3da5('0x5')];_0x96a3ef<_0x2a7570;_0x96a3ef++){var _0x4943a7=events[_0x96a3ef];var _0x44415b=createListener('squareProject:'+_0x4943a7,_0x3d3b2f);SquareProjectEvents['on'](_0x4943a7,_0x44415b);}}; \ No newline at end of file +var _0x75df=['register','length','./squareProject.events','remove','emit','removeListener'];(function(_0x3718b7,_0x2da677){var _0xf8c91e=function(_0x2519b4){while(--_0x2519b4){_0x3718b7['push'](_0x3718b7['shift']());}};_0xf8c91e(++_0x2da677);}(_0x75df,0x12e));var _0xf75d=function(_0x2c7731,_0x5e5fce){_0x2c7731=_0x2c7731-0x0;var _0x56f3ca=_0x75df[_0x2c7731];return _0x56f3ca;};'use strict';var SquareProjectEvents=require(_0xf75d('0x0'));var events=['save',_0xf75d('0x1'),'update'];function createListener(_0xaac293,_0x50ffd9){return function(_0x3b635d){_0x50ffd9[_0xf75d('0x2')](_0xaac293,_0x3b635d);};}function removeListener(_0x1cb5ad,_0x536a1b){return function(){SquareProjectEvents[_0xf75d('0x3')](_0x1cb5ad,_0x536a1b);};}exports[_0xf75d('0x4')]=function(_0x49108b){for(var _0x13bba3=0x0,_0x1c7b1a=events[_0xf75d('0x5')];_0x13bba3<_0x1c7b1a;_0x13bba3++){var _0x5b1a1c=events[_0x13bba3];var _0xb773b5=createListener('squareProject:'+_0x5b1a1c,_0x49108b);SquareProjectEvents['on'](_0x5b1a1c,_0xb773b5);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 2abbfb6..da7268f 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','download','post','create','put','delete','exports'];(function(_0x3b2879,_0x4071fa){var _0x4f46f0=function(_0x1dc691){while(--_0x1dc691){_0x3b2879['push'](_0x3b2879['shift']());}};_0x4f46f0(++_0x4071fa);}(_0x326f,0xd1));var _0xf326=function(_0x24be17,_0x5baf41){_0x24be17=_0x24be17-0x0;var _0x34b303=_0x326f[_0x24be17];return _0x34b303;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file +var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x22601,_0x1cad0d){var _0x26ee0c=function(_0x4af466){while(--_0x4af466){_0x22601['push'](_0x22601['shift']());}};_0x26ee0c(++_0x1cad0d);}(_0x4975,0x86));var _0x5497=function(_0x2dacd4,_0x2e88cf){_0x2dacd4=_0x2dacd4-0x0;var _0x3a7ed8=_0x4975[_0x2dacd4];return _0x3a7ed8;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index a9b3550..d732840 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 _0xa41a=['exports','STRING','getDataValue','substring','lastIndexOf','sequelize'];(function(_0x175f0f,_0x2a60c8){var _0x2f5219=function(_0x31b4ef){while(--_0x31b4ef){_0x175f0f['push'](_0x175f0f['shift']());}};_0x2f5219(++_0x2a60c8);}(_0xa41a,0x6b));var _0xaa41=function(_0x16b71e,_0x20353d){_0x16b71e=_0x16b71e-0x0;var _0x298c74=_0xa41a[_0x16b71e];return _0x298c74;};'use strict';var Sequelize=require(_0xaa41('0x0'));module[_0xaa41('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xaa41('0x2')]},'calleridname':{'type':Sequelize[_0xaa41('0x2')]},'context':{'type':Sequelize[_0xaa41('0x2')]},'extension':{'type':Sequelize[_0xaa41('0x2')]},'priority':{'type':Sequelize[_0xaa41('0x2')]},'accountcode':{'type':Sequelize[_0xaa41('0x2')]},'dnid':{'type':Sequelize[_0xaa41('0x2')]},'projectName':{'type':Sequelize[_0xaa41('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0xaa41('0x2')]},'savePath':{'type':Sequelize[_0xaa41('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x5b1fff='';var _0x179545=this[_0xaa41('0x3')]('savePath');if(_0x179545){_0x5b1fff=_0x179545[_0xaa41('0x4')](_0x179545[_0xaa41('0x5')]('.'));}return _0x5b1fff;}}}; \ No newline at end of file +var _0x8d0e=['exports','STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize'];(function(_0x4f66e9,_0x1db71d){var _0x319ad1=function(_0x54ca32){while(--_0x54ca32){_0x4f66e9['push'](_0x4f66e9['shift']());}};_0x319ad1(++_0x1db71d);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x59badf,_0x357929){_0x59badf=_0x59badf-0x0;var _0x99cc0a=_0x8d0e[_0x59badf];return _0x99cc0a;};'use strict';var Sequelize=require(_0xe8d0('0x0'));module[_0xe8d0('0x1')]={'uniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'callerid':{'type':Sequelize[_0xe8d0('0x2')]},'calleridname':{'type':Sequelize[_0xe8d0('0x2')]},'context':{'type':Sequelize[_0xe8d0('0x2')]},'extension':{'type':Sequelize[_0xe8d0('0x2')]},'priority':{'type':Sequelize[_0xe8d0('0x2')]},'accountcode':{'type':Sequelize[_0xe8d0('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xe8d0('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0xe8d0('0x2')]},'format':{'type':Sequelize[_0xe8d0('0x3')],'get':function(){var _0x469d37='';var _0xcc03d0=this[_0xe8d0('0x4')](_0xe8d0('0x5'));if(_0xcc03d0){_0x469d37=_0xcc03d0[_0xe8d0('0x6')](_0xcc03d0[_0xe8d0('0x7')]('.'));}return _0x469d37;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index cdc7fd8..d6c9b12 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 _0x3158=['apply','reject','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','SquareRecording','includeAll','include','findAll','rows','catch','show','find','create','body','params','download','../../components/encryptor','uniqueid','savePath','filename','format','existsSync','secrets','ValidationError','SquareRecording\x20not\x20found','unlink','message','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range'];(function(_0xb71e5c,_0x504369){var _0x3505a1=function(_0x56c7f5){while(--_0x56c7f5){_0xb71e5c['push'](_0xb71e5c['shift']());}};_0x3505a1(++_0x504369);}(_0x3158,0x9c));var _0x8315=function(_0x4d4c30,_0x40a89b){_0x4d4c30=_0x4d4c30-0x0;var _0x33535f=_0x3158[_0x4d4c30];return _0x33535f;};'use strict';var emlformat=require(_0x8315('0x0'));var rimraf=require(_0x8315('0x1'));var zipdir=require(_0x8315('0x2'));var jsonpatch=require(_0x8315('0x3'));var rp=require('request-promise');var moment=require(_0x8315('0x4'));var BPromise=require(_0x8315('0x5'));var Mustache=require(_0x8315('0x6'));var util=require('util');var path=require(_0x8315('0x7'));var sox=require('sox');var csv=require(_0x8315('0x8'));var ejs=require(_0x8315('0x9'));var fs=require('fs');var fs_extra=require(_0x8315('0xa'));var _=require(_0x8315('0xb'));var squel=require(_0x8315('0xc'));var crypto=require(_0x8315('0xd'));var jsforce=require(_0x8315('0xe'));var deskjs=require(_0x8315('0xf'));var toCsv=require(_0x8315('0x8'));var querystring=require(_0x8315('0x10'));var Papa=require('papaparse');var Redis=require(_0x8315('0x11'));var authService=require(_0x8315('0x12'));var qs=require(_0x8315('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8315('0x14'));var config=require(_0x8315('0x15'));var licenseUtil=require(_0x8315('0x16'));var db=require(_0x8315('0x17'))['db'];function respondWithStatusCode(_0x3e9b9f,_0x21796d){_0x21796d=_0x21796d||0xcc;return function(_0x53114a){if(_0x53114a){return _0x3e9b9f[_0x8315('0x18')](_0x21796d);}return _0x3e9b9f['status'](_0x21796d)[_0x8315('0x19')]();};}function respondWithResult(_0x1b9ef8,_0x2ec27e){_0x2ec27e=_0x2ec27e||0xc8;return function(_0x3be80c){if(_0x3be80c){return _0x1b9ef8[_0x8315('0x1a')](_0x2ec27e)[_0x8315('0x1b')](_0x3be80c);}};}function respondWithFilteredResult(_0x13a945,_0x5aa8c3){return function(_0x530111){if(_0x530111){var _0x10b6bd=typeof _0x5aa8c3['offset']===_0x8315('0x1c')&&typeof _0x5aa8c3[_0x8315('0x1d')]===_0x8315('0x1c');var _0x35a84d=_0x530111[_0x8315('0x1e')];var _0x419e08=_0x10b6bd?0x0:_0x5aa8c3[_0x8315('0x1f')];var _0x537636=_0x10b6bd?_0x530111['count']:_0x5aa8c3[_0x8315('0x1f')]+_0x5aa8c3['limit'];var _0x39d7a5;if(_0x537636>=_0x35a84d){_0x537636=_0x35a84d;_0x39d7a5=0xc8;}else{_0x39d7a5=0xce;}_0x13a945[_0x8315('0x1a')](_0x39d7a5);return _0x13a945[_0x8315('0x20')](_0x8315('0x21'),_0x419e08+'-'+_0x537636+'/'+_0x35a84d)[_0x8315('0x1b')](_0x530111);}return null;};}function patchUpdates(_0x5dec36){return function(_0x58bd7e){try{jsonpatch[_0x8315('0x22')](_0x58bd7e,_0x5dec36,!![]);}catch(_0x304462){return BPromise[_0x8315('0x23')](_0x304462);}return _0x58bd7e['save']();};}function saveUpdates(_0x580321,_0x1c99ac){return function(_0x3b9e9c){if(_0x3b9e9c){return _0x3b9e9c[_0x8315('0x24')](_0x580321)[_0x8315('0x25')](function(_0x4eeb39){return _0x4eeb39;});}return null;};}function removeEntity(_0x4eb6d9,_0x4be786){return function(_0x11ef45){if(_0x11ef45){return _0x11ef45[_0x8315('0x26')]()[_0x8315('0x25')](function(){_0x4eb6d9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x50dcf7,_0x36cdc0){return function(_0x3c1346){if(!_0x3c1346){_0x50dcf7[_0x8315('0x18')](0x194);}return _0x3c1346;};}function handleError(_0x49d9a8,_0x415773){_0x415773=_0x415773||0x1f4;return function(_0x33ad82){logger[_0x8315('0x27')](_0x33ad82[_0x8315('0x28')]);if(_0x33ad82['name']){delete _0x33ad82[_0x8315('0x29')];}_0x49d9a8[_0x8315('0x1a')](_0x415773)[_0x8315('0x2a')](_0x33ad82);};}exports['index']=function(_0x2bb025,_0x26acb3){var _0x486695={},_0x5eb0a1={},_0x2148b1={'count':0x0,'rows':[]};var _0x225f09=_[_0x8315('0x2b')](db['SquareRecording'][_0x8315('0x2c')],function(_0x50f32c){return{'name':_0x50f32c[_0x8315('0x2d')],'type':_0x50f32c[_0x8315('0x2e')][_0x8315('0x2f')]};});_0x5eb0a1[_0x8315('0x30')]=_[_0x8315('0x2b')](_0x225f09,_0x8315('0x29'));_0x5eb0a1[_0x8315('0x31')]=_[_0x8315('0x32')](_0x2bb025['query']);_0x5eb0a1[_0x8315('0x33')]=_['intersection'](_0x5eb0a1[_0x8315('0x30')],_0x5eb0a1[_0x8315('0x31')]);_0x486695[_0x8315('0x34')]=_[_0x8315('0x35')](_0x5eb0a1[_0x8315('0x30')],qs[_0x8315('0x36')](_0x2bb025[_0x8315('0x31')][_0x8315('0x36')]));_0x486695[_0x8315('0x34')]=_0x486695['attributes'][_0x8315('0x37')]?_0x486695[_0x8315('0x34')]:_0x5eb0a1[_0x8315('0x30')];if(!_0x2bb025[_0x8315('0x31')][_0x8315('0x38')](_0x8315('0x39'))){_0x486695[_0x8315('0x1d')]=qs[_0x8315('0x1d')](_0x2bb025['query']['limit']);_0x486695[_0x8315('0x1f')]=qs[_0x8315('0x1f')](_0x2bb025[_0x8315('0x31')][_0x8315('0x1f')]);}_0x486695[_0x8315('0x3a')]=qs[_0x8315('0x3b')](_0x2bb025['query']['sort']);_0x486695[_0x8315('0x3c')]=qs[_0x8315('0x33')](_[_0x8315('0x3d')](_0x2bb025[_0x8315('0x31')],_0x5eb0a1[_0x8315('0x33')]),_0x225f09);if(_0x2bb025['query']['filter']){_0x486695[_0x8315('0x3c')]=_[_0x8315('0x3e')](_0x486695[_0x8315('0x3c')],{'$or':_[_0x8315('0x2b')](_0x225f09,function(_0x1dc8bf){if(_0x1dc8bf['type']!==_0x8315('0x3f')){var _0x35f1d6={};_0x35f1d6[_0x1dc8bf[_0x8315('0x29')]]={'$like':'%'+_0x2bb025['query']['filter']+'%'};return _0x35f1d6;}})});}_0x486695=_[_0x8315('0x3e')]({},_0x486695,_0x2bb025[_0x8315('0x40')]);var _0x1175ae={'where':_0x486695['where']};return db[_0x8315('0x41')][_0x8315('0x1e')](_0x1175ae)['then'](function(_0x851d25){_0x2148b1['count']=_0x851d25;if(_0x2bb025[_0x8315('0x31')][_0x8315('0x42')]){_0x486695[_0x8315('0x43')]=[{'all':!![]}];}return db['SquareRecording'][_0x8315('0x44')](_0x486695);})['then'](function(_0x1a8ca6){_0x2148b1[_0x8315('0x45')]=_0x1a8ca6;return _0x2148b1;})[_0x8315('0x25')](respondWithFilteredResult(_0x26acb3,_0x486695))[_0x8315('0x46')](handleError(_0x26acb3,null));};exports[_0x8315('0x47')]=function(_0x201634,_0x2b7ef8){var _0x1d3df7={'raw':!![],'where':{'id':_0x201634['params']['id']}},_0x30b39d={};_0x30b39d[_0x8315('0x30')]=_['keys'](db['SquareRecording'][_0x8315('0x2c')]);_0x30b39d['query']=_[_0x8315('0x32')](_0x201634['query']);_0x30b39d[_0x8315('0x33')]=_[_0x8315('0x35')](_0x30b39d[_0x8315('0x30')],_0x30b39d['query']);_0x1d3df7[_0x8315('0x34')]=_[_0x8315('0x35')](_0x30b39d[_0x8315('0x30')],qs[_0x8315('0x36')](_0x201634[_0x8315('0x31')][_0x8315('0x36')]));_0x1d3df7[_0x8315('0x34')]=_0x1d3df7[_0x8315('0x34')]['length']?_0x1d3df7[_0x8315('0x34')]:_0x30b39d[_0x8315('0x30')];if(_0x201634[_0x8315('0x31')][_0x8315('0x42')]){_0x1d3df7[_0x8315('0x43')]=[{'all':!![]}];}_0x1d3df7=_[_0x8315('0x3e')]({},_0x1d3df7,_0x201634[_0x8315('0x40')]);return db['SquareRecording'][_0x8315('0x48')](_0x1d3df7)[_0x8315('0x25')](handleEntityNotFound(_0x2b7ef8,null))['then'](respondWithResult(_0x2b7ef8,null))[_0x8315('0x46')](handleError(_0x2b7ef8,null));};exports['create']=function(_0x314ae4,_0x1b05c3){return db[_0x8315('0x41')][_0x8315('0x49')](_0x314ae4['body'],{})[_0x8315('0x25')](respondWithResult(_0x1b05c3,0xc9))['catch'](handleError(_0x1b05c3,null));};exports['update']=function(_0x21cd38,_0x54d507){if(_0x21cd38[_0x8315('0x4a')]['id']){delete _0x21cd38[_0x8315('0x4a')]['id'];}return db[_0x8315('0x41')][_0x8315('0x48')]({'where':{'id':_0x21cd38[_0x8315('0x4b')]['id']}})['then'](handleEntityNotFound(_0x54d507,null))['then'](saveUpdates(_0x21cd38[_0x8315('0x4a')],null))['then'](respondWithResult(_0x54d507,null))[_0x8315('0x46')](handleError(_0x54d507,null));};exports[_0x8315('0x4c')]=function(_0x451fc2,_0x1231f4,_0x5ae4ef){var _0x350ba3=require(_0x8315('0x4d'));var _0x47b34d=![];var _0x38d5fd={};if(_0x451fc2['query'][_0x8315('0x2e')]&&_0x451fc2[_0x8315('0x31')]['type']===_0x8315('0x4e')){_0x38d5fd[_0x8315('0x4e')]=_0x451fc2['params']['id'];}else{_0x38d5fd['id']=_0x451fc2[_0x8315('0x4b')]['id'];}return db[_0x8315('0x41')][_0x8315('0x48')]({'where':_0x38d5fd,'attributes':['id',_0x8315('0x4f'),_0x8315('0x50')],'raw':!![]})[_0x8315('0x25')](handleEntityNotFound(_0x1231f4,null))[_0x8315('0x25')](function(_0x53d955){if(_0x53d955){var _0x530114=_0x53d955[_0x8315('0x4f')];var _0x2b464d=util[_0x8315('0x51')]('%s.cypher',_0x530114);if(fs[_0x8315('0x52')](_0x2b464d)){_0x47b34d=!![];return _0x350ba3['decryptFile'](_0x2b464d,_0x530114,config[_0x8315('0x53')]['recording'])[_0x8315('0x25')](function(){return _0x53d955;});}return _0x53d955;}})['then'](function(_0x1263ba){if(_0x1263ba){var _0x439098=_0x1263ba[_0x8315('0x4f')];if(!fs['existsSync'](_0x439098)){throw new db['Sequelize'][(_0x8315('0x54'))](_0x8315('0x55'));}if(_0x1263ba[_0x8315('0x50')]){return _0x1231f4['download'](_0x439098,_0x1263ba[_0x8315('0x50')]+path['extname'](_0x439098),function(){if(_0x47b34d){fs[_0x8315('0x56')](_0x439098);}});}else{return _0x1231f4[_0x8315('0x4c')](_0x439098,function(_0x70f4bf){if(_0x47b34d){fs['unlink'](_0x439098);}});}}})[_0x8315('0x46')](function(_0x3f09bd){if(_0x3f09bd[_0x8315('0x57')]===_0x8315('0x55')){_0x1231f4['status'](0x194)[_0x8315('0x2a')](_0x8315('0x58'));}else{return handleError(_0x1231f4,null);}});};exports[_0x8315('0x26')]=function(_0x363f38,_0x5c978d){return db[_0x8315('0x41')]['find']({'where':{'id':_0x363f38[_0x8315('0x4b')]['id']}})[_0x8315('0x25')](function(_0x7b9652){if(_['isNil'](_0x7b9652)){throw new ReferenceError(_0x8315('0x59'));}return _0x7b9652;})[_0x8315('0x25')](function(_0x395c0e){var _0x5f3240=_0x395c0e[_0x8315('0x4f')];logger[_0x8315('0x5a')](_0x8315('0x5b'),_0x5f3240);if(!_['isNil'](_0x395c0e[_0x8315('0x4f')])&&fs[_0x8315('0x52')](_0x5f3240)){logger['info']('File:\x20\x22'+_0x5f3240+_0x8315('0x5c'));fs[_0x8315('0x5d')](_0x5f3240);}_0x5f3240=_0x5f3240+_0x8315('0x5e');if(!_['isNil'](_0x395c0e[_0x8315('0x4f')])&&fs['existsSync'](_0x5f3240)){logger[_0x8315('0x5a')]('File:\x20\x22'+_0x5f3240+_0x8315('0x5c'));fs[_0x8315('0x5d')](_0x5f3240);}return _0x395c0e;})['then'](function(_0x5a35b1){if(!_0x5a35b1)throw new InternalError();return _0x5a35b1['destroy']();})[_0x8315('0x25')](function(){_0x5c978d['status'](0xcc)[_0x8315('0x19')]();})['catch'](handleError(_0x5c978d,null));}; \ No newline at end of file +var _0x6f04=['where','pick','type','VIRTUAL','filter','merge','options','SquareRecording','include','findAll','catch','show','params','create','body','find','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','download','extname','unlink','SquareRecording\x20not\x20found','destroy','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','json','apply','reject','save','update','then','error','stack','name','send','index','rawAttributes','fieldName','keys','filters','intersection','query','attributes','model','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x3601f4,_0xae6a3e){var _0x20e0bd=function(_0x2fa453){while(--_0x2fa453){_0x3601f4['push'](_0x3601f4['shift']());}};_0x20e0bd(++_0xae6a3e);}(_0x6f04,0x86));var _0x46f0=function(_0x4b2715,_0x14a31c){_0x4b2715=_0x4b2715-0x0;var _0x20f62a=_0x6f04[_0x4b2715];return _0x20f62a;};'use strict';var emlformat=require(_0x46f0('0x0'));var rimraf=require(_0x46f0('0x1'));var zipdir=require(_0x46f0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x46f0('0x3'));var moment=require(_0x46f0('0x4'));var BPromise=require(_0x46f0('0x5'));var Mustache=require('mustache');var util=require(_0x46f0('0x6'));var path=require(_0x46f0('0x7'));var sox=require('sox');var csv=require(_0x46f0('0x8'));var ejs=require(_0x46f0('0x9'));var fs=require('fs');var fs_extra=require(_0x46f0('0xa'));var _=require(_0x46f0('0xb'));var squel=require(_0x46f0('0xc'));var crypto=require(_0x46f0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x46f0('0xe'));var toCsv=require(_0x46f0('0x8'));var querystring=require(_0x46f0('0xf'));var Papa=require(_0x46f0('0x10'));var Redis=require(_0x46f0('0x11'));var authService=require(_0x46f0('0x12'));var qs=require(_0x46f0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x46f0('0x14'));var logger=require(_0x46f0('0x15'))(_0x46f0('0x16'));var utils=require(_0x46f0('0x17'));var config=require(_0x46f0('0x18'));var licenseUtil=require(_0x46f0('0x19'));var db=require(_0x46f0('0x1a'))['db'];function respondWithStatusCode(_0x211cad,_0x52c80f){_0x52c80f=_0x52c80f||0xcc;return function(_0xfd9272){if(_0xfd9272){return _0x211cad[_0x46f0('0x1b')](_0x52c80f);}return _0x211cad[_0x46f0('0x1c')](_0x52c80f)[_0x46f0('0x1d')]();};}function respondWithResult(_0x51f885,_0x39269f){_0x39269f=_0x39269f||0xc8;return function(_0x1cd92d){if(_0x1cd92d){return _0x51f885[_0x46f0('0x1c')](_0x39269f)['json'](_0x1cd92d);}};}function respondWithFilteredResult(_0x5b06b5,_0x1bf070){return function(_0x25ab4e){if(_0x25ab4e){var _0xde1b08=typeof _0x1bf070[_0x46f0('0x1e')]==='undefined'&&typeof _0x1bf070['limit']===_0x46f0('0x1f');var _0x4be243=_0x25ab4e[_0x46f0('0x20')];var _0x1bc2a9=_0xde1b08?0x0:_0x1bf070[_0x46f0('0x1e')];var _0x4cc9f0=_0xde1b08?_0x25ab4e[_0x46f0('0x20')]:_0x1bf070[_0x46f0('0x1e')]+_0x1bf070[_0x46f0('0x21')];var _0x444351;if(_0x4cc9f0>=_0x4be243){_0x4cc9f0=_0x4be243;_0x444351=0xc8;}else{_0x444351=0xce;}_0x5b06b5[_0x46f0('0x1c')](_0x444351);return _0x5b06b5['set']('Content-Range',_0x1bc2a9+'-'+_0x4cc9f0+'/'+_0x4be243)[_0x46f0('0x22')](_0x25ab4e);}return null;};}function patchUpdates(_0xa0a7cd){return function(_0x10db65){try{jsonpatch[_0x46f0('0x23')](_0x10db65,_0xa0a7cd,!![]);}catch(_0x4fcf41){return BPromise[_0x46f0('0x24')](_0x4fcf41);}return _0x10db65[_0x46f0('0x25')]();};}function saveUpdates(_0xe9a2c3,_0x46d79a){return function(_0x51a5f4){if(_0x51a5f4){return _0x51a5f4[_0x46f0('0x26')](_0xe9a2c3)[_0x46f0('0x27')](function(_0x5152fe){return _0x5152fe;});}return null;};}function removeEntity(_0xeb8784,_0x83f784){return function(_0x51ec57){if(_0x51ec57){return _0x51ec57['destroy']()['then'](function(){_0xeb8784[_0x46f0('0x1c')](0xcc)[_0x46f0('0x1d')]();});}};}function handleEntityNotFound(_0x1cd7fc,_0x247ab6){return function(_0x1d8013){if(!_0x1d8013){_0x1cd7fc['sendStatus'](0x194);}return _0x1d8013;};}function handleError(_0x2e9c12,_0x27c164){_0x27c164=_0x27c164||0x1f4;return function(_0x5ee058){logger[_0x46f0('0x28')](_0x5ee058[_0x46f0('0x29')]);if(_0x5ee058[_0x46f0('0x2a')]){delete _0x5ee058[_0x46f0('0x2a')];}_0x2e9c12['status'](_0x27c164)[_0x46f0('0x2b')](_0x5ee058);};}exports[_0x46f0('0x2c')]=function(_0x463edc,_0x3a0f16){var _0x22c3b4={},_0x2dd672={},_0x50961a={'count':0x0,'rows':[]};var _0x53ee22=_['map'](db['SquareRecording'][_0x46f0('0x2d')],function(_0x5d36df){return{'name':_0x5d36df[_0x46f0('0x2e')],'type':_0x5d36df['type']['key']};});_0x2dd672['model']=_['map'](_0x53ee22,_0x46f0('0x2a'));_0x2dd672['query']=_[_0x46f0('0x2f')](_0x463edc['query']);_0x2dd672[_0x46f0('0x30')]=_[_0x46f0('0x31')](_0x2dd672['model'],_0x2dd672[_0x46f0('0x32')]);_0x22c3b4[_0x46f0('0x33')]=_[_0x46f0('0x31')](_0x2dd672[_0x46f0('0x34')],qs[_0x46f0('0x35')](_0x463edc['query'][_0x46f0('0x35')]));_0x22c3b4[_0x46f0('0x33')]=_0x22c3b4[_0x46f0('0x33')]['length']?_0x22c3b4['attributes']:_0x2dd672['model'];if(!_0x463edc[_0x46f0('0x32')][_0x46f0('0x36')](_0x46f0('0x37'))){_0x22c3b4[_0x46f0('0x21')]=qs[_0x46f0('0x21')](_0x463edc[_0x46f0('0x32')][_0x46f0('0x21')]);_0x22c3b4[_0x46f0('0x1e')]=qs[_0x46f0('0x1e')](_0x463edc[_0x46f0('0x32')][_0x46f0('0x1e')]);}_0x22c3b4[_0x46f0('0x38')]=qs[_0x46f0('0x39')](_0x463edc[_0x46f0('0x32')][_0x46f0('0x39')]);_0x22c3b4[_0x46f0('0x3a')]=qs[_0x46f0('0x30')](_[_0x46f0('0x3b')](_0x463edc[_0x46f0('0x32')],_0x2dd672[_0x46f0('0x30')]),_0x53ee22);if(_0x463edc['query']['filter']){_0x22c3b4['where']=_['merge'](_0x22c3b4[_0x46f0('0x3a')],{'$or':_['map'](_0x53ee22,function(_0x48e6b4){if(_0x48e6b4[_0x46f0('0x3c')]!==_0x46f0('0x3d')){var _0x4c0f49={};_0x4c0f49[_0x48e6b4[_0x46f0('0x2a')]]={'$like':'%'+_0x463edc['query'][_0x46f0('0x3e')]+'%'};return _0x4c0f49;}})});}_0x22c3b4=_[_0x46f0('0x3f')]({},_0x22c3b4,_0x463edc[_0x46f0('0x40')]);var _0x505c34={'where':_0x22c3b4[_0x46f0('0x3a')]};return db[_0x46f0('0x41')][_0x46f0('0x20')](_0x505c34)[_0x46f0('0x27')](function(_0x2eb261){_0x50961a[_0x46f0('0x20')]=_0x2eb261;if(_0x463edc[_0x46f0('0x32')]['includeAll']){_0x22c3b4[_0x46f0('0x42')]=[{'all':!![]}];}return db[_0x46f0('0x41')][_0x46f0('0x43')](_0x22c3b4);})['then'](function(_0x54c203){_0x50961a['rows']=_0x54c203;return _0x50961a;})['then'](respondWithFilteredResult(_0x3a0f16,_0x22c3b4))[_0x46f0('0x44')](handleError(_0x3a0f16,null));};exports[_0x46f0('0x45')]=function(_0x1a9996,_0x5184f8){var _0x2e0e53={'raw':!![],'where':{'id':_0x1a9996[_0x46f0('0x46')]['id']}},_0x1c5426={};_0x1c5426[_0x46f0('0x34')]=_[_0x46f0('0x2f')](db[_0x46f0('0x41')][_0x46f0('0x2d')]);_0x1c5426['query']=_[_0x46f0('0x2f')](_0x1a9996[_0x46f0('0x32')]);_0x1c5426[_0x46f0('0x30')]=_['intersection'](_0x1c5426[_0x46f0('0x34')],_0x1c5426[_0x46f0('0x32')]);_0x2e0e53[_0x46f0('0x33')]=_[_0x46f0('0x31')](_0x1c5426[_0x46f0('0x34')],qs['fields'](_0x1a9996['query'][_0x46f0('0x35')]));_0x2e0e53[_0x46f0('0x33')]=_0x2e0e53[_0x46f0('0x33')]['length']?_0x2e0e53[_0x46f0('0x33')]:_0x1c5426[_0x46f0('0x34')];if(_0x1a9996[_0x46f0('0x32')]['includeAll']){_0x2e0e53[_0x46f0('0x42')]=[{'all':!![]}];}_0x2e0e53=_[_0x46f0('0x3f')]({},_0x2e0e53,_0x1a9996['options']);return db[_0x46f0('0x41')]['find'](_0x2e0e53)[_0x46f0('0x27')](handleEntityNotFound(_0x5184f8,null))[_0x46f0('0x27')](respondWithResult(_0x5184f8,null))['catch'](handleError(_0x5184f8,null));};exports[_0x46f0('0x47')]=function(_0x24c8f0,_0x462f41){return db[_0x46f0('0x41')][_0x46f0('0x47')](_0x24c8f0[_0x46f0('0x48')],{})[_0x46f0('0x27')](respondWithResult(_0x462f41,0xc9))[_0x46f0('0x44')](handleError(_0x462f41,null));};exports[_0x46f0('0x26')]=function(_0x1f04f1,_0x5c0a2b){if(_0x1f04f1[_0x46f0('0x48')]['id']){delete _0x1f04f1[_0x46f0('0x48')]['id'];}return db[_0x46f0('0x41')][_0x46f0('0x49')]({'where':{'id':_0x1f04f1[_0x46f0('0x46')]['id']}})[_0x46f0('0x27')](handleEntityNotFound(_0x5c0a2b,null))[_0x46f0('0x27')](saveUpdates(_0x1f04f1[_0x46f0('0x48')],null))[_0x46f0('0x27')](respondWithResult(_0x5c0a2b,null))[_0x46f0('0x44')](handleError(_0x5c0a2b,null));};exports['download']=function(_0x47eec5,_0x475aa7,_0x117a2a){var _0x2e6f14=require(_0x46f0('0x4a'));var _0x1c1f18=![];var _0x2a2e92={};if(_0x47eec5['query']['type']&&_0x47eec5[_0x46f0('0x32')][_0x46f0('0x3c')]===_0x46f0('0x4b')){_0x2a2e92[_0x46f0('0x4b')]=_0x47eec5['params']['id'];}else{_0x2a2e92['id']=_0x47eec5[_0x46f0('0x46')]['id'];}return db['SquareRecording'][_0x46f0('0x49')]({'where':_0x2a2e92,'attributes':['id',_0x46f0('0x4c'),_0x46f0('0x4d')],'raw':!![]})[_0x46f0('0x27')](handleEntityNotFound(_0x475aa7,null))[_0x46f0('0x27')](function(_0x39d4f8){if(_0x39d4f8){var _0x3a57a2=_0x39d4f8[_0x46f0('0x4c')];var _0x591f25=util[_0x46f0('0x4e')](_0x46f0('0x4f'),_0x3a57a2);if(fs[_0x46f0('0x50')](_0x591f25)){_0x1c1f18=!![];return _0x2e6f14[_0x46f0('0x51')](_0x591f25,_0x3a57a2,config[_0x46f0('0x52')][_0x46f0('0x53')])[_0x46f0('0x27')](function(){return _0x39d4f8;});}return _0x39d4f8;}})[_0x46f0('0x27')](function(_0x515ea8){if(_0x515ea8){var _0x31534c=_0x515ea8['savePath'];if(!fs[_0x46f0('0x50')](_0x31534c)){throw new db[(_0x46f0('0x54'))][(_0x46f0('0x55'))]('SquareRecording\x20not\x20found');}if(_0x515ea8[_0x46f0('0x4d')]){return _0x475aa7[_0x46f0('0x56')](_0x31534c,_0x515ea8[_0x46f0('0x4d')]+path[_0x46f0('0x57')](_0x31534c),function(){if(_0x1c1f18){fs[_0x46f0('0x58')](_0x31534c);}});}else{return _0x475aa7[_0x46f0('0x56')](_0x31534c,function(_0x320bf2){if(_0x1c1f18){fs[_0x46f0('0x58')](_0x31534c);}});}}})['catch'](function(_0x247fbb){if(_0x247fbb['message']===_0x46f0('0x59')){_0x475aa7['status'](0x194)['send']('Not\x20found');}else{return handleError(_0x475aa7,null);}});};exports[_0x46f0('0x5a')]=function(_0x4540f0,_0x37251f){return db[_0x46f0('0x41')][_0x46f0('0x49')]({'where':{'id':_0x4540f0[_0x46f0('0x46')]['id']}})[_0x46f0('0x27')](function(_0x1b4bd4){if(_['isNil'](_0x1b4bd4)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1b4bd4;})['then'](function(_0x480dec){var _0x492533=_0x480dec[_0x46f0('0x4c')];logger[_0x46f0('0x5b')](_0x46f0('0x5c'),_0x492533);if(!_[_0x46f0('0x5d')](_0x480dec[_0x46f0('0x4c')])&&fs[_0x46f0('0x50')](_0x492533)){logger[_0x46f0('0x5b')]('File:\x20\x22'+_0x492533+_0x46f0('0x5e'));fs['unlinkSync'](_0x492533);}_0x492533=_0x492533+'.cypher';if(!_[_0x46f0('0x5d')](_0x480dec['savePath'])&&fs[_0x46f0('0x50')](_0x492533)){logger[_0x46f0('0x5b')]('File:\x20\x22'+_0x492533+_0x46f0('0x5e'));fs[_0x46f0('0x5f')](_0x492533);}return _0x480dec;})[_0x46f0('0x27')](function(_0x581ec6){if(!_0x581ec6)throw new InternalError();return _0x581ec6[_0x46f0('0x5a')]();})[_0x46f0('0x27')](function(){_0x37251f[_0x46f0('0x1c')](0xcc)['end']();})[_0x46f0('0x44')](handleError(_0x37251f,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index d2cbc5b..5d7a01c 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 _0x5d0a=['square_recordings','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording'];(function(_0x360e5b,_0x2f5b){var _0x48c8b2=function(_0x10d63d){while(--_0x10d63d){_0x360e5b['push'](_0x360e5b['shift']());}};_0x48c8b2(++_0x2f5b);}(_0x5d0a,0x175));var _0xa5d0=function(_0x4e7a04,_0x1fc549){_0x4e7a04=_0x4e7a04-0x0;var _0x143390=_0x5d0a[_0x4e7a04];return _0x143390;};'use strict';var _=require(_0xa5d0('0x0'));var util=require('util');var logger=require(_0xa5d0('0x1'))('api');var moment=require(_0xa5d0('0x2'));var BPromise=require(_0xa5d0('0x3'));var rp=require(_0xa5d0('0x4'));var fs=require('fs');var path=require(_0xa5d0('0x5'));var rimraf=require('rimraf');var config=require(_0xa5d0('0x6'));var attributes=require(_0xa5d0('0x7'));module[_0xa5d0('0x8')]=function(_0x1e90c4,_0x406289){return _0x1e90c4[_0xa5d0('0x9')](_0xa5d0('0xa'),attributes,{'tableName':_0xa5d0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a85=['moment','path','rimraf','../../config/environment','exports','SquareRecording','square_recordings','../../config/logger','api'];(function(_0xf7cdef,_0x37fda7){var _0x288920=function(_0x2d5a3e){while(--_0x2d5a3e){_0xf7cdef['push'](_0xf7cdef['shift']());}};_0x288920(++_0x37fda7);}(_0x1a85,0x178));var _0x51a8=function(_0x39cff5,_0x234f0c){_0x39cff5=_0x39cff5-0x0;var _0x430437=_0x1a85[_0x39cff5];return _0x430437;};'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('./squareRecording.attributes');module[_0x51a8('0x6')]=function(_0x4b76a8,_0x2c1180){return _0x4b76a8['define'](_0x51a8('0x7'),attributes,{'tableName':_0x51a8('0x8'),'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 9294b86..f9b3b25 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 _0x0b90=['message','result','CreateSquareRecording','body','options','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x48cc04,_0x37efcb){var _0x9b4bf2=function(_0x469293){while(--_0x469293){_0x48cc04['push'](_0x48cc04['shift']());}};_0x9b4bf2(++_0x37efcb);}(_0x0b90,0x12f));var _0x00b9=function(_0x59d4e8,_0x152d1b){_0x59d4e8=_0x59d4e8-0x0;var _0x4b4387=_0x0b90[_0x59d4e8];return _0x4b4387;};'use strict';var _=require(_0x00b9('0x0'));var util=require(_0x00b9('0x1'));var moment=require(_0x00b9('0x2'));var BPromise=require('bluebird');var rs=require(_0x00b9('0x3'));var fs=require('fs');var Redis=require(_0x00b9('0x4'));var db=require(_0x00b9('0x5'))['db'];var utils=require(_0x00b9('0x6'));var logger=require(_0x00b9('0x7'))(_0x00b9('0x8'));var config=require(_0x00b9('0x9'));var jayson=require(_0x00b9('0xa'));var client=jayson[_0x00b9('0xb')][_0x00b9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x410eca,_0x41832b,_0xe57a90){return new BPromise(function(_0x5a38ae,_0x35b891){return client[_0x00b9('0xd')](_0x410eca,_0xe57a90)[_0x00b9('0xe')](function(_0x390352){logger[_0x00b9('0xf')](_0x00b9('0x10'),_0x41832b,_0x00b9('0x11'));logger['debug']('SquareRecording,\x20%s,\x20%s,\x20%s',_0x41832b,'request\x20sent',JSON[_0x00b9('0x12')](_0x390352));if(_0x390352[_0x00b9('0x13')]){if(_0x390352[_0x00b9('0x13')][_0x00b9('0x14')]===0x1f4){logger[_0x00b9('0x13')](_0x00b9('0x10'),_0x41832b,_0x390352[_0x00b9('0x13')][_0x00b9('0x15')]);return _0x35b891(_0x390352[_0x00b9('0x13')][_0x00b9('0x15')]);}logger[_0x00b9('0x13')](_0x00b9('0x10'),_0x41832b,_0x390352['error'][_0x00b9('0x15')]);return _0x5a38ae(_0x390352[_0x00b9('0x13')][_0x00b9('0x15')]);}else{logger[_0x00b9('0xf')](_0x00b9('0x10'),_0x41832b,_0x00b9('0x11'));_0x5a38ae(_0x390352[_0x00b9('0x16')][_0x00b9('0x15')]);}})['catch'](function(_0x54e04c){logger[_0x00b9('0x13')](_0x00b9('0x10'),_0x41832b,_0x54e04c);_0x35b891(_0x54e04c);});});}exports[_0x00b9('0x17')]=function(_0x3259ec){var _0x16b482=this;return new Promise(function(_0x1e54b7,_0x25d8ca){return db['SquareRecording']['create'](_0x3259ec[_0x00b9('0x18')],{'raw':_0x3259ec[_0x00b9('0x19')]?_0x3259ec[_0x00b9('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x00b9('0xe')](function(_0xfe6f56){logger[_0x00b9('0xf')](_0x00b9('0x17'),_0x3259ec);logger[_0x00b9('0x1a')](_0x00b9('0x17'),_0x3259ec,JSON[_0x00b9('0x12')](_0xfe6f56));_0x1e54b7(_0xfe6f56);})['catch'](function(_0x55aa1e){logger[_0x00b9('0x13')](_0x00b9('0x17'),_0x55aa1e[_0x00b9('0x15')],_0x3259ec);_0x25d8ca(_0x16b482[_0x00b9('0x13')](0x1f4,_0x55aa1e['message']));});});}; \ No newline at end of file +var _0xe2a4=['debug','request\x20sent','stringify','error','code','message','CreateSquareRecording','SquareRecording','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s'];(function(_0x5a488c,_0x4cc470){var _0x53a7d6=function(_0x43a0d8){while(--_0x43a0d8){_0x5a488c['push'](_0x5a488c['shift']());}};_0x53a7d6(++_0x4cc470);}(_0xe2a4,0xd0));var _0x4e2a=function(_0x4d0662,_0x145963){_0x4d0662=_0x4d0662-0x0;var _0x6eea6d=_0xe2a4[_0x4d0662];return _0x6eea6d;};'use strict';var _=require(_0x4e2a('0x0'));var util=require(_0x4e2a('0x1'));var moment=require(_0x4e2a('0x2'));var BPromise=require(_0x4e2a('0x3'));var rs=require(_0x4e2a('0x4'));var fs=require('fs');var Redis=require(_0x4e2a('0x5'));var db=require(_0x4e2a('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4e2a('0x7'));var config=require(_0x4e2a('0x8'));var jayson=require(_0x4e2a('0x9'));var client=jayson[_0x4e2a('0xa')][_0x4e2a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x43a9dc,_0xe3eb,_0x24e9da){return new BPromise(function(_0xfa61a8,_0x43792b){return client[_0x4e2a('0xc')](_0x43a9dc,_0x24e9da)[_0x4e2a('0xd')](function(_0x3e9dee){logger[_0x4e2a('0xe')](_0x4e2a('0xf'),_0xe3eb,'request\x20sent');logger[_0x4e2a('0x10')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0xe3eb,_0x4e2a('0x11'),JSON[_0x4e2a('0x12')](_0x3e9dee));if(_0x3e9dee['error']){if(_0x3e9dee[_0x4e2a('0x13')][_0x4e2a('0x14')]===0x1f4){logger[_0x4e2a('0x13')](_0x4e2a('0xf'),_0xe3eb,_0x3e9dee['error'][_0x4e2a('0x15')]);return _0x43792b(_0x3e9dee[_0x4e2a('0x13')][_0x4e2a('0x15')]);}logger[_0x4e2a('0x13')](_0x4e2a('0xf'),_0xe3eb,_0x3e9dee[_0x4e2a('0x13')][_0x4e2a('0x15')]);return _0xfa61a8(_0x3e9dee[_0x4e2a('0x13')][_0x4e2a('0x15')]);}else{logger[_0x4e2a('0xe')]('SquareRecording,\x20%s,\x20%s',_0xe3eb,'request\x20sent');_0xfa61a8(_0x3e9dee['result'][_0x4e2a('0x15')]);}})['catch'](function(_0x1d7066){logger['error']('SquareRecording,\x20%s,\x20%s',_0xe3eb,_0x1d7066);_0x43792b(_0x1d7066);});});}exports[_0x4e2a('0x16')]=function(_0x1ac3e8){var _0x1f817b=this;return new Promise(function(_0x532faa,_0x391319){return db[_0x4e2a('0x17')][_0x4e2a('0x18')](_0x1ac3e8[_0x4e2a('0x19')],{'raw':_0x1ac3e8[_0x4e2a('0x1a')]?_0x1ac3e8[_0x4e2a('0x1a')][_0x4e2a('0x1b')]===undefined?!![]:![]:!![]})[_0x4e2a('0xd')](function(_0x477cee){logger['info'](_0x4e2a('0x16'),_0x1ac3e8);logger[_0x4e2a('0x10')](_0x4e2a('0x16'),_0x1ac3e8,JSON['stringify'](_0x477cee));_0x532faa(_0x477cee);})['catch'](function(_0x142ef3){logger['error'](_0x4e2a('0x16'),_0x142ef3[_0x4e2a('0x15')],_0x1ac3e8);_0x391319(_0x1f817b[_0x4e2a('0x13')](0x1f4,_0x142ef3['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 9ebe911..7a28207 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(_0x18f55c,_0x1aa78a){var _0x2e8c09=function(_0xdd4dc3){while(--_0xdd4dc3){_0x18f55c['push'](_0x18f55c['shift']());}};_0x2e8c09(++_0x1aa78a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x1a1650,_0x22908e){var _0x560d6b=function(_0x199b6b){while(--_0x199b6b){_0x1a1650['push'](_0x1a1650['shift']());}};_0x560d6b(++_0x22908e);}(_0xe706,0xa3));var _0x6e70=function(_0x35bd6c,_0x585087){_0x35bd6c=_0x35bd6c-0x0;var _0x2f421d=_0xe706[_0x35bd6c];return _0x2f421d;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index e069bbe..bac5dfc 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 _0xf2d0=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x1f75f6,_0x3654e1){var _0x5c06c1=function(_0x21b3ba){while(--_0x21b3ba){_0x1f75f6['push'](_0x1f75f6['shift']());}};_0x5c06c1(++_0x3654e1);}(_0xf2d0,0x8a));var _0x0f2d=function(_0x5ae94e,_0x3e1933){_0x5ae94e=_0x5ae94e-0x0;var _0x37680a=_0xf2d0[_0x5ae94e];return _0x37680a;};'use strict';var Sequelize=require(_0x0f2d('0x0'));module[_0x0f2d('0x1')]={'network':{'type':Sequelize[_0x0f2d('0x2')]},'network_script':{'type':Sequelize[_0x0f2d('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x0f2d('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x0f2d('0x2')]},'version':{'type':Sequelize[_0x0f2d('0x2')]},'callerid':{'type':Sequelize[_0x0f2d('0x2')]},'calleridname':{'type':Sequelize[_0x0f2d('0x2')]},'callingpres':{'type':Sequelize[_0x0f2d('0x2')]},'callingani2':{'type':Sequelize[_0x0f2d('0x2')]},'callington':{'type':Sequelize[_0x0f2d('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x0f2d('0x2')]},'context':{'type':Sequelize[_0x0f2d('0x2')]},'extension':{'type':Sequelize[_0x0f2d('0x2')]},'priority':{'type':Sequelize[_0x0f2d('0x2')]},'enhanced':{'type':Sequelize[_0x0f2d('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x0f2d('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x0f2d('0x3')]},'leaveAt':{'type':Sequelize[_0x0f2d('0x3')]},'bot':{'type':Sequelize[_0x0f2d('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x5880=['DATE','sequelize','exports','STRING'];(function(_0x2cd1fb,_0x291f55){var _0x48fd2b=function(_0x18e23e){while(--_0x18e23e){_0x2cd1fb['push'](_0x2cd1fb['shift']());}};_0x48fd2b(++_0x291f55);}(_0x5880,0xcd));var _0x0588=function(_0x28dd4d,_0x548431){_0x28dd4d=_0x28dd4d-0x0;var _0x3aad4c=_0x5880[_0x28dd4d];return _0x3aad4c;};'use strict';var Sequelize=require(_0x0588('0x0'));module[_0x0588('0x1')]={'network':{'type':Sequelize[_0x0588('0x2')]},'network_script':{'type':Sequelize[_0x0588('0x2')]},'request':{'type':Sequelize[_0x0588('0x2')]},'channel':{'type':Sequelize[_0x0588('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x0588('0x2')]},'version':{'type':Sequelize[_0x0588('0x2')]},'callerid':{'type':Sequelize[_0x0588('0x2')]},'calleridname':{'type':Sequelize[_0x0588('0x2')]},'callingpres':{'type':Sequelize[_0x0588('0x2')]},'callingani2':{'type':Sequelize[_0x0588('0x2')]},'callington':{'type':Sequelize[_0x0588('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x0588('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x0588('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x0588('0x2')]},'accountcode':{'type':Sequelize[_0x0588('0x2')]},'threadid':{'type':Sequelize[_0x0588('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x0588('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 1494770..491d31e 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 _0xd5ff=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','SquareReport','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','where','pick','filter','VIRTUAL','merge','includeAll','include','show','params','options','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x211f04,_0x828280){var _0x1eab0d=function(_0x36e9a3){while(--_0x36e9a3){_0x211f04['push'](_0x211f04['shift']());}};_0x1eab0d(++_0x828280);}(_0xd5ff,0x8d));var _0xfd5f=function(_0x432928,_0x5b227f){_0x432928=_0x432928-0x0;var _0x1d199c=_0xd5ff[_0x432928];return _0x1d199c;};'use strict';var emlformat=require(_0xfd5f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfd5f('0x1'));var jsonpatch=require(_0xfd5f('0x2'));var rp=require(_0xfd5f('0x3'));var moment=require(_0xfd5f('0x4'));var BPromise=require(_0xfd5f('0x5'));var Mustache=require(_0xfd5f('0x6'));var util=require(_0xfd5f('0x7'));var path=require(_0xfd5f('0x8'));var sox=require(_0xfd5f('0x9'));var csv=require(_0xfd5f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfd5f('0xb'));var _=require(_0xfd5f('0xc'));var squel=require(_0xfd5f('0xd'));var crypto=require(_0xfd5f('0xe'));var jsforce=require(_0xfd5f('0xf'));var deskjs=require(_0xfd5f('0x10'));var toCsv=require(_0xfd5f('0xa'));var querystring=require(_0xfd5f('0x11'));var Papa=require(_0xfd5f('0x12'));var Redis=require(_0xfd5f('0x13'));var authService=require(_0xfd5f('0x14'));var qs=require(_0xfd5f('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfd5f('0x16'));var logger=require(_0xfd5f('0x17'))(_0xfd5f('0x18'));var utils=require('../../config/utils');var config=require(_0xfd5f('0x19'));var licenseUtil=require(_0xfd5f('0x1a'));var db=require(_0xfd5f('0x1b'))['db'];function respondWithStatusCode(_0x224bd3,_0x3da0c1){_0x3da0c1=_0x3da0c1||0xcc;return function(_0x1890fd){if(_0x1890fd){return _0x224bd3[_0xfd5f('0x1c')](_0x3da0c1);}return _0x224bd3[_0xfd5f('0x1d')](_0x3da0c1)['end']();};}function respondWithResult(_0x5c7813,_0x1e7520){_0x1e7520=_0x1e7520||0xc8;return function(_0x234a68){if(_0x234a68){return _0x5c7813[_0xfd5f('0x1d')](_0x1e7520)['json'](_0x234a68);}};}function respondWithFilteredResult(_0x5c6657,_0x4c1945){return function(_0x2c5f5c){if(_0x2c5f5c){var _0x59ccf5=typeof _0x4c1945[_0xfd5f('0x1e')]===_0xfd5f('0x1f')&&typeof _0x4c1945[_0xfd5f('0x20')]==='undefined';var _0x365f01=_0x2c5f5c[_0xfd5f('0x21')];var _0x23b9c7=_0x59ccf5?0x0:_0x4c1945[_0xfd5f('0x1e')];var _0x3deb8e=_0x59ccf5?_0x2c5f5c['count']:_0x4c1945[_0xfd5f('0x1e')]+_0x4c1945['limit'];var _0x23aa76;if(_0x3deb8e>=_0x365f01){_0x3deb8e=_0x365f01;_0x23aa76=0xc8;}else{_0x23aa76=0xce;}_0x5c6657[_0xfd5f('0x1d')](_0x23aa76);return _0x5c6657['set'](_0xfd5f('0x22'),_0x23b9c7+'-'+_0x3deb8e+'/'+_0x365f01)['json'](_0x2c5f5c);}return null;};}function patchUpdates(_0x9253ff){return function(_0x4654fa){try{jsonpatch[_0xfd5f('0x23')](_0x4654fa,_0x9253ff,!![]);}catch(_0x5111e1){return BPromise[_0xfd5f('0x24')](_0x5111e1);}return _0x4654fa['save']();};}function saveUpdates(_0x3507a8,_0x3badec){return function(_0x2c8439){if(_0x2c8439){return _0x2c8439[_0xfd5f('0x25')](_0x3507a8)[_0xfd5f('0x26')](function(_0x431b50){return _0x431b50;});}return null;};}function removeEntity(_0xd19ecb,_0x569ae1){return function(_0xf2958d){if(_0xf2958d){return _0xf2958d[_0xfd5f('0x27')]()['then'](function(){_0xd19ecb['status'](0xcc)[_0xfd5f('0x28')]();});}};}function handleEntityNotFound(_0x262e25,_0x401356){return function(_0x425f56){if(!_0x425f56){_0x262e25[_0xfd5f('0x1c')](0x194);}return _0x425f56;};}function handleError(_0xa2834a,_0x1fe6e0){_0x1fe6e0=_0x1fe6e0||0x1f4;return function(_0x3fed24){logger[_0xfd5f('0x29')](_0x3fed24[_0xfd5f('0x2a')]);if(_0x3fed24[_0xfd5f('0x2b')]){delete _0x3fed24[_0xfd5f('0x2b')];}_0xa2834a[_0xfd5f('0x1d')](_0x1fe6e0)[_0xfd5f('0x2c')](_0x3fed24);};}exports[_0xfd5f('0x2d')]=function(_0x48a799,_0x6f2882){var _0x1d6ede={},_0x51be15={},_0x119e75={'count':0x0,'rows':[]};var _0x5020c7=_['map'](db[_0xfd5f('0x2e')][_0xfd5f('0x2f')],function(_0xe78319){return{'name':_0xe78319[_0xfd5f('0x30')],'type':_0xe78319[_0xfd5f('0x31')][_0xfd5f('0x32')]};});_0x51be15['model']=_[_0xfd5f('0x33')](_0x5020c7,'name');_0x51be15[_0xfd5f('0x34')]=_[_0xfd5f('0x35')](_0x48a799[_0xfd5f('0x34')]);_0x51be15[_0xfd5f('0x36')]=_['intersection'](_0x51be15[_0xfd5f('0x37')],_0x51be15[_0xfd5f('0x34')]);_0x1d6ede[_0xfd5f('0x38')]=_[_0xfd5f('0x39')](_0x51be15[_0xfd5f('0x37')],qs[_0xfd5f('0x3a')](_0x48a799[_0xfd5f('0x34')]['fields']));_0x1d6ede['attributes']=_0x1d6ede[_0xfd5f('0x38')][_0xfd5f('0x3b')]?_0x1d6ede[_0xfd5f('0x38')]:_0x51be15[_0xfd5f('0x37')];if(!_0x48a799['query']['hasOwnProperty'](_0xfd5f('0x3c'))){_0x1d6ede[_0xfd5f('0x20')]=qs['limit'](_0x48a799['query']['limit']);_0x1d6ede['offset']=qs[_0xfd5f('0x1e')](_0x48a799[_0xfd5f('0x34')]['offset']);}_0x1d6ede[_0xfd5f('0x3d')]=qs['sort'](_0x48a799[_0xfd5f('0x34')]['sort']);_0x1d6ede[_0xfd5f('0x3e')]=qs[_0xfd5f('0x36')](_[_0xfd5f('0x3f')](_0x48a799[_0xfd5f('0x34')],_0x51be15[_0xfd5f('0x36')]),_0x5020c7);if(_0x48a799[_0xfd5f('0x34')][_0xfd5f('0x40')]){_0x1d6ede[_0xfd5f('0x3e')]=_['merge'](_0x1d6ede[_0xfd5f('0x3e')],{'$or':_[_0xfd5f('0x33')](_0x5020c7,function(_0x2f74f4){if(_0x2f74f4[_0xfd5f('0x31')]!==_0xfd5f('0x41')){var _0x10081d={};_0x10081d[_0x2f74f4[_0xfd5f('0x2b')]]={'$like':'%'+_0x48a799['query'][_0xfd5f('0x40')]+'%'};return _0x10081d;}})});}_0x1d6ede=_[_0xfd5f('0x42')]({},_0x1d6ede,_0x48a799['options']);var _0x2963e6={'where':_0x1d6ede[_0xfd5f('0x3e')]};return db[_0xfd5f('0x2e')][_0xfd5f('0x21')](_0x2963e6)[_0xfd5f('0x26')](function(_0x1b9ab4){_0x119e75[_0xfd5f('0x21')]=_0x1b9ab4;if(_0x48a799[_0xfd5f('0x34')][_0xfd5f('0x43')]){_0x1d6ede[_0xfd5f('0x44')]=[{'all':!![]}];}return db[_0xfd5f('0x2e')]['findAll'](_0x1d6ede);})[_0xfd5f('0x26')](function(_0x152438){_0x119e75['rows']=_0x152438;return _0x119e75;})['then'](respondWithFilteredResult(_0x6f2882,_0x1d6ede))['catch'](handleError(_0x6f2882,null));};exports[_0xfd5f('0x45')]=function(_0x8000f8,_0x3b2f44){var _0x15cc46={'raw':!![],'where':{'id':_0x8000f8[_0xfd5f('0x46')]['id']}},_0xb07804={};_0xb07804[_0xfd5f('0x37')]=_[_0xfd5f('0x35')](db[_0xfd5f('0x2e')]['rawAttributes']);_0xb07804[_0xfd5f('0x34')]=_[_0xfd5f('0x35')](_0x8000f8[_0xfd5f('0x34')]);_0xb07804[_0xfd5f('0x36')]=_['intersection'](_0xb07804[_0xfd5f('0x37')],_0xb07804[_0xfd5f('0x34')]);_0x15cc46[_0xfd5f('0x38')]=_['intersection'](_0xb07804[_0xfd5f('0x37')],qs[_0xfd5f('0x3a')](_0x8000f8['query'][_0xfd5f('0x3a')]));_0x15cc46[_0xfd5f('0x38')]=_0x15cc46[_0xfd5f('0x38')][_0xfd5f('0x3b')]?_0x15cc46[_0xfd5f('0x38')]:_0xb07804[_0xfd5f('0x37')];if(_0x8000f8[_0xfd5f('0x34')][_0xfd5f('0x43')]){_0x15cc46[_0xfd5f('0x44')]=[{'all':!![]}];}_0x15cc46=_[_0xfd5f('0x42')]({},_0x15cc46,_0x8000f8[_0xfd5f('0x47')]);return db[_0xfd5f('0x2e')]['find'](_0x15cc46)[_0xfd5f('0x26')](handleEntityNotFound(_0x3b2f44,null))['then'](respondWithResult(_0x3b2f44,null))[_0xfd5f('0x48')](handleError(_0x3b2f44,null));};exports[_0xfd5f('0x49')]=function(_0x4853af,_0x53c115){return db[_0xfd5f('0x2e')][_0xfd5f('0x49')](_0x4853af['body'],{})[_0xfd5f('0x26')](respondWithResult(_0x53c115,0xc9))[_0xfd5f('0x48')](handleError(_0x53c115,null));};exports[_0xfd5f('0x25')]=function(_0x595397,_0x29672c){if(_0x595397[_0xfd5f('0x4a')]['id']){delete _0x595397[_0xfd5f('0x4a')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x595397[_0xfd5f('0x46')]['id']}})[_0xfd5f('0x26')](handleEntityNotFound(_0x29672c,null))[_0xfd5f('0x26')](saveUpdates(_0x595397['body'],null))[_0xfd5f('0x26')](respondWithResult(_0x29672c,null))['catch'](handleError(_0x29672c,null));};exports[_0xfd5f('0x27')]=function(_0xbca5af,_0x5a6afb){return db[_0xfd5f('0x2e')][_0xfd5f('0x4b')]({'where':{'id':_0xbca5af[_0xfd5f('0x46')]['id']}})['then'](handleEntityNotFound(_0x5a6afb,null))[_0xfd5f('0x26')](removeEntity(_0x5a6afb,null))[_0xfd5f('0x48')](handleError(_0x5a6afb,null));};exports[_0xfd5f('0x4c')]=function(_0x5b46e4,_0x2ee18e){return db[_0xfd5f('0x2e')]['describe']()[_0xfd5f('0x26')](respondWithResult(_0x2ee18e,null))[_0xfd5f('0x48')](handleError(_0x2ee18e,null));}; \ No newline at end of file +var _0x501f=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','end','error','stack','name','send','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','SquareReport','then','includeAll','include','rows','catch','show','params','length','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs'];(function(_0x2107a6,_0xe8360d){var _0x2f09ef=function(_0x46a86a){while(--_0x46a86a){_0x2107a6['push'](_0x2107a6['shift']());}};_0x2f09ef(++_0xe8360d);}(_0x501f,0x1f1));var _0xf501=function(_0x914aa,_0x153181){_0x914aa=_0x914aa-0x0;var _0x36eca1=_0x501f[_0x914aa];return _0x36eca1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf501('0x0'));var zipdir=require(_0xf501('0x1'));var jsonpatch=require(_0xf501('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf501('0x3'));var util=require(_0xf501('0x4'));var path=require(_0xf501('0x5'));var sox=require(_0xf501('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf501('0x7'));var squel=require(_0xf501('0x8'));var crypto=require(_0xf501('0x9'));var jsforce=require(_0xf501('0xa'));var deskjs=require(_0xf501('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf501('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf501('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf501('0xe'))(_0xf501('0xf'));var utils=require(_0xf501('0x10'));var config=require(_0xf501('0x11'));var licenseUtil=require(_0xf501('0x12'));var db=require(_0xf501('0x13'))['db'];function respondWithStatusCode(_0x540f34,_0x354fee){_0x354fee=_0x354fee||0xcc;return function(_0x3b0d30){if(_0x3b0d30){return _0x540f34[_0xf501('0x14')](_0x354fee);}return _0x540f34[_0xf501('0x15')](_0x354fee)['end']();};}function respondWithResult(_0x378111,_0xeaf7e8){_0xeaf7e8=_0xeaf7e8||0xc8;return function(_0x342ee3){if(_0x342ee3){return _0x378111[_0xf501('0x15')](_0xeaf7e8)[_0xf501('0x16')](_0x342ee3);}};}function respondWithFilteredResult(_0x204481,_0x1d84e5){return function(_0x901a3a){if(_0x901a3a){var _0x517201=typeof _0x1d84e5[_0xf501('0x17')]===_0xf501('0x18')&&typeof _0x1d84e5[_0xf501('0x19')]===_0xf501('0x18');var _0x2fdfea=_0x901a3a[_0xf501('0x1a')];var _0x1396db=_0x517201?0x0:_0x1d84e5['offset'];var _0x4d8ce7=_0x517201?_0x901a3a[_0xf501('0x1a')]:_0x1d84e5['offset']+_0x1d84e5['limit'];var _0x14f62a;if(_0x4d8ce7>=_0x2fdfea){_0x4d8ce7=_0x2fdfea;_0x14f62a=0xc8;}else{_0x14f62a=0xce;}_0x204481[_0xf501('0x15')](_0x14f62a);return _0x204481[_0xf501('0x1b')](_0xf501('0x1c'),_0x1396db+'-'+_0x4d8ce7+'/'+_0x2fdfea)[_0xf501('0x16')](_0x901a3a);}return null;};}function patchUpdates(_0x4de8b5){return function(_0x1a24de){try{jsonpatch[_0xf501('0x1d')](_0x1a24de,_0x4de8b5,!![]);}catch(_0x23095f){return BPromise[_0xf501('0x1e')](_0x23095f);}return _0x1a24de[_0xf501('0x1f')]();};}function saveUpdates(_0x498e34,_0x4d4502){return function(_0x53f066){if(_0x53f066){return _0x53f066[_0xf501('0x20')](_0x498e34)['then'](function(_0x5894d8){return _0x5894d8;});}return null;};}function removeEntity(_0x5bd16a,_0x4e8cd2){return function(_0x1c281b){if(_0x1c281b){return _0x1c281b['destroy']()['then'](function(){_0x5bd16a[_0xf501('0x15')](0xcc)[_0xf501('0x21')]();});}};}function handleEntityNotFound(_0x477f73,_0x1a52b6){return function(_0x1b26a3){if(!_0x1b26a3){_0x477f73[_0xf501('0x14')](0x194);}return _0x1b26a3;};}function handleError(_0x4e8b6a,_0x38a08a){_0x38a08a=_0x38a08a||0x1f4;return function(_0x1419dd){logger[_0xf501('0x22')](_0x1419dd[_0xf501('0x23')]);if(_0x1419dd[_0xf501('0x24')]){delete _0x1419dd['name'];}_0x4e8b6a['status'](_0x38a08a)[_0xf501('0x25')](_0x1419dd);};}exports['index']=function(_0x84b23b,_0x4bda27){var _0x4b4f93={},_0x14bbb8={},_0x6feed0={'count':0x0,'rows':[]};var _0x3e1119=_['map'](db['SquareReport'][_0xf501('0x26')],function(_0x18b12d){return{'name':_0x18b12d['fieldName'],'type':_0x18b12d[_0xf501('0x27')][_0xf501('0x28')]};});_0x14bbb8[_0xf501('0x29')]=_[_0xf501('0x2a')](_0x3e1119,_0xf501('0x24'));_0x14bbb8['query']=_[_0xf501('0x2b')](_0x84b23b[_0xf501('0x2c')]);_0x14bbb8[_0xf501('0x2d')]=_[_0xf501('0x2e')](_0x14bbb8[_0xf501('0x29')],_0x14bbb8['query']);_0x4b4f93[_0xf501('0x2f')]=_[_0xf501('0x2e')](_0x14bbb8[_0xf501('0x29')],qs[_0xf501('0x30')](_0x84b23b[_0xf501('0x2c')][_0xf501('0x30')]));_0x4b4f93[_0xf501('0x2f')]=_0x4b4f93[_0xf501('0x2f')]['length']?_0x4b4f93['attributes']:_0x14bbb8['model'];if(!_0x84b23b[_0xf501('0x2c')][_0xf501('0x31')](_0xf501('0x32'))){_0x4b4f93[_0xf501('0x19')]=qs[_0xf501('0x19')](_0x84b23b[_0xf501('0x2c')][_0xf501('0x19')]);_0x4b4f93[_0xf501('0x17')]=qs[_0xf501('0x17')](_0x84b23b[_0xf501('0x2c')][_0xf501('0x17')]);}_0x4b4f93[_0xf501('0x33')]=qs[_0xf501('0x34')](_0x84b23b[_0xf501('0x2c')]['sort']);_0x4b4f93['where']=qs[_0xf501('0x2d')](_[_0xf501('0x35')](_0x84b23b['query'],_0x14bbb8[_0xf501('0x2d')]),_0x3e1119);if(_0x84b23b[_0xf501('0x2c')][_0xf501('0x36')]){_0x4b4f93[_0xf501('0x37')]=_[_0xf501('0x38')](_0x4b4f93[_0xf501('0x37')],{'$or':_[_0xf501('0x2a')](_0x3e1119,function(_0x334d50){if(_0x334d50[_0xf501('0x27')]!==_0xf501('0x39')){var _0x1e48ae={};_0x1e48ae[_0x334d50[_0xf501('0x24')]]={'$like':'%'+_0x84b23b[_0xf501('0x2c')][_0xf501('0x36')]+'%'};return _0x1e48ae;}})});}_0x4b4f93=_[_0xf501('0x38')]({},_0x4b4f93,_0x84b23b[_0xf501('0x3a')]);var _0xea5505={'where':_0x4b4f93[_0xf501('0x37')]};return db[_0xf501('0x3b')][_0xf501('0x1a')](_0xea5505)[_0xf501('0x3c')](function(_0x3cbcb6){_0x6feed0[_0xf501('0x1a')]=_0x3cbcb6;if(_0x84b23b[_0xf501('0x2c')][_0xf501('0x3d')]){_0x4b4f93[_0xf501('0x3e')]=[{'all':!![]}];}return db[_0xf501('0x3b')]['findAll'](_0x4b4f93);})[_0xf501('0x3c')](function(_0x3cdddd){_0x6feed0[_0xf501('0x3f')]=_0x3cdddd;return _0x6feed0;})[_0xf501('0x3c')](respondWithFilteredResult(_0x4bda27,_0x4b4f93))[_0xf501('0x40')](handleError(_0x4bda27,null));};exports[_0xf501('0x41')]=function(_0x196bd8,_0x3e7c6c){var _0x5de53e={'raw':!![],'where':{'id':_0x196bd8[_0xf501('0x42')]['id']}},_0x58e7b2={};_0x58e7b2[_0xf501('0x29')]=_[_0xf501('0x2b')](db['SquareReport'][_0xf501('0x26')]);_0x58e7b2[_0xf501('0x2c')]=_[_0xf501('0x2b')](_0x196bd8['query']);_0x58e7b2[_0xf501('0x2d')]=_['intersection'](_0x58e7b2[_0xf501('0x29')],_0x58e7b2['query']);_0x5de53e['attributes']=_[_0xf501('0x2e')](_0x58e7b2[_0xf501('0x29')],qs['fields'](_0x196bd8[_0xf501('0x2c')][_0xf501('0x30')]));_0x5de53e[_0xf501('0x2f')]=_0x5de53e['attributes'][_0xf501('0x43')]?_0x5de53e[_0xf501('0x2f')]:_0x58e7b2[_0xf501('0x29')];if(_0x196bd8['query'][_0xf501('0x3d')]){_0x5de53e[_0xf501('0x3e')]=[{'all':!![]}];}_0x5de53e=_[_0xf501('0x38')]({},_0x5de53e,_0x196bd8[_0xf501('0x3a')]);return db[_0xf501('0x3b')]['find'](_0x5de53e)[_0xf501('0x3c')](handleEntityNotFound(_0x3e7c6c,null))[_0xf501('0x3c')](respondWithResult(_0x3e7c6c,null))[_0xf501('0x40')](handleError(_0x3e7c6c,null));};exports[_0xf501('0x44')]=function(_0x287283,_0x44809d){return db['SquareReport'][_0xf501('0x44')](_0x287283['body'],{})[_0xf501('0x3c')](respondWithResult(_0x44809d,0xc9))[_0xf501('0x40')](handleError(_0x44809d,null));};exports['update']=function(_0x4a7c57,_0x5772d6){if(_0x4a7c57[_0xf501('0x45')]['id']){delete _0x4a7c57['body']['id'];}return db[_0xf501('0x3b')][_0xf501('0x46')]({'where':{'id':_0x4a7c57[_0xf501('0x42')]['id']}})[_0xf501('0x3c')](handleEntityNotFound(_0x5772d6,null))['then'](saveUpdates(_0x4a7c57[_0xf501('0x45')],null))[_0xf501('0x3c')](respondWithResult(_0x5772d6,null))[_0xf501('0x40')](handleError(_0x5772d6,null));};exports[_0xf501('0x47')]=function(_0x26b824,_0x4cbc6b){return db[_0xf501('0x3b')][_0xf501('0x46')]({'where':{'id':_0x26b824[_0xf501('0x42')]['id']}})['then'](handleEntityNotFound(_0x4cbc6b,null))['then'](removeEntity(_0x4cbc6b,null))['catch'](handleError(_0x4cbc6b,null));};exports[_0xf501('0x48')]=function(_0x22074f,_0x63e142){return db[_0xf501('0x3b')][_0xf501('0x48')]()[_0xf501('0x3c')](respondWithResult(_0x63e142,null))[_0xf501('0x40')](handleError(_0x63e142,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 780aed7..e5548dc 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 _0xcdf0=['rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','project_name','leaveAt','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x17bf0e,_0x5ad608){var _0x1a6a79=function(_0x5f0eba){while(--_0x5f0eba){_0x17bf0e['push'](_0x17bf0e['shift']());}};_0x1a6a79(++_0x5ad608);}(_0xcdf0,0x199));var _0x0cdf=function(_0x4dcf1d,_0x491ea1){_0x4dcf1d=_0x4dcf1d-0x0;var _0x773104=_0xcdf0[_0x4dcf1d];return _0x773104;};'use strict';var _=require(_0x0cdf('0x0'));var util=require('util');var logger=require(_0x0cdf('0x1'))(_0x0cdf('0x2'));var moment=require(_0x0cdf('0x3'));var BPromise=require(_0x0cdf('0x4'));var rp=require(_0x0cdf('0x5'));var fs=require('fs');var path=require(_0x0cdf('0x6'));var rimraf=require(_0x0cdf('0x7'));var config=require(_0x0cdf('0x8'));var attributes=require(_0x0cdf('0x9'));module[_0x0cdf('0xa')]=function(_0x5f28a0,_0x5c6178){return _0x5f28a0[_0x0cdf('0xb')](_0x0cdf('0xc'),attributes,{'tableName':_0x0cdf('0xd'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid',_0x0cdf('0xe')]},{'name':_0x0cdf('0xf'),'fields':[_0x0cdf('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x839e=['./squareReport.attributes','exports','define','SquareReport','report_square','project_name','leaveAt','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x839e,0x133));var _0xe839=function(_0x1988b0,_0x1fa6a0){_0x1988b0=_0x1988b0-0x0;var _0x1240b2=_0x839e[_0x1988b0];return _0x1240b2;};'use strict';var _=require(_0xe839('0x0'));var util=require(_0xe839('0x1'));var logger=require(_0xe839('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe839('0x3'));var rp=require(_0xe839('0x4'));var fs=require('fs');var path=require(_0xe839('0x5'));var rimraf=require(_0xe839('0x6'));var config=require(_0xe839('0x7'));var attributes=require(_0xe839('0x8'));module[_0xe839('0x9')]=function(_0x3110bf,_0x12f743){return _0x3110bf[_0xe839('0xa')](_0xe839('0xb'),attributes,{'tableName':_0xe839('0xc'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid',_0xe839('0xd')]},{'name':_0xe839('0xe'),'fields':[_0xe839('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 04b6141..72bdfee 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 _0x0326=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareReport,\x20%s,\x20%s','message','catch','SquareReport','create','body','options','raw','CreateSquareReport','attributes','limit','UpdateSquareReport','lodash','util','moment'];(function(_0x2909e8,_0x4e3d6e){var _0x2e8843=function(_0x21e863){while(--_0x21e863){_0x2909e8['push'](_0x2909e8['shift']());}};_0x2e8843(++_0x4e3d6e);}(_0x0326,0xdd));var _0x6032=function(_0x2abb04,_0x32a9b7){_0x2abb04=_0x2abb04-0x0;var _0x7d635c=_0x0326[_0x2abb04];return _0x7d635c;};'use strict';var _=require(_0x6032('0x0'));var util=require(_0x6032('0x1'));var moment=require(_0x6032('0x2'));var BPromise=require(_0x6032('0x3'));var rs=require(_0x6032('0x4'));var fs=require('fs');var Redis=require(_0x6032('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6032('0x6'));var logger=require(_0x6032('0x7'))(_0x6032('0x8'));var config=require('../../config/environment');var jayson=require(_0x6032('0x9'));var client=jayson[_0x6032('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x182150,_0x4ec5d4,_0x1ac228){return new BPromise(function(_0x5035a8,_0x330853){return client[_0x6032('0xb')](_0x182150,_0x1ac228)[_0x6032('0xc')](function(_0x1eb2d0){logger[_0x6032('0xd')]('SquareReport,\x20%s,\x20%s',_0x4ec5d4,_0x6032('0xe'));logger[_0x6032('0xf')](_0x6032('0x10'),_0x4ec5d4,_0x6032('0xe'),JSON[_0x6032('0x11')](_0x1eb2d0));if(_0x1eb2d0[_0x6032('0x12')]){if(_0x1eb2d0['error'][_0x6032('0x13')]===0x1f4){logger[_0x6032('0x12')](_0x6032('0x14'),_0x4ec5d4,_0x1eb2d0[_0x6032('0x12')][_0x6032('0x15')]);return _0x330853(_0x1eb2d0['error'][_0x6032('0x15')]);}logger[_0x6032('0x12')](_0x6032('0x14'),_0x4ec5d4,_0x1eb2d0['error']['message']);return _0x5035a8(_0x1eb2d0['error'][_0x6032('0x15')]);}else{logger[_0x6032('0xd')](_0x6032('0x14'),_0x4ec5d4,'request\x20sent');_0x5035a8(_0x1eb2d0['result']['message']);}})[_0x6032('0x16')](function(_0x1e7d2c){logger[_0x6032('0x12')]('SquareReport,\x20%s,\x20%s',_0x4ec5d4,_0x1e7d2c);_0x330853(_0x1e7d2c);});});}exports['CreateSquareReport']=function(_0x5684c9){var _0x25bca6=this;return new Promise(function(_0x2b3ba5,_0x413518){return db[_0x6032('0x17')][_0x6032('0x18')](_0x5684c9[_0x6032('0x19')],{'raw':_0x5684c9[_0x6032('0x1a')]?_0x5684c9[_0x6032('0x1a')][_0x6032('0x1b')]===undefined?!![]:![]:!![]})[_0x6032('0xc')](function(_0x215550){logger[_0x6032('0xd')](_0x6032('0x1c'),_0x5684c9);logger['debug'](_0x6032('0x1c'),_0x5684c9,JSON['stringify'](_0x215550));_0x2b3ba5(_0x215550);})[_0x6032('0x16')](function(_0x313593){logger[_0x6032('0x12')](_0x6032('0x1c'),_0x313593[_0x6032('0x15')],_0x5684c9);_0x413518(_0x25bca6[_0x6032('0x12')](0x1f4,_0x313593[_0x6032('0x15')]));});});};exports['UpdateSquareReport']=function(_0x47bef5){var _0x3396e3=this;return new Promise(function(_0xf98296,_0x2e7424){return db[_0x6032('0x17')]['update'](_0x47bef5[_0x6032('0x19')],{'raw':_0x47bef5[_0x6032('0x1a')]?_0x47bef5[_0x6032('0x1a')][_0x6032('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47bef5[_0x6032('0x1a')]?_0x47bef5[_0x6032('0x1a')]['where']||null:null,'attributes':_0x47bef5[_0x6032('0x1a')]?_0x47bef5[_0x6032('0x1a')][_0x6032('0x1d')]||null:null,'limit':_0x47bef5[_0x6032('0x1a')]?_0x47bef5[_0x6032('0x1a')][_0x6032('0x1e')]||null:null})['then'](function(_0x52437c){logger['info'](_0x6032('0x1f'),_0x47bef5);logger['debug'](_0x6032('0x1f'),_0x47bef5,JSON[_0x6032('0x11')](_0x52437c));_0xf98296(_0x52437c);})[_0x6032('0x16')](function(_0x30c68d){logger[_0x6032('0x12')](_0x6032('0x1f'),_0x30c68d['message'],_0x47bef5);_0x2e7424(_0x3396e3['error'](0x1f4,_0x30c68d[_0x6032('0x15')]));});});}; \ No newline at end of file +var _0x4f3a=['../../config/environment','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','CreateSquareReport','SquareReport','create','body','options','raw','UpdateSquareReport','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x31a37b,_0x826249){var _0x49ae16=function(_0x2e8d52){while(--_0x2e8d52){_0x31a37b['push'](_0x31a37b['shift']());}};_0x49ae16(++_0x826249);}(_0x4f3a,0x141));var _0xa4f3=function(_0x24431a,_0x52459a){_0x24431a=_0x24431a-0x0;var _0x454ec7=_0x4f3a[_0x24431a];return _0x454ec7;};'use strict';var _=require(_0xa4f3('0x0'));var util=require(_0xa4f3('0x1'));var moment=require(_0xa4f3('0x2'));var BPromise=require(_0xa4f3('0x3'));var rs=require(_0xa4f3('0x4'));var fs=require('fs');var Redis=require(_0xa4f3('0x5'));var db=require(_0xa4f3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa4f3('0x7'))(_0xa4f3('0x8'));var config=require(_0xa4f3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa4f3('0xa')][_0xa4f3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x452531,_0x354f34,_0x3916d9){return new BPromise(function(_0x5b4890,_0x2467ee){return client[_0xa4f3('0xc')](_0x452531,_0x3916d9)[_0xa4f3('0xd')](function(_0x827561){logger[_0xa4f3('0xe')](_0xa4f3('0xf'),_0x354f34,_0xa4f3('0x10'));logger[_0xa4f3('0x11')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x354f34,_0xa4f3('0x10'),JSON[_0xa4f3('0x12')](_0x827561));if(_0x827561[_0xa4f3('0x13')]){if(_0x827561[_0xa4f3('0x13')]['code']===0x1f4){logger[_0xa4f3('0x13')](_0xa4f3('0xf'),_0x354f34,_0x827561[_0xa4f3('0x13')][_0xa4f3('0x14')]);return _0x2467ee(_0x827561[_0xa4f3('0x13')][_0xa4f3('0x14')]);}logger[_0xa4f3('0x13')](_0xa4f3('0xf'),_0x354f34,_0x827561[_0xa4f3('0x13')][_0xa4f3('0x14')]);return _0x5b4890(_0x827561[_0xa4f3('0x13')][_0xa4f3('0x14')]);}else{logger[_0xa4f3('0xe')](_0xa4f3('0xf'),_0x354f34,_0xa4f3('0x10'));_0x5b4890(_0x827561['result'][_0xa4f3('0x14')]);}})[_0xa4f3('0x15')](function(_0x209523){logger[_0xa4f3('0x13')](_0xa4f3('0xf'),_0x354f34,_0x209523);_0x2467ee(_0x209523);});});}exports[_0xa4f3('0x16')]=function(_0x4d40d5){var _0x25558f=this;return new Promise(function(_0x173cb2,_0x11ef9e){return db[_0xa4f3('0x17')][_0xa4f3('0x18')](_0x4d40d5[_0xa4f3('0x19')],{'raw':_0x4d40d5[_0xa4f3('0x1a')]?_0x4d40d5[_0xa4f3('0x1a')][_0xa4f3('0x1b')]===undefined?!![]:![]:!![]})[_0xa4f3('0xd')](function(_0x1851db){logger[_0xa4f3('0xe')](_0xa4f3('0x16'),_0x4d40d5);logger['debug'](_0xa4f3('0x16'),_0x4d40d5,JSON[_0xa4f3('0x12')](_0x1851db));_0x173cb2(_0x1851db);})['catch'](function(_0xbbc638){logger[_0xa4f3('0x13')]('CreateSquareReport',_0xbbc638[_0xa4f3('0x14')],_0x4d40d5);_0x11ef9e(_0x25558f[_0xa4f3('0x13')](0x1f4,_0xbbc638[_0xa4f3('0x14')]));});});};exports[_0xa4f3('0x1c')]=function(_0x16c905){var _0x3aad4c=this;return new Promise(function(_0x18d45f,_0x388e60){return db['SquareReport']['update'](_0x16c905[_0xa4f3('0x19')],{'raw':_0x16c905[_0xa4f3('0x1a')]?_0x16c905[_0xa4f3('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16c905[_0xa4f3('0x1a')]?_0x16c905[_0xa4f3('0x1a')]['where']||null:null,'attributes':_0x16c905[_0xa4f3('0x1a')]?_0x16c905[_0xa4f3('0x1a')][_0xa4f3('0x1d')]||null:null,'limit':_0x16c905['options']?_0x16c905[_0xa4f3('0x1a')]['limit']||null:null})[_0xa4f3('0xd')](function(_0x3d958b){logger[_0xa4f3('0xe')](_0xa4f3('0x1c'),_0x16c905);logger[_0xa4f3('0x11')](_0xa4f3('0x1c'),_0x16c905,JSON[_0xa4f3('0x12')](_0x3d958b));_0x18d45f(_0x3d958b);})[_0xa4f3('0x15')](function(_0x1bd774){logger[_0xa4f3('0x13')]('UpdateSquareReport',_0x1bd774[_0xa4f3('0x14')],_0x16c905);_0x388e60(_0x3aad4c[_0xa4f3('0x13')](0x1f4,_0x1bd774[_0xa4f3('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 4075102..212e067 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 _0x0e56=['express','Router','../../config/environment','isAuthenticated','index','/describe','get','/:id','show','create','destroy','multer','util','path','connect-timeout'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x0e56,0x1a0));var _0x60e5=function(_0x1ef71d,_0x453e87){_0x1ef71d=_0x1ef71d-0x0;var _0x5bd739=_0x0e56[_0x1ef71d];return _0x5bd739;};'use strict';var multer=require(_0x60e5('0x0'));var util=require(_0x60e5('0x1'));var path=require(_0x60e5('0x2'));var timeout=require(_0x60e5('0x3'));var express=require(_0x60e5('0x4'));var router=express[_0x60e5('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x60e5('0x6'));var controller=require('./squareReportDetail.controller');router['get']('/',auth[_0x60e5('0x7')](),controller[_0x60e5('0x8')]);router['get'](_0x60e5('0x9'),auth[_0x60e5('0x7')](),controller['describe']);router[_0x60e5('0xa')](_0x60e5('0xb'),auth[_0x60e5('0x7')](),controller[_0x60e5('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x60e5('0xd')]);router['put'](_0x60e5('0xb'),auth[_0x60e5('0x7')](),controller['update']);router['delete']('/:id',auth[_0x60e5('0x7')](),controller[_0x60e5('0xe')]);module['exports']=router; \ No newline at end of file +var _0xa74f=['../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','index','show','create','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x42cced,_0x248712){var _0x1f5f5d=function(_0x3f148f){while(--_0x3f148f){_0x42cced['push'](_0x42cced['shift']());}};_0x1f5f5d(++_0x248712);}(_0xa74f,0x186));var _0xfa74=function(_0x20aadb,_0x5a607a){_0x20aadb=_0x20aadb-0x0;var _0x520018=_0xa74f[_0x20aadb];return _0x520018;};'use strict';var multer=require(_0xfa74('0x0'));var util=require(_0xfa74('0x1'));var path=require('path');var timeout=require(_0xfa74('0x2'));var express=require(_0xfa74('0x3'));var router=express[_0xfa74('0x4')]();var fs_extra=require(_0xfa74('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfa74('0x6'));var config=require('../../config/environment');var controller=require(_0xfa74('0x7'));router[_0xfa74('0x8')]('/',auth[_0xfa74('0x9')](),controller[_0xfa74('0xa')]);router[_0xfa74('0x8')]('/describe',auth[_0xfa74('0x9')](),controller['describe']);router[_0xfa74('0x8')]('/:id',auth[_0xfa74('0x9')](),controller[_0xfa74('0xb')]);router['post']('/',auth[_0xfa74('0x9')](),controller[_0xfa74('0xc')]);router['put'](_0xfa74('0xd'),auth['isAuthenticated'](),controller[_0xfa74('0xe')]);router[_0xfa74('0xf')]('/:id',auth[_0xfa74('0x9')](),controller[_0xfa74('0x10')]);module[_0xfa74('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 84dbc8a..82a54ca 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 _0x922c=['STRING','TEXT','sequelize'];(function(_0x36b98b,_0x1901bb){var _0x1ab3d9=function(_0x1702dc){while(--_0x1702dc){_0x36b98b['push'](_0x36b98b['shift']());}};_0x1ab3d9(++_0x1901bb);}(_0x922c,0x11c));var _0xc922=function(_0x9b7a64,_0x38d4a8){_0x9b7a64=_0x9b7a64-0x0;var _0x33fd98=_0x922c[_0x9b7a64];return _0x33fd98;};'use strict';var Sequelize=require(_0xc922('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xc922('0x1')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0xc922('0x1')]},'data':{'type':Sequelize[_0xc922('0x2')]},'project_name':{'type':Sequelize[_0xc922('0x1')]},'callerid':{'type':Sequelize[_0xc922('0x1')]}}; \ No newline at end of file +var _0xfa59=['exports','STRING','TEXT'];(function(_0x37756b,_0x24db76){var _0x46efec=function(_0x319807){while(--_0x319807){_0x37756b['push'](_0x37756b['shift']());}};_0x46efec(++_0x24db76);}(_0xfa59,0x1ec));var _0x9fa5=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xfa59[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0x9fa5('0x0')]={'uniqueid':{'type':Sequelize[_0x9fa5('0x1')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x9fa5('0x1')]},'data':{'type':Sequelize[_0x9fa5('0x2')]},'project_name':{'type':Sequelize[_0x9fa5('0x1')]},'callerid':{'type':Sequelize[_0x9fa5('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index b7f57c0..fa5d2e4 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 _0x70ba=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','name','send','index','SquareDetailsReport','rawAttributes','type','map','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','body','find','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x4cb26e,_0x584dff){var _0x17446c=function(_0x3c0e62){while(--_0x3c0e62){_0x4cb26e['push'](_0x4cb26e['shift']());}};_0x17446c(++_0x584dff);}(_0x70ba,0xc2));var _0xa70b=function(_0x1ee606,_0x46f08a){_0x1ee606=_0x1ee606-0x0;var _0x3d1d9a=_0x70ba[_0x1ee606];return _0x3d1d9a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa70b('0x0'));var zipdir=require(_0xa70b('0x1'));var jsonpatch=require(_0xa70b('0x2'));var rp=require('request-promise');var moment=require(_0xa70b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa70b('0x4'));var util=require(_0xa70b('0x5'));var path=require(_0xa70b('0x6'));var sox=require('sox');var csv=require(_0xa70b('0x7'));var ejs=require(_0xa70b('0x8'));var fs=require('fs');var fs_extra=require(_0xa70b('0x9'));var _=require(_0xa70b('0xa'));var squel=require(_0xa70b('0xb'));var crypto=require(_0xa70b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa70b('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa70b('0xe'));var Papa=require('papaparse');var Redis=require(_0xa70b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa70b('0x10'));var as=require(_0xa70b('0x11'));var hardwareService=require(_0xa70b('0x12'));var logger=require(_0xa70b('0x13'))('api');var utils=require(_0xa70b('0x14'));var config=require(_0xa70b('0x15'));var licenseUtil=require(_0xa70b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37e122,_0x28eebb){_0x28eebb=_0x28eebb||0xcc;return function(_0x3fc95d){if(_0x3fc95d){return _0x37e122['sendStatus'](_0x28eebb);}return _0x37e122[_0xa70b('0x17')](_0x28eebb)[_0xa70b('0x18')]();};}function respondWithResult(_0x4ceb73,_0x40600f){_0x40600f=_0x40600f||0xc8;return function(_0xe36d8a){if(_0xe36d8a){return _0x4ceb73[_0xa70b('0x17')](_0x40600f)[_0xa70b('0x19')](_0xe36d8a);}};}function respondWithFilteredResult(_0x4ddfc9,_0x3420ef){return function(_0x4a5567){if(_0x4a5567){var _0x50f70b=typeof _0x3420ef[_0xa70b('0x1a')]===_0xa70b('0x1b')&&typeof _0x3420ef[_0xa70b('0x1c')]==='undefined';var _0x323e62=_0x4a5567['count'];var _0x3ea69e=_0x50f70b?0x0:_0x3420ef['offset'];var _0x596b9c=_0x50f70b?_0x4a5567[_0xa70b('0x1d')]:_0x3420ef[_0xa70b('0x1a')]+_0x3420ef[_0xa70b('0x1c')];var _0x380895;if(_0x596b9c>=_0x323e62){_0x596b9c=_0x323e62;_0x380895=0xc8;}else{_0x380895=0xce;}_0x4ddfc9[_0xa70b('0x17')](_0x380895);return _0x4ddfc9[_0xa70b('0x1e')](_0xa70b('0x1f'),_0x3ea69e+'-'+_0x596b9c+'/'+_0x323e62)['json'](_0x4a5567);}return null;};}function patchUpdates(_0x3ff9bc){return function(_0x152f8e){try{jsonpatch[_0xa70b('0x20')](_0x152f8e,_0x3ff9bc,!![]);}catch(_0xb59d54){return BPromise[_0xa70b('0x21')](_0xb59d54);}return _0x152f8e[_0xa70b('0x22')]();};}function saveUpdates(_0x555d68,_0x566c4c){return function(_0x8467da){if(_0x8467da){return _0x8467da[_0xa70b('0x23')](_0x555d68)[_0xa70b('0x24')](function(_0xf18b78){return _0xf18b78;});}return null;};}function removeEntity(_0x5957b5,_0x1e1005){return function(_0x388f52){if(_0x388f52){return _0x388f52['destroy']()[_0xa70b('0x24')](function(){_0x5957b5[_0xa70b('0x17')](0xcc)[_0xa70b('0x18')]();});}};}function handleEntityNotFound(_0x1bfe83,_0x521e2c){return function(_0x2458c4){if(!_0x2458c4){_0x1bfe83[_0xa70b('0x25')](0x194);}return _0x2458c4;};}function handleError(_0x5c4cef,_0x315079){_0x315079=_0x315079||0x1f4;return function(_0x3a2eb5){logger['error'](_0x3a2eb5['stack']);if(_0x3a2eb5[_0xa70b('0x26')]){delete _0x3a2eb5[_0xa70b('0x26')];}_0x5c4cef['status'](_0x315079)[_0xa70b('0x27')](_0x3a2eb5);};}exports[_0xa70b('0x28')]=function(_0x50c76f,_0x18c29f){var _0x1ff044={},_0x18b910={},_0x4e9e23={'count':0x0,'rows':[]};var _0x410afd=_['map'](db[_0xa70b('0x29')][_0xa70b('0x2a')],function(_0x14164d){return{'name':_0x14164d['fieldName'],'type':_0x14164d[_0xa70b('0x2b')]['key']};});_0x18b910['model']=_[_0xa70b('0x2c')](_0x410afd,'name');_0x18b910[_0xa70b('0x2d')]=_[_0xa70b('0x2e')](_0x50c76f['query']);_0x18b910[_0xa70b('0x2f')]=_[_0xa70b('0x30')](_0x18b910[_0xa70b('0x31')],_0x18b910['query']);_0x1ff044['attributes']=_['intersection'](_0x18b910[_0xa70b('0x31')],qs[_0xa70b('0x32')](_0x50c76f['query'][_0xa70b('0x32')]));_0x1ff044[_0xa70b('0x33')]=_0x1ff044[_0xa70b('0x33')][_0xa70b('0x34')]?_0x1ff044[_0xa70b('0x33')]:_0x18b910[_0xa70b('0x31')];if(!_0x50c76f[_0xa70b('0x2d')]['hasOwnProperty'](_0xa70b('0x35'))){_0x1ff044[_0xa70b('0x1c')]=qs[_0xa70b('0x1c')](_0x50c76f[_0xa70b('0x2d')][_0xa70b('0x1c')]);_0x1ff044[_0xa70b('0x1a')]=qs[_0xa70b('0x1a')](_0x50c76f[_0xa70b('0x2d')][_0xa70b('0x1a')]);}_0x1ff044[_0xa70b('0x36')]=qs['sort'](_0x50c76f[_0xa70b('0x2d')][_0xa70b('0x37')]);_0x1ff044[_0xa70b('0x38')]=qs['filters'](_[_0xa70b('0x39')](_0x50c76f[_0xa70b('0x2d')],_0x18b910[_0xa70b('0x2f')]),_0x410afd);if(_0x50c76f['query']['filter']){_0x1ff044[_0xa70b('0x38')]=_['merge'](_0x1ff044[_0xa70b('0x38')],{'$or':_[_0xa70b('0x2c')](_0x410afd,function(_0x48e204){if(_0x48e204[_0xa70b('0x2b')]!==_0xa70b('0x3a')){var _0x30c0d3={};_0x30c0d3[_0x48e204[_0xa70b('0x26')]]={'$like':'%'+_0x50c76f[_0xa70b('0x2d')][_0xa70b('0x3b')]+'%'};return _0x30c0d3;}})});}_0x1ff044=_[_0xa70b('0x3c')]({},_0x1ff044,_0x50c76f[_0xa70b('0x3d')]);var _0xfa165e={'where':_0x1ff044[_0xa70b('0x38')]};return db[_0xa70b('0x29')]['count'](_0xfa165e)[_0xa70b('0x24')](function(_0x35f692){_0x4e9e23[_0xa70b('0x1d')]=_0x35f692;if(_0x50c76f[_0xa70b('0x2d')][_0xa70b('0x3e')]){_0x1ff044[_0xa70b('0x3f')]=[{'all':!![]}];}return db[_0xa70b('0x29')]['findAll'](_0x1ff044);})[_0xa70b('0x24')](function(_0x25938c){_0x4e9e23[_0xa70b('0x40')]=_0x25938c;return _0x4e9e23;})[_0xa70b('0x24')](respondWithFilteredResult(_0x18c29f,_0x1ff044))[_0xa70b('0x41')](handleError(_0x18c29f,null));};exports[_0xa70b('0x42')]=function(_0x4c6017,_0x430ac5){var _0x3a890b={'raw':!![],'where':{'id':_0x4c6017[_0xa70b('0x43')]['id']}},_0x468a63={};_0x468a63[_0xa70b('0x31')]=_['keys'](db[_0xa70b('0x29')][_0xa70b('0x2a')]);_0x468a63[_0xa70b('0x2d')]=_[_0xa70b('0x2e')](_0x4c6017[_0xa70b('0x2d')]);_0x468a63[_0xa70b('0x2f')]=_[_0xa70b('0x30')](_0x468a63[_0xa70b('0x31')],_0x468a63[_0xa70b('0x2d')]);_0x3a890b[_0xa70b('0x33')]=_['intersection'](_0x468a63[_0xa70b('0x31')],qs[_0xa70b('0x32')](_0x4c6017['query'][_0xa70b('0x32')]));_0x3a890b['attributes']=_0x3a890b[_0xa70b('0x33')][_0xa70b('0x34')]?_0x3a890b[_0xa70b('0x33')]:_0x468a63[_0xa70b('0x31')];if(_0x4c6017['query']['includeAll']){_0x3a890b[_0xa70b('0x3f')]=[{'all':!![]}];}_0x3a890b=_[_0xa70b('0x3c')]({},_0x3a890b,_0x4c6017['options']);return db[_0xa70b('0x29')]['find'](_0x3a890b)[_0xa70b('0x24')](handleEntityNotFound(_0x430ac5,null))[_0xa70b('0x24')](respondWithResult(_0x430ac5,null))[_0xa70b('0x41')](handleError(_0x430ac5,null));};exports['create']=function(_0x18e229,_0x19efaa){return db['SquareDetailsReport']['create'](_0x18e229[_0xa70b('0x44')],{})[_0xa70b('0x24')](respondWithResult(_0x19efaa,0xc9))[_0xa70b('0x41')](handleError(_0x19efaa,null));};exports[_0xa70b('0x23')]=function(_0x5e3eba,_0xf66777){if(_0x5e3eba[_0xa70b('0x44')]['id']){delete _0x5e3eba['body']['id'];}return db[_0xa70b('0x29')]['find']({'where':{'id':_0x5e3eba['params']['id']}})[_0xa70b('0x24')](handleEntityNotFound(_0xf66777,null))[_0xa70b('0x24')](saveUpdates(_0x5e3eba['body'],null))[_0xa70b('0x24')](respondWithResult(_0xf66777,null))[_0xa70b('0x41')](handleError(_0xf66777,null));};exports['destroy']=function(_0x4528d4,_0x5936c3){return db[_0xa70b('0x29')][_0xa70b('0x45')]({'where':{'id':_0x4528d4[_0xa70b('0x43')]['id']}})[_0xa70b('0x24')](handleEntityNotFound(_0x5936c3,null))[_0xa70b('0x24')](removeEntity(_0x5936c3,null))[_0xa70b('0x41')](handleError(_0x5936c3,null));};exports[_0xa70b('0x46')]=function(_0x463f8f,_0x40b45c){return db[_0xa70b('0x29')]['describe']()[_0xa70b('0x24')](respondWithResult(_0x40b45c,null))['catch'](handleError(_0x40b45c,null));}; \ No newline at end of file +var _0xe20b=['attributes','fields','length','nolimit','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','undefined','limit','count','offset','status','set','Content-Range','json','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','type','key','keys','intersection','model','query'];(function(_0x9c8c83,_0x16ebdd){var _0x4636ac=function(_0x5bacfc){while(--_0x5bacfc){_0x9c8c83['push'](_0x9c8c83['shift']());}};_0x4636ac(++_0x16ebdd);}(_0xe20b,0x198));var _0xbe20=function(_0x2e1447,_0x20995c){_0x2e1447=_0x2e1447-0x0;var _0x3c08c6=_0xe20b[_0x2e1447];return _0x3c08c6;};'use strict';var emlformat=require(_0xbe20('0x0'));var rimraf=require(_0xbe20('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbe20('0x2'));var rp=require(_0xbe20('0x3'));var moment=require(_0xbe20('0x4'));var BPromise=require(_0xbe20('0x5'));var Mustache=require(_0xbe20('0x6'));var util=require(_0xbe20('0x7'));var path=require('path');var sox=require(_0xbe20('0x8'));var csv=require('to-csv');var ejs=require(_0xbe20('0x9'));var fs=require('fs');var fs_extra=require(_0xbe20('0xa'));var _=require(_0xbe20('0xb'));var squel=require(_0xbe20('0xc'));var crypto=require(_0xbe20('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbe20('0xe'));var toCsv=require(_0xbe20('0xf'));var querystring=require('querystring');var Papa=require(_0xbe20('0x10'));var Redis=require(_0xbe20('0x11'));var authService=require(_0xbe20('0x12'));var qs=require(_0xbe20('0x13'));var as=require(_0xbe20('0x14'));var hardwareService=require(_0xbe20('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xbe20('0x16'));var config=require(_0xbe20('0x17'));var licenseUtil=require(_0xbe20('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f66ed,_0xd12498){_0xd12498=_0xd12498||0xcc;return function(_0x235118){if(_0x235118){return _0x1f66ed[_0xbe20('0x19')](_0xd12498);}return _0x1f66ed['status'](_0xd12498)['end']();};}function respondWithResult(_0x240c6e,_0x5d37aa){_0x5d37aa=_0x5d37aa||0xc8;return function(_0x681608){if(_0x681608){return _0x240c6e['status'](_0x5d37aa)['json'](_0x681608);}};}function respondWithFilteredResult(_0xe2ca01,_0x279363){return function(_0x20bbdf){if(_0x20bbdf){var _0x2e9ffc=typeof _0x279363['offset']===_0xbe20('0x1a')&&typeof _0x279363[_0xbe20('0x1b')]==='undefined';var _0x5da124=_0x20bbdf[_0xbe20('0x1c')];var _0x3ac8f1=_0x2e9ffc?0x0:_0x279363[_0xbe20('0x1d')];var _0xba5b9a=_0x2e9ffc?_0x20bbdf['count']:_0x279363[_0xbe20('0x1d')]+_0x279363['limit'];var _0x568029;if(_0xba5b9a>=_0x5da124){_0xba5b9a=_0x5da124;_0x568029=0xc8;}else{_0x568029=0xce;}_0xe2ca01[_0xbe20('0x1e')](_0x568029);return _0xe2ca01[_0xbe20('0x1f')](_0xbe20('0x20'),_0x3ac8f1+'-'+_0xba5b9a+'/'+_0x5da124)[_0xbe20('0x21')](_0x20bbdf);}return null;};}function patchUpdates(_0x14540a){return function(_0x3a5367){try{jsonpatch[_0xbe20('0x22')](_0x3a5367,_0x14540a,!![]);}catch(_0x4ae603){return BPromise[_0xbe20('0x23')](_0x4ae603);}return _0x3a5367['save']();};}function saveUpdates(_0x517f75,_0x5a8026){return function(_0x1a68aa){if(_0x1a68aa){return _0x1a68aa[_0xbe20('0x24')](_0x517f75)[_0xbe20('0x25')](function(_0x5e4728){return _0x5e4728;});}return null;};}function removeEntity(_0x141954,_0xfe1a30){return function(_0x4e994b){if(_0x4e994b){return _0x4e994b[_0xbe20('0x26')]()[_0xbe20('0x25')](function(){_0x141954[_0xbe20('0x1e')](0xcc)[_0xbe20('0x27')]();});}};}function handleEntityNotFound(_0x584d42,_0x4eda7c){return function(_0x4fd95a){if(!_0x4fd95a){_0x584d42[_0xbe20('0x19')](0x194);}return _0x4fd95a;};}function handleError(_0x3f22a,_0x2df05e){_0x2df05e=_0x2df05e||0x1f4;return function(_0x5da6a5){logger[_0xbe20('0x28')](_0x5da6a5[_0xbe20('0x29')]);if(_0x5da6a5[_0xbe20('0x2a')]){delete _0x5da6a5[_0xbe20('0x2a')];}_0x3f22a[_0xbe20('0x1e')](_0x2df05e)[_0xbe20('0x2b')](_0x5da6a5);};}exports[_0xbe20('0x2c')]=function(_0x2e0326,_0x409b2f){var _0x588f19={},_0x51d30e={},_0x4ceaea={'count':0x0,'rows':[]};var _0x497cb9=_[_0xbe20('0x2d')](db[_0xbe20('0x2e')][_0xbe20('0x2f')],function(_0x3c637d){return{'name':_0x3c637d['fieldName'],'type':_0x3c637d[_0xbe20('0x30')][_0xbe20('0x31')]};});_0x51d30e['model']=_[_0xbe20('0x2d')](_0x497cb9,_0xbe20('0x2a'));_0x51d30e['query']=_[_0xbe20('0x32')](_0x2e0326['query']);_0x51d30e['filters']=_[_0xbe20('0x33')](_0x51d30e[_0xbe20('0x34')],_0x51d30e[_0xbe20('0x35')]);_0x588f19[_0xbe20('0x36')]=_[_0xbe20('0x33')](_0x51d30e['model'],qs[_0xbe20('0x37')](_0x2e0326[_0xbe20('0x35')]['fields']));_0x588f19[_0xbe20('0x36')]=_0x588f19[_0xbe20('0x36')][_0xbe20('0x38')]?_0x588f19[_0xbe20('0x36')]:_0x51d30e[_0xbe20('0x34')];if(!_0x2e0326[_0xbe20('0x35')]['hasOwnProperty'](_0xbe20('0x39'))){_0x588f19[_0xbe20('0x1b')]=qs['limit'](_0x2e0326[_0xbe20('0x35')][_0xbe20('0x1b')]);_0x588f19[_0xbe20('0x1d')]=qs['offset'](_0x2e0326[_0xbe20('0x35')][_0xbe20('0x1d')]);}_0x588f19['order']=qs[_0xbe20('0x3a')](_0x2e0326[_0xbe20('0x35')][_0xbe20('0x3a')]);_0x588f19['where']=qs['filters'](_[_0xbe20('0x3b')](_0x2e0326[_0xbe20('0x35')],_0x51d30e[_0xbe20('0x3c')]),_0x497cb9);if(_0x2e0326[_0xbe20('0x35')][_0xbe20('0x3d')]){_0x588f19[_0xbe20('0x3e')]=_[_0xbe20('0x3f')](_0x588f19[_0xbe20('0x3e')],{'$or':_[_0xbe20('0x2d')](_0x497cb9,function(_0x4d22a3){if(_0x4d22a3[_0xbe20('0x30')]!==_0xbe20('0x40')){var _0x7a772={};_0x7a772[_0x4d22a3[_0xbe20('0x2a')]]={'$like':'%'+_0x2e0326['query'][_0xbe20('0x3d')]+'%'};return _0x7a772;}})});}_0x588f19=_[_0xbe20('0x3f')]({},_0x588f19,_0x2e0326[_0xbe20('0x41')]);var _0x3f4b59={'where':_0x588f19[_0xbe20('0x3e')]};return db[_0xbe20('0x2e')]['count'](_0x3f4b59)['then'](function(_0x59cf67){_0x4ceaea[_0xbe20('0x1c')]=_0x59cf67;if(_0x2e0326[_0xbe20('0x35')][_0xbe20('0x42')]){_0x588f19[_0xbe20('0x43')]=[{'all':!![]}];}return db[_0xbe20('0x2e')][_0xbe20('0x44')](_0x588f19);})[_0xbe20('0x25')](function(_0x846ef){_0x4ceaea[_0xbe20('0x45')]=_0x846ef;return _0x4ceaea;})['then'](respondWithFilteredResult(_0x409b2f,_0x588f19))[_0xbe20('0x46')](handleError(_0x409b2f,null));};exports[_0xbe20('0x47')]=function(_0x41678b,_0xec6fb6){var _0x2dd409={'raw':!![],'where':{'id':_0x41678b[_0xbe20('0x48')]['id']}},_0x3f86f1={};_0x3f86f1[_0xbe20('0x34')]=_[_0xbe20('0x32')](db[_0xbe20('0x2e')][_0xbe20('0x2f')]);_0x3f86f1[_0xbe20('0x35')]=_[_0xbe20('0x32')](_0x41678b[_0xbe20('0x35')]);_0x3f86f1[_0xbe20('0x3c')]=_[_0xbe20('0x33')](_0x3f86f1['model'],_0x3f86f1[_0xbe20('0x35')]);_0x2dd409[_0xbe20('0x36')]=_[_0xbe20('0x33')](_0x3f86f1[_0xbe20('0x34')],qs[_0xbe20('0x37')](_0x41678b['query'][_0xbe20('0x37')]));_0x2dd409[_0xbe20('0x36')]=_0x2dd409[_0xbe20('0x36')]['length']?_0x2dd409['attributes']:_0x3f86f1[_0xbe20('0x34')];if(_0x41678b[_0xbe20('0x35')]['includeAll']){_0x2dd409[_0xbe20('0x43')]=[{'all':!![]}];}_0x2dd409=_[_0xbe20('0x3f')]({},_0x2dd409,_0x41678b[_0xbe20('0x41')]);return db[_0xbe20('0x2e')][_0xbe20('0x49')](_0x2dd409)[_0xbe20('0x25')](handleEntityNotFound(_0xec6fb6,null))[_0xbe20('0x25')](respondWithResult(_0xec6fb6,null))[_0xbe20('0x46')](handleError(_0xec6fb6,null));};exports[_0xbe20('0x4a')]=function(_0x573e7c,_0x25b0fe){return db[_0xbe20('0x2e')]['create'](_0x573e7c[_0xbe20('0x4b')],{})['then'](respondWithResult(_0x25b0fe,0xc9))[_0xbe20('0x46')](handleError(_0x25b0fe,null));};exports['update']=function(_0xe34456,_0x35cbef){if(_0xe34456[_0xbe20('0x4b')]['id']){delete _0xe34456[_0xbe20('0x4b')]['id'];}return db[_0xbe20('0x2e')][_0xbe20('0x49')]({'where':{'id':_0xe34456[_0xbe20('0x48')]['id']}})['then'](handleEntityNotFound(_0x35cbef,null))['then'](saveUpdates(_0xe34456[_0xbe20('0x4b')],null))[_0xbe20('0x25')](respondWithResult(_0x35cbef,null))[_0xbe20('0x46')](handleError(_0x35cbef,null));};exports[_0xbe20('0x26')]=function(_0x3011e3,_0x361f38){return db[_0xbe20('0x2e')][_0xbe20('0x49')]({'where':{'id':_0x3011e3[_0xbe20('0x48')]['id']}})[_0xbe20('0x25')](handleEntityNotFound(_0x361f38,null))[_0xbe20('0x25')](removeEntity(_0x361f38,null))[_0xbe20('0x46')](handleError(_0x361f38,null));};exports[_0xbe20('0x4c')]=function(_0x595eae,_0x2dc82e){return db[_0xbe20('0x2e')]['describe']()[_0xbe20('0x25')](respondWithResult(_0x2dc82e,null))[_0xbe20('0x46')](handleError(_0x2dc82e,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 4cd4607..21664cc 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 _0x0552=['util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./squareReportDetail.attributes','define','report_square_details','lodash'];(function(_0x28120d,_0x503bdf){var _0x52a695=function(_0x40910c){while(--_0x40910c){_0x28120d['push'](_0x28120d['shift']());}};_0x52a695(++_0x503bdf);}(_0x0552,0x175));var _0x2055=function(_0x23719e,_0x3852f5){_0x23719e=_0x23719e-0x0;var _0x4e0343=_0x0552[_0x23719e];return _0x4e0343;};'use strict';var _=require(_0x2055('0x0'));var util=require(_0x2055('0x1'));var logger=require(_0x2055('0x2'))(_0x2055('0x3'));var moment=require(_0x2055('0x4'));var BPromise=require(_0x2055('0x5'));var rp=require(_0x2055('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2055('0x7'));var attributes=require(_0x2055('0x8'));module['exports']=function(_0x1854b6,_0x481f78){return _0x1854b6[_0x2055('0x9')]('SquareDetailsReport',attributes,{'tableName':_0x2055('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34c1=['lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport','report_square_details'];(function(_0x49c057,_0xc808ed){var _0xd8f0e6=function(_0x5b9042){while(--_0x5b9042){_0x49c057['push'](_0x49c057['shift']());}};_0xd8f0e6(++_0xc808ed);}(_0x34c1,0x134));var _0x134c=function(_0x1b96c6,_0x45e55a){_0x1b96c6=_0x1b96c6-0x0;var _0x4a20fa=_0x34c1[_0x1b96c6];return _0x4a20fa;};'use strict';var _=require(_0x134c('0x0'));var util=require(_0x134c('0x1'));var logger=require(_0x134c('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x134c('0x3'));var fs=require('fs');var path=require(_0x134c('0x4'));var rimraf=require(_0x134c('0x5'));var config=require(_0x134c('0x6'));var attributes=require(_0x134c('0x7'));module[_0x134c('0x8')]=function(_0x69bd49,_0x1f7734){return _0x69bd49['define'](_0x134c('0x9'),attributes,{'tableName':_0x134c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 22de709..9531a64 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 _0xd7d1=['debug','lodash','util','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','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','create','body','options','raw'];(function(_0x4739a3,_0x2949e1){var _0x2d800a=function(_0x32e2cd){while(--_0x32e2cd){_0x4739a3['push'](_0x4739a3['shift']());}};_0x2d800a(++_0x2949e1);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x23bfc1,_0xf2efbd){_0x23bfc1=_0x23bfc1-0x0;var _0x3f541b=_0xd7d1[_0x23bfc1];return _0x3f541b;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var moment=require(_0x1d7d('0x2'));var BPromise=require(_0x1d7d('0x3'));var rs=require(_0x1d7d('0x4'));var fs=require('fs');var Redis=require(_0x1d7d('0x5'));var db=require(_0x1d7d('0x6'))['db'];var utils=require(_0x1d7d('0x7'));var logger=require(_0x1d7d('0x8'))(_0x1d7d('0x9'));var config=require(_0x1d7d('0xa'));var jayson=require(_0x1d7d('0xb'));var client=jayson[_0x1d7d('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x462ef8,_0x1aa456,_0x14dbf6){return new BPromise(function(_0x3675a2,_0xd6189e){return client[_0x1d7d('0xd')](_0x462ef8,_0x14dbf6)[_0x1d7d('0xe')](function(_0xa44223){logger[_0x1d7d('0xf')](_0x1d7d('0x10'),_0x1aa456,_0x1d7d('0x11'));logger['debug'](_0x1d7d('0x12'),_0x1aa456,'request\x20sent',JSON[_0x1d7d('0x13')](_0xa44223));if(_0xa44223[_0x1d7d('0x14')]){if(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x15')]===0x1f4){logger['error'](_0x1d7d('0x10'),_0x1aa456,_0xa44223['error']['message']);return _0xd6189e(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x1aa456,_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);return _0x3675a2(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}else{logger[_0x1d7d('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x1aa456,_0x1d7d('0x11'));_0x3675a2(_0xa44223[_0x1d7d('0x17')]['message']);}})[_0x1d7d('0x18')](function(_0x162c3a){logger[_0x1d7d('0x14')](_0x1d7d('0x10'),_0x1aa456,_0x162c3a);_0xd6189e(_0x162c3a);});});}exports[_0x1d7d('0x19')]=function(_0x4db4f2){var _0x664e3f=this;return new Promise(function(_0x191024,_0x5cbb8f){return db['SquareDetailsReport'][_0x1d7d('0x1a')](_0x4db4f2[_0x1d7d('0x1b')],{'raw':_0x4db4f2[_0x1d7d('0x1c')]?_0x4db4f2[_0x1d7d('0x1c')][_0x1d7d('0x1d')]===undefined?!![]:![]:!![]})[_0x1d7d('0xe')](function(_0x54d401){logger[_0x1d7d('0xf')](_0x1d7d('0x19'),_0x4db4f2);logger[_0x1d7d('0x1e')]('CreateSquareDetailsReport',_0x4db4f2,JSON[_0x1d7d('0x13')](_0x54d401));_0x191024(_0x54d401);})[_0x1d7d('0x18')](function(_0x4a1cdc){logger['error'](_0x1d7d('0x19'),_0x4a1cdc[_0x1d7d('0x16')],_0x4db4f2);_0x5cbb8f(_0x664e3f[_0x1d7d('0x14')](0x1f4,_0x4a1cdc['message']));});});}; \ No newline at end of file +var _0x5204=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','lodash'];(function(_0x35674a,_0x457af3){var _0x41fdf3=function(_0x39c0d1){while(--_0x39c0d1){_0x35674a['push'](_0x35674a['shift']());}};_0x41fdf3(++_0x457af3);}(_0x5204,0xdf));var _0x4520=function(_0x15b380,_0x1a3c5f){_0x15b380=_0x15b380-0x0;var _0x232c5c=_0x5204[_0x15b380];return _0x232c5c;};'use strict';var _=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var moment=require('moment');var BPromise=require(_0x4520('0x2'));var rs=require(_0x4520('0x3'));var fs=require('fs');var Redis=require(_0x4520('0x4'));var db=require(_0x4520('0x5'))['db'];var utils=require(_0x4520('0x6'));var logger=require('../../config/logger')(_0x4520('0x7'));var config=require('../../config/environment');var jayson=require(_0x4520('0x8'));var client=jayson[_0x4520('0x9')][_0x4520('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe741c2,_0x396d29,_0x446dc9){return new BPromise(function(_0x27890f,_0x55b44f){return client[_0x4520('0xb')](_0xe741c2,_0x446dc9)['then'](function(_0x168e62){logger[_0x4520('0xc')](_0x4520('0xd'),_0x396d29,_0x4520('0xe'));logger[_0x4520('0xf')](_0x4520('0x10'),_0x396d29,_0x4520('0xe'),JSON[_0x4520('0x11')](_0x168e62));if(_0x168e62[_0x4520('0x12')]){if(_0x168e62[_0x4520('0x12')][_0x4520('0x13')]===0x1f4){logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);return _0x55b44f(_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);}logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);return _0x27890f(_0x168e62['error'][_0x4520('0x14')]);}else{logger[_0x4520('0xc')](_0x4520('0xd'),_0x396d29,_0x4520('0xe'));_0x27890f(_0x168e62[_0x4520('0x15')]['message']);}})[_0x4520('0x16')](function(_0x33ac29){logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x33ac29);_0x55b44f(_0x33ac29);});});}exports[_0x4520('0x17')]=function(_0x2e00f4){var _0x1dcf51=this;return new Promise(function(_0x4ba69f,_0x3791b6){return db[_0x4520('0x18')][_0x4520('0x19')](_0x2e00f4[_0x4520('0x1a')],{'raw':_0x2e00f4['options']?_0x2e00f4[_0x4520('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4c46c5){logger[_0x4520('0xc')]('CreateSquareDetailsReport',_0x2e00f4);logger[_0x4520('0xf')](_0x4520('0x17'),_0x2e00f4,JSON[_0x4520('0x11')](_0x4c46c5));_0x4ba69f(_0x4c46c5);})['catch'](function(_0x3199a9){logger[_0x4520('0x12')](_0x4520('0x17'),_0x3199a9['message'],_0x2e00f4);_0x3791b6(_0x1dcf51[_0x4520('0x12')](0x1f4,_0x3199a9[_0x4520('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 6285996..bbf2fe4 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 _0x9691=['express','Router','../../components/auth/service','./system.controller','get','isAuthenticated','killProcess','exports'];(function(_0x777247,_0x2bf167){var _0xe313ee=function(_0xd96a21){while(--_0xd96a21){_0x777247['push'](_0x777247['shift']());}};_0xe313ee(++_0x2bf167);}(_0x9691,0xb8));var _0x1969=function(_0x3f6ffc,_0x28b10f){_0x3f6ffc=_0x3f6ffc-0x0;var _0x5f13ab=_0x9691[_0x3f6ffc];return _0x5f13ab;};'use strict';var express=require(_0x1969('0x0'));var router=express[_0x1969('0x1')]();var auth=require(_0x1969('0x2'));var controller=require(_0x1969('0x3'));router[_0x1969('0x4')]('/',auth[_0x1969('0x5')](),controller['index']);router[_0x1969('0x4')]('/process/:pid/kill',auth[_0x1969('0x5')](),controller[_0x1969('0x6')]);module[_0x1969('0x7')]=router; \ No newline at end of file +var _0xba2d=['Router','../../components/auth/service','get','index','/process/:pid/kill','killProcess','exports','express'];(function(_0x30aa48,_0x5cf0c9){var _0x35fc1f=function(_0x13e53e){while(--_0x13e53e){_0x30aa48['push'](_0x30aa48['shift']());}};_0x35fc1f(++_0x5cf0c9);}(_0xba2d,0x107));var _0xdba2=function(_0x3f491f,_0x3cd9bf){_0x3f491f=_0x3f491f-0x0;var _0x476114=_0xba2d[_0x3f491f];return _0x476114;};'use strict';var express=require(_0xdba2('0x0'));var router=express[_0xdba2('0x1')]();var auth=require(_0xdba2('0x2'));var controller=require('./system.controller');router[_0xdba2('0x3')]('/',auth['isAuthenticated'](),controller[_0xdba2('0x4')]);router[_0xdba2('0x3')](_0xdba2('0x5'),auth['isAuthenticated'](),controller[_0xdba2('0x6')]);module[_0xdba2('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index cbf6089..fd7988e 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 _0xe7f0=['pid','then','length','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','params','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','child_process','api','util','lodash','inspect','name','send','getAllData','json','status','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args'];(function(_0x6248f4,_0xf62fc3){var _0x37d2a1=function(_0x10ec31){while(--_0x10ec31){_0x6248f4['push'](_0x6248f4['shift']());}};_0x37d2a1(++_0xf62fc3);}(_0xe7f0,0x6b));var _0x0e7f=function(_0x24697b,_0x2eb072){_0x24697b=_0x24697b-0x0;var _0x585b99=_0xe7f0[_0x24697b];return _0x585b99;};'use strict';var info=require('systeminformation');var exec=require(_0x0e7f('0x0'))['exec'];var logger=require('../../config/logger')(_0x0e7f('0x1'));var util=require(_0x0e7f('0x2'));var BPromise=require('bluebird');var _=require(_0x0e7f('0x3'));function handleError(_0x2e4a12,_0x400935,_0x4c7899){_0x400935=_0x400935||0x1f4;return function(_0xfe4f3a){logger['error']('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x4c7899,_0x400935,util[_0x0e7f('0x4')](_0xfe4f3a,{'showHidden':![],'depth':null}));delete _0xfe4f3a[_0x0e7f('0x5')];_0x2e4a12['status'](_0x400935)[_0x0e7f('0x6')](_0xfe4f3a);};}exports['index']=function(_0x7fb911,_0x4246c1){return info[_0x0e7f('0x7')]()['then'](function(_0xb1b416){return _0x4246c1['status'](0xc8)[_0x0e7f('0x8')](_0xb1b416);})['catch'](function(_0x4668c8){return _0x4246c1[_0x0e7f('0x9')](0x1f4)[_0x0e7f('0x8')](_0x4668c8);});};exports[_0x0e7f('0xa')]=function(_0x13d974,_0x247394){var _0x2fa9d9=[_0x0e7f('0xb')];return new BPromise(function(_0x1ddd2c,_0x48998b){return exec(util['format'](_0x0e7f('0xc'),_0x13d974['params'][_0x0e7f('0xd')]),function(_0x4d2f1c,_0x9dfad2,_0x34a7de){if(_0x4d2f1c){return _0x48998b(_0x4d2f1c);}return _0x1ddd2c(_0x9dfad2);});})[_0x0e7f('0xe')](function(_0xdd993a){var _0xee93fd=![];var _0x2b0d6e=_0xdd993a['split'](/\n/);for(var _0xff1263=0x0,_0x1e7e11=_0x2fa9d9[_0x0e7f('0xf')];_0xff1263<_0x1e7e11,_0xee93fd===![];_0xff1263+=0x1){if(_0xdd993a[_0x0e7f('0x10')](_0x2fa9d9[_0xff1263])>=0x0){_0xee93fd=!![];}}if(!_0xee93fd){throw new Error(util[_0x0e7f('0x11')](_0x0e7f('0x12'),_0x13d974[_0x0e7f('0x13')][_0x0e7f('0xd')]));}process[_0x0e7f('0x14')](_0x13d974[_0x0e7f('0x13')][_0x0e7f('0xd')],_0x0e7f('0x15'));return _0x247394['status'](0xc8)[_0x0e7f('0x8')]({'message':util['format'](_0x0e7f('0x16'),_0x13d974['params'][_0x0e7f('0xd')])});})[_0x0e7f('0x17')](handleError(_0x247394,null,'killProcess'));}; \ No newline at end of file +var _0x4b76=['api','util','bluebird','lodash','error','inspect','name','status','send','index','then','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','json','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','../../config/logger'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x4b76,0x93));var _0x64b7=function(_0x45d4b6,_0x155e2e){_0x45d4b6=_0x45d4b6-0x0;var _0x2071fb=_0x4b76[_0x45d4b6];return _0x2071fb;};'use strict';var info=require(_0x64b7('0x0'));var exec=require(_0x64b7('0x1'))['exec'];var logger=require(_0x64b7('0x2'))(_0x64b7('0x3'));var util=require(_0x64b7('0x4'));var BPromise=require(_0x64b7('0x5'));var _=require(_0x64b7('0x6'));function handleError(_0x566bca,_0x40de11,_0x2e8525){_0x40de11=_0x40de11||0x1f4;return function(_0x423589){logger[_0x64b7('0x7')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x2e8525,_0x40de11,util[_0x64b7('0x8')](_0x423589,{'showHidden':![],'depth':null}));delete _0x423589[_0x64b7('0x9')];_0x566bca[_0x64b7('0xa')](_0x40de11)[_0x64b7('0xb')](_0x423589);};}exports[_0x64b7('0xc')]=function(_0x2b6e5e,_0x267880){return info['getAllData']()[_0x64b7('0xd')](function(_0x1b7a4c){return _0x267880[_0x64b7('0xa')](0xc8)['json'](_0x1b7a4c);})[_0x64b7('0xe')](function(_0x41afd0){return _0x267880['status'](0x1f4)['json'](_0x41afd0);});};exports[_0x64b7('0xf')]=function(_0x4a7f75,_0x1890bf){var _0x94c7c8=[_0x64b7('0x10')];return new BPromise(function(_0x2b3699,_0x32b5bf){return exec(util[_0x64b7('0x11')](_0x64b7('0x12'),_0x4a7f75[_0x64b7('0x13')][_0x64b7('0x14')]),function(_0x453f0c,_0x22cf8e,_0x287293){if(_0x453f0c){return _0x32b5bf(_0x453f0c);}return _0x2b3699(_0x22cf8e);});})[_0x64b7('0xd')](function(_0x59ed8e){var _0x6c04d2=![];var _0x2dad0b=_0x59ed8e['split'](/\n/);for(var _0x354259=0x0,_0x970f8b=_0x94c7c8['length'];_0x354259<_0x970f8b,_0x6c04d2===![];_0x354259+=0x1){if(_0x59ed8e['indexOf'](_0x94c7c8[_0x354259])>=0x0){_0x6c04d2=!![];}}if(!_0x6c04d2){throw new Error(util[_0x64b7('0x11')](_0x64b7('0x15'),_0x4a7f75[_0x64b7('0x13')][_0x64b7('0x14')]));}process[_0x64b7('0x16')](_0x4a7f75['params'][_0x64b7('0x14')],'SIGINT');return _0x1890bf[_0x64b7('0xa')](0xc8)[_0x64b7('0x17')]({'message':util[_0x64b7('0x11')](_0x64b7('0x18'),_0x4a7f75[_0x64b7('0x13')][_0x64b7('0x14')])});})[_0x64b7('0xe')](handleError(_0x1890bf,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index f8f1fa4..0311336 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 _0x204c=['get','index','/:id','show','isAuthenticated','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller'];(function(_0x1141e6,_0x40ef38){var _0x3c1ce9=function(_0x27dae3){while(--_0x27dae3){_0x1141e6['push'](_0x1141e6['shift']());}};_0x3c1ce9(++_0x40ef38);}(_0x204c,0xdc));var _0xc204=function(_0xe45eeb,_0x26db8f){_0xe45eeb=_0xe45eeb-0x0;var _0x43a793=_0x204c[_0xe45eeb];return _0x43a793;};'use strict';var multer=require(_0xc204('0x0'));var util=require(_0xc204('0x1'));var path=require(_0xc204('0x2'));var timeout=require(_0xc204('0x3'));var express=require(_0xc204('0x4'));var router=express[_0xc204('0x5')]();var fs_extra=require(_0xc204('0x6'));var auth=require(_0xc204('0x7'));var interaction=require(_0xc204('0x8'));var config=require(_0xc204('0x9'));var controller=require(_0xc204('0xa'));router[_0xc204('0xb')]('/',auth['isAuthenticated'](),controller[_0xc204('0xc')]);router[_0xc204('0xb')](_0xc204('0xd'),auth['isAuthenticated'](),controller[_0xc204('0xe')]);router['post']('/',auth[_0xc204('0xf')](),controller[_0xc204('0x10')]);router['put'](_0xc204('0xd'),auth[_0xc204('0xf')](),controller[_0xc204('0x11')]);router[_0xc204('0x12')](_0xc204('0xd'),auth['isAuthenticated'](),controller[_0xc204('0x13')]);module[_0xc204('0x14')]=router; \ No newline at end of file +var _0x332c=['../../components/interaction/service','get','isAuthenticated','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x2ad1b8,_0x1ea09b){var _0x52547d=function(_0x33b77c){while(--_0x33b77c){_0x2ad1b8['push'](_0x2ad1b8['shift']());}};_0x52547d(++_0x1ea09b);}(_0x332c,0x11b));var _0xc332=function(_0x585b8c,_0x4135bc){_0x585b8c=_0x585b8c-0x0;var _0x55b8b5=_0x332c[_0x585b8c];return _0x55b8b5;};'use strict';var multer=require(_0xc332('0x0'));var util=require(_0xc332('0x1'));var path=require(_0xc332('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc332('0x3')]();var fs_extra=require(_0xc332('0x4'));var auth=require(_0xc332('0x5'));var interaction=require(_0xc332('0x6'));var config=require('../../config/environment');var controller=require('./tag.controller');router[_0xc332('0x7')]('/',auth[_0xc332('0x8')](),controller['index']);router[_0xc332('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xc332('0x9')]);router[_0xc332('0xa')]('/',auth[_0xc332('0x8')](),controller['create']);router[_0xc332('0xb')](_0xc332('0xc'),auth[_0xc332('0x8')](),controller[_0xc332('0xd')]);router[_0xc332('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xc332('0xf')]);module[_0xc332('0x10')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index a0f63a8..db50459 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 _0x2f56=['#0091EA','sequelize','exports','STRING','name'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2f56,0xb5));var _0x62f5=function(_0x5669bf,_0x30ab44){_0x5669bf=_0x5669bf-0x0;var _0x32bd77=_0x2f56[_0x5669bf];return _0x32bd77;};'use strict';var Sequelize=require(_0x62f5('0x0'));module[_0x62f5('0x1')]={'name':{'type':Sequelize[_0x62f5('0x2')],'unique':_0x62f5('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x62f5('0x4')},'description':{'type':Sequelize[_0x62f5('0x2')]}}; \ No newline at end of file +var _0x0caf=['name','STRING','#0091EA'];(function(_0x30c95b,_0x5beb11){var _0xc5810c=function(_0x3b8809){while(--_0x3b8809){_0x30c95b['push'](_0x30c95b['shift']());}};_0xc5810c(++_0x5beb11);}(_0x0caf,0x9f));var _0xf0ca=function(_0x103eed,_0x23b241){_0x103eed=_0x103eed-0x0;var _0x173cac=_0x0caf[_0x103eed];return _0x173cac;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xf0ca('0x0'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xf0ca('0x1')],'defaultValue':_0xf0ca('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index a77fa0f..a03200a 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 _0xcea2=['find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','Tags','UserProfileResource','sendStatus','error','name','send','map','Tag','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','filters','include'];(function(_0x3d101a,_0x5baa96){var _0x465ef9=function(_0x3482b1){while(--_0x3482b1){_0x3d101a['push'](_0x3d101a['shift']());}};_0x465ef9(++_0x5baa96);}(_0xcea2,0x15a));var _0x2cea=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xcea2[_0x1d24eb];return _0x1dc576;};'use strict';var emlformat=require(_0x2cea('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2cea('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2cea('0x2'));var moment=require(_0x2cea('0x3'));var BPromise=require(_0x2cea('0x4'));var Mustache=require('mustache');var util=require(_0x2cea('0x5'));var path=require(_0x2cea('0x6'));var sox=require(_0x2cea('0x7'));var csv=require('to-csv');var ejs=require(_0x2cea('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2cea('0x9'));var squel=require(_0x2cea('0xa'));var crypto=require(_0x2cea('0xb'));var jsforce=require(_0x2cea('0xc'));var deskjs=require(_0x2cea('0xd'));var toCsv=require(_0x2cea('0xe'));var querystring=require('querystring');var Papa=require(_0x2cea('0xf'));var Redis=require(_0x2cea('0x10'));var authService=require(_0x2cea('0x11'));var qs=require(_0x2cea('0x12'));var as=require(_0x2cea('0x13'));var hardwareService=require(_0x2cea('0x14'));var logger=require(_0x2cea('0x15'))(_0x2cea('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2cea('0x17'));var db=require(_0x2cea('0x18'))['db'];function respondWithStatusCode(_0x528c1d,_0x4bd265){_0x4bd265=_0x4bd265||0xcc;return function(_0x160eaf){if(_0x160eaf){return _0x528c1d['sendStatus'](_0x4bd265);}return _0x528c1d[_0x2cea('0x19')](_0x4bd265)[_0x2cea('0x1a')]();};}function respondWithResult(_0x4377b1,_0x5cf805){_0x5cf805=_0x5cf805||0xc8;return function(_0x4d7f8b){if(_0x4d7f8b){return _0x4377b1['status'](_0x5cf805)[_0x2cea('0x1b')](_0x4d7f8b);}};}function respondWithFilteredResult(_0x586ad5,_0x3c7130){return function(_0x338669){if(_0x338669){var _0x981e3f=typeof _0x3c7130[_0x2cea('0x1c')]===_0x2cea('0x1d')&&typeof _0x3c7130[_0x2cea('0x1e')]===_0x2cea('0x1d');var _0x1ead4c=_0x338669['count'];var _0x19927a=_0x981e3f?0x0:_0x3c7130[_0x2cea('0x1c')];var _0x20c46c=_0x981e3f?_0x338669[_0x2cea('0x1f')]:_0x3c7130[_0x2cea('0x1c')]+_0x3c7130[_0x2cea('0x1e')];var _0x5d75c4;if(_0x20c46c>=_0x1ead4c){_0x20c46c=_0x1ead4c;_0x5d75c4=0xc8;}else{_0x5d75c4=0xce;}_0x586ad5[_0x2cea('0x19')](_0x5d75c4);return _0x586ad5['set'](_0x2cea('0x20'),_0x19927a+'-'+_0x20c46c+'/'+_0x1ead4c)[_0x2cea('0x1b')](_0x338669);}return null;};}function patchUpdates(_0xa73bea){return function(_0x4fd3d5){try{jsonpatch[_0x2cea('0x21')](_0x4fd3d5,_0xa73bea,!![]);}catch(_0x22249e){return BPromise[_0x2cea('0x22')](_0x22249e);}return _0x4fd3d5[_0x2cea('0x23')]();};}function saveUpdates(_0x3246bc,_0x3f6f0e){return function(_0x10f13a){if(_0x10f13a){return _0x10f13a['update'](_0x3246bc)[_0x2cea('0x24')](function(_0x5e5b46){return _0x5e5b46;});}return null;};}function removeEntity(_0x7d88b9,_0x4926ff){return function(_0x3966d5){if(_0x3966d5){return _0x3966d5[_0x2cea('0x25')]()['then'](function(){var _0x41d272=_0x3966d5[_0x2cea('0x26')]({'plain':!![]});var _0x101314=_0x2cea('0x27');return db[_0x2cea('0x28')][_0x2cea('0x25')]({'where':{'type':_0x101314,'resourceId':_0x41d272['id']}})['then'](function(){return _0x3966d5;});})[_0x2cea('0x24')](function(){_0x7d88b9[_0x2cea('0x19')](0xcc)[_0x2cea('0x1a')]();});}};}function handleEntityNotFound(_0x32af98,_0x46ef5a){return function(_0x3ea40c){if(!_0x3ea40c){_0x32af98[_0x2cea('0x29')](0x194);}return _0x3ea40c;};}function handleError(_0x2741cb,_0x4e9cab){_0x4e9cab=_0x4e9cab||0x1f4;return function(_0xff69ad){logger[_0x2cea('0x2a')](_0xff69ad['stack']);if(_0xff69ad[_0x2cea('0x2b')]){delete _0xff69ad[_0x2cea('0x2b')];}_0x2741cb[_0x2cea('0x19')](_0x4e9cab)[_0x2cea('0x2c')](_0xff69ad);};}exports['index']=function(_0x3c0066,_0x128934){var _0x4a51e5={},_0x2bf4e9={},_0x2e3d44={'count':0x0,'rows':[]};var _0xa8f660=_[_0x2cea('0x2d')](db[_0x2cea('0x2e')][_0x2cea('0x2f')],function(_0x10e7c5){return{'name':_0x10e7c5[_0x2cea('0x30')],'type':_0x10e7c5[_0x2cea('0x31')][_0x2cea('0x32')]};});_0x2bf4e9[_0x2cea('0x33')]=_['map'](_0xa8f660,_0x2cea('0x2b'));_0x2bf4e9[_0x2cea('0x34')]=_[_0x2cea('0x35')](_0x3c0066[_0x2cea('0x34')]);_0x2bf4e9['filters']=_['intersection'](_0x2bf4e9[_0x2cea('0x33')],_0x2bf4e9[_0x2cea('0x34')]);_0x4a51e5['attributes']=_[_0x2cea('0x36')](_0x2bf4e9['model'],qs[_0x2cea('0x37')](_0x3c0066['query'][_0x2cea('0x37')]));_0x4a51e5['attributes']=_0x4a51e5[_0x2cea('0x38')][_0x2cea('0x39')]?_0x4a51e5['attributes']:_0x2bf4e9[_0x2cea('0x33')];if(!_0x3c0066[_0x2cea('0x34')]['hasOwnProperty'](_0x2cea('0x3a'))){_0x4a51e5[_0x2cea('0x1e')]=qs[_0x2cea('0x1e')](_0x3c0066[_0x2cea('0x34')][_0x2cea('0x1e')]);_0x4a51e5['offset']=qs[_0x2cea('0x1c')](_0x3c0066[_0x2cea('0x34')]['offset']);}_0x4a51e5['order']=qs[_0x2cea('0x3b')](_0x3c0066['query']['sort']);_0x4a51e5['where']=qs['filters'](_[_0x2cea('0x3c')](_0x3c0066[_0x2cea('0x34')],_0x2bf4e9['filters']),_0xa8f660);if(_0x3c0066[_0x2cea('0x34')][_0x2cea('0x3d')]){_0x4a51e5[_0x2cea('0x3e')]=_['merge'](_0x4a51e5[_0x2cea('0x3e')],{'$or':_[_0x2cea('0x2d')](_0xa8f660,function(_0x352f60){if(_0x352f60[_0x2cea('0x31')]!==_0x2cea('0x3f')){var _0x2cb62b={};_0x2cb62b[_0x352f60[_0x2cea('0x2b')]]={'$like':'%'+_0x3c0066[_0x2cea('0x34')][_0x2cea('0x3d')]+'%'};return _0x2cb62b;}})});}_0x4a51e5=_[_0x2cea('0x40')]({},_0x4a51e5,_0x3c0066[_0x2cea('0x41')]);var _0x1516a2={'where':_0x4a51e5[_0x2cea('0x3e')]};return db[_0x2cea('0x2e')][_0x2cea('0x1f')](_0x1516a2)[_0x2cea('0x24')](function(_0x36efa8){_0x2e3d44[_0x2cea('0x1f')]=_0x36efa8;if(_0x3c0066['query'][_0x2cea('0x42')]){_0x4a51e5['include']=[{'all':!![]}];}return db[_0x2cea('0x2e')][_0x2cea('0x43')](_0x4a51e5);})[_0x2cea('0x24')](function(_0x5b5d71){_0x2e3d44[_0x2cea('0x44')]=_0x5b5d71;return _0x2e3d44;})[_0x2cea('0x24')](respondWithFilteredResult(_0x128934,_0x4a51e5))[_0x2cea('0x45')](handleError(_0x128934,null));};exports[_0x2cea('0x46')]=function(_0x608740,_0x2aba98){var _0x4ac055={'raw':!![],'where':{'id':_0x608740[_0x2cea('0x47')]['id']}},_0x515494={};_0x515494[_0x2cea('0x33')]=_['keys'](db[_0x2cea('0x2e')]['rawAttributes']);_0x515494[_0x2cea('0x34')]=_['keys'](_0x608740[_0x2cea('0x34')]);_0x515494[_0x2cea('0x48')]=_[_0x2cea('0x36')](_0x515494[_0x2cea('0x33')],_0x515494[_0x2cea('0x34')]);_0x4ac055[_0x2cea('0x38')]=_[_0x2cea('0x36')](_0x515494[_0x2cea('0x33')],qs[_0x2cea('0x37')](_0x608740[_0x2cea('0x34')]['fields']));_0x4ac055[_0x2cea('0x38')]=_0x4ac055[_0x2cea('0x38')][_0x2cea('0x39')]?_0x4ac055[_0x2cea('0x38')]:_0x515494['model'];if(_0x608740['query'][_0x2cea('0x42')]){_0x4ac055[_0x2cea('0x49')]=[{'all':!![]}];}_0x4ac055=_[_0x2cea('0x40')]({},_0x4ac055,_0x608740['options']);return db[_0x2cea('0x2e')][_0x2cea('0x4a')](_0x4ac055)[_0x2cea('0x24')](handleEntityNotFound(_0x2aba98,null))[_0x2cea('0x24')](respondWithResult(_0x2aba98,null))['catch'](handleError(_0x2aba98,null));};exports[_0x2cea('0x4b')]=function(_0x526e92,_0x4d1b77){return db[_0x2cea('0x2e')][_0x2cea('0x4b')](_0x526e92[_0x2cea('0x4c')],{})[_0x2cea('0x24')](function(_0x542c10){var _0x492fcf=_0x526e92[_0x2cea('0x4d')][_0x2cea('0x26')]({'plain':!![]});if(!_0x492fcf)throw new Error(_0x2cea('0x4e'));if(_0x492fcf[_0x2cea('0x4f')]==='user'){var _0x4ec462=_0x542c10['get']({'plain':!![]});var _0x31c559=_0x2cea('0x27');return db[_0x2cea('0x50')][_0x2cea('0x4a')]({'where':{'name':_0x31c559,'userProfileId':_0x492fcf[_0x2cea('0x51')]},'raw':!![]})[_0x2cea('0x24')](function(_0x1672f6){if(_0x1672f6&&_0x1672f6['autoAssociation']===0x0){return db[_0x2cea('0x28')][_0x2cea('0x4b')]({'name':_0x4ec462[_0x2cea('0x2b')],'resourceId':_0x4ec462['id'],'type':_0x1672f6['name'],'sectionId':_0x1672f6['id']},{})[_0x2cea('0x24')](function(){return _0x542c10;});}else{return _0x542c10;}})['catch'](function(_0x471147){logger[_0x2cea('0x2a')](_0x2cea('0x52'),_0x471147);throw _0x471147;});}return _0x542c10;})[_0x2cea('0x24')](respondWithResult(_0x4d1b77,0xc9))[_0x2cea('0x45')](handleError(_0x4d1b77,null));};exports[_0x2cea('0x53')]=function(_0x33f411,_0x326fb2){if(_0x33f411['body']['id']){delete _0x33f411[_0x2cea('0x4c')]['id'];}return db['Tag'][_0x2cea('0x4a')]({'where':{'id':_0x33f411[_0x2cea('0x47')]['id']}})[_0x2cea('0x24')](handleEntityNotFound(_0x326fb2,null))['then'](saveUpdates(_0x33f411[_0x2cea('0x4c')],null))['then'](respondWithResult(_0x326fb2,null))['catch'](handleError(_0x326fb2,null));};exports[_0x2cea('0x25')]=function(_0x21a525,_0x28e720){return db[_0x2cea('0x2e')][_0x2cea('0x4a')]({'where':{'id':_0x21a525['params']['id']}})['then'](handleEntityNotFound(_0x28e720,null))[_0x2cea('0x24')](removeEntity(_0x28e720,null))[_0x2cea('0x45')](handleError(_0x28e720,null));}; \ No newline at end of file +var _0x049e=['map','rawAttributes','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','Tag','includeAll','include','rows','catch','show','params','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','json','reject','save','update','then','Tags','destroy','end','error','stack','name','send','index'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x049e,0x16a));var _0xe049=function(_0x2bd88d,_0x2d5dc3){_0x2bd88d=_0x2bd88d-0x0;var _0x5516d4=_0x049e[_0x2bd88d];return _0x5516d4;};'use strict';var emlformat=require(_0xe049('0x0'));var rimraf=require(_0xe049('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe049('0x2'));var rp=require('request-promise');var moment=require(_0xe049('0x3'));var BPromise=require(_0xe049('0x4'));var Mustache=require(_0xe049('0x5'));var util=require(_0xe049('0x6'));var path=require(_0xe049('0x7'));var sox=require('sox');var csv=require(_0xe049('0x8'));var ejs=require(_0xe049('0x9'));var fs=require('fs');var fs_extra=require(_0xe049('0xa'));var _=require(_0xe049('0xb'));var squel=require(_0xe049('0xc'));var crypto=require(_0xe049('0xd'));var jsforce=require(_0xe049('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe049('0x8'));var querystring=require(_0xe049('0xf'));var Papa=require(_0xe049('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe049('0x11'));var as=require(_0xe049('0x12'));var hardwareService=require(_0xe049('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe049('0x14'));var licenseUtil=require(_0xe049('0x15'));var db=require(_0xe049('0x16'))['db'];function respondWithStatusCode(_0x359931,_0x301c7e){_0x301c7e=_0x301c7e||0xcc;return function(_0x1021e7){if(_0x1021e7){return _0x359931[_0xe049('0x17')](_0x301c7e);}return _0x359931[_0xe049('0x18')](_0x301c7e)['end']();};}function respondWithResult(_0x20c286,_0x3f4a57){_0x3f4a57=_0x3f4a57||0xc8;return function(_0x3924a4){if(_0x3924a4){return _0x20c286[_0xe049('0x18')](_0x3f4a57)['json'](_0x3924a4);}};}function respondWithFilteredResult(_0x3a539b,_0xcc35b6){return function(_0x5c90fd){if(_0x5c90fd){var _0x388be0=typeof _0xcc35b6[_0xe049('0x19')]==='undefined'&&typeof _0xcc35b6[_0xe049('0x1a')]===_0xe049('0x1b');var _0x5d435b=_0x5c90fd[_0xe049('0x1c')];var _0x54c303=_0x388be0?0x0:_0xcc35b6['offset'];var _0x3cbbeb=_0x388be0?_0x5c90fd['count']:_0xcc35b6['offset']+_0xcc35b6[_0xe049('0x1a')];var _0x1092ec;if(_0x3cbbeb>=_0x5d435b){_0x3cbbeb=_0x5d435b;_0x1092ec=0xc8;}else{_0x1092ec=0xce;}_0x3a539b['status'](_0x1092ec);return _0x3a539b['set'](_0xe049('0x1d'),_0x54c303+'-'+_0x3cbbeb+'/'+_0x5d435b)[_0xe049('0x1e')](_0x5c90fd);}return null;};}function patchUpdates(_0x1d2f5b){return function(_0x430421){try{jsonpatch['apply'](_0x430421,_0x1d2f5b,!![]);}catch(_0x572f29){return BPromise[_0xe049('0x1f')](_0x572f29);}return _0x430421[_0xe049('0x20')]();};}function saveUpdates(_0x572a80,_0x36a03b){return function(_0x3f14eb){if(_0x3f14eb){return _0x3f14eb[_0xe049('0x21')](_0x572a80)['then'](function(_0x197358){return _0x197358;});}return null;};}function removeEntity(_0x3b0f54,_0x4c7492){return function(_0x4848c9){if(_0x4848c9){return _0x4848c9['destroy']()[_0xe049('0x22')](function(){var _0x5954c0=_0x4848c9['get']({'plain':!![]});var _0x1aafd1=_0xe049('0x23');return db['UserProfileResource'][_0xe049('0x24')]({'where':{'type':_0x1aafd1,'resourceId':_0x5954c0['id']}})[_0xe049('0x22')](function(){return _0x4848c9;});})[_0xe049('0x22')](function(){_0x3b0f54[_0xe049('0x18')](0xcc)[_0xe049('0x25')]();});}};}function handleEntityNotFound(_0x1843b8,_0x5b0e64){return function(_0x50552d){if(!_0x50552d){_0x1843b8[_0xe049('0x17')](0x194);}return _0x50552d;};}function handleError(_0x542c7c,_0x38ff5b){_0x38ff5b=_0x38ff5b||0x1f4;return function(_0x495d33){logger[_0xe049('0x26')](_0x495d33[_0xe049('0x27')]);if(_0x495d33['name']){delete _0x495d33[_0xe049('0x28')];}_0x542c7c[_0xe049('0x18')](_0x38ff5b)[_0xe049('0x29')](_0x495d33);};}exports[_0xe049('0x2a')]=function(_0x4464b2,_0x4055fc){var _0x123d2e={},_0x44faff={},_0x4038f0={'count':0x0,'rows':[]};var _0x1a4b97=_[_0xe049('0x2b')](db['Tag'][_0xe049('0x2c')],function(_0x1e99c8){return{'name':_0x1e99c8['fieldName'],'type':_0x1e99c8['type']['key']};});_0x44faff['model']=_[_0xe049('0x2b')](_0x1a4b97,_0xe049('0x28'));_0x44faff[_0xe049('0x2d')]=_[_0xe049('0x2e')](_0x4464b2[_0xe049('0x2d')]);_0x44faff['filters']=_[_0xe049('0x2f')](_0x44faff[_0xe049('0x30')],_0x44faff[_0xe049('0x2d')]);_0x123d2e[_0xe049('0x31')]=_[_0xe049('0x2f')](_0x44faff['model'],qs[_0xe049('0x32')](_0x4464b2['query'][_0xe049('0x32')]));_0x123d2e['attributes']=_0x123d2e[_0xe049('0x31')][_0xe049('0x33')]?_0x123d2e[_0xe049('0x31')]:_0x44faff[_0xe049('0x30')];if(!_0x4464b2[_0xe049('0x2d')][_0xe049('0x34')](_0xe049('0x35'))){_0x123d2e[_0xe049('0x1a')]=qs[_0xe049('0x1a')](_0x4464b2[_0xe049('0x2d')][_0xe049('0x1a')]);_0x123d2e['offset']=qs[_0xe049('0x19')](_0x4464b2[_0xe049('0x2d')][_0xe049('0x19')]);}_0x123d2e[_0xe049('0x36')]=qs[_0xe049('0x37')](_0x4464b2[_0xe049('0x2d')][_0xe049('0x37')]);_0x123d2e[_0xe049('0x38')]=qs['filters'](_[_0xe049('0x39')](_0x4464b2[_0xe049('0x2d')],_0x44faff[_0xe049('0x3a')]),_0x1a4b97);if(_0x4464b2[_0xe049('0x2d')][_0xe049('0x3b')]){_0x123d2e[_0xe049('0x38')]=_[_0xe049('0x3c')](_0x123d2e[_0xe049('0x38')],{'$or':_[_0xe049('0x2b')](_0x1a4b97,function(_0x3d6a4b){if(_0x3d6a4b['type']!==_0xe049('0x3d')){var _0x176374={};_0x176374[_0x3d6a4b[_0xe049('0x28')]]={'$like':'%'+_0x4464b2['query'][_0xe049('0x3b')]+'%'};return _0x176374;}})});}_0x123d2e=_['merge']({},_0x123d2e,_0x4464b2['options']);var _0x19dbc4={'where':_0x123d2e['where']};return db[_0xe049('0x3e')][_0xe049('0x1c')](_0x19dbc4)[_0xe049('0x22')](function(_0xe4f184){_0x4038f0[_0xe049('0x1c')]=_0xe4f184;if(_0x4464b2['query'][_0xe049('0x3f')]){_0x123d2e[_0xe049('0x40')]=[{'all':!![]}];}return db['Tag']['findAll'](_0x123d2e);})[_0xe049('0x22')](function(_0x20d264){_0x4038f0[_0xe049('0x41')]=_0x20d264;return _0x4038f0;})[_0xe049('0x22')](respondWithFilteredResult(_0x4055fc,_0x123d2e))[_0xe049('0x42')](handleError(_0x4055fc,null));};exports[_0xe049('0x43')]=function(_0x56a309,_0x1a4707){var _0x3f92ee={'raw':!![],'where':{'id':_0x56a309[_0xe049('0x44')]['id']}},_0x5c04f6={};_0x5c04f6[_0xe049('0x30')]=_[_0xe049('0x2e')](db[_0xe049('0x3e')][_0xe049('0x2c')]);_0x5c04f6['query']=_['keys'](_0x56a309[_0xe049('0x2d')]);_0x5c04f6[_0xe049('0x3a')]=_[_0xe049('0x2f')](_0x5c04f6[_0xe049('0x30')],_0x5c04f6[_0xe049('0x2d')]);_0x3f92ee[_0xe049('0x31')]=_['intersection'](_0x5c04f6[_0xe049('0x30')],qs[_0xe049('0x32')](_0x56a309['query'][_0xe049('0x32')]));_0x3f92ee['attributes']=_0x3f92ee[_0xe049('0x31')]['length']?_0x3f92ee[_0xe049('0x31')]:_0x5c04f6['model'];if(_0x56a309[_0xe049('0x2d')][_0xe049('0x3f')]){_0x3f92ee[_0xe049('0x40')]=[{'all':!![]}];}_0x3f92ee=_[_0xe049('0x3c')]({},_0x3f92ee,_0x56a309[_0xe049('0x45')]);return db['Tag'][_0xe049('0x46')](_0x3f92ee)[_0xe049('0x22')](handleEntityNotFound(_0x1a4707,null))[_0xe049('0x22')](respondWithResult(_0x1a4707,null))[_0xe049('0x42')](handleError(_0x1a4707,null));};exports[_0xe049('0x47')]=function(_0x3c15a2,_0x12f9b8){return db[_0xe049('0x3e')][_0xe049('0x47')](_0x3c15a2['body'],{})['then'](function(_0x478387){var _0xd1beaf=_0x3c15a2[_0xe049('0x48')][_0xe049('0x49')]({'plain':!![]});if(!_0xd1beaf)throw new Error(_0xe049('0x4a'));if(_0xd1beaf[_0xe049('0x4b')]===_0xe049('0x48')){var _0x2e4dce=_0x478387[_0xe049('0x49')]({'plain':!![]});var _0x23da27=_0xe049('0x23');return db['UserProfileSection'][_0xe049('0x46')]({'where':{'name':_0x23da27,'userProfileId':_0xd1beaf[_0xe049('0x4c')]},'raw':!![]})[_0xe049('0x22')](function(_0x4710ae){if(_0x4710ae&&_0x4710ae[_0xe049('0x4d')]===0x0){return db[_0xe049('0x4e')][_0xe049('0x47')]({'name':_0x2e4dce['name'],'resourceId':_0x2e4dce['id'],'type':_0x4710ae['name'],'sectionId':_0x4710ae['id']},{})['then'](function(){return _0x478387;});}else{return _0x478387;}})[_0xe049('0x42')](function(_0x2e508e){logger['error'](_0xe049('0x4f'),_0x2e508e);throw _0x2e508e;});}return _0x478387;})[_0xe049('0x22')](respondWithResult(_0x12f9b8,0xc9))[_0xe049('0x42')](handleError(_0x12f9b8,null));};exports[_0xe049('0x21')]=function(_0x4c3ba3,_0x5b0155){if(_0x4c3ba3[_0xe049('0x50')]['id']){delete _0x4c3ba3[_0xe049('0x50')]['id'];}return db['Tag']['find']({'where':{'id':_0x4c3ba3[_0xe049('0x44')]['id']}})['then'](handleEntityNotFound(_0x5b0155,null))[_0xe049('0x22')](saveUpdates(_0x4c3ba3[_0xe049('0x50')],null))['then'](respondWithResult(_0x5b0155,null))[_0xe049('0x42')](handleError(_0x5b0155,null));};exports['destroy']=function(_0x356605,_0x3ec963){return db['Tag'][_0xe049('0x46')]({'where':{'id':_0x356605[_0xe049('0x44')]['id']}})[_0xe049('0x22')](handleEntityNotFound(_0x3ec963,null))[_0xe049('0x22')](removeEntity(_0x3ec963,null))[_0xe049('0x42')](handleError(_0x3ec963,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 6567f49..90f741c 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 _0xf268=['util','api','moment','bluebird','request-promise','path','rimraf','exports','define','Tag','tools_tags'];(function(_0xe41747,_0x38dd11){var _0x52cd98=function(_0x9bb4a1){while(--_0x9bb4a1){_0xe41747['push'](_0xe41747['shift']());}};_0x52cd98(++_0x38dd11);}(_0xf268,0x11e));var _0x8f26=function(_0x1598e8,_0x5df7a7){_0x1598e8=_0x1598e8-0x0;var _0x1f71da=_0xf268[_0x1598e8];return _0x1f71da;};'use strict';var _=require('lodash');var util=require(_0x8f26('0x0'));var logger=require('../../config/logger')(_0x8f26('0x1'));var moment=require(_0x8f26('0x2'));var BPromise=require(_0x8f26('0x3'));var rp=require(_0x8f26('0x4'));var fs=require('fs');var path=require(_0x8f26('0x5'));var rimraf=require(_0x8f26('0x6'));var config=require('../../config/environment');var attributes=require('./tag.attributes');module[_0x8f26('0x7')]=function(_0x1a7a9d,_0x4525c7){return _0x1a7a9d[_0x8f26('0x8')](_0x8f26('0x9'),attributes,{'tableName':_0x8f26('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff96=['path','rimraf','../../config/environment','./tag.attributes','exports','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4c6425,_0x90e303){var _0x1849ef=function(_0x138ce9){while(--_0x138ce9){_0x4c6425['push'](_0x4c6425['shift']());}};_0x1849ef(++_0x90e303);}(_0xff96,0x179));var _0x6ff9=function(_0x34a459,_0x136cd9){_0x34a459=_0x34a459-0x0;var _0x500f8b=_0xff96[_0x34a459];return _0x500f8b;};'use strict';var _=require(_0x6ff9('0x0'));var util=require(_0x6ff9('0x1'));var logger=require(_0x6ff9('0x2'))(_0x6ff9('0x3'));var moment=require(_0x6ff9('0x4'));var BPromise=require(_0x6ff9('0x5'));var rp=require(_0x6ff9('0x6'));var fs=require('fs');var path=require(_0x6ff9('0x7'));var rimraf=require(_0x6ff9('0x8'));var config=require(_0x6ff9('0x9'));var attributes=require(_0x6ff9('0xa'));module[_0x6ff9('0xb')]=function(_0x4adb77,_0x3efaff){return _0x4adb77['define']('Tag',attributes,{'tableName':'tools_tags','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 daee06e..d7b903c 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 _0xaa7c=['debug','stringify','error','code','message','catch','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Tag,\x20%s,\x20%s','request\x20sent'];(function(_0x56b285,_0x4449a2){var _0x261f91=function(_0x2e02e7){while(--_0x2e02e7){_0x56b285['push'](_0x56b285['shift']());}};_0x261f91(++_0x4449a2);}(_0xaa7c,0x1ec));var _0xcaa7=function(_0x195059,_0x24d7ec){_0x195059=_0x195059-0x0;var _0x5e9b1d=_0xaa7c[_0x195059];return _0x5e9b1d;};'use strict';var _=require(_0xcaa7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcaa7('0x1'));var db=require(_0xcaa7('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xcaa7('0x3'))(_0xcaa7('0x4'));var config=require(_0xcaa7('0x5'));var jayson=require(_0xcaa7('0x6'));var client=jayson[_0xcaa7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b9df0,_0x5bd940,_0x55f6a4){return new BPromise(function(_0x4e4fc1,_0x126043){return client[_0xcaa7('0x8')](_0x4b9df0,_0x55f6a4)['then'](function(_0x20cd40){logger[_0xcaa7('0x9')](_0xcaa7('0xa'),_0x5bd940,_0xcaa7('0xb'));logger[_0xcaa7('0xc')]('Tag,\x20%s,\x20%s,\x20%s',_0x5bd940,_0xcaa7('0xb'),JSON[_0xcaa7('0xd')](_0x20cd40));if(_0x20cd40[_0xcaa7('0xe')]){if(_0x20cd40[_0xcaa7('0xe')][_0xcaa7('0xf')]===0x1f4){logger[_0xcaa7('0xe')]('Tag,\x20%s,\x20%s',_0x5bd940,_0x20cd40[_0xcaa7('0xe')][_0xcaa7('0x10')]);return _0x126043(_0x20cd40[_0xcaa7('0xe')][_0xcaa7('0x10')]);}logger[_0xcaa7('0xe')](_0xcaa7('0xa'),_0x5bd940,_0x20cd40[_0xcaa7('0xe')]['message']);return _0x4e4fc1(_0x20cd40['error'][_0xcaa7('0x10')]);}else{logger[_0xcaa7('0x9')](_0xcaa7('0xa'),_0x5bd940,_0xcaa7('0xb'));_0x4e4fc1(_0x20cd40['result'][_0xcaa7('0x10')]);}})[_0xcaa7('0x11')](function(_0x23c8f3){logger[_0xcaa7('0xe')](_0xcaa7('0xa'),_0x5bd940,_0x23c8f3);_0x126043(_0x23c8f3);});});} \ No newline at end of file +var _0x4944=['code','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Tag,\x20%s,\x20%s','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x33aae2,_0x58c8f0){var _0x3a65d7=function(_0x30cfa3){while(--_0x30cfa3){_0x33aae2['push'](_0x33aae2['shift']());}};_0x3a65d7(++_0x58c8f0);}(_0x4944,0x6d));var _0x4494=function(_0x2446c0,_0x46d9c8){_0x2446c0=_0x2446c0-0x0;var _0x5d34d7=_0x4944[_0x2446c0];return _0x5d34d7;};'use strict';var _=require(_0x4494('0x0'));var util=require('util');var moment=require(_0x4494('0x1'));var BPromise=require(_0x4494('0x2'));var rs=require(_0x4494('0x3'));var fs=require('fs');var Redis=require(_0x4494('0x4'));var db=require(_0x4494('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4494('0x6'))('rpc');var config=require(_0x4494('0x7'));var jayson=require(_0x4494('0x8'));var client=jayson[_0x4494('0x9')][_0x4494('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a4911,_0x1a94d6,_0x55bb81){return new BPromise(function(_0x12ef8e,_0x21098c){return client['request'](_0x2a4911,_0x55bb81)[_0x4494('0xb')](function(_0xec1762){logger[_0x4494('0xc')](_0x4494('0xd'),_0x1a94d6,'request\x20sent');logger['debug'](_0x4494('0xe'),_0x1a94d6,_0x4494('0xf'),JSON[_0x4494('0x10')](_0xec1762));if(_0xec1762['error']){if(_0xec1762['error'][_0x4494('0x11')]===0x1f4){logger[_0x4494('0x12')](_0x4494('0xd'),_0x1a94d6,_0xec1762[_0x4494('0x12')][_0x4494('0x13')]);return _0x21098c(_0xec1762[_0x4494('0x12')]['message']);}logger[_0x4494('0x12')](_0x4494('0xd'),_0x1a94d6,_0xec1762[_0x4494('0x12')][_0x4494('0x13')]);return _0x12ef8e(_0xec1762[_0x4494('0x12')][_0x4494('0x13')]);}else{logger[_0x4494('0xc')]('Tag,\x20%s,\x20%s',_0x1a94d6,_0x4494('0xf'));_0x12ef8e(_0xec1762['result']['message']);}})[_0x4494('0x14')](function(_0x267d0b){logger['error']('Tag,\x20%s,\x20%s',_0x1a94d6,_0x267d0b);_0x21098c(_0x267d0b);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index c4f090e..92068d3 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(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 1fe271a..a39fe9c 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','sequelize','STRING'];(function(_0x2250ea,_0x145a8c){var _0x1e84db=function(_0x4d8714){while(--_0x4d8714){_0x2250ea['push'](_0x2250ea['shift']());}};_0x1e84db(++_0x145a8c);}(_0xb10b,0x12a));var _0xbb10=function(_0xf37717,_0x5afacc){_0xf37717=_0xf37717-0x0;var _0x992835=_0xb10b[_0xf37717];return _0x992835;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0x757a=['exports','STRING'];(function(_0x4ef058,_0x3395ae){var _0x25248a=function(_0xaa42cd){while(--_0xaa42cd){_0x4ef058['push'](_0x4ef058['shift']());}};_0x25248a(++_0x3395ae);}(_0x757a,0xde));var _0xa757=function(_0x38afa1,_0x3c03b4){_0x38afa1=_0x38afa1-0x0;var _0x5d0318=_0x757a[_0x38afa1];return _0x5d0318;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 8555f95..db0186a 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 _0x045d=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','findAll','rows','show','params','includeAll','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','VoiceQueueId','UserVoiceQueue','MailQueueId','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','UserProfileResource','getQueues','findOne','channel','isValidChannel','ValidationError','capitalize','toLowerCase','Queues','Unknown\x20channel','add','ids','removeQueues','remove','addAgents','isArray','Voice','Chat','Mail','Sms','Whatsapp','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','online','voicePause','upsert','isNil','interface','format','SIP/%s','all','TeamVoicePrefix','removeAgents','Fax','Openchannel','Queue:remove','UserVoiceQueueRt','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./team.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','error','stack','name','send','map','Team'];(function(_0x5d838d,_0x55149c){var _0x1793ff=function(_0x10e2db){while(--_0x10e2db){_0x5d838d['push'](_0x5d838d['shift']());}};_0x1793ff(++_0x55149c);}(_0x045d,0x102));var _0xd045=function(_0x137960,_0x4c26aa){_0x137960=_0x137960-0x0;var _0x3c6672=_0x045d[_0x137960];return _0x3c6672;};'use strict';var emlformat=require(_0xd045('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd045('0x1'));var jsonpatch=require(_0xd045('0x2'));var rp=require(_0xd045('0x3'));var moment=require(_0xd045('0x4'));var BPromise=require(_0xd045('0x5'));var Mustache=require(_0xd045('0x6'));var util=require(_0xd045('0x7'));var path=require(_0xd045('0x8'));var sox=require(_0xd045('0x9'));var csv=require(_0xd045('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd045('0xb'));var squel=require(_0xd045('0xc'));var crypto=require(_0xd045('0xd'));var jsforce=require(_0xd045('0xe'));var deskjs=require(_0xd045('0xf'));var toCsv=require(_0xd045('0xa'));var querystring=require(_0xd045('0x10'));var Papa=require(_0xd045('0x11'));var Redis=require(_0xd045('0x12'));var authService=require(_0xd045('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xd045('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd045('0x15'))(_0xd045('0x16'));var utils=require(_0xd045('0x17'));var config=require(_0xd045('0x18'));var licenseUtil=require(_0xd045('0x19'));var db=require(_0xd045('0x1a'))['db'];config[_0xd045('0x1b')]=_['defaults'](config[_0xd045('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xd045('0x1c'))(new Redis(config[_0xd045('0x1b')]));require(_0xd045('0x1d'))[_0xd045('0x1e')](socket);function respondWithStatusCode(_0xbc70d2,_0x3345ac){_0x3345ac=_0x3345ac||0xcc;return function(_0x28b5d8){if(_0x28b5d8){return _0xbc70d2[_0xd045('0x1f')](_0x3345ac);}return _0xbc70d2['status'](_0x3345ac)[_0xd045('0x20')]();};}function respondWithResult(_0x139107,_0x288d05){_0x288d05=_0x288d05||0xc8;return function(_0x39da16){if(_0x39da16){return _0x139107[_0xd045('0x21')](_0x288d05)[_0xd045('0x22')](_0x39da16);}};}function respondWithFilteredResult(_0x51284f,_0x401b2a){return function(_0x5b93bf){if(_0x5b93bf){var _0x50b758=typeof _0x401b2a[_0xd045('0x23')]===_0xd045('0x24')&&typeof _0x401b2a[_0xd045('0x25')]==='undefined';var _0x1c4751=_0x5b93bf[_0xd045('0x26')];var _0x5c07d0=_0x50b758?0x0:_0x401b2a[_0xd045('0x23')];var _0x54f520=_0x50b758?_0x5b93bf[_0xd045('0x26')]:_0x401b2a[_0xd045('0x23')]+_0x401b2a['limit'];var _0x131a21;if(_0x54f520>=_0x1c4751){_0x54f520=_0x1c4751;_0x131a21=0xc8;}else{_0x131a21=0xce;}_0x51284f[_0xd045('0x21')](_0x131a21);return _0x51284f['set'](_0xd045('0x27'),_0x5c07d0+'-'+_0x54f520+'/'+_0x1c4751)[_0xd045('0x22')](_0x5b93bf);}return null;};}function patchUpdates(_0x5f45db){return function(_0x403e64){try{jsonpatch[_0xd045('0x28')](_0x403e64,_0x5f45db,!![]);}catch(_0x410daa){return BPromise['reject'](_0x410daa);}return _0x403e64[_0xd045('0x29')]();};}function saveUpdates(_0x55b3b8,_0x3b82f9){return function(_0x477322){if(_0x477322){return _0x477322[_0xd045('0x2a')](_0x55b3b8)[_0xd045('0x2b')](function(_0x535db8){return _0x535db8;});}return null;};}function handleEntityNotFound(_0x39bb2c,_0x4ce538){return function(_0x157f4b){if(!_0x157f4b){_0x39bb2c[_0xd045('0x1f')](0x194);}return _0x157f4b;};}function handleError(_0x279b51,_0x1810f5){_0x1810f5=_0x1810f5||0x1f4;return function(_0x3738ae){logger[_0xd045('0x2c')](_0x3738ae[_0xd045('0x2d')]);if(_0x3738ae[_0xd045('0x2e')]){delete _0x3738ae['name'];}_0x279b51[_0xd045('0x21')](_0x1810f5)[_0xd045('0x2f')](_0x3738ae);};}exports['index']=function(_0x899fd5,_0xf8054a){var _0x515389={},_0x55db74={},_0x340edc={'count':0x0,'rows':[]};var _0x52022b=_[_0xd045('0x30')](db[_0xd045('0x31')][_0xd045('0x32')],function(_0x121e9e){return{'name':_0x121e9e[_0xd045('0x33')],'type':_0x121e9e[_0xd045('0x34')][_0xd045('0x35')]};});_0x55db74[_0xd045('0x36')]=_[_0xd045('0x30')](_0x52022b,'name');_0x55db74[_0xd045('0x37')]=_[_0xd045('0x38')](_0x899fd5['query']);_0x55db74[_0xd045('0x39')]=_[_0xd045('0x3a')](_0x55db74['model'],_0x55db74[_0xd045('0x37')]);_0x515389[_0xd045('0x3b')]=_['intersection'](_0x55db74['model'],qs[_0xd045('0x3c')](_0x899fd5[_0xd045('0x37')][_0xd045('0x3c')]));_0x515389['attributes']=_0x515389[_0xd045('0x3b')][_0xd045('0x3d')]?_0x515389[_0xd045('0x3b')]:_0x55db74[_0xd045('0x36')];if(!_0x899fd5[_0xd045('0x37')][_0xd045('0x3e')](_0xd045('0x3f'))){_0x515389[_0xd045('0x25')]=qs[_0xd045('0x25')](_0x899fd5[_0xd045('0x37')]['limit']);_0x515389[_0xd045('0x23')]=qs[_0xd045('0x23')](_0x899fd5[_0xd045('0x37')][_0xd045('0x23')]);}_0x515389[_0xd045('0x40')]=qs[_0xd045('0x41')](_0x899fd5[_0xd045('0x37')]['sort']);_0x515389[_0xd045('0x42')]=qs[_0xd045('0x39')](_[_0xd045('0x43')](_0x899fd5[_0xd045('0x37')],_0x55db74['filters']),_0x52022b);if(_0x899fd5[_0xd045('0x37')]['filter']){_0x515389[_0xd045('0x42')]=_[_0xd045('0x44')](_0x515389[_0xd045('0x42')],{'$or':_[_0xd045('0x30')](_0x52022b,function(_0x264060){if(_0x264060[_0xd045('0x34')]!=='VIRTUAL'){var _0x1c5acb={};_0x1c5acb[_0x264060[_0xd045('0x2e')]]={'$like':'%'+_0x899fd5['query'][_0xd045('0x45')]+'%'};return _0x1c5acb;}})});}_0x515389=_['merge']({},_0x515389,_0x899fd5['options']);var _0x554ab9={'where':_0x515389[_0xd045('0x42')]};return db[_0xd045('0x31')][_0xd045('0x26')](_0x554ab9)[_0xd045('0x2b')](function(_0x5108c5){_0x340edc[_0xd045('0x26')]=_0x5108c5;if(_0x899fd5[_0xd045('0x37')]['includeAll']){_0x515389['include']=[{'all':!![]}];}return db[_0xd045('0x31')][_0xd045('0x46')](_0x515389);})[_0xd045('0x2b')](function(_0x394aad){_0x340edc[_0xd045('0x47')]=_0x394aad;return _0x340edc;})['then'](respondWithFilteredResult(_0xf8054a,_0x515389))['catch'](handleError(_0xf8054a,null));};exports[_0xd045('0x48')]=function(_0x42e89d,_0x5f4988){var _0x322a7e={'raw':![],'where':{'id':_0x42e89d[_0xd045('0x49')]['id']}},_0x25efca={};_0x25efca[_0xd045('0x36')]=_['keys'](db['Team'][_0xd045('0x32')]);_0x25efca[_0xd045('0x37')]=_[_0xd045('0x38')](_0x42e89d[_0xd045('0x37')]);_0x25efca[_0xd045('0x39')]=_[_0xd045('0x3a')](_0x25efca['model'],_0x25efca[_0xd045('0x37')]);_0x322a7e[_0xd045('0x3b')]=_['intersection'](_0x25efca['model'],qs['fields'](_0x42e89d[_0xd045('0x37')][_0xd045('0x3c')]));_0x322a7e['attributes']=_0x322a7e[_0xd045('0x3b')]['length']?_0x322a7e[_0xd045('0x3b')]:_0x25efca[_0xd045('0x36')];if(_0x42e89d[_0xd045('0x37')][_0xd045('0x4a')]){_0x322a7e[_0xd045('0x4b')]=[{'all':!![]}];}_0x322a7e=_['merge']({},_0x322a7e,_0x42e89d[_0xd045('0x4c')]);return db['Team'][_0xd045('0x4d')](_0x322a7e)['then'](handleEntityNotFound(_0x5f4988,null))[_0xd045('0x2b')](respondWithResult(_0x5f4988,null))['catch'](handleError(_0x5f4988,null));};exports[_0xd045('0x4e')]=function(_0x1b5e3a,_0x5896cb){return db[_0xd045('0x31')]['create'](_0x1b5e3a[_0xd045('0x4f')],{})[_0xd045('0x2b')](function(_0x34ba0e){var _0x511687=_0x1b5e3a[_0xd045('0x50')][_0xd045('0x51')]({'plain':!![]});if(!_0x511687)throw new Error(_0xd045('0x52'));if(_0x511687[_0xd045('0x53')]===_0xd045('0x50')){var _0x3ef11a=_0x34ba0e[_0xd045('0x51')]({'plain':!![]});var _0xea6a88=_0xd045('0x54');return db[_0xd045('0x55')][_0xd045('0x4d')]({'where':{'name':_0xea6a88,'userProfileId':_0x511687['userProfileId']},'raw':!![]})[_0xd045('0x2b')](function(_0x4895da){if(_0x4895da&&_0x4895da[_0xd045('0x56')]===0x0){return db['UserProfileResource'][_0xd045('0x4e')]({'name':_0x3ef11a[_0xd045('0x2e')],'resourceId':_0x3ef11a['id'],'type':_0x4895da[_0xd045('0x2e')],'sectionId':_0x4895da['id']},{})[_0xd045('0x2b')](function(){return _0x34ba0e;});}else{return _0x34ba0e;}})[_0xd045('0x57')](function(_0x24cc8c){logger['error'](_0xd045('0x58'),_0x24cc8c);throw _0x24cc8c;});}return _0x34ba0e;})['then'](respondWithResult(_0x5896cb,0xc9))[_0xd045('0x57')](handleError(_0x5896cb,null));};exports['update']=function(_0x77d44d,_0x314387){if(_0x77d44d[_0xd045('0x4f')]['id']){delete _0x77d44d[_0xd045('0x4f')]['id'];}return db['Team'][_0xd045('0x4d')]({'where':{'id':_0x77d44d[_0xd045('0x49')]['id']}})['then'](handleEntityNotFound(_0x314387,null))['then'](saveUpdates(_0x77d44d[_0xd045('0x4f')],null))['then'](respondWithResult(_0x314387,null))['catch'](handleError(_0x314387,null));};exports[_0xd045('0x59')]=function(_0x3b3fed,_0x239ccd){var _0x5e9e46=_0x3b3fed[_0xd045('0x49')]['id'];var _0x103e13=[];return db[_0xd045('0x5a')][_0xd045('0x5b')](function(_0x1f2133){var _0x480e7d=_0xd045('0x5c')+_0x5e9e46;return db[_0xd045('0x5a')]['query'](_0x480e7d,{'type':db[_0xd045('0x5d')][_0xd045('0x5e')][_0xd045('0x5f')],'raw':!![],'transaction':_0x1f2133})[_0xd045('0x2b')](function(_0x31598e){_0x103e13=_[_0xd045('0x30')](_0x31598e,function(_0x17e141){return Number(_0x17e141['UserId']);});})['then'](function(){var _0x130fee='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5e9e46;return db[_0xd045('0x5a')][_0xd045('0x37')](_0x130fee,{'type':db[_0xd045('0x5d')]['QueryTypes'][_0xd045('0x5f')],'raw':!![],'transaction':_0x1f2133});})[_0xd045('0x2b')](function(_0x335883){var _0x404315=_[_0xd045('0x30')](_0x335883,function(_0x690018){return Number(_0x690018[_0xd045('0x60')]);});return db[_0xd045('0x61')][_0xd045('0x59')]({'where':{'UserId':{'$in':_0x103e13},'VoiceQueueId':{'$in':_0x404315}},'transaction':_0x1f2133});})['then'](function(){var _0x31903c='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5e9e46;return db[_0xd045('0x5a')][_0xd045('0x37')](_0x31903c,{'type':db[_0xd045('0x5d')][_0xd045('0x5e')][_0xd045('0x5f')],'raw':!![],'transaction':_0x1f2133});})[_0xd045('0x2b')](function(_0x2a4e28){var _0x27a976=_[_0xd045('0x30')](_0x2a4e28,function(_0x582574){return Number(_0x582574[_0xd045('0x62')]);});return db['UserMailQueue'][_0xd045('0x59')]({'where':{'UserId':{'$in':_0x103e13},'MailQueueId':{'$in':_0x27a976}},'transaction':_0x1f2133});})[_0xd045('0x2b')](function(){var _0x5658c1='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5e9e46;return db['sequelize']['query'](_0x5658c1,{'type':db[_0xd045('0x5d')][_0xd045('0x5e')][_0xd045('0x5f')],'raw':!![],'transaction':_0x1f2133});})[_0xd045('0x2b')](function(_0x4ed13e){var _0x54bb4a=_[_0xd045('0x30')](_0x4ed13e,function(_0x20f216){return Number(_0x20f216[_0xd045('0x63')]);});return db[_0xd045('0x64')][_0xd045('0x59')]({'where':{'UserId':{'$in':_0x103e13},'SmsQueueId':{'$in':_0x54bb4a}},'transaction':_0x1f2133});})[_0xd045('0x2b')](function(){var _0x2894d1=_0xd045('0x65')+_0x5e9e46;return db['sequelize'][_0xd045('0x37')](_0x2894d1,{'type':db['Sequelize'][_0xd045('0x5e')]['SELECT'],'raw':!![],'transaction':_0x1f2133});})[_0xd045('0x2b')](function(_0x358be2){var _0x27f468=_[_0xd045('0x30')](_0x358be2,function(_0xf206e2){return Number(_0xf206e2[_0xd045('0x66')]);});return db[_0xd045('0x67')]['destroy']({'where':{'UserId':{'$in':_0x103e13},'ChatQueueId':{'$in':_0x27f468}},'transaction':_0x1f2133});})['then'](function(){var _0xcd9ff5=_0xd045('0x68')+_0x5e9e46;return db[_0xd045('0x5a')]['query'](_0xcd9ff5,{'type':db[_0xd045('0x5d')][_0xd045('0x5e')][_0xd045('0x5f')],'raw':!![],'transaction':_0x1f2133});})['then'](function(_0x37a1a2){var _0x344292=_[_0xd045('0x30')](_0x37a1a2,function(_0x3c7610){return Number(_0x3c7610[_0xd045('0x69')]);});return db['UserFaxQueue'][_0xd045('0x59')]({'where':{'UserId':{'$in':_0x103e13},'FaxQueueId':{'$in':_0x344292}},'transaction':_0x1f2133});})[_0xd045('0x2b')](function(){var _0x154c02=_0xd045('0x6a')+_0x5e9e46;return db[_0xd045('0x5a')]['query'](_0x154c02,{'type':db[_0xd045('0x5d')]['QueryTypes'][_0xd045('0x5f')],'raw':!![],'transaction':_0x1f2133});})[_0xd045('0x2b')](function(_0x32e994){var _0x28ed1a=_[_0xd045('0x30')](_0x32e994,function(_0x3e0317){return Number(_0x3e0317['OpenchannelQueueId']);});return db[_0xd045('0x6b')][_0xd045('0x59')]({'where':{'UserId':{'$in':_0x103e13},'OpenchannelQueueId':{'$in':_0x28ed1a}},'transaction':_0x1f2133});})[_0xd045('0x2b')](function(){var _0x5d2158='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5e9e46;return db[_0xd045('0x5a')][_0xd045('0x37')](_0x5d2158,{'type':db[_0xd045('0x5d')][_0xd045('0x5e')][_0xd045('0x5f')],'raw':!![],'transaction':_0x1f2133});})['then'](function(_0xa6ca66){var _0x4e5843=_['map'](_0xa6ca66,function(_0x2caffc){return Number(_0x2caffc[_0xd045('0x6c')]);});return db[_0xd045('0x6d')][_0xd045('0x59')]({'where':{'UserId':{'$in':_0x103e13},'WhatsappQueueId':{'$in':_0x4e5843}},'transaction':_0x1f2133});})[_0xd045('0x2b')](function(){return db['TeamVoicePrefix'][_0xd045('0x4d')]({'where':{'TeamId':_0x5e9e46}});})[_0xd045('0x2b')](function(_0x22affd){if(_0x22affd===null){return;}return db[_0xd045('0x6e')][_0xd045('0x59')]({'where':{'UserId':{'$in':_0x103e13},'VoicePrefixId':_0x22affd[_0xd045('0x6f')]},'transaction':_0x1f2133});})[_0xd045('0x2b')](function(){return db[_0xd045('0x31')][_0xd045('0x59')]({'where':{'id':_0x5e9e46},'cascade':!![],'transaction':_0x1f2133});})[_0xd045('0x2b')](function(_0x1d3a21){if(_0x1d3a21===0x0){_0x239ccd[_0xd045('0x1f')](0x194);}else{return db[_0xd045('0x70')]['destroy']({'where':{'type':_0xd045('0x54'),'resourceId':_0x5e9e46},'cascade':!![],'transaction':_0x1f2133})['then'](function(){_0x239ccd[_0xd045('0x21')](0xcc)[_0xd045('0x20')]();});}})[_0xd045('0x57')](function(_0x62379d){_0x239ccd[_0xd045('0x21')](0x1f4)[_0xd045('0x2f')](_0x62379d);});});};exports[_0xd045('0x71')]=function(_0x304b1f,_0x2b680e,_0x326ba0){return db['Team'][_0xd045('0x72')]({'where':{'id':_0x304b1f[_0xd045('0x49')]['id']}})[_0xd045('0x2b')](handleEntityNotFound(_0x2b680e,null))[_0xd045('0x2b')](function(_0x168708){if(!_0x304b1f['query'][_0xd045('0x73')]||!utils[_0xd045('0x74')](_0x304b1f['query'][_0xd045('0x73')])){throw new db[(_0xd045('0x5d'))][(_0xd045('0x75'))]('Unknown\x20channel');}var _0x254b9a={};var _0x539436={};_0x539436['model']=_[_0xd045('0x38')](db[_[_0xd045('0x76')](_0x304b1f['query'][_0xd045('0x73')][_0xd045('0x77')]())+'Queue'][_0xd045('0x32')]);_0x539436[_0xd045('0x37')]=_[_0xd045('0x38')](_0x304b1f[_0xd045('0x37')]);_0x539436[_0xd045('0x39')]=_['intersection'](_0x539436[_0xd045('0x36')],_0x539436[_0xd045('0x37')]);_0x254b9a[_0xd045('0x3b')]=_['intersection'](_0x539436[_0xd045('0x36')],qs['fields'](_0x304b1f['query'][_0xd045('0x3c')]));_0x254b9a['attributes']=_0x254b9a[_0xd045('0x3b')][_0xd045('0x3d')]?_0x254b9a['attributes']:_0x539436['model'];_0x254b9a[_0xd045('0x25')]=qs[_0xd045('0x25')](_0x304b1f[_0xd045('0x37')][_0xd045('0x25')]);_0x254b9a[_0xd045('0x23')]=qs[_0xd045('0x23')](_0x304b1f[_0xd045('0x37')][_0xd045('0x23')]);_0x254b9a[_0xd045('0x40')]=qs[_0xd045('0x41')](_0x304b1f[_0xd045('0x37')][_0xd045('0x41')]);_0x254b9a[_0xd045('0x42')]=qs[_0xd045('0x39')](_['pick'](_0x304b1f[_0xd045('0x37')],_0x539436[_0xd045('0x39')]));_0x254b9a=_[_0xd045('0x44')]({},_0x254b9a,_0x304b1f[_0xd045('0x4c')]);return _0x168708[_0xd045('0x51')+_[_0xd045('0x76')](_0x304b1f[_0xd045('0x37')][_0xd045('0x73')]['toLowerCase']())+_0xd045('0x78')](_0x254b9a);})[_0xd045('0x2b')](respondWithResult(_0x2b680e,null))['catch'](handleError(_0x2b680e,null));};exports['addQueues']=function(_0x2726ae,_0x207a71,_0x3bb040){return db['Team'][_0xd045('0x72')]({'where':{'id':_0x2726ae['params']['id']}})[_0xd045('0x2b')](function(_0x34d329){if(_0x34d329){if(!_0x2726ae[_0xd045('0x4f')][_0xd045('0x73')]||!utils[_0xd045('0x74')](_0x2726ae[_0xd045('0x4f')][_0xd045('0x73')])){throw new db[(_0xd045('0x5d'))][(_0xd045('0x75'))](_0xd045('0x79'));}return _0x34d329[_0xd045('0x7a')+_[_0xd045('0x76')](_0x2726ae[_0xd045('0x4f')][_0xd045('0x73')][_0xd045('0x77')]())+_0xd045('0x78')](_0x2726ae[_0xd045('0x4f')][_0xd045('0x7b')]);}return null;})[_0xd045('0x2b')](handleEntityNotFound(_0x207a71,null))[_0xd045('0x2b')](respondWithStatusCode(_0x207a71,null))[_0xd045('0x57')](handleError(_0x207a71,null));};exports[_0xd045('0x7c')]=function(_0x3bba26,_0xa5222d,_0x15d935){return db['Team'][_0xd045('0x72')]({'where':{'id':_0x3bba26['params']['id']}})['then'](function(_0x53479d){if(_0x53479d){if(!_0x3bba26['query'][_0xd045('0x73')]||!utils['isValidChannel'](_0x3bba26['query'][_0xd045('0x73')])){throw new db['Sequelize']['ValidationError'](_0xd045('0x79'));}return _0x53479d[_0xd045('0x7d')+_[_0xd045('0x76')](_0x3bba26[_0xd045('0x37')][_0xd045('0x73')][_0xd045('0x77')]())+_0xd045('0x78')](_0x3bba26[_0xd045('0x37')]['ids']);}return null;})[_0xd045('0x2b')](handleEntityNotFound(_0xa5222d,null))[_0xd045('0x2b')](respondWithStatusCode(_0xa5222d,null))[_0xd045('0x57')](handleError(_0xa5222d,null));};exports[_0xd045('0x7e')]=function(_0x585968,_0xa374b4){var _0x1c883c=_[_0xd045('0x7f')](_0x585968[_0xd045('0x4f')][_0xd045('0x7b')])?_0x585968[_0xd045('0x4f')][_0xd045('0x7b')]:[_0x585968[_0xd045('0x4f')][_0xd045('0x7b')]];var _0x500f86=_0x585968['params']['id'];return db['Team'][_0xd045('0x4d')]({'where':{'id':_0x500f86}})[_0xd045('0x2b')](handleEntityNotFound(_0xa374b4,null))[_0xd045('0x2b')](function(_0x4c5adf){if(_0x4c5adf){var _0x378573=[_0xd045('0x80'),_0xd045('0x81'),_0xd045('0x82'),_0xd045('0x83'),'Fax','Openchannel',_0xd045('0x84')];return db[_0xd045('0x5a')][_0xd045('0x5b')](function(_0xa267ba){var _0x55f92d=_['map'](_0x378573,function(_0x30f0c0){var _0x5ae3b2={'attributes':['id',_0xd045('0x2e')]};if(_0x30f0c0===_0xd045('0x80')){_0x5ae3b2['through']={'attributes':[_0xd045('0x85')]};}return _0x4c5adf[_0xd045('0x51')+_0x30f0c0+'Queues'](_0x5ae3b2)[_0xd045('0x2b')](function(_0x3a7196){var _0x4fd824=_['map'](_0x3a7196,function(_0x4bc6a0){var _0x402a3a=_[_0xd045('0x30')](_0x1c883c,function(_0x1fe2bd){var _0x417c0b={'where':{'UserId':_0x1fe2bd,[_0x30f0c0+_0xd045('0x86')]:_0x4bc6a0['id']},'transaction':_0xa267ba};if(_0x30f0c0===_0xd045('0x80')){_0x417c0b['defaults']={'penalty':_0x4bc6a0[_0xd045('0x87')][_0xd045('0x85')]};}return db[_0xd045('0x88')+_0x30f0c0+'Queue'][_0xd045('0x89')](_0x417c0b)[_0xd045('0x2b')](function(){socket[_0xd045('0x8a')](_0xd045('0x50')+_0x30f0c0+'Queue:save',{'UserId':_0x1fe2bd,[_0x30f0c0+_0xd045('0x86')]:_0x4bc6a0['id']});if(_0x30f0c0!==_0xd045('0x80')){return;}return db['User'][_0xd045('0x46')]({'where':{'id':_0x1c883c,'online':0x1},'attributes':['id','name',_0xd045('0x8b'),_0xd045('0x8c'),'interface'],'raw':!![]})[_0xd045('0x2b')](function(_0x178891){var _0x2f0e4b=_[_0xd045('0x30')](_0x178891,function(_0x564dd5){return db['UserVoiceQueueRt'][_0xd045('0x8d')]({'membername':_0x564dd5[_0xd045('0x2e')],'UserId':_0x564dd5['id'],'queue_name':_0x4bc6a0[_0xd045('0x2e')],'VoiceQueueId':_0x4bc6a0['id'],'interface':_[_0xd045('0x8e')](_0x564dd5[_0xd045('0x8f')])?util[_0xd045('0x90')](_0xd045('0x91'),_0x564dd5[_0xd045('0x2e')]):_0x564dd5[_0xd045('0x8f')],'paused':_0x564dd5['voicePause']||![],'penalty':_0x4bc6a0[_0xd045('0x87')]['penalty']},{'transaction':_0xa267ba});});return Promise[_0xd045('0x92')](_0x2f0e4b);});});});return Promise[_0xd045('0x92')](_0x402a3a);});return Promise[_0xd045('0x92')](_0x4fd824);})[_0xd045('0x2b')](function(){return db[_0xd045('0x93')][_0xd045('0x72')]({'where':{'teamId':_0x500f86}})['then'](function(_0x5e4ec9){if(_0x5e4ec9){var _0x5d1e42=_[_0xd045('0x30')](_0x1c883c,function(_0x20fb4b){db['UserVoicePrefix'][_0xd045('0x8d')]({'UserId':_0x20fb4b,'VoicePrefixId':_0x5e4ec9[_0xd045('0x6f')]});});return Promise['all'](_0x5d1e42);}});});});return Promise[_0xd045('0x92')](_0x55f92d)[_0xd045('0x2b')](function(){return _0x4c5adf['addAgents'](_0x1c883c,{'transaction':_0xa267ba})['spread'](function(_0x1ff364){return _0x1ff364;});});});}})[_0xd045('0x2b')](respondWithResult(_0xa374b4,null))[_0xd045('0x57')](handleError(_0xa374b4,null));};exports[_0xd045('0x94')]=function(_0xf18f1f,_0x32b360){var _0x581e03=_[_0xd045('0x7f')](_0xf18f1f[_0xd045('0x37')][_0xd045('0x7b')])?_0xf18f1f[_0xd045('0x37')][_0xd045('0x7b')]:[_0xf18f1f[_0xd045('0x37')][_0xd045('0x7b')]];var _0x4ac794=_0xf18f1f['params']['id'];return db[_0xd045('0x31')][_0xd045('0x4d')]({'where':{'id':_0x4ac794}})[_0xd045('0x2b')](handleEntityNotFound(_0x32b360,null))['then'](function(_0x31d5ee){if(_0x31d5ee){var _0x50cdb8=[_0xd045('0x80'),_0xd045('0x81'),_0xd045('0x82'),_0xd045('0x83'),_0xd045('0x95'),_0xd045('0x96'),_0xd045('0x84')];return db['sequelize']['transaction'](function(_0x21074e){var _0x5d6b91=_[_0xd045('0x30')](_0x50cdb8,function(_0x93f48b){var _0x3a62f9={'attributes':['id',_0xd045('0x2e')]};return _0x31d5ee[_0xd045('0x51')+_0x93f48b+_0xd045('0x78')](_0x3a62f9)[_0xd045('0x2b')](function(_0x897472){var _0x2a0bbb=_[_0xd045('0x30')](_0x897472,function(_0x212177){return _0x212177['removeAgents'](_0x581e03,{'transaction':_0x21074e})[_0xd045('0x2b')](function(){var _0x4e3cee=_['map'](_0x581e03,function(_0x53014e){socket[_0xd045('0x8a')](_0xd045('0x50')+_0x93f48b+_0xd045('0x97'),{'UserId':Number(_0x53014e),[_0x93f48b+'QueueId']:_0x212177['id']});if(_0x93f48b!=='Voice'){return;}return db[_0xd045('0x98')][_0xd045('0x59')]({'where':{'VoiceQueueId':_0x212177['id'],'UserId':_0x53014e},'transaction':_0x21074e});});return Promise[_0xd045('0x92')](_0x4e3cee);});});return Promise[_0xd045('0x92')](_0x2a0bbb);});});return Promise[_0xd045('0x92')](_0x5d6b91)[_0xd045('0x2b')](function(){return _0x31d5ee[_0xd045('0x94')](_0x581e03,{'transaction':_0x21074e});})['then'](function(){return db[_0xd045('0x93')]['findOne']({'where':{'teamId':_0x4ac794}})[_0xd045('0x2b')](function(_0xc34917){if(_0xc34917){var _0x153943=_[_0xd045('0x30')](_0x581e03,function(_0x2ef267){db['UserVoicePrefix'][_0xd045('0x59')]({'where':{'UserId':_0x2ef267,'VoicePrefixId':_0xc34917[_0xd045('0x6f')]}});});return Promise['all'](_0x153943);}});});});}})[_0xd045('0x2b')](respondWithStatusCode(_0x32b360,null))[_0xd045('0x57')](handleError(_0x32b360,null));};exports[_0xd045('0x99')]=function(_0x4a2131,_0x2fb51b,_0x16e43e){var _0x176623={};var _0x2b5e1f={};var _0x25738a;var _0x3a5b22;return db[_0xd045('0x31')][_0xd045('0x72')]({'where':{'id':_0x4a2131['params']['id']}})['then'](handleEntityNotFound(_0x2fb51b,null))['then'](function(_0xfbceb4){if(_0xfbceb4){_0x25738a=_0xfbceb4;_0x2b5e1f[_0xd045('0x36')]=_['keys'](db[_0xd045('0x88')]['rawAttributes']);_0x2b5e1f[_0xd045('0x37')]=_['keys'](_0x4a2131[_0xd045('0x37')]);_0x2b5e1f['filters']=_[_0xd045('0x3a')](_0x2b5e1f['model'],_0x2b5e1f[_0xd045('0x37')]);_0x176623['attributes']=_['intersection'](_0x2b5e1f[_0xd045('0x36')],qs[_0xd045('0x3c')](_0x4a2131[_0xd045('0x37')]['fields']));_0x176623['attributes']=_0x176623[_0xd045('0x3b')]['length']?_0x176623[_0xd045('0x3b')]:_0x2b5e1f['model'];_0x176623[_0xd045('0x40')]=qs[_0xd045('0x41')](_0x4a2131['query']['sort']);_0x176623['where']=qs['filters'](_[_0xd045('0x43')](_0x4a2131[_0xd045('0x37')],_0x2b5e1f['filters']));if(_0x4a2131['query'][_0xd045('0x45')]){_0x176623['where']=_[_0xd045('0x44')](_0x176623[_0xd045('0x42')],{'$or':_[_0xd045('0x30')](_0x176623['attributes'],function(_0x32bd23){var _0x33803d={};_0x33803d[_0x32bd23]={'$like':'%'+_0x4a2131['query'][_0xd045('0x45')]+'%'};return _0x33803d;})});}_0x176623=_['merge']({},_0x176623,_0x4a2131[_0xd045('0x4c')]);return _0x25738a[_0xd045('0x99')](_0x176623);}})[_0xd045('0x2b')](function(_0x2d2490){if(_0x2d2490){_0x3a5b22=_0x2d2490[_0xd045('0x3d')];if(!_0x4a2131['query'][_0xd045('0x3e')](_0xd045('0x3f'))){_0x176623[_0xd045('0x25')]=qs[_0xd045('0x25')](_0x4a2131['query']['limit']);_0x176623[_0xd045('0x23')]=qs['offset'](_0x4a2131[_0xd045('0x37')][_0xd045('0x23')]);}return _0x25738a[_0xd045('0x99')](_0x176623);}})['then'](function(_0x976a91){if(_0x976a91){return _0x976a91?{'count':_0x3a5b22,'rows':_0x976a91}:null;}})[_0xd045('0x2b')](respondWithResult(_0x2fb51b,null))['catch'](handleError(_0x2fb51b,null));}; \ No newline at end of file +var _0x5023=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./team.socket','register','sendStatus','status','offset','undefined','count','Content-Range','json','apply','save','error','stack','name','index','map','Team','fieldName','type','key','model','keys','intersection','query','attributes','fields','nolimit','limit','order','sort','where','filters','merge','filter','options','then','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','create','get','role','Teams','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','sequelize','transaction','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','destroy','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','end','send','getQueues','findOne','channel','isValidChannel','ValidationError','toLowerCase','Queue','capitalize','Queues','addQueues','ids','Unknown\x20channel','remove','addAgents','isArray','Voice','Chat','Openchannel','TeamVoiceQueue','penalty','User','emit','user','QueueId','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','TeamVoicePrefix','spread','removeAgents','Sms','Queue:remove','VoicePrefixId','getAgents','pick','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x113566,_0x78c52a){var _0x359407=function(_0x2fa3ad){while(--_0x2fa3ad){_0x113566['push'](_0x113566['shift']());}};_0x359407(++_0x78c52a);}(_0x5023,0x1b2));var _0x3502=function(_0x321361,_0x1a4564){_0x321361=_0x321361-0x0;var _0x23ba19=_0x5023[_0x321361];return _0x23ba19;};'use strict';var emlformat=require(_0x3502('0x0'));var rimraf=require(_0x3502('0x1'));var zipdir=require(_0x3502('0x2'));var jsonpatch=require(_0x3502('0x3'));var rp=require(_0x3502('0x4'));var moment=require(_0x3502('0x5'));var BPromise=require(_0x3502('0x6'));var Mustache=require(_0x3502('0x7'));var util=require(_0x3502('0x8'));var path=require('path');var sox=require(_0x3502('0x9'));var csv=require(_0x3502('0xa'));var ejs=require(_0x3502('0xb'));var fs=require('fs');var fs_extra=require(_0x3502('0xc'));var _=require(_0x3502('0xd'));var squel=require('squel');var crypto=require(_0x3502('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3502('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3502('0x10'));var Papa=require(_0x3502('0x11'));var Redis=require(_0x3502('0x12'));var authService=require(_0x3502('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3502('0x14'));var hardwareService=require(_0x3502('0x15'));var logger=require('../../config/logger')(_0x3502('0x16'));var utils=require(_0x3502('0x17'));var config=require(_0x3502('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3502('0x19'))['db'];config[_0x3502('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3502('0x1b'))(new Redis(config[_0x3502('0x1a')]));require(_0x3502('0x1c'))[_0x3502('0x1d')](socket);function respondWithStatusCode(_0x32612c,_0x532219){_0x532219=_0x532219||0xcc;return function(_0x278a7c){if(_0x278a7c){return _0x32612c[_0x3502('0x1e')](_0x532219);}return _0x32612c[_0x3502('0x1f')](_0x532219)['end']();};}function respondWithResult(_0x1716f8,_0x2dd1b7){_0x2dd1b7=_0x2dd1b7||0xc8;return function(_0x65d66d){if(_0x65d66d){return _0x1716f8['status'](_0x2dd1b7)['json'](_0x65d66d);}};}function respondWithFilteredResult(_0x509b6c,_0x1d9cb4){return function(_0x33150f){if(_0x33150f){var _0x157386=typeof _0x1d9cb4[_0x3502('0x20')]===_0x3502('0x21')&&typeof _0x1d9cb4['limit']===_0x3502('0x21');var _0x25a5f0=_0x33150f[_0x3502('0x22')];var _0x2a0953=_0x157386?0x0:_0x1d9cb4[_0x3502('0x20')];var _0x119069=_0x157386?_0x33150f[_0x3502('0x22')]:_0x1d9cb4[_0x3502('0x20')]+_0x1d9cb4['limit'];var _0x430d51;if(_0x119069>=_0x25a5f0){_0x119069=_0x25a5f0;_0x430d51=0xc8;}else{_0x430d51=0xce;}_0x509b6c[_0x3502('0x1f')](_0x430d51);return _0x509b6c['set'](_0x3502('0x23'),_0x2a0953+'-'+_0x119069+'/'+_0x25a5f0)[_0x3502('0x24')](_0x33150f);}return null;};}function patchUpdates(_0x4db03d){return function(_0x4cf917){try{jsonpatch[_0x3502('0x25')](_0x4cf917,_0x4db03d,!![]);}catch(_0x48ed35){return BPromise['reject'](_0x48ed35);}return _0x4cf917[_0x3502('0x26')]();};}function saveUpdates(_0x12a42c,_0x18152c){return function(_0x4ff217){if(_0x4ff217){return _0x4ff217['update'](_0x12a42c)['then'](function(_0x265ae0){return _0x265ae0;});}return null;};}function handleEntityNotFound(_0x2d6c46,_0x34fe6d){return function(_0x4f32d1){if(!_0x4f32d1){_0x2d6c46[_0x3502('0x1e')](0x194);}return _0x4f32d1;};}function handleError(_0x4d0350,_0x28eded){_0x28eded=_0x28eded||0x1f4;return function(_0x3db4b5){logger[_0x3502('0x27')](_0x3db4b5[_0x3502('0x28')]);if(_0x3db4b5[_0x3502('0x29')]){delete _0x3db4b5[_0x3502('0x29')];}_0x4d0350[_0x3502('0x1f')](_0x28eded)['send'](_0x3db4b5);};}exports[_0x3502('0x2a')]=function(_0x25e458,_0x41b55e){var _0x4e4c66={},_0x1dec1b={},_0x5dc4fa={'count':0x0,'rows':[]};var _0x101f89=_[_0x3502('0x2b')](db[_0x3502('0x2c')]['rawAttributes'],function(_0x58ce32){return{'name':_0x58ce32[_0x3502('0x2d')],'type':_0x58ce32[_0x3502('0x2e')][_0x3502('0x2f')]};});_0x1dec1b[_0x3502('0x30')]=_[_0x3502('0x2b')](_0x101f89,_0x3502('0x29'));_0x1dec1b['query']=_[_0x3502('0x31')](_0x25e458['query']);_0x1dec1b['filters']=_[_0x3502('0x32')](_0x1dec1b['model'],_0x1dec1b[_0x3502('0x33')]);_0x4e4c66[_0x3502('0x34')]=_[_0x3502('0x32')](_0x1dec1b[_0x3502('0x30')],qs[_0x3502('0x35')](_0x25e458[_0x3502('0x33')][_0x3502('0x35')]));_0x4e4c66[_0x3502('0x34')]=_0x4e4c66[_0x3502('0x34')]['length']?_0x4e4c66[_0x3502('0x34')]:_0x1dec1b['model'];if(!_0x25e458[_0x3502('0x33')]['hasOwnProperty'](_0x3502('0x36'))){_0x4e4c66[_0x3502('0x37')]=qs[_0x3502('0x37')](_0x25e458[_0x3502('0x33')][_0x3502('0x37')]);_0x4e4c66[_0x3502('0x20')]=qs[_0x3502('0x20')](_0x25e458[_0x3502('0x33')]['offset']);}_0x4e4c66[_0x3502('0x38')]=qs[_0x3502('0x39')](_0x25e458[_0x3502('0x33')][_0x3502('0x39')]);_0x4e4c66[_0x3502('0x3a')]=qs[_0x3502('0x3b')](_['pick'](_0x25e458['query'],_0x1dec1b[_0x3502('0x3b')]),_0x101f89);if(_0x25e458[_0x3502('0x33')]['filter']){_0x4e4c66[_0x3502('0x3a')]=_[_0x3502('0x3c')](_0x4e4c66[_0x3502('0x3a')],{'$or':_['map'](_0x101f89,function(_0x18119b){if(_0x18119b[_0x3502('0x2e')]!=='VIRTUAL'){var _0x34ede4={};_0x34ede4[_0x18119b[_0x3502('0x29')]]={'$like':'%'+_0x25e458['query'][_0x3502('0x3d')]+'%'};return _0x34ede4;}})});}_0x4e4c66=_[_0x3502('0x3c')]({},_0x4e4c66,_0x25e458[_0x3502('0x3e')]);var _0x1229de={'where':_0x4e4c66[_0x3502('0x3a')]};return db['Team'][_0x3502('0x22')](_0x1229de)[_0x3502('0x3f')](function(_0x106102){_0x5dc4fa[_0x3502('0x22')]=_0x106102;if(_0x25e458[_0x3502('0x33')]['includeAll']){_0x4e4c66[_0x3502('0x40')]=[{'all':!![]}];}return db[_0x3502('0x2c')][_0x3502('0x41')](_0x4e4c66);})[_0x3502('0x3f')](function(_0x42f1fe){_0x5dc4fa[_0x3502('0x42')]=_0x42f1fe;return _0x5dc4fa;})['then'](respondWithFilteredResult(_0x41b55e,_0x4e4c66))[_0x3502('0x43')](handleError(_0x41b55e,null));};exports[_0x3502('0x44')]=function(_0x29e3fd,_0x37b91c){var _0x5b3881={'raw':![],'where':{'id':_0x29e3fd[_0x3502('0x45')]['id']}},_0x521f5c={};_0x521f5c[_0x3502('0x30')]=_[_0x3502('0x31')](db[_0x3502('0x2c')][_0x3502('0x46')]);_0x521f5c[_0x3502('0x33')]=_[_0x3502('0x31')](_0x29e3fd[_0x3502('0x33')]);_0x521f5c[_0x3502('0x3b')]=_[_0x3502('0x32')](_0x521f5c['model'],_0x521f5c[_0x3502('0x33')]);_0x5b3881[_0x3502('0x34')]=_[_0x3502('0x32')](_0x521f5c['model'],qs[_0x3502('0x35')](_0x29e3fd[_0x3502('0x33')][_0x3502('0x35')]));_0x5b3881[_0x3502('0x34')]=_0x5b3881['attributes'][_0x3502('0x47')]?_0x5b3881[_0x3502('0x34')]:_0x521f5c[_0x3502('0x30')];if(_0x29e3fd[_0x3502('0x33')][_0x3502('0x48')]){_0x5b3881[_0x3502('0x40')]=[{'all':!![]}];}_0x5b3881=_['merge']({},_0x5b3881,_0x29e3fd[_0x3502('0x3e')]);return db[_0x3502('0x2c')]['find'](_0x5b3881)[_0x3502('0x3f')](handleEntityNotFound(_0x37b91c,null))['then'](respondWithResult(_0x37b91c,null))[_0x3502('0x43')](handleError(_0x37b91c,null));};exports[_0x3502('0x49')]=function(_0x5ca8eb,_0x42c346){return db['Team'][_0x3502('0x49')](_0x5ca8eb['body'],{})[_0x3502('0x3f')](function(_0x47d49b){var _0x43b444=_0x5ca8eb['user'][_0x3502('0x4a')]({'plain':!![]});if(!_0x43b444)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x43b444[_0x3502('0x4b')]==='user'){var _0x45fc76=_0x47d49b[_0x3502('0x4a')]({'plain':!![]});var _0x413abc=_0x3502('0x4c');return db[_0x3502('0x4d')][_0x3502('0x4e')]({'where':{'name':_0x413abc,'userProfileId':_0x43b444[_0x3502('0x4f')]},'raw':!![]})[_0x3502('0x3f')](function(_0x1218f1){if(_0x1218f1&&_0x1218f1[_0x3502('0x50')]===0x0){return db[_0x3502('0x51')][_0x3502('0x49')]({'name':_0x45fc76[_0x3502('0x29')],'resourceId':_0x45fc76['id'],'type':_0x1218f1['name'],'sectionId':_0x1218f1['id']},{})[_0x3502('0x3f')](function(){return _0x47d49b;});}else{return _0x47d49b;}})[_0x3502('0x43')](function(_0x9f6f87){logger[_0x3502('0x27')](_0x3502('0x52'),_0x9f6f87);throw _0x9f6f87;});}return _0x47d49b;})[_0x3502('0x3f')](respondWithResult(_0x42c346,0xc9))[_0x3502('0x43')](handleError(_0x42c346,null));};exports[_0x3502('0x53')]=function(_0x44850d,_0x5dd505){if(_0x44850d[_0x3502('0x54')]['id']){delete _0x44850d['body']['id'];}return db[_0x3502('0x2c')]['find']({'where':{'id':_0x44850d[_0x3502('0x45')]['id']}})[_0x3502('0x3f')](handleEntityNotFound(_0x5dd505,null))[_0x3502('0x3f')](saveUpdates(_0x44850d[_0x3502('0x54')],null))['then'](respondWithResult(_0x5dd505,null))['catch'](handleError(_0x5dd505,null));};exports['destroy']=function(_0x3e5e07,_0x5173ce){var _0xc3bc86=_0x3e5e07[_0x3502('0x45')]['id'];var _0x1920f5=[];return db[_0x3502('0x55')][_0x3502('0x56')](function(_0x2e69eb){var _0x319a43='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0xc3bc86;return db[_0x3502('0x55')][_0x3502('0x33')](_0x319a43,{'type':db[_0x3502('0x57')][_0x3502('0x58')][_0x3502('0x59')],'raw':!![],'transaction':_0x2e69eb})[_0x3502('0x3f')](function(_0x302336){_0x1920f5=_[_0x3502('0x2b')](_0x302336,function(_0x3741a0){return Number(_0x3741a0[_0x3502('0x5a')]);});})[_0x3502('0x3f')](function(){var _0x3103f=_0x3502('0x5b')+_0xc3bc86;return db[_0x3502('0x55')]['query'](_0x3103f,{'type':db['Sequelize'][_0x3502('0x58')][_0x3502('0x59')],'raw':!![],'transaction':_0x2e69eb});})[_0x3502('0x3f')](function(_0x675e9b){var _0x11285e=_['map'](_0x675e9b,function(_0x309ed0){return Number(_0x309ed0[_0x3502('0x5c')]);});return db['UserVoiceQueue'][_0x3502('0x5d')]({'where':{'UserId':{'$in':_0x1920f5},'VoiceQueueId':{'$in':_0x11285e}},'transaction':_0x2e69eb});})['then'](function(){var _0x5662de='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0xc3bc86;return db[_0x3502('0x55')][_0x3502('0x33')](_0x5662de,{'type':db['Sequelize']['QueryTypes'][_0x3502('0x59')],'raw':!![],'transaction':_0x2e69eb});})[_0x3502('0x3f')](function(_0x31b3fd){var _0x242146=_[_0x3502('0x2b')](_0x31b3fd,function(_0x4952c5){return Number(_0x4952c5[_0x3502('0x5e')]);});return db[_0x3502('0x5f')][_0x3502('0x5d')]({'where':{'UserId':{'$in':_0x1920f5},'MailQueueId':{'$in':_0x242146}},'transaction':_0x2e69eb});})[_0x3502('0x3f')](function(){var _0x6474d1=_0x3502('0x60')+_0xc3bc86;return db[_0x3502('0x55')][_0x3502('0x33')](_0x6474d1,{'type':db[_0x3502('0x57')][_0x3502('0x58')][_0x3502('0x59')],'raw':!![],'transaction':_0x2e69eb});})[_0x3502('0x3f')](function(_0x2ee941){var _0x47e2ca=_['map'](_0x2ee941,function(_0xf0205){return Number(_0xf0205[_0x3502('0x61')]);});return db['UserSmsQueue'][_0x3502('0x5d')]({'where':{'UserId':{'$in':_0x1920f5},'SmsQueueId':{'$in':_0x47e2ca}},'transaction':_0x2e69eb});})[_0x3502('0x3f')](function(){var _0x16a92b='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0xc3bc86;return db[_0x3502('0x55')][_0x3502('0x33')](_0x16a92b,{'type':db['Sequelize'][_0x3502('0x58')][_0x3502('0x59')],'raw':!![],'transaction':_0x2e69eb});})[_0x3502('0x3f')](function(_0x477e75){var _0x392611=_[_0x3502('0x2b')](_0x477e75,function(_0xa85821){return Number(_0xa85821[_0x3502('0x62')]);});return db[_0x3502('0x63')][_0x3502('0x5d')]({'where':{'UserId':{'$in':_0x1920f5},'ChatQueueId':{'$in':_0x392611}},'transaction':_0x2e69eb});})['then'](function(){var _0x58c882=_0x3502('0x64')+_0xc3bc86;return db[_0x3502('0x55')][_0x3502('0x33')](_0x58c882,{'type':db[_0x3502('0x57')]['QueryTypes'][_0x3502('0x59')],'raw':!![],'transaction':_0x2e69eb});})[_0x3502('0x3f')](function(_0x5df3cf){var _0x14a910=_['map'](_0x5df3cf,function(_0x3ca34c){return Number(_0x3ca34c[_0x3502('0x65')]);});return db[_0x3502('0x66')][_0x3502('0x5d')]({'where':{'UserId':{'$in':_0x1920f5},'FaxQueueId':{'$in':_0x14a910}},'transaction':_0x2e69eb});})['then'](function(){var _0xa6dcbb=_0x3502('0x67')+_0xc3bc86;return db[_0x3502('0x55')]['query'](_0xa6dcbb,{'type':db[_0x3502('0x57')]['QueryTypes'][_0x3502('0x59')],'raw':!![],'transaction':_0x2e69eb});})[_0x3502('0x3f')](function(_0x58489b){var _0x3f7597=_['map'](_0x58489b,function(_0x1c2ec0){return Number(_0x1c2ec0[_0x3502('0x68')]);});return db['UserOpenchannelQueue']['destroy']({'where':{'UserId':{'$in':_0x1920f5},'OpenchannelQueueId':{'$in':_0x3f7597}},'transaction':_0x2e69eb});})[_0x3502('0x3f')](function(){var _0x2ecd55='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0xc3bc86;return db[_0x3502('0x55')][_0x3502('0x33')](_0x2ecd55,{'type':db['Sequelize'][_0x3502('0x58')][_0x3502('0x59')],'raw':!![],'transaction':_0x2e69eb});})[_0x3502('0x3f')](function(_0x5d0148){var _0x1c4f96=_['map'](_0x5d0148,function(_0x459930){return Number(_0x459930[_0x3502('0x69')]);});return db[_0x3502('0x6a')]['destroy']({'where':{'UserId':{'$in':_0x1920f5},'WhatsappQueueId':{'$in':_0x1c4f96}},'transaction':_0x2e69eb});})[_0x3502('0x3f')](function(){return db['TeamVoicePrefix'][_0x3502('0x4e')]({'where':{'TeamId':_0xc3bc86}});})[_0x3502('0x3f')](function(_0x40acc8){if(_0x40acc8===null){return;}return db[_0x3502('0x6b')]['destroy']({'where':{'UserId':{'$in':_0x1920f5},'VoicePrefixId':_0x40acc8['VoicePrefixId']},'transaction':_0x2e69eb});})['then'](function(){return db[_0x3502('0x2c')][_0x3502('0x5d')]({'where':{'id':_0xc3bc86},'cascade':!![],'transaction':_0x2e69eb});})[_0x3502('0x3f')](function(_0x4b041a){if(_0x4b041a===0x0){_0x5173ce[_0x3502('0x1e')](0x194);}else{return db[_0x3502('0x51')]['destroy']({'where':{'type':_0x3502('0x4c'),'resourceId':_0xc3bc86},'cascade':!![],'transaction':_0x2e69eb})[_0x3502('0x3f')](function(){_0x5173ce[_0x3502('0x1f')](0xcc)[_0x3502('0x6c')]();});}})[_0x3502('0x43')](function(_0x1d1eb3){_0x5173ce[_0x3502('0x1f')](0x1f4)[_0x3502('0x6d')](_0x1d1eb3);});});};exports[_0x3502('0x6e')]=function(_0x5a024f,_0x2c0b25,_0x56f6b3){return db['Team'][_0x3502('0x6f')]({'where':{'id':_0x5a024f[_0x3502('0x45')]['id']}})[_0x3502('0x3f')](handleEntityNotFound(_0x2c0b25,null))[_0x3502('0x3f')](function(_0x155fbd){if(!_0x5a024f['query'][_0x3502('0x70')]||!utils[_0x3502('0x71')](_0x5a024f[_0x3502('0x33')][_0x3502('0x70')])){throw new db[(_0x3502('0x57'))][(_0x3502('0x72'))]('Unknown\x20channel');}var _0x4cb357={};var _0x4b8e24={};_0x4b8e24[_0x3502('0x30')]=_[_0x3502('0x31')](db[_['capitalize'](_0x5a024f[_0x3502('0x33')][_0x3502('0x70')][_0x3502('0x73')]())+_0x3502('0x74')]['rawAttributes']);_0x4b8e24[_0x3502('0x33')]=_['keys'](_0x5a024f['query']);_0x4b8e24['filters']=_[_0x3502('0x32')](_0x4b8e24[_0x3502('0x30')],_0x4b8e24[_0x3502('0x33')]);_0x4cb357[_0x3502('0x34')]=_[_0x3502('0x32')](_0x4b8e24[_0x3502('0x30')],qs['fields'](_0x5a024f['query']['fields']));_0x4cb357[_0x3502('0x34')]=_0x4cb357[_0x3502('0x34')][_0x3502('0x47')]?_0x4cb357[_0x3502('0x34')]:_0x4b8e24[_0x3502('0x30')];_0x4cb357['limit']=qs[_0x3502('0x37')](_0x5a024f[_0x3502('0x33')]['limit']);_0x4cb357[_0x3502('0x20')]=qs[_0x3502('0x20')](_0x5a024f[_0x3502('0x33')]['offset']);_0x4cb357[_0x3502('0x38')]=qs[_0x3502('0x39')](_0x5a024f['query'][_0x3502('0x39')]);_0x4cb357[_0x3502('0x3a')]=qs[_0x3502('0x3b')](_['pick'](_0x5a024f[_0x3502('0x33')],_0x4b8e24[_0x3502('0x3b')]));_0x4cb357=_[_0x3502('0x3c')]({},_0x4cb357,_0x5a024f['options']);return _0x155fbd[_0x3502('0x4a')+_[_0x3502('0x75')](_0x5a024f[_0x3502('0x33')][_0x3502('0x70')][_0x3502('0x73')]())+_0x3502('0x76')](_0x4cb357);})[_0x3502('0x3f')](respondWithResult(_0x2c0b25,null))[_0x3502('0x43')](handleError(_0x2c0b25,null));};exports[_0x3502('0x77')]=function(_0x539a4f,_0x54b9f6,_0x55c81d){return db[_0x3502('0x2c')][_0x3502('0x6f')]({'where':{'id':_0x539a4f[_0x3502('0x45')]['id']}})[_0x3502('0x3f')](function(_0x103fcb){if(_0x103fcb){if(!_0x539a4f[_0x3502('0x54')][_0x3502('0x70')]||!utils['isValidChannel'](_0x539a4f['body'][_0x3502('0x70')])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}return _0x103fcb['add'+_[_0x3502('0x75')](_0x539a4f['body']['channel'][_0x3502('0x73')]())+_0x3502('0x76')](_0x539a4f[_0x3502('0x54')][_0x3502('0x78')]);}return null;})[_0x3502('0x3f')](handleEntityNotFound(_0x54b9f6,null))['then'](respondWithStatusCode(_0x54b9f6,null))[_0x3502('0x43')](handleError(_0x54b9f6,null));};exports['removeQueues']=function(_0x1f195c,_0x376603,_0x257c3c){return db[_0x3502('0x2c')][_0x3502('0x6f')]({'where':{'id':_0x1f195c['params']['id']}})[_0x3502('0x3f')](function(_0x2cd667){if(_0x2cd667){if(!_0x1f195c[_0x3502('0x33')][_0x3502('0x70')]||!utils[_0x3502('0x71')](_0x1f195c['query']['channel'])){throw new db[(_0x3502('0x57'))][(_0x3502('0x72'))](_0x3502('0x79'));}return _0x2cd667[_0x3502('0x7a')+_[_0x3502('0x75')](_0x1f195c['query']['channel'][_0x3502('0x73')]())+_0x3502('0x76')](_0x1f195c[_0x3502('0x33')][_0x3502('0x78')]);}return null;})[_0x3502('0x3f')](handleEntityNotFound(_0x376603,null))[_0x3502('0x3f')](respondWithStatusCode(_0x376603,null))['catch'](handleError(_0x376603,null));};exports[_0x3502('0x7b')]=function(_0xc894fe,_0x5f5d86){var _0x431368=_[_0x3502('0x7c')](_0xc894fe[_0x3502('0x54')][_0x3502('0x78')])?_0xc894fe[_0x3502('0x54')][_0x3502('0x78')]:[_0xc894fe[_0x3502('0x54')][_0x3502('0x78')]];var _0x287ba9=_0xc894fe[_0x3502('0x45')]['id'];return db[_0x3502('0x2c')][_0x3502('0x4e')]({'where':{'id':_0x287ba9}})[_0x3502('0x3f')](handleEntityNotFound(_0x5f5d86,null))['then'](function(_0x539ea2){if(_0x539ea2){var _0x52bd23=[_0x3502('0x7d'),_0x3502('0x7e'),'Mail','Sms','Fax',_0x3502('0x7f'),'Whatsapp'];return db[_0x3502('0x55')][_0x3502('0x56')](function(_0x65a54){var _0xb28779=_['map'](_0x52bd23,function(_0x3ed4ed){var _0x2eef24={'attributes':['id',_0x3502('0x29')]};if(_0x3ed4ed===_0x3502('0x7d')){_0x2eef24['through']={'attributes':['penalty']};}return _0x539ea2[_0x3502('0x4a')+_0x3ed4ed+_0x3502('0x76')](_0x2eef24)[_0x3502('0x3f')](function(_0x49fd6c){var _0x5734a0=_[_0x3502('0x2b')](_0x49fd6c,function(_0x3a1058){var _0x33af77=_[_0x3502('0x2b')](_0x431368,function(_0x39f60d){var _0x57c0e9={'where':{'UserId':_0x39f60d,[_0x3ed4ed+'QueueId']:_0x3a1058['id']},'transaction':_0x65a54};if(_0x3ed4ed===_0x3502('0x7d')){_0x57c0e9['defaults']={'penalty':_0x3a1058[_0x3502('0x80')][_0x3502('0x81')]};}return db[_0x3502('0x82')+_0x3ed4ed+_0x3502('0x74')]['findOrCreate'](_0x57c0e9)['then'](function(){socket[_0x3502('0x83')](_0x3502('0x84')+_0x3ed4ed+'Queue:save',{'UserId':_0x39f60d,[_0x3ed4ed+_0x3502('0x85')]:_0x3a1058['id']});if(_0x3ed4ed!==_0x3502('0x7d')){return;}return db[_0x3502('0x82')][_0x3502('0x41')]({'where':{'id':_0x431368,'online':0x1},'attributes':['id',_0x3502('0x29'),'online',_0x3502('0x86'),_0x3502('0x87')],'raw':!![]})['then'](function(_0x30f3dc){var _0x53ef53=_[_0x3502('0x2b')](_0x30f3dc,function(_0x45303d){return db[_0x3502('0x88')][_0x3502('0x89')]({'membername':_0x45303d[_0x3502('0x29')],'UserId':_0x45303d['id'],'queue_name':_0x3a1058['name'],'VoiceQueueId':_0x3a1058['id'],'interface':_[_0x3502('0x8a')](_0x45303d[_0x3502('0x87')])?util[_0x3502('0x8b')](_0x3502('0x8c'),_0x45303d['name']):_0x45303d[_0x3502('0x87')],'paused':_0x45303d[_0x3502('0x86')]||![],'penalty':_0x3a1058['TeamVoiceQueue'][_0x3502('0x81')]},{'transaction':_0x65a54});});return Promise['all'](_0x53ef53);});});});return Promise[_0x3502('0x8d')](_0x33af77);});return Promise['all'](_0x5734a0);})[_0x3502('0x3f')](function(){return db[_0x3502('0x8e')][_0x3502('0x6f')]({'where':{'teamId':_0x287ba9}})[_0x3502('0x3f')](function(_0x5c9eb0){if(_0x5c9eb0){var _0x1627ad=_[_0x3502('0x2b')](_0x431368,function(_0x9c9169){db[_0x3502('0x6b')][_0x3502('0x89')]({'UserId':_0x9c9169,'VoicePrefixId':_0x5c9eb0['VoicePrefixId']});});return Promise[_0x3502('0x8d')](_0x1627ad);}});});});return Promise[_0x3502('0x8d')](_0xb28779)[_0x3502('0x3f')](function(){return _0x539ea2['addAgents'](_0x431368,{'transaction':_0x65a54})[_0x3502('0x8f')](function(_0x18eaa3){return _0x18eaa3;});});});}})[_0x3502('0x3f')](respondWithResult(_0x5f5d86,null))[_0x3502('0x43')](handleError(_0x5f5d86,null));};exports[_0x3502('0x90')]=function(_0x9f71fd,_0x24abbb){var _0x1b08cc=_['isArray'](_0x9f71fd[_0x3502('0x33')][_0x3502('0x78')])?_0x9f71fd['query'][_0x3502('0x78')]:[_0x9f71fd[_0x3502('0x33')][_0x3502('0x78')]];var _0x53238c=_0x9f71fd[_0x3502('0x45')]['id'];return db[_0x3502('0x2c')][_0x3502('0x4e')]({'where':{'id':_0x53238c}})[_0x3502('0x3f')](handleEntityNotFound(_0x24abbb,null))[_0x3502('0x3f')](function(_0x4987de){if(_0x4987de){var _0x371f28=[_0x3502('0x7d'),_0x3502('0x7e'),'Mail',_0x3502('0x91'),'Fax','Openchannel','Whatsapp'];return db[_0x3502('0x55')][_0x3502('0x56')](function(_0x19c63e){var _0x5b4377=_[_0x3502('0x2b')](_0x371f28,function(_0x1e5d36){var _0x50ceec={'attributes':['id','name']};return _0x4987de[_0x3502('0x4a')+_0x1e5d36+_0x3502('0x76')](_0x50ceec)[_0x3502('0x3f')](function(_0x46157e){var _0x16c512=_[_0x3502('0x2b')](_0x46157e,function(_0x246598){return _0x246598[_0x3502('0x90')](_0x1b08cc,{'transaction':_0x19c63e})[_0x3502('0x3f')](function(){var _0xaaf28a=_[_0x3502('0x2b')](_0x1b08cc,function(_0x5c5296){socket['emit'](_0x3502('0x84')+_0x1e5d36+_0x3502('0x92'),{'UserId':Number(_0x5c5296),[_0x1e5d36+'QueueId']:_0x246598['id']});if(_0x1e5d36!==_0x3502('0x7d')){return;}return db[_0x3502('0x88')][_0x3502('0x5d')]({'where':{'VoiceQueueId':_0x246598['id'],'UserId':_0x5c5296},'transaction':_0x19c63e});});return Promise[_0x3502('0x8d')](_0xaaf28a);});});return Promise[_0x3502('0x8d')](_0x16c512);});});return Promise[_0x3502('0x8d')](_0x5b4377)[_0x3502('0x3f')](function(){return _0x4987de['removeAgents'](_0x1b08cc,{'transaction':_0x19c63e});})[_0x3502('0x3f')](function(){return db[_0x3502('0x8e')][_0x3502('0x6f')]({'where':{'teamId':_0x53238c}})[_0x3502('0x3f')](function(_0x47f32c){if(_0x47f32c){var _0x3c939f=_[_0x3502('0x2b')](_0x1b08cc,function(_0x2f3ea4){db[_0x3502('0x6b')][_0x3502('0x5d')]({'where':{'UserId':_0x2f3ea4,'VoicePrefixId':_0x47f32c[_0x3502('0x93')]}});});return Promise[_0x3502('0x8d')](_0x3c939f);}});});});}})[_0x3502('0x3f')](respondWithStatusCode(_0x24abbb,null))[_0x3502('0x43')](handleError(_0x24abbb,null));};exports[_0x3502('0x94')]=function(_0x35509c,_0x2b4c44,_0x38a647){var _0x326b9a={};var _0xe1b31c={};var _0x4e7b4e;var _0x1b0af3;return db[_0x3502('0x2c')][_0x3502('0x6f')]({'where':{'id':_0x35509c[_0x3502('0x45')]['id']}})[_0x3502('0x3f')](handleEntityNotFound(_0x2b4c44,null))[_0x3502('0x3f')](function(_0x45d762){if(_0x45d762){_0x4e7b4e=_0x45d762;_0xe1b31c[_0x3502('0x30')]=_['keys'](db[_0x3502('0x82')]['rawAttributes']);_0xe1b31c[_0x3502('0x33')]=_[_0x3502('0x31')](_0x35509c['query']);_0xe1b31c[_0x3502('0x3b')]=_['intersection'](_0xe1b31c['model'],_0xe1b31c[_0x3502('0x33')]);_0x326b9a[_0x3502('0x34')]=_[_0x3502('0x32')](_0xe1b31c[_0x3502('0x30')],qs[_0x3502('0x35')](_0x35509c[_0x3502('0x33')][_0x3502('0x35')]));_0x326b9a[_0x3502('0x34')]=_0x326b9a[_0x3502('0x34')]['length']?_0x326b9a[_0x3502('0x34')]:_0xe1b31c[_0x3502('0x30')];_0x326b9a[_0x3502('0x38')]=qs[_0x3502('0x39')](_0x35509c[_0x3502('0x33')][_0x3502('0x39')]);_0x326b9a[_0x3502('0x3a')]=qs[_0x3502('0x3b')](_[_0x3502('0x95')](_0x35509c[_0x3502('0x33')],_0xe1b31c[_0x3502('0x3b')]));if(_0x35509c[_0x3502('0x33')]['filter']){_0x326b9a[_0x3502('0x3a')]=_[_0x3502('0x3c')](_0x326b9a[_0x3502('0x3a')],{'$or':_[_0x3502('0x2b')](_0x326b9a[_0x3502('0x34')],function(_0x5bcb65){var _0x216c0e={};_0x216c0e[_0x5bcb65]={'$like':'%'+_0x35509c[_0x3502('0x33')][_0x3502('0x3d')]+'%'};return _0x216c0e;})});}_0x326b9a=_[_0x3502('0x3c')]({},_0x326b9a,_0x35509c[_0x3502('0x3e')]);return _0x4e7b4e['getAgents'](_0x326b9a);}})['then'](function(_0x56585f){if(_0x56585f){_0x1b0af3=_0x56585f[_0x3502('0x47')];if(!_0x35509c[_0x3502('0x33')][_0x3502('0x96')](_0x3502('0x36'))){_0x326b9a[_0x3502('0x37')]=qs[_0x3502('0x37')](_0x35509c['query'][_0x3502('0x37')]);_0x326b9a[_0x3502('0x20')]=qs[_0x3502('0x20')](_0x35509c['query'][_0x3502('0x20')]);}return _0x4e7b4e[_0x3502('0x94')](_0x326b9a);}})[_0x3502('0x3f')](function(_0x45f084){if(_0x45f084){return _0x45f084?{'count':_0x1b0af3,'rows':_0x45f084}:null;}})[_0x3502('0x3f')](respondWithResult(_0x2b4c44,null))[_0x3502('0x43')](handleError(_0x2b4c44,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index bbedd86..c39048b 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 _0x4bd3=['events','../../mysqldb','Team','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4bd3,0xbe));var _0x34bd=function(_0x5e3c3e,_0x5e462){_0x5e3c3e=_0x5e3c3e-0x0;var _0x4b00e1=_0x4bd3[_0x5e3c3e];return _0x4b00e1;};'use strict';var EventEmitter=require(_0x34bd('0x0'));var Team=require(_0x34bd('0x1'))['db'][_0x34bd('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x34bd('0x3')](0x0);var events={'afterCreate':_0x34bd('0x4'),'afterUpdate':_0x34bd('0x5'),'afterDestroy':'remove'};function emitEvent(_0x269ada){return function(_0x7c7d34,_0x38f578,_0x8349d8){TeamEvents[_0x34bd('0x6')](_0x269ada+':'+_0x7c7d34['id'],_0x7c7d34);TeamEvents['emit'](_0x269ada,_0x7c7d34);_0x8349d8(null);};}for(var e in events){if(events[_0x34bd('0x7')](e)){var event=events[e];Team[_0x34bd('0x8')](e,emitEvent(event));}}module[_0x34bd('0x9')]=TeamEvents; \ No newline at end of file +var _0x377a=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','Team'];(function(_0x434e50,_0x4ed139){var _0x377d0d=function(_0x3f5aa2){while(--_0x3f5aa2){_0x434e50['push'](_0x434e50['shift']());}};_0x377d0d(++_0x4ed139);}(_0x377a,0x154));var _0xa377=function(_0x3b2c6f,_0xa9f35c){_0x3b2c6f=_0x3b2c6f-0x0;var _0x22e219=_0x377a[_0x3b2c6f];return _0x22e219;};'use strict';var EventEmitter=require(_0xa377('0x0'));var Team=require('../../mysqldb')['db'][_0xa377('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xa377('0x2')](0x0);var events={'afterCreate':_0xa377('0x3'),'afterUpdate':'update','afterDestroy':_0xa377('0x4')};function emitEvent(_0x10866d){return function(_0x3e0de4,_0x39a02b,_0x37364f){TeamEvents[_0xa377('0x5')](_0x10866d+':'+_0x3e0de4['id'],_0x3e0de4);TeamEvents[_0xa377('0x5')](_0x10866d,_0x3e0de4);_0x37364f(null);};}for(var e in events){if(events[_0xa377('0x6')](e)){var event=events[e];Team[_0xa377('0x7')](e,emitEvent(event));}}module[_0xa377('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index d23dc1d..daa2a60 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 _0xaee8=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','exports','teams'];(function(_0x225a75,_0x43c1de){var _0xee995d=function(_0x31a816){while(--_0x31a816){_0x225a75['push'](_0x225a75['shift']());}};_0xee995d(++_0x43c1de);}(_0xaee8,0x18c));var _0x8aee=function(_0x39874b,_0x508488){_0x39874b=_0x39874b-0x0;var _0x19c46f=_0xaee8[_0x39874b];return _0x19c46f;};'use strict';var _=require(_0x8aee('0x0'));var util=require(_0x8aee('0x1'));var logger=require(_0x8aee('0x2'))(_0x8aee('0x3'));var moment=require('moment');var BPromise=require(_0x8aee('0x4'));var rp=require(_0x8aee('0x5'));var fs=require('fs');var path=require(_0x8aee('0x6'));var rimraf=require(_0x8aee('0x7'));var config=require(_0x8aee('0x8'));var attributes=require(_0x8aee('0x9'));module[_0x8aee('0xa')]=function(_0x51b886,_0x32f236){return _0x51b886['define']('Team',attributes,{'tableName':_0x8aee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c31=['Team','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./team.attributes','exports'];(function(_0xda6ad1,_0x5f09e3){var _0xedc3a5=function(_0x5459d7){while(--_0x5459d7){_0xda6ad1['push'](_0xda6ad1['shift']());}};_0xedc3a5(++_0x5f09e3);}(_0x2c31,0x17d));var _0x12c3=function(_0x143989,_0x45c741){_0x143989=_0x143989-0x0;var _0x25e2e0=_0x2c31[_0x143989];return _0x25e2e0;};'use strict';var _=require(_0x12c3('0x0'));var util=require(_0x12c3('0x1'));var logger=require(_0x12c3('0x2'))(_0x12c3('0x3'));var moment=require('moment');var BPromise=require(_0x12c3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x12c3('0x5'));var rimraf=require('rimraf');var config=require(_0x12c3('0x6'));var attributes=require(_0x12c3('0x7'));module[_0x12c3('0x8')]=function(_0xc07b79,_0x5d41d8){return _0xc07b79['define'](_0x12c3('0x9'),attributes,{'tableName':'teams','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 7ff1e60..7cfb8bb 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 _0x3c14=['debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','request','then','Team,\x20%s,\x20%s'];(function(_0x1f6e2a,_0xe4e014){var _0x1c1496=function(_0x5e813f){while(--_0x5e813f){_0x1f6e2a['push'](_0x1f6e2a['shift']());}};_0x1c1496(++_0xe4e014);}(_0x3c14,0x149));var _0x43c1=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x3c14[_0x20589d];return _0x422de9;};'use strict';var _=require(_0x43c1('0x0'));var util=require(_0x43c1('0x1'));var moment=require(_0x43c1('0x2'));var BPromise=require(_0x43c1('0x3'));var rs=require(_0x43c1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43c1('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x43c1('0x6'));var config=require(_0x43c1('0x7'));var jayson=require(_0x43c1('0x8'));var client=jayson[_0x43c1('0x9')][_0x43c1('0xa')]({'port':0x232a});config[_0x43c1('0xb')]=_[_0x43c1('0xc')](config[_0x43c1('0xb')],{'host':_0x43c1('0xd'),'port':0x18eb});var socket=require(_0x43c1('0xe'))(new Redis(config['redis']));require(_0x43c1('0xf'))['register'](socket);function respondWithRpcPromise(_0x21b31b,_0x5d1aba,_0x513131){return new BPromise(function(_0x20faec,_0x1d1211){return client[_0x43c1('0x10')](_0x21b31b,_0x513131)[_0x43c1('0x11')](function(_0x43c0a5){logger['info'](_0x43c1('0x12'),_0x5d1aba,'request\x20sent');logger[_0x43c1('0x13')](_0x43c1('0x14'),_0x5d1aba,_0x43c1('0x15'),JSON[_0x43c1('0x16')](_0x43c0a5));if(_0x43c0a5[_0x43c1('0x17')]){if(_0x43c0a5[_0x43c1('0x17')][_0x43c1('0x18')]===0x1f4){logger[_0x43c1('0x17')](_0x43c1('0x12'),_0x5d1aba,_0x43c0a5['error'][_0x43c1('0x19')]);return _0x1d1211(_0x43c0a5[_0x43c1('0x17')][_0x43c1('0x19')]);}logger['error']('Team,\x20%s,\x20%s',_0x5d1aba,_0x43c0a5['error'][_0x43c1('0x19')]);return _0x20faec(_0x43c0a5[_0x43c1('0x17')][_0x43c1('0x19')]);}else{logger[_0x43c1('0x1a')](_0x43c1('0x12'),_0x5d1aba,_0x43c1('0x15'));_0x20faec(_0x43c0a5[_0x43c1('0x1b')][_0x43c1('0x19')]);}})[_0x43c1('0x1c')](function(_0x3d1a1c){logger[_0x43c1('0x17')](_0x43c1('0x12'),_0x5d1aba,_0x3d1a1c);_0x1d1211(_0x3d1a1c);});});} \ No newline at end of file +var _0x339f=['debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x339f,0x19a));var _0xf339=function(_0x180ab1,_0x19df4d){_0x180ab1=_0x180ab1-0x0;var _0xc452b7=_0x339f[_0x180ab1];return _0xc452b7;};'use strict';var _=require(_0xf339('0x0'));var util=require(_0xf339('0x1'));var moment=require(_0xf339('0x2'));var BPromise=require(_0xf339('0x3'));var rs=require(_0xf339('0x4'));var fs=require('fs');var Redis=require(_0xf339('0x5'));var db=require(_0xf339('0x6'))['db'];var utils=require(_0xf339('0x7'));var logger=require(_0xf339('0x8'))(_0xf339('0x9'));var config=require(_0xf339('0xa'));var jayson=require(_0xf339('0xb'));var client=jayson[_0xf339('0xc')][_0xf339('0xd')]({'port':0x232a});config[_0xf339('0xe')]=_[_0xf339('0xf')](config[_0xf339('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xf339('0x10'))(new Redis(config['redis']));require(_0xf339('0x11'))[_0xf339('0x12')](socket);function respondWithRpcPromise(_0x4842af,_0x34efcf,_0x28c301){return new BPromise(function(_0x8f0031,_0x15884b){return client[_0xf339('0x13')](_0x4842af,_0x28c301)[_0xf339('0x14')](function(_0x4c57de){logger[_0xf339('0x15')](_0xf339('0x16'),_0x34efcf,_0xf339('0x17'));logger[_0xf339('0x18')](_0xf339('0x19'),_0x34efcf,_0xf339('0x17'),JSON[_0xf339('0x1a')](_0x4c57de));if(_0x4c57de[_0xf339('0x1b')]){if(_0x4c57de[_0xf339('0x1b')][_0xf339('0x1c')]===0x1f4){logger[_0xf339('0x1b')](_0xf339('0x16'),_0x34efcf,_0x4c57de[_0xf339('0x1b')][_0xf339('0x1d')]);return _0x15884b(_0x4c57de['error'][_0xf339('0x1d')]);}logger[_0xf339('0x1b')](_0xf339('0x16'),_0x34efcf,_0x4c57de[_0xf339('0x1b')]['message']);return _0x8f0031(_0x4c57de[_0xf339('0x1b')]['message']);}else{logger['info'](_0xf339('0x16'),_0x34efcf,'request\x20sent');_0x8f0031(_0x4c57de[_0xf339('0x1e')]['message']);}})['catch'](function(_0x4c1ee8){logger[_0xf339('0x1b')]('Team,\x20%s,\x20%s',_0x34efcf,_0x4c1ee8);_0x15884b(_0x4c1ee8);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index fd7f3a6..1d0743b 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 _0xe235=['emit','register','length','team:','./team.events','save','remove','update'];(function(_0x34c6db,_0x5eab32){var _0x139a9c=function(_0x24fd80){while(--_0x24fd80){_0x34c6db['push'](_0x34c6db['shift']());}};_0x139a9c(++_0x5eab32);}(_0xe235,0xe4));var _0x5e23=function(_0x23af31,_0x8a1add){_0x23af31=_0x23af31-0x0;var _0x49b82f=_0xe235[_0x23af31];return _0x49b82f;};'use strict';var TeamEvents=require(_0x5e23('0x0'));var events=[_0x5e23('0x1'),_0x5e23('0x2'),_0x5e23('0x3')];function createListener(_0x49fc1b,_0x57e9e8){return function(_0x31faa4){_0x57e9e8[_0x5e23('0x4')](_0x49fc1b,_0x31faa4);};}function removeListener(_0x14eee2,_0x5ba17a){return function(){TeamEvents['removeListener'](_0x14eee2,_0x5ba17a);};}exports[_0x5e23('0x5')]=function(_0x37c8a7){for(var _0x1b49b2=0x0,_0x1c9b2b=events[_0x5e23('0x6')];_0x1b49b2<_0x1c9b2b;_0x1b49b2++){var _0xd7f262=events[_0x1b49b2];var _0x1f0008=createListener(_0x5e23('0x7')+_0xd7f262,_0x37c8a7);TeamEvents['on'](_0xd7f262,_0x1f0008);}}; \ No newline at end of file +var _0x566f=['emit','removeListener','register','length','./team.events','save','remove','update'];(function(_0x33803c,_0x540bce){var _0x2f1825=function(_0x57ee92){while(--_0x57ee92){_0x33803c['push'](_0x33803c['shift']());}};_0x2f1825(++_0x540bce);}(_0x566f,0x124));var _0xf566=function(_0x47179e,_0x5a6ac3){_0x47179e=_0x47179e-0x0;var _0x35aa82=_0x566f[_0x47179e];return _0x35aa82;};'use strict';var TeamEvents=require(_0xf566('0x0'));var events=[_0xf566('0x1'),_0xf566('0x2'),_0xf566('0x3')];function createListener(_0x8f1cbc,_0x33f5d1){return function(_0x1e171d){_0x33f5d1[_0xf566('0x4')](_0x8f1cbc,_0x1e171d);};}function removeListener(_0x5eef34,_0xae69b5){return function(){TeamEvents[_0xf566('0x5')](_0x5eef34,_0xae69b5);};}exports[_0xf566('0x6')]=function(_0x117398){for(var _0x5898ea=0x0,_0xacfc48=events[_0xf566('0x7')];_0x5898ea<_0xacfc48;_0x5898ea++){var _0x3af552=events[_0x5898ea];var _0x1e33fa=createListener('team:'+_0x3af552,_0x117398);TeamEvents['on'](_0x3af552,_0x1e33fa);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index b5c1be5..5616167 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 _0x9c64=['exports','INTEGER'];(function(_0x482214,_0x2550ff){var _0x38d0cb=function(_0x2ba281){while(--_0x2ba281){_0x482214['push'](_0x482214['shift']());}};_0x38d0cb(++_0x2550ff);}(_0x9c64,0x16a));var _0x49c6=function(_0x2bce80,_0x24bcf9){_0x2bce80=_0x2bce80-0x0;var _0x4af3c5=_0x9c64[_0x2bce80];return _0x4af3c5;};'use strict';var Sequelize=require('sequelize');module[_0x49c6('0x0')]={'TeamId':{'type':Sequelize[_0x49c6('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x49c6('0x1')]}}; \ No newline at end of file +var _0xcb5e=['sequelize','exports','INTEGER'];(function(_0x1bdd64,_0x339663){var _0x1857e9=function(_0x1573c4){while(--_0x1573c4){_0x1bdd64['push'](_0x1bdd64['shift']());}};_0x1857e9(++_0x339663);}(_0xcb5e,0x1dd));var _0xecb5=function(_0x574a8a,_0x1c75ec){_0x574a8a=_0x574a8a-0x0;var _0xa3948d=_0xcb5e[_0x574a8a];return _0xa3948d;};'use strict';var Sequelize=require(_0xecb5('0x0'));module[_0xecb5('0x1')]={'TeamId':{'type':Sequelize[_0xecb5('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xecb5('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index fa3b199..c7c3485 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 _0xd757=['./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xd757,0x1e5));var _0x7d75=function(_0x436151,_0x5906f8){_0x436151=_0x436151-0x0;var _0x3b2df2=_0xd757[_0x436151];return _0x3b2df2;};'use strict';var _=require(_0x7d75('0x0'));var util=require(_0x7d75('0x1'));var logger=require(_0x7d75('0x2'))(_0x7d75('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7d75('0x4'));var fs=require('fs');var path=require(_0x7d75('0x5'));var rimraf=require('rimraf');var config=require(_0x7d75('0x6'));var attributes=require(_0x7d75('0x7'));module[_0x7d75('0x8')]=function(_0x52bb43,_0x5d6128){return _0x52bb43[_0x7d75('0x9')](_0x7d75('0xa'),attributes,{'tableName':_0x7d75('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa3db=['./teamVoicePrefix.attributes','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x4f536c,_0x33acbf){var _0x5ce44d=function(_0x16abc1){while(--_0x16abc1){_0x4f536c['push'](_0x4f536c['shift']());}};_0x5ce44d(++_0x33acbf);}(_0xa3db,0x10c));var _0xba3d=function(_0x2207fc,_0x1398fb){_0x2207fc=_0x2207fc-0x0;var _0x507249=_0xa3db[_0x2207fc];return _0x507249;};'use strict';var _=require(_0xba3d('0x0'));var util=require(_0xba3d('0x1'));var logger=require(_0xba3d('0x2'))(_0xba3d('0x3'));var moment=require(_0xba3d('0x4'));var BPromise=require(_0xba3d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xba3d('0x6'));var config=require('../../config/environment');var attributes=require(_0xba3d('0x7'));module['exports']=function(_0x3f8f46,_0x12481b){return _0x3f8f46[_0xba3d('0x8')](_0xba3d('0x9'),attributes,{'tableName':_0xba3d('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 89b5642..efe4380 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x2d02bd,_0x3dfd19){var _0x522a0d=function(_0x569765){while(--_0x569765){_0x2d02bd['push'](_0x2d02bd['shift']());}};_0x522a0d(++_0x3dfd19);}(_0xedd9,0xfc));var _0x9edd=function(_0xb30755,_0x3bf0a1){_0xb30755=_0xb30755-0x0;var _0x333c37=_0xedd9[_0xb30755];return _0x333c37;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x462f2b,_0x337220){var _0x1308e7=function(_0x5e8a02){while(--_0x5e8a02){_0x462f2b['push'](_0x462f2b['shift']());}};_0x1308e7(++_0x337220);}(_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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index daad2fc..6096b16 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 _0x7f00=['exports','INTEGER','sequelize'];(function(_0x1ea910,_0x337c1b){var _0x11f6db=function(_0x5d1669){while(--_0x5d1669){_0x1ea910['push'](_0x1ea910['shift']());}};_0x11f6db(++_0x337c1b);}(_0x7f00,0x161));var _0x07f0=function(_0x33593e,_0x22ddd3){_0x33593e=_0x33593e-0x0;var _0x53db1a=_0x7f00[_0x33593e];return _0x53db1a;};'use strict';var Sequelize=require(_0x07f0('0x0'));module[_0x07f0('0x1')]={'penalty':{'type':Sequelize[_0x07f0('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd328=['exports','INTEGER'];(function(_0xb867d7,_0x17bf23){var _0xf94e9=function(_0x50e326){while(--_0x50e326){_0xb867d7['push'](_0xb867d7['shift']());}};_0xf94e9(++_0x17bf23);}(_0xd328,0x162));var _0x8d32=function(_0x54a63f,_0x32ef9a){_0x54a63f=_0x54a63f-0x0;var _0x15e269=_0xd328[_0x54a63f];return _0x15e269;};'use strict';var Sequelize=require('sequelize');module[_0x8d32('0x0')]={'penalty':{'type':Sequelize[_0x8d32('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 951ad1d..0925510 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 _0x3e25=['util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash'];(function(_0x52ece1,_0x425dc5){var _0x329205=function(_0xf76c47){while(--_0xf76c47){_0x52ece1['push'](_0x52ece1['shift']());}};_0x329205(++_0x425dc5);}(_0x3e25,0x14f));var _0x53e2=function(_0x2e5a0d,_0x574c4d){_0x2e5a0d=_0x2e5a0d-0x0;var _0x2d59c8=_0x3e25[_0x2e5a0d];return _0x2d59c8;};'use strict';var _=require(_0x53e2('0x0'));var util=require(_0x53e2('0x1'));var logger=require(_0x53e2('0x2'))('api');var moment=require(_0x53e2('0x3'));var BPromise=require('bluebird');var rp=require(_0x53e2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x53e2('0x5'));var config=require(_0x53e2('0x6'));var attributes=require(_0x53e2('0x7'));module[_0x53e2('0x8')]=function(_0x11ad7a,_0x14b22c){return _0x11ad7a[_0x53e2('0x9')](_0x53e2('0xa'),attributes,{'tableName':_0x53e2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x87ae=['define','TeamVoiceQueue','../../config/logger','bluebird','request-promise','path','../../config/environment','./teamVoiceQueue.attributes','exports'];(function(_0xf5a98b,_0x4c3646){var _0x1515d=function(_0xf882bc){while(--_0xf882bc){_0xf5a98b['push'](_0xf5a98b['shift']());}};_0x1515d(++_0x4c3646);}(_0x87ae,0xf5));var _0xe87a=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x87ae[_0x15bc81];return _0x59440e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe87a('0x0'))('api');var moment=require('moment');var BPromise=require(_0xe87a('0x1'));var rp=require(_0xe87a('0x2'));var fs=require('fs');var path=require(_0xe87a('0x3'));var rimraf=require('rimraf');var config=require(_0xe87a('0x4'));var attributes=require(_0xe87a('0x5'));module[_0xe87a('0x6')]=function(_0x5ef978,_0x4b9934){return _0x5ef978[_0xe87a('0x7')](_0xe87a('0x8'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 1e4e5ad..cf3cdd0 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 _0x3e84=['rpc','../../config/environment','http','then','info','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x47e72a,_0xdd3da2){var _0x558ea9=function(_0x29dc65){while(--_0x29dc65){_0x47e72a['push'](_0x47e72a['shift']());}};_0x558ea9(++_0xdd3da2);}(_0x3e84,0xd4));var _0x43e8=function(_0x315aea,_0x318a80){_0x315aea=_0x315aea-0x0;var _0x4a4bdb=_0x3e84[_0x315aea];return _0x4a4bdb;};'use strict';var _=require('lodash');var util=require(_0x43e8('0x0'));var moment=require(_0x43e8('0x1'));var BPromise=require(_0x43e8('0x2'));var rs=require(_0x43e8('0x3'));var fs=require('fs');var Redis=require(_0x43e8('0x4'));var db=require(_0x43e8('0x5'))['db'];var utils=require(_0x43e8('0x6'));var logger=require(_0x43e8('0x7'))(_0x43e8('0x8'));var config=require(_0x43e8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x43e8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d321d,_0x291bb0,_0x1a97ce){return new BPromise(function(_0x3955c5,_0x5500ea){return client['request'](_0x4d321d,_0x1a97ce)[_0x43e8('0xb')](function(_0x1ede84){logger[_0x43e8('0xc')](_0x43e8('0xd'),_0x291bb0,'request\x20sent');logger[_0x43e8('0xe')](_0x43e8('0xf'),_0x291bb0,_0x43e8('0x10'),JSON[_0x43e8('0x11')](_0x1ede84));if(_0x1ede84[_0x43e8('0x12')]){if(_0x1ede84[_0x43e8('0x12')][_0x43e8('0x13')]===0x1f4){logger['error'](_0x43e8('0xd'),_0x291bb0,_0x1ede84[_0x43e8('0x12')][_0x43e8('0x14')]);return _0x5500ea(_0x1ede84[_0x43e8('0x12')][_0x43e8('0x14')]);}logger['error'](_0x43e8('0xd'),_0x291bb0,_0x1ede84[_0x43e8('0x12')][_0x43e8('0x14')]);return _0x3955c5(_0x1ede84[_0x43e8('0x12')][_0x43e8('0x14')]);}else{logger[_0x43e8('0xc')](_0x43e8('0xd'),_0x291bb0,_0x43e8('0x10'));_0x3955c5(_0x1ede84[_0x43e8('0x15')]['message']);}})['catch'](function(_0x336a5b){logger[_0x43e8('0x12')](_0x43e8('0xd'),_0x291bb0,_0x336a5b);_0x5500ea(_0x336a5b);});});} \ No newline at end of file +var _0xbefb=['request','then','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client'];(function(_0x19b1c2,_0x205062){var _0x4e1ae5=function(_0x5a1cb7){while(--_0x5a1cb7){_0x19b1c2['push'](_0x19b1c2['shift']());}};_0x4e1ae5(++_0x205062);}(_0xbefb,0x13c));var _0xbbef=function(_0x1f8259,_0x3a9f27){_0x1f8259=_0x1f8259-0x0;var _0x443709=_0xbefb[_0x1f8259];return _0x443709;};'use strict';var _=require(_0xbbef('0x0'));var util=require(_0xbbef('0x1'));var moment=require('moment');var BPromise=require(_0xbbef('0x2'));var rs=require(_0xbbef('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbbef('0x4'))['db'];var utils=require(_0xbbef('0x5'));var logger=require(_0xbbef('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbbef('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3bbb5f,_0x1faba8,_0x14254c){return new BPromise(function(_0x4b86ca,_0x471cc1){return client[_0xbbef('0x8')](_0x3bbb5f,_0x14254c)[_0xbbef('0x9')](function(_0x345e5b){logger['info'](_0xbbef('0xa'),_0x1faba8,'request\x20sent');logger[_0xbbef('0xb')](_0xbbef('0xc'),_0x1faba8,_0xbbef('0xd'),JSON['stringify'](_0x345e5b));if(_0x345e5b['error']){if(_0x345e5b[_0xbbef('0xe')][_0xbbef('0xf')]===0x1f4){logger[_0xbbef('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x1faba8,_0x345e5b['error'][_0xbbef('0x10')]);return _0x471cc1(_0x345e5b[_0xbbef('0xe')]['message']);}logger[_0xbbef('0xe')](_0xbbef('0xa'),_0x1faba8,_0x345e5b['error'][_0xbbef('0x10')]);return _0x4b86ca(_0x345e5b[_0xbbef('0xe')][_0xbbef('0x10')]);}else{logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x1faba8,_0xbbef('0xd'));_0x4b86ca(_0x345e5b['result'][_0xbbef('0x10')]);}})[_0xbbef('0x11')](function(_0x104137){logger[_0xbbef('0xe')](_0xbbef('0xa'),_0x1faba8,_0x104137);_0x471cc1(_0x104137);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index c2433c5..f6ee674 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 _0x731b=['post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./template.controller','get','isAuthenticated','index','/:id'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x731b,0xf7));var _0xb731=function(_0x32bf10,_0x405391){_0x32bf10=_0x32bf10-0x0;var _0x641d76=_0x731b[_0x32bf10];return _0x641d76;};'use strict';var multer=require(_0xb731('0x0'));var util=require(_0xb731('0x1'));var path=require('path');var timeout=require(_0xb731('0x2'));var express=require(_0xb731('0x3'));var router=express[_0xb731('0x4')]();var fs_extra=require(_0xb731('0x5'));var auth=require(_0xb731('0x6'));var interaction=require(_0xb731('0x7'));var config=require('../../config/environment');var controller=require(_0xb731('0x8'));router[_0xb731('0x9')]('/',auth[_0xb731('0xa')](),controller[_0xb731('0xb')]);router[_0xb731('0x9')](_0xb731('0xc'),auth[_0xb731('0xa')](),controller['show']);router[_0xb731('0xd')]('/',auth[_0xb731('0xa')](),controller[_0xb731('0xe')]);router[_0xb731('0xf')](_0xb731('0xc'),auth[_0xb731('0xa')](),controller[_0xb731('0x10')]);router[_0xb731('0x11')](_0xb731('0xc'),auth[_0xb731('0xa')](),controller[_0xb731('0x12')]);module[_0xb731('0x13')]=router; \ No newline at end of file +var _0x2250=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2e2adc,_0x8dc425){var _0x105095=function(_0x414e5e){while(--_0x414e5e){_0x2e2adc['push'](_0x2e2adc['shift']());}};_0x105095(++_0x8dc425);}(_0x2250,0x178));var _0x0225=function(_0x51a8b3,_0x35a867){_0x51a8b3=_0x51a8b3-0x0;var _0x370673=_0x2250[_0x51a8b3];return _0x370673;};'use strict';var multer=require(_0x0225('0x0'));var util=require(_0x0225('0x1'));var path=require(_0x0225('0x2'));var timeout=require(_0x0225('0x3'));var express=require(_0x0225('0x4'));var router=express[_0x0225('0x5')]();var fs_extra=require(_0x0225('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0225('0x7'));var config=require(_0x0225('0x8'));var controller=require(_0x0225('0x9'));router[_0x0225('0xa')]('/',auth[_0x0225('0xb')](),controller[_0x0225('0xc')]);router[_0x0225('0xa')](_0x0225('0xd'),auth['isAuthenticated'](),controller[_0x0225('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0225('0xf')]);router[_0x0225('0x10')](_0x0225('0xd'),auth[_0x0225('0xb')](),controller[_0x0225('0x11')]);router['delete'](_0x0225('0xd'),auth[_0x0225('0xb')](),controller[_0x0225('0x12')]);module[_0x0225('0x13')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 0147629..7492228 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 _0xe128=['exports','STRING'];(function(_0x1845dd,_0x3e2fe3){var _0x49e7=function(_0x3c3f7c){while(--_0x3c3f7c){_0x1845dd['push'](_0x1845dd['shift']());}};_0x49e7(++_0x3e2fe3);}(_0xe128,0x1dc));var _0x8e12=function(_0x4c321c,_0x3e9da0){_0x4c321c=_0x4c321c-0x0;var _0x25accb=_0xe128[_0x4c321c];return _0x25accb;};'use strict';var Sequelize=require('sequelize');module[_0x8e12('0x0')]={'name':{'type':Sequelize[_0x8e12('0x1')]},'description':{'type':Sequelize[_0x8e12('0x1')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x600b=['exports','STRING','sequelize'];(function(_0x4de192,_0x1a12d1){var _0x52c806=function(_0x317d73){while(--_0x317d73){_0x4de192['push'](_0x4de192['shift']());}};_0x52c806(++_0x1a12d1);}(_0x600b,0xbf));var _0xb600=function(_0x51ed62,_0x574379){_0x51ed62=_0x51ed62-0x0;var _0x34aee3=_0x600b[_0x51ed62];return _0x34aee3;};'use strict';var Sequelize=require(_0xb600('0x0'));module[_0xb600('0x1')]={'name':{'type':Sequelize[_0xb600('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 5aff9c7..9a13757 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 _0x2f55=['Content-Range','apply','reject','save','update','then','destroy','get','Templates','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','VIRTUAL','options','Template','includeAll','include','findAll','rows','show','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x2761ca,_0xb91f4a){var _0x194887=function(_0x58b4f4){while(--_0x58b4f4){_0x2761ca['push'](_0x2761ca['shift']());}};_0x194887(++_0xb91f4a);}(_0x2f55,0x18a));var _0x52f5=function(_0x4ecf74,_0x2856cb){_0x4ecf74=_0x4ecf74-0x0;var _0x179e7c=_0x2f55[_0x4ecf74];return _0x179e7c;};'use strict';var emlformat=require(_0x52f5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x52f5('0x1'));var jsonpatch=require(_0x52f5('0x2'));var rp=require(_0x52f5('0x3'));var moment=require(_0x52f5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x52f5('0x5'));var util=require('util');var path=require(_0x52f5('0x6'));var sox=require(_0x52f5('0x7'));var csv=require(_0x52f5('0x8'));var ejs=require(_0x52f5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x52f5('0xa'));var crypto=require(_0x52f5('0xb'));var jsforce=require(_0x52f5('0xc'));var deskjs=require(_0x52f5('0xd'));var toCsv=require(_0x52f5('0x8'));var querystring=require(_0x52f5('0xe'));var Papa=require(_0x52f5('0xf'));var Redis=require(_0x52f5('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x52f5('0x11'));var as=require(_0x52f5('0x12'));var hardwareService=require(_0x52f5('0x13'));var logger=require('../../config/logger')(_0x52f5('0x14'));var utils=require('../../config/utils');var config=require(_0x52f5('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bd1ee,_0xce3e9b){_0xce3e9b=_0xce3e9b||0xcc;return function(_0x251d9c){if(_0x251d9c){return _0x5bd1ee[_0x52f5('0x16')](_0xce3e9b);}return _0x5bd1ee[_0x52f5('0x17')](_0xce3e9b)[_0x52f5('0x18')]();};}function respondWithResult(_0x46a273,_0x4b3ac4){_0x4b3ac4=_0x4b3ac4||0xc8;return function(_0x529632){if(_0x529632){return _0x46a273[_0x52f5('0x17')](_0x4b3ac4)[_0x52f5('0x19')](_0x529632);}};}function respondWithFilteredResult(_0x2ce317,_0x44d929){return function(_0x1eedfb){if(_0x1eedfb){var _0x4aac74=typeof _0x44d929[_0x52f5('0x1a')]===_0x52f5('0x1b')&&typeof _0x44d929[_0x52f5('0x1c')]==='undefined';var _0xb51a54=_0x1eedfb[_0x52f5('0x1d')];var _0x244a7d=_0x4aac74?0x0:_0x44d929['offset'];var _0x42f24e=_0x4aac74?_0x1eedfb[_0x52f5('0x1d')]:_0x44d929[_0x52f5('0x1a')]+_0x44d929[_0x52f5('0x1c')];var _0x328c14;if(_0x42f24e>=_0xb51a54){_0x42f24e=_0xb51a54;_0x328c14=0xc8;}else{_0x328c14=0xce;}_0x2ce317[_0x52f5('0x17')](_0x328c14);return _0x2ce317[_0x52f5('0x1e')](_0x52f5('0x1f'),_0x244a7d+'-'+_0x42f24e+'/'+_0xb51a54)[_0x52f5('0x19')](_0x1eedfb);}return null;};}function patchUpdates(_0x55e783){return function(_0x3c0e8b){try{jsonpatch[_0x52f5('0x20')](_0x3c0e8b,_0x55e783,!![]);}catch(_0x359aec){return BPromise[_0x52f5('0x21')](_0x359aec);}return _0x3c0e8b[_0x52f5('0x22')]();};}function saveUpdates(_0x2bfe04,_0x245ce4){return function(_0x4181be){if(_0x4181be){return _0x4181be[_0x52f5('0x23')](_0x2bfe04)[_0x52f5('0x24')](function(_0x1bac4f){return _0x1bac4f;});}return null;};}function removeEntity(_0x565110,_0x1a4776){return function(_0xb0b177){if(_0xb0b177){return _0xb0b177[_0x52f5('0x25')]()[_0x52f5('0x24')](function(){var _0x58d818=_0xb0b177[_0x52f5('0x26')]({'plain':!![]});var _0x5ed9a5=_0x52f5('0x27');return db['UserProfileResource'][_0x52f5('0x25')]({'where':{'type':_0x5ed9a5,'resourceId':_0x58d818['id']}})[_0x52f5('0x24')](function(){return _0xb0b177;});})[_0x52f5('0x24')](function(){_0x565110[_0x52f5('0x17')](0xcc)[_0x52f5('0x18')]();});}};}function handleEntityNotFound(_0x5d33e1,_0x15a827){return function(_0x39cbe5){if(!_0x39cbe5){_0x5d33e1[_0x52f5('0x16')](0x194);}return _0x39cbe5;};}function handleError(_0x3b04f6,_0x308d3f){_0x308d3f=_0x308d3f||0x1f4;return function(_0x147e0d){logger[_0x52f5('0x28')](_0x147e0d[_0x52f5('0x29')]);if(_0x147e0d['name']){delete _0x147e0d[_0x52f5('0x2a')];}_0x3b04f6[_0x52f5('0x17')](_0x308d3f)[_0x52f5('0x2b')](_0x147e0d);};}exports[_0x52f5('0x2c')]=function(_0x37f1f9,_0x54b2bf){var _0xfdec26={},_0x1daa00={},_0x5c7d56={'count':0x0,'rows':[]};var _0x4b4530=_[_0x52f5('0x2d')](db['Template'][_0x52f5('0x2e')],function(_0x5a36c2){return{'name':_0x5a36c2[_0x52f5('0x2f')],'type':_0x5a36c2[_0x52f5('0x30')][_0x52f5('0x31')]};});_0x1daa00['model']=_[_0x52f5('0x2d')](_0x4b4530,_0x52f5('0x2a'));_0x1daa00[_0x52f5('0x32')]=_[_0x52f5('0x33')](_0x37f1f9[_0x52f5('0x32')]);_0x1daa00[_0x52f5('0x34')]=_[_0x52f5('0x35')](_0x1daa00[_0x52f5('0x36')],_0x1daa00['query']);_0xfdec26[_0x52f5('0x37')]=_['intersection'](_0x1daa00[_0x52f5('0x36')],qs['fields'](_0x37f1f9[_0x52f5('0x32')][_0x52f5('0x38')]));_0xfdec26[_0x52f5('0x37')]=_0xfdec26[_0x52f5('0x37')][_0x52f5('0x39')]?_0xfdec26[_0x52f5('0x37')]:_0x1daa00[_0x52f5('0x36')];if(!_0x37f1f9[_0x52f5('0x32')][_0x52f5('0x3a')](_0x52f5('0x3b'))){_0xfdec26[_0x52f5('0x1c')]=qs[_0x52f5('0x1c')](_0x37f1f9['query'][_0x52f5('0x1c')]);_0xfdec26[_0x52f5('0x1a')]=qs[_0x52f5('0x1a')](_0x37f1f9['query'][_0x52f5('0x1a')]);}_0xfdec26[_0x52f5('0x3c')]=qs[_0x52f5('0x3d')](_0x37f1f9[_0x52f5('0x32')][_0x52f5('0x3d')]);_0xfdec26['where']=qs['filters'](_[_0x52f5('0x3e')](_0x37f1f9[_0x52f5('0x32')],_0x1daa00[_0x52f5('0x34')]),_0x4b4530);if(_0x37f1f9['query'][_0x52f5('0x3f')]){_0xfdec26['where']=_['merge'](_0xfdec26['where'],{'$or':_['map'](_0x4b4530,function(_0x15c6c0){if(_0x15c6c0[_0x52f5('0x30')]!==_0x52f5('0x40')){var _0x2d6dfd={};_0x2d6dfd[_0x15c6c0['name']]={'$like':'%'+_0x37f1f9['query'][_0x52f5('0x3f')]+'%'};return _0x2d6dfd;}})});}_0xfdec26=_['merge']({},_0xfdec26,_0x37f1f9[_0x52f5('0x41')]);var _0x50b8a3={'where':_0xfdec26['where']};return db[_0x52f5('0x42')][_0x52f5('0x1d')](_0x50b8a3)['then'](function(_0x540cd2){_0x5c7d56['count']=_0x540cd2;if(_0x37f1f9[_0x52f5('0x32')][_0x52f5('0x43')]){_0xfdec26[_0x52f5('0x44')]=[{'all':!![]}];}return db[_0x52f5('0x42')][_0x52f5('0x45')](_0xfdec26);})[_0x52f5('0x24')](function(_0x31fb6f){_0x5c7d56[_0x52f5('0x46')]=_0x31fb6f;return _0x5c7d56;})[_0x52f5('0x24')](respondWithFilteredResult(_0x54b2bf,_0xfdec26))['catch'](handleError(_0x54b2bf,null));};exports[_0x52f5('0x47')]=function(_0x841dc2,_0x121fb9){var _0x342cf7={'raw':!![],'where':{'id':_0x841dc2['params']['id']}},_0x203e96={};_0x203e96['model']=_[_0x52f5('0x33')](db[_0x52f5('0x42')][_0x52f5('0x2e')]);_0x203e96[_0x52f5('0x32')]=_[_0x52f5('0x33')](_0x841dc2[_0x52f5('0x32')]);_0x203e96[_0x52f5('0x34')]=_[_0x52f5('0x35')](_0x203e96[_0x52f5('0x36')],_0x203e96[_0x52f5('0x32')]);_0x342cf7[_0x52f5('0x37')]=_[_0x52f5('0x35')](_0x203e96[_0x52f5('0x36')],qs[_0x52f5('0x38')](_0x841dc2[_0x52f5('0x32')][_0x52f5('0x38')]));_0x342cf7[_0x52f5('0x37')]=_0x342cf7[_0x52f5('0x37')][_0x52f5('0x39')]?_0x342cf7[_0x52f5('0x37')]:_0x203e96['model'];if(_0x841dc2[_0x52f5('0x32')][_0x52f5('0x43')]){_0x342cf7[_0x52f5('0x44')]=[{'all':!![]}];}_0x342cf7=_[_0x52f5('0x48')]({},_0x342cf7,_0x841dc2[_0x52f5('0x41')]);return db[_0x52f5('0x42')][_0x52f5('0x49')](_0x342cf7)['then'](handleEntityNotFound(_0x121fb9,null))['then'](respondWithResult(_0x121fb9,null))['catch'](handleError(_0x121fb9,null));};exports[_0x52f5('0x4a')]=function(_0x415935,_0x1d7bd0){return db[_0x52f5('0x42')][_0x52f5('0x4a')](_0x415935['body'],{})[_0x52f5('0x24')](function(_0x14806a){var _0x265315=_0x415935[_0x52f5('0x4b')][_0x52f5('0x26')]({'plain':!![]});if(!_0x265315)throw new Error(_0x52f5('0x4c'));if(_0x265315['role']==='user'){var _0x2de32c=_0x14806a[_0x52f5('0x26')]({'plain':!![]});var _0x1bdd2d=_0x52f5('0x27');return db[_0x52f5('0x4d')][_0x52f5('0x49')]({'where':{'name':_0x1bdd2d,'userProfileId':_0x265315[_0x52f5('0x4e')]},'raw':!![]})[_0x52f5('0x24')](function(_0x3d999e){if(_0x3d999e&&_0x3d999e[_0x52f5('0x4f')]===0x0){return db[_0x52f5('0x50')][_0x52f5('0x4a')]({'name':_0x2de32c[_0x52f5('0x2a')],'resourceId':_0x2de32c['id'],'type':_0x3d999e[_0x52f5('0x2a')],'sectionId':_0x3d999e['id']},{})[_0x52f5('0x24')](function(){return _0x14806a;});}else{return _0x14806a;}})[_0x52f5('0x51')](function(_0x48eeba){logger[_0x52f5('0x28')](_0x52f5('0x52'),_0x48eeba);throw _0x48eeba;});}return _0x14806a;})[_0x52f5('0x24')](respondWithResult(_0x1d7bd0,0xc9))[_0x52f5('0x51')](handleError(_0x1d7bd0,null));};exports[_0x52f5('0x23')]=function(_0x46f757,_0x38a277){if(_0x46f757[_0x52f5('0x53')]['id']){delete _0x46f757[_0x52f5('0x53')]['id'];}return db[_0x52f5('0x42')][_0x52f5('0x49')]({'where':{'id':_0x46f757['params']['id']}})[_0x52f5('0x24')](handleEntityNotFound(_0x38a277,null))[_0x52f5('0x24')](saveUpdates(_0x46f757[_0x52f5('0x53')],null))[_0x52f5('0x24')](respondWithResult(_0x38a277,null))[_0x52f5('0x51')](handleError(_0x38a277,null));};exports[_0x52f5('0x25')]=function(_0x812122,_0x433ac2){return db[_0x52f5('0x42')]['find']({'where':{'id':_0x812122[_0x52f5('0x54')]['id']}})[_0x52f5('0x24')](handleEntityNotFound(_0x433ac2,null))[_0x52f5('0x24')](removeEntity(_0x433ac2,null))[_0x52f5('0x51')](handleError(_0x433ac2,null));}; \ No newline at end of file +var _0x3eec=['then','end','error','stack','name','status','send','index','Template','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','merge','VIRTUAL','options','includeAll','include','rows','catch','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','offset','undefined','limit','count','save','update','destroy','Templates','UserProfileResource'];(function(_0x4e5af1,_0x1dfc1f){var _0x357f9d=function(_0x645f3b){while(--_0x645f3b){_0x4e5af1['push'](_0x4e5af1['shift']());}};_0x357f9d(++_0x1dfc1f);}(_0x3eec,0x164));var _0xc3ee=function(_0x22156f,_0x5e0ade){_0x22156f=_0x22156f-0x0;var _0xaf3a1d=_0x3eec[_0x22156f];return _0xaf3a1d;};'use strict';var emlformat=require(_0xc3ee('0x0'));var rimraf=require(_0xc3ee('0x1'));var zipdir=require(_0xc3ee('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc3ee('0x3'));var moment=require('moment');var BPromise=require(_0xc3ee('0x4'));var Mustache=require('mustache');var util=require(_0xc3ee('0x5'));var path=require(_0xc3ee('0x6'));var sox=require(_0xc3ee('0x7'));var csv=require(_0xc3ee('0x8'));var ejs=require(_0xc3ee('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc3ee('0xa'));var squel=require(_0xc3ee('0xb'));var crypto=require(_0xc3ee('0xc'));var jsforce=require(_0xc3ee('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc3ee('0x8'));var querystring=require(_0xc3ee('0xe'));var Papa=require(_0xc3ee('0xf'));var Redis=require(_0xc3ee('0x10'));var authService=require(_0xc3ee('0x11'));var qs=require(_0xc3ee('0x12'));var as=require(_0xc3ee('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc3ee('0x14'))(_0xc3ee('0x15'));var utils=require(_0xc3ee('0x16'));var config=require(_0xc3ee('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25a21b,_0x38a06c){_0x38a06c=_0x38a06c||0xcc;return function(_0x50ea88){if(_0x50ea88){return _0x25a21b[_0xc3ee('0x18')](_0x38a06c);}return _0x25a21b['status'](_0x38a06c)['end']();};}function respondWithResult(_0x3ee151,_0xe7ffb0){_0xe7ffb0=_0xe7ffb0||0xc8;return function(_0x49efdc){if(_0x49efdc){return _0x3ee151['status'](_0xe7ffb0)['json'](_0x49efdc);}};}function respondWithFilteredResult(_0x77593e,_0x11b1fa){return function(_0x59c171){if(_0x59c171){var _0x1f722b=typeof _0x11b1fa[_0xc3ee('0x19')]===_0xc3ee('0x1a')&&typeof _0x11b1fa[_0xc3ee('0x1b')]==='undefined';var _0x12ef8e=_0x59c171[_0xc3ee('0x1c')];var _0x2e21e4=_0x1f722b?0x0:_0x11b1fa[_0xc3ee('0x19')];var _0x37f1bd=_0x1f722b?_0x59c171['count']:_0x11b1fa[_0xc3ee('0x19')]+_0x11b1fa[_0xc3ee('0x1b')];var _0x42f4a6;if(_0x37f1bd>=_0x12ef8e){_0x37f1bd=_0x12ef8e;_0x42f4a6=0xc8;}else{_0x42f4a6=0xce;}_0x77593e['status'](_0x42f4a6);return _0x77593e['set']('Content-Range',_0x2e21e4+'-'+_0x37f1bd+'/'+_0x12ef8e)['json'](_0x59c171);}return null;};}function patchUpdates(_0x1d6aad){return function(_0x51b459){try{jsonpatch['apply'](_0x51b459,_0x1d6aad,!![]);}catch(_0x482e7a){return BPromise['reject'](_0x482e7a);}return _0x51b459[_0xc3ee('0x1d')]();};}function saveUpdates(_0xf8a40a,_0x2e6f03){return function(_0x19d793){if(_0x19d793){return _0x19d793[_0xc3ee('0x1e')](_0xf8a40a)['then'](function(_0x41ef5f){return _0x41ef5f;});}return null;};}function removeEntity(_0x3c81b6,_0x5a3c37){return function(_0x412034){if(_0x412034){return _0x412034[_0xc3ee('0x1f')]()['then'](function(){var _0x3baf60=_0x412034['get']({'plain':!![]});var _0x332e06=_0xc3ee('0x20');return db[_0xc3ee('0x21')][_0xc3ee('0x1f')]({'where':{'type':_0x332e06,'resourceId':_0x3baf60['id']}})[_0xc3ee('0x22')](function(){return _0x412034;});})[_0xc3ee('0x22')](function(){_0x3c81b6['status'](0xcc)[_0xc3ee('0x23')]();});}};}function handleEntityNotFound(_0x3b9da2,_0x1b9481){return function(_0x5abc60){if(!_0x5abc60){_0x3b9da2[_0xc3ee('0x18')](0x194);}return _0x5abc60;};}function handleError(_0xd7bc73,_0x3ebfde){_0x3ebfde=_0x3ebfde||0x1f4;return function(_0x5b700a){logger[_0xc3ee('0x24')](_0x5b700a[_0xc3ee('0x25')]);if(_0x5b700a[_0xc3ee('0x26')]){delete _0x5b700a[_0xc3ee('0x26')];}_0xd7bc73[_0xc3ee('0x27')](_0x3ebfde)[_0xc3ee('0x28')](_0x5b700a);};}exports[_0xc3ee('0x29')]=function(_0x12a397,_0x182486){var _0x47847b={},_0x313bcd={},_0x1385da={'count':0x0,'rows':[]};var _0x48d220=_['map'](db[_0xc3ee('0x2a')][_0xc3ee('0x2b')],function(_0x4aee4e){return{'name':_0x4aee4e[_0xc3ee('0x2c')],'type':_0x4aee4e[_0xc3ee('0x2d')][_0xc3ee('0x2e')]};});_0x313bcd[_0xc3ee('0x2f')]=_[_0xc3ee('0x30')](_0x48d220,'name');_0x313bcd[_0xc3ee('0x31')]=_[_0xc3ee('0x32')](_0x12a397['query']);_0x313bcd['filters']=_[_0xc3ee('0x33')](_0x313bcd[_0xc3ee('0x2f')],_0x313bcd['query']);_0x47847b[_0xc3ee('0x34')]=_[_0xc3ee('0x33')](_0x313bcd[_0xc3ee('0x2f')],qs['fields'](_0x12a397[_0xc3ee('0x31')][_0xc3ee('0x35')]));_0x47847b[_0xc3ee('0x34')]=_0x47847b[_0xc3ee('0x34')][_0xc3ee('0x36')]?_0x47847b['attributes']:_0x313bcd[_0xc3ee('0x2f')];if(!_0x12a397['query'][_0xc3ee('0x37')](_0xc3ee('0x38'))){_0x47847b['limit']=qs[_0xc3ee('0x1b')](_0x12a397[_0xc3ee('0x31')][_0xc3ee('0x1b')]);_0x47847b[_0xc3ee('0x19')]=qs[_0xc3ee('0x19')](_0x12a397[_0xc3ee('0x31')][_0xc3ee('0x19')]);}_0x47847b['order']=qs[_0xc3ee('0x39')](_0x12a397[_0xc3ee('0x31')][_0xc3ee('0x39')]);_0x47847b[_0xc3ee('0x3a')]=qs['filters'](_[_0xc3ee('0x3b')](_0x12a397[_0xc3ee('0x31')],_0x313bcd[_0xc3ee('0x3c')]),_0x48d220);if(_0x12a397[_0xc3ee('0x31')]['filter']){_0x47847b[_0xc3ee('0x3a')]=_[_0xc3ee('0x3d')](_0x47847b[_0xc3ee('0x3a')],{'$or':_[_0xc3ee('0x30')](_0x48d220,function(_0x11c4dc){if(_0x11c4dc['type']!==_0xc3ee('0x3e')){var _0x187898={};_0x187898[_0x11c4dc['name']]={'$like':'%'+_0x12a397[_0xc3ee('0x31')]['filter']+'%'};return _0x187898;}})});}_0x47847b=_[_0xc3ee('0x3d')]({},_0x47847b,_0x12a397[_0xc3ee('0x3f')]);var _0x2ba83b={'where':_0x47847b[_0xc3ee('0x3a')]};return db[_0xc3ee('0x2a')][_0xc3ee('0x1c')](_0x2ba83b)[_0xc3ee('0x22')](function(_0x21b527){_0x1385da['count']=_0x21b527;if(_0x12a397['query'][_0xc3ee('0x40')]){_0x47847b[_0xc3ee('0x41')]=[{'all':!![]}];}return db['Template']['findAll'](_0x47847b);})[_0xc3ee('0x22')](function(_0x228178){_0x1385da[_0xc3ee('0x42')]=_0x228178;return _0x1385da;})[_0xc3ee('0x22')](respondWithFilteredResult(_0x182486,_0x47847b))[_0xc3ee('0x43')](handleError(_0x182486,null));};exports['show']=function(_0x5a3fda,_0xb4112c){var _0x4ab42e={'raw':!![],'where':{'id':_0x5a3fda[_0xc3ee('0x44')]['id']}},_0x3e3c31={};_0x3e3c31[_0xc3ee('0x2f')]=_[_0xc3ee('0x32')](db[_0xc3ee('0x2a')][_0xc3ee('0x2b')]);_0x3e3c31[_0xc3ee('0x31')]=_['keys'](_0x5a3fda[_0xc3ee('0x31')]);_0x3e3c31[_0xc3ee('0x3c')]=_[_0xc3ee('0x33')](_0x3e3c31[_0xc3ee('0x2f')],_0x3e3c31[_0xc3ee('0x31')]);_0x4ab42e[_0xc3ee('0x34')]=_[_0xc3ee('0x33')](_0x3e3c31['model'],qs[_0xc3ee('0x35')](_0x5a3fda[_0xc3ee('0x31')]['fields']));_0x4ab42e[_0xc3ee('0x34')]=_0x4ab42e[_0xc3ee('0x34')][_0xc3ee('0x36')]?_0x4ab42e[_0xc3ee('0x34')]:_0x3e3c31[_0xc3ee('0x2f')];if(_0x5a3fda['query'][_0xc3ee('0x40')]){_0x4ab42e[_0xc3ee('0x41')]=[{'all':!![]}];}_0x4ab42e=_['merge']({},_0x4ab42e,_0x5a3fda['options']);return db[_0xc3ee('0x2a')]['find'](_0x4ab42e)['then'](handleEntityNotFound(_0xb4112c,null))['then'](respondWithResult(_0xb4112c,null))['catch'](handleError(_0xb4112c,null));};exports['create']=function(_0x420941,_0x5cfabb){return db[_0xc3ee('0x2a')][_0xc3ee('0x45')](_0x420941[_0xc3ee('0x46')],{})[_0xc3ee('0x22')](function(_0x3c3b9d){var _0x1bf161=_0x420941[_0xc3ee('0x47')][_0xc3ee('0x48')]({'plain':!![]});if(!_0x1bf161)throw new Error(_0xc3ee('0x49'));if(_0x1bf161['role']===_0xc3ee('0x47')){var _0x43840d=_0x3c3b9d[_0xc3ee('0x48')]({'plain':!![]});var _0x347b1c=_0xc3ee('0x20');return db[_0xc3ee('0x4a')]['find']({'where':{'name':_0x347b1c,'userProfileId':_0x1bf161[_0xc3ee('0x4b')]},'raw':!![]})[_0xc3ee('0x22')](function(_0x229cc2){if(_0x229cc2&&_0x229cc2['autoAssociation']===0x0){return db[_0xc3ee('0x21')][_0xc3ee('0x45')]({'name':_0x43840d[_0xc3ee('0x26')],'resourceId':_0x43840d['id'],'type':_0x229cc2[_0xc3ee('0x26')],'sectionId':_0x229cc2['id']},{})[_0xc3ee('0x22')](function(){return _0x3c3b9d;});}else{return _0x3c3b9d;}})['catch'](function(_0x491e1e){logger[_0xc3ee('0x24')](_0xc3ee('0x4c'),_0x491e1e);throw _0x491e1e;});}return _0x3c3b9d;})[_0xc3ee('0x22')](respondWithResult(_0x5cfabb,0xc9))['catch'](handleError(_0x5cfabb,null));};exports[_0xc3ee('0x1e')]=function(_0x13d9be,_0x396e3c){if(_0x13d9be[_0xc3ee('0x46')]['id']){delete _0x13d9be[_0xc3ee('0x46')]['id'];}return db[_0xc3ee('0x2a')][_0xc3ee('0x4d')]({'where':{'id':_0x13d9be['params']['id']}})[_0xc3ee('0x22')](handleEntityNotFound(_0x396e3c,null))[_0xc3ee('0x22')](saveUpdates(_0x13d9be[_0xc3ee('0x46')],null))[_0xc3ee('0x22')](respondWithResult(_0x396e3c,null))[_0xc3ee('0x43')](handleError(_0x396e3c,null));};exports['destroy']=function(_0x2eca9e,_0xcb29d9){return db[_0xc3ee('0x2a')][_0xc3ee('0x4d')]({'where':{'id':_0x2eca9e[_0xc3ee('0x44')]['id']}})[_0xc3ee('0x22')](handleEntityNotFound(_0xcb29d9,null))[_0xc3ee('0x22')](removeEntity(_0xcb29d9,null))[_0xc3ee('0x43')](handleError(_0xcb29d9,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index c3cc30f..2a4e724 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 _0x64bf=['./template.attributes','define','Template','tools_templates','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x64bf,0x1e5));var _0xf64b=function(_0x1d6dc7,_0x1fafbf){_0x1d6dc7=_0x1d6dc7-0x0;var _0x1effff=_0x64bf[_0x1d6dc7];return _0x1effff;};'use strict';var _=require(_0xf64b('0x0'));var util=require(_0xf64b('0x1'));var logger=require(_0xf64b('0x2'))(_0xf64b('0x3'));var moment=require(_0xf64b('0x4'));var BPromise=require(_0xf64b('0x5'));var rp=require(_0xf64b('0x6'));var fs=require('fs');var path=require(_0xf64b('0x7'));var rimraf=require(_0xf64b('0x8'));var config=require('../../config/environment');var attributes=require(_0xf64b('0x9'));module['exports']=function(_0x764c64,_0x1dfa48){return _0x764c64[_0xf64b('0xa')](_0xf64b('0xb'),attributes,{'tableName':_0xf64b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9cff=['request-promise','rimraf','./template.attributes','exports','define','tools_templates','../../config/logger','api','moment','bluebird'];(function(_0x2b6020,_0x31b7e4){var _0x2b26f6=function(_0x237031){while(--_0x237031){_0x2b6020['push'](_0x2b6020['shift']());}};_0x2b26f6(++_0x31b7e4);}(_0x9cff,0x196));var _0xf9cf=function(_0x19dfb1,_0x2b10b7){_0x19dfb1=_0x19dfb1-0x0;var _0x36ce8c=_0x9cff[_0x19dfb1];return _0x36ce8c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf9cf('0x0'))(_0xf9cf('0x1'));var moment=require(_0xf9cf('0x2'));var BPromise=require(_0xf9cf('0x3'));var rp=require(_0xf9cf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf9cf('0x5'));var config=require('../../config/environment');var attributes=require(_0xf9cf('0x6'));module[_0xf9cf('0x7')]=function(_0x134281,_0x480eeb){return _0x134281[_0xf9cf('0x8')]('Template',attributes,{'tableName':_0xf9cf('0x9'),'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 4c4d9da..3356e25 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 _0xcf36=['code','message','request\x20sent','result','catch','findAll','options','raw','where','limit','include','map','model','attributes','GetTemplate','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcf36,0xc3));var _0x6cf3=function(_0x114ef0,_0x191587){_0x114ef0=_0x114ef0-0x0;var _0x94deec=_0xcf36[_0x114ef0];return _0x94deec;};'use strict';var _=require(_0x6cf3('0x0'));var util=require(_0x6cf3('0x1'));var moment=require(_0x6cf3('0x2'));var BPromise=require(_0x6cf3('0x3'));var rs=require(_0x6cf3('0x4'));var fs=require('fs');var Redis=require(_0x6cf3('0x5'));var db=require(_0x6cf3('0x6'))['db'];var utils=require(_0x6cf3('0x7'));var logger=require(_0x6cf3('0x8'))(_0x6cf3('0x9'));var config=require(_0x6cf3('0xa'));var jayson=require(_0x6cf3('0xb'));var client=jayson[_0x6cf3('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55994e,_0xed1fff,_0x7faa89){return new BPromise(function(_0x2ba062,_0x5ecb66){return client[_0x6cf3('0xd')](_0x55994e,_0x7faa89)[_0x6cf3('0xe')](function(_0x21d4d0){logger[_0x6cf3('0xf')](_0x6cf3('0x10'),_0xed1fff,'request\x20sent');logger[_0x6cf3('0x11')](_0x6cf3('0x12'),_0xed1fff,'request\x20sent',JSON[_0x6cf3('0x13')](_0x21d4d0));if(_0x21d4d0[_0x6cf3('0x14')]){if(_0x21d4d0['error'][_0x6cf3('0x15')]===0x1f4){logger[_0x6cf3('0x14')](_0x6cf3('0x10'),_0xed1fff,_0x21d4d0[_0x6cf3('0x14')]['message']);return _0x5ecb66(_0x21d4d0[_0x6cf3('0x14')][_0x6cf3('0x16')]);}logger[_0x6cf3('0x14')](_0x6cf3('0x10'),_0xed1fff,_0x21d4d0['error']['message']);return _0x2ba062(_0x21d4d0[_0x6cf3('0x14')]['message']);}else{logger[_0x6cf3('0xf')](_0x6cf3('0x10'),_0xed1fff,_0x6cf3('0x17'));_0x2ba062(_0x21d4d0[_0x6cf3('0x18')][_0x6cf3('0x16')]);}})[_0x6cf3('0x19')](function(_0x5eec56){logger[_0x6cf3('0x14')](_0x6cf3('0x10'),_0xed1fff,_0x5eec56);_0x5ecb66(_0x5eec56);});});}exports['GetTemplate']=function(_0x5e1a15){var _0x161721=this;return new Promise(function(_0x57cbd9,_0x3f3793){return db['Template'][_0x6cf3('0x1a')]({'raw':_0x5e1a15[_0x6cf3('0x1b')]?_0x5e1a15[_0x6cf3('0x1b')][_0x6cf3('0x1c')]===undefined?!![]:![]:!![],'where':_0x5e1a15['options']?_0x5e1a15['options'][_0x6cf3('0x1d')]||null:null,'attributes':_0x5e1a15['options']?_0x5e1a15[_0x6cf3('0x1b')]['attributes']||null:null,'limit':_0x5e1a15[_0x6cf3('0x1b')]?_0x5e1a15[_0x6cf3('0x1b')][_0x6cf3('0x1e')]||null:null,'include':_0x5e1a15[_0x6cf3('0x1b')]?_0x5e1a15[_0x6cf3('0x1b')][_0x6cf3('0x1f')]?_[_0x6cf3('0x20')](_0x5e1a15[_0x6cf3('0x1b')][_0x6cf3('0x1f')],function(_0x1c54f8){return{'model':db[_0x1c54f8[_0x6cf3('0x21')]],'as':_0x1c54f8['as'],'attributes':_0x1c54f8[_0x6cf3('0x22')],'include':_0x1c54f8[_0x6cf3('0x1f')]?_[_0x6cf3('0x20')](_0x1c54f8[_0x6cf3('0x1f')],function(_0x55a123){return{'model':db[_0x55a123[_0x6cf3('0x21')]],'as':_0x55a123['as'],'attributes':_0x55a123[_0x6cf3('0x22')],'include':_0x55a123[_0x6cf3('0x1f')]?_[_0x6cf3('0x20')](_0x55a123[_0x6cf3('0x1f')],function(_0x9d9848){return{'model':db[_0x9d9848['model']],'as':_0x9d9848['as'],'attributes':_0x9d9848[_0x6cf3('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e06f8){logger[_0x6cf3('0xf')]('GetTemplate',_0x5e1a15);logger[_0x6cf3('0x11')](_0x6cf3('0x23'),_0x5e1a15,JSON[_0x6cf3('0x13')](_0x3e06f8));_0x57cbd9(_0x3e06f8);})[_0x6cf3('0x19')](function(_0x2d97da){logger['error']('GetTemplate',_0x2d97da[_0x6cf3('0x16')],_0x5e1a15);_0x3f3793(_0x161721[_0x6cf3('0x14')](0x1f4,_0x2d97da[_0x6cf3('0x16')]));});});}; \ No newline at end of file +var _0xc0ac=['map','model','info','debug','GetTemplate','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','http','request','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Template','findAll','options','raw','where','attributes','include'];(function(_0x26e5e2,_0x4fd06a){var _0x4facd8=function(_0x3e1348){while(--_0x3e1348){_0x26e5e2['push'](_0x26e5e2['shift']());}};_0x4facd8(++_0x4fd06a);}(_0xc0ac,0x65));var _0xcc0a=function(_0x335db2,_0x2e2e4e){_0x335db2=_0x335db2-0x0;var _0x1cd492=_0xc0ac[_0x335db2];return _0x1cd492;};'use strict';var _=require(_0xcc0a('0x0'));var util=require(_0xcc0a('0x1'));var moment=require(_0xcc0a('0x2'));var BPromise=require(_0xcc0a('0x3'));var rs=require(_0xcc0a('0x4'));var fs=require('fs');var Redis=require(_0xcc0a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcc0a('0x6'))('rpc');var config=require(_0xcc0a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcc0a('0x8')][_0xcc0a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x186f0e,_0x308489,_0x537b99){return new BPromise(function(_0xbc7653,_0x5195c2){return client[_0xcc0a('0xa')](_0x186f0e,_0x537b99)['then'](function(_0x1c017c){logger['info'](_0xcc0a('0xb'),_0x308489,_0xcc0a('0xc'));logger['debug'](_0xcc0a('0xd'),_0x308489,_0xcc0a('0xc'),JSON[_0xcc0a('0xe')](_0x1c017c));if(_0x1c017c[_0xcc0a('0xf')]){if(_0x1c017c['error'][_0xcc0a('0x10')]===0x1f4){logger[_0xcc0a('0xf')](_0xcc0a('0xb'),_0x308489,_0x1c017c[_0xcc0a('0xf')][_0xcc0a('0x11')]);return _0x5195c2(_0x1c017c[_0xcc0a('0xf')][_0xcc0a('0x11')]);}logger[_0xcc0a('0xf')]('Template,\x20%s,\x20%s',_0x308489,_0x1c017c[_0xcc0a('0xf')][_0xcc0a('0x11')]);return _0xbc7653(_0x1c017c[_0xcc0a('0xf')][_0xcc0a('0x11')]);}else{logger['info'](_0xcc0a('0xb'),_0x308489,'request\x20sent');_0xbc7653(_0x1c017c[_0xcc0a('0x12')]['message']);}})[_0xcc0a('0x13')](function(_0x912b1c){logger['error']('Template,\x20%s,\x20%s',_0x308489,_0x912b1c);_0x5195c2(_0x912b1c);});});}exports['GetTemplate']=function(_0x4230ee){var _0x867d0c=this;return new Promise(function(_0x27433e,_0x405c21){return db[_0xcc0a('0x14')][_0xcc0a('0x15')]({'raw':_0x4230ee[_0xcc0a('0x16')]?_0x4230ee['options'][_0xcc0a('0x17')]===undefined?!![]:![]:!![],'where':_0x4230ee[_0xcc0a('0x16')]?_0x4230ee[_0xcc0a('0x16')][_0xcc0a('0x18')]||null:null,'attributes':_0x4230ee[_0xcc0a('0x16')]?_0x4230ee['options'][_0xcc0a('0x19')]||null:null,'limit':_0x4230ee['options']?_0x4230ee[_0xcc0a('0x16')]['limit']||null:null,'include':_0x4230ee[_0xcc0a('0x16')]?_0x4230ee[_0xcc0a('0x16')][_0xcc0a('0x1a')]?_[_0xcc0a('0x1b')](_0x4230ee[_0xcc0a('0x16')][_0xcc0a('0x1a')],function(_0x2633c1){return{'model':db[_0x2633c1[_0xcc0a('0x1c')]],'as':_0x2633c1['as'],'attributes':_0x2633c1[_0xcc0a('0x19')],'include':_0x2633c1[_0xcc0a('0x1a')]?_[_0xcc0a('0x1b')](_0x2633c1[_0xcc0a('0x1a')],function(_0x29843d){return{'model':db[_0x29843d[_0xcc0a('0x1c')]],'as':_0x29843d['as'],'attributes':_0x29843d[_0xcc0a('0x19')],'include':_0x29843d[_0xcc0a('0x1a')]?_[_0xcc0a('0x1b')](_0x29843d[_0xcc0a('0x1a')],function(_0x1e45e2){return{'model':db[_0x1e45e2['model']],'as':_0x1e45e2['as'],'attributes':_0x1e45e2[_0xcc0a('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ec74f){logger[_0xcc0a('0x1d')]('GetTemplate',_0x4230ee);logger[_0xcc0a('0x1e')](_0xcc0a('0x1f'),_0x4230ee,JSON['stringify'](_0x5ec74f));_0x27433e(_0x5ec74f);})['catch'](function(_0x583b1d){logger[_0xcc0a('0xf')](_0xcc0a('0x1f'),_0x583b1d[_0xcc0a('0x11')],_0x4230ee);_0x405c21(_0x867d0c[_0xcc0a('0xf')](0x1f4,_0x583b1d[_0xcc0a('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 7e0fb73..5e3e575 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 _0x5d72=['put','update','delete','exports','multer','util','path','express','fs-extra','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getActions','post','create','addAllCondition','/:id/actions','addAction'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x5d72,0x7c));var _0x25d7=function(_0x5aa992,_0x559ebb){_0x5aa992=_0x5aa992-0x0;var _0x2e2d59=_0x5d72[_0x5aa992];return _0x2e2d59;};'use strict';var multer=require(_0x25d7('0x0'));var util=require(_0x25d7('0x1'));var path=require(_0x25d7('0x2'));var timeout=require('connect-timeout');var express=require(_0x25d7('0x3'));var router=express['Router']();var fs_extra=require(_0x25d7('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x25d7('0x5'));router[_0x25d7('0x6')]('/',auth[_0x25d7('0x7')](),controller[_0x25d7('0x8')]);router[_0x25d7('0x6')](_0x25d7('0x9'),auth['isAuthenticated'](),controller[_0x25d7('0xa')]);router[_0x25d7('0x6')](_0x25d7('0xb'),auth[_0x25d7('0x7')](),controller[_0x25d7('0xc')]);router['get'](_0x25d7('0xd'),auth['isAuthenticated'](),controller['getAnyConditions']);router[_0x25d7('0x6')]('/:id/actions',auth[_0x25d7('0x7')](),controller[_0x25d7('0xe')]);router[_0x25d7('0xf')]('/',auth['isAuthenticated'](),controller[_0x25d7('0x10')]);router[_0x25d7('0xf')]('/:id/all_conditions',auth[_0x25d7('0x7')](),controller[_0x25d7('0x11')]);router[_0x25d7('0xf')](_0x25d7('0xd'),auth[_0x25d7('0x7')](),controller['addAnyCondition']);router['post'](_0x25d7('0x12'),auth[_0x25d7('0x7')](),controller[_0x25d7('0x13')]);router[_0x25d7('0x14')](_0x25d7('0x9'),auth[_0x25d7('0x7')](),controller[_0x25d7('0x15')]);router[_0x25d7('0x16')]('/:id',auth[_0x25d7('0x7')](),controller['destroy']);module[_0x25d7('0x17')]=router; \ No newline at end of file +var _0x658b=['exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','post','addAllCondition','addAnyCondition','put','update','delete','destroy'];(function(_0x45f8a9,_0xb30e6b){var _0xf7d347=function(_0x5a8ac5){while(--_0x5a8ac5){_0x45f8a9['push'](_0x45f8a9['shift']());}};_0xf7d347(++_0xb30e6b);}(_0x658b,0x11f));var _0xb658=function(_0x182775,_0x19fa84){_0x182775=_0x182775-0x0;var _0x4df5c5=_0x658b[_0x182775];return _0x4df5c5;};'use strict';var multer=require(_0xb658('0x0'));var util=require(_0xb658('0x1'));var path=require(_0xb658('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb658('0x3')]();var fs_extra=require(_0xb658('0x4'));var auth=require(_0xb658('0x5'));var interaction=require(_0xb658('0x6'));var config=require(_0xb658('0x7'));var controller=require('./trigger.controller');router[_0xb658('0x8')]('/',auth['isAuthenticated'](),controller[_0xb658('0x9')]);router[_0xb658('0x8')](_0xb658('0xa'),auth[_0xb658('0xb')](),controller[_0xb658('0xc')]);router['get'](_0xb658('0xd'),auth[_0xb658('0xb')](),controller[_0xb658('0xe')]);router[_0xb658('0x8')](_0xb658('0xf'),auth['isAuthenticated'](),controller[_0xb658('0x10')]);router[_0xb658('0x8')](_0xb658('0x11'),auth[_0xb658('0xb')](),controller['getActions']);router[_0xb658('0x12')]('/',auth[_0xb658('0xb')](),controller['create']);router[_0xb658('0x12')](_0xb658('0xd'),auth[_0xb658('0xb')](),controller[_0xb658('0x13')]);router[_0xb658('0x12')](_0xb658('0xf'),auth[_0xb658('0xb')](),controller[_0xb658('0x14')]);router[_0xb658('0x12')](_0xb658('0x11'),auth[_0xb658('0xb')](),controller['addAction']);router[_0xb658('0x15')]('/:id',auth[_0xb658('0xb')](),controller[_0xb658('0x16')]);router[_0xb658('0x17')](_0xb658('0xa'),auth[_0xb658('0xb')](),controller[_0xb658('0x18')]);module[_0xb658('0x19')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index b453230..6c21644 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 _0x63c7=['exports','STRING','BOOLEAN','sequelize'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x63c7,0x9b));var _0x763c=function(_0x561178,_0x1df232){_0x561178=_0x561178-0x0;var _0x68ac2d=_0x63c7[_0x561178];return _0x68ac2d;};'use strict';var Sequelize=require(_0x763c('0x0'));module[_0x763c('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x763c('0x2')]},'description':{'type':Sequelize[_0x763c('0x2')]},'status':{'type':Sequelize[_0x763c('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x199c=['sequelize','exports','STRING'];(function(_0x27e573,_0x2b5d40){var _0x4561aa=function(_0x1f2a3c){while(--_0x1f2a3c){_0x27e573['push'](_0x27e573['shift']());}};_0x4561aa(++_0x2b5d40);}(_0x199c,0x174));var _0xc199=function(_0x193a6f,_0x3fae3a){_0x193a6f=_0x193a6f-0x0;var _0x52be10=_0x199c[_0x193a6f];return _0x52be10;};'use strict';var Sequelize=require(_0xc199('0x0'));module[_0xc199('0x1')]={'name':{'type':Sequelize[_0xc199('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 0bf8bd8..29924cb 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 _0xc33b=['zip-dir','fast-json-patch','bluebird','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','Triggers','UserProfileResource','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','Condition','addAnyCondition','TriggerAnyId','getAllConditions','hasOwnProperty','getAnyConditions','findOne','addAction','TriggerId','Action','getActions','rimraf'];(function(_0x402949,_0x2bae72){var _0x2d8e41=function(_0x7f5a50){while(--_0x7f5a50){_0x402949['push'](_0x402949['shift']());}};_0x2d8e41(++_0x2bae72);}(_0xc33b,0x1cb));var _0xbc33=function(_0x4d8f7e,_0x2a8808){_0x4d8f7e=_0x4d8f7e-0x0;var _0x4369aa=_0xc33b[_0x4d8f7e];return _0x4369aa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbc33('0x0'));var zipdir=require(_0xbc33('0x1'));var jsonpatch=require(_0xbc33('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbc33('0x3'));var Mustache=require('mustache');var util=require(_0xbc33('0x4'));var path=require(_0xbc33('0x5'));var sox=require('sox');var csv=require(_0xbc33('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbc33('0x7'));var squel=require(_0xbc33('0x8'));var crypto=require(_0xbc33('0x9'));var jsforce=require(_0xbc33('0xa'));var deskjs=require(_0xbc33('0xb'));var toCsv=require(_0xbc33('0x6'));var querystring=require(_0xbc33('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbc33('0xd'));var qs=require(_0xbc33('0xe'));var as=require(_0xbc33('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbc33('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xbc33('0x11'));var licenseUtil=require(_0xbc33('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c0c24,_0x24e8c4){_0x24e8c4=_0x24e8c4||0xcc;return function(_0x3f6abc){if(_0x3f6abc){return _0x5c0c24[_0xbc33('0x13')](_0x24e8c4);}return _0x5c0c24[_0xbc33('0x14')](_0x24e8c4)[_0xbc33('0x15')]();};}function respondWithResult(_0x5b31b5,_0xcce8d5){_0xcce8d5=_0xcce8d5||0xc8;return function(_0x228fb5){if(_0x228fb5){return _0x5b31b5[_0xbc33('0x14')](_0xcce8d5)[_0xbc33('0x16')](_0x228fb5);}};}function respondWithFilteredResult(_0x4784ef,_0xe5b55b){return function(_0x1726d1){if(_0x1726d1){var _0x101db1=typeof _0xe5b55b['offset']===_0xbc33('0x17')&&typeof _0xe5b55b['limit']===_0xbc33('0x17');var _0x33cc99=_0x1726d1['count'];var _0x43794c=_0x101db1?0x0:_0xe5b55b['offset'];var _0x529e41=_0x101db1?_0x1726d1[_0xbc33('0x18')]:_0xe5b55b[_0xbc33('0x19')]+_0xe5b55b[_0xbc33('0x1a')];var _0x5be0e1;if(_0x529e41>=_0x33cc99){_0x529e41=_0x33cc99;_0x5be0e1=0xc8;}else{_0x5be0e1=0xce;}_0x4784ef[_0xbc33('0x14')](_0x5be0e1);return _0x4784ef[_0xbc33('0x1b')](_0xbc33('0x1c'),_0x43794c+'-'+_0x529e41+'/'+_0x33cc99)[_0xbc33('0x16')](_0x1726d1);}return null;};}function patchUpdates(_0x299ff5){return function(_0x53b5df){try{jsonpatch[_0xbc33('0x1d')](_0x53b5df,_0x299ff5,!![]);}catch(_0x465821){return BPromise[_0xbc33('0x1e')](_0x465821);}return _0x53b5df[_0xbc33('0x1f')]();};}function saveUpdates(_0x2b1f0a,_0x152ae5){return function(_0x22d549){if(_0x22d549){return _0x22d549[_0xbc33('0x20')](_0x2b1f0a)['then'](function(_0x41a204){return _0x41a204;});}return null;};}function removeEntity(_0x4194e9,_0x58d7ca){return function(_0x2ea4a8){if(_0x2ea4a8){return _0x2ea4a8[_0xbc33('0x21')]()[_0xbc33('0x22')](function(){var _0x53f735=_0x2ea4a8[_0xbc33('0x23')]({'plain':!![]});var _0xaed4d0=_0xbc33('0x24');return db[_0xbc33('0x25')][_0xbc33('0x21')]({'where':{'type':_0xaed4d0,'resourceId':_0x53f735['id']}})[_0xbc33('0x22')](function(){return _0x2ea4a8;});})[_0xbc33('0x22')](function(){_0x4194e9['status'](0xcc)[_0xbc33('0x15')]();});}};}function handleEntityNotFound(_0x8ddd48,_0x56fa48){return function(_0x203af6){if(!_0x203af6){_0x8ddd48['sendStatus'](0x194);}return _0x203af6;};}function handleError(_0x54bec0,_0x40a6f5){_0x40a6f5=_0x40a6f5||0x1f4;return function(_0x34ea6c){logger[_0xbc33('0x26')](_0x34ea6c[_0xbc33('0x27')]);if(_0x34ea6c['name']){delete _0x34ea6c[_0xbc33('0x28')];}_0x54bec0['status'](_0x40a6f5)[_0xbc33('0x29')](_0x34ea6c);};}exports[_0xbc33('0x2a')]=function(_0x330c4e,_0x7aa20f){var _0x15725d={},_0x52326b={},_0x28c6fe={'count':0x0,'rows':[]};var _0x72fffc=_[_0xbc33('0x2b')](db[_0xbc33('0x2c')][_0xbc33('0x2d')],function(_0x285ae2){return{'name':_0x285ae2[_0xbc33('0x2e')],'type':_0x285ae2[_0xbc33('0x2f')]['key']};});_0x52326b[_0xbc33('0x30')]=_[_0xbc33('0x2b')](_0x72fffc,_0xbc33('0x28'));_0x52326b[_0xbc33('0x31')]=_[_0xbc33('0x32')](_0x330c4e[_0xbc33('0x31')]);_0x52326b[_0xbc33('0x33')]=_['intersection'](_0x52326b[_0xbc33('0x30')],_0x52326b[_0xbc33('0x31')]);_0x15725d['attributes']=_[_0xbc33('0x34')](_0x52326b['model'],qs[_0xbc33('0x35')](_0x330c4e[_0xbc33('0x31')]['fields']));_0x15725d[_0xbc33('0x36')]=_0x15725d[_0xbc33('0x36')][_0xbc33('0x37')]?_0x15725d[_0xbc33('0x36')]:_0x52326b[_0xbc33('0x30')];if(!_0x330c4e[_0xbc33('0x31')]['hasOwnProperty'](_0xbc33('0x38'))){_0x15725d[_0xbc33('0x1a')]=qs[_0xbc33('0x1a')](_0x330c4e['query'][_0xbc33('0x1a')]);_0x15725d['offset']=qs[_0xbc33('0x19')](_0x330c4e[_0xbc33('0x31')][_0xbc33('0x19')]);}_0x15725d[_0xbc33('0x39')]=qs[_0xbc33('0x3a')](_0x330c4e[_0xbc33('0x31')]['sort']);_0x15725d[_0xbc33('0x3b')]=qs[_0xbc33('0x33')](_[_0xbc33('0x3c')](_0x330c4e[_0xbc33('0x31')],_0x52326b[_0xbc33('0x33')]),_0x72fffc);if(_0x330c4e[_0xbc33('0x31')][_0xbc33('0x3d')]){_0x15725d['where']=_[_0xbc33('0x3e')](_0x15725d[_0xbc33('0x3b')],{'$or':_[_0xbc33('0x2b')](_0x72fffc,function(_0x3f588a){if(_0x3f588a['type']!=='VIRTUAL'){var _0xab4cb3={};_0xab4cb3[_0x3f588a[_0xbc33('0x28')]]={'$like':'%'+_0x330c4e[_0xbc33('0x31')]['filter']+'%'};return _0xab4cb3;}})});}_0x15725d=_['merge']({},_0x15725d,_0x330c4e[_0xbc33('0x3f')]);var _0x1c2b64={'where':_0x15725d[_0xbc33('0x3b')]};return db[_0xbc33('0x2c')][_0xbc33('0x18')](_0x1c2b64)[_0xbc33('0x22')](function(_0x4144c4){_0x28c6fe['count']=_0x4144c4;if(_0x330c4e[_0xbc33('0x31')][_0xbc33('0x40')]){_0x15725d[_0xbc33('0x41')]=[{'all':!![]}];}return db[_0xbc33('0x2c')][_0xbc33('0x42')](_0x15725d);})[_0xbc33('0x22')](function(_0x363e44){_0x28c6fe[_0xbc33('0x43')]=_0x363e44;return _0x28c6fe;})[_0xbc33('0x22')](respondWithFilteredResult(_0x7aa20f,_0x15725d))[_0xbc33('0x44')](handleError(_0x7aa20f,null));};exports['show']=function(_0x4166bb,_0x5af052){var _0xb78eea={'raw':![],'where':{'id':_0x4166bb[_0xbc33('0x45')]['id']}},_0x586cc1={};_0x586cc1['model']=_[_0xbc33('0x32')](db[_0xbc33('0x2c')]['rawAttributes']);_0x586cc1['query']=_['keys'](_0x4166bb[_0xbc33('0x31')]);_0x586cc1[_0xbc33('0x33')]=_[_0xbc33('0x34')](_0x586cc1['model'],_0x586cc1[_0xbc33('0x31')]);_0xb78eea[_0xbc33('0x36')]=_[_0xbc33('0x34')](_0x586cc1[_0xbc33('0x30')],qs[_0xbc33('0x35')](_0x4166bb[_0xbc33('0x31')][_0xbc33('0x35')]));_0xb78eea[_0xbc33('0x36')]=_0xb78eea['attributes']['length']?_0xb78eea[_0xbc33('0x36')]:_0x586cc1[_0xbc33('0x30')];if(_0x4166bb[_0xbc33('0x31')][_0xbc33('0x40')]){_0xb78eea[_0xbc33('0x41')]=[{'all':!![]}];}_0xb78eea=_[_0xbc33('0x3e')]({},_0xb78eea,_0x4166bb[_0xbc33('0x3f')]);return db[_0xbc33('0x2c')][_0xbc33('0x46')](_0xb78eea)[_0xbc33('0x22')](handleEntityNotFound(_0x5af052,null))[_0xbc33('0x22')](respondWithResult(_0x5af052,null))[_0xbc33('0x44')](handleError(_0x5af052,null));};exports[_0xbc33('0x47')]=function(_0x38d887,_0x12c621){return db['Trigger'][_0xbc33('0x47')](_0x38d887[_0xbc33('0x48')],{})[_0xbc33('0x22')](function(_0x25c846){var _0x3e373e=_0x38d887[_0xbc33('0x49')][_0xbc33('0x23')]({'plain':!![]});if(!_0x3e373e)throw new Error(_0xbc33('0x4a'));if(_0x3e373e[_0xbc33('0x4b')]===_0xbc33('0x49')){var _0x5c7c27=_0x25c846[_0xbc33('0x23')]({'plain':!![]});var _0x1e9184=_0xbc33('0x24');return db[_0xbc33('0x4c')][_0xbc33('0x46')]({'where':{'name':_0x1e9184,'userProfileId':_0x3e373e[_0xbc33('0x4d')]},'raw':!![]})[_0xbc33('0x22')](function(_0x55d054){if(_0x55d054&&_0x55d054[_0xbc33('0x4e')]===0x0){return db[_0xbc33('0x25')][_0xbc33('0x47')]({'name':_0x5c7c27[_0xbc33('0x28')],'resourceId':_0x5c7c27['id'],'type':_0x55d054[_0xbc33('0x28')],'sectionId':_0x55d054['id']},{})[_0xbc33('0x22')](function(){return _0x25c846;});}else{return _0x25c846;}})[_0xbc33('0x44')](function(_0x576e19){logger[_0xbc33('0x26')](_0xbc33('0x4f'),_0x576e19);throw _0x576e19;});}return _0x25c846;})[_0xbc33('0x22')](respondWithResult(_0x12c621,0xc9))[_0xbc33('0x44')](handleError(_0x12c621,null));};exports[_0xbc33('0x20')]=function(_0x35edc4,_0x392f0a){if(_0x35edc4['body']['id']){delete _0x35edc4[_0xbc33('0x48')]['id'];}return db['Trigger'][_0xbc33('0x46')]({'where':{'id':_0x35edc4[_0xbc33('0x45')]['id']}})['then'](handleEntityNotFound(_0x392f0a,null))['then'](saveUpdates(_0x35edc4[_0xbc33('0x48')],null))['then'](respondWithResult(_0x392f0a,null))[_0xbc33('0x44')](handleError(_0x392f0a,null));};exports[_0xbc33('0x21')]=function(_0x5e026e,_0xfa6938){return db[_0xbc33('0x2c')][_0xbc33('0x46')]({'where':{'id':_0x5e026e[_0xbc33('0x45')]['id']}})['then'](handleEntityNotFound(_0xfa6938,null))['then'](removeEntity(_0xfa6938,null))['catch'](handleError(_0xfa6938,null));};exports[_0xbc33('0x50')]=function(_0x2c1938,_0x3cbdcb,_0x5730a3){if(_0x2c1938['body']['id']){delete _0x2c1938['body']['id'];}return db[_0xbc33('0x2c')][_0xbc33('0x46')]({'where':{'id':_0x2c1938[_0xbc33('0x45')]['id']}})['then'](handleEntityNotFound(_0x3cbdcb,null))[_0xbc33('0x22')](function(_0x20eb0a){if(_0x20eb0a){_0x2c1938[_0xbc33('0x48')]['TriggerAllId']=_0x20eb0a['id'];return db[_0xbc33('0x51')][_0xbc33('0x47')](_0x2c1938[_0xbc33('0x48')]);}})[_0xbc33('0x22')](respondWithResult(_0x3cbdcb,null))[_0xbc33('0x44')](handleError(_0x3cbdcb,null));};exports[_0xbc33('0x52')]=function(_0x5bd8e2,_0x37d32c,_0x545cb3){if(_0x5bd8e2[_0xbc33('0x48')]['id']){delete _0x5bd8e2[_0xbc33('0x48')]['id'];}return db[_0xbc33('0x2c')][_0xbc33('0x46')]({'where':{'id':_0x5bd8e2[_0xbc33('0x45')]['id']}})[_0xbc33('0x22')](handleEntityNotFound(_0x37d32c,null))['then'](function(_0x4260dd){if(_0x4260dd){_0x5bd8e2[_0xbc33('0x48')][_0xbc33('0x53')]=_0x4260dd['id'];return db['Condition'][_0xbc33('0x47')](_0x5bd8e2[_0xbc33('0x48')]);}})['then'](respondWithResult(_0x37d32c,null))[_0xbc33('0x44')](handleError(_0x37d32c,null));};exports[_0xbc33('0x54')]=function(_0x2cc287,_0x140aad,_0x39e4e3){var _0x2b018c={};var _0x4f5599={};var _0x56731f;var _0x55e08a;return db[_0xbc33('0x2c')]['findOne']({'where':{'id':_0x2cc287[_0xbc33('0x45')]['id']}})[_0xbc33('0x22')](handleEntityNotFound(_0x140aad,null))[_0xbc33('0x22')](function(_0x3152e1){if(_0x3152e1){_0x56731f=_0x3152e1;_0x4f5599['model']=_[_0xbc33('0x32')](db[_0xbc33('0x51')][_0xbc33('0x2d')]);_0x4f5599['query']=_[_0xbc33('0x32')](_0x2cc287['query']);_0x4f5599[_0xbc33('0x33')]=_[_0xbc33('0x34')](_0x4f5599[_0xbc33('0x30')],_0x4f5599[_0xbc33('0x31')]);_0x2b018c['attributes']=_['intersection'](_0x4f5599['model'],qs[_0xbc33('0x35')](_0x2cc287[_0xbc33('0x31')]['fields']));_0x2b018c[_0xbc33('0x36')]=_0x2b018c[_0xbc33('0x36')]['length']?_0x2b018c['attributes']:_0x4f5599[_0xbc33('0x30')];_0x2b018c[_0xbc33('0x39')]=qs[_0xbc33('0x3a')](_0x2cc287[_0xbc33('0x31')]['sort']);_0x2b018c[_0xbc33('0x3b')]=qs[_0xbc33('0x33')](_[_0xbc33('0x3c')](_0x2cc287[_0xbc33('0x31')],_0x4f5599['filters']));if(_0x2cc287[_0xbc33('0x31')][_0xbc33('0x3d')]){_0x2b018c[_0xbc33('0x3b')]=_[_0xbc33('0x3e')](_0x2b018c[_0xbc33('0x3b')],{'$or':_[_0xbc33('0x2b')](_0x2b018c[_0xbc33('0x36')],function(_0x3bb0a9){var _0x5df3a1={};_0x5df3a1[_0x3bb0a9]={'$like':'%'+_0x2cc287[_0xbc33('0x31')][_0xbc33('0x3d')]+'%'};return _0x5df3a1;})});}_0x2b018c=_[_0xbc33('0x3e')]({},_0x2b018c,_0x2cc287[_0xbc33('0x3f')]);return _0x56731f[_0xbc33('0x54')](_0x2b018c);}})[_0xbc33('0x22')](function(_0x30715c){if(_0x30715c){_0x55e08a=_0x30715c['length'];if(!_0x2cc287[_0xbc33('0x31')][_0xbc33('0x55')](_0xbc33('0x38'))){_0x2b018c[_0xbc33('0x1a')]=qs[_0xbc33('0x1a')](_0x2cc287[_0xbc33('0x31')][_0xbc33('0x1a')]);_0x2b018c[_0xbc33('0x19')]=qs[_0xbc33('0x19')](_0x2cc287['query']['offset']);}return _0x56731f[_0xbc33('0x54')](_0x2b018c);}})['then'](function(_0x43a76d){if(_0x43a76d){return _0x43a76d?{'count':_0x55e08a,'rows':_0x43a76d}:null;}})[_0xbc33('0x22')](respondWithResult(_0x140aad,null))[_0xbc33('0x44')](handleError(_0x140aad,null));};exports[_0xbc33('0x56')]=function(_0xaecd48,_0x39a8bd,_0x14f738){var _0x4221a9={};var _0x4ec3ab={};var _0x1ce311;var _0x50b1c7;return db['Trigger'][_0xbc33('0x57')]({'where':{'id':_0xaecd48[_0xbc33('0x45')]['id']}})[_0xbc33('0x22')](handleEntityNotFound(_0x39a8bd,null))[_0xbc33('0x22')](function(_0xea21a2){if(_0xea21a2){_0x1ce311=_0xea21a2;_0x4ec3ab[_0xbc33('0x30')]=_['keys'](db[_0xbc33('0x51')][_0xbc33('0x2d')]);_0x4ec3ab[_0xbc33('0x31')]=_['keys'](_0xaecd48['query']);_0x4ec3ab[_0xbc33('0x33')]=_['intersection'](_0x4ec3ab[_0xbc33('0x30')],_0x4ec3ab['query']);_0x4221a9[_0xbc33('0x36')]=_['intersection'](_0x4ec3ab[_0xbc33('0x30')],qs[_0xbc33('0x35')](_0xaecd48['query']['fields']));_0x4221a9[_0xbc33('0x36')]=_0x4221a9[_0xbc33('0x36')][_0xbc33('0x37')]?_0x4221a9[_0xbc33('0x36')]:_0x4ec3ab[_0xbc33('0x30')];_0x4221a9['order']=qs[_0xbc33('0x3a')](_0xaecd48[_0xbc33('0x31')]['sort']);_0x4221a9['where']=qs[_0xbc33('0x33')](_[_0xbc33('0x3c')](_0xaecd48[_0xbc33('0x31')],_0x4ec3ab[_0xbc33('0x33')]));if(_0xaecd48[_0xbc33('0x31')][_0xbc33('0x3d')]){_0x4221a9['where']=_['merge'](_0x4221a9[_0xbc33('0x3b')],{'$or':_[_0xbc33('0x2b')](_0x4221a9[_0xbc33('0x36')],function(_0x5552da){var _0x9f1c1b={};_0x9f1c1b[_0x5552da]={'$like':'%'+_0xaecd48[_0xbc33('0x31')][_0xbc33('0x3d')]+'%'};return _0x9f1c1b;})});}_0x4221a9=_[_0xbc33('0x3e')]({},_0x4221a9,_0xaecd48[_0xbc33('0x3f')]);return _0x1ce311[_0xbc33('0x56')](_0x4221a9);}})[_0xbc33('0x22')](function(_0x2714d7){if(_0x2714d7){_0x50b1c7=_0x2714d7['length'];if(!_0xaecd48[_0xbc33('0x31')]['hasOwnProperty']('nolimit')){_0x4221a9['limit']=qs[_0xbc33('0x1a')](_0xaecd48['query'][_0xbc33('0x1a')]);_0x4221a9[_0xbc33('0x19')]=qs[_0xbc33('0x19')](_0xaecd48[_0xbc33('0x31')]['offset']);}return _0x1ce311['getAnyConditions'](_0x4221a9);}})[_0xbc33('0x22')](function(_0x512c3f){if(_0x512c3f){return _0x512c3f?{'count':_0x50b1c7,'rows':_0x512c3f}:null;}})[_0xbc33('0x22')](respondWithResult(_0x39a8bd,null))[_0xbc33('0x44')](handleError(_0x39a8bd,null));};exports[_0xbc33('0x58')]=function(_0xd4fe7f,_0x22949e,_0x21c916){if(_0xd4fe7f['body']['id']){delete _0xd4fe7f[_0xbc33('0x48')]['id'];}return db[_0xbc33('0x2c')]['find']({'where':{'id':_0xd4fe7f[_0xbc33('0x45')]['id']}})[_0xbc33('0x22')](handleEntityNotFound(_0x22949e,null))[_0xbc33('0x22')](function(_0xf3f3ad){if(_0xf3f3ad){_0xd4fe7f[_0xbc33('0x48')][_0xbc33('0x59')]=_0xf3f3ad['id'];return db[_0xbc33('0x5a')][_0xbc33('0x47')](_0xd4fe7f[_0xbc33('0x48')]);}})[_0xbc33('0x22')](respondWithResult(_0x22949e,null))[_0xbc33('0x44')](handleError(_0x22949e,null));};exports[_0xbc33('0x5b')]=function(_0x5cb1bb,_0x256a30,_0x111c4a){var _0xdc80c9={};var _0x2d0b76={};var _0xa1ec43;var _0xa0639a;return db['Trigger'][_0xbc33('0x57')]({'where':{'id':_0x5cb1bb['params']['id']}})['then'](handleEntityNotFound(_0x256a30,null))[_0xbc33('0x22')](function(_0x404bf6){if(_0x404bf6){_0xa1ec43=_0x404bf6;_0x2d0b76[_0xbc33('0x30')]=_[_0xbc33('0x32')](db['Action'][_0xbc33('0x2d')]);_0x2d0b76[_0xbc33('0x31')]=_[_0xbc33('0x32')](_0x5cb1bb['query']);_0x2d0b76[_0xbc33('0x33')]=_['intersection'](_0x2d0b76[_0xbc33('0x30')],_0x2d0b76[_0xbc33('0x31')]);_0xdc80c9[_0xbc33('0x36')]=_[_0xbc33('0x34')](_0x2d0b76[_0xbc33('0x30')],qs[_0xbc33('0x35')](_0x5cb1bb[_0xbc33('0x31')][_0xbc33('0x35')]));_0xdc80c9[_0xbc33('0x36')]=_0xdc80c9[_0xbc33('0x36')][_0xbc33('0x37')]?_0xdc80c9[_0xbc33('0x36')]:_0x2d0b76[_0xbc33('0x30')];_0xdc80c9[_0xbc33('0x39')]=qs[_0xbc33('0x3a')](_0x5cb1bb[_0xbc33('0x31')]['sort']);_0xdc80c9[_0xbc33('0x3b')]=qs['filters'](_['pick'](_0x5cb1bb[_0xbc33('0x31')],_0x2d0b76[_0xbc33('0x33')]));if(_0x5cb1bb[_0xbc33('0x31')][_0xbc33('0x3d')]){_0xdc80c9[_0xbc33('0x3b')]=_[_0xbc33('0x3e')](_0xdc80c9[_0xbc33('0x3b')],{'$or':_[_0xbc33('0x2b')](_0xdc80c9[_0xbc33('0x36')],function(_0x3b6450){var _0x1b8691={};_0x1b8691[_0x3b6450]={'$like':'%'+_0x5cb1bb[_0xbc33('0x31')][_0xbc33('0x3d')]+'%'};return _0x1b8691;})});}_0xdc80c9=_[_0xbc33('0x3e')]({},_0xdc80c9,_0x5cb1bb[_0xbc33('0x3f')]);return _0xa1ec43['getActions'](_0xdc80c9);}})[_0xbc33('0x22')](function(_0x56e204){if(_0x56e204){_0xa0639a=_0x56e204[_0xbc33('0x37')];if(!_0x5cb1bb[_0xbc33('0x31')][_0xbc33('0x55')]('nolimit')){_0xdc80c9[_0xbc33('0x1a')]=qs['limit'](_0x5cb1bb['query']['limit']);_0xdc80c9[_0xbc33('0x19')]=qs[_0xbc33('0x19')](_0x5cb1bb['query'][_0xbc33('0x19')]);}return _0xa1ec43['getActions'](_0xdc80c9);}})[_0xbc33('0x22')](function(_0x345c8c){if(_0x345c8c){return _0x345c8c?{'count':_0xa0639a,'rows':_0x345c8c}:null;}})[_0xbc33('0x22')](respondWithResult(_0x256a30,null))[_0xbc33('0x44')](handleError(_0x256a30,null));}; \ No newline at end of file +var _0xb904=['find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','addAllCondition','Condition','TriggerAnyId','getAllConditions','getAnyConditions','findOne','addAction','TriggerId','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','get','Triggers','UserProfileResource','end','error','stack','name','index','map','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','options','Trigger','includeAll','findAll','rows','catch','show','params','rawAttributes'];(function(_0xfd332e,_0xd31ea9){var _0x212229=function(_0x2ef772){while(--_0x2ef772){_0xfd332e['push'](_0xfd332e['shift']());}};_0x212229(++_0xd31ea9);}(_0xb904,0x129));var _0x4b90=function(_0x4b3d07,_0x4358f4){_0x4b3d07=_0x4b3d07-0x0;var _0x1ca947=_0xb904[_0x4b3d07];return _0x1ca947;};'use strict';var emlformat=require(_0x4b90('0x0'));var rimraf=require(_0x4b90('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4b90('0x2'));var rp=require(_0x4b90('0x3'));var moment=require(_0x4b90('0x4'));var BPromise=require(_0x4b90('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4b90('0x6'));var sox=require(_0x4b90('0x7'));var csv=require('to-csv');var ejs=require(_0x4b90('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4b90('0x9'));var squel=require(_0x4b90('0xa'));var crypto=require(_0x4b90('0xb'));var jsforce=require(_0x4b90('0xc'));var deskjs=require(_0x4b90('0xd'));var toCsv=require(_0x4b90('0xe'));var querystring=require(_0x4b90('0xf'));var Papa=require(_0x4b90('0x10'));var Redis=require(_0x4b90('0x11'));var authService=require(_0x4b90('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4b90('0x13'));var hardwareService=require(_0x4b90('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x4b90('0x15'));var config=require(_0x4b90('0x16'));var licenseUtil=require(_0x4b90('0x17'));var db=require(_0x4b90('0x18'))['db'];function respondWithStatusCode(_0x303247,_0x47fc13){_0x47fc13=_0x47fc13||0xcc;return function(_0x510187){if(_0x510187){return _0x303247[_0x4b90('0x19')](_0x47fc13);}return _0x303247[_0x4b90('0x1a')](_0x47fc13)['end']();};}function respondWithResult(_0x3ed5bb,_0x1816cf){_0x1816cf=_0x1816cf||0xc8;return function(_0x23deb4){if(_0x23deb4){return _0x3ed5bb[_0x4b90('0x1a')](_0x1816cf)[_0x4b90('0x1b')](_0x23deb4);}};}function respondWithFilteredResult(_0x22d687,_0x95e99c){return function(_0x4047f4){if(_0x4047f4){var _0x3b655e=typeof _0x95e99c[_0x4b90('0x1c')]===_0x4b90('0x1d')&&typeof _0x95e99c[_0x4b90('0x1e')]==='undefined';var _0x190197=_0x4047f4[_0x4b90('0x1f')];var _0x9ce9c=_0x3b655e?0x0:_0x95e99c[_0x4b90('0x1c')];var _0x35fc80=_0x3b655e?_0x4047f4[_0x4b90('0x1f')]:_0x95e99c[_0x4b90('0x1c')]+_0x95e99c[_0x4b90('0x1e')];var _0xad7f6d;if(_0x35fc80>=_0x190197){_0x35fc80=_0x190197;_0xad7f6d=0xc8;}else{_0xad7f6d=0xce;}_0x22d687[_0x4b90('0x1a')](_0xad7f6d);return _0x22d687[_0x4b90('0x20')](_0x4b90('0x21'),_0x9ce9c+'-'+_0x35fc80+'/'+_0x190197)['json'](_0x4047f4);}return null;};}function patchUpdates(_0x55074a){return function(_0x1591a6){try{jsonpatch['apply'](_0x1591a6,_0x55074a,!![]);}catch(_0x777ce0){return BPromise[_0x4b90('0x22')](_0x777ce0);}return _0x1591a6[_0x4b90('0x23')]();};}function saveUpdates(_0x159764,_0x2e4f7e){return function(_0x2ff7f2){if(_0x2ff7f2){return _0x2ff7f2[_0x4b90('0x24')](_0x159764)['then'](function(_0x1c29a4){return _0x1c29a4;});}return null;};}function removeEntity(_0x33c130,_0x1ad633){return function(_0x5b7bfd){if(_0x5b7bfd){return _0x5b7bfd[_0x4b90('0x25')]()[_0x4b90('0x26')](function(){var _0xda5913=_0x5b7bfd[_0x4b90('0x27')]({'plain':!![]});var _0x4f4fd8=_0x4b90('0x28');return db[_0x4b90('0x29')][_0x4b90('0x25')]({'where':{'type':_0x4f4fd8,'resourceId':_0xda5913['id']}})[_0x4b90('0x26')](function(){return _0x5b7bfd;});})['then'](function(){_0x33c130[_0x4b90('0x1a')](0xcc)[_0x4b90('0x2a')]();});}};}function handleEntityNotFound(_0x1340e8,_0x2af282){return function(_0x3d7f1c){if(!_0x3d7f1c){_0x1340e8[_0x4b90('0x19')](0x194);}return _0x3d7f1c;};}function handleError(_0x95629,_0x30158c){_0x30158c=_0x30158c||0x1f4;return function(_0x56bc6d){logger[_0x4b90('0x2b')](_0x56bc6d[_0x4b90('0x2c')]);if(_0x56bc6d['name']){delete _0x56bc6d[_0x4b90('0x2d')];}_0x95629['status'](_0x30158c)['send'](_0x56bc6d);};}exports[_0x4b90('0x2e')]=function(_0x2aaf99,_0x4491e0){var _0x5b0287={},_0x24ba03={},_0x17a2d3={'count':0x0,'rows':[]};var _0x58eb0c=_[_0x4b90('0x2f')](db['Trigger']['rawAttributes'],function(_0x18aa19){return{'name':_0x18aa19['fieldName'],'type':_0x18aa19[_0x4b90('0x30')][_0x4b90('0x31')]};});_0x24ba03['model']=_[_0x4b90('0x2f')](_0x58eb0c,'name');_0x24ba03[_0x4b90('0x32')]=_[_0x4b90('0x33')](_0x2aaf99[_0x4b90('0x32')]);_0x24ba03['filters']=_['intersection'](_0x24ba03[_0x4b90('0x34')],_0x24ba03[_0x4b90('0x32')]);_0x5b0287[_0x4b90('0x35')]=_[_0x4b90('0x36')](_0x24ba03['model'],qs[_0x4b90('0x37')](_0x2aaf99['query'][_0x4b90('0x37')]));_0x5b0287[_0x4b90('0x35')]=_0x5b0287['attributes'][_0x4b90('0x38')]?_0x5b0287[_0x4b90('0x35')]:_0x24ba03[_0x4b90('0x34')];if(!_0x2aaf99[_0x4b90('0x32')][_0x4b90('0x39')](_0x4b90('0x3a'))){_0x5b0287[_0x4b90('0x1e')]=qs[_0x4b90('0x1e')](_0x2aaf99[_0x4b90('0x32')][_0x4b90('0x1e')]);_0x5b0287[_0x4b90('0x1c')]=qs[_0x4b90('0x1c')](_0x2aaf99[_0x4b90('0x32')][_0x4b90('0x1c')]);}_0x5b0287[_0x4b90('0x3b')]=qs['sort'](_0x2aaf99[_0x4b90('0x32')][_0x4b90('0x3c')]);_0x5b0287['where']=qs['filters'](_[_0x4b90('0x3d')](_0x2aaf99[_0x4b90('0x32')],_0x24ba03[_0x4b90('0x3e')]),_0x58eb0c);if(_0x2aaf99['query'][_0x4b90('0x3f')]){_0x5b0287[_0x4b90('0x40')]=_['merge'](_0x5b0287[_0x4b90('0x40')],{'$or':_['map'](_0x58eb0c,function(_0x337628){if(_0x337628[_0x4b90('0x30')]!=='VIRTUAL'){var _0xd41e43={};_0xd41e43[_0x337628[_0x4b90('0x2d')]]={'$like':'%'+_0x2aaf99['query'][_0x4b90('0x3f')]+'%'};return _0xd41e43;}})});}_0x5b0287=_[_0x4b90('0x41')]({},_0x5b0287,_0x2aaf99[_0x4b90('0x42')]);var _0x41635e={'where':_0x5b0287[_0x4b90('0x40')]};return db[_0x4b90('0x43')][_0x4b90('0x1f')](_0x41635e)['then'](function(_0x4a8624){_0x17a2d3[_0x4b90('0x1f')]=_0x4a8624;if(_0x2aaf99[_0x4b90('0x32')][_0x4b90('0x44')]){_0x5b0287['include']=[{'all':!![]}];}return db['Trigger'][_0x4b90('0x45')](_0x5b0287);})[_0x4b90('0x26')](function(_0x5e1cda){_0x17a2d3[_0x4b90('0x46')]=_0x5e1cda;return _0x17a2d3;})[_0x4b90('0x26')](respondWithFilteredResult(_0x4491e0,_0x5b0287))[_0x4b90('0x47')](handleError(_0x4491e0,null));};exports[_0x4b90('0x48')]=function(_0x166910,_0x38e86e){var _0x559e8a={'raw':![],'where':{'id':_0x166910[_0x4b90('0x49')]['id']}},_0x2dd4b4={};_0x2dd4b4['model']=_[_0x4b90('0x33')](db[_0x4b90('0x43')][_0x4b90('0x4a')]);_0x2dd4b4[_0x4b90('0x32')]=_['keys'](_0x166910[_0x4b90('0x32')]);_0x2dd4b4[_0x4b90('0x3e')]=_[_0x4b90('0x36')](_0x2dd4b4[_0x4b90('0x34')],_0x2dd4b4[_0x4b90('0x32')]);_0x559e8a['attributes']=_['intersection'](_0x2dd4b4['model'],qs[_0x4b90('0x37')](_0x166910['query'][_0x4b90('0x37')]));_0x559e8a[_0x4b90('0x35')]=_0x559e8a[_0x4b90('0x35')][_0x4b90('0x38')]?_0x559e8a[_0x4b90('0x35')]:_0x2dd4b4[_0x4b90('0x34')];if(_0x166910[_0x4b90('0x32')][_0x4b90('0x44')]){_0x559e8a['include']=[{'all':!![]}];}_0x559e8a=_[_0x4b90('0x41')]({},_0x559e8a,_0x166910[_0x4b90('0x42')]);return db[_0x4b90('0x43')][_0x4b90('0x4b')](_0x559e8a)['then'](handleEntityNotFound(_0x38e86e,null))['then'](respondWithResult(_0x38e86e,null))[_0x4b90('0x47')](handleError(_0x38e86e,null));};exports[_0x4b90('0x4c')]=function(_0x1582ad,_0x1fd3dc){return db['Trigger'][_0x4b90('0x4c')](_0x1582ad[_0x4b90('0x4d')],{})[_0x4b90('0x26')](function(_0x56925b){var _0x50fb56=_0x1582ad[_0x4b90('0x4e')][_0x4b90('0x27')]({'plain':!![]});if(!_0x50fb56)throw new Error(_0x4b90('0x4f'));if(_0x50fb56['role']===_0x4b90('0x4e')){var _0x42f544=_0x56925b[_0x4b90('0x27')]({'plain':!![]});var _0x56ad39=_0x4b90('0x28');return db[_0x4b90('0x50')][_0x4b90('0x4b')]({'where':{'name':_0x56ad39,'userProfileId':_0x50fb56[_0x4b90('0x51')]},'raw':!![]})[_0x4b90('0x26')](function(_0x18bafb){if(_0x18bafb&&_0x18bafb[_0x4b90('0x52')]===0x0){return db['UserProfileResource'][_0x4b90('0x4c')]({'name':_0x42f544[_0x4b90('0x2d')],'resourceId':_0x42f544['id'],'type':_0x18bafb[_0x4b90('0x2d')],'sectionId':_0x18bafb['id']},{})[_0x4b90('0x26')](function(){return _0x56925b;});}else{return _0x56925b;}})['catch'](function(_0x5b0c60){logger[_0x4b90('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b0c60);throw _0x5b0c60;});}return _0x56925b;})[_0x4b90('0x26')](respondWithResult(_0x1fd3dc,0xc9))[_0x4b90('0x47')](handleError(_0x1fd3dc,null));};exports[_0x4b90('0x24')]=function(_0x36f3c0,_0x1040fc){if(_0x36f3c0[_0x4b90('0x4d')]['id']){delete _0x36f3c0[_0x4b90('0x4d')]['id'];}return db[_0x4b90('0x43')][_0x4b90('0x4b')]({'where':{'id':_0x36f3c0['params']['id']}})['then'](handleEntityNotFound(_0x1040fc,null))['then'](saveUpdates(_0x36f3c0[_0x4b90('0x4d')],null))[_0x4b90('0x26')](respondWithResult(_0x1040fc,null))['catch'](handleError(_0x1040fc,null));};exports[_0x4b90('0x25')]=function(_0x2bd33b,_0x1ca3a9){return db[_0x4b90('0x43')][_0x4b90('0x4b')]({'where':{'id':_0x2bd33b['params']['id']}})['then'](handleEntityNotFound(_0x1ca3a9,null))['then'](removeEntity(_0x1ca3a9,null))[_0x4b90('0x47')](handleError(_0x1ca3a9,null));};exports[_0x4b90('0x53')]=function(_0x39f057,_0x43be98,_0x1e18a9){if(_0x39f057[_0x4b90('0x4d')]['id']){delete _0x39f057[_0x4b90('0x4d')]['id'];}return db['Trigger'][_0x4b90('0x4b')]({'where':{'id':_0x39f057[_0x4b90('0x49')]['id']}})[_0x4b90('0x26')](handleEntityNotFound(_0x43be98,null))[_0x4b90('0x26')](function(_0x1672a8){if(_0x1672a8){_0x39f057['body']['TriggerAllId']=_0x1672a8['id'];return db[_0x4b90('0x54')][_0x4b90('0x4c')](_0x39f057[_0x4b90('0x4d')]);}})[_0x4b90('0x26')](respondWithResult(_0x43be98,null))[_0x4b90('0x47')](handleError(_0x43be98,null));};exports['addAnyCondition']=function(_0x18a95a,_0x3d9b75,_0x3675c0){if(_0x18a95a[_0x4b90('0x4d')]['id']){delete _0x18a95a[_0x4b90('0x4d')]['id'];}return db[_0x4b90('0x43')][_0x4b90('0x4b')]({'where':{'id':_0x18a95a['params']['id']}})['then'](handleEntityNotFound(_0x3d9b75,null))[_0x4b90('0x26')](function(_0x2997c0){if(_0x2997c0){_0x18a95a[_0x4b90('0x4d')][_0x4b90('0x55')]=_0x2997c0['id'];return db[_0x4b90('0x54')]['create'](_0x18a95a[_0x4b90('0x4d')]);}})[_0x4b90('0x26')](respondWithResult(_0x3d9b75,null))[_0x4b90('0x47')](handleError(_0x3d9b75,null));};exports['getAllConditions']=function(_0x40b5ac,_0x3f84fd,_0xf1af61){var _0x2f7388={};var _0x2bbc50={};var _0x27fe18;var _0xee43b0;return db[_0x4b90('0x43')]['findOne']({'where':{'id':_0x40b5ac[_0x4b90('0x49')]['id']}})['then'](handleEntityNotFound(_0x3f84fd,null))['then'](function(_0x33abdf){if(_0x33abdf){_0x27fe18=_0x33abdf;_0x2bbc50[_0x4b90('0x34')]=_[_0x4b90('0x33')](db['Condition'][_0x4b90('0x4a')]);_0x2bbc50[_0x4b90('0x32')]=_['keys'](_0x40b5ac[_0x4b90('0x32')]);_0x2bbc50[_0x4b90('0x3e')]=_[_0x4b90('0x36')](_0x2bbc50[_0x4b90('0x34')],_0x2bbc50['query']);_0x2f7388[_0x4b90('0x35')]=_[_0x4b90('0x36')](_0x2bbc50['model'],qs[_0x4b90('0x37')](_0x40b5ac[_0x4b90('0x32')][_0x4b90('0x37')]));_0x2f7388[_0x4b90('0x35')]=_0x2f7388[_0x4b90('0x35')][_0x4b90('0x38')]?_0x2f7388[_0x4b90('0x35')]:_0x2bbc50[_0x4b90('0x34')];_0x2f7388['order']=qs[_0x4b90('0x3c')](_0x40b5ac[_0x4b90('0x32')]['sort']);_0x2f7388['where']=qs[_0x4b90('0x3e')](_['pick'](_0x40b5ac['query'],_0x2bbc50[_0x4b90('0x3e')]));if(_0x40b5ac['query'][_0x4b90('0x3f')]){_0x2f7388['where']=_[_0x4b90('0x41')](_0x2f7388[_0x4b90('0x40')],{'$or':_['map'](_0x2f7388['attributes'],function(_0xbefaba){var _0x26f43f={};_0x26f43f[_0xbefaba]={'$like':'%'+_0x40b5ac['query'][_0x4b90('0x3f')]+'%'};return _0x26f43f;})});}_0x2f7388=_['merge']({},_0x2f7388,_0x40b5ac['options']);return _0x27fe18[_0x4b90('0x56')](_0x2f7388);}})['then'](function(_0x5e0718){if(_0x5e0718){_0xee43b0=_0x5e0718[_0x4b90('0x38')];if(!_0x40b5ac['query'][_0x4b90('0x39')](_0x4b90('0x3a'))){_0x2f7388[_0x4b90('0x1e')]=qs['limit'](_0x40b5ac[_0x4b90('0x32')][_0x4b90('0x1e')]);_0x2f7388[_0x4b90('0x1c')]=qs['offset'](_0x40b5ac[_0x4b90('0x32')][_0x4b90('0x1c')]);}return _0x27fe18[_0x4b90('0x56')](_0x2f7388);}})[_0x4b90('0x26')](function(_0x369a22){if(_0x369a22){return _0x369a22?{'count':_0xee43b0,'rows':_0x369a22}:null;}})[_0x4b90('0x26')](respondWithResult(_0x3f84fd,null))[_0x4b90('0x47')](handleError(_0x3f84fd,null));};exports[_0x4b90('0x57')]=function(_0x2d63b8,_0x270264,_0x1f9842){var _0x440753={};var _0x229f9a={};var _0x11b9eb;var _0x108018;return db[_0x4b90('0x43')][_0x4b90('0x58')]({'where':{'id':_0x2d63b8[_0x4b90('0x49')]['id']}})[_0x4b90('0x26')](handleEntityNotFound(_0x270264,null))[_0x4b90('0x26')](function(_0xac14cb){if(_0xac14cb){_0x11b9eb=_0xac14cb;_0x229f9a[_0x4b90('0x34')]=_['keys'](db[_0x4b90('0x54')]['rawAttributes']);_0x229f9a['query']=_[_0x4b90('0x33')](_0x2d63b8['query']);_0x229f9a[_0x4b90('0x3e')]=_[_0x4b90('0x36')](_0x229f9a[_0x4b90('0x34')],_0x229f9a[_0x4b90('0x32')]);_0x440753['attributes']=_[_0x4b90('0x36')](_0x229f9a[_0x4b90('0x34')],qs[_0x4b90('0x37')](_0x2d63b8[_0x4b90('0x32')][_0x4b90('0x37')]));_0x440753[_0x4b90('0x35')]=_0x440753[_0x4b90('0x35')][_0x4b90('0x38')]?_0x440753[_0x4b90('0x35')]:_0x229f9a[_0x4b90('0x34')];_0x440753[_0x4b90('0x3b')]=qs[_0x4b90('0x3c')](_0x2d63b8[_0x4b90('0x32')]['sort']);_0x440753[_0x4b90('0x40')]=qs[_0x4b90('0x3e')](_[_0x4b90('0x3d')](_0x2d63b8[_0x4b90('0x32')],_0x229f9a[_0x4b90('0x3e')]));if(_0x2d63b8['query'][_0x4b90('0x3f')]){_0x440753[_0x4b90('0x40')]=_[_0x4b90('0x41')](_0x440753['where'],{'$or':_[_0x4b90('0x2f')](_0x440753[_0x4b90('0x35')],function(_0x37a2ef){var _0x11eb6d={};_0x11eb6d[_0x37a2ef]={'$like':'%'+_0x2d63b8[_0x4b90('0x32')][_0x4b90('0x3f')]+'%'};return _0x11eb6d;})});}_0x440753=_[_0x4b90('0x41')]({},_0x440753,_0x2d63b8[_0x4b90('0x42')]);return _0x11b9eb[_0x4b90('0x57')](_0x440753);}})[_0x4b90('0x26')](function(_0x2f3564){if(_0x2f3564){_0x108018=_0x2f3564[_0x4b90('0x38')];if(!_0x2d63b8[_0x4b90('0x32')][_0x4b90('0x39')](_0x4b90('0x3a'))){_0x440753[_0x4b90('0x1e')]=qs[_0x4b90('0x1e')](_0x2d63b8['query']['limit']);_0x440753[_0x4b90('0x1c')]=qs[_0x4b90('0x1c')](_0x2d63b8[_0x4b90('0x32')]['offset']);}return _0x11b9eb['getAnyConditions'](_0x440753);}})[_0x4b90('0x26')](function(_0x383844){if(_0x383844){return _0x383844?{'count':_0x108018,'rows':_0x383844}:null;}})['then'](respondWithResult(_0x270264,null))['catch'](handleError(_0x270264,null));};exports[_0x4b90('0x59')]=function(_0xe0fe88,_0x33e027,_0x2927a1){if(_0xe0fe88[_0x4b90('0x4d')]['id']){delete _0xe0fe88[_0x4b90('0x4d')]['id'];}return db[_0x4b90('0x43')]['find']({'where':{'id':_0xe0fe88[_0x4b90('0x49')]['id']}})[_0x4b90('0x26')](handleEntityNotFound(_0x33e027,null))[_0x4b90('0x26')](function(_0x1b4672){if(_0x1b4672){_0xe0fe88['body'][_0x4b90('0x5a')]=_0x1b4672['id'];return db[_0x4b90('0x5b')][_0x4b90('0x4c')](_0xe0fe88['body']);}})[_0x4b90('0x26')](respondWithResult(_0x33e027,null))[_0x4b90('0x47')](handleError(_0x33e027,null));};exports[_0x4b90('0x5c')]=function(_0x5ee5c8,_0x272ea6,_0x357396){var _0x420660={};var _0xab0f20={};var _0x51f320;var _0x3a2757;return db[_0x4b90('0x43')][_0x4b90('0x58')]({'where':{'id':_0x5ee5c8[_0x4b90('0x49')]['id']}})['then'](handleEntityNotFound(_0x272ea6,null))[_0x4b90('0x26')](function(_0x210712){if(_0x210712){_0x51f320=_0x210712;_0xab0f20[_0x4b90('0x34')]=_['keys'](db['Action'][_0x4b90('0x4a')]);_0xab0f20[_0x4b90('0x32')]=_[_0x4b90('0x33')](_0x5ee5c8[_0x4b90('0x32')]);_0xab0f20['filters']=_['intersection'](_0xab0f20[_0x4b90('0x34')],_0xab0f20[_0x4b90('0x32')]);_0x420660[_0x4b90('0x35')]=_[_0x4b90('0x36')](_0xab0f20[_0x4b90('0x34')],qs['fields'](_0x5ee5c8[_0x4b90('0x32')]['fields']));_0x420660[_0x4b90('0x35')]=_0x420660[_0x4b90('0x35')][_0x4b90('0x38')]?_0x420660['attributes']:_0xab0f20[_0x4b90('0x34')];_0x420660[_0x4b90('0x3b')]=qs[_0x4b90('0x3c')](_0x5ee5c8['query'][_0x4b90('0x3c')]);_0x420660[_0x4b90('0x40')]=qs['filters'](_[_0x4b90('0x3d')](_0x5ee5c8[_0x4b90('0x32')],_0xab0f20[_0x4b90('0x3e')]));if(_0x5ee5c8[_0x4b90('0x32')][_0x4b90('0x3f')]){_0x420660['where']=_[_0x4b90('0x41')](_0x420660[_0x4b90('0x40')],{'$or':_['map'](_0x420660[_0x4b90('0x35')],function(_0x4c5d72){var _0x339dbc={};_0x339dbc[_0x4c5d72]={'$like':'%'+_0x5ee5c8[_0x4b90('0x32')][_0x4b90('0x3f')]+'%'};return _0x339dbc;})});}_0x420660=_[_0x4b90('0x41')]({},_0x420660,_0x5ee5c8[_0x4b90('0x42')]);return _0x51f320[_0x4b90('0x5c')](_0x420660);}})[_0x4b90('0x26')](function(_0x3a92e3){if(_0x3a92e3){_0x3a2757=_0x3a92e3[_0x4b90('0x38')];if(!_0x5ee5c8[_0x4b90('0x32')][_0x4b90('0x39')](_0x4b90('0x3a'))){_0x420660[_0x4b90('0x1e')]=qs[_0x4b90('0x1e')](_0x5ee5c8[_0x4b90('0x32')][_0x4b90('0x1e')]);_0x420660['offset']=qs[_0x4b90('0x1c')](_0x5ee5c8[_0x4b90('0x32')][_0x4b90('0x1c')]);}return _0x51f320[_0x4b90('0x5c')](_0x420660);}})['then'](function(_0x18ca38){if(_0x18ca38){return _0x18ca38?{'count':_0x3a2757,'rows':_0x18ca38}:null;}})[_0x4b90('0x26')](respondWithResult(_0x272ea6,null))[_0x4b90('0x47')](handleError(_0x272ea6,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 0389fc9..3dbf1a1 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 _0xcddd=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','tools_triggers','lodash','util','../../config/logger'];(function(_0x44263a,_0x7761fd){var _0x5897a7=function(_0x4a7887){while(--_0x4a7887){_0x44263a['push'](_0x44263a['shift']());}};_0x5897a7(++_0x7761fd);}(_0xcddd,0x1a1));var _0xdcdd=function(_0x5f3932,_0x130970){_0x5f3932=_0x5f3932-0x0;var _0xcd924d=_0xcddd[_0x5f3932];return _0xcd924d;};'use strict';var _=require(_0xdcdd('0x0'));var util=require(_0xdcdd('0x1'));var logger=require(_0xdcdd('0x2'))(_0xdcdd('0x3'));var moment=require(_0xdcdd('0x4'));var BPromise=require(_0xdcdd('0x5'));var rp=require(_0xdcdd('0x6'));var fs=require('fs');var path=require(_0xdcdd('0x7'));var rimraf=require(_0xdcdd('0x8'));var config=require(_0xdcdd('0x9'));var attributes=require(_0xdcdd('0xa'));module[_0xdcdd('0xb')]=function(_0x59f64b,_0x171c54){return _0x59f64b[_0xdcdd('0xc')]('Trigger',attributes,{'tableName':_0xdcdd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7118=['request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','../../config/logger','api','bluebird'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7118,0x159));var _0x8711=function(_0x204a97,_0x594226){_0x204a97=_0x204a97-0x0;var _0x4551d4=_0x7118[_0x204a97];return _0x4551d4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8711('0x0'))(_0x8711('0x1'));var moment=require('moment');var BPromise=require(_0x8711('0x2'));var rp=require(_0x8711('0x3'));var fs=require('fs');var path=require(_0x8711('0x4'));var rimraf=require(_0x8711('0x5'));var config=require(_0x8711('0x6'));var attributes=require(_0x8711('0x7'));module[_0x8711('0x8')]=function(_0x54885e,_0x385033){return _0x54885e[_0x8711('0x9')](_0x8711('0xa'),attributes,{'tableName':_0x8711('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 61fff0f..4eeb318 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 _0x8e08=['http','request','Trigger,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','result','catch','GetTrigger','Trigger','findAll','options','where','attributes','include','model','map','then','stringify','find','raw','ShowTrigger','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client'];(function(_0x15e789,_0x23d05b){var _0x2e7b2e=function(_0x2ddb76){while(--_0x2ddb76){_0x15e789['push'](_0x15e789['shift']());}};_0x2e7b2e(++_0x23d05b);}(_0x8e08,0xf9));var _0x88e0=function(_0x3da08d,_0x404ef7){_0x3da08d=_0x3da08d-0x0;var _0x3977e6=_0x8e08[_0x3da08d];return _0x3977e6;};'use strict';var _=require('lodash');var util=require(_0x88e0('0x0'));var moment=require('moment');var BPromise=require(_0x88e0('0x1'));var rs=require(_0x88e0('0x2'));var fs=require('fs');var Redis=require(_0x88e0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x88e0('0x4'));var logger=require(_0x88e0('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x88e0('0x6')][_0x88e0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3a636c,_0x5a24a3,_0x5d6165){return new BPromise(function(_0x239c4c,_0x57799d){return client[_0x88e0('0x8')](_0x3a636c,_0x5d6165)['then'](function(_0x54ff22){logger['info'](_0x88e0('0x9'),_0x5a24a3,'request\x20sent');logger[_0x88e0('0xa')]('Trigger,\x20%s,\x20%s,\x20%s',_0x5a24a3,_0x88e0('0xb'),JSON['stringify'](_0x54ff22));if(_0x54ff22[_0x88e0('0xc')]){if(_0x54ff22[_0x88e0('0xc')][_0x88e0('0xd')]===0x1f4){logger['error']('Trigger,\x20%s,\x20%s',_0x5a24a3,_0x54ff22[_0x88e0('0xc')]['message']);return _0x57799d(_0x54ff22[_0x88e0('0xc')][_0x88e0('0xe')]);}logger[_0x88e0('0xc')](_0x88e0('0x9'),_0x5a24a3,_0x54ff22[_0x88e0('0xc')][_0x88e0('0xe')]);return _0x239c4c(_0x54ff22[_0x88e0('0xc')][_0x88e0('0xe')]);}else{logger[_0x88e0('0xf')](_0x88e0('0x9'),_0x5a24a3,_0x88e0('0xb'));_0x239c4c(_0x54ff22[_0x88e0('0x10')][_0x88e0('0xe')]);}})[_0x88e0('0x11')](function(_0x4d0649){logger[_0x88e0('0xc')](_0x88e0('0x9'),_0x5a24a3,_0x4d0649);_0x57799d(_0x4d0649);});});}exports[_0x88e0('0x12')]=function(_0x53d48e){var _0x1366c5=this;return new Promise(function(_0x482da5,_0x4746c1){return db[_0x88e0('0x13')][_0x88e0('0x14')]({'raw':_0x53d48e[_0x88e0('0x15')]?_0x53d48e['options']['raw']===undefined?!![]:![]:!![],'where':_0x53d48e[_0x88e0('0x15')]?_0x53d48e[_0x88e0('0x15')][_0x88e0('0x16')]||null:null,'attributes':_0x53d48e[_0x88e0('0x15')]?_0x53d48e[_0x88e0('0x15')][_0x88e0('0x17')]||null:null,'limit':_0x53d48e[_0x88e0('0x15')]?_0x53d48e[_0x88e0('0x15')]['limit']||null:null,'include':_0x53d48e[_0x88e0('0x15')]?_0x53d48e[_0x88e0('0x15')][_0x88e0('0x18')]?_['map'](_0x53d48e[_0x88e0('0x15')][_0x88e0('0x18')],function(_0x350c4c){return{'model':db[_0x350c4c[_0x88e0('0x19')]],'as':_0x350c4c['as'],'attributes':_0x350c4c[_0x88e0('0x17')],'include':_0x350c4c[_0x88e0('0x18')]?_[_0x88e0('0x1a')](_0x350c4c['include'],function(_0x5551c1){return{'model':db[_0x5551c1['model']],'as':_0x5551c1['as'],'attributes':_0x5551c1[_0x88e0('0x17')],'include':_0x5551c1[_0x88e0('0x18')]?_[_0x88e0('0x1a')](_0x5551c1['include'],function(_0x95bb29){return{'model':db[_0x95bb29[_0x88e0('0x19')]],'as':_0x95bb29['as'],'attributes':_0x95bb29[_0x88e0('0x17')]};}):[]};}):[]};}):[]:[]})[_0x88e0('0x1b')](function(_0x246ed5){logger[_0x88e0('0xf')](_0x88e0('0x12'),_0x53d48e);logger['debug'](_0x88e0('0x12'),_0x53d48e,JSON[_0x88e0('0x1c')](_0x246ed5));_0x482da5(_0x246ed5);})[_0x88e0('0x11')](function(_0xd5a42d){logger[_0x88e0('0xc')](_0x88e0('0x12'),_0xd5a42d['message'],_0x53d48e);_0x4746c1(_0x1366c5[_0x88e0('0xc')](0x1f4,_0xd5a42d[_0x88e0('0xe')]));});});};exports['ShowTrigger']=function(_0x8b8e88){var _0x195c86=this;return new Promise(function(_0x12ecab,_0x27b5c3){return db['Trigger'][_0x88e0('0x1d')]({'raw':_0x8b8e88[_0x88e0('0x15')]?_0x8b8e88['options'][_0x88e0('0x1e')]===undefined?!![]:![]:!![],'where':_0x8b8e88[_0x88e0('0x15')]?_0x8b8e88[_0x88e0('0x15')]['where']||null:null,'attributes':_0x8b8e88[_0x88e0('0x15')]?_0x8b8e88[_0x88e0('0x15')][_0x88e0('0x17')]||null:null,'include':_0x8b8e88[_0x88e0('0x15')]?_0x8b8e88[_0x88e0('0x15')][_0x88e0('0x18')]?_[_0x88e0('0x1a')](_0x8b8e88[_0x88e0('0x15')][_0x88e0('0x18')],function(_0x1fd9e5){return{'model':db[_0x1fd9e5['model']],'as':_0x1fd9e5['as'],'attributes':_0x1fd9e5['attributes'],'include':_0x1fd9e5['include']?_['map'](_0x1fd9e5['include'],function(_0x23bb2c){return{'model':db[_0x23bb2c[_0x88e0('0x19')]],'as':_0x23bb2c['as'],'attributes':_0x23bb2c[_0x88e0('0x17')],'include':_0x23bb2c[_0x88e0('0x18')]?_[_0x88e0('0x1a')](_0x23bb2c['include'],function(_0x54547b){return{'model':db[_0x54547b[_0x88e0('0x19')]],'as':_0x54547b['as'],'attributes':_0x54547b[_0x88e0('0x17')]};}):[]};}):[]};}):[]:[]})[_0x88e0('0x1b')](function(_0x40f1a5){logger[_0x88e0('0xf')]('ShowTrigger',_0x8b8e88);logger['debug'](_0x88e0('0x1f'),_0x8b8e88,JSON[_0x88e0('0x1c')](_0x40f1a5));_0x12ecab(_0x40f1a5);})[_0x88e0('0x11')](function(_0x1de83a){logger[_0x88e0('0xc')]('ShowTrigger',_0x1de83a[_0x88e0('0xe')],_0x8b8e88);_0x27b5c3(_0x195c86['error'](0x1f4,_0x1de83a[_0x88e0('0xe')]));});});}; \ No newline at end of file +var _0x9e1c=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','catch','findAll','options','raw','where','attributes','include','map','model','GetTrigger','ShowTrigger','Trigger','find'];(function(_0x5318e8,_0x5582ab){var _0x5571db=function(_0x35ce56){while(--_0x35ce56){_0x5318e8['push'](_0x5318e8['shift']());}};_0x5571db(++_0x5582ab);}(_0x9e1c,0x1b0));var _0xc9e1=function(_0xabc300,_0x38e357){_0xabc300=_0xabc300-0x0;var _0x47933a=_0x9e1c[_0xabc300];return _0x47933a;};'use strict';var _=require(_0xc9e1('0x0'));var util=require(_0xc9e1('0x1'));var moment=require('moment');var BPromise=require(_0xc9e1('0x2'));var rs=require(_0xc9e1('0x3'));var fs=require('fs');var Redis=require(_0xc9e1('0x4'));var db=require(_0xc9e1('0x5'))['db'];var utils=require(_0xc9e1('0x6'));var logger=require(_0xc9e1('0x7'))(_0xc9e1('0x8'));var config=require(_0xc9e1('0x9'));var jayson=require(_0xc9e1('0xa'));var client=jayson['client'][_0xc9e1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a78fa,_0x296f70,_0x43991c){return new BPromise(function(_0x1f10c3,_0x159b17){return client['request'](_0x4a78fa,_0x43991c)[_0xc9e1('0xc')](function(_0xfaf8f0){logger[_0xc9e1('0xd')]('Trigger,\x20%s,\x20%s',_0x296f70,_0xc9e1('0xe'));logger[_0xc9e1('0xf')](_0xc9e1('0x10'),_0x296f70,'request\x20sent',JSON[_0xc9e1('0x11')](_0xfaf8f0));if(_0xfaf8f0['error']){if(_0xfaf8f0[_0xc9e1('0x12')][_0xc9e1('0x13')]===0x1f4){logger[_0xc9e1('0x12')](_0xc9e1('0x14'),_0x296f70,_0xfaf8f0['error']['message']);return _0x159b17(_0xfaf8f0[_0xc9e1('0x12')][_0xc9e1('0x15')]);}logger['error'](_0xc9e1('0x14'),_0x296f70,_0xfaf8f0[_0xc9e1('0x12')][_0xc9e1('0x15')]);return _0x1f10c3(_0xfaf8f0[_0xc9e1('0x12')][_0xc9e1('0x15')]);}else{logger['info'](_0xc9e1('0x14'),_0x296f70,'request\x20sent');_0x1f10c3(_0xfaf8f0[_0xc9e1('0x16')][_0xc9e1('0x15')]);}})[_0xc9e1('0x17')](function(_0x195b16){logger['error'](_0xc9e1('0x14'),_0x296f70,_0x195b16);_0x159b17(_0x195b16);});});}exports['GetTrigger']=function(_0x21aeef){var _0x112ea7=this;return new Promise(function(_0x405c6d,_0x51c57e){return db['Trigger'][_0xc9e1('0x18')]({'raw':_0x21aeef[_0xc9e1('0x19')]?_0x21aeef[_0xc9e1('0x19')][_0xc9e1('0x1a')]===undefined?!![]:![]:!![],'where':_0x21aeef['options']?_0x21aeef[_0xc9e1('0x19')][_0xc9e1('0x1b')]||null:null,'attributes':_0x21aeef['options']?_0x21aeef[_0xc9e1('0x19')][_0xc9e1('0x1c')]||null:null,'limit':_0x21aeef[_0xc9e1('0x19')]?_0x21aeef['options']['limit']||null:null,'include':_0x21aeef[_0xc9e1('0x19')]?_0x21aeef[_0xc9e1('0x19')][_0xc9e1('0x1d')]?_[_0xc9e1('0x1e')](_0x21aeef[_0xc9e1('0x19')][_0xc9e1('0x1d')],function(_0x3a0872){return{'model':db[_0x3a0872[_0xc9e1('0x1f')]],'as':_0x3a0872['as'],'attributes':_0x3a0872[_0xc9e1('0x1c')],'include':_0x3a0872[_0xc9e1('0x1d')]?_[_0xc9e1('0x1e')](_0x3a0872['include'],function(_0x3a8f34){return{'model':db[_0x3a8f34['model']],'as':_0x3a8f34['as'],'attributes':_0x3a8f34[_0xc9e1('0x1c')],'include':_0x3a8f34[_0xc9e1('0x1d')]?_['map'](_0x3a8f34[_0xc9e1('0x1d')],function(_0x20447a){return{'model':db[_0x20447a[_0xc9e1('0x1f')]],'as':_0x20447a['as'],'attributes':_0x20447a[_0xc9e1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc9e1('0xc')](function(_0x434985){logger[_0xc9e1('0xd')](_0xc9e1('0x20'),_0x21aeef);logger[_0xc9e1('0xf')](_0xc9e1('0x20'),_0x21aeef,JSON['stringify'](_0x434985));_0x405c6d(_0x434985);})['catch'](function(_0x320edb){logger[_0xc9e1('0x12')](_0xc9e1('0x20'),_0x320edb[_0xc9e1('0x15')],_0x21aeef);_0x51c57e(_0x112ea7[_0xc9e1('0x12')](0x1f4,_0x320edb[_0xc9e1('0x15')]));});});};exports[_0xc9e1('0x21')]=function(_0x1b31e4){var _0x1b370c=this;return new Promise(function(_0x20308f,_0x5f0050){return db[_0xc9e1('0x22')][_0xc9e1('0x23')]({'raw':_0x1b31e4[_0xc9e1('0x19')]?_0x1b31e4[_0xc9e1('0x19')][_0xc9e1('0x1a')]===undefined?!![]:![]:!![],'where':_0x1b31e4[_0xc9e1('0x19')]?_0x1b31e4['options'][_0xc9e1('0x1b')]||null:null,'attributes':_0x1b31e4[_0xc9e1('0x19')]?_0x1b31e4['options'][_0xc9e1('0x1c')]||null:null,'include':_0x1b31e4['options']?_0x1b31e4[_0xc9e1('0x19')][_0xc9e1('0x1d')]?_[_0xc9e1('0x1e')](_0x1b31e4[_0xc9e1('0x19')]['include'],function(_0x38f4e3){return{'model':db[_0x38f4e3[_0xc9e1('0x1f')]],'as':_0x38f4e3['as'],'attributes':_0x38f4e3[_0xc9e1('0x1c')],'include':_0x38f4e3[_0xc9e1('0x1d')]?_[_0xc9e1('0x1e')](_0x38f4e3[_0xc9e1('0x1d')],function(_0x5b7716){return{'model':db[_0x5b7716[_0xc9e1('0x1f')]],'as':_0x5b7716['as'],'attributes':_0x5b7716[_0xc9e1('0x1c')],'include':_0x5b7716['include']?_[_0xc9e1('0x1e')](_0x5b7716[_0xc9e1('0x1d')],function(_0x4a66ce){return{'model':db[_0x4a66ce[_0xc9e1('0x1f')]],'as':_0x4a66ce['as'],'attributes':_0x4a66ce[_0xc9e1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc9e1('0xc')](function(_0x3a5267){logger['info'](_0xc9e1('0x21'),_0x1b31e4);logger[_0xc9e1('0xf')]('ShowTrigger',_0x1b31e4,JSON[_0xc9e1('0x11')](_0x3a5267));_0x20308f(_0x3a5267);})[_0xc9e1('0x17')](function(_0x5b81d3){logger[_0xc9e1('0x12')](_0xc9e1('0x21'),_0x5b81d3[_0xc9e1('0x15')],_0x1b31e4);_0x5f0050(_0x1b370c[_0xc9e1('0x12')](0x1f4,_0x5b81d3[_0xc9e1('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 0cf4573..765790f 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 _0x7bd2=['show','post','/:id/clone','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','/:id'];(function(_0x38c3e9,_0x272ee8){var _0x116ad9=function(_0x1432b0){while(--_0x1432b0){_0x38c3e9['push'](_0x38c3e9['shift']());}};_0x116ad9(++_0x272ee8);}(_0x7bd2,0x1c0));var _0x27bd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7bd2[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x27bd('0x0'));var util=require(_0x27bd('0x1'));var path=require(_0x27bd('0x2'));var timeout=require(_0x27bd('0x3'));var express=require('express');var router=express[_0x27bd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x27bd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x27bd('0x6'));var controller=require(_0x27bd('0x7'));router['get']('/',auth[_0x27bd('0x8')](),controller[_0x27bd('0x9')]);router[_0x27bd('0xa')](_0x27bd('0xb'),auth['isAuthenticated'](),controller[_0x27bd('0xc')]);router[_0x27bd('0xd')](_0x27bd('0xe'),auth[_0x27bd('0x8')](),controller['clone']);router[_0x27bd('0xd')]('/',auth[_0x27bd('0x8')](),controller[_0x27bd('0xf')]);router[_0x27bd('0x10')](_0x27bd('0xb'),auth[_0x27bd('0x8')](),controller[_0x27bd('0x11')]);router['delete']('/:id',auth[_0x27bd('0x8')](),controller[_0x27bd('0x12')]);module[_0x27bd('0x13')]=router; \ No newline at end of file +var _0x87e5=['get','isAuthenticated','index','post','/:id/clone','clone','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1b8050,_0x4d12c6){var _0x1ec2b1=function(_0x4c150a){while(--_0x4c150a){_0x1b8050['push'](_0x1b8050['shift']());}};_0x1ec2b1(++_0x4d12c6);}(_0x87e5,0x175));var _0x587e=function(_0x4b7b69,_0x3ab075){_0x4b7b69=_0x4b7b69-0x0;var _0x173b4c=_0x87e5[_0x4b7b69];return _0x173b4c;};'use strict';var multer=require(_0x587e('0x0'));var util=require(_0x587e('0x1'));var path=require(_0x587e('0x2'));var timeout=require(_0x587e('0x3'));var express=require(_0x587e('0x4'));var router=express[_0x587e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x587e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./trunk.controller');router[_0x587e('0x7')]('/',auth[_0x587e('0x8')](),controller[_0x587e('0x9')]);router[_0x587e('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x587e('0xa')](_0x587e('0xb'),auth[_0x587e('0x8')](),controller[_0x587e('0xc')]);router[_0x587e('0xa')]('/',auth['isAuthenticated'](),controller[_0x587e('0xd')]);router['put'](_0x587e('0xe'),auth[_0x587e('0x8')](),controller[_0x587e('0xf')]);router[_0x587e('0x10')](_0x587e('0xe'),auth[_0x587e('0x8')](),controller[_0x587e('0x11')]);module[_0x587e('0x12')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 37c6158..9e35e8a 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 _0x3404=['always','accept','originate','uac','uas','pai','fingerprint','passive','actpass','update,nonat','BOOLEAN','sequelize','name','ENUM','friend','peer','STRING','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','join','getDataValue','split','rfc2833','shortinfo','inband','nonat','update','yes','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','never','INTEGER','\x22\x22\x20<>'];(function(_0x258bcd,_0x387d06){var _0x4efa2e=function(_0x14ec4f){while(--_0x14ec4f){_0x258bcd['push'](_0x258bcd['shift']());}};_0x4efa2e(++_0x387d06);}(_0x3404,0x1a9));var _0x4340=function(_0x2e71fe,_0x237db0){_0x2e71fe=_0x2e71fe-0x0;var _0x146908=_0x3404[_0x2e71fe];return _0x146908;};'use strict';var Sequelize=require(_0x4340('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4340('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x4340('0x2')](_0x4340('0x3'),'user',_0x4340('0x4')),'allowNull':![],'defaultValue':_0x4340('0x3')},'context':{'type':Sequelize[_0x4340('0x5')],'allowNull':![],'defaultValue':_0x4340('0x6')},'callingpres':{'type':Sequelize[_0x4340('0x2')](_0x4340('0x7'),'ALLOWED_PASSED_SCREEN',_0x4340('0x8'),_0x4340('0x9'),'PROHIB_NOT_SCREENED',_0x4340('0xa'),_0x4340('0xb'),_0x4340('0xc'))},'deny':{'type':Sequelize[_0x4340('0x5')]},'permit':{'type':Sequelize[_0x4340('0x5')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x4340('0x5')]},'remotesecret':{'type':Sequelize[_0x4340('0x5')]},'transport':{'type':Sequelize[_0x4340('0x5')],'defaultValue':'udp','set':function(_0x6b6c29){this[_0x4340('0xd')](_0x4340('0xe'),_0x6b6c29?_0x6b6c29[_0x4340('0xf')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x4340('0x10')](_0x4340('0xe'))[_0x4340('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x4340('0x2')](_0x4340('0x12'),'info',_0x4340('0x13'),_0x4340('0x14'),'auto'),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0x4340('0x15'),_0x4340('0x16'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x4340('0x2')](_0x4340('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x4340('0x5')]},'directmediadeny':{'type':Sequelize[_0x4340('0x5')]},'nat':{'type':Sequelize[_0x4340('0x5')],'defaultValue':_0x4340('0x18'),'set':function(_0x1f4717){this[_0x4340('0xd')](_0x4340('0x19'),_0x1f4717?_0x1f4717[_0x4340('0xf')](','):null);},'get':function(){return this[_0x4340('0x10')]('nat')?this[_0x4340('0x10')](_0x4340('0x19'))[_0x4340('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x4340('0x5')]},'namedcallgroup':{'type':Sequelize[_0x4340('0x5')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x4340('0x5')]},'language':{'type':Sequelize[_0x4340('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x4340('0x5')],'defaultValue':_0x4340('0x1a')},'allow':{'type':Sequelize[_0x4340('0x5')],'allowNull':![],'defaultValue':_0x4340('0x1b'),'set':function(_0x25755e){this[_0x4340('0xd')](_0x4340('0x1c'),_0x25755e?_0x25755e[_0x4340('0xf')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0x4340('0x1c'))?this[_0x4340('0x10')](_0x4340('0x1c'))[_0x4340('0x11')](';'):null;},'comment':_0x4340('0x1d')},'autoframing':{'type':Sequelize[_0x4340('0x2')](_0x4340('0x17'),'no')},'insecure':{'type':Sequelize[_0x4340('0x5')],'defaultValue':_0x4340('0x1e'),'set':function(_0x5322d5){this[_0x4340('0xd')]('insecure',_0x5322d5?_0x5322d5[_0x4340('0xf')](','):null);},'get':function(){return this['getDataValue'](_0x4340('0x1f'))?this['getDataValue'](_0x4340('0x1f'))[_0x4340('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x4340('0x2')](_0x4340('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x4340('0x17'),'no',_0x4340('0x20'))},'promiscredir':{'type':Sequelize[_0x4340('0x2')]('yes','no')},'useclientcode':{'type':Sequelize[_0x4340('0x2')](_0x4340('0x17'),'no')},'accountcode':{'type':Sequelize[_0x4340('0x21')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x4340('0x5')],'defaultValue':_0x4340('0x22')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x4340('0x2')](_0x4340('0x17'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x4340('0x2')](_0x4340('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x4340('0x2')](_0x4340('0x17'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x4340('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0x4340('0x2')](_0x4340('0x17'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x4340('0x2')](_0x4340('0x17'),'no',_0x4340('0x23')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x4340('0x21')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x4340('0x2')](_0x4340('0x17'),'no')},'mailbox':{'type':Sequelize[_0x4340('0x5')]},'session_timers':{'type':Sequelize[_0x4340('0x2')](_0x4340('0x24'),'refuse',_0x4340('0x25'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x4340('0x2')](_0x4340('0x26'),'uas'),'defaultValue':_0x4340('0x27')},'t38pt_usertpsource':{'type':Sequelize[_0x4340('0x5')]},'regexten':{'type':Sequelize[_0x4340('0x5')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x4340('0x5')]},'port':{'type':Sequelize[_0x4340('0x21')](0x5)},'qualify':{'type':Sequelize[_0x4340('0x2')](_0x4340('0x17'),'no'),'defaultValue':_0x4340('0x17')},'keepalive':{'type':Sequelize[_0x4340('0x21')](0xb)},'defaultip':{'type':Sequelize[_0x4340('0x5')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x4340('0x21')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x4340('0x21')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x4340('0x21')](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no',_0x4340('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x4340('0x5')]},'timert1':{'type':Sequelize[_0x4340('0x21')](0xb)},'timerb':{'type':Sequelize[_0x4340('0x21')](0xb)},'qualifyfreq':{'type':Sequelize[_0x4340('0x21')](0xb)},'contactpermit':{'type':Sequelize[_0x4340('0x5')]},'contactdeny':{'type':Sequelize[_0x4340('0x5')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x4340('0x5')]},'maxforwards':{'type':Sequelize[_0x4340('0x21')](0xb)},'encryption':{'type':Sequelize[_0x4340('0x2')](_0x4340('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no')},'force_avp':{'type':Sequelize[_0x4340('0x2')]('yes','no')},'icesupport':{'type':Sequelize[_0x4340('0x2')](_0x4340('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0x4340('0x2')](_0x4340('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x4340('0x2')](_0x4340('0x17'),'no',_0x4340('0x29'),'certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x4340('0x5')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x4340('0x5')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x4340('0x5')]},'dtlssetup':{'type':Sequelize[_0x4340('0x2')]('active',_0x4340('0x2a'),_0x4340('0x2b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x4340('0x5')]},'usereqphone':{'type':Sequelize[_0x4340('0x2')](_0x4340('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x4340('0x5')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x4340('0x21')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x4340('0x2')](_0x4340('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0x4340('0x2')](_0x4340('0x17'),'no')},'vmexten':{'type':Sequelize[_0x4340('0x5')]},'mohinterpret':{'type':Sequelize[_0x4340('0x5')]},'mohsuggest':{'type':Sequelize[_0x4340('0x5')]},'parkinglot':{'type':Sequelize[_0x4340('0x5')]},'description':{'type':Sequelize[_0x4340('0x5')]},'host':{'type':Sequelize[_0x4340('0x5')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize['ENUM'](_0x4340('0x17'),'no',_0x4340('0x15'),_0x4340('0x16'),_0x4340('0x2c')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x4340('0x5')]},'active':{'type':Sequelize[_0x4340('0x2d')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x4340('0x5')],'defaultValue':'no'}}; \ No newline at end of file +var _0x8003=['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]','insecure','never','\x22\x22\x20<>','INTEGER','originate','uac','uas','fingerprint','certificate','passive','actpass','dynamic','update','BOOLEAN','sequelize','exports','name','ENUM','friend','peer','STRING','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','join','getDataValue','split','rfc2833','info','shortinfo','inband','auto','yes','nonat','outgoing','force_rport,comedia','nat'];(function(_0xe89b71,_0x4b2ed4){var _0x5dc5ac=function(_0x108837){while(--_0x108837){_0xe89b71['push'](_0xe89b71['shift']());}};_0x5dc5ac(++_0x4b2ed4);}(_0x8003,0x19b));var _0x3800=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x8003[_0x4e9628];return _0x27bc8c;};'use strict';var Sequelize=require(_0x3800('0x0'));module[_0x3800('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3800('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x3800('0x3')](_0x3800('0x4'),'user',_0x3800('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x3800('0x6')],'allowNull':![],'defaultValue':_0x3800('0x7')},'callingpres':{'type':Sequelize[_0x3800('0x3')]('ALLOWED_NOT_SCREENED',_0x3800('0x8'),_0x3800('0x9'),_0x3800('0xa'),_0x3800('0xb'),_0x3800('0xc'),_0x3800('0xd'),_0x3800('0xe'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x3800('0x6')]},'md5secret':{'type':Sequelize[_0x3800('0x6')]},'remotesecret':{'type':Sequelize[_0x3800('0x6')]},'transport':{'type':Sequelize['STRING'],'defaultValue':'udp','set':function(_0x2dc4c8){this[_0x3800('0xf')](_0x3800('0x10'),_0x2dc4c8?_0x2dc4c8[_0x3800('0x11')](','):null);},'get':function(){return this[_0x3800('0x12')](_0x3800('0x10'))?this[_0x3800('0x12')]('transport')[_0x3800('0x13')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x3800('0x3')](_0x3800('0x14'),_0x3800('0x15'),_0x3800('0x16'),_0x3800('0x17'),_0x3800('0x18')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x3800('0x3')](_0x3800('0x19'),'no',_0x3800('0x1a'),'update',_0x3800('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x3800('0x3')](_0x3800('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x3800('0x6')]},'directmediadeny':{'type':Sequelize[_0x3800('0x6')]},'nat':{'type':Sequelize[_0x3800('0x6')],'defaultValue':_0x3800('0x1c'),'set':function(_0x376a5d){this[_0x3800('0xf')](_0x3800('0x1d'),_0x376a5d?_0x376a5d[_0x3800('0x11')](','):null);},'get':function(){return this[_0x3800('0x12')](_0x3800('0x1d'))?this[_0x3800('0x12')](_0x3800('0x1d'))['split'](','):null;},'comment':_0x3800('0x1e')},'callgroup':{'type':Sequelize[_0x3800('0x6')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x3800('0x6')]},'language':{'type':Sequelize[_0x3800('0x6')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x3800('0x6')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x3800('0x1f')},'allow':{'type':Sequelize[_0x3800('0x6')],'allowNull':![],'defaultValue':_0x3800('0x20'),'set':function(_0x529899){this['setDataValue'](_0x3800('0x21'),_0x529899?_0x529899[_0x3800('0x11')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue']('allow')?this[_0x3800('0x12')]('allow')[_0x3800('0x13')](';'):null;},'comment':_0x3800('0x22')},'autoframing':{'type':Sequelize[_0x3800('0x3')]('yes','no')},'insecure':{'type':Sequelize[_0x3800('0x6')],'defaultValue':'port,invite','set':function(_0x3106db){this[_0x3800('0xf')](_0x3800('0x23'),_0x3106db?_0x3106db[_0x3800('0x11')](','):null);},'get':function(){return this[_0x3800('0x12')](_0x3800('0x23'))?this[_0x3800('0x12')](_0x3800('0x23'))[_0x3800('0x13')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x3800('0x3')](_0x3800('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x3800('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x3800('0x24'))},'promiscredir':{'type':Sequelize[_0x3800('0x3')](_0x3800('0x19'),'no')},'useclientcode':{'type':Sequelize[_0x3800('0x3')](_0x3800('0x19'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x3800('0x6')]},'callerid':{'type':Sequelize[_0x3800('0x6')],'defaultValue':_0x3800('0x25')},'amaflags':{'type':Sequelize[_0x3800('0x6')]},'callcounter':{'type':Sequelize[_0x3800('0x3')]('yes','no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x3800('0x26')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x3800('0x19'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x3800('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0x3800('0x3')](_0x3800('0x19'),'no')},'ignoresdpversion':{'type':Sequelize[_0x3800('0x3')](_0x3800('0x19'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x3800('0x3')](_0x3800('0x19'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x3800('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x3800('0x3')](_0x3800('0x19'),'no')},'mailbox':{'type':Sequelize[_0x3800('0x6')]},'session_timers':{'type':Sequelize[_0x3800('0x3')]('accept','refuse',_0x3800('0x27'))},'session_expires':{'type':Sequelize[_0x3800('0x26')](0xb)},'session_minse':{'type':Sequelize[_0x3800('0x26')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x3800('0x28'),_0x3800('0x29')),'defaultValue':_0x3800('0x29')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x3800('0x6')]},'fromdomain':{'type':Sequelize[_0x3800('0x6')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x3800('0x26')](0x5)},'qualify':{'type':Sequelize[_0x3800('0x3')](_0x3800('0x19'),'no'),'defaultValue':_0x3800('0x19')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x3800('0x6')]},'defaultuser':{'type':Sequelize[_0x3800('0x6')]},'rtptimeout':{'type':Sequelize[_0x3800('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x3800('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x3800('0x3')](_0x3800('0x19'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x3800('0x6')]},'callbackextension':{'type':Sequelize[_0x3800('0x6')]},'timert1':{'type':Sequelize[_0x3800('0x26')](0xb)},'timerb':{'type':Sequelize[_0x3800('0x26')](0xb)},'qualifyfreq':{'type':Sequelize[_0x3800('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0x3800('0x6')]},'contactdeny':{'type':Sequelize[_0x3800('0x6')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x3800('0x6')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x3800('0x26')](0xb)},'encryption':{'type':Sequelize[_0x3800('0x3')](_0x3800('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x3800('0x3')](_0x3800('0x19'),'no')},'force_avp':{'type':Sequelize[_0x3800('0x3')](_0x3800('0x19'),'no')},'icesupport':{'type':Sequelize[_0x3800('0x3')](_0x3800('0x19'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x3800('0x19'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x3800('0x19'),'no',_0x3800('0x2a'),_0x3800('0x2b'))},'dtlsrekey':{'type':Sequelize[_0x3800('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0x3800('0x6')]},'dtlsprivatekey':{'type':Sequelize[_0x3800('0x6')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x3800('0x6')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize['ENUM']('active',_0x3800('0x2c'),_0x3800('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize['ENUM'](_0x3800('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x3800('0x6')]},'recordofffeature':{'type':Sequelize[_0x3800('0x6')]},'call_limit':{'type':Sequelize[_0x3800('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x3800('0x19'),'no')},'subscribemwi':{'type':Sequelize[_0x3800('0x3')](_0x3800('0x19'),'no')},'vmexten':{'type':Sequelize[_0x3800('0x6')]},'mohinterpret':{'type':Sequelize[_0x3800('0x6')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x3800('0x6')]},'description':{'type':Sequelize[_0x3800('0x6')]},'host':{'type':Sequelize[_0x3800('0x6')],'defaultValue':_0x3800('0x2e')},'canreinvite':{'type':Sequelize[_0x3800('0x3')](_0x3800('0x19'),'no',_0x3800('0x1a'),_0x3800('0x2f'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x3800('0x6')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x3800('0x30')],'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 52f9df7..31d3cda 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 _0xa41a=['server/files/templates/registry.ejs','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','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','catch','sendStatus','status','json','offset','undefined','limit','count','set','reject','update','destroy','get','UserProfileResource','end','name','send','map','Trunk','fieldName','type','key','query','intersection','model','attributes','fields','length','order','filters','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','keys','rawAttributes','find','createdAt','updatedAt','body','create','user','UserProfileSection','userProfileId','autoAssociation','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','/etc/asterisk/sip_xcally_trunks.conf','registry','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','role','Trunks','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Reload'];(function(_0x160e96,_0x24fd39){var _0x19ed54=function(_0x5c6fc5){while(--_0x5c6fc5){_0x160e96['push'](_0x160e96['shift']());}};_0x19ed54(++_0x24fd39);}(_0xa41a,0x6b));var _0xaa41=function(_0xf850fa,_0x49c109){_0xf850fa=_0xf850fa-0x0;var _0x1b97e8=_0xa41a[_0xf850fa];return _0x1b97e8;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xaa41('0x19'));var client=jayson['client'][_0xaa41('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x12d9e6,_0x2f64bc,_0x889d44,_0x6f9ade){return new BPromise(function(_0x4eaf81,_0x1e9d7f){var _0x178170=_0x6f9ade||client;return _0x178170[_0xaa41('0x1b')](_0x12d9e6,_0x889d44)[_0xaa41('0x1c')](function(_0x2a6988){logger[_0xaa41('0x1d')](_0xaa41('0x1e'),_0x2f64bc,'request\x20sent');logger[_0xaa41('0x1f')](_0xaa41('0x20'),_0x2f64bc,_0xaa41('0x21'),JSON[_0xaa41('0x22')](_0x2a6988));if(_0x2a6988[_0xaa41('0x23')]){if(_0x2a6988[_0xaa41('0x23')][_0xaa41('0x24')]===0x1f4){logger[_0xaa41('0x23')](_0xaa41('0x1e'),_0x2f64bc,_0x2a6988['error']['message']);return _0x1e9d7f(_0x2a6988[_0xaa41('0x23')][_0xaa41('0x25')]);}logger[_0xaa41('0x23')]('Trunk,\x20%s,\x20%s',_0x2f64bc,_0x2a6988[_0xaa41('0x23')][_0xaa41('0x25')]);return _0x4eaf81(_0x2a6988['error']['message']);}else{logger[_0xaa41('0x1d')]('Trunk,\x20%s,\x20%s',_0x2f64bc,_0xaa41('0x21'));_0x4eaf81(_0x2a6988[_0xaa41('0x26')][_0xaa41('0x25')]);}})[_0xaa41('0x27')](function(_0x1d623c){logger['error'](_0xaa41('0x1e'),_0x2f64bc,_0x1d623c);_0x1e9d7f(_0x1d623c);});});}function respondWithStatusCode(_0x43a85c,_0x448a21){_0x448a21=_0x448a21||0xcc;return function(_0x21f596){if(_0x21f596){return _0x43a85c[_0xaa41('0x28')](_0x448a21);}return _0x43a85c[_0xaa41('0x29')](_0x448a21)['end']();};}function respondWithResult(_0x5795f4,_0x16aec5){_0x16aec5=_0x16aec5||0xc8;return function(_0x527cac){if(_0x527cac){return _0x5795f4['status'](_0x16aec5)[_0xaa41('0x2a')](_0x527cac);}};}function respondWithFilteredResult(_0x59707f,_0x536bed){return function(_0x2d0ac0){if(_0x2d0ac0){var _0x9c8c21=typeof _0x536bed[_0xaa41('0x2b')]===_0xaa41('0x2c')&&typeof _0x536bed[_0xaa41('0x2d')]===_0xaa41('0x2c');var _0x57ef96=_0x2d0ac0[_0xaa41('0x2e')];var _0x1f0275=_0x9c8c21?0x0:_0x536bed[_0xaa41('0x2b')];var _0x9a16e3=_0x9c8c21?_0x2d0ac0[_0xaa41('0x2e')]:_0x536bed[_0xaa41('0x2b')]+_0x536bed[_0xaa41('0x2d')];var _0x104a95;if(_0x9a16e3>=_0x57ef96){_0x9a16e3=_0x57ef96;_0x104a95=0xc8;}else{_0x104a95=0xce;}_0x59707f['status'](_0x104a95);return _0x59707f[_0xaa41('0x2f')]('Content-Range',_0x1f0275+'-'+_0x9a16e3+'/'+_0x57ef96)['json'](_0x2d0ac0);}return null;};}function patchUpdates(_0x714537){return function(_0x1176bd){try{jsonpatch['apply'](_0x1176bd,_0x714537,!![]);}catch(_0x392b5d){return BPromise[_0xaa41('0x30')](_0x392b5d);}return _0x1176bd['save']();};}function saveUpdates(_0x5022fb,_0x5c25fb){return function(_0x1cf3da){if(_0x1cf3da){return _0x1cf3da[_0xaa41('0x31')](_0x5022fb)[_0xaa41('0x1c')](function(_0x38afc4){return _0x38afc4;});}return null;};}function removeEntity(_0x58f203,_0x289c4a){return function(_0x45c8fe){if(_0x45c8fe){return _0x45c8fe[_0xaa41('0x32')]()['then'](function(){var _0x387c55=_0x45c8fe[_0xaa41('0x33')]({'plain':!![]});var _0x321eb7='Trunks';return db[_0xaa41('0x34')][_0xaa41('0x32')]({'where':{'type':_0x321eb7,'resourceId':_0x387c55['id']}})['then'](function(){return _0x45c8fe;});})[_0xaa41('0x1c')](function(){_0x58f203[_0xaa41('0x29')](0xcc)[_0xaa41('0x35')]();});}};}function handleEntityNotFound(_0x5cec87,_0x22b272){return function(_0x48335f){if(!_0x48335f){_0x5cec87[_0xaa41('0x28')](0x194);}return _0x48335f;};}function handleError(_0x199b24,_0xf13742){_0xf13742=_0xf13742||0x1f4;return function(_0x49b77a){logger['error'](_0x49b77a['stack']);if(_0x49b77a[_0xaa41('0x36')]){delete _0x49b77a[_0xaa41('0x36')];}_0x199b24[_0xaa41('0x29')](_0xf13742)[_0xaa41('0x37')](_0x49b77a);};}exports['index']=function(_0x53a2e4,_0x267999){var _0x5673c={},_0x951e52={},_0x4e8d2e={'count':0x0,'rows':[]};var _0xba115a=_[_0xaa41('0x38')](db[_0xaa41('0x39')]['rawAttributes'],function(_0x3adc28){return{'name':_0x3adc28[_0xaa41('0x3a')],'type':_0x3adc28[_0xaa41('0x3b')][_0xaa41('0x3c')]};});_0x951e52['model']=_['map'](_0xba115a,_0xaa41('0x36'));_0x951e52[_0xaa41('0x3d')]=_['keys'](_0x53a2e4[_0xaa41('0x3d')]);_0x951e52['filters']=_[_0xaa41('0x3e')](_0x951e52[_0xaa41('0x3f')],_0x951e52[_0xaa41('0x3d')]);_0x5673c[_0xaa41('0x40')]=_[_0xaa41('0x3e')](_0x951e52[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x53a2e4[_0xaa41('0x3d')]['fields']));_0x5673c[_0xaa41('0x40')]=_0x5673c[_0xaa41('0x40')][_0xaa41('0x42')]?_0x5673c[_0xaa41('0x40')]:_0x951e52[_0xaa41('0x3f')];if(!_0x53a2e4[_0xaa41('0x3d')]['hasOwnProperty']('nolimit')){_0x5673c[_0xaa41('0x2d')]=qs['limit'](_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x2d')]);_0x5673c[_0xaa41('0x2b')]=qs[_0xaa41('0x2b')](_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x2b')]);}_0x5673c[_0xaa41('0x43')]=qs['sort'](_0x53a2e4[_0xaa41('0x3d')]['sort']);_0x5673c['where']=qs[_0xaa41('0x44')](_['pick'](_0x53a2e4['query'],_0x951e52['filters']),_0xba115a);if(_0x53a2e4[_0xaa41('0x3d')]['filter']){_0x5673c[_0xaa41('0x45')]=_[_0xaa41('0x46')](_0x5673c['where'],{'$or':_['map'](_0xba115a,function(_0xe58f5e){if(_0xe58f5e[_0xaa41('0x3b')]!==_0xaa41('0x47')){var _0x2af8ba={};_0x2af8ba[_0xe58f5e[_0xaa41('0x36')]]={'$like':'%'+_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x48')]+'%'};return _0x2af8ba;}})});}_0x5673c=_[_0xaa41('0x46')]({},_0x5673c,_0x53a2e4[_0xaa41('0x49')]);var _0x4e1ac4={'where':_0x5673c[_0xaa41('0x45')]};return db[_0xaa41('0x39')][_0xaa41('0x2e')](_0x4e1ac4)[_0xaa41('0x1c')](function(_0x206d86){_0x4e8d2e[_0xaa41('0x2e')]=_0x206d86;if(_0x53a2e4['query'][_0xaa41('0x4a')]){_0x5673c[_0xaa41('0x4b')]=[{'all':!![]}];}return db[_0xaa41('0x39')][_0xaa41('0x4c')](_0x5673c);})['then'](function(_0x23bc61){_0x4e8d2e['rows']=_0x23bc61;return _0x4e8d2e;})['then'](respondWithFilteredResult(_0x267999,_0x5673c))[_0xaa41('0x27')](handleError(_0x267999,null));};exports[_0xaa41('0x4d')]=function(_0x3e16ef,_0x4ca114){var _0xb4773b={'raw':![],'where':{'id':_0x3e16ef[_0xaa41('0x4e')]['id']}},_0x3e1a73={};_0x3e1a73['model']=_[_0xaa41('0x4f')](db[_0xaa41('0x39')][_0xaa41('0x50')]);_0x3e1a73[_0xaa41('0x3d')]=_[_0xaa41('0x4f')](_0x3e16ef[_0xaa41('0x3d')]);_0x3e1a73[_0xaa41('0x44')]=_[_0xaa41('0x3e')](_0x3e1a73['model'],_0x3e1a73[_0xaa41('0x3d')]);_0xb4773b['attributes']=_['intersection'](_0x3e1a73[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x3e16ef[_0xaa41('0x3d')][_0xaa41('0x41')]));_0xb4773b[_0xaa41('0x40')]=_0xb4773b[_0xaa41('0x40')][_0xaa41('0x42')]?_0xb4773b[_0xaa41('0x40')]:_0x3e1a73['model'];if(_0x3e16ef[_0xaa41('0x3d')][_0xaa41('0x4a')]){_0xb4773b[_0xaa41('0x4b')]=[{'all':!![]}];}_0xb4773b=_['merge']({},_0xb4773b,_0x3e16ef[_0xaa41('0x49')]);return db[_0xaa41('0x39')]['find'](_0xb4773b)[_0xaa41('0x1c')](handleEntityNotFound(_0x4ca114,null))[_0xaa41('0x1c')](respondWithResult(_0x4ca114,null))[_0xaa41('0x27')](handleError(_0x4ca114,null));};exports['clone']=function(_0x2cf32c,_0xc8e626){var _0x4e3b13={'where':{'id':_0x2cf32c[_0xaa41('0x4e')]['id']}},_0x49789a={};_0x49789a[_0xaa41('0x3f')]=_[_0xaa41('0x4f')](db['Trunk'][_0xaa41('0x50')]);_0x4e3b13[_0xaa41('0x40')]=_[_0xaa41('0x3e')](_0x49789a[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x2cf32c['query'][_0xaa41('0x41')]));_0x4e3b13['attributes']=_0x4e3b13['attributes'][_0xaa41('0x42')]?_0x4e3b13['attributes']:_0x49789a[_0xaa41('0x3f')];if(_0x2cf32c[_0xaa41('0x3d')][_0xaa41('0x4a')]){_0x4e3b13['include']=[{'all':!![]}];}_0x4e3b13=_[_0xaa41('0x46')]({},_0x4e3b13,_0x2cf32c[_0xaa41('0x49')]);return db[_0xaa41('0x39')][_0xaa41('0x51')](_0x4e3b13)[_0xaa41('0x1c')](handleEntityNotFound(_0xc8e626,null))[_0xaa41('0x1c')](function(_0xc56018){if(_0xc56018){var _0x337059=_0xc56018[_0xaa41('0x33')]({'plain':!![]});_0x337059=qs['omit'](_0x337059,['id',_0xaa41('0x52'),_0xaa41('0x53')]);_0x2cf32c[_0xaa41('0x54')]=_['omit'](_0x2cf32c[_0xaa41('0x54')],['id',_0xaa41('0x52'),_0xaa41('0x53')]);return db[_0xaa41('0x39')][_0xaa41('0x55')](_[_0xaa41('0x46')](_0x337059,_0x2cf32c[_0xaa41('0x54')]),{'include':_0x2cf32c['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x540325){var _0x4ec357=_0x2cf32c['user'][_0xaa41('0x33')]({'plain':!![]});if(!_0x4ec357)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ec357['role']===_0xaa41('0x56')){var _0x40a524=_0x540325[_0xaa41('0x33')]({'plain':!![]});var _0x312eee='Trunks';return db[_0xaa41('0x57')][_0xaa41('0x51')]({'where':{'name':_0x312eee,'userProfileId':_0x4ec357[_0xaa41('0x58')]},'raw':!![]})[_0xaa41('0x1c')](function(_0xa71432){if(_0xa71432&&_0xa71432[_0xaa41('0x59')]===0x0){return db[_0xaa41('0x34')][_0xaa41('0x55')]({'name':_0x40a524[_0xaa41('0x36')],'resourceId':_0x40a524['id'],'type':_0xa71432['name'],'sectionId':_0xa71432['id']},{})[_0xaa41('0x1c')](function(){return _0x540325;});}else{return _0x540325;}})[_0xaa41('0x27')](function(_0x50170f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50170f);throw _0x50170f;});}return _0x540325;});}})[_0xaa41('0x1c')](respondWithResult(_0xc8e626,0xc9))['catch'](handleError(_0xc8e626,null));};exports[_0xaa41('0x55')]=function(_0x5c8028,_0x5423b6,_0x18d18b){var _0x4b1ec4;return db[_0xaa41('0x39')][_0xaa41('0x55')](_0x5c8028[_0xaa41('0x54')],{'raw':!![]})[_0xaa41('0x1c')](function(_0x5a2683){_0x4b1ec4=_0x5a2683;return db['Trunk'][_0xaa41('0x4c')]({'raw':!![]});})[_0xaa41('0x1c')](function(_0x4d6d0c){var _0x5954ba=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config[_0xaa41('0x5c')],_0xaa41('0x5d')),_0xaa41('0x5e'));var _0x5a385e=fs[_0xaa41('0x5a')](path['join'](config['root'],'server/files/templates/registry.ejs'),_0xaa41('0x5e'));var _0x19ec63=ejs[_0xaa41('0x5f')](_0x5954ba,{'trunks':_0x4d6d0c||[]});fs['writeFileSync'](_0xaa41('0x60'),_0x19ec63);if(_0x4b1ec4[_0xaa41('0x61')]){var _0x19ed68=ejs[_0xaa41('0x5f')](_0x5a385e,{'trunks':_0x4d6d0c||[]});fs[_0xaa41('0x62')](_0xaa41('0x63'),_0x19ed68);}})[_0xaa41('0x1c')](function(){return respondWithRpcPromise('Reload',_0xaa41('0x55'),{'module':_0xaa41('0x64')});})[_0xaa41('0x1c')](function(){var _0x175ca9=_0x5c8028['user'][_0xaa41('0x33')]({'plain':!![]});if(!_0x175ca9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x175ca9[_0xaa41('0x65')]===_0xaa41('0x56')){var _0x2b9e68=_0x4b1ec4[_0xaa41('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xaa41('0x51')]({'where':{'name':_0xaa41('0x66'),'userProfileId':_0x175ca9[_0xaa41('0x58')]},'raw':!![]})[_0xaa41('0x1c')](function(_0x59052d){if(_0x59052d&&_0x59052d[_0xaa41('0x59')]===0x0){return db['UserProfileResource'][_0xaa41('0x55')]({'name':_0x2b9e68[_0xaa41('0x36')],'resourceId':_0x2b9e68['id'],'type':_0x59052d['name'],'sectionId':_0x59052d['id']},{})[_0xaa41('0x1c')](function(){return _0x4b1ec4;});}else{return _0x4b1ec4;}})[_0xaa41('0x27')](function(_0x2ba160){logger[_0xaa41('0x23')](_0xaa41('0x67'),_0x2ba160);throw _0x2ba160;});}return _0x4b1ec4;})[_0xaa41('0x1c')](respondWithResult(_0x5423b6,0xc9))[_0xaa41('0x27')](handleError(_0x5423b6,null));};exports[_0xaa41('0x31')]=function(_0x33b5f4,_0x3d4f1e,_0x25a064){var _0x59a30b;return db[_0xaa41('0x39')][_0xaa41('0x51')]({'where':{'id':_0x33b5f4[_0xaa41('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3d4f1e,null))['then'](saveUpdates(_0x33b5f4[_0xaa41('0x54')],null))[_0xaa41('0x1c')](function(_0x59fd6a){if(_0x59fd6a){_0x59a30b=_0x59fd6a;return db[_0xaa41('0x39')][_0xaa41('0x4c')]({'raw':!![]});}})['then'](function(_0x305050){if(_0x305050){var _0x3dd47e=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config[_0xaa41('0x5c')],_0xaa41('0x5d')),_0xaa41('0x5e'));var _0x1472be=fs['readFileSync'](path['join'](config[_0xaa41('0x5c')],'server/files/templates/registry.ejs'),_0xaa41('0x5e'));var _0x44154f=ejs[_0xaa41('0x5f')](_0x3dd47e,{'trunks':_0x305050||[]});fs['writeFileSync'](_0xaa41('0x60'),_0x44154f);var _0x404c38=ejs[_0xaa41('0x5f')](_0x1472be,{'trunks':_0x305050||[]});fs['writeFileSync'](_0xaa41('0x63'),_0x404c38);return respondWithRpcPromise(_0xaa41('0x68'),'update',{'module':_0xaa41('0x64')});}return null;})['then'](function(_0x53faf4){if(_0x53faf4){return _0x59a30b;}})[_0xaa41('0x1c')](respondWithResult(_0x3d4f1e,null))[_0xaa41('0x27')](handleError(_0x3d4f1e,null));};exports['destroy']=function(_0x5a8cb0,_0x241e1a,_0x1726ec){var _0x3c189d;return db[_0xaa41('0x39')]['find']({'where':{'id':_0x5a8cb0[_0xaa41('0x4e')]['id']}})[_0xaa41('0x1c')](handleEntityNotFound(_0x241e1a,null))[_0xaa41('0x1c')](removeEntity(_0x241e1a,null))['then'](function(){return db[_0xaa41('0x39')][_0xaa41('0x4c')]({'raw':!![]});})[_0xaa41('0x1c')](function(_0x5697b6){var _0x183b36=fs['readFileSync'](path['join'](config[_0xaa41('0x5c')],_0xaa41('0x5d')),'utf8');var _0x399fbd=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config['root'],_0xaa41('0x69')),_0xaa41('0x5e'));var _0x1a2deb=ejs[_0xaa41('0x5f')](_0x183b36,{'trunks':_0x5697b6});var _0x38f5d0=ejs['render'](_0x399fbd,{'trunks':_0x5697b6});fs[_0xaa41('0x62')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1a2deb);fs[_0xaa41('0x62')](_0xaa41('0x63'),_0x38f5d0);return respondWithRpcPromise(_0xaa41('0x68'),_0xaa41('0x32'),{'module':_0xaa41('0x64')});})[_0xaa41('0x27')](handleError(_0x241e1a,null));}; \ No newline at end of file +var _0x54ef=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','include','find','get','updatedAt','omit','body','createdAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','userProfileId','root','chan_sip.so','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','http','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','Trunks','UserProfileResource','name','send','index','map','Trunk','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x541adf,_0x41b0e2){var _0x8bb31e=function(_0x9f69d4){while(--_0x9f69d4){_0x541adf['push'](_0x541adf['shift']());}};_0x8bb31e(++_0x41b0e2);}(_0x54ef,0x112));var _0xf54e=function(_0x3a3938,_0x56eda6){_0x3a3938=_0x3a3938-0x0;var _0x34b00f=_0x54ef[_0x3a3938];return _0x34b00f;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x2033e9,_0x28f776,_0x380f26,_0x5644aa){return new BPromise(function(_0x331732,_0x1bbeaa){var _0x1855fe=_0x5644aa||client;return _0x1855fe[_0xf54e('0x1a')](_0x2033e9,_0x380f26)['then'](function(_0x2366ee){logger[_0xf54e('0x1b')](_0xf54e('0x1c'),_0x28f776,'request\x20sent');logger['debug'](_0xf54e('0x1d'),_0x28f776,_0xf54e('0x1e'),JSON[_0xf54e('0x1f')](_0x2366ee));if(_0x2366ee[_0xf54e('0x20')]){if(_0x2366ee[_0xf54e('0x20')][_0xf54e('0x21')]===0x1f4){logger[_0xf54e('0x20')](_0xf54e('0x1c'),_0x28f776,_0x2366ee[_0xf54e('0x20')][_0xf54e('0x22')]);return _0x1bbeaa(_0x2366ee[_0xf54e('0x20')]['message']);}logger['error'](_0xf54e('0x1c'),_0x28f776,_0x2366ee['error'][_0xf54e('0x22')]);return _0x331732(_0x2366ee[_0xf54e('0x20')][_0xf54e('0x22')]);}else{logger[_0xf54e('0x1b')](_0xf54e('0x1c'),_0x28f776,_0xf54e('0x1e'));_0x331732(_0x2366ee[_0xf54e('0x23')][_0xf54e('0x22')]);}})[_0xf54e('0x24')](function(_0x5f9eea){logger[_0xf54e('0x20')]('Trunk,\x20%s,\x20%s',_0x28f776,_0x5f9eea);_0x1bbeaa(_0x5f9eea);});});}function respondWithStatusCode(_0x6f6d29,_0x54f914){_0x54f914=_0x54f914||0xcc;return function(_0x264a8f){if(_0x264a8f){return _0x6f6d29[_0xf54e('0x25')](_0x54f914);}return _0x6f6d29[_0xf54e('0x26')](_0x54f914)[_0xf54e('0x27')]();};}function respondWithResult(_0x3805a7,_0x160160){_0x160160=_0x160160||0xc8;return function(_0x1e08d1){if(_0x1e08d1){return _0x3805a7[_0xf54e('0x26')](_0x160160)[_0xf54e('0x28')](_0x1e08d1);}};}function respondWithFilteredResult(_0x33457f,_0xf6cdd7){return function(_0x39c0ae){if(_0x39c0ae){var _0x2ea001=typeof _0xf6cdd7['offset']===_0xf54e('0x29')&&typeof _0xf6cdd7['limit']===_0xf54e('0x29');var _0x5e63f4=_0x39c0ae[_0xf54e('0x2a')];var _0x269f47=_0x2ea001?0x0:_0xf6cdd7[_0xf54e('0x2b')];var _0xa13cd0=_0x2ea001?_0x39c0ae[_0xf54e('0x2a')]:_0xf6cdd7[_0xf54e('0x2b')]+_0xf6cdd7[_0xf54e('0x2c')];var _0x54bd8f;if(_0xa13cd0>=_0x5e63f4){_0xa13cd0=_0x5e63f4;_0x54bd8f=0xc8;}else{_0x54bd8f=0xce;}_0x33457f['status'](_0x54bd8f);return _0x33457f[_0xf54e('0x2d')](_0xf54e('0x2e'),_0x269f47+'-'+_0xa13cd0+'/'+_0x5e63f4)[_0xf54e('0x28')](_0x39c0ae);}return null;};}function patchUpdates(_0x16d00f){return function(_0xb2d4c4){try{jsonpatch[_0xf54e('0x2f')](_0xb2d4c4,_0x16d00f,!![]);}catch(_0x2b5408){return BPromise[_0xf54e('0x30')](_0x2b5408);}return _0xb2d4c4[_0xf54e('0x31')]();};}function saveUpdates(_0x12edc3,_0x5ea0cc){return function(_0x5f29d3){if(_0x5f29d3){return _0x5f29d3[_0xf54e('0x32')](_0x12edc3)[_0xf54e('0x33')](function(_0x4d8fdd){return _0x4d8fdd;});}return null;};}function removeEntity(_0x3e319c,_0x82e313){return function(_0x379110){if(_0x379110){return _0x379110[_0xf54e('0x34')]()['then'](function(){var _0x54bea4=_0x379110['get']({'plain':!![]});var _0x3c0cca=_0xf54e('0x35');return db[_0xf54e('0x36')][_0xf54e('0x34')]({'where':{'type':_0x3c0cca,'resourceId':_0x54bea4['id']}})[_0xf54e('0x33')](function(){return _0x379110;});})[_0xf54e('0x33')](function(){_0x3e319c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x530cee,_0xc04e04){return function(_0x734187){if(!_0x734187){_0x530cee['sendStatus'](0x194);}return _0x734187;};}function handleError(_0x4d9b06,_0xda1d10){_0xda1d10=_0xda1d10||0x1f4;return function(_0x2c0d30){logger[_0xf54e('0x20')](_0x2c0d30['stack']);if(_0x2c0d30[_0xf54e('0x37')]){delete _0x2c0d30[_0xf54e('0x37')];}_0x4d9b06['status'](_0xda1d10)[_0xf54e('0x38')](_0x2c0d30);};}exports[_0xf54e('0x39')]=function(_0x5af03,_0x1eeeb4){var _0x12ef97={},_0x199056={},_0x4e00b7={'count':0x0,'rows':[]};var _0x5d45cf=_[_0xf54e('0x3a')](db[_0xf54e('0x3b')][_0xf54e('0x3c')],function(_0x4b1f84){return{'name':_0x4b1f84[_0xf54e('0x3d')],'type':_0x4b1f84[_0xf54e('0x3e')][_0xf54e('0x3f')]};});_0x199056[_0xf54e('0x40')]=_[_0xf54e('0x3a')](_0x5d45cf,_0xf54e('0x37'));_0x199056[_0xf54e('0x41')]=_[_0xf54e('0x42')](_0x5af03[_0xf54e('0x41')]);_0x199056[_0xf54e('0x43')]=_[_0xf54e('0x44')](_0x199056[_0xf54e('0x40')],_0x199056[_0xf54e('0x41')]);_0x12ef97[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x199056['model'],qs['fields'](_0x5af03['query'][_0xf54e('0x46')]));_0x12ef97[_0xf54e('0x45')]=_0x12ef97['attributes'][_0xf54e('0x47')]?_0x12ef97[_0xf54e('0x45')]:_0x199056[_0xf54e('0x40')];if(!_0x5af03['query'][_0xf54e('0x48')](_0xf54e('0x49'))){_0x12ef97[_0xf54e('0x2c')]=qs[_0xf54e('0x2c')](_0x5af03[_0xf54e('0x41')][_0xf54e('0x2c')]);_0x12ef97[_0xf54e('0x2b')]=qs[_0xf54e('0x2b')](_0x5af03[_0xf54e('0x41')]['offset']);}_0x12ef97[_0xf54e('0x4a')]=qs[_0xf54e('0x4b')](_0x5af03[_0xf54e('0x41')][_0xf54e('0x4b')]);_0x12ef97[_0xf54e('0x4c')]=qs[_0xf54e('0x43')](_['pick'](_0x5af03[_0xf54e('0x41')],_0x199056['filters']),_0x5d45cf);if(_0x5af03[_0xf54e('0x41')]['filter']){_0x12ef97[_0xf54e('0x4c')]=_[_0xf54e('0x4d')](_0x12ef97[_0xf54e('0x4c')],{'$or':_['map'](_0x5d45cf,function(_0x1af35d){if(_0x1af35d[_0xf54e('0x3e')]!==_0xf54e('0x4e')){var _0x32fb46={};_0x32fb46[_0x1af35d[_0xf54e('0x37')]]={'$like':'%'+_0x5af03['query'][_0xf54e('0x4f')]+'%'};return _0x32fb46;}})});}_0x12ef97=_[_0xf54e('0x4d')]({},_0x12ef97,_0x5af03[_0xf54e('0x50')]);var _0x45592b={'where':_0x12ef97['where']};return db[_0xf54e('0x3b')][_0xf54e('0x2a')](_0x45592b)['then'](function(_0x22c842){_0x4e00b7[_0xf54e('0x2a')]=_0x22c842;if(_0x5af03[_0xf54e('0x41')][_0xf54e('0x51')]){_0x12ef97['include']=[{'all':!![]}];}return db[_0xf54e('0x3b')][_0xf54e('0x52')](_0x12ef97);})[_0xf54e('0x33')](function(_0xb4654f){_0x4e00b7[_0xf54e('0x53')]=_0xb4654f;return _0x4e00b7;})[_0xf54e('0x33')](respondWithFilteredResult(_0x1eeeb4,_0x12ef97))[_0xf54e('0x24')](handleError(_0x1eeeb4,null));};exports[_0xf54e('0x54')]=function(_0x15bfef,_0x21f2f8){var _0xaf9bf0={'raw':![],'where':{'id':_0x15bfef[_0xf54e('0x55')]['id']}},_0x1f4cf8={};_0x1f4cf8[_0xf54e('0x40')]=_[_0xf54e('0x42')](db[_0xf54e('0x3b')][_0xf54e('0x3c')]);_0x1f4cf8[_0xf54e('0x41')]=_[_0xf54e('0x42')](_0x15bfef[_0xf54e('0x41')]);_0x1f4cf8['filters']=_['intersection'](_0x1f4cf8[_0xf54e('0x40')],_0x1f4cf8[_0xf54e('0x41')]);_0xaf9bf0[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x1f4cf8[_0xf54e('0x40')],qs[_0xf54e('0x46')](_0x15bfef[_0xf54e('0x41')][_0xf54e('0x46')]));_0xaf9bf0[_0xf54e('0x45')]=_0xaf9bf0[_0xf54e('0x45')][_0xf54e('0x47')]?_0xaf9bf0['attributes']:_0x1f4cf8[_0xf54e('0x40')];if(_0x15bfef[_0xf54e('0x41')][_0xf54e('0x51')]){_0xaf9bf0[_0xf54e('0x56')]=[{'all':!![]}];}_0xaf9bf0=_[_0xf54e('0x4d')]({},_0xaf9bf0,_0x15bfef[_0xf54e('0x50')]);return db[_0xf54e('0x3b')]['find'](_0xaf9bf0)[_0xf54e('0x33')](handleEntityNotFound(_0x21f2f8,null))[_0xf54e('0x33')](respondWithResult(_0x21f2f8,null))[_0xf54e('0x24')](handleError(_0x21f2f8,null));};exports['clone']=function(_0x3ce832,_0x54ac1a){var _0x465a0f={'where':{'id':_0x3ce832[_0xf54e('0x55')]['id']}},_0x400ee0={};_0x400ee0['model']=_[_0xf54e('0x42')](db[_0xf54e('0x3b')][_0xf54e('0x3c')]);_0x465a0f[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x400ee0[_0xf54e('0x40')],qs[_0xf54e('0x46')](_0x3ce832['query']['fields']));_0x465a0f[_0xf54e('0x45')]=_0x465a0f[_0xf54e('0x45')]['length']?_0x465a0f[_0xf54e('0x45')]:_0x400ee0['model'];if(_0x3ce832[_0xf54e('0x41')]['includeAll']){_0x465a0f[_0xf54e('0x56')]=[{'all':!![]}];}_0x465a0f=_[_0xf54e('0x4d')]({},_0x465a0f,_0x3ce832[_0xf54e('0x50')]);return db[_0xf54e('0x3b')][_0xf54e('0x57')](_0x465a0f)[_0xf54e('0x33')](handleEntityNotFound(_0x54ac1a,null))['then'](function(_0x479572){if(_0x479572){var _0x79345=_0x479572[_0xf54e('0x58')]({'plain':!![]});_0x79345=qs['omit'](_0x79345,['id','createdAt',_0xf54e('0x59')]);_0x3ce832['body']=_[_0xf54e('0x5a')](_0x3ce832[_0xf54e('0x5b')],['id',_0xf54e('0x5c'),_0xf54e('0x59')]);return db[_0xf54e('0x3b')][_0xf54e('0x5d')](_[_0xf54e('0x4d')](_0x79345,_0x3ce832[_0xf54e('0x5b')]),{'include':_0x3ce832[_0xf54e('0x41')][_0xf54e('0x51')]?[{'all':!![]}]:undefined})[_0xf54e('0x33')](function(_0x2c6d0e){var _0x65bdf2=_0x3ce832[_0xf54e('0x5e')]['get']({'plain':!![]});if(!_0x65bdf2)throw new Error(_0xf54e('0x5f'));if(_0x65bdf2[_0xf54e('0x60')]===_0xf54e('0x5e')){var _0x11908b=_0x2c6d0e[_0xf54e('0x58')]({'plain':!![]});var _0x494629=_0xf54e('0x35');return db[_0xf54e('0x61')]['find']({'where':{'name':_0x494629,'userProfileId':_0x65bdf2['userProfileId']},'raw':!![]})[_0xf54e('0x33')](function(_0x4b4a2f){if(_0x4b4a2f&&_0x4b4a2f[_0xf54e('0x62')]===0x0){return db[_0xf54e('0x36')][_0xf54e('0x5d')]({'name':_0x11908b[_0xf54e('0x37')],'resourceId':_0x11908b['id'],'type':_0x4b4a2f['name'],'sectionId':_0x4b4a2f['id']},{})[_0xf54e('0x33')](function(){return _0x2c6d0e;});}else{return _0x2c6d0e;}})['catch'](function(_0x3800d4){logger[_0xf54e('0x20')](_0xf54e('0x63'),_0x3800d4);throw _0x3800d4;});}return _0x2c6d0e;});}})['then'](respondWithResult(_0x54ac1a,0xc9))[_0xf54e('0x24')](handleError(_0x54ac1a,null));};exports['create']=function(_0x3f7224,_0x3e2101,_0x5500d7){var _0x380b4f;return db['Trunk'][_0xf54e('0x5d')](_0x3f7224[_0xf54e('0x5b')],{'raw':!![]})[_0xf54e('0x33')](function(_0x38405c){_0x380b4f=_0x38405c;return db[_0xf54e('0x3b')]['findAll']({'raw':!![]});})[_0xf54e('0x33')](function(_0x1d18d3){var _0x57db6f=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config['root'],_0xf54e('0x66')),_0xf54e('0x67'));var _0x309895=fs['readFileSync'](path[_0xf54e('0x65')](config['root'],_0xf54e('0x68')),_0xf54e('0x67'));var _0x5e45e7=ejs[_0xf54e('0x69')](_0x57db6f,{'trunks':_0x1d18d3||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6b'),_0x5e45e7);if(_0x380b4f[_0xf54e('0x6c')]){var _0x38bf71=ejs[_0xf54e('0x69')](_0x309895,{'trunks':_0x1d18d3||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x38bf71);}})[_0xf54e('0x33')](function(){return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x5d'),{'module':'chan_sip.so'});})[_0xf54e('0x33')](function(){var _0x2c20b5=_0x3f7224[_0xf54e('0x5e')]['get']({'plain':!![]});if(!_0x2c20b5)throw new Error(_0xf54e('0x5f'));if(_0x2c20b5[_0xf54e('0x60')]===_0xf54e('0x5e')){var _0x13db3e=_0x380b4f[_0xf54e('0x58')]({'plain':!![]});return db[_0xf54e('0x61')][_0xf54e('0x57')]({'where':{'name':'Trunks','userProfileId':_0x2c20b5[_0xf54e('0x6f')]},'raw':!![]})[_0xf54e('0x33')](function(_0x261c39){if(_0x261c39&&_0x261c39['autoAssociation']===0x0){return db[_0xf54e('0x36')][_0xf54e('0x5d')]({'name':_0x13db3e[_0xf54e('0x37')],'resourceId':_0x13db3e['id'],'type':_0x261c39[_0xf54e('0x37')],'sectionId':_0x261c39['id']},{})['then'](function(){return _0x380b4f;});}else{return _0x380b4f;}})['catch'](function(_0x25d05e){logger[_0xf54e('0x20')](_0xf54e('0x63'),_0x25d05e);throw _0x25d05e;});}return _0x380b4f;})[_0xf54e('0x33')](respondWithResult(_0x3e2101,0xc9))[_0xf54e('0x24')](handleError(_0x3e2101,null));};exports[_0xf54e('0x32')]=function(_0x35b5a4,_0x3b2a3e,_0xf5108b){var _0x205b47;return db['Trunk'][_0xf54e('0x57')]({'where':{'id':_0x35b5a4[_0xf54e('0x55')]['id']}})[_0xf54e('0x33')](handleEntityNotFound(_0x3b2a3e,null))[_0xf54e('0x33')](saveUpdates(_0x35b5a4['body'],null))[_0xf54e('0x33')](function(_0x1de6dd){if(_0x1de6dd){_0x205b47=_0x1de6dd;return db[_0xf54e('0x3b')][_0xf54e('0x52')]({'raw':!![]});}})['then'](function(_0x394862){if(_0x394862){var _0x4876b5=fs[_0xf54e('0x64')](path['join'](config['root'],_0xf54e('0x66')),_0xf54e('0x67'));var _0x1e2834=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config[_0xf54e('0x70')],_0xf54e('0x68')),_0xf54e('0x67'));var _0x8093bc=ejs['render'](_0x4876b5,{'trunks':_0x394862||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6b'),_0x8093bc);var _0x4ce10=ejs[_0xf54e('0x69')](_0x1e2834,{'trunks':_0x394862||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x4ce10);return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x32'),{'module':_0xf54e('0x71')});}return null;})[_0xf54e('0x33')](function(_0x11dec2){if(_0x11dec2){return _0x205b47;}})[_0xf54e('0x33')](respondWithResult(_0x3b2a3e,null))['catch'](handleError(_0x3b2a3e,null));};exports[_0xf54e('0x34')]=function(_0x1cfa09,_0x59acbc,_0x4a0614){var _0x85b108;return db[_0xf54e('0x3b')][_0xf54e('0x57')]({'where':{'id':_0x1cfa09[_0xf54e('0x55')]['id']}})[_0xf54e('0x33')](handleEntityNotFound(_0x59acbc,null))[_0xf54e('0x33')](removeEntity(_0x59acbc,null))[_0xf54e('0x33')](function(){return db[_0xf54e('0x3b')][_0xf54e('0x52')]({'raw':!![]});})['then'](function(_0x2bb31f){var _0x3c222a=fs[_0xf54e('0x64')](path['join'](config[_0xf54e('0x70')],'server/files/templates/trunk.ejs'),_0xf54e('0x67'));var _0x57bc6f=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config['root'],'server/files/templates/registry.ejs'),_0xf54e('0x67'));var _0x632240=ejs[_0xf54e('0x69')](_0x3c222a,{'trunks':_0x2bb31f});var _0x406261=ejs[_0xf54e('0x69')](_0x57bc6f,{'trunks':_0x2bb31f});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x632240);fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x406261);return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x34'),{'module':_0xf54e('0x71')});})[_0xf54e('0x24')](handleError(_0x59acbc,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 8167a66..7cc301b 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 _0x3b11=['exports','define','Trunk','tools_trunks','util','../../config/logger','api','moment','path','../../config/environment','./trunk.attributes'];(function(_0x57694b,_0x24f2c4){var _0x5ef378=function(_0x56b5e3){while(--_0x56b5e3){_0x57694b['push'](_0x57694b['shift']());}};_0x5ef378(++_0x24f2c4);}(_0x3b11,0x159));var _0x13b1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3b11[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x13b1('0x0'));var logger=require(_0x13b1('0x1'))(_0x13b1('0x2'));var moment=require(_0x13b1('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x13b1('0x4'));var rimraf=require('rimraf');var config=require(_0x13b1('0x5'));var attributes=require(_0x13b1('0x6'));module[_0x13b1('0x7')]=function(_0x24998b,_0x593a80){return _0x24998b[_0x13b1('0x8')](_0x13b1('0x9'),attributes,{'tableName':_0x13b1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4841=['api','moment','bluebird','request-promise','path','./trunk.attributes','exports','Trunk','tools_trunks','lodash','../../config/logger'];(function(_0x46a812,_0x48a7a6){var _0x52e57e=function(_0x1d3517){while(--_0x1d3517){_0x46a812['push'](_0x46a812['shift']());}};_0x52e57e(++_0x48a7a6);}(_0x4841,0x8d));var _0x1484=function(_0x456039,_0x589c80){_0x456039=_0x456039-0x0;var _0x11259a=_0x4841[_0x456039];return _0x11259a;};'use strict';var _=require(_0x1484('0x0'));var util=require('util');var logger=require(_0x1484('0x1'))(_0x1484('0x2'));var moment=require(_0x1484('0x3'));var BPromise=require(_0x1484('0x4'));var rp=require(_0x1484('0x5'));var fs=require('fs');var path=require(_0x1484('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1484('0x7'));module[_0x1484('0x8')]=function(_0x251568,_0x2fda4f){return _0x251568['define'](_0x1484('0x9'),attributes,{'tableName':_0x1484('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 26f7d1e..c3521df 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 _0x2ce8=['model','then','GetTrunk','ShowTrunk','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','info','Trunk,\x20%s,\x20%s','result','catch','Trunk','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x47a6a4,_0x30c996){var _0x30d371=function(_0x1cfac4){while(--_0x1cfac4){_0x47a6a4['push'](_0x47a6a4['shift']());}};_0x30d371(++_0x30c996);}(_0x2ce8,0x71));var _0x82ce=function(_0x163807,_0x558cfa){_0x163807=_0x163807-0x0;var _0x535b97=_0x2ce8[_0x163807];return _0x535b97;};'use strict';var _=require(_0x82ce('0x0'));var util=require(_0x82ce('0x1'));var moment=require(_0x82ce('0x2'));var BPromise=require(_0x82ce('0x3'));var rs=require(_0x82ce('0x4'));var fs=require('fs');var Redis=require(_0x82ce('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x82ce('0x6'))('rpc');var config=require(_0x82ce('0x7'));var jayson=require(_0x82ce('0x8'));var client=jayson[_0x82ce('0x9')][_0x82ce('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40015d,_0x5c0bfb,_0x11db5f){return new BPromise(function(_0x32b5bd,_0xb87a4){return client[_0x82ce('0xb')](_0x40015d,_0x11db5f)['then'](function(_0x2d6167){logger['info']('Trunk,\x20%s,\x20%s',_0x5c0bfb,_0x82ce('0xc'));logger[_0x82ce('0xd')](_0x82ce('0xe'),_0x5c0bfb,_0x82ce('0xc'),JSON[_0x82ce('0xf')](_0x2d6167));if(_0x2d6167[_0x82ce('0x10')]){if(_0x2d6167[_0x82ce('0x10')]['code']===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x5c0bfb,_0x2d6167[_0x82ce('0x10')][_0x82ce('0x11')]);return _0xb87a4(_0x2d6167['error'][_0x82ce('0x11')]);}logger[_0x82ce('0x10')]('Trunk,\x20%s,\x20%s',_0x5c0bfb,_0x2d6167[_0x82ce('0x10')][_0x82ce('0x11')]);return _0x32b5bd(_0x2d6167[_0x82ce('0x10')]['message']);}else{logger[_0x82ce('0x12')](_0x82ce('0x13'),_0x5c0bfb,_0x82ce('0xc'));_0x32b5bd(_0x2d6167[_0x82ce('0x14')][_0x82ce('0x11')]);}})[_0x82ce('0x15')](function(_0x1fdbcc){logger[_0x82ce('0x10')](_0x82ce('0x13'),_0x5c0bfb,_0x1fdbcc);_0xb87a4(_0x1fdbcc);});});}exports['GetTrunk']=function(_0x1a42a2){var _0x2f8c12=this;return new Promise(function(_0x49dcb1,_0x28d4a8){return db[_0x82ce('0x16')][_0x82ce('0x17')]({'raw':_0x1a42a2[_0x82ce('0x18')]?_0x1a42a2['options'][_0x82ce('0x19')]===undefined?!![]:![]:!![],'where':_0x1a42a2[_0x82ce('0x18')]?_0x1a42a2[_0x82ce('0x18')][_0x82ce('0x1a')]||null:null,'attributes':_0x1a42a2[_0x82ce('0x18')]?_0x1a42a2[_0x82ce('0x18')][_0x82ce('0x1b')]||null:null,'limit':_0x1a42a2[_0x82ce('0x18')]?_0x1a42a2[_0x82ce('0x18')][_0x82ce('0x1c')]||null:null,'include':_0x1a42a2[_0x82ce('0x18')]?_0x1a42a2[_0x82ce('0x18')][_0x82ce('0x1d')]?_[_0x82ce('0x1e')](_0x1a42a2['options'][_0x82ce('0x1d')],function(_0x21eb69){return{'model':db[_0x21eb69['model']],'as':_0x21eb69['as'],'attributes':_0x21eb69['attributes'],'include':_0x21eb69[_0x82ce('0x1d')]?_[_0x82ce('0x1e')](_0x21eb69['include'],function(_0x4ebe04){return{'model':db[_0x4ebe04[_0x82ce('0x1f')]],'as':_0x4ebe04['as'],'attributes':_0x4ebe04[_0x82ce('0x1b')],'include':_0x4ebe04[_0x82ce('0x1d')]?_[_0x82ce('0x1e')](_0x4ebe04['include'],function(_0x139bc9){return{'model':db[_0x139bc9['model']],'as':_0x139bc9['as'],'attributes':_0x139bc9['attributes']};}):[]};}):[]};}):[]:[]})[_0x82ce('0x20')](function(_0x4b043d){logger['info'](_0x82ce('0x21'),_0x1a42a2);logger['debug'](_0x82ce('0x21'),_0x1a42a2,JSON['stringify'](_0x4b043d));_0x49dcb1(_0x4b043d);})[_0x82ce('0x15')](function(_0x7d1e93){logger[_0x82ce('0x10')](_0x82ce('0x21'),_0x7d1e93[_0x82ce('0x11')],_0x1a42a2);_0x28d4a8(_0x2f8c12[_0x82ce('0x10')](0x1f4,_0x7d1e93[_0x82ce('0x11')]));});});};exports[_0x82ce('0x22')]=function(_0x3085c6){var _0x1874c5=this;return new Promise(function(_0x30b328,_0x463dbe){return db[_0x82ce('0x16')][_0x82ce('0x23')]({'raw':_0x3085c6['options']?_0x3085c6[_0x82ce('0x18')][_0x82ce('0x19')]===undefined?!![]:![]:!![],'where':_0x3085c6[_0x82ce('0x18')]?_0x3085c6[_0x82ce('0x18')][_0x82ce('0x1a')]||null:null,'attributes':_0x3085c6[_0x82ce('0x18')]?_0x3085c6[_0x82ce('0x18')][_0x82ce('0x1b')]||null:null,'include':_0x3085c6[_0x82ce('0x18')]?_0x3085c6['options'][_0x82ce('0x1d')]?_['map'](_0x3085c6['options'][_0x82ce('0x1d')],function(_0x31b07f){return{'model':db[_0x31b07f[_0x82ce('0x1f')]],'as':_0x31b07f['as'],'attributes':_0x31b07f['attributes'],'include':_0x31b07f[_0x82ce('0x1d')]?_[_0x82ce('0x1e')](_0x31b07f[_0x82ce('0x1d')],function(_0x162554){return{'model':db[_0x162554['model']],'as':_0x162554['as'],'attributes':_0x162554[_0x82ce('0x1b')],'include':_0x162554[_0x82ce('0x1d')]?_[_0x82ce('0x1e')](_0x162554[_0x82ce('0x1d')],function(_0xc276e3){return{'model':db[_0xc276e3[_0x82ce('0x1f')]],'as':_0xc276e3['as'],'attributes':_0xc276e3[_0x82ce('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x82ce('0x20')](function(_0x49aaa4){logger[_0x82ce('0x12')](_0x82ce('0x22'),_0x3085c6);logger[_0x82ce('0xd')]('ShowTrunk',_0x3085c6,JSON[_0x82ce('0xf')](_0x49aaa4));_0x30b328(_0x49aaa4);})['catch'](function(_0x2287d4){logger[_0x82ce('0x10')](_0x82ce('0x22'),_0x2287d4[_0x82ce('0x11')],_0x3085c6);_0x463dbe(_0x1874c5['error'](0x1f4,_0x2287d4[_0x82ce('0x11')]));});});}; \ No newline at end of file +var _0x0644=['util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','http','then','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','model','debug','stringify','ShowTrunk','map','lodash'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0644,0xc5));var _0x4064=function(_0x2421ae,_0x3717fd){_0x2421ae=_0x2421ae-0x0;var _0x5e31c6=_0x0644[_0x2421ae];return _0x5e31c6;};'use strict';var _=require(_0x4064('0x0'));var util=require(_0x4064('0x1'));var moment=require(_0x4064('0x2'));var BPromise=require(_0x4064('0x3'));var rs=require(_0x4064('0x4'));var fs=require('fs');var Redis=require(_0x4064('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4064('0x6'));var config=require(_0x4064('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4064('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1118ee,_0x2113f8,_0x5a39f4){return new BPromise(function(_0x197ced,_0x394dae){return client['request'](_0x1118ee,_0x5a39f4)[_0x4064('0x9')](function(_0x55ca70){logger[_0x4064('0xa')](_0x4064('0xb'),_0x2113f8,'request\x20sent');logger['debug'](_0x4064('0xc'),_0x2113f8,_0x4064('0xd'),JSON['stringify'](_0x55ca70));if(_0x55ca70[_0x4064('0xe')]){if(_0x55ca70['error'][_0x4064('0xf')]===0x1f4){logger['error'](_0x4064('0xb'),_0x2113f8,_0x55ca70['error'][_0x4064('0x10')]);return _0x394dae(_0x55ca70[_0x4064('0xe')][_0x4064('0x10')]);}logger[_0x4064('0xe')](_0x4064('0xb'),_0x2113f8,_0x55ca70[_0x4064('0xe')]['message']);return _0x197ced(_0x55ca70[_0x4064('0xe')][_0x4064('0x10')]);}else{logger[_0x4064('0xa')](_0x4064('0xb'),_0x2113f8,'request\x20sent');_0x197ced(_0x55ca70[_0x4064('0x11')][_0x4064('0x10')]);}})[_0x4064('0x12')](function(_0x3adc26){logger[_0x4064('0xe')](_0x4064('0xb'),_0x2113f8,_0x3adc26);_0x394dae(_0x3adc26);});});}exports[_0x4064('0x13')]=function(_0x41693c){var _0x27b816=this;return new Promise(function(_0x448552,_0x27d4cd){return db[_0x4064('0x14')][_0x4064('0x15')]({'raw':_0x41693c[_0x4064('0x16')]?_0x41693c[_0x4064('0x16')][_0x4064('0x17')]===undefined?!![]:![]:!![],'where':_0x41693c[_0x4064('0x16')]?_0x41693c[_0x4064('0x16')][_0x4064('0x18')]||null:null,'attributes':_0x41693c['options']?_0x41693c['options'][_0x4064('0x19')]||null:null,'limit':_0x41693c['options']?_0x41693c[_0x4064('0x16')][_0x4064('0x1a')]||null:null,'include':_0x41693c[_0x4064('0x16')]?_0x41693c[_0x4064('0x16')]['include']?_['map'](_0x41693c[_0x4064('0x16')][_0x4064('0x1b')],function(_0x517df0){return{'model':db[_0x517df0['model']],'as':_0x517df0['as'],'attributes':_0x517df0[_0x4064('0x19')],'include':_0x517df0[_0x4064('0x1b')]?_['map'](_0x517df0[_0x4064('0x1b')],function(_0x437b8f){return{'model':db[_0x437b8f[_0x4064('0x1c')]],'as':_0x437b8f['as'],'attributes':_0x437b8f[_0x4064('0x19')],'include':_0x437b8f['include']?_['map'](_0x437b8f['include'],function(_0xf0e54d){return{'model':db[_0xf0e54d[_0x4064('0x1c')]],'as':_0xf0e54d['as'],'attributes':_0xf0e54d[_0x4064('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4064('0x9')](function(_0x3276cb){logger['info'](_0x4064('0x13'),_0x41693c);logger[_0x4064('0x1d')]('GetTrunk',_0x41693c,JSON[_0x4064('0x1e')](_0x3276cb));_0x448552(_0x3276cb);})[_0x4064('0x12')](function(_0x58077d){logger['error'](_0x4064('0x13'),_0x58077d['message'],_0x41693c);_0x27d4cd(_0x27b816['error'](0x1f4,_0x58077d[_0x4064('0x10')]));});});};exports[_0x4064('0x1f')]=function(_0x4b3125){var _0x512146=this;return new Promise(function(_0xb99d16,_0x3a5de9){return db['Trunk']['find']({'raw':_0x4b3125[_0x4064('0x16')]?_0x4b3125[_0x4064('0x16')][_0x4064('0x17')]===undefined?!![]:![]:!![],'where':_0x4b3125[_0x4064('0x16')]?_0x4b3125[_0x4064('0x16')][_0x4064('0x18')]||null:null,'attributes':_0x4b3125[_0x4064('0x16')]?_0x4b3125[_0x4064('0x16')]['attributes']||null:null,'include':_0x4b3125[_0x4064('0x16')]?_0x4b3125[_0x4064('0x16')]['include']?_[_0x4064('0x20')](_0x4b3125['options'][_0x4064('0x1b')],function(_0x12bf9f){return{'model':db[_0x12bf9f[_0x4064('0x1c')]],'as':_0x12bf9f['as'],'attributes':_0x12bf9f[_0x4064('0x19')],'include':_0x12bf9f[_0x4064('0x1b')]?_[_0x4064('0x20')](_0x12bf9f[_0x4064('0x1b')],function(_0x35c2b4){return{'model':db[_0x35c2b4[_0x4064('0x1c')]],'as':_0x35c2b4['as'],'attributes':_0x35c2b4[_0x4064('0x19')],'include':_0x35c2b4[_0x4064('0x1b')]?_[_0x4064('0x20')](_0x35c2b4[_0x4064('0x1b')],function(_0x326b9c){return{'model':db[_0x326b9c[_0x4064('0x1c')]],'as':_0x326b9c['as'],'attributes':_0x326b9c[_0x4064('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x576fea){logger[_0x4064('0xa')]('ShowTrunk',_0x4b3125);logger[_0x4064('0x1d')](_0x4064('0x1f'),_0x4b3125,JSON[_0x4064('0x1e')](_0x576fea));_0xb99d16(_0x576fea);})[_0x4064('0x12')](function(_0x52217f){logger[_0x4064('0xe')](_0x4064('0x1f'),_0x52217f['message'],_0x4b3125);_0x3a5de9(_0x512146[_0x4064('0xe')](0x1f4,_0x52217f[_0x4064('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 6c48925..e8acb13 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 _0xdc6d=['put','/:id/password','changePassword','removeQueues','delete','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','get','index','/describe','isAuthenticated','describe','/whoami','whoami','getPresence','/:id','show','getAvatar','/:id/open_tabs','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','/:id/api_key','getApiKey','post','/:id/contacts','addContacts','/create_many','bulkCreate','addQueues','diskStorage','root','server/files/images/','%s-%s','now','originalname','single','file','addAvatar','/:id/login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','addSquareProjects'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0xdc6d,0xff));var _0xddc6=function(_0x137fd0,_0x3ef84e){_0x137fd0=_0x137fd0-0x0;var _0x3b8f87=_0xdc6d[_0x137fd0];return _0x3b8f87;};'use strict';var multer=require(_0xddc6('0x0'));var util=require('util');var path=require(_0xddc6('0x1'));var timeout=require(_0xddc6('0x2'));var express=require(_0xddc6('0x3'));var router=express[_0xddc6('0x4')]();var fs_extra=require(_0xddc6('0x5'));var auth=require(_0xddc6('0x6'));var interaction=require(_0xddc6('0x7'));var config=require('../../config/environment');var controller=require(_0xddc6('0x8'));router[_0xddc6('0x9')]('/',auth['isAuthenticated'](),controller[_0xddc6('0xa')]);router[_0xddc6('0x9')](_0xddc6('0xb'),auth[_0xddc6('0xc')](),controller[_0xddc6('0xd')]);router['get'](_0xddc6('0xe'),auth['isAuthenticated'](),controller[_0xddc6('0xf')]);router[_0xddc6('0x9')]('/presence',auth['isAuthenticated'](),controller[_0xddc6('0x10')]);router['get'](_0xddc6('0x11'),auth['isAuthenticated'](),controller[_0xddc6('0x12')]);router[_0xddc6('0x9')]('/:id/avatar',controller[_0xddc6('0x13')]);router[_0xddc6('0x9')](_0xddc6('0x14'),auth[_0xddc6('0xc')](),controller['getOpenTabs']);router['get']('/:id/contacts',auth[_0xddc6('0xc')](),controller[_0xddc6('0x15')]);router[_0xddc6('0x9')](_0xddc6('0x16'),auth[_0xddc6('0xc')](),controller[_0xddc6('0x17')]);router[_0xddc6('0x9')](_0xddc6('0x18'),auth['isAuthenticated'](),controller[_0xddc6('0x19')]);router['get'](_0xddc6('0x1a'),auth[_0xddc6('0xc')](),controller[_0xddc6('0x1b')]);router[_0xddc6('0x9')](_0xddc6('0x1c'),auth[_0xddc6('0xc')](),controller['getRecordings']);router['get']('/:id/screen_recordings',auth[_0xddc6('0xc')](),controller[_0xddc6('0x1d')]);router['get'](_0xddc6('0x1e'),auth[_0xddc6('0xc')](),controller[_0xddc6('0x1f')]);router[_0xddc6('0x9')](_0xddc6('0x20'),auth[_0xddc6('0xc')](),controller[_0xddc6('0x21')]);router['get'](_0xddc6('0x22'),auth['isAuthenticated'](),controller[_0xddc6('0x23')]);router[_0xddc6('0x9')](_0xddc6('0x24'),auth['isAuthenticated'](),controller[_0xddc6('0x25')]);router[_0xddc6('0x9')](_0xddc6('0x26'),auth['isAuthenticated'](),controller[_0xddc6('0x27')]);router[_0xddc6('0x9')](_0xddc6('0x28'),auth[_0xddc6('0xc')](),controller[_0xddc6('0x29')]);router[_0xddc6('0x9')](_0xddc6('0x2a'),auth[_0xddc6('0xc')](),controller[_0xddc6('0x2b')]);router[_0xddc6('0x9')](_0xddc6('0x2c'),auth[_0xddc6('0xc')](),controller[_0xddc6('0x2d')]);router['get']('/:id/agents',auth[_0xddc6('0xc')](),controller['getAgents']);router[_0xddc6('0x9')](_0xddc6('0x2e'),auth[_0xddc6('0xc')](),controller[_0xddc6('0x2f')]);router[_0xddc6('0x9')](_0xddc6('0x30'),auth[_0xddc6('0xc')](),controller['getFaxAccounts']);router[_0xddc6('0x9')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0xddc6('0x31')]);router['get'](_0xddc6('0x32'),auth[_0xddc6('0xc')](),controller['getOpenchannelAccounts']);router['get'](_0xddc6('0x33'),auth[_0xddc6('0xc')](),controller[_0xddc6('0x34')]);router['get']('/:id/chat_websites',auth[_0xddc6('0xc')](),controller[_0xddc6('0x35')]);router[_0xddc6('0x9')](_0xddc6('0x36'),auth[_0xddc6('0xc')](),controller[_0xddc6('0x37')]);router[_0xddc6('0x9')](_0xddc6('0x38'),auth['isAuthenticated'](),controller[_0xddc6('0x39')]);router[_0xddc6('0x9')](_0xddc6('0x3a'),auth[_0xddc6('0xc')](),controller['getScheduledCalls']);router['get'](_0xddc6('0x3b'),auth[_0xddc6('0xc')](),controller[_0xddc6('0x3c')]);router[_0xddc6('0x3d')](_0xddc6('0x3e'),auth[_0xddc6('0xc')](),controller[_0xddc6('0x3f')]);router['post']('/',auth[_0xddc6('0xc')](),controller['create']);router[_0xddc6('0x3d')](_0xddc6('0x40'),auth[_0xddc6('0xc')](),controller[_0xddc6('0x41')]);router[_0xddc6('0x3d')]('/:id/queues',auth[_0xddc6('0xc')](),controller[_0xddc6('0x42')]);var upload=multer({'storage':multer[_0xddc6('0x43')]({'destination':function(_0x33bcee,_0x5b194b,_0x467f8c){_0x467f8c(null,path['join'](config[_0xddc6('0x44')],_0xddc6('0x45')));},'filename':function(_0x23dc19,_0x49521d,_0x2e230b){_0x2e230b(null,util['format'](_0xddc6('0x46'),Date[_0xddc6('0x47')](),_0x49521d[_0xddc6('0x48')]));}})});router['post']('/:id/avatar',upload[_0xddc6('0x49')](_0xddc6('0x4a')),controller[_0xddc6('0x4b')]);router['post'](_0xddc6('0x4c'),auth[_0xddc6('0xc')](),controller['login']);router[_0xddc6('0x3d')](_0xddc6('0x4d'),auth['isAuthenticated'](),controller['logout']);router[_0xddc6('0x3d')](_0xddc6('0x4e'),auth[_0xddc6('0xc')](),controller[_0xddc6('0x4f')]);router[_0xddc6('0x3d')](_0xddc6('0x50'),auth[_0xddc6('0xc')](),controller[_0xddc6('0x51')]);router[_0xddc6('0x3d')](_0xddc6('0x2a'),auth[_0xddc6('0xc')](),controller[_0xddc6('0x52')]);router[_0xddc6('0x3d')]('/:id/chat_interactions',auth[_0xddc6('0xc')](),controller[_0xddc6('0x53')]);router[_0xddc6('0x3d')](_0xddc6('0x54'),auth[_0xddc6('0xc')](),controller['addMailInteractions']);router['post'](_0xddc6('0x55'),auth[_0xddc6('0xc')](),controller['addFaxInteractions']);router[_0xddc6('0x3d')]('/:id/sms_interactions',auth[_0xddc6('0xc')](),controller[_0xddc6('0x56')]);router[_0xddc6('0x3d')](_0xddc6('0x57'),auth['isAuthenticated'](),controller[_0xddc6('0x58')]);router[_0xddc6('0x3d')]('/:id/whatsapp_interactions',auth[_0xddc6('0xc')](),controller[_0xddc6('0x59')]);router['post'](_0xddc6('0x30'),auth['isAuthenticated'](),controller[_0xddc6('0x5a')]);router[_0xddc6('0x3d')](_0xddc6('0x5b'),auth['isAuthenticated'](),controller['addMailAccounts']);router[_0xddc6('0x3d')](_0xddc6('0x32'),auth[_0xddc6('0xc')](),controller['addOpenchannelAccounts']);router['post'](_0xddc6('0x33'),auth['isAuthenticated'](),controller[_0xddc6('0x5c')]);router['post'](_0xddc6('0x5d'),auth['isAuthenticated'](),controller[_0xddc6('0x5e')]);router[_0xddc6('0x3d')]('/:id/whatsapp_accounts',auth[_0xddc6('0xc')](),controller['addWhatsappAccounts']);router[_0xddc6('0x3d')](_0xddc6('0x38'),auth[_0xddc6('0xc')](),controller[_0xddc6('0x5f')]);router['post']('/:id/api_key',auth[_0xddc6('0xc')](),controller['createApiKey']);router[_0xddc6('0x60')](_0xddc6('0x11'),auth['isAuthenticated'](),controller['update']);router[_0xddc6('0x60')](_0xddc6('0x61'),auth[_0xddc6('0xc')](),controller[_0xddc6('0x62')]);router['delete']('/:id/queues',auth[_0xddc6('0xc')](),controller[_0xddc6('0x63')]);router[_0xddc6('0x64')](_0xddc6('0x2a'),auth[_0xddc6('0xc')](),controller[_0xddc6('0x65')]);router['delete'](_0xddc6('0x11'),auth[_0xddc6('0xc')](),controller[_0xddc6('0x66')]);router[_0xddc6('0x64')](_0xddc6('0x67'),auth['isAuthenticated'](),controller[_0xddc6('0x68')]);router[_0xddc6('0x64')](_0xddc6('0x54'),auth['isAuthenticated'](),controller[_0xddc6('0x69')]);router[_0xddc6('0x64')](_0xddc6('0x55'),auth[_0xddc6('0xc')](),controller[_0xddc6('0x6a')]);router['delete'](_0xddc6('0x6b'),auth[_0xddc6('0xc')](),controller[_0xddc6('0x6c')]);router[_0xddc6('0x64')](_0xddc6('0x57'),auth[_0xddc6('0xc')](),controller[_0xddc6('0x6d')]);router[_0xddc6('0x64')]('/:id/whatsapp_interactions',auth[_0xddc6('0xc')](),controller[_0xddc6('0x6e')]);router['delete']('/:id/fax_accounts',auth[_0xddc6('0xc')](),controller['removeFaxAccounts']);router[_0xddc6('0x64')](_0xddc6('0x5b'),auth[_0xddc6('0xc')](),controller['removeMailAccounts']);router[_0xddc6('0x64')](_0xddc6('0x32'),auth[_0xddc6('0xc')](),controller[_0xddc6('0x6f')]);router[_0xddc6('0x64')]('/:id/sms_accounts',auth[_0xddc6('0xc')](),controller[_0xddc6('0x70')]);router[_0xddc6('0x64')]('/:id/chat_websites',auth[_0xddc6('0xc')](),controller[_0xddc6('0x71')]);router[_0xddc6('0x64')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller['removeWhatsappAccounts']);router[_0xddc6('0x64')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0xddc6('0x72')]);router[_0xddc6('0x64')](_0xddc6('0x3b'),auth[_0xddc6('0xc')](),controller[_0xddc6('0x73')]);module[_0xddc6('0x74')]=router; \ No newline at end of file +var _0xdf73=['/:id/contacts','create','/create_many','bulkCreate','/:id/queues','diskStorage','root','server/files/images/','format','%s-%s','now','originalname','single','file','login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','put','/:id/password','removeQueues','destroy','/:id/mail_interactions','removeMailInteractions','delete','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','/:id/sms_accounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','whoami','/presence','getPresence','/:id','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post'];(function(_0x18c20a,_0x4f7002){var _0x1a9ebd=function(_0x136687){while(--_0x136687){_0x18c20a['push'](_0x18c20a['shift']());}};_0x1a9ebd(++_0x4f7002);}(_0xdf73,0x12a));var _0x3df7=function(_0x3f7ab6,_0x2c3654){_0x3f7ab6=_0x3f7ab6-0x0;var _0x2c8384=_0xdf73[_0x3f7ab6];return _0x2c8384;};'use strict';var multer=require(_0x3df7('0x0'));var util=require('util');var path=require(_0x3df7('0x1'));var timeout=require(_0x3df7('0x2'));var express=require(_0x3df7('0x3'));var router=express['Router']();var fs_extra=require(_0x3df7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3df7('0x5'));var config=require(_0x3df7('0x6'));var controller=require(_0x3df7('0x7'));router[_0x3df7('0x8')]('/',auth[_0x3df7('0x9')](),controller[_0x3df7('0xa')]);router['get'](_0x3df7('0xb'),auth[_0x3df7('0x9')](),controller[_0x3df7('0xc')]);router[_0x3df7('0x8')]('/whoami',auth[_0x3df7('0x9')](),controller[_0x3df7('0xd')]);router[_0x3df7('0x8')](_0x3df7('0xe'),auth['isAuthenticated'](),controller[_0x3df7('0xf')]);router[_0x3df7('0x8')](_0x3df7('0x10'),auth[_0x3df7('0x9')](),controller['show']);router['get'](_0x3df7('0x11'),controller[_0x3df7('0x12')]);router[_0x3df7('0x8')](_0x3df7('0x13'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x14')]);router['get']('/:id/contacts',auth[_0x3df7('0x9')](),controller['getContacts']);router[_0x3df7('0x8')]('/:id/queues',auth['isAuthenticated'](),controller['getQueues']);router['get'](_0x3df7('0x15'),auth[_0x3df7('0x9')](),controller['getVoiceQueuesRt']);router[_0x3df7('0x8')](_0x3df7('0x16'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x17')]);router[_0x3df7('0x8')](_0x3df7('0x18'),auth['isAuthenticated'](),controller[_0x3df7('0x19')]);router[_0x3df7('0x8')]('/:id/screen_recordings',auth[_0x3df7('0x9')](),controller[_0x3df7('0x1a')]);router[_0x3df7('0x8')](_0x3df7('0x1b'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x1c')]);router['get'](_0x3df7('0x1d'),auth['isAuthenticated'](),controller[_0x3df7('0x1e')]);router[_0x3df7('0x8')](_0x3df7('0x1f'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x20')]);router[_0x3df7('0x8')](_0x3df7('0x21'),auth['isAuthenticated'](),controller['getSmsInteractions']);router[_0x3df7('0x8')](_0x3df7('0x22'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x23')]);router['get'](_0x3df7('0x24'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x25')]);router[_0x3df7('0x8')](_0x3df7('0x26'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x27')]);router['get'](_0x3df7('0x28'),auth[_0x3df7('0x9')](),controller['getLists']);router[_0x3df7('0x8')](_0x3df7('0x29'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x2a')]);router[_0x3df7('0x8')](_0x3df7('0x2b'),auth['isAuthenticated'](),controller[_0x3df7('0x2c')]);router[_0x3df7('0x8')](_0x3df7('0x2d'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x2e')]);router[_0x3df7('0x8')](_0x3df7('0x2f'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x30')]);router['get'](_0x3df7('0x31'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x32')]);router[_0x3df7('0x8')]('/:id/sms_accounts',auth[_0x3df7('0x9')](),controller[_0x3df7('0x33')]);router[_0x3df7('0x8')](_0x3df7('0x34'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x35')]);router['get'](_0x3df7('0x36'),auth['isAuthenticated'](),controller[_0x3df7('0x37')]);router['get'](_0x3df7('0x38'),auth[_0x3df7('0x9')](),controller['getSquareProjects']);router['get'](_0x3df7('0x39'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x3a')]);router[_0x3df7('0x8')](_0x3df7('0x3b'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x3c')]);router[_0x3df7('0x3d')](_0x3df7('0x3e'),auth[_0x3df7('0x9')](),controller['addContacts']);router['post']('/',auth[_0x3df7('0x9')](),controller[_0x3df7('0x3f')]);router[_0x3df7('0x3d')](_0x3df7('0x40'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x41')]);router['post'](_0x3df7('0x42'),auth[_0x3df7('0x9')](),controller['addQueues']);var upload=multer({'storage':multer[_0x3df7('0x43')]({'destination':function(_0x35cb5d,_0x506f2f,_0x10159d){_0x10159d(null,path['join'](config[_0x3df7('0x44')],_0x3df7('0x45')));},'filename':function(_0xa436fb,_0x3ae1fe,_0x16d24d){_0x16d24d(null,util[_0x3df7('0x46')](_0x3df7('0x47'),Date[_0x3df7('0x48')](),_0x3ae1fe[_0x3df7('0x49')]));}})});router[_0x3df7('0x3d')](_0x3df7('0x11'),upload[_0x3df7('0x4a')](_0x3df7('0x4b')),controller['addAvatar']);router[_0x3df7('0x3d')]('/:id/login',auth[_0x3df7('0x9')](),controller[_0x3df7('0x4c')]);router[_0x3df7('0x3d')](_0x3df7('0x4d'),auth[_0x3df7('0x9')](),controller['logout']);router['post'](_0x3df7('0x4e'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x4f')]);router[_0x3df7('0x3d')](_0x3df7('0x50'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x51')]);router[_0x3df7('0x3d')](_0x3df7('0x26'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x52')]);router[_0x3df7('0x3d')](_0x3df7('0x53'),auth[_0x3df7('0x9')](),controller['addChatInteractions']);router[_0x3df7('0x3d')]('/:id/mail_interactions',auth[_0x3df7('0x9')](),controller[_0x3df7('0x54')]);router[_0x3df7('0x3d')](_0x3df7('0x55'),auth['isAuthenticated'](),controller[_0x3df7('0x56')]);router[_0x3df7('0x3d')](_0x3df7('0x57'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x58')]);router[_0x3df7('0x3d')](_0x3df7('0x59'),auth[_0x3df7('0x9')](),controller['addOpenchannelInteractions']);router['post'](_0x3df7('0x5a'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x5b')]);router['post'](_0x3df7('0x2d'),auth['isAuthenticated'](),controller[_0x3df7('0x5c')]);router[_0x3df7('0x3d')](_0x3df7('0x2f'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x5d')]);router[_0x3df7('0x3d')](_0x3df7('0x31'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x5e')]);router[_0x3df7('0x3d')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x3df7('0x5f')]);router[_0x3df7('0x3d')](_0x3df7('0x34'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x60')]);router['post'](_0x3df7('0x36'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x61')]);router[_0x3df7('0x3d')](_0x3df7('0x38'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x62')]);router['post']('/:id/api_key',auth[_0x3df7('0x9')](),controller[_0x3df7('0x63')]);router[_0x3df7('0x64')](_0x3df7('0x10'),auth[_0x3df7('0x9')](),controller['update']);router[_0x3df7('0x64')](_0x3df7('0x65'),auth[_0x3df7('0x9')](),controller['changePassword']);router['delete'](_0x3df7('0x42'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x66')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x3df7('0x10'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x67')]);router['delete'](_0x3df7('0x53'),auth[_0x3df7('0x9')](),controller['removeChatInteractions']);router['delete'](_0x3df7('0x68'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x69')]);router[_0x3df7('0x6a')](_0x3df7('0x55'),auth[_0x3df7('0x9')](),controller['removeFaxInteractions']);router['delete']('/:id/sms_interactions',auth[_0x3df7('0x9')](),controller[_0x3df7('0x6b')]);router[_0x3df7('0x6a')](_0x3df7('0x59'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x6c')]);router['delete']('/:id/whatsapp_interactions',auth[_0x3df7('0x9')](),controller[_0x3df7('0x6d')]);router[_0x3df7('0x6a')](_0x3df7('0x2d'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x6e')]);router[_0x3df7('0x6a')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x3df7('0x6f')]);router[_0x3df7('0x6a')](_0x3df7('0x31'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x70')]);router['delete'](_0x3df7('0x71'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x72')]);router['delete'](_0x3df7('0x34'),auth['isAuthenticated'](),controller[_0x3df7('0x73')]);router[_0x3df7('0x6a')](_0x3df7('0x36'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x74')]);router[_0x3df7('0x6a')](_0x3df7('0x38'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x75')]);router[_0x3df7('0x6a')](_0x3df7('0x3b'),auth[_0x3df7('0x9')](),controller[_0x3df7('0x76')]);module[_0x3df7('0x77')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 2be93f8..161687e 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 _0xafd1=['uac','uas','fingerprint','certificate','actpass','nonat','TEXT','get','isArray','encryption','force_avp','dtlsenable','dtlsverify','dtlssetup','rtcp_mux','avpf','icesupport','dtlscertfile','dtlsprivatekey','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM','admin','user','agent','telephone','INTEGER','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','yes','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','accept','refuse','originate'];(function(_0x5c94df,_0x30b651){var _0xc61894=function(_0x4c3ccb){while(--_0x4c3ccb){_0x5c94df['push'](_0x5c94df['shift']());}};_0xc61894(++_0x30b651);}(_0xafd1,0x1e3));var _0x1afd=function(_0x46ec32,_0x1e842f){_0x46ec32=_0x46ec32-0x0;var _0x338f60=_0xafd1[_0x46ec32];return _0x338f60;};'use strict';var Sequelize=require(_0x1afd('0x0'));var moment=require(_0x1afd('0x1'));var util=require(_0x1afd('0x2'));var _=require(_0x1afd('0x3'));module[_0x1afd('0x4')]={'name':{'type':Sequelize[_0x1afd('0x5')],'allowNull':![],'unique':_0x1afd('0x6'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x1495fd){this['setDataValue'](_0x1afd('0x6'),_0x1495fd);this[_0x1afd('0x7')](_0x1afd('0x8'),_0x1495fd);},'comment':_0x1afd('0x9')},'fullname':{'type':Sequelize[_0x1afd('0x5')],'allowNull':![],'set':function(_0x7765a0){this['setDataValue'](_0x1afd('0xa'),_0x7765a0);this[_0x1afd('0x7')](_0x1afd('0xb'),util[_0x1afd('0xc')](_0x1afd('0xd'),_0x7765a0,this[_0x1afd('0xe')](_0x1afd('0xf'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x1afd('0x5')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x3cb261){if(_0x3cb261){this[_0x1afd('0x7')](_0x1afd('0x10'),_0x3cb261['toLowerCase']());}}},'role':{'type':Sequelize[_0x1afd('0x11')](_0x1afd('0x12'),_0x1afd('0x13'),_0x1afd('0x14'),_0x1afd('0x15')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x1afd('0x5')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x1afd('0x16')](0xb),'allowNull':![],'unique':_0x1afd('0xf'),'set':function(_0x23590a){this['setDataValue']('internal',_0x23590a);this[_0x1afd('0x7')](_0x1afd('0x17'),_0x23590a);this[_0x1afd('0x7')](_0x1afd('0xb'),util['format'](_0x1afd('0xd'),this[_0x1afd('0xe')](_0x1afd('0xa')),_0x23590a));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x1afd('0x5')]},'mobile':{'type':Sequelize[_0x1afd('0x5')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x1afd('0x5')]},'city':{'type':Sequelize[_0x1afd('0x5')]},'country':{'type':Sequelize[_0x1afd('0x5')]},'online':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x1afd('0x19')]},'voicePause':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x1afd('0x5')],'defaultValue':_0x1afd('0x1a')},'lastPauseAt':{'type':Sequelize[_0x1afd('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[_0x1afd('0x16')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x1afd('0x16')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x1afd('0x16')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x1afd('0x16')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':![]},'description':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'host':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'port':{'type':Sequelize[_0x1afd('0x16')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x1afd('0x16')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x1afd('0x11')](_0x1afd('0x1b'),'user',_0x1afd('0x1c')),'allowNull':!![],'defaultValue':_0x1afd('0x1b')},'context':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![],'defaultValue':_0x1afd('0x1d')},'callingpres':{'type':Sequelize[_0x1afd('0x11')](_0x1afd('0x1e'),_0x1afd('0x1f'),_0x1afd('0x20'),_0x1afd('0x21'),_0x1afd('0x22'),_0x1afd('0x23'),'PROHIB_FAILED_SCREEN',_0x1afd('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'permit':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'secret':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'transport':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![],'defaultValue':_0x1afd('0x25'),'set':function(_0x316e6d){this[_0x1afd('0x7')](_0x1afd('0x26'),_0x316e6d?_0x316e6d[_0x1afd('0x27')](','):null);},'get':function(){return this[_0x1afd('0xe')](_0x1afd('0x26'))?this[_0x1afd('0xe')](_0x1afd('0x26'))['split'](','):null;},'comment':_0x1afd('0x28')},'dtmfmode':{'type':Sequelize[_0x1afd('0x11')](_0x1afd('0x29'),_0x1afd('0x2a'),'shortinfo',_0x1afd('0x2b'),_0x1afd('0x2c')),'allowNull':!![],'defaultValue':_0x1afd('0x29')},'directmedia':{'type':Sequelize['ENUM'](_0x1afd('0x2d'),'no','nonat',_0x1afd('0x2e'),_0x1afd('0x2f')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1afd('0x11')](_0x1afd('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'nat':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![],'defaultValue':_0x1afd('0x30'),'set':function(_0x1d00ab){this['setDataValue'](_0x1afd('0x31'),_0x1d00ab?_0x1d00ab[_0x1afd('0x27')](','):null);},'get':function(){return this[_0x1afd('0xe')]('nat')?this[_0x1afd('0xe')](_0x1afd('0x31'))['split'](','):null;},'comment':_0x1afd('0x32')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x1afd('0x5')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x1afd('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x1afd('0x5')],'allowNull':![],'defaultValue':_0x1afd('0x33')},'allow':{'type':Sequelize[_0x1afd('0x5')],'allowNull':![],'defaultValue':_0x1afd('0x34'),'set':function(_0x298df4){this[_0x1afd('0x7')](_0x1afd('0x35'),_0x298df4?_0x298df4[_0x1afd('0x27')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x1afd('0xe')](_0x1afd('0x35'))?this[_0x1afd('0xe')]('allow')['split'](';'):null;},'comment':_0x1afd('0x36')},'autoframing':{'type':Sequelize[_0x1afd('0x11')](_0x1afd('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![],'set':function(_0x8caf7c){this[_0x1afd('0x7')](_0x1afd('0x37'),_0x8caf7c?_0x8caf7c[_0x1afd('0x27')](','):null);},'get':function(){return this['getDataValue'](_0x1afd('0x37'))?this['getDataValue']('insecure')[_0x1afd('0x38')](','):null;},'comment':_0x1afd('0x39')},'trustrpid':{'type':Sequelize[_0x1afd('0x11')](_0x1afd('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1afd('0x11')](_0x1afd('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x1afd('0x11')](_0x1afd('0x2d'),'no',_0x1afd('0x3a')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x1afd('0x11')](_0x1afd('0x2d'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x1afd('0x11')](_0x1afd('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x1afd('0x16')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x1afd('0x11')](_0x1afd('0x2d'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x1afd('0x11')](_0x1afd('0x2d'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x1afd('0x11')](_0x1afd('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x1afd('0x11')](_0x1afd('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x1afd('0x11')](_0x1afd('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x1afd('0x11')]('yes','no',_0x1afd('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1afd('0x16')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x1afd('0x11')](_0x1afd('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x1afd('0x11')](_0x1afd('0x3c'),_0x1afd('0x3d'),_0x1afd('0x3e')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x1afd('0x16')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x1afd('0x16')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x1afd('0x11')](_0x1afd('0x3f'),_0x1afd('0x40')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x1afd('0x2d'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x1afd('0x16')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x1afd('0x16')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x1afd('0x16')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x1afd('0x16')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x1afd('0x16')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x1afd('0x16')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x1afd('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x1afd('0x2d'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x1afd('0x11')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x1afd('0x2d'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x1afd('0x11')](_0x1afd('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x1afd('0x2d'),'no',_0x1afd('0x41'),_0x1afd('0x42')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x1afd('0x16')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM']('active','passive',_0x1afd('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x1afd('0x11')](_0x1afd('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x1afd('0x11')](_0x1afd('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x1afd('0x11')](_0x1afd('0x2d'),'no',_0x1afd('0x44'),_0x1afd('0x2e'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x1afd('0x19')]},'passwordResetAt':{'type':Sequelize[_0x1afd('0x19')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x1afd('0x45')]},'showWebBar':{'type':Sequelize[_0x1afd('0x16')],'defaultValue':0x0,'set':function(_0x2b9f30){this[_0x1afd('0x7')]('showWebBar',_0x2b9f30);var _0x43a5c0=this[_0x1afd('0x46')]({'plain':!![]});switch(_0x2b9f30){case 0x0:case 0x1:var _0x5a957f=_0x43a5c0[_0x1afd('0x26')]?_[_0x1afd('0x47')](_0x43a5c0[_0x1afd('0x26')])?_0x43a5c0[_0x1afd('0x26')]['join']():_0x43a5c0['transport']:'udp';if(_0x5a957f==='wss'){_0x5a957f=_0x1afd('0x25');}this[_0x1afd('0x7')](_0x1afd('0x26'),_0x5a957f);this[_0x1afd('0x7')](_0x1afd('0x48'),'no');this[_0x1afd('0x7')]('avpf',null);this[_0x1afd('0x7')](_0x1afd('0x49'),null);this[_0x1afd('0x7')]('icesupport',null);this['setDataValue'](_0x1afd('0x4a'),null);this[_0x1afd('0x7')](_0x1afd('0x4b'),null);this[_0x1afd('0x7')](_0x1afd('0x4c'),null);this[_0x1afd('0x7')]('dtlscertfile',null);this[_0x1afd('0x7')]('dtlsprivatekey',null);this[_0x1afd('0x7')](_0x1afd('0x4d'),'no');break;case 0x2:this[_0x1afd('0x7')](_0x1afd('0x26'),'wss');this[_0x1afd('0x7')](_0x1afd('0x48'),_0x1afd('0x2d'));this['setDataValue'](_0x1afd('0x4e'),_0x1afd('0x2d'));this[_0x1afd('0x7')](_0x1afd('0x49'),'yes');this[_0x1afd('0x7')](_0x1afd('0x4f'),_0x1afd('0x2d'));this[_0x1afd('0x7')](_0x1afd('0x4a'),_0x1afd('0x2d'));this[_0x1afd('0x7')](_0x1afd('0x4b'),'no');this[_0x1afd('0x7')](_0x1afd('0x4c'),_0x1afd('0x43'));this[_0x1afd('0x7')]('dtlscertfile',_0x43a5c0[_0x1afd('0x50')]||'/etc/pki/tls/certs/motion.crt');this['setDataValue'](_0x1afd('0x51'),_0x43a5c0[_0x1afd('0x51')]||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0x1afd('0x4d'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x1afd('0x45')],'set':function(_0x2927f5){this['setDataValue'](_0x1afd('0x52'),_0x2927f5?_0x2927f5[_0x1afd('0x27')](','):[]);},'get':function(){return this['getDataValue'](_0x1afd('0x52'))?_[_0x1afd('0x53')](this[_0x1afd('0xe')](_0x1afd('0x52'))[_0x1afd('0x38')](','),function(_0x425095){return parseInt(_0x425095,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x1afd('0x5')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x1afd('0x5')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x1afd('0x16')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x1afd('0x16')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x1afd('0x11')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x1afd('0x5')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x1afd('0x54')],'get':function(){return this[_0x1afd('0xe')]('phoneBarEnableScreenRecordingByAgent')?this['getDataValue'](_0x1afd('0x55')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':![]},'interface':{'type':Sequelize[_0x1afd('0x5')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x1afd('0x5')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':![],'set':function(_0x16b2ad){if(typeof _0x16b2ad==='string'){var _0x4a9afa=_0x16b2ad==='1'?!![]:_0x16b2ad==='0'?![]:_0x16b2ad===_0x1afd('0x56')?!![]:_0x16b2ad==='false'?![]:![];this['setDataValue'](_0x1afd('0x57'),_0x4a9afa);}else{this[_0x1afd('0x7')](_0x1afd('0x57'),_0x16b2ad);}}},'blocked':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':![],'set':function(_0x3033f7){this[_0x1afd('0x7')](_0x1afd('0x58'),_0x3033f7);if(_0x3033f7===!![]){this['setDataValue'](_0x1afd('0x59'),moment());this[_0x1afd('0x7')](_0x1afd('0x5a'),0x0);}else{this[_0x1afd('0x7')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x1afd('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x1afd('0x16')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x1afd('0x16')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x1afd('0x18')],'defaultValue':![]}}; \ No newline at end of file +var _0x740b=['DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','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','nonat','update','outgoing','yes','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','refuse','originate','uac','uas','fingerprint','certificate','active','actpass','TEXT','showWebBar','get','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','sequelize','moment','lodash','exports','name','setDataValue','The\x20name\x20of\x20the\x20user','STRING','fullname','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM','admin','user','telephone','local','INTEGER','accountcode','callerid','format','BOOLEAN'];(function(_0x3ba4dd,_0x30ad87){var _0x3e1ac8=function(_0x4ebff4){while(--_0x4ebff4){_0x3ba4dd['push'](_0x3ba4dd['shift']());}};_0x3e1ac8(++_0x30ad87);}(_0x740b,0x155));var _0xb740=function(_0x41b134,_0x840b59){_0x41b134=_0x41b134-0x0;var _0xabcba3=_0x740b[_0x41b134];return _0xabcba3;};'use strict';var Sequelize=require(_0xb740('0x0'));var moment=require(_0xb740('0x1'));var util=require('util');var _=require(_0xb740('0x2'));module[_0xb740('0x3')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb740('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2a803d){this[_0xb740('0x5')](_0xb740('0x4'),_0x2a803d);this[_0xb740('0x5')]('defaultuser',_0x2a803d);},'comment':_0xb740('0x6')},'fullname':{'type':Sequelize[_0xb740('0x7')],'allowNull':![],'set':function(_0x19c4ba){this['setDataValue'](_0xb740('0x8'),_0x19c4ba);this[_0xb740('0x5')]('callerid',util['format'](_0xb740('0x9'),_0x19c4ba,this[_0xb740('0xa')](_0xb740('0xb'))));}},'alias':{'type':Sequelize[_0xb740('0x7')]},'email':{'type':Sequelize[_0xb740('0x7')],'allowNull':![],'unique':_0xb740('0xc'),'validate':{'isEmail':!![]},'set':function(_0x4fb9d1){if(_0x4fb9d1){this[_0xb740('0x5')]('email',_0x4fb9d1['toLowerCase']());}}},'role':{'type':Sequelize[_0xb740('0xd')](_0xb740('0xe'),_0xb740('0xf'),'agent',_0xb740('0x10')),'allowNull':![]},'password':{'type':Sequelize[_0xb740('0x7')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0xb740('0x11')},'internal':{'type':Sequelize[_0xb740('0x12')](0xb),'allowNull':![],'unique':_0xb740('0xb'),'set':function(_0xb00851){this['setDataValue']('internal',_0xb00851);this[_0xb740('0x5')](_0xb740('0x13'),_0xb00851);this['setDataValue'](_0xb740('0x14'),util[_0xb740('0x15')]('\x22%s\x22\x20<%s>',this[_0xb740('0xa')]('fullname'),_0xb00851));}},'salt':{'type':Sequelize[_0xb740('0x7')]},'phone':{'type':Sequelize[_0xb740('0x7')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0xb740('0x7')]},'zipcode':{'type':Sequelize[_0xb740('0x7')]},'userpic':{'type':Sequelize[_0xb740('0x7')]},'city':{'type':Sequelize[_0xb740('0x7')]},'country':{'type':Sequelize[_0xb740('0x7')]},'online':{'type':Sequelize[_0xb740('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xb740('0x17')]},'voicePause':{'type':Sequelize[_0xb740('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xb740('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xb740('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xb740('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xb740('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xb740('0x7')],'defaultValue':_0xb740('0x18')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xb740('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xb740('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xb740('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xb740('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xb740('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xb740('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xb740('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xb740('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'host':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![],'defaultValue':_0xb740('0x19')},'ipaddr':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'port':{'type':Sequelize[_0xb740('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xb740('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xb740('0xd')](_0xb740('0x1a'),_0xb740('0xf'),_0xb740('0x1b')),'allowNull':!![],'defaultValue':_0xb740('0x1a')},'context':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![],'defaultValue':_0xb740('0x1c')},'callingpres':{'type':Sequelize[_0xb740('0xd')](_0xb740('0x1d'),_0xb740('0x1e'),'ALLOWED_FAILED_SCREEN',_0xb740('0x1f'),'PROHIB_NOT_SCREENED',_0xb740('0x20'),_0xb740('0x21'),_0xb740('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'transport':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![],'defaultValue':_0xb740('0x23'),'set':function(_0x324651){this['setDataValue'](_0xb740('0x24'),_0x324651?_0x324651[_0xb740('0x25')](','):null);},'get':function(){return this[_0xb740('0xa')](_0xb740('0x24'))?this[_0xb740('0xa')](_0xb740('0x24'))[_0xb740('0x26')](','):null;},'comment':_0xb740('0x27')},'dtmfmode':{'type':Sequelize['ENUM'](_0xb740('0x28'),_0xb740('0x29'),_0xb740('0x2a'),_0xb740('0x2b'),'auto'),'allowNull':!![],'defaultValue':_0xb740('0x28')},'directmedia':{'type':Sequelize[_0xb740('0xd')]('yes','no',_0xb740('0x2c'),_0xb740('0x2d'),_0xb740('0x2e')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xb740('0xd')](_0xb740('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x583da3){this[_0xb740('0x5')](_0xb740('0x30'),_0x583da3?_0x583da3[_0xb740('0x25')](','):null);},'get':function(){return this['getDataValue'](_0xb740('0x30'))?this['getDataValue'](_0xb740('0x30'))[_0xb740('0x26')](','):null;},'comment':_0xb740('0x31')},'callgroup':{'type':Sequelize[_0xb740('0x7')]},'namedcallgroup':{'type':Sequelize[_0xb740('0x7')]},'pickupgroup':{'type':Sequelize[_0xb740('0x7')]},'namedpickupgroup':{'type':Sequelize[_0xb740('0x7')]},'language':{'type':Sequelize[_0xb740('0x7')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xb740('0x7')]},'disallow':{'type':Sequelize[_0xb740('0x7')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0xb740('0x7')],'allowNull':![],'defaultValue':_0xb740('0x32'),'set':function(_0x403776){this[_0xb740('0x5')]('allow',_0x403776?_0x403776[_0xb740('0x25')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xb740('0xa')](_0xb740('0x33'))?this['getDataValue'](_0xb740('0x33'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0xb740('0x2f'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x3faee7){this[_0xb740('0x5')](_0xb740('0x34'),_0x3faee7?_0x3faee7[_0xb740('0x25')](','):null);},'get':function(){return this[_0xb740('0xa')]('insecure')?this[_0xb740('0xa')](_0xb740('0x34'))[_0xb740('0x26')](','):null;},'comment':_0xb740('0x35')},'trustrpid':{'type':Sequelize['ENUM'](_0xb740('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xb740('0xd')](_0xb740('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xb740('0xd')]('yes','no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xb740('0xd')](_0xb740('0x2f'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xb740('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xb740('0x36')},'amaflags':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0xb740('0x2f'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xb740('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xb740('0xd')](_0xb740('0x2f'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xb740('0xd')](_0xb740('0x2f'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'template':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xb740('0xd')](_0xb740('0x2f'),'no',_0xb740('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xb740('0xd')](_0xb740('0x2f'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xb740('0xd')]('accept',_0xb740('0x38'),_0xb740('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xb740('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xb740('0xd')](_0xb740('0x3a'),_0xb740('0x3b')),'allowNull':!![],'defaultValue':_0xb740('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xb740('0xd')](_0xb740('0x2f'),'no'),'allowNull':!![],'defaultValue':_0xb740('0x2f')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xb740('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xb740('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xb740('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xb740('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xb740('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xb740('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xb740('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xb740('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0xb740('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xb740('0xd')](_0xb740('0x2f'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xb740('0xd')](_0xb740('0x2f'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xb740('0xd')](_0xb740('0x2f'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0xb740('0x3c'),_0xb740('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xb740('0xd')](_0xb740('0x3e'),'passive',_0xb740('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0xb740('0x2f'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xb740('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xb740('0xd')](_0xb740('0x2f'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xb740('0xd')](_0xb740('0x2f'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xb740('0xd')](_0xb740('0x2f'),'no',_0xb740('0x2c'),_0xb740('0x2d'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xb740('0x7')]},'resetPasswordExpires':{'type':Sequelize[_0xb740('0x17')]},'passwordResetAt':{'type':Sequelize[_0xb740('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xb740('0x40')]},'showWebBar':{'type':Sequelize[_0xb740('0x12')],'defaultValue':0x0,'set':function(_0x25f49c){this[_0xb740('0x5')](_0xb740('0x41'),_0x25f49c);var _0x2e0805=this[_0xb740('0x42')]({'plain':!![]});switch(_0x25f49c){case 0x0:case 0x1:var _0x146083=_0x2e0805[_0xb740('0x24')]?_['isArray'](_0x2e0805[_0xb740('0x24')])?_0x2e0805[_0xb740('0x24')][_0xb740('0x25')]():_0x2e0805[_0xb740('0x24')]:'udp';if(_0x146083===_0xb740('0x43')){_0x146083='udp';}this[_0xb740('0x5')](_0xb740('0x24'),_0x146083);this[_0xb740('0x5')](_0xb740('0x44'),'no');this[_0xb740('0x5')](_0xb740('0x45'),null);this['setDataValue'](_0xb740('0x46'),null);this[_0xb740('0x5')](_0xb740('0x47'),null);this[_0xb740('0x5')](_0xb740('0x48'),null);this[_0xb740('0x5')](_0xb740('0x49'),null);this[_0xb740('0x5')](_0xb740('0x4a'),null);this[_0xb740('0x5')](_0xb740('0x4b'),null);this[_0xb740('0x5')](_0xb740('0x4c'),null);this[_0xb740('0x5')]('rtcp_mux','no');break;case 0x2:this[_0xb740('0x5')](_0xb740('0x24'),_0xb740('0x43'));this[_0xb740('0x5')](_0xb740('0x44'),_0xb740('0x2f'));this[_0xb740('0x5')](_0xb740('0x45'),'yes');this['setDataValue'](_0xb740('0x46'),'yes');this[_0xb740('0x5')](_0xb740('0x47'),'yes');this['setDataValue'](_0xb740('0x48'),'yes');this[_0xb740('0x5')]('dtlsverify','no');this[_0xb740('0x5')](_0xb740('0x4a'),'actpass');this[_0xb740('0x5')](_0xb740('0x4b'),_0x2e0805[_0xb740('0x4b')]||_0xb740('0x4d'));this[_0xb740('0x5')](_0xb740('0x4c'),_0x2e0805[_0xb740('0x4c')]||_0xb740('0x4e'));this[_0xb740('0x5')](_0xb740('0x4f'),_0xb740('0x2f'));break;default:}}},'permissions':{'type':Sequelize[_0xb740('0x40')],'set':function(_0x4d422b){this[_0xb740('0x5')](_0xb740('0x50'),_0x4d422b?_0x4d422b[_0xb740('0x25')](','):[]);},'get':function(){return this[_0xb740('0xa')]('permissions')?_[_0xb740('0x51')](this[_0xb740('0xa')](_0xb740('0x50'))['split'](','),function(_0x13f4e3){return parseInt(_0x13f4e3,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0xb740('0x7')]},'phoneBarBusyNumber':{'type':Sequelize[_0xb740('0x7')]},'phoneBarUnconditional':{'type':Sequelize[_0xb740('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xb740('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xb740('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xb740('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xb740('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xb740('0xd')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xb740('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xb740('0x7')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xb740('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xb740('0x52')],'get':function(){return this[_0xb740('0xa')](_0xb740('0x53'))?this[_0xb740('0xa')](_0xb740('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xb740('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xb740('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xb740('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0xb740('0x7')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xb740('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xb740('0x7')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xb740('0x16')],'defaultValue':![],'set':function(_0x576598){if(typeof _0x576598==='string'){var _0x3bf6b9=_0x576598==='1'?!![]:_0x576598==='0'?![]:_0x576598===_0xb740('0x54')?!![]:_0x576598===_0xb740('0x55')?![]:![];this[_0xb740('0x5')](_0xb740('0x56'),_0x3bf6b9);}else{this[_0xb740('0x5')](_0xb740('0x56'),_0x576598);}}},'blocked':{'type':Sequelize[_0xb740('0x16')],'defaultValue':![],'set':function(_0x3f586b){this[_0xb740('0x5')](_0xb740('0x57'),_0x3f586b);if(_0x3f586b===!![]){this[_0xb740('0x5')]('blockedAt',moment());this['setDataValue'](_0xb740('0x58'),0x0);}else{this[_0xb740('0x5')](_0xb740('0x59'),null);}}},'blockedAt':{'type':Sequelize[_0xb740('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xb740('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xb740('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0xb740('0x5a')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xb740('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xb740('0x16')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xb740('0x16')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xb740('0x16')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 413160e..5d9ec43 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 _0xe2fe=['Whatsapp','Fax','getOpenchannelQueues','Openchannel','transaction','addAgent','getDataValue','Voice','TeamVoicePrefix','VoicePrefixId','removeTeams','Chat','getMailQueues','Mail','flatten','removeAgent','UserVoicePrefix','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$overlap','$contains','$contained','firstName','lastName','Contact','dialActive','getApiKey','token','No\x20API\x20access\x20key\x20found!','generateApiKey','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','queues','teams','desc','asc','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','client','http','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','offline','idle','unknown','ringing','voiceStatus','busy','slice','toUpperCase','SELECT','ui.','field','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','path','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','redis','register','localhost','request','then','info','User,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','role','Users','Agents','agent','telephone','map','value','includes','find','name','stack','send','index','User','rawAttributes','fieldName','type','key','password','includeAll','attributes','push','findAll','openTabs','true','length','chat','rows','dataValues','sms','mail','openchannel','whatsapp','model','keys','salt','query','intersection','fields','include','merge','fax','body','describe','params','addContacts','ids','omit','internal','Setting','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','from','voicemail','mailbox','VoiceMail','fullname','102','110','104','106','108','109','100','111','114','115','user','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','create','UserProfileSection','Telephones','UserProfileResource','bulkCreate','Unauthorized','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','all','each','isEmpty','autoAssociation','compact','changePassword','oldPassword','newPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','ValidationError','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','passwordHistoryLimit','previousPasswords','validatePasswordHistory','updatePasswordsHistory','channel','online','loginInPause','interface','Unknown\x20channel','capitalize','toLowerCase','Queues','penalty','spread','QueueId','emit','Queue:save','voice','VoiceQueue','format','SIP/%s','voicePause','UserVoiceQueueRt','upsert','remove','isArray','Queue:remove','addAvatar','userpic','file','getAvatar','root','existsSync','join','server/files/images/','download','getOpenTabs','ChatOpenTabs','CHAT','FAX','createdAt','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','getContacts','CmContact','filters','sort','where','filter','options','List','Tag','Tags','color','tag','nolimit','getQueues','isValidChannel','order','Queue','hasOwnProperty','getVoiceQueuesRt','pick','ChatGroup','getGroups','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','WhatsappInteraction','getWhatsappInteractions','login','phone','LOCAL/%s@from-sip/n','intrf','user:%s','headers','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','PAUSE','LOGININPAUSE','MemberReport','concat','isMiddleware','resolve','QueuePause','pause','updateAttributes','getChannels','DEFAULT\x20PAUSE','unpause','mailPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','manual','%s%s','Pause','getTeams','Team','addTeams','setDataValue','getChatQueues','getSmsQueues','Sms','getWhatsappQueues'];(function(_0x3a628f,_0x5d5130){var _0x3dc968=function(_0x5f56a6){while(--_0x5f56a6){_0x3a628f['push'](_0x3a628f['shift']());}};_0x3dc968(++_0x5d5130);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var moment=require(_0xee2f('0x0'));var BPromise=require('bluebird');var util=require('util');var path=require(_0xee2f('0x1'));var fs=require('fs');var _=require('lodash');var squel=require(_0xee2f('0x2'));var jayson=require(_0xee2f('0x3'));var Redis=require(_0xee2f('0x4'));var authService=require(_0xee2f('0x5'));var qs=require(_0xee2f('0x6'));var logger=require('../../config/logger')(_0xee2f('0x7'));var utils=require(_0xee2f('0x8'));var config=require('../../config/environment');var licenseUtil=require(_0xee2f('0x9'));var db=require(_0xee2f('0xa'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xee2f('0xb')]));require('./user.socket')[_0xee2f('0xc')](socket);config[_0xee2f('0xb')]=_['defaults'](config[_0xee2f('0xb')],{'host':_0xee2f('0xd'),'port':0x18eb});var client=jayson['client']['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x4818df,_0x56bbea,_0x2b8fb1,_0x4cb4bf){return new BPromise(function(_0x481ea7,_0x53047d){var _0x25ddf7=_0x4cb4bf||client;return _0x25ddf7[_0xee2f('0xe')](_0x4818df,_0x2b8fb1)[_0xee2f('0xf')](function(_0x100449){logger[_0xee2f('0x10')](_0xee2f('0x11'),_0x56bbea,'request\x20sent');logger[_0xee2f('0x12')]('User,\x20%s,\x20%s,\x20%s',_0x56bbea,_0xee2f('0x13'),JSON[_0xee2f('0x14')](_0x100449));if(_0x100449['error']){if(_0x100449[_0xee2f('0x15')][_0xee2f('0x16')]===0x1f4){logger[_0xee2f('0x15')](_0xee2f('0x11'),_0x56bbea,_0x100449[_0xee2f('0x15')]['message']);return _0x53047d(_0x100449[_0xee2f('0x15')]['message']);}logger[_0xee2f('0x15')](_0xee2f('0x11'),_0x56bbea,_0x100449['error']['message']);return _0x481ea7(_0x100449[_0xee2f('0x15')]['message']);}else{logger[_0xee2f('0x10')](_0xee2f('0x11'),_0x56bbea,_0xee2f('0x13'));_0x481ea7(_0x100449['result'][_0xee2f('0x17')]);}})[_0xee2f('0x18')](function(_0x4db2cc){logger[_0xee2f('0x15')](_0xee2f('0x11'),_0x56bbea,_0x4db2cc);_0x53047d(_0x4db2cc);});});}function respondWithStatusCode(_0x5d36d4,_0x5e73ad){_0x5e73ad=_0x5e73ad||0xcc;return function(_0x40d1fd){if(_0x40d1fd){return _0x5d36d4[_0xee2f('0x19')](_0x5e73ad);}return _0x5d36d4[_0xee2f('0x1a')](_0x5e73ad)[_0xee2f('0x1b')]();};}function respondWithResult(_0x472e3b,_0xf278cc){_0xf278cc=_0xf278cc||0xc8;return function(_0x39a39c){if(_0x39a39c){return _0x472e3b['status'](_0xf278cc)[_0xee2f('0x1c')](_0x39a39c);}};}function respondWithFilteredResult(_0x2c47c5,_0x15ceda){return function(_0x70e308){if(_0x70e308){var _0x820101=typeof _0x15ceda[_0xee2f('0x1d')]===_0xee2f('0x1e')&&typeof _0x15ceda[_0xee2f('0x1f')]===_0xee2f('0x1e');var _0x1e394f=_0x70e308[_0xee2f('0x20')];var _0x168adc=_0x820101?0x0:_0x15ceda[_0xee2f('0x1d')];var _0x45c4a0=_0x820101?_0x70e308['count']:_0x15ceda['offset']+_0x15ceda['limit'];var _0x18bdbb;if(_0x45c4a0>=_0x1e394f){_0x45c4a0=_0x1e394f;_0x18bdbb=0xc8;}else{_0x18bdbb=0xce;}_0x2c47c5[_0xee2f('0x1a')](_0x18bdbb);return _0x2c47c5[_0xee2f('0x21')](_0xee2f('0x22'),_0x168adc+'-'+_0x45c4a0+'/'+_0x1e394f)[_0xee2f('0x1c')](_0x70e308);}return null;};}function saveUpdates(_0x3737fd){return function(_0x4d8398){if(_0x4d8398){return _0x4d8398[_0xee2f('0x23')](_0x3737fd)['then'](function(_0x235697){return _0x235697;});}return null;};}function removeEntity(_0x180429){return function(_0x25ee9c){if(_0x25ee9c){return _0x25ee9c[_0xee2f('0x24')]()[_0xee2f('0xf')](function(){var _0x47d5a6=_0x25ee9c[_0xee2f('0x25')]({'plain':!![]});if(_0x47d5a6[_0xee2f('0x26')]==='admin')return;var _0x4ee0e1=[{'name':_0xee2f('0x27'),'value':'user','ignore':!![]},{'name':_0xee2f('0x28'),'value':_0xee2f('0x29'),'ignore':![]},{'name':'Telephones','value':_0xee2f('0x2a'),'ignore':![]}];var _0x5ca9f6=_(_0x4ee0e1)['filter']('ignore')[_0xee2f('0x2b')](_0xee2f('0x2c'))['value']();if(_[_0xee2f('0x2d')](_0x5ca9f6,_0x47d5a6[_0xee2f('0x26')])){return;}var _0xd64b7=_[_0xee2f('0x2e')](_0x4ee0e1,[_0xee2f('0x2c'),_0x47d5a6['role']])[_0xee2f('0x2f')];return db['UserProfileResource'][_0xee2f('0x24')]({'where':{'type':_0xd64b7,'resourceId':_0x47d5a6['id']}})[_0xee2f('0xf')](function(){return _0x25ee9c;});})[_0xee2f('0xf')](function(){_0x180429['status'](0xcc)[_0xee2f('0x1b')]();});}};}function handleEntityNotFound(_0x5ed71e){return function(_0xd3aaa9){if(!_0xd3aaa9){_0x5ed71e['sendStatus'](0x194);}return _0xd3aaa9;};}function handleError(_0x3e6dcc,_0x13a824){_0x13a824=_0x13a824||0x1f4;return function(_0x13149e){logger[_0xee2f('0x15')](_0x13149e[_0xee2f('0x30')]);if(_0x13149e[_0xee2f('0x2f')]){delete _0x13149e[_0xee2f('0x2f')];}_0x3e6dcc[_0xee2f('0x1a')](_0x13a824)[_0xee2f('0x31')](_0x13149e);};}exports[_0xee2f('0x32')]=function(_0x433547,_0x5ad0a7){var _0x4584b8={},_0x47e54b={'count':0x0,'rows':[]};var _0x46166f=_(db[_0xee2f('0x33')][_0xee2f('0x34')])[_0xee2f('0x2b')](function(_0xaddf3b){return{'name':_0xaddf3b[_0xee2f('0x35')],'type':_0xaddf3b[_0xee2f('0x36')][_0xee2f('0x37')]};})['filter'](function(_0x562d58){return!_['includes']([_0xee2f('0x38'),'salt'],_0x562d58[_0xee2f('0x2f')]);})['value']();_0x4584b8=qs['getOptions'](_0x46166f,_0x433547);var _0x5027a6={'where':_0x4584b8['where']};return db[_0xee2f('0x33')][_0xee2f('0x20')](_0x5027a6)[_0xee2f('0xf')](function(_0x268775){_0x47e54b['count']=_0x268775;if(_0x433547['query'][_0xee2f('0x39')]){_0x4584b8['include']=[{'all':!![]}];}if(!_['includes'](_0x4584b8[_0xee2f('0x3a')],'id')){_0x4584b8[_0xee2f('0x3a')][_0xee2f('0x3b')]('id');}return db['User'][_0xee2f('0x3c')](_0x4584b8);})[_0xee2f('0xf')](function(_0x19bd4d){_0x47e54b['rows']=_0x19bd4d;if(_0x433547['query'][_0xee2f('0x3d')]===_0xee2f('0x3e')){var _0x3bf382=[];for(var _0x2b9b33=0x0;_0x2b9b33<_0x47e54b['rows'][_0xee2f('0x3f')];_0x2b9b33++){_0x3bf382[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x40'),_0x47e54b[_0xee2f('0x41')][_0x2b9b33][_0xee2f('0x42')]));_0x3bf382[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x43'),_0x47e54b[_0xee2f('0x41')][_0x2b9b33][_0xee2f('0x42')]));_0x3bf382[_0xee2f('0x3b')](get_open_tabs('fax',_0x47e54b['rows'][_0x2b9b33]['dataValues']));_0x3bf382['push'](get_open_tabs(_0xee2f('0x44'),_0x47e54b[_0xee2f('0x41')][_0x2b9b33][_0xee2f('0x42')]));_0x3bf382[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x45'),_0x47e54b['rows'][_0x2b9b33][_0xee2f('0x42')]));_0x3bf382[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x46'),_0x47e54b[_0xee2f('0x41')][_0x2b9b33]['dataValues']));}return BPromise['all'](_0x3bf382)['then'](function(_0x1609f0){return _0x47e54b;});}else{return _0x47e54b;}})['then'](respondWithFilteredResult(_0x5ad0a7,_0x4584b8))['catch'](handleError(_0x5ad0a7,null));};exports['show']=function(_0x5f39b4,_0x3834d1){var _0x3ebb54={'raw':![],'where':{'id':_0x5f39b4['params']['id']}},_0x32da72={};_0x32da72[_0xee2f('0x47')]=_['differenceBy'](_[_0xee2f('0x48')](db[_0xee2f('0x33')][_0xee2f('0x34')]),[_0xee2f('0x38'),_0xee2f('0x49')]);_0x32da72['query']=_['keys'](_0x5f39b4[_0xee2f('0x4a')]);_0x32da72['filters']=_[_0xee2f('0x4b')](_0x32da72[_0xee2f('0x47')],_0x32da72[_0xee2f('0x4a')]);_0x3ebb54[_0xee2f('0x3a')]=_['intersection'](_0x32da72['model'],qs[_0xee2f('0x4c')](_0x5f39b4[_0xee2f('0x4a')][_0xee2f('0x4c')]));_0x3ebb54[_0xee2f('0x3a')]=_0x3ebb54[_0xee2f('0x3a')][_0xee2f('0x3f')]?_0x3ebb54[_0xee2f('0x3a')]:_0x32da72[_0xee2f('0x47')];if(_0x5f39b4[_0xee2f('0x4a')][_0xee2f('0x39')]){_0x3ebb54[_0xee2f('0x4d')]=[{'all':!![]}];}_0x3ebb54=_[_0xee2f('0x4e')]({},_0x3ebb54,_0x5f39b4['options']);if(!_[_0xee2f('0x2d')](_0x3ebb54[_0xee2f('0x3a')],'id')){_0x3ebb54[_0xee2f('0x3a')][_0xee2f('0x3b')]('id');}return db['User'][_0xee2f('0x2e')](_0x3ebb54)[_0xee2f('0xf')](handleEntityNotFound(_0x3834d1,null))[_0xee2f('0xf')](function(_0xda9ad5){var _0xa88c4c=[];values=_0xda9ad5;if(_0x5f39b4['query'][_0xee2f('0x3d')]==='true'){_0xa88c4c['push'](get_open_tabs(_0xee2f('0x40'),_0xda9ad5[_0xee2f('0x42')]));_0xa88c4c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x43'),_0xda9ad5[_0xee2f('0x42')]));_0xa88c4c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x45'),_0xda9ad5['dataValues']));_0xa88c4c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x46'),_0xda9ad5[_0xee2f('0x42')]));_0xa88c4c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x4f'),_0xda9ad5[_0xee2f('0x42')]));_0xa88c4c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x44'),_0xda9ad5[_0xee2f('0x42')]));return BPromise['all'](_0xa88c4c);}else{return values;}})[_0xee2f('0xf')](function(_0x4b9d29){return values;})[_0xee2f('0xf')](respondWithResult(_0x3834d1,null))[_0xee2f('0x18')](handleError(_0x3834d1,null));};exports[_0xee2f('0x23')]=function(_0x11ba31,_0x2f3891){if(_0x11ba31['body']['id']){delete _0x11ba31[_0xee2f('0x50')]['id'];}delete _0x11ba31[_0xee2f('0x50')][_0xee2f('0x26')];return db[_0xee2f('0x33')]['find']({'where':{'id':_0x11ba31['params']['id']}})['then'](handleEntityNotFound(_0x2f3891,null))['then'](saveUpdates(_0x11ba31['body'],null))[_0xee2f('0xf')](respondWithResult(_0x2f3891,null))['catch'](handleError(_0x2f3891,null));};exports[_0xee2f('0x51')]=function(_0x1421da,_0xd967e9){return db[_0xee2f('0x33')][_0xee2f('0x51')]()[_0xee2f('0xf')](respondWithResult(_0xd967e9,null))['catch'](handleError(_0xd967e9,null));};exports['addContacts']=function(_0x1708c5,_0x58e464){return db[_0xee2f('0x33')]['find']({'where':{'id':_0x1708c5[_0xee2f('0x52')]['id']}})['then'](handleEntityNotFound(_0x58e464,null))[_0xee2f('0xf')](function(_0x38616b){if(_0x38616b){return _0x38616b[_0xee2f('0x53')](_0x1708c5['body'][_0xee2f('0x54')],_[_0xee2f('0x55')](_0x1708c5[_0xee2f('0x50')],[_0xee2f('0x54'),'id'])||{});}})[_0xee2f('0xf')](respondWithResult(_0x58e464,null))[_0xee2f('0x18')](handleError(_0x58e464,null));};function validateUser(_0xf0c721){return new BPromise(function(_0x54f48f,_0x3ee766){if(_0xf0c721[_0xee2f('0x56')])return _0x54f48f(_0xf0c721);return db[_0xee2f('0x57')][_0xee2f('0x58')](0x1)[_0xee2f('0xf')](function(_0x3c9d47){if(_0x3c9d47[_0xee2f('0x59')])authService[_0xee2f('0x5a')](_0xf0c721[_0xee2f('0x38')]);db[_0xee2f('0x33')][_0xee2f('0x5b')]('internal')[_0xee2f('0xf')](function(_0xf15bc1){if(_['isNil'](_0xf15bc1)){_0xf0c721[_0xee2f('0x56')]=_0x3c9d47['min_internal']||0x1;return;}if(_[_0xee2f('0x5c')](_0x3c9d47['min_internal'])||_0x3c9d47['min_internal']===_0xf15bc1){_0xf0c721[_0xee2f('0x56')]=_0xf15bc1+0x1;return;}if(_0x3c9d47[_0xee2f('0x5d')]>_0xf15bc1){_0xf0c721[_0xee2f('0x56')]=_0x3c9d47[_0xee2f('0x5d')];return;}return db[_0xee2f('0x5e')]['query'](_0xee2f('0x5f'),{'type':db[_0xee2f('0x5e')][_0xee2f('0x60')]['SELECT']})[_0xee2f('0xf')](function(_0x413d70){if(_0x413d70&&_0x413d70['length']){for(var _0x1f1c55=0x0,_0x32800d=_0x413d70[_0xee2f('0x3f')];_0x1f1c55<_0x32800d&&_[_0xee2f('0x5c')](_0xf0c721[_0xee2f('0x56')]);_0x1f1c55++){if(_0x3c9d47[_0xee2f('0x5d')]<=_0x413d70[_0x1f1c55][_0xee2f('0x61')]){_0xf0c721[_0xee2f('0x56')]=_0x413d70[_0x1f1c55][_0xee2f('0x61')];}else if(_0x3c9d47['min_internal']>_0x413d70[_0x1f1c55]['from']&&_0x3c9d47['min_internal']<=_0x413d70[_0x1f1c55]['to']){_0xf0c721[_0xee2f('0x56')]=_0x3c9d47[_0xee2f('0x5d')];}}}if(_[_0xee2f('0x5c')](_0xf0c721[_0xee2f('0x56')])){_0xf0c721[_0xee2f('0x56')]=_0xf15bc1+0x1;}return _0x54f48f(_0xf0c721);});});})['catch'](function(_0x2b69f0){_0x3ee766(_0x2b69f0);});});}function updateUser(_0x3a4464){return new BPromise(function(_0x4e39ba,_0x2c4a18){try{if(_0x3a4464[_0xee2f('0x62')]){_0x3a4464[_0xee2f('0x63')]=_0x3a4464['internal'];_0x3a4464[_0xee2f('0x64')]={'mailbox':_0x3a4464['internal'],'password':_0x3a4464[_0xee2f('0x38')],'fullname':_0x3a4464[_0xee2f('0x65')],'email':_0x3a4464['email']};}if(_0x3a4464[_0xee2f('0x26')]===_0xee2f('0x29')){if(!_0x3a4464['permissions'])_0x3a4464['permissions']=['101',_0xee2f('0x66'),'103','113',_0xee2f('0x67'),_0xee2f('0x68'),'105',_0xee2f('0x69'),'107',_0xee2f('0x6a'),_0xee2f('0x6b'),_0xee2f('0x6c'),_0xee2f('0x6d'),_0xee2f('0x6e'),_0xee2f('0x6f')];}_0x4e39ba(_0x3a4464);}catch(_0x20990f){_0x2c4a18(_0x20990f);}});}exports['create']=function(_0x86eb61,_0x2989a8){if(_0x86eb61[_0xee2f('0x70')][_0xee2f('0x26')]===_0xee2f('0x29'))throw new Error('Unauthorized');if(_0x86eb61[_0xee2f('0x50')][_0xee2f('0x26')]===_0xee2f('0x70')&&_0x86eb61[_0xee2f('0x70')][_0xee2f('0x26')]!==_0xee2f('0x71')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x86eb61['body'][_0xee2f('0x26')]===_0xee2f('0x71')&&_0x86eb61[_0xee2f('0x70')][_0xee2f('0x26')]!==_0xee2f('0x71')){throw new Error(_0xee2f('0x72'));}return licenseUtil[_0xee2f('0x73')]([_0x86eb61['body']])['then'](function(){return validateUser(_0x86eb61[_0xee2f('0x50')]);})[_0xee2f('0xf')](function(_0x12c4f9){return updateUser(_0x12c4f9)[_0xee2f('0xf')](function(_0x38ee46){if(_0x38ee46[_0xee2f('0x26')]===_0xee2f('0x71')){_0x38ee46[_0xee2f('0x74')]=_0x86eb61[_0xee2f('0x70')][_0xee2f('0x74')];delete _0x38ee46[_0xee2f('0x75')];}return _0x38ee46;});})[_0xee2f('0xf')](function(_0x563d01){return db['User'][_0xee2f('0x76')](_0x563d01,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})['then'](function(_0x5a1fdc){if(_0x86eb61[_0xee2f('0x50')][_0xee2f('0x26')]==='user')return _0x5a1fdc;if(_0x86eb61['user'][_0xee2f('0x26')]!==_0xee2f('0x70'))return _0x5a1fdc;return db[_0xee2f('0x77')]['find']({'where':{'name':_0x5a1fdc['role']===_0xee2f('0x29')?_0xee2f('0x28'):_0xee2f('0x78'),'userProfileId':_0x86eb61['user'][_0xee2f('0x75')]},'raw':!![]})['then'](function(_0x1afacf){if(!_0x1afacf||_0x1afacf['autoAssociation']!=0x0)return _0x5a1fdc;return db[_0xee2f('0x79')][_0xee2f('0x76')]({'name':_0x5a1fdc[_0xee2f('0x2f')],'resourceId':_0x5a1fdc['id'],'type':_0x1afacf['name'],'sectionId':_0x1afacf['id']},{})['then'](function(){return _0x5a1fdc;});})[_0xee2f('0x18')](function(_0x4448a6){logger[_0xee2f('0x15')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4448a6);throw _0x4448a6;});})[_0xee2f('0xf')](respondWithResult(_0x2989a8,0xc9))[_0xee2f('0x18')](handleError(_0x2989a8,null));};exports[_0xee2f('0x7a')]=function(_0x346fc2,_0x413340){var _0x2c14f=_0x346fc2[_0xee2f('0x50')];var _0x16326e=[];if(_0x346fc2[_0xee2f('0x70')][_0xee2f('0x26')]===_0xee2f('0x29'))throw new Error(_0xee2f('0x7b'));if(_[_0xee2f('0x7c')](_0x2c14f,[_0xee2f('0x26'),'user'])&&_0x346fc2[_0xee2f('0x70')][_0xee2f('0x26')]!==_0xee2f('0x71')){throw new Error(_0xee2f('0x7d'));}if(_[_0xee2f('0x7c')](_0x2c14f,[_0xee2f('0x26'),_0xee2f('0x71')])&&_0x346fc2[_0xee2f('0x70')][_0xee2f('0x26')]!==_0xee2f('0x71')){throw new Error(_0xee2f('0x7e'));}return licenseUtil['checkUserLimits'](_0x2c14f)[_0xee2f('0xf')](function(){return validateUser(_0x2c14f[0x0]);})[_0xee2f('0xf')](function(){for(var _0x1422e9=0x1;_0x1422e9<_0x2c14f[_0xee2f('0x3f')];_0x1422e9++){var _0x53d769=_0x2c14f[_0x1422e9-0x1][_0xee2f('0x56')];if(!_0x2c14f[_0x1422e9][_0xee2f('0x56')])_0x2c14f[_0x1422e9][_0xee2f('0x56')]=_0x53d769+0x1;_0x16326e['push'](validateUser(_0x2c14f[_0x1422e9]));}return BPromise['all'](_0x16326e);})[_0xee2f('0xf')](function(){_0x16326e=[];for(var _0x48fe47=0x0;_0x48fe47<_0x2c14f['length'];_0x48fe47++){_0x16326e['push'](updateUser(_0x2c14f[_0x48fe47]));}return BPromise[_0xee2f('0x7f')](_0x16326e);})[_0xee2f('0xf')](function(){return BPromise[_0xee2f('0x80')](_0x2c14f,function(_0x172cee){return db['User'][_0xee2f('0x76')](_0x172cee,{'include':[{'model':db[_0xee2f('0x64')],'as':_0xee2f('0x64')}]})['then'](function(_0x20e5db){_0x172cee['id']=_0x20e5db['id'];return _0x172cee;});});})['then'](function(_0x150445){if(_0x346fc2['body']['role']===_0xee2f('0x70'))return _0x150445;if(_0x346fc2['user'][_0xee2f('0x26')]!=='user')return _0x150445;var _0x4e585b=_[_0xee2f('0x7c')](_0x150445,function(_0x20bc03){return _0x20bc03['role']===_0xee2f('0x29')||_0x20bc03[_0xee2f('0x26')]==='telephone';});if(!_0x4e585b)return _0x150445;return db['UserProfileSection'][_0xee2f('0x3c')]({'where':{'name':{'$or':[_0xee2f('0x28'),'Telephones']},'userProfileId':_0x346fc2[_0xee2f('0x70')][_0xee2f('0x75')]},'raw':!![]})[_0xee2f('0xf')](function(_0x2238c2){if(_[_0xee2f('0x81')](_0x2238c2)||!_['some'](_0x2238c2,['autoAssociation',0x0]))return _0x150445;_0x16326e=[];var _0x567de2=_(_0x2238c2)[_0xee2f('0x2b')](function(_0x1fe927){if(_0x1fe927[_0xee2f('0x82')]===0x1)return;return _0x1fe927[_0xee2f('0x2f')]===_0xee2f('0x28')?_0xee2f('0x29'):_0xee2f('0x2a');})[_0xee2f('0x83')]()[_0xee2f('0x2c')]();for(var _0x173f5f=0x0;_0x173f5f<_0x150445[_0xee2f('0x3f')];_0x173f5f++){if(!_[_0xee2f('0x2d')](_0x567de2,_0x150445[_0x173f5f][_0xee2f('0x26')]))return;var _0x470780=_0x150445[_0x173f5f][_0xee2f('0x26')]===_0xee2f('0x29')?'Agents':'Telephones';_0x16326e[_0xee2f('0x3b')](db[_0xee2f('0x79')]['create']({'name':_0x150445[_0x173f5f][_0xee2f('0x2f')],'resourceId':_0x150445[_0x173f5f]['id'],'type':_0x470780,'sectionId':_[_0xee2f('0x2e')](_0x2238c2,[_0xee2f('0x2f'),_0x470780])['id']},{}));}return BPromise['all'](_0x16326e);});})[_0xee2f('0xf')](respondWithResult(_0x413340,0xc9))[_0xee2f('0x18')](handleError(_0x413340,null));};exports[_0xee2f('0x84')]=function(_0x609bd9,_0x1954b5){if(_0x609bd9[_0xee2f('0x50')]['id']){delete _0x609bd9[_0xee2f('0x50')]['id'];}return db[_0xee2f('0x33')][_0xee2f('0x2e')]({'where':{'id':_0x609bd9['params']['id']}})[_0xee2f('0xf')](function(_0x16b101){if(!_0x16b101)return null;if(_0x16b101['id']===_0x609bd9[_0xee2f('0x70')]['id']){if(!_0x609bd9[_0xee2f('0x50')][_0xee2f('0x85')]||!_0x609bd9[_0xee2f('0x50')][_0xee2f('0x86')]){throw new db[(_0xee2f('0x87'))]['ValidationError'](_0xee2f('0x88'));}if(!_0x16b101[_0xee2f('0x89')](_0x609bd9['body'][_0xee2f('0x85')])){throw new db['Sequelize']['ValidationError'](_0xee2f('0x8a'));}if(_0x609bd9[_0xee2f('0x50')][_0xee2f('0x85')]===_0x609bd9[_0xee2f('0x50')][_0xee2f('0x86')]){throw new db[(_0xee2f('0x87'))]['ValidationError'](_0xee2f('0x8b'));}}else if(_0x609bd9[_0xee2f('0x70')]['role']===_0xee2f('0x71')){if(!_0x609bd9[_0xee2f('0x50')]['newPassword']){throw new db[(_0xee2f('0x87'))][(_0xee2f('0x8c'))](_0xee2f('0x8d'));}}else if(_0x609bd9[_0xee2f('0x70')][_0xee2f('0x26')]===_0xee2f('0x70')){if(!_0x609bd9[_0xee2f('0x50')][_0xee2f('0x86')]){throw new db[(_0xee2f('0x87'))][(_0xee2f('0x8c'))](_0xee2f('0x8d'));}if(_0x16b101[_0xee2f('0x26')]!=='agent'){throw new db[(_0xee2f('0x87'))]['ValidationError']('Unauthorized');}}else{throw new db['Sequelize'][(_0xee2f('0x8c'))]('Unauthorized');}return _0x16b101;})[_0xee2f('0xf')](handleEntityNotFound(_0x1954b5,null))[_0xee2f('0xf')](function(_0x344a3a){return db['Setting'][_0xee2f('0x8e')]({'attributes':['id',_0xee2f('0x59'),'enforcePasswordHistory',_0xee2f('0x8f')]})[_0xee2f('0xf')](function(_0x392446){if(_0x392446[_0xee2f('0x59')])authService[_0xee2f('0x5a')](_0x609bd9[_0xee2f('0x50')][_0xee2f('0x86')]);if(!_0x392446['enforcePasswordHistory']||!_0x344a3a[_0xee2f('0x90')])return _0x344a3a;authService[_0xee2f('0x91')](_0x609bd9['body'][_0xee2f('0x86')],_0x344a3a[_0xee2f('0x90')],_0x392446[_0xee2f('0x8f')]);return _0x344a3a;})['then'](saveUpdates({'password':_0x609bd9[_0xee2f('0x50')][_0xee2f('0x86')],'passwordResetAt':_0x609bd9[_0xee2f('0x70')]['id']==_0x609bd9[_0xee2f('0x52')]['id']?moment():null,'previousPasswords':authService[_0xee2f('0x92')](_0x609bd9[_0xee2f('0x50')]['newPassword'],_0x344a3a[_0xee2f('0x90')])},null));})[_0xee2f('0xf')](respondWithResult(_0x1954b5,null))[_0xee2f('0x18')](handleError(_0x1954b5,null));};exports['addQueues']=function(_0x50670a,_0xd39c00){var _0x52bb33=_0x50670a[_0xee2f('0x50')][_0xee2f('0x93')];return db['User'][_0xee2f('0x2e')]({'where':{'id':_0x50670a[_0xee2f('0x52')]['id']},'attributes':['id','name','role',_0xee2f('0x94'),_0xee2f('0x95'),'voicePause',_0xee2f('0x96')]})[_0xee2f('0xf')](handleEntityNotFound(_0xd39c00,null))[_0xee2f('0xf')](function(_0xd98eab){if(_0xd98eab){if(!utils['isValidChannel'](_0x52bb33)){throw new db[(_0xee2f('0x87'))][(_0xee2f('0x8c'))](_0xee2f('0x97'));}return _0xd98eab['add'+_[_0xee2f('0x98')](_0x52bb33[_0xee2f('0x99')]())+_0xee2f('0x9a')](_0x50670a[_0xee2f('0x50')]['ids'],{'penalty':_0x50670a['body'][_0xee2f('0x9b')]||0x0})[_0xee2f('0x9c')](function(_0x1fff43){for(var _0x56abfb=0x0;_0x56abfb<_0x50670a[_0xee2f('0x50')][_0xee2f('0x54')]['length'];_0x56abfb+=0x1){var _0x969efe={'UserId':Number(_0x50670a[_0xee2f('0x52')]['id'])};_0x969efe[_[_0xee2f('0x98')](_0x52bb33[_0xee2f('0x99')]())+_0xee2f('0x9d')]=Number(_0x50670a[_0xee2f('0x50')][_0xee2f('0x54')][_0x56abfb]);socket[_0xee2f('0x9e')]('user'+_[_0xee2f('0x98')](_0x52bb33[_0xee2f('0x99')]())+_0xee2f('0x9f'),_0x969efe);}return _0x1fff43;})['then'](function(){if(_0x52bb33===_0xee2f('0xa0')){return db[_0xee2f('0xa1')][_0xee2f('0x3c')]({'where':{'id':_0x50670a[_0xee2f('0x50')][_0xee2f('0x54')]||[]},'raw':!![],'attributes':['id',_0xee2f('0x2f')]});}})[_0xee2f('0xf')](function(_0x3a71fa){var _0x298dfa=_0xd98eab[_0xee2f('0x25')]({'plain':!![]});var _0x2bf351=[];if(_0x52bb33===_0xee2f('0xa0')&&_0x298dfa['role']===_0xee2f('0x29')&&_0x298dfa['online']){for(var _0xc1d07e=0x0;_0xc1d07e<_0x3a71fa[_0xee2f('0x3f')];_0xc1d07e+=0x1){_0x2bf351['push']({'membername':_0x298dfa[_0xee2f('0x2f')],'UserId':_0x298dfa['id'],'queue_name':_0x3a71fa[_0xc1d07e][_0xee2f('0x2f')],'VoiceQueueId':_0x3a71fa[_0xc1d07e]['id'],'interface':_[_0xee2f('0x5c')](_0x298dfa[_0xee2f('0x96')])?util[_0xee2f('0xa2')](_0xee2f('0xa3'),_0x298dfa['name']):_0x298dfa[_0xee2f('0x96')],'paused':_0x298dfa[_0xee2f('0xa4')]||![],'penalty':_0x50670a[_0xee2f('0x50')][_0xee2f('0x9b')]||0x0});}return BPromise[_0xee2f('0x80')](_0x2bf351,function(_0x31b0f7){return db[_0xee2f('0xa5')][_0xee2f('0xa6')](_0x31b0f7);});}return _0xd98eab;});}})[_0xee2f('0xf')](respondWithStatusCode(_0xd39c00,null))[_0xee2f('0x18')](handleError(_0xd39c00,null));};exports['removeQueues']=function(_0x1d4d12,_0x3ab6c7){var _0x37ebf7;return db['User']['find']({'where':{'id':_0x1d4d12[_0xee2f('0x52')]['id']},'attributes':['id',_0xee2f('0x2f'),_0xee2f('0x26')]})[_0xee2f('0xf')](handleEntityNotFound(_0x3ab6c7,null))[_0xee2f('0xf')](function(_0x4a91ca){if(_0x4a91ca){_0x37ebf7=_0x4a91ca;if(!_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x93')]||!utils['isValidChannel'](_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x93')])){throw new db[(_0xee2f('0x87'))][(_0xee2f('0x8c'))](_0xee2f('0x97'));}return _0x4a91ca[_0xee2f('0xa7')+_['capitalize'](_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x93')][_0xee2f('0x99')]())+_0xee2f('0x9a')](_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x54')]);}})[_0xee2f('0xf')](function(_0x2bd952){if(_[_0xee2f('0xa8')](_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x54')])){for(var _0x5010eb=0x0;_0x5010eb<_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x54')][_0xee2f('0x3f')];_0x5010eb+=0x1){var _0x11e4f5={'UserId':Number(_0x1d4d12[_0xee2f('0x52')]['id'])};_0x11e4f5[_[_0xee2f('0x98')](_0x1d4d12['query'][_0xee2f('0x93')][_0xee2f('0x99')]())+_0xee2f('0x9d')]=Number(_0x1d4d12[_0xee2f('0x4a')]['ids'][_0x5010eb]);socket[_0xee2f('0x9e')](_0xee2f('0x70')+_[_0xee2f('0x98')](_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x93')][_0xee2f('0x99')]())+_0xee2f('0xa9'),_0x11e4f5);}}else{var _0x11e4f5={'UserId':Number(_0x1d4d12['params']['id'])};_0x11e4f5[_['capitalize'](_0x1d4d12[_0xee2f('0x4a')][_0xee2f('0x93')][_0xee2f('0x99')]())+'QueueId']=Number(_0x1d4d12[_0xee2f('0x4a')]['ids']);socket[_0xee2f('0x9e')]('user'+_[_0xee2f('0x98')](_0x1d4d12[_0xee2f('0x4a')]['channel'][_0xee2f('0x99')]())+'Queue:remove',_0x11e4f5);}return _0x2bd952;})[_0xee2f('0xf')](function(){if(_0x1d4d12['query'][_0xee2f('0x93')]===_0xee2f('0xa0')){return db[_0xee2f('0xa5')][_0xee2f('0x24')]({'where':{'UserId':_0x1d4d12[_0xee2f('0x52')]['id'],'VoiceQueueId':_0x1d4d12['query'][_0xee2f('0x54')]},'individualHooks':!![]})[_0xee2f('0xf')](function(){return _0x37ebf7;});}return _0x37ebf7;})[_0xee2f('0xf')](respondWithStatusCode(_0x3ab6c7,null))[_0xee2f('0x18')](handleError(_0x3ab6c7,null));};exports[_0xee2f('0xaa')]=function(_0x73e99a,_0x55f1bd){_0x73e99a[_0xee2f('0x50')][_0xee2f('0xab')]=_0x73e99a[_0xee2f('0xac')]['filename'];return db[_0xee2f('0x33')][_0xee2f('0x2e')]({'where':{'id':_0x73e99a[_0xee2f('0x52')]['id']}})[_0xee2f('0xf')](handleEntityNotFound(_0x55f1bd,null))[_0xee2f('0xf')](saveUpdates(_0x73e99a[_0xee2f('0x50')],null))[_0xee2f('0xf')](respondWithResult(_0x55f1bd,null))[_0xee2f('0x18')](handleError(_0x55f1bd,null));};exports[_0xee2f('0xad')]=function(_0x2dc4ff,_0x351e10){var _0x3f0ef6=path['join'](config[_0xee2f('0xae')],'server/files/images/logos/default_profile.png');return db[_0xee2f('0x33')][_0xee2f('0x2e')]({'where':{'id':_0x2dc4ff['params']['id']},'attributes':['id',_0xee2f('0xab')],'raw':!![]})['then'](handleEntityNotFound(_0x351e10,null))[_0xee2f('0xf')](function(_0x34a358){if(_0x34a358){if(_[_0xee2f('0x5c')](_0x34a358[_0xee2f('0xab')])){return _0x351e10['download'](_0x3f0ef6);}else{if(!fs[_0xee2f('0xaf')](path[_0xee2f('0xb0')](config[_0xee2f('0xae')],_0xee2f('0xb1'),_0x34a358[_0xee2f('0xab')]))){return _0x351e10[_0xee2f('0xb2')](_0x3f0ef6);}return _0x351e10['download'](path[_0xee2f('0xb0')](config['root'],_0xee2f('0xb1'),_0x34a358[_0xee2f('0xab')]));}}})['catch'](handleError(_0x351e10,null));};exports[_0xee2f('0xb3')]=function(_0x44c1a8,_0x4b9d27){return db['User'][_0xee2f('0x2e')]({'where':{'id':_0x44c1a8[_0xee2f('0x52')]['id']},'attributes':['id']})[_0xee2f('0xf')](handleEntityNotFound(_0x4b9d27,null))[_0xee2f('0xf')](function(_0x2f5a60){var _0x33182c=[];values=_0x2f5a60['dataValues'];_0x33182c[_0xee2f('0x3b')](get_open_tabs('chat',_0x2f5a60['dataValues']));_0x33182c['push'](get_open_tabs(_0xee2f('0x43'),_0x2f5a60['dataValues']));_0x33182c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x45'),_0x2f5a60['dataValues']));_0x33182c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x46'),_0x2f5a60[_0xee2f('0x42')]));_0x33182c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x4f'),_0x2f5a60['dataValues']));_0x33182c[_0xee2f('0x3b')](get_open_tabs(_0xee2f('0x44'),_0x2f5a60[_0xee2f('0x42')]));return BPromise[_0xee2f('0x7f')](_0x33182c);})[_0xee2f('0xf')](function(_0x1cbce0){var _0x6e5a1d=[];if(_0x1cbce0){for(var _0xf2d880=0x0;_0xf2d880=_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=_0x59669c['agents']){throw new Error(_0xd82e('0x54'));}})[_0xd82e('0x11')](function(){if(_0x3d09a5){return db[_0xd82e('0x2a')][_0xd82e('0x4a')]({'where':{'membername':_0x3d09a5[_0xd82e('0x28')]},'individualHooks':!![]});}})[_0xd82e('0x11')](function(){if(_0x3d09a5){return _0x3d09a5[_0xd82e('0x55')]({'raw':!![]});}})[_0xd82e('0x11')](function(_0x23af1d){if(_0x3d09a5){if(_0x23af1d){var _0x5c7fd1=[];_0x5b5d07=_0x23af1d;if(_0x5b5d07['length']){for(var _0xa4a8db=0x0;_0xa4a8db<_0x5b5d07[_0xd82e('0x2e')];_0xa4a8db++){_0x5c7fd1[_0xd82e('0x32')](db[_0xd82e('0x2a')][_0xd82e('0x56')]({'membername':_0x3d09a5['name'],'UserId':_0x3d09a5['id'],'queue_name':_0x5b5d07[_0xa4a8db][_0xd82e('0x28')],'VoiceQueueId':_0x5b5d07[_0xa4a8db]['id'],'interface':_0x6ebc4b,'paused':_0x3d09a5[_0xd82e('0x4f')]||![],'penalty':_0x5b5d07[_0xa4a8db][_0xd82e('0x57')]||0x0}));}return BPromise[_0xd82e('0x48')](_0x5c7fd1);}}}})[_0xd82e('0x11')](function(){if(_0x3d09a5){return db[_0xd82e('0x2b')][_0xd82e('0x2c')]({'where':{'membername':_0x3d09a5[_0xd82e('0x28')],'exitAt':null}});}})[_0xd82e('0x11')](function(_0x2871ec){if(_0x3d09a5){if(_0x2871ec&&_0x2871ec[_0xd82e('0x2e')]){var _0x3f2ebb=[];_0x2871ec[_0xd82e('0x31')](function(_0x10a235){_0x3f2ebb[_0xd82e('0x32')](_0x10a235[_0xd82e('0x3f')]({'exitAt':moment()['format'](_0xd82e('0x37'))}));});return BPromise[_0xd82e('0x48')](_0x3f2ebb);}}})['then'](function(_0x1de957){if(_0x3d09a5){var _0x14abed=[];var _0x4d60ed=[];var _0x53cdcd=utils[_0xd82e('0x30')]();var _0x2ea318={'membername':_0x3d09a5['name'],'interface':_0x6ebc4b,'enterAt':moment()['format'](_0xd82e('0x37')),'role':_0x3d09a5[_0xd82e('0x3b')],'internal':_0x3d09a5[_0xd82e('0x29')]};_0x53cdcd[_0xd82e('0x31')](function(_0x5adffd){_0x14abed['push'](_[_0xd82e('0x58')]({'channel':_0x5adffd,'type':'LOGIN','data1':_0xd82e('0x59'),'data2':_0x6ebc4b},_0x2ea318));if(_0x3d09a5[_0xd82e('0x4f')]){_0x4d60ed[_0xd82e('0x32')](_['merge']({'channel':_0x5adffd,'type':_0xd82e('0x2d'),'data1':_0xd82e('0x5a')},_0x2ea318));}});return db[_0xd82e('0x2b')]['bulkCreate'](_0x14abed[_0xd82e('0x5b')](_0x4d60ed),{'individualHooks':!![]});}})[_0xd82e('0x11')](function(){if(_0x3d09a5){return _0x3d09a5[_0xd82e('0x3f')]({'online':!![],'lastLoginAt':moment()['format'](_0xd82e('0x37')),'voicePause':_0x3d09a5[_0xd82e('0x4f')]||![],'mailPause':_0x3d09a5[_0xd82e('0x4f')]||![],'chatPause':_0x3d09a5[_0xd82e('0x4f')]||![],'faxPause':_0x3d09a5['loginInPause']||![],'smsPause':_0x3d09a5[_0xd82e('0x4f')]||![],'openchannelPause':_0x3d09a5[_0xd82e('0x4f')]||![],'pauseType':_0x3d09a5[_0xd82e('0x4f')]?_0xd82e('0x5a'):null,'lastPauseAt':moment()[_0xd82e('0x34')](_0xd82e('0x37')),'interface':_0x6ebc4b});}})[_0xd82e('0x11')](function(_0x3c0ef1){_0x57f1a6(_0x3c0ef1);})[_0xd82e('0x26')](function(_0x1c4761){_0x28b409(_0x3af2a3['error'](0x1f4,_0x1c4761['message']));});});}; \ No newline at end of file +var _0x0b68=['register','request','then','request\x20sent','stringify','error','code','User,\x20%s,\x20%s','message','info','result','catch','GetUser','findAll','options','where','attributes','limit','include','model','map','debug','ShowUser','find','raw','PauseUser','User','name','internal','interface','UserVoiceQueueRt','update','PAUSE','length','format','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','body','type','DEFAULT\x20PAUSE','role','uniqueid','MemberReport','YYYY-MM-DD\x20HH:mm:ss','findOne','channel','Unknown\x20channel','voice','mail','chat','sms','whatsapp','system','set','%s%s','Pause','LogoutUser','destroy','all','phone','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','loginInPause','LOGIN','callysquare','bulkCreate','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./user.socket'];(function(_0x111012,_0x52cd2f){var _0x160485=function(_0x3a8cdc){while(--_0x3a8cdc){_0x111012['push'](_0x111012['shift']());}};_0x160485(++_0x52cd2f);}(_0x0b68,0x1bc));var _0x80b6=function(_0x5badff,_0x574b94){_0x5badff=_0x5badff-0x0;var _0x3a2ba1=_0x0b68[_0x5badff];return _0x3a2ba1;};'use strict';var _=require('lodash');var util=require(_0x80b6('0x0'));var moment=require(_0x80b6('0x1'));var BPromise=require('bluebird');var rs=require(_0x80b6('0x2'));var fs=require('fs');var Redis=require(_0x80b6('0x3'));var db=require(_0x80b6('0x4'))['db'];var utils=require(_0x80b6('0x5'));var logger=require(_0x80b6('0x6'))(_0x80b6('0x7'));var config=require('../../config/environment');var jayson=require(_0x80b6('0x8'));var client=jayson[_0x80b6('0x9')][_0x80b6('0xa')]({'port':0x232a});config[_0x80b6('0xb')]=_[_0x80b6('0xc')](config['redis'],{'host':_0x80b6('0xd'),'port':0x18eb});var socket=require(_0x80b6('0xe'))(new Redis(config['redis']));require(_0x80b6('0xf'))[_0x80b6('0x10')](socket);function respondWithRpcPromise(_0x5364e7,_0x1c3706,_0x18d422){return new BPromise(function(_0x485b6a,_0x3590cd){return client[_0x80b6('0x11')](_0x5364e7,_0x18d422)[_0x80b6('0x12')](function(_0x38c4ea){logger['info']('User,\x20%s,\x20%s',_0x1c3706,_0x80b6('0x13'));logger['debug']('User,\x20%s,\x20%s,\x20%s',_0x1c3706,_0x80b6('0x13'),JSON[_0x80b6('0x14')](_0x38c4ea));if(_0x38c4ea[_0x80b6('0x15')]){if(_0x38c4ea['error'][_0x80b6('0x16')]===0x1f4){logger[_0x80b6('0x15')](_0x80b6('0x17'),_0x1c3706,_0x38c4ea[_0x80b6('0x15')][_0x80b6('0x18')]);return _0x3590cd(_0x38c4ea['error'][_0x80b6('0x18')]);}logger['error'](_0x80b6('0x17'),_0x1c3706,_0x38c4ea[_0x80b6('0x15')][_0x80b6('0x18')]);return _0x485b6a(_0x38c4ea[_0x80b6('0x15')]['message']);}else{logger[_0x80b6('0x19')](_0x80b6('0x17'),_0x1c3706,_0x80b6('0x13'));_0x485b6a(_0x38c4ea[_0x80b6('0x1a')]['message']);}})[_0x80b6('0x1b')](function(_0x58291f){logger[_0x80b6('0x15')](_0x80b6('0x17'),_0x1c3706,_0x58291f);_0x3590cd(_0x58291f);});});}exports[_0x80b6('0x1c')]=function(_0x552916){var _0x1901e2=this;return new Promise(function(_0x1ccf17,_0xc884e8){return db['User'][_0x80b6('0x1d')]({'raw':_0x552916[_0x80b6('0x1e')]?_0x552916['options']['raw']===undefined?!![]:![]:!![],'where':_0x552916[_0x80b6('0x1e')]?_0x552916[_0x80b6('0x1e')][_0x80b6('0x1f')]||null:null,'attributes':_0x552916['options']?_0x552916[_0x80b6('0x1e')][_0x80b6('0x20')]||null:null,'limit':_0x552916[_0x80b6('0x1e')]?_0x552916[_0x80b6('0x1e')][_0x80b6('0x21')]||null:null,'include':_0x552916[_0x80b6('0x1e')]?_0x552916['options']['include']?_['map'](_0x552916[_0x80b6('0x1e')][_0x80b6('0x22')],function(_0x3a8fe9){return{'model':db[_0x3a8fe9[_0x80b6('0x23')]],'as':_0x3a8fe9['as'],'attributes':_0x3a8fe9[_0x80b6('0x20')],'include':_0x3a8fe9[_0x80b6('0x22')]?_[_0x80b6('0x24')](_0x3a8fe9[_0x80b6('0x22')],function(_0xb7537){return{'model':db[_0xb7537[_0x80b6('0x23')]],'as':_0xb7537['as'],'attributes':_0xb7537[_0x80b6('0x20')],'include':_0xb7537[_0x80b6('0x22')]?_[_0x80b6('0x24')](_0xb7537[_0x80b6('0x22')],function(_0x10fbe6){return{'model':db[_0x10fbe6[_0x80b6('0x23')]],'as':_0x10fbe6['as'],'attributes':_0x10fbe6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x30a8cd){logger[_0x80b6('0x19')]('GetUser',_0x552916);logger[_0x80b6('0x25')](_0x80b6('0x1c'),_0x552916,JSON['stringify'](_0x30a8cd));_0x1ccf17(_0x30a8cd);})['catch'](function(_0x347417){logger['error'](_0x80b6('0x1c'),_0x347417[_0x80b6('0x18')],_0x552916);_0xc884e8(_0x1901e2[_0x80b6('0x15')](0x1f4,_0x347417[_0x80b6('0x18')]));});});};exports[_0x80b6('0x26')]=function(_0x24d42d){var _0x5cd18f=this;return new Promise(function(_0x4fcba3,_0x30e213){return db['User'][_0x80b6('0x27')]({'raw':_0x24d42d[_0x80b6('0x1e')]?_0x24d42d[_0x80b6('0x1e')][_0x80b6('0x28')]===undefined?!![]:![]:!![],'where':_0x24d42d['options']?_0x24d42d[_0x80b6('0x1e')]['where']||null:null,'attributes':_0x24d42d[_0x80b6('0x1e')]?_0x24d42d[_0x80b6('0x1e')][_0x80b6('0x20')]||null:null,'include':_0x24d42d[_0x80b6('0x1e')]?_0x24d42d[_0x80b6('0x1e')][_0x80b6('0x22')]?_[_0x80b6('0x24')](_0x24d42d[_0x80b6('0x1e')][_0x80b6('0x22')],function(_0x2fdac9){return{'model':db[_0x2fdac9[_0x80b6('0x23')]],'as':_0x2fdac9['as'],'attributes':_0x2fdac9['attributes'],'include':_0x2fdac9['include']?_['map'](_0x2fdac9[_0x80b6('0x22')],function(_0x174e5d){return{'model':db[_0x174e5d[_0x80b6('0x23')]],'as':_0x174e5d['as'],'attributes':_0x174e5d[_0x80b6('0x20')],'include':_0x174e5d[_0x80b6('0x22')]?_[_0x80b6('0x24')](_0x174e5d[_0x80b6('0x22')],function(_0x5cebd0){return{'model':db[_0x5cebd0[_0x80b6('0x23')]],'as':_0x5cebd0['as'],'attributes':_0x5cebd0[_0x80b6('0x20')]};}):[]};}):[]};}):[]:[]})[_0x80b6('0x12')](function(_0x35393c){logger[_0x80b6('0x19')]('ShowUser',_0x24d42d);logger[_0x80b6('0x25')](_0x80b6('0x26'),_0x24d42d,JSON['stringify'](_0x35393c));_0x4fcba3(_0x35393c);})['catch'](function(_0x4ef6f6){logger[_0x80b6('0x15')](_0x80b6('0x26'),_0x4ef6f6[_0x80b6('0x18')],_0x24d42d);_0x30e213(_0x5cd18f[_0x80b6('0x15')](0x1f4,_0x4ef6f6[_0x80b6('0x18')]));});});};exports[_0x80b6('0x29')]=function(_0x29dd0a){var _0x17c457=this;return new Promise(function(_0x4642f,_0x26404b){var _0x1586b7;return db[_0x80b6('0x2a')][_0x80b6('0x27')]({'where':_0x29dd0a['options'][_0x80b6('0x1f')]||{},'attributes':['id',_0x80b6('0x2b'),'role',_0x80b6('0x2c'),_0x80b6('0x2d')]})[_0x80b6('0x12')](function(_0x12d456){if(_0x12d456){_0x1586b7=_0x12d456;return db[_0x80b6('0x2e')][_0x80b6('0x2f')]({'paused':0x1},{'where':{'UserId':_0x1586b7['id']},'individualHooks':!![]});}})['then'](function(){if(_0x1586b7){return db['MemberReport']['findAll']({'where':{'membername':_0x1586b7[_0x80b6('0x2b')],'type':_0x80b6('0x30'),'exitAt':null}});}})[_0x80b6('0x12')](function(_0x3a51bc){if(_0x1586b7){if(_0x3a51bc&&_0x3a51bc[_0x80b6('0x31')]){var _0xf3e891=moment()[_0x80b6('0x32')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x29103d=0x0,_0x573296=_0x3a51bc[_0x80b6('0x31')];_0x29103d<_0x573296;_0x29103d++){_0x3a51bc[_0x29103d][_0x80b6('0x33')]({'exitAt':_0xf3e891});}}}})['then'](function(){if(_0x1586b7){var _0x258d6a=[];var _0x3aa4f7=utils[_0x80b6('0x34')]();_0x3aa4f7[_0x80b6('0x35')](function(_0x339a8f){_0x258d6a[_0x80b6('0x36')]({'channel':_0x339a8f,'membername':_0x1586b7[_0x80b6('0x2b')],'interface':_[_0x80b6('0x37')](_0x1586b7[_0x80b6('0x2d')])?util[_0x80b6('0x32')](_0x80b6('0x38'),_0x1586b7['name']):_0x1586b7['interface'],'type':_0x80b6('0x30'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x29dd0a[_0x80b6('0x39')][_0x80b6('0x3a')]||_0x80b6('0x3b'),'role':_0x1586b7[_0x80b6('0x3c')],'internal':_0x1586b7[_0x80b6('0x2c')],'uniqueid':_0x29dd0a['body'][_0x80b6('0x3d')]||null});});return db[_0x80b6('0x3e')]['bulkCreate'](_0x258d6a,{'individualHooks':!![]});}})[_0x80b6('0x12')](function(){if(_0x1586b7){return _0x1586b7[_0x80b6('0x2f')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x29dd0a['body'][_0x80b6('0x3a')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x80b6('0x32')](_0x80b6('0x3f'))});}})[_0x80b6('0x12')](function(_0x48b618){_0x4642f(_0x48b618);})[_0x80b6('0x1b')](function(_0x21bbb3){_0x26404b(_0x17c457[_0x80b6('0x15')](0x1f4,_0x21bbb3[_0x80b6('0x18')]));});});};exports['UnpauseUser']=function(_0x12ef4e){var _0x4ff1ec=this;return new Promise(function(_0x9cf10e,_0xe1d50e){var _0x1d2b55;return db[_0x80b6('0x2a')][_0x80b6('0x40')]({'where':_0x12ef4e[_0x80b6('0x1e')]['where']||{},'attributes':['id','name']})['then'](function(_0x32cdd0){if(_0x32cdd0){_0x1d2b55=_0x32cdd0;if(_0x12ef4e[_0x80b6('0x39')][_0x80b6('0x41')]&&!utils['isValidChannel'](_0x12ef4e[_0x80b6('0x39')]['channel'])){throw new Error(_0x80b6('0x42'));}switch(_0x12ef4e[_0x80b6('0x39')][_0x80b6('0x41')]){case _0x80b6('0x43'):return db[_0x80b6('0x2e')]['update']({'paused':0x0},{'where':{'UserId':_0x1d2b55['id']}})[_0x80b6('0x12')](function(){return db[_0x80b6('0x3e')][_0x80b6('0x27')]({'where':{'channel':_0x12ef4e[_0x80b6('0x39')][_0x80b6('0x41')],'membername':_0x1d2b55[_0x80b6('0x2b')],'type':_0x80b6('0x30'),'exitAt':null}});})[_0x80b6('0x12')](function(_0x2d7651){if(_0x2d7651){return _0x2d7651[_0x80b6('0x2f')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'},{'individualHooks':!![]});}return null;})['then'](function(){return _0x1d2b55[_0x80b6('0x2f')]({'voicePause':![]});});case _0x80b6('0x44'):case _0x80b6('0x45'):case'fax':case _0x80b6('0x46'):case'openchannel':case _0x80b6('0x47'):return db[_0x80b6('0x3e')][_0x80b6('0x27')]({'where':{'channel':_0x12ef4e[_0x80b6('0x39')]['channel'],'membername':_0x1d2b55[_0x80b6('0x2b')],'type':_0x80b6('0x30'),'exitAt':null}})[_0x80b6('0x12')](function(_0x378df4){return _0x378df4[_0x80b6('0x2f')]({'exitAt':moment()[_0x80b6('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x80b6('0x48')},{'individualHooks':!![]});})[_0x80b6('0x12')](function(){var _0x9b01aa={};_[_0x80b6('0x49')](_0x9b01aa,util[_0x80b6('0x32')](_0x80b6('0x4a'),_0x12ef4e[_0x80b6('0x39')][_0x80b6('0x41')],_0x80b6('0x4b')),![]);return _0x1d2b55[_0x80b6('0x2f')](_0x9b01aa);});default:return db[_0x80b6('0x2e')][_0x80b6('0x2f')]({'paused':0x0},{'where':{'UserId':_0x1d2b55['id']}})[_0x80b6('0x12')](function(){return db[_0x80b6('0x3e')]['findAll']({'where':{'membername':_0x1d2b55['name'],'type':_0x80b6('0x30'),'exitAt':null}});})['then'](function(_0x2a3cfe){var _0x90182b=[];_0x2a3cfe['forEach'](function(_0x3b747e){_0x90182b[_0x80b6('0x36')](_0x3b747e[_0x80b6('0x2f')]({'exitAt':moment()[_0x80b6('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x80b6('0x48')}));});return BPromise['all'](_0x90182b);})[_0x80b6('0x12')](function(){return _0x1d2b55[_0x80b6('0x2f')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x80b6('0x12')](function(_0x1b450c){_0x9cf10e(_0x1b450c);})['catch'](function(_0x2d6ede){_0xe1d50e(_0x4ff1ec[_0x80b6('0x15')](0x1f4,_0x2d6ede[_0x80b6('0x18')]));});});};exports[_0x80b6('0x4c')]=function(_0x426337){var _0x5ce158=this;return new Promise(function(_0x3922e0,_0x2c56df){var _0x3ecd26;return db[_0x80b6('0x2a')]['findOne']({'where':_0x426337['options'][_0x80b6('0x1f')]||{},'attributes':['id',_0x80b6('0x2b')]})['then'](function(_0xeebbfa){if(_0xeebbfa){_0x3ecd26=_0xeebbfa;return db['UserVoiceQueueRt'][_0x80b6('0x4d')]({'where':{'membername':_0x3ecd26[_0x80b6('0x2b')]},'individualHooks':!![]});}})[_0x80b6('0x12')](function(){if(_0x3ecd26){return db[_0x80b6('0x3e')][_0x80b6('0x1d')]({'where':{'membername':_0x3ecd26[_0x80b6('0x2b')],'exitAt':null}});}})[_0x80b6('0x12')](function(_0x162efb){if(_0x3ecd26){if(_0x162efb&&_0x162efb['length']){var _0xc0f261=[];_0x162efb[_0x80b6('0x35')](function(_0x13bfb1){_0xc0f261['push'](_0x13bfb1['update']({'exitAt':moment()['format'](_0x80b6('0x3f'))}));});return BPromise[_0x80b6('0x4e')](_0xc0f261);}}})[_0x80b6('0x12')](function(){if(_0x3ecd26){return _0x3ecd26['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x80b6('0x12')](function(_0x28a965){_0x3922e0(_0x28a965);})[_0x80b6('0x1b')](function(_0x8ad8e8){_0x2c56df(_0x5ce158[_0x80b6('0x15')](0x1f4,_0x8ad8e8[_0x80b6('0x18')]));});});};exports['LoginUser']=function(_0x5c9d08){var _0x4ffda8=this;return new Promise(function(_0x38fbce,_0x232b9c){var _0x497250;var _0x5f1231;var _0x2883a5;var _0x13ba07;return db[_0x80b6('0x2a')][_0x80b6('0x40')]({'where':_0x5c9d08[_0x80b6('0x1e')][_0x80b6('0x1f')]||{},'attributes':['id',_0x80b6('0x2b'),'role','mobile',_0x80b6('0x4f'),_0x80b6('0x2c'),'loginInPause',_0x80b6('0x2d')]})[_0x80b6('0x12')](function(_0x166922){if(_0x166922){_0x497250=_0x166922;_0x13ba07=_0x5c9d08[_0x80b6('0x39')]['interface']?_0x5c9d08[_0x80b6('0x39')][_0x80b6('0x2d')]:util['format'](_0x80b6('0x38'),_0x497250['name']);return db[_0x80b6('0x2a')][_0x80b6('0x50')]({'where':{'role':_0x80b6('0x51'),'online':!![],'id':{'$ne':_0x497250['id']}}});}})[_0x80b6('0x12')](function(_0x414daf){if(_0x414daf){_0x2883a5=_0x414daf;return require(_0x80b6('0x52'))[_0x80b6('0x53')]();}})[_0x80b6('0x12')](function(_0x2710dc){if(_0x2710dc&&_0x2710dc[_0x80b6('0x54')]&&_0x2883a5>=_0x2710dc[_0x80b6('0x54')]){throw new Error(_0x80b6('0x55'));}})['then'](function(){if(_0x497250){return db[_0x80b6('0x2e')][_0x80b6('0x4d')]({'where':{'membername':_0x497250['name']},'individualHooks':!![]});}})[_0x80b6('0x12')](function(){if(_0x497250){return _0x497250[_0x80b6('0x56')]({'raw':!![]});}})[_0x80b6('0x12')](function(_0x2cf3db){if(_0x497250){if(_0x2cf3db){var _0x1c0de5=[];_0x5f1231=_0x2cf3db;if(_0x5f1231[_0x80b6('0x31')]){for(var _0x1f2402=0x0;_0x1f2402<_0x5f1231[_0x80b6('0x31')];_0x1f2402++){_0x1c0de5[_0x80b6('0x36')](db['UserVoiceQueueRt'][_0x80b6('0x57')]({'membername':_0x497250[_0x80b6('0x2b')],'UserId':_0x497250['id'],'queue_name':_0x5f1231[_0x1f2402][_0x80b6('0x2b')],'VoiceQueueId':_0x5f1231[_0x1f2402]['id'],'interface':_0x13ba07,'paused':_0x497250[_0x80b6('0x58')]||![],'penalty':_0x5f1231[_0x1f2402]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x80b6('0x4e')](_0x1c0de5);}}}})[_0x80b6('0x12')](function(){if(_0x497250){return db[_0x80b6('0x3e')][_0x80b6('0x1d')]({'where':{'membername':_0x497250[_0x80b6('0x2b')],'exitAt':null}});}})[_0x80b6('0x12')](function(_0x41fb65){if(_0x497250){if(_0x41fb65&&_0x41fb65[_0x80b6('0x31')]){var _0x4abec4=[];_0x41fb65[_0x80b6('0x35')](function(_0x3c6278){_0x4abec4[_0x80b6('0x36')](_0x3c6278['update']({'exitAt':moment()[_0x80b6('0x32')](_0x80b6('0x3f'))}));});return BPromise[_0x80b6('0x4e')](_0x4abec4);}}})[_0x80b6('0x12')](function(_0x5a5aed){if(_0x497250){var _0x3c59c3=[];var _0x14bc7a=[];var _0x522f59=utils['getChannels']();var _0x47f429={'membername':_0x497250[_0x80b6('0x2b')],'interface':_0x13ba07,'enterAt':moment()[_0x80b6('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x497250[_0x80b6('0x3c')],'internal':_0x497250['internal']};_0x522f59[_0x80b6('0x35')](function(_0x5478a6){_0x3c59c3[_0x80b6('0x36')](_['merge']({'channel':_0x5478a6,'type':_0x80b6('0x59'),'data1':_0x80b6('0x5a'),'data2':_0x13ba07},_0x47f429));if(_0x497250['loginInPause']){_0x14bc7a[_0x80b6('0x36')](_['merge']({'channel':_0x5478a6,'type':_0x80b6('0x30'),'data1':'LOGININPAUSE'},_0x47f429));}});return db['MemberReport'][_0x80b6('0x5b')](_0x3c59c3['concat'](_0x14bc7a),{'individualHooks':!![]});}})[_0x80b6('0x12')](function(){if(_0x497250){return _0x497250[_0x80b6('0x2f')]({'online':!![],'lastLoginAt':moment()[_0x80b6('0x32')](_0x80b6('0x3f')),'voicePause':_0x497250[_0x80b6('0x58')]||![],'mailPause':_0x497250['loginInPause']||![],'chatPause':_0x497250[_0x80b6('0x58')]||![],'faxPause':_0x497250[_0x80b6('0x58')]||![],'smsPause':_0x497250['loginInPause']||![],'openchannelPause':_0x497250[_0x80b6('0x58')]||![],'pauseType':_0x497250[_0x80b6('0x58')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x80b6('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x13ba07});}})[_0x80b6('0x12')](function(_0x17240c){_0x38fbce(_0x17240c);})[_0x80b6('0x1b')](function(_0x41f7a6){_0x232b9c(_0x4ffda8[_0x80b6('0x15')](0x1f4,_0x41f7a6[_0x80b6('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 7d8c56f..cd08a43 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 _0xedb9=['length','remove','update','emit','register'];(function(_0x324e1d,_0x518d44){var _0x5d0dd3=function(_0x390188){while(--_0x390188){_0x324e1d['push'](_0x324e1d['shift']());}};_0x5d0dd3(++_0x518d44);}(_0xedb9,0x79));var _0x9edb=function(_0x1e40be,_0xf28ffc){_0x1e40be=_0x1e40be-0x0;var _0x403aa7=_0xedb9[_0x1e40be];return _0x403aa7;};'use strict';var UserEvents=require('./user.events');var events=['save',_0x9edb('0x0'),_0x9edb('0x1')];function createListener(_0x235cd0,_0x23119d){return function(_0x5bad79){_0x23119d[_0x9edb('0x2')](_0x235cd0,_0x5bad79);};}function removeListener(_0x549633,_0x4e6085){return function(){UserEvents['removeListener'](_0x549633,_0x4e6085);};}exports[_0x9edb('0x3')]=function(_0x572315){for(var _0x5c6846=0x0,_0x1c3f8f=events[_0x9edb('0x4')];_0x5c6846<_0x1c3f8f;_0x5c6846++){var _0x4bc4ed=events[_0x5c6846];var _0x59f658=createListener('user:'+_0x4bc4ed,_0x572315);UserEvents['on'](_0x4bc4ed,_0x59f658);}}; \ No newline at end of file +var _0xf3b2=['length','user:','./user.events','remove','update','register'];(function(_0xe30e17,_0xce02be){var _0x2342c9=function(_0x20b733){while(--_0x20b733){_0xe30e17['push'](_0xe30e17['shift']());}};_0x2342c9(++_0xce02be);}(_0xf3b2,0xe6));var _0x2f3b=function(_0x437b02,_0x34b630){_0x437b02=_0x437b02-0x0;var _0xf8c681=_0xf3b2[_0x437b02];return _0xf8c681;};'use strict';var UserEvents=require(_0x2f3b('0x0'));var events=['save',_0x2f3b('0x1'),_0x2f3b('0x2')];function createListener(_0x1fd0cb,_0x1bf7cf){return function(_0x46203f){_0x1bf7cf['emit'](_0x1fd0cb,_0x46203f);};}function removeListener(_0x3c0305,_0x267eae){return function(){UserEvents['removeListener'](_0x3c0305,_0x267eae);};}exports[_0x2f3b('0x3')]=function(_0x443c30){for(var _0x4160e9=0x0,_0x36c660=events[_0x2f3b('0x4')];_0x4160e9<_0x36c660;_0x4160e9++){var _0x228c5c=events[_0x4160e9];var _0x44589d=createListener(_0x2f3b('0x5')+_0x228c5c,_0x443c30);UserEvents['on'](_0x228c5c,_0x44589d);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 0f05778..126e189 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x59e854,_0x208b61){var _0x221e47=function(_0x45a221){while(--_0x45a221){_0x59e854['push'](_0x59e854['shift']());}};_0x221e47(++_0x208b61);}(_0x70e0,0x17b));var _0x070e=function(_0x3cb26d,_0x4baca6){_0x3cb26d=_0x3cb26d-0x0;var _0x5c94cc=_0x70e0[_0x3cb26d];return _0x5c94cc;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x12cc37,_0x25089a){var _0x6b31b7=function(_0x4ce45b){while(--_0x4ce45b){_0x12cc37['push'](_0x12cc37['shift']());}};_0x6b31b7(++_0x25089a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x623e7,_0x1bef7d){_0x623e7=_0x623e7-0x0;var _0x121131=_0xcb91[_0x623e7];return _0x121131;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 077facc..6fa4730 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 _0x618f=['sequelize','exports','INTEGER'];(function(_0x50fb34,_0x56b847){var _0x478797=function(_0x2a45df){while(--_0x2a45df){_0x50fb34['push'](_0x50fb34['shift']());}};_0x478797(++_0x56b847);}(_0x618f,0x1d4));var _0xf618=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x618f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf618('0x0'));module[_0xf618('0x1')]={'penalty':{'type':Sequelize[_0xf618('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xdde1=['sequelize','exports'];(function(_0x30349d,_0x588eb5){var _0x4a43c6=function(_0xcbdee0){while(--_0xcbdee0){_0x30349d['push'](_0x30349d['shift']());}};_0x4a43c6(++_0x588eb5);}(_0xdde1,0x14a));var _0x1dde=function(_0x3f8647,_0x39c233){_0x3f8647=_0x3f8647-0x0;var _0x39d095=_0xdde1[_0x3f8647];return _0x39d095;};'use strict';var Sequelize=require(_0x1dde('0x0'));module[_0x1dde('0x1')]={'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 465fa2e..a62a559 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 _0x707c=['request-promise','rimraf','exports','define','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','api','moment','bluebird'];(function(_0x32f05c,_0x273aef){var _0x4307ed=function(_0x1be4da){while(--_0x1be4da){_0x32f05c['push'](_0x32f05c['shift']());}};_0x4307ed(++_0x273aef);}(_0x707c,0x145));var _0xc707=function(_0x6d6a66,_0x2924af){_0x6d6a66=_0x6d6a66-0x0;var _0x11eb6e=_0x707c[_0x6d6a66];return _0x11eb6e;};'use strict';var _=require(_0xc707('0x0'));var util=require('util');var logger=require(_0xc707('0x1'))(_0xc707('0x2'));var moment=require(_0xc707('0x3'));var BPromise=require(_0xc707('0x4'));var rp=require(_0xc707('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc707('0x6'));var config=require('../../config/environment');var attributes=require('./userChatQueue.attributes');module[_0xc707('0x7')]=function(_0x289070,_0x31d936){return _0x289070[_0xc707('0x8')](_0xc707('0x9'),attributes,{'tableName':_0xc707('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x16b5=['UserChatQueue','lodash','../../config/logger','moment','path','rimraf','../../config/environment','exports','define'];(function(_0x4e1aff,_0x26ba8f){var _0x5e0928=function(_0x5707ed){while(--_0x5707ed){_0x4e1aff['push'](_0x4e1aff['shift']());}};_0x5e0928(++_0x26ba8f);}(_0x16b5,0x13c));var _0x516b=function(_0x1c71a6,_0x4ab9ae){_0x1c71a6=_0x1c71a6-0x0;var _0x34baf9=_0x16b5[_0x1c71a6];return _0x34baf9;};'use strict';var _=require(_0x516b('0x0'));var util=require('util');var logger=require(_0x516b('0x1'))('api');var moment=require(_0x516b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x516b('0x3'));var rimraf=require(_0x516b('0x4'));var config=require(_0x516b('0x5'));var attributes=require('./userChatQueue.attributes');module[_0x516b('0x6')]=function(_0x3bb6f6,_0x4c0312){return _0x3bb6f6[_0x516b('0x7')](_0x516b('0x8'),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 bd624f9..3a6cde9 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 _0xf727=['UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','UserChatQueue,\x20%s,\x20%s','debug'];(function(_0x367e31,_0x65764c){var _0x4d6e4f=function(_0x3fb842){while(--_0x3fb842){_0x367e31['push'](_0x367e31['shift']());}};_0x4d6e4f(++_0x65764c);}(_0xf727,0xd8));var _0x7f72=function(_0x2647f5,_0x7973a0){_0x2647f5=_0x2647f5-0x0;var _0x293a70=_0xf727[_0x2647f5];return _0x293a70;};'use strict';var _=require(_0x7f72('0x0'));var util=require(_0x7f72('0x1'));var moment=require(_0x7f72('0x2'));var BPromise=require(_0x7f72('0x3'));var rs=require(_0x7f72('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7f72('0x5'))['db'];var utils=require(_0x7f72('0x6'));var logger=require(_0x7f72('0x7'))('rpc');var config=require(_0x7f72('0x8'));var jayson=require(_0x7f72('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x45ee63,_0xd55e3f,_0x3cf4f0){return new BPromise(function(_0xdf136,_0x34fc3c){return client[_0x7f72('0xa')](_0x45ee63,_0x3cf4f0)[_0x7f72('0xb')](function(_0x3156cc){logger[_0x7f72('0xc')](_0x7f72('0xd'),_0xd55e3f,'request\x20sent');logger[_0x7f72('0xe')](_0x7f72('0xf'),_0xd55e3f,'request\x20sent',JSON['stringify'](_0x3156cc));if(_0x3156cc[_0x7f72('0x10')]){if(_0x3156cc['error'][_0x7f72('0x11')]===0x1f4){logger[_0x7f72('0x10')]('UserChatQueue,\x20%s,\x20%s',_0xd55e3f,_0x3156cc[_0x7f72('0x10')][_0x7f72('0x12')]);return _0x34fc3c(_0x3156cc[_0x7f72('0x10')]['message']);}logger[_0x7f72('0x10')](_0x7f72('0xd'),_0xd55e3f,_0x3156cc[_0x7f72('0x10')]['message']);return _0xdf136(_0x3156cc['error'][_0x7f72('0x12')]);}else{logger[_0x7f72('0xc')](_0x7f72('0xd'),_0xd55e3f,_0x7f72('0x13'));_0xdf136(_0x3156cc['result'][_0x7f72('0x12')]);}})[_0x7f72('0x14')](function(_0x4144dd){logger[_0x7f72('0x10')](_0x7f72('0xd'),_0xd55e3f,_0x4144dd);_0x34fc3c(_0x4144dd);});});} \ No newline at end of file +var _0x5fe9=['then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0xc03ae3,_0x24df29){var _0x5b3a60=function(_0x133416){while(--_0x133416){_0xc03ae3['push'](_0xc03ae3['shift']());}};_0x5b3a60(++_0x24df29);}(_0x5fe9,0xff));var _0x95fe=function(_0x35b177,_0x8a669e){_0x35b177=_0x35b177-0x0;var _0x792f7b=_0x5fe9[_0x35b177];return _0x792f7b;};'use strict';var _=require(_0x95fe('0x0'));var util=require(_0x95fe('0x1'));var moment=require(_0x95fe('0x2'));var BPromise=require(_0x95fe('0x3'));var rs=require(_0x95fe('0x4'));var fs=require('fs');var Redis=require(_0x95fe('0x5'));var db=require(_0x95fe('0x6'))['db'];var utils=require(_0x95fe('0x7'));var logger=require(_0x95fe('0x8'))(_0x95fe('0x9'));var config=require(_0x95fe('0xa'));var jayson=require(_0x95fe('0xb'));var client=jayson[_0x95fe('0xc')][_0x95fe('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x598f22,_0xe1ce2f,_0x1e96e3){return new BPromise(function(_0xc16eb5,_0x2c0743){return client[_0x95fe('0xe')](_0x598f22,_0x1e96e3)[_0x95fe('0xf')](function(_0x53d476){logger[_0x95fe('0x10')](_0x95fe('0x11'),_0xe1ce2f,_0x95fe('0x12'));logger[_0x95fe('0x13')](_0x95fe('0x14'),_0xe1ce2f,_0x95fe('0x12'),JSON[_0x95fe('0x15')](_0x53d476));if(_0x53d476[_0x95fe('0x16')]){if(_0x53d476[_0x95fe('0x16')][_0x95fe('0x17')]===0x1f4){logger[_0x95fe('0x16')]('UserChatQueue,\x20%s,\x20%s',_0xe1ce2f,_0x53d476[_0x95fe('0x16')][_0x95fe('0x18')]);return _0x2c0743(_0x53d476[_0x95fe('0x16')][_0x95fe('0x18')]);}logger[_0x95fe('0x16')](_0x95fe('0x11'),_0xe1ce2f,_0x53d476[_0x95fe('0x16')]['message']);return _0xc16eb5(_0x53d476[_0x95fe('0x16')]['message']);}else{logger['info'](_0x95fe('0x11'),_0xe1ce2f,_0x95fe('0x12'));_0xc16eb5(_0x53d476[_0x95fe('0x19')][_0x95fe('0x18')]);}})[_0x95fe('0x1a')](function(_0xd0bbc9){logger[_0x95fe('0x16')]('UserChatQueue,\x20%s,\x20%s',_0xe1ce2f,_0xd0bbc9);_0x2c0743(_0xd0bbc9);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 32b2eca..54b3617 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(_0x176ae9,_0x436b7d){var _0x2b5cbd=function(_0x59e7f4){while(--_0x59e7f4){_0x176ae9['push'](_0x176ae9['shift']());}};_0x2b5cbd(++_0x436b7d);}(_0x70e0,0x17b));var _0x070e=function(_0x39fd7e,_0x10993d){_0x39fd7e=_0x39fd7e-0x0;var _0x514d57=_0x70e0[_0x39fd7e];return _0x514d57;};'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(_0x252918,_0x1b3f96){var _0x2a276b=function(_0x4c10e5){while(--_0x4c10e5){_0x252918['push'](_0x252918['shift']());}};_0x2a276b(++_0x1b3f96);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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 d155b82..cdf8c96 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 _0x2d69=['INTEGER','sequelize','exports'];(function(_0x380501,_0x3babe6){var _0x1950d1=function(_0xc57c93){while(--_0xc57c93){_0x380501['push'](_0x380501['shift']());}};_0x1950d1(++_0x3babe6);}(_0x2d69,0x10f));var _0x92d6=function(_0x26da06,_0x44caa0){_0x26da06=_0x26da06-0x0;var _0x30d5a0=_0x2d69[_0x26da06];return _0x30d5a0;};'use strict';var Sequelize=require(_0x92d6('0x0'));module[_0x92d6('0x1')]={'penalty':{'type':Sequelize[_0x92d6('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x92d6('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7590=['STRING','exports','INTEGER'];(function(_0x1758b4,_0xc55a2b){var _0x3eae47=function(_0x362c99){while(--_0x362c99){_0x1758b4['push'](_0x1758b4['shift']());}};_0x3eae47(++_0xc55a2b);}(_0x7590,0x1bd));var _0x0759=function(_0x2bac49,_0x3ae389){_0x2bac49=_0x2bac49-0x0;var _0x183acc=_0x7590[_0x2bac49];return _0x183acc;};'use strict';var Sequelize=require('sequelize');module[_0x0759('0x0')]={'penalty':{'type':Sequelize[_0x0759('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x0759('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x0759('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 4a4d74d..31a22e3 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 _0xd14b=['exports','define','UserFaxQueue','user_has_fax_queues','api','moment','bluebird','path','rimraf','../../config/environment','./userFaxQueue.attributes'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0xd14b,0x1d2));var _0xbd14=function(_0x6d7060,_0x119c08){_0x6d7060=_0x6d7060-0x0;var _0x195046=_0xd14b[_0x6d7060];return _0x195046;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xbd14('0x0'));var moment=require(_0xbd14('0x1'));var BPromise=require(_0xbd14('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd14('0x3'));var rimraf=require(_0xbd14('0x4'));var config=require(_0xbd14('0x5'));var attributes=require(_0xbd14('0x6'));module[_0xbd14('0x7')]=function(_0x510b24,_0x2f8d9d){return _0x510b24[_0xbd14('0x8')](_0xbd14('0x9'),attributes,{'tableName':_0xbd14('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d6e=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','user_has_fax_queues','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2d6e,0x128));var _0xe2d6=function(_0x1b5320,_0x388d85){_0x1b5320=_0x1b5320-0x0;var _0x404bf=_0x2d6e[_0x1b5320];return _0x404bf;};'use strict';var _=require(_0xe2d6('0x0'));var util=require(_0xe2d6('0x1'));var logger=require('../../config/logger')(_0xe2d6('0x2'));var moment=require('moment');var BPromise=require(_0xe2d6('0x3'));var rp=require(_0xe2d6('0x4'));var fs=require('fs');var path=require(_0xe2d6('0x5'));var rimraf=require(_0xe2d6('0x6'));var config=require(_0xe2d6('0x7'));var attributes=require('./userFaxQueue.attributes');module[_0xe2d6('0x8')]=function(_0xafdfcd,_0x365d0d){return _0xafdfcd[_0xe2d6('0x9')]('UserFaxQueue',attributes,{'tableName':_0xe2d6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 12aea5f..8797e07 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 _0x79c6=['request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserFaxQueue,\x20%s,\x20%s'];(function(_0x597cd7,_0x27ba86){var _0x5d3528=function(_0x452f1b){while(--_0x452f1b){_0x597cd7['push'](_0x597cd7['shift']());}};_0x5d3528(++_0x27ba86);}(_0x79c6,0x11b));var _0x679c=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0x79c6[_0x25d386];return _0x857f4a;};'use strict';var _=require(_0x679c('0x0'));var util=require(_0x679c('0x1'));var moment=require(_0x679c('0x2'));var BPromise=require(_0x679c('0x3'));var rs=require(_0x679c('0x4'));var fs=require('fs');var Redis=require(_0x679c('0x5'));var db=require(_0x679c('0x6'))['db'];var utils=require(_0x679c('0x7'));var logger=require(_0x679c('0x8'))(_0x679c('0x9'));var config=require(_0x679c('0xa'));var jayson=require(_0x679c('0xb'));var client=jayson['client'][_0x679c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xcadc57,_0x3330be,_0x1e1ec8){return new BPromise(function(_0x120e06,_0x598587){return client[_0x679c('0xd')](_0xcadc57,_0x1e1ec8)[_0x679c('0xe')](function(_0x2e67f9){logger[_0x679c('0xf')](_0x679c('0x10'),_0x3330be,_0x679c('0x11'));logger[_0x679c('0x12')](_0x679c('0x13'),_0x3330be,'request\x20sent',JSON[_0x679c('0x14')](_0x2e67f9));if(_0x2e67f9[_0x679c('0x15')]){if(_0x2e67f9[_0x679c('0x15')]['code']===0x1f4){logger[_0x679c('0x15')]('UserFaxQueue,\x20%s,\x20%s',_0x3330be,_0x2e67f9[_0x679c('0x15')][_0x679c('0x16')]);return _0x598587(_0x2e67f9[_0x679c('0x15')]['message']);}logger[_0x679c('0x15')](_0x679c('0x10'),_0x3330be,_0x2e67f9[_0x679c('0x15')]['message']);return _0x120e06(_0x2e67f9[_0x679c('0x15')]['message']);}else{logger[_0x679c('0xf')]('UserFaxQueue,\x20%s,\x20%s',_0x3330be,_0x679c('0x11'));_0x120e06(_0x2e67f9[_0x679c('0x17')][_0x679c('0x16')]);}})[_0x679c('0x18')](function(_0x23abd5){logger[_0x679c('0x15')](_0x679c('0x10'),_0x3330be,_0x23abd5);_0x598587(_0x23abd5);});});} \ No newline at end of file +var _0xc02f=['http','request','info','request\x20sent','stringify','error','code','UserFaxQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x3ed35f,_0x1a352e){var _0x5d247e=function(_0x200385){while(--_0x200385){_0x3ed35f['push'](_0x3ed35f['shift']());}};_0x5d247e(++_0x1a352e);}(_0xc02f,0x199));var _0xfc02=function(_0x36d785,_0x21903e){_0x36d785=_0x36d785-0x0;var _0x5446e1=_0xc02f[_0x36d785];return _0x5446e1;};'use strict';var _=require(_0xfc02('0x0'));var util=require(_0xfc02('0x1'));var moment=require(_0xfc02('0x2'));var BPromise=require(_0xfc02('0x3'));var rs=require(_0xfc02('0x4'));var fs=require('fs');var Redis=require(_0xfc02('0x5'));var db=require(_0xfc02('0x6'))['db'];var utils=require(_0xfc02('0x7'));var logger=require(_0xfc02('0x8'))(_0xfc02('0x9'));var config=require('../../config/environment');var jayson=require(_0xfc02('0xa'));var client=jayson['client'][_0xfc02('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xdc36af,_0xcfeb1e,_0x5e67bd){return new BPromise(function(_0x5649df,_0x49c92d){return client[_0xfc02('0xc')](_0xdc36af,_0x5e67bd)['then'](function(_0x5c5ef4){logger[_0xfc02('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0xcfeb1e,_0xfc02('0xe'));logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0xcfeb1e,_0xfc02('0xe'),JSON[_0xfc02('0xf')](_0x5c5ef4));if(_0x5c5ef4[_0xfc02('0x10')]){if(_0x5c5ef4['error'][_0xfc02('0x11')]===0x1f4){logger[_0xfc02('0x10')](_0xfc02('0x12'),_0xcfeb1e,_0x5c5ef4[_0xfc02('0x10')][_0xfc02('0x13')]);return _0x49c92d(_0x5c5ef4[_0xfc02('0x10')][_0xfc02('0x13')]);}logger[_0xfc02('0x10')](_0xfc02('0x12'),_0xcfeb1e,_0x5c5ef4['error'][_0xfc02('0x13')]);return _0x5649df(_0x5c5ef4[_0xfc02('0x10')]['message']);}else{logger[_0xfc02('0xd')](_0xfc02('0x12'),_0xcfeb1e,'request\x20sent');_0x5649df(_0x5c5ef4['result'][_0xfc02('0x13')]);}})[_0xfc02('0x14')](function(_0x2a47c8){logger['error'](_0xfc02('0x12'),_0xcfeb1e,_0x2a47c8);_0x49c92d(_0x2a47c8);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index e7442a6..bf4fd81 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x24ac6d,_0x38be3f){var _0x3e0dc6=function(_0x368a4b){while(--_0x368a4b){_0x24ac6d['push'](_0x24ac6d['shift']());}};_0x3e0dc6(++_0x38be3f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x95411e,_0x38b4c3){_0x95411e=_0x95411e-0x0;var _0x2c8718=_0xcb91[_0x95411e];return _0x2c8718;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4a3347,_0x310c25){var _0x3425fc=function(_0x54c09f){while(--_0x54c09f){_0x4a3347['push'](_0x4a3347['shift']());}};_0x3425fc(++_0x310c25);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 35155df..95e6a13 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 _0xf1e9=['INTEGER','sequelize'];(function(_0x385ea2,_0x19738e){var _0x41de5c=function(_0x5deb74){while(--_0x5deb74){_0x385ea2['push'](_0x385ea2['shift']());}};_0x41de5c(++_0x19738e);}(_0xf1e9,0xc3));var _0x9f1e=function(_0x3453bb,_0x924dfc){_0x3453bb=_0x3453bb-0x0;var _0x48726d=_0xf1e9[_0x3453bb];return _0x48726d;};'use strict';var Sequelize=require(_0x9f1e('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x9f1e('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc7ae=['sequelize','INTEGER'];(function(_0x551e24,_0x117d02){var _0x4913a7=function(_0x17ab62){while(--_0x17ab62){_0x551e24['push'](_0x551e24['shift']());}};_0x4913a7(++_0x117d02);}(_0xc7ae,0x84));var _0xec7a=function(_0x1073bc,_0x2a4ec3){_0x1073bc=_0x1073bc-0x0;var _0x4e1015=_0xc7ae[_0x1073bc];return _0x4e1015;};'use strict';var Sequelize=require(_0xec7a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xec7a('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index c654de2..87ed99e 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 _0x36fb=['bluebird','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','util','moment'];(function(_0xfcf5f4,_0x414890){var _0x2aea1c=function(_0xe57313){while(--_0xe57313){_0xfcf5f4['push'](_0xfcf5f4['shift']());}};_0x2aea1c(++_0x414890);}(_0x36fb,0x69));var _0xb36f=function(_0x52d72b,_0x1604c4){_0x52d72b=_0x52d72b-0x0;var _0x547c18=_0x36fb[_0x52d72b];return _0x547c18;};'use strict';var _=require(_0xb36f('0x0'));var util=require(_0xb36f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb36f('0x2'));var BPromise=require(_0xb36f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb36f('0x4'));var rimraf=require(_0xb36f('0x5'));var config=require(_0xb36f('0x6'));var attributes=require(_0xb36f('0x7'));module[_0xb36f('0x8')]=function(_0x541579,_0x2e7e93){return _0x541579[_0xb36f('0x9')](_0xb36f('0xa'),attributes,{'tableName':_0xb36f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x818b=['request-promise','path','rimraf','../../config/environment','define','UserMailQueue','lodash','../../config/logger','api','moment','bluebird'];(function(_0x5e8b8d,_0x1d36ca){var _0x1e8a61=function(_0x2f5d05){while(--_0x2f5d05){_0x5e8b8d['push'](_0x5e8b8d['shift']());}};_0x1e8a61(++_0x1d36ca);}(_0x818b,0x166));var _0xb818=function(_0x36e653,_0x5cba31){_0x36e653=_0x36e653-0x0;var _0x447e4a=_0x818b[_0x36e653];return _0x447e4a;};'use strict';var _=require(_0xb818('0x0'));var util=require('util');var logger=require(_0xb818('0x1'))(_0xb818('0x2'));var moment=require(_0xb818('0x3'));var BPromise=require(_0xb818('0x4'));var rp=require(_0xb818('0x5'));var fs=require('fs');var path=require(_0xb818('0x6'));var rimraf=require(_0xb818('0x7'));var config=require(_0xb818('0x8'));var attributes=require('./userMailQueue.attributes');module['exports']=function(_0x7a615e,_0x3b34c0){return _0x7a615e[_0xb818('0x9')](_0xb818('0xa'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 48d374a..8175c31 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 _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2c0852,_0x5dfe0d){_0x2c0852=_0x2c0852-0x0;var _0x223d5f=_0x1cb9[_0x2c0852];return _0x223d5f;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('UserMailQueue,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file +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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x008c,0x188));var _0xc008=function(_0x23bca9,_0x590fef){_0x23bca9=_0x23bca9-0x0;var _0x5eb135=_0x008c[_0x23bca9];return _0x5eb135;};'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 cdc4ee3..92fba12 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 _0x1691=['../../components/auth/service','../../components/interaction/service','./userNotification.controller','post','isAuthenticated','sendUserNotification','multer','express','fs-extra'];(function(_0x3cf080,_0x5e475f){var _0x1fac5f=function(_0x430849){while(--_0x430849){_0x3cf080['push'](_0x3cf080['shift']());}};_0x1fac5f(++_0x5e475f);}(_0x1691,0x189));var _0x1169=function(_0x354400,_0x1ee91b){_0x354400=_0x354400-0x0;var _0x647716=_0x1691[_0x354400];return _0x647716;};'use strict';var multer=require(_0x1169('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1169('0x1'));var router=express['Router']();var fs_extra=require(_0x1169('0x2'));var auth=require(_0x1169('0x3'));var interaction=require(_0x1169('0x4'));var config=require('../../config/environment');var controller=require(_0x1169('0x5'));router[_0x1169('0x6')]('/',auth[_0x1169('0x7')](),controller[_0x1169('0x8')]);module['exports']=router; \ No newline at end of file +var _0xb305=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports'];(function(_0x45c4b5,_0x178bca){var _0x46480a=function(_0x2bc5a2){while(--_0x2bc5a2){_0x45c4b5['push'](_0x45c4b5['shift']());}};_0x46480a(++_0x178bca);}(_0xb305,0x1a4));var _0x5b30=function(_0x4b64a4,_0x1bdc50){_0x4b64a4=_0x4b64a4-0x0;var _0xd19b0e=_0xb305[_0x4b64a4];return _0xd19b0e;};'use strict';var multer=require(_0x5b30('0x0'));var util=require(_0x5b30('0x1'));var path=require(_0x5b30('0x2'));var timeout=require(_0x5b30('0x3'));var express=require(_0x5b30('0x4'));var router=express[_0x5b30('0x5')]();var fs_extra=require(_0x5b30('0x6'));var auth=require(_0x5b30('0x7'));var interaction=require(_0x5b30('0x8'));var config=require(_0x5b30('0x9'));var controller=require(_0x5b30('0xa'));router[_0x5b30('0xb')]('/',auth[_0x5b30('0xc')](),controller[_0x5b30('0xd')]);module[_0x5b30('0xe')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 4607bfd..f9a4e33 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 _0x26b1=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x26b1,0x78));var _0x126b=function(_0x5ec6d7,_0x1d3878){_0x5ec6d7=_0x5ec6d7-0x0;var _0x503fb3=_0x26b1[_0x5ec6d7];return _0x503fb3;};'use strict';var Sequelize=require(_0x126b('0x0'));module[_0x126b('0x1')]={'body':{'type':Sequelize[_0x126b('0x2')]},'senderName':{'type':Sequelize[_0x126b('0x3')]},'recipientsId':{'type':Sequelize[_0x126b('0x2')]},'recipientsDescription':{'type':Sequelize[_0x126b('0x3')]},'beep':{'type':Sequelize[_0x126b('0x4')]}}; \ No newline at end of file +var _0x0a57=['TEXT','STRING','BOOLEAN','sequelize'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x0a57,0x12f));var _0x70a5=function(_0x3b846e,_0x371cdd){_0x3b846e=_0x3b846e-0x0;var _0x45b489=_0x0a57[_0x3b846e];return _0x45b489;};'use strict';var Sequelize=require(_0x70a5('0x0'));module['exports']={'body':{'type':Sequelize[_0x70a5('0x1')]},'senderName':{'type':Sequelize[_0x70a5('0x2')]},'recipientsId':{'type':Sequelize[_0x70a5('0x1')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x70a5('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index c3b8e51..e5c4418 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 _0x19ce=['transaction','create','forEach','emit','userNotification:send','text','findOne','html','TemplateId','Invalid\x20\x27TemplateId\x27\x20parameter','view','startCase','User','union','includes','queue','Queue','ids','push','all','catch','getAgents','map','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','count','limit','set','apply','reject','save','update','then','destroy','error','stack','send','body','hasOwnProperty','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','openchannelqueue','smsqueue','team','user','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','recipientsId','sortBy','join'];(function(_0x5169e7,_0x1a1b1f){var _0x10881b=function(_0x4c1885){while(--_0x4c1885){_0x5169e7['push'](_0x5169e7['shift']());}};_0x10881b(++_0x1a1b1f);}(_0x19ce,0x78));var _0xe19c=function(_0x12f77d,_0x2b165e){_0x12f77d=_0x12f77d-0x0;var _0x1e11ab=_0x19ce[_0x12f77d];return _0x1e11ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe19c('0x0'));var zipdir=require(_0xe19c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe19c('0x2'));var moment=require(_0xe19c('0x3'));var BPromise=require(_0xe19c('0x4'));var Mustache=require(_0xe19c('0x5'));var util=require(_0xe19c('0x6'));var path=require(_0xe19c('0x7'));var sox=require('sox');var csv=require(_0xe19c('0x8'));var ejs=require(_0xe19c('0x9'));var fs=require('fs');var fs_extra=require(_0xe19c('0xa'));var _=require(_0xe19c('0xb'));var squel=require(_0xe19c('0xc'));var crypto=require(_0xe19c('0xd'));var jsforce=require(_0xe19c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe19c('0x8'));var querystring=require(_0xe19c('0xf'));var Papa=require(_0xe19c('0x10'));var Redis=require(_0xe19c('0x11'));var authService=require(_0xe19c('0x12'));var qs=require(_0xe19c('0x13'));var as=require(_0xe19c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe19c('0x15'));var utils=require(_0xe19c('0x16'));var config=require(_0xe19c('0x17'));var licenseUtil=require(_0xe19c('0x18'));var db=require(_0xe19c('0x19'))['db'];config[_0xe19c('0x1a')]=_['defaults'](config[_0xe19c('0x1a')],{'host':_0xe19c('0x1b'),'port':0x18eb});var socket=require(_0xe19c('0x1c'))(new Redis(config[_0xe19c('0x1a')]));require('./userNotification.socket')['register'](socket);function respondWithStatusCode(_0x45a0ba,_0x42dc7e){_0x42dc7e=_0x42dc7e||0xcc;return function(_0x50a4bc){if(_0x50a4bc){return _0x45a0ba[_0xe19c('0x1d')](_0x42dc7e);}return _0x45a0ba[_0xe19c('0x1e')](_0x42dc7e)[_0xe19c('0x1f')]();};}function respondWithResult(_0x4d8c6f,_0x230c2d){_0x230c2d=_0x230c2d||0xc8;return function(_0x10b0bb){if(_0x10b0bb){return _0x4d8c6f[_0xe19c('0x1e')](_0x230c2d)[_0xe19c('0x20')](_0x10b0bb);}};}function respondWithFilteredResult(_0x8130f0,_0x98f5eb){return function(_0x291624){if(_0x291624){var _0x5b2eee=typeof _0x98f5eb[_0xe19c('0x21')]==='undefined'&&typeof _0x98f5eb['limit']==='undefined';var _0x16bd1c=_0x291624[_0xe19c('0x22')];var _0x42829e=_0x5b2eee?0x0:_0x98f5eb[_0xe19c('0x21')];var _0x3513ef=_0x5b2eee?_0x291624[_0xe19c('0x22')]:_0x98f5eb['offset']+_0x98f5eb[_0xe19c('0x23')];var _0x2bfc5d;if(_0x3513ef>=_0x16bd1c){_0x3513ef=_0x16bd1c;_0x2bfc5d=0xc8;}else{_0x2bfc5d=0xce;}_0x8130f0[_0xe19c('0x1e')](_0x2bfc5d);return _0x8130f0[_0xe19c('0x24')]('Content-Range',_0x42829e+'-'+_0x3513ef+'/'+_0x16bd1c)[_0xe19c('0x20')](_0x291624);}return null;};}function patchUpdates(_0x15619e){return function(_0x1b0264){try{jsonpatch[_0xe19c('0x25')](_0x1b0264,_0x15619e,!![]);}catch(_0x3e4ec0){return BPromise[_0xe19c('0x26')](_0x3e4ec0);}return _0x1b0264[_0xe19c('0x27')]();};}function saveUpdates(_0x55d94a,_0x497ac0){return function(_0x24eceb){if(_0x24eceb){return _0x24eceb[_0xe19c('0x28')](_0x55d94a)[_0xe19c('0x29')](function(_0x4e14df){return _0x4e14df;});}return null;};}function removeEntity(_0x44c262,_0x3fe9a6){return function(_0xa1a57e){if(_0xa1a57e){return _0xa1a57e[_0xe19c('0x2a')]()[_0xe19c('0x29')](function(){_0x44c262[_0xe19c('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b447f,_0x324eba){return function(_0x232e9e){if(!_0x232e9e){_0x4b447f['sendStatus'](0x194);}return _0x232e9e;};}function handleError(_0x242530,_0x73e72b){_0x73e72b=_0x73e72b||0x1f4;return function(_0x22bcc8){logger[_0xe19c('0x2b')](_0x22bcc8[_0xe19c('0x2c')]);if(_0x22bcc8['name']){delete _0x22bcc8['name'];}_0x242530[_0xe19c('0x1e')](_0x73e72b)[_0xe19c('0x2d')](_0x22bcc8);};}exports['sendUserNotification']=function(_0x3fbf82,_0x539a5e,_0x5e516f){if(!_0x3fbf82[_0xe19c('0x2e')][_0xe19c('0x2f')]('text')&&!_0x3fbf82['body'][_0xe19c('0x2f')]('TemplateId')){throw new db[(_0xe19c('0x30'))][(_0xe19c('0x31'))](_0xe19c('0x32'));}else{if(_0x3fbf82[_0xe19c('0x2e')][_0xe19c('0x2f')]('TemplateId')&&!_0x3fbf82[_0xe19c('0x2e')][_0xe19c('0x2f')]('view')){throw new db[(_0xe19c('0x30'))][(_0xe19c('0x31'))](_0xe19c('0x33'));}if(!_0x3fbf82[_0xe19c('0x2e')]['hasOwnProperty'](_0xe19c('0x34'))){throw new db[(_0xe19c('0x30'))][(_0xe19c('0x31'))](_0xe19c('0x35'));}else{try{var _0x1840db=JSON[_0xe19c('0x36')](_0x3fbf82[_0xe19c('0x2e')]['recipients']);}catch(_0x3eab4d){logger[_0xe19c('0x2b')](_0x3eab4d);throw new db[(_0xe19c('0x30'))][(_0xe19c('0x31'))](_0xe19c('0x37'));}var _0x48932f=['chatqueue',_0xe19c('0x38'),_0xe19c('0x39'),_0xe19c('0x3a'),_0xe19c('0x3b'),'voicequeue','whatsappqueue',_0xe19c('0x3c'),_0xe19c('0x3d')];if(_[_0xe19c('0x3e')](_0x1840db,function(_0x28c50c){return!_['includes'](_0x48932f,_0x28c50c[_0xe19c('0x3f')][_0xe19c('0x40')]());})){throw new db[(_0xe19c('0x30'))][(_0xe19c('0x31'))](_0xe19c('0x41'));}}}var _0x21a177={};_0x21a177[_0xe19c('0x42')]=_0x3fbf82[_0xe19c('0x2e')]['hasOwnProperty']('senderName')?_0x3fbf82['body'][_0xe19c('0x42')]:_0x3fbf82[_0xe19c('0x3d')][_0xe19c('0x43')];_0x21a177['recipientsDescription']=_[_0xe19c('0x44')](_0x3fbf82['body']['recipientsDescription'])?null:_0x3fbf82[_0xe19c('0x2e')][_0xe19c('0x45')];_0x21a177['beep']=_0x3fbf82[_0xe19c('0x2e')][_0xe19c('0x46')]||![];_0x21a177['SenderId']=_0x3fbf82['user']['id'];return getContent(_0x3fbf82[_0xe19c('0x2e')])[_0xe19c('0x29')](function(_0x29f5ce){_0x21a177['body']=_0x29f5ce;return getRecipients(_0x1840db);})[_0xe19c('0x29')](function(_0x30636a){_0x21a177[_0xe19c('0x47')]=_[_0xe19c('0x48')](_0x30636a)[_0xe19c('0x49')](',');return db['sequelize'][_0xe19c('0x4a')](function(_0x5e0b57){return db['UserNotification'][_0xe19c('0x4b')](_0x21a177,{'raw':!![],'transaction':_0x5e0b57})[_0xe19c('0x29')](function(_0x502561){var _0x1ec57c={'sender':_0x21a177[_0xe19c('0x42')],'description':_0x21a177['recipientsDescription'],'content':_0x21a177[_0xe19c('0x2e')],'beep':_0x21a177[_0xe19c('0x46')]};_0x30636a[_0xe19c('0x4c')](function(_0x5a05e8){_0x1ec57c['recipient']=_0x5a05e8;socket[_0xe19c('0x4d')](_0xe19c('0x4e'),_0x1ec57c);});return _0x502561;});});})[_0xe19c('0x29')](respondWithResult(_0x539a5e,0xc9))['catch'](handleError(_0x539a5e,null));};function getContent(_0x315e2c){return new BPromise(function(_0x72593c,_0x2aaf98){if(_0x315e2c[_0xe19c('0x4f')]){_0x72593c(_0x315e2c[_0xe19c('0x4f')]);return;}return db['Template'][_0xe19c('0x50')]({'attributes':[_0xe19c('0x51')],'where':{'id':_0x315e2c[_0xe19c('0x52')]},'raw':!![]})[_0xe19c('0x29')](function(_0xbdfb65){if(!_0xbdfb65)throw new db['Sequelize']['ValidationError'](_0xe19c('0x53'));var _0x4e915b=Mustache['render'](_0xbdfb65[_0xe19c('0x51')],_0x315e2c[_0xe19c('0x54')]);_0x72593c(_0x4e915b);})['catch'](function(_0x353038){_0x2aaf98(_0x353038);});});}function getRecipients(_0x742560){return new BPromise(function(_0xe765a2,_0xaa3bee){var _0x5d235b=[];var _0x752a92=[];_0x742560['forEach'](function(_0x770df5){var _0x20b802=_[_0xe19c('0x55')](_0x770df5['model']['toLowerCase']());if(_0x20b802===_0xe19c('0x56')){_0x5d235b=_[_0xe19c('0x57')](_0x5d235b,_0x770df5['ids']);}else{if(_[_0xe19c('0x58')](_0x20b802,_0xe19c('0x59')))_0x20b802=_0x20b802['replace']('queue',_0xe19c('0x5a'));_0x770df5[_0xe19c('0x5b')]['forEach'](function(_0x3e3240){_0x752a92[_0xe19c('0x5c')](getAgents(_0x20b802,_0x3e3240));});}});return BPromise[_0xe19c('0x5d')](_0x752a92)[_0xe19c('0x29')](function(_0x1e32ab){_0x5d235b=_[_0xe19c('0x57')](_0x5d235b,_['flatten'](_0x1e32ab));_0xe765a2(_0x5d235b);})[_0xe19c('0x5e')](function(_0x7576ea){_0xaa3bee(_0x7576ea);});});}function getAgents(_0x5d1aee,_0x3e04f5){return new BPromise(function(_0x2b00a7,_0x259c68){return db[_0x5d1aee][_0xe19c('0x50')]({'where':{'id':_0x3e04f5}})[_0xe19c('0x29')](function(_0x3fc7b8){return _0x3fc7b8[_0xe19c('0x5f')]({'attributes':['id'],'raw':!![]})[_0xe19c('0x29')](function(_0x338685){var _0x42a476=_[_0xe19c('0x60')](_0x338685,'id');_0x2b00a7(_0x42a476);});})['catch'](function(_0x5400d4){_0x259c68(_0x5400d4);});});} \ No newline at end of file +var _0xdaf9=['squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','offset','count','limit','set','Content-Range','json','reject','save','update','then','destroy','end','error','stack','name','send','body','hasOwnProperty','text','ValidationError','TemplateId','view','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','parse','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','openchannelqueue','voicequeue','whatsappqueue','user','some','includes','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','model','toLowerCase','User','union','ids','queue','replace','Queue','push','all','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xdaf9,0xc2));var _0x9daf=function(_0x1e038f,_0x10509b){_0x1e038f=_0x1e038f-0x0;var _0x92f124=_0xdaf9[_0x1e038f];return _0x92f124;};'use strict';var emlformat=require(_0x9daf('0x0'));var rimraf=require(_0x9daf('0x1'));var zipdir=require(_0x9daf('0x2'));var jsonpatch=require(_0x9daf('0x3'));var rp=require(_0x9daf('0x4'));var moment=require(_0x9daf('0x5'));var BPromise=require(_0x9daf('0x6'));var Mustache=require(_0x9daf('0x7'));var util=require(_0x9daf('0x8'));var path=require('path');var sox=require(_0x9daf('0x9'));var csv=require(_0x9daf('0xa'));var ejs=require(_0x9daf('0xb'));var fs=require('fs');var fs_extra=require(_0x9daf('0xc'));var _=require(_0x9daf('0xd'));var squel=require(_0x9daf('0xe'));var crypto=require('crypto');var jsforce=require(_0x9daf('0xf'));var deskjs=require(_0x9daf('0x10'));var toCsv=require(_0x9daf('0xa'));var querystring=require(_0x9daf('0x11'));var Papa=require('papaparse');var Redis=require(_0x9daf('0x12'));var authService=require(_0x9daf('0x13'));var qs=require(_0x9daf('0x14'));var as=require(_0x9daf('0x15'));var hardwareService=require(_0x9daf('0x16'));var logger=require(_0x9daf('0x17'))(_0x9daf('0x18'));var utils=require(_0x9daf('0x19'));var config=require(_0x9daf('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x9daf('0x1b')]=_[_0x9daf('0x1c')](config['redis'],{'host':_0x9daf('0x1d'),'port':0x18eb});var socket=require(_0x9daf('0x1e'))(new Redis(config['redis']));require(_0x9daf('0x1f'))[_0x9daf('0x20')](socket);function respondWithStatusCode(_0x10eb6e,_0x3f5cbf){_0x3f5cbf=_0x3f5cbf||0xcc;return function(_0x550ae4){if(_0x550ae4){return _0x10eb6e[_0x9daf('0x21')](_0x3f5cbf);}return _0x10eb6e[_0x9daf('0x22')](_0x3f5cbf)['end']();};}function respondWithResult(_0xf6760c,_0x151ae2){_0x151ae2=_0x151ae2||0xc8;return function(_0x209486){if(_0x209486){return _0xf6760c[_0x9daf('0x22')](_0x151ae2)['json'](_0x209486);}};}function respondWithFilteredResult(_0x1f417b,_0x17bce7){return function(_0x4aa7ad){if(_0x4aa7ad){var _0x39fc0a=typeof _0x17bce7[_0x9daf('0x23')]==='undefined'&&typeof _0x17bce7['limit']==='undefined';var _0x251619=_0x4aa7ad['count'];var _0x254fbf=_0x39fc0a?0x0:_0x17bce7[_0x9daf('0x23')];var _0x7d026a=_0x39fc0a?_0x4aa7ad[_0x9daf('0x24')]:_0x17bce7['offset']+_0x17bce7[_0x9daf('0x25')];var _0x341f91;if(_0x7d026a>=_0x251619){_0x7d026a=_0x251619;_0x341f91=0xc8;}else{_0x341f91=0xce;}_0x1f417b[_0x9daf('0x22')](_0x341f91);return _0x1f417b[_0x9daf('0x26')](_0x9daf('0x27'),_0x254fbf+'-'+_0x7d026a+'/'+_0x251619)[_0x9daf('0x28')](_0x4aa7ad);}return null;};}function patchUpdates(_0x1bd047){return function(_0x9dfeec){try{jsonpatch['apply'](_0x9dfeec,_0x1bd047,!![]);}catch(_0x33226c){return BPromise[_0x9daf('0x29')](_0x33226c);}return _0x9dfeec[_0x9daf('0x2a')]();};}function saveUpdates(_0x5bce1f,_0x6a53be){return function(_0x485c05){if(_0x485c05){return _0x485c05[_0x9daf('0x2b')](_0x5bce1f)[_0x9daf('0x2c')](function(_0x26657c){return _0x26657c;});}return null;};}function removeEntity(_0x539957,_0x3f6586){return function(_0x1a1e0d){if(_0x1a1e0d){return _0x1a1e0d[_0x9daf('0x2d')]()[_0x9daf('0x2c')](function(){_0x539957[_0x9daf('0x22')](0xcc)[_0x9daf('0x2e')]();});}};}function handleEntityNotFound(_0x4d2391,_0x37eb38){return function(_0x43b277){if(!_0x43b277){_0x4d2391[_0x9daf('0x21')](0x194);}return _0x43b277;};}function handleError(_0x54e08a,_0x17d67e){_0x17d67e=_0x17d67e||0x1f4;return function(_0x5c8f65){logger[_0x9daf('0x2f')](_0x5c8f65[_0x9daf('0x30')]);if(_0x5c8f65['name']){delete _0x5c8f65[_0x9daf('0x31')];}_0x54e08a[_0x9daf('0x22')](_0x17d67e)[_0x9daf('0x32')](_0x5c8f65);};}exports['sendUserNotification']=function(_0xf030c9,_0x4ef52f,_0x1d9e9e){if(!_0xf030c9[_0x9daf('0x33')][_0x9daf('0x34')](_0x9daf('0x35'))&&!_0xf030c9[_0x9daf('0x33')][_0x9daf('0x34')]('TemplateId')){throw new db['Sequelize'][(_0x9daf('0x36'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0xf030c9[_0x9daf('0x33')][_0x9daf('0x34')](_0x9daf('0x37'))&&!_0xf030c9[_0x9daf('0x33')][_0x9daf('0x34')](_0x9daf('0x38'))){throw new db[(_0x9daf('0x39'))][(_0x9daf('0x36'))](_0x9daf('0x3a'));}if(!_0xf030c9[_0x9daf('0x33')][_0x9daf('0x34')](_0x9daf('0x3b'))){throw new db[(_0x9daf('0x39'))][(_0x9daf('0x36'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x4f0991=JSON[_0x9daf('0x3c')](_0xf030c9['body'][_0x9daf('0x3b')]);}catch(_0x30c97a){logger[_0x9daf('0x2f')](_0x30c97a);throw new db[(_0x9daf('0x39'))][(_0x9daf('0x36'))](_0x9daf('0x3d'));}var _0x3a3f4a=['chatqueue',_0x9daf('0x3e'),_0x9daf('0x3f'),_0x9daf('0x40'),'smsqueue',_0x9daf('0x41'),_0x9daf('0x42'),'team',_0x9daf('0x43')];if(_[_0x9daf('0x44')](_0x4f0991,function(_0x4222e7){return!_[_0x9daf('0x45')](_0x3a3f4a,_0x4222e7['model']['toLowerCase']());})){throw new db[(_0x9daf('0x39'))][(_0x9daf('0x36'))](_0x9daf('0x46'));}}}var _0x4dd850={};_0x4dd850[_0x9daf('0x47')]=_0xf030c9['body']['hasOwnProperty'](_0x9daf('0x47'))?_0xf030c9[_0x9daf('0x33')]['senderName']:_0xf030c9[_0x9daf('0x43')][_0x9daf('0x48')];_0x4dd850[_0x9daf('0x49')]=_[_0x9daf('0x4a')](_0xf030c9[_0x9daf('0x33')]['recipientsDescription'])?null:_0xf030c9['body'][_0x9daf('0x49')];_0x4dd850[_0x9daf('0x4b')]=_0xf030c9[_0x9daf('0x33')][_0x9daf('0x4b')]||![];_0x4dd850[_0x9daf('0x4c')]=_0xf030c9[_0x9daf('0x43')]['id'];return getContent(_0xf030c9[_0x9daf('0x33')])[_0x9daf('0x2c')](function(_0x5680ee){_0x4dd850['body']=_0x5680ee;return getRecipients(_0x4f0991);})[_0x9daf('0x2c')](function(_0x541400){_0x4dd850[_0x9daf('0x4d')]=_[_0x9daf('0x4e')](_0x541400)[_0x9daf('0x4f')](',');return db['sequelize'][_0x9daf('0x50')](function(_0x1af13a){return db[_0x9daf('0x51')][_0x9daf('0x52')](_0x4dd850,{'raw':!![],'transaction':_0x1af13a})[_0x9daf('0x2c')](function(_0x32b58a){var _0x3c5f53={'sender':_0x4dd850[_0x9daf('0x47')],'description':_0x4dd850[_0x9daf('0x49')],'content':_0x4dd850[_0x9daf('0x33')],'beep':_0x4dd850['beep']};_0x541400[_0x9daf('0x53')](function(_0x4f0d77){_0x3c5f53[_0x9daf('0x54')]=_0x4f0d77;socket[_0x9daf('0x55')](_0x9daf('0x56'),_0x3c5f53);});return _0x32b58a;});});})[_0x9daf('0x2c')](respondWithResult(_0x4ef52f,0xc9))[_0x9daf('0x57')](handleError(_0x4ef52f,null));};function getContent(_0x1e5b67){return new BPromise(function(_0x58f58f,_0xf04778){if(_0x1e5b67[_0x9daf('0x35')]){_0x58f58f(_0x1e5b67[_0x9daf('0x35')]);return;}return db['Template'][_0x9daf('0x58')]({'attributes':[_0x9daf('0x59')],'where':{'id':_0x1e5b67['TemplateId']},'raw':!![]})['then'](function(_0x125ee6){if(!_0x125ee6)throw new db[(_0x9daf('0x39'))][(_0x9daf('0x36'))](_0x9daf('0x5a'));var _0x21ff8e=Mustache['render'](_0x125ee6['html'],_0x1e5b67[_0x9daf('0x38')]);_0x58f58f(_0x21ff8e);})[_0x9daf('0x57')](function(_0x33f349){_0xf04778(_0x33f349);});});}function getRecipients(_0x22590a){return new BPromise(function(_0x57466c,_0x17d68e){var _0x1b4e19=[];var _0x12d3fa=[];_0x22590a[_0x9daf('0x53')](function(_0x45dd49){var _0x145f48=_['startCase'](_0x45dd49[_0x9daf('0x5b')][_0x9daf('0x5c')]());if(_0x145f48===_0x9daf('0x5d')){_0x1b4e19=_[_0x9daf('0x5e')](_0x1b4e19,_0x45dd49[_0x9daf('0x5f')]);}else{if(_['includes'](_0x145f48,_0x9daf('0x60')))_0x145f48=_0x145f48[_0x9daf('0x61')](_0x9daf('0x60'),_0x9daf('0x62'));_0x45dd49['ids'][_0x9daf('0x53')](function(_0x5d4204){_0x12d3fa[_0x9daf('0x63')](getAgents(_0x145f48,_0x5d4204));});}});return BPromise[_0x9daf('0x64')](_0x12d3fa)[_0x9daf('0x2c')](function(_0x202096){_0x1b4e19=_[_0x9daf('0x5e')](_0x1b4e19,_[_0x9daf('0x65')](_0x202096));_0x57466c(_0x1b4e19);})['catch'](function(_0x35b527){_0x17d68e(_0x35b527);});});}function getAgents(_0xc7d4aa,_0x3c4c7f){return new BPromise(function(_0x8ea634,_0x138af0){return db[_0xc7d4aa][_0x9daf('0x58')]({'where':{'id':_0x3c4c7f}})['then'](function(_0x278ced){return _0x278ced[_0x9daf('0x66')]({'attributes':['id'],'raw':!![]})[_0x9daf('0x2c')](function(_0x343e04){var _0x183161=_[_0x9daf('0x67')](_0x343e04,'id');_0x8ea634(_0x183161);});})[_0x9daf('0x57')](function(_0x36733b){_0x138af0(_0x36733b);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 2f63aa3..8c8f56c 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 _0x7b11=['update','hasOwnProperty','save'];(function(_0x39a872,_0x2c782e){var _0x277a47=function(_0x11ebb8){while(--_0x11ebb8){_0x39a872['push'](_0x39a872['shift']());}};_0x277a47(++_0x2c782e);}(_0x7b11,0x18e));var _0x17b1=function(_0x2451ee,_0x36d124){_0x2451ee=_0x2451ee-0x0;var _0x38be0d=_0x7b11[_0x2451ee];return _0x38be0d;};'use strict';var EventEmitter=require('events');var UserNotification=require('../../mysqldb')['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x17b1('0x0'),'afterUpdate':_0x17b1('0x1'),'afterDestroy':'remove'};function emitEvent(_0x52d147){return function(_0x28f148,_0x349472,_0xa646f8){UserNotificationEvents['emit'](_0x52d147+':'+_0x28f148['id'],_0x28f148);UserNotificationEvents['emit'](_0x52d147,_0x28f148);_0xa646f8(null);};}for(var e in events){if(events[_0x17b1('0x2')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0xc414=['UserNotification','setMaxListeners','save','update','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x395cc3,_0x506018){var _0x3a64cf=function(_0x15dcda){while(--_0x15dcda){_0x395cc3['push'](_0x395cc3['shift']());}};_0x3a64cf(++_0x506018);}(_0xc414,0xde));var _0x4c41=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc414[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x4c41('0x0'));var UserNotification=require(_0x4c41('0x1'))['db'][_0x4c41('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x4c41('0x3')](0x0);var events={'afterCreate':_0x4c41('0x4'),'afterUpdate':_0x4c41('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4237b9){return function(_0x1f1ae2,_0x57e1b9,_0x4795e0){UserNotificationEvents[_0x4c41('0x6')](_0x4237b9+':'+_0x1f1ae2['id'],_0x1f1ae2);UserNotificationEvents[_0x4c41('0x6')](_0x4237b9,_0x1f1ae2);_0x4795e0(null);};}for(var e in events){if(events[_0x4c41('0x7')](e)){var event=events[e];UserNotification['hook'](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 db24560..d3be3f8 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 _0x0323=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','UserNotification'];(function(_0x8fa5af,_0x532c14){var _0x1c502c=function(_0x161cb5){while(--_0x161cb5){_0x8fa5af['push'](_0x8fa5af['shift']());}};_0x1c502c(++_0x532c14);}(_0x0323,0x15f));var _0x3032=function(_0x476aba,_0x3a96cd){_0x476aba=_0x476aba-0x0;var _0x3291d8=_0x0323[_0x476aba];return _0x3291d8;};'use strict';var _=require(_0x3032('0x0'));var util=require('util');var logger=require(_0x3032('0x1'))(_0x3032('0x2'));var moment=require(_0x3032('0x3'));var BPromise=require('bluebird');var rp=require(_0x3032('0x4'));var fs=require('fs');var path=require(_0x3032('0x5'));var rimraf=require(_0x3032('0x6'));var config=require(_0x3032('0x7'));var attributes=require('./userNotification.attributes');module['exports']=function(_0x1633ed,_0x3db54d){return _0x1633ed['define'](_0x3032('0x8'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x6fda=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x2d9da8,_0x5d5072){var _0x57a29c=function(_0x2f562d){while(--_0x2f562d){_0x2d9da8['push'](_0x2d9da8['shift']());}};_0x57a29c(++_0x5d5072);}(_0x6fda,0xb7));var _0xa6fd=function(_0x4d8068,_0xc7fd1d){_0x4d8068=_0x4d8068-0x0;var _0x37d7c1=_0x6fda[_0x4d8068];return _0x37d7c1;};'use strict';var _=require(_0xa6fd('0x0'));var util=require(_0xa6fd('0x1'));var logger=require(_0xa6fd('0x2'))(_0xa6fd('0x3'));var moment=require(_0xa6fd('0x4'));var BPromise=require(_0xa6fd('0x5'));var rp=require(_0xa6fd('0x6'));var fs=require('fs');var path=require(_0xa6fd('0x7'));var rimraf=require(_0xa6fd('0x8'));var config=require(_0xa6fd('0x9'));var attributes=require(_0xa6fd('0xa'));module[_0xa6fd('0xb')]=function(_0x264fc0,_0x3885ef){return _0x264fc0[_0xa6fd('0xc')](_0xa6fd('0xd'),attributes,{'tableName':_0xa6fd('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa6fd('0xf'),'collate':_0xa6fd('0x10')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 6db7a34..582ae96 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 _0x41b7=['socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserNotification,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','rpc','http','redis','localhost'];(function(_0x2ab365,_0xa3812e){var _0x49fef3=function(_0x29b883){while(--_0x29b883){_0x2ab365['push'](_0x2ab365['shift']());}};_0x49fef3(++_0xa3812e);}(_0x41b7,0xb7));var _0x741b=function(_0x1d33ea,_0x236c84){_0x1d33ea=_0x1d33ea-0x0;var _0x44eb8e=_0x41b7[_0x1d33ea];return _0x44eb8e;};'use strict';var _=require(_0x741b('0x0'));var util=require(_0x741b('0x1'));var moment=require('moment');var BPromise=require(_0x741b('0x2'));var rs=require(_0x741b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x741b('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x741b('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x741b('0x6')]({'port':0x232a});config[_0x741b('0x7')]=_['defaults'](config['redis'],{'host':_0x741b('0x8'),'port':0x18eb});var socket=require(_0x741b('0x9'))(new Redis(config[_0x741b('0x7')]));require(_0x741b('0xa'))[_0x741b('0xb')](socket);function respondWithRpcPromise(_0x242466,_0x32b17a,_0x28ea4f){return new BPromise(function(_0x1491a5,_0x2eca96){return client[_0x741b('0xc')](_0x242466,_0x28ea4f)[_0x741b('0xd')](function(_0xb130a4){logger[_0x741b('0xe')]('UserNotification,\x20%s,\x20%s',_0x32b17a,'request\x20sent');logger['debug'](_0x741b('0xf'),_0x32b17a,_0x741b('0x10'),JSON[_0x741b('0x11')](_0xb130a4));if(_0xb130a4[_0x741b('0x12')]){if(_0xb130a4[_0x741b('0x12')][_0x741b('0x13')]===0x1f4){logger[_0x741b('0x12')](_0x741b('0x14'),_0x32b17a,_0xb130a4[_0x741b('0x12')]['message']);return _0x2eca96(_0xb130a4[_0x741b('0x12')]['message']);}logger[_0x741b('0x12')]('UserNotification,\x20%s,\x20%s',_0x32b17a,_0xb130a4[_0x741b('0x12')][_0x741b('0x15')]);return _0x1491a5(_0xb130a4['error'][_0x741b('0x15')]);}else{logger[_0x741b('0xe')](_0x741b('0x14'),_0x32b17a,_0x741b('0x10'));_0x1491a5(_0xb130a4[_0x741b('0x16')][_0x741b('0x15')]);}})[_0x741b('0x17')](function(_0x582ae7){logger[_0x741b('0x12')]('UserNotification,\x20%s,\x20%s',_0x32b17a,_0x582ae7);_0x2eca96(_0x582ae7);});});} \ No newline at end of file +var _0x2cfe=['defaults','localhost','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x5acf92,_0x4ff2a3){var _0x3d4117=function(_0x2e8e5a){while(--_0x2e8e5a){_0x5acf92['push'](_0x5acf92['shift']());}};_0x3d4117(++_0x4ff2a3);}(_0x2cfe,0x1e1));var _0xe2cf=function(_0x32351e,_0x25d53a){_0x32351e=_0x32351e-0x0;var _0xcc55=_0x2cfe[_0x32351e];return _0xcc55;};'use strict';var _=require(_0xe2cf('0x0'));var util=require(_0xe2cf('0x1'));var moment=require(_0xe2cf('0x2'));var BPromise=require(_0xe2cf('0x3'));var rs=require(_0xe2cf('0x4'));var fs=require('fs');var Redis=require(_0xe2cf('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe2cf('0x6'));var logger=require(_0xe2cf('0x7'))(_0xe2cf('0x8'));var config=require(_0xe2cf('0x9'));var jayson=require(_0xe2cf('0xa'));var client=jayson['client'][_0xe2cf('0xb')]({'port':0x232a});config[_0xe2cf('0xc')]=_[_0xe2cf('0xd')](config[_0xe2cf('0xc')],{'host':_0xe2cf('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe2cf('0xc')]));require(_0xe2cf('0xf'))[_0xe2cf('0x10')](socket);function respondWithRpcPromise(_0x3d3fff,_0x2e14ba,_0x5cd687){return new BPromise(function(_0x37fe5b,_0x288878){return client[_0xe2cf('0x11')](_0x3d3fff,_0x5cd687)[_0xe2cf('0x12')](function(_0x111dad){logger[_0xe2cf('0x13')](_0xe2cf('0x14'),_0x2e14ba,'request\x20sent');logger['debug'](_0xe2cf('0x15'),_0x2e14ba,_0xe2cf('0x16'),JSON['stringify'](_0x111dad));if(_0x111dad[_0xe2cf('0x17')]){if(_0x111dad['error']['code']===0x1f4){logger['error'](_0xe2cf('0x14'),_0x2e14ba,_0x111dad[_0xe2cf('0x17')][_0xe2cf('0x18')]);return _0x288878(_0x111dad[_0xe2cf('0x17')][_0xe2cf('0x18')]);}logger[_0xe2cf('0x17')](_0xe2cf('0x14'),_0x2e14ba,_0x111dad['error'][_0xe2cf('0x18')]);return _0x37fe5b(_0x111dad[_0xe2cf('0x17')]['message']);}else{logger['info'](_0xe2cf('0x14'),_0x2e14ba,_0xe2cf('0x16'));_0x37fe5b(_0x111dad['result']['message']);}})[_0xe2cf('0x19')](function(_0x246bb2){logger[_0xe2cf('0x17')](_0xe2cf('0x14'),_0x2e14ba,_0x246bb2);_0x288878(_0x246bb2);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 2046944..e5f4f1c 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 _0xd390=['update','emit','removeListener','save','remove'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xd390,0x166));var _0x0d39=function(_0x4c73b8,_0xc093a5){_0x4c73b8=_0x4c73b8-0x0;var _0xbead1e=_0xd390[_0x4c73b8];return _0xbead1e;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x0d39('0x0'),_0x0d39('0x1'),_0x0d39('0x2')];function createListener(_0x48d0d6,_0x41754a){return function(_0x384a42){_0x41754a[_0x0d39('0x3')](_0x48d0d6,_0x384a42);};}function removeListener(_0x3990fd,_0x43dfb6){return function(){UserNotificationEvents[_0x0d39('0x4')](_0x3990fd,_0x43dfb6);};}exports['register']=function(_0x209da0){for(var _0x1b1f8e=0x0,_0xb21a02=events['length'];_0x1b1f8e<_0xb21a02;_0x1b1f8e++){var _0x5d2252=events[_0x1b1f8e];var _0x1e07b5=createListener('userNotification:'+_0x5d2252,_0x209da0);UserNotificationEvents['on'](_0x5d2252,_0x1e07b5);}}; \ No newline at end of file +var _0xcf6b=['save','remove','update','emit','removeListener','register','length','userNotification:','./userNotification.events'];(function(_0x19ccc0,_0xa03633){var _0x274fa9=function(_0x2ee42d){while(--_0x2ee42d){_0x19ccc0['push'](_0x19ccc0['shift']());}};_0x274fa9(++_0xa03633);}(_0xcf6b,0x1dc));var _0xbcf6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xcf6b[_0x2641f9];return _0x585741;};'use strict';var UserNotificationEvents=require(_0xbcf6('0x0'));var events=[_0xbcf6('0x1'),_0xbcf6('0x2'),_0xbcf6('0x3')];function createListener(_0x30ab82,_0x2f4909){return function(_0x43333c){_0x2f4909[_0xbcf6('0x4')](_0x30ab82,_0x43333c);};}function removeListener(_0x369483,_0x336e8d){return function(){UserNotificationEvents[_0xbcf6('0x5')](_0x369483,_0x336e8d);};}exports[_0xbcf6('0x6')]=function(_0x3780e3){for(var _0x5ae8e1=0x0,_0x54b74d=events[_0xbcf6('0x7')];_0x5ae8e1<_0x54b74d;_0x5ae8e1++){var _0x5a7f84=events[_0x5ae8e1];var _0x28c9eb=createListener(_0xbcf6('0x8')+_0x5a7f84,_0x3780e3);UserNotificationEvents['on'](_0x5a7f84,_0x28c9eb);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 2738a50..8a1ade7 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x508c71,_0x55b144){var _0x1a1f53=function(_0x3755e7){while(--_0x3755e7){_0x508c71['push'](_0x508c71['shift']());}};_0x1a1f53(++_0x55b144);}(_0x9c44,0x178));var _0x49c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c44[_0x3511d3];return _0x5d6321;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x5962bd,_0x26e307){var _0x448b4f=function(_0x5d3927){while(--_0x5d3927){_0x5962bd['push'](_0x5962bd['shift']());}};_0x448b4f(++_0x26e307);}(_0xedd9,0xfc));var _0x9edd=function(_0x3cdb27,_0x1b271c){_0x3cdb27=_0x3cdb27-0x0;var _0x313588=_0xedd9[_0x3cdb27];return _0x313588;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 26ebea5..d78dae3 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 _0xbac5=['sequelize'];(function(_0x2551fc,_0x333800){var _0x389305=function(_0x2a6905){while(--_0x2a6905){_0x2551fc['push'](_0x2551fc['shift']());}};_0x389305(++_0x333800);}(_0xbac5,0xa9));var _0x5bac=function(_0x389c94,_0x2a93d9){_0x389c94=_0x389c94-0x0;var _0x1455cb=_0xbac5[_0x389c94];return _0x1455cb;};'use strict';var Sequelize=require(_0x5bac('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xb9fb=['exports','INTEGER','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb9fb,0xef));var _0xbb9f=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xb9fb[_0x1a36a5];return _0x746243;};'use strict';var Sequelize=require(_0xbb9f('0x0'));module[_0xbb9f('0x1')]={'penalty':{'type':Sequelize[_0xbb9f('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 7aa1812..b1ef9ea 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 _0x301c=['UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x2e7b5d,_0x19503e){var _0xea754b=function(_0x5c5bdb){while(--_0x5c5bdb){_0x2e7b5d['push'](_0x2e7b5d['shift']());}};_0xea754b(++_0x19503e);}(_0x301c,0x1bc));var _0xc301=function(_0x1286d5,_0x5c2870){_0x1286d5=_0x1286d5-0x0;var _0x1e06b0=_0x301c[_0x1286d5];return _0x1e06b0;};'use strict';var _=require(_0xc301('0x0'));var util=require(_0xc301('0x1'));var logger=require(_0xc301('0x2'))('api');var moment=require(_0xc301('0x3'));var BPromise=require(_0xc301('0x4'));var rp=require(_0xc301('0x5'));var fs=require('fs');var path=require(_0xc301('0x6'));var rimraf=require(_0xc301('0x7'));var config=require(_0xc301('0x8'));var attributes=require('./userOpenchannelQueue.attributes');module[_0xc301('0x9')]=function(_0xa7829,_0x43163e){return _0xa7829[_0xc301('0xa')](_0xc301('0xb'),attributes,{'tableName':_0xc301('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a2d=['bluebird','request-promise','../../config/environment','./userOpenchannelQueue.attributes','exports','user_has_openchannel_queues','lodash','../../config/logger','api','moment'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x9a2d,0x13c));var _0xd9a2=function(_0xb4f406,_0x6c219a){_0xb4f406=_0xb4f406-0x0;var _0x530d7a=_0x9a2d[_0xb4f406];return _0x530d7a;};'use strict';var _=require(_0xd9a2('0x0'));var util=require('util');var logger=require(_0xd9a2('0x1'))(_0xd9a2('0x2'));var moment=require(_0xd9a2('0x3'));var BPromise=require(_0xd9a2('0x4'));var rp=require(_0xd9a2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd9a2('0x6'));var attributes=require(_0xd9a2('0x7'));module[_0xd9a2('0x8')]=function(_0x10de33,_0x5dedf7){return _0x10de33['define']('UserOpenchannelQueue',attributes,{'tableName':_0xd9a2('0x9'),'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 3a1231f..3b1e529 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 _0xd8bc=['http','request','then','info','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserOpenchannelQueue,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client'];(function(_0x119705,_0xba9427){var _0x2affc2=function(_0x16f7e2){while(--_0x16f7e2){_0x119705['push'](_0x119705['shift']());}};_0x2affc2(++_0xba9427);}(_0xd8bc,0xa7));var _0xcd8b=function(_0x18e99e,_0x264cd0){_0x18e99e=_0x18e99e-0x0;var _0x51fb6b=_0xd8bc[_0x18e99e];return _0x51fb6b;};'use strict';var _=require(_0xcd8b('0x0'));var util=require(_0xcd8b('0x1'));var moment=require(_0xcd8b('0x2'));var BPromise=require(_0xcd8b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcd8b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcd8b('0x5'));var config=require(_0xcd8b('0x6'));var jayson=require(_0xcd8b('0x7'));var client=jayson[_0xcd8b('0x8')][_0xcd8b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10fab8,_0x1f1bd2,_0x260663){return new BPromise(function(_0x1b5067,_0x1cd1ef){return client[_0xcd8b('0xa')](_0x10fab8,_0x260663)[_0xcd8b('0xb')](function(_0x352daa){logger[_0xcd8b('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x1f1bd2,_0xcd8b('0xd'));logger[_0xcd8b('0xe')](_0xcd8b('0xf'),_0x1f1bd2,_0xcd8b('0xd'),JSON[_0xcd8b('0x10')](_0x352daa));if(_0x352daa[_0xcd8b('0x11')]){if(_0x352daa[_0xcd8b('0x11')][_0xcd8b('0x12')]===0x1f4){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x1f1bd2,_0x352daa[_0xcd8b('0x11')][_0xcd8b('0x13')]);return _0x1cd1ef(_0x352daa['error'][_0xcd8b('0x13')]);}logger['error'](_0xcd8b('0x14'),_0x1f1bd2,_0x352daa['error'][_0xcd8b('0x13')]);return _0x1b5067(_0x352daa[_0xcd8b('0x11')]['message']);}else{logger[_0xcd8b('0xc')](_0xcd8b('0x14'),_0x1f1bd2,_0xcd8b('0xd'));_0x1b5067(_0x352daa['result'][_0xcd8b('0x13')]);}})[_0xcd8b('0x15')](function(_0x432f40){logger['error'](_0xcd8b('0x14'),_0x1f1bd2,_0x432f40);_0x1cd1ef(_0x432f40);});});} \ No newline at end of file +var _0xa7ee=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x67f95e,_0x3ca797){var _0x538f5a=function(_0xc919e9){while(--_0xc919e9){_0x67f95e['push'](_0x67f95e['shift']());}};_0x538f5a(++_0x3ca797);}(_0xa7ee,0x18a));var _0xea7e=function(_0x3e8cae,_0x4cb96a){_0x3e8cae=_0x3e8cae-0x0;var _0x45c4d6=_0xa7ee[_0x3e8cae];return _0x45c4d6;};'use strict';var _=require(_0xea7e('0x0'));var util=require(_0xea7e('0x1'));var moment=require(_0xea7e('0x2'));var BPromise=require(_0xea7e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea7e('0x4'));var db=require(_0xea7e('0x5'))['db'];var utils=require(_0xea7e('0x6'));var logger=require(_0xea7e('0x7'))(_0xea7e('0x8'));var config=require('../../config/environment');var jayson=require(_0xea7e('0x9'));var client=jayson['client'][_0xea7e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11fc23,_0x5dcd05,_0x5c8da9){return new BPromise(function(_0x49a190,_0x3c85a0){return client[_0xea7e('0xb')](_0x11fc23,_0x5c8da9)[_0xea7e('0xc')](function(_0x4214b7){logger[_0xea7e('0xd')](_0xea7e('0xe'),_0x5dcd05,'request\x20sent');logger[_0xea7e('0xf')](_0xea7e('0x10'),_0x5dcd05,_0xea7e('0x11'),JSON[_0xea7e('0x12')](_0x4214b7));if(_0x4214b7[_0xea7e('0x13')]){if(_0x4214b7[_0xea7e('0x13')]['code']===0x1f4){logger[_0xea7e('0x13')](_0xea7e('0xe'),_0x5dcd05,_0x4214b7['error']['message']);return _0x3c85a0(_0x4214b7[_0xea7e('0x13')][_0xea7e('0x14')]);}logger[_0xea7e('0x13')](_0xea7e('0xe'),_0x5dcd05,_0x4214b7[_0xea7e('0x13')][_0xea7e('0x14')]);return _0x49a190(_0x4214b7['error']['message']);}else{logger[_0xea7e('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x5dcd05,_0xea7e('0x11'));_0x49a190(_0x4214b7[_0xea7e('0x15')][_0xea7e('0x14')]);}})[_0xea7e('0x16')](function(_0x348062){logger[_0xea7e('0x13')](_0xea7e('0xe'),_0x5dcd05,_0x348062);_0x3c85a0(_0x348062);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 287e094..152d09f 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 _0x7495=['/:id/clone','post','/:id/sections','addSections','/:id/resources','addResources','put','delete','destroy','removeResources','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','index','/describe','isAuthenticated','describe','get','/:id','show','getSections','getResources','create'];(function(_0x3374b0,_0x3cc015){var _0x11fac4=function(_0x2c05ca){while(--_0x2c05ca){_0x3374b0['push'](_0x3374b0['shift']());}};_0x11fac4(++_0x3cc015);}(_0x7495,0x15a));var _0x5749=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x7495[_0x56916d];return _0x2b7f1f;};'use strict';var multer=require(_0x5749('0x0'));var util=require(_0x5749('0x1'));var path=require('path');var timeout=require(_0x5749('0x2'));var express=require(_0x5749('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5749('0x4'));var interaction=require(_0x5749('0x5'));var config=require(_0x5749('0x6'));var controller=require(_0x5749('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x5749('0x8')]);router['get'](_0x5749('0x9'),auth[_0x5749('0xa')](),controller[_0x5749('0xb')]);router[_0x5749('0xc')](_0x5749('0xd'),auth[_0x5749('0xa')](),controller[_0x5749('0xe')]);router[_0x5749('0xc')]('/:id/sections',auth[_0x5749('0xa')](),controller[_0x5749('0xf')]);router[_0x5749('0xc')]('/:id/resources',auth[_0x5749('0xa')](),controller[_0x5749('0x10')]);router['post']('/',auth[_0x5749('0xa')](),controller[_0x5749('0x11')]);router['post'](_0x5749('0x12'),auth[_0x5749('0xa')](),controller['clone']);router[_0x5749('0x13')](_0x5749('0x14'),auth[_0x5749('0xa')](),controller[_0x5749('0x15')]);router[_0x5749('0x13')](_0x5749('0x16'),auth[_0x5749('0xa')](),controller[_0x5749('0x17')]);router[_0x5749('0x18')](_0x5749('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x5749('0x19')](_0x5749('0xd'),auth[_0x5749('0xa')](),controller[_0x5749('0x1a')]);router['delete'](_0x5749('0x14'),auth[_0x5749('0xa')](),controller['removeSections']);router[_0x5749('0x19')](_0x5749('0x16'),auth['isAuthenticated'](),controller[_0x5749('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xd61f=['get','isAuthenticated','index','/describe','describe','/:id','/:id/sections','getSections','/:id/resources','post','create','/:id/clone','clone','addSections','addResources','update','delete','removeResources','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller'];(function(_0xf4dca9,_0x24e8e0){var _0x3953cf=function(_0x281333){while(--_0x281333){_0xf4dca9['push'](_0xf4dca9['shift']());}};_0x3953cf(++_0x24e8e0);}(_0xd61f,0x1b3));var _0xfd61=function(_0x233fcf,_0x5683a2){_0x233fcf=_0x233fcf-0x0;var _0x23f8f0=_0xd61f[_0x233fcf];return _0x23f8f0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfd61('0x0'));var timeout=require(_0xfd61('0x1'));var express=require('express');var router=express[_0xfd61('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xfd61('0x3'));var interaction=require(_0xfd61('0x4'));var config=require(_0xfd61('0x5'));var controller=require(_0xfd61('0x6'));router[_0xfd61('0x7')]('/',auth[_0xfd61('0x8')](),controller[_0xfd61('0x9')]);router[_0xfd61('0x7')](_0xfd61('0xa'),auth[_0xfd61('0x8')](),controller[_0xfd61('0xb')]);router['get'](_0xfd61('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xfd61('0x7')](_0xfd61('0xd'),auth['isAuthenticated'](),controller[_0xfd61('0xe')]);router['get'](_0xfd61('0xf'),auth[_0xfd61('0x8')](),controller['getResources']);router[_0xfd61('0x10')]('/',auth[_0xfd61('0x8')](),controller[_0xfd61('0x11')]);router[_0xfd61('0x10')](_0xfd61('0x12'),auth[_0xfd61('0x8')](),controller[_0xfd61('0x13')]);router[_0xfd61('0x10')](_0xfd61('0xd'),auth['isAuthenticated'](),controller[_0xfd61('0x14')]);router[_0xfd61('0x10')]('/:id/resources',auth[_0xfd61('0x8')](),controller[_0xfd61('0x15')]);router['put']('/:id',auth[_0xfd61('0x8')](),controller[_0xfd61('0x16')]);router[_0xfd61('0x17')](_0xfd61('0xc'),auth[_0xfd61('0x8')](),controller['destroy']);router['delete']('/:id/sections',auth[_0xfd61('0x8')](),controller['removeSections']);router[_0xfd61('0x17')](_0xfd61('0xf'),auth[_0xfd61('0x8')](),controller[_0xfd61('0x18')]);module[_0xfd61('0x19')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index ff7f7ea..9046276 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 _0x6141=['BOOLEAN','sequelize','exports','STRING','name','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x8f906d,_0x557c4a){var _0x519283=function(_0x3cd7dd){while(--_0x3cd7dd){_0x8f906d['push'](_0x8f906d['shift']());}};_0x519283(++_0x557c4a);}(_0x6141,0xa1));var _0x1614=function(_0x4a47a5,_0x229d8e){_0x4a47a5=_0x4a47a5-0x0;var _0x47d2fd=_0x6141[_0x4a47a5];return _0x47d2fd;};'use strict';var Sequelize=require(_0x1614('0x0'));module[_0x1614('0x1')]={'name':{'type':Sequelize[_0x1614('0x2')],'allowNull':![],'unique':_0x1614('0x3')},'crudPermissions':{'type':Sequelize[_0x1614('0x2')],'set':function(_0x81753e){this[_0x1614('0x4')](_0x1614('0x5'),_0x81753e?_0x81753e[_0x1614('0x6')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0x1614('0x7')](_0x1614('0x5'))[_0x1614('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x1614('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x1614('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x1614('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x1614('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x1614('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x1614('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1614('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1614('0x9')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5e4d=['getDataValue','crudPermissions','split','BOOLEAN','sequelize','name','STRING','setDataValue','join'];(function(_0x180fc6,_0x5f3c92){var _0x4dbf08=function(_0x995139){while(--_0x995139){_0x180fc6['push'](_0x180fc6['shift']());}};_0x4dbf08(++_0x5f3c92);}(_0x5e4d,0x136));var _0xd5e4=function(_0x37cdd2,_0x3e3430){_0x37cdd2=_0x37cdd2-0x0;var _0x2cb401=_0x5e4d[_0x37cdd2];return _0x2cb401;};'use strict';var Sequelize=require(_0xd5e4('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd5e4('0x1')},'crudPermissions':{'type':Sequelize[_0xd5e4('0x2')],'set':function(_0x5204f3){this[_0xd5e4('0x3')]('crudPermissions',_0x5204f3?_0x5204f3[_0xd5e4('0x4')](''):[]);},'get':function(){return this[_0xd5e4('0x5')]('crudPermissions')?this['getDataValue'](_0xd5e4('0x6'))[_0xd5e4('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xd5e4('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xd5e4('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xd5e4('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xd5e4('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xd5e4('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xd5e4('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xd5e4('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xd5e4('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index d842004..29e5c5c 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 _0xdfdd=['crudPermissions','sequelize','transaction','create','UserProfileSection','findAll','each','autoAssociation','UserProfileResource','map','userProfileId','Resources','describe','sectionId','push','removeSections','ids','getSections','enabled','isEmpty','subsections','includes','findOne','forEach','resourceId','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','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','redis','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','UserProfile','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','rawAttributes','find','body','keys','options','get','omit','createdAt','updatedAt'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xdfdd,0x104));var _0xddfd=function(_0x4cdf3e,_0x3c2384){_0x4cdf3e=_0x4cdf3e-0x0;var _0x1eccbf=_0xdfdd[_0x4cdf3e];return _0x1eccbf;};'use strict';var emlformat=require(_0xddfd('0x0'));var rimraf=require(_0xddfd('0x1'));var zipdir=require(_0xddfd('0x2'));var jsonpatch=require(_0xddfd('0x3'));var rp=require('request-promise');var moment=require(_0xddfd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xddfd('0x5'));var util=require('util');var path=require(_0xddfd('0x6'));var sox=require(_0xddfd('0x7'));var csv=require(_0xddfd('0x8'));var ejs=require(_0xddfd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xddfd('0xa'));var squel=require('squel');var crypto=require(_0xddfd('0xb'));var jsforce=require(_0xddfd('0xc'));var deskjs=require(_0xddfd('0xd'));var toCsv=require(_0xddfd('0x8'));var querystring=require(_0xddfd('0xe'));var Papa=require(_0xddfd('0xf'));var Redis=require('ioredis');var authService=require(_0xddfd('0x10'));var qs=require(_0xddfd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xddfd('0x12'));var logger=require(_0xddfd('0x13'))(_0xddfd('0x14'));var utils=require(_0xddfd('0x15'));var config=require(_0xddfd('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xddfd('0x17'))['db'];config['redis']=_[_0xddfd('0x18')](config['redis'],{'host':_0xddfd('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xddfd('0x1a')]));require('./userProfile.socket')[_0xddfd('0x1b')](socket);function respondWithStatusCode(_0x46d769,_0x383ac8){_0x383ac8=_0x383ac8||0xcc;return function(_0x5027b4){if(_0x5027b4){return _0x46d769[_0xddfd('0x1c')](_0x383ac8);}return _0x46d769['status'](_0x383ac8)[_0xddfd('0x1d')]();};}function respondWithResult(_0x44771b,_0x47530a){_0x47530a=_0x47530a||0xc8;return function(_0xf0dfb1){if(_0xf0dfb1){return _0x44771b[_0xddfd('0x1e')](_0x47530a)[_0xddfd('0x1f')](_0xf0dfb1);}};}function respondWithFilteredResult(_0x40f3c9,_0x587e61){return function(_0x578f43){if(_0x578f43){var _0x33c48e=typeof _0x587e61[_0xddfd('0x20')]===_0xddfd('0x21')&&typeof _0x587e61[_0xddfd('0x22')]===_0xddfd('0x21');var _0x5a7403=_0x578f43[_0xddfd('0x23')];var _0x473977=_0x33c48e?0x0:_0x587e61[_0xddfd('0x20')];var _0x3c24b6=_0x33c48e?_0x578f43[_0xddfd('0x23')]:_0x587e61[_0xddfd('0x20')]+_0x587e61['limit'];var _0x57b589;if(_0x3c24b6>=_0x5a7403){_0x3c24b6=_0x5a7403;_0x57b589=0xc8;}else{_0x57b589=0xce;}_0x40f3c9['status'](_0x57b589);return _0x40f3c9[_0xddfd('0x24')](_0xddfd('0x25'),_0x473977+'-'+_0x3c24b6+'/'+_0x5a7403)[_0xddfd('0x1f')](_0x578f43);}return null;};}function patchUpdates(_0xe3677d){return function(_0x50fffd){try{jsonpatch[_0xddfd('0x26')](_0x50fffd,_0xe3677d,!![]);}catch(_0x1939fd){return BPromise[_0xddfd('0x27')](_0x1939fd);}return _0x50fffd[_0xddfd('0x28')]();};}function saveUpdates(_0xeb4841,_0x579cb1){return function(_0x25fab7){if(_0x25fab7){return _0x25fab7[_0xddfd('0x29')](_0xeb4841)[_0xddfd('0x2a')](function(_0x1dd7f3){return _0x1dd7f3;});}return null;};}function removeEntity(_0x5446f9,_0x51375f){return function(_0x4b8a02){if(_0x4b8a02){return _0x4b8a02[_0xddfd('0x2b')]()['then'](function(){_0x5446f9[_0xddfd('0x1e')](0xcc)[_0xddfd('0x1d')]();});}};}function handleEntityNotFound(_0x41c651,_0x1035e6){return function(_0x3fb12c){if(!_0x3fb12c){_0x41c651['sendStatus'](0x194);}return _0x3fb12c;};}function handleError(_0x3abe69,_0x320e9c){_0x320e9c=_0x320e9c||0x1f4;return function(_0x339607){logger[_0xddfd('0x2c')](_0x339607[_0xddfd('0x2d')]);if(_0x339607[_0xddfd('0x2e')]){delete _0x339607[_0xddfd('0x2e')];}_0x3abe69[_0xddfd('0x1e')](_0x320e9c)[_0xddfd('0x2f')](_0x339607);};}exports['index']=function(_0x19ae9a,_0xf736a2){var _0x4dcf94={},_0x3375d1={},_0xf5d766={'count':0x0,'rows':[]};var _0x279dd3=_['map'](db[_0xddfd('0x30')]['rawAttributes'],function(_0x31a526){return{'name':_0x31a526[_0xddfd('0x31')],'type':_0x31a526[_0xddfd('0x32')][_0xddfd('0x33')]};});_0x3375d1[_0xddfd('0x34')]=_['map'](_0x279dd3,_0xddfd('0x2e'));_0x3375d1['query']=_['keys'](_0x19ae9a[_0xddfd('0x35')]);_0x3375d1['filters']=_[_0xddfd('0x36')](_0x3375d1[_0xddfd('0x34')],_0x3375d1[_0xddfd('0x35')]);_0x4dcf94[_0xddfd('0x37')]=_[_0xddfd('0x36')](_0x3375d1[_0xddfd('0x34')],qs[_0xddfd('0x38')](_0x19ae9a['query'][_0xddfd('0x38')]));_0x4dcf94[_0xddfd('0x37')]=_0x4dcf94[_0xddfd('0x37')][_0xddfd('0x39')]?_0x4dcf94[_0xddfd('0x37')]:_0x3375d1['model'];if(!_0x19ae9a['query']['hasOwnProperty'](_0xddfd('0x3a'))){_0x4dcf94['limit']=qs[_0xddfd('0x22')](_0x19ae9a[_0xddfd('0x35')]['limit']);_0x4dcf94[_0xddfd('0x20')]=qs[_0xddfd('0x20')](_0x19ae9a[_0xddfd('0x35')][_0xddfd('0x20')]);}_0x4dcf94[_0xddfd('0x3b')]=qs[_0xddfd('0x3c')](_0x19ae9a[_0xddfd('0x35')]['sort']);_0x4dcf94[_0xddfd('0x3d')]=qs[_0xddfd('0x3e')](_[_0xddfd('0x3f')](_0x19ae9a[_0xddfd('0x35')],_0x3375d1[_0xddfd('0x3e')]),_0x279dd3);if(_0x19ae9a[_0xddfd('0x35')][_0xddfd('0x40')]){_0x4dcf94[_0xddfd('0x3d')]=_[_0xddfd('0x41')](_0x4dcf94['where'],{'$or':_['map'](_0x279dd3,function(_0x16f0c1){if(_0x16f0c1[_0xddfd('0x32')]!==_0xddfd('0x42')){var _0x5498bb={};_0x5498bb[_0x16f0c1['name']]={'$like':'%'+_0x19ae9a[_0xddfd('0x35')][_0xddfd('0x40')]+'%'};return _0x5498bb;}})});}_0x4dcf94=_['merge']({},_0x4dcf94,_0x19ae9a['options']);var _0x4d0012={'where':_0x4dcf94['where']};return db['UserProfile'][_0xddfd('0x23')](_0x4d0012)[_0xddfd('0x2a')](function(_0x10be32){_0xf5d766[_0xddfd('0x23')]=_0x10be32;if(_0x19ae9a[_0xddfd('0x35')][_0xddfd('0x43')]){_0x4dcf94[_0xddfd('0x44')]=[{'all':!![]}];}return db[_0xddfd('0x30')]['findAll'](_0x4dcf94);})[_0xddfd('0x2a')](function(_0x701822){_0xf5d766[_0xddfd('0x45')]=_0x701822;return _0xf5d766;})[_0xddfd('0x2a')](respondWithFilteredResult(_0xf736a2,_0x4dcf94))[_0xddfd('0x46')](handleError(_0xf736a2,null));};exports[_0xddfd('0x47')]=function(_0x255075,_0x13c01b){var _0x10a7b2={'raw':![],'where':{'id':_0x255075[_0xddfd('0x48')]['id']}},_0x1b0c20={};_0x1b0c20[_0xddfd('0x34')]=_['keys'](db[_0xddfd('0x30')][_0xddfd('0x49')]);_0x1b0c20[_0xddfd('0x35')]=_['keys'](_0x255075[_0xddfd('0x35')]);_0x1b0c20[_0xddfd('0x3e')]=_[_0xddfd('0x36')](_0x1b0c20[_0xddfd('0x34')],_0x1b0c20[_0xddfd('0x35')]);_0x10a7b2[_0xddfd('0x37')]=_['intersection'](_0x1b0c20['model'],qs[_0xddfd('0x38')](_0x255075['query'][_0xddfd('0x38')]));_0x10a7b2[_0xddfd('0x37')]=_0x10a7b2['attributes'][_0xddfd('0x39')]?_0x10a7b2[_0xddfd('0x37')]:_0x1b0c20['model'];if(_0x255075['query'][_0xddfd('0x43')]){_0x10a7b2['include']=[{'all':!![]}];}_0x10a7b2=_[_0xddfd('0x41')]({},_0x10a7b2,_0x255075['options']);return db[_0xddfd('0x30')][_0xddfd('0x4a')](_0x10a7b2)[_0xddfd('0x2a')](handleEntityNotFound(_0x13c01b,null))[_0xddfd('0x2a')](respondWithResult(_0x13c01b,null))[_0xddfd('0x46')](handleError(_0x13c01b,null));};exports['create']=function(_0x586e1c,_0x203a65){return db[_0xddfd('0x30')]['create'](_0x586e1c[_0xddfd('0x4b')],{})[_0xddfd('0x2a')](respondWithResult(_0x203a65,0xc9))[_0xddfd('0x46')](handleError(_0x203a65,null));};exports['clone']=function(_0x32a7cf,_0x485a1b){var _0x32b6c0={'where':{'id':_0x32a7cf[_0xddfd('0x48')]['id']}},_0x505759={};_0x505759[_0xddfd('0x34')]=_[_0xddfd('0x4c')](db[_0xddfd('0x30')][_0xddfd('0x49')]);_0x32b6c0[_0xddfd('0x37')]=_[_0xddfd('0x36')](_0x505759['model'],qs[_0xddfd('0x38')](_0x32a7cf[_0xddfd('0x35')][_0xddfd('0x38')]));_0x32b6c0['attributes']=_0x32b6c0[_0xddfd('0x37')][_0xddfd('0x39')]?_0x32b6c0['attributes']:_0x505759[_0xddfd('0x34')];if(_0x32a7cf[_0xddfd('0x35')]['includeAll']){_0x32b6c0[_0xddfd('0x44')]=[{'all':!![]}];}_0x32b6c0=_['merge']({},_0x32b6c0,_0x32a7cf[_0xddfd('0x4d')]);return db[_0xddfd('0x30')][_0xddfd('0x4a')](_0x32b6c0)['then'](handleEntityNotFound(_0x485a1b,null))['then'](function(_0x2f7472){if(_0x2f7472){var _0x5d8d35=_0x2f7472[_0xddfd('0x4e')]({'plain':!![]});_0x5d8d35=qs[_0xddfd('0x4f')](_0x5d8d35,['id',_0xddfd('0x50'),_0xddfd('0x51'),_0xddfd('0x52')]);_0x32a7cf[_0xddfd('0x4b')]=_['omit'](_0x32a7cf[_0xddfd('0x4b')],['id',_0xddfd('0x50'),_0xddfd('0x51')]);return db[_0xddfd('0x53')][_0xddfd('0x54')](function(_0x35b5d9){return db['UserProfile'][_0xddfd('0x55')](_['merge'](_0x5d8d35,_0x32a7cf['body']),{'include':_0x32a7cf[_0xddfd('0x35')][_0xddfd('0x43')]?[{'all':!![]}]:undefined,'transaction':_0x35b5d9})['then'](function(_0x348661){var _0x26457a=_0x348661[_0xddfd('0x4e')]({'plain':!![]});return db[_0xddfd('0x56')][_0xddfd('0x57')]({'where':{'userProfileId':_0x32a7cf[_0xddfd('0x48')]['id']},'raw':!![]})[_0xddfd('0x2a')](function(_0x4fd7d8){if(_0x4fd7d8){return BPromise[_0xddfd('0x58')](_0x4fd7d8,function(_0x59a97e){return new BPromise(function(_0x3c6fc8,_0x514909){if(_0x59a97e[_0xddfd('0x59')]===null||_0x59a97e[_0xddfd('0x59')]===0x1)_0x3c6fc8(null);return db[_0xddfd('0x5a')]['findAll']({'where':{'sectionId':_0x59a97e['id']},'raw':!![]})['then'](function(_0x5a3d73){var _0x4535dd=_[_0xddfd('0x5b')](_0x5a3d73,function(_0x152304){return qs[_0xddfd('0x4f')](_0x152304,['id',_0xddfd('0x50'),'updatedAt','sectionId']);});_0x3c6fc8(_0x4535dd);})['catch'](function(_0x5994d1){_0x514909(_0x5994d1);});})[_0xddfd('0x2a')](function(_0x3c6cd5){var _0xf01433=qs[_0xddfd('0x4f')](_0x59a97e,['id',_0xddfd('0x50'),'updatedAt']);_0xf01433[_0xddfd('0x5c')]=_0x26457a['id'];if(_0x3c6cd5)_0xf01433[_0xddfd('0x5d')]=_0x3c6cd5;return _0xf01433;})['then'](function(_0x4bff04){return db[_0xddfd('0x56')][_0xddfd('0x55')](_0x4bff04,{'include':[{'model':db[_0xddfd('0x5a')],'as':_0xddfd('0x5d')}],'raw':!![],'transaction':_0x35b5d9});});})[_0xddfd('0x2a')](function(){return _0x26457a;});}});});});}})[_0xddfd('0x2a')](respondWithResult(_0x485a1b,0xc9))[_0xddfd('0x46')](handleError(_0x485a1b,null));};exports['update']=function(_0x51f6f7,_0x4c4fd5){if(_0x51f6f7[_0xddfd('0x4b')]['id']){delete _0x51f6f7[_0xddfd('0x4b')]['id'];}return db['UserProfile']['find']({'where':{'id':_0x51f6f7[_0xddfd('0x48')]['id']}})[_0xddfd('0x2a')](handleEntityNotFound(_0x4c4fd5,null))['then'](saveUpdates(_0x51f6f7['body'],null))['then'](respondWithResult(_0x4c4fd5,null))['catch'](handleError(_0x4c4fd5,null));};exports[_0xddfd('0x2b')]=function(_0x1116c,_0x2d5bfd){return db[_0xddfd('0x30')][_0xddfd('0x4a')]({'where':{'id':_0x1116c[_0xddfd('0x48')]['id']}})['then'](handleEntityNotFound(_0x2d5bfd,null))[_0xddfd('0x2a')](removeEntity(_0x2d5bfd,null))[_0xddfd('0x46')](handleError(_0x2d5bfd,null));};exports['describe']=function(_0x166acd,_0x4f9f02){return db[_0xddfd('0x30')][_0xddfd('0x5e')]()['then'](respondWithResult(_0x4f9f02,null))[_0xddfd('0x46')](handleError(_0x4f9f02,null));};exports['addSections']=function(_0x4c63cd,_0x1a1aef){var _0xd84c9e=_0x4c63cd[_0xddfd('0x4b')];return db[_0xddfd('0x30')]['find']({'where':{'id':_0x4c63cd[_0xddfd('0x48')]['id']}})[_0xddfd('0x2a')](handleEntityNotFound(_0x1a1aef,null))[_0xddfd('0x2a')](function(_0x59d913){if(_0x59d913){return db['sequelize'][_0xddfd('0x54')](function(_0x369549){return db[_0xddfd('0x56')][_0xddfd('0x2b')]({'where':{'userProfileId':_0x4c63cd[_0xddfd('0x48')]['id'],'sectionId':_['map'](_0xd84c9e,function(_0x1596ac){return _0x1596ac[_0xddfd('0x5f')];})},'transaction':_0x369549})[_0xddfd('0x2a')](function(){var _0x14bbda=_['map'](_0xd84c9e,function(_0x53b31b){_0x53b31b[_0xddfd('0x5c')]=_0x4c63cd[_0xddfd('0x48')]['id'];return _0x53b31b;});var _0x34883e=[];return BPromise[_0xddfd('0x58')](_0x14bbda,function(_0x124511){return db[_0xddfd('0x56')][_0xddfd('0x55')](_0x124511,{'include':[{'model':db['UserProfileResource'],'as':_0xddfd('0x5d')}],'raw':!![],'transaction':_0x369549})['then'](function(_0x2ec195){_0x34883e[_0xddfd('0x60')](_0x2ec195['get']({'plain':!![]}));});})['then'](function(){return _0x34883e;});});});}})[_0xddfd('0x2a')](function(_0x2ef3f0){return _0x2ef3f0;})[_0xddfd('0x2a')](respondWithResult(_0x1a1aef,null))['catch'](handleError(_0x1a1aef,null));};exports[_0xddfd('0x61')]=function(_0x27febc,_0xb4cd48){var _0x24fd07;return db['UserProfile'][_0xddfd('0x4a')]({'where':{'id':_0x27febc[_0xddfd('0x48')]['id']},'attributes':['id',_0xddfd('0x2e')]})[_0xddfd('0x2a')](handleEntityNotFound(_0xb4cd48,null))[_0xddfd('0x2a')](function(_0x48eca7){if(_0x48eca7){_0x24fd07=_0x48eca7;return db[_0xddfd('0x56')][_0xddfd('0x2b')]({'where':{'userProfileId':_0x27febc[_0xddfd('0x48')]['id'],'sectionId':_0x27febc['query'][_0xddfd('0x62')]}});}})['then'](function(){return _0x24fd07;})['then'](respondWithStatusCode(_0xb4cd48,null))[_0xddfd('0x46')](handleError(_0xb4cd48,null));};exports[_0xddfd('0x63')]=function(_0x4f2d8c,_0x3e1b0e){var _0x1bae87=[];var _0x207102=[];return db[_0xddfd('0x56')][_0xddfd('0x57')]({'where':{'userProfileId':_0x4f2d8c['params']['id']},'raw':!![]})[_0xddfd('0x2a')](function(_0xa3a701){_0x1bae87=_[_0xddfd('0x40')](_0xa3a701,function(_0x42f3c2){return _0x42f3c2[_0xddfd('0x64')]===0x1||_['includes']([0x3eb,0x709],_0x42f3c2[_0xddfd('0x5f')]);});if(!_[_0xddfd('0x65')](_0x1bae87)){return _['map'](_0x1bae87,function(_0x265093){return _0x265093['sectionId'];});}else{return;}})[_0xddfd('0x2a')](function(_0x2f5d91){if(_0x2f5d91)_0x207102=_0x2f5d91;if(_['includes'](_0x207102,0x64)){var _0x428648=_[_0xddfd('0x4a')](_0x1bae87,{'sectionId':0x64});return hasDefaultDashboard(_0x428648)[_0xddfd('0x2a')](function(_0x21368e){return _[_0xddfd('0x5b')](_0x1bae87,function(_0x472f92){if(_0x472f92[_0xddfd('0x5f')]===0x64){_0x472f92[_0xddfd('0x66')]=_0x21368e;}return _0x472f92;});});}else{return;}})[_0xddfd('0x2a')](function(_0x2fa89c){if(_0x2fa89c)_0x1bae87=_0x2fa89c;if(_[_0xddfd('0x67')](_0x207102,0x3eb)){var _0x369ba8=_['find'](_0x1bae87,{'sectionId':0x3eb});return getCustomDashboards(_0x369ba8)[_0xddfd('0x2a')](function(_0x4467d8){return _['map'](_0x1bae87,function(_0x4d536e){if(_0x369ba8[_0xddfd('0x64')]){if(_0x4d536e[_0xddfd('0x5f')]===0x3eb){_0x4d536e[_0xddfd('0x66')]=_0x4467d8;}}else{if(_0x4d536e[_0xddfd('0x5f')]===0x64){_0x4d536e[_0xddfd('0x66')]=_0x4467d8;}}return _0x4d536e;});});}else{return;}})[_0xddfd('0x2a')](function(_0x213ef4){if(_0x213ef4)_0x1bae87=_0x213ef4;if(_[_0xddfd('0x67')](_0x207102,0x709)){var _0x4b98d5=_['find'](_0x1bae87,{'sectionId':0x709});return getPlugins(_0x4b98d5)[_0xddfd('0x2a')](function(_0x268853){if(_0x4b98d5[_0xddfd('0x64')]){return _[_0xddfd('0x5b')](_0x1bae87,function(_0x540df1){if(_0x540df1[_0xddfd('0x5f')]===0x709){_0x540df1[_0xddfd('0x66')]=_0x268853;}return _0x540df1;});}else{var _0x5c5b04={'sectionId':0x76c,'enabled':0x1,'subsections':_0x268853};var _0x1f7a25=_[_0xddfd('0x5b')](_0x1bae87);_0x1f7a25[_0xddfd('0x60')](_0x5c5b04);return _0x1f7a25;}});}else{return;}})[_0xddfd('0x2a')](function(_0x28af28){if(_0x28af28)_0x1bae87=_0x28af28;return _[_0xddfd('0x40')](_0x1bae87,[_0xddfd('0x64'),0x1]);})['then'](respondWithResult(_0x3e1b0e,null))[_0xddfd('0x46')](handleError(_0x3e1b0e,null));};function hasDefaultDashboard(_0x4b5719){var _0x3ad15f=[0x65];return new BPromise(function(_0x199324,_0x42cb42){try{if(_0x4b5719[_0xddfd('0x59')]){_0x199324(_0x3ad15f);}else{return db[_0xddfd('0x5a')][_0xddfd('0x68')]({'where':{'sectionId':_0x4b5719['id']},'raw':!![]})[_0xddfd('0x2a')](function(_0x23ee8d){_0x23ee8d?_0x199324(_0x3ad15f):_0x199324();});}}catch(_0x1335f1){_0x42cb42(_0x1335f1);}});}function getCustomDashboards(_0x4060db){var _0x26f5ba=[];return new BPromise(function(_0x5ae2b5,_0x50a728){try{if(_0x4060db['autoAssociation']){return db['Dashboard'][_0xddfd('0x57')]({'raw':!![]})[_0xddfd('0x2a')](function(_0x2e2689){_0x2e2689[_0xddfd('0x69')](function(_0xdb2c7d){_0x26f5ba[_0xddfd('0x60')](_0xdb2c7d['id']+0x1869f);});_0x5ae2b5(_0x26f5ba);});}else{return db[_0xddfd('0x5a')][_0xddfd('0x57')]({'where':{'sectionId':_0x4060db['id']},'raw':!![]})['then'](function(_0x24f34e){_0x24f34e[_0xddfd('0x69')](function(_0xfacc86){_0x26f5ba[_0xddfd('0x60')](_0xfacc86[_0xddfd('0x6a')]+0x1869f);});_0x5ae2b5(_0x26f5ba);});}}catch(_0x349aff){_0x50a728(_0x349aff);}});}function getPlugins(_0x18e460){var _0x709463=[];return new BPromise(function(_0x4fe12a,_0x32f13d){try{if(_0x18e460[_0xddfd('0x59')]){return db['Plugin']['findAll']({'raw':!![]})[_0xddfd('0x2a')](function(_0x151cad){_0x151cad[_0xddfd('0x69')](function(_0x2ce319){_0x709463[_0xddfd('0x60')](_0x2ce319['id']+0x15b38);});_0x4fe12a(_0x709463);});}else{return db[_0xddfd('0x5a')][_0xddfd('0x57')]({'where':{'sectionId':_0x18e460['id']},'raw':!![]})[_0xddfd('0x2a')](function(_0x3fd57d){_0x3fd57d[_0xddfd('0x69')](function(_0x15d509){_0x709463[_0xddfd('0x60')](_0x15d509[_0xddfd('0x6a')]+0x15b38);});_0x4fe12a(_0x709463);});}}catch(_0x1da8c3){_0x32f13d(_0x1da8c3);}});}exports[_0xddfd('0x6b')]=function(_0x5533e1,_0x4be9bc){return db[_0xddfd('0x30')]['find']({'where':{'id':_0x5533e1[_0xddfd('0x48')]['id']}})[_0xddfd('0x2a')](handleEntityNotFound(_0x4be9bc,null))[_0xddfd('0x2a')](function(_0x3b3481){if(_0x3b3481){return db[_0xddfd('0x53')]['transaction'](function(_0x1302a4){return db[_0xddfd('0x56')][_0xddfd('0x57')]({'where':{'userProfileId':_0x5533e1[_0xddfd('0x48')]['id']},'attributes':['id'],'raw':!![]})[_0xddfd('0x2a')](function(_0x1f6b8e){if(_0x1f6b8e){return db['UserProfileSection'][_0xddfd('0x2b')]({'where':{'userProfileId':_0x5533e1[_0xddfd('0x48')]['id'],'id':_[_0xddfd('0x5b')](_0x1f6b8e,function(_0x388619){return _0x388619['id'];})},'transaction':_0x1302a4});}})['then'](function(_0x14a295){var _0x21c2d6=_[_0xddfd('0x5b')](_0x5533e1[_0xddfd('0x4b')],function(_0x18c696){_0x18c696['userProfileId']=_0x5533e1[_0xddfd('0x48')]['id'];return _0x18c696;});return db[_0xddfd('0x56')][_0xddfd('0x6c')](_0x21c2d6,{'raw':!![],'transaction':_0x1302a4});})['then'](function(_0x572c9f){var _0x2b7669=_[_0xddfd('0x40')](_[_0xddfd('0x5b')](_0x572c9f,function(_0x176bd2){return _0x176bd2[_0xddfd('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0x2b7669){return db[_0xddfd('0x56')][_0xddfd('0x57')]({'where':{'userProfileId':_0x5533e1[_0xddfd('0x48')]['id'],'sectionId':_['map'](_0x2b7669,function(_0x16c660){return _0x16c660[_0xddfd('0x5f')];})},'attributes':['id',_0xddfd('0x5f')],'raw':!![]})[_0xddfd('0x2a')](function(_0x2bb517){var _0x2b033a=_['map'](_0x5533e1['body'],function(_0x3d41fa){_0x3d41fa[_0xddfd('0x5c')]=_0x5533e1[_0xddfd('0x48')]['id'];return _0x3d41fa;});return db[_0xddfd('0x5a')][_0xddfd('0x6c')](_0x2b033a,{'raw':!![],'transaction':_0x1302a4});});}})[_0xddfd('0x46')](handleError(_0x4be9bc,null));});}})[_0xddfd('0x2a')](function(_0x199dbf){var _0x3dc67b=_[_0xddfd('0x5b')](_0x199dbf,function(_0x26c1ac){return _0x26c1ac[_0xddfd('0x4e')]({'plain':!![]});});})[_0xddfd('0x2a')](respondWithResult(_0x4be9bc,null))[_0xddfd('0x46')](handleError(_0x4be9bc,null));};exports[_0xddfd('0x6d')]=function(_0x4186d2,_0x5a3a15,_0x234da6){return db['UserProfile'][_0xddfd('0x4a')]({'where':{'id':_0x4186d2[_0xddfd('0x48')]['id']}})[_0xddfd('0x2a')](handleEntityNotFound(_0x5a3a15,null))[_0xddfd('0x2a')](function(_0xb75789){if(_0xb75789){return _0xb75789['removeResources'](_0x4186d2[_0xddfd('0x35')][_0xddfd('0x62')]);}})[_0xddfd('0x2a')](respondWithStatusCode(_0x5a3a15,null))[_0xddfd('0x46')](handleError(_0x5a3a15,null));};exports[_0xddfd('0x6e')]=function(_0x5a896c,_0x18d63f){var _0x2c6e1e={};if(!_0x5a896c[_0xddfd('0x35')][_0xddfd('0x6f')])throw new Error(_0xddfd('0x70'));if(!_0x5a896c[_0xddfd('0x35')]['hasOwnProperty'](_0xddfd('0x3a'))){_0x2c6e1e[_0xddfd('0x22')]=qs[_0xddfd('0x22')](_0x5a896c['query'][_0xddfd('0x22')]);_0x2c6e1e[_0xddfd('0x20')]=qs['offset'](_0x5a896c[_0xddfd('0x35')][_0xddfd('0x20')]);}return db[_0xddfd('0x30')][_0xddfd('0x4a')]({'where':{'id':_0x5a896c['params']['id']}})[_0xddfd('0x2a')](function(_0x51b07a){if(!_0x51b07a)throw new Error(_0xddfd('0x71')+_0x5a896c[_0xddfd('0x48')]['id']);return db[_0xddfd('0x30')][_0xddfd('0x6e')](_0x5a896c);})['then'](respondWithFilteredResult(_0x18d63f,_0x2c6e1e))['catch'](handleError(_0x18d63f,null));}; \ No newline at end of file +var _0xc00b=['sort','where','filter','merge','options','include','findAll','show','find','catch','create','body','clone','params','includeAll','get','omit','createdAt','crudPermissions','updatedAt','sequelize','transaction','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','UserProfileSection','each','removeSections','getSections','includes','isEmpty','subsections','enabled','push','findOne','forEach','resourceId','addResources','bulkCreate','removeResources','ids','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','undefined','limit','offset','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x5dc2fa,_0x56279d){var _0x16eaf9=function(_0x83322){while(--_0x83322){_0x5dc2fa['push'](_0x5dc2fa['shift']());}};_0x16eaf9(++_0x56279d);}(_0xc00b,0x1e5));var _0xbc00=function(_0x1e4150,_0x55b02a){_0x1e4150=_0x1e4150-0x0;var _0x1ce3ee=_0xc00b[_0x1e4150];return _0x1ce3ee;};'use strict';var emlformat=require(_0xbc00('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbc00('0x1'));var moment=require('moment');var BPromise=require(_0xbc00('0x2'));var Mustache=require(_0xbc00('0x3'));var util=require(_0xbc00('0x4'));var path=require(_0xbc00('0x5'));var sox=require('sox');var csv=require(_0xbc00('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbc00('0x7'));var _=require('lodash');var squel=require(_0xbc00('0x8'));var crypto=require(_0xbc00('0x9'));var jsforce=require(_0xbc00('0xa'));var deskjs=require(_0xbc00('0xb'));var toCsv=require(_0xbc00('0x6'));var querystring=require(_0xbc00('0xc'));var Papa=require('papaparse');var Redis=require(_0xbc00('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xbc00('0xe'));var as=require(_0xbc00('0xf'));var hardwareService=require(_0xbc00('0x10'));var logger=require('../../config/logger')(_0xbc00('0x11'));var utils=require('../../config/utils');var config=require(_0xbc00('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xbc00('0x13'))['db'];config[_0xbc00('0x14')]=_[_0xbc00('0x15')](config['redis'],{'host':_0xbc00('0x16'),'port':0x18eb});var socket=require(_0xbc00('0x17'))(new Redis(config[_0xbc00('0x14')]));require('./userProfile.socket')[_0xbc00('0x18')](socket);function respondWithStatusCode(_0xd05e85,_0x573cf4){_0x573cf4=_0x573cf4||0xcc;return function(_0x33ce58){if(_0x33ce58){return _0xd05e85[_0xbc00('0x19')](_0x573cf4);}return _0xd05e85[_0xbc00('0x1a')](_0x573cf4)[_0xbc00('0x1b')]();};}function respondWithResult(_0x46ae64,_0x132011){_0x132011=_0x132011||0xc8;return function(_0x432a0d){if(_0x432a0d){return _0x46ae64['status'](_0x132011)['json'](_0x432a0d);}};}function respondWithFilteredResult(_0x53b0cd,_0x2d12f2){return function(_0x4e529d){if(_0x4e529d){var _0xdfc990=typeof _0x2d12f2['offset']===_0xbc00('0x1c')&&typeof _0x2d12f2[_0xbc00('0x1d')]==='undefined';var _0x3820c5=_0x4e529d['count'];var _0x44590e=_0xdfc990?0x0:_0x2d12f2[_0xbc00('0x1e')];var _0x48b39b=_0xdfc990?_0x4e529d[_0xbc00('0x1f')]:_0x2d12f2[_0xbc00('0x1e')]+_0x2d12f2[_0xbc00('0x1d')];var _0x13abd5;if(_0x48b39b>=_0x3820c5){_0x48b39b=_0x3820c5;_0x13abd5=0xc8;}else{_0x13abd5=0xce;}_0x53b0cd[_0xbc00('0x1a')](_0x13abd5);return _0x53b0cd[_0xbc00('0x20')]('Content-Range',_0x44590e+'-'+_0x48b39b+'/'+_0x3820c5)['json'](_0x4e529d);}return null;};}function patchUpdates(_0x39afdf){return function(_0x30c72a){try{jsonpatch[_0xbc00('0x21')](_0x30c72a,_0x39afdf,!![]);}catch(_0x5286eb){return BPromise[_0xbc00('0x22')](_0x5286eb);}return _0x30c72a[_0xbc00('0x23')]();};}function saveUpdates(_0x593289,_0x5f05c7){return function(_0x3c5623){if(_0x3c5623){return _0x3c5623[_0xbc00('0x24')](_0x593289)[_0xbc00('0x25')](function(_0x532f0d){return _0x532f0d;});}return null;};}function removeEntity(_0x5f21c5,_0x1a969f){return function(_0x510a0a){if(_0x510a0a){return _0x510a0a[_0xbc00('0x26')]()[_0xbc00('0x25')](function(){_0x5f21c5['status'](0xcc)[_0xbc00('0x1b')]();});}};}function handleEntityNotFound(_0x1aa791,_0x18fb72){return function(_0x1ef0cc){if(!_0x1ef0cc){_0x1aa791['sendStatus'](0x194);}return _0x1ef0cc;};}function handleError(_0x34ba27,_0x290557){_0x290557=_0x290557||0x1f4;return function(_0x15724a){logger[_0xbc00('0x27')](_0x15724a[_0xbc00('0x28')]);if(_0x15724a[_0xbc00('0x29')]){delete _0x15724a[_0xbc00('0x29')];}_0x34ba27['status'](_0x290557)[_0xbc00('0x2a')](_0x15724a);};}exports[_0xbc00('0x2b')]=function(_0x5dc5d9,_0x2c0cb3){var _0x2d4fad={},_0x3cfc78={},_0x39cfd0={'count':0x0,'rows':[]};var _0x215c71=_[_0xbc00('0x2c')](db[_0xbc00('0x2d')][_0xbc00('0x2e')],function(_0x3d361b){return{'name':_0x3d361b[_0xbc00('0x2f')],'type':_0x3d361b['type'][_0xbc00('0x30')]};});_0x3cfc78[_0xbc00('0x31')]=_[_0xbc00('0x2c')](_0x215c71,_0xbc00('0x29'));_0x3cfc78['query']=_[_0xbc00('0x32')](_0x5dc5d9[_0xbc00('0x33')]);_0x3cfc78[_0xbc00('0x34')]=_[_0xbc00('0x35')](_0x3cfc78[_0xbc00('0x31')],_0x3cfc78['query']);_0x2d4fad[_0xbc00('0x36')]=_[_0xbc00('0x35')](_0x3cfc78[_0xbc00('0x31')],qs['fields'](_0x5dc5d9[_0xbc00('0x33')][_0xbc00('0x37')]));_0x2d4fad[_0xbc00('0x36')]=_0x2d4fad[_0xbc00('0x36')][_0xbc00('0x38')]?_0x2d4fad['attributes']:_0x3cfc78[_0xbc00('0x31')];if(!_0x5dc5d9[_0xbc00('0x33')][_0xbc00('0x39')](_0xbc00('0x3a'))){_0x2d4fad[_0xbc00('0x1d')]=qs[_0xbc00('0x1d')](_0x5dc5d9['query']['limit']);_0x2d4fad[_0xbc00('0x1e')]=qs[_0xbc00('0x1e')](_0x5dc5d9[_0xbc00('0x33')][_0xbc00('0x1e')]);}_0x2d4fad[_0xbc00('0x3b')]=qs['sort'](_0x5dc5d9['query'][_0xbc00('0x3c')]);_0x2d4fad[_0xbc00('0x3d')]=qs[_0xbc00('0x34')](_['pick'](_0x5dc5d9[_0xbc00('0x33')],_0x3cfc78[_0xbc00('0x34')]),_0x215c71);if(_0x5dc5d9[_0xbc00('0x33')][_0xbc00('0x3e')]){_0x2d4fad['where']=_[_0xbc00('0x3f')](_0x2d4fad['where'],{'$or':_[_0xbc00('0x2c')](_0x215c71,function(_0xf0964f){if(_0xf0964f['type']!=='VIRTUAL'){var _0x9f979d={};_0x9f979d[_0xf0964f[_0xbc00('0x29')]]={'$like':'%'+_0x5dc5d9[_0xbc00('0x33')][_0xbc00('0x3e')]+'%'};return _0x9f979d;}})});}_0x2d4fad=_[_0xbc00('0x3f')]({},_0x2d4fad,_0x5dc5d9[_0xbc00('0x40')]);var _0x18dea0={'where':_0x2d4fad[_0xbc00('0x3d')]};return db[_0xbc00('0x2d')]['count'](_0x18dea0)[_0xbc00('0x25')](function(_0x51c4d8){_0x39cfd0[_0xbc00('0x1f')]=_0x51c4d8;if(_0x5dc5d9[_0xbc00('0x33')]['includeAll']){_0x2d4fad[_0xbc00('0x41')]=[{'all':!![]}];}return db['UserProfile'][_0xbc00('0x42')](_0x2d4fad);})[_0xbc00('0x25')](function(_0x25b82a){_0x39cfd0['rows']=_0x25b82a;return _0x39cfd0;})[_0xbc00('0x25')](respondWithFilteredResult(_0x2c0cb3,_0x2d4fad))['catch'](handleError(_0x2c0cb3,null));};exports[_0xbc00('0x43')]=function(_0x119ec6,_0x3d0eb3){var _0x2fa581={'raw':![],'where':{'id':_0x119ec6['params']['id']}},_0x3b4d6f={};_0x3b4d6f['model']=_['keys'](db['UserProfile'][_0xbc00('0x2e')]);_0x3b4d6f[_0xbc00('0x33')]=_['keys'](_0x119ec6[_0xbc00('0x33')]);_0x3b4d6f[_0xbc00('0x34')]=_[_0xbc00('0x35')](_0x3b4d6f['model'],_0x3b4d6f[_0xbc00('0x33')]);_0x2fa581[_0xbc00('0x36')]=_['intersection'](_0x3b4d6f['model'],qs['fields'](_0x119ec6[_0xbc00('0x33')][_0xbc00('0x37')]));_0x2fa581[_0xbc00('0x36')]=_0x2fa581[_0xbc00('0x36')][_0xbc00('0x38')]?_0x2fa581[_0xbc00('0x36')]:_0x3b4d6f[_0xbc00('0x31')];if(_0x119ec6['query']['includeAll']){_0x2fa581[_0xbc00('0x41')]=[{'all':!![]}];}_0x2fa581=_['merge']({},_0x2fa581,_0x119ec6[_0xbc00('0x40')]);return db['UserProfile'][_0xbc00('0x44')](_0x2fa581)[_0xbc00('0x25')](handleEntityNotFound(_0x3d0eb3,null))['then'](respondWithResult(_0x3d0eb3,null))[_0xbc00('0x45')](handleError(_0x3d0eb3,null));};exports[_0xbc00('0x46')]=function(_0x5ec178,_0x3fa95f){return db['UserProfile'][_0xbc00('0x46')](_0x5ec178[_0xbc00('0x47')],{})['then'](respondWithResult(_0x3fa95f,0xc9))[_0xbc00('0x45')](handleError(_0x3fa95f,null));};exports[_0xbc00('0x48')]=function(_0x59bd30,_0x2c3b5d){var _0x45a5a9={'where':{'id':_0x59bd30[_0xbc00('0x49')]['id']}},_0x56d70b={};_0x56d70b[_0xbc00('0x31')]=_[_0xbc00('0x32')](db[_0xbc00('0x2d')][_0xbc00('0x2e')]);_0x45a5a9[_0xbc00('0x36')]=_[_0xbc00('0x35')](_0x56d70b[_0xbc00('0x31')],qs['fields'](_0x59bd30[_0xbc00('0x33')][_0xbc00('0x37')]));_0x45a5a9['attributes']=_0x45a5a9[_0xbc00('0x36')][_0xbc00('0x38')]?_0x45a5a9[_0xbc00('0x36')]:_0x56d70b[_0xbc00('0x31')];if(_0x59bd30[_0xbc00('0x33')][_0xbc00('0x4a')]){_0x45a5a9[_0xbc00('0x41')]=[{'all':!![]}];}_0x45a5a9=_[_0xbc00('0x3f')]({},_0x45a5a9,_0x59bd30[_0xbc00('0x40')]);return db[_0xbc00('0x2d')][_0xbc00('0x44')](_0x45a5a9)[_0xbc00('0x25')](handleEntityNotFound(_0x2c3b5d,null))[_0xbc00('0x25')](function(_0x6aeba8){if(_0x6aeba8){var _0x4da05c=_0x6aeba8[_0xbc00('0x4b')]({'plain':!![]});_0x4da05c=qs[_0xbc00('0x4c')](_0x4da05c,['id',_0xbc00('0x4d'),'updatedAt',_0xbc00('0x4e')]);_0x59bd30[_0xbc00('0x47')]=_[_0xbc00('0x4c')](_0x59bd30[_0xbc00('0x47')],['id',_0xbc00('0x4d'),_0xbc00('0x4f')]);return db[_0xbc00('0x50')][_0xbc00('0x51')](function(_0x110be7){return db[_0xbc00('0x2d')][_0xbc00('0x46')](_[_0xbc00('0x3f')](_0x4da05c,_0x59bd30['body']),{'include':_0x59bd30[_0xbc00('0x33')][_0xbc00('0x4a')]?[{'all':!![]}]:undefined,'transaction':_0x110be7})[_0xbc00('0x25')](function(_0x5715b3){var _0x4040d0=_0x5715b3['get']({'plain':!![]});return db['UserProfileSection'][_0xbc00('0x42')]({'where':{'userProfileId':_0x59bd30[_0xbc00('0x49')]['id']},'raw':!![]})[_0xbc00('0x25')](function(_0xb2c0ec){if(_0xb2c0ec){return BPromise['each'](_0xb2c0ec,function(_0x981fb6){return new BPromise(function(_0x3c0003,_0x82d5fb){if(_0x981fb6['autoAssociation']===null||_0x981fb6[_0xbc00('0x52')]===0x1)_0x3c0003(null);return db[_0xbc00('0x53')][_0xbc00('0x42')]({'where':{'sectionId':_0x981fb6['id']},'raw':!![]})[_0xbc00('0x25')](function(_0x517dbf){var _0x142d2f=_[_0xbc00('0x2c')](_0x517dbf,function(_0x33b40f){return qs['omit'](_0x33b40f,['id',_0xbc00('0x4d'),_0xbc00('0x4f'),_0xbc00('0x54')]);});_0x3c0003(_0x142d2f);})['catch'](function(_0x563ad8){_0x82d5fb(_0x563ad8);});})[_0xbc00('0x25')](function(_0x458546){var _0x2c0640=qs['omit'](_0x981fb6,['id',_0xbc00('0x4d'),_0xbc00('0x4f')]);_0x2c0640[_0xbc00('0x55')]=_0x4040d0['id'];if(_0x458546)_0x2c0640[_0xbc00('0x56')]=_0x458546;return _0x2c0640;})[_0xbc00('0x25')](function(_0x1aa548){return db['UserProfileSection']['create'](_0x1aa548,{'include':[{'model':db[_0xbc00('0x53')],'as':_0xbc00('0x56')}],'raw':!![],'transaction':_0x110be7});});})[_0xbc00('0x25')](function(){return _0x4040d0;});}});});});}})[_0xbc00('0x25')](respondWithResult(_0x2c3b5d,0xc9))['catch'](handleError(_0x2c3b5d,null));};exports['update']=function(_0xf734e0,_0x12a1dc){if(_0xf734e0[_0xbc00('0x47')]['id']){delete _0xf734e0[_0xbc00('0x47')]['id'];}return db['UserProfile'][_0xbc00('0x44')]({'where':{'id':_0xf734e0[_0xbc00('0x49')]['id']}})[_0xbc00('0x25')](handleEntityNotFound(_0x12a1dc,null))[_0xbc00('0x25')](saveUpdates(_0xf734e0[_0xbc00('0x47')],null))[_0xbc00('0x25')](respondWithResult(_0x12a1dc,null))[_0xbc00('0x45')](handleError(_0x12a1dc,null));};exports[_0xbc00('0x26')]=function(_0x26f6ae,_0x558a32){return db[_0xbc00('0x2d')][_0xbc00('0x44')]({'where':{'id':_0x26f6ae[_0xbc00('0x49')]['id']}})['then'](handleEntityNotFound(_0x558a32,null))[_0xbc00('0x25')](removeEntity(_0x558a32,null))[_0xbc00('0x45')](handleError(_0x558a32,null));};exports[_0xbc00('0x57')]=function(_0x1b14da,_0x14a06e){return db['UserProfile']['describe']()[_0xbc00('0x25')](respondWithResult(_0x14a06e,null))[_0xbc00('0x45')](handleError(_0x14a06e,null));};exports[_0xbc00('0x58')]=function(_0x55f2ac,_0x2efabc){var _0x1c0535=_0x55f2ac[_0xbc00('0x47')];return db[_0xbc00('0x2d')][_0xbc00('0x44')]({'where':{'id':_0x55f2ac[_0xbc00('0x49')]['id']}})['then'](handleEntityNotFound(_0x2efabc,null))['then'](function(_0x3d4cf9){if(_0x3d4cf9){return db[_0xbc00('0x50')][_0xbc00('0x51')](function(_0x30d70d){return db[_0xbc00('0x59')]['destroy']({'where':{'userProfileId':_0x55f2ac['params']['id'],'sectionId':_[_0xbc00('0x2c')](_0x1c0535,function(_0x16cbc5){return _0x16cbc5[_0xbc00('0x54')];})},'transaction':_0x30d70d})['then'](function(){var _0x168c39=_[_0xbc00('0x2c')](_0x1c0535,function(_0x2bd90a){_0x2bd90a[_0xbc00('0x55')]=_0x55f2ac['params']['id'];return _0x2bd90a;});var _0x49a96b=[];return BPromise[_0xbc00('0x5a')](_0x168c39,function(_0x480e92){return db[_0xbc00('0x59')][_0xbc00('0x46')](_0x480e92,{'include':[{'model':db[_0xbc00('0x53')],'as':_0xbc00('0x56')}],'raw':!![],'transaction':_0x30d70d})['then'](function(_0x5acdda){_0x49a96b['push'](_0x5acdda[_0xbc00('0x4b')]({'plain':!![]}));});})[_0xbc00('0x25')](function(){return _0x49a96b;});});});}})[_0xbc00('0x25')](function(_0x37ce97){return _0x37ce97;})['then'](respondWithResult(_0x2efabc,null))[_0xbc00('0x45')](handleError(_0x2efabc,null));};exports[_0xbc00('0x5b')]=function(_0x13dd66,_0x280854){var _0x136ae8;return db[_0xbc00('0x2d')][_0xbc00('0x44')]({'where':{'id':_0x13dd66['params']['id']},'attributes':['id','name']})['then'](handleEntityNotFound(_0x280854,null))[_0xbc00('0x25')](function(_0x3473c3){if(_0x3473c3){_0x136ae8=_0x3473c3;return db[_0xbc00('0x59')][_0xbc00('0x26')]({'where':{'userProfileId':_0x13dd66['params']['id'],'sectionId':_0x13dd66['query']['ids']}});}})['then'](function(){return _0x136ae8;})[_0xbc00('0x25')](respondWithStatusCode(_0x280854,null))[_0xbc00('0x45')](handleError(_0x280854,null));};exports[_0xbc00('0x5c')]=function(_0x24ff43,_0x14ec73){var _0x79cba4=[];var _0x13f1e5=[];return db[_0xbc00('0x59')][_0xbc00('0x42')]({'where':{'userProfileId':_0x24ff43[_0xbc00('0x49')]['id']},'raw':!![]})[_0xbc00('0x25')](function(_0x529e39){_0x79cba4=_['filter'](_0x529e39,function(_0x902eda){return _0x902eda['enabled']===0x1||_[_0xbc00('0x5d')]([0x3eb,0x709],_0x902eda[_0xbc00('0x54')]);});if(!_[_0xbc00('0x5e')](_0x79cba4)){return _[_0xbc00('0x2c')](_0x79cba4,function(_0xd38050){return _0xd38050[_0xbc00('0x54')];});}else{return;}})[_0xbc00('0x25')](function(_0x4bfb40){if(_0x4bfb40)_0x13f1e5=_0x4bfb40;if(_[_0xbc00('0x5d')](_0x13f1e5,0x64)){var _0x182923=_[_0xbc00('0x44')](_0x79cba4,{'sectionId':0x64});return hasDefaultDashboard(_0x182923)[_0xbc00('0x25')](function(_0x3bda4c){return _[_0xbc00('0x2c')](_0x79cba4,function(_0x3d63cd){if(_0x3d63cd['sectionId']===0x64){_0x3d63cd[_0xbc00('0x5f')]=_0x3bda4c;}return _0x3d63cd;});});}else{return;}})['then'](function(_0x3e1847){if(_0x3e1847)_0x79cba4=_0x3e1847;if(_[_0xbc00('0x5d')](_0x13f1e5,0x3eb)){var _0x293758=_[_0xbc00('0x44')](_0x79cba4,{'sectionId':0x3eb});return getCustomDashboards(_0x293758)[_0xbc00('0x25')](function(_0x42bcc9){return _[_0xbc00('0x2c')](_0x79cba4,function(_0x13372c){if(_0x293758['enabled']){if(_0x13372c[_0xbc00('0x54')]===0x3eb){_0x13372c['subsections']=_0x42bcc9;}}else{if(_0x13372c[_0xbc00('0x54')]===0x64){_0x13372c[_0xbc00('0x5f')]=_0x42bcc9;}}return _0x13372c;});});}else{return;}})[_0xbc00('0x25')](function(_0x33179d){if(_0x33179d)_0x79cba4=_0x33179d;if(_['includes'](_0x13f1e5,0x709)){var _0x446e30=_[_0xbc00('0x44')](_0x79cba4,{'sectionId':0x709});return getPlugins(_0x446e30)[_0xbc00('0x25')](function(_0x4f1631){if(_0x446e30[_0xbc00('0x60')]){return _['map'](_0x79cba4,function(_0x41e4e2){if(_0x41e4e2[_0xbc00('0x54')]===0x709){_0x41e4e2[_0xbc00('0x5f')]=_0x4f1631;}return _0x41e4e2;});}else{var _0x3308a0={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4f1631};var _0x571dcc=_[_0xbc00('0x2c')](_0x79cba4);_0x571dcc[_0xbc00('0x61')](_0x3308a0);return _0x571dcc;}});}else{return;}})['then'](function(_0x5db44c){if(_0x5db44c)_0x79cba4=_0x5db44c;return _[_0xbc00('0x3e')](_0x79cba4,['enabled',0x1]);})['then'](respondWithResult(_0x14ec73,null))[_0xbc00('0x45')](handleError(_0x14ec73,null));};function hasDefaultDashboard(_0x562065){var _0x1e2bcd=[0x65];return new BPromise(function(_0x41b8be,_0x2bc867){try{if(_0x562065[_0xbc00('0x52')]){_0x41b8be(_0x1e2bcd);}else{return db[_0xbc00('0x53')][_0xbc00('0x62')]({'where':{'sectionId':_0x562065['id']},'raw':!![]})[_0xbc00('0x25')](function(_0x2e070d){_0x2e070d?_0x41b8be(_0x1e2bcd):_0x41b8be();});}}catch(_0x407729){_0x2bc867(_0x407729);}});}function getCustomDashboards(_0x4e7c43){var _0x1c05ae=[];return new BPromise(function(_0x2ec539,_0xc995e5){try{if(_0x4e7c43['autoAssociation']){return db['Dashboard']['findAll']({'raw':!![]})[_0xbc00('0x25')](function(_0x28c5c0){_0x28c5c0[_0xbc00('0x63')](function(_0x16b2c8){_0x1c05ae[_0xbc00('0x61')](_0x16b2c8['id']+0x1869f);});_0x2ec539(_0x1c05ae);});}else{return db[_0xbc00('0x53')][_0xbc00('0x42')]({'where':{'sectionId':_0x4e7c43['id']},'raw':!![]})['then'](function(_0x18462e){_0x18462e[_0xbc00('0x63')](function(_0x2aee94){_0x1c05ae[_0xbc00('0x61')](_0x2aee94[_0xbc00('0x64')]+0x1869f);});_0x2ec539(_0x1c05ae);});}}catch(_0x173fc7){_0xc995e5(_0x173fc7);}});}function getPlugins(_0x1ab7c4){var _0x2ec258=[];return new BPromise(function(_0xbfc36,_0x307156){try{if(_0x1ab7c4[_0xbc00('0x52')]){return db['Plugin'][_0xbc00('0x42')]({'raw':!![]})[_0xbc00('0x25')](function(_0x1b3d30){_0x1b3d30[_0xbc00('0x63')](function(_0x29b4cb){_0x2ec258['push'](_0x29b4cb['id']+0x15b38);});_0xbfc36(_0x2ec258);});}else{return db['UserProfileResource'][_0xbc00('0x42')]({'where':{'sectionId':_0x1ab7c4['id']},'raw':!![]})[_0xbc00('0x25')](function(_0x4bf685){_0x4bf685['forEach'](function(_0x417a6d){_0x2ec258[_0xbc00('0x61')](_0x417a6d['resourceId']+0x15b38);});_0xbfc36(_0x2ec258);});}}catch(_0x127fbc){_0x307156(_0x127fbc);}});}exports[_0xbc00('0x65')]=function(_0x1b5098,_0xb1dbdc){return db[_0xbc00('0x2d')][_0xbc00('0x44')]({'where':{'id':_0x1b5098['params']['id']}})[_0xbc00('0x25')](handleEntityNotFound(_0xb1dbdc,null))[_0xbc00('0x25')](function(_0x1f087a){if(_0x1f087a){return db[_0xbc00('0x50')][_0xbc00('0x51')](function(_0x3bfd42){return db[_0xbc00('0x59')][_0xbc00('0x42')]({'where':{'userProfileId':_0x1b5098['params']['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x28b843){if(_0x28b843){return db[_0xbc00('0x59')][_0xbc00('0x26')]({'where':{'userProfileId':_0x1b5098[_0xbc00('0x49')]['id'],'id':_[_0xbc00('0x2c')](_0x28b843,function(_0x2ab2e0){return _0x2ab2e0['id'];})},'transaction':_0x3bfd42});}})[_0xbc00('0x25')](function(_0x165ead){var _0x15a732=_[_0xbc00('0x2c')](_0x1b5098[_0xbc00('0x47')],function(_0x327059){_0x327059[_0xbc00('0x55')]=_0x1b5098[_0xbc00('0x49')]['id'];return _0x327059;});return db[_0xbc00('0x59')]['bulkCreate'](_0x15a732,{'raw':!![],'transaction':_0x3bfd42});})[_0xbc00('0x25')](function(_0x3f3eca){var _0x5315bc=_['filter'](_[_0xbc00('0x2c')](_0x3f3eca,function(_0xdc922d){return _0xdc922d['get']({'plain':!![]});}),{'includeAll':![]});if(_0x5315bc){return db['UserProfileSection'][_0xbc00('0x42')]({'where':{'userProfileId':_0x1b5098[_0xbc00('0x49')]['id'],'sectionId':_[_0xbc00('0x2c')](_0x5315bc,function(_0x2471a9){return _0x2471a9[_0xbc00('0x54')];})},'attributes':['id',_0xbc00('0x54')],'raw':!![]})[_0xbc00('0x25')](function(_0x2647fe){var _0x231437=_[_0xbc00('0x2c')](_0x1b5098[_0xbc00('0x47')],function(_0x24cbb0){_0x24cbb0[_0xbc00('0x55')]=_0x1b5098[_0xbc00('0x49')]['id'];return _0x24cbb0;});return db[_0xbc00('0x53')][_0xbc00('0x66')](_0x231437,{'raw':!![],'transaction':_0x3bfd42});});}})[_0xbc00('0x45')](handleError(_0xb1dbdc,null));});}})[_0xbc00('0x25')](function(_0x4055f2){var _0x432672=_['map'](_0x4055f2,function(_0x1e8ea7){return _0x1e8ea7[_0xbc00('0x4b')]({'plain':!![]});});})['then'](respondWithResult(_0xb1dbdc,null))['catch'](handleError(_0xb1dbdc,null));};exports[_0xbc00('0x67')]=function(_0x5befd5,_0x3d2f12,_0x1b6fb3){return db['UserProfile']['find']({'where':{'id':_0x5befd5[_0xbc00('0x49')]['id']}})[_0xbc00('0x25')](handleEntityNotFound(_0x3d2f12,null))[_0xbc00('0x25')](function(_0x3346f7){if(_0x3346f7){return _0x3346f7[_0xbc00('0x67')](_0x5befd5[_0xbc00('0x33')][_0xbc00('0x68')]);}})['then'](respondWithStatusCode(_0x3d2f12,null))[_0xbc00('0x45')](handleError(_0x3d2f12,null));};exports[_0xbc00('0x69')]=function(_0xb4d995,_0x7ec97f){var _0x37ee17={};if(!_0xb4d995[_0xbc00('0x33')][_0xbc00('0x6a')])throw new Error(_0xbc00('0x6b'));if(!_0xb4d995[_0xbc00('0x33')][_0xbc00('0x39')](_0xbc00('0x3a'))){_0x37ee17[_0xbc00('0x1d')]=qs[_0xbc00('0x1d')](_0xb4d995[_0xbc00('0x33')][_0xbc00('0x1d')]);_0x37ee17[_0xbc00('0x1e')]=qs[_0xbc00('0x1e')](_0xb4d995[_0xbc00('0x33')][_0xbc00('0x1e')]);}return db[_0xbc00('0x2d')][_0xbc00('0x44')]({'where':{'id':_0xb4d995['params']['id']}})[_0xbc00('0x25')](function(_0x1a20a1){if(!_0x1a20a1)throw new Error(_0xbc00('0x6c')+_0xb4d995['params']['id']);return db['UserProfile'][_0xbc00('0x69')](_0xb4d995);})[_0xbc00('0x25')](respondWithFilteredResult(_0x7ec97f,_0x37ee17))[_0xbc00('0x45')](handleError(_0x7ec97f,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 27f566d..9f67e06 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 _0xa76e=['hasOwnProperty','exports','../../mysqldb','UserProfile','update','emit'];(function(_0x1fdf9d,_0x2701f9){var _0xfc041e=function(_0x3ab49d){while(--_0x3ab49d){_0x1fdf9d['push'](_0x1fdf9d['shift']());}};_0xfc041e(++_0x2701f9);}(_0xa76e,0xfe));var _0xea76=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0xa76e[_0x5a79e2];return _0x266c45;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xea76('0x0'))['db'][_0xea76('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xea76('0x2'),'afterDestroy':'remove'};function emitEvent(_0x1d5309){return function(_0x368f89,_0xd37efd,_0x4ed094){UserProfileEvents[_0xea76('0x3')](_0x1d5309+':'+_0x368f89['id'],_0x368f89);UserProfileEvents['emit'](_0x1d5309,_0x368f89);_0x4ed094(null);};}for(var e in events){if(events[_0xea76('0x4')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xea76('0x5')]=UserProfileEvents; \ No newline at end of file +var _0x41ec=['hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x187f48,_0x55c5b3){var _0x212a96=function(_0x3949c4){while(--_0x3949c4){_0x187f48['push'](_0x187f48['shift']());}};_0x212a96(++_0x55c5b3);}(_0x41ec,0x143));var _0xc41e=function(_0x108617,_0x525a92){_0x108617=_0x108617-0x0;var _0x26128f=_0x41ec[_0x108617];return _0x26128f;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xc41e('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xc41e('0x1')](0x0);var events={'afterCreate':_0xc41e('0x2'),'afterUpdate':'update','afterDestroy':_0xc41e('0x3')};function emitEvent(_0x19ed31){return function(_0xd3f764,_0xf79325,_0xaa14e8){UserProfileEvents[_0xc41e('0x4')](_0x19ed31+':'+_0xd3f764['id'],_0xd3f764);UserProfileEvents[_0xc41e('0x4')](_0x19ed31,_0xd3f764);_0xaa14e8(null);};}for(var e in events){if(events[_0xc41e('0x5')](e)){var event=events[e];UserProfile[_0xc41e('0x6')](e,emitEvent(event));}}module[_0xc41e('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 79d7fc2..dd20f82 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 _0x4c60=['rows','count','CmContact','tag','ThroughTags','color','openTabs','chat','dataValues','fax','mail','openchannel','lodash','./userProfile.attributes','../../components/parsers/qs','squel','filter','field','value','findAll','then','model','associatedResources','map','name','catch','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projects','contacts','Lists','ListId','lists','CmList','companies','chatqueues','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','VoiceRecording','Agents','membername','User','role','VoiceQueues','queue','VoiceQueue','QueueCampaigns','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','smsqueues','smsaccounts','SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','users','agents','telephones','Users','user','Telephones','ZendeskAccount','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','Schedule','sounds','Sound','Tag','templates','Template','triggers','Trigger','trunks','plugins','Plugin','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','QueryTypes','select','ui.','InteractionId','ui.createdAt','from','user_has_','where','sequelize','query','UserProfile','user_profiles','section','Invalid\x20section\x20\x27','push','UserProfileSection','find','params','all','ignore','isEmpty','union','length','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','nolimit','limit','offset','order','sort','pick','key','foreignKey','forEach','merge','includeAll','include','default','DefaultReports','custom','CustomReports'];(function(_0x199b1f,_0x4ed849){var _0x267ac9=function(_0x184ac6){while(--_0x184ac6){_0x199b1f['push'](_0x199b1f['shift']());}};_0x267ac9(++_0x4ed849);}(_0x4c60,0xc1));var _0x04c6=function(_0x3d5093,_0x482991){_0x3d5093=_0x3d5093-0x0;var _0x551c81=_0x4c60[_0x3d5093];return _0x551c81;};'use strict';var _=require(_0x04c6('0x0'));var attributes=require(_0x04c6('0x1'));var qs=require(_0x04c6('0x2'));var squel=require(_0x04c6('0x3'));module['exports']=function(_0x2a1d36){var _0x5d9fa3=_0x2a1d36['models'];function _0x4ad4f1(_0x53ca7a,_0x3a9493){return new Promise(function(_0xc6e772,_0x2054da){if(!_0x3a9493)return _0xc6e772(null);var _0x12bd5d=_0x3a9493[_0x04c6('0x4')]?{[_0x3a9493[_0x04c6('0x4')][_0x04c6('0x5')]]:_0x3a9493['filter'][_0x04c6('0x6')]}:undefined;return _0x5d9fa3[_0x53ca7a][_0x04c6('0x7')]({'where':_0x12bd5d,'raw':!![]})[_0x04c6('0x8')](function(_0x30b901){_0x3a9493['associatedResources']=_['map'](_0x30b901,'id');_0xc6e772(_0x3a9493);})['catch'](function(_0x376da8){_0x2054da(_0x376da8);});});}function _0x5584cd(_0x15d31a,_0x2772fa){return new Promise(function(_0x5236c8,_0x4316f8){var _0x19eb01=_0x15d31a[_0x04c6('0x4')]?{[_0x15d31a[_0x04c6('0x4')]['field']]:_0x15d31a[_0x04c6('0x4')][_0x04c6('0x6')]}:undefined;return _0x5d9fa3[_0x15d31a[_0x04c6('0x9')]]['findAll']({'where':_0x19eb01,'raw':!![]})[_0x04c6('0x8')](function(_0x15cbe0){_0x2772fa[_0x04c6('0xa')]=_[_0x04c6('0xb')](_0x15cbe0,function(_0x4760f8){return _0x4760f8[_0x04c6('0xc')];});_0x5236c8(_0x2772fa);})[_0x04c6('0xd')](function(_0x3d46a9){_0x4316f8(_0x3d46a9);});});}function _0x5a5a66(_0x31edf9,_0xa2bc92,_0x382e58){if(!_0xa2bc92)return Promise[_0x04c6('0xe')](null);return new Promise(function(_0x43596a,_0xfb4db5){return _0x5d9fa3[_0x04c6('0xf')][_0x04c6('0x7')]({'where':{'sectionId':_0xa2bc92['id']},'raw':!![]})['then'](function(_0x142065){if(_0x31edf9[_0x04c6('0x5')]&&_0x31edf9[_0x04c6('0x5')]!=='id'){_0xa2bc92['associatedResources']=_['map'](_0x142065,function(_0x53ac86){return _0x53ac86[_0x31edf9[_0x04c6('0x5')]];});}else{if(_0x382e58===_0x04c6('0x10')){_0xa2bc92['associatedResources']=_['map'](_0x142065,function(_0x1e6854){return{'id':_0x1e6854[_0x04c6('0x11')],'type':_0x1e6854[_0x04c6('0x12')]};});}else{_0xa2bc92['associatedResources']=_[_0x04c6('0xb')](_0x142065,function(_0x13f2dc){return _0x13f2dc[_0x04c6('0x11')];});}}_0x43596a(_0xa2bc92);})['catch'](function(_0x2d3277){_0xfb4db5(_0x2d3277);});});}function _0x41e29f(_0x562491,_0x54a8b0){var _0x4c8d72={'parentSections':[]};switch(_0x562491[_0x04c6('0x13')]()){case _0x04c6('0x14'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x16');break;case _0x04c6('0x17'):_0x4c8d72['childModel']='SquareOdbc';break;case _0x04c6('0x18'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x19');_0x4c8d72[_0x04c6('0x1a')]=[{'name':_0x04c6('0x1b'),'field':_0x04c6('0xc'),'foreignKey':'projectName'}];break;case _0x04c6('0x1c'):_0x4c8d72[_0x04c6('0x15')]='JscriptyProject';break;case _0x04c6('0x1d'):_0x4c8d72[_0x04c6('0x15')]='CmContact';_0x4c8d72['parentSections']=[{'name':_0x04c6('0x1e'),'field':'id','foreignKey':_0x04c6('0x1f')}];break;case _0x04c6('0x20'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x21');break;case _0x04c6('0x22'):_0x4c8d72['childModel']='CmCompany';break;case'globalcustomfields':_0x4c8d72[_0x04c6('0x15')]='CmCustomField';break;case _0x04c6('0x23'):_0x4c8d72[_0x04c6('0x15')]='ChatQueue';break;case _0x04c6('0x24'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x25');break;case _0x04c6('0x26'):_0x4c8d72['childModel']=_0x04c6('0x27');break;case _0x04c6('0x28'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x29');break;case _0x04c6('0x2a'):case _0x04c6('0x2b'):case _0x04c6('0x2c'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x2d');break;case _0x04c6('0x2e'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x2f');break;case _0x04c6('0x30'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x31');break;case'voicerecordings':_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x32');_0x4c8d72[_0x04c6('0x1a')]=[{'name':_0x04c6('0x33'),'field':'name','foreignKey':_0x04c6('0x34'),'model':_0x04c6('0x35'),'filter':{'field':'role','value':['agent']}},{'name':'Telephones','field':_0x04c6('0xc'),'foreignKey':_0x04c6('0x34'),'model':'User','filter':{'field':_0x04c6('0x36'),'value':['telephone']}},{'name':_0x04c6('0x37'),'field':_0x04c6('0xc'),'foreignKey':_0x04c6('0x38'),'model':_0x04c6('0x39'),'filter':{'field':'type','value':['inbound']}},{'name':_0x04c6('0x3a'),'field':_0x04c6('0xc'),'foreignKey':'queue','model':_0x04c6('0x39'),'filter':{'field':'type','value':['outbound']}}];break;case _0x04c6('0x3b'):_0x4c8d72['childModel']=_0x04c6('0x3c');break;case _0x04c6('0x3d'):_0x4c8d72['childModel']=_0x04c6('0x3e');break;case'voiceprefixes':_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x3f');break;case _0x04c6('0x40'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x41');break;case'mailqueues':_0x4c8d72[_0x04c6('0x15')]='MailQueue';break;case _0x04c6('0x42'):_0x4c8d72['childModel']=_0x04c6('0x43');break;case _0x04c6('0x44'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x45');break;case _0x04c6('0x46'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x47');break;case'openchannelaccounts':_0x4c8d72[_0x04c6('0x15')]='OpenchannelAccount';break;case _0x04c6('0x48'):_0x4c8d72['childModel']='SmsQueue';break;case _0x04c6('0x49'):_0x4c8d72['childModel']=_0x04c6('0x4a');break;case _0x04c6('0x4b'):_0x4c8d72[_0x04c6('0x15')]='WhatsappQueue';break;case _0x04c6('0x4c'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x4d');break;case _0x04c6('0x4e'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x4f');break;case _0x04c6('0x50'):case'queuecampaigns':_0x4c8d72['childModel']=_0x04c6('0x39');if(_0x54a8b0){_0x4c8d72[_0x04c6('0x1a')]=[{'name':_0x04c6('0x37')},{'name':'QueueCampaigns'}];}break;case _0x04c6('0x51'):case _0x04c6('0x52'):case _0x04c6('0x53'):_0x4c8d72['childModel']='User';if(_0x54a8b0){_0x4c8d72['parentSections']=[{'name':_0x04c6('0x54'),'filter':{'field':_0x04c6('0x36'),'value':['admin',_0x04c6('0x55')]},'ignore':!![]},{'name':_0x04c6('0x33')},{'name':_0x04c6('0x56')}];}break;case'zendeskaccounts':_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x57');break;case'salesforceaccounts':_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x58');break;case _0x04c6('0x59'):_0x4c8d72[_0x04c6('0x15')]='FreshdeskAccount';break;case _0x04c6('0x5a'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x5b');break;case _0x04c6('0x5c'):_0x4c8d72['childModel']=_0x04c6('0x5d');break;case _0x04c6('0x5e'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x5f');break;case'vtigeraccounts':_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x35');break;case _0x04c6('0x60'):_0x4c8d72['childModel']=_0x04c6('0x61');break;case _0x04c6('0x62'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x63');break;case _0x04c6('0x64'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x65');break;case _0x04c6('0x66'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x67');break;case _0x04c6('0x68'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x69');break;case'scheduler':_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x6a');break;case _0x04c6('0x6b'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x6c');break;case'tags':_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x6d');break;case _0x04c6('0x6e'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x6f');break;case _0x04c6('0x70'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x71');break;case _0x04c6('0x72'):_0x4c8d72[_0x04c6('0x15')]='Trunk';break;case'variables':_0x4c8d72['childModel']='Variable';break;case _0x04c6('0x73'):_0x4c8d72['childModel']=_0x04c6('0x74');break;case'extractedreports':_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x10');_0x4c8d72['parentSections']=[{'name':'Reports','field':'id','foreignKey':_0x04c6('0x75')}];break;case _0x04c6('0x76'):_0x4c8d72[_0x04c6('0x15')]=_0x04c6('0x77');break;}return _0x4c8d72;}function _0x583b3c(_0x2fb324,_0xf4e9d6){var _0x216cb0=_0x2fb324[_0x04c6('0x78')](0x0)[_0x04c6('0x79')]()+_0x2fb324[_0x04c6('0x7a')](0x1);var _0x145854={'type':_0x5d9fa3['Sequelize'][_0x04c6('0x7b')]['SELECT'],'raw':!![]};return new Promise(function(_0x4336a3,_0x3bbd8b){var _0x4bcdab=squel[_0x04c6('0x7c')]()[_0x04c6('0x5')](_0x04c6('0x7d')+_0x216cb0+_0x04c6('0x7e'),'id')[_0x04c6('0x5')](_0x04c6('0x7f'))[_0x04c6('0x80')](_0x04c6('0x81')+_0x2fb324+'_interactions','ui')[_0x04c6('0x82')]('ui.UserId\x20=\x20?',_0xf4e9d6['id']);return _0x5d9fa3[_0x04c6('0x83')][_0x04c6('0x84')](_0x4bcdab['toString'](),_0x145854)['then'](function(_0x2e649d){_0xf4e9d6[_0x216cb0+'OpenTabs']=_0x2e649d;_0x4336a3(_0x2e649d);})[_0x04c6('0xd')](function(_0x4530de){_0x3bbd8b(_0x4530de);});});}return _0x2a1d36['define'](_0x04c6('0x85'),attributes,{'tableName':_0x04c6('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0xae0006){var _0x1cc1a1={'raw':![],'where':{}};var _0x2be139={};var _0xd12535={'count':0x0,'rows':[]};var _0x3e5a53=_0xae0006[_0x04c6('0x84')][_0x04c6('0x87')];var _0x129731=_0xae0006[_0x04c6('0x84')]['mergeResources']||![];var _0x3aaa1e=_0x41e29f(_0x3e5a53,_0x129731);if(!_0x3aaa1e[_0x04c6('0x15')])throw new Error(_0x04c6('0x88')+_0x3e5a53+'\x27');var _0x12394f=[{'name':_0x3e5a53}];if(!_['isEmpty'](_0x3aaa1e[_0x04c6('0x1a')]))_0x12394f=_0x3aaa1e[_0x04c6('0x1a')];var _0x1b38d1=[];for(var _0x49be80=0x0;_0x49be80<_0x12394f['length'];_0x49be80++){_0x1b38d1[_0x04c6('0x89')](_0x5d9fa3[_0x04c6('0x8a')][_0x04c6('0x8b')]({'where':{'userProfileId':_0xae0006[_0x04c6('0x8c')]['id'],'name':_0x12394f[_0x49be80][_0x04c6('0xc')]},'raw':!![]}));}return Promise[_0x04c6('0x8d')](_0x1b38d1)['then'](function(_0x375159){var _0x173df7=_[_0x04c6('0x4')](_0x375159,function(_0x596ac0){return _0x596ac0?_0x596ac0:undefined;});var _0x4f0850=_[_0x04c6('0x4')](_0x12394f,[_0x04c6('0x8e'),!![]]);var _0x1c62da=_[_0x04c6('0x8f')](_0x173df7)&&_['isEmpty'](_0x4f0850)?null:_[_0x04c6('0x90')](_0x4f0850,_0x173df7);if(!_0x1c62da)return null;var _0x4d4e50=[];for(var _0x5b5b09=0x0;_0x5b5b09<_0x1c62da[_0x04c6('0x91')];_0x5b5b09++){var _0xe178dd=_[_0x04c6('0x8b')](_0x12394f,function(_0x1904d4){return _0x1c62da[_0x5b5b09]?_0x1904d4[_0x04c6('0xc')]===_0x1c62da[_0x5b5b09][_0x04c6('0xc')]:null;});if(_0xe178dd){if(_0x1c62da[_0x5b5b09][_0x04c6('0x8e')]){_0x4d4e50['push'](_0x4ad4f1(_0x3aaa1e[_0x04c6('0x15')],_0x1c62da[_0x5b5b09]));}else{if(!_0x1c62da[_0x5b5b09][_0x04c6('0x92')]){_0x4d4e50[_0x04c6('0x89')](_0x5a5a66(_0xe178dd,_0x1c62da[_0x5b5b09],_0x3aaa1e[_0x04c6('0x15')]));}else{if(_0xe178dd[_0x04c6('0x9')]){_0x4d4e50['push'](_0x5584cd(_0xe178dd,_0x1c62da[_0x5b5b09]));}}}}}return Promise['all'](_0x4d4e50);})[_0x04c6('0x8')](function(_0x598941){var _0x2df63b=_0x598941;var _0x518e4e=null;if(_0x2df63b){_0x518e4e=_0x2df63b[_0x04c6('0x91')]===0x1?_0x2df63b[0x0]:null;}if(!_0x518e4e&&!_0x2df63b)return _0xd12535;var _0x467f3b=_0x5d9fa3[_0x3aaa1e['childModel']][_0x04c6('0x93')];_0x2be139[_0x04c6('0x9')]=_[_0x04c6('0x94')](_0x467f3b);_0x2be139[_0x04c6('0x84')]=_[_0x04c6('0x94')](_0xae0006[_0x04c6('0x84')]);_0x2be139[_0x04c6('0x95')]=_[_0x04c6('0x96')](_0x2be139[_0x04c6('0x9')],_0x2be139[_0x04c6('0x84')]);_0x1cc1a1[_0x04c6('0x97')]=_[_0x04c6('0x96')](_0x2be139[_0x04c6('0x9')],qs['fields'](_0xae0006[_0x04c6('0x84')][_0x04c6('0x98')]));_0x1cc1a1['attributes']=_0x1cc1a1[_0x04c6('0x97')][_0x04c6('0x91')]?_0x1cc1a1[_0x04c6('0x97')]:_0x2be139[_0x04c6('0x9')];if(!_0xae0006[_0x04c6('0x84')]['hasOwnProperty'](_0x04c6('0x99'))){_0x1cc1a1['limit']=qs[_0x04c6('0x9a')](_0xae0006['query'][_0x04c6('0x9a')]);_0x1cc1a1[_0x04c6('0x9b')]=qs[_0x04c6('0x9b')](_0xae0006[_0x04c6('0x84')][_0x04c6('0x9b')]);}_0x1cc1a1[_0x04c6('0x9c')]=qs[_0x04c6('0x9d')](_0xae0006[_0x04c6('0x84')][_0x04c6('0x9d')]);_0x1cc1a1['where']=qs[_0x04c6('0x95')](_[_0x04c6('0x9e')](_0xae0006['query'],_0x2be139[_0x04c6('0x95')]));if(_0xae0006['query'][_0x04c6('0x4')]){_0x1cc1a1[_0x04c6('0x82')]=_['merge'](_0x1cc1a1[_0x04c6('0x82')],{'$or':_[_0x04c6('0xb')](_0x467f3b,function(_0x5bdad4){if(_0x5bdad4[_0x04c6('0x12')][_0x04c6('0x9f')]!=='VIRTUAL'){var _0x7b9132={};_0x7b9132[_0x5bdad4[_0x04c6('0x5')]]={'$like':'%'+_0xae0006['query'][_0x04c6('0x4')]+'%'};return _0x7b9132;}})});}var _0x186aa0=[];var _0x4f02d9=null;var _0x5314ee={};if(_0x518e4e){_0x4f02d9=_['find'](_0x12394f,[_0x04c6('0xc'),_0x518e4e[_0x04c6('0xc')]]);if(_0x4f02d9[_0x04c6('0x5')]){_0x5314ee={};if(_0x3aaa1e[_0x04c6('0x15')]===_0x04c6('0x10')){_0x5314ee[_0x4f02d9['foreignKey']]=_[_0x04c6('0xb')](_0x518e4e[_0x04c6('0xa')],'id');}else{_0x5314ee[_0x4f02d9[_0x04c6('0xa0')]]=_0x518e4e[_0x04c6('0xa')];}_0x186aa0[_0x04c6('0x89')](_0x5314ee);}else{_0x1cc1a1[_0x04c6('0x82')]['id']=_0x518e4e[_0x04c6('0xa')];}}else{for(var _0x51858a=0x0;_0x51858a<_0x2df63b[_0x04c6('0x91')];_0x51858a++){_0x4f02d9=_['find'](_0x12394f,[_0x04c6('0xc'),_0x2df63b[_0x51858a]['name']]);if(_0x4f02d9['field']){_0x5314ee={};_0x5314ee[_0x4f02d9[_0x04c6('0xa0')]]=_0x2df63b[_0x51858a]['associatedResources'];_0x186aa0[_0x04c6('0x89')](_0x5314ee);}else{if(!_0x1cc1a1[_0x04c6('0x82')]['id'])_0x1cc1a1[_0x04c6('0x82')]['id']=[];_0x2df63b[_0x51858a][_0x04c6('0xa')][_0x04c6('0xa1')](function(_0x48fbdd){_0x1cc1a1['where']['id'][_0x04c6('0x89')](_0x48fbdd);});}}}if(!_[_0x04c6('0x8f')](_0x186aa0)){_0x1cc1a1[_0x04c6('0x82')]=_[_0x04c6('0xa2')](_0x1cc1a1[_0x04c6('0x82')],{'$and':{'$or':_0x186aa0}});}_0x1cc1a1=_[_0x04c6('0xa2')]({},_0x1cc1a1,_0xae0006['options']);if(_0x518e4e&&!_0x518e4e[_0x04c6('0x92')]&&_0x3aaa1e['childModel']==='AnalyticExtractedReport'){if(_0xae0006[_0x04c6('0x84')][_0x04c6('0xa3')]){_0x1cc1a1[_0x04c6('0xa4')]=[{'all':!![]}];}return _0x5d9fa3[_0x3aaa1e[_0x04c6('0x15')]][_0x04c6('0x7')](_0x1cc1a1)[_0x04c6('0x8')](function(_0x2e65f0){var _0x243553=[];_0x2e65f0[_0x04c6('0xa1')](function(_0x3dd78e){var _0x21dc7c;switch(_0x3dd78e['reportType']){case _0x04c6('0xa5'):_0x21dc7c=_['find'](_0x518e4e['associatedResources'],function(_0x38164e){return _0x38164e['id']===_0x3dd78e[_0x04c6('0x75')]&&_0x38164e[_0x04c6('0x12')]===_0x04c6('0xa6');});break;case _0x04c6('0xa7'):_0x21dc7c=_[_0x04c6('0x8b')](_0x518e4e[_0x04c6('0xa')],function(_0x383437){return _0x383437['id']===_0x3dd78e[_0x04c6('0x75')]&&_0x383437[_0x04c6('0x12')]===_0x04c6('0xa8');});break;}if(_0x21dc7c)_0x243553['push'](_0x3dd78e);});_0xd12535['count']=_0x243553[_0x04c6('0x91')];_0xd12535[_0x04c6('0xa9')]=_0x243553;return _0xd12535;});}else{return _0x5d9fa3[_0x3aaa1e['childModel']][_0x04c6('0xaa')]({'where':_0x1cc1a1[_0x04c6('0x82')]})['then'](function(_0x4504fc){_0xd12535[_0x04c6('0xaa')]=_0x4504fc;if(_0xae0006[_0x04c6('0x84')][_0x04c6('0xa3')]){if(_0x3aaa1e[_0x04c6('0x15')]===_0x04c6('0xab')){_0x1cc1a1[_0x04c6('0xa4')]=[{'model':_0x5d9fa3[_0x04c6('0x6d')],'as':'Tags','attributes':['id',_0x04c6('0xc'),'color'],'required':_0xae0006[_0x04c6('0x84')][_0x04c6('0xac')]?!![]:![]},{'model':_0x5d9fa3[_0x04c6('0x6d')],'as':_0x04c6('0xad'),'attributes':['id',_0x04c6('0xc'),_0x04c6('0xae')],'through':_0xae0006['query'][_0x04c6('0xac')]?{'attributes':[],'where':{'TagId':_0xae0006[_0x04c6('0x84')][_0x04c6('0xac')]||undefined}}:{},'required':_0xae0006['query']['tag']?!![]:![]}];}else{_0x1cc1a1['include']=[{'all':!![]}];}}return _0x5d9fa3[_0x3aaa1e[_0x04c6('0x15')]][_0x04c6('0x7')](_0x1cc1a1);})['then'](function(_0xd17fa3){_0xd12535[_0x04c6('0xa9')]=_0xd17fa3;if(_0x3e5a53===_0x04c6('0x33')&&_0xae0006['query'][_0x04c6('0xaf')]==='true'){var _0x1c0c74=[];for(var _0x3a1b76=0x0;_0x3a1b76<_0xd12535[_0x04c6('0xa9')]['length'];_0x3a1b76++){_0x1c0c74['push'](_0x583b3c(_0x04c6('0xb0'),_0xd12535[_0x04c6('0xa9')][_0x3a1b76][_0x04c6('0xb1')]));_0x1c0c74[_0x04c6('0x89')](_0x583b3c('sms',_0xd12535['rows'][_0x3a1b76][_0x04c6('0xb1')]));_0x1c0c74[_0x04c6('0x89')](_0x583b3c(_0x04c6('0xb2'),_0xd12535['rows'][_0x3a1b76][_0x04c6('0xb1')]));_0x1c0c74[_0x04c6('0x89')](_0x583b3c(_0x04c6('0xb3'),_0xd12535[_0x04c6('0xa9')][_0x3a1b76][_0x04c6('0xb1')]));_0x1c0c74[_0x04c6('0x89')](_0x583b3c(_0x04c6('0xb4'),_0xd12535[_0x04c6('0xa9')][_0x3a1b76][_0x04c6('0xb1')]));_0x1c0c74[_0x04c6('0x89')](_0x583b3c('whatsapp',_0xd12535[_0x04c6('0xa9')][_0x3a1b76][_0x04c6('0xb1')]));}return Promise[_0x04c6('0x8d')](_0x1c0c74)[_0x04c6('0x8')](function(){return _0xd12535;});}return _0xd12535;});}});}}});}; \ No newline at end of file +var _0xdb28=['slice','Sequelize','QueryTypes','SELECT','ui.','InteractionId','ui.createdAt','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','length','push','UserProfileSection','find','all','isEmpty','union','ignore','autoAssociation','keys','filters','intersection','attributes','fields','nolimit','limit','offset','order','sort','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','rows','count','Tags','color','tag','ThroughTags','Agents','openTabs','chat','dataValues','fax','mail','openchannel','lodash','./userProfile.attributes','../../components/parsers/qs','squel','models','filter','field','value','findAll','then','map','catch','model','associatedResources','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','SquareProject','odbc','childModel','SquareOdbc','squarerecordings','parentSections','SquareProjects','projectName','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','CmCompany','globalcustomfields','chatqueues','ChatQueue','chatwebsites','FaxQueue','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','membername','role','agent','Telephones','User','telephone','VoiceQueues','queue','inbound','QueueCampaigns','VoiceQueue','type','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','Team','voicequeues','users','agents','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','scheduler','sounds','Sound','Tag','templates','Template','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','Reports','reportId','AnalyticMetric','charAt','toUpperCase'];(function(_0xf17d4d,_0x4b447e){var _0x1636a8=function(_0x45aee2){while(--_0x45aee2){_0xf17d4d['push'](_0xf17d4d['shift']());}};_0x1636a8(++_0x4b447e);}(_0xdb28,0x106));var _0x8db2=function(_0x4d8119,_0x19cf02){_0x4d8119=_0x4d8119-0x0;var _0x3ca3d1=_0xdb28[_0x4d8119];return _0x3ca3d1;};'use strict';var _=require(_0x8db2('0x0'));var attributes=require(_0x8db2('0x1'));var qs=require(_0x8db2('0x2'));var squel=require(_0x8db2('0x3'));module['exports']=function(_0x1f4c45){var _0x11c26d=_0x1f4c45[_0x8db2('0x4')];function _0x4426fe(_0x11109e,_0x52bf99){return new Promise(function(_0x21a03e,_0x1d2dd3){if(!_0x52bf99)return _0x21a03e(null);var _0x5f42ee=_0x52bf99['filter']?{[_0x52bf99[_0x8db2('0x5')][_0x8db2('0x6')]]:_0x52bf99[_0x8db2('0x5')][_0x8db2('0x7')]}:undefined;return _0x11c26d[_0x11109e][_0x8db2('0x8')]({'where':_0x5f42ee,'raw':!![]})[_0x8db2('0x9')](function(_0x126c78){_0x52bf99['associatedResources']=_[_0x8db2('0xa')](_0x126c78,'id');_0x21a03e(_0x52bf99);})[_0x8db2('0xb')](function(_0x1f62af){_0x1d2dd3(_0x1f62af);});});}function _0x57015f(_0x1d9371,_0x150942){return new Promise(function(_0x576475,_0x41beda){var _0x3b2faa=_0x1d9371[_0x8db2('0x5')]?{[_0x1d9371[_0x8db2('0x5')][_0x8db2('0x6')]]:_0x1d9371['filter']['value']}:undefined;return _0x11c26d[_0x1d9371[_0x8db2('0xc')]][_0x8db2('0x8')]({'where':_0x3b2faa,'raw':!![]})[_0x8db2('0x9')](function(_0x1d6a15){_0x150942[_0x8db2('0xd')]=_[_0x8db2('0xa')](_0x1d6a15,function(_0x2f177a){return _0x2f177a[_0x8db2('0xe')];});_0x576475(_0x150942);})[_0x8db2('0xb')](function(_0x16c8c2){_0x41beda(_0x16c8c2);});});}function _0x5489a9(_0x13b0f5,_0x24da1b,_0x48101e){if(!_0x24da1b)return Promise[_0x8db2('0xf')](null);return new Promise(function(_0x44957d,_0x21db8c){return _0x11c26d[_0x8db2('0x10')][_0x8db2('0x8')]({'where':{'sectionId':_0x24da1b['id']},'raw':!![]})[_0x8db2('0x9')](function(_0x51d60d){if(_0x13b0f5['field']&&_0x13b0f5[_0x8db2('0x6')]!=='id'){_0x24da1b[_0x8db2('0xd')]=_[_0x8db2('0xa')](_0x51d60d,function(_0x1b64e4){return _0x1b64e4[_0x13b0f5['field']];});}else{if(_0x48101e===_0x8db2('0x11')){_0x24da1b[_0x8db2('0xd')]=_[_0x8db2('0xa')](_0x51d60d,function(_0x297ba3){return{'id':_0x297ba3[_0x8db2('0x12')],'type':_0x297ba3['type']};});}else{_0x24da1b[_0x8db2('0xd')]=_[_0x8db2('0xa')](_0x51d60d,function(_0x18f69c){return _0x18f69c[_0x8db2('0x12')];});}}_0x44957d(_0x24da1b);})[_0x8db2('0xb')](function(_0x21704c){_0x21db8c(_0x21704c);});});}function _0x796ec1(_0x5c6614,_0x256202){var _0x4f6516={'parentSections':[]};switch(_0x5c6614['toLowerCase']()){case'squareprojects':_0x4f6516['childModel']=_0x8db2('0x13');break;case _0x8db2('0x14'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x16');break;case _0x8db2('0x17'):_0x4f6516[_0x8db2('0x15')]='SquareRecording';_0x4f6516[_0x8db2('0x18')]=[{'name':_0x8db2('0x19'),'field':_0x8db2('0xe'),'foreignKey':_0x8db2('0x1a')}];break;case'projects':_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x1b');break;case _0x8db2('0x1c'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x1d');_0x4f6516[_0x8db2('0x18')]=[{'name':_0x8db2('0x1e'),'field':'id','foreignKey':_0x8db2('0x1f')}];break;case _0x8db2('0x20'):_0x4f6516['childModel']=_0x8db2('0x21');break;case'companies':_0x4f6516['childModel']=_0x8db2('0x22');break;case _0x8db2('0x23'):_0x4f6516[_0x8db2('0x15')]='CmCustomField';break;case _0x8db2('0x24'):_0x4f6516['childModel']=_0x8db2('0x25');break;case _0x8db2('0x26'):_0x4f6516[_0x8db2('0x15')]='ChatWebsite';break;case'faxqueues':_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x27');break;case'faxaccounts':_0x4f6516['childModel']=_0x8db2('0x28');break;case _0x8db2('0x29'):case _0x8db2('0x2a'):case _0x8db2('0x2b'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x2c');break;case _0x8db2('0x2d'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x2e');break;case _0x8db2('0x2f'):_0x4f6516['childModel']=_0x8db2('0x30');break;case _0x8db2('0x31'):_0x4f6516['childModel']=_0x8db2('0x32');_0x4f6516[_0x8db2('0x18')]=[{'name':'Agents','field':'name','foreignKey':_0x8db2('0x33'),'model':'User','filter':{'field':_0x8db2('0x34'),'value':[_0x8db2('0x35')]}},{'name':_0x8db2('0x36'),'field':_0x8db2('0xe'),'foreignKey':'membername','model':_0x8db2('0x37'),'filter':{'field':'role','value':[_0x8db2('0x38')]}},{'name':_0x8db2('0x39'),'field':_0x8db2('0xe'),'foreignKey':_0x8db2('0x3a'),'model':'VoiceQueue','filter':{'field':'type','value':[_0x8db2('0x3b')]}},{'name':_0x8db2('0x3c'),'field':'name','foreignKey':_0x8db2('0x3a'),'model':_0x8db2('0x3d'),'filter':{'field':_0x8db2('0x3e'),'value':['outbound']}}];break;case _0x8db2('0x3f'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x40');break;case _0x8db2('0x41'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x42');break;case _0x8db2('0x43'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x44');break;case _0x8db2('0x45'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x46');break;case _0x8db2('0x47'):_0x4f6516['childModel']=_0x8db2('0x48');break;case _0x8db2('0x49'):_0x4f6516['childModel']='MailAccount';break;case _0x8db2('0x4a'):_0x4f6516['childModel']=_0x8db2('0x4b');break;case _0x8db2('0x4c'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x4d');break;case _0x8db2('0x4e'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x4f');break;case'smsqueues':_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x50');break;case _0x8db2('0x51'):_0x4f6516[_0x8db2('0x15')]='SmsAccount';break;case _0x8db2('0x52'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x53');break;case _0x8db2('0x54'):_0x4f6516['childModel']=_0x8db2('0x55');break;case'teams':_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x56');break;case _0x8db2('0x57'):case'queuecampaigns':_0x4f6516['childModel']=_0x8db2('0x3d');if(_0x256202){_0x4f6516['parentSections']=[{'name':_0x8db2('0x39')},{'name':_0x8db2('0x3c')}];}break;case _0x8db2('0x58'):case _0x8db2('0x59'):case _0x8db2('0x5a'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x37');if(_0x256202){_0x4f6516[_0x8db2('0x18')]=[{'name':_0x8db2('0x5b'),'filter':{'field':_0x8db2('0x34'),'value':[_0x8db2('0x5c'),_0x8db2('0x5d')]},'ignore':!![]},{'name':'Agents'},{'name':_0x8db2('0x36')}];}break;case _0x8db2('0x5e'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x5f');break;case'salesforceaccounts':_0x4f6516['childModel']=_0x8db2('0x60');break;case _0x8db2('0x61'):_0x4f6516[_0x8db2('0x15')]='FreshdeskAccount';break;case'sugarcrmaccounts':_0x4f6516['childModel']=_0x8db2('0x62');break;case _0x8db2('0x63'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x64');break;case _0x8db2('0x65'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x66');break;case'vtigeraccounts':_0x4f6516['childModel']=_0x8db2('0x37');break;case _0x8db2('0x67'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x68');break;case _0x8db2('0x69'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x6a');break;case _0x8db2('0x6b'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x6c');break;case _0x8db2('0x6d'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x6e');break;case _0x8db2('0x6f'):_0x4f6516[_0x8db2('0x15')]='Pause';break;case _0x8db2('0x70'):_0x4f6516[_0x8db2('0x15')]='Schedule';break;case _0x8db2('0x71'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x72');break;case'tags':_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x73');break;case _0x8db2('0x74'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x75');break;case'triggers':_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x76');break;case _0x8db2('0x77'):_0x4f6516['childModel']=_0x8db2('0x78');break;case _0x8db2('0x79'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x7a');break;case _0x8db2('0x7b'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x7c');break;case'extractedreports':_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x11');_0x4f6516['parentSections']=[{'name':_0x8db2('0x7d'),'field':'id','foreignKey':_0x8db2('0x7e')}];break;case'metrics':_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x7f');break;}return _0x4f6516;}function _0x63e8f7(_0x30f4f3,_0x42b941){var _0x3c7d8c=_0x30f4f3[_0x8db2('0x80')](0x0)[_0x8db2('0x81')]()+_0x30f4f3[_0x8db2('0x82')](0x1);var _0x173a5e={'type':_0x11c26d[_0x8db2('0x83')][_0x8db2('0x84')][_0x8db2('0x85')],'raw':!![]};return new Promise(function(_0x1ce89f,_0x64ec90){var _0x105a53=squel['select']()[_0x8db2('0x6')](_0x8db2('0x86')+_0x3c7d8c+_0x8db2('0x87'),'id')[_0x8db2('0x6')](_0x8db2('0x88'))['from'](_0x8db2('0x89')+_0x30f4f3+_0x8db2('0x8a'),'ui')[_0x8db2('0x8b')](_0x8db2('0x8c'),_0x42b941['id']);return _0x11c26d[_0x8db2('0x8d')][_0x8db2('0x8e')](_0x105a53[_0x8db2('0x8f')](),_0x173a5e)[_0x8db2('0x9')](function(_0x24cfe9){_0x42b941[_0x3c7d8c+_0x8db2('0x90')]=_0x24cfe9;_0x1ce89f(_0x24cfe9);})[_0x8db2('0xb')](function(_0xfe6bac){_0x64ec90(_0xfe6bac);});});}return _0x1f4c45[_0x8db2('0x91')](_0x8db2('0x92'),attributes,{'tableName':_0x8db2('0x93'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x270fc0){var _0x1d7862={'raw':![],'where':{}};var _0xefb12={};var _0x5a719f={'count':0x0,'rows':[]};var _0x3273dd=_0x270fc0['query'][_0x8db2('0x94')];var _0x570c53=_0x270fc0[_0x8db2('0x8e')][_0x8db2('0x95')]||![];var _0xe4fd6a=_0x796ec1(_0x3273dd,_0x570c53);if(!_0xe4fd6a[_0x8db2('0x15')])throw new Error(_0x8db2('0x96')+_0x3273dd+'\x27');var _0x59a32e=[{'name':_0x3273dd}];if(!_['isEmpty'](_0xe4fd6a[_0x8db2('0x18')]))_0x59a32e=_0xe4fd6a[_0x8db2('0x18')];var _0x21ec87=[];for(var _0x3ba1d2=0x0;_0x3ba1d2<_0x59a32e[_0x8db2('0x97')];_0x3ba1d2++){_0x21ec87[_0x8db2('0x98')](_0x11c26d[_0x8db2('0x99')][_0x8db2('0x9a')]({'where':{'userProfileId':_0x270fc0['params']['id'],'name':_0x59a32e[_0x3ba1d2][_0x8db2('0xe')]},'raw':!![]}));}return Promise[_0x8db2('0x9b')](_0x21ec87)[_0x8db2('0x9')](function(_0x21521c){var _0x250150=_[_0x8db2('0x5')](_0x21521c,function(_0x451746){return _0x451746?_0x451746:undefined;});var _0x20caf0=_['filter'](_0x59a32e,['ignore',!![]]);var _0x358009=_[_0x8db2('0x9c')](_0x250150)&&_[_0x8db2('0x9c')](_0x20caf0)?null:_[_0x8db2('0x9d')](_0x20caf0,_0x250150);if(!_0x358009)return null;var _0x412801=[];for(var _0x5a074e=0x0;_0x5a074e<_0x358009['length'];_0x5a074e++){var _0x3611da=_[_0x8db2('0x9a')](_0x59a32e,function(_0x54f0d4){return _0x358009[_0x5a074e]?_0x54f0d4[_0x8db2('0xe')]===_0x358009[_0x5a074e][_0x8db2('0xe')]:null;});if(_0x3611da){if(_0x358009[_0x5a074e][_0x8db2('0x9e')]){_0x412801['push'](_0x4426fe(_0xe4fd6a[_0x8db2('0x15')],_0x358009[_0x5a074e]));}else{if(!_0x358009[_0x5a074e][_0x8db2('0x9f')]){_0x412801[_0x8db2('0x98')](_0x5489a9(_0x3611da,_0x358009[_0x5a074e],_0xe4fd6a['childModel']));}else{if(_0x3611da[_0x8db2('0xc')]){_0x412801[_0x8db2('0x98')](_0x57015f(_0x3611da,_0x358009[_0x5a074e]));}}}}}return Promise[_0x8db2('0x9b')](_0x412801);})[_0x8db2('0x9')](function(_0x3a0946){var _0x5923b3=_0x3a0946;var _0x3c9af4=null;if(_0x5923b3){_0x3c9af4=_0x5923b3[_0x8db2('0x97')]===0x1?_0x5923b3[0x0]:null;}if(!_0x3c9af4&&!_0x5923b3)return _0x5a719f;var _0x150439=_0x11c26d[_0xe4fd6a['childModel']]['rawAttributes'];_0xefb12[_0x8db2('0xc')]=_[_0x8db2('0xa0')](_0x150439);_0xefb12['query']=_[_0x8db2('0xa0')](_0x270fc0[_0x8db2('0x8e')]);_0xefb12[_0x8db2('0xa1')]=_[_0x8db2('0xa2')](_0xefb12[_0x8db2('0xc')],_0xefb12[_0x8db2('0x8e')]);_0x1d7862[_0x8db2('0xa3')]=_[_0x8db2('0xa2')](_0xefb12[_0x8db2('0xc')],qs[_0x8db2('0xa4')](_0x270fc0[_0x8db2('0x8e')][_0x8db2('0xa4')]));_0x1d7862[_0x8db2('0xa3')]=_0x1d7862['attributes'][_0x8db2('0x97')]?_0x1d7862['attributes']:_0xefb12[_0x8db2('0xc')];if(!_0x270fc0[_0x8db2('0x8e')]['hasOwnProperty'](_0x8db2('0xa5'))){_0x1d7862[_0x8db2('0xa6')]=qs['limit'](_0x270fc0[_0x8db2('0x8e')][_0x8db2('0xa6')]);_0x1d7862[_0x8db2('0xa7')]=qs[_0x8db2('0xa7')](_0x270fc0[_0x8db2('0x8e')][_0x8db2('0xa7')]);}_0x1d7862[_0x8db2('0xa8')]=qs[_0x8db2('0xa9')](_0x270fc0[_0x8db2('0x8e')]['sort']);_0x1d7862['where']=qs[_0x8db2('0xa1')](_['pick'](_0x270fc0[_0x8db2('0x8e')],_0xefb12[_0x8db2('0xa1')]));if(_0x270fc0[_0x8db2('0x8e')]['filter']){_0x1d7862[_0x8db2('0x8b')]=_[_0x8db2('0xaa')](_0x1d7862[_0x8db2('0x8b')],{'$or':_['map'](_0x150439,function(_0x3ae18c){if(_0x3ae18c[_0x8db2('0x3e')][_0x8db2('0xab')]!==_0x8db2('0xac')){var _0x48a618={};_0x48a618[_0x3ae18c[_0x8db2('0x6')]]={'$like':'%'+_0x270fc0[_0x8db2('0x8e')][_0x8db2('0x5')]+'%'};return _0x48a618;}})});}var _0x1edb1a=[];var _0xcf1c42=null;var _0x15fd4={};if(_0x3c9af4){_0xcf1c42=_[_0x8db2('0x9a')](_0x59a32e,[_0x8db2('0xe'),_0x3c9af4[_0x8db2('0xe')]]);if(_0xcf1c42[_0x8db2('0x6')]){_0x15fd4={};if(_0xe4fd6a[_0x8db2('0x15')]==='AnalyticExtractedReport'){_0x15fd4[_0xcf1c42[_0x8db2('0xad')]]=_[_0x8db2('0xa')](_0x3c9af4[_0x8db2('0xd')],'id');}else{_0x15fd4[_0xcf1c42['foreignKey']]=_0x3c9af4['associatedResources'];}_0x1edb1a['push'](_0x15fd4);}else{_0x1d7862[_0x8db2('0x8b')]['id']=_0x3c9af4[_0x8db2('0xd')];}}else{for(var _0x3191c8=0x0;_0x3191c8<_0x5923b3[_0x8db2('0x97')];_0x3191c8++){_0xcf1c42=_[_0x8db2('0x9a')](_0x59a32e,[_0x8db2('0xe'),_0x5923b3[_0x3191c8][_0x8db2('0xe')]]);if(_0xcf1c42[_0x8db2('0x6')]){_0x15fd4={};_0x15fd4[_0xcf1c42[_0x8db2('0xad')]]=_0x5923b3[_0x3191c8][_0x8db2('0xd')];_0x1edb1a[_0x8db2('0x98')](_0x15fd4);}else{if(!_0x1d7862['where']['id'])_0x1d7862[_0x8db2('0x8b')]['id']=[];_0x5923b3[_0x3191c8][_0x8db2('0xd')][_0x8db2('0xae')](function(_0x2fb169){_0x1d7862['where']['id']['push'](_0x2fb169);});}}}if(!_[_0x8db2('0x9c')](_0x1edb1a)){_0x1d7862[_0x8db2('0x8b')]=_['merge'](_0x1d7862[_0x8db2('0x8b')],{'$and':{'$or':_0x1edb1a}});}_0x1d7862=_[_0x8db2('0xaa')]({},_0x1d7862,_0x270fc0[_0x8db2('0xaf')]);if(_0x3c9af4&&!_0x3c9af4['autoAssociation']&&_0xe4fd6a['childModel']==='AnalyticExtractedReport'){if(_0x270fc0[_0x8db2('0x8e')][_0x8db2('0xb0')]){_0x1d7862[_0x8db2('0xb1')]=[{'all':!![]}];}return _0x11c26d[_0xe4fd6a[_0x8db2('0x15')]][_0x8db2('0x8')](_0x1d7862)['then'](function(_0x30930a){var _0x5e349c=[];_0x30930a[_0x8db2('0xae')](function(_0x353101){var _0xa083b1;switch(_0x353101[_0x8db2('0xb2')]){case _0x8db2('0xb3'):_0xa083b1=_['find'](_0x3c9af4['associatedResources'],function(_0x45cce8){return _0x45cce8['id']===_0x353101['reportId']&&_0x45cce8[_0x8db2('0x3e')]===_0x8db2('0xb4');});break;case _0x8db2('0xb5'):_0xa083b1=_[_0x8db2('0x9a')](_0x3c9af4[_0x8db2('0xd')],function(_0x456d5e){return _0x456d5e['id']===_0x353101['reportId']&&_0x456d5e[_0x8db2('0x3e')]===_0x8db2('0xb6');});break;}if(_0xa083b1)_0x5e349c[_0x8db2('0x98')](_0x353101);});_0x5a719f['count']=_0x5e349c[_0x8db2('0x97')];_0x5a719f[_0x8db2('0xb7')]=_0x5e349c;return _0x5a719f;});}else{return _0x11c26d[_0xe4fd6a['childModel']][_0x8db2('0xb8')]({'where':_0x1d7862[_0x8db2('0x8b')]})[_0x8db2('0x9')](function(_0x15307d){_0x5a719f[_0x8db2('0xb8')]=_0x15307d;if(_0x270fc0[_0x8db2('0x8e')][_0x8db2('0xb0')]){if(_0xe4fd6a[_0x8db2('0x15')]===_0x8db2('0x1d')){_0x1d7862['include']=[{'model':_0x11c26d[_0x8db2('0x73')],'as':_0x8db2('0xb9'),'attributes':['id',_0x8db2('0xe'),_0x8db2('0xba')],'required':_0x270fc0[_0x8db2('0x8e')][_0x8db2('0xbb')]?!![]:![]},{'model':_0x11c26d[_0x8db2('0x73')],'as':_0x8db2('0xbc'),'attributes':['id',_0x8db2('0xe'),_0x8db2('0xba')],'through':_0x270fc0['query'][_0x8db2('0xbb')]?{'attributes':[],'where':{'TagId':_0x270fc0[_0x8db2('0x8e')][_0x8db2('0xbb')]||undefined}}:{},'required':_0x270fc0[_0x8db2('0x8e')]['tag']?!![]:![]}];}else{_0x1d7862[_0x8db2('0xb1')]=[{'all':!![]}];}}return _0x11c26d[_0xe4fd6a[_0x8db2('0x15')]][_0x8db2('0x8')](_0x1d7862);})['then'](function(_0x59fbe1){_0x5a719f[_0x8db2('0xb7')]=_0x59fbe1;if(_0x3273dd===_0x8db2('0xbd')&&_0x270fc0[_0x8db2('0x8e')][_0x8db2('0xbe')]==='true'){var _0xaa2661=[];for(var _0x3a0e7e=0x0;_0x3a0e7e<_0x5a719f[_0x8db2('0xb7')][_0x8db2('0x97')];_0x3a0e7e++){_0xaa2661['push'](_0x63e8f7(_0x8db2('0xbf'),_0x5a719f[_0x8db2('0xb7')][_0x3a0e7e][_0x8db2('0xc0')]));_0xaa2661['push'](_0x63e8f7('sms',_0x5a719f['rows'][_0x3a0e7e][_0x8db2('0xc0')]));_0xaa2661[_0x8db2('0x98')](_0x63e8f7(_0x8db2('0xc1'),_0x5a719f[_0x8db2('0xb7')][_0x3a0e7e]['dataValues']));_0xaa2661['push'](_0x63e8f7(_0x8db2('0xc2'),_0x5a719f[_0x8db2('0xb7')][_0x3a0e7e][_0x8db2('0xc0')]));_0xaa2661[_0x8db2('0x98')](_0x63e8f7(_0x8db2('0xc3'),_0x5a719f[_0x8db2('0xb7')][_0x3a0e7e]['dataValues']));_0xaa2661[_0x8db2('0x98')](_0x63e8f7('whatsapp',_0x5a719f[_0x8db2('0xb7')][_0x3a0e7e][_0x8db2('0xc0')]));}return Promise[_0x8db2('0x9b')](_0xaa2661)[_0x8db2('0x9')](function(){return _0x5a719f;});}return _0x5a719f;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 8107fa3..6c2dffc 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 _0x7524=['randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment'];(function(_0x599741,_0x502229){var _0x1eaad4=function(_0x493eb8){while(--_0x493eb8){_0x599741['push'](_0x599741['shift']());}};_0x1eaad4(++_0x502229);}(_0x7524,0xce));var _0x4752=function(_0x47eb72,_0x4f3a2f){_0x47eb72=_0x47eb72-0x0;var _0x409b6e=_0x7524[_0x47eb72];return _0x409b6e;};'use strict';var _=require('lodash');var util=require(_0x4752('0x0'));var moment=require(_0x4752('0x1'));var BPromise=require('bluebird');var rs=require(_0x4752('0x2'));var fs=require('fs');var Redis=require(_0x4752('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4752('0x4'))('rpc');var config=require(_0x4752('0x5'));var jayson=require(_0x4752('0x6'));var client=jayson[_0x4752('0x7')][_0x4752('0x8')]({'port':0x232a});config[_0x4752('0x9')]=_['defaults'](config[_0x4752('0x9')],{'host':_0x4752('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4752('0xb'))[_0x4752('0xc')](socket);function respondWithRpcPromise(_0x3ffa66,_0x1c83b9,_0x52b972){return new BPromise(function(_0x12fd37,_0x2a83fd){return client[_0x4752('0xd')](_0x3ffa66,_0x52b972)[_0x4752('0xe')](function(_0xcf0104){logger['info'](_0x4752('0xf'),_0x1c83b9,_0x4752('0x10'));logger[_0x4752('0x11')](_0x4752('0x12'),_0x1c83b9,_0x4752('0x10'),JSON[_0x4752('0x13')](_0xcf0104));if(_0xcf0104[_0x4752('0x14')]){if(_0xcf0104['error'][_0x4752('0x15')]===0x1f4){logger['error'](_0x4752('0xf'),_0x1c83b9,_0xcf0104[_0x4752('0x14')][_0x4752('0x16')]);return _0x2a83fd(_0xcf0104[_0x4752('0x14')][_0x4752('0x16')]);}logger[_0x4752('0x14')](_0x4752('0xf'),_0x1c83b9,_0xcf0104['error'][_0x4752('0x16')]);return _0x12fd37(_0xcf0104[_0x4752('0x14')]['message']);}else{logger[_0x4752('0x17')]('UserProfile,\x20%s,\x20%s',_0x1c83b9,_0x4752('0x10'));_0x12fd37(_0xcf0104[_0x4752('0x18')]['message']);}})[_0x4752('0x19')](function(_0x4b95f8){logger['error'](_0x4752('0xf'),_0x1c83b9,_0x4b95f8);_0x2a83fd(_0x4b95f8);});});} \ No newline at end of file +var _0xcf71=['request\x20sent','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','debug'];(function(_0x4f0a3a,_0x14f8d9){var _0x430cca=function(_0x48ae46){while(--_0x48ae46){_0x4f0a3a['push'](_0x4f0a3a['shift']());}};_0x430cca(++_0x14f8d9);}(_0xcf71,0xba));var _0x1cf7=function(_0x18d60d,_0x5dd41a){_0x18d60d=_0x18d60d-0x0;var _0x215743=_0xcf71[_0x18d60d];return _0x215743;};'use strict';var _=require(_0x1cf7('0x0'));var util=require(_0x1cf7('0x1'));var moment=require(_0x1cf7('0x2'));var BPromise=require(_0x1cf7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1cf7('0x4'));var db=require(_0x1cf7('0x5'))['db'];var utils=require(_0x1cf7('0x6'));var logger=require(_0x1cf7('0x7'))(_0x1cf7('0x8'));var config=require(_0x1cf7('0x9'));var jayson=require(_0x1cf7('0xa'));var client=jayson[_0x1cf7('0xb')][_0x1cf7('0xc')]({'port':0x232a});config[_0x1cf7('0xd')]=_[_0x1cf7('0xe')](config[_0x1cf7('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1cf7('0xd')]));require(_0x1cf7('0xf'))[_0x1cf7('0x10')](socket);function respondWithRpcPromise(_0x540557,_0x318b81,_0x57eab0){return new BPromise(function(_0x4ce324,_0x145583){return client[_0x1cf7('0x11')](_0x540557,_0x57eab0)[_0x1cf7('0x12')](function(_0x1ca840){logger[_0x1cf7('0x13')](_0x1cf7('0x14'),_0x318b81,'request\x20sent');logger[_0x1cf7('0x15')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x318b81,_0x1cf7('0x16'),JSON['stringify'](_0x1ca840));if(_0x1ca840[_0x1cf7('0x17')]){if(_0x1ca840[_0x1cf7('0x17')]['code']===0x1f4){logger[_0x1cf7('0x17')](_0x1cf7('0x14'),_0x318b81,_0x1ca840[_0x1cf7('0x17')][_0x1cf7('0x18')]);return _0x145583(_0x1ca840[_0x1cf7('0x17')][_0x1cf7('0x18')]);}logger[_0x1cf7('0x17')](_0x1cf7('0x14'),_0x318b81,_0x1ca840[_0x1cf7('0x17')][_0x1cf7('0x18')]);return _0x4ce324(_0x1ca840[_0x1cf7('0x17')][_0x1cf7('0x18')]);}else{logger[_0x1cf7('0x13')]('UserProfile,\x20%s,\x20%s',_0x318b81,_0x1cf7('0x16'));_0x4ce324(_0x1ca840[_0x1cf7('0x19')][_0x1cf7('0x18')]);}})['catch'](function(_0x447a75){logger[_0x1cf7('0x17')](_0x1cf7('0x14'),_0x318b81,_0x447a75);_0x145583(_0x447a75);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 0d43735..d67fdd3 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 _0x928e=['register','length','userProfile:','./userProfile.events','save','remove','update'];(function(_0x21eb52,_0x368ca7){var _0x4d11fa=function(_0x1d880f){while(--_0x1d880f){_0x21eb52['push'](_0x21eb52['shift']());}};_0x4d11fa(++_0x368ca7);}(_0x928e,0x7a));var _0xe928=function(_0x27e30d,_0x1d3f44){_0x27e30d=_0x27e30d-0x0;var _0x58030e=_0x928e[_0x27e30d];return _0x58030e;};'use strict';var UserProfileEvents=require(_0xe928('0x0'));var events=[_0xe928('0x1'),_0xe928('0x2'),_0xe928('0x3')];function createListener(_0x1e4969,_0x345d18){return function(_0x43a569){_0x345d18['emit'](_0x1e4969,_0x43a569);};}function removeListener(_0x3e58ba,_0x2670fd){return function(){UserProfileEvents['removeListener'](_0x3e58ba,_0x2670fd);};}exports[_0xe928('0x4')]=function(_0x1b6d32){for(var _0x35f2ab=0x0,_0xa6448c=events[_0xe928('0x5')];_0x35f2ab<_0xa6448c;_0x35f2ab++){var _0x2332e2=events[_0x35f2ab];var _0x1c94ea=createListener(_0xe928('0x6')+_0x2332e2,_0x1b6d32);UserProfileEvents['on'](_0x2332e2,_0x1c94ea);}}; \ No newline at end of file +var _0x3513=['update','emit','removeListener','length','./userProfile.events','save','remove'];(function(_0x9bac8a,_0x141038){var _0x33a405=function(_0xb0230b){while(--_0xb0230b){_0x9bac8a['push'](_0x9bac8a['shift']());}};_0x33a405(++_0x141038);}(_0x3513,0x97));var _0x3351=function(_0x298024,_0x4a0817){_0x298024=_0x298024-0x0;var _0xf3fac7=_0x3513[_0x298024];return _0xf3fac7;};'use strict';var UserProfileEvents=require(_0x3351('0x0'));var events=[_0x3351('0x1'),_0x3351('0x2'),_0x3351('0x3')];function createListener(_0x1b750b,_0x22ead3){return function(_0x3499cf){_0x22ead3[_0x3351('0x4')](_0x1b750b,_0x3499cf);};}function removeListener(_0x5bd481,_0x128466){return function(){UserProfileEvents[_0x3351('0x5')](_0x5bd481,_0x128466);};}exports['register']=function(_0x42184f){for(var _0x18a50d=0x0,_0x4aabf8=events[_0x3351('0x6')];_0x18a50d<_0x4aabf8;_0x18a50d++){var _0x37676b=events[_0x18a50d];var _0x34a74f=createListener('userProfile:'+_0x37676b,_0x42184f);UserProfileEvents['on'](_0x37676b,_0x34a74f);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 6c98ce0..31f43f2 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 _0x58ac=['/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','put'];(function(_0xc14119,_0x3a1428){var _0x4c7ac1=function(_0x21ae7b){while(--_0x21ae7b){_0xc14119['push'](_0xc14119['shift']());}};_0x4c7ac1(++_0x3a1428);}(_0x58ac,0xc1));var _0xc58a=function(_0x404f3a,_0x243123){_0x404f3a=_0x404f3a-0x0;var _0x56267e=_0x58ac[_0x404f3a];return _0x56267e;};'use strict';var multer=require(_0xc58a('0x0'));var util=require(_0xc58a('0x1'));var path=require(_0xc58a('0x2'));var timeout=require(_0xc58a('0x3'));var express=require(_0xc58a('0x4'));var router=express[_0xc58a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc58a('0x6'));var interaction=require(_0xc58a('0x7'));var config=require(_0xc58a('0x8'));var controller=require('./userProfileResource.controller');router[_0xc58a('0x9')]('/',auth[_0xc58a('0xa')](),controller[_0xc58a('0xb')]);router['get'](_0xc58a('0xc'),auth[_0xc58a('0xa')](),controller[_0xc58a('0xd')]);router[_0xc58a('0x9')]('/:id',auth[_0xc58a('0xa')](),controller[_0xc58a('0xe')]);router[_0xc58a('0xf')]('/',auth[_0xc58a('0xa')](),controller['create']);router[_0xc58a('0x10')](_0xc58a('0x11'),auth[_0xc58a('0xa')](),controller['update']);router[_0xc58a('0x12')](_0xc58a('0x11'),auth['isAuthenticated'](),controller[_0xc58a('0x13')]);module[_0xc58a('0x14')]=router; \ No newline at end of file +var _0x5d6d=['connect-timeout','../../components/auth/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get','/describe','show','post','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x580e26,_0x28a37f){var _0x142689=function(_0x292904){while(--_0x292904){_0x580e26['push'](_0x580e26['shift']());}};_0x142689(++_0x28a37f);}(_0x5d6d,0xe1));var _0xd5d6=function(_0x47aaf3,_0x2326bc){_0x47aaf3=_0x47aaf3-0x0;var _0x237873=_0x5d6d[_0x47aaf3];return _0x237873;};'use strict';var multer=require(_0xd5d6('0x0'));var util=require(_0xd5d6('0x1'));var path=require(_0xd5d6('0x2'));var timeout=require(_0xd5d6('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd5d6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd5d6('0x5'));var controller=require(_0xd5d6('0x6'));router['get']('/',auth[_0xd5d6('0x7')](),controller[_0xd5d6('0x8')]);router[_0xd5d6('0x9')](_0xd5d6('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xd5d6('0x9')]('/:id',auth[_0xd5d6('0x7')](),controller[_0xd5d6('0xb')]);router[_0xd5d6('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd5d6('0xd')](_0xd5d6('0xe'),auth[_0xd5d6('0x7')](),controller[_0xd5d6('0xf')]);router[_0xd5d6('0x10')](_0xd5d6('0xe'),auth[_0xd5d6('0x7')](),controller[_0xd5d6('0x11')]);module[_0xd5d6('0x12')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index b0875a2..e08f54e 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 _0xf45b=['STRING','sequelize','exports'];(function(_0x4edb78,_0x55a934){var _0x5d653f=function(_0x258ed8){while(--_0x258ed8){_0x4edb78['push'](_0x4edb78['shift']());}};_0x5d653f(++_0x55a934);}(_0xf45b,0x7f));var _0xbf45=function(_0x2b3b3a,_0x3226e0){_0x2b3b3a=_0x2b3b3a-0x0;var _0x4b1b2c=_0xf45b[_0x2b3b3a];return _0x4b1b2c;};'use strict';var Sequelize=require(_0xbf45('0x0'));module[_0xbf45('0x1')]={'name':{'type':Sequelize[_0xbf45('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xbf45('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xf963=['sequelize','exports','INTEGER','STRING'];(function(_0x5e4d6c,_0xed2d29){var _0x33bc62=function(_0x25db04){while(--_0x25db04){_0x5e4d6c['push'](_0x5e4d6c['shift']());}};_0x33bc62(++_0xed2d29);}(_0xf963,0x1b4));var _0x3f96=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xf963[_0x55f8b4];return _0x2475f9;};'use strict';var Sequelize=require(_0x3f96('0x0'));module[_0x3f96('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x3f96('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3f96('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index ab7ff03..387e227 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 _0x5fab=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','includeAll','include','findAll','then','rows','show','params','intersection','fields','options','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x5fab,0x177));var _0xb5fa=function(_0x13b07a,_0x49cfc3){_0x13b07a=_0x13b07a-0x0;var _0xdcbe0=_0x5fab[_0x13b07a];return _0xdcbe0;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];function respondWithStatusCode(_0x4d3576,_0x2ad830){_0x2ad830=_0x2ad830||0xcc;return function(_0x3dad4d){if(_0x3dad4d){return _0x4d3576['sendStatus'](_0x2ad830);}return _0x4d3576[_0xb5fa('0x1a')](_0x2ad830)['end']();};}function respondWithResult(_0x265992,_0x3fc372){_0x3fc372=_0x3fc372||0xc8;return function(_0x40c914){if(_0x40c914){return _0x265992[_0xb5fa('0x1a')](_0x3fc372)[_0xb5fa('0x1b')](_0x40c914);}};}function respondWithFilteredResult(_0x5371cf,_0x567f31){return function(_0x38e964){if(_0x38e964){var _0x587043=typeof _0x567f31[_0xb5fa('0x1c')]===_0xb5fa('0x1d')&&typeof _0x567f31['limit']==='undefined';var _0x451a55=_0x38e964[_0xb5fa('0x1e')];var _0x32e9e5=_0x587043?0x0:_0x567f31[_0xb5fa('0x1c')];var _0x324ba5=_0x587043?_0x38e964[_0xb5fa('0x1e')]:_0x567f31[_0xb5fa('0x1c')]+_0x567f31[_0xb5fa('0x1f')];var _0xc14dc4;if(_0x324ba5>=_0x451a55){_0x324ba5=_0x451a55;_0xc14dc4=0xc8;}else{_0xc14dc4=0xce;}_0x5371cf[_0xb5fa('0x1a')](_0xc14dc4);return _0x5371cf[_0xb5fa('0x20')](_0xb5fa('0x21'),_0x32e9e5+'-'+_0x324ba5+'/'+_0x451a55)['json'](_0x38e964);}return null;};}function patchUpdates(_0x432bfa){return function(_0x519e20){try{jsonpatch[_0xb5fa('0x22')](_0x519e20,_0x432bfa,!![]);}catch(_0x4a6c04){return BPromise[_0xb5fa('0x23')](_0x4a6c04);}return _0x519e20[_0xb5fa('0x24')]();};}function saveUpdates(_0x4e05c0,_0x40dfdf){return function(_0x3a2ab9){if(_0x3a2ab9){return _0x3a2ab9[_0xb5fa('0x25')](_0x4e05c0)['then'](function(_0x32a85c){return _0x32a85c;});}return null;};}function removeEntity(_0xec108f,_0x444237){return function(_0x542348){if(_0x542348){return _0x542348[_0xb5fa('0x26')]()['then'](function(){_0xec108f[_0xb5fa('0x1a')](0xcc)[_0xb5fa('0x27')]();});}};}function handleEntityNotFound(_0x11053a,_0x543edf){return function(_0x2dbd22){if(!_0x2dbd22){_0x11053a[_0xb5fa('0x28')](0x194);}return _0x2dbd22;};}function handleError(_0x6a455c,_0x20d649){_0x20d649=_0x20d649||0x1f4;return function(_0x568870){logger['error'](_0x568870['stack']);if(_0x568870['name']){delete _0x568870[_0xb5fa('0x29')];}_0x6a455c[_0xb5fa('0x1a')](_0x20d649)[_0xb5fa('0x2a')](_0x568870);};}exports[_0xb5fa('0x2b')]=function(_0x534884,_0x3506a4){var _0x358549={},_0x353314={},_0x409af9={'count':0x0,'rows':[]};var _0x2a5690=_[_0xb5fa('0x2c')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')],function(_0x1f4380){return{'name':_0x1f4380[_0xb5fa('0x2f')],'type':_0x1f4380[_0xb5fa('0x30')][_0xb5fa('0x31')]};});_0x353314[_0xb5fa('0x32')]=_[_0xb5fa('0x2c')](_0x2a5690,_0xb5fa('0x29'));_0x353314[_0xb5fa('0x33')]=_[_0xb5fa('0x34')](_0x534884[_0xb5fa('0x33')]);_0x353314[_0xb5fa('0x35')]=_['intersection'](_0x353314[_0xb5fa('0x32')],_0x353314['query']);_0x358549['attributes']=_['intersection'](_0x353314[_0xb5fa('0x32')],qs['fields'](_0x534884[_0xb5fa('0x33')]['fields']));_0x358549['attributes']=_0x358549[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x358549['attributes']:_0x353314['model'];if(!_0x534884[_0xb5fa('0x33')][_0xb5fa('0x38')](_0xb5fa('0x39'))){_0x358549['limit']=qs[_0xb5fa('0x1f')](_0x534884[_0xb5fa('0x33')]['limit']);_0x358549[_0xb5fa('0x1c')]=qs[_0xb5fa('0x1c')](_0x534884[_0xb5fa('0x33')]['offset']);}_0x358549[_0xb5fa('0x3a')]=qs[_0xb5fa('0x3b')](_0x534884[_0xb5fa('0x33')]['sort']);_0x358549[_0xb5fa('0x3c')]=qs[_0xb5fa('0x35')](_[_0xb5fa('0x3d')](_0x534884[_0xb5fa('0x33')],_0x353314['filters']),_0x2a5690);if(_0x534884['query']['filter']){_0x358549['where']=_['merge'](_0x358549['where'],{'$or':_[_0xb5fa('0x2c')](_0x2a5690,function(_0x4c0a4d){if(_0x4c0a4d[_0xb5fa('0x30')]!==_0xb5fa('0x3e')){var _0x36db1a={};_0x36db1a[_0x4c0a4d[_0xb5fa('0x29')]]={'$like':'%'+_0x534884[_0xb5fa('0x33')][_0xb5fa('0x3f')]+'%'};return _0x36db1a;}})});}_0x358549=_['merge']({},_0x358549,_0x534884['options']);var _0x4c4bf0={'where':_0x358549[_0xb5fa('0x3c')]};return db['UserProfileResource'][_0xb5fa('0x1e')](_0x4c4bf0)['then'](function(_0x58aa97){_0x409af9[_0xb5fa('0x1e')]=_0x58aa97;if(_0x534884[_0xb5fa('0x33')][_0xb5fa('0x40')]){_0x358549[_0xb5fa('0x41')]=[{'all':!![]}];}return db[_0xb5fa('0x2d')][_0xb5fa('0x42')](_0x358549);})[_0xb5fa('0x43')](function(_0x83df0b){_0x409af9[_0xb5fa('0x44')]=_0x83df0b;return _0x409af9;})[_0xb5fa('0x43')](respondWithFilteredResult(_0x3506a4,_0x358549))['catch'](handleError(_0x3506a4,null));};exports[_0xb5fa('0x45')]=function(_0x4bc9df,_0x233f90){var _0x39aac3={'raw':![],'where':{'id':_0x4bc9df[_0xb5fa('0x46')]['id']}},_0x2c7c5f={};_0x2c7c5f[_0xb5fa('0x32')]=_[_0xb5fa('0x34')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')]);_0x2c7c5f['query']=_[_0xb5fa('0x34')](_0x4bc9df[_0xb5fa('0x33')]);_0x2c7c5f['filters']=_[_0xb5fa('0x47')](_0x2c7c5f['model'],_0x2c7c5f[_0xb5fa('0x33')]);_0x39aac3[_0xb5fa('0x36')]=_['intersection'](_0x2c7c5f['model'],qs[_0xb5fa('0x48')](_0x4bc9df[_0xb5fa('0x33')][_0xb5fa('0x48')]));_0x39aac3[_0xb5fa('0x36')]=_0x39aac3[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x39aac3[_0xb5fa('0x36')]:_0x2c7c5f[_0xb5fa('0x32')];if(_0x4bc9df['query'][_0xb5fa('0x40')]){_0x39aac3[_0xb5fa('0x41')]=[{'all':!![]}];}_0x39aac3=_['merge']({},_0x39aac3,_0x4bc9df[_0xb5fa('0x49')]);return db[_0xb5fa('0x2d')][_0xb5fa('0x4a')](_0x39aac3)[_0xb5fa('0x43')](handleEntityNotFound(_0x233f90,null))[_0xb5fa('0x43')](respondWithResult(_0x233f90,null))[_0xb5fa('0x4b')](handleError(_0x233f90,null));};exports[_0xb5fa('0x4c')]=function(_0x33eb2c,_0x20f5f5){return db[_0xb5fa('0x2d')][_0xb5fa('0x4c')](_0x33eb2c[_0xb5fa('0x4d')],{})[_0xb5fa('0x43')](respondWithResult(_0x20f5f5,0xc9))[_0xb5fa('0x4b')](handleError(_0x20f5f5,null));};exports[_0xb5fa('0x25')]=function(_0x3a39f2,_0x52f5d8){if(_0x3a39f2['body']['id']){delete _0x3a39f2[_0xb5fa('0x4d')]['id'];}return db['UserProfileResource'][_0xb5fa('0x4a')]({'where':{'id':_0x3a39f2[_0xb5fa('0x46')]['id']}})['then'](handleEntityNotFound(_0x52f5d8,null))[_0xb5fa('0x43')](saveUpdates(_0x3a39f2[_0xb5fa('0x4d')],null))[_0xb5fa('0x43')](respondWithResult(_0x52f5d8,null))[_0xb5fa('0x4b')](handleError(_0x52f5d8,null));};exports[_0xb5fa('0x26')]=function(_0x3ffee0,_0x51d5f7){return db[_0xb5fa('0x2d')]['find']({'where':{'id':_0x3ffee0[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x51d5f7,null))[_0xb5fa('0x43')](removeEntity(_0x51d5f7,null))['catch'](handleError(_0x51d5f7,null));};exports[_0xb5fa('0x4e')]=function(_0x130a0d,_0x4dea87){return db['UserProfileResource'][_0xb5fa('0x4e')]()[_0xb5fa('0x43')](respondWithResult(_0x4dea87,null))[_0xb5fa('0x4b')](handleError(_0x4dea87,null));}; \ No newline at end of file +var _0xadb5=['intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','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','UserProfileResource','fieldName','type','key','model','query','keys'];(function(_0x24310a,_0x22f59f){var _0x34fe89=function(_0x4a26c2){while(--_0x4a26c2){_0x24310a['push'](_0x24310a['shift']());}};_0x34fe89(++_0x22f59f);}(_0xadb5,0xad));var _0x5adb=function(_0x5c6812,_0x2ada72){_0x5c6812=_0x5c6812-0x0;var _0x1abf88=_0xadb5[_0x5c6812];return _0x1abf88;};'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['UserProfileResource']['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['UserProfileResource'][_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['UserProfileResource'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));};exports['describe']=function(_0x36b847,_0x3a5703){return db[_0x5adb('0x2a')][_0x5adb('0x49')]()['then'](respondWithResult(_0x3a5703,null))[_0x5adb('0x42')](handleError(_0x3a5703,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 83e26d6..954b853 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 _0x7c24=['define','UserProfileResource','compositeIndex','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userProfileResource.attributes','exports'];(function(_0x5e6dca,_0x21c716){var _0x2a5406=function(_0x45e401){while(--_0x45e401){_0x5e6dca['push'](_0x5e6dca['shift']());}};_0x2a5406(++_0x21c716);}(_0x7c24,0x1f1));var _0x47c2=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x7c24[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0x47c2('0x0'));var util=require('util');var logger=require(_0x47c2('0x1'))(_0x47c2('0x2'));var moment=require(_0x47c2('0x3'));var BPromise=require(_0x47c2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47c2('0x5'));var rimraf=require(_0x47c2('0x6'));var config=require(_0x47c2('0x7'));var attributes=require(_0x47c2('0x8'));module[_0x47c2('0x9')]=function(_0x5b036e,_0x2ef516){return _0x5b036e[_0x47c2('0xa')](_0x47c2('0xb'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x47c2('0xc'),'fields':['resourceId','sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0bd1=['UserProfileResource','user_profile_has_resources','compositeIndex','lodash','util','api','moment','path','./userProfileResource.attributes','define'];(function(_0x3def85,_0x5787b9){var _0x5d5c89=function(_0x23bd6b){while(--_0x23bd6b){_0x3def85['push'](_0x3def85['shift']());}};_0x5d5c89(++_0x5787b9);}(_0x0bd1,0xcb));var _0x10bd=function(_0x2c73fa,_0x41b660){_0x2c73fa=_0x2c73fa-0x0;var _0x201374=_0x0bd1[_0x2c73fa];return _0x201374;};'use strict';var _=require(_0x10bd('0x0'));var util=require(_0x10bd('0x1'));var logger=require('../../config/logger')(_0x10bd('0x2'));var moment=require(_0x10bd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x10bd('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x10bd('0x5'));module['exports']=function(_0x24b518,_0x29ef4d){return _0x24b518[_0x10bd('0x6')](_0x10bd('0x7'),attributes,{'tableName':_0x10bd('0x8'),'paranoid':![],'indexes':[{'name':_0x10bd('0x9'),'fields':['resourceId','sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 059074f..80f52b9 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 _0xa1f0=['UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa1f0,0x93));var _0x0a1f=function(_0x24531d,_0xbac1e2){_0x24531d=_0x24531d-0x0;var _0x28b30c=_0xa1f0[_0x24531d];return _0x28b30c;};'use strict';var _=require(_0x0a1f('0x0'));var util=require(_0x0a1f('0x1'));var moment=require(_0x0a1f('0x2'));var BPromise=require(_0x0a1f('0x3'));var rs=require(_0x0a1f('0x4'));var fs=require('fs');var Redis=require(_0x0a1f('0x5'));var db=require(_0x0a1f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a1f('0x7'))(_0x0a1f('0x8'));var config=require(_0x0a1f('0x9'));var jayson=require(_0x0a1f('0xa'));var client=jayson[_0x0a1f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54d7e3,_0x1c06ac,_0x2a6970){return new BPromise(function(_0x12a59d,_0x3b1cc1){return client[_0x0a1f('0xc')](_0x54d7e3,_0x2a6970)['then'](function(_0x55f15c){logger[_0x0a1f('0xd')](_0x0a1f('0xe'),_0x1c06ac,_0x0a1f('0xf'));logger[_0x0a1f('0x10')](_0x0a1f('0x11'),_0x1c06ac,_0x0a1f('0xf'),JSON[_0x0a1f('0x12')](_0x55f15c));if(_0x55f15c['error']){if(_0x55f15c[_0x0a1f('0x13')][_0x0a1f('0x14')]===0x1f4){logger['error'](_0x0a1f('0xe'),_0x1c06ac,_0x55f15c[_0x0a1f('0x13')][_0x0a1f('0x15')]);return _0x3b1cc1(_0x55f15c[_0x0a1f('0x13')][_0x0a1f('0x15')]);}logger['error'](_0x0a1f('0xe'),_0x1c06ac,_0x55f15c[_0x0a1f('0x13')][_0x0a1f('0x15')]);return _0x12a59d(_0x55f15c[_0x0a1f('0x13')]['message']);}else{logger[_0x0a1f('0xd')](_0x0a1f('0xe'),_0x1c06ac,_0x0a1f('0xf'));_0x12a59d(_0x55f15c['result'][_0x0a1f('0x15')]);}})[_0x0a1f('0x16')](function(_0x31aaad){logger[_0x0a1f('0x13')](_0x0a1f('0xe'),_0x1c06ac,_0x31aaad);_0x3b1cc1(_0x31aaad);});});} \ No newline at end of file +var _0x747e=['client','http','request','info','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x747e,0x1db));var _0xe747=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x747e[_0x556927];return _0x5f1235;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe747('0x0'));var BPromise=require(_0xe747('0x1'));var rs=require(_0xe747('0x2'));var fs=require('fs');var Redis=require(_0xe747('0x3'));var db=require(_0xe747('0x4'))['db'];var utils=require(_0xe747('0x5'));var logger=require(_0xe747('0x6'))(_0xe747('0x7'));var config=require('../../config/environment');var jayson=require(_0xe747('0x8'));var client=jayson[_0xe747('0x9')][_0xe747('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30aab1,_0x3b7c8e,_0x38ec6d){return new BPromise(function(_0x547397,_0x496d1a){return client[_0xe747('0xb')](_0x30aab1,_0x38ec6d)['then'](function(_0x2a9e9b){logger[_0xe747('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x3b7c8e,_0xe747('0xd'));logger[_0xe747('0xe')](_0xe747('0xf'),_0x3b7c8e,_0xe747('0xd'),JSON[_0xe747('0x10')](_0x2a9e9b));if(_0x2a9e9b[_0xe747('0x11')]){if(_0x2a9e9b['error'][_0xe747('0x12')]===0x1f4){logger[_0xe747('0x11')](_0xe747('0x13'),_0x3b7c8e,_0x2a9e9b[_0xe747('0x11')][_0xe747('0x14')]);return _0x496d1a(_0x2a9e9b[_0xe747('0x11')][_0xe747('0x14')]);}logger[_0xe747('0x11')](_0xe747('0x13'),_0x3b7c8e,_0x2a9e9b['error'][_0xe747('0x14')]);return _0x547397(_0x2a9e9b['error']['message']);}else{logger['info']('UserProfileResource,\x20%s,\x20%s',_0x3b7c8e,_0xe747('0xd'));_0x547397(_0x2a9e9b[_0xe747('0x15')][_0xe747('0x14')]);}})['catch'](function(_0x560b78){logger[_0xe747('0x11')](_0xe747('0x13'),_0x3b7c8e,_0x560b78);_0x496d1a(_0x560b78);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 1db143c..0a663fd 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 _0x1a98=['express','Router','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index','/describe','describe','get','/:id','put','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x25764f,_0x1db05e){var _0x217e84=function(_0x4f2975){while(--_0x4f2975){_0x25764f['push'](_0x25764f['shift']());}};_0x217e84(++_0x1db05e);}(_0x1a98,0x141));var _0x81a9=function(_0x2fcb2b,_0x332ee3){_0x2fcb2b=_0x2fcb2b-0x0;var _0x3f93da=_0x1a98[_0x2fcb2b];return _0x3f93da;};'use strict';var multer=require(_0x81a9('0x0'));var util=require(_0x81a9('0x1'));var path=require('path');var timeout=require(_0x81a9('0x2'));var express=require(_0x81a9('0x3'));var router=express[_0x81a9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x81a9('0x5'));var config=require(_0x81a9('0x6'));var controller=require(_0x81a9('0x7'));router['get']('/',auth[_0x81a9('0x8')](),controller[_0x81a9('0x9')]);router['get'](_0x81a9('0xa'),auth[_0x81a9('0x8')](),controller[_0x81a9('0xb')]);router[_0x81a9('0xc')](_0x81a9('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x81a9('0x8')](),controller['create']);router[_0x81a9('0xe')](_0x81a9('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x81a9('0xf')](_0x81a9('0xd'),auth[_0x81a9('0x8')](),controller[_0x81a9('0x10')]);module[_0x81a9('0x11')]=router; \ No newline at end of file +var _0x5bc0=['Router','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x5aa51e,_0x3687c7){var _0x4b979e=function(_0x5590cd){while(--_0x5590cd){_0x5aa51e['push'](_0x5aa51e['shift']());}};_0x4b979e(++_0x3687c7);}(_0x5bc0,0x150));var _0x05bc=function(_0x11707d,_0x5d8dc0){_0x11707d=_0x11707d-0x0;var _0x4454bd=_0x5bc0[_0x11707d];return _0x4454bd;};'use strict';var multer=require(_0x05bc('0x0'));var util=require('util');var path=require(_0x05bc('0x1'));var timeout=require(_0x05bc('0x2'));var express=require(_0x05bc('0x3'));var router=express[_0x05bc('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x05bc('0x5'));var config=require(_0x05bc('0x6'));var controller=require(_0x05bc('0x7'));router['get']('/',auth[_0x05bc('0x8')](),controller[_0x05bc('0x9')]);router[_0x05bc('0xa')](_0x05bc('0xb'),auth[_0x05bc('0x8')](),controller[_0x05bc('0xc')]);router[_0x05bc('0xa')](_0x05bc('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x05bc('0xe')]('/',auth[_0x05bc('0x8')](),controller[_0x05bc('0xf')]);router[_0x05bc('0x10')](_0x05bc('0xd'),auth[_0x05bc('0x8')](),controller[_0x05bc('0x11')]);router['delete'](_0x05bc('0xd'),auth[_0x05bc('0x8')](),controller[_0x05bc('0x12')]);module[_0x05bc('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 8f0dbe1..8178ac7 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 _0x6b20=['getDataValue','sequelize','exports','STRING','BOOLEAN','setDataValue','crudPermissions','join'];(function(_0x18fc56,_0xea32e5){var _0x14f3ec=function(_0x4f5979){while(--_0x4f5979){_0x18fc56['push'](_0x18fc56['shift']());}};_0x14f3ec(++_0xea32e5);}(_0x6b20,0xd1));var _0x06b2=function(_0x22c19e,_0x5e620b){_0x22c19e=_0x22c19e-0x0;var _0xfc922e=_0x6b20[_0x22c19e];return _0xfc922e;};'use strict';var Sequelize=require(_0x06b2('0x0'));module[_0x06b2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x06b2('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x06b2('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x06b2('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x06b2('0x2')],'set':function(_0x5ba392){this[_0x06b2('0x4')](_0x06b2('0x5'),_0x5ba392?_0x5ba392[_0x06b2('0x6')](''):[]);},'get':function(){return this[_0x06b2('0x7')](_0x06b2('0x5'))?this[_0x06b2('0x7')](_0x06b2('0x5'))['split'](''):[];}}}; \ No newline at end of file +var _0x4e81=['join','getDataValue','split','sequelize','exports','STRING','BOOLEAN','setDataValue','crudPermissions'];(function(_0x39caaa,_0x1f37bc){var _0x9b9c7d=function(_0x2da02c){while(--_0x2da02c){_0x39caaa['push'](_0x39caaa['shift']());}};_0x9b9c7d(++_0x1f37bc);}(_0x4e81,0x1bc));var _0x14e8=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x4e81[_0x176329];return _0x31997c;};'use strict';var Sequelize=require(_0x14e8('0x0'));module[_0x14e8('0x1')]={'name':{'type':Sequelize[_0x14e8('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x14e8('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x14e8('0x2')],'set':function(_0x224121){this[_0x14e8('0x4')](_0x14e8('0x5'),_0x224121?_0x224121[_0x14e8('0x6')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0x14e8('0x7')](_0x14e8('0x5'))[_0x14e8('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 8f5a6a6..da88475 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 _0xa6d5=['filters','intersection','attributes','fields','length','hasOwnProperty','where','merge','map','VIRTUAL','include','rows','show','params','includeAll','options','find','create','body','catch','describe','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','name','send','UserProfileSection','fieldName','type','key','model','query','keys'];(function(_0x39f420,_0x65b2ce){var _0x47e7fa=function(_0x483cf2){while(--_0x483cf2){_0x39f420['push'](_0x39f420['shift']());}};_0x47e7fa(++_0x65b2ce);}(_0xa6d5,0x1b9));var _0x5a6d=function(_0x555d79,_0x3c4ed8){_0x555d79=_0x555d79-0x0;var _0x2a83d5=_0xa6d5[_0x555d79];return _0x2a83d5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5a6d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5a6d('0x1'));var rp=require(_0x5a6d('0x2'));var moment=require(_0x5a6d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5a6d('0x4'));var util=require(_0x5a6d('0x5'));var path=require('path');var sox=require(_0x5a6d('0x6'));var csv=require(_0x5a6d('0x7'));var ejs=require(_0x5a6d('0x8'));var fs=require('fs');var fs_extra=require(_0x5a6d('0x9'));var _=require(_0x5a6d('0xa'));var squel=require(_0x5a6d('0xb'));var crypto=require(_0x5a6d('0xc'));var jsforce=require(_0x5a6d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5a6d('0xe'));var Papa=require(_0x5a6d('0xf'));var Redis=require(_0x5a6d('0x10'));var authService=require(_0x5a6d('0x11'));var qs=require(_0x5a6d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5a6d('0x13'));var logger=require(_0x5a6d('0x14'))(_0x5a6d('0x15'));var utils=require(_0x5a6d('0x16'));var config=require(_0x5a6d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5a6d('0x18'))['db'];function respondWithStatusCode(_0x2d0efe,_0x50dcca){_0x50dcca=_0x50dcca||0xcc;return function(_0x29281e){if(_0x29281e){return _0x2d0efe[_0x5a6d('0x19')](_0x50dcca);}return _0x2d0efe['status'](_0x50dcca)[_0x5a6d('0x1a')]();};}function respondWithResult(_0x43531d,_0x198628){_0x198628=_0x198628||0xc8;return function(_0x27310c){if(_0x27310c){return _0x43531d[_0x5a6d('0x1b')](_0x198628)[_0x5a6d('0x1c')](_0x27310c);}};}function respondWithFilteredResult(_0xda5003,_0x3f7b02){return function(_0x22aeb0){if(_0x22aeb0){var _0x1ea9cc=typeof _0x3f7b02['offset']===_0x5a6d('0x1d')&&typeof _0x3f7b02[_0x5a6d('0x1e')]===_0x5a6d('0x1d');var _0x240e66=_0x22aeb0[_0x5a6d('0x1f')];var _0x8d55bb=_0x1ea9cc?0x0:_0x3f7b02[_0x5a6d('0x20')];var _0x25f935=_0x1ea9cc?_0x22aeb0['count']:_0x3f7b02[_0x5a6d('0x20')]+_0x3f7b02[_0x5a6d('0x1e')];var _0x11b208;if(_0x25f935>=_0x240e66){_0x25f935=_0x240e66;_0x11b208=0xc8;}else{_0x11b208=0xce;}_0xda5003[_0x5a6d('0x1b')](_0x11b208);return _0xda5003[_0x5a6d('0x21')](_0x5a6d('0x22'),_0x8d55bb+'-'+_0x25f935+'/'+_0x240e66)[_0x5a6d('0x1c')](_0x22aeb0);}return null;};}function patchUpdates(_0x3cad50){return function(_0x46623c){try{jsonpatch['apply'](_0x46623c,_0x3cad50,!![]);}catch(_0x43205b){return BPromise[_0x5a6d('0x23')](_0x43205b);}return _0x46623c[_0x5a6d('0x24')]();};}function saveUpdates(_0x730fa2,_0x5dce79){return function(_0x4eca5f){if(_0x4eca5f){return _0x4eca5f[_0x5a6d('0x25')](_0x730fa2)[_0x5a6d('0x26')](function(_0x443075){return _0x443075;});}return null;};}function removeEntity(_0x5992d4,_0x1bd984){return function(_0x444b0a){if(_0x444b0a){return _0x444b0a[_0x5a6d('0x27')]()[_0x5a6d('0x26')](function(){_0x5992d4[_0x5a6d('0x1b')](0xcc)[_0x5a6d('0x1a')]();});}};}function handleEntityNotFound(_0x2b1e88,_0x18b36d){return function(_0x2f2ac4){if(!_0x2f2ac4){_0x2b1e88[_0x5a6d('0x19')](0x194);}return _0x2f2ac4;};}function handleError(_0x3d6b0c,_0x593d39){_0x593d39=_0x593d39||0x1f4;return function(_0x1e1861){logger['error'](_0x1e1861['stack']);if(_0x1e1861[_0x5a6d('0x28')]){delete _0x1e1861[_0x5a6d('0x28')];}_0x3d6b0c['status'](_0x593d39)[_0x5a6d('0x29')](_0x1e1861);};}exports['index']=function(_0x4c4a2b,_0x45e436){var _0x1e2c49={},_0x1651ac={},_0x5b75e4={'count':0x0,'rows':[]};var _0x50b214=_['map'](db[_0x5a6d('0x2a')]['rawAttributes'],function(_0x44e992){return{'name':_0x44e992[_0x5a6d('0x2b')],'type':_0x44e992[_0x5a6d('0x2c')][_0x5a6d('0x2d')]};});_0x1651ac[_0x5a6d('0x2e')]=_['map'](_0x50b214,_0x5a6d('0x28'));_0x1651ac[_0x5a6d('0x2f')]=_[_0x5a6d('0x30')](_0x4c4a2b[_0x5a6d('0x2f')]);_0x1651ac[_0x5a6d('0x31')]=_[_0x5a6d('0x32')](_0x1651ac[_0x5a6d('0x2e')],_0x1651ac[_0x5a6d('0x2f')]);_0x1e2c49[_0x5a6d('0x33')]=_[_0x5a6d('0x32')](_0x1651ac[_0x5a6d('0x2e')],qs[_0x5a6d('0x34')](_0x4c4a2b[_0x5a6d('0x2f')][_0x5a6d('0x34')]));_0x1e2c49[_0x5a6d('0x33')]=_0x1e2c49['attributes'][_0x5a6d('0x35')]?_0x1e2c49[_0x5a6d('0x33')]:_0x1651ac[_0x5a6d('0x2e')];if(!_0x4c4a2b[_0x5a6d('0x2f')][_0x5a6d('0x36')]('nolimit')){_0x1e2c49[_0x5a6d('0x1e')]=qs[_0x5a6d('0x1e')](_0x4c4a2b['query'][_0x5a6d('0x1e')]);_0x1e2c49[_0x5a6d('0x20')]=qs[_0x5a6d('0x20')](_0x4c4a2b[_0x5a6d('0x2f')][_0x5a6d('0x20')]);}_0x1e2c49['order']=qs['sort'](_0x4c4a2b[_0x5a6d('0x2f')]['sort']);_0x1e2c49[_0x5a6d('0x37')]=qs['filters'](_['pick'](_0x4c4a2b[_0x5a6d('0x2f')],_0x1651ac[_0x5a6d('0x31')]),_0x50b214);if(_0x4c4a2b[_0x5a6d('0x2f')]['filter']){_0x1e2c49['where']=_[_0x5a6d('0x38')](_0x1e2c49['where'],{'$or':_[_0x5a6d('0x39')](_0x50b214,function(_0x25c2a1){if(_0x25c2a1[_0x5a6d('0x2c')]!==_0x5a6d('0x3a')){var _0xfc6360={};_0xfc6360[_0x25c2a1[_0x5a6d('0x28')]]={'$like':'%'+_0x4c4a2b[_0x5a6d('0x2f')]['filter']+'%'};return _0xfc6360;}})});}_0x1e2c49=_[_0x5a6d('0x38')]({},_0x1e2c49,_0x4c4a2b['options']);var _0x27e3c7={'where':_0x1e2c49[_0x5a6d('0x37')]};return db['UserProfileSection'][_0x5a6d('0x1f')](_0x27e3c7)[_0x5a6d('0x26')](function(_0x38273f){_0x5b75e4['count']=_0x38273f;if(_0x4c4a2b['query']['includeAll']){_0x1e2c49[_0x5a6d('0x3b')]=[{'all':!![]}];}return db[_0x5a6d('0x2a')]['findAll'](_0x1e2c49);})['then'](function(_0x28031c){_0x5b75e4[_0x5a6d('0x3c')]=_0x28031c;return _0x5b75e4;})[_0x5a6d('0x26')](respondWithFilteredResult(_0x45e436,_0x1e2c49))['catch'](handleError(_0x45e436,null));};exports[_0x5a6d('0x3d')]=function(_0x23c30c,_0x169e1d){var _0x1e59ae={'raw':![],'where':{'id':_0x23c30c[_0x5a6d('0x3e')]['id']}},_0x26d7d1={};_0x26d7d1[_0x5a6d('0x2e')]=_[_0x5a6d('0x30')](db[_0x5a6d('0x2a')]['rawAttributes']);_0x26d7d1[_0x5a6d('0x2f')]=_['keys'](_0x23c30c[_0x5a6d('0x2f')]);_0x26d7d1[_0x5a6d('0x31')]=_[_0x5a6d('0x32')](_0x26d7d1[_0x5a6d('0x2e')],_0x26d7d1[_0x5a6d('0x2f')]);_0x1e59ae[_0x5a6d('0x33')]=_[_0x5a6d('0x32')](_0x26d7d1['model'],qs['fields'](_0x23c30c[_0x5a6d('0x2f')][_0x5a6d('0x34')]));_0x1e59ae[_0x5a6d('0x33')]=_0x1e59ae[_0x5a6d('0x33')][_0x5a6d('0x35')]?_0x1e59ae['attributes']:_0x26d7d1[_0x5a6d('0x2e')];if(_0x23c30c[_0x5a6d('0x2f')][_0x5a6d('0x3f')]){_0x1e59ae[_0x5a6d('0x3b')]=[{'all':!![]}];}_0x1e59ae=_[_0x5a6d('0x38')]({},_0x1e59ae,_0x23c30c[_0x5a6d('0x40')]);return db['UserProfileSection'][_0x5a6d('0x41')](_0x1e59ae)[_0x5a6d('0x26')](handleEntityNotFound(_0x169e1d,null))['then'](respondWithResult(_0x169e1d,null))['catch'](handleError(_0x169e1d,null));};exports[_0x5a6d('0x42')]=function(_0x93befb,_0x44f956){return db[_0x5a6d('0x2a')]['create'](_0x93befb[_0x5a6d('0x43')],{})[_0x5a6d('0x26')](respondWithResult(_0x44f956,0xc9))[_0x5a6d('0x44')](handleError(_0x44f956,null));};exports[_0x5a6d('0x25')]=function(_0x507811,_0x527387){if(_0x507811[_0x5a6d('0x43')]['id']){delete _0x507811['body']['id'];}return db[_0x5a6d('0x2a')][_0x5a6d('0x41')]({'where':{'id':_0x507811[_0x5a6d('0x3e')]['id']}})['then'](handleEntityNotFound(_0x527387,null))[_0x5a6d('0x26')](saveUpdates(_0x507811['body'],null))[_0x5a6d('0x26')](respondWithResult(_0x527387,null))[_0x5a6d('0x44')](handleError(_0x527387,null));};exports[_0x5a6d('0x27')]=function(_0x4ba219,_0x1a21a7){return db[_0x5a6d('0x2a')][_0x5a6d('0x41')]({'where':{'id':_0x4ba219['params']['id']}})[_0x5a6d('0x26')](handleEntityNotFound(_0x1a21a7,null))[_0x5a6d('0x26')](removeEntity(_0x1a21a7,null))[_0x5a6d('0x44')](handleError(_0x1a21a7,null));};exports[_0x5a6d('0x45')]=function(_0x5b42a3,_0x17a63b){return db[_0x5a6d('0x2a')][_0x5a6d('0x45')]()[_0x5a6d('0x26')](respondWithResult(_0x17a63b,null))[_0x5a6d('0x44')](handleError(_0x17a63b,null));}; \ No newline at end of file +var _0x4a87=['key','model','map','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','send','UserProfileSection','rawAttributes','type'];(function(_0x39dbaa,_0x16e4ff){var _0x58913c=function(_0x2f05cc){while(--_0x2f05cc){_0x39dbaa['push'](_0x39dbaa['shift']());}};_0x58913c(++_0x16e4ff);}(_0x4a87,0x106));var _0x74a8=function(_0xc1a518,_0x656e95){_0xc1a518=_0xc1a518-0x0;var _0x31f0e2=_0x4a87[_0xc1a518];return _0x31f0e2;};'use strict';var emlformat=require(_0x74a8('0x0'));var rimraf=require(_0x74a8('0x1'));var zipdir=require(_0x74a8('0x2'));var jsonpatch=require(_0x74a8('0x3'));var rp=require(_0x74a8('0x4'));var moment=require(_0x74a8('0x5'));var BPromise=require(_0x74a8('0x6'));var Mustache=require(_0x74a8('0x7'));var util=require('util');var path=require(_0x74a8('0x8'));var sox=require('sox');var csv=require(_0x74a8('0x9'));var ejs=require(_0x74a8('0xa'));var fs=require('fs');var fs_extra=require(_0x74a8('0xb'));var _=require(_0x74a8('0xc'));var squel=require(_0x74a8('0xd'));var crypto=require(_0x74a8('0xe'));var jsforce=require(_0x74a8('0xf'));var deskjs=require(_0x74a8('0x10'));var toCsv=require(_0x74a8('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x74a8('0x11'));var authService=require(_0x74a8('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x74a8('0x13'));var hardwareService=require(_0x74a8('0x14'));var logger=require(_0x74a8('0x15'))(_0x74a8('0x16'));var utils=require('../../config/utils');var config=require(_0x74a8('0x17'));var licenseUtil=require(_0x74a8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f3a05,_0x53faae){_0x53faae=_0x53faae||0xcc;return function(_0x4044fe){if(_0x4044fe){return _0x4f3a05[_0x74a8('0x19')](_0x53faae);}return _0x4f3a05[_0x74a8('0x1a')](_0x53faae)[_0x74a8('0x1b')]();};}function respondWithResult(_0x1e140b,_0x4c5a2c){_0x4c5a2c=_0x4c5a2c||0xc8;return function(_0x57cbf5){if(_0x57cbf5){return _0x1e140b['status'](_0x4c5a2c)[_0x74a8('0x1c')](_0x57cbf5);}};}function respondWithFilteredResult(_0x2179c7,_0x702e91){return function(_0x2d3b2c){if(_0x2d3b2c){var _0x23ac75=typeof _0x702e91['offset']===_0x74a8('0x1d')&&typeof _0x702e91[_0x74a8('0x1e')]===_0x74a8('0x1d');var _0x36a4bf=_0x2d3b2c[_0x74a8('0x1f')];var _0x3772cd=_0x23ac75?0x0:_0x702e91[_0x74a8('0x20')];var _0x524cd8=_0x23ac75?_0x2d3b2c[_0x74a8('0x1f')]:_0x702e91[_0x74a8('0x20')]+_0x702e91[_0x74a8('0x1e')];var _0x356575;if(_0x524cd8>=_0x36a4bf){_0x524cd8=_0x36a4bf;_0x356575=0xc8;}else{_0x356575=0xce;}_0x2179c7[_0x74a8('0x1a')](_0x356575);return _0x2179c7[_0x74a8('0x21')](_0x74a8('0x22'),_0x3772cd+'-'+_0x524cd8+'/'+_0x36a4bf)['json'](_0x2d3b2c);}return null;};}function patchUpdates(_0x4b12e6){return function(_0x1d82be){try{jsonpatch[_0x74a8('0x23')](_0x1d82be,_0x4b12e6,!![]);}catch(_0x34efc8){return BPromise[_0x74a8('0x24')](_0x34efc8);}return _0x1d82be['save']();};}function saveUpdates(_0x57be27,_0x1435f7){return function(_0x443e06){if(_0x443e06){return _0x443e06[_0x74a8('0x25')](_0x57be27)[_0x74a8('0x26')](function(_0x1d019a){return _0x1d019a;});}return null;};}function removeEntity(_0x2d03cd,_0xf141cb){return function(_0x1f8d0f){if(_0x1f8d0f){return _0x1f8d0f[_0x74a8('0x27')]()[_0x74a8('0x26')](function(){_0x2d03cd[_0x74a8('0x1a')](0xcc)[_0x74a8('0x1b')]();});}};}function handleEntityNotFound(_0xb60c8a,_0x3f71b1){return function(_0x56849a){if(!_0x56849a){_0xb60c8a[_0x74a8('0x19')](0x194);}return _0x56849a;};}function handleError(_0x41948e,_0x431ed3){_0x431ed3=_0x431ed3||0x1f4;return function(_0x2218c1){logger[_0x74a8('0x28')](_0x2218c1[_0x74a8('0x29')]);if(_0x2218c1['name']){delete _0x2218c1['name'];}_0x41948e[_0x74a8('0x1a')](_0x431ed3)[_0x74a8('0x2a')](_0x2218c1);};}exports['index']=function(_0x3fc0f9,_0x1449d0){var _0x56f2a2={},_0x570e6b={},_0x34d6e8={'count':0x0,'rows':[]};var _0x4331a8=_['map'](db[_0x74a8('0x2b')][_0x74a8('0x2c')],function(_0x3f301e){return{'name':_0x3f301e['fieldName'],'type':_0x3f301e[_0x74a8('0x2d')][_0x74a8('0x2e')]};});_0x570e6b[_0x74a8('0x2f')]=_[_0x74a8('0x30')](_0x4331a8,_0x74a8('0x31'));_0x570e6b['query']=_['keys'](_0x3fc0f9[_0x74a8('0x32')]);_0x570e6b[_0x74a8('0x33')]=_[_0x74a8('0x34')](_0x570e6b[_0x74a8('0x2f')],_0x570e6b[_0x74a8('0x32')]);_0x56f2a2[_0x74a8('0x35')]=_[_0x74a8('0x34')](_0x570e6b[_0x74a8('0x2f')],qs[_0x74a8('0x36')](_0x3fc0f9[_0x74a8('0x32')][_0x74a8('0x36')]));_0x56f2a2[_0x74a8('0x35')]=_0x56f2a2[_0x74a8('0x35')]['length']?_0x56f2a2[_0x74a8('0x35')]:_0x570e6b['model'];if(!_0x3fc0f9[_0x74a8('0x32')][_0x74a8('0x37')](_0x74a8('0x38'))){_0x56f2a2[_0x74a8('0x1e')]=qs[_0x74a8('0x1e')](_0x3fc0f9[_0x74a8('0x32')]['limit']);_0x56f2a2[_0x74a8('0x20')]=qs[_0x74a8('0x20')](_0x3fc0f9[_0x74a8('0x32')][_0x74a8('0x20')]);}_0x56f2a2[_0x74a8('0x39')]=qs[_0x74a8('0x3a')](_0x3fc0f9[_0x74a8('0x32')][_0x74a8('0x3a')]);_0x56f2a2[_0x74a8('0x3b')]=qs[_0x74a8('0x33')](_[_0x74a8('0x3c')](_0x3fc0f9['query'],_0x570e6b[_0x74a8('0x33')]),_0x4331a8);if(_0x3fc0f9['query'][_0x74a8('0x3d')]){_0x56f2a2[_0x74a8('0x3b')]=_[_0x74a8('0x3e')](_0x56f2a2[_0x74a8('0x3b')],{'$or':_[_0x74a8('0x30')](_0x4331a8,function(_0x4ea159){if(_0x4ea159[_0x74a8('0x2d')]!==_0x74a8('0x3f')){var _0x3fb333={};_0x3fb333[_0x4ea159[_0x74a8('0x31')]]={'$like':'%'+_0x3fc0f9[_0x74a8('0x32')][_0x74a8('0x3d')]+'%'};return _0x3fb333;}})});}_0x56f2a2=_[_0x74a8('0x3e')]({},_0x56f2a2,_0x3fc0f9[_0x74a8('0x40')]);var _0xb8ea80={'where':_0x56f2a2[_0x74a8('0x3b')]};return db[_0x74a8('0x2b')][_0x74a8('0x1f')](_0xb8ea80)[_0x74a8('0x26')](function(_0x526d46){_0x34d6e8[_0x74a8('0x1f')]=_0x526d46;if(_0x3fc0f9[_0x74a8('0x32')]['includeAll']){_0x56f2a2[_0x74a8('0x41')]=[{'all':!![]}];}return db['UserProfileSection'][_0x74a8('0x42')](_0x56f2a2);})[_0x74a8('0x26')](function(_0x1a83a1){_0x34d6e8[_0x74a8('0x43')]=_0x1a83a1;return _0x34d6e8;})['then'](respondWithFilteredResult(_0x1449d0,_0x56f2a2))[_0x74a8('0x44')](handleError(_0x1449d0,null));};exports[_0x74a8('0x45')]=function(_0x4371d3,_0x3d023e){var _0x355078={'raw':![],'where':{'id':_0x4371d3[_0x74a8('0x46')]['id']}},_0x6bcdd={};_0x6bcdd[_0x74a8('0x2f')]=_[_0x74a8('0x47')](db[_0x74a8('0x2b')][_0x74a8('0x2c')]);_0x6bcdd['query']=_[_0x74a8('0x47')](_0x4371d3[_0x74a8('0x32')]);_0x6bcdd[_0x74a8('0x33')]=_[_0x74a8('0x34')](_0x6bcdd[_0x74a8('0x2f')],_0x6bcdd['query']);_0x355078['attributes']=_[_0x74a8('0x34')](_0x6bcdd[_0x74a8('0x2f')],qs[_0x74a8('0x36')](_0x4371d3[_0x74a8('0x32')][_0x74a8('0x36')]));_0x355078[_0x74a8('0x35')]=_0x355078[_0x74a8('0x35')][_0x74a8('0x48')]?_0x355078[_0x74a8('0x35')]:_0x6bcdd[_0x74a8('0x2f')];if(_0x4371d3['query']['includeAll']){_0x355078[_0x74a8('0x41')]=[{'all':!![]}];}_0x355078=_[_0x74a8('0x3e')]({},_0x355078,_0x4371d3['options']);return db[_0x74a8('0x2b')][_0x74a8('0x49')](_0x355078)['then'](handleEntityNotFound(_0x3d023e,null))[_0x74a8('0x26')](respondWithResult(_0x3d023e,null))[_0x74a8('0x44')](handleError(_0x3d023e,null));};exports[_0x74a8('0x4a')]=function(_0x5ac480,_0x470a31){return db[_0x74a8('0x2b')][_0x74a8('0x4a')](_0x5ac480[_0x74a8('0x4b')],{})['then'](respondWithResult(_0x470a31,0xc9))[_0x74a8('0x44')](handleError(_0x470a31,null));};exports[_0x74a8('0x25')]=function(_0x3436b9,_0x369469){if(_0x3436b9[_0x74a8('0x4b')]['id']){delete _0x3436b9[_0x74a8('0x4b')]['id'];}return db[_0x74a8('0x2b')]['find']({'where':{'id':_0x3436b9[_0x74a8('0x46')]['id']}})[_0x74a8('0x26')](handleEntityNotFound(_0x369469,null))[_0x74a8('0x26')](saveUpdates(_0x3436b9[_0x74a8('0x4b')],null))[_0x74a8('0x26')](respondWithResult(_0x369469,null))['catch'](handleError(_0x369469,null));};exports[_0x74a8('0x27')]=function(_0x495402,_0xb6b887){return db['UserProfileSection'][_0x74a8('0x49')]({'where':{'id':_0x495402['params']['id']}})['then'](handleEntityNotFound(_0xb6b887,null))['then'](removeEntity(_0xb6b887,null))['catch'](handleError(_0xb6b887,null));};exports[_0x74a8('0x4c')]=function(_0x24febb,_0x1a3744){return db[_0x74a8('0x2b')][_0x74a8('0x4c')]()['then'](respondWithResult(_0x1a3744,null))[_0x74a8('0x44')](handleError(_0x1a3744,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index b10c4eb..c296afc 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 _0xa937=['moment','bluebird','request-promise','path','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','sectionId','userProfileId','lodash','util'];(function(_0x5db97a,_0x3d2426){var _0x481499=function(_0xa6b7c8){while(--_0xa6b7c8){_0x5db97a['push'](_0x5db97a['shift']());}};_0x481499(++_0x3d2426);}(_0xa937,0xde));var _0x7a93=function(_0x559c23,_0x12db18){_0x559c23=_0x559c23-0x0;var _0x3ac67e=_0xa937[_0x559c23];return _0x3ac67e;};'use strict';var _=require(_0x7a93('0x0'));var util=require(_0x7a93('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7a93('0x2'));var BPromise=require(_0x7a93('0x3'));var rp=require(_0x7a93('0x4'));var fs=require('fs');var path=require(_0x7a93('0x5'));var rimraf=require('rimraf');var config=require(_0x7a93('0x6'));var attributes=require(_0x7a93('0x7'));module[_0x7a93('0x8')]=function(_0x31d423,_0x5eec4e){return _0x31d423[_0x7a93('0x9')](_0x7a93('0xa'),attributes,{'tableName':_0x7a93('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x7a93('0xc'),_0x7a93('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6789=['compositeIndex','userProfileId','lodash','util','api','bluebird','request-promise','path','rimraf','UserProfileSection','user_profile_has_sections'];(function(_0x1b9029,_0x367e44){var _0x26f3b8=function(_0x9582f6){while(--_0x9582f6){_0x1b9029['push'](_0x1b9029['shift']());}};_0x26f3b8(++_0x367e44);}(_0x6789,0x86));var _0x9678=function(_0x43d668,_0x3398de){_0x43d668=_0x43d668-0x0;var _0x548973=_0x6789[_0x43d668];return _0x548973;};'use strict';var _=require(_0x9678('0x0'));var util=require(_0x9678('0x1'));var logger=require('../../config/logger')(_0x9678('0x2'));var moment=require('moment');var BPromise=require(_0x9678('0x3'));var rp=require(_0x9678('0x4'));var fs=require('fs');var path=require(_0x9678('0x5'));var rimraf=require(_0x9678('0x6'));var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x5dd047,_0x480df2){return _0x5dd047['define'](_0x9678('0x7'),attributes,{'tableName':_0x9678('0x8'),'paranoid':![],'indexes':[{'name':_0x9678('0x9'),'fields':['sectionId',_0x9678('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 65acb02..5b266f4 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 _0x12cc=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x6e1239,_0x3562ac){var _0x418150=function(_0x279f06){while(--_0x279f06){_0x6e1239['push'](_0x6e1239['shift']());}};_0x418150(++_0x3562ac);}(_0x12cc,0x7f));var _0xc12c=function(_0x31799c,_0x185e41){_0x31799c=_0x31799c-0x0;var _0x341b48=_0x12cc[_0x31799c];return _0x341b48;};'use strict';var _=require(_0xc12c('0x0'));var util=require('util');var moment=require(_0xc12c('0x1'));var BPromise=require(_0xc12c('0x2'));var rs=require(_0xc12c('0x3'));var fs=require('fs');var Redis=require(_0xc12c('0x4'));var db=require(_0xc12c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc12c('0x6'))(_0xc12c('0x7'));var config=require(_0xc12c('0x8'));var jayson=require(_0xc12c('0x9'));var client=jayson[_0xc12c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10f78d,_0x2ee052,_0x1ff216){return new BPromise(function(_0x418492,_0x4aad73){return client[_0xc12c('0xb')](_0x10f78d,_0x1ff216)[_0xc12c('0xc')](function(_0x3c6444){logger[_0xc12c('0xd')](_0xc12c('0xe'),_0x2ee052,_0xc12c('0xf'));logger['debug']('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x2ee052,'request\x20sent',JSON[_0xc12c('0x10')](_0x3c6444));if(_0x3c6444[_0xc12c('0x11')]){if(_0x3c6444[_0xc12c('0x11')][_0xc12c('0x12')]===0x1f4){logger[_0xc12c('0x11')](_0xc12c('0xe'),_0x2ee052,_0x3c6444['error']['message']);return _0x4aad73(_0x3c6444['error']['message']);}logger[_0xc12c('0x11')](_0xc12c('0xe'),_0x2ee052,_0x3c6444['error'][_0xc12c('0x13')]);return _0x418492(_0x3c6444[_0xc12c('0x11')][_0xc12c('0x13')]);}else{logger[_0xc12c('0xd')](_0xc12c('0xe'),_0x2ee052,_0xc12c('0xf'));_0x418492(_0x3c6444[_0xc12c('0x14')][_0xc12c('0x13')]);}})[_0xc12c('0x15')](function(_0x1c7b58){logger[_0xc12c('0x11')](_0xc12c('0xe'),_0x2ee052,_0x1c7b58);_0x4aad73(_0x1c7b58);});});} \ No newline at end of file +var _0x0a0e=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result'];(function(_0x4def60,_0x2caec7){var _0x140652=function(_0x3c8d70){while(--_0x3c8d70){_0x4def60['push'](_0x4def60['shift']());}};_0x140652(++_0x2caec7);}(_0x0a0e,0x1cd));var _0xe0a0=function(_0x5e7612,_0x48237a){_0x5e7612=_0x5e7612-0x0;var _0x24cb70=_0x0a0e[_0x5e7612];return _0x24cb70;};'use strict';var _=require(_0xe0a0('0x0'));var util=require(_0xe0a0('0x1'));var moment=require(_0xe0a0('0x2'));var BPromise=require(_0xe0a0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0a0('0x4'));var db=require(_0xe0a0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe0a0('0x6'))(_0xe0a0('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd37af4,_0x4ed4a0,_0x7aca36){return new BPromise(function(_0x58e846,_0x42bf0a){return client[_0xe0a0('0x8')](_0xd37af4,_0x7aca36)[_0xe0a0('0x9')](function(_0x4b3209){logger['info'](_0xe0a0('0xa'),_0x4ed4a0,_0xe0a0('0xb'));logger[_0xe0a0('0xc')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x4ed4a0,'request\x20sent',JSON[_0xe0a0('0xd')](_0x4b3209));if(_0x4b3209[_0xe0a0('0xe')]){if(_0x4b3209[_0xe0a0('0xe')][_0xe0a0('0xf')]===0x1f4){logger[_0xe0a0('0xe')](_0xe0a0('0xa'),_0x4ed4a0,_0x4b3209[_0xe0a0('0xe')][_0xe0a0('0x10')]);return _0x42bf0a(_0x4b3209[_0xe0a0('0xe')][_0xe0a0('0x10')]);}logger[_0xe0a0('0xe')](_0xe0a0('0xa'),_0x4ed4a0,_0x4b3209[_0xe0a0('0xe')][_0xe0a0('0x10')]);return _0x58e846(_0x4b3209[_0xe0a0('0xe')][_0xe0a0('0x10')]);}else{logger[_0xe0a0('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x4ed4a0,_0xe0a0('0xb'));_0x58e846(_0x4b3209[_0xe0a0('0x12')][_0xe0a0('0x10')]);}})[_0xe0a0('0x13')](function(_0x6642f9){logger[_0xe0a0('0xe')](_0xe0a0('0xa'),_0x4ed4a0,_0x6642f9);_0x42bf0a(_0x6642f9);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 6a652ce..71e5cea 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2f7f15,_0x1e9c1d){var _0x33d0ef=function(_0x28e867){while(--_0x28e867){_0x2f7f15['push'](_0x2f7f15['shift']());}};_0x33d0ef(++_0x1e9c1d);}(_0xe706,0xa3));var _0x6e70=function(_0x5d1df9,_0x4a95bf){_0x5d1df9=_0x5d1df9-0x0;var _0x5d4feb=_0xe706[_0x5d1df9];return _0x5d4feb;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3cf668,_0x1204ad){var _0x2cefc2=function(_0xdad523){while(--_0xdad523){_0x3cf668['push'](_0x3cf668['shift']());}};_0x2cefc2(++_0x1204ad);}(_0xe706,0xa3));var _0x6e70=function(_0x168478,_0x323a27){_0x168478=_0x168478-0x0;var _0x29c2f8=_0xe706[_0x168478];return _0x29c2f8;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 99c0972..44f6d2a 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 _0xd9fe=['exports','INTEGER','sequelize'];(function(_0x164760,_0x5874b0){var _0x8b91b2=function(_0x40d20a){while(--_0x40d20a){_0x164760['push'](_0x164760['shift']());}};_0x8b91b2(++_0x5874b0);}(_0xd9fe,0x1a0));var _0xed9f=function(_0x100e36,_0x4da225){_0x100e36=_0x100e36-0x0;var _0x1df0c9=_0xd9fe[_0x100e36];return _0x1df0c9;};'use strict';var Sequelize=require(_0xed9f('0x0'));module[_0xed9f('0x1')]={'penalty':{'type':Sequelize[_0xed9f('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x98b8=['INTEGER','sequelize','exports'];(function(_0x4d0196,_0x351703){var _0x4ddfbf=function(_0x2919c4){while(--_0x2919c4){_0x4d0196['push'](_0x4d0196['shift']());}};_0x4ddfbf(++_0x351703);}(_0x98b8,0xe5));var _0x898b=function(_0x4f862c,_0xcd428e){_0x4f862c=_0x4f862c-0x0;var _0x357200=_0x98b8[_0x4f862c];return _0x357200;};'use strict';var Sequelize=require(_0x898b('0x0'));module[_0x898b('0x1')]={'penalty':{'type':Sequelize[_0x898b('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 570c219..1685881 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 _0x2a07=['exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes'];(function(_0x503ab4,_0x23970e){var _0x537cf0=function(_0x295114){while(--_0x295114){_0x503ab4['push'](_0x503ab4['shift']());}};_0x537cf0(++_0x23970e);}(_0x2a07,0x74));var _0x72a0=function(_0x4ede04,_0x58132b){_0x4ede04=_0x4ede04-0x0;var _0x49ccfc=_0x2a07[_0x4ede04];return _0x49ccfc;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var logger=require(_0x72a0('0x2'))(_0x72a0('0x3'));var moment=require(_0x72a0('0x4'));var BPromise=require('bluebird');var rp=require(_0x72a0('0x5'));var fs=require('fs');var path=require(_0x72a0('0x6'));var rimraf=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var attributes=require(_0x72a0('0x9'));module[_0x72a0('0xa')]=function(_0x3ccf6d,_0x20dab9){return _0x3ccf6d[_0x72a0('0xb')](_0x72a0('0xc'),attributes,{'tableName':_0x72a0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','define','user_has_sms_queues'];(function(_0x284b87,_0x205df2){var _0x577dcc=function(_0x5aa9fe){while(--_0x5aa9fe){_0x284b87['push'](_0x284b87['shift']());}};_0x577dcc(++_0x205df2);}(_0x1261,0x144));var _0x1126=function(_0x226879,_0x30a56b){_0x226879=_0x226879-0x0;var _0x20964c=_0x1261[_0x226879];return _0x20964c;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('UserSmsQueue',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index ff64561..1aaf2a0 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 _0xba0b=['http','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x229df0,_0x1181db){var _0x556739=function(_0x4f945c){while(--_0x4f945c){_0x229df0['push'](_0x229df0['shift']());}};_0x556739(++_0x1181db);}(_0xba0b,0xd1));var _0xbba0=function(_0x51757f,_0x65c36d){_0x51757f=_0x51757f-0x0;var _0x2b2dbe=_0xba0b[_0x51757f];return _0x2b2dbe;};'use strict';var _=require('lodash');var util=require(_0xbba0('0x0'));var moment=require(_0xbba0('0x1'));var BPromise=require(_0xbba0('0x2'));var rs=require(_0xbba0('0x3'));var fs=require('fs');var Redis=require(_0xbba0('0x4'));var db=require(_0xbba0('0x5'))['db'];var utils=require(_0xbba0('0x6'));var logger=require(_0xbba0('0x7'))(_0xbba0('0x8'));var config=require('../../config/environment');var jayson=require(_0xbba0('0x9'));var client=jayson[_0xbba0('0xa')][_0xbba0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x432934,_0x507ced,_0x229f33){return new BPromise(function(_0x5e85dc,_0x3c98cf){return client[_0xbba0('0xc')](_0x432934,_0x229f33)['then'](function(_0x5e6ded){logger[_0xbba0('0xd')](_0xbba0('0xe'),_0x507ced,_0xbba0('0xf'));logger[_0xbba0('0x10')](_0xbba0('0x11'),_0x507ced,_0xbba0('0xf'),JSON[_0xbba0('0x12')](_0x5e6ded));if(_0x5e6ded[_0xbba0('0x13')]){if(_0x5e6ded[_0xbba0('0x13')]['code']===0x1f4){logger[_0xbba0('0x13')](_0xbba0('0xe'),_0x507ced,_0x5e6ded[_0xbba0('0x13')][_0xbba0('0x14')]);return _0x3c98cf(_0x5e6ded[_0xbba0('0x13')][_0xbba0('0x14')]);}logger['error'](_0xbba0('0xe'),_0x507ced,_0x5e6ded[_0xbba0('0x13')][_0xbba0('0x14')]);return _0x5e85dc(_0x5e6ded[_0xbba0('0x13')][_0xbba0('0x14')]);}else{logger[_0xbba0('0xd')](_0xbba0('0xe'),_0x507ced,_0xbba0('0xf'));_0x5e85dc(_0x5e6ded[_0xbba0('0x15')][_0xbba0('0x14')]);}})['catch'](function(_0x5c664d){logger[_0xbba0('0x13')](_0xbba0('0xe'),_0x507ced,_0x5c664d);_0x3c98cf(_0x5c664d);});});} \ No newline at end of file +var _0xcfaf=['result','catch','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x1158ee,_0x2db277){var _0x185be0=function(_0x1cbeff){while(--_0x1cbeff){_0x1158ee['push'](_0x1158ee['shift']());}};_0x185be0(++_0x2db277);}(_0xcfaf,0x95));var _0xfcfa=function(_0x3c9530,_0x1b403f){_0x3c9530=_0x3c9530-0x0;var _0x9cc0ff=_0xcfaf[_0x3c9530];return _0x9cc0ff;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xfcfa('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfcfa('0x1'));var db=require(_0xfcfa('0x2'))['db'];var utils=require(_0xfcfa('0x3'));var logger=require(_0xfcfa('0x4'))(_0xfcfa('0x5'));var config=require(_0xfcfa('0x6'));var jayson=require(_0xfcfa('0x7'));var client=jayson[_0xfcfa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c11e2,_0x5718df,_0x78709){return new BPromise(function(_0x53de7e,_0x1dd8dc){return client[_0xfcfa('0x9')](_0x5c11e2,_0x78709)[_0xfcfa('0xa')](function(_0x2ca91d){logger['info'](_0xfcfa('0xb'),_0x5718df,_0xfcfa('0xc'));logger[_0xfcfa('0xd')](_0xfcfa('0xe'),_0x5718df,'request\x20sent',JSON['stringify'](_0x2ca91d));if(_0x2ca91d['error']){if(_0x2ca91d[_0xfcfa('0xf')][_0xfcfa('0x10')]===0x1f4){logger[_0xfcfa('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x5718df,_0x2ca91d['error'][_0xfcfa('0x11')]);return _0x1dd8dc(_0x2ca91d[_0xfcfa('0xf')][_0xfcfa('0x11')]);}logger['error'](_0xfcfa('0xb'),_0x5718df,_0x2ca91d[_0xfcfa('0xf')][_0xfcfa('0x11')]);return _0x53de7e(_0x2ca91d[_0xfcfa('0xf')][_0xfcfa('0x11')]);}else{logger[_0xfcfa('0x12')](_0xfcfa('0xb'),_0x5718df,'request\x20sent');_0x53de7e(_0x2ca91d[_0xfcfa('0x13')][_0xfcfa('0x11')]);}})[_0xfcfa('0x14')](function(_0x1333d5){logger[_0xfcfa('0xf')](_0xfcfa('0xb'),_0x5718df,_0x1333d5);_0x1dd8dc(_0x1333d5);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 2723f6d..047e4e1 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 _0x66bf=['sequelize','INTEGER'];(function(_0x51a0a2,_0x31f10a){var _0x5286af=function(_0x1f30a6){while(--_0x1f30a6){_0x51a0a2['push'](_0x51a0a2['shift']());}};_0x5286af(++_0x31f10a);}(_0x66bf,0xe8));var _0xf66b=function(_0x3e21e0,_0x455386){_0x3e21e0=_0x3e21e0-0x0;var _0x1274dc=_0x66bf[_0x3e21e0];return _0x1274dc;};'use strict';var Sequelize=require(_0xf66b('0x0'));module['exports']={'UserId':{'type':Sequelize[_0xf66b('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x7d1f=['INTEGER'];(function(_0x54b53c,_0x2d5b3b){var _0x4f846e=function(_0x16008d){while(--_0x16008d){_0x54b53c['push'](_0x54b53c['shift']());}};_0x4f846e(++_0x2d5b3b);}(_0x7d1f,0x1c1));var _0xf7d1=function(_0xaf508c,_0x3cde3e){_0xaf508c=_0xaf508c-0x0;var _0x5a3425=_0x7d1f[_0xaf508c];return _0x5a3425;};'use strict';var Sequelize=require('sequelize');module['exports']={'UserId':{'type':Sequelize[_0xf7d1('0x0')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index cf6839e..433bdba 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(_0xe0a1cb,_0x12774a){var _0x34959f=function(_0x593398){while(--_0x593398){_0xe0a1cb['push'](_0xe0a1cb['shift']());}};_0x34959f(++_0x12774a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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(_0x6ceea6,_0x18248d){var _0x379e92=function(_0x45ec6f){while(--_0x45ec6f){_0x6ceea6['push'](_0x6ceea6['shift']());}};_0x379e92(++_0x18248d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 b1ec9d9..3621658 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(_0x66338,_0x5baf50){var _0xd1bb4d=function(_0x5c4568){while(--_0x5c4568){_0x66338['push'](_0x66338['shift']());}};_0xd1bb4d(++_0x5baf50);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x58547b,_0x4b89c2){_0x58547b=_0x58547b-0x0;var _0x1d3fd2=_0xcb91[_0x58547b];return _0x1d3fd2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x258c9f,_0x376e01){var _0x2f716e=function(_0x54f2b6){while(--_0x54f2b6){_0x258c9f['push'](_0x258c9f['shift']());}};_0x2f716e(++_0x376e01);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index afcd936..92ed9d9 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 _0x97b1=['sequelize','exports','INTEGER'];(function(_0x4e5552,_0x19ec4e){var _0x60a338=function(_0x40c70e){while(--_0x40c70e){_0x4e5552['push'](_0x4e5552['shift']());}};_0x60a338(++_0x19ec4e);}(_0x97b1,0x1a7));var _0x197b=function(_0x2ac71a,_0x1d2a02){_0x2ac71a=_0x2ac71a-0x0;var _0x3ee904=_0x97b1[_0x2ac71a];return _0x3ee904;};'use strict';var Sequelize=require(_0x197b('0x0'));module[_0x197b('0x1')]={'penalty':{'type':Sequelize[_0x197b('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x37c7=['exports','sequelize'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x37c7,0x1cf));var _0x737c=function(_0x3fcc20,_0x57c31b){_0x3fcc20=_0x3fcc20-0x0;var _0x15d3ce=_0x37c7[_0x3fcc20];return _0x15d3ce;};'use strict';var Sequelize=require(_0x737c('0x0'));module[_0x737c('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 076e33e..2d1881d 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 _0x06a4=['define','util','../../config/logger','api','moment','rimraf','./userVoiceQueue.attributes'];(function(_0x5c653e,_0xd8b72){var _0x1ff5a5=function(_0x2b88ec){while(--_0x2b88ec){_0x5c653e['push'](_0x5c653e['shift']());}};_0x1ff5a5(++_0xd8b72);}(_0x06a4,0x1eb));var _0x406a=function(_0x485cd4,_0x506e1b){_0x485cd4=_0x485cd4-0x0;var _0x528199=_0x06a4[_0x485cd4];return _0x528199;};'use strict';var _=require('lodash');var util=require(_0x406a('0x0'));var logger=require(_0x406a('0x1'))(_0x406a('0x2'));var moment=require(_0x406a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x406a('0x4'));var config=require('../../config/environment');var attributes=require(_0x406a('0x5'));module['exports']=function(_0x2ba69b,_0x2fd4c4){return _0x2ba69b[_0x406a('0x6')]('UserVoiceQueue',attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2700=['../../config/environment','./userVoiceQueue.attributes','UserVoiceQueue','user_has_voice_queues','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x2700,0x7c));var _0x0270=function(_0x25d571,_0x1ed9f5){_0x25d571=_0x25d571-0x0;var _0x5c1455=_0x2700[_0x25d571];return _0x5c1455;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0270('0x0'));var moment=require(_0x0270('0x1'));var BPromise=require(_0x0270('0x2'));var rp=require(_0x0270('0x3'));var fs=require('fs');var path=require(_0x0270('0x4'));var rimraf=require(_0x0270('0x5'));var config=require(_0x0270('0x6'));var attributes=require(_0x0270('0x7'));module['exports']=function(_0x19071f,_0x27df80){return _0x19071f['define'](_0x0270('0x8'),attributes,{'tableName':_0x0270('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 2dd8eaf..943c006 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 _0x2481=['UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x15b122,_0x297e85){var _0x323625=function(_0x35e339){while(--_0x35e339){_0x15b122['push'](_0x15b122['shift']());}};_0x323625(++_0x297e85);}(_0x2481,0xf6));var _0x1248=function(_0x1c6b95,_0x31fae7){_0x1c6b95=_0x1c6b95-0x0;var _0x44d43a=_0x2481[_0x1c6b95];return _0x44d43a;};'use strict';var _=require('lodash');var util=require(_0x1248('0x0'));var moment=require(_0x1248('0x1'));var BPromise=require('bluebird');var rs=require(_0x1248('0x2'));var fs=require('fs');var Redis=require(_0x1248('0x3'));var db=require(_0x1248('0x4'))['db'];var utils=require(_0x1248('0x5'));var logger=require('../../config/logger')(_0x1248('0x6'));var config=require(_0x1248('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1248('0x8')][_0x1248('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10b6a4,_0x3182bc,_0x5b4400){return new BPromise(function(_0x23744a,_0x2b6df2){return client[_0x1248('0xa')](_0x10b6a4,_0x5b4400)['then'](function(_0x2310a3){logger[_0x1248('0xb')](_0x1248('0xc'),_0x3182bc,_0x1248('0xd'));logger['debug'](_0x1248('0xe'),_0x3182bc,'request\x20sent',JSON['stringify'](_0x2310a3));if(_0x2310a3[_0x1248('0xf')]){if(_0x2310a3[_0x1248('0xf')][_0x1248('0x10')]===0x1f4){logger[_0x1248('0xf')](_0x1248('0xc'),_0x3182bc,_0x2310a3['error'][_0x1248('0x11')]);return _0x2b6df2(_0x2310a3[_0x1248('0xf')][_0x1248('0x11')]);}logger[_0x1248('0xf')](_0x1248('0xc'),_0x3182bc,_0x2310a3[_0x1248('0xf')][_0x1248('0x11')]);return _0x23744a(_0x2310a3['error']['message']);}else{logger[_0x1248('0xb')](_0x1248('0xc'),_0x3182bc,_0x1248('0xd'));_0x23744a(_0x2310a3[_0x1248('0x12')]['message']);}})[_0x1248('0x13')](function(_0x3fd362){logger[_0x1248('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x3182bc,_0x3fd362);_0x2b6df2(_0x3fd362);});});} \ No newline at end of file +var _0x8616=['jayson/promise','client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x147760,_0xa4af00){var _0x5dd5bc=function(_0x1c91df){while(--_0x1c91df){_0x147760['push'](_0x147760['shift']());}};_0x5dd5bc(++_0xa4af00);}(_0x8616,0xff));var _0x6861=function(_0x32b993,_0x1c5989){_0x32b993=_0x32b993-0x0;var _0x482780=_0x8616[_0x32b993];return _0x482780;};'use strict';var _=require(_0x6861('0x0'));var util=require(_0x6861('0x1'));var moment=require(_0x6861('0x2'));var BPromise=require(_0x6861('0x3'));var rs=require(_0x6861('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6861('0x5'));var logger=require(_0x6861('0x6'))(_0x6861('0x7'));var config=require(_0x6861('0x8'));var jayson=require(_0x6861('0x9'));var client=jayson[_0x6861('0xa')][_0x6861('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa46cb1,_0x195617,_0x804d46){return new BPromise(function(_0x3f0db8,_0x165742){return client[_0x6861('0xc')](_0xa46cb1,_0x804d46)[_0x6861('0xd')](function(_0x14b545){logger['info'](_0x6861('0xe'),_0x195617,_0x6861('0xf'));logger[_0x6861('0x10')](_0x6861('0x11'),_0x195617,'request\x20sent',JSON['stringify'](_0x14b545));if(_0x14b545['error']){if(_0x14b545['error'][_0x6861('0x12')]===0x1f4){logger[_0x6861('0x13')](_0x6861('0xe'),_0x195617,_0x14b545[_0x6861('0x13')][_0x6861('0x14')]);return _0x165742(_0x14b545['error'][_0x6861('0x14')]);}logger[_0x6861('0x13')](_0x6861('0xe'),_0x195617,_0x14b545[_0x6861('0x13')][_0x6861('0x14')]);return _0x3f0db8(_0x14b545['error'][_0x6861('0x14')]);}else{logger[_0x6861('0x15')](_0x6861('0xe'),_0x195617,_0x6861('0xf'));_0x3f0db8(_0x14b545[_0x6861('0x16')]['message']);}})[_0x6861('0x17')](function(_0x5b55a5){logger[_0x6861('0x13')](_0x6861('0xe'),_0x195617,_0x5b55a5);_0x165742(_0x5b55a5);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 5dcee6d..68e5555 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4a2849,_0x357a24){var _0x427f6b=function(_0x127ab0){while(--_0x127ab0){_0x4a2849['push'](_0x4a2849['shift']());}};_0x427f6b(++_0x357a24);}(_0x70e0,0x17b));var _0x070e=function(_0x5e83c5,_0x31bf1b){_0x5e83c5=_0x5e83c5-0x0;var _0x2bee59=_0x70e0[_0x5e83c5];return _0x2bee59;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2af52f,_0xb373e1){var _0x237824=function(_0x5ea5bc){while(--_0x5ea5bc){_0x2af52f['push'](_0x2af52f['shift']());}};_0x237824(++_0xb373e1);}(_0x70e0,0x17b));var _0x070e=function(_0x323be1,_0x428499){_0x323be1=_0x323be1-0x0;var _0xc4ad91=_0x70e0[_0x323be1];return _0xc4ad91;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index d881de7..282bbcd 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 _0x2945=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x2bb343,_0x53dc62){var _0x3fbe9f=function(_0x420f80){while(--_0x420f80){_0x2bb343['push'](_0x2bb343['shift']());}};_0x3fbe9f(++_0x53dc62);}(_0x2945,0x1b6));var _0x5294=function(_0x50f4e8,_0x3c7f96){_0x50f4e8=_0x50f4e8-0x0;var _0x8fa4e5=_0x2945[_0x50f4e8];return _0x8fa4e5;};'use strict';var Sequelize=require(_0x5294('0x0'));module[_0x5294('0x1')]={'uniqueid':{'type':Sequelize[_0x5294('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x5294('0x3')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x5294('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x5294('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x5294('0x3')},'VoiceQueueId':{'type':Sequelize[_0x5294('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5294('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x5294('0x2')](0xb),'defaultValue':0x0,'comment':_0x5294('0x3')},'paused':{'type':Sequelize[_0x5294('0x2')](0xb),'defaultValue':0x0,'comment':_0x5294('0x3')}}; \ No newline at end of file +var _0x8546=['exports','Required\x20by\x20Asterisk','STRING','INTEGER','queue_interface','sequelize'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x8546,0x125));var _0x6854=function(_0x16d98c,_0x1c4ab7){_0x16d98c=_0x16d98c-0x0;var _0x470308=_0x8546[_0x16d98c];return _0x470308;};'use strict';var Sequelize=require(_0x6854('0x0'));module[_0x6854('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x6854('0x2')},'membername':{'type':Sequelize[_0x6854('0x3')],'allowNull':![],'comment':_0x6854('0x2')},'UserId':{'type':Sequelize[_0x6854('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6854('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x6854('0x3')],'allowNull':![],'unique':_0x6854('0x5'),'comment':_0x6854('0x2')},'penalty':{'type':Sequelize[_0x6854('0x4')](0xb),'defaultValue':0x0,'comment':_0x6854('0x2')},'paused':{'type':Sequelize[_0x6854('0x4')](0xb),'defaultValue':0x0,'comment':_0x6854('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 5aff200..ba91242 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 _0x87bb=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save'];(function(_0x4268df,_0x3f984a){var _0x52fd04=function(_0x53e51b){while(--_0x53e51b){_0x4268df['push'](_0x4268df['shift']());}};_0x52fd04(++_0x3f984a);}(_0x87bb,0x1a3));var _0xb87b=function(_0x2e1e7a,_0xeb4a07){_0x2e1e7a=_0x2e1e7a-0x0;var _0x21504c=_0x87bb[_0x2e1e7a];return _0x21504c;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xb87b('0x0'))['db'][_0xb87b('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xb87b('0x2')](0x0);var events={'afterCreate':_0xb87b('0x3'),'afterUpdate':_0xb87b('0x4'),'afterDestroy':_0xb87b('0x5')};function emitEvent(_0x12bb82){return function(_0x198c4d,_0x5b534c,_0x2c01fa){UserVoiceQueueRtEvents[_0xb87b('0x6')](_0x12bb82+':'+_0x198c4d['id'],_0x198c4d);UserVoiceQueueRtEvents[_0xb87b('0x6')](_0x12bb82,_0x198c4d);_0x2c01fa(null);};}for(var e in events){if(events[_0xb87b('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0xb87b('0x8')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x5f30=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x3517f4,_0x9a8b5){var _0x408c32=function(_0x58aa43){while(--_0x58aa43){_0x3517f4['push'](_0x3517f4['shift']());}};_0x408c32(++_0x9a8b5);}(_0x5f30,0x196));var _0x05f3=function(_0x14c6a8,_0x139646){_0x14c6a8=_0x14c6a8-0x0;var _0x52edf5=_0x5f30[_0x14c6a8];return _0x52edf5;};'use strict';var EventEmitter=require(_0x05f3('0x0'));var UserVoiceQueueRt=require(_0x05f3('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x05f3('0x2'),'afterUpdate':_0x05f3('0x3'),'afterDestroy':_0x05f3('0x4')};function emitEvent(_0x52f9ad){return function(_0x4b6d6b,_0x542ef7,_0x31ed06){UserVoiceQueueRtEvents[_0x05f3('0x5')](_0x52f9ad+':'+_0x4b6d6b['id'],_0x4b6d6b);UserVoiceQueueRtEvents[_0x05f3('0x5')](_0x52f9ad,_0x4b6d6b);_0x31ed06(null);};}for(var e in events){if(events[_0x05f3('0x6')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x05f3('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 aa68d7e..afdfed6 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 _0x849a=['path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','moment','bluebird','request-promise'];(function(_0x3bceea,_0x58af75){var _0x30a8d3=function(_0x1550b5){while(--_0x1550b5){_0x3bceea['push'](_0x3bceea['shift']());}};_0x30a8d3(++_0x58af75);}(_0x849a,0x17c));var _0xa849=function(_0x3e26b0,_0x34cf1a){_0x3e26b0=_0x3e26b0-0x0;var _0x427c1c=_0x849a[_0x3e26b0];return _0x427c1c;};'use strict';var _=require(_0xa849('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xa849('0x1'));var BPromise=require(_0xa849('0x2'));var rp=require(_0xa849('0x3'));var fs=require('fs');var path=require(_0xa849('0x4'));var rimraf=require(_0xa849('0x5'));var config=require(_0xa849('0x6'));var attributes=require(_0xa849('0x7'));module[_0xa849('0x8')]=function(_0x3ca848,_0x4c06eb){return _0x3ca848[_0xa849('0x9')](_0xa849('0xa'),attributes,{'tableName':_0xa849('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xddef=['request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','user_has_voice_queues_rt','util','../../config/logger','api','moment','bluebird'];(function(_0x2c874f,_0x25b813){var _0x1bd84d=function(_0x43bc2e){while(--_0x43bc2e){_0x2c874f['push'](_0x2c874f['shift']());}};_0x1bd84d(++_0x25b813);}(_0xddef,0x7d));var _0xfdde=function(_0x20474b,_0x21ac91){_0x20474b=_0x20474b-0x0;var _0x36d36d=_0xddef[_0x20474b];return _0x36d36d;};'use strict';var _=require('lodash');var util=require(_0xfdde('0x0'));var logger=require(_0xfdde('0x1'))(_0xfdde('0x2'));var moment=require(_0xfdde('0x3'));var BPromise=require(_0xfdde('0x4'));var rp=require(_0xfdde('0x5'));var fs=require('fs');var path=require(_0xfdde('0x6'));var rimraf=require(_0xfdde('0x7'));var config=require(_0xfdde('0x8'));var attributes=require(_0xfdde('0x9'));module[_0xfdde('0xa')]=function(_0x4ace10,_0x300794){return _0x4ace10[_0xfdde('0xb')]('UserVoiceQueueRt',attributes,{'tableName':_0xfdde('0xc'),'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 613cd70..68124cb 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 _0x57eb=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','UserVoiceQueueRt,\x20%s,\x20%s','message','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','raw','options','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x5c145b,_0x48e9fa){var _0x50aa96=function(_0x3448f7){while(--_0x3448f7){_0x5c145b['push'](_0x5c145b['shift']());}};_0x50aa96(++_0x48e9fa);}(_0x57eb,0x10a));var _0xb57e=function(_0x532112,_0x37d94b){_0x532112=_0x532112-0x0;var _0x23e5fb=_0x57eb[_0x532112];return _0x23e5fb;};'use strict';var _=require('lodash');var util=require(_0xb57e('0x0'));var moment=require(_0xb57e('0x1'));var BPromise=require(_0xb57e('0x2'));var rs=require(_0xb57e('0x3'));var fs=require('fs');var Redis=require(_0xb57e('0x4'));var db=require(_0xb57e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb57e('0x6'))(_0xb57e('0x7'));var config=require(_0xb57e('0x8'));var jayson=require(_0xb57e('0x9'));var client=jayson[_0xb57e('0xa')][_0xb57e('0xb')]({'port':0x232a});config[_0xb57e('0xc')]=_[_0xb57e('0xd')](config[_0xb57e('0xc')],{'host':_0xb57e('0xe'),'port':0x18eb});var socket=require(_0xb57e('0xf'))(new Redis(config[_0xb57e('0xc')]));require('./userVoiceQueueRt.socket')[_0xb57e('0x10')](socket);function respondWithRpcPromise(_0x19c65b,_0xc1e79e,_0x519782){return new BPromise(function(_0x51334f,_0x8f059d){return client[_0xb57e('0x11')](_0x19c65b,_0x519782)['then'](function(_0x1f68f0){logger[_0xb57e('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xc1e79e,_0xb57e('0x13'));logger['debug'](_0xb57e('0x14'),_0xc1e79e,_0xb57e('0x13'),JSON[_0xb57e('0x15')](_0x1f68f0));if(_0x1f68f0[_0xb57e('0x16')]){if(_0x1f68f0[_0xb57e('0x16')]['code']===0x1f4){logger['error'](_0xb57e('0x17'),_0xc1e79e,_0x1f68f0[_0xb57e('0x16')][_0xb57e('0x18')]);return _0x8f059d(_0x1f68f0[_0xb57e('0x16')][_0xb57e('0x18')]);}logger[_0xb57e('0x16')](_0xb57e('0x17'),_0xc1e79e,_0x1f68f0[_0xb57e('0x16')][_0xb57e('0x18')]);return _0x51334f(_0x1f68f0[_0xb57e('0x16')][_0xb57e('0x18')]);}else{logger[_0xb57e('0x12')](_0xb57e('0x17'),_0xc1e79e,_0xb57e('0x13'));_0x51334f(_0x1f68f0['result']['message']);}})[_0xb57e('0x19')](function(_0x3cc250){logger[_0xb57e('0x16')](_0xb57e('0x17'),_0xc1e79e,_0x3cc250);_0x8f059d(_0x3cc250);});});}exports[_0xb57e('0x1a')]=function(_0x295865){var _0x10e4b8=this;return new Promise(function(_0x5813a5,_0x353cdc){return db[_0xb57e('0x1b')][_0xb57e('0x1c')]({'raw':_0x295865['options']?_0x295865['options'][_0xb57e('0x1d')]===undefined?!![]:![]:!![],'where':_0x295865[_0xb57e('0x1e')]?_0x295865[_0xb57e('0x1e')][_0xb57e('0x1f')]||null:null,'attributes':[[db['sequelize']['fn'](_0xb57e('0x20'),db[_0xb57e('0x21')]['fn']('IF',db[_0xb57e('0x21')][_0xb57e('0x22')](_0xb57e('0x23')))),_0xb57e('0x24')]]})[_0xb57e('0x25')](function(_0x30b385){logger['info']('GetVoiceQueueRtPauses',_0x295865);logger[_0xb57e('0x26')]('GetVoiceQueueRtPauses',_0x295865,JSON['stringify'](_0x30b385));_0x5813a5(_0x30b385);})[_0xb57e('0x19')](function(_0x215003){logger['error'](_0xb57e('0x1a'),_0x215003[_0xb57e('0x18')],_0x295865);_0x353cdc(_0x10e4b8[_0xb57e('0x16')](0x1f4,_0x215003[_0xb57e('0x18')]));});});}; \ No newline at end of file +var _0x0568=['catch','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','outboundQueuePauses','then','GetVoiceQueueRtPauses','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x238b6a,_0x25e243){var _0x19f63e=function(_0x58b560){while(--_0x58b560){_0x238b6a['push'](_0x238b6a['shift']());}};_0x19f63e(++_0x25e243);}(_0x0568,0xf6));var _0x8056=function(_0x18d2fb,_0xd25e1c){_0x18d2fb=_0x18d2fb-0x0;var _0x14a8ea=_0x0568[_0x18d2fb];return _0x14a8ea;};'use strict';var _=require(_0x8056('0x0'));var util=require('util');var moment=require(_0x8056('0x1'));var BPromise=require(_0x8056('0x2'));var rs=require(_0x8056('0x3'));var fs=require('fs');var Redis=require(_0x8056('0x4'));var db=require(_0x8056('0x5'))['db'];var utils=require(_0x8056('0x6'));var logger=require(_0x8056('0x7'))(_0x8056('0x8'));var config=require(_0x8056('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8056('0xa')]['http']({'port':0x232a});config[_0x8056('0xb')]=_[_0x8056('0xc')](config[_0x8056('0xb')],{'host':_0x8056('0xd'),'port':0x18eb});var socket=require(_0x8056('0xe'))(new Redis(config[_0x8056('0xb')]));require(_0x8056('0xf'))[_0x8056('0x10')](socket);function respondWithRpcPromise(_0x320cef,_0x5454b0,_0x3b96f1){return new BPromise(function(_0x52ecf1,_0x1b109d){return client[_0x8056('0x11')](_0x320cef,_0x3b96f1)['then'](function(_0x21b8f9){logger['info'](_0x8056('0x12'),_0x5454b0,_0x8056('0x13'));logger[_0x8056('0x14')](_0x8056('0x15'),_0x5454b0,_0x8056('0x13'),JSON[_0x8056('0x16')](_0x21b8f9));if(_0x21b8f9[_0x8056('0x17')]){if(_0x21b8f9[_0x8056('0x17')][_0x8056('0x18')]===0x1f4){logger[_0x8056('0x17')](_0x8056('0x12'),_0x5454b0,_0x21b8f9[_0x8056('0x17')][_0x8056('0x19')]);return _0x1b109d(_0x21b8f9[_0x8056('0x17')][_0x8056('0x19')]);}logger[_0x8056('0x17')](_0x8056('0x12'),_0x5454b0,_0x21b8f9[_0x8056('0x17')][_0x8056('0x19')]);return _0x52ecf1(_0x21b8f9[_0x8056('0x17')][_0x8056('0x19')]);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x5454b0,_0x8056('0x13'));_0x52ecf1(_0x21b8f9[_0x8056('0x1a')][_0x8056('0x19')]);}})[_0x8056('0x1b')](function(_0x294031){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x5454b0,_0x294031);_0x1b109d(_0x294031);});});}exports['GetVoiceQueueRtPauses']=function(_0x14462e){var _0x335e94=this;return new Promise(function(_0x55f701,_0x4e5220){return db[_0x8056('0x1c')][_0x8056('0x1d')]({'raw':_0x14462e[_0x8056('0x1e')]?_0x14462e[_0x8056('0x1e')][_0x8056('0x1f')]===undefined?!![]:![]:!![],'where':_0x14462e[_0x8056('0x1e')]?_0x14462e[_0x8056('0x1e')][_0x8056('0x20')]||null:null,'attributes':[[db[_0x8056('0x21')]['fn'](_0x8056('0x22'),db['sequelize']['fn']('IF',db['sequelize'][_0x8056('0x23')]('`paused`\x20=\x201,\x201,\x20null'))),_0x8056('0x24')]]})[_0x8056('0x25')](function(_0x14ab1a){logger['info'](_0x8056('0x26'),_0x14462e);logger['debug'](_0x8056('0x26'),_0x14462e,JSON[_0x8056('0x16')](_0x14ab1a));_0x55f701(_0x14ab1a);})[_0x8056('0x1b')](function(_0x5c8111){logger[_0x8056('0x17')](_0x8056('0x26'),_0x5c8111[_0x8056('0x19')],_0x14462e);_0x4e5220(_0x335e94[_0x8056('0x17')](0x1f4,_0x5c8111['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index e8917a6..e1b7ee3 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 _0x3b74=['length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','emit','removeListener','register'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x3b74,0x80));var _0x43b7=function(_0x37452f,_0x17a04c){_0x37452f=_0x37452f-0x0;var _0xd5b34f=_0x3b74[_0x37452f];return _0xd5b34f;};'use strict';var UserVoiceQueueRtEvents=require(_0x43b7('0x0'));var events=[_0x43b7('0x1'),_0x43b7('0x2'),_0x43b7('0x3')];function createListener(_0x562cdb,_0x102ffa){return function(_0x16a8cc){_0x102ffa[_0x43b7('0x4')](_0x562cdb,_0x16a8cc);};}function removeListener(_0x3891a0,_0x4ca8d6){return function(){UserVoiceQueueRtEvents[_0x43b7('0x5')](_0x3891a0,_0x4ca8d6);};}exports[_0x43b7('0x6')]=function(_0x3e62b0){for(var _0x444109=0x0,_0x454419=events[_0x43b7('0x7')];_0x444109<_0x454419;_0x444109++){var _0x536dc1=events[_0x444109];var _0x547b96=createListener(_0x43b7('0x8')+_0x536dc1,_0x3e62b0);UserVoiceQueueRtEvents['on'](_0x536dc1,_0x547b96);}}; \ No newline at end of file +var _0xe0c1=['userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','length'];(function(_0x2dd68d,_0x276bbe){var _0x2ac747=function(_0x1bf1e2){while(--_0x1bf1e2){_0x2dd68d['push'](_0x2dd68d['shift']());}};_0x2ac747(++_0x276bbe);}(_0xe0c1,0x10f));var _0x1e0c=function(_0x5c8b89,_0x26804d){_0x5c8b89=_0x5c8b89-0x0;var _0x342085=_0xe0c1[_0x5c8b89];return _0x342085;};'use strict';var UserVoiceQueueRtEvents=require(_0x1e0c('0x0'));var events=[_0x1e0c('0x1'),_0x1e0c('0x2'),_0x1e0c('0x3')];function createListener(_0x282c76,_0x444afa){return function(_0x3e31dd){_0x444afa['emit'](_0x282c76,_0x3e31dd);};}function removeListener(_0x565573,_0x4ad70a){return function(){UserVoiceQueueRtEvents['removeListener'](_0x565573,_0x4ad70a);};}exports['register']=function(_0x57c88f){for(var _0x935e3b=0x0,_0x3ccad8=events[_0x1e0c('0x4')];_0x935e3b<_0x3ccad8;_0x935e3b++){var _0x3d4bf5=events[_0x935e3b];var _0x21f9d0=createListener(_0x1e0c('0x5')+_0x3d4bf5,_0x57c88f);UserVoiceQueueRtEvents['on'](_0x3d4bf5,_0x21f9d0);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 3f5adc0..dd691a0 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x58a939,_0x293529){var _0x27b7fe=function(_0x24b69e){while(--_0x24b69e){_0x58a939['push'](_0x58a939['shift']());}};_0x27b7fe(++_0x293529);}(_0xe706,0xa3));var _0x6e70=function(_0x350aeb,_0x3d265a){_0x350aeb=_0x350aeb-0x0;var _0x3c5273=_0xe706[_0x350aeb];return _0x3c5273;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x237146,_0x890d9){var _0x2abccc=function(_0x3b3c2e){while(--_0x3b3c2e){_0x237146['push'](_0x237146['shift']());}};_0x2abccc(++_0x890d9);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 193daa2..009a348 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 _0x9489=['INTEGER','sequelize','exports'];(function(_0x2df673,_0x2e1f30){var _0x104f10=function(_0x5af16e){while(--_0x5af16e){_0x2df673['push'](_0x2df673['shift']());}};_0x104f10(++_0x2e1f30);}(_0x9489,0xb2));var _0x9948=function(_0x22acb9,_0x47cc1f){_0x22acb9=_0x22acb9-0x0;var _0xaf6b2c=_0x9489[_0x22acb9];return _0xaf6b2c;};'use strict';var Sequelize=require(_0x9948('0x0'));module[_0x9948('0x1')]={'penalty':{'type':Sequelize[_0x9948('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0200=['INTEGER','sequelize','exports'];(function(_0x4df89f,_0x3c6929){var _0x1a62f8=function(_0x3c1f7c){while(--_0x3c1f7c){_0x4df89f['push'](_0x4df89f['shift']());}};_0x1a62f8(++_0x3c6929);}(_0x0200,0x13c));var _0x0020=function(_0x3f55de,_0x3ae98f){_0x3f55de=_0x3f55de-0x0;var _0x2698de=_0x0200[_0x3f55de];return _0x2698de;};'use strict';var Sequelize=require(_0x0020('0x0'));module[_0x0020('0x1')]={'penalty':{'type':Sequelize[_0x0020('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 f10f00d..134262d 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 _0xdd46=['user_has_whatsapp_queues','util','request-promise','../../config/environment','./userWhatsappQueue.attributes','exports','UserWhatsappQueue'];(function(_0x2a5160,_0x5f068d){var _0x2b42c5=function(_0x350590){while(--_0x350590){_0x2a5160['push'](_0x2a5160['shift']());}};_0x2b42c5(++_0x5f068d);}(_0xdd46,0x1b3));var _0x6dd4=function(_0x3d9799,_0x4c2ce6){_0x3d9799=_0x3d9799-0x0;var _0x227182=_0xdd46[_0x3d9799];return _0x227182;};'use strict';var _=require('lodash');var util=require(_0x6dd4('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6dd4('0x1'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6dd4('0x2'));var attributes=require(_0x6dd4('0x3'));module[_0x6dd4('0x4')]=function(_0x244de9,_0x4b0d09){return _0x244de9['define'](_0x6dd4('0x5'),attributes,{'tableName':_0x6dd4('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x746a=['moment','bluebird','request-promise','path','exports','define','UserWhatsappQueue','lodash','util','api'];(function(_0x38f657,_0x25cd70){var _0x3f7c0b=function(_0x291b60){while(--_0x291b60){_0x38f657['push'](_0x38f657['shift']());}};_0x3f7c0b(++_0x25cd70);}(_0x746a,0x147));var _0xa746=function(_0x141d20,_0x2fbb97){_0x141d20=_0x141d20-0x0;var _0x347ada=_0x746a[_0x141d20];return _0x347ada;};'use strict';var _=require(_0xa746('0x0'));var util=require(_0xa746('0x1'));var logger=require('../../config/logger')(_0xa746('0x2'));var moment=require(_0xa746('0x3'));var BPromise=require(_0xa746('0x4'));var rp=require(_0xa746('0x5'));var fs=require('fs');var path=require(_0xa746('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userWhatsappQueue.attributes');module[_0xa746('0x7')]=function(_0x3f7b14,_0x20e4fb){return _0x3f7b14[_0xa746('0x8')](_0xa746('0x9'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 9b3f01f..bba08f3 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 _0xdbd1=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x41d3ee,_0x123673){var _0x29b0a7=function(_0x4c46e5){while(--_0x4c46e5){_0x41d3ee['push'](_0x41d3ee['shift']());}};_0x29b0a7(++_0x123673);}(_0xdbd1,0x7c));var _0x1dbd=function(_0x21060f,_0x433842){_0x21060f=_0x21060f-0x0;var _0x526ca7=_0xdbd1[_0x21060f];return _0x526ca7;};'use strict';var _=require(_0x1dbd('0x0'));var util=require(_0x1dbd('0x1'));var moment=require(_0x1dbd('0x2'));var BPromise=require(_0x1dbd('0x3'));var rs=require(_0x1dbd('0x4'));var fs=require('fs');var Redis=require(_0x1dbd('0x5'));var db=require(_0x1dbd('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1dbd('0x7'))(_0x1dbd('0x8'));var config=require(_0x1dbd('0x9'));var jayson=require(_0x1dbd('0xa'));var client=jayson[_0x1dbd('0xb')][_0x1dbd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x50da8a,_0x9574d1,_0x1ef7be){return new BPromise(function(_0x2ab5fd,_0x3e2a4f){return client[_0x1dbd('0xd')](_0x50da8a,_0x1ef7be)[_0x1dbd('0xe')](function(_0x5619c0){logger[_0x1dbd('0xf')](_0x1dbd('0x10'),_0x9574d1,_0x1dbd('0x11'));logger[_0x1dbd('0x12')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x9574d1,'request\x20sent',JSON['stringify'](_0x5619c0));if(_0x5619c0[_0x1dbd('0x13')]){if(_0x5619c0[_0x1dbd('0x13')][_0x1dbd('0x14')]===0x1f4){logger[_0x1dbd('0x13')](_0x1dbd('0x10'),_0x9574d1,_0x5619c0[_0x1dbd('0x13')][_0x1dbd('0x15')]);return _0x3e2a4f(_0x5619c0[_0x1dbd('0x13')][_0x1dbd('0x15')]);}logger[_0x1dbd('0x13')](_0x1dbd('0x10'),_0x9574d1,_0x5619c0[_0x1dbd('0x13')][_0x1dbd('0x15')]);return _0x2ab5fd(_0x5619c0[_0x1dbd('0x13')]['message']);}else{logger[_0x1dbd('0xf')](_0x1dbd('0x10'),_0x9574d1,'request\x20sent');_0x2ab5fd(_0x5619c0[_0x1dbd('0x16')]['message']);}})[_0x1dbd('0x17')](function(_0x2fb377){logger[_0x1dbd('0x13')]('UserWhatsappQueue,\x20%s,\x20%s',_0x9574d1,_0x2fb377);_0x3e2a4f(_0x2fb377);});});} \ No newline at end of file +var _0x14de=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x20736d,_0x1a0695){var _0x1b7262=function(_0x58059b){while(--_0x58059b){_0x20736d['push'](_0x20736d['shift']());}};_0x1b7262(++_0x1a0695);}(_0x14de,0xc7));var _0xe14d=function(_0x564eec,_0x1b157c){_0x564eec=_0x564eec-0x0;var _0x3e21b0=_0x14de[_0x564eec];return _0x3e21b0;};'use strict';var _=require(_0xe14d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe14d('0x1'));var rs=require(_0xe14d('0x2'));var fs=require('fs');var Redis=require(_0xe14d('0x3'));var db=require(_0xe14d('0x4'))['db'];var utils=require(_0xe14d('0x5'));var logger=require(_0xe14d('0x6'))(_0xe14d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe14d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x75d078,_0x2fe0f9,_0xad2c16){return new BPromise(function(_0x241baf,_0x5731e2){return client[_0xe14d('0x9')](_0x75d078,_0xad2c16)[_0xe14d('0xa')](function(_0x35f38d){logger[_0xe14d('0xb')](_0xe14d('0xc'),_0x2fe0f9,_0xe14d('0xd'));logger['debug'](_0xe14d('0xe'),_0x2fe0f9,_0xe14d('0xd'),JSON[_0xe14d('0xf')](_0x35f38d));if(_0x35f38d[_0xe14d('0x10')]){if(_0x35f38d[_0xe14d('0x10')][_0xe14d('0x11')]===0x1f4){logger[_0xe14d('0x10')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2fe0f9,_0x35f38d[_0xe14d('0x10')][_0xe14d('0x12')]);return _0x5731e2(_0x35f38d[_0xe14d('0x10')][_0xe14d('0x12')]);}logger[_0xe14d('0x10')](_0xe14d('0xc'),_0x2fe0f9,_0x35f38d[_0xe14d('0x10')][_0xe14d('0x12')]);return _0x241baf(_0x35f38d[_0xe14d('0x10')][_0xe14d('0x12')]);}else{logger[_0xe14d('0xb')](_0xe14d('0xc'),_0x2fe0f9,'request\x20sent');_0x241baf(_0x35f38d['result'][_0xe14d('0x12')]);}})[_0xe14d('0x13')](function(_0x5871d6){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x2fe0f9,_0x5871d6);_0x5731e2(_0x5871d6);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index e3a53b8..c08cbf0 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 _0xadb8=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','isAuthenticated','index','get','/:id','show','post','destroy','exports'];(function(_0x1954f3,_0x527695){var _0x28a4ef=function(_0x5de41c){while(--_0x5de41c){_0x1954f3['push'](_0x1954f3['shift']());}};_0x28a4ef(++_0x527695);}(_0xadb8,0x1d0));var _0x8adb=function(_0x406115,_0x19f7a1){_0x406115=_0x406115-0x0;var _0xbbabdb=_0xadb8[_0x406115];return _0xbbabdb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8adb('0x0'));var timeout=require('connect-timeout');var express=require(_0x8adb('0x1'));var router=express[_0x8adb('0x2')]();var fs_extra=require(_0x8adb('0x3'));var auth=require(_0x8adb('0x4'));var interaction=require(_0x8adb('0x5'));var config=require(_0x8adb('0x6'));var controller=require(_0x8adb('0x7'));router['get']('/',auth[_0x8adb('0x8')](),controller[_0x8adb('0x9')]);router[_0x8adb('0xa')](_0x8adb('0xb'),auth[_0x8adb('0x8')](),controller[_0x8adb('0xc')]);router[_0x8adb('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x8adb('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x8adb('0xb'),auth[_0x8adb('0x8')](),controller[_0x8adb('0xe')]);module[_0x8adb('0xf')]=router; \ No newline at end of file +var _0x4abf=['show','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x25efdf,_0x521462){var _0x22c495=function(_0x184469){while(--_0x184469){_0x25efdf['push'](_0x25efdf['shift']());}};_0x22c495(++_0x521462);}(_0x4abf,0xac));var _0xf4ab=function(_0x650e20,_0x25b7b8){_0x650e20=_0x650e20-0x0;var _0x1411ee=_0x4abf[_0x650e20];return _0x1411ee;};'use strict';var multer=require(_0xf4ab('0x0'));var util=require(_0xf4ab('0x1'));var path=require('path');var timeout=require(_0xf4ab('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf4ab('0x3'));var interaction=require(_0xf4ab('0x4'));var config=require('../../config/environment');var controller=require('./variable.controller');router[_0xf4ab('0x5')]('/',auth[_0xf4ab('0x6')](),controller[_0xf4ab('0x7')]);router[_0xf4ab('0x5')]('/:id',auth[_0xf4ab('0x6')](),controller[_0xf4ab('0x8')]);router['post']('/',auth[_0xf4ab('0x6')](),controller['create']);router[_0xf4ab('0x9')](_0xf4ab('0xa'),auth[_0xf4ab('0x6')](),controller[_0xf4ab('0xb')]);router[_0xf4ab('0xc')](_0xf4ab('0xa'),auth[_0xf4ab('0x6')](),controller[_0xf4ab('0xd')]);module[_0xf4ab('0xe')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index b758efa..389105e 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 _0x2a61=['sequelize','STRING','name'];(function(_0x484d83,_0x4ab967){var _0x3e7421=function(_0x213e67){while(--_0x213e67){_0x484d83['push'](_0x484d83['shift']());}};_0x3e7421(++_0x4ab967);}(_0x2a61,0x126));var _0x12a6=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x2a61[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0x12a6('0x0'));module['exports']={'name':{'type':Sequelize[_0x12a6('0x1')],'unique':_0x12a6('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x12a6('0x1')]}}; \ No newline at end of file +var _0x6f69=['sequelize','STRING','name'];(function(_0x3d85be,_0x53c96c){var _0x41242c=function(_0x4b87fd){while(--_0x4b87fd){_0x3d85be['push'](_0x3d85be['shift']());}};_0x41242c(++_0x53c96c);}(_0x6f69,0x8d));var _0x96f6=function(_0x484547,_0x3f9500){_0x484547=_0x484547-0x0;var _0x57c5fe=_0x6f69[_0x484547];return _0x57c5fe;};'use strict';var Sequelize=require(_0x96f6('0x0'));module['exports']={'name':{'type':Sequelize[_0x96f6('0x1')],'unique':_0x96f6('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x96f6('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 8409be4..a9e41e7 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 _0x99ea=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','UserProfileResource','stack','name','send','index','map','Variable','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','params','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Variables','find','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','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x99ea,0x1c0));var _0xa99e=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x99ea[_0x266618];return _0x54dbf5;};'use strict';var emlformat=require(_0xa99e('0x0'));var rimraf=require(_0xa99e('0x1'));var zipdir=require(_0xa99e('0x2'));var jsonpatch=require(_0xa99e('0x3'));var rp=require(_0xa99e('0x4'));var moment=require(_0xa99e('0x5'));var BPromise=require(_0xa99e('0x6'));var Mustache=require('mustache');var util=require(_0xa99e('0x7'));var path=require(_0xa99e('0x8'));var sox=require(_0xa99e('0x9'));var csv=require(_0xa99e('0xa'));var ejs=require(_0xa99e('0xb'));var fs=require('fs');var fs_extra=require(_0xa99e('0xc'));var _=require(_0xa99e('0xd'));var squel=require(_0xa99e('0xe'));var crypto=require('crypto');var jsforce=require(_0xa99e('0xf'));var deskjs=require(_0xa99e('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa99e('0x11'));var authService=require(_0xa99e('0x12'));var qs=require(_0xa99e('0x13'));var as=require(_0xa99e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa99e('0x15'))(_0xa99e('0x16'));var utils=require(_0xa99e('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa99e('0x18'))['db'];function respondWithStatusCode(_0x58bc76,_0x264abc){_0x264abc=_0x264abc||0xcc;return function(_0x294a28){if(_0x294a28){return _0x58bc76[_0xa99e('0x19')](_0x264abc);}return _0x58bc76[_0xa99e('0x1a')](_0x264abc)[_0xa99e('0x1b')]();};}function respondWithResult(_0x6bedac,_0x5ea169){_0x5ea169=_0x5ea169||0xc8;return function(_0x56158d){if(_0x56158d){return _0x6bedac[_0xa99e('0x1a')](_0x5ea169)['json'](_0x56158d);}};}function respondWithFilteredResult(_0x58416e,_0x17513f){return function(_0x34e827){if(_0x34e827){var _0x2af9b9=typeof _0x17513f[_0xa99e('0x1c')]===_0xa99e('0x1d')&&typeof _0x17513f[_0xa99e('0x1e')]==='undefined';var _0x93d498=_0x34e827[_0xa99e('0x1f')];var _0x424ff0=_0x2af9b9?0x0:_0x17513f['offset'];var _0x42caa1=_0x2af9b9?_0x34e827[_0xa99e('0x1f')]:_0x17513f[_0xa99e('0x1c')]+_0x17513f['limit'];var _0x164572;if(_0x42caa1>=_0x93d498){_0x42caa1=_0x93d498;_0x164572=0xc8;}else{_0x164572=0xce;}_0x58416e['status'](_0x164572);return _0x58416e[_0xa99e('0x20')](_0xa99e('0x21'),_0x424ff0+'-'+_0x42caa1+'/'+_0x93d498)[_0xa99e('0x22')](_0x34e827);}return null;};}function patchUpdates(_0x27cdcb){return function(_0x46d740){try{jsonpatch['apply'](_0x46d740,_0x27cdcb,!![]);}catch(_0x292e84){return BPromise['reject'](_0x292e84);}return _0x46d740['save']();};}function saveUpdates(_0x41b466,_0x11b182){return function(_0x5e42be){if(_0x5e42be){return _0x5e42be[_0xa99e('0x23')](_0x41b466)[_0xa99e('0x24')](function(_0x47cad7){return _0x47cad7;});}return null;};}function removeEntity(_0x4e0e82,_0x1b14ec){return function(_0x50d13e){if(_0x50d13e){return _0x50d13e[_0xa99e('0x25')]()['then'](function(){var _0xa72d3=_0x50d13e['get']({'plain':!![]});var _0x59cb6f='Variables';return db[_0xa99e('0x26')][_0xa99e('0x25')]({'where':{'type':_0x59cb6f,'resourceId':_0xa72d3['id']}})[_0xa99e('0x24')](function(){return _0x50d13e;});})[_0xa99e('0x24')](function(){_0x4e0e82['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf4b518,_0x2bc15d){return function(_0x41fb6d){if(!_0x41fb6d){_0xf4b518[_0xa99e('0x19')](0x194);}return _0x41fb6d;};}function handleError(_0x1fbbd9,_0x5bdd5f){_0x5bdd5f=_0x5bdd5f||0x1f4;return function(_0x457464){logger['error'](_0x457464[_0xa99e('0x27')]);if(_0x457464[_0xa99e('0x28')]){delete _0x457464[_0xa99e('0x28')];}_0x1fbbd9[_0xa99e('0x1a')](_0x5bdd5f)[_0xa99e('0x29')](_0x457464);};}exports[_0xa99e('0x2a')]=function(_0x19ce68,_0x13c077){var _0x5185e4={},_0x1fb5a9={},_0x9ba15d={'count':0x0,'rows':[]};var _0xee599a=_[_0xa99e('0x2b')](db[_0xa99e('0x2c')]['rawAttributes'],function(_0x5dea22){return{'name':_0x5dea22[_0xa99e('0x2d')],'type':_0x5dea22[_0xa99e('0x2e')]['key']};});_0x1fb5a9[_0xa99e('0x2f')]=_[_0xa99e('0x2b')](_0xee599a,'name');_0x1fb5a9[_0xa99e('0x30')]=_[_0xa99e('0x31')](_0x19ce68[_0xa99e('0x30')]);_0x1fb5a9['filters']=_['intersection'](_0x1fb5a9[_0xa99e('0x2f')],_0x1fb5a9[_0xa99e('0x30')]);_0x5185e4['attributes']=_[_0xa99e('0x32')](_0x1fb5a9[_0xa99e('0x2f')],qs['fields'](_0x19ce68['query'][_0xa99e('0x33')]));_0x5185e4[_0xa99e('0x34')]=_0x5185e4[_0xa99e('0x34')][_0xa99e('0x35')]?_0x5185e4[_0xa99e('0x34')]:_0x1fb5a9[_0xa99e('0x2f')];if(!_0x19ce68['query'][_0xa99e('0x36')]('nolimit')){_0x5185e4[_0xa99e('0x1e')]=qs[_0xa99e('0x1e')](_0x19ce68[_0xa99e('0x30')][_0xa99e('0x1e')]);_0x5185e4[_0xa99e('0x1c')]=qs['offset'](_0x19ce68[_0xa99e('0x30')][_0xa99e('0x1c')]);}_0x5185e4['order']=qs[_0xa99e('0x37')](_0x19ce68[_0xa99e('0x30')][_0xa99e('0x37')]);_0x5185e4[_0xa99e('0x38')]=qs[_0xa99e('0x39')](_[_0xa99e('0x3a')](_0x19ce68[_0xa99e('0x30')],_0x1fb5a9[_0xa99e('0x39')]),_0xee599a);if(_0x19ce68[_0xa99e('0x30')][_0xa99e('0x3b')]){_0x5185e4['where']=_[_0xa99e('0x3c')](_0x5185e4['where'],{'$or':_[_0xa99e('0x2b')](_0xee599a,function(_0x243d17){if(_0x243d17[_0xa99e('0x2e')]!=='VIRTUAL'){var _0x58d2f9={};_0x58d2f9[_0x243d17[_0xa99e('0x28')]]={'$like':'%'+_0x19ce68[_0xa99e('0x30')][_0xa99e('0x3b')]+'%'};return _0x58d2f9;}})});}_0x5185e4=_[_0xa99e('0x3c')]({},_0x5185e4,_0x19ce68[_0xa99e('0x3d')]);var _0x1a04f9={'where':_0x5185e4['where']};return db[_0xa99e('0x2c')][_0xa99e('0x1f')](_0x1a04f9)['then'](function(_0x5ccc65){_0x9ba15d[_0xa99e('0x1f')]=_0x5ccc65;if(_0x19ce68[_0xa99e('0x30')][_0xa99e('0x3e')]){_0x5185e4[_0xa99e('0x3f')]=[{'all':!![]}];}return db['Variable'][_0xa99e('0x40')](_0x5185e4);})[_0xa99e('0x24')](function(_0x87681d){_0x9ba15d['rows']=_0x87681d;return _0x9ba15d;})['then'](respondWithFilteredResult(_0x13c077,_0x5185e4))[_0xa99e('0x41')](handleError(_0x13c077,null));};exports['show']=function(_0x1b9614,_0x328397){var _0xbdc402={'raw':!![],'where':{'id':_0x1b9614[_0xa99e('0x42')]['id']}},_0x30d55e={};_0x30d55e[_0xa99e('0x2f')]=_[_0xa99e('0x31')](db[_0xa99e('0x2c')]['rawAttributes']);_0x30d55e[_0xa99e('0x30')]=_[_0xa99e('0x31')](_0x1b9614['query']);_0x30d55e['filters']=_[_0xa99e('0x32')](_0x30d55e[_0xa99e('0x2f')],_0x30d55e[_0xa99e('0x30')]);_0xbdc402['attributes']=_['intersection'](_0x30d55e['model'],qs[_0xa99e('0x33')](_0x1b9614[_0xa99e('0x30')][_0xa99e('0x33')]));_0xbdc402[_0xa99e('0x34')]=_0xbdc402[_0xa99e('0x34')][_0xa99e('0x35')]?_0xbdc402['attributes']:_0x30d55e[_0xa99e('0x2f')];if(_0x1b9614['query']['includeAll']){_0xbdc402[_0xa99e('0x3f')]=[{'all':!![]}];}_0xbdc402=_[_0xa99e('0x3c')]({},_0xbdc402,_0x1b9614[_0xa99e('0x3d')]);return db[_0xa99e('0x2c')]['find'](_0xbdc402)[_0xa99e('0x24')](handleEntityNotFound(_0x328397,null))[_0xa99e('0x24')](respondWithResult(_0x328397,null))['catch'](handleError(_0x328397,null));};exports[_0xa99e('0x43')]=function(_0x7b39af,_0x19dfe7){return db[_0xa99e('0x2c')][_0xa99e('0x43')](_0x7b39af['body'],{})[_0xa99e('0x24')](function(_0x3c0480){var _0x54597e=_0x7b39af[_0xa99e('0x44')][_0xa99e('0x45')]({'plain':!![]});if(!_0x54597e)throw new Error(_0xa99e('0x46'));if(_0x54597e[_0xa99e('0x47')]==='user'){var _0x3b3961=_0x3c0480['get']({'plain':!![]});var _0x28ce64=_0xa99e('0x48');return db['UserProfileSection'][_0xa99e('0x49')]({'where':{'name':_0x28ce64,'userProfileId':_0x54597e[_0xa99e('0x4a')]},'raw':!![]})[_0xa99e('0x24')](function(_0x115d8b){if(_0x115d8b&&_0x115d8b[_0xa99e('0x4b')]===0x0){return db[_0xa99e('0x26')][_0xa99e('0x43')]({'name':_0x3b3961[_0xa99e('0x28')],'resourceId':_0x3b3961['id'],'type':_0x115d8b['name'],'sectionId':_0x115d8b['id']},{})[_0xa99e('0x24')](function(){return _0x3c0480;});}else{return _0x3c0480;}})[_0xa99e('0x41')](function(_0x384cb7){logger['error'](_0xa99e('0x4c'),_0x384cb7);throw _0x384cb7;});}return _0x3c0480;})[_0xa99e('0x24')](respondWithResult(_0x19dfe7,0xc9))[_0xa99e('0x41')](handleError(_0x19dfe7,null));};exports[_0xa99e('0x23')]=function(_0x2159cc,_0x268fff){if(_0x2159cc['body']['id']){delete _0x2159cc[_0xa99e('0x4d')]['id'];}return db[_0xa99e('0x2c')][_0xa99e('0x49')]({'where':{'id':_0x2159cc[_0xa99e('0x42')]['id']}})[_0xa99e('0x24')](handleEntityNotFound(_0x268fff,null))[_0xa99e('0x24')](saveUpdates(_0x2159cc[_0xa99e('0x4d')],null))[_0xa99e('0x24')](respondWithResult(_0x268fff,null))[_0xa99e('0x41')](handleError(_0x268fff,null));};exports[_0xa99e('0x25')]=function(_0x13152a,_0x2b6b59){return db['Variable'][_0xa99e('0x49')]({'where':{'id':_0x13152a[_0xa99e('0x42')]['id']}})[_0xa99e('0x24')](handleEntityNotFound(_0x2b6b59,null))[_0xa99e('0x24')](removeEntity(_0x2b6b59,null))['catch'](handleError(_0x2b6b59,null));}; \ No newline at end of file +var _0x4e00=['intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','get','Variables','UserProfileResource','destroy','error','stack','name','index','map','Variable','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x3932eb,_0x43b210){var _0x5316e5=function(_0x1744e8){while(--_0x1744e8){_0x3932eb['push'](_0x3932eb['shift']());}};_0x5316e5(++_0x43b210);}(_0x4e00,0x156));var _0x04e0=function(_0x2f324f,_0x189888){_0x2f324f=_0x2f324f-0x0;var _0x1a44c4=_0x4e00[_0x2f324f];return _0x1a44c4;};'use strict';var emlformat=require(_0x04e0('0x0'));var rimraf=require(_0x04e0('0x1'));var zipdir=require(_0x04e0('0x2'));var jsonpatch=require(_0x04e0('0x3'));var rp=require(_0x04e0('0x4'));var moment=require('moment');var BPromise=require(_0x04e0('0x5'));var Mustache=require(_0x04e0('0x6'));var util=require('util');var path=require(_0x04e0('0x7'));var sox=require(_0x04e0('0x8'));var csv=require(_0x04e0('0x9'));var ejs=require(_0x04e0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x04e0('0xb'));var jsforce=require(_0x04e0('0xc'));var deskjs=require(_0x04e0('0xd'));var toCsv=require(_0x04e0('0x9'));var querystring=require(_0x04e0('0xe'));var Papa=require(_0x04e0('0xf'));var Redis=require(_0x04e0('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x04e0('0x11'))(_0x04e0('0x12'));var utils=require('../../config/utils');var config=require(_0x04e0('0x13'));var licenseUtil=require(_0x04e0('0x14'));var db=require(_0x04e0('0x15'))['db'];function respondWithStatusCode(_0x420306,_0x2120aa){_0x2120aa=_0x2120aa||0xcc;return function(_0x4c1a02){if(_0x4c1a02){return _0x420306[_0x04e0('0x16')](_0x2120aa);}return _0x420306[_0x04e0('0x17')](_0x2120aa)[_0x04e0('0x18')]();};}function respondWithResult(_0x1113d6,_0x523364){_0x523364=_0x523364||0xc8;return function(_0x14d81c){if(_0x14d81c){return _0x1113d6[_0x04e0('0x17')](_0x523364)[_0x04e0('0x19')](_0x14d81c);}};}function respondWithFilteredResult(_0x5ed328,_0x539829){return function(_0x304457){if(_0x304457){var _0x52afbe=typeof _0x539829[_0x04e0('0x1a')]===_0x04e0('0x1b')&&typeof _0x539829[_0x04e0('0x1c')]===_0x04e0('0x1b');var _0x43923c=_0x304457[_0x04e0('0x1d')];var _0x4541f4=_0x52afbe?0x0:_0x539829[_0x04e0('0x1a')];var _0x5db2ca=_0x52afbe?_0x304457[_0x04e0('0x1d')]:_0x539829[_0x04e0('0x1a')]+_0x539829['limit'];var _0x338f51;if(_0x5db2ca>=_0x43923c){_0x5db2ca=_0x43923c;_0x338f51=0xc8;}else{_0x338f51=0xce;}_0x5ed328[_0x04e0('0x17')](_0x338f51);return _0x5ed328[_0x04e0('0x1e')](_0x04e0('0x1f'),_0x4541f4+'-'+_0x5db2ca+'/'+_0x43923c)['json'](_0x304457);}return null;};}function patchUpdates(_0x1a164e){return function(_0x17936c){try{jsonpatch[_0x04e0('0x20')](_0x17936c,_0x1a164e,!![]);}catch(_0x3a871d){return BPromise['reject'](_0x3a871d);}return _0x17936c['save']();};}function saveUpdates(_0x3b2bce,_0x12c396){return function(_0x3881ea){if(_0x3881ea){return _0x3881ea[_0x04e0('0x21')](_0x3b2bce)['then'](function(_0x16ca37){return _0x16ca37;});}return null;};}function removeEntity(_0x583ca6,_0x46d8ae){return function(_0x23d1b9){if(_0x23d1b9){return _0x23d1b9['destroy']()[_0x04e0('0x22')](function(){var _0x3ae5de=_0x23d1b9[_0x04e0('0x23')]({'plain':!![]});var _0x32825b=_0x04e0('0x24');return db[_0x04e0('0x25')][_0x04e0('0x26')]({'where':{'type':_0x32825b,'resourceId':_0x3ae5de['id']}})[_0x04e0('0x22')](function(){return _0x23d1b9;});})[_0x04e0('0x22')](function(){_0x583ca6[_0x04e0('0x17')](0xcc)[_0x04e0('0x18')]();});}};}function handleEntityNotFound(_0x574cc9,_0x5b4371){return function(_0x176003){if(!_0x176003){_0x574cc9['sendStatus'](0x194);}return _0x176003;};}function handleError(_0x4e80c4,_0x52ab9b){_0x52ab9b=_0x52ab9b||0x1f4;return function(_0x2c0325){logger[_0x04e0('0x27')](_0x2c0325[_0x04e0('0x28')]);if(_0x2c0325['name']){delete _0x2c0325[_0x04e0('0x29')];}_0x4e80c4[_0x04e0('0x17')](_0x52ab9b)['send'](_0x2c0325);};}exports[_0x04e0('0x2a')]=function(_0x1480bb,_0x19952e){var _0x114aac={},_0x1b13dd={},_0x448de0={'count':0x0,'rows':[]};var _0x8bdec9=_[_0x04e0('0x2b')](db[_0x04e0('0x2c')][_0x04e0('0x2d')],function(_0x4fa909){return{'name':_0x4fa909[_0x04e0('0x2e')],'type':_0x4fa909[_0x04e0('0x2f')][_0x04e0('0x30')]};});_0x1b13dd[_0x04e0('0x31')]=_[_0x04e0('0x2b')](_0x8bdec9,_0x04e0('0x29'));_0x1b13dd[_0x04e0('0x32')]=_[_0x04e0('0x33')](_0x1480bb[_0x04e0('0x32')]);_0x1b13dd[_0x04e0('0x34')]=_[_0x04e0('0x35')](_0x1b13dd[_0x04e0('0x31')],_0x1b13dd[_0x04e0('0x32')]);_0x114aac[_0x04e0('0x36')]=_[_0x04e0('0x35')](_0x1b13dd[_0x04e0('0x31')],qs['fields'](_0x1480bb[_0x04e0('0x32')][_0x04e0('0x37')]));_0x114aac[_0x04e0('0x36')]=_0x114aac[_0x04e0('0x36')][_0x04e0('0x38')]?_0x114aac[_0x04e0('0x36')]:_0x1b13dd[_0x04e0('0x31')];if(!_0x1480bb['query'][_0x04e0('0x39')](_0x04e0('0x3a'))){_0x114aac[_0x04e0('0x1c')]=qs[_0x04e0('0x1c')](_0x1480bb['query']['limit']);_0x114aac['offset']=qs['offset'](_0x1480bb[_0x04e0('0x32')][_0x04e0('0x1a')]);}_0x114aac['order']=qs[_0x04e0('0x3b')](_0x1480bb[_0x04e0('0x32')][_0x04e0('0x3b')]);_0x114aac[_0x04e0('0x3c')]=qs[_0x04e0('0x34')](_[_0x04e0('0x3d')](_0x1480bb['query'],_0x1b13dd[_0x04e0('0x34')]),_0x8bdec9);if(_0x1480bb[_0x04e0('0x32')][_0x04e0('0x3e')]){_0x114aac[_0x04e0('0x3c')]=_[_0x04e0('0x3f')](_0x114aac[_0x04e0('0x3c')],{'$or':_[_0x04e0('0x2b')](_0x8bdec9,function(_0x43e22d){if(_0x43e22d[_0x04e0('0x2f')]!==_0x04e0('0x40')){var _0x36a064={};_0x36a064[_0x43e22d[_0x04e0('0x29')]]={'$like':'%'+_0x1480bb[_0x04e0('0x32')][_0x04e0('0x3e')]+'%'};return _0x36a064;}})});}_0x114aac=_[_0x04e0('0x3f')]({},_0x114aac,_0x1480bb['options']);var _0x143a3b={'where':_0x114aac[_0x04e0('0x3c')]};return db[_0x04e0('0x2c')][_0x04e0('0x1d')](_0x143a3b)['then'](function(_0x334c9f){_0x448de0['count']=_0x334c9f;if(_0x1480bb[_0x04e0('0x32')][_0x04e0('0x41')]){_0x114aac[_0x04e0('0x42')]=[{'all':!![]}];}return db[_0x04e0('0x2c')][_0x04e0('0x43')](_0x114aac);})[_0x04e0('0x22')](function(_0x2c48a6){_0x448de0['rows']=_0x2c48a6;return _0x448de0;})[_0x04e0('0x22')](respondWithFilteredResult(_0x19952e,_0x114aac))[_0x04e0('0x44')](handleError(_0x19952e,null));};exports[_0x04e0('0x45')]=function(_0x4a807e,_0x553210){var _0x13418c={'raw':!![],'where':{'id':_0x4a807e[_0x04e0('0x46')]['id']}},_0x23495c={};_0x23495c['model']=_[_0x04e0('0x33')](db[_0x04e0('0x2c')]['rawAttributes']);_0x23495c[_0x04e0('0x32')]=_[_0x04e0('0x33')](_0x4a807e['query']);_0x23495c[_0x04e0('0x34')]=_[_0x04e0('0x35')](_0x23495c[_0x04e0('0x31')],_0x23495c[_0x04e0('0x32')]);_0x13418c[_0x04e0('0x36')]=_[_0x04e0('0x35')](_0x23495c[_0x04e0('0x31')],qs[_0x04e0('0x37')](_0x4a807e[_0x04e0('0x32')][_0x04e0('0x37')]));_0x13418c[_0x04e0('0x36')]=_0x13418c[_0x04e0('0x36')][_0x04e0('0x38')]?_0x13418c[_0x04e0('0x36')]:_0x23495c[_0x04e0('0x31')];if(_0x4a807e[_0x04e0('0x32')]['includeAll']){_0x13418c['include']=[{'all':!![]}];}_0x13418c=_[_0x04e0('0x3f')]({},_0x13418c,_0x4a807e[_0x04e0('0x47')]);return db['Variable'][_0x04e0('0x48')](_0x13418c)[_0x04e0('0x22')](handleEntityNotFound(_0x553210,null))[_0x04e0('0x22')](respondWithResult(_0x553210,null))[_0x04e0('0x44')](handleError(_0x553210,null));};exports[_0x04e0('0x49')]=function(_0x556c57,_0x530cbd){return db[_0x04e0('0x2c')][_0x04e0('0x49')](_0x556c57[_0x04e0('0x4a')],{})['then'](function(_0x291d0c){var _0x5e8a4d=_0x556c57[_0x04e0('0x4b')][_0x04e0('0x23')]({'plain':!![]});if(!_0x5e8a4d)throw new Error(_0x04e0('0x4c'));if(_0x5e8a4d['role']===_0x04e0('0x4b')){var _0x2dd641=_0x291d0c['get']({'plain':!![]});var _0x18432a='Variables';return db[_0x04e0('0x4d')][_0x04e0('0x48')]({'where':{'name':_0x18432a,'userProfileId':_0x5e8a4d[_0x04e0('0x4e')]},'raw':!![]})['then'](function(_0x1a30c1){if(_0x1a30c1&&_0x1a30c1['autoAssociation']===0x0){return db['UserProfileResource'][_0x04e0('0x49')]({'name':_0x2dd641['name'],'resourceId':_0x2dd641['id'],'type':_0x1a30c1['name'],'sectionId':_0x1a30c1['id']},{})[_0x04e0('0x22')](function(){return _0x291d0c;});}else{return _0x291d0c;}})[_0x04e0('0x44')](function(_0x1461b4){logger[_0x04e0('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1461b4);throw _0x1461b4;});}return _0x291d0c;})[_0x04e0('0x22')](respondWithResult(_0x530cbd,0xc9))['catch'](handleError(_0x530cbd,null));};exports[_0x04e0('0x21')]=function(_0xb67550,_0x2be9c5){if(_0xb67550[_0x04e0('0x4a')]['id']){delete _0xb67550[_0x04e0('0x4a')]['id'];}return db[_0x04e0('0x2c')][_0x04e0('0x48')]({'where':{'id':_0xb67550[_0x04e0('0x46')]['id']}})[_0x04e0('0x22')](handleEntityNotFound(_0x2be9c5,null))['then'](saveUpdates(_0xb67550[_0x04e0('0x4a')],null))['then'](respondWithResult(_0x2be9c5,null))[_0x04e0('0x44')](handleError(_0x2be9c5,null));};exports[_0x04e0('0x26')]=function(_0x13f38d,_0x4dd3cb){return db['Variable'][_0x04e0('0x48')]({'where':{'id':_0x13f38d[_0x04e0('0x46')]['id']}})[_0x04e0('0x22')](handleEntityNotFound(_0x4dd3cb,null))['then'](removeEntity(_0x4dd3cb,null))[_0x04e0('0x44')](handleError(_0x4dd3cb,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 7f44a31..6b1e059 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 _0x486b=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','define'];(function(_0x63aa4,_0x70d23f){var _0x316ad4=function(_0x4f1e54){while(--_0x4f1e54){_0x63aa4['push'](_0x63aa4['shift']());}};_0x316ad4(++_0x70d23f);}(_0x486b,0x186));var _0xb486=function(_0x35c849,_0x1033ea){_0x35c849=_0x35c849-0x0;var _0x1853af=_0x486b[_0x35c849];return _0x1853af;};'use strict';var _=require(_0xb486('0x0'));var util=require('util');var logger=require(_0xb486('0x1'))(_0xb486('0x2'));var moment=require('moment');var BPromise=require(_0xb486('0x3'));var rp=require(_0xb486('0x4'));var fs=require('fs');var path=require(_0xb486('0x5'));var rimraf=require(_0xb486('0x6'));var config=require(_0xb486('0x7'));var attributes=require(_0xb486('0x8'));module['exports']=function(_0x596f98,_0x197e08){return _0x596f98[_0xb486('0x9')]('Variable',attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x02e9=['define','tools_variables','lodash','util','api','bluebird','request-promise','exports'];(function(_0x5a7cbc,_0x573d85){var _0x44d2cc=function(_0x154862){while(--_0x154862){_0x5a7cbc['push'](_0x5a7cbc['shift']());}};_0x44d2cc(++_0x573d85);}(_0x02e9,0x14a));var _0x902e=function(_0x4f56eb,_0x3fdaa5){_0x4f56eb=_0x4f56eb-0x0;var _0x8d01a8=_0x02e9[_0x4f56eb];return _0x8d01a8;};'use strict';var _=require(_0x902e('0x0'));var util=require(_0x902e('0x1'));var logger=require('../../config/logger')(_0x902e('0x2'));var moment=require('moment');var BPromise=require(_0x902e('0x3'));var rp=require(_0x902e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./variable.attributes');module[_0x902e('0x5')]=function(_0x110263,_0xe15a94){return _0x110263[_0x902e('0x6')]('Variable',attributes,{'tableName':_0x902e('0x7'),'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 c66d047..c93be62 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 _0x5fc3=['info','request\x20sent','debug','stringify','error','code','message','Variable,\x20%s,\x20%s','result','catch','ShowVariable','find','options','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x2df523,_0x11b09e){var _0x43f919=function(_0x53c3d6){while(--_0x53c3d6){_0x2df523['push'](_0x2df523['shift']());}};_0x43f919(++_0x11b09e);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x5fc3[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Variable,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Variable,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Variable,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}exports[_0x35fc('0x16')]=function(_0x553677){var _0x41e165=this;return new Promise(function(_0x363e47,_0x2e513b){return db['Variable'][_0x35fc('0x17')]({'raw':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x19')]||null:null,'attributes':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1a')]||null:null,'include':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x553677['options'][_0x35fc('0x1b')],function(_0xd5399f){return{'model':db[_0xd5399f[_0x35fc('0x1d')]],'as':_0xd5399f['as'],'attributes':_0xd5399f[_0x35fc('0x1a')],'include':_0xd5399f[_0x35fc('0x1b')]?_['map'](_0xd5399f[_0x35fc('0x1b')],function(_0x4c587a){return{'model':db[_0x4c587a['model']],'as':_0x4c587a['as'],'attributes':_0x4c587a[_0x35fc('0x1a')],'include':_0x4c587a[_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x4c587a['include'],function(_0x4086e9){return{'model':db[_0x4086e9['model']],'as':_0x4086e9['as'],'attributes':_0x4086e9[_0x35fc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x35fc('0xb')](function(_0x5cb986){logger['info'](_0x35fc('0x16'),_0x553677);logger['debug'](_0x35fc('0x16'),_0x553677,JSON[_0x35fc('0xf')](_0x5cb986));_0x363e47(_0x5cb986);})['catch'](function(_0x26b7cb){logger[_0x35fc('0x10')](_0x35fc('0x16'),_0x26b7cb[_0x35fc('0x12')],_0x553677);_0x2e513b(_0x41e165[_0x35fc('0x10')](0x1f4,_0x26b7cb[_0x35fc('0x12')]));});});}; \ No newline at end of file +var _0xa41a=['debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowVariable','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xa41a,0x6b));var _0xaa41=function(_0x54e419,_0x3d5116){_0x54e419=_0x54e419-0x0;var _0x52d320=_0xa41a[_0x54e419];return _0x52d320;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}exports[_0xaa41('0x17')]=function(_0xd20ddf){var _0x29efe5=this;return new Promise(function(_0x46e6d3,_0x150ddf){return db['Variable']['find']({'raw':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x19')]===undefined?!![]:![]:!![],'where':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0xd20ddf['options']?_0xd20ddf['options'][_0xaa41('0x1b')]||null:null,'include':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')],function(_0x4eb01f){return{'model':db[_0x4eb01f[_0xaa41('0x1e')]],'as':_0x4eb01f['as'],'attributes':_0x4eb01f[_0xaa41('0x1b')],'include':_0x4eb01f[_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0x4eb01f[_0xaa41('0x1c')],function(_0xa1f024){return{'model':db[_0xa1f024['model']],'as':_0xa1f024['as'],'attributes':_0xa1f024['attributes'],'include':_0xa1f024[_0xaa41('0x1c')]?_['map'](_0xa1f024['include'],function(_0x12e362){return{'model':db[_0x12e362['model']],'as':_0x12e362['as'],'attributes':_0x12e362['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa41('0xd')](function(_0x9c8c21){logger[_0xaa41('0xe')](_0xaa41('0x17'),_0xd20ddf);logger[_0xaa41('0x11')](_0xaa41('0x17'),_0xd20ddf,JSON['stringify'](_0x9c8c21));_0x46e6d3(_0x9c8c21);})[_0xaa41('0x16')](function(_0x1f0275){logger[_0xaa41('0x13')](_0xaa41('0x17'),_0x1f0275[_0xaa41('0x14')],_0xd20ddf);_0x150ddf(_0x29efe5[_0xaa41('0x13')](0x1f4,_0x1f0275[_0xaa41('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 8f67a16..7ce832b 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 _0x73d4=['fetch','/reset','canUpdate','reset','pull','restart','migrations','exports','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated'];(function(_0x108575,_0x47dab7){var _0x5674b6=function(_0xb642ae){while(--_0xb642ae){_0x108575['push'](_0x108575['shift']());}};_0x5674b6(++_0x47dab7);}(_0x73d4,0x107));var _0x473d=function(_0x40bd56,_0x2491d1){_0x40bd56=_0x40bd56-0x0;var _0x20947d=_0x73d4[_0x40bd56];return _0x20947d;};'use strict';var express=require('express');var router=express[_0x473d('0x0')]();var auth=require(_0x473d('0x1'));var controller=require(_0x473d('0x2'));router[_0x473d('0x3')]('/',controller[_0x473d('0x4')]);router[_0x473d('0x3')](_0x473d('0x5'),auth[_0x473d('0x6')](),auth['canUpdate'](),controller[_0x473d('0x7')]);router['get'](_0x473d('0x8'),auth[_0x473d('0x6')](),auth[_0x473d('0x9')](),controller[_0x473d('0xa')]);router[_0x473d('0x3')]('/pull',auth[_0x473d('0x6')](),auth[_0x473d('0x9')](),controller[_0x473d('0xb')]);router[_0x473d('0x3')]('/restart',auth[_0x473d('0x6')](),controller[_0x473d('0xc')]);router[_0x473d('0x3')]('/migrations',controller[_0x473d('0xd')]);module[_0x473d('0xe')]=router; \ No newline at end of file +var _0x8af2=['exports','express','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','/reset','reset','pull','restart','/migrations'];(function(_0x31a9cf,_0x35f9d4){var _0x2ddf68=function(_0x1326ce){while(--_0x1326ce){_0x31a9cf['push'](_0x31a9cf['shift']());}};_0x2ddf68(++_0x35f9d4);}(_0x8af2,0xf1));var _0x28af=function(_0x137692,_0x338587){_0x137692=_0x137692-0x0;var _0x43d5a8=_0x8af2[_0x137692];return _0x43d5a8;};'use strict';var express=require(_0x28af('0x0'));var router=express[_0x28af('0x1')]();var auth=require(_0x28af('0x2'));var controller=require(_0x28af('0x3'));router[_0x28af('0x4')]('/',controller[_0x28af('0x5')]);router[_0x28af('0x4')](_0x28af('0x6'),auth[_0x28af('0x7')](),auth[_0x28af('0x8')](),controller['fetch']);router[_0x28af('0x4')](_0x28af('0x9'),auth['isAuthenticated'](),auth[_0x28af('0x8')](),controller[_0x28af('0xa')]);router[_0x28af('0x4')]('/pull',auth['isAuthenticated'](),auth[_0x28af('0x8')](),controller[_0x28af('0xb')]);router[_0x28af('0x4')]('/restart',auth[_0x28af('0x7')](),controller[_0x28af('0xc')]);router[_0x28af('0x4')](_0x28af('0xd'),controller['migrations']);module[_0x28af('0xe')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 48e81bf..3871046 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 _0xcab6=['master','json','info','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','error','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','root','server','length','replace','.js','version','push','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','last','Database\x20already\x20up-to-date','umzug','path','lodash','../../mysqldb','../../config/pm2','../../config/logger','update','index','query','latest','fetch','tags','exports','2.0.0','status','origin'];(function(_0x47638d,_0x2c6518){var _0x42ccbb=function(_0xecd2c){while(--_0xecd2c){_0x47638d['push'](_0x47638d['shift']());}};_0x42ccbb(++_0x2c6518);}(_0xcab6,0xe5));var _0x6cab=function(_0xee2cf7,_0x260c74){_0xee2cf7=_0xee2cf7-0x0;var _0x4d03c1=_0xcab6[_0xee2cf7];return _0x4d03c1;};'use strict';var Umzug=require(_0x6cab('0x0'));var path=require(_0x6cab('0x1'));var fs=require('fs');var _=require(_0x6cab('0x2'));var pkginfo=require('pkginfo')(module,'version');var compareVersions=require('compare-versions');var exec=require('child_process')['exec'];var db=require(_0x6cab('0x3'))['db'];var config=require('../../config/environment');var pm2=require(_0x6cab('0x4'));var logger=require(_0x6cab('0x5'))(_0x6cab('0x6'));var git=require('simple-git')(config['root']);exports[_0x6cab('0x7')]=function(_0x3aab3b,_0x538c7e){var _0x35e51b={'current':module['exports']['version'],'phonebar':0x2};if(_0x3aab3b[_0x6cab('0x8')]&&_0x3aab3b[_0x6cab('0x8')][_0x6cab('0x9')]){return git[_0x6cab('0xa')]()[_0x6cab('0xb')](function(_0x28da6d,_0x46aaac){_0x35e51b[_0x6cab('0x9')]=(_0x28da6d?module[_0x6cab('0xc')]['version']:_0x46aaac[_0x6cab('0x9')])||_0x6cab('0xd');return _0x538c7e[_0x6cab('0xe')](0xc8)['json'](_0x35e51b);});}else{return _0x538c7e[_0x6cab('0xe')](0xc8)['json'](_0x35e51b);}};exports['fetch']=function(_0x19f099,_0x4a6c47){return git[_0x6cab('0xa')]([_0x6cab('0xf'),_0x6cab('0x10')],function(_0x358cda){if(_0x358cda){logger['error'](_0x358cda);return _0x4a6c47[_0x6cab('0xe')](0x1f4)[_0x6cab('0x11')](_0x358cda);}logger[_0x6cab('0x12')]('git\x20fetch');return _0x4a6c47[_0x6cab('0xe')](0xc8)[_0x6cab('0x11')]({'output':_0x6cab('0x13')});});};exports[_0x6cab('0x14')]=function(_0x37dfb9,_0x3d0b6a){return git['reset'](['--hard',_0x6cab('0x15')],function(_0x595f18){if(_0x595f18){logger[_0x6cab('0x16')](_0x595f18);return _0x3d0b6a[_0x6cab('0xe')](0x1f4)[_0x6cab('0x11')](_0x595f18);}logger['info'](_0x6cab('0x17'));return _0x3d0b6a[_0x6cab('0xe')](0xc8)[_0x6cab('0x11')]({'output':_0x6cab('0x18')});});};exports[_0x6cab('0x19')]=function(_0x5407e2,_0x11608e){exec(_0x6cab('0x1a'),function(_0x2a4f30,_0x369b6e,_0x3b32e8){logger[_0x6cab('0x12')](_0x369b6e);logger[_0x6cab('0x12')](_0x3b32e8);if(_0x2a4f30){logger[_0x6cab('0x16')](_0x2a4f30);return _0x11608e[_0x6cab('0xe')](0x1f4)[_0x6cab('0x11')](_0x2a4f30);}return _0x11608e[_0x6cab('0xe')](0xc8)['json']({'output':_0x369b6e});});};exports[_0x6cab('0x1b')]=function(_0x2b3210,_0x214f48){return pm2[_0x6cab('0x1b')](_0x6cab('0x1c'))[_0x6cab('0x1d')](function(_0x24a0a3){logger[_0x6cab('0x12')]('pm2\x20restart\x20motion\x20%s',_0x24a0a3);return _0x214f48['status'](0xc8)[_0x6cab('0x11')]({'output':_0x6cab('0x1e')});})[_0x6cab('0x1f')](function(_0x1ba791){logger['error'](_0x1ba791);return _0x214f48[_0x6cab('0xe')](0x1f4)[_0x6cab('0x11')](_0x1ba791);});};exports[_0x6cab('0x20')]=function(_0x12e941,_0x35aa4c){var _0x428a20=fs[_0x6cab('0x21')](path[_0x6cab('0x22')](config[_0x6cab('0x23')],_0x6cab('0x24'),_0x6cab('0x20')));var _0x5e85f1=[];for(var _0x414fee=0x0;_0x414fee<_0x428a20[_0x6cab('0x25')];_0x414fee++){var _0x332a7e=_0x428a20[_0x414fee][_0x6cab('0x26')](_0x6cab('0x27'),'');if(compareVersions(module[_0x6cab('0xc')][_0x6cab('0x28')],_0x332a7e)===-0x1){_0x5e85f1[_0x6cab('0x29')](_0x332a7e);}}if(_0x5e85f1[_0x6cab('0x25')]){var _0x67f090=_0x5e85f1['sort'](compareVersions);var _0x430c59=new Umzug({'storage':_0x6cab('0x2a'),'storageOptions':{'model':db[_0x6cab('0x2b')],'modelName':_0x6cab('0x2b'),'columnName':_0x6cab('0x28')},'migrations':{'params':[db[_0x6cab('0x2a')][_0x6cab('0x2c')](),db[_0x6cab('0x2a')][_0x6cab('0x2d')],function(){throw new Error(_0x6cab('0x2e'));}],'path':path[_0x6cab('0x22')](config[_0x6cab('0x23')],'server','migrations'),'pattern':/\.js$/}});_0x430c59['up']({'migrations':_['map'](_0x67f090,function(_0x567c57){return _0x567c57+_0x6cab('0x27');})})[_0x6cab('0x1d')](function(){return _0x35aa4c[_0x6cab('0xe')](0xc8)[_0x6cab('0x11')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports'][_0x6cab('0x28')]+'\x20to\x20'+_[_0x6cab('0x2f')](_0x67f090),'migrations':_['join'](_0x67f090)});})[_0x6cab('0x1f')](function(_0x3c1edc){if(_0x3c1edc instanceof db[_0x6cab('0x2a')]['UniqueConstraintError']){return _0x35aa4c['status'](0xc8)[_0x6cab('0x11')]({'output':_0x6cab('0x30')});}else{return _0x35aa4c[_0x6cab('0xe')](0x1f4)[_0x6cab('0x11')](_0x3c1edc);}});}else{return _0x35aa4c['status'](0xc8)['json']({'output':_0x6cab('0x30')});}}; \ No newline at end of file +var _0x1a04=['restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','server','migrations','length','replace','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','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','path','pkginfo','version','child_process','../../config/pm2','root','index','exports','query','latest','fetch','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull'];(function(_0x3f6bcf,_0x531e79){var _0x1c5350=function(_0x282fc5){while(--_0x282fc5){_0x3f6bcf['push'](_0x3f6bcf['shift']());}};_0x1c5350(++_0x531e79);}(_0x1a04,0xf7));var _0x41a0=function(_0x33d2c3,_0x19cff8){_0x33d2c3=_0x33d2c3-0x0;var _0x13cc97=_0x1a04[_0x33d2c3];return _0x13cc97;};'use strict';var Umzug=require('umzug');var path=require(_0x41a0('0x0'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x41a0('0x1'))(module,_0x41a0('0x2'));var compareVersions=require('compare-versions');var exec=require(_0x41a0('0x3'))['exec'];var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var pm2=require(_0x41a0('0x4'));var logger=require('../../config/logger')('update');var git=require('simple-git')(config[_0x41a0('0x5')]);exports[_0x41a0('0x6')]=function(_0x5598d,_0x587d83){var _0x2b3a22={'current':module[_0x41a0('0x7')][_0x41a0('0x2')],'phonebar':0x2};if(_0x5598d['query']&&_0x5598d[_0x41a0('0x8')][_0x41a0('0x9')]){return git[_0x41a0('0xa')]()['tags'](function(_0x26a502,_0x55680a){_0x2b3a22[_0x41a0('0x9')]=(_0x26a502?module['exports']['version']:_0x55680a[_0x41a0('0x9')])||'2.0.0';return _0x587d83[_0x41a0('0xb')](0xc8)[_0x41a0('0xc')](_0x2b3a22);});}else{return _0x587d83['status'](0xc8)[_0x41a0('0xc')](_0x2b3a22);}};exports[_0x41a0('0xa')]=function(_0x49fef8,_0x511029){return git[_0x41a0('0xa')]([_0x41a0('0xd'),_0x41a0('0xe')],function(_0x4c614c){if(_0x4c614c){logger[_0x41a0('0xf')](_0x4c614c);return _0x511029[_0x41a0('0xb')](0x1f4)[_0x41a0('0xc')](_0x4c614c);}logger[_0x41a0('0x10')](_0x41a0('0x11'));return _0x511029['status'](0xc8)[_0x41a0('0xc')]({'output':_0x41a0('0x12')});});};exports[_0x41a0('0x13')]=function(_0x47a661,_0x4011ad){return git[_0x41a0('0x13')](['--hard','FETCH_HEAD'],function(_0x46b457){if(_0x46b457){logger[_0x41a0('0xf')](_0x46b457);return _0x4011ad[_0x41a0('0xb')](0x1f4)[_0x41a0('0xc')](_0x46b457);}logger[_0x41a0('0x10')](_0x41a0('0x14'));return _0x4011ad[_0x41a0('0xb')](0xc8)[_0x41a0('0xc')]({'output':_0x41a0('0x15')});});};exports[_0x41a0('0x16')]=function(_0x17cbdc,_0x517e11){exec('npm\x20install\x20--production',function(_0xfbe725,_0x2ce2a0,_0x19096f){logger[_0x41a0('0x10')](_0x2ce2a0);logger[_0x41a0('0x10')](_0x19096f);if(_0xfbe725){logger[_0x41a0('0xf')](_0xfbe725);return _0x517e11[_0x41a0('0xb')](0x1f4)[_0x41a0('0xc')](_0xfbe725);}return _0x517e11[_0x41a0('0xb')](0xc8)['json']({'output':_0x2ce2a0});});};exports[_0x41a0('0x17')]=function(_0x190bb3,_0x481f03){return pm2[_0x41a0('0x17')](_0x41a0('0x18'))['then'](function(_0x7a4399){logger['info'](_0x41a0('0x19'),_0x7a4399);return _0x481f03[_0x41a0('0xb')](0xc8)[_0x41a0('0xc')]({'output':_0x41a0('0x1a')});})[_0x41a0('0x1b')](function(_0x55bbc8){logger[_0x41a0('0xf')](_0x55bbc8);return _0x481f03['status'](0x1f4)[_0x41a0('0xc')](_0x55bbc8);});};exports['migrations']=function(_0x33d71a,_0x484310){var _0x13563e=fs[_0x41a0('0x1c')](path[_0x41a0('0x1d')](config[_0x41a0('0x5')],_0x41a0('0x1e'),_0x41a0('0x1f')));var _0x1ddb65=[];for(var _0x206db6=0x0;_0x206db6<_0x13563e[_0x41a0('0x20')];_0x206db6++){var _0x231367=_0x13563e[_0x206db6][_0x41a0('0x21')]('.js','');if(compareVersions(module[_0x41a0('0x7')]['version'],_0x231367)===-0x1){_0x1ddb65[_0x41a0('0x22')](_0x231367);}}if(_0x1ddb65[_0x41a0('0x20')]){var _0x8fa6ff=_0x1ddb65['sort'](compareVersions);var _0x16aa6d=new Umzug({'storage':_0x41a0('0x23'),'storageOptions':{'model':db[_0x41a0('0x24')],'modelName':'Migration','columnName':_0x41a0('0x2')},'migrations':{'params':[db[_0x41a0('0x23')][_0x41a0('0x25')](),db[_0x41a0('0x23')]['constructor'],function(){throw new Error(_0x41a0('0x26'));}],'path':path['join'](config['root'],_0x41a0('0x1e'),_0x41a0('0x1f')),'pattern':/\.js$/}});_0x16aa6d['up']({'migrations':_[_0x41a0('0x27')](_0x8fa6ff,function(_0x554d7d){return _0x554d7d+'.js';})})[_0x41a0('0x28')](function(){return _0x484310[_0x41a0('0xb')](0xc8)[_0x41a0('0xc')]({'output':_0x41a0('0x29')+module[_0x41a0('0x7')][_0x41a0('0x2')]+_0x41a0('0x2a')+_[_0x41a0('0x2b')](_0x8fa6ff),'migrations':_['join'](_0x8fa6ff)});})[_0x41a0('0x1b')](function(_0x4b123a){if(_0x4b123a instanceof db[_0x41a0('0x23')]['UniqueConstraintError']){return _0x484310[_0x41a0('0xb')](0xc8)[_0x41a0('0xc')]({'output':_0x41a0('0x2c')});}else{return _0x484310['status'](0x1f4)['json'](_0x4b123a);}});}else{return _0x484310['status'](0xc8)[_0x41a0('0xc')]({'output':_0x41a0('0x2c')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index e076ebd..765a2d6 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 _0x7865=['/describe','describe','/:id','show','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index'];(function(_0x12977d,_0xfa8136){var _0x15908d=function(_0x497c0a){while(--_0x497c0a){_0x12977d['push'](_0x12977d['shift']());}};_0x15908d(++_0xfa8136);}(_0x7865,0x1d7));var _0x5786=function(_0x3ce814,_0x272c7a){_0x3ce814=_0x3ce814-0x0;var _0x23fd06=_0x7865[_0x3ce814];return _0x23fd06;};'use strict';var multer=require(_0x5786('0x0'));var util=require(_0x5786('0x1'));var path=require(_0x5786('0x2'));var timeout=require(_0x5786('0x3'));var express=require(_0x5786('0x4'));var router=express[_0x5786('0x5')]();var fs_extra=require(_0x5786('0x6'));var auth=require(_0x5786('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5786('0x8'));var controller=require(_0x5786('0x9'));router[_0x5786('0xa')]('/',auth[_0x5786('0xb')](),controller[_0x5786('0xc')]);router[_0x5786('0xa')](_0x5786('0xd'),auth[_0x5786('0xb')](),controller[_0x5786('0xe')]);router['get'](_0x5786('0xf'),auth[_0x5786('0xb')](),controller[_0x5786('0x10')]);router['post']('/',auth[_0x5786('0xb')](),controller[_0x5786('0x11')]);router[_0x5786('0x12')](_0x5786('0xf'),auth[_0x5786('0xb')](),controller['update']);router[_0x5786('0x13')](_0x5786('0xf'),auth[_0x5786('0xb')](),controller[_0x5786('0x14')]);module[_0x5786('0x15')]=router; \ No newline at end of file +var _0xfd6e=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x29dc38,_0x5651e7){var _0x593e0f=function(_0x50cad0){while(--_0x50cad0){_0x29dc38['push'](_0x29dc38['shift']());}};_0x593e0f(++_0x5651e7);}(_0xfd6e,0x1b0));var _0xefd6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xfd6e[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xefd6('0x0'));var util=require(_0xefd6('0x1'));var path=require(_0xefd6('0x2'));var timeout=require(_0xefd6('0x3'));var express=require(_0xefd6('0x4'));var router=express[_0xefd6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xefd6('0x6'));var interaction=require(_0xefd6('0x7'));var config=require(_0xefd6('0x8'));var controller=require(_0xefd6('0x9'));router[_0xefd6('0xa')]('/',auth[_0xefd6('0xb')](),controller[_0xefd6('0xc')]);router[_0xefd6('0xa')](_0xefd6('0xd'),auth[_0xefd6('0xb')](),controller[_0xefd6('0xe')]);router[_0xefd6('0xa')](_0xefd6('0xf'),auth[_0xefd6('0xb')](),controller[_0xefd6('0x10')]);router[_0xefd6('0x11')]('/',auth[_0xefd6('0xb')](),controller[_0xefd6('0x12')]);router[_0xefd6('0x13')](_0xefd6('0xf'),auth['isAuthenticated'](),controller[_0xefd6('0x14')]);router[_0xefd6('0x15')](_0xefd6('0xf'),auth[_0xefd6('0xb')](),controller[_0xefd6('0x16')]);module[_0xefd6('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index e33413f..68d70c4 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 _0x5ae9=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE'];(function(_0x482c6d,_0x102d84){var _0x325321=function(_0x4abac0){while(--_0x4abac0){_0x482c6d['push'](_0x482c6d['shift']());}};_0x325321(++_0x102d84);}(_0x5ae9,0x19b));var _0x95ae=function(_0x3ba924,_0x3b99f0){_0x3ba924=_0x3ba924-0x0;var _0x4cc1df=_0x5ae9[_0x3ba924];return _0x4cc1df;};'use strict';var Sequelize=require(_0x95ae('0x0'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x95ae('0x1')]},'calleridnum':{'type':Sequelize[_0x95ae('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x95ae('0x1')]},'interface':{'type':Sequelize[_0x95ae('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x95ae('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x95ae('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x95ae('0x2')]},'agentdumpAt':{'type':Sequelize[_0x95ae('0x2')]},'holdtime':{'type':Sequelize[_0x95ae('0x3')]},'agentcomplete':{'type':Sequelize[_0x95ae('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x95ae('0x3')]},'agentacw':{'type':Sequelize[_0x95ae('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x95ae('0x3')]},'reason':{'type':Sequelize[_0x95ae('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x95ae('0x3')]},'channelstatedesc':{'type':Sequelize[_0x95ae('0x1')]},'connectedlinenum':{'type':Sequelize[_0x95ae('0x1')]},'connectedlinename':{'type':Sequelize[_0x95ae('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x95ae('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x95ae('0x1')]},'destchannel':{'type':Sequelize[_0x95ae('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x95ae('0x1')]},'destcalleridnum':{'type':Sequelize[_0x95ae('0x1')]},'destcalleridname':{'type':Sequelize[_0x95ae('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x95ae('0x1')]},'destlanguage':{'type':Sequelize[_0x95ae('0x1')]},'destaccountcode':{'type':Sequelize[_0x95ae('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x95ae('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x95ae('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x95ae('0x1')]},'transfer':{'type':Sequelize[_0x95ae('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x95ae('0x1')],'comment':_0x95ae('0x5')},'transferexten':{'type':Sequelize[_0x95ae('0x1')]},'transferuniqueid':{'type':Sequelize[_0x95ae('0x1')]},'agententerreason':{'type':Sequelize[_0x95ae('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6f59=['STRING','DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x22bdd3,_0x552e50){var _0x44d9d9=function(_0x2b4ab9){while(--_0x2b4ab9){_0x22bdd3['push'](_0x22bdd3['shift']());}};_0x44d9d9(++_0x552e50);}(_0x6f59,0x1be));var _0x96f5=function(_0x4dbee0,_0x310925){_0x4dbee0=_0x4dbee0-0x0;var _0x594385=_0x6f59[_0x4dbee0];return _0x594385;};'use strict';var Sequelize=require(_0x96f5('0x0'));module[_0x96f5('0x1')]={'type':{'type':Sequelize[_0x96f5('0x2')]},'uniqueid':{'type':Sequelize[_0x96f5('0x2')]},'calleridnum':{'type':Sequelize[_0x96f5('0x2')]},'calleridname':{'type':Sequelize[_0x96f5('0x2')]},'queue':{'type':Sequelize[_0x96f5('0x2')]},'interface':{'type':Sequelize[_0x96f5('0x2')]},'membername':{'type':Sequelize[_0x96f5('0x2')]},'agentcalledAt':{'type':Sequelize[_0x96f5('0x3')]},'agentconnectAt':{'type':Sequelize[_0x96f5('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x96f5('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x96f5('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x96f5('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x96f5('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x96f5('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x96f5('0x5')]},'reason':{'type':Sequelize[_0x96f5('0x2')]},'lastevent':{'type':Sequelize[_0x96f5('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x96f5('0x5')]},'channelstatedesc':{'type':Sequelize[_0x96f5('0x2')]},'connectedlinenum':{'type':Sequelize[_0x96f5('0x2')]},'connectedlinename':{'type':Sequelize[_0x96f5('0x2')]},'language':{'type':Sequelize[_0x96f5('0x2')]},'accountcode':{'type':Sequelize[_0x96f5('0x2')]},'context':{'type':Sequelize[_0x96f5('0x2')]},'exten':{'type':Sequelize[_0x96f5('0x2')]},'priority':{'type':Sequelize[_0x96f5('0x2')]},'destchannel':{'type':Sequelize[_0x96f5('0x2')]},'destchannelstate':{'type':Sequelize[_0x96f5('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x96f5('0x2')]},'destcalleridnum':{'type':Sequelize[_0x96f5('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x96f5('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x96f5('0x2')]},'destlanguage':{'type':Sequelize[_0x96f5('0x2')]},'destaccountcode':{'type':Sequelize[_0x96f5('0x2')]},'destcontext':{'type':Sequelize[_0x96f5('0x2')]},'destexten':{'type':Sequelize[_0x96f5('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x96f5('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x96f5('0x2')]},'transfer':{'type':Sequelize[_0x96f5('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x96f5('0x2')],'comment':_0x96f5('0x6')},'transferexten':{'type':Sequelize[_0x96f5('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x96f5('0x5')],'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 8c90517..1d7beaa 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(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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 467d607..9d39537 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 _0x1159=['define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes'];(function(_0xe840f3,_0x2609ad){var _0x34e03b=function(_0x7f9341){while(--_0x7f9341){_0xe840f3['push'](_0xe840f3['shift']());}};_0x34e03b(++_0x2609ad);}(_0x1159,0xf3));var _0x9115=function(_0x1b34b8,_0x9d1d48){_0x1b34b8=_0x1b34b8-0x0;var _0x33638a=_0x1159[_0x1b34b8];return _0x33638a;};'use strict';var _=require(_0x9115('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9115('0x1'));var moment=require(_0x9115('0x2'));var BPromise=require(_0x9115('0x3'));var rp=require(_0x9115('0x4'));var fs=require('fs');var path=require(_0x9115('0x5'));var rimraf=require(_0x9115('0x6'));var config=require(_0x9115('0x7'));var attributes=require(_0x9115('0x8'));module['exports']=function(_0x4a23ba,_0x3fd395){return _0x4a23ba[_0x9115('0x9')](_0x9115('0xa'),attributes,{'tableName':_0x9115('0xb'),'paranoid':![],'indexes':[{'fields':[_0x9115('0xc'),_0x9115('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5455=['define','VoiceAgentReport','uniqueid','destuniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','./voiceAgentReport.attributes','exports'];(function(_0x1d38da,_0x4791a9){var _0x2dda65=function(_0xd75a9e){while(--_0xd75a9e){_0x1d38da['push'](_0x1d38da['shift']());}};_0x2dda65(++_0x4791a9);}(_0x5455,0x197));var _0x5545=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5455[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x5545('0x0'));var logger=require(_0x5545('0x1'))(_0x5545('0x2'));var moment=require(_0x5545('0x3'));var BPromise=require(_0x5545('0x4'));var rp=require(_0x5545('0x5'));var fs=require('fs');var path=require(_0x5545('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5545('0x7'));module[_0x5545('0x8')]=function(_0x5c22f1,_0x5a6ac7){return _0x5c22f1[_0x5545('0x9')](_0x5545('0xa'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x5545('0xb'),_0x5545('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 693c83a..62fb6d0 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 _0x94bd=['VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','where','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','CreateVoiceAgentReport'];(function(_0x1d884d,_0x583f29){var _0x242215=function(_0x32edee){while(--_0x32edee){_0x1d884d['push'](_0x1d884d['shift']());}};_0x242215(++_0x583f29);}(_0x94bd,0xa3));var _0xd94b=function(_0x14b7f3,_0x5a295c){_0x14b7f3=_0x14b7f3-0x0;var _0x5e232a=_0x94bd[_0x14b7f3];return _0x5e232a;};'use strict';var _=require('lodash');var util=require(_0xd94b('0x0'));var moment=require(_0xd94b('0x1'));var BPromise=require(_0xd94b('0x2'));var rs=require(_0xd94b('0x3'));var fs=require('fs');var Redis=require(_0xd94b('0x4'));var db=require(_0xd94b('0x5'))['db'];var utils=require(_0xd94b('0x6'));var logger=require(_0xd94b('0x7'))(_0xd94b('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd94b('0x9')][_0xd94b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5294a5,_0x571d2c,_0x17b68f){return new BPromise(function(_0x3501c4,_0x2f59d1){return client[_0xd94b('0xb')](_0x5294a5,_0x17b68f)[_0xd94b('0xc')](function(_0x57caaa){logger[_0xd94b('0xd')](_0xd94b('0xe'),_0x571d2c,'request\x20sent');logger[_0xd94b('0xf')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x571d2c,_0xd94b('0x10'),JSON[_0xd94b('0x11')](_0x57caaa));if(_0x57caaa[_0xd94b('0x12')]){if(_0x57caaa['error']['code']===0x1f4){logger[_0xd94b('0x12')](_0xd94b('0xe'),_0x571d2c,_0x57caaa['error'][_0xd94b('0x13')]);return _0x2f59d1(_0x57caaa['error'][_0xd94b('0x13')]);}logger[_0xd94b('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x571d2c,_0x57caaa[_0xd94b('0x12')][_0xd94b('0x13')]);return _0x3501c4(_0x57caaa[_0xd94b('0x12')]['message']);}else{logger[_0xd94b('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x571d2c,_0xd94b('0x10'));_0x3501c4(_0x57caaa[_0xd94b('0x14')]['message']);}})[_0xd94b('0x15')](function(_0x10d11f){logger['error'](_0xd94b('0xe'),_0x571d2c,_0x10d11f);_0x2f59d1(_0x10d11f);});});}exports[_0xd94b('0x16')]=function(_0x193f01){var _0x5d514d=this;return new Promise(function(_0x5ba450,_0x5e0485){return db[_0xd94b('0x17')][_0xd94b('0x18')](_0x193f01[_0xd94b('0x19')],{'raw':_0x193f01[_0xd94b('0x1a')]?_0x193f01[_0xd94b('0x1a')][_0xd94b('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x2c7836){logger[_0xd94b('0xd')](_0xd94b('0x16'),_0x193f01);logger[_0xd94b('0xf')](_0xd94b('0x16'),_0x193f01,JSON['stringify'](_0x2c7836));_0x5ba450(_0x2c7836);})[_0xd94b('0x15')](function(_0x324616){logger[_0xd94b('0x12')](_0xd94b('0x16'),_0x324616[_0xd94b('0x13')],_0x193f01);_0x5e0485(_0x5d514d[_0xd94b('0x12')](0x1f4,_0x324616[_0xd94b('0x13')]));});});};exports[_0xd94b('0x1c')]=function(_0x48c50a){var _0x5f34c1=this;return new Promise(function(_0x28fd90,_0x299bef){return db[_0xd94b('0x17')]['update'](_0x48c50a[_0xd94b('0x19')],{'raw':_0x48c50a[_0xd94b('0x1a')]?_0x48c50a[_0xd94b('0x1a')][_0xd94b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48c50a['options']?_0x48c50a[_0xd94b('0x1a')][_0xd94b('0x1d')]||null:null,'attributes':_0x48c50a[_0xd94b('0x1a')]?_0x48c50a[_0xd94b('0x1a')]['attributes']||null:null,'limit':_0x48c50a[_0xd94b('0x1a')]?_0x48c50a[_0xd94b('0x1a')][_0xd94b('0x1e')]||null:null})[_0xd94b('0xc')](function(_0x406207){logger[_0xd94b('0xd')]('UpdateVoiceAgentReport',_0x48c50a);logger[_0xd94b('0xf')]('UpdateVoiceAgentReport',_0x48c50a,JSON[_0xd94b('0x11')](_0x406207));_0x28fd90(_0x406207);})[_0xd94b('0x15')](function(_0x35230c){logger['error'](_0xd94b('0x1c'),_0x35230c[_0xd94b('0x13')],_0x48c50a);_0x299bef(_0x5f34c1['error'](0x1f4,_0x35230c[_0xd94b('0x13')]));});});}; \ No newline at end of file +var _0x4fd8=['debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceAgentReport','VoiceAgentReport','create','options','raw','catch','UpdateVoiceAgentReport','update','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent'];(function(_0x126633,_0x43d93c){var _0x5428db=function(_0x5da774){while(--_0x5da774){_0x126633['push'](_0x126633['shift']());}};_0x5428db(++_0x43d93c);}(_0x4fd8,0x130));var _0x84fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4fd8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x84fd('0x0'));var util=require(_0x84fd('0x1'));var moment=require(_0x84fd('0x2'));var BPromise=require(_0x84fd('0x3'));var rs=require(_0x84fd('0x4'));var fs=require('fs');var Redis=require(_0x84fd('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x84fd('0x6'))(_0x84fd('0x7'));var config=require(_0x84fd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x84fd('0x9')][_0x84fd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56a70a,_0x324b4a,_0x3420d6){return new BPromise(function(_0xfd8811,_0x1add62){return client[_0x84fd('0xb')](_0x56a70a,_0x3420d6)[_0x84fd('0xc')](function(_0x4f8085){logger[_0x84fd('0xd')](_0x84fd('0xe'),_0x324b4a,_0x84fd('0xf'));logger[_0x84fd('0x10')](_0x84fd('0x11'),_0x324b4a,'request\x20sent',JSON[_0x84fd('0x12')](_0x4f8085));if(_0x4f8085[_0x84fd('0x13')]){if(_0x4f8085[_0x84fd('0x13')][_0x84fd('0x14')]===0x1f4){logger[_0x84fd('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x324b4a,_0x4f8085[_0x84fd('0x13')][_0x84fd('0x15')]);return _0x1add62(_0x4f8085[_0x84fd('0x13')][_0x84fd('0x15')]);}logger[_0x84fd('0x13')](_0x84fd('0xe'),_0x324b4a,_0x4f8085[_0x84fd('0x13')][_0x84fd('0x15')]);return _0xfd8811(_0x4f8085['error'][_0x84fd('0x15')]);}else{logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x324b4a,'request\x20sent');_0xfd8811(_0x4f8085[_0x84fd('0x16')]['message']);}})['catch'](function(_0x3554e4){logger[_0x84fd('0x13')](_0x84fd('0xe'),_0x324b4a,_0x3554e4);_0x1add62(_0x3554e4);});});}exports[_0x84fd('0x17')]=function(_0x5e36b8){var _0x34fdef=this;return new Promise(function(_0x114072,_0x254a8d){return db[_0x84fd('0x18')][_0x84fd('0x19')](_0x5e36b8['body'],{'raw':_0x5e36b8[_0x84fd('0x1a')]?_0x5e36b8[_0x84fd('0x1a')][_0x84fd('0x1b')]===undefined?!![]:![]:!![]})[_0x84fd('0xc')](function(_0x1d36fe){logger[_0x84fd('0xd')]('CreateVoiceAgentReport',_0x5e36b8);logger[_0x84fd('0x10')](_0x84fd('0x17'),_0x5e36b8,JSON[_0x84fd('0x12')](_0x1d36fe));_0x114072(_0x1d36fe);})[_0x84fd('0x1c')](function(_0x3aa847){logger[_0x84fd('0x13')]('CreateVoiceAgentReport',_0x3aa847[_0x84fd('0x15')],_0x5e36b8);_0x254a8d(_0x34fdef['error'](0x1f4,_0x3aa847[_0x84fd('0x15')]));});});};exports[_0x84fd('0x1d')]=function(_0x786a86){var _0x3df384=this;return new Promise(function(_0xfe15d1,_0x21af5a){return db[_0x84fd('0x18')][_0x84fd('0x1e')](_0x786a86['body'],{'raw':_0x786a86[_0x84fd('0x1a')]?_0x786a86[_0x84fd('0x1a')][_0x84fd('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x786a86['options']?_0x786a86[_0x84fd('0x1a')]['where']||null:null,'attributes':_0x786a86[_0x84fd('0x1a')]?_0x786a86[_0x84fd('0x1a')]['attributes']||null:null,'limit':_0x786a86[_0x84fd('0x1a')]?_0x786a86[_0x84fd('0x1a')][_0x84fd('0x1f')]||null:null})[_0x84fd('0xc')](function(_0x3484f8){logger['info'](_0x84fd('0x1d'),_0x786a86);logger[_0x84fd('0x10')]('UpdateVoiceAgentReport',_0x786a86,JSON[_0x84fd('0x12')](_0x3484f8));_0xfe15d1(_0x3484f8);})['catch'](function(_0x5c280f){logger[_0x84fd('0x13')](_0x84fd('0x1d'),_0x5c280f[_0x84fd('0x15')],_0x786a86);_0x21af5a(_0x3df384[_0x84fd('0x13')](0x1f4,_0x5c280f[_0x84fd('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index e64f6f1..2e183a8 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 _0x303a=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','update','delete','exports','multer','path'];(function(_0x29782e,_0x132e87){var _0x348434=function(_0x5450e5){while(--_0x5450e5){_0x29782e['push'](_0x29782e['shift']());}};_0x348434(++_0x132e87);}(_0x303a,0x1a0));var _0xa303=function(_0x175290,_0x42e572){_0x175290=_0x175290-0x0;var _0x52bd78=_0x303a[_0x175290];return _0x52bd78;};'use strict';var multer=require(_0xa303('0x0'));var util=require('util');var path=require(_0xa303('0x1'));var timeout=require(_0xa303('0x2'));var express=require(_0xa303('0x3'));var router=express[_0xa303('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa303('0x5'));var interaction=require(_0xa303('0x6'));var config=require(_0xa303('0x7'));var controller=require(_0xa303('0x8'));router[_0xa303('0x9')]('/',auth[_0xa303('0xa')](),controller[_0xa303('0xb')]);router[_0xa303('0x9')](_0xa303('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xa303('0xd'),auth[_0xa303('0xa')](),controller['show']);router[_0xa303('0xe')]('/',auth['isAuthenticated'](),controller[_0xa303('0xf')]);router['put'](_0xa303('0xd'),auth[_0xa303('0xa')](),controller[_0xa303('0x10')]);router[_0xa303('0x11')]('/:id',auth[_0xa303('0xa')](),controller['destroy']);module[_0xa303('0x12')]=router; \ No newline at end of file +var _0xae24=['./voiceCallReport.controller','get','isAuthenticated','index','/describe','show','post','create','put','/:id','delete','exports','multer','path','express','Router','../../components/interaction/service'];(function(_0xd4636c,_0x34dbf6){var _0x5ee17d=function(_0x223c38){while(--_0x223c38){_0xd4636c['push'](_0xd4636c['shift']());}};_0x5ee17d(++_0x34dbf6);}(_0xae24,0x182));var _0x4ae2=function(_0x452c6b,_0x5b0132){_0x452c6b=_0x452c6b-0x0;var _0x5b51fc=_0xae24[_0x452c6b];return _0x5b51fc;};'use strict';var multer=require(_0x4ae2('0x0'));var util=require('util');var path=require(_0x4ae2('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ae2('0x2'));var router=express[_0x4ae2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ae2('0x4'));var config=require('../../config/environment');var controller=require(_0x4ae2('0x5'));router[_0x4ae2('0x6')]('/',auth[_0x4ae2('0x7')](),controller[_0x4ae2('0x8')]);router[_0x4ae2('0x6')](_0x4ae2('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x4ae2('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x4ae2('0xa')]);router[_0x4ae2('0xb')]('/',auth['isAuthenticated'](),controller[_0x4ae2('0xc')]);router[_0x4ae2('0xd')](_0x4ae2('0xe'),auth[_0x4ae2('0x7')](),controller['update']);router[_0x4ae2('0xf')](_0x4ae2('0xe'),auth[_0x4ae2('0x7')](),controller['destroy']);module[_0x4ae2('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index e099bdf..1be3c19 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 _0x8201=['outbound-fax','STRING','TEXT','DATE','INTEGER','sequelize','ENUM','internal','inbound-fax'];(function(_0x5ad190,_0xd39c9e){var _0x518ed3=function(_0x57f03a){while(--_0x57f03a){_0x5ad190['push'](_0x5ad190['shift']());}};_0x518ed3(++_0xd39c9e);}(_0x8201,0x71));var _0x1820=function(_0x210247,_0x265a8d){_0x210247=_0x210247-0x0;var _0x38b0d0=_0x8201[_0x210247];return _0x38b0d0;};'use strict';var Sequelize=require(_0x1820('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1820('0x1')]('inbound',_0x1820('0x2'),'outbound',_0x1820('0x3'),_0x1820('0x4'),'dialer')},'tag':{'type':Sequelize[_0x1820('0x5')]},'accountcode':{'type':Sequelize[_0x1820('0x5')]},'source':{'type':Sequelize[_0x1820('0x5')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x1820('0x5')]},'callerid':{'type':Sequelize[_0x1820('0x5')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x1820('0x5')]},'lastapplication':{'type':Sequelize[_0x1820('0x5')]},'lastdata':{'type':Sequelize[_0x1820('0x6')]},'starttime':{'type':Sequelize[_0x1820('0x7')]},'systemanswertime':{'type':Sequelize[_0x1820('0x7')]},'answertime':{'type':Sequelize[_0x1820('0x7')]},'endtime':{'type':Sequelize[_0x1820('0x7')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x1820('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x1820('0x5')]},'amaflags':{'type':Sequelize[_0x1820('0x5')]},'userfield':{'type':Sequelize[_0x1820('0x5')]},'userDisposition':{'type':Sequelize[_0x1820('0x5')]},'userSecondDisposition':{'type':Sequelize[_0x1820('0x5')]},'userThirdDisposition':{'type':Sequelize[_0x1820('0x5')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x1820('0x5')]}}; \ No newline at end of file +var _0x2ed4=['DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','outbound','outbound-fax','dialer','TEXT'];(function(_0xc5ed9,_0x435e78){var _0x4c7db7=function(_0x1bcaa8){while(--_0x1bcaa8){_0xc5ed9['push'](_0xc5ed9['shift']());}};_0x4c7db7(++_0x435e78);}(_0x2ed4,0xe6));var _0x42ed=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x2ed4[_0x1992f1];return _0x413dfe;};'use strict';var Sequelize=require(_0x42ed('0x0'));module[_0x42ed('0x1')]={'uniqueid':{'type':Sequelize[_0x42ed('0x2')]},'type':{'type':Sequelize[_0x42ed('0x3')](_0x42ed('0x4'),_0x42ed('0x5'),_0x42ed('0x6'),'inbound-fax',_0x42ed('0x7'),_0x42ed('0x8'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x42ed('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x42ed('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x42ed('0x2')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x42ed('0x9')]},'starttime':{'type':Sequelize[_0x42ed('0xa')]},'systemanswertime':{'type':Sequelize[_0x42ed('0xa')]},'answertime':{'type':Sequelize[_0x42ed('0xa')]},'endtime':{'type':Sequelize[_0x42ed('0xa')]},'duration':{'type':Sequelize[_0x42ed('0xb')]},'billableseconds':{'type':Sequelize[_0x42ed('0xb')]},'mohtime':{'type':Sequelize[_0x42ed('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x42ed('0x2')]},'userfield':{'type':Sequelize[_0x42ed('0x2')]},'userDisposition':{'type':Sequelize[_0x42ed('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x42ed('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x42ed('0x2')]},'note':{'type':Sequelize[_0x42ed('0x2')]},'prefix':{'type':Sequelize[_0x42ed('0x2')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 95dd6ad..c78e813 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5f66[_0x3e5086];return _0xfeb102;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file +var _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x19dd7a,_0x51de21){var _0x3feb6a=function(_0x4a3c84){while(--_0x4a3c84){_0x19dd7a['push'](_0x19dd7a['shift']());}};_0x3feb6a(++_0x51de21);}(_0x2ef3,0xba));var _0x32ef=function(_0x4f77ae,_0x2fbfab){_0x4f77ae=_0x4f77ae-0x0;var _0x20dd97=_0x2ef3[_0x4f77ae];return _0x20dd97;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 4658b6b..d784d8f 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 _0xc199=['exports','define','report_call','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceCallReport.attributes'];(function(_0x3c5d8d,_0x4925f2){var _0x2aa8c1=function(_0x2d05b7){while(--_0x2d05b7){_0x3c5d8d['push'](_0x3c5d8d['shift']());}};_0x2aa8c1(++_0x4925f2);}(_0xc199,0x162));var _0x9c19=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xc199[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0x9c19('0x0'));var util=require(_0x9c19('0x1'));var logger=require(_0x9c19('0x2'))(_0x9c19('0x3'));var moment=require(_0x9c19('0x4'));var BPromise=require(_0x9c19('0x5'));var rp=require(_0x9c19('0x6'));var fs=require('fs');var path=require(_0x9c19('0x7'));var rimraf=require(_0x9c19('0x8'));var config=require('../../config/environment');var attributes=require(_0x9c19('0x9'));module[_0x9c19('0xa')]=function(_0x409768,_0x1802d7){return _0x409768[_0x9c19('0xb')]('VoiceCallReport',attributes,{'tableName':_0x9c19('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x03e0=['define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','./voiceCallReport.attributes'];(function(_0x4c3334,_0x48eb3c){var _0x25f58f=function(_0x18e44b){while(--_0x18e44b){_0x4c3334['push'](_0x4c3334['shift']());}};_0x25f58f(++_0x48eb3c);}(_0x03e0,0xf6));var _0x003e=function(_0x5341d2,_0x2da6d6){_0x5341d2=_0x5341d2-0x0;var _0x3a4d6a=_0x03e0[_0x5341d2];return _0x3a4d6a;};'use strict';var _=require(_0x003e('0x0'));var util=require(_0x003e('0x1'));var logger=require(_0x003e('0x2'))('api');var moment=require(_0x003e('0x3'));var BPromise=require(_0x003e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x003e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x003e('0x6'));module['exports']=function(_0x276df,_0x11a949){return _0x276df[_0x003e('0x7')](_0x003e('0x8'),attributes,{'tableName':_0x003e('0x9'),'paranoid':![],'indexes':[{'fields':[_0x003e('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 1c9060a..f8fd606 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 _0x9541=['create','body','raw','catch','update','UpdateVoiceCallReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','request','info','VoiceCallReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','GetVoiceCallReport','VoiceCallReport','options','where','attributes','limit','map','include','model','then','stringify','CreateVoiceCallReport'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x9541,0x141));var _0x1954=function(_0x452d41,_0x46eb83){_0x452d41=_0x452d41-0x0;var _0x22fcb9=_0x9541[_0x452d41];return _0x22fcb9;};'use strict';var _=require(_0x1954('0x0'));var util=require(_0x1954('0x1'));var moment=require(_0x1954('0x2'));var BPromise=require('bluebird');var rs=require(_0x1954('0x3'));var fs=require('fs');var Redis=require(_0x1954('0x4'));var db=require(_0x1954('0x5'))['db'];var utils=require(_0x1954('0x6'));var logger=require('../../config/logger')(_0x1954('0x7'));var config=require('../../config/environment');var jayson=require(_0x1954('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x46d4ad,_0x26a08d,_0x5be4b9){return new BPromise(function(_0x1dc24b,_0xd04ba2){return client[_0x1954('0x9')](_0x46d4ad,_0x5be4b9)['then'](function(_0xbc146a){logger[_0x1954('0xa')](_0x1954('0xb'),_0x26a08d,'request\x20sent');logger[_0x1954('0xc')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x26a08d,_0x1954('0xd'),JSON['stringify'](_0xbc146a));if(_0xbc146a[_0x1954('0xe')]){if(_0xbc146a['error'][_0x1954('0xf')]===0x1f4){logger[_0x1954('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x26a08d,_0xbc146a[_0x1954('0xe')][_0x1954('0x10')]);return _0xd04ba2(_0xbc146a[_0x1954('0xe')][_0x1954('0x10')]);}logger[_0x1954('0xe')](_0x1954('0xb'),_0x26a08d,_0xbc146a[_0x1954('0xe')][_0x1954('0x10')]);return _0x1dc24b(_0xbc146a[_0x1954('0xe')][_0x1954('0x10')]);}else{logger[_0x1954('0xa')](_0x1954('0xb'),_0x26a08d,_0x1954('0xd'));_0x1dc24b(_0xbc146a['result'][_0x1954('0x10')]);}})['catch'](function(_0x19a7a9){logger[_0x1954('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x26a08d,_0x19a7a9);_0xd04ba2(_0x19a7a9);});});}exports[_0x1954('0x11')]=function(_0x1fa263){var _0x1ed8a0=this;return new Promise(function(_0x1748b9,_0x3f4fb0){return db[_0x1954('0x12')]['findAll']({'raw':_0x1fa263['options']?_0x1fa263[_0x1954('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x1fa263[_0x1954('0x13')]?_0x1fa263['options'][_0x1954('0x14')]||null:null,'attributes':_0x1fa263[_0x1954('0x13')]?_0x1fa263[_0x1954('0x13')][_0x1954('0x15')]||null:null,'limit':_0x1fa263[_0x1954('0x13')]?_0x1fa263[_0x1954('0x13')][_0x1954('0x16')]||null:null,'include':_0x1fa263[_0x1954('0x13')]?_0x1fa263['options']['include']?_[_0x1954('0x17')](_0x1fa263[_0x1954('0x13')][_0x1954('0x18')],function(_0x30a187){return{'model':db[_0x30a187[_0x1954('0x19')]],'as':_0x30a187['as'],'attributes':_0x30a187[_0x1954('0x15')],'include':_0x30a187[_0x1954('0x18')]?_[_0x1954('0x17')](_0x30a187[_0x1954('0x18')],function(_0x5abae3){return{'model':db[_0x5abae3[_0x1954('0x19')]],'as':_0x5abae3['as'],'attributes':_0x5abae3['attributes'],'include':_0x5abae3[_0x1954('0x18')]?_['map'](_0x5abae3['include'],function(_0x13ba49){return{'model':db[_0x13ba49[_0x1954('0x19')]],'as':_0x13ba49['as'],'attributes':_0x13ba49[_0x1954('0x15')]};}):[]};}):[]};}):[]:[]})[_0x1954('0x1a')](function(_0x59c37b){logger[_0x1954('0xa')](_0x1954('0x11'),_0x1fa263);logger[_0x1954('0xc')](_0x1954('0x11'),_0x1fa263,JSON[_0x1954('0x1b')](_0x59c37b));_0x1748b9(_0x59c37b);})['catch'](function(_0x40f15d){logger[_0x1954('0xe')](_0x1954('0x11'),_0x40f15d[_0x1954('0x10')],_0x1fa263);_0x3f4fb0(_0x1ed8a0['error'](0x1f4,_0x40f15d[_0x1954('0x10')]));});});};exports[_0x1954('0x1c')]=function(_0x15bc9e){var _0x9ec786=this;return new Promise(function(_0x2dab3,_0x3a3a09){return db['VoiceCallReport'][_0x1954('0x1d')](_0x15bc9e[_0x1954('0x1e')],{'raw':_0x15bc9e['options']?_0x15bc9e[_0x1954('0x13')][_0x1954('0x1f')]===undefined?!![]:![]:!![]})[_0x1954('0x1a')](function(_0x587b68){logger[_0x1954('0xa')](_0x1954('0x1c'),_0x15bc9e);logger[_0x1954('0xc')]('CreateVoiceCallReport',_0x15bc9e,JSON[_0x1954('0x1b')](_0x587b68));_0x2dab3(_0x587b68);})[_0x1954('0x20')](function(_0x30af71){logger[_0x1954('0xe')]('CreateVoiceCallReport',_0x30af71[_0x1954('0x10')],_0x15bc9e);_0x3a3a09(_0x9ec786['error'](0x1f4,_0x30af71[_0x1954('0x10')]));});});};exports['UpdateVoiceCallReport']=function(_0x526b51){var _0x2ebccb=this;return new Promise(function(_0x170e90,_0x76bdbd){return db[_0x1954('0x12')][_0x1954('0x21')](_0x526b51['body'],{'raw':_0x526b51['options']?_0x526b51['options'][_0x1954('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x526b51['options']?_0x526b51[_0x1954('0x13')][_0x1954('0x14')]||null:null,'attributes':_0x526b51[_0x1954('0x13')]?_0x526b51['options'][_0x1954('0x15')]||null:null,'limit':_0x526b51[_0x1954('0x13')]?_0x526b51[_0x1954('0x13')][_0x1954('0x16')]||null:null})[_0x1954('0x1a')](function(_0x5cd156){logger[_0x1954('0xa')]('UpdateVoiceCallReport',_0x526b51);logger['debug'](_0x1954('0x22'),_0x526b51,JSON[_0x1954('0x1b')](_0x5cd156));_0x170e90(_0x5cd156);})[_0x1954('0x20')](function(_0x278a99){logger[_0x1954('0xe')]('UpdateVoiceCallReport',_0x278a99[_0x1954('0x10')],_0x526b51);_0x76bdbd(_0x2ebccb[_0x1954('0xe')](0x1f4,_0x278a99[_0x1954('0x10')]));});});}; \ No newline at end of file +var _0x01dc=['findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceCallReport','create','body','update','UpdateVoiceCallReport','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','catch','GetVoiceCallReport','VoiceCallReport'];(function(_0x568b99,_0x56ee20){var _0x2c3099=function(_0x49ed4b){while(--_0x49ed4b){_0x568b99['push'](_0x568b99['shift']());}};_0x2c3099(++_0x56ee20);}(_0x01dc,0x1bb));var _0xc01d=function(_0x4d8b50,_0x157e39){_0x4d8b50=_0x4d8b50-0x0;var _0x445163=_0x01dc[_0x4d8b50];return _0x445163;};'use strict';var _=require(_0xc01d('0x0'));var util=require('util');var moment=require(_0xc01d('0x1'));var BPromise=require(_0xc01d('0x2'));var rs=require(_0xc01d('0x3'));var fs=require('fs');var Redis=require(_0xc01d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc01d('0x5'));var logger=require('../../config/logger')(_0xc01d('0x6'));var config=require(_0xc01d('0x7'));var jayson=require(_0xc01d('0x8'));var client=jayson[_0xc01d('0x9')][_0xc01d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e6e74,_0x40c07e,_0x3ea1a5){return new BPromise(function(_0x2e1857,_0x1f5668){return client[_0xc01d('0xb')](_0x3e6e74,_0x3ea1a5)[_0xc01d('0xc')](function(_0x182d7d){logger[_0xc01d('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0x40c07e,_0xc01d('0xe'));logger[_0xc01d('0xf')](_0xc01d('0x10'),_0x40c07e,_0xc01d('0xe'),JSON[_0xc01d('0x11')](_0x182d7d));if(_0x182d7d['error']){if(_0x182d7d[_0xc01d('0x12')][_0xc01d('0x13')]===0x1f4){logger[_0xc01d('0x12')](_0xc01d('0x14'),_0x40c07e,_0x182d7d[_0xc01d('0x12')]['message']);return _0x1f5668(_0x182d7d['error']['message']);}logger[_0xc01d('0x12')](_0xc01d('0x14'),_0x40c07e,_0x182d7d[_0xc01d('0x12')][_0xc01d('0x15')]);return _0x2e1857(_0x182d7d[_0xc01d('0x12')]['message']);}else{logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x40c07e,_0xc01d('0xe'));_0x2e1857(_0x182d7d['result']['message']);}})[_0xc01d('0x16')](function(_0x329de5){logger['error'](_0xc01d('0x14'),_0x40c07e,_0x329de5);_0x1f5668(_0x329de5);});});}exports[_0xc01d('0x17')]=function(_0x3b023e){var _0x4a55ce=this;return new Promise(function(_0x18291a,_0x7cd626){return db[_0xc01d('0x18')][_0xc01d('0x19')]({'raw':_0x3b023e['options']?_0x3b023e[_0xc01d('0x1a')][_0xc01d('0x1b')]===undefined?!![]:![]:!![],'where':_0x3b023e[_0xc01d('0x1a')]?_0x3b023e[_0xc01d('0x1a')][_0xc01d('0x1c')]||null:null,'attributes':_0x3b023e[_0xc01d('0x1a')]?_0x3b023e['options'][_0xc01d('0x1d')]||null:null,'limit':_0x3b023e[_0xc01d('0x1a')]?_0x3b023e[_0xc01d('0x1a')][_0xc01d('0x1e')]||null:null,'include':_0x3b023e[_0xc01d('0x1a')]?_0x3b023e[_0xc01d('0x1a')][_0xc01d('0x1f')]?_[_0xc01d('0x20')](_0x3b023e[_0xc01d('0x1a')]['include'],function(_0xb91618){return{'model':db[_0xb91618[_0xc01d('0x21')]],'as':_0xb91618['as'],'attributes':_0xb91618['attributes'],'include':_0xb91618[_0xc01d('0x1f')]?_[_0xc01d('0x20')](_0xb91618['include'],function(_0x177343){return{'model':db[_0x177343['model']],'as':_0x177343['as'],'attributes':_0x177343[_0xc01d('0x1d')],'include':_0x177343['include']?_[_0xc01d('0x20')](_0x177343['include'],function(_0x21132b){return{'model':db[_0x21132b[_0xc01d('0x21')]],'as':_0x21132b['as'],'attributes':_0x21132b[_0xc01d('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x48f9c6){logger[_0xc01d('0xd')](_0xc01d('0x17'),_0x3b023e);logger['debug'](_0xc01d('0x17'),_0x3b023e,JSON[_0xc01d('0x11')](_0x48f9c6));_0x18291a(_0x48f9c6);})['catch'](function(_0x23bef7){logger[_0xc01d('0x12')](_0xc01d('0x17'),_0x23bef7['message'],_0x3b023e);_0x7cd626(_0x4a55ce[_0xc01d('0x12')](0x1f4,_0x23bef7[_0xc01d('0x15')]));});});};exports[_0xc01d('0x22')]=function(_0x1d38b8){var _0x5a7697=this;return new Promise(function(_0x488f88,_0x53c2b1){return db[_0xc01d('0x18')][_0xc01d('0x23')](_0x1d38b8[_0xc01d('0x24')],{'raw':_0x1d38b8[_0xc01d('0x1a')]?_0x1d38b8[_0xc01d('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xc01d('0xc')](function(_0x6e0bba){logger[_0xc01d('0xd')](_0xc01d('0x22'),_0x1d38b8);logger[_0xc01d('0xf')](_0xc01d('0x22'),_0x1d38b8,JSON[_0xc01d('0x11')](_0x6e0bba));_0x488f88(_0x6e0bba);})[_0xc01d('0x16')](function(_0x46959e){logger[_0xc01d('0x12')](_0xc01d('0x22'),_0x46959e[_0xc01d('0x15')],_0x1d38b8);_0x53c2b1(_0x5a7697[_0xc01d('0x12')](0x1f4,_0x46959e[_0xc01d('0x15')]));});});};exports['UpdateVoiceCallReport']=function(_0x36ab63){var _0x396b20=this;return new Promise(function(_0xb38d46,_0x629652){return db[_0xc01d('0x18')][_0xc01d('0x25')](_0x36ab63['body'],{'raw':_0x36ab63[_0xc01d('0x1a')]?_0x36ab63[_0xc01d('0x1a')][_0xc01d('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36ab63[_0xc01d('0x1a')]?_0x36ab63[_0xc01d('0x1a')]['where']||null:null,'attributes':_0x36ab63[_0xc01d('0x1a')]?_0x36ab63[_0xc01d('0x1a')][_0xc01d('0x1d')]||null:null,'limit':_0x36ab63['options']?_0x36ab63[_0xc01d('0x1a')][_0xc01d('0x1e')]||null:null})[_0xc01d('0xc')](function(_0x5c4858){logger[_0xc01d('0xd')]('UpdateVoiceCallReport',_0x36ab63);logger[_0xc01d('0xf')](_0xc01d('0x26'),_0x36ab63,JSON[_0xc01d('0x11')](_0x5c4858));_0xb38d46(_0x5c4858);})['catch'](function(_0x910512){logger[_0xc01d('0x12')](_0xc01d('0x26'),_0x910512[_0xc01d('0x15')],_0x36ab63);_0x629652(_0x396b20[_0xc01d('0x12')](0x1f4,_0x910512[_0xc01d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 197b78b..b7a3717 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 _0x314b=['util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','destroy'];(function(_0x57474e,_0x4178b8){var _0xfaae8c=function(_0x2e34d1){while(--_0x2e34d1){_0x57474e['push'](_0x57474e['shift']());}};_0xfaae8c(++_0x4178b8);}(_0x314b,0xcc));var _0xb314=function(_0x188a93,_0xaf57db){_0x188a93=_0x188a93-0x0;var _0x23b40d=_0x314b[_0x188a93];return _0x23b40d;};'use strict';var multer=require('multer');var util=require(_0xb314('0x0'));var path=require(_0xb314('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb314('0x2')]();var fs_extra=require(_0xb314('0x3'));var auth=require(_0xb314('0x4'));var interaction=require(_0xb314('0x5'));var config=require('../../config/environment');var controller=require(_0xb314('0x6'));router['get']('/',auth[_0xb314('0x7')](),controller[_0xb314('0x8')]);router[_0xb314('0x9')](_0xb314('0xa'),auth['isAuthenticated'](),controller[_0xb314('0xb')]);router[_0xb314('0xc')]('/',auth[_0xb314('0x7')](),controller[_0xb314('0xd')]);router[_0xb314('0xe')](_0xb314('0xa'),auth['isAuthenticated'](),controller[_0xb314('0xf')]);router['delete']('/:id',auth[_0xb314('0x7')](),controller[_0xb314('0x10')]);module['exports']=router; \ No newline at end of file +var _0x514f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','isAuthenticated','get','show','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x53f3da,_0x2e0215){var _0x5303c6=function(_0x298341){while(--_0x298341){_0x53f3da['push'](_0x53f3da['shift']());}};_0x5303c6(++_0x2e0215);}(_0x514f,0x11a));var _0xf514=function(_0x157cbe,_0x3fb594){_0x157cbe=_0x157cbe-0x0;var _0x3d8373=_0x514f[_0x157cbe];return _0x3d8373;};'use strict';var multer=require('multer');var util=require(_0xf514('0x0'));var path=require(_0xf514('0x1'));var timeout=require(_0xf514('0x2'));var express=require(_0xf514('0x3'));var router=express[_0xf514('0x4')]();var fs_extra=require(_0xf514('0x5'));var auth=require(_0xf514('0x6'));var interaction=require(_0xf514('0x7'));var config=require(_0xf514('0x8'));var controller=require(_0xf514('0x9'));router['get']('/',auth[_0xf514('0xa')](),controller['index']);router[_0xf514('0xb')]('/:id',auth[_0xf514('0xa')](),controller[_0xf514('0xc')]);router['post']('/',auth[_0xf514('0xa')](),controller['create']);router['put']('/:id',auth[_0xf514('0xa')](),controller[_0xf514('0xd')]);router['delete']('/:id',auth[_0xf514('0xa')](),controller[_0xf514('0xe')]);module[_0xf514('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index f350880..2e3bcfb 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 _0xb0f9=['name','setDataValue','join','options','getDataValue','BOOLEAN','sequelize','STRING'];(function(_0x5b388b,_0x1e1539){var _0x56360d=function(_0x49c53b){while(--_0x49c53b){_0x5b388b['push'](_0x5b388b['shift']());}};_0x56360d(++_0x1e1539);}(_0xb0f9,0xf6));var _0x9b0f=function(_0x504331,_0x2dd432){_0x504331=_0x504331-0x0;var _0x5a8db8=_0xb0f9[_0x504331];return _0x5a8db8;};'use strict';var Sequelize=require(_0x9b0f('0x0'));module['exports']={'name':{'type':Sequelize[_0x9b0f('0x1')]},'prefix':{'type':Sequelize[_0x9b0f('0x1')],'unique':_0x9b0f('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x5ce97d){this[_0x9b0f('0x3')]('options',_0x5ce97d?_0x5ce97d[_0x9b0f('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0x9b0f('0x5'))?this[_0x9b0f('0x6')]('options')['split'](''):[];}},'auth':{'type':Sequelize[_0x9b0f('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x9b0f('0x1')]},'record':{'type':Sequelize[_0x9b0f('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x9b0f('0x1')]},'description':{'type':Sequelize[_0x9b0f('0x1')]}}; \ No newline at end of file +var _0x0204=['options','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue'];(function(_0xe7ba0b,_0x139f20){var _0x363b79=function(_0x732e87){while(--_0x732e87){_0xe7ba0b['push'](_0xe7ba0b['shift']());}};_0x363b79(++_0x139f20);}(_0x0204,0xaf));var _0x4020=function(_0x51fda2,_0x35f02e){_0x51fda2=_0x51fda2-0x0;var _0x37643a=_0x0204[_0x51fda2];return _0x37643a;};'use strict';var Sequelize=require(_0x4020('0x0'));module[_0x4020('0x1')]={'name':{'type':Sequelize[_0x4020('0x2')]},'prefix':{'type':Sequelize[_0x4020('0x2')],'unique':_0x4020('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x4020('0x2')],'set':function(_0xdbf9d4){this[_0x4020('0x4')](_0x4020('0x5'),_0xdbf9d4?_0xdbf9d4['join'](''):[]);},'get':function(){return this[_0x4020('0x6')](_0x4020('0x5'))?this[_0x4020('0x6')](_0x4020('0x5'))[_0x4020('0x7')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x4020('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x4020('0x2')]},'description':{'type':Sequelize[_0x4020('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index e5c0cc4..e403e24 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 _0xbe99=['end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','get','ChanSpies','UserProfileResource','destroy','error','name','send','index','map','VoiceChanSpy','rawAttributes','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','params','fields','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x7fb61e,_0x4fff33){var _0xe66629=function(_0x1a4bf1){while(--_0x1a4bf1){_0x7fb61e['push'](_0x7fb61e['shift']());}};_0xe66629(++_0x4fff33);}(_0xbe99,0x196));var _0x9be9=function(_0x274f6f,_0x541c09){_0x274f6f=_0x274f6f-0x0;var _0x66fe2=_0xbe99[_0x274f6f];return _0x66fe2;};'use strict';var emlformat=require(_0x9be9('0x0'));var rimraf=require(_0x9be9('0x1'));var zipdir=require(_0x9be9('0x2'));var jsonpatch=require(_0x9be9('0x3'));var rp=require(_0x9be9('0x4'));var moment=require('moment');var BPromise=require(_0x9be9('0x5'));var Mustache=require('mustache');var util=require(_0x9be9('0x6'));var path=require(_0x9be9('0x7'));var sox=require(_0x9be9('0x8'));var csv=require(_0x9be9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9be9('0xa'));var _=require(_0x9be9('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9be9('0xc'));var deskjs=require(_0x9be9('0xd'));var toCsv=require(_0x9be9('0x9'));var querystring=require(_0x9be9('0xe'));var Papa=require(_0x9be9('0xf'));var Redis=require(_0x9be9('0x10'));var authService=require(_0x9be9('0x11'));var qs=require(_0x9be9('0x12'));var as=require(_0x9be9('0x13'));var hardwareService=require(_0x9be9('0x14'));var logger=require(_0x9be9('0x15'))(_0x9be9('0x16'));var utils=require(_0x9be9('0x17'));var config=require(_0x9be9('0x18'));var licenseUtil=require(_0x9be9('0x19'));var db=require(_0x9be9('0x1a'))['db'];function respondWithStatusCode(_0x33c2cd,_0x4b6d99){_0x4b6d99=_0x4b6d99||0xcc;return function(_0x1251e4){if(_0x1251e4){return _0x33c2cd[_0x9be9('0x1b')](_0x4b6d99);}return _0x33c2cd[_0x9be9('0x1c')](_0x4b6d99)[_0x9be9('0x1d')]();};}function respondWithResult(_0x2cc374,_0x50a7fb){_0x50a7fb=_0x50a7fb||0xc8;return function(_0x2798bd){if(_0x2798bd){return _0x2cc374[_0x9be9('0x1c')](_0x50a7fb)[_0x9be9('0x1e')](_0x2798bd);}};}function respondWithFilteredResult(_0x5a8a3d,_0x2d3e45){return function(_0x418c1e){if(_0x418c1e){var _0x3c92cc=typeof _0x2d3e45[_0x9be9('0x1f')]===_0x9be9('0x20')&&typeof _0x2d3e45['limit']===_0x9be9('0x20');var _0x1cbff7=_0x418c1e[_0x9be9('0x21')];var _0x5f2612=_0x3c92cc?0x0:_0x2d3e45['offset'];var _0x9a37a0=_0x3c92cc?_0x418c1e[_0x9be9('0x21')]:_0x2d3e45[_0x9be9('0x1f')]+_0x2d3e45['limit'];var _0x5aeca2;if(_0x9a37a0>=_0x1cbff7){_0x9a37a0=_0x1cbff7;_0x5aeca2=0xc8;}else{_0x5aeca2=0xce;}_0x5a8a3d[_0x9be9('0x1c')](_0x5aeca2);return _0x5a8a3d[_0x9be9('0x22')](_0x9be9('0x23'),_0x5f2612+'-'+_0x9a37a0+'/'+_0x1cbff7)[_0x9be9('0x1e')](_0x418c1e);}return null;};}function patchUpdates(_0x1b041b){return function(_0x3761c7){try{jsonpatch[_0x9be9('0x24')](_0x3761c7,_0x1b041b,!![]);}catch(_0x2c1f2f){return BPromise[_0x9be9('0x25')](_0x2c1f2f);}return _0x3761c7[_0x9be9('0x26')]();};}function saveUpdates(_0xd700ff,_0x100637){return function(_0x599429){if(_0x599429){return _0x599429[_0x9be9('0x27')](_0xd700ff)['then'](function(_0x2d543d){return _0x2d543d;});}return null;};}function removeEntity(_0xf87e6d,_0x451e60){return function(_0x3fe959){if(_0x3fe959){return _0x3fe959['destroy']()[_0x9be9('0x28')](function(){var _0xfb4266=_0x3fe959[_0x9be9('0x29')]({'plain':!![]});var _0x42a486=_0x9be9('0x2a');return db[_0x9be9('0x2b')][_0x9be9('0x2c')]({'where':{'type':_0x42a486,'resourceId':_0xfb4266['id']}})[_0x9be9('0x28')](function(){return _0x3fe959;});})[_0x9be9('0x28')](function(){_0xf87e6d[_0x9be9('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x195330,_0x2f8466){return function(_0x26db60){if(!_0x26db60){_0x195330[_0x9be9('0x1b')](0x194);}return _0x26db60;};}function handleError(_0x10ac46,_0x54de1f){_0x54de1f=_0x54de1f||0x1f4;return function(_0x22c898){logger[_0x9be9('0x2d')](_0x22c898['stack']);if(_0x22c898[_0x9be9('0x2e')]){delete _0x22c898['name'];}_0x10ac46[_0x9be9('0x1c')](_0x54de1f)[_0x9be9('0x2f')](_0x22c898);};}exports[_0x9be9('0x30')]=function(_0x199cbd,_0x5a527a){var _0x133eca={},_0x3f6fff={},_0xb61721={'count':0x0,'rows':[]};var _0x35665c=_[_0x9be9('0x31')](db[_0x9be9('0x32')][_0x9be9('0x33')],function(_0x3dcb2a){return{'name':_0x3dcb2a['fieldName'],'type':_0x3dcb2a['type'][_0x9be9('0x34')]};});_0x3f6fff['model']=_[_0x9be9('0x31')](_0x35665c,_0x9be9('0x2e'));_0x3f6fff[_0x9be9('0x35')]=_[_0x9be9('0x36')](_0x199cbd['query']);_0x3f6fff[_0x9be9('0x37')]=_[_0x9be9('0x38')](_0x3f6fff[_0x9be9('0x39')],_0x3f6fff[_0x9be9('0x35')]);_0x133eca[_0x9be9('0x3a')]=_['intersection'](_0x3f6fff[_0x9be9('0x39')],qs['fields'](_0x199cbd['query']['fields']));_0x133eca['attributes']=_0x133eca[_0x9be9('0x3a')][_0x9be9('0x3b')]?_0x133eca['attributes']:_0x3f6fff[_0x9be9('0x39')];if(!_0x199cbd[_0x9be9('0x35')][_0x9be9('0x3c')](_0x9be9('0x3d'))){_0x133eca[_0x9be9('0x3e')]=qs['limit'](_0x199cbd[_0x9be9('0x35')][_0x9be9('0x3e')]);_0x133eca[_0x9be9('0x1f')]=qs[_0x9be9('0x1f')](_0x199cbd[_0x9be9('0x35')][_0x9be9('0x1f')]);}_0x133eca[_0x9be9('0x3f')]=qs[_0x9be9('0x40')](_0x199cbd[_0x9be9('0x35')][_0x9be9('0x40')]);_0x133eca[_0x9be9('0x41')]=qs[_0x9be9('0x37')](_[_0x9be9('0x42')](_0x199cbd[_0x9be9('0x35')],_0x3f6fff[_0x9be9('0x37')]),_0x35665c);if(_0x199cbd[_0x9be9('0x35')][_0x9be9('0x43')]){_0x133eca[_0x9be9('0x41')]=_[_0x9be9('0x44')](_0x133eca[_0x9be9('0x41')],{'$or':_[_0x9be9('0x31')](_0x35665c,function(_0x1c1d9a){if(_0x1c1d9a[_0x9be9('0x45')]!==_0x9be9('0x46')){var _0x56a49d={};_0x56a49d[_0x1c1d9a[_0x9be9('0x2e')]]={'$like':'%'+_0x199cbd[_0x9be9('0x35')][_0x9be9('0x43')]+'%'};return _0x56a49d;}})});}_0x133eca=_[_0x9be9('0x44')]({},_0x133eca,_0x199cbd[_0x9be9('0x47')]);var _0x51e6fe={'where':_0x133eca[_0x9be9('0x41')]};return db[_0x9be9('0x32')][_0x9be9('0x21')](_0x51e6fe)[_0x9be9('0x28')](function(_0x1f7775){_0xb61721[_0x9be9('0x21')]=_0x1f7775;if(_0x199cbd[_0x9be9('0x35')][_0x9be9('0x48')]){_0x133eca[_0x9be9('0x49')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x133eca);})[_0x9be9('0x28')](function(_0x56bf39){_0xb61721['rows']=_0x56bf39;return _0xb61721;})[_0x9be9('0x28')](respondWithFilteredResult(_0x5a527a,_0x133eca))[_0x9be9('0x4a')](handleError(_0x5a527a,null));};exports[_0x9be9('0x4b')]=function(_0x59ed83,_0x5ab632){var _0x24c121={'raw':![],'where':{'id':_0x59ed83[_0x9be9('0x4c')]['id']}},_0x4f4168={};_0x4f4168[_0x9be9('0x39')]=_['keys'](db[_0x9be9('0x32')][_0x9be9('0x33')]);_0x4f4168[_0x9be9('0x35')]=_[_0x9be9('0x36')](_0x59ed83[_0x9be9('0x35')]);_0x4f4168['filters']=_[_0x9be9('0x38')](_0x4f4168[_0x9be9('0x39')],_0x4f4168[_0x9be9('0x35')]);_0x24c121['attributes']=_[_0x9be9('0x38')](_0x4f4168['model'],qs[_0x9be9('0x4d')](_0x59ed83[_0x9be9('0x35')][_0x9be9('0x4d')]));_0x24c121[_0x9be9('0x3a')]=_0x24c121['attributes']['length']?_0x24c121[_0x9be9('0x3a')]:_0x4f4168[_0x9be9('0x39')];if(_0x59ed83['query'][_0x9be9('0x48')]){_0x24c121[_0x9be9('0x49')]=[{'all':!![]}];}_0x24c121=_[_0x9be9('0x44')]({},_0x24c121,_0x59ed83[_0x9be9('0x47')]);return db[_0x9be9('0x32')][_0x9be9('0x4e')](_0x24c121)[_0x9be9('0x28')](handleEntityNotFound(_0x5ab632,null))[_0x9be9('0x28')](respondWithResult(_0x5ab632,null))[_0x9be9('0x4a')](handleError(_0x5ab632,null));};exports[_0x9be9('0x4f')]=function(_0x1385ac,_0x31faa8){return db['VoiceChanSpy'][_0x9be9('0x4f')](_0x1385ac[_0x9be9('0x50')],{})[_0x9be9('0x28')](function(_0x31928f){var _0x47e6c8=_0x1385ac['user'][_0x9be9('0x29')]({'plain':!![]});if(!_0x47e6c8)throw new Error(_0x9be9('0x51'));if(_0x47e6c8[_0x9be9('0x52')]===_0x9be9('0x53')){var _0x18450a=_0x31928f['get']({'plain':!![]});var _0x240265=_0x9be9('0x2a');return db['UserProfileSection'][_0x9be9('0x4e')]({'where':{'name':_0x240265,'userProfileId':_0x47e6c8[_0x9be9('0x54')]},'raw':!![]})['then'](function(_0x5a4795){if(_0x5a4795&&_0x5a4795[_0x9be9('0x55')]===0x0){return db[_0x9be9('0x2b')][_0x9be9('0x4f')]({'name':_0x18450a['name'],'resourceId':_0x18450a['id'],'type':_0x5a4795[_0x9be9('0x2e')],'sectionId':_0x5a4795['id']},{})[_0x9be9('0x28')](function(){return _0x31928f;});}else{return _0x31928f;}})[_0x9be9('0x4a')](function(_0x46a7d2){logger[_0x9be9('0x2d')](_0x9be9('0x56'),_0x46a7d2);throw _0x46a7d2;});}return _0x31928f;})[_0x9be9('0x28')](respondWithResult(_0x31faa8,0xc9))[_0x9be9('0x4a')](handleError(_0x31faa8,null));};exports[_0x9be9('0x27')]=function(_0x156637,_0x4dd1d0){if(_0x156637['body']['id']){delete _0x156637['body']['id'];}return db[_0x9be9('0x32')][_0x9be9('0x4e')]({'where':{'id':_0x156637['params']['id']}})[_0x9be9('0x28')](handleEntityNotFound(_0x4dd1d0,null))[_0x9be9('0x28')](saveUpdates(_0x156637[_0x9be9('0x50')],null))[_0x9be9('0x28')](respondWithResult(_0x4dd1d0,null))[_0x9be9('0x4a')](handleError(_0x4dd1d0,null));};exports[_0x9be9('0x2c')]=function(_0x1b0543,_0x5245a1){return db[_0x9be9('0x32')]['find']({'where':{'id':_0x1b0543[_0x9be9('0x4c')]['id']}})[_0x9be9('0x28')](handleEntityNotFound(_0x5245a1,null))['then'](removeEntity(_0x5245a1,null))[_0x9be9('0x4a')](handleError(_0x5245a1,null));}; \ No newline at end of file +var _0x3402=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','update','then','get','ChanSpies','UserProfileResource','destroy','error','name','send','index','map','VoiceChanSpy','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user'];(function(_0x3205e8,_0x531741){var _0x4508eb=function(_0x423246){while(--_0x423246){_0x3205e8['push'](_0x3205e8['shift']());}};_0x4508eb(++_0x531741);}(_0x3402,0x1f0));var _0x2340=function(_0x57097a,_0x3477f3){_0x57097a=_0x57097a-0x0;var _0x11247b=_0x3402[_0x57097a];return _0x11247b;};'use strict';var emlformat=require(_0x2340('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2340('0x1'));var jsonpatch=require(_0x2340('0x2'));var rp=require(_0x2340('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2340('0x4'));var util=require(_0x2340('0x5'));var path=require(_0x2340('0x6'));var sox=require(_0x2340('0x7'));var csv=require(_0x2340('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2340('0x9'));var squel=require(_0x2340('0xa'));var crypto=require(_0x2340('0xb'));var jsforce=require(_0x2340('0xc'));var deskjs=require(_0x2340('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2340('0xe'));var Papa=require(_0x2340('0xf'));var Redis=require(_0x2340('0x10'));var authService=require(_0x2340('0x11'));var qs=require(_0x2340('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2340('0x13'));var logger=require(_0x2340('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x2340('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2340('0x16'))['db'];function respondWithStatusCode(_0x5cc478,_0x35baa8){_0x35baa8=_0x35baa8||0xcc;return function(_0x42c154){if(_0x42c154){return _0x5cc478[_0x2340('0x17')](_0x35baa8);}return _0x5cc478[_0x2340('0x18')](_0x35baa8)[_0x2340('0x19')]();};}function respondWithResult(_0x7e51a5,_0xcab834){_0xcab834=_0xcab834||0xc8;return function(_0x491814){if(_0x491814){return _0x7e51a5[_0x2340('0x18')](_0xcab834)[_0x2340('0x1a')](_0x491814);}};}function respondWithFilteredResult(_0x3642e0,_0x5aff27){return function(_0x173678){if(_0x173678){var _0x119a05=typeof _0x5aff27[_0x2340('0x1b')]===_0x2340('0x1c')&&typeof _0x5aff27['limit']===_0x2340('0x1c');var _0x3ce1fa=_0x173678[_0x2340('0x1d')];var _0x9723dd=_0x119a05?0x0:_0x5aff27[_0x2340('0x1b')];var _0x51524b=_0x119a05?_0x173678['count']:_0x5aff27[_0x2340('0x1b')]+_0x5aff27[_0x2340('0x1e')];var _0x434a59;if(_0x51524b>=_0x3ce1fa){_0x51524b=_0x3ce1fa;_0x434a59=0xc8;}else{_0x434a59=0xce;}_0x3642e0['status'](_0x434a59);return _0x3642e0['set'](_0x2340('0x1f'),_0x9723dd+'-'+_0x51524b+'/'+_0x3ce1fa)[_0x2340('0x1a')](_0x173678);}return null;};}function patchUpdates(_0x1b3822){return function(_0xb2b57a){try{jsonpatch['apply'](_0xb2b57a,_0x1b3822,!![]);}catch(_0x567de5){return BPromise[_0x2340('0x20')](_0x567de5);}return _0xb2b57a['save']();};}function saveUpdates(_0x3f9f54,_0x44622a){return function(_0x28a812){if(_0x28a812){return _0x28a812[_0x2340('0x21')](_0x3f9f54)[_0x2340('0x22')](function(_0x32e08b){return _0x32e08b;});}return null;};}function removeEntity(_0x8f1d89,_0x130944){return function(_0x49c77e){if(_0x49c77e){return _0x49c77e['destroy']()[_0x2340('0x22')](function(){var _0x91f5c=_0x49c77e[_0x2340('0x23')]({'plain':!![]});var _0x44680e=_0x2340('0x24');return db[_0x2340('0x25')][_0x2340('0x26')]({'where':{'type':_0x44680e,'resourceId':_0x91f5c['id']}})['then'](function(){return _0x49c77e;});})[_0x2340('0x22')](function(){_0x8f1d89[_0x2340('0x18')](0xcc)[_0x2340('0x19')]();});}};}function handleEntityNotFound(_0x184db2,_0x209eb4){return function(_0x14b89d){if(!_0x14b89d){_0x184db2[_0x2340('0x17')](0x194);}return _0x14b89d;};}function handleError(_0x181e5a,_0x23d20d){_0x23d20d=_0x23d20d||0x1f4;return function(_0x229a00){logger[_0x2340('0x27')](_0x229a00['stack']);if(_0x229a00[_0x2340('0x28')]){delete _0x229a00[_0x2340('0x28')];}_0x181e5a['status'](_0x23d20d)[_0x2340('0x29')](_0x229a00);};}exports[_0x2340('0x2a')]=function(_0x43c671,_0x2da109){var _0x1f5a91={},_0x500842={},_0x16282b={'count':0x0,'rows':[]};var _0x1fecfd=_[_0x2340('0x2b')](db[_0x2340('0x2c')][_0x2340('0x2d')],function(_0x518278){return{'name':_0x518278[_0x2340('0x2e')],'type':_0x518278[_0x2340('0x2f')][_0x2340('0x30')]};});_0x500842['model']=_[_0x2340('0x2b')](_0x1fecfd,_0x2340('0x28'));_0x500842['query']=_[_0x2340('0x31')](_0x43c671[_0x2340('0x32')]);_0x500842['filters']=_[_0x2340('0x33')](_0x500842[_0x2340('0x34')],_0x500842[_0x2340('0x32')]);_0x1f5a91[_0x2340('0x35')]=_[_0x2340('0x33')](_0x500842[_0x2340('0x34')],qs['fields'](_0x43c671[_0x2340('0x32')][_0x2340('0x36')]));_0x1f5a91[_0x2340('0x35')]=_0x1f5a91['attributes'][_0x2340('0x37')]?_0x1f5a91[_0x2340('0x35')]:_0x500842[_0x2340('0x34')];if(!_0x43c671[_0x2340('0x32')][_0x2340('0x38')](_0x2340('0x39'))){_0x1f5a91[_0x2340('0x1e')]=qs[_0x2340('0x1e')](_0x43c671[_0x2340('0x32')][_0x2340('0x1e')]);_0x1f5a91[_0x2340('0x1b')]=qs['offset'](_0x43c671[_0x2340('0x32')]['offset']);}_0x1f5a91['order']=qs[_0x2340('0x3a')](_0x43c671['query'][_0x2340('0x3a')]);_0x1f5a91[_0x2340('0x3b')]=qs['filters'](_[_0x2340('0x3c')](_0x43c671[_0x2340('0x32')],_0x500842[_0x2340('0x3d')]),_0x1fecfd);if(_0x43c671[_0x2340('0x32')]['filter']){_0x1f5a91[_0x2340('0x3b')]=_[_0x2340('0x3e')](_0x1f5a91[_0x2340('0x3b')],{'$or':_[_0x2340('0x2b')](_0x1fecfd,function(_0x40dc44){if(_0x40dc44[_0x2340('0x2f')]!==_0x2340('0x3f')){var _0xdbc054={};_0xdbc054[_0x40dc44[_0x2340('0x28')]]={'$like':'%'+_0x43c671[_0x2340('0x32')]['filter']+'%'};return _0xdbc054;}})});}_0x1f5a91=_[_0x2340('0x3e')]({},_0x1f5a91,_0x43c671[_0x2340('0x40')]);var _0x156161={'where':_0x1f5a91[_0x2340('0x3b')]};return db[_0x2340('0x2c')]['count'](_0x156161)['then'](function(_0x2de7f4){_0x16282b['count']=_0x2de7f4;if(_0x43c671[_0x2340('0x32')][_0x2340('0x41')]){_0x1f5a91[_0x2340('0x42')]=[{'all':!![]}];}return db[_0x2340('0x2c')][_0x2340('0x43')](_0x1f5a91);})['then'](function(_0x51121e){_0x16282b[_0x2340('0x44')]=_0x51121e;return _0x16282b;})[_0x2340('0x22')](respondWithFilteredResult(_0x2da109,_0x1f5a91))[_0x2340('0x45')](handleError(_0x2da109,null));};exports[_0x2340('0x46')]=function(_0x4f6c34,_0x22139c){var _0x5efb7d={'raw':![],'where':{'id':_0x4f6c34[_0x2340('0x47')]['id']}},_0x5a0dff={};_0x5a0dff[_0x2340('0x34')]=_['keys'](db[_0x2340('0x2c')][_0x2340('0x2d')]);_0x5a0dff[_0x2340('0x32')]=_[_0x2340('0x31')](_0x4f6c34[_0x2340('0x32')]);_0x5a0dff[_0x2340('0x3d')]=_['intersection'](_0x5a0dff[_0x2340('0x34')],_0x5a0dff[_0x2340('0x32')]);_0x5efb7d[_0x2340('0x35')]=_['intersection'](_0x5a0dff['model'],qs['fields'](_0x4f6c34[_0x2340('0x32')][_0x2340('0x36')]));_0x5efb7d[_0x2340('0x35')]=_0x5efb7d[_0x2340('0x35')][_0x2340('0x37')]?_0x5efb7d[_0x2340('0x35')]:_0x5a0dff['model'];if(_0x4f6c34[_0x2340('0x32')][_0x2340('0x41')]){_0x5efb7d[_0x2340('0x42')]=[{'all':!![]}];}_0x5efb7d=_[_0x2340('0x3e')]({},_0x5efb7d,_0x4f6c34[_0x2340('0x40')]);return db[_0x2340('0x2c')][_0x2340('0x48')](_0x5efb7d)[_0x2340('0x22')](handleEntityNotFound(_0x22139c,null))[_0x2340('0x22')](respondWithResult(_0x22139c,null))[_0x2340('0x45')](handleError(_0x22139c,null));};exports[_0x2340('0x49')]=function(_0x580e13,_0x211d58){return db[_0x2340('0x2c')][_0x2340('0x49')](_0x580e13[_0x2340('0x4a')],{})[_0x2340('0x22')](function(_0x9a4866){var _0x5585ba=_0x580e13['user'][_0x2340('0x23')]({'plain':!![]});if(!_0x5585ba)throw new Error(_0x2340('0x4b'));if(_0x5585ba[_0x2340('0x4c')]===_0x2340('0x4d')){var _0x618f98=_0x9a4866['get']({'plain':!![]});var _0x1d9bcd=_0x2340('0x24');return db[_0x2340('0x4e')][_0x2340('0x48')]({'where':{'name':_0x1d9bcd,'userProfileId':_0x5585ba[_0x2340('0x4f')]},'raw':!![]})[_0x2340('0x22')](function(_0x3b2816){if(_0x3b2816&&_0x3b2816[_0x2340('0x50')]===0x0){return db[_0x2340('0x25')][_0x2340('0x49')]({'name':_0x618f98[_0x2340('0x28')],'resourceId':_0x618f98['id'],'type':_0x3b2816[_0x2340('0x28')],'sectionId':_0x3b2816['id']},{})[_0x2340('0x22')](function(){return _0x9a4866;});}else{return _0x9a4866;}})[_0x2340('0x45')](function(_0x5bdb15){logger[_0x2340('0x27')](_0x2340('0x51'),_0x5bdb15);throw _0x5bdb15;});}return _0x9a4866;})[_0x2340('0x22')](respondWithResult(_0x211d58,0xc9))['catch'](handleError(_0x211d58,null));};exports[_0x2340('0x21')]=function(_0x3d6015,_0x31953d){if(_0x3d6015[_0x2340('0x4a')]['id']){delete _0x3d6015[_0x2340('0x4a')]['id'];}return db['VoiceChanSpy'][_0x2340('0x48')]({'where':{'id':_0x3d6015[_0x2340('0x47')]['id']}})[_0x2340('0x22')](handleEntityNotFound(_0x31953d,null))['then'](saveUpdates(_0x3d6015['body'],null))[_0x2340('0x22')](respondWithResult(_0x31953d,null))[_0x2340('0x45')](handleError(_0x31953d,null));};exports[_0x2340('0x26')]=function(_0x449259,_0x2927fa){return db[_0x2340('0x2c')][_0x2340('0x48')]({'where':{'id':_0x449259['params']['id']}})[_0x2340('0x22')](handleEntityNotFound(_0x2927fa,null))['then'](removeEntity(_0x2927fa,null))[_0x2340('0x45')](handleError(_0x2927fa,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index ca4fb74..96c8855 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 _0x2a8c=['VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','context','from-sip','format','%s%s','prefix','system','push','merge','CDR(type)=%s','recordingFormat','auth','Authenticate','password','SIP/%s,%s','name','options','record','length','concat','internal','User','findAll','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy'];(function(_0x2b60e6,_0xfe4884){var _0x27a2b3=function(_0x10136c){while(--_0x10136c){_0x2b60e6['push'](_0x2b60e6['shift']());}};_0x27a2b3(++_0xfe4884);}(_0x2a8c,0x6f));var _0xc2a8=function(_0xc0493e,_0x23aaac){_0xc0493e=_0xc0493e-0x0;var _0x27b6ed=_0x2a8c[_0xc0493e];return _0x27b6ed;};'use strict';var _=require(_0xc2a8('0x0'));var util=require(_0xc2a8('0x1'));var BPromise=require(_0xc2a8('0x2'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x18fdb9,_0x191151,_0x2e80fe){var _0x3353cb=0x1;var _0x282c6d=[];var _0x112d67={'context':_0x191151[_0xc2a8('0x3')]||_0xc2a8('0x4'),'exten':util[_0xc2a8('0x5')](_0xc2a8('0x6'),_0x18fdb9[_0xc2a8('0x7')],_0x2e80fe),'type':_0xc2a8('0x8'),'isApp':![],'ChanSpyId':_0x18fdb9['id'],'UserId':_0x191151['id']};_0x282c6d[_0xc2a8('0x9')](_[_0xc2a8('0xa')]({'app':'Set','appdata':util['format'](_0xc2a8('0xb'),'chanspy'),'priority':_0x3353cb++},_0x112d67));if(_0x18fdb9['record']){_0x282c6d[_0xc2a8('0x9')](_['merge']({'app':'MixMonitor','appdata':util['format']('${UNIQUEID}.%s,a',_0x18fdb9[_0xc2a8('0xc')]),'priority':_0x3353cb++},_0x112d67));}if(_0x18fdb9[_0xc2a8('0xd')]){_0x282c6d[_0xc2a8('0x9')](_[_0xc2a8('0xa')]({'app':_0xc2a8('0xe'),'appdata':_0x18fdb9[_0xc2a8('0xf')],'priority':_0x3353cb++},_0x112d67));}_0x282c6d[_0xc2a8('0x9')](_[_0xc2a8('0xa')]({'app':'ChanSpy','appdata':util[_0xc2a8('0x5')](_0xc2a8('0x10'),_0x191151[_0xc2a8('0x11')],_0x18fdb9[_0xc2a8('0x12')]?_0x18fdb9[_0xc2a8('0x12')]['join'](''):''),'priority':_0x3353cb++},_0x112d67));if(_0x18fdb9[_0xc2a8('0x13')]){_0x282c6d[_0xc2a8('0x9')](_[_0xc2a8('0xa')]({'app':'StopMixMonitor','priority':_0x3353cb++},_0x112d67));}return _0x282c6d;};var getChanSpyApplications=function(_0xdfdd55,_0x1bca8c){var _0x2cc05a=[];for(var _0x244c2c=0x0,_0x3746a0=0x1;_0x244c2c<_0x1bca8c[_0xc2a8('0x14')];_0x244c2c++,_0x3746a0=0x1){_0x2cc05a=_0x2cc05a[_0xc2a8('0x15')](getUserApplications(_0xdfdd55,_0x1bca8c[_0x244c2c],_0x1bca8c[_0x244c2c][_0xc2a8('0x16')]));if(_0x1bca8c[_0x244c2c]['internal']!=_0x1bca8c[_0x244c2c]['name']){_0x2cc05a=_0x2cc05a[_0xc2a8('0x15')](getUserApplications(_0xdfdd55,_0x1bca8c[_0x244c2c],_0x1bca8c[_0x244c2c][_0xc2a8('0x11')]));}}return _0x2cc05a;};var getChanSpyPromise=function(_0x338795,_0x3aa84c){return new BPromise(function(_0x2762ce,_0x2c8324){return _0x338795[_0xc2a8('0x17')][_0xc2a8('0x18')]({'attributes':['id',_0xc2a8('0x11'),'internal'],'where':{'role':_0xc2a8('0x19'),'chanspy':!![]},'raw':!![]})[_0xc2a8('0x1a')](function(_0x479cfe){if(_0x479cfe){return _0x2762ce(getChanSpyApplications(_0x3aa84c,_0x479cfe));}return _0x2762ce([]);})[_0xc2a8('0x1b')](function(_0x2dac7e){_0x2c8324(_0x2dac7e);});});};module[_0xc2a8('0x1c')]=function(_0x324a1f,_0x5387eb){var _0x38bf18=_0x324a1f[_0xc2a8('0x1d')];return _0x324a1f[_0xc2a8('0x1e')](_0xc2a8('0x1f'),attributes,{'tableName':_0xc2a8('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xc6b83e,_0x508690,_0x56fa01){return getChanSpyPromise(_0x38bf18,_0xc6b83e)[_0xc2a8('0x1a')](function(_0x25a87a){if(_0x25a87a&&_0x25a87a[_0xc2a8('0x14')]){return _0x38bf18[_0xc2a8('0x21')][_0xc2a8('0x22')](_0x25a87a);}})['then'](function(){_0x56fa01();})[_0xc2a8('0x1b')](function(_0x10e39e){_0x56fa01(_0x10e39e);});},'afterUpdate':function(_0x149aa0,_0x4644e9,_0x3cd2b8){return _0x38bf18[_0xc2a8('0x21')]['destroy']({'where':{'ChanSpyId':_0x149aa0['id']}})[_0xc2a8('0x1a')](function(){return getChanSpyPromise(_0x38bf18,_0x149aa0);})[_0xc2a8('0x1a')](function(_0x569763){if(_0x569763&&_0x569763[_0xc2a8('0x14')]){return _0x38bf18[_0xc2a8('0x21')][_0xc2a8('0x22')](_0x569763);}})[_0xc2a8('0x1a')](function(){_0x3cd2b8();})[_0xc2a8('0x1b')](function(_0x4072de){_0x3cd2b8(_0x4072de);});},'afterDestroy':function(_0x195765,_0x1888d1,_0x315faa){return _0x38bf18['VoiceExtension'][_0xc2a8('0x23')]({'where':{'ChanSpyId':_0x195765['id']}})['then'](function(){_0x315faa();})[_0xc2a8('0x1b')](function(_0x14b32c){_0x315faa(_0x14b32c);});}}});}; \ No newline at end of file +var _0x88b2=['bulkCreate','lodash','util','./voiceChanSpy.attributes','from-sip','format','%s%s','prefix','system','push','Set','CDR(type)=%s','chanspy','record','merge','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','SIP/%s,%s','name','options','join','StopMixMonitor','length','internal','User','findAll','agent','catch','models','define','voice_chanspy','VoiceExtension','then','destroy'];(function(_0x36fce5,_0x1d352a){var _0x247a82=function(_0x42a314){while(--_0x42a314){_0x36fce5['push'](_0x36fce5['shift']());}};_0x247a82(++_0x1d352a);}(_0x88b2,0x104));var _0x288b=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x88b2[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x288b('0x0'));var util=require(_0x288b('0x1'));var BPromise=require('bluebird');var attributes=require(_0x288b('0x2'));var getUserApplications=function(_0x130d30,_0x1d6d54,_0x11c3d5){var _0x11d38b=0x1;var _0x27cb5b=[];var _0x22ebe1={'context':_0x1d6d54['context']||_0x288b('0x3'),'exten':util[_0x288b('0x4')](_0x288b('0x5'),_0x130d30[_0x288b('0x6')],_0x11c3d5),'type':_0x288b('0x7'),'isApp':![],'ChanSpyId':_0x130d30['id'],'UserId':_0x1d6d54['id']};_0x27cb5b[_0x288b('0x8')](_['merge']({'app':_0x288b('0x9'),'appdata':util[_0x288b('0x4')](_0x288b('0xa'),_0x288b('0xb')),'priority':_0x11d38b++},_0x22ebe1));if(_0x130d30[_0x288b('0xc')]){_0x27cb5b[_0x288b('0x8')](_[_0x288b('0xd')]({'app':'MixMonitor','appdata':util[_0x288b('0x4')](_0x288b('0xe'),_0x130d30[_0x288b('0xf')]),'priority':_0x11d38b++},_0x22ebe1));}if(_0x130d30[_0x288b('0x10')]){_0x27cb5b[_0x288b('0x8')](_[_0x288b('0xd')]({'app':_0x288b('0x11'),'appdata':_0x130d30[_0x288b('0x12')],'priority':_0x11d38b++},_0x22ebe1));}_0x27cb5b[_0x288b('0x8')](_[_0x288b('0xd')]({'app':'ChanSpy','appdata':util['format'](_0x288b('0x13'),_0x1d6d54[_0x288b('0x14')],_0x130d30[_0x288b('0x15')]?_0x130d30['options'][_0x288b('0x16')](''):''),'priority':_0x11d38b++},_0x22ebe1));if(_0x130d30[_0x288b('0xc')]){_0x27cb5b['push'](_[_0x288b('0xd')]({'app':_0x288b('0x17'),'priority':_0x11d38b++},_0x22ebe1));}return _0x27cb5b;};var getChanSpyApplications=function(_0x538bbd,_0x599a46){var _0xdd9bc8=[];for(var _0x247112=0x0,_0x4c86b2=0x1;_0x247112<_0x599a46[_0x288b('0x18')];_0x247112++,_0x4c86b2=0x1){_0xdd9bc8=_0xdd9bc8['concat'](getUserApplications(_0x538bbd,_0x599a46[_0x247112],_0x599a46[_0x247112][_0x288b('0x19')]));if(_0x599a46[_0x247112]['internal']!=_0x599a46[_0x247112][_0x288b('0x14')]){_0xdd9bc8=_0xdd9bc8['concat'](getUserApplications(_0x538bbd,_0x599a46[_0x247112],_0x599a46[_0x247112][_0x288b('0x14')]));}}return _0xdd9bc8;};var getChanSpyPromise=function(_0x44a98e,_0x12a5df){return new BPromise(function(_0x189f97,_0x2c0593){return _0x44a98e[_0x288b('0x1a')][_0x288b('0x1b')]({'attributes':['id',_0x288b('0x14'),_0x288b('0x19')],'where':{'role':_0x288b('0x1c'),'chanspy':!![]},'raw':!![]})['then'](function(_0x567b08){if(_0x567b08){return _0x189f97(getChanSpyApplications(_0x12a5df,_0x567b08));}return _0x189f97([]);})[_0x288b('0x1d')](function(_0x58c73c){_0x2c0593(_0x58c73c);});});};module['exports']=function(_0x25b902,_0x1c344){var _0x395785=_0x25b902[_0x288b('0x1e')];return _0x25b902[_0x288b('0x1f')]('VoiceChanSpy',attributes,{'tableName':_0x288b('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4a8dd6,_0x5b9b58,_0x5dfe27){return getChanSpyPromise(_0x395785,_0x4a8dd6)['then'](function(_0x4b93d2){if(_0x4b93d2&&_0x4b93d2[_0x288b('0x18')]){return _0x395785[_0x288b('0x21')]['bulkCreate'](_0x4b93d2);}})[_0x288b('0x22')](function(){_0x5dfe27();})[_0x288b('0x1d')](function(_0x56c6e1){_0x5dfe27(_0x56c6e1);});},'afterUpdate':function(_0x58728d,_0x59fd17,_0x4c53f7){return _0x395785['VoiceExtension'][_0x288b('0x23')]({'where':{'ChanSpyId':_0x58728d['id']}})[_0x288b('0x22')](function(){return getChanSpyPromise(_0x395785,_0x58728d);})[_0x288b('0x22')](function(_0x46cd79){if(_0x46cd79&&_0x46cd79[_0x288b('0x18')]){return _0x395785['VoiceExtension'][_0x288b('0x24')](_0x46cd79);}})[_0x288b('0x22')](function(){_0x4c53f7();})['catch'](function(_0x19f089){_0x4c53f7(_0x19f089);});},'afterDestroy':function(_0x3f4a56,_0x27c6ed,_0x23d6a8){return _0x395785[_0x288b('0x21')]['destroy']({'where':{'ChanSpyId':_0x3f4a56['id']}})['then'](function(){_0x23d6a8();})[_0x288b('0x1d')](function(_0x35ba6b){_0x23d6a8(_0x35ba6b);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index f486a0f..5acda3b 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 _0x1b32=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x3b498a,_0x1efcee){var _0x2726ea=function(_0x2c49e4){while(--_0x2c49e4){_0x3b498a['push'](_0x3b498a['shift']());}};_0x2726ea(++_0x1efcee);}(_0x1b32,0x85));var _0x21b3=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x1b32[_0x45d3f0];return _0x314b79;};'use strict';var _=require('lodash');var util=require(_0x21b3('0x0'));var moment=require(_0x21b3('0x1'));var BPromise=require(_0x21b3('0x2'));var rs=require(_0x21b3('0x3'));var fs=require('fs');var Redis=require(_0x21b3('0x4'));var db=require(_0x21b3('0x5'))['db'];var utils=require(_0x21b3('0x6'));var logger=require(_0x21b3('0x7'))(_0x21b3('0x8'));var config=require(_0x21b3('0x9'));var jayson=require(_0x21b3('0xa'));var client=jayson[_0x21b3('0xb')][_0x21b3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47516a,_0x21e881,_0x5c0f36){return new BPromise(function(_0x45b1b7,_0x5639eb){return client['request'](_0x47516a,_0x5c0f36)['then'](function(_0xd7a981){logger[_0x21b3('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x21e881,'request\x20sent');logger[_0x21b3('0xe')](_0x21b3('0xf'),_0x21e881,_0x21b3('0x10'),JSON['stringify'](_0xd7a981));if(_0xd7a981[_0x21b3('0x11')]){if(_0xd7a981[_0x21b3('0x11')][_0x21b3('0x12')]===0x1f4){logger[_0x21b3('0x11')](_0x21b3('0x13'),_0x21e881,_0xd7a981[_0x21b3('0x11')][_0x21b3('0x14')]);return _0x5639eb(_0xd7a981[_0x21b3('0x11')][_0x21b3('0x14')]);}logger['error'](_0x21b3('0x13'),_0x21e881,_0xd7a981[_0x21b3('0x11')][_0x21b3('0x14')]);return _0x45b1b7(_0xd7a981['error'][_0x21b3('0x14')]);}else{logger['info'](_0x21b3('0x13'),_0x21e881,'request\x20sent');_0x45b1b7(_0xd7a981[_0x21b3('0x15')][_0x21b3('0x14')]);}})[_0x21b3('0x16')](function(_0x4217d6){logger['error'](_0x21b3('0x13'),_0x21e881,_0x4217d6);_0x5639eb(_0x4217d6);});});} \ No newline at end of file +var _0x4058=['request','then','info','request\x20sent','debug','stringify','VoiceChanSpy,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4058,0x129));var _0x8405=function(_0x4efc01,_0x42f7a1){_0x4efc01=_0x4efc01-0x0;var _0x1cf6d6=_0x4058[_0x4efc01];return _0x1cf6d6;};'use strict';var _=require(_0x8405('0x0'));var util=require(_0x8405('0x1'));var moment=require(_0x8405('0x2'));var BPromise=require(_0x8405('0x3'));var rs=require(_0x8405('0x4'));var fs=require('fs');var Redis=require(_0x8405('0x5'));var db=require(_0x8405('0x6'))['db'];var utils=require(_0x8405('0x7'));var logger=require(_0x8405('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8405('0x9')][_0x8405('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d9bf6,_0x1322e5,_0x1cb061){return new BPromise(function(_0x479c97,_0x16d810){return client[_0x8405('0xb')](_0x3d9bf6,_0x1cb061)[_0x8405('0xc')](function(_0x53bd7c){logger[_0x8405('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x1322e5,_0x8405('0xe'));logger[_0x8405('0xf')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x1322e5,_0x8405('0xe'),JSON[_0x8405('0x10')](_0x53bd7c));if(_0x53bd7c['error']){if(_0x53bd7c['error']['code']===0x1f4){logger['error'](_0x8405('0x11'),_0x1322e5,_0x53bd7c['error']['message']);return _0x16d810(_0x53bd7c['error']['message']);}logger['error'](_0x8405('0x11'),_0x1322e5,_0x53bd7c[_0x8405('0x12')]['message']);return _0x479c97(_0x53bd7c[_0x8405('0x12')][_0x8405('0x13')]);}else{logger[_0x8405('0xd')](_0x8405('0x11'),_0x1322e5,'request\x20sent');_0x479c97(_0x53bd7c[_0x8405('0x14')][_0x8405('0x13')]);}})[_0x8405('0x15')](function(_0x30cef7){logger[_0x8405('0x12')](_0x8405('0x11'),_0x1322e5,_0x30cef7);_0x16d810(_0x30cef7);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 36a5353..aabc4da 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 _0x627d=['put','update','delete','exports','multer','util','connect-timeout','../../components/auth/service','./voiceContext.controller','isAuthenticated','index','get','/:id','post','create'];(function(_0x1ca29f,_0x318ac5){var _0x576c3b=function(_0x40caab){while(--_0x40caab){_0x1ca29f['push'](_0x1ca29f['shift']());}};_0x576c3b(++_0x318ac5);}(_0x627d,0x121));var _0xd627=function(_0x15294d,_0x4aeea6){_0x15294d=_0x15294d-0x0;var _0x3b29d1=_0x627d[_0x15294d];return _0x3b29d1;};'use strict';var multer=require(_0xd627('0x0'));var util=require(_0xd627('0x1'));var path=require('path');var timeout=require(_0xd627('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd627('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd627('0x4'));router['get']('/',auth[_0xd627('0x5')](),controller[_0xd627('0x6')]);router[_0xd627('0x7')](_0xd627('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xd627('0x9')]('/',auth[_0xd627('0x5')](),controller[_0xd627('0xa')]);router[_0xd627('0xb')](_0xd627('0x8'),auth['isAuthenticated'](),controller[_0xd627('0xc')]);router[_0xd627('0xd')](_0xd627('0x8'),auth[_0xd627('0x5')](),controller['destroy']);module[_0xd627('0xe')]=router; \ No newline at end of file +var _0x6c2c=['put','/:id','update','exports','multer','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','show','post'];(function(_0x5b188c,_0x40e26b){var _0x42920b=function(_0x737788){while(--_0x737788){_0x5b188c['push'](_0x5b188c['shift']());}};_0x42920b(++_0x40e26b);}(_0x6c2c,0x66));var _0xc6c2=function(_0x5b1c80,_0x2711e0){_0x5b1c80=_0x5b1c80-0x0;var _0x1d76fa=_0x6c2c[_0x5b1c80];return _0x1d76fa;};'use strict';var multer=require(_0xc6c2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc6c2('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc6c2('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xc6c2('0x3'));var config=require(_0xc6c2('0x4'));var controller=require(_0xc6c2('0x5'));router[_0xc6c2('0x6')]('/',auth[_0xc6c2('0x7')](),controller['index']);router[_0xc6c2('0x6')]('/:id',auth[_0xc6c2('0x7')](),controller[_0xc6c2('0x8')]);router[_0xc6c2('0x9')]('/',auth[_0xc6c2('0x7')](),controller['create']);router[_0xc6c2('0xa')](_0xc6c2('0xb'),auth[_0xc6c2('0x7')](),controller[_0xc6c2('0xc')]);router['delete'](_0xc6c2('0xb'),auth[_0xc6c2('0x7')](),controller['destroy']);module[_0xc6c2('0xd')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 534e88a..a4b6c7b 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 _0xfc62=['sequelize','exports','name'];(function(_0x49cb32,_0x1633af){var _0x4a17f0=function(_0x31f32f){while(--_0x31f32f){_0x49cb32['push'](_0x49cb32['shift']());}};_0x4a17f0(++_0x1633af);}(_0xfc62,0x159));var _0x2fc6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xfc62[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x2fc6('0x0'));module[_0x2fc6('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2fc6('0x2')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xf2b5=['STRING','BOOLEAN','exports'];(function(_0x422ae7,_0x26f223){var _0x53f008=function(_0x1f76f6){while(--_0x1f76f6){_0x422ae7['push'](_0x422ae7['shift']());}};_0x53f008(++_0x26f223);}(_0xf2b5,0xa1));var _0x5f2b=function(_0x333767,_0x3e6f9c){_0x333767=_0x333767-0x0;var _0x51661b=_0xf2b5[_0x333767];return _0x51661b;};'use strict';var Sequelize=require('sequelize');module[_0x5f2b('0x0')]={'name':{'type':Sequelize[_0x5f2b('0x1')],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x5f2b('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 6f27d67..00d2c74 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 _0x5540=['fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','include','rows','show','params','includeAll','merge','options','create','body','readFileSync','join','root','utf8','writeFileSync','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','server/files/templates/context.ejs','/etc/asterisk/extensions_xcally_contexts.conf','findAll','render','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','then','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','reject','update','destroy','get','UserProfileResource','end','name','send','index','map','VoiceContext','rawAttributes'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x5540,0x92));var _0x0554=function(_0x265021,_0x455fa5){_0x265021=_0x265021-0x0;var _0x106a05=_0x5540[_0x265021];return _0x106a05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0554('0x0'));var zipdir=require(_0x0554('0x1'));var jsonpatch=require(_0x0554('0x2'));var rp=require(_0x0554('0x3'));var moment=require(_0x0554('0x4'));var BPromise=require(_0x0554('0x5'));var Mustache=require('mustache');var util=require(_0x0554('0x6'));var path=require(_0x0554('0x7'));var sox=require(_0x0554('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0554('0x9'));var _=require(_0x0554('0xa'));var squel=require(_0x0554('0xb'));var crypto=require('crypto');var jsforce=require(_0x0554('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0554('0xd'));var querystring=require(_0x0554('0xe'));var Papa=require(_0x0554('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0554('0x10'));var as=require(_0x0554('0x11'));var hardwareService=require(_0x0554('0x12'));var logger=require(_0x0554('0x13'))(_0x0554('0x14'));var utils=require(_0x0554('0x15'));var config=require(_0x0554('0x16'));var licenseUtil=require(_0x0554('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x0554('0x18'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3d7840,_0x1cba65,_0x506ade,_0x8408b5){return new BPromise(function(_0xf29e18,_0x33b76d){var _0x37bdab=_0x8408b5||client;return _0x37bdab['request'](_0x3d7840,_0x506ade)[_0x0554('0x19')](function(_0x578517){logger['info']('VoiceContext,\x20%s,\x20%s',_0x1cba65,_0x0554('0x1a'));logger[_0x0554('0x1b')](_0x0554('0x1c'),_0x1cba65,_0x0554('0x1a'),JSON[_0x0554('0x1d')](_0x578517));if(_0x578517['error']){if(_0x578517[_0x0554('0x1e')][_0x0554('0x1f')]===0x1f4){logger[_0x0554('0x1e')](_0x0554('0x20'),_0x1cba65,_0x578517[_0x0554('0x1e')][_0x0554('0x21')]);return _0x33b76d(_0x578517['error'][_0x0554('0x21')]);}logger[_0x0554('0x1e')](_0x0554('0x20'),_0x1cba65,_0x578517[_0x0554('0x1e')][_0x0554('0x21')]);return _0xf29e18(_0x578517[_0x0554('0x1e')]['message']);}else{logger[_0x0554('0x22')]('VoiceContext,\x20%s,\x20%s',_0x1cba65,_0x0554('0x1a'));_0xf29e18(_0x578517[_0x0554('0x23')][_0x0554('0x21')]);}})[_0x0554('0x24')](function(_0x15979c){logger[_0x0554('0x1e')](_0x0554('0x20'),_0x1cba65,_0x15979c);_0x33b76d(_0x15979c);});});}function respondWithStatusCode(_0x3f980c,_0x180012){_0x180012=_0x180012||0xcc;return function(_0xa192ea){if(_0xa192ea){return _0x3f980c[_0x0554('0x25')](_0x180012);}return _0x3f980c['status'](_0x180012)['end']();};}function respondWithResult(_0x59cdc9,_0x6a0c28){_0x6a0c28=_0x6a0c28||0xc8;return function(_0x55b037){if(_0x55b037){return _0x59cdc9[_0x0554('0x26')](_0x6a0c28)['json'](_0x55b037);}};}function respondWithFilteredResult(_0x19c927,_0x5087a8){return function(_0x55c162){if(_0x55c162){var _0x4fcffb=typeof _0x5087a8[_0x0554('0x27')]==='undefined'&&typeof _0x5087a8[_0x0554('0x28')]===_0x0554('0x29');var _0x12c08b=_0x55c162['count'];var _0x5c5e82=_0x4fcffb?0x0:_0x5087a8[_0x0554('0x27')];var _0x2e1082=_0x4fcffb?_0x55c162[_0x0554('0x2a')]:_0x5087a8[_0x0554('0x27')]+_0x5087a8[_0x0554('0x28')];var _0x468386;if(_0x2e1082>=_0x12c08b){_0x2e1082=_0x12c08b;_0x468386=0xc8;}else{_0x468386=0xce;}_0x19c927[_0x0554('0x26')](_0x468386);return _0x19c927[_0x0554('0x2b')](_0x0554('0x2c'),_0x5c5e82+'-'+_0x2e1082+'/'+_0x12c08b)[_0x0554('0x2d')](_0x55c162);}return null;};}function patchUpdates(_0x3f7b93){return function(_0x5ad895){try{jsonpatch['apply'](_0x5ad895,_0x3f7b93,!![]);}catch(_0x4825c2){return BPromise[_0x0554('0x2e')](_0x4825c2);}return _0x5ad895['save']();};}function saveUpdates(_0x4e30da,_0x68b844){return function(_0x1b78c6){if(_0x1b78c6){return _0x1b78c6[_0x0554('0x2f')](_0x4e30da)[_0x0554('0x19')](function(_0xb56068){return _0xb56068;});}return null;};}function removeEntity(_0x2cb6de,_0x463a47){return function(_0x4f8252){if(_0x4f8252){return _0x4f8252[_0x0554('0x30')]()[_0x0554('0x19')](function(){var _0x11d133=_0x4f8252[_0x0554('0x31')]({'plain':!![]});var _0x5db543='Contexts';return db[_0x0554('0x32')][_0x0554('0x30')]({'where':{'type':_0x5db543,'resourceId':_0x11d133['id']}})['then'](function(){return _0x4f8252;});})['then'](function(){_0x2cb6de[_0x0554('0x26')](0xcc)[_0x0554('0x33')]();});}};}function handleEntityNotFound(_0x2ef15b,_0x36390f){return function(_0x9edca0){if(!_0x9edca0){_0x2ef15b[_0x0554('0x25')](0x194);}return _0x9edca0;};}function handleError(_0x53a277,_0xbd1adc){_0xbd1adc=_0xbd1adc||0x1f4;return function(_0x26e5b0){logger[_0x0554('0x1e')](_0x26e5b0['stack']);if(_0x26e5b0[_0x0554('0x34')]){delete _0x26e5b0['name'];}_0x53a277['status'](_0xbd1adc)[_0x0554('0x35')](_0x26e5b0);};}exports[_0x0554('0x36')]=function(_0x32e176,_0x4e78e5){var _0x332a95={},_0x48a5da={},_0x111966={'count':0x0,'rows':[]};var _0x4e1a90=_[_0x0554('0x37')](db[_0x0554('0x38')][_0x0554('0x39')],function(_0x37a0aa){return{'name':_0x37a0aa[_0x0554('0x3a')],'type':_0x37a0aa[_0x0554('0x3b')]['key']};});_0x48a5da[_0x0554('0x3c')]=_['map'](_0x4e1a90,_0x0554('0x34'));_0x48a5da[_0x0554('0x3d')]=_[_0x0554('0x3e')](_0x32e176[_0x0554('0x3d')]);_0x48a5da['filters']=_[_0x0554('0x3f')](_0x48a5da[_0x0554('0x3c')],_0x48a5da[_0x0554('0x3d')]);_0x332a95[_0x0554('0x40')]=_[_0x0554('0x3f')](_0x48a5da[_0x0554('0x3c')],qs['fields'](_0x32e176[_0x0554('0x3d')][_0x0554('0x41')]));_0x332a95['attributes']=_0x332a95['attributes'][_0x0554('0x42')]?_0x332a95[_0x0554('0x40')]:_0x48a5da['model'];if(!_0x32e176[_0x0554('0x3d')][_0x0554('0x43')](_0x0554('0x44'))){_0x332a95['limit']=qs[_0x0554('0x28')](_0x32e176['query']['limit']);_0x332a95['offset']=qs[_0x0554('0x27')](_0x32e176[_0x0554('0x3d')][_0x0554('0x27')]);}_0x332a95['order']=qs[_0x0554('0x45')](_0x32e176[_0x0554('0x3d')][_0x0554('0x45')]);_0x332a95[_0x0554('0x46')]=qs[_0x0554('0x47')](_[_0x0554('0x48')](_0x32e176[_0x0554('0x3d')],_0x48a5da[_0x0554('0x47')]),_0x4e1a90);if(_0x32e176[_0x0554('0x3d')][_0x0554('0x49')]){_0x332a95[_0x0554('0x46')]=_['merge'](_0x332a95[_0x0554('0x46')],{'$or':_[_0x0554('0x37')](_0x4e1a90,function(_0x4044fa){if(_0x4044fa['type']!==_0x0554('0x4a')){var _0x80dd8f={};_0x80dd8f[_0x4044fa[_0x0554('0x34')]]={'$like':'%'+_0x32e176[_0x0554('0x3d')][_0x0554('0x49')]+'%'};return _0x80dd8f;}})});}_0x332a95=_['merge']({},_0x332a95,_0x32e176['options']);var _0x446e72={'where':_0x332a95['where']};return db[_0x0554('0x38')][_0x0554('0x2a')](_0x446e72)[_0x0554('0x19')](function(_0x30488b){_0x111966[_0x0554('0x2a')]=_0x30488b;if(_0x32e176[_0x0554('0x3d')]['includeAll']){_0x332a95[_0x0554('0x4b')]=[{'all':!![]}];}return db['VoiceContext']['findAll'](_0x332a95);})[_0x0554('0x19')](function(_0x50aa24){_0x111966[_0x0554('0x4c')]=_0x50aa24;return _0x111966;})[_0x0554('0x19')](respondWithFilteredResult(_0x4e78e5,_0x332a95))['catch'](handleError(_0x4e78e5,null));};exports[_0x0554('0x4d')]=function(_0x4e0b9b,_0x571938){var _0x1ca12a={'raw':![],'where':{'id':_0x4e0b9b[_0x0554('0x4e')]['id']}},_0x4c4013={};_0x4c4013['model']=_[_0x0554('0x3e')](db[_0x0554('0x38')][_0x0554('0x39')]);_0x4c4013[_0x0554('0x3d')]=_['keys'](_0x4e0b9b['query']);_0x4c4013['filters']=_[_0x0554('0x3f')](_0x4c4013[_0x0554('0x3c')],_0x4c4013[_0x0554('0x3d')]);_0x1ca12a['attributes']=_['intersection'](_0x4c4013[_0x0554('0x3c')],qs[_0x0554('0x41')](_0x4e0b9b[_0x0554('0x3d')]['fields']));_0x1ca12a[_0x0554('0x40')]=_0x1ca12a[_0x0554('0x40')][_0x0554('0x42')]?_0x1ca12a['attributes']:_0x4c4013['model'];if(_0x4e0b9b[_0x0554('0x3d')][_0x0554('0x4f')]){_0x1ca12a['include']=[{'all':!![]}];}_0x1ca12a=_[_0x0554('0x50')]({},_0x1ca12a,_0x4e0b9b[_0x0554('0x51')]);return db[_0x0554('0x38')]['find'](_0x1ca12a)[_0x0554('0x19')](handleEntityNotFound(_0x571938,null))[_0x0554('0x19')](respondWithResult(_0x571938,null))[_0x0554('0x24')](handleError(_0x571938,null));};exports[_0x0554('0x52')]=function(_0x40fed2,_0x27052c,_0x366ad4){var _0x4876ec;return db[_0x0554('0x38')][_0x0554('0x52')](_0x40fed2[_0x0554('0x53')],{'raw':!![]})[_0x0554('0x19')](function(_0x2910fc){_0x4876ec=_0x2910fc;return db[_0x0554('0x38')]['findAll']({'raw':!![]});})[_0x0554('0x19')](function(_0x5beaa){var _0x23f790=fs[_0x0554('0x54')](path[_0x0554('0x55')](config[_0x0554('0x56')],'server/files/templates/context.ejs'),_0x0554('0x57'));var _0x62d47a=ejs['render'](_0x23f790,{'contexts':_0x5beaa||[]});fs[_0x0554('0x58')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x62d47a);})[_0x0554('0x19')](function(){return respondWithRpcPromise(_0x0554('0x59'),_0x0554('0x52'),{'module':_0x0554('0x5a')});})[_0x0554('0x19')](function(){var _0x3f0b34=_0x40fed2['user'][_0x0554('0x31')]({'plain':!![]});if(!_0x3f0b34)throw new Error(_0x0554('0x5b'));if(_0x3f0b34[_0x0554('0x5c')]===_0x0554('0x5d')){var _0x1d2c5d=_0x4876ec[_0x0554('0x31')]({'plain':!![]});return db[_0x0554('0x5e')]['find']({'where':{'name':'Contexts','userProfileId':_0x3f0b34['userProfileId']},'raw':!![]})[_0x0554('0x19')](function(_0x411b0c){if(_0x411b0c&&_0x411b0c[_0x0554('0x5f')]===0x0){return db[_0x0554('0x32')][_0x0554('0x52')]({'name':_0x1d2c5d[_0x0554('0x34')],'resourceId':_0x1d2c5d['id'],'type':_0x411b0c[_0x0554('0x34')],'sectionId':_0x411b0c['id']},{})['then'](function(){return _0x4876ec;});}else{return _0x4876ec;}})[_0x0554('0x24')](function(_0x43f81c){logger[_0x0554('0x1e')](_0x0554('0x60'),_0x43f81c);throw _0x43f81c;});}return _0x4876ec;})[_0x0554('0x19')](respondWithResult(_0x27052c,0xc9))[_0x0554('0x24')](handleError(_0x27052c,null));};exports['update']=function(_0x2afa1f,_0x3e128f,_0x3ca2e2){var _0x9a886d;return db[_0x0554('0x38')][_0x0554('0x61')]({'where':{'id':_0x2afa1f[_0x0554('0x4e')]['id']}})[_0x0554('0x19')](handleEntityNotFound(_0x3e128f,null))[_0x0554('0x19')](saveUpdates(_0x2afa1f[_0x0554('0x53')],null))[_0x0554('0x19')](function(_0x50d564){if(_0x50d564){_0x9a886d=_0x50d564;return db[_0x0554('0x38')]['findAll']({'raw':!![]});}})[_0x0554('0x19')](function(_0x33e262){var _0x558bfc=fs['readFileSync'](path[_0x0554('0x55')](config['root'],_0x0554('0x62')),_0x0554('0x57'));var _0x5c7066=ejs['render'](_0x558bfc,{'contexts':_0x33e262||[]});fs[_0x0554('0x58')](_0x0554('0x63'),_0x5c7066);})[_0x0554('0x19')](function(){return respondWithRpcPromise(_0x0554('0x59'),_0x0554('0x2f'),{'module':_0x0554('0x5a')});})['then'](function(){return _0x9a886d;})['then'](respondWithResult(_0x3e128f,null))[_0x0554('0x24')](handleError(_0x3e128f,null));};exports[_0x0554('0x30')]=function(_0x1241aa,_0x354bee,_0x4ca8fb){var _0x578fbc;return db['VoiceContext'][_0x0554('0x61')]({'where':{'id':_0x1241aa[_0x0554('0x4e')]['id']}})[_0x0554('0x19')](handleEntityNotFound(_0x354bee,null))['then'](removeEntity(_0x354bee,null))[_0x0554('0x19')](function(){return db['VoiceContext'][_0x0554('0x64')]({'raw':!![]});})['then'](function(_0x48422f){var _0x707bee=fs[_0x0554('0x54')](path[_0x0554('0x55')](config[_0x0554('0x56')],_0x0554('0x62')),_0x0554('0x57'));var _0x17d0cd=ejs[_0x0554('0x65')](_0x707bee,{'contexts':_0x48422f});fs[_0x0554('0x58')](_0x0554('0x63'),_0x17d0cd);return respondWithRpcPromise(_0x0554('0x59'),_0x0554('0x30'),{'module':_0x0554('0x5a')});})[_0x0554('0x24')](handleError(_0x354bee,null));}; \ No newline at end of file +var _0x57a1=['jayson/promise','client','request','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','offset','undefined','limit','Content-Range','json','apply','reject','save','update','then','destroy','Contexts','UserProfileResource','sendStatus','stack','name','send','index','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','VoiceContext','count','includeAll','findAll','rows','show','params','rawAttributes','include','find','create','body','readFileSync','join','root','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/context.ejs','writeFileSync','eml-format','rimraf','zip-dir','request-promise','moment','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x2eb5bc,_0x4634c6){var _0x51c7b1=function(_0x1af430){while(--_0x1af430){_0x2eb5bc['push'](_0x2eb5bc['shift']());}};_0x51c7b1(++_0x4634c6);}(_0x57a1,0x129));var _0x157a=function(_0x11fb16,_0x29a381){_0x11fb16=_0x11fb16-0x0;var _0x343de1=_0x57a1[_0x11fb16];return _0x343de1;};'use strict';var emlformat=require(_0x157a('0x0'));var rimraf=require(_0x157a('0x1'));var zipdir=require(_0x157a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x157a('0x3'));var moment=require(_0x157a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x157a('0x5'));var util=require('util');var path=require('path');var sox=require(_0x157a('0x6'));var csv=require('to-csv');var ejs=require(_0x157a('0x7'));var fs=require('fs');var fs_extra=require(_0x157a('0x8'));var _=require(_0x157a('0x9'));var squel=require(_0x157a('0xa'));var crypto=require(_0x157a('0xb'));var jsforce=require(_0x157a('0xc'));var deskjs=require(_0x157a('0xd'));var toCsv=require(_0x157a('0xe'));var querystring=require('querystring');var Papa=require(_0x157a('0xf'));var Redis=require(_0x157a('0x10'));var authService=require(_0x157a('0x11'));var qs=require(_0x157a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x157a('0x13'));var logger=require('../../config/logger')(_0x157a('0x14'));var utils=require('../../config/utils');var config=require(_0x157a('0x15'));var licenseUtil=require(_0x157a('0x16'));var db=require(_0x157a('0x17'))['db'];var jayson=require(_0x157a('0x18'));var client=jayson[_0x157a('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e9df5,_0x15ed3a,_0x831100,_0x462e5d){return new BPromise(function(_0x27f5d2,_0x5a5b2b){var _0x3d47d4=_0x462e5d||client;return _0x3d47d4[_0x157a('0x1a')](_0x5e9df5,_0x831100)['then'](function(_0x2c1fd1){logger[_0x157a('0x1b')](_0x157a('0x1c'),_0x15ed3a,'request\x20sent');logger[_0x157a('0x1d')](_0x157a('0x1e'),_0x15ed3a,_0x157a('0x1f'),JSON[_0x157a('0x20')](_0x2c1fd1));if(_0x2c1fd1['error']){if(_0x2c1fd1[_0x157a('0x21')][_0x157a('0x22')]===0x1f4){logger[_0x157a('0x21')](_0x157a('0x1c'),_0x15ed3a,_0x2c1fd1[_0x157a('0x21')][_0x157a('0x23')]);return _0x5a5b2b(_0x2c1fd1[_0x157a('0x21')][_0x157a('0x23')]);}logger[_0x157a('0x21')]('VoiceContext,\x20%s,\x20%s',_0x15ed3a,_0x2c1fd1[_0x157a('0x21')][_0x157a('0x23')]);return _0x27f5d2(_0x2c1fd1[_0x157a('0x21')][_0x157a('0x23')]);}else{logger[_0x157a('0x1b')](_0x157a('0x1c'),_0x15ed3a,_0x157a('0x1f'));_0x27f5d2(_0x2c1fd1['result'][_0x157a('0x23')]);}})[_0x157a('0x24')](function(_0x2f0082){logger['error'](_0x157a('0x1c'),_0x15ed3a,_0x2f0082);_0x5a5b2b(_0x2f0082);});});}function respondWithStatusCode(_0x55bec4,_0x12820d){_0x12820d=_0x12820d||0xcc;return function(_0x717081){if(_0x717081){return _0x55bec4['sendStatus'](_0x12820d);}return _0x55bec4['status'](_0x12820d)['end']();};}function respondWithResult(_0x2613b8,_0x3c89a9){_0x3c89a9=_0x3c89a9||0xc8;return function(_0x32190f){if(_0x32190f){return _0x2613b8[_0x157a('0x25')](_0x3c89a9)['json'](_0x32190f);}};}function respondWithFilteredResult(_0x2d865a,_0x39b270){return function(_0x3f089c){if(_0x3f089c){var _0x324f55=typeof _0x39b270[_0x157a('0x26')]===_0x157a('0x27')&&typeof _0x39b270[_0x157a('0x28')]===_0x157a('0x27');var _0x253d87=_0x3f089c['count'];var _0x53df7b=_0x324f55?0x0:_0x39b270[_0x157a('0x26')];var _0x3e2209=_0x324f55?_0x3f089c['count']:_0x39b270[_0x157a('0x26')]+_0x39b270[_0x157a('0x28')];var _0x377302;if(_0x3e2209>=_0x253d87){_0x3e2209=_0x253d87;_0x377302=0xc8;}else{_0x377302=0xce;}_0x2d865a['status'](_0x377302);return _0x2d865a['set'](_0x157a('0x29'),_0x53df7b+'-'+_0x3e2209+'/'+_0x253d87)[_0x157a('0x2a')](_0x3f089c);}return null;};}function patchUpdates(_0x5000e8){return function(_0xbd6979){try{jsonpatch[_0x157a('0x2b')](_0xbd6979,_0x5000e8,!![]);}catch(_0x560f49){return BPromise[_0x157a('0x2c')](_0x560f49);}return _0xbd6979[_0x157a('0x2d')]();};}function saveUpdates(_0x1c408d,_0x397c46){return function(_0x602594){if(_0x602594){return _0x602594[_0x157a('0x2e')](_0x1c408d)[_0x157a('0x2f')](function(_0x2b18dc){return _0x2b18dc;});}return null;};}function removeEntity(_0x5a09f0,_0x1c04b6){return function(_0x59980b){if(_0x59980b){return _0x59980b[_0x157a('0x30')]()[_0x157a('0x2f')](function(){var _0x28da8c=_0x59980b['get']({'plain':!![]});var _0xeca337=_0x157a('0x31');return db[_0x157a('0x32')]['destroy']({'where':{'type':_0xeca337,'resourceId':_0x28da8c['id']}})[_0x157a('0x2f')](function(){return _0x59980b;});})[_0x157a('0x2f')](function(){_0x5a09f0[_0x157a('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45dc05,_0x26b6db){return function(_0x19e210){if(!_0x19e210){_0x45dc05[_0x157a('0x33')](0x194);}return _0x19e210;};}function handleError(_0x11e240,_0x253811){_0x253811=_0x253811||0x1f4;return function(_0x33a1e4){logger[_0x157a('0x21')](_0x33a1e4[_0x157a('0x34')]);if(_0x33a1e4[_0x157a('0x35')]){delete _0x33a1e4[_0x157a('0x35')];}_0x11e240['status'](_0x253811)[_0x157a('0x36')](_0x33a1e4);};}exports[_0x157a('0x37')]=function(_0x1c3244,_0x1b765a){var _0x5677c2={},_0x2cb2b0={},_0x36f0dc={'count':0x0,'rows':[]};var _0x5eac24=_['map'](db['VoiceContext']['rawAttributes'],function(_0x4eafcb){return{'name':_0x4eafcb['fieldName'],'type':_0x4eafcb[_0x157a('0x38')][_0x157a('0x39')]};});_0x2cb2b0[_0x157a('0x3a')]=_[_0x157a('0x3b')](_0x5eac24,'name');_0x2cb2b0[_0x157a('0x3c')]=_[_0x157a('0x3d')](_0x1c3244[_0x157a('0x3c')]);_0x2cb2b0[_0x157a('0x3e')]=_[_0x157a('0x3f')](_0x2cb2b0[_0x157a('0x3a')],_0x2cb2b0[_0x157a('0x3c')]);_0x5677c2[_0x157a('0x40')]=_[_0x157a('0x3f')](_0x2cb2b0[_0x157a('0x3a')],qs[_0x157a('0x41')](_0x1c3244['query']['fields']));_0x5677c2[_0x157a('0x40')]=_0x5677c2[_0x157a('0x40')][_0x157a('0x42')]?_0x5677c2[_0x157a('0x40')]:_0x2cb2b0[_0x157a('0x3a')];if(!_0x1c3244[_0x157a('0x3c')][_0x157a('0x43')](_0x157a('0x44'))){_0x5677c2[_0x157a('0x28')]=qs[_0x157a('0x28')](_0x1c3244[_0x157a('0x3c')][_0x157a('0x28')]);_0x5677c2[_0x157a('0x26')]=qs['offset'](_0x1c3244[_0x157a('0x3c')][_0x157a('0x26')]);}_0x5677c2[_0x157a('0x45')]=qs[_0x157a('0x46')](_0x1c3244[_0x157a('0x3c')][_0x157a('0x46')]);_0x5677c2[_0x157a('0x47')]=qs[_0x157a('0x3e')](_[_0x157a('0x48')](_0x1c3244[_0x157a('0x3c')],_0x2cb2b0['filters']),_0x5eac24);if(_0x1c3244['query'][_0x157a('0x49')]){_0x5677c2['where']=_['merge'](_0x5677c2['where'],{'$or':_[_0x157a('0x3b')](_0x5eac24,function(_0x201304){if(_0x201304[_0x157a('0x38')]!==_0x157a('0x4a')){var _0x5b8833={};_0x5b8833[_0x201304[_0x157a('0x35')]]={'$like':'%'+_0x1c3244['query'][_0x157a('0x49')]+'%'};return _0x5b8833;}})});}_0x5677c2=_[_0x157a('0x4b')]({},_0x5677c2,_0x1c3244[_0x157a('0x4c')]);var _0x4bbb93={'where':_0x5677c2[_0x157a('0x47')]};return db[_0x157a('0x4d')]['count'](_0x4bbb93)[_0x157a('0x2f')](function(_0x403d3c){_0x36f0dc[_0x157a('0x4e')]=_0x403d3c;if(_0x1c3244[_0x157a('0x3c')][_0x157a('0x4f')]){_0x5677c2['include']=[{'all':!![]}];}return db[_0x157a('0x4d')][_0x157a('0x50')](_0x5677c2);})[_0x157a('0x2f')](function(_0x5039c3){_0x36f0dc[_0x157a('0x51')]=_0x5039c3;return _0x36f0dc;})[_0x157a('0x2f')](respondWithFilteredResult(_0x1b765a,_0x5677c2))['catch'](handleError(_0x1b765a,null));};exports[_0x157a('0x52')]=function(_0x3a4192,_0x153654){var _0x2a6fc5={'raw':![],'where':{'id':_0x3a4192[_0x157a('0x53')]['id']}},_0x10623a={};_0x10623a['model']=_[_0x157a('0x3d')](db[_0x157a('0x4d')][_0x157a('0x54')]);_0x10623a['query']=_[_0x157a('0x3d')](_0x3a4192['query']);_0x10623a[_0x157a('0x3e')]=_[_0x157a('0x3f')](_0x10623a[_0x157a('0x3a')],_0x10623a[_0x157a('0x3c')]);_0x2a6fc5[_0x157a('0x40')]=_[_0x157a('0x3f')](_0x10623a[_0x157a('0x3a')],qs['fields'](_0x3a4192['query'][_0x157a('0x41')]));_0x2a6fc5[_0x157a('0x40')]=_0x2a6fc5['attributes'][_0x157a('0x42')]?_0x2a6fc5[_0x157a('0x40')]:_0x10623a['model'];if(_0x3a4192[_0x157a('0x3c')]['includeAll']){_0x2a6fc5[_0x157a('0x55')]=[{'all':!![]}];}_0x2a6fc5=_[_0x157a('0x4b')]({},_0x2a6fc5,_0x3a4192[_0x157a('0x4c')]);return db[_0x157a('0x4d')][_0x157a('0x56')](_0x2a6fc5)[_0x157a('0x2f')](handleEntityNotFound(_0x153654,null))[_0x157a('0x2f')](respondWithResult(_0x153654,null))[_0x157a('0x24')](handleError(_0x153654,null));};exports[_0x157a('0x57')]=function(_0x1b5316,_0x3bdbdb,_0x5d8251){var _0x221657;return db[_0x157a('0x4d')][_0x157a('0x57')](_0x1b5316[_0x157a('0x58')],{'raw':!![]})['then'](function(_0x32bf47){_0x221657=_0x32bf47;return db['VoiceContext'][_0x157a('0x50')]({'raw':!![]});})[_0x157a('0x2f')](function(_0x551325){var _0x27315c=fs[_0x157a('0x59')](path[_0x157a('0x5a')](config[_0x157a('0x5b')],'server/files/templates/context.ejs'),_0x157a('0x5c'));var _0x3f9990=ejs[_0x157a('0x5d')](_0x27315c,{'contexts':_0x551325||[]});fs['writeFileSync'](_0x157a('0x5e'),_0x3f9990);})['then'](function(){return respondWithRpcPromise(_0x157a('0x5f'),_0x157a('0x57'),{'module':_0x157a('0x60')});})[_0x157a('0x2f')](function(){var _0x439c41=_0x1b5316[_0x157a('0x61')][_0x157a('0x62')]({'plain':!![]});if(!_0x439c41)throw new Error(_0x157a('0x63'));if(_0x439c41[_0x157a('0x64')]===_0x157a('0x61')){var _0x1fa47a=_0x221657[_0x157a('0x62')]({'plain':!![]});return db[_0x157a('0x65')][_0x157a('0x56')]({'where':{'name':_0x157a('0x31'),'userProfileId':_0x439c41[_0x157a('0x66')]},'raw':!![]})[_0x157a('0x2f')](function(_0x559697){if(_0x559697&&_0x559697[_0x157a('0x67')]===0x0){return db[_0x157a('0x32')]['create']({'name':_0x1fa47a[_0x157a('0x35')],'resourceId':_0x1fa47a['id'],'type':_0x559697['name'],'sectionId':_0x559697['id']},{})[_0x157a('0x2f')](function(){return _0x221657;});}else{return _0x221657;}})[_0x157a('0x24')](function(_0x5e47a7){logger[_0x157a('0x21')](_0x157a('0x68'),_0x5e47a7);throw _0x5e47a7;});}return _0x221657;})[_0x157a('0x2f')](respondWithResult(_0x3bdbdb,0xc9))['catch'](handleError(_0x3bdbdb,null));};exports[_0x157a('0x2e')]=function(_0x430ea3,_0x19af02,_0x47f6da){var _0x50a94d;return db[_0x157a('0x4d')][_0x157a('0x56')]({'where':{'id':_0x430ea3[_0x157a('0x53')]['id']}})['then'](handleEntityNotFound(_0x19af02,null))[_0x157a('0x2f')](saveUpdates(_0x430ea3[_0x157a('0x58')],null))[_0x157a('0x2f')](function(_0x243117){if(_0x243117){_0x50a94d=_0x243117;return db[_0x157a('0x4d')][_0x157a('0x50')]({'raw':!![]});}})[_0x157a('0x2f')](function(_0x2095c4){var _0xb36dac=fs['readFileSync'](path[_0x157a('0x5a')](config[_0x157a('0x5b')],_0x157a('0x69')),'utf8');var _0x31b226=ejs['render'](_0xb36dac,{'contexts':_0x2095c4||[]});fs[_0x157a('0x6a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x31b226);})['then'](function(){return respondWithRpcPromise('Reload',_0x157a('0x2e'),{'module':'chan_sip.so'});})['then'](function(){return _0x50a94d;})[_0x157a('0x2f')](respondWithResult(_0x19af02,null))[_0x157a('0x24')](handleError(_0x19af02,null));};exports[_0x157a('0x30')]=function(_0x49a939,_0x18db7b,_0x57f45f){var _0x329fcd;return db['VoiceContext'][_0x157a('0x56')]({'where':{'id':_0x49a939[_0x157a('0x53')]['id']}})[_0x157a('0x2f')](handleEntityNotFound(_0x18db7b,null))['then'](removeEntity(_0x18db7b,null))[_0x157a('0x2f')](function(){return db['VoiceContext'][_0x157a('0x50')]({'raw':!![]});})[_0x157a('0x2f')](function(_0x5534b5){var _0x3416ed=fs['readFileSync'](path[_0x157a('0x5a')](config[_0x157a('0x5b')],_0x157a('0x69')),'utf8');var _0x11bbe7=ejs[_0x157a('0x5d')](_0x3416ed,{'contexts':_0x5534b5});fs[_0x157a('0x6a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x11bbe7);return respondWithRpcPromise(_0x157a('0x5f'),'destroy',{'module':_0x157a('0x60')});})[_0x157a('0x24')](handleError(_0x18db7b,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index d3d85e0..cbc6e53 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 _0xfeaf=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','voice_contexts','lodash','util','../../config/logger','moment'];(function(_0x24ff28,_0x3d7d7f){var _0x3e9555=function(_0x26b27e){while(--_0x26b27e){_0x24ff28['push'](_0x24ff28['shift']());}};_0x3e9555(++_0x3d7d7f);}(_0xfeaf,0x64));var _0xffea=function(_0x2bfdec,_0x596e9d){_0x2bfdec=_0x2bfdec-0x0;var _0x2409c6=_0xfeaf[_0x2bfdec];return _0x2409c6;};'use strict';var _=require(_0xffea('0x0'));var util=require(_0xffea('0x1'));var logger=require(_0xffea('0x2'))('api');var moment=require(_0xffea('0x3'));var BPromise=require(_0xffea('0x4'));var rp=require(_0xffea('0x5'));var fs=require('fs');var path=require(_0xffea('0x6'));var rimraf=require(_0xffea('0x7'));var config=require(_0xffea('0x8'));var attributes=require(_0xffea('0x9'));module[_0xffea('0xa')]=function(_0xd7c57b,_0x124fda){return _0xd7c57b[_0xffea('0xb')]('VoiceContext',attributes,{'tableName':_0xffea('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa2d0=['api','moment','path','../../config/environment','./voiceContext.attributes','exports','define','voice_contexts','lodash','util','../../config/logger'];(function(_0x10aa73,_0xc744f4){var _0x3496d9=function(_0x71c780){while(--_0x71c780){_0x10aa73['push'](_0x10aa73['shift']());}};_0x3496d9(++_0xc744f4);}(_0xa2d0,0x194));var _0x0a2d=function(_0x10e7c1,_0x133b00){_0x10e7c1=_0x10e7c1-0x0;var _0x2cfd6e=_0xa2d0[_0x10e7c1];return _0x2cfd6e;};'use strict';var _=require(_0x0a2d('0x0'));var util=require(_0x0a2d('0x1'));var logger=require(_0x0a2d('0x2'))(_0x0a2d('0x3'));var moment=require(_0x0a2d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a2d('0x5'));var rimraf=require('rimraf');var config=require(_0x0a2d('0x6'));var attributes=require(_0x0a2d('0x7'));module[_0x0a2d('0x8')]=function(_0x76ddeb,_0x50b9c6){return _0x76ddeb[_0x0a2d('0x9')]('VoiceContext',attributes,{'tableName':_0x0a2d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 05816ec..e63683b 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 _0xa1b9=['request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x52cb89,_0x5127d3){var _0x2bab6c=function(_0x1c9380){while(--_0x1c9380){_0x52cb89['push'](_0x52cb89['shift']());}};_0x2bab6c(++_0x5127d3);}(_0xa1b9,0x71));var _0x9a1b=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa1b9[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x9a1b('0x0'));var util=require('util');var moment=require(_0x9a1b('0x1'));var BPromise=require(_0x9a1b('0x2'));var rs=require(_0x9a1b('0x3'));var fs=require('fs');var Redis=require(_0x9a1b('0x4'));var db=require(_0x9a1b('0x5'))['db'];var utils=require(_0x9a1b('0x6'));var logger=require(_0x9a1b('0x7'))('rpc');var config=require(_0x9a1b('0x8'));var jayson=require(_0x9a1b('0x9'));var client=jayson[_0x9a1b('0xa')][_0x9a1b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47cb95,_0x185401,_0x534151){return new BPromise(function(_0x17b671,_0x4387ac){return client[_0x9a1b('0xc')](_0x47cb95,_0x534151)[_0x9a1b('0xd')](function(_0x1ddb9e){logger['info'](_0x9a1b('0xe'),_0x185401,_0x9a1b('0xf'));logger[_0x9a1b('0x10')](_0x9a1b('0x11'),_0x185401,_0x9a1b('0xf'),JSON[_0x9a1b('0x12')](_0x1ddb9e));if(_0x1ddb9e[_0x9a1b('0x13')]){if(_0x1ddb9e['error'][_0x9a1b('0x14')]===0x1f4){logger[_0x9a1b('0x13')](_0x9a1b('0xe'),_0x185401,_0x1ddb9e['error'][_0x9a1b('0x15')]);return _0x4387ac(_0x1ddb9e[_0x9a1b('0x13')][_0x9a1b('0x15')]);}logger[_0x9a1b('0x13')](_0x9a1b('0xe'),_0x185401,_0x1ddb9e[_0x9a1b('0x13')][_0x9a1b('0x15')]);return _0x17b671(_0x1ddb9e[_0x9a1b('0x13')][_0x9a1b('0x15')]);}else{logger[_0x9a1b('0x16')]('VoiceContext,\x20%s,\x20%s',_0x185401,_0x9a1b('0xf'));_0x17b671(_0x1ddb9e[_0x9a1b('0x17')]['message']);}})[_0x9a1b('0x18')](function(_0xbac830){logger[_0x9a1b('0x13')](_0x9a1b('0xe'),_0x185401,_0xbac830);_0x4387ac(_0xbac830);});});} \ No newline at end of file +var _0xdc25=['http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdc25,0x128));var _0x5dc2=function(_0x12c433,_0x4e7fb5){_0x12c433=_0x12c433-0x0;var _0x73650b=_0xdc25[_0x12c433];return _0x73650b;};'use strict';var _=require(_0x5dc2('0x0'));var util=require(_0x5dc2('0x1'));var moment=require(_0x5dc2('0x2'));var BPromise=require(_0x5dc2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5dc2('0x4'));var db=require(_0x5dc2('0x5'))['db'];var utils=require(_0x5dc2('0x6'));var logger=require(_0x5dc2('0x7'))(_0x5dc2('0x8'));var config=require(_0x5dc2('0x9'));var jayson=require(_0x5dc2('0xa'));var client=jayson[_0x5dc2('0xb')][_0x5dc2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x37ae21,_0x116bab,_0xa4f8a6){return new BPromise(function(_0x11c861,_0x3d111f){return client['request'](_0x37ae21,_0xa4f8a6)[_0x5dc2('0xd')](function(_0x4c9f63){logger[_0x5dc2('0xe')](_0x5dc2('0xf'),_0x116bab,_0x5dc2('0x10'));logger['debug'](_0x5dc2('0x11'),_0x116bab,_0x5dc2('0x10'),JSON['stringify'](_0x4c9f63));if(_0x4c9f63[_0x5dc2('0x12')]){if(_0x4c9f63[_0x5dc2('0x12')]['code']===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x116bab,_0x4c9f63[_0x5dc2('0x12')][_0x5dc2('0x13')]);return _0x3d111f(_0x4c9f63[_0x5dc2('0x12')][_0x5dc2('0x13')]);}logger[_0x5dc2('0x12')](_0x5dc2('0xf'),_0x116bab,_0x4c9f63['error'][_0x5dc2('0x13')]);return _0x11c861(_0x4c9f63['error'][_0x5dc2('0x13')]);}else{logger[_0x5dc2('0xe')](_0x5dc2('0xf'),_0x116bab,_0x5dc2('0x10'));_0x11c861(_0x4c9f63[_0x5dc2('0x14')][_0x5dc2('0x13')]);}})[_0x5dc2('0x15')](function(_0x137da2){logger['error'](_0x5dc2('0xf'),_0x116bab,_0x137da2);_0x3d111f(_0x137da2);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 4c0ecc6..6f5ae21 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 _0x8c5c=['delete','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x171fdc,_0x16ae91){var _0x3782ea=function(_0x58b691){while(--_0x58b691){_0x171fdc['push'](_0x171fdc['shift']());}};_0x3782ea(++_0x16ae91);}(_0x8c5c,0x7f));var _0xc8c5=function(_0x152c44,_0x3ca042){_0x152c44=_0x152c44-0x0;var _0x18bb77=_0x8c5c[_0x152c44];return _0x18bb77;};'use strict';var multer=require('multer');var util=require(_0xc8c5('0x0'));var path=require('path');var timeout=require(_0xc8c5('0x1'));var express=require('express');var router=express[_0xc8c5('0x2')]();var fs_extra=require(_0xc8c5('0x3'));var auth=require(_0xc8c5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc8c5('0x5'));var controller=require(_0xc8c5('0x6'));router[_0xc8c5('0x7')]('/',auth[_0xc8c5('0x8')](),controller[_0xc8c5('0x9')]);router[_0xc8c5('0x7')](_0xc8c5('0xa'),auth['isAuthenticated'](),controller[_0xc8c5('0xb')]);router[_0xc8c5('0x7')](_0xc8c5('0xc'),auth[_0xc8c5('0x8')](),controller[_0xc8c5('0xd')]);router[_0xc8c5('0xe')]('/',auth[_0xc8c5('0x8')](),controller[_0xc8c5('0xf')]);router[_0xc8c5('0x10')]('/:id',auth[_0xc8c5('0x8')](),controller['update']);router[_0xc8c5('0x11')](_0xc8c5('0xc'),auth[_0xc8c5('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8e0d=['put','update','delete','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0x23d210,_0x29a5be){var _0x4e2972=function(_0x1b2bc1){while(--_0x1b2bc1){_0x23d210['push'](_0x23d210['shift']());}};_0x4e2972(++_0x29a5be);}(_0x8e0d,0x82));var _0xd8e0=function(_0x258b93,_0x188ccc){_0x258b93=_0x258b93-0x0;var _0x35484b=_0x8e0d[_0x258b93];return _0x35484b;};'use strict';var multer=require(_0xd8e0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd8e0('0x1'));var express=require(_0xd8e0('0x2'));var router=express['Router']();var fs_extra=require(_0xd8e0('0x3'));var auth=require(_0xd8e0('0x4'));var interaction=require(_0xd8e0('0x5'));var config=require(_0xd8e0('0x6'));var controller=require('./voiceDialReport.controller');router['get']('/',auth[_0xd8e0('0x7')](),controller[_0xd8e0('0x8')]);router[_0xd8e0('0x9')](_0xd8e0('0xa'),auth['isAuthenticated'](),controller[_0xd8e0('0xb')]);router[_0xd8e0('0x9')](_0xd8e0('0xc'),auth[_0xd8e0('0x7')](),controller[_0xd8e0('0xd')]);router['post']('/',auth[_0xd8e0('0x7')](),controller['create']);router[_0xd8e0('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xd8e0('0xf')]);router[_0xd8e0('0x10')](_0xd8e0('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xd8e0('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index b499b95..7d2dbd8 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 _0x24ca=['STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x4b80dc,_0x2ecc32){var _0x9cd547=function(_0x2c5e92){while(--_0x2c5e92){_0x4b80dc['push'](_0x4b80dc['shift']());}};_0x9cd547(++_0x2ecc32);}(_0x24ca,0x1bc));var _0xa24c=function(_0x1d7300,_0x17f109){_0x1d7300=_0x1d7300-0x0;var _0x46ee98=_0x24ca[_0x1d7300];return _0x46ee98;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xa24c('0x1')]},'channel':{'type':Sequelize[_0xa24c('0x1')]},'channelstate':{'type':Sequelize[_0xa24c('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xa24c('0x1')]},'calleridname':{'type':Sequelize[_0xa24c('0x1')]},'connectedlinenum':{'type':Sequelize[_0xa24c('0x1')]},'connectedlinename':{'type':Sequelize[_0xa24c('0x1')]},'language':{'type':Sequelize[_0xa24c('0x1')]},'accountcode':{'type':Sequelize[_0xa24c('0x1')]},'context':{'type':Sequelize[_0xa24c('0x1')]},'exten':{'type':Sequelize[_0xa24c('0x1')]},'priority':{'type':Sequelize[_0xa24c('0x2')]},'uniqueid':{'type':Sequelize[_0xa24c('0x1')]},'linkedid':{'type':Sequelize[_0xa24c('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xa24c('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xa24c('0x1')]},'destcalleridnum':{'type':Sequelize[_0xa24c('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xa24c('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xa24c('0x1')]},'destlanguage':{'type':Sequelize[_0xa24c('0x1')]},'destaccountcode':{'type':Sequelize[_0xa24c('0x1')]},'destcontext':{'type':Sequelize[_0xa24c('0x1')]},'destexten':{'type':Sequelize[_0xa24c('0x1')]},'destpriority':{'type':Sequelize[_0xa24c('0x2')]},'destuniqueid':{'type':Sequelize[_0xa24c('0x1')]},'destlinkedid':{'type':Sequelize[_0xa24c('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xa24c('0x1')]},'starttime':{'type':Sequelize[_0xa24c('0x3')]},'answertime':{'type':Sequelize[_0xa24c('0x3')]},'endtime':{'type':Sequelize[_0xa24c('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xa24c('0x4')},'routeId':{'type':Sequelize[_0xa24c('0x2')]},'duration':{'type':Sequelize[_0xa24c('0x2')]},'holdtime':{'type':Sequelize[_0xa24c('0x2')]},'billableseconds':{'type':Sequelize[_0xa24c('0x2')]}}; \ No newline at end of file +var _0x425d=['sequelize','STRING','INTEGER','DATE'];(function(_0x1adcde,_0x214221){var _0x39d6ad=function(_0x4c1338){while(--_0x4c1338){_0x1adcde['push'](_0x1adcde['shift']());}};_0x39d6ad(++_0x214221);}(_0x425d,0x1e0));var _0xd425=function(_0x261d18,_0x13490f){_0x261d18=_0x261d18-0x0;var _0x3e7208=_0x425d[_0x261d18];return _0x3e7208;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xd425('0x1')]},'channel':{'type':Sequelize[_0xd425('0x1')]},'channelstate':{'type':Sequelize[_0xd425('0x2')]},'channelstatedesc':{'type':Sequelize[_0xd425('0x1')]},'calleridnum':{'type':Sequelize[_0xd425('0x1')]},'calleridname':{'type':Sequelize[_0xd425('0x1')]},'connectedlinenum':{'type':Sequelize[_0xd425('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xd425('0x1')]},'accountcode':{'type':Sequelize[_0xd425('0x1')]},'context':{'type':Sequelize[_0xd425('0x1')]},'exten':{'type':Sequelize[_0xd425('0x1')]},'priority':{'type':Sequelize[_0xd425('0x2')]},'uniqueid':{'type':Sequelize[_0xd425('0x1')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xd425('0x1')]},'destchannelstate':{'type':Sequelize[_0xd425('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xd425('0x1')]},'destcalleridnum':{'type':Sequelize[_0xd425('0x1')]},'destcalleridname':{'type':Sequelize[_0xd425('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xd425('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xd425('0x1')]},'destlanguage':{'type':Sequelize[_0xd425('0x1')]},'destaccountcode':{'type':Sequelize[_0xd425('0x1')]},'destcontext':{'type':Sequelize[_0xd425('0x1')]},'destexten':{'type':Sequelize[_0xd425('0x1')]},'destpriority':{'type':Sequelize[_0xd425('0x2')]},'destuniqueid':{'type':Sequelize[_0xd425('0x1')]},'destlinkedid':{'type':Sequelize[_0xd425('0x1')]},'dialstring':{'type':Sequelize[_0xd425('0x1')]},'dialstatus':{'type':Sequelize[_0xd425('0x1')]},'starttime':{'type':Sequelize[_0xd425('0x3')]},'answertime':{'type':Sequelize[_0xd425('0x3')]},'endtime':{'type':Sequelize[_0xd425('0x3')]},'lastevent':{'type':Sequelize[_0xd425('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xd425('0x2')]},'duration':{'type':Sequelize[_0xd425('0x2')]},'holdtime':{'type':Sequelize[_0xd425('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 0d00189..b008549 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 _0x8bc7=['catch','show','params','includeAll','find','create','body','describe','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','stack','name','send','VoiceDialReport','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','type','VIRTUAL','options','count','include','findAll','rows'];(function(_0x1d5ee0,_0xb5ad2c){var _0x3435d0=function(_0x580b63){while(--_0x580b63){_0x1d5ee0['push'](_0x1d5ee0['shift']());}};_0x3435d0(++_0xb5ad2c);}(_0x8bc7,0x1be));var _0x78bc=function(_0x39f59c,_0x283547){_0x39f59c=_0x39f59c-0x0;var _0x21627f=_0x8bc7[_0x39f59c];return _0x21627f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x78bc('0x0'));var rp=require('request-promise');var moment=require(_0x78bc('0x1'));var BPromise=require(_0x78bc('0x2'));var Mustache=require('mustache');var util=require(_0x78bc('0x3'));var path=require(_0x78bc('0x4'));var sox=require(_0x78bc('0x5'));var csv=require('to-csv');var ejs=require(_0x78bc('0x6'));var fs=require('fs');var fs_extra=require(_0x78bc('0x7'));var _=require(_0x78bc('0x8'));var squel=require(_0x78bc('0x9'));var crypto=require(_0x78bc('0xa'));var jsforce=require(_0x78bc('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x78bc('0xc'));var Papa=require(_0x78bc('0xd'));var Redis=require(_0x78bc('0xe'));var authService=require(_0x78bc('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x78bc('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x78bc('0x11'))(_0x78bc('0x12'));var utils=require('../../config/utils');var config=require(_0x78bc('0x13'));var licenseUtil=require(_0x78bc('0x14'));var db=require(_0x78bc('0x15'))['db'];function respondWithStatusCode(_0xb1af35,_0x20803e){_0x20803e=_0x20803e||0xcc;return function(_0x3c97b3){if(_0x3c97b3){return _0xb1af35['sendStatus'](_0x20803e);}return _0xb1af35['status'](_0x20803e)['end']();};}function respondWithResult(_0x1b6918,_0xbcdf34){_0xbcdf34=_0xbcdf34||0xc8;return function(_0x4e6fe5){if(_0x4e6fe5){return _0x1b6918[_0x78bc('0x16')](_0xbcdf34)[_0x78bc('0x17')](_0x4e6fe5);}};}function respondWithFilteredResult(_0x4cbe2b,_0x6bc8d3){return function(_0x2d998a){if(_0x2d998a){var _0x328eaa=typeof _0x6bc8d3[_0x78bc('0x18')]===_0x78bc('0x19')&&typeof _0x6bc8d3[_0x78bc('0x1a')]===_0x78bc('0x19');var _0x273b7a=_0x2d998a['count'];var _0x11a300=_0x328eaa?0x0:_0x6bc8d3['offset'];var _0x1d9982=_0x328eaa?_0x2d998a['count']:_0x6bc8d3['offset']+_0x6bc8d3[_0x78bc('0x1a')];var _0x2db25f;if(_0x1d9982>=_0x273b7a){_0x1d9982=_0x273b7a;_0x2db25f=0xc8;}else{_0x2db25f=0xce;}_0x4cbe2b[_0x78bc('0x16')](_0x2db25f);return _0x4cbe2b[_0x78bc('0x1b')](_0x78bc('0x1c'),_0x11a300+'-'+_0x1d9982+'/'+_0x273b7a)['json'](_0x2d998a);}return null;};}function patchUpdates(_0x241541){return function(_0x10f29f){try{jsonpatch[_0x78bc('0x1d')](_0x10f29f,_0x241541,!![]);}catch(_0x4d6fa1){return BPromise[_0x78bc('0x1e')](_0x4d6fa1);}return _0x10f29f[_0x78bc('0x1f')]();};}function saveUpdates(_0x46be74,_0x113693){return function(_0x1d8106){if(_0x1d8106){return _0x1d8106[_0x78bc('0x20')](_0x46be74)['then'](function(_0x1d1f91){return _0x1d1f91;});}return null;};}function removeEntity(_0x4dd18d,_0x4c4038){return function(_0x44822a){if(_0x44822a){return _0x44822a[_0x78bc('0x21')]()[_0x78bc('0x22')](function(){_0x4dd18d[_0x78bc('0x16')](0xcc)[_0x78bc('0x23')]();});}};}function handleEntityNotFound(_0x67919a,_0x3201cb){return function(_0x5f38fd){if(!_0x5f38fd){_0x67919a['sendStatus'](0x194);}return _0x5f38fd;};}function handleError(_0x29e7d7,_0x1733c8){_0x1733c8=_0x1733c8||0x1f4;return function(_0x5ec977){logger['error'](_0x5ec977[_0x78bc('0x24')]);if(_0x5ec977[_0x78bc('0x25')]){delete _0x5ec977[_0x78bc('0x25')];}_0x29e7d7['status'](_0x1733c8)[_0x78bc('0x26')](_0x5ec977);};}exports['index']=function(_0x596974,_0x396617){var _0x4a963d={},_0x35f796={},_0x31ff11={'count':0x0,'rows':[]};var _0x851c10=_['map'](db[_0x78bc('0x27')][_0x78bc('0x28')],function(_0x2f7794){return{'name':_0x2f7794[_0x78bc('0x29')],'type':_0x2f7794['type'][_0x78bc('0x2a')]};});_0x35f796[_0x78bc('0x2b')]=_[_0x78bc('0x2c')](_0x851c10,_0x78bc('0x25'));_0x35f796['query']=_[_0x78bc('0x2d')](_0x596974[_0x78bc('0x2e')]);_0x35f796[_0x78bc('0x2f')]=_[_0x78bc('0x30')](_0x35f796['model'],_0x35f796[_0x78bc('0x2e')]);_0x4a963d[_0x78bc('0x31')]=_['intersection'](_0x35f796[_0x78bc('0x2b')],qs[_0x78bc('0x32')](_0x596974[_0x78bc('0x2e')]['fields']));_0x4a963d[_0x78bc('0x31')]=_0x4a963d['attributes'][_0x78bc('0x33')]?_0x4a963d['attributes']:_0x35f796[_0x78bc('0x2b')];if(!_0x596974[_0x78bc('0x2e')][_0x78bc('0x34')](_0x78bc('0x35'))){_0x4a963d[_0x78bc('0x1a')]=qs[_0x78bc('0x1a')](_0x596974[_0x78bc('0x2e')][_0x78bc('0x1a')]);_0x4a963d[_0x78bc('0x18')]=qs['offset'](_0x596974['query']['offset']);}_0x4a963d['order']=qs['sort'](_0x596974[_0x78bc('0x2e')]['sort']);_0x4a963d[_0x78bc('0x36')]=qs[_0x78bc('0x2f')](_[_0x78bc('0x37')](_0x596974[_0x78bc('0x2e')],_0x35f796['filters']),_0x851c10);if(_0x596974['query'][_0x78bc('0x38')]){_0x4a963d[_0x78bc('0x36')]=_[_0x78bc('0x39')](_0x4a963d[_0x78bc('0x36')],{'$or':_[_0x78bc('0x2c')](_0x851c10,function(_0x251c33){if(_0x251c33[_0x78bc('0x3a')]!==_0x78bc('0x3b')){var _0x2c5fb1={};_0x2c5fb1[_0x251c33['name']]={'$like':'%'+_0x596974[_0x78bc('0x2e')]['filter']+'%'};return _0x2c5fb1;}})});}_0x4a963d=_[_0x78bc('0x39')]({},_0x4a963d,_0x596974[_0x78bc('0x3c')]);var _0x5b3fe8={'where':_0x4a963d[_0x78bc('0x36')]};return db['VoiceDialReport'][_0x78bc('0x3d')](_0x5b3fe8)[_0x78bc('0x22')](function(_0x1d38d9){_0x31ff11['count']=_0x1d38d9;if(_0x596974['query']['includeAll']){_0x4a963d[_0x78bc('0x3e')]=[{'all':!![]}];}return db[_0x78bc('0x27')][_0x78bc('0x3f')](_0x4a963d);})[_0x78bc('0x22')](function(_0x266933){_0x31ff11[_0x78bc('0x40')]=_0x266933;return _0x31ff11;})['then'](respondWithFilteredResult(_0x396617,_0x4a963d))[_0x78bc('0x41')](handleError(_0x396617,null));};exports[_0x78bc('0x42')]=function(_0x3e08c9,_0x139834){var _0x2fc8e4={'raw':!![],'where':{'id':_0x3e08c9[_0x78bc('0x43')]['id']}},_0x2d2b33={};_0x2d2b33[_0x78bc('0x2b')]=_[_0x78bc('0x2d')](db['VoiceDialReport'][_0x78bc('0x28')]);_0x2d2b33['query']=_[_0x78bc('0x2d')](_0x3e08c9['query']);_0x2d2b33[_0x78bc('0x2f')]=_[_0x78bc('0x30')](_0x2d2b33[_0x78bc('0x2b')],_0x2d2b33[_0x78bc('0x2e')]);_0x2fc8e4[_0x78bc('0x31')]=_[_0x78bc('0x30')](_0x2d2b33[_0x78bc('0x2b')],qs[_0x78bc('0x32')](_0x3e08c9[_0x78bc('0x2e')][_0x78bc('0x32')]));_0x2fc8e4['attributes']=_0x2fc8e4['attributes'][_0x78bc('0x33')]?_0x2fc8e4[_0x78bc('0x31')]:_0x2d2b33[_0x78bc('0x2b')];if(_0x3e08c9[_0x78bc('0x2e')][_0x78bc('0x44')]){_0x2fc8e4[_0x78bc('0x3e')]=[{'all':!![]}];}_0x2fc8e4=_[_0x78bc('0x39')]({},_0x2fc8e4,_0x3e08c9[_0x78bc('0x3c')]);return db['VoiceDialReport'][_0x78bc('0x45')](_0x2fc8e4)[_0x78bc('0x22')](handleEntityNotFound(_0x139834,null))[_0x78bc('0x22')](respondWithResult(_0x139834,null))[_0x78bc('0x41')](handleError(_0x139834,null));};exports[_0x78bc('0x46')]=function(_0x400e86,_0x36facc){return db['VoiceDialReport'][_0x78bc('0x46')](_0x400e86[_0x78bc('0x47')],{})[_0x78bc('0x22')](respondWithResult(_0x36facc,0xc9))['catch'](handleError(_0x36facc,null));};exports[_0x78bc('0x20')]=function(_0x5b4d0b,_0x5cd03c){if(_0x5b4d0b[_0x78bc('0x47')]['id']){delete _0x5b4d0b[_0x78bc('0x47')]['id'];}return db[_0x78bc('0x27')][_0x78bc('0x45')]({'where':{'id':_0x5b4d0b['params']['id']}})[_0x78bc('0x22')](handleEntityNotFound(_0x5cd03c,null))[_0x78bc('0x22')](saveUpdates(_0x5b4d0b['body'],null))[_0x78bc('0x22')](respondWithResult(_0x5cd03c,null))[_0x78bc('0x41')](handleError(_0x5cd03c,null));};exports[_0x78bc('0x21')]=function(_0x4c5a45,_0xfb923c){return db[_0x78bc('0x27')]['find']({'where':{'id':_0x4c5a45[_0x78bc('0x43')]['id']}})[_0x78bc('0x22')](handleEntityNotFound(_0xfb923c,null))[_0x78bc('0x22')](removeEntity(_0xfb923c,null))[_0x78bc('0x41')](handleError(_0xfb923c,null));};exports[_0x78bc('0x48')]=function(_0x5b7d77,_0x2f29e9){return db[_0x78bc('0x27')][_0x78bc('0x48')]()['then'](respondWithResult(_0x2f29e9,null))['catch'](handleError(_0x2f29e9,null));}; \ No newline at end of file +var _0x0b9f=['filter','merge','options','findAll','rows','show','keys','rawAttributes','includeAll','include','find','catch','create','body','params','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','index','map','VoiceDialReport','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','VIRTUAL'];(function(_0x1a458a,_0x3bdc79){var _0x22993b=function(_0x47c13f){while(--_0x47c13f){_0x1a458a['push'](_0x1a458a['shift']());}};_0x22993b(++_0x3bdc79);}(_0x0b9f,0x16e));var _0xf0b9=function(_0x59de9b,_0x517095){_0x59de9b=_0x59de9b-0x0;var _0x4f1348=_0x0b9f[_0x59de9b];return _0x4f1348;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf0b9('0x0'));var zipdir=require(_0xf0b9('0x1'));var jsonpatch=require(_0xf0b9('0x2'));var rp=require('request-promise');var moment=require(_0xf0b9('0x3'));var BPromise=require(_0xf0b9('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf0b9('0x5'));var sox=require(_0xf0b9('0x6'));var csv=require(_0xf0b9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf0b9('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf0b9('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xf0b9('0xa'));var toCsv=require(_0xf0b9('0x7'));var querystring=require(_0xf0b9('0xb'));var Papa=require(_0xf0b9('0xc'));var Redis=require('ioredis');var authService=require(_0xf0b9('0xd'));var qs=require(_0xf0b9('0xe'));var as=require(_0xf0b9('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf0b9('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xf0b9('0x11'));var licenseUtil=require(_0xf0b9('0x12'));var db=require(_0xf0b9('0x13'))['db'];function respondWithStatusCode(_0x4517c7,_0x1aff9b){_0x1aff9b=_0x1aff9b||0xcc;return function(_0x20f5c3){if(_0x20f5c3){return _0x4517c7[_0xf0b9('0x14')](_0x1aff9b);}return _0x4517c7[_0xf0b9('0x15')](_0x1aff9b)['end']();};}function respondWithResult(_0x402954,_0x5b1048){_0x5b1048=_0x5b1048||0xc8;return function(_0x3285b8){if(_0x3285b8){return _0x402954[_0xf0b9('0x15')](_0x5b1048)[_0xf0b9('0x16')](_0x3285b8);}};}function respondWithFilteredResult(_0x22384f,_0x2ed6cc){return function(_0x1978ff){if(_0x1978ff){var _0x3d857d=typeof _0x2ed6cc[_0xf0b9('0x17')]===_0xf0b9('0x18')&&typeof _0x2ed6cc['limit']==='undefined';var _0x4d08e6=_0x1978ff[_0xf0b9('0x19')];var _0x472c13=_0x3d857d?0x0:_0x2ed6cc['offset'];var _0x2bb956=_0x3d857d?_0x1978ff[_0xf0b9('0x19')]:_0x2ed6cc['offset']+_0x2ed6cc[_0xf0b9('0x1a')];var _0x1af7b9;if(_0x2bb956>=_0x4d08e6){_0x2bb956=_0x4d08e6;_0x1af7b9=0xc8;}else{_0x1af7b9=0xce;}_0x22384f[_0xf0b9('0x15')](_0x1af7b9);return _0x22384f[_0xf0b9('0x1b')](_0xf0b9('0x1c'),_0x472c13+'-'+_0x2bb956+'/'+_0x4d08e6)[_0xf0b9('0x16')](_0x1978ff);}return null;};}function patchUpdates(_0x2fa077){return function(_0x1571a3){try{jsonpatch[_0xf0b9('0x1d')](_0x1571a3,_0x2fa077,!![]);}catch(_0xc8b5ae){return BPromise[_0xf0b9('0x1e')](_0xc8b5ae);}return _0x1571a3[_0xf0b9('0x1f')]();};}function saveUpdates(_0x1e820c,_0x501acc){return function(_0x11e398){if(_0x11e398){return _0x11e398[_0xf0b9('0x20')](_0x1e820c)[_0xf0b9('0x21')](function(_0x3cb9c2){return _0x3cb9c2;});}return null;};}function removeEntity(_0x2e87e7,_0x584f21){return function(_0x16ad00){if(_0x16ad00){return _0x16ad00[_0xf0b9('0x22')]()[_0xf0b9('0x21')](function(){_0x2e87e7[_0xf0b9('0x15')](0xcc)[_0xf0b9('0x23')]();});}};}function handleEntityNotFound(_0x57398e,_0x44e02){return function(_0x5a0c38){if(!_0x5a0c38){_0x57398e['sendStatus'](0x194);}return _0x5a0c38;};}function handleError(_0x1d3eee,_0x1e6bb7){_0x1e6bb7=_0x1e6bb7||0x1f4;return function(_0x3b8cd3){logger['error'](_0x3b8cd3[_0xf0b9('0x24')]);if(_0x3b8cd3['name']){delete _0x3b8cd3[_0xf0b9('0x25')];}_0x1d3eee[_0xf0b9('0x15')](_0x1e6bb7)['send'](_0x3b8cd3);};}exports[_0xf0b9('0x26')]=function(_0x15a7d7,_0x472299){var _0x5ed7eb={},_0x39f944={},_0x2fd507={'count':0x0,'rows':[]};var _0x564e42=_[_0xf0b9('0x27')](db[_0xf0b9('0x28')]['rawAttributes'],function(_0x4354ee){return{'name':_0x4354ee['fieldName'],'type':_0x4354ee[_0xf0b9('0x29')]['key']};});_0x39f944[_0xf0b9('0x2a')]=_[_0xf0b9('0x27')](_0x564e42,_0xf0b9('0x25'));_0x39f944[_0xf0b9('0x2b')]=_['keys'](_0x15a7d7[_0xf0b9('0x2b')]);_0x39f944[_0xf0b9('0x2c')]=_[_0xf0b9('0x2d')](_0x39f944[_0xf0b9('0x2a')],_0x39f944[_0xf0b9('0x2b')]);_0x5ed7eb[_0xf0b9('0x2e')]=_[_0xf0b9('0x2d')](_0x39f944[_0xf0b9('0x2a')],qs[_0xf0b9('0x2f')](_0x15a7d7[_0xf0b9('0x2b')][_0xf0b9('0x2f')]));_0x5ed7eb[_0xf0b9('0x2e')]=_0x5ed7eb[_0xf0b9('0x2e')][_0xf0b9('0x30')]?_0x5ed7eb[_0xf0b9('0x2e')]:_0x39f944[_0xf0b9('0x2a')];if(!_0x15a7d7[_0xf0b9('0x2b')]['hasOwnProperty'](_0xf0b9('0x31'))){_0x5ed7eb['limit']=qs[_0xf0b9('0x1a')](_0x15a7d7[_0xf0b9('0x2b')][_0xf0b9('0x1a')]);_0x5ed7eb[_0xf0b9('0x17')]=qs[_0xf0b9('0x17')](_0x15a7d7['query'][_0xf0b9('0x17')]);}_0x5ed7eb[_0xf0b9('0x32')]=qs[_0xf0b9('0x33')](_0x15a7d7[_0xf0b9('0x2b')]['sort']);_0x5ed7eb[_0xf0b9('0x34')]=qs['filters'](_['pick'](_0x15a7d7[_0xf0b9('0x2b')],_0x39f944[_0xf0b9('0x2c')]),_0x564e42);if(_0x15a7d7[_0xf0b9('0x2b')]['filter']){_0x5ed7eb['where']=_['merge'](_0x5ed7eb[_0xf0b9('0x34')],{'$or':_[_0xf0b9('0x27')](_0x564e42,function(_0x5dc15d){if(_0x5dc15d[_0xf0b9('0x29')]!==_0xf0b9('0x35')){var _0x4da4e6={};_0x4da4e6[_0x5dc15d['name']]={'$like':'%'+_0x15a7d7['query'][_0xf0b9('0x36')]+'%'};return _0x4da4e6;}})});}_0x5ed7eb=_[_0xf0b9('0x37')]({},_0x5ed7eb,_0x15a7d7[_0xf0b9('0x38')]);var _0x5c1338={'where':_0x5ed7eb[_0xf0b9('0x34')]};return db[_0xf0b9('0x28')][_0xf0b9('0x19')](_0x5c1338)['then'](function(_0x1c694f){_0x2fd507['count']=_0x1c694f;if(_0x15a7d7[_0xf0b9('0x2b')]['includeAll']){_0x5ed7eb['include']=[{'all':!![]}];}return db[_0xf0b9('0x28')][_0xf0b9('0x39')](_0x5ed7eb);})[_0xf0b9('0x21')](function(_0x363831){_0x2fd507[_0xf0b9('0x3a')]=_0x363831;return _0x2fd507;})['then'](respondWithFilteredResult(_0x472299,_0x5ed7eb))['catch'](handleError(_0x472299,null));};exports[_0xf0b9('0x3b')]=function(_0x4091e6,_0x16851c){var _0x4a5892={'raw':!![],'where':{'id':_0x4091e6['params']['id']}},_0x5bc859={};_0x5bc859[_0xf0b9('0x2a')]=_[_0xf0b9('0x3c')](db[_0xf0b9('0x28')][_0xf0b9('0x3d')]);_0x5bc859[_0xf0b9('0x2b')]=_[_0xf0b9('0x3c')](_0x4091e6['query']);_0x5bc859[_0xf0b9('0x2c')]=_[_0xf0b9('0x2d')](_0x5bc859['model'],_0x5bc859[_0xf0b9('0x2b')]);_0x4a5892[_0xf0b9('0x2e')]=_[_0xf0b9('0x2d')](_0x5bc859[_0xf0b9('0x2a')],qs[_0xf0b9('0x2f')](_0x4091e6['query'][_0xf0b9('0x2f')]));_0x4a5892[_0xf0b9('0x2e')]=_0x4a5892[_0xf0b9('0x2e')][_0xf0b9('0x30')]?_0x4a5892[_0xf0b9('0x2e')]:_0x5bc859[_0xf0b9('0x2a')];if(_0x4091e6['query'][_0xf0b9('0x3e')]){_0x4a5892[_0xf0b9('0x3f')]=[{'all':!![]}];}_0x4a5892=_['merge']({},_0x4a5892,_0x4091e6[_0xf0b9('0x38')]);return db['VoiceDialReport'][_0xf0b9('0x40')](_0x4a5892)[_0xf0b9('0x21')](handleEntityNotFound(_0x16851c,null))[_0xf0b9('0x21')](respondWithResult(_0x16851c,null))[_0xf0b9('0x41')](handleError(_0x16851c,null));};exports[_0xf0b9('0x42')]=function(_0x5c78f0,_0x466cdf){return db[_0xf0b9('0x28')]['create'](_0x5c78f0[_0xf0b9('0x43')],{})[_0xf0b9('0x21')](respondWithResult(_0x466cdf,0xc9))['catch'](handleError(_0x466cdf,null));};exports[_0xf0b9('0x20')]=function(_0x86d571,_0x307f3a){if(_0x86d571[_0xf0b9('0x43')]['id']){delete _0x86d571[_0xf0b9('0x43')]['id'];}return db[_0xf0b9('0x28')][_0xf0b9('0x40')]({'where':{'id':_0x86d571[_0xf0b9('0x44')]['id']}})[_0xf0b9('0x21')](handleEntityNotFound(_0x307f3a,null))[_0xf0b9('0x21')](saveUpdates(_0x86d571[_0xf0b9('0x43')],null))[_0xf0b9('0x21')](respondWithResult(_0x307f3a,null))[_0xf0b9('0x41')](handleError(_0x307f3a,null));};exports[_0xf0b9('0x22')]=function(_0xb081dc,_0x97c612){return db[_0xf0b9('0x28')][_0xf0b9('0x40')]({'where':{'id':_0xb081dc[_0xf0b9('0x44')]['id']}})['then'](handleEntityNotFound(_0x97c612,null))[_0xf0b9('0x21')](removeEntity(_0x97c612,null))[_0xf0b9('0x41')](handleError(_0x97c612,null));};exports['describe']=function(_0x499d58,_0x2d2c56){return db[_0xf0b9('0x28')][_0xf0b9('0x45')]()[_0xf0b9('0x21')](respondWithResult(_0x2d2c56,null))[_0xf0b9('0x41')](handleError(_0x2d2c56,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 9a81b55..fb2d0e9 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 _0x36f4=['exports','define','report_dial','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./voiceDialReport.attributes'];(function(_0x5a77fb,_0x2d2d59){var _0x6ca4fb=function(_0x428777){while(--_0x428777){_0x5a77fb['push'](_0x5a77fb['shift']());}};_0x6ca4fb(++_0x2d2d59);}(_0x36f4,0xb3));var _0x436f=function(_0x5956f9,_0x1bc066){_0x5956f9=_0x5956f9-0x0;var _0x507fda=_0x36f4[_0x5956f9];return _0x507fda;};'use strict';var _=require('lodash');var util=require(_0x436f('0x0'));var logger=require(_0x436f('0x1'))(_0x436f('0x2'));var moment=require(_0x436f('0x3'));var BPromise=require(_0x436f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x436f('0x5'));var config=require(_0x436f('0x6'));var attributes=require(_0x436f('0x7'));module[_0x436f('0x8')]=function(_0x59cfcf,_0x5f31ff){return _0x59cfcf[_0x436f('0x9')]('VoiceDialReport',attributes,{'tableName':_0x436f('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3e44=['rimraf','../../config/environment','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','../../config/logger','bluebird','request-promise'];(function(_0x42d391,_0x52cd57){var _0x2e4ee9=function(_0x49241d){while(--_0x49241d){_0x42d391['push'](_0x42d391['shift']());}};_0x2e4ee9(++_0x52cd57);}(_0x3e44,0xd8));var _0x43e4=function(_0x5966e0,_0x21c72c){_0x5966e0=_0x5966e0-0x0;var _0x906d7=_0x3e44[_0x5966e0];return _0x906d7;};'use strict';var _=require(_0x43e4('0x0'));var util=require('util');var logger=require(_0x43e4('0x1'))('api');var moment=require('moment');var BPromise=require(_0x43e4('0x2'));var rp=require(_0x43e4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x43e4('0x4'));var config=require(_0x43e4('0x5'));var attributes=require('./voiceDialReport.attributes');module[_0x43e4('0x6')]=function(_0x19cbb8,_0x190d4c){return _0x19cbb8[_0x43e4('0x7')](_0x43e4('0x8'),attributes,{'tableName':_0x43e4('0x9'),'paranoid':![],'indexes':[{'fields':[_0x43e4('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 2e0f896..bd50523 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 _0xf6cc=['CreateVoiceDialReport','VoiceDialReport','create','body','options','UpdateVoiceDialReport','update','raw','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2498be,_0x431d2a){var _0x21835a=function(_0x22d9d0){while(--_0x22d9d0){_0x2498be['push'](_0x2498be['shift']());}};_0x21835a(++_0x431d2a);}(_0xf6cc,0x9e));var _0xcf6c=function(_0x1d0435,_0x236be5){_0x1d0435=_0x1d0435-0x0;var _0x5b5c60=_0xf6cc[_0x1d0435];return _0x5b5c60;};'use strict';var _=require(_0xcf6c('0x0'));var util=require('util');var moment=require(_0xcf6c('0x1'));var BPromise=require(_0xcf6c('0x2'));var rs=require(_0xcf6c('0x3'));var fs=require('fs');var Redis=require(_0xcf6c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcf6c('0x5'));var logger=require(_0xcf6c('0x6'))(_0xcf6c('0x7'));var config=require(_0xcf6c('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcf6c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6face7,_0x106251,_0x1bbd6c){return new BPromise(function(_0x5050d1,_0x4aa1c0){return client['request'](_0x6face7,_0x1bbd6c)[_0xcf6c('0xa')](function(_0x347058){logger[_0xcf6c('0xb')](_0xcf6c('0xc'),_0x106251,_0xcf6c('0xd'));logger[_0xcf6c('0xe')](_0xcf6c('0xf'),_0x106251,'request\x20sent',JSON[_0xcf6c('0x10')](_0x347058));if(_0x347058[_0xcf6c('0x11')]){if(_0x347058['error'][_0xcf6c('0x12')]===0x1f4){logger[_0xcf6c('0x11')](_0xcf6c('0xc'),_0x106251,_0x347058['error'][_0xcf6c('0x13')]);return _0x4aa1c0(_0x347058[_0xcf6c('0x11')][_0xcf6c('0x13')]);}logger[_0xcf6c('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x106251,_0x347058[_0xcf6c('0x11')][_0xcf6c('0x13')]);return _0x5050d1(_0x347058[_0xcf6c('0x11')][_0xcf6c('0x13')]);}else{logger['info'](_0xcf6c('0xc'),_0x106251,_0xcf6c('0xd'));_0x5050d1(_0x347058[_0xcf6c('0x14')][_0xcf6c('0x13')]);}})[_0xcf6c('0x15')](function(_0x38fbbb){logger[_0xcf6c('0x11')](_0xcf6c('0xc'),_0x106251,_0x38fbbb);_0x4aa1c0(_0x38fbbb);});});}exports[_0xcf6c('0x16')]=function(_0x8c3b7e){var _0x2f7532=this;return new Promise(function(_0x3ec1dd,_0x1b4a95){return db[_0xcf6c('0x17')][_0xcf6c('0x18')](_0x8c3b7e[_0xcf6c('0x19')],{'raw':_0x8c3b7e['options']?_0x8c3b7e[_0xcf6c('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xcf6c('0xa')](function(_0x2cc119){logger[_0xcf6c('0xb')](_0xcf6c('0x16'),_0x8c3b7e);logger[_0xcf6c('0xe')]('CreateVoiceDialReport',_0x8c3b7e,JSON[_0xcf6c('0x10')](_0x2cc119));_0x3ec1dd(_0x2cc119);})['catch'](function(_0x24703d){logger[_0xcf6c('0x11')](_0xcf6c('0x16'),_0x24703d[_0xcf6c('0x13')],_0x8c3b7e);_0x1b4a95(_0x2f7532['error'](0x1f4,_0x24703d[_0xcf6c('0x13')]));});});};exports[_0xcf6c('0x1b')]=function(_0x3843e6){var _0x3416bf=this;return new Promise(function(_0x1d6109,_0x3d22ed){return db['VoiceDialReport'][_0xcf6c('0x1c')](_0x3843e6[_0xcf6c('0x19')],{'raw':_0x3843e6[_0xcf6c('0x1a')]?_0x3843e6[_0xcf6c('0x1a')][_0xcf6c('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3843e6[_0xcf6c('0x1a')]?_0x3843e6[_0xcf6c('0x1a')]['where']||null:null,'attributes':_0x3843e6['options']?_0x3843e6[_0xcf6c('0x1a')]['attributes']||null:null,'limit':_0x3843e6['options']?_0x3843e6[_0xcf6c('0x1a')]['limit']||null:null})['then'](function(_0x12f4e8){logger['info']('UpdateVoiceDialReport',_0x3843e6);logger[_0xcf6c('0xe')]('UpdateVoiceDialReport',_0x3843e6,JSON[_0xcf6c('0x10')](_0x12f4e8));_0x1d6109(_0x12f4e8);})[_0xcf6c('0x15')](function(_0xfd799){logger['error'](_0xcf6c('0x1b'),_0xfd799[_0xcf6c('0x13')],_0x3843e6);_0x3d22ed(_0x3416bf[_0xcf6c('0x11')](0x1f4,_0xfd799[_0xcf6c('0x13')]));});});}; \ No newline at end of file +var _0x08f0=['options','CreateVoiceDialReport','debug','update','raw','attributes','limit','UpdateVoiceDialReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','VoiceDialReport','body'];(function(_0xf8da14,_0x49b2f2){var _0x61d88c=function(_0x23c987){while(--_0x23c987){_0xf8da14['push'](_0xf8da14['shift']());}};_0x61d88c(++_0x49b2f2);}(_0x08f0,0x128));var _0x008f=function(_0x3c58da,_0x50e809){_0x3c58da=_0x3c58da-0x0;var _0x17697e=_0x08f0[_0x3c58da];return _0x17697e;};'use strict';var _=require(_0x008f('0x0'));var util=require('util');var moment=require(_0x008f('0x1'));var BPromise=require(_0x008f('0x2'));var rs=require(_0x008f('0x3'));var fs=require('fs');var Redis=require(_0x008f('0x4'));var db=require(_0x008f('0x5'))['db'];var utils=require(_0x008f('0x6'));var logger=require(_0x008f('0x7'))(_0x008f('0x8'));var config=require(_0x008f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x008f('0xa')][_0x008f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4fac43,_0x52ddb7,_0x4bf47a){return new BPromise(function(_0x3e41d7,_0x4084a5){return client['request'](_0x4fac43,_0x4bf47a)[_0x008f('0xc')](function(_0x5a57b4){logger[_0x008f('0xd')](_0x008f('0xe'),_0x52ddb7,_0x008f('0xf'));logger['debug']('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x52ddb7,_0x008f('0xf'),JSON[_0x008f('0x10')](_0x5a57b4));if(_0x5a57b4['error']){if(_0x5a57b4[_0x008f('0x11')][_0x008f('0x12')]===0x1f4){logger[_0x008f('0x11')](_0x008f('0xe'),_0x52ddb7,_0x5a57b4['error'][_0x008f('0x13')]);return _0x4084a5(_0x5a57b4[_0x008f('0x11')][_0x008f('0x13')]);}logger[_0x008f('0x11')](_0x008f('0xe'),_0x52ddb7,_0x5a57b4[_0x008f('0x11')]['message']);return _0x3e41d7(_0x5a57b4[_0x008f('0x11')][_0x008f('0x13')]);}else{logger['info'](_0x008f('0xe'),_0x52ddb7,_0x008f('0xf'));_0x3e41d7(_0x5a57b4[_0x008f('0x14')][_0x008f('0x13')]);}})[_0x008f('0x15')](function(_0x5629ca){logger[_0x008f('0x11')](_0x008f('0xe'),_0x52ddb7,_0x5629ca);_0x4084a5(_0x5629ca);});});}exports['CreateVoiceDialReport']=function(_0x5bb61e){var _0x3fa255=this;return new Promise(function(_0x3ba133,_0x338e82){return db[_0x008f('0x16')]['create'](_0x5bb61e[_0x008f('0x17')],{'raw':_0x5bb61e[_0x008f('0x18')]?_0x5bb61e[_0x008f('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0xb3195b){logger['info'](_0x008f('0x19'),_0x5bb61e);logger[_0x008f('0x1a')]('CreateVoiceDialReport',_0x5bb61e,JSON[_0x008f('0x10')](_0xb3195b));_0x3ba133(_0xb3195b);})[_0x008f('0x15')](function(_0x401922){logger[_0x008f('0x11')](_0x008f('0x19'),_0x401922[_0x008f('0x13')],_0x5bb61e);_0x338e82(_0x3fa255[_0x008f('0x11')](0x1f4,_0x401922[_0x008f('0x13')]));});});};exports['UpdateVoiceDialReport']=function(_0x404e62){var _0x4dbe20=this;return new Promise(function(_0x471698,_0x36aafa){return db[_0x008f('0x16')][_0x008f('0x1b')](_0x404e62[_0x008f('0x17')],{'raw':_0x404e62[_0x008f('0x18')]?_0x404e62['options'][_0x008f('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x404e62[_0x008f('0x18')]?_0x404e62['options']['where']||null:null,'attributes':_0x404e62[_0x008f('0x18')]?_0x404e62['options'][_0x008f('0x1d')]||null:null,'limit':_0x404e62[_0x008f('0x18')]?_0x404e62[_0x008f('0x18')][_0x008f('0x1e')]||null:null})[_0x008f('0xc')](function(_0x16d58e){logger[_0x008f('0xd')]('UpdateVoiceDialReport',_0x404e62);logger['debug'](_0x008f('0x1f'),_0x404e62,JSON['stringify'](_0x16d58e));_0x471698(_0x16d58e);})[_0x008f('0x15')](function(_0x33ef1e){logger[_0x008f('0x11')]('UpdateVoiceDialReport',_0x33ef1e[_0x008f('0x13')],_0x404e62);_0x36aafa(_0x4dbe20[_0x008f('0x11')](0x1f4,_0x33ef1e['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index b8ed8c8..18c5440 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 _0x659d=['Router','fs-extra','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','post','create','/:id/applications','addApplications','put','update','delete','exports','util','path','connect-timeout','express'];(function(_0x161341,_0x1c054d){var _0x5e06c3=function(_0x1d177a){while(--_0x1d177a){_0x161341['push'](_0x161341['shift']());}};_0x5e06c3(++_0x1c054d);}(_0x659d,0xb9));var _0xd659=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0x659d[_0x4c440b];return _0x2d48cf;};'use strict';var multer=require('multer');var util=require(_0xd659('0x0'));var path=require(_0xd659('0x1'));var timeout=require(_0xd659('0x2'));var express=require(_0xd659('0x3'));var router=express[_0xd659('0x4')]();var fs_extra=require(_0xd659('0x5'));var auth=require(_0xd659('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd659('0x7'));var controller=require(_0xd659('0x8'));router[_0xd659('0x9')]('/',auth[_0xd659('0xa')](),controller[_0xd659('0xb')]);router[_0xd659('0x9')](_0xd659('0xc'),auth[_0xd659('0xa')](),controller['show']);router[_0xd659('0xd')]('/',auth[_0xd659('0xa')](),controller[_0xd659('0xe')]);router[_0xd659('0xd')](_0xd659('0xf'),auth[_0xd659('0xa')](),controller[_0xd659('0x10')]);router[_0xd659('0x11')]('/:id',auth[_0xd659('0xa')](),controller[_0xd659('0x12')]);router[_0xd659('0x13')]('/:id',auth[_0xd659('0xa')](),controller['destroy']);module[_0xd659('0x14')]=router; \ No newline at end of file +var _0xd7f1=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','isAuthenticated','index','show','post','create','/:id/applications','addApplications','put','/:id','update','destroy','util'];(function(_0x430cb4,_0x23ac85){var _0x396f73=function(_0x492650){while(--_0x492650){_0x430cb4['push'](_0x430cb4['shift']());}};_0x396f73(++_0x23ac85);}(_0xd7f1,0x103));var _0x1d7f=function(_0x3c9741,_0x557e3d){_0x3c9741=_0x3c9741-0x0;var _0x72aa01=_0xd7f1[_0x3c9741];return _0x72aa01;};'use strict';var multer=require('multer');var util=require(_0x1d7f('0x0'));var path=require('path');var timeout=require(_0x1d7f('0x1'));var express=require(_0x1d7f('0x2'));var router=express[_0x1d7f('0x3')]();var fs_extra=require(_0x1d7f('0x4'));var auth=require(_0x1d7f('0x5'));var interaction=require(_0x1d7f('0x6'));var config=require(_0x1d7f('0x7'));var controller=require(_0x1d7f('0x8'));router['get']('/',auth[_0x1d7f('0x9')](),controller[_0x1d7f('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1d7f('0xb')]);router[_0x1d7f('0xc')]('/',auth['isAuthenticated'](),controller[_0x1d7f('0xd')]);router['post'](_0x1d7f('0xe'),auth[_0x1d7f('0x9')](),controller[_0x1d7f('0xf')]);router[_0x1d7f('0x10')](_0x1d7f('0x11'),auth[_0x1d7f('0x9')](),controller[_0x1d7f('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x1d7f('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 451dcc0..145d30b 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 _0xff75=['NoOp','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','BOOLEAN','INTEGER','wav','VIRTUAL','getDataValue','exten','sequelize','STRING','compositeIndex'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0xff75,0x189));var _0x5ff7=function(_0xe938a0,_0x1002da){_0xe938a0=_0xe938a0-0x0;var _0x5eb2c4=_0xff75[_0xe938a0];return _0x5eb2c4;};'use strict';var Sequelize=require(_0x5ff7('0x0'));module['exports']={'context':{'type':Sequelize[_0x5ff7('0x1')],'allowNull':![],'unique':_0x5ff7('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x5ff7('0x1')],'allowNull':![],'unique':_0x5ff7('0x2')},'priority':{'type':Sequelize[_0x5ff7('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x5ff7('0x2')},'tag':{'type':Sequelize[_0x5ff7('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x5ff7('0x1')],'allowNull':![],'defaultValue':_0x5ff7('0x3')},'appdata':{'type':Sequelize[_0x5ff7('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x5ff7('0x4'),_0x5ff7('0x5'),_0x5ff7('0x6'),_0x5ff7('0x7'),_0x5ff7('0x8'),_0x5ff7('0x9'),_0x5ff7('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x5ff7('0x1')]},'interval':{'type':Sequelize[_0x5ff7('0x1')],'allowNull':![],'defaultValue':_0x5ff7('0xb')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x5ff7('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x5ff7('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x5ff7('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x5ff7('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x5ff7('0xd')]},'recordingFormat':{'type':Sequelize[_0x5ff7('0x1')],'defaultValue':_0x5ff7('0xe')},'answer':{'type':Sequelize[_0x5ff7('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x5ff7('0xf')],'get':function(_0x3b11c1){return this[_0x5ff7('0x10')](_0x5ff7('0x11'));}},'alias':{'type':Sequelize[_0x5ff7('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x8ba9=['exten','sequelize','compositeIndex','STRING','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue'];(function(_0x376986,_0x5ce3e4){var _0x2bc214=function(_0x12a6d9){while(--_0x12a6d9){_0x376986['push'](_0x376986['shift']());}};_0x2bc214(++_0x5ce3e4);}(_0x8ba9,0x169));var _0x98ba=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x8ba9[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x98ba('0x0'));module['exports']={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x98ba('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x98ba('0x2')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x98ba('0x1')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x98ba('0x2')],'allowNull':![],'defaultValue':_0x98ba('0x3')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x98ba('0x4')](_0x98ba('0x5'),_0x98ba('0x6'),_0x98ba('0x7'),_0x98ba('0x8'),_0x98ba('0x9'),_0x98ba('0xa'),_0x98ba('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x98ba('0x2')]},'interval':{'type':Sequelize[_0x98ba('0x2')],'allowNull':![],'defaultValue':_0x98ba('0xc')},'IntervalId':{'type':Sequelize[_0x98ba('0xd')]},'isApp':{'type':Sequelize[_0x98ba('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x98ba('0xd')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x98ba('0xf')],'get':function(_0x536236){return this[_0x98ba('0x10')](_0x98ba('0x11'));}},'alias':{'type':Sequelize[_0x98ba('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index dc31384..8ec3ace 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 _0xbb68=['update','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','priority','stack','finally','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','destroy','get','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','UserProfileResource','then','error','send','index','VoiceExtension','rawAttributes','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','filters','options','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0xbb68,0xc9));var _0x8bb6=function(_0xa073ef,_0x5d5e5c){_0xa073ef=_0xa073ef-0x0;var _0x524bca=_0xbb68[_0xa073ef];return _0x524bca;};'use strict';var _=require('lodash');var Redis=require(_0x8bb6('0x0'));var qs=require(_0x8bb6('0x1'));var logger=require(_0x8bb6('0x2'))(_0x8bb6('0x3'));var config=require('../../config/environment');var db=require(_0x8bb6('0x4'))['db'];config[_0x8bb6('0x5')]=_[_0x8bb6('0x6')](config[_0x8bb6('0x5')],{'host':_0x8bb6('0x7'),'port':0x18eb});var socket=require(_0x8bb6('0x8'))(new Redis(config[_0x8bb6('0x5')]));require('./voiceExtension.socket')[_0x8bb6('0x9')](socket);function respondWithStatusCode(_0x21814d,_0x5bcdcc){_0x5bcdcc=_0x5bcdcc||0xcc;return function(_0x12f445){if(_0x12f445){return _0x21814d[_0x8bb6('0xa')](_0x5bcdcc);}return _0x21814d[_0x8bb6('0xb')](_0x5bcdcc)['end']();};}function respondWithResult(_0xe99f66,_0x458e5b){_0x458e5b=_0x458e5b||0xc8;return function(_0x43c96b){if(_0x43c96b){return _0xe99f66[_0x8bb6('0xb')](_0x458e5b)[_0x8bb6('0xc')](_0x43c96b);}};}function respondWithFilteredResult(_0x499772,_0x541138){return function(_0x3ada43){if(_0x3ada43){var _0x342e4b=typeof _0x541138[_0x8bb6('0xd')]===_0x8bb6('0xe')&&typeof _0x541138['limit']==='undefined';var _0x32bceb=_0x3ada43[_0x8bb6('0xf')];var _0x5d0eef=_0x342e4b?0x0:_0x541138['offset'];var _0x343d55=_0x342e4b?_0x3ada43[_0x8bb6('0xf')]:_0x541138[_0x8bb6('0xd')]+_0x541138[_0x8bb6('0x10')];var _0x139138;if(_0x343d55>=_0x32bceb){_0x343d55=_0x32bceb;_0x139138=0xc8;}else{_0x139138=0xce;}_0x499772[_0x8bb6('0xb')](_0x139138);return _0x499772[_0x8bb6('0x11')](_0x8bb6('0x12'),_0x5d0eef+'-'+_0x343d55+'/'+_0x32bceb)[_0x8bb6('0xc')](_0x3ada43);}return null;};}function removeEntity(_0x38cd7e){return function(_0x18f819){if(_0x18f819){return _0x18f819[_0x8bb6('0x13')]()['then'](function(){var _0x2c16d6=_0x18f819[_0x8bb6('0x14')]({'plain':!![]});var _0x51369a=[{'name':'InboundRoutes','value':_0x8bb6('0x15'),'ignore':![]},{'name':_0x8bb6('0x16'),'value':_0x8bb6('0x17'),'ignore':![]},{'name':_0x8bb6('0x18'),'value':_0x8bb6('0x19'),'ignore':![]}];var _0x162a71=_(_0x51369a)[_0x8bb6('0x1a')](_0x8bb6('0x1b'))[_0x8bb6('0x1c')](_0x8bb6('0x1d'))['value']();if(_[_0x8bb6('0x1e')](_0x162a71,_0x2c16d6[_0x8bb6('0x1f')])){return;}var _0x14986b=_[_0x8bb6('0x20')](_0x51369a,[_0x8bb6('0x1d'),_0x2c16d6[_0x8bb6('0x1f')]])[_0x8bb6('0x21')];return db[_0x8bb6('0x22')][_0x8bb6('0x13')]({'where':{'type':_0x14986b,'resourceId':_0x2c16d6['id']}})['then'](function(){return _0x18f819;});})[_0x8bb6('0x23')](function(){_0x38cd7e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b688f){return function(_0x5be5ff){if(!_0x5be5ff){_0x3b688f[_0x8bb6('0xa')](0x194);}return _0x5be5ff;};}function handleError(_0x28d90b,_0x5d64dd){_0x5d64dd=_0x5d64dd||0x1f4;return function(_0x3e0a48){logger[_0x8bb6('0x24')](_0x3e0a48['stack']);if(_0x3e0a48[_0x8bb6('0x21')]){delete _0x3e0a48[_0x8bb6('0x21')];}_0x28d90b[_0x8bb6('0xb')](_0x5d64dd)[_0x8bb6('0x25')](_0x3e0a48);};}exports[_0x8bb6('0x26')]=function(_0x172a17,_0x4eba71){var _0x443c9e={},_0x5c0177={},_0x37effe={'count':0x0,'rows':[]};var _0x1bcb0f=_[_0x8bb6('0x1c')](db[_0x8bb6('0x27')][_0x8bb6('0x28')],function(_0x31a4c7){return{'name':_0x31a4c7['fieldName'],'type':_0x31a4c7[_0x8bb6('0x1f')][_0x8bb6('0x29')]};});_0x5c0177[_0x8bb6('0x2a')]=_[_0x8bb6('0x1c')](_0x1bcb0f,_0x8bb6('0x21'));_0x5c0177['query']=_[_0x8bb6('0x2b')](_0x172a17[_0x8bb6('0x2c')]);_0x5c0177['filters']=_[_0x8bb6('0x2d')](_0x5c0177[_0x8bb6('0x2a')],_0x5c0177[_0x8bb6('0x2c')]);_0x443c9e[_0x8bb6('0x2e')]=_['intersection'](_0x5c0177['model'],qs[_0x8bb6('0x2f')](_0x172a17[_0x8bb6('0x2c')][_0x8bb6('0x2f')]));_0x443c9e[_0x8bb6('0x2e')]=_0x443c9e[_0x8bb6('0x2e')][_0x8bb6('0x30')]?_0x443c9e[_0x8bb6('0x2e')]:_0x5c0177['model'];if(!_0x172a17[_0x8bb6('0x2c')][_0x8bb6('0x31')](_0x8bb6('0x32'))){_0x443c9e['limit']=qs[_0x8bb6('0x10')](_0x172a17[_0x8bb6('0x2c')]['limit']);_0x443c9e[_0x8bb6('0xd')]=qs[_0x8bb6('0xd')](_0x172a17[_0x8bb6('0x2c')][_0x8bb6('0xd')]);}_0x443c9e['order']=qs[_0x8bb6('0x33')](_0x172a17[_0x8bb6('0x2c')][_0x8bb6('0x33')]);_0x443c9e[_0x8bb6('0x34')]=qs['filters'](_[_0x8bb6('0x35')](_0x172a17[_0x8bb6('0x2c')],_0x5c0177['filters']),_0x1bcb0f);if(_0x172a17['query'][_0x8bb6('0x1a')]){_0x443c9e[_0x8bb6('0x34')]=_['merge'](_0x443c9e[_0x8bb6('0x34')],{'$or':_[_0x8bb6('0x1c')](_0x1bcb0f,function(_0x956482){if(_0x956482['type']!==_0x8bb6('0x36')){var _0x30fb97={};_0x30fb97[_0x956482[_0x8bb6('0x21')]]={'$like':'%'+_0x172a17['query'][_0x8bb6('0x1a')]+'%'};return _0x30fb97;}})});}_0x443c9e=_[_0x8bb6('0x37')]({},_0x443c9e,_0x172a17['options']);var _0x3ca640={'where':_0x443c9e[_0x8bb6('0x34')]};return db[_0x8bb6('0x27')][_0x8bb6('0xf')](_0x3ca640)[_0x8bb6('0x23')](function(_0x42cd4a){_0x37effe[_0x8bb6('0xf')]=_0x42cd4a;if(_0x172a17['query'][_0x8bb6('0x38')]){_0x443c9e[_0x8bb6('0x39')]=[{'all':!![]}];}return db[_0x8bb6('0x27')][_0x8bb6('0x3a')](_0x443c9e);})[_0x8bb6('0x23')](function(_0x735c38){_0x37effe[_0x8bb6('0x3b')]=_0x735c38;return _0x37effe;})[_0x8bb6('0x23')](respondWithFilteredResult(_0x4eba71,_0x443c9e))[_0x8bb6('0x3c')](handleError(_0x4eba71,null));};exports[_0x8bb6('0x3d')]=function(_0x44bd00,_0x2a120e){var _0x37699e={'raw':![],'where':{'id':_0x44bd00[_0x8bb6('0x3e')]['id']}},_0x160d30={};_0x160d30[_0x8bb6('0x2a')]=_[_0x8bb6('0x2b')](db['VoiceExtension'][_0x8bb6('0x28')]);_0x160d30[_0x8bb6('0x2c')]=_[_0x8bb6('0x2b')](_0x44bd00[_0x8bb6('0x2c')]);_0x160d30[_0x8bb6('0x3f')]=_[_0x8bb6('0x2d')](_0x160d30[_0x8bb6('0x2a')],_0x160d30[_0x8bb6('0x2c')]);_0x37699e[_0x8bb6('0x2e')]=_[_0x8bb6('0x2d')](_0x160d30['model'],qs[_0x8bb6('0x2f')](_0x44bd00[_0x8bb6('0x2c')][_0x8bb6('0x2f')]));_0x37699e[_0x8bb6('0x2e')]=_0x37699e[_0x8bb6('0x2e')][_0x8bb6('0x30')]?_0x37699e[_0x8bb6('0x2e')]:_0x160d30[_0x8bb6('0x2a')];if(_0x44bd00[_0x8bb6('0x2c')][_0x8bb6('0x38')]){_0x37699e['include']=[{'all':!![]}];}_0x37699e=_[_0x8bb6('0x37')]({},_0x37699e,_0x44bd00[_0x8bb6('0x40')]);return db['VoiceExtension'][_0x8bb6('0x20')](_0x37699e)[_0x8bb6('0x23')](handleEntityNotFound(_0x2a120e,null))['then'](respondWithResult(_0x2a120e,null))[_0x8bb6('0x3c')](handleError(_0x2a120e,null));};exports['destroy']=function(_0x4905e1,_0x4c1dfa){return db[_0x8bb6('0x27')][_0x8bb6('0x20')]({'where':{'id':_0x4905e1[_0x8bb6('0x3e')]['id']}})[_0x8bb6('0x23')](handleEntityNotFound(_0x4c1dfa,null))[_0x8bb6('0x23')](removeEntity(_0x4c1dfa,null))['catch'](handleError(_0x4c1dfa,null));};exports[_0x8bb6('0x41')]=function(_0xe7eecc,_0x2afba2){if(_0xe7eecc[_0x8bb6('0x42')][_0x8bb6('0x1f')]===_0x8bb6('0x17')&&!_[_0x8bb6('0x43')](_0xe7eecc[_0x8bb6('0x42')]['exten'],'_')){_0xe7eecc[_0x8bb6('0x42')][_0x8bb6('0x44')]='_'[_0x8bb6('0x45')](_0xe7eecc[_0x8bb6('0x42')][_0x8bb6('0x44')]);}return db[_0x8bb6('0x27')][_0x8bb6('0x41')](_0xe7eecc[_0x8bb6('0x42')],{'raw':![]})['then'](function(_0x104fd7){var _0x4f3fe2=_0xe7eecc[_0x8bb6('0x46')][_0x8bb6('0x14')]({'plain':!![]});if(!_0x4f3fe2)throw new Error(_0x8bb6('0x47'));if(_0x4f3fe2[_0x8bb6('0x48')]==='user'){var _0x272e30=_0x104fd7[_0x8bb6('0x14')]({'plain':!![]});var _0x354295=[{'name':'InboundRoutes','value':_0x8bb6('0x15')},{'name':_0x8bb6('0x16'),'value':_0x8bb6('0x17')},{'name':_0x8bb6('0x18'),'value':_0x8bb6('0x19')}];var _0x5e64e5=_[_0x8bb6('0x20')](_0x354295,[_0x8bb6('0x1d'),_0x272e30[_0x8bb6('0x1f')]])[_0x8bb6('0x21')];return db[_0x8bb6('0x49')][_0x8bb6('0x20')]({'where':{'name':_0x5e64e5,'userProfileId':_0x4f3fe2['userProfileId']},'raw':!![]})[_0x8bb6('0x23')](function(_0x32ebb1){if(_0x32ebb1&&_0x32ebb1['autoAssociation']===0x0){return db[_0x8bb6('0x22')][_0x8bb6('0x41')]({'name':_0x272e30[_0x8bb6('0x21')],'resourceId':_0x272e30['id'],'type':_0x32ebb1[_0x8bb6('0x21')],'sectionId':_0x32ebb1['id']},{})[_0x8bb6('0x23')](function(){return _0x104fd7;});}else{return _0x104fd7;}})[_0x8bb6('0x3c')](function(_0x30b82f){logger[_0x8bb6('0x24')](_0x8bb6('0x4a'),_0x30b82f);throw _0x30b82f;});}return _0x104fd7;})[_0x8bb6('0x23')](respondWithResult(_0x2afba2,0xc9))['catch'](handleError(_0x2afba2,null));};exports[_0x8bb6('0x4b')]=function(_0x5df07b,_0x55d804){if(_0x5df07b['body']['id']){delete _0x5df07b[_0x8bb6('0x42')]['id'];}return db[_0x8bb6('0x27')][_0x8bb6('0x20')]({'where':{'id':_0x5df07b[_0x8bb6('0x3e')]['id']}})['then'](handleEntityNotFound(_0x55d804,null))['then'](function(_0x3a7e53){if(_0x3a7e53){return db[_0x8bb6('0x27')][_0x8bb6('0x4b')](_['pick'](_0x5df07b[_0x8bb6('0x42')],['exten',_0x8bb6('0x4c'),_0x8bb6('0x4d'),_0x8bb6('0x4e'),_0x8bb6('0x4f'),_0x8bb6('0x50'),'alias']),{'where':{'context':_0x3a7e53['context'],'exten':_0x3a7e53[_0x8bb6('0x44')]},'individualHooks':!![]})[_0x8bb6('0x23')](function(_0x212cf3){return _0x212cf3;});}return null;})[_0x8bb6('0x23')](respondWithStatusCode(_0x55d804,null))[_0x8bb6('0x3c')](handleError(_0x55d804,null));};exports[_0x8bb6('0x51')]=function(_0x4442a0,_0x329be9){var _0xef88ca=_0x4442a0['params']['id'];var _0x5422e4=_0x4442a0[_0x8bb6('0x42')];var _0x10ef83=0xc8;var _0x58ff88=null;return db[_0x8bb6('0x52')][_0x8bb6('0x53')]({'isolationLevel':db[_0x8bb6('0x52')][_0x8bb6('0x54')][_0x8bb6('0x55')][_0x8bb6('0x56')]},function(_0x36fef0){return db['VoiceExtension'][_0x8bb6('0x57')]({'where':{'id':_0xef88ca},'transaction':_0x36fef0})[_0x8bb6('0x23')](function(_0x241664){if(_0x241664){return db[_0x8bb6('0x27')][_0x8bb6('0x13')]({'where':{'VoiceExtensionId':_0xef88ca},'transaction':_0x36fef0})['then'](function(){var _0x43933d=_['map'](_0x5422e4,function(_0x1cee36){_0x1cee36[_0x8bb6('0x58')]=_0xef88ca;_0x1cee36['isApp']=!![];return _0x1cee36;});return _0x241664['createRouting'](_0x43933d);})['then'](function(_0x3bf1f5){return db[_0x8bb6('0x27')]['bulkCreate'](_0x3bf1f5,{'transaction':_0x36fef0});});}else{_0x10ef83=0x194;_0x58ff88=[];}});})[_0x8bb6('0x23')](function(){if(_0x10ef83!==0x194){return db[_0x8bb6('0x27')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0xef88ca},'order':_0x8bb6('0x59')})[_0x8bb6('0x23')](function(_0x30e682){_0x58ff88=_0x30e682;});}})[_0x8bb6('0x3c')](function(_0x17f289){_0x10ef83=0x1f4;logger[_0x8bb6('0x24')](_0x17f289[_0x8bb6('0x5a')]);if(_0x17f289[_0x8bb6('0x21')]){delete _0x17f289['name'];}_0x58ff88=_0x17f289;})[_0x8bb6('0x5b')](function(){if(_0x58ff88===null){_0x329be9[_0x8bb6('0xa')](_0x10ef83);}else{if(_0x10ef83===0x1f4){_0x329be9[_0x8bb6('0xb')](_0x10ef83)[_0x8bb6('0x25')](_0x58ff88);}else{_0x329be9[_0x8bb6('0xb')](_0x10ef83)[_0x8bb6('0xc')](_0x58ff88);}}});}; \ No newline at end of file +var _0x5ee7=['params','length','find','catch','create','body','outbound','startsWith','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','context','recordingFormat','cutdigits','alias','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','createRouting','bulkCreate','findAndCountAll','finally','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','then','get','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','filter','map','value','includes','type','name','destroy','end','error','stack','send','index','VoiceExtension','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','includeAll','include','findAll','rows','show'];(function(_0x289e64,_0x5adb3c){var _0x30246c=function(_0x1bf7f6){while(--_0x1bf7f6){_0x289e64['push'](_0x289e64['shift']());}};_0x30246c(++_0x5adb3c);}(_0x5ee7,0x138));var _0x75ee=function(_0x13018c,_0x5e9fe0){_0x13018c=_0x13018c-0x0;var _0x262284=_0x5ee7[_0x13018c];return _0x262284;};'use strict';var _=require(_0x75ee('0x0'));var Redis=require(_0x75ee('0x1'));var qs=require(_0x75ee('0x2'));var logger=require('../../config/logger')(_0x75ee('0x3'));var config=require(_0x75ee('0x4'));var db=require(_0x75ee('0x5'))['db'];config[_0x75ee('0x6')]=_[_0x75ee('0x7')](config[_0x75ee('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x75ee('0x8'))(new Redis(config[_0x75ee('0x6')]));require(_0x75ee('0x9'))['register'](socket);function respondWithStatusCode(_0x1f1ad4,_0x4f4e61){_0x4f4e61=_0x4f4e61||0xcc;return function(_0xbc988c){if(_0xbc988c){return _0x1f1ad4[_0x75ee('0xa')](_0x4f4e61);}return _0x1f1ad4['status'](_0x4f4e61)['end']();};}function respondWithResult(_0x42cf6a,_0x5001db){_0x5001db=_0x5001db||0xc8;return function(_0x29adc9){if(_0x29adc9){return _0x42cf6a[_0x75ee('0xb')](_0x5001db)['json'](_0x29adc9);}};}function respondWithFilteredResult(_0x5608e0,_0x18267e){return function(_0x3bdc0f){if(_0x3bdc0f){var _0x503a1a=typeof _0x18267e[_0x75ee('0xc')]===_0x75ee('0xd')&&typeof _0x18267e[_0x75ee('0xe')]===_0x75ee('0xd');var _0x28b6b2=_0x3bdc0f[_0x75ee('0xf')];var _0x5d3c34=_0x503a1a?0x0:_0x18267e[_0x75ee('0xc')];var _0x436b1a=_0x503a1a?_0x3bdc0f[_0x75ee('0xf')]:_0x18267e[_0x75ee('0xc')]+_0x18267e[_0x75ee('0xe')];var _0x268350;if(_0x436b1a>=_0x28b6b2){_0x436b1a=_0x28b6b2;_0x268350=0xc8;}else{_0x268350=0xce;}_0x5608e0[_0x75ee('0xb')](_0x268350);return _0x5608e0[_0x75ee('0x10')](_0x75ee('0x11'),_0x5d3c34+'-'+_0x436b1a+'/'+_0x28b6b2)[_0x75ee('0x12')](_0x3bdc0f);}return null;};}function removeEntity(_0x28b665){return function(_0x3c55e){if(_0x3c55e){return _0x3c55e['destroy']()[_0x75ee('0x13')](function(){var _0x5ad52a=_0x3c55e[_0x75ee('0x14')]({'plain':!![]});var _0x470d47=[{'name':_0x75ee('0x15'),'value':_0x75ee('0x16'),'ignore':![]},{'name':_0x75ee('0x17'),'value':'outbound','ignore':![]},{'name':_0x75ee('0x18'),'value':_0x75ee('0x19'),'ignore':![]}];var _0x12a25e=_(_0x470d47)[_0x75ee('0x1a')]('ignore')[_0x75ee('0x1b')](_0x75ee('0x1c'))[_0x75ee('0x1c')]();if(_[_0x75ee('0x1d')](_0x12a25e,_0x5ad52a[_0x75ee('0x1e')])){return;}var _0x356b95=_['find'](_0x470d47,[_0x75ee('0x1c'),_0x5ad52a[_0x75ee('0x1e')]])[_0x75ee('0x1f')];return db['UserProfileResource'][_0x75ee('0x20')]({'where':{'type':_0x356b95,'resourceId':_0x5ad52a['id']}})[_0x75ee('0x13')](function(){return _0x3c55e;});})['then'](function(){_0x28b665['status'](0xcc)[_0x75ee('0x21')]();});}};}function handleEntityNotFound(_0x2c4355){return function(_0x3e862a){if(!_0x3e862a){_0x2c4355[_0x75ee('0xa')](0x194);}return _0x3e862a;};}function handleError(_0x4a8f77,_0x402317){_0x402317=_0x402317||0x1f4;return function(_0x2436e7){logger[_0x75ee('0x22')](_0x2436e7[_0x75ee('0x23')]);if(_0x2436e7[_0x75ee('0x1f')]){delete _0x2436e7[_0x75ee('0x1f')];}_0x4a8f77[_0x75ee('0xb')](_0x402317)[_0x75ee('0x24')](_0x2436e7);};}exports[_0x75ee('0x25')]=function(_0xc61ec6,_0x4f81aa){var _0x381f00={},_0x47e77e={},_0x75623b={'count':0x0,'rows':[]};var _0x50f561=_[_0x75ee('0x1b')](db[_0x75ee('0x26')][_0x75ee('0x27')],function(_0x1254a6){return{'name':_0x1254a6[_0x75ee('0x28')],'type':_0x1254a6['type']['key']};});_0x47e77e[_0x75ee('0x29')]=_['map'](_0x50f561,_0x75ee('0x1f'));_0x47e77e[_0x75ee('0x2a')]=_[_0x75ee('0x2b')](_0xc61ec6[_0x75ee('0x2a')]);_0x47e77e[_0x75ee('0x2c')]=_[_0x75ee('0x2d')](_0x47e77e[_0x75ee('0x29')],_0x47e77e[_0x75ee('0x2a')]);_0x381f00[_0x75ee('0x2e')]=_[_0x75ee('0x2d')](_0x47e77e['model'],qs[_0x75ee('0x2f')](_0xc61ec6[_0x75ee('0x2a')]['fields']));_0x381f00[_0x75ee('0x2e')]=_0x381f00['attributes']['length']?_0x381f00['attributes']:_0x47e77e[_0x75ee('0x29')];if(!_0xc61ec6[_0x75ee('0x2a')][_0x75ee('0x30')](_0x75ee('0x31'))){_0x381f00[_0x75ee('0xe')]=qs[_0x75ee('0xe')](_0xc61ec6[_0x75ee('0x2a')][_0x75ee('0xe')]);_0x381f00[_0x75ee('0xc')]=qs[_0x75ee('0xc')](_0xc61ec6[_0x75ee('0x2a')][_0x75ee('0xc')]);}_0x381f00[_0x75ee('0x32')]=qs['sort'](_0xc61ec6[_0x75ee('0x2a')][_0x75ee('0x33')]);_0x381f00[_0x75ee('0x34')]=qs[_0x75ee('0x2c')](_['pick'](_0xc61ec6['query'],_0x47e77e['filters']),_0x50f561);if(_0xc61ec6[_0x75ee('0x2a')][_0x75ee('0x1a')]){_0x381f00[_0x75ee('0x34')]=_[_0x75ee('0x35')](_0x381f00[_0x75ee('0x34')],{'$or':_['map'](_0x50f561,function(_0x154b65){if(_0x154b65['type']!==_0x75ee('0x36')){var _0x4955e4={};_0x4955e4[_0x154b65[_0x75ee('0x1f')]]={'$like':'%'+_0xc61ec6[_0x75ee('0x2a')]['filter']+'%'};return _0x4955e4;}})});}_0x381f00=_[_0x75ee('0x35')]({},_0x381f00,_0xc61ec6['options']);var _0x5715fc={'where':_0x381f00[_0x75ee('0x34')]};return db[_0x75ee('0x26')]['count'](_0x5715fc)[_0x75ee('0x13')](function(_0x3d93b3){_0x75623b[_0x75ee('0xf')]=_0x3d93b3;if(_0xc61ec6[_0x75ee('0x2a')][_0x75ee('0x37')]){_0x381f00[_0x75ee('0x38')]=[{'all':!![]}];}return db[_0x75ee('0x26')][_0x75ee('0x39')](_0x381f00);})[_0x75ee('0x13')](function(_0x7d7c02){_0x75623b[_0x75ee('0x3a')]=_0x7d7c02;return _0x75623b;})[_0x75ee('0x13')](respondWithFilteredResult(_0x4f81aa,_0x381f00))['catch'](handleError(_0x4f81aa,null));};exports[_0x75ee('0x3b')]=function(_0x447b61,_0x3d5ed3){var _0x35ddad={'raw':![],'where':{'id':_0x447b61[_0x75ee('0x3c')]['id']}},_0x1a2417={};_0x1a2417['model']=_['keys'](db[_0x75ee('0x26')][_0x75ee('0x27')]);_0x1a2417[_0x75ee('0x2a')]=_['keys'](_0x447b61[_0x75ee('0x2a')]);_0x1a2417[_0x75ee('0x2c')]=_[_0x75ee('0x2d')](_0x1a2417[_0x75ee('0x29')],_0x1a2417['query']);_0x35ddad['attributes']=_[_0x75ee('0x2d')](_0x1a2417[_0x75ee('0x29')],qs['fields'](_0x447b61['query'][_0x75ee('0x2f')]));_0x35ddad['attributes']=_0x35ddad[_0x75ee('0x2e')][_0x75ee('0x3d')]?_0x35ddad['attributes']:_0x1a2417['model'];if(_0x447b61[_0x75ee('0x2a')]['includeAll']){_0x35ddad[_0x75ee('0x38')]=[{'all':!![]}];}_0x35ddad=_[_0x75ee('0x35')]({},_0x35ddad,_0x447b61['options']);return db['VoiceExtension'][_0x75ee('0x3e')](_0x35ddad)['then'](handleEntityNotFound(_0x3d5ed3,null))['then'](respondWithResult(_0x3d5ed3,null))[_0x75ee('0x3f')](handleError(_0x3d5ed3,null));};exports['destroy']=function(_0x4fd443,_0x5305e6){return db[_0x75ee('0x26')][_0x75ee('0x3e')]({'where':{'id':_0x4fd443[_0x75ee('0x3c')]['id']}})['then'](handleEntityNotFound(_0x5305e6,null))[_0x75ee('0x13')](removeEntity(_0x5305e6,null))[_0x75ee('0x3f')](handleError(_0x5305e6,null));};exports[_0x75ee('0x40')]=function(_0x14a88b,_0x3ca871){if(_0x14a88b[_0x75ee('0x41')][_0x75ee('0x1e')]===_0x75ee('0x42')&&!_[_0x75ee('0x43')](_0x14a88b[_0x75ee('0x41')][_0x75ee('0x44')],'_')){_0x14a88b['body'][_0x75ee('0x44')]='_'['concat'](_0x14a88b[_0x75ee('0x41')][_0x75ee('0x44')]);}return db[_0x75ee('0x26')]['create'](_0x14a88b[_0x75ee('0x41')],{'raw':![]})[_0x75ee('0x13')](function(_0x154468){var _0x3e128d=_0x14a88b[_0x75ee('0x45')][_0x75ee('0x14')]({'plain':!![]});if(!_0x3e128d)throw new Error(_0x75ee('0x46'));if(_0x3e128d[_0x75ee('0x47')]===_0x75ee('0x45')){var _0x27fc78=_0x154468[_0x75ee('0x14')]({'plain':!![]});var _0x5b53e7=[{'name':_0x75ee('0x15'),'value':'inbound'},{'name':_0x75ee('0x17'),'value':_0x75ee('0x42')},{'name':_0x75ee('0x18'),'value':_0x75ee('0x19')}];var _0xcfd5e6=_['find'](_0x5b53e7,[_0x75ee('0x1c'),_0x27fc78[_0x75ee('0x1e')]])[_0x75ee('0x1f')];return db[_0x75ee('0x48')][_0x75ee('0x3e')]({'where':{'name':_0xcfd5e6,'userProfileId':_0x3e128d['userProfileId']},'raw':!![]})['then'](function(_0x1364de){if(_0x1364de&&_0x1364de[_0x75ee('0x49')]===0x0){return db[_0x75ee('0x4a')][_0x75ee('0x40')]({'name':_0x27fc78['name'],'resourceId':_0x27fc78['id'],'type':_0x1364de[_0x75ee('0x1f')],'sectionId':_0x1364de['id']},{})[_0x75ee('0x13')](function(){return _0x154468;});}else{return _0x154468;}})[_0x75ee('0x3f')](function(_0x3813f8){logger[_0x75ee('0x22')](_0x75ee('0x4b'),_0x3813f8);throw _0x3813f8;});}return _0x154468;})[_0x75ee('0x13')](respondWithResult(_0x3ca871,0xc9))[_0x75ee('0x3f')](handleError(_0x3ca871,null));};exports['update']=function(_0x41f43d,_0x29f12f){if(_0x41f43d['body']['id']){delete _0x41f43d[_0x75ee('0x41')]['id'];}return db[_0x75ee('0x26')]['find']({'where':{'id':_0x41f43d[_0x75ee('0x3c')]['id']}})[_0x75ee('0x13')](handleEntityNotFound(_0x29f12f,null))[_0x75ee('0x13')](function(_0x4ef383){if(_0x4ef383){return db[_0x75ee('0x26')]['update'](_[_0x75ee('0x4c')](_0x41f43d[_0x75ee('0x41')],[_0x75ee('0x44'),_0x75ee('0x4d'),'description',_0x75ee('0x4e'),_0x75ee('0x4f'),'mandatoryDisposition',_0x75ee('0x50')]),{'where':{'context':_0x4ef383['context'],'exten':_0x4ef383[_0x75ee('0x44')]},'individualHooks':!![]})[_0x75ee('0x13')](function(_0x17e9fc){return _0x17e9fc;});}return null;})['then'](respondWithStatusCode(_0x29f12f,null))[_0x75ee('0x3f')](handleError(_0x29f12f,null));};exports[_0x75ee('0x51')]=function(_0x20a577,_0x2a62f4){var _0x2739a0=_0x20a577[_0x75ee('0x3c')]['id'];var _0x2dac02=_0x20a577[_0x75ee('0x41')];var _0x213361=0xc8;var _0x2baf7d=null;return db['sequelize'][_0x75ee('0x52')]({'isolationLevel':db[_0x75ee('0x53')][_0x75ee('0x54')][_0x75ee('0x55')][_0x75ee('0x56')]},function(_0x3de169){return db['VoiceExtension'][_0x75ee('0x57')]({'where':{'id':_0x2739a0},'transaction':_0x3de169})[_0x75ee('0x13')](function(_0x4ab35a){if(_0x4ab35a){return db[_0x75ee('0x26')]['destroy']({'where':{'VoiceExtensionId':_0x2739a0},'transaction':_0x3de169})[_0x75ee('0x13')](function(){var _0xbb29af=_[_0x75ee('0x1b')](_0x2dac02,function(_0x2777e7){_0x2777e7[_0x75ee('0x58')]=_0x2739a0;_0x2777e7['isApp']=!![];return _0x2777e7;});return _0x4ab35a[_0x75ee('0x59')](_0xbb29af);})['then'](function(_0x23c4e4){return db[_0x75ee('0x26')][_0x75ee('0x5a')](_0x23c4e4,{'transaction':_0x3de169});});}else{_0x213361=0x194;_0x2baf7d=[];}});})[_0x75ee('0x13')](function(){if(_0x213361!==0x194){return db['VoiceExtension'][_0x75ee('0x5b')]({'where':{'isApp':!![],'VoiceExtensionId':_0x2739a0},'order':'priority'})[_0x75ee('0x13')](function(_0x3e1b5a){_0x2baf7d=_0x3e1b5a;});}})[_0x75ee('0x3f')](function(_0x33093d){_0x213361=0x1f4;logger['error'](_0x33093d[_0x75ee('0x23')]);if(_0x33093d['name']){delete _0x33093d[_0x75ee('0x1f')];}_0x2baf7d=_0x33093d;})[_0x75ee('0x5c')](function(){if(_0x2baf7d===null){_0x2a62f4[_0x75ee('0xa')](_0x213361);}else{if(_0x213361===0x1f4){_0x2a62f4['status'](_0x213361)[_0x75ee('0x24')](_0x2baf7d);}else{_0x2a62f4[_0x75ee('0xb')](_0x213361)[_0x75ee('0x12')](_0x2baf7d);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 6cacc30..8486472 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 _0x70b8=['hook','events','../../mysqldb','VoiceExtension','update','remove','emit','hasOwnProperty'];(function(_0x46b6d1,_0x42d6b9){var _0x421c8b=function(_0x486019){while(--_0x486019){_0x46b6d1['push'](_0x46b6d1['shift']());}};_0x421c8b(++_0x42d6b9);}(_0x70b8,0x71));var _0x870b=function(_0x1efa3c,_0x197716){_0x1efa3c=_0x1efa3c-0x0;var _0x38d0b9=_0x70b8[_0x1efa3c];return _0x38d0b9;};'use strict';var EventEmitter=require(_0x870b('0x0'));var VoiceExtension=require(_0x870b('0x1'))['db'][_0x870b('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x870b('0x3'),'afterDestroy':_0x870b('0x4')};function emitEvent(_0x5125e9){return function(_0x4500cd,_0x3050db,_0x5db243){VoiceExtensionEvents[_0x870b('0x5')](_0x5125e9+':'+_0x4500cd['id'],_0x4500cd);VoiceExtensionEvents[_0x870b('0x5')](_0x5125e9,_0x4500cd);_0x5db243(null);};}for(var e in events){if(events[_0x870b('0x6')](e)){var event=events[e];VoiceExtension[_0x870b('0x7')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0x51e4=['../../mysqldb','VoiceExtension','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2f4311,_0xd2d511){var _0x309ccb=function(_0x3ddf5c){while(--_0x3ddf5c){_0x2f4311['push'](_0x2f4311['shift']());}};_0x309ccb(++_0xd2d511);}(_0x51e4,0x182));var _0x451e=function(_0x13fd59,_0x2e05b1){_0x13fd59=_0x13fd59-0x0;var _0x2e6ce7=_0x51e4[_0x13fd59];return _0x2e6ce7;};'use strict';var EventEmitter=require(_0x451e('0x0'));var VoiceExtension=require(_0x451e('0x1'))['db'][_0x451e('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x451e('0x3'),'afterDestroy':_0x451e('0x4')};function emitEvent(_0x1d5a21){return function(_0xe54cbb,_0x2fc34b,_0x3102cd){VoiceExtensionEvents[_0x451e('0x5')](_0x1d5a21+':'+_0xe54cbb['id'],_0xe54cbb);VoiceExtensionEvents[_0x451e('0x5')](_0x1d5a21,_0xe54cbb);_0x3102cd(null);};}for(var e in events){if(events[_0x451e('0x6')](e)){var event=events[e];VoiceExtension[_0x451e('0x7')](e,emitEvent(event));}}module[_0x451e('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index f4cab77..c5093e4 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 _0x6ec9=['name','phone','param','prefix','${EXTEN}','join','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','then','interval','*,*,*,*','intervals','IntervalId','map','filter','tag','toLowerCase','CDR(tag)=','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','outboundDial','appdata','priority','last','concat','catch','define','voice_extensions','Hangup','lodash','exports','Set','CDR(type)=','type','alias','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','context','XCALLY-MOTION-ANSWER=0','exten','MONITOR_OPTIONS=ab','outbound','NoOp','CDR(destination)=','${EXTEN:','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','length'];(function(_0x4fb9ad,_0x128adf){var _0x318748=function(_0x2ee628){while(--_0x2ee628){_0x4fb9ad['push'](_0x4fb9ad['shift']());}};_0x318748(++_0x128adf);}(_0x6ec9,0x174));var _0x96ec=function(_0x28d009,_0x4c5880){_0x28d009=_0x28d009-0x0;var _0x471475=_0x6ec9[_0x28d009];return _0x471475;};'use strict';var _=require(_0x96ec('0x0'));var attributes=require('./voiceExtension.attributes');module[_0x96ec('0x1')]=function(_0x4cc5ad){var _0x37c970=_0x4cc5ad['models'];function _0x15e89a(_0x51fc7c){var _0x112569=0x2;var _0x286bd7=[{'type':_0x51fc7c['type'],'app':_0x96ec('0x2'),'appdata':_0x96ec('0x3')+_0x51fc7c[_0x96ec('0x4')],'context':_0x51fc7c['context'],'exten':_0x51fc7c['exten'],'priority':_0x112569++,'VoiceExtensionId':_0x51fc7c['id']},{'type':_0x51fc7c['type'],'app':_0x51fc7c[_0x96ec('0x5')]?_0x96ec('0x2'):'NoOp','appdata':_0x51fc7c[_0x96ec('0x5')]?_0x96ec('0x6')+_0x51fc7c[_0x96ec('0x5')]:_0x96ec('0x7'),'context':_0x51fc7c['context'],'exten':_0x51fc7c['exten'],'priority':_0x112569++,'VoiceExtensionId':_0x51fc7c['id']}];if(_0x51fc7c[_0x96ec('0x4')]===_0x96ec('0x8')){_0x286bd7[_0x96ec('0x9')]({'type':_0x96ec('0x8'),'app':_0x96ec('0x2'),'appdata':_0x96ec('0xa')+_0x51fc7c['id'],'context':_0x51fc7c[_0x96ec('0xb')],'exten':_0x51fc7c['exten'],'priority':_0x112569++,'VoiceExtensionId':_0x51fc7c['id']});}_0x286bd7[_0x96ec('0x9')]({'type':_0x51fc7c[_0x96ec('0x4')],'app':_0x96ec('0x2'),'appdata':_0x96ec('0xc'),'context':_0x51fc7c[_0x96ec('0xb')],'exten':_0x51fc7c[_0x96ec('0xd')],'priority':_0x112569++,'VoiceExtensionId':_0x51fc7c['id']},{'type':_0x51fc7c[_0x96ec('0x4')],'app':_0x96ec('0x2'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x51fc7c['context'],'exten':_0x51fc7c[_0x96ec('0xd')],'priority':_0x112569++,'VoiceExtensionId':_0x51fc7c['id']},{'type':_0x51fc7c[_0x96ec('0x4')],'app':_0x96ec('0x2'),'appdata':_0x96ec('0xe'),'context':_0x51fc7c[_0x96ec('0xb')],'exten':_0x51fc7c[_0x96ec('0xd')],'priority':_0x112569++,'VoiceExtensionId':_0x51fc7c['id']});return _0x286bd7;}function _0x5e9f05(_0x30c229){var _0x3dfbb6=0x2;var _0x20a11f=[{'type':'outbound','app':_0x96ec('0x2'),'appdata':'CDR(type)=outbound','context':_0x30c229[_0x96ec('0xb')],'exten':_0x30c229['exten'],'priority':_0x3dfbb6++,'VoiceExtensionId':_0x30c229['id']},{'type':_0x96ec('0xf'),'app':_0x30c229[_0x96ec('0x5')]?_0x96ec('0x2'):_0x96ec('0x10'),'appdata':_0x30c229[_0x96ec('0x5')]?_0x96ec('0x6')+_0x30c229['alias']:_0x96ec('0x7'),'context':_0x30c229[_0x96ec('0xb')],'exten':_0x30c229[_0x96ec('0xd')],'priority':_0x3dfbb6++,'VoiceExtensionId':_0x30c229['id']},{'type':_0x96ec('0xf'),'app':_0x96ec('0x2'),'appdata':_0x96ec('0x11')+(_0x30c229['cutdigits']?_0x96ec('0x12')+_0x30c229[_0x96ec('0x13')]+'}':'${EXTEN}'),'context':_0x30c229[_0x96ec('0xb')],'exten':_0x30c229['exten'],'priority':_0x3dfbb6++,'VoiceExtensionId':_0x30c229['id']},{'type':_0x96ec('0xf'),'app':'Set','appdata':_0x96ec('0xa')+_0x30c229['id'],'context':_0x30c229['context'],'exten':_0x30c229[_0x96ec('0xd')],'priority':_0x3dfbb6++,'VoiceExtensionId':_0x30c229['id']},{'type':_0x96ec('0xf'),'app':_0x96ec('0x14'),'appdata':_0x96ec('0x15')+(_0x3dfbb6+0x2)+_0x96ec('0x16')+(_0x3dfbb6+0x1)+')','context':_0x30c229['context'],'exten':_0x30c229['exten'],'priority':_0x3dfbb6++,'VoiceExtensionId':_0x30c229['id']},{'type':_0x96ec('0xf'),'app':'Set','appdata':_0x30c229[_0x96ec('0x13')]?_0x96ec('0x17')+_0x30c229['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x30c229[_0x96ec('0xb')],'exten':_0x30c229[_0x96ec('0xd')],'priority':_0x3dfbb6++,'VoiceExtensionId':_0x30c229['id']},{'type':_0x96ec('0xf'),'app':'Set','appdata':_0x96ec('0xc'),'context':_0x30c229[_0x96ec('0xb')],'exten':_0x30c229[_0x96ec('0xd')],'priority':_0x3dfbb6++,'VoiceExtensionId':_0x30c229['id']},{'type':'outbound','app':_0x96ec('0x2'),'appdata':_0x96ec('0x18'),'context':_0x30c229[_0x96ec('0xb')],'exten':_0x30c229[_0x96ec('0xd')],'priority':_0x3dfbb6++,'VoiceExtensionId':_0x30c229['id']},{'type':_0x96ec('0xf'),'app':_0x96ec('0x2'),'appdata':_0x96ec('0xe'),'context':_0x30c229[_0x96ec('0xb')],'exten':_0x30c229[_0x96ec('0xd')],'priority':_0x3dfbb6++,'VoiceExtensionId':_0x30c229['id']},{'type':_0x96ec('0xf'),'app':_0x96ec('0x2'),'appdata':_0x96ec('0x19')+_0x30c229['id'],'context':_0x30c229['context'],'exten':_0x30c229[_0x96ec('0xd')],'priority':_0x3dfbb6++,'VoiceExtensionId':_0x30c229['id']}];if(_0x30c229[_0x96ec('0x1a')](_0x96ec('0x1b'))&&_0x30c229['recordingFormat']!==_0x96ec('0x1c')){_0x20a11f[_0x96ec('0x9')]({'type':_0x96ec('0xf'),'app':_0x96ec('0x2'),'appdata':_0x96ec('0x1d'),'context':_0x30c229[_0x96ec('0xb')],'exten':_0x30c229[_0x96ec('0xd')],'priority':_0x3dfbb6++,'VoiceExtensionId':_0x30c229['id']},{'type':_0x96ec('0xf'),'app':'Set','appdata':_0x96ec('0x1e')+_0x30c229['recordingFormat']||_0x96ec('0x1f'),'context':_0x30c229[_0x96ec('0xb')],'exten':_0x30c229[_0x96ec('0xd')],'priority':_0x3dfbb6++,'VoiceExtensionId':_0x30c229['id']});}return _0x20a11f;}function _0x48c90e(_0x45cd38,_0xfb781){var _0x5bb643=[{'name':_0x96ec('0x20'),'param':0x0},{'name':_0x96ec('0x21'),'param':0x1},{'name':_0x96ec('0x22'),'param':0x2},{'name':_0x96ec('0x23'),'param':0x3}];var _0xf17c77={};var _0x3553c5=_0xfb781[_0x96ec('0x24')](',');var _0x1a5d88=[];for(var _0x1566b9=0x0;_0x1566b9<_0x5bb643[_0x96ec('0x25')];_0x1566b9++){switch(_0x5bb643[_0x1566b9][_0x96ec('0x26')]){case'trunk':_0xf17c77[_0x96ec('0x20')]=_0x3553c5[_0x5bb643[_0x1566b9]['param']][_0x96ec('0x24')]('/')[0x1];_0xf17c77[_0x96ec('0x27')]=_0x3553c5[_0x5bb643[_0x1566b9][_0x96ec('0x28')]][_0x96ec('0x24')]('/')[0x2];_0xf17c77[_0x96ec('0x29')]=_0xf17c77[_0x96ec('0x27')]?_0xf17c77['phone'][_0x96ec('0x24')]('$')[0x0]:undefined;_0xf17c77['phone']=_0x45cd38[_0x96ec('0x13')]?(_0xf17c77[_0x96ec('0x29')]||'')+_0x96ec('0x12')+_0x45cd38[_0x96ec('0x13')]+'}':(_0xf17c77[_0x96ec('0x29')]||'')+_0x96ec('0x2a');_0x1a5d88[_0x5bb643[_0x1566b9][_0x96ec('0x28')]]=['SIP',_0xf17c77[_0x96ec('0x20')],_0xf17c77['phone']][_0x96ec('0x2b')]('/');break;case _0x96ec('0x22'):_0xf17c77['options']=_0x3553c5[_0x5bb643[_0x1566b9][_0x96ec('0x28')]];if(_0x45cd38[_0x96ec('0x1b')]!=='none'){if(_0xf17c77['options'][_0x96ec('0x2c')](_0x96ec('0x2d'))<0x0){_0xf17c77[_0x96ec('0x22')]+=_0x96ec('0x2d');}}else{_0xf17c77['options']=_0xf17c77[_0x96ec('0x22')]['replace']('U(xcally-mixmonitor-context)','');}_0x1a5d88[_0x5bb643[_0x1566b9][_0x96ec('0x28')]]=_0xf17c77[_0x96ec('0x22')];break;default:_0x1a5d88[_0x5bb643[_0x1566b9][_0x96ec('0x28')]]=_0x3553c5[_0x5bb643[_0x1566b9]['param']];}}return _0x1a5d88[_0x96ec('0x2b')](',');}function _0xc00a44(_0x5851ec,_0x649162,_0x19e875){return new Promise(function(_0x29979e,_0x1f1d32){var _0x5bb6c4=[];if(_[_0x96ec('0x2e')](_0x649162))return _0x29979e(_0x5bb6c4);_0x37c970[_0x96ec('0x2f')]['findAll']({'attributes':['id','interval','IntervalId'],'raw':!![]})[_0x96ec('0x30')](function(_0x3837b){for(var _0x151534=0x0,_0x1e0328=0x0;_0x151534<_0x649162[_0x96ec('0x25')];_0x151534++,_0x1e0328=0x0){var _0x8cbed8=_0x649162[_0x151534];var _0x39504b=[];var _0x5262e8=[];delete _0x8cbed8['id'];if(_0x8cbed8[_0x96ec('0x31')]!==_0x96ec('0x32')){_0x8cbed8[_0x96ec('0x33')]=[_0x8cbed8[_0x96ec('0x31')]];}else{_0x8cbed8[_0x96ec('0x33')]=_0x8cbed8[_0x96ec('0x34')]?_[_0x96ec('0x35')](_[_0x96ec('0x36')](_0x3837b,{'IntervalId':_0x8cbed8['IntervalId']}),'interval'):[];}_0x8cbed8['context']=_0x5851ec[_0x96ec('0xb')];_0x8cbed8[_0x96ec('0xd')]=_0x5851ec[_0x96ec('0xd')];if(_0x8cbed8[_0x96ec('0x4')])_0x8cbed8[_0x96ec('0x4')]=_0x8cbed8[_0x96ec('0x4')]['toLowerCase']();if(_0x5851ec[_0x96ec('0x4')]===_0x96ec('0xf')){if(_0x8cbed8[_0x96ec('0x1a')](_0x96ec('0x37'))&&_0x8cbed8[_0x96ec('0x37')]&&_0x8cbed8[_0x96ec('0x37')]!=='--'){_0x39504b[_0x96ec('0x9')]({'type':_0x8cbed8[_0x96ec('0x4')][_0x96ec('0x38')](),'app':_0x96ec('0x2'),'appdata':_0x96ec('0x39')+_0x8cbed8[_0x96ec('0x37')],'context':_0x5851ec[_0x96ec('0xb')],'exten':_0x5851ec[_0x96ec('0xd')],'priority':_0x8cbed8['intervals'][_0x96ec('0x25')]+_0x19e875+_0x1e0328++,'VoiceExtensionId':_0x5851ec['id']});}_0x39504b[_0x96ec('0x9')]({'type':_0x8cbed8[_0x96ec('0x4')]['toLowerCase'](),'app':_0x96ec('0x14'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x8cbed8[_0x96ec('0x3a')]?_0x96ec('0x3b')+_0x8cbed8[_0x96ec('0x3a')]+')':_0x96ec('0x3c')),'context':_0x5851ec[_0x96ec('0xb')],'exten':_0x5851ec['exten'],'priority':_0x8cbed8['intervals'][_0x96ec('0x25')]+_0x19e875+_0x1e0328++,'VoiceExtensionId':_0x5851ec['id']});}else{if(_0x8cbed8['hasOwnProperty'](_0x96ec('0x3d'))){if(['queue',_0x96ec('0x3e')][_0x96ec('0x3f')](_0x8cbed8[_0x96ec('0x40')][_0x96ec('0x38')]())&&_0x8cbed8[_0x96ec('0x41')]!==_0x96ec('0x42')){if(_0x8cbed8[_0x96ec('0x3d')]){_0x39504b[_0x96ec('0x9')]({'type':_0x8cbed8[_0x96ec('0x4')][_0x96ec('0x38')](),'app':_0x96ec('0x14'),'appdata':_0x96ec('0x43'),'context':_0x5851ec[_0x96ec('0xb')],'exten':_0x5851ec[_0x96ec('0xd')],'priority':_0x8cbed8[_0x96ec('0x33')][_0x96ec('0x25')]+_0x19e875+_0x1e0328++,'VoiceExtensionId':_0x5851ec['id']});_0x39504b[_0x96ec('0x9')]({'type':_0x8cbed8[_0x96ec('0x4')]['toLowerCase'](),'app':_0x96ec('0x2'),'appdata':_0x96ec('0x44'),'context':_0x5851ec[_0x96ec('0xb')],'exten':_0x5851ec[_0x96ec('0xd')],'priority':_0x8cbed8['intervals'][_0x96ec('0x25')]+_0x19e875+_0x1e0328++,'VoiceExtensionId':_0x5851ec['id']});}else{_0x39504b[_0x96ec('0x9')]({'type':_0x8cbed8[_0x96ec('0x4')][_0x96ec('0x38')](),'app':_0x96ec('0x14'),'appdata':_0x96ec('0x45'),'context':_0x5851ec[_0x96ec('0xb')],'exten':_0x5851ec[_0x96ec('0xd')],'priority':_0x8cbed8[_0x96ec('0x33')][_0x96ec('0x25')]+_0x19e875+_0x1e0328++,'VoiceExtensionId':_0x5851ec['id']});_0x39504b[_0x96ec('0x9')]({'type':_0x8cbed8[_0x96ec('0x4')][_0x96ec('0x38')](),'app':_0x96ec('0x2'),'appdata':_0x96ec('0x46'),'context':_0x5851ec[_0x96ec('0xb')],'exten':_0x5851ec[_0x96ec('0xd')],'priority':_0x8cbed8['intervals']['length']+_0x19e875+_0x1e0328++,'VoiceExtensionId':_0x5851ec['id']});}}}}for(var _0x41afd1=0x0;_0x41afd1<_0x8cbed8['intervals'][_0x96ec('0x25')];_0x41afd1++){var _0x5634ea=_0x19e875+_0x8cbed8[_0x96ec('0x33')][_0x96ec('0x25')];var _0x24640a=_0x41afd1===_0x8cbed8[_0x96ec('0x33')][_0x96ec('0x25')]-0x1?_0x19e875+_0x39504b[_0x96ec('0x25')]+_0x5262e8['length']+0x2:_0x19e875+_0x41afd1+0x1;_0x39504b[_0x96ec('0x47')](_0x41afd1,0x0,{'type':_0x5851ec['type'],'app':_0x96ec('0x48'),'appdata':_0x8cbed8[_0x96ec('0x33')][_0x41afd1]+'?'+_0x5851ec['context']+',${EXTEN},'+_0x5634ea+':'+_0x5851ec[_0x96ec('0xb')]+',${EXTEN},'+_0x24640a,'exten':_0x5851ec[_0x96ec('0xd')],'context':_0x5851ec[_0x96ec('0xb')],'priority':_0x19e875+_0x41afd1,'VoiceExtensionId':_0x5851ec['id']});}if(_0x8cbed8[_0x96ec('0x41')]===_0x96ec('0x49'))_0x8cbed8[_0x96ec('0x4a')]=_0x48c90e(_0x5851ec,_0x8cbed8[_0x96ec('0x4a')]);_0x8cbed8[_0x96ec('0x4b')]=_0x39504b['length']?_[_0x96ec('0x4c')](_0x39504b)[_0x96ec('0x4b')]+0x1:_0x19e875;_0x5bb6c4=_[_0x96ec('0x4d')](_0x5bb6c4,_0x39504b,[_0x8cbed8],_0x5262e8);_0x19e875=_[_0x96ec('0x4c')](_0x5bb6c4)[_0x96ec('0x4b')]+0x1;}return _0x29979e(_0x5bb6c4);})[_0x96ec('0x4e')](function(_0x68e58f){_0x1f1d32(_0x68e58f);});});}return _0x4cc5ad[_0x96ec('0x4f')]('VoiceExtension',attributes,{'tableName':_0x96ec('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x5c803e){var _0x105ca6=this['get']({'plain':!![]});var _0x3d43af=_0x105ca6[_0x96ec('0x4')]===_0x96ec('0xf')?_0x5e9f05(_0x105ca6):_0x15e89a(_0x105ca6);return _0xc00a44(_0x105ca6,_0x5c803e,_[_0x96ec('0x4c')](_0x3d43af)[_0x96ec('0x4b')]+0x1)[_0x96ec('0x30')](function(_0x4f03fe){var _0x3f8748=_[_0x96ec('0x4d')](_0x3d43af,_0x4f03fe);_0x3f8748[_0x96ec('0x9')]({'type':_0x105ca6[_0x96ec('0x4')],'app':_0x96ec('0x51'),'exten':_0x105ca6[_0x96ec('0xd')],'context':_0x105ca6[_0x96ec('0xb')],'priority':_['last'](_0x3f8748)['priority']+0x1,'VoiceExtensionId':_0x105ca6['id']});return _0x3f8748;});}}});}; \ No newline at end of file +var _0xe14b=['ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','timeout','split','length','name','trunk','param','phone','prefix','${EXTEN:','${EXTEN}','SIP','join','options','none','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','IntervalId','then','interval','*,*,*,*','intervals','map','filter','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','queue','playback','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','priority','last','concat','catch','define','VoiceExtension','get','lodash','./voiceExtension.attributes','models','type','Set','CDR(type)=','context','exten','alias','CDR(routeAlias)=','No\x20alias\x20set','inbound','CDR(routeid)=','push','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','NoOp','cutdigits'];(function(_0x257b45,_0x3820d5){var _0x4ecab5=function(_0x3c7f52){while(--_0x3c7f52){_0x257b45['push'](_0x257b45['shift']());}};_0x4ecab5(++_0x3820d5);}(_0xe14b,0x93));var _0xbe14=function(_0x5f4b59,_0x42af00){_0x5f4b59=_0x5f4b59-0x0;var _0x1fcd9a=_0xe14b[_0x5f4b59];return _0x1fcd9a;};'use strict';var _=require(_0xbe14('0x0'));var attributes=require(_0xbe14('0x1'));module['exports']=function(_0x5cc4d8){var _0x11c3a0=_0x5cc4d8[_0xbe14('0x2')];function _0x48a116(_0x7d3665){var _0x5ce8fb=0x2;var _0x496c04=[{'type':_0x7d3665[_0xbe14('0x3')],'app':_0xbe14('0x4'),'appdata':_0xbe14('0x5')+_0x7d3665[_0xbe14('0x3')],'context':_0x7d3665[_0xbe14('0x6')],'exten':_0x7d3665[_0xbe14('0x7')],'priority':_0x5ce8fb++,'VoiceExtensionId':_0x7d3665['id']},{'type':_0x7d3665[_0xbe14('0x3')],'app':_0x7d3665['alias']?'Set':'NoOp','appdata':_0x7d3665[_0xbe14('0x8')]?_0xbe14('0x9')+_0x7d3665[_0xbe14('0x8')]:_0xbe14('0xa'),'context':_0x7d3665['context'],'exten':_0x7d3665['exten'],'priority':_0x5ce8fb++,'VoiceExtensionId':_0x7d3665['id']}];if(_0x7d3665[_0xbe14('0x3')]===_0xbe14('0xb')){_0x496c04['push']({'type':_0xbe14('0xb'),'app':_0xbe14('0x4'),'appdata':_0xbe14('0xc')+_0x7d3665['id'],'context':_0x7d3665[_0xbe14('0x6')],'exten':_0x7d3665[_0xbe14('0x7')],'priority':_0x5ce8fb++,'VoiceExtensionId':_0x7d3665['id']});}_0x496c04[_0xbe14('0xd')]({'type':_0x7d3665[_0xbe14('0x3')],'app':_0xbe14('0x4'),'appdata':_0xbe14('0xe'),'context':_0x7d3665[_0xbe14('0x6')],'exten':_0x7d3665[_0xbe14('0x7')],'priority':_0x5ce8fb++,'VoiceExtensionId':_0x7d3665['id']},{'type':_0x7d3665[_0xbe14('0x3')],'app':_0xbe14('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x7d3665['context'],'exten':_0x7d3665[_0xbe14('0x7')],'priority':_0x5ce8fb++,'VoiceExtensionId':_0x7d3665['id']},{'type':_0x7d3665[_0xbe14('0x3')],'app':_0xbe14('0x4'),'appdata':_0xbe14('0xf'),'context':_0x7d3665['context'],'exten':_0x7d3665[_0xbe14('0x7')],'priority':_0x5ce8fb++,'VoiceExtensionId':_0x7d3665['id']});return _0x496c04;}function _0xe9c3ec(_0xfd7b8f){var _0x123ede=0x2;var _0x38f1ea=[{'type':_0xbe14('0x10'),'app':_0xbe14('0x4'),'appdata':'CDR(type)=outbound','context':_0xfd7b8f[_0xbe14('0x6')],'exten':_0xfd7b8f[_0xbe14('0x7')],'priority':_0x123ede++,'VoiceExtensionId':_0xfd7b8f['id']},{'type':_0xbe14('0x10'),'app':_0xfd7b8f[_0xbe14('0x8')]?_0xbe14('0x4'):_0xbe14('0x11'),'appdata':_0xfd7b8f['alias']?_0xbe14('0x9')+_0xfd7b8f[_0xbe14('0x8')]:_0xbe14('0xa'),'context':_0xfd7b8f[_0xbe14('0x6')],'exten':_0xfd7b8f[_0xbe14('0x7')],'priority':_0x123ede++,'VoiceExtensionId':_0xfd7b8f['id']},{'type':'outbound','app':_0xbe14('0x4'),'appdata':'CDR(destination)='+(_0xfd7b8f[_0xbe14('0x12')]?'${EXTEN:'+_0xfd7b8f[_0xbe14('0x12')]+'}':'${EXTEN}'),'context':_0xfd7b8f[_0xbe14('0x6')],'exten':_0xfd7b8f[_0xbe14('0x7')],'priority':_0x123ede++,'VoiceExtensionId':_0xfd7b8f['id']},{'type':'outbound','app':_0xbe14('0x4'),'appdata':'CDR(routeid)='+_0xfd7b8f['id'],'context':_0xfd7b8f[_0xbe14('0x6')],'exten':_0xfd7b8f['exten'],'priority':_0x123ede++,'VoiceExtensionId':_0xfd7b8f['id']},{'type':_0xbe14('0x10'),'app':_0xbe14('0x13'),'appdata':_0xbe14('0x14')+(_0x123ede+0x2)+_0xbe14('0x15')+(_0x123ede+0x1)+')','context':_0xfd7b8f[_0xbe14('0x6')],'exten':_0xfd7b8f[_0xbe14('0x7')],'priority':_0x123ede++,'VoiceExtensionId':_0xfd7b8f['id']},{'type':'outbound','app':_0xbe14('0x4'),'appdata':_0xfd7b8f[_0xbe14('0x12')]?_0xbe14('0x16')+_0xfd7b8f[_0xbe14('0x12')]+'}':'CDR(prefix)=noprefix','context':_0xfd7b8f[_0xbe14('0x6')],'exten':_0xfd7b8f[_0xbe14('0x7')],'priority':_0x123ede++,'VoiceExtensionId':_0xfd7b8f['id']},{'type':'outbound','app':_0xbe14('0x4'),'appdata':_0xbe14('0xe'),'context':_0xfd7b8f[_0xbe14('0x6')],'exten':_0xfd7b8f[_0xbe14('0x7')],'priority':_0x123ede++,'VoiceExtensionId':_0xfd7b8f['id']},{'type':_0xbe14('0x10'),'app':_0xbe14('0x4'),'appdata':_0xbe14('0x17'),'context':_0xfd7b8f[_0xbe14('0x6')],'exten':_0xfd7b8f[_0xbe14('0x7')],'priority':_0x123ede++,'VoiceExtensionId':_0xfd7b8f['id']},{'type':_0xbe14('0x10'),'app':_0xbe14('0x4'),'appdata':_0xbe14('0xf'),'context':_0xfd7b8f[_0xbe14('0x6')],'exten':_0xfd7b8f[_0xbe14('0x7')],'priority':_0x123ede++,'VoiceExtensionId':_0xfd7b8f['id']},{'type':_0xbe14('0x10'),'app':_0xbe14('0x4'),'appdata':_0xbe14('0x18')+_0xfd7b8f['id'],'context':_0xfd7b8f[_0xbe14('0x6')],'exten':_0xfd7b8f[_0xbe14('0x7')],'priority':_0x123ede++,'VoiceExtensionId':_0xfd7b8f['id']}];if(_0xfd7b8f[_0xbe14('0x19')]('recordingFormat')&&_0xfd7b8f[_0xbe14('0x1a')]!=='none'){_0x38f1ea['push']({'type':_0xbe14('0x10'),'app':'Set','appdata':_0xbe14('0x1b'),'context':_0xfd7b8f[_0xbe14('0x6')],'exten':_0xfd7b8f['exten'],'priority':_0x123ede++,'VoiceExtensionId':_0xfd7b8f['id']},{'type':'outbound','app':'Set','appdata':_0xbe14('0x1c')+_0xfd7b8f[_0xbe14('0x1a')]||'wav','context':_0xfd7b8f[_0xbe14('0x6')],'exten':_0xfd7b8f[_0xbe14('0x7')],'priority':_0x123ede++,'VoiceExtensionId':_0xfd7b8f['id']});}return _0x38f1ea;}function _0x452635(_0x1aa849,_0x29c23e){var _0x5ef1e5=[{'name':'trunk','param':0x0},{'name':_0xbe14('0x1d'),'param':0x1},{'name':'options','param':0x2},{'name':'url','param':0x3}];var _0x5c5e9f={};var _0x163ef7=_0x29c23e[_0xbe14('0x1e')](',');var _0x2bb45=[];for(var _0x3dbacb=0x0;_0x3dbacb<_0x5ef1e5[_0xbe14('0x1f')];_0x3dbacb++){switch(_0x5ef1e5[_0x3dbacb][_0xbe14('0x20')]){case _0xbe14('0x21'):_0x5c5e9f[_0xbe14('0x21')]=_0x163ef7[_0x5ef1e5[_0x3dbacb][_0xbe14('0x22')]][_0xbe14('0x1e')]('/')[0x1];_0x5c5e9f[_0xbe14('0x23')]=_0x163ef7[_0x5ef1e5[_0x3dbacb][_0xbe14('0x22')]]['split']('/')[0x2];_0x5c5e9f['prefix']=_0x5c5e9f[_0xbe14('0x23')]?_0x5c5e9f[_0xbe14('0x23')][_0xbe14('0x1e')]('$')[0x0]:undefined;_0x5c5e9f['phone']=_0x1aa849[_0xbe14('0x12')]?(_0x5c5e9f[_0xbe14('0x24')]||'')+_0xbe14('0x25')+_0x1aa849[_0xbe14('0x12')]+'}':(_0x5c5e9f[_0xbe14('0x24')]||'')+_0xbe14('0x26');_0x2bb45[_0x5ef1e5[_0x3dbacb][_0xbe14('0x22')]]=[_0xbe14('0x27'),_0x5c5e9f[_0xbe14('0x21')],_0x5c5e9f['phone']][_0xbe14('0x28')]('/');break;case _0xbe14('0x29'):_0x5c5e9f[_0xbe14('0x29')]=_0x163ef7[_0x5ef1e5[_0x3dbacb][_0xbe14('0x22')]];if(_0x1aa849[_0xbe14('0x1a')]!==_0xbe14('0x2a')){if(_0x5c5e9f['options'][_0xbe14('0x2b')](_0xbe14('0x2c'))<0x0){_0x5c5e9f[_0xbe14('0x29')]+=_0xbe14('0x2c');}}else{_0x5c5e9f['options']=_0x5c5e9f['options'][_0xbe14('0x2d')](_0xbe14('0x2c'),'');}_0x2bb45[_0x5ef1e5[_0x3dbacb][_0xbe14('0x22')]]=_0x5c5e9f['options'];break;default:_0x2bb45[_0x5ef1e5[_0x3dbacb]['param']]=_0x163ef7[_0x5ef1e5[_0x3dbacb][_0xbe14('0x22')]];}}return _0x2bb45['join'](',');}function _0x5657fe(_0x3593f8,_0x1f0355,_0x8216c3){return new Promise(function(_0x5051e4,_0x558525){var _0x5aaa4f=[];if(_[_0xbe14('0x2e')](_0x1f0355))return _0x5051e4(_0x5aaa4f);_0x11c3a0[_0xbe14('0x2f')][_0xbe14('0x30')]({'attributes':['id','interval',_0xbe14('0x31')],'raw':!![]})[_0xbe14('0x32')](function(_0x32f22e){for(var _0x3ab0f6=0x0,_0x58351f=0x0;_0x3ab0f6<_0x1f0355['length'];_0x3ab0f6++,_0x58351f=0x0){var _0x3e2fd3=_0x1f0355[_0x3ab0f6];var _0x34ffa0=[];var _0x24559b=[];delete _0x3e2fd3['id'];if(_0x3e2fd3[_0xbe14('0x33')]!==_0xbe14('0x34')){_0x3e2fd3['intervals']=[_0x3e2fd3['interval']];}else{_0x3e2fd3[_0xbe14('0x35')]=_0x3e2fd3[_0xbe14('0x31')]?_[_0xbe14('0x36')](_[_0xbe14('0x37')](_0x32f22e,{'IntervalId':_0x3e2fd3['IntervalId']}),_0xbe14('0x33')):[];}_0x3e2fd3[_0xbe14('0x6')]=_0x3593f8['context'];_0x3e2fd3[_0xbe14('0x7')]=_0x3593f8[_0xbe14('0x7')];if(_0x3e2fd3[_0xbe14('0x3')])_0x3e2fd3[_0xbe14('0x3')]=_0x3e2fd3['type']['toLowerCase']();if(_0x3593f8[_0xbe14('0x3')]===_0xbe14('0x10')){if(_0x3e2fd3['hasOwnProperty']('tag')&&_0x3e2fd3[_0xbe14('0x38')]&&_0x3e2fd3[_0xbe14('0x38')]!=='--'){_0x34ffa0[_0xbe14('0xd')]({'type':_0x3e2fd3[_0xbe14('0x3')][_0xbe14('0x39')](),'app':_0xbe14('0x4'),'appdata':_0xbe14('0x3a')+_0x3e2fd3['tag'],'context':_0x3593f8[_0xbe14('0x6')],'exten':_0x3593f8[_0xbe14('0x7')],'priority':_0x3e2fd3[_0xbe14('0x35')][_0xbe14('0x1f')]+_0x8216c3+_0x58351f++,'VoiceExtensionId':_0x3593f8['id']});}_0x34ffa0[_0xbe14('0xd')]({'type':_0x3e2fd3['type'][_0xbe14('0x39')](),'app':_0xbe14('0x13'),'appdata':_0xbe14('0x3b')+(_0x3e2fd3[_0xbe14('0x3c')]?_0xbe14('0x3d')+_0x3e2fd3[_0xbe14('0x3c')]+')':'NoOp(No\x20number\x20available)'),'context':_0x3593f8['context'],'exten':_0x3593f8[_0xbe14('0x7')],'priority':_0x3e2fd3[_0xbe14('0x35')][_0xbe14('0x1f')]+_0x8216c3+_0x58351f++,'VoiceExtensionId':_0x3593f8['id']});}else{if(_0x3e2fd3['hasOwnProperty']('answer')){if([_0xbe14('0x3e'),_0xbe14('0x3f')]['includes'](_0x3e2fd3[_0xbe14('0x40')][_0xbe14('0x39')]())&&_0x3e2fd3['appType']!==_0xbe14('0x41')){if(_0x3e2fd3['answer']){_0x34ffa0[_0xbe14('0xd')]({'type':_0x3e2fd3[_0xbe14('0x3')][_0xbe14('0x39')](),'app':'ExecIf','appdata':_0xbe14('0x42'),'context':_0x3593f8[_0xbe14('0x6')],'exten':_0x3593f8['exten'],'priority':_0x3e2fd3[_0xbe14('0x35')][_0xbe14('0x1f')]+_0x8216c3+_0x58351f++,'VoiceExtensionId':_0x3593f8['id']});_0x34ffa0[_0xbe14('0xd')]({'type':_0x3e2fd3[_0xbe14('0x3')][_0xbe14('0x39')](),'app':'Set','appdata':_0xbe14('0x43'),'context':_0x3593f8[_0xbe14('0x6')],'exten':_0x3593f8[_0xbe14('0x7')],'priority':_0x3e2fd3[_0xbe14('0x35')][_0xbe14('0x1f')]+_0x8216c3+_0x58351f++,'VoiceExtensionId':_0x3593f8['id']});}else{_0x34ffa0[_0xbe14('0xd')]({'type':_0x3e2fd3[_0xbe14('0x3')]['toLowerCase'](),'app':_0xbe14('0x13'),'appdata':_0xbe14('0x44'),'context':_0x3593f8[_0xbe14('0x6')],'exten':_0x3593f8[_0xbe14('0x7')],'priority':_0x3e2fd3[_0xbe14('0x35')][_0xbe14('0x1f')]+_0x8216c3+_0x58351f++,'VoiceExtensionId':_0x3593f8['id']});_0x34ffa0[_0xbe14('0xd')]({'type':_0x3e2fd3[_0xbe14('0x3')][_0xbe14('0x39')](),'app':_0xbe14('0x4'),'appdata':_0xbe14('0x45'),'context':_0x3593f8['context'],'exten':_0x3593f8['exten'],'priority':_0x3e2fd3['intervals'][_0xbe14('0x1f')]+_0x8216c3+_0x58351f++,'VoiceExtensionId':_0x3593f8['id']});}}}}for(var _0x1bfcbf=0x0;_0x1bfcbf<_0x3e2fd3[_0xbe14('0x35')][_0xbe14('0x1f')];_0x1bfcbf++){var _0x1cf828=_0x8216c3+_0x3e2fd3[_0xbe14('0x35')][_0xbe14('0x1f')];var _0x22bf69=_0x1bfcbf===_0x3e2fd3[_0xbe14('0x35')][_0xbe14('0x1f')]-0x1?_0x8216c3+_0x34ffa0[_0xbe14('0x1f')]+_0x24559b[_0xbe14('0x1f')]+0x2:_0x8216c3+_0x1bfcbf+0x1;_0x34ffa0[_0xbe14('0x46')](_0x1bfcbf,0x0,{'type':_0x3593f8[_0xbe14('0x3')],'app':_0xbe14('0x47'),'appdata':_0x3e2fd3[_0xbe14('0x35')][_0x1bfcbf]+'?'+_0x3593f8[_0xbe14('0x6')]+_0xbe14('0x48')+_0x1cf828+':'+_0x3593f8[_0xbe14('0x6')]+_0xbe14('0x48')+_0x22bf69,'exten':_0x3593f8['exten'],'context':_0x3593f8[_0xbe14('0x6')],'priority':_0x8216c3+_0x1bfcbf,'VoiceExtensionId':_0x3593f8['id']});}if(_0x3e2fd3[_0xbe14('0x49')]===_0xbe14('0x4a'))_0x3e2fd3[_0xbe14('0x4b')]=_0x452635(_0x3593f8,_0x3e2fd3[_0xbe14('0x4b')]);_0x3e2fd3[_0xbe14('0x4c')]=_0x34ffa0[_0xbe14('0x1f')]?_[_0xbe14('0x4d')](_0x34ffa0)[_0xbe14('0x4c')]+0x1:_0x8216c3;_0x5aaa4f=_[_0xbe14('0x4e')](_0x5aaa4f,_0x34ffa0,[_0x3e2fd3],_0x24559b);_0x8216c3=_['last'](_0x5aaa4f)[_0xbe14('0x4c')]+0x1;}return _0x5051e4(_0x5aaa4f);})[_0xbe14('0x4f')](function(_0x2d4dd4){_0x558525(_0x2d4dd4);});});}return _0x5cc4d8[_0xbe14('0x50')](_0xbe14('0x51'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x42b341){var _0x120077=this[_0xbe14('0x52')]({'plain':!![]});var _0xd4e1c7=_0x120077[_0xbe14('0x3')]==='outbound'?_0xe9c3ec(_0x120077):_0x48a116(_0x120077);return _0x5657fe(_0x120077,_0x42b341,_[_0xbe14('0x4d')](_0xd4e1c7)[_0xbe14('0x4c')]+0x1)[_0xbe14('0x32')](function(_0x29bb26){var _0xaebce8=_[_0xbe14('0x4e')](_0xd4e1c7,_0x29bb26);_0xaebce8[_0xbe14('0xd')]({'type':_0x120077[_0xbe14('0x3')],'app':'Hangup','exten':_0x120077[_0xbe14('0x7')],'context':_0x120077[_0xbe14('0x6')],'priority':_[_0xbe14('0x4d')](_0xaebce8)[_0xbe14('0x4c')]+0x1,'VoiceExtensionId':_0x120077['id']});return _0xaebce8;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 6fe44e6..34373a8 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 _0xf95f=['debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','VoiceExtension,\x20%s,\x20%s','message','result','catch','VoiceExtension','findAll','options','raw','attributes','limit','include','map','model','GetVoiceExtension','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xf95f,0x142));var _0xff95=function(_0x170b20,_0x49fc52){_0x170b20=_0x170b20-0x0;var _0xbe0395=_0xf95f[_0x170b20];return _0xbe0395;};'use strict';var _=require(_0xff95('0x0'));var util=require(_0xff95('0x1'));var moment=require(_0xff95('0x2'));var BPromise=require(_0xff95('0x3'));var rs=require(_0xff95('0x4'));var fs=require('fs');var Redis=require(_0xff95('0x5'));var db=require(_0xff95('0x6'))['db'];var utils=require(_0xff95('0x7'));var logger=require(_0xff95('0x8'))('rpc');var config=require(_0xff95('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xff95('0xa')]['http']({'port':0x232a});config[_0xff95('0xb')]=_[_0xff95('0xc')](config[_0xff95('0xb')],{'host':_0xff95('0xd'),'port':0x18eb});var socket=require(_0xff95('0xe'))(new Redis(config[_0xff95('0xb')]));require(_0xff95('0xf'))[_0xff95('0x10')](socket);function respondWithRpcPromise(_0x522870,_0x50293a,_0x405908){return new BPromise(function(_0x4547b5,_0x3e5d26){return client[_0xff95('0x11')](_0x522870,_0x405908)[_0xff95('0x12')](function(_0x4245a4){logger[_0xff95('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x50293a,'request\x20sent');logger[_0xff95('0x14')](_0xff95('0x15'),_0x50293a,'request\x20sent',JSON[_0xff95('0x16')](_0x4245a4));if(_0x4245a4['error']){if(_0x4245a4['error']['code']===0x1f4){logger[_0xff95('0x17')](_0xff95('0x18'),_0x50293a,_0x4245a4[_0xff95('0x17')][_0xff95('0x19')]);return _0x3e5d26(_0x4245a4[_0xff95('0x17')][_0xff95('0x19')]);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x50293a,_0x4245a4[_0xff95('0x17')][_0xff95('0x19')]);return _0x4547b5(_0x4245a4[_0xff95('0x17')][_0xff95('0x19')]);}else{logger[_0xff95('0x13')](_0xff95('0x18'),_0x50293a,'request\x20sent');_0x4547b5(_0x4245a4[_0xff95('0x1a')][_0xff95('0x19')]);}})[_0xff95('0x1b')](function(_0x49f1fb){logger['error'](_0xff95('0x18'),_0x50293a,_0x49f1fb);_0x3e5d26(_0x49f1fb);});});}exports['GetVoiceExtension']=function(_0x379bba){var _0x1661b9=this;return new Promise(function(_0x3a3f10,_0x40ebfd){return db[_0xff95('0x1c')][_0xff95('0x1d')]({'raw':_0x379bba[_0xff95('0x1e')]?_0x379bba[_0xff95('0x1e')][_0xff95('0x1f')]===undefined?!![]:![]:!![],'where':_0x379bba[_0xff95('0x1e')]?_0x379bba[_0xff95('0x1e')]['where']||null:null,'attributes':_0x379bba[_0xff95('0x1e')]?_0x379bba[_0xff95('0x1e')][_0xff95('0x20')]||null:null,'limit':_0x379bba[_0xff95('0x1e')]?_0x379bba[_0xff95('0x1e')][_0xff95('0x21')]||null:null,'include':_0x379bba[_0xff95('0x1e')]?_0x379bba[_0xff95('0x1e')][_0xff95('0x22')]?_[_0xff95('0x23')](_0x379bba['options']['include'],function(_0x50a5c2){return{'model':db[_0x50a5c2['model']],'as':_0x50a5c2['as'],'attributes':_0x50a5c2[_0xff95('0x20')],'include':_0x50a5c2[_0xff95('0x22')]?_[_0xff95('0x23')](_0x50a5c2[_0xff95('0x22')],function(_0x2b98e0){return{'model':db[_0x2b98e0['model']],'as':_0x2b98e0['as'],'attributes':_0x2b98e0[_0xff95('0x20')],'include':_0x2b98e0[_0xff95('0x22')]?_[_0xff95('0x23')](_0x2b98e0[_0xff95('0x22')],function(_0x2528a4){return{'model':db[_0x2528a4[_0xff95('0x24')]],'as':_0x2528a4['as'],'attributes':_0x2528a4[_0xff95('0x20')]};}):[]};}):[]};}):[]:[]})[_0xff95('0x12')](function(_0x2c0f2c){logger['info'](_0xff95('0x25'),_0x379bba);logger[_0xff95('0x14')]('GetVoiceExtension',_0x379bba,JSON[_0xff95('0x16')](_0x2c0f2c));_0x3a3f10(_0x2c0f2c);})['catch'](function(_0x369036){logger['error']('GetVoiceExtension',_0x369036[_0xff95('0x19')],_0x379bba);_0x40ebfd(_0x1661b9[_0xff95('0x17')](0x1f4,_0x369036[_0xff95('0x19')]));});});}; \ No newline at end of file +var _0x5e0c=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./voiceExtension.socket','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','GetVoiceExtension','options','where','attributes','limit','include','model','stringify','util','moment','bluebird','randomstring','ioredis'];(function(_0x19710b,_0x3b2c21){var _0x44f6c7=function(_0x9d28f4){while(--_0x9d28f4){_0x19710b['push'](_0x19710b['shift']());}};_0x44f6c7(++_0x3b2c21);}(_0x5e0c,0x19f));var _0xc5e0=function(_0x1d6a29,_0x1f9cf9){_0x1d6a29=_0x1d6a29-0x0;var _0x1d3206=_0x5e0c[_0x1d6a29];return _0x1d3206;};'use strict';var _=require('lodash');var util=require(_0xc5e0('0x0'));var moment=require(_0xc5e0('0x1'));var BPromise=require(_0xc5e0('0x2'));var rs=require(_0xc5e0('0x3'));var fs=require('fs');var Redis=require(_0xc5e0('0x4'));var db=require(_0xc5e0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc5e0('0x6'))(_0xc5e0('0x7'));var config=require(_0xc5e0('0x8'));var jayson=require(_0xc5e0('0x9'));var client=jayson[_0xc5e0('0xa')]['http']({'port':0x232a});config['redis']=_[_0xc5e0('0xb')](config['redis'],{'host':_0xc5e0('0xc'),'port':0x18eb});var socket=require(_0xc5e0('0xd'))(new Redis(config[_0xc5e0('0xe')]));require(_0xc5e0('0xf'))['register'](socket);function respondWithRpcPromise(_0x2c12b8,_0x558bbd,_0x37627e){return new BPromise(function(_0x33d821,_0x1d3618){return client[_0xc5e0('0x10')](_0x2c12b8,_0x37627e)[_0xc5e0('0x11')](function(_0x44980b){logger['info'](_0xc5e0('0x12'),_0x558bbd,_0xc5e0('0x13'));logger[_0xc5e0('0x14')](_0xc5e0('0x15'),_0x558bbd,_0xc5e0('0x13'),JSON['stringify'](_0x44980b));if(_0x44980b[_0xc5e0('0x16')]){if(_0x44980b[_0xc5e0('0x16')]['code']===0x1f4){logger['error'](_0xc5e0('0x12'),_0x558bbd,_0x44980b['error']['message']);return _0x1d3618(_0x44980b[_0xc5e0('0x16')][_0xc5e0('0x17')]);}logger[_0xc5e0('0x16')](_0xc5e0('0x12'),_0x558bbd,_0x44980b[_0xc5e0('0x16')][_0xc5e0('0x17')]);return _0x33d821(_0x44980b[_0xc5e0('0x16')][_0xc5e0('0x17')]);}else{logger[_0xc5e0('0x18')](_0xc5e0('0x12'),_0x558bbd,_0xc5e0('0x13'));_0x33d821(_0x44980b[_0xc5e0('0x19')][_0xc5e0('0x17')]);}})[_0xc5e0('0x1a')](function(_0x5c534d){logger['error'](_0xc5e0('0x12'),_0x558bbd,_0x5c534d);_0x1d3618(_0x5c534d);});});}exports[_0xc5e0('0x1b')]=function(_0x3d7981){var _0x2dba3d=this;return new Promise(function(_0x4214b0,_0x106819){return db['VoiceExtension']['findAll']({'raw':_0x3d7981['options']?_0x3d7981[_0xc5e0('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3d7981[_0xc5e0('0x1c')]?_0x3d7981[_0xc5e0('0x1c')][_0xc5e0('0x1d')]||null:null,'attributes':_0x3d7981[_0xc5e0('0x1c')]?_0x3d7981[_0xc5e0('0x1c')][_0xc5e0('0x1e')]||null:null,'limit':_0x3d7981[_0xc5e0('0x1c')]?_0x3d7981['options'][_0xc5e0('0x1f')]||null:null,'include':_0x3d7981['options']?_0x3d7981[_0xc5e0('0x1c')][_0xc5e0('0x20')]?_['map'](_0x3d7981['options']['include'],function(_0x30f734){return{'model':db[_0x30f734['model']],'as':_0x30f734['as'],'attributes':_0x30f734[_0xc5e0('0x1e')],'include':_0x30f734[_0xc5e0('0x20')]?_['map'](_0x30f734[_0xc5e0('0x20')],function(_0x331e07){return{'model':db[_0x331e07[_0xc5e0('0x21')]],'as':_0x331e07['as'],'attributes':_0x331e07[_0xc5e0('0x1e')],'include':_0x331e07['include']?_['map'](_0x331e07['include'],function(_0x4b30d9){return{'model':db[_0x4b30d9[_0xc5e0('0x21')]],'as':_0x4b30d9['as'],'attributes':_0x4b30d9['attributes']};}):[]};}):[]};}):[]:[]})[_0xc5e0('0x11')](function(_0x19f77a){logger[_0xc5e0('0x18')](_0xc5e0('0x1b'),_0x3d7981);logger['debug'](_0xc5e0('0x1b'),_0x3d7981,JSON[_0xc5e0('0x22')](_0x19f77a));_0x4214b0(_0x19f77a);})['catch'](function(_0x40b717){logger[_0xc5e0('0x16')](_0xc5e0('0x1b'),_0x40b717[_0xc5e0('0x17')],_0x3d7981);_0x106819(_0x2dba3d[_0xc5e0('0x16')](0x1f4,_0x40b717[_0xc5e0('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index d1dac4f..c4f5717 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 _0x53ec=['length','voiceExtension:','./voiceExtension.events','save','remove','update','emit','removeListener'];(function(_0x5bfaef,_0xd8f8a0){var _0x2d8ea2=function(_0x3e5604){while(--_0x3e5604){_0x5bfaef['push'](_0x5bfaef['shift']());}};_0x2d8ea2(++_0xd8f8a0);}(_0x53ec,0x192));var _0xc53e=function(_0x195299,_0x7a1c77){_0x195299=_0x195299-0x0;var _0x258842=_0x53ec[_0x195299];return _0x258842;};'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 +var _0xc4aa=['remove','update','removeListener','register','length','./voiceExtension.events','save'];(function(_0x3c4c09,_0x3ccf4b){var _0x36b267=function(_0x31a517){while(--_0x31a517){_0x3c4c09['push'](_0x3c4c09['shift']());}};_0x36b267(++_0x3ccf4b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xc4aa[_0x2235bf];return _0x4c3a64;};'use strict';var VoiceExtensionEvents=require(_0xac4a('0x0'));var events=[_0xac4a('0x1'),_0xac4a('0x2'),_0xac4a('0x3')];function createListener(_0x275161,_0x22469d){return function(_0x58634e){_0x22469d['emit'](_0x275161,_0x58634e);};}function removeListener(_0x47d4f6,_0x2f48ed){return function(){VoiceExtensionEvents[_0xac4a('0x4')](_0x47d4f6,_0x2f48ed);};}exports[_0xac4a('0x5')]=function(_0x215f39){for(var _0x96be2b=0x0,_0x15cd34=events[_0xac4a('0x6')];_0x96be2b<_0x15cd34;_0x96be2b++){var _0x10525b=events[_0x96be2b];var _0x5c6179=createListener('voiceExtension:'+_0x10525b,_0x215f39);VoiceExtensionEvents['on'](_0x10525b,_0x5c6179);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 115af50..1f4826f 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 _0x4fb4=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','getMessages','post','create','put'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0x4fb4,0x190));var _0x44fb=function(_0x3b256c,_0xf0c96d){_0x3b256c=_0x3b256c-0x0;var _0x2c6df7=_0x4fb4[_0x3b256c];return _0x2c6df7;};'use strict';var multer=require('multer');var util=require(_0x44fb('0x0'));var path=require(_0x44fb('0x1'));var timeout=require(_0x44fb('0x2'));var express=require(_0x44fb('0x3'));var router=express[_0x44fb('0x4')]();var fs_extra=require(_0x44fb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x44fb('0x6'));var config=require(_0x44fb('0x7'));var controller=require(_0x44fb('0x8'));router[_0x44fb('0x9')]('/',auth[_0x44fb('0xa')](),controller[_0x44fb('0xb')]);router[_0x44fb('0x9')](_0x44fb('0xc'),auth['isAuthenticated'](),controller[_0x44fb('0xd')]);router[_0x44fb('0x9')]('/:id/messages',auth[_0x44fb('0xa')](),controller[_0x44fb('0xe')]);router[_0x44fb('0xf')]('/',auth[_0x44fb('0xa')](),controller[_0x44fb('0x10')]);router[_0x44fb('0x11')](_0x44fb('0xc'),auth[_0x44fb('0xa')](),controller[_0x44fb('0x12')]);router[_0x44fb('0x13')]('/:id',auth[_0x44fb('0xa')](),controller[_0x44fb('0x14')]);module[_0x44fb('0x15')]=router; \ No newline at end of file +var _0x9536=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','/:id','isAuthenticated','show','/:id/messages','getMessages','create','put','update','delete','exports','multer'];(function(_0x405c97,_0x3a9aeb){var _0x4bba8f=function(_0x354926){while(--_0x354926){_0x405c97['push'](_0x405c97['shift']());}};_0x4bba8f(++_0x3a9aeb);}(_0x9536,0x179));var _0x6953=function(_0x2a390b,_0xf49f9b){_0x2a390b=_0x2a390b-0x0;var _0x5df10a=_0x9536[_0x2a390b];return _0x5df10a;};'use strict';var multer=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var path=require(_0x6953('0x2'));var timeout=require(_0x6953('0x3'));var express=require('express');var router=express[_0x6953('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6953('0x5'));var interaction=require(_0x6953('0x6'));var config=require(_0x6953('0x7'));var controller=require(_0x6953('0x8'));router[_0x6953('0x9')]('/',auth['isAuthenticated'](),controller[_0x6953('0xa')]);router[_0x6953('0x9')](_0x6953('0xb'),auth[_0x6953('0xc')](),controller[_0x6953('0xd')]);router['get'](_0x6953('0xe'),auth[_0x6953('0xc')](),controller[_0x6953('0xf')]);router['post']('/',auth[_0x6953('0xc')](),controller[_0x6953('0x10')]);router[_0x6953('0x11')](_0x6953('0xb'),auth[_0x6953('0xc')](),controller[_0x6953('0x12')]);router[_0x6953('0x13')](_0x6953('0xb'),auth[_0x6953('0xc')](),controller['destroy']);module[_0x6953('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 5133664..e388e65 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 _0x94a0=['\x20-\x20','mailbox','sequelize','STRING','from-voicemail','contest_mailbox','setDataValue','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname'];(function(_0xca5256,_0x578467){var _0x1fe79d=function(_0x64311a){while(--_0x64311a){_0xca5256['push'](_0xca5256['shift']());}};_0x1fe79d(++_0x578467);}(_0x94a0,0x1b2));var _0x094a=function(_0x1bc089,_0x5ab38){_0x1bc089=_0x1bc089-0x0;var _0x5382be=_0x94a0[_0x1bc089];return _0x5382be;};'use strict';var Sequelize=require(_0x094a('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x094a('0x1')]},'context':{'type':Sequelize[_0x094a('0x1')],'defaultValue':_0x094a('0x2'),'unique':_0x094a('0x3')},'mailbox':{'type':Sequelize[_0x094a('0x1')],'defaultValue':'','allowNull':![],'unique':_0x094a('0x3')},'password':{'type':Sequelize[_0x094a('0x1')]},'fullname':{'type':Sequelize[_0x094a('0x1')]},'email':{'type':Sequelize[_0x094a('0x1')],'validate':{'isEmail':!![]},'set':function(_0x2d6ce0){this[_0x094a('0x4')]('email',typeof _0x2d6ce0===_0x094a('0x5')&&_0x2d6ce0[_0x094a('0x6')]()?_0x2d6ce0[_0x094a('0x6')]():null);}},'pager':{'type':Sequelize[_0x094a('0x1')]},'tz':{'type':Sequelize[_0x094a('0x1')],'defaultValue':_0x094a('0x7')},'attach':{'type':Sequelize[_0x094a('0x8')](_0x094a('0x9'),'no'),'defaultValue':_0x094a('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x094a('0x8')](_0x094a('0x9'),'no'),'defaultValue':_0x094a('0x9'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x094a('0x1')]},'review':{'type':Sequelize[_0x094a('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x094a('0x8')](_0x094a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x094a('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x094a('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x094a('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x094a('0x8')](_0x094a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x094a('0x8')]('yes','no'),'defaultValue':_0x094a('0x9'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x094a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x094a('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x094a('0x9'),'allowNull':![]},'stamp':{'type':_0x094a('0xb')},'emailsubject':{'type':Sequelize[_0x094a('0x1')]},'emailbody':{'type':Sequelize[_0x094a('0x1')]},'maxsecs':{'type':Sequelize[_0x094a('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x094a('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x094a('0xd')],'get':function(){return this[_0x094a('0xe')](_0x094a('0xf'))+_0x094a('0x10')+this[_0x094a('0xe')](_0x094a('0x11'));}}}; \ No newline at end of file +var _0xa5d3=['mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','\x20-\x20'];(function(_0x388b0f,_0x4d9704){var _0x234262=function(_0x1e55f0){while(--_0x1e55f0){_0x388b0f['push'](_0x388b0f['shift']());}};_0x234262(++_0x4d9704);}(_0xa5d3,0x1e7));var _0x3a5d=function(_0x5d4241,_0x29fba1){_0x5d4241=_0x5d4241-0x0;var _0x5c044b=_0xa5d3[_0x5d4241];return _0x5c044b;};'use strict';var Sequelize=require(_0x3a5d('0x0'));module[_0x3a5d('0x1')]={'customer_id':{'type':Sequelize[_0x3a5d('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x3a5d('0x3'),'unique':_0x3a5d('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x3a5d('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x262f68){this[_0x3a5d('0x5')](_0x3a5d('0x6'),typeof _0x262f68===_0x3a5d('0x7')&&_0x262f68[_0x3a5d('0x8')]()?_0x262f68[_0x3a5d('0x8')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x3a5d('0x2')],'defaultValue':_0x3a5d('0x9')},'attach':{'type':Sequelize[_0x3a5d('0xa')]('yes','no'),'defaultValue':_0x3a5d('0xb'),'allowNull':![]},'saycid':{'type':Sequelize[_0x3a5d('0xa')](_0x3a5d('0xb'),'no'),'defaultValue':_0x3a5d('0xb'),'allowNull':![]},'dialout':{'type':Sequelize[_0x3a5d('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x3a5d('0xa')](_0x3a5d('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x3a5d('0xa')](_0x3a5d('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x3a5d('0xa')](_0x3a5d('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x3a5d('0xa')](_0x3a5d('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x3a5d('0xa')](_0x3a5d('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x3a5d('0xa')](_0x3a5d('0xb'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x3a5d('0xa')](_0x3a5d('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x3a5d('0xa')](_0x3a5d('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x3a5d('0xa')](_0x3a5d('0xb'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x3a5d('0xb'),'allowNull':![]},'stamp':{'type':_0x3a5d('0xc')},'emailsubject':{'type':Sequelize[_0x3a5d('0x2')]},'emailbody':{'type':Sequelize[_0x3a5d('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x3a5d('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x3a5d('0xe')],'get':function(){return this[_0x3a5d('0xf')]('fullname')+_0x3a5d('0x10')+this[_0x3a5d('0xf')](_0x3a5d('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 20ff2be..b170190 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 _0xae60=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','VoiceMail','includeAll','include','findAll','rows','catch','show','params','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','getMessages','findOne','VoiceMailMessage','order','pick','mailbox','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x5de6c9,_0x471538){var _0x4f45f6=function(_0xe0c086){while(--_0xe0c086){_0x5de6c9['push'](_0x5de6c9['shift']());}};_0x4f45f6(++_0x471538);}(_0xae60,0x1c7));var _0x0ae6=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xae60[_0x1b6186];return _0x186121;};'use strict';var emlformat=require(_0x0ae6('0x0'));var rimraf=require(_0x0ae6('0x1'));var zipdir=require(_0x0ae6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ae6('0x3'));var moment=require(_0x0ae6('0x4'));var BPromise=require(_0x0ae6('0x5'));var Mustache=require('mustache');var util=require(_0x0ae6('0x6'));var path=require(_0x0ae6('0x7'));var sox=require('sox');var csv=require(_0x0ae6('0x8'));var ejs=require(_0x0ae6('0x9'));var fs=require('fs');var fs_extra=require(_0x0ae6('0xa'));var _=require(_0x0ae6('0xb'));var squel=require(_0x0ae6('0xc'));var crypto=require(_0x0ae6('0xd'));var jsforce=require(_0x0ae6('0xe'));var deskjs=require(_0x0ae6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0ae6('0x10'));var Papa=require(_0x0ae6('0x11'));var Redis=require(_0x0ae6('0x12'));var authService=require(_0x0ae6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0ae6('0x14'));var hardwareService=require(_0x0ae6('0x15'));var logger=require(_0x0ae6('0x16'))(_0x0ae6('0x17'));var utils=require(_0x0ae6('0x18'));var config=require(_0x0ae6('0x19'));var licenseUtil=require(_0x0ae6('0x1a'));var db=require(_0x0ae6('0x1b'))['db'];function respondWithStatusCode(_0x3b05a4,_0x30f8f9){_0x30f8f9=_0x30f8f9||0xcc;return function(_0x1aefd5){if(_0x1aefd5){return _0x3b05a4[_0x0ae6('0x1c')](_0x30f8f9);}return _0x3b05a4[_0x0ae6('0x1d')](_0x30f8f9)[_0x0ae6('0x1e')]();};}function respondWithResult(_0x4d2da8,_0x3809c6){_0x3809c6=_0x3809c6||0xc8;return function(_0x10c3bc){if(_0x10c3bc){return _0x4d2da8[_0x0ae6('0x1d')](_0x3809c6)[_0x0ae6('0x1f')](_0x10c3bc);}};}function respondWithFilteredResult(_0xce3e23,_0x3a1e26){return function(_0x151144){if(_0x151144){var _0x3b64ac=typeof _0x3a1e26[_0x0ae6('0x20')]===_0x0ae6('0x21')&&typeof _0x3a1e26[_0x0ae6('0x22')]===_0x0ae6('0x21');var _0xa97151=_0x151144[_0x0ae6('0x23')];var _0xda4f01=_0x3b64ac?0x0:_0x3a1e26[_0x0ae6('0x20')];var _0x2fdf25=_0x3b64ac?_0x151144[_0x0ae6('0x23')]:_0x3a1e26[_0x0ae6('0x20')]+_0x3a1e26[_0x0ae6('0x22')];var _0x26b369;if(_0x2fdf25>=_0xa97151){_0x2fdf25=_0xa97151;_0x26b369=0xc8;}else{_0x26b369=0xce;}_0xce3e23[_0x0ae6('0x1d')](_0x26b369);return _0xce3e23['set'](_0x0ae6('0x24'),_0xda4f01+'-'+_0x2fdf25+'/'+_0xa97151)[_0x0ae6('0x1f')](_0x151144);}return null;};}function patchUpdates(_0x140a3b){return function(_0x1027c2){try{jsonpatch[_0x0ae6('0x25')](_0x1027c2,_0x140a3b,!![]);}catch(_0xb4e6af){return BPromise[_0x0ae6('0x26')](_0xb4e6af);}return _0x1027c2[_0x0ae6('0x27')]();};}function saveUpdates(_0x515f3d,_0x39b22e){return function(_0x2a6484){if(_0x2a6484){return _0x2a6484[_0x0ae6('0x28')](_0x515f3d)[_0x0ae6('0x29')](function(_0x31ad85){return _0x31ad85;});}return null;};}function removeEntity(_0x4eba72,_0x296a9d){return function(_0x4e1242){if(_0x4e1242){return _0x4e1242[_0x0ae6('0x2a')]()[_0x0ae6('0x29')](function(){var _0x3c43d8=_0x4e1242[_0x0ae6('0x2b')]({'plain':!![]});var _0x5b86fe=_0x0ae6('0x2c');return db[_0x0ae6('0x2d')]['destroy']({'where':{'type':_0x5b86fe,'resourceId':_0x3c43d8['id']}})['then'](function(){return _0x4e1242;});})[_0x0ae6('0x29')](function(){_0x4eba72[_0x0ae6('0x1d')](0xcc)[_0x0ae6('0x1e')]();});}};}function handleEntityNotFound(_0x4fe77b,_0x3b5f8f){return function(_0xb68cbe){if(!_0xb68cbe){_0x4fe77b[_0x0ae6('0x1c')](0x194);}return _0xb68cbe;};}function handleError(_0x4df796,_0x2428b2){_0x2428b2=_0x2428b2||0x1f4;return function(_0x29fef3){logger[_0x0ae6('0x2e')](_0x29fef3[_0x0ae6('0x2f')]);if(_0x29fef3[_0x0ae6('0x30')]){delete _0x29fef3[_0x0ae6('0x30')];}_0x4df796['status'](_0x2428b2)['send'](_0x29fef3);};}exports[_0x0ae6('0x31')]=function(_0x419384,_0x4e6df8){var _0x4a06f1={},_0x1ca059={},_0x278577={'count':0x0,'rows':[]};var _0x714c6d=_[_0x0ae6('0x32')](db['VoiceMail'][_0x0ae6('0x33')],function(_0x429f06){return{'name':_0x429f06[_0x0ae6('0x34')],'type':_0x429f06['type'][_0x0ae6('0x35')]};});_0x1ca059[_0x0ae6('0x36')]=_[_0x0ae6('0x32')](_0x714c6d,_0x0ae6('0x30'));_0x1ca059[_0x0ae6('0x37')]=_[_0x0ae6('0x38')](_0x419384[_0x0ae6('0x37')]);_0x1ca059[_0x0ae6('0x39')]=_[_0x0ae6('0x3a')](_0x1ca059[_0x0ae6('0x36')],_0x1ca059['query']);_0x4a06f1[_0x0ae6('0x3b')]=_[_0x0ae6('0x3a')](_0x1ca059['model'],qs[_0x0ae6('0x3c')](_0x419384[_0x0ae6('0x37')][_0x0ae6('0x3c')]));_0x4a06f1['attributes']=_0x4a06f1[_0x0ae6('0x3b')]['length']?_0x4a06f1['attributes']:_0x1ca059[_0x0ae6('0x36')];if(!_0x419384[_0x0ae6('0x37')][_0x0ae6('0x3d')](_0x0ae6('0x3e'))){_0x4a06f1[_0x0ae6('0x22')]=qs['limit'](_0x419384['query'][_0x0ae6('0x22')]);_0x4a06f1['offset']=qs[_0x0ae6('0x20')](_0x419384['query'][_0x0ae6('0x20')]);}_0x4a06f1['order']=qs[_0x0ae6('0x3f')](_0x419384[_0x0ae6('0x37')][_0x0ae6('0x3f')]);_0x4a06f1[_0x0ae6('0x40')]=qs['filters'](_['pick'](_0x419384[_0x0ae6('0x37')],_0x1ca059[_0x0ae6('0x39')]),_0x714c6d);if(_0x419384[_0x0ae6('0x37')]['filter']){_0x4a06f1[_0x0ae6('0x40')]=_['merge'](_0x4a06f1[_0x0ae6('0x40')],{'$or':_[_0x0ae6('0x32')](_0x714c6d,function(_0x460e3f){if(_0x460e3f[_0x0ae6('0x41')]!==_0x0ae6('0x42')){var _0x1f8258={};_0x1f8258[_0x460e3f['name']]={'$like':'%'+_0x419384[_0x0ae6('0x37')][_0x0ae6('0x43')]+'%'};return _0x1f8258;}})});}_0x4a06f1=_[_0x0ae6('0x44')]({},_0x4a06f1,_0x419384[_0x0ae6('0x45')]);var _0x1ad562={'where':_0x4a06f1[_0x0ae6('0x40')]};return db[_0x0ae6('0x46')][_0x0ae6('0x23')](_0x1ad562)['then'](function(_0x38faeb){_0x278577[_0x0ae6('0x23')]=_0x38faeb;if(_0x419384[_0x0ae6('0x37')][_0x0ae6('0x47')]){_0x4a06f1[_0x0ae6('0x48')]=[{'all':!![]}];}return db[_0x0ae6('0x46')][_0x0ae6('0x49')](_0x4a06f1);})[_0x0ae6('0x29')](function(_0xb38cbb){_0x278577[_0x0ae6('0x4a')]=_0xb38cbb;return _0x278577;})[_0x0ae6('0x29')](respondWithFilteredResult(_0x4e6df8,_0x4a06f1))[_0x0ae6('0x4b')](handleError(_0x4e6df8,null));};exports[_0x0ae6('0x4c')]=function(_0x85d9ce,_0x201e95){var _0x16d225={'raw':!![],'where':{'id':_0x85d9ce[_0x0ae6('0x4d')]['id']}},_0x4235de={};_0x4235de['model']=_[_0x0ae6('0x38')](db[_0x0ae6('0x46')][_0x0ae6('0x33')]);_0x4235de[_0x0ae6('0x37')]=_[_0x0ae6('0x38')](_0x85d9ce[_0x0ae6('0x37')]);_0x4235de['filters']=_[_0x0ae6('0x3a')](_0x4235de[_0x0ae6('0x36')],_0x4235de[_0x0ae6('0x37')]);_0x16d225[_0x0ae6('0x3b')]=_['intersection'](_0x4235de['model'],qs['fields'](_0x85d9ce[_0x0ae6('0x37')][_0x0ae6('0x3c')]));_0x16d225[_0x0ae6('0x3b')]=_0x16d225['attributes'][_0x0ae6('0x4e')]?_0x16d225[_0x0ae6('0x3b')]:_0x4235de['model'];if(_0x85d9ce[_0x0ae6('0x37')][_0x0ae6('0x47')]){_0x16d225['include']=[{'all':!![]}];}_0x16d225=_[_0x0ae6('0x44')]({},_0x16d225,_0x85d9ce[_0x0ae6('0x45')]);return db['VoiceMail'][_0x0ae6('0x4f')](_0x16d225)[_0x0ae6('0x29')](handleEntityNotFound(_0x201e95,null))[_0x0ae6('0x29')](respondWithResult(_0x201e95,null))['catch'](handleError(_0x201e95,null));};exports[_0x0ae6('0x50')]=function(_0x21de54,_0x46075a){return db[_0x0ae6('0x46')][_0x0ae6('0x50')](_0x21de54[_0x0ae6('0x51')],{})[_0x0ae6('0x29')](function(_0x5ababa){var _0x5afd3b=_0x21de54[_0x0ae6('0x52')][_0x0ae6('0x2b')]({'plain':!![]});if(!_0x5afd3b)throw new Error(_0x0ae6('0x53'));if(_0x5afd3b['role']===_0x0ae6('0x52')){var _0x51df5c=_0x5ababa['get']({'plain':!![]});var _0x23454a=_0x0ae6('0x2c');return db[_0x0ae6('0x54')]['find']({'where':{'name':_0x23454a,'userProfileId':_0x5afd3b[_0x0ae6('0x55')]},'raw':!![]})[_0x0ae6('0x29')](function(_0x31a4db){if(_0x31a4db&&_0x31a4db[_0x0ae6('0x56')]===0x0){return db[_0x0ae6('0x2d')][_0x0ae6('0x50')]({'name':_0x51df5c[_0x0ae6('0x30')],'resourceId':_0x51df5c['id'],'type':_0x31a4db[_0x0ae6('0x30')],'sectionId':_0x31a4db['id']},{})[_0x0ae6('0x29')](function(){return _0x5ababa;});}else{return _0x5ababa;}})[_0x0ae6('0x4b')](function(_0x1cc515){logger[_0x0ae6('0x2e')](_0x0ae6('0x57'),_0x1cc515);throw _0x1cc515;});}return _0x5ababa;})[_0x0ae6('0x29')](respondWithResult(_0x46075a,0xc9))[_0x0ae6('0x4b')](handleError(_0x46075a,null));};exports['update']=function(_0x4cbe19,_0x30a9f1){if(_0x4cbe19[_0x0ae6('0x51')]['id']){delete _0x4cbe19[_0x0ae6('0x51')]['id'];}return db[_0x0ae6('0x46')][_0x0ae6('0x4f')]({'where':{'id':_0x4cbe19[_0x0ae6('0x4d')]['id']}})[_0x0ae6('0x29')](handleEntityNotFound(_0x30a9f1,null))[_0x0ae6('0x29')](saveUpdates(_0x4cbe19[_0x0ae6('0x51')],null))[_0x0ae6('0x29')](respondWithResult(_0x30a9f1,null))[_0x0ae6('0x4b')](handleError(_0x30a9f1,null));};exports[_0x0ae6('0x2a')]=function(_0x16a311,_0x2babcc){return db[_0x0ae6('0x46')][_0x0ae6('0x4f')]({'where':{'id':_0x16a311[_0x0ae6('0x4d')]['id']}})[_0x0ae6('0x29')](handleEntityNotFound(_0x2babcc,null))['then'](removeEntity(_0x2babcc,null))[_0x0ae6('0x4b')](handleError(_0x2babcc,null));};exports[_0x0ae6('0x58')]=function(_0x15191e,_0x578125,_0x2648de){return db[_0x0ae6('0x46')][_0x0ae6('0x59')]({'where':{'id':_0x15191e[_0x0ae6('0x4d')]['id']}})[_0x0ae6('0x29')](handleEntityNotFound(_0x578125,null))[_0x0ae6('0x29')](function(_0x5ec716){var _0x456d2a;var _0x2132d6={},_0x1c53bf={};_0x1c53bf[_0x0ae6('0x36')]=_[_0x0ae6('0x38')](db[_0x0ae6('0x5a')][_0x0ae6('0x33')]);_0x1c53bf[_0x0ae6('0x37')]=_[_0x0ae6('0x38')](_0x15191e['query']);_0x1c53bf['filters']=_[_0x0ae6('0x3a')](_0x1c53bf[_0x0ae6('0x36')],_0x1c53bf['query']);_0x2132d6['attributes']=_[_0x0ae6('0x3a')](_0x1c53bf[_0x0ae6('0x36')],qs[_0x0ae6('0x3c')](_0x15191e[_0x0ae6('0x37')][_0x0ae6('0x3c')]));_0x2132d6[_0x0ae6('0x3b')]=_0x2132d6[_0x0ae6('0x3b')]['length']?_0x2132d6[_0x0ae6('0x3b')]:_0x1c53bf['model'];if(!_0x15191e[_0x0ae6('0x37')][_0x0ae6('0x3d')]('nolimit')){_0x2132d6[_0x0ae6('0x22')]=qs[_0x0ae6('0x22')](_0x15191e[_0x0ae6('0x37')]['limit']);_0x2132d6[_0x0ae6('0x20')]=qs['offset'](_0x15191e[_0x0ae6('0x37')][_0x0ae6('0x20')]);}_0x2132d6[_0x0ae6('0x5b')]=qs[_0x0ae6('0x3f')](_0x15191e['query']['sort']);_0x2132d6[_0x0ae6('0x40')]=qs[_0x0ae6('0x39')](_[_0x0ae6('0x5c')](_0x15191e[_0x0ae6('0x37')],_0x1c53bf[_0x0ae6('0x39')]));if(_0x15191e[_0x0ae6('0x37')]['filter']){_0x2132d6['where']=_[_0x0ae6('0x44')](_0x2132d6[_0x0ae6('0x40')],{'$or':_[_0x0ae6('0x32')](_0x2132d6[_0x0ae6('0x3b')],function(_0x2bafcc){var _0x15f38f={};_0x15f38f[_0x2bafcc]={'$like':'%'+_0x15191e[_0x0ae6('0x37')][_0x0ae6('0x43')]+'%'};return _0x15f38f;})});}_0x2132d6['where']=_[_0x0ae6('0x44')](_0x2132d6[_0x0ae6('0x40')],{'mailboxuser':_0x5ec716[_0x0ae6('0x5d')]});_0x2132d6=_[_0x0ae6('0x44')]({},_0x2132d6,_0x15191e[_0x0ae6('0x45')]);return db[_0x0ae6('0x5a')]['findAndCountAll'](_0x2132d6)['then'](respondWithFilteredResult(_0x578125,_0x2132d6));})[_0x0ae6('0x4b')](handleError(_0x578125,null));}; \ No newline at end of file +var _0x9c00=['name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','merge','where','VIRTUAL','options','VoiceMail','includeAll','include','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','Content-Range','apply','reject','update','destroy','get','Voicemails','UserProfileResource','then','stack'];(function(_0x297206,_0xbf36f6){var _0xccb9f=function(_0x44ed6b){while(--_0x44ed6b){_0x297206['push'](_0x297206['shift']());}};_0xccb9f(++_0xbf36f6);}(_0x9c00,0x1a0));var _0x09c0=function(_0x249d7c,_0x17163a){_0x249d7c=_0x249d7c-0x0;var _0x20f24b=_0x9c00[_0x249d7c];return _0x20f24b;};'use strict';var emlformat=require(_0x09c0('0x0'));var rimraf=require(_0x09c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x09c0('0x2'));var moment=require(_0x09c0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x09c0('0x4'));var util=require(_0x09c0('0x5'));var path=require(_0x09c0('0x6'));var sox=require(_0x09c0('0x7'));var csv=require(_0x09c0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x09c0('0x9'));var squel=require(_0x09c0('0xa'));var crypto=require(_0x09c0('0xb'));var jsforce=require(_0x09c0('0xc'));var deskjs=require(_0x09c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x09c0('0xe'));var Papa=require(_0x09c0('0xf'));var Redis=require(_0x09c0('0x10'));var authService=require(_0x09c0('0x11'));var qs=require(_0x09c0('0x12'));var as=require(_0x09c0('0x13'));var hardwareService=require(_0x09c0('0x14'));var logger=require(_0x09c0('0x15'))(_0x09c0('0x16'));var utils=require(_0x09c0('0x17'));var config=require(_0x09c0('0x18'));var licenseUtil=require(_0x09c0('0x19'));var db=require(_0x09c0('0x1a'))['db'];function respondWithStatusCode(_0x144271,_0x3b95cc){_0x3b95cc=_0x3b95cc||0xcc;return function(_0x331905){if(_0x331905){return _0x144271[_0x09c0('0x1b')](_0x3b95cc);}return _0x144271[_0x09c0('0x1c')](_0x3b95cc)[_0x09c0('0x1d')]();};}function respondWithResult(_0x3649d2,_0x16e490){_0x16e490=_0x16e490||0xc8;return function(_0x254598){if(_0x254598){return _0x3649d2[_0x09c0('0x1c')](_0x16e490)[_0x09c0('0x1e')](_0x254598);}};}function respondWithFilteredResult(_0x33c3d6,_0x2fdf11){return function(_0x4ff6b7){if(_0x4ff6b7){var _0x590129=typeof _0x2fdf11['offset']===_0x09c0('0x1f')&&typeof _0x2fdf11[_0x09c0('0x20')]===_0x09c0('0x1f');var _0x628272=_0x4ff6b7['count'];var _0x2c4440=_0x590129?0x0:_0x2fdf11['offset'];var _0x4c29a7=_0x590129?_0x4ff6b7[_0x09c0('0x21')]:_0x2fdf11['offset']+_0x2fdf11[_0x09c0('0x20')];var _0x319c36;if(_0x4c29a7>=_0x628272){_0x4c29a7=_0x628272;_0x319c36=0xc8;}else{_0x319c36=0xce;}_0x33c3d6[_0x09c0('0x1c')](_0x319c36);return _0x33c3d6['set'](_0x09c0('0x22'),_0x2c4440+'-'+_0x4c29a7+'/'+_0x628272)[_0x09c0('0x1e')](_0x4ff6b7);}return null;};}function patchUpdates(_0x8ad645){return function(_0x3447c5){try{jsonpatch[_0x09c0('0x23')](_0x3447c5,_0x8ad645,!![]);}catch(_0xa5d16f){return BPromise[_0x09c0('0x24')](_0xa5d16f);}return _0x3447c5['save']();};}function saveUpdates(_0x1695e8,_0x46f171){return function(_0x473fbd){if(_0x473fbd){return _0x473fbd[_0x09c0('0x25')](_0x1695e8)['then'](function(_0x4f6824){return _0x4f6824;});}return null;};}function removeEntity(_0x321bcc,_0x25fdb5){return function(_0x1e8a1c){if(_0x1e8a1c){return _0x1e8a1c[_0x09c0('0x26')]()['then'](function(){var _0x42ebfc=_0x1e8a1c[_0x09c0('0x27')]({'plain':!![]});var _0x56d883=_0x09c0('0x28');return db[_0x09c0('0x29')][_0x09c0('0x26')]({'where':{'type':_0x56d883,'resourceId':_0x42ebfc['id']}})[_0x09c0('0x2a')](function(){return _0x1e8a1c;});})[_0x09c0('0x2a')](function(){_0x321bcc[_0x09c0('0x1c')](0xcc)[_0x09c0('0x1d')]();});}};}function handleEntityNotFound(_0x35b61c,_0x1ea951){return function(_0x1aa80e){if(!_0x1aa80e){_0x35b61c[_0x09c0('0x1b')](0x194);}return _0x1aa80e;};}function handleError(_0x5e53ac,_0x15a667){_0x15a667=_0x15a667||0x1f4;return function(_0x1bdde9){logger['error'](_0x1bdde9[_0x09c0('0x2b')]);if(_0x1bdde9['name']){delete _0x1bdde9[_0x09c0('0x2c')];}_0x5e53ac['status'](_0x15a667)[_0x09c0('0x2d')](_0x1bdde9);};}exports[_0x09c0('0x2e')]=function(_0x108409,_0x4159bc){var _0x4e999a={},_0x5478b7={},_0x17c374={'count':0x0,'rows':[]};var _0x38a315=_[_0x09c0('0x2f')](db['VoiceMail'][_0x09c0('0x30')],function(_0x4bdae9){return{'name':_0x4bdae9[_0x09c0('0x31')],'type':_0x4bdae9[_0x09c0('0x32')][_0x09c0('0x33')]};});_0x5478b7['model']=_[_0x09c0('0x2f')](_0x38a315,_0x09c0('0x2c'));_0x5478b7[_0x09c0('0x34')]=_[_0x09c0('0x35')](_0x108409[_0x09c0('0x34')]);_0x5478b7[_0x09c0('0x36')]=_[_0x09c0('0x37')](_0x5478b7['model'],_0x5478b7[_0x09c0('0x34')]);_0x4e999a[_0x09c0('0x38')]=_[_0x09c0('0x37')](_0x5478b7[_0x09c0('0x39')],qs[_0x09c0('0x3a')](_0x108409['query'][_0x09c0('0x3a')]));_0x4e999a[_0x09c0('0x38')]=_0x4e999a[_0x09c0('0x38')][_0x09c0('0x3b')]?_0x4e999a[_0x09c0('0x38')]:_0x5478b7['model'];if(!_0x108409[_0x09c0('0x34')][_0x09c0('0x3c')](_0x09c0('0x3d'))){_0x4e999a[_0x09c0('0x20')]=qs[_0x09c0('0x20')](_0x108409[_0x09c0('0x34')][_0x09c0('0x20')]);_0x4e999a['offset']=qs[_0x09c0('0x3e')](_0x108409[_0x09c0('0x34')][_0x09c0('0x3e')]);}_0x4e999a[_0x09c0('0x3f')]=qs[_0x09c0('0x40')](_0x108409['query']['sort']);_0x4e999a['where']=qs['filters'](_[_0x09c0('0x41')](_0x108409[_0x09c0('0x34')],_0x5478b7[_0x09c0('0x36')]),_0x38a315);if(_0x108409[_0x09c0('0x34')][_0x09c0('0x42')]){_0x4e999a['where']=_[_0x09c0('0x43')](_0x4e999a[_0x09c0('0x44')],{'$or':_['map'](_0x38a315,function(_0x1067cf){if(_0x1067cf['type']!==_0x09c0('0x45')){var _0x5c80a2={};_0x5c80a2[_0x1067cf[_0x09c0('0x2c')]]={'$like':'%'+_0x108409[_0x09c0('0x34')]['filter']+'%'};return _0x5c80a2;}})});}_0x4e999a=_[_0x09c0('0x43')]({},_0x4e999a,_0x108409[_0x09c0('0x46')]);var _0x5d69fd={'where':_0x4e999a[_0x09c0('0x44')]};return db[_0x09c0('0x47')][_0x09c0('0x21')](_0x5d69fd)[_0x09c0('0x2a')](function(_0xeb8191){_0x17c374[_0x09c0('0x21')]=_0xeb8191;if(_0x108409['query'][_0x09c0('0x48')]){_0x4e999a[_0x09c0('0x49')]=[{'all':!![]}];}return db[_0x09c0('0x47')]['findAll'](_0x4e999a);})[_0x09c0('0x2a')](function(_0x30c0c5){_0x17c374[_0x09c0('0x4a')]=_0x30c0c5;return _0x17c374;})['then'](respondWithFilteredResult(_0x4159bc,_0x4e999a))[_0x09c0('0x4b')](handleError(_0x4159bc,null));};exports[_0x09c0('0x4c')]=function(_0x52cd5c,_0x5bbf4e){var _0x397e73={'raw':!![],'where':{'id':_0x52cd5c['params']['id']}},_0x471078={};_0x471078[_0x09c0('0x39')]=_[_0x09c0('0x35')](db['VoiceMail'][_0x09c0('0x30')]);_0x471078[_0x09c0('0x34')]=_[_0x09c0('0x35')](_0x52cd5c[_0x09c0('0x34')]);_0x471078[_0x09c0('0x36')]=_['intersection'](_0x471078[_0x09c0('0x39')],_0x471078['query']);_0x397e73['attributes']=_[_0x09c0('0x37')](_0x471078[_0x09c0('0x39')],qs[_0x09c0('0x3a')](_0x52cd5c[_0x09c0('0x34')][_0x09c0('0x3a')]));_0x397e73[_0x09c0('0x38')]=_0x397e73['attributes']['length']?_0x397e73['attributes']:_0x471078[_0x09c0('0x39')];if(_0x52cd5c[_0x09c0('0x34')][_0x09c0('0x48')]){_0x397e73['include']=[{'all':!![]}];}_0x397e73=_[_0x09c0('0x43')]({},_0x397e73,_0x52cd5c[_0x09c0('0x46')]);return db[_0x09c0('0x47')][_0x09c0('0x4d')](_0x397e73)[_0x09c0('0x2a')](handleEntityNotFound(_0x5bbf4e,null))[_0x09c0('0x2a')](respondWithResult(_0x5bbf4e,null))[_0x09c0('0x4b')](handleError(_0x5bbf4e,null));};exports[_0x09c0('0x4e')]=function(_0x3f6d14,_0x38085c){return db[_0x09c0('0x47')][_0x09c0('0x4e')](_0x3f6d14[_0x09c0('0x4f')],{})[_0x09c0('0x2a')](function(_0x332b69){var _0x32abbe=_0x3f6d14[_0x09c0('0x50')][_0x09c0('0x27')]({'plain':!![]});if(!_0x32abbe)throw new Error(_0x09c0('0x51'));if(_0x32abbe[_0x09c0('0x52')]==='user'){var _0x4acf54=_0x332b69[_0x09c0('0x27')]({'plain':!![]});var _0x15b0a2=_0x09c0('0x28');return db[_0x09c0('0x53')]['find']({'where':{'name':_0x15b0a2,'userProfileId':_0x32abbe[_0x09c0('0x54')]},'raw':!![]})[_0x09c0('0x2a')](function(_0x1823c2){if(_0x1823c2&&_0x1823c2['autoAssociation']===0x0){return db[_0x09c0('0x29')][_0x09c0('0x4e')]({'name':_0x4acf54[_0x09c0('0x2c')],'resourceId':_0x4acf54['id'],'type':_0x1823c2[_0x09c0('0x2c')],'sectionId':_0x1823c2['id']},{})[_0x09c0('0x2a')](function(){return _0x332b69;});}else{return _0x332b69;}})[_0x09c0('0x4b')](function(_0x45ecd0){logger['error'](_0x09c0('0x55'),_0x45ecd0);throw _0x45ecd0;});}return _0x332b69;})[_0x09c0('0x2a')](respondWithResult(_0x38085c,0xc9))[_0x09c0('0x4b')](handleError(_0x38085c,null));};exports[_0x09c0('0x25')]=function(_0x21fe00,_0x316fbd){if(_0x21fe00[_0x09c0('0x4f')]['id']){delete _0x21fe00['body']['id'];}return db['VoiceMail'][_0x09c0('0x4d')]({'where':{'id':_0x21fe00[_0x09c0('0x56')]['id']}})[_0x09c0('0x2a')](handleEntityNotFound(_0x316fbd,null))['then'](saveUpdates(_0x21fe00[_0x09c0('0x4f')],null))['then'](respondWithResult(_0x316fbd,null))[_0x09c0('0x4b')](handleError(_0x316fbd,null));};exports[_0x09c0('0x26')]=function(_0x42d4dd,_0x290618){return db[_0x09c0('0x47')][_0x09c0('0x4d')]({'where':{'id':_0x42d4dd[_0x09c0('0x56')]['id']}})['then'](handleEntityNotFound(_0x290618,null))[_0x09c0('0x2a')](removeEntity(_0x290618,null))[_0x09c0('0x4b')](handleError(_0x290618,null));};exports[_0x09c0('0x57')]=function(_0x270ff2,_0x3a6845,_0x219195){return db[_0x09c0('0x47')][_0x09c0('0x58')]({'where':{'id':_0x270ff2[_0x09c0('0x56')]['id']}})[_0x09c0('0x2a')](handleEntityNotFound(_0x3a6845,null))[_0x09c0('0x2a')](function(_0x4c4339){var _0x34cc0a;var _0x3564e6={},_0x26dc22={};_0x26dc22[_0x09c0('0x39')]=_['keys'](db[_0x09c0('0x59')]['rawAttributes']);_0x26dc22[_0x09c0('0x34')]=_[_0x09c0('0x35')](_0x270ff2[_0x09c0('0x34')]);_0x26dc22['filters']=_['intersection'](_0x26dc22[_0x09c0('0x39')],_0x26dc22[_0x09c0('0x34')]);_0x3564e6[_0x09c0('0x38')]=_[_0x09c0('0x37')](_0x26dc22['model'],qs[_0x09c0('0x3a')](_0x270ff2[_0x09c0('0x34')]['fields']));_0x3564e6[_0x09c0('0x38')]=_0x3564e6[_0x09c0('0x38')][_0x09c0('0x3b')]?_0x3564e6[_0x09c0('0x38')]:_0x26dc22['model'];if(!_0x270ff2[_0x09c0('0x34')][_0x09c0('0x3c')](_0x09c0('0x3d'))){_0x3564e6[_0x09c0('0x20')]=qs[_0x09c0('0x20')](_0x270ff2[_0x09c0('0x34')][_0x09c0('0x20')]);_0x3564e6[_0x09c0('0x3e')]=qs[_0x09c0('0x3e')](_0x270ff2[_0x09c0('0x34')][_0x09c0('0x3e')]);}_0x3564e6[_0x09c0('0x3f')]=qs[_0x09c0('0x40')](_0x270ff2['query'][_0x09c0('0x40')]);_0x3564e6[_0x09c0('0x44')]=qs[_0x09c0('0x36')](_[_0x09c0('0x41')](_0x270ff2[_0x09c0('0x34')],_0x26dc22['filters']));if(_0x270ff2[_0x09c0('0x34')][_0x09c0('0x42')]){_0x3564e6[_0x09c0('0x44')]=_[_0x09c0('0x43')](_0x3564e6['where'],{'$or':_[_0x09c0('0x2f')](_0x3564e6[_0x09c0('0x38')],function(_0x569462){var _0x325013={};_0x325013[_0x569462]={'$like':'%'+_0x270ff2[_0x09c0('0x34')][_0x09c0('0x42')]+'%'};return _0x325013;})});}_0x3564e6[_0x09c0('0x44')]=_[_0x09c0('0x43')](_0x3564e6['where'],{'mailboxuser':_0x4c4339[_0x09c0('0x5a')]});_0x3564e6=_[_0x09c0('0x43')]({},_0x3564e6,_0x270ff2[_0x09c0('0x46')]);return db[_0x09c0('0x59')][_0x09c0('0x5b')](_0x3564e6)['then'](respondWithFilteredResult(_0x3a6845,_0x3564e6));})[_0x09c0('0x4b')](handleError(_0x3a6845,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 05761c0..2d15bfb 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 _0x9f72=['request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','define','voice_voicemail','mailbox_context','context','lodash','util','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f72,0x105));var _0x29f7=function(_0x1a04ad,_0x390617){_0x1a04ad=_0x1a04ad-0x0;var _0x102712=_0x9f72[_0x1a04ad];return _0x102712;};'use strict';var _=require(_0x29f7('0x0'));var util=require(_0x29f7('0x1'));var logger=require('../../config/logger')(_0x29f7('0x2'));var moment=require(_0x29f7('0x3'));var BPromise=require(_0x29f7('0x4'));var rp=require(_0x29f7('0x5'));var fs=require('fs');var path=require(_0x29f7('0x6'));var rimraf=require(_0x29f7('0x7'));var config=require(_0x29f7('0x8'));var attributes=require(_0x29f7('0x9'));module['exports']=function(_0xd16bc4,_0x389b14){return _0xd16bc4[_0x29f7('0xa')]('VoiceMail',attributes,{'tableName':_0x29f7('0xb'),'paranoid':![],'indexes':[{'name':_0x29f7('0xc'),'fields':['mailbox',_0x29f7('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcead=['exports','define','voice_voicemail','mailbox_context','context','lodash','util','bluebird','path','rimraf','../../config/environment','./voiceMail.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcead,0x1f1));var _0xdcea=function(_0x1de310,_0x40e22b){_0x1de310=_0x1de310-0x0;var _0x15fd6d=_0xcead[_0x1de310];return _0x15fd6d;};'use strict';var _=require(_0xdcea('0x0'));var util=require(_0xdcea('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xdcea('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdcea('0x3'));var rimraf=require(_0xdcea('0x4'));var config=require(_0xdcea('0x5'));var attributes=require(_0xdcea('0x6'));module[_0xdcea('0x7')]=function(_0xdb132b,_0x3eb858){return _0xdb132b[_0xdcea('0x8')]('VoiceMail',attributes,{'tableName':_0xdcea('0x9'),'paranoid':![],'indexes':[{'name':_0xdcea('0xa'),'fields':['mailbox',_0xdcea('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 65f261b..ef10feb 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 _0x7f97=['client','http','request','info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x7f97,0x7c));var _0x77f9=function(_0x4ea7ff,_0x2a79fe){_0x4ea7ff=_0x4ea7ff-0x0;var _0x4fc65d=_0x7f97[_0x4ea7ff];return _0x4fc65d;};'use strict';var _=require(_0x77f9('0x0'));var util=require(_0x77f9('0x1'));var moment=require(_0x77f9('0x2'));var BPromise=require(_0x77f9('0x3'));var rs=require(_0x77f9('0x4'));var fs=require('fs');var Redis=require(_0x77f9('0x5'));var db=require(_0x77f9('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x77f9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x77f9('0x8')][_0x77f9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11f6d8,_0x3a88cc,_0x40286a){return new BPromise(function(_0x1922d3,_0x4768f9){return client[_0x77f9('0xa')](_0x11f6d8,_0x40286a)['then'](function(_0x4db853){logger[_0x77f9('0xb')]('VoiceMail,\x20%s,\x20%s',_0x3a88cc,_0x77f9('0xc'));logger[_0x77f9('0xd')](_0x77f9('0xe'),_0x3a88cc,_0x77f9('0xc'),JSON[_0x77f9('0xf')](_0x4db853));if(_0x4db853[_0x77f9('0x10')]){if(_0x4db853['error'][_0x77f9('0x11')]===0x1f4){logger[_0x77f9('0x10')](_0x77f9('0x12'),_0x3a88cc,_0x4db853[_0x77f9('0x10')][_0x77f9('0x13')]);return _0x4768f9(_0x4db853[_0x77f9('0x10')]['message']);}logger['error'](_0x77f9('0x12'),_0x3a88cc,_0x4db853['error'][_0x77f9('0x13')]);return _0x1922d3(_0x4db853[_0x77f9('0x10')][_0x77f9('0x13')]);}else{logger['info'](_0x77f9('0x12'),_0x3a88cc,_0x77f9('0xc'));_0x1922d3(_0x4db853[_0x77f9('0x14')][_0x77f9('0x13')]);}})[_0x77f9('0x15')](function(_0x3b40df){logger['error'](_0x77f9('0x12'),_0x3a88cc,_0x3b40df);_0x4768f9(_0x3b40df);});});} \ No newline at end of file +var _0x3c65=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x1dc9bb,_0x5b167c){var _0x5e2cc1=function(_0x3a3c3a){while(--_0x3a3c3a){_0x1dc9bb['push'](_0x1dc9bb['shift']());}};_0x5e2cc1(++_0x5b167c);}(_0x3c65,0x19b));var _0x53c6=function(_0x544099,_0x372b30){_0x544099=_0x544099-0x0;var _0x20ab09=_0x3c65[_0x544099];return _0x20ab09;};'use strict';var _=require(_0x53c6('0x0'));var util=require(_0x53c6('0x1'));var moment=require(_0x53c6('0x2'));var BPromise=require(_0x53c6('0x3'));var rs=require(_0x53c6('0x4'));var fs=require('fs');var Redis=require(_0x53c6('0x5'));var db=require(_0x53c6('0x6'))['db'];var utils=require(_0x53c6('0x7'));var logger=require(_0x53c6('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x53c6('0x9'));var client=jayson['client'][_0x53c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xdf5186,_0x2efbc9,_0x3790bd){return new BPromise(function(_0x37148c,_0x14e61c){return client['request'](_0xdf5186,_0x3790bd)[_0x53c6('0xb')](function(_0x3d3211){logger[_0x53c6('0xc')](_0x53c6('0xd'),_0x2efbc9,'request\x20sent');logger[_0x53c6('0xe')](_0x53c6('0xf'),_0x2efbc9,_0x53c6('0x10'),JSON[_0x53c6('0x11')](_0x3d3211));if(_0x3d3211[_0x53c6('0x12')]){if(_0x3d3211[_0x53c6('0x12')][_0x53c6('0x13')]===0x1f4){logger[_0x53c6('0x12')](_0x53c6('0xd'),_0x2efbc9,_0x3d3211[_0x53c6('0x12')][_0x53c6('0x14')]);return _0x14e61c(_0x3d3211[_0x53c6('0x12')][_0x53c6('0x14')]);}logger[_0x53c6('0x12')](_0x53c6('0xd'),_0x2efbc9,_0x3d3211['error'][_0x53c6('0x14')]);return _0x37148c(_0x3d3211['error'][_0x53c6('0x14')]);}else{logger[_0x53c6('0xc')](_0x53c6('0xd'),_0x2efbc9,_0x53c6('0x10'));_0x37148c(_0x3d3211[_0x53c6('0x15')][_0x53c6('0x14')]);}})[_0x53c6('0x16')](function(_0x5ba0e0){logger[_0x53c6('0x12')](_0x53c6('0xd'),_0x2efbc9,_0x5ba0e0);_0x14e61c(_0x5ba0e0);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 061e2d9..5cc122f 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 _0xd8a8=['index','show','/:id/download','/:id','update','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated'];(function(_0x177e48,_0x2f35dd){var _0x365760=function(_0x349940){while(--_0x349940){_0x177e48['push'](_0x177e48['shift']());}};_0x365760(++_0x2f35dd);}(_0xd8a8,0xf5));var _0x8d8a=function(_0xcff441,_0x5b5bf2){_0xcff441=_0xcff441-0x0;var _0x435865=_0xd8a8[_0xcff441];return _0x435865;};'use strict';var multer=require('multer');var util=require(_0x8d8a('0x0'));var path=require('path');var timeout=require(_0x8d8a('0x1'));var express=require(_0x8d8a('0x2'));var router=express[_0x8d8a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8d8a('0x4'));var interaction=require(_0x8d8a('0x5'));var config=require(_0x8d8a('0x6'));var controller=require(_0x8d8a('0x7'));router[_0x8d8a('0x8')]('/',auth[_0x8d8a('0x9')](),controller[_0x8d8a('0xa')]);router[_0x8d8a('0x8')]('/:id',auth[_0x8d8a('0x9')](),controller[_0x8d8a('0xb')]);router['get'](_0x8d8a('0xc'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x8d8a('0x9')](),controller['create']);router['put'](_0x8d8a('0xd'),auth[_0x8d8a('0x9')](),controller[_0x8d8a('0xe')]);router[_0x8d8a('0xf')]('/:id',auth[_0x8d8a('0x9')](),controller[_0x8d8a('0x10')]);module['exports']=router; \ No newline at end of file +var _0xb45e=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','/:id','get','/:id/download','download','create','update','destroy'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xb45e,0xc7));var _0xeb45=function(_0x2ad228,_0x3a77c8){_0x2ad228=_0x2ad228-0x0;var _0x13010c=_0xb45e[_0x2ad228];return _0x13010c;};'use strict';var multer=require('multer');var util=require(_0xeb45('0x0'));var path=require(_0xeb45('0x1'));var timeout=require(_0xeb45('0x2'));var express=require(_0xeb45('0x3'));var router=express[_0xeb45('0x4')]();var fs_extra=require(_0xeb45('0x5'));var auth=require(_0xeb45('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xeb45('0x7'));var controller=require(_0xeb45('0x8'));router['get']('/',auth[_0xeb45('0x9')](),controller['index']);router['get'](_0xeb45('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xeb45('0xb')](_0xeb45('0xc'),auth['isAuthenticated'](),controller[_0xeb45('0xd')]);router['post']('/',auth[_0xeb45('0x9')](),controller[_0xeb45('0xe')]);router['put'](_0xeb45('0xa'),auth[_0xeb45('0x9')](),controller[_0xeb45('0xf')]);router['delete'](_0xeb45('0xa'),auth[_0xeb45('0x9')](),controller[_0xeb45('0x10')]);module[_0xeb45('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 25f4b2a..d26cbdb 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 _0xaf14=['STRING','BLOB','long','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','getDataValue'];(function(_0x663bc0,_0x3e0485){var _0x3eeb11=function(_0x2fc28a){while(--_0x2fc28a){_0x663bc0['push'](_0x663bc0['shift']());}};_0x3eeb11(++_0x3e0485);}(_0xaf14,0x6d));var _0x4af1=function(_0xfb6087,_0x18ccbf){_0xfb6087=_0xfb6087-0x0;var _0x5f3273=_0xaf14[_0xfb6087];return _0x5f3273;};'use strict';var Sequelize=require('sequelize');module[_0x4af1('0x0')]={'name':{'type':Sequelize[_0x4af1('0x1')],'get':function(_0x285e46){return this[_0x4af1('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x4af1('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x4af1('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x4af1('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x4af1('0x3')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x4af1('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x4af1('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x4af1('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x4af1('0x4')](_0x4af1('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x4af1('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x4af1('0x3')],'defaultValue':''},'stamp':{'type':_0x4af1('0x6'),'defaultValue':Sequelize['literal'](_0x4af1('0x7'))}}; \ No newline at end of file +var _0x87c7=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','INTEGER','STRING','long','TIMESTAMP','literal'];(function(_0x13563f,_0x444525){var _0x20befa=function(_0x1b1c06){while(--_0x1b1c06){_0x13563f['push'](_0x13563f['shift']());}};_0x20befa(++_0x444525);}(_0x87c7,0x1b1));var _0x787c=function(_0x314340,_0x44eac9){_0x314340=_0x314340-0x0;var _0x1336d6=_0x87c7[_0x314340];return _0x1336d6;};'use strict';var Sequelize=require(_0x787c('0x0'));module['exports']={'name':{'type':Sequelize[_0x787c('0x1')],'get':function(_0x3a1460){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x787c('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x787c('0x3')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x787c('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x787c('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x787c('0x3')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x787c('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x787c('0x3')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x787c('0x4')),'defaultValue':null},'flag':{'type':Sequelize[_0x787c('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x787c('0x5'),'defaultValue':Sequelize[_0x787c('0x6')](_0x787c('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index f213611..355d733 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 _0x1d04=['moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','limit','set','Content-Range','json','apply','save','update','then','name','send','map','VoiceMailMessage','type','key','model','differenceBy','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','body','download','msg_id','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','rimraf','fast-json-patch','request-promise'];(function(_0x4cc314,_0x50591f){var _0x41dee9=function(_0x4f5a8d){while(--_0x4f5a8d){_0x4cc314['push'](_0x4cc314['shift']());}};_0x41dee9(++_0x50591f);}(_0x1d04,0xa9));var _0x41d0=function(_0x362400,_0x231f5c){_0x362400=_0x362400-0x0;var _0x11de1a=_0x1d04[_0x362400];return _0x11de1a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x41d0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x41d0('0x1'));var rp=require(_0x41d0('0x2'));var moment=require(_0x41d0('0x3'));var BPromise=require(_0x41d0('0x4'));var Mustache=require(_0x41d0('0x5'));var util=require('util');var path=require(_0x41d0('0x6'));var sox=require(_0x41d0('0x7'));var csv=require(_0x41d0('0x8'));var ejs=require(_0x41d0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x41d0('0xa'));var squel=require(_0x41d0('0xb'));var crypto=require(_0x41d0('0xc'));var jsforce=require(_0x41d0('0xd'));var deskjs=require(_0x41d0('0xe'));var toCsv=require(_0x41d0('0x8'));var querystring=require(_0x41d0('0xf'));var Papa=require(_0x41d0('0x10'));var Redis=require('ioredis');var authService=require(_0x41d0('0x11'));var qs=require(_0x41d0('0x12'));var as=require(_0x41d0('0x13'));var hardwareService=require(_0x41d0('0x14'));var logger=require(_0x41d0('0x15'))(_0x41d0('0x16'));var utils=require(_0x41d0('0x17'));var config=require(_0x41d0('0x18'));var licenseUtil=require(_0x41d0('0x19'));var db=require(_0x41d0('0x1a'))['db'];function respondWithStatusCode(_0x57be68,_0x20d169){_0x20d169=_0x20d169||0xcc;return function(_0x1ea4f4){if(_0x1ea4f4){return _0x57be68[_0x41d0('0x1b')](_0x20d169);}return _0x57be68[_0x41d0('0x1c')](_0x20d169)[_0x41d0('0x1d')]();};}function respondWithResult(_0x512a42,_0x1fadfc){_0x1fadfc=_0x1fadfc||0xc8;return function(_0xa1363e){if(_0xa1363e){return _0x512a42[_0x41d0('0x1c')](_0x1fadfc)['json'](_0xa1363e);}};}function respondWithFilteredResult(_0x2d2930,_0x186b2e){return function(_0x24ed18){if(_0x24ed18){var _0x46c1e0=typeof _0x186b2e['offset']===_0x41d0('0x1e')&&typeof _0x186b2e['limit']===_0x41d0('0x1e');var _0x5c7fad=_0x24ed18['count'];var _0x37f8f6=_0x46c1e0?0x0:_0x186b2e['offset'];var _0x58ac27=_0x46c1e0?_0x24ed18[_0x41d0('0x1f')]:_0x186b2e['offset']+_0x186b2e[_0x41d0('0x20')];var _0x33ed8d;if(_0x58ac27>=_0x5c7fad){_0x58ac27=_0x5c7fad;_0x33ed8d=0xc8;}else{_0x33ed8d=0xce;}_0x2d2930[_0x41d0('0x1c')](_0x33ed8d);return _0x2d2930[_0x41d0('0x21')](_0x41d0('0x22'),_0x37f8f6+'-'+_0x58ac27+'/'+_0x5c7fad)[_0x41d0('0x23')](_0x24ed18);}return null;};}function patchUpdates(_0x47d898){return function(_0x48633c){try{jsonpatch[_0x41d0('0x24')](_0x48633c,_0x47d898,!![]);}catch(_0x438161){return BPromise['reject'](_0x438161);}return _0x48633c[_0x41d0('0x25')]();};}function saveUpdates(_0x54a418,_0x317abe){return function(_0x5c19a5){if(_0x5c19a5){return _0x5c19a5[_0x41d0('0x26')](_0x54a418)[_0x41d0('0x27')](function(_0x3d5227){return _0x3d5227;});}return null;};}function removeEntity(_0x4515e1,_0x4b7fe0){return function(_0x5d5fb3){if(_0x5d5fb3){return _0x5d5fb3['destroy']()['then'](function(){_0x4515e1[_0x41d0('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x513d34,_0x53a359){return function(_0x516494){if(!_0x516494){_0x513d34[_0x41d0('0x1b')](0x194);}return _0x516494;};}function handleError(_0x159cb3,_0x596680){_0x596680=_0x596680||0x1f4;return function(_0x3f4eb7){logger['error'](_0x3f4eb7['stack']);if(_0x3f4eb7[_0x41d0('0x28')]){delete _0x3f4eb7[_0x41d0('0x28')];}_0x159cb3[_0x41d0('0x1c')](_0x596680)[_0x41d0('0x29')](_0x3f4eb7);};}exports['index']=function(_0x102fec,_0x5f59b5){var _0x1d2587={},_0x61b964={},_0x6f6694={'count':0x0,'rows':[]};var _0x54dfe5=_[_0x41d0('0x2a')](db[_0x41d0('0x2b')]['rawAttributes'],function(_0x1d0f85){return{'name':_0x1d0f85['fieldName'],'type':_0x1d0f85[_0x41d0('0x2c')][_0x41d0('0x2d')]};});_0x61b964[_0x41d0('0x2e')]=_[_0x41d0('0x2f')](_[_0x41d0('0x2a')](_0x54dfe5,_0x41d0('0x28')),[_0x41d0('0x28')]);_0x61b964[_0x41d0('0x30')]=_[_0x41d0('0x31')](_0x102fec[_0x41d0('0x30')]);_0x61b964[_0x41d0('0x32')]=_[_0x41d0('0x33')](_0x61b964[_0x41d0('0x2e')],_0x61b964['query']);_0x1d2587[_0x41d0('0x34')]=_[_0x41d0('0x33')](_0x61b964[_0x41d0('0x2e')],qs['fields'](_0x102fec['query']['fields']));_0x1d2587[_0x41d0('0x34')]=_0x1d2587[_0x41d0('0x34')][_0x41d0('0x35')]?_0x1d2587[_0x41d0('0x34')]:_0x61b964['model'];if(!_0x102fec[_0x41d0('0x30')][_0x41d0('0x36')](_0x41d0('0x37'))){_0x1d2587[_0x41d0('0x20')]=qs[_0x41d0('0x20')](_0x102fec[_0x41d0('0x30')]['limit']);_0x1d2587[_0x41d0('0x38')]=qs[_0x41d0('0x38')](_0x102fec[_0x41d0('0x30')]['offset']);}_0x1d2587['order']=qs[_0x41d0('0x39')](_0x102fec[_0x41d0('0x30')][_0x41d0('0x39')]);_0x1d2587[_0x41d0('0x3a')]=qs[_0x41d0('0x32')](_[_0x41d0('0x3b')](_0x102fec[_0x41d0('0x30')],_0x61b964[_0x41d0('0x32')]),_0x54dfe5);if(_0x102fec[_0x41d0('0x30')][_0x41d0('0x3c')]){_0x1d2587['where']=_[_0x41d0('0x3d')](_0x1d2587[_0x41d0('0x3a')],{'$or':_[_0x41d0('0x2a')](_0x54dfe5,function(_0xa8dbde){if(_0xa8dbde[_0x41d0('0x2c')]!==_0x41d0('0x3e')){var _0x1075ab={};_0x1075ab[_0xa8dbde[_0x41d0('0x28')]]={'$like':'%'+_0x102fec[_0x41d0('0x30')]['filter']+'%'};return _0x1075ab;}})});}_0x1d2587=_[_0x41d0('0x3d')]({},_0x1d2587,_0x102fec[_0x41d0('0x3f')]);var _0x18193a={'where':_0x1d2587[_0x41d0('0x3a')]};return db[_0x41d0('0x2b')][_0x41d0('0x1f')](_0x18193a)['then'](function(_0x2d878f){_0x6f6694[_0x41d0('0x1f')]=_0x2d878f;if(_0x102fec['query'][_0x41d0('0x40')]){_0x1d2587[_0x41d0('0x41')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x41d0('0x42')](_0x1d2587);})[_0x41d0('0x27')](function(_0x586179){_0x6f6694[_0x41d0('0x43')]=_0x586179;return _0x6f6694;})[_0x41d0('0x27')](respondWithFilteredResult(_0x5f59b5,_0x1d2587))[_0x41d0('0x44')](handleError(_0x5f59b5,null));};exports[_0x41d0('0x45')]=function(_0x1ceda5,_0x54ceef){var _0x4d05f6={'raw':!![],'where':{'id':_0x1ceda5[_0x41d0('0x46')]['id']}},_0x49c3bc={};_0x49c3bc[_0x41d0('0x2e')]=_[_0x41d0('0x31')](db[_0x41d0('0x2b')][_0x41d0('0x47')]);_0x49c3bc['query']=_[_0x41d0('0x31')](_0x1ceda5[_0x41d0('0x30')]);_0x49c3bc[_0x41d0('0x32')]=_['intersection'](_0x49c3bc['model'],_0x49c3bc[_0x41d0('0x30')]);_0x4d05f6[_0x41d0('0x34')]=_[_0x41d0('0x33')](_0x49c3bc[_0x41d0('0x2e')],qs[_0x41d0('0x48')](_0x1ceda5['query'][_0x41d0('0x48')]));_0x4d05f6[_0x41d0('0x34')]=_0x4d05f6[_0x41d0('0x34')][_0x41d0('0x35')]?_0x4d05f6['attributes']:_0x49c3bc[_0x41d0('0x2e')];if(_0x1ceda5[_0x41d0('0x30')][_0x41d0('0x40')]){_0x4d05f6[_0x41d0('0x41')]=[{'all':!![]}];}_0x4d05f6=_[_0x41d0('0x3d')]({},_0x4d05f6,_0x1ceda5['options']);return db[_0x41d0('0x2b')][_0x41d0('0x49')](_0x4d05f6)['then'](handleEntityNotFound(_0x54ceef,null))['then'](respondWithResult(_0x54ceef,null))[_0x41d0('0x44')](handleError(_0x54ceef,null));};exports[_0x41d0('0x4a')]=function(_0x109405,_0x4d4b9b){return db[_0x41d0('0x2b')]['create'](_0x109405[_0x41d0('0x4b')],{})[_0x41d0('0x27')](respondWithResult(_0x4d4b9b,0xc9))[_0x41d0('0x44')](handleError(_0x4d4b9b,null));};exports[_0x41d0('0x26')]=function(_0x3dda04,_0x2dd384){if(_0x3dda04[_0x41d0('0x4b')]['id']){delete _0x3dda04[_0x41d0('0x4b')]['id'];}return db[_0x41d0('0x2b')][_0x41d0('0x49')]({'where':{'id':_0x3dda04[_0x41d0('0x46')]['id']}})[_0x41d0('0x27')](handleEntityNotFound(_0x2dd384,null))[_0x41d0('0x27')](saveUpdates(_0x3dda04['body'],null))[_0x41d0('0x27')](respondWithResult(_0x2dd384,null))[_0x41d0('0x44')](handleError(_0x2dd384,null));};exports['destroy']=function(_0x54e509,_0x312b22){return db['VoiceMailMessage'][_0x41d0('0x49')]({'where':{'id':_0x54e509[_0x41d0('0x46')]['id']}})[_0x41d0('0x27')](handleEntityNotFound(_0x312b22,null))[_0x41d0('0x27')](removeEntity(_0x312b22,null))[_0x41d0('0x44')](handleError(_0x312b22,null));};exports[_0x41d0('0x4c')]=function(_0x426afb,_0x4f085f,_0x443a8e){return db[_0x41d0('0x2b')][_0x41d0('0x49')]({'where':{'id':_0x426afb[_0x41d0('0x46')]['id']},'attributes':['id','recording',_0x41d0('0x4d')]})[_0x41d0('0x27')](handleEntityNotFound(_0x4f085f,null))[_0x41d0('0x27')](function(_0x12afef){if(_0x12afef){if(!_0x12afef[_0x41d0('0x4e')]){throw new db[(_0x41d0('0x4f'))][(_0x41d0('0x50'))](_0x41d0('0x51'));}var _0x3ee877={'Content-Type':_0x41d0('0x52'),'Content-Disposition':'attachment'};if(_0x12afef[_0x41d0('0x4d')]){_0x3ee877[_0x41d0('0x53')]=_0x41d0('0x54')+_0x12afef[_0x41d0('0x4d')]+_0x41d0('0x55');}_0x4f085f['set'](_0x3ee877);return _0x4f085f[_0x41d0('0x29')](new Buffer(_0x12afef[_0x41d0('0x4e')]));}})[_0x41d0('0x44')](handleError(_0x4f085f,null));}; \ No newline at end of file +var _0x79d5=['params','includeAll','include','merge','find','body','recording','Sequelize','ValidationError','audio/wav','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','fields','attributes','length','nolimit','order','sort','where','pick','filter','options','rows','catch','show'];(function(_0x1166c8,_0x20e417){var _0x200469=function(_0x56b6fa){while(--_0x56b6fa){_0x1166c8['push'](_0x1166c8['shift']());}};_0x200469(++_0x20e417);}(_0x79d5,0xb1));var _0x579d=function(_0x483102,_0x54e93d){_0x483102=_0x483102-0x0;var _0x5cc885=_0x79d5[_0x483102];return _0x5cc885;};'use strict';var emlformat=require(_0x579d('0x0'));var rimraf=require(_0x579d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x579d('0x2'));var moment=require('moment');var BPromise=require(_0x579d('0x3'));var Mustache=require(_0x579d('0x4'));var util=require('util');var path=require(_0x579d('0x5'));var sox=require(_0x579d('0x6'));var csv=require(_0x579d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x579d('0x8'));var _=require(_0x579d('0x9'));var squel=require('squel');var crypto=require(_0x579d('0xa'));var jsforce=require(_0x579d('0xb'));var deskjs=require(_0x579d('0xc'));var toCsv=require(_0x579d('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x579d('0xd'));var authService=require(_0x579d('0xe'));var qs=require(_0x579d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x579d('0x10'));var logger=require(_0x579d('0x11'))(_0x579d('0x12'));var utils=require(_0x579d('0x13'));var config=require(_0x579d('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x579d('0x15'))['db'];function respondWithStatusCode(_0x15d170,_0x47e9ec){_0x47e9ec=_0x47e9ec||0xcc;return function(_0x12b3be){if(_0x12b3be){return _0x15d170[_0x579d('0x16')](_0x47e9ec);}return _0x15d170[_0x579d('0x17')](_0x47e9ec)[_0x579d('0x18')]();};}function respondWithResult(_0x133cc4,_0x403691){_0x403691=_0x403691||0xc8;return function(_0x410590){if(_0x410590){return _0x133cc4[_0x579d('0x17')](_0x403691)['json'](_0x410590);}};}function respondWithFilteredResult(_0x537e5f,_0x36ea28){return function(_0x2a805c){if(_0x2a805c){var _0x360193=typeof _0x36ea28[_0x579d('0x19')]===_0x579d('0x1a')&&typeof _0x36ea28['limit']==='undefined';var _0x53be7e=_0x2a805c[_0x579d('0x1b')];var _0x32e0f5=_0x360193?0x0:_0x36ea28[_0x579d('0x19')];var _0xfedba8=_0x360193?_0x2a805c[_0x579d('0x1b')]:_0x36ea28['offset']+_0x36ea28[_0x579d('0x1c')];var _0x1c5506;if(_0xfedba8>=_0x53be7e){_0xfedba8=_0x53be7e;_0x1c5506=0xc8;}else{_0x1c5506=0xce;}_0x537e5f[_0x579d('0x17')](_0x1c5506);return _0x537e5f[_0x579d('0x1d')](_0x579d('0x1e'),_0x32e0f5+'-'+_0xfedba8+'/'+_0x53be7e)[_0x579d('0x1f')](_0x2a805c);}return null;};}function patchUpdates(_0x4f2bf8){return function(_0x44bc25){try{jsonpatch[_0x579d('0x20')](_0x44bc25,_0x4f2bf8,!![]);}catch(_0x34fc8e){return BPromise[_0x579d('0x21')](_0x34fc8e);}return _0x44bc25['save']();};}function saveUpdates(_0x368460,_0x5e49d3){return function(_0x28f979){if(_0x28f979){return _0x28f979[_0x579d('0x22')](_0x368460)['then'](function(_0xa6fb63){return _0xa6fb63;});}return null;};}function removeEntity(_0x13e3f6,_0x4563e4){return function(_0x15fc22){if(_0x15fc22){return _0x15fc22[_0x579d('0x23')]()[_0x579d('0x24')](function(){_0x13e3f6[_0x579d('0x17')](0xcc)[_0x579d('0x18')]();});}};}function handleEntityNotFound(_0x2db309,_0x5bf739){return function(_0x2c8a6c){if(!_0x2c8a6c){_0x2db309[_0x579d('0x16')](0x194);}return _0x2c8a6c;};}function handleError(_0x21645f,_0x178f3e){_0x178f3e=_0x178f3e||0x1f4;return function(_0x1aa8d1){logger[_0x579d('0x25')](_0x1aa8d1[_0x579d('0x26')]);if(_0x1aa8d1[_0x579d('0x27')]){delete _0x1aa8d1['name'];}_0x21645f[_0x579d('0x17')](_0x178f3e)[_0x579d('0x28')](_0x1aa8d1);};}exports[_0x579d('0x29')]=function(_0x41b48b,_0x1967bb){var _0x58b400={},_0x399146={},_0x38fd3a={'count':0x0,'rows':[]};var _0x3c6a02=_[_0x579d('0x2a')](db[_0x579d('0x2b')][_0x579d('0x2c')],function(_0x4e370d){return{'name':_0x4e370d[_0x579d('0x2d')],'type':_0x4e370d[_0x579d('0x2e')][_0x579d('0x2f')]};});_0x399146['model']=_['differenceBy'](_[_0x579d('0x2a')](_0x3c6a02,_0x579d('0x27')),[_0x579d('0x27')]);_0x399146['query']=_[_0x579d('0x30')](_0x41b48b['query']);_0x399146[_0x579d('0x31')]=_[_0x579d('0x32')](_0x399146[_0x579d('0x33')],_0x399146[_0x579d('0x34')]);_0x58b400['attributes']=_[_0x579d('0x32')](_0x399146[_0x579d('0x33')],qs[_0x579d('0x35')](_0x41b48b['query']['fields']));_0x58b400[_0x579d('0x36')]=_0x58b400['attributes'][_0x579d('0x37')]?_0x58b400[_0x579d('0x36')]:_0x399146['model'];if(!_0x41b48b[_0x579d('0x34')]['hasOwnProperty'](_0x579d('0x38'))){_0x58b400[_0x579d('0x1c')]=qs[_0x579d('0x1c')](_0x41b48b[_0x579d('0x34')][_0x579d('0x1c')]);_0x58b400[_0x579d('0x19')]=qs[_0x579d('0x19')](_0x41b48b['query'][_0x579d('0x19')]);}_0x58b400[_0x579d('0x39')]=qs[_0x579d('0x3a')](_0x41b48b['query'][_0x579d('0x3a')]);_0x58b400[_0x579d('0x3b')]=qs[_0x579d('0x31')](_[_0x579d('0x3c')](_0x41b48b[_0x579d('0x34')],_0x399146[_0x579d('0x31')]),_0x3c6a02);if(_0x41b48b['query'][_0x579d('0x3d')]){_0x58b400['where']=_['merge'](_0x58b400[_0x579d('0x3b')],{'$or':_[_0x579d('0x2a')](_0x3c6a02,function(_0x3a46b2){if(_0x3a46b2[_0x579d('0x2e')]!=='VIRTUAL'){var _0x7cf194={};_0x7cf194[_0x3a46b2[_0x579d('0x27')]]={'$like':'%'+_0x41b48b['query'][_0x579d('0x3d')]+'%'};return _0x7cf194;}})});}_0x58b400=_['merge']({},_0x58b400,_0x41b48b[_0x579d('0x3e')]);var _0x312b5e={'where':_0x58b400['where']};return db[_0x579d('0x2b')]['count'](_0x312b5e)[_0x579d('0x24')](function(_0x1d7e11){_0x38fd3a[_0x579d('0x1b')]=_0x1d7e11;if(_0x41b48b['query']['includeAll']){_0x58b400['include']=[{'all':!![]}];}return db[_0x579d('0x2b')]['findAll'](_0x58b400);})[_0x579d('0x24')](function(_0xb748ab){_0x38fd3a[_0x579d('0x3f')]=_0xb748ab;return _0x38fd3a;})['then'](respondWithFilteredResult(_0x1967bb,_0x58b400))[_0x579d('0x40')](handleError(_0x1967bb,null));};exports[_0x579d('0x41')]=function(_0xdbe1f0,_0xc61cba){var _0x157615={'raw':!![],'where':{'id':_0xdbe1f0[_0x579d('0x42')]['id']}},_0x42539f={};_0x42539f[_0x579d('0x33')]=_[_0x579d('0x30')](db[_0x579d('0x2b')][_0x579d('0x2c')]);_0x42539f[_0x579d('0x34')]=_[_0x579d('0x30')](_0xdbe1f0[_0x579d('0x34')]);_0x42539f[_0x579d('0x31')]=_['intersection'](_0x42539f[_0x579d('0x33')],_0x42539f[_0x579d('0x34')]);_0x157615[_0x579d('0x36')]=_[_0x579d('0x32')](_0x42539f[_0x579d('0x33')],qs[_0x579d('0x35')](_0xdbe1f0[_0x579d('0x34')][_0x579d('0x35')]));_0x157615[_0x579d('0x36')]=_0x157615[_0x579d('0x36')][_0x579d('0x37')]?_0x157615[_0x579d('0x36')]:_0x42539f[_0x579d('0x33')];if(_0xdbe1f0[_0x579d('0x34')][_0x579d('0x43')]){_0x157615[_0x579d('0x44')]=[{'all':!![]}];}_0x157615=_[_0x579d('0x45')]({},_0x157615,_0xdbe1f0[_0x579d('0x3e')]);return db[_0x579d('0x2b')][_0x579d('0x46')](_0x157615)[_0x579d('0x24')](handleEntityNotFound(_0xc61cba,null))[_0x579d('0x24')](respondWithResult(_0xc61cba,null))[_0x579d('0x40')](handleError(_0xc61cba,null));};exports['create']=function(_0x2df38f,_0x378895){return db[_0x579d('0x2b')]['create'](_0x2df38f[_0x579d('0x47')],{})[_0x579d('0x24')](respondWithResult(_0x378895,0xc9))['catch'](handleError(_0x378895,null));};exports[_0x579d('0x22')]=function(_0x3250cd,_0x3ad46e){if(_0x3250cd['body']['id']){delete _0x3250cd['body']['id'];}return db[_0x579d('0x2b')][_0x579d('0x46')]({'where':{'id':_0x3250cd[_0x579d('0x42')]['id']}})[_0x579d('0x24')](handleEntityNotFound(_0x3ad46e,null))['then'](saveUpdates(_0x3250cd[_0x579d('0x47')],null))[_0x579d('0x24')](respondWithResult(_0x3ad46e,null))[_0x579d('0x40')](handleError(_0x3ad46e,null));};exports[_0x579d('0x23')]=function(_0xc72c9b,_0x50e2cd){return db[_0x579d('0x2b')][_0x579d('0x46')]({'where':{'id':_0xc72c9b[_0x579d('0x42')]['id']}})[_0x579d('0x24')](handleEntityNotFound(_0x50e2cd,null))[_0x579d('0x24')](removeEntity(_0x50e2cd,null))['catch'](handleError(_0x50e2cd,null));};exports['download']=function(_0x2aeefb,_0x59c1c0,_0x581232){return db[_0x579d('0x2b')][_0x579d('0x46')]({'where':{'id':_0x2aeefb[_0x579d('0x42')]['id']},'attributes':['id',_0x579d('0x48'),'msg_id']})['then'](handleEntityNotFound(_0x59c1c0,null))['then'](function(_0x4fc32b){if(_0x4fc32b){if(!_0x4fc32b[_0x579d('0x48')]){throw new db[(_0x579d('0x49'))][(_0x579d('0x4a'))]('VoiceMailMessage\x20not\x20found');}var _0x751d66={'Content-Type':_0x579d('0x4b'),'Content-Disposition':_0x579d('0x4c')};if(_0x4fc32b[_0x579d('0x4d')]){_0x751d66[_0x579d('0x4e')]=_0x579d('0x4f')+_0x4fc32b['msg_id']+_0x579d('0x50');}_0x59c1c0['set'](_0x751d66);return _0x59c1c0[_0x579d('0x28')](new Buffer(_0x4fc32b[_0x579d('0x48')]));}})['catch'](handleError(_0x59c1c0,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 84af817..3e78adb 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 _0x0ed0=['request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','define','voice_voicemail_messages','dir','lodash','../../config/logger','api'];(function(_0x1b3874,_0x5dfd48){var _0x12ca45=function(_0x4eefb5){while(--_0x4eefb5){_0x1b3874['push'](_0x1b3874['shift']());}};_0x12ca45(++_0x5dfd48);}(_0x0ed0,0x1cb));var _0x00ed=function(_0x3d9071,_0xf8eddc){_0x3d9071=_0x3d9071-0x0;var _0x122ba1=_0x0ed0[_0x3d9071];return _0x122ba1;};'use strict';var _=require(_0x00ed('0x0'));var util=require('util');var logger=require(_0x00ed('0x1'))(_0x00ed('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x00ed('0x3'));var fs=require('fs');var path=require(_0x00ed('0x4'));var rimraf=require(_0x00ed('0x5'));var config=require(_0x00ed('0x6'));var attributes=require(_0x00ed('0x7'));module['exports']=function(_0x1a9fa5,_0x17df46){return _0x1a9fa5[_0x00ed('0x8')]('VoiceMailMessage',attributes,{'tableName':_0x00ed('0x9'),'paranoid':![],'indexes':[{'name':_0x00ed('0xa'),'fields':[_0x00ed('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0x4324=['api','moment','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','voice_voicemail_messages','dir','lodash','util','../../config/logger'];(function(_0x57a283,_0x51b4c3){var _0x5d8f09=function(_0x27af92){while(--_0x27af92){_0x57a283['push'](_0x57a283['shift']());}};_0x5d8f09(++_0x51b4c3);}(_0x4324,0x135));var _0x4432=function(_0x470f24,_0x2436a9){_0x470f24=_0x470f24-0x0;var _0x2c6fc8=_0x4324[_0x470f24];return _0x2c6fc8;};'use strict';var _=require(_0x4432('0x0'));var util=require(_0x4432('0x1'));var logger=require(_0x4432('0x2'))(_0x4432('0x3'));var moment=require(_0x4432('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4432('0x5'));var rimraf=require(_0x4432('0x6'));var config=require(_0x4432('0x7'));var attributes=require(_0x4432('0x8'));module[_0x4432('0x9')]=function(_0x178324,_0x25ba33){return _0x178324[_0x4432('0xa')]('VoiceMailMessage',attributes,{'tableName':_0x4432('0xb'),'paranoid':![],'indexes':[{'name':_0x4432('0xc'),'fields':[_0x4432('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 27284e7..bc66a69 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 _0x0294=['../../config/environment','jayson/promise','client','request','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1cbc3b,_0x56c2d0){var _0xe6d5f5=function(_0x419522){while(--_0x419522){_0x1cbc3b['push'](_0x1cbc3b['shift']());}};_0xe6d5f5(++_0x56c2d0);}(_0x0294,0x18e));var _0x4029=function(_0x377302,_0x492196){_0x377302=_0x377302-0x0;var _0x39bd55=_0x0294[_0x377302];return _0x39bd55;};'use strict';var _=require(_0x4029('0x0'));var util=require(_0x4029('0x1'));var moment=require(_0x4029('0x2'));var BPromise=require(_0x4029('0x3'));var rs=require(_0x4029('0x4'));var fs=require('fs');var Redis=require(_0x4029('0x5'));var db=require(_0x4029('0x6'))['db'];var utils=require(_0x4029('0x7'));var logger=require(_0x4029('0x8'))(_0x4029('0x9'));var config=require(_0x4029('0xa'));var jayson=require(_0x4029('0xb'));var client=jayson[_0x4029('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42debd,_0xfa5194,_0x42264a){return new BPromise(function(_0x264186,_0x3192a7){return client[_0x4029('0xd')](_0x42debd,_0x42264a)['then'](function(_0x47d173){logger['info'](_0x4029('0xe'),_0xfa5194,_0x4029('0xf'));logger[_0x4029('0x10')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0xfa5194,_0x4029('0xf'),JSON[_0x4029('0x11')](_0x47d173));if(_0x47d173['error']){if(_0x47d173['error'][_0x4029('0x12')]===0x1f4){logger[_0x4029('0x13')](_0x4029('0xe'),_0xfa5194,_0x47d173[_0x4029('0x13')][_0x4029('0x14')]);return _0x3192a7(_0x47d173[_0x4029('0x13')][_0x4029('0x14')]);}logger[_0x4029('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0xfa5194,_0x47d173[_0x4029('0x13')][_0x4029('0x14')]);return _0x264186(_0x47d173['error']['message']);}else{logger[_0x4029('0x15')](_0x4029('0xe'),_0xfa5194,_0x4029('0xf'));_0x264186(_0x47d173[_0x4029('0x16')][_0x4029('0x14')]);}})[_0x4029('0x17')](function(_0x33c2dc){logger[_0x4029('0x13')](_0x4029('0xe'),_0xfa5194,_0x33c2dc);_0x3192a7(_0x33c2dc);});});} \ No newline at end of file +var _0x2ce4=['../../config/logger','../../config/environment','jayson/promise','http','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x740d5a,_0x4b6e17){var _0x24a14b=function(_0x1132c4){while(--_0x1132c4){_0x740d5a['push'](_0x740d5a['shift']());}};_0x24a14b(++_0x4b6e17);}(_0x2ce4,0x15e));var _0x42ce=function(_0x34411d,_0x32e357){_0x34411d=_0x34411d-0x0;var _0x3edfa9=_0x2ce4[_0x34411d];return _0x3edfa9;};'use strict';var _=require(_0x42ce('0x0'));var util=require(_0x42ce('0x1'));var moment=require('moment');var BPromise=require(_0x42ce('0x2'));var rs=require(_0x42ce('0x3'));var fs=require('fs');var Redis=require(_0x42ce('0x4'));var db=require(_0x42ce('0x5'))['db'];var utils=require(_0x42ce('0x6'));var logger=require(_0x42ce('0x7'))('rpc');var config=require(_0x42ce('0x8'));var jayson=require(_0x42ce('0x9'));var client=jayson['client'][_0x42ce('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x392bb7,_0x203020,_0x4653cf){return new BPromise(function(_0x29656b,_0x7eea2b){return client['request'](_0x392bb7,_0x4653cf)['then'](function(_0x25fac7){logger[_0x42ce('0xb')](_0x42ce('0xc'),_0x203020,_0x42ce('0xd'));logger[_0x42ce('0xe')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x203020,'request\x20sent',JSON[_0x42ce('0xf')](_0x25fac7));if(_0x25fac7[_0x42ce('0x10')]){if(_0x25fac7[_0x42ce('0x10')][_0x42ce('0x11')]===0x1f4){logger['error'](_0x42ce('0xc'),_0x203020,_0x25fac7[_0x42ce('0x10')][_0x42ce('0x12')]);return _0x7eea2b(_0x25fac7[_0x42ce('0x10')]['message']);}logger[_0x42ce('0x10')](_0x42ce('0xc'),_0x203020,_0x25fac7['error'][_0x42ce('0x12')]);return _0x29656b(_0x25fac7[_0x42ce('0x10')][_0x42ce('0x12')]);}else{logger[_0x42ce('0xb')](_0x42ce('0xc'),_0x203020,_0x42ce('0xd'));_0x29656b(_0x25fac7[_0x42ce('0x13')]['message']);}})[_0x42ce('0x14')](function(_0x20d3cf){logger[_0x42ce('0x10')](_0x42ce('0xc'),_0x203020,_0x20d3cf);_0x7eea2b(_0x20d3cf);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index c48f4cc..61daef7 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 _0x30e5=['post','create','/:id/sounds','addSound','update','delete','destroy','/:id/sounds/:id2','removeSound','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x1603cd,_0x18b34c){var _0x6fe421=function(_0x4d71d6){while(--_0x4d71d6){_0x1603cd['push'](_0x1603cd['shift']());}};_0x6fe421(++_0x18b34c);}(_0x30e5,0xdb));var _0x530e=function(_0x38c121,_0x29c927){_0x38c121=_0x38c121-0x0;var _0x21c1f5=_0x30e5[_0x38c121];return _0x21c1f5;};'use strict';var multer=require(_0x530e('0x0'));var util=require('util');var path=require(_0x530e('0x1'));var timeout=require(_0x530e('0x2'));var express=require(_0x530e('0x3'));var router=express['Router']();var fs_extra=require(_0x530e('0x4'));var auth=require(_0x530e('0x5'));var interaction=require(_0x530e('0x6'));var config=require(_0x530e('0x7'));var controller=require('./voiceMusicOnHold.controller');router[_0x530e('0x8')]('/',auth[_0x530e('0x9')](),controller[_0x530e('0xa')]);router['get'](_0x530e('0xb'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/sounds',auth[_0x530e('0x9')](),controller['getSounds']);router[_0x530e('0xc')]('/',auth[_0x530e('0x9')](),controller[_0x530e('0xd')]);router[_0x530e('0xc')](_0x530e('0xe'),auth[_0x530e('0x9')](),controller[_0x530e('0xf')]);router['put']('/:id',auth[_0x530e('0x9')](),controller[_0x530e('0x10')]);router[_0x530e('0x11')](_0x530e('0xb'),auth[_0x530e('0x9')](),controller[_0x530e('0x12')]);router[_0x530e('0x11')](_0x530e('0x13'),auth[_0x530e('0x9')](),controller[_0x530e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xd1e6=['show','/:id/sounds','getSounds','post','addSound','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id'];(function(_0x3ead9d,_0x356d7c){var _0x4f7023=function(_0xa69035){while(--_0xa69035){_0x3ead9d['push'](_0x3ead9d['shift']());}};_0x4f7023(++_0x356d7c);}(_0xd1e6,0x11c));var _0x6d1e=function(_0x9a359b,_0x1919b7){_0x9a359b=_0x9a359b-0x0;var _0x15bd2b=_0xd1e6[_0x9a359b];return _0x15bd2b;};'use strict';var multer=require('multer');var util=require(_0x6d1e('0x0'));var path=require('path');var timeout=require(_0x6d1e('0x1'));var express=require('express');var router=express[_0x6d1e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6d1e('0x3'));var interaction=require(_0x6d1e('0x4'));var config=require('../../config/environment');var controller=require(_0x6d1e('0x5'));router[_0x6d1e('0x6')]('/',auth[_0x6d1e('0x7')](),controller[_0x6d1e('0x8')]);router[_0x6d1e('0x6')](_0x6d1e('0x9'),auth[_0x6d1e('0x7')](),controller[_0x6d1e('0xa')]);router['get'](_0x6d1e('0xb'),auth[_0x6d1e('0x7')](),controller[_0x6d1e('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x6d1e('0xd')](_0x6d1e('0xb'),auth[_0x6d1e('0x7')](),controller[_0x6d1e('0xe')]);router['put'](_0x6d1e('0x9'),auth[_0x6d1e('0x7')](),controller[_0x6d1e('0xf')]);router[_0x6d1e('0x10')](_0x6d1e('0x9'),auth[_0x6d1e('0x7')](),controller[_0x6d1e('0x11')]);router['delete'](_0x6d1e('0x12'),auth[_0x6d1e('0x7')](),controller[_0x6d1e('0x13')]);module[_0x6d1e('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 8c0e181..93902a5 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 _0xf195=['STRING','ENUM','custom','files','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize'];(function(_0xba4b76,_0x12f86b){var _0x31f74a=function(_0x545e07){while(--_0x545e07){_0xba4b76['push'](_0xba4b76['shift']());}};_0x31f74a(++_0x12f86b);}(_0xf195,0x99));var _0x5f19=function(_0x31e5cb,_0x2f5adf){_0x31e5cb=_0x31e5cb-0x0;var _0x4170df=_0xf195[_0x31e5cb];return _0x4170df;};'use strict';var Sequelize=require(_0x5f19('0x0'));module['exports']={'name':{'type':Sequelize[_0x5f19('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x5f19('0x2')](_0x5f19('0x3'),_0x5f19('0x4'),'mp3nb',_0x5f19('0x5'),_0x5f19('0x6'),_0x5f19('0x7')),'allowNull':!![],'defaultValue':_0x5f19('0x4')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x5f19('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x5f19('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x5f19('0x1')],'allowNull':!![],'defaultValue':_0x5f19('0x8')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x5f19('0x9')},'defaultEntry':{'type':Sequelize[_0x5f19('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe3e2=['BOOLEAN','STRING','custom','files','mp3nb','quietmp3','alpha','TIMESTAMP'];(function(_0x5bccb5,_0x57bcc7){var _0x58c644=function(_0x12b28c){while(--_0x12b28c){_0x5bccb5['push'](_0x5bccb5['shift']());}};_0x58c644(++_0x57bcc7);}(_0xe3e2,0x191));var _0x2e3e=function(_0x796d7d,_0x17c422){_0x796d7d=_0x796d7d-0x0;var _0x2f156c=_0xe3e2[_0x796d7d];return _0x2f156c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2e3e('0x0')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize['ENUM'](_0x2e3e('0x1'),_0x2e3e('0x2'),_0x2e3e('0x3'),'quietmp3nb',_0x2e3e('0x4'),'mp3'),'allowNull':!![],'defaultValue':_0x2e3e('0x2')},'directory':{'type':Sequelize[_0x2e3e('0x0')],'allowNull':!![]},'application':{'type':Sequelize[_0x2e3e('0x0')],'allowNull':!![]},'digit':{'type':Sequelize[_0x2e3e('0x0')],'allowNull':!![]},'sort':{'type':Sequelize[_0x2e3e('0x0')],'allowNull':!![],'defaultValue':_0x2e3e('0x5')},'format':{'type':Sequelize[_0x2e3e('0x0')],'allowNull':!![]},'stamp':{'type':_0x2e3e('0x6')},'defaultEntry':{'type':Sequelize[_0x2e3e('0x7')],'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 7e705a3..7640d99 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 _0xc3b7=['include','find','body','create','sequelize','files','directory','join','root','server/files/moh','mode','mkdirSync','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','unlinkSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','format','%s.%s','basename','removeSound','getSounds','order','nolimit','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','undefined','count','offset','limit','json','apply','reject','save','update','destroy','then','MusicOnHolds','UserProfileResource','error','stack','name','send','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','params','length'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xc3b7,0xfd));var _0x7c3b=function(_0x2d1eef,_0x3763da){_0x2d1eef=_0x2d1eef-0x0;var _0x4e1e23=_0xc3b7[_0x2d1eef];return _0x4e1e23;};'use strict';var emlformat=require(_0x7c3b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7c3b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7c3b('0x2'));var moment=require(_0x7c3b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7c3b('0x4'));var util=require(_0x7c3b('0x5'));var path=require(_0x7c3b('0x6'));var sox=require(_0x7c3b('0x7'));var csv=require(_0x7c3b('0x8'));var ejs=require(_0x7c3b('0x9'));var fs=require('fs');var fs_extra=require(_0x7c3b('0xa'));var _=require(_0x7c3b('0xb'));var squel=require('squel');var crypto=require(_0x7c3b('0xc'));var jsforce=require(_0x7c3b('0xd'));var deskjs=require(_0x7c3b('0xe'));var toCsv=require(_0x7c3b('0x8'));var querystring=require(_0x7c3b('0xf'));var Papa=require('papaparse');var Redis=require(_0x7c3b('0x10'));var authService=require(_0x7c3b('0x11'));var qs=require(_0x7c3b('0x12'));var as=require(_0x7c3b('0x13'));var hardwareService=require(_0x7c3b('0x14'));var logger=require(_0x7c3b('0x15'))(_0x7c3b('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11272e,_0x1466c3){_0x1466c3=_0x1466c3||0xcc;return function(_0x3771fb){if(_0x3771fb){return _0x11272e[_0x7c3b('0x17')](_0x1466c3);}return _0x11272e[_0x7c3b('0x18')](_0x1466c3)[_0x7c3b('0x19')]();};}function respondWithResult(_0x19fb4d,_0x45e715){_0x45e715=_0x45e715||0xc8;return function(_0x1ef844){if(_0x1ef844){return _0x19fb4d[_0x7c3b('0x18')](_0x45e715)['json'](_0x1ef844);}};}function respondWithFilteredResult(_0x46b533,_0x554173){return function(_0x3bce8c){if(_0x3bce8c){var _0x2e1a8f=typeof _0x554173['offset']===_0x7c3b('0x1a')&&typeof _0x554173['limit']===_0x7c3b('0x1a');var _0x3d733a=_0x3bce8c[_0x7c3b('0x1b')];var _0xda65a=_0x2e1a8f?0x0:_0x554173[_0x7c3b('0x1c')];var _0x49e37c=_0x2e1a8f?_0x3bce8c['count']:_0x554173['offset']+_0x554173[_0x7c3b('0x1d')];var _0x3631df;if(_0x49e37c>=_0x3d733a){_0x49e37c=_0x3d733a;_0x3631df=0xc8;}else{_0x3631df=0xce;}_0x46b533['status'](_0x3631df);return _0x46b533['set']('Content-Range',_0xda65a+'-'+_0x49e37c+'/'+_0x3d733a)[_0x7c3b('0x1e')](_0x3bce8c);}return null;};}function patchUpdates(_0x3baf64){return function(_0x1c6fcf){try{jsonpatch[_0x7c3b('0x1f')](_0x1c6fcf,_0x3baf64,!![]);}catch(_0x5cd0c3){return BPromise[_0x7c3b('0x20')](_0x5cd0c3);}return _0x1c6fcf[_0x7c3b('0x21')]();};}function saveUpdates(_0x333a31,_0x1dd38b){return function(_0x4d01c2){if(_0x4d01c2){return _0x4d01c2[_0x7c3b('0x22')](_0x333a31)['then'](function(_0x4ce77c){return _0x4ce77c;});}return null;};}function removeEntity(_0x561825,_0x41c599){return function(_0x5a1294){if(_0x5a1294){return _0x5a1294[_0x7c3b('0x23')]()[_0x7c3b('0x24')](function(){var _0x3e26f2=_0x5a1294['get']({'plain':!![]});var _0x5e173f=_0x7c3b('0x25');return db[_0x7c3b('0x26')][_0x7c3b('0x23')]({'where':{'type':_0x5e173f,'resourceId':_0x3e26f2['id']}})[_0x7c3b('0x24')](function(){return _0x5a1294;});})[_0x7c3b('0x24')](function(){_0x561825[_0x7c3b('0x18')](0xcc)[_0x7c3b('0x19')]();});}};}function handleEntityNotFound(_0x2e8020,_0x419546){return function(_0x2e3dd9){if(!_0x2e3dd9){_0x2e8020[_0x7c3b('0x17')](0x194);}return _0x2e3dd9;};}function handleError(_0x825f73,_0x2400b9){_0x2400b9=_0x2400b9||0x1f4;return function(_0x4fd963){logger[_0x7c3b('0x27')](_0x4fd963[_0x7c3b('0x28')]);if(_0x4fd963[_0x7c3b('0x29')]){delete _0x4fd963[_0x7c3b('0x29')];}_0x825f73['status'](_0x2400b9)[_0x7c3b('0x2a')](_0x4fd963);};}exports['index']=function(_0x488e98,_0x52df4b){var _0x54103f={},_0x255f43={},_0x2bb6ab={'count':0x0,'rows':[]};var _0xcd4427=_['map'](db[_0x7c3b('0x2b')][_0x7c3b('0x2c')],function(_0xd6c6ea){return{'name':_0xd6c6ea[_0x7c3b('0x2d')],'type':_0xd6c6ea[_0x7c3b('0x2e')][_0x7c3b('0x2f')]};});_0x255f43[_0x7c3b('0x30')]=_[_0x7c3b('0x31')](_0xcd4427,_0x7c3b('0x29'));_0x255f43['query']=_[_0x7c3b('0x32')](_0x488e98[_0x7c3b('0x33')]);_0x255f43[_0x7c3b('0x34')]=_[_0x7c3b('0x35')](_0x255f43[_0x7c3b('0x30')],_0x255f43[_0x7c3b('0x33')]);_0x54103f[_0x7c3b('0x36')]=_[_0x7c3b('0x35')](_0x255f43[_0x7c3b('0x30')],qs[_0x7c3b('0x37')](_0x488e98[_0x7c3b('0x33')]['fields']));_0x54103f[_0x7c3b('0x36')]=_0x54103f[_0x7c3b('0x36')]['length']?_0x54103f[_0x7c3b('0x36')]:_0x255f43['model'];if(!_0x488e98[_0x7c3b('0x33')][_0x7c3b('0x38')]('nolimit')){_0x54103f[_0x7c3b('0x1d')]=qs[_0x7c3b('0x1d')](_0x488e98['query'][_0x7c3b('0x1d')]);_0x54103f['offset']=qs[_0x7c3b('0x1c')](_0x488e98[_0x7c3b('0x33')][_0x7c3b('0x1c')]);}_0x54103f['order']=qs['sort'](_0x488e98['query'][_0x7c3b('0x39')]);delete _0x488e98[_0x7c3b('0x33')][_0x7c3b('0x39')];_0x54103f[_0x7c3b('0x3a')]=qs[_0x7c3b('0x34')](_[_0x7c3b('0x3b')](_0x488e98['query'],_0x255f43['filters']),_0xcd4427);if(_0x488e98[_0x7c3b('0x33')]['filter']){_0x54103f[_0x7c3b('0x3a')]=_['merge'](_0x54103f[_0x7c3b('0x3a')],{'$or':_['map'](_0xcd4427,function(_0x3d5feb){if(_0x3d5feb[_0x7c3b('0x2e')]!==_0x7c3b('0x3c')){var _0x65d262={};_0x65d262[_0x3d5feb[_0x7c3b('0x29')]]={'$like':'%'+_0x488e98[_0x7c3b('0x33')][_0x7c3b('0x3d')]+'%'};return _0x65d262;}})});}_0x54103f=_[_0x7c3b('0x3e')]({},_0x54103f,_0x488e98[_0x7c3b('0x3f')]);var _0x2bd50f={'where':_0x54103f[_0x7c3b('0x3a')]};return db[_0x7c3b('0x2b')][_0x7c3b('0x1b')](_0x2bd50f)[_0x7c3b('0x24')](function(_0x3596d9){_0x2bb6ab[_0x7c3b('0x1b')]=_0x3596d9;if(_0x488e98['query'][_0x7c3b('0x40')]){_0x54103f['include']=[{'all':!![]}];}return db[_0x7c3b('0x2b')][_0x7c3b('0x41')](_0x54103f);})[_0x7c3b('0x24')](function(_0x38fe80){_0x2bb6ab[_0x7c3b('0x42')]=_0x38fe80;return _0x2bb6ab;})[_0x7c3b('0x24')](respondWithFilteredResult(_0x52df4b,_0x54103f))[_0x7c3b('0x43')](handleError(_0x52df4b,null));};exports[_0x7c3b('0x44')]=function(_0x1f4048,_0x40951d){var _0x588eab={'raw':![],'where':{'id':_0x1f4048[_0x7c3b('0x45')]['id']}},_0x43eee1={};_0x43eee1['model']=_[_0x7c3b('0x32')](db[_0x7c3b('0x2b')]['rawAttributes']);_0x43eee1['query']=_[_0x7c3b('0x32')](_0x1f4048[_0x7c3b('0x33')]);_0x43eee1[_0x7c3b('0x34')]=_['intersection'](_0x43eee1['model'],_0x43eee1[_0x7c3b('0x33')]);_0x588eab[_0x7c3b('0x36')]=_[_0x7c3b('0x35')](_0x43eee1['model'],qs[_0x7c3b('0x37')](_0x1f4048['query']['fields']));_0x588eab[_0x7c3b('0x36')]=_0x588eab['attributes'][_0x7c3b('0x46')]?_0x588eab['attributes']:_0x43eee1[_0x7c3b('0x30')];if(_0x1f4048['query'][_0x7c3b('0x40')]){_0x588eab[_0x7c3b('0x47')]=[{'all':!![]}];}_0x588eab=_[_0x7c3b('0x3e')]({},_0x588eab,_0x1f4048[_0x7c3b('0x3f')]);return db[_0x7c3b('0x2b')][_0x7c3b('0x48')](_0x588eab)[_0x7c3b('0x24')](handleEntityNotFound(_0x40951d,null))[_0x7c3b('0x24')](respondWithResult(_0x40951d,null))['catch'](handleError(_0x40951d,null));};exports['update']=function(_0xb404a2,_0x588764){if(_0xb404a2[_0x7c3b('0x49')]['id']){delete _0xb404a2['body']['id'];}return db[_0x7c3b('0x2b')][_0x7c3b('0x48')]({'where':{'id':_0xb404a2[_0x7c3b('0x45')]['id']}})[_0x7c3b('0x24')](handleEntityNotFound(_0x588764,null))[_0x7c3b('0x24')](saveUpdates(_0xb404a2['body'],null))['then'](respondWithResult(_0x588764,null))[_0x7c3b('0x43')](handleError(_0x588764,null));};exports[_0x7c3b('0x4a')]=function(_0x4d25f6,_0x344971,_0x54f194){return db[_0x7c3b('0x4b')]['transaction'](function(_0x8f5b93){if(_0x4d25f6[_0x7c3b('0x49')]['mode']===_0x7c3b('0x4c')){_0x4d25f6['body'][_0x7c3b('0x4d')]=path[_0x7c3b('0x4e')](config[_0x7c3b('0x4f')],_0x7c3b('0x50'),_0x4d25f6[_0x7c3b('0x49')][_0x7c3b('0x29')]);}return db[_0x7c3b('0x2b')][_0x7c3b('0x4a')](_0x4d25f6[_0x7c3b('0x49')],{'transaction':_0x8f5b93})[_0x7c3b('0x24')](function(_0x1546ab){if(_0x4d25f6[_0x7c3b('0x49')][_0x7c3b('0x51')]===_0x7c3b('0x4c')){fs[_0x7c3b('0x52')](_0x1546ab[_0x7c3b('0x4d')],parseInt('0777',0x8));}var _0x818869=_0x4d25f6['user'][_0x7c3b('0x53')]({'plain':!![]});if(!_0x818869)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x818869[_0x7c3b('0x54')]==='user'){var _0x3626b1=_0x1546ab[_0x7c3b('0x53')]({'plain':!![]});return db[_0x7c3b('0x55')]['find']({'where':{'name':_0x7c3b('0x25'),'userProfileId':_0x818869[_0x7c3b('0x56')]},'raw':!![]})[_0x7c3b('0x24')](function(_0x508dad){if(_0x508dad&&_0x508dad[_0x7c3b('0x57')]===0x0){return db['UserProfileResource'][_0x7c3b('0x4a')]({'name':_0x3626b1[_0x7c3b('0x29')],'resourceId':_0x3626b1['id'],'type':_0x508dad[_0x7c3b('0x29')],'sectionId':_0x508dad['id']},{})[_0x7c3b('0x24')](function(){return _0x1546ab;});}else{return _0x1546ab;}})[_0x7c3b('0x43')](function(_0x24f6fd){logger[_0x7c3b('0x27')](_0x7c3b('0x58'),_0x24f6fd);});}return _0x1546ab;});})[_0x7c3b('0x24')](respondWithResult(_0x344971,0xc9))['catch'](handleError(_0x344971,null));};exports[_0x7c3b('0x23')]=function(_0x369806,_0x5ac38c,_0x535b86){var _0x3fd227;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x369806[_0x7c3b('0x45')]['id']}})[_0x7c3b('0x24')](function(_0x597180){if(_0x597180){return db[_0x7c3b('0x4b')][_0x7c3b('0x59')](function(_0x408692){return _0x597180[_0x7c3b('0x23')]({'transaction':_0x408692,'raw':!![]})[_0x7c3b('0x24')](function(_0x293159){if(_0x293159[_0x7c3b('0x4d')]){fs[_0x7c3b('0x5a')](_0x293159[_0x7c3b('0x4d')])['forEach'](function(_0x409f88){fs[_0x7c3b('0x5b')](path['join'](_0x293159[_0x7c3b('0x4d')],_0x409f88));});fs['rmdirSync'](_0x293159[_0x7c3b('0x4d')]);}return _0x293159;});})[_0x7c3b('0x43')](function(_0x32bcec){throw new db[(_0x7c3b('0x5c'))][(_0x7c3b('0x5d'))](_0x32bcec[_0x7c3b('0x5e')]);});}})['then'](handleEntityNotFound(_0x5ac38c,null))[_0x7c3b('0x24')](removeEntity(_0x5ac38c,null))['catch'](handleError(_0x5ac38c,null));};exports[_0x7c3b('0x5f')]=function(_0x369969,_0x279370,_0x110805){return db[_0x7c3b('0x4b')][_0x7c3b('0x59')](function(_0x4bf890){var _0x191071;return db[_0x7c3b('0x2b')][_0x7c3b('0x48')]({'where':{'id':_0x369969[_0x7c3b('0x45')]['id']}})[_0x7c3b('0x24')](function(_0x5e695b){if(_0x5e695b){_0x191071=_0x5e695b;return _0x5e695b['addSound'](_0x369969[_0x7c3b('0x49')]['id'],{'transaction':_0x4bf890});}})[_0x7c3b('0x24')](function(_0x40c9b0){if(_0x40c9b0){return db[_0x7c3b('0x60')][_0x7c3b('0x61')]({'where':{'id':_0x369969['body']['id']},'attributes':['id',_0x7c3b('0x29'),_0x7c3b('0x62'),_0x7c3b('0x63'),_0x7c3b('0x64')],'raw':!![]});}})[_0x7c3b('0x24')](function(_0x37d342){if(_0x37d342){var _0x33c54a=path[_0x7c3b('0x4e')](config[_0x7c3b('0x4f')],'server/files/sounds/converted',util[_0x7c3b('0x65')](_0x7c3b('0x66'),path[_0x7c3b('0x67')](_0x37d342['save_name'],path['extname'](_0x37d342[_0x7c3b('0x62')])),_0x37d342[_0x7c3b('0x63')]));var _0x2568e7=path[_0x7c3b('0x4e')](config[_0x7c3b('0x4f')],_0x7c3b('0x50'),_0x191071[_0x7c3b('0x29')],util[_0x7c3b('0x65')](_0x7c3b('0x66'),_0x37d342['name'],_0x37d342[_0x7c3b('0x63')]));fs['symlinkSync'](_0x33c54a,_0x2568e7);return _0x37d342;}})[_0x7c3b('0x43')](function(_0x54a660){throw new db['Sequelize'][(_0x7c3b('0x5d'))](_0x54a660[_0x7c3b('0x5e')]);});})['then'](handleEntityNotFound(_0x279370,null))[_0x7c3b('0x24')](respondWithResult(_0x279370,0xc9))[_0x7c3b('0x43')](handleError(_0x279370,null));};exports[_0x7c3b('0x68')]=function(_0x422ec5,_0x4a508b,_0x5cfcc1){return db['sequelize'][_0x7c3b('0x59')](function(_0x13ce1b){var _0x55ee02;return db['VoiceMusicOnHold'][_0x7c3b('0x61')]({'where':{'id':_0x422ec5[_0x7c3b('0x45')]['id']}})[_0x7c3b('0x24')](handleEntityNotFound(_0x4a508b,null))['then'](function(_0x1ecd82){if(_0x1ecd82){_0x55ee02=_0x1ecd82;return _0x1ecd82[_0x7c3b('0x68')](_0x422ec5[_0x7c3b('0x45')]['id2']);}})[_0x7c3b('0x24')](function(_0x5c6930){if(_0x5c6930){return db[_0x7c3b('0x60')][_0x7c3b('0x61')]({'where':{'id':_0x422ec5[_0x7c3b('0x45')]['id2']},'attributes':['id',_0x7c3b('0x29'),_0x7c3b('0x62'),_0x7c3b('0x63'),_0x7c3b('0x64')],'raw':!![]});}})['then'](function(_0x5993b3){if(_0x5993b3){fs[_0x7c3b('0x5b')](path[_0x7c3b('0x4e')](_0x55ee02[_0x7c3b('0x4d')],util[_0x7c3b('0x65')](_0x7c3b('0x66'),_0x5993b3['name'],_0x5993b3[_0x7c3b('0x63')])));return _0x5993b3;}})[_0x7c3b('0x43')](function(_0x13fcbf){throw new db[(_0x7c3b('0x5c'))]['ValidationError'](_0x13fcbf[_0x7c3b('0x5e')]);});})[_0x7c3b('0x24')](handleEntityNotFound(_0x4a508b,null))['then'](respondWithStatusCode(_0x4a508b,0xcc))[_0x7c3b('0x43')](handleError(_0x4a508b,null));};exports[_0x7c3b('0x69')]=function(_0x487e1e,_0x47cd74,_0x302fea){var _0x591a1b={};var _0xc61e38={};var _0x29b2b8;var _0x2d6779;return db[_0x7c3b('0x2b')][_0x7c3b('0x61')]({'where':{'id':_0x487e1e[_0x7c3b('0x45')]['id']}})[_0x7c3b('0x24')](handleEntityNotFound(_0x47cd74,null))[_0x7c3b('0x24')](function(_0x5e0988){if(_0x5e0988){_0x29b2b8=_0x5e0988;_0xc61e38['model']=_[_0x7c3b('0x32')](db['Sound'][_0x7c3b('0x2c')]);_0xc61e38['query']=_['keys'](_0x487e1e[_0x7c3b('0x33')]);_0xc61e38[_0x7c3b('0x34')]=_[_0x7c3b('0x35')](_0xc61e38[_0x7c3b('0x30')],_0xc61e38['query']);_0x591a1b[_0x7c3b('0x36')]=_[_0x7c3b('0x35')](_0xc61e38[_0x7c3b('0x30')],qs[_0x7c3b('0x37')](_0x487e1e[_0x7c3b('0x33')][_0x7c3b('0x37')]));_0x591a1b['attributes']=_0x591a1b[_0x7c3b('0x36')]['length']?_0x591a1b[_0x7c3b('0x36')]:_0xc61e38[_0x7c3b('0x30')];_0x591a1b[_0x7c3b('0x6a')]=qs[_0x7c3b('0x39')](_0x487e1e[_0x7c3b('0x33')]['sort']);_0x591a1b[_0x7c3b('0x3a')]=qs[_0x7c3b('0x34')](_[_0x7c3b('0x3b')](_0x487e1e['query'],_0xc61e38['filters']));if(_0x487e1e[_0x7c3b('0x33')][_0x7c3b('0x3d')]){_0x591a1b[_0x7c3b('0x3a')]=_['merge'](_0x591a1b[_0x7c3b('0x3a')],{'$or':_[_0x7c3b('0x31')](_0x591a1b[_0x7c3b('0x36')],function(_0x5fec93){var _0x164017={};_0x164017[_0x5fec93]={'$like':'%'+_0x487e1e[_0x7c3b('0x33')][_0x7c3b('0x3d')]+'%'};return _0x164017;})});}_0x591a1b=_['merge']({},_0x591a1b,_0x487e1e[_0x7c3b('0x3f')]);return _0x29b2b8[_0x7c3b('0x69')](_0x591a1b);}})[_0x7c3b('0x24')](function(_0x5f05f3){if(_0x5f05f3){_0x2d6779=_0x5f05f3[_0x7c3b('0x46')];if(!_0x487e1e[_0x7c3b('0x33')][_0x7c3b('0x38')](_0x7c3b('0x6b'))){_0x591a1b[_0x7c3b('0x1d')]=qs[_0x7c3b('0x1d')](_0x487e1e[_0x7c3b('0x33')][_0x7c3b('0x1d')]);_0x591a1b[_0x7c3b('0x1c')]=qs[_0x7c3b('0x1c')](_0x487e1e[_0x7c3b('0x33')][_0x7c3b('0x1c')]);}return _0x29b2b8[_0x7c3b('0x69')](_0x591a1b);}})[_0x7c3b('0x24')](function(_0x47ca59){if(_0x47ca59){return _0x47ca59?{'count':_0x2d6779,'rows':_0x47ca59}:null;}})[_0x7c3b('0x24')](respondWithResult(_0x47cd74,null))[_0x7c3b('0x43')](handleError(_0x47cd74,null));}; \ No newline at end of file +var _0xa62b=['files','directory','join','root','server/files/moh','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','save_name','extname','symlinkSync','removeSound','findOne','id2','getSounds','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','MusicOnHolds','UserProfileResource','error','stack','name','send','map','VoiceMusicOnHold','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','show','params','length','include','find','catch','body','create','sequelize','mode'];(function(_0x3d2916,_0x267432){var _0x37c9bd=function(_0x4af973){while(--_0x4af973){_0x3d2916['push'](_0x3d2916['shift']());}};_0x37c9bd(++_0x267432);}(_0xa62b,0x1e8));var _0xba62=function(_0x5cb556,_0x426ea3){_0x5cb556=_0x5cb556-0x0;var _0x49a6f4=_0xa62b[_0x5cb556];return _0x49a6f4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xba62('0x0'));var zipdir=require(_0xba62('0x1'));var jsonpatch=require(_0xba62('0x2'));var rp=require(_0xba62('0x3'));var moment=require(_0xba62('0x4'));var BPromise=require(_0xba62('0x5'));var Mustache=require(_0xba62('0x6'));var util=require(_0xba62('0x7'));var path=require(_0xba62('0x8'));var sox=require(_0xba62('0x9'));var csv=require('to-csv');var ejs=require(_0xba62('0xa'));var fs=require('fs');var fs_extra=require(_0xba62('0xb'));var _=require('lodash');var squel=require(_0xba62('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xba62('0xd'));var querystring=require(_0xba62('0xe'));var Papa=require(_0xba62('0xf'));var Redis=require(_0xba62('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xba62('0x11'));var hardwareService=require(_0xba62('0x12'));var logger=require(_0xba62('0x13'))(_0xba62('0x14'));var utils=require(_0xba62('0x15'));var config=require(_0xba62('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c3d00,_0x5129e6){_0x5129e6=_0x5129e6||0xcc;return function(_0x39a5e5){if(_0x39a5e5){return _0x1c3d00[_0xba62('0x17')](_0x5129e6);}return _0x1c3d00[_0xba62('0x18')](_0x5129e6)[_0xba62('0x19')]();};}function respondWithResult(_0x328e09,_0x4eef92){_0x4eef92=_0x4eef92||0xc8;return function(_0xbf14){if(_0xbf14){return _0x328e09['status'](_0x4eef92)[_0xba62('0x1a')](_0xbf14);}};}function respondWithFilteredResult(_0x13edca,_0x594de1){return function(_0x15490f){if(_0x15490f){var _0x293a60=typeof _0x594de1[_0xba62('0x1b')]===_0xba62('0x1c')&&typeof _0x594de1[_0xba62('0x1d')]===_0xba62('0x1c');var _0x38b025=_0x15490f[_0xba62('0x1e')];var _0x56aad4=_0x293a60?0x0:_0x594de1[_0xba62('0x1b')];var _0x6b95a7=_0x293a60?_0x15490f['count']:_0x594de1[_0xba62('0x1b')]+_0x594de1[_0xba62('0x1d')];var _0x269b52;if(_0x6b95a7>=_0x38b025){_0x6b95a7=_0x38b025;_0x269b52=0xc8;}else{_0x269b52=0xce;}_0x13edca['status'](_0x269b52);return _0x13edca['set'](_0xba62('0x1f'),_0x56aad4+'-'+_0x6b95a7+'/'+_0x38b025)['json'](_0x15490f);}return null;};}function patchUpdates(_0x5b2d0c){return function(_0x1b5cf0){try{jsonpatch[_0xba62('0x20')](_0x1b5cf0,_0x5b2d0c,!![]);}catch(_0x3e9a17){return BPromise[_0xba62('0x21')](_0x3e9a17);}return _0x1b5cf0[_0xba62('0x22')]();};}function saveUpdates(_0x4e3d4b,_0x2cefdf){return function(_0x3b8650){if(_0x3b8650){return _0x3b8650[_0xba62('0x23')](_0x4e3d4b)[_0xba62('0x24')](function(_0x2a718c){return _0x2a718c;});}return null;};}function removeEntity(_0x261c29,_0x2dbbd9){return function(_0x506edf){if(_0x506edf){return _0x506edf[_0xba62('0x25')]()[_0xba62('0x24')](function(){var _0x444aad=_0x506edf['get']({'plain':!![]});var _0x282ec8=_0xba62('0x26');return db[_0xba62('0x27')][_0xba62('0x25')]({'where':{'type':_0x282ec8,'resourceId':_0x444aad['id']}})[_0xba62('0x24')](function(){return _0x506edf;});})[_0xba62('0x24')](function(){_0x261c29[_0xba62('0x18')](0xcc)[_0xba62('0x19')]();});}};}function handleEntityNotFound(_0x53bfc5,_0x2d1fbf){return function(_0x2f73e2){if(!_0x2f73e2){_0x53bfc5[_0xba62('0x17')](0x194);}return _0x2f73e2;};}function handleError(_0x4bbf96,_0x5939e9){_0x5939e9=_0x5939e9||0x1f4;return function(_0x1e4847){logger[_0xba62('0x28')](_0x1e4847[_0xba62('0x29')]);if(_0x1e4847[_0xba62('0x2a')]){delete _0x1e4847[_0xba62('0x2a')];}_0x4bbf96[_0xba62('0x18')](_0x5939e9)[_0xba62('0x2b')](_0x1e4847);};}exports['index']=function(_0xb26fea,_0x682967){var _0x4a0fe2={},_0xe128b0={},_0x1a136c={'count':0x0,'rows':[]};var _0x4d30c4=_[_0xba62('0x2c')](db[_0xba62('0x2d')][_0xba62('0x2e')],function(_0x39cb23){return{'name':_0x39cb23['fieldName'],'type':_0x39cb23[_0xba62('0x2f')][_0xba62('0x30')]};});_0xe128b0[_0xba62('0x31')]=_['map'](_0x4d30c4,_0xba62('0x2a'));_0xe128b0[_0xba62('0x32')]=_[_0xba62('0x33')](_0xb26fea[_0xba62('0x32')]);_0xe128b0[_0xba62('0x34')]=_['intersection'](_0xe128b0['model'],_0xe128b0[_0xba62('0x32')]);_0x4a0fe2[_0xba62('0x35')]=_[_0xba62('0x36')](_0xe128b0[_0xba62('0x31')],qs['fields'](_0xb26fea[_0xba62('0x32')][_0xba62('0x37')]));_0x4a0fe2[_0xba62('0x35')]=_0x4a0fe2[_0xba62('0x35')]['length']?_0x4a0fe2[_0xba62('0x35')]:_0xe128b0[_0xba62('0x31')];if(!_0xb26fea['query']['hasOwnProperty'](_0xba62('0x38'))){_0x4a0fe2[_0xba62('0x1d')]=qs['limit'](_0xb26fea[_0xba62('0x32')][_0xba62('0x1d')]);_0x4a0fe2['offset']=qs['offset'](_0xb26fea[_0xba62('0x32')][_0xba62('0x1b')]);}_0x4a0fe2[_0xba62('0x39')]=qs[_0xba62('0x3a')](_0xb26fea['query'][_0xba62('0x3a')]);delete _0xb26fea[_0xba62('0x32')][_0xba62('0x3a')];_0x4a0fe2[_0xba62('0x3b')]=qs[_0xba62('0x34')](_[_0xba62('0x3c')](_0xb26fea[_0xba62('0x32')],_0xe128b0[_0xba62('0x34')]),_0x4d30c4);if(_0xb26fea[_0xba62('0x32')][_0xba62('0x3d')]){_0x4a0fe2['where']=_['merge'](_0x4a0fe2[_0xba62('0x3b')],{'$or':_[_0xba62('0x2c')](_0x4d30c4,function(_0x30acf3){if(_0x30acf3['type']!==_0xba62('0x3e')){var _0x59aa8={};_0x59aa8[_0x30acf3['name']]={'$like':'%'+_0xb26fea[_0xba62('0x32')][_0xba62('0x3d')]+'%'};return _0x59aa8;}})});}_0x4a0fe2=_[_0xba62('0x3f')]({},_0x4a0fe2,_0xb26fea[_0xba62('0x40')]);var _0x1116d4={'where':_0x4a0fe2[_0xba62('0x3b')]};return db[_0xba62('0x2d')][_0xba62('0x1e')](_0x1116d4)['then'](function(_0x346098){_0x1a136c[_0xba62('0x1e')]=_0x346098;if(_0xb26fea[_0xba62('0x32')]['includeAll']){_0x4a0fe2['include']=[{'all':!![]}];}return db[_0xba62('0x2d')][_0xba62('0x41')](_0x4a0fe2);})[_0xba62('0x24')](function(_0x2098b0){_0x1a136c[_0xba62('0x42')]=_0x2098b0;return _0x1a136c;})[_0xba62('0x24')](respondWithFilteredResult(_0x682967,_0x4a0fe2))['catch'](handleError(_0x682967,null));};exports[_0xba62('0x43')]=function(_0xa615ae,_0x5f1534){var _0x5aeb31={'raw':![],'where':{'id':_0xa615ae[_0xba62('0x44')]['id']}},_0x224f70={};_0x224f70[_0xba62('0x31')]=_[_0xba62('0x33')](db[_0xba62('0x2d')]['rawAttributes']);_0x224f70[_0xba62('0x32')]=_[_0xba62('0x33')](_0xa615ae[_0xba62('0x32')]);_0x224f70['filters']=_[_0xba62('0x36')](_0x224f70[_0xba62('0x31')],_0x224f70[_0xba62('0x32')]);_0x5aeb31['attributes']=_[_0xba62('0x36')](_0x224f70['model'],qs[_0xba62('0x37')](_0xa615ae['query'][_0xba62('0x37')]));_0x5aeb31['attributes']=_0x5aeb31[_0xba62('0x35')][_0xba62('0x45')]?_0x5aeb31[_0xba62('0x35')]:_0x224f70[_0xba62('0x31')];if(_0xa615ae['query']['includeAll']){_0x5aeb31[_0xba62('0x46')]=[{'all':!![]}];}_0x5aeb31=_[_0xba62('0x3f')]({},_0x5aeb31,_0xa615ae['options']);return db['VoiceMusicOnHold'][_0xba62('0x47')](_0x5aeb31)[_0xba62('0x24')](handleEntityNotFound(_0x5f1534,null))['then'](respondWithResult(_0x5f1534,null))[_0xba62('0x48')](handleError(_0x5f1534,null));};exports[_0xba62('0x23')]=function(_0x37e361,_0x2b6cb0){if(_0x37e361['body']['id']){delete _0x37e361[_0xba62('0x49')]['id'];}return db[_0xba62('0x2d')]['find']({'where':{'id':_0x37e361['params']['id']}})[_0xba62('0x24')](handleEntityNotFound(_0x2b6cb0,null))[_0xba62('0x24')](saveUpdates(_0x37e361[_0xba62('0x49')],null))[_0xba62('0x24')](respondWithResult(_0x2b6cb0,null))['catch'](handleError(_0x2b6cb0,null));};exports[_0xba62('0x4a')]=function(_0x187f15,_0x111a69,_0x536aa3){return db[_0xba62('0x4b')]['transaction'](function(_0x16ac67){if(_0x187f15[_0xba62('0x49')][_0xba62('0x4c')]===_0xba62('0x4d')){_0x187f15['body'][_0xba62('0x4e')]=path[_0xba62('0x4f')](config[_0xba62('0x50')],_0xba62('0x51'),_0x187f15['body'][_0xba62('0x2a')]);}return db[_0xba62('0x2d')]['create'](_0x187f15[_0xba62('0x49')],{'transaction':_0x16ac67})[_0xba62('0x24')](function(_0x44a713){if(_0x187f15['body'][_0xba62('0x4c')]===_0xba62('0x4d')){fs['mkdirSync'](_0x44a713[_0xba62('0x4e')],parseInt('0777',0x8));}var _0xdcbb16=_0x187f15[_0xba62('0x52')]['get']({'plain':!![]});if(!_0xdcbb16)throw new Error(_0xba62('0x53'));if(_0xdcbb16[_0xba62('0x54')]===_0xba62('0x52')){var _0x3c6dbe=_0x44a713[_0xba62('0x55')]({'plain':!![]});return db[_0xba62('0x56')][_0xba62('0x47')]({'where':{'name':_0xba62('0x26'),'userProfileId':_0xdcbb16[_0xba62('0x57')]},'raw':!![]})['then'](function(_0x7fe4f1){if(_0x7fe4f1&&_0x7fe4f1['autoAssociation']===0x0){return db[_0xba62('0x27')][_0xba62('0x4a')]({'name':_0x3c6dbe[_0xba62('0x2a')],'resourceId':_0x3c6dbe['id'],'type':_0x7fe4f1[_0xba62('0x2a')],'sectionId':_0x7fe4f1['id']},{})[_0xba62('0x24')](function(){return _0x44a713;});}else{return _0x44a713;}})[_0xba62('0x48')](function(_0x5adfb0){logger[_0xba62('0x28')](_0xba62('0x58'),_0x5adfb0);});}return _0x44a713;});})[_0xba62('0x24')](respondWithResult(_0x111a69,0xc9))['catch'](handleError(_0x111a69,null));};exports[_0xba62('0x25')]=function(_0x2fca64,_0x37979e,_0x290f0b){var _0x1808df;return db[_0xba62('0x2d')]['find']({'where':{'id':_0x2fca64[_0xba62('0x44')]['id']}})[_0xba62('0x24')](function(_0x442b0c){if(_0x442b0c){return db[_0xba62('0x4b')][_0xba62('0x59')](function(_0x3b97c6){return _0x442b0c['destroy']({'transaction':_0x3b97c6,'raw':!![]})[_0xba62('0x24')](function(_0x466a8f){if(_0x466a8f[_0xba62('0x4e')]){fs[_0xba62('0x5a')](_0x466a8f[_0xba62('0x4e')])[_0xba62('0x5b')](function(_0x4935a5){fs[_0xba62('0x5c')](path[_0xba62('0x4f')](_0x466a8f[_0xba62('0x4e')],_0x4935a5));});fs[_0xba62('0x5d')](_0x466a8f[_0xba62('0x4e')]);}return _0x466a8f;});})[_0xba62('0x48')](function(_0x185746){throw new db[(_0xba62('0x5e'))][(_0xba62('0x5f'))](_0x185746[_0xba62('0x60')]);});}})[_0xba62('0x24')](handleEntityNotFound(_0x37979e,null))['then'](removeEntity(_0x37979e,null))['catch'](handleError(_0x37979e,null));};exports[_0xba62('0x61')]=function(_0x282f6f,_0x81b2ec,_0x292898){return db[_0xba62('0x4b')]['transaction'](function(_0x3ee232){var _0x3f32ee;return db[_0xba62('0x2d')]['find']({'where':{'id':_0x282f6f[_0xba62('0x44')]['id']}})[_0xba62('0x24')](function(_0x16b3ce){if(_0x16b3ce){_0x3f32ee=_0x16b3ce;return _0x16b3ce['addSound'](_0x282f6f['body']['id'],{'transaction':_0x3ee232});}})[_0xba62('0x24')](function(_0x433550){if(_0x433550){return db[_0xba62('0x62')]['findOne']({'where':{'id':_0x282f6f[_0xba62('0x49')]['id']},'attributes':['id','name','save_name',_0xba62('0x63'),_0xba62('0x64')],'raw':!![]});}})['then'](function(_0x2ce490){if(_0x2ce490){var _0x33d808=path['join'](config[_0xba62('0x50')],_0xba62('0x65'),util[_0xba62('0x66')](_0xba62('0x67'),path[_0xba62('0x68')](_0x2ce490[_0xba62('0x69')],path[_0xba62('0x6a')](_0x2ce490[_0xba62('0x69')])),_0x2ce490[_0xba62('0x63')]));var _0x5d1bb5=path[_0xba62('0x4f')](config['root'],_0xba62('0x51'),_0x3f32ee[_0xba62('0x2a')],util[_0xba62('0x66')](_0xba62('0x67'),_0x2ce490['name'],_0x2ce490[_0xba62('0x63')]));fs[_0xba62('0x6b')](_0x33d808,_0x5d1bb5);return _0x2ce490;}})[_0xba62('0x48')](function(_0x5383ee){throw new db[(_0xba62('0x5e'))][(_0xba62('0x5f'))](_0x5383ee[_0xba62('0x60')]);});})[_0xba62('0x24')](handleEntityNotFound(_0x81b2ec,null))[_0xba62('0x24')](respondWithResult(_0x81b2ec,0xc9))[_0xba62('0x48')](handleError(_0x81b2ec,null));};exports[_0xba62('0x6c')]=function(_0x39cf8a,_0x517ed2,_0x5d391c){return db[_0xba62('0x4b')][_0xba62('0x59')](function(_0x9e7660){var _0x3c988a;return db['VoiceMusicOnHold'][_0xba62('0x6d')]({'where':{'id':_0x39cf8a[_0xba62('0x44')]['id']}})[_0xba62('0x24')](handleEntityNotFound(_0x517ed2,null))[_0xba62('0x24')](function(_0x623bba){if(_0x623bba){_0x3c988a=_0x623bba;return _0x623bba[_0xba62('0x6c')](_0x39cf8a[_0xba62('0x44')][_0xba62('0x6e')]);}})[_0xba62('0x24')](function(_0xe2bd87){if(_0xe2bd87){return db['Sound'][_0xba62('0x6d')]({'where':{'id':_0x39cf8a[_0xba62('0x44')]['id2']},'attributes':['id',_0xba62('0x2a'),_0xba62('0x69'),'converted_format',_0xba62('0x64')],'raw':!![]});}})[_0xba62('0x24')](function(_0x31b297){if(_0x31b297){fs['unlinkSync'](path[_0xba62('0x4f')](_0x3c988a[_0xba62('0x4e')],util[_0xba62('0x66')](_0xba62('0x67'),_0x31b297[_0xba62('0x2a')],_0x31b297[_0xba62('0x63')])));return _0x31b297;}})[_0xba62('0x48')](function(_0x59baf7){throw new db[(_0xba62('0x5e'))]['ValidationError'](_0x59baf7[_0xba62('0x60')]);});})['then'](handleEntityNotFound(_0x517ed2,null))['then'](respondWithStatusCode(_0x517ed2,0xcc))[_0xba62('0x48')](handleError(_0x517ed2,null));};exports[_0xba62('0x6f')]=function(_0x252081,_0x1fb80d,_0x14f289){var _0x53774b={};var _0x325b69={};var _0xac42fe;var _0x8618dd;return db[_0xba62('0x2d')][_0xba62('0x6d')]({'where':{'id':_0x252081['params']['id']}})['then'](handleEntityNotFound(_0x1fb80d,null))['then'](function(_0x3f6618){if(_0x3f6618){_0xac42fe=_0x3f6618;_0x325b69['model']=_[_0xba62('0x33')](db[_0xba62('0x62')][_0xba62('0x2e')]);_0x325b69['query']=_['keys'](_0x252081['query']);_0x325b69[_0xba62('0x34')]=_[_0xba62('0x36')](_0x325b69[_0xba62('0x31')],_0x325b69['query']);_0x53774b[_0xba62('0x35')]=_['intersection'](_0x325b69[_0xba62('0x31')],qs[_0xba62('0x37')](_0x252081[_0xba62('0x32')]['fields']));_0x53774b[_0xba62('0x35')]=_0x53774b[_0xba62('0x35')][_0xba62('0x45')]?_0x53774b[_0xba62('0x35')]:_0x325b69[_0xba62('0x31')];_0x53774b[_0xba62('0x39')]=qs['sort'](_0x252081[_0xba62('0x32')][_0xba62('0x3a')]);_0x53774b[_0xba62('0x3b')]=qs[_0xba62('0x34')](_[_0xba62('0x3c')](_0x252081[_0xba62('0x32')],_0x325b69[_0xba62('0x34')]));if(_0x252081['query'][_0xba62('0x3d')]){_0x53774b['where']=_[_0xba62('0x3f')](_0x53774b[_0xba62('0x3b')],{'$or':_[_0xba62('0x2c')](_0x53774b[_0xba62('0x35')],function(_0x1c5e89){var _0x4a938b={};_0x4a938b[_0x1c5e89]={'$like':'%'+_0x252081[_0xba62('0x32')]['filter']+'%'};return _0x4a938b;})});}_0x53774b=_['merge']({},_0x53774b,_0x252081['options']);return _0xac42fe[_0xba62('0x6f')](_0x53774b);}})[_0xba62('0x24')](function(_0x2fcac8){if(_0x2fcac8){_0x8618dd=_0x2fcac8['length'];if(!_0x252081[_0xba62('0x32')][_0xba62('0x70')](_0xba62('0x38'))){_0x53774b['limit']=qs[_0xba62('0x1d')](_0x252081[_0xba62('0x32')][_0xba62('0x1d')]);_0x53774b['offset']=qs['offset'](_0x252081[_0xba62('0x32')][_0xba62('0x1b')]);}return _0xac42fe[_0xba62('0x6f')](_0x53774b);}})['then'](function(_0x1f95e1){if(_0x1f95e1){return _0x1f95e1?{'count':_0x8618dd,'rows':_0x1f95e1}:null;}})['then'](respondWithResult(_0x1fb80d,null))['catch'](handleError(_0x1fb80d,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 115a9e6..0254082 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 _0xcb8b=['rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','moment','bluebird','path'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0xcb8b,0xc7));var _0xbcb8=function(_0x12397a,_0x20da0c){_0x12397a=_0x12397a-0x0;var _0x439a5f=_0xcb8b[_0x12397a];return _0x439a5f;};'use strict';var _=require('lodash');var util=require(_0xbcb8('0x0'));var logger=require(_0xbcb8('0x1'))('api');var moment=require(_0xbcb8('0x2'));var BPromise=require(_0xbcb8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbcb8('0x4'));var rimraf=require(_0xbcb8('0x5'));var config=require(_0xbcb8('0x6'));var attributes=require(_0xbcb8('0x7'));module[_0xbcb8('0x8')]=function(_0x429636,_0x29fbcd){return _0x429636[_0xbcb8('0x9')](_0xbcb8('0xa'),attributes,{'tableName':_0xbcb8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0615=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','voice_musiconhold'];(function(_0xe8a05f,_0xff1a57){var _0x4c307f=function(_0x353d4b){while(--_0x353d4b){_0xe8a05f['push'](_0xe8a05f['shift']());}};_0x4c307f(++_0xff1a57);}(_0x0615,0x9c));var _0x5061=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0615[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x5061('0x0'));var util=require('util');var logger=require(_0x5061('0x1'))(_0x5061('0x2'));var moment=require(_0x5061('0x3'));var BPromise=require(_0x5061('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5061('0x5'));var rimraf=require(_0x5061('0x6'));var config=require(_0x5061('0x7'));var attributes=require(_0x5061('0x8'));module[_0x5061('0x9')]=function(_0x2b0f3a,_0x151ac7){return _0x2b0f3a['define'](_0x5061('0xa'),attributes,{'tableName':_0x5061('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 1cc473d..4244035 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x11d02b,_0x29e0a8){var _0x3ad499=function(_0x501dd9){while(--_0x501dd9){_0x11d02b['push'](_0x11d02b['shift']());}};_0x3ad499(++_0x29e0a8);}(_0x70e0,0x17b));var _0x070e=function(_0x4eb751,_0x4485b0){_0x4eb751=_0x4eb751-0x0;var _0x26878d=_0x70e0[_0x4eb751];return _0x26878d;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x1765a5,_0x797b9f){var _0x2a9058=function(_0x3e5864){while(--_0x3e5864){_0x1765a5['push'](_0x1765a5['shift']());}};_0x2a9058(++_0x797b9f);}(_0x9c44,0x178));var _0x49c4=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x9c44[_0x3b0731];return _0x4204d7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index d455d53..2fa3835 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 _0x2fed=['../../components/auth/service','./voicePrefix.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams','update','destroy','delete','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x2d2624,_0x3f7918){var _0x257d4c=function(_0x1e9c3e){while(--_0x1e9c3e){_0x2d2624['push'](_0x2d2624['shift']());}};_0x257d4c(++_0x3f7918);}(_0x2fed,0x7c));var _0xd2fe=function(_0x1e5b18,_0x43fe0c){_0x1e5b18=_0x1e5b18-0x0;var _0x417a4e=_0x2fed[_0x1e5b18];return _0x417a4e;};'use strict';var multer=require(_0xd2fe('0x0'));var util=require(_0xd2fe('0x1'));var path=require(_0xd2fe('0x2'));var timeout=require(_0xd2fe('0x3'));var express=require(_0xd2fe('0x4'));var router=express['Router']();var fs_extra=require(_0xd2fe('0x5'));var auth=require(_0xd2fe('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd2fe('0x7'));router[_0xd2fe('0x8')]('/',auth[_0xd2fe('0x9')](),controller['index']);router[_0xd2fe('0x8')](_0xd2fe('0xa'),auth[_0xd2fe('0x9')](),controller[_0xd2fe('0xb')]);router['get'](_0xd2fe('0xc'),auth[_0xd2fe('0x9')](),controller[_0xd2fe('0xd')]);router[_0xd2fe('0x8')](_0xd2fe('0xe'),auth[_0xd2fe('0x9')](),controller[_0xd2fe('0xf')]);router[_0xd2fe('0x8')](_0xd2fe('0x10'),auth[_0xd2fe('0x9')](),controller[_0xd2fe('0x11')]);router[_0xd2fe('0x12')]('/',auth[_0xd2fe('0x9')](),controller[_0xd2fe('0x13')]);router[_0xd2fe('0x12')](_0xd2fe('0xe'),auth[_0xd2fe('0x9')](),controller[_0xd2fe('0x14')]);router['post'](_0xd2fe('0x10'),auth[_0xd2fe('0x9')](),controller[_0xd2fe('0x15')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xd2fe('0x16')]);router['delete'](_0xd2fe('0xc'),auth[_0xd2fe('0x9')](),controller[_0xd2fe('0x17')]);router[_0xd2fe('0x18')](_0xd2fe('0xe'),auth[_0xd2fe('0x9')](),controller['removeAgents']);router['delete'](_0xd2fe('0x10'),auth[_0xd2fe('0x9')](),controller['removeTeams']);module[_0xd2fe('0x19')]=router; \ No newline at end of file +var _0xf873=['index','/describe','describe','/:id','/:id/users','getAgents','/:id/teams','getTeams','post','create','addTeams','put','update','delete','removeTeams','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x37c18d,_0x4f7f53){var _0x2da6fa=function(_0xa09653){while(--_0xa09653){_0x37c18d['push'](_0x37c18d['shift']());}};_0x2da6fa(++_0x4f7f53);}(_0xf873,0xb2));var _0x3f87=function(_0x21bb97,_0xedffde){_0x21bb97=_0x21bb97-0x0;var _0x1852ef=_0xf873[_0x21bb97];return _0x1852ef;};'use strict';var multer=require('multer');var util=require(_0x3f87('0x0'));var path=require(_0x3f87('0x1'));var timeout=require(_0x3f87('0x2'));var express=require(_0x3f87('0x3'));var router=express[_0x3f87('0x4')]();var fs_extra=require(_0x3f87('0x5'));var auth=require(_0x3f87('0x6'));var interaction=require(_0x3f87('0x7'));var config=require(_0x3f87('0x8'));var controller=require('./voicePrefix.controller');router[_0x3f87('0x9')]('/',auth[_0x3f87('0xa')](),controller[_0x3f87('0xb')]);router['get'](_0x3f87('0xc'),auth[_0x3f87('0xa')](),controller[_0x3f87('0xd')]);router[_0x3f87('0x9')](_0x3f87('0xe'),auth[_0x3f87('0xa')](),controller['show']);router[_0x3f87('0x9')](_0x3f87('0xf'),auth[_0x3f87('0xa')](),controller[_0x3f87('0x10')]);router[_0x3f87('0x9')](_0x3f87('0x11'),auth[_0x3f87('0xa')](),controller[_0x3f87('0x12')]);router[_0x3f87('0x13')]('/',auth[_0x3f87('0xa')](),controller[_0x3f87('0x14')]);router[_0x3f87('0x13')](_0x3f87('0xf'),auth[_0x3f87('0xa')](),controller['addAgents']);router[_0x3f87('0x13')](_0x3f87('0x11'),auth['isAuthenticated'](),controller[_0x3f87('0x15')]);router[_0x3f87('0x16')](_0x3f87('0xe'),auth[_0x3f87('0xa')](),controller[_0x3f87('0x17')]);router[_0x3f87('0x18')](_0x3f87('0xe'),auth[_0x3f87('0xa')](),controller['destroy']);router[_0x3f87('0x18')](_0x3f87('0xf'),auth[_0x3f87('0xa')](),controller['removeAgents']);router[_0x3f87('0x18')]('/:id/teams',auth[_0x3f87('0xa')](),controller[_0x3f87('0x19')]);module[_0x3f87('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 475adcd..dffce1c 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 _0x704b=['name','system-','getDataValue','INTEGER','sequelize','exports','STRING'];(function(_0x26aa1a,_0xe7090a){var _0x2f0d57=function(_0x51fc15){while(--_0x51fc15){_0x26aa1a['push'](_0x26aa1a['shift']());}};_0x2f0d57(++_0xe7090a);}(_0x704b,0xcf));var _0xb704=function(_0x15c23e,_0x162305){_0x15c23e=_0x15c23e-0x0;var _0x4ed7d1=_0x704b[_0x15c23e];return _0x4ed7d1;};'use strict';var Sequelize=require(_0xb704('0x0'));module[_0xb704('0x1')]={'name':{'type':Sequelize[_0xb704('0x2')],'allowNull':![],'unique':_0xb704('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0xfa14cf){return _0xb704('0x4')+this[_0xb704('0x5')](_0xb704('0x3'))+'-';}},'description':{'type':Sequelize[_0xb704('0x2')]},'callerIdAll':{'type':Sequelize[_0xb704('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xb704('0x6')]}}; \ No newline at end of file +var _0xc5b7=['STRING','name','VIRTUAL','getDataValue','INTEGER','sequelize'];(function(_0x3e0996,_0x50def9){var _0x270122=function(_0x351268){while(--_0x351268){_0x3e0996['push'](_0x3e0996['shift']());}};_0x270122(++_0x50def9);}(_0xc5b7,0x17f));var _0x7c5b=function(_0x57589f,_0x56740f){_0x57589f=_0x57589f-0x0;var _0x48566d=_0xc5b7[_0x57589f];return _0x48566d;};'use strict';var Sequelize=require(_0x7c5b('0x0'));module['exports']={'name':{'type':Sequelize[_0x7c5b('0x1')],'allowNull':![],'unique':_0x7c5b('0x2')},'prefix':{'type':Sequelize[_0x7c5b('0x3')],'get':function(_0x5dfc0f){return'system-'+this[_0x7c5b('0x4')](_0x7c5b('0x2'))+'-';}},'description':{'type':Sequelize[_0x7c5b('0x1')]},'callerIdAll':{'type':Sequelize[_0x7c5b('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x7c5b('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 91dc83e..fa3d3b7 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 _0x087b=['status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','VoicePrefixes','UserProfileResource','end','error','stack','name','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','merge','VIRTUAL','where','include','catch','options','find','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','description','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','Set','CDR(prefix)=','callerIdAll','push','No\x20callerid\x20available','context','charAt','body','system-','findById','addAgents','params','omit','ids','spread','removeAgents','isArray','emit','userVoicePrefix:remove','findOne','User','pick','getAgents','nolimit','getTeams','Team','addTeams','findAll','interface','flatMap','Agents','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','union','compact','value','removeTeams','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus'];(function(_0x3ffa90,_0x534de3){var _0x2845a2=function(_0x70cb04){while(--_0x70cb04){_0x3ffa90['push'](_0x3ffa90['shift']());}};_0x2845a2(++_0x534de3);}(_0x087b,0x11a));var _0xb087=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0x087b[_0x2f45ea];return _0x485a84;};'use strict';var emlformat=require(_0xb087('0x0'));var rimraf=require(_0xb087('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb087('0x2'));var moment=require('moment');var BPromise=require(_0xb087('0x3'));var Mustache=require(_0xb087('0x4'));var util=require(_0xb087('0x5'));var path=require(_0xb087('0x6'));var sox=require(_0xb087('0x7'));var csv=require(_0xb087('0x8'));var ejs=require(_0xb087('0x9'));var fs=require('fs');var fs_extra=require(_0xb087('0xa'));var _=require(_0xb087('0xb'));var squel=require(_0xb087('0xc'));var crypto=require(_0xb087('0xd'));var jsforce=require(_0xb087('0xe'));var deskjs=require(_0xb087('0xf'));var toCsv=require(_0xb087('0x8'));var querystring=require(_0xb087('0x10'));var Papa=require(_0xb087('0x11'));var Redis=require(_0xb087('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb087('0x13'));var as=require(_0xb087('0x14'));var hardwareService=require(_0xb087('0x15'));var logger=require(_0xb087('0x16'))(_0xb087('0x17'));var utils=require(_0xb087('0x18'));var config=require(_0xb087('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb087('0x1a'))['db'];config[_0xb087('0x1b')]=_[_0xb087('0x1c')](config['redis'],{'host':_0xb087('0x1d'),'port':0x18eb});var socket=require(_0xb087('0x1e'))(new Redis(config[_0xb087('0x1b')]));require(_0xb087('0x1f'))[_0xb087('0x20')](socket);function respondWithStatusCode(_0x12d0db,_0x5e9757){_0x5e9757=_0x5e9757||0xcc;return function(_0x5147e3){if(_0x5147e3){return _0x12d0db[_0xb087('0x21')](_0x5e9757);}return _0x12d0db[_0xb087('0x22')](_0x5e9757)['end']();};}function respondWithResult(_0x43e576,_0x412b48){_0x412b48=_0x412b48||0xc8;return function(_0x597478){if(_0x597478){return _0x43e576[_0xb087('0x22')](_0x412b48)[_0xb087('0x23')](_0x597478);}};}function respondWithFilteredResult(_0x2e9e74,_0x5bb80b){return function(_0x330005){if(_0x330005){var _0x3c680f=typeof _0x5bb80b[_0xb087('0x24')]===_0xb087('0x25')&&typeof _0x5bb80b['limit']===_0xb087('0x25');var _0x28428e=_0x330005[_0xb087('0x26')];var _0x23c1b6=_0x3c680f?0x0:_0x5bb80b['offset'];var _0x5aeab1=_0x3c680f?_0x330005['count']:_0x5bb80b['offset']+_0x5bb80b[_0xb087('0x27')];var _0x17be8e;if(_0x5aeab1>=_0x28428e){_0x5aeab1=_0x28428e;_0x17be8e=0xc8;}else{_0x17be8e=0xce;}_0x2e9e74[_0xb087('0x22')](_0x17be8e);return _0x2e9e74[_0xb087('0x28')](_0xb087('0x29'),_0x23c1b6+'-'+_0x5aeab1+'/'+_0x28428e)[_0xb087('0x23')](_0x330005);}return null;};}function patchUpdates(_0x31ae01){return function(_0x5587f7){try{jsonpatch[_0xb087('0x2a')](_0x5587f7,_0x31ae01,!![]);}catch(_0x466397){return BPromise[_0xb087('0x2b')](_0x466397);}return _0x5587f7[_0xb087('0x2c')]();};}function saveUpdates(_0x3ad74e,_0x4d9028){return function(_0x183eab){if(_0x183eab){return _0x183eab[_0xb087('0x2d')](_0x3ad74e)['then'](function(_0x5a2dc6){return _0x5a2dc6;});}return null;};}function removeEntity(_0x50745a,_0x598b99){return function(_0x5a4ee0){if(_0x5a4ee0){return _0x5a4ee0[_0xb087('0x2e')]()[_0xb087('0x2f')](function(){var _0x1d124f=_0x5a4ee0[_0xb087('0x30')]({'plain':!![]});var _0xd9ec66=_0xb087('0x31');return db[_0xb087('0x32')][_0xb087('0x2e')]({'where':{'type':_0xd9ec66,'resourceId':_0x1d124f['id']}})[_0xb087('0x2f')](function(){return _0x5a4ee0;});})[_0xb087('0x2f')](function(){_0x50745a[_0xb087('0x22')](0xcc)[_0xb087('0x33')]();});}};}function handleEntityNotFound(_0xb0baf6,_0x263259){return function(_0x593b78){if(!_0x593b78){_0xb0baf6[_0xb087('0x21')](0x194);}return _0x593b78;};}function handleError(_0x1335d9,_0x20183f){_0x20183f=_0x20183f||0x1f4;return function(_0x15c9ac){logger[_0xb087('0x34')](_0x15c9ac[_0xb087('0x35')]);if(_0x15c9ac[_0xb087('0x36')]){delete _0x15c9ac[_0xb087('0x36')];}_0x1335d9['status'](_0x20183f)['send'](_0x15c9ac);};}exports[_0xb087('0x37')]=function(_0xedd164,_0x4cb5a8){var _0x60bfe2={},_0x7d3776={},_0x2a48d3={'count':0x0,'rows':[]};var _0x32b20d=_[_0xb087('0x38')](db[_0xb087('0x39')][_0xb087('0x3a')],function(_0x3b7ace){return{'name':_0x3b7ace[_0xb087('0x3b')],'type':_0x3b7ace[_0xb087('0x3c')][_0xb087('0x3d')]};});_0x7d3776[_0xb087('0x3e')]=_['map'](_0x32b20d,_0xb087('0x36'));_0x7d3776['query']=_[_0xb087('0x3f')](_0xedd164[_0xb087('0x40')]);_0x7d3776[_0xb087('0x41')]=_[_0xb087('0x42')](_0x7d3776[_0xb087('0x3e')],_0x7d3776[_0xb087('0x40')]);_0x60bfe2[_0xb087('0x43')]=_[_0xb087('0x42')](_0x7d3776[_0xb087('0x3e')],qs['fields'](_0xedd164['query'][_0xb087('0x44')]));_0x60bfe2[_0xb087('0x43')]=_0x60bfe2[_0xb087('0x43')][_0xb087('0x45')]?_0x60bfe2[_0xb087('0x43')]:_0x7d3776['model'];if(!_0xedd164[_0xb087('0x40')][_0xb087('0x46')]('nolimit')){_0x60bfe2['limit']=qs[_0xb087('0x27')](_0xedd164[_0xb087('0x40')][_0xb087('0x27')]);_0x60bfe2['offset']=qs[_0xb087('0x24')](_0xedd164[_0xb087('0x40')][_0xb087('0x24')]);}_0x60bfe2[_0xb087('0x47')]=qs[_0xb087('0x48')](_0xedd164['query'][_0xb087('0x48')]);_0x60bfe2['where']=qs[_0xb087('0x41')](_['pick'](_0xedd164[_0xb087('0x40')],_0x7d3776[_0xb087('0x41')]),_0x32b20d);if(_0xedd164['query'][_0xb087('0x49')]){_0x60bfe2['where']=_[_0xb087('0x4a')](_0x60bfe2['where'],{'$or':_[_0xb087('0x38')](_0x32b20d,function(_0x326934){if(_0x326934[_0xb087('0x3c')]!==_0xb087('0x4b')){var _0x1785e0={};_0x1785e0[_0x326934[_0xb087('0x36')]]={'$like':'%'+_0xedd164[_0xb087('0x40')]['filter']+'%'};return _0x1785e0;}})});}_0x60bfe2=_[_0xb087('0x4a')]({},_0x60bfe2,_0xedd164['options']);var _0x2a2b9c={'where':_0x60bfe2[_0xb087('0x4c')]};return db['VoicePrefix'][_0xb087('0x26')](_0x2a2b9c)[_0xb087('0x2f')](function(_0x7650c5){_0x2a48d3['count']=_0x7650c5;if(_0xedd164[_0xb087('0x40')]['includeAll']){_0x60bfe2[_0xb087('0x4d')]=[{'all':!![]}];}return db[_0xb087('0x39')]['findAll'](_0x60bfe2);})[_0xb087('0x2f')](function(_0x302ce7){_0x2a48d3['rows']=_0x302ce7;return _0x2a48d3;})[_0xb087('0x2f')](respondWithFilteredResult(_0x4cb5a8,_0x60bfe2))[_0xb087('0x4e')](handleError(_0x4cb5a8,null));};exports['show']=function(_0x93ada7,_0x46c713){var _0x1d7f80={'raw':![],'where':{'id':_0x93ada7['params']['id']}},_0x174c10={};_0x174c10['model']=_[_0xb087('0x3f')](db[_0xb087('0x39')][_0xb087('0x3a')]);_0x174c10[_0xb087('0x40')]=_[_0xb087('0x3f')](_0x93ada7[_0xb087('0x40')]);_0x174c10['filters']=_['intersection'](_0x174c10[_0xb087('0x3e')],_0x174c10['query']);_0x1d7f80[_0xb087('0x43')]=_[_0xb087('0x42')](_0x174c10[_0xb087('0x3e')],qs[_0xb087('0x44')](_0x93ada7['query'][_0xb087('0x44')]));_0x1d7f80['attributes']=_0x1d7f80[_0xb087('0x43')][_0xb087('0x45')]?_0x1d7f80[_0xb087('0x43')]:_0x174c10[_0xb087('0x3e')];if(_0x93ada7[_0xb087('0x40')]['includeAll']){_0x1d7f80[_0xb087('0x4d')]=[{'all':!![]}];}_0x1d7f80=_[_0xb087('0x4a')]({},_0x1d7f80,_0x93ada7[_0xb087('0x4f')]);return db['VoicePrefix'][_0xb087('0x50')](_0x1d7f80)['then'](handleEntityNotFound(_0x46c713,null))['then'](respondWithResult(_0x46c713,null))[_0xb087('0x4e')](handleError(_0x46c713,null));};exports[_0xb087('0x2e')]=function(_0x5eacf3,_0x4362d4){return db[_0xb087('0x39')][_0xb087('0x50')]({'where':{'id':_0x5eacf3['params']['id']}})['then'](handleEntityNotFound(_0x4362d4,null))[_0xb087('0x2f')](removeEntity(_0x4362d4,null))['catch'](handleError(_0x4362d4,null));};exports['describe']=function(_0x1e52e4,_0x3bafca){return db[_0xb087('0x39')][_0xb087('0x51')]()[_0xb087('0x2f')](respondWithResult(_0x3bafca,null))[_0xb087('0x4e')](handleError(_0x3bafca,null));};exports[_0xb087('0x52')]=function(_0xfb8827,_0x1fe178){var _0x18d93b;return db[_0xb087('0x53')][_0xb087('0x54')](function(_0x55e653){return db[_0xb087('0x39')][_0xb087('0x52')](_0xfb8827['body'],{'transaction':_0x55e653})[_0xb087('0x2f')](function(_0x458301){_0x18d93b=_0x458301[_0xb087('0x30')]({'plain':!![]});return db[_0xb087('0x55')][_0xb087('0x50')]({'where':{'id':_0x18d93b[_0xb087('0x56')]},'raw':!![]})[_0xb087('0x2f')](function(_0x298169){return createVoicePrefixExtensions(_0x18d93b,_0x298169,_0x55e653);});});})[_0xb087('0x2f')](function(){var _0x357616=_0xfb8827[_0xb087('0x57')]['get']({'plain':!![]});if(!_0x357616)throw new Error(_0xb087('0x58'));if(_0x357616['role']===_0xb087('0x57')){var _0x575cc4=_0x18d93b;return db[_0xb087('0x59')][_0xb087('0x50')]({'where':{'name':_0xb087('0x31'),'userProfileId':_0x357616[_0xb087('0x5a')]},'raw':!![]})[_0xb087('0x2f')](function(_0x465ef6){if(_0x465ef6&&_0x465ef6[_0xb087('0x5b')]===0x0){return db[_0xb087('0x32')][_0xb087('0x52')]({'name':_0x575cc4[_0xb087('0x36')],'resourceId':_0x575cc4['id'],'type':_0x465ef6[_0xb087('0x36')],'sectionId':_0x465ef6['id']},{})[_0xb087('0x2f')](function(){return _0x18d93b;});}else{return _0x18d93b;}})[_0xb087('0x4e')](function(_0x22be05){logger[_0xb087('0x34')](_0xb087('0x5c'),_0x22be05);throw _0x22be05;});}return _0x18d93b;})[_0xb087('0x2f')](respondWithResult(_0x1fe178,null))[_0xb087('0x4e')](handleError(_0x1fe178,null));};function Extension(_0x40ff74,_0xe3cb2,_0x4053c8,_0x459c5b){this['context']=_0xb087('0x5d');this[_0xb087('0x5e')]=_0x40ff74;this[_0xb087('0x5f')]=_0x4053c8;this['type']=_0xb087('0x60');this[_0xb087('0x61')]='Voice\x20Prefix\x20Extension';this[_0xb087('0x62')]=_0xe3cb2;this[_0xb087('0x63')]=_0x459c5b;}function createVoicePrefixExtensions(_0x2e3a14,_0x596264,_0x133c58){return new BPromise(function(_0x257894,_0x3d7f74){var _0x43ef22=new Extension(formatPrefixName(_0x2e3a14[_0xb087('0x64')]),0x1,_0xb087('0x65'),_0xb087('0x66'));_0x43ef22[_0xb087('0x67')]=_0x2e3a14['id'];return db['VoiceExtension'][_0xb087('0x52')](_0x43ef22,{'transaction':_0x133c58})[_0xb087('0x2f')](function(_0x44548f){var _0x47b2c7=_0x44548f[_0xb087('0x30')]({'plain':!![]});var _0x4a26d0=_['map'](addVoicePrefixExtensions(_0x2e3a14,_0x596264),function(_0x3516d4){_0x3516d4[_0xb087('0x56')]=_0x47b2c7['id'];_0x3516d4['VoicePrefixId']=_0x2e3a14['id'];return _0x3516d4;});return db[_0xb087('0x55')]['bulkCreate'](_0x4a26d0,{'transaction':_0x133c58})[_0xb087('0x2f')](function(_0x1a8237){if(!_0x1a8237){return _0x3d7f74('Extensions\x20creation\x20failed');}else{return _0x257894(_0x1a8237);}})['catch'](function(_0x22219d){return _0x3d7f74(_0x22219d);});});;});};function addVoicePrefixExtensions(_0x5c43c8,_0x5ede2e){var _0x3c97ab=[];var _0x52d72a=formatPrefixName(_0x5c43c8[_0xb087('0x64')]);_0x3c97ab['push'](new Extension(_0x52d72a,0x2,_0xb087('0x68'),_0xb087('0x69')+_0x5c43c8[_0xb087('0x36')]));if(_0x5c43c8[_0xb087('0x6a')]){_0x3c97ab[_0xb087('0x6b')](new Extension(_0x52d72a,0x3,_0xb087('0x68'),'PREFIX-CALLERIDALL='+_0x5c43c8[_0xb087('0x6a')]));}else{_0x3c97ab['push'](new Extension(_0x52d72a,0x3,_0xb087('0x65'),_0xb087('0x6c')));}_0x3c97ab[_0xb087('0x6b')](new Extension(_0x52d72a,0x4,'goto',_0x5ede2e[_0xb087('0x6d')]+','+'${EXTEN:'+(0x8+_0x5c43c8[_0xb087('0x36')][_0xb087('0x45')])+'}'+','+0x1));return _0x3c97ab;}function formatPrefixName(_0x66f15b){var _0x2ee63f='_';for(var _0x16cb87=0x0;_0x16cb87<_0x66f15b[_0xb087('0x45')];_0x16cb87++){if(_0x66f15b['charAt'](_0x16cb87)=='-'){_0x2ee63f+=_0x66f15b[_0xb087('0x6e')](_0x16cb87);}else{_0x2ee63f+='['+_0x66f15b[_0xb087('0x6e')](_0x16cb87)+']';}}_0x2ee63f+='.';return _0x2ee63f;}exports['update']=function(_0x25a45f,_0x58de88,_0x19238d){var _0x38f5d2=_0x25a45f[_0xb087('0x6f')];_0x38f5d2[_0xb087('0x64')]=_0xb087('0x70')+_0x38f5d2[_0xb087('0x36')]+'-';return db[_0xb087('0x53')][_0xb087('0x54')](function(_0x509ee7){return db['VoicePrefix']['update'](_0x38f5d2,{'where':{'id':_0x38f5d2['id']},'transaction':_0x509ee7})[_0xb087('0x2f')](function(){return db['VoiceExtension'][_0xb087('0x2e')]({'where':{'VoicePrefixId':_0x38f5d2['id']},'transaction':_0x509ee7})['then'](function(){return db[_0xb087('0x55')][_0xb087('0x50')]({'where':{'id':_0x38f5d2[_0xb087('0x56')]},'raw':!![]})[_0xb087('0x2f')](function(_0x49d0d3){return createVoicePrefixExtensions(_0x38f5d2,_0x49d0d3,_0x509ee7);});});});})[_0xb087('0x2f')](function(){return db['VoicePrefix'][_0xb087('0x71')](_0x38f5d2['id']);})[_0xb087('0x2f')](respondWithResult(_0x58de88,null))[_0xb087('0x4e')](handleError(_0x58de88,null));};exports[_0xb087('0x72')]=function(_0x5b5ad3,_0x49d26a,_0x38f296){return db['VoicePrefix'][_0xb087('0x50')]({'where':{'id':_0x5b5ad3[_0xb087('0x73')]['id']}})[_0xb087('0x2f')](handleEntityNotFound(_0x49d26a,null))[_0xb087('0x2f')](function(_0x4a9193){if(_0x4a9193){return _0x4a9193['addAgents'](_0x5b5ad3[_0xb087('0x6f')]['ids'],_[_0xb087('0x74')](_0x5b5ad3[_0xb087('0x6f')],[_0xb087('0x75'),'id'])||{})[_0xb087('0x76')](function(_0x142b0f){for(var _0x581ad4=0x0;_0x581ad4<_0x5b5ad3[_0xb087('0x6f')][_0xb087('0x75')]['length'];_0x581ad4+=0x1){socket['emit']('userVoicePrefix:save',{'UserId':Number(_0x5b5ad3[_0xb087('0x6f')][_0xb087('0x75')][_0x581ad4]),'VoicePrefixId':Number(_0x5b5ad3[_0xb087('0x73')]['id'])});}return _0x142b0f;});}})[_0xb087('0x2f')](respondWithResult(_0x49d26a,null))[_0xb087('0x4e')](handleError(_0x49d26a,null));};exports[_0xb087('0x77')]=function(_0x47ea48,_0xd1f58a,_0x25e097){return db[_0xb087('0x39')][_0xb087('0x50')]({'where':{'id':_0x47ea48[_0xb087('0x73')]['id']}})[_0xb087('0x2f')](handleEntityNotFound(_0xd1f58a,null))[_0xb087('0x2f')](function(_0x50454b){if(_0x50454b){return _0x50454b[_0xb087('0x77')](_0x47ea48[_0xb087('0x40')][_0xb087('0x75')])['then'](function(){if(_[_0xb087('0x78')](_0x47ea48['query'][_0xb087('0x75')])){for(var _0x5fb869=0x0;_0x5fb869<_0x47ea48[_0xb087('0x40')][_0xb087('0x75')][_0xb087('0x45')];_0x5fb869+=0x1){socket[_0xb087('0x79')]('userVoicePrefix:remove',{'UserId':Number(_0x47ea48['query'][_0xb087('0x75')][_0x5fb869]),'VoicePrefixId':Number(_0x47ea48[_0xb087('0x73')]['id'])});}}else{socket['emit'](_0xb087('0x7a'),{'UserId':Number(_0x47ea48[_0xb087('0x40')][_0xb087('0x75')]),'VoicePrefixId':Number(_0x47ea48[_0xb087('0x73')]['id'])});}});}})[_0xb087('0x2f')](respondWithStatusCode(_0xd1f58a,null))[_0xb087('0x4e')](handleError(_0xd1f58a,null));};exports['getAgents']=function(_0x15ff29,_0x141859,_0x2c92f6){var _0x3114ce={};var _0x416e05={};var _0x3d6d1a;var _0xf286de;return db[_0xb087('0x39')][_0xb087('0x7b')]({'where':{'id':_0x15ff29['params']['id']}})[_0xb087('0x2f')](handleEntityNotFound(_0x141859,null))['then'](function(_0x2a32d0){if(_0x2a32d0){_0x3d6d1a=_0x2a32d0;_0x416e05[_0xb087('0x3e')]=_['keys'](db[_0xb087('0x7c')][_0xb087('0x3a')]);_0x416e05[_0xb087('0x40')]=_[_0xb087('0x3f')](_0x15ff29[_0xb087('0x40')]);_0x416e05[_0xb087('0x41')]=_['intersection'](_0x416e05[_0xb087('0x3e')],_0x416e05[_0xb087('0x40')]);_0x3114ce[_0xb087('0x43')]=_[_0xb087('0x42')](_0x416e05[_0xb087('0x3e')],qs['fields'](_0x15ff29[_0xb087('0x40')][_0xb087('0x44')]));_0x3114ce[_0xb087('0x43')]=_0x3114ce[_0xb087('0x43')][_0xb087('0x45')]?_0x3114ce[_0xb087('0x43')]:_0x416e05[_0xb087('0x3e')];_0x3114ce[_0xb087('0x47')]=qs[_0xb087('0x48')](_0x15ff29[_0xb087('0x40')][_0xb087('0x48')]);_0x3114ce['where']=qs['filters'](_[_0xb087('0x7d')](_0x15ff29[_0xb087('0x40')],_0x416e05[_0xb087('0x41')]));if(_0x15ff29[_0xb087('0x40')][_0xb087('0x49')]){_0x3114ce['where']=_[_0xb087('0x4a')](_0x3114ce[_0xb087('0x4c')],{'$or':_[_0xb087('0x38')](_0x3114ce[_0xb087('0x43')],function(_0x3e58be){var _0xbe2a4c={};_0xbe2a4c[_0x3e58be]={'$like':'%'+_0x15ff29['query'][_0xb087('0x49')]+'%'};return _0xbe2a4c;})});}_0x3114ce=_['merge']({},_0x3114ce,_0x15ff29['options']);return _0x3d6d1a[_0xb087('0x7e')](_0x3114ce);}})[_0xb087('0x2f')](function(_0x3a446d){if(_0x3a446d){_0xf286de=_0x3a446d[_0xb087('0x45')];if(!_0x15ff29['query'][_0xb087('0x46')](_0xb087('0x7f'))){_0x3114ce['limit']=qs[_0xb087('0x27')](_0x15ff29['query']['limit']);_0x3114ce[_0xb087('0x24')]=qs[_0xb087('0x24')](_0x15ff29[_0xb087('0x40')][_0xb087('0x24')]);}return _0x3d6d1a[_0xb087('0x7e')](_0x3114ce);}})['then'](function(_0x3cf818){if(_0x3cf818){return _0x3cf818?{'count':_0xf286de,'rows':_0x3cf818}:null;}})[_0xb087('0x2f')](respondWithResult(_0x141859,null))[_0xb087('0x4e')](handleError(_0x141859,null));};exports[_0xb087('0x80')]=function(_0x48e2c6,_0x489b1f,_0x544a68){var _0x5ebb4f={};var _0x17f0af={};var _0x3296c9;var _0x10e4b6;return db[_0xb087('0x39')][_0xb087('0x7b')]({'where':{'id':_0x48e2c6[_0xb087('0x73')]['id']}})[_0xb087('0x2f')](handleEntityNotFound(_0x489b1f,null))['then'](function(_0x5d45e7){if(_0x5d45e7){_0x3296c9=_0x5d45e7;_0x17f0af[_0xb087('0x3e')]=_[_0xb087('0x3f')](db[_0xb087('0x81')][_0xb087('0x3a')]);_0x17f0af['query']=_[_0xb087('0x3f')](_0x48e2c6['query']);_0x17f0af[_0xb087('0x41')]=_['intersection'](_0x17f0af[_0xb087('0x3e')],_0x17f0af[_0xb087('0x40')]);_0x5ebb4f[_0xb087('0x43')]=_[_0xb087('0x42')](_0x17f0af['model'],qs[_0xb087('0x44')](_0x48e2c6['query']['fields']));_0x5ebb4f['attributes']=_0x5ebb4f[_0xb087('0x43')]['length']?_0x5ebb4f[_0xb087('0x43')]:_0x17f0af[_0xb087('0x3e')];_0x5ebb4f[_0xb087('0x47')]=qs[_0xb087('0x48')](_0x48e2c6[_0xb087('0x40')][_0xb087('0x48')]);_0x5ebb4f[_0xb087('0x4c')]=qs[_0xb087('0x41')](_[_0xb087('0x7d')](_0x48e2c6[_0xb087('0x40')],_0x17f0af[_0xb087('0x41')]));if(_0x48e2c6[_0xb087('0x40')][_0xb087('0x49')]){_0x5ebb4f[_0xb087('0x4c')]=_[_0xb087('0x4a')](_0x5ebb4f[_0xb087('0x4c')],{'$or':_[_0xb087('0x38')](_0x5ebb4f[_0xb087('0x43')],function(_0x4e42eb){var _0x15e2f9={};_0x15e2f9[_0x4e42eb]={'$like':'%'+_0x48e2c6['query'][_0xb087('0x49')]+'%'};return _0x15e2f9;})});}_0x5ebb4f=_[_0xb087('0x4a')]({},_0x5ebb4f,_0x48e2c6[_0xb087('0x4f')]);return _0x3296c9[_0xb087('0x80')](_0x5ebb4f);}})[_0xb087('0x2f')](function(_0x2e4d22){if(_0x2e4d22){_0x10e4b6=_0x2e4d22[_0xb087('0x45')];if(!_0x48e2c6['query']['hasOwnProperty']('nolimit')){_0x5ebb4f[_0xb087('0x27')]=qs[_0xb087('0x27')](_0x48e2c6[_0xb087('0x40')][_0xb087('0x27')]);_0x5ebb4f[_0xb087('0x24')]=qs[_0xb087('0x24')](_0x48e2c6[_0xb087('0x40')][_0xb087('0x24')]);}return _0x3296c9[_0xb087('0x80')](_0x5ebb4f);}})['then'](function(_0x2de517){if(_0x2de517){return _0x2de517?{'count':_0x10e4b6,'rows':_0x2de517}:null;}})['then'](respondWithResult(_0x489b1f,null))[_0xb087('0x4e')](handleError(_0x489b1f,null));};exports[_0xb087('0x82')]=function(_0x597d80,_0x4c3aef,_0x2f2597){var _0x2ae274=_0x597d80[_0xb087('0x6f')][_0xb087('0x75')];var _0x5069f2;return db[_0xb087('0x81')][_0xb087('0x83')]({'where':{'id':_0x2ae274},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xb087('0x36'),'online','voicePause',_0xb087('0x84')],'raw':!![]}]})['then'](function(_0x4059ac){if(_0x4059ac){_0x5069f2=_0x4059ac;var _0x12976c=_[_0xb087('0x85')](_0x4059ac,function(_0x1e48cc){var _0x2de831=_0x1e48cc[_0xb087('0x30')]({'plain':!![]});return _0x2de831[_0xb087('0x86')];});return db[_0xb087('0x39')]['find']({'where':{'id':_0x597d80[_0xb087('0x73')]['id']}})['then'](function(_0x5acf13){return db[_0xb087('0x53')][_0xb087('0x54')](function(_0x1fdb0f){return _0x5acf13['addTeams'](_0x2ae274,{'transaction':_0x1fdb0f})[_0xb087('0x2f')](function(){return BPromise[_0xb087('0x87')](_0x5069f2,function(_0x313d4b){return db[_0xb087('0x88')]['upsert']({'TeamId':_0x313d4b['id'],'VoicePrefixId':_0x597d80[_0xb087('0x73')]['id']},{'transaction':_0x1fdb0f});});})[_0xb087('0x2f')](function(){return BPromise[_0xb087('0x87')](_0x12976c,function(_0x46f5e6){return db[_0xb087('0x89')][_0xb087('0x8a')]({'where':{'UserId':_0x46f5e6['id'],'VoicePrefixId':_0x597d80[_0xb087('0x73')]['id']},'transaction':_0x1fdb0f});});})['then'](function(){_0x12976c[_0xb087('0x8b')](function(_0xfc3490){socket[_0xb087('0x79')](_0xb087('0x8c'),{'UserId':_0xfc3490['id'],'VoicePrefixId':_0x5acf13['id']});});});});});}})[_0xb087('0x2f')](respondWithStatusCode(_0x4c3aef,null))[_0xb087('0x4e')](handleError(_0x4c3aef,null));};exports['removeTeams']=function(_0x44c8cb,_0x15bbda,_0x149020){return db['Team']['findAll']({'where':{'id':_0x44c8cb[_0xb087('0x40')][_0xb087('0x75')]},'attributes':['id'],'include':[{'model':db[_0xb087('0x7c')],'as':_0xb087('0x86'),'attributes':['id'],'raw':!![]}]})[_0xb087('0x2f')](handleEntityNotFound(_0x15bbda,null))[_0xb087('0x2f')](function(_0x42528a){var _0x2795e9=_[_0xb087('0x38')](_0x42528a,'id');var _0xa58050=[];var _0x5ef263=[];var _0x1a7486=squel[_0xb087('0x8d')]();_0x1a7486[_0xb087('0x8e')](_0xb087('0x8f'))[_0xb087('0x90')]('team_has_voice_prefixes','tq')[_0xb087('0x91')](_0xb087('0x92'),'ut',_0xb087('0x93'))[_0xb087('0x4c')]('VoicePrefixId\x20=\x20?',_0x44c8cb[_0xb087('0x73')]['id']);for(var _0x547968=0x0;_0x547968<_0x42528a[_0xb087('0x45')];_0x547968+=0x1){let _0x532682=_0x42528a[_0x547968];for(var _0x5f4312=0x0;_0x5f4312<_0x532682[_0xb087('0x86')][_0xb087('0x45')];_0x5f4312+=0x1){let _0x1cb959=_0x532682['Agents'][_0x5f4312];var _0x595faa=_0x1a7486[_0xb087('0x94')]();_0x595faa[_0xb087('0x4c')](_0xb087('0x95'),_0x1cb959['id']);_0x5ef263[_0xb087('0x6b')](db[_0xb087('0x53')]['query'](_0x595faa[_0xb087('0x96')](),{'type':db[_0xb087('0x53')][_0xb087('0x97')][_0xb087('0x98')]})[_0xb087('0x2f')](function(_0x14737){if(_0x14737['length']===0x1){return _0x1cb959['id'];}else{var _0x5777d0=_[_0xb087('0x99')](_[_0xb087('0x38')](_0x14737,'TeamId'),function(_0x1f28dd){return _['includes'](_0x2795e9,_0x1f28dd);});if(_0x5777d0){return _0x1cb959['id'];}}}));}}return BPromise['all'](_0x5ef263)[_0xb087('0x2f')](function(_0x3193c8){_0xa58050=_(_0xa58050)[_0xb087('0x9a')](_0x3193c8)[_0xb087('0x9b')]()[_0xb087('0x9c')]();return db[_0xb087('0x39')][_0xb087('0x50')]({'where':{'id':_0x44c8cb[_0xb087('0x73')]['id']}})[_0xb087('0x2f')](function(_0xff9c0c){return db['sequelize']['transaction'](function(_0x5e704a){return _0xff9c0c[_0xb087('0x9d')](_0x44c8cb['query'][_0xb087('0x75')],{'transaction':_0x5e704a})['then'](function(){if(!_['isEmpty'](_0xa58050)){return _0xff9c0c[_0xb087('0x77')](_0xa58050,{'transaction':_0x5e704a});}})[_0xb087('0x2f')](function(){_0xa58050[_0xb087('0x8b')](function(_0x170d9e){socket[_0xb087('0x79')](_0xb087('0x7a'),{'UserId':_0x170d9e,'VoicePrefixId':_0xff9c0c['id']});});});});});});})[_0xb087('0x2f')](respondWithStatusCode(_0x15bbda,null))[_0xb087('0x4e')](handleError(_0x15bbda,null));}; \ No newline at end of file +var _0x1893=['compact','value','isEmpty','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','error','name','index','map','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','VoicePrefix','includeAll','findAll','rows','show','length','options','find','catch','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','context','${EXTEN:','charAt','body','system-','findById','addAgents','params','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','rawAttributes','pick','getAgents','getTeams','addTeams','Team','Agents','online','voicePause','flatMap','each','upsert','findOrCreate','forEach','removeTeams','field','tq.TeamId','from','team_has_voice_prefixes','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','TeamId','includes','all','union'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x1893,0xa2));var _0x3189=function(_0x25bd2a,_0xc8fe7a){_0x25bd2a=_0x25bd2a-0x0;var _0xb6b479=_0x1893[_0x25bd2a];return _0xb6b479;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3189('0x0'));var jsonpatch=require(_0x3189('0x1'));var rp=require(_0x3189('0x2'));var moment=require(_0x3189('0x3'));var BPromise=require(_0x3189('0x4'));var Mustache=require(_0x3189('0x5'));var util=require(_0x3189('0x6'));var path=require('path');var sox=require(_0x3189('0x7'));var csv=require(_0x3189('0x8'));var ejs=require(_0x3189('0x9'));var fs=require('fs');var fs_extra=require(_0x3189('0xa'));var _=require(_0x3189('0xb'));var squel=require(_0x3189('0xc'));var crypto=require(_0x3189('0xd'));var jsforce=require(_0x3189('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3189('0x8'));var querystring=require('querystring');var Papa=require(_0x3189('0xf'));var Redis=require('ioredis');var authService=require(_0x3189('0x10'));var qs=require(_0x3189('0x11'));var as=require(_0x3189('0x12'));var hardwareService=require(_0x3189('0x13'));var logger=require('../../config/logger')(_0x3189('0x14'));var utils=require(_0x3189('0x15'));var config=require(_0x3189('0x16'));var licenseUtil=require(_0x3189('0x17'));var db=require(_0x3189('0x18'))['db'];config['redis']=_[_0x3189('0x19')](config[_0x3189('0x1a')],{'host':_0x3189('0x1b'),'port':0x18eb});var socket=require(_0x3189('0x1c'))(new Redis(config[_0x3189('0x1a')]));require(_0x3189('0x1d'))[_0x3189('0x1e')](socket);function respondWithStatusCode(_0x25a917,_0x5521bb){_0x5521bb=_0x5521bb||0xcc;return function(_0x220b18){if(_0x220b18){return _0x25a917[_0x3189('0x1f')](_0x5521bb);}return _0x25a917[_0x3189('0x20')](_0x5521bb)[_0x3189('0x21')]();};}function respondWithResult(_0x486dd2,_0x40195d){_0x40195d=_0x40195d||0xc8;return function(_0x5f2e82){if(_0x5f2e82){return _0x486dd2['status'](_0x40195d)[_0x3189('0x22')](_0x5f2e82);}};}function respondWithFilteredResult(_0x49b1bc,_0x42c3a3){return function(_0xf8aed7){if(_0xf8aed7){var _0x22c7ba=typeof _0x42c3a3[_0x3189('0x23')]==='undefined'&&typeof _0x42c3a3[_0x3189('0x24')]===_0x3189('0x25');var _0x16edd7=_0xf8aed7['count'];var _0x561265=_0x22c7ba?0x0:_0x42c3a3[_0x3189('0x23')];var _0x306ed3=_0x22c7ba?_0xf8aed7[_0x3189('0x26')]:_0x42c3a3[_0x3189('0x23')]+_0x42c3a3['limit'];var _0x1771a8;if(_0x306ed3>=_0x16edd7){_0x306ed3=_0x16edd7;_0x1771a8=0xc8;}else{_0x1771a8=0xce;}_0x49b1bc[_0x3189('0x20')](_0x1771a8);return _0x49b1bc[_0x3189('0x27')]('Content-Range',_0x561265+'-'+_0x306ed3+'/'+_0x16edd7)[_0x3189('0x22')](_0xf8aed7);}return null;};}function patchUpdates(_0x47abb4){return function(_0x4bfc03){try{jsonpatch[_0x3189('0x28')](_0x4bfc03,_0x47abb4,!![]);}catch(_0x200f16){return BPromise[_0x3189('0x29')](_0x200f16);}return _0x4bfc03[_0x3189('0x2a')]();};}function saveUpdates(_0x393fcb,_0x5a08dc){return function(_0x4b03ad){if(_0x4b03ad){return _0x4b03ad[_0x3189('0x2b')](_0x393fcb)[_0x3189('0x2c')](function(_0x1dc1c8){return _0x1dc1c8;});}return null;};}function removeEntity(_0x3cc1e5,_0x103de4){return function(_0x3f4789){if(_0x3f4789){return _0x3f4789[_0x3189('0x2d')]()[_0x3189('0x2c')](function(){var _0x17b540=_0x3f4789[_0x3189('0x2e')]({'plain':!![]});var _0x5ce5f5='VoicePrefixes';return db['UserProfileResource'][_0x3189('0x2d')]({'where':{'type':_0x5ce5f5,'resourceId':_0x17b540['id']}})[_0x3189('0x2c')](function(){return _0x3f4789;});})[_0x3189('0x2c')](function(){_0x3cc1e5[_0x3189('0x20')](0xcc)[_0x3189('0x21')]();});}};}function handleEntityNotFound(_0x2f7504,_0x4d453a){return function(_0x1ab94b){if(!_0x1ab94b){_0x2f7504[_0x3189('0x1f')](0x194);}return _0x1ab94b;};}function handleError(_0x4bd677,_0x173f18){_0x173f18=_0x173f18||0x1f4;return function(_0x3744ff){logger[_0x3189('0x2f')](_0x3744ff['stack']);if(_0x3744ff[_0x3189('0x30')]){delete _0x3744ff[_0x3189('0x30')];}_0x4bd677[_0x3189('0x20')](_0x173f18)['send'](_0x3744ff);};}exports[_0x3189('0x31')]=function(_0x47f7a7,_0x51ce54){var _0x32ca90={},_0x34007b={},_0x374f23={'count':0x0,'rows':[]};var _0x3bdc84=_[_0x3189('0x32')](db['VoicePrefix']['rawAttributes'],function(_0x7d7745){return{'name':_0x7d7745['fieldName'],'type':_0x7d7745[_0x3189('0x33')][_0x3189('0x34')]};});_0x34007b[_0x3189('0x35')]=_[_0x3189('0x32')](_0x3bdc84,_0x3189('0x30'));_0x34007b[_0x3189('0x36')]=_[_0x3189('0x37')](_0x47f7a7[_0x3189('0x36')]);_0x34007b[_0x3189('0x38')]=_['intersection'](_0x34007b[_0x3189('0x35')],_0x34007b[_0x3189('0x36')]);_0x32ca90[_0x3189('0x39')]=_[_0x3189('0x3a')](_0x34007b[_0x3189('0x35')],qs[_0x3189('0x3b')](_0x47f7a7[_0x3189('0x36')]['fields']));_0x32ca90['attributes']=_0x32ca90[_0x3189('0x39')]['length']?_0x32ca90[_0x3189('0x39')]:_0x34007b[_0x3189('0x35')];if(!_0x47f7a7['query'][_0x3189('0x3c')](_0x3189('0x3d'))){_0x32ca90[_0x3189('0x24')]=qs[_0x3189('0x24')](_0x47f7a7['query'][_0x3189('0x24')]);_0x32ca90['offset']=qs['offset'](_0x47f7a7[_0x3189('0x36')][_0x3189('0x23')]);}_0x32ca90[_0x3189('0x3e')]=qs[_0x3189('0x3f')](_0x47f7a7[_0x3189('0x36')][_0x3189('0x3f')]);_0x32ca90[_0x3189('0x40')]=qs[_0x3189('0x38')](_['pick'](_0x47f7a7['query'],_0x34007b[_0x3189('0x38')]),_0x3bdc84);if(_0x47f7a7[_0x3189('0x36')][_0x3189('0x41')]){_0x32ca90[_0x3189('0x40')]=_[_0x3189('0x42')](_0x32ca90[_0x3189('0x40')],{'$or':_['map'](_0x3bdc84,function(_0x280146){if(_0x280146[_0x3189('0x33')]!==_0x3189('0x43')){var _0xaf76f1={};_0xaf76f1[_0x280146['name']]={'$like':'%'+_0x47f7a7[_0x3189('0x36')][_0x3189('0x41')]+'%'};return _0xaf76f1;}})});}_0x32ca90=_['merge']({},_0x32ca90,_0x47f7a7['options']);var _0x1ef1b2={'where':_0x32ca90['where']};return db[_0x3189('0x44')][_0x3189('0x26')](_0x1ef1b2)[_0x3189('0x2c')](function(_0x9593f3){_0x374f23['count']=_0x9593f3;if(_0x47f7a7[_0x3189('0x36')][_0x3189('0x45')]){_0x32ca90['include']=[{'all':!![]}];}return db[_0x3189('0x44')][_0x3189('0x46')](_0x32ca90);})[_0x3189('0x2c')](function(_0x3a6a36){_0x374f23[_0x3189('0x47')]=_0x3a6a36;return _0x374f23;})['then'](respondWithFilteredResult(_0x51ce54,_0x32ca90))['catch'](handleError(_0x51ce54,null));};exports[_0x3189('0x48')]=function(_0x5ca360,_0x44e45f){var _0xf095fe={'raw':![],'where':{'id':_0x5ca360['params']['id']}},_0x1a3e51={};_0x1a3e51[_0x3189('0x35')]=_[_0x3189('0x37')](db[_0x3189('0x44')]['rawAttributes']);_0x1a3e51[_0x3189('0x36')]=_[_0x3189('0x37')](_0x5ca360[_0x3189('0x36')]);_0x1a3e51[_0x3189('0x38')]=_[_0x3189('0x3a')](_0x1a3e51[_0x3189('0x35')],_0x1a3e51['query']);_0xf095fe['attributes']=_[_0x3189('0x3a')](_0x1a3e51['model'],qs['fields'](_0x5ca360[_0x3189('0x36')]['fields']));_0xf095fe[_0x3189('0x39')]=_0xf095fe[_0x3189('0x39')][_0x3189('0x49')]?_0xf095fe['attributes']:_0x1a3e51[_0x3189('0x35')];if(_0x5ca360['query'][_0x3189('0x45')]){_0xf095fe['include']=[{'all':!![]}];}_0xf095fe=_['merge']({},_0xf095fe,_0x5ca360[_0x3189('0x4a')]);return db['VoicePrefix'][_0x3189('0x4b')](_0xf095fe)['then'](handleEntityNotFound(_0x44e45f,null))['then'](respondWithResult(_0x44e45f,null))[_0x3189('0x4c')](handleError(_0x44e45f,null));};exports[_0x3189('0x2d')]=function(_0x4373f6,_0x35cb23){return db[_0x3189('0x44')][_0x3189('0x4b')]({'where':{'id':_0x4373f6['params']['id']}})[_0x3189('0x2c')](handleEntityNotFound(_0x35cb23,null))['then'](removeEntity(_0x35cb23,null))['catch'](handleError(_0x35cb23,null));};exports[_0x3189('0x4d')]=function(_0x4f641a,_0xd90868){return db[_0x3189('0x44')][_0x3189('0x4d')]()[_0x3189('0x2c')](respondWithResult(_0xd90868,null))['catch'](handleError(_0xd90868,null));};exports[_0x3189('0x4e')]=function(_0x4ad892,_0x35fdb2){var _0x242ec4;return db[_0x3189('0x4f')][_0x3189('0x50')](function(_0x4f41e5){return db[_0x3189('0x44')][_0x3189('0x4e')](_0x4ad892['body'],{'transaction':_0x4f41e5})[_0x3189('0x2c')](function(_0xbf07c5){_0x242ec4=_0xbf07c5[_0x3189('0x2e')]({'plain':!![]});return db[_0x3189('0x51')]['find']({'where':{'id':_0x242ec4[_0x3189('0x52')]},'raw':!![]})['then'](function(_0x1ebb0d){return createVoicePrefixExtensions(_0x242ec4,_0x1ebb0d,_0x4f41e5);});});})['then'](function(){var _0x460c6e=_0x4ad892[_0x3189('0x53')]['get']({'plain':!![]});if(!_0x460c6e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x460c6e['role']===_0x3189('0x53')){var _0x5b14ac=_0x242ec4;return db[_0x3189('0x54')][_0x3189('0x4b')]({'where':{'name':_0x3189('0x55'),'userProfileId':_0x460c6e[_0x3189('0x56')]},'raw':!![]})[_0x3189('0x2c')](function(_0x40623f){if(_0x40623f&&_0x40623f[_0x3189('0x57')]===0x0){return db[_0x3189('0x58')][_0x3189('0x4e')]({'name':_0x5b14ac['name'],'resourceId':_0x5b14ac['id'],'type':_0x40623f[_0x3189('0x30')],'sectionId':_0x40623f['id']},{})[_0x3189('0x2c')](function(){return _0x242ec4;});}else{return _0x242ec4;}})[_0x3189('0x4c')](function(_0x429de3){logger[_0x3189('0x2f')](_0x3189('0x59'),_0x429de3);throw _0x429de3;});}return _0x242ec4;})[_0x3189('0x2c')](respondWithResult(_0x35fdb2,null))[_0x3189('0x4c')](handleError(_0x35fdb2,null));};function Extension(_0xa1316a,_0x68de3c,_0x187877,_0x3a2fe6){this['context']='from-sip';this[_0x3189('0x5a')]=_0xa1316a;this[_0x3189('0x5b')]=_0x187877;this[_0x3189('0x33')]=_0x3189('0x5c');this[_0x3189('0x5d')]=_0x3189('0x5e');this[_0x3189('0x5f')]=_0x68de3c;this[_0x3189('0x60')]=_0x3a2fe6;}function createVoicePrefixExtensions(_0x120a8a,_0x1472b6,_0xd45395){return new BPromise(function(_0x4f0ccb,_0x5b31dd){var _0x57aae5=new Extension(formatPrefixName(_0x120a8a[_0x3189('0x61')]),0x1,_0x3189('0x62'),'Voice\x20Prefix');_0x57aae5[_0x3189('0x63')]=_0x120a8a['id'];return db[_0x3189('0x51')][_0x3189('0x4e')](_0x57aae5,{'transaction':_0xd45395})[_0x3189('0x2c')](function(_0x26fdf2){var _0x4875a2=_0x26fdf2[_0x3189('0x2e')]({'plain':!![]});var _0x35a4d1=_[_0x3189('0x32')](addVoicePrefixExtensions(_0x120a8a,_0x1472b6),function(_0x228dfc){_0x228dfc['VoiceExtensionId']=_0x4875a2['id'];_0x228dfc[_0x3189('0x63')]=_0x120a8a['id'];return _0x228dfc;});return db[_0x3189('0x51')][_0x3189('0x64')](_0x35a4d1,{'transaction':_0xd45395})[_0x3189('0x2c')](function(_0x4a7172){if(!_0x4a7172){return _0x5b31dd(_0x3189('0x65'));}else{return _0x4f0ccb(_0x4a7172);}})['catch'](function(_0x1d7a44){return _0x5b31dd(_0x1d7a44);});});;});};function addVoicePrefixExtensions(_0x448635,_0x10fe1b){var _0xb02b4f=[];var _0x55bcf0=formatPrefixName(_0x448635[_0x3189('0x61')]);_0xb02b4f[_0x3189('0x66')](new Extension(_0x55bcf0,0x2,_0x3189('0x67'),_0x3189('0x68')+_0x448635[_0x3189('0x30')]));if(_0x448635[_0x3189('0x69')]){_0xb02b4f['push'](new Extension(_0x55bcf0,0x3,_0x3189('0x67'),_0x3189('0x6a')+_0x448635[_0x3189('0x69')]));}else{_0xb02b4f[_0x3189('0x66')](new Extension(_0x55bcf0,0x3,_0x3189('0x62'),'No\x20callerid\x20available'));}_0xb02b4f[_0x3189('0x66')](new Extension(_0x55bcf0,0x4,'goto',_0x10fe1b[_0x3189('0x6b')]+','+_0x3189('0x6c')+(0x8+_0x448635[_0x3189('0x30')][_0x3189('0x49')])+'}'+','+0x1));return _0xb02b4f;}function formatPrefixName(_0x46faac){var _0x458db9='_';for(var _0x403d31=0x0;_0x403d31<_0x46faac[_0x3189('0x49')];_0x403d31++){if(_0x46faac['charAt'](_0x403d31)=='-'){_0x458db9+=_0x46faac[_0x3189('0x6d')](_0x403d31);}else{_0x458db9+='['+_0x46faac['charAt'](_0x403d31)+']';}}_0x458db9+='.';return _0x458db9;}exports[_0x3189('0x2b')]=function(_0x2eedf4,_0xf740b0,_0x1e08f4){var _0x3d11ac=_0x2eedf4[_0x3189('0x6e')];_0x3d11ac['prefix']=_0x3189('0x6f')+_0x3d11ac[_0x3189('0x30')]+'-';return db['sequelize'][_0x3189('0x50')](function(_0x50438f){return db[_0x3189('0x44')][_0x3189('0x2b')](_0x3d11ac,{'where':{'id':_0x3d11ac['id']},'transaction':_0x50438f})[_0x3189('0x2c')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x3d11ac['id']},'transaction':_0x50438f})[_0x3189('0x2c')](function(){return db[_0x3189('0x51')][_0x3189('0x4b')]({'where':{'id':_0x3d11ac['VoiceExtensionId']},'raw':!![]})[_0x3189('0x2c')](function(_0x285b0d){return createVoicePrefixExtensions(_0x3d11ac,_0x285b0d,_0x50438f);});});});})['then'](function(){return db[_0x3189('0x44')][_0x3189('0x70')](_0x3d11ac['id']);})[_0x3189('0x2c')](respondWithResult(_0xf740b0,null))['catch'](handleError(_0xf740b0,null));};exports[_0x3189('0x71')]=function(_0x28bbe6,_0x3ab88e,_0x5d3478){return db['VoicePrefix'][_0x3189('0x4b')]({'where':{'id':_0x28bbe6[_0x3189('0x72')]['id']}})[_0x3189('0x2c')](handleEntityNotFound(_0x3ab88e,null))['then'](function(_0x1f57c7){if(_0x1f57c7){return _0x1f57c7[_0x3189('0x71')](_0x28bbe6[_0x3189('0x6e')][_0x3189('0x73')],_[_0x3189('0x74')](_0x28bbe6[_0x3189('0x6e')],[_0x3189('0x73'),'id'])||{})[_0x3189('0x75')](function(_0x2c110e){for(var _0x41d415=0x0;_0x41d415<_0x28bbe6['body'][_0x3189('0x73')][_0x3189('0x49')];_0x41d415+=0x1){socket[_0x3189('0x76')](_0x3189('0x77'),{'UserId':Number(_0x28bbe6[_0x3189('0x6e')][_0x3189('0x73')][_0x41d415]),'VoicePrefixId':Number(_0x28bbe6[_0x3189('0x72')]['id'])});}return _0x2c110e;});}})[_0x3189('0x2c')](respondWithResult(_0x3ab88e,null))['catch'](handleError(_0x3ab88e,null));};exports[_0x3189('0x78')]=function(_0x4861ba,_0x226a58,_0x176c44){return db[_0x3189('0x44')][_0x3189('0x4b')]({'where':{'id':_0x4861ba['params']['id']}})['then'](handleEntityNotFound(_0x226a58,null))[_0x3189('0x2c')](function(_0x2c0e85){if(_0x2c0e85){return _0x2c0e85[_0x3189('0x78')](_0x4861ba[_0x3189('0x36')]['ids'])[_0x3189('0x2c')](function(){if(_[_0x3189('0x79')](_0x4861ba['query'][_0x3189('0x73')])){for(var _0x65c13f=0x0;_0x65c13f<_0x4861ba['query'][_0x3189('0x73')][_0x3189('0x49')];_0x65c13f+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x4861ba[_0x3189('0x36')]['ids'][_0x65c13f]),'VoicePrefixId':Number(_0x4861ba[_0x3189('0x72')]['id'])});}}else{socket[_0x3189('0x76')](_0x3189('0x7a'),{'UserId':Number(_0x4861ba[_0x3189('0x36')][_0x3189('0x73')]),'VoicePrefixId':Number(_0x4861ba['params']['id'])});}});}})['then'](respondWithStatusCode(_0x226a58,null))[_0x3189('0x4c')](handleError(_0x226a58,null));};exports['getAgents']=function(_0x33b271,_0x5c138a,_0x583d35){var _0x51303a={};var _0x278553={};var _0x4917e3;var _0x2d3d78;return db[_0x3189('0x44')][_0x3189('0x7b')]({'where':{'id':_0x33b271[_0x3189('0x72')]['id']}})[_0x3189('0x2c')](handleEntityNotFound(_0x5c138a,null))[_0x3189('0x2c')](function(_0x4d3554){if(_0x4d3554){_0x4917e3=_0x4d3554;_0x278553[_0x3189('0x35')]=_[_0x3189('0x37')](db[_0x3189('0x7c')][_0x3189('0x7d')]);_0x278553[_0x3189('0x36')]=_['keys'](_0x33b271[_0x3189('0x36')]);_0x278553[_0x3189('0x38')]=_[_0x3189('0x3a')](_0x278553[_0x3189('0x35')],_0x278553[_0x3189('0x36')]);_0x51303a['attributes']=_[_0x3189('0x3a')](_0x278553[_0x3189('0x35')],qs[_0x3189('0x3b')](_0x33b271[_0x3189('0x36')][_0x3189('0x3b')]));_0x51303a[_0x3189('0x39')]=_0x51303a[_0x3189('0x39')][_0x3189('0x49')]?_0x51303a[_0x3189('0x39')]:_0x278553[_0x3189('0x35')];_0x51303a['order']=qs[_0x3189('0x3f')](_0x33b271[_0x3189('0x36')][_0x3189('0x3f')]);_0x51303a[_0x3189('0x40')]=qs[_0x3189('0x38')](_[_0x3189('0x7e')](_0x33b271['query'],_0x278553[_0x3189('0x38')]));if(_0x33b271['query'][_0x3189('0x41')]){_0x51303a['where']=_[_0x3189('0x42')](_0x51303a['where'],{'$or':_[_0x3189('0x32')](_0x51303a['attributes'],function(_0x3a84e8){var _0x17b46a={};_0x17b46a[_0x3a84e8]={'$like':'%'+_0x33b271['query'][_0x3189('0x41')]+'%'};return _0x17b46a;})});}_0x51303a=_[_0x3189('0x42')]({},_0x51303a,_0x33b271[_0x3189('0x4a')]);return _0x4917e3[_0x3189('0x7f')](_0x51303a);}})[_0x3189('0x2c')](function(_0x549bbd){if(_0x549bbd){_0x2d3d78=_0x549bbd['length'];if(!_0x33b271[_0x3189('0x36')][_0x3189('0x3c')](_0x3189('0x3d'))){_0x51303a[_0x3189('0x24')]=qs[_0x3189('0x24')](_0x33b271[_0x3189('0x36')]['limit']);_0x51303a[_0x3189('0x23')]=qs[_0x3189('0x23')](_0x33b271['query'][_0x3189('0x23')]);}return _0x4917e3[_0x3189('0x7f')](_0x51303a);}})[_0x3189('0x2c')](function(_0x5d10f8){if(_0x5d10f8){return _0x5d10f8?{'count':_0x2d3d78,'rows':_0x5d10f8}:null;}})[_0x3189('0x2c')](respondWithResult(_0x5c138a,null))[_0x3189('0x4c')](handleError(_0x5c138a,null));};exports[_0x3189('0x80')]=function(_0x24fec5,_0x5a7cf4,_0x2ef30c){var _0x14cecc={};var _0x2165f1={};var _0x1b8666;var _0x5bbf36;return db[_0x3189('0x44')][_0x3189('0x7b')]({'where':{'id':_0x24fec5[_0x3189('0x72')]['id']}})[_0x3189('0x2c')](handleEntityNotFound(_0x5a7cf4,null))['then'](function(_0x4371b7){if(_0x4371b7){_0x1b8666=_0x4371b7;_0x2165f1[_0x3189('0x35')]=_[_0x3189('0x37')](db['Team'][_0x3189('0x7d')]);_0x2165f1['query']=_[_0x3189('0x37')](_0x24fec5['query']);_0x2165f1[_0x3189('0x38')]=_[_0x3189('0x3a')](_0x2165f1[_0x3189('0x35')],_0x2165f1[_0x3189('0x36')]);_0x14cecc['attributes']=_[_0x3189('0x3a')](_0x2165f1[_0x3189('0x35')],qs[_0x3189('0x3b')](_0x24fec5[_0x3189('0x36')][_0x3189('0x3b')]));_0x14cecc[_0x3189('0x39')]=_0x14cecc['attributes']['length']?_0x14cecc[_0x3189('0x39')]:_0x2165f1[_0x3189('0x35')];_0x14cecc['order']=qs[_0x3189('0x3f')](_0x24fec5[_0x3189('0x36')][_0x3189('0x3f')]);_0x14cecc[_0x3189('0x40')]=qs['filters'](_[_0x3189('0x7e')](_0x24fec5[_0x3189('0x36')],_0x2165f1[_0x3189('0x38')]));if(_0x24fec5[_0x3189('0x36')]['filter']){_0x14cecc[_0x3189('0x40')]=_[_0x3189('0x42')](_0x14cecc['where'],{'$or':_[_0x3189('0x32')](_0x14cecc[_0x3189('0x39')],function(_0x5eeb3d){var _0xe94bda={};_0xe94bda[_0x5eeb3d]={'$like':'%'+_0x24fec5[_0x3189('0x36')]['filter']+'%'};return _0xe94bda;})});}_0x14cecc=_[_0x3189('0x42')]({},_0x14cecc,_0x24fec5[_0x3189('0x4a')]);return _0x1b8666[_0x3189('0x80')](_0x14cecc);}})[_0x3189('0x2c')](function(_0x23d34e){if(_0x23d34e){_0x5bbf36=_0x23d34e[_0x3189('0x49')];if(!_0x24fec5['query'][_0x3189('0x3c')](_0x3189('0x3d'))){_0x14cecc[_0x3189('0x24')]=qs[_0x3189('0x24')](_0x24fec5[_0x3189('0x36')][_0x3189('0x24')]);_0x14cecc[_0x3189('0x23')]=qs[_0x3189('0x23')](_0x24fec5['query'][_0x3189('0x23')]);}return _0x1b8666[_0x3189('0x80')](_0x14cecc);}})['then'](function(_0x418ef8){if(_0x418ef8){return _0x418ef8?{'count':_0x5bbf36,'rows':_0x418ef8}:null;}})[_0x3189('0x2c')](respondWithResult(_0x5a7cf4,null))['catch'](handleError(_0x5a7cf4,null));};exports[_0x3189('0x81')]=function(_0x85c195,_0x4917ee,_0x2a8f73){var _0x464843=_0x85c195[_0x3189('0x6e')][_0x3189('0x73')];var _0x429bc1;return db[_0x3189('0x82')]['findAll']({'where':{'id':_0x464843},'attributes':['id'],'include':[{'model':db[_0x3189('0x7c')],'as':_0x3189('0x83'),'attributes':['id','name',_0x3189('0x84'),_0x3189('0x85'),'interface'],'raw':!![]}]})['then'](function(_0x158199){if(_0x158199){_0x429bc1=_0x158199;var _0x431e68=_[_0x3189('0x86')](_0x158199,function(_0x18d525){var _0x5e565c=_0x18d525['get']({'plain':!![]});return _0x5e565c[_0x3189('0x83')];});return db[_0x3189('0x44')]['find']({'where':{'id':_0x85c195[_0x3189('0x72')]['id']}})[_0x3189('0x2c')](function(_0x36262a){return db['sequelize'][_0x3189('0x50')](function(_0xd24f4a){return _0x36262a[_0x3189('0x81')](_0x464843,{'transaction':_0xd24f4a})[_0x3189('0x2c')](function(){return BPromise[_0x3189('0x87')](_0x429bc1,function(_0x33f64c){return db['TeamVoicePrefix'][_0x3189('0x88')]({'TeamId':_0x33f64c['id'],'VoicePrefixId':_0x85c195['params']['id']},{'transaction':_0xd24f4a});});})[_0x3189('0x2c')](function(){return BPromise[_0x3189('0x87')](_0x431e68,function(_0x1c919f){return db['UserVoicePrefix'][_0x3189('0x89')]({'where':{'UserId':_0x1c919f['id'],'VoicePrefixId':_0x85c195[_0x3189('0x72')]['id']},'transaction':_0xd24f4a});});})['then'](function(){_0x431e68[_0x3189('0x8a')](function(_0x2bab94){socket['emit'](_0x3189('0x77'),{'UserId':_0x2bab94['id'],'VoicePrefixId':_0x36262a['id']});});});});});}})[_0x3189('0x2c')](respondWithStatusCode(_0x4917ee,null))[_0x3189('0x4c')](handleError(_0x4917ee,null));};exports[_0x3189('0x8b')]=function(_0x39fe89,_0x4f564d,_0x341e23){return db['Team'][_0x3189('0x46')]({'where':{'id':_0x39fe89[_0x3189('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x3189('0x7c')],'as':_0x3189('0x83'),'attributes':['id'],'raw':!![]}]})[_0x3189('0x2c')](handleEntityNotFound(_0x4f564d,null))['then'](function(_0x4fb475){var _0x522aa5=_[_0x3189('0x32')](_0x4fb475,'id');var _0x1f0c98=[];var _0x3f5cf9=[];var _0x47ce18=squel['select']();_0x47ce18[_0x3189('0x8c')](_0x3189('0x8d'))[_0x3189('0x8e')](_0x3189('0x8f'),'tq')[_0x3189('0x90')]('user_has_teams','ut',_0x3189('0x91'))['where'](_0x3189('0x92'),_0x39fe89['params']['id']);for(var _0x241a67=0x0;_0x241a67<_0x4fb475[_0x3189('0x49')];_0x241a67+=0x1){let _0x51913c=_0x4fb475[_0x241a67];for(var _0x1a07d7=0x0;_0x1a07d7<_0x51913c[_0x3189('0x83')][_0x3189('0x49')];_0x1a07d7+=0x1){let _0x36602c=_0x51913c['Agents'][_0x1a07d7];var _0x1f9018=_0x47ce18[_0x3189('0x93')]();_0x1f9018[_0x3189('0x40')]('ut.UserId\x20=\x20?',_0x36602c['id']);_0x3f5cf9[_0x3189('0x66')](db[_0x3189('0x4f')][_0x3189('0x36')](_0x1f9018[_0x3189('0x94')](),{'type':db['sequelize'][_0x3189('0x95')][_0x3189('0x96')]})[_0x3189('0x2c')](function(_0x13fc9f){if(_0x13fc9f[_0x3189('0x49')]===0x1){return _0x36602c['id'];}else{var _0x516164=_[_0x3189('0x97')](_['map'](_0x13fc9f,_0x3189('0x98')),function(_0x1f506c){return _[_0x3189('0x99')](_0x522aa5,_0x1f506c);});if(_0x516164){return _0x36602c['id'];}}}));}}return BPromise[_0x3189('0x9a')](_0x3f5cf9)[_0x3189('0x2c')](function(_0x48835c){_0x1f0c98=_(_0x1f0c98)[_0x3189('0x9b')](_0x48835c)[_0x3189('0x9c')]()[_0x3189('0x9d')]();return db['VoicePrefix']['find']({'where':{'id':_0x39fe89[_0x3189('0x72')]['id']}})[_0x3189('0x2c')](function(_0x4c19e2){return db[_0x3189('0x4f')][_0x3189('0x50')](function(_0x5d89ec){return _0x4c19e2[_0x3189('0x8b')](_0x39fe89[_0x3189('0x36')][_0x3189('0x73')],{'transaction':_0x5d89ec})['then'](function(){if(!_[_0x3189('0x9e')](_0x1f0c98)){return _0x4c19e2[_0x3189('0x78')](_0x1f0c98,{'transaction':_0x5d89ec});}})['then'](function(){_0x1f0c98[_0x3189('0x8a')](function(_0xab746c){socket[_0x3189('0x76')](_0x3189('0x7a'),{'UserId':_0xab746c,'VoicePrefixId':_0x4c19e2['id']});});});});});});})[_0x3189('0x2c')](respondWithStatusCode(_0x4f564d,null))[_0x3189('0x4c')](handleError(_0x4f564d,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 1f1e2ca..6ce072b 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 _0x9785=['setMaxListeners','save','emit','hasOwnProperty','VoicePrefix'];(function(_0x3e3bee,_0x4f91fe){var _0x3ae14c=function(_0x3861a0){while(--_0x3861a0){_0x3e3bee['push'](_0x3e3bee['shift']());}};_0x3ae14c(++_0x4f91fe);}(_0x9785,0x90));var _0x5978=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0x9785[_0x4dcc2d];return _0x1bbd79;};'use strict';var EventEmitter=require('events');var VoicePrefix=require('../../mysqldb')['db'][_0x5978('0x0')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x5978('0x1')](0x0);var events={'afterCreate':_0x5978('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xa02e10){return function(_0x3bfe9c,_0x40b43e,_0x42c633){VoicePrefixEvents[_0x5978('0x3')](_0xa02e10+':'+_0x3bfe9c['id'],_0x3bfe9c);VoicePrefixEvents[_0x5978('0x3')](_0xa02e10,_0x3bfe9c);_0x42c633(null);};}for(var e in events){if(events[_0x5978('0x4')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0xba6e=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','update'];(function(_0x52478a,_0x2e57ce){var _0x391804=function(_0x2735ba){while(--_0x2735ba){_0x52478a['push'](_0x52478a['shift']());}};_0x391804(++_0x2e57ce);}(_0xba6e,0xa6));var _0xeba6=function(_0x3ff1bf,_0x2df206){_0x3ff1bf=_0x3ff1bf-0x0;var _0x29f3fd=_0xba6e[_0x3ff1bf];return _0x29f3fd;};'use strict';var EventEmitter=require(_0xeba6('0x0'));var VoicePrefix=require(_0xeba6('0x1'))['db'][_0xeba6('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xeba6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xeba6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5ed017){return function(_0x39e4a3,_0x43c819,_0x353137){VoicePrefixEvents['emit'](_0x5ed017+':'+_0x39e4a3['id'],_0x39e4a3);VoicePrefixEvents[_0xeba6('0x5')](_0x5ed017,_0x39e4a3);_0x353137(null);};}for(var e in events){if(events[_0xeba6('0x6')](e)){var event=events[e];VoicePrefix[_0xeba6('0x7')](e,emitEvent(event));}}module[_0xeba6('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index ed126f8..4824663 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 _0x98de=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','define','VoicePrefix','voice_prefixes','util','../../config/logger','api'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x98de,0x176));var _0xe98d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x98de[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xe98d('0x0'));var logger=require(_0xe98d('0x1'))(_0xe98d('0x2'));var moment=require(_0xe98d('0x3'));var BPromise=require(_0xe98d('0x4'));var rp=require(_0xe98d('0x5'));var fs=require('fs');var path=require(_0xe98d('0x6'));var rimraf=require(_0xe98d('0x7'));var config=require(_0xe98d('0x8'));var attributes=require(_0xe98d('0x9'));module['exports']=function(_0x279ce1,_0x5261dd){return _0x279ce1[_0xe98d('0xa')](_0xe98d('0xb'),attributes,{'tableName':_0xe98d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2128=['bluebird','request-promise','path','rimraf','./voicePrefix.attributes','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api'];(function(_0xfd60de,_0x242c1f){var _0x2435c0=function(_0x41f665){while(--_0x41f665){_0xfd60de['push'](_0xfd60de['shift']());}};_0x2435c0(++_0x242c1f);}(_0x2128,0xa4));var _0x8212=function(_0x208331,_0x16a0d0){_0x208331=_0x208331-0x0;var _0xa34762=_0x2128[_0x208331];return _0xa34762;};'use strict';var _=require(_0x8212('0x0'));var util=require(_0x8212('0x1'));var logger=require(_0x8212('0x2'))(_0x8212('0x3'));var moment=require('moment');var BPromise=require(_0x8212('0x4'));var rp=require(_0x8212('0x5'));var fs=require('fs');var path=require(_0x8212('0x6'));var rimraf=require(_0x8212('0x7'));var config=require('../../config/environment');var attributes=require(_0x8212('0x8'));module['exports']=function(_0x42541f,_0x3d409d){return _0x42541f[_0x8212('0x9')](_0x8212('0xa'),attributes,{'tableName':_0x8212('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 dbef734..3e99d0c 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 _0xffc0=['client','http','redis','localhost','socket.io-emitter','register','request','then','info','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x1e710b,_0x47b651){var _0x5d12b6=function(_0x2555d6){while(--_0x2555d6){_0x1e710b['push'](_0x1e710b['shift']());}};_0x5d12b6(++_0x47b651);}(_0xffc0,0x1a0));var _0x0ffc=function(_0x413d97,_0x45eb6c){_0x413d97=_0x413d97-0x0;var _0x242fcc=_0xffc0[_0x413d97];return _0x242fcc;};'use strict';var _=require('lodash');var util=require(_0x0ffc('0x0'));var moment=require('moment');var BPromise=require(_0x0ffc('0x1'));var rs=require(_0x0ffc('0x2'));var fs=require('fs');var Redis=require(_0x0ffc('0x3'));var db=require(_0x0ffc('0x4'))['db'];var utils=require(_0x0ffc('0x5'));var logger=require(_0x0ffc('0x6'))(_0x0ffc('0x7'));var config=require('../../config/environment');var jayson=require(_0x0ffc('0x8'));var client=jayson[_0x0ffc('0x9')][_0x0ffc('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0ffc('0xb')],{'host':_0x0ffc('0xc'),'port':0x18eb});var socket=require(_0x0ffc('0xd'))(new Redis(config[_0x0ffc('0xb')]));require('./voicePrefix.socket')[_0x0ffc('0xe')](socket);function respondWithRpcPromise(_0xfda6e3,_0x234549,_0x3dcb0e){return new BPromise(function(_0x20bfe1,_0x1ca057){return client[_0x0ffc('0xf')](_0xfda6e3,_0x3dcb0e)[_0x0ffc('0x10')](function(_0x481a0f){logger[_0x0ffc('0x11')](_0x0ffc('0x12'),_0x234549,'request\x20sent');logger[_0x0ffc('0x13')](_0x0ffc('0x14'),_0x234549,_0x0ffc('0x15'),JSON['stringify'](_0x481a0f));if(_0x481a0f[_0x0ffc('0x16')]){if(_0x481a0f[_0x0ffc('0x16')]['code']===0x1f4){logger[_0x0ffc('0x16')](_0x0ffc('0x12'),_0x234549,_0x481a0f[_0x0ffc('0x16')][_0x0ffc('0x17')]);return _0x1ca057(_0x481a0f[_0x0ffc('0x16')]['message']);}logger[_0x0ffc('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x234549,_0x481a0f[_0x0ffc('0x16')][_0x0ffc('0x17')]);return _0x20bfe1(_0x481a0f['error'][_0x0ffc('0x17')]);}else{logger['info']('VoicePrefix,\x20%s,\x20%s',_0x234549,'request\x20sent');_0x20bfe1(_0x481a0f['result'][_0x0ffc('0x17')]);}})[_0x0ffc('0x18')](function(_0x3fb92b){logger[_0x0ffc('0x16')](_0x0ffc('0x12'),_0x234549,_0x3fb92b);_0x1ca057(_0x3fb92b);});});} \ No newline at end of file +var _0x644f=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter','./voicePrefix.socket','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x644f,0x177));var _0xf644=function(_0x421196,_0x1cbd94){_0x421196=_0x421196-0x0;var _0x2738af=_0x644f[_0x421196];return _0x2738af;};'use strict';var _=require('lodash');var util=require(_0xf644('0x0'));var moment=require(_0xf644('0x1'));var BPromise=require(_0xf644('0x2'));var rs=require(_0xf644('0x3'));var fs=require('fs');var Redis=require(_0xf644('0x4'));var db=require(_0xf644('0x5'))['db'];var utils=require(_0xf644('0x6'));var logger=require(_0xf644('0x7'))(_0xf644('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf644('0x9')][_0xf644('0xa')]({'port':0x232a});config[_0xf644('0xb')]=_['defaults'](config[_0xf644('0xb')],{'host':_0xf644('0xc'),'port':0x18eb});var socket=require(_0xf644('0xd'))(new Redis(config[_0xf644('0xb')]));require(_0xf644('0xe'))['register'](socket);function respondWithRpcPromise(_0x35b8e5,_0x21e90a,_0x33a2c2){return new BPromise(function(_0xcd5688,_0x59d974){return client['request'](_0x35b8e5,_0x33a2c2)[_0xf644('0xf')](function(_0x517447){logger['info'](_0xf644('0x10'),_0x21e90a,_0xf644('0x11'));logger[_0xf644('0x12')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x21e90a,_0xf644('0x11'),JSON[_0xf644('0x13')](_0x517447));if(_0x517447[_0xf644('0x14')]){if(_0x517447[_0xf644('0x14')][_0xf644('0x15')]===0x1f4){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x21e90a,_0x517447['error']['message']);return _0x59d974(_0x517447['error'][_0xf644('0x16')]);}logger['error'](_0xf644('0x10'),_0x21e90a,_0x517447[_0xf644('0x14')][_0xf644('0x16')]);return _0xcd5688(_0x517447[_0xf644('0x14')][_0xf644('0x16')]);}else{logger['info']('VoicePrefix,\x20%s,\x20%s',_0x21e90a,_0xf644('0x11'));_0xcd5688(_0x517447[_0xf644('0x17')][_0xf644('0x16')]);}})[_0xf644('0x18')](function(_0x2b628d){logger[_0xf644('0x14')](_0xf644('0x10'),_0x21e90a,_0x2b628d);_0x59d974(_0x2b628d);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index b4dc162..bee18ad 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 _0xe706=['register','length','voicePrefix:','./voicePrefix.events','save','remove','emit','removeListener'];(function(_0x53377b,_0x166f23){var _0x39cba9=function(_0x4be07d){while(--_0x4be07d){_0x53377b['push'](_0x53377b['shift']());}};_0x39cba9(++_0x166f23);}(_0xe706,0xa3));var _0x6e70=function(_0x3a3b9e,_0xc59037){_0x3a3b9e=_0x3a3b9e-0x0;var _0x148103=_0xe706[_0x3a3b9e];return _0x148103;};'use strict';var VoicePrefixEvents=require(_0x6e70('0x0'));var events=[_0x6e70('0x1'),_0x6e70('0x2'),'update'];function createListener(_0x2cae77,_0x315629){return function(_0x2ca810){_0x315629[_0x6e70('0x3')](_0x2cae77,_0x2ca810);};}function removeListener(_0x142c27,_0x2164a4){return function(){VoicePrefixEvents[_0x6e70('0x4')](_0x142c27,_0x2164a4);};}exports[_0x6e70('0x5')]=function(_0x1b0389){for(var _0x4381d1=0x0,_0x36357b=events[_0x6e70('0x6')];_0x4381d1<_0x36357b;_0x4381d1++){var _0x45a2d4=events[_0x4381d1];var _0x188ed3=createListener(_0x6e70('0x7')+_0x45a2d4,_0x1b0389);VoicePrefixEvents['on'](_0x45a2d4,_0x188ed3);}}; \ No newline at end of file +var _0x37a4=['remove','removeListener','register','length','voicePrefix:','./voicePrefix.events'];(function(_0x321f18,_0x7cd432){var _0xbec2ee=function(_0x18bfa8){while(--_0x18bfa8){_0x321f18['push'](_0x321f18['shift']());}};_0xbec2ee(++_0x7cd432);}(_0x37a4,0xcb));var _0x437a=function(_0xacfbf8,_0x1a9146){_0xacfbf8=_0xacfbf8-0x0;var _0x53e719=_0x37a4[_0xacfbf8];return _0x53e719;};'use strict';var VoicePrefixEvents=require(_0x437a('0x0'));var events=['save',_0x437a('0x1'),'update'];function createListener(_0x421d01,_0x35f27e){return function(_0x1d6ff4){_0x35f27e['emit'](_0x421d01,_0x1d6ff4);};}function removeListener(_0x5f2883,_0xf52f1a){return function(){VoicePrefixEvents[_0x437a('0x2')](_0x5f2883,_0xf52f1a);};}exports[_0x437a('0x3')]=function(_0x1b637a){for(var _0x5f5067=0x0,_0x1c567f=events[_0x437a('0x4')];_0x5f5067<_0x1c567f;_0x5f5067++){var _0x5017ce=events[_0x5f5067];var _0x36270b=createListener(_0x437a('0x5')+_0x5017ce,_0x1b637a);VoicePrefixEvents['on'](_0x5017ce,_0x36270b);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index b796e8f..fdab1d1 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 _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(_0x1f47b2,_0x32ea9c){var _0xf37729=function(_0x15ed33){while(--_0x15ed33){_0x1f47b2['push'](_0x1f47b2['shift']());}};_0xf37729(++_0x32ea9c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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 +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(_0x359bbe,_0x5b7fcc){var _0x1b3353=function(_0x34b41c){while(--_0x34b41c){_0x359bbe['push'](_0x359bbe['shift']());}};_0x1b3353(++_0x5b7fcc);}(_0xb10b,0x12a));var _0xbb10=function(_0x23895f,_0x43e4a9){_0x23895f=_0x23895f-0x0;var _0x39cfc9=_0xb10b[_0x23895f];return _0x39cfc9;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 31939f2..26b9bbb 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 _0x8c85=['Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','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)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','linear','wrandom','rrordered','setDataValue','rrmemory','getDataValue','type','strategy','booked','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Busy\x20Retry\x20(min:1,\x20max:999)'];(function(_0x26ac39,_0x33e94d){var _0x5d7a31=function(_0x3e683){while(--_0x3e683){_0x26ac39['push'](_0x26ac39['shift']());}};_0x5d7a31(++_0x33e94d);}(_0x8c85,0x158));var _0x58c8=function(_0x56db19,_0x90c0a){_0x56db19=_0x56db19-0x0;var _0x660af8=_0x8c85[_0x56db19];return _0x660af8;};'use strict';var Sequelize=require(_0x58c8('0x0'));module[_0x58c8('0x1')]={'name':{'type':Sequelize[_0x58c8('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x58c8('0x3')](_0x58c8('0x4'),_0x58c8('0x5')),'allowNull':![],'defaultValue':_0x58c8('0x4')},'musiconhold':{'type':Sequelize[_0x58c8('0x2')],'defaultValue':_0x58c8('0x6')},'announce':{'type':Sequelize[_0x58c8('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x58c8('0x3')]('rr',_0x58c8('0x7'),_0x58c8('0x8'),_0x58c8('0x9'),_0x58c8('0xa'),'rrmemory',_0x58c8('0xb'),_0x58c8('0xc'),_0x58c8('0xd')),'allowNull':![],'defaultValue':_0x58c8('0x7'),'set':function(_0x5c8001){this[_0x58c8('0xe')]('strategy',_0x5c8001?_0x5c8001:_0x58c8('0xf'));},'get':function(){var _0x545897=this[_0x58c8('0x10')](_0x58c8('0x11'));var _0x4f2d18=this[_0x58c8('0x10')]('dialMethod');var _0x443b01=this[_0x58c8('0x10')](_0x58c8('0x12'));if(_0x545897===_0x58c8('0x4')){return _0x443b01;}if(_0x4f2d18===_0x58c8('0x13')&&_0x443b01===_0x58c8('0xf')||_0x4f2d18===_0x58c8('0x13')&&_0x443b01==='roundrobin'){return _0x443b01;}if(_0x4f2d18===_0x58c8('0x14')||_0x4f2d18===_0x58c8('0x15')||_0x4f2d18===_0x58c8('0x16')){return _0x443b01;}return null;}},'servicelevel':{'type':Sequelize[_0x58c8('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x58c8('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x58c8('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x58c8('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x58c8('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x58c8('0x3')](_0x58c8('0x18'),'no'),'defaultValue':_0x58c8('0x18')},'autopause':{'type':Sequelize[_0x58c8('0x3')](_0x58c8('0x18'),'no',_0x58c8('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x58c8('0x3')](_0x58c8('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x58c8('0x3')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x58c8('0x3')](_0x58c8('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x58c8('0x3')](_0x58c8('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x58c8('0x3')](_0x58c8('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x58c8('0x3')](_0x58c8('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x58c8('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x58c8('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x58c8('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x58c8('0x3')](_0x58c8('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x58c8('0x18'),'no'),'defaultValue':_0x58c8('0x18')},'announce_holdtime':{'type':Sequelize[_0x58c8('0x3')]('yes','no',_0x58c8('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x58c8('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x58c8('0x3')](_0x58c8('0x18'),'no')},'announce_position_limit':{'type':Sequelize[_0x58c8('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x58c8('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x58c8('0x2')]},'queue_youarenext':{'type':Sequelize[_0x58c8('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x58c8('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x58c8('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x58c8('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x58c8('0x2')]},'queue_quantity1':{'type':Sequelize[_0x58c8('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x58c8('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x58c8('0x1b')],'set':function(_0x295d48){this['setDataValue'](_0x58c8('0x1c'),_0x295d48?_0x295d48[_0x58c8('0x1d')](','):[]);},'get':function(){return this[_0x58c8('0x10')](_0x58c8('0x1c'))?this[_0x58c8('0x10')]('periodic_announce')[_0x58c8('0x1e')](','):[];}},'joinempty':{'type':Sequelize[_0x58c8('0x2')],'defaultValue':'yes','set':function(_0x279400){this[_0x58c8('0xe')](_0x58c8('0x1f'),_0x279400?_0x279400[_0x58c8('0x1d')](','):undefined);},'get':function(){return this[_0x58c8('0x10')]('joinempty')?this[_0x58c8('0x10')]('joinempty')[_0x58c8('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x593d32){this[_0x58c8('0xe')](_0x58c8('0x20'),_0x593d32?_0x593d32[_0x58c8('0x1d')](','):undefined);},'get':function(){return this[_0x58c8('0x10')](_0x58c8('0x20'))?this[_0x58c8('0x10')](_0x58c8('0x20'))[_0x58c8('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x58c8('0x3')](_0x58c8('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x58c8('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x58c8('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x58c8('0x3')](_0x58c8('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x58c8('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x35df6b){this['setDataValue'](_0x58c8('0x21'),_0x35df6b);if(_0x35df6b){if(this[_0x58c8('0x10')](_0x58c8('0x22'))<0x2){this[_0x58c8('0xe')](_0x58c8('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x58c8('0x23')],'defaultValue':0x0,'comment':_0x58c8('0x24')},'dialMethod':{'type':Sequelize[_0x58c8('0x3')](_0x58c8('0x25'),'progressive',_0x58c8('0x16'),_0x58c8('0x15'),_0x58c8('0x13')),'defaultValue':'progressive','comment':_0x58c8('0x26')},'dialLimitChannel':{'type':Sequelize[_0x58c8('0x17')](0x4)[_0x58c8('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x58c8('0x28')},'dialLimitQueue':{'type':Sequelize[_0x58c8('0x17')](0x4)[_0x58c8('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x58c8('0x29')](0x2)[_0x58c8('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x58c8('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0x58c8('0x3')](_0x58c8('0x2b'),_0x58c8('0x2c')),'defaultValue':_0x58c8('0x2c'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x58c8('0x29')](0x2)[_0x58c8('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x58c8('0x17')](0x3)[_0x58c8('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x58c8('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0x58c8('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x58c8('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x58c8('0x2e'),'comment':_0x58c8('0x2f')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x58c8('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x58c8('0x30')},'dialQueueProject':{'type':Sequelize[_0x58c8('0x2')],'comment':_0x58c8('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x58c8('0x17')](0x3)[_0x58c8('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x58c8('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x58c8('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x58c8('0x32')},'dialBusyRetryFrequency':{'type':Sequelize[_0x58c8('0x17')](0x5)[_0x58c8('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x58c8('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x58c8('0x17')](0x3)[_0x58c8('0x27')],'defaultValue':0x3,'comment':_0x58c8('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x58c8('0x17')](0x5)[_0x58c8('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x58c8('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0x58c8('0x17')](0x3)[_0x58c8('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x58c8('0x36')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x58c8('0x2')],'defaultValue':_0x58c8('0x37')},'dialPrefix':{'type':Sequelize[_0x58c8('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x58c8('0x3')](_0x58c8('0x38'),'never',_0x58c8('0x39')),'defaultValue':_0x58c8('0x38')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x58c8('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0x58c8('0x17')](0x9)[_0x58c8('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x58c8('0x17')](0x9)[_0x58c8('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x58c8('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x58c8('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x58c8('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x58c8('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0x58c8('0x17')](0x9)[_0x58c8('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x58c8('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x58c8('0x17')](0x9)[_0x58c8('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x58c8('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x58c8('0x17')](0x9)[_0x58c8('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x58c8('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x58c8('0x17')](0x5)[_0x58c8('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x58c8('0x17')](0x9)[_0x58c8('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x58c8('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x58c8('0x23')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x58c8('0x40'),_0x58c8('0x41')),'defaultValue':_0x58c8('0x40')},'dialQueueProject2':{'type':Sequelize[_0x58c8('0x2')],'comment':_0x58c8('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x58c8('0x23')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x58c8('0x23')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x58c8('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x58c8('0x42')},'dialCutDigit':{'type':Sequelize[_0x58c8('0x17')](0x3)[_0x58c8('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x58c8('0x43')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x58c8('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x58c8('0x17')](0x5)[_0x58c8('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x58c8('0x44')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x58c8('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x58c8('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x58c8('0x17')](0x5)[_0x58c8('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x58c8('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x58c8('0x17')](0x3)[_0x58c8('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x58c8('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x58c8('0x17')](0x5)[_0x58c8('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x58c8('0x48')},'dialMachineMaxRetry':{'type':Sequelize[_0x58c8('0x17')](0x3)[_0x58c8('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x58c8('0x49')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x58c8('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x58c8('0x17')](0x3)[_0x58c8('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x58c8('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x58c8('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x58c8('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x58c8('0x17')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x58c8('0x23')],'defaultValue':![],'comment':_0x58c8('0x4d'),'set':function(_0x21d8fb){if(!_0x21d8fb)this[_0x58c8('0xe')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x58c8('0x4e'),_0x21d8fb);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x58c8('0x17')](0x3)[_0x58c8('0x27')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x58c8('0x23')],'defaultValue':!![]}}; \ No newline at end of file +var _0x9d3f=['name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','rrordered','strategy','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','setDataValue','periodic_announce','join','getDataValue','joinempty','leavewhenempty','acw','wrapuptime','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','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','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#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,*,*,*','never','always','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','STRING'];(function(_0x307375,_0x271e83){var _0x5adea6=function(_0x5ab56a){while(--_0x5ab56a){_0x307375['push'](_0x307375['shift']());}};_0x5adea6(++_0x271e83);}(_0x9d3f,0x9a));var _0xf9d3=function(_0xcace0f,_0x3de18a){_0xcace0f=_0xcace0f-0x0;var _0x20d145=_0x9d3f[_0xcace0f];return _0x20d145;};'use strict';var Sequelize=require(_0xf9d3('0x0'));module['exports']={'name':{'type':Sequelize[_0xf9d3('0x1')],'allowNull':![],'unique':_0xf9d3('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xf9d3('0x3')](_0xf9d3('0x4'),_0xf9d3('0x5')),'allowNull':![],'defaultValue':_0xf9d3('0x4')},'musiconhold':{'type':Sequelize[_0xf9d3('0x1')],'defaultValue':_0xf9d3('0x6')},'announce':{'type':Sequelize[_0xf9d3('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0xf9d3('0x3')]('rr',_0xf9d3('0x7'),_0xf9d3('0x8'),_0xf9d3('0x9'),_0xf9d3('0xa'),_0xf9d3('0xb'),_0xf9d3('0xc'),'wrandom',_0xf9d3('0xd')),'allowNull':![],'defaultValue':'ringall','set':function(_0x59d364){this['setDataValue'](_0xf9d3('0xe'),_0x59d364?_0x59d364:_0xf9d3('0xb'));},'get':function(){var _0x45b39f=this['getDataValue']('type');var _0x41f3b0=this['getDataValue']('dialMethod');var _0x46ca9c=this['getDataValue']('strategy');if(_0x45b39f===_0xf9d3('0x4')){return _0x46ca9c;}if(_0x41f3b0===_0xf9d3('0xf')&&_0x46ca9c==='rrmemory'||_0x41f3b0==='booked'&&_0x46ca9c===_0xf9d3('0x10')){return _0x46ca9c;}if(_0x41f3b0===_0xf9d3('0x11')||_0x41f3b0===_0xf9d3('0x12')||_0x41f3b0===_0xf9d3('0x13')){return _0x46ca9c;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xf9d3('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xf9d3('0x14')](0xb)},'timeout':{'type':Sequelize[_0xf9d3('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xf9d3('0x1')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xf9d3('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xf9d3('0x3')](_0xf9d3('0x15'),'no'),'defaultValue':_0xf9d3('0x15')},'autopause':{'type':Sequelize[_0xf9d3('0x3')](_0xf9d3('0x15'),'no',_0xf9d3('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0xf9d3('0x3')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xf9d3('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xf9d3('0x3')](_0xf9d3('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM']('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xf9d3('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xf9d3('0x3')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xf9d3('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xf9d3('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xf9d3('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xf9d3('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xf9d3('0x3')](_0xf9d3('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xf9d3('0x3')](_0xf9d3('0x15'),'no'),'defaultValue':_0xf9d3('0x15')},'announce_holdtime':{'type':Sequelize[_0xf9d3('0x3')]('yes','no',_0xf9d3('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xf9d3('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xf9d3('0x3')](_0xf9d3('0x15'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0xf9d3('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xf9d3('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xf9d3('0x1')]},'queue_youarenext':{'type':Sequelize[_0xf9d3('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xf9d3('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xf9d3('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xf9d3('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xf9d3('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xf9d3('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xf9d3('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0xf9d3('0x1')]},'queue_quantity2':{'type':Sequelize[_0xf9d3('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0xf9d3('0x1')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x44f120){this[_0xf9d3('0x18')](_0xf9d3('0x19'),_0x44f120?_0x44f120[_0xf9d3('0x1a')](','):[]);},'get':function(){return this[_0xf9d3('0x1b')](_0xf9d3('0x19'))?this[_0xf9d3('0x1b')]('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize[_0xf9d3('0x1')],'defaultValue':_0xf9d3('0x15'),'set':function(_0xedb002){this['setDataValue'](_0xf9d3('0x1c'),_0xedb002?_0xedb002[_0xf9d3('0x1a')](','):undefined);},'get':function(){return this[_0xf9d3('0x1b')](_0xf9d3('0x1c'))?this['getDataValue']('joinempty')['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xf9d3('0x1')],'defaultValue':'no','set':function(_0x9e70f3){this[_0xf9d3('0x18')]('leavewhenempty',_0x9e70f3?_0x9e70f3[_0xf9d3('0x1a')](','):undefined);},'get':function(){return this[_0xf9d3('0x1b')](_0xf9d3('0x1d'))?this['getDataValue'](_0xf9d3('0x1d'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xf9d3('0x3')](_0xf9d3('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xf9d3('0x3')](_0xf9d3('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xf9d3('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xf9d3('0x3')](_0xf9d3('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf9d3('0x1')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x48d6e5){this[_0xf9d3('0x18')](_0xf9d3('0x1e'),_0x48d6e5);if(_0x48d6e5){if(this[_0xf9d3('0x1b')]('wrapuptime')<0x2){this['setDataValue'](_0xf9d3('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xf9d3('0x3')](_0xf9d3('0x20'),_0xf9d3('0x11'),'power','predictive',_0xf9d3('0xf')),'defaultValue':_0xf9d3('0x11'),'comment':_0xf9d3('0x21')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0xf9d3('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0xf9d3('0x14')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xf9d3('0x23')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0xf9d3('0x22')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xf9d3('0x3')](_0xf9d3('0x24'),_0xf9d3('0x25')),'defaultValue':_0xf9d3('0x25'),'comment':_0xf9d3('0x26')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xf9d3('0x27')](0x2)[_0xf9d3('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xf9d3('0x28')},'dialPredictiveInterval':{'type':Sequelize[_0xf9d3('0x14')](0x3)[_0xf9d3('0x22')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xf9d3('0x29')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf9d3('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf9d3('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xf9d3('0x14')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf9d3('0x2a')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0xf9d3('0x2b'),'comment':_0xf9d3('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0xf9d3('0x14')](0x3)[_0xf9d3('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf9d3('0x2d')},'dialQueueProject':{'type':Sequelize[_0xf9d3('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xf9d3('0x14')](0x3)[_0xf9d3('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf9d3('0x2e')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf9d3('0x14')](0x5)[_0xf9d3('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xf9d3('0x14')](0x3)[_0xf9d3('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf9d3('0x2f')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf9d3('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf9d3('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf9d3('0x14')](0x3)[_0xf9d3('0x22')],'defaultValue':0x3,'comment':_0xf9d3('0x31')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf9d3('0x14')](0x5)[_0xf9d3('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf9d3('0x32')},'dialGlobalMaxRetry':{'type':Sequelize[_0xf9d3('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xf9d3('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf9d3('0x1')],'defaultValue':_0xf9d3('0x33')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xf9d3('0x3')]('always',_0xf9d3('0x34'),'onlyIfOpen'),'defaultValue':_0xf9d3('0x35')},'dialAMDActive':{'type':Sequelize[_0xf9d3('0x36')],'defaultValue':0x0,'comment':_0xf9d3('0x37')},'dialAMDInitialSilence':{'type':Sequelize[_0xf9d3('0x14')](0x9)[_0xf9d3('0x22')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf9d3('0x38')},'dialAMDGreeting':{'type':Sequelize[_0xf9d3('0x14')](0x9)[_0xf9d3('0x22')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf9d3('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf9d3('0x14')](0x9)[_0xf9d3('0x22')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf9d3('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf9d3('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0xf9d3('0x14')](0x9)[_0xf9d3('0x22')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf9d3('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf9d3('0x14')](0x9)[_0xf9d3('0x22')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf9d3('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf9d3('0x14')](0x9)[_0xf9d3('0x22')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xf9d3('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf9d3('0x14')](0x5)[_0xf9d3('0x22')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf9d3('0x3f')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf9d3('0x14')](0x9)[_0xf9d3('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0xf9d3('0x14')](0x5)[_0xf9d3('0x22')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0xf9d3('0x36')],'defaultValue':0x0,'comment':_0xf9d3('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0xf9d3('0x3')](_0xf9d3('0x41'),_0xf9d3('0x42')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xf9d3('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0xf9d3('0x36')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf9d3('0x14')](0x3)[_0xf9d3('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf9d3('0x43')},'dialCutDigit':{'type':Sequelize[_0xf9d3('0x14')](0x3)[_0xf9d3('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf9d3('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf9d3('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf9d3('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf9d3('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf9d3('0x46')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf9d3('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf9d3('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf9d3('0x14')](0x3)[_0xf9d3('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf9d3('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf9d3('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf9d3('0x48')},'dialMachineMaxRetry':{'type':Sequelize[_0xf9d3('0x14')](0x3)[_0xf9d3('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xf9d3('0x14')](0x5)[_0xf9d3('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf9d3('0x49')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xf9d3('0x14')](0x3)[_0xf9d3('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xf9d3('0x14')](0x5)[_0xf9d3('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf9d3('0x4a')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf9d3('0x14')],'allowNull':!![],'comment':_0xf9d3('0x4b')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xf9d3('0x4c'),'set':function(_0x619851){if(!_0x619851)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xf9d3('0x18')](_0xf9d3('0x4d'),_0x619851);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xf9d3('0x14')](0x3)[_0xf9d3('0x22')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xf9d3('0x22')],'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 23861b0..5929fc0 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 _0x2314=['intersection','attributes','fields','length','order','sort','where','merge','VIRTUAL','options','include','findAll','catch','show','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','updatedAt','omit','getHoppers','findOne','CmHopper','hasOwnProperty','nolimit','VoiceQueueId','getHopperHistories','CmHopperHistory','rows','CmHopperFinal','pick','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','penalty','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','isNil','userVoiceQueue:save','User','field','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','TeamId','compact','removeTeams','isEmpty','removeAgents','forEach','emit','userVoiceQueue:remove','addAgents','ids','spread','push','format','SIP/%s','all','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','NOW()','ContactId','CmListId','ListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','into','phone\x20IS\x20NOT\x20NULL','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','squel','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','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','value','includes','find','type','UserProfileResource','error','stack','name','send','index','map','VoiceQueue','rawAttributes','fieldName','model','keys','query','filters'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x2314,0x1eb));var _0x4231=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0x2314[_0x1b4b23];return _0x2a325b;};'use strict';var emlformat=require(_0x4231('0x0'));var rimraf=require(_0x4231('0x1'));var zipdir=require(_0x4231('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4231('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4231('0x4'));var util=require(_0x4231('0x5'));var path=require('path');var sox=require(_0x4231('0x6'));var csv=require(_0x4231('0x7'));var ejs=require(_0x4231('0x8'));var fs=require('fs');var fs_extra=require(_0x4231('0x9'));var _=require('lodash');var squel=require(_0x4231('0xa'));var crypto=require('crypto');var jsforce=require(_0x4231('0xb'));var deskjs=require(_0x4231('0xc'));var toCsv=require(_0x4231('0x7'));var querystring=require('querystring');var Papa=require(_0x4231('0xd'));var Redis=require(_0x4231('0xe'));var authService=require(_0x4231('0xf'));var qs=require(_0x4231('0x10'));var as=require(_0x4231('0x11'));var hardwareService=require(_0x4231('0x12'));var logger=require(_0x4231('0x13'))(_0x4231('0x14'));var utils=require('../../config/utils');var config=require(_0x4231('0x15'));var licenseUtil=require(_0x4231('0x16'));var db=require(_0x4231('0x17'))['db'];config[_0x4231('0x18')]=_[_0x4231('0x19')](config[_0x4231('0x18')],{'host':_0x4231('0x1a'),'port':0x18eb});var socket=require(_0x4231('0x1b'))(new Redis(config[_0x4231('0x18')]));require('./voiceQueue.socket')[_0x4231('0x1c')](socket);function respondWithStatusCode(_0x1ec4ae,_0x46cd08){_0x46cd08=_0x46cd08||0xcc;return function(_0x2564c9){if(_0x2564c9){return _0x1ec4ae['sendStatus'](_0x46cd08);}return _0x1ec4ae[_0x4231('0x1d')](_0x46cd08)[_0x4231('0x1e')]();};}function respondWithResult(_0x2e8281,_0x4ca199){_0x4ca199=_0x4ca199||0xc8;return function(_0x50df6b){if(_0x50df6b){return _0x2e8281['status'](_0x4ca199)[_0x4231('0x1f')](_0x50df6b);}};}function respondWithFilteredResult(_0x1effa0,_0x11e29f){return function(_0x570710){if(_0x570710){var _0x15c76f=typeof _0x11e29f[_0x4231('0x20')]===_0x4231('0x21')&&typeof _0x11e29f[_0x4231('0x22')]===_0x4231('0x21');var _0x4a5753=_0x570710[_0x4231('0x23')];var _0x56f483=_0x15c76f?0x0:_0x11e29f[_0x4231('0x20')];var _0x226900=_0x15c76f?_0x570710[_0x4231('0x23')]:_0x11e29f['offset']+_0x11e29f[_0x4231('0x22')];var _0x4782ec;if(_0x226900>=_0x4a5753){_0x226900=_0x4a5753;_0x4782ec=0xc8;}else{_0x4782ec=0xce;}_0x1effa0['status'](_0x4782ec);return _0x1effa0[_0x4231('0x24')](_0x4231('0x25'),_0x56f483+'-'+_0x226900+'/'+_0x4a5753)[_0x4231('0x1f')](_0x570710);}return null;};}function patchUpdates(_0x5f3850){return function(_0xbfe579){try{jsonpatch[_0x4231('0x26')](_0xbfe579,_0x5f3850,!![]);}catch(_0x5e90e0){return BPromise['reject'](_0x5e90e0);}return _0xbfe579[_0x4231('0x27')]();};}function saveUpdates(_0x174378,_0x3b6007){return function(_0x55dbd4){if(_0x55dbd4){return _0x55dbd4[_0x4231('0x28')](_0x174378)[_0x4231('0x29')](function(_0x2b14a5){return _0x2b14a5;});}return null;};}function removeEntity(_0x28cbab,_0x468ff5){return function(_0xe1c79f){if(_0xe1c79f){return _0xe1c79f[_0x4231('0x2a')]()[_0x4231('0x29')](function(){var _0x8d90be=_0xe1c79f[_0x4231('0x2b')]({'plain':!![]});var _0x40d16d=[{'name':_0x4231('0x2c'),'value':_0x4231('0x2d'),'ignore':![]},{'name':_0x4231('0x2e'),'value':_0x4231('0x2f'),'ignore':![]}];var _0x3e0af1=_(_0x40d16d)[_0x4231('0x30')]('ignore')['map'](_0x4231('0x31'))[_0x4231('0x31')]();if(_[_0x4231('0x32')](_0x3e0af1,_0x8d90be['type'])){return;}var _0x5d4235=_[_0x4231('0x33')](_0x40d16d,[_0x4231('0x31'),_0x8d90be[_0x4231('0x34')]])['name'];return db[_0x4231('0x35')][_0x4231('0x2a')]({'where':{'type':_0x5d4235,'resourceId':_0x8d90be['id']}})['then'](function(){return _0xe1c79f;});})[_0x4231('0x29')](function(){_0x28cbab[_0x4231('0x1d')](0xcc)[_0x4231('0x1e')]();});}};}function handleEntityNotFound(_0x431ee8,_0x5b2ca5){return function(_0x357bf6){if(!_0x357bf6){_0x431ee8['sendStatus'](0x194);}return _0x357bf6;};}function handleError(_0x46fbbe,_0x1335ca){_0x1335ca=_0x1335ca||0x1f4;return function(_0x4d992c){logger[_0x4231('0x36')](_0x4d992c[_0x4231('0x37')]);if(_0x4d992c[_0x4231('0x38')]){delete _0x4d992c['name'];}_0x46fbbe[_0x4231('0x1d')](_0x1335ca)[_0x4231('0x39')](_0x4d992c);};}exports[_0x4231('0x3a')]=function(_0x17f725,_0x116490){var _0xfffaba={},_0x491c5e={},_0xccbe98={'count':0x0,'rows':[]};var _0x363d42=_[_0x4231('0x3b')](db[_0x4231('0x3c')][_0x4231('0x3d')],function(_0x35a63d){return{'name':_0x35a63d[_0x4231('0x3e')],'type':_0x35a63d['type']['key']};});_0x491c5e[_0x4231('0x3f')]=_[_0x4231('0x3b')](_0x363d42,_0x4231('0x38'));_0x491c5e['query']=_[_0x4231('0x40')](_0x17f725[_0x4231('0x41')]);_0x491c5e[_0x4231('0x42')]=_[_0x4231('0x43')](_0x491c5e[_0x4231('0x3f')],_0x491c5e[_0x4231('0x41')]);_0xfffaba[_0x4231('0x44')]=_[_0x4231('0x43')](_0x491c5e[_0x4231('0x3f')],qs['fields'](_0x17f725['query'][_0x4231('0x45')]));_0xfffaba[_0x4231('0x44')]=_0xfffaba[_0x4231('0x44')][_0x4231('0x46')]?_0xfffaba[_0x4231('0x44')]:_0x491c5e[_0x4231('0x3f')];if(!_0x17f725[_0x4231('0x41')]['hasOwnProperty']('nolimit')){_0xfffaba[_0x4231('0x22')]=qs[_0x4231('0x22')](_0x17f725[_0x4231('0x41')][_0x4231('0x22')]);_0xfffaba[_0x4231('0x20')]=qs[_0x4231('0x20')](_0x17f725[_0x4231('0x41')][_0x4231('0x20')]);}_0xfffaba[_0x4231('0x47')]=qs[_0x4231('0x48')](_0x17f725['query'][_0x4231('0x48')]);_0xfffaba[_0x4231('0x49')]=qs['filters'](_['pick'](_0x17f725[_0x4231('0x41')],_0x491c5e[_0x4231('0x42')]),_0x363d42);if(_0x17f725['query'][_0x4231('0x30')]){_0xfffaba[_0x4231('0x49')]=_[_0x4231('0x4a')](_0xfffaba[_0x4231('0x49')],{'$or':_[_0x4231('0x3b')](_0x363d42,function(_0x3510ad){if(_0x3510ad[_0x4231('0x34')]!==_0x4231('0x4b')){var _0x5e3727={};_0x5e3727[_0x3510ad['name']]={'$like':'%'+_0x17f725['query'][_0x4231('0x30')]+'%'};return _0x5e3727;}})});}_0xfffaba=_[_0x4231('0x4a')]({},_0xfffaba,_0x17f725[_0x4231('0x4c')]);var _0xda1e1={'where':_0xfffaba[_0x4231('0x49')]};return db['VoiceQueue'][_0x4231('0x23')](_0xda1e1)[_0x4231('0x29')](function(_0x73f809){_0xccbe98[_0x4231('0x23')]=_0x73f809;if(_0x17f725[_0x4231('0x41')]['includeAll']){_0xfffaba[_0x4231('0x4d')]=[{'all':!![]}];}return db[_0x4231('0x3c')][_0x4231('0x4e')](_0xfffaba);})[_0x4231('0x29')](function(_0x2d4c78){_0xccbe98['rows']=_0x2d4c78;return _0xccbe98;})['then'](respondWithFilteredResult(_0x116490,_0xfffaba))[_0x4231('0x4f')](handleError(_0x116490,null));};exports[_0x4231('0x50')]=function(_0x528361,_0x5756cd){var _0xc3b6ee={'raw':![],'where':{'id':_0x528361['params']['id']}},_0xeefc7a={};_0xeefc7a[_0x4231('0x3f')]=_[_0x4231('0x40')](db[_0x4231('0x3c')]['rawAttributes']);_0xeefc7a['query']=_['keys'](_0x528361[_0x4231('0x41')]);_0xeefc7a['filters']=_['intersection'](_0xeefc7a[_0x4231('0x3f')],_0xeefc7a['query']);_0xc3b6ee['attributes']=_['intersection'](_0xeefc7a[_0x4231('0x3f')],qs[_0x4231('0x45')](_0x528361[_0x4231('0x41')][_0x4231('0x45')]));_0xc3b6ee[_0x4231('0x44')]=_0xc3b6ee['attributes'][_0x4231('0x46')]?_0xc3b6ee[_0x4231('0x44')]:_0xeefc7a[_0x4231('0x3f')];if(_0x528361[_0x4231('0x41')][_0x4231('0x51')]){_0xc3b6ee['include']=[{'all':!![]}];}_0xc3b6ee=_[_0x4231('0x4a')]({},_0xc3b6ee,_0x528361[_0x4231('0x4c')]);return db[_0x4231('0x3c')][_0x4231('0x33')](_0xc3b6ee)['then'](handleEntityNotFound(_0x5756cd,null))[_0x4231('0x29')](respondWithResult(_0x5756cd,null))[_0x4231('0x4f')](handleError(_0x5756cd,null));};exports[_0x4231('0x52')]=function(_0x599bd4,_0x5030cd){return db[_0x4231('0x3c')][_0x4231('0x52')](_0x599bd4[_0x4231('0x53')],{})['then'](function(_0x135a0a){var _0xb5aef5=_0x599bd4[_0x4231('0x54')][_0x4231('0x2b')]({'plain':!![]});if(!_0xb5aef5)throw new Error(_0x4231('0x55'));if(_0xb5aef5[_0x4231('0x56')]===_0x4231('0x54')){var _0x3d1ee8=_0x135a0a[_0x4231('0x2b')]({'plain':!![]});var _0x5a763c=[{'name':_0x4231('0x2c'),'value':_0x4231('0x2d')},{'name':_0x4231('0x2e'),'value':'outbound'}];var _0x1c7ce9=_[_0x4231('0x33')](_0x5a763c,[_0x4231('0x31'),_0x3d1ee8[_0x4231('0x34')]])[_0x4231('0x38')];return db[_0x4231('0x57')][_0x4231('0x33')]({'where':{'name':_0x1c7ce9,'userProfileId':_0xb5aef5[_0x4231('0x58')]},'raw':!![]})['then'](function(_0x4c096b){if(_0x4c096b&&_0x4c096b[_0x4231('0x59')]===0x0){return db[_0x4231('0x35')]['create']({'name':_0x3d1ee8[_0x4231('0x38')],'resourceId':_0x3d1ee8['id'],'type':_0x4c096b[_0x4231('0x38')],'sectionId':_0x4c096b['id']},{})[_0x4231('0x29')](function(){return _0x135a0a;});}else{return _0x135a0a;}})['catch'](function(_0x569a3f){logger[_0x4231('0x36')](_0x4231('0x5a'),_0x569a3f);throw _0x569a3f;});}return _0x135a0a;})[_0x4231('0x29')](respondWithResult(_0x5030cd,0xc9))['catch'](handleError(_0x5030cd,null));};exports[_0x4231('0x5b')]=function(_0x5ef020,_0x3f37c9){var _0x4d8258={'where':{'id':_0x5ef020[_0x4231('0x5c')]['id']}},_0x150797={};_0x150797[_0x4231('0x3f')]=_[_0x4231('0x40')](db[_0x4231('0x3c')]['rawAttributes']);_0x4d8258[_0x4231('0x44')]=_[_0x4231('0x43')](_0x150797[_0x4231('0x3f')],qs['fields'](_0x5ef020['query'][_0x4231('0x45')]));_0x4d8258['attributes']=_0x4d8258['attributes'][_0x4231('0x46')]?_0x4d8258[_0x4231('0x44')]:_0x150797['model'];if(_0x5ef020['query'][_0x4231('0x51')]){_0x4d8258[_0x4231('0x4d')]=[{'all':!![]}];}_0x4d8258=_[_0x4231('0x4a')]({},_0x4d8258,_0x5ef020['options']);return db[_0x4231('0x3c')][_0x4231('0x33')](_0x4d8258)[_0x4231('0x29')](handleEntityNotFound(_0x3f37c9,null))['then'](function(_0x31fefd){if(_0x31fefd){var _0x407442=_0x31fefd[_0x4231('0x2b')]({'plain':!![]});_0x407442=qs['omit'](_0x407442,['id',_0x4231('0x5d'),_0x4231('0x5e')]);_0x5ef020[_0x4231('0x53')]=_[_0x4231('0x5f')](_0x5ef020[_0x4231('0x53')],['id','createdAt','updatedAt']);return db[_0x4231('0x3c')][_0x4231('0x52')](_[_0x4231('0x4a')](_0x407442,_0x5ef020['body']),{'include':_0x5ef020[_0x4231('0x41')]['includeAll']?[{'all':!![]}]:undefined})[_0x4231('0x29')](function(_0x4a3322){var _0x5703a9=_0x5ef020['user'][_0x4231('0x2b')]({'plain':!![]});if(!_0x5703a9)throw new Error(_0x4231('0x55'));if(_0x5703a9['role']==='user'){var _0x54f7d3=_0x4a3322[_0x4231('0x2b')]({'plain':!![]});var _0x4c88c8=[{'name':'VoiceQueues','value':'inbound'},{'name':_0x4231('0x2e'),'value':_0x4231('0x2f')}];var _0x247857=_[_0x4231('0x33')](_0x4c88c8,['value',_0x54f7d3[_0x4231('0x34')]])[_0x4231('0x38')];return db[_0x4231('0x57')]['find']({'where':{'name':_0x247857,'userProfileId':_0x5703a9[_0x4231('0x58')]},'raw':!![]})['then'](function(_0x398cc5){if(_0x398cc5&&_0x398cc5['autoAssociation']===0x0){return db[_0x4231('0x35')][_0x4231('0x52')]({'name':_0x54f7d3['name'],'resourceId':_0x54f7d3['id'],'type':_0x398cc5[_0x4231('0x38')],'sectionId':_0x398cc5['id']},{})[_0x4231('0x29')](function(){return _0x4a3322;});}else{return _0x4a3322;}})[_0x4231('0x4f')](function(_0x3e1803){logger['error'](_0x4231('0x5a'),_0x3e1803);throw _0x3e1803;});}return _0x4a3322;});}})[_0x4231('0x29')](respondWithResult(_0x3f37c9,0xc9))[_0x4231('0x4f')](handleError(_0x3f37c9,null));};exports[_0x4231('0x28')]=function(_0x499061,_0x315bb4){if(_0x499061[_0x4231('0x53')]['id']){delete _0x499061[_0x4231('0x53')]['id'];}return db[_0x4231('0x3c')][_0x4231('0x33')]({'where':{'id':_0x499061[_0x4231('0x5c')]['id']}})['then'](handleEntityNotFound(_0x315bb4,null))[_0x4231('0x29')](saveUpdates(_0x499061[_0x4231('0x53')],null))[_0x4231('0x29')](respondWithResult(_0x315bb4,null))['catch'](handleError(_0x315bb4,null));};exports[_0x4231('0x2a')]=function(_0x31bbe3,_0x49f81d){return db[_0x4231('0x3c')]['find']({'where':{'id':_0x31bbe3[_0x4231('0x5c')]['id']}})[_0x4231('0x29')](handleEntityNotFound(_0x49f81d,null))[_0x4231('0x29')](removeEntity(_0x49f81d,null))[_0x4231('0x4f')](handleError(_0x49f81d,null));};exports[_0x4231('0x60')]=function(_0x4d27d9,_0x366b89,_0x1ce01a){var _0x4ed650={'raw':![],'where':{}};var _0xb0d01e={};var _0x16ec26={'count':0x0,'rows':[]};return db[_0x4231('0x3c')][_0x4231('0x61')]({'where':{'id':_0x4d27d9[_0x4231('0x5c')]['id']}})[_0x4231('0x29')](handleEntityNotFound(_0x366b89,null))['then'](function(_0x12c4e5){if(_0x12c4e5){_0xb0d01e[_0x4231('0x3f')]=_[_0x4231('0x40')](db[_0x4231('0x62')][_0x4231('0x3d')]);_0xb0d01e[_0x4231('0x41')]=_['keys'](_0x4d27d9[_0x4231('0x41')]);_0xb0d01e[_0x4231('0x42')]=_['intersection'](_0xb0d01e[_0x4231('0x3f')],_0xb0d01e[_0x4231('0x41')]);_0x4ed650[_0x4231('0x44')]=_[_0x4231('0x43')](_0xb0d01e['model'],qs[_0x4231('0x45')](_0x4d27d9[_0x4231('0x41')][_0x4231('0x45')]));_0x4ed650[_0x4231('0x44')]=_0x4ed650['attributes'][_0x4231('0x46')]?_0x4ed650[_0x4231('0x44')]:_0xb0d01e[_0x4231('0x3f')];if(!_0x4d27d9['query'][_0x4231('0x63')](_0x4231('0x64'))){_0x4ed650[_0x4231('0x22')]=qs[_0x4231('0x22')](_0x4d27d9['query']['limit']);_0x4ed650[_0x4231('0x20')]=qs['offset'](_0x4d27d9[_0x4231('0x41')][_0x4231('0x20')]);}_0x4ed650[_0x4231('0x47')]=qs[_0x4231('0x48')](_0x4d27d9[_0x4231('0x41')][_0x4231('0x48')]);_0x4ed650[_0x4231('0x49')]=qs[_0x4231('0x42')](_['pick'](_0x4d27d9[_0x4231('0x41')],_0xb0d01e[_0x4231('0x42')]));_0x4ed650[_0x4231('0x49')][_0x4231('0x65')]=_0x12c4e5['id'];if(_0x4d27d9[_0x4231('0x41')][_0x4231('0x30')]){_0x4ed650['where']=_[_0x4231('0x4a')](_0x4ed650[_0x4231('0x49')],{'$or':_[_0x4231('0x3b')](_0x4ed650[_0x4231('0x44')],function(_0x5c7506){var _0x47fc5f={};_0x47fc5f[_0x5c7506]={'$like':'%'+_0x4d27d9[_0x4231('0x41')][_0x4231('0x30')]+'%'};return _0x47fc5f;})});}_0x4ed650=_[_0x4231('0x4a')]({},_0x4ed650,_0x4d27d9[_0x4231('0x4c')]);return db[_0x4231('0x62')][_0x4231('0x23')]({'where':_0x4ed650['where']})['then'](function(_0x53e910){_0x16ec26[_0x4231('0x23')]=_0x53e910;if(_0x4d27d9[_0x4231('0x41')][_0x4231('0x51')]){_0x4ed650[_0x4231('0x4d')]=[{'all':!![]}];}return db['CmHopper'][_0x4231('0x4e')](_0x4ed650);})[_0x4231('0x29')](function(_0x46299f){_0x16ec26['rows']=_0x46299f;return _0x16ec26;});}})[_0x4231('0x29')](respondWithFilteredResult(_0x366b89,_0x4ed650))[_0x4231('0x4f')](handleError(_0x366b89,null));};exports[_0x4231('0x66')]=function(_0xd90348,_0x95dfec,_0x3a8daa){var _0x115a22={'raw':!![],'where':{}};var _0x4e9f4d={};var _0x1f5a3e={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0xd90348['params']['id']}})[_0x4231('0x29')](handleEntityNotFound(_0x95dfec,null))[_0x4231('0x29')](function(_0xf27a86){if(_0xf27a86){_0x4e9f4d[_0x4231('0x3f')]=_[_0x4231('0x40')](db[_0x4231('0x67')]['rawAttributes']);_0x4e9f4d[_0x4231('0x41')]=_['keys'](_0xd90348[_0x4231('0x41')]);_0x4e9f4d[_0x4231('0x42')]=_[_0x4231('0x43')](_0x4e9f4d[_0x4231('0x3f')],_0x4e9f4d[_0x4231('0x41')]);_0x115a22[_0x4231('0x44')]=_[_0x4231('0x43')](_0x4e9f4d['model'],qs[_0x4231('0x45')](_0xd90348['query']['fields']));_0x115a22[_0x4231('0x44')]=_0x115a22[_0x4231('0x44')]['length']?_0x115a22[_0x4231('0x44')]:_0x4e9f4d[_0x4231('0x3f')];if(!_0xd90348[_0x4231('0x41')][_0x4231('0x63')]('nolimit')){_0x115a22['limit']=qs['limit'](_0xd90348[_0x4231('0x41')][_0x4231('0x22')]);_0x115a22[_0x4231('0x20')]=qs[_0x4231('0x20')](_0xd90348[_0x4231('0x41')][_0x4231('0x20')]);}_0x115a22['order']=qs[_0x4231('0x48')](_0xd90348[_0x4231('0x41')]['sort']);_0x115a22['where']=qs[_0x4231('0x42')](_['pick'](_0xd90348['query'],_0x4e9f4d['filters']));_0x115a22['where'][_0x4231('0x65')]=_0xf27a86['id'];if(_0xd90348[_0x4231('0x41')][_0x4231('0x30')]){_0x115a22['where']=_[_0x4231('0x4a')](_0x115a22[_0x4231('0x49')],{'$or':_['map'](_0x115a22[_0x4231('0x44')],function(_0x400aea){var _0x5e29a5={};_0x5e29a5[_0x400aea]={'$like':'%'+_0xd90348[_0x4231('0x41')][_0x4231('0x30')]+'%'};return _0x5e29a5;})});}_0x115a22=_[_0x4231('0x4a')]({},_0x115a22,_0xd90348[_0x4231('0x4c')]);return db[_0x4231('0x67')][_0x4231('0x23')]({'where':_0x115a22[_0x4231('0x49')]})[_0x4231('0x29')](function(_0x3df1b4){_0x1f5a3e[_0x4231('0x23')]=_0x3df1b4;if(_0xd90348['query'][_0x4231('0x51')]){_0x115a22['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x115a22);})[_0x4231('0x29')](function(_0x2a5a48){_0x1f5a3e[_0x4231('0x68')]=_0x2a5a48;return _0x1f5a3e;});}})[_0x4231('0x29')](respondWithFilteredResult(_0x95dfec,_0x115a22))['catch'](handleError(_0x95dfec,null));};exports['getHopperFinals']=function(_0x366c9a,_0x4167cd,_0x43cba0){var _0x41221a={'raw':!![],'where':{}};var _0x3023a2={};var _0x25320a={'count':0x0,'rows':[]};return db[_0x4231('0x3c')][_0x4231('0x61')]({'where':{'id':_0x366c9a[_0x4231('0x5c')]['id']}})[_0x4231('0x29')](handleEntityNotFound(_0x4167cd,null))[_0x4231('0x29')](function(_0x344277){if(_0x344277){_0x3023a2[_0x4231('0x3f')]=_[_0x4231('0x40')](db[_0x4231('0x69')][_0x4231('0x3d')]);_0x3023a2['query']=_[_0x4231('0x40')](_0x366c9a[_0x4231('0x41')]);_0x3023a2[_0x4231('0x42')]=_[_0x4231('0x43')](_0x3023a2[_0x4231('0x3f')],_0x3023a2['query']);_0x41221a['attributes']=_[_0x4231('0x43')](_0x3023a2['model'],qs[_0x4231('0x45')](_0x366c9a[_0x4231('0x41')][_0x4231('0x45')]));_0x41221a[_0x4231('0x44')]=_0x41221a[_0x4231('0x44')]['length']?_0x41221a[_0x4231('0x44')]:_0x3023a2[_0x4231('0x3f')];if(!_0x366c9a[_0x4231('0x41')][_0x4231('0x63')]('nolimit')){_0x41221a['limit']=qs['limit'](_0x366c9a[_0x4231('0x41')][_0x4231('0x22')]);_0x41221a['offset']=qs[_0x4231('0x20')](_0x366c9a[_0x4231('0x41')][_0x4231('0x20')]);}_0x41221a[_0x4231('0x47')]=qs[_0x4231('0x48')](_0x366c9a['query'][_0x4231('0x48')]);_0x41221a[_0x4231('0x49')]=qs['filters'](_[_0x4231('0x6a')](_0x366c9a['query'],_0x3023a2[_0x4231('0x42')]));_0x41221a[_0x4231('0x49')][_0x4231('0x65')]=_0x344277['id'];if(_0x366c9a['query'][_0x4231('0x30')]){_0x41221a[_0x4231('0x49')]=_['merge'](_0x41221a[_0x4231('0x49')],{'$or':_[_0x4231('0x3b')](_0x41221a['attributes'],function(_0x112c6a){var _0x39e75f={};_0x39e75f[_0x112c6a]={'$like':'%'+_0x366c9a[_0x4231('0x41')][_0x4231('0x30')]+'%'};return _0x39e75f;})});}_0x41221a=_[_0x4231('0x4a')]({},_0x41221a,_0x366c9a['options']);return db['CmHopperFinal'][_0x4231('0x23')]({'where':_0x41221a[_0x4231('0x49')]})['then'](function(_0x273529){_0x25320a[_0x4231('0x23')]=_0x273529;if(_0x366c9a[_0x4231('0x41')][_0x4231('0x51')]){_0x41221a[_0x4231('0x4d')]=[{'all':!![]}];}return db[_0x4231('0x69')]['findAll'](_0x41221a);})['then'](function(_0x2262d2){_0x25320a[_0x4231('0x68')]=_0x2262d2;return _0x25320a;});}})[_0x4231('0x29')](respondWithFilteredResult(_0x4167cd,_0x41221a))[_0x4231('0x4f')](handleError(_0x4167cd,null));};exports[_0x4231('0x6b')]=function(_0x13384a,_0x128d64,_0x4d2664){var _0x194704={'raw':!![],'where':{}};var _0x614caf={};var _0x4e92c7={'count':0x0,'rows':[]};return db[_0x4231('0x3c')][_0x4231('0x61')]({'where':{'id':_0x13384a[_0x4231('0x5c')]['id']}})[_0x4231('0x29')](handleEntityNotFound(_0x128d64,null))['then'](function(_0x24c290){if(_0x24c290){_0x614caf[_0x4231('0x3f')]=_['keys'](db[_0x4231('0x6c')][_0x4231('0x3d')]);_0x614caf[_0x4231('0x41')]=_[_0x4231('0x40')](_0x13384a['query']);_0x614caf[_0x4231('0x42')]=_[_0x4231('0x43')](_0x614caf[_0x4231('0x3f')],_0x614caf[_0x4231('0x41')]);_0x194704['attributes']=_[_0x4231('0x43')](_0x614caf[_0x4231('0x3f')],qs[_0x4231('0x45')](_0x13384a[_0x4231('0x41')][_0x4231('0x45')]));_0x194704[_0x4231('0x44')]=_0x194704[_0x4231('0x44')][_0x4231('0x46')]?_0x194704[_0x4231('0x44')]:_0x614caf[_0x4231('0x3f')];if(!_0x13384a[_0x4231('0x41')][_0x4231('0x63')]('nolimit')){_0x194704[_0x4231('0x22')]=qs[_0x4231('0x22')](_0x13384a[_0x4231('0x41')][_0x4231('0x22')]);_0x194704['offset']=qs[_0x4231('0x20')](_0x13384a['query'][_0x4231('0x20')]);}_0x194704['order']=qs[_0x4231('0x48')](_0x13384a[_0x4231('0x41')][_0x4231('0x48')]);_0x194704[_0x4231('0x49')]=qs[_0x4231('0x42')](_[_0x4231('0x6a')](_0x13384a['query'],_0x614caf[_0x4231('0x42')]));_0x194704[_0x4231('0x49')][_0x4231('0x65')]=_0x24c290['id'];if(_0x13384a[_0x4231('0x41')][_0x4231('0x30')]){_0x194704['where']=_[_0x4231('0x4a')](_0x194704[_0x4231('0x49')],{'$or':_[_0x4231('0x3b')](_0x194704[_0x4231('0x44')],function(_0x36ad4b){var _0x1a6fad={};_0x1a6fad[_0x36ad4b]={'$like':'%'+_0x13384a[_0x4231('0x41')][_0x4231('0x30')]+'%'};return _0x1a6fad;})});}_0x194704=_['merge']({},_0x194704,_0x13384a[_0x4231('0x4c')]);return db['CmHopperBlack']['count']({'where':_0x194704[_0x4231('0x49')]})[_0x4231('0x29')](function(_0x3937e6){_0x4e92c7[_0x4231('0x23')]=_0x3937e6;if(_0x13384a[_0x4231('0x41')]['includeAll']){_0x194704[_0x4231('0x4d')]=[{'all':!![]}];}return db[_0x4231('0x6c')][_0x4231('0x4e')](_0x194704);})['then'](function(_0x16f9dc){_0x4e92c7[_0x4231('0x68')]=_0x16f9dc;return _0x4e92c7;});}})[_0x4231('0x29')](respondWithFilteredResult(_0x128d64,_0x194704))['catch'](handleError(_0x128d64,null));};exports[_0x4231('0x6d')]=function(_0x4cd466,_0x162ce2,_0x2f5c4d){var _0x19bf1f={};var _0x151e4f={};var _0x678c15;var _0x125a92;return db[_0x4231('0x3c')][_0x4231('0x61')]({'where':{'id':_0x4cd466[_0x4231('0x5c')]['id']}})[_0x4231('0x29')](handleEntityNotFound(_0x162ce2,null))[_0x4231('0x29')](function(_0x26071c){if(_0x26071c){_0x678c15=_0x26071c;_0x151e4f['model']=_['keys'](db[_0x4231('0x6e')]['rawAttributes']);_0x151e4f['query']=_[_0x4231('0x40')](_0x4cd466[_0x4231('0x41')]);_0x151e4f[_0x4231('0x42')]=_[_0x4231('0x43')](_0x151e4f[_0x4231('0x3f')],_0x151e4f[_0x4231('0x41')]);_0x19bf1f['attributes']=_[_0x4231('0x43')](_0x151e4f[_0x4231('0x3f')],qs[_0x4231('0x45')](_0x4cd466[_0x4231('0x41')][_0x4231('0x45')]));_0x19bf1f[_0x4231('0x44')]=_0x19bf1f[_0x4231('0x44')][_0x4231('0x46')]?_0x19bf1f[_0x4231('0x44')]:_0x151e4f[_0x4231('0x3f')];_0x19bf1f[_0x4231('0x47')]=qs['sort'](_0x4cd466[_0x4231('0x41')][_0x4231('0x48')]);_0x19bf1f[_0x4231('0x49')]=qs[_0x4231('0x42')](_[_0x4231('0x6a')](_0x4cd466[_0x4231('0x41')],_0x151e4f[_0x4231('0x42')]));if(_0x4cd466[_0x4231('0x41')][_0x4231('0x30')]){_0x19bf1f[_0x4231('0x49')]=_[_0x4231('0x4a')](_0x19bf1f[_0x4231('0x49')],{'$or':_[_0x4231('0x3b')](_0x19bf1f[_0x4231('0x44')],function(_0x30066c){var _0x217ccb={};_0x217ccb[_0x30066c]={'$like':'%'+_0x4cd466[_0x4231('0x41')][_0x4231('0x30')]+'%'};return _0x217ccb;})});}_0x19bf1f=_[_0x4231('0x4a')]({},_0x19bf1f,_0x4cd466['options']);return _0x678c15['getTeams'](_0x19bf1f);}})['then'](function(_0x3e14ff){if(_0x3e14ff){_0x125a92=_0x3e14ff[_0x4231('0x46')];if(!_0x4cd466['query']['hasOwnProperty'](_0x4231('0x64'))){_0x19bf1f[_0x4231('0x22')]=qs[_0x4231('0x22')](_0x4cd466[_0x4231('0x41')][_0x4231('0x22')]);_0x19bf1f['offset']=qs[_0x4231('0x20')](_0x4cd466['query']['offset']);}return _0x678c15[_0x4231('0x6d')](_0x19bf1f);}})['then'](function(_0x2aeb12){if(_0x2aeb12){return _0x2aeb12?{'count':_0x125a92,'rows':_0x2aeb12}:null;}})['then'](respondWithResult(_0x162ce2,null))[_0x4231('0x4f')](handleError(_0x162ce2,null));};exports[_0x4231('0x6f')]=function(_0x572117,_0x424acb,_0x4c4706){var _0x59e211=_0x572117[_0x4231('0x53')]['teams'];var _0x2a84af=_['map'](_0x59e211,'id');return db[_0x4231('0x6e')][_0x4231('0x4e')]({'where':{'id':_0x2a84af},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4231('0x70'),'attributes':['id','name',_0x4231('0x71'),_0x4231('0x72'),_0x4231('0x73')],'raw':!![]}]})[_0x4231('0x29')](function(_0x5c8f68){if(_0x5c8f68){var _0x45279c=_[_0x4231('0x74')](_0x5c8f68,function(_0x1cf95c){var _0x22209d=_0x1cf95c[_0x4231('0x2b')]({'plain':!![]});_0x22209d[_0x4231('0x70')]['forEach'](function(_0x23c05e){_0x23c05e[_0x4231('0x75')]=_[_0x4231('0x33')](_0x59e211,{'id':_0x22209d['id']})[_0x4231('0x75')];});return _0x22209d['Agents'];});return db['VoiceQueue']['find']({'where':{'id':_0x572117[_0x4231('0x5c')]['id']}})[_0x4231('0x29')](function(_0xfd65e3){return db['sequelize'][_0x4231('0x76')](function(_0x49cbcd){return _0xfd65e3[_0x4231('0x6f')](_0x2a84af,{'transaction':_0x49cbcd})[_0x4231('0x29')](function(){return BPromise[_0x4231('0x77')](_0x59e211,function(_0x51e274){return db[_0x4231('0x78')][_0x4231('0x79')]({'TeamId':_0x51e274['id'],'VoiceQueueId':_0x572117['params']['id'],'penalty':_0x51e274[_0x4231('0x75')]},{'transaction':_0x49cbcd});});})[_0x4231('0x29')](function(){return BPromise[_0x4231('0x77')](_0x45279c,function(_0x287557){return db[_0x4231('0x7a')]['findOrCreate']({'where':{'UserId':_0x287557['id'],'VoiceQueueId':_0x572117[_0x4231('0x5c')]['id']},'defaults':{'penalty':_0x287557[_0x4231('0x75')]},'transaction':_0x49cbcd});});})[_0x4231('0x29')](function(){return BPromise[_0x4231('0x77')](_[_0x4231('0x30')](_0x45279c,{'online':!![]}),function(_0x364ddf){return db[_0x4231('0x7b')][_0x4231('0x79')]({'membername':_0x364ddf['name'],'UserId':_0x364ddf['id'],'queue_name':_0xfd65e3[_0x4231('0x38')],'VoiceQueueId':_0xfd65e3['id'],'interface':_[_0x4231('0x7c')](_0x364ddf[_0x4231('0x73')])?util['format']('SIP/%s',_0x364ddf[_0x4231('0x38')]):_0x364ddf[_0x4231('0x73')],'paused':_0x364ddf[_0x4231('0x72')]||![],'penalty':_0x364ddf['penalty']},{'transaction':_0x49cbcd});});})[_0x4231('0x29')](function(){_0x45279c['forEach'](function(_0x4d1a2d){socket['emit'](_0x4231('0x7d'),{'UserId':_0x4d1a2d['id'],'VoiceQueueId':_0xfd65e3['id']});});});});});}})[_0x4231('0x29')](respondWithStatusCode(_0x424acb,null))[_0x4231('0x4f')](handleError(_0x424acb,null));};exports['removeTeams']=function(_0x5cefa4,_0x463127,_0x472bd5){return db[_0x4231('0x6e')][_0x4231('0x4e')]({'where':{'id':_0x5cefa4[_0x4231('0x41')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4231('0x7e')],'as':_0x4231('0x70'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x463127,null))['then'](function(_0x1cbc31){var _0x11dee8=_[_0x4231('0x3b')](_0x1cbc31,'id');var _0x376ed1=[];var _0x1efe74=[];var _0x794043=squel['select']();_0x794043[_0x4231('0x7f')](_0x4231('0x80'))[_0x4231('0x81')](_0x4231('0x82'),'tq')['join'](_0x4231('0x83'),'ut',_0x4231('0x84'))[_0x4231('0x49')](_0x4231('0x85'),_0x5cefa4[_0x4231('0x5c')]['id']);for(var _0xa5419d=0x0;_0xa5419d<_0x1cbc31['length'];_0xa5419d+=0x1){let _0x2b7384=_0x1cbc31[_0xa5419d];for(var _0x5d9583=0x0;_0x5d9583<_0x2b7384['Agents'][_0x4231('0x46')];_0x5d9583+=0x1){let _0x3bb539=_0x2b7384[_0x4231('0x70')][_0x5d9583];var _0x129546=_0x794043[_0x4231('0x5b')]();_0x129546['where']('ut.UserId\x20=\x20?',_0x3bb539['id']);_0x1efe74['push'](db[_0x4231('0x86')]['query'](_0x129546[_0x4231('0x87')](),{'type':db[_0x4231('0x86')][_0x4231('0x88')][_0x4231('0x89')]})[_0x4231('0x29')](function(_0x4d5bd9){if(_0x4d5bd9[_0x4231('0x46')]===0x1){return _0x3bb539['id'];}else{var _0x3e714b=_['every'](_[_0x4231('0x3b')](_0x4d5bd9,_0x4231('0x8a')),function(_0xaec9b){return _[_0x4231('0x32')](_0x11dee8,_0xaec9b);});if(_0x3e714b){return _0x3bb539['id'];}}}));}}return BPromise['all'](_0x1efe74)['then'](function(_0x189ed4){_0x376ed1=_(_0x376ed1)['union'](_0x189ed4)[_0x4231('0x8b')]()[_0x4231('0x31')]();return db[_0x4231('0x3c')][_0x4231('0x33')]({'where':{'id':_0x5cefa4[_0x4231('0x5c')]['id']}})[_0x4231('0x29')](function(_0x1b4b11){return db[_0x4231('0x86')][_0x4231('0x76')](function(_0x5cd8ee){return _0x1b4b11[_0x4231('0x8c')](_0x5cefa4[_0x4231('0x41')]['ids'],{'transaction':_0x5cd8ee})[_0x4231('0x29')](function(){if(!_[_0x4231('0x8d')](_0x376ed1)){return _0x1b4b11[_0x4231('0x8e')](_0x376ed1,{'transaction':_0x5cd8ee})[_0x4231('0x29')](function(){return db[_0x4231('0x7b')][_0x4231('0x2a')]({'where':{'VoiceQueueId':_0x5cefa4[_0x4231('0x5c')]['id'],'UserId':_0x376ed1},'transaction':_0x5cd8ee});});}})[_0x4231('0x29')](function(){_0x376ed1[_0x4231('0x8f')](function(_0x1fa86f){socket[_0x4231('0x90')](_0x4231('0x91'),{'UserId':_0x1fa86f,'VoiceQueueId':_0x1b4b11['id']});});});});});});})['then'](respondWithStatusCode(_0x463127,null))[_0x4231('0x4f')](handleError(_0x463127,null));};exports[_0x4231('0x92')]=function(_0x998c6f,_0x32e806,_0x3a85d9){var _0x41a88a,_0x44afca;return db[_0x4231('0x3c')]['find']({'where':{'id':_0x998c6f[_0x4231('0x5c')]['id']}})[_0x4231('0x29')](handleEntityNotFound(_0x32e806,null))['then'](function(_0x294aaf){if(_0x294aaf){_0x44afca=_0x294aaf;return _0x294aaf[_0x4231('0x92')](_0x998c6f[_0x4231('0x53')][_0x4231('0x93')],_[_0x4231('0x5f')](_0x998c6f[_0x4231('0x53')],[_0x4231('0x93'),'id'])||{})[_0x4231('0x94')](function(_0x2f2dc9){for(var _0xcf808f=0x0;_0xcf808f<_0x998c6f[_0x4231('0x53')][_0x4231('0x93')][_0x4231('0x46')];_0xcf808f+=0x1){socket[_0x4231('0x90')](_0x4231('0x7d'),{'UserId':Number(_0x998c6f[_0x4231('0x53')][_0x4231('0x93')][_0xcf808f]),'VoiceQueueId':Number(_0x998c6f[_0x4231('0x5c')]['id'])});}return _0x2f2dc9;});}})[_0x4231('0x29')](function(_0x4e31c0){_0x41a88a=_0x4e31c0||[];if(_0x44afca){return db[_0x4231('0x7e')][_0x4231('0x4e')]({'where':{'id':_0x998c6f[_0x4231('0x53')][_0x4231('0x93')]},'attributes':['id','name',_0x4231('0x71'),'voicePause',_0x4231('0x73')],'raw':!![]});}})['then'](function(_0x35b448){if(!_[_0x4231('0x8d')](_0x35b448)){var _0x1efdc5=[];for(var _0x4fda6f=0x0;_0x4fda6f<_0x35b448['length'];_0x4fda6f++){if(_0x35b448[_0x4fda6f]['online']){_0x1efdc5[_0x4231('0x95')](db['UserVoiceQueueRt'][_0x4231('0x79')]({'membername':_0x35b448[_0x4fda6f]['name'],'UserId':_0x35b448[_0x4fda6f]['id'],'queue_name':_0x44afca[_0x4231('0x38')],'VoiceQueueId':_0x44afca['id'],'interface':_[_0x4231('0x7c')](_0x35b448[_0x4fda6f][_0x4231('0x73')])?util[_0x4231('0x96')](_0x4231('0x97'),_0x35b448[_0x4fda6f]['name']):_0x35b448[_0x4fda6f]['interface'],'paused':_0x35b448[_0x4fda6f][_0x4231('0x72')]||![],'penalty':_0x998c6f['body'][_0x4231('0x75')]||0x0}));}}return BPromise[_0x4231('0x98')](_0x1efdc5);}})[_0x4231('0x29')](function(){return _0x41a88a;})['then'](respondWithResult(_0x32e806,null))[_0x4231('0x4f')](handleError(_0x32e806,null));};exports['removeAgents']=function(_0x7c733e,_0x246173,_0x3b6a38){return db[_0x4231('0x3c')][_0x4231('0x33')]({'where':{'id':_0x7c733e['params']['id']}})['then'](handleEntityNotFound(_0x246173,null))['then'](function(_0x5341c5){if(_0x5341c5){return _0x5341c5[_0x4231('0x8e')](_0x7c733e[_0x4231('0x41')][_0x4231('0x93')])[_0x4231('0x29')](function(){if(_[_0x4231('0x99')](_0x7c733e['query'][_0x4231('0x93')])){for(var _0x5f19c8=0x0;_0x5f19c8<_0x7c733e[_0x4231('0x41')][_0x4231('0x93')]['length'];_0x5f19c8+=0x1){socket[_0x4231('0x90')]('userVoiceQueue:remove',{'UserId':Number(_0x7c733e[_0x4231('0x41')][_0x4231('0x93')][_0x5f19c8]),'VoiceQueueId':Number(_0x7c733e['params']['id'])});}}else{socket[_0x4231('0x90')](_0x4231('0x91'),{'UserId':Number(_0x7c733e[_0x4231('0x41')][_0x4231('0x93')]),'VoiceQueueId':Number(_0x7c733e[_0x4231('0x5c')]['id'])});}});}})[_0x4231('0x29')](function(_0x5f76f6){return db[_0x4231('0x7b')][_0x4231('0x2a')]({'where':{'VoiceQueueId':_0x7c733e[_0x4231('0x5c')]['id'],'UserId':_0x7c733e[_0x4231('0x41')]['ids']}})[_0x4231('0x29')](function(){return _0x5f76f6;});})[_0x4231('0x29')](respondWithStatusCode(_0x246173,null))['catch'](handleError(_0x246173,null));};exports[_0x4231('0x9a')]=function(_0x10f215,_0x5eda9c,_0x2aea2e){var _0x5f6fe5={};var _0x238348={};var _0x930ef1;var _0x326dd7;return db[_0x4231('0x3c')][_0x4231('0x61')]({'where':{'id':_0x10f215[_0x4231('0x5c')]['id']}})[_0x4231('0x29')](handleEntityNotFound(_0x5eda9c,null))[_0x4231('0x29')](function(_0x452154){if(_0x452154){_0x930ef1=_0x452154;_0x238348[_0x4231('0x3f')]=_['keys'](db[_0x4231('0x7e')][_0x4231('0x3d')]);_0x238348[_0x4231('0x41')]=_[_0x4231('0x40')](_0x10f215['query']);_0x238348['filters']=_['intersection'](_0x238348['model'],_0x238348[_0x4231('0x41')]);_0x5f6fe5['attributes']=_[_0x4231('0x43')](_0x238348['model'],qs[_0x4231('0x45')](_0x10f215[_0x4231('0x41')][_0x4231('0x45')]));_0x5f6fe5['attributes']=_0x5f6fe5[_0x4231('0x44')]['length']?_0x5f6fe5[_0x4231('0x44')]:_0x238348[_0x4231('0x3f')];_0x5f6fe5['order']=qs[_0x4231('0x48')](_0x10f215['query'][_0x4231('0x48')]);_0x5f6fe5[_0x4231('0x49')]=qs[_0x4231('0x42')](_[_0x4231('0x6a')](_0x10f215[_0x4231('0x41')],_0x238348[_0x4231('0x42')]));if(_0x10f215[_0x4231('0x41')][_0x4231('0x30')]){_0x5f6fe5[_0x4231('0x49')]=_[_0x4231('0x4a')](_0x5f6fe5[_0x4231('0x49')],{'$or':_[_0x4231('0x3b')](_0x5f6fe5[_0x4231('0x44')],function(_0x26ddf8){var _0x1b93b1={};_0x1b93b1[_0x26ddf8]={'$like':'%'+_0x10f215[_0x4231('0x41')][_0x4231('0x30')]+'%'};return _0x1b93b1;})});}_0x5f6fe5=_['merge']({},_0x5f6fe5,_0x10f215['options']);return _0x930ef1[_0x4231('0x9a')](_0x5f6fe5);}})['then'](function(_0x31563a){if(_0x31563a){_0x326dd7=_0x31563a['length'];if(!_0x10f215[_0x4231('0x41')][_0x4231('0x63')](_0x4231('0x64'))){_0x5f6fe5['limit']=qs[_0x4231('0x22')](_0x10f215[_0x4231('0x41')][_0x4231('0x22')]);_0x5f6fe5[_0x4231('0x20')]=qs[_0x4231('0x20')](_0x10f215[_0x4231('0x41')][_0x4231('0x20')]);}return _0x930ef1['getAgents'](_0x5f6fe5);}})['then'](function(_0x23e9c9){if(_0x23e9c9){return _0x23e9c9?{'count':_0x326dd7,'rows':_0x23e9c9}:null;}})[_0x4231('0x29')](respondWithResult(_0x5eda9c,null))[_0x4231('0x4f')](handleError(_0x5eda9c,null));};exports['getMembers']=function(_0x3a557d,_0x439c06,_0x44afec){var _0x1e775c={};var _0x302808={};var _0x2c67ea;var _0x4e6b97;return db[_0x4231('0x3c')][_0x4231('0x61')]({'where':{'id':_0x3a557d[_0x4231('0x5c')]['id']}})[_0x4231('0x29')](handleEntityNotFound(_0x439c06,null))[_0x4231('0x29')](function(_0x5deee7){if(_0x5deee7){_0x2c67ea=_0x5deee7;_0x302808[_0x4231('0x3f')]=_[_0x4231('0x40')](db['UserVoiceQueueRt']['rawAttributes']);_0x302808[_0x4231('0x41')]=_[_0x4231('0x40')](_0x3a557d[_0x4231('0x41')]);_0x302808[_0x4231('0x42')]=_[_0x4231('0x43')](_0x302808['model'],_0x302808[_0x4231('0x41')]);_0x1e775c[_0x4231('0x44')]=_[_0x4231('0x43')](_0x302808['model'],qs[_0x4231('0x45')](_0x3a557d['query']['fields']));_0x1e775c[_0x4231('0x44')]=_0x1e775c[_0x4231('0x44')][_0x4231('0x46')]?_0x1e775c['attributes']:_0x302808[_0x4231('0x3f')];_0x1e775c['order']=qs[_0x4231('0x48')](_0x3a557d[_0x4231('0x41')][_0x4231('0x48')]);_0x1e775c[_0x4231('0x49')]=qs['filters'](_[_0x4231('0x6a')](_0x3a557d['query'],_0x302808[_0x4231('0x42')]));if(_0x3a557d['query'][_0x4231('0x30')]){_0x1e775c[_0x4231('0x49')]=_[_0x4231('0x4a')](_0x1e775c['where'],{'$or':_['map'](_0x1e775c['attributes'],function(_0x36915d){var _0x18ab12={};_0x18ab12[_0x36915d]={'$like':'%'+_0x3a557d[_0x4231('0x41')][_0x4231('0x30')]+'%'};return _0x18ab12;})});}_0x1e775c=_[_0x4231('0x4a')]({},_0x1e775c,_0x3a557d[_0x4231('0x4c')]);return _0x2c67ea[_0x4231('0x9b')](_0x1e775c);}})['then'](function(_0xc1d120){if(_0xc1d120){_0x4e6b97=_0xc1d120[_0x4231('0x46')];if(!_0x3a557d[_0x4231('0x41')][_0x4231('0x63')](_0x4231('0x64'))){_0x1e775c['limit']=qs['limit'](_0x3a557d['query'][_0x4231('0x22')]);_0x1e775c['offset']=qs[_0x4231('0x20')](_0x3a557d[_0x4231('0x41')][_0x4231('0x20')]);}return _0x2c67ea[_0x4231('0x9b')](_0x1e775c);}})['then'](function(_0x191b0d){return _0x191b0d?{'count':_0x4e6b97,'rows':_0x191b0d}:null;})[_0x4231('0x29')](respondWithResult(_0x439c06,null))['catch'](handleError(_0x439c06,null));};exports[_0x4231('0x9c')]=function(_0x2098d8,_0x36d06c,_0x1fd2b1){var _0xb88c10={};var _0x5050f4={};var _0x31c682;var _0x538ac3;return db[_0x4231('0x3c')][_0x4231('0x61')]({'where':{'id':_0x2098d8[_0x4231('0x5c')]['id']}})[_0x4231('0x29')](handleEntityNotFound(_0x36d06c,null))[_0x4231('0x29')](function(_0x31f7b7){if(_0x31f7b7){_0x31c682=_0x31f7b7;_0x5050f4['model']=_[_0x4231('0x40')](db[_0x4231('0x9d')][_0x4231('0x3d')]);_0x5050f4['query']=_[_0x4231('0x40')](_0x2098d8[_0x4231('0x41')]);_0x5050f4[_0x4231('0x42')]=_[_0x4231('0x43')](_0x5050f4[_0x4231('0x3f')],_0x5050f4[_0x4231('0x41')]);_0xb88c10['attributes']=_[_0x4231('0x43')](_0x5050f4[_0x4231('0x3f')],qs[_0x4231('0x45')](_0x2098d8[_0x4231('0x41')]['fields']));_0xb88c10['attributes']=_0xb88c10[_0x4231('0x44')][_0x4231('0x46')]?_0xb88c10[_0x4231('0x44')]:_0x5050f4[_0x4231('0x3f')];_0xb88c10[_0x4231('0x47')]=qs[_0x4231('0x48')](_0x2098d8['query'][_0x4231('0x48')]);_0xb88c10[_0x4231('0x49')]=qs[_0x4231('0x42')](_['pick'](_0x2098d8['query'],_0x5050f4[_0x4231('0x42')]));if(_0x2098d8[_0x4231('0x41')][_0x4231('0x30')]){_0xb88c10[_0x4231('0x49')]=_[_0x4231('0x4a')](_0xb88c10['where'],{'$or':_[_0x4231('0x3b')](_0xb88c10[_0x4231('0x44')],function(_0x2fc19b){var _0x2362a2={};_0x2362a2[_0x2fc19b]={'$like':'%'+_0x2098d8[_0x4231('0x41')][_0x4231('0x30')]+'%'};return _0x2362a2;})});}_0xb88c10=_[_0x4231('0x4a')]({},_0xb88c10,_0x2098d8['options']);return _0x31c682[_0x4231('0x9c')](_0xb88c10);}})[_0x4231('0x29')](function(_0x19d853){if(_0x19d853){_0x538ac3=_0x19d853[_0x4231('0x46')];if(!_0x2098d8[_0x4231('0x41')]['hasOwnProperty'](_0x4231('0x64'))){_0xb88c10[_0x4231('0x22')]=qs[_0x4231('0x22')](_0x2098d8['query']['limit']);_0xb88c10['offset']=qs[_0x4231('0x20')](_0x2098d8['query'][_0x4231('0x20')]);}return _0x31c682['getLists'](_0xb88c10);}})[_0x4231('0x29')](function(_0x326189){if(_0x326189){return _0x326189?{'count':_0x538ac3,'rows':_0x326189}:null;}})[_0x4231('0x29')](respondWithResult(_0x36d06c,null))[_0x4231('0x4f')](handleError(_0x36d06c,null));};exports[_0x4231('0x9e')]=function(_0x1b1bee,_0x63519f,_0x2df941){var _0x87830c,_0x5d7e3f;return db[_0x4231('0x3c')][_0x4231('0x33')]({'where':{'id':_0x1b1bee[_0x4231('0x5c')]['id']}})[_0x4231('0x29')](handleEntityNotFound(_0x63519f,null))[_0x4231('0x29')](function(_0x2fcc44){if(_0x2fcc44){_0x5d7e3f=_0x2fcc44;return _0x2fcc44['addLists'](_0x1b1bee[_0x4231('0x53')][_0x4231('0x93')],_[_0x4231('0x5f')](_0x1b1bee[_0x4231('0x53')],[_0x4231('0x93'),'id'])||{});}return null;})[_0x4231('0x94')](function(_0x35f6de){var _0x38e5b2;_0x87830c=_0x35f6de||[];var _0x23baab=[];if(_0x35f6de){for(var _0x1da4ed=0x0;_0x1da4ed<_0x35f6de[_0x4231('0x46')];_0x1da4ed+=0x1){var _0x53a687=_0x35f6de[_0x1da4ed][_0x4231('0x2b')]({'plain':!![]});_0x5d7e3f[_0x4231('0x9f')]=_0x1b1bee[_0x4231('0x53')][_0x4231('0x9f')]?_0x1b1bee['body'][_0x4231('0x9f')]:_0x5d7e3f['dialCheckDuplicateType'];switch(_0x5d7e3f[_0x4231('0x9f')]){case _0x4231('0xa0'):_0x38e5b2=squel[_0x4231('0xa1')]()['into'](_0x4231('0xa2'))[_0x4231('0xa3')]([_0x4231('0xa4'),_0x4231('0xa5'),'ContactId','ListId','VoiceQueueId',_0x4231('0x5d'),_0x4231('0x5e')],squel['select']()[_0x4231('0x7f')](_0x4231('0xa4'),_0x4231('0xa4'))['field'](_0x4231('0xa6'),_0x4231('0xa5'))[_0x4231('0x7f')]('id',_0x4231('0xa7'))[_0x4231('0x7f')](_0x53a687[_0x4231('0xa8')][_0x4231('0x87')](),_0x4231('0xa9'))[_0x4231('0x7f')](_0x1b1bee[_0x4231('0x5c')]['id'][_0x4231('0x87')](),'VoiceQueueId')[_0x4231('0x7f')](_0x4231('0xa6'),_0x4231('0x5d'))[_0x4231('0x7f')]('NOW()',_0x4231('0x5e'))[_0x4231('0x81')](_0x4231('0xaa'))['where'](_0x4231('0xab'))[_0x4231('0x49')](_0x4231('0xac'),_0x53a687['CmListId'][_0x4231('0x87')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x4231('0x49')]('phone\x20NOT\x20IN\x20(?)',squel[_0x4231('0xad')]()[_0x4231('0x7f')](_0x4231('0xae'))[_0x4231('0x81')](_0x4231('0xaf'))[_0x4231('0x49')](_0x4231('0x85'),_0x1b1bee[_0x4231('0x5c')]['id'][_0x4231('0x87')]()))[_0x4231('0x49')](_0x4231('0xb0'),squel[_0x4231('0xad')]()[_0x4231('0x7f')](_0x4231('0xb1'))['from'](_0x4231('0xa2'))[_0x4231('0x49')](_0x4231('0x85'),_0x1b1bee['params']['id'][_0x4231('0x87')]())))[_0x4231('0x87')]();break;case _0x4231('0xb2'):_0x38e5b2=squel[_0x4231('0xa1')]()[_0x4231('0xb3')](_0x4231('0xa2'))[_0x4231('0xa3')](['phone',_0x4231('0xa5'),_0x4231('0xa7'),_0x4231('0xa9'),_0x4231('0x65'),_0x4231('0x5d'),'updatedAt'],squel[_0x4231('0xad')]()[_0x4231('0x7f')](_0x4231('0xa4'),_0x4231('0xa4'))[_0x4231('0x7f')](_0x4231('0xa6'),_0x4231('0xa5'))[_0x4231('0x7f')]('id',_0x4231('0xa7'))[_0x4231('0x7f')](_0x53a687[_0x4231('0xa8')][_0x4231('0x87')](),_0x4231('0xa9'))[_0x4231('0x7f')](_0x1b1bee[_0x4231('0x5c')]['id'][_0x4231('0x87')](),_0x4231('0x65'))[_0x4231('0x7f')](_0x4231('0xa6'),_0x4231('0x5d'))[_0x4231('0x7f')](_0x4231('0xa6'),_0x4231('0x5e'))[_0x4231('0x81')](_0x4231('0xaa'))[_0x4231('0x49')](_0x4231('0xab'))[_0x4231('0x49')](_0x4231('0xac'),_0x53a687[_0x4231('0xa8')][_0x4231('0x87')]())[_0x4231('0x49')](_0x4231('0xb4'))[_0x4231('0x49')](_0x4231('0xb0'),squel[_0x4231('0xad')]()[_0x4231('0x7f')](_0x4231('0xb1'))[_0x4231('0x81')](_0x4231('0xa2'))[_0x4231('0x49')](_0x4231('0x85'),_0x1b1bee['params']['id']['toString']())))[_0x4231('0x87')]();break;default:_0x38e5b2=squel[_0x4231('0xa1')]()[_0x4231('0xb3')](_0x4231('0xa2'))['fromQuery']([_0x4231('0xa4'),_0x4231('0xa5'),_0x4231('0xa7'),'ListId',_0x4231('0x65'),_0x4231('0x5d'),_0x4231('0x5e')],squel[_0x4231('0xad')]()[_0x4231('0x7f')](_0x4231('0xa4'),_0x4231('0xa4'))['field'](_0x4231('0xa6'),_0x4231('0xa5'))['field']('id',_0x4231('0xa7'))[_0x4231('0x7f')](_0x53a687[_0x4231('0xa8')]['toString'](),_0x4231('0xa9'))[_0x4231('0x7f')](_0x1b1bee[_0x4231('0x5c')]['id'][_0x4231('0x87')](),'VoiceQueueId')[_0x4231('0x7f')](_0x4231('0xa6'),_0x4231('0x5d'))[_0x4231('0x7f')](_0x4231('0xa6'),_0x4231('0x5e'))[_0x4231('0x81')](_0x4231('0xaa'))[_0x4231('0x49')](_0x4231('0xab'))[_0x4231('0x49')](_0x4231('0xac'),_0x53a687[_0x4231('0xa8')][_0x4231('0x87')]())[_0x4231('0x49')](_0x4231('0xb4')))[_0x4231('0x87')]();}_0x23baab['push'](db[_0x4231('0x86')][_0x4231('0x41')](_0x38e5b2));}return BPromise[_0x4231('0x98')](_0x23baab);}})[_0x4231('0x29')](function(){return _0x87830c;})[_0x4231('0x29')](respondWithResult(_0x63519f,null))['catch'](handleError(_0x63519f,null));};exports[_0x4231('0xb5')]=function(_0x40861b,_0x20851b,_0x219107){return db[_0x4231('0x3c')][_0x4231('0x33')]({'where':{'id':_0x40861b[_0x4231('0x5c')]['id']}})[_0x4231('0x29')](handleEntityNotFound(_0x20851b,null))[_0x4231('0x29')](function(_0x3adae8){if(_0x3adae8){return _0x3adae8['removeLists'](_0x40861b[_0x4231('0x41')][_0x4231('0x93')]);}})[_0x4231('0x29')](function(_0x7127bf){if(_0x7127bf){return db[_0x4231('0x62')][_0x4231('0x2a')]({'where':{'ListId':_0x40861b[_0x4231('0x41')][_0x4231('0x93')],'VoiceQueueId':_0x40861b[_0x4231('0x5c')]['id']}})[_0x4231('0x29')](function(){return _0x7127bf;});}})[_0x4231('0x29')](respondWithStatusCode(_0x20851b,null))['catch'](handleError(_0x20851b,null));};exports[_0x4231('0xb6')]=function(_0x27f279,_0xba53e0,_0x5eae66){var _0x1a0ad8={};var _0x57a83={};var _0x35dd24;var _0x3d6646;return db[_0x4231('0x3c')][_0x4231('0x61')]({'where':{'id':_0x27f279[_0x4231('0x5c')]['id']}})[_0x4231('0x29')](handleEntityNotFound(_0xba53e0,null))[_0x4231('0x29')](function(_0x2d4f21){if(_0x2d4f21){_0x35dd24=_0x2d4f21;_0x57a83[_0x4231('0x3f')]=_['keys'](db[_0x4231('0x9d')][_0x4231('0x3d')]);_0x57a83[_0x4231('0x41')]=_[_0x4231('0x40')](_0x27f279['query']);_0x57a83['filters']=_[_0x4231('0x43')](_0x57a83[_0x4231('0x3f')],_0x57a83[_0x4231('0x41')]);_0x1a0ad8[_0x4231('0x44')]=_['intersection'](_0x57a83['model'],qs[_0x4231('0x45')](_0x27f279[_0x4231('0x41')][_0x4231('0x45')]));_0x1a0ad8[_0x4231('0x44')]=_0x1a0ad8[_0x4231('0x44')][_0x4231('0x46')]?_0x1a0ad8['attributes']:_0x57a83[_0x4231('0x3f')];_0x1a0ad8[_0x4231('0x47')]=qs['sort'](_0x27f279[_0x4231('0x41')]['sort']);_0x1a0ad8['where']=qs[_0x4231('0x42')](_[_0x4231('0x6a')](_0x27f279[_0x4231('0x41')],_0x57a83[_0x4231('0x42')]));if(_0x27f279[_0x4231('0x41')][_0x4231('0x30')]){_0x1a0ad8[_0x4231('0x49')]=_[_0x4231('0x4a')](_0x1a0ad8[_0x4231('0x49')],{'$or':_[_0x4231('0x3b')](_0x1a0ad8[_0x4231('0x44')],function(_0x5b7045){var _0x43474e={};_0x43474e[_0x5b7045]={'$like':'%'+_0x27f279[_0x4231('0x41')][_0x4231('0x30')]+'%'};return _0x43474e;})});}_0x1a0ad8=_['merge']({},_0x1a0ad8,_0x27f279[_0x4231('0x4c')]);return _0x35dd24[_0x4231('0xb6')](_0x1a0ad8);}})[_0x4231('0x29')](function(_0x382e18){if(_0x382e18){_0x3d6646=_0x382e18[_0x4231('0x46')];if(!_0x27f279[_0x4231('0x41')][_0x4231('0x63')](_0x4231('0x64'))){_0x1a0ad8[_0x4231('0x22')]=qs[_0x4231('0x22')](_0x27f279['query'][_0x4231('0x22')]);_0x1a0ad8['offset']=qs['offset'](_0x27f279['query'][_0x4231('0x20')]);}return _0x35dd24[_0x4231('0xb6')](_0x1a0ad8);}})['then'](function(_0x8671ca){if(_0x8671ca){return _0x8671ca?{'count':_0x3d6646,'rows':_0x8671ca}:null;}})['then'](respondWithResult(_0xba53e0,null))[_0x4231('0x4f')](handleError(_0xba53e0,null));};exports['addBlackLists']=function(_0x1db2eb,_0x4b4cfa,_0x118c29){var _0x5a59b3,_0x9e55c6;return db['VoiceQueue']['find']({'where':{'id':_0x1db2eb[_0x4231('0x5c')]['id']}})[_0x4231('0x29')](handleEntityNotFound(_0x4b4cfa,null))[_0x4231('0x29')](function(_0x4416a2){if(_0x4416a2){_0x9e55c6=_0x4416a2;return _0x4416a2[_0x4231('0xb7')](_0x1db2eb[_0x4231('0x53')]['ids'],_[_0x4231('0x5f')](_0x1db2eb['body'],['ids','id'])||{});}return null;})['spread'](function(_0x27aa67){var _0x3d6c66;_0x5a59b3=_0x27aa67||[];var _0x1ea477=[];if(_0x27aa67){for(var _0x57dca1=0x0;_0x57dca1<_0x27aa67[_0x4231('0x46')];_0x57dca1+=0x1){var _0x2b7656=_0x27aa67[_0x57dca1][_0x4231('0x2b')]({'plain':!![]});_0x3d6c66=squel['insert']()[_0x4231('0xb3')](_0x4231('0xb8'))[_0x4231('0xa3')](['phone','ContactId',_0x4231('0xa9'),_0x4231('0x65'),'createdAt',_0x4231('0x5e')],squel[_0x4231('0xad')]()[_0x4231('0x7f')](_0x4231('0xa4'),_0x4231('0xa4'))[_0x4231('0x7f')]('id','ContactId')[_0x4231('0x7f')](_0x2b7656[_0x4231('0xa8')][_0x4231('0x87')](),_0x4231('0xa9'))[_0x4231('0x7f')](_0x1db2eb[_0x4231('0x5c')]['id'][_0x4231('0x87')](),_0x4231('0x65'))[_0x4231('0x7f')](_0x4231('0xa6'),_0x4231('0x5d'))['field'](_0x4231('0xa6'),'updatedAt')[_0x4231('0x81')]('cm_contacts')['where'](_0x4231('0xab'))['where'](_0x4231('0xac'),_0x2b7656['CmListId'][_0x4231('0x87')]())[_0x4231('0x49')]('phone\x20IS\x20NOT\x20NULL'))[_0x4231('0x87')]();_0x1ea477[_0x4231('0x95')](db['sequelize'][_0x4231('0x41')](_0x3d6c66));}return BPromise['all'](_0x1ea477);}})[_0x4231('0x29')](function(){return _0x5a59b3;})[_0x4231('0x29')](respondWithResult(_0x4b4cfa,null))[_0x4231('0x4f')](handleError(_0x4b4cfa,null));};exports[_0x4231('0xb9')]=function(_0x1f245f,_0x6848c6,_0x15fbd7){return db[_0x4231('0x3c')][_0x4231('0x33')]({'where':{'id':_0x1f245f[_0x4231('0x5c')]['id']}})[_0x4231('0x29')](handleEntityNotFound(_0x6848c6,null))[_0x4231('0x29')](function(_0xec3e7d){if(_0xec3e7d){return _0xec3e7d[_0x4231('0xb9')](_0x1f245f[_0x4231('0x41')]['ids']);}})[_0x4231('0x29')](function(_0x5315ee){if(_0x5315ee){return db[_0x4231('0x6c')][_0x4231('0x2a')]({'where':{'ListId':_0x1f245f[_0x4231('0x41')]['ids'],'VoiceQueueId':_0x1f245f[_0x4231('0x5c')]['id']}})[_0x4231('0x29')](function(){return _0x5315ee;});}})['then'](respondWithStatusCode(_0x6848c6,null))[_0x4231('0x4f')](handleError(_0x6848c6,null));}; \ No newline at end of file +var _0x2378=['getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','always','insert','fromQuery','phone','scheduledAt','ListId','createdAt','CmListId','NOW()','from','cm_contacts','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','cm_hopper','onlyIfOpen','into','ContactId','COALESCE(phone,\x27\x27)','deletedAt\x20IS\x20NULL','removeLists','CmList','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','defaults','redis','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','filter','value','type','stack','name','index','map','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','VoiceQueue','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','outbound','find','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','autoAssociation','findOne','nolimit','pick','VoiceQueueId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','addTeams','each','TeamVoiceQueue','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','join','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','all','union','transaction','isEmpty','removeAgents','addAgents','spread','push','isArray','userVoiceQueue:remove'];(function(_0x16972d,_0x24d931){var _0x236f96=function(_0x14e1af){while(--_0x14e1af){_0x16972d['push'](_0x16972d['shift']());}};_0x236f96(++_0x24d931);}(_0x2378,0xd1));var _0x8237=function(_0x35157c,_0x11e57c){_0x35157c=_0x35157c-0x0;var _0x310d53=_0x2378[_0x35157c];return _0x310d53;};'use strict';var emlformat=require(_0x8237('0x0'));var rimraf=require(_0x8237('0x1'));var zipdir=require(_0x8237('0x2'));var jsonpatch=require(_0x8237('0x3'));var rp=require(_0x8237('0x4'));var moment=require(_0x8237('0x5'));var BPromise=require(_0x8237('0x6'));var Mustache=require(_0x8237('0x7'));var util=require(_0x8237('0x8'));var path=require(_0x8237('0x9'));var sox=require(_0x8237('0xa'));var csv=require(_0x8237('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8237('0xc'));var _=require(_0x8237('0xd'));var squel=require('squel');var crypto=require(_0x8237('0xe'));var jsforce=require(_0x8237('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8237('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8237('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8237('0x11'));var hardwareService=require(_0x8237('0x12'));var logger=require('../../config/logger')(_0x8237('0x13'));var utils=require(_0x8237('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8237('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x8237('0x16')](config[_0x8237('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x8237('0x18'))(new Redis(config[_0x8237('0x17')]));require('./voiceQueue.socket')[_0x8237('0x19')](socket);function respondWithStatusCode(_0x30b846,_0x48f988){_0x48f988=_0x48f988||0xcc;return function(_0x5223d8){if(_0x5223d8){return _0x30b846[_0x8237('0x1a')](_0x48f988);}return _0x30b846[_0x8237('0x1b')](_0x48f988)[_0x8237('0x1c')]();};}function respondWithResult(_0x21f6a6,_0x59affc){_0x59affc=_0x59affc||0xc8;return function(_0x30993d){if(_0x30993d){return _0x21f6a6['status'](_0x59affc)[_0x8237('0x1d')](_0x30993d);}};}function respondWithFilteredResult(_0x3cc1d1,_0x2765b9){return function(_0x5611ea){if(_0x5611ea){var _0x16125e=typeof _0x2765b9['offset']===_0x8237('0x1e')&&typeof _0x2765b9[_0x8237('0x1f')]===_0x8237('0x1e');var _0x274d61=_0x5611ea[_0x8237('0x20')];var _0x492391=_0x16125e?0x0:_0x2765b9[_0x8237('0x21')];var _0x37cc8a=_0x16125e?_0x5611ea[_0x8237('0x20')]:_0x2765b9['offset']+_0x2765b9[_0x8237('0x1f')];var _0x4e18b6;if(_0x37cc8a>=_0x274d61){_0x37cc8a=_0x274d61;_0x4e18b6=0xc8;}else{_0x4e18b6=0xce;}_0x3cc1d1['status'](_0x4e18b6);return _0x3cc1d1[_0x8237('0x22')](_0x8237('0x23'),_0x492391+'-'+_0x37cc8a+'/'+_0x274d61)['json'](_0x5611ea);}return null;};}function patchUpdates(_0x46482c){return function(_0x267dbe){try{jsonpatch[_0x8237('0x24')](_0x267dbe,_0x46482c,!![]);}catch(_0x43a97f){return BPromise['reject'](_0x43a97f);}return _0x267dbe['save']();};}function saveUpdates(_0x5a4049,_0x4a92bf){return function(_0x1da1fb){if(_0x1da1fb){return _0x1da1fb[_0x8237('0x25')](_0x5a4049)[_0x8237('0x26')](function(_0x2f3f50){return _0x2f3f50;});}return null;};}function removeEntity(_0x49c296,_0x4d458d){return function(_0x19e2d5){if(_0x19e2d5){return _0x19e2d5[_0x8237('0x27')]()['then'](function(){var _0x64c73=_0x19e2d5[_0x8237('0x28')]({'plain':!![]});var _0x629ff9=[{'name':_0x8237('0x29'),'value':_0x8237('0x2a'),'ignore':![]},{'name':_0x8237('0x2b'),'value':'outbound','ignore':![]}];var _0x2b5db7=_(_0x629ff9)[_0x8237('0x2c')]('ignore')['map'](_0x8237('0x2d'))['value']();if(_['includes'](_0x2b5db7,_0x64c73['type'])){return;}var _0x25d42d=_['find'](_0x629ff9,[_0x8237('0x2d'),_0x64c73[_0x8237('0x2e')]])['name'];return db['UserProfileResource'][_0x8237('0x27')]({'where':{'type':_0x25d42d,'resourceId':_0x64c73['id']}})[_0x8237('0x26')](function(){return _0x19e2d5;});})[_0x8237('0x26')](function(){_0x49c296[_0x8237('0x1b')](0xcc)[_0x8237('0x1c')]();});}};}function handleEntityNotFound(_0x18bf7e,_0x278489){return function(_0x58bd89){if(!_0x58bd89){_0x18bf7e[_0x8237('0x1a')](0x194);}return _0x58bd89;};}function handleError(_0x5d349b,_0x44c0cd){_0x44c0cd=_0x44c0cd||0x1f4;return function(_0x55de7f){logger['error'](_0x55de7f[_0x8237('0x2f')]);if(_0x55de7f[_0x8237('0x30')]){delete _0x55de7f[_0x8237('0x30')];}_0x5d349b[_0x8237('0x1b')](_0x44c0cd)['send'](_0x55de7f);};}exports[_0x8237('0x31')]=function(_0x498e3,_0x565290){var _0x2e59c8={},_0x1b3c5d={},_0xad11a9={'count':0x0,'rows':[]};var _0x1b7021=_[_0x8237('0x32')](db['VoiceQueue'][_0x8237('0x33')],function(_0x2c4d74){return{'name':_0x2c4d74['fieldName'],'type':_0x2c4d74[_0x8237('0x2e')]['key']};});_0x1b3c5d[_0x8237('0x34')]=_[_0x8237('0x32')](_0x1b7021,'name');_0x1b3c5d[_0x8237('0x35')]=_[_0x8237('0x36')](_0x498e3[_0x8237('0x35')]);_0x1b3c5d[_0x8237('0x37')]=_[_0x8237('0x38')](_0x1b3c5d[_0x8237('0x34')],_0x1b3c5d['query']);_0x2e59c8[_0x8237('0x39')]=_['intersection'](_0x1b3c5d[_0x8237('0x34')],qs[_0x8237('0x3a')](_0x498e3[_0x8237('0x35')][_0x8237('0x3a')]));_0x2e59c8['attributes']=_0x2e59c8[_0x8237('0x39')][_0x8237('0x3b')]?_0x2e59c8[_0x8237('0x39')]:_0x1b3c5d['model'];if(!_0x498e3[_0x8237('0x35')][_0x8237('0x3c')]('nolimit')){_0x2e59c8[_0x8237('0x1f')]=qs['limit'](_0x498e3[_0x8237('0x35')]['limit']);_0x2e59c8[_0x8237('0x21')]=qs[_0x8237('0x21')](_0x498e3[_0x8237('0x35')]['offset']);}_0x2e59c8[_0x8237('0x3d')]=qs[_0x8237('0x3e')](_0x498e3[_0x8237('0x35')]['sort']);_0x2e59c8[_0x8237('0x3f')]=qs['filters'](_['pick'](_0x498e3[_0x8237('0x35')],_0x1b3c5d[_0x8237('0x37')]),_0x1b7021);if(_0x498e3['query']['filter']){_0x2e59c8[_0x8237('0x3f')]=_[_0x8237('0x40')](_0x2e59c8['where'],{'$or':_['map'](_0x1b7021,function(_0x20c9a7){if(_0x20c9a7[_0x8237('0x2e')]!==_0x8237('0x41')){var _0x23605c={};_0x23605c[_0x20c9a7[_0x8237('0x30')]]={'$like':'%'+_0x498e3['query'][_0x8237('0x2c')]+'%'};return _0x23605c;}})});}_0x2e59c8=_['merge']({},_0x2e59c8,_0x498e3[_0x8237('0x42')]);var _0x4ef855={'where':_0x2e59c8[_0x8237('0x3f')]};return db['VoiceQueue'][_0x8237('0x20')](_0x4ef855)[_0x8237('0x26')](function(_0x497781){_0xad11a9[_0x8237('0x20')]=_0x497781;if(_0x498e3[_0x8237('0x35')][_0x8237('0x43')]){_0x2e59c8['include']=[{'all':!![]}];}return db['VoiceQueue'][_0x8237('0x44')](_0x2e59c8);})[_0x8237('0x26')](function(_0xfad801){_0xad11a9[_0x8237('0x45')]=_0xfad801;return _0xad11a9;})[_0x8237('0x26')](respondWithFilteredResult(_0x565290,_0x2e59c8))[_0x8237('0x46')](handleError(_0x565290,null));};exports[_0x8237('0x47')]=function(_0x542c2b,_0x416129){var _0xaa4305={'raw':![],'where':{'id':_0x542c2b[_0x8237('0x48')]['id']}},_0x5bc365={};_0x5bc365[_0x8237('0x34')]=_['keys'](db[_0x8237('0x49')][_0x8237('0x33')]);_0x5bc365[_0x8237('0x35')]=_[_0x8237('0x36')](_0x542c2b[_0x8237('0x35')]);_0x5bc365[_0x8237('0x37')]=_[_0x8237('0x38')](_0x5bc365[_0x8237('0x34')],_0x5bc365[_0x8237('0x35')]);_0xaa4305[_0x8237('0x39')]=_[_0x8237('0x38')](_0x5bc365['model'],qs[_0x8237('0x3a')](_0x542c2b['query'][_0x8237('0x3a')]));_0xaa4305[_0x8237('0x39')]=_0xaa4305[_0x8237('0x39')]['length']?_0xaa4305['attributes']:_0x5bc365[_0x8237('0x34')];if(_0x542c2b[_0x8237('0x35')]['includeAll']){_0xaa4305[_0x8237('0x4a')]=[{'all':!![]}];}_0xaa4305=_['merge']({},_0xaa4305,_0x542c2b[_0x8237('0x42')]);return db[_0x8237('0x49')]['find'](_0xaa4305)[_0x8237('0x26')](handleEntityNotFound(_0x416129,null))['then'](respondWithResult(_0x416129,null))[_0x8237('0x46')](handleError(_0x416129,null));};exports[_0x8237('0x4b')]=function(_0x5b62a0,_0x576150){return db['VoiceQueue'][_0x8237('0x4b')](_0x5b62a0[_0x8237('0x4c')],{})['then'](function(_0x2b58e0){var _0x211432=_0x5b62a0['user'][_0x8237('0x28')]({'plain':!![]});if(!_0x211432)throw new Error(_0x8237('0x4d'));if(_0x211432[_0x8237('0x4e')]===_0x8237('0x4f')){var _0x519ca9=_0x2b58e0[_0x8237('0x28')]({'plain':!![]});var _0x1e4e40=[{'name':_0x8237('0x29'),'value':_0x8237('0x2a')},{'name':_0x8237('0x2b'),'value':_0x8237('0x50')}];var _0x55bbc6=_[_0x8237('0x51')](_0x1e4e40,['value',_0x519ca9[_0x8237('0x2e')]])['name'];return db[_0x8237('0x52')]['find']({'where':{'name':_0x55bbc6,'userProfileId':_0x211432[_0x8237('0x53')]},'raw':!![]})['then'](function(_0x54c23e){if(_0x54c23e&&_0x54c23e['autoAssociation']===0x0){return db[_0x8237('0x54')][_0x8237('0x4b')]({'name':_0x519ca9['name'],'resourceId':_0x519ca9['id'],'type':_0x54c23e[_0x8237('0x30')],'sectionId':_0x54c23e['id']},{})[_0x8237('0x26')](function(){return _0x2b58e0;});}else{return _0x2b58e0;}})[_0x8237('0x46')](function(_0x2c001d){logger[_0x8237('0x55')](_0x8237('0x56'),_0x2c001d);throw _0x2c001d;});}return _0x2b58e0;})[_0x8237('0x26')](respondWithResult(_0x576150,0xc9))[_0x8237('0x46')](handleError(_0x576150,null));};exports[_0x8237('0x57')]=function(_0x58f449,_0x5ed63b){var _0x3fb572={'where':{'id':_0x58f449[_0x8237('0x48')]['id']}},_0xf93b92={};_0xf93b92[_0x8237('0x34')]=_['keys'](db['VoiceQueue'][_0x8237('0x33')]);_0x3fb572[_0x8237('0x39')]=_['intersection'](_0xf93b92[_0x8237('0x34')],qs[_0x8237('0x3a')](_0x58f449[_0x8237('0x35')]['fields']));_0x3fb572['attributes']=_0x3fb572['attributes'][_0x8237('0x3b')]?_0x3fb572[_0x8237('0x39')]:_0xf93b92[_0x8237('0x34')];if(_0x58f449[_0x8237('0x35')][_0x8237('0x43')]){_0x3fb572[_0x8237('0x4a')]=[{'all':!![]}];}_0x3fb572=_[_0x8237('0x40')]({},_0x3fb572,_0x58f449[_0x8237('0x42')]);return db['VoiceQueue'][_0x8237('0x51')](_0x3fb572)['then'](handleEntityNotFound(_0x5ed63b,null))[_0x8237('0x26')](function(_0x5173b5){if(_0x5173b5){var _0x16d368=_0x5173b5[_0x8237('0x28')]({'plain':!![]});_0x16d368=qs[_0x8237('0x58')](_0x16d368,['id','createdAt',_0x8237('0x59')]);_0x58f449[_0x8237('0x4c')]=_['omit'](_0x58f449['body'],['id','createdAt',_0x8237('0x59')]);return db[_0x8237('0x49')][_0x8237('0x4b')](_[_0x8237('0x40')](_0x16d368,_0x58f449['body']),{'include':_0x58f449[_0x8237('0x35')][_0x8237('0x43')]?[{'all':!![]}]:undefined})[_0x8237('0x26')](function(_0x5d1174){var _0x5b0970=_0x58f449[_0x8237('0x4f')][_0x8237('0x28')]({'plain':!![]});if(!_0x5b0970)throw new Error(_0x8237('0x4d'));if(_0x5b0970[_0x8237('0x4e')]==='user'){var _0x5c2286=_0x5d1174[_0x8237('0x28')]({'plain':!![]});var _0x5edc77=[{'name':'VoiceQueues','value':_0x8237('0x2a')},{'name':'QueueCampaigns','value':_0x8237('0x50')}];var _0x484176=_[_0x8237('0x51')](_0x5edc77,[_0x8237('0x2d'),_0x5c2286[_0x8237('0x2e')]])['name'];return db['UserProfileSection'][_0x8237('0x51')]({'where':{'name':_0x484176,'userProfileId':_0x5b0970[_0x8237('0x53')]},'raw':!![]})[_0x8237('0x26')](function(_0x500050){if(_0x500050&&_0x500050[_0x8237('0x5a')]===0x0){return db['UserProfileResource'][_0x8237('0x4b')]({'name':_0x5c2286[_0x8237('0x30')],'resourceId':_0x5c2286['id'],'type':_0x500050['name'],'sectionId':_0x500050['id']},{})[_0x8237('0x26')](function(){return _0x5d1174;});}else{return _0x5d1174;}})[_0x8237('0x46')](function(_0x471729){logger[_0x8237('0x55')](_0x8237('0x56'),_0x471729);throw _0x471729;});}return _0x5d1174;});}})[_0x8237('0x26')](respondWithResult(_0x5ed63b,0xc9))[_0x8237('0x46')](handleError(_0x5ed63b,null));};exports[_0x8237('0x25')]=function(_0x2c079b,_0x29b114){if(_0x2c079b[_0x8237('0x4c')]['id']){delete _0x2c079b[_0x8237('0x4c')]['id'];}return db[_0x8237('0x49')]['find']({'where':{'id':_0x2c079b[_0x8237('0x48')]['id']}})[_0x8237('0x26')](handleEntityNotFound(_0x29b114,null))['then'](saveUpdates(_0x2c079b[_0x8237('0x4c')],null))[_0x8237('0x26')](respondWithResult(_0x29b114,null))['catch'](handleError(_0x29b114,null));};exports[_0x8237('0x27')]=function(_0x59383b,_0xb3dabe){return db['VoiceQueue']['find']({'where':{'id':_0x59383b[_0x8237('0x48')]['id']}})[_0x8237('0x26')](handleEntityNotFound(_0xb3dabe,null))['then'](removeEntity(_0xb3dabe,null))[_0x8237('0x46')](handleError(_0xb3dabe,null));};exports['getHoppers']=function(_0x59504d,_0x40e1b3,_0x21d1a4){var _0x3d6653={'raw':![],'where':{}};var _0x5ebbc4={};var _0x2b3d85={'count':0x0,'rows':[]};return db[_0x8237('0x49')][_0x8237('0x5b')]({'where':{'id':_0x59504d[_0x8237('0x48')]['id']}})['then'](handleEntityNotFound(_0x40e1b3,null))[_0x8237('0x26')](function(_0x1d87e7){if(_0x1d87e7){_0x5ebbc4[_0x8237('0x34')]=_[_0x8237('0x36')](db['CmHopper'][_0x8237('0x33')]);_0x5ebbc4['query']=_[_0x8237('0x36')](_0x59504d['query']);_0x5ebbc4[_0x8237('0x37')]=_[_0x8237('0x38')](_0x5ebbc4[_0x8237('0x34')],_0x5ebbc4['query']);_0x3d6653[_0x8237('0x39')]=_[_0x8237('0x38')](_0x5ebbc4[_0x8237('0x34')],qs[_0x8237('0x3a')](_0x59504d[_0x8237('0x35')]['fields']));_0x3d6653[_0x8237('0x39')]=_0x3d6653['attributes']['length']?_0x3d6653[_0x8237('0x39')]:_0x5ebbc4[_0x8237('0x34')];if(!_0x59504d[_0x8237('0x35')][_0x8237('0x3c')](_0x8237('0x5c'))){_0x3d6653['limit']=qs['limit'](_0x59504d[_0x8237('0x35')][_0x8237('0x1f')]);_0x3d6653[_0x8237('0x21')]=qs[_0x8237('0x21')](_0x59504d[_0x8237('0x35')]['offset']);}_0x3d6653['order']=qs[_0x8237('0x3e')](_0x59504d['query']['sort']);_0x3d6653[_0x8237('0x3f')]=qs[_0x8237('0x37')](_[_0x8237('0x5d')](_0x59504d[_0x8237('0x35')],_0x5ebbc4[_0x8237('0x37')]));_0x3d6653[_0x8237('0x3f')][_0x8237('0x5e')]=_0x1d87e7['id'];if(_0x59504d[_0x8237('0x35')]['filter']){_0x3d6653[_0x8237('0x3f')]=_[_0x8237('0x40')](_0x3d6653[_0x8237('0x3f')],{'$or':_['map'](_0x3d6653[_0x8237('0x39')],function(_0x5a5103){var _0x197174={};_0x197174[_0x5a5103]={'$like':'%'+_0x59504d[_0x8237('0x35')][_0x8237('0x2c')]+'%'};return _0x197174;})});}_0x3d6653=_['merge']({},_0x3d6653,_0x59504d[_0x8237('0x42')]);return db['CmHopper'][_0x8237('0x20')]({'where':_0x3d6653['where']})['then'](function(_0x4326e6){_0x2b3d85[_0x8237('0x20')]=_0x4326e6;if(_0x59504d[_0x8237('0x35')][_0x8237('0x43')]){_0x3d6653[_0x8237('0x4a')]=[{'all':!![]}];}return db[_0x8237('0x5f')][_0x8237('0x44')](_0x3d6653);})[_0x8237('0x26')](function(_0x2a70b5){_0x2b3d85['rows']=_0x2a70b5;return _0x2b3d85;});}})[_0x8237('0x26')](respondWithFilteredResult(_0x40e1b3,_0x3d6653))[_0x8237('0x46')](handleError(_0x40e1b3,null));};exports[_0x8237('0x60')]=function(_0x238506,_0x3b0abb,_0x528e27){var _0x6ac834={'raw':!![],'where':{}};var _0x381dc6={};var _0x901028={'count':0x0,'rows':[]};return db[_0x8237('0x49')]['findOne']({'where':{'id':_0x238506[_0x8237('0x48')]['id']}})[_0x8237('0x26')](handleEntityNotFound(_0x3b0abb,null))[_0x8237('0x26')](function(_0x51fe40){if(_0x51fe40){_0x381dc6[_0x8237('0x34')]=_[_0x8237('0x36')](db[_0x8237('0x61')]['rawAttributes']);_0x381dc6[_0x8237('0x35')]=_[_0x8237('0x36')](_0x238506['query']);_0x381dc6[_0x8237('0x37')]=_['intersection'](_0x381dc6[_0x8237('0x34')],_0x381dc6['query']);_0x6ac834[_0x8237('0x39')]=_[_0x8237('0x38')](_0x381dc6[_0x8237('0x34')],qs[_0x8237('0x3a')](_0x238506[_0x8237('0x35')][_0x8237('0x3a')]));_0x6ac834['attributes']=_0x6ac834[_0x8237('0x39')][_0x8237('0x3b')]?_0x6ac834[_0x8237('0x39')]:_0x381dc6[_0x8237('0x34')];if(!_0x238506[_0x8237('0x35')]['hasOwnProperty']('nolimit')){_0x6ac834[_0x8237('0x1f')]=qs[_0x8237('0x1f')](_0x238506[_0x8237('0x35')][_0x8237('0x1f')]);_0x6ac834[_0x8237('0x21')]=qs['offset'](_0x238506[_0x8237('0x35')][_0x8237('0x21')]);}_0x6ac834[_0x8237('0x3d')]=qs[_0x8237('0x3e')](_0x238506[_0x8237('0x35')][_0x8237('0x3e')]);_0x6ac834[_0x8237('0x3f')]=qs[_0x8237('0x37')](_[_0x8237('0x5d')](_0x238506[_0x8237('0x35')],_0x381dc6[_0x8237('0x37')]));_0x6ac834[_0x8237('0x3f')][_0x8237('0x5e')]=_0x51fe40['id'];if(_0x238506[_0x8237('0x35')][_0x8237('0x2c')]){_0x6ac834[_0x8237('0x3f')]=_[_0x8237('0x40')](_0x6ac834['where'],{'$or':_[_0x8237('0x32')](_0x6ac834['attributes'],function(_0x4ac787){var _0x5e58bc={};_0x5e58bc[_0x4ac787]={'$like':'%'+_0x238506[_0x8237('0x35')][_0x8237('0x2c')]+'%'};return _0x5e58bc;})});}_0x6ac834=_[_0x8237('0x40')]({},_0x6ac834,_0x238506[_0x8237('0x42')]);return db[_0x8237('0x61')][_0x8237('0x20')]({'where':_0x6ac834[_0x8237('0x3f')]})['then'](function(_0x3918e9){_0x901028[_0x8237('0x20')]=_0x3918e9;if(_0x238506[_0x8237('0x35')]['includeAll']){_0x6ac834[_0x8237('0x4a')]=[{'all':!![]}];}return db[_0x8237('0x61')][_0x8237('0x44')](_0x6ac834);})[_0x8237('0x26')](function(_0x51f755){_0x901028['rows']=_0x51f755;return _0x901028;});}})[_0x8237('0x26')](respondWithFilteredResult(_0x3b0abb,_0x6ac834))[_0x8237('0x46')](handleError(_0x3b0abb,null));};exports['getHopperFinals']=function(_0x18cf2e,_0x46d970,_0xbf6959){var _0x3dbd12={'raw':!![],'where':{}};var _0x382765={};var _0x448825={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x8237('0x5b')]({'where':{'id':_0x18cf2e[_0x8237('0x48')]['id']}})[_0x8237('0x26')](handleEntityNotFound(_0x46d970,null))['then'](function(_0x4e354f){if(_0x4e354f){_0x382765['model']=_['keys'](db[_0x8237('0x62')][_0x8237('0x33')]);_0x382765[_0x8237('0x35')]=_[_0x8237('0x36')](_0x18cf2e[_0x8237('0x35')]);_0x382765[_0x8237('0x37')]=_['intersection'](_0x382765[_0x8237('0x34')],_0x382765['query']);_0x3dbd12['attributes']=_[_0x8237('0x38')](_0x382765[_0x8237('0x34')],qs[_0x8237('0x3a')](_0x18cf2e[_0x8237('0x35')][_0x8237('0x3a')]));_0x3dbd12[_0x8237('0x39')]=_0x3dbd12[_0x8237('0x39')][_0x8237('0x3b')]?_0x3dbd12[_0x8237('0x39')]:_0x382765[_0x8237('0x34')];if(!_0x18cf2e[_0x8237('0x35')]['hasOwnProperty'](_0x8237('0x5c'))){_0x3dbd12[_0x8237('0x1f')]=qs[_0x8237('0x1f')](_0x18cf2e[_0x8237('0x35')]['limit']);_0x3dbd12[_0x8237('0x21')]=qs[_0x8237('0x21')](_0x18cf2e[_0x8237('0x35')][_0x8237('0x21')]);}_0x3dbd12[_0x8237('0x3d')]=qs[_0x8237('0x3e')](_0x18cf2e[_0x8237('0x35')][_0x8237('0x3e')]);_0x3dbd12[_0x8237('0x3f')]=qs[_0x8237('0x37')](_['pick'](_0x18cf2e['query'],_0x382765[_0x8237('0x37')]));_0x3dbd12[_0x8237('0x3f')]['VoiceQueueId']=_0x4e354f['id'];if(_0x18cf2e['query']['filter']){_0x3dbd12[_0x8237('0x3f')]=_[_0x8237('0x40')](_0x3dbd12[_0x8237('0x3f')],{'$or':_[_0x8237('0x32')](_0x3dbd12[_0x8237('0x39')],function(_0x43e7bd){var _0x4c3643={};_0x4c3643[_0x43e7bd]={'$like':'%'+_0x18cf2e[_0x8237('0x35')][_0x8237('0x2c')]+'%'};return _0x4c3643;})});}_0x3dbd12=_[_0x8237('0x40')]({},_0x3dbd12,_0x18cf2e[_0x8237('0x42')]);return db['CmHopperFinal']['count']({'where':_0x3dbd12[_0x8237('0x3f')]})[_0x8237('0x26')](function(_0x4aec34){_0x448825[_0x8237('0x20')]=_0x4aec34;if(_0x18cf2e[_0x8237('0x35')]['includeAll']){_0x3dbd12['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x8237('0x44')](_0x3dbd12);})['then'](function(_0x5774d6){_0x448825[_0x8237('0x45')]=_0x5774d6;return _0x448825;});}})[_0x8237('0x26')](respondWithFilteredResult(_0x46d970,_0x3dbd12))[_0x8237('0x46')](handleError(_0x46d970,null));};exports[_0x8237('0x63')]=function(_0x553a87,_0x318bb7,_0x256850){var _0x566abc={'raw':!![],'where':{}};var _0x1a31c7={};var _0x17c264={'count':0x0,'rows':[]};return db[_0x8237('0x49')]['findOne']({'where':{'id':_0x553a87[_0x8237('0x48')]['id']}})['then'](handleEntityNotFound(_0x318bb7,null))['then'](function(_0x1e221b){if(_0x1e221b){_0x1a31c7['model']=_[_0x8237('0x36')](db[_0x8237('0x64')][_0x8237('0x33')]);_0x1a31c7['query']=_[_0x8237('0x36')](_0x553a87[_0x8237('0x35')]);_0x1a31c7[_0x8237('0x37')]=_['intersection'](_0x1a31c7[_0x8237('0x34')],_0x1a31c7[_0x8237('0x35')]);_0x566abc[_0x8237('0x39')]=_[_0x8237('0x38')](_0x1a31c7[_0x8237('0x34')],qs[_0x8237('0x3a')](_0x553a87[_0x8237('0x35')]['fields']));_0x566abc[_0x8237('0x39')]=_0x566abc[_0x8237('0x39')]['length']?_0x566abc[_0x8237('0x39')]:_0x1a31c7['model'];if(!_0x553a87['query'][_0x8237('0x3c')](_0x8237('0x5c'))){_0x566abc[_0x8237('0x1f')]=qs[_0x8237('0x1f')](_0x553a87[_0x8237('0x35')][_0x8237('0x1f')]);_0x566abc['offset']=qs[_0x8237('0x21')](_0x553a87[_0x8237('0x35')][_0x8237('0x21')]);}_0x566abc[_0x8237('0x3d')]=qs[_0x8237('0x3e')](_0x553a87[_0x8237('0x35')][_0x8237('0x3e')]);_0x566abc[_0x8237('0x3f')]=qs[_0x8237('0x37')](_['pick'](_0x553a87[_0x8237('0x35')],_0x1a31c7[_0x8237('0x37')]));_0x566abc['where']['VoiceQueueId']=_0x1e221b['id'];if(_0x553a87['query'][_0x8237('0x2c')]){_0x566abc['where']=_[_0x8237('0x40')](_0x566abc['where'],{'$or':_[_0x8237('0x32')](_0x566abc['attributes'],function(_0x3df968){var _0xd5f6ee={};_0xd5f6ee[_0x3df968]={'$like':'%'+_0x553a87[_0x8237('0x35')][_0x8237('0x2c')]+'%'};return _0xd5f6ee;})});}_0x566abc=_['merge']({},_0x566abc,_0x553a87[_0x8237('0x42')]);return db['CmHopperBlack']['count']({'where':_0x566abc[_0x8237('0x3f')]})['then'](function(_0x2874d9){_0x17c264[_0x8237('0x20')]=_0x2874d9;if(_0x553a87[_0x8237('0x35')]['includeAll']){_0x566abc[_0x8237('0x4a')]=[{'all':!![]}];}return db[_0x8237('0x64')][_0x8237('0x44')](_0x566abc);})['then'](function(_0x596d71){_0x17c264[_0x8237('0x45')]=_0x596d71;return _0x17c264;});}})[_0x8237('0x26')](respondWithFilteredResult(_0x318bb7,_0x566abc))[_0x8237('0x46')](handleError(_0x318bb7,null));};exports[_0x8237('0x65')]=function(_0x43708e,_0x3bb770,_0x4fad9a){var _0x38dfd2={};var _0x48c79a={};var _0x317773;var _0x2a0a61;return db[_0x8237('0x49')]['findOne']({'where':{'id':_0x43708e['params']['id']}})['then'](handleEntityNotFound(_0x3bb770,null))[_0x8237('0x26')](function(_0x30e0b2){if(_0x30e0b2){_0x317773=_0x30e0b2;_0x48c79a[_0x8237('0x34')]=_[_0x8237('0x36')](db[_0x8237('0x66')][_0x8237('0x33')]);_0x48c79a[_0x8237('0x35')]=_[_0x8237('0x36')](_0x43708e[_0x8237('0x35')]);_0x48c79a[_0x8237('0x37')]=_[_0x8237('0x38')](_0x48c79a[_0x8237('0x34')],_0x48c79a[_0x8237('0x35')]);_0x38dfd2[_0x8237('0x39')]=_['intersection'](_0x48c79a[_0x8237('0x34')],qs[_0x8237('0x3a')](_0x43708e['query'][_0x8237('0x3a')]));_0x38dfd2[_0x8237('0x39')]=_0x38dfd2[_0x8237('0x39')]['length']?_0x38dfd2[_0x8237('0x39')]:_0x48c79a[_0x8237('0x34')];_0x38dfd2['order']=qs[_0x8237('0x3e')](_0x43708e['query'][_0x8237('0x3e')]);_0x38dfd2[_0x8237('0x3f')]=qs[_0x8237('0x37')](_[_0x8237('0x5d')](_0x43708e['query'],_0x48c79a[_0x8237('0x37')]));if(_0x43708e[_0x8237('0x35')]['filter']){_0x38dfd2[_0x8237('0x3f')]=_[_0x8237('0x40')](_0x38dfd2[_0x8237('0x3f')],{'$or':_[_0x8237('0x32')](_0x38dfd2[_0x8237('0x39')],function(_0x157a46){var _0x4a54a7={};_0x4a54a7[_0x157a46]={'$like':'%'+_0x43708e[_0x8237('0x35')][_0x8237('0x2c')]+'%'};return _0x4a54a7;})});}_0x38dfd2=_[_0x8237('0x40')]({},_0x38dfd2,_0x43708e[_0x8237('0x42')]);return _0x317773[_0x8237('0x65')](_0x38dfd2);}})[_0x8237('0x26')](function(_0x77d268){if(_0x77d268){_0x2a0a61=_0x77d268['length'];if(!_0x43708e['query']['hasOwnProperty'](_0x8237('0x5c'))){_0x38dfd2[_0x8237('0x1f')]=qs[_0x8237('0x1f')](_0x43708e[_0x8237('0x35')][_0x8237('0x1f')]);_0x38dfd2['offset']=qs['offset'](_0x43708e[_0x8237('0x35')]['offset']);}return _0x317773[_0x8237('0x65')](_0x38dfd2);}})[_0x8237('0x26')](function(_0x21fb8d){if(_0x21fb8d){return _0x21fb8d?{'count':_0x2a0a61,'rows':_0x21fb8d}:null;}})[_0x8237('0x26')](respondWithResult(_0x3bb770,null))[_0x8237('0x46')](handleError(_0x3bb770,null));};exports['addTeams']=function(_0x54bdce,_0x16662e,_0x53b0d0){var _0x374332=_0x54bdce['body']['teams'];var _0x491be3=_[_0x8237('0x32')](_0x374332,'id');return db[_0x8237('0x66')][_0x8237('0x44')]({'where':{'id':_0x491be3},'attributes':['id'],'include':[{'model':db[_0x8237('0x67')],'as':_0x8237('0x68'),'attributes':['id',_0x8237('0x30'),_0x8237('0x69'),_0x8237('0x6a'),_0x8237('0x6b')],'raw':!![]}]})[_0x8237('0x26')](function(_0x226a40){if(_0x226a40){var _0x1d3e06=_[_0x8237('0x6c')](_0x226a40,function(_0x4bd8f4){var _0x201b30=_0x4bd8f4[_0x8237('0x28')]({'plain':!![]});_0x201b30[_0x8237('0x68')][_0x8237('0x6d')](function(_0x1ed492){_0x1ed492[_0x8237('0x6e')]=_[_0x8237('0x51')](_0x374332,{'id':_0x201b30['id']})[_0x8237('0x6e')];});return _0x201b30[_0x8237('0x68')];});return db['VoiceQueue'][_0x8237('0x51')]({'where':{'id':_0x54bdce['params']['id']}})[_0x8237('0x26')](function(_0xd6c16d){return db[_0x8237('0x6f')]['transaction'](function(_0x3a01fb){return _0xd6c16d[_0x8237('0x70')](_0x491be3,{'transaction':_0x3a01fb})['then'](function(){return BPromise[_0x8237('0x71')](_0x374332,function(_0x1fc61c){return db[_0x8237('0x72')]['upsert']({'TeamId':_0x1fc61c['id'],'VoiceQueueId':_0x54bdce[_0x8237('0x48')]['id'],'penalty':_0x1fc61c[_0x8237('0x6e')]},{'transaction':_0x3a01fb});});})[_0x8237('0x26')](function(){return BPromise[_0x8237('0x71')](_0x1d3e06,function(_0x19b680){return db[_0x8237('0x73')][_0x8237('0x74')]({'where':{'UserId':_0x19b680['id'],'VoiceQueueId':_0x54bdce[_0x8237('0x48')]['id']},'defaults':{'penalty':_0x19b680['penalty']},'transaction':_0x3a01fb});});})[_0x8237('0x26')](function(){return BPromise['each'](_[_0x8237('0x2c')](_0x1d3e06,{'online':!![]}),function(_0x3eb977){return db[_0x8237('0x75')][_0x8237('0x76')]({'membername':_0x3eb977['name'],'UserId':_0x3eb977['id'],'queue_name':_0xd6c16d[_0x8237('0x30')],'VoiceQueueId':_0xd6c16d['id'],'interface':_[_0x8237('0x77')](_0x3eb977[_0x8237('0x6b')])?util[_0x8237('0x78')](_0x8237('0x79'),_0x3eb977[_0x8237('0x30')]):_0x3eb977[_0x8237('0x6b')],'paused':_0x3eb977['voicePause']||![],'penalty':_0x3eb977['penalty']},{'transaction':_0x3a01fb});});})[_0x8237('0x26')](function(){_0x1d3e06[_0x8237('0x6d')](function(_0x2c7b6f){socket[_0x8237('0x7a')](_0x8237('0x7b'),{'UserId':_0x2c7b6f['id'],'VoiceQueueId':_0xd6c16d['id']});});});});});}})[_0x8237('0x26')](respondWithStatusCode(_0x16662e,null))['catch'](handleError(_0x16662e,null));};exports[_0x8237('0x7c')]=function(_0x2655d2,_0xd04ac1,_0x549100){return db[_0x8237('0x66')]['findAll']({'where':{'id':_0x2655d2[_0x8237('0x35')][_0x8237('0x7d')]},'attributes':['id'],'include':[{'model':db[_0x8237('0x67')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8237('0x26')](handleEntityNotFound(_0xd04ac1,null))[_0x8237('0x26')](function(_0x97554){var _0x565357=_[_0x8237('0x32')](_0x97554,'id');var _0x2ef121=[];var _0x20743e=[];var _0x31c7e0=squel[_0x8237('0x7e')]();_0x31c7e0[_0x8237('0x7f')](_0x8237('0x80'))['from']('team_has_voice_queues','tq')[_0x8237('0x81')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x8237('0x3f')](_0x8237('0x82'),_0x2655d2['params']['id']);for(var _0xf183c7=0x0;_0xf183c7<_0x97554['length'];_0xf183c7+=0x1){let _0x58eaed=_0x97554[_0xf183c7];for(var _0x5a4a28=0x0;_0x5a4a28<_0x58eaed['Agents']['length'];_0x5a4a28+=0x1){let _0x315e2c=_0x58eaed['Agents'][_0x5a4a28];var _0x377d89=_0x31c7e0[_0x8237('0x57')]();_0x377d89[_0x8237('0x3f')](_0x8237('0x83'),_0x315e2c['id']);_0x20743e['push'](db[_0x8237('0x6f')][_0x8237('0x35')](_0x377d89[_0x8237('0x84')](),{'type':db[_0x8237('0x6f')][_0x8237('0x85')]['SELECT']})['then'](function(_0x57af1d){if(_0x57af1d[_0x8237('0x3b')]===0x1){return _0x315e2c['id'];}else{var _0x55113d=_[_0x8237('0x86')](_[_0x8237('0x32')](_0x57af1d,_0x8237('0x87')),function(_0x4c42d5){return _[_0x8237('0x88')](_0x565357,_0x4c42d5);});if(_0x55113d){return _0x315e2c['id'];}}}));}}return BPromise[_0x8237('0x89')](_0x20743e)['then'](function(_0x50552c){_0x2ef121=_(_0x2ef121)[_0x8237('0x8a')](_0x50552c)['compact']()[_0x8237('0x2d')]();return db[_0x8237('0x49')][_0x8237('0x51')]({'where':{'id':_0x2655d2[_0x8237('0x48')]['id']}})[_0x8237('0x26')](function(_0x18f1d0){return db[_0x8237('0x6f')][_0x8237('0x8b')](function(_0x5f3ea5){return _0x18f1d0[_0x8237('0x7c')](_0x2655d2['query'][_0x8237('0x7d')],{'transaction':_0x5f3ea5})[_0x8237('0x26')](function(){if(!_[_0x8237('0x8c')](_0x2ef121)){return _0x18f1d0[_0x8237('0x8d')](_0x2ef121,{'transaction':_0x5f3ea5})[_0x8237('0x26')](function(){return db['UserVoiceQueueRt'][_0x8237('0x27')]({'where':{'VoiceQueueId':_0x2655d2[_0x8237('0x48')]['id'],'UserId':_0x2ef121},'transaction':_0x5f3ea5});});}})[_0x8237('0x26')](function(){_0x2ef121[_0x8237('0x6d')](function(_0x28995a){socket[_0x8237('0x7a')]('userVoiceQueue:remove',{'UserId':_0x28995a,'VoiceQueueId':_0x18f1d0['id']});});});});});});})[_0x8237('0x26')](respondWithStatusCode(_0xd04ac1,null))[_0x8237('0x46')](handleError(_0xd04ac1,null));};exports[_0x8237('0x8e')]=function(_0x5a8c48,_0xeabc3d,_0x4f66f3){var _0x2702ce,_0x39bfbf;return db['VoiceQueue'][_0x8237('0x51')]({'where':{'id':_0x5a8c48[_0x8237('0x48')]['id']}})[_0x8237('0x26')](handleEntityNotFound(_0xeabc3d,null))[_0x8237('0x26')](function(_0x5d6d36){if(_0x5d6d36){_0x39bfbf=_0x5d6d36;return _0x5d6d36[_0x8237('0x8e')](_0x5a8c48[_0x8237('0x4c')]['ids'],_[_0x8237('0x58')](_0x5a8c48[_0x8237('0x4c')],[_0x8237('0x7d'),'id'])||{})[_0x8237('0x8f')](function(_0xfbbdc7){for(var _0x20e31b=0x0;_0x20e31b<_0x5a8c48[_0x8237('0x4c')][_0x8237('0x7d')][_0x8237('0x3b')];_0x20e31b+=0x1){socket[_0x8237('0x7a')](_0x8237('0x7b'),{'UserId':Number(_0x5a8c48['body'][_0x8237('0x7d')][_0x20e31b]),'VoiceQueueId':Number(_0x5a8c48[_0x8237('0x48')]['id'])});}return _0xfbbdc7;});}})[_0x8237('0x26')](function(_0x34a03a){_0x2702ce=_0x34a03a||[];if(_0x39bfbf){return db[_0x8237('0x67')][_0x8237('0x44')]({'where':{'id':_0x5a8c48[_0x8237('0x4c')]['ids']},'attributes':['id','name',_0x8237('0x69'),_0x8237('0x6a'),'interface'],'raw':!![]});}})[_0x8237('0x26')](function(_0x4b339b){if(!_[_0x8237('0x8c')](_0x4b339b)){var _0x51b631=[];for(var _0x2f2fd8=0x0;_0x2f2fd8<_0x4b339b['length'];_0x2f2fd8++){if(_0x4b339b[_0x2f2fd8]['online']){_0x51b631[_0x8237('0x90')](db['UserVoiceQueueRt'][_0x8237('0x76')]({'membername':_0x4b339b[_0x2f2fd8]['name'],'UserId':_0x4b339b[_0x2f2fd8]['id'],'queue_name':_0x39bfbf[_0x8237('0x30')],'VoiceQueueId':_0x39bfbf['id'],'interface':_[_0x8237('0x77')](_0x4b339b[_0x2f2fd8][_0x8237('0x6b')])?util['format'](_0x8237('0x79'),_0x4b339b[_0x2f2fd8]['name']):_0x4b339b[_0x2f2fd8][_0x8237('0x6b')],'paused':_0x4b339b[_0x2f2fd8]['voicePause']||![],'penalty':_0x5a8c48[_0x8237('0x4c')][_0x8237('0x6e')]||0x0}));}}return BPromise[_0x8237('0x89')](_0x51b631);}})[_0x8237('0x26')](function(){return _0x2702ce;})['then'](respondWithResult(_0xeabc3d,null))['catch'](handleError(_0xeabc3d,null));};exports[_0x8237('0x8d')]=function(_0x4dbe4,_0xeb7309,_0x1e6745){return db[_0x8237('0x49')]['find']({'where':{'id':_0x4dbe4['params']['id']}})[_0x8237('0x26')](handleEntityNotFound(_0xeb7309,null))[_0x8237('0x26')](function(_0x136ba4){if(_0x136ba4){return _0x136ba4[_0x8237('0x8d')](_0x4dbe4[_0x8237('0x35')]['ids'])[_0x8237('0x26')](function(){if(_[_0x8237('0x91')](_0x4dbe4[_0x8237('0x35')][_0x8237('0x7d')])){for(var _0x4b3016=0x0;_0x4b3016<_0x4dbe4[_0x8237('0x35')][_0x8237('0x7d')][_0x8237('0x3b')];_0x4b3016+=0x1){socket[_0x8237('0x7a')](_0x8237('0x92'),{'UserId':Number(_0x4dbe4['query'][_0x8237('0x7d')][_0x4b3016]),'VoiceQueueId':Number(_0x4dbe4[_0x8237('0x48')]['id'])});}}else{socket[_0x8237('0x7a')]('userVoiceQueue:remove',{'UserId':Number(_0x4dbe4[_0x8237('0x35')]['ids']),'VoiceQueueId':Number(_0x4dbe4['params']['id'])});}});}})[_0x8237('0x26')](function(_0x363bb6){return db[_0x8237('0x75')]['destroy']({'where':{'VoiceQueueId':_0x4dbe4[_0x8237('0x48')]['id'],'UserId':_0x4dbe4[_0x8237('0x35')][_0x8237('0x7d')]}})[_0x8237('0x26')](function(){return _0x363bb6;});})[_0x8237('0x26')](respondWithStatusCode(_0xeb7309,null))[_0x8237('0x46')](handleError(_0xeb7309,null));};exports[_0x8237('0x93')]=function(_0x56aeb6,_0x30d27f,_0x1489d5){var _0xe39d9c={};var _0x3838c3={};var _0x471d29;var _0x23697d;return db[_0x8237('0x49')][_0x8237('0x5b')]({'where':{'id':_0x56aeb6[_0x8237('0x48')]['id']}})['then'](handleEntityNotFound(_0x30d27f,null))['then'](function(_0x2a28ba){if(_0x2a28ba){_0x471d29=_0x2a28ba;_0x3838c3[_0x8237('0x34')]=_['keys'](db[_0x8237('0x67')][_0x8237('0x33')]);_0x3838c3[_0x8237('0x35')]=_['keys'](_0x56aeb6[_0x8237('0x35')]);_0x3838c3[_0x8237('0x37')]=_[_0x8237('0x38')](_0x3838c3['model'],_0x3838c3[_0x8237('0x35')]);_0xe39d9c[_0x8237('0x39')]=_['intersection'](_0x3838c3[_0x8237('0x34')],qs[_0x8237('0x3a')](_0x56aeb6[_0x8237('0x35')]['fields']));_0xe39d9c[_0x8237('0x39')]=_0xe39d9c['attributes'][_0x8237('0x3b')]?_0xe39d9c[_0x8237('0x39')]:_0x3838c3['model'];_0xe39d9c['order']=qs[_0x8237('0x3e')](_0x56aeb6[_0x8237('0x35')]['sort']);_0xe39d9c['where']=qs[_0x8237('0x37')](_[_0x8237('0x5d')](_0x56aeb6[_0x8237('0x35')],_0x3838c3['filters']));if(_0x56aeb6[_0x8237('0x35')][_0x8237('0x2c')]){_0xe39d9c[_0x8237('0x3f')]=_[_0x8237('0x40')](_0xe39d9c[_0x8237('0x3f')],{'$or':_[_0x8237('0x32')](_0xe39d9c[_0x8237('0x39')],function(_0xae93c8){var _0x1d1cf2={};_0x1d1cf2[_0xae93c8]={'$like':'%'+_0x56aeb6[_0x8237('0x35')][_0x8237('0x2c')]+'%'};return _0x1d1cf2;})});}_0xe39d9c=_[_0x8237('0x40')]({},_0xe39d9c,_0x56aeb6['options']);return _0x471d29[_0x8237('0x93')](_0xe39d9c);}})[_0x8237('0x26')](function(_0x153728){if(_0x153728){_0x23697d=_0x153728[_0x8237('0x3b')];if(!_0x56aeb6[_0x8237('0x35')][_0x8237('0x3c')](_0x8237('0x5c'))){_0xe39d9c[_0x8237('0x1f')]=qs[_0x8237('0x1f')](_0x56aeb6['query']['limit']);_0xe39d9c[_0x8237('0x21')]=qs[_0x8237('0x21')](_0x56aeb6[_0x8237('0x35')][_0x8237('0x21')]);}return _0x471d29[_0x8237('0x93')](_0xe39d9c);}})[_0x8237('0x26')](function(_0x32c690){if(_0x32c690){return _0x32c690?{'count':_0x23697d,'rows':_0x32c690}:null;}})[_0x8237('0x26')](respondWithResult(_0x30d27f,null))[_0x8237('0x46')](handleError(_0x30d27f,null));};exports[_0x8237('0x94')]=function(_0x4f7e33,_0xf80293,_0x115fe1){var _0x2164de={};var _0x36f29b={};var _0x3bd5c4;var _0x2a805f;return db[_0x8237('0x49')]['findOne']({'where':{'id':_0x4f7e33[_0x8237('0x48')]['id']}})[_0x8237('0x26')](handleEntityNotFound(_0xf80293,null))[_0x8237('0x26')](function(_0x60a608){if(_0x60a608){_0x3bd5c4=_0x60a608;_0x36f29b['model']=_[_0x8237('0x36')](db[_0x8237('0x75')][_0x8237('0x33')]);_0x36f29b[_0x8237('0x35')]=_['keys'](_0x4f7e33[_0x8237('0x35')]);_0x36f29b[_0x8237('0x37')]=_[_0x8237('0x38')](_0x36f29b[_0x8237('0x34')],_0x36f29b[_0x8237('0x35')]);_0x2164de[_0x8237('0x39')]=_[_0x8237('0x38')](_0x36f29b[_0x8237('0x34')],qs['fields'](_0x4f7e33[_0x8237('0x35')][_0x8237('0x3a')]));_0x2164de[_0x8237('0x39')]=_0x2164de[_0x8237('0x39')][_0x8237('0x3b')]?_0x2164de[_0x8237('0x39')]:_0x36f29b[_0x8237('0x34')];_0x2164de[_0x8237('0x3d')]=qs[_0x8237('0x3e')](_0x4f7e33['query'][_0x8237('0x3e')]);_0x2164de[_0x8237('0x3f')]=qs[_0x8237('0x37')](_[_0x8237('0x5d')](_0x4f7e33[_0x8237('0x35')],_0x36f29b[_0x8237('0x37')]));if(_0x4f7e33[_0x8237('0x35')][_0x8237('0x2c')]){_0x2164de[_0x8237('0x3f')]=_['merge'](_0x2164de[_0x8237('0x3f')],{'$or':_['map'](_0x2164de[_0x8237('0x39')],function(_0x4621bd){var _0x205a68={};_0x205a68[_0x4621bd]={'$like':'%'+_0x4f7e33[_0x8237('0x35')]['filter']+'%'};return _0x205a68;})});}_0x2164de=_[_0x8237('0x40')]({},_0x2164de,_0x4f7e33[_0x8237('0x42')]);return _0x3bd5c4[_0x8237('0x94')](_0x2164de);}})[_0x8237('0x26')](function(_0x43d62b){if(_0x43d62b){_0x2a805f=_0x43d62b[_0x8237('0x3b')];if(!_0x4f7e33[_0x8237('0x35')][_0x8237('0x3c')](_0x8237('0x5c'))){_0x2164de[_0x8237('0x1f')]=qs[_0x8237('0x1f')](_0x4f7e33[_0x8237('0x35')][_0x8237('0x1f')]);_0x2164de['offset']=qs[_0x8237('0x21')](_0x4f7e33[_0x8237('0x35')][_0x8237('0x21')]);}return _0x3bd5c4[_0x8237('0x94')](_0x2164de);}})[_0x8237('0x26')](function(_0x835126){return _0x835126?{'count':_0x2a805f,'rows':_0x835126}:null;})[_0x8237('0x26')](respondWithResult(_0xf80293,null))[_0x8237('0x46')](handleError(_0xf80293,null));};exports[_0x8237('0x95')]=function(_0x83100c,_0x2aee0d,_0x316e4c){var _0x4e7588={};var _0x645f81={};var _0x2d6c86;var _0x2d8fc9;return db['VoiceQueue'][_0x8237('0x5b')]({'where':{'id':_0x83100c[_0x8237('0x48')]['id']}})[_0x8237('0x26')](handleEntityNotFound(_0x2aee0d,null))['then'](function(_0x36bbb5){if(_0x36bbb5){_0x2d6c86=_0x36bbb5;_0x645f81['model']=_[_0x8237('0x36')](db['CmList'][_0x8237('0x33')]);_0x645f81[_0x8237('0x35')]=_['keys'](_0x83100c[_0x8237('0x35')]);_0x645f81[_0x8237('0x37')]=_[_0x8237('0x38')](_0x645f81[_0x8237('0x34')],_0x645f81[_0x8237('0x35')]);_0x4e7588[_0x8237('0x39')]=_[_0x8237('0x38')](_0x645f81[_0x8237('0x34')],qs['fields'](_0x83100c[_0x8237('0x35')][_0x8237('0x3a')]));_0x4e7588[_0x8237('0x39')]=_0x4e7588[_0x8237('0x39')][_0x8237('0x3b')]?_0x4e7588[_0x8237('0x39')]:_0x645f81['model'];_0x4e7588['order']=qs[_0x8237('0x3e')](_0x83100c[_0x8237('0x35')][_0x8237('0x3e')]);_0x4e7588['where']=qs[_0x8237('0x37')](_['pick'](_0x83100c['query'],_0x645f81[_0x8237('0x37')]));if(_0x83100c[_0x8237('0x35')]['filter']){_0x4e7588[_0x8237('0x3f')]=_[_0x8237('0x40')](_0x4e7588[_0x8237('0x3f')],{'$or':_[_0x8237('0x32')](_0x4e7588[_0x8237('0x39')],function(_0x4ace29){var _0x213e7b={};_0x213e7b[_0x4ace29]={'$like':'%'+_0x83100c[_0x8237('0x35')]['filter']+'%'};return _0x213e7b;})});}_0x4e7588=_[_0x8237('0x40')]({},_0x4e7588,_0x83100c[_0x8237('0x42')]);return _0x2d6c86[_0x8237('0x95')](_0x4e7588);}})['then'](function(_0x2c4ff9){if(_0x2c4ff9){_0x2d8fc9=_0x2c4ff9[_0x8237('0x3b')];if(!_0x83100c[_0x8237('0x35')][_0x8237('0x3c')](_0x8237('0x5c'))){_0x4e7588['limit']=qs[_0x8237('0x1f')](_0x83100c[_0x8237('0x35')][_0x8237('0x1f')]);_0x4e7588[_0x8237('0x21')]=qs[_0x8237('0x21')](_0x83100c[_0x8237('0x35')][_0x8237('0x21')]);}return _0x2d6c86[_0x8237('0x95')](_0x4e7588);}})[_0x8237('0x26')](function(_0x2b8cf4){if(_0x2b8cf4){return _0x2b8cf4?{'count':_0x2d8fc9,'rows':_0x2b8cf4}:null;}})[_0x8237('0x26')](respondWithResult(_0x2aee0d,null))[_0x8237('0x46')](handleError(_0x2aee0d,null));};exports[_0x8237('0x96')]=function(_0x38d4c8,_0x1da26a,_0x112ccd){var _0x419084,_0x1c2504;return db[_0x8237('0x49')]['find']({'where':{'id':_0x38d4c8[_0x8237('0x48')]['id']}})[_0x8237('0x26')](handleEntityNotFound(_0x1da26a,null))[_0x8237('0x26')](function(_0x440026){if(_0x440026){_0x1c2504=_0x440026;return _0x440026['addLists'](_0x38d4c8['body'][_0x8237('0x7d')],_[_0x8237('0x58')](_0x38d4c8['body'],[_0x8237('0x7d'),'id'])||{});}return null;})['spread'](function(_0x1e2b30){var _0x1cf03a;_0x419084=_0x1e2b30||[];var _0xf40fb4=[];if(_0x1e2b30){for(var _0x2afad1=0x0;_0x2afad1<_0x1e2b30[_0x8237('0x3b')];_0x2afad1+=0x1){var _0x552bdd=_0x1e2b30[_0x2afad1]['get']({'plain':!![]});_0x1c2504[_0x8237('0x97')]=_0x38d4c8[_0x8237('0x4c')][_0x8237('0x97')]?_0x38d4c8['body'][_0x8237('0x97')]:_0x1c2504[_0x8237('0x97')];switch(_0x1c2504[_0x8237('0x97')]){case _0x8237('0x98'):_0x1cf03a=squel[_0x8237('0x99')]()['into']('cm_hopper')[_0x8237('0x9a')]([_0x8237('0x9b'),_0x8237('0x9c'),'ContactId',_0x8237('0x9d'),_0x8237('0x5e'),_0x8237('0x9e'),_0x8237('0x59')],squel['select']()['field']('phone',_0x8237('0x9b'))[_0x8237('0x7f')]('NOW()',_0x8237('0x9c'))[_0x8237('0x7f')]('id','ContactId')[_0x8237('0x7f')](_0x552bdd[_0x8237('0x9f')]['toString'](),'ListId')[_0x8237('0x7f')](_0x38d4c8[_0x8237('0x48')]['id']['toString'](),_0x8237('0x5e'))[_0x8237('0x7f')]('NOW()','createdAt')['field'](_0x8237('0xa0'),_0x8237('0x59'))[_0x8237('0xa1')](_0x8237('0xa2'))[_0x8237('0x3f')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x552bdd[_0x8237('0x9f')]['toString']())['where'](_0x8237('0xa3'))[_0x8237('0x3f')](_0x8237('0xa4'),squel['select']()['field'](_0x8237('0xa5'))[_0x8237('0xa1')](_0x8237('0xa6'))['where']('VoiceQueueId\x20=\x20?',_0x38d4c8[_0x8237('0x48')]['id'][_0x8237('0x84')]()))[_0x8237('0x3f')](_0x8237('0xa4'),squel[_0x8237('0x7e')]()[_0x8237('0x7f')]('COALESCE(phone,\x27\x27)')['from'](_0x8237('0xa7'))[_0x8237('0x3f')](_0x8237('0x82'),_0x38d4c8[_0x8237('0x48')]['id'][_0x8237('0x84')]())))[_0x8237('0x84')]();break;case _0x8237('0xa8'):_0x1cf03a=squel[_0x8237('0x99')]()[_0x8237('0xa9')](_0x8237('0xa7'))[_0x8237('0x9a')]([_0x8237('0x9b'),_0x8237('0x9c'),_0x8237('0xaa'),_0x8237('0x9d'),_0x8237('0x5e'),_0x8237('0x9e'),_0x8237('0x59')],squel['select']()['field'](_0x8237('0x9b'),_0x8237('0x9b'))[_0x8237('0x7f')](_0x8237('0xa0'),'scheduledAt')[_0x8237('0x7f')]('id',_0x8237('0xaa'))[_0x8237('0x7f')](_0x552bdd[_0x8237('0x9f')]['toString'](),_0x8237('0x9d'))[_0x8237('0x7f')](_0x38d4c8[_0x8237('0x48')]['id'][_0x8237('0x84')](),'VoiceQueueId')[_0x8237('0x7f')](_0x8237('0xa0'),_0x8237('0x9e'))[_0x8237('0x7f')](_0x8237('0xa0'),_0x8237('0x59'))[_0x8237('0xa1')](_0x8237('0xa2'))['where']('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x552bdd[_0x8237('0x9f')][_0x8237('0x84')]())[_0x8237('0x3f')](_0x8237('0xa3'))[_0x8237('0x3f')](_0x8237('0xa4'),squel[_0x8237('0x7e')]()[_0x8237('0x7f')](_0x8237('0xab'))[_0x8237('0xa1')](_0x8237('0xa7'))['where']('VoiceQueueId\x20=\x20?',_0x38d4c8[_0x8237('0x48')]['id'][_0x8237('0x84')]())))[_0x8237('0x84')]();break;default:_0x1cf03a=squel[_0x8237('0x99')]()['into'](_0x8237('0xa7'))[_0x8237('0x9a')]([_0x8237('0x9b'),'scheduledAt',_0x8237('0xaa'),_0x8237('0x9d'),_0x8237('0x5e'),_0x8237('0x9e'),_0x8237('0x59')],squel[_0x8237('0x7e')]()[_0x8237('0x7f')](_0x8237('0x9b'),_0x8237('0x9b'))[_0x8237('0x7f')](_0x8237('0xa0'),'scheduledAt')['field']('id',_0x8237('0xaa'))[_0x8237('0x7f')](_0x552bdd[_0x8237('0x9f')][_0x8237('0x84')](),_0x8237('0x9d'))[_0x8237('0x7f')](_0x38d4c8[_0x8237('0x48')]['id'][_0x8237('0x84')](),_0x8237('0x5e'))[_0x8237('0x7f')](_0x8237('0xa0'),'createdAt')[_0x8237('0x7f')](_0x8237('0xa0'),_0x8237('0x59'))[_0x8237('0xa1')](_0x8237('0xa2'))[_0x8237('0x3f')](_0x8237('0xac'))[_0x8237('0x3f')]('ListId\x20=\x20?',_0x552bdd['CmListId'][_0x8237('0x84')]())[_0x8237('0x3f')](_0x8237('0xa3')))[_0x8237('0x84')]();}_0xf40fb4[_0x8237('0x90')](db[_0x8237('0x6f')]['query'](_0x1cf03a));}return BPromise[_0x8237('0x89')](_0xf40fb4);}})[_0x8237('0x26')](function(){return _0x419084;})[_0x8237('0x26')](respondWithResult(_0x1da26a,null))[_0x8237('0x46')](handleError(_0x1da26a,null));};exports[_0x8237('0xad')]=function(_0x4bf0ac,_0x48992d,_0x342a4f){return db['VoiceQueue'][_0x8237('0x51')]({'where':{'id':_0x4bf0ac['params']['id']}})['then'](handleEntityNotFound(_0x48992d,null))['then'](function(_0x21ef2d){if(_0x21ef2d){return _0x21ef2d[_0x8237('0xad')](_0x4bf0ac[_0x8237('0x35')][_0x8237('0x7d')]);}})[_0x8237('0x26')](function(_0x4f2065){if(_0x4f2065){return db['CmHopper'][_0x8237('0x27')]({'where':{'ListId':_0x4bf0ac['query'][_0x8237('0x7d')],'VoiceQueueId':_0x4bf0ac['params']['id']}})[_0x8237('0x26')](function(){return _0x4f2065;});}})[_0x8237('0x26')](respondWithStatusCode(_0x48992d,null))[_0x8237('0x46')](handleError(_0x48992d,null));};exports['getBlackLists']=function(_0x5e8554,_0x5033dc,_0x27d744){var _0x3d6a88={};var _0x351d33={};var _0x5c5272;var _0x592987;return db[_0x8237('0x49')][_0x8237('0x5b')]({'where':{'id':_0x5e8554[_0x8237('0x48')]['id']}})['then'](handleEntityNotFound(_0x5033dc,null))['then'](function(_0x16cf3a){if(_0x16cf3a){_0x5c5272=_0x16cf3a;_0x351d33['model']=_[_0x8237('0x36')](db[_0x8237('0xae')][_0x8237('0x33')]);_0x351d33['query']=_[_0x8237('0x36')](_0x5e8554['query']);_0x351d33['filters']=_[_0x8237('0x38')](_0x351d33[_0x8237('0x34')],_0x351d33['query']);_0x3d6a88[_0x8237('0x39')]=_[_0x8237('0x38')](_0x351d33[_0x8237('0x34')],qs['fields'](_0x5e8554[_0x8237('0x35')][_0x8237('0x3a')]));_0x3d6a88['attributes']=_0x3d6a88['attributes'][_0x8237('0x3b')]?_0x3d6a88[_0x8237('0x39')]:_0x351d33[_0x8237('0x34')];_0x3d6a88['order']=qs['sort'](_0x5e8554[_0x8237('0x35')]['sort']);_0x3d6a88[_0x8237('0x3f')]=qs[_0x8237('0x37')](_[_0x8237('0x5d')](_0x5e8554['query'],_0x351d33[_0x8237('0x37')]));if(_0x5e8554[_0x8237('0x35')][_0x8237('0x2c')]){_0x3d6a88[_0x8237('0x3f')]=_['merge'](_0x3d6a88[_0x8237('0x3f')],{'$or':_['map'](_0x3d6a88['attributes'],function(_0x21acd4){var _0x1cd000={};_0x1cd000[_0x21acd4]={'$like':'%'+_0x5e8554['query']['filter']+'%'};return _0x1cd000;})});}_0x3d6a88=_[_0x8237('0x40')]({},_0x3d6a88,_0x5e8554[_0x8237('0x42')]);return _0x5c5272[_0x8237('0xaf')](_0x3d6a88);}})[_0x8237('0x26')](function(_0x5c1ac8){if(_0x5c1ac8){_0x592987=_0x5c1ac8[_0x8237('0x3b')];if(!_0x5e8554['query'][_0x8237('0x3c')](_0x8237('0x5c'))){_0x3d6a88[_0x8237('0x1f')]=qs[_0x8237('0x1f')](_0x5e8554[_0x8237('0x35')][_0x8237('0x1f')]);_0x3d6a88[_0x8237('0x21')]=qs[_0x8237('0x21')](_0x5e8554[_0x8237('0x35')][_0x8237('0x21')]);}return _0x5c5272[_0x8237('0xaf')](_0x3d6a88);}})[_0x8237('0x26')](function(_0x5437ac){if(_0x5437ac){return _0x5437ac?{'count':_0x592987,'rows':_0x5437ac}:null;}})[_0x8237('0x26')](respondWithResult(_0x5033dc,null))['catch'](handleError(_0x5033dc,null));};exports[_0x8237('0xb0')]=function(_0x48082f,_0x3638c8,_0x155b17){var _0x30e7dd,_0x4b4c9d;return db[_0x8237('0x49')][_0x8237('0x51')]({'where':{'id':_0x48082f[_0x8237('0x48')]['id']}})[_0x8237('0x26')](handleEntityNotFound(_0x3638c8,null))[_0x8237('0x26')](function(_0x27748b){if(_0x27748b){_0x4b4c9d=_0x27748b;return _0x27748b[_0x8237('0xb0')](_0x48082f[_0x8237('0x4c')][_0x8237('0x7d')],_['omit'](_0x48082f[_0x8237('0x4c')],[_0x8237('0x7d'),'id'])||{});}return null;})[_0x8237('0x8f')](function(_0xe340b1){var _0xa46cab;_0x30e7dd=_0xe340b1||[];var _0x55ef77=[];if(_0xe340b1){for(var _0x2bd3ca=0x0;_0x2bd3ca<_0xe340b1[_0x8237('0x3b')];_0x2bd3ca+=0x1){var _0xac792c=_0xe340b1[_0x2bd3ca][_0x8237('0x28')]({'plain':!![]});_0xa46cab=squel[_0x8237('0x99')]()[_0x8237('0xa9')]('cm_hopper_black')[_0x8237('0x9a')]([_0x8237('0x9b'),_0x8237('0xaa'),_0x8237('0x9d'),'VoiceQueueId',_0x8237('0x9e'),'updatedAt'],squel[_0x8237('0x7e')]()[_0x8237('0x7f')](_0x8237('0x9b'),_0x8237('0x9b'))[_0x8237('0x7f')]('id','ContactId')['field'](_0xac792c[_0x8237('0x9f')][_0x8237('0x84')](),_0x8237('0x9d'))[_0x8237('0x7f')](_0x48082f['params']['id'][_0x8237('0x84')](),_0x8237('0x5e'))[_0x8237('0x7f')](_0x8237('0xa0'),_0x8237('0x9e'))[_0x8237('0x7f')]('NOW()',_0x8237('0x59'))[_0x8237('0xa1')](_0x8237('0xa2'))['where'](_0x8237('0xac'))[_0x8237('0x3f')]('ListId\x20=\x20?',_0xac792c['CmListId'][_0x8237('0x84')]())['where'](_0x8237('0xa3')))[_0x8237('0x84')]();_0x55ef77[_0x8237('0x90')](db['sequelize'][_0x8237('0x35')](_0xa46cab));}return BPromise[_0x8237('0x89')](_0x55ef77);}})[_0x8237('0x26')](function(){return _0x30e7dd;})[_0x8237('0x26')](respondWithResult(_0x3638c8,null))[_0x8237('0x46')](handleError(_0x3638c8,null));};exports[_0x8237('0xb1')]=function(_0x3ac1a9,_0x3f6de8,_0x5675fe){return db['VoiceQueue']['find']({'where':{'id':_0x3ac1a9[_0x8237('0x48')]['id']}})[_0x8237('0x26')](handleEntityNotFound(_0x3f6de8,null))[_0x8237('0x26')](function(_0x4bc79f){if(_0x4bc79f){return _0x4bc79f[_0x8237('0xb1')](_0x3ac1a9[_0x8237('0x35')][_0x8237('0x7d')]);}})[_0x8237('0x26')](function(_0x52a38f){if(_0x52a38f){return db[_0x8237('0x64')]['destroy']({'where':{'ListId':_0x3ac1a9[_0x8237('0x35')][_0x8237('0x7d')],'VoiceQueueId':_0x3ac1a9[_0x8237('0x48')]['id']}})[_0x8237('0x26')](function(){return _0x52a38f;});}})['then'](respondWithStatusCode(_0x3f6de8,null))[_0x8237('0x46')](handleError(_0x3f6de8,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index d208548..74bc727 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 _0xe30e=['save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','VoiceQueue','setMaxListeners'];(function(_0x1cb89e,_0x1f32d7){var _0x2ec8db=function(_0x15e253){while(--_0x15e253){_0x1cb89e['push'](_0x1cb89e['shift']());}};_0x2ec8db(++_0x1f32d7);}(_0xe30e,0x153));var _0xee30=function(_0xab2622,_0x582313){_0xab2622=_0xab2622-0x0;var _0x3ab544=_0xe30e[_0xab2622];return _0x3ab544;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xee30('0x0'))['db'][_0xee30('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xee30('0x2')](0x0);var events={'afterCreate':_0xee30('0x3'),'afterUpdate':_0xee30('0x4'),'afterDestroy':_0xee30('0x5')};function emitEvent(_0x61a215){return function(_0x15e7dd,_0xd8343f,_0x496080){VoiceQueueEvents[_0xee30('0x6')](_0x61a215+':'+_0x15e7dd['id'],_0x15e7dd);VoiceQueueEvents[_0xee30('0x6')](_0x61a215,_0x15e7dd);_0x496080(null);};}for(var e in events){if(events[_0xee30('0x7')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xee30('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0xfc9d=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','update','remove'];(function(_0x4bd06e,_0x593701){var _0x85ebb=function(_0x26a7f2){while(--_0x26a7f2){_0x4bd06e['push'](_0x4bd06e['shift']());}};_0x85ebb(++_0x593701);}(_0xfc9d,0xa3));var _0xdfc9=function(_0x1a78f0,_0x398b53){_0x1a78f0=_0x1a78f0-0x0;var _0x3704e5=_0xfc9d[_0x1a78f0];return _0x3704e5;};'use strict';var EventEmitter=require(_0xdfc9('0x0'));var VoiceQueue=require(_0xdfc9('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xdfc9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdfc9('0x3'),'afterDestroy':_0xdfc9('0x4')};function emitEvent(_0x1aa42f){return function(_0x503955,_0x15ade9,_0x2900d0){VoiceQueueEvents[_0xdfc9('0x5')](_0x1aa42f+':'+_0x503955['id'],_0x503955);VoiceQueueEvents[_0xdfc9('0x5')](_0x1aa42f,_0x503955);_0x2900d0(null);};}for(var e in events){if(events[_0xdfc9('0x6')](e)){var event=events[e];VoiceQueue[_0xdfc9('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index d4cff05..3b9c3ff 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(_0x2093f0,_0x1f903c){var _0x37829f=function(_0x27d3bc){while(--_0x27d3bc){_0x2093f0['push'](_0x2093f0['shift']());}};_0x37829f(++_0x1f903c);}(_0x3e74,0x175));var _0x43e7=function(_0x2aebe,_0x166a87){_0x2aebe=_0x2aebe-0x0;var _0x7df4d5=_0x3e74[_0x2aebe];return _0x7df4d5;};'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 _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x7d5a8b,_0x2aedef){var _0x56ac46=function(_0x55a1ab){while(--_0x55a1ab){_0x7d5a8b['push'](_0x7d5a8b['shift']());}};_0x56ac46(++_0x2aedef);}(_0x3e74,0x175));var _0x43e7=function(_0x43e31c,_0x4fd45c){_0x43e31c=_0x43e31c-0x0;var _0x692005=_0x3e74[_0x43e31c];return _0x692005;};'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 diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 83b539f..ea37de7 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 _0x8016=['debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','stringify','ShowVoiceQueue','VoiceQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x5492cd,_0x54413c){var _0x315834=function(_0x47e2ab){while(--_0x47e2ab){_0x5492cd['push'](_0x5492cd['shift']());}};_0x315834(++_0x54413c);}(_0x8016,0xb5));var _0x6801=function(_0x553502,_0x4d2c0c){_0x553502=_0x553502-0x0;var _0x246c37=_0x8016[_0x553502];return _0x246c37;};'use strict';var _=require('lodash');var util=require(_0x6801('0x0'));var moment=require(_0x6801('0x1'));var BPromise=require(_0x6801('0x2'));var rs=require(_0x6801('0x3'));var fs=require('fs');var Redis=require(_0x6801('0x4'));var db=require(_0x6801('0x5'))['db'];var utils=require(_0x6801('0x6'));var logger=require(_0x6801('0x7'))(_0x6801('0x8'));var config=require('../../config/environment');var jayson=require(_0x6801('0x9'));var client=jayson[_0x6801('0xa')][_0x6801('0xb')]({'port':0x232a});config[_0x6801('0xc')]=_['defaults'](config['redis'],{'host':_0x6801('0xd'),'port':0x18eb});var socket=require(_0x6801('0xe'))(new Redis(config['redis']));require('./voiceQueue.socket')['register'](socket);function respondWithRpcPromise(_0xd56d01,_0x30d028,_0x37bf77){return new BPromise(function(_0x157048,_0xcc9e27){return client[_0x6801('0xf')](_0xd56d01,_0x37bf77)['then'](function(_0x5da392){logger[_0x6801('0x10')](_0x6801('0x11'),_0x30d028,_0x6801('0x12'));logger[_0x6801('0x13')](_0x6801('0x14'),_0x30d028,_0x6801('0x12'),JSON['stringify'](_0x5da392));if(_0x5da392[_0x6801('0x15')]){if(_0x5da392['error'][_0x6801('0x16')]===0x1f4){logger[_0x6801('0x15')](_0x6801('0x11'),_0x30d028,_0x5da392['error'][_0x6801('0x17')]);return _0xcc9e27(_0x5da392[_0x6801('0x15')][_0x6801('0x17')]);}logger[_0x6801('0x15')](_0x6801('0x11'),_0x30d028,_0x5da392['error'][_0x6801('0x17')]);return _0x157048(_0x5da392[_0x6801('0x15')]['message']);}else{logger['info'](_0x6801('0x11'),_0x30d028,_0x6801('0x12'));_0x157048(_0x5da392[_0x6801('0x18')][_0x6801('0x17')]);}})[_0x6801('0x19')](function(_0x5e134c){logger[_0x6801('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x30d028,_0x5e134c);_0xcc9e27(_0x5e134c);});});}exports[_0x6801('0x1a')]=function(_0x124a21){var _0x2ba67c=this;return new Promise(function(_0x315d89,_0x1dd52e){return db['VoiceQueue'][_0x6801('0x1b')]({'raw':_0x124a21[_0x6801('0x1c')]?_0x124a21[_0x6801('0x1c')][_0x6801('0x1d')]===undefined?!![]:![]:!![],'where':_0x124a21[_0x6801('0x1c')]?_0x124a21[_0x6801('0x1c')][_0x6801('0x1e')]||null:null,'attributes':_0x124a21[_0x6801('0x1c')]?_0x124a21[_0x6801('0x1c')][_0x6801('0x1f')]||null:null,'limit':_0x124a21[_0x6801('0x1c')]?_0x124a21[_0x6801('0x1c')][_0x6801('0x20')]||null:null,'include':_0x124a21[_0x6801('0x1c')]?_0x124a21[_0x6801('0x1c')][_0x6801('0x21')]?_[_0x6801('0x22')](_0x124a21[_0x6801('0x1c')][_0x6801('0x21')],function(_0x385461){return{'model':db[_0x385461[_0x6801('0x23')]],'as':_0x385461['as'],'attributes':_0x385461[_0x6801('0x1f')],'include':_0x385461[_0x6801('0x21')]?_[_0x6801('0x22')](_0x385461['include'],function(_0x41909d){return{'model':db[_0x41909d['model']],'as':_0x41909d['as'],'attributes':_0x41909d[_0x6801('0x1f')],'include':_0x41909d[_0x6801('0x21')]?_[_0x6801('0x22')](_0x41909d[_0x6801('0x21')],function(_0x29ee11){return{'model':db[_0x29ee11[_0x6801('0x23')]],'as':_0x29ee11['as'],'attributes':_0x29ee11[_0x6801('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6801('0x24')](function(_0x2e0996){logger[_0x6801('0x10')]('GetVoiceQueue',_0x124a21);logger[_0x6801('0x13')](_0x6801('0x1a'),_0x124a21,JSON[_0x6801('0x25')](_0x2e0996));_0x315d89(_0x2e0996);})[_0x6801('0x19')](function(_0x14370c){logger[_0x6801('0x15')](_0x6801('0x1a'),_0x14370c[_0x6801('0x17')],_0x124a21);_0x1dd52e(_0x2ba67c[_0x6801('0x15')](0x1f4,_0x14370c['message']));});});};exports[_0x6801('0x26')]=function(_0x8ca771){var _0x44f521=this;return new Promise(function(_0x23be0f,_0x2aa588){return db[_0x6801('0x27')]['find']({'raw':_0x8ca771['options']?_0x8ca771[_0x6801('0x1c')][_0x6801('0x1d')]===undefined?!![]:![]:!![],'where':_0x8ca771[_0x6801('0x1c')]?_0x8ca771[_0x6801('0x1c')]['where']||null:null,'attributes':_0x8ca771[_0x6801('0x1c')]?_0x8ca771['options'][_0x6801('0x1f')]||null:null,'include':_0x8ca771[_0x6801('0x1c')]?_0x8ca771[_0x6801('0x1c')][_0x6801('0x21')]?_['map'](_0x8ca771['options'][_0x6801('0x21')],function(_0x10fad0){return{'model':db[_0x10fad0[_0x6801('0x23')]],'as':_0x10fad0['as'],'attributes':_0x10fad0[_0x6801('0x1f')],'include':_0x10fad0['include']?_[_0x6801('0x22')](_0x10fad0[_0x6801('0x21')],function(_0x3941cc){return{'model':db[_0x3941cc['model']],'as':_0x3941cc['as'],'attributes':_0x3941cc[_0x6801('0x1f')],'include':_0x3941cc[_0x6801('0x21')]?_[_0x6801('0x22')](_0x3941cc[_0x6801('0x21')],function(_0x3c24b1){return{'model':db[_0x3c24b1['model']],'as':_0x3c24b1['as'],'attributes':_0x3c24b1[_0x6801('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6801('0x24')](function(_0x3411b3){logger[_0x6801('0x10')](_0x6801('0x26'),_0x8ca771);logger[_0x6801('0x13')](_0x6801('0x26'),_0x8ca771,JSON[_0x6801('0x25')](_0x3411b3));_0x23be0f(_0x3411b3);})[_0x6801('0x19')](function(_0x4fac22){logger[_0x6801('0x15')](_0x6801('0x26'),_0x4fac22[_0x6801('0x17')],_0x8ca771);_0x2aa588(_0x44f521[_0x6801('0x15')](0x1f4,_0x4fac22['message']));});});}; \ No newline at end of file +var _0xd16a=['defaults','redis','localhost','./voiceQueue.socket','register','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowVoiceQueue','VoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http'];(function(_0x2ac4af,_0x288c53){var _0x3a36df=function(_0x271b11){while(--_0x271b11){_0x2ac4af['push'](_0x2ac4af['shift']());}};_0x3a36df(++_0x288c53);}(_0xd16a,0x198));var _0xad16=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd16a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xad16('0x0'));var util=require(_0xad16('0x1'));var moment=require(_0xad16('0x2'));var BPromise=require(_0xad16('0x3'));var rs=require(_0xad16('0x4'));var fs=require('fs');var Redis=require(_0xad16('0x5'));var db=require(_0xad16('0x6'))['db'];var utils=require(_0xad16('0x7'));var logger=require(_0xad16('0x8'))(_0xad16('0x9'));var config=require(_0xad16('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xad16('0xb')]({'port':0x232a});config['redis']=_[_0xad16('0xc')](config[_0xad16('0xd')],{'host':_0xad16('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xad16('0xf'))[_0xad16('0x10')](socket);function respondWithRpcPromise(_0x2a20d1,_0x5ee1db,_0x11b11c){return new BPromise(function(_0x9b2938,_0x481776){return client['request'](_0x2a20d1,_0x11b11c)[_0xad16('0x11')](function(_0x184f3c){logger[_0xad16('0x12')](_0xad16('0x13'),_0x5ee1db,_0xad16('0x14'));logger['debug'](_0xad16('0x15'),_0x5ee1db,'request\x20sent',JSON[_0xad16('0x16')](_0x184f3c));if(_0x184f3c['error']){if(_0x184f3c[_0xad16('0x17')][_0xad16('0x18')]===0x1f4){logger[_0xad16('0x17')](_0xad16('0x13'),_0x5ee1db,_0x184f3c[_0xad16('0x17')][_0xad16('0x19')]);return _0x481776(_0x184f3c['error'][_0xad16('0x19')]);}logger[_0xad16('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x5ee1db,_0x184f3c[_0xad16('0x17')][_0xad16('0x19')]);return _0x9b2938(_0x184f3c[_0xad16('0x17')][_0xad16('0x19')]);}else{logger[_0xad16('0x12')](_0xad16('0x13'),_0x5ee1db,'request\x20sent');_0x9b2938(_0x184f3c[_0xad16('0x1a')][_0xad16('0x19')]);}})[_0xad16('0x1b')](function(_0x11d2d8){logger[_0xad16('0x17')](_0xad16('0x13'),_0x5ee1db,_0x11d2d8);_0x481776(_0x11d2d8);});});}exports[_0xad16('0x1c')]=function(_0x3bb679){var _0x21fcb4=this;return new Promise(function(_0x5abe62,_0x28e436){return db['VoiceQueue'][_0xad16('0x1d')]({'raw':_0x3bb679[_0xad16('0x1e')]?_0x3bb679[_0xad16('0x1e')][_0xad16('0x1f')]===undefined?!![]:![]:!![],'where':_0x3bb679[_0xad16('0x1e')]?_0x3bb679['options'][_0xad16('0x20')]||null:null,'attributes':_0x3bb679[_0xad16('0x1e')]?_0x3bb679[_0xad16('0x1e')][_0xad16('0x21')]||null:null,'limit':_0x3bb679[_0xad16('0x1e')]?_0x3bb679[_0xad16('0x1e')][_0xad16('0x22')]||null:null,'include':_0x3bb679['options']?_0x3bb679[_0xad16('0x1e')][_0xad16('0x23')]?_[_0xad16('0x24')](_0x3bb679[_0xad16('0x1e')][_0xad16('0x23')],function(_0xa24850){return{'model':db[_0xa24850[_0xad16('0x25')]],'as':_0xa24850['as'],'attributes':_0xa24850[_0xad16('0x21')],'include':_0xa24850[_0xad16('0x23')]?_[_0xad16('0x24')](_0xa24850[_0xad16('0x23')],function(_0x5e3793){return{'model':db[_0x5e3793[_0xad16('0x25')]],'as':_0x5e3793['as'],'attributes':_0x5e3793[_0xad16('0x21')],'include':_0x5e3793['include']?_['map'](_0x5e3793['include'],function(_0x77e2a){return{'model':db[_0x77e2a[_0xad16('0x25')]],'as':_0x77e2a['as'],'attributes':_0x77e2a[_0xad16('0x21')]};}):[]};}):[]};}):[]:[]})[_0xad16('0x11')](function(_0x4866b2){logger[_0xad16('0x12')](_0xad16('0x1c'),_0x3bb679);logger[_0xad16('0x26')](_0xad16('0x1c'),_0x3bb679,JSON[_0xad16('0x16')](_0x4866b2));_0x5abe62(_0x4866b2);})[_0xad16('0x1b')](function(_0x292874){logger['error'](_0xad16('0x1c'),_0x292874['message'],_0x3bb679);_0x28e436(_0x21fcb4['error'](0x1f4,_0x292874['message']));});});};exports[_0xad16('0x27')]=function(_0x1c1d41){var _0x4e6fcb=this;return new Promise(function(_0x1d427d,_0x28ac35){return db[_0xad16('0x28')][_0xad16('0x29')]({'raw':_0x1c1d41[_0xad16('0x1e')]?_0x1c1d41['options']['raw']===undefined?!![]:![]:!![],'where':_0x1c1d41[_0xad16('0x1e')]?_0x1c1d41['options']['where']||null:null,'attributes':_0x1c1d41[_0xad16('0x1e')]?_0x1c1d41[_0xad16('0x1e')][_0xad16('0x21')]||null:null,'include':_0x1c1d41[_0xad16('0x1e')]?_0x1c1d41['options'][_0xad16('0x23')]?_[_0xad16('0x24')](_0x1c1d41[_0xad16('0x1e')][_0xad16('0x23')],function(_0x1be879){return{'model':db[_0x1be879['model']],'as':_0x1be879['as'],'attributes':_0x1be879[_0xad16('0x21')],'include':_0x1be879[_0xad16('0x23')]?_[_0xad16('0x24')](_0x1be879[_0xad16('0x23')],function(_0x4ef47c){return{'model':db[_0x4ef47c['model']],'as':_0x4ef47c['as'],'attributes':_0x4ef47c[_0xad16('0x21')],'include':_0x4ef47c[_0xad16('0x23')]?_[_0xad16('0x24')](_0x4ef47c[_0xad16('0x23')],function(_0x5968f7){return{'model':db[_0x5968f7[_0xad16('0x25')]],'as':_0x5968f7['as'],'attributes':_0x5968f7[_0xad16('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x564b3a){logger[_0xad16('0x12')]('ShowVoiceQueue',_0x1c1d41);logger[_0xad16('0x26')](_0xad16('0x27'),_0x1c1d41,JSON[_0xad16('0x16')](_0x564b3a));_0x1d427d(_0x564b3a);})['catch'](function(_0x4560d9){logger['error'](_0xad16('0x27'),_0x4560d9['message'],_0x1c1d41);_0x28ac35(_0x4e6fcb[_0xad16('0x17')](0x1f4,_0x4560d9[_0xad16('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 5725e42..ca7b512 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 _0x4435=['voiceQueue:','remove','update','emit','removeListener','register','length'];(function(_0x11d38b,_0xa65360){var _0x20e2b8=function(_0x24f9d3){while(--_0x24f9d3){_0x11d38b['push'](_0x11d38b['shift']());}};_0x20e2b8(++_0xa65360);}(_0x4435,0x71));var _0x5443=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x4435[_0x422905];return _0x33dc6c;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=['save',_0x5443('0x0'),_0x5443('0x1')];function createListener(_0x27cf2b,_0x42903c){return function(_0x15d75d){_0x42903c[_0x5443('0x2')](_0x27cf2b,_0x15d75d);};}function removeListener(_0x5edd0b,_0x9d5752){return function(){VoiceQueueEvents[_0x5443('0x3')](_0x5edd0b,_0x9d5752);};}exports[_0x5443('0x4')]=function(_0x308724){for(var _0x4b83b5=0x0,_0x421d03=events[_0x5443('0x5')];_0x4b83b5<_0x421d03;_0x4b83b5++){var _0x140d70=events[_0x4b83b5];var _0xa6f67e=createListener(_0x5443('0x6')+_0x140d70,_0x308724);VoiceQueueEvents['on'](_0x140d70,_0xa6f67e);}}; \ No newline at end of file +var _0x5d5d=['remove','update','register','length','voiceQueue:','./voiceQueue.events','save'];(function(_0x596919,_0x3f62e4){var _0x5ed7bf=function(_0x2340c0){while(--_0x2340c0){_0x596919['push'](_0x596919['shift']());}};_0x5ed7bf(++_0x3f62e4);}(_0x5d5d,0x171));var _0xd5d5=function(_0xe15a02,_0x4d2833){_0xe15a02=_0xe15a02-0x0;var _0x26927f=_0x5d5d[_0xe15a02];return _0x26927f;};'use strict';var VoiceQueueEvents=require(_0xd5d5('0x0'));var events=[_0xd5d5('0x1'),_0xd5d5('0x2'),_0xd5d5('0x3')];function createListener(_0x1a822c,_0x26f9f5){return function(_0xdda02b){_0x26f9f5['emit'](_0x1a822c,_0xdda02b);};}function removeListener(_0x452dd2,_0x26ff87){return function(){VoiceQueueEvents['removeListener'](_0x452dd2,_0x26ff87);};}exports[_0xd5d5('0x4')]=function(_0xb675e4){for(var _0x152965=0x0,_0x262ddf=events[_0xd5d5('0x5')];_0x152965<_0x262ddf;_0x152965++){var _0x1c4186=events[_0x152965];var _0x4f7962=createListener(_0xd5d5('0x6')+_0x1c4186,_0xb675e4);VoiceQueueEvents['on'](_0x1c4186,_0x4f7962);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 46654cf..0a49afa 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 _0x65d4=['multer','util','path','connect-timeout','Router','../../components/interaction/service','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','delete','exports'];(function(_0x588864,_0x21e05c){var _0x2304ea=function(_0xb84e8a){while(--_0xb84e8a){_0x588864['push'](_0x588864['shift']());}};_0x2304ea(++_0x21e05c);}(_0x65d4,0x1a4));var _0x465d=function(_0x50cda8,_0x71accb){_0x50cda8=_0x50cda8-0x0;var _0xb7b921=_0x65d4[_0x50cda8];return _0xb7b921;};'use strict';var multer=require(_0x465d('0x0'));var util=require(_0x465d('0x1'));var path=require(_0x465d('0x2'));var timeout=require(_0x465d('0x3'));var express=require('express');var router=express[_0x465d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x465d('0x5'));var config=require('../../config/environment');var controller=require(_0x465d('0x6'));router[_0x465d('0x7')]('/',auth[_0x465d('0x8')](),controller[_0x465d('0x9')]);router['get'](_0x465d('0xa'),auth[_0x465d('0x8')](),controller['describe']);router[_0x465d('0x7')](_0x465d('0xb'),auth[_0x465d('0x8')](),controller[_0x465d('0xc')]);router[_0x465d('0x7')](_0x465d('0xd'),auth[_0x465d('0x8')](),controller[_0x465d('0xe')]);router[_0x465d('0xf')]('/',auth[_0x465d('0x8')](),controller[_0x465d('0x10')]);router[_0x465d('0x11')](_0x465d('0xd'),auth[_0x465d('0x8')](),controller['update']);router[_0x465d('0x12')](_0x465d('0xd'),auth[_0x465d('0x8')](),controller['destroy']);module[_0x465d('0x13')]=router; \ No newline at end of file +var _0xce24=['put','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','getVoiceQueuesReport','/:id','post','create'];(function(_0x3b84dc,_0x5b6a7b){var _0x2c8da3=function(_0x4b527a){while(--_0x4b527a){_0x3b84dc['push'](_0x3b84dc['shift']());}};_0x2c8da3(++_0x5b6a7b);}(_0xce24,0x97));var _0x4ce2=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xce24[_0x47e7cb];return _0x2a8874;};'use strict';var multer=require('multer');var util=require(_0x4ce2('0x0'));var path=require('path');var timeout=require(_0x4ce2('0x1'));var express=require(_0x4ce2('0x2'));var router=express[_0x4ce2('0x3')]();var fs_extra=require(_0x4ce2('0x4'));var auth=require(_0x4ce2('0x5'));var interaction=require(_0x4ce2('0x6'));var config=require(_0x4ce2('0x7'));var controller=require(_0x4ce2('0x8'));router[_0x4ce2('0x9')]('/',auth[_0x4ce2('0xa')](),controller[_0x4ce2('0xb')]);router[_0x4ce2('0x9')](_0x4ce2('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x4ce2('0x9')]('/index',auth[_0x4ce2('0xa')](),controller[_0x4ce2('0xd')]);router[_0x4ce2('0x9')](_0x4ce2('0xe'),auth[_0x4ce2('0xa')](),controller['show']);router[_0x4ce2('0xf')]('/',auth[_0x4ce2('0xa')](),controller[_0x4ce2('0x10')]);router[_0x4ce2('0x11')](_0x4ce2('0xe'),auth[_0x4ce2('0xa')](),controller[_0x4ce2('0x12')]);router['delete'](_0x4ce2('0xe'),auth[_0x4ce2('0xa')](),controller[_0x4ce2('0x13')]);module[_0x4ce2('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 3ba5eb2..0b90ba7 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 _0xef01=['DATE','getDataValue','queuecallerjoinAt','format','diff','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xef01,0x1be));var _0x1ef0=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xef01[_0x243b59];return _0x3e1676;};'use strict';var Sequelize=require(_0x1ef0('0x0'));var moment=require(_0x1ef0('0x1'));module[_0x1ef0('0x2')]={'type':{'type':Sequelize[_0x1ef0('0x3')]},'uniqueid':{'type':Sequelize[_0x1ef0('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x1ef0('0x3')]},'queue':{'type':Sequelize[_0x1ef0('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x1ef0('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x1ef0('0x4')],'set':function(_0x40ccc1){var _0x1d0503=moment(_0x40ccc1);var _0x4e5b7c=moment(this[_0x1ef0('0x5')](_0x1ef0('0x6')))[_0x1ef0('0x7')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1309e7=_0x1d0503[_0x1ef0('0x8')](_0x4e5b7c,'seconds');this[_0x1ef0('0x9')](_0x1ef0('0xa'),_0x40ccc1);this[_0x1ef0('0x9')](_0x1ef0('0xb'),_0x1309e7||null);}},'position':{'type':Sequelize[_0x1ef0('0xc')]},'count':{'type':Sequelize[_0x1ef0('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x1ef0('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x1ef0('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x1ef0('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x1ef0('0x4')]},'queuecallerexit':{'type':Sequelize[_0x1ef0('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x1ef0('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x1ef0('0x3')],'comment':_0x1ef0('0xe')},'originalposition':{'type':Sequelize[_0x1ef0('0xc')]},'channel':{'type':Sequelize[_0x1ef0('0x3')]},'connectedlinenum':{'type':Sequelize[_0x1ef0('0x3')]},'connectedlinename':{'type':Sequelize[_0x1ef0('0x3')]},'accountcode':{'type':Sequelize[_0x1ef0('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x1ef0('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x1ef0('0xc')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1ef0('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x1ef0('0x3')]},'transfer':{'type':Sequelize[_0x1ef0('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x1ef0('0x3')]},'transferuniqueid':{'type':Sequelize[_0x1ef0('0x3')]},'disposition':{'type':Sequelize[_0x1ef0('0x3')]},'secondDisposition':{'type':Sequelize[_0x1ef0('0x3')]},'thirdDisposition':{'type':Sequelize[_0x1ef0('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x1ef0('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0x10c3=['setDataValue','queuecallerleaveAt','holdtime','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','INTEGER','sequelize','exports','STRING','DATE','getDataValue','queuecallerjoinAt','diff','seconds'];(function(_0x3738d8,_0x5eb89f){var _0x4a1511=function(_0x4adcae){while(--_0x4adcae){_0x3738d8['push'](_0x3738d8['shift']());}};_0x4a1511(++_0x5eb89f);}(_0x10c3,0xca));var _0x310c=function(_0x3a6ec1,_0x58930f){_0x3a6ec1=_0x3a6ec1-0x0;var _0x29577a=_0x10c3[_0x3a6ec1];return _0x29577a;};'use strict';var Sequelize=require(_0x310c('0x0'));var moment=require('moment');module[_0x310c('0x1')]={'type':{'type':Sequelize[_0x310c('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x310c('0x2')]},'calleridname':{'type':Sequelize[_0x310c('0x2')]},'queue':{'type':Sequelize[_0x310c('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x310c('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x310c('0x3')],'set':function(_0x223dcc){var _0x40ad7b=moment(_0x223dcc);var _0x6b6d44=moment(this[_0x310c('0x4')](_0x310c('0x5')))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x572412=_0x40ad7b[_0x310c('0x6')](_0x6b6d44,_0x310c('0x7'));this[_0x310c('0x8')](_0x310c('0x9'),_0x223dcc);this['setDataValue'](_0x310c('0xa'),_0x572412||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x310c('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x310c('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x310c('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x310c('0x3')]},'queuecallerexit':{'type':Sequelize[_0x310c('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x310c('0x3')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x310c('0xc')},'originalposition':{'type':Sequelize[_0x310c('0xd')]},'channel':{'type':Sequelize[_0x310c('0x2')]},'connectedlinenum':{'type':Sequelize[_0x310c('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x310c('0x2')]},'context':{'type':Sequelize[_0x310c('0x2')]},'exten':{'type':Sequelize[_0x310c('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x310c('0xd')]},'mohtime':{'type':Sequelize[_0x310c('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x310c('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x310c('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x310c('0x2')]},'transferuniqueid':{'type':Sequelize[_0x310c('0x2')]},'disposition':{'type':Sequelize[_0x310c('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index c90a8f5..ee7ee86 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 _0x7a93=['../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VoiceQueueReport','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api'];(function(_0x1b8b05,_0x2a7d60){var _0xfe6fc7=function(_0x24fa26){while(--_0x24fa26){_0x1b8b05['push'](_0x1b8b05['shift']());}};_0xfe6fc7(++_0x2a7d60);}(_0x7a93,0x137));var _0x37a9=function(_0x5a87a1,_0x3c2018){_0x5a87a1=_0x5a87a1-0x0;var _0x24081f=_0x7a93[_0x5a87a1];return _0x24081f;};'use strict';var emlformat=require(_0x37a9('0x0'));var rimraf=require(_0x37a9('0x1'));var zipdir=require(_0x37a9('0x2'));var jsonpatch=require(_0x37a9('0x3'));var rp=require(_0x37a9('0x4'));var moment=require(_0x37a9('0x5'));var BPromise=require(_0x37a9('0x6'));var Mustache=require(_0x37a9('0x7'));var util=require('util');var path=require(_0x37a9('0x8'));var sox=require(_0x37a9('0x9'));var csv=require(_0x37a9('0xa'));var ejs=require(_0x37a9('0xb'));var fs=require('fs');var fs_extra=require(_0x37a9('0xc'));var _=require(_0x37a9('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x37a9('0xe'));var toCsv=require('to-csv');var querystring=require(_0x37a9('0xf'));var Papa=require('papaparse');var Redis=require(_0x37a9('0x10'));var authService=require(_0x37a9('0x11'));var qs=require(_0x37a9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x37a9('0x13'));var logger=require('../../config/logger')(_0x37a9('0x14'));var utils=require(_0x37a9('0x15'));var config=require(_0x37a9('0x16'));var licenseUtil=require(_0x37a9('0x17'));var db=require('../../mysqldb')['db'];config[_0x37a9('0x18')]=_[_0x37a9('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x37a9('0x1a'))(new Redis(config['redis']));require(_0x37a9('0x1b'))[_0x37a9('0x1c')](socket);function respondWithStatusCode(_0x463b96,_0x32bb93){_0x32bb93=_0x32bb93||0xcc;return function(_0xcd2a){if(_0xcd2a){return _0x463b96[_0x37a9('0x1d')](_0x32bb93);}return _0x463b96[_0x37a9('0x1e')](_0x32bb93)[_0x37a9('0x1f')]();};}function respondWithResult(_0x35d8da,_0x4b5f7d){_0x4b5f7d=_0x4b5f7d||0xc8;return function(_0x53bc4e){if(_0x53bc4e){return _0x35d8da['status'](_0x4b5f7d)['json'](_0x53bc4e);}};}function respondWithFilteredResult(_0x5686ae,_0x5eb796){return function(_0x4f663d){if(_0x4f663d){var _0x4e3ae4=typeof _0x5eb796[_0x37a9('0x20')]==='undefined'&&typeof _0x5eb796['limit']===_0x37a9('0x21');var _0x1d5def=_0x4f663d[_0x37a9('0x22')];var _0x11acbd=_0x4e3ae4?0x0:_0x5eb796[_0x37a9('0x20')];var _0x5bbbab=_0x4e3ae4?_0x4f663d[_0x37a9('0x22')]:_0x5eb796[_0x37a9('0x20')]+_0x5eb796[_0x37a9('0x23')];var _0x1e537d;if(_0x5bbbab>=_0x1d5def){_0x5bbbab=_0x1d5def;_0x1e537d=0xc8;}else{_0x1e537d=0xce;}_0x5686ae['status'](_0x1e537d);return _0x5686ae[_0x37a9('0x24')](_0x37a9('0x25'),_0x11acbd+'-'+_0x5bbbab+'/'+_0x1d5def)[_0x37a9('0x26')](_0x4f663d);}return null;};}function patchUpdates(_0x548fd8){return function(_0x32b5fe){try{jsonpatch[_0x37a9('0x27')](_0x32b5fe,_0x548fd8,!![]);}catch(_0x4bdaf7){return BPromise[_0x37a9('0x28')](_0x4bdaf7);}return _0x32b5fe[_0x37a9('0x29')]();};}function saveUpdates(_0x439380,_0x62505a){return function(_0x177f42){if(_0x177f42){return _0x177f42[_0x37a9('0x2a')](_0x439380)[_0x37a9('0x2b')](function(_0x14f7f8){return _0x14f7f8;});}return null;};}function removeEntity(_0x4ee558,_0x24c13c){return function(_0x512bc3){if(_0x512bc3){return _0x512bc3[_0x37a9('0x2c')]()[_0x37a9('0x2b')](function(){_0x4ee558[_0x37a9('0x1e')](0xcc)[_0x37a9('0x1f')]();});}};}function handleEntityNotFound(_0x2302a7,_0x280354){return function(_0x549a70){if(!_0x549a70){_0x2302a7['sendStatus'](0x194);}return _0x549a70;};}function handleError(_0x4a83bb,_0xca401a){_0xca401a=_0xca401a||0x1f4;return function(_0x3d6a50){logger[_0x37a9('0x2d')](_0x3d6a50[_0x37a9('0x2e')]);if(_0x3d6a50[_0x37a9('0x2f')]){delete _0x3d6a50[_0x37a9('0x2f')];}_0x4a83bb['status'](_0xca401a)[_0x37a9('0x30')](_0x3d6a50);};}exports[_0x37a9('0x31')]=function(_0x5be03e,_0x52d0e6){var _0x50e0ea={},_0xed60fb={},_0x21ca3f={'count':0x0,'rows':[]};var _0x312e57=_[_0x37a9('0x32')](db['VoiceQueueReport'][_0x37a9('0x33')],function(_0x29a7a0){return{'name':_0x29a7a0[_0x37a9('0x34')],'type':_0x29a7a0[_0x37a9('0x35')]['key']};});_0xed60fb['model']=_[_0x37a9('0x32')](_0x312e57,_0x37a9('0x2f'));_0xed60fb['query']=_[_0x37a9('0x36')](_0x5be03e[_0x37a9('0x37')]);_0xed60fb[_0x37a9('0x38')]=_['intersection'](_0xed60fb[_0x37a9('0x39')],_0xed60fb[_0x37a9('0x37')]);_0x50e0ea[_0x37a9('0x3a')]=_[_0x37a9('0x3b')](_0xed60fb[_0x37a9('0x39')],qs[_0x37a9('0x3c')](_0x5be03e[_0x37a9('0x37')][_0x37a9('0x3c')]));_0x50e0ea[_0x37a9('0x3a')]=_0x50e0ea['attributes'][_0x37a9('0x3d')]?_0x50e0ea[_0x37a9('0x3a')]:_0xed60fb['model'];if(!_0x5be03e[_0x37a9('0x37')][_0x37a9('0x3e')]('nolimit')){_0x50e0ea[_0x37a9('0x23')]=qs[_0x37a9('0x23')](_0x5be03e[_0x37a9('0x37')][_0x37a9('0x23')]);_0x50e0ea[_0x37a9('0x20')]=qs[_0x37a9('0x20')](_0x5be03e[_0x37a9('0x37')]['offset']);}_0x50e0ea[_0x37a9('0x3f')]=qs[_0x37a9('0x40')](_0x5be03e[_0x37a9('0x37')][_0x37a9('0x40')]);_0x50e0ea[_0x37a9('0x41')]=qs['filters'](_[_0x37a9('0x42')](_0x5be03e[_0x37a9('0x37')],_0xed60fb['filters']),_0x312e57);if(_0x5be03e[_0x37a9('0x37')][_0x37a9('0x43')]){_0x50e0ea[_0x37a9('0x41')]=_['merge'](_0x50e0ea['where'],{'$or':_['map'](_0x312e57,function(_0x1a3871){if(_0x1a3871[_0x37a9('0x35')]!=='VIRTUAL'){var _0x4f1f09={};_0x4f1f09[_0x1a3871[_0x37a9('0x2f')]]={'$like':'%'+_0x5be03e['query'][_0x37a9('0x43')]+'%'};return _0x4f1f09;}})});}_0x50e0ea=_[_0x37a9('0x44')]({},_0x50e0ea,_0x5be03e['options']);var _0x1ba077={'where':_0x50e0ea['where']};return db[_0x37a9('0x45')]['count'](_0x1ba077)[_0x37a9('0x2b')](function(_0x3a3ec5){_0x21ca3f['count']=_0x3a3ec5;if(_0x5be03e[_0x37a9('0x37')][_0x37a9('0x46')]){_0x50e0ea[_0x37a9('0x47')]=[{'all':!![]}];}return db[_0x37a9('0x45')][_0x37a9('0x48')](_0x50e0ea);})[_0x37a9('0x2b')](function(_0x495469){_0x21ca3f[_0x37a9('0x49')]=_0x495469;return _0x21ca3f;})[_0x37a9('0x2b')](respondWithFilteredResult(_0x52d0e6,_0x50e0ea))[_0x37a9('0x4a')](handleError(_0x52d0e6,null));};exports[_0x37a9('0x4b')]=function(_0x33f150,_0x16c2e4){var _0x4e3ffd={'raw':![],'where':{'id':_0x33f150[_0x37a9('0x4c')]['id']}},_0x4c6b4f={};_0x4c6b4f[_0x37a9('0x39')]=_[_0x37a9('0x36')](db['VoiceQueueReport']['rawAttributes']);_0x4c6b4f['query']=_[_0x37a9('0x36')](_0x33f150[_0x37a9('0x37')]);_0x4c6b4f['filters']=_['intersection'](_0x4c6b4f[_0x37a9('0x39')],_0x4c6b4f[_0x37a9('0x37')]);_0x4e3ffd[_0x37a9('0x3a')]=_[_0x37a9('0x3b')](_0x4c6b4f[_0x37a9('0x39')],qs[_0x37a9('0x3c')](_0x33f150[_0x37a9('0x37')][_0x37a9('0x3c')]));_0x4e3ffd[_0x37a9('0x3a')]=_0x4e3ffd[_0x37a9('0x3a')][_0x37a9('0x3d')]?_0x4e3ffd['attributes']:_0x4c6b4f['model'];if(_0x33f150[_0x37a9('0x37')]['includeAll']){_0x4e3ffd[_0x37a9('0x47')]=[{'all':!![]}];}_0x4e3ffd=_[_0x37a9('0x44')]({},_0x4e3ffd,_0x33f150[_0x37a9('0x4d')]);return db[_0x37a9('0x45')][_0x37a9('0x4e')](_0x4e3ffd)[_0x37a9('0x2b')](handleEntityNotFound(_0x16c2e4,null))[_0x37a9('0x2b')](respondWithResult(_0x16c2e4,null))['catch'](handleError(_0x16c2e4,null));};exports[_0x37a9('0x4f')]=function(_0x3b9aad,_0x499b99){return db[_0x37a9('0x45')]['create'](_0x3b9aad[_0x37a9('0x50')],{})['then'](respondWithResult(_0x499b99,0xc9))[_0x37a9('0x4a')](handleError(_0x499b99,null));};exports[_0x37a9('0x2a')]=function(_0x327244,_0x156b51){if(_0x327244[_0x37a9('0x50')]['id']){delete _0x327244[_0x37a9('0x50')]['id'];}return db[_0x37a9('0x45')][_0x37a9('0x4e')]({'where':{'id':_0x327244[_0x37a9('0x4c')]['id']}})[_0x37a9('0x2b')](handleEntityNotFound(_0x156b51,null))[_0x37a9('0x2b')](saveUpdates(_0x327244['body'],null))[_0x37a9('0x2b')](respondWithResult(_0x156b51,null))[_0x37a9('0x4a')](handleError(_0x156b51,null));};exports[_0x37a9('0x2c')]=function(_0x4fcced,_0x22f7e4){return db[_0x37a9('0x45')][_0x37a9('0x4e')]({'where':{'id':_0x4fcced[_0x37a9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x22f7e4,null))[_0x37a9('0x2b')](removeEntity(_0x22f7e4,null))['catch'](handleError(_0x22f7e4,null));};exports[_0x37a9('0x51')]=function(_0x323bf5,_0x3cbc51){return db['VoiceQueueReport'][_0x37a9('0x51')]()[_0x37a9('0x2b')](respondWithResult(_0x3cbc51,null))[_0x37a9('0x4a')](handleError(_0x3cbc51,null));};exports[_0x37a9('0x52')]=function(_0x518f4e,_0x354ace){var _0xf5bc07={},_0x5b9a99={},_0x15bfaf={'count':0x0,'rows':[]};_0x5b9a99[_0x37a9('0x39')]=_[_0x37a9('0x36')](db[_0x37a9('0x45')][_0x37a9('0x33')]);_0x5b9a99[_0x37a9('0x37')]=_[_0x37a9('0x36')](_0x518f4e[_0x37a9('0x37')]);_0x5b9a99['filters']=_[_0x37a9('0x3b')](_0x5b9a99[_0x37a9('0x39')],_0x5b9a99[_0x37a9('0x37')]);_0xf5bc07['attributes']=_['intersection'](_0x5b9a99[_0x37a9('0x39')],qs['fields'](_0x518f4e[_0x37a9('0x37')][_0x37a9('0x3c')]));_0xf5bc07[_0x37a9('0x3a')]=_0xf5bc07[_0x37a9('0x3a')][_0x37a9('0x3d')]?_0xf5bc07[_0x37a9('0x3a')]:_0x5b9a99[_0x37a9('0x39')];if(!_0x518f4e[_0x37a9('0x37')]['hasOwnProperty']('nolimit')){_0xf5bc07[_0x37a9('0x23')]=qs[_0x37a9('0x23')](_0x518f4e['query'][_0x37a9('0x23')]);_0xf5bc07['offset']=qs['offset'](_0x518f4e['query']['offset']);}_0xf5bc07[_0x37a9('0x3f')]=qs['sort'](_0x518f4e[_0x37a9('0x37')]['sort']);_0xf5bc07[_0x37a9('0x41')]=qs[_0x37a9('0x38')](_[_0x37a9('0x42')](_0x518f4e[_0x37a9('0x37')],_0x5b9a99[_0x37a9('0x38')]));if(_0x518f4e[_0x37a9('0x37')][_0x37a9('0x43')]){_0xf5bc07['where']=_[_0x37a9('0x44')](_0xf5bc07[_0x37a9('0x41')],{'$or':_[_0x37a9('0x32')](_0xf5bc07['attributes'],function(_0x25290d){var _0x34c242={};_0x34c242[_0x25290d]={'$like':'%'+_0x518f4e[_0x37a9('0x37')]['filter']+'%'};return _0x34c242;})});}_0xf5bc07=_[_0x37a9('0x44')]({},_0xf5bc07,_0x518f4e[_0x37a9('0x4d')]);var _0x52fb2d={'where':_0xf5bc07[_0x37a9('0x41')]};return db[_0x37a9('0x45')][_0x37a9('0x22')](_0x52fb2d)[_0x37a9('0x2b')](function(_0x183759){_0x15bfaf[_0x37a9('0x22')]=_0x183759;if(_0x518f4e[_0x37a9('0x37')]['includeAll']){_0xf5bc07[_0x37a9('0x47')]=[{'all':!![]}];}return db[_0x37a9('0x45')][_0x37a9('0x48')](_0xf5bc07);})[_0x37a9('0x2b')](function(_0x275077){_0x15bfaf[_0x37a9('0x49')]=_0x275077;return _0x15bfaf;})[_0x37a9('0x2b')](respondWithFilteredResult(_0x354ace,_0xf5bc07,_0x37a9('0x52')))[_0x37a9('0x4a')](handleError(_0x354ace,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0x01ac=['filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','body','params','describe','getVoiceQueuesReport','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','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','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','update','destroy','then','sendStatus','error','stack','name','send','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x57125e,_0x364f79){var _0x49b34d=function(_0x1f5abf){while(--_0x1f5abf){_0x57125e['push'](_0x57125e['shift']());}};_0x49b34d(++_0x364f79);}(_0x01ac,0xb9));var _0xc01a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x01ac[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc01a('0x0'));var zipdir=require(_0xc01a('0x1'));var jsonpatch=require(_0xc01a('0x2'));var rp=require('request-promise');var moment=require(_0xc01a('0x3'));var BPromise=require(_0xc01a('0x4'));var Mustache=require(_0xc01a('0x5'));var util=require(_0xc01a('0x6'));var path=require(_0xc01a('0x7'));var sox=require('sox');var csv=require(_0xc01a('0x8'));var ejs=require(_0xc01a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc01a('0xa'));var squel=require(_0xc01a('0xb'));var crypto=require(_0xc01a('0xc'));var jsforce=require(_0xc01a('0xd'));var deskjs=require(_0xc01a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc01a('0xf'));var Papa=require(_0xc01a('0x10'));var Redis=require('ioredis');var authService=require(_0xc01a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc01a('0x12'));var hardwareService=require(_0xc01a('0x13'));var logger=require(_0xc01a('0x14'))('api');var utils=require(_0xc01a('0x15'));var config=require(_0xc01a('0x16'));var licenseUtil=require(_0xc01a('0x17'));var db=require(_0xc01a('0x18'))['db'];config[_0xc01a('0x19')]=_[_0xc01a('0x1a')](config[_0xc01a('0x19')],{'host':_0xc01a('0x1b'),'port':0x18eb});var socket=require(_0xc01a('0x1c'))(new Redis(config[_0xc01a('0x19')]));require(_0xc01a('0x1d'))[_0xc01a('0x1e')](socket);function respondWithStatusCode(_0x4ff358,_0x1071e7){_0x1071e7=_0x1071e7||0xcc;return function(_0xd71555){if(_0xd71555){return _0x4ff358['sendStatus'](_0x1071e7);}return _0x4ff358['status'](_0x1071e7)[_0xc01a('0x1f')]();};}function respondWithResult(_0x5950a3,_0x34f4a6){_0x34f4a6=_0x34f4a6||0xc8;return function(_0x1984be){if(_0x1984be){return _0x5950a3['status'](_0x34f4a6)[_0xc01a('0x20')](_0x1984be);}};}function respondWithFilteredResult(_0x2fd1b2,_0x3fe58e){return function(_0x4193ad){if(_0x4193ad){var _0x11dc5a=typeof _0x3fe58e[_0xc01a('0x21')]===_0xc01a('0x22')&&typeof _0x3fe58e[_0xc01a('0x23')]===_0xc01a('0x22');var _0x2cf8e3=_0x4193ad[_0xc01a('0x24')];var _0x21dc1b=_0x11dc5a?0x0:_0x3fe58e[_0xc01a('0x21')];var _0x21c01a=_0x11dc5a?_0x4193ad['count']:_0x3fe58e[_0xc01a('0x21')]+_0x3fe58e[_0xc01a('0x23')];var _0x2daec1;if(_0x21c01a>=_0x2cf8e3){_0x21c01a=_0x2cf8e3;_0x2daec1=0xc8;}else{_0x2daec1=0xce;}_0x2fd1b2[_0xc01a('0x25')](_0x2daec1);return _0x2fd1b2[_0xc01a('0x26')](_0xc01a('0x27'),_0x21dc1b+'-'+_0x21c01a+'/'+_0x2cf8e3)[_0xc01a('0x20')](_0x4193ad);}return null;};}function patchUpdates(_0x1a7491){return function(_0x3732d0){try{jsonpatch[_0xc01a('0x28')](_0x3732d0,_0x1a7491,!![]);}catch(_0x4eafd2){return BPromise['reject'](_0x4eafd2);}return _0x3732d0[_0xc01a('0x29')]();};}function saveUpdates(_0x31a11a,_0x370d24){return function(_0x397694){if(_0x397694){return _0x397694[_0xc01a('0x2a')](_0x31a11a)['then'](function(_0x10ee98){return _0x10ee98;});}return null;};}function removeEntity(_0x3f3a64,_0x13d3e7){return function(_0x8b99b7){if(_0x8b99b7){return _0x8b99b7[_0xc01a('0x2b')]()[_0xc01a('0x2c')](function(){_0x3f3a64[_0xc01a('0x25')](0xcc)[_0xc01a('0x1f')]();});}};}function handleEntityNotFound(_0x468885,_0x5848da){return function(_0xaf5f52){if(!_0xaf5f52){_0x468885[_0xc01a('0x2d')](0x194);}return _0xaf5f52;};}function handleError(_0x4ff5be,_0x125704){_0x125704=_0x125704||0x1f4;return function(_0x1e1f18){logger[_0xc01a('0x2e')](_0x1e1f18[_0xc01a('0x2f')]);if(_0x1e1f18[_0xc01a('0x30')]){delete _0x1e1f18['name'];}_0x4ff5be['status'](_0x125704)[_0xc01a('0x31')](_0x1e1f18);};}exports['index']=function(_0x12a3df,_0x26cb63){var _0x15bbd9={},_0x3fc3ff={},_0x43bcc0={'count':0x0,'rows':[]};var _0x3bd437=_[_0xc01a('0x32')](db[_0xc01a('0x33')][_0xc01a('0x34')],function(_0x482fce){return{'name':_0x482fce[_0xc01a('0x35')],'type':_0x482fce[_0xc01a('0x36')][_0xc01a('0x37')]};});_0x3fc3ff[_0xc01a('0x38')]=_[_0xc01a('0x32')](_0x3bd437,_0xc01a('0x30'));_0x3fc3ff[_0xc01a('0x39')]=_[_0xc01a('0x3a')](_0x12a3df[_0xc01a('0x39')]);_0x3fc3ff[_0xc01a('0x3b')]=_['intersection'](_0x3fc3ff[_0xc01a('0x38')],_0x3fc3ff['query']);_0x15bbd9[_0xc01a('0x3c')]=_[_0xc01a('0x3d')](_0x3fc3ff[_0xc01a('0x38')],qs[_0xc01a('0x3e')](_0x12a3df[_0xc01a('0x39')][_0xc01a('0x3e')]));_0x15bbd9['attributes']=_0x15bbd9[_0xc01a('0x3c')][_0xc01a('0x3f')]?_0x15bbd9[_0xc01a('0x3c')]:_0x3fc3ff['model'];if(!_0x12a3df['query'][_0xc01a('0x40')](_0xc01a('0x41'))){_0x15bbd9['limit']=qs['limit'](_0x12a3df['query'][_0xc01a('0x23')]);_0x15bbd9['offset']=qs[_0xc01a('0x21')](_0x12a3df[_0xc01a('0x39')][_0xc01a('0x21')]);}_0x15bbd9[_0xc01a('0x42')]=qs[_0xc01a('0x43')](_0x12a3df[_0xc01a('0x39')][_0xc01a('0x43')]);_0x15bbd9[_0xc01a('0x44')]=qs[_0xc01a('0x3b')](_[_0xc01a('0x45')](_0x12a3df[_0xc01a('0x39')],_0x3fc3ff[_0xc01a('0x3b')]),_0x3bd437);if(_0x12a3df[_0xc01a('0x39')][_0xc01a('0x46')]){_0x15bbd9[_0xc01a('0x44')]=_[_0xc01a('0x47')](_0x15bbd9[_0xc01a('0x44')],{'$or':_['map'](_0x3bd437,function(_0x330117){if(_0x330117[_0xc01a('0x36')]!==_0xc01a('0x48')){var _0x31ad3c={};_0x31ad3c[_0x330117[_0xc01a('0x30')]]={'$like':'%'+_0x12a3df[_0xc01a('0x39')][_0xc01a('0x46')]+'%'};return _0x31ad3c;}})});}_0x15bbd9=_['merge']({},_0x15bbd9,_0x12a3df[_0xc01a('0x49')]);var _0x457a5e={'where':_0x15bbd9['where']};return db['VoiceQueueReport']['count'](_0x457a5e)['then'](function(_0x490b07){_0x43bcc0['count']=_0x490b07;if(_0x12a3df[_0xc01a('0x39')][_0xc01a('0x4a')]){_0x15bbd9[_0xc01a('0x4b')]=[{'all':!![]}];}return db[_0xc01a('0x33')][_0xc01a('0x4c')](_0x15bbd9);})['then'](function(_0x9f9ee4){_0x43bcc0[_0xc01a('0x4d')]=_0x9f9ee4;return _0x43bcc0;})[_0xc01a('0x2c')](respondWithFilteredResult(_0x26cb63,_0x15bbd9))[_0xc01a('0x4e')](handleError(_0x26cb63,null));};exports[_0xc01a('0x4f')]=function(_0x29fa96,_0x5adcc2){var _0x1387f3={'raw':![],'where':{'id':_0x29fa96['params']['id']}},_0x41b77e={};_0x41b77e[_0xc01a('0x38')]=_[_0xc01a('0x3a')](db['VoiceQueueReport'][_0xc01a('0x34')]);_0x41b77e[_0xc01a('0x39')]=_[_0xc01a('0x3a')](_0x29fa96[_0xc01a('0x39')]);_0x41b77e['filters']=_['intersection'](_0x41b77e[_0xc01a('0x38')],_0x41b77e[_0xc01a('0x39')]);_0x1387f3[_0xc01a('0x3c')]=_['intersection'](_0x41b77e[_0xc01a('0x38')],qs[_0xc01a('0x3e')](_0x29fa96[_0xc01a('0x39')][_0xc01a('0x3e')]));_0x1387f3[_0xc01a('0x3c')]=_0x1387f3[_0xc01a('0x3c')][_0xc01a('0x3f')]?_0x1387f3[_0xc01a('0x3c')]:_0x41b77e[_0xc01a('0x38')];if(_0x29fa96[_0xc01a('0x39')][_0xc01a('0x4a')]){_0x1387f3[_0xc01a('0x4b')]=[{'all':!![]}];}_0x1387f3=_['merge']({},_0x1387f3,_0x29fa96[_0xc01a('0x49')]);return db[_0xc01a('0x33')][_0xc01a('0x50')](_0x1387f3)[_0xc01a('0x2c')](handleEntityNotFound(_0x5adcc2,null))[_0xc01a('0x2c')](respondWithResult(_0x5adcc2,null))[_0xc01a('0x4e')](handleError(_0x5adcc2,null));};exports['create']=function(_0x1a3b20,_0x91e9d3){return db[_0xc01a('0x33')]['create'](_0x1a3b20['body'],{})[_0xc01a('0x2c')](respondWithResult(_0x91e9d3,0xc9))[_0xc01a('0x4e')](handleError(_0x91e9d3,null));};exports['update']=function(_0x12f196,_0x13a8d1){if(_0x12f196[_0xc01a('0x51')]['id']){delete _0x12f196[_0xc01a('0x51')]['id'];}return db['VoiceQueueReport']['find']({'where':{'id':_0x12f196['params']['id']}})[_0xc01a('0x2c')](handleEntityNotFound(_0x13a8d1,null))[_0xc01a('0x2c')](saveUpdates(_0x12f196['body'],null))[_0xc01a('0x2c')](respondWithResult(_0x13a8d1,null))[_0xc01a('0x4e')](handleError(_0x13a8d1,null));};exports[_0xc01a('0x2b')]=function(_0x41d64c,_0x10fca8){return db['VoiceQueueReport'][_0xc01a('0x50')]({'where':{'id':_0x41d64c[_0xc01a('0x52')]['id']}})['then'](handleEntityNotFound(_0x10fca8,null))[_0xc01a('0x2c')](removeEntity(_0x10fca8,null))[_0xc01a('0x4e')](handleError(_0x10fca8,null));};exports['describe']=function(_0x4f54de,_0x345892){return db[_0xc01a('0x33')][_0xc01a('0x53')]()['then'](respondWithResult(_0x345892,null))[_0xc01a('0x4e')](handleError(_0x345892,null));};exports['getVoiceQueuesReport']=function(_0x30094d,_0x45d54e){var _0x55cd9d={},_0x56c88e={},_0x364f08={'count':0x0,'rows':[]};_0x56c88e['model']=_['keys'](db['VoiceQueueReport']['rawAttributes']);_0x56c88e[_0xc01a('0x39')]=_[_0xc01a('0x3a')](_0x30094d[_0xc01a('0x39')]);_0x56c88e['filters']=_[_0xc01a('0x3d')](_0x56c88e[_0xc01a('0x38')],_0x56c88e[_0xc01a('0x39')]);_0x55cd9d[_0xc01a('0x3c')]=_[_0xc01a('0x3d')](_0x56c88e[_0xc01a('0x38')],qs[_0xc01a('0x3e')](_0x30094d[_0xc01a('0x39')][_0xc01a('0x3e')]));_0x55cd9d[_0xc01a('0x3c')]=_0x55cd9d[_0xc01a('0x3c')][_0xc01a('0x3f')]?_0x55cd9d['attributes']:_0x56c88e[_0xc01a('0x38')];if(!_0x30094d['query']['hasOwnProperty'](_0xc01a('0x41'))){_0x55cd9d[_0xc01a('0x23')]=qs[_0xc01a('0x23')](_0x30094d[_0xc01a('0x39')]['limit']);_0x55cd9d[_0xc01a('0x21')]=qs['offset'](_0x30094d[_0xc01a('0x39')][_0xc01a('0x21')]);}_0x55cd9d['order']=qs[_0xc01a('0x43')](_0x30094d['query']['sort']);_0x55cd9d['where']=qs[_0xc01a('0x3b')](_[_0xc01a('0x45')](_0x30094d[_0xc01a('0x39')],_0x56c88e[_0xc01a('0x3b')]));if(_0x30094d['query'][_0xc01a('0x46')]){_0x55cd9d['where']=_[_0xc01a('0x47')](_0x55cd9d[_0xc01a('0x44')],{'$or':_['map'](_0x55cd9d[_0xc01a('0x3c')],function(_0x3ebc81){var _0x4706c8={};_0x4706c8[_0x3ebc81]={'$like':'%'+_0x30094d[_0xc01a('0x39')][_0xc01a('0x46')]+'%'};return _0x4706c8;})});}_0x55cd9d=_[_0xc01a('0x47')]({},_0x55cd9d,_0x30094d[_0xc01a('0x49')]);var _0x2f1c12={'where':_0x55cd9d[_0xc01a('0x44')]};return db[_0xc01a('0x33')][_0xc01a('0x24')](_0x2f1c12)[_0xc01a('0x2c')](function(_0x455743){_0x364f08['count']=_0x455743;if(_0x30094d[_0xc01a('0x39')][_0xc01a('0x4a')]){_0x55cd9d['include']=[{'all':!![]}];}return db[_0xc01a('0x33')]['findAll'](_0x55cd9d);})[_0xc01a('0x2c')](function(_0x1cf65){_0x364f08['rows']=_0x1cf65;return _0x364f08;})['then'](respondWithFilteredResult(_0x45d54e,_0x55cd9d,_0xc01a('0x54')))[_0xc01a('0x4e')](handleError(_0x45d54e,null,_0xc01a('0x54')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 2cbf861..4d48c03 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 _0x2e1c=['VoiceQueueReport','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x2e1c,0x1e8));var _0xc2e1=function(_0x42589e,_0x560526){_0x42589e=_0x42589e-0x0;var _0x377b11=_0x2e1c[_0x42589e];return _0x377b11;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db'][_0xc2e1('0x0')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xc2e1('0x1')](0x0);var events={'afterCreate':_0xc2e1('0x2'),'afterUpdate':_0xc2e1('0x3'),'afterDestroy':_0xc2e1('0x4')};function emitEvent(_0x59a142){return function(_0x1abe12,_0x23dff4,_0x3953ed){VoiceQueueReportEvents['emit'](_0x59a142+':'+_0x1abe12['id'],_0x1abe12);VoiceQueueReportEvents['emit'](_0x59a142,_0x1abe12);_0x3953ed(null);};}for(var e in events){if(events[_0xc2e1('0x5')](e)){var event=events[e];VoiceQueueReport[_0xc2e1('0x6')](e,emitEvent(event));}}module[_0xc2e1('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x4989=['update','remove','emit','hasOwnProperty','exports','VoiceQueueReport'];(function(_0x51c31b,_0x215673){var _0x483895=function(_0x342bd8){while(--_0x342bd8){_0x51c31b['push'](_0x51c31b['shift']());}};_0x483895(++_0x215673);}(_0x4989,0x185));var _0x9498=function(_0x327cbf,_0x114362){_0x327cbf=_0x327cbf-0x0;var _0x409cb8=_0x4989[_0x327cbf];return _0x409cb8;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db'][_0x9498('0x0')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x9498('0x1'),'afterDestroy':_0x9498('0x2')};function emitEvent(_0x337de6){return function(_0x4947b7,_0x56c069,_0x2d395f){VoiceQueueReportEvents[_0x9498('0x3')](_0x337de6+':'+_0x4947b7['id'],_0x4947b7);VoiceQueueReportEvents[_0x9498('0x3')](_0x337de6,_0x4947b7);_0x2d395f(null);};}for(var e in events){if(events[_0x9498('0x4')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x9498('0x5')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index eb35c02..e5c9e77 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 _0x4b9c=['exports','define','report_queue','uniqueid','lodash','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b9c,0x1c6));var _0xc4b9=function(_0x273408,_0x207885){_0x273408=_0x273408-0x0;var _0x59248d=_0x4b9c[_0x273408];return _0x59248d;};'use strict';var _=require(_0xc4b9('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xc4b9('0x1'));var BPromise=require(_0xc4b9('0x2'));var rp=require(_0xc4b9('0x3'));var fs=require('fs');var path=require(_0xc4b9('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceQueueReport.attributes');module[_0xc4b9('0x5')]=function(_0x570330,_0x595e25){return _0x570330[_0xc4b9('0x6')]('VoiceQueueReport',attributes,{'tableName':_0xc4b9('0x7'),'paranoid':![],'indexes':[{'fields':[_0xc4b9('0x8')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x20e2=['VoiceQueueReport','report_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','../../config/environment','./voiceQueueReport.attributes','exports','define'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x20e2,0x1cb));var _0x220e=function(_0x37e048,_0x370ce8){_0x37e048=_0x37e048-0x0;var _0xe022fe=_0x20e2[_0x37e048];return _0xe022fe;};'use strict';var _=require(_0x220e('0x0'));var util=require(_0x220e('0x1'));var logger=require(_0x220e('0x2'))('api');var moment=require(_0x220e('0x3'));var BPromise=require(_0x220e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x220e('0x5'));var attributes=require(_0x220e('0x6'));module[_0x220e('0x7')]=function(_0x27d55a,_0x3d2dbc){return _0x27d55a[_0x220e('0x8')](_0x220e('0x9'),attributes,{'tableName':_0x220e('0xa'),'paranoid':![],'indexes':[{'fields':[_0x220e('0xb')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index c4cda51..a1df4bf 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 _0x0a09=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','register','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','model','map','GetVoiceQueueReport','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','update','body','lodash','util','bluebird','randomstring'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x0a09,0x7d));var _0x90a0=function(_0x2892da,_0x191a40){_0x2892da=_0x2892da-0x0;var _0x28cff2=_0x0a09[_0x2892da];return _0x28cff2;};'use strict';var _=require(_0x90a0('0x0'));var util=require(_0x90a0('0x1'));var moment=require('moment');var BPromise=require(_0x90a0('0x2'));var rs=require(_0x90a0('0x3'));var fs=require('fs');var Redis=require(_0x90a0('0x4'));var db=require(_0x90a0('0x5'))['db'];var utils=require(_0x90a0('0x6'));var logger=require(_0x90a0('0x7'))(_0x90a0('0x8'));var config=require('../../config/environment');var jayson=require(_0x90a0('0x9'));var client=jayson[_0x90a0('0xa')]['http']({'port':0x232a});config[_0x90a0('0xb')]=_['defaults'](config[_0x90a0('0xb')],{'host':_0x90a0('0xc'),'port':0x18eb});var socket=require(_0x90a0('0xd'))(new Redis(config[_0x90a0('0xb')]));require('./voiceQueueReport.socket')[_0x90a0('0xe')](socket);function respondWithRpcPromise(_0x4ad4e6,_0x5aa147,_0x1bfcb6){return new BPromise(function(_0x5bbde0,_0x21fe17){return client['request'](_0x4ad4e6,_0x1bfcb6)[_0x90a0('0xf')](function(_0x47d828){logger[_0x90a0('0x10')](_0x90a0('0x11'),_0x5aa147,_0x90a0('0x12'));logger[_0x90a0('0x13')](_0x90a0('0x14'),_0x5aa147,_0x90a0('0x12'),JSON[_0x90a0('0x15')](_0x47d828));if(_0x47d828['error']){if(_0x47d828[_0x90a0('0x16')][_0x90a0('0x17')]===0x1f4){logger[_0x90a0('0x16')](_0x90a0('0x11'),_0x5aa147,_0x47d828[_0x90a0('0x16')]['message']);return _0x21fe17(_0x47d828[_0x90a0('0x16')][_0x90a0('0x18')]);}logger[_0x90a0('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x5aa147,_0x47d828[_0x90a0('0x16')][_0x90a0('0x18')]);return _0x5bbde0(_0x47d828[_0x90a0('0x16')][_0x90a0('0x18')]);}else{logger[_0x90a0('0x10')](_0x90a0('0x11'),_0x5aa147,_0x90a0('0x12'));_0x5bbde0(_0x47d828[_0x90a0('0x19')][_0x90a0('0x18')]);}})[_0x90a0('0x1a')](function(_0xd4f1eb){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x5aa147,_0xd4f1eb);_0x21fe17(_0xd4f1eb);});});}exports['GetVoiceQueueReport']=function(_0x268847){var _0x24ebdf=this;return new Promise(function(_0x44b923,_0x15775c){return db[_0x90a0('0x1b')][_0x90a0('0x1c')]({'raw':_0x268847[_0x90a0('0x1d')]?_0x268847['options'][_0x90a0('0x1e')]===undefined?!![]:![]:!![],'where':_0x268847[_0x90a0('0x1d')]?_0x268847[_0x90a0('0x1d')][_0x90a0('0x1f')]||null:null,'attributes':_0x268847[_0x90a0('0x1d')]?_0x268847[_0x90a0('0x1d')][_0x90a0('0x20')]||null:null,'limit':_0x268847[_0x90a0('0x1d')]?_0x268847['options'][_0x90a0('0x21')]||null:null,'include':_0x268847[_0x90a0('0x1d')]?_0x268847[_0x90a0('0x1d')][_0x90a0('0x22')]?_['map'](_0x268847[_0x90a0('0x1d')][_0x90a0('0x22')],function(_0x2c4ad0){return{'model':db[_0x2c4ad0[_0x90a0('0x23')]],'as':_0x2c4ad0['as'],'attributes':_0x2c4ad0['attributes'],'include':_0x2c4ad0[_0x90a0('0x22')]?_[_0x90a0('0x24')](_0x2c4ad0[_0x90a0('0x22')],function(_0x185b19){return{'model':db[_0x185b19[_0x90a0('0x23')]],'as':_0x185b19['as'],'attributes':_0x185b19['attributes'],'include':_0x185b19[_0x90a0('0x22')]?_[_0x90a0('0x24')](_0x185b19['include'],function(_0x116cf5){return{'model':db[_0x116cf5[_0x90a0('0x23')]],'as':_0x116cf5['as'],'attributes':_0x116cf5[_0x90a0('0x20')]};}):[]};}):[]};}):[]:[]})[_0x90a0('0xf')](function(_0x5b0ac8){logger[_0x90a0('0x10')](_0x90a0('0x25'),_0x268847);logger['debug']('GetVoiceQueueReport',_0x268847,JSON[_0x90a0('0x15')](_0x5b0ac8));_0x44b923(_0x5b0ac8);})['catch'](function(_0xdc7f69){logger[_0x90a0('0x16')]('GetVoiceQueueReport',_0xdc7f69[_0x90a0('0x18')],_0x268847);_0x15775c(_0x24ebdf[_0x90a0('0x16')](0x1f4,_0xdc7f69[_0x90a0('0x18')]));});});};exports[_0x90a0('0x26')]=function(_0x4eedf3){var _0x1ccd11=this;return new Promise(function(_0x45feb2,_0x1f638c){return db[_0x90a0('0x1b')][_0x90a0('0x27')](_0x4eedf3['body'],{'raw':_0x4eedf3[_0x90a0('0x1d')]?_0x4eedf3[_0x90a0('0x1d')][_0x90a0('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x503dfc){logger[_0x90a0('0x10')]('CreateVoiceQueueReport',_0x4eedf3);logger[_0x90a0('0x13')]('CreateVoiceQueueReport',_0x4eedf3,JSON[_0x90a0('0x15')](_0x503dfc));_0x45feb2(_0x503dfc);})[_0x90a0('0x1a')](function(_0x229abf){logger['error'](_0x90a0('0x26'),_0x229abf[_0x90a0('0x18')],_0x4eedf3);_0x1f638c(_0x1ccd11['error'](0x1f4,_0x229abf[_0x90a0('0x18')]));});});};exports[_0x90a0('0x28')]=function(_0x3dc2a3){var _0xba1c9d=this;return new Promise(function(_0x591fe3,_0x66f3cd){return db[_0x90a0('0x1b')][_0x90a0('0x29')](_0x3dc2a3[_0x90a0('0x2a')],{'raw':_0x3dc2a3[_0x90a0('0x1d')]?_0x3dc2a3[_0x90a0('0x1d')][_0x90a0('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3dc2a3[_0x90a0('0x1d')]?_0x3dc2a3['options'][_0x90a0('0x1f')]||null:null,'attributes':_0x3dc2a3[_0x90a0('0x1d')]?_0x3dc2a3[_0x90a0('0x1d')]['attributes']||null:null,'limit':_0x3dc2a3[_0x90a0('0x1d')]?_0x3dc2a3[_0x90a0('0x1d')][_0x90a0('0x21')]||null:null})['then'](function(_0x2902cc){logger[_0x90a0('0x10')](_0x90a0('0x28'),_0x3dc2a3);logger[_0x90a0('0x13')](_0x90a0('0x28'),_0x3dc2a3,JSON[_0x90a0('0x15')](_0x2902cc));_0x591fe3(_0x2902cc);})[_0x90a0('0x1a')](function(_0x52836c){logger[_0x90a0('0x16')](_0x90a0('0x28'),_0x52836c['message'],_0x3dc2a3);_0x66f3cd(_0xba1c9d[_0x90a0('0x16')](0x1f4,_0x52836c[_0x90a0('0x18')]));});});}; \ No newline at end of file +var _0x52e6=['include','map','model','attributes','create','body','CreateVoiceQueueReport','limit','UpdateVoiceQueueReport','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where'];(function(_0xfbb2c4,_0x26b45a){var _0x440158=function(_0x4dee3b){while(--_0x4dee3b){_0xfbb2c4['push'](_0xfbb2c4['shift']());}};_0x440158(++_0x26b45a);}(_0x52e6,0x1ad));var _0x652e=function(_0x50a2b9,_0x23e3c3){_0x50a2b9=_0x50a2b9-0x0;var _0x311298=_0x52e6[_0x50a2b9];return _0x311298;};'use strict';var _=require('lodash');var util=require(_0x652e('0x0'));var moment=require(_0x652e('0x1'));var BPromise=require(_0x652e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x652e('0x3'))['db'];var utils=require(_0x652e('0x4'));var logger=require(_0x652e('0x5'))(_0x652e('0x6'));var config=require(_0x652e('0x7'));var jayson=require(_0x652e('0x8'));var client=jayson[_0x652e('0x9')][_0x652e('0xa')]({'port':0x232a});config[_0x652e('0xb')]=_[_0x652e('0xc')](config[_0x652e('0xb')],{'host':_0x652e('0xd'),'port':0x18eb});var socket=require(_0x652e('0xe'))(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0x652e('0xf')](socket);function respondWithRpcPromise(_0x305659,_0x2d64fa,_0x3fc9ba){return new BPromise(function(_0x2abe9d,_0xe3db70){return client[_0x652e('0x10')](_0x305659,_0x3fc9ba)[_0x652e('0x11')](function(_0x32d85a){logger['info'](_0x652e('0x12'),_0x2d64fa,_0x652e('0x13'));logger[_0x652e('0x14')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x2d64fa,'request\x20sent',JSON[_0x652e('0x15')](_0x32d85a));if(_0x32d85a[_0x652e('0x16')]){if(_0x32d85a[_0x652e('0x16')][_0x652e('0x17')]===0x1f4){logger[_0x652e('0x16')](_0x652e('0x12'),_0x2d64fa,_0x32d85a[_0x652e('0x16')][_0x652e('0x18')]);return _0xe3db70(_0x32d85a[_0x652e('0x16')][_0x652e('0x18')]);}logger['error'](_0x652e('0x12'),_0x2d64fa,_0x32d85a['error'][_0x652e('0x18')]);return _0x2abe9d(_0x32d85a['error']['message']);}else{logger[_0x652e('0x19')]('VoiceQueueReport,\x20%s,\x20%s',_0x2d64fa,_0x652e('0x13'));_0x2abe9d(_0x32d85a['result'][_0x652e('0x18')]);}})[_0x652e('0x1a')](function(_0x31ae6f){logger[_0x652e('0x16')](_0x652e('0x12'),_0x2d64fa,_0x31ae6f);_0xe3db70(_0x31ae6f);});});}exports[_0x652e('0x1b')]=function(_0x55871f){var _0x39c8f6=this;return new Promise(function(_0x21371b,_0x51eeea){return db[_0x652e('0x1c')][_0x652e('0x1d')]({'raw':_0x55871f[_0x652e('0x1e')]?_0x55871f[_0x652e('0x1e')][_0x652e('0x1f')]===undefined?!![]:![]:!![],'where':_0x55871f[_0x652e('0x1e')]?_0x55871f['options'][_0x652e('0x20')]||null:null,'attributes':_0x55871f[_0x652e('0x1e')]?_0x55871f[_0x652e('0x1e')]['attributes']||null:null,'limit':_0x55871f[_0x652e('0x1e')]?_0x55871f['options']['limit']||null:null,'include':_0x55871f['options']?_0x55871f['options'][_0x652e('0x21')]?_[_0x652e('0x22')](_0x55871f[_0x652e('0x1e')]['include'],function(_0x5ebefc){return{'model':db[_0x5ebefc[_0x652e('0x23')]],'as':_0x5ebefc['as'],'attributes':_0x5ebefc[_0x652e('0x24')],'include':_0x5ebefc['include']?_[_0x652e('0x22')](_0x5ebefc['include'],function(_0x49866c){return{'model':db[_0x49866c[_0x652e('0x23')]],'as':_0x49866c['as'],'attributes':_0x49866c['attributes'],'include':_0x49866c[_0x652e('0x21')]?_[_0x652e('0x22')](_0x49866c[_0x652e('0x21')],function(_0xa269dd){return{'model':db[_0xa269dd[_0x652e('0x23')]],'as':_0xa269dd['as'],'attributes':_0xa269dd[_0x652e('0x24')]};}):[]};}):[]};}):[]:[]})[_0x652e('0x11')](function(_0x2324ba){logger[_0x652e('0x19')](_0x652e('0x1b'),_0x55871f);logger[_0x652e('0x14')](_0x652e('0x1b'),_0x55871f,JSON[_0x652e('0x15')](_0x2324ba));_0x21371b(_0x2324ba);})[_0x652e('0x1a')](function(_0x17d7c3){logger['error']('GetVoiceQueueReport',_0x17d7c3[_0x652e('0x18')],_0x55871f);_0x51eeea(_0x39c8f6[_0x652e('0x16')](0x1f4,_0x17d7c3['message']));});});};exports['CreateVoiceQueueReport']=function(_0x1cd749){var _0x849d93=this;return new Promise(function(_0x33270e,_0x3136dc){return db[_0x652e('0x1c')][_0x652e('0x25')](_0x1cd749[_0x652e('0x26')],{'raw':_0x1cd749[_0x652e('0x1e')]?_0x1cd749['options'][_0x652e('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x20cdcc){logger[_0x652e('0x19')](_0x652e('0x27'),_0x1cd749);logger['debug'](_0x652e('0x27'),_0x1cd749,JSON[_0x652e('0x15')](_0x20cdcc));_0x33270e(_0x20cdcc);})[_0x652e('0x1a')](function(_0x3a1a99){logger[_0x652e('0x16')]('CreateVoiceQueueReport',_0x3a1a99[_0x652e('0x18')],_0x1cd749);_0x3136dc(_0x849d93[_0x652e('0x16')](0x1f4,_0x3a1a99[_0x652e('0x18')]));});});};exports['UpdateVoiceQueueReport']=function(_0x4ba75e){var _0x7480bb=this;return new Promise(function(_0x480ac0,_0x16098a){return db[_0x652e('0x1c')]['update'](_0x4ba75e[_0x652e('0x26')],{'raw':_0x4ba75e['options']?_0x4ba75e[_0x652e('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ba75e[_0x652e('0x1e')]?_0x4ba75e[_0x652e('0x1e')][_0x652e('0x20')]||null:null,'attributes':_0x4ba75e[_0x652e('0x1e')]?_0x4ba75e[_0x652e('0x1e')][_0x652e('0x24')]||null:null,'limit':_0x4ba75e[_0x652e('0x1e')]?_0x4ba75e[_0x652e('0x1e')][_0x652e('0x28')]||null:null})[_0x652e('0x11')](function(_0x538aaf){logger[_0x652e('0x19')](_0x652e('0x29'),_0x4ba75e);logger[_0x652e('0x14')](_0x652e('0x29'),_0x4ba75e,JSON[_0x652e('0x15')](_0x538aaf));_0x480ac0(_0x538aaf);})[_0x652e('0x1a')](function(_0x523190){logger[_0x652e('0x16')](_0x652e('0x29'),_0x523190[_0x652e('0x18')],_0x4ba75e);_0x16098a(_0x7480bb['error'](0x1f4,_0x523190[_0x652e('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 2dbdb1b..4983d21 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 _0x7531=['./voiceQueueReport.events','save','remove','emit','removeListener','length','voiceQueueReport:'];(function(_0x3fde8f,_0x400e9c){var _0x5988b7=function(_0x1fde6f){while(--_0x1fde6f){_0x3fde8f['push'](_0x3fde8f['shift']());}};_0x5988b7(++_0x400e9c);}(_0x7531,0x69));var _0x1753=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x7531[_0x397e5f];return _0x5302b8;};'use strict';var VoiceQueueReportEvents=require(_0x1753('0x0'));var events=[_0x1753('0x1'),_0x1753('0x2'),'update'];function createListener(_0x5b48a9,_0x581dd8){return function(_0x286ce5){_0x581dd8[_0x1753('0x3')](_0x5b48a9,_0x286ce5);};}function removeListener(_0x5595df,_0x22192f){return function(){VoiceQueueReportEvents[_0x1753('0x4')](_0x5595df,_0x22192f);};}exports['register']=function(_0x169355){for(var _0x411737=0x0,_0x2b7da1=events[_0x1753('0x5')];_0x411737<_0x2b7da1;_0x411737++){var _0xce3a0b=events[_0x411737];var _0x41533a=createListener(_0x1753('0x6')+_0xce3a0b,_0x169355);VoiceQueueReportEvents['on'](_0xce3a0b,_0x41533a);}}; \ No newline at end of file +var _0x18d6=['update','register','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0x5302fb,_0x1a2db3){var _0x43e6a4=function(_0x324ae6){while(--_0x324ae6){_0x5302fb['push'](_0x5302fb['shift']());}};_0x43e6a4(++_0x1a2db3);}(_0x18d6,0x166));var _0x618d=function(_0x1b5fdd,_0x5cf4e5){_0x1b5fdd=_0x1b5fdd-0x0;var _0x234c76=_0x18d6[_0x1b5fdd];return _0x234c76;};'use strict';var VoiceQueueReportEvents=require(_0x618d('0x0'));var events=[_0x618d('0x1'),'remove',_0x618d('0x2')];function createListener(_0x1b9feb,_0x2a5bc1){return function(_0x3b0d41){_0x2a5bc1['emit'](_0x1b9feb,_0x3b0d41);};}function removeListener(_0x3151de,_0x1a7716){return function(){VoiceQueueReportEvents['removeListener'](_0x3151de,_0x1a7716);};}exports[_0x618d('0x3')]=function(_0x55caad){for(var _0xa89cff=0x0,_0x2d3dbf=events['length'];_0xa89cff<_0x2d3dbf;_0xa89cff++){var _0x41ca65=events[_0xa89cff];var _0x45d2d3=createListener(_0x618d('0x4')+_0x41ca65,_0x55caad);VoiceQueueReportEvents['on'](_0x41ca65,_0x45d2d3);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 3c7903d..bf3c7d1 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 _0x62da=['./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x34b849,_0x4d5692){var _0x23e164=function(_0x6c691f){while(--_0x6c691f){_0x34b849['push'](_0x34b849['shift']());}};_0x23e164(++_0x4d5692);}(_0x62da,0xc0));var _0xa62d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x62da[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xa62d('0x0'));var util=require('util');var path=require(_0xa62d('0x1'));var timeout=require(_0xa62d('0x2'));var express=require(_0xa62d('0x3'));var router=express[_0xa62d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa62d('0x5'));var interaction=require(_0xa62d('0x6'));var config=require(_0xa62d('0x7'));var controller=require(_0xa62d('0x8'));router[_0xa62d('0x9')]('/',auth[_0xa62d('0xa')](),controller[_0xa62d('0xb')]);router[_0xa62d('0x9')](_0xa62d('0xc'),auth[_0xa62d('0xa')](),controller[_0xa62d('0xd')]);router[_0xa62d('0xe')]('/',auth['isAuthenticated'](),controller[_0xa62d('0xf')]);router[_0xa62d('0x10')]('/:id',auth[_0xa62d('0xa')](),controller[_0xa62d('0x11')]);router[_0xa62d('0x12')](_0xa62d('0xc'),auth[_0xa62d('0xa')](),controller['destroy']);module[_0xa62d('0x13')]=router; \ No newline at end of file +var _0xb0b4=['destroy','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x1ae662,_0x82dbc){var _0x2c459f=function(_0xb29131){while(--_0xb29131){_0x1ae662['push'](_0x1ae662['shift']());}};_0x2c459f(++_0x82dbc);}(_0xb0b4,0xb6));var _0x4b0b=function(_0x35e37f,_0x510a6e){_0x35e37f=_0x35e37f-0x0;var _0xa6ac99=_0xb0b4[_0x35e37f];return _0xa6ac99;};'use strict';var multer=require(_0x4b0b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4b0b('0x1'));var express=require(_0x4b0b('0x2'));var router=express['Router']();var fs_extra=require(_0x4b0b('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4b0b('0x4'));var config=require(_0x4b0b('0x5'));var controller=require(_0x4b0b('0x6'));router[_0x4b0b('0x7')]('/',auth[_0x4b0b('0x8')](),controller[_0x4b0b('0x9')]);router[_0x4b0b('0x7')](_0x4b0b('0xa'),auth[_0x4b0b('0x8')](),controller[_0x4b0b('0xb')]);router[_0x4b0b('0xc')]('/',auth[_0x4b0b('0x8')](),controller[_0x4b0b('0xd')]);router[_0x4b0b('0xe')](_0x4b0b('0xa'),auth[_0x4b0b('0x8')](),controller[_0x4b0b('0xf')]);router['delete'](_0x4b0b('0xa'),auth['isAuthenticated'](),controller[_0x4b0b('0x10')]);module[_0x4b0b('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 b3f302b..b720a5b 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 _0x68cf=['format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING','DATE'];(function(_0x338b30,_0x12e994){var _0x56c628=function(_0x14ea6f){while(--_0x14ea6f){_0x338b30['push'](_0x338b30['shift']());}};_0x56c628(++_0x12e994);}(_0x68cf,0xe9));var _0xf68c=function(_0x4d7f96,_0x296626){_0x4d7f96=_0x4d7f96-0x0;var _0x16dbe6=_0x68cf[_0x4d7f96];return _0x16dbe6;};'use strict';var Sequelize=require(_0xf68c('0x0'));var moment=require(_0xf68c('0x1'));module[_0xf68c('0x2')]={'time':{'type':Sequelize[_0xf68c('0x3')]},'callid':{'type':Sequelize[_0xf68c('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xf68c('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xf68c('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xf68c('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xf68c('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xf68c('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xf68c('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xf68c('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xf68c('0x4')],'allowNull':![],'defaultValue':moment()[_0xf68c('0x5')](_0xf68c('0x6'))}}; \ No newline at end of file +var _0xa90b=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','STRING'];(function(_0x3e4285,_0x83a4f0){var _0xce09e7=function(_0x2f13ee){while(--_0x2f13ee){_0x3e4285['push'](_0x3e4285['shift']());}};_0xce09e7(++_0x83a4f0);}(_0xa90b,0x10c));var _0xba90=function(_0x4358f5,_0x5b1ac6){_0x4358f5=_0x4358f5-0x0;var _0x4d8104=_0xa90b[_0x4358f5];return _0x4d8104;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xba90('0x0'));module['exports']={'time':{'type':Sequelize[_0xba90('0x1')]},'callid':{'type':Sequelize[_0xba90('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xba90('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xba90('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xba90('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xba90('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xba90('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xba90('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xba90('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xba90('0x2')],'allowNull':![],'defaultValue':moment()[_0xba90('0x3')](_0xba90('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index e7f4a3c..e660f2c 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 _0x6940=['query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','update','then','destroy','error','name','index','VoiceQueuesLog','fieldName','type','key','model','map'];(function(_0x154c0e,_0x1390ca){var _0x2e57fe=function(_0x38d265){while(--_0x38d265){_0x154c0e['push'](_0x154c0e['shift']());}};_0x2e57fe(++_0x1390ca);}(_0x6940,0xae));var _0x0694=function(_0x24ee66,_0x2da36b){_0x24ee66=_0x24ee66-0x0;var _0x3d2a44=_0x6940[_0x24ee66];return _0x3d2a44;};'use strict';var emlformat=require(_0x0694('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0694('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0694('0x2'));var moment=require(_0x0694('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0694('0x4'));var util=require(_0x0694('0x5'));var path=require(_0x0694('0x6'));var sox=require(_0x0694('0x7'));var csv=require(_0x0694('0x8'));var ejs=require(_0x0694('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0694('0xa'));var squel=require('squel');var crypto=require(_0x0694('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0694('0xc'));var toCsv=require(_0x0694('0x8'));var querystring=require(_0x0694('0xd'));var Papa=require(_0x0694('0xe'));var Redis=require('ioredis');var authService=require(_0x0694('0xf'));var qs=require(_0x0694('0x10'));var as=require(_0x0694('0x11'));var hardwareService=require(_0x0694('0x12'));var logger=require(_0x0694('0x13'))('api');var utils=require(_0x0694('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0694('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf83007,_0x34df58){_0x34df58=_0x34df58||0xcc;return function(_0x35fc16){if(_0x35fc16){return _0xf83007[_0x0694('0x16')](_0x34df58);}return _0xf83007[_0x0694('0x17')](_0x34df58)[_0x0694('0x18')]();};}function respondWithResult(_0x411821,_0x4fd186){_0x4fd186=_0x4fd186||0xc8;return function(_0x1df55e){if(_0x1df55e){return _0x411821[_0x0694('0x17')](_0x4fd186)[_0x0694('0x19')](_0x1df55e);}};}function respondWithFilteredResult(_0x24b937,_0x39404d){return function(_0x69d868){if(_0x69d868){var _0x64a9f8=typeof _0x39404d['offset']==='undefined'&&typeof _0x39404d[_0x0694('0x1a')]===_0x0694('0x1b');var _0x3ca4a3=_0x69d868[_0x0694('0x1c')];var _0x4314d9=_0x64a9f8?0x0:_0x39404d[_0x0694('0x1d')];var _0x52aa02=_0x64a9f8?_0x69d868[_0x0694('0x1c')]:_0x39404d[_0x0694('0x1d')]+_0x39404d['limit'];var _0x13f6f2;if(_0x52aa02>=_0x3ca4a3){_0x52aa02=_0x3ca4a3;_0x13f6f2=0xc8;}else{_0x13f6f2=0xce;}_0x24b937[_0x0694('0x17')](_0x13f6f2);return _0x24b937['set'](_0x0694('0x1e'),_0x4314d9+'-'+_0x52aa02+'/'+_0x3ca4a3)[_0x0694('0x19')](_0x69d868);}return null;};}function patchUpdates(_0x133727){return function(_0x5932fd){try{jsonpatch[_0x0694('0x1f')](_0x5932fd,_0x133727,!![]);}catch(_0x4b0a65){return BPromise[_0x0694('0x20')](_0x4b0a65);}return _0x5932fd['save']();};}function saveUpdates(_0x4a29e4,_0x34c9a2){return function(_0x17393f){if(_0x17393f){return _0x17393f[_0x0694('0x21')](_0x4a29e4)[_0x0694('0x22')](function(_0x3130af){return _0x3130af;});}return null;};}function removeEntity(_0xf8b58e,_0x5ba579){return function(_0x3942f4){if(_0x3942f4){return _0x3942f4[_0x0694('0x23')]()['then'](function(){_0xf8b58e[_0x0694('0x17')](0xcc)[_0x0694('0x18')]();});}};}function handleEntityNotFound(_0x3c6b5b,_0xe01a23){return function(_0x3f7ac5){if(!_0x3f7ac5){_0x3c6b5b['sendStatus'](0x194);}return _0x3f7ac5;};}function handleError(_0x12e9e2,_0x3f79f2){_0x3f79f2=_0x3f79f2||0x1f4;return function(_0x1cdfc5){logger[_0x0694('0x24')](_0x1cdfc5['stack']);if(_0x1cdfc5['name']){delete _0x1cdfc5[_0x0694('0x25')];}_0x12e9e2[_0x0694('0x17')](_0x3f79f2)['send'](_0x1cdfc5);};}exports[_0x0694('0x26')]=function(_0x13634b,_0xb7bdf3){var _0x206024={},_0x3c7d65={},_0x510c60={'count':0x0,'rows':[]};var _0x3dbb08=_['map'](db[_0x0694('0x27')]['rawAttributes'],function(_0x14f066){return{'name':_0x14f066[_0x0694('0x28')],'type':_0x14f066[_0x0694('0x29')][_0x0694('0x2a')]};});_0x3c7d65[_0x0694('0x2b')]=_[_0x0694('0x2c')](_0x3dbb08,_0x0694('0x25'));_0x3c7d65[_0x0694('0x2d')]=_[_0x0694('0x2e')](_0x13634b[_0x0694('0x2d')]);_0x3c7d65['filters']=_[_0x0694('0x2f')](_0x3c7d65['model'],_0x3c7d65['query']);_0x206024['attributes']=_[_0x0694('0x2f')](_0x3c7d65[_0x0694('0x2b')],qs[_0x0694('0x30')](_0x13634b['query'][_0x0694('0x30')]));_0x206024[_0x0694('0x31')]=_0x206024[_0x0694('0x31')][_0x0694('0x32')]?_0x206024['attributes']:_0x3c7d65[_0x0694('0x2b')];if(!_0x13634b['query'][_0x0694('0x33')](_0x0694('0x34'))){_0x206024[_0x0694('0x1a')]=qs[_0x0694('0x1a')](_0x13634b['query'][_0x0694('0x1a')]);_0x206024['offset']=qs[_0x0694('0x1d')](_0x13634b[_0x0694('0x2d')][_0x0694('0x1d')]);}_0x206024[_0x0694('0x35')]=qs[_0x0694('0x36')](_0x13634b[_0x0694('0x2d')][_0x0694('0x36')]);_0x206024[_0x0694('0x37')]=qs[_0x0694('0x38')](_[_0x0694('0x39')](_0x13634b[_0x0694('0x2d')],_0x3c7d65[_0x0694('0x38')]),_0x3dbb08);if(_0x13634b[_0x0694('0x2d')][_0x0694('0x3a')]){_0x206024[_0x0694('0x37')]=_[_0x0694('0x3b')](_0x206024[_0x0694('0x37')],{'$or':_[_0x0694('0x2c')](_0x3dbb08,function(_0x29d7f4){if(_0x29d7f4[_0x0694('0x29')]!==_0x0694('0x3c')){var _0x339acb={};_0x339acb[_0x29d7f4[_0x0694('0x25')]]={'$like':'%'+_0x13634b[_0x0694('0x2d')][_0x0694('0x3a')]+'%'};return _0x339acb;}})});}_0x206024=_[_0x0694('0x3b')]({},_0x206024,_0x13634b[_0x0694('0x3d')]);var _0x512ee3={'where':_0x206024[_0x0694('0x37')]};return db[_0x0694('0x27')][_0x0694('0x1c')](_0x512ee3)['then'](function(_0x31913c){_0x510c60['count']=_0x31913c;if(_0x13634b[_0x0694('0x2d')]['includeAll']){_0x206024[_0x0694('0x3e')]=[{'all':!![]}];}return db[_0x0694('0x27')][_0x0694('0x3f')](_0x206024);})[_0x0694('0x22')](function(_0x353c46){_0x510c60[_0x0694('0x40')]=_0x353c46;return _0x510c60;})[_0x0694('0x22')](respondWithFilteredResult(_0xb7bdf3,_0x206024))[_0x0694('0x41')](handleError(_0xb7bdf3,null));};exports[_0x0694('0x42')]=function(_0xca22a0,_0x4e46f7){var _0x2c95c9={'raw':!![],'where':{'id':_0xca22a0[_0x0694('0x43')]['id']}},_0x338c21={};_0x338c21[_0x0694('0x2b')]=_[_0x0694('0x2e')](db[_0x0694('0x27')][_0x0694('0x44')]);_0x338c21[_0x0694('0x2d')]=_['keys'](_0xca22a0[_0x0694('0x2d')]);_0x338c21[_0x0694('0x38')]=_[_0x0694('0x2f')](_0x338c21[_0x0694('0x2b')],_0x338c21['query']);_0x2c95c9[_0x0694('0x31')]=_[_0x0694('0x2f')](_0x338c21[_0x0694('0x2b')],qs[_0x0694('0x30')](_0xca22a0[_0x0694('0x2d')][_0x0694('0x30')]));_0x2c95c9['attributes']=_0x2c95c9[_0x0694('0x31')][_0x0694('0x32')]?_0x2c95c9['attributes']:_0x338c21[_0x0694('0x2b')];if(_0xca22a0[_0x0694('0x2d')][_0x0694('0x45')]){_0x2c95c9[_0x0694('0x3e')]=[{'all':!![]}];}_0x2c95c9=_[_0x0694('0x3b')]({},_0x2c95c9,_0xca22a0['options']);return db[_0x0694('0x27')][_0x0694('0x46')](_0x2c95c9)['then'](handleEntityNotFound(_0x4e46f7,null))[_0x0694('0x22')](respondWithResult(_0x4e46f7,null))[_0x0694('0x41')](handleError(_0x4e46f7,null));};exports[_0x0694('0x47')]=function(_0x177746,_0x4b15f2){return db[_0x0694('0x27')][_0x0694('0x47')](_0x177746[_0x0694('0x48')],{})[_0x0694('0x22')](respondWithResult(_0x4b15f2,0xc9))[_0x0694('0x41')](handleError(_0x4b15f2,null));};exports[_0x0694('0x21')]=function(_0x1e547c,_0x59696c){if(_0x1e547c[_0x0694('0x48')]['id']){delete _0x1e547c[_0x0694('0x48')]['id'];}return db[_0x0694('0x27')][_0x0694('0x46')]({'where':{'id':_0x1e547c[_0x0694('0x43')]['id']}})[_0x0694('0x22')](handleEntityNotFound(_0x59696c,null))[_0x0694('0x22')](saveUpdates(_0x1e547c[_0x0694('0x48')],null))['then'](respondWithResult(_0x59696c,null))[_0x0694('0x41')](handleError(_0x59696c,null));};exports[_0x0694('0x23')]=function(_0x22a3df,_0xf2bd47){return db[_0x0694('0x27')][_0x0694('0x46')]({'where':{'id':_0x22a3df[_0x0694('0x43')]['id']}})[_0x0694('0x22')](handleEntityNotFound(_0xf2bd47,null))[_0x0694('0x22')](removeEntity(_0xf2bd47,null))['catch'](handleError(_0xf2bd47,null));}; \ No newline at end of file +var _0x4d4a=['zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','update','destroy','then','sendStatus','stack','name','send','index','map','rawAttributes','type','model','keys','query','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','VoiceQueuesLog','includeAll','include','findAll','rows','catch','show','params','length','create','body','rimraf'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x4d4a,0x19d));var _0xa4d4=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x4d4a[_0x1cc8fe];return _0x230054;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa4d4('0x0'));var zipdir=require(_0xa4d4('0x1'));var jsonpatch=require(_0xa4d4('0x2'));var rp=require('request-promise');var moment=require(_0xa4d4('0x3'));var BPromise=require(_0xa4d4('0x4'));var Mustache=require(_0xa4d4('0x5'));var util=require('util');var path=require(_0xa4d4('0x6'));var sox=require(_0xa4d4('0x7'));var csv=require(_0xa4d4('0x8'));var ejs=require(_0xa4d4('0x9'));var fs=require('fs');var fs_extra=require(_0xa4d4('0xa'));var _=require('lodash');var squel=require(_0xa4d4('0xb'));var crypto=require(_0xa4d4('0xc'));var jsforce=require(_0xa4d4('0xd'));var deskjs=require(_0xa4d4('0xe'));var toCsv=require(_0xa4d4('0x8'));var querystring=require(_0xa4d4('0xf'));var Papa=require(_0xa4d4('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa4d4('0x11'));var as=require(_0xa4d4('0x12'));var hardwareService=require(_0xa4d4('0x13'));var logger=require(_0xa4d4('0x14'))(_0xa4d4('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa4d4('0x16'))['db'];function respondWithStatusCode(_0x354db4,_0x259338){_0x259338=_0x259338||0xcc;return function(_0x5ef81e){if(_0x5ef81e){return _0x354db4['sendStatus'](_0x259338);}return _0x354db4[_0xa4d4('0x17')](_0x259338)[_0xa4d4('0x18')]();};}function respondWithResult(_0xf66828,_0x4b39eb){_0x4b39eb=_0x4b39eb||0xc8;return function(_0x9b0ca2){if(_0x9b0ca2){return _0xf66828[_0xa4d4('0x17')](_0x4b39eb)[_0xa4d4('0x19')](_0x9b0ca2);}};}function respondWithFilteredResult(_0x6b8a03,_0x243ebf){return function(_0x91ae23){if(_0x91ae23){var _0x483061=typeof _0x243ebf[_0xa4d4('0x1a')]==='undefined'&&typeof _0x243ebf['limit']===_0xa4d4('0x1b');var _0x23cd35=_0x91ae23['count'];var _0x7d287d=_0x483061?0x0:_0x243ebf[_0xa4d4('0x1a')];var _0x45c48a=_0x483061?_0x91ae23[_0xa4d4('0x1c')]:_0x243ebf[_0xa4d4('0x1a')]+_0x243ebf[_0xa4d4('0x1d')];var _0x5b4c8a;if(_0x45c48a>=_0x23cd35){_0x45c48a=_0x23cd35;_0x5b4c8a=0xc8;}else{_0x5b4c8a=0xce;}_0x6b8a03['status'](_0x5b4c8a);return _0x6b8a03[_0xa4d4('0x1e')](_0xa4d4('0x1f'),_0x7d287d+'-'+_0x45c48a+'/'+_0x23cd35)[_0xa4d4('0x19')](_0x91ae23);}return null;};}function patchUpdates(_0x3c90ae){return function(_0xfb672b){try{jsonpatch['apply'](_0xfb672b,_0x3c90ae,!![]);}catch(_0x618fc5){return BPromise['reject'](_0x618fc5);}return _0xfb672b['save']();};}function saveUpdates(_0xa6d715,_0x2503ac){return function(_0x17862e){if(_0x17862e){return _0x17862e[_0xa4d4('0x20')](_0xa6d715)['then'](function(_0x1ce0ff){return _0x1ce0ff;});}return null;};}function removeEntity(_0x31da12,_0x2af556){return function(_0x5c1061){if(_0x5c1061){return _0x5c1061[_0xa4d4('0x21')]()[_0xa4d4('0x22')](function(){_0x31da12[_0xa4d4('0x17')](0xcc)[_0xa4d4('0x18')]();});}};}function handleEntityNotFound(_0x3984b7,_0xd80bdc){return function(_0xe1a186){if(!_0xe1a186){_0x3984b7[_0xa4d4('0x23')](0x194);}return _0xe1a186;};}function handleError(_0x3b0627,_0xaec732){_0xaec732=_0xaec732||0x1f4;return function(_0x30fd7d){logger['error'](_0x30fd7d[_0xa4d4('0x24')]);if(_0x30fd7d[_0xa4d4('0x25')]){delete _0x30fd7d[_0xa4d4('0x25')];}_0x3b0627[_0xa4d4('0x17')](_0xaec732)[_0xa4d4('0x26')](_0x30fd7d);};}exports[_0xa4d4('0x27')]=function(_0xad0723,_0x199cce){var _0x65471a={},_0x1fb20b={},_0x2865f8={'count':0x0,'rows':[]};var _0x383789=_[_0xa4d4('0x28')](db['VoiceQueuesLog'][_0xa4d4('0x29')],function(_0x567b36){return{'name':_0x567b36['fieldName'],'type':_0x567b36[_0xa4d4('0x2a')]['key']};});_0x1fb20b[_0xa4d4('0x2b')]=_[_0xa4d4('0x28')](_0x383789,_0xa4d4('0x25'));_0x1fb20b['query']=_[_0xa4d4('0x2c')](_0xad0723[_0xa4d4('0x2d')]);_0x1fb20b[_0xa4d4('0x2e')]=_['intersection'](_0x1fb20b[_0xa4d4('0x2b')],_0x1fb20b[_0xa4d4('0x2d')]);_0x65471a[_0xa4d4('0x2f')]=_[_0xa4d4('0x30')](_0x1fb20b[_0xa4d4('0x2b')],qs[_0xa4d4('0x31')](_0xad0723[_0xa4d4('0x2d')][_0xa4d4('0x31')]));_0x65471a['attributes']=_0x65471a['attributes']['length']?_0x65471a[_0xa4d4('0x2f')]:_0x1fb20b['model'];if(!_0xad0723[_0xa4d4('0x2d')]['hasOwnProperty'](_0xa4d4('0x32'))){_0x65471a[_0xa4d4('0x1d')]=qs['limit'](_0xad0723['query'][_0xa4d4('0x1d')]);_0x65471a[_0xa4d4('0x1a')]=qs['offset'](_0xad0723['query']['offset']);}_0x65471a['order']=qs[_0xa4d4('0x33')](_0xad0723[_0xa4d4('0x2d')][_0xa4d4('0x33')]);_0x65471a[_0xa4d4('0x34')]=qs[_0xa4d4('0x2e')](_[_0xa4d4('0x35')](_0xad0723['query'],_0x1fb20b[_0xa4d4('0x2e')]),_0x383789);if(_0xad0723[_0xa4d4('0x2d')][_0xa4d4('0x36')]){_0x65471a['where']=_[_0xa4d4('0x37')](_0x65471a[_0xa4d4('0x34')],{'$or':_['map'](_0x383789,function(_0x49d567){if(_0x49d567[_0xa4d4('0x2a')]!==_0xa4d4('0x38')){var _0x1866d8={};_0x1866d8[_0x49d567['name']]={'$like':'%'+_0xad0723[_0xa4d4('0x2d')][_0xa4d4('0x36')]+'%'};return _0x1866d8;}})});}_0x65471a=_[_0xa4d4('0x37')]({},_0x65471a,_0xad0723[_0xa4d4('0x39')]);var _0x1bc7da={'where':_0x65471a[_0xa4d4('0x34')]};return db[_0xa4d4('0x3a')]['count'](_0x1bc7da)['then'](function(_0x346bab){_0x2865f8[_0xa4d4('0x1c')]=_0x346bab;if(_0xad0723[_0xa4d4('0x2d')][_0xa4d4('0x3b')]){_0x65471a[_0xa4d4('0x3c')]=[{'all':!![]}];}return db[_0xa4d4('0x3a')][_0xa4d4('0x3d')](_0x65471a);})[_0xa4d4('0x22')](function(_0x4aa16b){_0x2865f8[_0xa4d4('0x3e')]=_0x4aa16b;return _0x2865f8;})[_0xa4d4('0x22')](respondWithFilteredResult(_0x199cce,_0x65471a))[_0xa4d4('0x3f')](handleError(_0x199cce,null));};exports[_0xa4d4('0x40')]=function(_0x3fc4a1,_0x282f14){var _0x6839df={'raw':!![],'where':{'id':_0x3fc4a1[_0xa4d4('0x41')]['id']}},_0x399f32={};_0x399f32['model']=_['keys'](db[_0xa4d4('0x3a')][_0xa4d4('0x29')]);_0x399f32['query']=_['keys'](_0x3fc4a1['query']);_0x399f32['filters']=_[_0xa4d4('0x30')](_0x399f32[_0xa4d4('0x2b')],_0x399f32[_0xa4d4('0x2d')]);_0x6839df[_0xa4d4('0x2f')]=_[_0xa4d4('0x30')](_0x399f32[_0xa4d4('0x2b')],qs[_0xa4d4('0x31')](_0x3fc4a1[_0xa4d4('0x2d')][_0xa4d4('0x31')]));_0x6839df[_0xa4d4('0x2f')]=_0x6839df[_0xa4d4('0x2f')][_0xa4d4('0x42')]?_0x6839df[_0xa4d4('0x2f')]:_0x399f32[_0xa4d4('0x2b')];if(_0x3fc4a1[_0xa4d4('0x2d')][_0xa4d4('0x3b')]){_0x6839df[_0xa4d4('0x3c')]=[{'all':!![]}];}_0x6839df=_[_0xa4d4('0x37')]({},_0x6839df,_0x3fc4a1['options']);return db['VoiceQueuesLog']['find'](_0x6839df)['then'](handleEntityNotFound(_0x282f14,null))[_0xa4d4('0x22')](respondWithResult(_0x282f14,null))['catch'](handleError(_0x282f14,null));};exports[_0xa4d4('0x43')]=function(_0x2b25fb,_0x392344){return db[_0xa4d4('0x3a')][_0xa4d4('0x43')](_0x2b25fb['body'],{})['then'](respondWithResult(_0x392344,0xc9))[_0xa4d4('0x3f')](handleError(_0x392344,null));};exports[_0xa4d4('0x20')]=function(_0x484e35,_0x1073bd){if(_0x484e35[_0xa4d4('0x44')]['id']){delete _0x484e35[_0xa4d4('0x44')]['id'];}return db[_0xa4d4('0x3a')]['find']({'where':{'id':_0x484e35['params']['id']}})[_0xa4d4('0x22')](handleEntityNotFound(_0x1073bd,null))['then'](saveUpdates(_0x484e35['body'],null))['then'](respondWithResult(_0x1073bd,null))[_0xa4d4('0x3f')](handleError(_0x1073bd,null));};exports['destroy']=function(_0x572037,_0x15ce2c){return db[_0xa4d4('0x3a')]['find']({'where':{'id':_0x572037['params']['id']}})['then'](handleEntityNotFound(_0x15ce2c,null))[_0xa4d4('0x22')](removeEntity(_0x15ce2c,null))['catch'](handleError(_0x15ce2c,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index fab0200..51ac3cd 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 _0x6fd5=['api','moment','request-promise','rimraf','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log','event','dtm','util','../../config/logger'];(function(_0x36a3e0,_0x2fa57b){var _0x10d2ec=function(_0x16b4e2){while(--_0x16b4e2){_0x36a3e0['push'](_0x36a3e0['shift']());}};_0x10d2ec(++_0x2fa57b);}(_0x6fd5,0x150));var _0x56fd=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x6fd5[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require('lodash');var util=require(_0x56fd('0x0'));var logger=require(_0x56fd('0x1'))(_0x56fd('0x2'));var moment=require(_0x56fd('0x3'));var BPromise=require('bluebird');var rp=require(_0x56fd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x56fd('0x5'));var config=require(_0x56fd('0x6'));var attributes=require(_0x56fd('0x7'));module['exports']=function(_0xa1156d,_0x560985){return _0xa1156d[_0x56fd('0x8')](_0x56fd('0x9'),attributes,{'tableName':_0x56fd('0xa'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x56fd('0xb'),_0x56fd('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x3b8c=['lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','event_dtm','event','dtm'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x3b8c,0x1b3));var _0xc3b8=function(_0x7625f1,_0x375399){_0x7625f1=_0x7625f1-0x0;var _0x544935=_0x3b8c[_0x7625f1];return _0x544935;};'use strict';var _=require(_0xc3b8('0x0'));var util=require(_0xc3b8('0x1'));var logger=require(_0xc3b8('0x2'))(_0xc3b8('0x3'));var moment=require(_0xc3b8('0x4'));var BPromise=require('bluebird');var rp=require(_0xc3b8('0x5'));var fs=require('fs');var path=require(_0xc3b8('0x6'));var rimraf=require('rimraf');var config=require(_0xc3b8('0x7'));var attributes=require(_0xc3b8('0x8'));module[_0xc3b8('0x9')]=function(_0x5ece8f,_0x5848a9){return _0x5ece8f[_0xc3b8('0xa')](_0xc3b8('0xb'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xc3b8('0xc'),'fields':[_0xc3b8('0xd'),_0xc3b8('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 0d44736..6252ae1 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 _0xba47=['VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xba47,0x1ac));var _0x7ba4=function(_0x366171,_0x160e18){_0x366171=_0x366171-0x0;var _0x2fb0af=_0xba47[_0x366171];return _0x2fb0af;};'use strict';var _=require(_0x7ba4('0x0'));var util=require(_0x7ba4('0x1'));var moment=require(_0x7ba4('0x2'));var BPromise=require('bluebird');var rs=require(_0x7ba4('0x3'));var fs=require('fs');var Redis=require(_0x7ba4('0x4'));var db=require(_0x7ba4('0x5'))['db'];var utils=require(_0x7ba4('0x6'));var logger=require('../../config/logger')(_0x7ba4('0x7'));var config=require(_0x7ba4('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7ba4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11ea18,_0x932508,_0x227abe){return new BPromise(function(_0x7963fa,_0x380790){return client[_0x7ba4('0xa')](_0x11ea18,_0x227abe)[_0x7ba4('0xb')](function(_0x48456d){logger['info'](_0x7ba4('0xc'),_0x932508,'request\x20sent');logger[_0x7ba4('0xd')](_0x7ba4('0xe'),_0x932508,_0x7ba4('0xf'),JSON[_0x7ba4('0x10')](_0x48456d));if(_0x48456d['error']){if(_0x48456d[_0x7ba4('0x11')][_0x7ba4('0x12')]===0x1f4){logger['error'](_0x7ba4('0xc'),_0x932508,_0x48456d[_0x7ba4('0x11')][_0x7ba4('0x13')]);return _0x380790(_0x48456d['error'][_0x7ba4('0x13')]);}logger[_0x7ba4('0x11')](_0x7ba4('0xc'),_0x932508,_0x48456d[_0x7ba4('0x11')][_0x7ba4('0x13')]);return _0x7963fa(_0x48456d[_0x7ba4('0x11')][_0x7ba4('0x13')]);}else{logger[_0x7ba4('0x14')](_0x7ba4('0xc'),_0x932508,'request\x20sent');_0x7963fa(_0x48456d['result'][_0x7ba4('0x13')]);}})[_0x7ba4('0x15')](function(_0x53c7b2){logger[_0x7ba4('0x11')](_0x7ba4('0xc'),_0x932508,_0x53c7b2);_0x380790(_0x53c7b2);});});} \ No newline at end of file +var _0x19ea=['result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x4fbc9b,_0x5ab526){var _0x156147=function(_0x4b0c93){while(--_0x4b0c93){_0x4fbc9b['push'](_0x4fbc9b['shift']());}};_0x156147(++_0x5ab526);}(_0x19ea,0xfe));var _0xa19e=function(_0x19b84f,_0x48765e){_0x19b84f=_0x19b84f-0x0;var _0x18067b=_0x19ea[_0x19b84f];return _0x18067b;};'use strict';var _=require(_0xa19e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa19e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa19e('0x2'));var db=require(_0xa19e('0x3'))['db'];var utils=require(_0xa19e('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa19e('0x5'));var jayson=require(_0xa19e('0x6'));var client=jayson[_0xa19e('0x7')][_0xa19e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1087e7,_0x30fd4a,_0x336e23){return new BPromise(function(_0x1867cb,_0x44e468){return client[_0xa19e('0x9')](_0x1087e7,_0x336e23)[_0xa19e('0xa')](function(_0x59b907){logger[_0xa19e('0xb')](_0xa19e('0xc'),_0x30fd4a,_0xa19e('0xd'));logger[_0xa19e('0xe')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x30fd4a,_0xa19e('0xd'),JSON[_0xa19e('0xf')](_0x59b907));if(_0x59b907[_0xa19e('0x10')]){if(_0x59b907['error'][_0xa19e('0x11')]===0x1f4){logger[_0xa19e('0x10')](_0xa19e('0xc'),_0x30fd4a,_0x59b907[_0xa19e('0x10')][_0xa19e('0x12')]);return _0x44e468(_0x59b907['error'][_0xa19e('0x12')]);}logger[_0xa19e('0x10')](_0xa19e('0xc'),_0x30fd4a,_0x59b907[_0xa19e('0x10')][_0xa19e('0x12')]);return _0x1867cb(_0x59b907[_0xa19e('0x10')][_0xa19e('0x12')]);}else{logger[_0xa19e('0xb')](_0xa19e('0xc'),_0x30fd4a,_0xa19e('0xd'));_0x1867cb(_0x59b907[_0xa19e('0x13')]['message']);}})[_0xa19e('0x14')](function(_0x34066a){logger[_0xa19e('0x10')](_0xa19e('0xc'),_0x30fd4a,_0x34066a);_0x44e468(_0x34066a);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index fe12dbe..c948876 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 _0xae9a=['get','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','post','runTranscribe','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','/describe'];(function(_0x3ff685,_0x304b9e){var _0x2046c9=function(_0x7a10e9){while(--_0x7a10e9){_0x3ff685['push'](_0x3ff685['shift']());}};_0x2046c9(++_0x304b9e);}(_0xae9a,0x121));var _0xaae9=function(_0x4530d,_0x3ba96f){_0x4530d=_0x4530d-0x0;var _0xf442e5=_0xae9a[_0x4530d];return _0xf442e5;};'use strict';var multer=require(_0xaae9('0x0'));var util=require(_0xaae9('0x1'));var path=require('path');var timeout=require(_0xaae9('0x2'));var express=require(_0xaae9('0x3'));var router=express[_0xaae9('0x4')]();var fs_extra=require(_0xaae9('0x5'));var auth=require(_0xaae9('0x6'));var interaction=require(_0xaae9('0x7'));var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router['get']('/',auth[_0xaae9('0x8')](),controller['index']);router['get'](_0xaae9('0x9'),auth[_0xaae9('0x8')](),controller['describe']);router[_0xaae9('0xa')]('/:id',auth[_0xaae9('0x8')](),controller[_0xaae9('0xb')]);router[_0xaae9('0xa')](_0xaae9('0xc'),auth[_0xaae9('0x8')](),controller[_0xaae9('0xd')]);router[_0xaae9('0xa')](_0xaae9('0xe'),controller[_0xaae9('0xf')]);router[_0xaae9('0xa')](_0xaae9('0x10'),auth[_0xaae9('0x8')](),controller['downloadTranscribe']);router[_0xaae9('0x11')]('/',auth[_0xaae9('0x8')](),controller['create']);router[_0xaae9('0x11')](_0xaae9('0x10'),auth['isAuthenticated'](),controller[_0xaae9('0x12')]);router['put'](_0xaae9('0x13'),auth[_0xaae9('0x8')](),controller['update']);router[_0xaae9('0x14')](_0xaae9('0x13'),auth[_0xaae9('0x8')](),controller[_0xaae9('0x15')]);module[_0xaae9('0x16')]=router; \ No newline at end of file +var _0x9691=['downloadTranscribe','create','post','runTranscribe','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','index','get','/describe','describe','/:id','show','download','/:id/transcribe'];(function(_0xdd1f52,_0x227e9e){var _0x368782=function(_0x480309){while(--_0x480309){_0xdd1f52['push'](_0xdd1f52['shift']());}};_0x368782(++_0x227e9e);}(_0x9691,0xe8));var _0x1969=function(_0x813d72,_0x4c6170){_0x813d72=_0x813d72-0x0;var _0x40f273=_0x9691[_0x813d72];return _0x40f273;};'use strict';var multer=require(_0x1969('0x0'));var util=require(_0x1969('0x1'));var path=require(_0x1969('0x2'));var timeout=require(_0x1969('0x3'));var express=require(_0x1969('0x4'));var router=express[_0x1969('0x5')]();var fs_extra=require(_0x1969('0x6'));var auth=require(_0x1969('0x7'));var interaction=require(_0x1969('0x8'));var config=require(_0x1969('0x9'));var controller=require(_0x1969('0xa'));router['get']('/',auth[_0x1969('0xb')](),controller[_0x1969('0xc')]);router[_0x1969('0xd')](_0x1969('0xe'),auth['isAuthenticated'](),controller[_0x1969('0xf')]);router[_0x1969('0xd')](_0x1969('0x10'),auth['isAuthenticated'](),controller[_0x1969('0x11')]);router[_0x1969('0xd')]('/:id/download',auth[_0x1969('0xb')](),controller[_0x1969('0x12')]);router['get']('/:id/downloads',controller['downloads']);router['get'](_0x1969('0x13'),auth[_0x1969('0xb')](),controller[_0x1969('0x14')]);router['post']('/',auth[_0x1969('0xb')](),controller[_0x1969('0x15')]);router[_0x1969('0x16')](_0x1969('0x13'),auth['isAuthenticated'](),controller[_0x1969('0x17')]);router['put'](_0x1969('0x10'),auth['isAuthenticated'](),controller[_0x1969('0x18')]);router[_0x1969('0x19')]('/:id',auth[_0x1969('0xb')](),controller[_0x1969('0x1a')]);module[_0x1969('0x1b')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 0f0c8df..7c96979 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(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +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(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 08e24b6..fe2356d 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 _0x9251=['ejs','squel','crypto','desk.js','querystring','papaparse','aws-sdk','uuid/v4','../../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','undefined','count','offset','reject','save','update','then','end','error','name','send','index','rawAttributes','fieldName','key','differenceBy','map','format','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','VoiceRecording','includeAll','include','findAll','catch','params','model','find','create','body','describe','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','recording','Sequelize','VoiceRecording\x20not\x20found','filename','download','unlink','Not\x20found','downloads','sequelize','col','$and','push','secrets','extname','destroy','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','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','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','ValidationError','transcribe','transcribeRegion','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','runSentiment','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv'];(function(_0x58fde8,_0x35f915){var _0x3e4524=function(_0x47e7bc){while(--_0x47e7bc){_0x58fde8['push'](_0x58fde8['shift']());}};_0x3e4524(++_0x35f915);}(_0x9251,0x1ab));var _0x1925=function(_0x162780,_0x47f2e2){_0x162780=_0x162780-0x0;var _0x1ea2dc=_0x9251[_0x162780];return _0x1ea2dc;};'use strict';var emlformat=require(_0x1925('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1925('0x1'));var jsonpatch=require(_0x1925('0x2'));var rp=require(_0x1925('0x3'));var moment=require(_0x1925('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1925('0x5'));var path=require(_0x1925('0x6'));var sox=require('sox');var csv=require(_0x1925('0x7'));var ejs=require(_0x1925('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1925('0x9'));var crypto=require(_0x1925('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1925('0xb'));var toCsv=require('to-csv');var querystring=require(_0x1925('0xc'));var Papa=require(_0x1925('0xd'));var AWS=require(_0x1925('0xe'));var uuidv4=require(_0x1925('0xf'));var Redis=require('ioredis');var authService=require(_0x1925('0x10'));var qs=require(_0x1925('0x11'));var as=require(_0x1925('0x12'));var hardwareService=require(_0x1925('0x13'));var logger=require(_0x1925('0x14'))(_0x1925('0x15'));var utils=require(_0x1925('0x16'));var config=require(_0x1925('0x17'));var licenseUtil=require(_0x1925('0x18'));var db=require(_0x1925('0x19'))['db'];function respondWithStatusCode(_0x2c6281,_0x211695){_0x211695=_0x211695||0xcc;return function(_0x435b5a){if(_0x435b5a){return _0x2c6281[_0x1925('0x1a')](_0x211695);}return _0x2c6281[_0x1925('0x1b')](_0x211695)['end']();};}function respondWithResult(_0x44fc92,_0x14efba){_0x14efba=_0x14efba||0xc8;return function(_0xea2e98){if(_0xea2e98){return _0x44fc92[_0x1925('0x1b')](_0x14efba)[_0x1925('0x1c')](_0xea2e98);}};}function respondWithFilteredResult(_0x39576e,_0x3b9b60){return function(_0x43661b){if(_0x43661b){var _0x4b9790=typeof _0x3b9b60['offset']===_0x1925('0x1d')&&typeof _0x3b9b60['limit']===_0x1925('0x1d');var _0x2d5817=_0x43661b[_0x1925('0x1e')];var _0x4ffc7f=_0x4b9790?0x0:_0x3b9b60[_0x1925('0x1f')];var _0x2f4b5e=_0x4b9790?_0x43661b[_0x1925('0x1e')]:_0x3b9b60[_0x1925('0x1f')]+_0x3b9b60['limit'];var _0x4d9bb9;if(_0x2f4b5e>=_0x2d5817){_0x2f4b5e=_0x2d5817;_0x4d9bb9=0xc8;}else{_0x4d9bb9=0xce;}_0x39576e[_0x1925('0x1b')](_0x4d9bb9);return _0x39576e['set']('Content-Range',_0x4ffc7f+'-'+_0x2f4b5e+'/'+_0x2d5817)['json'](_0x43661b);}return null;};}function patchUpdates(_0x1a8835){return function(_0x5a045c){try{jsonpatch['apply'](_0x5a045c,_0x1a8835,!![]);}catch(_0x34dd42){return BPromise[_0x1925('0x20')](_0x34dd42);}return _0x5a045c[_0x1925('0x21')]();};}function saveUpdates(_0x33c31f,_0x5990b2){return function(_0x13ac30){if(_0x13ac30){return _0x13ac30[_0x1925('0x22')](_0x33c31f)[_0x1925('0x23')](function(_0x23bd93){return _0x23bd93;});}return null;};}function removeEntity(_0x32d2a5,_0x81ddd3){return function(_0x17f32e){if(_0x17f32e){return _0x17f32e['destroy']()[_0x1925('0x23')](function(){_0x32d2a5[_0x1925('0x1b')](0xcc)[_0x1925('0x24')]();});}};}function handleEntityNotFound(_0x29f130,_0x22a6f5){return function(_0x3ccca1){if(!_0x3ccca1){_0x29f130[_0x1925('0x1a')](0x194);}return _0x3ccca1;};}function handleError(_0x2aa535,_0x222880){_0x222880=_0x222880||0x1f4;return function(_0x2fd1c6){logger[_0x1925('0x25')](_0x2fd1c6['stack']);if(_0x2fd1c6[_0x1925('0x26')]){delete _0x2fd1c6[_0x1925('0x26')];}_0x2aa535['status'](_0x222880)[_0x1925('0x27')](_0x2fd1c6);};}exports[_0x1925('0x28')]=function(_0x254c9d,_0x79bd2a){var _0x526c46={},_0x275de7={},_0x16397e={'count':0x0,'rows':[]};var _0x537a3b=_['map'](db['VoiceRecording'][_0x1925('0x29')],function(_0x34643f){return{'name':_0x34643f[_0x1925('0x2a')],'type':_0x34643f['type'][_0x1925('0x2b')]};});_0x275de7['model']=_[_0x1925('0x2c')](_[_0x1925('0x2d')](_0x537a3b,'name'),[_0x1925('0x2e')]);_0x275de7[_0x1925('0x2f')]=_[_0x1925('0x30')](_0x254c9d['query']);_0x275de7[_0x1925('0x31')]=_[_0x1925('0x32')](_0x275de7['model'],_0x275de7['query']);_0x526c46[_0x1925('0x33')]=_[_0x1925('0x32')](_0x275de7['model'],qs['fields'](_0x254c9d[_0x1925('0x2f')][_0x1925('0x34')]));_0x526c46[_0x1925('0x33')]=_0x526c46[_0x1925('0x33')][_0x1925('0x35')]?_0x526c46['attributes']:_0x275de7['model'];if(!_0x254c9d[_0x1925('0x2f')]['hasOwnProperty'](_0x1925('0x36'))){_0x526c46[_0x1925('0x37')]=qs[_0x1925('0x37')](_0x254c9d[_0x1925('0x2f')][_0x1925('0x37')]);_0x526c46[_0x1925('0x1f')]=qs['offset'](_0x254c9d[_0x1925('0x2f')][_0x1925('0x1f')]);}_0x526c46[_0x1925('0x38')]=qs[_0x1925('0x39')](_0x254c9d['query'][_0x1925('0x39')]);_0x526c46['where']=qs[_0x1925('0x31')](_[_0x1925('0x3a')](_0x254c9d[_0x1925('0x2f')],_0x275de7[_0x1925('0x31')]),_0x537a3b);if(_0x254c9d[_0x1925('0x2f')][_0x1925('0x3b')]){_0x526c46['where']=_['merge'](_0x526c46[_0x1925('0x3c')],{'$or':_[_0x1925('0x2d')](_0x537a3b,function(_0x20830a){if(_0x20830a[_0x1925('0x3d')]!==_0x1925('0x3e')){var _0x347f3d={};_0x347f3d[_0x20830a[_0x1925('0x26')]]={'$like':'%'+_0x254c9d[_0x1925('0x2f')][_0x1925('0x3b')]+'%'};return _0x347f3d;}})});}_0x526c46=_[_0x1925('0x3f')]({},_0x526c46,_0x254c9d[_0x1925('0x40')]);var _0x19277f={'where':_0x526c46[_0x1925('0x3c')]};return db[_0x1925('0x41')][_0x1925('0x1e')](_0x19277f)[_0x1925('0x23')](function(_0x5353fb){_0x16397e[_0x1925('0x1e')]=_0x5353fb;if(_0x254c9d['query'][_0x1925('0x42')]){_0x526c46[_0x1925('0x43')]=[{'all':!![]}];}return db[_0x1925('0x41')][_0x1925('0x44')](_0x526c46);})[_0x1925('0x23')](function(_0x252ed0){_0x16397e['rows']=_0x252ed0;return _0x16397e;})[_0x1925('0x23')](respondWithFilteredResult(_0x79bd2a,_0x526c46))[_0x1925('0x45')](handleError(_0x79bd2a,null));};exports['show']=function(_0x2889dc,_0x44f3bc){var _0x1fc526={'raw':![],'where':{'id':_0x2889dc[_0x1925('0x46')]['id']}},_0x5cf189={};_0x5cf189[_0x1925('0x47')]=_[_0x1925('0x30')](db['VoiceRecording']['rawAttributes']);_0x5cf189[_0x1925('0x2f')]=_[_0x1925('0x30')](_0x2889dc[_0x1925('0x2f')]);_0x5cf189[_0x1925('0x31')]=_[_0x1925('0x32')](_0x5cf189[_0x1925('0x47')],_0x5cf189['query']);_0x1fc526[_0x1925('0x33')]=_[_0x1925('0x32')](_0x5cf189[_0x1925('0x47')],qs['fields'](_0x2889dc[_0x1925('0x2f')][_0x1925('0x34')]));_0x1fc526[_0x1925('0x33')]=_0x1fc526['attributes'][_0x1925('0x35')]?_0x1fc526['attributes']:_0x5cf189['model'];if(_0x2889dc['query'][_0x1925('0x42')]){_0x1fc526[_0x1925('0x43')]=[{'all':!![]}];}_0x1fc526=_[_0x1925('0x3f')]({},_0x1fc526,_0x2889dc['options']);return db[_0x1925('0x41')][_0x1925('0x48')](_0x1fc526)[_0x1925('0x23')](handleEntityNotFound(_0x44f3bc,null))[_0x1925('0x23')](respondWithResult(_0x44f3bc,null))['catch'](handleError(_0x44f3bc,null));};exports[_0x1925('0x49')]=function(_0x1e1f89,_0x5abf11){return db[_0x1925('0x41')][_0x1925('0x49')](_0x1e1f89[_0x1925('0x4a')],{})['then'](respondWithResult(_0x5abf11,0xc9))[_0x1925('0x45')](handleError(_0x5abf11,null));};exports[_0x1925('0x22')]=function(_0xe31d3e,_0x27bfe6){if(_0xe31d3e['body']['id']){delete _0xe31d3e[_0x1925('0x4a')]['id'];}return db[_0x1925('0x41')][_0x1925('0x48')]({'where':{'id':_0xe31d3e[_0x1925('0x46')]['id']}})[_0x1925('0x23')](handleEntityNotFound(_0x27bfe6,null))['then'](saveUpdates(_0xe31d3e[_0x1925('0x4a')],null))['then'](respondWithResult(_0x27bfe6,null))['catch'](handleError(_0x27bfe6,null));};exports[_0x1925('0x4b')]=function(_0x15e3e7,_0x34c15d){return db[_0x1925('0x41')][_0x1925('0x4b')]()[_0x1925('0x23')](respondWithResult(_0x34c15d,null))['catch'](handleError(_0x34c15d,null));};exports['download']=function(_0x416725,_0x440b33,_0x40ff69){var _0x5bfdc4=require(_0x1925('0x4c'));var _0x1e9e65=![];var _0x1990f2={};if(_0x416725[_0x1925('0x2f')][_0x1925('0x3d')]&&_0x416725[_0x1925('0x2f')][_0x1925('0x3d')]===_0x1925('0x4d')){_0x1990f2[_0x1925('0x4d')]=_0x416725[_0x1925('0x46')]['id'];}else{_0x1990f2['id']=_0x416725[_0x1925('0x46')]['id'];}return db[_0x1925('0x41')][_0x1925('0x48')]({'where':_0x1990f2,'attributes':['id',_0x1925('0x4e')],'raw':!![]})[_0x1925('0x23')](handleEntityNotFound(_0x440b33,null))['then'](function(_0x1386e8){if(_0x1386e8){var _0x795773=_0x1386e8['value'];var _0x3fdc14=util[_0x1925('0x2e')](_0x1925('0x4f'),_0x795773);if(fs[_0x1925('0x50')](_0x3fdc14)){_0x1e9e65=!![];return _0x5bfdc4[_0x1925('0x51')](_0x3fdc14,_0x795773,config['secrets'][_0x1925('0x52')])[_0x1925('0x23')](function(){return _0x1386e8;});}return _0x1386e8;}})[_0x1925('0x23')](function(_0x2c0d38){if(_0x2c0d38){var _0x180ac4=_0x2c0d38['value'];if(!fs[_0x1925('0x50')](_0x180ac4)){throw new db[(_0x1925('0x53'))]['ValidationError'](_0x1925('0x54'));}if(_0x2c0d38[_0x1925('0x55')]){return _0x440b33[_0x1925('0x56')](_0x180ac4,_0x2c0d38[_0x1925('0x55')]+path['extname'](_0x180ac4),function(){if(_0x1e9e65){fs['unlink'](_0x180ac4);}});}else{return _0x440b33[_0x1925('0x56')](_0x180ac4,function(_0x2a046e){if(_0x1e9e65){fs[_0x1925('0x57')](_0x180ac4);}});}}})[_0x1925('0x45')](function(_0x5051ec){if(_0x5051ec['message']===_0x1925('0x54')){_0x440b33[_0x1925('0x1b')](0x194)[_0x1925('0x27')](_0x1925('0x58'));}else{return handleError(_0x440b33,null);}});};exports[_0x1925('0x59')]=function(_0x532ef5,_0x3d737d,_0x19f404){var _0x559407=require(_0x1925('0x4c'));var _0x35801c=![];var _0x52ae97={'$and':[db[_0x1925('0x5a')][_0x1925('0x3c')](db['sequelize']['fn']('MD5',db[_0x1925('0x5a')][_0x1925('0x5b')](_0x1925('0x4d'))),_0x532ef5[_0x1925('0x2f')]['token'])]};if(_0x532ef5['query'][_0x1925('0x3d')]&&_0x532ef5[_0x1925('0x2f')]['type']==='uniqueid'){_0x52ae97[_0x1925('0x5c')][_0x1925('0x5d')]({'uniqueid':_0x532ef5[_0x1925('0x46')]['id']});}else{_0x52ae97[_0x1925('0x5c')]['push']({'id':_0x532ef5[_0x1925('0x46')]['id']});}return db[_0x1925('0x41')][_0x1925('0x48')]({'where':_0x52ae97,'attributes':['id','value'],'raw':!![]})[_0x1925('0x23')](handleEntityNotFound(_0x3d737d,null))[_0x1925('0x23')](function(_0x3b1ded){if(_0x3b1ded){var _0x541b41=util['format']('%s.cypher',_0x3b1ded[_0x1925('0x4e')]);if(fs['existsSync'](_0x541b41)){_0x35801c=!![];return _0x559407[_0x1925('0x51')](_0x541b41,_0x3b1ded[_0x1925('0x4e')],config[_0x1925('0x5e')][_0x1925('0x52')])[_0x1925('0x23')](function(){return _0x3b1ded;});}return _0x3b1ded;}})[_0x1925('0x23')](function(_0x242af4){if(_0x242af4){if(!fs[_0x1925('0x50')](_0x242af4[_0x1925('0x4e')])){throw new db[(_0x1925('0x53'))]['ValidationError'](_0x1925('0x54'));}if(_0x242af4[_0x1925('0x55')]){return _0x3d737d['download'](_0x242af4['value'],_0x242af4[_0x1925('0x55')]+path[_0x1925('0x5f')](_0x242af4[_0x1925('0x4e')]),function(){if(_0x35801c){fs[_0x1925('0x57')](_0x242af4[_0x1925('0x4e')]);}});}else{return _0x3d737d[_0x1925('0x56')](_0x242af4[_0x1925('0x4e')],function(_0x20fe16){if(_0x35801c){fs[_0x1925('0x57')](_0x242af4[_0x1925('0x4e')]);}});}}})[_0x1925('0x45')](handleError(_0x3d737d,null));};exports[_0x1925('0x60')]=function(_0x577e0d,_0x248a64){return db['VoiceRecording'][_0x1925('0x48')]({'where':{'id':_0x577e0d['params']['id']}})['then'](function(_0x2116bf){if(_[_0x1925('0x61')](_0x2116bf)){throw new ReferenceError(_0x1925('0x62'));}return _0x2116bf;})['then'](function(_0x191ab1){var _0x6b7c02=_0x191ab1['value'];logger['info'](_0x1925('0x63'),_0x6b7c02);if(!_['isNil'](_0x191ab1[_0x1925('0x4e')])&&fs[_0x1925('0x50')](_0x6b7c02)){logger[_0x1925('0x64')](_0x1925('0x65')+_0x6b7c02+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x6b7c02);}_0x6b7c02=_0x6b7c02+'.cypher';if(!_[_0x1925('0x61')](_0x191ab1[_0x1925('0x4e')])&&fs[_0x1925('0x50')](_0x6b7c02)){logger[_0x1925('0x64')](_0x1925('0x65')+_0x6b7c02+_0x1925('0x66'));fs[_0x1925('0x67')](_0x6b7c02);}return _0x191ab1;})[_0x1925('0x23')](function(_0x3839a1){if(!_0x3839a1)throw new InternalError();return _0x3839a1[_0x1925('0x60')]();})['then'](function(){_0x248a64[_0x1925('0x1b')](0xcc)[_0x1925('0x24')]();})[_0x1925('0x45')](handleError(_0x248a64,null));};function getBucketslist(_0x342520,_0x47b637,_0x186e75){return new Promise(function(_0x45afc9,_0x55ab42){var _0x88c31f=new AWS['S3']({'accessKeyId':_0x47b637,'secretAccessKey':_0x342520,'region':_0x186e75});_0x88c31f[_0x1925('0x68')]({},function(_0x44ad2a,_0x459263){if(_0x44ad2a){return _0x55ab42(_0x44ad2a);}else{return _0x45afc9(_0x459263);}});});}function createBucket(_0x2e6b5d,_0x1c9a56,_0x4f3f45,_0x5567e2){return new Promise(function(_0x4e8001,_0x4fa1e6){var _0x59cdcd=new AWS['S3']({'accessKeyId':_0x1c9a56,'secretAccessKey':_0x2e6b5d,'region':_0x4f3f45});_0x59cdcd[_0x1925('0x69')]({'Bucket':_0x5567e2},function(_0x377b1e,_0x45efca){if(_0x377b1e){return _0x4fa1e6(_0x377b1e);}else{return _0x4e8001(_0x45efca);}});});}function uploadFile(_0x27501c,_0x2c47ef,_0x44ca3f,_0x18aea2,_0x45cf00,_0x12b30a){return new Promise(function(_0xa48e48,_0x46b059){var _0x3a2b6d=new AWS['S3']({'accessKeyId':_0x2c47ef,'secretAccessKey':_0x27501c,'region':_0x44ca3f});_0x3a2b6d[_0x1925('0x6a')]({'Bucket':_0x18aea2,'Key':_0x45cf00,'Body':_0x12b30a},function(_0x17f9fe,_0x44add9){if(_0x17f9fe){return _0x46b059(_0x17f9fe);}else{return _0xa48e48(_0x44add9);}});});}function startTranscribe(_0xaaab1e,_0x4215e7,_0x755f6a,_0x2c44b8,_0x3dac71,_0x28d607){return new Promise(function(_0x76cc52,_0x4b686f){var _0x34414e=new AWS[(_0x1925('0x6b'))]({'accessKeyId':_0x4215e7,'secretAccessKey':_0xaaab1e,'region':_0x755f6a});_0x34414e[_0x1925('0x6c')]({'TranscriptionJobName':_0x2c44b8,'LanguageCode':_0x3dac71,'Media':{'MediaFileUri':_0x28d607}},function(_0x174495,_0x2f8d4f){if(_0x174495){return _0x4b686f(_0x174495);}else{return _0x76cc52(_0x2f8d4f);}});});}function transcribe(_0x1aa70f,_0x53adcc,_0x4d078a,_0x1f6a5b,_0x4022e,_0x432682,_0x224680){return new Promise(function(_0x4a0849,_0x229703){var _0x4b44e4={};logger[_0x1925('0x64')](util[_0x1925('0x2e')](_0x1925('0x6d'),_0x1aa70f,_0x4022e));return uploadFile(_0x53adcc,_0x4d078a,_0x1f6a5b,_0x4022e,path['basename'](_0x432682),fs['readFileSync'](_0x432682))[_0x1925('0x23')](function(_0x41aa53){logger[_0x1925('0x64')](util[_0x1925('0x2e')](_0x1925('0x6e'),_0x1aa70f,_0x4022e,_0x41aa53[_0x1925('0x6f')]));_0x4b44e4[_0x1925('0x70')]=_0x41aa53['Bucket'];_0x4b44e4[_0x1925('0x71')]=_0x41aa53[_0x1925('0x6f')];logger[_0x1925('0x64')](util[_0x1925('0x2e')](_0x1925('0x72'),_0x1aa70f));return startTranscribe(_0x53adcc,_0x4d078a,_0x1f6a5b,uuidv4(),_0x224680,_0x41aa53[_0x1925('0x6f')]);})['then'](function(_0x3d6033){logger[_0x1925('0x64')](util[_0x1925('0x2e')](_0x1925('0x73'),_0x1aa70f,_0x3d6033[_0x1925('0x74')][_0x1925('0x75')]));_0x4b44e4[_0x1925('0x76')]=_0x3d6033[_0x1925('0x74')][_0x1925('0x75')];_0x4b44e4[_0x1925('0x77')]=_0x3d6033[_0x1925('0x74')][_0x1925('0x78')];return _0x4a0849(_0x4b44e4);})[_0x1925('0x45')](function(_0x45e5c7){return _0x229703(_0x45e5c7);});});}exports[_0x1925('0x79')]=function(_0xfd7dba,_0x588c0b,_0x4cd66a){var _0x348bc5;var _0x19b3f9;var _0x566854;var _0x312663=require(_0x1925('0x4c'));return db[_0x1925('0x41')][_0x1925('0x7a')]({'where':{'id':_0xfd7dba[_0x1925('0x46')]['id']}})[_0x1925('0x23')](function(_0x4b0adb){if(_0x4b0adb){var _0x5bdcc4=util['format'](_0x1925('0x4f'),_0x4b0adb[_0x1925('0x4e')]);if(fs[_0x1925('0x50')](_0x5bdcc4)){cypher=!![];return _0x312663[_0x1925('0x51')](_0x5bdcc4,_0x4b0adb['value'],config[_0x1925('0x5e')][_0x1925('0x52')])[_0x1925('0x23')](function(){return _0x4b0adb;});}return _0x4b0adb;}})[_0x1925('0x23')](function(_0x9297a6){if(!_0x9297a6){throw new db[(_0x1925('0x53'))][(_0x1925('0x7b'))]('Voice\x20Recording\x20not\x20found');}_0x19b3f9=_0x9297a6;return db['Setting'][_0x1925('0x7a')]({'where':{'id':0x1}});})[_0x1925('0x23')](handleEntityNotFound(_0x588c0b,null))[_0x1925('0x23')](function(_0x359e29){if(_0x359e29){_0x348bc5=_0x359e29;if(!_0x348bc5[_0x1925('0x7c')]||!_0x348bc5['transcribeAccountId']||!_0x348bc5[_0x1925('0x7d')]||!_0x348bc5['language']||!_0x348bc5[_0x1925('0x70')]){throw new db['Sequelize']['ValidationError']('Transcribe\x20not\x20configured');}if(_0xfd7dba['body']['runSentiment']&&(!_0x348bc5[_0x1925('0x7e')]||!_0x348bc5['sentimentAccountId']||!_0x348bc5[_0x1925('0x7f')]||!_0x348bc5['language']||!_0x348bc5[_0x1925('0x70')])){throw new db[(_0x1925('0x53'))]['ValidationError'](_0x1925('0x80'));}return db[_0x1925('0x81')]['findOne']({'where':{'id':_0x348bc5['transcribeAccountId']}});}})['then'](function(_0x7a9c80){if(!_0x7a9c80){throw new db[(_0x1925('0x53'))][(_0x1925('0x7b'))](_0x1925('0x82'));}if(!_0x7a9c80[_0x1925('0x83')]||!_0x7a9c80[_0x1925('0x84')]){throw new db['Sequelize'][(_0x1925('0x7b'))](_0x1925('0x85'));}_0x566854=_0x7a9c80;return getBucketslist(_0x566854[_0x1925('0x83')],_0x566854[_0x1925('0x84')],_0x348bc5[_0x1925('0x7d')]);})[_0x1925('0x23')](function(_0xfd930e){if(_0xfd930e&&_0xfd930e[_0x1925('0x86')]){var _0x1a09de=_['find'](_0xfd930e[_0x1925('0x86')],function(_0x3145dc){return _0x3145dc['Name']===_0x348bc5[_0x1925('0x70')];});if(!_0x1a09de){logger[_0x1925('0x64')](util[_0x1925('0x2e')](_0x1925('0x87'),_0xfd7dba[_0x1925('0x46')]['id'],_0x348bc5['bucket']));return createBucket(_0x566854[_0x1925('0x83')],_0x566854[_0x1925('0x84')],_0x348bc5[_0x1925('0x7d')],_0x348bc5[_0x1925('0x70')]);}logger[_0x1925('0x64')](util[_0x1925('0x2e')](_0x1925('0x88'),_0xfd7dba[_0x1925('0x46')]['id'],_0x348bc5['bucket']));return;}})[_0x1925('0x23')](function(_0x91c3be){if(_0x19b3f9[_0x1925('0x77')]==='NEW'){return transcribe(_0xfd7dba[_0x1925('0x46')]['id'],_0x566854[_0x1925('0x83')],_0x566854[_0x1925('0x84')],_0x348bc5[_0x1925('0x7d')],_0x348bc5[_0x1925('0x70')],_0x19b3f9[_0x1925('0x4e')],_0x348bc5['language']);}else{logger['info'](util[_0x1925('0x2e')](_0x1925('0x89'),_0xfd7dba[_0x1925('0x46')]['id']));return{'transcribeStatus':_0x1925('0x8a')};}})[_0x1925('0x23')](function(_0x5a68be){if(_0x5a68be){_0x5a68be['tempSentiment']=_0xfd7dba[_0x1925('0x4a')][_0x1925('0x8b')];return _0x19b3f9['updateAttributes'](_0x5a68be);}})[_0x1925('0x23')](respondWithResult(_0x588c0b,null))[_0x1925('0x45')](handleError(_0x588c0b,null));};function writeFile(_0x163974,_0x12833b){return new Promise(function(_0x2f0e17,_0x2f1130){fs[_0x1925('0x8c')](_0x12833b,_0x163974,function(_0x234026,_0xbe7145){if(_0x234026){return _0x2f1130(_0x234026);}else{return _0x2f0e17(_0xbe7145);}});});}exports[_0x1925('0x8d')]=function(_0x4c516b,_0x196d3d,_0x1e28dd){return db[_0x1925('0x41')][_0x1925('0x7a')]({'where':{'id':_0x4c516b[_0x1925('0x46')]['id']}})['then'](handleEntityNotFound(_0x196d3d))['then'](function(_0x25fdad){if(_0x25fdad&&_0x25fdad[_0x1925('0x8e')]){var _0x3bc1b9=_0x25fdad[_0x1925('0x8e')];var _0xf432b7=config['root']+_0x1925('0x8f')+_0x25fdad['id']+'.txt';if(fs[_0x1925('0x50')](_0xf432b7)){return _0xf432b7;}return writeFile(_0x3bc1b9,_0xf432b7)['then'](function(){return _0xf432b7;});}else{throw new db[(_0x1925('0x53'))][(_0x1925('0x7b'))](_0x1925('0x90'));}})[_0x1925('0x23')](function(_0x18bff7){return _0x196d3d[_0x1925('0x56')](_0x18bff7);})['catch'](handleError(_0x196d3d));}; \ No newline at end of file +var _0xeb6d=['findOne','transcribe','transcribeAccountId','language','bucket','runSentiment','sentiment','sentimentAccountId','sentimentRegion','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','IN_PROGRESS','downloadTranscribe','fileText','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','aws-sdk','uuid/v4','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','fields','attributes','order','where','filter','merge','VIRTUAL','options','VoiceRecording','includeAll','include','show','params','rawAttributes','length','find','create','catch','body','describe','download','uniqueid','value','%s.cypher','existsSync','secrets','recording','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','downloads','sequelize','MD5','col','token','$and','push','decryptFile','Sequelize','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','upload','TranscribeService','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','../../components/encryptor','Voice\x20Recording\x20not\x20found','Setting'];(function(_0x3a1b90,_0x3c0158){var _0xf6de77=function(_0x396533){while(--_0x396533){_0x3a1b90['push'](_0x3a1b90['shift']());}};_0xf6de77(++_0x3c0158);}(_0xeb6d,0x140));var _0xdeb6=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xeb6d[_0x138adb];return _0x1b27f2;};'use strict';var emlformat=require(_0xdeb6('0x0'));var rimraf=require(_0xdeb6('0x1'));var zipdir=require(_0xdeb6('0x2'));var jsonpatch=require(_0xdeb6('0x3'));var rp=require('request-promise');var moment=require(_0xdeb6('0x4'));var BPromise=require(_0xdeb6('0x5'));var Mustache=require(_0xdeb6('0x6'));var util=require(_0xdeb6('0x7'));var path=require(_0xdeb6('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdeb6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdeb6('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdeb6('0xb'));var deskjs=require(_0xdeb6('0xc'));var toCsv=require(_0xdeb6('0xd'));var querystring=require(_0xdeb6('0xe'));var Papa=require(_0xdeb6('0xf'));var AWS=require(_0xdeb6('0x10'));var uuidv4=require(_0xdeb6('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdeb6('0x12'));var as=require(_0xdeb6('0x13'));var hardwareService=require(_0xdeb6('0x14'));var logger=require(_0xdeb6('0x15'))('api');var utils=require(_0xdeb6('0x16'));var config=require(_0xdeb6('0x17'));var licenseUtil=require(_0xdeb6('0x18'));var db=require(_0xdeb6('0x19'))['db'];function respondWithStatusCode(_0x1c9066,_0x569929){_0x569929=_0x569929||0xcc;return function(_0x34c469){if(_0x34c469){return _0x1c9066[_0xdeb6('0x1a')](_0x569929);}return _0x1c9066[_0xdeb6('0x1b')](_0x569929)[_0xdeb6('0x1c')]();};}function respondWithResult(_0x34b501,_0x33c85d){_0x33c85d=_0x33c85d||0xc8;return function(_0x116a4a){if(_0x116a4a){return _0x34b501[_0xdeb6('0x1b')](_0x33c85d)[_0xdeb6('0x1d')](_0x116a4a);}};}function respondWithFilteredResult(_0x1c6b34,_0x48118a){return function(_0x3ca0f7){if(_0x3ca0f7){var _0x1dde7b=typeof _0x48118a[_0xdeb6('0x1e')]===_0xdeb6('0x1f')&&typeof _0x48118a[_0xdeb6('0x20')]===_0xdeb6('0x1f');var _0x1c8a16=_0x3ca0f7[_0xdeb6('0x21')];var _0x29ce64=_0x1dde7b?0x0:_0x48118a[_0xdeb6('0x1e')];var _0x3366d4=_0x1dde7b?_0x3ca0f7['count']:_0x48118a[_0xdeb6('0x1e')]+_0x48118a['limit'];var _0x5c1d58;if(_0x3366d4>=_0x1c8a16){_0x3366d4=_0x1c8a16;_0x5c1d58=0xc8;}else{_0x5c1d58=0xce;}_0x1c6b34[_0xdeb6('0x1b')](_0x5c1d58);return _0x1c6b34[_0xdeb6('0x22')](_0xdeb6('0x23'),_0x29ce64+'-'+_0x3366d4+'/'+_0x1c8a16)[_0xdeb6('0x1d')](_0x3ca0f7);}return null;};}function patchUpdates(_0x2812da){return function(_0x2b72b5){try{jsonpatch[_0xdeb6('0x24')](_0x2b72b5,_0x2812da,!![]);}catch(_0x383988){return BPromise['reject'](_0x383988);}return _0x2b72b5[_0xdeb6('0x25')]();};}function saveUpdates(_0x5daa60,_0x26e9e7){return function(_0x33c201){if(_0x33c201){return _0x33c201[_0xdeb6('0x26')](_0x5daa60)[_0xdeb6('0x27')](function(_0x2f607a){return _0x2f607a;});}return null;};}function removeEntity(_0x267a57,_0x4c5588){return function(_0x2fc426){if(_0x2fc426){return _0x2fc426[_0xdeb6('0x28')]()[_0xdeb6('0x27')](function(){_0x267a57[_0xdeb6('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f5ac1,_0x34b207){return function(_0x1db3b7){if(!_0x1db3b7){_0x3f5ac1[_0xdeb6('0x1a')](0x194);}return _0x1db3b7;};}function handleError(_0x55c8e9,_0x5b24b4){_0x5b24b4=_0x5b24b4||0x1f4;return function(_0x587409){logger[_0xdeb6('0x29')](_0x587409[_0xdeb6('0x2a')]);if(_0x587409[_0xdeb6('0x2b')]){delete _0x587409[_0xdeb6('0x2b')];}_0x55c8e9['status'](_0x5b24b4)[_0xdeb6('0x2c')](_0x587409);};}exports[_0xdeb6('0x2d')]=function(_0x3e1727,_0x7e177b){var _0x406d8b={},_0x31661d={},_0xde22e9={'count':0x0,'rows':[]};var _0x35b46c=_[_0xdeb6('0x2e')](db['VoiceRecording']['rawAttributes'],function(_0x2d5005){return{'name':_0x2d5005[_0xdeb6('0x2f')],'type':_0x2d5005[_0xdeb6('0x30')][_0xdeb6('0x31')]};});_0x31661d[_0xdeb6('0x32')]=_[_0xdeb6('0x33')](_['map'](_0x35b46c,'name'),[_0xdeb6('0x34')]);_0x31661d[_0xdeb6('0x35')]=_[_0xdeb6('0x36')](_0x3e1727['query']);_0x31661d[_0xdeb6('0x37')]=_[_0xdeb6('0x38')](_0x31661d[_0xdeb6('0x32')],_0x31661d[_0xdeb6('0x35')]);_0x406d8b['attributes']=_[_0xdeb6('0x38')](_0x31661d[_0xdeb6('0x32')],qs[_0xdeb6('0x39')](_0x3e1727['query'][_0xdeb6('0x39')]));_0x406d8b['attributes']=_0x406d8b['attributes']['length']?_0x406d8b[_0xdeb6('0x3a')]:_0x31661d[_0xdeb6('0x32')];if(!_0x3e1727['query']['hasOwnProperty']('nolimit')){_0x406d8b['limit']=qs[_0xdeb6('0x20')](_0x3e1727[_0xdeb6('0x35')]['limit']);_0x406d8b['offset']=qs['offset'](_0x3e1727[_0xdeb6('0x35')][_0xdeb6('0x1e')]);}_0x406d8b[_0xdeb6('0x3b')]=qs['sort'](_0x3e1727[_0xdeb6('0x35')]['sort']);_0x406d8b[_0xdeb6('0x3c')]=qs[_0xdeb6('0x37')](_['pick'](_0x3e1727[_0xdeb6('0x35')],_0x31661d[_0xdeb6('0x37')]),_0x35b46c);if(_0x3e1727['query'][_0xdeb6('0x3d')]){_0x406d8b[_0xdeb6('0x3c')]=_[_0xdeb6('0x3e')](_0x406d8b[_0xdeb6('0x3c')],{'$or':_['map'](_0x35b46c,function(_0x531a2a){if(_0x531a2a[_0xdeb6('0x30')]!==_0xdeb6('0x3f')){var _0xc89131={};_0xc89131[_0x531a2a[_0xdeb6('0x2b')]]={'$like':'%'+_0x3e1727['query']['filter']+'%'};return _0xc89131;}})});}_0x406d8b=_['merge']({},_0x406d8b,_0x3e1727[_0xdeb6('0x40')]);var _0x2eb24f={'where':_0x406d8b['where']};return db[_0xdeb6('0x41')]['count'](_0x2eb24f)[_0xdeb6('0x27')](function(_0x7e2449){_0xde22e9[_0xdeb6('0x21')]=_0x7e2449;if(_0x3e1727['query'][_0xdeb6('0x42')]){_0x406d8b[_0xdeb6('0x43')]=[{'all':!![]}];}return db[_0xdeb6('0x41')]['findAll'](_0x406d8b);})['then'](function(_0xf5ebae){_0xde22e9['rows']=_0xf5ebae;return _0xde22e9;})['then'](respondWithFilteredResult(_0x7e177b,_0x406d8b))['catch'](handleError(_0x7e177b,null));};exports[_0xdeb6('0x44')]=function(_0x5d9bc6,_0x7e3ae3){var _0x21e7a9={'raw':![],'where':{'id':_0x5d9bc6[_0xdeb6('0x45')]['id']}},_0x32b8ec={};_0x32b8ec['model']=_['keys'](db[_0xdeb6('0x41')][_0xdeb6('0x46')]);_0x32b8ec['query']=_['keys'](_0x5d9bc6[_0xdeb6('0x35')]);_0x32b8ec[_0xdeb6('0x37')]=_[_0xdeb6('0x38')](_0x32b8ec[_0xdeb6('0x32')],_0x32b8ec[_0xdeb6('0x35')]);_0x21e7a9[_0xdeb6('0x3a')]=_[_0xdeb6('0x38')](_0x32b8ec[_0xdeb6('0x32')],qs[_0xdeb6('0x39')](_0x5d9bc6[_0xdeb6('0x35')][_0xdeb6('0x39')]));_0x21e7a9['attributes']=_0x21e7a9[_0xdeb6('0x3a')][_0xdeb6('0x47')]?_0x21e7a9['attributes']:_0x32b8ec[_0xdeb6('0x32')];if(_0x5d9bc6[_0xdeb6('0x35')]['includeAll']){_0x21e7a9[_0xdeb6('0x43')]=[{'all':!![]}];}_0x21e7a9=_[_0xdeb6('0x3e')]({},_0x21e7a9,_0x5d9bc6[_0xdeb6('0x40')]);return db['VoiceRecording'][_0xdeb6('0x48')](_0x21e7a9)['then'](handleEntityNotFound(_0x7e3ae3,null))[_0xdeb6('0x27')](respondWithResult(_0x7e3ae3,null))['catch'](handleError(_0x7e3ae3,null));};exports[_0xdeb6('0x49')]=function(_0x2a9bc6,_0x185cdc){return db[_0xdeb6('0x41')][_0xdeb6('0x49')](_0x2a9bc6['body'],{})['then'](respondWithResult(_0x185cdc,0xc9))[_0xdeb6('0x4a')](handleError(_0x185cdc,null));};exports[_0xdeb6('0x26')]=function(_0x5f2f92,_0x20a804){if(_0x5f2f92[_0xdeb6('0x4b')]['id']){delete _0x5f2f92[_0xdeb6('0x4b')]['id'];}return db[_0xdeb6('0x41')][_0xdeb6('0x48')]({'where':{'id':_0x5f2f92[_0xdeb6('0x45')]['id']}})[_0xdeb6('0x27')](handleEntityNotFound(_0x20a804,null))['then'](saveUpdates(_0x5f2f92[_0xdeb6('0x4b')],null))[_0xdeb6('0x27')](respondWithResult(_0x20a804,null))[_0xdeb6('0x4a')](handleError(_0x20a804,null));};exports[_0xdeb6('0x4c')]=function(_0x5c7141,_0x17e9cf){return db['VoiceRecording']['describe']()[_0xdeb6('0x27')](respondWithResult(_0x17e9cf,null))[_0xdeb6('0x4a')](handleError(_0x17e9cf,null));};exports[_0xdeb6('0x4d')]=function(_0x53ddb3,_0x329bf0,_0x31aac1){var _0x148964=require('../../components/encryptor');var _0x147d06=![];var _0x52a590={};if(_0x53ddb3['query'][_0xdeb6('0x30')]&&_0x53ddb3['query'][_0xdeb6('0x30')]===_0xdeb6('0x4e')){_0x52a590[_0xdeb6('0x4e')]=_0x53ddb3['params']['id'];}else{_0x52a590['id']=_0x53ddb3['params']['id'];}return db[_0xdeb6('0x41')][_0xdeb6('0x48')]({'where':_0x52a590,'attributes':['id',_0xdeb6('0x4f')],'raw':!![]})[_0xdeb6('0x27')](handleEntityNotFound(_0x329bf0,null))[_0xdeb6('0x27')](function(_0x440f4e){if(_0x440f4e){var _0x43c121=_0x440f4e['value'];var _0x46f07f=util['format'](_0xdeb6('0x50'),_0x43c121);if(fs[_0xdeb6('0x51')](_0x46f07f)){_0x147d06=!![];return _0x148964['decryptFile'](_0x46f07f,_0x43c121,config[_0xdeb6('0x52')][_0xdeb6('0x53')])['then'](function(){return _0x440f4e;});}return _0x440f4e;}})[_0xdeb6('0x27')](function(_0x2abcaf){if(_0x2abcaf){var _0x3556f7=_0x2abcaf[_0xdeb6('0x4f')];if(!fs[_0xdeb6('0x51')](_0x3556f7)){throw new db['Sequelize'][(_0xdeb6('0x54'))](_0xdeb6('0x55'));}if(_0x2abcaf[_0xdeb6('0x56')]){return _0x329bf0[_0xdeb6('0x4d')](_0x3556f7,_0x2abcaf['filename']+path[_0xdeb6('0x57')](_0x3556f7),function(){if(_0x147d06){fs[_0xdeb6('0x58')](_0x3556f7);}});}else{return _0x329bf0[_0xdeb6('0x4d')](_0x3556f7,function(_0x2bae7e){if(_0x147d06){fs['unlink'](_0x3556f7);}});}}})[_0xdeb6('0x4a')](function(_0x23662d){if(_0x23662d[_0xdeb6('0x59')]===_0xdeb6('0x55')){_0x329bf0[_0xdeb6('0x1b')](0x194)[_0xdeb6('0x2c')]('Not\x20found');}else{return handleError(_0x329bf0,null);}});};exports[_0xdeb6('0x5a')]=function(_0x187a55,_0x537dee,_0x13c49a){var _0x34489a=require('../../components/encryptor');var _0x480ee0=![];var _0x1f9c2b={'$and':[db[_0xdeb6('0x5b')][_0xdeb6('0x3c')](db['sequelize']['fn'](_0xdeb6('0x5c'),db[_0xdeb6('0x5b')][_0xdeb6('0x5d')]('uniqueid')),_0x187a55[_0xdeb6('0x35')][_0xdeb6('0x5e')])]};if(_0x187a55['query']['type']&&_0x187a55['query'][_0xdeb6('0x30')]==='uniqueid'){_0x1f9c2b[_0xdeb6('0x5f')][_0xdeb6('0x60')]({'uniqueid':_0x187a55['params']['id']});}else{_0x1f9c2b['$and'][_0xdeb6('0x60')]({'id':_0x187a55['params']['id']});}return db['VoiceRecording']['find']({'where':_0x1f9c2b,'attributes':['id','value'],'raw':!![]})[_0xdeb6('0x27')](handleEntityNotFound(_0x537dee,null))[_0xdeb6('0x27')](function(_0x2178cf){if(_0x2178cf){var _0x152c5e=util[_0xdeb6('0x34')](_0xdeb6('0x50'),_0x2178cf[_0xdeb6('0x4f')]);if(fs[_0xdeb6('0x51')](_0x152c5e)){_0x480ee0=!![];return _0x34489a[_0xdeb6('0x61')](_0x152c5e,_0x2178cf[_0xdeb6('0x4f')],config['secrets'][_0xdeb6('0x53')])[_0xdeb6('0x27')](function(){return _0x2178cf;});}return _0x2178cf;}})[_0xdeb6('0x27')](function(_0x475b33){if(_0x475b33){if(!fs[_0xdeb6('0x51')](_0x475b33[_0xdeb6('0x4f')])){throw new db[(_0xdeb6('0x62'))][(_0xdeb6('0x54'))](_0xdeb6('0x55'));}if(_0x475b33['filename']){return _0x537dee[_0xdeb6('0x4d')](_0x475b33[_0xdeb6('0x4f')],_0x475b33['filename']+path[_0xdeb6('0x57')](_0x475b33[_0xdeb6('0x4f')]),function(){if(_0x480ee0){fs[_0xdeb6('0x58')](_0x475b33[_0xdeb6('0x4f')]);}});}else{return _0x537dee[_0xdeb6('0x4d')](_0x475b33[_0xdeb6('0x4f')],function(_0xae7795){if(_0x480ee0){fs['unlink'](_0x475b33[_0xdeb6('0x4f')]);}});}}})['catch'](handleError(_0x537dee,null));};exports[_0xdeb6('0x28')]=function(_0x12e2ea,_0x12c416){return db[_0xdeb6('0x41')][_0xdeb6('0x48')]({'where':{'id':_0x12e2ea[_0xdeb6('0x45')]['id']}})[_0xdeb6('0x27')](function(_0x5cfb6f){if(_[_0xdeb6('0x63')](_0x5cfb6f)){throw new ReferenceError(_0xdeb6('0x64'));}return _0x5cfb6f;})[_0xdeb6('0x27')](function(_0xaf7a98){var _0x1d44bc=_0xaf7a98[_0xdeb6('0x4f')];logger[_0xdeb6('0x65')](_0xdeb6('0x66'),_0x1d44bc);if(!_[_0xdeb6('0x63')](_0xaf7a98['value'])&&fs['existsSync'](_0x1d44bc)){logger[_0xdeb6('0x65')](_0xdeb6('0x67')+_0x1d44bc+_0xdeb6('0x68'));fs[_0xdeb6('0x69')](_0x1d44bc);}_0x1d44bc=_0x1d44bc+'.cypher';if(!_['isNil'](_0xaf7a98[_0xdeb6('0x4f')])&&fs['existsSync'](_0x1d44bc)){logger[_0xdeb6('0x65')](_0xdeb6('0x67')+_0x1d44bc+_0xdeb6('0x68'));fs[_0xdeb6('0x69')](_0x1d44bc);}return _0xaf7a98;})[_0xdeb6('0x27')](function(_0xefbabd){if(!_0xefbabd)throw new InternalError();return _0xefbabd[_0xdeb6('0x28')]();})['then'](function(){_0x12c416[_0xdeb6('0x1b')](0xcc)[_0xdeb6('0x1c')]();})[_0xdeb6('0x4a')](handleError(_0x12c416,null));};function getBucketslist(_0x421170,_0x4c3532,_0x3bb8eb){return new Promise(function(_0x2d8e8c,_0x221386){var _0x1ab7ce=new AWS['S3']({'accessKeyId':_0x4c3532,'secretAccessKey':_0x421170,'region':_0x3bb8eb});_0x1ab7ce[_0xdeb6('0x6a')]({},function(_0x378d55,_0xc1e83f){if(_0x378d55){return _0x221386(_0x378d55);}else{return _0x2d8e8c(_0xc1e83f);}});});}function createBucket(_0x184b9e,_0x1e0285,_0x486051,_0x18f4e6){return new Promise(function(_0xf0ee51,_0x2e8f05){var _0x5ad36c=new AWS['S3']({'accessKeyId':_0x1e0285,'secretAccessKey':_0x184b9e,'region':_0x486051});_0x5ad36c['createBucket']({'Bucket':_0x18f4e6},function(_0x2f6984,_0x346301){if(_0x2f6984){return _0x2e8f05(_0x2f6984);}else{return _0xf0ee51(_0x346301);}});});}function uploadFile(_0x1c3a2e,_0x577bf1,_0x1b4b85,_0x12761d,_0x1e7455,_0x544c2e){return new Promise(function(_0x353789,_0x2fab03){var _0x1c592e=new AWS['S3']({'accessKeyId':_0x577bf1,'secretAccessKey':_0x1c3a2e,'region':_0x1b4b85});_0x1c592e[_0xdeb6('0x6b')]({'Bucket':_0x12761d,'Key':_0x1e7455,'Body':_0x544c2e},function(_0x17d87b,_0x4ff525){if(_0x17d87b){return _0x2fab03(_0x17d87b);}else{return _0x353789(_0x4ff525);}});});}function startTranscribe(_0x3ba215,_0x1a861a,_0x3fac64,_0x597bbb,_0x1e6847,_0x6a3b68){return new Promise(function(_0x358d36,_0x322981){var _0x240a15=new AWS[(_0xdeb6('0x6c'))]({'accessKeyId':_0x1a861a,'secretAccessKey':_0x3ba215,'region':_0x3fac64});_0x240a15['startTranscriptionJob']({'TranscriptionJobName':_0x597bbb,'LanguageCode':_0x1e6847,'Media':{'MediaFileUri':_0x6a3b68}},function(_0x14d428,_0x2d8850){if(_0x14d428){return _0x322981(_0x14d428);}else{return _0x358d36(_0x2d8850);}});});}function transcribe(_0x28e646,_0x1e2b2e,_0x26267e,_0x3d7d85,_0xf99867,_0x2dcd4f,_0x3ba0b5){return new Promise(function(_0x44ea2e,_0x2da93b){var _0x21c470={};logger['info'](util[_0xdeb6('0x34')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x28e646,_0xf99867));return uploadFile(_0x1e2b2e,_0x26267e,_0x3d7d85,_0xf99867,path['basename'](_0x2dcd4f),fs[_0xdeb6('0x6d')](_0x2dcd4f))[_0xdeb6('0x27')](function(_0x1ee33e){logger['info'](util[_0xdeb6('0x34')](_0xdeb6('0x6e'),_0x28e646,_0xf99867,_0x1ee33e[_0xdeb6('0x6f')]));_0x21c470['bucket']=_0x1ee33e[_0xdeb6('0x70')];_0x21c470[_0xdeb6('0x71')]=_0x1ee33e[_0xdeb6('0x6f')];logger[_0xdeb6('0x65')](util[_0xdeb6('0x34')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x28e646));return startTranscribe(_0x1e2b2e,_0x26267e,_0x3d7d85,uuidv4(),_0x3ba0b5,_0x1ee33e[_0xdeb6('0x6f')]);})[_0xdeb6('0x27')](function(_0x52a9af){logger['info'](util[_0xdeb6('0x34')](_0xdeb6('0x72'),_0x28e646,_0x52a9af[_0xdeb6('0x73')]['TranscriptionJobName']));_0x21c470[_0xdeb6('0x74')]=_0x52a9af[_0xdeb6('0x73')][_0xdeb6('0x75')];_0x21c470[_0xdeb6('0x76')]=_0x52a9af[_0xdeb6('0x73')][_0xdeb6('0x77')];return _0x44ea2e(_0x21c470);})[_0xdeb6('0x4a')](function(_0x2b6dfc){return _0x2da93b(_0x2b6dfc);});});}exports[_0xdeb6('0x78')]=function(_0x1fe94f,_0x30d762,_0x49ad90){var _0x2abf07;var _0xaa96b3;var _0x215688;var _0x4f6a73=require(_0xdeb6('0x79'));return db[_0xdeb6('0x41')]['findOne']({'where':{'id':_0x1fe94f[_0xdeb6('0x45')]['id']}})[_0xdeb6('0x27')](function(_0x1e8daf){if(_0x1e8daf){var _0x470537=util['format'](_0xdeb6('0x50'),_0x1e8daf['value']);if(fs[_0xdeb6('0x51')](_0x470537)){cypher=!![];return _0x4f6a73[_0xdeb6('0x61')](_0x470537,_0x1e8daf['value'],config[_0xdeb6('0x52')][_0xdeb6('0x53')])[_0xdeb6('0x27')](function(){return _0x1e8daf;});}return _0x1e8daf;}})[_0xdeb6('0x27')](function(_0x6c71cb){if(!_0x6c71cb){throw new db[(_0xdeb6('0x62'))][(_0xdeb6('0x54'))](_0xdeb6('0x7a'));}_0xaa96b3=_0x6c71cb;return db[_0xdeb6('0x7b')][_0xdeb6('0x7c')]({'where':{'id':0x1}});})[_0xdeb6('0x27')](handleEntityNotFound(_0x30d762,null))['then'](function(_0x52d7c8){if(_0x52d7c8){_0x2abf07=_0x52d7c8;if(!_0x2abf07[_0xdeb6('0x7d')]||!_0x2abf07[_0xdeb6('0x7e')]||!_0x2abf07['transcribeRegion']||!_0x2abf07[_0xdeb6('0x7f')]||!_0x2abf07[_0xdeb6('0x80')]){throw new db[(_0xdeb6('0x62'))][(_0xdeb6('0x54'))]('Transcribe\x20not\x20configured');}if(_0x1fe94f[_0xdeb6('0x4b')][_0xdeb6('0x81')]&&(!_0x2abf07[_0xdeb6('0x82')]||!_0x2abf07[_0xdeb6('0x83')]||!_0x2abf07[_0xdeb6('0x84')]||!_0x2abf07[_0xdeb6('0x7f')]||!_0x2abf07[_0xdeb6('0x80')])){throw new db[(_0xdeb6('0x62'))][(_0xdeb6('0x54'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0xdeb6('0x85')]['findOne']({'where':{'id':_0x2abf07['transcribeAccountId']}});}})[_0xdeb6('0x27')](function(_0x40f26e){if(!_0x40f26e){throw new db[(_0xdeb6('0x62'))][(_0xdeb6('0x54'))](_0xdeb6('0x86'));}if(!_0x40f26e[_0xdeb6('0x87')]||!_0x40f26e[_0xdeb6('0x88')]){throw new db[(_0xdeb6('0x62'))][(_0xdeb6('0x54'))](_0xdeb6('0x89'));}_0x215688=_0x40f26e;return getBucketslist(_0x215688[_0xdeb6('0x87')],_0x215688[_0xdeb6('0x88')],_0x2abf07[_0xdeb6('0x8a')]);})['then'](function(_0x182deb){if(_0x182deb&&_0x182deb[_0xdeb6('0x8b')]){var _0xa97dbd=_[_0xdeb6('0x48')](_0x182deb[_0xdeb6('0x8b')],function(_0x1bbf0e){return _0x1bbf0e[_0xdeb6('0x8c')]===_0x2abf07[_0xdeb6('0x80')];});if(!_0xa97dbd){logger[_0xdeb6('0x65')](util[_0xdeb6('0x34')](_0xdeb6('0x8d'),_0x1fe94f[_0xdeb6('0x45')]['id'],_0x2abf07[_0xdeb6('0x80')]));return createBucket(_0x215688['data1'],_0x215688['data2'],_0x2abf07[_0xdeb6('0x8a')],_0x2abf07[_0xdeb6('0x80')]);}logger['info'](util[_0xdeb6('0x34')](_0xdeb6('0x8e'),_0x1fe94f[_0xdeb6('0x45')]['id'],_0x2abf07['bucket']));return;}})[_0xdeb6('0x27')](function(_0x831d09){if(_0xaa96b3[_0xdeb6('0x76')]==='NEW'){return transcribe(_0x1fe94f['params']['id'],_0x215688['data1'],_0x215688[_0xdeb6('0x88')],_0x2abf07[_0xdeb6('0x8a')],_0x2abf07[_0xdeb6('0x80')],_0xaa96b3[_0xdeb6('0x4f')],_0x2abf07['language']);}else{logger[_0xdeb6('0x65')](util[_0xdeb6('0x34')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x1fe94f[_0xdeb6('0x45')]['id']));return{'transcribeStatus':_0xdeb6('0x8f')};}})[_0xdeb6('0x27')](function(_0x1e89c7){if(_0x1e89c7){_0x1e89c7['tempSentiment']=_0x1fe94f[_0xdeb6('0x4b')][_0xdeb6('0x81')];return _0xaa96b3['updateAttributes'](_0x1e89c7);}})[_0xdeb6('0x27')](respondWithResult(_0x30d762,null))['catch'](handleError(_0x30d762,null));};function writeFile(_0x4f4e2e,_0x475a27){return new Promise(function(_0x265545,_0x23f48d){fs['writeFile'](_0x475a27,_0x4f4e2e,function(_0x5ce789,_0x18ee5e){if(_0x5ce789){return _0x23f48d(_0x5ce789);}else{return _0x265545(_0x18ee5e);}});});}exports[_0xdeb6('0x90')]=function(_0x1a74c2,_0x3a82b8,_0x31ac41){return db['VoiceRecording']['findOne']({'where':{'id':_0x1a74c2[_0xdeb6('0x45')]['id']}})[_0xdeb6('0x27')](handleEntityNotFound(_0x3a82b8))[_0xdeb6('0x27')](function(_0x16d568){if(_0x16d568&&_0x16d568[_0xdeb6('0x91')]){var _0x471336=_0x16d568['fileText'];var _0x1d1e2c=config['root']+'/server/files/transcribes/transcribe_'+_0x16d568['id']+_0xdeb6('0x92');if(fs[_0xdeb6('0x51')](_0x1d1e2c)){return _0x1d1e2c;}return writeFile(_0x471336,_0x1d1e2c)[_0xdeb6('0x27')](function(){return _0x1d1e2c;});}else{throw new db['Sequelize'][(_0xdeb6('0x54'))](_0xdeb6('0x93'));}})['then'](function(_0x1eaea9){return _0x3a82b8['download'](_0x1eaea9);})['catch'](handleError(_0x3a82b8));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index a94311a..573c751 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 _0x4b17=['path','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','lodash','../../config/logger','moment','bluebird'];(function(_0x5c980a,_0x53ce8d){var _0x591167=function(_0x19eac8){while(--_0x19eac8){_0x5c980a['push'](_0x5c980a['shift']());}};_0x591167(++_0x53ce8d);}(_0x4b17,0x10f));var _0x74b1=function(_0x2962d5,_0x38deda){_0x2962d5=_0x2962d5-0x0;var _0x273406=_0x4b17[_0x2962d5];return _0x273406;};'use strict';var _=require(_0x74b1('0x0'));var util=require('util');var logger=require(_0x74b1('0x1'))('api');var moment=require(_0x74b1('0x2'));var BPromise=require(_0x74b1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x74b1('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x74b1('0x5'));module[_0x74b1('0x6')]=function(_0x379dcc,_0x3873a6){return _0x379dcc[_0x74b1('0x7')](_0x74b1('0x8'),attributes,{'tableName':_0x74b1('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x74b1('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa1c9=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceRecording.attributes','exports','define','voice_recordings'];(function(_0x2d2796,_0x4f3ac3){var _0x5d1502=function(_0x10c48a){while(--_0x10c48a){_0x2d2796['push'](_0x2d2796['shift']());}};_0x5d1502(++_0x4f3ac3);}(_0xa1c9,0x135));var _0x9a1c=function(_0x33851a,_0x2aefa2){_0x33851a=_0x33851a-0x0;var _0xf6cb6e=_0xa1c9[_0x33851a];return _0xf6cb6e;};'use strict';var _=require(_0x9a1c('0x0'));var util=require(_0x9a1c('0x1'));var logger=require(_0x9a1c('0x2'))(_0x9a1c('0x3'));var moment=require(_0x9a1c('0x4'));var BPromise=require(_0x9a1c('0x5'));var rp=require(_0x9a1c('0x6'));var fs=require('fs');var path=require(_0x9a1c('0x7'));var rimraf=require(_0x9a1c('0x8'));var config=require('../../config/environment');var attributes=require(_0x9a1c('0x9'));module[_0x9a1c('0xa')]=function(_0x176efb,_0x304592){return _0x176efb[_0x9a1c('0xb')]('VoiceRecording',attributes,{'tableName':_0x9a1c('0xc'),'paranoid':![],'indexes':[{'name':_0x9a1c('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 3257243..7ecbe3a 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 _0xa6b0=['create','value','%s.cypher','encryptFile','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','update','body','options','raw','where','limit','then','UpdateVoiceRecording','CreateVoiceRecording','../../components/encryptor','callRecordingEncryption','VoiceRecording'];(function(_0x239c03,_0x570517){var _0x356478=function(_0x539df3){while(--_0x539df3){_0x239c03['push'](_0x239c03['shift']());}};_0x356478(++_0x570517);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x44a7e3,_0x34bb07){_0x44a7e3=_0x44a7e3-0x0;var _0x47d0a5=_0xa6b0[_0x44a7e3];return _0x47d0a5;};'use strict';var _=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0a6b('0x2'));var fs=require('fs');var Redis=require(_0x0a6b('0x3'));var db=require(_0x0a6b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a6b('0x5'))(_0x0a6b('0x6'));var config=require(_0x0a6b('0x7'));var jayson=require(_0x0a6b('0x8'));var client=jayson[_0x0a6b('0x9')][_0x0a6b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b5fb5,_0xa908dd,_0x26f761){return new BPromise(function(_0x340a33,_0x8e89f){return client[_0x0a6b('0xb')](_0x1b5fb5,_0x26f761)['then'](function(_0x493948){logger[_0x0a6b('0xc')](_0x0a6b('0xd'),_0xa908dd,_0x0a6b('0xe'));logger[_0x0a6b('0xf')](_0x0a6b('0x10'),_0xa908dd,_0x0a6b('0xe'),JSON[_0x0a6b('0x11')](_0x493948));if(_0x493948[_0x0a6b('0x12')]){if(_0x493948[_0x0a6b('0x12')][_0x0a6b('0x13')]===0x1f4){logger[_0x0a6b('0x12')](_0x0a6b('0xd'),_0xa908dd,_0x493948[_0x0a6b('0x12')][_0x0a6b('0x14')]);return _0x8e89f(_0x493948['error']['message']);}logger[_0x0a6b('0x12')](_0x0a6b('0xd'),_0xa908dd,_0x493948[_0x0a6b('0x12')][_0x0a6b('0x14')]);return _0x340a33(_0x493948[_0x0a6b('0x12')][_0x0a6b('0x14')]);}else{logger[_0x0a6b('0xc')](_0x0a6b('0xd'),_0xa908dd,_0x0a6b('0xe'));_0x340a33(_0x493948[_0x0a6b('0x15')]['message']);}})[_0x0a6b('0x16')](function(_0x1538f4){logger['error'](_0x0a6b('0xd'),_0xa908dd,_0x1538f4);_0x8e89f(_0x1538f4);});});}exports['UpdateVoiceRecording']=function(_0xcb412){var _0x31f347=this;return new Promise(function(_0x2cb10b,_0x1ad45d){return db['VoiceRecording'][_0x0a6b('0x17')](_0xcb412[_0x0a6b('0x18')],{'raw':_0xcb412['options']?_0xcb412[_0x0a6b('0x19')][_0x0a6b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcb412[_0x0a6b('0x19')]?_0xcb412['options'][_0x0a6b('0x1b')]||null:null,'attributes':_0xcb412[_0x0a6b('0x19')]?_0xcb412[_0x0a6b('0x19')]['attributes']||null:null,'limit':_0xcb412[_0x0a6b('0x19')]?_0xcb412[_0x0a6b('0x19')][_0x0a6b('0x1c')]||null:null})[_0x0a6b('0x1d')](function(_0x122c19){logger['info'](_0x0a6b('0x1e'),_0xcb412);logger[_0x0a6b('0xf')](_0x0a6b('0x1e'),_0xcb412,JSON['stringify'](_0x122c19));_0x2cb10b(_0x122c19);})[_0x0a6b('0x16')](function(_0x2e58fd){logger[_0x0a6b('0x12')](_0x0a6b('0x1e'),_0x2e58fd[_0x0a6b('0x14')],_0xcb412);_0x1ad45d(_0x31f347['error'](0x1f4,_0x2e58fd[_0x0a6b('0x14')]));});});};exports[_0x0a6b('0x1f')]=function(_0x19a653){var _0x4ce9d4=this;return new Promise(function(_0x3a9092,_0x51e760){var _0xecbf0c=require(_0x0a6b('0x20'));var _0x45ae97;return db['Setting']['findOne']({'attributes':['id',_0x0a6b('0x21')],'where':{'id':0x1},'raw':!![]})[_0x0a6b('0x1d')](function(_0x1aecc7){_0x45ae97=_0x1aecc7;return db[_0x0a6b('0x22')][_0x0a6b('0x23')](_0x19a653[_0x0a6b('0x18')]);})['then'](function(_0xa7ab7c){if(_0x45ae97[_0x0a6b('0x21')]&&fs['existsSync'](_0xa7ab7c[_0x0a6b('0x24')])){var _0x554145=util['format'](_0x0a6b('0x25'),_0xa7ab7c[_0x0a6b('0x24')]);return _0xecbf0c[_0x0a6b('0x26')](_0xa7ab7c[_0x0a6b('0x24')],_0x554145,config[_0x0a6b('0x27')]['recording'])['then'](function(){fs[_0x0a6b('0x28')](_0xa7ab7c[_0x0a6b('0x24')]);logger[_0x0a6b('0xc')](_0x0a6b('0x29'));return _0xa7ab7c;});}return _0xa7ab7c;})['then'](function(_0xe2b82b){logger[_0x0a6b('0xc')]('CreateVoiceRecording',_0x19a653);logger['debug'](_0x0a6b('0x1f'),_0x19a653,JSON[_0x0a6b('0x11')](_0xe2b82b));_0x3a9092(_0xe2b82b);})['catch'](function(_0x3c3c23){logger[_0x0a6b('0x12')](_0x0a6b('0x1f'),_0x3c3c23[_0x0a6b('0x14')],_0x19a653);_0x51e760(_0x4ce9d4[_0x0a6b('0x12')](0x1f4,_0x3c3c23[_0x0a6b('0x14')]));});});}; \ No newline at end of file +var _0x4888=['recording','unlink','CreateVoiceRecording\x20file\x20encrypted','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','UpdateVoiceRecording','VoiceRecording','update','body','options','where','attributes','limit','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','value','format','%s.cypher','encryptFile','secrets'];(function(_0x57a55c,_0x214a3b){var _0x3054c1=function(_0x4fd9ad){while(--_0x4fd9ad){_0x57a55c['push'](_0x57a55c['shift']());}};_0x3054c1(++_0x214a3b);}(_0x4888,0x198));var _0x8488=function(_0x57112d,_0x9ea573){_0x57112d=_0x57112d-0x0;var _0x3c32b9=_0x4888[_0x57112d];return _0x3c32b9;};'use strict';var _=require('lodash');var util=require(_0x8488('0x0'));var moment=require(_0x8488('0x1'));var BPromise=require(_0x8488('0x2'));var rs=require(_0x8488('0x3'));var fs=require('fs');var Redis=require(_0x8488('0x4'));var db=require(_0x8488('0x5'))['db'];var utils=require(_0x8488('0x6'));var logger=require('../../config/logger')(_0x8488('0x7'));var config=require(_0x8488('0x8'));var jayson=require(_0x8488('0x9'));var client=jayson[_0x8488('0xa')][_0x8488('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19e508,_0x5250a1,_0x5b30a7){return new BPromise(function(_0x56aad0,_0x568a82){return client[_0x8488('0xc')](_0x19e508,_0x5b30a7)[_0x8488('0xd')](function(_0x542bd8){logger[_0x8488('0xe')](_0x8488('0xf'),_0x5250a1,_0x8488('0x10'));logger[_0x8488('0x11')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x5250a1,_0x8488('0x10'),JSON[_0x8488('0x12')](_0x542bd8));if(_0x542bd8[_0x8488('0x13')]){if(_0x542bd8[_0x8488('0x13')][_0x8488('0x14')]===0x1f4){logger['error'](_0x8488('0xf'),_0x5250a1,_0x542bd8[_0x8488('0x13')]['message']);return _0x568a82(_0x542bd8['error'][_0x8488('0x15')]);}logger['error'](_0x8488('0xf'),_0x5250a1,_0x542bd8['error']['message']);return _0x56aad0(_0x542bd8[_0x8488('0x13')][_0x8488('0x15')]);}else{logger[_0x8488('0xe')](_0x8488('0xf'),_0x5250a1,_0x8488('0x10'));_0x56aad0(_0x542bd8[_0x8488('0x16')][_0x8488('0x15')]);}})['catch'](function(_0x3dad45){logger[_0x8488('0x13')](_0x8488('0xf'),_0x5250a1,_0x3dad45);_0x568a82(_0x3dad45);});});}exports[_0x8488('0x17')]=function(_0x60ae2f){var _0x39775f=this;return new Promise(function(_0x1aedb1,_0x27c62a){return db[_0x8488('0x18')][_0x8488('0x19')](_0x60ae2f[_0x8488('0x1a')],{'raw':_0x60ae2f[_0x8488('0x1b')]?_0x60ae2f[_0x8488('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x60ae2f['options']?_0x60ae2f[_0x8488('0x1b')][_0x8488('0x1c')]||null:null,'attributes':_0x60ae2f[_0x8488('0x1b')]?_0x60ae2f[_0x8488('0x1b')][_0x8488('0x1d')]||null:null,'limit':_0x60ae2f[_0x8488('0x1b')]?_0x60ae2f[_0x8488('0x1b')][_0x8488('0x1e')]||null:null})[_0x8488('0xd')](function(_0x5123d0){logger[_0x8488('0xe')](_0x8488('0x17'),_0x60ae2f);logger[_0x8488('0x11')](_0x8488('0x17'),_0x60ae2f,JSON[_0x8488('0x12')](_0x5123d0));_0x1aedb1(_0x5123d0);})['catch'](function(_0x577234){logger['error']('UpdateVoiceRecording',_0x577234[_0x8488('0x15')],_0x60ae2f);_0x27c62a(_0x39775f['error'](0x1f4,_0x577234['message']));});});};exports[_0x8488('0x1f')]=function(_0x2f350a){var _0x2b3c97=this;return new Promise(function(_0x6ebee0,_0x287662){var _0x503b83=require(_0x8488('0x20'));var _0x38c137;return db[_0x8488('0x21')][_0x8488('0x22')]({'attributes':['id',_0x8488('0x23')],'where':{'id':0x1},'raw':!![]})[_0x8488('0xd')](function(_0x2c15ff){_0x38c137=_0x2c15ff;return db[_0x8488('0x18')][_0x8488('0x24')](_0x2f350a[_0x8488('0x1a')]);})[_0x8488('0xd')](function(_0x58d0cc){if(_0x38c137['callRecordingEncryption']&&fs['existsSync'](_0x58d0cc[_0x8488('0x25')])){var _0x408c36=util[_0x8488('0x26')](_0x8488('0x27'),_0x58d0cc[_0x8488('0x25')]);return _0x503b83[_0x8488('0x28')](_0x58d0cc['value'],_0x408c36,config[_0x8488('0x29')][_0x8488('0x2a')])[_0x8488('0xd')](function(){fs[_0x8488('0x2b')](_0x58d0cc[_0x8488('0x25')]);logger['info'](_0x8488('0x2c'));return _0x58d0cc;});}return _0x58d0cc;})[_0x8488('0xd')](function(_0x579d50){logger[_0x8488('0xe')](_0x8488('0x1f'),_0x2f350a);logger[_0x8488('0x11')](_0x8488('0x1f'),_0x2f350a,JSON[_0x8488('0x12')](_0x579d50));_0x6ebee0(_0x579d50);})['catch'](function(_0x44c8f3){logger[_0x8488('0x13')](_0x8488('0x1f'),_0x44c8f3['message'],_0x2f350a);_0x287662(_0x2b3c97[_0x8488('0x13')](0x1f4,_0x44c8f3['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index b5d940e..db2e136 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 _0x1360=['update','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','put'];(function(_0x53e787,_0x4298e6){var _0x2781a0=function(_0x21f861){while(--_0x21f861){_0x53e787['push'](_0x53e787['shift']());}};_0x2781a0(++_0x4298e6);}(_0x1360,0x87));var _0x0136=function(_0x5b7755,_0x44681c){_0x5b7755=_0x5b7755-0x0;var _0x1a9c39=_0x1360[_0x5b7755];return _0x1a9c39;};'use strict';var multer=require(_0x0136('0x0'));var util=require(_0x0136('0x1'));var path=require(_0x0136('0x2'));var timeout=require(_0x0136('0x3'));var express=require('express');var router=express[_0x0136('0x4')]();var fs_extra=require(_0x0136('0x5'));var auth=require(_0x0136('0x6'));var interaction=require(_0x0136('0x7'));var config=require('../../config/environment');var controller=require(_0x0136('0x8'));router[_0x0136('0x9')]('/',auth['isAuthenticated'](),controller[_0x0136('0xa')]);router[_0x0136('0x9')](_0x0136('0xb'),auth[_0x0136('0xc')](),controller['describe']);router[_0x0136('0x9')](_0x0136('0xd'),auth[_0x0136('0xc')](),controller[_0x0136('0xe')]);router[_0x0136('0xf')]('/',auth[_0x0136('0xc')](),controller['create']);router[_0x0136('0x10')](_0x0136('0xd'),auth['isAuthenticated'](),controller[_0x0136('0x11')]);router['delete'](_0x0136('0xd'),auth['isAuthenticated'](),controller[_0x0136('0x12')]);module['exports']=router; \ No newline at end of file +var _0x66ff=['show','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x66ff,0xd8));var _0xf66f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x66ff[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xf66f('0x0'));var util=require(_0xf66f('0x1'));var path=require(_0xf66f('0x2'));var timeout=require(_0xf66f('0x3'));var express=require(_0xf66f('0x4'));var router=express['Router']();var fs_extra=require(_0xf66f('0x5'));var auth=require(_0xf66f('0x6'));var interaction=require(_0xf66f('0x7'));var config=require('../../config/environment');var controller=require(_0xf66f('0x8'));router['get']('/',auth[_0xf66f('0x9')](),controller[_0xf66f('0xa')]);router[_0xf66f('0xb')](_0xf66f('0xc'),auth['isAuthenticated'](),controller[_0xf66f('0xd')]);router[_0xf66f('0xb')](_0xf66f('0xe'),auth[_0xf66f('0x9')](),controller[_0xf66f('0xf')]);router['post']('/',auth[_0xf66f('0x9')](),controller[_0xf66f('0x10')]);router[_0xf66f('0x11')](_0xf66f('0xe'),auth[_0xf66f('0x9')](),controller[_0xf66f('0x12')]);router[_0xf66f('0x13')](_0xf66f('0xe'),auth['isAuthenticated'](),controller[_0xf66f('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index aa1167f..5fdbe4b 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 _0x0c22=['exports','ENUM','blind','STRING','Yes','moment'];(function(_0x551cf2,_0x1fed51){var _0x21fb6f=function(_0x48bafd){while(--_0x48bafd){_0x551cf2['push'](_0x551cf2['shift']());}};_0x21fb6f(++_0x1fed51);}(_0x0c22,0x18b));var _0x20c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c22[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x20c2('0x0'));module[_0x20c2('0x1')]={'type':{'type':Sequelize[_0x20c2('0x2')](_0x20c2('0x3'),'attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x20c2('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x20c2('0x4')]},'transferercalleridname':{'type':Sequelize[_0x20c2('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x20c2('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x20c2('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x20c2('0x4')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x20c2('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x20c2('0x4')]},'transfereechannel':{'type':Sequelize[_0x20c2('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x20c2('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x20c2('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x20c2('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x20c2('0x4')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x20c2('0x4')]},'transfereeexten':{'type':Sequelize[_0x20c2('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x20c2('0x4')]},'isexternal':{'type':Sequelize['ENUM'](_0x20c2('0x5'),'No')},'context':{'type':Sequelize[_0x20c2('0x4')]},'extension':{'type':Sequelize[_0x20c2('0x4')]}}; \ No newline at end of file +var _0x6c20=['sequelize','moment','exports','ENUM','attended','STRING','Yes'];(function(_0x3aad81,_0x40761d){var _0x3b3c28=function(_0xe1657a){while(--_0xe1657a){_0x3aad81['push'](_0x3aad81['shift']());}};_0x3b3c28(++_0x40761d);}(_0x6c20,0xaf));var _0x06c2=function(_0x6fabdb,_0x168fcd){_0x6fabdb=_0x6fabdb-0x0;var _0x58c0c2=_0x6c20[_0x6fabdb];return _0x58c0c2;};'use strict';var Sequelize=require(_0x06c2('0x0'));var moment=require(_0x06c2('0x1'));module[_0x06c2('0x2')]={'type':{'type':Sequelize[_0x06c2('0x3')]('blind',_0x06c2('0x4'))},'result':{'type':Sequelize[_0x06c2('0x5')]},'transfererchannel':{'type':Sequelize[_0x06c2('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x06c2('0x5')]},'transferercalleridname':{'type':Sequelize[_0x06c2('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x06c2('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x06c2('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x06c2('0x5')]},'transferercontext':{'type':Sequelize[_0x06c2('0x5')]},'transfererexten':{'type':Sequelize[_0x06c2('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x06c2('0x5')]},'transfereechannel':{'type':Sequelize[_0x06c2('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x06c2('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x06c2('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x06c2('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x06c2('0x5')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x06c2('0x5')]},'transfereeexten':{'type':Sequelize[_0x06c2('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x06c2('0x5')]},'isexternal':{'type':Sequelize[_0x06c2('0x3')](_0x06c2('0x6'),'No')},'context':{'type':Sequelize[_0x06c2('0x5')]},'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 faa2e86..c1bbf75 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 _0x9489=['create','body','update','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','save','then','error','name','send','index','VoiceTransferReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','rows','catch','params','include','options','find'];(function(_0x1b3495,_0x250f35){var _0x5c8053=function(_0x388945){while(--_0x388945){_0x1b3495['push'](_0x1b3495['shift']());}};_0x5c8053(++_0x250f35);}(_0x9489,0x1bb));var _0x9948=function(_0x36c146,_0x3a6ae0){_0x36c146=_0x36c146-0x0;var _0x54cae6=_0x9489[_0x36c146];return _0x54cae6;};'use strict';var emlformat=require(_0x9948('0x0'));var rimraf=require(_0x9948('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9948('0x2'));var rp=require(_0x9948('0x3'));var moment=require(_0x9948('0x4'));var BPromise=require(_0x9948('0x5'));var Mustache=require('mustache');var util=require(_0x9948('0x6'));var path=require(_0x9948('0x7'));var sox=require(_0x9948('0x8'));var csv=require('to-csv');var ejs=require(_0x9948('0x9'));var fs=require('fs');var fs_extra=require(_0x9948('0xa'));var _=require('lodash');var squel=require(_0x9948('0xb'));var crypto=require('crypto');var jsforce=require(_0x9948('0xc'));var deskjs=require(_0x9948('0xd'));var toCsv=require(_0x9948('0xe'));var querystring=require(_0x9948('0xf'));var Papa=require('papaparse');var Redis=require(_0x9948('0x10'));var authService=require(_0x9948('0x11'));var qs=require(_0x9948('0x12'));var as=require(_0x9948('0x13'));var hardwareService=require(_0x9948('0x14'));var logger=require(_0x9948('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x9948('0x16'));var licenseUtil=require(_0x9948('0x17'));var db=require(_0x9948('0x18'))['db'];function respondWithStatusCode(_0x4f12b3,_0x1baf4f){_0x1baf4f=_0x1baf4f||0xcc;return function(_0x4f58b3){if(_0x4f58b3){return _0x4f12b3[_0x9948('0x19')](_0x1baf4f);}return _0x4f12b3[_0x9948('0x1a')](_0x1baf4f)[_0x9948('0x1b')]();};}function respondWithResult(_0xdbb2fb,_0x3793f9){_0x3793f9=_0x3793f9||0xc8;return function(_0x4aabbe){if(_0x4aabbe){return _0xdbb2fb[_0x9948('0x1a')](_0x3793f9)[_0x9948('0x1c')](_0x4aabbe);}};}function respondWithFilteredResult(_0x397858,_0x12f3f2){return function(_0x517d85){if(_0x517d85){var _0x4ee949=typeof _0x12f3f2[_0x9948('0x1d')]===_0x9948('0x1e')&&typeof _0x12f3f2[_0x9948('0x1f')]===_0x9948('0x1e');var _0x3f655b=_0x517d85[_0x9948('0x20')];var _0x533ef2=_0x4ee949?0x0:_0x12f3f2[_0x9948('0x1d')];var _0x50ecf0=_0x4ee949?_0x517d85[_0x9948('0x20')]:_0x12f3f2['offset']+_0x12f3f2['limit'];var _0x31b071;if(_0x50ecf0>=_0x3f655b){_0x50ecf0=_0x3f655b;_0x31b071=0xc8;}else{_0x31b071=0xce;}_0x397858[_0x9948('0x1a')](_0x31b071);return _0x397858[_0x9948('0x21')]('Content-Range',_0x533ef2+'-'+_0x50ecf0+'/'+_0x3f655b)['json'](_0x517d85);}return null;};}function patchUpdates(_0x246001){return function(_0x4927f2){try{jsonpatch['apply'](_0x4927f2,_0x246001,!![]);}catch(_0x45e5f1){return BPromise['reject'](_0x45e5f1);}return _0x4927f2[_0x9948('0x22')]();};}function saveUpdates(_0x5f3d5b,_0x16958f){return function(_0x2e9cee){if(_0x2e9cee){return _0x2e9cee['update'](_0x5f3d5b)[_0x9948('0x23')](function(_0x3316e2){return _0x3316e2;});}return null;};}function removeEntity(_0x7f0eb2,_0x20b2c7){return function(_0x2ec846){if(_0x2ec846){return _0x2ec846['destroy']()[_0x9948('0x23')](function(){_0x7f0eb2[_0x9948('0x1a')](0xcc)[_0x9948('0x1b')]();});}};}function handleEntityNotFound(_0xdbd436,_0x3a2321){return function(_0x3d2c09){if(!_0x3d2c09){_0xdbd436['sendStatus'](0x194);}return _0x3d2c09;};}function handleError(_0x27194a,_0x26445d){_0x26445d=_0x26445d||0x1f4;return function(_0x114d1c){logger[_0x9948('0x24')](_0x114d1c['stack']);if(_0x114d1c[_0x9948('0x25')]){delete _0x114d1c[_0x9948('0x25')];}_0x27194a[_0x9948('0x1a')](_0x26445d)[_0x9948('0x26')](_0x114d1c);};}exports[_0x9948('0x27')]=function(_0x317ae4,_0x43acc7){var _0x37edb5={},_0x3a1afe={},_0x24bcc1={'count':0x0,'rows':[]};var _0x95616b=_['map'](db[_0x9948('0x28')][_0x9948('0x29')],function(_0x2616ed){return{'name':_0x2616ed[_0x9948('0x2a')],'type':_0x2616ed[_0x9948('0x2b')][_0x9948('0x2c')]};});_0x3a1afe['model']=_[_0x9948('0x2d')](_0x95616b,_0x9948('0x25'));_0x3a1afe[_0x9948('0x2e')]=_[_0x9948('0x2f')](_0x317ae4[_0x9948('0x2e')]);_0x3a1afe[_0x9948('0x30')]=_[_0x9948('0x31')](_0x3a1afe['model'],_0x3a1afe[_0x9948('0x2e')]);_0x37edb5[_0x9948('0x32')]=_[_0x9948('0x31')](_0x3a1afe['model'],qs['fields'](_0x317ae4[_0x9948('0x2e')][_0x9948('0x33')]));_0x37edb5[_0x9948('0x32')]=_0x37edb5['attributes'][_0x9948('0x34')]?_0x37edb5[_0x9948('0x32')]:_0x3a1afe[_0x9948('0x35')];if(!_0x317ae4['query'][_0x9948('0x36')](_0x9948('0x37'))){_0x37edb5['limit']=qs['limit'](_0x317ae4['query']['limit']);_0x37edb5[_0x9948('0x1d')]=qs[_0x9948('0x1d')](_0x317ae4[_0x9948('0x2e')]['offset']);}_0x37edb5['order']=qs[_0x9948('0x38')](_0x317ae4[_0x9948('0x2e')][_0x9948('0x38')]);_0x37edb5[_0x9948('0x39')]=qs[_0x9948('0x30')](_[_0x9948('0x3a')](_0x317ae4['query'],_0x3a1afe['filters']),_0x95616b);if(_0x317ae4[_0x9948('0x2e')]['filter']){_0x37edb5['where']=_['merge'](_0x37edb5[_0x9948('0x39')],{'$or':_['map'](_0x95616b,function(_0x4707c9){if(_0x4707c9[_0x9948('0x2b')]!=='VIRTUAL'){var _0x14bd2a={};_0x14bd2a[_0x4707c9[_0x9948('0x25')]]={'$like':'%'+_0x317ae4['query'][_0x9948('0x3b')]+'%'};return _0x14bd2a;}})});}_0x37edb5=_[_0x9948('0x3c')]({},_0x37edb5,_0x317ae4['options']);var _0x2f8e14={'where':_0x37edb5[_0x9948('0x39')]};return db['VoiceTransferReport'][_0x9948('0x20')](_0x2f8e14)[_0x9948('0x23')](function(_0x554716){_0x24bcc1[_0x9948('0x20')]=_0x554716;if(_0x317ae4['query'][_0x9948('0x3d')]){_0x37edb5['include']=[{'all':!![]}];}return db[_0x9948('0x28')]['findAll'](_0x37edb5);})[_0x9948('0x23')](function(_0x31757e){_0x24bcc1[_0x9948('0x3e')]=_0x31757e;return _0x24bcc1;})[_0x9948('0x23')](respondWithFilteredResult(_0x43acc7,_0x37edb5))[_0x9948('0x3f')](handleError(_0x43acc7,null));};exports['show']=function(_0x3fb354,_0x44ee83){var _0x5e70c2={'raw':!![],'where':{'id':_0x3fb354[_0x9948('0x40')]['id']}},_0x5f1e60={};_0x5f1e60[_0x9948('0x35')]=_[_0x9948('0x2f')](db[_0x9948('0x28')][_0x9948('0x29')]);_0x5f1e60[_0x9948('0x2e')]=_[_0x9948('0x2f')](_0x3fb354['query']);_0x5f1e60[_0x9948('0x30')]=_['intersection'](_0x5f1e60[_0x9948('0x35')],_0x5f1e60[_0x9948('0x2e')]);_0x5e70c2[_0x9948('0x32')]=_['intersection'](_0x5f1e60['model'],qs[_0x9948('0x33')](_0x3fb354[_0x9948('0x2e')]['fields']));_0x5e70c2[_0x9948('0x32')]=_0x5e70c2[_0x9948('0x32')]['length']?_0x5e70c2['attributes']:_0x5f1e60[_0x9948('0x35')];if(_0x3fb354[_0x9948('0x2e')]['includeAll']){_0x5e70c2[_0x9948('0x41')]=[{'all':!![]}];}_0x5e70c2=_['merge']({},_0x5e70c2,_0x3fb354[_0x9948('0x42')]);return db['VoiceTransferReport'][_0x9948('0x43')](_0x5e70c2)['then'](handleEntityNotFound(_0x44ee83,null))[_0x9948('0x23')](respondWithResult(_0x44ee83,null))['catch'](handleError(_0x44ee83,null));};exports[_0x9948('0x44')]=function(_0x4f46f7,_0x2a0253){return db[_0x9948('0x28')]['create'](_0x4f46f7[_0x9948('0x45')],{})[_0x9948('0x23')](respondWithResult(_0x2a0253,0xc9))[_0x9948('0x3f')](handleError(_0x2a0253,null));};exports[_0x9948('0x46')]=function(_0x66081f,_0x14463b){if(_0x66081f[_0x9948('0x45')]['id']){delete _0x66081f['body']['id'];}return db[_0x9948('0x28')][_0x9948('0x43')]({'where':{'id':_0x66081f[_0x9948('0x40')]['id']}})[_0x9948('0x23')](handleEntityNotFound(_0x14463b,null))[_0x9948('0x23')](saveUpdates(_0x66081f[_0x9948('0x45')],null))['then'](respondWithResult(_0x14463b,null))['catch'](handleError(_0x14463b,null));};exports[_0x9948('0x47')]=function(_0xe780fe,_0x56f6b5){return db[_0x9948('0x28')]['find']({'where':{'id':_0xe780fe[_0x9948('0x40')]['id']}})[_0x9948('0x23')](handleEntityNotFound(_0x56f6b5,null))[_0x9948('0x23')](removeEntity(_0x56f6b5,null))[_0x9948('0x3f')](handleError(_0x56f6b5,null));};exports[_0x9948('0x48')]=function(_0x39179e,_0x408c37){return db['VoiceTransferReport'][_0x9948('0x48')]()[_0x9948('0x23')](respondWithResult(_0x408c37,null))[_0x9948('0x3f')](handleError(_0x408c37,null));}; \ No newline at end of file +var _0xe3f1=['rawAttributes','keys','intersection','length','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','send','index','map','VoiceTransferReport','fieldName','key','model','name','query','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params'];(function(_0x25d132,_0xbb9b77){var _0x2159ad=function(_0x30cfa5){while(--_0x30cfa5){_0x25d132['push'](_0x25d132['shift']());}};_0x2159ad(++_0xbb9b77);}(_0xe3f1,0xa4));var _0x1e3f=function(_0x3328d1,_0x35ddc1){_0x3328d1=_0x3328d1-0x0;var _0x33c0d8=_0xe3f1[_0x3328d1];return _0x33c0d8;};'use strict';var emlformat=require(_0x1e3f('0x0'));var rimraf=require(_0x1e3f('0x1'));var zipdir=require(_0x1e3f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1e3f('0x3'));var moment=require(_0x1e3f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1e3f('0x5'));var util=require(_0x1e3f('0x6'));var path=require(_0x1e3f('0x7'));var sox=require(_0x1e3f('0x8'));var csv=require(_0x1e3f('0x9'));var ejs=require(_0x1e3f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1e3f('0xb'));var squel=require(_0x1e3f('0xc'));var crypto=require(_0x1e3f('0xd'));var jsforce=require(_0x1e3f('0xe'));var deskjs=require(_0x1e3f('0xf'));var toCsv=require(_0x1e3f('0x9'));var querystring=require(_0x1e3f('0x10'));var Papa=require(_0x1e3f('0x11'));var Redis=require(_0x1e3f('0x12'));var authService=require(_0x1e3f('0x13'));var qs=require(_0x1e3f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1e3f('0x15'));var logger=require(_0x1e3f('0x16'))(_0x1e3f('0x17'));var utils=require(_0x1e3f('0x18'));var config=require(_0x1e3f('0x19'));var licenseUtil=require(_0x1e3f('0x1a'));var db=require(_0x1e3f('0x1b'))['db'];function respondWithStatusCode(_0x1584a0,_0x3e95ac){_0x3e95ac=_0x3e95ac||0xcc;return function(_0x2e4dc7){if(_0x2e4dc7){return _0x1584a0[_0x1e3f('0x1c')](_0x3e95ac);}return _0x1584a0['status'](_0x3e95ac)['end']();};}function respondWithResult(_0x3b1ce4,_0x6b7461){_0x6b7461=_0x6b7461||0xc8;return function(_0x3ee973){if(_0x3ee973){return _0x3b1ce4[_0x1e3f('0x1d')](_0x6b7461)[_0x1e3f('0x1e')](_0x3ee973);}};}function respondWithFilteredResult(_0x20a9fe,_0x1e12cb){return function(_0x362478){if(_0x362478){var _0x5b680f=typeof _0x1e12cb[_0x1e3f('0x1f')]==='undefined'&&typeof _0x1e12cb['limit']===_0x1e3f('0x20');var _0x906b7f=_0x362478[_0x1e3f('0x21')];var _0x5d321=_0x5b680f?0x0:_0x1e12cb['offset'];var _0xe81476=_0x5b680f?_0x362478[_0x1e3f('0x21')]:_0x1e12cb[_0x1e3f('0x1f')]+_0x1e12cb[_0x1e3f('0x22')];var _0x49193c;if(_0xe81476>=_0x906b7f){_0xe81476=_0x906b7f;_0x49193c=0xc8;}else{_0x49193c=0xce;}_0x20a9fe[_0x1e3f('0x1d')](_0x49193c);return _0x20a9fe[_0x1e3f('0x23')]('Content-Range',_0x5d321+'-'+_0xe81476+'/'+_0x906b7f)[_0x1e3f('0x1e')](_0x362478);}return null;};}function patchUpdates(_0x47d445){return function(_0xd13fb0){try{jsonpatch[_0x1e3f('0x24')](_0xd13fb0,_0x47d445,!![]);}catch(_0x45d2e3){return BPromise[_0x1e3f('0x25')](_0x45d2e3);}return _0xd13fb0[_0x1e3f('0x26')]();};}function saveUpdates(_0x33c9e4,_0x35efc9){return function(_0x5cb7a0){if(_0x5cb7a0){return _0x5cb7a0[_0x1e3f('0x27')](_0x33c9e4)[_0x1e3f('0x28')](function(_0x2f9812){return _0x2f9812;});}return null;};}function removeEntity(_0x3fcc1a,_0x4c6ee0){return function(_0x14dae3){if(_0x14dae3){return _0x14dae3[_0x1e3f('0x29')]()[_0x1e3f('0x28')](function(){_0x3fcc1a[_0x1e3f('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xba8593,_0x420cdf){return function(_0x11f804){if(!_0x11f804){_0xba8593[_0x1e3f('0x1c')](0x194);}return _0x11f804;};}function handleError(_0x4a1163,_0xec922f){_0xec922f=_0xec922f||0x1f4;return function(_0x4a86b2){logger[_0x1e3f('0x2a')](_0x4a86b2['stack']);if(_0x4a86b2['name']){delete _0x4a86b2['name'];}_0x4a1163[_0x1e3f('0x1d')](_0xec922f)[_0x1e3f('0x2b')](_0x4a86b2);};}exports[_0x1e3f('0x2c')]=function(_0x36c5d2,_0x1ef2fe){var _0xe722c9={},_0x3616f5={},_0x5266d6={'count':0x0,'rows':[]};var _0x4498b9=_[_0x1e3f('0x2d')](db[_0x1e3f('0x2e')]['rawAttributes'],function(_0x3d8e80){return{'name':_0x3d8e80[_0x1e3f('0x2f')],'type':_0x3d8e80['type'][_0x1e3f('0x30')]};});_0x3616f5[_0x1e3f('0x31')]=_[_0x1e3f('0x2d')](_0x4498b9,_0x1e3f('0x32'));_0x3616f5[_0x1e3f('0x33')]=_['keys'](_0x36c5d2[_0x1e3f('0x33')]);_0x3616f5[_0x1e3f('0x34')]=_['intersection'](_0x3616f5[_0x1e3f('0x31')],_0x3616f5[_0x1e3f('0x33')]);_0xe722c9[_0x1e3f('0x35')]=_['intersection'](_0x3616f5['model'],qs[_0x1e3f('0x36')](_0x36c5d2[_0x1e3f('0x33')][_0x1e3f('0x36')]));_0xe722c9[_0x1e3f('0x35')]=_0xe722c9[_0x1e3f('0x35')]['length']?_0xe722c9[_0x1e3f('0x35')]:_0x3616f5[_0x1e3f('0x31')];if(!_0x36c5d2[_0x1e3f('0x33')][_0x1e3f('0x37')](_0x1e3f('0x38'))){_0xe722c9[_0x1e3f('0x22')]=qs[_0x1e3f('0x22')](_0x36c5d2['query'][_0x1e3f('0x22')]);_0xe722c9[_0x1e3f('0x1f')]=qs[_0x1e3f('0x1f')](_0x36c5d2[_0x1e3f('0x33')][_0x1e3f('0x1f')]);}_0xe722c9['order']=qs['sort'](_0x36c5d2['query'][_0x1e3f('0x39')]);_0xe722c9[_0x1e3f('0x3a')]=qs[_0x1e3f('0x34')](_[_0x1e3f('0x3b')](_0x36c5d2[_0x1e3f('0x33')],_0x3616f5[_0x1e3f('0x34')]),_0x4498b9);if(_0x36c5d2['query']['filter']){_0xe722c9[_0x1e3f('0x3a')]=_[_0x1e3f('0x3c')](_0xe722c9[_0x1e3f('0x3a')],{'$or':_[_0x1e3f('0x2d')](_0x4498b9,function(_0x4961da){if(_0x4961da[_0x1e3f('0x3d')]!==_0x1e3f('0x3e')){var _0x233ed6={};_0x233ed6[_0x4961da[_0x1e3f('0x32')]]={'$like':'%'+_0x36c5d2[_0x1e3f('0x33')]['filter']+'%'};return _0x233ed6;}})});}_0xe722c9=_['merge']({},_0xe722c9,_0x36c5d2[_0x1e3f('0x3f')]);var _0x450ff1={'where':_0xe722c9['where']};return db[_0x1e3f('0x2e')][_0x1e3f('0x21')](_0x450ff1)[_0x1e3f('0x28')](function(_0x36f2bc){_0x5266d6[_0x1e3f('0x21')]=_0x36f2bc;if(_0x36c5d2[_0x1e3f('0x33')][_0x1e3f('0x40')]){_0xe722c9[_0x1e3f('0x41')]=[{'all':!![]}];}return db[_0x1e3f('0x2e')][_0x1e3f('0x42')](_0xe722c9);})['then'](function(_0x53c597){_0x5266d6['rows']=_0x53c597;return _0x5266d6;})[_0x1e3f('0x28')](respondWithFilteredResult(_0x1ef2fe,_0xe722c9))[_0x1e3f('0x43')](handleError(_0x1ef2fe,null));};exports[_0x1e3f('0x44')]=function(_0x3dcbab,_0x284ff5){var _0x1e2fb9={'raw':!![],'where':{'id':_0x3dcbab[_0x1e3f('0x45')]['id']}},_0x3b59da={};_0x3b59da[_0x1e3f('0x31')]=_['keys'](db[_0x1e3f('0x2e')][_0x1e3f('0x46')]);_0x3b59da[_0x1e3f('0x33')]=_[_0x1e3f('0x47')](_0x3dcbab[_0x1e3f('0x33')]);_0x3b59da[_0x1e3f('0x34')]=_[_0x1e3f('0x48')](_0x3b59da[_0x1e3f('0x31')],_0x3b59da[_0x1e3f('0x33')]);_0x1e2fb9[_0x1e3f('0x35')]=_['intersection'](_0x3b59da[_0x1e3f('0x31')],qs['fields'](_0x3dcbab[_0x1e3f('0x33')][_0x1e3f('0x36')]));_0x1e2fb9[_0x1e3f('0x35')]=_0x1e2fb9[_0x1e3f('0x35')][_0x1e3f('0x49')]?_0x1e2fb9[_0x1e3f('0x35')]:_0x3b59da['model'];if(_0x3dcbab[_0x1e3f('0x33')][_0x1e3f('0x40')]){_0x1e2fb9['include']=[{'all':!![]}];}_0x1e2fb9=_[_0x1e3f('0x3c')]({},_0x1e2fb9,_0x3dcbab['options']);return db[_0x1e3f('0x2e')]['find'](_0x1e2fb9)[_0x1e3f('0x28')](handleEntityNotFound(_0x284ff5,null))[_0x1e3f('0x28')](respondWithResult(_0x284ff5,null))[_0x1e3f('0x43')](handleError(_0x284ff5,null));};exports[_0x1e3f('0x4a')]=function(_0x2197d2,_0x4069b4){return db[_0x1e3f('0x2e')]['create'](_0x2197d2[_0x1e3f('0x4b')],{})[_0x1e3f('0x28')](respondWithResult(_0x4069b4,0xc9))['catch'](handleError(_0x4069b4,null));};exports[_0x1e3f('0x27')]=function(_0x4565eb,_0x4c1869){if(_0x4565eb[_0x1e3f('0x4b')]['id']){delete _0x4565eb[_0x1e3f('0x4b')]['id'];}return db[_0x1e3f('0x2e')][_0x1e3f('0x4c')]({'where':{'id':_0x4565eb[_0x1e3f('0x45')]['id']}})[_0x1e3f('0x28')](handleEntityNotFound(_0x4c1869,null))[_0x1e3f('0x28')](saveUpdates(_0x4565eb['body'],null))[_0x1e3f('0x28')](respondWithResult(_0x4c1869,null))[_0x1e3f('0x43')](handleError(_0x4c1869,null));};exports[_0x1e3f('0x29')]=function(_0x4b7e03,_0x2f2c48){return db[_0x1e3f('0x2e')][_0x1e3f('0x4c')]({'where':{'id':_0x4b7e03[_0x1e3f('0x45')]['id']}})['then'](handleEntityNotFound(_0x2f2c48,null))[_0x1e3f('0x28')](removeEntity(_0x2f2c48,null))[_0x1e3f('0x43')](handleError(_0x2f2c48,null));};exports[_0x1e3f('0x4d')]=function(_0xd52b47,_0x202126){return db[_0x1e3f('0x2e')][_0x1e3f('0x4d')]()[_0x1e3f('0x28')](respondWithResult(_0x202126,null))[_0x1e3f('0x43')](handleError(_0x202126,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 65b6715..de22737 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 _0x36b2=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_call_transfer'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x36b2,0x134));var _0x236b=function(_0x208c6b,_0x390e19){_0x208c6b=_0x208c6b-0x0;var _0x3e859c=_0x36b2[_0x208c6b];return _0x3e859c;};'use strict';var _=require(_0x236b('0x0'));var util=require(_0x236b('0x1'));var logger=require('../../config/logger')(_0x236b('0x2'));var moment=require('moment');var BPromise=require(_0x236b('0x3'));var rp=require(_0x236b('0x4'));var fs=require('fs');var path=require(_0x236b('0x5'));var rimraf=require(_0x236b('0x6'));var config=require(_0x236b('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0x236b('0x8')]=function(_0x24cf0e,_0x1fb0a7){return _0x24cf0e[_0x236b('0x9')]('VoiceTransferReport',attributes,{'tableName':_0x236b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x972f=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','../../config/logger','api','moment'];(function(_0x3c9e74,_0x4334c5){var _0x4fea21=function(_0x5a2cbb){while(--_0x5a2cbb){_0x3c9e74['push'](_0x3c9e74['shift']());}};_0x4fea21(++_0x4334c5);}(_0x972f,0x1a0));var _0xf972=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x972f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf972('0x0'));var util=require('util');var logger=require(_0xf972('0x1'))(_0xf972('0x2'));var moment=require(_0xf972('0x3'));var BPromise=require(_0xf972('0x4'));var rp=require(_0xf972('0x5'));var fs=require('fs');var path=require(_0xf972('0x6'));var rimraf=require(_0xf972('0x7'));var config=require(_0xf972('0x8'));var attributes=require(_0xf972('0x9'));module[_0xf972('0xa')]=function(_0x23a080,_0x2f8f3e){return _0x23a080[_0xf972('0xb')](_0xf972('0xc'),attributes,{'tableName':_0xf972('0xd'),'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 1146bbb..24493e9 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 _0x15c1=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','error','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','body','options','raw','stringify','lodash','util','moment','bluebird'];(function(_0x2fee96,_0x2f735d){var _0x2e6ad1=function(_0x2c55ad){while(--_0x2c55ad){_0x2fee96['push'](_0x2fee96['shift']());}};_0x2e6ad1(++_0x2f735d);}(_0x15c1,0x8d));var _0x115c=function(_0x278107,_0x2b920c){_0x278107=_0x278107-0x0;var _0x9982f8=_0x15c1[_0x278107];return _0x9982f8;};'use strict';var _=require(_0x115c('0x0'));var util=require(_0x115c('0x1'));var moment=require(_0x115c('0x2'));var BPromise=require(_0x115c('0x3'));var rs=require(_0x115c('0x4'));var fs=require('fs');var Redis=require(_0x115c('0x5'));var db=require(_0x115c('0x6'))['db'];var utils=require(_0x115c('0x7'));var logger=require(_0x115c('0x8'))(_0x115c('0x9'));var config=require(_0x115c('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x115c('0xb')][_0x115c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xebaa09,_0x4488be,_0x3d70ea){return new BPromise(function(_0x5056c3,_0x5e4581){return client[_0x115c('0xd')](_0xebaa09,_0x3d70ea)[_0x115c('0xe')](function(_0x1ebdfb){logger[_0x115c('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x4488be,_0x115c('0x10'));logger[_0x115c('0x11')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x4488be,_0x115c('0x10'),JSON['stringify'](_0x1ebdfb));if(_0x1ebdfb[_0x115c('0x12')]){if(_0x1ebdfb[_0x115c('0x12')]['code']===0x1f4){logger['error'](_0x115c('0x13'),_0x4488be,_0x1ebdfb[_0x115c('0x12')]['message']);return _0x5e4581(_0x1ebdfb['error'][_0x115c('0x14')]);}logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x4488be,_0x1ebdfb[_0x115c('0x12')][_0x115c('0x14')]);return _0x5056c3(_0x1ebdfb[_0x115c('0x12')][_0x115c('0x14')]);}else{logger['info'](_0x115c('0x13'),_0x4488be,_0x115c('0x10'));_0x5056c3(_0x1ebdfb[_0x115c('0x15')][_0x115c('0x14')]);}})[_0x115c('0x16')](function(_0x25baed){logger[_0x115c('0x12')](_0x115c('0x13'),_0x4488be,_0x25baed);_0x5e4581(_0x25baed);});});}exports[_0x115c('0x17')]=function(_0x124d9a){var _0x2753c2=this;return new Promise(function(_0x4d07be,_0x45ed9b){return db[_0x115c('0x18')]['create'](_0x124d9a[_0x115c('0x19')],{'raw':_0x124d9a[_0x115c('0x1a')]?_0x124d9a['options'][_0x115c('0x1b')]===undefined?!![]:![]:!![]})[_0x115c('0xe')](function(_0x1be0e7){logger['info'](_0x115c('0x17'),_0x124d9a);logger[_0x115c('0x11')](_0x115c('0x17'),_0x124d9a,JSON[_0x115c('0x1c')](_0x1be0e7));_0x4d07be(_0x1be0e7);})[_0x115c('0x16')](function(_0x112221){logger[_0x115c('0x12')](_0x115c('0x17'),_0x112221[_0x115c('0x14')],_0x124d9a);_0x45ed9b(_0x2753c2['error'](0x1f4,_0x112221[_0x115c('0x14')]));});});}; \ No newline at end of file +var _0x8022=['error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','body','options','raw','debug','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5021ab,_0x2b9740){var _0x49df1a=function(_0x19f772){while(--_0x19f772){_0x5021ab['push'](_0x5021ab['shift']());}};_0x49df1a(++_0x2b9740);}(_0x8022,0x14b));var _0x2802=function(_0x287d9b,_0x5ca28f){_0x287d9b=_0x287d9b-0x0;var _0x39e46f=_0x8022[_0x287d9b];return _0x39e46f;};'use strict';var _=require(_0x2802('0x0'));var util=require('util');var moment=require(_0x2802('0x1'));var BPromise=require(_0x2802('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2802('0x3'));var db=require(_0x2802('0x4'))['db'];var utils=require(_0x2802('0x5'));var logger=require(_0x2802('0x6'))(_0x2802('0x7'));var config=require(_0x2802('0x8'));var jayson=require(_0x2802('0x9'));var client=jayson[_0x2802('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45123f,_0x33f87b,_0x3ed11d){return new BPromise(function(_0x601fe3,_0x5b8c72){return client[_0x2802('0xb')](_0x45123f,_0x3ed11d)[_0x2802('0xc')](function(_0x250fec){logger[_0x2802('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x33f87b,_0x2802('0xe'));logger['debug'](_0x2802('0xf'),_0x33f87b,'request\x20sent',JSON[_0x2802('0x10')](_0x250fec));if(_0x250fec[_0x2802('0x11')]){if(_0x250fec[_0x2802('0x11')][_0x2802('0x12')]===0x1f4){logger[_0x2802('0x11')](_0x2802('0x13'),_0x33f87b,_0x250fec[_0x2802('0x11')][_0x2802('0x14')]);return _0x5b8c72(_0x250fec[_0x2802('0x11')][_0x2802('0x14')]);}logger[_0x2802('0x11')](_0x2802('0x13'),_0x33f87b,_0x250fec[_0x2802('0x11')][_0x2802('0x14')]);return _0x601fe3(_0x250fec[_0x2802('0x11')][_0x2802('0x14')]);}else{logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x33f87b,_0x2802('0xe'));_0x601fe3(_0x250fec[_0x2802('0x15')][_0x2802('0x14')]);}})[_0x2802('0x16')](function(_0x285f80){logger[_0x2802('0x11')](_0x2802('0x13'),_0x33f87b,_0x285f80);_0x5b8c72(_0x285f80);});});}exports[_0x2802('0x17')]=function(_0x57998d){var _0x2163c8=this;return new Promise(function(_0x59aefc,_0x513dc6){return db[_0x2802('0x18')]['create'](_0x57998d[_0x2802('0x19')],{'raw':_0x57998d[_0x2802('0x1a')]?_0x57998d['options'][_0x2802('0x1b')]===undefined?!![]:![]:!![]})[_0x2802('0xc')](function(_0x2296d7){logger['info'](_0x2802('0x17'),_0x57998d);logger[_0x2802('0x1c')](_0x2802('0x17'),_0x57998d,JSON['stringify'](_0x2296d7));_0x59aefc(_0x2296d7);})[_0x2802('0x16')](function(_0xef5450){logger[_0x2802('0x11')](_0x2802('0x17'),_0xef5450['message'],_0x57998d);_0x513dc6(_0x2163c8[_0x2802('0x11')](0x1f4,_0xef5450[_0x2802('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 7b09a1c..3b192be 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 _0x9a19=['hangup','answer','hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup'];(function(_0x146249,_0x2b4b50){var _0xe39b4a=function(_0xd5943d){while(--_0xd5943d){_0x146249['push'](_0x146249['shift']());}};_0xe39b4a(++_0x2b4b50);}(_0x9a19,0x114));var _0x99a1=function(_0x41c381,_0x1176bd){_0x41c381=_0x41c381-0x0;var _0x427981=_0x9a19[_0x41c381];return _0x427981;};'use strict';var express=require(_0x99a1('0x0'));var router=express[_0x99a1('0x1')]();var auth=require(_0x99a1('0x2'));var controller=require('./webbar.controller');router[_0x99a1('0x3')](_0x99a1('0x4'),auth[_0x99a1('0x5')](),auth[_0x99a1('0x6')](),controller[_0x99a1('0x7')]);router[_0x99a1('0x3')](_0x99a1('0x8'),auth[_0x99a1('0x5')](),auth[_0x99a1('0x6')](),controller[_0x99a1('0x9')]);router[_0x99a1('0x3')]('/answer',auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x99a1('0xa')]);router[_0x99a1('0x3')]('/hold',auth['isAuthenticated'](),auth[_0x99a1('0x6')](),controller[_0x99a1('0xb')]);router[_0x99a1('0x3')](_0x99a1('0xc'),auth[_0x99a1('0x5')](),auth['isWebrtcLicence'](),controller[_0x99a1('0xd')]);router[_0x99a1('0x3')](_0x99a1('0xe'),auth[_0x99a1('0x5')](),auth[_0x99a1('0x6')](),controller[_0x99a1('0xf')]);router[_0x99a1('0x3')](_0x99a1('0x10'),auth[_0x99a1('0x5')](),auth[_0x99a1('0x6')](),controller[_0x99a1('0x11')]);module[_0x99a1('0x12')]=router; \ No newline at end of file +var _0x9c44=['/answer','answer','/hold','/unhold','unhold','/transfer','transfer','exports','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','/hangup','hangup'];(function(_0x55a89e,_0x1a05ab){var _0x3aa2bd=function(_0x4b9d09){while(--_0x4b9d09){_0x55a89e['push'](_0x55a89e['shift']());}};_0x3aa2bd(++_0x1a05ab);}(_0x9c44,0x178));var _0x49c4=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9c44[_0x5d2803];return _0xdcad2c;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x49c4('0x0'));var controller=require(_0x49c4('0x1'));router[_0x49c4('0x2')](_0x49c4('0x3'),auth[_0x49c4('0x4')](),auth[_0x49c4('0x5')](),controller['originate']);router['post'](_0x49c4('0x6'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0x7')]);router[_0x49c4('0x2')](_0x49c4('0x8'),auth[_0x49c4('0x4')](),auth['isWebrtcLicence'](),controller[_0x49c4('0x9')]);router[_0x49c4('0x2')](_0x49c4('0xa'),auth[_0x49c4('0x4')](),auth['isWebrtcLicence'](),controller['hold']);router[_0x49c4('0x2')](_0x49c4('0xb'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0xc')]);router['post']('/calls',auth[_0x49c4('0x4')](),auth[_0x49c4('0x5')](),controller['calls']);router[_0x49c4('0x2')](_0x49c4('0xd'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0xe')]);module[_0x49c4('0xf')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 835ca7b..f24dc0f 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 _0xbe02=['unhold','unhold\x20fired:','unhold\x20executed!','calls\x20fired:','rows','webbar:conference','conference\x20executed!','transfer','transferNumber','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','socket.io-emitter','validate','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','request','then','code','message','result','catch','User','agent','VoiceChannels','all','filter','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','callNumber','callbackUrl','entityFound:','format','user:%s','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','userId','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!'];(function(_0x916f6e,_0x1b538e){var _0x589dac=function(_0x56b1e1){while(--_0x56b1e1){_0x916f6e['push'](_0x916f6e['shift']());}};_0x589dac(++_0x1b538e);}(_0xbe02,0x146));var _0x2be0=function(_0xd7b516,_0x1eabab){_0xd7b516=_0xd7b516-0x0;var _0x1c5830=_0xbe02[_0xd7b516];return _0x1c5830;};'use strict';var path=require(_0x2be0('0x0'));var fs=require('fs');var _=require(_0x2be0('0x1'));var db=require(_0x2be0('0x2'))['db'];var config=require(_0x2be0('0x3'));var util=require('util');var BPromise=require(_0x2be0('0x4'));var jayson=require(_0x2be0('0x5'));var amiClient=jayson[_0x2be0('0x6')][_0x2be0('0x7')]({'port':0x232a});var logger=require(_0x2be0('0x8'))(_0x2be0('0x9'));var Redis=require(_0x2be0('0xa'));config[_0x2be0('0xb')]=_[_0x2be0('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x2be0('0xd'))(new Redis(config[_0x2be0('0xb')]));var Schema=require(_0x2be0('0xe'));var originateValidation=new Schema({'userId':{'type':_0x2be0('0xf'),'required':[!![],_0x2be0('0x10')]},'callNumber':{'type':_0x2be0('0x11'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':'string'},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x2be0('0xf'),'required':[!![],_0x2be0('0x10')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x2be0('0xf'),'required':[!![],_0x2be0('0x10')]},'sessionId':{'type':_0x2be0('0x11'),'required':[!![],_0x2be0('0x12')]},'transferNumber':{'type':_0x2be0('0x11'),'required':[!![],_0x2be0('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0x2be0('0xf'),'required':[!![],_0x2be0('0x10')]},'sessionId':{'type':_0x2be0('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x2be0('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x2be0('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x2be0('0xf'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x2be0('0xf'),'required':[!![],_0x2be0('0x10')]}});function emit(_0x5bcbc5,_0x334070,_0x30d623){logger[_0x2be0('0x14')](_0x5bcbc5,_0x334070,JSON[_0x2be0('0x15')](_0x30d623));io['to'](_0x5bcbc5)[_0x2be0('0x16')](_0x334070,_0x30d623);}function handleError(_0x1ae700){return function(_0x48d386){console[_0x2be0('0x17')](_0x2be0('0x18'),_0x48d386,_0x48d386 instanceof RangeError);logger[_0x2be0('0x19')](_0x48d386[_0x2be0('0x1a')]);if(_0x48d386 instanceof RangeError){if(_0x48d386[_0x2be0('0x1b')]){delete _0x48d386[_0x2be0('0x1b')];}_0x1ae700[_0x2be0('0x1c')](0x194)[_0x2be0('0x1d')](_0x48d386);}else{if(_0x48d386[_0x2be0('0x1b')]){delete _0x48d386[_0x2be0('0x1b')];}_0x1ae700['status'](0x1f4)['send'](_0x48d386);}};}function checkError(){return function(_0x3292af){if(!_0x3292af){throw new RangeError('NotFound');}return _0x3292af;};}function respondWithRpcPromise(_0x5d1a32,_0x40cc4d){return new BPromise(function(_0x4d2c62,_0x2da0d5){var _0x2b3f88=amiClient;return _0x2b3f88[_0x2be0('0x1e')](_0x5d1a32,_0x40cc4d)[_0x2be0('0x1f')](function(_0x105fa6){if(_0x105fa6[_0x2be0('0x19')]){if(_0x105fa6['error'][_0x2be0('0x20')]===0x1f4){return _0x2da0d5(_0x105fa6['error']['message']);}return _0x4d2c62(_0x105fa6[_0x2be0('0x19')][_0x2be0('0x21')]);}else{_0x4d2c62(_0x105fa6[_0x2be0('0x22')]);}})[_0x2be0('0x23')](function(_0x3fb87f){_0x2da0d5(_0x3fb87f);});});}function getAgent(_0x4b5f21){return db[_0x2be0('0x24')]['findOne']({'where':{'id':_0x4b5f21,'role':_0x2be0('0x25')}})[_0x2be0('0x1f')](checkError());}function getAgentCheckSession(_0x559a66,_0x5260d3){return new BPromise(function(_0x1fd3eb,_0x20f866){var _0x4bdf61=respondWithRpcPromise(_0x2be0('0x26'));var _0x36b490=getAgent(_0x559a66);Promise[_0x2be0('0x27')]([_0x4bdf61,_0x36b490])[_0x2be0('0x1f')](function(_0x3b97c0){var _0x4184e4=_0x3b97c0[0x0];var _0x463fd5=_0x3b97c0[0x1];var _0x58846a=_[_0x2be0('0x28')](_0x4184e4['rows'],function(_0x11abcf){return _0x11abcf[_0x2be0('0x29')]==_0x463fd5['id']&&_0x11abcf[_0x2be0('0x2a')]==_0x5260d3;});if(_0x58846a[_0x2be0('0x2b')]==0x1){_0x1fd3eb(_0x463fd5);}else{_0x20f866(new RangeError(_0x2be0('0x2c')+_0x5260d3+_0x2be0('0x2d')));}});});}exports[_0x2be0('0x2e')]=function(_0x5191e6,_0x121e5b){logger[_0x2be0('0x14')](_0x2be0('0x2f'),_0x5191e6[_0x2be0('0x30')]);var _0x101114=originateValidation['validate'](_0x5191e6[_0x2be0('0x30')]);if(_0x101114[_0x2be0('0x2b')]>0x0){return _0x121e5b[_0x2be0('0x1c')](0x190)[_0x2be0('0x31')](_0x101114);}var _0x779ef2=_0x5191e6['body']['userId'];var _0x22458d=_0x5191e6[_0x2be0('0x30')][_0x2be0('0x32')];var _0x5a53ac=_0x5191e6['body']['callerId'];var _0x41afcb=_0x5191e6[_0x2be0('0x30')][_0x2be0('0x33')];return getAgent(_0x779ef2)[_0x2be0('0x1f')](function(_0x3c7227){logger[_0x2be0('0x14')](_0x2be0('0x34'),_0x3c7227[_0x2be0('0x1b')]);emit(util[_0x2be0('0x35')](_0x2be0('0x36'),_0x3c7227[_0x2be0('0x1b')]),'webbar:originate',{'callNumber':_0x22458d,'callerId':_0x5a53ac,'callbackUrl':_0x41afcb});return _0x121e5b[_0x2be0('0x1c')](0xc8)[_0x2be0('0x31')]({'error':![],'message':_0x2be0('0x37')});})[_0x2be0('0x23')](handleError(_0x121e5b));};exports[_0x2be0('0x38')]=function(_0x565623,_0x27d35e){logger[_0x2be0('0x14')](_0x2be0('0x39'),_0x565623['body']);var _0x1123bc=hangupValidation['validate'](_0x565623[_0x2be0('0x30')]);if(_0x1123bc['length']>0x0){return _0x27d35e['status'](0x190)[_0x2be0('0x31')](_0x1123bc);}var _0x4d6ccf=_0x565623[_0x2be0('0x30')]['userId'];var _0x3017c4=_0x565623['body'][_0x2be0('0x2a')];return getAgent(_0x4d6ccf)[_0x2be0('0x1f')](function(_0xa4d6f0){logger['info'](_0x2be0('0x34'),_0xa4d6f0['name']);emit(util[_0x2be0('0x35')](_0x2be0('0x36'),_0xa4d6f0[_0x2be0('0x1b')]),_0x2be0('0x3a'),{'sessionId':_0x3017c4});return _0x27d35e[_0x2be0('0x1c')](0xc8)[_0x2be0('0x31')]({'error':![],'message':_0x2be0('0x3b')});})[_0x2be0('0x23')](handleError(_0x27d35e));};exports[_0x2be0('0x3c')]=function(_0x1d7540,_0xa1f755){logger[_0x2be0('0x14')](_0x2be0('0x3d'),_0x1d7540[_0x2be0('0x30')]);var _0x1c669d=answerValidation['validate'](_0x1d7540[_0x2be0('0x30')]);if(_0x1c669d['length']>0x0){return _0xa1f755[_0x2be0('0x1c')](0x190)[_0x2be0('0x31')](_0x1c669d);}var _0x20869a=_0x1d7540[_0x2be0('0x30')][_0x2be0('0x3e')];var _0x35eea1=_0x1d7540[_0x2be0('0x30')]['sessionId'];return getAgent(_0x20869a)[_0x2be0('0x1f')](function(_0x268d24){logger[_0x2be0('0x14')](_0x2be0('0x34'),_0x268d24[_0x2be0('0x1b')]);emit(util['format'](_0x2be0('0x36'),_0x268d24['name']),_0x2be0('0x3f'),{'sessionId':_0x35eea1});return _0xa1f755[_0x2be0('0x1c')](0xc8)[_0x2be0('0x31')]({'error':![],'message':_0x2be0('0x40')});})[_0x2be0('0x23')](handleError(_0xa1f755));};exports[_0x2be0('0x41')]=function(_0x5ed58e,_0x2d3a11){logger['info'](_0x2be0('0x42'),_0x5ed58e[_0x2be0('0x30')]);var _0x5b78a1=holdValidation[_0x2be0('0xe')](_0x5ed58e[_0x2be0('0x30')]);if(_0x5b78a1[_0x2be0('0x2b')]>0x0){return _0x2d3a11[_0x2be0('0x1c')](0x190)[_0x2be0('0x31')](_0x5b78a1);}var _0x59bb83=_0x5ed58e['body'][_0x2be0('0x3e')];var _0x362915=_0x5ed58e['body']['sessionId'];return getAgent(_0x59bb83)[_0x2be0('0x1f')](function(_0x3e6f94){logger[_0x2be0('0x14')](_0x2be0('0x34'),_0x3e6f94['name']);emit(util[_0x2be0('0x35')](_0x2be0('0x36'),_0x3e6f94[_0x2be0('0x1b')]),_0x2be0('0x43'),{'sessionId':_0x362915});return _0x2d3a11[_0x2be0('0x1c')](0xc8)[_0x2be0('0x31')]({'error':![],'message':_0x2be0('0x44')});})['catch'](handleError(_0x2d3a11));};exports[_0x2be0('0x45')]=function(_0x400f59,_0x52dd0c){logger[_0x2be0('0x14')](_0x2be0('0x46'),_0x400f59[_0x2be0('0x30')]);var _0x556235=unholdValidation[_0x2be0('0xe')](_0x400f59[_0x2be0('0x30')]);if(_0x556235[_0x2be0('0x2b')]>0x0){return _0x52dd0c[_0x2be0('0x1c')](0x190)[_0x2be0('0x31')](_0x556235);}var _0x1b7c41=_0x400f59[_0x2be0('0x30')][_0x2be0('0x3e')];var _0x2835b4=_0x400f59['body'][_0x2be0('0x2a')];return getAgent(_0x1b7c41)[_0x2be0('0x1f')](function(_0xc33e5b){logger[_0x2be0('0x14')]('entityFound:',_0xc33e5b[_0x2be0('0x1b')]);emit(util['format'](_0x2be0('0x36'),_0xc33e5b[_0x2be0('0x1b')]),'webbar:unhold',{'sessionId':_0x2835b4});return _0x52dd0c[_0x2be0('0x1c')](0xc8)['json']({'error':![],'message':_0x2be0('0x47')});})[_0x2be0('0x23')](handleError(_0x52dd0c));};exports['calls']=function(_0xa641d7,_0x24a64a){logger[_0x2be0('0x14')](_0x2be0('0x48'),_0x24a64a[_0x2be0('0x30')]);var _0x210df5=callsValidation[_0x2be0('0xe')](_0xa641d7[_0x2be0('0x30')]);if(_0x210df5[_0x2be0('0x2b')]>0x0){return _0x24a64a['status'](0x190)[_0x2be0('0x31')](_0x210df5);}var _0x3cb80b=_0xa641d7[_0x2be0('0x30')]['userId'];var _0x38278b=respondWithRpcPromise(_0x2be0('0x26'));var _0x2ec0dc=getAgent(_0x3cb80b);return Promise[_0x2be0('0x27')]([_0x38278b,_0x2ec0dc])[_0x2be0('0x1f')](function(_0x126eda){var _0x328a16=_0x126eda[0x0];var _0x4c3e21=_0x126eda[0x1];var _0x43e76a=_[_0x2be0('0x28')](_0x328a16[_0x2be0('0x49')],function(_0x2152a1){return _0x2152a1[_0x2be0('0x29')]==_0x4c3e21['id'];});return _0x24a64a[_0x2be0('0x1c')](0xc8)['json']({'count':_0x43e76a[_0x2be0('0x2b')],'rows':_0x43e76a});})['catch'](handleError(_0x24a64a));};exports['conference']=function(_0x2d2e79,_0x3c1967){logger[_0x2be0('0x14')]('conference\x20fired:',_0x2d2e79[_0x2be0('0x30')]);var _0x436d7a=conferenceValidation[_0x2be0('0xe')](_0x2d2e79[_0x2be0('0x30')]);if(_0x436d7a[_0x2be0('0x2b')]>0x0){return _0x3c1967['status'](0x190)[_0x2be0('0x31')](_0x436d7a);}var _0x2553e0=_0x2d2e79[_0x2be0('0x30')][_0x2be0('0x3e')];return getAgent(_0x2553e0)[_0x2be0('0x1f')](function(_0x27b8e6){logger[_0x2be0('0x14')](_0x2be0('0x34'),_0x27b8e6[_0x2be0('0x1b')]);emit(util[_0x2be0('0x35')](_0x2be0('0x36'),_0x27b8e6['name']),_0x2be0('0x4a'));return _0x3c1967[_0x2be0('0x1c')](0xc8)['json']({'error':![],'message':_0x2be0('0x4b')});})[_0x2be0('0x23')](handleError(_0x3c1967));};exports[_0x2be0('0x4c')]=function(_0x32ed3a,_0x2f733a){logger['info']('transfer\x20fired:',_0x32ed3a[_0x2be0('0x30')]);var _0x3a0154=transferValidation[_0x2be0('0xe')](_0x32ed3a['body']);if(_0x3a0154[_0x2be0('0x2b')]>0x0){return _0x2f733a[_0x2be0('0x1c')](0x190)[_0x2be0('0x31')](_0x3a0154);}var _0xc34958=_0x32ed3a[_0x2be0('0x30')][_0x2be0('0x3e')];var _0xc10295=_0x32ed3a[_0x2be0('0x30')][_0x2be0('0x2a')];var _0x435a14=_0x32ed3a[_0x2be0('0x30')][_0x2be0('0x4d')];return getAgent(_0xc34958)[_0x2be0('0x1f')](function(_0x10e9a7){logger['info'](_0x2be0('0x34'),_0x10e9a7[_0x2be0('0x1b')]);emit(util[_0x2be0('0x35')](_0x2be0('0x36'),_0x10e9a7['name']),'webbar:transfer',{'sessionId':_0xc10295,'transferNumber':_0x435a14});return _0x2f733a[_0x2be0('0x1c')](0xc8)[_0x2be0('0x31')]({'error':![],'message':_0x2be0('0x4e')});})[_0x2be0('0x23')](handleError(_0x2f733a));}; \ No newline at end of file +var _0xd58c=['hangup\x20fired:','length','webbar:hangup','answer','entityFound:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','VoiceChannels','all','filter','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','util','jayson/promise','http','../../config/logger','webbarapi','ioredis','redis','localhost','socket.io-emitter','validate','number','string','callNumber\x20is\x20required','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','handleError:','error','stack','name','status','send','request','code','message','findOne','then','rows','UserId','sessionId','sessionId\x20','originate','originate\x20fired:','body','json','userId','callerId','callbackUrl','format','user:%s','webbar:originate','originate\x20executed!','catch','hangup'];(function(_0x3d0113,_0x1c3a5f){var _0x40d13b=function(_0x26cf73){while(--_0x26cf73){_0x3d0113['push'](_0x3d0113['shift']());}};_0x40d13b(++_0x1c3a5f);}(_0xd58c,0xb6));var _0xcd58=function(_0x59117c,_0x29cf2a){_0x59117c=_0x59117c-0x0;var _0x397d95=_0xd58c[_0x59117c];return _0x397d95;};'use strict';var path=require(_0xcd58('0x0'));var fs=require('fs');var _=require(_0xcd58('0x1'));var db=require(_0xcd58('0x2'))['db'];var config=require('../../config/environment');var util=require(_0xcd58('0x3'));var BPromise=require('bluebird');var jayson=require(_0xcd58('0x4'));var amiClient=jayson['client'][_0xcd58('0x5')]({'port':0x232a});var logger=require(_0xcd58('0x6'))(_0xcd58('0x7'));var Redis=require(_0xcd58('0x8'));config[_0xcd58('0x9')]=_['defaults'](config['redis'],{'host':_0xcd58('0xa'),'port':0x18eb});var io=require(_0xcd58('0xb'))(new Redis(config[_0xcd58('0x9')]));var Schema=require(_0xcd58('0xc'));var originateValidation=new Schema({'userId':{'type':_0xcd58('0xd'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xcd58('0xe'),'required':[!![],_0xcd58('0xf')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xcd58('0xe')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0xcd58('0x10')]},'sessionId':{'type':_0xcd58('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xcd58('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xcd58('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0xcd58('0x10')]},'sessionId':{'type':'string','required':[!![],_0xcd58('0x11')]},'transferNumber':{'type':_0xcd58('0xe'),'required':[!![],_0xcd58('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0xcd58('0xd'),'required':[!![],_0xcd58('0x10')]},'sessionId':{'type':_0xcd58('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xcd58('0xd'),'required':[!![],_0xcd58('0x10')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xcd58('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0xcd58('0xd'),'required':[!![],_0xcd58('0x10')]}});function emit(_0x51f5b6,_0x515fc3,_0xea2532){logger[_0xcd58('0x13')](_0x51f5b6,_0x515fc3,JSON[_0xcd58('0x14')](_0xea2532));io['to'](_0x51f5b6)['emit'](_0x515fc3,_0xea2532);}function handleError(_0x4e9b76){return function(_0x3686ad){console['log'](_0xcd58('0x15'),_0x3686ad,_0x3686ad instanceof RangeError);logger[_0xcd58('0x16')](_0x3686ad[_0xcd58('0x17')]);if(_0x3686ad instanceof RangeError){if(_0x3686ad[_0xcd58('0x18')]){delete _0x3686ad['name'];}_0x4e9b76[_0xcd58('0x19')](0x194)['send'](_0x3686ad);}else{if(_0x3686ad['name']){delete _0x3686ad['name'];}_0x4e9b76[_0xcd58('0x19')](0x1f4)[_0xcd58('0x1a')](_0x3686ad);}};}function checkError(){return function(_0x44b002){if(!_0x44b002){throw new RangeError('NotFound');}return _0x44b002;};}function respondWithRpcPromise(_0xb7325f,_0x2a8681){return new BPromise(function(_0x5c241c,_0x18f953){var _0x1765d3=amiClient;return _0x1765d3[_0xcd58('0x1b')](_0xb7325f,_0x2a8681)['then'](function(_0x566d56){if(_0x566d56[_0xcd58('0x16')]){if(_0x566d56[_0xcd58('0x16')][_0xcd58('0x1c')]===0x1f4){return _0x18f953(_0x566d56[_0xcd58('0x16')][_0xcd58('0x1d')]);}return _0x5c241c(_0x566d56[_0xcd58('0x16')][_0xcd58('0x1d')]);}else{_0x5c241c(_0x566d56['result']);}})['catch'](function(_0x19010d){_0x18f953(_0x19010d);});});}function getAgent(_0xaa4a53){return db['User'][_0xcd58('0x1e')]({'where':{'id':_0xaa4a53,'role':'agent'}})[_0xcd58('0x1f')](checkError());}function getAgentCheckSession(_0x2ec6b1,_0x75bb8e){return new BPromise(function(_0x1784ff,_0x2b64b8){var _0x30cf55=respondWithRpcPromise('VoiceChannels');var _0x1c369f=getAgent(_0x2ec6b1);Promise['all']([_0x30cf55,_0x1c369f])[_0xcd58('0x1f')](function(_0x5e1b62){var _0x34d063=_0x5e1b62[0x0];var _0x55c551=_0x5e1b62[0x1];var _0x3499c4=_['filter'](_0x34d063[_0xcd58('0x20')],function(_0x5871da){return _0x5871da[_0xcd58('0x21')]==_0x55c551['id']&&_0x5871da[_0xcd58('0x22')]==_0x75bb8e;});if(_0x3499c4['length']==0x1){_0x1784ff(_0x55c551);}else{_0x2b64b8(new RangeError(_0xcd58('0x23')+_0x75bb8e+'\x20not\x20found!'));}});});}exports[_0xcd58('0x24')]=function(_0x3852c8,_0x2a7ce1){logger[_0xcd58('0x13')](_0xcd58('0x25'),_0x3852c8[_0xcd58('0x26')]);var _0x5b5d90=originateValidation['validate'](_0x3852c8[_0xcd58('0x26')]);if(_0x5b5d90['length']>0x0){return _0x2a7ce1['status'](0x190)[_0xcd58('0x27')](_0x5b5d90);}var _0x3ef48e=_0x3852c8[_0xcd58('0x26')][_0xcd58('0x28')];var _0xd5fc97=_0x3852c8[_0xcd58('0x26')]['callNumber'];var _0x535ad4=_0x3852c8[_0xcd58('0x26')][_0xcd58('0x29')];var _0x1c1ce4=_0x3852c8['body'][_0xcd58('0x2a')];return getAgent(_0x3ef48e)[_0xcd58('0x1f')](function(_0x6a7872){logger['info']('entityFound:',_0x6a7872[_0xcd58('0x18')]);emit(util[_0xcd58('0x2b')](_0xcd58('0x2c'),_0x6a7872[_0xcd58('0x18')]),_0xcd58('0x2d'),{'callNumber':_0xd5fc97,'callerId':_0x535ad4,'callbackUrl':_0x1c1ce4});return _0x2a7ce1[_0xcd58('0x19')](0xc8)[_0xcd58('0x27')]({'error':![],'message':_0xcd58('0x2e')});})[_0xcd58('0x2f')](handleError(_0x2a7ce1));};exports[_0xcd58('0x30')]=function(_0x455ce1,_0x37e840){logger[_0xcd58('0x13')](_0xcd58('0x31'),_0x455ce1[_0xcd58('0x26')]);var _0x1139c2=hangupValidation[_0xcd58('0xc')](_0x455ce1[_0xcd58('0x26')]);if(_0x1139c2[_0xcd58('0x32')]>0x0){return _0x37e840[_0xcd58('0x19')](0x190)[_0xcd58('0x27')](_0x1139c2);}var _0x5cd1eb=_0x455ce1[_0xcd58('0x26')][_0xcd58('0x28')];var _0x464158=_0x455ce1['body'][_0xcd58('0x22')];return getAgent(_0x5cd1eb)[_0xcd58('0x1f')](function(_0x4ced85){logger[_0xcd58('0x13')]('entityFound:',_0x4ced85['name']);emit(util[_0xcd58('0x2b')]('user:%s',_0x4ced85['name']),_0xcd58('0x33'),{'sessionId':_0x464158});return _0x37e840[_0xcd58('0x19')](0xc8)[_0xcd58('0x27')]({'error':![],'message':'hangup\x20executed!'});})['catch'](handleError(_0x37e840));};exports[_0xcd58('0x34')]=function(_0x55fdf9,_0x3ab135){logger[_0xcd58('0x13')]('answer\x20fired:',_0x55fdf9['body']);var _0x1f5e98=answerValidation[_0xcd58('0xc')](_0x55fdf9[_0xcd58('0x26')]);if(_0x1f5e98[_0xcd58('0x32')]>0x0){return _0x3ab135[_0xcd58('0x19')](0x190)[_0xcd58('0x27')](_0x1f5e98);}var _0x14a574=_0x55fdf9[_0xcd58('0x26')][_0xcd58('0x28')];var _0x297478=_0x55fdf9[_0xcd58('0x26')][_0xcd58('0x22')];return getAgent(_0x14a574)[_0xcd58('0x1f')](function(_0x503ee3){logger[_0xcd58('0x13')](_0xcd58('0x35'),_0x503ee3[_0xcd58('0x18')]);emit(util['format'](_0xcd58('0x2c'),_0x503ee3[_0xcd58('0x18')]),_0xcd58('0x36'),{'sessionId':_0x297478});return _0x3ab135[_0xcd58('0x19')](0xc8)['json']({'error':![],'message':_0xcd58('0x37')});})[_0xcd58('0x2f')](handleError(_0x3ab135));};exports[_0xcd58('0x38')]=function(_0x13e0cb,_0x3aa129){logger[_0xcd58('0x13')](_0xcd58('0x39'),_0x13e0cb[_0xcd58('0x26')]);var _0x452e7e=holdValidation[_0xcd58('0xc')](_0x13e0cb['body']);if(_0x452e7e[_0xcd58('0x32')]>0x0){return _0x3aa129[_0xcd58('0x19')](0x190)[_0xcd58('0x27')](_0x452e7e);}var _0x1ead66=_0x13e0cb[_0xcd58('0x26')][_0xcd58('0x28')];var _0x11aa04=_0x13e0cb[_0xcd58('0x26')][_0xcd58('0x22')];return getAgent(_0x1ead66)[_0xcd58('0x1f')](function(_0x1416fa){logger[_0xcd58('0x13')]('entityFound:',_0x1416fa[_0xcd58('0x18')]);emit(util[_0xcd58('0x2b')]('user:%s',_0x1416fa[_0xcd58('0x18')]),_0xcd58('0x3a'),{'sessionId':_0x11aa04});return _0x3aa129[_0xcd58('0x19')](0xc8)[_0xcd58('0x27')]({'error':![],'message':_0xcd58('0x3b')});})[_0xcd58('0x2f')](handleError(_0x3aa129));};exports['unhold']=function(_0x51735b,_0x8a5d52){logger['info'](_0xcd58('0x3c'),_0x51735b[_0xcd58('0x26')]);var _0x3eb747=unholdValidation[_0xcd58('0xc')](_0x51735b['body']);if(_0x3eb747['length']>0x0){return _0x8a5d52[_0xcd58('0x19')](0x190)['json'](_0x3eb747);}var _0x4972b7=_0x51735b[_0xcd58('0x26')][_0xcd58('0x28')];var _0x361422=_0x51735b[_0xcd58('0x26')]['sessionId'];return getAgent(_0x4972b7)[_0xcd58('0x1f')](function(_0x5530f3){logger['info'](_0xcd58('0x35'),_0x5530f3[_0xcd58('0x18')]);emit(util['format'](_0xcd58('0x2c'),_0x5530f3['name']),_0xcd58('0x3d'),{'sessionId':_0x361422});return _0x8a5d52[_0xcd58('0x19')](0xc8)[_0xcd58('0x27')]({'error':![],'message':_0xcd58('0x3e')});})[_0xcd58('0x2f')](handleError(_0x8a5d52));};exports[_0xcd58('0x3f')]=function(_0x2e4157,_0xe1a29a){logger[_0xcd58('0x13')](_0xcd58('0x40'),_0xe1a29a[_0xcd58('0x26')]);var _0x2220af=callsValidation['validate'](_0x2e4157[_0xcd58('0x26')]);if(_0x2220af['length']>0x0){return _0xe1a29a[_0xcd58('0x19')](0x190)[_0xcd58('0x27')](_0x2220af);}var _0x13df99=_0x2e4157[_0xcd58('0x26')]['userId'];var _0x3d2fe7=respondWithRpcPromise(_0xcd58('0x41'));var _0x458157=getAgent(_0x13df99);return Promise[_0xcd58('0x42')]([_0x3d2fe7,_0x458157])['then'](function(_0x5ab979){var _0x2bd97b=_0x5ab979[0x0];var _0x386388=_0x5ab979[0x1];var _0x418fb5=_[_0xcd58('0x43')](_0x2bd97b[_0xcd58('0x20')],function(_0x10cf46){return _0x10cf46[_0xcd58('0x21')]==_0x386388['id'];});return _0xe1a29a['status'](0xc8)[_0xcd58('0x27')]({'count':_0x418fb5[_0xcd58('0x32')],'rows':_0x418fb5});})[_0xcd58('0x2f')](handleError(_0xe1a29a));};exports[_0xcd58('0x44')]=function(_0x3a4699,_0x29f03b){logger[_0xcd58('0x13')](_0xcd58('0x45'),_0x3a4699[_0xcd58('0x26')]);var _0x2d16d0=conferenceValidation[_0xcd58('0xc')](_0x3a4699[_0xcd58('0x26')]);if(_0x2d16d0[_0xcd58('0x32')]>0x0){return _0x29f03b[_0xcd58('0x19')](0x190)[_0xcd58('0x27')](_0x2d16d0);}var _0x322466=_0x3a4699[_0xcd58('0x26')]['userId'];return getAgent(_0x322466)[_0xcd58('0x1f')](function(_0x183762){logger[_0xcd58('0x13')](_0xcd58('0x35'),_0x183762['name']);emit(util[_0xcd58('0x2b')](_0xcd58('0x2c'),_0x183762[_0xcd58('0x18')]),_0xcd58('0x46'));return _0x29f03b[_0xcd58('0x19')](0xc8)['json']({'error':![],'message':_0xcd58('0x47')});})[_0xcd58('0x2f')](handleError(_0x29f03b));};exports[_0xcd58('0x48')]=function(_0x1cc739,_0x3a13ab){logger[_0xcd58('0x13')](_0xcd58('0x49'),_0x1cc739[_0xcd58('0x26')]);var _0x2729dd=transferValidation[_0xcd58('0xc')](_0x1cc739['body']);if(_0x2729dd['length']>0x0){return _0x3a13ab[_0xcd58('0x19')](0x190)[_0xcd58('0x27')](_0x2729dd);}var _0x5913b2=_0x1cc739['body'][_0xcd58('0x28')];var _0x19887d=_0x1cc739['body'][_0xcd58('0x22')];var _0x29d4a4=_0x1cc739[_0xcd58('0x26')][_0xcd58('0x4a')];return getAgent(_0x5913b2)[_0xcd58('0x1f')](function(_0x3c3f38){logger[_0xcd58('0x13')](_0xcd58('0x35'),_0x3c3f38['name']);emit(util['format'](_0xcd58('0x2c'),_0x3c3f38['name']),_0xcd58('0x4b'),{'sessionId':_0x19887d,'transferNumber':_0x29d4a4});return _0x3a13ab['status'](0xc8)[_0xcd58('0x27')]({'error':![],'message':_0xcd58('0x4c')});})[_0xcd58('0x2f')](handleError(_0x3a13ab));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 58001df..64d79a7 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 _0x781d=['post','addDisposition','/:id/canned_answers','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','send','put','/:id','update','delete','destroy','removeAnswers','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id/dispositions','getDispositions','getAnswers','/:id/users','getAgents','/:id/applications','getApplications'];(function(_0x4a7e98,_0x250137){var _0x27d10d=function(_0x378768){while(--_0x378768){_0x4a7e98['push'](_0x4a7e98['shift']());}};_0x27d10d(++_0x250137);}(_0x781d,0x14a));var _0xd781=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x781d[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd781('0x2'));var router=express[_0xd781('0x3')]();var fs_extra=require(_0xd781('0x4'));var auth=require(_0xd781('0x5'));var interaction=require(_0xd781('0x6'));var config=require(_0xd781('0x7'));var controller=require(_0xd781('0x8'));router[_0xd781('0x9')]('/',auth[_0xd781('0xa')](),controller[_0xd781('0xb')]);router['get'](_0xd781('0xc'),auth[_0xd781('0xa')](),controller[_0xd781('0xd')]);router[_0xd781('0x9')]('/:id',auth[_0xd781('0xa')](),controller['show']);router[_0xd781('0x9')](_0xd781('0xe'),auth['isAuthenticated'](),controller[_0xd781('0xf')]);router[_0xd781('0x9')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xd781('0x10')]);router[_0xd781('0x9')](_0xd781('0x11'),auth[_0xd781('0xa')](),controller[_0xd781('0x12')]);router[_0xd781('0x9')](_0xd781('0x13'),auth[_0xd781('0xa')](),controller[_0xd781('0x14')]);router[_0xd781('0x15')]('/',auth[_0xd781('0xa')](),controller['create']);router[_0xd781('0x15')](_0xd781('0xe'),auth['isAuthenticated'](),controller[_0xd781('0x16')]);router['post'](_0xd781('0x17'),auth[_0xd781('0xa')](),controller[_0xd781('0x18')]);router[_0xd781('0x15')](_0xd781('0x11'),auth[_0xd781('0xa')](),controller[_0xd781('0x19')]);router['post'](_0xd781('0x13'),auth[_0xd781('0xa')](),controller[_0xd781('0x1a')]);router[_0xd781('0x15')](_0xd781('0x1b'),controller[_0xd781('0x1c')]);router[_0xd781('0x15')](_0xd781('0x1d'),auth['isAuthenticated'](),controller[_0xd781('0x1e')]);router[_0xd781('0x1f')](_0xd781('0x20'),auth[_0xd781('0xa')](),controller[_0xd781('0x21')]);router[_0xd781('0x22')](_0xd781('0x20'),auth['isAuthenticated'](),controller[_0xd781('0x23')]);router['delete']('/:id/dispositions',auth[_0xd781('0xa')](),controller['removeDispositions']);router[_0xd781('0x22')](_0xd781('0x17'),auth[_0xd781('0xa')](),controller[_0xd781('0x24')]);router[_0xd781('0x22')](_0xd781('0x11'),auth[_0xd781('0xa')](),controller[_0xd781('0x25')]);module[_0xd781('0x26')]=router; \ No newline at end of file +var _0x47c5=['/:id/notify','notify','send','update','delete','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addApplications'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x47c5,0x165));var _0x547c=function(_0x418ce0,_0xaee358){_0x418ce0=_0x418ce0-0x0;var _0x46bd09=_0x47c5[_0x418ce0];return _0x46bd09;};'use strict';var multer=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var path=require(_0x547c('0x2'));var timeout=require(_0x547c('0x3'));var express=require(_0x547c('0x4'));var router=express[_0x547c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x547c('0x6'));var interaction=require(_0x547c('0x7'));var config=require('../../config/environment');var controller=require(_0x547c('0x8'));router[_0x547c('0x9')]('/',auth['isAuthenticated'](),controller[_0x547c('0xa')]);router[_0x547c('0x9')](_0x547c('0xb'),auth[_0x547c('0xc')](),controller[_0x547c('0xd')]);router[_0x547c('0x9')](_0x547c('0xe'),auth[_0x547c('0xc')](),controller[_0x547c('0xf')]);router[_0x547c('0x9')](_0x547c('0x10'),auth[_0x547c('0xc')](),controller[_0x547c('0x11')]);router[_0x547c('0x9')](_0x547c('0x12'),auth[_0x547c('0xc')](),controller[_0x547c('0x13')]);router['get'](_0x547c('0x14'),auth[_0x547c('0xc')](),controller['getAgents']);router[_0x547c('0x9')](_0x547c('0x15'),auth[_0x547c('0xc')](),controller[_0x547c('0x16')]);router[_0x547c('0x17')]('/',auth[_0x547c('0xc')](),controller[_0x547c('0x18')]);router[_0x547c('0x17')](_0x547c('0x10'),auth[_0x547c('0xc')](),controller[_0x547c('0x19')]);router[_0x547c('0x17')](_0x547c('0x12'),auth[_0x547c('0xc')](),controller[_0x547c('0x1a')]);router[_0x547c('0x17')](_0x547c('0x14'),auth[_0x547c('0xc')](),controller['addAgents']);router['post'](_0x547c('0x15'),auth[_0x547c('0xc')](),controller[_0x547c('0x1b')]);router['post'](_0x547c('0x1c'),controller[_0x547c('0x1d')]);router[_0x547c('0x17')]('/:id/send',auth[_0x547c('0xc')](),controller[_0x547c('0x1e')]);router['put']('/:id',auth[_0x547c('0xc')](),controller[_0x547c('0x1f')]);router['delete'](_0x547c('0xe'),auth[_0x547c('0xc')](),controller['destroy']);router[_0x547c('0x20')](_0x547c('0x10'),auth[_0x547c('0xc')](),controller['removeDispositions']);router[_0x547c('0x20')](_0x547c('0x12'),auth[_0x547c('0xc')](),controller[_0x547c('0x21')]);router[_0x547c('0x20')](_0x547c('0x14'),auth[_0x547c('0xc')](),controller[_0x547c('0x22')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index aeae5e3..42acf83 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 _0xf7be=['generate','ENUM','twilio','sinch','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','mandatoryDisposition','sequelize','randomstring','STRING','name'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0xf7be,0xdc));var _0xef7b=function(_0x5b1cb5,_0x266627){_0x5b1cb5=_0x5b1cb5-0x0;var _0x331efc=_0xf7be[_0x5b1cb5];return _0x331efc;};'use strict';var Sequelize=require(_0xef7b('0x0'));var rs=require(_0xef7b('0x1'));module['exports']={'name':{'type':Sequelize[_0xef7b('0x2')],'unique':_0xef7b('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xef7b('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xef7b('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xef7b('0x2')],'defaultValue':function(){return rs[_0xef7b('0x4')]();}},'phone':{'type':Sequelize[_0xef7b('0x2')]},'type':{'type':Sequelize[_0xef7b('0x5')](_0xef7b('0x6'),_0xef7b('0x7'))},'accountSid':{'type':Sequelize[_0xef7b('0x2')]},'baseUrl':{'type':Sequelize[_0xef7b('0x2')]},'authToken':{'type':Sequelize[_0xef7b('0x2')]},'notificationTemplate':{'type':Sequelize[_0xef7b('0x8')],'defaultValue':function(){return _0xef7b('0x9');}},'notificationSound':{'type':Sequelize[_0xef7b('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xef7b('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xef7b('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xef7b('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xef7b('0xb')],'comment':_0xef7b('0xc')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xef7b('0xd'),'set':function(_0x4152be){if(!_0x4152be){this[_0xef7b('0xe')]('mandatoryDispositionPauseId',null);}this[_0xef7b('0xe')](_0xef7b('0xf'),_0x4152be);}},'description':{'type':Sequelize[_0xef7b('0x2')]}}; \ No newline at end of file +var _0x67b9=['ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','name','STRING'];(function(_0x24d861,_0x4751a1){var _0x1a1b2e=function(_0xb5b049){while(--_0xb5b049){_0x24d861['push'](_0x24d861['shift']());}};_0x1a1b2e(++_0x4751a1);}(_0x67b9,0x6b));var _0x967b=function(_0x26d107,_0x288f0c){_0x26d107=_0x26d107-0x0;var _0x4afc48=_0x67b9[_0x26d107];return _0x4afc48;};'use strict';var Sequelize=require(_0x967b('0x0'));var rs=require(_0x967b('0x1'));module[_0x967b('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x967b('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x967b('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0x967b('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0x967b('0x4')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x967b('0x5')](_0x967b('0x6'),_0x967b('0x7'))},'accountSid':{'type':Sequelize[_0x967b('0x4')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x967b('0x4')]},'notificationTemplate':{'type':Sequelize[_0x967b('0x8')],'defaultValue':function(){return _0x967b('0x9');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x967b('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x967b('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x967b('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x967b('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x967b('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x59768c){if(!_0x59768c){this[_0x967b('0xc')](_0x967b('0xd'),null);}this[_0x967b('0xc')]('mandatoryDisposition',_0x59768c);}},'description':{'type':Sequelize[_0x967b('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index d8c69cb..250f8e8 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 _0x9445=['destroy','describe','addDisposition','WhatsappAccountId','findOne','pick','Disposition','includeAll','rows','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','send','getApplications','whatsapp','Applications','account','sinch','statuses','state','timestamp','message_id','applications','orderBy','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','Body','messageId','MessageSid','notifications','isNil','Sequelize','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','DESC','list','Contacts','contact','WhatsappInteraction','created','autoclose','close','unmanaged','*,*,*,*','WhatsappMessage','AttachmentId','interaction','UserId','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','Messages','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./whatsappAccount.socket','register','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','get','WhatsappAccounts','end','stack','name','index','Pause','mandatoryDispositionPause','WhatsappAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','findAll','params','include','find','create','user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body'];(function(_0x306626,_0x425e93){var _0x466728=function(_0x3b3478){while(--_0x3b3478){_0x306626['push'](_0x306626['shift']());}};_0x466728(++_0x425e93);}(_0x9445,0x64));var _0x5944=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x9445[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0x5944('0x0'));var rimraf=require(_0x5944('0x1'));var zipdir=require(_0x5944('0x2'));var jsonpatch=require(_0x5944('0x3'));var rp=require(_0x5944('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5944('0x5'));var util=require(_0x5944('0x6'));var path=require(_0x5944('0x7'));var sox=require(_0x5944('0x8'));var csv=require(_0x5944('0x9'));var ejs=require(_0x5944('0xa'));var fs=require('fs');var fs_extra=require(_0x5944('0xb'));var _=require(_0x5944('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5944('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5944('0x9'));var querystring=require('querystring');var Papa=require(_0x5944('0xe'));var Redis=require(_0x5944('0xf'));var authService=require(_0x5944('0x10'));var qs=require(_0x5944('0x11'));var as=require(_0x5944('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5944('0x13'))(_0x5944('0x14'));var utils=require(_0x5944('0x15'));var config=require(_0x5944('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5944('0x17'))['db'];config['redis']=_[_0x5944('0x18')](config[_0x5944('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x5944('0x1a'))(new Redis(config[_0x5944('0x19')]));require(_0x5944('0x1b'))[_0x5944('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5944('0x1d')][_0x5944('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x5f5114,_0x38eaad,_0x58a163,_0x34f767){return new BPromise(function(_0x4ac001,_0x14f34b){var _0xa3077e=_0x34f767||client;return _0xa3077e[_0x5944('0x1f')](_0x5f5114,_0x58a163)[_0x5944('0x20')](function(_0x17e5fb){logger[_0x5944('0x21')](_0x5944('0x22'),_0x38eaad,_0x5944('0x23'));logger['debug'](_0x5944('0x24'),_0x38eaad,'request\x20sent',JSON['stringify'](_0x17e5fb));if(_0x17e5fb[_0x5944('0x25')]){if(_0x17e5fb['error'][_0x5944('0x26')]===0x1f4){logger[_0x5944('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x38eaad,_0x17e5fb['error'][_0x5944('0x27')]);return _0x14f34b(_0x17e5fb[_0x5944('0x25')][_0x5944('0x27')]);}logger[_0x5944('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x38eaad,_0x17e5fb['error'][_0x5944('0x27')]);return _0x4ac001(_0x17e5fb['error']['message']);}else{logger[_0x5944('0x21')](_0x5944('0x22'),_0x38eaad,_0x5944('0x23'));_0x4ac001(_0x17e5fb[_0x5944('0x28')]['message']);}})[_0x5944('0x29')](function(_0xfa34b8){logger[_0x5944('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x38eaad,_0xfa34b8);_0x14f34b(_0xfa34b8);});});}function respondWithStatusCode(_0x346dae,_0xa5b50d){_0xa5b50d=_0xa5b50d||0xcc;return function(_0x2ff111){if(_0x2ff111){return _0x346dae[_0x5944('0x2a')](_0xa5b50d);}return _0x346dae[_0x5944('0x2b')](_0xa5b50d)['end']();};}function respondWithResult(_0x9b9e2b,_0x11651a){_0x11651a=_0x11651a||0xc8;return function(_0x16bf51){if(_0x16bf51){return _0x9b9e2b[_0x5944('0x2b')](_0x11651a)[_0x5944('0x2c')](_0x16bf51);}};}function respondWithFilteredResult(_0x187802,_0x27e685){return function(_0x8d21f2){if(_0x8d21f2){var _0x3fbdd0=typeof _0x27e685[_0x5944('0x2d')]===_0x5944('0x2e')&&typeof _0x27e685[_0x5944('0x2f')]===_0x5944('0x2e');var _0x538f81=_0x8d21f2['count'];var _0x1bbea9=_0x3fbdd0?0x0:_0x27e685[_0x5944('0x2d')];var _0x195912=_0x3fbdd0?_0x8d21f2[_0x5944('0x30')]:_0x27e685[_0x5944('0x2d')]+_0x27e685[_0x5944('0x2f')];var _0x1b46d0;if(_0x195912>=_0x538f81){_0x195912=_0x538f81;_0x1b46d0=0xc8;}else{_0x1b46d0=0xce;}_0x187802[_0x5944('0x2b')](_0x1b46d0);return _0x187802['set'](_0x5944('0x31'),_0x1bbea9+'-'+_0x195912+'/'+_0x538f81)['json'](_0x8d21f2);}return null;};}function patchUpdates(_0x36d215){return function(_0x458a1c){try{jsonpatch[_0x5944('0x32')](_0x458a1c,_0x36d215,!![]);}catch(_0x5668ca){return BPromise[_0x5944('0x33')](_0x5668ca);}return _0x458a1c[_0x5944('0x34')]();};}function saveUpdates(_0x514495,_0x30953a){return function(_0x1a8337){if(_0x1a8337){return _0x1a8337[_0x5944('0x35')](_0x514495)[_0x5944('0x20')](function(_0x4f1c3b){return _0x4f1c3b;});}return null;};}function removeEntity(_0x426345,_0x30adf3){return function(_0x6802a5){if(_0x6802a5){return _0x6802a5['destroy']()[_0x5944('0x20')](function(){var _0x502ef5=_0x6802a5[_0x5944('0x36')]({'plain':!![]});var _0x1df6be=_0x5944('0x37');return db['UserProfileResource']['destroy']({'where':{'type':_0x1df6be,'resourceId':_0x502ef5['id']}})[_0x5944('0x20')](function(){return _0x6802a5;});})[_0x5944('0x20')](function(){_0x426345[_0x5944('0x2b')](0xcc)[_0x5944('0x38')]();});}};}function handleEntityNotFound(_0x4e3801,_0x45f242){return function(_0x348bca){if(!_0x348bca){_0x4e3801[_0x5944('0x2a')](0x194);}return _0x348bca;};}function handleError(_0x121eba,_0x2179e5){_0x2179e5=_0x2179e5||0x1f4;return function(_0x459c04){logger[_0x5944('0x25')](_0x459c04[_0x5944('0x39')]);if(_0x459c04[_0x5944('0x3a')]){delete _0x459c04[_0x5944('0x3a')];}_0x121eba['status'](_0x2179e5)['send'](_0x459c04);};}exports[_0x5944('0x3b')]=function(_0xb0952c,_0x520f39){var _0x1da687={'include':[{'model':db[_0x5944('0x3c')],'as':_0x5944('0x3d')}]},_0x29d419={},_0x351900={'count':0x0,'rows':[]};var _0x52686e=_['map'](db[_0x5944('0x3e')][_0x5944('0x3f')],function(_0x395fc9){return{'name':_0x395fc9[_0x5944('0x40')],'type':_0x395fc9[_0x5944('0x41')][_0x5944('0x42')]};});_0x29d419['model']=_[_0x5944('0x43')](_0x52686e,_0x5944('0x3a'));_0x29d419[_0x5944('0x44')]=_[_0x5944('0x45')](_0xb0952c[_0x5944('0x44')]);_0x29d419[_0x5944('0x46')]=_[_0x5944('0x47')](_0x29d419[_0x5944('0x48')],_0x29d419['query']);_0x1da687[_0x5944('0x49')]=_['intersection'](_0x29d419[_0x5944('0x48')],qs[_0x5944('0x4a')](_0xb0952c['query']['fields']));_0x1da687[_0x5944('0x49')]=_0x1da687[_0x5944('0x49')][_0x5944('0x4b')]?_0x1da687[_0x5944('0x49')]:_0x29d419[_0x5944('0x48')];if(!_0xb0952c['query'][_0x5944('0x4c')](_0x5944('0x4d'))){_0x1da687['limit']=qs[_0x5944('0x2f')](_0xb0952c[_0x5944('0x44')][_0x5944('0x2f')]);_0x1da687['offset']=qs['offset'](_0xb0952c[_0x5944('0x44')][_0x5944('0x2d')]);}_0x1da687[_0x5944('0x4e')]=qs[_0x5944('0x4f')](_0xb0952c['query'][_0x5944('0x4f')]);_0x1da687['where']=qs[_0x5944('0x46')](_['pick'](_0xb0952c[_0x5944('0x44')],_0x29d419['filters']),_0x52686e);if(_0xb0952c['query'][_0x5944('0x50')]){_0x1da687[_0x5944('0x51')]=_[_0x5944('0x52')](_0x1da687[_0x5944('0x51')],{'$or':_[_0x5944('0x43')](_0x52686e,function(_0x29a126){if(_0x29a126[_0x5944('0x41')]!==_0x5944('0x53')){var _0x5ee6b1={};_0x5ee6b1[_0x29a126[_0x5944('0x3a')]]={'$like':'%'+_0xb0952c[_0x5944('0x44')]['filter']+'%'};return _0x5ee6b1;}})});}_0x1da687=_['merge']({},_0x1da687,_0xb0952c[_0x5944('0x54')]);var _0x27a19f={'where':_0x1da687[_0x5944('0x51')]};return db['WhatsappAccount'][_0x5944('0x30')](_0x27a19f)[_0x5944('0x20')](function(_0x25afac){_0x351900[_0x5944('0x30')]=_0x25afac;if(_0xb0952c['query']['includeAll']){_0x1da687['include']=[{'all':!![]}];}return db[_0x5944('0x3e')][_0x5944('0x55')](_0x1da687);})['then'](function(_0x1f524c){_0x351900['rows']=_0x1f524c;return _0x351900;})[_0x5944('0x20')](respondWithFilteredResult(_0x520f39,_0x1da687))[_0x5944('0x29')](handleError(_0x520f39,null));};exports['show']=function(_0x1b02db,_0x51b4df){var _0x6adcd={'raw':![],'where':{'id':_0x1b02db[_0x5944('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0x5944('0x3d')}]},_0x42b1b3={};_0x42b1b3['model']=_[_0x5944('0x45')](db[_0x5944('0x3e')]['rawAttributes']);_0x42b1b3[_0x5944('0x44')]=_['keys'](_0x1b02db[_0x5944('0x44')]);_0x42b1b3[_0x5944('0x46')]=_[_0x5944('0x47')](_0x42b1b3[_0x5944('0x48')],_0x42b1b3['query']);_0x6adcd[_0x5944('0x49')]=_[_0x5944('0x47')](_0x42b1b3[_0x5944('0x48')],qs[_0x5944('0x4a')](_0x1b02db[_0x5944('0x44')][_0x5944('0x4a')]));_0x6adcd[_0x5944('0x49')]=_0x6adcd[_0x5944('0x49')][_0x5944('0x4b')]?_0x6adcd[_0x5944('0x49')]:_0x42b1b3['model'];if(_0x1b02db[_0x5944('0x44')]['includeAll']){_0x6adcd[_0x5944('0x57')]=[{'all':!![]}];}_0x6adcd=_[_0x5944('0x52')]({},_0x6adcd,_0x1b02db[_0x5944('0x54')]);return db[_0x5944('0x3e')][_0x5944('0x58')](_0x6adcd)[_0x5944('0x20')](handleEntityNotFound(_0x51b4df,null))['then'](respondWithResult(_0x51b4df,null))[_0x5944('0x29')](handleError(_0x51b4df,null));};exports[_0x5944('0x59')]=function(_0x35c69d,_0xa34e65){return db[_0x5944('0x3e')][_0x5944('0x59')](_0x35c69d['body'],{})[_0x5944('0x20')](function(_0x25d6a6){var _0x394574=_0x35c69d[_0x5944('0x5a')][_0x5944('0x36')]({'plain':!![]});if(!_0x394574)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x394574[_0x5944('0x5b')]===_0x5944('0x5a')){var _0x522857=_0x25d6a6[_0x5944('0x36')]({'plain':!![]});var _0x579596=_0x5944('0x37');return db['UserProfileSection'][_0x5944('0x58')]({'where':{'name':_0x579596,'userProfileId':_0x394574[_0x5944('0x5c')]},'raw':!![]})[_0x5944('0x20')](function(_0x554b26){if(_0x554b26&&_0x554b26[_0x5944('0x5d')]===0x0){return db[_0x5944('0x5e')][_0x5944('0x59')]({'name':_0x522857[_0x5944('0x3a')],'resourceId':_0x522857['id'],'type':_0x554b26[_0x5944('0x3a')],'sectionId':_0x554b26['id']},{})[_0x5944('0x20')](function(){return _0x25d6a6;});}else{return _0x25d6a6;}})['catch'](function(_0x26215c){logger[_0x5944('0x25')](_0x5944('0x5f'),_0x26215c);throw _0x26215c;});}return _0x25d6a6;})['then'](respondWithResult(_0xa34e65,0xc9))[_0x5944('0x29')](handleError(_0xa34e65,null));};exports[_0x5944('0x35')]=function(_0x5ae369,_0x170378){if(_0x5ae369[_0x5944('0x60')]['id']){delete _0x5ae369['body']['id'];}return db[_0x5944('0x3e')]['find']({'where':{'id':_0x5ae369[_0x5944('0x56')]['id']},'include':[{'model':db[_0x5944('0x3c')],'as':_0x5944('0x3d')}]})[_0x5944('0x20')](handleEntityNotFound(_0x170378,null))[_0x5944('0x20')](saveUpdates(_0x5ae369[_0x5944('0x60')],null))[_0x5944('0x20')](respondWithResult(_0x170378,null))[_0x5944('0x29')](handleError(_0x170378,null));};exports[_0x5944('0x61')]=function(_0x10aa93,_0x4d6da0){return db[_0x5944('0x3e')][_0x5944('0x58')]({'where':{'id':_0x10aa93[_0x5944('0x56')]['id']}})[_0x5944('0x20')](handleEntityNotFound(_0x4d6da0,null))['then'](removeEntity(_0x4d6da0,null))[_0x5944('0x29')](handleError(_0x4d6da0,null));};exports[_0x5944('0x62')]=function(_0xb87a13,_0x44b76d){return db['WhatsappAccount'][_0x5944('0x62')]()[_0x5944('0x20')](respondWithResult(_0x44b76d,null))[_0x5944('0x29')](handleError(_0x44b76d,null));};exports[_0x5944('0x63')]=function(_0x2bab7f,_0x4c620b,_0x1ec12a){if(_0x2bab7f[_0x5944('0x60')]['id']){delete _0x2bab7f[_0x5944('0x60')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x2bab7f[_0x5944('0x56')]['id']}})[_0x5944('0x20')](handleEntityNotFound(_0x4c620b,null))[_0x5944('0x20')](function(_0x52f09b){if(_0x52f09b){_0x2bab7f['body'][_0x5944('0x64')]=_0x52f09b['id'];return db['Disposition']['create'](_0x2bab7f[_0x5944('0x60')]);}})['then'](respondWithResult(_0x4c620b,null))[_0x5944('0x29')](handleError(_0x4c620b,null));};exports['getDispositions']=function(_0x204730,_0x53b171,_0x17058f){var _0x3a029c={'raw':![],'where':{}};var _0x4dcedb={};var _0x132701={'count':0x0,'rows':[]};return db[_0x5944('0x3e')][_0x5944('0x65')]({'where':{'id':_0x204730['params']['id']}})[_0x5944('0x20')](handleEntityNotFound(_0x53b171,null))[_0x5944('0x20')](function(_0x55da70){if(_0x55da70){_0x4dcedb[_0x5944('0x48')]=_['keys'](db['Disposition'][_0x5944('0x3f')]);_0x4dcedb['query']=_[_0x5944('0x45')](_0x204730[_0x5944('0x44')]);_0x4dcedb['filters']=_[_0x5944('0x47')](_0x4dcedb[_0x5944('0x48')],_0x4dcedb[_0x5944('0x44')]);_0x3a029c['attributes']=_[_0x5944('0x47')](_0x4dcedb[_0x5944('0x48')],qs['fields'](_0x204730['query'][_0x5944('0x4a')]));_0x3a029c[_0x5944('0x49')]=_0x3a029c['attributes'][_0x5944('0x4b')]?_0x3a029c[_0x5944('0x49')]:_0x4dcedb[_0x5944('0x48')];if(!_0x204730[_0x5944('0x44')][_0x5944('0x4c')]('nolimit')){_0x3a029c['limit']=qs['limit'](_0x204730[_0x5944('0x44')][_0x5944('0x2f')]);_0x3a029c[_0x5944('0x2d')]=qs[_0x5944('0x2d')](_0x204730[_0x5944('0x44')]['offset']);}_0x3a029c[_0x5944('0x4e')]=qs[_0x5944('0x4f')](_0x204730[_0x5944('0x44')][_0x5944('0x4f')]);_0x3a029c['where']=qs['filters'](_[_0x5944('0x66')](_0x204730[_0x5944('0x44')],_0x4dcedb[_0x5944('0x46')]));_0x3a029c[_0x5944('0x51')][_0x5944('0x64')]=_0x55da70['id'];if(_0x204730[_0x5944('0x44')][_0x5944('0x50')]){_0x3a029c[_0x5944('0x51')]=_[_0x5944('0x52')](_0x3a029c[_0x5944('0x51')],{'$or':_['map'](_0x3a029c['attributes'],function(_0x2e963d){var _0x205b6e={};_0x205b6e[_0x2e963d]={'$like':'%'+_0x204730['query'][_0x5944('0x50')]+'%'};return _0x205b6e;})});}_0x3a029c=_[_0x5944('0x52')]({},_0x3a029c,_0x204730[_0x5944('0x54')]);return db[_0x5944('0x67')]['count']({'where':_0x3a029c[_0x5944('0x51')]})[_0x5944('0x20')](function(_0x5af8f2){_0x132701[_0x5944('0x30')]=_0x5af8f2;if(_0x204730['query'][_0x5944('0x68')]){_0x3a029c[_0x5944('0x57')]=[{'all':!![]}];}return db[_0x5944('0x67')][_0x5944('0x55')](_0x3a029c);})['then'](function(_0x71f331){_0x132701[_0x5944('0x69')]=_0x71f331;return _0x132701;});}})[_0x5944('0x20')](respondWithFilteredResult(_0x53b171,_0x3a029c))['catch'](handleError(_0x53b171,null));};exports[_0x5944('0x6a')]=function(_0x1dc7e4,_0x2a8300,_0xdd89aa){return db[_0x5944('0x3e')]['find']({'where':{'id':_0x1dc7e4[_0x5944('0x56')]['id']}})['then'](handleEntityNotFound(_0x2a8300,null))[_0x5944('0x20')](function(_0x148cbb){if(_0x148cbb){return _0x148cbb['removeDispositions'](_0x1dc7e4['query'][_0x5944('0x6b')]);}})[_0x5944('0x20')](respondWithStatusCode(_0x2a8300,null))[_0x5944('0x29')](handleError(_0x2a8300,null));};exports['addAnswer']=function(_0x42a450,_0x2e4b5b,_0xa6b7e0){if(_0x42a450[_0x5944('0x60')]['id']){delete _0x42a450['body']['id'];}return db[_0x5944('0x3e')][_0x5944('0x58')]({'where':{'id':_0x42a450[_0x5944('0x56')]['id']}})[_0x5944('0x20')](handleEntityNotFound(_0x2e4b5b,null))[_0x5944('0x20')](function(_0xa51a7e){if(_0xa51a7e){_0x42a450[_0x5944('0x60')]['WhatsappAccountId']=_0xa51a7e['id'];return db[_0x5944('0x6c')]['create'](_0x42a450[_0x5944('0x60')]);}})[_0x5944('0x20')](respondWithResult(_0x2e4b5b,null))[_0x5944('0x29')](handleError(_0x2e4b5b,null));};exports[_0x5944('0x6d')]=function(_0x4e59ea,_0x3f5ed3,_0x31e9c4){var _0x640a86={'raw':![],'where':{}};var _0x2fdd4e={};var _0x2a48ba={'count':0x0,'rows':[]};return db[_0x5944('0x3e')][_0x5944('0x65')]({'where':{'id':_0x4e59ea[_0x5944('0x56')]['id']}})['then'](handleEntityNotFound(_0x3f5ed3,null))[_0x5944('0x20')](function(_0x554f4e){if(_0x554f4e){_0x2fdd4e[_0x5944('0x48')]=_[_0x5944('0x45')](db[_0x5944('0x6c')]['rawAttributes']);_0x2fdd4e['query']=_[_0x5944('0x45')](_0x4e59ea[_0x5944('0x44')]);_0x2fdd4e[_0x5944('0x46')]=_[_0x5944('0x47')](_0x2fdd4e[_0x5944('0x48')],_0x2fdd4e['query']);_0x640a86[_0x5944('0x49')]=_[_0x5944('0x47')](_0x2fdd4e['model'],qs[_0x5944('0x4a')](_0x4e59ea[_0x5944('0x44')][_0x5944('0x4a')]));_0x640a86['attributes']=_0x640a86[_0x5944('0x49')][_0x5944('0x4b')]?_0x640a86['attributes']:_0x2fdd4e[_0x5944('0x48')];if(!_0x4e59ea[_0x5944('0x44')][_0x5944('0x4c')](_0x5944('0x4d'))){_0x640a86[_0x5944('0x2f')]=qs[_0x5944('0x2f')](_0x4e59ea[_0x5944('0x44')][_0x5944('0x2f')]);_0x640a86[_0x5944('0x2d')]=qs[_0x5944('0x2d')](_0x4e59ea[_0x5944('0x44')][_0x5944('0x2d')]);}_0x640a86['order']=qs['sort'](_0x4e59ea[_0x5944('0x44')][_0x5944('0x4f')]);_0x640a86[_0x5944('0x51')]=qs['filters'](_[_0x5944('0x66')](_0x4e59ea[_0x5944('0x44')],_0x2fdd4e['filters']));_0x640a86[_0x5944('0x51')]['WhatsappAccountId']=_0x554f4e['id'];if(_0x4e59ea[_0x5944('0x44')][_0x5944('0x50')]){_0x640a86[_0x5944('0x51')]=_[_0x5944('0x52')](_0x640a86[_0x5944('0x51')],{'$or':_[_0x5944('0x43')](_0x640a86[_0x5944('0x49')],function(_0x584ddc){var _0x524ee6={};_0x524ee6[_0x584ddc]={'$like':'%'+_0x4e59ea[_0x5944('0x44')][_0x5944('0x50')]+'%'};return _0x524ee6;})});}_0x640a86=_['merge']({},_0x640a86,_0x4e59ea[_0x5944('0x54')]);return db['CannedAnswer'][_0x5944('0x30')]({'where':_0x640a86['where']})[_0x5944('0x20')](function(_0x2a4422){_0x2a48ba[_0x5944('0x30')]=_0x2a4422;if(_0x4e59ea[_0x5944('0x44')]['includeAll']){_0x640a86[_0x5944('0x57')]=[{'all':!![]}];}return db[_0x5944('0x6c')][_0x5944('0x55')](_0x640a86);})['then'](function(_0x45a955){_0x2a48ba[_0x5944('0x69')]=_0x45a955;return _0x2a48ba;});}})[_0x5944('0x20')](respondWithFilteredResult(_0x3f5ed3,_0x640a86))[_0x5944('0x29')](handleError(_0x3f5ed3,null));};exports[_0x5944('0x6e')]=function(_0x14106c,_0x4848a5,_0x449a0d){return db[_0x5944('0x3e')][_0x5944('0x58')]({'where':{'id':_0x14106c[_0x5944('0x56')]['id']}})[_0x5944('0x20')](handleEntityNotFound(_0x4848a5,null))[_0x5944('0x20')](function(_0x184370){if(_0x184370){return _0x184370[_0x5944('0x6e')](_0x14106c['query'][_0x5944('0x6b')]);}})[_0x5944('0x20')](respondWithStatusCode(_0x4848a5,null))[_0x5944('0x29')](handleError(_0x4848a5,null));};exports[_0x5944('0x6f')]=function(_0x1bfdb0,_0x3c92f8,_0x197653){return db['WhatsappAccount'][_0x5944('0x58')]({'where':{'id':_0x1bfdb0[_0x5944('0x56')]['id']}})[_0x5944('0x20')](handleEntityNotFound(_0x3c92f8,null))[_0x5944('0x20')](function(_0x18cbfd){if(_0x18cbfd){return _0x18cbfd[_0x5944('0x6f')](_0x1bfdb0[_0x5944('0x60')][_0x5944('0x6b')],_[_0x5944('0x70')](_0x1bfdb0[_0x5944('0x60')],['ids','id'])||{})[_0x5944('0x71')](function(_0x3a559c){for(var _0x401a9e=0x0;_0x401a9e<_0x1bfdb0[_0x5944('0x60')][_0x5944('0x6b')][_0x5944('0x4b')];_0x401a9e+=0x1){socket[_0x5944('0x72')](_0x5944('0x73'),{'UserId':Number(_0x1bfdb0['body']['ids'][_0x401a9e]),'WhatsappAccountId':Number(_0x1bfdb0[_0x5944('0x56')]['id'])});}return _0x3a559c;});}})[_0x5944('0x20')](respondWithResult(_0x3c92f8,null))[_0x5944('0x29')](handleError(_0x3c92f8,null));};exports[_0x5944('0x74')]=function(_0x3ca7f6,_0x4370dd,_0x2fd86a){return db[_0x5944('0x3e')][_0x5944('0x58')]({'where':{'id':_0x3ca7f6['params']['id']}})['then'](handleEntityNotFound(_0x4370dd,null))[_0x5944('0x20')](function(_0x5174ee){if(_0x5174ee){return _0x5174ee[_0x5944('0x74')](_0x3ca7f6[_0x5944('0x44')][_0x5944('0x6b')])['then'](function(){if(_[_0x5944('0x75')](_0x3ca7f6[_0x5944('0x44')][_0x5944('0x6b')])){for(var _0x2f2992=0x0;_0x2f2992<_0x3ca7f6[_0x5944('0x44')][_0x5944('0x6b')][_0x5944('0x4b')];_0x2f2992+=0x1){socket[_0x5944('0x72')](_0x5944('0x76'),{'UserId':Number(_0x3ca7f6[_0x5944('0x44')][_0x5944('0x6b')][_0x2f2992]),'WhatsappAccountId':Number(_0x3ca7f6[_0x5944('0x56')]['id'])});}}else{socket[_0x5944('0x72')](_0x5944('0x76'),{'UserId':Number(_0x3ca7f6[_0x5944('0x44')][_0x5944('0x6b')]),'WhatsappAccountId':Number(_0x3ca7f6['params']['id'])});}});}})[_0x5944('0x20')](respondWithStatusCode(_0x4370dd,null))['catch'](handleError(_0x4370dd,null));};exports[_0x5944('0x77')]=function(_0x2a1bc2,_0x3c0dc5,_0x31a9bf){var _0x5ddda8={};var _0x92e274={};var _0x9c592f;var _0x18cfd1;return db['WhatsappAccount'][_0x5944('0x65')]({'where':{'id':_0x2a1bc2[_0x5944('0x56')]['id']}})[_0x5944('0x20')](handleEntityNotFound(_0x3c0dc5,null))['then'](function(_0x4494d1){if(_0x4494d1){_0x9c592f=_0x4494d1;_0x92e274[_0x5944('0x48')]=_[_0x5944('0x45')](db[_0x5944('0x78')][_0x5944('0x3f')]);_0x92e274[_0x5944('0x44')]=_[_0x5944('0x45')](_0x2a1bc2[_0x5944('0x44')]);_0x92e274[_0x5944('0x46')]=_[_0x5944('0x47')](_0x92e274[_0x5944('0x48')],_0x92e274[_0x5944('0x44')]);_0x5ddda8[_0x5944('0x49')]=_['intersection'](_0x92e274['model'],qs[_0x5944('0x4a')](_0x2a1bc2[_0x5944('0x44')][_0x5944('0x4a')]));_0x5ddda8[_0x5944('0x49')]=_0x5ddda8['attributes'][_0x5944('0x4b')]?_0x5ddda8[_0x5944('0x49')]:_0x92e274['model'];_0x5ddda8[_0x5944('0x4e')]=qs[_0x5944('0x4f')](_0x2a1bc2[_0x5944('0x44')][_0x5944('0x4f')]);_0x5ddda8['where']=qs['filters'](_['pick'](_0x2a1bc2[_0x5944('0x44')],_0x92e274[_0x5944('0x46')]));if(_0x2a1bc2[_0x5944('0x44')][_0x5944('0x50')]){_0x5ddda8[_0x5944('0x51')]=_[_0x5944('0x52')](_0x5ddda8[_0x5944('0x51')],{'$or':_[_0x5944('0x43')](_0x5ddda8['attributes'],function(_0x31ab81){var _0x93da92={};_0x93da92[_0x31ab81]={'$like':'%'+_0x2a1bc2['query']['filter']+'%'};return _0x93da92;})});}_0x5ddda8=_[_0x5944('0x52')]({},_0x5ddda8,_0x2a1bc2[_0x5944('0x54')]);return _0x9c592f[_0x5944('0x77')](_0x5ddda8);}})[_0x5944('0x20')](function(_0x3270fa){if(_0x3270fa){_0x18cfd1=_0x3270fa['length'];if(!_0x2a1bc2[_0x5944('0x44')][_0x5944('0x4c')]('nolimit')){_0x5ddda8[_0x5944('0x2f')]=qs[_0x5944('0x2f')](_0x2a1bc2[_0x5944('0x44')][_0x5944('0x2f')]);_0x5ddda8[_0x5944('0x2d')]=qs[_0x5944('0x2d')](_0x2a1bc2[_0x5944('0x44')][_0x5944('0x2d')]);}return _0x9c592f[_0x5944('0x77')](_0x5ddda8);}})['then'](function(_0x3c102d){if(_0x3c102d){return _0x3c102d?{'count':_0x18cfd1,'rows':_0x3c102d}:null;}})[_0x5944('0x20')](respondWithResult(_0x3c0dc5,null))[_0x5944('0x29')](handleError(_0x3c0dc5,null));};exports[_0x5944('0x79')]=function(_0x25c3d6,_0x4a675c){var _0x4bd4bb=_0x25c3d6[_0x5944('0x56')]['id'];var _0x202347=_0x25c3d6[_0x5944('0x60')];var _0x2e64c6=0xc8;var _0x575c1b=null;return db[_0x5944('0x7a')][_0x5944('0x7b')]({'isolationLevel':db['sequelize'][_0x5944('0x7c')][_0x5944('0x7d')][_0x5944('0x7e')]},function(_0x152df4){return db[_0x5944('0x3e')][_0x5944('0x65')]({'where':{'id':_0x4bd4bb},'transaction':_0x152df4})[_0x5944('0x20')](function(_0x2d3586){if(_0x2d3586){return db[_0x5944('0x7f')]['destroy']({'where':{'WhatsappAccountId':_0x4bd4bb},'transaction':_0x152df4})['then'](function(){var _0x533b39=_[_0x5944('0x43')](_0x202347,function(_0x48d2bc){_0x48d2bc[_0x5944('0x64')]=_0x4bd4bb;return _0x48d2bc;});return db[_0x5944('0x7f')][_0x5944('0x80')](_0x533b39,{'transaction':_0x152df4});});}else{_0x2e64c6=0x194;_0x575c1b=[];}});})[_0x5944('0x20')](function(){if(_0x2e64c6!==0x194){return db[_0x5944('0x7f')][_0x5944('0x81')]({'where':{'WhatsappAccountId':_0x4bd4bb},'order':_0x5944('0x82')})[_0x5944('0x20')](function(_0x293d5a){_0x575c1b=_0x293d5a;});}})['catch'](function(_0x2f2af7){_0x2e64c6=0x1f4;logger[_0x5944('0x25')](_0x2f2af7[_0x5944('0x39')]);if(_0x2f2af7['name']){delete _0x2f2af7[_0x5944('0x3a')];}_0x575c1b=_0x2f2af7;})['finally'](function(){if(_0x575c1b===null){_0x4a675c['sendStatus'](_0x2e64c6);}else{if(_0x2e64c6===0x1f4){_0x4a675c[_0x5944('0x2b')](_0x2e64c6)[_0x5944('0x83')](_0x575c1b);}else{_0x4a675c[_0x5944('0x2b')](_0x2e64c6)[_0x5944('0x2c')](_0x575c1b);}}});};exports[_0x5944('0x84')]=function(_0x35c3b7,_0x455f3b,_0x374da1){var _0x5acb0c={};var _0x547a12={};var _0x3983bd;var _0x1d4a43;return db[_0x5944('0x3e')][_0x5944('0x65')]({'where':{'id':_0x35c3b7[_0x5944('0x56')]['id']}})[_0x5944('0x20')](handleEntityNotFound(_0x455f3b,null))['then'](function(_0x5e379f){if(_0x5e379f){_0x3983bd=_0x5e379f;_0x547a12[_0x5944('0x48')]=_[_0x5944('0x45')](db[_0x5944('0x7f')][_0x5944('0x3f')]);_0x547a12[_0x5944('0x44')]=_['keys'](_0x35c3b7[_0x5944('0x44')]);_0x547a12[_0x5944('0x46')]=_[_0x5944('0x47')](_0x547a12[_0x5944('0x48')],_0x547a12[_0x5944('0x44')]);_0x5acb0c['attributes']=_[_0x5944('0x47')](_0x547a12[_0x5944('0x48')],qs[_0x5944('0x4a')](_0x35c3b7[_0x5944('0x44')][_0x5944('0x4a')]));_0x5acb0c[_0x5944('0x49')]=_0x5acb0c['attributes'][_0x5944('0x4b')]?_0x5acb0c[_0x5944('0x49')]:_0x547a12[_0x5944('0x48')];_0x5acb0c[_0x5944('0x4e')]=qs[_0x5944('0x4f')](_0x35c3b7['query'][_0x5944('0x4f')]);_0x5acb0c['where']=qs[_0x5944('0x46')](_[_0x5944('0x66')](_0x35c3b7[_0x5944('0x44')],_0x547a12[_0x5944('0x46')]));if(_0x35c3b7[_0x5944('0x44')][_0x5944('0x50')]){_0x5acb0c[_0x5944('0x51')]=_['merge'](_0x5acb0c[_0x5944('0x51')],{'$or':_[_0x5944('0x43')](_0x5acb0c[_0x5944('0x49')],function(_0xad2076){var _0x497dc7={};_0x497dc7[_0xad2076]={'$like':'%'+_0x35c3b7[_0x5944('0x44')]['filter']+'%'};return _0x497dc7;})});}_0x5acb0c=_[_0x5944('0x52')]({},_0x5acb0c,_0x35c3b7[_0x5944('0x54')]);return _0x3983bd[_0x5944('0x84')](_0x5acb0c);}})['then'](function(_0x588de3){if(_0x588de3){_0x1d4a43=_0x588de3[_0x5944('0x4b')];if(!_0x35c3b7[_0x5944('0x44')][_0x5944('0x4c')]('nolimit')){_0x5acb0c[_0x5944('0x2f')]=qs[_0x5944('0x2f')](_0x35c3b7['query'][_0x5944('0x2f')]);_0x5acb0c[_0x5944('0x2d')]=qs[_0x5944('0x2d')](_0x35c3b7[_0x5944('0x44')]['offset']);}return _0x3983bd[_0x5944('0x84')](_0x5acb0c);}})['then'](function(_0x93dbd0){if(_0x93dbd0){return _0x93dbd0?{'count':_0x1d4a43,'rows':_0x93dbd0}:null;}})[_0x5944('0x20')](respondWithResult(_0x455f3b,null))[_0x5944('0x29')](handleError(_0x455f3b,null));};exports['notify']=function(_0x7b6662,_0x430b9d,_0x2205a8){var _0x38b63d={'channel':_0x5944('0x85')};var _0x494197=[];var _0x15e3bb=[];var _0x36af96={};return db['WhatsappAccount']['find']({'where':{'id':_0x7b6662[_0x5944('0x56')]['id']},'include':[{'model':db[_0x5944('0x7f')],'as':_0x5944('0x86')}]})[_0x5944('0x20')](handleEntityNotFound(_0x430b9d,null))['then'](function(_0x380a6d){_0x38b63d[_0x5944('0x87')]=_0x380a6d;if(_0x38b63d['account']&&_0x38b63d['account']['type']===_0x5944('0x88')&&_0x7b6662['body'][_0x5944('0x89')]){if(_0x7b6662['body'][_0x5944('0x89')][_0x5944('0x4b')]===0x0)return;if(_0x7b6662[_0x5944('0x60')][_0x5944('0x89')][0x0][_0x5944('0x8a')]!=='read')return;return db['WhatsappMessage']['update']({'read':!![],'readAt':_0x7b6662[_0x5944('0x60')]['statuses'][0x0][_0x5944('0x8b')]},{'where':{'messageId':_0x7b6662[_0x5944('0x60')][_0x5944('0x89')][0x0][_0x5944('0x8c')]},'individualHooks':!![]})['then'](function(_0x49e628){return _0x430b9d[_0x5944('0x2b')](0xc8)[_0x5944('0x2c')](_0x49e628);});}_0x38b63d[_0x5944('0x8d')]=_[_0x5944('0x8e')](_0x380a6d['Applications'],[_0x5944('0x82')],['asc']);if(_0x38b63d[_0x5944('0x87')][_0x5944('0x86')]){delete _0x38b63d[_0x5944('0x87')]['Applications'];}return db[_0x5944('0x8f')][_0x5944('0x62')]()[_0x5944('0x20')](function(_0x1650ee){if(!_0x1650ee){throw new db['Sequelize']['ValidationError'](_0x5944('0x90'));}_0x494197=_[_0x5944('0x91')](_[_0x5944('0x45')](_0x1650ee),[_0x5944('0x92'),_0x5944('0x93')]);_0x15e3bb=_[_0x5944('0x91')](_[_0x5944('0x45')](_0x1650ee),['createdAt','updatedAt',_0x5944('0x94'),_0x5944('0x95')]);_0x38b63d[_0x5944('0x60')]={'mapKey':_0x5944('0x96')};if(_0x38b63d[_0x5944('0x87')]&&_0x38b63d[_0x5944('0x87')][_0x5944('0x41')]===_0x5944('0x97')){_0x38b63d[_0x5944('0x60')][_0x5944('0x98')]=_0x7b6662['body'][_0x5944('0x99')][_0x5944('0x9a')]('whatsapp:','');_0x38b63d['body'][_0x5944('0x60')]=_0x7b6662['body'][_0x5944('0x9b')];_0x38b63d['body'][_0x5944('0x9c')]=_0x7b6662[_0x5944('0x60')][_0x5944('0x9d')];}if(_0x38b63d[_0x5944('0x87')]&&_0x38b63d[_0x5944('0x87')][_0x5944('0x41')]==='sinch'){_0x38b63d[_0x5944('0x60')][_0x5944('0x98')]=_0x7b6662[_0x5944('0x60')][_0x5944('0x9e')][0x0][_0x5944('0x98')];_0x38b63d['body'][_0x5944('0x60')]=_0x7b6662[_0x5944('0x60')][_0x5944('0x9e')][0x0][_0x5944('0x27')]['body'];_0x38b63d[_0x5944('0x60')][_0x5944('0x9c')]=_0x7b6662[_0x5944('0x60')]['notifications'][0x0][_0x5944('0x8c')];}if(_0x38b63d['body']['id']){delete _0x38b63d[_0x5944('0x60')]['id'];}if(_[_0x5944('0x9f')](_0x38b63d[_0x5944('0x60')][_0x5944('0x98')])){throw new db[(_0x5944('0xa0'))][(_0x5944('0xa1'))](_0x5944('0xa2'));}if(_[_0x5944('0x9f')](_0x38b63d[_0x5944('0x60')][_0x5944('0x60')])||_0x38b63d['body'][_0x5944('0x60')]===''){throw new db[(_0x5944('0xa0'))][(_0x5944('0xa1'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5944('0x9f')](_0x38b63d[_0x5944('0x60')][_0x5944('0xa3')])){throw new db[(_0x5944('0xa0'))][(_0x5944('0xa1'))](_0x5944('0xa4')+_0x15e3bb);}if(!_[_0x5944('0xa5')](_0x15e3bb,_0x38b63d['body'][_0x5944('0xa3')])){throw new db[(_0x5944('0xa0'))][(_0x5944('0xa1'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x15e3bb);}_0x36af96[_0x38b63d[_0x5944('0x60')][_0x5944('0xa3')]]=_0x38b63d[_0x5944('0x60')]['from'];return db[_0x5944('0xa6')][_0x5944('0x58')]({'where':{'id':_0x38b63d['account'][_0x5944('0x95')]},'include':[{'model':db[_0x5944('0x8f')],'as':'Contacts','where':_0x36af96,'limit':0x1,'order':[[_0x5944('0x93'),_0x5944('0xa7')]]}]});})[_0x5944('0x20')](handleEntityNotFound(_0x430b9d,null))['then'](function(_0x1ca94a){if(_0x1ca94a){_0x38b63d[_0x5944('0xa8')]=_[_0x5944('0x70')](_0x1ca94a,[_0x5944('0xa9')]);if(_0x1ca94a[_0x5944('0xa9')][_0x5944('0x4b')]){return _0x1ca94a[_0x5944('0xa9')][0x0];}var _0x554dad=_[_0x5944('0x18')](_0x38b63d[_0x5944('0x60')],{'firstName':_0x38b63d['body']['from'],'ListId':_0x1ca94a['id']});_0x554dad[_0x38b63d['body'][_0x5944('0xa3')]]=_0x38b63d['body'][_0x5944('0x98')];return db[_0x5944('0x8f')][_0x5944('0x59')](_0x554dad,{'fields':_0x494197,'raw':!![]});}})[_0x5944('0x20')](handleEntityNotFound(_0x430b9d,null))[_0x5944('0x20')](function(_0x2852e0){if(_0x2852e0){_0x38b63d[_0x5944('0xaa')]=_0x2852e0;var _0x3ff549={'ContactId':_0x2852e0['id'],'phone':_0x38b63d[_0x5944('0x60')][_0x5944('0x98')],'WhatsappAccountId':_0x7b6662['params']['id']};var _0x34675a={'ContactId':_0x2852e0['id'],'WhatsappAccountId':_0x7b6662[_0x5944('0x56')]['id'],'closed':![]};return db[_0x5944('0xab')][_0x5944('0x58')]({'where':_0x34675a})[_0x5944('0x20')](function(_0x31ea0f){if(_0x31ea0f){return[_0x31ea0f,![]];}return db['WhatsappInteraction'][_0x5944('0x59')](_0x3ff549)[_0x5944('0x20')](function(_0x299d5a){return[_0x299d5a,!![]];});});}})[_0x5944('0x71')](function(_0x353868,_0x4564f3){_0x38b63d['interaction']=_0x353868[_0x5944('0x36')]({'plain':!![]});_0x38b63d['interaction'][_0x5944('0xac')]=![];if(_0x4564f3){if(_0x38b63d['account'][_0x5944('0xad')]){_0x38b63d[_0x5944('0x8d')]['push']({'id':0x0,'priority':_0x38b63d[_0x5944('0x8d')][_0x5944('0x4b')]+0x1,'app':_0x5944('0xae'),'appdata':_0x5944('0xaf'),'interval':_0x5944('0xb0')});}_0x38b63d['interaction'][_0x5944('0xac')]=!![];}return db[_0x5944('0xb1')][_0x5944('0x59')]({'phone':_0x38b63d[_0x5944('0x60')]['from'],'messageId':_0x38b63d[_0x5944('0x60')]['messageId'],'body':_0x38b63d[_0x5944('0x60')]['body'],'WhatsappAccountId':_0x7b6662[_0x5944('0x56')]['id'],'WhatsappInteractionId':_0x353868['id'],'direction':'in','ContactId':_0x353868['ContactId'],'AttachmentId':_0x38b63d[_0x5944('0x60')][_0x5944('0xb2')]});})['then'](function(_0x224a86){_0x38b63d[_0x5944('0x27')]=_0x224a86;if(_0x38b63d[_0x5944('0xb3')][_0x5944('0xb4')]){return db['User']['find']({'attributes':['id',_0x5944('0x3a')],'where':{'id':_0x38b63d[_0x5944('0xb3')][_0x5944('0xb4')]}})['then'](function(_0x3dd6fe){if(_0x3dd6fe){_0x38b63d[_0x5944('0x8d')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5944('0xb5'),'appdata':_0x3dd6fe[_0x5944('0x3a')]+','+(_0x38b63d[_0x5944('0x87')][_0x5944('0xb6')]||0xa),'interval':_0x5944('0xb0')});}return respondWithRpcPromise(_0x5944('0xb7'),_0x5944('0xb8'),_0x38b63d);});}return respondWithRpcPromise('Start','startRouting',_0x38b63d);})[_0x5944('0x20')](function(_0x66041b){if(_0x66041b){var _0x5b59c0=0xc8;var _0x16843c=_0x5944('0xb9');logger[_0x5944('0x21')](_0x5944('0x24'),_0x16843c,_0x5b59c0,_0x5944('0xba'));logger[_0x5944('0xbb')](_0x5944('0xbc'),_0x16843c,_0x5b59c0,_0x5944('0xba'),JSON['stringify'](_0x66041b));if(_0x38b63d[_0x5944('0x87')][_0x5944('0x41')]==='twilio'){return _0x430b9d['status'](_0x5b59c0)['set']('Content-Type',_0x5944('0xbd'))['send']('\x0a');}else{return _0x430b9d[_0x5944('0x2b')](_0x5b59c0)[_0x5944('0x2c')](_0x66041b);}}});})[_0x5944('0x29')](handleError(_0x430b9d,null));};exports['send']=function(_0x3a9d1e,_0x56397b,_0x10b9e3){var _0x30ccfc,_0x30d419,_0x2c4022;if(_[_0x5944('0x9f')](_0x3a9d1e[_0x5944('0x60')][_0x5944('0x60')])||_0x3a9d1e['body'][_0x5944('0x60')]===''){throw new db[(_0x5944('0xa0'))]['ValidationError'](_0x5944('0xbe'));}if(_[_0x5944('0x9f')](_0x3a9d1e['body']['to'])){throw new db[(_0x5944('0xa0'))][(_0x5944('0xa1'))](_0x5944('0xbf'));}_0x30ccfc=_0x3a9d1e[_0x5944('0x60')]['to'];return db['WhatsappAccount'][_0x5944('0x58')]({'where':{'id':_0x3a9d1e[_0x5944('0x56')]['id']},'include':[{'model':db[_0x5944('0xa6')],'as':_0x5944('0xc0'),'include':[{'model':db[_0x5944('0x8f')],'as':'Contacts','where':{'mobile':_0x30ccfc},'limit':0x1,'order':[[_0x5944('0x93'),_0x5944('0xa7')]]}]}]})[_0x5944('0x20')](handleEntityNotFound(_0x56397b,null))[_0x5944('0x20')](function(_0x59c047){if(_0x59c047&&_0x59c047[_0x5944('0xc0')]){_0x30d419=_0x59c047[_0x5944('0x36')]({'plain':!![]});if(_0x30d419[_0x5944('0xc0')]&&_0x30d419[_0x5944('0xc0')]['Contacts']['length']){return _0x30d419[_0x5944('0xc0')][_0x5944('0xa9')][0x0];}return db[_0x5944('0x8f')][_0x5944('0x59')](_['defaults'](_0x3a9d1e[_0x5944('0x60')],{'firstName':_0x30ccfc,'mobile':_0x30ccfc,'phone':_0x30ccfc,'ListId':_0x30d419[_0x5944('0x95')]}));}})['then'](handleEntityNotFound(_0x56397b,null))[_0x5944('0x20')](function(_0x72d55c){if(_0x72d55c){_0x2c4022=_0x72d55c;return db[_0x5944('0xab')][_0x5944('0x58')]({'where':{'ContactId':_0x2c4022['id'],'closed':![],'WhatsappAccountId':_0x30d419['id']}})[_0x5944('0x20')](function(_0x24c79e){if(_0x24c79e){return[_0x24c79e,![]];}return db[_0x5944('0xab')][_0x5944('0x59')]({'UserId':_0x3a9d1e[_0x5944('0x5a')]['id'],'ContactId':_0x2c4022['id'],'WhatsappAccountId':_0x30d419['id'],'phone':_0x30ccfc,'firstMsgDirection':_0x5944('0xc1'),'Messages':[_[_0x5944('0x52')](_0x3a9d1e[_0x5944('0x60')],{'read':![],'body':_0x3a9d1e[_0x5944('0x60')]['body'],'phone':_0x30ccfc,'WhatsappAccountId':_0x30d419['id'],'UserId':_0x3a9d1e['user']['id'],'ContactId':_0x2c4022['id']})]},{'include':[{'model':db[_0x5944('0xb1')],'as':_0x5944('0xc2')}]})[_0x5944('0x20')](function(_0x45fa22){return[_0x45fa22,!![]];});});}})['spread'](function(_0x567b52,_0x126fc0){if(_0x126fc0){return _0x567b52;}return db['WhatsappMessage'][_0x5944('0x59')](_['merge'](_0x3a9d1e[_0x5944('0x60')],{'read':![],'body':_0x3a9d1e[_0x5944('0x60')]['body'],'phone':_0x30ccfc,'WhatsappAccountId':_0x30d419['id'],'WhatsappInteractionId':_0x567b52['id'],'UserId':_0x3a9d1e['user']['id'],'ContactId':_0x2c4022['id']}))['then'](function(_0x5cf5c0){_0x567b52[_0x5944('0xc3')][_0x5944('0xc2')]=[];_0x567b52[_0x5944('0xc3')][_0x5944('0xc2')][_0x5944('0xc4')](_0x5cf5c0['dataValues']);return _0x567b52;});})[_0x5944('0x20')](respondWithResult(_0x56397b,null))[_0x5944('0x29')](handleError(_0x56397b,null));}; \ No newline at end of file +var _0x8546=['stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','include','rows','show','params','fields','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','filter','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','options','findAll','addAgents','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','WhatsappApplication','findAndCountAll','priority','finally','getApplications','notify','whatsapp','Applications','account','statuses','state','read','WhatsappMessage','timestamp','applications','orderBy','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','from','From','replace','whatsapp:','messageId','sinch','notifications','message_id','Sequelize','from\x20is\x20mandatory','isNil','mapKey','includes','CmList','Contacts','DESC','list','omit','defaults','contact','WhatsappInteraction','created','autoclose','push','close','*,*,*,*','interaction','UserId','User','unshift','startRouting','Start','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','text/xml','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./whatsappAccount.socket','register','client','request','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','UserProfileResource','destroy'];(function(_0x7a6824,_0x5354e2){var _0x3ab46c=function(_0x6af0e3){while(--_0x6af0e3){_0x7a6824['push'](_0x7a6824['shift']());}};_0x3ab46c(++_0x5354e2);}(_0x8546,0x8b));var _0x6854=function(_0x4719f1,_0x1e0fb4){_0x4719f1=_0x4719f1-0x0;var _0x96182a=_0x8546[_0x4719f1];return _0x96182a;};'use strict';var emlformat=require(_0x6854('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6854('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6854('0x2'));var moment=require(_0x6854('0x3'));var BPromise=require(_0x6854('0x4'));var Mustache=require(_0x6854('0x5'));var util=require(_0x6854('0x6'));var path=require(_0x6854('0x7'));var sox=require('sox');var csv=require(_0x6854('0x8'));var ejs=require(_0x6854('0x9'));var fs=require('fs');var fs_extra=require(_0x6854('0xa'));var _=require('lodash');var squel=require(_0x6854('0xb'));var crypto=require('crypto');var jsforce=require(_0x6854('0xc'));var deskjs=require(_0x6854('0xd'));var toCsv=require(_0x6854('0x8'));var querystring=require(_0x6854('0xe'));var Papa=require(_0x6854('0xf'));var Redis=require('ioredis');var authService=require(_0x6854('0x10'));var qs=require(_0x6854('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6854('0x12'));var logger=require('../../config/logger')(_0x6854('0x13'));var utils=require(_0x6854('0x14'));var config=require(_0x6854('0x15'));var licenseUtil=require(_0x6854('0x16'));var db=require('../../mysqldb')['db'];config[_0x6854('0x17')]=_['defaults'](config[_0x6854('0x17')],{'host':_0x6854('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6854('0x17')]));require(_0x6854('0x19'))[_0x6854('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6854('0x1b')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3d400a,_0x5e3e48,_0x869b49,_0x3d1270){return new BPromise(function(_0x4724ca,_0x31693b){var _0x4abae8=_0x3d1270||client;return _0x4abae8[_0x6854('0x1c')](_0x3d400a,_0x869b49)['then'](function(_0x4bc075){logger[_0x6854('0x1d')]('WhatsappAccount,\x20%s,\x20%s',_0x5e3e48,_0x6854('0x1e'));logger[_0x6854('0x1f')](_0x6854('0x20'),_0x5e3e48,_0x6854('0x1e'),JSON[_0x6854('0x21')](_0x4bc075));if(_0x4bc075[_0x6854('0x22')]){if(_0x4bc075[_0x6854('0x22')][_0x6854('0x23')]===0x1f4){logger[_0x6854('0x22')](_0x6854('0x24'),_0x5e3e48,_0x4bc075[_0x6854('0x22')][_0x6854('0x25')]);return _0x31693b(_0x4bc075['error']['message']);}logger[_0x6854('0x22')](_0x6854('0x24'),_0x5e3e48,_0x4bc075[_0x6854('0x22')][_0x6854('0x25')]);return _0x4724ca(_0x4bc075[_0x6854('0x22')]['message']);}else{logger[_0x6854('0x1d')](_0x6854('0x24'),_0x5e3e48,_0x6854('0x1e'));_0x4724ca(_0x4bc075['result']['message']);}})[_0x6854('0x26')](function(_0x3886a0){logger[_0x6854('0x22')](_0x6854('0x24'),_0x5e3e48,_0x3886a0);_0x31693b(_0x3886a0);});});}function respondWithStatusCode(_0x142951,_0x159d3d){_0x159d3d=_0x159d3d||0xcc;return function(_0xe2e031){if(_0xe2e031){return _0x142951[_0x6854('0x27')](_0x159d3d);}return _0x142951[_0x6854('0x28')](_0x159d3d)[_0x6854('0x29')]();};}function respondWithResult(_0x10b04e,_0x4d7f54){_0x4d7f54=_0x4d7f54||0xc8;return function(_0x37f1ff){if(_0x37f1ff){return _0x10b04e[_0x6854('0x28')](_0x4d7f54)[_0x6854('0x2a')](_0x37f1ff);}};}function respondWithFilteredResult(_0x502485,_0x4dae53){return function(_0x3200c3){if(_0x3200c3){var _0x449bb7=typeof _0x4dae53[_0x6854('0x2b')]===_0x6854('0x2c')&&typeof _0x4dae53[_0x6854('0x2d')]===_0x6854('0x2c');var _0xe079f=_0x3200c3[_0x6854('0x2e')];var _0x571053=_0x449bb7?0x0:_0x4dae53[_0x6854('0x2b')];var _0x5dee14=_0x449bb7?_0x3200c3[_0x6854('0x2e')]:_0x4dae53[_0x6854('0x2b')]+_0x4dae53[_0x6854('0x2d')];var _0x2ca2bf;if(_0x5dee14>=_0xe079f){_0x5dee14=_0xe079f;_0x2ca2bf=0xc8;}else{_0x2ca2bf=0xce;}_0x502485[_0x6854('0x28')](_0x2ca2bf);return _0x502485[_0x6854('0x2f')](_0x6854('0x30'),_0x571053+'-'+_0x5dee14+'/'+_0xe079f)['json'](_0x3200c3);}return null;};}function patchUpdates(_0x3fa8a8){return function(_0x4c31a9){try{jsonpatch[_0x6854('0x31')](_0x4c31a9,_0x3fa8a8,!![]);}catch(_0x22f5f0){return BPromise[_0x6854('0x32')](_0x22f5f0);}return _0x4c31a9['save']();};}function saveUpdates(_0x54f4d0,_0x18a8d2){return function(_0x5de7d6){if(_0x5de7d6){return _0x5de7d6[_0x6854('0x33')](_0x54f4d0)[_0x6854('0x34')](function(_0x5ad053){return _0x5ad053;});}return null;};}function removeEntity(_0xe4f0da,_0x2adf08){return function(_0xd08979){if(_0xd08979){return _0xd08979['destroy']()['then'](function(){var _0x4bdbf9=_0xd08979['get']({'plain':!![]});var _0x5d6247='WhatsappAccounts';return db[_0x6854('0x35')][_0x6854('0x36')]({'where':{'type':_0x5d6247,'resourceId':_0x4bdbf9['id']}})[_0x6854('0x34')](function(){return _0xd08979;});})[_0x6854('0x34')](function(){_0xe4f0da['status'](0xcc)[_0x6854('0x29')]();});}};}function handleEntityNotFound(_0x3d4956,_0xf1816d){return function(_0x18d9e7){if(!_0x18d9e7){_0x3d4956['sendStatus'](0x194);}return _0x18d9e7;};}function handleError(_0x503145,_0x491743){_0x491743=_0x491743||0x1f4;return function(_0x4faaea){logger['error'](_0x4faaea[_0x6854('0x37')]);if(_0x4faaea[_0x6854('0x38')]){delete _0x4faaea['name'];}_0x503145[_0x6854('0x28')](_0x491743)[_0x6854('0x39')](_0x4faaea);};}exports[_0x6854('0x3a')]=function(_0x2cc131,_0x2e993c){var _0x1e2eac={'include':[{'model':db[_0x6854('0x3b')],'as':_0x6854('0x3c')}]},_0x167084={},_0x1d4f71={'count':0x0,'rows':[]};var _0x4589f2=_[_0x6854('0x3d')](db[_0x6854('0x3e')][_0x6854('0x3f')],function(_0x2e6d4d){return{'name':_0x2e6d4d[_0x6854('0x40')],'type':_0x2e6d4d[_0x6854('0x41')]['key']};});_0x167084[_0x6854('0x42')]=_[_0x6854('0x3d')](_0x4589f2,_0x6854('0x38'));_0x167084[_0x6854('0x43')]=_[_0x6854('0x44')](_0x2cc131['query']);_0x167084[_0x6854('0x45')]=_[_0x6854('0x46')](_0x167084[_0x6854('0x42')],_0x167084[_0x6854('0x43')]);_0x1e2eac['attributes']=_[_0x6854('0x46')](_0x167084[_0x6854('0x42')],qs['fields'](_0x2cc131[_0x6854('0x43')]['fields']));_0x1e2eac[_0x6854('0x47')]=_0x1e2eac[_0x6854('0x47')][_0x6854('0x48')]?_0x1e2eac[_0x6854('0x47')]:_0x167084['model'];if(!_0x2cc131[_0x6854('0x43')][_0x6854('0x49')](_0x6854('0x4a'))){_0x1e2eac[_0x6854('0x2d')]=qs[_0x6854('0x2d')](_0x2cc131[_0x6854('0x43')][_0x6854('0x2d')]);_0x1e2eac[_0x6854('0x2b')]=qs[_0x6854('0x2b')](_0x2cc131[_0x6854('0x43')][_0x6854('0x2b')]);}_0x1e2eac[_0x6854('0x4b')]=qs[_0x6854('0x4c')](_0x2cc131[_0x6854('0x43')][_0x6854('0x4c')]);_0x1e2eac[_0x6854('0x4d')]=qs[_0x6854('0x45')](_[_0x6854('0x4e')](_0x2cc131['query'],_0x167084['filters']),_0x4589f2);if(_0x2cc131[_0x6854('0x43')]['filter']){_0x1e2eac['where']=_[_0x6854('0x4f')](_0x1e2eac[_0x6854('0x4d')],{'$or':_[_0x6854('0x3d')](_0x4589f2,function(_0x2fe2bf){if(_0x2fe2bf[_0x6854('0x41')]!==_0x6854('0x50')){var _0x1e5999={};_0x1e5999[_0x2fe2bf['name']]={'$like':'%'+_0x2cc131['query']['filter']+'%'};return _0x1e5999;}})});}_0x1e2eac=_[_0x6854('0x4f')]({},_0x1e2eac,_0x2cc131['options']);var _0x1c9130={'where':_0x1e2eac[_0x6854('0x4d')]};return db[_0x6854('0x3e')][_0x6854('0x2e')](_0x1c9130)[_0x6854('0x34')](function(_0x10b385){_0x1d4f71[_0x6854('0x2e')]=_0x10b385;if(_0x2cc131[_0x6854('0x43')]['includeAll']){_0x1e2eac[_0x6854('0x51')]=[{'all':!![]}];}return db[_0x6854('0x3e')]['findAll'](_0x1e2eac);})[_0x6854('0x34')](function(_0x326ba6){_0x1d4f71[_0x6854('0x52')]=_0x326ba6;return _0x1d4f71;})[_0x6854('0x34')](respondWithFilteredResult(_0x2e993c,_0x1e2eac))['catch'](handleError(_0x2e993c,null));};exports[_0x6854('0x53')]=function(_0x1f7e63,_0x52b862){var _0x10044b={'raw':![],'where':{'id':_0x1f7e63[_0x6854('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0x6854('0x3c')}]},_0x1c583f={};_0x1c583f['model']=_['keys'](db[_0x6854('0x3e')][_0x6854('0x3f')]);_0x1c583f[_0x6854('0x43')]=_[_0x6854('0x44')](_0x1f7e63[_0x6854('0x43')]);_0x1c583f['filters']=_[_0x6854('0x46')](_0x1c583f[_0x6854('0x42')],_0x1c583f[_0x6854('0x43')]);_0x10044b[_0x6854('0x47')]=_[_0x6854('0x46')](_0x1c583f['model'],qs['fields'](_0x1f7e63[_0x6854('0x43')][_0x6854('0x55')]));_0x10044b['attributes']=_0x10044b['attributes'][_0x6854('0x48')]?_0x10044b['attributes']:_0x1c583f['model'];if(_0x1f7e63[_0x6854('0x43')][_0x6854('0x56')]){_0x10044b[_0x6854('0x51')]=[{'all':!![]}];}_0x10044b=_[_0x6854('0x4f')]({},_0x10044b,_0x1f7e63['options']);return db[_0x6854('0x3e')][_0x6854('0x57')](_0x10044b)[_0x6854('0x34')](handleEntityNotFound(_0x52b862,null))[_0x6854('0x34')](respondWithResult(_0x52b862,null))['catch'](handleError(_0x52b862,null));};exports[_0x6854('0x58')]=function(_0x1cf740,_0x2c88d6){return db[_0x6854('0x3e')][_0x6854('0x58')](_0x1cf740[_0x6854('0x59')],{})['then'](function(_0x29418b){var _0x58326e=_0x1cf740[_0x6854('0x5a')][_0x6854('0x5b')]({'plain':!![]});if(!_0x58326e)throw new Error(_0x6854('0x5c'));if(_0x58326e[_0x6854('0x5d')]===_0x6854('0x5a')){var _0x4a6690=_0x29418b[_0x6854('0x5b')]({'plain':!![]});var _0x1f5e68='WhatsappAccounts';return db[_0x6854('0x5e')][_0x6854('0x57')]({'where':{'name':_0x1f5e68,'userProfileId':_0x58326e[_0x6854('0x5f')]},'raw':!![]})[_0x6854('0x34')](function(_0x502bfa){if(_0x502bfa&&_0x502bfa['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4a6690[_0x6854('0x38')],'resourceId':_0x4a6690['id'],'type':_0x502bfa['name'],'sectionId':_0x502bfa['id']},{})['then'](function(){return _0x29418b;});}else{return _0x29418b;}})[_0x6854('0x26')](function(_0x5a5b6f){logger['error'](_0x6854('0x60'),_0x5a5b6f);throw _0x5a5b6f;});}return _0x29418b;})[_0x6854('0x34')](respondWithResult(_0x2c88d6,0xc9))['catch'](handleError(_0x2c88d6,null));};exports['update']=function(_0x31c4eb,_0x24ee1c){if(_0x31c4eb[_0x6854('0x59')]['id']){delete _0x31c4eb['body']['id'];}return db[_0x6854('0x3e')][_0x6854('0x57')]({'where':{'id':_0x31c4eb[_0x6854('0x54')]['id']},'include':[{'model':db[_0x6854('0x3b')],'as':_0x6854('0x3c')}]})[_0x6854('0x34')](handleEntityNotFound(_0x24ee1c,null))[_0x6854('0x34')](saveUpdates(_0x31c4eb[_0x6854('0x59')],null))['then'](respondWithResult(_0x24ee1c,null))[_0x6854('0x26')](handleError(_0x24ee1c,null));};exports[_0x6854('0x36')]=function(_0x4d5108,_0x581601){return db[_0x6854('0x3e')][_0x6854('0x57')]({'where':{'id':_0x4d5108[_0x6854('0x54')]['id']}})[_0x6854('0x34')](handleEntityNotFound(_0x581601,null))[_0x6854('0x34')](removeEntity(_0x581601,null))['catch'](handleError(_0x581601,null));};exports[_0x6854('0x61')]=function(_0x2809dc,_0x591ffb){return db[_0x6854('0x3e')][_0x6854('0x61')]()[_0x6854('0x34')](respondWithResult(_0x591ffb,null))[_0x6854('0x26')](handleError(_0x591ffb,null));};exports[_0x6854('0x62')]=function(_0x546d6f,_0x5b29f2,_0x741739){if(_0x546d6f['body']['id']){delete _0x546d6f[_0x6854('0x59')]['id'];}return db[_0x6854('0x3e')][_0x6854('0x57')]({'where':{'id':_0x546d6f['params']['id']}})[_0x6854('0x34')](handleEntityNotFound(_0x5b29f2,null))[_0x6854('0x34')](function(_0x55487d){if(_0x55487d){_0x546d6f['body'][_0x6854('0x63')]=_0x55487d['id'];return db[_0x6854('0x64')][_0x6854('0x58')](_0x546d6f[_0x6854('0x59')]);}})[_0x6854('0x34')](respondWithResult(_0x5b29f2,null))[_0x6854('0x26')](handleError(_0x5b29f2,null));};exports['getDispositions']=function(_0x66ab5d,_0xb56724,_0x4038d6){var _0x44c216={'raw':![],'where':{}};var _0x1e5ff3={};var _0x208e8d={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x66ab5d[_0x6854('0x54')]['id']}})[_0x6854('0x34')](handleEntityNotFound(_0xb56724,null))[_0x6854('0x34')](function(_0x1e8ffe){if(_0x1e8ffe){_0x1e5ff3['model']=_[_0x6854('0x44')](db[_0x6854('0x64')][_0x6854('0x3f')]);_0x1e5ff3[_0x6854('0x43')]=_['keys'](_0x66ab5d['query']);_0x1e5ff3[_0x6854('0x45')]=_[_0x6854('0x46')](_0x1e5ff3[_0x6854('0x42')],_0x1e5ff3[_0x6854('0x43')]);_0x44c216[_0x6854('0x47')]=_[_0x6854('0x46')](_0x1e5ff3[_0x6854('0x42')],qs[_0x6854('0x55')](_0x66ab5d[_0x6854('0x43')][_0x6854('0x55')]));_0x44c216[_0x6854('0x47')]=_0x44c216['attributes'][_0x6854('0x48')]?_0x44c216['attributes']:_0x1e5ff3[_0x6854('0x42')];if(!_0x66ab5d[_0x6854('0x43')][_0x6854('0x49')](_0x6854('0x4a'))){_0x44c216[_0x6854('0x2d')]=qs['limit'](_0x66ab5d[_0x6854('0x43')][_0x6854('0x2d')]);_0x44c216[_0x6854('0x2b')]=qs[_0x6854('0x2b')](_0x66ab5d['query'][_0x6854('0x2b')]);}_0x44c216[_0x6854('0x4b')]=qs[_0x6854('0x4c')](_0x66ab5d[_0x6854('0x43')][_0x6854('0x4c')]);_0x44c216[_0x6854('0x4d')]=qs['filters'](_[_0x6854('0x4e')](_0x66ab5d[_0x6854('0x43')],_0x1e5ff3[_0x6854('0x45')]));_0x44c216[_0x6854('0x4d')][_0x6854('0x63')]=_0x1e8ffe['id'];if(_0x66ab5d['query'][_0x6854('0x65')]){_0x44c216[_0x6854('0x4d')]=_[_0x6854('0x4f')](_0x44c216['where'],{'$or':_[_0x6854('0x3d')](_0x44c216[_0x6854('0x47')],function(_0x1c8913){var _0x2246f1={};_0x2246f1[_0x1c8913]={'$like':'%'+_0x66ab5d[_0x6854('0x43')][_0x6854('0x65')]+'%'};return _0x2246f1;})});}_0x44c216=_['merge']({},_0x44c216,_0x66ab5d['options']);return db[_0x6854('0x64')][_0x6854('0x2e')]({'where':_0x44c216['where']})[_0x6854('0x34')](function(_0x49436e){_0x208e8d[_0x6854('0x2e')]=_0x49436e;if(_0x66ab5d['query'][_0x6854('0x56')]){_0x44c216['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x44c216);})[_0x6854('0x34')](function(_0x16e342){_0x208e8d[_0x6854('0x52')]=_0x16e342;return _0x208e8d;});}})['then'](respondWithFilteredResult(_0xb56724,_0x44c216))[_0x6854('0x26')](handleError(_0xb56724,null));};exports[_0x6854('0x66')]=function(_0x3982bf,_0x5b3f8b,_0x1e3a8e){return db[_0x6854('0x3e')][_0x6854('0x57')]({'where':{'id':_0x3982bf[_0x6854('0x54')]['id']}})[_0x6854('0x34')](handleEntityNotFound(_0x5b3f8b,null))['then'](function(_0x27de18){if(_0x27de18){return _0x27de18['removeDispositions'](_0x3982bf['query'][_0x6854('0x67')]);}})[_0x6854('0x34')](respondWithStatusCode(_0x5b3f8b,null))[_0x6854('0x26')](handleError(_0x5b3f8b,null));};exports[_0x6854('0x68')]=function(_0x1a274d,_0x1cd574,_0x4b3b67){if(_0x1a274d['body']['id']){delete _0x1a274d[_0x6854('0x59')]['id'];}return db[_0x6854('0x3e')][_0x6854('0x57')]({'where':{'id':_0x1a274d[_0x6854('0x54')]['id']}})[_0x6854('0x34')](handleEntityNotFound(_0x1cd574,null))[_0x6854('0x34')](function(_0x5b9434){if(_0x5b9434){_0x1a274d['body'][_0x6854('0x63')]=_0x5b9434['id'];return db[_0x6854('0x69')][_0x6854('0x58')](_0x1a274d['body']);}})['then'](respondWithResult(_0x1cd574,null))['catch'](handleError(_0x1cd574,null));};exports[_0x6854('0x6a')]=function(_0x2e8d3a,_0xe7e3b4,_0x1bcdfd){var _0x150859={'raw':![],'where':{}};var _0x356945={};var _0x17b357={'count':0x0,'rows':[]};return db[_0x6854('0x3e')][_0x6854('0x6b')]({'where':{'id':_0x2e8d3a[_0x6854('0x54')]['id']}})['then'](handleEntityNotFound(_0xe7e3b4,null))[_0x6854('0x34')](function(_0xbe931d){if(_0xbe931d){_0x356945[_0x6854('0x42')]=_[_0x6854('0x44')](db[_0x6854('0x69')]['rawAttributes']);_0x356945[_0x6854('0x43')]=_[_0x6854('0x44')](_0x2e8d3a[_0x6854('0x43')]);_0x356945[_0x6854('0x45')]=_[_0x6854('0x46')](_0x356945[_0x6854('0x42')],_0x356945[_0x6854('0x43')]);_0x150859[_0x6854('0x47')]=_['intersection'](_0x356945['model'],qs['fields'](_0x2e8d3a['query'][_0x6854('0x55')]));_0x150859[_0x6854('0x47')]=_0x150859['attributes'][_0x6854('0x48')]?_0x150859[_0x6854('0x47')]:_0x356945[_0x6854('0x42')];if(!_0x2e8d3a['query'][_0x6854('0x49')](_0x6854('0x4a'))){_0x150859[_0x6854('0x2d')]=qs[_0x6854('0x2d')](_0x2e8d3a[_0x6854('0x43')][_0x6854('0x2d')]);_0x150859['offset']=qs[_0x6854('0x2b')](_0x2e8d3a[_0x6854('0x43')][_0x6854('0x2b')]);}_0x150859[_0x6854('0x4b')]=qs[_0x6854('0x4c')](_0x2e8d3a[_0x6854('0x43')][_0x6854('0x4c')]);_0x150859[_0x6854('0x4d')]=qs['filters'](_[_0x6854('0x4e')](_0x2e8d3a[_0x6854('0x43')],_0x356945[_0x6854('0x45')]));_0x150859['where'][_0x6854('0x63')]=_0xbe931d['id'];if(_0x2e8d3a[_0x6854('0x43')][_0x6854('0x65')]){_0x150859['where']=_['merge'](_0x150859[_0x6854('0x4d')],{'$or':_['map'](_0x150859[_0x6854('0x47')],function(_0x156f80){var _0x61754c={};_0x61754c[_0x156f80]={'$like':'%'+_0x2e8d3a[_0x6854('0x43')][_0x6854('0x65')]+'%'};return _0x61754c;})});}_0x150859=_[_0x6854('0x4f')]({},_0x150859,_0x2e8d3a[_0x6854('0x6c')]);return db[_0x6854('0x69')][_0x6854('0x2e')]({'where':_0x150859[_0x6854('0x4d')]})[_0x6854('0x34')](function(_0x35f14a){_0x17b357[_0x6854('0x2e')]=_0x35f14a;if(_0x2e8d3a[_0x6854('0x43')][_0x6854('0x56')]){_0x150859[_0x6854('0x51')]=[{'all':!![]}];}return db[_0x6854('0x69')][_0x6854('0x6d')](_0x150859);})[_0x6854('0x34')](function(_0x150aa2){_0x17b357[_0x6854('0x52')]=_0x150aa2;return _0x17b357;});}})[_0x6854('0x34')](respondWithFilteredResult(_0xe7e3b4,_0x150859))[_0x6854('0x26')](handleError(_0xe7e3b4,null));};exports['removeAnswers']=function(_0x22a4bd,_0x2fddfb,_0x949a58){return db[_0x6854('0x3e')]['find']({'where':{'id':_0x22a4bd[_0x6854('0x54')]['id']}})[_0x6854('0x34')](handleEntityNotFound(_0x2fddfb,null))[_0x6854('0x34')](function(_0x3ee1f7){if(_0x3ee1f7){return _0x3ee1f7['removeAnswers'](_0x22a4bd[_0x6854('0x43')][_0x6854('0x67')]);}})[_0x6854('0x34')](respondWithStatusCode(_0x2fddfb,null))[_0x6854('0x26')](handleError(_0x2fddfb,null));};exports[_0x6854('0x6e')]=function(_0x4dfe11,_0x3daaeb,_0x1a822e){return db['WhatsappAccount'][_0x6854('0x57')]({'where':{'id':_0x4dfe11[_0x6854('0x54')]['id']}})[_0x6854('0x34')](handleEntityNotFound(_0x3daaeb,null))[_0x6854('0x34')](function(_0x365cf8){if(_0x365cf8){return _0x365cf8[_0x6854('0x6e')](_0x4dfe11[_0x6854('0x59')]['ids'],_['omit'](_0x4dfe11[_0x6854('0x59')],[_0x6854('0x67'),'id'])||{})[_0x6854('0x6f')](function(_0x25b30e){for(var _0x18f82e=0x0;_0x18f82e<_0x4dfe11[_0x6854('0x59')][_0x6854('0x67')][_0x6854('0x48')];_0x18f82e+=0x1){socket[_0x6854('0x70')](_0x6854('0x71'),{'UserId':Number(_0x4dfe11[_0x6854('0x59')][_0x6854('0x67')][_0x18f82e]),'WhatsappAccountId':Number(_0x4dfe11[_0x6854('0x54')]['id'])});}return _0x25b30e;});}})[_0x6854('0x34')](respondWithResult(_0x3daaeb,null))['catch'](handleError(_0x3daaeb,null));};exports[_0x6854('0x72')]=function(_0x5de1c3,_0x182ab5,_0x2e0def){return db[_0x6854('0x3e')][_0x6854('0x57')]({'where':{'id':_0x5de1c3[_0x6854('0x54')]['id']}})['then'](handleEntityNotFound(_0x182ab5,null))[_0x6854('0x34')](function(_0x8821e){if(_0x8821e){return _0x8821e[_0x6854('0x72')](_0x5de1c3['query'][_0x6854('0x67')])[_0x6854('0x34')](function(){if(_[_0x6854('0x73')](_0x5de1c3[_0x6854('0x43')][_0x6854('0x67')])){for(var _0x547351=0x0;_0x547351<_0x5de1c3[_0x6854('0x43')][_0x6854('0x67')][_0x6854('0x48')];_0x547351+=0x1){socket[_0x6854('0x70')](_0x6854('0x74'),{'UserId':Number(_0x5de1c3['query'][_0x6854('0x67')][_0x547351]),'WhatsappAccountId':Number(_0x5de1c3[_0x6854('0x54')]['id'])});}}else{socket[_0x6854('0x70')]('userWhatsappAccount:remove',{'UserId':Number(_0x5de1c3['query'][_0x6854('0x67')]),'WhatsappAccountId':Number(_0x5de1c3['params']['id'])});}});}})[_0x6854('0x34')](respondWithStatusCode(_0x182ab5,null))[_0x6854('0x26')](handleError(_0x182ab5,null));};exports[_0x6854('0x75')]=function(_0x429440,_0x52fd9d,_0x838c9d){var _0x5918be={};var _0x53ae8e={};var _0x1f2012;var _0x5bb1ee;return db[_0x6854('0x3e')][_0x6854('0x6b')]({'where':{'id':_0x429440['params']['id']}})[_0x6854('0x34')](handleEntityNotFound(_0x52fd9d,null))[_0x6854('0x34')](function(_0xbd121b){if(_0xbd121b){_0x1f2012=_0xbd121b;_0x53ae8e[_0x6854('0x42')]=_[_0x6854('0x44')](db['User'][_0x6854('0x3f')]);_0x53ae8e[_0x6854('0x43')]=_[_0x6854('0x44')](_0x429440[_0x6854('0x43')]);_0x53ae8e[_0x6854('0x45')]=_[_0x6854('0x46')](_0x53ae8e[_0x6854('0x42')],_0x53ae8e[_0x6854('0x43')]);_0x5918be[_0x6854('0x47')]=_[_0x6854('0x46')](_0x53ae8e[_0x6854('0x42')],qs['fields'](_0x429440[_0x6854('0x43')][_0x6854('0x55')]));_0x5918be['attributes']=_0x5918be[_0x6854('0x47')][_0x6854('0x48')]?_0x5918be[_0x6854('0x47')]:_0x53ae8e['model'];_0x5918be[_0x6854('0x4b')]=qs['sort'](_0x429440[_0x6854('0x43')]['sort']);_0x5918be[_0x6854('0x4d')]=qs['filters'](_[_0x6854('0x4e')](_0x429440['query'],_0x53ae8e['filters']));if(_0x429440[_0x6854('0x43')][_0x6854('0x65')]){_0x5918be[_0x6854('0x4d')]=_[_0x6854('0x4f')](_0x5918be['where'],{'$or':_[_0x6854('0x3d')](_0x5918be[_0x6854('0x47')],function(_0x97ae12){var _0x2fc982={};_0x2fc982[_0x97ae12]={'$like':'%'+_0x429440[_0x6854('0x43')][_0x6854('0x65')]+'%'};return _0x2fc982;})});}_0x5918be=_['merge']({},_0x5918be,_0x429440['options']);return _0x1f2012[_0x6854('0x75')](_0x5918be);}})[_0x6854('0x34')](function(_0x388cab){if(_0x388cab){_0x5bb1ee=_0x388cab[_0x6854('0x48')];if(!_0x429440[_0x6854('0x43')][_0x6854('0x49')](_0x6854('0x4a'))){_0x5918be[_0x6854('0x2d')]=qs[_0x6854('0x2d')](_0x429440[_0x6854('0x43')]['limit']);_0x5918be[_0x6854('0x2b')]=qs[_0x6854('0x2b')](_0x429440[_0x6854('0x43')]['offset']);}return _0x1f2012[_0x6854('0x75')](_0x5918be);}})[_0x6854('0x34')](function(_0x2d054){if(_0x2d054){return _0x2d054?{'count':_0x5bb1ee,'rows':_0x2d054}:null;}})[_0x6854('0x34')](respondWithResult(_0x52fd9d,null))['catch'](handleError(_0x52fd9d,null));};exports[_0x6854('0x76')]=function(_0x405253,_0x24dab9){var _0x578049=_0x405253[_0x6854('0x54')]['id'];var _0x3576f5=_0x405253[_0x6854('0x59')];var _0x16aec1=0xc8;var _0x3cd9c5=null;return db['sequelize'][_0x6854('0x77')]({'isolationLevel':db[_0x6854('0x78')][_0x6854('0x79')][_0x6854('0x7a')][_0x6854('0x7b')]},function(_0x50d97e){return db[_0x6854('0x3e')][_0x6854('0x6b')]({'where':{'id':_0x578049},'transaction':_0x50d97e})[_0x6854('0x34')](function(_0x68b15b){if(_0x68b15b){return db['WhatsappApplication'][_0x6854('0x36')]({'where':{'WhatsappAccountId':_0x578049},'transaction':_0x50d97e})[_0x6854('0x34')](function(){var _0x1f95c2=_[_0x6854('0x3d')](_0x3576f5,function(_0x51076a){_0x51076a[_0x6854('0x63')]=_0x578049;return _0x51076a;});return db['WhatsappApplication'][_0x6854('0x7c')](_0x1f95c2,{'transaction':_0x50d97e});});}else{_0x16aec1=0x194;_0x3cd9c5=[];}});})[_0x6854('0x34')](function(){if(_0x16aec1!==0x194){return db[_0x6854('0x7d')][_0x6854('0x7e')]({'where':{'WhatsappAccountId':_0x578049},'order':_0x6854('0x7f')})['then'](function(_0x47f7f6){_0x3cd9c5=_0x47f7f6;});}})[_0x6854('0x26')](function(_0x3c27cb){_0x16aec1=0x1f4;logger[_0x6854('0x22')](_0x3c27cb[_0x6854('0x37')]);if(_0x3c27cb['name']){delete _0x3c27cb['name'];}_0x3cd9c5=_0x3c27cb;})[_0x6854('0x80')](function(){if(_0x3cd9c5===null){_0x24dab9[_0x6854('0x27')](_0x16aec1);}else{if(_0x16aec1===0x1f4){_0x24dab9[_0x6854('0x28')](_0x16aec1)['send'](_0x3cd9c5);}else{_0x24dab9[_0x6854('0x28')](_0x16aec1)[_0x6854('0x2a')](_0x3cd9c5);}}});};exports[_0x6854('0x81')]=function(_0x4c5d80,_0x57f629,_0x2145de){var _0x6195af={};var _0x6745db={};var _0x50374a;var _0x212c5c;return db[_0x6854('0x3e')]['findOne']({'where':{'id':_0x4c5d80[_0x6854('0x54')]['id']}})[_0x6854('0x34')](handleEntityNotFound(_0x57f629,null))[_0x6854('0x34')](function(_0xa31b43){if(_0xa31b43){_0x50374a=_0xa31b43;_0x6745db[_0x6854('0x42')]=_[_0x6854('0x44')](db[_0x6854('0x7d')][_0x6854('0x3f')]);_0x6745db[_0x6854('0x43')]=_[_0x6854('0x44')](_0x4c5d80['query']);_0x6745db['filters']=_['intersection'](_0x6745db[_0x6854('0x42')],_0x6745db['query']);_0x6195af[_0x6854('0x47')]=_['intersection'](_0x6745db['model'],qs['fields'](_0x4c5d80['query']['fields']));_0x6195af[_0x6854('0x47')]=_0x6195af[_0x6854('0x47')]['length']?_0x6195af[_0x6854('0x47')]:_0x6745db[_0x6854('0x42')];_0x6195af['order']=qs[_0x6854('0x4c')](_0x4c5d80[_0x6854('0x43')]['sort']);_0x6195af['where']=qs[_0x6854('0x45')](_[_0x6854('0x4e')](_0x4c5d80[_0x6854('0x43')],_0x6745db[_0x6854('0x45')]));if(_0x4c5d80[_0x6854('0x43')]['filter']){_0x6195af[_0x6854('0x4d')]=_[_0x6854('0x4f')](_0x6195af[_0x6854('0x4d')],{'$or':_[_0x6854('0x3d')](_0x6195af[_0x6854('0x47')],function(_0x1919e1){var _0x45f8b7={};_0x45f8b7[_0x1919e1]={'$like':'%'+_0x4c5d80[_0x6854('0x43')][_0x6854('0x65')]+'%'};return _0x45f8b7;})});}_0x6195af=_[_0x6854('0x4f')]({},_0x6195af,_0x4c5d80[_0x6854('0x6c')]);return _0x50374a[_0x6854('0x81')](_0x6195af);}})[_0x6854('0x34')](function(_0x3ea04b){if(_0x3ea04b){_0x212c5c=_0x3ea04b[_0x6854('0x48')];if(!_0x4c5d80['query'][_0x6854('0x49')](_0x6854('0x4a'))){_0x6195af[_0x6854('0x2d')]=qs['limit'](_0x4c5d80[_0x6854('0x43')][_0x6854('0x2d')]);_0x6195af[_0x6854('0x2b')]=qs['offset'](_0x4c5d80[_0x6854('0x43')]['offset']);}return _0x50374a[_0x6854('0x81')](_0x6195af);}})[_0x6854('0x34')](function(_0xdb282b){if(_0xdb282b){return _0xdb282b?{'count':_0x212c5c,'rows':_0xdb282b}:null;}})[_0x6854('0x34')](respondWithResult(_0x57f629,null))[_0x6854('0x26')](handleError(_0x57f629,null));};exports[_0x6854('0x82')]=function(_0x5e4d60,_0x1b60f7,_0xc24b64){var _0x4f6720={'channel':_0x6854('0x83')};var _0x4f2128=[];var _0x18158f=[];var _0x21fa1c={};return db['WhatsappAccount'][_0x6854('0x57')]({'where':{'id':_0x5e4d60['params']['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x6854('0x84')}]})['then'](handleEntityNotFound(_0x1b60f7,null))[_0x6854('0x34')](function(_0x54f6f8){_0x4f6720[_0x6854('0x85')]=_0x54f6f8;if(_0x4f6720[_0x6854('0x85')]&&_0x4f6720['account']['type']==='sinch'&&_0x5e4d60[_0x6854('0x59')][_0x6854('0x86')]){if(_0x5e4d60[_0x6854('0x59')]['statuses']['length']===0x0)return;if(_0x5e4d60[_0x6854('0x59')][_0x6854('0x86')][0x0][_0x6854('0x87')]!==_0x6854('0x88'))return;return db[_0x6854('0x89')][_0x6854('0x33')]({'read':!![],'readAt':_0x5e4d60[_0x6854('0x59')][_0x6854('0x86')][0x0][_0x6854('0x8a')]},{'where':{'messageId':_0x5e4d60[_0x6854('0x59')]['statuses'][0x0]['message_id']},'individualHooks':!![]})[_0x6854('0x34')](function(_0x2edf8d){return _0x1b60f7[_0x6854('0x28')](0xc8)[_0x6854('0x2a')](_0x2edf8d);});}_0x4f6720[_0x6854('0x8b')]=_[_0x6854('0x8c')](_0x54f6f8[_0x6854('0x84')],['priority'],[_0x6854('0x8d')]);if(_0x4f6720[_0x6854('0x85')][_0x6854('0x84')]){delete _0x4f6720['account'][_0x6854('0x84')];}return db[_0x6854('0x8e')][_0x6854('0x61')]()[_0x6854('0x34')](function(_0x423b25){if(!_0x423b25){throw new db['Sequelize'][(_0x6854('0x8f'))](_0x6854('0x90'));}_0x4f2128=_[_0x6854('0x91')](_[_0x6854('0x44')](_0x423b25),['createdAt',_0x6854('0x92')]);_0x18158f=_[_0x6854('0x91')](_[_0x6854('0x44')](_0x423b25),[_0x6854('0x93'),_0x6854('0x92'),_0x6854('0x94'),_0x6854('0x95')]);_0x4f6720['body']={'mapKey':_0x6854('0x96')};if(_0x4f6720[_0x6854('0x85')]&&_0x4f6720[_0x6854('0x85')][_0x6854('0x41')]==='twilio'){_0x4f6720[_0x6854('0x59')][_0x6854('0x97')]=_0x5e4d60[_0x6854('0x59')][_0x6854('0x98')][_0x6854('0x99')](_0x6854('0x9a'),'');_0x4f6720[_0x6854('0x59')][_0x6854('0x59')]=_0x5e4d60[_0x6854('0x59')]['Body'];_0x4f6720[_0x6854('0x59')][_0x6854('0x9b')]=_0x5e4d60[_0x6854('0x59')]['MessageSid'];}if(_0x4f6720[_0x6854('0x85')]&&_0x4f6720[_0x6854('0x85')][_0x6854('0x41')]===_0x6854('0x9c')){_0x4f6720['body']['from']=_0x5e4d60[_0x6854('0x59')]['notifications'][0x0]['from'];_0x4f6720['body'][_0x6854('0x59')]=_0x5e4d60['body'][_0x6854('0x9d')][0x0][_0x6854('0x25')][_0x6854('0x59')];_0x4f6720[_0x6854('0x59')][_0x6854('0x9b')]=_0x5e4d60[_0x6854('0x59')][_0x6854('0x9d')][0x0][_0x6854('0x9e')];}if(_0x4f6720[_0x6854('0x59')]['id']){delete _0x4f6720['body']['id'];}if(_['isNil'](_0x4f6720['body'][_0x6854('0x97')])){throw new db[(_0x6854('0x9f'))]['ValidationError'](_0x6854('0xa0'));}if(_['isNil'](_0x4f6720[_0x6854('0x59')][_0x6854('0x59')])||_0x4f6720[_0x6854('0x59')]['body']===''){throw new db[(_0x6854('0x9f'))][(_0x6854('0x8f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x6854('0xa1')](_0x4f6720[_0x6854('0x59')][_0x6854('0xa2')])){throw new db[(_0x6854('0x9f'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x18158f);}if(!_[_0x6854('0xa3')](_0x18158f,_0x4f6720['body'][_0x6854('0xa2')])){throw new db[(_0x6854('0x9f'))][(_0x6854('0x8f'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x18158f);}_0x21fa1c[_0x4f6720[_0x6854('0x59')][_0x6854('0xa2')]]=_0x4f6720['body'][_0x6854('0x97')];return db[_0x6854('0xa4')][_0x6854('0x57')]({'where':{'id':_0x4f6720['account'][_0x6854('0x95')]},'include':[{'model':db[_0x6854('0x8e')],'as':_0x6854('0xa5'),'where':_0x21fa1c,'limit':0x1,'order':[[_0x6854('0x92'),_0x6854('0xa6')]]}]});})[_0x6854('0x34')](handleEntityNotFound(_0x1b60f7,null))[_0x6854('0x34')](function(_0x1e3a61){if(_0x1e3a61){_0x4f6720[_0x6854('0xa7')]=_[_0x6854('0xa8')](_0x1e3a61,[_0x6854('0xa5')]);if(_0x1e3a61[_0x6854('0xa5')][_0x6854('0x48')]){return _0x1e3a61[_0x6854('0xa5')][0x0];}var _0x329584=_[_0x6854('0xa9')](_0x4f6720[_0x6854('0x59')],{'firstName':_0x4f6720[_0x6854('0x59')][_0x6854('0x97')],'ListId':_0x1e3a61['id']});_0x329584[_0x4f6720[_0x6854('0x59')]['mapKey']]=_0x4f6720[_0x6854('0x59')][_0x6854('0x97')];return db[_0x6854('0x8e')][_0x6854('0x58')](_0x329584,{'fields':_0x4f2128,'raw':!![]});}})[_0x6854('0x34')](handleEntityNotFound(_0x1b60f7,null))[_0x6854('0x34')](function(_0x5c8e8d){if(_0x5c8e8d){_0x4f6720[_0x6854('0xaa')]=_0x5c8e8d;var _0x10effa={'ContactId':_0x5c8e8d['id'],'phone':_0x4f6720[_0x6854('0x59')][_0x6854('0x97')],'WhatsappAccountId':_0x5e4d60[_0x6854('0x54')]['id']};var _0x32fc83={'ContactId':_0x5c8e8d['id'],'WhatsappAccountId':_0x5e4d60['params']['id'],'closed':![]};return db[_0x6854('0xab')]['find']({'where':_0x32fc83})['then'](function(_0x301eaa){if(_0x301eaa){return[_0x301eaa,![]];}return db[_0x6854('0xab')]['create'](_0x10effa)['then'](function(_0xe71170){return[_0xe71170,!![]];});});}})['spread'](function(_0x4f9092,_0x48ecbc){_0x4f6720['interaction']=_0x4f9092[_0x6854('0x5b')]({'plain':!![]});_0x4f6720['interaction'][_0x6854('0xac')]=![];if(_0x48ecbc){if(_0x4f6720[_0x6854('0x85')][_0x6854('0xad')]){_0x4f6720[_0x6854('0x8b')][_0x6854('0xae')]({'id':0x0,'priority':_0x4f6720[_0x6854('0x8b')][_0x6854('0x48')]+0x1,'app':_0x6854('0xaf'),'appdata':'unmanaged','interval':_0x6854('0xb0')});}_0x4f6720[_0x6854('0xb1')][_0x6854('0xac')]=!![];}return db['WhatsappMessage'][_0x6854('0x58')]({'phone':_0x4f6720[_0x6854('0x59')][_0x6854('0x97')],'messageId':_0x4f6720['body']['messageId'],'body':_0x4f6720[_0x6854('0x59')]['body'],'WhatsappAccountId':_0x5e4d60[_0x6854('0x54')]['id'],'WhatsappInteractionId':_0x4f9092['id'],'direction':'in','ContactId':_0x4f9092['ContactId'],'AttachmentId':_0x4f6720[_0x6854('0x59')]['AttachmentId']});})[_0x6854('0x34')](function(_0x102359){_0x4f6720[_0x6854('0x25')]=_0x102359;if(_0x4f6720['interaction'][_0x6854('0xb2')]){return db[_0x6854('0xb3')][_0x6854('0x57')]({'attributes':['id',_0x6854('0x38')],'where':{'id':_0x4f6720['interaction'][_0x6854('0xb2')]}})[_0x6854('0x34')](function(_0x3082be){if(_0x3082be){_0x4f6720[_0x6854('0x8b')][_0x6854('0xb4')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3082be[_0x6854('0x38')]+','+(_0x4f6720[_0x6854('0x85')]['waitForTheAssignedAgent']||0xa),'interval':_0x6854('0xb0')});}return respondWithRpcPromise('Start',_0x6854('0xb5'),_0x4f6720);});}return respondWithRpcPromise(_0x6854('0xb6'),_0x6854('0xb5'),_0x4f6720);})[_0x6854('0x34')](function(_0x2a9d7b){if(_0x2a9d7b){var _0x2ed11d=0xc8;var _0x42f0c7=_0x6854('0xb7');logger[_0x6854('0x1d')](_0x6854('0x20'),_0x42f0c7,_0x2ed11d,_0x6854('0xb8'));logger[_0x6854('0x1f')](_0x6854('0xb9'),_0x42f0c7,_0x2ed11d,'entity\x20found',JSON[_0x6854('0x21')](_0x2a9d7b));if(_0x4f6720[_0x6854('0x85')][_0x6854('0x41')]===_0x6854('0xba')){return _0x1b60f7[_0x6854('0x28')](_0x2ed11d)[_0x6854('0x2f')]('Content-Type',_0x6854('0xbb'))['send'](_0x6854('0xbc'));}else{return _0x1b60f7[_0x6854('0x28')](_0x2ed11d)[_0x6854('0x2a')](_0x2a9d7b);}}});})[_0x6854('0x26')](handleError(_0x1b60f7,null));};exports[_0x6854('0x39')]=function(_0x525678,_0x3c53b5,_0x13261b){var _0x36e520,_0x199083,_0x3b8379;if(_[_0x6854('0xa1')](_0x525678['body'][_0x6854('0x59')])||_0x525678['body'][_0x6854('0x59')]===''){throw new db[(_0x6854('0x9f'))][(_0x6854('0x8f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x525678[_0x6854('0x59')]['to'])){throw new db[(_0x6854('0x9f'))][(_0x6854('0x8f'))](_0x6854('0xbd'));}_0x36e520=_0x525678[_0x6854('0x59')]['to'];return db['WhatsappAccount']['find']({'where':{'id':_0x525678[_0x6854('0x54')]['id']},'include':[{'model':db[_0x6854('0xa4')],'as':_0x6854('0xbe'),'include':[{'model':db[_0x6854('0x8e')],'as':_0x6854('0xa5'),'where':{'mobile':_0x36e520},'limit':0x1,'order':[[_0x6854('0x92'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x3c53b5,null))['then'](function(_0x3456fe){if(_0x3456fe&&_0x3456fe[_0x6854('0xbe')]){_0x199083=_0x3456fe['get']({'plain':!![]});if(_0x199083[_0x6854('0xbe')]&&_0x199083['List'][_0x6854('0xa5')][_0x6854('0x48')]){return _0x199083[_0x6854('0xbe')][_0x6854('0xa5')][0x0];}return db[_0x6854('0x8e')]['create'](_[_0x6854('0xa9')](_0x525678[_0x6854('0x59')],{'firstName':_0x36e520,'mobile':_0x36e520,'phone':_0x36e520,'ListId':_0x199083[_0x6854('0x95')]}));}})[_0x6854('0x34')](handleEntityNotFound(_0x3c53b5,null))[_0x6854('0x34')](function(_0x279f20){if(_0x279f20){_0x3b8379=_0x279f20;return db[_0x6854('0xab')][_0x6854('0x57')]({'where':{'ContactId':_0x3b8379['id'],'closed':![],'WhatsappAccountId':_0x199083['id']}})[_0x6854('0x34')](function(_0x42be02){if(_0x42be02){return[_0x42be02,![]];}return db[_0x6854('0xab')]['create']({'UserId':_0x525678[_0x6854('0x5a')]['id'],'ContactId':_0x3b8379['id'],'WhatsappAccountId':_0x199083['id'],'phone':_0x36e520,'firstMsgDirection':_0x6854('0xbf'),'Messages':[_['merge'](_0x525678[_0x6854('0x59')],{'read':![],'body':_0x525678[_0x6854('0x59')]['body'],'phone':_0x36e520,'WhatsappAccountId':_0x199083['id'],'UserId':_0x525678[_0x6854('0x5a')]['id'],'ContactId':_0x3b8379['id']})]},{'include':[{'model':db[_0x6854('0x89')],'as':_0x6854('0xc0')}]})[_0x6854('0x34')](function(_0x4b67bb){return[_0x4b67bb,!![]];});});}})[_0x6854('0x6f')](function(_0x48ec56,_0x245bf8){if(_0x245bf8){return _0x48ec56;}return db[_0x6854('0x89')][_0x6854('0x58')](_[_0x6854('0x4f')](_0x525678['body'],{'read':![],'body':_0x525678[_0x6854('0x59')][_0x6854('0x59')],'phone':_0x36e520,'WhatsappAccountId':_0x199083['id'],'WhatsappInteractionId':_0x48ec56['id'],'UserId':_0x525678['user']['id'],'ContactId':_0x3b8379['id']}))[_0x6854('0x34')](function(_0x3fbfd2){_0x48ec56[_0x6854('0xc1')][_0x6854('0xc0')]=[];_0x48ec56[_0x6854('0xc1')][_0x6854('0xc0')][_0x6854('0xae')](_0x3fbfd2['dataValues']);return _0x48ec56;});})[_0x6854('0x34')](respondWithResult(_0x3c53b5,null))[_0x6854('0x26')](handleError(_0x3c53b5,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 06a9ae1..0b39e02 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 _0xddaa=['setMaxListeners','save','update','remove','emit','hook','../../mysqldb','WhatsappAccount'];(function(_0x1e726a,_0x4f3638){var _0x32faef=function(_0x50096f){while(--_0x50096f){_0x1e726a['push'](_0x1e726a['shift']());}};_0x32faef(++_0x4f3638);}(_0xddaa,0xc6));var _0xadda=function(_0x2b22ff,_0x504a9a){_0x2b22ff=_0x2b22ff-0x0;var _0x4026a1=_0xddaa[_0x2b22ff];return _0x4026a1;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xadda('0x0'))['db'][_0xadda('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xadda('0x2')](0x0);var events={'afterCreate':_0xadda('0x3'),'afterUpdate':_0xadda('0x4'),'afterDestroy':_0xadda('0x5')};function emitEvent(_0x2e9d62){return function(_0x38a4f9,_0x17842a,_0x215eff){WhatsappAccountEvents[_0xadda('0x6')](_0x2e9d62+':'+_0x38a4f9['id'],_0x38a4f9);WhatsappAccountEvents[_0xadda('0x6')](_0x2e9d62,_0x38a4f9);_0x215eff(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0xadda('0x7')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0x6d37=['../../mysqldb','WhatsappAccount','save','update','emit','hasOwnProperty','hook','events'];(function(_0x46d6c7,_0x3fdd09){var _0x551049=function(_0x59126d){while(--_0x59126d){_0x46d6c7['push'](_0x46d6c7['shift']());}};_0x551049(++_0x3fdd09);}(_0x6d37,0xc7));var _0x76d3=function(_0x595f22,_0x5d3bf6){_0x595f22=_0x595f22-0x0;var _0x2e9325=_0x6d37[_0x595f22];return _0x2e9325;};'use strict';var EventEmitter=require(_0x76d3('0x0'));var WhatsappAccount=require(_0x76d3('0x1'))['db'][_0x76d3('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x76d3('0x3'),'afterUpdate':_0x76d3('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1175c1){return function(_0x10b65e,_0x575dd7,_0x2c4131){WhatsappAccountEvents[_0x76d3('0x5')](_0x1175c1+':'+_0x10b65e['id'],_0x10b65e);WhatsappAccountEvents[_0x76d3('0x5')](_0x1175c1,_0x10b65e);_0x2c4131(null);};}for(var e in events){if(events[_0x76d3('0x6')](e)){var event=events[e];WhatsappAccount[_0x76d3('0x7')](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 98af828..ac74486 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 _0xcd6c=['./whatsappAccount.attributes','define','WhatsappAccount','whatsapp_accounts','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x26f4f5,_0x53419e){var _0x91bf0a=function(_0x144da0){while(--_0x144da0){_0x26f4f5['push'](_0x26f4f5['shift']());}};_0x91bf0a(++_0x53419e);}(_0xcd6c,0x67));var _0xccd6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcd6c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xccd6('0x0'));var moment=require(_0xccd6('0x1'));var BPromise=require(_0xccd6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xccd6('0x3'));var config=require(_0xccd6('0x4'));var attributes=require(_0xccd6('0x5'));module['exports']=function(_0x15fb1d,_0x2e955d){return _0x15fb1d[_0xccd6('0x6')](_0xccd6('0x7'),attributes,{'tableName':_0xccd6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ea=['bluebird','request-promise','path','rimraf','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','util','../../config/logger','api','moment'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x55ea,0x14e));var _0xa55e=function(_0xb1dea5,_0x1fd18c){_0xb1dea5=_0xb1dea5-0x0;var _0x99cb2c=_0x55ea[_0xb1dea5];return _0x99cb2c;};'use strict';var _=require('lodash');var util=require(_0xa55e('0x0'));var logger=require(_0xa55e('0x1'))(_0xa55e('0x2'));var moment=require(_0xa55e('0x3'));var BPromise=require(_0xa55e('0x4'));var rp=require(_0xa55e('0x5'));var fs=require('fs');var path=require(_0xa55e('0x6'));var rimraf=require(_0xa55e('0x7'));var config=require('../../config/environment');var attributes=require(_0xa55e('0x8'));module[_0xa55e('0x9')]=function(_0x52e39c,_0x16c9c4){return _0x52e39c[_0xa55e('0xa')](_0xa55e('0xb'),attributes,{'tableName':_0xa55e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 6305cb0..b3880fe 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 _0xf316=['rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','WhatsappAccount,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','map','model','stringify','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x2307fd,_0x5d6325){var _0x282eb7=function(_0x59adf6){while(--_0x59adf6){_0x2307fd['push'](_0x2307fd['shift']());}};_0x282eb7(++_0x5d6325);}(_0xf316,0xd7));var _0x6f31=function(_0x4015bd,_0x5e77e2){_0x4015bd=_0x4015bd-0x0;var _0x387c8a=_0xf316[_0x4015bd];return _0x387c8a;};'use strict';var _=require('lodash');var util=require(_0x6f31('0x0'));var moment=require(_0x6f31('0x1'));var BPromise=require(_0x6f31('0x2'));var rs=require(_0x6f31('0x3'));var fs=require('fs');var Redis=require(_0x6f31('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6f31('0x5'));var logger=require(_0x6f31('0x6'))(_0x6f31('0x7'));var config=require(_0x6f31('0x8'));var jayson=require(_0x6f31('0x9'));var client=jayson[_0x6f31('0xa')][_0x6f31('0xb')]({'port':0x232a});config[_0x6f31('0xc')]=_['defaults'](config['redis'],{'host':_0x6f31('0xd'),'port':0x18eb});var socket=require(_0x6f31('0xe'))(new Redis(config['redis']));require(_0x6f31('0xf'))[_0x6f31('0x10')](socket);function respondWithRpcPromise(_0x35cf3e,_0x4f14a3,_0x30a5e6){return new BPromise(function(_0x266ea2,_0x1859ea){return client[_0x6f31('0x11')](_0x35cf3e,_0x30a5e6)[_0x6f31('0x12')](function(_0x3ed1e7){logger['info'](_0x6f31('0x13'),_0x4f14a3,'request\x20sent');logger[_0x6f31('0x14')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4f14a3,_0x6f31('0x15'),JSON['stringify'](_0x3ed1e7));if(_0x3ed1e7[_0x6f31('0x16')]){if(_0x3ed1e7[_0x6f31('0x16')]['code']===0x1f4){logger[_0x6f31('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x4f14a3,_0x3ed1e7['error']['message']);return _0x1859ea(_0x3ed1e7[_0x6f31('0x16')][_0x6f31('0x17')]);}logger[_0x6f31('0x16')](_0x6f31('0x13'),_0x4f14a3,_0x3ed1e7[_0x6f31('0x16')][_0x6f31('0x17')]);return _0x266ea2(_0x3ed1e7[_0x6f31('0x16')]['message']);}else{logger['info'](_0x6f31('0x13'),_0x4f14a3,_0x6f31('0x15'));_0x266ea2(_0x3ed1e7[_0x6f31('0x18')]['message']);}})[_0x6f31('0x19')](function(_0xd3922b){logger['error'](_0x6f31('0x13'),_0x4f14a3,_0xd3922b);_0x1859ea(_0xd3922b);});});}exports[_0x6f31('0x1a')]=function(_0x2590a8){var _0x4df141=this;return new Promise(function(_0x2670e3,_0x4d5b87){return db[_0x6f31('0x1b')][_0x6f31('0x1c')]({'raw':_0x2590a8[_0x6f31('0x1d')]?_0x2590a8[_0x6f31('0x1d')][_0x6f31('0x1e')]===undefined?!![]:![]:!![],'where':_0x2590a8[_0x6f31('0x1d')]?_0x2590a8['options'][_0x6f31('0x1f')]||null:null,'attributes':_0x2590a8[_0x6f31('0x1d')]?_0x2590a8[_0x6f31('0x1d')][_0x6f31('0x20')]||null:null,'include':_0x2590a8['options']?_0x2590a8[_0x6f31('0x1d')][_0x6f31('0x21')]?_[_0x6f31('0x22')](_0x2590a8[_0x6f31('0x1d')][_0x6f31('0x21')],function(_0x5035c4){return{'model':db[_0x5035c4[_0x6f31('0x23')]],'as':_0x5035c4['as'],'attributes':_0x5035c4['attributes'],'include':_0x5035c4[_0x6f31('0x21')]?_[_0x6f31('0x22')](_0x5035c4['include'],function(_0x5d18e0){return{'model':db[_0x5d18e0[_0x6f31('0x23')]],'as':_0x5d18e0['as'],'attributes':_0x5d18e0[_0x6f31('0x20')],'include':_0x5d18e0[_0x6f31('0x21')]?_[_0x6f31('0x22')](_0x5d18e0[_0x6f31('0x21')],function(_0x4b561f){return{'model':db[_0x4b561f['model']],'as':_0x4b561f['as'],'attributes':_0x4b561f[_0x6f31('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6f31('0x12')](function(_0x4317f8){logger['info'](_0x6f31('0x1a'),_0x2590a8);logger[_0x6f31('0x14')]('ShowWhatsappAccount',_0x2590a8,JSON[_0x6f31('0x24')](_0x4317f8));_0x2670e3(_0x4317f8);})[_0x6f31('0x19')](function(_0xade23){logger['error']('ShowWhatsappAccount',_0xade23[_0x6f31('0x17')],_0x2590a8);_0x4d5b87(_0x4df141[_0x6f31('0x16')](0x1f4,_0xade23['message']));});});}; \ No newline at end of file +var _0xbd07=['info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappAccount,\x20%s,\x20%s','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','model','map','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then'];(function(_0x390e5b,_0x1cb294){var _0x34bfa7=function(_0x1a64d6){while(--_0x1a64d6){_0x390e5b['push'](_0x390e5b['shift']());}};_0x34bfa7(++_0x1cb294);}(_0xbd07,0x1cd));var _0x7bd0=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xbd07[_0x2064e5];return _0x21a233;};'use strict';var _=require('lodash');var util=require(_0x7bd0('0x0'));var moment=require(_0x7bd0('0x1'));var BPromise=require(_0x7bd0('0x2'));var rs=require(_0x7bd0('0x3'));var fs=require('fs');var Redis=require(_0x7bd0('0x4'));var db=require(_0x7bd0('0x5'))['db'];var utils=require(_0x7bd0('0x6'));var logger=require(_0x7bd0('0x7'))(_0x7bd0('0x8'));var config=require(_0x7bd0('0x9'));var jayson=require(_0x7bd0('0xa'));var client=jayson[_0x7bd0('0xb')][_0x7bd0('0xc')]({'port':0x232a});config[_0x7bd0('0xd')]=_['defaults'](config[_0x7bd0('0xd')],{'host':_0x7bd0('0xe'),'port':0x18eb});var socket=require(_0x7bd0('0xf'))(new Redis(config[_0x7bd0('0xd')]));require('./whatsappAccount.socket')[_0x7bd0('0x10')](socket);function respondWithRpcPromise(_0x144a3b,_0x334492,_0x370c76){return new BPromise(function(_0x43459f,_0x5df434){return client[_0x7bd0('0x11')](_0x144a3b,_0x370c76)[_0x7bd0('0x12')](function(_0x144dc2){logger[_0x7bd0('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x334492,_0x7bd0('0x14'));logger[_0x7bd0('0x15')](_0x7bd0('0x16'),_0x334492,_0x7bd0('0x14'),JSON[_0x7bd0('0x17')](_0x144dc2));if(_0x144dc2[_0x7bd0('0x18')]){if(_0x144dc2['error'][_0x7bd0('0x19')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x334492,_0x144dc2[_0x7bd0('0x18')][_0x7bd0('0x1a')]);return _0x5df434(_0x144dc2[_0x7bd0('0x18')][_0x7bd0('0x1a')]);}logger['error'](_0x7bd0('0x1b'),_0x334492,_0x144dc2[_0x7bd0('0x18')][_0x7bd0('0x1a')]);return _0x43459f(_0x144dc2['error'][_0x7bd0('0x1a')]);}else{logger[_0x7bd0('0x13')](_0x7bd0('0x1b'),_0x334492,_0x7bd0('0x14'));_0x43459f(_0x144dc2[_0x7bd0('0x1c')][_0x7bd0('0x1a')]);}})[_0x7bd0('0x1d')](function(_0x2c0bfe){logger['error'](_0x7bd0('0x1b'),_0x334492,_0x2c0bfe);_0x5df434(_0x2c0bfe);});});}exports[_0x7bd0('0x1e')]=function(_0x383019){var _0x550f1e=this;return new Promise(function(_0x28f4d7,_0x4409ca){return db[_0x7bd0('0x1f')][_0x7bd0('0x20')]({'raw':_0x383019[_0x7bd0('0x21')]?_0x383019[_0x7bd0('0x21')][_0x7bd0('0x22')]===undefined?!![]:![]:!![],'where':_0x383019[_0x7bd0('0x21')]?_0x383019['options'][_0x7bd0('0x23')]||null:null,'attributes':_0x383019[_0x7bd0('0x21')]?_0x383019[_0x7bd0('0x21')][_0x7bd0('0x24')]||null:null,'include':_0x383019['options']?_0x383019['options'][_0x7bd0('0x25')]?_['map'](_0x383019[_0x7bd0('0x21')][_0x7bd0('0x25')],function(_0x2cc2e2){return{'model':db[_0x2cc2e2['model']],'as':_0x2cc2e2['as'],'attributes':_0x2cc2e2[_0x7bd0('0x24')],'include':_0x2cc2e2['include']?_['map'](_0x2cc2e2['include'],function(_0x11d271){return{'model':db[_0x11d271[_0x7bd0('0x26')]],'as':_0x11d271['as'],'attributes':_0x11d271[_0x7bd0('0x24')],'include':_0x11d271[_0x7bd0('0x25')]?_[_0x7bd0('0x27')](_0x11d271['include'],function(_0x5085ec){return{'model':db[_0x5085ec['model']],'as':_0x5085ec['as'],'attributes':_0x5085ec[_0x7bd0('0x24')]};}):[]};}):[]};}):[]:[]})[_0x7bd0('0x12')](function(_0x3c92fe){logger[_0x7bd0('0x13')](_0x7bd0('0x1e'),_0x383019);logger[_0x7bd0('0x15')](_0x7bd0('0x1e'),_0x383019,JSON[_0x7bd0('0x17')](_0x3c92fe));_0x28f4d7(_0x3c92fe);})[_0x7bd0('0x1d')](function(_0xe73817){logger[_0x7bd0('0x18')](_0x7bd0('0x1e'),_0xe73817[_0x7bd0('0x1a')],_0x383019);_0x4409ca(_0x550f1e[_0x7bd0('0x18')](0x1f4,_0xe73817[_0x7bd0('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index a7b5d1c..fbe5c77 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 _0x3b9c=['emit','removeListener','register','./whatsappAccount.events'];(function(_0x30f08d,_0x1814c9){var _0xcee806=function(_0x459970){while(--_0x459970){_0x30f08d['push'](_0x30f08d['shift']());}};_0xcee806(++_0x1814c9);}(_0x3b9c,0x7b));var _0xc3b9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3b9c[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappAccountEvents=require(_0xc3b9('0x0'));var events=['save','remove','update'];function createListener(_0x1cd644,_0x210cc6){return function(_0x375f68){_0x210cc6[_0xc3b9('0x1')](_0x1cd644,_0x375f68);};}function removeListener(_0x24508f,_0x9b8f1a){return function(){WhatsappAccountEvents[_0xc3b9('0x2')](_0x24508f,_0x9b8f1a);};}exports[_0xc3b9('0x3')]=function(_0x1c972c){for(var _0x52a972=0x0,_0x4af868=events['length'];_0x52a972<_0x4af868;_0x52a972++){var _0x3abf75=events[_0x52a972];var _0x39235a=createListener('whatsappAccount:'+_0x3abf75,_0x1c972c);WhatsappAccountEvents['on'](_0x3abf75,_0x39235a);}}; \ No newline at end of file +var _0x2953=['register','./whatsappAccount.events','save','update','emit','removeListener'];(function(_0x305b20,_0x5e57e9){var _0x26d64a=function(_0x2e17f0){while(--_0x2e17f0){_0x305b20['push'](_0x305b20['shift']());}};_0x26d64a(++_0x5e57e9);}(_0x2953,0xd3));var _0x3295=function(_0x261f21,_0x74e83c){_0x261f21=_0x261f21-0x0;var _0x29c515=_0x2953[_0x261f21];return _0x29c515;};'use strict';var WhatsappAccountEvents=require(_0x3295('0x0'));var events=[_0x3295('0x1'),'remove',_0x3295('0x2')];function createListener(_0x2d1c5f,_0x50ff45){return function(_0x5f0ea3){_0x50ff45[_0x3295('0x3')](_0x2d1c5f,_0x5f0ea3);};}function removeListener(_0x586340,_0x5c881f){return function(){WhatsappAccountEvents[_0x3295('0x4')](_0x586340,_0x5c881f);};}exports[_0x3295('0x5')]=function(_0x1556c9){for(var _0x23567f=0x0,_0xd09c31=events['length'];_0x23567f<_0xd09c31;_0x23567f++){var _0xa4a724=events[_0x23567f];var _0x3ff7ea=createListener('whatsappAccount:'+_0xa4a724,_0x1556c9);WhatsappAccountEvents['on'](_0xa4a724,_0x3ff7ea);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 7bb3ce3..471f373 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 _0x07f3=['post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappApplication.controller','index','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x07f3,0xec));var _0x307f=function(_0x61b3ab,_0x1fc298){_0x61b3ab=_0x61b3ab-0x0;var _0x57097f=_0x07f3[_0x61b3ab];return _0x57097f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x307f('0x0'));var timeout=require(_0x307f('0x1'));var express=require(_0x307f('0x2'));var router=express[_0x307f('0x3')]();var fs_extra=require(_0x307f('0x4'));var auth=require(_0x307f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x307f('0x6'));var controller=require(_0x307f('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x307f('0x8')]);router[_0x307f('0x9')]('/:id',auth[_0x307f('0xa')](),controller['show']);router[_0x307f('0xb')]('/',auth[_0x307f('0xa')](),controller[_0x307f('0xc')]);router[_0x307f('0xd')](_0x307f('0xe'),auth[_0x307f('0xa')](),controller[_0x307f('0xf')]);router[_0x307f('0x10')](_0x307f('0xe'),auth[_0x307f('0xa')](),controller[_0x307f('0x11')]);module[_0x307f('0x12')]=router; \ No newline at end of file +var _0xa8ed=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller','get','isAuthenticated','create','put','/:id','update','delete'];(function(_0x4bf013,_0x287933){var _0x21d42e=function(_0x1c251f){while(--_0x1c251f){_0x4bf013['push'](_0x4bf013['shift']());}};_0x21d42e(++_0x287933);}(_0xa8ed,0xf0));var _0xda8e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa8ed[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0xda8e('0x0'));var util=require(_0xda8e('0x1'));var path=require('path');var timeout=require(_0xda8e('0x2'));var express=require(_0xda8e('0x3'));var router=express[_0xda8e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xda8e('0x5'));var interaction=require(_0xda8e('0x6'));var config=require('../../config/environment');var controller=require(_0xda8e('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xda8e('0x8')]('/:id',auth[_0xda8e('0x9')](),controller['show']);router['post']('/',auth[_0xda8e('0x9')](),controller[_0xda8e('0xa')]);router[_0xda8e('0xb')](_0xda8e('0xc'),auth[_0xda8e('0x9')](),controller[_0xda8e('0xd')]);router[_0xda8e('0xe')]('/:id',auth[_0xda8e('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 39f3117..2d51235 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 _0xc344=['exports','INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize'];(function(_0x253451,_0x39f56a){var _0x5111a4=function(_0x3c6075){while(--_0x3c6075){_0x253451['push'](_0x253451['shift']());}};_0x5111a4(++_0x39f56a);}(_0xc344,0x117));var _0x4c34=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0xc344[_0x1b7368];return _0x25d54c;};'use strict';var Sequelize=require(_0x4c34('0x0'));module[_0x4c34('0x1')]={'priority':{'type':Sequelize[_0x4c34('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4c34('0x3')},'appdata':{'type':Sequelize[_0x4c34('0x4')]()},'description':{'type':Sequelize[_0x4c34('0x5')]},'interval':{'type':Sequelize[_0x4c34('0x5')],'defaultValue':_0x4c34('0x6')}}; \ No newline at end of file +var _0x7c9e=['sequelize','exports','noop','STRING','*,*,*,*'];(function(_0x34e780,_0x360086){var _0x3669a1=function(_0x17edff){while(--_0x17edff){_0x34e780['push'](_0x34e780['shift']());}};_0x3669a1(++_0x360086);}(_0x7c9e,0x18b));var _0xe7c9=function(_0x35117e,_0x211a20){_0x35117e=_0x35117e-0x0;var _0x33044d=_0x7c9e[_0x35117e];return _0x33044d;};'use strict';var Sequelize=require(_0xe7c9('0x0'));module[_0xe7c9('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe7c9('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xe7c9('0x3')]},'interval':{'type':Sequelize[_0xe7c9('0x3')],'defaultValue':_0xe7c9('0x4')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 4e23235..ee2745e 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 _0x117c=['set','Content-Range','apply','update','then','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','WhatsappApplication','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset'];(function(_0x3f0231,_0x56c788){var _0x374d3f=function(_0x221b9e){while(--_0x221b9e){_0x3f0231['push'](_0x3f0231['shift']());}};_0x374d3f(++_0x56c788);}(_0x117c,0x71));var _0xc117=function(_0x2e1af3,_0x2a077b){_0x2e1af3=_0x2e1af3-0x0;var _0x4150cd=_0x117c[_0x2e1af3];return _0x4150cd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc117('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc117('0x1'));var Mustache=require(_0xc117('0x2'));var util=require(_0xc117('0x3'));var path=require(_0xc117('0x4'));var sox=require(_0xc117('0x5'));var csv=require(_0xc117('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc117('0x7'));var _=require(_0xc117('0x8'));var squel=require('squel');var crypto=require(_0xc117('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc117('0xa'));var toCsv=require(_0xc117('0x6'));var querystring=require(_0xc117('0xb'));var Papa=require(_0xc117('0xc'));var Redis=require(_0xc117('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xc117('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc117('0xf'));var logger=require('../../config/logger')(_0xc117('0x10'));var utils=require(_0xc117('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xc117('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29d939,_0x1d8601){_0x1d8601=_0x1d8601||0xcc;return function(_0xd597a1){if(_0xd597a1){return _0x29d939[_0xc117('0x13')](_0x1d8601);}return _0x29d939['status'](_0x1d8601)[_0xc117('0x14')]();};}function respondWithResult(_0x432d27,_0x102957){_0x102957=_0x102957||0xc8;return function(_0x9dec18){if(_0x9dec18){return _0x432d27[_0xc117('0x15')](_0x102957)[_0xc117('0x16')](_0x9dec18);}};}function respondWithFilteredResult(_0x44042a,_0x6960b9){return function(_0xc14e71){if(_0xc14e71){var _0x58bce8=typeof _0x6960b9['offset']===_0xc117('0x17')&&typeof _0x6960b9[_0xc117('0x18')]===_0xc117('0x17');var _0x2c3a28=_0xc14e71[_0xc117('0x19')];var _0x339239=_0x58bce8?0x0:_0x6960b9[_0xc117('0x1a')];var _0x1a757f=_0x58bce8?_0xc14e71[_0xc117('0x19')]:_0x6960b9[_0xc117('0x1a')]+_0x6960b9[_0xc117('0x18')];var _0x224395;if(_0x1a757f>=_0x2c3a28){_0x1a757f=_0x2c3a28;_0x224395=0xc8;}else{_0x224395=0xce;}_0x44042a['status'](_0x224395);return _0x44042a[_0xc117('0x1b')](_0xc117('0x1c'),_0x339239+'-'+_0x1a757f+'/'+_0x2c3a28)[_0xc117('0x16')](_0xc14e71);}return null;};}function patchUpdates(_0x1a5ba0){return function(_0x3946cb){try{jsonpatch[_0xc117('0x1d')](_0x3946cb,_0x1a5ba0,!![]);}catch(_0x32ef4e){return BPromise['reject'](_0x32ef4e);}return _0x3946cb['save']();};}function saveUpdates(_0x412ec1,_0x24bb40){return function(_0x1492d0){if(_0x1492d0){return _0x1492d0[_0xc117('0x1e')](_0x412ec1)[_0xc117('0x1f')](function(_0x2531f1){return _0x2531f1;});}return null;};}function removeEntity(_0x5d5ba1,_0x4bde1b){return function(_0x3d670e){if(_0x3d670e){return _0x3d670e['destroy']()[_0xc117('0x1f')](function(){_0x5d5ba1[_0xc117('0x15')](0xcc)[_0xc117('0x14')]();});}};}function handleEntityNotFound(_0x4e6616,_0x3d71f8){return function(_0xfefce5){if(!_0xfefce5){_0x4e6616[_0xc117('0x13')](0x194);}return _0xfefce5;};}function handleError(_0x4ed450,_0x2cc134){_0x2cc134=_0x2cc134||0x1f4;return function(_0x28575b){logger['error'](_0x28575b[_0xc117('0x20')]);if(_0x28575b['name']){delete _0x28575b['name'];}_0x4ed450[_0xc117('0x15')](_0x2cc134)[_0xc117('0x21')](_0x28575b);};}exports[_0xc117('0x22')]=function(_0x52c152,_0x211fb1){var _0x5db129={},_0x4a2a10={},_0x459b8a={'count':0x0,'rows':[]};var _0x35bb86=_[_0xc117('0x23')](db['WhatsappApplication'][_0xc117('0x24')],function(_0x5eabf1){return{'name':_0x5eabf1[_0xc117('0x25')],'type':_0x5eabf1[_0xc117('0x26')][_0xc117('0x27')]};});_0x4a2a10[_0xc117('0x28')]=_['map'](_0x35bb86,_0xc117('0x29'));_0x4a2a10[_0xc117('0x2a')]=_[_0xc117('0x2b')](_0x52c152[_0xc117('0x2a')]);_0x4a2a10['filters']=_[_0xc117('0x2c')](_0x4a2a10['model'],_0x4a2a10[_0xc117('0x2a')]);_0x5db129['attributes']=_[_0xc117('0x2c')](_0x4a2a10['model'],qs[_0xc117('0x2d')](_0x52c152['query'][_0xc117('0x2d')]));_0x5db129[_0xc117('0x2e')]=_0x5db129[_0xc117('0x2e')]['length']?_0x5db129[_0xc117('0x2e')]:_0x4a2a10[_0xc117('0x28')];if(!_0x52c152[_0xc117('0x2a')][_0xc117('0x2f')](_0xc117('0x30'))){_0x5db129[_0xc117('0x18')]=qs[_0xc117('0x18')](_0x52c152[_0xc117('0x2a')]['limit']);_0x5db129[_0xc117('0x1a')]=qs[_0xc117('0x1a')](_0x52c152[_0xc117('0x2a')]['offset']);}_0x5db129[_0xc117('0x31')]=qs[_0xc117('0x32')](_0x52c152[_0xc117('0x2a')][_0xc117('0x32')]);_0x5db129[_0xc117('0x33')]=qs[_0xc117('0x34')](_[_0xc117('0x35')](_0x52c152['query'],_0x4a2a10[_0xc117('0x34')]),_0x35bb86);if(_0x52c152[_0xc117('0x2a')]['filter']){_0x5db129[_0xc117('0x33')]=_[_0xc117('0x36')](_0x5db129[_0xc117('0x33')],{'$or':_['map'](_0x35bb86,function(_0x595e2f){if(_0x595e2f['type']!==_0xc117('0x37')){var _0x57a4fe={};_0x57a4fe[_0x595e2f[_0xc117('0x29')]]={'$like':'%'+_0x52c152[_0xc117('0x2a')][_0xc117('0x38')]+'%'};return _0x57a4fe;}})});}_0x5db129=_[_0xc117('0x36')]({},_0x5db129,_0x52c152[_0xc117('0x39')]);var _0x301cc0={'where':_0x5db129['where']};return db[_0xc117('0x3a')][_0xc117('0x19')](_0x301cc0)['then'](function(_0x32f677){_0x459b8a['count']=_0x32f677;if(_0x52c152[_0xc117('0x2a')][_0xc117('0x3b')]){_0x5db129[_0xc117('0x3c')]=[{'all':!![]}];}return db['WhatsappApplication'][_0xc117('0x3d')](_0x5db129);})[_0xc117('0x1f')](function(_0x2e0820){_0x459b8a[_0xc117('0x3e')]=_0x2e0820;return _0x459b8a;})['then'](respondWithFilteredResult(_0x211fb1,_0x5db129))[_0xc117('0x3f')](handleError(_0x211fb1,null));};exports[_0xc117('0x40')]=function(_0x4e6c89,_0x2880b8){var _0x2066cf={'raw':!![],'where':{'id':_0x4e6c89[_0xc117('0x41')]['id']}},_0x5128ef={};_0x5128ef['model']=_[_0xc117('0x2b')](db[_0xc117('0x3a')][_0xc117('0x24')]);_0x5128ef[_0xc117('0x2a')]=_['keys'](_0x4e6c89['query']);_0x5128ef['filters']=_[_0xc117('0x2c')](_0x5128ef[_0xc117('0x28')],_0x5128ef['query']);_0x2066cf['attributes']=_['intersection'](_0x5128ef[_0xc117('0x28')],qs[_0xc117('0x2d')](_0x4e6c89[_0xc117('0x2a')][_0xc117('0x2d')]));_0x2066cf[_0xc117('0x2e')]=_0x2066cf[_0xc117('0x2e')]['length']?_0x2066cf['attributes']:_0x5128ef[_0xc117('0x28')];if(_0x4e6c89[_0xc117('0x2a')]['includeAll']){_0x2066cf['include']=[{'all':!![]}];}_0x2066cf=_[_0xc117('0x36')]({},_0x2066cf,_0x4e6c89['options']);return db[_0xc117('0x3a')][_0xc117('0x42')](_0x2066cf)[_0xc117('0x1f')](handleEntityNotFound(_0x2880b8,null))[_0xc117('0x1f')](respondWithResult(_0x2880b8,null))['catch'](handleError(_0x2880b8,null));};exports[_0xc117('0x43')]=function(_0x248347,_0x4bca5e){return db[_0xc117('0x3a')][_0xc117('0x43')](_0x248347['body'],{})['then'](respondWithResult(_0x4bca5e,0xc9))['catch'](handleError(_0x4bca5e,null));};exports[_0xc117('0x1e')]=function(_0x461d76,_0x2b7534){if(_0x461d76[_0xc117('0x44')]['id']){delete _0x461d76[_0xc117('0x44')]['id'];}return db[_0xc117('0x3a')]['find']({'where':{'id':_0x461d76['params']['id']}})[_0xc117('0x1f')](handleEntityNotFound(_0x2b7534,null))[_0xc117('0x1f')](saveUpdates(_0x461d76[_0xc117('0x44')],null))[_0xc117('0x1f')](respondWithResult(_0x2b7534,null))[_0xc117('0x3f')](handleError(_0x2b7534,null));};exports[_0xc117('0x45')]=function(_0x5079f0,_0x2ce262){return db[_0xc117('0x3a')][_0xc117('0x42')]({'where':{'id':_0x5079f0[_0xc117('0x41')]['id']}})[_0xc117('0x1f')](handleEntityNotFound(_0x2ce262,null))[_0xc117('0x1f')](removeEntity(_0x2ce262,null))[_0xc117('0x3f')](handleError(_0x2ce262,null));}; \ No newline at end of file +var _0x0c3a=['VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','keys','options','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','sendStatus','error','stack','name','send','WhatsappApplication','rawAttributes','fieldName','type','model','map','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick'];(function(_0x546ecb,_0x457191){var _0x97f7bc=function(_0x5655af){while(--_0x5655af){_0x546ecb['push'](_0x546ecb['shift']());}};_0x97f7bc(++_0x457191);}(_0x0c3a,0x171));var _0xa0c3=function(_0xdcfa3,_0x426d85){_0xdcfa3=_0xdcfa3-0x0;var _0x64a7f1=_0x0c3a[_0xdcfa3];return _0x64a7f1;};'use strict';var emlformat=require(_0xa0c3('0x0'));var rimraf=require(_0xa0c3('0x1'));var zipdir=require(_0xa0c3('0x2'));var jsonpatch=require(_0xa0c3('0x3'));var rp=require(_0xa0c3('0x4'));var moment=require(_0xa0c3('0x5'));var BPromise=require(_0xa0c3('0x6'));var Mustache=require('mustache');var util=require(_0xa0c3('0x7'));var path=require(_0xa0c3('0x8'));var sox=require('sox');var csv=require(_0xa0c3('0x9'));var ejs=require(_0xa0c3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa0c3('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa0c3('0xc'));var deskjs=require(_0xa0c3('0xd'));var toCsv=require(_0xa0c3('0x9'));var querystring=require(_0xa0c3('0xe'));var Papa=require('papaparse');var Redis=require(_0xa0c3('0xf'));var authService=require(_0xa0c3('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa0c3('0x11'));var logger=require(_0xa0c3('0x12'))('api');var utils=require(_0xa0c3('0x13'));var config=require(_0xa0c3('0x14'));var licenseUtil=require(_0xa0c3('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2140d3,_0x46280d){_0x46280d=_0x46280d||0xcc;return function(_0x4a9d44){if(_0x4a9d44){return _0x2140d3['sendStatus'](_0x46280d);}return _0x2140d3[_0xa0c3('0x16')](_0x46280d)[_0xa0c3('0x17')]();};}function respondWithResult(_0x3fb33c,_0x2b0e25){_0x2b0e25=_0x2b0e25||0xc8;return function(_0x334049){if(_0x334049){return _0x3fb33c['status'](_0x2b0e25)[_0xa0c3('0x18')](_0x334049);}};}function respondWithFilteredResult(_0x49575a,_0x2f0ec4){return function(_0x5195c3){if(_0x5195c3){var _0x49983c=typeof _0x2f0ec4['offset']===_0xa0c3('0x19')&&typeof _0x2f0ec4[_0xa0c3('0x1a')]===_0xa0c3('0x19');var _0x4c6b92=_0x5195c3[_0xa0c3('0x1b')];var _0xbadd6f=_0x49983c?0x0:_0x2f0ec4[_0xa0c3('0x1c')];var _0x35b716=_0x49983c?_0x5195c3[_0xa0c3('0x1b')]:_0x2f0ec4[_0xa0c3('0x1c')]+_0x2f0ec4[_0xa0c3('0x1a')];var _0x50c239;if(_0x35b716>=_0x4c6b92){_0x35b716=_0x4c6b92;_0x50c239=0xc8;}else{_0x50c239=0xce;}_0x49575a[_0xa0c3('0x16')](_0x50c239);return _0x49575a['set'](_0xa0c3('0x1d'),_0xbadd6f+'-'+_0x35b716+'/'+_0x4c6b92)[_0xa0c3('0x18')](_0x5195c3);}return null;};}function patchUpdates(_0x46732e){return function(_0x2475ff){try{jsonpatch['apply'](_0x2475ff,_0x46732e,!![]);}catch(_0x91fd9f){return BPromise[_0xa0c3('0x1e')](_0x91fd9f);}return _0x2475ff[_0xa0c3('0x1f')]();};}function saveUpdates(_0x1a1c0b,_0x124907){return function(_0xdb5807){if(_0xdb5807){return _0xdb5807[_0xa0c3('0x20')](_0x1a1c0b)['then'](function(_0x406356){return _0x406356;});}return null;};}function removeEntity(_0xbc0388,_0x216dc7){return function(_0x4a70bc){if(_0x4a70bc){return _0x4a70bc['destroy']()[_0xa0c3('0x21')](function(){_0xbc0388[_0xa0c3('0x16')](0xcc)[_0xa0c3('0x17')]();});}};}function handleEntityNotFound(_0x256f8c,_0xf43037){return function(_0x303410){if(!_0x303410){_0x256f8c[_0xa0c3('0x22')](0x194);}return _0x303410;};}function handleError(_0x171720,_0x5bc220){_0x5bc220=_0x5bc220||0x1f4;return function(_0x2cd86f){logger[_0xa0c3('0x23')](_0x2cd86f[_0xa0c3('0x24')]);if(_0x2cd86f[_0xa0c3('0x25')]){delete _0x2cd86f[_0xa0c3('0x25')];}_0x171720['status'](_0x5bc220)[_0xa0c3('0x26')](_0x2cd86f);};}exports['index']=function(_0x24c677,_0xd1bfff){var _0xc1e39b={},_0x20d3c4={},_0xbbfbd1={'count':0x0,'rows':[]};var _0x1597ea=_['map'](db[_0xa0c3('0x27')][_0xa0c3('0x28')],function(_0xa06c67){return{'name':_0xa06c67[_0xa0c3('0x29')],'type':_0xa06c67[_0xa0c3('0x2a')]['key']};});_0x20d3c4[_0xa0c3('0x2b')]=_[_0xa0c3('0x2c')](_0x1597ea,_0xa0c3('0x25'));_0x20d3c4[_0xa0c3('0x2d')]=_['keys'](_0x24c677[_0xa0c3('0x2d')]);_0x20d3c4['filters']=_[_0xa0c3('0x2e')](_0x20d3c4[_0xa0c3('0x2b')],_0x20d3c4[_0xa0c3('0x2d')]);_0xc1e39b['attributes']=_[_0xa0c3('0x2e')](_0x20d3c4[_0xa0c3('0x2b')],qs[_0xa0c3('0x2f')](_0x24c677[_0xa0c3('0x2d')][_0xa0c3('0x2f')]));_0xc1e39b[_0xa0c3('0x30')]=_0xc1e39b['attributes'][_0xa0c3('0x31')]?_0xc1e39b[_0xa0c3('0x30')]:_0x20d3c4[_0xa0c3('0x2b')];if(!_0x24c677[_0xa0c3('0x2d')][_0xa0c3('0x32')](_0xa0c3('0x33'))){_0xc1e39b[_0xa0c3('0x1a')]=qs['limit'](_0x24c677['query']['limit']);_0xc1e39b[_0xa0c3('0x1c')]=qs[_0xa0c3('0x1c')](_0x24c677[_0xa0c3('0x2d')][_0xa0c3('0x1c')]);}_0xc1e39b[_0xa0c3('0x34')]=qs[_0xa0c3('0x35')](_0x24c677[_0xa0c3('0x2d')][_0xa0c3('0x35')]);_0xc1e39b[_0xa0c3('0x36')]=qs[_0xa0c3('0x37')](_[_0xa0c3('0x38')](_0x24c677[_0xa0c3('0x2d')],_0x20d3c4['filters']),_0x1597ea);if(_0x24c677[_0xa0c3('0x2d')]['filter']){_0xc1e39b[_0xa0c3('0x36')]=_['merge'](_0xc1e39b[_0xa0c3('0x36')],{'$or':_[_0xa0c3('0x2c')](_0x1597ea,function(_0xd8616f){if(_0xd8616f[_0xa0c3('0x2a')]!==_0xa0c3('0x39')){var _0x3f1e0a={};_0x3f1e0a[_0xd8616f[_0xa0c3('0x25')]]={'$like':'%'+_0x24c677[_0xa0c3('0x2d')][_0xa0c3('0x3a')]+'%'};return _0x3f1e0a;}})});}_0xc1e39b=_['merge']({},_0xc1e39b,_0x24c677['options']);var _0x4dc209={'where':_0xc1e39b['where']};return db[_0xa0c3('0x27')]['count'](_0x4dc209)[_0xa0c3('0x21')](function(_0x1eea38){_0xbbfbd1[_0xa0c3('0x1b')]=_0x1eea38;if(_0x24c677[_0xa0c3('0x2d')][_0xa0c3('0x3b')]){_0xc1e39b[_0xa0c3('0x3c')]=[{'all':!![]}];}return db[_0xa0c3('0x27')][_0xa0c3('0x3d')](_0xc1e39b);})[_0xa0c3('0x21')](function(_0x25e989){_0xbbfbd1[_0xa0c3('0x3e')]=_0x25e989;return _0xbbfbd1;})[_0xa0c3('0x21')](respondWithFilteredResult(_0xd1bfff,_0xc1e39b))[_0xa0c3('0x3f')](handleError(_0xd1bfff,null));};exports[_0xa0c3('0x40')]=function(_0x4a5f41,_0x350c30){var _0x30dbe4={'raw':!![],'where':{'id':_0x4a5f41[_0xa0c3('0x41')]['id']}},_0x3d0b8c={};_0x3d0b8c[_0xa0c3('0x2b')]=_[_0xa0c3('0x42')](db[_0xa0c3('0x27')][_0xa0c3('0x28')]);_0x3d0b8c[_0xa0c3('0x2d')]=_[_0xa0c3('0x42')](_0x4a5f41['query']);_0x3d0b8c[_0xa0c3('0x37')]=_[_0xa0c3('0x2e')](_0x3d0b8c[_0xa0c3('0x2b')],_0x3d0b8c[_0xa0c3('0x2d')]);_0x30dbe4['attributes']=_[_0xa0c3('0x2e')](_0x3d0b8c[_0xa0c3('0x2b')],qs[_0xa0c3('0x2f')](_0x4a5f41[_0xa0c3('0x2d')][_0xa0c3('0x2f')]));_0x30dbe4['attributes']=_0x30dbe4['attributes']['length']?_0x30dbe4[_0xa0c3('0x30')]:_0x3d0b8c['model'];if(_0x4a5f41[_0xa0c3('0x2d')][_0xa0c3('0x3b')]){_0x30dbe4[_0xa0c3('0x3c')]=[{'all':!![]}];}_0x30dbe4=_['merge']({},_0x30dbe4,_0x4a5f41[_0xa0c3('0x43')]);return db['WhatsappApplication']['find'](_0x30dbe4)[_0xa0c3('0x21')](handleEntityNotFound(_0x350c30,null))[_0xa0c3('0x21')](respondWithResult(_0x350c30,null))[_0xa0c3('0x3f')](handleError(_0x350c30,null));};exports[_0xa0c3('0x44')]=function(_0xedba00,_0x23fe12){return db[_0xa0c3('0x27')][_0xa0c3('0x44')](_0xedba00[_0xa0c3('0x45')],{})[_0xa0c3('0x21')](respondWithResult(_0x23fe12,0xc9))['catch'](handleError(_0x23fe12,null));};exports['update']=function(_0x3ffaf8,_0x50df44){if(_0x3ffaf8['body']['id']){delete _0x3ffaf8['body']['id'];}return db[_0xa0c3('0x27')]['find']({'where':{'id':_0x3ffaf8['params']['id']}})[_0xa0c3('0x21')](handleEntityNotFound(_0x50df44,null))[_0xa0c3('0x21')](saveUpdates(_0x3ffaf8[_0xa0c3('0x45')],null))[_0xa0c3('0x21')](respondWithResult(_0x50df44,null))['catch'](handleError(_0x50df44,null));};exports['destroy']=function(_0x164c1c,_0x376b87){return db[_0xa0c3('0x27')][_0xa0c3('0x46')]({'where':{'id':_0x164c1c[_0xa0c3('0x41')]['id']}})[_0xa0c3('0x21')](handleEntityNotFound(_0x376b87,null))[_0xa0c3('0x21')](removeEntity(_0x376b87,null))['catch'](handleError(_0x376b87,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index a99ce67..dd2c118 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 _0x7217=['../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2534a0,_0xda89db){var _0x3209c0=function(_0x1342c3){while(--_0x1342c3){_0x2534a0['push'](_0x2534a0['shift']());}};_0x3209c0(++_0xda89db);}(_0x7217,0x19e));var _0x7721=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x7217[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7721('0xc'),'collate':_0x7721('0xd')});}; \ No newline at end of file +var _0x24ca=['request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment'];(function(_0x309458,_0xba6e63){var _0x3306ee=function(_0x47e10c){while(--_0x47e10c){_0x309458['push'](_0x309458['shift']());}};_0x3306ee(++_0xba6e63);}(_0x24ca,0x1bc));var _0xa24c=function(_0x5dee2a,_0x47d02a){_0x5dee2a=_0x5dee2a-0x0;var _0x31e98e=_0x24ca[_0x5dee2a];return _0x31e98e;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var logger=require(_0xa24c('0x1'))(_0xa24c('0x2'));var moment=require(_0xa24c('0x3'));var BPromise=require('bluebird');var rp=require(_0xa24c('0x4'));var fs=require('fs');var path=require(_0xa24c('0x5'));var rimraf=require(_0xa24c('0x6'));var config=require(_0xa24c('0x7'));var attributes=require(_0xa24c('0x8'));module[_0xa24c('0x9')]=function(_0xf0511,_0x3c0aaa){return _0xf0511[_0xa24c('0xa')](_0xa24c('0xb'),attributes,{'tableName':_0xa24c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa24c('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index e0e0225..42a17a6 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 _0x24ca=['request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s'];(function(_0x20125e,_0xd9fc0f){var _0x29aaea=function(_0x1dae70){while(--_0x1dae70){_0x20125e['push'](_0x20125e['shift']());}};_0x29aaea(++_0xd9fc0f);}(_0x24ca,0x1bc));var _0xa24c=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x24ca[_0x54d4a8];return _0x3b321b;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var moment=require(_0xa24c('0x1'));var BPromise=require(_0xa24c('0x2'));var rs=require(_0xa24c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa24c('0x4'))['db'];var utils=require(_0xa24c('0x5'));var logger=require(_0xa24c('0x6'))(_0xa24c('0x7'));var config=require(_0xa24c('0x8'));var jayson=require(_0xa24c('0x9'));var client=jayson[_0xa24c('0xa')][_0xa24c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dd348,_0x257264,_0x9a5013){return new BPromise(function(_0x481196,_0x42d89c){return client[_0xa24c('0xc')](_0x2dd348,_0x9a5013)[_0xa24c('0xd')](function(_0x5eac78){logger[_0xa24c('0xe')](_0xa24c('0xf'),_0x257264,_0xa24c('0x10'));logger[_0xa24c('0x11')](_0xa24c('0x12'),_0x257264,_0xa24c('0x10'),JSON[_0xa24c('0x13')](_0x5eac78));if(_0x5eac78[_0xa24c('0x14')]){if(_0x5eac78[_0xa24c('0x14')]['code']===0x1f4){logger[_0xa24c('0x14')](_0xa24c('0xf'),_0x257264,_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);return _0x42d89c(_0x5eac78['error'][_0xa24c('0x15')]);}logger[_0xa24c('0x14')](_0xa24c('0xf'),_0x257264,_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);return _0x481196(_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x257264,_0xa24c('0x10'));_0x481196(_0x5eac78[_0xa24c('0x16')]['message']);}})['catch'](function(_0x221d21){logger[_0xa24c('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x257264,_0x221d21);_0x42d89c(_0x221d21);});});} \ No newline at end of file +var _0x9bde=['code','message','WhatsappApplication,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x333958,_0x1087a3){var _0x1cb927=function(_0x11cb51){while(--_0x11cb51){_0x333958['push'](_0x333958['shift']());}};_0x1cb927(++_0x1087a3);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3c8d86,_0x518906){_0x3c8d86=_0x3c8d86-0x0;var _0x40613a=_0x9bde[_0x3c8d86];return _0x40613a;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('WhatsappApplication,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 9c2d8ac..b11f248 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 _0xae30=['describe','/:id','show','/:id/messages','/:id/download','download','post','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','/:id/tags','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe'];(function(_0x3922b1,_0x4978e6){var _0x49c093=function(_0x1e01e7){while(--_0x1e01e7){_0x3922b1['push'](_0x3922b1['shift']());}};_0x49c093(++_0x4978e6);}(_0xae30,0x10a));var _0x0ae3=function(_0x484c03,_0x13c1d2){_0x484c03=_0x484c03-0x0;var _0x294127=_0xae30[_0x484c03];return _0x294127;};'use strict';var multer=require(_0x0ae3('0x0'));var util=require(_0x0ae3('0x1'));var path=require(_0x0ae3('0x2'));var timeout=require('connect-timeout');var express=require(_0x0ae3('0x3'));var router=express[_0x0ae3('0x4')]();var fs_extra=require(_0x0ae3('0x5'));var auth=require(_0x0ae3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0ae3('0x7'));var controller=require(_0x0ae3('0x8'));router[_0x0ae3('0x9')]('/',auth[_0x0ae3('0xa')](),controller[_0x0ae3('0xb')]);router[_0x0ae3('0x9')](_0x0ae3('0xc'),auth[_0x0ae3('0xa')](),controller[_0x0ae3('0xd')]);router[_0x0ae3('0x9')](_0x0ae3('0xe'),auth[_0x0ae3('0xa')](),controller[_0x0ae3('0xf')]);router['get'](_0x0ae3('0x10'),auth[_0x0ae3('0xa')](),controller['getMessages']);router['get'](_0x0ae3('0x11'),auth[_0x0ae3('0xa')](),controller[_0x0ae3('0x12')]);router[_0x0ae3('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0ae3('0x13')](_0x0ae3('0x10'),auth['isAuthenticated'](),controller['addMessage']);router[_0x0ae3('0x13')]('/:id/tags',auth[_0x0ae3('0xa')](),interaction[_0x0ae3('0x14')](_0x0ae3('0x15'),_0x0ae3('0x16')),controller[_0x0ae3('0x17')]);router[_0x0ae3('0x18')](_0x0ae3('0xe'),auth['isAuthenticated'](),interaction[_0x0ae3('0x14')]('whatsapp',_0x0ae3('0x19')),controller[_0x0ae3('0x1a')]);router[_0x0ae3('0x1b')](_0x0ae3('0xe'),auth[_0x0ae3('0xa')](),interaction[_0x0ae3('0x14')](_0x0ae3('0x15'),_0x0ae3('0x1c')),controller[_0x0ae3('0x1d')]);router['delete'](_0x0ae3('0x1e'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0xb4c7=['post','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','whatsapp','whatsappinteraction:update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','get','describe','/:id','show','/:id/messages','getMessages','/:id/download','create'];(function(_0x3027b1,_0x282484){var _0x59447f=function(_0x20adff){while(--_0x20adff){_0x3027b1['push'](_0x3027b1['shift']());}};_0x59447f(++_0x282484);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x33158c,_0x3e4157){_0x33158c=_0x33158c-0x0;var _0x412f72=_0xb4c7[_0x33158c];return _0x412f72;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get']('/',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xb')]);router[_0x7b4c('0xc')]('/describe',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xd')]);router['get'](_0x7b4c('0xe'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xf')]);router[_0x7b4c('0xc')](_0x7b4c('0x10'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x11')]);router[_0x7b4c('0xc')](_0x7b4c('0x12'),auth[_0x7b4c('0xa')](),controller['download']);router['post']('/',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x13')]);router[_0x7b4c('0x14')](_0x7b4c('0x10'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x15')]);router[_0x7b4c('0x14')](_0x7b4c('0x16'),auth[_0x7b4c('0xa')](),interaction[_0x7b4c('0x17')]('whatsapp',_0x7b4c('0x18')),controller[_0x7b4c('0x19')]);router[_0x7b4c('0x1a')](_0x7b4c('0xe'),auth[_0x7b4c('0xa')](),interaction[_0x7b4c('0x17')](_0x7b4c('0x1b'),_0x7b4c('0x1c')),controller['update']);router[_0x7b4c('0x1d')](_0x7b4c('0xe'),auth[_0x7b4c('0xa')](),interaction[_0x7b4c('0x17')]('whatsapp',_0x7b4c('0x1e')),controller[_0x7b4c('0x1f')]);router[_0x7b4c('0x1d')](_0x7b4c('0x16'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x20')]);module[_0x7b4c('0x21')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 9099560..4127e96 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 _0xed08=['BOOLEAN','DATE','STRING','ENUM','out','moment','exports'];(function(_0x784e31,_0x51f0f1){var _0x221db5=function(_0x18c42c){while(--_0x18c42c){_0x784e31['push'](_0x784e31['shift']());}};_0x221db5(++_0x51f0f1);}(_0xed08,0x67));var _0x8ed0=function(_0x47a796,_0x246bb3){_0x47a796=_0x47a796-0x0;var _0x15d37d=_0xed08[_0x47a796];return _0x15d37d;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8ed0('0x0'));module[_0x8ed0('0x1')]={'closed':{'type':Sequelize[_0x8ed0('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8ed0('0x3')]},'disposition':{'type':Sequelize[_0x8ed0('0x4')]},'secondDisposition':{'type':Sequelize[_0x8ed0('0x4')]},'thirdDisposition':{'type':Sequelize[_0x8ed0('0x4')]},'note':{'type':Sequelize[_0x8ed0('0x4')]},'phone':{'type':Sequelize[_0x8ed0('0x4')]},'read1stAt':{'type':Sequelize[_0x8ed0('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x8ed0('0x5')]('in',_0x8ed0('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x8ed0('0x5')]('in',_0x8ed0('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x8ed0('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x6f47=['out','moment','exports','DATE','STRING','ENUM'];(function(_0x36f5d4,_0x5786a0){var _0x194585=function(_0x32ed21){while(--_0x32ed21){_0x36f5d4['push'](_0x36f5d4['shift']());}};_0x194585(++_0x5786a0);}(_0x6f47,0xc7));var _0x76f4=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x6f47[_0x3ab9ee];return _0x82ee88;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x76f4('0x0'));module[_0x76f4('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x76f4('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x76f4('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x76f4('0x3')]},'phone':{'type':Sequelize[_0x76f4('0x3')]},'read1stAt':{'type':Sequelize[_0x76f4('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x76f4('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x76f4('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x76f4('0x4')]('in',_0x76f4('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 81adb25..c5d28bf 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 _0xde3a=['c.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','rows','show','params','includeAll','include','options','create','update','describe','addMessage','omit','ids','getMessages','findOne','WhatsappMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','emit','whatsappInteractionTags:save','removeTags','download','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','firstName','lastName','Attachment','direction','secret','WhatsappAccount','Account','get','mkdirSync','Whatsapp','Owner','N.A.','closedAt','disposition','Messages','existsSync','createReadStream','pipe','createWriteStream','out','System','basename','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','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','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','limit','undefined','count','offset','set','json','apply','reject','save','then','destroy','end','stack','name','Users','fullname','TagIds','Tags','split','forEach','push','catch','talking','answered','unmanaged','total','closed','waiting','UserId','index','map','WhatsappInteraction','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','field','color','from','tools_tags','select','u.fullname','ui.WhatsappInteractionId','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','User','$substring','start','body','isEmpty','i.WhatsappAccountId\x20IN\x20?','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\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?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','merge','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.*'];(function(_0x8526b2,_0x268906){var _0x492ece=function(_0x5cca08){while(--_0x5cca08){_0x8526b2['push'](_0x8526b2['shift']());}};_0x492ece(++_0x268906);}(_0xde3a,0x140));var _0xade3=function(_0x194135,_0x14f9bc){_0x194135=_0x194135-0x0;var _0x2c050f=_0xde3a[_0x194135];return _0x2c050f;};'use strict';var emlformat=require(_0xade3('0x0'));var rimraf=require(_0xade3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xade3('0x2'));var BPromise=require(_0xade3('0x3'));var Mustache=require(_0xade3('0x4'));var util=require(_0xade3('0x5'));var path=require(_0xade3('0x6'));var sox=require(_0xade3('0x7'));var csv=require(_0xade3('0x8'));var ejs=require(_0xade3('0x9'));var fs=require('fs');var fs_extra=require(_0xade3('0xa'));var _=require('lodash');var squel=require(_0xade3('0xb'));var crypto=require(_0xade3('0xc'));var jsforce=require(_0xade3('0xd'));var deskjs=require(_0xade3('0xe'));var toCsv=require(_0xade3('0x8'));var querystring=require(_0xade3('0xf'));var Papa=require(_0xade3('0x10'));var Redis=require('ioredis');var authService=require(_0xade3('0x11'));var qs=require(_0xade3('0x12'));var as=require(_0xade3('0x13'));var pdf=require(_0xade3('0x14'));var hardwareService=require(_0xade3('0x15'));var logger=require('../../config/logger')(_0xade3('0x16'));var utils=require(_0xade3('0x17'));var config=require(_0xade3('0x18'));var licenseUtil=require(_0xade3('0x19'));var db=require(_0xade3('0x1a'))['db'];config[_0xade3('0x1b')]=_[_0xade3('0x1c')](config[_0xade3('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xade3('0x1d'))(new Redis(config['redis']));require(_0xade3('0x1e'))[_0xade3('0x1f')](socket);function respondWithStatusCode(_0x445269,_0x57c690){_0x57c690=_0x57c690||0xcc;return function(_0x5dbaa7){if(_0x5dbaa7){return _0x445269[_0xade3('0x20')](_0x57c690);}return _0x445269[_0xade3('0x21')](_0x57c690)['end']();};}function respondWithResult(_0xb60571,_0x5d17d7){_0x5d17d7=_0x5d17d7||0xc8;return function(_0x3a79d2){if(_0x3a79d2){return _0xb60571[_0xade3('0x21')](_0x5d17d7)['json'](_0x3a79d2);}};}function respondWithFilteredResult(_0x43e1cb,_0x247c25){return function(_0x5bb218){if(_0x5bb218){var _0x4264d8=typeof _0x247c25['offset']==='undefined'&&typeof _0x247c25[_0xade3('0x22')]===_0xade3('0x23');var _0x2e6791=_0x5bb218[_0xade3('0x24')];var _0x2a4a7c=_0x4264d8?0x0:_0x247c25[_0xade3('0x25')];var _0x5e78b8=_0x4264d8?_0x5bb218[_0xade3('0x24')]:_0x247c25[_0xade3('0x25')]+_0x247c25[_0xade3('0x22')];var _0xf3edf5;if(_0x5e78b8>=_0x2e6791){_0x5e78b8=_0x2e6791;_0xf3edf5=0xc8;}else{_0xf3edf5=0xce;}_0x43e1cb[_0xade3('0x21')](_0xf3edf5);return _0x43e1cb[_0xade3('0x26')]('Content-Range',_0x2a4a7c+'-'+_0x5e78b8+'/'+_0x2e6791)[_0xade3('0x27')](_0x5bb218);}return null;};}function patchUpdates(_0x36f028){return function(_0xe4109b){try{jsonpatch[_0xade3('0x28')](_0xe4109b,_0x36f028,!![]);}catch(_0x421cd2){return BPromise[_0xade3('0x29')](_0x421cd2);}return _0xe4109b[_0xade3('0x2a')]();};}function saveUpdates(_0x2f50f8,_0x15a121){return function(_0x54dc1a){if(_0x54dc1a){return _0x54dc1a['update'](_0x2f50f8)[_0xade3('0x2b')](function(_0x57b91e){return _0x57b91e;});}return null;};}function removeEntity(_0x596362,_0x249a6c){return function(_0x1e901b){if(_0x1e901b){return _0x1e901b[_0xade3('0x2c')]()[_0xade3('0x2b')](function(){_0x596362['status'](0xcc)[_0xade3('0x2d')]();});}};}function handleEntityNotFound(_0x3ef3f5,_0x1842c5){return function(_0x49c4c6){if(!_0x49c4c6){_0x3ef3f5['sendStatus'](0x194);}return _0x49c4c6;};}function handleError(_0x8eeab,_0x14b149){_0x14b149=_0x14b149||0x1f4;return function(_0xc4e273){logger['error'](_0xc4e273[_0xade3('0x2e')]);if(_0xc4e273[_0xade3('0x2f')]){delete _0xc4e273[_0xade3('0x2f')];}_0x8eeab[_0xade3('0x21')](_0x14b149)['send'](_0xc4e273);};}function getInteractionUsers(_0x422fbf,_0x3861a6){return new BPromise(function(_0x5edf40,_0x36b016){try{if(_0x3861a6[_0x422fbf['id']]){_0x422fbf[_0xade3('0x30')]=_['map'](_0x3861a6[_0x422fbf['id']],function(_0x3717da){return{'id':_0x3717da['id'],'fullname':_0x3717da[_0xade3('0x31')]};});}}catch(_0x427b96){_0x36b016(_0x427b96);}_0x5edf40(_0x422fbf);});}function getInteractionTags(_0x1c8e56,_0x272361){return new BPromise(function(_0xf77b81,_0x4aac33){try{if(_0x1c8e56[_0xade3('0x32')]){_0x1c8e56[_0xade3('0x33')]=[];_0x1c8e56['TagIds'][_0xade3('0x34')](',')[_0xade3('0x35')](function(_0x18f25f){_0x1c8e56[_0xade3('0x33')][_0xade3('0x36')](_0x272361[_0x18f25f]);});}delete _0x1c8e56[_0xade3('0x32')];}catch(_0x2f0284){_0x4aac33(_0x2f0284);}_0xf77b81(_0x1c8e56);});}function updateWhatsappInteraction(_0xc3bd2c,_0x509cf7,_0x36d861){return new BPromise(function(_0x1c584f,_0x32410c){return getInteractionUsers(_0xc3bd2c,_0x36d861)[_0xade3('0x2b')](function(_0x4b7801){return getInteractionTags(_0x4b7801,_0x509cf7);})[_0xade3('0x2b')](function(_0x11cc68){return getStateInteraction(_0x11cc68);})['then'](function(_0x1b3f24){_0x1c584f(_0x1b3f24);})[_0xade3('0x37')](function(_0x4eaf97){_0x32410c(_0x4eaf97);});});}function getStateInteraction(_0xe80641){return new BPromise(function(_0x56d69f){_0xe80641['waiting']=0x0;_0xe80641[_0xade3('0x38')]=0x0;_0xe80641[_0xade3('0x39')]=0x0;_0xe80641[_0xade3('0x3a')]=0x0;_0xe80641[_0xade3('0x3b')]=0x0;if(!_0xe80641[_0xade3('0x3c')]&&!_0xe80641['UserId']){_0xe80641[_0xade3('0x3d')]+=0x1;}if(!_0xe80641[_0xade3('0x3c')]&&_0xe80641[_0xade3('0x3e')]){_0xe80641[_0xade3('0x38')]+=0x1;if(_0xe80641['waiting']){_0xe80641['waiting']-=0x1;}}if(_0xe80641[_0xade3('0x3c')]&&_0xe80641[_0xade3('0x3e')]){_0xe80641['answered']+=0x1;if(_0xe80641[_0xade3('0x38')]){_0xe80641['talking']-=0x1;}}if(_0xe80641['closed']&&!_0xe80641[_0xade3('0x3e')]){_0xe80641['unmanaged']+=0x1;if(_0xe80641['waiting']){_0xe80641[_0xade3('0x3d')]-=0x1;}}_0xe80641[_0xade3('0x3b')]+=0x1;_0x56d69f(_0xe80641);});}exports[_0xade3('0x3f')]=function(_0x39db1a,_0x41034d){var _0x4eef75={},_0x2355a5={},_0x1027ff={'count':0x0,'rows':[]};var _0x334283=_[_0xade3('0x40')](db[_0xade3('0x41')][_0xade3('0x42')],function(_0xfb9b9b){return{'name':_0xfb9b9b[_0xade3('0x43')],'type':_0xfb9b9b[_0xade3('0x44')][_0xade3('0x45')]};});_0x2355a5['model']=_['map'](_0x334283,_0xade3('0x2f'));_0x2355a5[_0xade3('0x46')]=_[_0xade3('0x47')](_0x39db1a[_0xade3('0x46')]);_0x2355a5['filters']=_[_0xade3('0x48')](_0x2355a5['model'],_0x2355a5[_0xade3('0x46')]);_0x4eef75[_0xade3('0x49')]=_[_0xade3('0x48')](_0x2355a5[_0xade3('0x4a')],qs[_0xade3('0x4b')](_0x39db1a[_0xade3('0x46')][_0xade3('0x4b')]));_0x4eef75['attributes']=_0x4eef75[_0xade3('0x49')][_0xade3('0x4c')]?_0x4eef75['attributes']:_0x2355a5['model'];if(!_0x39db1a[_0xade3('0x46')][_0xade3('0x4d')](_0xade3('0x4e'))){_0x4eef75['limit']=qs[_0xade3('0x22')](_0x39db1a[_0xade3('0x46')][_0xade3('0x22')]);_0x4eef75[_0xade3('0x25')]=qs['offset'](_0x39db1a[_0xade3('0x46')]['offset']);}_0x4eef75[_0xade3('0x4f')]=qs['sort'](_0x39db1a[_0xade3('0x46')][_0xade3('0x50')]);_0x4eef75[_0xade3('0x51')]=qs['filters'](_[_0xade3('0x52')](_0x39db1a['query'],_0x2355a5[_0xade3('0x53')]),_0x334283);var _0x944f8=[];var _0x7c9cbd=squel['select']()[_0xade3('0x54')]('id')[_0xade3('0x54')](_0xade3('0x2f'))[_0xade3('0x54')](_0xade3('0x55'))[_0xade3('0x56')](_0xade3('0x57'));var _0x1976e1=squel[_0xade3('0x58')]()[_0xade3('0x54')]('u.id')[_0xade3('0x54')](_0xade3('0x59'))['field'](_0xade3('0x5a'))[_0xade3('0x56')]('user_has_whatsapp_interactions','ui')[_0xade3('0x5b')](_0xade3('0x5c'),'u',_0xade3('0x5d'));var _0x3b43c3=squel[_0xade3('0x58')]()[_0xade3('0x56')]('whatsapp_interactions','i')[_0xade3('0x5b')](_0xade3('0x5e'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xade3('0x5b')]('users','o',_0xade3('0x5f'))[_0xade3('0x5b')](_0xade3('0x60'),'a',_0xade3('0x61'))[_0xade3('0x5b')](_0xade3('0x62'),'me','me.WhatsappInteractionId\x20=\x20i.id')[_0xade3('0x5b')](_0xade3('0x63'),'it',_0xade3('0x64'))[_0xade3('0x5b')]('tools_tags','t',_0xade3('0x65'));var _0x4cb692=squel['expr']();var _0x3db2ca=[];var _0x518143=squel[_0xade3('0x66')]();var _0x19f8b1;if(_0x39db1a['query'][_0xade3('0x67')]){_0x19f8b1=as['parseSearch'](_0x39db1a['query'][_0xade3('0x67')]);var _0x20018e=_0x19f8b1[_0xade3('0x68')];for(var _0x2e253c=0x0;_0x2e253c<_0x19f8b1[_0xade3('0x69')][_0xade3('0x4c')];_0x2e253c++){var _0x349fb3=_0x19f8b1[_0xade3('0x69')][_0x2e253c];var _0xae0e01='i';var _0x4c0383=_[_0xade3('0x6a')](_0x334283,[_0xade3('0x2f'),_0x349fb3['field']]);if(!_0x4c0383){switch(_0x349fb3[_0xade3('0x54')]){case _0xade3('0x6b'):if(_0x349fb3[_0xade3('0x6c')]==0x1){_0x3b43c3['having']('`'+_0x349fb3[_0xade3('0x54')]+'`\x20=\x200');}else{_0x3b43c3[_0xade3('0x6d')]('`'+_0x349fb3[_0xade3('0x54')]+_0xade3('0x6e'));}break;case _0xade3('0x6f'):if(_0x349fb3[_0xade3('0x70')]==='$substring'){if(_0x349fb3[_0xade3('0x6c')][_0xade3('0x34')]('\x20')['length']>0x1){_0x4cb692[_0x20018e](_0xade3('0x71'),qs[_0xade3('0x72')](_0x349fb3['value']),null);}else{var _0x381a97='%'+_0x349fb3['value']+'%';_0x4cb692[_0x20018e](_0xade3('0x73'),_0x381a97,_0x381a97,_0x381a97);}}else{_0x4c0383=_[_0xade3('0x6a')](_0x334283,[_0xade3('0x2f'),_0xade3('0x74')]);_0x349fb3[_0xade3('0x54')]=_0xade3('0x74');_0xc8d173=as[_0xade3('0x75')](_0xae0e01,_0x4c0383['type'],_0x349fb3);_0x4cb692[_0x20018e](_0xc8d173[_0xade3('0x76')],_0xc8d173[_0xade3('0x6c')]['start'],_0xc8d173[_0xade3('0x6c')]['end']);}break;case _0xade3('0x77'):var _0xd655f0=_0x349fb3['value']['split'](',')[_0xade3('0x40')](function(_0x1e7885){return Number(_0x1e7885);});_0xd655f0[_0xade3('0x35')](function(_0x382d41){_0x518143['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x382d41+',%');});_0x3db2ca=_['union'](_0x3db2ca,_0xd655f0);break;case _0xade3('0x78'):if(_0x349fb3['operator']===_0xade3('0x79')){_0x4cb692[_0x20018e]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x349fb3[_0xade3('0x6c')]+'%',null);}else{_0x4c0383=_[_0xade3('0x6a')](_0x334283,[_0xade3('0x2f'),_0xade3('0x3e')]);_0x349fb3['field']=_0xade3('0x3e');_0xc8d173=as[_0xade3('0x75')](_0xae0e01,_0x4c0383[_0xade3('0x44')],_0x349fb3);_0x4cb692[_0x20018e](_0xc8d173[_0xade3('0x76')],_0xc8d173['value'][_0xade3('0x7a')],_0xc8d173[_0xade3('0x6c')][_0xade3('0x2d')]);}break;case _0xade3('0x7b'):_0xc8d173=as[_0xade3('0x75')]('me',null,_0x349fb3);_0x4cb692[_0x20018e](_0xc8d173[_0xade3('0x76')],_0xc8d173[_0xade3('0x6c')][_0xade3('0x7a')],_0xc8d173[_0xade3('0x6c')][_0xade3('0x2d')]);break;}}else{var _0xc8d173=as['buildExpression'](_0xae0e01,_0x4c0383[_0xade3('0x44')],_0x349fb3);_0x4cb692[_0x20018e](_0xc8d173[_0xade3('0x76')],_0xc8d173[_0xade3('0x6c')]['start'],_0xc8d173[_0xade3('0x6c')][_0xade3('0x2d')]);}}}else{var _0x332fae=_(_0x39db1a[_0xade3('0x46')])[_0xade3('0x47')]()[_0xade3('0x40')](function(_0x451a17){return _['some'](_0x334283,[_0xade3('0x2f'),_0x451a17])?_0x451a17:undefined;})['compact']()['value']();if(!_[_0xade3('0x7c')](_0x332fae)){_0x332fae[_0xade3('0x35')](function(_0x57bb29){if(_0x57bb29==='WhatsappAccountId'){_0x3b43c3[_0xade3('0x51')](_0xade3('0x7d'),[]['concat'](_0x39db1a[_0xade3('0x46')][_0x57bb29]));}else if(_0x57bb29===_0xade3('0x7e')){var _0x34b4c5=JSON[_0xade3('0x7f')](_0x39db1a['query'][_0x57bb29])['$gte'];var _0x89500c=JSON[_0xade3('0x7f')](_0x39db1a[_0xade3('0x46')][_0x57bb29])[_0xade3('0x80')];_0x3b43c3[_0xade3('0x51')](_0xade3('0x81'),_0x34b4c5,_0x89500c);}else{if(_0x39db1a[_0xade3('0x46')][_0x57bb29]===_0xade3('0x82')){_0x3b43c3[_0xade3('0x51')]('i.'+_0x57bb29+_0xade3('0x83'));}else{_0x3b43c3[_0xade3('0x51')]('i.'+_0x57bb29+_0xade3('0x84'),_0x39db1a[_0xade3('0x46')][_0x57bb29]);}}});}if(_0x39db1a[_0xade3('0x46')][_0xade3('0x85')]){if(_0x39db1a[_0xade3('0x46')][_0xade3('0x85')]==0x1){_0x3b43c3[_0xade3('0x6d')]('`unreadMessages`\x20=\x200');}else{_0x3b43c3[_0xade3('0x6d')](_0xade3('0x86'));}}if(_0x39db1a['query'][_0xade3('0x87')]){_0x3db2ca=_[_0xade3('0x88')](_0x39db1a[_0xade3('0x46')][_0xade3('0x87')])?_0x39db1a[_0xade3('0x46')][_0xade3('0x87')]:new Array(_0x39db1a[_0xade3('0x46')][_0xade3('0x87')]);_0x3db2ca['forEach'](function(_0x5e0282){_0x518143['or'](_0xade3('0x89'),'%,'+_0x5e0282+',%');});}if(_0x39db1a[_0xade3('0x46')][_0xade3('0x8a')]){var _0x282b72=_0x39db1a['query'][_0xade3('0x8a')][_0xade3('0x8b')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xade3('0x8c')](_0x282b72)){_0x4cb692['or'](_0xade3('0x8d'),_0x282b72+'%')['or']('i.phone\x20LIKE\x20?',_0x282b72+'%');}else{_0x4cb692['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xade3('0x72')](_0x282b72))['or'](_0xade3('0x8e'),_0x282b72+'%');}}}_0x3b43c3[_0xade3('0x51')](_0x4cb692);_0x3b43c3[_0xade3('0x8f')](_0xade3('0x90'));var _0x11dd84={'type':db[_0xade3('0x91')]['QueryTypes'][_0xade3('0x92')],'raw':!![]};var _0x485e3f=_0x3b43c3[_0xade3('0x93')]();_0x485e3f[_0xade3('0x54')](_0xade3('0x90'));_0x485e3f[_0xade3('0x54')](_0xade3('0x94'),_0xade3('0x6b'));if(_0x4eef75[_0xade3('0x4f')]){_0x4eef75['order'][_0xade3('0x35')](function(_0x473fdf){var _0x207e3c=_0x473fdf[0x0]===_0xade3('0x95')?_0x473fdf[0x0]:'i.'+_0x473fdf[0x0];_0x3b43c3[_0xade3('0x4f')](_0x207e3c,_0x473fdf[0x1]==='DESC'?![]:!![]);});}if(!_[_0xade3('0x7c')](_0x3db2ca)){_0x3b43c3[_0xade3('0x6d')](_0x518143);_0x485e3f[_0xade3('0x51')](_0xade3('0x96'),_0x3db2ca);}BPromise[_0xade3('0x97')]()[_0xade3('0x2b')](function(){if(!_0x19f8b1){if(_0x39db1a[_0xade3('0x46')][_0xade3('0x98')])return;_0x485e3f[_0xade3('0x51')](_0xade3('0x99'));_0x3b43c3[_0xade3('0x51')](_0xade3('0x99'));return;}if(_0x39db1a[_0xade3('0x9a')][_0xade3('0x9b')]!==_0xade3('0x9c'))return;return _0x39db1a['user'][_0xade3('0x9d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2502b2){if(_['isEmpty'](_0x2502b2)){_0x485e3f[_0xade3('0x51')](_0xade3('0x9e'));_0x3b43c3[_0xade3('0x51')](_0xade3('0x9e'));}else{_0x485e3f[_0xade3('0x51')](_0xade3('0x7d'),_[_0xade3('0x40')](_0x2502b2,'id'));_0x3b43c3[_0xade3('0x51')](_0xade3('0x7d'),_[_0xade3('0x40')](_0x2502b2,'id'));}});})[_0xade3('0x2b')](function(){if(_0x39db1a[_0xade3('0x9a')]['role']===_0xade3('0x9c')&&!_0x19f8b1&&!_0x39db1a[_0xade3('0x46')][_0xade3('0x98')])return[];return db[_0xade3('0x9f')]['query'](_0x485e3f[_0xade3('0xa0')](),_0x11dd84);})[_0xade3('0x2b')](function(_0x3bfd82){_0x1027ff[_0xade3('0x24')]=_0x3bfd82[_0xade3('0x4c')];if(_0x1027ff[_0xade3('0x24')]===0x0)return[];return db[_0xade3('0x9f')]['query'](_0x7c9cbd[_0xade3('0xa0')](),_0x11dd84)[_0xade3('0x2b')](function(_0x3a7c2e){_0x944f8=_['keyBy'](_0x3a7c2e,'id');_0x11dd84=_[_0xade3('0xa1')](_0x11dd84,{'model':db[_0xade3('0x41')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x39db1a[_0xade3('0x46')][_0xade3('0x4b')]){_0x4eef75[_0xade3('0x49')]['forEach'](function(_0x55c743){_0x3b43c3[_0xade3('0x54')]('i.'+_0x55c743);});}else{_0x3b43c3[_0xade3('0x54')](_0xade3('0x94'),_0xade3('0x6b'));_0x3b43c3[_0xade3('0x54')](_0xade3('0xa2'),_0xade3('0xa3'));_0x3b43c3[_0xade3('0x54')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x3b43c3[_0xade3('0x54')](_0xade3('0xa4'),'contactName');_0x3b43c3[_0xade3('0x54')](_0xade3('0xa5'));_0x3b43c3[_0xade3('0x54')](_0xade3('0xa6'),'Contact.firstName');_0x3b43c3[_0xade3('0x54')](_0xade3('0xa7'),_0xade3('0xa8'));_0x3b43c3[_0xade3('0x54')](_0xade3('0xa9'),'Contact.email');_0x3b43c3['field']('c.phone',_0xade3('0xaa'));_0x3b43c3['field'](_0xade3('0xab'),_0xade3('0xac'));_0x3b43c3[_0xade3('0x54')](_0xade3('0xad'),_0xade3('0xae'));_0x3b43c3[_0xade3('0x54')](_0xade3('0xaf'),_0xade3('0xb0'));_0x3b43c3[_0xade3('0x54')](_0xade3('0xb1'),'Owner.internal');_0x3b43c3[_0xade3('0x54')](_0xade3('0xb2'),_0xade3('0x32'));}if(_0x4eef75['limit'])_0x3b43c3['limit'](_0x4eef75[_0xade3('0x22')]);if(_0x4eef75[_0xade3('0x25')])_0x3b43c3[_0xade3('0x25')](_0x4eef75['offset']);return db[_0xade3('0x9f')]['query'](_0x3b43c3[_0xade3('0xa0')](),_0x11dd84);})[_0xade3('0x2b')](function(_0x1f290e){if(_0x1f290e['length']>0x0)_0x1976e1[_0xade3('0x51')](_0xade3('0xb3'),_[_0xade3('0x40')](_0x1f290e,'id'));return db[_0xade3('0x9f')][_0xade3('0x46')](_0x1976e1[_0xade3('0xa0')](),_0x11dd84)[_0xade3('0x2b')](function(_0x3688f1){var _0x436900=_[_0xade3('0xb4')](_0x3688f1,'WhatsappInteractionId');var _0x27043d=[];_0x1f290e[_0xade3('0x35')](function(_0x3963bf){_0x27043d[_0xade3('0x36')](updateWhatsappInteraction(_0x3963bf,_0x944f8,_0x436900));});return BPromise['all'](_0x27043d);});});})[_0xade3('0x2b')](function(_0x15675a){_0x1027ff[_0xade3('0xb5')]=_0x15675a;return _0x1027ff;})[_0xade3('0x2b')](respondWithFilteredResult(_0x41034d,_0x4eef75))[_0xade3('0x37')](handleError(_0x41034d,null));};exports[_0xade3('0xb6')]=function(_0x2433ba,_0x4433c6){var _0x3a79cd={'raw':![],'where':{'id':_0x2433ba[_0xade3('0xb7')]['id']}},_0x55a61b={};_0x55a61b[_0xade3('0x4a')]=_[_0xade3('0x47')](db['WhatsappInteraction'][_0xade3('0x42')]);_0x55a61b['query']=_['keys'](_0x2433ba[_0xade3('0x46')]);_0x55a61b['filters']=_[_0xade3('0x48')](_0x55a61b[_0xade3('0x4a')],_0x55a61b['query']);_0x3a79cd[_0xade3('0x49')]=_[_0xade3('0x48')](_0x55a61b['model'],qs['fields'](_0x2433ba[_0xade3('0x46')][_0xade3('0x4b')]));_0x3a79cd[_0xade3('0x49')]=_0x3a79cd[_0xade3('0x49')][_0xade3('0x4c')]?_0x3a79cd[_0xade3('0x49')]:_0x55a61b['model'];if(_0x2433ba[_0xade3('0x46')][_0xade3('0xb8')]){_0x3a79cd[_0xade3('0xb9')]=[{'all':!![]}];}_0x3a79cd=_[_0xade3('0xa1')]({},_0x3a79cd,_0x2433ba[_0xade3('0xba')]);return db[_0xade3('0x41')]['find'](_0x3a79cd)[_0xade3('0x2b')](handleEntityNotFound(_0x4433c6,null))['then'](respondWithResult(_0x4433c6,null))[_0xade3('0x37')](handleError(_0x4433c6,null));};exports[_0xade3('0xbb')]=function(_0x3906c2,_0x1460cc){return db[_0xade3('0x41')][_0xade3('0xbb')](_0x3906c2['body'],{})[_0xade3('0x2b')](respondWithResult(_0x1460cc,0xc9))[_0xade3('0x37')](handleError(_0x1460cc,null));};exports[_0xade3('0xbc')]=function(_0x40d390,_0x58c17b){if(_0x40d390[_0xade3('0x7b')]['id']){delete _0x40d390[_0xade3('0x7b')]['id'];}return db['WhatsappInteraction'][_0xade3('0x6a')]({'where':{'id':_0x40d390['params']['id']}})[_0xade3('0x2b')](handleEntityNotFound(_0x58c17b,null))[_0xade3('0x2b')](saveUpdates(_0x40d390[_0xade3('0x7b')],null))[_0xade3('0x2b')](respondWithResult(_0x58c17b,null))['catch'](handleError(_0x58c17b,null));};exports[_0xade3('0x2c')]=function(_0x3aefd0,_0x32d19f){return db[_0xade3('0x41')][_0xade3('0x6a')]({'where':{'id':_0x3aefd0[_0xade3('0xb7')]['id']}})['then'](handleEntityNotFound(_0x32d19f,null))['then'](removeEntity(_0x32d19f,null))[_0xade3('0x37')](handleError(_0x32d19f,null));};exports[_0xade3('0xbd')]=function(_0x137762,_0x16bc2d){return db[_0xade3('0x41')][_0xade3('0xbd')]()[_0xade3('0x2b')](respondWithResult(_0x16bc2d,null))[_0xade3('0x37')](handleError(_0x16bc2d,null));};exports[_0xade3('0xbe')]=function(_0x4115a0,_0x1586ca,_0x4d09a5){return db['WhatsappMessage'][_0xade3('0x6a')]({'where':{'id':_0x4115a0[_0xade3('0xb7')]['id']}})[_0xade3('0x2b')](handleEntityNotFound(_0x1586ca,null))[_0xade3('0x2b')](function(_0x195c8e){if(_0x195c8e){return _0x195c8e[_0xade3('0xbe')](_0x4115a0['body']['ids'],_[_0xade3('0xbf')](_0x4115a0['body'],[_0xade3('0xc0'),'id'])||{});}})[_0xade3('0x2b')](respondWithResult(_0x1586ca,null))[_0xade3('0x37')](handleError(_0x1586ca,null));};exports[_0xade3('0xc1')]=function(_0x3e6fed,_0x1a7184,_0x49088e){var _0x442f34={'raw':![],'where':{}};var _0x32c309={};var _0xe713c0={'count':0x0,'rows':[]};return db[_0xade3('0x41')][_0xade3('0xc2')]({'where':{'id':_0x3e6fed[_0xade3('0xb7')]['id']}})[_0xade3('0x2b')](handleEntityNotFound(_0x1a7184,null))[_0xade3('0x2b')](function(_0x232f09){if(_0x232f09){_0x32c309[_0xade3('0x4a')]=_[_0xade3('0x47')](db[_0xade3('0xc3')]['rawAttributes']);_0x32c309[_0xade3('0x46')]=_[_0xade3('0x47')](_0x3e6fed['query']);_0x32c309['filters']=_['intersection'](_0x32c309[_0xade3('0x4a')],_0x32c309[_0xade3('0x46')]);_0x442f34[_0xade3('0x49')]=_[_0xade3('0x48')](_0x32c309[_0xade3('0x4a')],qs[_0xade3('0x4b')](_0x3e6fed[_0xade3('0x46')]['fields']));_0x442f34['attributes']=_0x442f34[_0xade3('0x49')][_0xade3('0x4c')]?_0x442f34[_0xade3('0x49')]:_0x32c309[_0xade3('0x4a')];if(!_0x3e6fed[_0xade3('0x46')]['hasOwnProperty']('nolimit')){_0x442f34[_0xade3('0x22')]=qs[_0xade3('0x22')](_0x3e6fed[_0xade3('0x46')]['limit']);_0x442f34[_0xade3('0x25')]=qs[_0xade3('0x25')](_0x3e6fed[_0xade3('0x46')][_0xade3('0x25')]);}_0x442f34[_0xade3('0x4f')]=qs[_0xade3('0x50')](_0x3e6fed['query']['sort']);_0x442f34[_0xade3('0x51')]=qs[_0xade3('0x53')](_[_0xade3('0x52')](_0x3e6fed[_0xade3('0x46')],_0x32c309[_0xade3('0x53')]));_0x442f34[_0xade3('0x51')]['WhatsappInteractionId']=_0x232f09['id'];if(_0x3e6fed['query'][_0xade3('0x8a')]){_0x442f34[_0xade3('0x51')]=_[_0xade3('0xa1')](_0x442f34[_0xade3('0x51')],{'$or':_[_0xade3('0x40')](_0x442f34[_0xade3('0x49')],function(_0x5a3f46){var _0x393886={};_0x393886[_0x5a3f46]={'$like':'%'+_0x3e6fed[_0xade3('0x46')][_0xade3('0x8a')]+'%'};return _0x393886;})});}if(_0x3e6fed[_0xade3('0x46')][_0xade3('0xc4')]){var _0x34615f=_0x3e6fed[_0xade3('0x46')][_0xade3('0xc4')]['split'](',');var _0x1891fc={};_0x1891fc[_0x34615f[0x0]]={'$gte':moment(_0x34615f[0x1])[_0xade3('0xc5')](_0xade3('0xc6'))};_0x442f34[_0xade3('0x51')]=_['merge'](_0x442f34[_0xade3('0x51')],_0x1891fc);}_0x442f34=_[_0xade3('0xa1')]({},_0x442f34,_0x3e6fed[_0xade3('0xba')]);return db[_0xade3('0xc3')]['count']({'where':_0x442f34[_0xade3('0x51')]})[_0xade3('0x2b')](function(_0x1f07b2){_0xe713c0[_0xade3('0x24')]=_0x1f07b2;if(_0x3e6fed[_0xade3('0x46')]['includeAll']){_0x442f34[_0xade3('0xb9')]=[{'all':!![]}];}return db[_0xade3('0xc3')][_0xade3('0xc7')](_0x442f34);})[_0xade3('0x2b')](function(_0x23e6b8){_0xe713c0['rows']=_0x23e6b8;return _0xe713c0;});}})[_0xade3('0x2b')](respondWithFilteredResult(_0x1a7184,_0x442f34))[_0xade3('0x37')](handleError(_0x1a7184,null));};exports[_0xade3('0xc8')]=function(_0x3a0cd2,_0xd60bbb,_0x2adb8a){return db['WhatsappInteraction']['find']({'where':{'id':_0x3a0cd2[_0xade3('0xb7')]['id']}})[_0xade3('0x2b')](handleEntityNotFound(_0xd60bbb,null))[_0xade3('0x2b')](function(_0x4b248f){if(_0x4b248f){return _0x4b248f['setTags'](_0x3a0cd2[_0xade3('0x7b')][_0xade3('0xc0')],_[_0xade3('0xbf')](_0x3a0cd2[_0xade3('0x7b')],['ids','id'])||{})[_0xade3('0xc9')](function(){return db['Tag'][_0xade3('0xc7')]({'attributes':['id',_0xade3('0x2f'),_0xade3('0x55')],'where':{'id':_0x3a0cd2['body'][_0xade3('0xc0')]}});})[_0xade3('0x2b')](function(_0x4cffff){socket[_0xade3('0xca')](_0xade3('0xcb'),{'id':Number(_0x3a0cd2[_0xade3('0xb7')]['id']),'tags':_0x4cffff||[]});return{'id':Number(_0x3a0cd2[_0xade3('0xb7')]['id']),'tags':_0x4cffff||[]};});}})[_0xade3('0x2b')](respondWithResult(_0xd60bbb,null))['catch'](handleError(_0xd60bbb,null));};exports['removeTags']=function(_0x58626f,_0x15ed20,_0x5921ee){return db[_0xade3('0x41')][_0xade3('0x6a')]({'where':{'id':_0x58626f[_0xade3('0xb7')]['id']}})[_0xade3('0x2b')](handleEntityNotFound(_0x15ed20,null))[_0xade3('0x2b')](function(_0x346884){if(_0x346884){return _0x346884[_0xade3('0xcc')](_0x58626f[_0xade3('0x46')][_0xade3('0xc0')]);}})['then'](respondWithStatusCode(_0x15ed20,null))[_0xade3('0x37')](handleError(_0x15ed20,null));};exports[_0xade3('0xcd')]=function(_0xff908d,_0x1cdcfa){var _0x191607=moment()['unix']()['toString']();var _0x4ce587=path[_0xade3('0xce')](config['root'],_0xade3('0xcf'),_0xade3('0xd0'),_0xade3('0xd1'));var _0x18913c=path['join'](config[_0xade3('0xd2')],_0xade3('0xcf'),_0xade3('0xd0'),_0xade3('0xd3'));var _0x4501a9=path['join'](_0x4ce587,_0x191607);var _0x4d9c85=util['format'](_0xade3('0xd4'),_0xff908d['params']['id'],_0x191607);var _0x4e96c7=path[_0xade3('0xce')](_0x4ce587,_0x4d9c85);var _0x3e6485=[];_0x3e6485['push']({'model':db[_0xade3('0x78')],'as':'User','attributes':['id',_0xade3('0x31')],'raw':!![]});_0x3e6485[_0xade3('0x36')]({'model':db['CmContact'],'as':_0xade3('0x6f'),'attributes':['id',_0xade3('0xd5'),_0xade3('0xd6')],'raw':!![]});if(_0xff908d[_0xade3('0x46')][_0xade3('0xd3')]){_0x3e6485['push']({'model':db[_0xade3('0xd7')],'as':_0xade3('0xd7'),'raw':!![]});}var _0x2d4993=[{'model':db[_0xade3('0xc3')],'as':'Messages','attributes':['id',_0xade3('0x7b'),'createdAt',_0xade3('0xd8'),_0xade3('0xd9'),_0xade3('0x85')],'include':_0x3e6485}];_0x2d4993[_0xade3('0x36')]({'model':db[_0xade3('0xda')],'as':_0xade3('0xdb'),'attributes':['id',_0xade3('0x2f')]});_0x2d4993[_0xade3('0x36')]({'model':db[_0xade3('0x78')],'as':'Owner','attributes':['id','fullname']});return db['WhatsappInteraction'][_0xade3('0x6a')]({'where':{'id':_0xff908d[_0xade3('0xb7')]['id']},'include':_0x2d4993})[_0xade3('0x2b')](handleEntityNotFound(_0x1cdcfa,null))[_0xade3('0x2b')](function(_0x10cd39){if(_0x10cd39){var _0x2c8989=_0x10cd39[_0xade3('0xdc')]({'plain':!![]});fs[_0xade3('0xdd')](_0x4501a9);var _0x3f40d8={'channel':_0xade3('0xde'),'account':_0x2c8989[_0xade3('0xdb')][_0xade3('0x2f')],'agent':_0x2c8989[_0xade3('0xdf')]?_0x2c8989[_0xade3('0xdf')][_0xade3('0x31')]:_0xade3('0xe0'),'createdAt':moment(_0x2c8989['createdAt'])[_0xade3('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x2c8989[_0xade3('0x3c')]?moment(_0x2c8989[_0xade3('0xe1')])[_0xade3('0xc5')](_0xade3('0xc6'))[_0xade3('0xa0')]():'','disposition':_0x2c8989[_0xade3('0xe2')],'messages':_(_0x2c8989[_0xade3('0xe3')])[_0xade3('0x8a')]({'secret':![]})['map'](function(_0x100745){if(_0x100745[_0xade3('0xd7')]){var _0x46a9e3=path[_0xade3('0xce')](_0x18913c,_0x100745[_0xade3('0xd7')]['basename']);if(fs[_0xade3('0xe4')](_0x46a9e3)){fs[_0xade3('0xe5')](_0x46a9e3)[_0xade3('0xe6')](fs[_0xade3('0xe7')](path['join'](_0x4501a9,_0x100745['Attachment']['basename'])));}}return{'date':moment(_0x100745[_0xade3('0x7e')])[_0xade3('0xc5')](_0xade3('0xc6'))[_0xade3('0xa0')](),'sender':_0x100745['direction']===_0xade3('0xe8')?_0x100745[_0xade3('0x78')]?_0x100745[_0xade3('0x78')][_0xade3('0x31')]:_0xade3('0xe9'):_0x100745['Contact'][_0xade3('0xd5')]+(_0x100745[_0xade3('0x6f')][_0xade3('0xd6')]?'\x20'+_0x100745['Contact'][_0xade3('0xd6')]:''),'body':_0x100745[_0xade3('0xd7')]?_0x100745[_0xade3('0xd7')][_0xade3('0xea')]:_0x100745[_0xade3('0x7b')],'direction':_0x100745['direction']===_0xade3('0xe8')?'A':'C','secret':_0x100745['secret'],'read':_0x100745[_0xade3('0x85')],'attachment':_0x100745[_0xade3('0xd7')]};})[_0xade3('0x6c')]()};return ejs[_0xade3('0xeb')](path[_0xade3('0xce')](config['root'],_0xade3('0xcf'),_0xade3('0xec'),'downloadInteraction.ejs'),{'interaction':_0x3f40d8})[_0xade3('0x2b')](function(_0x2cdd80){var _0x3d7953=path[_0xade3('0xce')](_0x4501a9,_0xade3('0xed')+_0x2c8989['id']+'-'+_0x191607+_0xade3('0xee'));var _0x496d23={'path':_0x3d7953,'channel':_0xade3('0xde'),'interactionId':_0x2c8989['id']};return pdf[_0xade3('0xef')](_0x2cdd80,_0x496d23);})[_0xade3('0x2b')](function(){return new BPromise(function(_0x34edc2,_0xd97c05){zipdir(_0x4501a9,{'saveTo':_0x4e96c7},function(_0x5aeb6e,_0x2802ae){if(_0x5aeb6e)return _0xd97c05(_0x5aeb6e);return _0x34edc2(_0x2802ae);});})[_0xade3('0x2b')](function(){return new BPromise(function(_0x5072c4,_0x18e21c){rimraf(_0x4501a9,function(_0x218ecf){if(_0x218ecf)_0x18e21c(_0x218ecf);return _0x5072c4();});});})['then'](function(){return _0x1cdcfa[_0xade3('0xcd')](_0x4e96c7,_0x4d9c85,function(_0x380191){if(_0x380191){console[_0xade3('0xf0')](_0xade3('0xf1'),_0x380191);}else{fs[_0xade3('0xf2')](_0x4e96c7);}});});});}else{return _0x1cdcfa[_0xade3('0x20')](0xc8);}})[_0xade3('0x37')](handleError(_0x1cdcfa,null));}; \ No newline at end of file +var _0x1d11=['rawAttributes','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','field','color','from','tools_tags','select','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','o.id\x20=\x20i.UserId','whatsapp_accounts','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','end','Tag','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','operator','$substring','body','keys','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','role','sequelize','toString','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.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','WhatsappInteractionId','all','rows','includeAll','include','merge','options','create','describe','addMessage','WhatsappMessage','params','omit','ids','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','whatsappInteractionTags:save','removeTags','unix','join','root','server','files','transcript-%d-%s.zip','User','fullname','CmContact','lastName','attachments','Attachment','Messages','createdAt','direction','secret','Account','Owner','get','mkdirSync','Whatsapp','N.A.','closedAt','disposition','basename','pipe','createWriteStream','out','firstName','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','sendStatus','error','stack','name','send','Users','TagIds','Tags','forEach','push','catch','answered','unmanaged','total','UserId','waiting','closed','talking','index','map','WhatsappInteraction'];(function(_0x2940b2,_0xae61bb){var _0x4f18fa=function(_0x3e183a){while(--_0x3e183a){_0x2940b2['push'](_0x2940b2['shift']());}};_0x4f18fa(++_0xae61bb);}(_0x1d11,0xb6));var _0x11d1=function(_0x22568b,_0x4c7b9e){_0x22568b=_0x22568b-0x0;var _0x1b7d71=_0x1d11[_0x22568b];return _0x1b7d71;};'use strict';var emlformat=require(_0x11d1('0x0'));var rimraf=require(_0x11d1('0x1'));var zipdir=require(_0x11d1('0x2'));var jsonpatch=require(_0x11d1('0x3'));var rp=require(_0x11d1('0x4'));var moment=require(_0x11d1('0x5'));var BPromise=require(_0x11d1('0x6'));var Mustache=require(_0x11d1('0x7'));var util=require(_0x11d1('0x8'));var path=require(_0x11d1('0x9'));var sox=require(_0x11d1('0xa'));var csv=require('to-csv');var ejs=require(_0x11d1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x11d1('0xc'));var squel=require(_0x11d1('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x11d1('0xe'));var toCsv=require(_0x11d1('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x11d1('0x10'));var authService=require(_0x11d1('0x11'));var qs=require(_0x11d1('0x12'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0x11d1('0x13'));var logger=require(_0x11d1('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x11d1('0x15'));var licenseUtil=require(_0x11d1('0x16'));var db=require(_0x11d1('0x17'))['db'];config[_0x11d1('0x18')]=_['defaults'](config[_0x11d1('0x18')],{'host':_0x11d1('0x19'),'port':0x18eb});var socket=require(_0x11d1('0x1a'))(new Redis(config['redis']));require(_0x11d1('0x1b'))[_0x11d1('0x1c')](socket);function respondWithStatusCode(_0x17fefe,_0x25c1e7){_0x25c1e7=_0x25c1e7||0xcc;return function(_0x1c13a9){if(_0x1c13a9){return _0x17fefe['sendStatus'](_0x25c1e7);}return _0x17fefe[_0x11d1('0x1d')](_0x25c1e7)['end']();};}function respondWithResult(_0x2dcd26,_0x15a338){_0x15a338=_0x15a338||0xc8;return function(_0x2ce6b6){if(_0x2ce6b6){return _0x2dcd26[_0x11d1('0x1d')](_0x15a338)[_0x11d1('0x1e')](_0x2ce6b6);}};}function respondWithFilteredResult(_0xe8a9e5,_0x59442c){return function(_0x3a93ec){if(_0x3a93ec){var _0x1cb958=typeof _0x59442c[_0x11d1('0x1f')]===_0x11d1('0x20')&&typeof _0x59442c[_0x11d1('0x21')]===_0x11d1('0x20');var _0x16bb0b=_0x3a93ec[_0x11d1('0x22')];var _0xa90a49=_0x1cb958?0x0:_0x59442c['offset'];var _0x5bd882=_0x1cb958?_0x3a93ec[_0x11d1('0x22')]:_0x59442c[_0x11d1('0x1f')]+_0x59442c['limit'];var _0x2ec18a;if(_0x5bd882>=_0x16bb0b){_0x5bd882=_0x16bb0b;_0x2ec18a=0xc8;}else{_0x2ec18a=0xce;}_0xe8a9e5[_0x11d1('0x1d')](_0x2ec18a);return _0xe8a9e5[_0x11d1('0x23')]('Content-Range',_0xa90a49+'-'+_0x5bd882+'/'+_0x16bb0b)['json'](_0x3a93ec);}return null;};}function patchUpdates(_0x627118){return function(_0x28e5b8){try{jsonpatch['apply'](_0x28e5b8,_0x627118,!![]);}catch(_0xf220a6){return BPromise[_0x11d1('0x24')](_0xf220a6);}return _0x28e5b8[_0x11d1('0x25')]();};}function saveUpdates(_0x37798e,_0x14070d){return function(_0x3c5444){if(_0x3c5444){return _0x3c5444[_0x11d1('0x26')](_0x37798e)[_0x11d1('0x27')](function(_0x442400){return _0x442400;});}return null;};}function removeEntity(_0x5909aa,_0xc7130){return function(_0x1f44ba){if(_0x1f44ba){return _0x1f44ba[_0x11d1('0x28')]()[_0x11d1('0x27')](function(){_0x5909aa[_0x11d1('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe21205,_0x3d32c4){return function(_0x546b69){if(!_0x546b69){_0xe21205[_0x11d1('0x29')](0x194);}return _0x546b69;};}function handleError(_0x179000,_0x43254e){_0x43254e=_0x43254e||0x1f4;return function(_0x37a95e){logger[_0x11d1('0x2a')](_0x37a95e[_0x11d1('0x2b')]);if(_0x37a95e[_0x11d1('0x2c')]){delete _0x37a95e[_0x11d1('0x2c')];}_0x179000[_0x11d1('0x1d')](_0x43254e)[_0x11d1('0x2d')](_0x37a95e);};}function getInteractionUsers(_0x485190,_0x439553){return new BPromise(function(_0x38bb84,_0x41a671){try{if(_0x439553[_0x485190['id']]){_0x485190[_0x11d1('0x2e')]=_['map'](_0x439553[_0x485190['id']],function(_0x9588b6){return{'id':_0x9588b6['id'],'fullname':_0x9588b6['fullname']};});}}catch(_0x1d20ae){_0x41a671(_0x1d20ae);}_0x38bb84(_0x485190);});}function getInteractionTags(_0x566b1d,_0x507e8f){return new BPromise(function(_0x4f55ba,_0x47ba3e){try{if(_0x566b1d[_0x11d1('0x2f')]){_0x566b1d[_0x11d1('0x30')]=[];_0x566b1d[_0x11d1('0x2f')]['split'](',')[_0x11d1('0x31')](function(_0x4f929d){_0x566b1d[_0x11d1('0x30')][_0x11d1('0x32')](_0x507e8f[_0x4f929d]);});}delete _0x566b1d[_0x11d1('0x2f')];}catch(_0x31b834){_0x47ba3e(_0x31b834);}_0x4f55ba(_0x566b1d);});}function updateWhatsappInteraction(_0x28c87f,_0x6818ea,_0x511e1d){return new BPromise(function(_0x11b3b0,_0x3929ab){return getInteractionUsers(_0x28c87f,_0x511e1d)[_0x11d1('0x27')](function(_0x1152df){return getInteractionTags(_0x1152df,_0x6818ea);})[_0x11d1('0x27')](function(_0x2959ff){return getStateInteraction(_0x2959ff);})[_0x11d1('0x27')](function(_0x4fa55c){_0x11b3b0(_0x4fa55c);})[_0x11d1('0x33')](function(_0x555f09){_0x3929ab(_0x555f09);});});}function getStateInteraction(_0x53d341){return new BPromise(function(_0x2c597b){_0x53d341['waiting']=0x0;_0x53d341['talking']=0x0;_0x53d341[_0x11d1('0x34')]=0x0;_0x53d341[_0x11d1('0x35')]=0x0;_0x53d341[_0x11d1('0x36')]=0x0;if(!_0x53d341['closed']&&!_0x53d341[_0x11d1('0x37')]){_0x53d341[_0x11d1('0x38')]+=0x1;}if(!_0x53d341[_0x11d1('0x39')]&&_0x53d341[_0x11d1('0x37')]){_0x53d341[_0x11d1('0x3a')]+=0x1;if(_0x53d341[_0x11d1('0x38')]){_0x53d341[_0x11d1('0x38')]-=0x1;}}if(_0x53d341[_0x11d1('0x39')]&&_0x53d341[_0x11d1('0x37')]){_0x53d341[_0x11d1('0x34')]+=0x1;if(_0x53d341[_0x11d1('0x3a')]){_0x53d341['talking']-=0x1;}}if(_0x53d341[_0x11d1('0x39')]&&!_0x53d341['UserId']){_0x53d341[_0x11d1('0x35')]+=0x1;if(_0x53d341[_0x11d1('0x38')]){_0x53d341['waiting']-=0x1;}}_0x53d341[_0x11d1('0x36')]+=0x1;_0x2c597b(_0x53d341);});}exports[_0x11d1('0x3b')]=function(_0x50bc76,_0x1370e1){var _0x77a93d={},_0x485368={},_0x31c8f1={'count':0x0,'rows':[]};var _0x37b3c8=_[_0x11d1('0x3c')](db[_0x11d1('0x3d')][_0x11d1('0x3e')],function(_0x3c18a6){return{'name':_0x3c18a6['fieldName'],'type':_0x3c18a6[_0x11d1('0x3f')][_0x11d1('0x40')]};});_0x485368['model']=_[_0x11d1('0x3c')](_0x37b3c8,'name');_0x485368[_0x11d1('0x41')]=_['keys'](_0x50bc76[_0x11d1('0x41')]);_0x485368['filters']=_[_0x11d1('0x42')](_0x485368[_0x11d1('0x43')],_0x485368[_0x11d1('0x41')]);_0x77a93d[_0x11d1('0x44')]=_['intersection'](_0x485368[_0x11d1('0x43')],qs[_0x11d1('0x45')](_0x50bc76[_0x11d1('0x41')][_0x11d1('0x45')]));_0x77a93d[_0x11d1('0x44')]=_0x77a93d[_0x11d1('0x44')][_0x11d1('0x46')]?_0x77a93d[_0x11d1('0x44')]:_0x485368[_0x11d1('0x43')];if(!_0x50bc76['query'][_0x11d1('0x47')](_0x11d1('0x48'))){_0x77a93d[_0x11d1('0x21')]=qs['limit'](_0x50bc76[_0x11d1('0x41')][_0x11d1('0x21')]);_0x77a93d[_0x11d1('0x1f')]=qs['offset'](_0x50bc76[_0x11d1('0x41')][_0x11d1('0x1f')]);}_0x77a93d[_0x11d1('0x49')]=qs[_0x11d1('0x4a')](_0x50bc76[_0x11d1('0x41')][_0x11d1('0x4a')]);_0x77a93d[_0x11d1('0x4b')]=qs[_0x11d1('0x4c')](_[_0x11d1('0x4d')](_0x50bc76[_0x11d1('0x41')],_0x485368[_0x11d1('0x4c')]),_0x37b3c8);var _0x5910ec=[];var _0x7d0a5f=squel['select']()[_0x11d1('0x4e')]('id')[_0x11d1('0x4e')]('name')[_0x11d1('0x4e')](_0x11d1('0x4f'))[_0x11d1('0x50')](_0x11d1('0x51'));var _0x3d0c0b=squel[_0x11d1('0x52')]()[_0x11d1('0x4e')](_0x11d1('0x53'))[_0x11d1('0x4e')](_0x11d1('0x54'))[_0x11d1('0x4e')](_0x11d1('0x55'))['from'](_0x11d1('0x56'),'ui')[_0x11d1('0x57')](_0x11d1('0x58'),'u',_0x11d1('0x59'));var _0x347415=squel[_0x11d1('0x52')]()[_0x11d1('0x50')](_0x11d1('0x5a'),'i')[_0x11d1('0x57')](_0x11d1('0x5b'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x11d1('0x57')](_0x11d1('0x58'),'o',_0x11d1('0x5c'))['left_join'](_0x11d1('0x5d'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0x11d1('0x57')]('whatsapp_messages','me',_0x11d1('0x5e'))[_0x11d1('0x57')](_0x11d1('0x5f'),'it',_0x11d1('0x60'))[_0x11d1('0x57')](_0x11d1('0x51'),'t',_0x11d1('0x61'));var _0x216789=squel['expr']();var _0x42d83e=[];var _0x16f646=squel[_0x11d1('0x62')]();var _0x2c30d6;if(_0x50bc76['query'][_0x11d1('0x63')]){_0x2c30d6=as[_0x11d1('0x64')](_0x50bc76[_0x11d1('0x41')]['search']);var _0x1eef77=_0x2c30d6[_0x11d1('0x65')];for(var _0x219351=0x0;_0x219351<_0x2c30d6[_0x11d1('0x66')][_0x11d1('0x46')];_0x219351++){var _0x22caec=_0x2c30d6['conditions'][_0x219351];var _0x2ca37a='i';var _0x178d53=_['find'](_0x37b3c8,[_0x11d1('0x2c'),_0x22caec[_0x11d1('0x4e')]]);if(!_0x178d53){switch(_0x22caec[_0x11d1('0x4e')]){case _0x11d1('0x67'):if(_0x22caec[_0x11d1('0x68')]==0x1){_0x347415[_0x11d1('0x69')]('`'+_0x22caec[_0x11d1('0x4e')]+_0x11d1('0x6a'));}else{_0x347415[_0x11d1('0x69')]('`'+_0x22caec[_0x11d1('0x4e')]+_0x11d1('0x6b'));}break;case _0x11d1('0x6c'):if(_0x22caec['operator']==='$substring'){if(_0x22caec[_0x11d1('0x68')]['split']('\x20')[_0x11d1('0x46')]>0x1){_0x216789[_0x1eef77](_0x11d1('0x6d'),qs[_0x11d1('0x6e')](_0x22caec['value']),null);}else{var _0x2ea0f8='%'+_0x22caec[_0x11d1('0x68')]+'%';_0x216789[_0x1eef77](_0x11d1('0x6f'),_0x2ea0f8,_0x2ea0f8,_0x2ea0f8);}}else{_0x178d53=_[_0x11d1('0x70')](_0x37b3c8,[_0x11d1('0x2c'),_0x11d1('0x71')]);_0x22caec[_0x11d1('0x4e')]=_0x11d1('0x71');_0x47d2d6=as[_0x11d1('0x72')](_0x2ca37a,_0x178d53[_0x11d1('0x3f')],_0x22caec);_0x216789[_0x1eef77](_0x47d2d6[_0x11d1('0x73')],_0x47d2d6[_0x11d1('0x68')][_0x11d1('0x74')],_0x47d2d6[_0x11d1('0x68')][_0x11d1('0x75')]);}break;case _0x11d1('0x76'):var _0x5511c7=_0x22caec['value'][_0x11d1('0x77')](',')[_0x11d1('0x3c')](function(_0x39e642){return Number(_0x39e642);});_0x5511c7['forEach'](function(_0x10d933){_0x16f646['or'](_0x11d1('0x78'),'%,'+_0x10d933+',%');});_0x42d83e=_[_0x11d1('0x79')](_0x42d83e,_0x5511c7);break;case'User':if(_0x22caec[_0x11d1('0x7a')]===_0x11d1('0x7b')){_0x216789[_0x1eef77]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x22caec[_0x11d1('0x68')]+'%',null);}else{_0x178d53=_[_0x11d1('0x70')](_0x37b3c8,[_0x11d1('0x2c'),_0x11d1('0x37')]);_0x22caec[_0x11d1('0x4e')]='UserId';_0x47d2d6=as[_0x11d1('0x72')](_0x2ca37a,_0x178d53['type'],_0x22caec);_0x216789[_0x1eef77](_0x47d2d6['text'],_0x47d2d6[_0x11d1('0x68')][_0x11d1('0x74')],_0x47d2d6[_0x11d1('0x68')]['end']);}break;case _0x11d1('0x7c'):_0x47d2d6=as[_0x11d1('0x72')]('me',null,_0x22caec);_0x216789[_0x1eef77](_0x47d2d6[_0x11d1('0x73')],_0x47d2d6[_0x11d1('0x68')][_0x11d1('0x74')],_0x47d2d6[_0x11d1('0x68')][_0x11d1('0x75')]);break;}}else{var _0x47d2d6=as[_0x11d1('0x72')](_0x2ca37a,_0x178d53['type'],_0x22caec);_0x216789[_0x1eef77](_0x47d2d6[_0x11d1('0x73')],_0x47d2d6[_0x11d1('0x68')][_0x11d1('0x74')],_0x47d2d6[_0x11d1('0x68')]['end']);}}}else{var _0x13f792=_(_0x50bc76[_0x11d1('0x41')])[_0x11d1('0x7d')]()[_0x11d1('0x3c')](function(_0x1c8c3f){return _[_0x11d1('0x7e')](_0x37b3c8,['name',_0x1c8c3f])?_0x1c8c3f:undefined;})[_0x11d1('0x7f')]()[_0x11d1('0x68')]();if(!_[_0x11d1('0x80')](_0x13f792)){_0x13f792['forEach'](function(_0x1da4c4){if(_0x1da4c4===_0x11d1('0x81')){_0x347415[_0x11d1('0x4b')](_0x11d1('0x82'),[]['concat'](_0x50bc76[_0x11d1('0x41')][_0x1da4c4]));}else if(_0x1da4c4==='createdAt'){var _0x30c9ac=JSON[_0x11d1('0x83')](_0x50bc76[_0x11d1('0x41')][_0x1da4c4])[_0x11d1('0x84')];var _0x5d58b8=JSON[_0x11d1('0x83')](_0x50bc76[_0x11d1('0x41')][_0x1da4c4])[_0x11d1('0x85')];_0x347415[_0x11d1('0x4b')](_0x11d1('0x86'),_0x30c9ac,_0x5d58b8);}else{if(_0x50bc76[_0x11d1('0x41')][_0x1da4c4]==='null'){_0x347415['where']('i.'+_0x1da4c4+_0x11d1('0x87'));}else{_0x347415['where']('i.'+_0x1da4c4+_0x11d1('0x88'),_0x50bc76[_0x11d1('0x41')][_0x1da4c4]);}}});}if(_0x50bc76[_0x11d1('0x41')][_0x11d1('0x89')]){if(_0x50bc76[_0x11d1('0x41')]['read']==0x1){_0x347415['having'](_0x11d1('0x8a'));}else{_0x347415[_0x11d1('0x69')](_0x11d1('0x8b'));}}if(_0x50bc76[_0x11d1('0x41')]['tag']){_0x42d83e=_[_0x11d1('0x8c')](_0x50bc76[_0x11d1('0x41')][_0x11d1('0x8d')])?_0x50bc76[_0x11d1('0x41')][_0x11d1('0x8d')]:new Array(_0x50bc76[_0x11d1('0x41')][_0x11d1('0x8d')]);_0x42d83e['forEach'](function(_0x3ec886){_0x16f646['or'](_0x11d1('0x78'),'%,'+_0x3ec886+',%');});}if(_0x50bc76[_0x11d1('0x41')]['filter']){var _0x30027f=_0x50bc76[_0x11d1('0x41')][_0x11d1('0x8e')][_0x11d1('0x8f')]('\x5c','\x5c\x5c')[_0x11d1('0x8f')](/'/g,'\x27\x27');if(qs[_0x11d1('0x90')](_0x30027f)){_0x216789['or'](_0x11d1('0x91'),_0x30027f+'%')['or'](_0x11d1('0x92'),_0x30027f+'%');}else{_0x216789['or'](_0x11d1('0x93'),qs['getFullTextValue'](_0x30027f))['or'](_0x11d1('0x94'),_0x30027f+'%');}}}_0x347415[_0x11d1('0x4b')](_0x216789);_0x347415[_0x11d1('0x95')](_0x11d1('0x96'));var _0x569fc0={'type':db[_0x11d1('0x97')]['QueryTypes']['SELECT'],'raw':!![]};var _0x45ab6b=_0x347415['clone']();_0x45ab6b[_0x11d1('0x4e')](_0x11d1('0x96'));_0x45ab6b['field'](_0x11d1('0x98'),'unreadMessages');if(_0x77a93d[_0x11d1('0x49')]){_0x77a93d['order']['forEach'](function(_0x45a562){var _0x12afb5=_0x45a562[0x0]===_0x11d1('0x99')?_0x45a562[0x0]:'i.'+_0x45a562[0x0];_0x347415[_0x11d1('0x49')](_0x12afb5,_0x45a562[0x1]===_0x11d1('0x9a')?![]:!![]);});}if(!_[_0x11d1('0x80')](_0x42d83e)){_0x347415[_0x11d1('0x69')](_0x16f646);_0x45ab6b[_0x11d1('0x4b')](_0x11d1('0x9b'),_0x42d83e);}BPromise[_0x11d1('0x9c')]()[_0x11d1('0x27')](function(){if(!_0x2c30d6){if(_0x50bc76[_0x11d1('0x41')][_0x11d1('0x81')])return;_0x45ab6b[_0x11d1('0x4b')](_0x11d1('0x9d'));_0x347415[_0x11d1('0x4b')](_0x11d1('0x9d'));return;}if(_0x50bc76[_0x11d1('0x9e')]['role']!==_0x11d1('0x9f'))return;return _0x50bc76['user'][_0x11d1('0xa0')]({'attributes':['id'],'raw':!![]})[_0x11d1('0x27')](function(_0x3fa1b5){if(_[_0x11d1('0x80')](_0x3fa1b5)){_0x45ab6b[_0x11d1('0x4b')](_0x11d1('0xa1'));_0x347415['where'](_0x11d1('0xa1'));}else{_0x45ab6b[_0x11d1('0x4b')]('i.WhatsappAccountId\x20IN\x20?',_['map'](_0x3fa1b5,'id'));_0x347415['where'](_0x11d1('0x82'),_[_0x11d1('0x3c')](_0x3fa1b5,'id'));}});})[_0x11d1('0x27')](function(){if(_0x50bc76[_0x11d1('0x9e')][_0x11d1('0xa2')]==='agent'&&!_0x2c30d6&&!_0x50bc76[_0x11d1('0x41')]['WhatsappAccountId'])return[];return db[_0x11d1('0xa3')][_0x11d1('0x41')](_0x45ab6b[_0x11d1('0xa4')](),_0x569fc0);})[_0x11d1('0x27')](function(_0x2ff72b){_0x31c8f1['count']=_0x2ff72b[_0x11d1('0x46')];if(_0x31c8f1[_0x11d1('0x22')]===0x0)return[];return db[_0x11d1('0xa3')][_0x11d1('0x41')](_0x7d0a5f[_0x11d1('0xa4')](),_0x569fc0)['then'](function(_0x52e05c){_0x5910ec=_['keyBy'](_0x52e05c,'id');_0x569fc0=_['merge'](_0x569fc0,{'model':db[_0x11d1('0x3d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x50bc76[_0x11d1('0x41')]['fields']){_0x77a93d[_0x11d1('0x44')]['forEach'](function(_0x94a430){_0x347415['field']('i.'+_0x94a430);});}else{_0x347415[_0x11d1('0x4e')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x11d1('0x67'));_0x347415[_0x11d1('0x4e')](_0x11d1('0xa5'),_0x11d1('0xa6'));_0x347415['field']('a.mandatoryDisposition',_0x11d1('0xa7'));_0x347415['field'](_0x11d1('0xa8'),_0x11d1('0x99'));_0x347415['field'](_0x11d1('0xa9'));_0x347415[_0x11d1('0x4e')]('c.firstName',_0x11d1('0xaa'));_0x347415[_0x11d1('0x4e')](_0x11d1('0xab'),_0x11d1('0xac'));_0x347415['field'](_0x11d1('0xad'),_0x11d1('0xae'));_0x347415[_0x11d1('0x4e')](_0x11d1('0xaf'),_0x11d1('0xb0'));_0x347415[_0x11d1('0x4e')](_0x11d1('0xb1'),_0x11d1('0xb2'));_0x347415['field'](_0x11d1('0xb3'),_0x11d1('0xb4'));_0x347415[_0x11d1('0x4e')](_0x11d1('0xb5'),_0x11d1('0xb6'));_0x347415[_0x11d1('0x4e')](_0x11d1('0xb7'),_0x11d1('0xb8'));_0x347415[_0x11d1('0x4e')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x11d1('0x2f'));}if(_0x77a93d[_0x11d1('0x21')])_0x347415[_0x11d1('0x21')](_0x77a93d[_0x11d1('0x21')]);if(_0x77a93d[_0x11d1('0x1f')])_0x347415[_0x11d1('0x1f')](_0x77a93d[_0x11d1('0x1f')]);return db['sequelize'][_0x11d1('0x41')](_0x347415[_0x11d1('0xa4')](),_0x569fc0);})[_0x11d1('0x27')](function(_0x51b685){if(_0x51b685[_0x11d1('0x46')]>0x0)_0x3d0c0b[_0x11d1('0x4b')]('ui.WhatsappInteractionId\x20IN\x20?',_[_0x11d1('0x3c')](_0x51b685,'id'));return db[_0x11d1('0xa3')]['query'](_0x3d0c0b[_0x11d1('0xa4')](),_0x569fc0)[_0x11d1('0x27')](function(_0x3a8b8b){var _0x2879b4=_['groupBy'](_0x3a8b8b,_0x11d1('0xb9'));var _0x338874=[];_0x51b685[_0x11d1('0x31')](function(_0xfea567){_0x338874[_0x11d1('0x32')](updateWhatsappInteraction(_0xfea567,_0x5910ec,_0x2879b4));});return BPromise[_0x11d1('0xba')](_0x338874);});});})[_0x11d1('0x27')](function(_0x55ed1d){_0x31c8f1[_0x11d1('0xbb')]=_0x55ed1d;return _0x31c8f1;})[_0x11d1('0x27')](respondWithFilteredResult(_0x1370e1,_0x77a93d))[_0x11d1('0x33')](handleError(_0x1370e1,null));};exports['show']=function(_0x32f708,_0x4c0593){var _0x284929={'raw':![],'where':{'id':_0x32f708['params']['id']}},_0x35c445={};_0x35c445[_0x11d1('0x43')]=_['keys'](db[_0x11d1('0x3d')][_0x11d1('0x3e')]);_0x35c445['query']=_[_0x11d1('0x7d')](_0x32f708[_0x11d1('0x41')]);_0x35c445[_0x11d1('0x4c')]=_[_0x11d1('0x42')](_0x35c445['model'],_0x35c445[_0x11d1('0x41')]);_0x284929[_0x11d1('0x44')]=_['intersection'](_0x35c445[_0x11d1('0x43')],qs[_0x11d1('0x45')](_0x32f708[_0x11d1('0x41')][_0x11d1('0x45')]));_0x284929['attributes']=_0x284929[_0x11d1('0x44')][_0x11d1('0x46')]?_0x284929['attributes']:_0x35c445[_0x11d1('0x43')];if(_0x32f708[_0x11d1('0x41')][_0x11d1('0xbc')]){_0x284929[_0x11d1('0xbd')]=[{'all':!![]}];}_0x284929=_[_0x11d1('0xbe')]({},_0x284929,_0x32f708[_0x11d1('0xbf')]);return db[_0x11d1('0x3d')][_0x11d1('0x70')](_0x284929)[_0x11d1('0x27')](handleEntityNotFound(_0x4c0593,null))[_0x11d1('0x27')](respondWithResult(_0x4c0593,null))[_0x11d1('0x33')](handleError(_0x4c0593,null));};exports['create']=function(_0x222fd7,_0x4a7412){return db[_0x11d1('0x3d')][_0x11d1('0xc0')](_0x222fd7[_0x11d1('0x7c')],{})[_0x11d1('0x27')](respondWithResult(_0x4a7412,0xc9))['catch'](handleError(_0x4a7412,null));};exports[_0x11d1('0x26')]=function(_0x2b0167,_0x134a4f){if(_0x2b0167[_0x11d1('0x7c')]['id']){delete _0x2b0167['body']['id'];}return db[_0x11d1('0x3d')][_0x11d1('0x70')]({'where':{'id':_0x2b0167['params']['id']}})[_0x11d1('0x27')](handleEntityNotFound(_0x134a4f,null))[_0x11d1('0x27')](saveUpdates(_0x2b0167[_0x11d1('0x7c')],null))['then'](respondWithResult(_0x134a4f,null))[_0x11d1('0x33')](handleError(_0x134a4f,null));};exports['destroy']=function(_0x2c7e34,_0x300ce0){return db[_0x11d1('0x3d')][_0x11d1('0x70')]({'where':{'id':_0x2c7e34['params']['id']}})[_0x11d1('0x27')](handleEntityNotFound(_0x300ce0,null))[_0x11d1('0x27')](removeEntity(_0x300ce0,null))['catch'](handleError(_0x300ce0,null));};exports[_0x11d1('0xc1')]=function(_0x24f4a5,_0x3bd5b1){return db[_0x11d1('0x3d')][_0x11d1('0xc1')]()[_0x11d1('0x27')](respondWithResult(_0x3bd5b1,null))[_0x11d1('0x33')](handleError(_0x3bd5b1,null));};exports[_0x11d1('0xc2')]=function(_0x2378ee,_0x3cf930,_0x3646d2){return db[_0x11d1('0xc3')][_0x11d1('0x70')]({'where':{'id':_0x2378ee[_0x11d1('0xc4')]['id']}})[_0x11d1('0x27')](handleEntityNotFound(_0x3cf930,null))[_0x11d1('0x27')](function(_0x5250ec){if(_0x5250ec){return _0x5250ec['addMessage'](_0x2378ee['body']['ids'],_[_0x11d1('0xc5')](_0x2378ee[_0x11d1('0x7c')],[_0x11d1('0xc6'),'id'])||{});}})[_0x11d1('0x27')](respondWithResult(_0x3cf930,null))[_0x11d1('0x33')](handleError(_0x3cf930,null));};exports['getMessages']=function(_0x41a923,_0x568d2b,_0x2c6302){var _0x6b46e={'raw':![],'where':{}};var _0x224492={};var _0x1d1b62={'count':0x0,'rows':[]};return db[_0x11d1('0x3d')][_0x11d1('0xc7')]({'where':{'id':_0x41a923[_0x11d1('0xc4')]['id']}})[_0x11d1('0x27')](handleEntityNotFound(_0x568d2b,null))[_0x11d1('0x27')](function(_0xc144c6){if(_0xc144c6){_0x224492['model']=_['keys'](db[_0x11d1('0xc3')][_0x11d1('0x3e')]);_0x224492[_0x11d1('0x41')]=_[_0x11d1('0x7d')](_0x41a923[_0x11d1('0x41')]);_0x224492[_0x11d1('0x4c')]=_[_0x11d1('0x42')](_0x224492[_0x11d1('0x43')],_0x224492[_0x11d1('0x41')]);_0x6b46e[_0x11d1('0x44')]=_[_0x11d1('0x42')](_0x224492[_0x11d1('0x43')],qs['fields'](_0x41a923[_0x11d1('0x41')][_0x11d1('0x45')]));_0x6b46e[_0x11d1('0x44')]=_0x6b46e[_0x11d1('0x44')]['length']?_0x6b46e[_0x11d1('0x44')]:_0x224492[_0x11d1('0x43')];if(!_0x41a923[_0x11d1('0x41')]['hasOwnProperty'](_0x11d1('0x48'))){_0x6b46e[_0x11d1('0x21')]=qs[_0x11d1('0x21')](_0x41a923[_0x11d1('0x41')][_0x11d1('0x21')]);_0x6b46e['offset']=qs['offset'](_0x41a923['query'][_0x11d1('0x1f')]);}_0x6b46e[_0x11d1('0x49')]=qs[_0x11d1('0x4a')](_0x41a923['query']['sort']);_0x6b46e['where']=qs[_0x11d1('0x4c')](_[_0x11d1('0x4d')](_0x41a923['query'],_0x224492[_0x11d1('0x4c')]));_0x6b46e['where'][_0x11d1('0xb9')]=_0xc144c6['id'];if(_0x41a923[_0x11d1('0x41')]['filter']){_0x6b46e[_0x11d1('0x4b')]=_[_0x11d1('0xbe')](_0x6b46e['where'],{'$or':_[_0x11d1('0x3c')](_0x6b46e[_0x11d1('0x44')],function(_0xa2035e){var _0x424650={};_0x424650[_0xa2035e]={'$like':'%'+_0x41a923[_0x11d1('0x41')][_0x11d1('0x8e')]+'%'};return _0x424650;})});}if(_0x41a923['query'][_0x11d1('0x84')]){var _0x3db289=_0x41a923[_0x11d1('0x41')][_0x11d1('0x84')]['split'](',');var _0x472984={};_0x472984[_0x3db289[0x0]]={'$gte':moment(_0x3db289[0x1])[_0x11d1('0xc8')](_0x11d1('0xc9'))};_0x6b46e[_0x11d1('0x4b')]=_[_0x11d1('0xbe')](_0x6b46e[_0x11d1('0x4b')],_0x472984);}_0x6b46e=_['merge']({},_0x6b46e,_0x41a923[_0x11d1('0xbf')]);return db[_0x11d1('0xc3')]['count']({'where':_0x6b46e[_0x11d1('0x4b')]})[_0x11d1('0x27')](function(_0x27d274){_0x1d1b62[_0x11d1('0x22')]=_0x27d274;if(_0x41a923[_0x11d1('0x41')]['includeAll']){_0x6b46e[_0x11d1('0xbd')]=[{'all':!![]}];}return db[_0x11d1('0xc3')][_0x11d1('0xca')](_0x6b46e);})[_0x11d1('0x27')](function(_0x20f2d9){_0x1d1b62[_0x11d1('0xbb')]=_0x20f2d9;return _0x1d1b62;});}})[_0x11d1('0x27')](respondWithFilteredResult(_0x568d2b,_0x6b46e))[_0x11d1('0x33')](handleError(_0x568d2b,null));};exports[_0x11d1('0xcb')]=function(_0x58bb6e,_0x5aaf85,_0x415535){return db[_0x11d1('0x3d')][_0x11d1('0x70')]({'where':{'id':_0x58bb6e[_0x11d1('0xc4')]['id']}})[_0x11d1('0x27')](handleEntityNotFound(_0x5aaf85,null))[_0x11d1('0x27')](function(_0x3a4a5c){if(_0x3a4a5c){return _0x3a4a5c['setTags'](_0x58bb6e['body'][_0x11d1('0xc6')],_['omit'](_0x58bb6e[_0x11d1('0x7c')],[_0x11d1('0xc6'),'id'])||{})[_0x11d1('0xcc')](function(){return db[_0x11d1('0x76')][_0x11d1('0xca')]({'attributes':['id','name','color'],'where':{'id':_0x58bb6e[_0x11d1('0x7c')][_0x11d1('0xc6')]}});})[_0x11d1('0x27')](function(_0x36409b){socket['emit'](_0x11d1('0xcd'),{'id':Number(_0x58bb6e[_0x11d1('0xc4')]['id']),'tags':_0x36409b||[]});return{'id':Number(_0x58bb6e[_0x11d1('0xc4')]['id']),'tags':_0x36409b||[]};});}})[_0x11d1('0x27')](respondWithResult(_0x5aaf85,null))[_0x11d1('0x33')](handleError(_0x5aaf85,null));};exports[_0x11d1('0xce')]=function(_0x36af9c,_0x1d499d,_0x23316e){return db[_0x11d1('0x3d')][_0x11d1('0x70')]({'where':{'id':_0x36af9c[_0x11d1('0xc4')]['id']}})[_0x11d1('0x27')](handleEntityNotFound(_0x1d499d,null))[_0x11d1('0x27')](function(_0x3c310f){if(_0x3c310f){return _0x3c310f[_0x11d1('0xce')](_0x36af9c[_0x11d1('0x41')][_0x11d1('0xc6')]);}})[_0x11d1('0x27')](respondWithStatusCode(_0x1d499d,null))[_0x11d1('0x33')](handleError(_0x1d499d,null));};exports['download']=function(_0x372fdb,_0x338449){var _0x4d62ac=moment()[_0x11d1('0xcf')]()[_0x11d1('0xa4')]();var _0x3fb7a1=path[_0x11d1('0xd0')](config[_0x11d1('0xd1')],_0x11d1('0xd2'),_0x11d1('0xd3'),'tmp');var _0x1c1027=path['join'](config['root'],_0x11d1('0xd2'),_0x11d1('0xd3'),'attachments');var _0x1541c4=path[_0x11d1('0xd0')](_0x3fb7a1,_0x4d62ac);var _0x40a8a8=util[_0x11d1('0xc8')](_0x11d1('0xd4'),_0x372fdb[_0x11d1('0xc4')]['id'],_0x4d62ac);var _0x111fa5=path[_0x11d1('0xd0')](_0x3fb7a1,_0x40a8a8);var _0x1c83ee=[];_0x1c83ee[_0x11d1('0x32')]({'model':db[_0x11d1('0xd5')],'as':_0x11d1('0xd5'),'attributes':['id',_0x11d1('0xd6')],'raw':!![]});_0x1c83ee[_0x11d1('0x32')]({'model':db[_0x11d1('0xd7')],'as':_0x11d1('0x6c'),'attributes':['id','firstName',_0x11d1('0xd8')],'raw':!![]});if(_0x372fdb['query'][_0x11d1('0xd9')]){_0x1c83ee[_0x11d1('0x32')]({'model':db[_0x11d1('0xda')],'as':'Attachment','raw':!![]});}var _0x4b0d75=[{'model':db[_0x11d1('0xc3')],'as':_0x11d1('0xdb'),'attributes':['id',_0x11d1('0x7c'),_0x11d1('0xdc'),_0x11d1('0xdd'),_0x11d1('0xde'),_0x11d1('0x89')],'include':_0x1c83ee}];_0x4b0d75[_0x11d1('0x32')]({'model':db['WhatsappAccount'],'as':_0x11d1('0xdf'),'attributes':['id',_0x11d1('0x2c')]});_0x4b0d75[_0x11d1('0x32')]({'model':db['User'],'as':_0x11d1('0xe0'),'attributes':['id','fullname']});return db[_0x11d1('0x3d')]['find']({'where':{'id':_0x372fdb[_0x11d1('0xc4')]['id']},'include':_0x4b0d75})[_0x11d1('0x27')](handleEntityNotFound(_0x338449,null))[_0x11d1('0x27')](function(_0xf8f3f3){if(_0xf8f3f3){var _0x2ccafb=_0xf8f3f3[_0x11d1('0xe1')]({'plain':!![]});fs[_0x11d1('0xe2')](_0x1541c4);var _0x363ec0={'channel':_0x11d1('0xe3'),'account':_0x2ccafb[_0x11d1('0xdf')][_0x11d1('0x2c')],'agent':_0x2ccafb[_0x11d1('0xe0')]?_0x2ccafb[_0x11d1('0xe0')][_0x11d1('0xd6')]:_0x11d1('0xe4'),'createdAt':moment(_0x2ccafb[_0x11d1('0xdc')])[_0x11d1('0xc8')](_0x11d1('0xc9'))[_0x11d1('0xa4')](),'closedAt':_0x2ccafb[_0x11d1('0x39')]?moment(_0x2ccafb[_0x11d1('0xe5')])[_0x11d1('0xc8')](_0x11d1('0xc9'))[_0x11d1('0xa4')]():'','disposition':_0x2ccafb[_0x11d1('0xe6')],'messages':_(_0x2ccafb[_0x11d1('0xdb')])[_0x11d1('0x8e')]({'secret':![]})[_0x11d1('0x3c')](function(_0x2313aa){if(_0x2313aa[_0x11d1('0xda')]){var _0x1ba1d8=path[_0x11d1('0xd0')](_0x1c1027,_0x2313aa[_0x11d1('0xda')][_0x11d1('0xe7')]);if(fs['existsSync'](_0x1ba1d8)){fs['createReadStream'](_0x1ba1d8)[_0x11d1('0xe8')](fs[_0x11d1('0xe9')](path[_0x11d1('0xd0')](_0x1541c4,_0x2313aa[_0x11d1('0xda')][_0x11d1('0xe7')])));}}return{'date':moment(_0x2313aa[_0x11d1('0xdc')])[_0x11d1('0xc8')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x2313aa['direction']===_0x11d1('0xea')?_0x2313aa[_0x11d1('0xd5')]?_0x2313aa[_0x11d1('0xd5')]['fullname']:'System':_0x2313aa['Contact'][_0x11d1('0xeb')]+(_0x2313aa[_0x11d1('0x6c')][_0x11d1('0xd8')]?'\x20'+_0x2313aa[_0x11d1('0x6c')][_0x11d1('0xd8')]:''),'body':_0x2313aa[_0x11d1('0xda')]?_0x2313aa[_0x11d1('0xda')]['basename']:_0x2313aa[_0x11d1('0x7c')],'direction':_0x2313aa[_0x11d1('0xdd')]===_0x11d1('0xea')?'A':'C','secret':_0x2313aa['secret'],'read':_0x2313aa[_0x11d1('0x89')],'attachment':_0x2313aa[_0x11d1('0xda')]};})[_0x11d1('0x68')]()};return ejs[_0x11d1('0xec')](path[_0x11d1('0xd0')](config[_0x11d1('0xd1')],_0x11d1('0xd2'),_0x11d1('0xed'),_0x11d1('0xee')),{'interaction':_0x363ec0})[_0x11d1('0x27')](function(_0x28651a){var _0x366624=path[_0x11d1('0xd0')](_0x1541c4,'transcript-'+_0x2ccafb['id']+'-'+_0x4d62ac+_0x11d1('0xef'));var _0x3f80e3={'path':_0x366624,'channel':_0x11d1('0xe3'),'interactionId':_0x2ccafb['id']};return pdf[_0x11d1('0xf0')](_0x28651a,_0x3f80e3);})[_0x11d1('0x27')](function(){return new BPromise(function(_0x2b5dc1,_0x1a6aba){zipdir(_0x1541c4,{'saveTo':_0x111fa5},function(_0x27d624,_0x2a9130){if(_0x27d624)return _0x1a6aba(_0x27d624);return _0x2b5dc1(_0x2a9130);});})[_0x11d1('0x27')](function(){return new BPromise(function(_0x1cc4e3,_0x10c9ad){rimraf(_0x1541c4,function(_0x3893cb){if(_0x3893cb)_0x10c9ad(_0x3893cb);return _0x1cc4e3();});});})['then'](function(){return _0x338449['download'](_0x111fa5,_0x40a8a8,function(_0x476254){if(_0x476254){console[_0x11d1('0xf1')](_0x11d1('0xf2'),_0x476254);}else{fs[_0x11d1('0xf3')](_0x111fa5);}});});});}else{return _0x338449[_0x11d1('0x29')](0xc8);}})[_0x11d1('0x33')](handleError(_0x338449,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 5c0f0ba..f531b00 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 _0x6931=['remove','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save'];(function(_0xaa657d,_0x53caa9){var _0x4de563=function(_0x1c86cc){while(--_0x1c86cc){_0xaa657d['push'](_0xaa657d['shift']());}};_0x4de563(++_0x53caa9);}(_0x6931,0xa5));var _0x1693=function(_0x2c8e40,_0x14d128){_0x2c8e40=_0x2c8e40-0x0;var _0x1135c0=_0x6931[_0x2c8e40];return _0x1135c0;};'use strict';var EventEmitter=require(_0x1693('0x0'));var WhatsappInteraction=require(_0x1693('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db'][_0x1693('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x1693('0x3')](0x0);var events={'afterCreate':_0x1693('0x4'),'afterUpdate':'update','afterDestroy':_0x1693('0x5')};function emitEvent(_0x3ea966){return function(_0x2c6ed0,_0x576a1d,_0x361381){_0x2c6ed0['getUsers']({'attributes':['id'],'raw':!![]})[_0x1693('0x6')](function(_0x45aa35){_0x2c6ed0[_0x1693('0x7')](_0x1693('0x8'),_0x45aa35[_0x1693('0x9')](function(_0x1c3da1){return{'id':_0x1c3da1['id']};}));return WhatsappMessage[_0x1693('0xa')]({'where':{'WhatsappInteractionId':_0x2c6ed0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1693('0x6')](function(_0x2a0e80){_0x2c6ed0[_0x1693('0x7')](_0x1693('0xb'),_0x2a0e80[_0x1693('0xc')]);WhatsappInteractionEvents[_0x1693('0xd')](_0x3ea966+':'+_0x2c6ed0['id'],_0x2c6ed0);WhatsappInteractionEvents[_0x1693('0xd')](_0x3ea966,_0x2c6ed0);_0x361381(null);})[_0x1693('0xe')](_0x361381(null));};}for(var e in events){if(events[_0x1693('0xf')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x1693('0x10')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xefe3=['unreadMessages','length','emit','hook','exports','events','WhatsappMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map','findAll'];(function(_0x85c7c5,_0xb360d5){var _0xdf6b11=function(_0x5d29fa){while(--_0x5d29fa){_0x85c7c5['push'](_0x85c7c5['shift']());}};_0xdf6b11(++_0xb360d5);}(_0xefe3,0xf5));var _0x3efe=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xefe3[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0x3efe('0x0'));var WhatsappInteraction=require('../../mysqldb')['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db'][_0x3efe('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x3efe('0x2')](0x0);var events={'afterCreate':_0x3efe('0x3'),'afterUpdate':_0x3efe('0x4'),'afterDestroy':'remove'};function emitEvent(_0x11125f){return function(_0x58e1bb,_0x89aaa1,_0x4b5006){_0x58e1bb[_0x3efe('0x5')]({'attributes':['id'],'raw':!![]})[_0x3efe('0x6')](function(_0x1f697b){_0x58e1bb[_0x3efe('0x7')](_0x3efe('0x8'),_0x1f697b[_0x3efe('0x9')](function(_0x4b9766){return{'id':_0x4b9766['id']};}));return WhatsappMessage[_0x3efe('0xa')]({'where':{'WhatsappInteractionId':_0x58e1bb['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1edce8){_0x58e1bb[_0x3efe('0x7')](_0x3efe('0xb'),_0x1edce8[_0x3efe('0xc')]);WhatsappInteractionEvents[_0x3efe('0xd')](_0x11125f+':'+_0x58e1bb['id'],_0x58e1bb);WhatsappInteractionEvents[_0x3efe('0xd')](_0x11125f,_0x58e1bb);_0x4b5006(null);})['catch'](_0x4b5006(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x3efe('0xe')](e,emitEvent(event));}}module[_0x3efe('0xf')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index a985a7b..dd80146 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 _0x93f7=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./whatsappInteraction.attributes','exports','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x65167d,_0x404d4b){var _0x1ced5a=function(_0x516b12){while(--_0x516b12){_0x65167d['push'](_0x65167d['shift']());}};_0x1ced5a(++_0x404d4b);}(_0x93f7,0x140));var _0x793f=function(_0x3dc0c2,_0x4729cf){_0x3dc0c2=_0x3dc0c2-0x0;var _0x2175be=_0x93f7[_0x3dc0c2];return _0x2175be;};'use strict';var _=require('lodash');var util=require(_0x793f('0x0'));var logger=require(_0x793f('0x1'))('api');var moment=require(_0x793f('0x2'));var BPromise=require(_0x793f('0x3'));var rp=require(_0x793f('0x4'));var fs=require('fs');var path=require(_0x793f('0x5'));var rimraf=require('rimraf');var config=require(_0x793f('0x6'));var attributes=require(_0x793f('0x7'));module[_0x793f('0x8')]=function(_0x500f5e,_0x455b9c){return _0x500f5e['define'](_0x793f('0x9'),attributes,{'tableName':_0x793f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x17a914,_0x5622a,_0x437229){if(_0x17a914[_0x793f('0xb')](_0x793f('0xc'))){_0x17a914[_0x793f('0xd')]=moment()[_0x793f('0xe')](_0x793f('0xf'));}_0x437229(null,_0x17a914);}}});}; \ No newline at end of file +var _0xfc3d=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','bluebird','path','../../config/environment','./whatsappInteraction.attributes','whatsapp_interactions','closed'];(function(_0x246084,_0x34e858){var _0x360dbd=function(_0x2d4fd3){while(--_0x2d4fd3){_0x246084['push'](_0x246084['shift']());}};_0x360dbd(++_0x34e858);}(_0xfc3d,0x123));var _0xdfc3=function(_0x539ceb,_0x4a6a39){_0x539ceb=_0x539ceb-0x0;var _0x2b4bea=_0xfc3d[_0x539ceb];return _0x2b4bea;};'use strict';var _=require(_0xdfc3('0x0'));var util=require(_0xdfc3('0x1'));var logger=require('../../config/logger')(_0xdfc3('0x2'));var moment=require('moment');var BPromise=require(_0xdfc3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdfc3('0x4'));var rimraf=require('rimraf');var config=require(_0xdfc3('0x5'));var attributes=require(_0xdfc3('0x6'));module['exports']=function(_0x507b3a,_0x520c02){return _0x507b3a['define']('WhatsappInteraction',attributes,{'tableName':_0xdfc3('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x58f225,_0x18ff9b,_0x3680f6){if(_0x58f225['changed'](_0xdfc3('0x8'))){_0x58f225[_0xdfc3('0x9')]=moment()[_0xdfc3('0xa')](_0xdfc3('0xb'));}_0x3680f6(null,_0x58f225);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 98ec72d..2984159 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 _0xd008=['result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','find','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','then','info','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappInteraction,\x20%s,\x20%s'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0xd008,0x8a));var _0x8d00=function(_0x3a99e8,_0x5ba447){_0x3a99e8=_0x3a99e8-0x0;var _0x321e1f=_0xd008[_0x3a99e8];return _0x321e1f;};'use strict';var _=require(_0x8d00('0x0'));var util=require(_0x8d00('0x1'));var moment=require(_0x8d00('0x2'));var BPromise=require('bluebird');var rs=require(_0x8d00('0x3'));var fs=require('fs');var Redis=require(_0x8d00('0x4'));var db=require(_0x8d00('0x5'))['db'];var utils=require(_0x8d00('0x6'));var logger=require(_0x8d00('0x7'))(_0x8d00('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8d00('0x9')]({'port':0x232a});config['redis']=_[_0x8d00('0xa')](config[_0x8d00('0xb')],{'host':_0x8d00('0xc'),'port':0x18eb});var socket=require(_0x8d00('0xd'))(new Redis(config[_0x8d00('0xb')]));require(_0x8d00('0xe'))[_0x8d00('0xf')](socket);function respondWithRpcPromise(_0x1aac69,_0x48bf88,_0x5788ea){return new BPromise(function(_0x2152bf,_0x5ba47c){return client['request'](_0x1aac69,_0x5788ea)[_0x8d00('0x10')](function(_0x4c49fe){logger[_0x8d00('0x11')]('WhatsappInteraction,\x20%s,\x20%s',_0x48bf88,_0x8d00('0x12'));logger[_0x8d00('0x13')](_0x8d00('0x14'),_0x48bf88,_0x8d00('0x12'),JSON[_0x8d00('0x15')](_0x4c49fe));if(_0x4c49fe['error']){if(_0x4c49fe[_0x8d00('0x16')][_0x8d00('0x17')]===0x1f4){logger[_0x8d00('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x48bf88,_0x4c49fe['error'][_0x8d00('0x18')]);return _0x5ba47c(_0x4c49fe[_0x8d00('0x16')][_0x8d00('0x18')]);}logger[_0x8d00('0x16')](_0x8d00('0x19'),_0x48bf88,_0x4c49fe[_0x8d00('0x16')][_0x8d00('0x18')]);return _0x2152bf(_0x4c49fe['error'][_0x8d00('0x18')]);}else{logger['info'](_0x8d00('0x19'),_0x48bf88,_0x8d00('0x12'));_0x2152bf(_0x4c49fe[_0x8d00('0x1a')][_0x8d00('0x18')]);}})[_0x8d00('0x1b')](function(_0x1c60af){logger[_0x8d00('0x16')](_0x8d00('0x19'),_0x48bf88,_0x1c60af);_0x5ba47c(_0x1c60af);});});}exports[_0x8d00('0x1c')]=function(_0x36689d){var _0x33d03e=this;return new Promise(function(_0x437b78,_0x5d06a2){return db[_0x8d00('0x1d')][_0x8d00('0x1e')](_0x36689d[_0x8d00('0x1f')],{'raw':_0x36689d[_0x8d00('0x20')]?_0x36689d[_0x8d00('0x20')][_0x8d00('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36689d[_0x8d00('0x20')]?_0x36689d['options'][_0x8d00('0x22')]||null:null,'attributes':_0x36689d[_0x8d00('0x20')]?_0x36689d[_0x8d00('0x20')][_0x8d00('0x23')]||null:null,'limit':_0x36689d[_0x8d00('0x20')]?_0x36689d[_0x8d00('0x20')]['limit']||null:null})['then'](function(_0x4ac020){logger[_0x8d00('0x11')](_0x8d00('0x1c'),_0x36689d);logger[_0x8d00('0x13')](_0x8d00('0x1c'),_0x36689d,JSON[_0x8d00('0x15')](_0x4ac020));_0x437b78(_0x4ac020);})[_0x8d00('0x1b')](function(_0x22a784){logger[_0x8d00('0x16')](_0x8d00('0x1c'),_0x22a784[_0x8d00('0x18')],_0x36689d);_0x5d06a2(_0x33d03e[_0x8d00('0x16')](0x1f4,_0x22a784['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x543231){return new Promise(function(_0x501b1d,_0x46acd0){return db[_0x8d00('0x1d')][_0x8d00('0x24')]({'where':_0x543231[_0x8d00('0x20')]?_0x543231[_0x8d00('0x20')][_0x8d00('0x22')]||null:null})[_0x8d00('0x10')](function(_0x4b6014){if(_0x4b6014){return _0x4b6014['addTags'](_0x543231[_0x8d00('0x1f')][_0x8d00('0x25')],_[_0x8d00('0x26')](_0x543231['body'],['ids','id'])||{});}})[_0x8d00('0x27')](function(_0x58bfa8){logger[_0x8d00('0x11')](_0x8d00('0x28'),_0x543231);logger[_0x8d00('0x13')]('AddTags',_0x543231,JSON['stringify'](_0x58bfa8));_0x501b1d(_0x58bfa8);})[_0x8d00('0x1b')](function(_0x713598){logger[_0x8d00('0x16')](_0x8d00('0x28'),_0x713598[_0x8d00('0x18')],_0x543231);_0x46acd0(_this[_0x8d00('0x16')](0x1f4,_0x713598[_0x8d00('0x18')]));});});}; \ No newline at end of file +var _0x0c43=['AddTags','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','request','then','info','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappInteraction,\x20%s,\x20%s','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','debug','AddTagsToWhatsappInteraction','find','omit','ids'];(function(_0x52e595,_0xf621c2){var _0x52f0fb=function(_0x1892a3){while(--_0x1892a3){_0x52e595['push'](_0x52e595['shift']());}};_0x52f0fb(++_0xf621c2);}(_0x0c43,0x1c4));var _0x30c4=function(_0x2d6d4c,_0x8dd9a8){_0x2d6d4c=_0x2d6d4c-0x0;var _0x4f95e0=_0x0c43[_0x2d6d4c];return _0x4f95e0;};'use strict';var _=require('lodash');var util=require(_0x30c4('0x0'));var moment=require('moment');var BPromise=require(_0x30c4('0x1'));var rs=require(_0x30c4('0x2'));var fs=require('fs');var Redis=require(_0x30c4('0x3'));var db=require(_0x30c4('0x4'))['db'];var utils=require(_0x30c4('0x5'));var logger=require(_0x30c4('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x30c4('0x7'));var client=jayson[_0x30c4('0x8')][_0x30c4('0x9')]({'port':0x232a});config[_0x30c4('0xa')]=_[_0x30c4('0xb')](config['redis'],{'host':_0x30c4('0xc'),'port':0x18eb});var socket=require(_0x30c4('0xd'))(new Redis(config['redis']));require(_0x30c4('0xe'))['register'](socket);function respondWithRpcPromise(_0xbf162d,_0x4b37c9,_0x55d5b8){return new BPromise(function(_0x4a338a,_0xadb8bc){return client[_0x30c4('0xf')](_0xbf162d,_0x55d5b8)[_0x30c4('0x10')](function(_0x5f0caa){logger[_0x30c4('0x11')]('WhatsappInteraction,\x20%s,\x20%s',_0x4b37c9,_0x30c4('0x12'));logger['debug'](_0x30c4('0x13'),_0x4b37c9,'request\x20sent',JSON[_0x30c4('0x14')](_0x5f0caa));if(_0x5f0caa[_0x30c4('0x15')]){if(_0x5f0caa['error']['code']===0x1f4){logger[_0x30c4('0x15')](_0x30c4('0x16'),_0x4b37c9,_0x5f0caa[_0x30c4('0x15')]['message']);return _0xadb8bc(_0x5f0caa['error']['message']);}logger[_0x30c4('0x15')](_0x30c4('0x16'),_0x4b37c9,_0x5f0caa[_0x30c4('0x15')][_0x30c4('0x17')]);return _0x4a338a(_0x5f0caa[_0x30c4('0x15')]['message']);}else{logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x4b37c9,_0x30c4('0x12'));_0x4a338a(_0x5f0caa[_0x30c4('0x18')][_0x30c4('0x17')]);}})[_0x30c4('0x19')](function(_0x549159){logger[_0x30c4('0x15')](_0x30c4('0x16'),_0x4b37c9,_0x549159);_0xadb8bc(_0x549159);});});}exports[_0x30c4('0x1a')]=function(_0x5bb1df){var _0x30033=this;return new Promise(function(_0x4ebce9,_0x3be93c){return db[_0x30c4('0x1b')][_0x30c4('0x1c')](_0x5bb1df[_0x30c4('0x1d')],{'raw':_0x5bb1df[_0x30c4('0x1e')]?_0x5bb1df[_0x30c4('0x1e')][_0x30c4('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bb1df[_0x30c4('0x1e')]?_0x5bb1df[_0x30c4('0x1e')][_0x30c4('0x20')]||null:null,'attributes':_0x5bb1df[_0x30c4('0x1e')]?_0x5bb1df[_0x30c4('0x1e')][_0x30c4('0x21')]||null:null,'limit':_0x5bb1df['options']?_0x5bb1df[_0x30c4('0x1e')][_0x30c4('0x22')]||null:null})[_0x30c4('0x10')](function(_0x40ee5d){logger[_0x30c4('0x11')](_0x30c4('0x1a'),_0x5bb1df);logger[_0x30c4('0x23')](_0x30c4('0x1a'),_0x5bb1df,JSON[_0x30c4('0x14')](_0x40ee5d));_0x4ebce9(_0x40ee5d);})['catch'](function(_0x4d27cb){logger[_0x30c4('0x15')](_0x30c4('0x1a'),_0x4d27cb[_0x30c4('0x17')],_0x5bb1df);_0x3be93c(_0x30033['error'](0x1f4,_0x4d27cb[_0x30c4('0x17')]));});});};exports[_0x30c4('0x24')]=function(_0x50bc91){return new Promise(function(_0x267a7f,_0x2f751){return db[_0x30c4('0x1b')][_0x30c4('0x25')]({'where':_0x50bc91[_0x30c4('0x1e')]?_0x50bc91['options'][_0x30c4('0x20')]||null:null})[_0x30c4('0x10')](function(_0x5eb6bd){if(_0x5eb6bd){return _0x5eb6bd['addTags'](_0x50bc91['body']['ids'],_[_0x30c4('0x26')](_0x50bc91[_0x30c4('0x1d')],[_0x30c4('0x27'),'id'])||{});}})['spread'](function(_0x826bdd){logger[_0x30c4('0x11')](_0x30c4('0x28'),_0x50bc91);logger[_0x30c4('0x23')](_0x30c4('0x28'),_0x50bc91,JSON[_0x30c4('0x14')](_0x826bdd));_0x267a7f(_0x826bdd);})[_0x30c4('0x19')](function(_0x4cd098){logger[_0x30c4('0x15')]('AddTags',_0x4cd098[_0x30c4('0x17')],_0x50bc91);_0x2f751(_this[_0x30c4('0x15')](0x1f4,_0x4cd098[_0x30c4('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 63c2a60..3898caf 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 _0x5cd9=['save','remove','update','emit','removeListener','register','length','./whatsappInteraction.events'];(function(_0x5eec91,_0x2c1d91){var _0x41cacf=function(_0x3b05c1){while(--_0x3b05c1){_0x5eec91['push'](_0x5eec91['shift']());}};_0x41cacf(++_0x2c1d91);}(_0x5cd9,0xbf));var _0x95cd=function(_0x1f465b,_0xa1d03b){_0x1f465b=_0x1f465b-0x0;var _0x32a6f6=_0x5cd9[_0x1f465b];return _0x32a6f6;};'use strict';var WhatsappInteractionEvents=require(_0x95cd('0x0'));var events=[_0x95cd('0x1'),_0x95cd('0x2'),_0x95cd('0x3')];function createListener(_0x184608,_0x17fb09){return function(_0x5e8637){_0x17fb09[_0x95cd('0x4')](_0x184608,_0x5e8637);};}function removeListener(_0x42ca00,_0x94606b){return function(){WhatsappInteractionEvents[_0x95cd('0x5')](_0x42ca00,_0x94606b);};}exports[_0x95cd('0x6')]=function(_0x37d1e7){for(var _0x1b7d00=0x0,_0x40ffd5=events[_0x95cd('0x7')];_0x1b7d00<_0x40ffd5;_0x1b7d00++){var _0x326543=events[_0x1b7d00];var _0x1b00e9=createListener('whatsappInteraction:'+_0x326543,_0x37d1e7);WhatsappInteractionEvents['on'](_0x326543,_0x1b00e9);}}; \ No newline at end of file +var _0xb17d=['removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update'];(function(_0x1fcf1b,_0x214549){var _0x5d2952=function(_0x3331b7){while(--_0x3331b7){_0x1fcf1b['push'](_0x1fcf1b['shift']());}};_0x5d2952(++_0x214549);}(_0xb17d,0x1ec));var _0xdb17=function(_0x42dd72,_0x50671f){_0x42dd72=_0x42dd72-0x0;var _0x4832db=_0xb17d[_0x42dd72];return _0x4832db;};'use strict';var WhatsappInteractionEvents=require(_0xdb17('0x0'));var events=[_0xdb17('0x1'),_0xdb17('0x2'),_0xdb17('0x3')];function createListener(_0x58dca7,_0x56a3e0){return function(_0x175916){_0x56a3e0['emit'](_0x58dca7,_0x175916);};}function removeListener(_0x3af2c9,_0xac6dbc){return function(){WhatsappInteractionEvents[_0xdb17('0x4')](_0x3af2c9,_0xac6dbc);};}exports[_0xdb17('0x5')]=function(_0x227b7e){for(var _0x5bbd66=0x0,_0x2684cf=events[_0xdb17('0x6')];_0x5bbd66<_0x2684cf;_0x5bbd66++){var _0x4771a2=events[_0x5bbd66];var _0x60f94=createListener(_0xdb17('0x7')+_0x4771a2,_0x227b7e);WhatsappInteractionEvents['on'](_0x4771a2,_0x60f94);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index d27b978..2bd0b27 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 _0xa793=['/describe','describe','/:id','show','post','whatsappmessage:create','create','/:id/status','status','put','update','accept','reject','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa793,0x17c));var _0x3a79=function(_0x1d2bbb,_0x202267){_0x1d2bbb=_0x1d2bbb-0x0;var _0x38082b=_0xa793[_0x1d2bbb];return _0x38082b;};'use strict';var multer=require(_0x3a79('0x0'));var util=require(_0x3a79('0x1'));var path=require(_0x3a79('0x2'));var timeout=require('connect-timeout');var express=require(_0x3a79('0x3'));var router=express[_0x3a79('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3a79('0x5'));var interaction=require(_0x3a79('0x6'));var config=require(_0x3a79('0x7'));var controller=require('./whatsappMessage.controller');router['get']('/',auth[_0x3a79('0x8')](),controller['index']);router[_0x3a79('0x9')](_0x3a79('0xa'),auth[_0x3a79('0x8')](),controller[_0x3a79('0xb')]);router[_0x3a79('0x9')](_0x3a79('0xc'),auth[_0x3a79('0x8')](),controller[_0x3a79('0xd')]);router[_0x3a79('0xe')]('/',auth['isAuthenticated'](),interaction['tracked']('whatsapp',_0x3a79('0xf')),controller[_0x3a79('0x10')]);router['post'](_0x3a79('0x11'),controller[_0x3a79('0x12')]);router[_0x3a79('0x13')](_0x3a79('0xc'),auth[_0x3a79('0x8')](),controller[_0x3a79('0x14')]);router[_0x3a79('0x13')]('/:id/accept',auth[_0x3a79('0x8')](),controller[_0x3a79('0x15')]);router[_0x3a79('0x13')]('/:id/reject',auth[_0x3a79('0x8')](),controller[_0x3a79('0x16')]);router[_0x3a79('0x17')](_0x3a79('0xc'),auth[_0x3a79('0x8')](),controller[_0x3a79('0x18')]);module[_0x3a79('0x19')]=router; \ No newline at end of file +var _0x2812=['index','show','tracked','whatsapp','whatsappmessage:create','post','/:id/status','put','/:id','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated'];(function(_0x1d4bca,_0xaf18a6){var _0x1a5503=function(_0x474e57){while(--_0x474e57){_0x1d4bca['push'](_0x1d4bca['shift']());}};_0x1a5503(++_0xaf18a6);}(_0x2812,0x130));var _0x2281=function(_0x474d97,_0x5909ce){_0x474d97=_0x474d97-0x0;var _0x1edf25=_0x2812[_0x474d97];return _0x1edf25;};'use strict';var multer=require(_0x2281('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2281('0x1'));var router=express[_0x2281('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2281('0x3'));var interaction=require(_0x2281('0x4'));var config=require('../../config/environment');var controller=require(_0x2281('0x5'));router[_0x2281('0x6')]('/',auth[_0x2281('0x7')](),controller[_0x2281('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x2281('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x2281('0x9')]);router['post']('/',auth[_0x2281('0x7')](),interaction[_0x2281('0xa')](_0x2281('0xb'),_0x2281('0xc')),controller['create']);router[_0x2281('0xd')](_0x2281('0xe'),controller['status']);router[_0x2281('0xf')](_0x2281('0x10'),auth['isAuthenticated'](),controller['update']);router['put'](_0x2281('0x11'),auth[_0x2281('0x7')](),controller[_0x2281('0x12')]);router[_0x2281('0xf')](_0x2281('0x13'),auth[_0x2281('0x7')](),controller[_0x2281('0x14')]);router[_0x2281('0x15')](_0x2281('0x10'),auth[_0x2281('0x7')](),controller[_0x2281('0x16')]);module[_0x2281('0x17')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index a01ad22..b21dc1b 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 _0x4fef=['DATE','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x466247,_0x5d69e3){var _0x4b352e=function(_0x58c71b){while(--_0x58c71b){_0x466247['push'](_0x466247['shift']());}};_0x4b352e(++_0x5d69e3);}(_0x4fef,0x109));var _0xf4fe=function(_0x15fbd5,_0xf595d0){_0x15fbd5=_0x15fbd5-0x0;var _0x26891c=_0x4fef[_0x15fbd5];return _0x26891c;};'use strict';var Sequelize=require('sequelize');module[_0xf4fe('0x0')]={'body':{'type':Sequelize[_0xf4fe('0x1')](_0xf4fe('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xf4fe('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf4fe('0x4')]('in',_0xf4fe('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xf4fe('0x6')](0xbe)},'phone':{'type':Sequelize[_0xf4fe('0x6')]},'readAt':{'type':Sequelize[_0xf4fe('0x7')]},'secret':{'type':Sequelize[_0xf4fe('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xf4fe('0x6')]},'providerResponse':{'type':Sequelize[_0xf4fe('0x1')]}}; \ No newline at end of file +var _0xe009=['DATE','BOOLEAN','sequelize','exports','TEXT','medium','ENUM','out','STRING'];(function(_0x5de32f,_0xee2724){var _0x285927=function(_0x30f414){while(--_0x30f414){_0x5de32f['push'](_0x5de32f['shift']());}};_0x285927(++_0xee2724);}(_0xe009,0x122));var _0x9e00=function(_0x591aa6,_0x4c24f6){_0x591aa6=_0x591aa6-0x0;var _0x353e5c=_0xe009[_0x591aa6];return _0x353e5c;};'use strict';var Sequelize=require(_0x9e00('0x0'));module[_0x9e00('0x1')]={'body':{'type':Sequelize[_0x9e00('0x2')](_0x9e00('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9e00('0x4')]('in','out'),'defaultValue':_0x9e00('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x9e00('0x6')](0xbe)},'phone':{'type':Sequelize[_0x9e00('0x6')]},'readAt':{'type':Sequelize[_0x9e00('0x7')]},'secret':{'type':Sequelize[_0x9e00('0x8')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x9e00('0x6')]},'providerResponse':{'type':Sequelize[_0x9e00('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index e069c6b..83dbd0d 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 _0x5293=['name','send','index','map','WhatsappMessage','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','type','options','includeAll','findAll','rows','show','params','include','merge','find','create','body','describe','../../config/logger','whatsapp-interactions','whatsapp','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','WhatsappInteractionId','stringify','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','WhatsappAccount','WhatsappAccountId','inspect','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','eml-format','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy'];(function(_0x7cb905,_0x5c2772){var _0x411552=function(_0xa6c946){while(--_0xa6c946){_0x7cb905['push'](_0x7cb905['shift']());}};_0x411552(++_0x5c2772);}(_0x5293,0xd7));var _0x3529=function(_0x5c4585,_0x3d0eab){_0x5c4585=_0x5c4585-0x0;var _0x21dede=_0x5293[_0x5c4585];return _0x21dede;};'use strict';var emlformat=require(_0x3529('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3529('0x1'));var jsonpatch=require(_0x3529('0x2'));var rp=require('request-promise');var moment=require(_0x3529('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3529('0x4'));var util=require('util');var path=require(_0x3529('0x5'));var sox=require('sox');var csv=require(_0x3529('0x6'));var ejs=require(_0x3529('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3529('0x8'));var squel=require(_0x3529('0x9'));var crypto=require(_0x3529('0xa'));var jsforce=require(_0x3529('0xb'));var deskjs=require(_0x3529('0xc'));var toCsv=require(_0x3529('0x6'));var querystring=require(_0x3529('0xd'));var Papa=require(_0x3529('0xe'));var Redis=require(_0x3529('0xf'));var authService=require(_0x3529('0x10'));var qs=require(_0x3529('0x11'));var as=require(_0x3529('0x12'));var hardwareService=require(_0x3529('0x13'));var logger=require('../../config/logger')(_0x3529('0x14'));var utils=require(_0x3529('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3529('0x16'));var db=require(_0x3529('0x17'))['db'];config[_0x3529('0x18')]=_[_0x3529('0x19')](config[_0x3529('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3529('0x18')]));require(_0x3529('0x1a'))[_0x3529('0x1b')](socket);var jayson=require(_0x3529('0x1c'));var client=jayson[_0x3529('0x1d')][_0x3529('0x1e')]({'port':0x232c});var client9002=jayson[_0x3529('0x1d')][_0x3529('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x50407d,_0x952a22,_0x34e09e,_0x3aa4d4){return new BPromise(function(_0x3feb78,_0x389737){var _0x296a7a=_0x3aa4d4||client;return _0x296a7a[_0x3529('0x1f')](_0x50407d,_0x34e09e)[_0x3529('0x20')](function(_0x428d44){logger[_0x3529('0x21')](_0x3529('0x22'),_0x952a22,_0x3529('0x23'));logger[_0x3529('0x24')](_0x3529('0x25'),_0x952a22,_0x3529('0x23'),JSON['stringify'](_0x428d44));if(_0x428d44[_0x3529('0x26')]){if(_0x428d44[_0x3529('0x26')][_0x3529('0x27')]===0x1f4){logger[_0x3529('0x26')](_0x3529('0x22'),_0x952a22,_0x428d44['error'][_0x3529('0x28')]);return _0x389737(_0x428d44[_0x3529('0x26')][_0x3529('0x28')]);}logger[_0x3529('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x952a22,_0x428d44[_0x3529('0x26')][_0x3529('0x28')]);return _0x3feb78(_0x428d44[_0x3529('0x26')][_0x3529('0x28')]);}else{logger[_0x3529('0x21')]('WhatsappMessage,\x20%s,\x20%s',_0x952a22,_0x3529('0x23'));_0x3feb78(_0x428d44['result']['message']);}})[_0x3529('0x29')](function(_0x5005d2){logger[_0x3529('0x26')](_0x3529('0x22'),_0x952a22,_0x5005d2);_0x389737(_0x5005d2);});});}function respondWithStatusCode(_0x28d68b,_0x1afea2){_0x1afea2=_0x1afea2||0xcc;return function(_0x508f7d){if(_0x508f7d){return _0x28d68b[_0x3529('0x2a')](_0x1afea2);}return _0x28d68b['status'](_0x1afea2)[_0x3529('0x2b')]();};}function respondWithResult(_0x502f76,_0x240cfb){_0x240cfb=_0x240cfb||0xc8;return function(_0x469df2){if(_0x469df2){return _0x502f76[_0x3529('0x2c')](_0x240cfb)['json'](_0x469df2);}};}function respondWithFilteredResult(_0x24e2fd,_0x1e2b8a){return function(_0x503b57){if(_0x503b57){var _0x24207f=typeof _0x1e2b8a[_0x3529('0x2d')]===_0x3529('0x2e')&&typeof _0x1e2b8a[_0x3529('0x2f')]===_0x3529('0x2e');var _0x40ed4e=_0x503b57[_0x3529('0x30')];var _0x4ad441=_0x24207f?0x0:_0x1e2b8a['offset'];var _0x316d01=_0x24207f?_0x503b57[_0x3529('0x30')]:_0x1e2b8a[_0x3529('0x2d')]+_0x1e2b8a[_0x3529('0x2f')];var _0x408fcf;if(_0x316d01>=_0x40ed4e){_0x316d01=_0x40ed4e;_0x408fcf=0xc8;}else{_0x408fcf=0xce;}_0x24e2fd[_0x3529('0x2c')](_0x408fcf);return _0x24e2fd[_0x3529('0x31')](_0x3529('0x32'),_0x4ad441+'-'+_0x316d01+'/'+_0x40ed4e)[_0x3529('0x33')](_0x503b57);}return null;};}function patchUpdates(_0x2d3e1d){return function(_0x32c1c5){try{jsonpatch[_0x3529('0x34')](_0x32c1c5,_0x2d3e1d,!![]);}catch(_0x1c32ad){return BPromise[_0x3529('0x35')](_0x1c32ad);}return _0x32c1c5[_0x3529('0x36')]();};}function saveUpdates(_0x13720a,_0x210fac){return function(_0x2c2ecc){if(_0x2c2ecc){return _0x2c2ecc[_0x3529('0x37')](_0x13720a)[_0x3529('0x20')](function(_0x53b303){return _0x53b303;});}return null;};}function removeEntity(_0x3b173d,_0x1dab1d){return function(_0x556271){if(_0x556271){return _0x556271[_0x3529('0x38')]()[_0x3529('0x20')](function(){_0x3b173d['status'](0xcc)[_0x3529('0x2b')]();});}};}function handleEntityNotFound(_0x72c96b,_0x57733f){return function(_0x531965){if(!_0x531965){_0x72c96b[_0x3529('0x2a')](0x194);}return _0x531965;};}function handleError(_0x1a1e89,_0x576537){_0x576537=_0x576537||0x1f4;return function(_0x2ea2c2){logger[_0x3529('0x26')](_0x2ea2c2['stack']);if(_0x2ea2c2[_0x3529('0x39')]){delete _0x2ea2c2[_0x3529('0x39')];}_0x1a1e89[_0x3529('0x2c')](_0x576537)[_0x3529('0x3a')](_0x2ea2c2);};}exports[_0x3529('0x3b')]=function(_0x23e8a7,_0xb346c){var _0x634201={},_0x1440ce={},_0x20d24a={'count':0x0,'rows':[]};var _0x18da73=_[_0x3529('0x3c')](db[_0x3529('0x3d')]['rawAttributes'],function(_0x585d92){return{'name':_0x585d92[_0x3529('0x3e')],'type':_0x585d92['type'][_0x3529('0x3f')]};});_0x1440ce[_0x3529('0x40')]=_[_0x3529('0x3c')](_0x18da73,'name');_0x1440ce[_0x3529('0x41')]=_[_0x3529('0x42')](_0x23e8a7[_0x3529('0x41')]);_0x1440ce['filters']=_[_0x3529('0x43')](_0x1440ce['model'],_0x1440ce[_0x3529('0x41')]);_0x634201[_0x3529('0x44')]=_[_0x3529('0x43')](_0x1440ce[_0x3529('0x40')],qs['fields'](_0x23e8a7[_0x3529('0x41')][_0x3529('0x45')]));_0x634201['attributes']=_0x634201[_0x3529('0x44')][_0x3529('0x46')]?_0x634201[_0x3529('0x44')]:_0x1440ce[_0x3529('0x40')];if(!_0x23e8a7['query'][_0x3529('0x47')]('nolimit')){_0x634201[_0x3529('0x2f')]=qs[_0x3529('0x2f')](_0x23e8a7[_0x3529('0x41')][_0x3529('0x2f')]);_0x634201[_0x3529('0x2d')]=qs[_0x3529('0x2d')](_0x23e8a7['query'][_0x3529('0x2d')]);}_0x634201['order']=qs[_0x3529('0x48')](_0x23e8a7[_0x3529('0x41')][_0x3529('0x48')]);_0x634201[_0x3529('0x49')]=qs[_0x3529('0x4a')](_[_0x3529('0x4b')](_0x23e8a7['query'],_0x1440ce['filters']),_0x18da73);if(_0x23e8a7[_0x3529('0x41')][_0x3529('0x4c')]){_0x634201[_0x3529('0x49')]=_['merge'](_0x634201[_0x3529('0x49')],{'$or':_[_0x3529('0x3c')](_0x18da73,function(_0x22318a){if(_0x22318a[_0x3529('0x4d')]!=='VIRTUAL'){var _0x420357={};_0x420357[_0x22318a[_0x3529('0x39')]]={'$like':'%'+_0x23e8a7[_0x3529('0x41')]['filter']+'%'};return _0x420357;}})});}_0x634201=_['merge']({},_0x634201,_0x23e8a7[_0x3529('0x4e')]);var _0x4deae0={'where':_0x634201[_0x3529('0x49')]};return db[_0x3529('0x3d')][_0x3529('0x30')](_0x4deae0)['then'](function(_0x1d795a){_0x20d24a[_0x3529('0x30')]=_0x1d795a;if(_0x23e8a7[_0x3529('0x41')][_0x3529('0x4f')]){_0x634201['include']=[{'all':!![]}];}return db[_0x3529('0x3d')][_0x3529('0x50')](_0x634201);})[_0x3529('0x20')](function(_0x489830){_0x20d24a[_0x3529('0x51')]=_0x489830;return _0x20d24a;})['then'](respondWithFilteredResult(_0xb346c,_0x634201))[_0x3529('0x29')](handleError(_0xb346c,null));};exports[_0x3529('0x52')]=function(_0x1741b3,_0x3bc40b){var _0x1b8c47={'raw':!![],'where':{'id':_0x1741b3[_0x3529('0x53')]['id']}},_0xb6afa8={};_0xb6afa8[_0x3529('0x40')]=_['keys'](db[_0x3529('0x3d')]['rawAttributes']);_0xb6afa8[_0x3529('0x41')]=_['keys'](_0x1741b3[_0x3529('0x41')]);_0xb6afa8['filters']=_[_0x3529('0x43')](_0xb6afa8[_0x3529('0x40')],_0xb6afa8[_0x3529('0x41')]);_0x1b8c47[_0x3529('0x44')]=_[_0x3529('0x43')](_0xb6afa8['model'],qs[_0x3529('0x45')](_0x1741b3[_0x3529('0x41')][_0x3529('0x45')]));_0x1b8c47[_0x3529('0x44')]=_0x1b8c47[_0x3529('0x44')][_0x3529('0x46')]?_0x1b8c47[_0x3529('0x44')]:_0xb6afa8[_0x3529('0x40')];if(_0x1741b3[_0x3529('0x41')][_0x3529('0x4f')]){_0x1b8c47[_0x3529('0x54')]=[{'all':!![]}];}_0x1b8c47=_[_0x3529('0x55')]({},_0x1b8c47,_0x1741b3[_0x3529('0x4e')]);return db['WhatsappMessage'][_0x3529('0x56')](_0x1b8c47)['then'](handleEntityNotFound(_0x3bc40b,null))[_0x3529('0x20')](respondWithResult(_0x3bc40b,null))[_0x3529('0x29')](handleError(_0x3bc40b,null));};exports['create']=function(_0x14d3e7,_0x13371a){return db[_0x3529('0x3d')][_0x3529('0x57')](_0x14d3e7[_0x3529('0x58')],{})[_0x3529('0x20')](respondWithResult(_0x13371a,0xc9))[_0x3529('0x29')](handleError(_0x13371a,null));};exports['update']=function(_0xd5820d,_0x217461){if(_0xd5820d[_0x3529('0x58')]['id']){delete _0xd5820d[_0x3529('0x58')]['id'];}return db[_0x3529('0x3d')][_0x3529('0x56')]({'where':{'id':_0xd5820d[_0x3529('0x53')]['id']}})[_0x3529('0x20')](handleEntityNotFound(_0x217461,null))[_0x3529('0x20')](saveUpdates(_0xd5820d[_0x3529('0x58')],null))[_0x3529('0x20')](respondWithResult(_0x217461,null))[_0x3529('0x29')](handleError(_0x217461,null));};exports[_0x3529('0x38')]=function(_0x4fc047,_0x2a0209){return db[_0x3529('0x3d')][_0x3529('0x56')]({'where':{'id':_0x4fc047[_0x3529('0x53')]['id']}})[_0x3529('0x20')](handleEntityNotFound(_0x2a0209,null))['then'](removeEntity(_0x2a0209,null))[_0x3529('0x29')](handleError(_0x2a0209,null));};exports[_0x3529('0x59')]=function(_0x500ca4,_0x56b14d){return db['WhatsappMessage'][_0x3529('0x59')]()[_0x3529('0x20')](respondWithResult(_0x56b14d,null))[_0x3529('0x29')](handleError(_0x56b14d,null));};var interaction_log=require(_0x3529('0x5a'))(_0x3529('0x5b'));exports['accept']=function(_0x464864,_0x27ec70,_0x47970e){var _0x41a34f={'agent':{},'channel':_0x3529('0x5c')};if(_0x464864[_0x3529('0x58')]['id']){delete _0x464864[_0x3529('0x58')]['id'];}_0x464864[_0x3529('0x58')]['read']=!![];_0x464864[_0x3529('0x58')][_0x3529('0x5d')]=moment()[_0x3529('0x5e')](_0x3529('0x5f'));_0x464864[_0x3529('0x58')][_0x3529('0x60')]=_0x464864[_0x3529('0x58')]['UserId']||_0x464864[_0x3529('0x61')]['id'];_0x41a34f[_0x3529('0x62')]['id']=_0x464864[_0x3529('0x58')][_0x3529('0x60')];return db['WhatsappMessage'][_0x3529('0x56')]({'where':{'id':_0x464864[_0x3529('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x27ec70,null))[_0x3529('0x20')](saveUpdates(_0x464864[_0x3529('0x58')],null))['then'](function(_0x389cdc){if(_0x389cdc){_0x41a34f[_0x3529('0x28')]=_0x389cdc[_0x3529('0x63')]({'plain':!![]});return db[_0x3529('0x64')][_0x3529('0x56')]({'where':{'id':_0x389cdc['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x27ec70,null))[_0x3529('0x20')](function(_0x3b2979){if(_0x3b2979){return _0x3b2979[_0x3529('0x37')]({'UserId':_0x464864[_0x3529('0x58')][_0x3529('0x60')],'read1stAt':_['isNil'](_0x3b2979['read1stAt'])?moment()['format'](_0x3529('0x5f')):undefined});}return null;})['then'](function(_0x5b9ae2){if(_0x5b9ae2){_0x41a34f[_0x3529('0x65')]=_0x5b9ae2['get']({'plain':!![]});interaction_log['info'](_0x3529('0x66'),_0x464864[_0x3529('0x61')]['id'],_0x464864[_0x3529('0x61')]['name'],_0x464864['user'][_0x3529('0x67')],_0x41a34f[_0x3529('0x65')]['id'],_0x464864[_0x3529('0x58')]?JSON['stringify'](_0x464864[_0x3529('0x58')]):_0x3529('0x68'));return respondWithRpcPromise(_0x3529('0x69'),_0x3529('0x6a'),_0x41a34f);}return null;})[_0x3529('0x20')](function(_0x39056e){var _0x364403='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x39056e[_0x3529('0x28')][_0x3529('0x6b')];return db['sequelize']['query'](_0x364403,{'type':db[_0x3529('0x6c')][_0x3529('0x6d')][_0x3529('0x6e')],'raw':!![]})[_0x3529('0x20')](function(_0x4e6627){return _0x4e6627;});})[_0x3529('0x20')](function(_0x3eef90){if(_0x3eef90){_0x41a34f[_0x3529('0x28')][_0x3529('0x6f')]=_0x3eef90[0x0];if(!_0x464864[_0x3529('0x58')][_0x3529('0x60')])return;return db[_0x3529('0x70')][_0x3529('0x56')]({'where':{'id':_0x464864[_0x3529('0x58')][_0x3529('0x60')],'role':_0x3529('0x62')},'attributes':['id',_0x3529('0x39'),_0x3529('0x71'),_0x3529('0x72'),_0x3529('0x73')],'raw':!![]});}return null;})['then'](function(_0x449886){if(!_0x449886)return null;_0x41a34f[_0x3529('0x28')][_0x3529('0x62')]=_0x449886;return _0x41a34f;})[_0x3529('0x20')](function(_0x1ac46c){if(_0x1ac46c){if(_0x464864['body'][_0x3529('0x74')]){_0x41a34f[_0x3529('0x28')][_0x3529('0x75')]=util[_0x3529('0x5e')](_0x3529('0x76'),_0x464864[_0x3529('0x61')][_0x3529('0x39')]);_0x41a34f[_0x3529('0x28')][_0x3529('0x77')]=_0x41a34f[_0x3529('0x77')];_0x41a34f[_0x3529('0x28')][_0x3529('0x78')]=_0x41a34f[_0x3529('0x77')];_0x41a34f[_0x3529('0x28')][_0x3529('0x79')]=_0x3529('0x7a');return respondWithRpcPromise(_0x3529('0x7b'),'EventManager',{'event':_0x3529('0x7c'),'message':_0x41a34f[_0x3529('0x28')]},client9002)[_0x3529('0x20')](function(){return _0x41a34f;});}return _0x41a34f;}return null;})[_0x3529('0x20')](respondWithResult(_0x27ec70,null))['catch'](handleError(_0x27ec70,null));};var interaction_log=require(_0x3529('0x5a'))('whatsapp-interactions');exports[_0x3529('0x35')]=function(_0x1a2e98,_0x3b6043,_0x4cd3d0){var _0x4e8551={'agent':{},'channel':'whatsapp'};if(_0x1a2e98['body']['id']){delete _0x1a2e98[_0x3529('0x58')]['id'];}_0x1a2e98[_0x3529('0x58')]['UserId']=_0x1a2e98['body'][_0x3529('0x60')]||_0x1a2e98['user']['id'];_0x4e8551[_0x3529('0x62')]['id']=_0x1a2e98[_0x3529('0x58')][_0x3529('0x60')];return db['WhatsappMessage']['find']({'where':{'id':_0x1a2e98['params']['id'],'UserId':null}})[_0x3529('0x20')](handleEntityNotFound(_0x3b6043,null))[_0x3529('0x20')](function(_0x3e8b22){if(_0x3e8b22){_0x4e8551[_0x3529('0x28')]=_0x3e8b22[_0x3529('0x63')]({'plain':!![]});return db[_0x3529('0x64')][_0x3529('0x56')]({'where':{'id':_0x3e8b22[_0x3529('0x7d')]}});}return null;})[_0x3529('0x20')](handleEntityNotFound(_0x3b6043,null))['then'](function(_0x574b65){if(_0x574b65){_0x4e8551[_0x3529('0x65')]=_0x574b65[_0x3529('0x63')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1a2e98[_0x3529('0x61')]['id'],_0x1a2e98[_0x3529('0x61')][_0x3529('0x39')],_0x1a2e98[_0x3529('0x61')][_0x3529('0x67')],_0x4e8551[_0x3529('0x65')]['id'],_0x1a2e98[_0x3529('0x58')]?JSON[_0x3529('0x7e')](_0x1a2e98[_0x3529('0x58')]):_0x3529('0x68'));return respondWithRpcPromise(_0x3529('0x7f'),'rejectMessage',_0x4e8551);}return null;})[_0x3529('0x20')](function(_0x1fcc62){var _0x23b02c=_0x3529('0x80')+_0x1fcc62[_0x3529('0x28')]['ContactId'];return db['sequelize'][_0x3529('0x41')](_0x23b02c,{'type':db['Sequelize'][_0x3529('0x6d')][_0x3529('0x6e')],'raw':!![]})[_0x3529('0x20')](function(_0x42187f){return _0x42187f;});})[_0x3529('0x20')](function(_0x328ff7){if(_0x328ff7){_0x4e8551[_0x3529('0x28')][_0x3529('0x6f')]=_0x328ff7[0x0];if(!_0x1a2e98[_0x3529('0x58')][_0x3529('0x60')])return;return db[_0x3529('0x70')][_0x3529('0x56')]({'where':{'id':_0x1a2e98['body'][_0x3529('0x60')],'role':_0x3529('0x62')},'attributes':['id',_0x3529('0x39'),_0x3529('0x71'),'email',_0x3529('0x73')],'raw':!![]});}return null;})[_0x3529('0x20')](function(_0x2b76d0){if(!_0x2b76d0)return null;_0x4e8551[_0x3529('0x28')][_0x3529('0x62')]=_0x2b76d0;return _0x4e8551;})['then'](function(_0x20ed6a){if(_0x20ed6a){_0x20ed6a['message'][_0x3529('0x75')]=util[_0x3529('0x5e')](_0x3529('0x76'),_0x1a2e98['user'][_0x3529('0x39')]);_0x20ed6a[_0x3529('0x28')][_0x3529('0x77')]=_0x4e8551['channel'];_0x20ed6a[_0x3529('0x28')]['motionChannel']=_0x4e8551['channel'];_0x20ed6a[_0x3529('0x28')][_0x3529('0x79')]='reject';respondWithRpcPromise(_0x3529('0x7b'),'EventManager',{'event':'rejectmessage','message':_0x20ed6a[_0x3529('0x28')]},client9002);return _0x4e8551;}return null;})[_0x3529('0x20')](respondWithResult(_0x3b6043,null))[_0x3529('0x29')](handleError(_0x3b6043,null));};exports[_0x3529('0x2c')]=function(_0x2faffe,_0x3ca112,_0x22d13e){if(_0x2faffe['body']['id']){delete _0x2faffe[_0x3529('0x58')]['id'];}var _0xaaa247;return db[_0x3529('0x3d')][_0x3529('0x56')]({'where':{'id':_0x2faffe[_0x3529('0x53')]['id']}})[_0x3529('0x20')](handleEntityNotFound(_0x3ca112,null))[_0x3529('0x20')](function(_0x460913){if(_0x460913){_0xaaa247=_0x460913;return db[_0x3529('0x81')][_0x3529('0x56')]({'where':{'id':_0x460913[_0x3529('0x82')]}});}})[_0x3529('0x20')](handleEntityNotFound(_0x3ca112,null))[_0x3529('0x20')](function(_0x256427){if(_0x256427){logger[_0x3529('0x24')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x3529('0x2c'),'received\x20delivery\x20report\x20from',_0x256427[_0x3529('0x4d')],util[_0x3529('0x83')](_0x2faffe['body'],{'showHidden':![],'depth':null}));switch(_0x256427[_0x3529('0x4d')]){case'twilio':if(_0x2faffe['body']['MessageSid']&&_0x2faffe[_0x3529('0x58')]['MessageSid']===_0xaaa247[_0x3529('0x84')]&&_0x2faffe['body'][_0x3529('0x85')]&&_0x2faffe[_0x3529('0x58')][_0x3529('0x85')]==='read'){return _0xaaa247[_0x3529('0x37')]({'read':!![]});}else{logger[_0x3529('0x26')](_0x3529('0x86'),_0x3529('0x2c'),_0x3529('0x87'),util[_0x3529('0x83')](_0x2faffe[_0x3529('0x58')],{'showHidden':![],'depth':null}));}break;}return _0xaaa247;}})[_0x3529('0x20')](respondWithResult(_0x3ca112,null))['catch'](handleError(_0x3ca112,null));}; \ No newline at end of file +var _0xeff2=['query','keys','filters','attributes','intersection','fields','order','sort','pick','filter','merge','VIRTUAL','where','WhatsappMessage','includeAll','findAll','show','params','rawAttributes','length','create','body','find','catch','whatsapp-interactions','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','whatsapp','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','format','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','update','destroy','sendStatus','name','send','index','map','fieldName','type','model'];(function(_0x457585,_0x47e33a){var _0x1f96e1=function(_0x5be312){while(--_0x5be312){_0x457585['push'](_0x457585['shift']());}};_0x1f96e1(++_0x47e33a);}(_0xeff2,0x1e4));var _0x2eff=function(_0x4ad6db,_0xe4226a){_0x4ad6db=_0x4ad6db-0x0;var _0x195ea1=_0xeff2[_0x4ad6db];return _0x195ea1;};'use strict';var emlformat=require(_0x2eff('0x0'));var rimraf=require(_0x2eff('0x1'));var zipdir=require(_0x2eff('0x2'));var jsonpatch=require(_0x2eff('0x3'));var rp=require(_0x2eff('0x4'));var moment=require(_0x2eff('0x5'));var BPromise=require(_0x2eff('0x6'));var Mustache=require(_0x2eff('0x7'));var util=require(_0x2eff('0x8'));var path=require(_0x2eff('0x9'));var sox=require(_0x2eff('0xa'));var csv=require(_0x2eff('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2eff('0xc'));var _=require(_0x2eff('0xd'));var squel=require(_0x2eff('0xe'));var crypto=require(_0x2eff('0xf'));var jsforce=require(_0x2eff('0x10'));var deskjs=require(_0x2eff('0x11'));var toCsv=require(_0x2eff('0xb'));var querystring=require(_0x2eff('0x12'));var Papa=require(_0x2eff('0x13'));var Redis=require(_0x2eff('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x2eff('0x15'));var as=require(_0x2eff('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2eff('0x17'))('api');var utils=require(_0x2eff('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2eff('0x19'));var db=require('../../mysqldb')['db'];config[_0x2eff('0x1a')]=_[_0x2eff('0x1b')](config[_0x2eff('0x1a')],{'host':_0x2eff('0x1c'),'port':0x18eb});var socket=require(_0x2eff('0x1d'))(new Redis(config[_0x2eff('0x1a')]));require(_0x2eff('0x1e'))[_0x2eff('0x1f')](socket);var jayson=require(_0x2eff('0x20'));var client=jayson[_0x2eff('0x21')][_0x2eff('0x22')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x22d0c2,_0x2b89cc,_0x1eb448,_0xe118e0){return new BPromise(function(_0x3c882e,_0x35465d){var _0x1e2432=_0xe118e0||client;return _0x1e2432[_0x2eff('0x23')](_0x22d0c2,_0x1eb448)[_0x2eff('0x24')](function(_0x25ddc4){logger[_0x2eff('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x2b89cc,_0x2eff('0x26'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x2b89cc,_0x2eff('0x26'),JSON[_0x2eff('0x27')](_0x25ddc4));if(_0x25ddc4[_0x2eff('0x28')]){if(_0x25ddc4[_0x2eff('0x28')][_0x2eff('0x29')]===0x1f4){logger[_0x2eff('0x28')](_0x2eff('0x2a'),_0x2b89cc,_0x25ddc4['error'][_0x2eff('0x2b')]);return _0x35465d(_0x25ddc4[_0x2eff('0x28')][_0x2eff('0x2b')]);}logger[_0x2eff('0x28')](_0x2eff('0x2a'),_0x2b89cc,_0x25ddc4[_0x2eff('0x28')][_0x2eff('0x2b')]);return _0x3c882e(_0x25ddc4['error'][_0x2eff('0x2b')]);}else{logger['info'](_0x2eff('0x2a'),_0x2b89cc,_0x2eff('0x26'));_0x3c882e(_0x25ddc4['result']['message']);}})['catch'](function(_0x3115fe){logger[_0x2eff('0x28')]('WhatsappMessage,\x20%s,\x20%s',_0x2b89cc,_0x3115fe);_0x35465d(_0x3115fe);});});}function respondWithStatusCode(_0x1d5657,_0x495f48){_0x495f48=_0x495f48||0xcc;return function(_0x404349){if(_0x404349){return _0x1d5657['sendStatus'](_0x495f48);}return _0x1d5657[_0x2eff('0x2c')](_0x495f48)[_0x2eff('0x2d')]();};}function respondWithResult(_0x341a0e,_0x17cbb5){_0x17cbb5=_0x17cbb5||0xc8;return function(_0x244411){if(_0x244411){return _0x341a0e[_0x2eff('0x2c')](_0x17cbb5)[_0x2eff('0x2e')](_0x244411);}};}function respondWithFilteredResult(_0x2d788,_0x5a7433){return function(_0x3dbff9){if(_0x3dbff9){var _0x4714a7=typeof _0x5a7433[_0x2eff('0x2f')]===_0x2eff('0x30')&&typeof _0x5a7433['limit']===_0x2eff('0x30');var _0x44897b=_0x3dbff9[_0x2eff('0x31')];var _0x4fc54b=_0x4714a7?0x0:_0x5a7433[_0x2eff('0x2f')];var _0xd76844=_0x4714a7?_0x3dbff9['count']:_0x5a7433['offset']+_0x5a7433[_0x2eff('0x32')];var _0x9b6db8;if(_0xd76844>=_0x44897b){_0xd76844=_0x44897b;_0x9b6db8=0xc8;}else{_0x9b6db8=0xce;}_0x2d788['status'](_0x9b6db8);return _0x2d788['set'](_0x2eff('0x33'),_0x4fc54b+'-'+_0xd76844+'/'+_0x44897b)[_0x2eff('0x2e')](_0x3dbff9);}return null;};}function patchUpdates(_0x412ed0){return function(_0x174b1e){try{jsonpatch['apply'](_0x174b1e,_0x412ed0,!![]);}catch(_0x1621a3){return BPromise[_0x2eff('0x34')](_0x1621a3);}return _0x174b1e[_0x2eff('0x35')]();};}function saveUpdates(_0xe81230,_0x47f9cf){return function(_0x3a7df6){if(_0x3a7df6){return _0x3a7df6[_0x2eff('0x36')](_0xe81230)[_0x2eff('0x24')](function(_0x13d643){return _0x13d643;});}return null;};}function removeEntity(_0x2cc50b,_0x4d4a06){return function(_0x1df470){if(_0x1df470){return _0x1df470[_0x2eff('0x37')]()[_0x2eff('0x24')](function(){_0x2cc50b[_0x2eff('0x2c')](0xcc)[_0x2eff('0x2d')]();});}};}function handleEntityNotFound(_0x50b923,_0x3d5d68){return function(_0x236a55){if(!_0x236a55){_0x50b923[_0x2eff('0x38')](0x194);}return _0x236a55;};}function handleError(_0x862974,_0x26564){_0x26564=_0x26564||0x1f4;return function(_0x4b6bb4){logger['error'](_0x4b6bb4['stack']);if(_0x4b6bb4[_0x2eff('0x39')]){delete _0x4b6bb4[_0x2eff('0x39')];}_0x862974[_0x2eff('0x2c')](_0x26564)[_0x2eff('0x3a')](_0x4b6bb4);};}exports[_0x2eff('0x3b')]=function(_0xd37600,_0x5cce91){var _0x20c3ca={},_0x5d928a={},_0x27cb34={'count':0x0,'rows':[]};var _0x430f74=_[_0x2eff('0x3c')](db['WhatsappMessage']['rawAttributes'],function(_0x52b1ee){return{'name':_0x52b1ee[_0x2eff('0x3d')],'type':_0x52b1ee[_0x2eff('0x3e')]['key']};});_0x5d928a[_0x2eff('0x3f')]=_[_0x2eff('0x3c')](_0x430f74,_0x2eff('0x39'));_0x5d928a[_0x2eff('0x40')]=_[_0x2eff('0x41')](_0xd37600[_0x2eff('0x40')]);_0x5d928a[_0x2eff('0x42')]=_['intersection'](_0x5d928a[_0x2eff('0x3f')],_0x5d928a[_0x2eff('0x40')]);_0x20c3ca[_0x2eff('0x43')]=_[_0x2eff('0x44')](_0x5d928a[_0x2eff('0x3f')],qs[_0x2eff('0x45')](_0xd37600[_0x2eff('0x40')]['fields']));_0x20c3ca['attributes']=_0x20c3ca['attributes']['length']?_0x20c3ca[_0x2eff('0x43')]:_0x5d928a[_0x2eff('0x3f')];if(!_0xd37600[_0x2eff('0x40')]['hasOwnProperty']('nolimit')){_0x20c3ca['limit']=qs[_0x2eff('0x32')](_0xd37600[_0x2eff('0x40')][_0x2eff('0x32')]);_0x20c3ca[_0x2eff('0x2f')]=qs[_0x2eff('0x2f')](_0xd37600['query']['offset']);}_0x20c3ca[_0x2eff('0x46')]=qs[_0x2eff('0x47')](_0xd37600[_0x2eff('0x40')][_0x2eff('0x47')]);_0x20c3ca['where']=qs['filters'](_[_0x2eff('0x48')](_0xd37600[_0x2eff('0x40')],_0x5d928a['filters']),_0x430f74);if(_0xd37600[_0x2eff('0x40')][_0x2eff('0x49')]){_0x20c3ca['where']=_[_0x2eff('0x4a')](_0x20c3ca['where'],{'$or':_[_0x2eff('0x3c')](_0x430f74,function(_0x1e8225){if(_0x1e8225[_0x2eff('0x3e')]!==_0x2eff('0x4b')){var _0x580c7a={};_0x580c7a[_0x1e8225[_0x2eff('0x39')]]={'$like':'%'+_0xd37600[_0x2eff('0x40')][_0x2eff('0x49')]+'%'};return _0x580c7a;}})});}_0x20c3ca=_[_0x2eff('0x4a')]({},_0x20c3ca,_0xd37600['options']);var _0x508bf6={'where':_0x20c3ca[_0x2eff('0x4c')]};return db[_0x2eff('0x4d')][_0x2eff('0x31')](_0x508bf6)[_0x2eff('0x24')](function(_0x297e17){_0x27cb34[_0x2eff('0x31')]=_0x297e17;if(_0xd37600[_0x2eff('0x40')][_0x2eff('0x4e')]){_0x20c3ca['include']=[{'all':!![]}];}return db[_0x2eff('0x4d')][_0x2eff('0x4f')](_0x20c3ca);})[_0x2eff('0x24')](function(_0x2463c3){_0x27cb34['rows']=_0x2463c3;return _0x27cb34;})[_0x2eff('0x24')](respondWithFilteredResult(_0x5cce91,_0x20c3ca))['catch'](handleError(_0x5cce91,null));};exports[_0x2eff('0x50')]=function(_0x613db2,_0x19d767){var _0x1d5ae2={'raw':!![],'where':{'id':_0x613db2[_0x2eff('0x51')]['id']}},_0x1f7772={};_0x1f7772[_0x2eff('0x3f')]=_[_0x2eff('0x41')](db['WhatsappMessage'][_0x2eff('0x52')]);_0x1f7772['query']=_[_0x2eff('0x41')](_0x613db2[_0x2eff('0x40')]);_0x1f7772[_0x2eff('0x42')]=_[_0x2eff('0x44')](_0x1f7772[_0x2eff('0x3f')],_0x1f7772['query']);_0x1d5ae2[_0x2eff('0x43')]=_[_0x2eff('0x44')](_0x1f7772['model'],qs[_0x2eff('0x45')](_0x613db2['query'][_0x2eff('0x45')]));_0x1d5ae2['attributes']=_0x1d5ae2[_0x2eff('0x43')][_0x2eff('0x53')]?_0x1d5ae2[_0x2eff('0x43')]:_0x1f7772[_0x2eff('0x3f')];if(_0x613db2[_0x2eff('0x40')][_0x2eff('0x4e')]){_0x1d5ae2['include']=[{'all':!![]}];}_0x1d5ae2=_[_0x2eff('0x4a')]({},_0x1d5ae2,_0x613db2['options']);return db[_0x2eff('0x4d')]['find'](_0x1d5ae2)['then'](handleEntityNotFound(_0x19d767,null))[_0x2eff('0x24')](respondWithResult(_0x19d767,null))['catch'](handleError(_0x19d767,null));};exports[_0x2eff('0x54')]=function(_0x5ed372,_0x2ac0ec){return db[_0x2eff('0x4d')][_0x2eff('0x54')](_0x5ed372[_0x2eff('0x55')],{})[_0x2eff('0x24')](respondWithResult(_0x2ac0ec,0xc9))['catch'](handleError(_0x2ac0ec,null));};exports['update']=function(_0x1eb5ef,_0x2c370c){if(_0x1eb5ef[_0x2eff('0x55')]['id']){delete _0x1eb5ef[_0x2eff('0x55')]['id'];}return db[_0x2eff('0x4d')][_0x2eff('0x56')]({'where':{'id':_0x1eb5ef[_0x2eff('0x51')]['id']}})[_0x2eff('0x24')](handleEntityNotFound(_0x2c370c,null))['then'](saveUpdates(_0x1eb5ef[_0x2eff('0x55')],null))[_0x2eff('0x24')](respondWithResult(_0x2c370c,null))[_0x2eff('0x57')](handleError(_0x2c370c,null));};exports[_0x2eff('0x37')]=function(_0x32364e,_0xc42f61){return db[_0x2eff('0x4d')][_0x2eff('0x56')]({'where':{'id':_0x32364e[_0x2eff('0x51')]['id']}})[_0x2eff('0x24')](handleEntityNotFound(_0xc42f61,null))['then'](removeEntity(_0xc42f61,null))[_0x2eff('0x57')](handleError(_0xc42f61,null));};exports['describe']=function(_0x482244,_0x5ea6f6){return db[_0x2eff('0x4d')]['describe']()[_0x2eff('0x24')](respondWithResult(_0x5ea6f6,null))[_0x2eff('0x57')](handleError(_0x5ea6f6,null));};var interaction_log=require(_0x2eff('0x17'))(_0x2eff('0x58'));exports[_0x2eff('0x59')]=function(_0x12285b,_0x405f6e,_0x2cf10a){var _0x4a4f31={'agent':{},'channel':'whatsapp'};if(_0x12285b[_0x2eff('0x55')]['id']){delete _0x12285b[_0x2eff('0x55')]['id'];}_0x12285b['body'][_0x2eff('0x5a')]=!![];_0x12285b['body'][_0x2eff('0x5b')]=moment()['format'](_0x2eff('0x5c'));_0x12285b[_0x2eff('0x55')][_0x2eff('0x5d')]=_0x12285b[_0x2eff('0x55')][_0x2eff('0x5d')]||_0x12285b[_0x2eff('0x5e')]['id'];_0x4a4f31[_0x2eff('0x5f')]['id']=_0x12285b[_0x2eff('0x55')][_0x2eff('0x5d')];return db['WhatsappMessage']['find']({'where':{'id':_0x12285b[_0x2eff('0x51')]['id'],'UserId':null}})[_0x2eff('0x24')](handleEntityNotFound(_0x405f6e,null))[_0x2eff('0x24')](saveUpdates(_0x12285b['body'],null))[_0x2eff('0x24')](function(_0x55d3fd){if(_0x55d3fd){_0x4a4f31[_0x2eff('0x2b')]=_0x55d3fd['get']({'plain':!![]});return db[_0x2eff('0x60')]['find']({'where':{'id':_0x55d3fd[_0x2eff('0x61')]}});}return null;})[_0x2eff('0x24')](handleEntityNotFound(_0x405f6e,null))['then'](function(_0x429919){if(_0x429919){return _0x429919[_0x2eff('0x36')]({'UserId':_0x12285b[_0x2eff('0x55')][_0x2eff('0x5d')],'read1stAt':_[_0x2eff('0x62')](_0x429919[_0x2eff('0x63')])?moment()['format'](_0x2eff('0x5c')):undefined});}return null;})[_0x2eff('0x24')](function(_0x1caba7){if(_0x1caba7){_0x4a4f31[_0x2eff('0x64')]=_0x1caba7[_0x2eff('0x65')]({'plain':!![]});interaction_log[_0x2eff('0x25')](_0x2eff('0x66'),_0x12285b[_0x2eff('0x5e')]['id'],_0x12285b['user'][_0x2eff('0x39')],_0x12285b[_0x2eff('0x5e')][_0x2eff('0x67')],_0x4a4f31[_0x2eff('0x64')]['id'],_0x12285b[_0x2eff('0x55')]?JSON[_0x2eff('0x27')](_0x12285b[_0x2eff('0x55')]):_0x2eff('0x68'));return respondWithRpcPromise(_0x2eff('0x69'),'acceptMessage',_0x4a4f31);}return null;})['then'](function(_0x1dd60c){var _0x523cda=_0x2eff('0x6a')+_0x1dd60c['message'][_0x2eff('0x6b')];return db[_0x2eff('0x6c')]['query'](_0x523cda,{'type':db[_0x2eff('0x6d')][_0x2eff('0x6e')][_0x2eff('0x6f')],'raw':!![]})[_0x2eff('0x24')](function(_0x1ad618){return _0x1ad618;});})[_0x2eff('0x24')](function(_0x3f855f){if(_0x3f855f){_0x4a4f31[_0x2eff('0x2b')][_0x2eff('0x70')]=_0x3f855f[0x0];if(!_0x12285b[_0x2eff('0x55')]['UserId'])return;return db[_0x2eff('0x71')][_0x2eff('0x56')]({'where':{'id':_0x12285b[_0x2eff('0x55')][_0x2eff('0x5d')],'role':'agent'},'attributes':['id',_0x2eff('0x39'),'fullname',_0x2eff('0x72'),_0x2eff('0x73')],'raw':!![]});}return null;})['then'](function(_0x5befed){if(!_0x5befed)return null;_0x4a4f31[_0x2eff('0x2b')][_0x2eff('0x5f')]=_0x5befed;return _0x4a4f31;})[_0x2eff('0x24')](function(_0x4ed94f){if(_0x4ed94f){if(_0x12285b['body'][_0x2eff('0x74')]){_0x4a4f31['message'][_0x2eff('0x75')]=util['format'](_0x2eff('0x76'),_0x12285b[_0x2eff('0x5e')]['name']);_0x4a4f31[_0x2eff('0x2b')][_0x2eff('0x77')]=_0x4a4f31[_0x2eff('0x77')];_0x4a4f31[_0x2eff('0x2b')][_0x2eff('0x78')]=_0x4a4f31['channel'];_0x4a4f31[_0x2eff('0x2b')]['event']=_0x2eff('0x59');return respondWithRpcPromise(_0x2eff('0x79'),_0x2eff('0x79'),{'event':'acceptmessage','message':_0x4a4f31[_0x2eff('0x2b')]},client9002)[_0x2eff('0x24')](function(){return _0x4a4f31;});}return _0x4a4f31;}return null;})[_0x2eff('0x24')](respondWithResult(_0x405f6e,null))[_0x2eff('0x57')](handleError(_0x405f6e,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0x2eff('0x34')]=function(_0x3dd6c7,_0x23dd61,_0x4ed004){var _0x36f44d={'agent':{},'channel':_0x2eff('0x7a')};if(_0x3dd6c7[_0x2eff('0x55')]['id']){delete _0x3dd6c7['body']['id'];}_0x3dd6c7[_0x2eff('0x55')][_0x2eff('0x5d')]=_0x3dd6c7[_0x2eff('0x55')][_0x2eff('0x5d')]||_0x3dd6c7[_0x2eff('0x5e')]['id'];_0x36f44d['agent']['id']=_0x3dd6c7['body'][_0x2eff('0x5d')];return db[_0x2eff('0x4d')][_0x2eff('0x56')]({'where':{'id':_0x3dd6c7[_0x2eff('0x51')]['id'],'UserId':null}})[_0x2eff('0x24')](handleEntityNotFound(_0x23dd61,null))[_0x2eff('0x24')](function(_0x49c3c1){if(_0x49c3c1){_0x36f44d['message']=_0x49c3c1[_0x2eff('0x65')]({'plain':!![]});return db[_0x2eff('0x60')]['find']({'where':{'id':_0x49c3c1['WhatsappInteractionId']}});}return null;})[_0x2eff('0x24')](handleEntityNotFound(_0x23dd61,null))['then'](function(_0x40a1f8){if(_0x40a1f8){_0x36f44d['interaction']=_0x40a1f8[_0x2eff('0x65')]({'plain':!![]});interaction_log[_0x2eff('0x25')](_0x2eff('0x7b'),_0x3dd6c7['user']['id'],_0x3dd6c7[_0x2eff('0x5e')][_0x2eff('0x39')],_0x3dd6c7[_0x2eff('0x5e')][_0x2eff('0x67')],_0x36f44d['interaction']['id'],_0x3dd6c7[_0x2eff('0x55')]?JSON['stringify'](_0x3dd6c7[_0x2eff('0x55')]):_0x2eff('0x68'));return respondWithRpcPromise(_0x2eff('0x7c'),'rejectMessage',_0x36f44d);}return null;})['then'](function(_0x523b0f){var _0x4487df='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x523b0f[_0x2eff('0x2b')]['ContactId'];return db[_0x2eff('0x6c')][_0x2eff('0x40')](_0x4487df,{'type':db['Sequelize'][_0x2eff('0x6e')][_0x2eff('0x6f')],'raw':!![]})[_0x2eff('0x24')](function(_0x1effc6){return _0x1effc6;});})[_0x2eff('0x24')](function(_0x2bcd74){if(_0x2bcd74){_0x36f44d[_0x2eff('0x2b')][_0x2eff('0x70')]=_0x2bcd74[0x0];if(!_0x3dd6c7[_0x2eff('0x55')][_0x2eff('0x5d')])return;return db[_0x2eff('0x71')]['find']({'where':{'id':_0x3dd6c7['body'][_0x2eff('0x5d')],'role':'agent'},'attributes':['id',_0x2eff('0x39'),'fullname',_0x2eff('0x72'),_0x2eff('0x73')],'raw':!![]});}return null;})[_0x2eff('0x24')](function(_0x480551){if(!_0x480551)return null;_0x36f44d[_0x2eff('0x2b')][_0x2eff('0x5f')]=_0x480551;return _0x36f44d;})[_0x2eff('0x24')](function(_0xebac98){if(_0xebac98){_0xebac98[_0x2eff('0x2b')]['interface']=util[_0x2eff('0x7d')](_0x2eff('0x76'),_0x3dd6c7[_0x2eff('0x5e')]['name']);_0xebac98[_0x2eff('0x2b')][_0x2eff('0x77')]=_0x36f44d[_0x2eff('0x77')];_0xebac98[_0x2eff('0x2b')][_0x2eff('0x78')]=_0x36f44d[_0x2eff('0x77')];_0xebac98[_0x2eff('0x2b')]['event']=_0x2eff('0x34');respondWithRpcPromise(_0x2eff('0x79'),_0x2eff('0x79'),{'event':_0x2eff('0x7e'),'message':_0xebac98[_0x2eff('0x2b')]},client9002);return _0x36f44d;}return null;})[_0x2eff('0x24')](respondWithResult(_0x23dd61,null))[_0x2eff('0x57')](handleError(_0x23dd61,null));};exports[_0x2eff('0x2c')]=function(_0x4ed3,_0x1d0d52,_0x5290a7){if(_0x4ed3[_0x2eff('0x55')]['id']){delete _0x4ed3[_0x2eff('0x55')]['id'];}var _0x2e5d56;return db[_0x2eff('0x4d')][_0x2eff('0x56')]({'where':{'id':_0x4ed3[_0x2eff('0x51')]['id']}})[_0x2eff('0x24')](handleEntityNotFound(_0x1d0d52,null))[_0x2eff('0x24')](function(_0x502172){if(_0x502172){_0x2e5d56=_0x502172;return db[_0x2eff('0x7f')][_0x2eff('0x56')]({'where':{'id':_0x502172[_0x2eff('0x80')]}});}})[_0x2eff('0x24')](handleEntityNotFound(_0x1d0d52,null))[_0x2eff('0x24')](function(_0x229df4){if(_0x229df4){logger[_0x2eff('0x81')](_0x2eff('0x82'),_0x2eff('0x2c'),_0x2eff('0x83'),_0x229df4[_0x2eff('0x3e')],util['inspect'](_0x4ed3['body'],{'showHidden':![],'depth':null}));switch(_0x229df4[_0x2eff('0x3e')]){case _0x2eff('0x84'):if(_0x4ed3[_0x2eff('0x55')][_0x2eff('0x85')]&&_0x4ed3[_0x2eff('0x55')][_0x2eff('0x85')]===_0x2e5d56[_0x2eff('0x86')]&&_0x4ed3[_0x2eff('0x55')][_0x2eff('0x87')]&&_0x4ed3[_0x2eff('0x55')][_0x2eff('0x87')]===_0x2eff('0x5a')){return _0x2e5d56['update']({'read':!![]});}else{logger[_0x2eff('0x28')](_0x2eff('0x88'),_0x2eff('0x2c'),'twilio',util['inspect'](_0x4ed3[_0x2eff('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x2e5d56;}})[_0x2eff('0x24')](respondWithResult(_0x1d0d52,null))[_0x2eff('0x57')](handleError(_0x1d0d52,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 6bd24d0..a43899f 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 _0xde2c=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappMessage'];(function(_0x36f243,_0x188505){var _0x426436=function(_0x1c8622){while(--_0x1c8622){_0x36f243['push'](_0x36f243['shift']());}};_0x426436(++_0x188505);}(_0xde2c,0x7f));var _0xcde2=function(_0xf5d71c,_0x2613a6){_0xf5d71c=_0xf5d71c-0x0;var _0x5af672=_0xde2c[_0xf5d71c];return _0x5af672;};'use strict';var EventEmitter=require(_0xcde2('0x0'));var WhatsappMessage=require(_0xcde2('0x1'))['db'][_0xcde2('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xcde2('0x3')](0x0);var events={'afterCreate':_0xcde2('0x4'),'afterUpdate':_0xcde2('0x5'),'afterDestroy':_0xcde2('0x6')};function emitEvent(_0x3a309f){return function(_0x55c175,_0x4353c8,_0x196898){WhatsappMessageEvents[_0xcde2('0x7')](_0x3a309f+':'+_0x55c175['id'],_0x55c175);WhatsappMessageEvents[_0xcde2('0x7')](_0x3a309f,_0x55c175);_0x196898(null);};}for(var e in events){if(events[_0xcde2('0x8')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xcde2('0x9')]=WhatsappMessageEvents; \ No newline at end of file +var _0x9861=['remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update'];(function(_0x99dec5,_0x134f43){var _0x2a1864=function(_0x3fe66e){while(--_0x3fe66e){_0x99dec5['push'](_0x99dec5['shift']());}};_0x2a1864(++_0x134f43);}(_0x9861,0x176));var _0x1986=function(_0x500bd6,_0x1f00b1){_0x500bd6=_0x500bd6-0x0;var _0x27db18=_0x9861[_0x500bd6];return _0x27db18;};'use strict';var EventEmitter=require(_0x1986('0x0'));var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x1986('0x1')](0x0);var events={'afterCreate':_0x1986('0x2'),'afterUpdate':_0x1986('0x3'),'afterDestroy':_0x1986('0x4')};function emitEvent(_0x2c59a4){return function(_0x44e5c9,_0x5462a7,_0xe033ef){WhatsappMessageEvents[_0x1986('0x5')](_0x2c59a4+':'+_0x44e5c9['id'],_0x44e5c9);WhatsappMessageEvents[_0x1986('0x5')](_0x2c59a4,_0x44e5c9);_0xe033ef(null);};}for(var e in events){if(events[_0x1986('0x6')](e)){var event=events[e];WhatsappMessage[_0x1986('0x7')](e,emitEvent(event));}}module[_0x1986('0x8')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index e12a394..be67238 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 _0x3472=['out','secret','isNil','findOne','then','update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','authToken','phone','messages','create','body','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','accountSid','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','statuses','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./whatsappMessage.attributes','WhatsappMessage','models','direction','toLowerCase'];(function(_0x379c88,_0x4c76ef){var _0x34b21e=function(_0x3d7166){while(--_0x3d7166){_0x379c88['push'](_0x379c88['shift']());}};_0x34b21e(++_0x4c76ef);}(_0x3472,0xf8));var _0x2347=function(_0xe332c3,_0x3ca405){_0xe332c3=_0xe332c3-0x0;var _0x1d6ada=_0x3472[_0xe332c3];return _0x1d6ada;};'use strict';var _=require('lodash');var util=require(_0x2347('0x0'));var logger=require(_0x2347('0x1'))('api');var moment=require(_0x2347('0x2'));var BPromise=require(_0x2347('0x3'));var rp=require(_0x2347('0x4'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x2347('0x5'));var rimraf=require('rimraf');var config=require(_0x2347('0x6'));var attributes=require(_0x2347('0x7'));module['exports']=function(_0x6ded3,_0x5460b1){return _0x6ded3['define'](_0x2347('0x8'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':'fti_whatsapp_messages','fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5d1b72,_0x375f2a,_0x27cd95){var _0x42e317=_0x6ded3[_0x2347('0x9')];var _0x5f4a69=_0x5d1b72['get']({'plain':!![]});if(_0x5f4a69[_0x2347('0xa')][_0x2347('0xb')]()==='in'||_0x5f4a69[_0x2347('0xa')][_0x2347('0xb')]()===_0x2347('0xc')&&!_0x5f4a69[_0x2347('0xd')]&&!_[_0x2347('0xe')](_0x5f4a69['UserId'])){_0x42e317['WhatsappInteraction'][_0x2347('0xf')]({'where':{'id':_0x5f4a69['WhatsappInteractionId']}})[_0x2347('0x10')](function(_0x5c4605){if(_0x5c4605){_0x5c4605[_0x2347('0x11')]({'lastMsgAt':_0x5f4a69[_0x2347('0x12')],'lastMsgDirection':_0x5f4a69[_0x2347('0xa')][_0x2347('0xb')]()});}})[_0x2347('0x13')](function(_0x51b4ce){console[_0x2347('0x14')](_0x51b4ce);});}if(_0x5f4a69[_0x2347('0xa')]===_0x2347('0xc')&&!_0x5f4a69[_0x2347('0xd')]){var _0x2a59e6;_0x42e317[_0x2347('0x15')][_0x2347('0x16')]({'where':{'id':_0x5f4a69[_0x2347('0x17')]},'raw':!![]})[_0x2347('0x10')](function(_0x5217c2){_0x2a59e6=_0x5217c2;if(_0x2a59e6&&_0x2a59e6[_0x2347('0x18')]){switch(_0x2a59e6[_0x2347('0x18')]){case _0x2347('0x19'):var _0x3f2633=require(_0x2347('0x19'));if(_0x2a59e6['accountSid']&&_0x2a59e6[_0x2347('0x1a')]&&_0x2a59e6[_0x2347('0x1b')]){var _0x3ebfc0=new _0x3f2633(_0x2a59e6['accountSid'],_0x2a59e6['authToken']);_0x3ebfc0[_0x2347('0x1c')][_0x2347('0x1d')]({'body':_0x5f4a69[_0x2347('0x1e')],'to':_0x2347('0x1f')+_0x5f4a69[_0x2347('0x1b')],'from':_0x2347('0x1f')+_0x2a59e6[_0x2347('0x1b')],'statusCallback':_0x2a59e6[_0x2347('0x20')]+_0x2347('0x21')+_0x5f4a69['id']+_0x2347('0x22')+_0x2a59e6[_0x2347('0x23')]})[_0x2347('0x10')](function(_0x48295c){if(_0x48295c[_0x2347('0x24')]){return _0x5d1b72['update']({'messageId':_0x48295c['sid']});}})[_0x2347('0x13')](function(_0x45981d){logger[_0x2347('0x14')](_0x2347('0x25'),_0x2347('0x26'),'twilio',util[_0x2347('0x27')](_0x45981d,{'showHidden':![],'depth':null}));});}else{logger[_0x2347('0x14')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x2347('0x26'),_0x2347('0x19'),_0x2347('0x28'));}break;case _0x2347('0x29'):var _0x343102=_0x2a59e6[_0x2347('0x2a')];var _0x217965=_0x2a59e6['authToken'];var _0x596b1d=_0x2a59e6[_0x2347('0x2b')]+_0x2347('0x2c')+_0x343102+_0x2347('0x2d');var _0x36f1e6={'to':[_0x5f4a69[_0x2347('0x1b')]],'message':{'type':_0x2347('0x2e'),'text':_0x5f4a69[_0x2347('0x1e')]}};var _0x23e065={'method':_0x2347('0x2f'),'uri':_0x596b1d,'headers':{'Authorization':_0x2347('0x30')+_0x217965,'Content-Type':'application/json'},'body':_0x36f1e6,'json':!![]};rp(_0x23e065)['then'](function(_0x469ad3){if(_0x469ad3[_0x2347('0x31')][0x0]['message_id']){return _0x5d1b72[_0x2347('0x11')]({'messageId':_0x469ad3[_0x2347('0x31')][0x0]['message_id']});}})['catch'](function(_0x3561ad){logger['err']('WhatsappMessage,\x20%s',_0x3561ad);});break;}}})['finally'](function(){_0x27cd95();});}else{_0x27cd95();}}},'charset':_0x2347('0x32'),'collate':_0x2347('0x33')});}; \ No newline at end of file +var _0x6b60=['message_id','statuses','WhatsappMessage,\x20%s','finally','utf8mb4','util','api','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','fti_whatsapp_messages','body','models','direction','toLowerCase','secret','isNil','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','catch','error','out','WhatsappAccount','WhatsappAccountId','type','twilio','authToken','accountSid','messages','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token=','token','sid','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','POST','application/json'];(function(_0x1e3ff4,_0x4d42ff){var _0x3836ff=function(_0x5ca286){while(--_0x5ca286){_0x1e3ff4['push'](_0x1e3ff4['shift']());}};_0x3836ff(++_0x4d42ff);}(_0x6b60,0xe9));var _0x06b6=function(_0x466af7,_0x2f7551){_0x466af7=_0x466af7-0x0;var _0x348c96=_0x6b60[_0x466af7];return _0x348c96;};'use strict';var _=require('lodash');var util=require(_0x06b6('0x0'));var logger=require('../../config/logger')(_0x06b6('0x1'));var moment=require(_0x06b6('0x2'));var BPromise=require(_0x06b6('0x3'));var rp=require(_0x06b6('0x4'));var fetch=require(_0x06b6('0x5'));var fs=require('fs');var path=require(_0x06b6('0x6'));var rimraf=require(_0x06b6('0x7'));var config=require(_0x06b6('0x8'));var attributes=require(_0x06b6('0x9'));module[_0x06b6('0xa')]=function(_0x44ba36,_0x157746){return _0x44ba36[_0x06b6('0xb')](_0x06b6('0xc'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x06b6('0xd'),'fields':[_0x06b6('0xd')]},{'name':_0x06b6('0xe'),'fields':[_0x06b6('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3517bf,_0x8ed04e,_0x6c07ac){var _0x123ff6=_0x44ba36[_0x06b6('0x10')];var _0x5ba199=_0x3517bf['get']({'plain':!![]});if(_0x5ba199[_0x06b6('0x11')]['toLowerCase']()==='in'||_0x5ba199[_0x06b6('0x11')][_0x06b6('0x12')]()==='out'&&!_0x5ba199[_0x06b6('0x13')]&&!_[_0x06b6('0x14')](_0x5ba199['UserId'])){_0x123ff6[_0x06b6('0x15')][_0x06b6('0x16')]({'where':{'id':_0x5ba199[_0x06b6('0x17')]}})[_0x06b6('0x18')](function(_0xbec46){if(_0xbec46){_0xbec46[_0x06b6('0x19')]({'lastMsgAt':_0x5ba199['createdAt'],'lastMsgDirection':_0x5ba199[_0x06b6('0x11')][_0x06b6('0x12')]()});}})[_0x06b6('0x1a')](function(_0x429197){console[_0x06b6('0x1b')](_0x429197);});}if(_0x5ba199['direction']===_0x06b6('0x1c')&&!_0x5ba199['secret']){var _0x454da5;_0x123ff6[_0x06b6('0x1d')]['find']({'where':{'id':_0x5ba199[_0x06b6('0x1e')]},'raw':!![]})[_0x06b6('0x18')](function(_0x4e233a){_0x454da5=_0x4e233a;if(_0x454da5&&_0x454da5[_0x06b6('0x1f')]){switch(_0x454da5[_0x06b6('0x1f')]){case _0x06b6('0x20'):var _0x4b2f55=require(_0x06b6('0x20'));if(_0x454da5['accountSid']&&_0x454da5[_0x06b6('0x21')]&&_0x454da5['phone']){var _0x309998=new _0x4b2f55(_0x454da5[_0x06b6('0x22')],_0x454da5[_0x06b6('0x21')]);_0x309998[_0x06b6('0x23')]['create']({'body':_0x5ba199[_0x06b6('0xf')],'to':_0x06b6('0x24')+_0x5ba199['phone'],'from':'whatsapp:'+_0x454da5[_0x06b6('0x25')],'statusCallback':_0x454da5[_0x06b6('0x26')]+_0x06b6('0x27')+_0x5ba199['id']+_0x06b6('0x28')+_0x454da5[_0x06b6('0x29')]})[_0x06b6('0x18')](function(_0x1f8116){if(_0x1f8116[_0x06b6('0x2a')]){return _0x3517bf[_0x06b6('0x19')]({'messageId':_0x1f8116[_0x06b6('0x2a')]});}})[_0x06b6('0x1a')](function(_0x55122f){logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x06b6('0x2b'),'twilio',util[_0x06b6('0x2c')](_0x55122f,{'showHidden':![],'depth':null}));});}else{logger[_0x06b6('0x1b')](_0x06b6('0x2d'),_0x06b6('0x2b'),_0x06b6('0x20'),_0x06b6('0x2e'));}break;case _0x06b6('0x2f'):var _0x55de01=_0x454da5[_0x06b6('0x22')];var _0x52fb29=_0x454da5[_0x06b6('0x21')];var _0x25b2b5=_0x454da5[_0x06b6('0x30')]+_0x06b6('0x31')+_0x55de01+'/messages/';var _0x116e1b={'to':[_0x5ba199['phone']],'message':{'type':'text','text':_0x5ba199['body']}};var _0x5b2543={'method':_0x06b6('0x32'),'uri':_0x25b2b5,'headers':{'Authorization':'Bearer\x20'+_0x52fb29,'Content-Type':_0x06b6('0x33')},'body':_0x116e1b,'json':!![]};rp(_0x5b2543)[_0x06b6('0x18')](function(_0x200a94){if(_0x200a94['statuses'][0x0][_0x06b6('0x34')]){return _0x3517bf[_0x06b6('0x19')]({'messageId':_0x200a94[_0x06b6('0x35')][0x0][_0x06b6('0x34')]});}})[_0x06b6('0x1a')](function(_0x535c45){logger['err'](_0x06b6('0x36'),_0x535c45);});break;}}})[_0x06b6('0x37')](function(){_0x6c07ac();});}else{_0x6c07ac();}}},'charset':_0x06b6('0x38'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 26a514e..27c9f85 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 _0x745c=['raw','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','then','info','request\x20sent','debug','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','CreateWhatsappMessage','create','options'];(function(_0xaea2b8,_0xc36e6c){var _0x48ca5a=function(_0x5a591d){while(--_0x5a591d){_0xaea2b8['push'](_0xaea2b8['shift']());}};_0x48ca5a(++_0xc36e6c);}(_0x745c,0xe9));var _0xc745=function(_0x891b81,_0xfbb107){_0x891b81=_0x891b81-0x0;var _0x585932=_0x745c[_0x891b81];return _0x585932;};'use strict';var _=require(_0xc745('0x0'));var util=require('util');var moment=require(_0xc745('0x1'));var BPromise=require(_0xc745('0x2'));var rs=require(_0xc745('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc745('0x4'))['db'];var utils=require(_0xc745('0x5'));var logger=require('../../config/logger')(_0xc745('0x6'));var config=require(_0xc745('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc745('0x8')][_0xc745('0x9')]({'port':0x232a});config[_0xc745('0xa')]=_['defaults'](config['redis'],{'host':_0xc745('0xb'),'port':0x18eb});var socket=require(_0xc745('0xc'))(new Redis(config[_0xc745('0xa')]));require(_0xc745('0xd'))[_0xc745('0xe')](socket);function respondWithRpcPromise(_0x2468a6,_0x1669ce,_0x58a23d){return new BPromise(function(_0x10fd94,_0x117511){return client['request'](_0x2468a6,_0x58a23d)[_0xc745('0xf')](function(_0x1b6c46){logger[_0xc745('0x10')]('WhatsappMessage,\x20%s,\x20%s',_0x1669ce,_0xc745('0x11'));logger[_0xc745('0x12')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x1669ce,_0xc745('0x11'),JSON[_0xc745('0x13')](_0x1b6c46));if(_0x1b6c46[_0xc745('0x14')]){if(_0x1b6c46[_0xc745('0x14')][_0xc745('0x15')]===0x1f4){logger[_0xc745('0x14')](_0xc745('0x16'),_0x1669ce,_0x1b6c46[_0xc745('0x14')][_0xc745('0x17')]);return _0x117511(_0x1b6c46['error'][_0xc745('0x17')]);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x1669ce,_0x1b6c46[_0xc745('0x14')][_0xc745('0x17')]);return _0x10fd94(_0x1b6c46[_0xc745('0x14')][_0xc745('0x17')]);}else{logger['info'](_0xc745('0x16'),_0x1669ce,_0xc745('0x11'));_0x10fd94(_0x1b6c46[_0xc745('0x18')][_0xc745('0x17')]);}})['catch'](function(_0xe9df32){logger[_0xc745('0x14')](_0xc745('0x16'),_0x1669ce,_0xe9df32);_0x117511(_0xe9df32);});});}exports[_0xc745('0x19')]=function(_0x27e4c2){var _0x33cab9=this;return new Promise(function(_0x579139,_0xa7af25){return db['WhatsappMessage'][_0xc745('0x1a')](_0x27e4c2['body'],{'raw':_0x27e4c2['options']?_0x27e4c2[_0xc745('0x1b')][_0xc745('0x1c')]===undefined?!![]:![]:!![]})[_0xc745('0xf')](function(_0x29a750){logger[_0xc745('0x10')](_0xc745('0x19'),_0x27e4c2);logger[_0xc745('0x12')](_0xc745('0x19'),_0x27e4c2,JSON[_0xc745('0x13')](_0x29a750));_0x579139(_0x29a750);})['catch'](function(_0x55ef60){logger[_0xc745('0x14')](_0xc745('0x19'),_0x55ef60[_0xc745('0x17')],_0x27e4c2);_0xa7af25(_0x33cab9[_0xc745('0x14')](0x1f4,_0x55ef60['message']));});});}; \ No newline at end of file +var _0x03e4=['request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','WhatsappMessage,\x20%s,\x20%s','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info'];(function(_0x33eeca,_0x1d5c35){var _0xe36780=function(_0x5784f3){while(--_0x5784f3){_0x33eeca['push'](_0x33eeca['shift']());}};_0xe36780(++_0x1d5c35);}(_0x03e4,0xe6));var _0x403e=function(_0x30780e,_0x537b34){_0x30780e=_0x30780e-0x0;var _0x5b9129=_0x03e4[_0x30780e];return _0x5b9129;};'use strict';var _=require(_0x403e('0x0'));var util=require(_0x403e('0x1'));var moment=require(_0x403e('0x2'));var BPromise=require(_0x403e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x403e('0x4'));var db=require(_0x403e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x403e('0x6'))(_0x403e('0x7'));var config=require('../../config/environment');var jayson=require(_0x403e('0x8'));var client=jayson[_0x403e('0x9')]['http']({'port':0x232a});config[_0x403e('0xa')]=_[_0x403e('0xb')](config[_0x403e('0xa')],{'host':_0x403e('0xc'),'port':0x18eb});var socket=require(_0x403e('0xd'))(new Redis(config['redis']));require('./whatsappMessage.socket')[_0x403e('0xe')](socket);function respondWithRpcPromise(_0x40d76d,_0x2494ba,_0x2ad401){return new BPromise(function(_0x48a664,_0x24951f){return client[_0x403e('0xf')](_0x40d76d,_0x2ad401)[_0x403e('0x10')](function(_0x38b5a4){logger[_0x403e('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x2494ba,_0x403e('0x12'));logger['debug'](_0x403e('0x13'),_0x2494ba,_0x403e('0x12'),JSON['stringify'](_0x38b5a4));if(_0x38b5a4[_0x403e('0x14')]){if(_0x38b5a4['error']['code']===0x1f4){logger['error'](_0x403e('0x15'),_0x2494ba,_0x38b5a4[_0x403e('0x14')][_0x403e('0x16')]);return _0x24951f(_0x38b5a4[_0x403e('0x14')][_0x403e('0x16')]);}logger[_0x403e('0x14')](_0x403e('0x15'),_0x2494ba,_0x38b5a4[_0x403e('0x14')][_0x403e('0x16')]);return _0x48a664(_0x38b5a4[_0x403e('0x14')][_0x403e('0x16')]);}else{logger[_0x403e('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x2494ba,_0x403e('0x12'));_0x48a664(_0x38b5a4[_0x403e('0x17')][_0x403e('0x16')]);}})[_0x403e('0x18')](function(_0x1c67dd){logger[_0x403e('0x14')](_0x403e('0x15'),_0x2494ba,_0x1c67dd);_0x24951f(_0x1c67dd);});});}exports[_0x403e('0x19')]=function(_0x1a4b8d){var _0x3a0ec7=this;return new Promise(function(_0x5b8ed7,_0x1d042b){return db[_0x403e('0x1a')][_0x403e('0x1b')](_0x1a4b8d['body'],{'raw':_0x1a4b8d[_0x403e('0x1c')]?_0x1a4b8d[_0x403e('0x1c')][_0x403e('0x1d')]===undefined?!![]:![]:!![]})[_0x403e('0x10')](function(_0x3bdd22){logger[_0x403e('0x11')](_0x403e('0x19'),_0x1a4b8d);logger['debug'](_0x403e('0x19'),_0x1a4b8d,JSON[_0x403e('0x1e')](_0x3bdd22));_0x5b8ed7(_0x3bdd22);})[_0x403e('0x18')](function(_0x597896){logger[_0x403e('0x14')](_0x403e('0x19'),_0x597896[_0x403e('0x16')],_0x1a4b8d);_0x1d042b(_0x3a0ec7[_0x403e('0x14')](0x1f4,_0x597896[_0x403e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index c72d96d..341f703 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 _0xed76=['update','removeListener','length','./whatsappMessage.events','save','remove'];(function(_0x3f4395,_0x57e457){var _0x38ced8=function(_0x46f01a){while(--_0x46f01a){_0x3f4395['push'](_0x3f4395['shift']());}};_0x38ced8(++_0x57e457);}(_0xed76,0x81));var _0x6ed7=function(_0x3ee184,_0x238e17){_0x3ee184=_0x3ee184-0x0;var _0x100cf4=_0xed76[_0x3ee184];return _0x100cf4;};'use strict';var WhatsappMessageEvents=require(_0x6ed7('0x0'));var events=[_0x6ed7('0x1'),_0x6ed7('0x2'),_0x6ed7('0x3')];function createListener(_0x466e35,_0x2ee929){return function(_0x13d119){_0x2ee929['emit'](_0x466e35,_0x13d119);};}function removeListener(_0xcbc618,_0x166a99){return function(){WhatsappMessageEvents[_0x6ed7('0x4')](_0xcbc618,_0x166a99);};}exports['register']=function(_0xd1078a){for(var _0x1aa780=0x0,_0x136cdf=events[_0x6ed7('0x5')];_0x1aa780<_0x136cdf;_0x1aa780++){var _0xac3646=events[_0x1aa780];var _0x4a8787=createListener('whatsappMessage:'+_0xac3646,_0xd1078a);WhatsappMessageEvents['on'](_0xac3646,_0x4a8787);}}; \ No newline at end of file +var _0x011c=['emit','removeListener','register','length','whatsappMessage:','./whatsappMessage.events','save','remove','update'];(function(_0xd17d45,_0x18aba2){var _0x36ae73=function(_0x280916){while(--_0x280916){_0xd17d45['push'](_0xd17d45['shift']());}};_0x36ae73(++_0x18aba2);}(_0x011c,0x149));var _0xc011=function(_0x11c5fe,_0x413e16){_0x11c5fe=_0x11c5fe-0x0;var _0x289e10=_0x011c[_0x11c5fe];return _0x289e10;};'use strict';var WhatsappMessageEvents=require(_0xc011('0x0'));var events=[_0xc011('0x1'),_0xc011('0x2'),_0xc011('0x3')];function createListener(_0x1004e3,_0x15eacb){return function(_0xa80519){_0x15eacb[_0xc011('0x4')](_0x1004e3,_0xa80519);};}function removeListener(_0x3cc4ce,_0x406d2a){return function(){WhatsappMessageEvents[_0xc011('0x5')](_0x3cc4ce,_0x406d2a);};}exports[_0xc011('0x6')]=function(_0x46b5ab){for(var _0x4f718a=0x0,_0x3a2c55=events[_0xc011('0x7')];_0x4f718a<_0x3a2c55;_0x4f718a++){var _0x2e931d=events[_0x4f718a];var _0x2eadda=createListener(_0xc011('0x8')+_0x2e931d,_0x46b5ab);WhatsappMessageEvents['on'](_0x2e931d,_0x2eadda);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 064e4b8..97006f2 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 _0xdf39=['index','get','describe','/:id','show','/:id/members','/:id/teams','getTeams','post','addAgents','update','delete','destroy','removeTeams','/:id/users','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0xe6fdfa,_0x5551dc){var _0x1a821d=function(_0x51e105){while(--_0x51e105){_0xe6fdfa['push'](_0xe6fdfa['shift']());}};_0x1a821d(++_0x5551dc);}(_0xdf39,0xcd));var _0x9df3=function(_0x8ad428,_0x473edd){_0x8ad428=_0x8ad428-0x0;var _0x300ef7=_0xdf39[_0x8ad428];return _0x300ef7;};'use strict';var multer=require(_0x9df3('0x0'));var util=require(_0x9df3('0x1'));var path=require(_0x9df3('0x2'));var timeout=require(_0x9df3('0x3'));var express=require(_0x9df3('0x4'));var router=express[_0x9df3('0x5')]();var fs_extra=require(_0x9df3('0x6'));var auth=require(_0x9df3('0x7'));var interaction=require(_0x9df3('0x8'));var config=require(_0x9df3('0x9'));var controller=require('./whatsappQueue.controller');router['get']('/',auth[_0x9df3('0xa')](),controller[_0x9df3('0xb')]);router[_0x9df3('0xc')]('/describe',auth[_0x9df3('0xa')](),controller[_0x9df3('0xd')]);router[_0x9df3('0xc')](_0x9df3('0xe'),auth['isAuthenticated'](),controller[_0x9df3('0xf')]);router[_0x9df3('0xc')](_0x9df3('0x10'),auth[_0x9df3('0xa')](),controller['getMembers']);router[_0x9df3('0xc')](_0x9df3('0x11'),auth[_0x9df3('0xa')](),controller[_0x9df3('0x12')]);router[_0x9df3('0xc')]('/:id/users',auth[_0x9df3('0xa')](),controller['getAgents']);router[_0x9df3('0x13')]('/',auth[_0x9df3('0xa')](),controller['create']);router[_0x9df3('0x13')]('/:id/teams',auth[_0x9df3('0xa')](),controller['addTeams']);router['post']('/:id/users',auth[_0x9df3('0xa')](),controller[_0x9df3('0x14')]);router['put'](_0x9df3('0xe'),auth[_0x9df3('0xa')](),controller[_0x9df3('0x15')]);router[_0x9df3('0x16')](_0x9df3('0xe'),auth[_0x9df3('0xa')](),controller[_0x9df3('0x17')]);router[_0x9df3('0x16')]('/:id/teams',auth['isAuthenticated'](),controller[_0x9df3('0x18')]);router['delete'](_0x9df3('0x19'),auth['isAuthenticated'](),controller[_0x9df3('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x6b23=['destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','get','/describe','describe','show','/:id/members','getMembers','/:id/users','getAgents','post','addTeams','addAgents','put','/:id','update','delete'];(function(_0xa7fbf2,_0x3ba879){var _0x49890c=function(_0x4912ec){while(--_0x4912ec){_0xa7fbf2['push'](_0xa7fbf2['shift']());}};_0x49890c(++_0x3ba879);}(_0x6b23,0x18a));var _0x36b2=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0x6b23[_0x4c440b];return _0x2d48cf;};'use strict';var multer=require(_0x36b2('0x0'));var util=require(_0x36b2('0x1'));var path=require(_0x36b2('0x2'));var timeout=require(_0x36b2('0x3'));var express=require(_0x36b2('0x4'));var router=express[_0x36b2('0x5')]();var fs_extra=require(_0x36b2('0x6'));var auth=require(_0x36b2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x36b2('0x8'));var controller=require(_0x36b2('0x9'));router['get']('/',auth[_0x36b2('0xa')](),controller['index']);router[_0x36b2('0xb')](_0x36b2('0xc'),auth[_0x36b2('0xa')](),controller[_0x36b2('0xd')]);router[_0x36b2('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x36b2('0xe')]);router[_0x36b2('0xb')](_0x36b2('0xf'),auth[_0x36b2('0xa')](),controller[_0x36b2('0x10')]);router[_0x36b2('0xb')]('/:id/teams',auth[_0x36b2('0xa')](),controller['getTeams']);router[_0x36b2('0xb')](_0x36b2('0x11'),auth['isAuthenticated'](),controller[_0x36b2('0x12')]);router[_0x36b2('0x13')]('/',auth[_0x36b2('0xa')](),controller['create']);router['post']('/:id/teams',auth[_0x36b2('0xa')](),controller[_0x36b2('0x14')]);router['post'](_0x36b2('0x11'),auth['isAuthenticated'](),controller[_0x36b2('0x15')]);router[_0x36b2('0x16')](_0x36b2('0x17'),auth['isAuthenticated'](),controller[_0x36b2('0x18')]);router[_0x36b2('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x36b2('0x1a')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0x36b2('0x1b')]);router[_0x36b2('0x19')]('/:id/users',auth[_0x36b2('0xa')](),controller[_0x36b2('0x1c')]);module[_0x36b2('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 667eb74..bd653ca 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 _0x35a9=['exports','STRING','name','INTEGER','beepall'];(function(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0x35a9,0x73));var _0x935a=function(_0x48e074,_0x1da3aa){_0x48e074=_0x48e074-0x0;var _0x4554ec=_0x35a9[_0x48e074];return _0x4554ec;};'use strict';var Sequelize=require('sequelize');module[_0x935a('0x0')]={'name':{'type':Sequelize[_0x935a('0x1')],'unique':_0x935a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x935a('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x935a('0x4'),'roundrobin')},'description':{'type':Sequelize[_0x935a('0x1')]}}; \ No newline at end of file +var _0xfa20=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x194d79,_0x144a2d){var _0x3023dc=function(_0x55d279){while(--_0x55d279){_0x194d79['push'](_0x194d79['shift']());}};_0x3023dc(++_0x144a2d);}(_0xfa20,0x141));var _0x0fa2=function(_0x180890,_0x4bc2cd){_0x180890=_0x180890-0x0;var _0x4f4d0f=_0xfa20[_0x180890];return _0x4f4d0f;};'use strict';var Sequelize=require(_0x0fa2('0x0'));module[_0x0fa2('0x1')]={'name':{'type':Sequelize[_0x0fa2('0x2')],'unique':_0x0fa2('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x0fa2('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0fa2('0x5')](_0x0fa2('0x6'),_0x0fa2('0x7'),_0x0fa2('0x8'))},'description':{'type':Sequelize[_0x0fa2('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 0011482..e4f228c 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 _0xe0ed=['UserWhatsappQueue','hasOwnProperty','WhatsappQueueId','User','agent','updatedAt','rows','format','%s/%s','SIP','whatsappPause','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','push','toString','SELECT','every','TeamId','includes','all','compact','value','removeAgents','omit','spread','userWhatsappQueue:save','userWhatsappQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','./whatsappQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','WhatsappQueues','UserProfileResource','stack','name','index','map','WhatsappQueue','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','catch','show','rawAttributes','includeAll','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne'];(function(_0x372d81,_0x120f6f){var _0x4cc42b=function(_0x1c4f0b){while(--_0x1c4f0b){_0x372d81['push'](_0x372d81['shift']());}};_0x4cc42b(++_0x120f6f);}(_0xe0ed,0x14c));var _0xde0e=function(_0x3ab740,_0x6597de){_0x3ab740=_0x3ab740-0x0;var _0x2c5b61=_0xe0ed[_0x3ab740];return _0x2c5b61;};'use strict';var emlformat=require(_0xde0e('0x0'));var rimraf=require(_0xde0e('0x1'));var zipdir=require(_0xde0e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xde0e('0x3'));var moment=require(_0xde0e('0x4'));var BPromise=require(_0xde0e('0x5'));var Mustache=require(_0xde0e('0x6'));var util=require(_0xde0e('0x7'));var path=require(_0xde0e('0x8'));var sox=require(_0xde0e('0x9'));var csv=require(_0xde0e('0xa'));var ejs=require(_0xde0e('0xb'));var fs=require('fs');var fs_extra=require(_0xde0e('0xc'));var _=require(_0xde0e('0xd'));var squel=require(_0xde0e('0xe'));var crypto=require(_0xde0e('0xf'));var jsforce=require(_0xde0e('0x10'));var deskjs=require(_0xde0e('0x11'));var toCsv=require('to-csv');var querystring=require(_0xde0e('0x12'));var Papa=require('papaparse');var Redis=require(_0xde0e('0x13'));var authService=require(_0xde0e('0x14'));var qs=require(_0xde0e('0x15'));var as=require(_0xde0e('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xde0e('0x17'))(_0xde0e('0x18'));var utils=require(_0xde0e('0x19'));var config=require(_0xde0e('0x1a'));var licenseUtil=require(_0xde0e('0x1b'));var db=require(_0xde0e('0x1c'))['db'];config['redis']=_[_0xde0e('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xde0e('0x1e'))[_0xde0e('0x1f')](socket);function respondWithStatusCode(_0x554759,_0x277b6b){_0x277b6b=_0x277b6b||0xcc;return function(_0x385cfa){if(_0x385cfa){return _0x554759[_0xde0e('0x20')](_0x277b6b);}return _0x554759['status'](_0x277b6b)[_0xde0e('0x21')]();};}function respondWithResult(_0x21790c,_0x28e517){_0x28e517=_0x28e517||0xc8;return function(_0x5cc31e){if(_0x5cc31e){return _0x21790c[_0xde0e('0x22')](_0x28e517)[_0xde0e('0x23')](_0x5cc31e);}};}function respondWithFilteredResult(_0x11eea6,_0x52254a){return function(_0x1c8274){if(_0x1c8274){var _0x108c4f=typeof _0x52254a[_0xde0e('0x24')]===_0xde0e('0x25')&&typeof _0x52254a[_0xde0e('0x26')]===_0xde0e('0x25');var _0x40d078=_0x1c8274[_0xde0e('0x27')];var _0x25945a=_0x108c4f?0x0:_0x52254a[_0xde0e('0x24')];var _0x559c88=_0x108c4f?_0x1c8274[_0xde0e('0x27')]:_0x52254a[_0xde0e('0x24')]+_0x52254a[_0xde0e('0x26')];var _0x6c76cf;if(_0x559c88>=_0x40d078){_0x559c88=_0x40d078;_0x6c76cf=0xc8;}else{_0x6c76cf=0xce;}_0x11eea6[_0xde0e('0x22')](_0x6c76cf);return _0x11eea6['set'](_0xde0e('0x28'),_0x25945a+'-'+_0x559c88+'/'+_0x40d078)[_0xde0e('0x23')](_0x1c8274);}return null;};}function patchUpdates(_0x326374){return function(_0x2f56e5){try{jsonpatch[_0xde0e('0x29')](_0x2f56e5,_0x326374,!![]);}catch(_0x4974a4){return BPromise[_0xde0e('0x2a')](_0x4974a4);}return _0x2f56e5['save']();};}function saveUpdates(_0x341e1a,_0x2dd0f0){return function(_0x1bd410){if(_0x1bd410){return _0x1bd410['update'](_0x341e1a)[_0xde0e('0x2b')](function(_0x474675){return _0x474675;});}return null;};}function removeEntity(_0x365dca,_0x392bac){return function(_0xed45c2){if(_0xed45c2){return _0xed45c2[_0xde0e('0x2c')]()[_0xde0e('0x2b')](function(){var _0x370547=_0xed45c2['get']({'plain':!![]});var _0x43fe2f=_0xde0e('0x2d');return db[_0xde0e('0x2e')]['destroy']({'where':{'type':_0x43fe2f,'resourceId':_0x370547['id']}})[_0xde0e('0x2b')](function(){return _0xed45c2;});})[_0xde0e('0x2b')](function(){_0x365dca['status'](0xcc)[_0xde0e('0x21')]();});}};}function handleEntityNotFound(_0x1bfabd,_0x34f281){return function(_0x304386){if(!_0x304386){_0x1bfabd[_0xde0e('0x20')](0x194);}return _0x304386;};}function handleError(_0x39b7af,_0x354523){_0x354523=_0x354523||0x1f4;return function(_0x9d1109){logger['error'](_0x9d1109[_0xde0e('0x2f')]);if(_0x9d1109[_0xde0e('0x30')]){delete _0x9d1109[_0xde0e('0x30')];}_0x39b7af[_0xde0e('0x22')](_0x354523)['send'](_0x9d1109);};}exports[_0xde0e('0x31')]=function(_0x4d2335,_0x53df2a){var _0x28b2e1={},_0x479bea={},_0x1f6b72={'count':0x0,'rows':[]};var _0x115578=_[_0xde0e('0x32')](db[_0xde0e('0x33')]['rawAttributes'],function(_0x32d063){return{'name':_0x32d063[_0xde0e('0x34')],'type':_0x32d063[_0xde0e('0x35')]['key']};});_0x479bea[_0xde0e('0x36')]=_[_0xde0e('0x32')](_0x115578,'name');_0x479bea[_0xde0e('0x37')]=_[_0xde0e('0x38')](_0x4d2335[_0xde0e('0x37')]);_0x479bea[_0xde0e('0x39')]=_[_0xde0e('0x3a')](_0x479bea['model'],_0x479bea['query']);_0x28b2e1[_0xde0e('0x3b')]=_[_0xde0e('0x3a')](_0x479bea[_0xde0e('0x36')],qs[_0xde0e('0x3c')](_0x4d2335[_0xde0e('0x37')][_0xde0e('0x3c')]));_0x28b2e1[_0xde0e('0x3b')]=_0x28b2e1[_0xde0e('0x3b')][_0xde0e('0x3d')]?_0x28b2e1[_0xde0e('0x3b')]:_0x479bea[_0xde0e('0x36')];if(!_0x4d2335[_0xde0e('0x37')]['hasOwnProperty'](_0xde0e('0x3e'))){_0x28b2e1[_0xde0e('0x26')]=qs[_0xde0e('0x26')](_0x4d2335['query'][_0xde0e('0x26')]);_0x28b2e1[_0xde0e('0x24')]=qs[_0xde0e('0x24')](_0x4d2335[_0xde0e('0x37')][_0xde0e('0x24')]);}_0x28b2e1[_0xde0e('0x3f')]=qs[_0xde0e('0x40')](_0x4d2335[_0xde0e('0x37')][_0xde0e('0x40')]);_0x28b2e1[_0xde0e('0x41')]=qs[_0xde0e('0x39')](_[_0xde0e('0x42')](_0x4d2335[_0xde0e('0x37')],_0x479bea['filters']),_0x115578);if(_0x4d2335[_0xde0e('0x37')][_0xde0e('0x43')]){_0x28b2e1[_0xde0e('0x41')]=_['merge'](_0x28b2e1['where'],{'$or':_[_0xde0e('0x32')](_0x115578,function(_0xf36924){if(_0xf36924[_0xde0e('0x35')]!==_0xde0e('0x44')){var _0x151b7f={};_0x151b7f[_0xf36924[_0xde0e('0x30')]]={'$like':'%'+_0x4d2335[_0xde0e('0x37')][_0xde0e('0x43')]+'%'};return _0x151b7f;}})});}_0x28b2e1=_[_0xde0e('0x45')]({},_0x28b2e1,_0x4d2335[_0xde0e('0x46')]);var _0x286141={'where':_0x28b2e1['where']};return db[_0xde0e('0x33')]['count'](_0x286141)['then'](function(_0x29f746){_0x1f6b72['count']=_0x29f746;if(_0x4d2335['query']['includeAll']){_0x28b2e1['include']=[{'all':!![]}];}return db['WhatsappQueue'][_0xde0e('0x47')](_0x28b2e1);})['then'](function(_0x25eea6){_0x1f6b72['rows']=_0x25eea6;return _0x1f6b72;})['then'](respondWithFilteredResult(_0x53df2a,_0x28b2e1))[_0xde0e('0x48')](handleError(_0x53df2a,null));};exports[_0xde0e('0x49')]=function(_0x5aadfe,_0xd666cc){var _0x624944={'raw':!![],'where':{'id':_0x5aadfe['params']['id']}},_0x273db1={};_0x273db1[_0xde0e('0x36')]=_[_0xde0e('0x38')](db[_0xde0e('0x33')][_0xde0e('0x4a')]);_0x273db1[_0xde0e('0x37')]=_[_0xde0e('0x38')](_0x5aadfe[_0xde0e('0x37')]);_0x273db1['filters']=_[_0xde0e('0x3a')](_0x273db1[_0xde0e('0x36')],_0x273db1[_0xde0e('0x37')]);_0x624944[_0xde0e('0x3b')]=_[_0xde0e('0x3a')](_0x273db1[_0xde0e('0x36')],qs[_0xde0e('0x3c')](_0x5aadfe[_0xde0e('0x37')][_0xde0e('0x3c')]));_0x624944[_0xde0e('0x3b')]=_0x624944['attributes'][_0xde0e('0x3d')]?_0x624944[_0xde0e('0x3b')]:_0x273db1[_0xde0e('0x36')];if(_0x5aadfe[_0xde0e('0x37')][_0xde0e('0x4b')]){_0x624944[_0xde0e('0x4c')]=[{'all':!![]}];}_0x624944=_[_0xde0e('0x45')]({},_0x624944,_0x5aadfe[_0xde0e('0x46')]);return db['WhatsappQueue'][_0xde0e('0x4d')](_0x624944)[_0xde0e('0x2b')](handleEntityNotFound(_0xd666cc,null))['then'](respondWithResult(_0xd666cc,null))['catch'](handleError(_0xd666cc,null));};exports[_0xde0e('0x4e')]=function(_0xf18222,_0x23630f){return db[_0xde0e('0x33')][_0xde0e('0x4e')](_0xf18222[_0xde0e('0x4f')],{})[_0xde0e('0x2b')](function(_0x147d30){var _0x48b73b=_0xf18222[_0xde0e('0x50')][_0xde0e('0x51')]({'plain':!![]});if(!_0x48b73b)throw new Error(_0xde0e('0x52'));if(_0x48b73b[_0xde0e('0x53')]==='user'){var _0x369c3e=_0x147d30[_0xde0e('0x51')]({'plain':!![]});var _0x196f0a=_0xde0e('0x2d');return db['UserProfileSection'][_0xde0e('0x4d')]({'where':{'name':_0x196f0a,'userProfileId':_0x48b73b['userProfileId']},'raw':!![]})[_0xde0e('0x2b')](function(_0x88d66a){if(_0x88d66a&&_0x88d66a[_0xde0e('0x54')]===0x0){return db[_0xde0e('0x2e')]['create']({'name':_0x369c3e['name'],'resourceId':_0x369c3e['id'],'type':_0x88d66a[_0xde0e('0x30')],'sectionId':_0x88d66a['id']},{})[_0xde0e('0x2b')](function(){return _0x147d30;});}else{return _0x147d30;}})[_0xde0e('0x48')](function(_0x2491f6){logger[_0xde0e('0x55')](_0xde0e('0x56'),_0x2491f6);throw _0x2491f6;});}return _0x147d30;})[_0xde0e('0x2b')](respondWithResult(_0x23630f,0xc9))[_0xde0e('0x48')](handleError(_0x23630f,null));};exports['update']=function(_0x1eb68f,_0x35def1){if(_0x1eb68f[_0xde0e('0x4f')]['id']){delete _0x1eb68f[_0xde0e('0x4f')]['id'];}return db['WhatsappQueue'][_0xde0e('0x4d')]({'where':{'id':_0x1eb68f[_0xde0e('0x57')]['id']}})[_0xde0e('0x2b')](handleEntityNotFound(_0x35def1,null))['then'](saveUpdates(_0x1eb68f['body'],null))['then'](respondWithResult(_0x35def1,null))[_0xde0e('0x48')](handleError(_0x35def1,null));};exports[_0xde0e('0x2c')]=function(_0x5def7c,_0x1229ad){return db[_0xde0e('0x33')]['find']({'where':{'id':_0x5def7c[_0xde0e('0x57')]['id']}})[_0xde0e('0x2b')](handleEntityNotFound(_0x1229ad,null))[_0xde0e('0x2b')](removeEntity(_0x1229ad,null))[_0xde0e('0x48')](handleError(_0x1229ad,null));};exports[_0xde0e('0x58')]=function(_0xd501d3,_0x3d86fa){return db[_0xde0e('0x33')][_0xde0e('0x58')]()[_0xde0e('0x2b')](respondWithResult(_0x3d86fa,null))[_0xde0e('0x48')](handleError(_0x3d86fa,null));};exports[_0xde0e('0x59')]=function(_0x40e05f,_0x328f56,_0x5d85e9){var _0x17d8f6={'raw':!![],'where':{}},_0x4e2b7d={},_0x1d5ff0;return db['WhatsappQueue'][_0xde0e('0x5a')]({'where':{'id':_0x40e05f[_0xde0e('0x57')]['id']}})['then'](handleEntityNotFound(_0x328f56,null))[_0xde0e('0x2b')](function(_0x2b1997){if(_0x2b1997){_0x1d5ff0=_0x2b1997[_0xde0e('0x51')]({'plain':!![]});_0x4e2b7d[_0xde0e('0x36')]=_[_0xde0e('0x38')](db[_0xde0e('0x5b')]['rawAttributes']);_0x4e2b7d[_0xde0e('0x37')]=_[_0xde0e('0x38')](_0x40e05f[_0xde0e('0x37')]);_0x4e2b7d[_0xde0e('0x39')]=_[_0xde0e('0x3a')](_0x4e2b7d['model'],_0x4e2b7d[_0xde0e('0x37')]);_0x17d8f6['attributes']=_['intersection'](_0x4e2b7d[_0xde0e('0x36')],qs[_0xde0e('0x3c')](_0x40e05f[_0xde0e('0x37')][_0xde0e('0x3c')]));_0x17d8f6[_0xde0e('0x3b')]=_0x17d8f6['attributes'][_0xde0e('0x3d')]?_0x17d8f6['attributes']:_0x4e2b7d[_0xde0e('0x36')];if(!_0x40e05f[_0xde0e('0x37')][_0xde0e('0x5c')]('nolimit')){_0x17d8f6['limit']=qs['limit'](_0x40e05f['query']['limit']);_0x17d8f6[_0xde0e('0x24')]=qs[_0xde0e('0x24')](_0x40e05f['query'][_0xde0e('0x24')]);}_0x17d8f6['order']=qs[_0xde0e('0x40')](_0x40e05f[_0xde0e('0x37')]['sort']);_0x17d8f6[_0xde0e('0x41')]=qs['filters'](_['pick'](_0x40e05f['query'],_0x4e2b7d[_0xde0e('0x39')]));_0x17d8f6['where'][_0xde0e('0x5d')]=_0x2b1997['id'];if(_0x40e05f[_0xde0e('0x37')][_0xde0e('0x43')]){_0x17d8f6[_0xde0e('0x41')]=_[_0xde0e('0x45')](_0x17d8f6[_0xde0e('0x41')],{'$or':_['map'](_0x17d8f6['attributes'],function(_0x1f2476){var _0x54154e={};_0x54154e[_0x1f2476]={'$like':'%'+_0x40e05f['query'][_0xde0e('0x43')]+'%'};return _0x54154e;})});}_0x17d8f6=_[_0xde0e('0x45')]({},_0x17d8f6,_0x40e05f['options']);return db[_0xde0e('0x5b')][_0xde0e('0x47')](_0x17d8f6);}})[_0xde0e('0x2b')](function(_0xe9b83b){if(_0xe9b83b){return db[_0xde0e('0x5e')]['findAndCountAll']({'where':{'id':_['map'](_0xe9b83b,'UserId'),'role':_0xde0e('0x5f')},'attributes':['id','name','whatsappPause',_0xde0e('0x60'),'createdAt']});}})[_0xde0e('0x2b')](function(_0x1a9a00){if(_0x1a9a00){return{'count':_0x1a9a00['count'],'rows':_[_0xde0e('0x32')](_0x1a9a00[_0xde0e('0x61')],function(_0x1dcf02){return{'membername':_0x1dcf02[_0xde0e('0x30')],'UserId':_0x1dcf02['id'],'queue_name':_0x1d5ff0[_0xde0e('0x30')],'WhatsappQueueId':_0x1d5ff0['id'],'interface':util[_0xde0e('0x62')](_0xde0e('0x63'),_0xde0e('0x64'),_0x1dcf02[_0xde0e('0x30')]),'penalty':0x0,'paused':_0x1dcf02[_0xde0e('0x65')],'createdAt':_0x1dcf02[_0xde0e('0x66')],'updatedAt':_0x1dcf02[_0xde0e('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x328f56,_0x17d8f6))['catch'](handleError(_0x328f56,null));};exports[_0xde0e('0x67')]=function(_0x1de486,_0x1e4782,_0x229b2f){var _0x3a4e1a={};var _0x880033={};var _0x32d054;var _0xc8f6ee;return db['WhatsappQueue']['findOne']({'where':{'id':_0x1de486[_0xde0e('0x57')]['id']}})[_0xde0e('0x2b')](handleEntityNotFound(_0x1e4782,null))['then'](function(_0x4f914d){if(_0x4f914d){_0x32d054=_0x4f914d;_0x880033[_0xde0e('0x36')]=_['keys'](db[_0xde0e('0x68')][_0xde0e('0x4a')]);_0x880033[_0xde0e('0x37')]=_[_0xde0e('0x38')](_0x1de486[_0xde0e('0x37')]);_0x880033['filters']=_[_0xde0e('0x3a')](_0x880033[_0xde0e('0x36')],_0x880033['query']);_0x3a4e1a['attributes']=_[_0xde0e('0x3a')](_0x880033[_0xde0e('0x36')],qs[_0xde0e('0x3c')](_0x1de486[_0xde0e('0x37')][_0xde0e('0x3c')]));_0x3a4e1a['attributes']=_0x3a4e1a['attributes'][_0xde0e('0x3d')]?_0x3a4e1a[_0xde0e('0x3b')]:_0x880033['model'];_0x3a4e1a['order']=qs['sort'](_0x1de486[_0xde0e('0x37')][_0xde0e('0x40')]);_0x3a4e1a[_0xde0e('0x41')]=qs[_0xde0e('0x39')](_[_0xde0e('0x42')](_0x1de486[_0xde0e('0x37')],_0x880033[_0xde0e('0x39')]));if(_0x1de486[_0xde0e('0x37')][_0xde0e('0x43')]){_0x3a4e1a[_0xde0e('0x41')]=_['merge'](_0x3a4e1a[_0xde0e('0x41')],{'$or':_[_0xde0e('0x32')](_0x3a4e1a['attributes'],function(_0x4f1e4b){var _0x3be0f5={};_0x3be0f5[_0x4f1e4b]={'$like':'%'+_0x1de486[_0xde0e('0x37')][_0xde0e('0x43')]+'%'};return _0x3be0f5;})});}_0x3a4e1a=_[_0xde0e('0x45')]({},_0x3a4e1a,_0x1de486[_0xde0e('0x46')]);return _0x32d054[_0xde0e('0x67')](_0x3a4e1a);}})[_0xde0e('0x2b')](function(_0x5bb503){if(_0x5bb503){_0xc8f6ee=_0x5bb503['length'];if(!_0x1de486[_0xde0e('0x37')]['hasOwnProperty'](_0xde0e('0x3e'))){_0x3a4e1a['limit']=qs[_0xde0e('0x26')](_0x1de486[_0xde0e('0x37')][_0xde0e('0x26')]);_0x3a4e1a['offset']=qs['offset'](_0x1de486[_0xde0e('0x37')][_0xde0e('0x24')]);}return _0x32d054[_0xde0e('0x67')](_0x3a4e1a);}})[_0xde0e('0x2b')](function(_0xbec797){if(_0xbec797){return _0xbec797?{'count':_0xc8f6ee,'rows':_0xbec797}:null;}})[_0xde0e('0x2b')](respondWithResult(_0x1e4782,null))[_0xde0e('0x48')](handleError(_0x1e4782,null));};exports[_0xde0e('0x69')]=function(_0x25a5b0,_0x2801d9,_0x871516){var _0x5b31a5=_0x25a5b0['body'][_0xde0e('0x6a')];return db[_0xde0e('0x68')][_0xde0e('0x47')]({'where':{'id':_0x5b31a5},'attributes':['id'],'include':[{'model':db[_0xde0e('0x5e')],'as':_0xde0e('0x6b'),'attributes':['id',_0xde0e('0x30'),_0xde0e('0x6c'),_0xde0e('0x6d'),_0xde0e('0x6e')],'raw':!![]}]})[_0xde0e('0x2b')](function(_0x29d3a0){if(_0x29d3a0){var _0x1a5dcd=_[_0xde0e('0x6f')](_0x29d3a0,function(_0x1325c4){var _0x2ddbb5=_0x1325c4[_0xde0e('0x51')]({'plain':!![]});return _0x2ddbb5[_0xde0e('0x6b')];});return db[_0xde0e('0x33')][_0xde0e('0x4d')]({'where':{'id':_0x25a5b0['params']['id']}})[_0xde0e('0x2b')](function(_0x5ac920){return db[_0xde0e('0x70')][_0xde0e('0x71')](function(_0x19e4d8){return _0x5ac920[_0xde0e('0x69')](_0x5b31a5,{'transaction':_0x19e4d8})[_0xde0e('0x2b')](function(){return BPromise['each'](_0x1a5dcd,function(_0x345df1){return db[_0xde0e('0x5b')][_0xde0e('0x72')]({'where':{'UserId':_0x345df1['id'],'WhatsappQueueId':_0x25a5b0['params']['id']},'transaction':_0x19e4d8});});})[_0xde0e('0x2b')](function(){_0x1a5dcd[_0xde0e('0x73')](function(_0x25a949){socket[_0xde0e('0x74')]('userWhatsappQueue:save',{'UserId':_0x25a949['id'],'WhatsappQueueId':_0x5ac920['id']});});});});});}})[_0xde0e('0x2b')](respondWithStatusCode(_0x2801d9,null))[_0xde0e('0x48')](handleError(_0x2801d9,null));};exports[_0xde0e('0x75')]=function(_0x1c751b,_0x2d517f,_0x3fd448){return db[_0xde0e('0x68')][_0xde0e('0x47')]({'where':{'id':_0x1c751b[_0xde0e('0x37')][_0xde0e('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xde0e('0x5e')],'as':_0xde0e('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xde0e('0x2b')](handleEntityNotFound(_0x2d517f,null))[_0xde0e('0x2b')](function(_0x56acb9){var _0x2ac104=_[_0xde0e('0x32')](_0x56acb9,'id');var _0x43f1f5=[];var _0x4651d2=[];var _0xede5dc=squel[_0xde0e('0x76')]();_0xede5dc[_0xde0e('0x77')](_0xde0e('0x78'))[_0xde0e('0x79')]('team_has_whatsapp_queues','tq')['join'](_0xde0e('0x7a'),'ut',_0xde0e('0x7b'))[_0xde0e('0x41')](_0xde0e('0x7c'),_0x1c751b[_0xde0e('0x57')]['id']);for(var _0x24ff95=0x0;_0x24ff95<_0x56acb9[_0xde0e('0x3d')];_0x24ff95+=0x1){let _0x5ba4fa=_0x56acb9[_0x24ff95];for(var _0x5b6170=0x0;_0x5b6170<_0x5ba4fa['Agents'][_0xde0e('0x3d')];_0x5b6170+=0x1){let _0x516b6f=_0x5ba4fa[_0xde0e('0x6b')][_0x5b6170];var _0x535160=_0xede5dc[_0xde0e('0x7d')]();_0x535160['where']('ut.UserId\x20=\x20?',_0x516b6f['id']);_0x4651d2[_0xde0e('0x7e')](db[_0xde0e('0x70')][_0xde0e('0x37')](_0x535160[_0xde0e('0x7f')](),{'type':db[_0xde0e('0x70')]['QueryTypes'][_0xde0e('0x80')]})[_0xde0e('0x2b')](function(_0x111d65){if(_0x111d65[_0xde0e('0x3d')]===0x1){return _0x516b6f['id'];}else{var _0x592b6b=_[_0xde0e('0x81')](_[_0xde0e('0x32')](_0x111d65,_0xde0e('0x82')),function(_0x2329c7){return _[_0xde0e('0x83')](_0x2ac104,_0x2329c7);});if(_0x592b6b){return _0x516b6f['id'];}}}));}}return BPromise[_0xde0e('0x84')](_0x4651d2)[_0xde0e('0x2b')](function(_0x96e38d){_0x43f1f5=_(_0x43f1f5)['union'](_0x96e38d)[_0xde0e('0x85')]()[_0xde0e('0x86')]();return db[_0xde0e('0x33')]['find']({'where':{'id':_0x1c751b['params']['id']}})['then'](function(_0x391d3c){return db['sequelize'][_0xde0e('0x71')](function(_0x1f4532){return _0x391d3c[_0xde0e('0x75')](_0x1c751b[_0xde0e('0x37')]['ids'],{'transaction':_0x1f4532})[_0xde0e('0x2b')](function(){if(!_['isEmpty'](_0x43f1f5)){return _0x391d3c[_0xde0e('0x87')](_0x43f1f5,{'transaction':_0x1f4532});}})['then'](function(){_0x43f1f5[_0xde0e('0x73')](function(_0x1d8970){socket[_0xde0e('0x74')]('userWhatsappQueue:remove',{'UserId':_0x1d8970,'WhatsappQueueId':_0x391d3c['id']});});});});});});})['then'](respondWithStatusCode(_0x2d517f,null))[_0xde0e('0x48')](handleError(_0x2d517f,null));};exports['addAgents']=function(_0x3cb13e,_0x4d096b,_0x448c8e){return db['WhatsappQueue'][_0xde0e('0x4d')]({'where':{'id':_0x3cb13e[_0xde0e('0x57')]['id']}})['then'](handleEntityNotFound(_0x4d096b,null))[_0xde0e('0x2b')](function(_0x380dfd){if(_0x380dfd){return _0x380dfd['addAgents'](_0x3cb13e[_0xde0e('0x4f')][_0xde0e('0x6a')],_[_0xde0e('0x88')](_0x3cb13e[_0xde0e('0x4f')],[_0xde0e('0x6a'),'id'])||{})[_0xde0e('0x89')](function(_0xb5338a){for(var _0x37bcb8=0x0;_0x37bcb8<_0x3cb13e[_0xde0e('0x4f')][_0xde0e('0x6a')][_0xde0e('0x3d')];_0x37bcb8+=0x1){socket[_0xde0e('0x74')](_0xde0e('0x8a'),{'UserId':Number(_0x3cb13e[_0xde0e('0x4f')][_0xde0e('0x6a')][_0x37bcb8]),'WhatsappQueueId':Number(_0x3cb13e[_0xde0e('0x57')]['id'])});}return _0xb5338a;});}})[_0xde0e('0x2b')](respondWithResult(_0x4d096b,null))['catch'](handleError(_0x4d096b,null));};exports[_0xde0e('0x87')]=function(_0x4878b8,_0x363a32,_0x11d675){return db[_0xde0e('0x33')]['find']({'where':{'id':_0x4878b8[_0xde0e('0x57')]['id']}})[_0xde0e('0x2b')](handleEntityNotFound(_0x363a32,null))[_0xde0e('0x2b')](function(_0x2101ca){if(_0x2101ca){return _0x2101ca[_0xde0e('0x87')](_0x4878b8[_0xde0e('0x37')]['ids'])[_0xde0e('0x2b')](function(){if(_['isArray'](_0x4878b8['query']['ids'])){for(var _0x2b46c2=0x0;_0x2b46c2<_0x4878b8[_0xde0e('0x37')]['ids']['length'];_0x2b46c2+=0x1){socket[_0xde0e('0x74')]('userWhatsappQueue:remove',{'UserId':Number(_0x4878b8[_0xde0e('0x37')][_0xde0e('0x6a')][_0x2b46c2]),'WhatsappQueueId':Number(_0x4878b8[_0xde0e('0x57')]['id'])});}}else{socket['emit'](_0xde0e('0x8b'),{'UserId':Number(_0x4878b8[_0xde0e('0x37')]['ids']),'WhatsappQueueId':Number(_0x4878b8[_0xde0e('0x57')]['id'])});}});}})[_0xde0e('0x2b')](respondWithStatusCode(_0x363a32,null))['catch'](handleError(_0x363a32,null));};exports['getAgents']=function(_0xe48e3e,_0x4c463e,_0x5c9c90){var _0x5981ec={};var _0x4344bb={};var _0x1c28b4;var _0x5d9aab;return db[_0xde0e('0x33')][_0xde0e('0x5a')]({'where':{'id':_0xe48e3e[_0xde0e('0x57')]['id']}})[_0xde0e('0x2b')](handleEntityNotFound(_0x4c463e,null))[_0xde0e('0x2b')](function(_0x296a5e){if(_0x296a5e){_0x1c28b4=_0x296a5e;_0x4344bb[_0xde0e('0x36')]=_[_0xde0e('0x38')](db[_0xde0e('0x5e')][_0xde0e('0x4a')]);_0x4344bb['query']=_[_0xde0e('0x38')](_0xe48e3e[_0xde0e('0x37')]);_0x4344bb[_0xde0e('0x39')]=_['intersection'](_0x4344bb[_0xde0e('0x36')],_0x4344bb[_0xde0e('0x37')]);_0x5981ec[_0xde0e('0x3b')]=_[_0xde0e('0x3a')](_0x4344bb[_0xde0e('0x36')],qs[_0xde0e('0x3c')](_0xe48e3e['query']['fields']));_0x5981ec[_0xde0e('0x3b')]=_0x5981ec[_0xde0e('0x3b')][_0xde0e('0x3d')]?_0x5981ec[_0xde0e('0x3b')]:_0x4344bb['model'];_0x5981ec[_0xde0e('0x3f')]=qs[_0xde0e('0x40')](_0xe48e3e['query'][_0xde0e('0x40')]);_0x5981ec[_0xde0e('0x41')]=qs[_0xde0e('0x39')](_[_0xde0e('0x42')](_0xe48e3e[_0xde0e('0x37')],_0x4344bb['filters']));if(_0xe48e3e[_0xde0e('0x37')][_0xde0e('0x43')]){_0x5981ec['where']=_[_0xde0e('0x45')](_0x5981ec[_0xde0e('0x41')],{'$or':_[_0xde0e('0x32')](_0x5981ec[_0xde0e('0x3b')],function(_0x1436db){var _0x4fdf0d={};_0x4fdf0d[_0x1436db]={'$like':'%'+_0xe48e3e[_0xde0e('0x37')][_0xde0e('0x43')]+'%'};return _0x4fdf0d;})});}_0x5981ec=_[_0xde0e('0x45')]({},_0x5981ec,_0xe48e3e[_0xde0e('0x46')]);return _0x1c28b4[_0xde0e('0x8c')](_0x5981ec);}})[_0xde0e('0x2b')](function(_0x5a4d33){if(_0x5a4d33){_0x5d9aab=_0x5a4d33[_0xde0e('0x3d')];if(!_0xe48e3e[_0xde0e('0x37')][_0xde0e('0x5c')](_0xde0e('0x3e'))){_0x5981ec[_0xde0e('0x26')]=qs[_0xde0e('0x26')](_0xe48e3e[_0xde0e('0x37')][_0xde0e('0x26')]);_0x5981ec[_0xde0e('0x24')]=qs[_0xde0e('0x24')](_0xe48e3e['query'][_0xde0e('0x24')]);}return _0x1c28b4['getAgents'](_0x5981ec);}})[_0xde0e('0x2b')](function(_0x112ddd){if(_0x112ddd){return _0x112ddd?{'count':_0x5d9aab,'rows':_0x112ddd}:null;}})['then'](respondWithResult(_0x4c463e,null))[_0xde0e('0x48')](handleError(_0x4c463e,null));}; \ No newline at end of file +var _0x20f2=['where','filters','pick','filter','merge','VIRTUAL','options','WhatsappQueue','include','findAll','catch','show','params','model','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','User','findAndCountAll','UserId','updatedAt','createdAt','rows','%s/%s','SIP','whatsappPause','getTeams','Team','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','SELECT','every','includes','all','union','value','removeAgents','userWhatsappQueue:remove','addAgents','omit','userWhatsappQueue:save','isArray','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','socket.io-emitter','./whatsappQueue.socket','sendStatus','end','json','offset','undefined','count','status','Content-Range','reject','save','then','get','WhatsappQueues','destroy','error','name','send','map','rawAttributes','type','key','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x20f2,0xd5));var _0x220f=function(_0xdd7139,_0x49b0bc){_0xdd7139=_0xdd7139-0x0;var _0xf04355=_0x20f2[_0xdd7139];return _0xf04355;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x220f('0x0'));var jsonpatch=require(_0x220f('0x1'));var rp=require(_0x220f('0x2'));var moment=require(_0x220f('0x3'));var BPromise=require(_0x220f('0x4'));var Mustache=require('mustache');var util=require(_0x220f('0x5'));var path=require(_0x220f('0x6'));var sox=require(_0x220f('0x7'));var csv=require(_0x220f('0x8'));var ejs=require(_0x220f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x220f('0xa'));var squel=require(_0x220f('0xb'));var crypto=require(_0x220f('0xc'));var jsforce=require(_0x220f('0xd'));var deskjs=require(_0x220f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x220f('0xf'));var Papa=require(_0x220f('0x10'));var Redis=require(_0x220f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x220f('0x12'));var as=require(_0x220f('0x13'));var hardwareService=require(_0x220f('0x14'));var logger=require(_0x220f('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x220f('0x16'));var licenseUtil=require(_0x220f('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x220f('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x220f('0x19'))(new Redis(config[_0x220f('0x18')]));require(_0x220f('0x1a'))['register'](socket);function respondWithStatusCode(_0x2d6b2a,_0x306805){_0x306805=_0x306805||0xcc;return function(_0x174023){if(_0x174023){return _0x2d6b2a[_0x220f('0x1b')](_0x306805);}return _0x2d6b2a['status'](_0x306805)[_0x220f('0x1c')]();};}function respondWithResult(_0x3929c2,_0x25461a){_0x25461a=_0x25461a||0xc8;return function(_0x4f71f1){if(_0x4f71f1){return _0x3929c2['status'](_0x25461a)[_0x220f('0x1d')](_0x4f71f1);}};}function respondWithFilteredResult(_0x5eba63,_0x1f63e3){return function(_0x2c0063){if(_0x2c0063){var _0x2722d2=typeof _0x1f63e3[_0x220f('0x1e')]===_0x220f('0x1f')&&typeof _0x1f63e3['limit']==='undefined';var _0xda0979=_0x2c0063['count'];var _0x31299c=_0x2722d2?0x0:_0x1f63e3[_0x220f('0x1e')];var _0x6791ac=_0x2722d2?_0x2c0063[_0x220f('0x20')]:_0x1f63e3[_0x220f('0x1e')]+_0x1f63e3['limit'];var _0x4c0939;if(_0x6791ac>=_0xda0979){_0x6791ac=_0xda0979;_0x4c0939=0xc8;}else{_0x4c0939=0xce;}_0x5eba63[_0x220f('0x21')](_0x4c0939);return _0x5eba63['set'](_0x220f('0x22'),_0x31299c+'-'+_0x6791ac+'/'+_0xda0979)[_0x220f('0x1d')](_0x2c0063);}return null;};}function patchUpdates(_0x5178c6){return function(_0x461a38){try{jsonpatch['apply'](_0x461a38,_0x5178c6,!![]);}catch(_0x40c5c6){return BPromise[_0x220f('0x23')](_0x40c5c6);}return _0x461a38[_0x220f('0x24')]();};}function saveUpdates(_0x1767df,_0x11aaef){return function(_0x5d4a22){if(_0x5d4a22){return _0x5d4a22['update'](_0x1767df)[_0x220f('0x25')](function(_0xfd1e8a){return _0xfd1e8a;});}return null;};}function removeEntity(_0x38f6ed,_0x5063f1){return function(_0x5339bb){if(_0x5339bb){return _0x5339bb['destroy']()['then'](function(){var _0x8fbefd=_0x5339bb[_0x220f('0x26')]({'plain':!![]});var _0x35d7bf=_0x220f('0x27');return db['UserProfileResource'][_0x220f('0x28')]({'where':{'type':_0x35d7bf,'resourceId':_0x8fbefd['id']}})[_0x220f('0x25')](function(){return _0x5339bb;});})[_0x220f('0x25')](function(){_0x38f6ed[_0x220f('0x21')](0xcc)[_0x220f('0x1c')]();});}};}function handleEntityNotFound(_0x25f05c,_0xf6e071){return function(_0x24d387){if(!_0x24d387){_0x25f05c[_0x220f('0x1b')](0x194);}return _0x24d387;};}function handleError(_0x52c30d,_0x575ef3){_0x575ef3=_0x575ef3||0x1f4;return function(_0x4a70ad){logger[_0x220f('0x29')](_0x4a70ad['stack']);if(_0x4a70ad['name']){delete _0x4a70ad[_0x220f('0x2a')];}_0x52c30d[_0x220f('0x21')](_0x575ef3)[_0x220f('0x2b')](_0x4a70ad);};}exports['index']=function(_0x1a4cb1,_0x1d66df){var _0x4334d7={},_0x4b41ad={},_0x2f348a={'count':0x0,'rows':[]};var _0x2ebf0d=_[_0x220f('0x2c')](db['WhatsappQueue'][_0x220f('0x2d')],function(_0x50a492){return{'name':_0x50a492['fieldName'],'type':_0x50a492[_0x220f('0x2e')][_0x220f('0x2f')]};});_0x4b41ad['model']=_[_0x220f('0x2c')](_0x2ebf0d,'name');_0x4b41ad[_0x220f('0x30')]=_[_0x220f('0x31')](_0x1a4cb1[_0x220f('0x30')]);_0x4b41ad['filters']=_[_0x220f('0x32')](_0x4b41ad['model'],_0x4b41ad[_0x220f('0x30')]);_0x4334d7[_0x220f('0x33')]=_[_0x220f('0x32')](_0x4b41ad['model'],qs[_0x220f('0x34')](_0x1a4cb1['query']['fields']));_0x4334d7['attributes']=_0x4334d7[_0x220f('0x33')][_0x220f('0x35')]?_0x4334d7[_0x220f('0x33')]:_0x4b41ad['model'];if(!_0x1a4cb1[_0x220f('0x30')][_0x220f('0x36')](_0x220f('0x37'))){_0x4334d7[_0x220f('0x38')]=qs['limit'](_0x1a4cb1[_0x220f('0x30')]['limit']);_0x4334d7[_0x220f('0x1e')]=qs[_0x220f('0x1e')](_0x1a4cb1[_0x220f('0x30')]['offset']);}_0x4334d7[_0x220f('0x39')]=qs[_0x220f('0x3a')](_0x1a4cb1[_0x220f('0x30')][_0x220f('0x3a')]);_0x4334d7[_0x220f('0x3b')]=qs[_0x220f('0x3c')](_[_0x220f('0x3d')](_0x1a4cb1[_0x220f('0x30')],_0x4b41ad[_0x220f('0x3c')]),_0x2ebf0d);if(_0x1a4cb1['query'][_0x220f('0x3e')]){_0x4334d7[_0x220f('0x3b')]=_[_0x220f('0x3f')](_0x4334d7[_0x220f('0x3b')],{'$or':_[_0x220f('0x2c')](_0x2ebf0d,function(_0x2149bb){if(_0x2149bb[_0x220f('0x2e')]!==_0x220f('0x40')){var _0x5db5db={};_0x5db5db[_0x2149bb['name']]={'$like':'%'+_0x1a4cb1['query'][_0x220f('0x3e')]+'%'};return _0x5db5db;}})});}_0x4334d7=_[_0x220f('0x3f')]({},_0x4334d7,_0x1a4cb1[_0x220f('0x41')]);var _0x88c1ed={'where':_0x4334d7[_0x220f('0x3b')]};return db[_0x220f('0x42')][_0x220f('0x20')](_0x88c1ed)[_0x220f('0x25')](function(_0x5a65db){_0x2f348a[_0x220f('0x20')]=_0x5a65db;if(_0x1a4cb1[_0x220f('0x30')]['includeAll']){_0x4334d7[_0x220f('0x43')]=[{'all':!![]}];}return db[_0x220f('0x42')][_0x220f('0x44')](_0x4334d7);})[_0x220f('0x25')](function(_0x550999){_0x2f348a['rows']=_0x550999;return _0x2f348a;})[_0x220f('0x25')](respondWithFilteredResult(_0x1d66df,_0x4334d7))[_0x220f('0x45')](handleError(_0x1d66df,null));};exports[_0x220f('0x46')]=function(_0x22337c,_0x5622a6){var _0x948021={'raw':!![],'where':{'id':_0x22337c[_0x220f('0x47')]['id']}},_0x4909e0={};_0x4909e0[_0x220f('0x48')]=_['keys'](db[_0x220f('0x42')][_0x220f('0x2d')]);_0x4909e0['query']=_[_0x220f('0x31')](_0x22337c[_0x220f('0x30')]);_0x4909e0[_0x220f('0x3c')]=_['intersection'](_0x4909e0['model'],_0x4909e0[_0x220f('0x30')]);_0x948021[_0x220f('0x33')]=_[_0x220f('0x32')](_0x4909e0['model'],qs['fields'](_0x22337c[_0x220f('0x30')][_0x220f('0x34')]));_0x948021[_0x220f('0x33')]=_0x948021[_0x220f('0x33')][_0x220f('0x35')]?_0x948021['attributes']:_0x4909e0[_0x220f('0x48')];if(_0x22337c[_0x220f('0x30')][_0x220f('0x49')]){_0x948021[_0x220f('0x43')]=[{'all':!![]}];}_0x948021=_['merge']({},_0x948021,_0x22337c['options']);return db[_0x220f('0x42')][_0x220f('0x4a')](_0x948021)[_0x220f('0x25')](handleEntityNotFound(_0x5622a6,null))[_0x220f('0x25')](respondWithResult(_0x5622a6,null))['catch'](handleError(_0x5622a6,null));};exports[_0x220f('0x4b')]=function(_0x164ed8,_0x40ca29){return db['WhatsappQueue']['create'](_0x164ed8[_0x220f('0x4c')],{})['then'](function(_0x5de052){var _0x3f6826=_0x164ed8[_0x220f('0x4d')]['get']({'plain':!![]});if(!_0x3f6826)throw new Error(_0x220f('0x4e'));if(_0x3f6826[_0x220f('0x4f')]==='user'){var _0x432cf6=_0x5de052['get']({'plain':!![]});var _0x382b2e=_0x220f('0x27');return db[_0x220f('0x50')]['find']({'where':{'name':_0x382b2e,'userProfileId':_0x3f6826[_0x220f('0x51')]},'raw':!![]})[_0x220f('0x25')](function(_0x377421){if(_0x377421&&_0x377421[_0x220f('0x52')]===0x0){return db[_0x220f('0x53')][_0x220f('0x4b')]({'name':_0x432cf6[_0x220f('0x2a')],'resourceId':_0x432cf6['id'],'type':_0x377421[_0x220f('0x2a')],'sectionId':_0x377421['id']},{})[_0x220f('0x25')](function(){return _0x5de052;});}else{return _0x5de052;}})['catch'](function(_0x25b095){logger['error'](_0x220f('0x54'),_0x25b095);throw _0x25b095;});}return _0x5de052;})['then'](respondWithResult(_0x40ca29,0xc9))[_0x220f('0x45')](handleError(_0x40ca29,null));};exports['update']=function(_0x16496a,_0x5198e3){if(_0x16496a[_0x220f('0x4c')]['id']){delete _0x16496a[_0x220f('0x4c')]['id'];}return db[_0x220f('0x42')][_0x220f('0x4a')]({'where':{'id':_0x16496a[_0x220f('0x47')]['id']}})[_0x220f('0x25')](handleEntityNotFound(_0x5198e3,null))[_0x220f('0x25')](saveUpdates(_0x16496a[_0x220f('0x4c')],null))['then'](respondWithResult(_0x5198e3,null))[_0x220f('0x45')](handleError(_0x5198e3,null));};exports[_0x220f('0x28')]=function(_0x2f0895,_0x19129e){return db[_0x220f('0x42')]['find']({'where':{'id':_0x2f0895['params']['id']}})[_0x220f('0x25')](handleEntityNotFound(_0x19129e,null))['then'](removeEntity(_0x19129e,null))[_0x220f('0x45')](handleError(_0x19129e,null));};exports[_0x220f('0x55')]=function(_0x270bd7,_0x1363d0){return db[_0x220f('0x42')][_0x220f('0x55')]()[_0x220f('0x25')](respondWithResult(_0x1363d0,null))[_0x220f('0x45')](handleError(_0x1363d0,null));};exports[_0x220f('0x56')]=function(_0x2bc12a,_0x7ca2c4,_0x1bce84){var _0x5ac098={'raw':!![],'where':{}},_0x33de8e={},_0x4672a9;return db[_0x220f('0x42')][_0x220f('0x57')]({'where':{'id':_0x2bc12a[_0x220f('0x47')]['id']}})[_0x220f('0x25')](handleEntityNotFound(_0x7ca2c4,null))[_0x220f('0x25')](function(_0x54641a){if(_0x54641a){_0x4672a9=_0x54641a['get']({'plain':!![]});_0x33de8e['model']=_[_0x220f('0x31')](db[_0x220f('0x58')]['rawAttributes']);_0x33de8e['query']=_[_0x220f('0x31')](_0x2bc12a[_0x220f('0x30')]);_0x33de8e[_0x220f('0x3c')]=_['intersection'](_0x33de8e[_0x220f('0x48')],_0x33de8e[_0x220f('0x30')]);_0x5ac098[_0x220f('0x33')]=_[_0x220f('0x32')](_0x33de8e[_0x220f('0x48')],qs['fields'](_0x2bc12a['query'][_0x220f('0x34')]));_0x5ac098[_0x220f('0x33')]=_0x5ac098['attributes'][_0x220f('0x35')]?_0x5ac098[_0x220f('0x33')]:_0x33de8e['model'];if(!_0x2bc12a[_0x220f('0x30')][_0x220f('0x36')](_0x220f('0x37'))){_0x5ac098[_0x220f('0x38')]=qs[_0x220f('0x38')](_0x2bc12a[_0x220f('0x30')][_0x220f('0x38')]);_0x5ac098[_0x220f('0x1e')]=qs['offset'](_0x2bc12a[_0x220f('0x30')][_0x220f('0x1e')]);}_0x5ac098[_0x220f('0x39')]=qs[_0x220f('0x3a')](_0x2bc12a[_0x220f('0x30')][_0x220f('0x3a')]);_0x5ac098[_0x220f('0x3b')]=qs[_0x220f('0x3c')](_[_0x220f('0x3d')](_0x2bc12a['query'],_0x33de8e[_0x220f('0x3c')]));_0x5ac098[_0x220f('0x3b')]['WhatsappQueueId']=_0x54641a['id'];if(_0x2bc12a[_0x220f('0x30')][_0x220f('0x3e')]){_0x5ac098['where']=_[_0x220f('0x3f')](_0x5ac098[_0x220f('0x3b')],{'$or':_[_0x220f('0x2c')](_0x5ac098[_0x220f('0x33')],function(_0x2b3e7b){var _0x514689={};_0x514689[_0x2b3e7b]={'$like':'%'+_0x2bc12a['query']['filter']+'%'};return _0x514689;})});}_0x5ac098=_['merge']({},_0x5ac098,_0x2bc12a[_0x220f('0x41')]);return db[_0x220f('0x58')]['findAll'](_0x5ac098);}})['then'](function(_0x171ebc){if(_0x171ebc){return db[_0x220f('0x59')][_0x220f('0x5a')]({'where':{'id':_['map'](_0x171ebc,_0x220f('0x5b')),'role':'agent'},'attributes':['id','name','whatsappPause',_0x220f('0x5c'),_0x220f('0x5d')]});}})[_0x220f('0x25')](function(_0x4d27c3){if(_0x4d27c3){return{'count':_0x4d27c3[_0x220f('0x20')],'rows':_['map'](_0x4d27c3[_0x220f('0x5e')],function(_0x554082){return{'membername':_0x554082['name'],'UserId':_0x554082['id'],'queue_name':_0x4672a9[_0x220f('0x2a')],'WhatsappQueueId':_0x4672a9['id'],'interface':util['format'](_0x220f('0x5f'),_0x220f('0x60'),_0x554082[_0x220f('0x2a')]),'penalty':0x0,'paused':_0x554082[_0x220f('0x61')],'createdAt':_0x554082[_0x220f('0x5d')],'updatedAt':_0x554082['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x220f('0x25')](respondWithFilteredResult(_0x7ca2c4,_0x5ac098))[_0x220f('0x45')](handleError(_0x7ca2c4,null));};exports[_0x220f('0x62')]=function(_0x38dcb,_0x50a294,_0x396915){var _0x438243={};var _0x5ea897={};var _0x177dfb;var _0x3abd70;return db['WhatsappQueue'][_0x220f('0x57')]({'where':{'id':_0x38dcb[_0x220f('0x47')]['id']}})[_0x220f('0x25')](handleEntityNotFound(_0x50a294,null))[_0x220f('0x25')](function(_0x11b3d0){if(_0x11b3d0){_0x177dfb=_0x11b3d0;_0x5ea897[_0x220f('0x48')]=_[_0x220f('0x31')](db[_0x220f('0x63')][_0x220f('0x2d')]);_0x5ea897['query']=_[_0x220f('0x31')](_0x38dcb['query']);_0x5ea897[_0x220f('0x3c')]=_[_0x220f('0x32')](_0x5ea897['model'],_0x5ea897[_0x220f('0x30')]);_0x438243['attributes']=_[_0x220f('0x32')](_0x5ea897[_0x220f('0x48')],qs[_0x220f('0x34')](_0x38dcb[_0x220f('0x30')][_0x220f('0x34')]));_0x438243[_0x220f('0x33')]=_0x438243[_0x220f('0x33')][_0x220f('0x35')]?_0x438243[_0x220f('0x33')]:_0x5ea897[_0x220f('0x48')];_0x438243['order']=qs[_0x220f('0x3a')](_0x38dcb[_0x220f('0x30')]['sort']);_0x438243[_0x220f('0x3b')]=qs['filters'](_[_0x220f('0x3d')](_0x38dcb[_0x220f('0x30')],_0x5ea897['filters']));if(_0x38dcb[_0x220f('0x30')]['filter']){_0x438243[_0x220f('0x3b')]=_[_0x220f('0x3f')](_0x438243[_0x220f('0x3b')],{'$or':_[_0x220f('0x2c')](_0x438243[_0x220f('0x33')],function(_0x2075f5){var _0x2769ca={};_0x2769ca[_0x2075f5]={'$like':'%'+_0x38dcb[_0x220f('0x30')][_0x220f('0x3e')]+'%'};return _0x2769ca;})});}_0x438243=_[_0x220f('0x3f')]({},_0x438243,_0x38dcb[_0x220f('0x41')]);return _0x177dfb[_0x220f('0x62')](_0x438243);}})['then'](function(_0x41d3b3){if(_0x41d3b3){_0x3abd70=_0x41d3b3[_0x220f('0x35')];if(!_0x38dcb[_0x220f('0x30')][_0x220f('0x36')](_0x220f('0x37'))){_0x438243[_0x220f('0x38')]=qs[_0x220f('0x38')](_0x38dcb['query']['limit']);_0x438243[_0x220f('0x1e')]=qs[_0x220f('0x1e')](_0x38dcb[_0x220f('0x30')][_0x220f('0x1e')]);}return _0x177dfb[_0x220f('0x62')](_0x438243);}})[_0x220f('0x25')](function(_0x4bdc7e){if(_0x4bdc7e){return _0x4bdc7e?{'count':_0x3abd70,'rows':_0x4bdc7e}:null;}})[_0x220f('0x25')](respondWithResult(_0x50a294,null))['catch'](handleError(_0x50a294,null));};exports[_0x220f('0x64')]=function(_0x16e6e8,_0x55e479,_0x5b9add){var _0x2f642b=_0x16e6e8[_0x220f('0x4c')][_0x220f('0x65')];return db['Team'][_0x220f('0x44')]({'where':{'id':_0x2f642b},'attributes':['id'],'include':[{'model':db[_0x220f('0x59')],'as':'Agents','attributes':['id',_0x220f('0x2a'),_0x220f('0x66'),_0x220f('0x67'),_0x220f('0x68')],'raw':!![]}]})[_0x220f('0x25')](function(_0x5347f9){if(_0x5347f9){var _0x5656e1=_[_0x220f('0x69')](_0x5347f9,function(_0x1e2bd4){var _0x295391=_0x1e2bd4[_0x220f('0x26')]({'plain':!![]});return _0x295391[_0x220f('0x6a')];});return db['WhatsappQueue'][_0x220f('0x4a')]({'where':{'id':_0x16e6e8[_0x220f('0x47')]['id']}})[_0x220f('0x25')](function(_0x2aa7f4){return db[_0x220f('0x6b')][_0x220f('0x6c')](function(_0x5e73b4){return _0x2aa7f4[_0x220f('0x64')](_0x2f642b,{'transaction':_0x5e73b4})['then'](function(){return BPromise[_0x220f('0x6d')](_0x5656e1,function(_0x1c3ed2){return db[_0x220f('0x58')][_0x220f('0x6e')]({'where':{'UserId':_0x1c3ed2['id'],'WhatsappQueueId':_0x16e6e8['params']['id']},'transaction':_0x5e73b4});});})['then'](function(){_0x5656e1[_0x220f('0x6f')](function(_0x5e5de5){socket[_0x220f('0x70')]('userWhatsappQueue:save',{'UserId':_0x5e5de5['id'],'WhatsappQueueId':_0x2aa7f4['id']});});});});});}})['then'](respondWithStatusCode(_0x55e479,null))[_0x220f('0x45')](handleError(_0x55e479,null));};exports[_0x220f('0x71')]=function(_0x4b05e9,_0x271f1f,_0x4a5e0e){return db['Team'][_0x220f('0x44')]({'where':{'id':_0x4b05e9[_0x220f('0x30')][_0x220f('0x65')]},'attributes':['id'],'include':[{'model':db[_0x220f('0x59')],'as':_0x220f('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x220f('0x25')](handleEntityNotFound(_0x271f1f,null))[_0x220f('0x25')](function(_0x4516a3){var _0x570ec6=_[_0x220f('0x2c')](_0x4516a3,'id');var _0x5e3c6e=[];var _0x52acb8=[];var _0xff91cd=squel[_0x220f('0x72')]();_0xff91cd[_0x220f('0x73')](_0x220f('0x74'))['from']('team_has_whatsapp_queues','tq')[_0x220f('0x75')](_0x220f('0x76'),'ut',_0x220f('0x77'))['where']('WhatsappQueueId\x20=\x20?',_0x4b05e9[_0x220f('0x47')]['id']);for(var _0x1bee36=0x0;_0x1bee36<_0x4516a3[_0x220f('0x35')];_0x1bee36+=0x1){let _0x1c7c93=_0x4516a3[_0x1bee36];for(var _0xe17cbb=0x0;_0xe17cbb<_0x1c7c93[_0x220f('0x6a')][_0x220f('0x35')];_0xe17cbb+=0x1){let _0x194a4f=_0x1c7c93[_0x220f('0x6a')][_0xe17cbb];var _0x546aa8=_0xff91cd[_0x220f('0x78')]();_0x546aa8['where'](_0x220f('0x79'),_0x194a4f['id']);_0x52acb8['push'](db[_0x220f('0x6b')][_0x220f('0x30')](_0x546aa8[_0x220f('0x7a')](),{'type':db[_0x220f('0x6b')]['QueryTypes'][_0x220f('0x7b')]})['then'](function(_0x381c1d){if(_0x381c1d[_0x220f('0x35')]===0x1){return _0x194a4f['id'];}else{var _0x4e461c=_[_0x220f('0x7c')](_[_0x220f('0x2c')](_0x381c1d,'TeamId'),function(_0x202896){return _[_0x220f('0x7d')](_0x570ec6,_0x202896);});if(_0x4e461c){return _0x194a4f['id'];}}}));}}return BPromise[_0x220f('0x7e')](_0x52acb8)[_0x220f('0x25')](function(_0x250785){_0x5e3c6e=_(_0x5e3c6e)[_0x220f('0x7f')](_0x250785)['compact']()[_0x220f('0x80')]();return db[_0x220f('0x42')]['find']({'where':{'id':_0x4b05e9[_0x220f('0x47')]['id']}})[_0x220f('0x25')](function(_0x194e62){return db[_0x220f('0x6b')][_0x220f('0x6c')](function(_0x11d372){return _0x194e62['removeTeams'](_0x4b05e9[_0x220f('0x30')][_0x220f('0x65')],{'transaction':_0x11d372})[_0x220f('0x25')](function(){if(!_['isEmpty'](_0x5e3c6e)){return _0x194e62[_0x220f('0x81')](_0x5e3c6e,{'transaction':_0x11d372});}})['then'](function(){_0x5e3c6e[_0x220f('0x6f')](function(_0x4b37f4){socket[_0x220f('0x70')](_0x220f('0x82'),{'UserId':_0x4b37f4,'WhatsappQueueId':_0x194e62['id']});});});});});});})[_0x220f('0x25')](respondWithStatusCode(_0x271f1f,null))['catch'](handleError(_0x271f1f,null));};exports[_0x220f('0x83')]=function(_0x22e79a,_0x34c756,_0x304fde){return db[_0x220f('0x42')][_0x220f('0x4a')]({'where':{'id':_0x22e79a['params']['id']}})[_0x220f('0x25')](handleEntityNotFound(_0x34c756,null))[_0x220f('0x25')](function(_0x3a75fe){if(_0x3a75fe){return _0x3a75fe['addAgents'](_0x22e79a['body'][_0x220f('0x65')],_[_0x220f('0x84')](_0x22e79a['body'],['ids','id'])||{})['spread'](function(_0x4e6fee){for(var _0x399954=0x0;_0x399954<_0x22e79a[_0x220f('0x4c')][_0x220f('0x65')]['length'];_0x399954+=0x1){socket[_0x220f('0x70')](_0x220f('0x85'),{'UserId':Number(_0x22e79a[_0x220f('0x4c')][_0x220f('0x65')][_0x399954]),'WhatsappQueueId':Number(_0x22e79a[_0x220f('0x47')]['id'])});}return _0x4e6fee;});}})[_0x220f('0x25')](respondWithResult(_0x34c756,null))['catch'](handleError(_0x34c756,null));};exports[_0x220f('0x81')]=function(_0x42d20d,_0x447984,_0x49122c){return db[_0x220f('0x42')]['find']({'where':{'id':_0x42d20d[_0x220f('0x47')]['id']}})[_0x220f('0x25')](handleEntityNotFound(_0x447984,null))[_0x220f('0x25')](function(_0x4c1bf1){if(_0x4c1bf1){return _0x4c1bf1[_0x220f('0x81')](_0x42d20d['query']['ids'])['then'](function(){if(_[_0x220f('0x86')](_0x42d20d[_0x220f('0x30')]['ids'])){for(var _0x155ee6=0x0;_0x155ee6<_0x42d20d[_0x220f('0x30')][_0x220f('0x65')]['length'];_0x155ee6+=0x1){socket[_0x220f('0x70')](_0x220f('0x82'),{'UserId':Number(_0x42d20d[_0x220f('0x30')]['ids'][_0x155ee6]),'WhatsappQueueId':Number(_0x42d20d[_0x220f('0x47')]['id'])});}}else{socket[_0x220f('0x70')](_0x220f('0x82'),{'UserId':Number(_0x42d20d[_0x220f('0x30')]['ids']),'WhatsappQueueId':Number(_0x42d20d[_0x220f('0x47')]['id'])});}});}})[_0x220f('0x25')](respondWithStatusCode(_0x447984,null))[_0x220f('0x45')](handleError(_0x447984,null));};exports[_0x220f('0x87')]=function(_0x3cbe5b,_0x2c2334,_0x164e67){var _0x53e680={};var _0x2fa84d={};var _0x5e0b31;var _0x1f740e;return db[_0x220f('0x42')][_0x220f('0x57')]({'where':{'id':_0x3cbe5b[_0x220f('0x47')]['id']}})[_0x220f('0x25')](handleEntityNotFound(_0x2c2334,null))[_0x220f('0x25')](function(_0xf9001c){if(_0xf9001c){_0x5e0b31=_0xf9001c;_0x2fa84d['model']=_[_0x220f('0x31')](db['User']['rawAttributes']);_0x2fa84d[_0x220f('0x30')]=_[_0x220f('0x31')](_0x3cbe5b['query']);_0x2fa84d[_0x220f('0x3c')]=_['intersection'](_0x2fa84d[_0x220f('0x48')],_0x2fa84d[_0x220f('0x30')]);_0x53e680[_0x220f('0x33')]=_[_0x220f('0x32')](_0x2fa84d[_0x220f('0x48')],qs[_0x220f('0x34')](_0x3cbe5b[_0x220f('0x30')]['fields']));_0x53e680[_0x220f('0x33')]=_0x53e680[_0x220f('0x33')]['length']?_0x53e680[_0x220f('0x33')]:_0x2fa84d[_0x220f('0x48')];_0x53e680['order']=qs[_0x220f('0x3a')](_0x3cbe5b[_0x220f('0x30')][_0x220f('0x3a')]);_0x53e680[_0x220f('0x3b')]=qs[_0x220f('0x3c')](_['pick'](_0x3cbe5b[_0x220f('0x30')],_0x2fa84d['filters']));if(_0x3cbe5b['query']['filter']){_0x53e680[_0x220f('0x3b')]=_[_0x220f('0x3f')](_0x53e680['where'],{'$or':_['map'](_0x53e680[_0x220f('0x33')],function(_0x5f396c){var _0x371d53={};_0x371d53[_0x5f396c]={'$like':'%'+_0x3cbe5b[_0x220f('0x30')][_0x220f('0x3e')]+'%'};return _0x371d53;})});}_0x53e680=_['merge']({},_0x53e680,_0x3cbe5b[_0x220f('0x41')]);return _0x5e0b31[_0x220f('0x87')](_0x53e680);}})['then'](function(_0x82d9bb){if(_0x82d9bb){_0x1f740e=_0x82d9bb['length'];if(!_0x3cbe5b['query'][_0x220f('0x36')]('nolimit')){_0x53e680[_0x220f('0x38')]=qs[_0x220f('0x38')](_0x3cbe5b[_0x220f('0x30')][_0x220f('0x38')]);_0x53e680['offset']=qs[_0x220f('0x1e')](_0x3cbe5b[_0x220f('0x30')][_0x220f('0x1e')]);}return _0x5e0b31['getAgents'](_0x53e680);}})[_0x220f('0x25')](function(_0x297814){if(_0x297814){return _0x297814?{'count':_0x1f740e,'rows':_0x297814}:null;}})[_0x220f('0x25')](respondWithResult(_0x2c2334,null))[_0x220f('0x45')](handleError(_0x2c2334,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 07c9c2d..be63c45 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 _0xed78=['exports','events','../../mysqldb','WhatsappQueue','save','remove','emit','hook'];(function(_0x110738,_0x3c88c3){var _0x599789=function(_0x3801d7){while(--_0x3801d7){_0x110738['push'](_0x110738['shift']());}};_0x599789(++_0x3c88c3);}(_0xed78,0x179));var _0x8ed7=function(_0x21bfe4,_0x20ffba){_0x21bfe4=_0x21bfe4-0x0;var _0x5bef31=_0xed78[_0x21bfe4];return _0x5bef31;};'use strict';var EventEmitter=require(_0x8ed7('0x0'));var WhatsappQueue=require(_0x8ed7('0x1'))['db'][_0x8ed7('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8ed7('0x3'),'afterUpdate':'update','afterDestroy':_0x8ed7('0x4')};function emitEvent(_0x34f18e){return function(_0x551331,_0x87d9b2,_0x3a1745){WhatsappQueueEvents[_0x8ed7('0x5')](_0x34f18e+':'+_0x551331['id'],_0x551331);WhatsappQueueEvents[_0x8ed7('0x5')](_0x34f18e,_0x551331);_0x3a1745(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x8ed7('0x6')](e,emitEvent(event));}}module[_0x8ed7('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0xbdbc=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappQueue','setMaxListeners','save'];(function(_0x3d6bd3,_0x1ea55d){var _0x106abe=function(_0x125f4d){while(--_0x125f4d){_0x3d6bd3['push'](_0x3d6bd3['shift']());}};_0x106abe(++_0x1ea55d);}(_0xbdbc,0x1db));var _0xcbdb=function(_0x3a0614,_0x4b6627){_0x3a0614=_0x3a0614-0x0;var _0x12bba7=_0xbdbc[_0x3a0614];return _0x12bba7;};'use strict';var EventEmitter=require(_0xcbdb('0x0'));var WhatsappQueue=require(_0xcbdb('0x1'))['db'][_0xcbdb('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xcbdb('0x3')](0x0);var events={'afterCreate':_0xcbdb('0x4'),'afterUpdate':_0xcbdb('0x5'),'afterDestroy':_0xcbdb('0x6')};function emitEvent(_0x513a0e){return function(_0x24d3da,_0x30981a,_0x3266e2){WhatsappQueueEvents[_0xcbdb('0x7')](_0x513a0e+':'+_0x24d3da['id'],_0x24d3da);WhatsappQueueEvents[_0xcbdb('0x7')](_0x513a0e,_0x24d3da);_0x3266e2(null);};}for(var e in events){if(events[_0xcbdb('0x8')](e)){var event=events[e];WhatsappQueue[_0xcbdb('0x9')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 941be49..10ed0fc 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 _0x3d5d=['./whatsappQueue.attributes','exports','util','../../config/logger','api','moment','request-promise','path'];(function(_0x503950,_0x5022eb){var _0x1657a9=function(_0x4c1e8f){while(--_0x4c1e8f){_0x503950['push'](_0x503950['shift']());}};_0x1657a9(++_0x5022eb);}(_0x3d5d,0x1ca));var _0xd3d5=function(_0x4a6cf8,_0x5534ef){_0x4a6cf8=_0x4a6cf8-0x0;var _0x22205e=_0x3d5d[_0x4a6cf8];return _0x22205e;};'use strict';var _=require('lodash');var util=require(_0xd3d5('0x0'));var logger=require(_0xd3d5('0x1'))(_0xd3d5('0x2'));var moment=require(_0xd3d5('0x3'));var BPromise=require('bluebird');var rp=require(_0xd3d5('0x4'));var fs=require('fs');var path=require(_0xd3d5('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd3d5('0x6'));module[_0xd3d5('0x7')]=function(_0x551d47,_0x5f1660){return _0x551d47['define']('WhatsappQueue',attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3946=['./whatsappQueue.attributes','define','WhatsappQueue','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x59b993,_0x312d12){var _0x2d2b84=function(_0x1714d0){while(--_0x1714d0){_0x59b993['push'](_0x59b993['shift']());}};_0x2d2b84(++_0x312d12);}(_0x3946,0xff));var _0x6394=function(_0x27fd1d,_0x2c7271){_0x27fd1d=_0x27fd1d-0x0;var _0x41b9af=_0x3946[_0x27fd1d];return _0x41b9af;};'use strict';var _=require(_0x6394('0x0'));var util=require(_0x6394('0x1'));var logger=require(_0x6394('0x2'))(_0x6394('0x3'));var moment=require(_0x6394('0x4'));var BPromise=require(_0x6394('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6394('0x6'));var rimraf=require(_0x6394('0x7'));var config=require(_0x6394('0x8'));var attributes=require(_0x6394('0x9'));module['exports']=function(_0x535cb8,_0x1c7213){return _0x535cb8[_0x6394('0xa')](_0x6394('0xb'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index b801784..7bba4c5 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 _0xe6ce=['code','message','result','catch','WhatsappQueue','findAll','options','where','attributes','include','map','model','GetWhatsappQueue','stringify','find','raw','ShowWhatsappQueue','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe6ce,0xde));var _0xee6c=function(_0x3c66e1,_0x1c4f0e){_0x3c66e1=_0x3c66e1-0x0;var _0xe0a60c=_0xe6ce[_0x3c66e1];return _0xe0a60c;};'use strict';var _=require('lodash');var util=require(_0xee6c('0x0'));var moment=require(_0xee6c('0x1'));var BPromise=require('bluebird');var rs=require(_0xee6c('0x2'));var fs=require('fs');var Redis=require(_0xee6c('0x3'));var db=require(_0xee6c('0x4'))['db'];var utils=require(_0xee6c('0x5'));var logger=require(_0xee6c('0x6'))(_0xee6c('0x7'));var config=require(_0xee6c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xee6c('0x9')][_0xee6c('0xa')]({'port':0x232a});config[_0xee6c('0xb')]=_[_0xee6c('0xc')](config[_0xee6c('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xee6c('0xd'))(new Redis(config[_0xee6c('0xb')]));require(_0xee6c('0xe'))[_0xee6c('0xf')](socket);function respondWithRpcPromise(_0x4cd730,_0x3d868a,_0x2578d9){return new BPromise(function(_0x3063a9,_0x3a0ae2){return client[_0xee6c('0x10')](_0x4cd730,_0x2578d9)[_0xee6c('0x11')](function(_0x402466){logger[_0xee6c('0x12')](_0xee6c('0x13'),_0x3d868a,_0xee6c('0x14'));logger[_0xee6c('0x15')](_0xee6c('0x16'),_0x3d868a,_0xee6c('0x14'),JSON['stringify'](_0x402466));if(_0x402466[_0xee6c('0x17')]){if(_0x402466[_0xee6c('0x17')][_0xee6c('0x18')]===0x1f4){logger[_0xee6c('0x17')](_0xee6c('0x13'),_0x3d868a,_0x402466[_0xee6c('0x17')][_0xee6c('0x19')]);return _0x3a0ae2(_0x402466[_0xee6c('0x17')][_0xee6c('0x19')]);}logger[_0xee6c('0x17')](_0xee6c('0x13'),_0x3d868a,_0x402466[_0xee6c('0x17')]['message']);return _0x3063a9(_0x402466[_0xee6c('0x17')][_0xee6c('0x19')]);}else{logger[_0xee6c('0x12')](_0xee6c('0x13'),_0x3d868a,_0xee6c('0x14'));_0x3063a9(_0x402466[_0xee6c('0x1a')][_0xee6c('0x19')]);}})[_0xee6c('0x1b')](function(_0x41316d){logger[_0xee6c('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x3d868a,_0x41316d);_0x3a0ae2(_0x41316d);});});}exports['GetWhatsappQueue']=function(_0x1dbd99){var _0x58c4a4=this;return new Promise(function(_0x579159,_0x4ede44){return db[_0xee6c('0x1c')][_0xee6c('0x1d')]({'raw':_0x1dbd99[_0xee6c('0x1e')]?_0x1dbd99[_0xee6c('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x1dbd99[_0xee6c('0x1e')]?_0x1dbd99['options'][_0xee6c('0x1f')]||null:null,'attributes':_0x1dbd99[_0xee6c('0x1e')]?_0x1dbd99[_0xee6c('0x1e')][_0xee6c('0x20')]||null:null,'limit':_0x1dbd99[_0xee6c('0x1e')]?_0x1dbd99[_0xee6c('0x1e')]['limit']||null:null,'include':_0x1dbd99['options']?_0x1dbd99[_0xee6c('0x1e')][_0xee6c('0x21')]?_[_0xee6c('0x22')](_0x1dbd99[_0xee6c('0x1e')][_0xee6c('0x21')],function(_0x1ad4a5){return{'model':db[_0x1ad4a5[_0xee6c('0x23')]],'as':_0x1ad4a5['as'],'attributes':_0x1ad4a5[_0xee6c('0x20')],'include':_0x1ad4a5[_0xee6c('0x21')]?_[_0xee6c('0x22')](_0x1ad4a5[_0xee6c('0x21')],function(_0x3422ed){return{'model':db[_0x3422ed[_0xee6c('0x23')]],'as':_0x3422ed['as'],'attributes':_0x3422ed[_0xee6c('0x20')],'include':_0x3422ed['include']?_['map'](_0x3422ed[_0xee6c('0x21')],function(_0x79f337){return{'model':db[_0x79f337['model']],'as':_0x79f337['as'],'attributes':_0x79f337[_0xee6c('0x20')]};}):[]};}):[]};}):[]:[]})[_0xee6c('0x11')](function(_0x3212fe){logger[_0xee6c('0x12')]('GetWhatsappQueue',_0x1dbd99);logger[_0xee6c('0x15')](_0xee6c('0x24'),_0x1dbd99,JSON[_0xee6c('0x25')](_0x3212fe));_0x579159(_0x3212fe);})[_0xee6c('0x1b')](function(_0xfaa291){logger[_0xee6c('0x17')](_0xee6c('0x24'),_0xfaa291[_0xee6c('0x19')],_0x1dbd99);_0x4ede44(_0x58c4a4['error'](0x1f4,_0xfaa291[_0xee6c('0x19')]));});});};exports['ShowWhatsappQueue']=function(_0x5658bc){var _0x40e4b1=this;return new Promise(function(_0x20cec4,_0x5e62eb){return db[_0xee6c('0x1c')][_0xee6c('0x26')]({'raw':_0x5658bc['options']?_0x5658bc[_0xee6c('0x1e')][_0xee6c('0x27')]===undefined?!![]:![]:!![],'where':_0x5658bc[_0xee6c('0x1e')]?_0x5658bc['options']['where']||null:null,'attributes':_0x5658bc['options']?_0x5658bc[_0xee6c('0x1e')][_0xee6c('0x20')]||null:null,'include':_0x5658bc[_0xee6c('0x1e')]?_0x5658bc['options'][_0xee6c('0x21')]?_[_0xee6c('0x22')](_0x5658bc['options'][_0xee6c('0x21')],function(_0x7800f9){return{'model':db[_0x7800f9[_0xee6c('0x23')]],'as':_0x7800f9['as'],'attributes':_0x7800f9[_0xee6c('0x20')],'include':_0x7800f9['include']?_[_0xee6c('0x22')](_0x7800f9[_0xee6c('0x21')],function(_0xca15e7){return{'model':db[_0xca15e7[_0xee6c('0x23')]],'as':_0xca15e7['as'],'attributes':_0xca15e7[_0xee6c('0x20')],'include':_0xca15e7[_0xee6c('0x21')]?_[_0xee6c('0x22')](_0xca15e7['include'],function(_0xe41d09){return{'model':db[_0xe41d09[_0xee6c('0x23')]],'as':_0xe41d09['as'],'attributes':_0xe41d09[_0xee6c('0x20')]};}):[]};}):[]};}):[]:[]})[_0xee6c('0x11')](function(_0x3c71f5){logger[_0xee6c('0x12')](_0xee6c('0x28'),_0x5658bc);logger['debug']('ShowWhatsappQueue',_0x5658bc,JSON[_0xee6c('0x25')](_0x3c71f5));_0x20cec4(_0x3c71f5);})[_0xee6c('0x1b')](function(_0x2bcef5){logger['error'](_0xee6c('0x28'),_0x2bcef5[_0xee6c('0x19')],_0x5658bc);_0x5e62eb(_0x40e4b1[_0xee6c('0x17')](0x1f4,_0x2bcef5['message']));});});}; \ No newline at end of file +var _0x764d=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','WhatsappQueue','raw','options','where','attributes','include','map','model','GetWhatsappQueue','ShowWhatsappQueue','debug'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x764d,0x75));var _0xd764=function(_0x311909,_0x414bf7){_0x311909=_0x311909-0x0;var _0x8d3163=_0x764d[_0x311909];return _0x8d3163;};'use strict';var _=require(_0xd764('0x0'));var util=require(_0xd764('0x1'));var moment=require('moment');var BPromise=require(_0xd764('0x2'));var rs=require(_0xd764('0x3'));var fs=require('fs');var Redis=require(_0xd764('0x4'));var db=require(_0xd764('0x5'))['db'];var utils=require(_0xd764('0x6'));var logger=require(_0xd764('0x7'))(_0xd764('0x8'));var config=require(_0xd764('0x9'));var jayson=require(_0xd764('0xa'));var client=jayson[_0xd764('0xb')][_0xd764('0xc')]({'port':0x232a});config[_0xd764('0xd')]=_['defaults'](config[_0xd764('0xd')],{'host':_0xd764('0xe'),'port':0x18eb});var socket=require(_0xd764('0xf'))(new Redis(config[_0xd764('0xd')]));require(_0xd764('0x10'))[_0xd764('0x11')](socket);function respondWithRpcPromise(_0x1a6c96,_0x54cc91,_0x5a6281){return new BPromise(function(_0x3dc87f,_0x5a2100){return client[_0xd764('0x12')](_0x1a6c96,_0x5a6281)[_0xd764('0x13')](function(_0x115d6c){logger[_0xd764('0x14')](_0xd764('0x15'),_0x54cc91,_0xd764('0x16'));logger['debug']('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x54cc91,_0xd764('0x16'),JSON[_0xd764('0x17')](_0x115d6c));if(_0x115d6c[_0xd764('0x18')]){if(_0x115d6c[_0xd764('0x18')]['code']===0x1f4){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x54cc91,_0x115d6c[_0xd764('0x18')]['message']);return _0x5a2100(_0x115d6c[_0xd764('0x18')]['message']);}logger[_0xd764('0x18')](_0xd764('0x15'),_0x54cc91,_0x115d6c[_0xd764('0x18')][_0xd764('0x19')]);return _0x3dc87f(_0x115d6c[_0xd764('0x18')]['message']);}else{logger[_0xd764('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x54cc91,_0xd764('0x16'));_0x3dc87f(_0x115d6c[_0xd764('0x1a')][_0xd764('0x19')]);}})[_0xd764('0x1b')](function(_0xee6aff){logger[_0xd764('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x54cc91,_0xee6aff);_0x5a2100(_0xee6aff);});});}exports['GetWhatsappQueue']=function(_0x53b11a){var _0x1da37e=this;return new Promise(function(_0x140459,_0x3e4393){return db[_0xd764('0x1c')]['findAll']({'raw':_0x53b11a['options']?_0x53b11a['options'][_0xd764('0x1d')]===undefined?!![]:![]:!![],'where':_0x53b11a[_0xd764('0x1e')]?_0x53b11a[_0xd764('0x1e')][_0xd764('0x1f')]||null:null,'attributes':_0x53b11a[_0xd764('0x1e')]?_0x53b11a['options'][_0xd764('0x20')]||null:null,'limit':_0x53b11a[_0xd764('0x1e')]?_0x53b11a[_0xd764('0x1e')]['limit']||null:null,'include':_0x53b11a[_0xd764('0x1e')]?_0x53b11a[_0xd764('0x1e')][_0xd764('0x21')]?_[_0xd764('0x22')](_0x53b11a[_0xd764('0x1e')]['include'],function(_0x10614a){return{'model':db[_0x10614a[_0xd764('0x23')]],'as':_0x10614a['as'],'attributes':_0x10614a['attributes'],'include':_0x10614a[_0xd764('0x21')]?_[_0xd764('0x22')](_0x10614a[_0xd764('0x21')],function(_0x300995){return{'model':db[_0x300995[_0xd764('0x23')]],'as':_0x300995['as'],'attributes':_0x300995['attributes'],'include':_0x300995[_0xd764('0x21')]?_['map'](_0x300995[_0xd764('0x21')],function(_0x534baa){return{'model':db[_0x534baa[_0xd764('0x23')]],'as':_0x534baa['as'],'attributes':_0x534baa[_0xd764('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd764('0x13')](function(_0x42cedf){logger[_0xd764('0x14')](_0xd764('0x24'),_0x53b11a);logger['debug'](_0xd764('0x24'),_0x53b11a,JSON[_0xd764('0x17')](_0x42cedf));_0x140459(_0x42cedf);})['catch'](function(_0xb6efc9){logger[_0xd764('0x18')](_0xd764('0x24'),_0xb6efc9[_0xd764('0x19')],_0x53b11a);_0x3e4393(_0x1da37e[_0xd764('0x18')](0x1f4,_0xb6efc9[_0xd764('0x19')]));});});};exports[_0xd764('0x25')]=function(_0x213726){var _0xd85be2=this;return new Promise(function(_0x517d34,_0x362aa9){return db[_0xd764('0x1c')]['find']({'raw':_0x213726[_0xd764('0x1e')]?_0x213726[_0xd764('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x213726[_0xd764('0x1e')]?_0x213726[_0xd764('0x1e')][_0xd764('0x1f')]||null:null,'attributes':_0x213726['options']?_0x213726[_0xd764('0x1e')]['attributes']||null:null,'include':_0x213726['options']?_0x213726['options'][_0xd764('0x21')]?_['map'](_0x213726[_0xd764('0x1e')][_0xd764('0x21')],function(_0xa46c71){return{'model':db[_0xa46c71[_0xd764('0x23')]],'as':_0xa46c71['as'],'attributes':_0xa46c71['attributes'],'include':_0xa46c71[_0xd764('0x21')]?_[_0xd764('0x22')](_0xa46c71['include'],function(_0x209a2d){return{'model':db[_0x209a2d[_0xd764('0x23')]],'as':_0x209a2d['as'],'attributes':_0x209a2d[_0xd764('0x20')],'include':_0x209a2d[_0xd764('0x21')]?_[_0xd764('0x22')](_0x209a2d[_0xd764('0x21')],function(_0x4db04f){return{'model':db[_0x4db04f[_0xd764('0x23')]],'as':_0x4db04f['as'],'attributes':_0x4db04f[_0xd764('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd764('0x13')](function(_0x58f81f){logger[_0xd764('0x14')]('ShowWhatsappQueue',_0x213726);logger[_0xd764('0x26')](_0xd764('0x25'),_0x213726,JSON[_0xd764('0x17')](_0x58f81f));_0x517d34(_0x58f81f);})[_0xd764('0x1b')](function(_0x16ac67){logger[_0xd764('0x18')](_0xd764('0x25'),_0x16ac67[_0xd764('0x19')],_0x213726);_0x362aa9(_0xd85be2[_0xd764('0x18')](0x1f4,_0x16ac67[_0xd764('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index e163b30..ee04003 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 _0x0f95=['update','emit','register','length','whatsappQueue:','./whatsappQueue.events','save','remove'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x0f95,0x165));var _0x50f9=function(_0x38b14f,_0xd08fa8){_0x38b14f=_0x38b14f-0x0;var _0x22a324=_0x0f95[_0x38b14f];return _0x22a324;};'use strict';var WhatsappQueueEvents=require(_0x50f9('0x0'));var events=[_0x50f9('0x1'),_0x50f9('0x2'),_0x50f9('0x3')];function createListener(_0x37c718,_0x26a32d){return function(_0x506b23){_0x26a32d[_0x50f9('0x4')](_0x37c718,_0x506b23);};}function removeListener(_0xa1b4f5,_0x54d0d5){return function(){WhatsappQueueEvents['removeListener'](_0xa1b4f5,_0x54d0d5);};}exports[_0x50f9('0x5')]=function(_0x35abcb){for(var _0x2f4ddc=0x0,_0x3bad5e=events[_0x50f9('0x6')];_0x2f4ddc<_0x3bad5e;_0x2f4ddc++){var _0x2c6e7e=events[_0x2f4ddc];var _0x2504a4=createListener(_0x50f9('0x7')+_0x2c6e7e,_0x35abcb);WhatsappQueueEvents['on'](_0x2c6e7e,_0x2504a4);}}; \ No newline at end of file +var _0x7322=['whatsappQueue:','./whatsappQueue.events','save','update','emit','removeListener','register','length'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x7322,0x111));var _0x2732=function(_0x589c08,_0x264b33){_0x589c08=_0x589c08-0x0;var _0xc21d72=_0x7322[_0x589c08];return _0xc21d72;};'use strict';var WhatsappQueueEvents=require(_0x2732('0x0'));var events=[_0x2732('0x1'),'remove',_0x2732('0x2')];function createListener(_0x2bb5d8,_0x594db8){return function(_0x3b6292){_0x594db8[_0x2732('0x3')](_0x2bb5d8,_0x3b6292);};}function removeListener(_0x4bc8ca,_0x57410){return function(){WhatsappQueueEvents[_0x2732('0x4')](_0x4bc8ca,_0x57410);};}exports[_0x2732('0x5')]=function(_0x24d45d){for(var _0x33a3ba=0x0,_0x1180b5=events[_0x2732('0x6')];_0x33a3ba<_0x1180b5;_0x33a3ba++){var _0x225f2d=events[_0x33a3ba];var _0x601a82=createListener(_0x2732('0x7')+_0x225f2d,_0x24d45d);WhatsappQueueEvents['on'](_0x225f2d,_0x601a82);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 8a0b03a..86de762 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 _0x2d5e=['exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','index','/describe','isAuthenticated','describe','get','/:id','put','update','delete','destroy'];(function(_0x3cfdd6,_0x3d89fd){var _0x5a935f=function(_0x2d984e){while(--_0x2d984e){_0x3cfdd6['push'](_0x3cfdd6['shift']());}};_0x5a935f(++_0x3d89fd);}(_0x2d5e,0x119));var _0xe2d5=function(_0x139c3e,_0x5e80a9){_0x139c3e=_0x139c3e-0x0;var _0x3d79e4=_0x2d5e[_0x139c3e];return _0x3d79e4;};'use strict';var multer=require(_0xe2d5('0x0'));var util=require('util');var path=require(_0xe2d5('0x1'));var timeout=require('connect-timeout');var express=require(_0xe2d5('0x2'));var router=express[_0xe2d5('0x3')]();var fs_extra=require(_0xe2d5('0x4'));var auth=require(_0xe2d5('0x5'));var interaction=require(_0xe2d5('0x6'));var config=require(_0xe2d5('0x7'));var controller=require(_0xe2d5('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xe2d5('0x9')]);router['get'](_0xe2d5('0xa'),auth[_0xe2d5('0xb')](),controller[_0xe2d5('0xc')]);router[_0xe2d5('0xd')](_0xe2d5('0xe'),auth[_0xe2d5('0xb')](),controller['show']);router['post']('/',auth[_0xe2d5('0xb')](),controller['create']);router[_0xe2d5('0xf')](_0xe2d5('0xe'),auth[_0xe2d5('0xb')](),controller[_0xe2d5('0x10')]);router[_0xe2d5('0x11')](_0xe2d5('0xe'),auth[_0xe2d5('0xb')](),controller[_0xe2d5('0x12')]);module[_0xe2d5('0x13')]=router; \ No newline at end of file +var _0x1a1d=['destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update'];(function(_0x587c53,_0x4b4483){var _0x18209a=function(_0x3b8188){while(--_0x3b8188){_0x587c53['push'](_0x587c53['shift']());}};_0x18209a(++_0x4b4483);}(_0x1a1d,0x1ca));var _0xd1a1=function(_0x5e8014,_0x5d4527){_0x5e8014=_0x5e8014-0x0;var _0x35c08d=_0x1a1d[_0x5e8014];return _0x35c08d;};'use strict';var multer=require('multer');var util=require(_0xd1a1('0x0'));var path=require(_0xd1a1('0x1'));var timeout=require('connect-timeout');var express=require(_0xd1a1('0x2'));var router=express['Router']();var fs_extra=require(_0xd1a1('0x3'));var auth=require(_0xd1a1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd1a1('0x5'));var controller=require(_0xd1a1('0x6'));router[_0xd1a1('0x7')]('/',auth[_0xd1a1('0x8')](),controller[_0xd1a1('0x9')]);router[_0xd1a1('0x7')](_0xd1a1('0xa'),auth['isAuthenticated'](),controller[_0xd1a1('0xb')]);router[_0xd1a1('0x7')](_0xd1a1('0xc'),auth[_0xd1a1('0x8')](),controller[_0xd1a1('0xd')]);router[_0xd1a1('0xe')]('/',auth[_0xd1a1('0x8')](),controller[_0xd1a1('0xf')]);router['put']('/:id',auth[_0xd1a1('0x8')](),controller[_0xd1a1('0x10')]);router['delete'](_0xd1a1('0xc'),auth[_0xd1a1('0x8')](),controller[_0xd1a1('0x11')]);module[_0xd1a1('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index f4cd559..6382bd0 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(_0x31019a,_0x480e9d){var _0x20731f=function(_0x13986e){while(--_0x13986e){_0x31019a['push'](_0x31019a['shift']());}};_0x20731f(++_0x480e9d);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x3c7aa9,_0x3f3e9e){var _0x48e7da=function(_0x3a672a){while(--_0x3a672a){_0x3c7aa9['push'](_0x3c7aa9['shift']());}};_0x48e7da(++_0x3f3e9e);}(_0x7a54,0x106));var _0x47a5=function(_0x32937d,_0x37464e){_0x32937d=_0x32937d-0x0;var _0x375811=_0x7a54[_0x32937d];return _0x375811;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 0dc7a00..1993d7e 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 _0x0fd9=['includeAll','include','rows','catch','show','params','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','WhatsappQueueReport','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options'];(function(_0x1b397c,_0x10f331){var _0x55146c=function(_0x47d455){while(--_0x47d455){_0x1b397c['push'](_0x1b397c['shift']());}};_0x55146c(++_0x10f331);}(_0x0fd9,0xa3));var _0x90fd=function(_0x4b4d43,_0x1590f7){_0x4b4d43=_0x4b4d43-0x0;var _0x5706ba=_0x0fd9[_0x4b4d43];return _0x5706ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x90fd('0x0'));var zipdir=require(_0x90fd('0x1'));var jsonpatch=require(_0x90fd('0x2'));var rp=require(_0x90fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x90fd('0x4'));var util=require(_0x90fd('0x5'));var path=require(_0x90fd('0x6'));var sox=require(_0x90fd('0x7'));var csv=require(_0x90fd('0x8'));var ejs=require(_0x90fd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x90fd('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x90fd('0xb'));var toCsv=require(_0x90fd('0x8'));var querystring=require('querystring');var Papa=require(_0x90fd('0xc'));var Redis=require(_0x90fd('0xd'));var authService=require(_0x90fd('0xe'));var qs=require(_0x90fd('0xf'));var as=require(_0x90fd('0x10'));var hardwareService=require(_0x90fd('0x11'));var logger=require(_0x90fd('0x12'))(_0x90fd('0x13'));var utils=require(_0x90fd('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x90fd('0x15'));var db=require(_0x90fd('0x16'))['db'];function respondWithStatusCode(_0x4e8b99,_0x1439ed){_0x1439ed=_0x1439ed||0xcc;return function(_0x37a0f8){if(_0x37a0f8){return _0x4e8b99[_0x90fd('0x17')](_0x1439ed);}return _0x4e8b99['status'](_0x1439ed)[_0x90fd('0x18')]();};}function respondWithResult(_0x48e701,_0x1cae40){_0x1cae40=_0x1cae40||0xc8;return function(_0xb402d9){if(_0xb402d9){return _0x48e701[_0x90fd('0x19')](_0x1cae40)[_0x90fd('0x1a')](_0xb402d9);}};}function respondWithFilteredResult(_0x3c5da8,_0x442a19){return function(_0x296a64){if(_0x296a64){var _0x4eb953=typeof _0x442a19['offset']===_0x90fd('0x1b')&&typeof _0x442a19[_0x90fd('0x1c')]==='undefined';var _0x130489=_0x296a64[_0x90fd('0x1d')];var _0x1fcc87=_0x4eb953?0x0:_0x442a19['offset'];var _0x3f9c76=_0x4eb953?_0x296a64[_0x90fd('0x1d')]:_0x442a19[_0x90fd('0x1e')]+_0x442a19[_0x90fd('0x1c')];var _0x251957;if(_0x3f9c76>=_0x130489){_0x3f9c76=_0x130489;_0x251957=0xc8;}else{_0x251957=0xce;}_0x3c5da8[_0x90fd('0x19')](_0x251957);return _0x3c5da8[_0x90fd('0x1f')](_0x90fd('0x20'),_0x1fcc87+'-'+_0x3f9c76+'/'+_0x130489)[_0x90fd('0x1a')](_0x296a64);}return null;};}function patchUpdates(_0x90197e){return function(_0x19e79b){try{jsonpatch[_0x90fd('0x21')](_0x19e79b,_0x90197e,!![]);}catch(_0x1fb31a){return BPromise[_0x90fd('0x22')](_0x1fb31a);}return _0x19e79b[_0x90fd('0x23')]();};}function saveUpdates(_0x493c26,_0x35ce4e){return function(_0xc4e4e2){if(_0xc4e4e2){return _0xc4e4e2[_0x90fd('0x24')](_0x493c26)[_0x90fd('0x25')](function(_0x411a6a){return _0x411a6a;});}return null;};}function removeEntity(_0x3ad6c6,_0x30f67e){return function(_0x300262){if(_0x300262){return _0x300262['destroy']()[_0x90fd('0x25')](function(){_0x3ad6c6['status'](0xcc)[_0x90fd('0x18')]();});}};}function handleEntityNotFound(_0x18d5b3,_0x2ffea2){return function(_0x31667c){if(!_0x31667c){_0x18d5b3[_0x90fd('0x17')](0x194);}return _0x31667c;};}function handleError(_0x4c962f,_0x35c38d){_0x35c38d=_0x35c38d||0x1f4;return function(_0xe333f0){logger[_0x90fd('0x26')](_0xe333f0[_0x90fd('0x27')]);if(_0xe333f0[_0x90fd('0x28')]){delete _0xe333f0[_0x90fd('0x28')];}_0x4c962f['status'](_0x35c38d)['send'](_0xe333f0);};}exports[_0x90fd('0x29')]=function(_0x170cfb,_0x2924e9){var _0x404971={},_0x397aaf={},_0x59b3e8={'count':0x0,'rows':[]};var _0x4f69e7=_[_0x90fd('0x2a')](db[_0x90fd('0x2b')][_0x90fd('0x2c')],function(_0x3a0102){return{'name':_0x3a0102['fieldName'],'type':_0x3a0102['type'][_0x90fd('0x2d')]};});_0x397aaf[_0x90fd('0x2e')]=_[_0x90fd('0x2a')](_0x4f69e7,_0x90fd('0x28'));_0x397aaf['query']=_[_0x90fd('0x2f')](_0x170cfb[_0x90fd('0x30')]);_0x397aaf[_0x90fd('0x31')]=_[_0x90fd('0x32')](_0x397aaf[_0x90fd('0x2e')],_0x397aaf[_0x90fd('0x30')]);_0x404971[_0x90fd('0x33')]=_[_0x90fd('0x32')](_0x397aaf[_0x90fd('0x2e')],qs[_0x90fd('0x34')](_0x170cfb[_0x90fd('0x30')][_0x90fd('0x34')]));_0x404971[_0x90fd('0x33')]=_0x404971[_0x90fd('0x33')][_0x90fd('0x35')]?_0x404971[_0x90fd('0x33')]:_0x397aaf['model'];if(!_0x170cfb[_0x90fd('0x30')][_0x90fd('0x36')](_0x90fd('0x37'))){_0x404971[_0x90fd('0x1c')]=qs[_0x90fd('0x1c')](_0x170cfb[_0x90fd('0x30')][_0x90fd('0x1c')]);_0x404971[_0x90fd('0x1e')]=qs[_0x90fd('0x1e')](_0x170cfb[_0x90fd('0x30')][_0x90fd('0x1e')]);}_0x404971[_0x90fd('0x38')]=qs[_0x90fd('0x39')](_0x170cfb['query'][_0x90fd('0x39')]);_0x404971[_0x90fd('0x3a')]=qs[_0x90fd('0x31')](_[_0x90fd('0x3b')](_0x170cfb['query'],_0x397aaf[_0x90fd('0x31')]),_0x4f69e7);if(_0x170cfb[_0x90fd('0x30')][_0x90fd('0x3c')]){_0x404971['where']=_['merge'](_0x404971[_0x90fd('0x3a')],{'$or':_[_0x90fd('0x2a')](_0x4f69e7,function(_0x377319){if(_0x377319[_0x90fd('0x3d')]!==_0x90fd('0x3e')){var _0x254200={};_0x254200[_0x377319[_0x90fd('0x28')]]={'$like':'%'+_0x170cfb[_0x90fd('0x30')][_0x90fd('0x3c')]+'%'};return _0x254200;}})});}_0x404971=_[_0x90fd('0x3f')]({},_0x404971,_0x170cfb[_0x90fd('0x40')]);var _0x43c84c={'where':_0x404971[_0x90fd('0x3a')]};return db[_0x90fd('0x2b')][_0x90fd('0x1d')](_0x43c84c)[_0x90fd('0x25')](function(_0x2717ca){_0x59b3e8[_0x90fd('0x1d')]=_0x2717ca;if(_0x170cfb['query'][_0x90fd('0x41')]){_0x404971[_0x90fd('0x42')]=[{'all':!![]}];}return db[_0x90fd('0x2b')]['findAll'](_0x404971);})['then'](function(_0x47b8c8){_0x59b3e8[_0x90fd('0x43')]=_0x47b8c8;return _0x59b3e8;})[_0x90fd('0x25')](respondWithFilteredResult(_0x2924e9,_0x404971))[_0x90fd('0x44')](handleError(_0x2924e9,null));};exports[_0x90fd('0x45')]=function(_0x1361d9,_0x311c7e){var _0x363365={'raw':!![],'where':{'id':_0x1361d9[_0x90fd('0x46')]['id']}},_0x733d4d={};_0x733d4d[_0x90fd('0x2e')]=_[_0x90fd('0x2f')](db[_0x90fd('0x2b')][_0x90fd('0x2c')]);_0x733d4d[_0x90fd('0x30')]=_[_0x90fd('0x2f')](_0x1361d9['query']);_0x733d4d['filters']=_[_0x90fd('0x32')](_0x733d4d[_0x90fd('0x2e')],_0x733d4d[_0x90fd('0x30')]);_0x363365['attributes']=_['intersection'](_0x733d4d[_0x90fd('0x2e')],qs[_0x90fd('0x34')](_0x1361d9['query']['fields']));_0x363365[_0x90fd('0x33')]=_0x363365[_0x90fd('0x33')]['length']?_0x363365['attributes']:_0x733d4d[_0x90fd('0x2e')];if(_0x1361d9[_0x90fd('0x30')][_0x90fd('0x41')]){_0x363365['include']=[{'all':!![]}];}_0x363365=_[_0x90fd('0x3f')]({},_0x363365,_0x1361d9[_0x90fd('0x40')]);return db['WhatsappQueueReport']['find'](_0x363365)['then'](handleEntityNotFound(_0x311c7e,null))[_0x90fd('0x25')](respondWithResult(_0x311c7e,null))[_0x90fd('0x44')](handleError(_0x311c7e,null));};exports['create']=function(_0x2d42b3,_0x2b73f7){return db[_0x90fd('0x2b')][_0x90fd('0x47')](_0x2d42b3[_0x90fd('0x48')],{})['then'](respondWithResult(_0x2b73f7,0xc9))['catch'](handleError(_0x2b73f7,null));};exports[_0x90fd('0x24')]=function(_0x326e4d,_0x125874){if(_0x326e4d[_0x90fd('0x48')]['id']){delete _0x326e4d[_0x90fd('0x48')]['id'];}return db[_0x90fd('0x2b')][_0x90fd('0x49')]({'where':{'id':_0x326e4d[_0x90fd('0x46')]['id']}})[_0x90fd('0x25')](handleEntityNotFound(_0x125874,null))[_0x90fd('0x25')](saveUpdates(_0x326e4d['body'],null))[_0x90fd('0x25')](respondWithResult(_0x125874,null))[_0x90fd('0x44')](handleError(_0x125874,null));};exports[_0x90fd('0x4a')]=function(_0x38021b,_0x4b47bc){return db['WhatsappQueueReport'][_0x90fd('0x49')]({'where':{'id':_0x38021b['params']['id']}})['then'](handleEntityNotFound(_0x4b47bc,null))[_0x90fd('0x25')](removeEntity(_0x4b47bc,null))[_0x90fd('0x44')](handleError(_0x4b47bc,null));};exports[_0x90fd('0x4b')]=function(_0xb8a2af,_0x13c428){return db[_0x90fd('0x2b')][_0x90fd('0x4b')]()['then'](respondWithResult(_0x13c428,null))['catch'](handleError(_0x13c428,null));}; \ No newline at end of file +var _0xeffd=['model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','catch','show','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','set','Content-Range','json','reject','update','then','destroy','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','type'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xeffd,0x6b));var _0xdeff=function(_0x1ebc6c,_0x5dc61e){_0x1ebc6c=_0x1ebc6c-0x0;var _0x47619f=_0xeffd[_0x1ebc6c];return _0x47619f;};'use strict';var emlformat=require(_0xdeff('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdeff('0x1'));var jsonpatch=require(_0xdeff('0x2'));var rp=require(_0xdeff('0x3'));var moment=require(_0xdeff('0x4'));var BPromise=require(_0xdeff('0x5'));var Mustache=require(_0xdeff('0x6'));var util=require(_0xdeff('0x7'));var path=require(_0xdeff('0x8'));var sox=require(_0xdeff('0x9'));var csv=require(_0xdeff('0xa'));var ejs=require(_0xdeff('0xb'));var fs=require('fs');var fs_extra=require(_0xdeff('0xc'));var _=require(_0xdeff('0xd'));var squel=require(_0xdeff('0xe'));var crypto=require(_0xdeff('0xf'));var jsforce=require(_0xdeff('0x10'));var deskjs=require(_0xdeff('0x11'));var toCsv=require('to-csv');var querystring=require(_0xdeff('0x12'));var Papa=require(_0xdeff('0x13'));var Redis=require(_0xdeff('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xdeff('0x15'));var as=require(_0xdeff('0x16'));var hardwareService=require(_0xdeff('0x17'));var logger=require(_0xdeff('0x18'))(_0xdeff('0x19'));var utils=require(_0xdeff('0x1a'));var config=require(_0xdeff('0x1b'));var licenseUtil=require(_0xdeff('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x461699,_0x116bf9){_0x116bf9=_0x116bf9||0xcc;return function(_0x4952f2){if(_0x4952f2){return _0x461699[_0xdeff('0x1d')](_0x116bf9);}return _0x461699['status'](_0x116bf9)['end']();};}function respondWithResult(_0x3e56a1,_0x47410f){_0x47410f=_0x47410f||0xc8;return function(_0x1585e8){if(_0x1585e8){return _0x3e56a1[_0xdeff('0x1e')](_0x47410f)['json'](_0x1585e8);}};}function respondWithFilteredResult(_0x826132,_0x314ded){return function(_0xea6c4){if(_0xea6c4){var _0x391633=typeof _0x314ded[_0xdeff('0x1f')]===_0xdeff('0x20')&&typeof _0x314ded['limit']==='undefined';var _0x7440af=_0xea6c4['count'];var _0x5c9837=_0x391633?0x0:_0x314ded[_0xdeff('0x1f')];var _0x369e13=_0x391633?_0xea6c4['count']:_0x314ded[_0xdeff('0x1f')]+_0x314ded[_0xdeff('0x21')];var _0x1ab1fa;if(_0x369e13>=_0x7440af){_0x369e13=_0x7440af;_0x1ab1fa=0xc8;}else{_0x1ab1fa=0xce;}_0x826132[_0xdeff('0x1e')](_0x1ab1fa);return _0x826132[_0xdeff('0x22')](_0xdeff('0x23'),_0x5c9837+'-'+_0x369e13+'/'+_0x7440af)[_0xdeff('0x24')](_0xea6c4);}return null;};}function patchUpdates(_0x919c93){return function(_0x488faa){try{jsonpatch['apply'](_0x488faa,_0x919c93,!![]);}catch(_0x56cb84){return BPromise[_0xdeff('0x25')](_0x56cb84);}return _0x488faa['save']();};}function saveUpdates(_0x189627,_0x91c0b4){return function(_0x543653){if(_0x543653){return _0x543653[_0xdeff('0x26')](_0x189627)[_0xdeff('0x27')](function(_0x4eb2a8){return _0x4eb2a8;});}return null;};}function removeEntity(_0x5dbe96,_0x3b2554){return function(_0x15c425){if(_0x15c425){return _0x15c425[_0xdeff('0x28')]()[_0xdeff('0x27')](function(){_0x5dbe96[_0xdeff('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb08f19,_0x412db3){return function(_0x3741fb){if(!_0x3741fb){_0xb08f19[_0xdeff('0x1d')](0x194);}return _0x3741fb;};}function handleError(_0x16974b,_0x35823c){_0x35823c=_0x35823c||0x1f4;return function(_0x3d0111){logger['error'](_0x3d0111[_0xdeff('0x29')]);if(_0x3d0111[_0xdeff('0x2a')]){delete _0x3d0111['name'];}_0x16974b['status'](_0x35823c)[_0xdeff('0x2b')](_0x3d0111);};}exports[_0xdeff('0x2c')]=function(_0x16b2d0,_0xcb819c){var _0x533069={},_0xf9b278={},_0xbc75ee={'count':0x0,'rows':[]};var _0x4e0ff2=_[_0xdeff('0x2d')](db[_0xdeff('0x2e')][_0xdeff('0x2f')],function(_0x5045b8){return{'name':_0x5045b8['fieldName'],'type':_0x5045b8[_0xdeff('0x30')]['key']};});_0xf9b278[_0xdeff('0x31')]=_[_0xdeff('0x2d')](_0x4e0ff2,_0xdeff('0x2a'));_0xf9b278['query']=_[_0xdeff('0x32')](_0x16b2d0['query']);_0xf9b278['filters']=_[_0xdeff('0x33')](_0xf9b278[_0xdeff('0x31')],_0xf9b278[_0xdeff('0x34')]);_0x533069[_0xdeff('0x35')]=_['intersection'](_0xf9b278[_0xdeff('0x31')],qs[_0xdeff('0x36')](_0x16b2d0[_0xdeff('0x34')][_0xdeff('0x36')]));_0x533069[_0xdeff('0x35')]=_0x533069[_0xdeff('0x35')][_0xdeff('0x37')]?_0x533069['attributes']:_0xf9b278[_0xdeff('0x31')];if(!_0x16b2d0['query'][_0xdeff('0x38')](_0xdeff('0x39'))){_0x533069[_0xdeff('0x21')]=qs[_0xdeff('0x21')](_0x16b2d0[_0xdeff('0x34')][_0xdeff('0x21')]);_0x533069['offset']=qs[_0xdeff('0x1f')](_0x16b2d0[_0xdeff('0x34')]['offset']);}_0x533069[_0xdeff('0x3a')]=qs[_0xdeff('0x3b')](_0x16b2d0[_0xdeff('0x34')][_0xdeff('0x3b')]);_0x533069[_0xdeff('0x3c')]=qs[_0xdeff('0x3d')](_[_0xdeff('0x3e')](_0x16b2d0[_0xdeff('0x34')],_0xf9b278['filters']),_0x4e0ff2);if(_0x16b2d0[_0xdeff('0x34')]['filter']){_0x533069[_0xdeff('0x3c')]=_[_0xdeff('0x3f')](_0x533069[_0xdeff('0x3c')],{'$or':_['map'](_0x4e0ff2,function(_0x443550){if(_0x443550[_0xdeff('0x30')]!==_0xdeff('0x40')){var _0x467ce0={};_0x467ce0[_0x443550[_0xdeff('0x2a')]]={'$like':'%'+_0x16b2d0['query'][_0xdeff('0x41')]+'%'};return _0x467ce0;}})});}_0x533069=_['merge']({},_0x533069,_0x16b2d0[_0xdeff('0x42')]);var _0x14f1d0={'where':_0x533069['where']};return db[_0xdeff('0x2e')][_0xdeff('0x43')](_0x14f1d0)[_0xdeff('0x27')](function(_0x2e9dcd){_0xbc75ee[_0xdeff('0x43')]=_0x2e9dcd;if(_0x16b2d0['query'][_0xdeff('0x44')]){_0x533069[_0xdeff('0x45')]=[{'all':!![]}];}return db[_0xdeff('0x2e')][_0xdeff('0x46')](_0x533069);})[_0xdeff('0x27')](function(_0x5dfbb3){_0xbc75ee['rows']=_0x5dfbb3;return _0xbc75ee;})[_0xdeff('0x27')](respondWithFilteredResult(_0xcb819c,_0x533069))[_0xdeff('0x47')](handleError(_0xcb819c,null));};exports[_0xdeff('0x48')]=function(_0x318e77,_0x3c4fd2){var _0x289f70={'raw':!![],'where':{'id':_0x318e77['params']['id']}},_0x2cd68a={};_0x2cd68a[_0xdeff('0x31')]=_[_0xdeff('0x32')](db[_0xdeff('0x2e')]['rawAttributes']);_0x2cd68a[_0xdeff('0x34')]=_[_0xdeff('0x32')](_0x318e77[_0xdeff('0x34')]);_0x2cd68a[_0xdeff('0x3d')]=_['intersection'](_0x2cd68a[_0xdeff('0x31')],_0x2cd68a[_0xdeff('0x34')]);_0x289f70[_0xdeff('0x35')]=_[_0xdeff('0x33')](_0x2cd68a[_0xdeff('0x31')],qs[_0xdeff('0x36')](_0x318e77[_0xdeff('0x34')][_0xdeff('0x36')]));_0x289f70['attributes']=_0x289f70[_0xdeff('0x35')][_0xdeff('0x37')]?_0x289f70[_0xdeff('0x35')]:_0x2cd68a[_0xdeff('0x31')];if(_0x318e77[_0xdeff('0x34')]['includeAll']){_0x289f70[_0xdeff('0x45')]=[{'all':!![]}];}_0x289f70=_[_0xdeff('0x3f')]({},_0x289f70,_0x318e77[_0xdeff('0x42')]);return db[_0xdeff('0x2e')][_0xdeff('0x49')](_0x289f70)['then'](handleEntityNotFound(_0x3c4fd2,null))[_0xdeff('0x27')](respondWithResult(_0x3c4fd2,null))['catch'](handleError(_0x3c4fd2,null));};exports[_0xdeff('0x4a')]=function(_0x10e4ba,_0x1bf17c){return db[_0xdeff('0x2e')][_0xdeff('0x4a')](_0x10e4ba[_0xdeff('0x4b')],{})['then'](respondWithResult(_0x1bf17c,0xc9))['catch'](handleError(_0x1bf17c,null));};exports[_0xdeff('0x26')]=function(_0xf91a72,_0x3dc206){if(_0xf91a72['body']['id']){delete _0xf91a72['body']['id'];}return db[_0xdeff('0x2e')][_0xdeff('0x49')]({'where':{'id':_0xf91a72['params']['id']}})[_0xdeff('0x27')](handleEntityNotFound(_0x3dc206,null))[_0xdeff('0x27')](saveUpdates(_0xf91a72[_0xdeff('0x4b')],null))['then'](respondWithResult(_0x3dc206,null))[_0xdeff('0x47')](handleError(_0x3dc206,null));};exports[_0xdeff('0x28')]=function(_0x1ca376,_0x59ae32){return db[_0xdeff('0x2e')][_0xdeff('0x49')]({'where':{'id':_0x1ca376[_0xdeff('0x4c')]['id']}})[_0xdeff('0x27')](handleEntityNotFound(_0x59ae32,null))[_0xdeff('0x27')](removeEntity(_0x59ae32,null))[_0xdeff('0x47')](handleError(_0x59ae32,null));};exports[_0xdeff('0x4d')]=function(_0x578185,_0x4517d1){return db[_0xdeff('0x2e')]['describe']()[_0xdeff('0x27')](respondWithResult(_0x4517d1,null))[_0xdeff('0x47')](handleError(_0x4517d1,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index c109692..6fef72e 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 _0x8634=['../../config/logger','api','moment','bluebird','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash'];(function(_0x2670f7,_0x34c405){var _0x6b813c=function(_0x41989a){while(--_0x41989a){_0x2670f7['push'](_0x2670f7['shift']());}};_0x6b813c(++_0x34c405);}(_0x8634,0x1eb));var _0x4863=function(_0x3c6b7d,_0x5f0d90){_0x3c6b7d=_0x3c6b7d-0x0;var _0x1d3ed2=_0x8634[_0x3c6b7d];return _0x1d3ed2;};'use strict';var _=require(_0x4863('0x0'));var util=require('util');var logger=require(_0x4863('0x1'))(_0x4863('0x2'));var moment=require(_0x4863('0x3'));var BPromise=require(_0x4863('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4863('0x5'));var attributes=require(_0x4863('0x6'));module[_0x4863('0x7')]=function(_0x304301,_0x20323c){return _0x304301[_0x4863('0x8')](_0x4863('0x9'),attributes,{'tableName':_0x4863('0xa'),'paranoid':![],'indexes':[{'name':_0x4863('0xb'),'fields':[_0x4863('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3ecf=['../../config/environment','./whatsappQueueReport.attributes','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x375d40,_0xbff715){var _0x594edf=function(_0x2d2834){while(--_0x2d2834){_0x375d40['push'](_0x375d40['shift']());}};_0x594edf(++_0xbff715);}(_0x3ecf,0xb6));var _0xf3ec=function(_0x25a63e,_0x5973a7){_0x25a63e=_0x25a63e-0x0;var _0x376a76=_0x3ecf[_0x25a63e];return _0x376a76;};'use strict';var _=require('lodash');var util=require(_0xf3ec('0x0'));var logger=require('../../config/logger')(_0xf3ec('0x1'));var moment=require(_0xf3ec('0x2'));var BPromise=require(_0xf3ec('0x3'));var rp=require(_0xf3ec('0x4'));var fs=require('fs');var path=require(_0xf3ec('0x5'));var rimraf=require(_0xf3ec('0x6'));var config=require(_0xf3ec('0x7'));var attributes=require(_0xf3ec('0x8'));module['exports']=function(_0x5e7e43,_0x53565c){return _0x5e7e43['define']('WhatsappQueueReport',attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 2a9a2a3..5a87925 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 _0xb461=['WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','body','options','raw','where','attributes','limit','UpdateWhatsappQueueReport','debug','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x2375e1,_0x3d125a){var _0x2ccc7d=function(_0x343bb6){while(--_0x343bb6){_0x2375e1['push'](_0x2375e1['shift']());}};_0x2ccc7d(++_0x3d125a);}(_0xb461,0x132));var _0x1b46=function(_0x45dd6a,_0x268430){_0x45dd6a=_0x45dd6a-0x0;var _0x1ea5e5=_0xb461[_0x45dd6a];return _0x1ea5e5;};'use strict';var _=require(_0x1b46('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1b46('0x1'));var fs=require('fs');var Redis=require(_0x1b46('0x2'));var db=require(_0x1b46('0x3'))['db'];var utils=require(_0x1b46('0x4'));var logger=require(_0x1b46('0x5'))('rpc');var config=require(_0x1b46('0x6'));var jayson=require(_0x1b46('0x7'));var client=jayson[_0x1b46('0x8')][_0x1b46('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ea131,_0x4d06ec,_0x33b416){return new BPromise(function(_0x5e7b13,_0xb4d624){return client[_0x1b46('0xa')](_0x1ea131,_0x33b416)[_0x1b46('0xb')](function(_0x20b5e1){logger[_0x1b46('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x4d06ec,_0x1b46('0xd'));logger['debug'](_0x1b46('0xe'),_0x4d06ec,_0x1b46('0xd'),JSON[_0x1b46('0xf')](_0x20b5e1));if(_0x20b5e1[_0x1b46('0x10')]){if(_0x20b5e1['error'][_0x1b46('0x11')]===0x1f4){logger[_0x1b46('0x10')](_0x1b46('0x12'),_0x4d06ec,_0x20b5e1[_0x1b46('0x10')][_0x1b46('0x13')]);return _0xb4d624(_0x20b5e1[_0x1b46('0x10')]['message']);}logger['error'](_0x1b46('0x12'),_0x4d06ec,_0x20b5e1[_0x1b46('0x10')][_0x1b46('0x13')]);return _0x5e7b13(_0x20b5e1[_0x1b46('0x10')][_0x1b46('0x13')]);}else{logger[_0x1b46('0xc')](_0x1b46('0x12'),_0x4d06ec,_0x1b46('0xd'));_0x5e7b13(_0x20b5e1[_0x1b46('0x14')][_0x1b46('0x13')]);}})[_0x1b46('0x15')](function(_0x402fc9){logger[_0x1b46('0x10')](_0x1b46('0x12'),_0x4d06ec,_0x402fc9);_0xb4d624(_0x402fc9);});});}exports[_0x1b46('0x16')]=function(_0x50f794){var _0x111979=this;return new Promise(function(_0x26322d,_0xa4ed24){return db[_0x1b46('0x17')]['create'](_0x50f794[_0x1b46('0x18')],{'raw':_0x50f794[_0x1b46('0x19')]?_0x50f794[_0x1b46('0x19')][_0x1b46('0x1a')]===undefined?!![]:![]:!![]})[_0x1b46('0xb')](function(_0x44fb30){logger[_0x1b46('0xc')](_0x1b46('0x16'),_0x50f794);logger['debug'](_0x1b46('0x16'),_0x50f794,JSON[_0x1b46('0xf')](_0x44fb30));_0x26322d(_0x44fb30);})[_0x1b46('0x15')](function(_0x4f8821){logger[_0x1b46('0x10')](_0x1b46('0x16'),_0x4f8821[_0x1b46('0x13')],_0x50f794);_0xa4ed24(_0x111979[_0x1b46('0x10')](0x1f4,_0x4f8821[_0x1b46('0x13')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x435f66){var _0x14e18e=this;return new Promise(function(_0x3aea10,_0x240784){return db[_0x1b46('0x17')]['update'](_0x435f66[_0x1b46('0x18')],{'raw':_0x435f66['options']?_0x435f66[_0x1b46('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x435f66[_0x1b46('0x19')]?_0x435f66[_0x1b46('0x19')][_0x1b46('0x1b')]||null:null,'attributes':_0x435f66[_0x1b46('0x19')]?_0x435f66[_0x1b46('0x19')][_0x1b46('0x1c')]||null:null,'limit':_0x435f66[_0x1b46('0x19')]?_0x435f66[_0x1b46('0x19')][_0x1b46('0x1d')]||null:null})[_0x1b46('0xb')](function(_0x1228b2){logger['info'](_0x1b46('0x1e'),_0x435f66);logger[_0x1b46('0x1f')]('UpdateWhatsappQueueReport',_0x435f66,JSON[_0x1b46('0xf')](_0x1228b2));_0x3aea10(_0x1228b2);})[_0x1b46('0x15')](function(_0x110b06){logger[_0x1b46('0x10')](_0x1b46('0x1e'),_0x110b06[_0x1b46('0x13')],_0x435f66);_0x240784(_0x14e18e[_0x1b46('0x10')](0x1f4,_0x110b06['message']));});});}; \ No newline at end of file +var _0x62a1=['options','raw','then','stringify','UpdateWhatsappQueueReport','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateWhatsappQueueReport','body'];(function(_0x6d76e8,_0x3a5b96){var _0x10a933=function(_0xcca43b){while(--_0xcca43b){_0x6d76e8['push'](_0x6d76e8['shift']());}};_0x10a933(++_0x3a5b96);}(_0x62a1,0x17c));var _0x162a=function(_0xf49fc,_0x56595d){_0xf49fc=_0xf49fc-0x0;var _0x561c4d=_0x62a1[_0xf49fc];return _0x561c4d;};'use strict';var _=require(_0x162a('0x0'));var util=require(_0x162a('0x1'));var moment=require(_0x162a('0x2'));var BPromise=require(_0x162a('0x3'));var rs=require(_0x162a('0x4'));var fs=require('fs');var Redis=require(_0x162a('0x5'));var db=require(_0x162a('0x6'))['db'];var utils=require(_0x162a('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x162a('0x8'));var jayson=require(_0x162a('0x9'));var client=jayson['client'][_0x162a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e6dc9,_0xdad59a,_0x19808d){return new BPromise(function(_0x5426b2,_0x3fe209){return client[_0x162a('0xb')](_0x3e6dc9,_0x19808d)['then'](function(_0x272b0){logger[_0x162a('0xc')](_0x162a('0xd'),_0xdad59a,_0x162a('0xe'));logger[_0x162a('0xf')](_0x162a('0x10'),_0xdad59a,_0x162a('0xe'),JSON['stringify'](_0x272b0));if(_0x272b0[_0x162a('0x11')]){if(_0x272b0['error'][_0x162a('0x12')]===0x1f4){logger[_0x162a('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0xdad59a,_0x272b0['error']['message']);return _0x3fe209(_0x272b0['error'][_0x162a('0x13')]);}logger[_0x162a('0x11')](_0x162a('0xd'),_0xdad59a,_0x272b0[_0x162a('0x11')][_0x162a('0x13')]);return _0x5426b2(_0x272b0['error'][_0x162a('0x13')]);}else{logger['info'](_0x162a('0xd'),_0xdad59a,'request\x20sent');_0x5426b2(_0x272b0['result'][_0x162a('0x13')]);}})[_0x162a('0x14')](function(_0x5b8031){logger[_0x162a('0x11')](_0x162a('0xd'),_0xdad59a,_0x5b8031);_0x3fe209(_0x5b8031);});});}exports[_0x162a('0x15')]=function(_0x5375af){var _0x33275b=this;return new Promise(function(_0x248f6e,_0x1d461b){return db['WhatsappQueueReport']['create'](_0x5375af[_0x162a('0x16')],{'raw':_0x5375af[_0x162a('0x17')]?_0x5375af[_0x162a('0x17')][_0x162a('0x18')]===undefined?!![]:![]:!![]})[_0x162a('0x19')](function(_0x5137cb){logger[_0x162a('0xc')]('CreateWhatsappQueueReport',_0x5375af);logger['debug']('CreateWhatsappQueueReport',_0x5375af,JSON[_0x162a('0x1a')](_0x5137cb));_0x248f6e(_0x5137cb);})['catch'](function(_0x314be0){logger[_0x162a('0x11')](_0x162a('0x15'),_0x314be0[_0x162a('0x13')],_0x5375af);_0x1d461b(_0x33275b[_0x162a('0x11')](0x1f4,_0x314be0[_0x162a('0x13')]));});});};exports[_0x162a('0x1b')]=function(_0x55c279){var _0x36e342=this;return new Promise(function(_0x5f0e28,_0x3d60fc){return db['WhatsappQueueReport']['update'](_0x55c279[_0x162a('0x16')],{'raw':_0x55c279[_0x162a('0x17')]?_0x55c279[_0x162a('0x17')][_0x162a('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55c279[_0x162a('0x17')]?_0x55c279['options'][_0x162a('0x1c')]||null:null,'attributes':_0x55c279[_0x162a('0x17')]?_0x55c279[_0x162a('0x17')][_0x162a('0x1d')]||null:null,'limit':_0x55c279[_0x162a('0x17')]?_0x55c279[_0x162a('0x17')][_0x162a('0x1e')]||null:null})[_0x162a('0x19')](function(_0x203488){logger[_0x162a('0xc')](_0x162a('0x1b'),_0x55c279);logger[_0x162a('0xf')](_0x162a('0x1b'),_0x55c279,JSON[_0x162a('0x1a')](_0x203488));_0x5f0e28(_0x203488);})[_0x162a('0x14')](function(_0x54d24a){logger[_0x162a('0x11')]('UpdateWhatsappQueueReport',_0x54d24a[_0x162a('0x13')],_0x55c279);_0x3d60fc(_0x36e342['error'](0x1f4,_0x54d24a[_0x162a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 9e0585c..d166828 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 _0xb24a=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','show','/:id','update','delete','destroy'];(function(_0x3acee8,_0x5f3924){var _0x5046cc=function(_0x338def){while(--_0x338def){_0x3acee8['push'](_0x3acee8['shift']());}};_0x5046cc(++_0x5f3924);}(_0xb24a,0x1cc));var _0xab24=function(_0x2498b5,_0x514ddb){_0x2498b5=_0x2498b5-0x0;var _0x5c48d8=_0xb24a[_0x2498b5];return _0x5c48d8;};'use strict';var multer=require(_0xab24('0x0'));var util=require(_0xab24('0x1'));var path=require(_0xab24('0x2'));var timeout=require(_0xab24('0x3'));var express=require(_0xab24('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xab24('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xab24('0x6'));var controller=require(_0xab24('0x7'));router[_0xab24('0x8')]('/',auth[_0xab24('0x9')](),controller[_0xab24('0xa')]);router[_0xab24('0x8')]('/describe',auth[_0xab24('0x9')](),controller['describe']);router[_0xab24('0x8')]('/:id',auth[_0xab24('0x9')](),controller[_0xab24('0xb')]);router['post']('/',auth[_0xab24('0x9')](),controller['create']);router['put'](_0xab24('0xc'),auth[_0xab24('0x9')](),controller[_0xab24('0xd')]);router[_0xab24('0xe')](_0xab24('0xc'),auth[_0xab24('0x9')](),controller[_0xab24('0xf')]);module[_0xab24('0x10')]=router; \ No newline at end of file +var _0xc9cb=['isAuthenticated','put','delete','destroy','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','describe','/:id','show','post'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0xc9cb,0x103));var _0xbc9c=function(_0x292efd,_0x3d4fca){_0x292efd=_0x292efd-0x0;var _0x5c92ac=_0xc9cb[_0x292efd];return _0x5c92ac;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbc9c('0x0'));var timeout=require(_0xbc9c('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbc9c('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xbc9c('0x3'));var config=require(_0xbc9c('0x4'));var controller=require(_0xbc9c('0x5'));router[_0xbc9c('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xbc9c('0x7')]);router[_0xbc9c('0x6')](_0xbc9c('0x8'),auth['isAuthenticated'](),controller[_0xbc9c('0x9')]);router[_0xbc9c('0xa')]('/',auth[_0xbc9c('0xb')](),controller['create']);router[_0xbc9c('0xc')](_0xbc9c('0x8'),auth[_0xbc9c('0xb')](),controller['update']);router[_0xbc9c('0xd')](_0xbc9c('0x8'),auth[_0xbc9c('0xb')](),controller[_0xbc9c('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index fa2d958..1d229a3 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 _0x7366=['ENUM','account','agent','queue','DATE','sequelize','exports','STRING'];(function(_0x4cef1a,_0x4d77ca){var _0xe8dac7=function(_0x16916e){while(--_0x16916e){_0x4cef1a['push'](_0x4cef1a['shift']());}};_0xe8dac7(++_0x4d77ca);}(_0x7366,0x9d));var _0x6736=function(_0x2f1a77,_0x433aaf){_0x2f1a77=_0x2f1a77-0x0;var _0x2350d0=_0x7366[_0x2f1a77];return _0x2350d0;};'use strict';var Sequelize=require(_0x6736('0x0'));module[_0x6736('0x1')]={'uniqueid':{'type':Sequelize[_0x6736('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6736('0x3')](_0x6736('0x4'),_0x6736('0x5'),_0x6736('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x6736('0x7')]}}; \ No newline at end of file +var _0xd027=['queue','DATE','exports','account','agent'];(function(_0x2cc8bb,_0x5f2607){var _0x140e40=function(_0x80d96d){while(--_0x80d96d){_0x2cc8bb['push'](_0x2cc8bb['shift']());}};_0x140e40(++_0x5f2607);}(_0xd027,0x197));var _0x7d02=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd027[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x7d02('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x7d02('0x1'),_0x7d02('0x2'),_0x7d02('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x7d02('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index cd0a0b9..5f684b0 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 _0x1069=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','then','destroy','stack','name','send','map','WhatsappTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','pick','filter','where','merge','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','ejs','fs-extra','lodash','crypto'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x1069,0x167));var _0x9106=function(_0x213cb4,_0x477d8d){_0x213cb4=_0x213cb4-0x0;var _0x118ac8=_0x1069[_0x213cb4];return _0x118ac8;};'use strict';var emlformat=require(_0x9106('0x0'));var rimraf=require(_0x9106('0x1'));var zipdir=require(_0x9106('0x2'));var jsonpatch=require(_0x9106('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9106('0x4'));var util=require(_0x9106('0x5'));var path=require(_0x9106('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9106('0x7'));var fs=require('fs');var fs_extra=require(_0x9106('0x8'));var _=require(_0x9106('0x9'));var squel=require('squel');var crypto=require(_0x9106('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x9106('0xb'));var toCsv=require(_0x9106('0xc'));var querystring=require(_0x9106('0xd'));var Papa=require(_0x9106('0xe'));var Redis=require(_0x9106('0xf'));var authService=require(_0x9106('0x10'));var qs=require(_0x9106('0x11'));var as=require(_0x9106('0x12'));var hardwareService=require(_0x9106('0x13'));var logger=require('../../config/logger')(_0x9106('0x14'));var utils=require(_0x9106('0x15'));var config=require(_0x9106('0x16'));var licenseUtil=require(_0x9106('0x17'));var db=require(_0x9106('0x18'))['db'];function respondWithStatusCode(_0x3f3079,_0x563dbe){_0x563dbe=_0x563dbe||0xcc;return function(_0x14806d){if(_0x14806d){return _0x3f3079[_0x9106('0x19')](_0x563dbe);}return _0x3f3079[_0x9106('0x1a')](_0x563dbe)[_0x9106('0x1b')]();};}function respondWithResult(_0x3cfd90,_0x5c6001){_0x5c6001=_0x5c6001||0xc8;return function(_0x18e314){if(_0x18e314){return _0x3cfd90[_0x9106('0x1a')](_0x5c6001)['json'](_0x18e314);}};}function respondWithFilteredResult(_0x4c4f81,_0x2a28b4){return function(_0x5602a1){if(_0x5602a1){var _0x32e2b8=typeof _0x2a28b4[_0x9106('0x1c')]==='undefined'&&typeof _0x2a28b4[_0x9106('0x1d')]===_0x9106('0x1e');var _0x8e0052=_0x5602a1[_0x9106('0x1f')];var _0x3e24dc=_0x32e2b8?0x0:_0x2a28b4['offset'];var _0x55dbe7=_0x32e2b8?_0x5602a1['count']:_0x2a28b4[_0x9106('0x1c')]+_0x2a28b4[_0x9106('0x1d')];var _0x4cfb0c;if(_0x55dbe7>=_0x8e0052){_0x55dbe7=_0x8e0052;_0x4cfb0c=0xc8;}else{_0x4cfb0c=0xce;}_0x4c4f81['status'](_0x4cfb0c);return _0x4c4f81[_0x9106('0x20')]('Content-Range',_0x3e24dc+'-'+_0x55dbe7+'/'+_0x8e0052)[_0x9106('0x21')](_0x5602a1);}return null;};}function patchUpdates(_0x16ff86){return function(_0x330c25){try{jsonpatch[_0x9106('0x22')](_0x330c25,_0x16ff86,!![]);}catch(_0x1f8931){return BPromise[_0x9106('0x23')](_0x1f8931);}return _0x330c25[_0x9106('0x24')]();};}function saveUpdates(_0x318aea,_0x5f1a46){return function(_0x756e54){if(_0x756e54){return _0x756e54[_0x9106('0x25')](_0x318aea)[_0x9106('0x26')](function(_0x1b6c43){return _0x1b6c43;});}return null;};}function removeEntity(_0x39c69b,_0x48e0e9){return function(_0x315c35){if(_0x315c35){return _0x315c35[_0x9106('0x27')]()[_0x9106('0x26')](function(){_0x39c69b['status'](0xcc)[_0x9106('0x1b')]();});}};}function handleEntityNotFound(_0x492a16,_0x558b0a){return function(_0x3b5353){if(!_0x3b5353){_0x492a16[_0x9106('0x19')](0x194);}return _0x3b5353;};}function handleError(_0x49a948,_0x26e03f){_0x26e03f=_0x26e03f||0x1f4;return function(_0x4ca69c){logger['error'](_0x4ca69c[_0x9106('0x28')]);if(_0x4ca69c[_0x9106('0x29')]){delete _0x4ca69c[_0x9106('0x29')];}_0x49a948[_0x9106('0x1a')](_0x26e03f)[_0x9106('0x2a')](_0x4ca69c);};}exports['index']=function(_0x5dccb3,_0x430a35){var _0x53faf5={},_0x3051d3={},_0x4f945e={'count':0x0,'rows':[]};var _0x4dbcb9=_[_0x9106('0x2b')](db[_0x9106('0x2c')][_0x9106('0x2d')],function(_0x3af916){return{'name':_0x3af916[_0x9106('0x2e')],'type':_0x3af916[_0x9106('0x2f')]['key']};});_0x3051d3[_0x9106('0x30')]=_[_0x9106('0x2b')](_0x4dbcb9,_0x9106('0x29'));_0x3051d3[_0x9106('0x31')]=_[_0x9106('0x32')](_0x5dccb3['query']);_0x3051d3[_0x9106('0x33')]=_[_0x9106('0x34')](_0x3051d3['model'],_0x3051d3['query']);_0x53faf5[_0x9106('0x35')]=_[_0x9106('0x34')](_0x3051d3[_0x9106('0x30')],qs[_0x9106('0x36')](_0x5dccb3[_0x9106('0x31')][_0x9106('0x36')]));_0x53faf5['attributes']=_0x53faf5[_0x9106('0x35')][_0x9106('0x37')]?_0x53faf5[_0x9106('0x35')]:_0x3051d3[_0x9106('0x30')];if(!_0x5dccb3[_0x9106('0x31')]['hasOwnProperty'](_0x9106('0x38'))){_0x53faf5['limit']=qs[_0x9106('0x1d')](_0x5dccb3[_0x9106('0x31')][_0x9106('0x1d')]);_0x53faf5[_0x9106('0x1c')]=qs[_0x9106('0x1c')](_0x5dccb3[_0x9106('0x31')][_0x9106('0x1c')]);}_0x53faf5[_0x9106('0x39')]=qs['sort'](_0x5dccb3[_0x9106('0x31')]['sort']);_0x53faf5['where']=qs[_0x9106('0x33')](_[_0x9106('0x3a')](_0x5dccb3[_0x9106('0x31')],_0x3051d3[_0x9106('0x33')]),_0x4dbcb9);if(_0x5dccb3[_0x9106('0x31')][_0x9106('0x3b')]){_0x53faf5[_0x9106('0x3c')]=_[_0x9106('0x3d')](_0x53faf5[_0x9106('0x3c')],{'$or':_[_0x9106('0x2b')](_0x4dbcb9,function(_0x111942){if(_0x111942['type']!=='VIRTUAL'){var _0x4a231f={};_0x4a231f[_0x111942[_0x9106('0x29')]]={'$like':'%'+_0x5dccb3[_0x9106('0x31')][_0x9106('0x3b')]+'%'};return _0x4a231f;}})});}_0x53faf5=_[_0x9106('0x3d')]({},_0x53faf5,_0x5dccb3['options']);var _0x5ec6c8={'where':_0x53faf5['where']};return db['WhatsappTransferReport'][_0x9106('0x1f')](_0x5ec6c8)[_0x9106('0x26')](function(_0x882527){_0x4f945e[_0x9106('0x1f')]=_0x882527;if(_0x5dccb3[_0x9106('0x31')][_0x9106('0x3e')]){_0x53faf5[_0x9106('0x3f')]=[{'all':!![]}];}return db[_0x9106('0x2c')][_0x9106('0x40')](_0x53faf5);})[_0x9106('0x26')](function(_0x1805c6){_0x4f945e[_0x9106('0x41')]=_0x1805c6;return _0x4f945e;})[_0x9106('0x26')](respondWithFilteredResult(_0x430a35,_0x53faf5))[_0x9106('0x42')](handleError(_0x430a35,null));};exports[_0x9106('0x43')]=function(_0x2e408b,_0x30c547){var _0x11b1a6={'raw':!![],'where':{'id':_0x2e408b['params']['id']}},_0x248391={};_0x248391['model']=_[_0x9106('0x32')](db[_0x9106('0x2c')][_0x9106('0x2d')]);_0x248391[_0x9106('0x31')]=_[_0x9106('0x32')](_0x2e408b[_0x9106('0x31')]);_0x248391[_0x9106('0x33')]=_[_0x9106('0x34')](_0x248391[_0x9106('0x30')],_0x248391[_0x9106('0x31')]);_0x11b1a6['attributes']=_[_0x9106('0x34')](_0x248391[_0x9106('0x30')],qs['fields'](_0x2e408b[_0x9106('0x31')]['fields']));_0x11b1a6[_0x9106('0x35')]=_0x11b1a6['attributes'][_0x9106('0x37')]?_0x11b1a6['attributes']:_0x248391[_0x9106('0x30')];if(_0x2e408b[_0x9106('0x31')][_0x9106('0x3e')]){_0x11b1a6[_0x9106('0x3f')]=[{'all':!![]}];}_0x11b1a6=_[_0x9106('0x3d')]({},_0x11b1a6,_0x2e408b[_0x9106('0x44')]);return db[_0x9106('0x2c')][_0x9106('0x45')](_0x11b1a6)[_0x9106('0x26')](handleEntityNotFound(_0x30c547,null))['then'](respondWithResult(_0x30c547,null))[_0x9106('0x42')](handleError(_0x30c547,null));};exports[_0x9106('0x46')]=function(_0x252dab,_0x2590cd){return db[_0x9106('0x2c')][_0x9106('0x46')](_0x252dab['body'],{})[_0x9106('0x26')](respondWithResult(_0x2590cd,0xc9))[_0x9106('0x42')](handleError(_0x2590cd,null));};exports[_0x9106('0x25')]=function(_0x3128bf,_0x289fc3){if(_0x3128bf['body']['id']){delete _0x3128bf[_0x9106('0x47')]['id'];}return db[_0x9106('0x2c')][_0x9106('0x45')]({'where':{'id':_0x3128bf[_0x9106('0x48')]['id']}})[_0x9106('0x26')](handleEntityNotFound(_0x289fc3,null))[_0x9106('0x26')](saveUpdates(_0x3128bf['body'],null))['then'](respondWithResult(_0x289fc3,null))[_0x9106('0x42')](handleError(_0x289fc3,null));};exports[_0x9106('0x27')]=function(_0x2a38c9,_0x1bb868){return db[_0x9106('0x2c')][_0x9106('0x45')]({'where':{'id':_0x2a38c9[_0x9106('0x48')]['id']}})['then'](handleEntityNotFound(_0x1bb868,null))[_0x9106('0x26')](removeEntity(_0x1bb868,null))[_0x9106('0x42')](handleError(_0x1bb868,null));};exports['describe']=function(_0x289f02,_0x3f4f49){return db[_0x9106('0x2c')][_0x9106('0x49')]()[_0x9106('0x26')](respondWithResult(_0x3f4f49,null))['catch'](handleError(_0x3f4f49,null));}; \ No newline at end of file +var _0x2b80=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','index','map','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','WhatsappTransferReport','includeAll','include','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils'];(function(_0x5a57ef,_0x51b325){var _0x1d7743=function(_0x38e245){while(--_0x38e245){_0x5a57ef['push'](_0x5a57ef['shift']());}};_0x1d7743(++_0x51b325);}(_0x2b80,0x1a6));var _0x02b8=function(_0x2b9c43,_0x49b9cd){_0x2b9c43=_0x2b9c43-0x0;var _0x3e3c32=_0x2b80[_0x2b9c43];return _0x3e3c32;};'use strict';var emlformat=require(_0x02b8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x02b8('0x1'));var jsonpatch=require(_0x02b8('0x2'));var rp=require(_0x02b8('0x3'));var moment=require(_0x02b8('0x4'));var BPromise=require(_0x02b8('0x5'));var Mustache=require(_0x02b8('0x6'));var util=require(_0x02b8('0x7'));var path=require(_0x02b8('0x8'));var sox=require('sox');var csv=require(_0x02b8('0x9'));var ejs=require(_0x02b8('0xa'));var fs=require('fs');var fs_extra=require(_0x02b8('0xb'));var _=require(_0x02b8('0xc'));var squel=require(_0x02b8('0xd'));var crypto=require('crypto');var jsforce=require(_0x02b8('0xe'));var deskjs=require(_0x02b8('0xf'));var toCsv=require('to-csv');var querystring=require(_0x02b8('0x10'));var Papa=require(_0x02b8('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x02b8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x02b8('0x13'));var logger=require('../../config/logger')(_0x02b8('0x14'));var utils=require(_0x02b8('0x15'));var config=require(_0x02b8('0x16'));var licenseUtil=require(_0x02b8('0x17'));var db=require(_0x02b8('0x18'))['db'];function respondWithStatusCode(_0x593661,_0x305802){_0x305802=_0x305802||0xcc;return function(_0x37a0e5){if(_0x37a0e5){return _0x593661[_0x02b8('0x19')](_0x305802);}return _0x593661[_0x02b8('0x1a')](_0x305802)[_0x02b8('0x1b')]();};}function respondWithResult(_0x4577f2,_0x4d676a){_0x4d676a=_0x4d676a||0xc8;return function(_0x94798b){if(_0x94798b){return _0x4577f2['status'](_0x4d676a)[_0x02b8('0x1c')](_0x94798b);}};}function respondWithFilteredResult(_0x53a16b,_0x5b72b8){return function(_0x5d10b4){if(_0x5d10b4){var _0x335631=typeof _0x5b72b8[_0x02b8('0x1d')]===_0x02b8('0x1e')&&typeof _0x5b72b8[_0x02b8('0x1f')]==='undefined';var _0x523352=_0x5d10b4[_0x02b8('0x20')];var _0x255db5=_0x335631?0x0:_0x5b72b8[_0x02b8('0x1d')];var _0x55897a=_0x335631?_0x5d10b4[_0x02b8('0x20')]:_0x5b72b8['offset']+_0x5b72b8[_0x02b8('0x1f')];var _0x2d0cef;if(_0x55897a>=_0x523352){_0x55897a=_0x523352;_0x2d0cef=0xc8;}else{_0x2d0cef=0xce;}_0x53a16b[_0x02b8('0x1a')](_0x2d0cef);return _0x53a16b[_0x02b8('0x21')](_0x02b8('0x22'),_0x255db5+'-'+_0x55897a+'/'+_0x523352)[_0x02b8('0x1c')](_0x5d10b4);}return null;};}function patchUpdates(_0x1b71bc){return function(_0x25d3e2){try{jsonpatch[_0x02b8('0x23')](_0x25d3e2,_0x1b71bc,!![]);}catch(_0x118028){return BPromise[_0x02b8('0x24')](_0x118028);}return _0x25d3e2['save']();};}function saveUpdates(_0x14b2a3,_0x290a25){return function(_0x2004c7){if(_0x2004c7){return _0x2004c7[_0x02b8('0x25')](_0x14b2a3)[_0x02b8('0x26')](function(_0x83ecfc){return _0x83ecfc;});}return null;};}function removeEntity(_0x3b0d93,_0x216694){return function(_0x123432){if(_0x123432){return _0x123432[_0x02b8('0x27')]()[_0x02b8('0x26')](function(){_0x3b0d93['status'](0xcc)[_0x02b8('0x1b')]();});}};}function handleEntityNotFound(_0x259f28,_0x22e214){return function(_0xf91a6){if(!_0xf91a6){_0x259f28[_0x02b8('0x19')](0x194);}return _0xf91a6;};}function handleError(_0x77e23a,_0x58a065){_0x58a065=_0x58a065||0x1f4;return function(_0x544f62){logger[_0x02b8('0x28')](_0x544f62['stack']);if(_0x544f62[_0x02b8('0x29')]){delete _0x544f62[_0x02b8('0x29')];}_0x77e23a[_0x02b8('0x1a')](_0x58a065)['send'](_0x544f62);};}exports[_0x02b8('0x2a')]=function(_0x5d2231,_0x3769be){var _0x8c1618={},_0x29dfe6={},_0x2d7f77={'count':0x0,'rows':[]};var _0xf48148=_[_0x02b8('0x2b')](db['WhatsappTransferReport'][_0x02b8('0x2c')],function(_0x3ea4a6){return{'name':_0x3ea4a6[_0x02b8('0x2d')],'type':_0x3ea4a6[_0x02b8('0x2e')][_0x02b8('0x2f')]};});_0x29dfe6['model']=_[_0x02b8('0x2b')](_0xf48148,_0x02b8('0x29'));_0x29dfe6[_0x02b8('0x30')]=_[_0x02b8('0x31')](_0x5d2231[_0x02b8('0x30')]);_0x29dfe6['filters']=_['intersection'](_0x29dfe6[_0x02b8('0x32')],_0x29dfe6[_0x02b8('0x30')]);_0x8c1618[_0x02b8('0x33')]=_[_0x02b8('0x34')](_0x29dfe6['model'],qs['fields'](_0x5d2231[_0x02b8('0x30')][_0x02b8('0x35')]));_0x8c1618[_0x02b8('0x33')]=_0x8c1618[_0x02b8('0x33')][_0x02b8('0x36')]?_0x8c1618['attributes']:_0x29dfe6[_0x02b8('0x32')];if(!_0x5d2231[_0x02b8('0x30')][_0x02b8('0x37')]('nolimit')){_0x8c1618['limit']=qs[_0x02b8('0x1f')](_0x5d2231['query']['limit']);_0x8c1618['offset']=qs[_0x02b8('0x1d')](_0x5d2231[_0x02b8('0x30')][_0x02b8('0x1d')]);}_0x8c1618[_0x02b8('0x38')]=qs[_0x02b8('0x39')](_0x5d2231[_0x02b8('0x30')][_0x02b8('0x39')]);_0x8c1618[_0x02b8('0x3a')]=qs['filters'](_['pick'](_0x5d2231[_0x02b8('0x30')],_0x29dfe6[_0x02b8('0x3b')]),_0xf48148);if(_0x5d2231['query'][_0x02b8('0x3c')]){_0x8c1618[_0x02b8('0x3a')]=_[_0x02b8('0x3d')](_0x8c1618[_0x02b8('0x3a')],{'$or':_['map'](_0xf48148,function(_0x1dcc49){if(_0x1dcc49[_0x02b8('0x2e')]!==_0x02b8('0x3e')){var _0x41b179={};_0x41b179[_0x1dcc49[_0x02b8('0x29')]]={'$like':'%'+_0x5d2231['query'][_0x02b8('0x3c')]+'%'};return _0x41b179;}})});}_0x8c1618=_['merge']({},_0x8c1618,_0x5d2231[_0x02b8('0x3f')]);var _0x289d17={'where':_0x8c1618['where']};return db[_0x02b8('0x40')][_0x02b8('0x20')](_0x289d17)[_0x02b8('0x26')](function(_0x1d41e6){_0x2d7f77[_0x02b8('0x20')]=_0x1d41e6;if(_0x5d2231[_0x02b8('0x30')][_0x02b8('0x41')]){_0x8c1618[_0x02b8('0x42')]=[{'all':!![]}];}return db[_0x02b8('0x40')]['findAll'](_0x8c1618);})[_0x02b8('0x26')](function(_0x26cae6){_0x2d7f77['rows']=_0x26cae6;return _0x2d7f77;})[_0x02b8('0x26')](respondWithFilteredResult(_0x3769be,_0x8c1618))[_0x02b8('0x43')](handleError(_0x3769be,null));};exports[_0x02b8('0x44')]=function(_0x589055,_0x39bd06){var _0x279f6e={'raw':!![],'where':{'id':_0x589055[_0x02b8('0x45')]['id']}},_0x1a977d={};_0x1a977d[_0x02b8('0x32')]=_[_0x02b8('0x31')](db[_0x02b8('0x40')][_0x02b8('0x2c')]);_0x1a977d['query']=_[_0x02b8('0x31')](_0x589055[_0x02b8('0x30')]);_0x1a977d[_0x02b8('0x3b')]=_[_0x02b8('0x34')](_0x1a977d['model'],_0x1a977d[_0x02b8('0x30')]);_0x279f6e[_0x02b8('0x33')]=_[_0x02b8('0x34')](_0x1a977d[_0x02b8('0x32')],qs[_0x02b8('0x35')](_0x589055[_0x02b8('0x30')][_0x02b8('0x35')]));_0x279f6e[_0x02b8('0x33')]=_0x279f6e['attributes'][_0x02b8('0x36')]?_0x279f6e['attributes']:_0x1a977d[_0x02b8('0x32')];if(_0x589055[_0x02b8('0x30')][_0x02b8('0x41')]){_0x279f6e[_0x02b8('0x42')]=[{'all':!![]}];}_0x279f6e=_[_0x02b8('0x3d')]({},_0x279f6e,_0x589055[_0x02b8('0x3f')]);return db['WhatsappTransferReport'][_0x02b8('0x46')](_0x279f6e)[_0x02b8('0x26')](handleEntityNotFound(_0x39bd06,null))[_0x02b8('0x26')](respondWithResult(_0x39bd06,null))[_0x02b8('0x43')](handleError(_0x39bd06,null));};exports['create']=function(_0x2022b3,_0x9cb595){return db[_0x02b8('0x40')][_0x02b8('0x47')](_0x2022b3['body'],{})['then'](respondWithResult(_0x9cb595,0xc9))[_0x02b8('0x43')](handleError(_0x9cb595,null));};exports[_0x02b8('0x25')]=function(_0x4c4c92,_0x5e91ba){if(_0x4c4c92[_0x02b8('0x48')]['id']){delete _0x4c4c92[_0x02b8('0x48')]['id'];}return db[_0x02b8('0x40')][_0x02b8('0x46')]({'where':{'id':_0x4c4c92[_0x02b8('0x45')]['id']}})[_0x02b8('0x26')](handleEntityNotFound(_0x5e91ba,null))[_0x02b8('0x26')](saveUpdates(_0x4c4c92[_0x02b8('0x48')],null))[_0x02b8('0x26')](respondWithResult(_0x5e91ba,null))[_0x02b8('0x43')](handleError(_0x5e91ba,null));};exports[_0x02b8('0x27')]=function(_0x375ca6,_0x1959ae){return db[_0x02b8('0x40')][_0x02b8('0x46')]({'where':{'id':_0x375ca6[_0x02b8('0x45')]['id']}})[_0x02b8('0x26')](handleEntityNotFound(_0x1959ae,null))[_0x02b8('0x26')](removeEntity(_0x1959ae,null))[_0x02b8('0x43')](handleError(_0x1959ae,null));};exports[_0x02b8('0x49')]=function(_0x4835df,_0xd7f71d){return db['WhatsappTransferReport'][_0x02b8('0x49')]()[_0x02b8('0x26')](respondWithResult(_0xd7f71d,null))[_0x02b8('0x43')](handleError(_0xd7f71d,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index a966579..00f30a2 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 _0xa9fd=['request-promise','path','rimraf','./whatsappTransferReport.attributes','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xa9fd,0xb1));var _0xda9f=function(_0x1c0ec4,_0x21ed22){_0x1c0ec4=_0x1c0ec4-0x0;var _0x170406=_0xa9fd[_0x1c0ec4];return _0x170406;};'use strict';var _=require(_0xda9f('0x0'));var util=require(_0xda9f('0x1'));var logger=require(_0xda9f('0x2'))(_0xda9f('0x3'));var moment=require('moment');var BPromise=require(_0xda9f('0x4'));var rp=require(_0xda9f('0x5'));var fs=require('fs');var path=require(_0xda9f('0x6'));var rimraf=require(_0xda9f('0x7'));var config=require('../../config/environment');var attributes=require(_0xda9f('0x8'));module['exports']=function(_0x2adea5,_0x193fa9){return _0x2adea5[_0xda9f('0x9')](_0xda9f('0xa'),attributes,{'tableName':_0xda9f('0xb'),'paranoid':![],'indexes':[{'name':_0xda9f('0xc'),'fields':[_0xda9f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x658c=['define','WhatsappTransferReport','report_whatsapp_transfer','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./whatsappTransferReport.attributes','exports'];(function(_0x51f40e,_0x14e8ea){var _0xb37761=function(_0x10bce3){while(--_0x10bce3){_0x51f40e['push'](_0x51f40e['shift']());}};_0xb37761(++_0x14e8ea);}(_0x658c,0x9d));var _0xc658=function(_0xf0cea9,_0x5a81b1){_0xf0cea9=_0xf0cea9-0x0;var _0x128adc=_0x658c[_0xf0cea9];return _0x128adc;};'use strict';var _=require(_0xc658('0x0'));var util=require(_0xc658('0x1'));var logger=require(_0xc658('0x2'))(_0xc658('0x3'));var moment=require(_0xc658('0x4'));var BPromise=require(_0xc658('0x5'));var rp=require(_0xc658('0x6'));var fs=require('fs');var path=require(_0xc658('0x7'));var rimraf=require(_0xc658('0x8'));var config=require('../../config/environment');var attributes=require(_0xc658('0x9'));module[_0xc658('0xa')]=function(_0x5860cb,_0x3092ba){return _0x5860cb[_0xc658('0xb')](_0xc658('0xc'),attributes,{'tableName':_0xc658('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 2022cb3..0c51fea 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 _0xd64a=['info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then'];(function(_0x109b4d,_0x3a9069){var _0x504d65=function(_0x10d0dd){while(--_0x10d0dd){_0x109b4d['push'](_0x109b4d['shift']());}};_0x504d65(++_0x3a9069);}(_0xd64a,0x1d8));var _0xad64=function(_0x5508fe,_0x8cf100){_0x5508fe=_0x5508fe-0x0;var _0x2b40d0=_0xd64a[_0x5508fe];return _0x2b40d0;};'use strict';var _=require(_0xad64('0x0'));var util=require(_0xad64('0x1'));var moment=require('moment');var BPromise=require(_0xad64('0x2'));var rs=require(_0xad64('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad64('0x4'))['db'];var utils=require(_0xad64('0x5'));var logger=require(_0xad64('0x6'))(_0xad64('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xad64('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5cd465,_0x188d9a,_0x576f7a){return new BPromise(function(_0xa246e5,_0x16fd00){return client[_0xad64('0x9')](_0x5cd465,_0x576f7a)[_0xad64('0xa')](function(_0x4019fe){logger[_0xad64('0xb')](_0xad64('0xc'),_0x188d9a,_0xad64('0xd'));logger[_0xad64('0xe')](_0xad64('0xf'),_0x188d9a,_0xad64('0xd'),JSON['stringify'](_0x4019fe));if(_0x4019fe[_0xad64('0x10')]){if(_0x4019fe[_0xad64('0x10')][_0xad64('0x11')]===0x1f4){logger[_0xad64('0x10')](_0xad64('0xc'),_0x188d9a,_0x4019fe[_0xad64('0x10')][_0xad64('0x12')]);return _0x16fd00(_0x4019fe['error'][_0xad64('0x12')]);}logger[_0xad64('0x10')](_0xad64('0xc'),_0x188d9a,_0x4019fe[_0xad64('0x10')][_0xad64('0x12')]);return _0xa246e5(_0x4019fe[_0xad64('0x10')][_0xad64('0x12')]);}else{logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x188d9a,_0xad64('0xd'));_0xa246e5(_0x4019fe[_0xad64('0x13')][_0xad64('0x12')]);}})[_0xad64('0x14')](function(_0x508598){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x188d9a,_0x508598);_0x16fd00(_0x508598);});});} \ No newline at end of file +var _0xb878=['request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','WhatsappTransferReport,\x20%s,\x20%s'];(function(_0x52a113,_0x164c4d){var _0x4b4208=function(_0x2a0bcf){while(--_0x2a0bcf){_0x52a113['push'](_0x52a113['shift']());}};_0x4b4208(++_0x164c4d);}(_0xb878,0x1aa));var _0x8b87=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb878[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8b87('0x0'));var util=require('util');var moment=require(_0x8b87('0x1'));var BPromise=require(_0x8b87('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b87('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8b87('0x4'));var logger=require(_0x8b87('0x5'))(_0x8b87('0x6'));var config=require(_0x8b87('0x7'));var jayson=require(_0x8b87('0x8'));var client=jayson[_0x8b87('0x9')][_0x8b87('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41cc4a,_0x59891f,_0x456cf8){return new BPromise(function(_0x237f08,_0xcd039c){return client[_0x8b87('0xb')](_0x41cc4a,_0x456cf8)[_0x8b87('0xc')](function(_0x53deb1){logger['info'](_0x8b87('0xd'),_0x59891f,'request\x20sent');logger['debug']('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x59891f,_0x8b87('0xe'),JSON[_0x8b87('0xf')](_0x53deb1));if(_0x53deb1[_0x8b87('0x10')]){if(_0x53deb1[_0x8b87('0x10')]['code']===0x1f4){logger['error'](_0x8b87('0xd'),_0x59891f,_0x53deb1[_0x8b87('0x10')][_0x8b87('0x11')]);return _0xcd039c(_0x53deb1[_0x8b87('0x10')][_0x8b87('0x11')]);}logger[_0x8b87('0x10')]('WhatsappTransferReport,\x20%s,\x20%s',_0x59891f,_0x53deb1[_0x8b87('0x10')]['message']);return _0x237f08(_0x53deb1[_0x8b87('0x10')]['message']);}else{logger['info'](_0x8b87('0xd'),_0x59891f,_0x8b87('0xe'));_0x237f08(_0x53deb1[_0x8b87('0x12')]['message']);}})[_0x8b87('0x13')](function(_0x5408fa){logger[_0x8b87('0x10')](_0x8b87('0xd'),_0x59891f,_0x5408fa);_0xcd039c(_0x5408fa);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 5774412..67e5a7d 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc61e=['./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule/chat','sequelize','then','info','start','Online\x20apps:','filter','online','Offline\x20apps:','map','status','name','join','None','seedDB','./config/seedDB','default','catch','error','exit','lodash','./mysqldb'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xc61e,0x116));var _0xec61=function(_0x55ba16,_0x17f99f){_0x55ba16=_0x55ba16-0x0;var _0xe8cd25=_0xc61e[_0x55ba16];return _0xe8cd25;};'use strict';var _=require(_0xec61('0x0'));var mysqldb=require(_0xec61('0x1'));var rpc=require(_0xec61('0x2'));var config=require(_0xec61('0x3'));var logger=require(_0xec61('0x4'))(_0xec61('0x5'));var pm2=require(_0xec61('0x6'));var pm2Config=require(_0xec61('0x7'));var schedule=require('./config/schedule');var chat=require(_0xec61('0x8'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0xec61('0x9')]['sync']()[_0xec61('0xa')](function(){return rpc['listen']();})[_0xec61('0xa')](function(_0x2785f3){logger[_0xec61('0xb')](_0x2785f3);return chat[_0xec61('0xc')]();})['then'](function(){return whatsapp[_0xec61('0xc')]();})[_0xec61('0xa')](function(){return schedule[_0xec61('0xc')]();})[_0xec61('0xa')](function(){return transcribe[_0xec61('0xc')]();})[_0xec61('0xa')](function(_0x2ab01f){logger[_0xec61('0xb')](_0x2ab01f);return pm2[_0xec61('0xc')](pm2Config);})[_0xec61('0xa')](function(_0x1d9085){logger[_0xec61('0xb')](_0xec61('0xd'),_['map'](_[_0xec61('0xe')](_0x1d9085,{'status':_0xec61('0xf')}),'name')['join']());logger[_0xec61('0xb')](_0xec61('0x10'),_[_0xec61('0x11')](_[_0xec61('0xe')](_0x1d9085,function(_0xe1f470){return _0xe1f470[_0xec61('0x12')]!==_0xec61('0xf');}),_0xec61('0x13'))[_0xec61('0x14')]()||_0xec61('0x15'));config[_0xec61('0x16')]&&require(_0xec61('0x17'))[_0xec61('0x18')]();require('./config/license')['default']();})[_0xec61('0x19')](function(_0x5a6288){logger[_0xec61('0x1a')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x5a6288);process[_0xec61('0x1b')](0x1);});}main(); \ No newline at end of file +var _0xea56=['./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','listen','info','start','Online\x20apps:','filter','online','name','join','Offline\x20apps:','map','status','None','seedDB','./config/seedDB','./config/license','default','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2'];(function(_0x1bd46a,_0x58b0a1){var _0x1519fa=function(_0x33edb7){while(--_0x33edb7){_0x1bd46a['push'](_0x1bd46a['shift']());}};_0x1519fa(++_0x58b0a1);}(_0xea56,0x139));var _0x6ea5=function(_0x474c66,_0xbce925){_0x474c66=_0x474c66-0x0;var _0xcbd9bf=_0xea56[_0x474c66];return _0xcbd9bf;};'use strict';var _=require(_0x6ea5('0x0'));var mysqldb=require(_0x6ea5('0x1'));var rpc=require(_0x6ea5('0x2'));var config=require(_0x6ea5('0x3'));var logger=require(_0x6ea5('0x4'))(_0x6ea5('0x5'));var pm2=require(_0x6ea5('0x6'));var pm2Config=require(_0x6ea5('0x7'));var schedule=require(_0x6ea5('0x8'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x6ea5('0x9'));var transcribe=require(_0x6ea5('0xa'));function main(){return mysqldb['db'][_0x6ea5('0xb')][_0x6ea5('0xc')]()[_0x6ea5('0xd')](function(){return rpc[_0x6ea5('0xe')]();})[_0x6ea5('0xd')](function(_0xe7ef04){logger[_0x6ea5('0xf')](_0xe7ef04);return chat['start']();})[_0x6ea5('0xd')](function(){return whatsapp[_0x6ea5('0x10')]();})[_0x6ea5('0xd')](function(){return schedule[_0x6ea5('0x10')]();})[_0x6ea5('0xd')](function(){return transcribe['start']();})[_0x6ea5('0xd')](function(_0x4501e8){logger[_0x6ea5('0xf')](_0x4501e8);return pm2[_0x6ea5('0x10')](pm2Config);})[_0x6ea5('0xd')](function(_0x2c75db){logger[_0x6ea5('0xf')](_0x6ea5('0x11'),_['map'](_[_0x6ea5('0x12')](_0x2c75db,{'status':_0x6ea5('0x13')}),_0x6ea5('0x14'))[_0x6ea5('0x15')]());logger[_0x6ea5('0xf')](_0x6ea5('0x16'),_[_0x6ea5('0x17')](_[_0x6ea5('0x12')](_0x2c75db,function(_0x275db7){return _0x275db7[_0x6ea5('0x18')]!==_0x6ea5('0x13');}),'name')['join']()||_0x6ea5('0x19'));config[_0x6ea5('0x1a')]&&require(_0x6ea5('0x1b'))['default']();require(_0x6ea5('0x1c'))[_0x6ea5('0x1d')]();})[_0x6ea5('0x1e')](function(_0x2424a8){logger['error'](_0x6ea5('0x1f'),_0x2424a8);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index dcd524a..4e23538 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 _0xf8dc=['phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','hotdesk','interface','settingsEnabled','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','isAuthenticated','use','user','ChatInteraction','params','disposition','then','unmanaged','json','Unmanaged.','Forbidden.','catch','headers','authorization','User','find','authenticate','pass','status','Wrong\x20credentials.','Unknown\x20authorization\x20format','apikey','getUuid','query','sub','Setting','findOne','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','User\x20not\x20found.','getLicense','update','Forbidden','isWebrtcLicence','webrtc','signToken','setTokenCookie','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','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~!@#$%^&-_=+[{]}.','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','decryptString','length','splice','unshift','encryptString','join','promisify','secret','payload','options','verify','randomBytes','toString','HS512','../../mysqldb','../../config/environment','../encryptor','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','session','role','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','smsPause','openchannelPause','showWebBar','lastLoginAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0xf8dc,0xd2));var _0xcf8d=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xf8dc[_0x102e37];return _0x35a07c;};'use strict';var db=require(_0xcf8d('0x0'))['db'];var config=require(_0xcf8d('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require(_0xcf8d('0x2'));var _=require(_0xcf8d('0x3'));var jwt=require(_0xcf8d('0x4'));var expressJwt=require('express-jwt');var compose=require(_0xcf8d('0x5'));var basicAuth=require(_0xcf8d('0x6'));var crypto=require(_0xcf8d('0x7'));var BPromise=require(_0xcf8d('0x8'));var util=require(_0xcf8d('0x9'));var moment=require(_0xcf8d('0xa'));var validateJwt=expressJwt({'secret':config[_0xcf8d('0xb')][_0xcf8d('0xc')]});var userAttributes=['id',_0xcf8d('0xd'),'fullname',_0xcf8d('0xe'),_0xcf8d('0xf'),_0xcf8d('0x10'),_0xcf8d('0x11'),_0xcf8d('0x12'),_0xcf8d('0x13'),_0xcf8d('0x14'),_0xcf8d('0x15'),_0xcf8d('0x16'),'faxPause',_0xcf8d('0x17'),_0xcf8d('0x18'),'pauseType',_0xcf8d('0x19'),_0xcf8d('0x1a'),'lastPauseAt',_0xcf8d('0x1b'),'allowmessenger',_0xcf8d('0x1c'),_0xcf8d('0x1d'),_0xcf8d('0x1e'),_0xcf8d('0x1f'),_0xcf8d('0x20'),_0xcf8d('0x21'),'phoneBarEnableDtmfTone',_0xcf8d('0x22'),_0xcf8d('0x23'),_0xcf8d('0x24'),'phoneBarRemoteControl',_0xcf8d('0x25'),_0xcf8d('0x26'),_0xcf8d('0x27'),'userProfileId','privacyEnabled',_0xcf8d('0x28'),'wssPort',_0xcf8d('0x29'),'downloadOmnichannelInteractions',_0xcf8d('0x2a'),_0xcf8d('0x2b'),'selectRecallMeCampaign'];exports['isChatInteractionAuthorized']=function(){return this[_0xcf8d('0x2c')](!![])[_0xcf8d('0x2d')](function(_0x2b794f,_0xe6c755,_0x144dce){if(_0x2b794f[_0xcf8d('0x2e')]){_0x144dce();}else{return db[_0xcf8d('0x2f')]['findOne']({'where':{'id':_0x2b794f[_0xcf8d('0x30')]['id']},'attributes':['id','closed',_0xcf8d('0x31')],'raw':!![]})[_0xcf8d('0x32')](function(_0x283094){if(_0x283094&&_0x283094['closed']){return _0xe6c755['status'](_0x283094[_0xcf8d('0x31')]===_0xcf8d('0x33')?0x195:0x193)[_0xcf8d('0x34')]({'message':_0x283094['disposition']===_0xcf8d('0x33')?_0xcf8d('0x35'):_0xcf8d('0x36')});}else{_0x144dce();}})[_0xcf8d('0x37')](function(_0x3673ef){_0x144dce(_0x3673ef);});}});};exports[_0xcf8d('0x2c')]=function isAuthenticated(_0x46277e){return compose()[_0xcf8d('0x2d')](function(_0x355685,_0x262f20,_0x39c45f){var _0x46aed6;if(_0x355685[_0xcf8d('0x38')]['authorization']){if(_['startsWith'](_0x355685[_0xcf8d('0x38')][_0xcf8d('0x39')],'Basic')){var _0x5142aa=basicAuth(_0x355685);db[_0xcf8d('0x3a')][_0xcf8d('0x3b')]({'where':{'name':_0x5142aa['name']}})['then'](function(_0x21db5b){if(!_0x21db5b||!_0x21db5b[_0xcf8d('0x3c')](_0x5142aa[_0xcf8d('0x3d')])){return _0x262f20[_0xcf8d('0x3e')](0x191)[_0xcf8d('0x34')]({'message':_0xcf8d('0x3f')});}_0x355685['user']={'id':_0x21db5b['id']};_0x39c45f();})['catch'](function(_0x3b8658){_0x39c45f(_0x3b8658);});}else if(_['startsWith'](_0x355685[_0xcf8d('0x38')][_0xcf8d('0x39')],'Bearer')){validateJwt(_0x355685,_0x262f20,_0x39c45f);}else{if(_0x46277e){_0x39c45f();}else{return _0x262f20[_0xcf8d('0x3e')](0x193)[_0xcf8d('0x34')]({'message':_0xcf8d('0x40')});}}}else if(_0x355685['query'][_0xcf8d('0x41')]){try{var _0x133009={'audience':hardwareConf[_0xcf8d('0x42')](),'issuer':hardwareConf[_0xcf8d('0x42')]()};verifyJwt(_0x355685[_0xcf8d('0x43')][_0xcf8d('0x41')],_0x133009)[_0xcf8d('0x32')](function(_0x5726d5){return db['User'][_0xcf8d('0x3b')]({'where':{'id':_0x5726d5[_0xcf8d('0x44')]}})[_0xcf8d('0x32')](function(_0x310db4){_0x46aed6=_0x310db4;return db[_0xcf8d('0x45')][_0xcf8d('0x46')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xcf8d('0x47')],'raw':!![]});})[_0xcf8d('0x32')](function(_0x592b29){if(!_0x46aed6||!_[_0xcf8d('0x48')](_0x46aed6[_0xcf8d('0x49')],_0x5726d5[_0xcf8d('0x4a')])){return _0x262f20[_0xcf8d('0x3e')](0x191)['json']({'message':_0xcf8d('0x4b')});}if(_0x46aed6[_0xcf8d('0x4c')]){return _0x262f20[_0xcf8d('0x3e')](0x191)[_0xcf8d('0x34')]({'message':_0xcf8d('0x4d')});}if(_0x46aed6[_0xcf8d('0x4e')]){if(_0x592b29[_0xcf8d('0x47')]>0x0){if(moment(_0x46aed6[_0xcf8d('0x4f')])[_0xcf8d('0x50')](_0x592b29['blockDuration'],_0xcf8d('0x51'))>moment()){return _0x262f20['status'](0x191)[_0xcf8d('0x34')]({'message':_0xcf8d('0x4d')});}}else{return _0x262f20[_0xcf8d('0x3e')](0x191)[_0xcf8d('0x34')]({'message':_0xcf8d('0x4d')});}}_0x355685[_0xcf8d('0x2e')]={'id':_0x46aed6['id']};_0x39c45f();});})[_0xcf8d('0x37')](function(){return _0x262f20[_0xcf8d('0x3e')](0x191)[_0xcf8d('0x34')]({'message':_0xcf8d('0x4d')});});}catch(_0x57d5f2){_0x39c45f(_0x57d5f2);}}else if(_0x46277e){_0x39c45f();}else{return _0x262f20[_0xcf8d('0x3e')](0x193)[_0xcf8d('0x34')]({'message':_0xcf8d('0x40')});}})[_0xcf8d('0x2d')](function(_0x118b0b,_0x179b69,_0x2d552c){if(_0x118b0b[_0xcf8d('0x2e')]){db['User']['find']({'where':{'id':_0x118b0b['user']['id']},'attributes':userAttributes})['then'](function(_0x353e28){if(!_0x353e28){return _0x179b69[_0xcf8d('0x3e')](0x194)['json']({'message':_0xcf8d('0x52')});}_0x118b0b[_0xcf8d('0x2e')]=_0x353e28;_0x2d552c();})[_0xcf8d('0x37')](function(_0x566718){_0x2d552c(_0x566718);});}else if(_0x46277e){_0x2d552c();}else{return _0x179b69['status'](0x194)[_0xcf8d('0x34')]({'message':'User\x20object\x20not\x20found.'});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xcf8d('0x2d')](function(_0x377458,_0x59bf9e,_0x2c5194){return licenseUtil[_0xcf8d('0x53')]()[_0xcf8d('0x32')](function(_0x1b8f5f){if(_0x1b8f5f[_0xcf8d('0x54')]){_0x2c5194();}else{return _0x59bf9e[_0xcf8d('0x3e')](0x193)[_0xcf8d('0x34')]({'message':_0xcf8d('0x55')});}})['catch'](function(_0x383a13){_0x2c5194(_0x383a13);});});};exports[_0xcf8d('0x56')]=function isWebrtcLicence(){return compose()[_0xcf8d('0x2d')](function(_0x261b87,_0x37f0f3,_0xd40f62){return licenseUtil[_0xcf8d('0x53')]()['then'](function(_0x29595a){if(_0x29595a[_0xcf8d('0x57')]){_0xd40f62();}else{return _0x37f0f3[_0xcf8d('0x3e')](0x193)[_0xcf8d('0x34')]({'message':_0xcf8d('0x55')});}})[_0xcf8d('0x37')](function(_0x24fe99){_0xd40f62(_0x24fe99);});});};exports['isMiddleware']=function(_0x3aa66f,_0xd689c7,_0x459566){_0x3aa66f['isMiddleware']=!![];return _0x459566();};exports[_0xcf8d('0x58')]=function signToken(_0x275431){return signJwt(_0x275431);};exports[_0xcf8d('0x59')]=function(_0x19d05a,_0x4764b6){if(!_0x19d05a[_0xcf8d('0x2e')]){return _0x4764b6[_0xcf8d('0x3e')](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x5789df={'payload':{'id':_0x19d05a[_0xcf8d('0x2e')]['id'],'role':_0x19d05a[_0xcf8d('0x2e')][_0xcf8d('0xd')]},'options':{'expiresIn':0x15180}};return signJwt(_0x5789df)[_0xcf8d('0x32')](function(_0x47e07c){_0x4764b6[_0xcf8d('0x5a')](_0xcf8d('0x5b'),_0x47e07c);_0x4764b6[_0xcf8d('0x5c')](_0xcf8d('0x5d'));})[_0xcf8d('0x37')](function(_0x5bad3b){return _0x4764b6[_0xcf8d('0x3e')](0x1f4)['send'](_0x5bad3b);});};exports[_0xcf8d('0x5e')]=function(_0xd1cc9f){if(_[_0xcf8d('0x5f')](_0xd1cc9f[_0xcf8d('0x49')])||_[_0xcf8d('0x5f')](_0xd1cc9f[_0xcf8d('0x60')])){return null;}else{return createJwt(_0xd1cc9f);}};exports[_0xcf8d('0x61')]=function(_0x1cda31){_0x1cda31[_0xcf8d('0x49')]=generateNonce();_0x1cda31['apiKeyIat']=generateIssuedAt();return createJwt(_0x1cda31);};exports['regenerateApiKey']=function(_0x3dd91c,_0x2116ff){var _0x125199=_0x3dd91c[_0xcf8d('0x43')][_0xcf8d('0x41')];if(_0x125199){var _0x2715fb={'nonce':_0x2116ff['apiKeyNonce'],'iat':_0x2116ff[_0xcf8d('0x60')],'audience':hardwareConf[_0xcf8d('0x42')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x125199,_0x2715fb)[_0xcf8d('0x32')](function(){return generateApiKey(_0x2116ff);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports['validatePasswordPattern']=function(_0x1900fc){var _0x4e6bda=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x4e6bda[_0xcf8d('0x62')](_0x1900fc))throw new db[(_0xcf8d('0x63'))][(_0xcf8d('0x64'))](_0xcf8d('0x65'));return;};exports['validatePasswordHistory']=function(_0x218d95,_0x47d998,_0x160c2d){var _0x4c6c69=encryptor['decryptString'](_0x47d998)[_0xcf8d('0x66')](',');for(var _0x5938c7=0x0;_0x5938c7<_0x160c2d;_0x5938c7++){if(!_0x4c6c69[_0x5938c7])break;if(_0x218d95[_0xcf8d('0x67')]()===_0x4c6c69[_0x5938c7][_0xcf8d('0x67')]()){var _0x2f98c2=util[_0xcf8d('0x68')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x160c2d);if(_0x160c2d===0x1){_0x2f98c2=_0xcf8d('0x69');}throw new db[(_0xcf8d('0x63'))]['ValidationError'](_0x2f98c2);}}return;};exports[_0xcf8d('0x6a')]=function(_0x867277,_0x2128a4){var _0x49b267=_0x2128a4?encryptor[_0xcf8d('0x6b')](_0x2128a4)[_0xcf8d('0x66')](','):[];if(_0x49b267[_0xcf8d('0x6c')]===0x5){_0x49b267[_0xcf8d('0x6d')](-0x1,0x1);}_0x49b267[_0xcf8d('0x6e')](_0x867277);return encryptor[_0xcf8d('0x6f')](_0x49b267[_0xcf8d('0x70')](','));};function signJwt(_0x3bf9ac){var _0x15532b=BPromise[_0xcf8d('0x71')](jwt['sign'],{'context':jwt});var _0x14c960=_0x3bf9ac[_0xcf8d('0x72')]||config[_0xcf8d('0xb')][_0xcf8d('0xc')];return new BPromise(function(_0x5bd938,_0x5706a2){_0x15532b(_0x3bf9ac[_0xcf8d('0x73')],_0x14c960,_0x3bf9ac[_0xcf8d('0x74')])[_0xcf8d('0x32')](function(_0x2d0059){_0x5bd938(_0x2d0059);})['catch'](function(_0xb76ae0){_0x5706a2(_0xb76ae0);});});}function verifyJwt(_0x6d35c6,_0x334b1a,_0x37296e){var _0x1f8bf6=BPromise[_0xcf8d('0x71')](jwt[_0xcf8d('0x75')],{'context':jwt});var _0x56db0b=_0x37296e||config[_0xcf8d('0xb')][_0xcf8d('0xc')];return new BPromise(function(_0x47b450,_0x94fb88){_0x1f8bf6(_0x6d35c6,_0x56db0b,_0x334b1a)[_0xcf8d('0x32')](function(_0x2c66aa){_0x47b450(_0x2c66aa);})['catch'](function(_0x146392){_0x94fb88(_0x146392);});});}function generateNonce(){return crypto[_0xcf8d('0x76')](0x10)['toString']('hex');}function generateIssuedAt(){return Math['floor'](Date['now']()/0x3e8)[_0xcf8d('0x77')]();}function createJwt(_0x233062){var _0x4dbf81={'payload':{'iat':_0x233062['apiKeyIat'],'nonce':_0x233062['apiKeyNonce']},'options':{'algorithm':_0xcf8d('0x78'),'subject':_0x233062['id'][_0xcf8d('0x77')](),'issuer':hardwareConf[_0xcf8d('0x42')](),'audience':hardwareConf[_0xcf8d('0x42')]()}};return signJwt(_0x4dbf81)[_0xcf8d('0x32')](function(_0x8c3cec){return{'iat':_0x233062[_0xcf8d('0x60')],'nonce':_0x233062[_0xcf8d('0x49')],'token':_0x8c3cec};});} \ No newline at end of file +var _0xd26b=['Unknown\x20authorization\x20format','query','getUuid','apikey','find','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','update','Forbidden','isWebrtcLicence','getLicense','webrtc','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','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','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','decryptString','split','length','splice','unshift','encryptString','join','promisify','sign','secret','payload','verify','randomBytes','toString','hex','now','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','secrets','session','role','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','status','disposition','unmanaged','json','Forbidden.','catch','authorization','Basic','User','then','authenticate','Wrong\x20credentials.','startsWith','headers','Bearer'];(function(_0xa3114,_0x2576d5){var _0x1d414d=function(_0x2bec48){while(--_0x2bec48){_0xa3114['push'](_0xa3114['shift']());}};_0x1d414d(++_0x2576d5);}(_0xd26b,0x1cd));var _0xbd26=function(_0x449853,_0x2f6bc6){_0x449853=_0x449853-0x0;var _0x4ec99e=_0xd26b[_0x449853];return _0x4ec99e;};'use strict';var db=require(_0xbd26('0x0'))['db'];var config=require(_0xbd26('0x1'));var hardwareConf=require(_0xbd26('0x2'));var licenseUtil=require(_0xbd26('0x3'));var encryptor=require(_0xbd26('0x4'));var _=require(_0xbd26('0x5'));var jwt=require(_0xbd26('0x6'));var expressJwt=require('express-jwt');var compose=require(_0xbd26('0x7'));var basicAuth=require(_0xbd26('0x8'));var crypto=require(_0xbd26('0x9'));var BPromise=require('bluebird');var util=require('util');var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0xbd26('0xa')][_0xbd26('0xb')]});var userAttributes=['id',_0xbd26('0xc'),_0xbd26('0xd'),_0xbd26('0xe'),_0xbd26('0xf'),_0xbd26('0x10'),_0xbd26('0x11'),_0xbd26('0x12'),_0xbd26('0x13'),_0xbd26('0x14'),_0xbd26('0x15'),_0xbd26('0x16'),_0xbd26('0x17'),_0xbd26('0x18'),_0xbd26('0x19'),_0xbd26('0x1a'),_0xbd26('0x1b'),_0xbd26('0x1c'),_0xbd26('0x1d'),'crudPermissions',_0xbd26('0x1e'),_0xbd26('0x1f'),_0xbd26('0x20'),_0xbd26('0x21'),'phoneBarAutoAnswerDelay',_0xbd26('0x22'),'phoneBarEnableRecording',_0xbd26('0x23'),_0xbd26('0x24'),_0xbd26('0x25'),_0xbd26('0x26'),'phoneBarRemoteControl',_0xbd26('0x27'),_0xbd26('0x28'),_0xbd26('0x29'),_0xbd26('0x2a'),_0xbd26('0x2b'),'settingsEnabled',_0xbd26('0x2c'),_0xbd26('0x2d'),_0xbd26('0x2e'),'downloadAttachments','ignorePauseForPreviewCalls',_0xbd26('0x2f')];exports[_0xbd26('0x30')]=function(){return this[_0xbd26('0x31')](!![])[_0xbd26('0x32')](function(_0x4f1df8,_0x4b4ddd,_0x40c631){if(_0x4f1df8[_0xbd26('0x33')]){_0x40c631();}else{return db[_0xbd26('0x34')][_0xbd26('0x35')]({'where':{'id':_0x4f1df8[_0xbd26('0x36')]['id']},'attributes':['id',_0xbd26('0x37'),'disposition'],'raw':!![]})['then'](function(_0x3fad0a){if(_0x3fad0a&&_0x3fad0a[_0xbd26('0x37')]){return _0x4b4ddd[_0xbd26('0x38')](_0x3fad0a[_0xbd26('0x39')]===_0xbd26('0x3a')?0x195:0x193)[_0xbd26('0x3b')]({'message':_0x3fad0a[_0xbd26('0x39')]==='unmanaged'?'Unmanaged.':_0xbd26('0x3c')});}else{_0x40c631();}})[_0xbd26('0x3d')](function(_0x262a05){_0x40c631(_0x262a05);});}});};exports[_0xbd26('0x31')]=function isAuthenticated(_0x43f8e5){return compose()[_0xbd26('0x32')](function(_0x3c4681,_0x5601a1,_0x13b1e9){var _0x5c9389;if(_0x3c4681['headers']['authorization']){if(_['startsWith'](_0x3c4681['headers'][_0xbd26('0x3e')],_0xbd26('0x3f'))){var _0x4a2893=basicAuth(_0x3c4681);db[_0xbd26('0x40')]['find']({'where':{'name':_0x4a2893[_0xbd26('0xe')]}})[_0xbd26('0x41')](function(_0x16dc81){if(!_0x16dc81||!_0x16dc81[_0xbd26('0x42')](_0x4a2893['pass'])){return _0x5601a1['status'](0x191)[_0xbd26('0x3b')]({'message':_0xbd26('0x43')});}_0x3c4681[_0xbd26('0x33')]={'id':_0x16dc81['id']};_0x13b1e9();})[_0xbd26('0x3d')](function(_0x4f3a53){_0x13b1e9(_0x4f3a53);});}else if(_[_0xbd26('0x44')](_0x3c4681[_0xbd26('0x45')][_0xbd26('0x3e')],_0xbd26('0x46'))){validateJwt(_0x3c4681,_0x5601a1,_0x13b1e9);}else{if(_0x43f8e5){_0x13b1e9();}else{return _0x5601a1[_0xbd26('0x38')](0x193)['json']({'message':_0xbd26('0x47')});}}}else if(_0x3c4681[_0xbd26('0x48')]['apikey']){try{var _0x53ea73={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xbd26('0x49')]()};verifyJwt(_0x3c4681['query'][_0xbd26('0x4a')],_0x53ea73)[_0xbd26('0x41')](function(_0x4a20d3){return db[_0xbd26('0x40')][_0xbd26('0x4b')]({'where':{'id':_0x4a20d3[_0xbd26('0x4c')]}})[_0xbd26('0x41')](function(_0x264f05){_0x5c9389=_0x264f05;return db[_0xbd26('0x4d')][_0xbd26('0x35')]({'where':{'id':0x1},'attributes':[_0xbd26('0x4e'),_0xbd26('0x4f')],'raw':!![]});})[_0xbd26('0x41')](function(_0x694ed3){if(!_0x5c9389||!_[_0xbd26('0x50')](_0x5c9389[_0xbd26('0x51')],_0x4a20d3['nonce'])){return _0x5601a1[_0xbd26('0x38')](0x191)[_0xbd26('0x3b')]({'message':_0xbd26('0x52')});}if(_0x5c9389[_0xbd26('0x53')]){return _0x5601a1[_0xbd26('0x38')](0x191)['json']({'message':_0xbd26('0x54')});}if(_0x5c9389[_0xbd26('0x55')]){if(_0x694ed3['blockDuration']>0x0){if(moment(_0x5c9389[_0xbd26('0x56')])['add'](_0x694ed3[_0xbd26('0x4f')],_0xbd26('0x57'))>moment()){return _0x5601a1[_0xbd26('0x38')](0x191)[_0xbd26('0x3b')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x5601a1[_0xbd26('0x38')](0x191)['json']({'message':_0xbd26('0x54')});}}_0x3c4681[_0xbd26('0x33')]={'id':_0x5c9389['id']};_0x13b1e9();});})[_0xbd26('0x3d')](function(){return _0x5601a1[_0xbd26('0x38')](0x191)['json']({'message':_0xbd26('0x54')});});}catch(_0x4876cf){_0x13b1e9(_0x4876cf);}}else if(_0x43f8e5){_0x13b1e9();}else{return _0x5601a1[_0xbd26('0x38')](0x193)['json']({'message':_0xbd26('0x47')});}})['use'](function(_0x154736,_0x488fd1,_0x31b5c1){if(_0x154736['user']){db[_0xbd26('0x40')][_0xbd26('0x4b')]({'where':{'id':_0x154736['user']['id']},'attributes':userAttributes})[_0xbd26('0x41')](function(_0x37d126){if(!_0x37d126){return _0x488fd1['status'](0x194)[_0xbd26('0x3b')]({'message':_0xbd26('0x58')});}_0x154736[_0xbd26('0x33')]=_0x37d126;_0x31b5c1();})['catch'](function(_0x3d9563){_0x31b5c1(_0x3d9563);});}else if(_0x43f8e5){_0x31b5c1();}else{return _0x488fd1[_0xbd26('0x38')](0x194)[_0xbd26('0x3b')]({'message':_0xbd26('0x59')});}});};exports['canUpdate']=function canUpdate(){return compose()['use'](function(_0x1b5986,_0x30dccb,_0x4d3205){return licenseUtil['getLicense']()['then'](function(_0x45e1c7){if(_0x45e1c7[_0xbd26('0x5a')]){_0x4d3205();}else{return _0x30dccb[_0xbd26('0x38')](0x193)[_0xbd26('0x3b')]({'message':_0xbd26('0x5b')});}})[_0xbd26('0x3d')](function(_0x489741){_0x4d3205(_0x489741);});});};exports[_0xbd26('0x5c')]=function isWebrtcLicence(){return compose()['use'](function(_0x22f1ab,_0x269268,_0x42e49a){return licenseUtil[_0xbd26('0x5d')]()[_0xbd26('0x41')](function(_0x224b12){if(_0x224b12[_0xbd26('0x5e')]){_0x42e49a();}else{return _0x269268[_0xbd26('0x38')](0x193)[_0xbd26('0x3b')]({'message':_0xbd26('0x5b')});}})[_0xbd26('0x3d')](function(_0x4f5318){_0x42e49a(_0x4f5318);});});};exports[_0xbd26('0x5f')]=function(_0x16bb69,_0x4c5843,_0x479a3e){_0x16bb69[_0xbd26('0x5f')]=!![];return _0x479a3e();};exports['signToken']=function signToken(_0x41d487){return signJwt(_0x41d487);};exports[_0xbd26('0x60')]=function(_0x20c170,_0x48d229){if(!_0x20c170[_0xbd26('0x33')]){return _0x48d229[_0xbd26('0x38')](0x194)[_0xbd26('0x3b')]({'message':_0xbd26('0x61')});}var _0xd95e7d={'payload':{'id':_0x20c170[_0xbd26('0x33')]['id'],'role':_0x20c170[_0xbd26('0x33')][_0xbd26('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0xd95e7d)[_0xbd26('0x41')](function(_0x2ac214){_0x48d229[_0xbd26('0x62')](_0xbd26('0x63'),_0x2ac214);_0x48d229[_0xbd26('0x64')](_0xbd26('0x65'));})['catch'](function(_0x9c89e3){return _0x48d229[_0xbd26('0x38')](0x1f4)['send'](_0x9c89e3);});};exports[_0xbd26('0x66')]=function(_0x19b0f9){if(_[_0xbd26('0x67')](_0x19b0f9[_0xbd26('0x51')])||_['isNil'](_0x19b0f9['apiKeyIat'])){return null;}else{return createJwt(_0x19b0f9);}};exports['generateApiKey']=function(_0x52b0b6){_0x52b0b6[_0xbd26('0x51')]=generateNonce();_0x52b0b6[_0xbd26('0x68')]=generateIssuedAt();return createJwt(_0x52b0b6);};exports[_0xbd26('0x69')]=function(_0xc65e40,_0x4d3f7a){var _0xef9d16=_0xc65e40[_0xbd26('0x48')][_0xbd26('0x4a')];if(_0xef9d16){var _0x4bb17a={'nonce':_0x4d3f7a[_0xbd26('0x51')],'iat':_0x4d3f7a[_0xbd26('0x68')],'audience':hardwareConf[_0xbd26('0x49')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0xef9d16,_0x4bb17a)[_0xbd26('0x41')](function(){return generateApiKey(_0x4d3f7a);});}else{throw{'message':_0xbd26('0x6a')};}};exports[_0xbd26('0x6b')]=function(_0x5de056){var _0x589f87=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x589f87['test'](_0x5de056))throw new db[(_0xbd26('0x6c'))][(_0xbd26('0x6d'))](_0xbd26('0x6e'));return;};exports[_0xbd26('0x6f')]=function(_0x4c0f25,_0x3d1b11,_0x286334){var _0x42e31e=encryptor['decryptString'](_0x3d1b11)['split'](',');for(var _0x1138ab=0x0;_0x1138ab<_0x286334;_0x1138ab++){if(!_0x42e31e[_0x1138ab])break;if(_0x4c0f25['toLowerCase']()===_0x42e31e[_0x1138ab][_0xbd26('0x70')]()){var _0x30828b=util[_0xbd26('0x71')](_0xbd26('0x72'),_0x286334);if(_0x286334===0x1){_0x30828b=_0xbd26('0x73');}throw new db[(_0xbd26('0x6c'))][(_0xbd26('0x6d'))](_0x30828b);}}return;};exports[_0xbd26('0x74')]=function(_0x306481,_0x350c2e){var _0x5990eb=_0x350c2e?encryptor[_0xbd26('0x75')](_0x350c2e)[_0xbd26('0x76')](','):[];if(_0x5990eb[_0xbd26('0x77')]===0x5){_0x5990eb[_0xbd26('0x78')](-0x1,0x1);}_0x5990eb[_0xbd26('0x79')](_0x306481);return encryptor[_0xbd26('0x7a')](_0x5990eb[_0xbd26('0x7b')](','));};function signJwt(_0x39352b){var _0x2d12e3=BPromise[_0xbd26('0x7c')](jwt[_0xbd26('0x7d')],{'context':jwt});var _0xabb88e=_0x39352b[_0xbd26('0x7e')]||config[_0xbd26('0xa')][_0xbd26('0xb')];return new BPromise(function(_0x510148,_0x39d825){_0x2d12e3(_0x39352b[_0xbd26('0x7f')],_0xabb88e,_0x39352b['options'])[_0xbd26('0x41')](function(_0x2f7c51){_0x510148(_0x2f7c51);})['catch'](function(_0x1cea6f){_0x39d825(_0x1cea6f);});});}function verifyJwt(_0x1d5112,_0xd459e,_0x224917){var _0x1da62e=BPromise[_0xbd26('0x7c')](jwt[_0xbd26('0x80')],{'context':jwt});var _0x3c9ec3=_0x224917||config[_0xbd26('0xa')][_0xbd26('0xb')];return new BPromise(function(_0x4e3b7c,_0x572c2b){_0x1da62e(_0x1d5112,_0x3c9ec3,_0xd459e)[_0xbd26('0x41')](function(_0x26a420){_0x4e3b7c(_0x26a420);})[_0xbd26('0x3d')](function(_0x4ca9b6){_0x572c2b(_0x4ca9b6);});});}function generateNonce(){return crypto[_0xbd26('0x81')](0x10)[_0xbd26('0x82')](_0xbd26('0x83'));}function generateIssuedAt(){return Math['floor'](Date[_0xbd26('0x84')]()/0x3e8)[_0xbd26('0x82')]();}function createJwt(_0x2c0b23){var _0x54c74b={'payload':{'iat':_0x2c0b23[_0xbd26('0x68')],'nonce':_0x2c0b23[_0xbd26('0x51')]},'options':{'algorithm':'HS512','subject':_0x2c0b23['id'][_0xbd26('0x82')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xbd26('0x49')]()}};return signJwt(_0x54c74b)[_0xbd26('0x41')](function(_0x1a015b){return{'iat':_0x2c0b23['apiKeyIat'],'nonce':_0x2c0b23[_0xbd26('0x51')],'token':_0x1a015b};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 87bed10..dcb31d4 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 _0xe832=['hasOwnProperty','encryptFile','createWriteStream','createCipher','data','binary','write','final','end','close','decryptFile','createReadStream','createDecipher','update','unlink','encryptString','secret','utf8','base64','decryptString','bluebird','lodash','../../config/logger','app','session','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter'];(function(_0x36ebcc,_0x4bb3cb){var _0x5c49f0=function(_0xba2b52){while(--_0xba2b52){_0x36ebcc['push'](_0x36ebcc['shift']());}};_0x5c49f0(++_0x4bb3cb);}(_0xe832,0x102));var _0x2e83=function(_0xdb25b7,_0xfbb6c0){_0xdb25b7=_0xdb25b7-0x0;var _0x2fe5c7=_0xe832[_0xdb25b7];return _0x2fe5c7;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x2e83('0x0'));var _=require(_0x2e83('0x1'));var config=require('../../config/environment');var logger=require(_0x2e83('0x2'))(_0x2e83('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x2e83('0x4')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x2e83('0x5')};if(config[_0x2e83('0x6')]&&config[_0x2e83('0x6')]['algorithm']){var isSupported=isAlgorithmSupported(config['encrypt'][_0x2e83('0x7')]);if(isSupported){fileOptions[_0x2e83('0x7')]=config['encrypt'][_0x2e83('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x2e83('0x8')](',\x20');logger[_0x2e83('0x9')](config[_0x2e83('0x6')][_0x2e83('0x7')],_0x2e83('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0xc0e8a3){return AES_SUPPORTED_RX[_0x2e83('0xb')](_0xc0e8a3);}function getSupportedCiphers(){return crypto[_0x2e83('0xc')]()[_0x2e83('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x16ab18){return getSupportedCiphers()['indexOf'](_0x16ab18)>-0x1;}function combineOptions(_0x25097d){var _0x1a8fa6={};for(var _0xf8fcd2 in fileOptions){if(fileOptions[_0x2e83('0xe')](_0xf8fcd2)){_0x1a8fa6[_0xf8fcd2]=fileOptions[_0xf8fcd2];}}if(_0x25097d){for(var _0x5b1a1d in _0x25097d){if(_0x25097d[_0x2e83('0xe')](_0x5b1a1d)){_0x1a8fa6[_0x5b1a1d]=_0x25097d[_0x5b1a1d];}}}return _0x1a8fa6;}exports[_0x2e83('0xf')]=function(_0x3e03db,_0xbed66e,_0x5f5c1f,_0x572d6e){return new BPromise(function(_0x5d23d8,_0x249669){_0x572d6e=combineOptions(_0x572d6e);var _0x32ad4c=new Buffer(_0x5f5c1f);var _0x4aa259=fs['createReadStream'](_0x3e03db);var _0x349459=fs[_0x2e83('0x10')](_0xbed66e);var _0x4721f0=crypto[_0x2e83('0x11')](_0x572d6e['algorithm'],_0x32ad4c);_0x4aa259['on'](_0x2e83('0x12'),function(_0x3655b3){var _0x3316d6=new Buffer(_0x4721f0['update'](_0x3655b3),_0x2e83('0x13'));_0x349459[_0x2e83('0x14')](_0x3316d6);});_0x4aa259['on']('end',function(){try{var _0x27be3c=new Buffer(_0x4721f0[_0x2e83('0x15')](_0x2e83('0x13')),_0x2e83('0x13'));_0x349459[_0x2e83('0x14')](_0x27be3c);_0x349459[_0x2e83('0x16')]();_0x349459['on'](_0x2e83('0x17'),function(){return _0x5d23d8(_0xbed66e);});}catch(_0x4bd6c9){fs['unlink'](_0xbed66e);return _0x249669(_0x4bd6c9);}});});};exports[_0x2e83('0x18')]=function(_0x11d4fa,_0x4f18dc,_0xc34daf,_0x4be3f8){return new BPromise(function(_0x126072,_0x4b4481){_0x4be3f8=combineOptions(_0x4be3f8);var _0xb70eef=new Buffer(_0xc34daf);var _0xf5f72d=fs[_0x2e83('0x19')](_0x11d4fa);var _0x36d31b=fs['createWriteStream'](_0x4f18dc);var _0x4c9451=crypto[_0x2e83('0x1a')](_0x4be3f8['algorithm'],_0xb70eef);_0xf5f72d['on'](_0x2e83('0x12'),function(_0x3a846b){var _0xd28159=new Buffer(_0x4c9451[_0x2e83('0x1b')](_0x3a846b),_0x2e83('0x13'));_0x36d31b[_0x2e83('0x14')](_0xd28159);});_0xf5f72d['on'](_0x2e83('0x16'),function(){try{var _0x524a9b=new Buffer(_0x4c9451[_0x2e83('0x15')]('binary'),_0x2e83('0x13'));_0x36d31b[_0x2e83('0x14')](_0x524a9b);_0x36d31b[_0x2e83('0x16')]();_0x36d31b['on'](_0x2e83('0x17'),function(){return _0x126072(_0x4f18dc);});}catch(_0xa7faf6){fs[_0x2e83('0x1c')](_0x4f18dc);return _0x4b4481(_0xa7faf6);}});});};exports[_0x2e83('0x1d')]=function(_0x5356ef,_0x543571,_0x180cd0){var _0xd6593d=_0x180cd0||stringOptions['algorithm'];var _0x11f300=_0x543571||stringOptions[_0x2e83('0x1e')];var _0x3b7585=crypto['createCipher'](_0xd6593d,_0x11f300);var _0xa6427f=_0x3b7585[_0x2e83('0x1b')](_0x5356ef,_0x2e83('0x1f'),_0x2e83('0x20'));_0xa6427f+=_0x3b7585[_0x2e83('0x15')](_0x2e83('0x20'));return _0xa6427f;};exports[_0x2e83('0x21')]=function(_0x381558,_0x40ddf5,_0x48b1df){var _0x5850ae=_0x48b1df||stringOptions['algorithm'];var _0x4b5b70=_0x40ddf5||stringOptions[_0x2e83('0x1e')];var _0x1c5e74=crypto[_0x2e83('0x1a')](_0x5850ae,_0x4b5b70);var _0x3e5b3a=_0x1c5e74[_0x2e83('0x1b')](_0x381558,_0x2e83('0x20'),_0x2e83('0x1f'));_0x3e5b3a+=_0x1c5e74[_0x2e83('0x15')](_0x2e83('0x1f'));return _0x3e5b3a;}; \ No newline at end of file +var _0x4b20=['unlink','createReadStream','encryptString','utf8','base64','decryptString','createDecipher','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','hasOwnProperty','createWriteStream','createCipher','data','update','binary','write','end','final','close'];(function(_0x219d87,_0x1cb6f7){var _0x22823d=function(_0x5357bf){while(--_0x5357bf){_0x219d87['push'](_0x219d87['shift']());}};_0x22823d(++_0x1cb6f7);}(_0x4b20,0x133));var _0x04b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b20[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var _=require('lodash');var config=require(_0x04b2('0x0'));var logger=require(_0x04b2('0x1'))(_0x04b2('0x2'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x04b2('0x3')][_0x04b2('0x4')],'algorithm':_0x04b2('0x5')};const fileOptions={'algorithm':'aes192'};if(config[_0x04b2('0x6')]&&config[_0x04b2('0x6')][_0x04b2('0x7')]){var isSupported=isAlgorithmSupported(config[_0x04b2('0x6')][_0x04b2('0x7')]);if(isSupported){fileOptions[_0x04b2('0x7')]=config['encrypt'][_0x04b2('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x04b2('0x8')](',\x20');logger[_0x04b2('0x9')](config[_0x04b2('0x6')][_0x04b2('0x7')],_0x04b2('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x26a4ed){return AES_SUPPORTED_RX[_0x04b2('0xb')](_0x26a4ed);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x04b2('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x3357ea){return getSupportedCiphers()['indexOf'](_0x3357ea)>-0x1;}function combineOptions(_0x4350d2){var _0x10efc6={};for(var _0x175250 in fileOptions){if(fileOptions[_0x04b2('0xd')](_0x175250)){_0x10efc6[_0x175250]=fileOptions[_0x175250];}}if(_0x4350d2){for(var _0x730235 in _0x4350d2){if(_0x4350d2['hasOwnProperty'](_0x730235)){_0x10efc6[_0x730235]=_0x4350d2[_0x730235];}}}return _0x10efc6;}exports['encryptFile']=function(_0x2829ff,_0x11e019,_0x3dddfe,_0x1a9f89){return new BPromise(function(_0x1fe577,_0x544133){_0x1a9f89=combineOptions(_0x1a9f89);var _0x410b08=new Buffer(_0x3dddfe);var _0x21673e=fs['createReadStream'](_0x2829ff);var _0x559b47=fs[_0x04b2('0xe')](_0x11e019);var _0x4b6d23=crypto[_0x04b2('0xf')](_0x1a9f89[_0x04b2('0x7')],_0x410b08);_0x21673e['on'](_0x04b2('0x10'),function(_0x2b077c){var _0x5c6b65=new Buffer(_0x4b6d23[_0x04b2('0x11')](_0x2b077c),_0x04b2('0x12'));_0x559b47[_0x04b2('0x13')](_0x5c6b65);});_0x21673e['on'](_0x04b2('0x14'),function(){try{var _0x72d037=new Buffer(_0x4b6d23[_0x04b2('0x15')](_0x04b2('0x12')),_0x04b2('0x12'));_0x559b47[_0x04b2('0x13')](_0x72d037);_0x559b47[_0x04b2('0x14')]();_0x559b47['on'](_0x04b2('0x16'),function(){return _0x1fe577(_0x11e019);});}catch(_0x1d1ad7){fs[_0x04b2('0x17')](_0x11e019);return _0x544133(_0x1d1ad7);}});});};exports['decryptFile']=function(_0x2e133e,_0x1ab1b0,_0x1750ee,_0x36e3b5){return new BPromise(function(_0x2df046,_0x1000ac){_0x36e3b5=combineOptions(_0x36e3b5);var _0x141bce=new Buffer(_0x1750ee);var _0x5af49e=fs[_0x04b2('0x18')](_0x2e133e);var _0x8e08ce=fs[_0x04b2('0xe')](_0x1ab1b0);var _0x7d6db6=crypto['createDecipher'](_0x36e3b5[_0x04b2('0x7')],_0x141bce);_0x5af49e['on'](_0x04b2('0x10'),function(_0xbc7de9){var _0xd797d=new Buffer(_0x7d6db6[_0x04b2('0x11')](_0xbc7de9),_0x04b2('0x12'));_0x8e08ce[_0x04b2('0x13')](_0xd797d);});_0x5af49e['on']('end',function(){try{var _0x2f4f72=new Buffer(_0x7d6db6['final']('binary'),_0x04b2('0x12'));_0x8e08ce[_0x04b2('0x13')](_0x2f4f72);_0x8e08ce[_0x04b2('0x14')]();_0x8e08ce['on']('close',function(){return _0x2df046(_0x1ab1b0);});}catch(_0x2a00eb){fs['unlink'](_0x1ab1b0);return _0x1000ac(_0x2a00eb);}});});};exports[_0x04b2('0x19')]=function(_0x643137,_0x388747,_0x97514b){var _0x107110=_0x97514b||stringOptions[_0x04b2('0x7')];var _0x1aa94e=_0x388747||stringOptions['secret'];var _0x2542f2=crypto['createCipher'](_0x107110,_0x1aa94e);var _0x1b12dd=_0x2542f2[_0x04b2('0x11')](_0x643137,_0x04b2('0x1a'),'base64');_0x1b12dd+=_0x2542f2['final'](_0x04b2('0x1b'));return _0x1b12dd;};exports[_0x04b2('0x1c')]=function(_0x4cb57b,_0x871863,_0x22af0b){var _0x2e48ab=_0x22af0b||stringOptions[_0x04b2('0x7')];var _0x357b91=_0x871863||stringOptions['secret'];var _0x5a7db1=crypto[_0x04b2('0x1d')](_0x2e48ab,_0x357b91);var _0xc15f45=_0x5a7db1[_0x04b2('0x11')](_0x4cb57b,_0x04b2('0x1b'),_0x04b2('0x1a'));_0xc15f45+=_0x5a7db1[_0x04b2('0x15')]('utf8');return _0xc15f45;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index b4988ad..950f72a 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 _0xb1ac=['info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeCsv','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','length','range','isInteger','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','each','%s%d.%s','csv','%s.%s','writeFileSync','join','zip','zip\x20finished','CSV','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','util','path','lodash','bluebird','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update'];(function(_0x475266,_0x572e26){var _0x4a794e=function(_0x410086){while(--_0x410086){_0x475266['push'](_0x475266['shift']());}};_0x4a794e(++_0x572e26);}(_0xb1ac,0x87));var _0xcb1a=function(_0x290891,_0x189217){_0x290891=_0x290891-0x0;var _0x13b889=_0xb1ac[_0x290891];return _0x13b889;};'use strict';var util=require(_0xcb1a('0x0'));var path=require(_0xcb1a('0x1'));var _=require(_0xcb1a('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xcb1a('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xcb1a('0x4'));var db=require(_0xcb1a('0x5'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0xcb1a('0x6'))(_0xcb1a('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xcb1a('0x8')][0x2]);var QUERY=process[_0xcb1a('0x8')][0x3];var PATH=process[_0xcb1a('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x107d87,_0x3a8abf){var _0xb0f535={'status':_0x107d87};var _0x589cef={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3a8abf){_0xb0f535[_0xcb1a('0x9')]=_0x3a8abf;}return db[_0xcb1a('0xa')][_0xcb1a('0xb')](_0xb0f535,_0x589cef);}function main(){var _0x67bc94=0x1388;var _0x540204;logger[_0xcb1a('0xc')](util[_0xcb1a('0xd')](_0xcb1a('0xe'),EXTRACTED_REPORT_ID,'CSV'));return db[_0xcb1a('0xf')][_0xcb1a('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xcb1a('0x11'),_0xcb1a('0x12')]})[_0xcb1a('0x13')](function(_0x146659){if(_0x146659){_0x540204=_0x146659;_0x67bc94=_0x540204[_0xcb1a('0x12')]||0x1388;}})[_0xcb1a('0x13')](function(){return dbH['sequelize']['query'](util['format'](_0xcb1a('0x14'),QUERY),{'type':dbH[_0xcb1a('0x15')][_0xcb1a('0x16')][_0xcb1a('0x17')]});})['then'](function(_0x138325){if(!_0x138325[0x0][_0xcb1a('0x18')]){return analyticExtractedReport('Empty');}var _0x5b1b43=[];var _0x41480d=0x0;if(_0x540204[_0xcb1a('0x11')]){if(_0x138325&&_0x138325[_0xcb1a('0x19')]){var _0x3d246c=_[_0xcb1a('0x1a')](_0x138325[0x0][_0xcb1a('0x18')]/_0x67bc94);var _0x7ad300=Number[_0xcb1a('0x1b')](_0x138325[0x0][_0xcb1a('0x18')]/_0x67bc94)?_0x138325[0x0][_0xcb1a('0x18')]%_0x67bc94:0x0;_0x3d246c['forEach'](function(_0x151fa5){if(_0x151fa5>0x0){_0x41480d+=_0x67bc94;}_0x5b1b43[_0xcb1a('0x1c')](dbH[_0xcb1a('0x15')][_0xcb1a('0x1d')](util[_0xcb1a('0xd')](_0xcb1a('0x1e'),QUERY,_0x67bc94,_0x41480d),{'type':dbH['sequelize'][_0xcb1a('0x16')][_0xcb1a('0x17')]}));});if(_0x7ad300>0x0){_0x41480d+=_0x67bc94;_0x5b1b43[_0xcb1a('0x1c')](dbH[_0xcb1a('0x15')][_0xcb1a('0x1d')](util['format'](_0xcb1a('0x1e'),QUERY,_0x7ad300,_0x41480d),{'type':dbH[_0xcb1a('0x15')]['QueryTypes'][_0xcb1a('0x17')]}));}}}else{_0x5b1b43[_0xcb1a('0x1c')](dbH[_0xcb1a('0x15')][_0xcb1a('0x1d')](QUERY,{'type':dbH[_0xcb1a('0x15')]['QueryTypes'][_0xcb1a('0x17')]}));}var _0x1a9618=path[_0xcb1a('0x1f')](PATH);var _0x95a710=path[_0xcb1a('0x20')](PATH,_0xcb1a('0x21'));var _0x4c7bec=_0x540204['split']&&_0x5b1b43[_0xcb1a('0x19')]>0x1;var _0x4c9ce1=[];if(!fs[_0xcb1a('0x22')](path['join'](_0x1a9618,_0x95a710))&&_0x4c7bec){fs['mkdirSync'](path['join'](_0x1a9618,_0x95a710));}return BPromise[_0xcb1a('0x23')](_0x5b1b43,function(_0x413114){_0x4c9ce1[_0xcb1a('0x1c')](_0x413114);})[_0xcb1a('0x13')](function(){for(var _0x54f918=0x0;_0x54f918<_0x4c9ce1[_0xcb1a('0x19')];_0x54f918+=0x1){var _0x508946;var _0x52b520=_0x4c9ce1[_0x54f918];if(_0x4c7bec){_0x508946=path['join'](_0x1a9618,_0x95a710,util['format'](_0xcb1a('0x24'),_0x95a710,_0x54f918,_0xcb1a('0x25')));}else{_0x508946=path['join'](_0x1a9618,util['format'](_0xcb1a('0x26'),_0x95a710,_0xcb1a('0x25')));}fs[_0xcb1a('0x27')](_0x508946,csv(_0x52b520));}})['then'](function(){if(_0x4c7bec){return new Promise(function(_0x22036e){zipdir(path['join'](_0x1a9618,_0x95a710),{'saveTo':path[_0xcb1a('0x28')](_0x1a9618,util[_0xcb1a('0xd')](_0xcb1a('0x26'),_0x95a710,_0xcb1a('0x29')))},function(_0x20a372,_0x5d9920){rimraf(path[_0xcb1a('0x28')](_0x1a9618,_0x95a710),function(){});_0x22036e(_0xcb1a('0x2a'));});});}})[_0xcb1a('0x13')](function(){logger[_0xcb1a('0xc')](util[_0xcb1a('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xcb1a('0x2b')));return analyticExtractedReport('Completed',_0x4c7bec?util[_0xcb1a('0xd')](_0xcb1a('0x26'),_0x95a710,_0x4c7bec?_0xcb1a('0x29'):_0xcb1a('0x25')):null);});})[_0xcb1a('0x2c')](function(_0x4663ae){logger[_0xcb1a('0xc')](util[_0xcb1a('0xd')](_0xcb1a('0x2d'),EXTRACTED_REPORT_ID,_0xcb1a('0x2b')),util[_0xcb1a('0x2e')](_0x4663ae,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xcb1a('0x2f')](function(){process[_0xcb1a('0x30')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x0f14=['util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','split','then','splitSizeCsv','sequelize','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','range','isInteger','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','basename','.csv','existsSync','mkdirSync','join','each','length','csv','%s.%s','zip','zip\x20finished','info','CSV','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','exit'];(function(_0x3c4afa,_0x1bf126){var _0xa57a1a=function(_0x19caa0){while(--_0x19caa0){_0x3c4afa['push'](_0x3c4afa['shift']());}};_0xa57a1a(++_0x1bf126);}(_0x0f14,0x1e0));var _0x40f1=function(_0x7428d9,_0x4fb189){_0x7428d9=_0x7428d9-0x0;var _0xfc0fd1=_0x0f14[_0x7428d9];return _0xfc0fd1;};'use strict';var util=require(_0x40f1('0x0'));var path=require(_0x40f1('0x1'));var _=require(_0x40f1('0x2'));var csv=require(_0x40f1('0x3'));var fs=require('fs');var BPromise=require(_0x40f1('0x4'));var zipdir=require(_0x40f1('0x5'));var rimraf=require(_0x40f1('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0x40f1('0x7'))[_0x40f1('0x8')];var logger=require(_0x40f1('0x9'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x40f1('0xa')][0x2]);var QUERY=process[_0x40f1('0xa')][0x3];var PATH=process[_0x40f1('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x12d47a,_0x5ca1e8){var _0x1a24f7={'status':_0x12d47a};var _0xf09297={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5ca1e8){_0x1a24f7['savename']=_0x5ca1e8;}return db['AnalyticExtractedReport'][_0x40f1('0xb')](_0x1a24f7,_0xf09297);}function main(){var _0x46c6ba=0x1388;var _0x46b6b5;logger['info'](util['format'](_0x40f1('0xc'),EXTRACTED_REPORT_ID,'CSV'));return db['Setting'][_0x40f1('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x40f1('0xe'),'splitSizeCsv']})[_0x40f1('0xf')](function(_0x329243){if(_0x329243){_0x46b6b5=_0x329243;_0x46c6ba=_0x46b6b5[_0x40f1('0x10')]||0x1388;}})['then'](function(){return dbH[_0x40f1('0x11')]['query'](util[_0x40f1('0x12')](_0x40f1('0x13'),QUERY),{'type':dbH['sequelize'][_0x40f1('0x14')][_0x40f1('0x15')]});})[_0x40f1('0xf')](function(_0x5e0fb6){if(!_0x5e0fb6[0x0][_0x40f1('0x16')]){return analyticExtractedReport(_0x40f1('0x17'));}var _0x252fd0=[];var _0x4cd9e0=0x0;if(_0x46b6b5[_0x40f1('0xe')]){if(_0x5e0fb6&&_0x5e0fb6['length']){var _0xcb23b4=_[_0x40f1('0x18')](_0x5e0fb6[0x0][_0x40f1('0x16')]/_0x46c6ba);var _0x130be4=Number[_0x40f1('0x19')](_0x5e0fb6[0x0][_0x40f1('0x16')]/_0x46c6ba)?_0x5e0fb6[0x0][_0x40f1('0x16')]%_0x46c6ba:0x0;_0xcb23b4[_0x40f1('0x1a')](function(_0xbc7d39){if(_0xbc7d39>0x0){_0x4cd9e0+=_0x46c6ba;}_0x252fd0['push'](dbH[_0x40f1('0x11')][_0x40f1('0x1b')](util[_0x40f1('0x12')](_0x40f1('0x1c'),QUERY,_0x46c6ba,_0x4cd9e0),{'type':dbH[_0x40f1('0x11')][_0x40f1('0x14')][_0x40f1('0x15')]}));});if(_0x130be4>0x0){_0x4cd9e0+=_0x46c6ba;_0x252fd0[_0x40f1('0x1d')](dbH[_0x40f1('0x11')][_0x40f1('0x1b')](util[_0x40f1('0x12')](_0x40f1('0x1c'),QUERY,_0x130be4,_0x4cd9e0),{'type':dbH[_0x40f1('0x11')][_0x40f1('0x14')][_0x40f1('0x15')]}));}}}else{_0x252fd0['push'](dbH[_0x40f1('0x11')]['query'](QUERY,{'type':dbH[_0x40f1('0x11')][_0x40f1('0x14')][_0x40f1('0x15')]}));}var _0x592484=path[_0x40f1('0x1e')](PATH);var _0x50b891=path[_0x40f1('0x1f')](PATH,_0x40f1('0x20'));var _0x50f281=_0x46b6b5[_0x40f1('0xe')]&&_0x252fd0['length']>0x1;var _0x1fa95e=[];if(!fs[_0x40f1('0x21')](path['join'](_0x592484,_0x50b891))&&_0x50f281){fs[_0x40f1('0x22')](path[_0x40f1('0x23')](_0x592484,_0x50b891));}return BPromise[_0x40f1('0x24')](_0x252fd0,function(_0x4627da){_0x1fa95e[_0x40f1('0x1d')](_0x4627da);})[_0x40f1('0xf')](function(){for(var _0x1629b6=0x0;_0x1629b6<_0x1fa95e[_0x40f1('0x25')];_0x1629b6+=0x1){var _0x2a8f08;var _0x58e400=_0x1fa95e[_0x1629b6];if(_0x50f281){_0x2a8f08=path[_0x40f1('0x23')](_0x592484,_0x50b891,util[_0x40f1('0x12')]('%s%d.%s',_0x50b891,_0x1629b6,_0x40f1('0x26')));}else{_0x2a8f08=path[_0x40f1('0x23')](_0x592484,util[_0x40f1('0x12')](_0x40f1('0x27'),_0x50b891,_0x40f1('0x26')));}fs['writeFileSync'](_0x2a8f08,csv(_0x58e400));}})[_0x40f1('0xf')](function(){if(_0x50f281){return new Promise(function(_0x41ecc1){zipdir(path[_0x40f1('0x23')](_0x592484,_0x50b891),{'saveTo':path['join'](_0x592484,util[_0x40f1('0x12')](_0x40f1('0x27'),_0x50b891,_0x40f1('0x28')))},function(_0x1288f6,_0x1e6281){rimraf(path[_0x40f1('0x23')](_0x592484,_0x50b891),function(){});_0x41ecc1(_0x40f1('0x29'));});});}})[_0x40f1('0xf')](function(){logger[_0x40f1('0x2a')](util[_0x40f1('0x12')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x40f1('0x2b')));return analyticExtractedReport(_0x40f1('0x2c'),_0x50f281?util['format'](_0x40f1('0x27'),_0x50b891,_0x50f281?_0x40f1('0x28'):_0x40f1('0x26')):null);});})['catch'](function(_0x5518f3){logger[_0x40f1('0x2a')](util['format'](_0x40f1('0x2d'),EXTRACTED_REPORT_ID,_0x40f1('0x2b')),util['inspect'](_0x5518f3,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x40f1('0x2e')](function(){process[_0x40f1('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 8da3445..0b5ac4f 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 _0x7772=['../../mysqldb','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','toString','fill','length','auto','body','push','concat','forEach','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','format','endDate','header','margin','landscape','\x20/\x20','footer','Arial','black','Empty','Setting','split','splitSizePdf','then','range','num','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','join','mkdirSync','flatten','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','info','PDF','Completed','findOne','catch','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','finish','end','createPdfFromHTML','createPdfKitDocument','lodash','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','bluebird'];(function(_0x1e05c1,_0x3cffa3){var _0x15f1ca=function(_0x3a9594){while(--_0x3a9594){_0x1e05c1['push'](_0x1e05c1['shift']());}};_0x15f1ca(++_0x3cffa3);}(_0x7772,0xa2));var _0x2777=function(_0x2356b0,_0x6b40ec){_0x2356b0=_0x2356b0-0x0;var _0x30ce1c=_0x7772[_0x2356b0];return _0x30ce1c;};'use strict';var _=require(_0x2777('0x0'));var fs=require('fs');var util=require('util');var path=require(_0x2777('0x1'));var moment=require(_0x2777('0x2'));var htmlToPdfmake=require(_0x2777('0x3'));var PdfPrinter=require(_0x2777('0x4'));var zipdir=require(_0x2777('0x5'));var rimraf=require(_0x2777('0x6'));var JSDOM=require(_0x2777('0x7'))[_0x2777('0x8')];var window=new JSDOM('')['window'];var BPromise=require(_0x2777('0x9'));var db=require('../../mysqldb')['db'];var dbH=require(_0x2777('0xa'))['dbH'];var logger=require(_0x2777('0xb'))(_0x2777('0xc'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x2777('0xd')][0x3];var PATH=process[_0x2777('0xd')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x2777('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x55d6f8,_0x3f5abc){var _0x3326db={'status':_0x55d6f8};var _0x3a1c57={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3f5abc){_0x3326db[_0x2777('0xf')]=_0x3f5abc;}return db[_0x2777('0x10')]['update'](_0x3326db,_0x3a1c57);}function getHeaders(_0x5c9fb0){return _[_0x2777('0x11')](_0x5c9fb0,function(_0xe0725d){return{'text':_0xe0725d,'style':_0x2777('0x12')};});}function getRows(_0x5802cc,_0x1150ad){return _[_0x2777('0x11')](_0x1150ad,function(_0x2130ac){return _(_0x2130ac)['pick'](_0x5802cc)[_0x2777('0x11')](function(_0x56f149){return _0x56f149?_[_0x2777('0x13')](_0x56f149):'';})['value']();});}function createTable(_0x1aa89d,_0x47d709){var _0x14dac2={'widths':_[_0x2777('0x14')](Array(_0x1aa89d[_0x2777('0x15')]),0x91),'heights':function(_0x5af9ae){return _0x5af9ae===0x0?_0x2777('0x16'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x17342c=getHeaders(_0x1aa89d);_0x14dac2[_0x2777('0x17')][_0x2777('0x18')](_0x17342c);var _0x1cb0ad=getRows(_0x1aa89d,_0x47d709);_0x14dac2[_0x2777('0x17')]=_0x14dac2[_0x2777('0x17')][_0x2777('0x19')](_0x1cb0ad);return _0x14dac2;}function createTables(_0x46db28){var _0x2e6670=[];var _0x398f1a=_['chunk'](Object['keys'](_0x46db28[0x0]),0x5);_0x398f1a[_0x2777('0x1a')](function(_0x20a71b){_0x2e6670[_0x2777('0x18')](createTable(_0x20a71b,_0x46db28));});return _0x2e6670;}function getPDFDocDefinition(_0x2d5846){var _0x504481=util['format'](_0x2777('0x1b'),NAME,EXTRACTED_REPORT[_0x2777('0x1c')],moment(EXTRACTED_REPORT[_0x2777('0x1d')])[_0x2777('0x1e')](FORMAT),moment(EXTRACTED_REPORT[_0x2777('0x1f')])[_0x2777('0x1e')](FORMAT));var _0x3a9dd5=[];for(var _0xaf0e7e=0x0;_0xaf0e7e<_0x2d5846[_0x2777('0x15')];_0xaf0e7e++){var _0x115270=[];if(_0xaf0e7e===0x0){_0x115270[_0x2777('0x18')]({'text':_0x504481,'style':_0x2777('0x20')});}var _0x570800={'table':_0x2d5846[_0xaf0e7e]};if(_0xaf0e7e>0x0){_0x570800['pageBreak']='before';_0x570800[_0x2777('0x21')]=[0x0,0x46,0x0,0x0];}_0x115270['push'](_0x570800);_0x3a9dd5['push'](_0x115270);}return{'pageSize':'A4','pageOrientation':_0x2777('0x22'),'content':_0x3a9dd5,'footer':function(_0x337a23,_0x5998bf){return{'text':_0x337a23['toString']()+_0x2777('0x23')+_0x5998bf,'style':_0x2777('0x24')};},'defaultStyle':{'font':_0x2777('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x2777('0x26')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2ccb28){var _0x5e2c94=0x1388;var _0x3a63b2;if(!_0x2ccb28[0x0]['num']){return analyticExtractedReport(_0x2777('0x27'));}return db[_0x2777('0x28')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2777('0x29'),_0x2777('0x2a')]})[_0x2777('0x2b')](function(_0x10fe3f){if(_0x10fe3f){_0x3a63b2=_0x10fe3f;_0x5e2c94=_0x3a63b2[_0x2777('0x2a')]||0x3e8;}})[_0x2777('0x2b')](function(){var _0x4a3bcd=[];var _0x179ae3=0x0;if(_0x3a63b2[_0x2777('0x29')]){if(_0x2ccb28&&_0x2ccb28[_0x2777('0x15')]){var _0x12f8cc=_[_0x2777('0x2c')](_0x2ccb28[0x0][_0x2777('0x2d')]/_0x5e2c94);var _0x592544=Number[_0x2777('0x2e')](_0x2ccb28[0x0][_0x2777('0x2d')]/_0x5e2c94)?_0x2ccb28[0x0][_0x2777('0x2d')]%_0x5e2c94:0x0;_0x12f8cc['forEach'](function(_0x30216a){if(_0x30216a>0x0){_0x179ae3+=_0x5e2c94;}_0x4a3bcd[_0x2777('0x18')](dbH[_0x2777('0x2f')][_0x2777('0x30')](util[_0x2777('0x1e')](_0x2777('0x31'),QUERY,_0x5e2c94,_0x179ae3),{'type':dbH[_0x2777('0x2f')][_0x2777('0x32')][_0x2777('0x33')]}));});if(_0x592544>0x0){_0x179ae3+=_0x5e2c94;_0x4a3bcd[_0x2777('0x18')](dbH[_0x2777('0x2f')][_0x2777('0x30')](util[_0x2777('0x1e')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x592544,_0x179ae3),{'type':dbH['sequelize'][_0x2777('0x32')][_0x2777('0x33')]}));}}}else{_0x4a3bcd['push'](dbH['sequelize'][_0x2777('0x30')](QUERY,{'type':dbH[_0x2777('0x2f')]['QueryTypes']['SELECT']}));}var _0x366dfd=path[_0x2777('0x34')](PATH);var _0x3fe491=path[_0x2777('0x35')](PATH,_0x2777('0x36'));var _0x52a956=_0x3a63b2['split']&&_0x4a3bcd[_0x2777('0x15')]>0x1;var _0x451baf=[];if(!fs[_0x2777('0x37')](path[_0x2777('0x38')](_0x366dfd,_0x3fe491))&&_0x52a956){fs[_0x2777('0x39')](path['join'](_0x366dfd,_0x3fe491));}return BPromise['each'](_0x4a3bcd,function(_0x471bcd){_0x451baf[_0x2777('0x18')](_0x471bcd);})[_0x2777('0x2b')](function(){var _0x203091=[];for(var _0x4174e2=0x0;_0x4174e2<_0x451baf['length'];_0x4174e2+=0x1){var _0x6dd5e7=_0x451baf[_0x4174e2];var _0x29c646=createTables(_[_0x2777('0x3a')](_0x6dd5e7));var _0x3bfa16;var _0x489e67=getPDFDocDefinition(_0x29c646);var _0x566a22=getPDFPrinter();var _0x47ec42=_0x566a22['createPdfKitDocument'](_0x489e67);if(_0x52a956){_0x3bfa16=path['join'](_0x366dfd,_0x3fe491,util[_0x2777('0x1e')](_0x2777('0x3b'),_0x3fe491,_0x4174e2,_0x2777('0x3c')));}else{_0x3bfa16=path[_0x2777('0x38')](_0x366dfd,util[_0x2777('0x1e')](_0x2777('0x3d'),_0x3fe491,_0x2777('0x3c')));}_0x203091[_0x2777('0x18')](writePDFDocument(_0x47ec42,_0x3bfa16));}return Promise[_0x2777('0x3e')](_0x203091);})[_0x2777('0x2b')](function(){if(_0x52a956){return new Promise(function(_0x116b5a){zipdir(path[_0x2777('0x38')](_0x366dfd,_0x3fe491),{'saveTo':path[_0x2777('0x38')](_0x366dfd,util[_0x2777('0x1e')]('%s.%s',_0x3fe491,_0x2777('0x3f')))},function(){rimraf(path['join'](_0x366dfd,_0x3fe491),function(){});_0x116b5a(_0x2777('0x40'));});});}})[_0x2777('0x2b')](function(){if(!_0x52a956)return;rimraf(path['join'](_0x366dfd,_0x3fe491),function(){});})[_0x2777('0x2b')](function(){logger[_0x2777('0x41')](util[_0x2777('0x1e')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x2777('0x42')));return analyticExtractedReport(_0x2777('0x43'),_0x52a956?util[_0x2777('0x1e')](_0x2777('0x3d'),_0x3fe491,_0x52a956?_0x2777('0x3f'):_0x2777('0x3c')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x2777('0x41')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x2777('0x42')));return db['AnalyticExtractedReport'][_0x2777('0x44')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x2777('0x2b')](function(_0x222e8d){EXTRACTED_REPORT=_0x222e8d;return dbH[_0x2777('0x2f')][_0x2777('0x30')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x2777('0x2f')][_0x2777('0x32')][_0x2777('0x33')]});})[_0x2777('0x2b')](extractReport)[_0x2777('0x45')](function(_0x59e64d){logger[_0x2777('0x41')](util[_0x2777('0x1e')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x2777('0x42')),util[_0x2777('0x46')](_0x59e64d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x2777('0x47'));})[_0x2777('0x48')](function(){process[_0x2777('0x49')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x29887f=new PdfPrinter({'Arial':{'normal':__dirname+_0x2777('0x4a'),'bold':__dirname+_0x2777('0x4b'),'italics':__dirname+_0x2777('0x4c'),'bolditalics':__dirname+_0x2777('0x4d')}});return _0x29887f;}function getPDFDocDefinitionFromHTML(_0x1844e9,_0x18d152){var _0x212473=util['format'](_0x2777('0x4e'),_0x18d152['channel'],_0x18d152['interactionId']);var _0x2ec99d=moment()['format']('YYYY-MM-DD')[_0x2777('0x13')]();var _0x1e4b7c=htmlToPdfmake(_0x1844e9,{'window':window,'tableAutoSize':!![]});return{'content':[_0x1e4b7c],'defaultStyle':{'font':_0x2777('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x2777('0x4f'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x2777('0x50'),'style':_0x2777('0x20')}];},'footer':function(_0x1b0e20,_0xdf7eb8){return[{'text':util[_0x2777('0x1e')](_0x2777('0x51'),_0x212473,_0x1b0e20,_0xdf7eb8,_0x2ec99d),'style':_0x2777('0x24')}];}};}function writePDFDocument(_0x436ec4,_0x397b48){return new Promise(function(_0x5998e4,_0x2e7e62){var _0x386664=_0x436ec4['pipe'](fs['createWriteStream'](_0x397b48));_0x386664['on'](_0x2777('0x52'),function(){_0x5998e4(_0x2777('0x52'));});_0x386664['on']('error',function(_0x53055c){_0x2e7e62(_0x53055c);});_0x436ec4[_0x2777('0x53')]();});}exports[_0x2777('0x54')]=function(_0x344fa8,_0x15d473){var _0x36675e=getPDFPrinter();var _0x5ef26d=getPDFDocDefinitionFromHTML(_0x344fa8,_0x15d473);var _0x1fc976=_0x36675e[_0x2777('0x55')](_0x5ef26d);return writePDFDocument(_0x1fc976,_0x15d473[_0x2777('0x1')])[_0x2777('0x45')](function(_0x442d9f){throw _0x442d9f;});}; \ No newline at end of file +var _0x9a24=['push','body','concat','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','margin','landscape','\x20/\x20','footer','Arial','num','Empty','Setting','splitSizePdf','then','length','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','dirname','basename','.pdf','split','existsSync','join','mkdirSync','flatten','%s.%s','pdf','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','inspect','Failed','/fonts/arial-regular.ttf','/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','pipe','createWriteStream','finish','error','createPdfKitDocument','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','argv','savename','update','map','pick','toString'];(function(_0x2beb61,_0x257372){var _0x21aadc=function(_0x3fc2cb){while(--_0x3fc2cb){_0x2beb61['push'](_0x2beb61['shift']());}};_0x21aadc(++_0x257372);}(_0x9a24,0xfa));var _0x49a2=function(_0x2bf10f,_0x345a64){_0x2bf10f=_0x2bf10f-0x0;var _0x34d53c=_0x9a24[_0x2bf10f];return _0x34d53c;};'use strict';var _=require(_0x49a2('0x0'));var fs=require('fs');var util=require(_0x49a2('0x1'));var path=require(_0x49a2('0x2'));var moment=require(_0x49a2('0x3'));var htmlToPdfmake=require(_0x49a2('0x4'));var PdfPrinter=require(_0x49a2('0x5'));var zipdir=require(_0x49a2('0x6'));var rimraf=require(_0x49a2('0x7'));var JSDOM=require(_0x49a2('0x8'))[_0x49a2('0x9')];var window=new JSDOM('')[_0x49a2('0xa')];var BPromise=require(_0x49a2('0xb'));var db=require(_0x49a2('0xc'))['db'];var dbH=require(_0x49a2('0xc'))[_0x49a2('0xd')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x49a2('0xe')][0x2]);var QUERY=process[_0x49a2('0xe')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x49a2('0xe')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x319aed,_0x17685a){var _0x16d76a={'status':_0x319aed};var _0x392026={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x17685a){_0x16d76a[_0x49a2('0xf')]=_0x17685a;}return db['AnalyticExtractedReport'][_0x49a2('0x10')](_0x16d76a,_0x392026);}function getHeaders(_0xe0d6af){return _[_0x49a2('0x11')](_0xe0d6af,function(_0xaa2bba){return{'text':_0xaa2bba,'style':'tableHeader'};});}function getRows(_0x49f37d,_0x1822e7){return _[_0x49a2('0x11')](_0x1822e7,function(_0x58080b){return _(_0x58080b)[_0x49a2('0x12')](_0x49f37d)[_0x49a2('0x11')](function(_0x2d609b){return _0x2d609b?_[_0x49a2('0x13')](_0x2d609b):'';})['value']();});}function createTable(_0x483d80,_0x8991e6){var _0x257557={'widths':_['fill'](Array(_0x483d80['length']),0x91),'heights':function(_0xa6f34){return _0xa6f34===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x4bbd3c=getHeaders(_0x483d80);_0x257557['body'][_0x49a2('0x14')](_0x4bbd3c);var _0x126341=getRows(_0x483d80,_0x8991e6);_0x257557[_0x49a2('0x15')]=_0x257557[_0x49a2('0x15')][_0x49a2('0x16')](_0x126341);return _0x257557;}function createTables(_0x43c6b3){var _0x480227=[];var _0x106f09=_['chunk'](Object['keys'](_0x43c6b3[0x0]),0x5);_0x106f09[_0x49a2('0x17')](function(_0x2579d8){_0x480227[_0x49a2('0x14')](createTable(_0x2579d8,_0x43c6b3));});return _0x480227;}function getPDFDocDefinition(_0x14a950){var _0x190213=util[_0x49a2('0x18')](_0x49a2('0x19'),NAME,EXTRACTED_REPORT[_0x49a2('0x1a')],moment(EXTRACTED_REPORT[_0x49a2('0x1b')])[_0x49a2('0x18')](FORMAT),moment(EXTRACTED_REPORT[_0x49a2('0x1c')])[_0x49a2('0x18')](FORMAT));var _0xd1321c=[];for(var _0x41e5b1=0x0;_0x41e5b1<_0x14a950['length'];_0x41e5b1++){var _0x48d75e=[];if(_0x41e5b1===0x0){_0x48d75e[_0x49a2('0x14')]({'text':_0x190213,'style':_0x49a2('0x1d')});}var _0x5ef6fe={'table':_0x14a950[_0x41e5b1]};if(_0x41e5b1>0x0){_0x5ef6fe[_0x49a2('0x1e')]='before';_0x5ef6fe[_0x49a2('0x1f')]=[0x0,0x46,0x0,0x0];}_0x48d75e[_0x49a2('0x14')](_0x5ef6fe);_0xd1321c[_0x49a2('0x14')](_0x48d75e);}return{'pageSize':'A4','pageOrientation':_0x49a2('0x20'),'content':_0xd1321c,'footer':function(_0x1a8576,_0x59ce3c){return{'text':_0x1a8576['toString']()+_0x49a2('0x21')+_0x59ce3c,'style':_0x49a2('0x22')};},'defaultStyle':{'font':_0x49a2('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x52c819){var _0x3526b0=0x1388;var _0x3b1bf3;if(!_0x52c819[0x0][_0x49a2('0x24')]){return analyticExtractedReport(_0x49a2('0x25'));}return db[_0x49a2('0x26')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x49a2('0x27')]})['then'](function(_0x37cb32){if(_0x37cb32){_0x3b1bf3=_0x37cb32;_0x3526b0=_0x3b1bf3['splitSizePdf']||0x3e8;}})[_0x49a2('0x28')](function(){var _0x3a03f1=[];var _0x1093a3=0x0;if(_0x3b1bf3['split']){if(_0x52c819&&_0x52c819[_0x49a2('0x29')]){var _0x10cff5=_[_0x49a2('0x2a')](_0x52c819[0x0][_0x49a2('0x24')]/_0x3526b0);var _0x1cadde=Number[_0x49a2('0x2b')](_0x52c819[0x0][_0x49a2('0x24')]/_0x3526b0)?_0x52c819[0x0]['num']%_0x3526b0:0x0;_0x10cff5['forEach'](function(_0xeacbc3){if(_0xeacbc3>0x0){_0x1093a3+=_0x3526b0;}_0x3a03f1[_0x49a2('0x14')](dbH[_0x49a2('0x2c')][_0x49a2('0x2d')](util[_0x49a2('0x18')](_0x49a2('0x2e'),QUERY,_0x3526b0,_0x1093a3),{'type':dbH[_0x49a2('0x2c')]['QueryTypes'][_0x49a2('0x2f')]}));});if(_0x1cadde>0x0){_0x1093a3+=_0x3526b0;_0x3a03f1[_0x49a2('0x14')](dbH[_0x49a2('0x2c')][_0x49a2('0x2d')](util[_0x49a2('0x18')](_0x49a2('0x2e'),QUERY,_0x1cadde,_0x1093a3),{'type':dbH[_0x49a2('0x2c')][_0x49a2('0x30')][_0x49a2('0x2f')]}));}}}else{_0x3a03f1['push'](dbH[_0x49a2('0x2c')]['query'](QUERY,{'type':dbH['sequelize'][_0x49a2('0x30')][_0x49a2('0x2f')]}));}var _0x3a4084=path[_0x49a2('0x31')](PATH);var _0x3a1652=path[_0x49a2('0x32')](PATH,_0x49a2('0x33'));var _0x25b378=_0x3b1bf3[_0x49a2('0x34')]&&_0x3a03f1['length']>0x1;var _0x48a211=[];if(!fs[_0x49a2('0x35')](path[_0x49a2('0x36')](_0x3a4084,_0x3a1652))&&_0x25b378){fs[_0x49a2('0x37')](path[_0x49a2('0x36')](_0x3a4084,_0x3a1652));}return BPromise['each'](_0x3a03f1,function(_0x449742){_0x48a211[_0x49a2('0x14')](_0x449742);})[_0x49a2('0x28')](function(){var _0x47095e=[];for(var _0xf9d985=0x0;_0xf9d985<_0x48a211[_0x49a2('0x29')];_0xf9d985+=0x1){var _0xda7818=_0x48a211[_0xf9d985];var _0x12a97a=createTables(_[_0x49a2('0x38')](_0xda7818));var _0x347394;var _0x25ee3b=getPDFDocDefinition(_0x12a97a);var _0x4a018e=getPDFPrinter();var _0x2de9b5=_0x4a018e['createPdfKitDocument'](_0x25ee3b);if(_0x25b378){_0x347394=path[_0x49a2('0x36')](_0x3a4084,_0x3a1652,util[_0x49a2('0x18')]('%s%d.%s',_0x3a1652,_0xf9d985,'pdf'));}else{_0x347394=path[_0x49a2('0x36')](_0x3a4084,util[_0x49a2('0x18')](_0x49a2('0x39'),_0x3a1652,_0x49a2('0x3a')));}_0x47095e[_0x49a2('0x14')](writePDFDocument(_0x2de9b5,_0x347394));}return Promise[_0x49a2('0x3b')](_0x47095e);})['then'](function(){if(_0x25b378){return new Promise(function(_0x577b8e){zipdir(path[_0x49a2('0x36')](_0x3a4084,_0x3a1652),{'saveTo':path[_0x49a2('0x36')](_0x3a4084,util[_0x49a2('0x18')](_0x49a2('0x39'),_0x3a1652,_0x49a2('0x3c')))},function(){rimraf(path[_0x49a2('0x36')](_0x3a4084,_0x3a1652),function(){});_0x577b8e(_0x49a2('0x3d'));});});}})[_0x49a2('0x28')](function(){if(!_0x25b378)return;rimraf(path[_0x49a2('0x36')](_0x3a4084,_0x3a1652),function(){});})['then'](function(){logger[_0x49a2('0x3e')](util['format'](_0x49a2('0x3f'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0x49a2('0x40'),_0x25b378?util[_0x49a2('0x18')]('%s.%s',_0x3a1652,_0x25b378?_0x49a2('0x3c'):_0x49a2('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x49a2('0x3e')](util[_0x49a2('0x18')](_0x49a2('0x41'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x49a2('0x42')][_0x49a2('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x49a2('0x28')](function(_0x10cba0){EXTRACTED_REPORT=_0x10cba0;return dbH[_0x49a2('0x2c')][_0x49a2('0x2d')](util['format'](_0x49a2('0x44'),QUERY),{'type':dbH[_0x49a2('0x2c')][_0x49a2('0x30')][_0x49a2('0x2f')]});})[_0x49a2('0x28')](extractReport)[_0x49a2('0x45')](function(_0x2b2222){logger[_0x49a2('0x3e')](util[_0x49a2('0x18')](_0x49a2('0x46'),EXTRACTED_REPORT_ID,_0x49a2('0x47')),util[_0x49a2('0x48')](_0x2b2222,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x49a2('0x49'));})['finally'](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x4aa1f8=new PdfPrinter({'Arial':{'normal':__dirname+_0x49a2('0x4a'),'bold':__dirname+_0x49a2('0x4b'),'italics':__dirname+_0x49a2('0x4c'),'bolditalics':__dirname+_0x49a2('0x4d')}});return _0x4aa1f8;}function getPDFDocDefinitionFromHTML(_0x433ca0,_0x2eedae){var _0x2b3ca3=util[_0x49a2('0x18')](_0x49a2('0x4e'),_0x2eedae[_0x49a2('0x4f')],_0x2eedae[_0x49a2('0x50')]);var _0x300201=moment()[_0x49a2('0x18')](_0x49a2('0x51'))[_0x49a2('0x13')]();var _0x551f47=htmlToPdfmake(_0x433ca0,{'window':window,'tableAutoSize':!![]});return{'content':[_0x551f47],'defaultStyle':{'font':_0x49a2('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x49a2('0x52'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x49a2('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x49a2('0x53'),'style':'header'}];},'footer':function(_0x23f5e7,_0x46d263){return[{'text':util[_0x49a2('0x18')](_0x49a2('0x54'),_0x2b3ca3,_0x23f5e7,_0x46d263,_0x300201),'style':_0x49a2('0x22')}];}};}function writePDFDocument(_0x1eaba9,_0xab28f8){return new Promise(function(_0x5adda0,_0x18a2b4){var _0x3802ac=_0x1eaba9[_0x49a2('0x55')](fs[_0x49a2('0x56')](_0xab28f8));_0x3802ac['on'](_0x49a2('0x57'),function(){_0x5adda0(_0x49a2('0x57'));});_0x3802ac['on'](_0x49a2('0x58'),function(_0x323b3f){_0x18a2b4(_0x323b3f);});_0x1eaba9['end']();});}exports['createPdfFromHTML']=function(_0x2b157e,_0x5d004d){var _0x36e5f4=getPDFPrinter();var _0x57a035=getPDFDocDefinitionFromHTML(_0x2b157e,_0x5d004d);var _0x56b091=_0x36e5f4[_0x49a2('0x59')](_0x57a035);return writePDFDocument(_0x56b091,_0x5d004d[_0x49a2('0x2')])[_0x49a2('0x45')](function(_0x3af4a5){throw _0x3af4a5;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index fd3fd82..0367e15 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 _0xf255=['dirname','basename','.xlsx','mkdirSync','join','each','%s%d.%s','%s.%s','xlsx','binary','zip\x20finished','XLSX','zip','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','lodash','json2xls','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','split','splitSizeXlsx','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d'];(function(_0x246cfb,_0x676933){var _0x11e5ec=function(_0x5437f5){while(--_0x5437f5){_0x246cfb['push'](_0x246cfb['shift']());}};_0x11e5ec(++_0x676933);}(_0xf255,0xce));var _0x5f25=function(_0x13899b,_0x4c90fa){_0x13899b=_0x13899b-0x0;var _0x478a0d=_0xf255[_0x13899b];return _0x478a0d;};'use strict';var util=require(_0x5f25('0x0'));var path=require('path');var _=require(_0x5f25('0x1'));var fs=require('fs');var json2xls=require(_0x5f25('0x2'));var BPromise=require(_0x5f25('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x5f25('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0x5f25('0x5'))[_0x5f25('0x6')];var logger=require(_0x5f25('0x7'))(_0x5f25('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x5f25('0x9')][0x2]);var QUERY=process[_0x5f25('0x9')][0x3];var PATH=process[_0x5f25('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x35e1a2,_0x2114d3){var _0x52ed21={'status':_0x35e1a2};var _0x286a86={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2114d3){_0x52ed21[_0x5f25('0xa')]=_0x2114d3;}return db['AnalyticExtractedReport']['update'](_0x52ed21,_0x286a86);}function main(){var _0x5ad135=0x1388;var _0x357ada;logger[_0x5f25('0xb')](util['format'](_0x5f25('0xc'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x5f25('0xd')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5f25('0xe'),_0x5f25('0xf')]})[_0x5f25('0x10')](function(_0x1c8246){if(_0x1c8246){_0x357ada=_0x1c8246;_0x5ad135=_0x357ada['splitSizeXlsx']||0x1388;}})[_0x5f25('0x10')](function(){return dbH[_0x5f25('0x11')][_0x5f25('0x12')](util[_0x5f25('0x13')](_0x5f25('0x14'),QUERY),{'type':dbH[_0x5f25('0x11')][_0x5f25('0x15')][_0x5f25('0x16')]});})[_0x5f25('0x10')](function(_0xf352a2){if(!_0xf352a2[0x0][_0x5f25('0x17')]){return analyticExtractedReport(_0x5f25('0x18'));}var _0xf4d685=[];var _0x2e8313=0x0;if(_0x357ada[_0x5f25('0xe')]){if(_0xf352a2&&_0xf352a2[_0x5f25('0x19')]){var _0x570cb6=_['range'](_0xf352a2[0x0][_0x5f25('0x17')]/_0x5ad135);var _0x2d4e85=Number[_0x5f25('0x1a')](_0xf352a2[0x0][_0x5f25('0x17')]/_0x5ad135)?_0xf352a2[0x0][_0x5f25('0x17')]%_0x5ad135:0x0;_0x570cb6['forEach'](function(_0x14171d){if(_0x14171d>0x0){_0x2e8313+=_0x5ad135;}_0xf4d685['push'](dbH[_0x5f25('0x11')][_0x5f25('0x12')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5ad135,_0x2e8313),{'type':dbH[_0x5f25('0x11')][_0x5f25('0x15')][_0x5f25('0x16')]}));});if(_0x2d4e85>0x0){_0x2e8313+=_0x5ad135;_0xf4d685[_0x5f25('0x1b')](dbH['sequelize'][_0x5f25('0x12')](util[_0x5f25('0x13')](_0x5f25('0x1c'),QUERY,_0x2d4e85,_0x2e8313),{'type':dbH[_0x5f25('0x11')][_0x5f25('0x15')]['SELECT']}));}}}else{_0xf4d685[_0x5f25('0x1b')](dbH[_0x5f25('0x11')][_0x5f25('0x12')](QUERY,{'type':dbH[_0x5f25('0x11')][_0x5f25('0x15')][_0x5f25('0x16')]}));}var _0x22bd4e=path[_0x5f25('0x1d')](PATH);var _0x4359a0=path[_0x5f25('0x1e')](PATH,_0x5f25('0x1f'));var _0x5b7f2c=_0x357ada[_0x5f25('0xe')]&&_0xf4d685['length']>0x1;var _0x5a1f1b=[];if(!fs['existsSync'](path['join'](_0x22bd4e,_0x4359a0))&&_0x5b7f2c){fs[_0x5f25('0x20')](path[_0x5f25('0x21')](_0x22bd4e,_0x4359a0));}return BPromise[_0x5f25('0x22')](_0xf4d685,function(_0x3d71bc){_0x5a1f1b['push'](_0x3d71bc);})[_0x5f25('0x10')](function(){for(var _0x376aa2=0x0;_0x376aa2<_0x5a1f1b[_0x5f25('0x19')];_0x376aa2+=0x1){var _0x3a5c7b;var _0x395a19=_0x5a1f1b[_0x376aa2];if(_0x5b7f2c){_0x3a5c7b=path[_0x5f25('0x21')](_0x22bd4e,_0x4359a0,util[_0x5f25('0x13')](_0x5f25('0x23'),_0x4359a0,_0x376aa2,'xlsx'));}else{_0x3a5c7b=path[_0x5f25('0x21')](_0x22bd4e,util[_0x5f25('0x13')](_0x5f25('0x24'),_0x4359a0,_0x5f25('0x25')));}fs['writeFileSync'](_0x3a5c7b,json2xls(_0x395a19),_0x5f25('0x26'));}})[_0x5f25('0x10')](function(){if(_0x5b7f2c){return new Promise(function(_0x5ebe7c){zipdir(path[_0x5f25('0x21')](_0x22bd4e,_0x4359a0),{'saveTo':path[_0x5f25('0x21')](_0x22bd4e,util[_0x5f25('0x13')]('%s.%s',_0x4359a0,'zip'))},function(_0x24a522,_0x4b5c52){rimraf(path[_0x5f25('0x21')](_0x22bd4e,_0x4359a0),function(){});_0x5ebe7c(_0x5f25('0x27'));});});}})[_0x5f25('0x10')](function(){logger[_0x5f25('0xb')](util[_0x5f25('0x13')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x5f25('0x28')));return analyticExtractedReport('Completed',_0x5b7f2c?util[_0x5f25('0x13')]('%s.%s',_0x4359a0,_0x5b7f2c?_0x5f25('0x29'):_0x5f25('0x25')):null);});})['catch'](function(_0x1e7b77){logger[_0x5f25('0xb')](util[_0x5f25('0x13')](_0x5f25('0x2a'),EXTRACTED_REPORT_ID,_0x5f25('0x28')),util[_0x5f25('0x2b')](_0x1e7b77,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5f25('0x2c'));})[_0x5f25('0x2d')](function(){process[_0x5f25('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x3bd1=['bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','argv','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','length','range','isInteger','forEach','push','sequelize','QueryTypes','dirname','basename','.xlsx','existsSync','join','each','%s%d.%s','xlsx','%s.%s','writeFileSync','zip','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','lodash','json2xls'];(function(_0x1f1a97,_0xadfc15){var _0x29fc6a=function(_0x38c180){while(--_0x38c180){_0x1f1a97['push'](_0x1f1a97['shift']());}};_0x29fc6a(++_0xadfc15);}(_0x3bd1,0x111));var _0x13bd=function(_0x9a223a,_0x5b3a26){_0x9a223a=_0x9a223a-0x0;var _0x4bb4d9=_0x3bd1[_0x9a223a];return _0x4bb4d9;};'use strict';var util=require(_0x13bd('0x0'));var path=require('path');var _=require(_0x13bd('0x1'));var fs=require('fs');var json2xls=require(_0x13bd('0x2'));var BPromise=require(_0x13bd('0x3'));var zipdir=require(_0x13bd('0x4'));var rimraf=require('rimraf');var db=require(_0x13bd('0x5'))['db'];var dbH=require(_0x13bd('0x5'))[_0x13bd('0x6')];var logger=require(_0x13bd('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x13bd('0x8')][0x2]);var QUERY=process[_0x13bd('0x8')][0x3];var PATH=process[_0x13bd('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2aa817,_0x1024b5){var _0x19b63c={'status':_0x2aa817};var _0x183108={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1024b5){_0x19b63c['savename']=_0x1024b5;}return db[_0x13bd('0x9')]['update'](_0x19b63c,_0x183108);}function main(){var _0x1c9e50=0x1388;var _0x22187f;logger[_0x13bd('0xa')](util[_0x13bd('0xb')](_0x13bd('0xc'),EXTRACTED_REPORT_ID,'XLSX'));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x13bd('0xd'),_0x13bd('0xe')]})[_0x13bd('0xf')](function(_0x4f3800){if(_0x4f3800){_0x22187f=_0x4f3800;_0x1c9e50=_0x22187f[_0x13bd('0xe')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0x13bd('0x10')](util[_0x13bd('0xb')](_0x13bd('0x11'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x13bd('0x12')]});})[_0x13bd('0xf')](function(_0x56c3d3){if(!_0x56c3d3[0x0][_0x13bd('0x13')]){return analyticExtractedReport('Empty');}var _0x1bbf24=[];var _0x4a2e95=0x0;if(_0x22187f['split']){if(_0x56c3d3&&_0x56c3d3[_0x13bd('0x14')]){var _0x1917da=_[_0x13bd('0x15')](_0x56c3d3[0x0][_0x13bd('0x13')]/_0x1c9e50);var _0x32202a=Number[_0x13bd('0x16')](_0x56c3d3[0x0]['num']/_0x1c9e50)?_0x56c3d3[0x0]['num']%_0x1c9e50:0x0;_0x1917da[_0x13bd('0x17')](function(_0x3a3c79){if(_0x3a3c79>0x0){_0x4a2e95+=_0x1c9e50;}_0x1bbf24[_0x13bd('0x18')](dbH[_0x13bd('0x19')][_0x13bd('0x10')](util[_0x13bd('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1c9e50,_0x4a2e95),{'type':dbH[_0x13bd('0x19')][_0x13bd('0x1a')][_0x13bd('0x12')]}));});if(_0x32202a>0x0){_0x4a2e95+=_0x1c9e50;_0x1bbf24[_0x13bd('0x18')](dbH[_0x13bd('0x19')][_0x13bd('0x10')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x32202a,_0x4a2e95),{'type':dbH[_0x13bd('0x19')]['QueryTypes'][_0x13bd('0x12')]}));}}}else{_0x1bbf24[_0x13bd('0x18')](dbH[_0x13bd('0x19')][_0x13bd('0x10')](QUERY,{'type':dbH[_0x13bd('0x19')][_0x13bd('0x1a')][_0x13bd('0x12')]}));}var _0x235ed1=path[_0x13bd('0x1b')](PATH);var _0x870ff1=path[_0x13bd('0x1c')](PATH,_0x13bd('0x1d'));var _0x1795c4=_0x22187f[_0x13bd('0xd')]&&_0x1bbf24[_0x13bd('0x14')]>0x1;var _0x72457e=[];if(!fs[_0x13bd('0x1e')](path[_0x13bd('0x1f')](_0x235ed1,_0x870ff1))&&_0x1795c4){fs['mkdirSync'](path[_0x13bd('0x1f')](_0x235ed1,_0x870ff1));}return BPromise[_0x13bd('0x20')](_0x1bbf24,function(_0x4b7d7f){_0x72457e['push'](_0x4b7d7f);})[_0x13bd('0xf')](function(){for(var _0x25860a=0x0;_0x25860a<_0x72457e[_0x13bd('0x14')];_0x25860a+=0x1){var _0x2356bc;var _0x42da42=_0x72457e[_0x25860a];if(_0x1795c4){_0x2356bc=path[_0x13bd('0x1f')](_0x235ed1,_0x870ff1,util['format'](_0x13bd('0x21'),_0x870ff1,_0x25860a,_0x13bd('0x22')));}else{_0x2356bc=path['join'](_0x235ed1,util[_0x13bd('0xb')](_0x13bd('0x23'),_0x870ff1,'xlsx'));}fs[_0x13bd('0x24')](_0x2356bc,json2xls(_0x42da42),'binary');}})['then'](function(){if(_0x1795c4){return new Promise(function(_0x25c468){zipdir(path[_0x13bd('0x1f')](_0x235ed1,_0x870ff1),{'saveTo':path[_0x13bd('0x1f')](_0x235ed1,util[_0x13bd('0xb')](_0x13bd('0x23'),_0x870ff1,_0x13bd('0x25')))},function(_0x3c1850,_0x184ea7){rimraf(path[_0x13bd('0x1f')](_0x235ed1,_0x870ff1),function(){});_0x25c468('zip\x20finished');});});}})['then'](function(){logger['info'](util[_0x13bd('0xb')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x13bd('0x26')));return analyticExtractedReport(_0x13bd('0x27'),_0x1795c4?util[_0x13bd('0xb')]('%s.%s',_0x870ff1,_0x1795c4?_0x13bd('0x25'):'xlsx'):null);});})[_0x13bd('0x28')](function(_0x503fe){logger[_0x13bd('0xa')](util[_0x13bd('0xb')](_0x13bd('0x29'),EXTRACTED_REPORT_ID,_0x13bd('0x26')),util[_0x13bd('0x2a')](_0x503fe,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x13bd('0x2b'));})[_0x13bd('0x2c')](function(){process[_0x13bd('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 90c92d2..6a8e3ec 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 _0x1c21=['models','findAll','then','intervals','VoiceExtension','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','hasOwnProperty','priority','extensions','extension','find','push','type','Set','format','CDR(type)=%s','context','inbound','CDR(routeid)=','VoiceExtensionId','outbound','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','updatedAt','*,*,*,*','interval','IntervalId','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','length','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','app','appType','custom','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','concat','Hangup','transaction','destroy','bulkCreate','catch','error','rewrite','util'];(function(_0x137674,_0x1978b1){var _0x3fbbb7=function(_0x2eac59){while(--_0x2eac59){_0x137674['push'](_0x137674['shift']());}};_0x3fbbb7(++_0x1978b1);}(_0x1c21,0xd1));var _0x11c2=function(_0x34183e,_0x526c02){_0x34183e=_0x34183e-0x0;var _0x1eb061=_0x1c21[_0x34183e];return _0x1eb061;};'use strict';var _=require('lodash');var util=require(_0x11c2('0x0'));function rewrite(_0x175cbf,_0x4efef9){var _0x494a84=this;return _0x175cbf[_0x11c2('0x1')]['Interval'][_0x11c2('0x2')]({'raw':!![]})[_0x11c2('0x3')](function(_0x44c15d){_0x494a84[_0x11c2('0x4')]=_0x44c15d;return _0x175cbf[_0x11c2('0x1')]['VoiceExtension'][_0x11c2('0x2')]({'where':{'IntervalId':_0x4efef9['IntervalId']},'raw':!![]});})['then'](function(_0x43dc97){return _0x175cbf['models'][_0x11c2('0x5')]['findAll']({'where':{'exten':{'$in':_['uniq'](_[_0x11c2('0x6')](_0x43dc97,_0x11c2('0x7')))}},'order':[{'raw':_0x11c2('0x8')}],'raw':!![]});})[_0x11c2('0x3')](function(_0x2e1230){var _0x1db313=_[_0x11c2('0x9')](_0x2e1230,{'priority':'1'});var _0x2852a2=_[_0x11c2('0x9')](_0x2e1230,{'isApp':0x1});var _0x198c86=_[_0x11c2('0xa')](_0x2852a2,_0x11c2('0x7'));var _0x519ab5=['queue','playback'];var _0x53d03f=[];var _0x12926c=[];for(var _0x3fb36c in _0x198c86){if(_0x198c86[_0x11c2('0xb')](_0x3fb36c)){_0x494a84[_0x11c2('0xc')]=0x2;_0x494a84[_0x11c2('0xd')]=[];_0x494a84[_0x11c2('0xe')]=_[_0x11c2('0xf')](_0x1db313,{'exten':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x7')]});_0x494a84[_0x11c2('0xd')][_0x11c2('0x10')]({'type':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x11')],'app':_0x11c2('0x12'),'appdata':util[_0x11c2('0x13')](_0x11c2('0x14'),_0x198c86[_0x3fb36c][0x0][_0x11c2('0x11')]),'context':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x15')],'exten':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x7')],'priority':_0x494a84[_0x11c2('0xc')]++,'VoiceExtensionId':_0x198c86[_0x3fb36c][0x0]['VoiceExtensionId']});if(_0x198c86[_0x3fb36c][0x0][_0x11c2('0x11')]===_0x11c2('0x16')){_0x494a84['extensions'][_0x11c2('0x10')]({'type':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x11')],'app':'Set','appdata':_0x11c2('0x17')+_0x198c86[_0x3fb36c][0x0]['VoiceExtensionId'],'context':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x15')],'exten':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x7')],'priority':_0x494a84[_0x11c2('0xc')]++,'VoiceExtensionId':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x18')]});}else if(_0x198c86[_0x3fb36c][0x0][_0x11c2('0x11')]===_0x11c2('0x19')){if(_0x494a84['extension']){_0x494a84[_0x11c2('0xd')][_0x11c2('0x10')]({'type':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x11')],'app':_0x11c2('0x12'),'appdata':_0x11c2('0x1a')+(_0x494a84[_0x11c2('0xe')]['cutdigits']?_0x11c2('0x1b')+_0x494a84[_0x11c2('0xe')][_0x11c2('0x1c')]+'}':_0x11c2('0x1d')),'context':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x15')],'exten':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x7')],'priority':_0x494a84[_0x11c2('0xc')]++,'VoiceExtensionId':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x18')]});}_0x494a84[_0x11c2('0xd')][_0x11c2('0x10')]({'type':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x11')],'app':_0x11c2('0x12'),'appdata':_0x11c2('0x17')+_0x198c86[_0x3fb36c][0x0][_0x11c2('0x18')],'context':_0x198c86[_0x3fb36c][0x0]['context'],'exten':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x7')],'priority':_0x494a84[_0x11c2('0xc')]++,'VoiceExtensionId':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x18')]});var _0xc75344=_0x494a84['priority']++;_0x494a84[_0x11c2('0xd')][_0x11c2('0x10')]({'type':_0x198c86[_0x3fb36c][0x0]['type'],'app':_0x11c2('0x1e'),'appdata':_0x11c2('0x1f')+(_0xc75344+0x2)+_0x11c2('0x20')+(_0xc75344+0x1)+')','context':_0x198c86[_0x3fb36c][0x0]['context'],'exten':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x7')],'priority':_0xc75344,'VoiceExtensionId':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x18')]});if(_0x494a84[_0x11c2('0xe')]){_0x494a84['extensions']['push']({'type':_0x198c86[_0x3fb36c][0x0]['type'],'app':'Set','appdata':_0x494a84[_0x11c2('0xe')]['cutdigits']?_0x11c2('0x21')+_0x494a84['extension']['cutdigits']+'}':_0x11c2('0x22'),'context':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x15')],'exten':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x7')],'priority':_0x494a84[_0x11c2('0xc')]++,'VoiceExtensionId':_0x198c86[_0x3fb36c][0x0]['VoiceExtensionId']});}_0x494a84[_0x11c2('0xd')][_0x11c2('0x10')]({'type':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x11')],'app':_0x11c2('0x12'),'appdata':_0x11c2('0x23')+_0x198c86[_0x3fb36c][0x0][_0x11c2('0x18')],'context':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x15')],'exten':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x7')],'priority':_0x494a84[_0x11c2('0xc')]++,'VoiceExtensionId':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x18')]});if(_0x494a84['extension']&&_0x494a84[_0x11c2('0xe')]['hasOwnProperty'](_0x11c2('0x24'))&&_0x494a84[_0x11c2('0xe')]['recordingFormat']!=='none'){_0x494a84[_0x11c2('0xd')][_0x11c2('0x10')]({'type':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x11')],'app':_0x11c2('0x12'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x15')],'exten':_0x198c86[_0x3fb36c][0x0]['exten'],'priority':_0x494a84[_0x11c2('0xc')]++,'VoiceExtensionId':_0x198c86[_0x3fb36c][0x0]['VoiceExtensionId']});_0x494a84[_0x11c2('0xd')][_0x11c2('0x10')]({'type':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x11')],'app':_0x11c2('0x12'),'appdata':_0x11c2('0x25')+_0x494a84[_0x11c2('0xe')]['recordingFormat']||_0x11c2('0x26'),'context':_0x198c86[_0x3fb36c][0x0]['context'],'exten':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x7')],'priority':_0x494a84[_0x11c2('0xc')]++,'VoiceExtensionId':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x18')]});}}_0x494a84[_0x11c2('0xd')]['push']({'type':_0x198c86[_0x3fb36c][0x0]['type'],'app':_0x11c2('0x12'),'appdata':_0x11c2('0x27'),'context':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x15')],'exten':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x7')],'priority':_0x494a84[_0x11c2('0xc')]++,'VoiceExtensionId':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x18')]});_0x494a84[_0x11c2('0xd')]['push']({'type':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x11')],'app':'Set','appdata':_0x11c2('0x28'),'context':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x15')],'exten':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x7')],'priority':_0x494a84[_0x11c2('0xc')]++,'VoiceExtensionId':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x18')]});_0x494a84['extensions'][_0x11c2('0x10')]({'type':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x11')],'app':'Set','appdata':_0x11c2('0x29'),'context':_0x198c86[_0x3fb36c][0x0]['context'],'exten':_0x198c86[_0x3fb36c][0x0]['exten'],'priority':_0x494a84['priority']++,'VoiceExtensionId':_0x198c86[_0x3fb36c][0x0]['VoiceExtensionId']});for(var _0x28a1e4=0x0,_0x1523e6=0x0;_0x28a1e4<_0x198c86[_0x3fb36c]['length'];_0x28a1e4+=0x1,_0x1523e6=0x0){var _0x42d8a0=_0x198c86[_0x3fb36c][_0x28a1e4];if(_0x42d8a0['type']){_0x42d8a0[_0x11c2('0x11')]=_0x42d8a0[_0x11c2('0x11')][_0x11c2('0x2a')]();}var _0x29490e=[];var _0x30ec92=[];delete _0x42d8a0['id'];delete _0x42d8a0['createdAt'];delete _0x42d8a0[_0x11c2('0x2b')];var _0x1752b9=_0x42d8a0['interval']!==_0x11c2('0x2c')?[_0x42d8a0[_0x11c2('0x2d')]]:_0x42d8a0['IntervalId']?_[_0x11c2('0x6')](_[_0x11c2('0x9')](_0x494a84[_0x11c2('0x4')],{'IntervalId':_0x42d8a0[_0x11c2('0x2e')]}),'interval'):[];if(_0x42d8a0['hasOwnProperty'](_0x11c2('0x2f'))){if(_0x42d8a0['tag']&&_0x42d8a0[_0x11c2('0x2f')]!=='--'){_0x29490e['push']({'type':_0x42d8a0[_0x11c2('0x11')],'app':_0x11c2('0x12'),'appdata':_0x11c2('0x30')+_0x42d8a0[_0x11c2('0x2f')],'context':_0x42d8a0[_0x11c2('0x15')],'exten':_0x42d8a0[_0x11c2('0x7')],'priority':_0x1752b9['length']+_0x494a84['priority']+_0x1523e6++,'VoiceExtensionId':_0x42d8a0[_0x11c2('0x18')]});}}if(_0x42d8a0[_0x11c2('0x11')]==='outbound'&&_0x42d8a0[_0x11c2('0xb')](_0x11c2('0x31'))){if(_0x42d8a0[_0x11c2('0x31')]){_0x29490e[_0x11c2('0x10')]({'type':_0x42d8a0['type'],'app':_0x11c2('0x1e'),'appdata':_0x11c2('0x32')+_0x42d8a0[_0x11c2('0x31')]+')','context':_0x42d8a0[_0x11c2('0x15')],'exten':_0x42d8a0['exten'],'priority':_0x1752b9[_0x11c2('0x33')]+_0x494a84[_0x11c2('0xc')]+_0x1523e6++,'VoiceExtensionId':_0x42d8a0['VoiceExtensionId']});}else{_0x29490e['push']({'type':_0x42d8a0[_0x11c2('0x11')],'app':_0x11c2('0x1e'),'appdata':_0x11c2('0x34'),'context':_0x42d8a0[_0x11c2('0x15')],'exten':_0x42d8a0[_0x11c2('0x7')],'priority':_0x1752b9['length']+_0x494a84['priority']+_0x1523e6++,'VoiceExtensionId':_0x42d8a0['VoiceExtensionId']});}}if(_0x42d8a0['hasOwnProperty'](_0x11c2('0x35'))){if(_0x519ab5['indexOf'](_0x42d8a0[_0x11c2('0x36')][_0x11c2('0x2a')]())>=0x0&&_0x42d8a0[_0x11c2('0x37')]!==_0x11c2('0x38')){if(_0x42d8a0[_0x11c2('0x35')]){_0x29490e['push']({'type':_0x42d8a0['type'],'app':_0x11c2('0x1e'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x42d8a0[_0x11c2('0x15')],'exten':_0x42d8a0[_0x11c2('0x7')],'priority':_0x1752b9['length']+_0x494a84[_0x11c2('0xc')]+_0x1523e6++,'VoiceExtensionId':_0x42d8a0[_0x11c2('0x18')]});_0x29490e['push']({'type':_0x42d8a0[_0x11c2('0x11')],'app':_0x11c2('0x12'),'appdata':_0x11c2('0x39'),'context':_0x42d8a0['context'],'exten':_0x42d8a0[_0x11c2('0x7')],'priority':_0x1752b9['length']+_0x494a84[_0x11c2('0xc')]+_0x1523e6++,'VoiceExtensionId':_0x42d8a0[_0x11c2('0x18')]});}else{_0x29490e['push']({'type':_0x42d8a0[_0x11c2('0x11')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x42d8a0['context'],'exten':_0x42d8a0[_0x11c2('0x7')],'priority':_0x1752b9[_0x11c2('0x33')]+_0x494a84['priority']+_0x1523e6++,'VoiceExtensionId':_0x42d8a0['VoiceExtensionId']});_0x29490e[_0x11c2('0x10')]({'type':_0x42d8a0['type'],'app':_0x11c2('0x12'),'appdata':_0x11c2('0x3a'),'context':_0x42d8a0[_0x11c2('0x15')],'exten':_0x42d8a0['exten'],'priority':_0x1752b9[_0x11c2('0x33')]+_0x494a84[_0x11c2('0xc')]+_0x1523e6++,'VoiceExtensionId':_0x42d8a0[_0x11c2('0x18')]});}}}for(var _0x1ba059=0x0;_0x1ba059<_0x1752b9['length'];_0x1ba059+=0x1){var _0x579a1a=_0x494a84[_0x11c2('0xc')]+_0x1752b9[_0x11c2('0x33')];var _0x48e253=_0x1ba059===_0x1752b9[_0x11c2('0x33')]-0x1?_0x494a84[_0x11c2('0xc')]+_0x29490e['length']+_0x30ec92[_0x11c2('0x33')]+0x2:_0x494a84['priority']+_0x1ba059+0x1;_0x29490e[_0x11c2('0x3b')](_0x1ba059,0x0,{'type':_0x42d8a0[_0x11c2('0x11')],'app':_0x11c2('0x3c'),'appdata':_0x1752b9[_0x1ba059]+'?'+_0x42d8a0[_0x11c2('0x15')]+_0x11c2('0x3d')+_0x579a1a+':'+_0x42d8a0[_0x11c2('0x15')]+_0x11c2('0x3d')+_0x48e253,'exten':_0x42d8a0[_0x11c2('0x7')],'context':_0x42d8a0[_0x11c2('0x15')],'priority':_0x494a84[_0x11c2('0xc')]+_0x1ba059,'VoiceExtensionId':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x18')]});}_0x42d8a0[_0x11c2('0xc')]=_0x29490e['length']?_['last'](_0x29490e)[_0x11c2('0xc')]+0x1:_0x494a84[_0x11c2('0xc')];_0x494a84['priority']=(_0x30ec92[_0x11c2('0x33')]?_['last'](_0x30ec92)['priority']:_0x42d8a0['priority'])+0x1;_0x494a84[_0x11c2('0xd')]=_[_0x11c2('0x3e')](_0x494a84[_0x11c2('0xd')],_0x29490e,[_0x42d8a0],_0x30ec92);}_0x494a84['extensions'][_0x11c2('0x10')]({'type':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x11')],'app':_0x11c2('0x3f'),'exten':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x7')],'context':_0x198c86[_0x3fb36c][0x0]['context'],'priority':_0x494a84[_0x11c2('0xc')],'VoiceExtensionId':_0x198c86[_0x3fb36c][0x0][_0x11c2('0x18')]});_0x53d03f[_0x11c2('0x10')](_0x198c86[_0x3fb36c][0x0]['VoiceExtensionId']);_0x12926c=_['concat'](_0x12926c,_0x494a84[_0x11c2('0xd')]);}}return _0x175cbf[_0x11c2('0x40')](function(_0xe0005f){return _0x175cbf['models'][_0x11c2('0x5')][_0x11c2('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x53d03f}},'transaction':_0xe0005f})[_0x11c2('0x3')](function(_0x5efa6a){return _0x175cbf['models'][_0x11c2('0x5')][_0x11c2('0x42')](_['sortBy'](_0x12926c,'priority'),{'transaction':_0xe0005f});});});})[_0x11c2('0x43')](function(_0xa03442){console[_0x11c2('0x44')](_0xa03442);});}exports[_0x11c2('0x45')]=rewrite; \ No newline at end of file +var _0x2148=['$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','intervals','VoiceExtension','IntervalId','then','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','hasOwnProperty','extensions','extension','find','type','Set','CDR(type)=%s','context','priority','VoiceExtensionId','push','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','*,*,*,*','interval','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType'];(function(_0x4959f2,_0x3d1162){var _0x12acdc=function(_0x4636f4){while(--_0x4636f4){_0x4959f2['push'](_0x4959f2['shift']());}};_0x12acdc(++_0x3d1162);}(_0x2148,0x132));var _0x8214=function(_0x3ef45e,_0xe84f33){_0x3ef45e=_0x3ef45e-0x0;var _0x69e7c=_0x2148[_0x3ef45e];return _0x69e7c;};'use strict';var _=require(_0x8214('0x0'));var util=require(_0x8214('0x1'));function rewrite(_0x546bca,_0x4550cd){var _0x58238e=this;return _0x546bca[_0x8214('0x2')][_0x8214('0x3')][_0x8214('0x4')]({'raw':!![]})['then'](function(_0xfd1069){_0x58238e[_0x8214('0x5')]=_0xfd1069;return _0x546bca['models'][_0x8214('0x6')][_0x8214('0x4')]({'where':{'IntervalId':_0x4550cd[_0x8214('0x7')]},'raw':!![]});})[_0x8214('0x8')](function(_0x470326){return _0x546bca['models']['VoiceExtension']['findAll']({'where':{'exten':{'$in':_[_0x8214('0x9')](_[_0x8214('0xa')](_0x470326,_0x8214('0xb')))}},'order':[{'raw':_0x8214('0xc')}],'raw':!![]});})[_0x8214('0x8')](function(_0x42768a){var _0x1cb37e=_[_0x8214('0xd')](_0x42768a,{'priority':'1'});var _0x1c98c1=_[_0x8214('0xd')](_0x42768a,{'isApp':0x1});var _0x3d4fdd=_[_0x8214('0xe')](_0x1c98c1,_0x8214('0xb'));var _0x2afaed=['queue','playback'];var _0x372bf8=[];var _0x56e450=[];for(var _0x55a48a in _0x3d4fdd){if(_0x3d4fdd[_0x8214('0xf')](_0x55a48a)){_0x58238e['priority']=0x2;_0x58238e[_0x8214('0x10')]=[];_0x58238e[_0x8214('0x11')]=_[_0x8214('0x12')](_0x1cb37e,{'exten':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0xb')]});_0x58238e['extensions']['push']({'type':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x13')],'app':_0x8214('0x14'),'appdata':util['format'](_0x8214('0x15'),_0x3d4fdd[_0x55a48a][0x0]['type']),'context':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x16')],'exten':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0xb')],'priority':_0x58238e[_0x8214('0x17')]++,'VoiceExtensionId':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x18')]});if(_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x13')]==='inbound'){_0x58238e[_0x8214('0x10')][_0x8214('0x19')]({'type':_0x3d4fdd[_0x55a48a][0x0]['type'],'app':_0x8214('0x14'),'appdata':_0x8214('0x1a')+_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x18')],'context':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x16')],'exten':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0xb')],'priority':_0x58238e[_0x8214('0x17')]++,'VoiceExtensionId':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x18')]});}else if(_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x13')]===_0x8214('0x1b')){if(_0x58238e[_0x8214('0x11')]){_0x58238e[_0x8214('0x10')]['push']({'type':_0x3d4fdd[_0x55a48a][0x0]['type'],'app':'Set','appdata':_0x8214('0x1c')+(_0x58238e[_0x8214('0x11')][_0x8214('0x1d')]?_0x8214('0x1e')+_0x58238e['extension']['cutdigits']+'}':_0x8214('0x1f')),'context':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x16')],'exten':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0xb')],'priority':_0x58238e['priority']++,'VoiceExtensionId':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x18')]});}_0x58238e[_0x8214('0x10')][_0x8214('0x19')]({'type':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x13')],'app':'Set','appdata':_0x8214('0x1a')+_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x18')],'context':_0x3d4fdd[_0x55a48a][0x0]['context'],'exten':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0xb')],'priority':_0x58238e[_0x8214('0x17')]++,'VoiceExtensionId':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x18')]});var _0x5c2e21=_0x58238e[_0x8214('0x17')]++;_0x58238e[_0x8214('0x10')][_0x8214('0x19')]({'type':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x13')],'app':'ExecIf','appdata':_0x8214('0x20')+(_0x5c2e21+0x2)+_0x8214('0x21')+(_0x5c2e21+0x1)+')','context':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x16')],'exten':_0x3d4fdd[_0x55a48a][0x0]['exten'],'priority':_0x5c2e21,'VoiceExtensionId':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x18')]});if(_0x58238e[_0x8214('0x11')]){_0x58238e[_0x8214('0x10')][_0x8214('0x19')]({'type':_0x3d4fdd[_0x55a48a][0x0]['type'],'app':_0x8214('0x14'),'appdata':_0x58238e['extension'][_0x8214('0x1d')]?_0x8214('0x22')+_0x58238e[_0x8214('0x11')]['cutdigits']+'}':_0x8214('0x23'),'context':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x16')],'exten':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0xb')],'priority':_0x58238e[_0x8214('0x17')]++,'VoiceExtensionId':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x18')]});}_0x58238e[_0x8214('0x10')][_0x8214('0x19')]({'type':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x13')],'app':_0x8214('0x14'),'appdata':_0x8214('0x24')+_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x18')],'context':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x16')],'exten':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0xb')],'priority':_0x58238e[_0x8214('0x17')]++,'VoiceExtensionId':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x18')]});if(_0x58238e[_0x8214('0x11')]&&_0x58238e[_0x8214('0x11')][_0x8214('0xf')](_0x8214('0x25'))&&_0x58238e[_0x8214('0x11')][_0x8214('0x25')]!==_0x8214('0x26')){_0x58238e['extensions'][_0x8214('0x19')]({'type':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x13')],'app':_0x8214('0x14'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x16')],'exten':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0xb')],'priority':_0x58238e[_0x8214('0x17')]++,'VoiceExtensionId':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x18')]});_0x58238e[_0x8214('0x10')]['push']({'type':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x13')],'app':_0x8214('0x14'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x58238e[_0x8214('0x11')][_0x8214('0x25')]||_0x8214('0x27'),'context':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x16')],'exten':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0xb')],'priority':_0x58238e[_0x8214('0x17')]++,'VoiceExtensionId':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x18')]});}}_0x58238e[_0x8214('0x10')][_0x8214('0x19')]({'type':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x13')],'app':_0x8214('0x14'),'appdata':_0x8214('0x28'),'context':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x16')],'exten':_0x3d4fdd[_0x55a48a][0x0]['exten'],'priority':_0x58238e[_0x8214('0x17')]++,'VoiceExtensionId':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x18')]});_0x58238e[_0x8214('0x10')][_0x8214('0x19')]({'type':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x13')],'app':_0x8214('0x14'),'appdata':_0x8214('0x29'),'context':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x16')],'exten':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0xb')],'priority':_0x58238e[_0x8214('0x17')]++,'VoiceExtensionId':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x18')]});_0x58238e[_0x8214('0x10')]['push']({'type':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x13')],'app':_0x8214('0x14'),'appdata':_0x8214('0x2a'),'context':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x16')],'exten':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0xb')],'priority':_0x58238e['priority']++,'VoiceExtensionId':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x18')]});for(var _0x3d62c3=0x0,_0x4a77d2=0x0;_0x3d62c3<_0x3d4fdd[_0x55a48a][_0x8214('0x2b')];_0x3d62c3+=0x1,_0x4a77d2=0x0){var _0x5b9510=_0x3d4fdd[_0x55a48a][_0x3d62c3];if(_0x5b9510[_0x8214('0x13')]){_0x5b9510[_0x8214('0x13')]=_0x5b9510['type'][_0x8214('0x2c')]();}var _0x36e8ea=[];var _0x2f8643=[];delete _0x5b9510['id'];delete _0x5b9510[_0x8214('0x2d')];delete _0x5b9510[_0x8214('0x2e')];var _0x59baac=_0x5b9510['interval']!==_0x8214('0x2f')?[_0x5b9510['interval']]:_0x5b9510[_0x8214('0x7')]?_[_0x8214('0xa')](_[_0x8214('0xd')](_0x58238e['intervals'],{'IntervalId':_0x5b9510[_0x8214('0x7')]}),_0x8214('0x30')):[];if(_0x5b9510[_0x8214('0xf')](_0x8214('0x31'))){if(_0x5b9510[_0x8214('0x31')]&&_0x5b9510[_0x8214('0x31')]!=='--'){_0x36e8ea[_0x8214('0x19')]({'type':_0x5b9510[_0x8214('0x13')],'app':'Set','appdata':_0x8214('0x32')+_0x5b9510[_0x8214('0x31')],'context':_0x5b9510['context'],'exten':_0x5b9510[_0x8214('0xb')],'priority':_0x59baac[_0x8214('0x2b')]+_0x58238e[_0x8214('0x17')]+_0x4a77d2++,'VoiceExtensionId':_0x5b9510[_0x8214('0x18')]});}}if(_0x5b9510[_0x8214('0x13')]==='outbound'&&_0x5b9510[_0x8214('0xf')](_0x8214('0x33'))){if(_0x5b9510[_0x8214('0x33')]){_0x36e8ea[_0x8214('0x19')]({'type':_0x5b9510[_0x8214('0x13')],'app':'ExecIf','appdata':_0x8214('0x34')+_0x5b9510[_0x8214('0x33')]+')','context':_0x5b9510['context'],'exten':_0x5b9510['exten'],'priority':_0x59baac[_0x8214('0x2b')]+_0x58238e[_0x8214('0x17')]+_0x4a77d2++,'VoiceExtensionId':_0x5b9510[_0x8214('0x18')]});}else{_0x36e8ea[_0x8214('0x19')]({'type':_0x5b9510[_0x8214('0x13')],'app':_0x8214('0x35'),'appdata':_0x8214('0x36'),'context':_0x5b9510[_0x8214('0x16')],'exten':_0x5b9510[_0x8214('0xb')],'priority':_0x59baac[_0x8214('0x2b')]+_0x58238e[_0x8214('0x17')]+_0x4a77d2++,'VoiceExtensionId':_0x5b9510[_0x8214('0x18')]});}}if(_0x5b9510['hasOwnProperty'](_0x8214('0x37'))){if(_0x2afaed[_0x8214('0x38')](_0x5b9510[_0x8214('0x39')][_0x8214('0x2c')]())>=0x0&&_0x5b9510[_0x8214('0x3a')]!=='custom'){if(_0x5b9510[_0x8214('0x37')]){_0x36e8ea[_0x8214('0x19')]({'type':_0x5b9510[_0x8214('0x13')],'app':_0x8214('0x35'),'appdata':_0x8214('0x3b'),'context':_0x5b9510[_0x8214('0x16')],'exten':_0x5b9510[_0x8214('0xb')],'priority':_0x59baac['length']+_0x58238e[_0x8214('0x17')]+_0x4a77d2++,'VoiceExtensionId':_0x5b9510[_0x8214('0x18')]});_0x36e8ea[_0x8214('0x19')]({'type':_0x5b9510[_0x8214('0x13')],'app':_0x8214('0x14'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x5b9510[_0x8214('0x16')],'exten':_0x5b9510['exten'],'priority':_0x59baac['length']+_0x58238e['priority']+_0x4a77d2++,'VoiceExtensionId':_0x5b9510[_0x8214('0x18')]});}else{_0x36e8ea['push']({'type':_0x5b9510[_0x8214('0x13')],'app':_0x8214('0x35'),'appdata':_0x8214('0x3c'),'context':_0x5b9510['context'],'exten':_0x5b9510['exten'],'priority':_0x59baac[_0x8214('0x2b')]+_0x58238e[_0x8214('0x17')]+_0x4a77d2++,'VoiceExtensionId':_0x5b9510[_0x8214('0x18')]});_0x36e8ea[_0x8214('0x19')]({'type':_0x5b9510[_0x8214('0x13')],'app':_0x8214('0x14'),'appdata':_0x8214('0x3d'),'context':_0x5b9510[_0x8214('0x16')],'exten':_0x5b9510['exten'],'priority':_0x59baac[_0x8214('0x2b')]+_0x58238e['priority']+_0x4a77d2++,'VoiceExtensionId':_0x5b9510[_0x8214('0x18')]});}}}for(var _0x5b8621=0x0;_0x5b8621<_0x59baac[_0x8214('0x2b')];_0x5b8621+=0x1){var _0x5f4d35=_0x58238e[_0x8214('0x17')]+_0x59baac[_0x8214('0x2b')];var _0x4498bf=_0x5b8621===_0x59baac['length']-0x1?_0x58238e[_0x8214('0x17')]+_0x36e8ea[_0x8214('0x2b')]+_0x2f8643[_0x8214('0x2b')]+0x2:_0x58238e[_0x8214('0x17')]+_0x5b8621+0x1;_0x36e8ea[_0x8214('0x3e')](_0x5b8621,0x0,{'type':_0x5b9510[_0x8214('0x13')],'app':'GotoIfTime','appdata':_0x59baac[_0x5b8621]+'?'+_0x5b9510[_0x8214('0x16')]+_0x8214('0x3f')+_0x5f4d35+':'+_0x5b9510[_0x8214('0x16')]+_0x8214('0x3f')+_0x4498bf,'exten':_0x5b9510[_0x8214('0xb')],'context':_0x5b9510[_0x8214('0x16')],'priority':_0x58238e[_0x8214('0x17')]+_0x5b8621,'VoiceExtensionId':_0x3d4fdd[_0x55a48a][0x0]['VoiceExtensionId']});}_0x5b9510['priority']=_0x36e8ea[_0x8214('0x2b')]?_[_0x8214('0x40')](_0x36e8ea)[_0x8214('0x17')]+0x1:_0x58238e[_0x8214('0x17')];_0x58238e[_0x8214('0x17')]=(_0x2f8643[_0x8214('0x2b')]?_['last'](_0x2f8643)[_0x8214('0x17')]:_0x5b9510[_0x8214('0x17')])+0x1;_0x58238e[_0x8214('0x10')]=_['concat'](_0x58238e[_0x8214('0x10')],_0x36e8ea,[_0x5b9510],_0x2f8643);}_0x58238e[_0x8214('0x10')]['push']({'type':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x13')],'app':_0x8214('0x41'),'exten':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0xb')],'context':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x16')],'priority':_0x58238e[_0x8214('0x17')],'VoiceExtensionId':_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x18')]});_0x372bf8[_0x8214('0x19')](_0x3d4fdd[_0x55a48a][0x0][_0x8214('0x18')]);_0x56e450=_['concat'](_0x56e450,_0x58238e[_0x8214('0x10')]);}}return _0x546bca[_0x8214('0x42')](function(_0x48600c){return _0x546bca[_0x8214('0x2')]['VoiceExtension'][_0x8214('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x372bf8}},'transaction':_0x48600c})[_0x8214('0x8')](function(_0x1a1f8f){return _0x546bca[_0x8214('0x2')][_0x8214('0x6')][_0x8214('0x44')](_[_0x8214('0x45')](_0x56e450,_0x8214('0x17')),{'transaction':_0x48600c});});});})[_0x8214('0x46')](function(_0x3a84ac){console[_0x8214('0x47')](_0x3a84ac);});}exports[_0x8214('0x48')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index e490e69..cdf78a5 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 _0x51cc=['CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','stringify','finally','emit','contact:csv_','resume','unlinkSync','exit','SIGINT','CSV\x20import\x20process\x20stopped!','pause','info','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','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','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ListId','createdAt','select','field','NOW()','ContactId','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','updatedAt','id\x20IN\x20?','str','calleridnum','cm_hopper_black','VoiceQueue','outbound','CmList','get','dialCheckDuplicateType','always','query','VoiceQueueId','onlyIfOpen','sequelize','all','findAll','Campaign','Lists'];(function(_0x4e5bda,_0x21a04f){var _0x18a152=function(_0x17a4dd){while(--_0x17a4dd){_0x4e5bda['push'](_0x4e5bda['shift']());}};_0x18a152(++_0x21a04f);}(_0x51cc,0xef));var _0xc51c=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x51cc[_0xaa0309];return _0x5de7ce;};'use strict';var BPromise=require(_0xc51c('0x0'));var util=require(_0xc51c('0x1'));var _=require(_0xc51c('0x2'));var fs=require('fs');var squel=require(_0xc51c('0x3'));var Papa=require(_0xc51c('0x4'));var Redis=require(_0xc51c('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0xc51c('0x6'));var logger=require(_0xc51c('0x7'))(_0xc51c('0x8'));config[_0xc51c('0x9')]=_[_0xc51c('0xa')](config[_0xc51c('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xc51c('0xb'))(new Redis(config[_0xc51c('0x9')]));require(_0xc51c('0xc'))[_0xc51c('0xd')](socket);try{if(!process[_0xc51c('0xe')][0x2]||process['argv'][0x2]===_0xc51c('0xf')||process[_0xc51c('0xe')][0x2]==='null'){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process['argv'][0x2];if(!process['argv'][0x3]||process['argv'][0x3]===_0xc51c('0xf')||process[_0xc51c('0xe')][0x3]===_0xc51c('0x10')||!process[_0xc51c('0xe')][0x4]||process['argv'][0x4]===_0xc51c('0xf')||process['argv'][0x4]===_0xc51c('0x10')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xc51c('0x11')](process[_0xc51c('0xe')][0x3][_0xc51c('0x12')](','),process[_0xc51c('0xe')][0x4][_0xc51c('0x12')](','));if(!process['argv'][0x5]||process['argv'][0x5]==='undefined'||process[_0xc51c('0xe')][0x5]===_0xc51c('0x10')){throw new Error(_0xc51c('0x13'));}var LISTID=process[_0xc51c('0xe')][0x5];var COMPANYID=process[_0xc51c('0xe')][0x6]&&process['argv'][0x6]!=='undefined'&&process[_0xc51c('0xe')][0x6]!==_0xc51c('0x10')?process[_0xc51c('0xe')][0x6]:null;var DUPLICATES=process[_0xc51c('0xe')][0x7]&&process[_0xc51c('0xe')][0x7]!==_0xc51c('0xf')&&process[_0xc51c('0xe')][0x7]!=='null'?process[_0xc51c('0xe')][0x7]:null;if(!process[_0xc51c('0xe')][0x8]||process[_0xc51c('0xe')][0x8]===_0xc51c('0xf')||process['argv'][0x8]===_0xc51c('0x10')){throw new Error(_0xc51c('0x14'));}var SOCKET_TIMESTAMP=process[_0xc51c('0xe')][0x8];}catch(_0x16bb16){logger[_0xc51c('0x15')](_0x16bb16);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(_0x5aa654,_0x3b2bb7,_0x4cf1cc,_0x1d8e93){var _0x48c593={'message':_0x3b2bb7};_0x48c593[_0x5aa654]=!![];if(_0x4cf1cc){_0x48c593[_0xc51c('0x16')]=_0x4cf1cc;}if(_0x1d8e93){_0x48c593[_0xc51c('0x17')]=_0x1d8e93;}return _0x48c593;}function isEmail(_0x558bef){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x558bef);}function checkRow(_0x3d5c50,_0x2d426b,_0x538e3d){return new BPromise(function(_0x4d580b,_0x5e9e8f){if(_[_0xc51c('0x18')](_0x3d5c50)){return _0x5e9e8f(handleCheckRowError(_0xc51c('0x15'),_0xc51c('0x19'),null,_0x538e3d));}if(_0x3d5c50[_0xc51c('0x1a')]&&_0x3d5c50[_0xc51c('0x1a')][_0xc51c('0x1b')]){var _0x21c6c3=_[_0xc51c('0x1c')](_0x3d5c50[_0xc51c('0x1a')],_0xc51c('0x1d'))[_0xc51c('0x1e')](';');return _0x5e9e8f(handleCheckRowError(_0xc51c('0x15'),_0x21c6c3,null,_0x538e3d));}var _0x38f3eb={};for(var _0x26d71f in FIELDS){if(FIELDS['hasOwnProperty'](_0x26d71f)&&FIELDS[_0x26d71f]){_0x38f3eb[_0x26d71f]=_0x3d5c50[_0xc51c('0x1f')][0x0][FIELDS[_0x26d71f]]||_0x3d5c50[_0xc51c('0x1f')][0x0]['\ufeff'+FIELDS[_0x26d71f]];}}if(!_0x38f3eb[_0xc51c('0x20')]){return _0x5e9e8f(handleCheckRowError(_0xc51c('0x15'),_0xc51c('0x21'),null,_0x538e3d));}if(!_0x38f3eb[_0xc51c('0x22')]){return _0x5e9e8f(handleCheckRowError(_0xc51c('0x15'),_0xc51c('0x23'),null,_0x538e3d));}if(_0x38f3eb['birthDate']){var _0x14e68c=moment(_0x38f3eb[_0xc51c('0x24')],_0xc51c('0x25'));if(!_0x14e68c['isValid']()){return _0x5e9e8f(handleCheckRowError(_0xc51c('0x15'),_0xc51c('0x26'),null,_0x538e3d));}}if(_0x38f3eb[_0xc51c('0x27')]){if(!isEmail(_0x38f3eb['email'])){return _0x5e9e8f(handleCheckRowError('error',_0xc51c('0x28'),null,_0x538e3d));}}_0x38f3eb['ListId']=LISTID;_0x38f3eb[_0xc51c('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xc51c('0x1b')]&&_0x2d426b){var _0x9850b3={};for(var _0x1213c7=0x0,_0x31953a=DUPLICATES['length'];_0x1213c7<_0x31953a;_0x1213c7+=0x1){_0x9850b3[DUPLICATES[_0x1213c7]]=_0x38f3eb[DUPLICATES[_0x1213c7]];}var _0x2c3a05=_[_0xc51c('0x2a')](_0x2d426b,_0x9850b3);if(_0x2c3a05){return _0x5e9e8f(handleCheckRowError(_0xc51c('0x2b'),_0xc51c('0x2c'),_0x2c3a05,_0x538e3d));}}return db[_0xc51c('0x2d')][_0xc51c('0x2e')](_0x38f3eb,{'raw':!![],'hooks':![],'fields':_[_0xc51c('0x2f')](_0x38f3eb)})[_0xc51c('0x30')](function(_0x480a47){if(DUPLICATES&&DUPLICATES['length']&&_0x2d426b){_0x2d426b[_0xc51c('0x31')](_[_0xc51c('0x32')](_0x38f3eb,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x480a47['id'];return _0x4d580b();})[_0xc51c('0x33')](function(_0x26f29a){return _0x5e9e8f(handleCheckRowError(_0xc51c('0x15'),'Error\x20while\x20creating\x20contact:\x20'+(_0x26f29a['message']||JSON['stringify'](_0x26f29a)),null,_0x538e3d));});});}function checkHopper(){function _0x12acdd(){return function(_0x327afd){logger[_0xc51c('0x15')](_0xc51c('0x34'),_0xc51c('0x35'),util[_0xc51c('0x36')](_0x327afd,{'showHidden':![],'depth':null}));};}var _0x1a68ae=function(_0x4b5d1e,_0x31390b){var _0x5a6296=squel[_0xc51c('0x37')]()[_0xc51c('0x38')](_0xc51c('0x39'))[_0xc51c('0x3a')](['phone',_0xc51c('0x3b'),'ContactId',_0xc51c('0x3c'),_0x31390b,_0xc51c('0x3d'),'updatedAt'],squel[_0xc51c('0x3e')]()[_0xc51c('0x3f')](_0xc51c('0x22'),_0xc51c('0x22'))[_0xc51c('0x3f')](_0xc51c('0x40'),'scheduledAt')[_0xc51c('0x3f')]('id',_0xc51c('0x41'))[_0xc51c('0x3f')](LISTID[_0xc51c('0x42')](),_0xc51c('0x3c'))[_0xc51c('0x3f')](_0x4b5d1e['id'][_0xc51c('0x42')](),_0x31390b)[_0xc51c('0x3f')]('NOW()','createdAt')[_0xc51c('0x3f')](_0xc51c('0x40'),'updatedAt')[_0xc51c('0x43')](_0xc51c('0x44'))[_0xc51c('0x45')](_0xc51c('0x46'))[_0xc51c('0x45')](_0xc51c('0x47'),LISTID[_0xc51c('0x42')]())[_0xc51c('0x45')](_0xc51c('0x48'))[_0xc51c('0x45')](_0xc51c('0x49'),squel['select']()[_0xc51c('0x3f')](_0xc51c('0x22'))['from']('cm_hopper')[_0xc51c('0x45')](_0x31390b+_0xc51c('0x4a'),_0x4b5d1e['id'][_0xc51c('0x42')]())))[_0xc51c('0x42')]();return _0x5a6296;};var _0xbb6bbb=function(_0x22cc02,_0x5ef38f){var _0x211100=squel['insert']()[_0xc51c('0x38')](_0xc51c('0x39'))[_0xc51c('0x3a')]([_0xc51c('0x22'),'scheduledAt',_0xc51c('0x41'),'ListId',_0x5ef38f,'createdAt',_0xc51c('0x4b')],squel[_0xc51c('0x3e')]()['field']('phone','phone')['field'](_0xc51c('0x40'),_0xc51c('0x3b'))[_0xc51c('0x3f')]('id','ContactId')[_0xc51c('0x3f')](LISTID[_0xc51c('0x42')](),_0xc51c('0x3c'))[_0xc51c('0x3f')](_0x22cc02['id'][_0xc51c('0x42')](),_0x5ef38f)[_0xc51c('0x3f')](_0xc51c('0x40'),'createdAt')[_0xc51c('0x3f')](_0xc51c('0x40'),_0xc51c('0x4b'))[_0xc51c('0x43')](_0xc51c('0x44'))[_0xc51c('0x45')]('deletedAt\x20IS\x20NULL')[_0xc51c('0x45')](_0xc51c('0x47'),LISTID[_0xc51c('0x42')]())[_0xc51c('0x45')](_0xc51c('0x4c'),squel[_0xc51c('0x4d')](hopperContacts))[_0xc51c('0x45')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xc51c('0x49'),squel[_0xc51c('0x3e')]()[_0xc51c('0x3f')](_0xc51c('0x4e'))['from']('cm_hopper_final')[_0xc51c('0x45')](_0x5ef38f+'\x20=\x20?',_0x22cc02['id'][_0xc51c('0x42')]()))['where'](_0xc51c('0x49'),squel[_0xc51c('0x3e')]()[_0xc51c('0x3f')](_0xc51c('0x22'))[_0xc51c('0x43')](_0xc51c('0x39'))['where'](_0x5ef38f+'\x20=\x20?',_0x22cc02['id']['toString']())))[_0xc51c('0x42')]();return _0x211100;};function _0xbbbe3a(_0x9764eb,_0x408411){var _0x2a4790=squel[_0xc51c('0x37')]()[_0xc51c('0x38')]('cm_hopper')['fromQuery']([_0xc51c('0x22'),_0xc51c('0x3b'),_0xc51c('0x41'),_0xc51c('0x3c'),_0x408411,_0xc51c('0x3d'),_0xc51c('0x4b')],squel[_0xc51c('0x3e')]()[_0xc51c('0x3f')](_0xc51c('0x22'),'phone')[_0xc51c('0x3f')](_0xc51c('0x40'),_0xc51c('0x3b'))['field']('id','ContactId')[_0xc51c('0x3f')](LISTID[_0xc51c('0x42')](),_0xc51c('0x3c'))['field'](_0x9764eb['id']['toString'](),_0x408411)[_0xc51c('0x3f')](_0xc51c('0x40'),_0xc51c('0x3d'))[_0xc51c('0x3f')](_0xc51c('0x40'),_0xc51c('0x4b'))[_0xc51c('0x43')]('cm_contacts')[_0xc51c('0x45')](_0xc51c('0x46'))[_0xc51c('0x45')](_0xc51c('0x47'),LISTID[_0xc51c('0x42')]())[_0xc51c('0x45')]('id\x20IN\x20?',squel[_0xc51c('0x4d')](hopperContacts))['where'](_0xc51c('0x48')))[_0xc51c('0x42')]();return _0x2a4790;}function _0x1869e2(_0x4a6948,_0x44e696){var _0x23c680=squel['insert']()[_0xc51c('0x38')](_0xc51c('0x4f'))[_0xc51c('0x3a')]([_0xc51c('0x22'),_0xc51c('0x41'),_0xc51c('0x3c'),_0x44e696,_0xc51c('0x3d'),_0xc51c('0x4b')],squel[_0xc51c('0x3e')]()[_0xc51c('0x3f')](_0xc51c('0x22'),_0xc51c('0x22'))[_0xc51c('0x3f')]('id','ContactId')[_0xc51c('0x3f')](LISTID[_0xc51c('0x42')](),'ListId')[_0xc51c('0x3f')](_0x4a6948['id'][_0xc51c('0x42')](),_0x44e696)['field'](_0xc51c('0x40'),_0xc51c('0x3d'))['field'](_0xc51c('0x40'),_0xc51c('0x4b'))[_0xc51c('0x43')]('cm_contacts')[_0xc51c('0x45')](_0xc51c('0x46'))[_0xc51c('0x45')](_0xc51c('0x47'),LISTID[_0xc51c('0x42')]())[_0xc51c('0x45')](_0xc51c('0x4c'),squel[_0xc51c('0x4d')](hopperContacts))['where'](_0xc51c('0x48')))['toString']();return _0x23c680;}return db[_0xc51c('0x50')]['findAll']({'where':{'type':_0xc51c('0x51')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xc51c('0x52')],'as':'Lists','where':{'id':LISTID}}]})[_0xc51c('0x30')](function(_0x493221){var _0x497629=[];if(_0x493221){var _0x387e7e;for(var _0x272425=0x0,_0x16b989;_0x272425<_0x493221[_0xc51c('0x1b')];_0x272425+=0x1){_0x16b989=_0x493221[_0x272425][_0xc51c('0x53')]({'plain':!![]});switch(_0x16b989[_0xc51c('0x54')]){case _0xc51c('0x55'):_0x497629['push'](db['sequelize'][_0xc51c('0x56')](_0xbb6bbb(_0x16b989,_0xc51c('0x57')))[_0xc51c('0x30')](function(){})[_0xc51c('0x33')](_0x12acdd()));break;case _0xc51c('0x58'):_0x497629['push'](db[_0xc51c('0x59')][_0xc51c('0x56')](_0x1a68ae(_0x16b989,_0xc51c('0x57')))['then'](function(){})[_0xc51c('0x33')](_0x12acdd()));break;default:_0x497629['push'](db[_0xc51c('0x59')][_0xc51c('0x56')](_0xbbbe3a(_0x16b989,_0xc51c('0x57')))[_0xc51c('0x30')](function(){})[_0xc51c('0x33')](_0x12acdd()));}}}return _0x497629;})[_0xc51c('0x5a')]()['then'](function(){return db[_0xc51c('0x50')][_0xc51c('0x5b')]({'where':{'type':_0xc51c('0x51')},'attributes':['id'],'include':[{'model':db[_0xc51c('0x52')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x308b4d){var _0x3b9c80=[];if(_0x308b4d){var _0x3b7cba;for(var _0x4aa1d7=0x0,_0x3f4aaa;_0x4aa1d7<_0x308b4d['length'];_0x4aa1d7+=0x1){_0x3f4aaa=_0x308b4d[_0x4aa1d7][_0xc51c('0x53')]({'plain':!![]});_0x3b9c80[_0xc51c('0x31')](db[_0xc51c('0x59')]['query'](_0x1869e2(_0x3f4aaa,_0xc51c('0x57')))['then'](function(){})[_0xc51c('0x33')](_0x12acdd()));}}return _0x3b9c80;})[_0xc51c('0x5a')]();})[_0xc51c('0x30')](function(){return db[_0xc51c('0x5c')][_0xc51c('0x5b')]({'attributes':['id',_0xc51c('0x54')],'include':[{'model':db[_0xc51c('0x52')],'as':_0xc51c('0x5d'),'where':{'id':LISTID}}]})['then'](function(_0x462041){var _0x527ee5=[];if(_0x462041){for(var _0x354346=0x0,_0x3fa276;_0x354346<_0x462041['length'];_0x354346+=0x1){_0x3fa276=_0x462041[_0x354346][_0xc51c('0x53')]({'plain':!![]});switch(_0x3fa276[_0xc51c('0x54')]){case _0xc51c('0x55'):_0x527ee5[_0xc51c('0x31')](db[_0xc51c('0x59')][_0xc51c('0x56')](_0xbb6bbb(_0x3fa276,'CampaignId'))[_0xc51c('0x30')](function(){})['catch'](_0x12acdd()));break;case _0xc51c('0x58'):_0x527ee5[_0xc51c('0x31')](db[_0xc51c('0x59')][_0xc51c('0x56')](_0x1a68ae(_0x3fa276,'CampaignId'))[_0xc51c('0x30')](function(){})[_0xc51c('0x33')](_0x12acdd()));break;default:_0x527ee5['push'](db['sequelize'][_0xc51c('0x56')](_0xbbbe3a(_0x3fa276,_0xc51c('0x5e')))[_0xc51c('0x30')](function(){})[_0xc51c('0x33')](_0x12acdd()));}}}return _0x527ee5;})[_0xc51c('0x5a')]();})[_0xc51c('0x30')](function(){return db['Campaign']['findAll']({'attributes':['id'],'include':[{'model':db[_0xc51c('0x52')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xc51c('0x30')](function(_0x5ba625){var _0x3f2488=[];if(_0x5ba625){for(var _0x4e4a76=0x0,_0x8ed19d;_0x4e4a76<_0x5ba625[_0xc51c('0x1b')];_0x4e4a76+=0x1){_0x8ed19d=_0x5ba625[_0x4e4a76]['get']({'plain':!![]});_0x3f2488[_0xc51c('0x31')](db['sequelize'][_0xc51c('0x56')](_0x1869e2(_0x8ed19d,_0xc51c('0x5e')))['then'](function(){})[_0xc51c('0x33')](_0x12acdd()));}}return _0x3f2488;})['all']();})[_0xc51c('0x33')](function(_0x341748){logger['error'](_0xc51c('0x5f'),_0xc51c('0x60'),_0x341748['message']);});}var processPromises=function(_0x129f94){return BPromise[_0xc51c('0x5a')](promises)['then'](function(_0x203c07){})['catch'](function(_0x38c16a){logger['error'](_0xc51c('0x61'),JSON[_0xc51c('0x62')](_0x38c16a));})[_0xc51c('0x63')](function(){socket[_0xc51c('0x64')](_0xc51c('0x65')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x129f94){return _0x129f94[_0xc51c('0x66')]();}});};var endCsv=function(){return BPromise['resolve']()[_0xc51c('0x30')](function(){if(hopperContacts){return checkHopper();}})[_0xc51c('0x30')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xc51c('0x67')](FILEPATH);}catch(_0x2de5c9){logger['error']('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0xc51c('0x62')](_0x2de5c9));}finally{process[_0xc51c('0x68')](0x0);}});};process['on'](_0xc51c('0x69'),function(){logger['info'](_0xc51c('0x6a'));endCsv();});function main(){return BPromise['resolve']()[_0xc51c('0x30')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0xc51c('0x2d')][_0xc51c('0x5b')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x10b27f){var _0x456614=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x456614,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4193ec,_0x2b49e4){total+=0x1;var _0x4e48c3=total;promises[_0xc51c('0x31')](checkRow(_0x4193ec,_0x10b27f,_0x4e48c3)[_0xc51c('0x30')](function(){success+=0x1;})['catch'](function(_0x5678c8){if(_0x5678c8[_0xc51c('0x15')]){errors+=0x1;delete _0x5678c8['error'];}else if(_0x5678c8[_0xc51c('0x2b')]){duplicates+=0x1;delete _0x5678c8[_0xc51c('0x2b')];}rows[_0xc51c('0x31')](_0x5678c8);}));if(total%0xc8===0x0){_0x2b49e4[_0xc51c('0x6b')]();return processPromises(_0x2b49e4);}},'complete':function(){return processPromises()[_0xc51c('0x30')](function(){logger[_0xc51c('0x6c')](_0xc51c('0x6d'));endCsv();});},'error':function(_0x504dac,_0x4b6aed){logger[_0xc51c('0x6c')]('CSV\x20parse\x20error',JSON[_0xc51c('0x62')](_0x504dac));endCsv();}});})[_0xc51c('0x33')](function(_0x467694){logger[_0xc51c('0x15')](_0xc51c('0x6e'),JSON[_0xc51c('0x62')](_0x467694));});}main(); \ No newline at end of file +var _0x5c26=['cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','select','field','toString','NOW()','updatedAt','from','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','into','cm_contacts','id\x20IN\x20?','str','cm_hopper_final','\x20=\x20?','VoiceQueue','outbound','dialCheckDuplicateType','Lists','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','findAll','CmList','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','../../../mysqldb','../../../config/environment','../../../config/logger','api','defaults','redis','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','contact','index','test','isNil','error','errors','length','map','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','then','push','pick','catch','message','stringify','cmContact','checkHopper','insert'];(function(_0x166341,_0x1eb646){var _0x17339d=function(_0x322368){while(--_0x322368){_0x166341['push'](_0x166341['shift']());}};_0x17339d(++_0x1eb646);}(_0x5c26,0x10e));var _0x65c2=function(_0x5cc9a2,_0x4dab4f){_0x5cc9a2=_0x5cc9a2-0x0;var _0x193333=_0x5c26[_0x5cc9a2];return _0x193333;};'use strict';var BPromise=require(_0x65c2('0x0'));var util=require(_0x65c2('0x1'));var _=require(_0x65c2('0x2'));var fs=require('fs');var squel=require(_0x65c2('0x3'));var Papa=require('papaparse');var Redis=require('ioredis');var db=require(_0x65c2('0x4'))['db'];var config=require(_0x65c2('0x5'));var logger=require(_0x65c2('0x6'))(_0x65c2('0x7'));config['redis']=_[_0x65c2('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x65c2('0x9')]));require(_0x65c2('0xa'))[_0x65c2('0xb')](socket);try{if(!process['argv'][0x2]||process[_0x65c2('0xc')][0x2]===_0x65c2('0xd')||process[_0x65c2('0xc')][0x2]===_0x65c2('0xe')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x65c2('0xc')][0x2];if(!process[_0x65c2('0xc')][0x3]||process['argv'][0x3]==='undefined'||process['argv'][0x3]==='null'||!process[_0x65c2('0xc')][0x4]||process[_0x65c2('0xc')][0x4]===_0x65c2('0xd')||process['argv'][0x4]===_0x65c2('0xe')){throw new Error(_0x65c2('0xf'));}var FIELDS=_[_0x65c2('0x10')](process['argv'][0x3][_0x65c2('0x11')](','),process[_0x65c2('0xc')][0x4][_0x65c2('0x11')](','));if(!process[_0x65c2('0xc')][0x5]||process[_0x65c2('0xc')][0x5]==='undefined'||process['argv'][0x5]===_0x65c2('0xe')){throw new Error(_0x65c2('0x12'));}var LISTID=process[_0x65c2('0xc')][0x5];var COMPANYID=process[_0x65c2('0xc')][0x6]&&process[_0x65c2('0xc')][0x6]!=='undefined'&&process[_0x65c2('0xc')][0x6]!==_0x65c2('0xe')?process[_0x65c2('0xc')][0x6]:null;var DUPLICATES=process[_0x65c2('0xc')][0x7]&&process[_0x65c2('0xc')][0x7]!==_0x65c2('0xd')&&process['argv'][0x7]!==_0x65c2('0xe')?process[_0x65c2('0xc')][0x7]:null;if(!process['argv'][0x8]||process[_0x65c2('0xc')][0x8]===_0x65c2('0xd')||process[_0x65c2('0xc')][0x8]===_0x65c2('0xe')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x25277f){logger['error'](_0x25277f);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(_0x45b0e7,_0x2901bb,_0x3b50fe,_0x189422){var _0x3727b3={'message':_0x2901bb};_0x3727b3[_0x45b0e7]=!![];if(_0x3b50fe){_0x3727b3[_0x65c2('0x13')]=_0x3b50fe;}if(_0x189422){_0x3727b3[_0x65c2('0x14')]=_0x189422;}return _0x3727b3;}function isEmail(_0x2a20ca){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))*$/[_0x65c2('0x15')](_0x2a20ca);}function checkRow(_0x484b7c,_0x291f69,_0x294e8d){return new BPromise(function(_0x43e334,_0x33bf67){if(_[_0x65c2('0x16')](_0x484b7c)){return _0x33bf67(handleCheckRowError(_0x65c2('0x17'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x294e8d));}if(_0x484b7c[_0x65c2('0x18')]&&_0x484b7c[_0x65c2('0x18')][_0x65c2('0x19')]){var _0x290ec3=_[_0x65c2('0x1a')](_0x484b7c[_0x65c2('0x18')],'message')[_0x65c2('0x1b')](';');return _0x33bf67(handleCheckRowError(_0x65c2('0x17'),_0x290ec3,null,_0x294e8d));}var _0x58542d={};for(var _0x1f058f in FIELDS){if(FIELDS[_0x65c2('0x1c')](_0x1f058f)&&FIELDS[_0x1f058f]){_0x58542d[_0x1f058f]=_0x484b7c[_0x65c2('0x1d')][0x0][FIELDS[_0x1f058f]]||_0x484b7c[_0x65c2('0x1d')][0x0]['\ufeff'+FIELDS[_0x1f058f]];}}if(!_0x58542d[_0x65c2('0x1e')]){return _0x33bf67(handleCheckRowError('error',_0x65c2('0x1f'),null,_0x294e8d));}if(!_0x58542d[_0x65c2('0x20')]){return _0x33bf67(handleCheckRowError(_0x65c2('0x17'),_0x65c2('0x21'),null,_0x294e8d));}if(_0x58542d[_0x65c2('0x22')]){var _0x27b9b0=moment(_0x58542d[_0x65c2('0x22')],'YYYY-MM-DD');if(!_0x27b9b0['isValid']()){return _0x33bf67(handleCheckRowError('error',_0x65c2('0x23'),null,_0x294e8d));}}if(_0x58542d[_0x65c2('0x24')]){if(!isEmail(_0x58542d[_0x65c2('0x24')])){return _0x33bf67(handleCheckRowError(_0x65c2('0x17'),_0x65c2('0x25'),null,_0x294e8d));}}_0x58542d[_0x65c2('0x26')]=LISTID;_0x58542d[_0x65c2('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x65c2('0x19')]&&_0x291f69){var _0x1eb160={};for(var _0x225e2e=0x0,_0x522a44=DUPLICATES[_0x65c2('0x19')];_0x225e2e<_0x522a44;_0x225e2e+=0x1){_0x1eb160[DUPLICATES[_0x225e2e]]=_0x58542d[DUPLICATES[_0x225e2e]];}var _0x1e37c6=_[_0x65c2('0x28')](_0x291f69,_0x1eb160);if(_0x1e37c6){return _0x33bf67(handleCheckRowError(_0x65c2('0x29'),_0x65c2('0x2a'),_0x1e37c6,_0x294e8d));}}return db[_0x65c2('0x2b')][_0x65c2('0x2c')](_0x58542d,{'raw':!![],'hooks':![],'fields':_['keys'](_0x58542d)})[_0x65c2('0x2d')](function(_0x1a2b47){if(DUPLICATES&&DUPLICATES[_0x65c2('0x19')]&&_0x291f69){_0x291f69[_0x65c2('0x2e')](_[_0x65c2('0x2f')](_0x58542d,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1a2b47['id'];return _0x43e334();})[_0x65c2('0x30')](function(_0x43c35e){return _0x33bf67(handleCheckRowError(_0x65c2('0x17'),'Error\x20while\x20creating\x20contact:\x20'+(_0x43c35e[_0x65c2('0x31')]||JSON[_0x65c2('0x32')](_0x43c35e)),null,_0x294e8d));});});}function checkHopper(){function _0x40fd3b(){return function(_0x2e11a7){logger[_0x65c2('0x17')](_0x65c2('0x33'),_0x65c2('0x34'),util['inspect'](_0x2e11a7,{'showHidden':![],'depth':null}));};}var _0x5e3135=function(_0x13b190,_0x35662f){var _0xeef23c=squel[_0x65c2('0x35')]()['into'](_0x65c2('0x36'))[_0x65c2('0x37')]([_0x65c2('0x20'),_0x65c2('0x38'),_0x65c2('0x39'),_0x65c2('0x26'),_0x35662f,_0x65c2('0x3a'),'updatedAt'],squel[_0x65c2('0x3b')]()[_0x65c2('0x3c')](_0x65c2('0x20'),_0x65c2('0x20'))[_0x65c2('0x3c')]('NOW()','scheduledAt')[_0x65c2('0x3c')]('id',_0x65c2('0x39'))[_0x65c2('0x3c')](LISTID[_0x65c2('0x3d')](),'ListId')[_0x65c2('0x3c')](_0x13b190['id'][_0x65c2('0x3d')](),_0x35662f)[_0x65c2('0x3c')](_0x65c2('0x3e'),_0x65c2('0x3a'))[_0x65c2('0x3c')](_0x65c2('0x3e'),_0x65c2('0x3f'))[_0x65c2('0x40')]('cm_contacts')[_0x65c2('0x41')](_0x65c2('0x42'))['where']('ListId\x20=\x20?',LISTID[_0x65c2('0x3d')]())[_0x65c2('0x41')](_0x65c2('0x43'))[_0x65c2('0x41')](_0x65c2('0x44'),squel[_0x65c2('0x3b')]()[_0x65c2('0x3c')](_0x65c2('0x20'))[_0x65c2('0x40')]('cm_hopper')[_0x65c2('0x41')](_0x35662f+'\x20=\x20?',_0x13b190['id'][_0x65c2('0x3d')]())))[_0x65c2('0x3d')]();return _0xeef23c;};var _0xca9a34=function(_0x40f417,_0x4a0049){var _0x31f0ee=squel[_0x65c2('0x35')]()[_0x65c2('0x45')](_0x65c2('0x36'))[_0x65c2('0x37')]([_0x65c2('0x20'),_0x65c2('0x38'),_0x65c2('0x39'),_0x65c2('0x26'),_0x4a0049,_0x65c2('0x3a'),'updatedAt'],squel[_0x65c2('0x3b')]()['field']('phone',_0x65c2('0x20'))[_0x65c2('0x3c')](_0x65c2('0x3e'),_0x65c2('0x38'))[_0x65c2('0x3c')]('id',_0x65c2('0x39'))[_0x65c2('0x3c')](LISTID['toString'](),'ListId')[_0x65c2('0x3c')](_0x40f417['id'][_0x65c2('0x3d')](),_0x4a0049)[_0x65c2('0x3c')](_0x65c2('0x3e'),_0x65c2('0x3a'))['field'](_0x65c2('0x3e'),_0x65c2('0x3f'))[_0x65c2('0x40')](_0x65c2('0x46'))[_0x65c2('0x41')](_0x65c2('0x42'))[_0x65c2('0x41')]('ListId\x20=\x20?',LISTID[_0x65c2('0x3d')]())['where'](_0x65c2('0x47'),squel[_0x65c2('0x48')](hopperContacts))[_0x65c2('0x41')](_0x65c2('0x43'))[_0x65c2('0x41')](_0x65c2('0x44'),squel['select']()['field']('calleridnum')[_0x65c2('0x40')](_0x65c2('0x49'))[_0x65c2('0x41')](_0x4a0049+_0x65c2('0x4a'),_0x40f417['id'][_0x65c2('0x3d')]()))[_0x65c2('0x41')](_0x65c2('0x44'),squel[_0x65c2('0x3b')]()['field'](_0x65c2('0x20'))[_0x65c2('0x40')](_0x65c2('0x36'))[_0x65c2('0x41')](_0x4a0049+'\x20=\x20?',_0x40f417['id'][_0x65c2('0x3d')]())))[_0x65c2('0x3d')]();return _0x31f0ee;};function _0x2f22a6(_0x3d4455,_0x405679){var _0x101671=squel[_0x65c2('0x35')]()[_0x65c2('0x45')]('cm_hopper')[_0x65c2('0x37')](['phone',_0x65c2('0x38'),_0x65c2('0x39'),_0x65c2('0x26'),_0x405679,_0x65c2('0x3a'),'updatedAt'],squel[_0x65c2('0x3b')]()['field'](_0x65c2('0x20'),_0x65c2('0x20'))[_0x65c2('0x3c')](_0x65c2('0x3e'),_0x65c2('0x38'))[_0x65c2('0x3c')]('id',_0x65c2('0x39'))['field'](LISTID[_0x65c2('0x3d')](),_0x65c2('0x26'))[_0x65c2('0x3c')](_0x3d4455['id'][_0x65c2('0x3d')](),_0x405679)['field'](_0x65c2('0x3e'),_0x65c2('0x3a'))['field']('NOW()',_0x65c2('0x3f'))[_0x65c2('0x40')](_0x65c2('0x46'))[_0x65c2('0x41')](_0x65c2('0x42'))[_0x65c2('0x41')]('ListId\x20=\x20?',LISTID[_0x65c2('0x3d')]())[_0x65c2('0x41')](_0x65c2('0x47'),squel[_0x65c2('0x48')](hopperContacts))[_0x65c2('0x41')](_0x65c2('0x43')))[_0x65c2('0x3d')]();return _0x101671;}function _0x2161df(_0x281c3b,_0x245eb6){var _0x2c997d=squel['insert']()[_0x65c2('0x45')]('cm_hopper_black')[_0x65c2('0x37')]([_0x65c2('0x20'),_0x65c2('0x39'),_0x65c2('0x26'),_0x245eb6,_0x65c2('0x3a'),_0x65c2('0x3f')],squel[_0x65c2('0x3b')]()[_0x65c2('0x3c')](_0x65c2('0x20'),_0x65c2('0x20'))['field']('id',_0x65c2('0x39'))[_0x65c2('0x3c')](LISTID[_0x65c2('0x3d')](),_0x65c2('0x26'))[_0x65c2('0x3c')](_0x281c3b['id']['toString'](),_0x245eb6)['field'](_0x65c2('0x3e'),_0x65c2('0x3a'))['field'](_0x65c2('0x3e'),_0x65c2('0x3f'))[_0x65c2('0x40')](_0x65c2('0x46'))[_0x65c2('0x41')](_0x65c2('0x42'))[_0x65c2('0x41')]('ListId\x20=\x20?',LISTID[_0x65c2('0x3d')]())['where'](_0x65c2('0x47'),squel[_0x65c2('0x48')](hopperContacts))['where'](_0x65c2('0x43')))['toString']();return _0x2c997d;}return db[_0x65c2('0x4b')]['findAll']({'where':{'type':_0x65c2('0x4c')},'attributes':['id',_0x65c2('0x4d')],'include':[{'model':db['CmList'],'as':_0x65c2('0x4e'),'where':{'id':LISTID}}]})[_0x65c2('0x2d')](function(_0xcf592e){var _0x3c54c7=[];if(_0xcf592e){var _0x27efcb;for(var _0x730590=0x0,_0x41f354;_0x730590<_0xcf592e['length'];_0x730590+=0x1){_0x41f354=_0xcf592e[_0x730590][_0x65c2('0x4f')]({'plain':!![]});switch(_0x41f354[_0x65c2('0x4d')]){case _0x65c2('0x50'):_0x3c54c7[_0x65c2('0x2e')](db[_0x65c2('0x51')][_0x65c2('0x52')](_0xca9a34(_0x41f354,_0x65c2('0x53')))[_0x65c2('0x2d')](function(){})['catch'](_0x40fd3b()));break;case _0x65c2('0x54'):_0x3c54c7[_0x65c2('0x2e')](db['sequelize'][_0x65c2('0x52')](_0x5e3135(_0x41f354,'VoiceQueueId'))[_0x65c2('0x2d')](function(){})[_0x65c2('0x30')](_0x40fd3b()));break;default:_0x3c54c7[_0x65c2('0x2e')](db[_0x65c2('0x51')]['query'](_0x2f22a6(_0x41f354,_0x65c2('0x53')))[_0x65c2('0x2d')](function(){})[_0x65c2('0x30')](_0x40fd3b()));}}}return _0x3c54c7;})[_0x65c2('0x55')]()['then'](function(){return db['VoiceQueue'][_0x65c2('0x56')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x65c2('0x57')],'as':_0x65c2('0x58'),'where':{'id':LISTID}}]})[_0x65c2('0x2d')](function(_0x2fe461){var _0x5c7ccb=[];if(_0x2fe461){var _0x17d2c0;for(var _0x252bf5=0x0,_0x4ecf01;_0x252bf5<_0x2fe461['length'];_0x252bf5+=0x1){_0x4ecf01=_0x2fe461[_0x252bf5][_0x65c2('0x4f')]({'plain':!![]});_0x5c7ccb[_0x65c2('0x2e')](db[_0x65c2('0x51')][_0x65c2('0x52')](_0x2161df(_0x4ecf01,'VoiceQueueId'))[_0x65c2('0x2d')](function(){})[_0x65c2('0x30')](_0x40fd3b()));}}return _0x5c7ccb;})[_0x65c2('0x55')]();})[_0x65c2('0x2d')](function(){return db[_0x65c2('0x59')]['findAll']({'attributes':['id',_0x65c2('0x4d')],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x1f19fa){var _0x230dc2=[];if(_0x1f19fa){for(var _0x269492=0x0,_0x489802;_0x269492<_0x1f19fa[_0x65c2('0x19')];_0x269492+=0x1){_0x489802=_0x1f19fa[_0x269492][_0x65c2('0x4f')]({'plain':!![]});switch(_0x489802[_0x65c2('0x4d')]){case _0x65c2('0x50'):_0x230dc2['push'](db[_0x65c2('0x51')][_0x65c2('0x52')](_0xca9a34(_0x489802,_0x65c2('0x5a')))[_0x65c2('0x2d')](function(){})[_0x65c2('0x30')](_0x40fd3b()));break;case'onlyIfOpen':_0x230dc2['push'](db['sequelize']['query'](_0x5e3135(_0x489802,_0x65c2('0x5a')))[_0x65c2('0x2d')](function(){})[_0x65c2('0x30')](_0x40fd3b()));break;default:_0x230dc2[_0x65c2('0x2e')](db[_0x65c2('0x51')]['query'](_0x2f22a6(_0x489802,_0x65c2('0x5a')))[_0x65c2('0x2d')](function(){})[_0x65c2('0x30')](_0x40fd3b()));}}}return _0x230dc2;})[_0x65c2('0x55')]();})[_0x65c2('0x2d')](function(){return db['Campaign']['findAll']({'attributes':['id'],'include':[{'model':db[_0x65c2('0x57')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x65c2('0x2d')](function(_0x5ee5da){var _0x21fdc7=[];if(_0x5ee5da){for(var _0x178122=0x0,_0x25d8e3;_0x178122<_0x5ee5da[_0x65c2('0x19')];_0x178122+=0x1){_0x25d8e3=_0x5ee5da[_0x178122][_0x65c2('0x4f')]({'plain':!![]});_0x21fdc7[_0x65c2('0x2e')](db[_0x65c2('0x51')]['query'](_0x2161df(_0x25d8e3,_0x65c2('0x5a')))[_0x65c2('0x2d')](function(){})[_0x65c2('0x30')](_0x40fd3b()));}}return _0x21fdc7;})[_0x65c2('0x55')]();})[_0x65c2('0x30')](function(_0x38b88e){logger[_0x65c2('0x17')](_0x65c2('0x5b'),_0x65c2('0x5c'),_0x38b88e['message']);});}var processPromises=function(_0x46d8ee){return BPromise['all'](promises)[_0x65c2('0x2d')](function(_0x2d6c0f){})[_0x65c2('0x30')](function(_0x8395da){logger[_0x65c2('0x17')](_0x65c2('0x5d'),JSON[_0x65c2('0x32')](_0x8395da));})[_0x65c2('0x5e')](function(){socket[_0x65c2('0x5f')](_0x65c2('0x60')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x46d8ee){return _0x46d8ee[_0x65c2('0x61')]();}});};var endCsv=function(){return BPromise[_0x65c2('0x62')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x65c2('0x2d')](function(){socket[_0x65c2('0x5f')](_0x65c2('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x65c2('0x63')](FILEPATH);}catch(_0x4ccbc1){logger[_0x65c2('0x17')](_0x65c2('0x64'),JSON[_0x65c2('0x32')](_0x4ccbc1));}finally{process['exit'](0x0);}});};process['on'](_0x65c2('0x65'),function(){logger[_0x65c2('0x66')](_0x65c2('0x67'));endCsv();});function main(){return BPromise[_0x65c2('0x62')]()[_0x65c2('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x65c2('0x11')](',');return db[_0x65c2('0x2b')][_0x65c2('0x56')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x65c2('0x2d')](function(_0x2003df){var _0x377416=fs[_0x65c2('0x68')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x65c2('0x69')](_0x377416,{'header':!![],'skipEmptyLines':!![],'step':function(_0x491792,_0x40ff1f){total+=0x1;var _0x43dd83=total;promises['push'](checkRow(_0x491792,_0x2003df,_0x43dd83)[_0x65c2('0x2d')](function(){success+=0x1;})['catch'](function(_0x540df5){if(_0x540df5[_0x65c2('0x17')]){errors+=0x1;delete _0x540df5[_0x65c2('0x17')];}else if(_0x540df5[_0x65c2('0x29')]){duplicates+=0x1;delete _0x540df5[_0x65c2('0x29')];}rows[_0x65c2('0x2e')](_0x540df5);}));if(total%0xc8===0x0){_0x40ff1f['pause']();return processPromises(_0x40ff1f);}},'complete':function(){return processPromises()[_0x65c2('0x2d')](function(){logger[_0x65c2('0x66')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x5f0ada,_0x334d7f){logger['info'](_0x65c2('0x6a'),JSON['stringify'](_0x5f0ada));endCsv();}});})[_0x65c2('0x30')](function(_0x6b1b6e){logger[_0x65c2('0x17')](_0x65c2('0x6b'),JSON[_0x65c2('0x32')](_0x6b1b6e));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 7b31849..cf4f5a0 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 _0x6228=['cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.id','ListId\x20=\x20?','\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','info','error','message','exit','errors','code','sequelize','query','spread','push','catch','main','stringify','send','start','binding','socket_timestamp','server/files/tmp','.csv','header','parse','createReadStream','length','rows','data','replace','scheduledat','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','appendFileSync','emit','contact:import:','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil','DROP\x20TABLE\x20','voice_queues','voice_queues_has_cm_blacklists','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId','each','then','finish','affectedRows','unlink','argv','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','lodash','papaparse','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','createdAt','updatedAt','UserId','fields','from','cm_contacts'];(function(_0x242141,_0x2f7b82){var _0x20d352=function(_0x185bd7){while(--_0x185bd7){_0x242141['push'](_0x242141['shift']());}};_0x20d352(++_0x2f7b82);}(_0x6228,0xe2));var _0x8622=function(_0x1a88c1,_0x3d0850){_0x1a88c1=_0x1a88c1-0x0;var _0x1c92e5=_0x6228[_0x1a88c1];return _0x1c92e5;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x8622('0x0'));var Papa=require(_0x8622('0x1'));var util=require('util');var BPromise=require(_0x8622('0x2'));var moment=require(_0x8622('0x3'));var squel=require(_0x8622('0x4'));var Redis=require('ioredis');var db=require(_0x8622('0x5'))['db'];var config=require(_0x8622('0x6'));var logger=require(_0x8622('0x7'))(_0x8622('0x8'));config[_0x8622('0x9')]=_[_0x8622('0xa')](config[_0x8622('0x9')],{'host':_0x8622('0xb'),'port':0x18eb});var socket=require(_0x8622('0xc'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x8622('0xd')](_0x8622('0xe'));function isEmail(_0x373285){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))*$/[_0x8622('0xf')](_0x373285);}function selectNotIn(_0x21bbc4,_0x3d6a65,_0x2ddd97,_0x20c56b,_0x7047d){return squel[_0x8622('0x10')]()[_0x8622('0x11')]('phone')['from'](_0x20c56b)[_0x8622('0x12')](_0x3d6a65,null,_0x3d6a65+_0x8622('0x13')+_0x20c56b+'.'+_0x2ddd97)[_0x8622('0x14')](_0x20c56b+'.'+_0x2ddd97+_0x8622('0x15')+_0x21bbc4+'.'+_0x2ddd97)[_0x8622('0x14')](_0x3d6a65+_0x8622('0x16')+_0x7047d[_0x8622('0x12')]()+')');}function insertCmHopper(_0x3e49aa,_0x5ac286,_0x1511d7,_0x37493f,_0x45b9b1){var _0x98d857=[_0x8622('0x17'),_0x8622('0x18'),'cm_contacts.id','cm_contacts.ListId',_0x5ac286+'.'+_0x37493f,_0x8622('0x19'),_0x8622('0x1a'),_0x8622('0x1b'),_0x8622('0x1c'),'\x22'+_0x45b9b1+'\x22'];return squel[_0x8622('0x1d')]()[_0x8622('0x1e')](_0x8622('0x1f'))[_0x8622('0x20')]([_0x8622('0x21'),'scheduledat',_0x8622('0x22'),_0x8622('0x23'),_0x37493f,_0x8622('0x24'),_0x8622('0x25'),'priority',_0x8622('0x26'),'recallme'],squel[_0x8622('0x10')]()[_0x8622('0x27')](_0x98d857)[_0x8622('0x28')](_0x5ac286)[_0x8622('0x12')](_0x8622('0x29'),null,_0x8622('0x2a')+_0x5ac286+_0x8622('0x2b'))[_0x8622('0x12')](_0x1511d7,null,_0x1511d7+_0x8622('0x13')+_0x5ac286+'.'+_0x37493f)['where'](_0x5ac286+_0x8622('0x2c'),_0x3e49aa)[_0x8622('0x14')](_0x8622('0x2d'),NOW)[_0x8622('0x14')](_0x8622('0x2e'),selectNotIn(_0x5ac286,_0x1511d7,_0x37493f,'cm_hopper',[_0x8622('0x2f'),_0x8622('0x30')]))[_0x8622('0x14')](_0x8622('0x2e'),selectNotIn(_0x5ac286,_0x1511d7,_0x37493f,_0x8622('0x1f'),[_0x8622('0x2f')])))[_0x8622('0x31')]();}function insertCmHopperBlack(_0x3d66ae,_0x1cff23,_0x30fd38,_0x3a49e4){var _0x1947ca=[_0x8622('0x17'),_0x8622('0x32'),'cm_contacts.ListId',_0x1cff23+'.'+_0x3a49e4,_0x8622('0x19'),_0x8622('0x1a')];return squel[_0x8622('0x1d')]()[_0x8622('0x1e')]('cm_hopper_black')[_0x8622('0x20')](['phone',_0x8622('0x22'),_0x8622('0x23'),_0x3a49e4,_0x8622('0x24'),_0x8622('0x25')],squel['select']()[_0x8622('0x27')](_0x1947ca)[_0x8622('0x28')](_0x1cff23)['join'](_0x8622('0x29'),null,_0x8622('0x2a')+_0x1cff23+_0x8622('0x2b'))['join'](_0x30fd38,null,_0x30fd38+_0x8622('0x13')+_0x1cff23+'.'+_0x3a49e4)[_0x8622('0x14')](_0x1cff23+_0x8622('0x2c'),_0x3d66ae)[_0x8622('0x14')](_0x8622('0x2d'),NOW)[_0x8622('0x14')](_0x8622('0x2e'),squel['select']()['field']('phone')['from']('cm_hopper_black')[_0x8622('0x14')](_0x8622('0x33'),_0x3d66ae)['where'](_0x3a49e4+_0x8622('0x34'),_0x1cff23+'.'+_0x3a49e4)))['toString']();}function insertCmContact(_0x52bfd4,_0x1af010,_0x5816b7,_0x4092e3){var _0x46fedf=_['concat'](_[_0x8622('0x35')](_0x4092e3),['ListId',_0x8622('0x36'),_0x8622('0x24'),'updatedAt']);return squel[_0x8622('0x1d')]()[_0x8622('0x1e')](_0x8622('0x29'))[_0x8622('0x20')](_0x46fedf,squel[_0x8622('0x10')]()['fields'](_0x46fedf)[_0x8622('0x28')](_0x1af010)[_0x8622('0x14')]('('+_0x5816b7[_0x8622('0x12')](',')+_0x8622('0x37'),squel[_0x8622('0x10')]()[_0x8622('0x27')](_0x5816b7)[_0x8622('0x28')](_0x8622('0x29'))[_0x8622('0x14')]('ListId\x20=\x20?',_0x52bfd4)[_0x8622('0x14')](_0x8622('0x38')))[_0x8622('0x14')](_0x8622('0x39'),squel[_0x8622('0x10')]()[_0x8622('0x11')](_0x8622('0x3a'),_0x8622('0x3b'))[_0x8622('0x28')](_0x1af010)['group'](_0x5816b7[_0x8622('0x12')](','))))[_0x8622('0x31')]();}function handleStop(){logger[_0x8622('0x3c')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x2826de){logger[_0x8622('0x3d')](_0x2826de[_0x8622('0x3e')]);process[_0x8622('0x3f')](0x1);}function handleError(_0x41c059,_0x1d2e12){stats[_0x8622('0x40')]['push']({'name':_0x1d2e12[_0x8622('0x41')],'message':_0x1d2e12[_0x8622('0x3e')],'row':_0x41c059});}function handleQuery(_0x3d5c21){logger['info'](_0x3d5c21);return db[_0x8622('0x42')][_0x8622('0x43')](_0x3d5c21)[_0x8622('0x44')](function(_0x3a952e){results[_0x8622('0x45')](_0x3a952e);})[_0x8622('0x46')](function(_0x5cd316){logger[_0x8622('0x3d')](_0x5cd316['message']);});}function main(_0x3e6dde,_0x141fc9,_0xc6f9b4,_0x2e6cb2){logger[_0x8622('0x3c')](_0x8622('0x47'),_0x3e6dde,JSON[_0x8622('0x48')](_0x141fc9));process[_0x8622('0x49')](_0x8622('0x4a'));var _0x15911d=_0x141fc9[_0x8622('0x4b')];var _0xa9bf9f=_0x141fc9[_0x8622('0x4c')];var _0xa93995=path[_0x8622('0x12')](config['root'],_0x8622('0x4d'),_0xa9bf9f+_0x8622('0x4e'));var _0x366339=_[_0x8622('0x35')](_0x15911d)[_0x8622('0x12')]();logger[_0x8622('0x3c')](_0x8622('0x4f'),_0x366339);fs['writeFileSync'](_0xa93995,_0x366339+'\x0a');Papa[_0x8622('0x50')](fs[_0x8622('0x51')](_0x3e6dde),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2a876f,_0x50f901){try{for(var _0x44f7ca=0x0,_0x214bf4=[];_0x44f7ca<_0x2a876f['data'][_0x8622('0x52')];_0x44f7ca++){stats[_0x8622('0x53')]+=0x1;if(_0x2a876f[_0x8622('0x40')][_0x44f7ca]){handleError(_0x2a876f[_0x8622('0x54')][_0x44f7ca],_0x2a876f[_0x8622('0x40')][_0x44f7ca]);}else{var _0x323ad0=[];for(var _0x334c70 in _0x15911d){if(_0x15911d['hasOwnProperty'](_0x334c70)){if(_0x2a876f['data'][_0x44f7ca][_0x15911d[_0x334c70]]){var _0x22d43b=_['trim'](_0x2a876f[_0x8622('0x54')][_0x44f7ca][_0x15911d[_0x334c70]][_0x8622('0x55')](/"/g,'\x27'));switch(_0x334c70){case _0x8622('0x56'):var _0x4fafd1=moment(_0x22d43b,_0x8622('0xe'),!![]);if(_0x4fafd1['isValid']()){_0x214bf4[_0x8622('0x45')]('\x22'+_0x22d43b+'\x22');}else{_0x323ad0['push'](_0x8622('0x57'));}break;case _0x8622('0x58'):var _0x49a69d=parseInt(_0x22d43b);_0x22d43b=_[_0x8622('0x59')](_0x49a69d)||_0x49a69d<0x0||_0x49a69d>0x4?_0x2e6cb2?0x3:0x2:_0x49a69d;_0x214bf4['push']('\x22'+_0x22d43b+'\x22');break;case _0x8622('0x26'):var _0x11d9a1=parseInt(_0x22d43b);if(_['isNumber'](_0x11d9a1)&&_['includes'](_0xc6f9b4,_0x11d9a1)){_0x214bf4[_0x8622('0x45')]('\x22'+_0x11d9a1+'\x22');}else{_0x323ad0[_0x8622('0x45')](_0x8622('0x5a'));}break;case _0x8622('0x5b'):if(isEmail(_0x22d43b)){_0x214bf4['push']('\x22'+_0x22d43b+'\x22');}else{_0x323ad0['push'](_0x8622('0x5c'));}break;case _0x8622('0x5d'):var _0x24a939=moment(_0x22d43b,'YYYY-MM-DD',!![]);if(_0x24a939[_0x8622('0x5e')]()){_0x214bf4[_0x8622('0x45')]('\x22'+_0x22d43b+'\x22');}else{_0x323ad0[_0x8622('0x45')](_0x8622('0x5f'));}break;default:_0x214bf4[_0x8622('0x45')]('\x22'+_0x22d43b+'\x22');}}else{switch(_0x334c70){case _0x8622('0x60'):case _0x8622('0x21'):_0x323ad0[_0x8622('0x45')](_0x334c70+_0x8622('0x61'));break;default:_0x214bf4[_0x8622('0x45')]('\x22\x22');}}}}if(_0x323ad0['length']){handleError(_0x2a876f[_0x8622('0x54')][_0x44f7ca],{'code':'SystemRow','message':_0x323ad0['join']()});}else{fs[_0x8622('0x62')](_0xa93995,_0x214bf4['join']()+'\x0a');}_0x214bf4=[];}if(!(stats[_0x8622('0x53')]%0xc8)){socket[_0x8622('0x63')](_0x8622('0x64')+_0xa9bf9f,stats);stats[_0x8622('0x40')]=[];}}if(stopped){logger['info']('Abort\x20parser');_0x50f901[_0x8622('0x65')]();}}catch(_0x982cc){handleError(_0x2a876f[_0x8622('0x54')][_0x44f7ca],{'code':_0x8622('0x66'),'message':_0x982cc[_0x8622('0x3e')]});logger[_0x8622('0x3d')](_0x8622('0x67'),_0x982cc[_0x8622('0x3e')]);}},'complete':function(){try{var _0x510245=[];var _0x4bf42c=_0x8622('0x29');if(_0x141fc9['duplicates']&&_0x141fc9[_0x8622('0x68')]['length']){_0x4bf42c=_0x8622('0x69')+_0xa9bf9f;_0x510245['push'](_0x8622('0x6a')+_0x4bf42c+_0x8622('0x6b'));}var _0x14a0f5=util[_0x8622('0xd')](_0x8622('0x6c'),_0xa93995,_0x4bf42c,_0x366339,_0x141fc9['ListId'],_0x141fc9['CompanyId']||null,NOW,NOW);if(_[_0x8622('0x6d')](_0x15911d[_0x8622('0x56')])){_0x14a0f5+=',\x20scheduledAt\x20=\x20NOW()';}_0x510245['push'](_0x14a0f5);if(_0x141fc9[_0x8622('0x68')]&&_0x141fc9[_0x8622('0x68')][_0x8622('0x52')]){_0x510245[_0x8622('0x45')](insertCmContact(_0x141fc9[_0x8622('0x23')],_0x4bf42c,_0x141fc9[_0x8622('0x68')],_0x15911d));_0x510245['push'](_0x8622('0x6e')+_0x4bf42c+';');}_0x510245['push'](insertCmHopper(_0x141fc9[_0x8622('0x23')],'voice_queues_has_cm_lists',_0x8622('0x6f'),'VoiceQueueId',_0x2e6cb2));_0x510245[_0x8622('0x45')](insertCmHopperBlack(_0x141fc9[_0x8622('0x23')],_0x8622('0x70'),_0x8622('0x6f'),_0x8622('0x71')));_0x510245[_0x8622('0x45')](insertCmHopper(_0x141fc9[_0x8622('0x23')],_0x8622('0x72'),_0x8622('0x73'),_0x8622('0x74'),_0x2e6cb2));_0x510245[_0x8622('0x45')](insertCmHopperBlack(_0x141fc9[_0x8622('0x23')],'campaigns_has_cm_blacklists',_0x8622('0x73'),_0x8622('0x74')));BPromise[_0x8622('0x75')](_0x510245,handleQuery)[_0x8622('0x76')](function(_0x1b826b){stats[_0x8622('0x77')]=!![];stats[_0x8622('0x78')]=_0x141fc9[_0x8622('0x68')]&&_0x141fc9[_0x8622('0x68')][_0x8622('0x52')]?results[0x2][_0x8622('0x78')]:results[0x0][_0x8622('0x78')];socket['emit'](_0x8622('0x64')+_0xa9bf9f,stats);fs['unlink'](_0x3e6dde);fs[_0x8622('0x79')](_0xa93995);process['exit'](0x0);})[_0x8622('0x46')](function(_0x45ad6a){logger[_0x8622('0x3d')](_0x45ad6a['message']);process[_0x8622('0x3f')](0x1);});}catch(_0x3eca43){logger[_0x8622('0x3d')]('complete',_0x3eca43[_0x8622('0x3e')]);process[_0x8622('0x3f')](0x1);}},'error':function(_0x188a3b,_0x323d68,_0x2f220a,_0x195c8d){throw new Error(_0x195c8d);}});}function validate(){if(process['argv']&&process[_0x8622('0x7a')][_0x8622('0x52')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x5e1cc2=path[_0x8622('0x12')](config[_0x8622('0x7b')],_0x8622('0x4d'),process[_0x8622('0x7a')][0x2]);if(!fs[_0x8622('0x7c')](_0x5e1cc2)){throw new Error(_0x8622('0x7d'));}var _0x40e2dc={};try{_0x40e2dc=JSON[_0x8622('0x50')](process[_0x8622('0x7a')][0x3]);if(!_0x40e2dc['binding']){throw new Error(_0x8622('0x7e'));}if(!_0x40e2dc[_0x8622('0x4b')][_0x8622('0x21')]){throw new Error(_0x8622('0x7f'));}if(!_0x40e2dc['binding']['firstName']){throw new Error(_0x8622('0x80'));}var _0x205c6d=0x0;if(_0x40e2dc[_0x8622('0x4b')][_0x8622('0x26')]){_0x205c6d=0x1;}if(!_0x40e2dc[_0x8622('0x23')]){throw new Error(_0x8622('0x81'));}}catch(_0x2b4d19){throw new Error(_0x8622('0x82'));}var _0x9f58eb=[];try{_0x9f58eb=_[_0x8622('0x83')](JSON['parse'](process[_0x8622('0x7a')][0x4]),'id');}catch(_0x3a1bf0){logger['info'](_0x8622('0x84'));}main(_0x5e1cc2,_0x40e2dc,_0x9f58eb,_0x205c6d);}validate();process['on'](_0x8622('0x85'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0x050e=['.id\x20=\x20','where','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','phone','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','toString','cm_contacts.phone','cm_contacts.updatedAt','cm_hopper_black','fields','cm_contacts.ListId\x20=\x20','field','ListId\x20=\x20?','concat','keys',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','exit','errors','code','message','sequelize','query','push','catch','stringify','send','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','data','length','hasOwnProperty','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','SystemRow','rows','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','format','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','voice_queues','campaigns','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','complete','argv','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','import','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','select','from','join'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x050e,0x6e));var _0xe050=function(_0x283c87,_0x545688){_0x283c87=_0x283c87-0x0;var _0xde4143=_0x050e[_0x283c87];return _0xde4143;};'use strict';var fs=require('fs');var path=require('path');var _=require('lodash');var Papa=require(_0xe050('0x0'));var util=require(_0xe050('0x1'));var BPromise=require(_0xe050('0x2'));var moment=require(_0xe050('0x3'));var squel=require(_0xe050('0x4'));var Redis=require(_0xe050('0x5'));var db=require(_0xe050('0x6'))['db'];var config=require(_0xe050('0x7'));var logger=require('../../../config/logger')(_0xe050('0x8'));config[_0xe050('0x9')]=_[_0xe050('0xa')](config['redis'],{'host':_0xe050('0xb'),'port':0x18eb});var socket=require(_0xe050('0xc'))(new Redis(config[_0xe050('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0xe050('0xd'));function isEmail(_0x249a92){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))*$/[_0xe050('0xe')](_0x249a92);}function selectNotIn(_0x5b9aae,_0x19bced,_0x1d7e4f,_0x1b6c40,_0x26055a){return squel[_0xe050('0xf')]()['field']('phone')[_0xe050('0x10')](_0x1b6c40)[_0xe050('0x11')](_0x19bced,null,_0x19bced+_0xe050('0x12')+_0x1b6c40+'.'+_0x1d7e4f)[_0xe050('0x13')](_0x1b6c40+'.'+_0x1d7e4f+'\x20=\x20'+_0x5b9aae+'.'+_0x1d7e4f)[_0xe050('0x13')](_0x19bced+'.dialCheckDuplicateType\x20IN\x20('+_0x26055a[_0xe050('0x11')]()+')');}function insertCmHopper(_0x1f9078,_0x200184,_0x1194fb,_0x1828d5,_0x5ed641){var _0x44e540=['cm_contacts.phone',_0xe050('0x14'),_0xe050('0x15'),_0xe050('0x16'),_0x200184+'.'+_0x1828d5,_0xe050('0x17'),'cm_contacts.updatedAt',_0xe050('0x18'),_0xe050('0x19'),'\x22'+_0x5ed641+'\x22'];return squel[_0xe050('0x1a')]()[_0xe050('0x1b')](_0xe050('0x1c'))[_0xe050('0x1d')]([_0xe050('0x1e'),_0xe050('0x1f'),_0xe050('0x20'),_0xe050('0x21'),_0x1828d5,_0xe050('0x22'),_0xe050('0x23'),_0xe050('0x24'),_0xe050('0x25'),_0xe050('0x26')],squel[_0xe050('0xf')]()['fields'](_0x44e540)[_0xe050('0x10')](_0x200184)[_0xe050('0x11')](_0xe050('0x27'),null,'cm_contacts.ListId\x20=\x20'+_0x200184+_0xe050('0x28'))[_0xe050('0x11')](_0x1194fb,null,_0x1194fb+_0xe050('0x12')+_0x200184+'.'+_0x1828d5)[_0xe050('0x13')](_0x200184+_0xe050('0x29'),_0x1f9078)[_0xe050('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xe050('0x13')](_0xe050('0x2a'),selectNotIn(_0x200184,_0x1194fb,_0x1828d5,_0xe050('0x1c'),['\x22always\x22',_0xe050('0x2b')]))['where'](_0xe050('0x2a'),selectNotIn(_0x200184,_0x1194fb,_0x1828d5,_0xe050('0x1c'),['\x22always\x22'])))[_0xe050('0x2c')]();}function insertCmHopperBlack(_0x26350d,_0x4d6a47,_0x1ad867,_0x9dba71){var _0x305eff=[_0xe050('0x2d'),_0xe050('0x15'),_0xe050('0x16'),_0x4d6a47+'.'+_0x9dba71,_0xe050('0x17'),_0xe050('0x2e')];return squel[_0xe050('0x1a')]()[_0xe050('0x1b')](_0xe050('0x2f'))[_0xe050('0x1d')]([_0xe050('0x1e'),_0xe050('0x20'),'ListId',_0x9dba71,'createdAt',_0xe050('0x23')],squel[_0xe050('0xf')]()[_0xe050('0x30')](_0x305eff)[_0xe050('0x10')](_0x4d6a47)[_0xe050('0x11')](_0xe050('0x27'),null,_0xe050('0x31')+_0x4d6a47+_0xe050('0x28'))[_0xe050('0x11')](_0x1ad867,null,_0x1ad867+_0xe050('0x12')+_0x4d6a47+'.'+_0x9dba71)[_0xe050('0x13')](_0x4d6a47+_0xe050('0x29'),_0x26350d)[_0xe050('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xe050('0x13')](_0xe050('0x2a'),squel[_0xe050('0xf')]()[_0xe050('0x32')]('phone')['from'](_0xe050('0x2f'))[_0xe050('0x13')](_0xe050('0x33'),_0x26350d)[_0xe050('0x13')](_0x9dba71+'\x20=\x20?',_0x4d6a47+'.'+_0x9dba71)))['toString']();}function insertCmContact(_0x521a4b,_0x298143,_0x376322,_0x2189ce){var _0x2be6fd=_[_0xe050('0x34')](_[_0xe050('0x35')](_0x2189ce),[_0xe050('0x21'),'CompanyId',_0xe050('0x22'),_0xe050('0x23')]);return squel[_0xe050('0x1a')]()[_0xe050('0x1b')](_0xe050('0x27'))[_0xe050('0x1d')](_0x2be6fd,squel[_0xe050('0xf')]()[_0xe050('0x30')](_0x2be6fd)[_0xe050('0x10')](_0x298143)[_0xe050('0x13')]('('+_0x376322['join'](',')+_0xe050('0x36'),squel[_0xe050('0xf')]()['fields'](_0x376322)[_0xe050('0x10')](_0xe050('0x27'))[_0xe050('0x13')]('ListId\x20=\x20?',_0x521a4b)['where']('deletedAt\x20IS\x20NULL'))[_0xe050('0x13')](_0xe050('0x37'),squel[_0xe050('0xf')]()[_0xe050('0x32')](_0xe050('0x38'),_0xe050('0x39'))[_0xe050('0x10')](_0x298143)[_0xe050('0x3a')](_0x376322[_0xe050('0x11')](','))))[_0xe050('0x2c')]();}function handleStop(){logger[_0xe050('0x3b')](_0xe050('0x3c'));stopped=!![];}function handleUncaughtException(_0x507135){logger[_0xe050('0x3d')](_0x507135['message']);process[_0xe050('0x3e')](0x1);}function handleError(_0x50f0c7,_0x26ea9b){stats[_0xe050('0x3f')]['push']({'name':_0x26ea9b[_0xe050('0x40')],'message':_0x26ea9b[_0xe050('0x41')],'row':_0x50f0c7});}function handleQuery(_0x15fd76){logger['info'](_0x15fd76);return db[_0xe050('0x42')][_0xe050('0x43')](_0x15fd76)['spread'](function(_0x40c77a){results[_0xe050('0x44')](_0x40c77a);})[_0xe050('0x45')](function(_0x567e75){logger[_0xe050('0x3d')](_0x567e75[_0xe050('0x41')]);});}function main(_0xa6ce60,_0x5bf7b9,_0x3170b0,_0x331ee0){logger[_0xe050('0x3b')]('main',_0xa6ce60,JSON[_0xe050('0x46')](_0x5bf7b9));process[_0xe050('0x47')]('start');var _0x27bb99=_0x5bf7b9['binding'];var _0x23914c=_0x5bf7b9[_0xe050('0x48')];var _0x31cf1f=path[_0xe050('0x11')](config[_0xe050('0x49')],_0xe050('0x4a'),_0x23914c+_0xe050('0x4b'));var _0x488f69=_[_0xe050('0x35')](_0x27bb99)[_0xe050('0x11')]();logger[_0xe050('0x3b')](_0xe050('0x4c'),_0x488f69);fs[_0xe050('0x4d')](_0x31cf1f,_0x488f69+'\x0a');Papa[_0xe050('0x4e')](fs[_0xe050('0x4f')](_0xa6ce60),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2c4272,_0x20ea7e){try{for(var _0x5785b0=0x0,_0x6a1612=[];_0x5785b0<_0x2c4272[_0xe050('0x50')][_0xe050('0x51')];_0x5785b0++){stats['rows']+=0x1;if(_0x2c4272['errors'][_0x5785b0]){handleError(_0x2c4272[_0xe050('0x50')][_0x5785b0],_0x2c4272['errors'][_0x5785b0]);}else{var _0x45cea3=[];for(var _0x5f04f4 in _0x27bb99){if(_0x27bb99[_0xe050('0x52')](_0x5f04f4)){if(_0x2c4272[_0xe050('0x50')][_0x5785b0][_0x27bb99[_0x5f04f4]]){var _0x16b58a=_['trim'](_0x2c4272[_0xe050('0x50')][_0x5785b0][_0x27bb99[_0x5f04f4]][_0xe050('0x53')](/"/g,'\x27'));switch(_0x5f04f4){case _0xe050('0x1f'):var _0x2f2684=moment(_0x16b58a,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x2f2684[_0xe050('0x54')]()){_0x6a1612['push']('\x22'+_0x16b58a+'\x22');}else{_0x45cea3[_0xe050('0x44')](_0xe050('0x55'));}break;case _0xe050('0x24'):var _0x9915f6=parseInt(_0x16b58a);_0x16b58a=_['isNaN'](_0x9915f6)||_0x9915f6<0x0||_0x9915f6>0x4?_0x331ee0?0x3:0x2:_0x9915f6;_0x6a1612['push']('\x22'+_0x16b58a+'\x22');break;case _0xe050('0x25'):var _0x563814=parseInt(_0x16b58a);if(_[_0xe050('0x56')](_0x563814)&&_[_0xe050('0x57')](_0x3170b0,_0x563814)){_0x6a1612[_0xe050('0x44')]('\x22'+_0x563814+'\x22');}else{_0x45cea3['push'](_0xe050('0x58'));}break;case _0xe050('0x59'):if(isEmail(_0x16b58a)){_0x6a1612[_0xe050('0x44')]('\x22'+_0x16b58a+'\x22');}else{_0x45cea3['push'](_0xe050('0x5a'));}break;case'dateOfBirth':var _0x3ce9f4=moment(_0x16b58a,'YYYY-MM-DD',!![]);if(_0x3ce9f4[_0xe050('0x54')]()){_0x6a1612[_0xe050('0x44')]('\x22'+_0x16b58a+'\x22');}else{_0x45cea3[_0xe050('0x44')](_0xe050('0x5b'));}break;default:_0x6a1612[_0xe050('0x44')]('\x22'+_0x16b58a+'\x22');}}else{switch(_0x5f04f4){case _0xe050('0x5c'):case _0xe050('0x1e'):_0x45cea3[_0xe050('0x44')](_0x5f04f4+'\x20not\x20specified');break;default:_0x6a1612[_0xe050('0x44')]('\x22\x22');}}}}if(_0x45cea3['length']){handleError(_0x2c4272['data'][_0x5785b0],{'code':_0xe050('0x5d'),'message':_0x45cea3[_0xe050('0x11')]()});}else{fs['appendFileSync'](_0x31cf1f,_0x6a1612[_0xe050('0x11')]()+'\x0a');}_0x6a1612=[];}if(!(stats[_0xe050('0x5e')]%0xc8)){socket[_0xe050('0x5f')](_0xe050('0x60')+_0x23914c,stats);stats['errors']=[];}}if(stopped){logger[_0xe050('0x3b')](_0xe050('0x61'));_0x20ea7e[_0xe050('0x62')]();}}catch(_0x5521e1){handleError(_0x2c4272[_0xe050('0x50')][_0x5785b0],{'code':_0xe050('0x63'),'message':_0x5521e1[_0xe050('0x41')]});logger[_0xe050('0x3d')](_0xe050('0x64'),_0x5521e1[_0xe050('0x41')]);}},'complete':function(){try{var _0x1ba53b=[];var _0x4e8cd3='cm_contacts';if(_0x5bf7b9[_0xe050('0x65')]&&_0x5bf7b9[_0xe050('0x65')][_0xe050('0x51')]){_0x4e8cd3=_0xe050('0x66')+_0x23914c;_0x1ba53b['push']('CREATE\x20TABLE\x20'+_0x4e8cd3+'\x20LIKE\x20cm_contacts;');}var _0x49b477=util[_0xe050('0x67')](_0xe050('0x68'),_0x31cf1f,_0x4e8cd3,_0x488f69,_0x5bf7b9[_0xe050('0x21')],_0x5bf7b9[_0xe050('0x69')]||null,NOW,NOW);if(_['isNil'](_0x27bb99[_0xe050('0x1f')])){_0x49b477+=',\x20scheduledAt\x20=\x20NOW()';}_0x1ba53b['push'](_0x49b477);if(_0x5bf7b9['duplicates']&&_0x5bf7b9['duplicates'][_0xe050('0x51')]){_0x1ba53b[_0xe050('0x44')](insertCmContact(_0x5bf7b9[_0xe050('0x21')],_0x4e8cd3,_0x5bf7b9[_0xe050('0x65')],_0x27bb99));_0x1ba53b[_0xe050('0x44')](_0xe050('0x6a')+_0x4e8cd3+';');}_0x1ba53b[_0xe050('0x44')](insertCmHopper(_0x5bf7b9[_0xe050('0x21')],_0xe050('0x6b'),'voice_queues',_0xe050('0x6c'),_0x331ee0));_0x1ba53b[_0xe050('0x44')](insertCmHopperBlack(_0x5bf7b9['ListId'],_0xe050('0x6d'),_0xe050('0x6e'),_0xe050('0x6c')));_0x1ba53b[_0xe050('0x44')](insertCmHopper(_0x5bf7b9[_0xe050('0x21')],'campaigns_has_cm_lists',_0xe050('0x6f'),_0xe050('0x70'),_0x331ee0));_0x1ba53b['push'](insertCmHopperBlack(_0x5bf7b9[_0xe050('0x21')],_0xe050('0x71'),_0xe050('0x6f'),'CampaignId'));BPromise['each'](_0x1ba53b,handleQuery)['then'](function(_0x4651ed){stats[_0xe050('0x72')]=!![];stats[_0xe050('0x73')]=_0x5bf7b9[_0xe050('0x65')]&&_0x5bf7b9['duplicates'][_0xe050('0x51')]?results[0x2]['affectedRows']:results[0x0]['affectedRows'];socket[_0xe050('0x5f')](_0xe050('0x60')+_0x23914c,stats);fs[_0xe050('0x74')](_0xa6ce60);fs['unlink'](_0x31cf1f);process[_0xe050('0x3e')](0x0);})[_0xe050('0x45')](function(_0x28bb14){logger[_0xe050('0x3d')](_0x28bb14[_0xe050('0x41')]);process[_0xe050('0x3e')](0x1);});}catch(_0x58179e){logger['error'](_0xe050('0x75'),_0x58179e['message']);process['exit'](0x1);}},'error':function(_0x3b9768,_0x87c7e3,_0x56665d,_0xefed7f){throw new Error(_0xefed7f);}});}function validate(){if(process[_0xe050('0x76')]&&process[_0xe050('0x76')]['length']<0x4){throw new Error('arguments\x20\x20\x20');}var _0x259e88=path[_0xe050('0x11')](config[_0xe050('0x49')],_0xe050('0x4a'),process[_0xe050('0x76')][0x2]);if(!fs[_0xe050('0x77')](_0x259e88)){throw new Error(_0xe050('0x78'));}var _0x48bdf6={};try{_0x48bdf6=JSON[_0xe050('0x4e')](process['argv'][0x3]);if(!_0x48bdf6[_0xe050('0x79')]){throw new Error(_0xe050('0x7a'));}if(!_0x48bdf6[_0xe050('0x79')]['phone']){throw new Error('phone\x20is\x20mandatory');}if(!_0x48bdf6['binding']['firstName']){throw new Error(_0xe050('0x7b'));}var _0x50d989=0x0;if(_0x48bdf6[_0xe050('0x79')][_0xe050('0x25')]){_0x50d989=0x1;}if(!_0x48bdf6[_0xe050('0x21')]){throw new Error(_0xe050('0x7c'));}}catch(_0x1c55fb){throw new Error(_0xe050('0x7d'));}var _0x48d8a3=[];try{_0x48d8a3=_[_0xe050('0x7e')](JSON['parse'](process[_0xe050('0x76')][0x4]),'id');}catch(_0x534f0d){logger[_0xe050('0x3b')](_0xe050('0x7f'));}main(_0x259e88,_0x48bdf6,_0x48d8a3,_0x50d989);}validate();process['on']('SIGINT',handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 173b809..9992dca 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 _0x594e=['membername','starttime','Complete\x20Time','endtime','Duration','duration','billableseconds','string','[xCALLY\x20Ticket]','toLowerCase','inbound','variable','queue','calleridnum','push','Outbound\x20Call','destcalleridnum','getDescriptions','voice','Caller\x20Number','Caller\x20Name','calleridname','destexten','Queue','keyValue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentconnectAt','Hold\x20Time','Talk\x20Time','***\x20Call\x20Info\x20***','Called\x20Number','Member\x20Name'];(function(_0x16b08f,_0x36b3e4){var _0x1c7583=function(_0x473892){while(--_0x473892){_0x16b08f['push'](_0x16b08f['shift']());}};_0x1c7583(++_0x36b3e4);}(_0x594e,0x11f));var _0xe594=function(_0x423f6f,_0x24857b){_0x423f6f=_0x423f6f-0x0;var _0x49bcad=_0x594e[_0x423f6f];return _0x49bcad;};'use strict';exports['getSubjects']=function(_0x5a3813,_0x23361d){var _0x1b4f5d=[{'type':_0xe594('0x0'),'content':_0xe594('0x1'),'variableName':null}];switch(_0x5a3813[_0xe594('0x2')]()){case'voice':switch(_0x23361d[_0xe594('0x2')]()){case _0xe594('0x3'):_0x1b4f5d['push']({'type':_0xe594('0x4'),'content':'','variableName':_0xe594('0x5')});_0x1b4f5d['push']({'type':'variable','content':'','variableName':_0xe594('0x6')});break;case'outbound':_0x1b4f5d[_0xe594('0x7')]({'type':_0xe594('0x0'),'content':_0xe594('0x8'),'variableName':null});_0x1b4f5d['push']({'type':_0xe594('0x4'),'content':'','variableName':_0xe594('0x9')});break;}}return _0x1b4f5d;};exports[_0xe594('0xa')]=function(_0x3d2667,_0x45932b){var _0x2900b2=[];switch(_0x3d2667[_0xe594('0x2')]()){case _0xe594('0xb'):switch(_0x45932b[_0xe594('0x2')]()){case'inbound':_0x2900b2=[{'type':_0xe594('0x0'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xe594('0xc'),'keyType':_0xe594('0x4'),'variableName':_0xe594('0x6')},{'type':'keyValue','content':'','key':_0xe594('0xd'),'keyType':_0xe594('0x4'),'variableName':_0xe594('0xe')},{'type':'keyValue','content':'','key':'Call\x20To','keyType':_0xe594('0x4'),'variableName':_0xe594('0xf')},{'type':'keyValue','content':'','key':_0xe594('0x10'),'keyType':_0xe594('0x4'),'variableName':_0xe594('0x5')},{'type':_0xe594('0x11'),'content':'','key':_0xe594('0x12'),'keyType':_0xe594('0x4'),'variableName':_0xe594('0x13')},{'type':'keyValue','content':'','key':_0xe594('0x14'),'keyType':_0xe594('0x4'),'variableName':_0xe594('0x15')},{'type':'string','content':_0xe594('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0xe594('0x11'),'content':'','key':'Agent\x20Name','keyType':_0xe594('0x4'),'variableName':_0xe594('0x17')},{'type':_0xe594('0x11'),'content':'','key':_0xe594('0x18'),'keyType':_0xe594('0x4'),'variableName':_0xe594('0x9')},{'type':'string','content':_0xe594('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0xe594('0x11'),'content':'','key':_0xe594('0x1a'),'keyType':_0xe594('0x4'),'variableName':_0xe594('0x15')},{'type':'keyValue','content':'','key':'Agent\x20Connect','keyType':_0xe594('0x4'),'variableName':_0xe594('0x1b')},{'type':_0xe594('0x11'),'content':'','key':'Agent\x20Complete','keyType':_0xe594('0x4'),'variableName':'agentcompleteAt'},{'type':_0xe594('0x11'),'content':'','key':_0xe594('0x1c'),'keyType':_0xe594('0x4'),'variableName':'holdtime'},{'type':'keyValue','content':'','key':_0xe594('0x1d'),'keyType':_0xe594('0x4'),'variableName':'talktime'}];break;case'outbound':_0x2900b2=[{'type':'string','content':_0xe594('0x1e'),'variableName':null},{'type':_0xe594('0x11'),'content':'','key':_0xe594('0x1f'),'keyType':_0xe594('0x4'),'keyContent':'','variableName':'destcalleridnum'},{'type':'keyValue','content':'','key':_0xe594('0x20'),'keyType':'variable','keyContent':'','variableName':_0xe594('0x21')},{'type':_0xe594('0x11'),'content':'','key':_0xe594('0x12'),'keyType':_0xe594('0x4'),'keyContent':'','variableName':_0xe594('0x13')},{'type':'keyValue','content':'','key':_0xe594('0x14'),'keyType':_0xe594('0x4'),'keyContent':'','variableName':_0xe594('0x22')},{'type':_0xe594('0x0'),'content':_0xe594('0x19')},{'type':_0xe594('0x11'),'content':'','key':'Answer\x20Time','keyType':_0xe594('0x4'),'keyContent':'','variableName':'answertime'},{'type':_0xe594('0x11'),'content':'','key':_0xe594('0x23'),'keyType':_0xe594('0x4'),'keyContent':'','variableName':_0xe594('0x24')},{'type':_0xe594('0x11'),'content':'','key':_0xe594('0x25'),'keyType':_0xe594('0x4'),'keyContent':'','variableName':_0xe594('0x26')},{'type':_0xe594('0x11'),'content':'','key':'Billable\x20Time','keyType':'variable','keyContent':'','variableName':_0xe594('0x27')}];break;}}return _0x2900b2;}; \ No newline at end of file +var _0xe198=['UniqueId','uniqueid','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','Agent\x20Complete','holdtime','talktime','Called\x20Number','Member\x20Name','membername','starttime','Answer\x20Time','Complete\x20Time','endtime','duration','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','voice','push','variable','queue','calleridnum','outbound','Outbound\x20Call','destcalleridnum','toLowerCase','inbound','***\x20Call\x20Info\x20***','keyValue','Call\x20To','destexten'];(function(_0x39ff5c,_0x3de001){var _0x1eba54=function(_0x1fcfaa){while(--_0x1fcfaa){_0x39ff5c['push'](_0x39ff5c['shift']());}};_0x1eba54(++_0x3de001);}(_0xe198,0x1b7));var _0x8e19=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xe198[_0x68c979];return _0x4f0001;};'use strict';exports[_0x8e19('0x0')]=function(_0x5afb88,_0x17bce3){var _0x52b517=[{'type':_0x8e19('0x1'),'content':_0x8e19('0x2'),'variableName':null}];switch(_0x5afb88['toLowerCase']()){case _0x8e19('0x3'):switch(_0x17bce3['toLowerCase']()){case'inbound':_0x52b517[_0x8e19('0x4')]({'type':_0x8e19('0x5'),'content':'','variableName':_0x8e19('0x6')});_0x52b517[_0x8e19('0x4')]({'type':_0x8e19('0x5'),'content':'','variableName':_0x8e19('0x7')});break;case _0x8e19('0x8'):_0x52b517[_0x8e19('0x4')]({'type':_0x8e19('0x1'),'content':_0x8e19('0x9'),'variableName':null});_0x52b517[_0x8e19('0x4')]({'type':_0x8e19('0x5'),'content':'','variableName':_0x8e19('0xa')});break;}}return _0x52b517;};exports['getDescriptions']=function(_0x296bc6,_0x201022){var _0x1f7f44=[];switch(_0x296bc6[_0x8e19('0xb')]()){case _0x8e19('0x3'):switch(_0x201022['toLowerCase']()){case _0x8e19('0xc'):_0x1f7f44=[{'type':_0x8e19('0x1'),'content':_0x8e19('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x8e19('0xe'),'content':'','key':'Caller\x20Number','keyType':_0x8e19('0x5'),'variableName':_0x8e19('0x7')},{'type':'keyValue','content':'','key':'Caller\x20Name','keyType':_0x8e19('0x5'),'variableName':'calleridname'},{'type':_0x8e19('0xe'),'content':'','key':_0x8e19('0xf'),'keyType':_0x8e19('0x5'),'variableName':_0x8e19('0x10')},{'type':'keyValue','content':'','key':'Queue','keyType':_0x8e19('0x5'),'variableName':_0x8e19('0x6')},{'type':_0x8e19('0xe'),'content':'','key':_0x8e19('0x11'),'keyType':_0x8e19('0x5'),'variableName':_0x8e19('0x12')},{'type':'keyValue','content':'','key':'Date','keyType':'variable','variableName':_0x8e19('0x13')},{'type':'string','content':_0x8e19('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0x8e19('0xe'),'content':'','key':_0x8e19('0x15'),'keyType':_0x8e19('0x5'),'variableName':'destcalleridname'},{'type':_0x8e19('0xe'),'content':'','key':_0x8e19('0x16'),'keyType':_0x8e19('0x5'),'variableName':'destcalleridnum'},{'type':'string','content':_0x8e19('0x17'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Ring','keyType':_0x8e19('0x5'),'variableName':'agentcalledAt'},{'type':'keyValue','content':'','key':_0x8e19('0x18'),'keyType':_0x8e19('0x5'),'variableName':_0x8e19('0x19')},{'type':_0x8e19('0xe'),'content':'','key':_0x8e19('0x1a'),'keyType':_0x8e19('0x5'),'variableName':'agentcompleteAt'},{'type':'keyValue','content':'','key':'Hold\x20Time','keyType':_0x8e19('0x5'),'variableName':_0x8e19('0x1b')},{'type':_0x8e19('0xe'),'content':'','key':'Talk\x20Time','keyType':'variable','variableName':_0x8e19('0x1c')}];break;case _0x8e19('0x8'):_0x1f7f44=[{'type':_0x8e19('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':'keyValue','content':'','key':_0x8e19('0x1d'),'keyType':_0x8e19('0x5'),'keyContent':'','variableName':_0x8e19('0xa')},{'type':_0x8e19('0xe'),'content':'','key':_0x8e19('0x1e'),'keyType':_0x8e19('0x5'),'keyContent':'','variableName':_0x8e19('0x1f')},{'type':_0x8e19('0xe'),'content':'','key':'UniqueId','keyType':_0x8e19('0x5'),'keyContent':'','variableName':_0x8e19('0x12')},{'type':_0x8e19('0xe'),'content':'','key':'Date','keyType':'variable','keyContent':'','variableName':_0x8e19('0x20')},{'type':_0x8e19('0x1'),'content':_0x8e19('0x17')},{'type':'keyValue','content':'','key':_0x8e19('0x21'),'keyType':'variable','keyContent':'','variableName':'answertime'},{'type':_0x8e19('0xe'),'content':'','key':_0x8e19('0x22'),'keyType':_0x8e19('0x5'),'keyContent':'','variableName':_0x8e19('0x23')},{'type':_0x8e19('0xe'),'content':'','key':'Duration','keyType':_0x8e19('0x5'),'keyContent':'','variableName':_0x8e19('0x24')},{'type':_0x8e19('0xe'),'content':'','key':'Billable\x20Time','keyType':_0x8e19('0x5'),'keyContent':'','variableName':_0x8e19('0x25')}];break;}}return _0x1f7f44;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index a29d086..02760e9 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 _0x0332=['body','omit','html','phone','fax','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','findOne','then','update','info','catch','error','tracked','user','query'];(function(_0x5feb83,_0x25f29e){var _0x3f4d6f=function(_0x15b3dc){while(--_0x15b3dc){_0x5feb83['push'](_0x5feb83['shift']());}};_0x3f4d6f(++_0x25f29e);}(_0x0332,0x198));var _0x2033=function(_0x52dfa5,_0x3908fd){_0x52dfa5=_0x52dfa5-0x0;var _0x1eaf0b=_0x0332[_0x52dfa5];return _0x1eaf0b;};'use strict';var _=require(_0x2033('0x0'));var db=require(_0x2033('0x1'))['db'];var loggers={'openchannel':require(_0x2033('0x2'))(_0x2033('0x3')),'mail':require('../../config/logger')(_0x2033('0x4')),'fax':require('../../config/logger')('fax-interactions'),'sms':require('../../config/logger')(_0x2033('0x5')),'chat':require(_0x2033('0x2'))(_0x2033('0x6')),'whatsapp':require('../../config/logger')(_0x2033('0x7'))};function getInteractionId(_0x23da52,_0x5a5e40,_0x19e688){if(_0x23da52&&_0x23da52[_[_0x2033('0x8')](_0x19e688)+_0x2033('0x9')]){return _0x23da52[_[_0x2033('0x8')](_0x19e688)+_0x2033('0x9')];}else if(_0x23da52&&_0x23da52['id']){return _0x23da52['id'];}else if(_0x5a5e40&&_0x5a5e40['id']){return _0x5a5e40['id'];}else{return _0x2033('0xa');}}function log(_0x4e042c,_0x3e2801,_0x49e9bf,_0x5f4210,_0x120f73,_0x8c672b){loggers[_0x120f73[_0x2033('0xb')]()][_0x4e042c](_0x2033('0xc'),_0x8c672b[_0x2033('0xd')](),_0x3e2801?_0x3e2801['id']:null,_0x3e2801?_0x3e2801[_0x2033('0xe')]:null,_0x3e2801?_0x3e2801[_0x2033('0xf')]:null,getInteractionId(_0x49e9bf,_0x5f4210,_0x120f73),_0x49e9bf?JSON[_0x2033('0x10')](_0x49e9bf):'null');}function updateUser(_0x38614d,_0x1a521f,_0x4b33e8,_0x2c226b,_0x569584){db[_[_0x2033('0x8')](_0x2c226b)+'Interaction'][_0x2033('0x11')]({'where':{'id':getInteractionId(_0x1a521f,_0x4b33e8,_0x2c226b)}})[_0x2033('0x12')](function(_0x358cba){if(_0x358cba){return _0x358cba[_0x2033('0x13')]({'UserId':_0x38614d?_0x38614d['id']:null});}})[_0x2033('0x12')](function(_0xbd7b4b){if(_0xbd7b4b){log(_0x2033('0x14'),_0x38614d,_0x1a521f,_0x4b33e8,_0x2c226b,_0x569584);}})[_0x2033('0x15')](function(){log(_0x2033('0x16'),_0x38614d,_0x1a521f,_0x4b33e8,_0x2c226b,_0x569584);});}exports[_0x2033('0x17')]=function(_0x502b51,_0x3b4e2b){return function(_0x4be3e7,_0x342b36,_0x157a95){var _0x2b1830=_0x4be3e7[_0x2033('0x18')];var _0x9aeb17={};var _0x59d494=_0x4be3e7[_0x2033('0x19')];if(_0x9aeb17){_0x9aeb17=_['clone'](_0x4be3e7[_0x2033('0x1a')]);_0x9aeb17=_[_0x2033('0x1b')](_0x9aeb17,[_0x2033('0x1a'),_0x2033('0x1c'),_0x2033('0x1d'),_0x2033('0x1e'),'mobile']);}updateUser(_0x2b1830,_0x9aeb17,_0x59d494,_0x502b51,_0x3b4e2b);_0x157a95(null);};}; \ No newline at end of file +var _0x9268=['phone','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','stringify','null','Interaction','findOne','then','update','info','catch','error','tracked','user','query','clone','body','html'];(function(_0x44d34f,_0x4f98f9){var _0x2eb329=function(_0x92b999){while(--_0x92b999){_0x44d34f['push'](_0x44d34f['shift']());}};_0x2eb329(++_0x4f98f9);}(_0x9268,0x110));var _0x8926=function(_0x7abd7,_0x1ca3f9){_0x7abd7=_0x7abd7-0x0;var _0x3a2577=_0x9268[_0x7abd7];return _0x3a2577;};'use strict';var _=require(_0x8926('0x0'));var db=require(_0x8926('0x1'))['db'];var loggers={'openchannel':require(_0x8926('0x2'))(_0x8926('0x3')),'mail':require(_0x8926('0x2'))(_0x8926('0x4')),'fax':require(_0x8926('0x2'))('fax-interactions'),'sms':require(_0x8926('0x2'))(_0x8926('0x5')),'chat':require(_0x8926('0x2'))(_0x8926('0x6')),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getInteractionId(_0xbc310f,_0x154d27,_0x66e5a6){if(_0xbc310f&&_0xbc310f[_[_0x8926('0x7')](_0x66e5a6)+_0x8926('0x8')]){return _0xbc310f[_[_0x8926('0x7')](_0x66e5a6)+'InteractionId'];}else if(_0xbc310f&&_0xbc310f['id']){return _0xbc310f['id'];}else if(_0x154d27&&_0x154d27['id']){return _0x154d27['id'];}else{return _0x8926('0x9');}}function log(_0x18d1a8,_0x22e635,_0x788e4d,_0x5ce40d,_0x567b7f,_0x4fb87f){loggers[_0x567b7f[_0x8926('0xa')]()][_0x18d1a8](_0x8926('0xb'),_0x4fb87f[_0x8926('0xc')](),_0x22e635?_0x22e635['id']:null,_0x22e635?_0x22e635['name']:null,_0x22e635?_0x22e635['role']:null,getInteractionId(_0x788e4d,_0x5ce40d,_0x567b7f),_0x788e4d?JSON[_0x8926('0xd')](_0x788e4d):_0x8926('0xe'));}function updateUser(_0x34571e,_0x35b1ae,_0x48bc35,_0x364dc2,_0x35797e){db[_[_0x8926('0x7')](_0x364dc2)+_0x8926('0xf')][_0x8926('0x10')]({'where':{'id':getInteractionId(_0x35b1ae,_0x48bc35,_0x364dc2)}})[_0x8926('0x11')](function(_0x56bc6f){if(_0x56bc6f){return _0x56bc6f[_0x8926('0x12')]({'UserId':_0x34571e?_0x34571e['id']:null});}})[_0x8926('0x11')](function(_0x15ae52){if(_0x15ae52){log(_0x8926('0x13'),_0x34571e,_0x35b1ae,_0x48bc35,_0x364dc2,_0x35797e);}})[_0x8926('0x14')](function(){log(_0x8926('0x15'),_0x34571e,_0x35b1ae,_0x48bc35,_0x364dc2,_0x35797e);});}exports[_0x8926('0x16')]=function(_0x4d3480,_0x226fc0){return function(_0x36072a,_0x2ee062,_0xa543b){var _0x3df964=_0x36072a[_0x8926('0x17')];var _0x19141d={};var _0x16cc83=_0x36072a[_0x8926('0x18')];if(_0x19141d){_0x19141d=_[_0x8926('0x19')](_0x36072a[_0x8926('0x1a')]);_0x19141d=_['omit'](_0x19141d,[_0x8926('0x1a'),_0x8926('0x1b'),_0x8926('0x1c'),'fax',_0x8926('0x1d')]);}updateUser(_0x3df964,_0x19141d,_0x16cc83,_0x4d3480,_0x226fc0);_0xa543b(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 4e4f979..5754439 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 _0x14ad=['split','createDecipher','aes-256-ctr','%s:%s:%s','update','base64','final','utf8','parse','use','findOne','then','count','status','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','crypto','util','composable-middleware','data1','license'];(function(_0x6b110f,_0x2feb8d){var _0x239342=function(_0x4ebfeb){while(--_0x4ebfeb){_0x6b110f['push'](_0x6b110f['shift']());}};_0x239342(++_0x2feb8d);}(_0x14ad,0x8b));var _0xd14a=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x14ad[_0x5c351c];return _0x26f3b3;};'use strict';var crypto=require(_0xd14a('0x0'));var util=require(_0xd14a('0x1'));var compose=require(_0xd14a('0x2'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');function getValueFromLicense(_0x5a1da3,_0xd5e69b){if(_0x5a1da3&&_0xd5e69b){if(_0xd5e69b[_0xd14a('0x3')]&&_0xd5e69b[_0xd14a('0x4')]){var _0x49a710=_0xd5e69b[_0xd14a('0x3')];var _0x2c89dc=_0xd5e69b[_0xd14a('0x4')];var _0x14cd1f=_0x49a710[_0xd14a('0x5')]('-')[0x4];var _0xab023e=_0x49a710[_0xd14a('0x5')]('-')[0x0];var _0x3ec174=crypto[_0xd14a('0x6')](_0xd14a('0x7'),util['format'](_0xd14a('0x8'),_0x14cd1f,_0x49a710,_0xab023e));var _0x4e44b7=_0x3ec174[_0xd14a('0x9')](_0x2c89dc,_0xd14a('0xa'),'utf8');_0x4e44b7+=_0x3ec174[_0xd14a('0xb')](_0xd14a('0xc'));var _0x20070f=JSON[_0xd14a('0xd')](_0x4e44b7);return _0x20070f['hasOwnProperty'](_0x5a1da3)?_0x20070f[_0x5a1da3]:null;}}return null;}function isLimit(_0x27052c,_0x2dc009,_0x2a24d7,_0x17a828){var _0x2932a9=_0x2dc009;return compose()[_0xd14a('0xe')](function(_0x298ef1,_0x4feeb5,_0x2f0b66){return db['License'][_0xd14a('0xf')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x53983e){var _0x2af33f=getValueFromLicense(_0x27052c,_0x53983e);return _0x2af33f?_0x2af33f:_0x2932a9;})[_0xd14a('0x10')](function(_0x43b579){_0x2932a9=_0x43b579;return _0x2a24d7[_0xd14a('0x11')](_0x17a828);})[_0xd14a('0x10')](function(_0x1a7175){if(_0x1a7175>=_0x2932a9){return _0x4feeb5[_0xd14a('0x12')](0x193)['json']({'message':util[_0xd14a('0x13')](_0xd14a('0x14'),_0x27052c)});}_0x2f0b66();})[_0xd14a('0x15')](function(_0x37d567){_0x2f0b66(_0x37d567);});});}function isUserLimit(){return isLimit(_0xd14a('0x16'),0x1,db['User'],{'where':{'$or':[{'role':_0xd14a('0x17')},{'role':'user'}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x4416=['catch','users','User','admin','user','isUserLimit','crypto','composable-middleware','data1','license','split','createDecipher','format','%s:%s:%s','update','base64','utf8','parse','use','License','then','count','status','json'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4416,0x1ce));var _0x6441=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x4416[_0x21549c];return _0x426cbd;};'use strict';var crypto=require(_0x6441('0x0'));var util=require('util');var compose=require(_0x6441('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');function getValueFromLicense(_0x5ccdad,_0x2cc82d){if(_0x5ccdad&&_0x2cc82d){if(_0x2cc82d[_0x6441('0x2')]&&_0x2cc82d[_0x6441('0x3')]){var _0x233905=_0x2cc82d[_0x6441('0x2')];var _0x580b72=_0x2cc82d['license'];var _0x2076a3=_0x233905[_0x6441('0x4')]('-')[0x4];var _0x198b6b=_0x233905['split']('-')[0x0];var _0x304653=crypto[_0x6441('0x5')]('aes-256-ctr',util[_0x6441('0x6')](_0x6441('0x7'),_0x2076a3,_0x233905,_0x198b6b));var _0x31fe3e=_0x304653[_0x6441('0x8')](_0x580b72,_0x6441('0x9'),_0x6441('0xa'));_0x31fe3e+=_0x304653['final'](_0x6441('0xa'));var _0x1355b7=JSON[_0x6441('0xb')](_0x31fe3e);return _0x1355b7['hasOwnProperty'](_0x5ccdad)?_0x1355b7[_0x5ccdad]:null;}}return null;}function isLimit(_0x2863ca,_0x5b68d3,_0x1a7cce,_0x49b2f1){var _0x447a55=_0x5b68d3;return compose()[_0x6441('0xc')](function(_0x4bce1a,_0x10d73c,_0x4203d4){return db[_0x6441('0xd')]['findOne']({'where':{'id':0x1},'raw':!![]})['then'](function(_0x255f68){var _0x48126f=getValueFromLicense(_0x2863ca,_0x255f68);return _0x48126f?_0x48126f:_0x447a55;})[_0x6441('0xe')](function(_0x494592){_0x447a55=_0x494592;return _0x1a7cce[_0x6441('0xf')](_0x49b2f1);})[_0x6441('0xe')](function(_0x4837cc){if(_0x4837cc>=_0x447a55){return _0x10d73c[_0x6441('0x10')](0x193)[_0x6441('0x11')]({'message':util[_0x6441('0x6')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x2863ca)});}_0x4203d4();})[_0x6441('0x12')](function(_0x255ccc){_0x4203d4(_0x255ccc);});});}function isUserLimit(){return isLimit(_0x6441('0x13'),0x1,db[_0x6441('0x14')],{'where':{'$or':[{'role':_0x6441('0x15')},{'role':_0x6441('0x16')}]}});}exports[_0x6441('0x17')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 9b69a2a..237266c 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 _0x622e=['and','[$and]','replace','split','forEach','shift','filter','indexOf','map','conditions','buildExpression','DATE','operator','$eq','value','$gt','$lte','days','format','YYYY-MM-DD','castTo','text','field','\x20AS\x20','includes','$ne','$notIn','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','$in','start','pop','add','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]'];(function(_0x496b02,_0x4cf688){var _0x358680=function(_0x3e103f){while(--_0x3e103f){_0x496b02['push'](_0x496b02['shift']());}};_0x358680(++_0x4cf688);}(_0x622e,0xd6));var _0xe622=function(_0x1b1dff,_0x4c2de2){_0x1b1dff=_0x1b1dff-0x0;var _0x280d9d=_0x622e[_0x1b1dff];return _0x280d9d;};'use strict';var _=require(_0xe622('0x0'));var moment=require(_0xe622('0x1'));exports[_0xe622('0x2')]=function(_0x1a0db7){var _0xa9710f={'conditions':[]};_0xa9710f[_0xe622('0x3')]=_[_0xe622('0x4')](_0x1a0db7,_0xe622('0x5'))?'or':_0xe622('0x6');var _0x3d3577=_0x1a0db7['replace'](_0xe622('0x7'),'')[_0xe622('0x8')](_0xe622('0x5'),'')[_0xe622('0x9')]('||');for(var _0x2c6b72=0x0;_0x2c6b72<_0x3d3577['length'];_0x2c6b72++){var _0x47814b=_0x3d3577[_0x2c6b72]['split'](':=');var _0x5a8b4a=_0x47814b[0x0];var _0x208179=_0x47814b['slice'](0x1);_0x208179[_0xe622('0xa')](function(_0x45724d){var _0x5df5a6=_0x45724d[_0xe622('0x9')]('[')[_0xe622('0xb')]();var _0x205aba=_0x45724d['match'](/\[(.*?)\]/g);_0x205aba[_0xe622('0xa')](function(_0x183aab){var _0x5a5f92=_0x183aab[_0xe622('0x9')]('[')[_0xe622('0xc')](function(_0xf814bd){return _0xf814bd[_0xe622('0xd')](']')>-0x1;})[_0xe622('0xe')](function(_0x155dce){return _0x155dce[_0xe622('0x9')](']')[0x0];})[0x0];_0xa9710f[_0xe622('0xf')]['push']({'field':_0x5a8b4a,'operator':_0x5df5a6,'value':_0x5a5f92});});});}return _0xa9710f;};exports[_0xe622('0x10')]=function(_0xf94f18,_0x5d30c5,_0x1738ed){var _0x229630={};if(_0x5d30c5===_0xe622('0x11')){if(_0x1738ed[_0xe622('0x12')]===_0xe622('0x13')){_0x1738ed['operator']='$between';_0x1738ed[_0xe622('0x14')]+=','+_0x1738ed[_0xe622('0x14')];}else if(_['includes']([_0xe622('0x15'),_0xe622('0x16')],_0x1738ed['operator'])){_0x1738ed[_0xe622('0x14')]=moment(_0x1738ed[_0xe622('0x14')])['add'](0x1,_0xe622('0x17'))[_0xe622('0x18')](_0xe622('0x19'));}}if(_0x1738ed[_0xe622('0x1a')]){_0x5d30c5=_0x1738ed[_0xe622('0x1a')];_0x229630[_0xe622('0x1b')]='CAST('+_0xf94f18+'.'+_0x1738ed[_0xe622('0x1c')]+_0xe622('0x1d')+_0x1738ed[_0xe622('0x1a')]+')\x20'+parseOperator(_0x1738ed[_0xe622('0x12')]);}else{_0x229630[_0xe622('0x1b')]=_0xf94f18+'.'+_0x1738ed[_0xe622('0x1c')]+'\x20'+parseOperator(_0x1738ed[_0xe622('0x12')]);}if(_[_0xe622('0x1e')]([_0xe622('0x1f'),_0xe622('0x20')],_0x1738ed[_0xe622('0x12')]))_0x229630['text']='('+_0x229630[_0xe622('0x1b')]+'\x20OR\x20'+_0xf94f18+'.'+_0x1738ed[_0xe622('0x1c')]+_0xe622('0x21');_0x229630['value']=parseValue(_0x5d30c5,_0x1738ed[_0xe622('0x12')],_0x1738ed[_0xe622('0x14')]);return _0x229630;};function parseOperator(_0x152fbb){var _0x301cb8;switch(_0x152fbb){case'$in':_0x301cb8=_0xe622('0x22');break;case _0xe622('0x20'):_0x301cb8=_0xe622('0x23');break;case _0xe622('0x13'):_0x301cb8=_0xe622('0x24');break;case _0xe622('0x1f'):_0x301cb8=_0xe622('0x25');break;case _0xe622('0x26'):case _0xe622('0x27'):case _0xe622('0x28'):_0x301cb8=_0xe622('0x29');break;case _0xe622('0x2a'):_0x301cb8=_0xe622('0x2b');break;case _0xe622('0x15'):_0x301cb8=_0xe622('0x2c');break;case _0xe622('0x16'):_0x301cb8=_0xe622('0x2d');break;case _0xe622('0x2e'):_0x301cb8=_0xe622('0x2f');break;case _0xe622('0x30'):_0x301cb8=_0xe622('0x31');break;}return _0x301cb8;}function parseValue(_0x5ea918,_0x42e2cd,_0x1f6bdb){var _0x25b1d6={'start':undefined,'end':undefined};switch(_0x42e2cd){case _0xe622('0x32'):case'$notIn':_0x25b1d6[_0xe622('0x33')]=_0x1f6bdb[_0xe622('0x9')](',');break;case _0xe622('0x26'):_0x25b1d6['start']='%'+_0x1f6bdb+'%';break;case _0xe622('0x27'):_0x25b1d6[_0xe622('0x33')]=_0x1f6bdb+'%';break;case _0xe622('0x28'):_0x25b1d6[_0xe622('0x33')]='%'+_0x1f6bdb;break;case _0xe622('0x30'):var _0x22b8c6=_0x1f6bdb['split'](',');var _0x1f6bdb=_0x22b8c6[_0xe622('0xb')]();var _0x4abf9a=_0x22b8c6[_0xe622('0x34')]();if(_0x5ea918==='DATE'){_0x1f6bdb=moment(_0x1f6bdb)['utcOffset'](0x0,!![])[_0xe622('0x18')]();_0x4abf9a=moment(_0x4abf9a)['utcOffset'](0x0,!![])[_0xe622('0x35')](0x17,'hours')[_0xe622('0x35')](0x3b,'minutes')['add'](0x3b,_0xe622('0x36'))[_0xe622('0x18')]();}_0x25b1d6={'start':_0x1f6bdb,'end':_0x4abf9a};break;default:_0x25b1d6[_0xe622('0x33')]=_0x1f6bdb;break;}return _0x25b1d6;} \ No newline at end of file +var _0xa7b7=['start','pop','utcOffset','add','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','replace','length','split','slice','forEach','shift','filter','indexOf','map','conditions','buildExpression','DATE','operator','$between','value','includes','$gt','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','\x20OR\x20','$in','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$lte','<=\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','$notIn'];(function(_0x591a90,_0x5525b0){var _0x551587=function(_0xd6ad8e){while(--_0xd6ad8e){_0x591a90['push'](_0x591a90['shift']());}};_0x551587(++_0x5525b0);}(_0xa7b7,0x1b7));var _0x7a7b=function(_0x457096,_0x21052a){_0x457096=_0x457096-0x0;var _0x3c141f=_0xa7b7[_0x457096];return _0x3c141f;};'use strict';var _=require(_0x7a7b('0x0'));var moment=require(_0x7a7b('0x1'));exports[_0x7a7b('0x2')]=function(_0x4e6bac){var _0x5c7ab9={'conditions':[]};_0x5c7ab9[_0x7a7b('0x3')]=_[_0x7a7b('0x4')](_0x4e6bac,_0x7a7b('0x5'))?'or':'and';var _0xc8ab98=_0x4e6bac[_0x7a7b('0x6')]('[$and]','')[_0x7a7b('0x6')]('[$or]','')['split']('||');for(var _0x46d17f=0x0;_0x46d17f<_0xc8ab98[_0x7a7b('0x7')];_0x46d17f++){var _0x963340=_0xc8ab98[_0x46d17f][_0x7a7b('0x8')](':=');var _0x65cded=_0x963340[0x0];var _0x14c570=_0x963340[_0x7a7b('0x9')](0x1);_0x14c570[_0x7a7b('0xa')](function(_0x45d4b7){var _0x4b663b=_0x45d4b7[_0x7a7b('0x8')]('[')[_0x7a7b('0xb')]();var _0x1f88a3=_0x45d4b7['match'](/\[(.*?)\]/g);_0x1f88a3[_0x7a7b('0xa')](function(_0x84694a){var _0x3ab2bf=_0x84694a[_0x7a7b('0x8')]('[')[_0x7a7b('0xc')](function(_0x49f617){return _0x49f617[_0x7a7b('0xd')](']')>-0x1;})[_0x7a7b('0xe')](function(_0x7d3fbb){return _0x7d3fbb[_0x7a7b('0x8')](']')[0x0];})[0x0];_0x5c7ab9[_0x7a7b('0xf')]['push']({'field':_0x65cded,'operator':_0x4b663b,'value':_0x3ab2bf});});});}return _0x5c7ab9;};exports[_0x7a7b('0x10')]=function(_0x4bcb63,_0x5d29e,_0x3546e5){var _0x27f6f3={};if(_0x5d29e===_0x7a7b('0x11')){if(_0x3546e5[_0x7a7b('0x12')]==='$eq'){_0x3546e5[_0x7a7b('0x12')]=_0x7a7b('0x13');_0x3546e5[_0x7a7b('0x14')]+=','+_0x3546e5[_0x7a7b('0x14')];}else if(_[_0x7a7b('0x15')]([_0x7a7b('0x16'),'$lte'],_0x3546e5[_0x7a7b('0x12')])){_0x3546e5['value']=moment(_0x3546e5[_0x7a7b('0x14')])['add'](0x1,_0x7a7b('0x17'))[_0x7a7b('0x18')](_0x7a7b('0x19'));}}if(_0x3546e5[_0x7a7b('0x1a')]){_0x5d29e=_0x3546e5['castTo'];_0x27f6f3[_0x7a7b('0x1b')]=_0x7a7b('0x1c')+_0x4bcb63+'.'+_0x3546e5[_0x7a7b('0x1d')]+_0x7a7b('0x1e')+_0x3546e5['castTo']+')\x20'+parseOperator(_0x3546e5[_0x7a7b('0x12')]);}else{_0x27f6f3[_0x7a7b('0x1b')]=_0x4bcb63+'.'+_0x3546e5[_0x7a7b('0x1d')]+'\x20'+parseOperator(_0x3546e5[_0x7a7b('0x12')]);}if(_[_0x7a7b('0x15')]([_0x7a7b('0x1f'),'$notIn'],_0x3546e5[_0x7a7b('0x12')]))_0x27f6f3[_0x7a7b('0x1b')]='('+_0x27f6f3[_0x7a7b('0x1b')]+_0x7a7b('0x20')+_0x4bcb63+'.'+_0x3546e5[_0x7a7b('0x1d')]+'\x20IS\x20NULL)';_0x27f6f3[_0x7a7b('0x14')]=parseValue(_0x5d29e,_0x3546e5[_0x7a7b('0x12')],_0x3546e5['value']);return _0x27f6f3;};function parseOperator(_0x295d0c){var _0x5e4620;switch(_0x295d0c){case _0x7a7b('0x21'):_0x5e4620='IN\x20?';break;case'$notIn':_0x5e4620='NOT\x20IN\x20?';break;case'$eq':_0x5e4620='=\x20?';break;case _0x7a7b('0x1f'):_0x5e4620=_0x7a7b('0x22');break;case _0x7a7b('0x23'):case _0x7a7b('0x24'):case _0x7a7b('0x25'):_0x5e4620=_0x7a7b('0x26');break;case _0x7a7b('0x27'):_0x5e4620=_0x7a7b('0x28');break;case _0x7a7b('0x16'):_0x5e4620=_0x7a7b('0x29');break;case _0x7a7b('0x2a'):_0x5e4620=_0x7a7b('0x2b');break;case'$gte':_0x5e4620=_0x7a7b('0x2c');break;case'$between':_0x5e4620=_0x7a7b('0x2d');break;}return _0x5e4620;}function parseValue(_0x4f255e,_0x420dd2,_0x208f16){var _0x3a2623={'start':undefined,'end':undefined};switch(_0x420dd2){case'$in':case _0x7a7b('0x2e'):_0x3a2623[_0x7a7b('0x2f')]=_0x208f16[_0x7a7b('0x8')](',');break;case _0x7a7b('0x23'):_0x3a2623['start']='%'+_0x208f16+'%';break;case'$startsWith':_0x3a2623['start']=_0x208f16+'%';break;case'$endsWith':_0x3a2623[_0x7a7b('0x2f')]='%'+_0x208f16;break;case _0x7a7b('0x13'):var _0x3630cc=_0x208f16['split'](',');var _0x208f16=_0x3630cc[_0x7a7b('0xb')]();var _0x2d5564=_0x3630cc[_0x7a7b('0x30')]();if(_0x4f255e===_0x7a7b('0x11')){_0x208f16=moment(_0x208f16)[_0x7a7b('0x31')](0x0,!![])[_0x7a7b('0x18')]();_0x2d5564=moment(_0x2d5564)[_0x7a7b('0x31')](0x0,!![])[_0x7a7b('0x32')](0x17,_0x7a7b('0x33'))[_0x7a7b('0x32')](0x3b,_0x7a7b('0x34'))[_0x7a7b('0x32')](0x3b,_0x7a7b('0x35'))[_0x7a7b('0x18')]();}_0x3a2623={'start':_0x208f16,'end':_0x2d5564};break;default:_0x3a2623['start']=_0x208f16;break;}return _0x3a2623;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 20d411a..194f8de 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 _0xe647=['isObject','hasOwnProperty','match','^[+]?[0-9]*$','getFullTextValue','forEach','join','getOptions','query','$id','model','intersection','attributes','fields','nolimit','offset','order','pick','filter','object','columns','value','where','merge','VIRTUAL','lower','options','lodash','sequelize','moment','parse','includes','keys','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','limit','sort','map','priority','unsigned','substr','DESC','cast','ASC','length','omit'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xe647,0x93));var _0x7e64=function(_0x512369,_0x2c39c7){_0x512369=_0x512369-0x0;var _0x1000d7=_0xe647[_0x512369];return _0x1000d7;};'use strict';var _=require(_0x7e64('0x0'));var sequelize=require(_0x7e64('0x1'));var moment=require(_0x7e64('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1456d2){var _0x3b4b6f=['ne'];try{var _0x2a8e4e=JSON[_0x7e64('0x3')](_0x1456d2);var _0x3c3a05=Object['keys'](_0x2a8e4e)[0x0];return _0x3b4b6f[_0x7e64('0x4')](_0x3c3a05);}catch(_0x4d8b39){return![];}}function getOperatorValue(_0x4f4855){var _0x69919=JSON['parse'](_0x4f4855);var _0x2cd689=Object[_0x7e64('0x5')](_0x69919)[0x0];var _0x2494b7=_0x69919[_0x2cd689];return{['$'+_0x2cd689]:_0x2494b7};}exports['fields']=function(_0x941e0c){var _0xd76111=null;if(_0x941e0c){_0xd76111=_0x941e0c[_0x7e64('0x6')](',');}return _0xd76111;};exports[_0x7e64('0x7')]=function(_0xc2785a,_0x1bce1c){var _0x3c0d6b={};if(!_[_0x7e64('0x8')](_0xc2785a)){_[_0x7e64('0x9')](_0xc2785a,function(_0x146b18,_0x3dbd47){try{if(_0x1bce1c){var _0x15c9cd=_[_0x7e64('0xa')](_0x1bce1c,{'name':_0x3dbd47})||{};if(hasSequelizeOperator(_0x146b18)){_0x3c0d6b[_0x3dbd47]=getOperatorValue(_0x146b18);}else if(_0x15c9cd[_0x7e64('0xb')]===_0x7e64('0xc')&&_[_0x7e64('0xd')](_0x146b18)){var _0x302e6e=JSON[_0x7e64('0x3')](_0x146b18);var _0x3d13c5={'$gte':moment(moment(_0x302e6e[_0x7e64('0xe')])[_0x7e64('0xf')](_0x7e64('0x10')))[_0x7e64('0x11')]()[_0x7e64('0xf')](),'$lte':moment(moment(_0x302e6e['$lte'])['format']('YYYY-MM-DD'))['utc']()[_0x7e64('0x12')](0x1,'s')[_0x7e64('0xf')]()};_0x3c0d6b[_0x3dbd47]=_0x3d13c5;}else if(_0x15c9cd[_0x7e64('0x13')]===_0x7e64('0x14')){_0x3c0d6b[_0x3dbd47]=_0x146b18;}else{_0x3c0d6b[_0x3dbd47]=_[_0x7e64('0x15')](_0x146b18)?_0x146b18:JSON[_0x7e64('0x3')](_0x146b18);}}else{_0x3c0d6b[_0x3dbd47]=_[_0x7e64('0x15')](_0x146b18)?_0x146b18:JSON[_0x7e64('0x3')](_0x146b18);}}catch(_0x2d8dec){_0x3c0d6b[_0x3dbd47]=_0x146b18[_0x7e64('0x6')](',');}});}return _0x3c0d6b;};exports[_0x7e64('0x16')]=function(_0x53edcc){_0x53edcc=parseInt(_0x53edcc,0xa);if(!_0x53edcc||_0x53edcc<0x0){_0x53edcc=LIMIT_VALUE;}return _0x53edcc;};exports['offset']=function(_0x14e034){_0x14e034=parseInt(_0x14e034,0xa);if(!_0x14e034||_0x14e034<0x0){_0x14e034=0x0;}return _0x14e034;};exports[_0x7e64('0x17')]=function(_0x3e5f4f){var _0x129326,_0x186c0a=null;if(_0x3e5f4f){_0x129326=_0x3e5f4f[_0x7e64('0x6')](',');_0x186c0a=_[_0x7e64('0x18')](_0x129326,function(_0x4ee50a){if(_0x4ee50a['indexOf']('-')===0x0){return[_0x4ee50a===_0x7e64('0x19')?sequelize['cast'](sequelize['col'](_0x7e64('0x19')),_0x7e64('0x1a')):_0x4ee50a[_0x7e64('0x1b')](0x1),_0x7e64('0x1c')];}else{return[_0x4ee50a===_0x7e64('0x19')?sequelize[_0x7e64('0x1d')](sequelize['col'](_0x7e64('0x19')),'unsigned'):_0x4ee50a,_0x7e64('0x1e')];}});}return _0x186c0a;};exports['omit']=function(_0xccabd6,_0x2cb58d){if(_['isEmpty'](_0xccabd6)){return _0xccabd6;}if(_[_0x7e64('0x15')](_0xccabd6)){for(var _0x157dee=0x0;_0x157dee<_0xccabd6[_0x7e64('0x1f')];_0x157dee+=0x1){_0xccabd6[_0x157dee]=this[_0x7e64('0x20')](_0xccabd6[_0x157dee],_0x2cb58d);}return _0xccabd6;}if(!_[_0x7e64('0x21')](_0xccabd6)){return _0xccabd6;}if(_['isString'](_0x2cb58d)){_0x2cb58d=[_0x2cb58d];}if(!_[_0x7e64('0x15')](_0x2cb58d)){return _0xccabd6;}for(var _0x599c78=0x0;_0x599c78<_0x2cb58d['length'];_0x599c78+=0x1){_['unset'](_0xccabd6,_0x2cb58d[_0x599c78]);}for(var _0x491017 in _0xccabd6){if(_0xccabd6[_0x7e64('0x22')](_0x491017)){_0xccabd6[_0x491017]=this[_0x7e64('0x20')](_0xccabd6[_0x491017],_0x2cb58d);}}return _0xccabd6;};exports['isNumeric']=function(_0x3d05d5){return _0x3d05d5[_0x7e64('0x23')](RegExp(_0x7e64('0x24')))?!![]:![];};exports['isEmail']=function(_0x292c6f){return _0x292c6f[_0x7e64('0x23')](/^\S+@\S+$/)?!![]:![];};exports[_0x7e64('0x25')]=function(_0x2a4c9e){var _0x17b594=[];_0x2a4c9e[_0x7e64('0x6')](/[ ,]+/)[_0x7e64('0x26')](function(_0x4572ca){_0x4572ca=_0x4572ca['replace'](/([^:]")"+/g,'$1');_0x4572ca='+'+_0x4572ca+'*';var _0x4da9ef=/[ `!@#$%^&*()_\-?~]/;if(_0x4572ca[_0x7e64('0x23')](_0x4da9ef))_0x4572ca='\x22'+_0x4572ca+'\x22';_0x17b594['push'](_0x4572ca);});return _0x17b594[_0x7e64('0x27')]('\x20');};exports[_0x7e64('0x28')]=function(_0x53eef6,_0x16ebd6,_0x4b5dd1){var _0x399c42={},_0x2cc60d={};if(_0x16ebd6[_0x7e64('0x29')][_0x7e64('0x2a')]){_0x16ebd6[_0x7e64('0x29')]['id']=_0x16ebd6[_0x7e64('0x29')]['$id'];delete _0x16ebd6[_0x7e64('0x29')]['$id'];}_0x399c42[_0x7e64('0x2b')]=_[_0x7e64('0x18')](_0x53eef6,_0x7e64('0x13'));_0x399c42[_0x7e64('0x29')]=_[_0x7e64('0x5')](_0x16ebd6['query']);_0x399c42['filters']=_[_0x7e64('0x2c')](_0x399c42[_0x7e64('0x2b')],_0x399c42[_0x7e64('0x29')]);_0x2cc60d[_0x7e64('0x2d')]=_['intersection'](_0x399c42[_0x7e64('0x2b')],this[_0x7e64('0x2e')](_0x16ebd6[_0x7e64('0x29')][_0x7e64('0x2e')]));_0x2cc60d[_0x7e64('0x2d')]=_0x2cc60d['attributes'][_0x7e64('0x1f')]?_0x2cc60d[_0x7e64('0x2d')]:_0x399c42[_0x7e64('0x2b')];if(!_0x16ebd6[_0x7e64('0x29')]['hasOwnProperty'](_0x7e64('0x2f'))){_0x2cc60d['limit']=this['limit'](_0x16ebd6['query']['limit']);_0x2cc60d[_0x7e64('0x30')]=this['offset'](_0x16ebd6[_0x7e64('0x29')][_0x7e64('0x30')]);}_0x2cc60d[_0x7e64('0x31')]=this[_0x7e64('0x17')](_0x16ebd6[_0x7e64('0x29')][_0x7e64('0x17')]);_0x2cc60d['where']=this[_0x7e64('0x7')](_[_0x7e64('0x32')](_0x16ebd6[_0x7e64('0x29')],_0x399c42[_0x7e64('0x7')]),_0x53eef6);if(_0x16ebd6[_0x7e64('0x29')][_0x7e64('0x33')]){var _0x289b81=_0x53eef6;var _0x2735e4=_0x16ebd6[_0x7e64('0x29')]['filter'];if(typeof _0x2735e4===_0x7e64('0x34')){_0x289b81=_[_0x7e64('0x33')](_0x53eef6,function(_0x2385aa){return _[_0x7e64('0x4')](_0x2735e4[_0x7e64('0x35')],_0x2385aa[_0x7e64('0x13')]);});_0x2735e4=_0x2735e4[_0x7e64('0x36')];}_0x2cc60d[_0x7e64('0x37')]=_[_0x7e64('0x38')](_0x2cc60d[_0x7e64('0x37')],{'$or':_[_0x7e64('0x18')](_0x289b81,function(_0x2551d6){if(_0x2551d6[_0x7e64('0xb')]!==_0x7e64('0x39')){if(_0x4b5dd1){return sequelize['where'](sequelize['fn'](_0x7e64('0x3a'),sequelize['col'](_0x2551d6[_0x7e64('0x13')])),{'$like':sequelize['fn'](_0x7e64('0x3a'),'%'+_0x16ebd6[_0x7e64('0x29')]['filter']+'%')});}else{var _0x2ada5a={};_0x2ada5a[_0x2551d6[_0x7e64('0x13')]]={'$like':'%'+_0x16ebd6[_0x7e64('0x29')][_0x7e64('0x33')]+'%'};return _0x2ada5a;}}})});}_0x2cc60d=_['merge']({},_0x2cc60d,_0x16ebd6[_0x7e64('0x3b')]);return _0x2cc60d;}; \ No newline at end of file +var _0x57d2=['$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','split','limit','offset','map','indexOf','cast','priority','unsigned','substr','DESC','col','ASC','omit','length','isString','unset','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','model','intersection','attributes','sort','where','filter','object','columns','merge','VIRTUAL','lower','options','lodash','moment','parse','keys','fields','filters','isEmpty','forOwn','type','DATE','isPlainObject'];(function(_0x2089ea,_0xbdfee6){var _0xc80029=function(_0x31dd1b){while(--_0x31dd1b){_0x2089ea['push'](_0x2089ea['shift']());}};_0xc80029(++_0xbdfee6);}(_0x57d2,0x6d));var _0x257d=function(_0x274e08,_0x4e48c3){_0x274e08=_0x274e08-0x0;var _0x4e57b1=_0x57d2[_0x274e08];return _0x4e57b1;};'use strict';var _=require(_0x257d('0x0'));var sequelize=require('sequelize');var moment=require(_0x257d('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x5113e0){var _0x1a524f=['ne'];try{var _0x3f3b33=JSON[_0x257d('0x2')](_0x5113e0);var _0x493072=Object[_0x257d('0x3')](_0x3f3b33)[0x0];return _0x1a524f['includes'](_0x493072);}catch(_0x4e9251){return![];}}function getOperatorValue(_0x1286a7){var _0x2e4453=JSON[_0x257d('0x2')](_0x1286a7);var _0x249b31=Object['keys'](_0x2e4453)[0x0];var _0x4e8109=_0x2e4453[_0x249b31];return{['$'+_0x249b31]:_0x4e8109};}exports[_0x257d('0x4')]=function(_0x1ee3df){var _0x78839b=null;if(_0x1ee3df){_0x78839b=_0x1ee3df['split'](',');}return _0x78839b;};exports[_0x257d('0x5')]=function(_0x121913,_0x3128f){var _0x1c0a21={};if(!_[_0x257d('0x6')](_0x121913)){_[_0x257d('0x7')](_0x121913,function(_0x32ec27,_0x425bc2){try{if(_0x3128f){var _0x27fd90=_['find'](_0x3128f,{'name':_0x425bc2})||{};if(hasSequelizeOperator(_0x32ec27)){_0x1c0a21[_0x425bc2]=getOperatorValue(_0x32ec27);}else if(_0x27fd90[_0x257d('0x8')]===_0x257d('0x9')&&_[_0x257d('0xa')](_0x32ec27)){var _0x2a3d2b=JSON['parse'](_0x32ec27);var _0x73aa32={'$gte':moment(moment(_0x2a3d2b[_0x257d('0xb')])[_0x257d('0xc')](_0x257d('0xd')))[_0x257d('0xe')]()['format'](),'$lte':moment(moment(_0x2a3d2b[_0x257d('0xf')])[_0x257d('0xc')]('YYYY-MM-DD'))['utc']()[_0x257d('0x10')](0x1,'s')[_0x257d('0xc')]()};_0x1c0a21[_0x425bc2]=_0x73aa32;}else if(_0x27fd90[_0x257d('0x11')]===_0x257d('0x12')){_0x1c0a21[_0x425bc2]=_0x32ec27;}else{_0x1c0a21[_0x425bc2]=_[_0x257d('0x13')](_0x32ec27)?_0x32ec27:JSON['parse'](_0x32ec27);}}else{_0x1c0a21[_0x425bc2]=_[_0x257d('0x13')](_0x32ec27)?_0x32ec27:JSON['parse'](_0x32ec27);}}catch(_0x4a2f3e){_0x1c0a21[_0x425bc2]=_0x32ec27[_0x257d('0x14')](',');}});}return _0x1c0a21;};exports[_0x257d('0x15')]=function(_0x36c234){_0x36c234=parseInt(_0x36c234,0xa);if(!_0x36c234||_0x36c234<0x0){_0x36c234=LIMIT_VALUE;}return _0x36c234;};exports[_0x257d('0x16')]=function(_0x4650f9){_0x4650f9=parseInt(_0x4650f9,0xa);if(!_0x4650f9||_0x4650f9<0x0){_0x4650f9=0x0;}return _0x4650f9;};exports['sort']=function(_0x1a35e7){var _0x40c5ef,_0x4a77c1=null;if(_0x1a35e7){_0x40c5ef=_0x1a35e7[_0x257d('0x14')](',');_0x4a77c1=_[_0x257d('0x17')](_0x40c5ef,function(_0x2b491c){if(_0x2b491c[_0x257d('0x18')]('-')===0x0){return[_0x2b491c==='priority'?sequelize[_0x257d('0x19')](sequelize['col'](_0x257d('0x1a')),_0x257d('0x1b')):_0x2b491c[_0x257d('0x1c')](0x1),_0x257d('0x1d')];}else{return[_0x2b491c==='priority'?sequelize[_0x257d('0x19')](sequelize[_0x257d('0x1e')](_0x257d('0x1a')),'unsigned'):_0x2b491c,_0x257d('0x1f')];}});}return _0x4a77c1;};exports[_0x257d('0x20')]=function(_0x37cb6c,_0x4fc376){if(_[_0x257d('0x6')](_0x37cb6c)){return _0x37cb6c;}if(_['isArray'](_0x37cb6c)){for(var _0x46f0cc=0x0;_0x46f0cc<_0x37cb6c[_0x257d('0x21')];_0x46f0cc+=0x1){_0x37cb6c[_0x46f0cc]=this[_0x257d('0x20')](_0x37cb6c[_0x46f0cc],_0x4fc376);}return _0x37cb6c;}if(!_['isObject'](_0x37cb6c)){return _0x37cb6c;}if(_[_0x257d('0x22')](_0x4fc376)){_0x4fc376=[_0x4fc376];}if(!_[_0x257d('0x13')](_0x4fc376)){return _0x37cb6c;}for(var _0x181987=0x0;_0x181987<_0x4fc376[_0x257d('0x21')];_0x181987+=0x1){_[_0x257d('0x23')](_0x37cb6c,_0x4fc376[_0x181987]);}for(var _0x51cf8f in _0x37cb6c){if(_0x37cb6c['hasOwnProperty'](_0x51cf8f)){_0x37cb6c[_0x51cf8f]=this[_0x257d('0x20')](_0x37cb6c[_0x51cf8f],_0x4fc376);}}return _0x37cb6c;};exports[_0x257d('0x24')]=function(_0x145a3e){return _0x145a3e[_0x257d('0x25')](RegExp(_0x257d('0x26')))?!![]:![];};exports[_0x257d('0x27')]=function(_0x5c1954){return _0x5c1954[_0x257d('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0x257d('0x28')]=function(_0x3421cc){var _0x1bee66=[];_0x3421cc[_0x257d('0x14')](/[ ,]+/)[_0x257d('0x29')](function(_0x5b11f1){_0x5b11f1=_0x5b11f1[_0x257d('0x2a')](/([^:]")"+/g,'$1');_0x5b11f1='+'+_0x5b11f1+'*';var _0x168264=/[ `!@#$%^&*()_\-?~]/;if(_0x5b11f1['match'](_0x168264))_0x5b11f1='\x22'+_0x5b11f1+'\x22';_0x1bee66[_0x257d('0x2b')](_0x5b11f1);});return _0x1bee66[_0x257d('0x2c')]('\x20');};exports[_0x257d('0x2d')]=function(_0x23f4e2,_0x508629,_0xf0d659){var _0xbcdc98={},_0x2ee5f={};if(_0x508629[_0x257d('0x2e')]['$id']){_0x508629[_0x257d('0x2e')]['id']=_0x508629['query'][_0x257d('0x2f')];delete _0x508629[_0x257d('0x2e')][_0x257d('0x2f')];}_0xbcdc98[_0x257d('0x30')]=_[_0x257d('0x17')](_0x23f4e2,_0x257d('0x11'));_0xbcdc98[_0x257d('0x2e')]=_[_0x257d('0x3')](_0x508629[_0x257d('0x2e')]);_0xbcdc98[_0x257d('0x5')]=_[_0x257d('0x31')](_0xbcdc98['model'],_0xbcdc98[_0x257d('0x2e')]);_0x2ee5f[_0x257d('0x32')]=_['intersection'](_0xbcdc98[_0x257d('0x30')],this[_0x257d('0x4')](_0x508629[_0x257d('0x2e')]['fields']));_0x2ee5f['attributes']=_0x2ee5f[_0x257d('0x32')][_0x257d('0x21')]?_0x2ee5f[_0x257d('0x32')]:_0xbcdc98[_0x257d('0x30')];if(!_0x508629[_0x257d('0x2e')]['hasOwnProperty']('nolimit')){_0x2ee5f[_0x257d('0x15')]=this[_0x257d('0x15')](_0x508629[_0x257d('0x2e')][_0x257d('0x15')]);_0x2ee5f[_0x257d('0x16')]=this[_0x257d('0x16')](_0x508629[_0x257d('0x2e')][_0x257d('0x16')]);}_0x2ee5f['order']=this[_0x257d('0x33')](_0x508629[_0x257d('0x2e')][_0x257d('0x33')]);_0x2ee5f[_0x257d('0x34')]=this[_0x257d('0x5')](_['pick'](_0x508629[_0x257d('0x2e')],_0xbcdc98['filters']),_0x23f4e2);if(_0x508629['query'][_0x257d('0x35')]){var _0x508638=_0x23f4e2;var _0x3e11db=_0x508629[_0x257d('0x2e')][_0x257d('0x35')];if(typeof _0x3e11db===_0x257d('0x36')){_0x508638=_['filter'](_0x23f4e2,function(_0x3512a9){return _['includes'](_0x3e11db[_0x257d('0x37')],_0x3512a9[_0x257d('0x11')]);});_0x3e11db=_0x3e11db['value'];}_0x2ee5f[_0x257d('0x34')]=_[_0x257d('0x38')](_0x2ee5f[_0x257d('0x34')],{'$or':_[_0x257d('0x17')](_0x508638,function(_0x226629){if(_0x226629[_0x257d('0x8')]!==_0x257d('0x39')){if(_0xf0d659){return sequelize['where'](sequelize['fn'](_0x257d('0x3a'),sequelize[_0x257d('0x1e')](_0x226629[_0x257d('0x11')])),{'$like':sequelize['fn'](_0x257d('0x3a'),'%'+_0x508629['query'][_0x257d('0x35')]+'%')});}else{var _0x29f040={};_0x29f040[_0x226629[_0x257d('0x11')]]={'$like':'%'+_0x508629[_0x257d('0x2e')][_0x257d('0x35')]+'%'};return _0x29f040;}}})});}_0x2ee5f=_[_0x257d('0x38')]({},_0x2ee5f,_0x508629[_0x257d('0x3b')]);return _0x2ee5f;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 3abcc3d..c78484c 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2474=['default','get','env','production','set','appPath','join','test','root','json\x20replacer','toISOString','split','static','views','/server/views','engine','html','view\x20engine','urlencoded','use','json','50mb','express','serve-favicon','cookie-parser','errorhandler','path','passport','cors','./environment'];(function(_0x119254,_0x344a3f){var _0x51f960=function(_0x1f622a){while(--_0x1f622a){_0x119254['push'](_0x119254['shift']());}};_0x51f960(++_0x344a3f);}(_0x2474,0x17e));var _0x4247=function(_0xf87cc8,_0x3ceb59){_0xf87cc8=_0xf87cc8-0x0;var _0x21e659=_0x2474[_0xf87cc8];return _0x21e659;};'use strict';var express=require(_0x4247('0x0'));var favicon=require(_0x4247('0x1'));var bodyParser=require('body-parser');var methodOverride=require('method-override');var cookieParser=require(_0x4247('0x2'));var errorHandler=require(_0x4247('0x3'));var path=require(_0x4247('0x4'));var passport=require(_0x4247('0x5'));var cors=require(_0x4247('0x6'));var moment=require('moment');var config=require(_0x4247('0x7'));var db=require('../mysqldb')['db'];exports[_0x4247('0x8')]=function(_0xfd2d30){var _0x1ac786=_0xfd2d30[_0x4247('0x9')](_0x4247('0xa'));if(_0x1ac786===_0x4247('0xb')){_0xfd2d30[_0x4247('0xc')](_0x4247('0xd'),path[_0x4247('0xe')](config['root'],'public'));}if(_0x1ac786==='development'||_0x1ac786===_0x4247('0xf')){_0xfd2d30['set'](_0x4247('0xd'),path['join'](config[_0x4247('0x10')],'client'));_0xfd2d30['use'](errorHandler());}_0xfd2d30[_0x4247('0xc')](_0x4247('0x11'),function(_0x34f9fe,_0x475eb1){if(this[_0x34f9fe]instanceof Date){_0x475eb1=this[_0x34f9fe][_0x4247('0x12')]()[_0x4247('0x13')]('.')[0x0]+'Z';}return _0x475eb1;});_0xfd2d30['use'](express[_0x4247('0x14')](_0xfd2d30['get'](_0x4247('0xd'))));_0xfd2d30[_0x4247('0xc')](_0x4247('0x15'),config[_0x4247('0x10')]+_0x4247('0x16'));_0xfd2d30[_0x4247('0x17')](_0x4247('0x18'),require('ejs')['renderFile']);_0xfd2d30[_0x4247('0xc')](_0x4247('0x19'),'html');_0xfd2d30['use'](bodyParser[_0x4247('0x1a')]({'limit':'50mb','extended':!![]}));_0xfd2d30[_0x4247('0x1b')](bodyParser[_0x4247('0x1c')]({'limit':_0x4247('0x1d')}));_0xfd2d30[_0x4247('0x1b')](cors());_0xfd2d30['use'](methodOverride());_0xfd2d30['use'](cookieParser());_0xfd2d30[_0x4247('0x1b')](passport['initialize']());}; \ No newline at end of file +var _0xfcbe=['./environment','../mysqldb','default','env','production','set','appPath','join','root','development','test','client','use','json\x20replacer','split','get','/server/views','engine','html','ejs','renderFile','view\x20engine','50mb','json','initialize','express','serve-favicon','body-parser','cookie-parser','errorhandler','path','passport','cors','moment'];(function(_0x19d988,_0x294a0f){var _0x5f2138=function(_0x2a142c){while(--_0x2a142c){_0x19d988['push'](_0x19d988['shift']());}};_0x5f2138(++_0x294a0f);}(_0xfcbe,0x7f));var _0xefcb=function(_0x395c20,_0x55032d){_0x395c20=_0x395c20-0x0;var _0x47b077=_0xfcbe[_0x395c20];return _0x47b077;};'use strict';var express=require(_0xefcb('0x0'));var favicon=require(_0xefcb('0x1'));var bodyParser=require(_0xefcb('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0xefcb('0x3'));var errorHandler=require(_0xefcb('0x4'));var path=require(_0xefcb('0x5'));var passport=require(_0xefcb('0x6'));var cors=require(_0xefcb('0x7'));var moment=require(_0xefcb('0x8'));var config=require(_0xefcb('0x9'));var db=require(_0xefcb('0xa'))['db'];exports[_0xefcb('0xb')]=function(_0x5639bb){var _0xa2eea2=_0x5639bb['get'](_0xefcb('0xc'));if(_0xa2eea2===_0xefcb('0xd')){_0x5639bb[_0xefcb('0xe')](_0xefcb('0xf'),path[_0xefcb('0x10')](config[_0xefcb('0x11')],'public'));}if(_0xa2eea2===_0xefcb('0x12')||_0xa2eea2===_0xefcb('0x13')){_0x5639bb['set']('appPath',path[_0xefcb('0x10')](config[_0xefcb('0x11')],_0xefcb('0x14')));_0x5639bb[_0xefcb('0x15')](errorHandler());}_0x5639bb[_0xefcb('0xe')](_0xefcb('0x16'),function(_0xecd2aa,_0x568cc9){if(this[_0xecd2aa]instanceof Date){_0x568cc9=this[_0xecd2aa]['toISOString']()[_0xefcb('0x17')]('.')[0x0]+'Z';}return _0x568cc9;});_0x5639bb[_0xefcb('0x15')](express['static'](_0x5639bb[_0xefcb('0x18')](_0xefcb('0xf'))));_0x5639bb[_0xefcb('0xe')]('views',config[_0xefcb('0x11')]+_0xefcb('0x19'));_0x5639bb[_0xefcb('0x1a')](_0xefcb('0x1b'),require(_0xefcb('0x1c'))[_0xefcb('0x1d')]);_0x5639bb[_0xefcb('0xe')](_0xefcb('0x1e'),_0xefcb('0x1b'));_0x5639bb[_0xefcb('0x15')](bodyParser['urlencoded']({'limit':_0xefcb('0x1f'),'extended':!![]}));_0x5639bb[_0xefcb('0x15')](bodyParser[_0xefcb('0x20')]({'limit':'50mb'}));_0x5639bb[_0xefcb('0x15')](cors());_0x5639bb['use'](methodOverride());_0x5639bb[_0xefcb('0x15')](cookieParser());_0x5639bb['use'](passport[_0xefcb('0x21')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index a57de96..62bdb1b 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 _0x1f74=['substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','family','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','cpus','model','join','md5','digest','hex','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','createHash','update'];(function(_0x16a252,_0x3310ea){var _0x464b63=function(_0x1a61ee){while(--_0x1a61ee){_0x16a252['push'](_0x16a252['shift']());}};_0x464b63(++_0x3310ea);}(_0x1f74,0x73));var _0x41f7=function(_0x18d710,_0x153c7c){_0x18d710=_0x18d710-0x0;var _0x54f4eb=_0x1f74[_0x18d710];return _0x54f4eb;};'use strict';var _=require(_0x41f7('0x0'));var os=require('os');var crypto=require(_0x41f7('0x1'));var machine=require(_0x41f7('0x2'));var exec=require(_0x41f7('0x3'))[_0x41f7('0x4')];var config=require(_0x41f7('0x5'));function getInterfaces(){var _0x5f458e=[];var _0x3695b6=os[_0x41f7('0x6')]();var _0xa7536c=_[_0x41f7('0x7')](_[_0x41f7('0x8')](_0x3695b6));for(var _0xf3c699=0x0;_0xf3c699<_0xa7536c[_0x41f7('0x9')];_0xf3c699++){var _0x5dacc3=_0x3695b6[_0xa7536c[_0xf3c699]][_0x41f7('0xa')](function(_0x4e04ed){return _0x4e04ed[_0x41f7('0xb')]==='IPv4'&&_0x4e04ed['internal']===![];});_0x5f458e=_0x5f458e[_0x41f7('0xc')](_0x5dacc3);}return _0x5f458e;}function getFirstInterface(){var _0x58c960=_[_0x41f7('0xd')](getInterfaces());return{'macAddress':_0x58c960&&_0x58c960[_0x41f7('0xe')]?_0x58c960[_0x41f7('0xe')]:_0x41f7('0xf'),'ipAddress':_0x58c960&&_0x58c960['address']?_0x58c960[_0x41f7('0x10')]:_0x41f7('0x11')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x3ec576=_['orderBy'](os[_0x41f7('0x12')]()['map'](function(_0x2256d1){return _0x2256d1[_0x41f7('0x13')];}))[_0x41f7('0x14')](':');return crypto['createHash'](_0x41f7('0x15'))['update'](_0x3ec576)[_0x41f7('0x16')](_0x41f7('0x17'));}exports[_0x41f7('0x18')]=function(){var _0x898bb0=os[_0x41f7('0x19')]();var _0x3910be=/[0-9a-f-]{36}/;if(config[_0x41f7('0x1a')]&&_0x3910be[_0x41f7('0x1b')](config[_0x41f7('0x1a')])){return config[_0x41f7('0x1a')];}else if(_0x898bb0===_0x41f7('0x1c')){return exec(_0x41f7('0x1d'),{'encoding':_0x41f7('0x1e')})[_0x41f7('0x1f')]('\x0d\x0a','');}else{var _0x396873=getFirstInterface();var _0x2219d2=getCPUhash();var _0x3c6029=_0x2219d2+'|'+os[_0x41f7('0x20')]()+'|'+_0x396873[_0x41f7('0x21')]+'|'+_0x396873[_0x41f7('0x22')];var _0x4d2830=crypto[_0x41f7('0x23')](_0x41f7('0x15'))[_0x41f7('0x24')](_0x3c6029)['digest'](_0x41f7('0x17'));return _0x4d2830[_0x41f7('0x25')](0x0,0x8)+'-'+_0x4d2830[_0x41f7('0x25')](0x8,0xc)+'-'+_0x4d2830['substring'](0xc,0x10)+'-'+_0x4d2830['substring'](0x10,0x14)+'-'+_0x4d2830[_0x41f7('0x25')](0x14);}}; \ No newline at end of file +var _0x659c=['utf8','replace','macAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','length','filter','IPv4','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','model','join','createHash','md5','update','digest','hex','getUuid','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid'];(function(_0x5dc53c,_0x52ed03){var _0x4f3087=function(_0x276f08){while(--_0x276f08){_0x5dc53c['push'](_0x5dc53c['shift']());}};_0x4f3087(++_0x52ed03);}(_0x659c,0x14e));var _0xc659=function(_0x86c6cb,_0x30bb53){_0x86c6cb=_0x86c6cb-0x0;var _0x1b1592=_0x659c[_0x86c6cb];return _0x1b1592;};'use strict';var _=require(_0xc659('0x0'));var os=require('os');var crypto=require(_0xc659('0x1'));var machine=require(_0xc659('0x2'));var exec=require(_0xc659('0x3'))[_0xc659('0x4')];var config=require('../environment');function getInterfaces(){var _0x4f1ea7=[];var _0x5d4c4e=os[_0xc659('0x5')]();var _0x2036d0=_[_0xc659('0x6')](_['keys'](_0x5d4c4e));for(var _0x4317f8=0x0;_0x4317f8<_0x2036d0[_0xc659('0x7')];_0x4317f8++){var _0x56eb36=_0x5d4c4e[_0x2036d0[_0x4317f8]][_0xc659('0x8')](function(_0x1d2e93){return _0x1d2e93['family']===_0xc659('0x9')&&_0x1d2e93['internal']===![];});_0x4f1ea7=_0x4f1ea7[_0xc659('0xa')](_0x56eb36);}return _0x4f1ea7;}function getFirstInterface(){var _0x49d7d0=_[_0xc659('0xb')](getInterfaces());return{'macAddress':_0x49d7d0&&_0x49d7d0[_0xc659('0xc')]?_0x49d7d0[_0xc659('0xc')]:_0xc659('0xd'),'ipAddress':_0x49d7d0&&_0x49d7d0[_0xc659('0xe')]?_0x49d7d0[_0xc659('0xe')]:_0xc659('0xf')};}exports[_0xc659('0x10')]=getFirstInterface;function getCPUhash(){var _0x4e1b05=_[_0xc659('0x6')](os['cpus']()['map'](function(_0x5cf8f1){return _0x5cf8f1[_0xc659('0x11')];}))[_0xc659('0x12')](':');return crypto[_0xc659('0x13')](_0xc659('0x14'))[_0xc659('0x15')](_0x4e1b05)[_0xc659('0x16')](_0xc659('0x17'));}exports[_0xc659('0x18')]=function(){var _0xc3d20a=os[_0xc659('0x19')]();var _0x1df325=/[0-9a-f-]{36}/;if(config[_0xc659('0x1a')]&&_0x1df325['test'](config[_0xc659('0x1a')])){return config[_0xc659('0x1a')];}else if(_0xc3d20a===_0xc659('0x1b')){return exec(_0xc659('0x1c'),{'encoding':_0xc659('0x1d')})[_0xc659('0x1e')]('\x0d\x0a','');}else{var _0x20b728=getFirstInterface();var _0x54dbe9=getCPUhash();var _0x291148=_0x54dbe9+'|'+os['hostname']()+'|'+_0x20b728[_0xc659('0x1f')]+'|'+_0x20b728['ipAddress'];var _0x5c9796=crypto[_0xc659('0x13')](_0xc659('0x14'))[_0xc659('0x15')](_0x291148)[_0xc659('0x16')](_0xc659('0x17'));return _0x5c9796[_0xc659('0x20')](0x0,0x8)+'-'+_0x5c9796[_0xc659('0x20')](0x8,0xc)+'-'+_0x5c9796['substring'](0xc,0x10)+'-'+_0x5c9796[_0xc659('0x20')](0x10,0x14)+'-'+_0x5c9796['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 1d5dada..bcfe3c4 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 _0x3073=['THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','update','encryptString','diff','days','DEMO\x20START\x20AT\x20%s','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','message','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','./hardware','../logger','license','https://www.xcallymotion.com','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','catch','get','data1','then','active','data2','info'];(function(_0x5b3dbb,_0x518159){var _0x123923=function(_0x57db1b){while(--_0x57db1b){_0x5b3dbb['push'](_0x5b3dbb['shift']());}};_0x123923(++_0x518159);}(_0x3073,0x165));var _0x3307=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x3073[_0x3c2a69];return _0x596bc8;};'use strict';var util=require(_0x3307('0x0'));var moment=require(_0x3307('0x1'));var rp=require(_0x3307('0x2'));var BPromise=require(_0x3307('0x3'));var pkginfo=require(_0x3307('0x4'))(module,_0x3307('0x5'));var db=require(_0x3307('0x6'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x3307('0x7'));var logger=require(_0x3307('0x8'))(_0x3307('0x9'));var HOST=_0x3307('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x445572){return new BPromise(function(_0x327a6a,_0x56f2f2){var _0x11604e=util[_0x3307('0xb')]('%s/api/servers/%s/check?version=%s',HOST,_0x445572,module[_0x3307('0xc')][_0x3307('0x5')]);if(oldToken){_0x11604e=util[_0x3307('0xb')](_0x3307('0xd'),HOST,_0x445572,module[_0x3307('0xc')]['version'],oldToken);}var _0x410ac9={'uri':_0x11604e,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x410ac9)['then'](function(_0x19bb71){_0x327a6a(_0x19bb71);})[_0x3307('0xe')](function(_0x4d16f5){_0x56f2f2(_0x4d16f5);});});}function manageLicense(_0x593734,_0x29c5ca){var _0x320b66=_0x29c5ca[_0x3307('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x320b66[_0x3307('0x10')]!==_0x593734&&!_0x320b66['data2']){oldToken=_0x320b66[_0x3307('0x10')];}httpRequest(_0x593734)[_0x3307('0x11')](function(_0x3262fb){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3262fb[_0x3307('0x12')]){isOldTokenSent=![];if(!_0x320b66[_0x3307('0x9')]&&_0x320b66[_0x3307('0x9')]!=_0x3262fb[_0x3307('0x9')]||_0x320b66[_0x3307('0x9')]&&_0x320b66[_0x3307('0x13')]){logger[_0x3307('0x14')](_0x3307('0x15'));}if(_0x320b66[_0x3307('0x9')]&&!_0x320b66[_0x3307('0x13')]&&_0x320b66[_0x3307('0x9')]!=_0x3262fb[_0x3307('0x9')]){logger[_0x3307('0x14')](_0x3307('0x16'));}if(_0x320b66[_0x3307('0x9')]&&!_0x320b66['data2']&&_0x320b66[_0x3307('0x9')]==_0x3262fb[_0x3307('0x9')]){return _0x29c5ca;}return _0x29c5ca['update']({'data1':_0x593734,'data2':null,'license':_0x3262fb['license']});}else{if(_0x3262fb['license']||_0x320b66['license']){if(!_0x320b66['data2']){if(_0x320b66['data1']==_0x593734){GRAY_PERIOD_REASON=_0x3307('0x17');logger[_0x3307('0x14')](_0x3307('0x18'));}else{GRAY_PERIOD_REASON=_0x3307('0x19');logger[_0x3307('0x14')](_0x3307('0x1a'),_0x320b66[_0x3307('0x10')],_0x593734);}logger['info'](_0x3307('0x1b'),GRAY_PERIOD_REASON[_0x3307('0x1c')](),moment()[_0x3307('0xb')](_0x3307('0x1d')));return _0x29c5ca[_0x3307('0x1e')]({'data2':encryptor[_0x3307('0x1f')](moment()['format']('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x3307('0x20')](encryptor['decryptString'](_0x320b66[_0x3307('0x13')]),_0x3307('0x21'))>DAYS){logger['info'](_0x3307('0x22'),moment()[_0x3307('0xb')]('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x29c5ca[_0x3307('0x1e')]({'data1':_0x593734,'data2':null,'license':null});}}}else{if(_0x320b66['data1']!=_0x593734){logger[_0x3307('0x14')](_0x3307('0x1a'),_0x320b66[_0x3307('0x10')],_0x593734);return _0x29c5ca[_0x3307('0x1e')]({'data1':_0x593734,'data2':null,'license':null});}}}return _0x29c5ca;})[_0x3307('0x11')](function(_0x2a0687){_0x29c5ca=_0x2a0687;})[_0x3307('0xe')](function(_0x196abe){logger['error'](_0x196abe['message']);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x3307('0x23')](),_0x29c5ca);},TIME);});}function defaultLicense(){var _0x26af7e=hardware[_0x3307('0x23')]();if(_0x26af7e){return db[_0x3307('0x24')][_0x3307('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x26af7e}})[_0x3307('0x26')](function(_0x3ae01f,_0x20ac48){logger[_0x3307('0x14')](_0x3307('0x27'),_0x26af7e);manageLicense(_0x26af7e,_0x3ae01f);})[_0x3307('0xe')](function(_0x356ba0){logger[_0x3307('0x28')](_0x356ba0[_0x3307('0x29')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x1cd9=['update','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','decryptString','days','DEMO\x20START\x20AT\x20%s','catch','error','message','finally','getUuid','License','util','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','license','%s/api/servers/%s/check?version=%s','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED'];(function(_0x1f7928,_0xdafed0){var _0x498443=function(_0x2da729){while(--_0x2da729){_0x1f7928['push'](_0x1f7928['shift']());}};_0x498443(++_0xdafed0);}(_0x1cd9,0x164));var _0x91cd=function(_0x20d4cd,_0xf9d701){_0x20d4cd=_0x20d4cd-0x0;var _0x35d0cd=_0x1cd9[_0x20d4cd];return _0x35d0cd;};'use strict';var util=require(_0x91cd('0x0'));var moment=require('moment');var rp=require('request-promise');var BPromise=require(_0x91cd('0x1'));var pkginfo=require(_0x91cd('0x2'))(module,_0x91cd('0x3'));var db=require(_0x91cd('0x4'))['db'];var encryptor=require(_0x91cd('0x5'));var hardware=require(_0x91cd('0x6'));var logger=require('../logger')(_0x91cd('0x7'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0xfc4e6a){return new BPromise(function(_0x4a97e0,_0x1d9579){var _0xe27855=util['format'](_0x91cd('0x8'),HOST,_0xfc4e6a,module['exports'][_0x91cd('0x3')]);if(oldToken){_0xe27855=util[_0x91cd('0x9')](_0x91cd('0xa'),HOST,_0xfc4e6a,module['exports'][_0x91cd('0x3')],oldToken);}var _0x53311f={'uri':_0xe27855,'method':_0x91cd('0xb'),'timeout':0xea60,'json':!![]};return rp(_0x53311f)[_0x91cd('0xc')](function(_0x4cb46a){_0x4a97e0(_0x4cb46a);})['catch'](function(_0xf4738d){_0x1d9579(_0xf4738d);});});}function manageLicense(_0x5b5112,_0x113ca5){var _0x31c7ab=_0x113ca5['get']({'plain':!![]});if(!isOldTokenSent&&_0x31c7ab[_0x91cd('0xd')]!==_0x5b5112&&!_0x31c7ab[_0x91cd('0xe')]){oldToken=_0x31c7ab[_0x91cd('0xd')];}httpRequest(_0x5b5112)[_0x91cd('0xc')](function(_0x5e0237){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x5e0237[_0x91cd('0xf')]){isOldTokenSent=![];if(!_0x31c7ab['license']&&_0x31c7ab[_0x91cd('0x7')]!=_0x5e0237[_0x91cd('0x7')]||_0x31c7ab[_0x91cd('0x7')]&&_0x31c7ab[_0x91cd('0xe')]){logger[_0x91cd('0x10')](_0x91cd('0x11'));}if(_0x31c7ab['license']&&!_0x31c7ab[_0x91cd('0xe')]&&_0x31c7ab['license']!=_0x5e0237[_0x91cd('0x7')]){logger[_0x91cd('0x10')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x31c7ab['license']&&!_0x31c7ab['data2']&&_0x31c7ab[_0x91cd('0x7')]==_0x5e0237[_0x91cd('0x7')]){return _0x113ca5;}return _0x113ca5[_0x91cd('0x12')]({'data1':_0x5b5112,'data2':null,'license':_0x5e0237[_0x91cd('0x7')]});}else{if(_0x5e0237[_0x91cd('0x7')]||_0x31c7ab[_0x91cd('0x7')]){if(!_0x31c7ab['data2']){if(_0x31c7ab[_0x91cd('0xd')]==_0x5b5112){GRAY_PERIOD_REASON='Disabled';logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x91cd('0x13');logger[_0x91cd('0x10')](_0x91cd('0x14'),_0x31c7ab[_0x91cd('0xd')],_0x5b5112);}logger['info'](_0x91cd('0x15'),GRAY_PERIOD_REASON[_0x91cd('0x16')](),moment()['format'](_0x91cd('0x17')));return _0x113ca5['update']({'data2':encryptor[_0x91cd('0x18')](moment()[_0x91cd('0x9')](_0x91cd('0x17')))});}else{if(moment()['diff'](encryptor[_0x91cd('0x19')](_0x31c7ab[_0x91cd('0xe')]),_0x91cd('0x1a'))>DAYS){logger[_0x91cd('0x10')](_0x91cd('0x1b'),moment()[_0x91cd('0x9')](_0x91cd('0x17')));isOldTokenSent=![];return _0x113ca5[_0x91cd('0x12')]({'data1':_0x5b5112,'data2':null,'license':null});}}}else{if(_0x31c7ab[_0x91cd('0xd')]!=_0x5b5112){logger[_0x91cd('0x10')](_0x91cd('0x14'),_0x31c7ab['data1'],_0x5b5112);return _0x113ca5[_0x91cd('0x12')]({'data1':_0x5b5112,'data2':null,'license':null});}}}return _0x113ca5;})[_0x91cd('0xc')](function(_0x5cf130){_0x113ca5=_0x5cf130;})[_0x91cd('0x1c')](function(_0xe4be44){logger[_0x91cd('0x1d')](_0xe4be44[_0x91cd('0x1e')]);})[_0x91cd('0x1f')](function(){setTimeout(function(){manageLicense(hardware[_0x91cd('0x20')](),_0x113ca5);},TIME);});}function defaultLicense(){var _0xc43e44=hardware[_0x91cd('0x20')]();if(_0xc43e44){return db[_0x91cd('0x21')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0xc43e44}})['spread'](function(_0x352977,_0x322a61){logger[_0x91cd('0x10')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0xc43e44);manageLicense(_0xc43e44,_0x352977);})[_0x91cd('0x1c')](function(_0x216e3d){logger[_0x91cd('0x1d')](_0x216e3d['message']);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 2a988a5..fd70405 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 _0xda7e=['role','sequelize','COUNT','col','count','telephone','users','telephones','admin','pick','countBy','user','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','bluebird','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','getUuid','License','defaults','then','catch','uuid','data1','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','deadline','grayReason','changed','disabled','message','User'];(function(_0x412085,_0x435fe6){var _0x51e670=function(_0x2a6f7f){while(--_0x2a6f7f){_0x412085['push'](_0x412085['shift']());}};_0x51e670(++_0x435fe6);}(_0xda7e,0x1bd));var _0xeda7=function(_0x29e3b6,_0x40b0b4){_0x29e3b6=_0x29e3b6-0x0;var _0x55d4b0=_0xda7e[_0x29e3b6];return _0x55d4b0;};'use strict';var util=require(_0xeda7('0x0'));var _=require('lodash');var moment=require('moment');var BPromise=require(_0xeda7('0x1'));var hardware=require('./hardware');var encryptor=require('../../components/encryptor');var db=require(_0xeda7('0x2'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xeda7('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xeda7('0x4'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xeda7('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xeda7('0x5'),'machineUuid':hardware[_0xeda7('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x78134){return new BPromise(function(_0x856074,_0x28ec56){return db[_0xeda7('0x7')]['find'](_[_0xeda7('0x8')](_0x78134,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x489ae2){return checkLicense(_0x489ae2,null);})[_0xeda7('0x9')](function(_0x493e88){_0x856074(_0x493e88);return;})[_0xeda7('0xa')](function(_0x298d0b){_0x28ec56(_0x298d0b);});});}function checkLicense(_0x3fda07,_0x224474){if(!_0x3fda07){demoLicense[_0xeda7('0xb')]=_0x3fda07[_0xeda7('0xc')];return demoLicense;}try{var _0x1b2628=_0x224474||_0x3fda07['license'];if(_['isEmpty'](_0x1b2628)){throw new Error(_0xeda7('0xd'));}var _0xd8ef0d=_0x3fda07[_0xeda7('0xc')];var _0x2fc722=_0x3fda07[_0xeda7('0xe')];var _0x4d17d1=_0xd8ef0d[_0xeda7('0xf')]('-')[0x4];var _0x5d6877=_0xd8ef0d[_0xeda7('0xf')]('-')[0x0];var _0xc5dd0c=encryptor[_0xeda7('0x10')](_0x1b2628,util[_0xeda7('0x11')](_0xeda7('0x12'),_0x4d17d1,_0xd8ef0d,_0x5d6877));var _0x20f28b=JSON[_0xeda7('0x13')](_0xc5dd0c);_0x20f28b[_0xeda7('0x14')]=![];_0x20f28b[_0xeda7('0xb')]=_0xd8ef0d;_0x20f28b[_0xeda7('0x15')]=hardware[_0xeda7('0x6')]();if(_0x2fc722){var _0x18f06c=encryptor[_0xeda7('0x10')](_0x2fc722);_0x20f28b['gray']=_0x18f06c;_0x20f28b[_0xeda7('0x16')]=moment(_0x18f06c)['add'](0x7,'days')['format']();_0x20f28b[_0xeda7('0x17')]=_0x20f28b[_0xeda7('0xb')]!=_0x20f28b[_0xeda7('0x15')]?_0xeda7('0x18'):_0xeda7('0x19');}return _0x20f28b;}catch(_0x3ae7aa){breakingLicense[_0xeda7('0xb')]=_0x3fda07[_0xeda7('0xc')];breakingLicense[_0xeda7('0x1a')]=_0x3ae7aa['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xeacc15,_0x3c3f2f){getLicense()['then'](function(_0x5c0ad6){return db[_0xeda7('0x1b')]['findAll']({'attributes':[_0xeda7('0x1c'),[db[_0xeda7('0x1d')]['fn'](_0xeda7('0x1e'),db['sequelize'][_0xeda7('0x1f')](_0xeda7('0x1c'))),_0xeda7('0x20')]],'group':_0xeda7('0x1c'),'where':{'role':{'$or':['admin','user',_0xeda7('0x21')]}},'raw':!![]})[_0xeda7('0x9')](function(_0x336c32){var _0x2b43c9={'user':_0x5c0ad6[_0xeda7('0x22')]||0x0,'telephone':_0x5c0ad6[_0xeda7('0x23')]||0x0};_0x336c32['forEach'](function(_0x191622){var _0x2e8468=_0x191622['role']===_0xeda7('0x24')?'user':_0x191622['role'];_0x2b43c9[_0x2e8468]-=_0x191622['count'];if(_0x2b43c9[_0x2e8468]<0x0)_0x2b43c9[_0x2e8468]=0x0;});_0xeacc15(_0x2b43c9);return;});})[_0xeda7('0xa')](function(_0x5802da){_0x3c3f2f(_0x5802da);});});}function checkUserLimits(_0x1789e6){return new BPromise(function(_0xe5bddd,_0x5d628e){getLimits()[_0xeda7('0x9')](function(_0x14265f){var _0x6a283c=_[_0xeda7('0x25')](_[_0xeda7('0x26')](_0x1789e6,'role'),['admin',_0xeda7('0x27'),_0xeda7('0x21')]);var _0x5aaccd=(_0x6a283c[_0xeda7('0x24')]||0x0)+(_0x6a283c[_0xeda7('0x27')]||0x0);var _0x15cba1=_0x6a283c[_0xeda7('0x21')]||0x0;if(_0x5aaccd>_0x14265f['user'])return _0x5d628e(_0xeda7('0x28'));if(_0x15cba1>_0x14265f[_0xeda7('0x21')])return _0x5d628e(_0xeda7('0x29'));return _0xe5bddd();})[_0xeda7('0xa')](function(_0x3196cf){_0x5d628e(_0x3196cf);});});}module[_0xeda7('0x2a')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xe0ae=['format','grayReason','changed','disabled','message','User','findAll','role','COUNT','col','count','admin','user','catch','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','exports','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','License','find','defaults','then','uuid','license','data1','data2','split','decryptString','parse','demo','machineUuid','gray','deadline','add'];(function(_0x25a54f,_0x1c90bd){var _0x18f270=function(_0x4a4fc7){while(--_0x4a4fc7){_0x25a54f['push'](_0x25a54f['shift']());}};_0x18f270(++_0x1c90bd);}(_0xe0ae,0x6b));var _0xee0a=function(_0x459a0a,_0x25c46f){_0x459a0a=_0x459a0a-0x0;var _0x4ab46c=_0xe0ae[_0x459a0a];return _0x4ab46c;};'use strict';var util=require('util');var _=require(_0xee0a('0x0'));var moment=require(_0xee0a('0x1'));var BPromise=require(_0xee0a('0x2'));var hardware=require(_0xee0a('0x3'));var encryptor=require(_0xee0a('0x4'));var db=require(_0xee0a('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xee0a('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xee0a('0x7'),'machineUuid':hardware[_0xee0a('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0xee0a('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x7319ef){return new BPromise(function(_0x45a1f7,_0x2c0e7d){return db[_0xee0a('0x9')][_0xee0a('0xa')](_[_0xee0a('0xb')](_0x7319ef,{'raw':!![],'where':{'id':0x1}}))[_0xee0a('0xc')](function(_0x21935a){return checkLicense(_0x21935a,null);})[_0xee0a('0xc')](function(_0x22b8b6){_0x45a1f7(_0x22b8b6);return;})['catch'](function(_0x3aa0d4){_0x2c0e7d(_0x3aa0d4);});});}function checkLicense(_0x1ada1b,_0xa9ab08){if(!_0x1ada1b){demoLicense[_0xee0a('0xd')]=_0x1ada1b['data1'];return demoLicense;}try{var _0x4fde3d=_0xa9ab08||_0x1ada1b[_0xee0a('0xe')];if(_['isEmpty'](_0x4fde3d)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x13e4d1=_0x1ada1b[_0xee0a('0xf')];var _0x12b2c2=_0x1ada1b[_0xee0a('0x10')];var _0x8aa6bd=_0x13e4d1[_0xee0a('0x11')]('-')[0x4];var _0x28e1c7=_0x13e4d1['split']('-')[0x0];var _0x4ff7c1=encryptor[_0xee0a('0x12')](_0x4fde3d,util['format']('%s:%s:%s',_0x8aa6bd,_0x13e4d1,_0x28e1c7));var _0xd6fa75=JSON[_0xee0a('0x13')](_0x4ff7c1);_0xd6fa75[_0xee0a('0x14')]=![];_0xd6fa75[_0xee0a('0xd')]=_0x13e4d1;_0xd6fa75[_0xee0a('0x15')]=hardware[_0xee0a('0x8')]();if(_0x12b2c2){var _0x24776f=encryptor['decryptString'](_0x12b2c2);_0xd6fa75[_0xee0a('0x16')]=_0x24776f;_0xd6fa75[_0xee0a('0x17')]=moment(_0x24776f)[_0xee0a('0x18')](0x7,'days')[_0xee0a('0x19')]();_0xd6fa75[_0xee0a('0x1a')]=_0xd6fa75[_0xee0a('0xd')]!=_0xd6fa75[_0xee0a('0x15')]?_0xee0a('0x1b'):_0xee0a('0x1c');}return _0xd6fa75;}catch(_0x22edbe){breakingLicense['uuid']=_0x1ada1b['data1'];breakingLicense['message']=_0x22edbe[_0xee0a('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x20b7fa,_0x2d03cf){getLicense()[_0xee0a('0xc')](function(_0x46f367){return db[_0xee0a('0x1e')][_0xee0a('0x1f')]({'attributes':[_0xee0a('0x20'),[db['sequelize']['fn'](_0xee0a('0x21'),db['sequelize'][_0xee0a('0x22')]('role')),_0xee0a('0x23')]],'group':'role','where':{'role':{'$or':[_0xee0a('0x24'),'user','telephone']}},'raw':!![]})[_0xee0a('0xc')](function(_0x5a1598){var _0x423dc0={'user':_0x46f367['users']||0x0,'telephone':_0x46f367['telephones']||0x0};_0x5a1598['forEach'](function(_0x102118){var _0x28fe03=_0x102118['role']===_0xee0a('0x24')?_0xee0a('0x25'):_0x102118[_0xee0a('0x20')];_0x423dc0[_0x28fe03]-=_0x102118[_0xee0a('0x23')];if(_0x423dc0[_0x28fe03]<0x0)_0x423dc0[_0x28fe03]=0x0;});_0x20b7fa(_0x423dc0);return;});})[_0xee0a('0x26')](function(_0x4091e8){_0x2d03cf(_0x4091e8);});});}function checkUserLimits(_0x8cbaad){return new BPromise(function(_0x397e41,_0xa899b5){getLimits()[_0xee0a('0xc')](function(_0x41305e){var _0x473507=_[_0xee0a('0x27')](_[_0xee0a('0x28')](_0x8cbaad,_0xee0a('0x20')),[_0xee0a('0x24'),_0xee0a('0x25'),_0xee0a('0x29')]);var _0x1486be=(_0x473507[_0xee0a('0x24')]||0x0)+(_0x473507[_0xee0a('0x25')]||0x0);var _0x1fe41b=_0x473507[_0xee0a('0x29')]||0x0;if(_0x1486be>_0x41305e[_0xee0a('0x25')])return _0xa899b5(_0xee0a('0x2a'));if(_0x1fe41b>_0x41305e['telephone'])return _0xa899b5('License\x20limit\x20reached\x20for\x20telephones');return _0x397e41();})['catch'](function(_0x71c72){_0xa899b5(_0x71c72);});});}module[_0xee0a('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 2ff14ef..737ceb0 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 _0xfff0=['app-id','http://localhost:9000','myappanuglar-secret'];(function(_0x55e591,_0x55d796){var _0x29b2ed=function(_0x1b8ddc){while(--_0x1b8ddc){_0x55e591['push'](_0x55e591['shift']());}};_0x29b2ed(++_0x55d796);}(_0xfff0,0x139));var _0x0fff=function(_0x5cf8db,_0x12f0ce){_0x5cf8db=_0x5cf8db-0x0;var _0x265e2d=_0xfff0[_0x5cf8db];return _0x265e2d;};'use strict';module['exports']={'DOMAIN':_0x0fff('0x0'),'SESSION_SECRET':_0x0fff('0x1'),'GOOGLE_ID':_0x0fff('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x77e6=['app-id','secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x45c2bb,_0x339c62){var _0xfd9176=function(_0x2fd9a0){while(--_0x2fd9a0){_0x45c2bb['push'](_0x45c2bb['shift']());}};_0xfd9176(++_0x339c62);}(_0x77e6,0x1a6));var _0x677e=function(_0x411ff3,_0x45b118){_0x411ff3=_0x411ff3-0x0;var _0x25396b=_0x77e6[_0x411ff3];return _0x25396b;};'use strict';module[_0x677e('0x0')]={'DOMAIN':_0x677e('0x1'),'SESSION_SECRET':_0x677e('0x2'),'GOOGLE_ID':_0x677e('0x3'),'GOOGLE_SECRET':_0x677e('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 06f956e..26b1497 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4651=['message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','exports','Logger','transports','File','%s-%s','error','info','debugLevel','winston','util','path','INFO','join','xcally','format','%s-%s.log'];(function(_0x11b059,_0x39c286){var _0x4180b9=function(_0x57acc4){while(--_0x57acc4){_0x11b059['push'](_0x11b059['shift']());}};_0x4180b9(++_0x39c286);}(_0x4651,0x1f2));var _0x1465=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4651[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var winston=require(_0x1465('0x0'));var util=require(_0x1465('0x1'));var path=require(_0x1465('0x2'));var debugLevel=_0x1465('0x3');function filename(_0x2ccab8,_0x3432f8){return path[_0x1465('0x4')]('/var','log',_0x1465('0x5'),util[_0x1465('0x6')](_0x1465('0x7'),_0x2ccab8,_0x3432f8));}function formatter(_0x53a0b8,_0xd00510){_0xd00510['message']=_0xd00510[_0x1465('0x8')][_0x1465('0x9')](/@@{/g,'{{{')[_0x1465('0x9')](/}@@/g,_0x1465('0xa'))[_0x1465('0x9')](/@{/g,'{{')[_0x1465('0x9')](/}@/g,'}}');return util[_0x1465('0x6')](_0x1465('0xb'),moment()[_0x1465('0x6')](_0x1465('0xc')),_0xd00510[_0x1465('0xd')]['toUpperCase'](),_0x53a0b8,_0xd00510[_0x1465('0x8')]);}module[_0x1465('0xe')]=function(_0x528f29){return new winston[(_0x1465('0xf'))]({'transports':[new winston[(_0x1465('0x10'))][(_0x1465('0x11'))]({'name':util[_0x1465('0x6')](_0x1465('0x12'),_0x528f29,'error'),'filename':filename(_0x528f29,_0x1465('0x13')),'level':_0x1465('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x6469b9){return formatter(_0x528f29,_0x6469b9);}}),new winston[(_0x1465('0x10'))][(_0x1465('0x11'))]({'name':util[_0x1465('0x6')](_0x1465('0x12'),_0x528f29,_0x1465('0x14')),'filename':filename(_0x528f29,_0x1465('0x14')),'level':_0x1465('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x24f6e7){return formatter(_0x528f29,_0x24f6e7);}}),new winston[(_0x1465('0x10'))]['Console']({'level':process['env'][_0x1465('0x15')]||debugLevel,'json':![],'formatter':function(_0x30ba12){return formatter(_0x528f29,_0x30ba12);}})]});}; \ No newline at end of file +var _0x51f4=['[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','transports','File','%s-%s','error','info','moment','util','path','INFO','join','log','xcally','format','%s-%s.log','message','{{{','replace','}}}'];(function(_0x2ca2d0,_0x3ea8e4){var _0x521c23=function(_0x5b0731){while(--_0x5b0731){_0x2ca2d0['push'](_0x2ca2d0['shift']());}};_0x521c23(++_0x3ea8e4);}(_0x51f4,0x17f));var _0x451f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x51f4[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x451f('0x0'));var winston=require('winston');var util=require(_0x451f('0x1'));var path=require(_0x451f('0x2'));var debugLevel=_0x451f('0x3');function filename(_0x2d89e3,_0x5b9059){return path[_0x451f('0x4')]('/var',_0x451f('0x5'),_0x451f('0x6'),util[_0x451f('0x7')](_0x451f('0x8'),_0x2d89e3,_0x5b9059));}function formatter(_0x537355,_0x439259){_0x439259[_0x451f('0x9')]=_0x439259[_0x451f('0x9')]['replace'](/@@{/g,_0x451f('0xa'))[_0x451f('0xb')](/}@@/g,_0x451f('0xc'))[_0x451f('0xb')](/@{/g,'{{')[_0x451f('0xb')](/}@/g,'}}');return util[_0x451f('0x7')](_0x451f('0xd'),moment()[_0x451f('0x7')](_0x451f('0xe')),_0x439259[_0x451f('0xf')][_0x451f('0x10')](),_0x537355,_0x439259[_0x451f('0x9')]);}module['exports']=function(_0x374fc8){return new winston['Logger']({'transports':[new winston[(_0x451f('0x11'))][(_0x451f('0x12'))]({'name':util[_0x451f('0x7')](_0x451f('0x13'),_0x374fc8,_0x451f('0x14')),'filename':filename(_0x374fc8,'error'),'level':_0x451f('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2982ec){return formatter(_0x374fc8,_0x2982ec);}}),new winston[(_0x451f('0x11'))]['File']({'name':util['format'](_0x451f('0x13'),_0x374fc8,'info'),'filename':filename(_0x374fc8,_0x451f('0x15')),'level':_0x451f('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x38eb29){return formatter(_0x374fc8,_0x38eb29);}}),new winston[(_0x451f('0x11'))]['Console']({'level':process['env']['debugLevel']||debugLevel,'json':![],'formatter':function(_0x16ca0d){return formatter(_0x374fc8,_0x16ca0d);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 79a9f26..0abfff2 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 _0x0c45=['email','../../services/email/index.js','routing','../../services/routing/index.js','../../services/xdr/index.js','exports','express','join','../../services/express/index.js','../../services/ami/index.js','agi','../../services/agi/index.js'];(function(_0x229000,_0x4b7a88){var _0x12de30=function(_0x4b002b){while(--_0x4b002b){_0x229000['push'](_0x229000['shift']());}};_0x12de30(++_0x4b7a88);}(_0x0c45,0xea));var _0x50c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c45[_0x3dd15e];return _0x231fd0;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x50c4('0x0'),'script':path[_0x50c4('0x1')](__dirname,_0x50c4('0x2'))},{'name':'ami','script':path[_0x50c4('0x1')](__dirname,_0x50c4('0x3'))},{'name':_0x50c4('0x4'),'script':path[_0x50c4('0x1')](__dirname,_0x50c4('0x5'))},{'name':_0x50c4('0x6'),'script':path['join'](__dirname,_0x50c4('0x7'))},{'name':_0x50c4('0x8'),'script':path['join'](__dirname,_0x50c4('0x9'))},{'name':'xdr','script':path[_0x50c4('0x1')](__dirname,_0x50c4('0xa'))}]};module[_0x50c4('0xb')]=config; \ No newline at end of file +var _0xf8a1=['../../services/routing/index.js','exports','path','express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing'];(function(_0x2805ec,_0x5570ad){var _0x593ed8=function(_0x3ecd01){while(--_0x3ecd01){_0x2805ec['push'](_0x2805ec['shift']());}};_0x593ed8(++_0x5570ad);}(_0xf8a1,0x17b));var _0x1f8a=function(_0x200076,_0x5474c0){_0x200076=_0x200076-0x0;var _0x513ea7=_0xf8a1[_0x200076];return _0x513ea7;};'use strict';var path=require(_0x1f8a('0x0'));var os=require('os');var config={'apps':[{'name':_0x1f8a('0x1'),'script':path[_0x1f8a('0x2')](__dirname,_0x1f8a('0x3'))},{'name':_0x1f8a('0x4'),'script':path[_0x1f8a('0x2')](__dirname,_0x1f8a('0x5'))},{'name':_0x1f8a('0x6'),'script':path[_0x1f8a('0x2')](__dirname,_0x1f8a('0x7'))},{'name':_0x1f8a('0x8'),'script':path[_0x1f8a('0x2')](__dirname,_0x1f8a('0x9'))},{'name':_0x1f8a('0xa'),'script':path['join'](__dirname,_0x1f8a('0xb'))},{'name':'xdr','script':path[_0x1f8a('0x2')](__dirname,'../../services/xdr/index.js')}]};module[_0x1f8a('0xc')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 391f4da..508017b 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 _0x5920=['./config','connected','start','then','disconnect','stop','list','describe','delete','dump','pm2'];(function(_0x266e57,_0x41125b){var _0x4cdc1d=function(_0x3d3734){while(--_0x3d3734){_0x266e57['push'](_0x266e57['shift']());}};_0x4cdc1d(++_0x41125b);}(_0x5920,0xdb));var _0x0592=function(_0x36e7a4,_0xb4f27a){_0x36e7a4=_0x36e7a4-0x0;var _0xc831f1=_0x5920[_0x36e7a4];return _0xc831f1;};'use strict';var pm2=require(_0x0592('0x0'));var BPromise=require('bluebird');var config=require(_0x0592('0x1'));function connect(){return new BPromise(function(_0x2e6d82,_0xa29160){return pm2['connect'](function(_0x5f9bd5){if(_0x5f9bd5){return _0xa29160(_0x5f9bd5);}return _0x2e6d82(_0x0592('0x2'));});});};exports[_0x0592('0x3')]=function(_0x1c0c4a){return connect()[_0x0592('0x4')](function(){return new BPromise(function(_0x2b86a4,_0x23a52f){return pm2[_0x0592('0x3')](_0x1c0c4a,function(_0x1fa271,_0x1aa5ce){if(_0x1fa271){return _0x23a52f(_0x1fa271);}pm2[_0x0592('0x5')]();return _0x2b86a4(_0x1aa5ce);});});});};exports['stop']=function(_0x57d97d){return connect()[_0x0592('0x4')](function(){return new BPromise(function(_0xdd85f,_0x5bec5e){return pm2[_0x0592('0x6')](_0x57d97d,function(_0x4f7a4f,_0x3f6a64){if(_0x4f7a4f){return _0x5bec5e(_0x4f7a4f);}pm2[_0x0592('0x5')]();return _0xdd85f(_0x3f6a64);});});});};exports['restart']=function(_0x4c71f4){return connect()[_0x0592('0x4')](function(){return new BPromise(function(_0x1dff17,_0x276c62){return pm2['restart'](_0x4c71f4,function(_0x4fe3d2,_0x71240a){if(_0x4fe3d2){return _0x276c62(_0x4fe3d2);}pm2[_0x0592('0x5')]();return _0x1dff17(_0x71240a);});});});};exports[_0x0592('0x7')]=function(){return connect()[_0x0592('0x4')](function(){return new BPromise(function(_0x450c4e,_0x312703){return pm2[_0x0592('0x7')](function(_0x362ae6,_0x2557dc){if(_0x362ae6){return _0x312703(_0x362ae6);}pm2['disconnect']();return _0x450c4e(_0x2557dc);});});});};exports[_0x0592('0x8')]=function(_0xb0c830){return connect()[_0x0592('0x4')](function(){return new BPromise(function(_0xe7c9b3,_0x4d0dea){return pm2[_0x0592('0x8')](_0xb0c830,function(_0x1f3fd0,_0x191066){if(_0x1f3fd0){return _0x4d0dea(_0x1f3fd0);}pm2[_0x0592('0x5')]();return _0xe7c9b3(_0x191066);});});});};exports[_0x0592('0x9')]=function(_0x56a352){return connect()['then'](function(){return new BPromise(function(_0x22e80a,_0x430455){return pm2[_0x0592('0x9')](_0x56a352,function(_0x545699,_0x4f5bef){if(_0x545699){return _0x430455(_0x545699);}pm2[_0x0592('0x5')]();return _0x22e80a(_0x4f5bef);});});});};exports[_0x0592('0xa')]=function(){return connect()[_0x0592('0x4')](function(){return new BPromise(function(_0x5ba902,_0x18fce2){return pm2[_0x0592('0xa')](function(_0x6a8649){if(_0x6a8649){return _0x18fce2(_0x6a8649);}return _0x5ba902('saved');});});});}; \ No newline at end of file +var _0xc2a7=['pm2','./config','connect','then','disconnect','stop','restart','list','describe','delete','dump','saved'];(function(_0x628452,_0x5ee9fc){var _0xc14d6f=function(_0x326465){while(--_0x326465){_0x628452['push'](_0x628452['shift']());}};_0xc14d6f(++_0x5ee9fc);}(_0xc2a7,0x138));var _0x7c2a=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc2a7[_0x4a9fb1];return _0x348672;};'use strict';var pm2=require(_0x7c2a('0x0'));var BPromise=require('bluebird');var config=require(_0x7c2a('0x1'));function connect(){return new BPromise(function(_0x3318bf,_0x4d1fb4){return pm2[_0x7c2a('0x2')](function(_0x2fe4d7){if(_0x2fe4d7){return _0x4d1fb4(_0x2fe4d7);}return _0x3318bf('connected');});});};exports['start']=function(_0x3de53a){return connect()[_0x7c2a('0x3')](function(){return new BPromise(function(_0xcecfc6,_0x29b572){return pm2['start'](_0x3de53a,function(_0x1b2059,_0xce0657){if(_0x1b2059){return _0x29b572(_0x1b2059);}pm2[_0x7c2a('0x4')]();return _0xcecfc6(_0xce0657);});});});};exports[_0x7c2a('0x5')]=function(_0x25bbe2){return connect()['then'](function(){return new BPromise(function(_0x3ddba9,_0xf3c6cb){return pm2['stop'](_0x25bbe2,function(_0x18d1c1,_0x488164){if(_0x18d1c1){return _0xf3c6cb(_0x18d1c1);}pm2[_0x7c2a('0x4')]();return _0x3ddba9(_0x488164);});});});};exports['restart']=function(_0x82568b){return connect()[_0x7c2a('0x3')](function(){return new BPromise(function(_0x457568,_0x27cad5){return pm2[_0x7c2a('0x6')](_0x82568b,function(_0x114a63,_0x36a392){if(_0x114a63){return _0x27cad5(_0x114a63);}pm2[_0x7c2a('0x4')]();return _0x457568(_0x36a392);});});});};exports[_0x7c2a('0x7')]=function(){return connect()[_0x7c2a('0x3')](function(){return new BPromise(function(_0x33b77e,_0x29bc1e){return pm2[_0x7c2a('0x7')](function(_0xb69584,_0x2aa04b){if(_0xb69584){return _0x29bc1e(_0xb69584);}pm2['disconnect']();return _0x33b77e(_0x2aa04b);});});});};exports[_0x7c2a('0x8')]=function(_0x3fc539){return connect()['then'](function(){return new BPromise(function(_0x49f5de,_0x40a09a){return pm2[_0x7c2a('0x8')](_0x3fc539,function(_0x4cacd0,_0x3a3947){if(_0x4cacd0){return _0x40a09a(_0x4cacd0);}pm2[_0x7c2a('0x4')]();return _0x49f5de(_0x3a3947);});});});};exports['delete']=function(_0x37166d){return connect()[_0x7c2a('0x3')](function(){return new BPromise(function(_0x263b8b,_0x24352b){return pm2[_0x7c2a('0x9')](_0x37166d,function(_0x661189,_0x1a3a20){if(_0x661189){return _0x24352b(_0x661189);}pm2[_0x7c2a('0x4')]();return _0x263b8b(_0x1a3a20);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x401fb3,_0x322c11){return pm2[_0x7c2a('0xa')](function(_0xd73222){if(_0xd73222){return _0x322c11(_0xd73222);}return _0x401fb3(_0x7c2a('0xb'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index f7d0feb..1878dec 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 _0xebf6=['../logger','schedule','redis','localhost','Setting','find','then','chatTimeout','ChatInteraction','lastMsgAt','minutes','length','info','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','inspect','start','lodash','util','../../config/environment','../../mysqldb'];(function(_0x50e5d1,_0x3bca00){var _0x1f3567=function(_0x1a855e){while(--_0x1a855e){_0x50e5d1['push'](_0x50e5d1['shift']());}};_0x1f3567(++_0x3bca00);}(_0xebf6,0x1e9));var _0x6ebf=function(_0x4cb408,_0x2054c9){_0x4cb408=_0x4cb408-0x0;var _0x28fc52=_0xebf6[_0x4cb408];return _0x28fc52;};'use strict';var _=require(_0x6ebf('0x0'));var moment=require('moment');var Redis=require('ioredis');var util=require(_0x6ebf('0x1'));var config=require(_0x6ebf('0x2'));var db=require(_0x6ebf('0x3'))['db'];var logger=require(_0x6ebf('0x4'))(_0x6ebf('0x5'));config[_0x6ebf('0x6')]=_['defaults'](config[_0x6ebf('0x6')],{'host':_0x6ebf('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x2860d3=0x0;var _0x403c39=[];return db[_0x6ebf('0x8')][_0x6ebf('0x9')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x6ebf('0xa')](function(_0x858c9){_0x2860d3=_0x858c9[_0x6ebf('0xb')];if(_0x2860d3){return db[_0x6ebf('0xc')]['findAll']({'raw':!![],'attributes':['id',_0x6ebf('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x858c9['chatTimeout'],_0x6ebf('0xe'))}}});}else{return[];}})[_0x6ebf('0xa')](function(_0x57028a){if(_0x57028a&&_0x57028a[_0x6ebf('0xf')]){_0x403c39=_['map'](_0x57028a||[],'id');logger[_0x6ebf('0x10')]('[CHAT]\x20Interactions\x20to\x20close:',_0x403c39[_0x6ebf('0x11')]());return db[_0x6ebf('0xc')][_0x6ebf('0x12')]({'closeReason':_0x6ebf('0x13'),'disposition':_0x6ebf('0x14'),'closed':!![],'closedAt':moment()[_0x6ebf('0x15')](_0x6ebf('0x16'))},{'where':{'id':_0x403c39}});}})['then'](function(){if(_0x403c39&&_0x403c39[_0x6ebf('0xf')]){logger[_0x6ebf('0x10')](_0x6ebf('0x17'),_0x403c39['join']());for(var _0x5945bc=0x0;_0x5945bc<_0x403c39[_0x6ebf('0xf')];_0x5945bc++){io[_0x6ebf('0x18')](_0x6ebf('0x19'),{'id':_0x403c39[_0x5945bc],'closed':!![]});}}})[_0x6ebf('0x1a')](function(_0x76c241){logger['error']('[CHAT]\x20Error\x20closing\x20interactions',_0x76c241?util[_0x6ebf('0x1b')](_0x76c241,{'showHidden':![],'depth':null}):'');});}exports[_0x6ebf('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xaef4=['lastMsgAt','minutes','length','[CHAT]\x20Interactions\x20to\x20close:','update','system','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','ioredis','util','../../config/environment','../../mysqldb','schedule','localhost','socket.io-emitter','redis','find','chatTimeout','then','ChatInteraction','findAll'];(function(_0x2da88e,_0x217115){var _0xba813a=function(_0x1dbdad){while(--_0x1dbdad){_0x2da88e['push'](_0x2da88e['shift']());}};_0xba813a(++_0x217115);}(_0xaef4,0x66));var _0x4aef=function(_0x56af40,_0x4c2382){_0x56af40=_0x56af40-0x0;var _0x2548ea=_0xaef4[_0x56af40];return _0x2548ea;};'use strict';var _=require(_0x4aef('0x0'));var moment=require('moment');var Redis=require(_0x4aef('0x1'));var util=require(_0x4aef('0x2'));var config=require(_0x4aef('0x3'));var db=require(_0x4aef('0x4'))['db'];var logger=require('../logger')(_0x4aef('0x5'));config['redis']=_['defaults'](config['redis'],{'host':_0x4aef('0x6'),'port':0x18eb});var io=require(_0x4aef('0x7'))(new Redis(config[_0x4aef('0x8')]));function closeInteractions(){var _0x50c35f=0x0;var _0x1fc1dd=[];return db['Setting'][_0x4aef('0x9')]({'raw':!![],'attributes':['id',_0x4aef('0xa')],'where':{'id':0x1}})[_0x4aef('0xb')](function(_0x3377ef){_0x50c35f=_0x3377ef[_0x4aef('0xa')];if(_0x50c35f){return db[_0x4aef('0xc')][_0x4aef('0xd')]({'raw':!![],'attributes':['id',_0x4aef('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x3377ef['chatTimeout'],_0x4aef('0xf'))}}});}else{return[];}})[_0x4aef('0xb')](function(_0x3caf79){if(_0x3caf79&&_0x3caf79[_0x4aef('0x10')]){_0x1fc1dd=_['map'](_0x3caf79||[],'id');logger['info'](_0x4aef('0x11'),_0x1fc1dd['join']());return db[_0x4aef('0xc')][_0x4aef('0x12')]({'closeReason':_0x4aef('0x13'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0x4aef('0x14'))},{'where':{'id':_0x1fc1dd}});}})[_0x4aef('0xb')](function(){if(_0x1fc1dd&&_0x1fc1dd[_0x4aef('0x10')]){logger[_0x4aef('0x15')](_0x4aef('0x16'),_0x1fc1dd[_0x4aef('0x17')]());for(var _0x39f1c4=0x0;_0x39f1c4<_0x1fc1dd[_0x4aef('0x10')];_0x39f1c4++){io['emit'](_0x4aef('0x18'),{'id':_0x1fc1dd[_0x39f1c4],'closed':!![]});}}})['catch'](function(_0x4de33b){logger[_0x4aef('0x19')](_0x4aef('0x1a'),_0x4de33b?util[_0x4aef('0x1b')](_0x4de33b,{'showHidden':![],'depth':null}):'');});}exports[_0x4aef('0x1c')]=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 b873d93..78eac34 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 _0x1433=['Smtp','service','host','port','secure','authentication','auth','user','\x22%s\x22\x20<%s>','name','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','stringify','email\x20sent','catch','error\x20mail','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','runReport','DefaultReportId','then','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','MailServerOut','keys','jobs','map','toString','difference','intersection','exists','deleteJob','delete\x20cron','toRun','length','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','start','endAt','update','stop','run','util','path','lodash','jayson/promise','bluebird','../logger','schedule','../../mysqldb','client','http','info','email','MailAccount'];(function(_0x41fed5,_0x209d0c){var _0x546500=function(_0x1855d3){while(--_0x1855d3){_0x41fed5['push'](_0x41fed5['shift']());}};_0x546500(++_0x209d0c);}(_0x1433,0xfe));var _0x3143=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x1433[_0x3ab51d];return _0x29a04e;};'use strict';var fs=require('fs');var util=require(_0x3143('0x0'));var path=require(_0x3143('0x1'));var _=require(_0x3143('0x2'));var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require(_0x3143('0x3'));var BPromise=require(_0x3143('0x4'));var logger=require(_0x3143('0x5'))(_0x3143('0x6'));var db=require(_0x3143('0x7'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x3143('0x8')][_0x3143('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xab8ed1,_0x16f240){return function(){logger[_0x3143('0xa')]('Try\x20to\x20send\x20a\x20mail\x20to',_0xab8ed1[_0x3143('0xb')]);var _0x37aca7=!![];var _0x32fa1b={'tls':{'rejectUnauthorized':![]}};if(_0xab8ed1[_0x3143('0xc')][_0x3143('0xd')][_0x3143('0xe')]){_0x32fa1b[_0x3143('0xe')]=_0xab8ed1[_0x3143('0xc')][_0x3143('0xd')][_0x3143('0xe')];}else{_0x32fa1b['host']=_0xab8ed1[_0x3143('0xc')][_0x3143('0xd')][_0x3143('0xf')];_0x32fa1b[_0x3143('0x10')]=_0xab8ed1[_0x3143('0xc')][_0x3143('0xd')][_0x3143('0x10')];_0x32fa1b[_0x3143('0x11')]=_0xab8ed1['MailAccount'][_0x3143('0xd')][_0x3143('0x11')];}if(_0xab8ed1[_0x3143('0xc')][_0x3143('0xd')][_0x3143('0x12')]){_0x32fa1b[_0x3143('0x13')]={'user':_0xab8ed1[_0x3143('0xc')][_0x3143('0xd')][_0x3143('0x14')],'pass':_0xab8ed1[_0x3143('0xc')][_0x3143('0xd')]['pass']};}var _0x2392d8={'account':_0x32fa1b,'message':{'from':util['format'](_0x3143('0x15'),_0xab8ed1[_0x3143('0xc')][_0x3143('0x16')],_0xab8ed1[_0x3143('0xc')]['email']||_0xab8ed1['MailAccount'][_0x3143('0xd')][_0x3143('0x14')]),'to':_0xab8ed1[_0x3143('0xb')],'cc':_0xab8ed1['cc'],'bcc':_0xab8ed1[_0x3143('0x17')],'subject':util[_0x3143('0x18')](_0x3143('0x19'),_0x16f240['name'],_0xab8ed1[_0x3143('0x1a')],_0xab8ed1[_0x3143('0x1b')])}};var _0x2f1183=path[_0x3143('0x1c')](__dirname,_0x3143('0x1d'));var _0x104130=_0x16f240[_0x3143('0x1e')];var _0x2380bd=util['format'](_0x3143('0x1f'),path[_0x3143('0x20')](_0x16f240[_0x3143('0x1e')],path[_0x3143('0x21')](_0x16f240[_0x3143('0x1e')])),'zip');var _0x54c39c=path[_0x3143('0x1c')](_0x2f1183,_0x104130);var _0x551253=path[_0x3143('0x1c')](_0x2f1183,_0x2380bd);if(fs[_0x3143('0x22')](_0x54c39c)){_0x16f240[_0x3143('0x23')]=_0x3143('0x24');_0x2392d8[_0x3143('0x25')][_0x3143('0x26')]=[{'filename':_0x104130,'path':_0x54c39c}];_0x2392d8[_0x3143('0x25')][_0x3143('0x27')]=util[_0x3143('0x18')](_0x3143('0x28'),JSON['stringify'](_0x16f240,null,0x2));}else if(fs[_0x3143('0x22')](_0x551253)){_0x16f240[_0x3143('0x23')]=_0x3143('0x24');_0x2392d8[_0x3143('0x25')]['attachments']=[{'filename':_0x2380bd,'path':_0x551253}];}else{_0x2392d8[_0x3143('0x25')][_0x3143('0x27')]=_0x3143('0x29');if(!_0xab8ed1['sendIfEmpty']){_0x37aca7=![];logger[_0x3143('0xa')](_0x3143('0x2a'));}}if(_0x37aca7){return client[_0x3143('0x2b')](_0x3143('0x2c'),_0x2392d8)['then'](function(_0x4a238d){if(_0x4a238d['error']){return logger[_0x3143('0x2d')]('error\x20mail',JSON[_0x3143('0x2e')](_0x4a238d));}return logger[_0x3143('0xa')](_0x3143('0x2f'));})[_0x3143('0x30')](function(_0x181fa9){return logger[_0x3143('0x2d')](_0x3143('0x31'),JSON[_0x3143('0x2e')](_0x181fa9));});}};}function handleError(){return function(_0x4c486f){return logger[_0x3143('0x2d')](JSON[_0x3143('0x2e')](_0x4c486f));};}function handleResult(_0x304bc7){return function(_0x2a6dde){logger[_0x3143('0xa')]('data',JSON['stringify'](_0x2a6dde));if(_0x304bc7['MailAccount']&&_0x304bc7[_0x3143('0xc')][_0x3143('0xd')]&&!_[_0x3143('0x32')](_0x304bc7['email'])){setTimeout(handleSendEmail(_0x304bc7,_0x2a6dde),0x3c*0x3e8);}};}function handleJob(_0x47c1f8){return function(){try{if(_[_0x3143('0x32')](_0x47c1f8['subtractNumber'])){return logger[_0x3143('0xa')](_0x3143('0x33'));}if(_['isNil'](_0x47c1f8[_0x3143('0x1b')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x50232d={'startDate':moment()[_0x3143('0x34')](_0x47c1f8[_0x3143('0x1a')],_0x47c1f8[_0x3143('0x1b')])[_0x3143('0x18')](_0x3143('0x35')),'endDate':moment()[_0x3143('0x18')](_0x3143('0x35')),'type':_0x3143('0x36'),'output':_0x47c1f8[_0x3143('0x37')],'name':_0x47c1f8[_0x3143('0x16')]};if(!_[_0x3143('0x32')](_0x47c1f8['DefaultReportId'])){logger[_0x3143('0xa')](_0x3143('0x38'),_0x47c1f8['DefaultReportId']);return analyticDefaultReportController[_0x3143('0x39')]({'id':_0x47c1f8[_0x3143('0x3a')]},_0x50232d)[_0x3143('0x3b')](handleResult(_0x47c1f8))[_0x3143('0x30')](handleError());}if(!_['isNil'](_0x47c1f8[_0x3143('0x3c')])){logger['info'](_0x3143('0x3d'),_0x47c1f8[_0x3143('0x3c')]);return analyticCustomReportController[_0x3143('0x39')]({'id':_0x47c1f8[_0x3143('0x3c')]},_0x50232d)[_0x3143('0x3b')](handleResult(_0x47c1f8))[_0x3143('0x30')](handleError());}}catch(_0xa8f1a2){logger[_0x3143('0x2d')](JSON[_0x3143('0x2e')](_0xa8f1a2));}return logger['info'](_0x3143('0x3e'));};}function getJobs(_0x31f4c8){var _0x57f234={};if(_0x31f4c8){_0x57f234['id']=_0x31f4c8;}return db[_0x3143('0x3f')]['findAll']({'where':_0x57f234,'include':[{'model':db[_0x3143('0xc')],'attributes':['id',_0x3143('0x16'),_0x3143('0xb')],'include':[{'model':db[_0x3143('0x40')],'as':_0x3143('0xd')}]}]})[_0x3143('0x3b')](function(_0x562e54){var _0x16222f=_[_0x3143('0x41')](manager[_0x3143('0x42')]);var _0x26f122=_[_0x3143('0x43')](_0x562e54,function(_0x42b591){return _0x42b591['id'][_0x3143('0x44')]();});var _0x376271=_['keyBy'](_0x562e54,function(_0x25ddff){return _0x25ddff['id'][_0x3143('0x44')]();});var _0x4a2e2f=_0x31f4c8?_0x26f122:_[_0x3143('0x45')](_0x26f122,_0x16222f);var _0x1305e9=_[_0x3143('0x46')](_0x26f122,_0x16222f);var _0x5e699f=_[_0x3143('0x45')](_0x16222f,_0x26f122);var _0x27d0bc;var _0x200bce;for(_0x27d0bc=0x0;_0x27d0bc<_0x5e699f['length']&&!_0x31f4c8;_0x27d0bc+=0x1){_0x200bce=_0x5e699f[_0x27d0bc][_0x3143('0x44')]();if(manager[_0x3143('0x47')](_0x200bce)){manager['stop'](_0x200bce);manager[_0x3143('0x48')](_0x200bce);logger[_0x3143('0xa')](_0x3143('0x49'),_0x200bce);}}logger[_0x3143('0xa')](_0x3143('0x4a'),JSON[_0x3143('0x2e')](_0x4a2e2f));for(_0x27d0bc=0x0;_0x27d0bc<_0x4a2e2f[_0x3143('0x4b')];_0x27d0bc+=0x1){_0x200bce=_0x4a2e2f[_0x27d0bc][_0x3143('0x44')]();logger[_0x3143('0xa')](_0x3143('0x4c'),_0x200bce);if(_0x31f4c8){logger[_0x3143('0xa')](_0x3143('0x4d'),_0x31f4c8);logger['info'](JSON['stringify'](_0x376271[_0x200bce]));BPromise[_0x3143('0x4e')]()[_0x3143('0x3b')](handleJob(_0x376271[_0x200bce]));logger[_0x3143('0xa')](_0x3143('0x4f'),_0x376271[_0x200bce][_0x3143('0x16')],_0x376271[_0x200bce][_0x3143('0x50')]);}else if(_0x376271[_0x200bce][_0x3143('0x50')]&&_0x376271[_0x200bce][_0x3143('0x51')]&&moment()[_0x3143('0x52')](_0x376271[_0x200bce][_0x3143('0x53')],_0x376271[_0x200bce]['endAt'])){manager['add'](_0x200bce,_0x376271[_0x200bce][_0x3143('0x50')],handleJob(_0x376271[_0x200bce]));manager[_0x3143('0x54')](_0x200bce);logger['info']('add\x20cron',_0x376271[_0x200bce][_0x3143('0x16')],_0x376271[_0x200bce][_0x3143('0x50')]);}else if(manager['exists'](_0x200bce)){manager['stop'](_0x200bce);manager['deleteJob'](_0x200bce);logger[_0x3143('0xa')]('stop\x20cron',_0x376271[_0x200bce]['name'],_0x376271[_0x200bce][_0x3143('0x50')]);}}for(_0x27d0bc=0x0,_0x200bce;_0x27d0bc<_0x1305e9['length']&&!_0x31f4c8;_0x27d0bc+=0x1){_0x200bce=_0x1305e9[_0x27d0bc][_0x3143('0x44')]();if(manager[_0x3143('0x47')](_0x200bce)){if(_0x376271[_0x200bce]['cron']&&_0x376271[_0x200bce]['active']&&moment()['isBetween'](_0x376271[_0x200bce][_0x3143('0x53')],_0x376271[_0x200bce][_0x3143('0x55')])){manager[_0x3143('0x56')](_0x200bce,_0x376271[_0x200bce][_0x3143('0x50')],handleJob(_0x376271[_0x200bce]));logger[_0x3143('0xa')]('update\x20cron',_0x376271[_0x200bce]['name'],_0x376271[_0x200bce]['cron']);}else{manager[_0x3143('0x57')](_0x200bce);manager['deleteJob'](_0x200bce);logger['info']('stop\x20cron',_0x376271[_0x200bce][_0x3143('0x16')],_0x376271[_0x200bce][_0x3143('0x50')]);}}}})[_0x3143('0x30')](function(_0x37c842){logger[_0x3143('0x2d')](JSON[_0x3143('0x2e')](_0x37c842));});}exports[_0x3143('0x58')]=function(_0x25ee52){return getJobs(_0x25ee52);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x372e=['endAt','add','start','exists','stop\x20cron','update','update\x20cron','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','host','secure','auth','user','\x22%s\x22\x20<%s>','name','email','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','SendMail','then','error','error\x20mail','email\x20sent','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','catch','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map','toString','keyBy','intersection','difference','length','stop','deleteJob','toRun','index','my\x20id','run\x20job','cron','active','isBetween','startAt'];(function(_0x513bf0,_0x16e93c){var _0x4f4eb1=function(_0x3e7e9e){while(--_0x3e7e9e){_0x513bf0['push'](_0x513bf0['shift']());}};_0x4f4eb1(++_0x16e93c);}(_0x372e,0x64));var _0xe372=function(_0x3dec14,_0x2f9fea){_0x3dec14=_0x3dec14-0x0;var _0x490687=_0x372e[_0x3dec14];return _0x490687;};'use strict';var fs=require('fs');var util=require(_0xe372('0x0'));var path=require(_0xe372('0x1'));var _=require(_0xe372('0x2'));var moment=require(_0xe372('0x3'));var CronJobManager=require(_0xe372('0x4'));var jayson=require(_0xe372('0x5'));var BPromise=require(_0xe372('0x6'));var logger=require(_0xe372('0x7'))(_0xe372('0x8'));var db=require(_0xe372('0x9'))['db'];var analyticCustomReportController=require(_0xe372('0xa'));var analyticDefaultReportController=require(_0xe372('0xb'));var client=jayson[_0xe372('0xc')][_0xe372('0xd')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x20c355,_0x5ad689){return function(){logger['info'](_0xe372('0xe'),_0x20c355['email']);var _0x29df66=!![];var _0x468960={'tls':{'rejectUnauthorized':![]}};if(_0x20c355[_0xe372('0xf')][_0xe372('0x10')][_0xe372('0x11')]){_0x468960[_0xe372('0x11')]=_0x20c355['MailAccount']['Smtp']['service'];}else{_0x468960['host']=_0x20c355[_0xe372('0xf')][_0xe372('0x10')][_0xe372('0x12')];_0x468960['port']=_0x20c355['MailAccount'][_0xe372('0x10')]['port'];_0x468960[_0xe372('0x13')]=_0x20c355['MailAccount']['Smtp']['secure'];}if(_0x20c355[_0xe372('0xf')]['Smtp']['authentication']){_0x468960[_0xe372('0x14')]={'user':_0x20c355[_0xe372('0xf')][_0xe372('0x10')][_0xe372('0x15')],'pass':_0x20c355['MailAccount'][_0xe372('0x10')]['pass']};}var _0x27d0f0={'account':_0x468960,'message':{'from':util['format'](_0xe372('0x16'),_0x20c355['MailAccount'][_0xe372('0x17')],_0x20c355[_0xe372('0xf')][_0xe372('0x18')]||_0x20c355[_0xe372('0xf')][_0xe372('0x10')]['user']),'to':_0x20c355[_0xe372('0x18')],'cc':_0x20c355['cc'],'bcc':_0x20c355[_0xe372('0x19')],'subject':util[_0xe372('0x1a')](_0xe372('0x1b'),_0x5ad689[_0xe372('0x17')],_0x20c355[_0xe372('0x1c')],_0x20c355[_0xe372('0x1d')])}};var _0x17a99f=path[_0xe372('0x1e')](__dirname,_0xe372('0x1f'));var _0x5f37ae=_0x5ad689[_0xe372('0x20')];var _0x533e1a=util[_0xe372('0x1a')](_0xe372('0x21'),path['basename'](_0x5ad689['savename'],path['extname'](_0x5ad689[_0xe372('0x20')])),_0xe372('0x22'));var _0x457e6a=path[_0xe372('0x1e')](_0x17a99f,_0x5f37ae);var _0x532bb8=path[_0xe372('0x1e')](_0x17a99f,_0x533e1a);if(fs[_0xe372('0x23')](_0x457e6a)){_0x5ad689[_0xe372('0x24')]=_0xe372('0x25');_0x27d0f0[_0xe372('0x26')][_0xe372('0x27')]=[{'filename':_0x5f37ae,'path':_0x457e6a}];_0x27d0f0[_0xe372('0x26')][_0xe372('0x28')]=util[_0xe372('0x1a')](_0xe372('0x29'),JSON[_0xe372('0x2a')](_0x5ad689,null,0x2));}else if(fs[_0xe372('0x23')](_0x532bb8)){_0x5ad689['status']=_0xe372('0x25');_0x27d0f0['message'][_0xe372('0x27')]=[{'filename':_0x533e1a,'path':_0x532bb8}];}else{_0x27d0f0[_0xe372('0x26')][_0xe372('0x28')]=_0xe372('0x2b');if(!_0x20c355[_0xe372('0x2c')]){_0x29df66=![];logger[_0xe372('0x2d')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x29df66){return client['request'](_0xe372('0x2e'),_0x27d0f0)[_0xe372('0x2f')](function(_0x2b4e4e){if(_0x2b4e4e[_0xe372('0x30')]){return logger[_0xe372('0x30')](_0xe372('0x31'),JSON[_0xe372('0x2a')](_0x2b4e4e));}return logger[_0xe372('0x2d')](_0xe372('0x32'));})['catch'](function(_0x556dff){return logger[_0xe372('0x30')]('error\x20mail',JSON[_0xe372('0x2a')](_0x556dff));});}};}function handleError(){return function(_0x554767){return logger[_0xe372('0x30')](JSON[_0xe372('0x2a')](_0x554767));};}function handleResult(_0x2c855c){return function(_0x24125e){logger[_0xe372('0x2d')](_0xe372('0x33'),JSON['stringify'](_0x24125e));if(_0x2c855c['MailAccount']&&_0x2c855c[_0xe372('0xf')]['Smtp']&&!_[_0xe372('0x34')](_0x2c855c[_0xe372('0x18')])){setTimeout(handleSendEmail(_0x2c855c,_0x24125e),0x3c*0x3e8);}};}function handleJob(_0x3064f7){return function(){try{if(_[_0xe372('0x34')](_0x3064f7[_0xe372('0x1c')])){return logger[_0xe372('0x2d')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xe372('0x34')](_0x3064f7[_0xe372('0x1d')])){return logger[_0xe372('0x2d')](_0xe372('0x35'));}var _0x41991c={'startDate':moment()[_0xe372('0x36')](_0x3064f7['subtractNumber'],_0x3064f7['subtractUnit'])['format'](_0xe372('0x37')),'endDate':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xe372('0x38'),'output':_0x3064f7['output'],'name':_0x3064f7[_0xe372('0x17')]};if(!_[_0xe372('0x34')](_0x3064f7[_0xe372('0x39')])){logger[_0xe372('0x2d')](_0xe372('0x3a'),_0x3064f7[_0xe372('0x39')]);return analyticDefaultReportController[_0xe372('0x3b')]({'id':_0x3064f7[_0xe372('0x39')]},_0x41991c)[_0xe372('0x2f')](handleResult(_0x3064f7))[_0xe372('0x3c')](handleError());}if(!_[_0xe372('0x34')](_0x3064f7[_0xe372('0x3d')])){logger[_0xe372('0x2d')]('exec\x20custom\x20report\x20id:%s',_0x3064f7['CustomReportId']);return analyticCustomReportController[_0xe372('0x3b')]({'id':_0x3064f7[_0xe372('0x3d')]},_0x41991c)[_0xe372('0x2f')](handleResult(_0x3064f7))['catch'](handleError());}}catch(_0x41bc55){logger[_0xe372('0x30')](JSON[_0xe372('0x2a')](_0x41bc55));}return logger[_0xe372('0x2d')](_0xe372('0x3e'));};}function getJobs(_0x3e159a){var _0x1221ff={};if(_0x3e159a){_0x1221ff['id']=_0x3e159a;}return db[_0xe372('0x3f')][_0xe372('0x40')]({'where':_0x1221ff,'include':[{'model':db[_0xe372('0xf')],'attributes':['id','name',_0xe372('0x18')],'include':[{'model':db[_0xe372('0x41')],'as':_0xe372('0x10')}]}]})[_0xe372('0x2f')](function(_0x3c7ee7){var _0x28bb95=_[_0xe372('0x42')](manager[_0xe372('0x43')]);var _0x211730=_[_0xe372('0x44')](_0x3c7ee7,function(_0x4eb821){return _0x4eb821['id'][_0xe372('0x45')]();});var _0x365772=_[_0xe372('0x46')](_0x3c7ee7,function(_0x590db9){return _0x590db9['id'][_0xe372('0x45')]();});var _0x34ddee=_0x3e159a?_0x211730:_['difference'](_0x211730,_0x28bb95);var _0x1d432a=_[_0xe372('0x47')](_0x211730,_0x28bb95);var _0x4ba8ce=_[_0xe372('0x48')](_0x28bb95,_0x211730);var _0x253766;var _0x3ddff4;for(_0x253766=0x0;_0x253766<_0x4ba8ce[_0xe372('0x49')]&&!_0x3e159a;_0x253766+=0x1){_0x3ddff4=_0x4ba8ce[_0x253766][_0xe372('0x45')]();if(manager['exists'](_0x3ddff4)){manager[_0xe372('0x4a')](_0x3ddff4);manager[_0xe372('0x4b')](_0x3ddff4);logger[_0xe372('0x2d')]('delete\x20cron',_0x3ddff4);}}logger['info'](_0xe372('0x4c'),JSON[_0xe372('0x2a')](_0x34ddee));for(_0x253766=0x0;_0x253766<_0x34ddee['length'];_0x253766+=0x1){_0x3ddff4=_0x34ddee[_0x253766][_0xe372('0x45')]();logger[_0xe372('0x2d')](_0xe372('0x4d'),_0x3ddff4);if(_0x3e159a){logger[_0xe372('0x2d')](_0xe372('0x4e'),_0x3e159a);logger['info'](JSON[_0xe372('0x2a')](_0x365772[_0x3ddff4]));BPromise['resolve']()[_0xe372('0x2f')](handleJob(_0x365772[_0x3ddff4]));logger[_0xe372('0x2d')](_0xe372('0x4f'),_0x365772[_0x3ddff4][_0xe372('0x17')],_0x365772[_0x3ddff4][_0xe372('0x50')]);}else if(_0x365772[_0x3ddff4][_0xe372('0x50')]&&_0x365772[_0x3ddff4][_0xe372('0x51')]&&moment()[_0xe372('0x52')](_0x365772[_0x3ddff4][_0xe372('0x53')],_0x365772[_0x3ddff4][_0xe372('0x54')])){manager[_0xe372('0x55')](_0x3ddff4,_0x365772[_0x3ddff4][_0xe372('0x50')],handleJob(_0x365772[_0x3ddff4]));manager[_0xe372('0x56')](_0x3ddff4);logger[_0xe372('0x2d')]('add\x20cron',_0x365772[_0x3ddff4][_0xe372('0x17')],_0x365772[_0x3ddff4][_0xe372('0x50')]);}else if(manager[_0xe372('0x57')](_0x3ddff4)){manager['stop'](_0x3ddff4);manager[_0xe372('0x4b')](_0x3ddff4);logger['info'](_0xe372('0x58'),_0x365772[_0x3ddff4][_0xe372('0x17')],_0x365772[_0x3ddff4][_0xe372('0x50')]);}}for(_0x253766=0x0,_0x3ddff4;_0x253766<_0x1d432a[_0xe372('0x49')]&&!_0x3e159a;_0x253766+=0x1){_0x3ddff4=_0x1d432a[_0x253766][_0xe372('0x45')]();if(manager[_0xe372('0x57')](_0x3ddff4)){if(_0x365772[_0x3ddff4][_0xe372('0x50')]&&_0x365772[_0x3ddff4][_0xe372('0x51')]&&moment()['isBetween'](_0x365772[_0x3ddff4][_0xe372('0x53')],_0x365772[_0x3ddff4][_0xe372('0x54')])){manager[_0xe372('0x59')](_0x3ddff4,_0x365772[_0x3ddff4][_0xe372('0x50')],handleJob(_0x365772[_0x3ddff4]));logger[_0xe372('0x2d')](_0xe372('0x5a'),_0x365772[_0x3ddff4][_0xe372('0x17')],_0x365772[_0x3ddff4][_0xe372('0x50')]);}else{manager[_0xe372('0x4a')](_0x3ddff4);manager['deleteJob'](_0x3ddff4);logger[_0xe372('0x2d')](_0xe372('0x58'),_0x365772[_0x3ddff4][_0xe372('0x17')],_0x365772[_0x3ddff4]['cron']);}}}})[_0xe372('0x3c')](function(_0x46ac0a){logger['error'](JSON[_0xe372('0x2a')](_0x46ac0a));});}exports[_0xe372('0x5b')]=function(_0x38d173){return getJobs(_0x38d173);};exports[_0xe372('0x56')]=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 b55c1b7..fc4c0f0 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 _0x09dd=['[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','language','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Sequelize','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','update','FailureReason','resolve','Transcript\x20not\x20available','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','catch','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','push','SequelizeValidationError','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','Comprehend','detectSentiment','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x09dd,0xb7));var _0xd09d=function(_0x385eb1,_0x497a94){_0x385eb1=_0x385eb1-0x0;var _0x5d40eb=_0x09dd[_0x385eb1];return _0x5d40eb;};var _=require(_0xd09d('0x0'));var AWS=require(_0xd09d('0x1'));var rp=require(_0xd09d('0x2'));var util=require(_0xd09d('0x3'));var BPromise=require(_0xd09d('0x4'));var db=require(_0xd09d('0x5'))['db'];var logger=require(_0xd09d('0x6'))(_0xd09d('0x7'));function getTranscriptionJob(_0x297ba2,_0x50d0a5,_0x467211,_0x5c3a69){return new Promise(function(_0x274db5,_0x535080){var _0x57eba0=new AWS['TranscribeService']({'accessKeyId':_0x50d0a5,'secretAccessKey':_0x297ba2,'region':_0x467211});_0x57eba0['getTranscriptionJob']({'TranscriptionJobName':_0x5c3a69},function(_0x58c10c,_0x483c0a){if(_0x58c10c){return _0x535080(_0x58c10c);}else{return _0x274db5(_0x483c0a);}});});}function sentiment(_0x66a82,_0x4cfa68,_0x439f9c,_0x2566ce,_0x50692e){return new Promise(function(_0x5f1a89,_0x5f1205){var _0x477658=new AWS[(_0xd09d('0x8'))]({'accessKeyId':_0x4cfa68,'secretAccessKey':_0x66a82,'region':_0x439f9c});_0x477658[_0xd09d('0x9')]({'Text':_0x2566ce,'LanguageCode':_0x50692e[_0xd09d('0xa')](0x0,0x2)},function(_0x2fa597,_0x367838){if(_0x2fa597){return _0x5f1205(_0x2fa597);}else{return _0x5f1a89(_0x367838);}});});}function checkTranscribeJob(_0x4ac130,_0x58c129,_0x3004d0){var _0x3c4a7a;return new BPromise(function(_0x34aed6,_0x2494f9){logger[_0xd09d('0xb')](util['format'](_0xd09d('0xc'),_0x4ac130['id'],_0x4ac130[_0xd09d('0xd')]));return getTranscriptionJob(_0x3004d0[_0xd09d('0xe')],_0x3004d0[_0xd09d('0xf')],_0x58c129[_0xd09d('0x10')],_0x4ac130['transcribeName'])[_0xd09d('0x11')](function(_0x375e61){logger['info'](util[_0xd09d('0x12')](_0xd09d('0x13'),_0x4ac130['id'],_0x4ac130[_0xd09d('0xd')],_0x375e61[_0xd09d('0x14')][_0xd09d('0x15')]));if(!_0x4ac130[_0xd09d('0x16')]){switch(_0x375e61[_0xd09d('0x14')][_0xd09d('0x15')]){case _0xd09d('0x17'):var _0x175920={'transcribeStatus':_0x375e61['TranscriptionJob'][_0xd09d('0x15')],'fileUri':_0x375e61['TranscriptionJob'][_0xd09d('0x18')][_0xd09d('0x19')]};logger[_0xd09d('0xb')](util[_0xd09d('0x12')]('[RECORDING:%d]\x20Get\x20transcript',_0x4ac130['id']));return rp({'uri':_0x375e61[_0xd09d('0x14')]['Transcript']['TranscriptFileUri'],'json':!![]})[_0xd09d('0x11')](function(_0x220beb){logger['info'](util[_0xd09d('0x12')](_0xd09d('0x1a'),_0x4ac130['id']));if(_0x220beb&&_0x220beb[_0xd09d('0x1b')]&&_0x220beb[_0xd09d('0x1b')][_0xd09d('0x1c')]&&_0x220beb[_0xd09d('0x1b')][_0xd09d('0x1c')][_0xd09d('0x1d')]){_0x175920[_0xd09d('0x16')]='';for(var _0x12997c=0x0;_0x12997c<_0x220beb[_0xd09d('0x1b')][_0xd09d('0x1c')][_0xd09d('0x1d')];_0x12997c++){_0x175920[_0xd09d('0x16')]+=_0x220beb[_0xd09d('0x1b')]['transcripts'][_0x12997c]['transcript']+'';}}return _0x4ac130['update'](_0x175920);})['then'](function(){logger[_0xd09d('0xb')](util[_0xd09d('0x12')](_0xd09d('0x1e'),_0x4ac130['id']));if(!_0x4ac130[_0xd09d('0x1f')]){throw new db['Sequelize'][(_0xd09d('0x20'))](_0xd09d('0x21'));}if(!_0x58c129['sentiment']||!_0x58c129[_0xd09d('0x22')]||!_0x58c129['sentimentRegion']||!_0x58c129[_0xd09d('0x23')]||!_0x58c129[_0xd09d('0x24')]){throw new db['Sequelize'][(_0xd09d('0x20'))](_0xd09d('0x25'));}if(!_0x175920['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x58c129[_0xd09d('0x22')]===_0x3004d0['id']){return _0x3004d0;}else{return db[_0xd09d('0x26')][_0xd09d('0x27')]({'where':{'id':_settings[_0xd09d('0x22')]}});}})[_0xd09d('0x11')](function(_0x1ecfa4){if(!_0x1ecfa4){throw new db[(_0xd09d('0x28'))][(_0xd09d('0x20'))](_0xd09d('0x29'));}if(!_0x1ecfa4[_0xd09d('0xe')]||!_0x1ecfa4[_0xd09d('0xf')]){throw new db[(_0xd09d('0x28'))]['ValidationError'](_0xd09d('0x2a'));}_0x3c4a7a=_0x1ecfa4;logger[_0xd09d('0xb')](util[_0xd09d('0x12')](_0xd09d('0x2b'),_0x4ac130['id']));return sentiment(_0x3c4a7a['data1'],_0x3c4a7a[_0xd09d('0xf')],_0x58c129[_0xd09d('0x2c')],_0x175920['fileText'],_0x58c129['language']);})['then'](function(_0x897b3){logger[_0xd09d('0xb')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x4ac130['id']));return _0x4ac130['update']({'sentiment':_0x897b3[_0xd09d('0x2d')],'sPositive':_0x897b3[_0xd09d('0x2e')][_0xd09d('0x2f')],'sNegative':_0x897b3['SentimentScore'][_0xd09d('0x30')],'sMixed':_0x897b3[_0xd09d('0x2e')][_0xd09d('0x31')],'sNeutral':_0x897b3['SentimentScore'][_0xd09d('0x32')]});})[_0xd09d('0x11')](function(){logger[_0xd09d('0xb')](util[_0xd09d('0x12')](_0xd09d('0x1e'),_0x4ac130['id']));_0x34aed6();});case _0xd09d('0x33'):return _0x4ac130[_0xd09d('0x34')]({'transcribeStatus':_0xd09d('0x33'),'failureReason':_0x375e61[_0xd09d('0x14')][_0xd09d('0x35')]})[_0xd09d('0x11')](function(){logger[_0xd09d('0xb')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4ac130['id']));_0x34aed6();});default:logger[_0xd09d('0xb')](util['format']('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x4ac130['id']));break;}}else{return BPromise[_0xd09d('0x36')]()[_0xd09d('0x11')](function(){if(!_0x4ac130[_0xd09d('0x1f')]){throw new db['Sequelize']['ValidationError'](_0xd09d('0x21'));}if(!_0x58c129['sentiment']||!_0x58c129[_0xd09d('0x22')]||!_0x58c129[_0xd09d('0x2c')]||!_0x58c129[_0xd09d('0x23')]||!_0x58c129[_0xd09d('0x24')]){throw new db[(_0xd09d('0x28'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x4ac130['fileText']){throw new Error(_0xd09d('0x37'));}if(_0x58c129['sentimentAccountId']===_0x3004d0['id']){return _0x3004d0;}else{return db[_0xd09d('0x26')][_0xd09d('0x27')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x3d7c46){if(!_0x3d7c46){throw new db[(_0xd09d('0x28'))][(_0xd09d('0x20'))](_0xd09d('0x29'));}if(!_0x3d7c46[_0xd09d('0xe')]||!_0x3d7c46[_0xd09d('0xf')]){throw new db[(_0xd09d('0x28'))][(_0xd09d('0x20'))](_0xd09d('0x2a'));}_0x3c4a7a=_0x3d7c46;logger[_0xd09d('0xb')](util['format'](_0xd09d('0x2b'),_0x4ac130['id']));return sentiment(_0x3c4a7a[_0xd09d('0xe')],_0x3c4a7a['data2'],_0x58c129[_0xd09d('0x2c')],_0x4ac130[_0xd09d('0x16')],_0x58c129['language']);})[_0xd09d('0x11')](function(_0x83a22a){logger['info'](util[_0xd09d('0x12')](_0xd09d('0x38'),_0x4ac130['id']));return _0x4ac130[_0xd09d('0x34')]({'sentiment':_0x83a22a[_0xd09d('0x2d')],'sPositive':_0x83a22a[_0xd09d('0x2e')][_0xd09d('0x2f')],'sNegative':_0x83a22a[_0xd09d('0x2e')][_0xd09d('0x30')],'sMixed':_0x83a22a[_0xd09d('0x2e')][_0xd09d('0x31')],'sNeutral':_0x83a22a[_0xd09d('0x2e')][_0xd09d('0x32')],'transcribeStatus':_0xd09d('0x17')});})[_0xd09d('0x11')](function(){logger['info'](util[_0xd09d('0x12')](_0xd09d('0x1e'),_0x4ac130['id']));_0x34aed6();});}})[_0xd09d('0x39')](function(_0x5d9190){if(_0x5d9190){if(!_0x5d9190[_0xd09d('0x3a')]||_0x5d9190['name']!=='SequelizeValidationError'){logger[_0xd09d('0x3b')](util['format'](_0xd09d('0x3c'),_0x4ac130['id']),util[_0xd09d('0x3d')](_0x5d9190,{'showHidden':![],'depth':null}));}}_0x34aed6();});});}function checkTranscribe(){var _0x50716b;var _0x42a3f2;var _0x3d3199;return db['VoiceRecording'][_0xd09d('0x3e')]({'where':{'transcribeStatus':_0xd09d('0x3f')}})[_0xd09d('0x11')](function(_0x36732f){if(!_0x36732f||!_0x36732f[_0xd09d('0x1d')]){throw new db['Sequelize']['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x50716b=_0x36732f;return db[_0xd09d('0x40')][_0xd09d('0x27')]({'where':{'id':0x1}});})[_0xd09d('0x11')](function(_0x403b0c){if(!_0x403b0c){throw new db['Sequelize'][(_0xd09d('0x20'))](_0xd09d('0x41'));}_0x42a3f2=_0x403b0c;if(!_0x42a3f2[_0xd09d('0x7')]||!_0x42a3f2[_0xd09d('0x42')]||!_0x42a3f2[_0xd09d('0x10')]||!_0x42a3f2[_0xd09d('0x23')]||!_0x42a3f2[_0xd09d('0x24')]){throw new db[(_0xd09d('0x28'))]['ValidationError'](_0xd09d('0x43'));}return db[_0xd09d('0x26')][_0xd09d('0x27')]({'where':{'id':_0x42a3f2[_0xd09d('0x42')]}});})[_0xd09d('0x11')](function(_0x472ffa){if(!_0x472ffa){throw new db[(_0xd09d('0x28'))][(_0xd09d('0x20'))](_0xd09d('0x29'));}if(!_0x472ffa[_0xd09d('0xe')]||!_0x472ffa[_0xd09d('0xf')]){throw new db['Sequelize']['ValidationError'](_0xd09d('0x2a'));}_0x3d3199=_0x472ffa;var _0x5bba56=[];_0x50716b['forEach'](function(_0x5f1032){_0x5bba56[_0xd09d('0x44')](checkTranscribeJob(_0x5f1032,_0x42a3f2,_0x3d3199));});return BPromise['all'](_0x5bba56);})[_0xd09d('0x39')](function(_0x593f8b){if(_0x593f8b){if(!_0x593f8b['name']||_0x593f8b[_0xd09d('0x3a')]!==_0xd09d('0x45')){logger[_0xd09d('0x3b')](util[_0xd09d('0x3d')](_0x593f8b,{'showHidden':![],'depth':null}));}}});}exports[_0xd09d('0x46')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x8322=['[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','SentimentScore','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','CloudProvider','Cloud\x20Provider\x20not\x20available','Positive','COMPLETED','catch','name','error','inspect','findAll','IN_PROGRESS','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','push','all','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','fileText','TranscriptionJob','TranscriptionJobStatus','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript'];(function(_0x4f1641,_0x18f9e7){var _0x93c288=function(_0x32902e){while(--_0x32902e){_0x4f1641['push'](_0x4f1641['shift']());}};_0x93c288(++_0x18f9e7);}(_0x8322,0x186));var _0x2832=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x8322[_0x20c9b2];return _0x2c6030;};var _=require(_0x2832('0x0'));var AWS=require(_0x2832('0x1'));var rp=require(_0x2832('0x2'));var util=require(_0x2832('0x3'));var BPromise=require(_0x2832('0x4'));var db=require(_0x2832('0x5'))['db'];var logger=require(_0x2832('0x6'))(_0x2832('0x7'));function getTranscriptionJob(_0x3c9253,_0x26f1af,_0x582ff5,_0x4b1bcc){return new Promise(function(_0x3583d5,_0x1d10f2){var _0xab2c39=new AWS[(_0x2832('0x8'))]({'accessKeyId':_0x26f1af,'secretAccessKey':_0x3c9253,'region':_0x582ff5});_0xab2c39[_0x2832('0x9')]({'TranscriptionJobName':_0x4b1bcc},function(_0x4b0ca8,_0xb57a3c){if(_0x4b0ca8){return _0x1d10f2(_0x4b0ca8);}else{return _0x3583d5(_0xb57a3c);}});});}function sentiment(_0x6e6b65,_0x303743,_0xb1f005,_0x5e6ba7,_0x3b091c){return new Promise(function(_0xba937c,_0x4c0026){var _0x4e9da7=new AWS[(_0x2832('0xa'))]({'accessKeyId':_0x303743,'secretAccessKey':_0x6e6b65,'region':_0xb1f005});_0x4e9da7['detectSentiment']({'Text':_0x5e6ba7,'LanguageCode':_0x3b091c['substring'](0x0,0x2)},function(_0x733b89,_0x33ef36){if(_0x733b89){return _0x4c0026(_0x733b89);}else{return _0xba937c(_0x33ef36);}});});}function checkTranscribeJob(_0x3efaf2,_0x362f97,_0x53f53c){var _0x2fc06a;return new BPromise(function(_0x6eeba,_0x5975ad){logger[_0x2832('0xb')](util[_0x2832('0xc')](_0x2832('0xd'),_0x3efaf2['id'],_0x3efaf2[_0x2832('0xe')]));return getTranscriptionJob(_0x53f53c[_0x2832('0xf')],_0x53f53c[_0x2832('0x10')],_0x362f97[_0x2832('0x11')],_0x3efaf2['transcribeName'])[_0x2832('0x12')](function(_0x38f293){logger['info'](util[_0x2832('0xc')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x3efaf2['id'],_0x3efaf2[_0x2832('0xe')],_0x38f293['TranscriptionJob']['TranscriptionJobStatus']));if(!_0x3efaf2[_0x2832('0x13')]){switch(_0x38f293[_0x2832('0x14')][_0x2832('0x15')]){case'COMPLETED':var _0x3def5f={'transcribeStatus':_0x38f293[_0x2832('0x14')]['TranscriptionJobStatus'],'fileUri':_0x38f293[_0x2832('0x14')][_0x2832('0x16')][_0x2832('0x17')]};logger[_0x2832('0xb')](util['format'](_0x2832('0x18'),_0x3efaf2['id']));return rp({'uri':_0x38f293[_0x2832('0x14')][_0x2832('0x16')][_0x2832('0x17')],'json':!![]})[_0x2832('0x12')](function(_0x2df647){logger[_0x2832('0xb')](util[_0x2832('0xc')](_0x2832('0x19'),_0x3efaf2['id']));if(_0x2df647&&_0x2df647[_0x2832('0x1a')]&&_0x2df647[_0x2832('0x1a')]['transcripts']&&_0x2df647[_0x2832('0x1a')][_0x2832('0x1b')][_0x2832('0x1c')]){_0x3def5f[_0x2832('0x13')]='';for(var _0x24621a=0x0;_0x24621a<_0x2df647[_0x2832('0x1a')][_0x2832('0x1b')]['length'];_0x24621a++){_0x3def5f['fileText']+=_0x2df647['results'][_0x2832('0x1b')][_0x24621a][_0x2832('0x1d')]+'';}}return _0x3efaf2['update'](_0x3def5f);})[_0x2832('0x12')](function(){logger[_0x2832('0xb')](util[_0x2832('0xc')](_0x2832('0x1e'),_0x3efaf2['id']));if(!_0x3efaf2[_0x2832('0x1f')]){throw new db[(_0x2832('0x20'))][(_0x2832('0x21'))](_0x2832('0x22'));}if(!_0x362f97[_0x2832('0x23')]||!_0x362f97['sentimentAccountId']||!_0x362f97[_0x2832('0x24')]||!_0x362f97['language']||!_0x362f97[_0x2832('0x25')]){throw new db[(_0x2832('0x20'))][(_0x2832('0x21'))](_0x2832('0x26'));}if(!_0x3def5f[_0x2832('0x13')]){throw new Error(_0x2832('0x27'));}if(_0x362f97[_0x2832('0x28')]===_0x53f53c['id']){return _0x53f53c;}else{return db['CloudProvider'][_0x2832('0x29')]({'where':{'id':_settings[_0x2832('0x28')]}});}})[_0x2832('0x12')](function(_0x275a9d){if(!_0x275a9d){throw new db['Sequelize'][(_0x2832('0x21'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x275a9d[_0x2832('0xf')]||!_0x275a9d['data2']){throw new db['Sequelize'][(_0x2832('0x21'))](_0x2832('0x2a'));}_0x2fc06a=_0x275a9d;logger[_0x2832('0xb')](util[_0x2832('0xc')](_0x2832('0x2b'),_0x3efaf2['id']));return sentiment(_0x2fc06a[_0x2832('0xf')],_0x2fc06a[_0x2832('0x10')],_0x362f97[_0x2832('0x24')],_0x3def5f['fileText'],_0x362f97[_0x2832('0x2c')]);})[_0x2832('0x12')](function(_0xf5244c){logger['info'](util[_0x2832('0xc')](_0x2832('0x2d'),_0x3efaf2['id']));return _0x3efaf2[_0x2832('0x2e')]({'sentiment':_0xf5244c[_0x2832('0x2f')],'sPositive':_0xf5244c[_0x2832('0x30')]['Positive'],'sNegative':_0xf5244c['SentimentScore'][_0x2832('0x31')],'sMixed':_0xf5244c[_0x2832('0x30')][_0x2832('0x32')],'sNeutral':_0xf5244c['SentimentScore'][_0x2832('0x33')]});})[_0x2832('0x12')](function(){logger[_0x2832('0xb')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x3efaf2['id']));_0x6eeba();});case _0x2832('0x34'):return _0x3efaf2[_0x2832('0x2e')]({'transcribeStatus':_0x2832('0x34'),'failureReason':_0x38f293[_0x2832('0x14')][_0x2832('0x35')]})[_0x2832('0x12')](function(){logger['info'](util[_0x2832('0xc')](_0x2832('0x1e'),_0x3efaf2['id']));_0x6eeba();});default:logger[_0x2832('0xb')](util[_0x2832('0xc')](_0x2832('0x36'),_0x3efaf2['id']));break;}}else{return BPromise['resolve']()[_0x2832('0x12')](function(){if(!_0x3efaf2[_0x2832('0x1f')]){throw new db[(_0x2832('0x20'))][(_0x2832('0x21'))](_0x2832('0x22'));}if(!_0x362f97['sentiment']||!_0x362f97[_0x2832('0x28')]||!_0x362f97['sentimentRegion']||!_0x362f97[_0x2832('0x2c')]||!_0x362f97[_0x2832('0x25')]){throw new db[(_0x2832('0x20'))]['ValidationError'](_0x2832('0x26'));}if(!_0x3efaf2[_0x2832('0x13')]){throw new Error('Transcript\x20not\x20available');}if(_0x362f97['sentimentAccountId']===_0x53f53c['id']){return _0x53f53c;}else{return db[_0x2832('0x37')][_0x2832('0x29')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x2832('0x12')](function(_0x30def3){if(!_0x30def3){throw new db[(_0x2832('0x20'))][(_0x2832('0x21'))](_0x2832('0x38'));}if(!_0x30def3[_0x2832('0xf')]||!_0x30def3[_0x2832('0x10')]){throw new db[(_0x2832('0x20'))][(_0x2832('0x21'))](_0x2832('0x2a'));}_0x2fc06a=_0x30def3;logger['info'](util[_0x2832('0xc')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x3efaf2['id']));return sentiment(_0x2fc06a[_0x2832('0xf')],_0x2fc06a['data2'],_0x362f97[_0x2832('0x24')],_0x3efaf2[_0x2832('0x13')],_0x362f97['language']);})[_0x2832('0x12')](function(_0x208b6e){logger['info'](util[_0x2832('0xc')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x3efaf2['id']));return _0x3efaf2[_0x2832('0x2e')]({'sentiment':_0x208b6e[_0x2832('0x2f')],'sPositive':_0x208b6e[_0x2832('0x30')][_0x2832('0x39')],'sNegative':_0x208b6e[_0x2832('0x30')][_0x2832('0x31')],'sMixed':_0x208b6e[_0x2832('0x30')][_0x2832('0x32')],'sNeutral':_0x208b6e['SentimentScore']['Neutral'],'transcribeStatus':_0x2832('0x3a')});})[_0x2832('0x12')](function(){logger[_0x2832('0xb')](util[_0x2832('0xc')](_0x2832('0x1e'),_0x3efaf2['id']));_0x6eeba();});}})[_0x2832('0x3b')](function(_0x28d3b0){if(_0x28d3b0){if(!_0x28d3b0[_0x2832('0x3c')]||_0x28d3b0[_0x2832('0x3c')]!=='SequelizeValidationError'){logger[_0x2832('0x3d')](util['format']('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x3efaf2['id']),util[_0x2832('0x3e')](_0x28d3b0,{'showHidden':![],'depth':null}));}}_0x6eeba();});});}function checkTranscribe(){var _0x1813c4;var _0x34b23c;var _0xea06cf;return db['VoiceRecording'][_0x2832('0x3f')]({'where':{'transcribeStatus':_0x2832('0x40')}})[_0x2832('0x12')](function(_0x26ed8a){if(!_0x26ed8a||!_0x26ed8a[_0x2832('0x1c')]){throw new db[(_0x2832('0x20'))][(_0x2832('0x21'))]('No\x20transcribe\x20job\x20to\x20check');}_0x1813c4=_0x26ed8a;return db['Setting']['findOne']({'where':{'id':0x1}});})['then'](function(_0x5a9fc7){if(!_0x5a9fc7){throw new db['Sequelize'][(_0x2832('0x21'))](_0x2832('0x41'));}_0x34b23c=_0x5a9fc7;if(!_0x34b23c[_0x2832('0x7')]||!_0x34b23c[_0x2832('0x42')]||!_0x34b23c[_0x2832('0x11')]||!_0x34b23c[_0x2832('0x2c')]||!_0x34b23c[_0x2832('0x25')]){throw new db[(_0x2832('0x20'))]['ValidationError'](_0x2832('0x43'));}return db[_0x2832('0x37')][_0x2832('0x29')]({'where':{'id':_0x34b23c[_0x2832('0x42')]}});})[_0x2832('0x12')](function(_0x426ab5){if(!_0x426ab5){throw new db[(_0x2832('0x20'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x426ab5[_0x2832('0xf')]||!_0x426ab5[_0x2832('0x10')]){throw new db[(_0x2832('0x20'))][(_0x2832('0x21'))](_0x2832('0x2a'));}_0xea06cf=_0x426ab5;var _0x296e03=[];_0x1813c4['forEach'](function(_0x180040){_0x296e03[_0x2832('0x44')](checkTranscribeJob(_0x180040,_0x34b23c,_0xea06cf));});return BPromise[_0x2832('0x45')](_0x296e03);})['catch'](function(_0x2695b0){if(_0x2695b0){if(!_0x2695b0['name']||_0x2695b0[_0x2832('0x3c')]!=='SequelizeValidationError'){logger[_0x2832('0x3d')](util[_0x2832('0x3e')](_0x2695b0,{'showHidden':![],'depth':null}));}}});}exports['start']=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 fdc9746..81f241e 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 _0x6e5b=['timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','ioredis','../../config/environment','../logger','schedule','defaults','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','hours','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system'];(function(_0x4422db,_0x1ff633){var _0x5509b9=function(_0x62a6a){while(--_0x62a6a){_0x4422db['push'](_0x4422db['shift']());}};_0x5509b9(++_0x1ff633);}(_0x6e5b,0x1ae));var _0xb6e5=function(_0x316eb0,_0xec6509){_0x316eb0=_0x316eb0-0x0;var _0xeae260=_0x6e5b[_0x316eb0];return _0xeae260;};'use strict';var _=require(_0xb6e5('0x0'));var moment=require('moment');var Redis=require(_0xb6e5('0x1'));var util=require('util');var config=require(_0xb6e5('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0xb6e5('0x3'))(_0xb6e5('0x4'));config['redis']=_[_0xb6e5('0x5')](config[_0xb6e5('0x6')],{'host':_0xb6e5('0x7'),'port':0x18eb});var io=require(_0xb6e5('0x8'))(new Redis(config[_0xb6e5('0x6')]));function closeInteractions(){var _0x3aea3b=[];return db[_0xb6e5('0x9')][_0xb6e5('0xa')]({'raw':!![],'attributes':['id',_0xb6e5('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0xb6e5('0xc'))}}})['then'](function(_0x504e97){if(_0x504e97&&_0x504e97[_0xb6e5('0xd')]){_0x3aea3b=_[_0xb6e5('0xe')](_0x504e97||[],'id');logger[_0xb6e5('0xf')](_0xb6e5('0x10'),_0x3aea3b[_0xb6e5('0x11')]());return db[_0xb6e5('0x9')][_0xb6e5('0x12')]({'closeReason':_0xb6e5('0x13'),'disposition':_0xb6e5('0x14'),'closed':!![],'closedAt':moment()[_0xb6e5('0x15')](_0xb6e5('0x16'))},{'where':{'id':_0x3aea3b}});}})['then'](function(){if(_0x3aea3b&&_0x3aea3b[_0xb6e5('0xd')]){logger[_0xb6e5('0xf')](_0xb6e5('0x17'),_0x3aea3b[_0xb6e5('0x11')]());for(var _0x5d994a=0x0;_0x5d994a<_0x3aea3b[_0xb6e5('0xd')];_0x5d994a++){io[_0xb6e5('0x18')](_0xb6e5('0x19'),{'id':_0x3aea3b[_0x5d994a],'closed':!![]});}}})[_0xb6e5('0x1a')](function(_0x2ea32f){logger['error'](_0xb6e5('0x1b'),_0x2ea32f?util[_0xb6e5('0x1c')](_0x2ea32f,{'showHidden':![],'depth':null}):'');});}exports[_0xb6e5('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x0f4f=['inspect','start','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','defaults','socket.io-emitter','redis','WhatsappInteraction','findAll','lastMsgAt','subtract','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','system','timeout','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions'];(function(_0x487168,_0x322b3b){var _0x35fb26=function(_0x47fac2){while(--_0x47fac2){_0x487168['push'](_0x487168['shift']());}};_0x35fb26(++_0x322b3b);}(_0x0f4f,0x16a));var _0xf0f4=function(_0x2a3aaa,_0x3657c4){_0x2a3aaa=_0x2a3aaa-0x0;var _0x2187af=_0x0f4f[_0x2a3aaa];return _0x2187af;};'use strict';var _=require('lodash');var moment=require(_0xf0f4('0x0'));var Redis=require(_0xf0f4('0x1'));var util=require(_0xf0f4('0x2'));var config=require(_0xf0f4('0x3'));var db=require(_0xf0f4('0x4'))['db'];var logger=require(_0xf0f4('0x5'))(_0xf0f4('0x6'));config['redis']=_[_0xf0f4('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xf0f4('0x8'))(new Redis(config[_0xf0f4('0x9')]));function closeInteractions(){var _0x5b0971=[];return db[_0xf0f4('0xa')][_0xf0f4('0xb')]({'raw':!![],'attributes':['id',_0xf0f4('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xf0f4('0xd')](0x18,'hours')}}})['then'](function(_0x553006){if(_0x553006&&_0x553006[_0xf0f4('0xe')]){_0x5b0971=_[_0xf0f4('0xf')](_0x553006||[],'id');logger[_0xf0f4('0x10')](_0xf0f4('0x11'),_0x5b0971['join']());return db['WhatsappInteraction']['update']({'closeReason':_0xf0f4('0x12'),'disposition':_0xf0f4('0x13'),'closed':!![],'closedAt':moment()['format'](_0xf0f4('0x14'))},{'where':{'id':_0x5b0971}});}})['then'](function(){if(_0x5b0971&&_0x5b0971[_0xf0f4('0xe')]){logger['info'](_0xf0f4('0x15'),_0x5b0971[_0xf0f4('0x16')]());for(var _0x920734=0x0;_0x920734<_0x5b0971[_0xf0f4('0xe')];_0x920734++){io[_0xf0f4('0x17')](_0xf0f4('0x18'),{'id':_0x5b0971[_0x920734],'closed':!![]});}}})[_0xf0f4('0x19')](function(_0x5c16b2){logger[_0xf0f4('0x1a')](_0xf0f4('0x1b'),_0x5c16b2?util[_0xf0f4('0x1c')](_0x5c16b2,{'showHidden':![],'depth':null}):'');});}exports[_0xf0f4('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 60fcc6f..4f12ed6 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ba8=['CmContact','destroy','bulkCreate','then','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','../mysqldb','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','push','now'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x8ba8,0x107));var _0x88ba=function(_0x3e0afe,_0x3ae326){_0x3e0afe=_0x3e0afe-0x0;var _0x1eaad6=_0x8ba8[_0x3e0afe];return _0x1eaad6;};'use strict';var util=require('util');var db=require(_0x88ba('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x88ba('0x1')+i,'lastName':_0x88ba('0x2')+i,'phone':0xf879fb460+i,'email':_0x88ba('0x3')+i+_0x88ba('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x88ba('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x88ba('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x88ba('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x88ba('0x5')]({'id':i,'firstName':_0x88ba('0x1')+i,'lastName':_0x88ba('0x2')+i,'phone':0xf879fb460+i,'email':_0x88ba('0x3')+i+_0x88ba('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x88ba('0x5')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x88ba('0x6')](),'updatedAt':Date['now']()});}db[_0x88ba('0x7')][_0x88ba('0x8')]({'where':{}})['then'](function(){return db[_0x88ba('0x7')][_0x88ba('0x9')](contacts);})[_0x88ba('0xa')](function(){console[_0x88ba('0xb')](_0x88ba('0xc'),_0x88ba('0xd'));return db['CmHopper'][_0x88ba('0x8')]({'where':{}});})[_0x88ba('0xa')](function(){return db[_0x88ba('0xe')][_0x88ba('0x9')](hopper);})[_0x88ba('0xa')](function(){console[_0x88ba('0xb')](_0x88ba('0xc'),_0x88ba('0xf'));return db[_0x88ba('0x7')][_0x88ba('0x9')](contacts2);})['then'](function(){console[_0x88ba('0xb')](_0x88ba('0xc'),_0x88ba('0x10'));return db['CmHopper']['bulkCreate'](hopper2);})['then'](function(){console[_0x88ba('0xb')](_0x88ba('0xc'),_0x88ba('0x11'));})['catch'](function(_0xc2e2a){console['log'](_0xc2e2a);}); \ No newline at end of file +var _0x6f2c=['then','log','contacts1','CmHopper','bulkCreate','finished\x20populating','hopper1','hopper2','util','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy'];(function(_0x311aff,_0x5bcf2f){var _0x399492=function(_0x170234){while(--_0x170234){_0x311aff['push'](_0x311aff['shift']());}};_0x399492(++_0x5bcf2f);}(_0x6f2c,0x15c));var _0xc6f2=function(_0x2fa264,_0x22be1d){_0x2fa264=_0x2fa264-0x0;var _0x1a2073=_0x6f2c[_0x2fa264];return _0x1a2073;};'use strict';var util=require(_0xc6f2('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xc6f2('0x1')]({'id':i,'firstName':_0xc6f2('0x2')+i,'lastName':_0xc6f2('0x3')+i,'phone':0xf879fb460+i,'email':_0xc6f2('0x4')+i+_0xc6f2('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xc6f2('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xc6f2('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc6f2('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xc6f2('0x1')]({'id':i,'firstName':_0xc6f2('0x2')+i,'lastName':_0xc6f2('0x3')+i,'phone':0xf879fb460+i,'email':_0xc6f2('0x4')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xc6f2('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xc6f2('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xc6f2('0x6')]()});}db[_0xc6f2('0x7')][_0xc6f2('0x8')]({'where':{}})[_0xc6f2('0x9')](function(){return db[_0xc6f2('0x7')]['bulkCreate'](contacts);})['then'](function(){console[_0xc6f2('0xa')]('finished\x20populating',_0xc6f2('0xb'));return db[_0xc6f2('0xc')][_0xc6f2('0x8')]({'where':{}});})[_0xc6f2('0x9')](function(){return db[_0xc6f2('0xc')][_0xc6f2('0xd')](hopper);})['then'](function(){console[_0xc6f2('0xa')](_0xc6f2('0xe'),_0xc6f2('0xf'));return db[_0xc6f2('0x7')][_0xc6f2('0xd')](contacts2);})['then'](function(){console[_0xc6f2('0xa')](_0xc6f2('0xe'),'contacts2');return db[_0xc6f2('0xc')]['bulkCreate'](hopper2);})[_0xc6f2('0x9')](function(){console[_0xc6f2('0xa')](_0xc6f2('0xe'),_0xc6f2('0x10'));})['catch'](function(_0x576c4a){console[_0xc6f2('0xa')](_0x576c4a);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 7633f6f..f255db6 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa833=['%s%s','agent','%s%s@xcally.com','password','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','bulkCreate','then','log','catch','util','push','format'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0xa833,0xf4));var _0x3a83=function(_0x274604,_0x39f7bf){_0x274604=_0x274604-0x0;var _0x1a6b2b=_0xa833[_0x274604];return _0x1a6b2b;};'use strict';var util=require(_0x3a83('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x3a83('0x1')]({'name':util[_0x3a83('0x2')](_0x3a83('0x3'),_0x3a83('0x4'),i),'fullname':util[_0x3a83('0x2')](_0x3a83('0x3'),_0x3a83('0x4'),i),'email':util[_0x3a83('0x2')](_0x3a83('0x5'),_0x3a83('0x4'),i),'role':_0x3a83('0x4'),'password':_0x3a83('0x6'),'internal':0xfa0+i,'type':'friend','transport':[_0x3a83('0x7'),'ws',_0x3a83('0x8')],'disallow':[_0x3a83('0x9')],'allow':[_0x3a83('0xa')],'defaultuser':util[_0x3a83('0x2')](_0x3a83('0x3'),_0x3a83('0x4'),i),'encryption':_0x3a83('0xb'),'avpf':'yes','force_avp':_0x3a83('0xb'),'icesupport':_0x3a83('0xb'),'dtlsenable':_0x3a83('0xb'),'dtlsverify':'no','dtlscertfile':_0x3a83('0xc'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x3a83('0xd'),'callerid':util[_0x3a83('0x2')](_0x3a83('0xe'),util[_0x3a83('0x2')](_0x3a83('0x3'),_0x3a83('0x4'),i),0xfa0+i)});}db['User'][_0x3a83('0xf')](users)[_0x3a83('0x10')](function(){console[_0x3a83('0x11')]('add\x20user');})[_0x3a83('0x12')](function(_0x149d99){console['log'](_0x149d99);}); \ No newline at end of file +var _0x543d=['yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','password','friend','udp','wss','all','ulaw'];(function(_0x3bb336,_0x5a090d){var _0x15140f=function(_0x2da253){while(--_0x2da253){_0x3bb336['push'](_0x3bb336['shift']());}};_0x15140f(++_0x5a090d);}(_0x543d,0x105));var _0xd543=function(_0x26f1b2,_0x33d843){_0x26f1b2=_0x26f1b2-0x0;var _0x1624a4=_0x543d[_0x26f1b2];return _0x1624a4;};'use strict';var util=require(_0xd543('0x0'));var db=require(_0xd543('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xd543('0x2')]({'name':util[_0xd543('0x3')](_0xd543('0x4'),_0xd543('0x5'),i),'fullname':util[_0xd543('0x3')](_0xd543('0x4'),_0xd543('0x5'),i),'email':util[_0xd543('0x3')]('%s%s@xcally.com',_0xd543('0x5'),i),'role':_0xd543('0x5'),'password':_0xd543('0x6'),'internal':0xfa0+i,'type':_0xd543('0x7'),'transport':[_0xd543('0x8'),'ws',_0xd543('0x9')],'disallow':[_0xd543('0xa')],'allow':[_0xd543('0xb')],'defaultuser':util[_0xd543('0x3')](_0xd543('0x4'),'agent',i),'encryption':_0xd543('0xc'),'avpf':_0xd543('0xc'),'force_avp':_0xd543('0xc'),'icesupport':_0xd543('0xc'),'dtlsenable':_0xd543('0xc'),'dtlsverify':'no','dtlscertfile':_0xd543('0xd'),'dtlsprivatekey':_0xd543('0xe'),'dtlssetup':_0xd543('0xf'),'callerid':util[_0xd543('0x3')]('\x22%s\x22\x20<%s>',util[_0xd543('0x3')](_0xd543('0x4'),_0xd543('0x5'),i),0xfa0+i)});}db[_0xd543('0x10')][_0xd543('0x11')](users)['then'](function(){console[_0xd543('0x12')](_0xd543('0x13'));})[_0xd543('0x14')](function(_0x34b783){console[_0xd543('0x12')](_0x34b783);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index ea34257..564214b 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc5b3=['UserProfileResource','resourceId','map','where','Campaign','%s:queue:%s','format','user:%s','query','find','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','MailQueue','OpenchannelQueue','WhatsappQueue','user','VoiceQueues','userProfileId','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','Telephones','getVoiceQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','length','voice','chat','fax','sms','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','connection','setMaxListeners','address','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Trunks','IvrCampaigns'];(function(_0x1d4574,_0x2e735f){var _0x46c8b6=function(_0x2f9ffe){while(--_0x2f9ffe){_0x1d4574['push'](_0x1d4574['shift']());}};_0x46c8b6(++_0x2e735f);}(_0xc5b3,0x1ee));var _0x3c5b=function(_0x196e1b,_0x55fa06){_0x196e1b=_0x196e1b-0x0;var _0x5e1f18=_0xc5b3[_0x196e1b];return _0x5e1f18;};'use strict';var _=require(_0x3c5b('0x0'));var util=require(_0x3c5b('0x1'));var BPromise=require(_0x3c5b('0x2'));var db=require(_0x3c5b('0x3'))['db'];var config=require(_0x3c5b('0x4'));var queryQueues={'attributes':['id',_0x3c5b('0x5')],'include':[{'as':_0x3c5b('0x6'),'model':db[_0x3c5b('0x7')],'attributes':['id','name',_0x3c5b('0x8')],'raw':!![],'where':{'role':_0x3c5b('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x3c5b('0xa')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x3c5b('0x5')],'where':{'role':_0x3c5b('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x3c5b('0x5'),_0x3c5b('0xb')],'where':{'type':_0x3c5b('0xc')}};function getAssociatedResources(_0x1d0174,_0x435b4f,_0x5f5df9){return db[_0x3c5b('0xd')][_0x3c5b('0xe')]({'where':{'name':_0x1d0174,'userProfileId':_0x435b4f},'raw':!![]})[_0x3c5b('0xf')](function(_0x475757){if(_0x475757){if(_0x475757[_0x3c5b('0x10')]){switch(_0x1d0174){case'VoiceQueues':case _0x3c5b('0x11'):case _0x3c5b('0x12'):case _0x3c5b('0x13'):case _0x3c5b('0x14'):case _0x3c5b('0x15'):case _0x3c5b('0x16'):return db[_0x5f5df9][_0x3c5b('0x17')](queryQueues);case'Telephones':return db[_0x5f5df9][_0x3c5b('0x17')](queryTelephones);case _0x3c5b('0x18'):return db[_0x5f5df9][_0x3c5b('0x17')](queryTrunks);case _0x3c5b('0x19'):return db[_0x5f5df9]['findAll'](queryCampaigns);}}else{return db[_0x3c5b('0x1a')]['findAll']({'attributes':[_0x3c5b('0x1b')],'where':{'sectionId':_0x475757['id']},'raw':!![]})[_0x3c5b('0xf')](function(_0x578f49){if(_0x578f49){var _0x2b1d45={'where':{'id':_[_0x3c5b('0x1c')](_0x578f49,'resourceId')},'raw':!![]};switch(_0x5f5df9){case _0x3c5b('0x7'):_0x2b1d45[_0x3c5b('0x1d')][_0x3c5b('0x8')]='telephone';break;case _0x3c5b('0x1e'):_0x2b1d45['where'][_0x3c5b('0xb')]=_0x3c5b('0xc');break;}return db[_0x5f5df9][_0x3c5b('0x17')](_0x2b1d45);}else{return[];}});}}else{return[];}})[_0x3c5b('0xf')](function(_0x37dfb0){return _0x37dfb0;});}function joinOrLeaveQueues(_0x3211a8,_0x47c970,_0x4a76d5,_0xa074cc){_0x3211a8[_0x47c970](util['format'](_0x3c5b('0x1f'),_0x4a76d5,_0xa074cc[_0x3c5b('0x5')]));if(_0xa074cc[_0x3c5b('0x6')]){for(var _0x4cb3d3=0x0;_0x4cb3d3<_0xa074cc[_0x3c5b('0x6')]['length'];_0x4cb3d3+=0x1){_0x3211a8[_0x47c970](util[_0x3c5b('0x20')](_0x3c5b('0x21'),_0xa074cc[_0x3c5b('0x6')][_0x4cb3d3][_0x3c5b('0x5')]));}}}function joinOrLeave(_0x6ad725,_0x462880,_0x2fa139){var _0x1b3215;if(_0x6ad725['handshake'][_0x3c5b('0x22')]['id']){db[_0x3c5b('0x7')][_0x3c5b('0x23')]({'attributes':['id','name',_0x3c5b('0x8'),'userProfileId'],'where':{'id':_0x6ad725['handshake']['query']['id']},'include':[{'model':db['ChatInteraction'],'as':_0x3c5b('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x3c5b('0x25')],'as':_0x3c5b('0x26'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x3c5b('0x27'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x3c5b('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x3c5b('0x29')],'as':_0x3c5b('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x3c5b('0x2b')],'as':_0x3c5b('0x2c'),'attributes':['id'],'raw':!![]}]})[_0x3c5b('0xf')](function(_0x37cd2f){if(_0x37cd2f){_0x1b3215=_0x37cd2f;_0x6ad725[_0x462880](util[_0x3c5b('0x20')](_0x3c5b('0x21'),_0x37cd2f['name']));var _0x173cd1=[];switch(_0x37cd2f[_0x3c5b('0x8')]){case _0x3c5b('0x2d'):_0x6ad725[_0x462880](_0x3c5b('0x2e'));_0x6ad725[_0x462880](_0x3c5b('0x2f'));if(queryQueues[_0x3c5b('0x30')](_0x3c5b('0x31'))){delete queryQueues[_0x3c5b('0x31')];}_0x173cd1['push'](db['VoiceQueue'][_0x3c5b('0x17')](queryQueues));_0x173cd1[_0x3c5b('0x32')](db['ChatQueue'][_0x3c5b('0x17')](queryQueues));_0x173cd1[_0x3c5b('0x32')](db['FaxQueue'][_0x3c5b('0x17')](queryQueues));_0x173cd1[_0x3c5b('0x32')](db['SmsQueue'][_0x3c5b('0x17')](queryQueues));_0x173cd1[_0x3c5b('0x32')](db[_0x3c5b('0x33')][_0x3c5b('0x17')](queryQueues));_0x173cd1[_0x3c5b('0x32')](db[_0x3c5b('0x34')][_0x3c5b('0x17')](queryQueues));_0x173cd1[_0x3c5b('0x32')](db[_0x3c5b('0x35')][_0x3c5b('0x17')](queryQueues));_0x173cd1[_0x3c5b('0x32')](db[_0x3c5b('0x7')][_0x3c5b('0x17')](queryTelephones));_0x173cd1[_0x3c5b('0x32')](db['Trunk'][_0x3c5b('0x17')](queryTrunks));_0x173cd1[_0x3c5b('0x32')](db[_0x3c5b('0x1e')]['findAll'](queryCampaigns));_0x173cd1['push'](db[_0x3c5b('0x7')]['findAll'](queryAgents));break;case _0x3c5b('0x36'):_0x6ad725[_0x462880](_0x3c5b('0x2e'));_0x6ad725[_0x462880](_0x3c5b('0x2f'));_0x173cd1[_0x3c5b('0x32')](getAssociatedResources(_0x3c5b('0x37'),_0x37cd2f[_0x3c5b('0x38')],_0x3c5b('0x39')));_0x173cd1['push'](getAssociatedResources('ChatQueues',_0x37cd2f[_0x3c5b('0x38')],_0x3c5b('0x3a')));_0x173cd1['push'](getAssociatedResources(_0x3c5b('0x12'),_0x37cd2f[_0x3c5b('0x38')],_0x3c5b('0x3b')));_0x173cd1[_0x3c5b('0x32')](getAssociatedResources('SmsQueues',_0x37cd2f[_0x3c5b('0x38')],_0x3c5b('0x3c')));_0x173cd1[_0x3c5b('0x32')](getAssociatedResources('MailQueues',_0x37cd2f['userProfileId'],_0x3c5b('0x33')));_0x173cd1[_0x3c5b('0x32')](getAssociatedResources(_0x3c5b('0x15'),_0x37cd2f[_0x3c5b('0x38')],_0x3c5b('0x34')));_0x173cd1[_0x3c5b('0x32')](getAssociatedResources('WhatsappQueues',_0x37cd2f['userProfileId'],'WhatsappQueue'));_0x173cd1[_0x3c5b('0x32')](getAssociatedResources(_0x3c5b('0x3d'),_0x37cd2f[_0x3c5b('0x38')],'User'));_0x173cd1['push'](getAssociatedResources(_0x3c5b('0x18'),_0x37cd2f[_0x3c5b('0x38')],'Trunk'));_0x173cd1[_0x3c5b('0x32')](getAssociatedResources('IvrCampaigns',_0x37cd2f['userProfileId'],_0x3c5b('0x1e')));_0x173cd1[_0x3c5b('0x32')](db[_0x3c5b('0x7')][_0x3c5b('0x17')](queryAgents));break;case _0x3c5b('0x9'):_0x6ad725[_0x462880](_0x3c5b('0x2e'));_0x6ad725[_0x462880](_0x3c5b('0x2f'));_0x173cd1[_0x3c5b('0x32')](_0x37cd2f[_0x3c5b('0x3e')]({'attributes':['id',_0x3c5b('0x5')]}));_0x173cd1[_0x3c5b('0x32')](_0x37cd2f['getChatQueues']({'attributes':['id',_0x3c5b('0x5')]}));_0x173cd1['push'](_0x37cd2f[_0x3c5b('0x3f')]({'attributes':['id','name']}));_0x173cd1[_0x3c5b('0x32')](_0x37cd2f[_0x3c5b('0x40')]({'attributes':['id',_0x3c5b('0x5')]}));_0x173cd1[_0x3c5b('0x32')](_0x37cd2f[_0x3c5b('0x41')]({'attributes':['id',_0x3c5b('0x5')]}));_0x173cd1[_0x3c5b('0x32')](_0x37cd2f[_0x3c5b('0x42')]({'attributes':['id','name']}));_0x173cd1[_0x3c5b('0x32')](_0x37cd2f[_0x3c5b('0x43')]({'attributes':['id',_0x3c5b('0x5')]}));break;}return BPromise[_0x3c5b('0x44')](_0x173cd1);}})['then'](function(_0x32d71f){if(_0x32d71f&&_0x32d71f[_0x3c5b('0x45')]){for(var _0x647d9d=0x0;_0x647d9d<_0x32d71f[_0x3c5b('0x45')];_0x647d9d+=0x1){for(var _0x2d550b=0x0;_0x2d550b<_0x32d71f[_0x647d9d][_0x3c5b('0x45')];_0x2d550b+=0x1){switch(_0x647d9d){case 0x0:joinOrLeaveQueues(_0x6ad725,_0x462880,_0x3c5b('0x46'),_0x32d71f[_0x647d9d][_0x2d550b]);break;case 0x1:joinOrLeaveQueues(_0x6ad725,_0x462880,_0x3c5b('0x47'),_0x32d71f[_0x647d9d][_0x2d550b]);break;case 0x2:joinOrLeaveQueues(_0x6ad725,_0x462880,_0x3c5b('0x48'),_0x32d71f[_0x647d9d][_0x2d550b]);break;case 0x3:joinOrLeaveQueues(_0x6ad725,_0x462880,_0x3c5b('0x49'),_0x32d71f[_0x647d9d][_0x2d550b]);break;case 0x4:joinOrLeaveQueues(_0x6ad725,_0x462880,_0x3c5b('0x4a'),_0x32d71f[_0x647d9d][_0x2d550b]);break;case 0x5:joinOrLeaveQueues(_0x6ad725,_0x462880,_0x3c5b('0x4b'),_0x32d71f[_0x647d9d][_0x2d550b]);break;case 0x6:joinOrLeaveQueues(_0x6ad725,_0x462880,'whatsapp',_0x32d71f[_0x647d9d][_0x2d550b]);break;case 0x7:if(_0x1b3215['role']!==_0x3c5b('0x9'))_0x6ad725[_0x462880](util[_0x3c5b('0x20')](_0x3c5b('0x4c'),_0x32d71f[_0x647d9d][_0x2d550b]['name']));break;case 0x8:if(_0x1b3215[_0x3c5b('0x8')]!=='agent')_0x6ad725[_0x462880](util[_0x3c5b('0x20')](_0x3c5b('0x4d'),_0x32d71f[_0x647d9d][_0x2d550b][_0x3c5b('0x5')]));break;case 0x9:if(_0x1b3215[_0x3c5b('0x8')]!==_0x3c5b('0x9'))_0x6ad725[_0x462880](util[_0x3c5b('0x20')](_0x3c5b('0x4e'),_0x32d71f[_0x647d9d][_0x2d550b][_0x3c5b('0xb')],_0x32d71f[_0x647d9d][_0x2d550b][_0x3c5b('0x5')]));break;case 0xa:_0x6ad725[_0x462880](util[_0x3c5b('0x20')](_0x3c5b('0x21'),_0x32d71f[_0x647d9d][_0x2d550b][_0x3c5b('0x5')]));break;}}}}})[_0x3c5b('0xf')](function(){if(_0x462880===_0x3c5b('0x4f')){var _0x3ac181=_[_0x3c5b('0x1c')](_0x1b3215['ChatInteractions'],'id');return _0x1b3215[_0x3c5b('0x50')](_0x3ac181)['then'](function(){for(var _0x26231b=0x0;_0x26231b<_0x3ac181[_0x3c5b('0x45')];_0x26231b+=0x1){_0x2fa139['emit'](_0x3c5b('0x51'),{'ChatInteractionId':Number(_0x3ac181[_0x26231b]),'UserId':Number(_0x1b3215['id'])});}});}})['then'](function(){if(_0x462880===_0x3c5b('0x4f')){var _0x1a8b13=_['map'](_0x1b3215[_0x3c5b('0x26')],'id');return _0x1b3215[_0x3c5b('0x52')](_0x1a8b13)['then'](function(){for(var _0x190fae=0x0;_0x190fae<_0x1a8b13[_0x3c5b('0x45')];_0x190fae+=0x1){_0x2fa139[_0x3c5b('0x53')](_0x3c5b('0x54'),{'MailInteractionId':Number(_0x1a8b13[_0x190fae]),'UserId':Number(_0x1b3215['id'])});}});}})['then'](function(){if(_0x462880===_0x3c5b('0x4f')){var _0x74fb3=_[_0x3c5b('0x1c')](_0x1b3215[_0x3c5b('0x27')],'id');return _0x1b3215[_0x3c5b('0x55')](_0x74fb3)[_0x3c5b('0xf')](function(){for(var _0x4223d2=0x0;_0x4223d2<_0x74fb3[_0x3c5b('0x45')];_0x4223d2+=0x1){_0x2fa139[_0x3c5b('0x53')](_0x3c5b('0x56'),{'FaxInteractionId':Number(_0x74fb3[_0x4223d2]),'UserId':Number(_0x1b3215['id'])});}});}})['then'](function(){if(_0x462880===_0x3c5b('0x4f')){var _0x174bb2=_[_0x3c5b('0x1c')](_0x1b3215[_0x3c5b('0x28')],'id');return _0x1b3215['removeSmsInteractions'](_0x174bb2)[_0x3c5b('0xf')](function(){for(var _0x1c9bc1=0x0;_0x1c9bc1<_0x174bb2[_0x3c5b('0x45')];_0x1c9bc1+=0x1){_0x2fa139[_0x3c5b('0x53')](_0x3c5b('0x57'),{'SmsInteractionId':Number(_0x174bb2[_0x1c9bc1]),'UserId':Number(_0x1b3215['id'])});}});}})[_0x3c5b('0xf')](function(){if(_0x462880===_0x3c5b('0x4f')){var _0x1d6337=_[_0x3c5b('0x1c')](_0x1b3215['OpenchannelInteractions'],'id');return _0x1b3215['removeOpenchannelInteractions'](_0x1d6337)[_0x3c5b('0xf')](function(){for(var _0x1dcee6=0x0;_0x1dcee6<_0x1d6337[_0x3c5b('0x45')];_0x1dcee6+=0x1){_0x2fa139[_0x3c5b('0x53')](_0x3c5b('0x58'),{'OpenchannelInteractionId':Number(_0x1d6337[_0x1dcee6]),'UserId':Number(_0x1b3215['id'])});}});}})[_0x3c5b('0xf')](function(){if(_0x462880===_0x3c5b('0x4f')){var _0x281340=_[_0x3c5b('0x1c')](_0x1b3215['WhatsappInteractions'],'id');return _0x1b3215[_0x3c5b('0x59')](_0x281340)[_0x3c5b('0xf')](function(){for(var _0x50fba1=0x0;_0x50fba1<_0x281340['length'];_0x50fba1+=0x1){_0x2fa139[_0x3c5b('0x53')](_0x3c5b('0x5a'),{'WhatsappInteractionId':Number(_0x281340[_0x50fba1]),'UserId':Number(_0x1b3215['id'])});}});}})['catch'](function(_0xa81213){_0x6ad725[_0x3c5b('0x5b')](_0xa81213);});}}function onDisconnect(_0xf37db1,_0x560c77){joinOrLeave(_0xf37db1,_0x3c5b('0x4f'),_0x560c77);}function onConnect(_0x1babce){joinOrLeave(_0x1babce,_0x3c5b('0x5c'));}exports['default']=function(_0x31632d){_0x31632d['on'](_0x3c5b('0x5d'),function(_0x347114){_0x347114[_0x3c5b('0x5e')](0x0);_0x347114[_0x3c5b('0x5f')]=_0x347114[_0x3c5b('0x60')][_0x3c5b('0x5d')]['remoteAddress']+':'+_0x347114['request']['connection'][_0x3c5b('0x61')];_0x347114[_0x3c5b('0x62')]=new Date();_0x347114[_0x3c5b('0x5b')]=function(_0x55c61c){console['log'](_0x3c5b('0x63')+_0x347114[_0x3c5b('0x64')][_0x3c5b('0x5')]+'['+_0x347114[_0x3c5b('0x5f')]+']',_0x55c61c);};_0x347114['on'](_0x3c5b('0x65'),function(){onDisconnect(_0x347114,_0x31632d);_0x347114['log'](_0x3c5b('0x66'));});onConnect(_0x347114);_0x347114[_0x3c5b('0x5b')](_0x3c5b('0x67'));});}; \ No newline at end of file +var _0x5ed9=['catch','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','log','SocketIO\x20','nsp','disconnect','DISCONNECTED','lodash','util','../mysqldb','./environment','name','Agents','role','agent','telephone','type','ivr','UserProfileSection','findOne','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','resourceId','then','map','User','Campaign','format','%s:queue:%s','length','handshake','query','find','userProfileId','ChatInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','voice:inbound','VoiceQueue','push','ChatQueue','FaxQueue','SmsQueue','WhatsappQueue','user','voice:outbound','MailQueue','OpenchannelQueues','OpenchannelQueue','Trunks','Trunk','getFaxQueues','getSmsQueues','getMailQueues','getWhatsappQueues','chat','fax','sms','mail','openchannel','telephone:%s','trunk:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','MailInteractions','removeMailInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','removeSmsInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove'];(function(_0x135731,_0x341aaa){var _0x258464=function(_0x489138){while(--_0x489138){_0x135731['push'](_0x135731['shift']());}};_0x258464(++_0x341aaa);}(_0x5ed9,0x1e9));var _0x95ed=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x5ed9[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0x95ed('0x0'));var util=require(_0x95ed('0x1'));var BPromise=require('bluebird');var db=require(_0x95ed('0x2'))['db'];var config=require(_0x95ed('0x3'));var queryQueues={'attributes':['id',_0x95ed('0x4')],'include':[{'as':_0x95ed('0x5'),'model':db['User'],'attributes':['id',_0x95ed('0x4'),_0x95ed('0x6')],'raw':!![],'where':{'role':_0x95ed('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x95ed('0x8')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x95ed('0x4')],'where':{'role':_0x95ed('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x95ed('0x4'),_0x95ed('0x9')],'where':{'type':_0x95ed('0xa')}};function getAssociatedResources(_0x408081,_0x51ccf6,_0x2b59f5){return db[_0x95ed('0xb')][_0x95ed('0xc')]({'where':{'name':_0x408081,'userProfileId':_0x51ccf6},'raw':!![]})['then'](function(_0x435110){if(_0x435110){if(_0x435110['autoAssociation']){switch(_0x408081){case _0x95ed('0xd'):case _0x95ed('0xe'):case _0x95ed('0xf'):case _0x95ed('0x10'):case _0x95ed('0x11'):case'OpenchannelQueues':case'WhatsappQueues':return db[_0x2b59f5][_0x95ed('0x12')](queryQueues);case _0x95ed('0x13'):return db[_0x2b59f5]['findAll'](queryTelephones);case'Trunks':return db[_0x2b59f5][_0x95ed('0x12')](queryTrunks);case _0x95ed('0x14'):return db[_0x2b59f5][_0x95ed('0x12')](queryCampaigns);}}else{return db[_0x95ed('0x15')]['findAll']({'attributes':[_0x95ed('0x16')],'where':{'sectionId':_0x435110['id']},'raw':!![]})[_0x95ed('0x17')](function(_0x477b8f){if(_0x477b8f){var _0x597a04={'where':{'id':_[_0x95ed('0x18')](_0x477b8f,'resourceId')},'raw':!![]};switch(_0x2b59f5){case _0x95ed('0x19'):_0x597a04['where']['role']='telephone';break;case _0x95ed('0x1a'):_0x597a04['where'][_0x95ed('0x9')]=_0x95ed('0xa');break;}return db[_0x2b59f5]['findAll'](_0x597a04);}else{return[];}});}}else{return[];}})[_0x95ed('0x17')](function(_0x3e9d1e){return _0x3e9d1e;});}function joinOrLeaveQueues(_0x4432c9,_0x2a8dc3,_0x35210d,_0x41efe4){_0x4432c9[_0x2a8dc3](util[_0x95ed('0x1b')](_0x95ed('0x1c'),_0x35210d,_0x41efe4[_0x95ed('0x4')]));if(_0x41efe4[_0x95ed('0x5')]){for(var _0x5887e3=0x0;_0x5887e3<_0x41efe4[_0x95ed('0x5')][_0x95ed('0x1d')];_0x5887e3+=0x1){_0x4432c9[_0x2a8dc3](util['format']('user:%s',_0x41efe4['Agents'][_0x5887e3][_0x95ed('0x4')]));}}}function joinOrLeave(_0x226a60,_0x31384c,_0x61d85e){var _0x2c0824;if(_0x226a60[_0x95ed('0x1e')][_0x95ed('0x1f')]['id']){db[_0x95ed('0x19')][_0x95ed('0x20')]({'attributes':['id',_0x95ed('0x4'),_0x95ed('0x6'),_0x95ed('0x21')],'where':{'id':_0x226a60[_0x95ed('0x1e')][_0x95ed('0x1f')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x95ed('0x22'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x95ed('0x23')],'as':_0x95ed('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x95ed('0x25')],'as':_0x95ed('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x95ed('0x27')],'as':_0x95ed('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x95ed('0x29')],'as':_0x95ed('0x2a'),'attributes':['id'],'raw':!![]}]})[_0x95ed('0x17')](function(_0x3f3ed9){if(_0x3f3ed9){_0x2c0824=_0x3f3ed9;_0x226a60[_0x31384c](util[_0x95ed('0x1b')](_0x95ed('0x2b'),_0x3f3ed9['name']));var _0x3a588a=[];switch(_0x3f3ed9[_0x95ed('0x6')]){case'admin':_0x226a60[_0x31384c](_0x95ed('0x2c'));_0x226a60[_0x31384c]('voice:outbound');if(queryQueues['hasOwnProperty']('include')){delete queryQueues['include'];}_0x3a588a['push'](db[_0x95ed('0x2d')][_0x95ed('0x12')](queryQueues));_0x3a588a[_0x95ed('0x2e')](db[_0x95ed('0x2f')][_0x95ed('0x12')](queryQueues));_0x3a588a[_0x95ed('0x2e')](db[_0x95ed('0x30')]['findAll'](queryQueues));_0x3a588a[_0x95ed('0x2e')](db[_0x95ed('0x31')][_0x95ed('0x12')](queryQueues));_0x3a588a['push'](db['MailQueue'][_0x95ed('0x12')](queryQueues));_0x3a588a['push'](db['OpenchannelQueue']['findAll'](queryQueues));_0x3a588a['push'](db[_0x95ed('0x32')]['findAll'](queryQueues));_0x3a588a[_0x95ed('0x2e')](db[_0x95ed('0x19')]['findAll'](queryTelephones));_0x3a588a['push'](db['Trunk']['findAll'](queryTrunks));_0x3a588a['push'](db[_0x95ed('0x1a')][_0x95ed('0x12')](queryCampaigns));_0x3a588a[_0x95ed('0x2e')](db[_0x95ed('0x19')][_0x95ed('0x12')](queryAgents));break;case _0x95ed('0x33'):_0x226a60[_0x31384c]('voice:inbound');_0x226a60[_0x31384c](_0x95ed('0x34'));_0x3a588a[_0x95ed('0x2e')](getAssociatedResources(_0x95ed('0xd'),_0x3f3ed9['userProfileId'],_0x95ed('0x2d')));_0x3a588a[_0x95ed('0x2e')](getAssociatedResources(_0x95ed('0xe'),_0x3f3ed9[_0x95ed('0x21')],_0x95ed('0x2f')));_0x3a588a[_0x95ed('0x2e')](getAssociatedResources(_0x95ed('0xf'),_0x3f3ed9[_0x95ed('0x21')],'FaxQueue'));_0x3a588a['push'](getAssociatedResources('SmsQueues',_0x3f3ed9[_0x95ed('0x21')],_0x95ed('0x31')));_0x3a588a[_0x95ed('0x2e')](getAssociatedResources(_0x95ed('0x11'),_0x3f3ed9[_0x95ed('0x21')],_0x95ed('0x35')));_0x3a588a['push'](getAssociatedResources(_0x95ed('0x36'),_0x3f3ed9[_0x95ed('0x21')],_0x95ed('0x37')));_0x3a588a['push'](getAssociatedResources('WhatsappQueues',_0x3f3ed9[_0x95ed('0x21')],_0x95ed('0x32')));_0x3a588a[_0x95ed('0x2e')](getAssociatedResources(_0x95ed('0x13'),_0x3f3ed9[_0x95ed('0x21')],'User'));_0x3a588a['push'](getAssociatedResources(_0x95ed('0x38'),_0x3f3ed9[_0x95ed('0x21')],_0x95ed('0x39')));_0x3a588a[_0x95ed('0x2e')](getAssociatedResources('IvrCampaigns',_0x3f3ed9[_0x95ed('0x21')],'Campaign'));_0x3a588a[_0x95ed('0x2e')](db[_0x95ed('0x19')][_0x95ed('0x12')](queryAgents));break;case'agent':_0x226a60[_0x31384c](_0x95ed('0x2c'));_0x226a60[_0x31384c](_0x95ed('0x34'));_0x3a588a[_0x95ed('0x2e')](_0x3f3ed9['getVoiceQueues']({'attributes':['id','name']}));_0x3a588a[_0x95ed('0x2e')](_0x3f3ed9['getChatQueues']({'attributes':['id',_0x95ed('0x4')]}));_0x3a588a['push'](_0x3f3ed9[_0x95ed('0x3a')]({'attributes':['id',_0x95ed('0x4')]}));_0x3a588a[_0x95ed('0x2e')](_0x3f3ed9[_0x95ed('0x3b')]({'attributes':['id',_0x95ed('0x4')]}));_0x3a588a['push'](_0x3f3ed9[_0x95ed('0x3c')]({'attributes':['id',_0x95ed('0x4')]}));_0x3a588a[_0x95ed('0x2e')](_0x3f3ed9['getOpenchannelQueues']({'attributes':['id',_0x95ed('0x4')]}));_0x3a588a['push'](_0x3f3ed9[_0x95ed('0x3d')]({'attributes':['id',_0x95ed('0x4')]}));break;}return BPromise['all'](_0x3a588a);}})[_0x95ed('0x17')](function(_0x2b825d){if(_0x2b825d&&_0x2b825d['length']){for(var _0x59d18f=0x0;_0x59d18f<_0x2b825d[_0x95ed('0x1d')];_0x59d18f+=0x1){for(var _0x5756f4=0x0;_0x5756f4<_0x2b825d[_0x59d18f][_0x95ed('0x1d')];_0x5756f4+=0x1){switch(_0x59d18f){case 0x0:joinOrLeaveQueues(_0x226a60,_0x31384c,'voice',_0x2b825d[_0x59d18f][_0x5756f4]);break;case 0x1:joinOrLeaveQueues(_0x226a60,_0x31384c,_0x95ed('0x3e'),_0x2b825d[_0x59d18f][_0x5756f4]);break;case 0x2:joinOrLeaveQueues(_0x226a60,_0x31384c,_0x95ed('0x3f'),_0x2b825d[_0x59d18f][_0x5756f4]);break;case 0x3:joinOrLeaveQueues(_0x226a60,_0x31384c,_0x95ed('0x40'),_0x2b825d[_0x59d18f][_0x5756f4]);break;case 0x4:joinOrLeaveQueues(_0x226a60,_0x31384c,_0x95ed('0x41'),_0x2b825d[_0x59d18f][_0x5756f4]);break;case 0x5:joinOrLeaveQueues(_0x226a60,_0x31384c,_0x95ed('0x42'),_0x2b825d[_0x59d18f][_0x5756f4]);break;case 0x6:joinOrLeaveQueues(_0x226a60,_0x31384c,'whatsapp',_0x2b825d[_0x59d18f][_0x5756f4]);break;case 0x7:if(_0x2c0824[_0x95ed('0x6')]!==_0x95ed('0x7'))_0x226a60[_0x31384c](util[_0x95ed('0x1b')](_0x95ed('0x43'),_0x2b825d[_0x59d18f][_0x5756f4][_0x95ed('0x4')]));break;case 0x8:if(_0x2c0824[_0x95ed('0x6')]!==_0x95ed('0x7'))_0x226a60[_0x31384c](util[_0x95ed('0x1b')](_0x95ed('0x44'),_0x2b825d[_0x59d18f][_0x5756f4][_0x95ed('0x4')]));break;case 0x9:if(_0x2c0824[_0x95ed('0x6')]!==_0x95ed('0x7'))_0x226a60[_0x31384c](util[_0x95ed('0x1b')]('campaign:%s:%s',_0x2b825d[_0x59d18f][_0x5756f4][_0x95ed('0x9')],_0x2b825d[_0x59d18f][_0x5756f4][_0x95ed('0x4')]));break;case 0xa:_0x226a60[_0x31384c](util['format'](_0x95ed('0x2b'),_0x2b825d[_0x59d18f][_0x5756f4]['name']));break;}}}}})[_0x95ed('0x17')](function(){if(_0x31384c===_0x95ed('0x45')){var _0x198c7a=_[_0x95ed('0x18')](_0x2c0824[_0x95ed('0x22')],'id');return _0x2c0824[_0x95ed('0x46')](_0x198c7a)['then'](function(){for(var _0x5ddd5b=0x0;_0x5ddd5b<_0x198c7a[_0x95ed('0x1d')];_0x5ddd5b+=0x1){_0x61d85e['emit'](_0x95ed('0x47'),{'ChatInteractionId':Number(_0x198c7a[_0x5ddd5b]),'UserId':Number(_0x2c0824['id'])});}});}})[_0x95ed('0x17')](function(){if(_0x31384c==='leave'){var _0xf30593=_[_0x95ed('0x18')](_0x2c0824[_0x95ed('0x48')],'id');return _0x2c0824[_0x95ed('0x49')](_0xf30593)['then'](function(){for(var _0x4a0b09=0x0;_0x4a0b09<_0xf30593['length'];_0x4a0b09+=0x1){_0x61d85e[_0x95ed('0x4a')](_0x95ed('0x4b'),{'MailInteractionId':Number(_0xf30593[_0x4a0b09]),'UserId':Number(_0x2c0824['id'])});}});}})[_0x95ed('0x17')](function(){if(_0x31384c===_0x95ed('0x45')){var _0x3e580f=_[_0x95ed('0x18')](_0x2c0824['FaxInteractions'],'id');return _0x2c0824[_0x95ed('0x4c')](_0x3e580f)[_0x95ed('0x17')](function(){for(var _0x2f94f0=0x0;_0x2f94f0<_0x3e580f[_0x95ed('0x1d')];_0x2f94f0+=0x1){_0x61d85e[_0x95ed('0x4a')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x3e580f[_0x2f94f0]),'UserId':Number(_0x2c0824['id'])});}});}})['then'](function(){if(_0x31384c===_0x95ed('0x45')){var _0x660ee6=_['map'](_0x2c0824['SmsInteractions'],'id');return _0x2c0824[_0x95ed('0x4d')](_0x660ee6)[_0x95ed('0x17')](function(){for(var _0x5757d6=0x0;_0x5757d6<_0x660ee6['length'];_0x5757d6+=0x1){_0x61d85e['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x660ee6[_0x5757d6]),'UserId':Number(_0x2c0824['id'])});}});}})[_0x95ed('0x17')](function(){if(_0x31384c==='leave'){var _0x1ce0f2=_[_0x95ed('0x18')](_0x2c0824[_0x95ed('0x28')],'id');return _0x2c0824['removeOpenchannelInteractions'](_0x1ce0f2)[_0x95ed('0x17')](function(){for(var _0x176b6b=0x0;_0x176b6b<_0x1ce0f2[_0x95ed('0x1d')];_0x176b6b+=0x1){_0x61d85e[_0x95ed('0x4a')](_0x95ed('0x4e'),{'OpenchannelInteractionId':Number(_0x1ce0f2[_0x176b6b]),'UserId':Number(_0x2c0824['id'])});}});}})[_0x95ed('0x17')](function(){if(_0x31384c===_0x95ed('0x45')){var _0x5eaf47=_[_0x95ed('0x18')](_0x2c0824[_0x95ed('0x2a')],'id');return _0x2c0824[_0x95ed('0x4f')](_0x5eaf47)['then'](function(){for(var _0x4bda31=0x0;_0x4bda31<_0x5eaf47[_0x95ed('0x1d')];_0x4bda31+=0x1){_0x61d85e['emit'](_0x95ed('0x50'),{'WhatsappInteractionId':Number(_0x5eaf47[_0x4bda31]),'UserId':Number(_0x2c0824['id'])});}});}})[_0x95ed('0x51')](function(_0x419988){_0x226a60['log'](_0x419988);});}}function onDisconnect(_0x56af5d,_0x3649ff){joinOrLeave(_0x56af5d,_0x95ed('0x45'),_0x3649ff);}function onConnect(_0x1419e7){joinOrLeave(_0x1419e7,_0x95ed('0x52'));}exports[_0x95ed('0x53')]=function(_0x29b009){_0x29b009['on'](_0x95ed('0x54'),function(_0x9b257f){_0x9b257f[_0x95ed('0x55')](0x0);_0x9b257f[_0x95ed('0x56')]=_0x9b257f[_0x95ed('0x57')][_0x95ed('0x54')][_0x95ed('0x58')]+':'+_0x9b257f['request']['connection'][_0x95ed('0x59')];_0x9b257f['connectedAt']=new Date();_0x9b257f[_0x95ed('0x5a')]=function(_0x943ed8){console[_0x95ed('0x5a')](_0x95ed('0x5b')+_0x9b257f[_0x95ed('0x5c')][_0x95ed('0x4')]+'['+_0x9b257f[_0x95ed('0x56')]+']',_0x943ed8);};_0x9b257f['on'](_0x95ed('0x5d'),function(){onDisconnect(_0x9b257f,_0x29b009);_0x9b257f[_0x95ed('0x5a')](_0x95ed('0x5e'));});onConnect(_0x9b257f);_0x9b257f[_0x95ed('0x5a')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 68fe59b..11d7757 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 _0x1934=['incomingmessage','outgoingmessage','AfterCreateMessage','event','opened','closed','substatus','fullname','email','internal','default','length','hasOwnProperty','model','hook','callback','toLowerCase','condition','util','../../mysqldb','../logger','triggers','Chat','ChatInteraction','newinteraction','afterUpdate','closedinteraction','afterCreate','newmessage','Sms','SmsInteraction','Whatsapp','WhatsappInteraction','FaxInteraction','Fax','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','EventManager','Trigger,\x20%s','error','code','catch','get','motionChannel','direction','resolve','then','ContactId','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','SELECT','undefined','UserId','interface','format','SIP/%s','name','agent','channel'];(function(_0x5d0853,_0x4e6800){var _0x5d8a25=function(_0x4d72c9){while(--_0x4d72c9){_0x5d0853['push'](_0x5d0853['shift']());}};_0x5d8a25(++_0x4e6800);}(_0x1934,0x1d9));var _0x4193=function(_0x480d67,_0x3110a9){_0x480d67=_0x480d67-0x0;var _0x32752b=_0x1934[_0x480d67];return _0x32752b;};'use strict';var util=require(_0x4193('0x0'));var db=require(_0x4193('0x1'))['db'];var jayson=require('jayson/promise');var logger=require(_0x4193('0x2'))(_0x4193('0x3'));var client=jayson['client']['http']({'port':0x232a});var triggers=[{'channel':_0x4193('0x4'),'model':_0x4193('0x5'),'event':'afterCreate','condition':_0x4193('0x6'),'callback':afterCreate},{'channel':_0x4193('0x4'),'model':_0x4193('0x5'),'event':_0x4193('0x7'),'condition':_0x4193('0x8'),'callback':afterUpdate},{'channel':_0x4193('0x4'),'model':'ChatMessage','event':_0x4193('0x9'),'condition':_0x4193('0xa'),'callback':afterCreateMessage},{'channel':_0x4193('0xb'),'model':_0x4193('0xc'),'event':_0x4193('0x9'),'condition':_0x4193('0x6'),'callback':afterCreate},{'channel':_0x4193('0xb'),'model':_0x4193('0xc'),'event':_0x4193('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x4193('0xb'),'model':'SmsMessage','event':_0x4193('0x9'),'condition':_0x4193('0xa'),'callback':afterCreateMessage},{'channel':_0x4193('0xd'),'model':_0x4193('0xe'),'event':'afterCreate','condition':_0x4193('0x6'),'callback':afterCreate},{'channel':'Whatsapp','model':_0x4193('0xe'),'event':_0x4193('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x4193('0xd'),'model':'WhatsappMessage','event':_0x4193('0x9'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Fax','model':_0x4193('0xf'),'event':_0x4193('0x9'),'condition':_0x4193('0x6'),'callback':afterCreate},{'channel':_0x4193('0x10'),'model':_0x4193('0xf'),'event':'afterUpdate','condition':_0x4193('0x8'),'callback':afterUpdate},{'channel':_0x4193('0x10'),'model':_0x4193('0x11'),'event':_0x4193('0x9'),'condition':_0x4193('0xa'),'callback':afterCreateMessage},{'channel':_0x4193('0x12'),'model':_0x4193('0x13'),'event':_0x4193('0x9'),'condition':_0x4193('0x6'),'callback':afterCreate},{'channel':'Mail','model':_0x4193('0x13'),'event':_0x4193('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x4193('0x12'),'model':_0x4193('0x14'),'event':_0x4193('0x9'),'condition':_0x4193('0xa'),'callback':afterCreateMessage},{'channel':_0x4193('0x15'),'model':_0x4193('0x16'),'event':_0x4193('0x9'),'condition':_0x4193('0x6'),'callback':afterCreate},{'channel':_0x4193('0x15'),'model':'OpenchannelInteraction','event':_0x4193('0x7'),'condition':_0x4193('0x8'),'callback':afterUpdate},{'channel':_0x4193('0x15'),'model':_0x4193('0x17'),'event':_0x4193('0x9'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x272f3f){return client['request'](_0x4193('0x18'),_0x272f3f)['then'](function(_0x46572c){logger['info'](_0x4193('0x19'),_0x4193('0x18'),_0x46572c);if(_0x46572c['error']){if(_0x46572c[_0x4193('0x1a')][_0x4193('0x1b')]===0x1f4){logger['error']('Trigger,\x20%s',_0x4193('0x18'),_0x46572c[_0x4193('0x1a')]);}}})[_0x4193('0x1c')](function(_0x310f62){logger['error'](_0x4193('0x19'),_0x4193('0x18'),_0x310f62);});}function afterCreateMessage(_0x497399){return function(_0x59f9ec){_0x59f9ec=_0x59f9ec[_0x4193('0x1d')]({'plain':!![]});_0x59f9ec['channel']=_0x497399;_0x59f9ec[_0x4193('0x1e')]=_0x497399;_0x59f9ec['event']=_0x59f9ec[_0x4193('0x1f')];Promise[_0x4193('0x20')]()[_0x4193('0x21')](function(){if(typeof _0x59f9ec[_0x4193('0x22')]==='undefined')return null;var _0xe82214=_0x4193('0x23')+_0x59f9ec[_0x4193('0x22')];return db[_0x4193('0x24')][_0x4193('0x25')](_0xe82214,{'type':db['Sequelize']['QueryTypes'][_0x4193('0x26')],'raw':!![]});})[_0x4193('0x21')](function(_0x42de1a){if(_0x42de1a){_0x59f9ec['contact']=_0x42de1a[0x0];}if(typeof _0x59f9ec['UserId']===_0x4193('0x27'))return;return getAgent(_0x59f9ec[_0x4193('0x28')]);})[_0x4193('0x21')](function(_0x46a890){if(_0x46a890){_0x59f9ec[_0x4193('0x29')]=util[_0x4193('0x2a')](_0x4193('0x2b'),_0x46a890[_0x4193('0x2c')]);_0x59f9ec[_0x4193('0x2d')]=_0x46a890;_0x59f9ec[_0x4193('0x2e')]=_0x497399;return request({'event':_0x4193('0x2f'),'message':_0x59f9ec});}else{return request({'event':_0x4193('0x30'),'message':_0x59f9ec});}})[_0x4193('0x1c')](function(_0x321bfe){logger[_0x4193('0x1a')](_0x4193('0x19'),_0x4193('0x31'),_0x321bfe);});};}function afterCreate(_0x8b0d7a,_0x114f70){return function(_0x11c767){_0x11c767=_0x11c767['get']({'plain':!![]});_0x11c767[_0x4193('0x2e')]=_0x8b0d7a;_0x11c767[_0x4193('0x1e')]=_0x8b0d7a;_0x11c767[_0x4193('0x32')]=_0x4193('0x33');Promise[_0x4193('0x20')]()[_0x4193('0x21')](function(){var _0x1fb3fd=_0x4193('0x23')+_0x11c767[_0x4193('0x22')];return db[_0x4193('0x24')][_0x4193('0x25')](_0x1fb3fd,{'type':db['Sequelize']['QueryTypes'][_0x4193('0x26')],'raw':!![]});})[_0x4193('0x21')](function(_0x2a5370){if(_0x2a5370){_0x11c767['contact']=_0x2a5370[0x0];}if(typeof _0x11c767[_0x4193('0x28')]===_0x4193('0x27'))return;return getAgent(_0x11c767[_0x4193('0x28')]);})[_0x4193('0x21')](function(_0x2d173e){if(_0x2d173e){_0x11c767[_0x4193('0x29')]=util[_0x4193('0x2a')](_0x4193('0x2b'),_0x2d173e[_0x4193('0x2c')]);_0x11c767['agent']=_0x2d173e;}return request({'event':_0x114f70,'message':_0x11c767});})[_0x4193('0x1c')](function(_0x241ea7){logger[_0x4193('0x1a')]('Trigger,\x20%s','AfterCreate',_0x241ea7);});};}function afterUpdate(_0x26262a){return function(_0x4b32b7){var _0x58aeef=_0x4b32b7['changed'](_0x4193('0x34'))&&_0x4b32b7[_0x4193('0x34')];var _0x4e8f8f=_0x4b32b7['changed'](_0x4193('0x35'));if(_0x58aeef||_0x4e8f8f){var _0x5a35ff=_0x58aeef?_0x4193('0x8'):'substatus';var _0x217e60=_0x4b32b7['get']({'plain':!![]});_0x217e60[_0x4193('0x2e')]=_0x26262a;_0x217e60['motionChannel']=_0x26262a;_0x217e60['event']=_0x58aeef?_0x4193('0x34'):_0x4193('0x35');var _0x2018c7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x217e60['ContactId'];return db[_0x4193('0x24')][_0x4193('0x25')](_0x2018c7,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x4193('0x21')](function(_0x43bfa0){if(_0x43bfa0){_0x217e60['contact']=_0x43bfa0[0x0];}if(typeof _0x217e60['UserId']===_0x4193('0x27'))return;return getAgent(_0x217e60[_0x4193('0x28')]);})['then'](function(_0x8881a8){if(_0x8881a8){_0x217e60[_0x4193('0x29')]=util[_0x4193('0x2a')](_0x4193('0x2b'),_0x8881a8[_0x4193('0x2c')]);_0x217e60[_0x4193('0x2d')]=_0x8881a8;}return request({'event':_0x5a35ff,'message':_0x217e60});})[_0x4193('0x1c')](function(_0x34bcb8){logger[_0x4193('0x1a')]('Trigger,\x20%s','AfterUpdate',_0x34bcb8);});}};}function getAgent(_0x2d425d){return db['User']['find']({'where':{'id':_0x2d425d},'attributes':['id','name',_0x4193('0x36'),_0x4193('0x37'),_0x4193('0x38')],'raw':!![]})[_0x4193('0x21')](function(_0x35c995){return _0x35c995;});}exports[_0x4193('0x39')]=function(){for(var _0x122fa1=0x0;_0x122fa1=_0x9131db[_0xd63b('0x14')]){throw Error(_0xd63b('0x15'));}_0x1a8d28(_0x38f2b0);})['catch'](function(_0x2931b6){_0x5a4aa5(_0x2931b6);});});}; \ No newline at end of file +var _0x0480=['includes','clearBlockUser','updateAttributes','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','voice','mail','chat','fax','whatsapp','getChannels'];(function(_0x804654,_0x2df4d7){var _0x2e753a=function(_0x5f5667){while(--_0x5f5667){_0x804654['push'](_0x804654['shift']());}};_0x2e753a(++_0x2df4d7);}(_0x0480,0x7a));var _0x0048=function(_0x4a9080,_0x41c803){_0x4a9080=_0x4a9080-0x0;var _0x1aedb2=_0x0480[_0x4a9080];return _0x1aedb2;};'use strict';var _=require(_0x0048('0x0'));var BPromise=require(_0x0048('0x1'));var db=require(_0x0048('0x2'))['db'];var util=require(_0x0048('0x3'));var channels=[_0x0048('0x4'),_0x0048('0x5'),_0x0048('0x6'),_0x0048('0x7'),'sms',_0x0048('0x8'),'openchannel'];exports[_0x0048('0x9')]=function(){return channels;};exports['isValidChannel']=function(_0x5a520c){_0x5a520c=_0x5a520c['toLowerCase']();return _[_0x0048('0xa')](channels,_0x5a520c);};exports[_0x0048('0xb')]=function(_0x2fc90d,_0x24a8ad,_0x61186,_0x4daae3){var _0x1462b2={'loginAttempts':_0x24a8ad,'blocked':_0x61186};if(!_['isUndefined'](_0x4daae3)){_0x1462b2['blockedAt']=_0x4daae3;}return _0x2fc90d[_0x0048('0xc')](_0x1462b2);};exports[_0x0048('0xd')]=function(_0x4f96c3){return new BPromise(function(_0x32d2d5,_0x2e15dd){var _0x3c122a=0x0;if(_0x4f96c3[_0x0048('0xe')]!==_0x0048('0xf')){_0x32d2d5(_0x4f96c3);}db[_0x0048('0x10')][_0x0048('0x11')]({'where':{'role':_0x0048('0xf'),'online':!![],'id':{'$ne':_0x4f96c3['id']}}})[_0x0048('0x12')](function(_0x72c1bd){_0x3c122a=_0x72c1bd;return util[_0x0048('0xd')]();})['then'](function(_0x2fccd9){if(_0x2fccd9&&_0x2fccd9['agents']&&_0x3c122a>=_0x2fccd9[_0x0048('0x13')]){throw Error(_0x0048('0x14'));}_0x32d2d5(_0x4f96c3);})[_0x0048('0x15')](function(_0x35221d){_0x2e15dd(_0x35221d);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index bf74ba9..39bc5e8 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4dc5=['404','status','render','json','send'];(function(_0x214642,_0xc9fac6){var _0x4ec937=function(_0x14b3a8){while(--_0x14b3a8){_0x214642['push'](_0x214642['shift']());}};_0x4ec937(++_0xc9fac6);}(_0x4dc5,0x96));var _0x54dc=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x4dc5[_0x27af45];return _0x18df21;};'use strict';module['exports'][0x194]=function pageNotFound(_0x76c0f4,_0x44fcfc){var _0x4586e8=_0x54dc('0x0');var _0x42f421=0x194;var _0x24be50={'status':_0x42f421};_0x44fcfc[_0x54dc('0x1')](_0x24be50[_0x54dc('0x1')]);_0x44fcfc[_0x54dc('0x2')](_0x4586e8,{},function(_0x16782c,_0x12626c){if(_0x16782c){return _0x44fcfc[_0x54dc('0x1')](_0x24be50[_0x54dc('0x1')])[_0x54dc('0x3')](_0x24be50);}_0x44fcfc[_0x54dc('0x4')](_0x12626c);});}; \ No newline at end of file +var _0x85cf=['json','send','404','status'];(function(_0x41df57,_0x207f12){var _0x4f2da6=function(_0x27454f){while(--_0x27454f){_0x41df57['push'](_0x41df57['shift']());}};_0x4f2da6(++_0x207f12);}(_0x85cf,0x76));var _0xf85c=function(_0xcee595,_0x2a6c0e){_0xcee595=_0xcee595-0x0;var _0x1bdda0=_0x85cf[_0xcee595];return _0x1bdda0;};'use strict';module['exports'][0x194]=function pageNotFound(_0x3b732f,_0x235af7){var _0x2fbb4f=_0xf85c('0x0');var _0x39bbfd=0x194;var _0x240fa2={'status':_0x39bbfd};_0x235af7[_0xf85c('0x1')](_0x240fa2[_0xf85c('0x1')]);_0x235af7['render'](_0x2fbb4f,{},function(_0x5d7a11,_0x95f9f8){if(_0x5d7a11){return _0x235af7[_0xf85c('0x1')](_0x240fa2['status'])[_0xf85c('0x2')](_0x240fa2);}_0x235af7[_0xf85c('0x3')](_0x95f9f8);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 27300bf..ab28ced 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','../api/integration/integration.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/team/team.model','License','../api/license/license.model','Campaign','Migration','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfileSection/userProfileSection.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','User','hasOne','cascade','UserId','VoiceRecording','Recordings','hasMany','VoiceExtension','Extensions','CmHopperFinal','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','WhatsappInteraction','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','Groups','chat_group_has_users','belongsToMany','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_chat_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueue','VoiceQueues','UserVoiceQueue','VoicePrefixes','MailQueues','UserMailQueue','ChatQueue','ChatQueues','UserChatQueue','FaxQueues','UserFaxQueue','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Team','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','ContactId','MailServerOut','MailAccountId','Imap','Smtp','Answers','Interactions','List','TemplateId','team_has_mail_queues','MailMessage','MailInteractionId','mail_interaction_has_tags','Tags','Users','Attachments','Interaction','Account','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','restrict','TagId','MailQueueReport','ListId','Items','FaxAccountId','Exntensions','Pause','mandatoryDispositionPause','FaxInteractionId','fax_interaction_has_tags','ThroughTags','user_has_fax_interactions','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','Owner','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','Dispositions','OpenchannelAccountId','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ChatProactiveAction','ChatApplication','Agent','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatInternalMessage','ChatGroupId','JscriptySessionReport','Company','CompanyId','cm_contact_has_tags','CampaignId','OwnerId','All','OneAll','AutomationAllId','Automation','Any','AutomationAnyId','Action','Actions','AutomationId','Intervals','MailApplications','ChatApplications','FaxApplications','Schedule','AnalyticDefaultReport','DefaultReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerId','Fields','MetricId','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Description','Variable','SugarcrmField','Subject','VariableId','Configurations','int_desk_configuration_has_tags','Field','FreshdeskField','int_freshdesk_configuration_has_tags','ServicenowConfiguration','FromId','SessionId','JscriptyAnswerReport','JscriptyProject','ProjectId','team_has_whatsapp_queues','WhatsappQueues','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToChatWebsiteId','ToAccount','FromFaxAccountId','FromAgent','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','UserProfileSection','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','user_has_whatsapp_interactions','WhatsappTransferReport','ToQueueId','WhatsappQueueId','exports','../config/environment','sequelize','lodash','defaultsDeep','motion2','xC@LL1234','mysql','utf8_general_ci','sequelizeHistory','xcall','utf8mb4','name','utf8','database','username','password','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueue/userVoiceQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperHistory','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/action/action.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model'];(function(_0x2c2cad,_0x455edd){var _0xff4172=function(_0x3c9cce){while(--_0x3c9cce){_0x2c2cad['push'](_0x2c2cad['shift']());}};_0xff4172(++_0x455edd);}(_0x70e0,0x17b));var _0x070e=function(_0x1c75f9,_0x3547d7){_0x1c75f9=_0x1c75f9-0x0;var _0x1bd5c6=_0x70e0[_0x1c75f9];return _0x1bd5c6;};'use strict';var config=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));var _=require(_0x070e('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0x070e('0x1')]=_[_0x070e('0x3')](config[_0x070e('0x1')],{'database':_0x070e('0x4'),'username':'xcall','password':_0x070e('0x5'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x070e('0x6'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0x070e('0x7')}}});config[_0x070e('0x8')]=_[_0x070e('0x3')](config[_0x070e('0x8')],{'database':_0x070e('0x4'),'username':_0x070e('0x9'),'password':_0x070e('0x5'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x070e('0xa')},'logging':![],'timezone':timezone[_0x070e('0xb')](),'define':{'charset':_0x070e('0xc'),'collate':_0x070e('0x7')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x070e('0x1')][_0x070e('0xd')],config[_0x070e('0x1')][_0x070e('0xe')],config[_0x070e('0x1')][_0x070e('0xf')],config[_0x070e('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x070e('0xd')],config['sequelizeHistory']['username'],config['sequelizeHistory'][_0x070e('0xf')],config[_0x070e('0x8')]['options'])};db['User']=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x11'));db[_0x070e('0x12')]=db['sequelize']['import'](_0x070e('0x13'));db[_0x070e('0x14')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x15'));db['VoiceExtension']=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x16'));db[_0x070e('0x17')]=db[_0x070e('0x1')]['import']('../api/voiceMusicOnHold/voiceMusicOnHold.model');db['VoiceQueue']=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x18'));db['VoiceRecording']=db[_0x070e('0x1')]['import'](_0x070e('0x19'));db[_0x070e('0x1a')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x1b'));db[_0x070e('0x1c')]=db[_0x070e('0x1')][_0x070e('0x10')]('../api/voiceMail/voiceMail.model');db[_0x070e('0x1d')]=db[_0x070e('0x1')][_0x070e('0x10')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0x070e('0x1e')]=db['sequelize']['import'](_0x070e('0x1f'));db[_0x070e('0x20')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x21'));db['VoiceAgentReport']=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x22'));db[_0x070e('0x23')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x24'));db[_0x070e('0x25')]=db['sequelize'][_0x070e('0x10')](_0x070e('0x26'));db[_0x070e('0x27')]=db['sequelize']['import'](_0x070e('0x28'));db[_0x070e('0x29')]=db[_0x070e('0x1')]['import'](_0x070e('0x2a'));db[_0x070e('0x2b')]=db[_0x070e('0x1')][_0x070e('0x10')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db['UserVoiceQueue']=db['sequelize']['import'](_0x070e('0x2c'));db['UserChatQueue']=db[_0x070e('0x1')][_0x070e('0x10')]('../api/userChatQueue/userChatQueue.model');db['UserMailQueue']=db[_0x070e('0x1')][_0x070e('0x10')]('../api/userMailQueue/userMailQueue.model');db['UserFaxQueue']=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x2d'));db[_0x070e('0x2e')]=db[_0x070e('0x1')]['import']('../api/userSmsQueue/userSmsQueue.model');db[_0x070e('0x2f')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x30'));db[_0x070e('0x31')]=db['sequelize'][_0x070e('0x10')](_0x070e('0x32'));db['MailServerIn']=db[_0x070e('0x1')][_0x070e('0x10')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db['sequelize'][_0x070e('0x10')](_0x070e('0x33'));db[_0x070e('0x34')]=db[_0x070e('0x1')][_0x070e('0x10')]('../api/mailAccount/mailAccount.model');db[_0x070e('0x35')]=db[_0x070e('0x1')][_0x070e('0x10')]('../api/mailQueue/mailQueue.model');db[_0x070e('0x36')]=db[_0x070e('0x1')][_0x070e('0x10')]('../api/mailSubstatus/mailSubstatus.model');db[_0x070e('0x37')]=db[_0x070e('0x1')]['import'](_0x070e('0x38'));db['MailMessage']=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x39'));db[_0x070e('0x3a')]=db[_0x070e('0x1')]['import'](_0x070e('0x3b'));db['MailQueueReport']=db['sequelize'][_0x070e('0x10')](_0x070e('0x3c'));db[_0x070e('0x3d')]=db['sequelize'][_0x070e('0x10')](_0x070e('0x3e'));db[_0x070e('0x3f')]=db[_0x070e('0x1')]['import'](_0x070e('0x40'));db['FaxAccount']=db['sequelize']['import'](_0x070e('0x41'));db[_0x070e('0x42')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x43'));db['FaxInteraction']=db[_0x070e('0x1')]['import'](_0x070e('0x44'));db[_0x070e('0x45')]=db[_0x070e('0x1')]['import']('../api/faxMessage/faxMessage.model');db[_0x070e('0x46')]=db['sequelize'][_0x070e('0x10')](_0x070e('0x47'));db[_0x070e('0x48')]=db['sequelize'][_0x070e('0x10')](_0x070e('0x49'));db['SmsAccount']=db['sequelize'][_0x070e('0x10')](_0x070e('0x4a'));db[_0x070e('0x4b')]=db[_0x070e('0x1')][_0x070e('0x10')]('../api/smsApplication/smsApplication.model');db[_0x070e('0x4c')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x4d'));db[_0x070e('0x4e')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x4f'));db[_0x070e('0x50')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x51'));db[_0x070e('0x52')]=db[_0x070e('0x1')][_0x070e('0x10')]('../api/openchannelAccount/openchannelAccount.model');db[_0x070e('0x53')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x54'));db[_0x070e('0x55')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x56'));db[_0x070e('0x57')]=db['sequelize'][_0x070e('0x10')]('../api/openchannelMessage/openchannelMessage.model');db[_0x070e('0x58')]=db[_0x070e('0x1')]['import'](_0x070e('0x59'));db[_0x070e('0x5a')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x5b'));db[_0x070e('0x5c')]=db[_0x070e('0x1')]['import'](_0x070e('0x5d'));db['ChatApplication']=db['sequelize'][_0x070e('0x10')](_0x070e('0x5e'));db[_0x070e('0x5f')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x60'));db[_0x070e('0x61')]=db[_0x070e('0x1')]['import'](_0x070e('0x62'));db['ChatOfflineMessage']=db['sequelize'][_0x070e('0x10')](_0x070e('0x63'));db['ChatQueue']=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x64'));db[_0x070e('0x65')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x66'));db['ChatProactiveAction']=db['sequelize']['import'](_0x070e('0x67'));db[_0x070e('0x68')]=db[_0x070e('0x1')][_0x070e('0x10')]('../api/cmCompany/cmCompany.model');db[_0x070e('0x69')]=db['sequelize'][_0x070e('0x10')](_0x070e('0x6a'));db[_0x070e('0x6b')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x6c'));db['CmHopperBlack']=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x6d'));db['CmHopperFinal']=db[_0x070e('0x1')][_0x070e('0x10')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x070e('0x6e')]=db['sequelize'][_0x070e('0x10')]('../api/cmHopperHistory/cmHopperHistory.model');db['ReportAgentPreview']=db['sequelize'][_0x070e('0x10')](_0x070e('0x6f'));db[_0x070e('0x70')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x71'));db['Action']=db[_0x070e('0x1')]['import'](_0x070e('0x72'));db['Automation']=db[_0x070e('0x1')][_0x070e('0x10')]('../api/automation/automation.model');db[_0x070e('0x73')]=db['sequelize'][_0x070e('0x10')](_0x070e('0x74'));db[_0x070e('0x75')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x76'));db[_0x070e('0x77')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x78'));db[_0x070e('0x79')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x7a'));db['Pause']=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x7b'));db[_0x070e('0x7c')]=db['sequelize'][_0x070e('0x10')](_0x070e('0x7d'));db[_0x070e('0x7e')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x7f'));db['Schedule']=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x80'));db[_0x070e('0x81')]=db['sequelize'][_0x070e('0x10')]('../api/sound/sound.model');db[_0x070e('0x82')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x83'));db[_0x070e('0x84')]=db['sequelize'][_0x070e('0x10')](_0x070e('0x85'));db[_0x070e('0x86')]=db[_0x070e('0x1')]['import'](_0x070e('0x87'));db['Variable']=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x88'));db['Integration']=db[_0x070e('0x1')]['import'](_0x070e('0x89'));db['IntegrationReport']=db[_0x070e('0x1')][_0x070e('0x10')]('../api/integrationReport/integrationReport.model');db[_0x070e('0x8a')]=db['sequelize'][_0x070e('0x10')](_0x070e('0x8b'));db['AnalyticDefaultReport']=db['sequelize'][_0x070e('0x10')](_0x070e('0x8c'));db[_0x070e('0x8d')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x8e'));db[_0x070e('0x8f')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x90'));db[_0x070e('0x91')]=db[_0x070e('0x1')][_0x070e('0x10')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x070e('0x92')]=db[_0x070e('0x1')]['import']('../api/analyticTreeReport/analyticTreeReport.model');db[_0x070e('0x93')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x94'));db[_0x070e('0x95')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x96'));db[_0x070e('0x97')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x98'));db[_0x070e('0x99')]=db['sequelize']['import']('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x070e('0x9a')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x9b'));db['SugarcrmField']=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x9c'));db[_0x070e('0x9d')]=db[_0x070e('0x1')][_0x070e('0x10')]('../api/intDeskAccount/intDeskAccount.model');db[_0x070e('0x9e')]=db['sequelize'][_0x070e('0x10')](_0x070e('0x9f'));db[_0x070e('0xa0')]=db[_0x070e('0x1')][_0x070e('0x10')]('../api/intDeskField/intDeskField.model');db[_0x070e('0xa1')]=db[_0x070e('0x1')]['import'](_0x070e('0xa2'));db[_0x070e('0xa3')]=db['sequelize'][_0x070e('0x10')](_0x070e('0xa4'));db[_0x070e('0xa5')]=db['sequelize'][_0x070e('0x10')](_0x070e('0xa6'));db[_0x070e('0xa7')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0xa8'));db[_0x070e('0xa9')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0xaa'));db[_0x070e('0xab')]=db[_0x070e('0x1')][_0x070e('0x10')]('../api/intZendeskField/intZendeskField.model');db[_0x070e('0xac')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0xad'));db[_0x070e('0xae')]=db[_0x070e('0x1')]['import']('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db['FreshdeskField']=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0xaf'));db[_0x070e('0xb0')]=db['sequelize'][_0x070e('0x10')](_0x070e('0xb1'));db[_0x070e('0xb2')]=db['sequelize'][_0x070e('0x10')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x070e('0xb3')]=db[_0x070e('0x1')]['import']('../api/intVtigerField/intVtigerField.model');db[_0x070e('0xb4')]=db[_0x070e('0x1')]['import'](_0x070e('0xb5'));db['ServicenowConfiguration']=db['sequelize']['import'](_0x070e('0xb6'));db[_0x070e('0xb7')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0xb8'));db[_0x070e('0xb9')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0xba'));db[_0x070e('0xbb')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0xbc'));db[_0x070e('0xbd')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0xbe'));db[_0x070e('0xbf')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0xc0'));db[_0x070e('0xc1')]=db['sequelize'][_0x070e('0x10')](_0x070e('0xc2'));db[_0x070e('0xc3')]=db[_0x070e('0x1')]['import'](_0x070e('0xc4'));db[_0x070e('0xc5')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x89'));db[_0x070e('0xc6')]=db['sequelize']['import']('../api/network/network.model');db[_0x070e('0xc7')]=db['sequelize'][_0x070e('0x10')](_0x070e('0xc8'));db['ChatInternalMessage']=db[_0x070e('0x1')][_0x070e('0x10')]('../api/chatInternalMessage/chatInternalMessage.model');db['JscriptyAnswerReport']=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0xc9'));db[_0x070e('0xca')]=db[_0x070e('0x1')]['import'](_0x070e('0xcb'));db['JscriptySessionReport']=db[_0x070e('0x1')][_0x070e('0x10')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x070e('0xcc')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0xcd'));db[_0x070e('0xce')]=db[_0x070e('0x1')]['import'](_0x070e('0xcf'));db[_0x070e('0xd0')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0xd1'));db['JscriptyProject']=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0xd2'));db[_0x070e('0xd3')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0xd4'));db[_0x070e('0xd5')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0xd6'));db[_0x070e('0xd7')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0xd8'));db[_0x070e('0xd9')]=db['sequelize']['import'](_0x070e('0xda'));db[_0x070e('0xdb')]=db['sequelize']['import']('../api/squareMessage/squareMessage.model');db['Team']=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0xdc'));db[_0x070e('0xdd')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0xde'));db[_0x070e('0xdf')]=db[_0x070e('0x1')][_0x070e('0x10')]('../api/campaign/campaign.model');db[_0x070e('0xe0')]=db[_0x070e('0x1')]['import'](_0x070e('0xe1'));db[_0x070e('0xe2')]=db[_0x070e('0x1')][_0x070e('0x10')]('../api/attachment/attachment.model');db[_0x070e('0xe3')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0xe4'));db['MailTransferReport']=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0xe5'));db[_0x070e('0xe6')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0xe7'));db[_0x070e('0xe8')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0xe9'));db['OpenchannelTransferReport']=db[_0x070e('0x1')][_0x070e('0x10')]('../api/openchannelTransferReport/openchannelTransferReport.model');db['SmsTransferReport']=db[_0x070e('0x1')]['import'](_0x070e('0xea'));db[_0x070e('0xeb')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0xec'));db[_0x070e('0xed')]=db[_0x070e('0x1')]['import'](_0x070e('0xee'));db[_0x070e('0xef')]=db[_0x070e('0x1')][_0x070e('0x10')]('../api/userProfile/userProfile.model');db['UserProfileSection']=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0xf0'));db['UserProfileResource']=db[_0x070e('0x1')][_0x070e('0x10')]('../api/userProfileResource/userProfileResource.model');db[_0x070e('0xf1')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0xf2'));db[_0x070e('0xf3')]=db[_0x070e('0x1')]['import']('../api/whatsappAccount/whatsappAccount.model');db[_0x070e('0xf4')]=db['sequelize'][_0x070e('0x10')](_0x070e('0xf5'));db['WhatsappInteraction']=db[_0x070e('0x1')]['import'](_0x070e('0xf6'));db[_0x070e('0xf7')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0xf8'));db[_0x070e('0xf9')]=db['sequelize'][_0x070e('0x10')](_0x070e('0xfa'));db['WhatsappTransferReport']=db['sequelize'][_0x070e('0x10')](_0x070e('0xfb'));db[_0x070e('0xfc')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0xfd'));db[_0x070e('0xfe')]=db[_0x070e('0x1')]['import'](_0x070e('0xff'));db[_0x070e('0x100')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x101'));db[_0x070e('0x102')]=db[_0x070e('0x1')][_0x070e('0x10')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x070e('0x103')]=db[_0x070e('0x1')][_0x070e('0x10')](_0x070e('0x104'));db[_0x070e('0x105')][_0x070e('0x106')](db[_0x070e('0x1c')],{'as':_0x070e('0x1c'),'onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x108')});db['User']['hasMany'](db[_0x070e('0x109')],{'as':_0x070e('0x10a'),'foreignKey':_0x070e('0x108')});db['User'][_0x070e('0x10b')](db[_0x070e('0x2b')],{'as':'VoiceQueuesRt','foreignKey':_0x070e('0x108')});db[_0x070e('0x105')][_0x070e('0x10b')](db[_0x070e('0x10c')],{'as':_0x070e('0x10d'),'onDelete':_0x070e('0x107'),'hooks':!![]});db['User']['hasMany'](db[_0x070e('0x10e')],{'as':_0x070e('0x10f'),'foreignKey':'UserId'});db[_0x070e('0x105')][_0x070e('0x10b')](db[_0x070e('0x6e')],{'as':_0x070e('0x110'),'foreignKey':_0x070e('0x108')});db[_0x070e('0x105')]['hasMany'](db[_0x070e('0x111')],{'as':_0x070e('0x111'),'foreignKey':'UserId'});db[_0x070e('0x105')][_0x070e('0x10b')](db[_0x070e('0x55')],{'as':_0x070e('0x112'),'foreignKey':'UserId'});db['User'][_0x070e('0x10b')](db[_0x070e('0x5f')],{'as':_0x070e('0x113'),'foreignKey':_0x070e('0x108')});db[_0x070e('0x105')][_0x070e('0x10b')](db[_0x070e('0x4c')],{'as':_0x070e('0x114'),'foreignKey':_0x070e('0x108')});db[_0x070e('0x105')]['hasMany'](db[_0x070e('0x115')],{'as':_0x070e('0x116'),'foreignKey':_0x070e('0x108')});db[_0x070e('0x105')]['hasMany'](db[_0x070e('0x37')],{'as':_0x070e('0x117'),'foreignKey':'UserId'});db['User'][_0x070e('0x10b')](db[_0x070e('0x118')],{'as':_0x070e('0x119'),'foreignKey':'UserId'});db[_0x070e('0x105')][_0x070e('0x10b')](db[_0x070e('0xf1')],{'as':_0x070e('0x11a'),'foreignKey':_0x070e('0x11b')});db['User'][_0x070e('0x11c')](db[_0x070e('0xef')],{'as':'UserProfile','foreignKey':_0x070e('0x11d')});db['User']['belongsToMany'](db['ChatGroup'],{'as':_0x070e('0x11e'),'through':_0x070e('0x11f')});db[_0x070e('0x105')][_0x070e('0x120')](db['CmContact'],{'as':_0x070e('0x121'),'through':_0x070e('0x122')});db['User'][_0x070e('0x120')](db[_0x070e('0xeb')],{'as':_0x070e('0x123'),'through':_0x070e('0x124')});db[_0x070e('0x105')][_0x070e('0x120')](db['Team'],{'through':_0x070e('0x125')});db['User'][_0x070e('0x120')](db[_0x070e('0x37')],{'as':_0x070e('0x117'),'through':'user_has_mail_interactions'});db[_0x070e('0x105')][_0x070e('0x120')](db[_0x070e('0x5f')],{'as':'ChatInteractions','through':_0x070e('0x126')});db[_0x070e('0x105')]['belongsToMany'](db[_0x070e('0x115')],{'as':_0x070e('0x116'),'through':'user_has_fax_interactions'});db['User']['belongsToMany'](db['SmsInteraction'],{'as':_0x070e('0x114'),'through':_0x070e('0x127')});db[_0x070e('0x105')][_0x070e('0x120')](db[_0x070e('0x55')],{'as':_0x070e('0x112'),'through':_0x070e('0x128')});db[_0x070e('0x105')]['belongsToMany'](db['WhatsappInteraction'],{'as':'WhatsappInteractions','through':'user_has_whatsapp_interactions'});db[_0x070e('0x105')][_0x070e('0x120')](db[_0x070e('0x129')],{'as':_0x070e('0x12a'),'through':_0x070e('0x12b'),'required':![]});db['User']['belongsToMany'](db[_0x070e('0xed')],{'as':_0x070e('0x12c'),'through':'UserVoicePrefix','required':![]});db[_0x070e('0x105')][_0x070e('0x120')](db[_0x070e('0x35')],{'as':_0x070e('0x12d'),'through':_0x070e('0x12e'),'required':![]});db[_0x070e('0x105')]['belongsToMany'](db[_0x070e('0x12f')],{'as':_0x070e('0x130'),'through':_0x070e('0x131'),'required':![],'hooks':!![]});db['User'][_0x070e('0x120')](db[_0x070e('0x46')],{'as':_0x070e('0x132'),'through':_0x070e('0x133'),'required':![]});db['User'][_0x070e('0x120')](db[_0x070e('0x50')],{'as':'SmsQueues','through':_0x070e('0x2e'),'required':![]});db[_0x070e('0x105')]['belongsToMany'](db[_0x070e('0x58')],{'as':'OpenchannelQueues','through':_0x070e('0x2f'),'required':![]});db['User'][_0x070e('0x120')](db['WhatsappQueue'],{'as':'WhatsappQueues','through':_0x070e('0x31'),'required':![]});db['User']['belongsToMany'](db[_0x070e('0xeb')],{'through':_0x070e('0x124')});db[_0x070e('0x105')][_0x070e('0x120')](db[_0x070e('0x5a')],{'as':'ChatWebsites','through':_0x070e('0x134')});db[_0x070e('0x105')][_0x070e('0x120')](db[_0x070e('0x135')],{'as':_0x070e('0x136'),'through':_0x070e('0x137')});db['User'][_0x070e('0x120')](db[_0x070e('0x34')],{'as':_0x070e('0x138'),'through':_0x070e('0x139')});db['User']['belongsToMany'](db[_0x070e('0x52')],{'as':_0x070e('0x13a'),'through':_0x070e('0x13b')});db[_0x070e('0x105')][_0x070e('0x120')](db[_0x070e('0x13c')],{'as':'SmsAccounts','through':_0x070e('0x13d')});db[_0x070e('0x105')][_0x070e('0x120')](db[_0x070e('0xf3')],{'as':_0x070e('0x13e'),'through':_0x070e('0x13f')});db['User']['belongsToMany'](db[_0x070e('0xd7')],{'as':_0x070e('0x140'),'through':_0x070e('0x141')});db[_0x070e('0x12')][_0x070e('0x10b')](db[_0x070e('0x10c')],{'as':_0x070e('0x142'),'onDelete':'cascade','foreignKey':_0x070e('0x143')});db['VoiceContext'][_0x070e('0x10b')](db['VoiceExtension'],{'onDelete':'cascade'});db['VoiceExtension'][_0x070e('0x10b')](db[_0x070e('0x10c')],{'as':_0x070e('0x144'),'onDelete':_0x070e('0x107')});db[_0x070e('0x17')][_0x070e('0x120')](db[_0x070e('0x81')],{'as':_0x070e('0x145'),'through':_0x070e('0x146')});db['VoiceQueue'][_0x070e('0x10b')](db[_0x070e('0x2b')],{'as':_0x070e('0x147'),'foreignKey':_0x070e('0x148')});db[_0x070e('0x129')][_0x070e('0x10b')](db[_0x070e('0x6b')],{'as':_0x070e('0x149'),'foreignKey':_0x070e('0x148')});db['VoiceQueue']['hasMany'](db[_0x070e('0x10e')],{'as':_0x070e('0x10f'),'foreignKey':'VoiceQueueId'});db[_0x070e('0x129')]['hasMany'](db['CmHopperHistory'],{'as':_0x070e('0x14a'),'foreignKey':_0x070e('0x148')});db['VoiceQueue'][_0x070e('0x10b')](db[_0x070e('0x111')],{'as':_0x070e('0x111'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x070e('0x10b')](db[_0x070e('0x14b')],{'as':_0x070e('0x14c'),'foreignKey':'VoiceQueueId'});db[_0x070e('0x129')][_0x070e('0x10b')](db['JscriptySessionReport'],{'as':_0x070e('0x14d'),'foreignKey':_0x070e('0x148')});db[_0x070e('0x129')][_0x070e('0x11c')](db[_0x070e('0x27')],{'as':_0x070e('0x27'),'foreignKey':_0x070e('0x14e')});db[_0x070e('0x129')][_0x070e('0x11c')](db[_0x070e('0x27')],{'as':_0x070e('0x14f'),'foreignKey':_0x070e('0x150')});db[_0x070e('0x129')][_0x070e('0x11c')](db[_0x070e('0x79')],{'as':_0x070e('0x79'),'foreignKey':_0x070e('0x151')});db['VoiceQueue']['belongsTo'](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x070e('0x152')});db[_0x070e('0x129')][_0x070e('0x120')](db['CmList'],{'as':_0x070e('0x123'),'through':_0x070e('0x153')});db[_0x070e('0x129')]['belongsToMany'](db[_0x070e('0x105')],{'as':_0x070e('0x154'),'through':_0x070e('0x12b')});db[_0x070e('0x129')]['belongsToMany'](db[_0x070e('0x155')],{'as':_0x070e('0x156'),'through':_0x070e('0x100')});db['VoiceQueue'][_0x070e('0x120')](db[_0x070e('0xeb')],{'as':_0x070e('0x157'),'through':_0x070e('0x158')});db[_0x070e('0x109')][_0x070e('0x11c')](db[_0x070e('0x105')],{'as':_0x070e('0x105'),'foreignKey':_0x070e('0x108')});db['ScreenRecording']['belongsTo'](db[_0x070e('0x105')],{'as':'User','foreignKey':'UserId'});db[_0x070e('0x1c')][_0x070e('0x10b')](db[_0x070e('0x1d')],{'as':_0x070e('0x159'),'onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x15a'),'sourceKey':'mailbox'});db[_0x070e('0x1d')][_0x070e('0x11c')](db[_0x070e('0x1c')],{'foreignKey':_0x070e('0x15a'),'targetKey':'mailbox'});db[_0x070e('0x1e')]['hasMany'](db[_0x070e('0x23')],{'as':_0x070e('0x15b'),'foreignKey':_0x070e('0x15c'),'constraints':![]});db[_0x070e('0x1e')][_0x070e('0x10b')](db[_0x070e('0x15d')],{'as':_0x070e('0x15e'),'foreignKey':_0x070e('0x15c'),'constraints':![]});db[_0x070e('0x1e')]['belongsTo'](db[_0x070e('0x105')],{'as':_0x070e('0x105'),'foreignKey':_0x070e('0x108')});db[_0x070e('0x1e')][_0x070e('0x11c')](db[_0x070e('0x69')],{'as':_0x070e('0x15f'),'foreignKey':_0x070e('0x160')});db['MailServerIn'][_0x070e('0x11c')](db[_0x070e('0x34')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0x070e('0x161')][_0x070e('0x11c')](db[_0x070e('0x34')],{'as':_0x070e('0x34'),'foreignKey':_0x070e('0x162')});db[_0x070e('0x34')]['hasOne'](db['MailServerIn'],{'as':_0x070e('0x163'),'onDelete':_0x070e('0x107')});db['MailAccount'][_0x070e('0x106')](db['MailServerOut'],{'as':_0x070e('0x164'),'onDelete':_0x070e('0x107')});db['MailAccount'][_0x070e('0x10b')](db[_0x070e('0x75')],{'as':'Dispositions','foreignKey':'MailAccountId','onDelete':_0x070e('0x107')});db['MailAccount'][_0x070e('0x10b')](db[_0x070e('0x73')],{'as':_0x070e('0x165'),'foreignKey':'MailAccountId'});db[_0x070e('0x34')][_0x070e('0x10b')](db['MailMessage'],{'as':_0x070e('0x159'),'foreignKey':_0x070e('0x162')});db[_0x070e('0x34')][_0x070e('0x10b')](db[_0x070e('0x37')],{'as':_0x070e('0x166')});db[_0x070e('0x34')][_0x070e('0x10b')](db[_0x070e('0x3a')],{'as':_0x070e('0x144')});db['MailAccount'][_0x070e('0x11c')](db[_0x070e('0xeb')],{'as':_0x070e('0x167'),'foreignKey':'ListId'});db['MailAccount'][_0x070e('0x11c')](db[_0x070e('0x84')],{'as':_0x070e('0x84'),'foreignKey':_0x070e('0x168')});db['MailAccount'][_0x070e('0x11c')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x070e('0x152')});db['MailAccount'][_0x070e('0x120')](db[_0x070e('0x105')],{'as':_0x070e('0x154'),'through':_0x070e('0x139')});db['MailQueue'][_0x070e('0x120')](db['User'],{'as':_0x070e('0x154'),'through':_0x070e('0x12e')});db[_0x070e('0x35')][_0x070e('0x120')](db[_0x070e('0x155')],{'through':_0x070e('0x169'),'as':_0x070e('0x156')});db[_0x070e('0x37')][_0x070e('0x10b')](db[_0x070e('0x16a')],{'as':_0x070e('0x159'),'onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x16b')});db[_0x070e('0x37')][_0x070e('0x11c')](db[_0x070e('0x34')],{'as':'Account','foreignKey':'MailAccountId'});db[_0x070e('0x37')][_0x070e('0x11c')](db['CmContact'],{'as':_0x070e('0x15f'),'foreignKey':_0x070e('0x160')});db['MailInteraction'][_0x070e('0x11c')](db[_0x070e('0x105')],{'as':'Owner','foreignKey':_0x070e('0x108')});db[_0x070e('0x37')][_0x070e('0x120')](db[_0x070e('0x82')],{'through':_0x070e('0x16c'),'as':_0x070e('0x16d')});db['MailInteraction'][_0x070e('0x120')](db[_0x070e('0x82')],{'through':_0x070e('0x16c'),'as':'ThroughTags'});db[_0x070e('0x37')][_0x070e('0x120')](db[_0x070e('0x105')],{'as':_0x070e('0x16e'),'through':'user_has_mail_interactions','foreignKey':'MailInteractionId'});db[_0x070e('0x16a')][_0x070e('0x10b')](db[_0x070e('0xe2')],{'as':_0x070e('0x16f'),'onDelete':_0x070e('0x107')});db[_0x070e('0x16a')][_0x070e('0x11c')](db['User'],{'as':_0x070e('0x105')});db[_0x070e('0x16a')][_0x070e('0x11c')](db[_0x070e('0x69')],{'onDelete':_0x070e('0x107'),'as':_0x070e('0x15f')});db[_0x070e('0x16a')][_0x070e('0x11c')](db[_0x070e('0x37')],{'as':_0x070e('0x170'),'foreignKey':_0x070e('0x16b')});db[_0x070e('0x16a')][_0x070e('0x11c')](db[_0x070e('0x34')],{'as':_0x070e('0x171'),'foreignKey':'MailAccountId'});db[_0x070e('0x16a')][_0x070e('0x11c')](db[_0x070e('0x5a')],{'as':_0x070e('0x5a'),'foreignKey':_0x070e('0x172')});db[_0x070e('0x16a')][_0x070e('0x11c')](db['ChatOfflineMessage'],{'as':_0x070e('0x173'),'foreignKey':_0x070e('0x174')});db[_0x070e('0x3a')][_0x070e('0x11c')](db[_0x070e('0x105')],{'onDelete':_0x070e('0x175')});db[_0x070e('0x3a')][_0x070e('0x11c')](db[_0x070e('0x35')],{'onDelete':'restrict'});db[_0x070e('0x3a')][_0x070e('0x11c')](db[_0x070e('0x34')],{'onDelete':_0x070e('0x175')});db[_0x070e('0x3a')][_0x070e('0x11c')](db[_0x070e('0x79')],{'onDelete':_0x070e('0x175'),'foreignKey':_0x070e('0x151')});db[_0x070e('0x3a')][_0x070e('0x11c')](db[_0x070e('0x82')],{'onDelete':_0x070e('0x175'),'foreignKey':_0x070e('0x176')});db[_0x070e('0x177')][_0x070e('0x11c')](db[_0x070e('0x34')],{});db[_0x070e('0x177')][_0x070e('0x11c')](db[_0x070e('0xeb')],{'as':_0x070e('0x167'),'foreignKey':_0x070e('0x178')});db['MailQueueReport'][_0x070e('0x11c')](db[_0x070e('0x69')],{'as':_0x070e('0x15f'),'foreignKey':_0x070e('0x160')});db['MailQueueReport'][_0x070e('0x11c')](db['MailInteraction'],{});db[_0x070e('0x177')]['belongsTo'](db['MailMessage'],{});db[_0x070e('0x177')][_0x070e('0x11c')](db[_0x070e('0x105')],{});db['MailQueueReport'][_0x070e('0x11c')](db['MailQueue'],{});db[_0x070e('0x3d')][_0x070e('0x10b')](db['DashboardItem'],{'as':_0x070e('0x179'),'onDelete':'cascade'});db[_0x070e('0x135')][_0x070e('0x10b')](db[_0x070e('0x75')],{'as':'Dispositions','foreignKey':'FaxAccountId','onDelete':_0x070e('0x107')});db['FaxAccount'][_0x070e('0x10b')](db[_0x070e('0x73')],{'as':_0x070e('0x165'),'foreignKey':_0x070e('0x17a')});db[_0x070e('0x135')][_0x070e('0x10b')](db['FaxInteraction'],{'as':'Interactions'});db[_0x070e('0x135')]['hasMany'](db['FaxApplication'],{'as':_0x070e('0x144')});db[_0x070e('0x135')][_0x070e('0x10b')](db['VoiceExtension'],{'as':_0x070e('0x17b'),'onDelete':_0x070e('0x107')});db[_0x070e('0x135')]['hasMany'](db['FaxMessage'],{'as':_0x070e('0x159')});db[_0x070e('0x135')][_0x070e('0x11c')](db['Trunk'],{'as':_0x070e('0x27')});db['FaxAccount'][_0x070e('0x11c')](db['CmList'],{'as':_0x070e('0x167'),'foreignKey':_0x070e('0x178')});db['FaxAccount'][_0x070e('0x11c')](db[_0x070e('0x17c')],{'as':_0x070e('0x17d'),'foreignKey':_0x070e('0x152')});db[_0x070e('0x135')][_0x070e('0x120')](db[_0x070e('0x105')],{'as':_0x070e('0x154'),'through':_0x070e('0x137')});db[_0x070e('0x42')][_0x070e('0x11c')](db[_0x070e('0x105')],{'onDelete':_0x070e('0x175')});db['FaxApplication'][_0x070e('0x11c')](db[_0x070e('0x46')],{'onDelete':_0x070e('0x175')});db['FaxApplication']['belongsTo'](db[_0x070e('0x135')],{'onDelete':_0x070e('0x175')});db['FaxApplication'][_0x070e('0x11c')](db[_0x070e('0x82')],{'onDelete':_0x070e('0x175'),'foreignKey':'TagId'});db[_0x070e('0x115')]['hasMany'](db[_0x070e('0x45')],{'as':_0x070e('0x159'),'onDelete':'cascade','foreignKey':_0x070e('0x17e')});db[_0x070e('0x115')][_0x070e('0x11c')](db[_0x070e('0x135')],{'as':_0x070e('0x171'),'foreignKey':_0x070e('0x17a')});db[_0x070e('0x115')][_0x070e('0x11c')](db[_0x070e('0x69')],{'as':'Contact','foreignKey':_0x070e('0x160')});db[_0x070e('0x115')][_0x070e('0x11c')](db[_0x070e('0x105')],{'as':'Owner','foreignKey':'UserId'});db['FaxInteraction'][_0x070e('0x120')](db['Tag'],{'through':_0x070e('0x17f'),'as':_0x070e('0x16d')});db['FaxInteraction'][_0x070e('0x120')](db['Tag'],{'through':'fax_interaction_has_tags','as':_0x070e('0x180')});db[_0x070e('0x115')][_0x070e('0x120')](db[_0x070e('0x105')],{'as':_0x070e('0x16e'),'through':_0x070e('0x181'),'foreignKey':_0x070e('0x17e')});db[_0x070e('0x45')][_0x070e('0x11c')](db[_0x070e('0x105')],{'onDelete':_0x070e('0x107'),'as':_0x070e('0x105')});db['FaxMessage'][_0x070e('0x11c')](db[_0x070e('0x115')],{'as':_0x070e('0x170'),'foreignKey':_0x070e('0x17e')});db[_0x070e('0x45')][_0x070e('0x11c')](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db[_0x070e('0x45')][_0x070e('0x11c')](db[_0x070e('0xe2')],{'as':'Attachment','foreignKey':_0x070e('0x182')});db[_0x070e('0x45')]['belongsTo'](db['FaxAccount'],{'as':_0x070e('0x171'),'foreignKey':'FaxAccountId'});db[_0x070e('0x46')][_0x070e('0x120')](db[_0x070e('0x105')],{'as':_0x070e('0x154'),'through':_0x070e('0x133')});db[_0x070e('0x46')]['belongsToMany'](db[_0x070e('0x155')],{'through':_0x070e('0x183'),'as':_0x070e('0x156')});db['FaxQueueReport'][_0x070e('0x11c')](db['FaxAccount'],{});db['FaxQueueReport'][_0x070e('0x11c')](db['CmList'],{'as':_0x070e('0x167'),'foreignKey':'ListId'});db[_0x070e('0x48')][_0x070e('0x11c')](db['CmContact'],{'as':_0x070e('0x15f'),'foreignKey':_0x070e('0x160')});db[_0x070e('0x48')][_0x070e('0x11c')](db[_0x070e('0x115')],{});db[_0x070e('0x48')][_0x070e('0x11c')](db[_0x070e('0x45')],{});db[_0x070e('0x48')][_0x070e('0x11c')](db['User'],{});db[_0x070e('0x48')]['belongsTo'](db[_0x070e('0x46')],{});db[_0x070e('0x13c')]['hasMany'](db[_0x070e('0x75')],{'as':'Dispositions','foreignKey':_0x070e('0x184'),'onDelete':'cascade'});db[_0x070e('0x13c')][_0x070e('0x10b')](db['CannedAnswer'],{'as':_0x070e('0x165'),'foreignKey':_0x070e('0x184')});db[_0x070e('0x13c')][_0x070e('0x10b')](db[_0x070e('0x4e')],{'as':'Messages','foreignKey':_0x070e('0x184')});db['SmsAccount']['hasMany'](db[_0x070e('0x4c')],{'as':'Interactions'});db['SmsAccount'][_0x070e('0x10b')](db['SmsApplication'],{'as':_0x070e('0x144')});db[_0x070e('0x13c')][_0x070e('0x11c')](db['CmList'],{'as':_0x070e('0x167'),'foreignKey':_0x070e('0x178')});db[_0x070e('0x13c')][_0x070e('0x11c')](db[_0x070e('0x17c')],{'as':'mandatoryDispositionPause','foreignKey':_0x070e('0x152')});db[_0x070e('0x13c')][_0x070e('0x120')](db[_0x070e('0x105')],{'as':_0x070e('0x154'),'through':_0x070e('0x13d')});db[_0x070e('0x4b')]['belongsTo'](db[_0x070e('0x105')],{'onDelete':_0x070e('0x175')});db[_0x070e('0x4b')][_0x070e('0x11c')](db['SmsQueue'],{'onDelete':_0x070e('0x175')});db[_0x070e('0x4b')][_0x070e('0x11c')](db['SmsAccount'],{'onDelete':_0x070e('0x175')});db[_0x070e('0x4b')][_0x070e('0x11c')](db['Interval'],{'onDelete':_0x070e('0x175'),'foreignKey':_0x070e('0x151')});db[_0x070e('0x4b')][_0x070e('0x11c')](db[_0x070e('0x82')],{'onDelete':_0x070e('0x175'),'foreignKey':'TagId'});db[_0x070e('0x4c')][_0x070e('0x10b')](db['SmsMessage'],{'as':'Messages','onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x185')});db[_0x070e('0x4c')][_0x070e('0x11c')](db['SmsAccount'],{'as':_0x070e('0x171'),'foreignKey':_0x070e('0x184')});db[_0x070e('0x4c')]['belongsTo'](db[_0x070e('0x69')],{'as':_0x070e('0x15f'),'foreignKey':_0x070e('0x160')});db[_0x070e('0x4c')]['belongsTo'](db['User'],{'as':_0x070e('0x186'),'foreignKey':_0x070e('0x108')});db['SmsInteraction'][_0x070e('0x120')](db[_0x070e('0x82')],{'through':'sms_interaction_has_tags','as':'Tags'});db[_0x070e('0x4c')][_0x070e('0x120')](db[_0x070e('0x82')],{'through':_0x070e('0x187'),'as':'ThroughTags'});db['SmsInteraction'][_0x070e('0x120')](db[_0x070e('0x105')],{'as':'Users','through':_0x070e('0x127'),'foreignKey':'SmsInteractionId'});db[_0x070e('0x4e')][_0x070e('0x11c')](db[_0x070e('0x105')],{'as':'User'});db[_0x070e('0x4e')]['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':_0x070e('0x15f')});db[_0x070e('0x4e')][_0x070e('0x11c')](db[_0x070e('0x4c')],{'onDelete':_0x070e('0x107'),'as':_0x070e('0x170'),'foreignKey':_0x070e('0x185')});db[_0x070e('0x4e')][_0x070e('0x11c')](db[_0x070e('0x13c')],{'as':_0x070e('0x171'),'foreignKey':'SmsAccountId'});db[_0x070e('0x50')][_0x070e('0x120')](db['User'],{'as':'Agents','through':_0x070e('0x2e'),'foreignKey':_0x070e('0x188')});db[_0x070e('0x50')][_0x070e('0x120')](db['Team'],{'through':_0x070e('0x189'),'as':_0x070e('0x156')});db[_0x070e('0x52')][_0x070e('0x10b')](db[_0x070e('0x75')],{'as':_0x070e('0x18a'),'foreignKey':'OpenchannelAccountId','onDelete':_0x070e('0x107')});db['OpenchannelAccount'][_0x070e('0x10b')](db[_0x070e('0x73')],{'as':_0x070e('0x165'),'foreignKey':_0x070e('0x18b')});db[_0x070e('0x52')][_0x070e('0x10b')](db[_0x070e('0x55')],{'as':'Interactions','foreignKey':_0x070e('0x18b')});db[_0x070e('0x52')][_0x070e('0x10b')](db[_0x070e('0x57')],{'as':_0x070e('0x159'),'foreignKey':_0x070e('0x18b')});db[_0x070e('0x52')][_0x070e('0x10b')](db[_0x070e('0x53')],{'as':_0x070e('0x144'),'foreignKey':_0x070e('0x18b')});db[_0x070e('0x52')][_0x070e('0x11c')](db[_0x070e('0xeb')],{'as':'List','foreignKey':_0x070e('0x178')});db[_0x070e('0x52')]['belongsTo'](db[_0x070e('0x17c')],{'as':_0x070e('0x17d'),'foreignKey':_0x070e('0x152')});db[_0x070e('0x52')]['belongsToMany'](db[_0x070e('0x105')],{'as':_0x070e('0x154'),'through':'user_has_openchannel_accounts'});db[_0x070e('0x53')][_0x070e('0x11c')](db[_0x070e('0x105')],{'onDelete':_0x070e('0x175')});db[_0x070e('0x53')]['belongsTo'](db[_0x070e('0x58')],{'onDelete':_0x070e('0x175'),'foreignKey':_0x070e('0x18c')});db[_0x070e('0x53')]['belongsTo'](db[_0x070e('0x52')],{'onDelete':_0x070e('0x175'),'foreignKey':_0x070e('0x18b')});db['OpenchannelApplication'][_0x070e('0x11c')](db[_0x070e('0x79')],{'onDelete':'restrict','foreignKey':_0x070e('0x151')});db[_0x070e('0x53')][_0x070e('0x11c')](db[_0x070e('0x82')],{'onDelete':'restrict','foreignKey':_0x070e('0x176')});db['OpenchannelInteraction'][_0x070e('0x10b')](db[_0x070e('0x57')],{'as':_0x070e('0x159'),'onDelete':'cascade','foreignKey':'OpenchannelInteractionId'});db['OpenchannelInteraction'][_0x070e('0x11c')](db[_0x070e('0x52')],{'as':'Account','foreignKey':_0x070e('0x18b')});db[_0x070e('0x55')][_0x070e('0x11c')](db[_0x070e('0x69')],{'as':_0x070e('0x15f'),'foreignKey':_0x070e('0x160')});db[_0x070e('0x55')]['belongsTo'](db[_0x070e('0x105')],{'as':'Owner','foreignKey':_0x070e('0x108')});db[_0x070e('0x55')][_0x070e('0x120')](db[_0x070e('0x82')],{'through':'openchannel_interaction_has_tags','as':_0x070e('0x16d')});db[_0x070e('0x55')][_0x070e('0x120')](db['Tag'],{'through':_0x070e('0x18d'),'as':'ThroughTags'});db[_0x070e('0x55')][_0x070e('0x120')](db[_0x070e('0x105')],{'as':'Users','through':_0x070e('0x128'),'foreignKey':_0x070e('0x18e')});db[_0x070e('0x57')][_0x070e('0x11c')](db[_0x070e('0x105')],{'onDelete':_0x070e('0x107'),'as':_0x070e('0x105')});db[_0x070e('0x57')][_0x070e('0x11c')](db[_0x070e('0x69')],{'onDelete':_0x070e('0x107'),'as':'Contact'});db[_0x070e('0x57')][_0x070e('0x11c')](db['OpenchannelInteraction'],{'onDelete':_0x070e('0x107'),'as':_0x070e('0x170'),'foreignKey':_0x070e('0x18e')});db[_0x070e('0x57')][_0x070e('0x11c')](db[_0x070e('0xe2')],{'as':_0x070e('0xe2'),'foreignKey':_0x070e('0x182')});db[_0x070e('0x57')]['belongsTo'](db[_0x070e('0x52')],{'as':_0x070e('0x171'),'foreignKey':_0x070e('0x18b')});db['OpenchannelQueue'][_0x070e('0x120')](db[_0x070e('0x105')],{'as':_0x070e('0x154'),'through':_0x070e('0x2f'),'foreignKey':_0x070e('0x18c')});db[_0x070e('0x58')][_0x070e('0x120')](db['Team'],{'through':_0x070e('0x18f'),'as':_0x070e('0x156')});db[_0x070e('0x5a')][_0x070e('0x10b')](db[_0x070e('0x75')],{'as':'Dispositions','foreignKey':_0x070e('0x172'),'onDelete':_0x070e('0x107')});db['ChatWebsite']['hasMany'](db['CannedAnswer'],{'as':_0x070e('0x165'),'foreignKey':_0x070e('0x172')});db['ChatWebsite']['hasMany'](db[_0x070e('0x190')],{'as':'ProactiveActions'});db[_0x070e('0x5a')][_0x070e('0x10b')](db[_0x070e('0x5f')],{'as':_0x070e('0x166')});db[_0x070e('0x5a')][_0x070e('0x10b')](db[_0x070e('0x191')],{'as':'Applications'});db[_0x070e('0x5a')][_0x070e('0x10b')](db[_0x070e('0x61')],{'as':_0x070e('0x159')});db['ChatWebsite']['belongsTo'](db[_0x070e('0xeb')],{'as':_0x070e('0x167'),'foreignKey':_0x070e('0x178')});db['ChatWebsite'][_0x070e('0x11c')](db[_0x070e('0x79')],{'as':_0x070e('0x79'),'foreignKey':_0x070e('0x151')});db['ChatWebsite']['belongsTo'](db[_0x070e('0x34')],{'as':_0x070e('0x34'),'foreignKey':_0x070e('0x162')});db[_0x070e('0x5a')][_0x070e('0x11c')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x070e('0x5a')][_0x070e('0x120')](db[_0x070e('0x105')],{'as':_0x070e('0x154'),'through':'user_has_chat_websites'});db[_0x070e('0x5c')]['belongsTo'](db['OpenchannelAccount'],{});db[_0x070e('0x5c')][_0x070e('0x11c')](db['CmList'],{'as':_0x070e('0x167'),'foreignKey':_0x070e('0x178')});db[_0x070e('0x5c')][_0x070e('0x11c')](db[_0x070e('0x69')],{'as':_0x070e('0x15f'),'foreignKey':'ContactId'});db[_0x070e('0x5c')][_0x070e('0x11c')](db[_0x070e('0x55')],{});db['OpenchannelQueueReport'][_0x070e('0x11c')](db[_0x070e('0x57')],{});db[_0x070e('0x5c')]['belongsTo'](db[_0x070e('0x105')],{});db[_0x070e('0x5c')][_0x070e('0x11c')](db[_0x070e('0x58')],{});db[_0x070e('0x191')][_0x070e('0x11c')](db[_0x070e('0x105')],{'as':_0x070e('0x192'),'foreignKey':_0x070e('0x108'),'onDelete':_0x070e('0x175')});db[_0x070e('0x191')]['belongsTo'](db[_0x070e('0x12f')],{'as':_0x070e('0x193'),'foreignKey':_0x070e('0x194'),'onDelete':_0x070e('0x175')});db['ChatApplication'][_0x070e('0x11c')](db[_0x070e('0x5a')],{'as':'Website','foreignKey':_0x070e('0x172'),'onDelete':_0x070e('0x175')});db['ChatApplication'][_0x070e('0x11c')](db['Tag'],{'onDelete':_0x070e('0x175'),'foreignKey':'TagId'});db['ChatInteraction'][_0x070e('0x10b')](db['ChatMessage'],{'as':_0x070e('0x159'),'onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x195')});db[_0x070e('0x5f')][_0x070e('0x11c')](db[_0x070e('0x5a')],{'as':'Account','foreignKey':'ChatWebsiteId'});db['ChatInteraction']['belongsTo'](db[_0x070e('0x69')],{'as':'Contact','foreignKey':_0x070e('0x160')});db[_0x070e('0x5f')][_0x070e('0x11c')](db[_0x070e('0x105')],{'as':_0x070e('0x186'),'foreignKey':_0x070e('0x108')});db['ChatInteraction'][_0x070e('0x120')](db[_0x070e('0x82')],{'through':_0x070e('0x196'),'as':_0x070e('0x16d')});db[_0x070e('0x5f')][_0x070e('0x120')](db['Tag'],{'through':_0x070e('0x196'),'as':_0x070e('0x180')});db[_0x070e('0x5f')]['belongsToMany'](db[_0x070e('0x105')],{'as':_0x070e('0x16e'),'through':_0x070e('0x126'),'foreignKey':_0x070e('0x195')});db[_0x070e('0x61')][_0x070e('0x11c')](db[_0x070e('0x105')],{'onDelete':_0x070e('0x107'),'as':_0x070e('0x105')});db[_0x070e('0x61')][_0x070e('0x11c')](db[_0x070e('0x69')],{'onDelete':_0x070e('0x107'),'as':_0x070e('0x15f'),'foreignKey':_0x070e('0x160')});db[_0x070e('0x61')][_0x070e('0x11c')](db[_0x070e('0x5f')],{'onDelete':_0x070e('0x107'),'as':_0x070e('0x170'),'foreignKey':'ChatInteractionId'});db[_0x070e('0x61')]['belongsTo'](db['Attachment'],{'as':_0x070e('0xe2'),'foreignKey':'AttachmentId'});db[_0x070e('0x61')][_0x070e('0x11c')](db[_0x070e('0x5a')],{'as':_0x070e('0x171'),'foreignKey':_0x070e('0x172')});db[_0x070e('0x173')][_0x070e('0x10b')](db[_0x070e('0xe2')],{'as':_0x070e('0x16f'),'foreignKey':_0x070e('0x174'),'onDelete':'cascade','hooks':!![]});db[_0x070e('0x173')][_0x070e('0x11c')](db[_0x070e('0x69')],{'onDelete':_0x070e('0x107'),'as':_0x070e('0x15f'),'foreignKey':'ContactId'});db[_0x070e('0x173')][_0x070e('0x11c')](db[_0x070e('0x5a')],{'as':_0x070e('0x171'),'foreignKey':'ChatWebsiteId'});db[_0x070e('0x12f')][_0x070e('0x120')](db['User'],{'as':_0x070e('0x154'),'through':_0x070e('0x131'),'hooks':!![]});db[_0x070e('0x12f')][_0x070e('0x120')](db['Team'],{'through':_0x070e('0x197'),'as':_0x070e('0x156')});db[_0x070e('0x65')]['hasMany'](db[_0x070e('0x198')],{'as':'Messages','foreignKey':_0x070e('0x199'),'onDelete':_0x070e('0x107')});db['ChatGroup'][_0x070e('0x120')](db[_0x070e('0x105')],{'as':_0x070e('0x147'),'through':_0x070e('0x11f')});db[_0x070e('0x190')][_0x070e('0x11c')](db[_0x070e('0x5a')],{'as':'Website','foreignKey':'ChatWebsiteId'});db[_0x070e('0x68')][_0x070e('0x10b')](db[_0x070e('0x69')],{'as':'Contacts','foreignKey':'CompanyId'});db[_0x070e('0x69')]['hasMany'](db['CmHopper'],{'as':_0x070e('0x149'),'foreignKey':_0x070e('0x160')});db[_0x070e('0x69')][_0x070e('0x10b')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x070e('0x160')});db[_0x070e('0x69')][_0x070e('0x10b')](db[_0x070e('0x6e')],{'as':_0x070e('0x14a'),'foreignKey':'ContactId'});db[_0x070e('0x69')][_0x070e('0x10b')](db[_0x070e('0x111')],{'as':'ReportAgentPreview','foreignKey':_0x070e('0x160')});db['CmContact'][_0x070e('0x10b')](db[_0x070e('0x19a')],{'as':_0x070e('0x14d'),'foreignKey':_0x070e('0x160')});db[_0x070e('0x69')]['hasMany'](db['OpenchannelInteraction'],{'as':_0x070e('0x112'),'foreignKey':_0x070e('0x160'),'onDelete':_0x070e('0x175')});db['CmContact']['hasMany'](db[_0x070e('0x5f')],{'as':_0x070e('0x113'),'foreignKey':_0x070e('0x160'),'onDelete':_0x070e('0x175')});db[_0x070e('0x69')][_0x070e('0x10b')](db[_0x070e('0x4c')],{'as':_0x070e('0x114'),'foreignKey':_0x070e('0x160'),'onDelete':_0x070e('0x175')});db[_0x070e('0x69')][_0x070e('0x10b')](db[_0x070e('0x115')],{'as':_0x070e('0x116'),'foreignKey':_0x070e('0x160'),'onDelete':'restrict'});db[_0x070e('0x69')][_0x070e('0x10b')](db[_0x070e('0x37')],{'as':'MailInteractions','foreignKey':'ContactId','onDelete':'restrict'});db['CmContact'][_0x070e('0x11c')](db[_0x070e('0x68')],{'as':_0x070e('0x19b'),'foreignKey':_0x070e('0x19c')});db[_0x070e('0x69')][_0x070e('0x11c')](db[_0x070e('0xeb')],{'as':_0x070e('0x167'),'foreignKey':_0x070e('0x178'),'onDelete':'cascade'});db['CmContact']['belongsToMany'](db['User'],{'as':_0x070e('0x16e'),'through':'cm_user_has_contacts'});db[_0x070e('0x69')][_0x070e('0x120')](db[_0x070e('0x82')],{'as':_0x070e('0x16d'),'through':_0x070e('0x19d')});db[_0x070e('0x69')][_0x070e('0x120')](db[_0x070e('0x82')],{'through':'cm_contact_has_tags','as':_0x070e('0x180')});db[_0x070e('0x6b')][_0x070e('0x11c')](db[_0x070e('0x69')],{'as':_0x070e('0x15f'),'foreignKey':_0x070e('0x160'),'onDelete':_0x070e('0x107')});db[_0x070e('0x6b')][_0x070e('0x11c')](db[_0x070e('0xeb')],{'as':_0x070e('0x167'),'foreignKey':'ListId','onDelete':_0x070e('0x107')});db[_0x070e('0x6b')]['belongsTo'](db[_0x070e('0x105')],{'as':'Agent','foreignKey':'UserId'});db[_0x070e('0x6b')]['belongsTo'](db[_0x070e('0x129')],{'as':_0x070e('0x193'),'foreignKey':_0x070e('0x148'),'onDelete':'cascade'});db[_0x070e('0x6b')]['belongsTo'](db[_0x070e('0xdf')],{'as':'Campaign','foreignKey':_0x070e('0x19e'),'onDelete':_0x070e('0x107')});db[_0x070e('0x6b')]['belongsTo'](db['User'],{'as':_0x070e('0x186'),'foreignKey':_0x070e('0x19f')});db[_0x070e('0x14b')][_0x070e('0x11c')](db['CmContact'],{'as':_0x070e('0x15f'),'foreignKey':_0x070e('0x160'),'onDelete':_0x070e('0x107')});db[_0x070e('0x14b')][_0x070e('0x11c')](db[_0x070e('0xeb')],{'as':'List','foreignKey':_0x070e('0x178'),'onDelete':_0x070e('0x107')});db['CmHopperBlack'][_0x070e('0x11c')](db[_0x070e('0x129')],{'as':_0x070e('0x193'),'foreignKey':_0x070e('0x148'),'onDelete':'cascade'});db['CmHopperBlack'][_0x070e('0x11c')](db[_0x070e('0xdf')],{'as':_0x070e('0xdf'),'foreignKey':_0x070e('0x19e'),'onDelete':_0x070e('0x107')});db['Automation'][_0x070e('0x10b')](db[_0x070e('0x77')],{'as':{'plural':_0x070e('0x1a0'),'singular':_0x070e('0x1a1')},'foreignKey':_0x070e('0x1a2'),'onDelete':'cascade','hooks':!![]});db[_0x070e('0x1a3')][_0x070e('0x10b')](db[_0x070e('0x77')],{'as':{'plural':_0x070e('0x1a4'),'singular':'OneAny'},'foreignKey':_0x070e('0x1a5'),'onDelete':_0x070e('0x107'),'hooks':!![]});db['Automation'][_0x070e('0x10b')](db[_0x070e('0x1a6')],{'as':_0x070e('0x1a7'),'foreignKey':_0x070e('0x1a8'),'onDelete':_0x070e('0x107'),'hooks':!![]});db[_0x070e('0x75')][_0x070e('0x10b')](db[_0x070e('0x75')],{'as':_0x070e('0x18a'),'foreignKey':'ParentId','onDelete':_0x070e('0x107')});db[_0x070e('0x79')][_0x070e('0x10b')](db[_0x070e('0x79')],{'as':_0x070e('0x1a9'),'foreignKey':_0x070e('0x151'),'onDelete':_0x070e('0x107'),'hooks':!![],'required':![]});db['Interval'][_0x070e('0x10b')](db[_0x070e('0x10c')],{'as':_0x070e('0x10d'),'foreignKey':'IntervalId','onDelete':_0x070e('0x175')});db[_0x070e('0x79')][_0x070e('0x10b')](db[_0x070e('0x3a')],{'as':_0x070e('0x1aa'),'foreignKey':_0x070e('0x151')});db[_0x070e('0x79')][_0x070e('0x10b')](db[_0x070e('0x191')],{'as':_0x070e('0x1ab'),'foreignKey':'IntervalId'});db['Interval'][_0x070e('0x10b')](db[_0x070e('0x42')],{'as':_0x070e('0x1ac'),'foreignKey':'IntervalId'});db[_0x070e('0x79')][_0x070e('0x10b')](db[_0x070e('0x4b')],{'as':'SmsApplications','foreignKey':_0x070e('0x151')});db[_0x070e('0x1ad')][_0x070e('0x11c')](db[_0x070e('0x34')],{});db['Schedule'][_0x070e('0x11c')](db[_0x070e('0x1ae')],{'foreignKey':_0x070e('0x1af')});db[_0x070e('0x1ad')][_0x070e('0x11c')](db[_0x070e('0x8a')],{'foreignKey':'CustomReportId'});db['Sound'][_0x070e('0x120')](db['VoiceMusicOnHold'],{'as':_0x070e('0x1b0'),'through':_0x070e('0x146'),'onDelete':'restrict'});db[_0x070e('0x82')][_0x070e('0x120')](db[_0x070e('0x69')],{'through':'cm_contact_has_tags'});db[_0x070e('0x82')]['belongsToMany'](db['ChatInteraction'],{'through':_0x070e('0x196')});db[_0x070e('0x82')]['belongsToMany'](db[_0x070e('0x37')],{'through':_0x070e('0x16c')});db['Tag'][_0x070e('0x120')](db[_0x070e('0x4c')],{'through':'sms_interaction_has_tags'});db[_0x070e('0x82')][_0x070e('0x120')](db[_0x070e('0x115')],{'through':'fax_interaction_has_tags'});db['Tag'][_0x070e('0x120')](db[_0x070e('0x55')],{'through':_0x070e('0x18d')});db[_0x070e('0x82')][_0x070e('0x120')](db[_0x070e('0x118')],{'through':_0x070e('0x1b1')});db[_0x070e('0x86')][_0x070e('0x10b')](db['Condition'],{'as':{'plural':_0x070e('0x1b2'),'singular':'AllCondition'},'foreignKey':_0x070e('0x1b3'),'onDelete':_0x070e('0x107'),'hooks':!![]});db[_0x070e('0x86')][_0x070e('0x10b')](db[_0x070e('0x77')],{'as':{'plural':_0x070e('0x1b4'),'singular':_0x070e('0x1b5')},'foreignKey':'TriggerAnyId','onDelete':_0x070e('0x107'),'hooks':!![]});db[_0x070e('0x86')]['hasMany'](db[_0x070e('0x1a6')],{'as':_0x070e('0x1a7'),'foreignKey':_0x070e('0x1b6'),'onDelete':_0x070e('0x107'),'hooks':!![]});db[_0x070e('0x8a')][_0x070e('0x10b')](db[_0x070e('0x91')],{'as':_0x070e('0x1b7'),'onDelete':_0x070e('0x107'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x070e('0x10b')](db[_0x070e('0x91')],{'as':_0x070e('0x1b7'),'onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x1af')});db[_0x070e('0x8f')][_0x070e('0x10b')](db[_0x070e('0x91')],{'as':_0x070e('0x1b7'),'onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x1b8')});db[_0x070e('0x91')][_0x070e('0x11c')](db['AnalyticMetric'],{'foreignKey':'MetricId'});db[_0x070e('0x93')][_0x070e('0x10b')](db[_0x070e('0x95')],{'as':'Configurations','onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x1b9')});db[_0x070e('0x95')][_0x070e('0x10b')](db['SalesforceField'],{'as':_0x070e('0x1ba'),'onDelete':'cascade','foreignKey':_0x070e('0x1bb')});db[_0x070e('0x95')][_0x070e('0x10b')](db['SalesforceField'],{'as':_0x070e('0x1bc'),'onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x1bd')});db[_0x070e('0x95')]['hasMany'](db['SalesforceField'],{'as':_0x070e('0x1b7'),'onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x1be')});db[_0x070e('0x95')]['belongsTo'](db[_0x070e('0x93')],{'as':_0x070e('0x171'),'foreignKey':_0x070e('0x1b9')});db[_0x070e('0x97')][_0x070e('0x10b')](db['SalesforceField'],{'as':'Subject','foreignKey':_0x070e('0x1bb')});db[_0x070e('0x97')][_0x070e('0x10b')](db[_0x070e('0x97')],{'as':_0x070e('0x1bf'),'foreignKey':_0x070e('0x1bd')});db[_0x070e('0x97')][_0x070e('0x10b')](db[_0x070e('0x97')],{'as':'Field','foreignKey':_0x070e('0x1be')});db['SalesforceField'][_0x070e('0x11c')](db[_0x070e('0x1c0')],{'as':_0x070e('0x1c0'),'foreignKey':'VariableId'});db['SugarcrmAccount'][_0x070e('0x10b')](db[_0x070e('0x9a')],{'as':'Configurations','onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x1b9')});db[_0x070e('0x9a')][_0x070e('0x10b')](db[_0x070e('0x1c1')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x070e('0x9a')][_0x070e('0x10b')](db['SugarcrmField'],{'as':_0x070e('0x1bc'),'onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x1bd')});db[_0x070e('0x9a')][_0x070e('0x10b')](db['SugarcrmField'],{'as':_0x070e('0x1b7'),'onDelete':'cascade','foreignKey':_0x070e('0x1be')});db['SugarcrmConfiguration'][_0x070e('0x11c')](db[_0x070e('0x99')],{'as':'Account','foreignKey':'AccountId'});db[_0x070e('0x1c1')]['hasMany'](db['SugarcrmField'],{'as':_0x070e('0x1c2'),'foreignKey':_0x070e('0x1bb')});db[_0x070e('0x1c1')][_0x070e('0x10b')](db[_0x070e('0x1c1')],{'as':_0x070e('0x1bf'),'foreignKey':_0x070e('0x1bd')});db[_0x070e('0x1c1')][_0x070e('0x10b')](db['SugarcrmField'],{'as':'Field','foreignKey':_0x070e('0x1be')});db[_0x070e('0x1c1')][_0x070e('0x11c')](db[_0x070e('0x1c0')],{'as':_0x070e('0x1c0'),'foreignKey':_0x070e('0x1c3')});db[_0x070e('0x9d')][_0x070e('0x10b')](db[_0x070e('0x9e')],{'as':_0x070e('0x1c4'),'onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x1b9')});db['DeskConfiguration'][_0x070e('0x10b')](db[_0x070e('0xa0')],{'as':'Subjects','onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x1bb')});db[_0x070e('0x9e')][_0x070e('0x10b')](db[_0x070e('0xa0')],{'as':_0x070e('0x1bc'),'onDelete':'cascade','foreignKey':_0x070e('0x1bd')});db[_0x070e('0x9e')][_0x070e('0x10b')](db[_0x070e('0xa0')],{'as':'Fields','onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x1be')});db[_0x070e('0x9e')][_0x070e('0x11c')](db[_0x070e('0x9d')],{'as':_0x070e('0x171'),'foreignKey':_0x070e('0x1b9')});db[_0x070e('0x9e')][_0x070e('0x120')](db[_0x070e('0x82')],{'through':_0x070e('0x1c5')});db[_0x070e('0xa0')][_0x070e('0x10b')](db[_0x070e('0xa0')],{'as':_0x070e('0x1c2'),'foreignKey':_0x070e('0x1bb')});db[_0x070e('0xa0')][_0x070e('0x10b')](db[_0x070e('0xa0')],{'as':_0x070e('0x1bf'),'foreignKey':_0x070e('0x1bd')});db[_0x070e('0xa0')][_0x070e('0x10b')](db[_0x070e('0xa0')],{'as':_0x070e('0x1c6'),'foreignKey':_0x070e('0x1be')});db[_0x070e('0xa0')][_0x070e('0x11c')](db[_0x070e('0x1c0')],{'as':_0x070e('0x1c0'),'foreignKey':_0x070e('0x1c3')});db['ZohoAccount']['hasMany'](db['ZohoConfiguration'],{'as':_0x070e('0x1c4'),'onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x1b9')});db[_0x070e('0xa3')][_0x070e('0x10b')](db['ZohoField'],{'as':_0x070e('0x1ba'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x070e('0xa3')][_0x070e('0x10b')](db[_0x070e('0xa5')],{'as':_0x070e('0x1bc'),'onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x1bd')});db[_0x070e('0xa3')]['hasMany'](db[_0x070e('0xa5')],{'as':_0x070e('0x1b7'),'onDelete':'cascade','foreignKey':_0x070e('0x1be')});db[_0x070e('0xa3')][_0x070e('0x11c')](db[_0x070e('0xa1')],{'as':_0x070e('0x171'),'foreignKey':_0x070e('0x1b9')});db[_0x070e('0xa5')][_0x070e('0x10b')](db['ZohoField'],{'as':_0x070e('0x1c2'),'foreignKey':_0x070e('0x1bb')});db[_0x070e('0xa5')][_0x070e('0x10b')](db[_0x070e('0xa5')],{'as':_0x070e('0x1bf'),'foreignKey':_0x070e('0x1bd')});db[_0x070e('0xa5')][_0x070e('0x10b')](db[_0x070e('0xa5')],{'as':_0x070e('0x1c6'),'foreignKey':_0x070e('0x1be')});db['ZohoField'][_0x070e('0x11c')](db['Variable'],{'as':_0x070e('0x1c0'),'foreignKey':_0x070e('0x1c3')});db[_0x070e('0xa7')][_0x070e('0x10b')](db[_0x070e('0xa9')],{'as':_0x070e('0x1c4'),'onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x1b9')});db[_0x070e('0xa9')][_0x070e('0x10b')](db[_0x070e('0xab')],{'as':_0x070e('0x1ba'),'foreignKey':_0x070e('0x1bb')});db['ZendeskConfiguration'][_0x070e('0x10b')](db['ZendeskField'],{'as':_0x070e('0x1bc'),'foreignKey':_0x070e('0x1bd')});db[_0x070e('0xa9')]['hasMany'](db[_0x070e('0xab')],{'as':_0x070e('0x1b7'),'foreignKey':_0x070e('0x1be')});db[_0x070e('0xa9')][_0x070e('0x11c')](db[_0x070e('0xa7')],{'as':'Account','foreignKey':_0x070e('0x1b9')});db[_0x070e('0xa9')][_0x070e('0x120')](db[_0x070e('0x82')],{'through':'int_zendesk_configuration_has_tags'});db['ZendeskField'][_0x070e('0x10b')](db[_0x070e('0xab')],{'as':_0x070e('0x1c2'),'foreignKey':_0x070e('0x1bb')});db[_0x070e('0xab')][_0x070e('0x10b')](db[_0x070e('0xab')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x070e('0xab')][_0x070e('0x10b')](db[_0x070e('0xab')],{'as':'Field','foreignKey':_0x070e('0x1be')});db[_0x070e('0xab')][_0x070e('0x11c')](db[_0x070e('0x1c0')],{'as':_0x070e('0x1c0'),'foreignKey':_0x070e('0x1c3')});db[_0x070e('0xac')]['hasMany'](db[_0x070e('0xae')],{'as':'Configurations','onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x1b9')});db[_0x070e('0xae')][_0x070e('0x10b')](db['FreshdeskField'],{'as':_0x070e('0x1ba'),'onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x1bb')});db['FreshdeskConfiguration'][_0x070e('0x10b')](db[_0x070e('0x1c7')],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x070e('0xae')][_0x070e('0x10b')](db[_0x070e('0x1c7')],{'as':'Fields','onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x1be')});db[_0x070e('0xae')][_0x070e('0x11c')](db[_0x070e('0xac')],{'as':_0x070e('0x171'),'foreignKey':_0x070e('0x1b9')});db[_0x070e('0xae')]['belongsToMany'](db[_0x070e('0x82')],{'through':_0x070e('0x1c8')});db[_0x070e('0x1c7')][_0x070e('0x10b')](db[_0x070e('0x1c7')],{'as':_0x070e('0x1c2'),'foreignKey':_0x070e('0x1bb')});db['FreshdeskField'][_0x070e('0x10b')](db[_0x070e('0x1c7')],{'as':_0x070e('0x1bf'),'foreignKey':_0x070e('0x1bd')});db[_0x070e('0x1c7')]['hasMany'](db[_0x070e('0x1c7')],{'as':'Field','foreignKey':_0x070e('0x1be')});db['FreshdeskField'][_0x070e('0x11c')](db[_0x070e('0x1c0')],{'as':_0x070e('0x1c0'),'foreignKey':_0x070e('0x1c3')});db[_0x070e('0xb0')]['hasMany'](db['VtigerConfiguration'],{'as':_0x070e('0x1c4'),'onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x1b9')});db[_0x070e('0xb2')][_0x070e('0x10b')](db[_0x070e('0xb3')],{'as':'Subjects','foreignKey':_0x070e('0x1bb')});db[_0x070e('0xb2')][_0x070e('0x10b')](db[_0x070e('0xb3')],{'as':'Descriptions','foreignKey':_0x070e('0x1bd')});db[_0x070e('0xb2')]['hasMany'](db['VtigerField'],{'as':_0x070e('0x1b7'),'foreignKey':'FieldId'});db['VtigerConfiguration']['belongsTo'](db['VtigerAccount'],{'as':_0x070e('0x171'),'foreignKey':_0x070e('0x1b9')});db[_0x070e('0xb3')][_0x070e('0x10b')](db[_0x070e('0xb3')],{'as':_0x070e('0x1c2'),'foreignKey':_0x070e('0x1bb')});db[_0x070e('0xb3')][_0x070e('0x10b')](db[_0x070e('0xb3')],{'as':_0x070e('0x1bf'),'foreignKey':_0x070e('0x1bd')});db[_0x070e('0xb3')][_0x070e('0x10b')](db[_0x070e('0xb3')],{'as':_0x070e('0x1c6'),'foreignKey':_0x070e('0x1be')});db[_0x070e('0xb3')][_0x070e('0x11c')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db['ServicenowAccount'][_0x070e('0x10b')](db[_0x070e('0x1c9')],{'as':_0x070e('0x1c4'),'onDelete':_0x070e('0x107'),'foreignKey':'AccountId'});db['ServicenowConfiguration'][_0x070e('0x10b')](db[_0x070e('0xb7')],{'as':_0x070e('0x1ba'),'foreignKey':_0x070e('0x1bb')});db[_0x070e('0x1c9')]['hasMany'](db['ServicenowField'],{'as':_0x070e('0x1bc'),'foreignKey':'DescriptionId'});db['ServicenowConfiguration']['hasMany'](db[_0x070e('0xb7')],{'as':'Fields','foreignKey':_0x070e('0x1be')});db[_0x070e('0x1c9')][_0x070e('0x11c')](db[_0x070e('0xb4')],{'as':_0x070e('0x171'),'foreignKey':_0x070e('0x1b9')});db[_0x070e('0xb7')]['hasMany'](db[_0x070e('0xb7')],{'as':_0x070e('0x1c2'),'foreignKey':_0x070e('0x1bb')});db[_0x070e('0xb7')][_0x070e('0x10b')](db['ServicenowField'],{'as':_0x070e('0x1bf'),'foreignKey':_0x070e('0x1bd')});db[_0x070e('0xb7')][_0x070e('0x10b')](db[_0x070e('0xb7')],{'as':_0x070e('0x1c6'),'foreignKey':'FieldId'});db[_0x070e('0xb7')]['belongsTo'](db[_0x070e('0x1c0')],{'as':'Variable','foreignKey':_0x070e('0x1c3')});db[_0x070e('0xb9')]['hasMany'](db['Dynamics365Configuration'],{'as':_0x070e('0x1c4'),'onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x1b9')});db[_0x070e('0xbb')][_0x070e('0x10b')](db['Dynamics365Field'],{'as':'Subjects','onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x1bb')});db[_0x070e('0xbb')]['hasMany'](db[_0x070e('0xbd')],{'as':_0x070e('0x1bc'),'onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x1bd')});db[_0x070e('0xbb')][_0x070e('0x10b')](db[_0x070e('0xbd')],{'as':_0x070e('0x1b7'),'onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x1be')});db[_0x070e('0xbb')][_0x070e('0x11c')](db['Dynamics365Account'],{'as':_0x070e('0x171'),'foreignKey':_0x070e('0x1b9')});db['Dynamics365Field']['hasMany'](db[_0x070e('0xbd')],{'as':'Subject','foreignKey':_0x070e('0x1bb')});db['Dynamics365Field'][_0x070e('0x10b')](db['Dynamics365Field'],{'as':_0x070e('0x1bf'),'foreignKey':_0x070e('0x1bd')});db[_0x070e('0xbd')][_0x070e('0x10b')](db['Dynamics365Field'],{'as':_0x070e('0x1c6'),'foreignKey':_0x070e('0x1be')});db['Dynamics365Field'][_0x070e('0x11c')](db['Variable'],{'as':_0x070e('0x1c0'),'foreignKey':_0x070e('0x1c3')});db[_0x070e('0xbf')]['hasMany'](db[_0x070e('0xc1')],{'as':_0x070e('0x1c4'),'onDelete':'cascade','foreignKey':_0x070e('0x1b9')});db[_0x070e('0xc1')][_0x070e('0x10b')](db[_0x070e('0xc3')],{'as':_0x070e('0x1ba'),'foreignKey':_0x070e('0x1bb')});db[_0x070e('0xc1')]['hasMany'](db[_0x070e('0xc3')],{'as':_0x070e('0x1bc'),'foreignKey':'DescriptionId'});db[_0x070e('0xc1')][_0x070e('0x10b')](db[_0x070e('0xc3')],{'as':_0x070e('0x1b7'),'foreignKey':_0x070e('0x1be')});db[_0x070e('0xc1')][_0x070e('0x11c')](db[_0x070e('0xbf')],{'as':_0x070e('0x171'),'foreignKey':_0x070e('0x1b9')});db['FreshsalesField'][_0x070e('0x10b')](db[_0x070e('0xc3')],{'as':_0x070e('0x1c2'),'foreignKey':'SubjectId'});db[_0x070e('0xc3')][_0x070e('0x10b')](db[_0x070e('0xc3')],{'as':_0x070e('0x1bf'),'foreignKey':_0x070e('0x1bd')});db['FreshsalesField']['hasMany'](db[_0x070e('0xc3')],{'as':'Field','foreignKey':_0x070e('0x1be')});db['FreshsalesField']['belongsTo'](db[_0x070e('0x1c0')],{'as':'Variable','foreignKey':_0x070e('0x1c3')});db[_0x070e('0xc7')][_0x070e('0x11c')](db[_0x070e('0x5a')],{});db[_0x070e('0xc7')][_0x070e('0x11c')](db[_0x070e('0xeb')],{'as':_0x070e('0x167'),'foreignKey':_0x070e('0x178')});db[_0x070e('0xc7')][_0x070e('0x11c')](db[_0x070e('0x69')],{'as':_0x070e('0x15f'),'foreignKey':'ContactId'});db['ChatQueueReport']['belongsTo'](db[_0x070e('0x5f')],{});db[_0x070e('0xc7')][_0x070e('0x11c')](db[_0x070e('0x61')],{});db['ChatQueueReport'][_0x070e('0x11c')](db[_0x070e('0x105')],{});db[_0x070e('0xc7')][_0x070e('0x11c')](db[_0x070e('0x12f')],{});db['ChatInternalMessage'][_0x070e('0x11c')](db[_0x070e('0x105')],{'onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x1ca')});db['ChatInternalMessage'][_0x070e('0x11c')](db[_0x070e('0x105')],{'onDelete':_0x070e('0x107'),'foreignKey':'ToId'});db[_0x070e('0x19a')][_0x070e('0x10b')](db[_0x070e('0xca')],{'foreignKey':_0x070e('0x1cb'),'onDelete':_0x070e('0x107')});db[_0x070e('0x19a')][_0x070e('0x10b')](db[_0x070e('0x1cc')],{'foreignKey':_0x070e('0x1cb'),'onDelete':_0x070e('0x107')});db[_0x070e('0xcc')]['belongsTo'](db[_0x070e('0x13c')],{});db[_0x070e('0xcc')][_0x070e('0x11c')](db['CmList'],{'as':_0x070e('0x167'),'foreignKey':'ListId'});db[_0x070e('0xcc')][_0x070e('0x11c')](db['CmContact'],{'as':_0x070e('0x15f'),'foreignKey':_0x070e('0x160')});db[_0x070e('0xcc')][_0x070e('0x11c')](db['SmsInteraction'],{});db['SmsQueueReport'][_0x070e('0x11c')](db[_0x070e('0x4e')],{});db[_0x070e('0xcc')][_0x070e('0x11c')](db[_0x070e('0x105')],{});db[_0x070e('0xcc')][_0x070e('0x11c')](db[_0x070e('0x50')],{});db[_0x070e('0x1cd')]['hasMany'](db[_0x070e('0x19a')],{'foreignKey':_0x070e('0x1ce')});db[_0x070e('0x1cd')][_0x070e('0x10b')](db['JscriptyQuestionReport'],{'foreignKey':_0x070e('0x1ce')});db[_0x070e('0x1cd')][_0x070e('0x10b')](db[_0x070e('0x1cc')],{'foreignKey':_0x070e('0x1ce')});db[_0x070e('0xd7')][_0x070e('0x120')](db[_0x070e('0x105')],{'as':_0x070e('0x16e'),'through':_0x070e('0x141')});db[_0x070e('0x155')]['belongsToMany'](db[_0x070e('0x105')],{'as':'Agents','through':'user_has_teams'});db['Team']['belongsToMany'](db[_0x070e('0x129')],{'through':_0x070e('0x100'),'as':_0x070e('0x12a')});db[_0x070e('0x155')]['belongsToMany'](db[_0x070e('0x35')],{'through':_0x070e('0x169'),'as':_0x070e('0x12d')});db['Team'][_0x070e('0x120')](db['ChatQueue'],{'through':_0x070e('0x197'),'as':_0x070e('0x130')});db[_0x070e('0x155')]['belongsToMany'](db[_0x070e('0x46')],{'through':'team_has_fax_queues','as':_0x070e('0x132')});db[_0x070e('0x155')][_0x070e('0x120')](db['SmsQueue'],{'through':_0x070e('0x189'),'as':'SmsQueues'});db[_0x070e('0x155')][_0x070e('0x120')](db['OpenchannelQueue'],{'through':_0x070e('0x18f'),'as':'OpenchannelQueues'});db[_0x070e('0x155')][_0x070e('0x120')](db[_0x070e('0xfc')],{'through':_0x070e('0x1cf'),'as':_0x070e('0x1d0')});db['Team'][_0x070e('0x120')](db[_0x070e('0xed')],{'through':_0x070e('0x102'),'as':_0x070e('0x12c')});db[_0x070e('0xdf')][_0x070e('0x10b')](db[_0x070e('0x6b')],{'as':_0x070e('0x149'),'foreignKey':_0x070e('0x19e')});db['Campaign']['hasMany'](db[_0x070e('0x10e')],{'as':_0x070e('0x10f'),'foreignKey':_0x070e('0x19e')});db['Campaign'][_0x070e('0x10b')](db[_0x070e('0x6e')],{'as':'HopperHistories','foreignKey':_0x070e('0x19e')});db[_0x070e('0xdf')][_0x070e('0x10b')](db[_0x070e('0x14b')],{'as':'HopperBlacks','foreignKey':_0x070e('0x19e')});db[_0x070e('0xdf')][_0x070e('0x11c')](db['Trunk'],{'as':_0x070e('0x27'),'foreignKey':'TrunkId'});db[_0x070e('0xdf')]['belongsTo'](db[_0x070e('0x27')],{'as':_0x070e('0x14f'),'foreignKey':_0x070e('0x150')});db[_0x070e('0xdf')][_0x070e('0x11c')](db[_0x070e('0x79')],{'as':_0x070e('0x79'),'foreignKey':_0x070e('0x151')});db[_0x070e('0xdf')]['belongsTo'](db['SquareProject'],{'as':_0x070e('0xd7'),'foreignKey':_0x070e('0x1d1')});db[_0x070e('0xdf')][_0x070e('0x120')](db[_0x070e('0xeb')],{'as':_0x070e('0x123'),'through':_0x070e('0x1d2')});db['Campaign'][_0x070e('0x120')](db['CmList'],{'as':_0x070e('0x157'),'through':_0x070e('0x1d3')});db['Attachment'][_0x070e('0x11c')](db[_0x070e('0x173')],{'as':_0x070e('0x173'),'foreignKey':_0x070e('0x174')});db[_0x070e('0x1d4')][_0x070e('0x11c')](db[_0x070e('0x16a')],{});db[_0x070e('0x1d4')]['belongsTo'](db[_0x070e('0x37')],{});db[_0x070e('0x1d4')][_0x070e('0x11c')](db[_0x070e('0x34')],{'foreignKey':_0x070e('0x1d5'),'as':_0x070e('0x1d6')});db['MailTransferReport'][_0x070e('0x11c')](db['User'],{'foreignKey':_0x070e('0x1d7'),'as':'FromAgent'});db[_0x070e('0x1d4')][_0x070e('0x11c')](db[_0x070e('0x105')],{'foreignKey':_0x070e('0x1d8'),'as':_0x070e('0x1d9')});db['MailTransferReport'][_0x070e('0x11c')](db[_0x070e('0x35')],{'foreignKey':_0x070e('0x1da'),'as':_0x070e('0x1db')});db[_0x070e('0x1d4')]['belongsTo'](db['MailAccount'],{'foreignKey':'ToMailAccountId','as':'ToAccount'});db[_0x070e('0xe6')][_0x070e('0x11c')](db[_0x070e('0x61')],{});db[_0x070e('0xe6')][_0x070e('0x11c')](db[_0x070e('0x5f')],{});db[_0x070e('0xe6')][_0x070e('0x11c')](db[_0x070e('0x5a')],{'foreignKey':'FromChatWebsiteId','as':_0x070e('0x1d6')});db[_0x070e('0xe6')]['belongsTo'](db['User'],{'foreignKey':_0x070e('0x1d7'),'as':'FromAgent'});db[_0x070e('0xe6')][_0x070e('0x11c')](db[_0x070e('0x105')],{'foreignKey':_0x070e('0x1d8'),'as':'ToAgent'});db['ChatTransferReport'][_0x070e('0x11c')](db[_0x070e('0x12f')],{'foreignKey':'ToChatQueueId','as':_0x070e('0x1db')});db[_0x070e('0xe6')][_0x070e('0x11c')](db[_0x070e('0x5a')],{'foreignKey':_0x070e('0x1dc'),'as':_0x070e('0x1dd')});db['FaxTransferReport'][_0x070e('0x11c')](db['FaxMessage'],{});db[_0x070e('0xe8')][_0x070e('0x11c')](db[_0x070e('0x115')],{});db[_0x070e('0xe8')][_0x070e('0x11c')](db[_0x070e('0x135')],{'foreignKey':_0x070e('0x1de'),'as':'FromAccount'});db[_0x070e('0xe8')][_0x070e('0x11c')](db[_0x070e('0x105')],{'foreignKey':'FromUserId','as':_0x070e('0x1df')});db[_0x070e('0xe8')][_0x070e('0x11c')](db[_0x070e('0x105')],{'foreignKey':_0x070e('0x1d8'),'as':_0x070e('0x1d9')});db[_0x070e('0xe8')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x070e('0x1e0'),'as':_0x070e('0x1db')});db[_0x070e('0xe8')][_0x070e('0x11c')](db[_0x070e('0x135')],{'foreignKey':_0x070e('0x1e1'),'as':_0x070e('0x1dd')});db[_0x070e('0x1e2')]['belongsTo'](db[_0x070e('0x57')],{});db[_0x070e('0x1e2')]['belongsTo'](db['OpenchannelInteraction'],{});db[_0x070e('0x1e2')]['belongsTo'](db[_0x070e('0x52')],{'foreignKey':'FromOpenchannelAccountId','as':_0x070e('0x1d6')});db[_0x070e('0x1e2')][_0x070e('0x11c')](db[_0x070e('0x105')],{'foreignKey':'FromUserId','as':_0x070e('0x1df')});db[_0x070e('0x1e2')]['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':_0x070e('0x1d9')});db['OpenchannelTransferReport'][_0x070e('0x11c')](db[_0x070e('0x58')],{'foreignKey':_0x070e('0x1e3'),'as':_0x070e('0x1db')});db[_0x070e('0x1e2')]['belongsTo'](db[_0x070e('0x52')],{'foreignKey':_0x070e('0x1e4'),'as':_0x070e('0x1dd')});db[_0x070e('0x1e5')][_0x070e('0x11c')](db[_0x070e('0x4e')],{});db[_0x070e('0x1e5')]['belongsTo'](db[_0x070e('0x4c')],{});db[_0x070e('0x1e5')][_0x070e('0x11c')](db[_0x070e('0x13c')],{'foreignKey':_0x070e('0x1e6'),'as':_0x070e('0x1d6')});db[_0x070e('0x1e5')][_0x070e('0x11c')](db[_0x070e('0x105')],{'foreignKey':_0x070e('0x1d7'),'as':_0x070e('0x1df')});db[_0x070e('0x1e5')][_0x070e('0x11c')](db[_0x070e('0x105')],{'foreignKey':_0x070e('0x1d8'),'as':_0x070e('0x1d9')});db['SmsTransferReport'][_0x070e('0x11c')](db['SmsQueue'],{'foreignKey':_0x070e('0x1e7'),'as':'ToQueue'});db[_0x070e('0x1e5')][_0x070e('0x11c')](db['SmsAccount'],{'foreignKey':_0x070e('0x1e8'),'as':'ToAccount'});db[_0x070e('0xeb')][_0x070e('0x10b')](db[_0x070e('0x75')],{'as':_0x070e('0x18a'),'foreignKey':'ListId','onDelete':_0x070e('0x107')});db['CmList'][_0x070e('0x10b')](db[_0x070e('0x70')],{'as':_0x070e('0x1e9'),'foreignKey':_0x070e('0x178')});db[_0x070e('0xeb')][_0x070e('0x10b')](db[_0x070e('0x69')],{'as':_0x070e('0x121'),'onDelete':_0x070e('0x107'),'foreignKey':_0x070e('0x178')});db[_0x070e('0xeb')]['hasMany'](db['CmHopperFinal'],{'as':_0x070e('0x10f'),'foreignKey':_0x070e('0x178')});db[_0x070e('0xeb')][_0x070e('0x10b')](db[_0x070e('0x6e')],{'as':'HopperHistory','foreignKey':_0x070e('0x178')});db[_0x070e('0xeb')][_0x070e('0x10b')](db[_0x070e('0x111')],{'as':'ReportAgentPreview','foreignKey':_0x070e('0x178')});db[_0x070e('0xeb')][_0x070e('0x120')](db[_0x070e('0x129')],{'as':_0x070e('0x1ea'),'through':_0x070e('0x153')});db['CmList']['belongsToMany'](db[_0x070e('0x105')],{'as':'Agents','through':_0x070e('0x124')});db[_0x070e('0xed')][_0x070e('0x10b')](db[_0x070e('0x10c')],{'as':_0x070e('0x10d'),'onDelete':'cascade'});db[_0x070e('0xed')][_0x070e('0x120')](db[_0x070e('0x105')],{'as':_0x070e('0x154'),'through':_0x070e('0x103')});db[_0x070e('0xed')][_0x070e('0x120')](db[_0x070e('0x155')],{'through':_0x070e('0x102'),'as':_0x070e('0x156')});db[_0x070e('0xef')][_0x070e('0x10b')](db[_0x070e('0x105')],{'as':'Users','foreignKey':_0x070e('0x11d')});db['UserProfile'][_0x070e('0x10b')](db[_0x070e('0x1eb')],{'as':_0x070e('0x1ec'),'foreignKey':_0x070e('0x11d'),'onDelete':_0x070e('0x107')});db['UserProfileSection'][_0x070e('0x10b')](db['UserProfileResource'],{'as':_0x070e('0x1ed'),'foreignKey':_0x070e('0x1ee'),'onDelete':_0x070e('0x107')});db[_0x070e('0xf3')]['hasMany'](db[_0x070e('0x75')],{'as':_0x070e('0x18a'),'foreignKey':_0x070e('0x1ef'),'onDelete':'cascade'});db['WhatsappAccount'][_0x070e('0x10b')](db[_0x070e('0x73')],{'as':'Answers','foreignKey':_0x070e('0x1ef')});db[_0x070e('0xf3')]['hasMany'](db[_0x070e('0xf7')],{'as':_0x070e('0x159'),'foreignKey':_0x070e('0x1ef')});db['WhatsappAccount'][_0x070e('0x10b')](db[_0x070e('0x118')],{'as':_0x070e('0x166')});db['WhatsappAccount'][_0x070e('0x10b')](db[_0x070e('0xf4')],{'as':_0x070e('0x144')});db[_0x070e('0xf3')][_0x070e('0x11c')](db['CmList'],{'as':_0x070e('0x167'),'foreignKey':_0x070e('0x178')});db[_0x070e('0xf3')][_0x070e('0x11c')](db[_0x070e('0x17c')],{'as':_0x070e('0x17d'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x070e('0xf3')]['belongsToMany'](db[_0x070e('0x105')],{'as':_0x070e('0x154'),'through':_0x070e('0x13f')});db['WhatsappApplication'][_0x070e('0x11c')](db['User'],{'onDelete':'restrict'});db['WhatsappApplication']['belongsTo'](db[_0x070e('0xfc')],{'onDelete':'restrict'});db[_0x070e('0xf4')][_0x070e('0x11c')](db[_0x070e('0xf3')],{'onDelete':_0x070e('0x175')});db[_0x070e('0xf4')][_0x070e('0x11c')](db['Interval'],{'onDelete':_0x070e('0x175'),'foreignKey':_0x070e('0x151')});db['WhatsappApplication'][_0x070e('0x11c')](db['Tag'],{'onDelete':_0x070e('0x175'),'foreignKey':_0x070e('0x176')});db[_0x070e('0x118')][_0x070e('0x10b')](db['WhatsappMessage'],{'as':_0x070e('0x159'),'onDelete':'cascade','foreignKey':_0x070e('0x1f0')});db[_0x070e('0x118')][_0x070e('0x11c')](db[_0x070e('0xf3')],{'as':_0x070e('0x171'),'foreignKey':'WhatsappAccountId'});db['WhatsappInteraction']['belongsTo'](db[_0x070e('0x69')],{'as':'Contact','foreignKey':_0x070e('0x160')});db[_0x070e('0x118')][_0x070e('0x11c')](db[_0x070e('0x105')],{'as':'Owner','foreignKey':'UserId'});db['WhatsappInteraction']['belongsToMany'](db[_0x070e('0x82')],{'through':_0x070e('0x1b1'),'as':_0x070e('0x16d')});db[_0x070e('0x118')][_0x070e('0x120')](db[_0x070e('0x82')],{'through':_0x070e('0x1b1'),'as':'ThroughTags'});db[_0x070e('0x118')][_0x070e('0x120')](db[_0x070e('0x105')],{'as':_0x070e('0x16e'),'through':_0x070e('0x1f1'),'foreignKey':_0x070e('0x1f0')});db[_0x070e('0xf7')][_0x070e('0x11c')](db[_0x070e('0x105')],{'as':_0x070e('0x105')});db['WhatsappMessage']['belongsTo'](db[_0x070e('0x69')],{'onDelete':_0x070e('0x107'),'as':_0x070e('0x15f')});db[_0x070e('0xf7')][_0x070e('0x11c')](db[_0x070e('0x118')],{'onDelete':_0x070e('0x107'),'as':'Interaction','foreignKey':'WhatsappInteractionId'});db[_0x070e('0xf7')][_0x070e('0x11c')](db[_0x070e('0xf3')],{'as':_0x070e('0x171'),'foreignKey':'WhatsappAccountId'});db[_0x070e('0xf9')][_0x070e('0x11c')](db['WhatsappAccount'],{});db[_0x070e('0xf9')][_0x070e('0x11c')](db[_0x070e('0xeb')],{'as':_0x070e('0x167'),'foreignKey':_0x070e('0x178')});db['WhatsappQueueReport'][_0x070e('0x11c')](db[_0x070e('0x69')],{'as':'Contact','foreignKey':_0x070e('0x160')});db[_0x070e('0xf9')][_0x070e('0x11c')](db[_0x070e('0x118')],{});db['WhatsappQueueReport'][_0x070e('0x11c')](db['WhatsappQueue'],{});db[_0x070e('0xf9')][_0x070e('0x11c')](db[_0x070e('0xf7')],{});db[_0x070e('0xf9')][_0x070e('0x11c')](db['User'],{});db['WhatsappTransferReport'][_0x070e('0x11c')](db[_0x070e('0xf7')],{});db[_0x070e('0x1f2')][_0x070e('0x11c')](db[_0x070e('0x118')],{});db['WhatsappTransferReport'][_0x070e('0x11c')](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db[_0x070e('0x1f2')]['belongsTo'](db[_0x070e('0xf3')],{'foreignKey':'ToWhatsappAccountId','as':'ToAccount'});db[_0x070e('0x1f2')]['belongsTo'](db[_0x070e('0xfc')],{'foreignKey':_0x070e('0x1f3'),'as':_0x070e('0x1db')});db[_0x070e('0x1f2')][_0x070e('0x11c')](db[_0x070e('0x105')],{'foreignKey':_0x070e('0x1d7'),'as':_0x070e('0x1df')});db['WhatsappTransferReport'][_0x070e('0x11c')](db[_0x070e('0x105')],{'foreignKey':_0x070e('0x1d8'),'as':_0x070e('0x1d9')});db[_0x070e('0xfc')]['belongsToMany'](db[_0x070e('0x105')],{'as':'Agents','through':_0x070e('0x31'),'foreignKey':_0x070e('0x1f4')});db[_0x070e('0xfc')][_0x070e('0x120')](db[_0x070e('0x155')],{'through':_0x070e('0x1cf'),'as':_0x070e('0x156')});module[_0x070e('0x1f5')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x2547=['../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','VoiceTransferReport','UserVoiceQueueRt','../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','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','Interval','Pause','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','cascade','UserId','Recordings','hasMany','VoiceQueuesRt','Extensions','CmHopperFinal','HopperFinals','OpenchannelInteractions','ChatInteraction','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotification','UserNotifications','belongsTo','userProfileId','belongsToMany','cm_user_has_contacts','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','VoiceQueues','VoicePrefixes','UserVoicePrefix','ChatQueues','FaxQueues','SmsQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','SquareProjects','user_has_square_projects','ChanSpyId','Applications','moh_has_sounds','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','Trunk','IntervalId','mandatoryDispositionPause','Lists','voice_queues_has_cm_lists','Agents','Teams','BlackLists','Messages','mailbox','mailboxuser','QueueCalls','uniqueid','AgentReports','ContactId','MailAccountId','Imap','Dispositions','Interactions','List','ListId','Template','TemplateId','MailQueue','team_has_mail_queues','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Contact','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','DashboardItem','Items','FaxAccountId','Answers','FaxApplication','Exntensions','FaxInteractionId','fax_interaction_has_tags','SmsAccountId','SmsMessage','mandatoryDispositionPauseId','SmsInteractionId','sms_interaction_has_tags','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','ProactiveActions','Agent','Queue','ChatQueueId','chat_interaction_has_tags','ChatInternalMessage','ChatGroupId','chat_group_has_users','Website','CmCompany','CompanyId','JscriptySessions','Company','cm_contact_has_tags','CampaignId','OwnerId','Automation','All','OneAll','AutomationAllId','OneAny','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AnyConditions','AnyCondition','TriggerId','AnalyticFieldReport','AnalyticMetric','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','FieldId','DescriptionId','Field','Subject','Description','VariableId','DeskField','int_desk_configuration_has_tags','ZendeskField','FreshdeskAccount','FreshdeskField','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowConfiguration','Dynamics365Field','Dynamics365Account','FreshsalesConfiguration','FreshsalesAccount','FromId','ToId','SessionId','JscriptyAnswerReport','ProjectId','MailQueues','team_has_chat_queues','team_has_fax_queues','team_has_openchannel_queues','TeamVoicePrefix','TrunkId','TrunkBackup','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','ToFaxQueueId','ToOpenchannelQueueId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','Contacts','HopperHistory','Queues','UserProfileSections','UserProfileResource','sectionId','WhatsappAccountId','WhatsappInteractionId','user_has_whatsapp_interactions','FromWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','exports','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','name','database','username','password','options','User'];(function(_0x49bfb8,_0x5b6e2b){var _0x1be0b7=function(_0x3df70f){while(--_0x3df70f){_0x49bfb8['push'](_0x49bfb8['shift']());}};_0x1be0b7(++_0x5b6e2b);}(_0x2547,0x1cd));var _0x7254=function(_0x339863,_0x2a20b2){_0x339863=_0x339863-0x0;var _0x18eb37=_0x2547[_0x339863];return _0x18eb37;};'use strict';var config=require('../config/environment');var Sequelize=require(_0x7254('0x0'));var _=require(_0x7254('0x1'));var jstz=require(_0x7254('0x2'));var timezone=jstz[_0x7254('0x3')]();config[_0x7254('0x0')]=_[_0x7254('0x4')](config[_0x7254('0x0')],{'database':_0x7254('0x5'),'username':'xcall','password':_0x7254('0x6'),'options':{'host':_0x7254('0x7'),'port':0xcea,'dialect':_0x7254('0x8'),'dialectOptions':{'charset':_0x7254('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x7254('0xa'),'collate':_0x7254('0xb')}}});config[_0x7254('0xc')]=_['defaultsDeep'](config[_0x7254('0xc')],{'database':'motion2','username':'xcall','password':'xC@LL1234','options':{'host':_0x7254('0x7'),'port':0xcea,'dialect':_0x7254('0x8'),'dialectOptions':{'charset':_0x7254('0x9')},'logging':![],'timezone':timezone[_0x7254('0xd')](),'define':{'charset':_0x7254('0xa'),'collate':_0x7254('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x7254('0xe')],config['sequelize'][_0x7254('0xf')],config['sequelize'][_0x7254('0x10')],config[_0x7254('0x0')][_0x7254('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x7254('0xc')][_0x7254('0xe')],config[_0x7254('0xc')][_0x7254('0xf')],config[_0x7254('0xc')][_0x7254('0x10')],config[_0x7254('0xc')][_0x7254('0x11')])};db[_0x7254('0x12')]=db[_0x7254('0x0')]['import'](_0x7254('0x13'));db[_0x7254('0x14')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x16'));db[_0x7254('0x17')]=db[_0x7254('0x0')]['import'](_0x7254('0x18'));db[_0x7254('0x19')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x1a'));db[_0x7254('0x1b')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x1c'));db[_0x7254('0x1d')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x1e'));db[_0x7254('0x1f')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x20'));db[_0x7254('0x21')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x22'));db['VoiceMail']=db['sequelize'][_0x7254('0x15')](_0x7254('0x23'));db[_0x7254('0x24')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x25'));db[_0x7254('0x26')]=db['sequelize'][_0x7254('0x15')](_0x7254('0x27'));db[_0x7254('0x28')]=db['sequelize'][_0x7254('0x15')]('../api/voiceDialReport/voiceDialReport.model');db[_0x7254('0x29')]=db[_0x7254('0x0')]['import'](_0x7254('0x2a'));db[_0x7254('0x2b')]=db['sequelize'][_0x7254('0x15')](_0x7254('0x2c'));db[_0x7254('0x2d')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x2e'));db['Trunk']=db[_0x7254('0x0')][_0x7254('0x15')]('../api/trunk/trunk.model');db[_0x7254('0x2f')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x7254('0x30')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x31'));db[_0x7254('0x32')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0x7254('0x33')]=db['sequelize']['import'](_0x7254('0x34'));db[_0x7254('0x35')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x36'));db[_0x7254('0x37')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x38'));db[_0x7254('0x39')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x3a'));db[_0x7254('0x3b')]=db['sequelize'][_0x7254('0x15')](_0x7254('0x3c'));db[_0x7254('0x3d')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x7254('0x3e')]=db['sequelize'][_0x7254('0x15')](_0x7254('0x3f'));db[_0x7254('0x40')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/mailServerOut/mailServerOut.model');db[_0x7254('0x41')]=db['sequelize'][_0x7254('0x15')](_0x7254('0x42'));db['MailQueue']=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x43'));db[_0x7254('0x44')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/mailSubstatus/mailSubstatus.model');db[_0x7254('0x45')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/mailInteraction/mailInteraction.model');db[_0x7254('0x46')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/mailMessage/mailMessage.model');db[_0x7254('0x47')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x48'));db[_0x7254('0x49')]=db['sequelize']['import'](_0x7254('0x4a'));db[_0x7254('0x4b')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/dashboard/dashboard.model');db['DashboardItem']=db[_0x7254('0x0')]['import'](_0x7254('0x4c'));db[_0x7254('0x4d')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/faxAccount/faxAccount.model');db['FaxApplication']=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x4e'));db[_0x7254('0x4f')]=db[_0x7254('0x0')]['import']('../api/faxInteraction/faxInteraction.model');db[_0x7254('0x50')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/faxMessage/faxMessage.model');db[_0x7254('0x51')]=db[_0x7254('0x0')]['import'](_0x7254('0x52'));db[_0x7254('0x53')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/faxQueueReport/faxQueueReport.model');db[_0x7254('0x54')]=db[_0x7254('0x0')]['import'](_0x7254('0x55'));db[_0x7254('0x56')]=db[_0x7254('0x0')]['import'](_0x7254('0x57'));db[_0x7254('0x58')]=db['sequelize']['import'](_0x7254('0x59'));db['SmsMessage']=db[_0x7254('0x0')][_0x7254('0x15')]('../api/smsMessage/smsMessage.model');db['SmsQueue']=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x5a'));db[_0x7254('0x5b')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/openchannelAccount/openchannelAccount.model');db[_0x7254('0x5c')]=db['sequelize'][_0x7254('0x15')](_0x7254('0x5d'));db[_0x7254('0x5e')]=db['sequelize'][_0x7254('0x15')](_0x7254('0x5f'));db[_0x7254('0x60')]=db['sequelize'][_0x7254('0x15')](_0x7254('0x61'));db[_0x7254('0x62')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/openchannelQueue/openchannelQueue.model');db['ChatWebsite']=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x63'));db[_0x7254('0x64')]=db[_0x7254('0x0')]['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x7254('0x65')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x66'));db['ChatInteraction']=db[_0x7254('0x0')][_0x7254('0x15')]('../api/chatInteraction/chatInteraction.model');db[_0x7254('0x67')]=db['sequelize'][_0x7254('0x15')]('../api/chatMessage/chatMessage.model');db[_0x7254('0x68')]=db['sequelize']['import'](_0x7254('0x69'));db[_0x7254('0x6a')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/chatQueue/chatQueue.model');db[_0x7254('0x6b')]=db['sequelize'][_0x7254('0x15')](_0x7254('0x6c'));db[_0x7254('0x6d')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x6e'));db['CmCompany']=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x6f'));db[_0x7254('0x70')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/cmContact/cmContact.model');db[_0x7254('0x71')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x72'));db[_0x7254('0x73')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/cmHopperBlack/cmHopperBlack.model');db['CmHopperFinal']=db[_0x7254('0x0')]['import']('../api/cmHopperFinal/cmHopperFinal.model');db[_0x7254('0x74')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x7254('0x75')]=db['sequelize'][_0x7254('0x15')](_0x7254('0x76'));db[_0x7254('0x77')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/cmCustomField/cmCustomField.model');db[_0x7254('0x78')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x79'));db['Automation']=db['sequelize'][_0x7254('0x15')](_0x7254('0x7a'));db[_0x7254('0x7b')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x7c'));db[_0x7254('0x7d')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x7e'));db[_0x7254('0x7f')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/condition/condition.model');db[_0x7254('0x80')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/interval/interval.model');db[_0x7254('0x81')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x82'));db['Cdr']=db[_0x7254('0x0')]['import'](_0x7254('0x83'));db[_0x7254('0x84')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x7254('0x85')]=db['sequelize'][_0x7254('0x15')]('../api/schedule/schedule.model');db[_0x7254('0x86')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x87'));db[_0x7254('0x88')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x89'));db['Template']=db[_0x7254('0x0')]['import'](_0x7254('0x8a'));db[_0x7254('0x8b')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x8c'));db[_0x7254('0x8d')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/variable/variable.model');db[_0x7254('0x8e')]=db['sequelize'][_0x7254('0x15')](_0x7254('0x8f'));db[_0x7254('0x90')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x91'));db[_0x7254('0x92')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x93'));db[_0x7254('0x94')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x95'));db[_0x7254('0x96')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/analyticExtractedReport/analyticExtractedReport.model');db['AnalyticMetric']=db[_0x7254('0x0')][_0x7254('0x15')]('../api/analyticMetric/analyticMetric.model');db['AnalyticFieldReport']=db['sequelize'][_0x7254('0x15')](_0x7254('0x97'));db[_0x7254('0x98')]=db[_0x7254('0x0')]['import'](_0x7254('0x99'));db[_0x7254('0x9a')]=db['sequelize'][_0x7254('0x15')](_0x7254('0x9b'));db[_0x7254('0x9c')]=db['sequelize']['import'](_0x7254('0x9d'));db[_0x7254('0x9e')]=db['sequelize'][_0x7254('0x15')](_0x7254('0x9f'));db[_0x7254('0xa0')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x7254('0xa1')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x7254('0xa2')]=db['sequelize']['import']('../api/intSugarcrmField/intSugarcrmField.model');db[_0x7254('0xa3')]=db['sequelize']['import'](_0x7254('0xa4'));db[_0x7254('0xa5')]=db[_0x7254('0x0')]['import'](_0x7254('0xa6'));db['DeskField']=db[_0x7254('0x0')][_0x7254('0x15')]('../api/intDeskField/intDeskField.model');db[_0x7254('0xa7')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0xa8'));db[_0x7254('0xa9')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x7254('0xaa')]=db['sequelize']['import'](_0x7254('0xab'));db[_0x7254('0xac')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x7254('0xad')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0xae'));db['ZendeskField']=db[_0x7254('0x0')]['import']('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db[_0x7254('0x0')][_0x7254('0x15')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db[_0x7254('0x0')]['import']('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db['FreshdeskField']=db['sequelize'][_0x7254('0x15')](_0x7254('0xaf'));db['VtigerAccount']=db['sequelize'][_0x7254('0x15')](_0x7254('0xb0'));db[_0x7254('0xb1')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x7254('0xb2')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0xb3'));db[_0x7254('0xb4')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0xb5'));db['ServicenowConfiguration']=db['sequelize'][_0x7254('0x15')](_0x7254('0xb6'));db[_0x7254('0xb7')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0xb8'));db['Dynamics365Account']=db[_0x7254('0x0')][_0x7254('0x15')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x7254('0xb9')]=db['sequelize']['import'](_0x7254('0xba'));db['Dynamics365Field']=db['sequelize'][_0x7254('0x15')](_0x7254('0xbb'));db['FreshsalesAccount']=db['sequelize'][_0x7254('0x15')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db['FreshsalesConfiguration']=db[_0x7254('0x0')][_0x7254('0x15')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0x7254('0xbc')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0xbd'));db[_0x7254('0x8e')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0x8f'));db[_0x7254('0xbe')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/network/network.model');db[_0x7254('0xbf')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0xc0'));db['ChatInternalMessage']=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0xc1'));db['JscriptyAnswerReport']=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0xc2'));db[_0x7254('0xc3')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x7254('0xc4')]=db[_0x7254('0x0')]['import'](_0x7254('0xc5'));db[_0x7254('0xc6')]=db[_0x7254('0x0')]['import']('../api/smsQueueReport/smsQueueReport.model');db['SquareReport']=db[_0x7254('0x0')]['import'](_0x7254('0xc7'));db[_0x7254('0xc8')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0xc9'));db[_0x7254('0xca')]=db[_0x7254('0x0')]['import'](_0x7254('0xcb'));db[_0x7254('0xcc')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0xcd'));db[_0x7254('0xce')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0xcf'));db[_0x7254('0xd0')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0xd1'));db[_0x7254('0xd2')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0xd3'));db[_0x7254('0xd4')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0xd5'));db[_0x7254('0xd6')]=db[_0x7254('0x0')]['import'](_0x7254('0xd7'));db[_0x7254('0xd8')]=db['sequelize'][_0x7254('0x15')](_0x7254('0xd9'));db[_0x7254('0xda')]=db['sequelize'][_0x7254('0x15')]('../api/campaign/campaign.model');db[_0x7254('0xdb')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0xdc'));db[_0x7254('0xdd')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0xde'));db['Plugin']=db[_0x7254('0x0')][_0x7254('0x15')]('../api/plugin/plugin.model');db[_0x7254('0xdf')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/mailTransferReport/mailTransferReport.model');db[_0x7254('0xe0')]=db[_0x7254('0x0')]['import'](_0x7254('0xe1'));db['FaxTransferReport']=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0xe2'));db[_0x7254('0xe3')]=db['sequelize'][_0x7254('0x15')](_0x7254('0xe4'));db['SmsTransferReport']=db[_0x7254('0x0')][_0x7254('0x15')]('../api/smsTransferReport/smsTransferReport.model');db[_0x7254('0xe5')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/cmList/cmList.model');db[_0x7254('0xe6')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0xe7'));db[_0x7254('0xe8')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0xe9'));db[_0x7254('0xea')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/userProfileSection/userProfileSection.model');db['UserProfileResource']=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0xeb'));db['UserNotification']=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0xec'));db[_0x7254('0xed')]=db['sequelize'][_0x7254('0x15')]('../api/whatsappAccount/whatsappAccount.model');db[_0x7254('0xee')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/whatsappApplication/whatsappApplication.model');db[_0x7254('0xef')]=db['sequelize'][_0x7254('0x15')](_0x7254('0xf0'));db[_0x7254('0xf1')]=db[_0x7254('0x0')]['import'](_0x7254('0xf2'));db[_0x7254('0xf3')]=db[_0x7254('0x0')]['import'](_0x7254('0xf4'));db[_0x7254('0xf5')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0xf6'));db[_0x7254('0xf7')]=db[_0x7254('0x0')][_0x7254('0x15')]('../api/whatsappQueue/whatsappQueue.model');db[_0x7254('0xf8')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0xf9'));db[_0x7254('0xfa')]=db[_0x7254('0x0')][_0x7254('0x15')](_0x7254('0xfb'));db['TeamVoicePrefix']=db['sequelize'][_0x7254('0x15')]('../api/teamVoicePrefix/teamVoicePrefix.model');db['UserVoicePrefix']=db['sequelize'][_0x7254('0x15')](_0x7254('0xfc'));db[_0x7254('0x12')][_0x7254('0xfd')](db[_0x7254('0xfe')],{'as':_0x7254('0xfe'),'onDelete':_0x7254('0xff'),'foreignKey':_0x7254('0x100')});db[_0x7254('0x12')]['hasMany'](db[_0x7254('0x1f')],{'as':_0x7254('0x101'),'foreignKey':_0x7254('0x100')});db[_0x7254('0x12')][_0x7254('0x102')](db['UserVoiceQueueRt'],{'as':_0x7254('0x103'),'foreignKey':_0x7254('0x100')});db[_0x7254('0x12')]['hasMany'](db[_0x7254('0x19')],{'as':_0x7254('0x104'),'onDelete':_0x7254('0xff'),'hooks':!![]});db['User'][_0x7254('0x102')](db[_0x7254('0x105')],{'as':_0x7254('0x106'),'foreignKey':_0x7254('0x100')});db[_0x7254('0x12')]['hasMany'](db[_0x7254('0x74')],{'as':'HopperHistory','foreignKey':_0x7254('0x100')});db[_0x7254('0x12')][_0x7254('0x102')](db[_0x7254('0x75')],{'as':_0x7254('0x75'),'foreignKey':_0x7254('0x100')});db[_0x7254('0x12')][_0x7254('0x102')](db[_0x7254('0x5e')],{'as':_0x7254('0x107'),'foreignKey':_0x7254('0x100')});db[_0x7254('0x12')]['hasMany'](db[_0x7254('0x108')],{'as':_0x7254('0x109'),'foreignKey':_0x7254('0x100')});db['User'][_0x7254('0x102')](db[_0x7254('0x58')],{'as':_0x7254('0x10a'),'foreignKey':_0x7254('0x100')});db[_0x7254('0x12')][_0x7254('0x102')](db[_0x7254('0x4f')],{'as':_0x7254('0x10b'),'foreignKey':_0x7254('0x100')});db[_0x7254('0x12')][_0x7254('0x102')](db[_0x7254('0x45')],{'as':_0x7254('0x10c'),'foreignKey':'UserId'});db['User'][_0x7254('0x102')](db[_0x7254('0xef')],{'as':_0x7254('0x10d'),'foreignKey':'UserId'});db[_0x7254('0x12')][_0x7254('0x102')](db[_0x7254('0x10e')],{'as':_0x7254('0x10f'),'foreignKey':'SenderId'});db[_0x7254('0x12')][_0x7254('0x110')](db[_0x7254('0xe8')],{'as':_0x7254('0xe8'),'foreignKey':_0x7254('0x111')});db[_0x7254('0x12')][_0x7254('0x112')](db[_0x7254('0x6b')],{'as':'Groups','through':'chat_group_has_users'});db[_0x7254('0x12')]['belongsToMany'](db[_0x7254('0x70')],{'as':'Contacts','through':_0x7254('0x113')});db['User'][_0x7254('0x112')](db[_0x7254('0xe5')],{'as':'Lists','through':_0x7254('0x114')});db[_0x7254('0x12')][_0x7254('0x112')](db[_0x7254('0xd6')],{'through':_0x7254('0x115')});db[_0x7254('0x12')][_0x7254('0x112')](db['MailInteraction'],{'as':'MailInteractions','through':_0x7254('0x116')});db[_0x7254('0x12')][_0x7254('0x112')](db['ChatInteraction'],{'as':'ChatInteractions','through':_0x7254('0x117')});db['User'][_0x7254('0x112')](db['FaxInteraction'],{'as':_0x7254('0x10b'),'through':_0x7254('0x118')});db[_0x7254('0x12')]['belongsToMany'](db['SmsInteraction'],{'as':_0x7254('0x10a'),'through':_0x7254('0x119')});db['User'][_0x7254('0x112')](db['OpenchannelInteraction'],{'as':_0x7254('0x107'),'through':'user_has_openchannel_interactions'});db[_0x7254('0x12')][_0x7254('0x112')](db[_0x7254('0xef')],{'as':_0x7254('0x10d'),'through':'user_has_whatsapp_interactions'});db['User'][_0x7254('0x112')](db[_0x7254('0x1d')],{'as':_0x7254('0x11a'),'through':_0x7254('0x32'),'required':![]});db[_0x7254('0x12')][_0x7254('0x112')](db[_0x7254('0xe6')],{'as':_0x7254('0x11b'),'through':_0x7254('0x11c'),'required':![]});db[_0x7254('0x12')][_0x7254('0x112')](db['MailQueue'],{'as':'MailQueues','through':_0x7254('0x35'),'required':![]});db[_0x7254('0x12')]['belongsToMany'](db['ChatQueue'],{'as':_0x7254('0x11d'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User'][_0x7254('0x112')](db[_0x7254('0x51')],{'as':_0x7254('0x11e'),'through':_0x7254('0x37'),'required':![]});db[_0x7254('0x12')][_0x7254('0x112')](db[_0x7254('0x11f')],{'as':_0x7254('0x120'),'through':'UserSmsQueue','required':![]});db[_0x7254('0x12')][_0x7254('0x112')](db['OpenchannelQueue'],{'as':_0x7254('0x121'),'through':_0x7254('0x3b'),'required':![]});db[_0x7254('0x12')][_0x7254('0x112')](db[_0x7254('0xf7')],{'as':_0x7254('0x122'),'through':_0x7254('0x3d'),'required':![]});db[_0x7254('0x12')]['belongsToMany'](db[_0x7254('0xe5')],{'through':_0x7254('0x114')});db[_0x7254('0x12')]['belongsToMany'](db[_0x7254('0x123')],{'as':_0x7254('0x124'),'through':_0x7254('0x125')});db[_0x7254('0x12')][_0x7254('0x112')](db[_0x7254('0x4d')],{'as':_0x7254('0x126'),'through':_0x7254('0x127')});db[_0x7254('0x12')][_0x7254('0x112')](db[_0x7254('0x41')],{'as':_0x7254('0x128'),'through':_0x7254('0x129')});db[_0x7254('0x12')][_0x7254('0x112')](db[_0x7254('0x5b')],{'as':_0x7254('0x12a'),'through':_0x7254('0x12b')});db['User'][_0x7254('0x112')](db['SmsAccount'],{'as':_0x7254('0x12c'),'through':_0x7254('0x12d')});db[_0x7254('0x12')][_0x7254('0x112')](db[_0x7254('0xed')],{'as':_0x7254('0x12e'),'through':'user_has_whatsapp_accounts'});db['User'][_0x7254('0x112')](db[_0x7254('0xd0')],{'as':_0x7254('0x12f'),'through':_0x7254('0x130')});db['VoiceChanSpy'][_0x7254('0x102')](db[_0x7254('0x19')],{'as':'SpiedAgents','onDelete':_0x7254('0xff'),'foreignKey':_0x7254('0x131')});db[_0x7254('0x17')][_0x7254('0x102')](db['VoiceExtension'],{'onDelete':'cascade'});db[_0x7254('0x19')][_0x7254('0x102')](db['VoiceExtension'],{'as':_0x7254('0x132'),'onDelete':_0x7254('0xff')});db[_0x7254('0x1b')][_0x7254('0x112')](db[_0x7254('0x86')],{'as':'Sounds','through':_0x7254('0x133')});db[_0x7254('0x1d')]['hasMany'](db[_0x7254('0x30')],{'as':'Members','foreignKey':_0x7254('0x134')});db[_0x7254('0x1d')][_0x7254('0x102')](db[_0x7254('0x71')],{'as':_0x7254('0x135'),'foreignKey':_0x7254('0x134')});db['VoiceQueue']['hasMany'](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x7254('0x134')});db[_0x7254('0x1d')][_0x7254('0x102')](db['CmHopperHistory'],{'as':_0x7254('0x136'),'foreignKey':'VoiceQueueId'});db[_0x7254('0x1d')][_0x7254('0x102')](db[_0x7254('0x75')],{'as':_0x7254('0x75'),'foreignKey':_0x7254('0x134')});db['VoiceQueue'][_0x7254('0x102')](db[_0x7254('0x73')],{'as':_0x7254('0x137'),'foreignKey':_0x7254('0x134')});db[_0x7254('0x1d')][_0x7254('0x102')](db[_0x7254('0xc4')],{'as':'JscriptySessions','foreignKey':'VoiceQueueId'});db[_0x7254('0x1d')][_0x7254('0x110')](db['Trunk'],{'as':_0x7254('0x138'),'foreignKey':'TrunkId'});db[_0x7254('0x1d')][_0x7254('0x110')](db[_0x7254('0x138')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0x7254('0x1d')]['belongsTo'](db[_0x7254('0x80')],{'as':'Interval','foreignKey':_0x7254('0x139')});db[_0x7254('0x1d')]['belongsTo'](db[_0x7254('0x81')],{'as':_0x7254('0x13a'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x7254('0x1d')][_0x7254('0x112')](db['CmList'],{'as':_0x7254('0x13b'),'through':_0x7254('0x13c')});db[_0x7254('0x1d')][_0x7254('0x112')](db['User'],{'as':_0x7254('0x13d'),'through':_0x7254('0x32')});db['VoiceQueue'][_0x7254('0x112')](db[_0x7254('0xd6')],{'as':_0x7254('0x13e'),'through':'TeamVoiceQueue'});db[_0x7254('0x1d')][_0x7254('0x112')](db[_0x7254('0xe5')],{'as':_0x7254('0x13f'),'through':'voice_queues_has_cm_blacklists'});db[_0x7254('0x1f')]['belongsTo'](db[_0x7254('0x12')],{'as':_0x7254('0x12'),'foreignKey':_0x7254('0x100')});db[_0x7254('0x21')][_0x7254('0x110')](db[_0x7254('0x12')],{'as':_0x7254('0x12'),'foreignKey':_0x7254('0x100')});db['VoiceMail'][_0x7254('0x102')](db[_0x7254('0x24')],{'as':_0x7254('0x140'),'onDelete':_0x7254('0xff'),'foreignKey':'mailboxuser','sourceKey':_0x7254('0x141')});db[_0x7254('0x24')][_0x7254('0x110')](db['VoiceMail'],{'foreignKey':_0x7254('0x142'),'targetKey':_0x7254('0x141')});db[_0x7254('0x26')]['hasMany'](db[_0x7254('0x2b')],{'as':_0x7254('0x143'),'foreignKey':_0x7254('0x144'),'constraints':![]});db[_0x7254('0x26')][_0x7254('0x102')](db[_0x7254('0x29')],{'as':_0x7254('0x145'),'foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0x7254('0x12')],{'as':'User','foreignKey':_0x7254('0x100')});db['VoiceCallReport'][_0x7254('0x110')](db[_0x7254('0x70')],{'as':'Contact','foreignKey':_0x7254('0x146')});db[_0x7254('0x3e')][_0x7254('0x110')](db[_0x7254('0x41')],{'as':'MailAccount','foreignKey':_0x7254('0x147')});db[_0x7254('0x40')][_0x7254('0x110')](db[_0x7254('0x41')],{'as':_0x7254('0x41'),'foreignKey':_0x7254('0x147')});db[_0x7254('0x41')][_0x7254('0xfd')](db['MailServerIn'],{'as':_0x7254('0x148'),'onDelete':_0x7254('0xff')});db[_0x7254('0x41')][_0x7254('0xfd')](db[_0x7254('0x40')],{'as':'Smtp','onDelete':_0x7254('0xff')});db[_0x7254('0x41')]['hasMany'](db['Disposition'],{'as':_0x7254('0x149'),'foreignKey':_0x7254('0x147'),'onDelete':_0x7254('0xff')});db['MailAccount'][_0x7254('0x102')](db[_0x7254('0x7b')],{'as':'Answers','foreignKey':_0x7254('0x147')});db[_0x7254('0x41')][_0x7254('0x102')](db[_0x7254('0x46')],{'as':'Messages','foreignKey':'MailAccountId'});db['MailAccount'][_0x7254('0x102')](db['MailInteraction'],{'as':_0x7254('0x14a')});db[_0x7254('0x41')][_0x7254('0x102')](db[_0x7254('0x47')],{'as':'Applications'});db[_0x7254('0x41')][_0x7254('0x110')](db[_0x7254('0xe5')],{'as':_0x7254('0x14b'),'foreignKey':_0x7254('0x14c')});db[_0x7254('0x41')][_0x7254('0x110')](db[_0x7254('0x14d')],{'as':_0x7254('0x14d'),'foreignKey':_0x7254('0x14e')});db[_0x7254('0x41')][_0x7254('0x110')](db[_0x7254('0x81')],{'as':_0x7254('0x13a'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x7254('0x41')][_0x7254('0x112')](db[_0x7254('0x12')],{'as':_0x7254('0x13d'),'through':_0x7254('0x129')});db[_0x7254('0x14f')]['belongsToMany'](db[_0x7254('0x12')],{'as':_0x7254('0x13d'),'through':_0x7254('0x35')});db[_0x7254('0x14f')][_0x7254('0x112')](db[_0x7254('0xd6')],{'through':_0x7254('0x150'),'as':_0x7254('0x13e')});db[_0x7254('0x45')][_0x7254('0x102')](db[_0x7254('0x46')],{'as':'Messages','onDelete':_0x7254('0xff'),'foreignKey':'MailInteractionId'});db[_0x7254('0x45')][_0x7254('0x110')](db['MailAccount'],{'as':_0x7254('0x151'),'foreignKey':_0x7254('0x147')});db[_0x7254('0x45')][_0x7254('0x110')](db[_0x7254('0x70')],{'as':'Contact','foreignKey':'ContactId'});db[_0x7254('0x45')][_0x7254('0x110')](db[_0x7254('0x12')],{'as':_0x7254('0x152'),'foreignKey':_0x7254('0x100')});db[_0x7254('0x45')]['belongsToMany'](db[_0x7254('0x88')],{'through':_0x7254('0x153'),'as':_0x7254('0x154')});db[_0x7254('0x45')][_0x7254('0x112')](db[_0x7254('0x88')],{'through':_0x7254('0x153'),'as':_0x7254('0x155')});db[_0x7254('0x45')][_0x7254('0x112')](db[_0x7254('0x12')],{'as':_0x7254('0x156'),'through':_0x7254('0x116'),'foreignKey':_0x7254('0x157')});db['MailMessage'][_0x7254('0x102')](db[_0x7254('0xdd')],{'as':_0x7254('0x158'),'onDelete':_0x7254('0xff')});db[_0x7254('0x46')][_0x7254('0x110')](db[_0x7254('0x12')],{'as':_0x7254('0x12')});db['MailMessage']['belongsTo'](db[_0x7254('0x70')],{'onDelete':_0x7254('0xff'),'as':_0x7254('0x159')});db['MailMessage'][_0x7254('0x110')](db['MailInteraction'],{'as':_0x7254('0x15a'),'foreignKey':_0x7254('0x157')});db[_0x7254('0x46')][_0x7254('0x110')](db[_0x7254('0x41')],{'as':_0x7254('0x151'),'foreignKey':_0x7254('0x147')});db['MailMessage'][_0x7254('0x110')](db['ChatWebsite'],{'as':_0x7254('0x123'),'foreignKey':_0x7254('0x15b')});db[_0x7254('0x46')][_0x7254('0x110')](db['ChatOfflineMessage'],{'as':_0x7254('0x68'),'foreignKey':_0x7254('0x15c')});db['MailApplication'][_0x7254('0x110')](db[_0x7254('0x12')],{'onDelete':_0x7254('0x15d')});db[_0x7254('0x47')][_0x7254('0x110')](db[_0x7254('0x14f')],{'onDelete':_0x7254('0x15d')});db['MailApplication'][_0x7254('0x110')](db[_0x7254('0x41')],{'onDelete':_0x7254('0x15d')});db[_0x7254('0x47')][_0x7254('0x110')](db[_0x7254('0x80')],{'onDelete':'restrict','foreignKey':_0x7254('0x139')});db['MailApplication'][_0x7254('0x110')](db[_0x7254('0x88')],{'onDelete':'restrict','foreignKey':_0x7254('0x15e')});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x7254('0x49')][_0x7254('0x110')](db['CmList'],{'as':_0x7254('0x14b'),'foreignKey':'ListId'});db['MailQueueReport']['belongsTo'](db[_0x7254('0x70')],{'as':_0x7254('0x159'),'foreignKey':_0x7254('0x146')});db[_0x7254('0x49')][_0x7254('0x110')](db[_0x7254('0x45')],{});db['MailQueueReport'][_0x7254('0x110')](db['MailMessage'],{});db[_0x7254('0x49')][_0x7254('0x110')](db[_0x7254('0x12')],{});db[_0x7254('0x49')]['belongsTo'](db[_0x7254('0x14f')],{});db[_0x7254('0x4b')][_0x7254('0x102')](db[_0x7254('0x15f')],{'as':_0x7254('0x160'),'onDelete':_0x7254('0xff')});db['FaxAccount'][_0x7254('0x102')](db[_0x7254('0x7d')],{'as':_0x7254('0x149'),'foreignKey':_0x7254('0x161'),'onDelete':_0x7254('0xff')});db[_0x7254('0x4d')][_0x7254('0x102')](db['CannedAnswer'],{'as':_0x7254('0x162'),'foreignKey':_0x7254('0x161')});db[_0x7254('0x4d')][_0x7254('0x102')](db['FaxInteraction'],{'as':_0x7254('0x14a')});db['FaxAccount'][_0x7254('0x102')](db[_0x7254('0x163')],{'as':_0x7254('0x132')});db['FaxAccount']['hasMany'](db[_0x7254('0x19')],{'as':_0x7254('0x164'),'onDelete':'cascade'});db[_0x7254('0x4d')][_0x7254('0x102')](db[_0x7254('0x50')],{'as':'Messages'});db['FaxAccount'][_0x7254('0x110')](db[_0x7254('0x138')],{'as':_0x7254('0x138')});db[_0x7254('0x4d')]['belongsTo'](db[_0x7254('0xe5')],{'as':'List','foreignKey':_0x7254('0x14c')});db['FaxAccount']['belongsTo'](db[_0x7254('0x81')],{'as':_0x7254('0x13a'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x7254('0x4d')][_0x7254('0x112')](db['User'],{'as':_0x7254('0x13d'),'through':_0x7254('0x127')});db[_0x7254('0x163')][_0x7254('0x110')](db[_0x7254('0x12')],{'onDelete':_0x7254('0x15d')});db['FaxApplication'][_0x7254('0x110')](db[_0x7254('0x51')],{'onDelete':_0x7254('0x15d')});db[_0x7254('0x163')][_0x7254('0x110')](db['FaxAccount'],{'onDelete':_0x7254('0x15d')});db['FaxApplication'][_0x7254('0x110')](db[_0x7254('0x88')],{'onDelete':_0x7254('0x15d'),'foreignKey':_0x7254('0x15e')});db[_0x7254('0x4f')]['hasMany'](db[_0x7254('0x50')],{'as':_0x7254('0x140'),'onDelete':_0x7254('0xff'),'foreignKey':_0x7254('0x165')});db[_0x7254('0x4f')][_0x7254('0x110')](db[_0x7254('0x4d')],{'as':'Account','foreignKey':_0x7254('0x161')});db['FaxInteraction'][_0x7254('0x110')](db[_0x7254('0x70')],{'as':_0x7254('0x159'),'foreignKey':'ContactId'});db['FaxInteraction']['belongsTo'](db[_0x7254('0x12')],{'as':_0x7254('0x152'),'foreignKey':_0x7254('0x100')});db[_0x7254('0x4f')][_0x7254('0x112')](db[_0x7254('0x88')],{'through':_0x7254('0x166'),'as':'Tags'});db[_0x7254('0x4f')]['belongsToMany'](db[_0x7254('0x88')],{'through':_0x7254('0x166'),'as':_0x7254('0x155')});db[_0x7254('0x4f')][_0x7254('0x112')](db[_0x7254('0x12')],{'as':_0x7254('0x156'),'through':_0x7254('0x118'),'foreignKey':'FaxInteractionId'});db[_0x7254('0x50')][_0x7254('0x110')](db[_0x7254('0x12')],{'onDelete':_0x7254('0xff'),'as':'User'});db['FaxMessage'][_0x7254('0x110')](db['FaxInteraction'],{'as':_0x7254('0x15a'),'foreignKey':_0x7254('0x165')});db[_0x7254('0x50')][_0x7254('0x110')](db[_0x7254('0x70')],{'onDelete':_0x7254('0xff'),'as':'Contact'});db[_0x7254('0x50')][_0x7254('0x110')](db[_0x7254('0xdd')],{'as':_0x7254('0xdd'),'foreignKey':'AttachmentId'});db['FaxMessage'][_0x7254('0x110')](db[_0x7254('0x4d')],{'as':_0x7254('0x151'),'foreignKey':'FaxAccountId'});db[_0x7254('0x51')][_0x7254('0x112')](db[_0x7254('0x12')],{'as':_0x7254('0x13d'),'through':'UserFaxQueue'});db['FaxQueue']['belongsToMany'](db['Team'],{'through':'team_has_fax_queues','as':_0x7254('0x13e')});db[_0x7254('0x53')]['belongsTo'](db['FaxAccount'],{});db[_0x7254('0x53')][_0x7254('0x110')](db['CmList'],{'as':_0x7254('0x14b'),'foreignKey':_0x7254('0x14c')});db[_0x7254('0x53')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0x7254('0x146')});db[_0x7254('0x53')][_0x7254('0x110')](db['FaxInteraction'],{});db[_0x7254('0x53')]['belongsTo'](db['FaxMessage'],{});db['FaxQueueReport'][_0x7254('0x110')](db[_0x7254('0x12')],{});db['FaxQueueReport'][_0x7254('0x110')](db[_0x7254('0x51')],{});db[_0x7254('0x54')][_0x7254('0x102')](db[_0x7254('0x7d')],{'as':'Dispositions','foreignKey':_0x7254('0x167'),'onDelete':'cascade'});db[_0x7254('0x54')][_0x7254('0x102')](db[_0x7254('0x7b')],{'as':_0x7254('0x162'),'foreignKey':_0x7254('0x167')});db[_0x7254('0x54')][_0x7254('0x102')](db[_0x7254('0x168')],{'as':_0x7254('0x140'),'foreignKey':'SmsAccountId'});db[_0x7254('0x54')][_0x7254('0x102')](db[_0x7254('0x58')],{'as':_0x7254('0x14a')});db[_0x7254('0x54')]['hasMany'](db['SmsApplication'],{'as':_0x7254('0x132')});db[_0x7254('0x54')][_0x7254('0x110')](db['CmList'],{'as':'List','foreignKey':_0x7254('0x14c')});db[_0x7254('0x54')][_0x7254('0x110')](db[_0x7254('0x81')],{'as':'mandatoryDispositionPause','foreignKey':_0x7254('0x169')});db[_0x7254('0x54')][_0x7254('0x112')](db[_0x7254('0x12')],{'as':_0x7254('0x13d'),'through':_0x7254('0x12d')});db['SmsApplication'][_0x7254('0x110')](db[_0x7254('0x12')],{'onDelete':_0x7254('0x15d')});db[_0x7254('0x56')][_0x7254('0x110')](db[_0x7254('0x11f')],{'onDelete':_0x7254('0x15d')});db[_0x7254('0x56')][_0x7254('0x110')](db[_0x7254('0x54')],{'onDelete':_0x7254('0x15d')});db['SmsApplication'][_0x7254('0x110')](db[_0x7254('0x80')],{'onDelete':'restrict','foreignKey':_0x7254('0x139')});db[_0x7254('0x56')][_0x7254('0x110')](db[_0x7254('0x88')],{'onDelete':_0x7254('0x15d'),'foreignKey':_0x7254('0x15e')});db[_0x7254('0x58')]['hasMany'](db[_0x7254('0x168')],{'as':_0x7254('0x140'),'onDelete':'cascade','foreignKey':_0x7254('0x16a')});db[_0x7254('0x58')][_0x7254('0x110')](db['SmsAccount'],{'as':_0x7254('0x151'),'foreignKey':_0x7254('0x167')});db[_0x7254('0x58')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x7254('0x58')][_0x7254('0x110')](db[_0x7254('0x12')],{'as':_0x7254('0x152'),'foreignKey':_0x7254('0x100')});db[_0x7254('0x58')]['belongsToMany'](db[_0x7254('0x88')],{'through':_0x7254('0x16b'),'as':_0x7254('0x154')});db[_0x7254('0x58')][_0x7254('0x112')](db[_0x7254('0x88')],{'through':_0x7254('0x16b'),'as':_0x7254('0x155')});db[_0x7254('0x58')][_0x7254('0x112')](db['User'],{'as':_0x7254('0x156'),'through':'user_has_sms_interactions','foreignKey':'SmsInteractionId'});db[_0x7254('0x168')]['belongsTo'](db[_0x7254('0x12')],{'as':'User'});db[_0x7254('0x168')][_0x7254('0x110')](db[_0x7254('0x70')],{'onDelete':_0x7254('0xff'),'as':'Contact'});db['SmsMessage'][_0x7254('0x110')](db[_0x7254('0x58')],{'onDelete':_0x7254('0xff'),'as':_0x7254('0x15a'),'foreignKey':'SmsInteractionId'});db[_0x7254('0x168')]['belongsTo'](db[_0x7254('0x54')],{'as':'Account','foreignKey':_0x7254('0x167')});db[_0x7254('0x11f')][_0x7254('0x112')](db[_0x7254('0x12')],{'as':_0x7254('0x13d'),'through':'UserSmsQueue','foreignKey':'SmsQueueId'});db[_0x7254('0x11f')][_0x7254('0x112')](db[_0x7254('0xd6')],{'through':'team_has_sms_queues','as':_0x7254('0x13e')});db[_0x7254('0x5b')][_0x7254('0x102')](db[_0x7254('0x7d')],{'as':'Dispositions','foreignKey':_0x7254('0x16c'),'onDelete':'cascade'});db['OpenchannelAccount'][_0x7254('0x102')](db[_0x7254('0x7b')],{'as':'Answers','foreignKey':_0x7254('0x16c')});db[_0x7254('0x5b')][_0x7254('0x102')](db[_0x7254('0x5e')],{'as':_0x7254('0x14a'),'foreignKey':_0x7254('0x16c')});db['OpenchannelAccount'][_0x7254('0x102')](db[_0x7254('0x60')],{'as':_0x7254('0x140'),'foreignKey':_0x7254('0x16c')});db[_0x7254('0x5b')][_0x7254('0x102')](db['OpenchannelApplication'],{'as':_0x7254('0x132'),'foreignKey':_0x7254('0x16c')});db[_0x7254('0x5b')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x7254('0x14c')});db[_0x7254('0x5b')][_0x7254('0x110')](db[_0x7254('0x81')],{'as':'mandatoryDispositionPause','foreignKey':_0x7254('0x169')});db[_0x7254('0x5b')][_0x7254('0x112')](db[_0x7254('0x12')],{'as':_0x7254('0x13d'),'through':_0x7254('0x12b')});db['OpenchannelApplication']['belongsTo'](db[_0x7254('0x12')],{'onDelete':_0x7254('0x15d')});db[_0x7254('0x5c')]['belongsTo'](db['OpenchannelQueue'],{'onDelete':_0x7254('0x15d'),'foreignKey':_0x7254('0x16d')});db[_0x7254('0x5c')][_0x7254('0x110')](db['OpenchannelAccount'],{'onDelete':_0x7254('0x15d'),'foreignKey':_0x7254('0x16c')});db[_0x7254('0x5c')][_0x7254('0x110')](db[_0x7254('0x80')],{'onDelete':'restrict','foreignKey':_0x7254('0x139')});db[_0x7254('0x5c')][_0x7254('0x110')](db[_0x7254('0x88')],{'onDelete':_0x7254('0x15d'),'foreignKey':'TagId'});db['OpenchannelInteraction'][_0x7254('0x102')](db['OpenchannelMessage'],{'as':_0x7254('0x140'),'onDelete':'cascade','foreignKey':_0x7254('0x16e')});db['OpenchannelInteraction']['belongsTo'](db[_0x7254('0x5b')],{'as':'Account','foreignKey':_0x7254('0x16c')});db['OpenchannelInteraction'][_0x7254('0x110')](db[_0x7254('0x70')],{'as':_0x7254('0x159'),'foreignKey':_0x7254('0x146')});db['OpenchannelInteraction'][_0x7254('0x110')](db['User'],{'as':'Owner','foreignKey':'UserId'});db[_0x7254('0x5e')][_0x7254('0x112')](db['Tag'],{'through':_0x7254('0x16f'),'as':_0x7254('0x154')});db['OpenchannelInteraction'][_0x7254('0x112')](db[_0x7254('0x88')],{'through':_0x7254('0x16f'),'as':_0x7254('0x155')});db[_0x7254('0x5e')][_0x7254('0x112')](db['User'],{'as':_0x7254('0x156'),'through':'user_has_openchannel_interactions','foreignKey':_0x7254('0x16e')});db['OpenchannelMessage'][_0x7254('0x110')](db[_0x7254('0x12')],{'onDelete':_0x7254('0xff'),'as':_0x7254('0x12')});db[_0x7254('0x60')][_0x7254('0x110')](db[_0x7254('0x70')],{'onDelete':_0x7254('0xff'),'as':_0x7254('0x159')});db[_0x7254('0x60')]['belongsTo'](db['OpenchannelInteraction'],{'onDelete':'cascade','as':_0x7254('0x15a'),'foreignKey':_0x7254('0x16e')});db['OpenchannelMessage'][_0x7254('0x110')](db[_0x7254('0xdd')],{'as':_0x7254('0xdd'),'foreignKey':'AttachmentId'});db[_0x7254('0x60')][_0x7254('0x110')](db[_0x7254('0x5b')],{'as':_0x7254('0x151'),'foreignKey':_0x7254('0x16c')});db[_0x7254('0x62')][_0x7254('0x112')](db[_0x7254('0x12')],{'as':_0x7254('0x13d'),'through':_0x7254('0x3b'),'foreignKey':_0x7254('0x16d')});db[_0x7254('0x62')][_0x7254('0x112')](db[_0x7254('0xd6')],{'through':'team_has_openchannel_queues','as':_0x7254('0x13e')});db[_0x7254('0x123')][_0x7254('0x102')](db[_0x7254('0x7d')],{'as':_0x7254('0x149'),'foreignKey':_0x7254('0x15b'),'onDelete':_0x7254('0xff')});db['ChatWebsite'][_0x7254('0x102')](db[_0x7254('0x7b')],{'as':_0x7254('0x162'),'foreignKey':_0x7254('0x15b')});db['ChatWebsite'][_0x7254('0x102')](db[_0x7254('0x6d')],{'as':_0x7254('0x170')});db[_0x7254('0x123')][_0x7254('0x102')](db[_0x7254('0x108')],{'as':_0x7254('0x14a')});db[_0x7254('0x123')][_0x7254('0x102')](db['ChatApplication'],{'as':_0x7254('0x132')});db[_0x7254('0x123')]['hasMany'](db[_0x7254('0x67')],{'as':_0x7254('0x140')});db['ChatWebsite'][_0x7254('0x110')](db[_0x7254('0xe5')],{'as':'List','foreignKey':_0x7254('0x14c')});db['ChatWebsite']['belongsTo'](db[_0x7254('0x80')],{'as':_0x7254('0x80'),'foreignKey':_0x7254('0x139')});db['ChatWebsite'][_0x7254('0x110')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0x7254('0x147')});db['ChatWebsite'][_0x7254('0x110')](db[_0x7254('0x81')],{'as':'mandatoryDispositionPause','foreignKey':_0x7254('0x169')});db[_0x7254('0x123')]['belongsToMany'](db[_0x7254('0x12')],{'as':'Agents','through':_0x7254('0x125')});db['OpenchannelQueueReport'][_0x7254('0x110')](db[_0x7254('0x5b')],{});db['OpenchannelQueueReport']['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x7254('0x14c')});db[_0x7254('0x64')][_0x7254('0x110')](db[_0x7254('0x70')],{'as':_0x7254('0x159'),'foreignKey':_0x7254('0x146')});db[_0x7254('0x64')][_0x7254('0x110')](db[_0x7254('0x5e')],{});db[_0x7254('0x64')]['belongsTo'](db['OpenchannelMessage'],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x7254('0x12')],{});db[_0x7254('0x64')][_0x7254('0x110')](db[_0x7254('0x62')],{});db[_0x7254('0x65')][_0x7254('0x110')](db[_0x7254('0x12')],{'as':_0x7254('0x171'),'foreignKey':_0x7254('0x100'),'onDelete':_0x7254('0x15d')});db['ChatApplication'][_0x7254('0x110')](db['ChatQueue'],{'as':_0x7254('0x172'),'foreignKey':_0x7254('0x173'),'onDelete':_0x7254('0x15d')});db[_0x7254('0x65')][_0x7254('0x110')](db['ChatWebsite'],{'as':'Website','foreignKey':_0x7254('0x15b'),'onDelete':'restrict'});db['ChatApplication'][_0x7254('0x110')](db['Tag'],{'onDelete':_0x7254('0x15d'),'foreignKey':'TagId'});db['ChatInteraction'][_0x7254('0x102')](db['ChatMessage'],{'as':_0x7254('0x140'),'onDelete':_0x7254('0xff'),'foreignKey':'ChatInteractionId'});db[_0x7254('0x108')][_0x7254('0x110')](db[_0x7254('0x123')],{'as':'Account','foreignKey':_0x7254('0x15b')});db['ChatInteraction'][_0x7254('0x110')](db[_0x7254('0x70')],{'as':_0x7254('0x159'),'foreignKey':_0x7254('0x146')});db[_0x7254('0x108')][_0x7254('0x110')](db[_0x7254('0x12')],{'as':_0x7254('0x152'),'foreignKey':_0x7254('0x100')});db['ChatInteraction'][_0x7254('0x112')](db[_0x7254('0x88')],{'through':_0x7254('0x174'),'as':'Tags'});db['ChatInteraction'][_0x7254('0x112')](db[_0x7254('0x88')],{'through':_0x7254('0x174'),'as':_0x7254('0x155')});db['ChatInteraction'][_0x7254('0x112')](db[_0x7254('0x12')],{'as':_0x7254('0x156'),'through':_0x7254('0x117'),'foreignKey':'ChatInteractionId'});db[_0x7254('0x67')]['belongsTo'](db[_0x7254('0x12')],{'onDelete':_0x7254('0xff'),'as':'User'});db[_0x7254('0x67')][_0x7254('0x110')](db[_0x7254('0x70')],{'onDelete':_0x7254('0xff'),'as':_0x7254('0x159'),'foreignKey':_0x7254('0x146')});db[_0x7254('0x67')][_0x7254('0x110')](db[_0x7254('0x108')],{'onDelete':'cascade','as':'Interaction','foreignKey':'ChatInteractionId'});db[_0x7254('0x67')][_0x7254('0x110')](db['Attachment'],{'as':_0x7254('0xdd'),'foreignKey':'AttachmentId'});db[_0x7254('0x67')]['belongsTo'](db['ChatWebsite'],{'as':_0x7254('0x151'),'foreignKey':_0x7254('0x15b')});db[_0x7254('0x68')][_0x7254('0x102')](db[_0x7254('0xdd')],{'as':_0x7254('0x158'),'foreignKey':_0x7254('0x15c'),'onDelete':_0x7254('0xff'),'hooks':!![]});db[_0x7254('0x68')]['belongsTo'](db[_0x7254('0x70')],{'onDelete':_0x7254('0xff'),'as':_0x7254('0x159'),'foreignKey':_0x7254('0x146')});db[_0x7254('0x68')][_0x7254('0x110')](db[_0x7254('0x123')],{'as':_0x7254('0x151'),'foreignKey':_0x7254('0x15b')});db[_0x7254('0x6a')]['belongsToMany'](db[_0x7254('0x12')],{'as':'Agents','through':_0x7254('0x33'),'hooks':!![]});db[_0x7254('0x6a')][_0x7254('0x112')](db[_0x7254('0xd6')],{'through':'team_has_chat_queues','as':_0x7254('0x13e')});db[_0x7254('0x6b')]['hasMany'](db[_0x7254('0x175')],{'as':'Messages','foreignKey':_0x7254('0x176'),'onDelete':'cascade'});db[_0x7254('0x6b')][_0x7254('0x112')](db['User'],{'as':'Members','through':_0x7254('0x177')});db[_0x7254('0x6d')][_0x7254('0x110')](db['ChatWebsite'],{'as':_0x7254('0x178'),'foreignKey':_0x7254('0x15b')});db[_0x7254('0x179')]['hasMany'](db[_0x7254('0x70')],{'as':'Contacts','foreignKey':_0x7254('0x17a')});db[_0x7254('0x70')][_0x7254('0x102')](db[_0x7254('0x71')],{'as':_0x7254('0x135'),'foreignKey':_0x7254('0x146')});db[_0x7254('0x70')][_0x7254('0x102')](db[_0x7254('0x105')],{'as':_0x7254('0x106'),'foreignKey':_0x7254('0x146')});db[_0x7254('0x70')][_0x7254('0x102')](db[_0x7254('0x74')],{'as':_0x7254('0x136'),'foreignKey':_0x7254('0x146')});db['CmContact'][_0x7254('0x102')](db[_0x7254('0x75')],{'as':_0x7254('0x75'),'foreignKey':_0x7254('0x146')});db[_0x7254('0x70')]['hasMany'](db[_0x7254('0xc4')],{'as':_0x7254('0x17b'),'foreignKey':_0x7254('0x146')});db['CmContact'][_0x7254('0x102')](db[_0x7254('0x5e')],{'as':'OpenchannelInteractions','foreignKey':_0x7254('0x146'),'onDelete':'restrict'});db[_0x7254('0x70')][_0x7254('0x102')](db[_0x7254('0x108')],{'as':_0x7254('0x109'),'foreignKey':'ContactId','onDelete':'restrict'});db['CmContact']['hasMany'](db[_0x7254('0x58')],{'as':_0x7254('0x10a'),'foreignKey':_0x7254('0x146'),'onDelete':_0x7254('0x15d')});db['CmContact'][_0x7254('0x102')](db[_0x7254('0x4f')],{'as':'FaxInteractions','foreignKey':_0x7254('0x146'),'onDelete':_0x7254('0x15d')});db[_0x7254('0x70')][_0x7254('0x102')](db[_0x7254('0x45')],{'as':'MailInteractions','foreignKey':_0x7254('0x146'),'onDelete':_0x7254('0x15d')});db[_0x7254('0x70')][_0x7254('0x110')](db[_0x7254('0x179')],{'as':_0x7254('0x17c'),'foreignKey':'CompanyId'});db[_0x7254('0x70')][_0x7254('0x110')](db[_0x7254('0xe5')],{'as':'List','foreignKey':_0x7254('0x14c'),'onDelete':'cascade'});db[_0x7254('0x70')][_0x7254('0x112')](db[_0x7254('0x12')],{'as':'Users','through':'cm_user_has_contacts'});db[_0x7254('0x70')][_0x7254('0x112')](db[_0x7254('0x88')],{'as':_0x7254('0x154'),'through':_0x7254('0x17d')});db[_0x7254('0x70')]['belongsToMany'](db['Tag'],{'through':_0x7254('0x17d'),'as':_0x7254('0x155')});db[_0x7254('0x71')][_0x7254('0x110')](db[_0x7254('0x70')],{'as':_0x7254('0x159'),'foreignKey':'ContactId','onDelete':_0x7254('0xff')});db[_0x7254('0x71')][_0x7254('0x110')](db[_0x7254('0xe5')],{'as':_0x7254('0x14b'),'foreignKey':_0x7254('0x14c'),'onDelete':_0x7254('0xff')});db[_0x7254('0x71')][_0x7254('0x110')](db['User'],{'as':_0x7254('0x171'),'foreignKey':'UserId'});db[_0x7254('0x71')][_0x7254('0x110')](db[_0x7254('0x1d')],{'as':_0x7254('0x172'),'foreignKey':_0x7254('0x134'),'onDelete':_0x7254('0xff')});db['CmHopper'][_0x7254('0x110')](db[_0x7254('0xda')],{'as':_0x7254('0xda'),'foreignKey':_0x7254('0x17e'),'onDelete':_0x7254('0xff')});db[_0x7254('0x71')]['belongsTo'](db[_0x7254('0x12')],{'as':'Owner','foreignKey':_0x7254('0x17f')});db[_0x7254('0x73')][_0x7254('0x110')](db[_0x7254('0x70')],{'as':_0x7254('0x159'),'foreignKey':_0x7254('0x146'),'onDelete':_0x7254('0xff')});db[_0x7254('0x73')][_0x7254('0x110')](db[_0x7254('0xe5')],{'as':_0x7254('0x14b'),'foreignKey':_0x7254('0x14c'),'onDelete':_0x7254('0xff')});db[_0x7254('0x73')][_0x7254('0x110')](db[_0x7254('0x1d')],{'as':'Queue','foreignKey':_0x7254('0x134'),'onDelete':_0x7254('0xff')});db['CmHopperBlack'][_0x7254('0x110')](db['Campaign'],{'as':_0x7254('0xda'),'foreignKey':_0x7254('0x17e'),'onDelete':_0x7254('0xff')});db[_0x7254('0x180')][_0x7254('0x102')](db[_0x7254('0x7f')],{'as':{'plural':_0x7254('0x181'),'singular':_0x7254('0x182')},'foreignKey':_0x7254('0x183'),'onDelete':_0x7254('0xff'),'hooks':!![]});db['Automation']['hasMany'](db[_0x7254('0x7f')],{'as':{'plural':'Any','singular':_0x7254('0x184')},'foreignKey':'AutomationAnyId','onDelete':_0x7254('0xff'),'hooks':!![]});db[_0x7254('0x180')][_0x7254('0x102')](db[_0x7254('0x78')],{'as':_0x7254('0x185'),'foreignKey':_0x7254('0x186'),'onDelete':_0x7254('0xff'),'hooks':!![]});db[_0x7254('0x7d')][_0x7254('0x102')](db[_0x7254('0x7d')],{'as':'Dispositions','foreignKey':_0x7254('0x187'),'onDelete':_0x7254('0xff')});db[_0x7254('0x80')][_0x7254('0x102')](db[_0x7254('0x80')],{'as':_0x7254('0x188'),'foreignKey':'IntervalId','onDelete':_0x7254('0xff'),'hooks':!![],'required':![]});db['Interval'][_0x7254('0x102')](db[_0x7254('0x19')],{'as':_0x7254('0x104'),'foreignKey':'IntervalId','onDelete':_0x7254('0x15d')});db['Interval'][_0x7254('0x102')](db[_0x7254('0x47')],{'as':_0x7254('0x189'),'foreignKey':_0x7254('0x139')});db['Interval'][_0x7254('0x102')](db[_0x7254('0x65')],{'as':_0x7254('0x18a'),'foreignKey':_0x7254('0x139')});db[_0x7254('0x80')][_0x7254('0x102')](db[_0x7254('0x163')],{'as':_0x7254('0x18b'),'foreignKey':_0x7254('0x139')});db[_0x7254('0x80')]['hasMany'](db[_0x7254('0x56')],{'as':'SmsApplications','foreignKey':'IntervalId'});db[_0x7254('0x85')]['belongsTo'](db[_0x7254('0x41')],{});db['Schedule']['belongsTo'](db[_0x7254('0x94')],{'foreignKey':_0x7254('0x18c')});db[_0x7254('0x85')][_0x7254('0x110')](db[_0x7254('0x92')],{'foreignKey':_0x7254('0x18d')});db[_0x7254('0x86')][_0x7254('0x112')](db['VoiceMusicOnHold'],{'as':_0x7254('0x18e'),'through':_0x7254('0x133'),'onDelete':_0x7254('0x15d')});db[_0x7254('0x88')][_0x7254('0x112')](db[_0x7254('0x70')],{'through':'cm_contact_has_tags'});db[_0x7254('0x88')][_0x7254('0x112')](db[_0x7254('0x108')],{'through':_0x7254('0x174')});db[_0x7254('0x88')]['belongsToMany'](db[_0x7254('0x45')],{'through':_0x7254('0x153')});db[_0x7254('0x88')][_0x7254('0x112')](db['SmsInteraction'],{'through':_0x7254('0x16b')});db['Tag']['belongsToMany'](db['FaxInteraction'],{'through':_0x7254('0x166')});db[_0x7254('0x88')]['belongsToMany'](db[_0x7254('0x5e')],{'through':_0x7254('0x16f')});db[_0x7254('0x88')][_0x7254('0x112')](db[_0x7254('0xef')],{'through':_0x7254('0x18f')});db[_0x7254('0x8b')][_0x7254('0x102')](db[_0x7254('0x7f')],{'as':{'plural':_0x7254('0x190'),'singular':'AllCondition'},'foreignKey':'TriggerAllId','onDelete':_0x7254('0xff'),'hooks':!![]});db['Trigger'][_0x7254('0x102')](db[_0x7254('0x7f')],{'as':{'plural':_0x7254('0x191'),'singular':_0x7254('0x192')},'foreignKey':'TriggerAnyId','onDelete':_0x7254('0xff'),'hooks':!![]});db[_0x7254('0x8b')]['hasMany'](db[_0x7254('0x78')],{'as':_0x7254('0x185'),'foreignKey':_0x7254('0x193'),'onDelete':_0x7254('0xff'),'hooks':!![]});db['AnalyticCustomReport'][_0x7254('0x102')](db[_0x7254('0x194')],{'as':'Fields','onDelete':_0x7254('0xff'),'foreignKey':_0x7254('0x18d'),'hooks':!![]});db['AnalyticDefaultReport'][_0x7254('0x102')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x7254('0xff'),'foreignKey':_0x7254('0x18c')});db[_0x7254('0x195')][_0x7254('0x102')](db[_0x7254('0x194')],{'as':_0x7254('0x196'),'onDelete':_0x7254('0xff'),'foreignKey':_0x7254('0x197')});db[_0x7254('0x194')][_0x7254('0x110')](db[_0x7254('0x195')],{'foreignKey':_0x7254('0x197')});db[_0x7254('0x9a')][_0x7254('0x102')](db[_0x7254('0x9c')],{'as':_0x7254('0x198'),'onDelete':_0x7254('0xff'),'foreignKey':_0x7254('0x199')});db[_0x7254('0x9c')][_0x7254('0x102')](db[_0x7254('0x9e')],{'as':_0x7254('0x19a'),'onDelete':_0x7254('0xff'),'foreignKey':_0x7254('0x19b')});db[_0x7254('0x9c')][_0x7254('0x102')](db['SalesforceField'],{'as':_0x7254('0x19c'),'onDelete':_0x7254('0xff'),'foreignKey':'DescriptionId'});db[_0x7254('0x9c')][_0x7254('0x102')](db[_0x7254('0x9e')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x7254('0x19d')});db[_0x7254('0x9c')]['belongsTo'](db[_0x7254('0x9a')],{'as':'Account','foreignKey':_0x7254('0x199')});db['SalesforceField'][_0x7254('0x102')](db[_0x7254('0x9e')],{'as':'Subject','foreignKey':_0x7254('0x19b')});db['SalesforceField'][_0x7254('0x102')](db[_0x7254('0x9e')],{'as':'Description','foreignKey':_0x7254('0x19e')});db['SalesforceField'][_0x7254('0x102')](db['SalesforceField'],{'as':_0x7254('0x19f'),'foreignKey':_0x7254('0x19d')});db['SalesforceField']['belongsTo'](db[_0x7254('0x8d')],{'as':_0x7254('0x8d'),'foreignKey':'VariableId'});db[_0x7254('0xa0')][_0x7254('0x102')](db[_0x7254('0xa1')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0x7254('0xa1')]['hasMany'](db[_0x7254('0xa2')],{'as':_0x7254('0x19a'),'onDelete':_0x7254('0xff'),'foreignKey':'SubjectId'});db[_0x7254('0xa1')]['hasMany'](db['SugarcrmField'],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x7254('0x19e')});db[_0x7254('0xa1')][_0x7254('0x102')](db['SugarcrmField'],{'as':'Fields','onDelete':_0x7254('0xff'),'foreignKey':_0x7254('0x19d')});db[_0x7254('0xa1')]['belongsTo'](db['SugarcrmAccount'],{'as':_0x7254('0x151'),'foreignKey':_0x7254('0x199')});db[_0x7254('0xa2')][_0x7254('0x102')](db[_0x7254('0xa2')],{'as':_0x7254('0x1a0'),'foreignKey':_0x7254('0x19b')});db[_0x7254('0xa2')]['hasMany'](db[_0x7254('0xa2')],{'as':_0x7254('0x1a1'),'foreignKey':_0x7254('0x19e')});db[_0x7254('0xa2')][_0x7254('0x102')](db[_0x7254('0xa2')],{'as':_0x7254('0x19f'),'foreignKey':'FieldId'});db[_0x7254('0xa2')]['belongsTo'](db[_0x7254('0x8d')],{'as':_0x7254('0x8d'),'foreignKey':_0x7254('0x1a2')});db['DeskAccount'][_0x7254('0x102')](db[_0x7254('0xa5')],{'as':_0x7254('0x198'),'onDelete':'cascade','foreignKey':_0x7254('0x199')});db[_0x7254('0xa5')][_0x7254('0x102')](db[_0x7254('0x1a3')],{'as':_0x7254('0x19a'),'onDelete':_0x7254('0xff'),'foreignKey':_0x7254('0x19b')});db[_0x7254('0xa5')][_0x7254('0x102')](db['DeskField'],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x7254('0x19e')});db['DeskConfiguration'][_0x7254('0x102')](db[_0x7254('0x1a3')],{'as':_0x7254('0x196'),'onDelete':_0x7254('0xff'),'foreignKey':_0x7254('0x19d')});db[_0x7254('0xa5')]['belongsTo'](db[_0x7254('0xa3')],{'as':_0x7254('0x151'),'foreignKey':_0x7254('0x199')});db[_0x7254('0xa5')][_0x7254('0x112')](db['Tag'],{'through':_0x7254('0x1a4')});db[_0x7254('0x1a3')][_0x7254('0x102')](db[_0x7254('0x1a3')],{'as':_0x7254('0x1a0'),'foreignKey':_0x7254('0x19b')});db[_0x7254('0x1a3')][_0x7254('0x102')](db[_0x7254('0x1a3')],{'as':_0x7254('0x1a1'),'foreignKey':'DescriptionId'});db[_0x7254('0x1a3')][_0x7254('0x102')](db[_0x7254('0x1a3')],{'as':'Field','foreignKey':_0x7254('0x19d')});db[_0x7254('0x1a3')]['belongsTo'](db['Variable'],{'as':_0x7254('0x8d'),'foreignKey':_0x7254('0x1a2')});db[_0x7254('0xa7')][_0x7254('0x102')](db['ZohoConfiguration'],{'as':_0x7254('0x198'),'onDelete':_0x7254('0xff'),'foreignKey':_0x7254('0x199')});db['ZohoConfiguration']['hasMany'](db[_0x7254('0xaa')],{'as':_0x7254('0x19a'),'onDelete':_0x7254('0xff'),'foreignKey':_0x7254('0x19b')});db[_0x7254('0xa9')][_0x7254('0x102')](db['ZohoField'],{'as':_0x7254('0x19c'),'onDelete':_0x7254('0xff'),'foreignKey':_0x7254('0x19e')});db['ZohoConfiguration']['hasMany'](db[_0x7254('0xaa')],{'as':_0x7254('0x196'),'onDelete':_0x7254('0xff'),'foreignKey':'FieldId'});db[_0x7254('0xa9')][_0x7254('0x110')](db[_0x7254('0xa7')],{'as':'Account','foreignKey':_0x7254('0x199')});db[_0x7254('0xaa')]['hasMany'](db[_0x7254('0xaa')],{'as':'Subject','foreignKey':_0x7254('0x19b')});db[_0x7254('0xaa')][_0x7254('0x102')](db[_0x7254('0xaa')],{'as':'Description','foreignKey':_0x7254('0x19e')});db['ZohoField'][_0x7254('0x102')](db['ZohoField'],{'as':'Field','foreignKey':_0x7254('0x19d')});db[_0x7254('0xaa')][_0x7254('0x110')](db[_0x7254('0x8d')],{'as':'Variable','foreignKey':_0x7254('0x1a2')});db['ZendeskAccount'][_0x7254('0x102')](db['ZendeskConfiguration'],{'as':_0x7254('0x198'),'onDelete':'cascade','foreignKey':_0x7254('0x199')});db[_0x7254('0xad')][_0x7254('0x102')](db[_0x7254('0x1a5')],{'as':_0x7254('0x19a'),'foreignKey':_0x7254('0x19b')});db['ZendeskConfiguration'][_0x7254('0x102')](db['ZendeskField'],{'as':'Descriptions','foreignKey':_0x7254('0x19e')});db[_0x7254('0xad')][_0x7254('0x102')](db[_0x7254('0x1a5')],{'as':_0x7254('0x196'),'foreignKey':_0x7254('0x19d')});db[_0x7254('0xad')][_0x7254('0x110')](db['ZendeskAccount'],{'as':_0x7254('0x151'),'foreignKey':_0x7254('0x199')});db[_0x7254('0xad')][_0x7254('0x112')](db[_0x7254('0x88')],{'through':'int_zendesk_configuration_has_tags'});db['ZendeskField'][_0x7254('0x102')](db[_0x7254('0x1a5')],{'as':_0x7254('0x1a0'),'foreignKey':_0x7254('0x19b')});db[_0x7254('0x1a5')][_0x7254('0x102')](db[_0x7254('0x1a5')],{'as':_0x7254('0x1a1'),'foreignKey':_0x7254('0x19e')});db[_0x7254('0x1a5')]['hasMany'](db[_0x7254('0x1a5')],{'as':'Field','foreignKey':_0x7254('0x19d')});db['ZendeskField'][_0x7254('0x110')](db[_0x7254('0x8d')],{'as':_0x7254('0x8d'),'foreignKey':'VariableId'});db[_0x7254('0x1a6')]['hasMany'](db['FreshdeskConfiguration'],{'as':_0x7254('0x198'),'onDelete':'cascade','foreignKey':_0x7254('0x199')});db['FreshdeskConfiguration'][_0x7254('0x102')](db[_0x7254('0x1a7')],{'as':_0x7254('0x19a'),'onDelete':_0x7254('0xff'),'foreignKey':_0x7254('0x19b')});db['FreshdeskConfiguration'][_0x7254('0x102')](db[_0x7254('0x1a7')],{'as':'Descriptions','onDelete':_0x7254('0xff'),'foreignKey':_0x7254('0x19e')});db[_0x7254('0x1a8')][_0x7254('0x102')](db[_0x7254('0x1a7')],{'as':_0x7254('0x196'),'onDelete':_0x7254('0xff'),'foreignKey':_0x7254('0x19d')});db[_0x7254('0x1a8')][_0x7254('0x110')](db[_0x7254('0x1a6')],{'as':'Account','foreignKey':_0x7254('0x199')});db[_0x7254('0x1a8')]['belongsToMany'](db[_0x7254('0x88')],{'through':_0x7254('0x1a9')});db[_0x7254('0x1a7')][_0x7254('0x102')](db[_0x7254('0x1a7')],{'as':_0x7254('0x1a0'),'foreignKey':'SubjectId'});db[_0x7254('0x1a7')][_0x7254('0x102')](db[_0x7254('0x1a7')],{'as':_0x7254('0x1a1'),'foreignKey':_0x7254('0x19e')});db[_0x7254('0x1a7')]['hasMany'](db[_0x7254('0x1a7')],{'as':'Field','foreignKey':_0x7254('0x19d')});db[_0x7254('0x1a7')][_0x7254('0x110')](db[_0x7254('0x8d')],{'as':_0x7254('0x8d'),'foreignKey':_0x7254('0x1a2')});db[_0x7254('0x1aa')][_0x7254('0x102')](db[_0x7254('0xb1')],{'as':_0x7254('0x198'),'onDelete':'cascade','foreignKey':_0x7254('0x199')});db['VtigerConfiguration'][_0x7254('0x102')](db['VtigerField'],{'as':_0x7254('0x19a'),'foreignKey':_0x7254('0x19b')});db['VtigerConfiguration'][_0x7254('0x102')](db['VtigerField'],{'as':_0x7254('0x19c'),'foreignKey':'DescriptionId'});db[_0x7254('0xb1')][_0x7254('0x102')](db[_0x7254('0xb2')],{'as':_0x7254('0x196'),'foreignKey':_0x7254('0x19d')});db[_0x7254('0xb1')][_0x7254('0x110')](db[_0x7254('0x1aa')],{'as':'Account','foreignKey':_0x7254('0x199')});db[_0x7254('0xb2')]['hasMany'](db[_0x7254('0xb2')],{'as':_0x7254('0x1a0'),'foreignKey':_0x7254('0x19b')});db['VtigerField'][_0x7254('0x102')](db[_0x7254('0xb2')],{'as':'Description','foreignKey':_0x7254('0x19e')});db[_0x7254('0xb2')]['hasMany'](db[_0x7254('0xb2')],{'as':_0x7254('0x19f'),'foreignKey':_0x7254('0x19d')});db['VtigerField']['belongsTo'](db[_0x7254('0x8d')],{'as':_0x7254('0x8d'),'foreignKey':_0x7254('0x1a2')});db[_0x7254('0xb4')][_0x7254('0x102')](db[_0x7254('0x1ab')],{'as':_0x7254('0x198'),'onDelete':_0x7254('0xff'),'foreignKey':_0x7254('0x199')});db[_0x7254('0x1ab')][_0x7254('0x102')](db['ServicenowField'],{'as':_0x7254('0x19a'),'foreignKey':_0x7254('0x19b')});db[_0x7254('0x1ab')][_0x7254('0x102')](db['ServicenowField'],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x7254('0x1ab')][_0x7254('0x102')](db['ServicenowField'],{'as':_0x7254('0x196'),'foreignKey':_0x7254('0x19d')});db[_0x7254('0x1ab')][_0x7254('0x110')](db[_0x7254('0xb4')],{'as':_0x7254('0x151'),'foreignKey':_0x7254('0x199')});db['ServicenowField']['hasMany'](db[_0x7254('0xb7')],{'as':'Subject','foreignKey':_0x7254('0x19b')});db['ServicenowField'][_0x7254('0x102')](db[_0x7254('0xb7')],{'as':_0x7254('0x1a1'),'foreignKey':_0x7254('0x19e')});db[_0x7254('0xb7')][_0x7254('0x102')](db[_0x7254('0xb7')],{'as':_0x7254('0x19f'),'foreignKey':_0x7254('0x19d')});db['ServicenowField'][_0x7254('0x110')](db[_0x7254('0x8d')],{'as':'Variable','foreignKey':_0x7254('0x1a2')});db['Dynamics365Account'][_0x7254('0x102')](db[_0x7254('0xb9')],{'as':_0x7254('0x198'),'onDelete':_0x7254('0xff'),'foreignKey':_0x7254('0x199')});db[_0x7254('0xb9')][_0x7254('0x102')](db[_0x7254('0x1ac')],{'as':_0x7254('0x19a'),'onDelete':_0x7254('0xff'),'foreignKey':_0x7254('0x19b')});db[_0x7254('0xb9')][_0x7254('0x102')](db[_0x7254('0x1ac')],{'as':_0x7254('0x19c'),'onDelete':_0x7254('0xff'),'foreignKey':_0x7254('0x19e')});db[_0x7254('0xb9')][_0x7254('0x102')](db[_0x7254('0x1ac')],{'as':'Fields','onDelete':_0x7254('0xff'),'foreignKey':_0x7254('0x19d')});db[_0x7254('0xb9')][_0x7254('0x110')](db[_0x7254('0x1ad')],{'as':_0x7254('0x151'),'foreignKey':'AccountId'});db[_0x7254('0x1ac')][_0x7254('0x102')](db['Dynamics365Field'],{'as':_0x7254('0x1a0'),'foreignKey':'SubjectId'});db['Dynamics365Field']['hasMany'](db['Dynamics365Field'],{'as':'Description','foreignKey':_0x7254('0x19e')});db[_0x7254('0x1ac')][_0x7254('0x102')](db['Dynamics365Field'],{'as':_0x7254('0x19f'),'foreignKey':_0x7254('0x19d')});db[_0x7254('0x1ac')]['belongsTo'](db[_0x7254('0x8d')],{'as':'Variable','foreignKey':_0x7254('0x1a2')});db['FreshsalesAccount'][_0x7254('0x102')](db[_0x7254('0x1ae')],{'as':'Configurations','onDelete':_0x7254('0xff'),'foreignKey':_0x7254('0x199')});db['FreshsalesConfiguration'][_0x7254('0x102')](db['FreshsalesField'],{'as':_0x7254('0x19a'),'foreignKey':_0x7254('0x19b')});db[_0x7254('0x1ae')][_0x7254('0x102')](db['FreshsalesField'],{'as':_0x7254('0x19c'),'foreignKey':_0x7254('0x19e')});db['FreshsalesConfiguration'][_0x7254('0x102')](db[_0x7254('0xbc')],{'as':_0x7254('0x196'),'foreignKey':'FieldId'});db[_0x7254('0x1ae')]['belongsTo'](db[_0x7254('0x1af')],{'as':_0x7254('0x151'),'foreignKey':'AccountId'});db[_0x7254('0xbc')]['hasMany'](db[_0x7254('0xbc')],{'as':_0x7254('0x1a0'),'foreignKey':_0x7254('0x19b')});db[_0x7254('0xbc')][_0x7254('0x102')](db[_0x7254('0xbc')],{'as':_0x7254('0x1a1'),'foreignKey':'DescriptionId'});db['FreshsalesField'][_0x7254('0x102')](db[_0x7254('0xbc')],{'as':_0x7254('0x19f'),'foreignKey':_0x7254('0x19d')});db['FreshsalesField'][_0x7254('0x110')](db[_0x7254('0x8d')],{'as':_0x7254('0x8d'),'foreignKey':'VariableId'});db[_0x7254('0xbf')][_0x7254('0x110')](db[_0x7254('0x123')],{});db[_0x7254('0xbf')]['belongsTo'](db[_0x7254('0xe5')],{'as':_0x7254('0x14b'),'foreignKey':'ListId'});db[_0x7254('0xbf')][_0x7254('0x110')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x7254('0xbf')]['belongsTo'](db[_0x7254('0x108')],{});db['ChatQueueReport'][_0x7254('0x110')](db[_0x7254('0x67')],{});db[_0x7254('0xbf')][_0x7254('0x110')](db[_0x7254('0x12')],{});db[_0x7254('0xbf')]['belongsTo'](db[_0x7254('0x6a')],{});db['ChatInternalMessage'][_0x7254('0x110')](db[_0x7254('0x12')],{'onDelete':_0x7254('0xff'),'foreignKey':_0x7254('0x1b0')});db[_0x7254('0x175')][_0x7254('0x110')](db[_0x7254('0x12')],{'onDelete':_0x7254('0xff'),'foreignKey':_0x7254('0x1b1')});db[_0x7254('0xc4')][_0x7254('0x102')](db[_0x7254('0xc3')],{'foreignKey':_0x7254('0x1b2'),'onDelete':_0x7254('0xff')});db[_0x7254('0xc4')]['hasMany'](db[_0x7254('0x1b3')],{'foreignKey':_0x7254('0x1b2'),'onDelete':_0x7254('0xff')});db['SmsQueueReport'][_0x7254('0x110')](db[_0x7254('0x54')],{});db[_0x7254('0xc6')]['belongsTo'](db[_0x7254('0xe5')],{'as':_0x7254('0x14b'),'foreignKey':'ListId'});db['SmsQueueReport'][_0x7254('0x110')](db[_0x7254('0x70')],{'as':_0x7254('0x159'),'foreignKey':_0x7254('0x146')});db['SmsQueueReport'][_0x7254('0x110')](db['SmsInteraction'],{});db[_0x7254('0xc6')][_0x7254('0x110')](db['SmsMessage'],{});db['SmsQueueReport'][_0x7254('0x110')](db['User'],{});db[_0x7254('0xc6')][_0x7254('0x110')](db['SmsQueue'],{});db['JscriptyProject'][_0x7254('0x102')](db['JscriptySessionReport'],{'foreignKey':_0x7254('0x1b4')});db[_0x7254('0xca')][_0x7254('0x102')](db[_0x7254('0xc3')],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0x7254('0x102')](db[_0x7254('0x1b3')],{'foreignKey':_0x7254('0x1b4')});db['SquareProject'][_0x7254('0x112')](db[_0x7254('0x12')],{'as':_0x7254('0x156'),'through':_0x7254('0x130')});db[_0x7254('0xd6')]['belongsToMany'](db[_0x7254('0x12')],{'as':_0x7254('0x13d'),'through':_0x7254('0x115')});db[_0x7254('0xd6')][_0x7254('0x112')](db[_0x7254('0x1d')],{'through':_0x7254('0xfa'),'as':'VoiceQueues'});db[_0x7254('0xd6')][_0x7254('0x112')](db[_0x7254('0x14f')],{'through':_0x7254('0x150'),'as':_0x7254('0x1b5')});db[_0x7254('0xd6')]['belongsToMany'](db[_0x7254('0x6a')],{'through':_0x7254('0x1b6'),'as':_0x7254('0x11d')});db[_0x7254('0xd6')]['belongsToMany'](db['FaxQueue'],{'through':_0x7254('0x1b7'),'as':'FaxQueues'});db['Team']['belongsToMany'](db[_0x7254('0x11f')],{'through':'team_has_sms_queues','as':_0x7254('0x120')});db[_0x7254('0xd6')]['belongsToMany'](db[_0x7254('0x62')],{'through':_0x7254('0x1b8'),'as':'OpenchannelQueues'});db[_0x7254('0xd6')][_0x7254('0x112')](db[_0x7254('0xf7')],{'through':'team_has_whatsapp_queues','as':_0x7254('0x122')});db[_0x7254('0xd6')]['belongsToMany'](db[_0x7254('0xe6')],{'through':_0x7254('0x1b9'),'as':_0x7254('0x11b')});db[_0x7254('0xda')][_0x7254('0x102')](db['CmHopper'],{'as':_0x7254('0x135'),'foreignKey':_0x7254('0x17e')});db[_0x7254('0xda')][_0x7254('0x102')](db[_0x7254('0x105')],{'as':_0x7254('0x106'),'foreignKey':_0x7254('0x17e')});db[_0x7254('0xda')][_0x7254('0x102')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0x7254('0x17e')});db[_0x7254('0xda')]['hasMany'](db[_0x7254('0x73')],{'as':_0x7254('0x137'),'foreignKey':'CampaignId'});db[_0x7254('0xda')][_0x7254('0x110')](db[_0x7254('0x138')],{'as':_0x7254('0x138'),'foreignKey':_0x7254('0x1ba')});db[_0x7254('0xda')]['belongsTo'](db[_0x7254('0x138')],{'as':_0x7254('0x1bb'),'foreignKey':_0x7254('0x1bc')});db['Campaign'][_0x7254('0x110')](db[_0x7254('0x80')],{'as':_0x7254('0x80'),'foreignKey':_0x7254('0x139')});db[_0x7254('0xda')][_0x7254('0x110')](db[_0x7254('0xd0')],{'as':_0x7254('0xd0'),'foreignKey':_0x7254('0x1bd')});db['Campaign'][_0x7254('0x112')](db[_0x7254('0xe5')],{'as':_0x7254('0x13b'),'through':_0x7254('0x1be')});db[_0x7254('0xda')][_0x7254('0x112')](db['CmList'],{'as':_0x7254('0x13f'),'through':'campaigns_has_cm_blacklists'});db[_0x7254('0xdd')][_0x7254('0x110')](db[_0x7254('0x68')],{'as':_0x7254('0x68'),'foreignKey':_0x7254('0x15c')});db[_0x7254('0xdf')][_0x7254('0x110')](db['MailMessage'],{});db[_0x7254('0xdf')][_0x7254('0x110')](db['MailInteraction'],{});db[_0x7254('0xdf')][_0x7254('0x110')](db[_0x7254('0x41')],{'foreignKey':'FromMailAccountId','as':_0x7254('0x1bf')});db[_0x7254('0xdf')]['belongsTo'](db[_0x7254('0x12')],{'foreignKey':_0x7254('0x1c0'),'as':_0x7254('0x1c1')});db[_0x7254('0xdf')]['belongsTo'](db['User'],{'foreignKey':_0x7254('0x1c2'),'as':_0x7254('0x1c3')});db[_0x7254('0xdf')][_0x7254('0x110')](db[_0x7254('0x14f')],{'foreignKey':_0x7254('0x1c4'),'as':_0x7254('0x1c5')});db['MailTransferReport']['belongsTo'](db[_0x7254('0x41')],{'foreignKey':_0x7254('0x1c6'),'as':_0x7254('0x1c7')});db[_0x7254('0xe0')][_0x7254('0x110')](db[_0x7254('0x67')],{});db[_0x7254('0xe0')][_0x7254('0x110')](db[_0x7254('0x108')],{});db[_0x7254('0xe0')][_0x7254('0x110')](db['ChatWebsite'],{'foreignKey':_0x7254('0x1c8'),'as':_0x7254('0x1bf')});db[_0x7254('0xe0')]['belongsTo'](db['User'],{'foreignKey':_0x7254('0x1c0'),'as':_0x7254('0x1c1')});db[_0x7254('0xe0')]['belongsTo'](db['User'],{'foreignKey':_0x7254('0x1c2'),'as':_0x7254('0x1c3')});db[_0x7254('0xe0')][_0x7254('0x110')](db[_0x7254('0x6a')],{'foreignKey':_0x7254('0x1c9'),'as':_0x7254('0x1c5')});db['ChatTransferReport'][_0x7254('0x110')](db[_0x7254('0x123')],{'foreignKey':_0x7254('0x1ca'),'as':_0x7254('0x1c7')});db['FaxTransferReport'][_0x7254('0x110')](db[_0x7254('0x50')],{});db[_0x7254('0x1cb')]['belongsTo'](db['FaxInteraction'],{});db['FaxTransferReport'][_0x7254('0x110')](db['FaxAccount'],{'foreignKey':_0x7254('0x1cc'),'as':_0x7254('0x1bf')});db[_0x7254('0x1cb')][_0x7254('0x110')](db[_0x7254('0x12')],{'foreignKey':'FromUserId','as':_0x7254('0x1c1')});db['FaxTransferReport'][_0x7254('0x110')](db[_0x7254('0x12')],{'foreignKey':_0x7254('0x1c2'),'as':_0x7254('0x1c3')});db['FaxTransferReport']['belongsTo'](db[_0x7254('0x51')],{'foreignKey':_0x7254('0x1cd'),'as':_0x7254('0x1c5')});db[_0x7254('0x1cb')][_0x7254('0x110')](db[_0x7254('0x4d')],{'foreignKey':'ToFaxAccountId','as':'ToAccount'});db[_0x7254('0xe3')]['belongsTo'](db[_0x7254('0x60')],{});db[_0x7254('0xe3')][_0x7254('0x110')](db[_0x7254('0x5e')],{});db['OpenchannelTransferReport']['belongsTo'](db[_0x7254('0x5b')],{'foreignKey':'FromOpenchannelAccountId','as':_0x7254('0x1bf')});db[_0x7254('0xe3')][_0x7254('0x110')](db[_0x7254('0x12')],{'foreignKey':_0x7254('0x1c0'),'as':_0x7254('0x1c1')});db[_0x7254('0xe3')][_0x7254('0x110')](db[_0x7254('0x12')],{'foreignKey':'ToUserId','as':_0x7254('0x1c3')});db[_0x7254('0xe3')][_0x7254('0x110')](db[_0x7254('0x62')],{'foreignKey':_0x7254('0x1ce'),'as':_0x7254('0x1c5')});db[_0x7254('0xe3')][_0x7254('0x110')](db[_0x7254('0x5b')],{'foreignKey':'ToOpenchannelAccountId','as':_0x7254('0x1c7')});db[_0x7254('0x1cf')][_0x7254('0x110')](db[_0x7254('0x168')],{});db['SmsTransferReport'][_0x7254('0x110')](db[_0x7254('0x58')],{});db[_0x7254('0x1cf')][_0x7254('0x110')](db[_0x7254('0x54')],{'foreignKey':_0x7254('0x1d0'),'as':_0x7254('0x1bf')});db['SmsTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x7254('0x1c0'),'as':'FromAgent'});db[_0x7254('0x1cf')][_0x7254('0x110')](db[_0x7254('0x12')],{'foreignKey':'ToUserId','as':_0x7254('0x1c3')});db['SmsTransferReport'][_0x7254('0x110')](db[_0x7254('0x11f')],{'foreignKey':_0x7254('0x1d1'),'as':_0x7254('0x1c5')});db['SmsTransferReport']['belongsTo'](db[_0x7254('0x54')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db[_0x7254('0xe5')][_0x7254('0x102')](db['Disposition'],{'as':_0x7254('0x149'),'foreignKey':_0x7254('0x14c'),'onDelete':'cascade'});db['CmList'][_0x7254('0x102')](db[_0x7254('0x77')],{'as':'CustomFields','foreignKey':_0x7254('0x14c')});db[_0x7254('0xe5')][_0x7254('0x102')](db[_0x7254('0x70')],{'as':_0x7254('0x1d2'),'onDelete':_0x7254('0xff'),'foreignKey':_0x7254('0x14c')});db[_0x7254('0xe5')][_0x7254('0x102')](db[_0x7254('0x105')],{'as':_0x7254('0x106'),'foreignKey':_0x7254('0x14c')});db[_0x7254('0xe5')][_0x7254('0x102')](db[_0x7254('0x74')],{'as':_0x7254('0x1d3'),'foreignKey':_0x7254('0x14c')});db[_0x7254('0xe5')]['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':'ListId'});db['CmList'][_0x7254('0x112')](db[_0x7254('0x1d')],{'as':_0x7254('0x1d4'),'through':'voice_queues_has_cm_lists'});db['CmList']['belongsToMany'](db['User'],{'as':_0x7254('0x13d'),'through':_0x7254('0x114')});db[_0x7254('0xe6')]['hasMany'](db['VoiceExtension'],{'as':_0x7254('0x104'),'onDelete':_0x7254('0xff')});db['VoicePrefix']['belongsToMany'](db[_0x7254('0x12')],{'as':_0x7254('0x13d'),'through':_0x7254('0x11c')});db[_0x7254('0xe6')]['belongsToMany'](db['Team'],{'through':_0x7254('0x1b9'),'as':'Teams'});db[_0x7254('0xe8')][_0x7254('0x102')](db[_0x7254('0x12')],{'as':_0x7254('0x156'),'foreignKey':_0x7254('0x111')});db['UserProfile'][_0x7254('0x102')](db[_0x7254('0xea')],{'as':_0x7254('0x1d5'),'foreignKey':'userProfileId','onDelete':_0x7254('0xff')});db[_0x7254('0xea')]['hasMany'](db[_0x7254('0x1d6')],{'as':'Resources','foreignKey':_0x7254('0x1d7'),'onDelete':_0x7254('0xff')});db[_0x7254('0xed')]['hasMany'](db[_0x7254('0x7d')],{'as':_0x7254('0x149'),'foreignKey':_0x7254('0x1d8'),'onDelete':_0x7254('0xff')});db[_0x7254('0xed')][_0x7254('0x102')](db['CannedAnswer'],{'as':_0x7254('0x162'),'foreignKey':_0x7254('0x1d8')});db[_0x7254('0xed')]['hasMany'](db[_0x7254('0xf1')],{'as':_0x7254('0x140'),'foreignKey':_0x7254('0x1d8')});db[_0x7254('0xed')][_0x7254('0x102')](db[_0x7254('0xef')],{'as':_0x7254('0x14a')});db[_0x7254('0xed')]['hasMany'](db['WhatsappApplication'],{'as':_0x7254('0x132')});db['WhatsappAccount'][_0x7254('0x110')](db[_0x7254('0xe5')],{'as':'List','foreignKey':_0x7254('0x14c')});db[_0x7254('0xed')]['belongsTo'](db[_0x7254('0x81')],{'as':_0x7254('0x13a'),'foreignKey':_0x7254('0x169')});db['WhatsappAccount']['belongsToMany'](db[_0x7254('0x12')],{'as':'Agents','through':'user_has_whatsapp_accounts'});db['WhatsappApplication'][_0x7254('0x110')](db['User'],{'onDelete':_0x7254('0x15d')});db[_0x7254('0xee')][_0x7254('0x110')](db[_0x7254('0xf7')],{'onDelete':'restrict'});db['WhatsappApplication']['belongsTo'](db[_0x7254('0xed')],{'onDelete':'restrict'});db['WhatsappApplication'][_0x7254('0x110')](db[_0x7254('0x80')],{'onDelete':_0x7254('0x15d'),'foreignKey':'IntervalId'});db['WhatsappApplication'][_0x7254('0x110')](db[_0x7254('0x88')],{'onDelete':_0x7254('0x15d'),'foreignKey':'TagId'});db[_0x7254('0xef')][_0x7254('0x102')](db['WhatsappMessage'],{'as':_0x7254('0x140'),'onDelete':_0x7254('0xff'),'foreignKey':_0x7254('0x1d9')});db[_0x7254('0xef')][_0x7254('0x110')](db['WhatsappAccount'],{'as':_0x7254('0x151'),'foreignKey':'WhatsappAccountId'});db[_0x7254('0xef')]['belongsTo'](db['CmContact'],{'as':_0x7254('0x159'),'foreignKey':'ContactId'});db[_0x7254('0xef')][_0x7254('0x110')](db[_0x7254('0x12')],{'as':'Owner','foreignKey':'UserId'});db[_0x7254('0xef')]['belongsToMany'](db[_0x7254('0x88')],{'through':_0x7254('0x18f'),'as':_0x7254('0x154')});db[_0x7254('0xef')][_0x7254('0x112')](db[_0x7254('0x88')],{'through':_0x7254('0x18f'),'as':_0x7254('0x155')});db[_0x7254('0xef')][_0x7254('0x112')](db[_0x7254('0x12')],{'as':_0x7254('0x156'),'through':_0x7254('0x1da'),'foreignKey':_0x7254('0x1d9')});db[_0x7254('0xf1')]['belongsTo'](db[_0x7254('0x12')],{'as':_0x7254('0x12')});db[_0x7254('0xf1')][_0x7254('0x110')](db[_0x7254('0x70')],{'onDelete':_0x7254('0xff'),'as':_0x7254('0x159')});db[_0x7254('0xf1')][_0x7254('0x110')](db[_0x7254('0xef')],{'onDelete':_0x7254('0xff'),'as':_0x7254('0x15a'),'foreignKey':_0x7254('0x1d9')});db['WhatsappMessage'][_0x7254('0x110')](db[_0x7254('0xed')],{'as':_0x7254('0x151'),'foreignKey':_0x7254('0x1d8')});db[_0x7254('0xf3')][_0x7254('0x110')](db[_0x7254('0xed')],{});db['WhatsappQueueReport']['belongsTo'](db[_0x7254('0xe5')],{'as':_0x7254('0x14b'),'foreignKey':_0x7254('0x14c')});db[_0x7254('0xf3')][_0x7254('0x110')](db['CmContact'],{'as':'Contact','foreignKey':_0x7254('0x146')});db[_0x7254('0xf3')][_0x7254('0x110')](db[_0x7254('0xef')],{});db[_0x7254('0xf3')][_0x7254('0x110')](db['WhatsappQueue'],{});db[_0x7254('0xf3')][_0x7254('0x110')](db[_0x7254('0xf1')],{});db[_0x7254('0xf3')][_0x7254('0x110')](db[_0x7254('0x12')],{});db[_0x7254('0xf5')][_0x7254('0x110')](db['WhatsappMessage'],{});db[_0x7254('0xf5')][_0x7254('0x110')](db[_0x7254('0xef')],{});db[_0x7254('0xf5')][_0x7254('0x110')](db[_0x7254('0xed')],{'foreignKey':_0x7254('0x1db'),'as':_0x7254('0x1bf')});db[_0x7254('0xf5')][_0x7254('0x110')](db[_0x7254('0xed')],{'foreignKey':'ToWhatsappAccountId','as':_0x7254('0x1c7')});db[_0x7254('0xf5')][_0x7254('0x110')](db['WhatsappQueue'],{'foreignKey':_0x7254('0x1dc'),'as':_0x7254('0x1c5')});db[_0x7254('0xf5')][_0x7254('0x110')](db['User'],{'foreignKey':'FromUserId','as':_0x7254('0x1c1')});db[_0x7254('0xf5')]['belongsTo'](db[_0x7254('0x12')],{'foreignKey':_0x7254('0x1c2'),'as':_0x7254('0x1c3')});db[_0x7254('0xf7')][_0x7254('0x112')](db['User'],{'as':'Agents','through':_0x7254('0x3d'),'foreignKey':_0x7254('0x1dd')});db['WhatsappQueue'][_0x7254('0x112')](db[_0x7254('0xd6')],{'through':_0x7254('0x1de'),'as':_0x7254('0x13e')});module[_0x7254('0x1df')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 4eb4594..48312f2 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x43a2=['/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/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/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/version','/api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','root','/www','join','/demo','/snippet','snippet','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','username','password','newPassword','apiKey','street','fax','email','clientSecret','code','tenantId','token','channelSecret','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridname','privateKey','secretaccesskey','key','pass','accountSid','localstationid','secret','oldPassword','isPlainObject','isArray','length','isString','replace','}@@','includes','path','express','express-winston','./errors','./config/logger','api','auth','safeTemplate','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','role','use','logger','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)','name','other','agent_name','test','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','./api/voiceAgentReport','./api/voiceQueueReport','/api/trunks','./api/trunk','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','./api/mailQueue','./api/mailSubstatus','/api/mail/messages','./api/mailMessage','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/interactions','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation'];(function(_0x2ff252,_0x222a1b){var _0x327741=function(_0x250617){while(--_0x250617){_0x2ff252['push'](_0x2ff252['shift']());}};_0x327741(++_0x222a1b);}(_0x43a2,0xd0));var _0x243a=function(_0x210347,_0x4ab537){_0x210347=_0x210347-0x0;var _0x5bb046=_0x43a2[_0x210347];return _0x5bb046;};'use strict';var _=require('lodash');var path=require(_0x243a('0x0'));var express=require(_0x243a('0x1'));var ewinston=require(_0x243a('0x2'));var util=require('util');var errors=require(_0x243a('0x3'));var config=require('./config/environment');var logger=require(_0x243a('0x4'))(_0x243a('0x5'));var authLogger=require(_0x243a('0x4'))(_0x243a('0x6'));var safeTemplate=require('./safe-template')[_0x243a('0x7')];exports['default']=function(_0x5c9192){_0x5c9192['use'](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x59e0db,_0x339c47){var _0xcaef6f=_0x243a('0x8');if(!_[_0x243a('0x9')](_0x59e0db[_0x243a('0xa')])){_0xcaef6f+=_0x243a('0xb');var _0x5a1f51=_0x59e0db['body'];maskSensitiveData(_0x5a1f51);}return safeTemplate(util[_0x243a('0xc')](_0xcaef6f,_0x59e0db[_0x243a('0xd')],_0x59e0db[_0x243a('0xe')][_0x243a('0xf')]?_0x59e0db[_0x243a('0xe')][_0x243a('0xf')]:_0x59e0db[_0x243a('0x10')][_0x243a('0x11')]||_0x59e0db['ip'],_0x59e0db[_0x243a('0x12')],_0x339c47[_0x243a('0x13')],_0x339c47[_0x243a('0x14')],_0x59e0db[_0x243a('0x15')]?_0x59e0db[_0x243a('0x15')]['id']:null,_0x59e0db[_0x243a('0x15')]?_0x59e0db[_0x243a('0x15')]['name']:null,_0x59e0db[_0x243a('0x15')]?_0x59e0db[_0x243a('0x15')][_0x243a('0x16')]:null,_0x5a1f51?util['inspect'](_0x5a1f51,![],null):''));}}));_0x5c9192[_0x243a('0x17')](ewinston[_0x243a('0x18')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0xca2ec6,_0x3965e8){var _0x505bf2='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0xca2ec6[_0x243a('0xa')]&&_0xca2ec6[_0x243a('0xa')][_0x243a('0x19')]&&_0xca2ec6['body'][_0x243a('0x1a')]){_0x505bf2=_0x243a('0x1b');}return util[_0x243a('0xc')](_0x505bf2,_0xca2ec6[_0x243a('0xd')],_0xca2ec6[_0x243a('0xe')][_0x243a('0xf')]?_0xca2ec6[_0x243a('0xe')][_0x243a('0xf')]:_0xca2ec6[_0x243a('0x10')][_0x243a('0x11')]||_0xca2ec6['ip'],_0xca2ec6[_0x243a('0x12')],_0x3965e8[_0x243a('0x13')],_0x3965e8[_0x243a('0x14')],_0xca2ec6[_0x243a('0x15')]?_0xca2ec6[_0x243a('0x15')]['id']:null,_0xca2ec6[_0x243a('0x15')]?_0xca2ec6[_0x243a('0x15')][_0x243a('0x1c')]:null,_0xca2ec6['user']?_0xca2ec6[_0x243a('0x15')][_0x243a('0x16')]:null,_0xca2ec6[_0x243a('0xa')]&&_0xca2ec6[_0x243a('0xa')][_0x243a('0x19')]?_0xca2ec6[_0x243a('0xa')]['device']:_0x243a('0x1d'),_0xca2ec6[_0x243a('0xa')]&&_0xca2ec6[_0x243a('0xa')][_0x243a('0x1a')]?_0xca2ec6[_0x243a('0xa')]['agent_id']:'',_0xca2ec6[_0x243a('0xa')]&&_0xca2ec6[_0x243a('0xa')][_0x243a('0x1e')]?_0xca2ec6[_0x243a('0xa')][_0x243a('0x1e')]:'');},'ignoreRoute':function(_0x310b30){var _0x4ee41e=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4ee41e[_0x243a('0x1f')](_0x310b30[_0x243a('0x12')]);}}));_0x5c9192[_0x243a('0x17')]('/api/users',require('./api/user'));_0x5c9192[_0x243a('0x17')]('/api/voice/chanspy',require(_0x243a('0x20')));_0x5c9192[_0x243a('0x17')](_0x243a('0x21'),require(_0x243a('0x22')));_0x5c9192[_0x243a('0x17')](_0x243a('0x23'),require(_0x243a('0x24')));_0x5c9192[_0x243a('0x17')](_0x243a('0x25'),require('./api/voiceMusicOnHold'));_0x5c9192[_0x243a('0x17')](_0x243a('0x26'),require(_0x243a('0x27')));_0x5c9192[_0x243a('0x17')]('/api/voice/recordings',require(_0x243a('0x28')));_0x5c9192[_0x243a('0x17')](_0x243a('0x29'),require(_0x243a('0x2a')));_0x5c9192['use'](_0x243a('0x2b'),require(_0x243a('0x2c')));_0x5c9192[_0x243a('0x17')](_0x243a('0x2d'),require(_0x243a('0x2e')));_0x5c9192[_0x243a('0x17')](_0x243a('0x2f'),require(_0x243a('0x30')));_0x5c9192[_0x243a('0x17')]('/api/voice/dials/reports',require(_0x243a('0x31')));_0x5c9192[_0x243a('0x17')]('/api/voice/agents/reports',require(_0x243a('0x32')));_0x5c9192[_0x243a('0x17')]('/api/voice/queues/reports',require(_0x243a('0x33')));_0x5c9192[_0x243a('0x17')]('/api/members/reports',require('./api/memberReport'));_0x5c9192[_0x243a('0x17')](_0x243a('0x34'),require(_0x243a('0x35')));_0x5c9192[_0x243a('0x17')]('/api/voice/transfers/reports',require(_0x243a('0x36')));_0x5c9192[_0x243a('0x17')]('/api/mail/out_servers',require(_0x243a('0x37')));_0x5c9192[_0x243a('0x17')](_0x243a('0x38'),require(_0x243a('0x39')));_0x5c9192[_0x243a('0x17')]('/api/mail/queues',require(_0x243a('0x3a')));_0x5c9192[_0x243a('0x17')]('/api/mail/substatuses',require(_0x243a('0x3b')));_0x5c9192[_0x243a('0x17')]('/api/mail/interactions',require('./api/mailInteraction'));_0x5c9192[_0x243a('0x17')](_0x243a('0x3c'),require(_0x243a('0x3d')));_0x5c9192[_0x243a('0x17')]('/api/mail/applications',require('./api/mailApplication'));_0x5c9192[_0x243a('0x17')](_0x243a('0x3e'),require(_0x243a('0x3f')));_0x5c9192[_0x243a('0x17')]('/api/dashboards',require(_0x243a('0x40')));_0x5c9192[_0x243a('0x17')](_0x243a('0x41'),require(_0x243a('0x42')));_0x5c9192['use'](_0x243a('0x43'),require(_0x243a('0x44')));_0x5c9192[_0x243a('0x17')](_0x243a('0x45'),require(_0x243a('0x46')));_0x5c9192[_0x243a('0x17')](_0x243a('0x47'),require(_0x243a('0x48')));_0x5c9192[_0x243a('0x17')]('/api/fax/messages',require(_0x243a('0x49')));_0x5c9192[_0x243a('0x17')](_0x243a('0x4a'),require('./api/faxQueue'));_0x5c9192[_0x243a('0x17')]('/api/fax/reports/queue',require(_0x243a('0x4b')));_0x5c9192[_0x243a('0x17')](_0x243a('0x4c'),require('./api/smsAccount'));_0x5c9192[_0x243a('0x17')](_0x243a('0x4d'),require(_0x243a('0x4e')));_0x5c9192[_0x243a('0x17')](_0x243a('0x4f'),require(_0x243a('0x50')));_0x5c9192[_0x243a('0x17')]('/api/sms/messages',require(_0x243a('0x51')));_0x5c9192[_0x243a('0x17')]('/api/sms/queues',require(_0x243a('0x52')));_0x5c9192[_0x243a('0x17')](_0x243a('0x53'),require(_0x243a('0x54')));_0x5c9192[_0x243a('0x17')](_0x243a('0x55'),require(_0x243a('0x56')));_0x5c9192[_0x243a('0x17')](_0x243a('0x57'),require(_0x243a('0x58')));_0x5c9192['use'](_0x243a('0x59'),require(_0x243a('0x5a')));_0x5c9192['use'](_0x243a('0x5b'),require(_0x243a('0x5c')));_0x5c9192[_0x243a('0x17')](_0x243a('0x5d'),require(_0x243a('0x5e')));_0x5c9192['use'](_0x243a('0x5f'),require(_0x243a('0x60')));_0x5c9192[_0x243a('0x17')]('/api/chat/applications',require('./api/chatApplication'));_0x5c9192[_0x243a('0x17')](_0x243a('0x61'),require('./api/chatInteraction'));_0x5c9192[_0x243a('0x17')](_0x243a('0x62'),require(_0x243a('0x63')));_0x5c9192['use']('/api/chat/offline_messages',require(_0x243a('0x64')));_0x5c9192[_0x243a('0x17')](_0x243a('0x65'),require(_0x243a('0x66')));_0x5c9192['use'](_0x243a('0x67'),require(_0x243a('0x68')));_0x5c9192[_0x243a('0x17')]('/api/chat/proactive_actions',require(_0x243a('0x69')));_0x5c9192['use']('/api/cm/companies',require(_0x243a('0x6a')));_0x5c9192[_0x243a('0x17')](_0x243a('0x6b'),require(_0x243a('0x6c')));_0x5c9192['use'](_0x243a('0x6d'),require(_0x243a('0x6e')));_0x5c9192[_0x243a('0x17')](_0x243a('0x6f'),require(_0x243a('0x70')));_0x5c9192['use'](_0x243a('0x71'),require(_0x243a('0x72')));_0x5c9192[_0x243a('0x17')]('/api/cm/hopper_history',require('./api/cmHopperHistory'));_0x5c9192[_0x243a('0x17')](_0x243a('0x73'),require(_0x243a('0x74')));_0x5c9192[_0x243a('0x17')](_0x243a('0x75'),require(_0x243a('0x76')));_0x5c9192[_0x243a('0x17')](_0x243a('0x77'),require(_0x243a('0x78')));_0x5c9192[_0x243a('0x17')](_0x243a('0x79'),require(_0x243a('0x7a')));_0x5c9192[_0x243a('0x17')](_0x243a('0x7b'),require(_0x243a('0x7c')));_0x5c9192['use'](_0x243a('0x7d'),require(_0x243a('0x7e')));_0x5c9192['use'](_0x243a('0x7f'),require(_0x243a('0x80')));_0x5c9192[_0x243a('0x17')](_0x243a('0x81'),require(_0x243a('0x82')));_0x5c9192[_0x243a('0x17')](_0x243a('0x83'),require('./api/cdr'));_0x5c9192[_0x243a('0x17')](_0x243a('0x84'),require(_0x243a('0x85')));_0x5c9192['use'](_0x243a('0x86'),require(_0x243a('0x87')));_0x5c9192[_0x243a('0x17')](_0x243a('0x88'),require(_0x243a('0x89')));_0x5c9192[_0x243a('0x17')](_0x243a('0x8a'),require('./api/tag'));_0x5c9192[_0x243a('0x17')](_0x243a('0x8b'),require(_0x243a('0x8c')));_0x5c9192[_0x243a('0x17')](_0x243a('0x8d'),require(_0x243a('0x8e')));_0x5c9192[_0x243a('0x17')](_0x243a('0x8f'),require('./api/variable'));_0x5c9192[_0x243a('0x17')](_0x243a('0x90'),require(_0x243a('0x91')));_0x5c9192[_0x243a('0x17')](_0x243a('0x92'),require(_0x243a('0x93')));_0x5c9192['use'](_0x243a('0x94'),require('./api/analyticCustomReport'));_0x5c9192['use'](_0x243a('0x95'),require('./api/analyticDefaultReport'));_0x5c9192[_0x243a('0x17')](_0x243a('0x96'),require(_0x243a('0x97')));_0x5c9192[_0x243a('0x17')](_0x243a('0x98'),require(_0x243a('0x99')));_0x5c9192[_0x243a('0x17')](_0x243a('0x9a'),require(_0x243a('0x9b')));_0x5c9192[_0x243a('0x17')]('/api/analytics/tree_reports',require(_0x243a('0x9c')));_0x5c9192[_0x243a('0x17')](_0x243a('0x9d'),require('./api/intSalesforceAccount'));_0x5c9192[_0x243a('0x17')](_0x243a('0x9e'),require(_0x243a('0x9f')));_0x5c9192[_0x243a('0x17')]('/api/integrations/salesforce/fields',require('./api/intSalesforceField'));_0x5c9192['use'](_0x243a('0xa0'),require(_0x243a('0xa1')));_0x5c9192[_0x243a('0x17')]('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0x5c9192[_0x243a('0x17')](_0x243a('0xa2'),require(_0x243a('0xa3')));_0x5c9192['use'](_0x243a('0xa4'),require(_0x243a('0xa5')));_0x5c9192[_0x243a('0x17')]('/api/integrations/desk/configurations',require(_0x243a('0xa6')));_0x5c9192[_0x243a('0x17')](_0x243a('0xa7'),require(_0x243a('0xa8')));_0x5c9192['use'](_0x243a('0xa9'),require('./api/intZohoAccount'));_0x5c9192['use'](_0x243a('0xaa'),require(_0x243a('0xab')));_0x5c9192[_0x243a('0x17')](_0x243a('0xac'),require(_0x243a('0xad')));_0x5c9192[_0x243a('0x17')](_0x243a('0xae'),require(_0x243a('0xaf')));_0x5c9192['use'](_0x243a('0xb0'),require(_0x243a('0xb1')));_0x5c9192[_0x243a('0x17')](_0x243a('0xb2'),require(_0x243a('0xb3')));_0x5c9192[_0x243a('0x17')]('/api/integrations/freshdesk/accounts',require('./api/intFreshdeskAccount'));_0x5c9192[_0x243a('0x17')](_0x243a('0xb4'),require(_0x243a('0xb5')));_0x5c9192['use'](_0x243a('0xb6'),require(_0x243a('0xb7')));_0x5c9192[_0x243a('0x17')]('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0x5c9192['use'](_0x243a('0xb8'),require(_0x243a('0xb9')));_0x5c9192['use'](_0x243a('0xba'),require(_0x243a('0xbb')));_0x5c9192[_0x243a('0x17')]('/api/integrations/servicenow/accounts',require(_0x243a('0xbc')));_0x5c9192[_0x243a('0x17')](_0x243a('0xbd'),require(_0x243a('0xbe')));_0x5c9192[_0x243a('0x17')]('/api/integrations/servicenow/fields',require(_0x243a('0xbf')));_0x5c9192[_0x243a('0x17')]('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0x5c9192['use']('/api/integrations/dynamics365/configurations',require(_0x243a('0xc0')));_0x5c9192['use']('/api/integrations/dynamics365/fields',require(_0x243a('0xc1')));_0x5c9192['use'](_0x243a('0xc2'),require(_0x243a('0xc3')));_0x5c9192[_0x243a('0x17')](_0x243a('0xc4'),require('./api/intFreshsalesConfiguration'));_0x5c9192[_0x243a('0x17')]('/api/integrations/freshsales/fields',require('./api/intFreshsalesField'));_0x5c9192[_0x243a('0x17')]('/api/networks',require(_0x243a('0xc5')));_0x5c9192[_0x243a('0x17')](_0x243a('0xc6'),require('./api/chatQueueReport'));_0x5c9192[_0x243a('0x17')](_0x243a('0xc7'),require(_0x243a('0xc8')));_0x5c9192[_0x243a('0x17')]('/api/jscripty/answers/reports',require(_0x243a('0xc9')));_0x5c9192[_0x243a('0x17')](_0x243a('0xca'),require(_0x243a('0xcb')));_0x5c9192[_0x243a('0x17')]('/api/jscripty/sessions/reports',require(_0x243a('0xcc')));_0x5c9192['use'](_0x243a('0xcd'),require(_0x243a('0xce')));_0x5c9192['use']('/api/square/reports',require(_0x243a('0xcf')));_0x5c9192[_0x243a('0x17')](_0x243a('0xd0'),require(_0x243a('0xd1')));_0x5c9192[_0x243a('0x17')](_0x243a('0xd2'),require(_0x243a('0xd3')));_0x5c9192[_0x243a('0x17')](_0x243a('0xd4'),require('./api/setting'));_0x5c9192['use'](_0x243a('0xd5'),require(_0x243a('0xd6')));_0x5c9192[_0x243a('0x17')](_0x243a('0xd7'),require(_0x243a('0xd8')));_0x5c9192['use'](_0x243a('0xd9'),require(_0x243a('0xda')));_0x5c9192[_0x243a('0x17')](_0x243a('0xdb'),require(_0x243a('0xdc')));_0x5c9192['use'](_0x243a('0xdd'),require(_0x243a('0xde')));_0x5c9192['use'](_0x243a('0xdf'),require(_0x243a('0xe0')));_0x5c9192[_0x243a('0x17')](_0x243a('0xe1'),require(_0x243a('0xe2')));_0x5c9192[_0x243a('0x17')](_0x243a('0xe3'),require(_0x243a('0xe4')));_0x5c9192[_0x243a('0x17')](_0x243a('0xe5'),require(_0x243a('0xe6')));_0x5c9192['use'](_0x243a('0xe7'),require(_0x243a('0xe8')));_0x5c9192[_0x243a('0x17')](_0x243a('0xe9'),require(_0x243a('0xea')));_0x5c9192['use'](_0x243a('0xeb'),require(_0x243a('0xec')));_0x5c9192[_0x243a('0x17')]('/api/fax/reports/transfer',require(_0x243a('0xed')));_0x5c9192[_0x243a('0x17')]('/api/openchannel/reports/transfer',require(_0x243a('0xee')));_0x5c9192[_0x243a('0x17')](_0x243a('0xef'),require('./api/smsTransferReport'));_0x5c9192[_0x243a('0x17')](_0x243a('0xf0'),require(_0x243a('0xf1')));_0x5c9192[_0x243a('0x17')](_0x243a('0xf2'),require(_0x243a('0xf3')));_0x5c9192[_0x243a('0x17')](_0x243a('0xf4'),require(_0x243a('0xf5')));_0x5c9192[_0x243a('0x17')](_0x243a('0xf6'),require(_0x243a('0xf7')));_0x5c9192[_0x243a('0x17')](_0x243a('0xf8'),require(_0x243a('0xf9')));_0x5c9192[_0x243a('0x17')]('/api/userNotifications',require('./api/userNotification'));_0x5c9192['use'](_0x243a('0xfa'),require(_0x243a('0xfb')));_0x5c9192[_0x243a('0x17')](_0x243a('0xfc'),require(_0x243a('0xfd')));_0x5c9192[_0x243a('0x17')]('/api/whatsapp/interactions',require(_0x243a('0xfe')));_0x5c9192[_0x243a('0x17')](_0x243a('0xff'),require(_0x243a('0x100')));_0x5c9192[_0x243a('0x17')](_0x243a('0x101'),require(_0x243a('0x102')));_0x5c9192[_0x243a('0x17')](_0x243a('0x103'),require(_0x243a('0x104')));_0x5c9192[_0x243a('0x17')]('/api/whatsapp/queues',require(_0x243a('0x105')));_0x5c9192[_0x243a('0x17')](_0x243a('0x106'),require(_0x243a('0x107')));_0x5c9192[_0x243a('0x17')](_0x243a('0x108'),require(_0x243a('0x109')));_0x5c9192[_0x243a('0x17')](_0x243a('0x10a'),require(_0x243a('0x10b')));_0x5c9192[_0x243a('0x17')](_0x243a('0x10c'),require(_0x243a('0x10d')));_0x5c9192['use'](_0x243a('0x10e'),require(_0x243a('0x10f')));_0x5c9192[_0x243a('0x17')](_0x243a('0x110'),require(_0x243a('0x111')));_0x5c9192[_0x243a('0x17')]('/api/rpc',require('./api/rpc'));_0x5c9192['use'](_0x243a('0x112'),require('./api/version'));_0x5c9192['use'](_0x243a('0x113'),require('./api/system'));_0x5c9192[_0x243a('0x17')](_0x243a('0x114'),require(_0x243a('0x115')));_0x5c9192['use'](_0x243a('0x116'),require(_0x243a('0x117')));_0x5c9192[_0x243a('0x17')](_0x243a('0x118'),express[_0x243a('0x119')](path['join'](config[_0x243a('0x11a')],_0x243a('0x118'))));_0x5c9192['use'](_0x243a('0x11b'),express[_0x243a('0x119')](path[_0x243a('0x11c')](config[_0x243a('0x11a')],_0x243a('0x11b'))));_0x5c9192['use'](_0x243a('0x11d'),express[_0x243a('0x119')](path[_0x243a('0x11c')](config[_0x243a('0x11a')],_0x243a('0x11d'))));_0x5c9192['use'](_0x243a('0x11e'),express['static'](path[_0x243a('0x11c')](config[_0x243a('0x11a')],_0x243a('0x11f'),'3.0.0')));_0x5c9192[_0x243a('0x17')](_0x243a('0x120'),express[_0x243a('0x119')](path[_0x243a('0x11c')](config[_0x243a('0x11a')],'/server/files/plugins')));_0x5c9192[_0x243a('0x121')](_0x243a('0x122'))[_0x243a('0x123')](errors[0x194]);_0x5c9192[_0x243a('0x121')]('/*')[_0x243a('0x123')](function(_0x29903b,_0x2b4093){_0x2b4093[_0x243a('0x124')](path[_0x243a('0x125')](_0x5c9192[_0x243a('0x123')](_0x243a('0x126'))+_0x243a('0x127')));});};var sensitiveFields=[_0x243a('0x128'),_0x243a('0x129'),_0x243a('0x12a'),_0x243a('0x12b'),'firstName','lastName',_0x243a('0x12c'),'phone','mobile',_0x243a('0x12d'),_0x243a('0x12e'),'clientId',_0x243a('0x12f'),'securityToken',_0x243a('0x130'),'accessKey',_0x243a('0x131'),_0x243a('0x132'),_0x243a('0x133'),_0x243a('0x134'),_0x243a('0x135'),'authToken',_0x243a('0x136'),_0x243a('0x137'),_0x243a('0x138'),_0x243a('0x139'),'calleridnum','exten','vidaooApiKey','clientEmail',_0x243a('0x13a'),'accesskeyid',_0x243a('0x13b'),_0x243a('0x13c'),_0x243a('0x15'),_0x243a('0x13d'),_0x243a('0x13e'),_0x243a('0x13f'),'dsn',_0x243a('0x140'),'registry',_0x243a('0x141')];function maskSensitiveData(_0x1fa6c4){var _0x305c10=/(?!^)[\s\S](?!$)/g;if(!_[_0x243a('0x142')](_0x1fa6c4))return;for(var _0x198b67 in _0x1fa6c4){if(_[_0x243a('0x143')](_0x1fa6c4[_0x198b67])){for(var _0xb6551d=0x0;_0xb6551d<_0x1fa6c4[_0x198b67][_0x243a('0x144')];_0xb6551d++){maskSensitiveData(_0x1fa6c4[_0x198b67][_0xb6551d]);}}else if(_[_0x243a('0x142')](_0x1fa6c4[_0x198b67])){maskSensitiveData(_0x1fa6c4[_0x198b67]);}else if(_[_0x243a('0x145')](_0x1fa6c4[_0x198b67])){_0x1fa6c4[_0x198b67]=_0x1fa6c4[_0x198b67][_0x243a('0x146')](/{{{/g,'@@{')[_0x243a('0x146')](/}}}/g,_0x243a('0x147'))[_0x243a('0x146')](/{{/g,'@{')[_0x243a('0x146')](/}}/g,'}@');if(_[_0x243a('0x148')](sensitiveFields,_0x198b67)){_0x1fa6c4[_0x198b67]=_0x1fa6c4[_0x198b67][_0x243a('0x146')](_0x305c10,'*');}}}} \ No newline at end of file +var _0xe1e6=['./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappQueue','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','./api/authActiveDirectory','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.0.0','/server/files/plugins','route','get','sendFile','appPath','/index.html','username','password','newPassword','apiKey','firstName','lastName','mobile','fax','clientId','clientSecret','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','exten','vidaooApiKey','clientEmail','privateKey','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','replace','}@@','includes','lodash','express-winston','util','./config/environment','api','auth','./safe-template','safeTemplate','default','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','agent_id','agent_name','test','/api/users','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/interactions','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','./api/template','/api/triggers','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zendesk/accounts','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intVtigerAccount','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./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/square/reports','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','./api/attachment','/api/plugins'];(function(_0x3a99b3,_0x4d32de){var _0x2eebe6=function(_0x28b605){while(--_0x28b605){_0x3a99b3['push'](_0x3a99b3['shift']());}};_0x2eebe6(++_0x4d32de);}(_0xe1e6,0x67));var _0x6e1e=function(_0x4b3505,_0x4957c1){_0x4b3505=_0x4b3505-0x0;var _0x213106=_0xe1e6[_0x4b3505];return _0x213106;};'use strict';var _=require(_0x6e1e('0x0'));var path=require('path');var express=require('express');var ewinston=require(_0x6e1e('0x1'));var util=require(_0x6e1e('0x2'));var errors=require('./errors');var config=require(_0x6e1e('0x3'));var logger=require('./config/logger')(_0x6e1e('0x4'));var authLogger=require('./config/logger')(_0x6e1e('0x5'));var safeTemplate=require(_0x6e1e('0x6'))[_0x6e1e('0x7')];exports[_0x6e1e('0x8')]=function(_0x50e059){_0x50e059[_0x6e1e('0x9')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x13fd5a,_0x711d2f){var _0x55f776=_0x6e1e('0xa');if(!_[_0x6e1e('0xb')](_0x13fd5a[_0x6e1e('0xc')])){_0x55f776+=_0x6e1e('0xd');var _0x43716a=_0x13fd5a[_0x6e1e('0xc')];maskSensitiveData(_0x43716a);}return safeTemplate(util['format'](_0x55f776,_0x13fd5a['method'],_0x13fd5a[_0x6e1e('0xe')]['x-forwarded-for']?_0x13fd5a[_0x6e1e('0xe')][_0x6e1e('0xf')]:_0x13fd5a[_0x6e1e('0x10')][_0x6e1e('0x11')]||_0x13fd5a['ip'],_0x13fd5a[_0x6e1e('0x12')],_0x711d2f[_0x6e1e('0x13')],_0x711d2f[_0x6e1e('0x14')],_0x13fd5a[_0x6e1e('0x15')]?_0x13fd5a['user']['id']:null,_0x13fd5a[_0x6e1e('0x15')]?_0x13fd5a['user'][_0x6e1e('0x16')]:null,_0x13fd5a['user']?_0x13fd5a[_0x6e1e('0x15')][_0x6e1e('0x17')]:null,_0x43716a?util[_0x6e1e('0x18')](_0x43716a,![],null):''));}}));_0x50e059[_0x6e1e('0x9')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x38c552,_0x325c22){var _0x42c734=_0x6e1e('0x19');if(_0x38c552['body']&&_0x38c552[_0x6e1e('0xc')][_0x6e1e('0x1a')]&&_0x38c552[_0x6e1e('0xc')]['agent_id']){_0x42c734=_0x6e1e('0x1b');}return util['format'](_0x42c734,_0x38c552[_0x6e1e('0x1c')],_0x38c552[_0x6e1e('0xe')][_0x6e1e('0xf')]?_0x38c552['headers']['x-forwarded-for']:_0x38c552['connection'][_0x6e1e('0x11')]||_0x38c552['ip'],_0x38c552[_0x6e1e('0x12')],_0x325c22[_0x6e1e('0x13')],_0x325c22[_0x6e1e('0x14')],_0x38c552[_0x6e1e('0x15')]?_0x38c552[_0x6e1e('0x15')]['id']:null,_0x38c552[_0x6e1e('0x15')]?_0x38c552[_0x6e1e('0x15')][_0x6e1e('0x16')]:null,_0x38c552[_0x6e1e('0x15')]?_0x38c552[_0x6e1e('0x15')][_0x6e1e('0x17')]:null,_0x38c552[_0x6e1e('0xc')]&&_0x38c552['body'][_0x6e1e('0x1a')]?_0x38c552[_0x6e1e('0xc')][_0x6e1e('0x1a')]:'other',_0x38c552[_0x6e1e('0xc')]&&_0x38c552['body'][_0x6e1e('0x1d')]?_0x38c552[_0x6e1e('0xc')][_0x6e1e('0x1d')]:'',_0x38c552[_0x6e1e('0xc')]&&_0x38c552[_0x6e1e('0xc')][_0x6e1e('0x1e')]?_0x38c552[_0x6e1e('0xc')][_0x6e1e('0x1e')]:'');},'ignoreRoute':function(_0xbad71f){var _0x43b6d1=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x43b6d1[_0x6e1e('0x1f')](_0xbad71f[_0x6e1e('0x12')]);}}));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x20'),require('./api/user'));_0x50e059['use'](_0x6e1e('0x21'),require('./api/voiceChanSpy'));_0x50e059['use'](_0x6e1e('0x22'),require(_0x6e1e('0x23')));_0x50e059['use']('/api/voice/extensions',require('./api/voiceExtension'));_0x50e059['use'](_0x6e1e('0x24'),require(_0x6e1e('0x25')));_0x50e059[_0x6e1e('0x9')]('/api/voice/queues',require(_0x6e1e('0x26')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x27'),require(_0x6e1e('0x28')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x29'),require(_0x6e1e('0x2a')));_0x50e059[_0x6e1e('0x9')]('/api/voice/mails',require('./api/voiceMail'));_0x50e059[_0x6e1e('0x9')]('/api/voice/mails/messages',require('./api/voiceMailMessage'));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x2b'),require(_0x6e1e('0x2c')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x2d'),require(_0x6e1e('0x2e')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x2f'),require(_0x6e1e('0x30')));_0x50e059['use']('/api/voice/queues/reports',require(_0x6e1e('0x31')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x32'),require(_0x6e1e('0x33')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x34'),require(_0x6e1e('0x35')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x36'),require(_0x6e1e('0x37')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x38'),require(_0x6e1e('0x39')));_0x50e059['use']('/api/mail/accounts',require(_0x6e1e('0x3a')));_0x50e059[_0x6e1e('0x9')]('/api/mail/queues',require(_0x6e1e('0x3b')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x3c'),require(_0x6e1e('0x3d')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x3e'),require(_0x6e1e('0x3f')));_0x50e059[_0x6e1e('0x9')]('/api/mail/messages',require(_0x6e1e('0x40')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x41'),require(_0x6e1e('0x42')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x43'),require('./api/mailQueueReport'));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x44'),require('./api/dashboard'));_0x50e059[_0x6e1e('0x9')]('/api/dashboards/items',require(_0x6e1e('0x45')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x46'),require('./api/faxAccount'));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x47'),require(_0x6e1e('0x48')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x49'),require(_0x6e1e('0x4a')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x4b'),require(_0x6e1e('0x4c')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x4d'),require(_0x6e1e('0x4e')));_0x50e059[_0x6e1e('0x9')]('/api/fax/reports/queue',require(_0x6e1e('0x4f')));_0x50e059['use']('/api/sms/accounts',require(_0x6e1e('0x50')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x51'),require(_0x6e1e('0x52')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x53'),require(_0x6e1e('0x54')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x55'),require('./api/smsMessage'));_0x50e059['use'](_0x6e1e('0x56'),require(_0x6e1e('0x57')));_0x50e059[_0x6e1e('0x9')]('/api/openchannel/accounts',require('./api/openchannelAccount'));_0x50e059[_0x6e1e('0x9')]('/api/openchannel/applications',require(_0x6e1e('0x58')));_0x50e059[_0x6e1e('0x9')]('/api/openchannel/interactions',require(_0x6e1e('0x59')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x5a'),require('./api/openchannelMessage'));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x5b'),require('./api/openchannelQueue'));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x5c'),require(_0x6e1e('0x5d')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x5e'),require(_0x6e1e('0x5f')));_0x50e059[_0x6e1e('0x9')]('/api/chat/applications',require('./api/chatApplication'));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x60'),require('./api/chatInteraction'));_0x50e059['use'](_0x6e1e('0x61'),require(_0x6e1e('0x62')));_0x50e059[_0x6e1e('0x9')]('/api/chat/offline_messages',require(_0x6e1e('0x63')));_0x50e059['use']('/api/chat/queues',require(_0x6e1e('0x64')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x65'),require(_0x6e1e('0x66')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x67'),require(_0x6e1e('0x68')));_0x50e059['use'](_0x6e1e('0x69'),require(_0x6e1e('0x6a')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x6b'),require(_0x6e1e('0x6c')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x6d'),require(_0x6e1e('0x6e')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x6f'),require(_0x6e1e('0x70')));_0x50e059['use']('/api/cm/hopper_final',require(_0x6e1e('0x71')));_0x50e059[_0x6e1e('0x9')]('/api/cm/hopper_history',require(_0x6e1e('0x72')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x73'),require(_0x6e1e('0x74')));_0x50e059['use'](_0x6e1e('0x75'),require(_0x6e1e('0x76')));_0x50e059['use'](_0x6e1e('0x77'),require(_0x6e1e('0x78')));_0x50e059[_0x6e1e('0x9')]('/api/canned_answers',require(_0x6e1e('0x79')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x7a'),require('./api/disposition'));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x7b'),require(_0x6e1e('0x7c')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x7d'),require(_0x6e1e('0x7e')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x7f'),require(_0x6e1e('0x80')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x81'),require('./api/cdr'));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x82'),require('./api/voiceQueuesLog'));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x83'),require(_0x6e1e('0x84')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x85'),require(_0x6e1e('0x86')));_0x50e059['use']('/api/tags',require(_0x6e1e('0x87')));_0x50e059[_0x6e1e('0x9')]('/api/templates',require(_0x6e1e('0x88')));_0x50e059['use'](_0x6e1e('0x89'),require('./api/trigger'));_0x50e059[_0x6e1e('0x9')]('/api/variables',require(_0x6e1e('0x8a')));_0x50e059[_0x6e1e('0x9')]('/api/integrations',require(_0x6e1e('0x8b')));_0x50e059['use'](_0x6e1e('0x8c'),require(_0x6e1e('0x8d')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x8e'),require(_0x6e1e('0x8f')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x90'),require(_0x6e1e('0x91')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x92'),require(_0x6e1e('0x93')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x94'),require(_0x6e1e('0x95')));_0x50e059['use'](_0x6e1e('0x96'),require(_0x6e1e('0x97')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x98'),require('./api/analyticTreeReport'));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x99'),require(_0x6e1e('0x9a')));_0x50e059['use'](_0x6e1e('0x9b'),require('./api/intSalesforceConfiguration'));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x9c'),require(_0x6e1e('0x9d')));_0x50e059[_0x6e1e('0x9')]('/api/integrations/sugarcrm/accounts',require('./api/intSugarcrmAccount'));_0x50e059[_0x6e1e('0x9')]('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0x50e059[_0x6e1e('0x9')]('/api/integrations/sugarcrm/fields',require('./api/intSugarcrmField'));_0x50e059[_0x6e1e('0x9')]('/api/integrations/desk/accounts',require(_0x6e1e('0x9e')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x9f'),require(_0x6e1e('0xa0')));_0x50e059['use'](_0x6e1e('0xa1'),require(_0x6e1e('0xa2')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xa3'),require(_0x6e1e('0xa4')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xa5'),require(_0x6e1e('0xa6')));_0x50e059[_0x6e1e('0x9')]('/api/integrations/zoho/fields',require('./api/intZohoField'));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xa7'),require('./api/intZendeskAccount'));_0x50e059['use']('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xa8'),require(_0x6e1e('0xa9')));_0x50e059[_0x6e1e('0x9')]('/api/integrations/freshdesk/accounts',require(_0x6e1e('0xaa')));_0x50e059['use'](_0x6e1e('0xab'),require(_0x6e1e('0xac')));_0x50e059['use'](_0x6e1e('0xad'),require('./api/intFreshdeskField'));_0x50e059[_0x6e1e('0x9')]('/api/integrations/vtiger/accounts',require(_0x6e1e('0xae')));_0x50e059[_0x6e1e('0x9')]('/api/integrations/vtiger/configurations',require('./api/intVtigerConfiguration'));_0x50e059[_0x6e1e('0x9')]('/api/integrations/vtiger/fields',require(_0x6e1e('0xaf')));_0x50e059['use']('/api/integrations/servicenow/accounts',require(_0x6e1e('0xb0')));_0x50e059['use'](_0x6e1e('0xb1'),require('./api/intServicenowConfiguration'));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xb2'),require(_0x6e1e('0xb3')));_0x50e059[_0x6e1e('0x9')]('/api/integrations/dynamics365/accounts',require(_0x6e1e('0xb4')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xb5'),require('./api/intDynamics365Configuration'));_0x50e059['use'](_0x6e1e('0xb6'),require('./api/intDynamics365Field'));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xb7'),require(_0x6e1e('0xb8')));_0x50e059['use']('/api/integrations/freshsales/configurations',require(_0x6e1e('0xb9')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xba'),require(_0x6e1e('0xbb')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xbc'),require(_0x6e1e('0xbd')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xbe'),require(_0x6e1e('0xbf')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xc0'),require(_0x6e1e('0xc1')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xc2'),require(_0x6e1e('0xc3')));_0x50e059['use'](_0x6e1e('0xc4'),require(_0x6e1e('0xc5')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xc6'),require(_0x6e1e('0xc7')));_0x50e059['use'](_0x6e1e('0xc8'),require(_0x6e1e('0xc9')));_0x50e059['use'](_0x6e1e('0xca'),require(_0x6e1e('0xcb')));_0x50e059['use'](_0x6e1e('0xcc'),require('./api/squareReportDetail'));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xcd'),require(_0x6e1e('0xce')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xcf'),require('./api/setting'));_0x50e059['use']('/api/square/odbc',require('./api/squareOdbc'));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xd0'),require(_0x6e1e('0xd1')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xd2'),require(_0x6e1e('0xd3')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xd4'),require(_0x6e1e('0xd5')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xd6'),require(_0x6e1e('0xd7')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xd8'),require(_0x6e1e('0xd9')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xda'),require(_0x6e1e('0xdb')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xdc'),require('./api/migration'));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xdd'),require(_0x6e1e('0xde')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xdf'),require(_0x6e1e('0xe0')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xe1'),require('./api/mailTransferReport'));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xe2'),require(_0x6e1e('0xe3')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xe4'),require(_0x6e1e('0xe5')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xe6'),require(_0x6e1e('0xe7')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xe8'),require(_0x6e1e('0xe9')));_0x50e059['use'](_0x6e1e('0xea'),require(_0x6e1e('0xeb')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xec'),require('./api/voicePrefix'));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xed'),require(_0x6e1e('0xee')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xef'),require(_0x6e1e('0xf0')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xf1'),require('./api/userProfileResource'));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xf2'),require(_0x6e1e('0xf3')));_0x50e059['use'](_0x6e1e('0xf4'),require(_0x6e1e('0xf5')));_0x50e059['use'](_0x6e1e('0xf6'),require(_0x6e1e('0xf7')));_0x50e059['use'](_0x6e1e('0xf8'),require(_0x6e1e('0xf9')));_0x50e059[_0x6e1e('0x9')]('/api/whatsapp/messages',require(_0x6e1e('0xfa')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xfb'),require(_0x6e1e('0xfc')));_0x50e059[_0x6e1e('0x9')]('/api/whatsapp/reports/transfer',require('./api/whatsappTransferReport'));_0x50e059['use']('/api/whatsapp/queues',require(_0x6e1e('0xfd')));_0x50e059['use']('/api/cloudProviders',require(_0x6e1e('0xfe')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0xff'),require(_0x6e1e('0x100')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x101'),require(_0x6e1e('0x102')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x103'),require(_0x6e1e('0x104')));_0x50e059[_0x6e1e('0x9')]('/api/auth/activedirectory',require(_0x6e1e('0x105')));_0x50e059['use'](_0x6e1e('0x106'),require('./api/jira'));_0x50e059['use'](_0x6e1e('0x107'),require(_0x6e1e('0x108')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x109'),require(_0x6e1e('0x10a')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x10b'),require('./api/system'));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x10c'),require(_0x6e1e('0x10d')));_0x50e059['use'](_0x6e1e('0x10e'),require(_0x6e1e('0x10f')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x110'),express[_0x6e1e('0x111')](path[_0x6e1e('0x112')](config[_0x6e1e('0x113')],'/apidoc')));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x114'),express[_0x6e1e('0x111')](path[_0x6e1e('0x112')](config[_0x6e1e('0x113')],'/www')));_0x50e059['use'](_0x6e1e('0x115'),express[_0x6e1e('0x111')](path['join'](config[_0x6e1e('0x113')],_0x6e1e('0x115'))));_0x50e059[_0x6e1e('0x9')](_0x6e1e('0x116'),express[_0x6e1e('0x111')](path[_0x6e1e('0x112')](config[_0x6e1e('0x113')],_0x6e1e('0x117'),_0x6e1e('0x118'))));_0x50e059[_0x6e1e('0x9')]('/plugins',express[_0x6e1e('0x111')](path['join'](config[_0x6e1e('0x113')],_0x6e1e('0x119'))));_0x50e059[_0x6e1e('0x11a')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x6e1e('0x11b')](errors[0x194]);_0x50e059[_0x6e1e('0x11a')]('/*')[_0x6e1e('0x11b')](function(_0x664666,_0x8fe302){_0x8fe302[_0x6e1e('0x11c')](path['resolve'](_0x50e059[_0x6e1e('0x11b')](_0x6e1e('0x11d'))+_0x6e1e('0x11e')));});};var sensitiveFields=[_0x6e1e('0x11f'),_0x6e1e('0x120'),_0x6e1e('0x121'),_0x6e1e('0x122'),_0x6e1e('0x123'),_0x6e1e('0x124'),'street','phone',_0x6e1e('0x125'),_0x6e1e('0x126'),'email',_0x6e1e('0x127'),_0x6e1e('0x128'),'securityToken',_0x6e1e('0x129'),_0x6e1e('0x12a'),_0x6e1e('0x12b'),_0x6e1e('0x12c'),_0x6e1e('0x12d'),_0x6e1e('0x12e'),_0x6e1e('0x12f'),_0x6e1e('0x130'),_0x6e1e('0x131'),_0x6e1e('0x132'),_0x6e1e('0x133'),'calleridname','calleridnum',_0x6e1e('0x134'),_0x6e1e('0x135'),_0x6e1e('0x136'),_0x6e1e('0x137'),'accesskeyid',_0x6e1e('0x138'),_0x6e1e('0x139'),_0x6e1e('0x15'),_0x6e1e('0x13a'),_0x6e1e('0x13b'),_0x6e1e('0x13c'),_0x6e1e('0x13d'),_0x6e1e('0x13e'),_0x6e1e('0x13f'),_0x6e1e('0x140')];function maskSensitiveData(_0x5a70cd){var _0x216a39=/(?!^)[\s\S](?!$)/g;if(!_[_0x6e1e('0x141')](_0x5a70cd))return;for(var _0x590995 in _0x5a70cd){if(_[_0x6e1e('0x142')](_0x5a70cd[_0x590995])){for(var _0x309c21=0x0;_0x309c21<_0x5a70cd[_0x590995][_0x6e1e('0x143')];_0x309c21++){maskSensitiveData(_0x5a70cd[_0x590995][_0x309c21]);}}else if(_['isPlainObject'](_0x5a70cd[_0x590995])){maskSensitiveData(_0x5a70cd[_0x590995]);}else if(_['isString'](_0x5a70cd[_0x590995])){_0x5a70cd[_0x590995]=_0x5a70cd[_0x590995]['replace'](/{{{/g,'@@{')[_0x6e1e('0x144')](/}}}/g,_0x6e1e('0x145'))[_0x6e1e('0x144')](/{{/g,'@{')[_0x6e1e('0x144')](/}}/g,'}@');if(_[_0x6e1e('0x146')](sensitiveFields,_0x590995)){_0x5a70cd[_0x590995]=_0x5a70cd[_0x590995][_0x6e1e('0x144')](_0x216a39,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 7196500..062602d 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x945e=['../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/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/variable/variable.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/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','port','localhost','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc'];(function(_0x35025c,_0x5558f4){var _0x26bbb6=function(_0x3951f8){while(--_0x3951f8){_0x35025c['push'](_0x35025c['shift']());}};_0x26bbb6(++_0x5558f4);}(_0x945e,0x1ea));var _0xe945=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x945e[_0x397cfb];return _0x15fed9;};'use strict';var jayson=require(_0xe945('0x0'));var BPromise=require(_0xe945('0x1'));var _=require(_0xe945('0x2'));var config=require(_0xe945('0x3'));exports['listen']=function(){return new BPromise(function(_0x30e0aa,_0x477ff9){var _0x1f7d9e={};_0x1f7d9e=_['merge'](_0x1f7d9e,require(_0xe945('0x4')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x6')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x7')));_0x1f7d9e=_['merge'](_0x1f7d9e,require(_0xe945('0x8')));_0x1f7d9e=_['merge'](_0x1f7d9e,require(_0xe945('0x9')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0xa')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0xb')));_0x1f7d9e=_['merge'](_0x1f7d9e,require(_0xe945('0xc')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0xd')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0xe')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0xf')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x1f7d9e=_['merge'](_0x1f7d9e,require(_0xe945('0x10')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x11')));_0x1f7d9e=_['merge'](_0x1f7d9e,require(_0xe945('0x12')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require('../api/mailInteraction/mailInteraction.rpc'));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x13')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x14')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x15')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require('../api/faxAccount/faxAccount.rpc'));_0x1f7d9e=_['merge'](_0x1f7d9e,require('../api/faxApplication/faxApplication.rpc'));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require('../api/faxInteraction/faxInteraction.rpc'));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x16')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x17')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x18')));_0x1f7d9e=_['merge'](_0x1f7d9e,require(_0xe945('0x19')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x1a')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x1b')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x1c')));_0x1f7d9e=_['merge'](_0x1f7d9e,require(_0xe945('0x1d')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x1e')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x1f')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x1f7d9e=_['merge'](_0x1f7d9e,require(_0xe945('0x20')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require('../api/chatMessage/chatMessage.rpc'));_0x1f7d9e=_['merge'](_0x1f7d9e,require(_0xe945('0x21')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x22')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x23')));_0x1f7d9e=_['merge'](_0x1f7d9e,require(_0xe945('0x24')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x25')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x26')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x27')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require('../api/pause/pause.rpc'));_0x1f7d9e=_['merge'](_0x1f7d9e,require(_0xe945('0x28')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require('../api/template/template.rpc'));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x29')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x2a')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x2b')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x2c')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x2d')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x2e')));_0x1f7d9e=_['merge'](_0x1f7d9e,require(_0xe945('0x2f')));_0x1f7d9e=_['merge'](_0x1f7d9e,require(_0xe945('0x30')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x31')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x32')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x33')));_0x1f7d9e=_['merge'](_0x1f7d9e,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x34')));_0x1f7d9e=_['merge'](_0x1f7d9e,require(_0xe945('0x35')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x36')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x37')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require('../api/squareMessage/squareMessage.rpc'));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x38')));_0x1f7d9e=_['merge'](_0x1f7d9e,require(_0xe945('0x39')));_0x1f7d9e=_['merge'](_0x1f7d9e,require(_0xe945('0x3a')));_0x1f7d9e=_['merge'](_0x1f7d9e,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x3b')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require(_0xe945('0x3c')));_0x1f7d9e=_[_0xe945('0x5')](_0x1f7d9e,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x48df6e=jayson[_0xe945('0x3d')](_0x1f7d9e)[_0xe945('0x3e')]();var _0x321f60=config['rpc'][_0xe945('0x3f')]||config[_0xe945('0x3f')]+0x1;var _0x27aa4d=config['rpc']['ip']||_0xe945('0x40');_0x48df6e['on'](_0xe945('0x41'),function(_0x37e164){return _0x477ff9(_0x37e164);});_0x48df6e[_0xe945('0x42')](_0x321f60,_0x27aa4d,function(){console[_0xe945('0x43')](_0xe945('0x44'),_0x27aa4d,_0x321f60);require(_0xe945('0x45'))['default']();return _0x30e0aa(_0xe945('0x46')+_0x27aa4d+':'+_0x321f60);});});}; \ No newline at end of file +var _0x0a0a=['../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.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/whatsappQueueReport/whatsappQueueReport.rpc','http','rpc','port','localhost','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.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/smsInteraction/smsInteraction.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/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.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'];(function(_0x13a61c,_0x17c53a){var _0x2d0c84=function(_0x5c6f77){while(--_0x5c6f77){_0x13a61c['push'](_0x13a61c['shift']());}};_0x2d0c84(++_0x17c53a);}(_0x0a0a,0x135));var _0xa0a0=function(_0x30dbf3,_0x2fec13){_0x30dbf3=_0x30dbf3-0x0;var _0x35cf57=_0x0a0a[_0x30dbf3];return _0x35cf57;};'use strict';var jayson=require(_0xa0a0('0x0'));var BPromise=require(_0xa0a0('0x1'));var _=require(_0xa0a0('0x2'));var config=require('../config/environment');exports['listen']=function(){return new BPromise(function(_0x177a1d,_0x35c8f0){var _0x1a2a06={};_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x4')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x5')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require('../api/voiceQueue/voiceQueue.rpc'));_0x1a2a06=_['merge'](_0x1a2a06,require(_0xa0a0('0x6')));_0x1a2a06=_['merge'](_0x1a2a06,require(_0xa0a0('0x7')));_0x1a2a06=_['merge'](_0x1a2a06,require(_0xa0a0('0x8')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x1a2a06=_['merge'](_0x1a2a06,require(_0xa0a0('0x9')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0xa')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0xb')));_0x1a2a06=_['merge'](_0x1a2a06,require(_0xa0a0('0xc')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0xd')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require('../api/mailServerIn/mailServerIn.rpc'));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0xe')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0xf')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x10')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x11')));_0x1a2a06=_['merge'](_0x1a2a06,require('../api/mailApplication/mailApplication.rpc'));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x12')));_0x1a2a06=_['merge'](_0x1a2a06,require(_0xa0a0('0x13')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x14')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x15')));_0x1a2a06=_['merge'](_0x1a2a06,require(_0xa0a0('0x16')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x17')));_0x1a2a06=_['merge'](_0x1a2a06,require(_0xa0a0('0x18')));_0x1a2a06=_['merge'](_0x1a2a06,require('../api/smsAccount/smsAccount.rpc'));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x19')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require('../api/smsMessage/smsMessage.rpc'));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x1a')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x1b')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x1c')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x1d')));_0x1a2a06=_['merge'](_0x1a2a06,require(_0xa0a0('0x1e')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x1f')));_0x1a2a06=_['merge'](_0x1a2a06,require(_0xa0a0('0x20')));_0x1a2a06=_['merge'](_0x1a2a06,require(_0xa0a0('0x21')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x22')));_0x1a2a06=_['merge'](_0x1a2a06,require('../api/cmContact/cmContact.rpc'));_0x1a2a06=_['merge'](_0x1a2a06,require(_0xa0a0('0x23')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x24')));_0x1a2a06=_['merge'](_0x1a2a06,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x25')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x26')));_0x1a2a06=_['merge'](_0x1a2a06,require(_0xa0a0('0x27')));_0x1a2a06=_['merge'](_0x1a2a06,require('../api/sound/sound.rpc'));_0x1a2a06=_['merge'](_0x1a2a06,require('../api/template/template.rpc'));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require('../api/trigger/trigger.rpc'));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x28')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x29')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x2a')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x2b')));_0x1a2a06=_['merge'](_0x1a2a06,require(_0xa0a0('0x2c')));_0x1a2a06=_['merge'](_0x1a2a06,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x2d')));_0x1a2a06=_['merge'](_0x1a2a06,require(_0xa0a0('0x2e')));_0x1a2a06=_['merge'](_0x1a2a06,require(_0xa0a0('0x2f')));_0x1a2a06=_['merge'](_0x1a2a06,require(_0xa0a0('0x30')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x31')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x32')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x33')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require('../api/setting/setting.rpc'));_0x1a2a06=_['merge'](_0x1a2a06,require(_0xa0a0('0x34')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require('../api/squareProject/squareProject.rpc'));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x35')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x36')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x37')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x38')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x39')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x3a')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x3b')));_0x1a2a06=_['merge'](_0x1a2a06,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require(_0xa0a0('0x3c')));_0x1a2a06=_[_0xa0a0('0x3')](_0x1a2a06,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x58fad9=jayson['server'](_0x1a2a06)[_0xa0a0('0x3d')]();var _0x55d1aa=config[_0xa0a0('0x3e')][_0xa0a0('0x3f')]||config[_0xa0a0('0x3f')]+0x1;var _0x1f76a6=config['rpc']['ip']||_0xa0a0('0x40');_0x58fad9['on'](_0xa0a0('0x41'),function(_0x43cd12){return _0x35c8f0(_0x43cd12);});_0x58fad9[_0xa0a0('0x42')](_0x55d1aa,_0x1f76a6,function(){console[_0xa0a0('0x43')](_0xa0a0('0x44'),_0x1f76a6,_0x55d1aa);require('../config/triggers')[_0xa0a0('0x45')]();return _0x177a1d(_0xa0a0('0x46')+_0x1f76a6+':'+_0x55d1aa);});});}; \ No newline at end of file diff --git a/server/safe-template.js b/server/safe-template.js index 58c9d31..6a2d761 100644 --- a/server/safe-template.js +++ b/server/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7916=['{\x20{\x20','\x20}\x20}','string','replace','isArray','keys','reduce','safeTemplate','lodash'];(function(_0x4c588d,_0x549dbb){var _0x5ebc45=function(_0x1a8543){while(--_0x1a8543){_0x4c588d['push'](_0x4c588d['shift']());}};_0x5ebc45(++_0x549dbb);}(_0x7916,0x128));var _0x6791=function(_0x12ef68,_0x294c46){_0x12ef68=_0x12ef68-0x0;var _0x2cf64a=_0x7916[_0x12ef68];return _0x2cf64a;};var _=require(_0x6791('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x5eaf3a){return _0x5eaf3a==='{{'?_0x6791('0x1'):_0x6791('0x2');}function safeTemplate(_0x4ca50a){var _0x325c54=_0x4ca50a;if(typeof _0x4ca50a===_0x6791('0x3')){_0x325c54=_0x4ca50a[_0x6791('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x6791('0x5')](_0x4ca50a)){_0x325c54=_0x4ca50a['map'](function(_0xe98396){return safeTemplate(_0xe98396);});}else if(_['isPlainObject'](_0x4ca50a)){_0x325c54=Object[_0x6791('0x6')](_0x4ca50a)[_0x6791('0x7')](function(_0x5ad8c0,_0x8b85ff){_0x5ad8c0[_0x8b85ff]=safeTemplate(_0x4ca50a[_0x8b85ff]);return _0x5ad8c0;},{});}return _0x325c54;}module['exports'][_0x6791('0x8')]=safeTemplate; \ No newline at end of file +var _0xb03e=['safeTemplate','{\x20{\x20','\x20}\x20}','string','replace','isArray','map','isPlainObject','keys','exports'];(function(_0x26e6dc,_0xda480f){var _0x3a898b=function(_0x38a36e){while(--_0x38a36e){_0x26e6dc['push'](_0x26e6dc['shift']());}};_0x3a898b(++_0xda480f);}(_0xb03e,0x1eb));var _0xeb03=function(_0x4e84cc,_0x2c25fe){_0x4e84cc=_0x4e84cc-0x0;var _0x4a0233=_0xb03e[_0x4e84cc];return _0x4a0233;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x36351b){return _0x36351b==='{{'?_0xeb03('0x0'):_0xeb03('0x1');}function safeTemplate(_0x3c5e68){var _0x1c58b5=_0x3c5e68;if(typeof _0x3c5e68===_0xeb03('0x2')){_0x1c58b5=_0x3c5e68[_0xeb03('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xeb03('0x4')](_0x3c5e68)){_0x1c58b5=_0x3c5e68[_0xeb03('0x5')](function(_0x3ba4b0){return safeTemplate(_0x3ba4b0);});}else if(_[_0xeb03('0x6')](_0x3c5e68)){_0x1c58b5=Object[_0xeb03('0x7')](_0x3c5e68)['reduce'](function(_0x3b58a2,_0x3d3322){_0x3b58a2[_0x3d3322]=safeTemplate(_0x3c5e68[_0x3d3322]);return _0x3b58a2;},{});}return _0x1c58b5;}module[_0xeb03('0x8')][_0xeb03('0x9')]=safeTemplate; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 8a7a80e..2239b63 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 _0x58d5=['setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setExtension','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','./reply','./error','call','setEncoding','utf8','emit','ready','toLowerCase','hangup','520-Invalid','search','no\x20code','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','function','write','inherits','prototype','sendRequest','sync','ANSWER','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','isArray','format','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','HANGUP'];(function(_0x538c70,_0x35531f){var _0x42ae01=function(_0x5c7368){while(--_0x5c7368){_0x538c70['push'](_0x538c70['shift']());}};_0x42ae01(++_0x35531f);}(_0x58d5,0x107));var _0x558d=function(_0x34d753,_0x4df39b){_0x34d753=_0x34d753-0x0;var _0xfc01ad=_0x58d5[_0x34d753];return _0xfc01ad;};'use strict';var util=require(_0x558d('0x0'));var _=require(_0x558d('0x1'));var EventEmitter=require(_0x558d('0x2'))['EventEmitter'];var AGIReply=require(_0x558d('0x3'));var AGIError=require(_0x558d('0x4'));function AGIChannel(_0x1d1a25){var _0x34b2b0=this,_0x52b448=new AGIReply(),_0x3ebb20=![],_0x1c07cd={};EventEmitter[_0x558d('0x5')](_0x34b2b0);_0x1d1a25['setEncoding']('utf8');_0x1d1a25['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x52b448[_0x558d('0x6')](_0x558d('0x7'));_0x52b448['on']('headers',function(_0x14b004){for(var _0x5a27df in _0x14b004){_0x34b2b0[_0x5a27df]=_0x14b004[_0x5a27df];}_0x34b2b0[_0x558d('0x8')](_0x558d('0x9'));});_0x52b448['on']('line',function(_0x38abb5){if(_0x38abb5[_0x558d('0xa')]()=='hangup'){_0x34b2b0[_0x558d('0x8')](_0x558d('0xb'));return;}if(_0x38abb5['substring'](0x0,0xb)==_0x558d('0xc')){_0x3ebb20=!![];}if(_0x3ebb20){_0x1c07cd['rx']+=_0x38abb5+'\x0a';if(_0x38abb5[_0x558d('0xd')]('520\x20End\x20of\x20proper')!=-0x1){_0x3ebb20=![];}}else{_0x1c07cd['rx']=_0x38abb5;}if(_0x3ebb20){return;}if(typeof _0x1c07cd['cb']=='function'){var _0x28164c=_0x1c07cd['rx']['substring'](0x0,0x3),_0xf0fb14=null,_0x16c689=null;_0x28164c=parseInt(_0x28164c);if(isNaN(_0x28164c)){_0x1c07cd['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x558d('0xe')});return;}if(_0x28164c!=0xc8){_0x1c07cd['cb'](null,{'code':_0x28164c,'result':-0x1,'extra':'KO'});return;}_0xf0fb14=_0x1c07cd['rx']['substring'](0x4)['replace'](_0x558d('0xf'),'');if(_0xf0fb14[_0x558d('0x10')]('\x20')!=-0x1){_0xf0fb14=_0xf0fb14[_0x558d('0x11')](0x0,_0xf0fb14[_0x558d('0x10')]('\x20'));}if(_[_0x558d('0x12')](_0xf0fb14,'-1')){_0xf0fb14=parseInt(_0xf0fb14);}_0x16c689=_0x1c07cd['rx'][_0x558d('0x13')]('\x20');if(_0x16c689['length']==0x3){_0x16c689=_0x16c689[0x2]['substring'](0x1,_0x16c689[0x2][_0x558d('0x14')]-0x1);}else if(_0x16c689[_0x558d('0x14')]>0x3){var _0xdf770a=/\((.+)\)/;var _0x43ef05=_0x1c07cd['rx'][_0x558d('0x15')](_0xdf770a);if(_0x43ef05){_0x16c689=_0x43ef05[0x1];}else{_0x16c689=null;}}else{_0x16c689=null;}_0x1c07cd['cb'](null,{'code':_0x28164c,'result':_0xf0fb14,'extra':_0x16c689});}});_0x1d1a25['on'](_0x558d('0x16'),function(_0x3d55da){_0x34b2b0[_0x558d('0x8')](_0x558d('0x16'),new AGIError(_0x558d('0x17'),_0x3d55da['code']));});_0x1d1a25['on'](_0x558d('0x18'),function(){_0x34b2b0[_0x558d('0x8')]('close',new AGIError(_0x558d('0x19')));});_0x1d1a25['on']('timeout',function(){_0x34b2b0['emit'](_0x558d('0x1a'),new AGIError(_0x558d('0x1b')));_0x1d1a25['destroy']();});_0x1d1a25[_0x558d('0x1c')](_0x52b448);this[_0x558d('0x1d')]=function(_0x443b0a,_0x2296af){var _0x443b0a=_0x443b0a||'',_0x2296af=typeof _0x2296af==_0x558d('0x1e')?_0x2296af:new Function();_0x1c07cd={'tx':_0x443b0a,'rx':'','cb':_0x2296af};_0x1d1a25[_0x558d('0x1f')](_0x443b0a+'\x0a');},this[_0x558d('0x18')]=function(){_0x1d1a25['destroy']();};}util[_0x558d('0x20')](AGIChannel,EventEmitter);AGIChannel[_0x558d('0x21')][_0x558d('0x22')]=function(_0x1360dc){return this[_0x558d('0x1d')][_0x558d('0x23')](this,_0x1360dc);};AGIChannel[_0x558d('0x21')]['answer']=function(){return this[_0x558d('0x22')](_0x558d('0x24'));};AGIChannel[_0x558d('0x21')][_0x558d('0x25')]=function(_0x1c8a42,_0x597350,_0xb5f289){_0x1c8a42=_0x1c8a42===undefined?_0x558d('0x26'):_0x1c8a42;_0x597350=_0x597350===undefined?'5':_0x597350;_0xb5f289=_0xb5f289===undefined?'1':_0xb5f289;return this['sendRequest'](util['format'](_0x558d('0x27'),_0x1c8a42,_0x597350*0x3e8,_0xb5f289));};AGIChannel[_0x558d('0x21')][_0x558d('0x28')]=function(_0x3e5ae7){_0x3e5ae7=_0x3e5ae7||'NO\x20MESSAGE';return this[_0x558d('0x22')](util['format'](_0x558d('0x29'),_0x3e5ae7));};AGIChannel['prototype']['exec']=function(_0x5e7edc,_0x3f5366){if(_[_0x558d('0x2a')](_0x3f5366)){return this[_0x558d('0x22')](util[_0x558d('0x2b')](_0x558d('0x2c'),_0x5e7edc,_0x3f5366['join'](',')));}return this[_0x558d('0x22')](util[_0x558d('0x2b')](_0x558d('0x2c'),_0x5e7edc,_0x3f5366));};AGIChannel['prototype'][_0x558d('0x2d')]=function(_0x3b1264){return this[_0x558d('0x22')](util['format'](_0x558d('0x2e'),_0x3b1264));};AGIChannel[_0x558d('0x21')]['setExtension']=function(_0x2926a1){return this[_0x558d('0x22')](util['format'](_0x558d('0x2f'),_0x2926a1));};AGIChannel[_0x558d('0x21')]['setPriority']=function(_0x2744f9){return this[_0x558d('0x22')](util['format']('SET\x20PRIORITY\x20%s',_0x2744f9));};AGIChannel[_0x558d('0x21')][_0x558d('0xb')]=function(){return this[_0x558d('0x22')](_0x558d('0x30'));};AGIChannel[_0x558d('0x21')][_0x558d('0x31')]=function(_0x52f1a4,_0x4a43b8){var _0x1aab8=_[_0x558d('0x32')](_0x4a43b8)||_[_0x558d('0x33')](_0x4a43b8)?_0x4a43b8[_0x558d('0x34')]():_0x4a43b8;return this['sendRequest'](util['format'](_0x558d('0x35'),_0x52f1a4,_0x1aab8?_0x1aab8['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x558d('0x36')]=function(_0x5a94ef,_0x4f23ea){return this[_0x558d('0x22')](util[_0x558d('0x2b')](_0x558d('0x37'),_0x5a94ef,_0x4f23ea));};AGIChannel['prototype'][_0x558d('0x38')]=function(_0x5111b8,_0x22e473){return this[_0x558d('0x22')](util['format'](_0x558d('0x39'),_0x5111b8,_0x22e473));};AGIChannel[_0x558d('0x21')][_0x558d('0x3a')]=function(_0x2777d6,_0x1c00d9){return this[_0x558d('0x22')](util[_0x558d('0x2b')](_0x558d('0x3b'),_0x2777d6,_0x1c00d9));};AGIChannel[_0x558d('0x21')][_0x558d('0x3c')]=function(_0x59a254,_0x5acb6b,_0x51a812){_0x5acb6b=_0x5acb6b||this[_0x558d('0x3d')];_0x51a812=_0x51a812||0x1;this[_0x558d('0x2d')](_0x59a254);this[_0x558d('0x3e')](_0x5acb6b);this[_0x558d('0x3f')](_0x51a812);return this['noop'](util['format'](_0x558d('0x40'),_0x59a254,_0x5acb6b,_0x51a812));};AGIChannel[_0x558d('0x21')][_0x558d('0x41')]=function(_0x5b7613){return this['sendRequest'](util[_0x558d('0x2b')](_0x558d('0x42'),_0x5b7613));};AGIChannel[_0x558d('0x21')][_0x558d('0x43')]=function(_0x21fa53,_0x48a3ea,_0x271e09,_0x3a1104,_0xd47eac,_0x2c2e86){_0x48a3ea=_0x48a3ea||'wav';_0x271e09=_0x271e09||'';_0x3a1104=_0x3a1104===undefined?-0x1:_0x3a1104==='-1'?-0x1:_0x3a1104*0x3e8;_0xd47eac=_0xd47eac===undefined?'':'s='+_0xd47eac;_0x2c2e86=_0x2c2e86?'BEEP':'';return this[_0x558d('0x22')](util[_0x558d('0x2b')](_0x558d('0x44'),_0x21fa53,_0x48a3ea,_0x271e09,_0x3a1104,_0x2c2e86,_0xd47eac));};AGIChannel[_0x558d('0x21')][_0x558d('0x45')]=function(_0x5b85e0,_0x19b61e){_0x19b61e=_0x19b61e||'';return this[_0x558d('0x22')](util[_0x558d('0x2b')](_0x558d('0x46'),_0x5b85e0,_0x19b61e));};AGIChannel['prototype'][_0x558d('0x47')]=function(_0x51060f){return this[_0x558d('0x48')](_0x558d('0x49'),_0x51060f);};AGIChannel['prototype']['wait']=function(_0x138a3b){return this[_0x558d('0x48')](_0x558d('0x4a'),_0x138a3b);};AGIChannel[_0x558d('0x21')][_0x558d('0x16')]=function(_0x1bf0a3,_0x12a10e){this[_0x558d('0x28')](util[_0x558d('0x2b')](_0x558d('0x4b'),_0x1bf0a3['id'],_0x1bf0a3[_0x558d('0x4c')],_0x12a10e));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x558d('0x4d')]=AGIChannel; \ No newline at end of file +var _0x5993=['exports','util','lodash','events','./error','call','setEncoding','headers','emit','ready','line','toLowerCase','substring','520-Invalid','replace','result=','indexOf','substr','startsWith','length','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','command','function','write','destroy','inherits','sendRequest','prototype','getData','format','noop','NO\x20MESSAGE','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20EXTENSION\x20%s','setPriority','hangup','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','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','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s'];(function(_0x405f5b,_0x3d8098){var _0x44b4d9=function(_0x4f6bb5){while(--_0x4f6bb5){_0x405f5b['push'](_0x405f5b['shift']());}};_0x44b4d9(++_0x3d8098);}(_0x5993,0x1ab));var _0x3599=function(_0x13cab0,_0x14d825){_0x13cab0=_0x13cab0-0x0;var _0x38804f=_0x5993[_0x13cab0];return _0x38804f;};'use strict';var util=require(_0x3599('0x0'));var _=require(_0x3599('0x1'));var EventEmitter=require(_0x3599('0x2'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0x3599('0x3'));function AGIChannel(_0x3baf11){var _0x5dc63d=this,_0x14522f=new AGIReply(),_0xd3f533=![],_0x27cdc8={};EventEmitter[_0x3599('0x4')](_0x5dc63d);_0x3baf11[_0x3599('0x5')]('utf8');_0x3baf11['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x14522f[_0x3599('0x5')]('utf8');_0x14522f['on'](_0x3599('0x6'),function(_0x195e42){for(var _0xfb16e9 in _0x195e42){_0x5dc63d[_0xfb16e9]=_0x195e42[_0xfb16e9];}_0x5dc63d[_0x3599('0x7')](_0x3599('0x8'));});_0x14522f['on'](_0x3599('0x9'),function(_0x58f85e){if(_0x58f85e[_0x3599('0xa')]()=='hangup'){_0x5dc63d[_0x3599('0x7')]('hangup');return;}if(_0x58f85e[_0x3599('0xb')](0x0,0xb)==_0x3599('0xc')){_0xd3f533=!![];}if(_0xd3f533){_0x27cdc8['rx']+=_0x58f85e+'\x0a';if(_0x58f85e['search']('520\x20End\x20of\x20proper')!=-0x1){_0xd3f533=![];}}else{_0x27cdc8['rx']=_0x58f85e;}if(_0xd3f533){return;}if(typeof _0x27cdc8['cb']=='function'){var _0x16a0b8=_0x27cdc8['rx'][_0x3599('0xb')](0x0,0x3),_0x2c13b6=null,_0x1b3533=null;_0x16a0b8=parseInt(_0x16a0b8);if(isNaN(_0x16a0b8)){_0x27cdc8['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x16a0b8!=0xc8){_0x27cdc8['cb'](null,{'code':_0x16a0b8,'result':-0x1,'extra':'KO'});return;}_0x2c13b6=_0x27cdc8['rx'][_0x3599('0xb')](0x4)[_0x3599('0xd')](_0x3599('0xe'),'');if(_0x2c13b6[_0x3599('0xf')]('\x20')!=-0x1){_0x2c13b6=_0x2c13b6[_0x3599('0x10')](0x0,_0x2c13b6[_0x3599('0xf')]('\x20'));}if(_[_0x3599('0x11')](_0x2c13b6,'-1')){_0x2c13b6=parseInt(_0x2c13b6);}_0x1b3533=_0x27cdc8['rx']['split']('\x20');if(_0x1b3533[_0x3599('0x12')]==0x3){_0x1b3533=_0x1b3533[0x2][_0x3599('0xb')](0x1,_0x1b3533[0x2][_0x3599('0x12')]-0x1);}else if(_0x1b3533['length']>0x3){var _0x1232f8=/\((.+)\)/;var _0x55a909=_0x27cdc8['rx']['match'](_0x1232f8);if(_0x55a909){_0x1b3533=_0x55a909[0x1];}else{_0x1b3533=null;}}else{_0x1b3533=null;}_0x27cdc8['cb'](null,{'code':_0x16a0b8,'result':_0x2c13b6,'extra':_0x1b3533});}});_0x3baf11['on'](_0x3599('0x13'),function(_0x4d8cc5){_0x5dc63d[_0x3599('0x7')](_0x3599('0x13'),new AGIError(_0x3599('0x14'),_0x4d8cc5[_0x3599('0x15')]));});_0x3baf11['on'](_0x3599('0x16'),function(){_0x5dc63d['emit'](_0x3599('0x16'),new AGIError(_0x3599('0x17')));});_0x3baf11['on'](_0x3599('0x18'),function(){_0x5dc63d['emit'](_0x3599('0x18'),new AGIError(_0x3599('0x19')));_0x3baf11['destroy']();});_0x3baf11['pipe'](_0x14522f);this[_0x3599('0x1a')]=function(_0xd203a5,_0x22f77a){var _0xd203a5=_0xd203a5||'',_0x22f77a=typeof _0x22f77a==_0x3599('0x1b')?_0x22f77a:new Function();_0x27cdc8={'tx':_0xd203a5,'rx':'','cb':_0x22f77a};_0x3baf11[_0x3599('0x1c')](_0xd203a5+'\x0a');},this[_0x3599('0x16')]=function(){_0x3baf11[_0x3599('0x1d')]();};}util[_0x3599('0x1e')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x3599('0x1f')]=function(_0x5fc8c2){return this[_0x3599('0x1a')]['sync'](this,_0x5fc8c2);};AGIChannel[_0x3599('0x20')]['answer']=function(){return this[_0x3599('0x1f')]('ANSWER');};AGIChannel[_0x3599('0x20')][_0x3599('0x21')]=function(_0x4f388f,_0x140e97,_0x4ec224){_0x4f388f=_0x4f388f===undefined?'beep':_0x4f388f;_0x140e97=_0x140e97===undefined?'5':_0x140e97;_0x4ec224=_0x4ec224===undefined?'1':_0x4ec224;return this[_0x3599('0x1f')](util[_0x3599('0x22')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x4f388f,_0x140e97*0x3e8,_0x4ec224));};AGIChannel[_0x3599('0x20')][_0x3599('0x23')]=function(_0x5cbfe1){_0x5cbfe1=_0x5cbfe1||_0x3599('0x24');return this['sendRequest'](util[_0x3599('0x22')]('VERBOSE\x20\x22%s\x22',_0x5cbfe1));};AGIChannel[_0x3599('0x20')][_0x3599('0x25')]=function(_0x483973,_0x46cd63){if(_[_0x3599('0x26')](_0x46cd63)){return this[_0x3599('0x1f')](util['format'](_0x3599('0x27'),_0x483973,_0x46cd63[_0x3599('0x28')](',')));}return this[_0x3599('0x1f')](util[_0x3599('0x22')](_0x3599('0x27'),_0x483973,_0x46cd63));};AGIChannel['prototype'][_0x3599('0x29')]=function(_0x1705e2){return this[_0x3599('0x1f')](util['format']('SET\x20CONTEXT\x20%s',_0x1705e2));};AGIChannel[_0x3599('0x20')][_0x3599('0x2a')]=function(_0x5b8505){return this[_0x3599('0x1f')](util[_0x3599('0x22')](_0x3599('0x2b'),_0x5b8505));};AGIChannel[_0x3599('0x20')][_0x3599('0x2c')]=function(_0x4faee2){return this[_0x3599('0x1f')](util[_0x3599('0x22')]('SET\x20PRIORITY\x20%s',_0x4faee2));};AGIChannel['prototype'][_0x3599('0x2d')]=function(){return this[_0x3599('0x1f')]('HANGUP');};AGIChannel['prototype']['setVariable']=function(_0x27127a,_0xc6c48b){var _0x28e5bd=_['isBoolean'](_0xc6c48b)||_[_0x3599('0x2e')](_0xc6c48b)?_0xc6c48b[_0x3599('0x2f')]():_0xc6c48b;return this[_0x3599('0x1f')](util[_0x3599('0x22')](_0x3599('0x30'),_0x27127a,_0x28e5bd?_0x28e5bd[_0x3599('0x2f')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x3599('0x20')][_0x3599('0x31')]=function(_0x4c5cfe,_0x4920f9){return this[_0x3599('0x1f')](util[_0x3599('0x22')](_0x3599('0x32'),_0x4c5cfe,_0x4920f9));};AGIChannel['prototype'][_0x3599('0x33')]=function(_0x183104,_0x36dfda){return this['sendRequest'](util[_0x3599('0x22')](_0x3599('0x34'),_0x183104,_0x36dfda));};AGIChannel[_0x3599('0x20')][_0x3599('0x35')]=function(_0x224e2f,_0x127422){return this[_0x3599('0x1f')](util[_0x3599('0x22')](_0x3599('0x36'),_0x224e2f,_0x127422));};AGIChannel['prototype'][_0x3599('0x37')]=function(_0x1730e0,_0x13dcd3,_0x19cae2){_0x13dcd3=_0x13dcd3||this[_0x3599('0x38')];_0x19cae2=_0x19cae2||0x1;this['setContext'](_0x1730e0);this[_0x3599('0x2a')](_0x13dcd3);this[_0x3599('0x2c')](_0x19cae2);return this[_0x3599('0x23')](util[_0x3599('0x22')](_0x3599('0x39'),_0x1730e0,_0x13dcd3,_0x19cae2));};AGIChannel[_0x3599('0x20')][_0x3599('0x3a')]=function(_0x4ee689){return this[_0x3599('0x1f')](util[_0x3599('0x22')](_0x3599('0x3b'),_0x4ee689));};AGIChannel['prototype'][_0x3599('0x3c')]=function(_0x1714b9,_0x342856,_0x584a0b,_0x17f8c5,_0xa87f1e,_0x42bb9a){_0x342856=_0x342856||_0x3599('0x3d');_0x584a0b=_0x584a0b||'';_0x17f8c5=_0x17f8c5===undefined?-0x1:_0x17f8c5==='-1'?-0x1:_0x17f8c5*0x3e8;_0xa87f1e=_0xa87f1e===undefined?'':'s='+_0xa87f1e;_0x42bb9a=_0x42bb9a?_0x3599('0x3e'):'';return this['sendRequest'](util[_0x3599('0x22')](_0x3599('0x3f'),_0x1714b9,_0x342856,_0x584a0b,_0x17f8c5,_0x42bb9a,_0xa87f1e));};AGIChannel[_0x3599('0x20')]['streamFile']=function(_0x278ad5,_0x3ae71d){_0x3ae71d=_0x3ae71d||'';return this[_0x3599('0x1f')](util[_0x3599('0x22')](_0x3599('0x40'),_0x278ad5,_0x3ae71d));};AGIChannel[_0x3599('0x20')][_0x3599('0x41')]=function(_0x35eb8f){return this['exec'](_0x3599('0x42'),_0x35eb8f);};AGIChannel['prototype'][_0x3599('0x43')]=function(_0x2bbe16){return this['exec'](_0x3599('0x44'),_0x2bbe16);};AGIChannel['prototype']['error']=function(_0x24c0c4,_0x668209){this['noop'](util[_0x3599('0x22')](_0x3599('0x45'),_0x24c0c4['id'],_0x24c0c4['label'],_0x668209));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x3599('0x46')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index d391399..e369a87 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 _0xcec0=['Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','format','apply','message','name','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.'];(function(_0x18ee5d,_0xd670c0){var _0x2db3cd=function(_0x485307){while(--_0x485307){_0x18ee5d['push'](_0x18ee5d['shift']());}};_0x2db3cd(++_0xd670c0);}(_0xcec0,0xad));var _0x0cec=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xcec0[_0x187ee1];return _0x388160;};'use strict';var util=require(_0x0cec('0x0'));var error={'E_AGI_UNDEFINED':_0x0cec('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x0cec('0x2'),'E_AGI_SERVER_CLOSE':_0x0cec('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x0cec('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x0cec('0x5'),'E_AGI_SOCKET_ERROR':_0x0cec('0x6'),'E_AGI_SOCKET_CLOSE':_0x0cec('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x0cec('0x8'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x0cec('0x9'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x5b2f6c){var _0x5b2f6c=_0x5b2f6c||null,_0x314111=_0x314111||[],_0x5c8560=0x1,_0x1c2666='';if(!error[_0x5b2f6c]){_0x5b2f6c=_0x0cec('0xa');}_0x314111['push'](error[_0x5b2f6c]);while(arguments[_0x5c8560]){_0x314111['push'](arguments[_0x5c8560]);_0x5c8560++;}_0x1c2666=util[_0x0cec('0xb')][_0x0cec('0xc')](util,_0x314111);this[_0x0cec('0xd')]=_0x1c2666;this[_0x0cec('0xe')]=_0x5b2f6c;}module[_0x0cec('0xf')]=AGIError; \ No newline at end of file +var _0x99fd=['Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','message','name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.'];(function(_0x57fa7e,_0xd0b5ce){var _0x320671=function(_0x3392cc){while(--_0x3392cc){_0x57fa7e['push'](_0x57fa7e['shift']());}};_0x320671(++_0xd0b5ce);}(_0x99fd,0x1bd));var _0xd99f=function(_0x2aeb32,_0x299258){_0x2aeb32=_0x2aeb32-0x0;var _0x4220c2=_0x99fd[_0x2aeb32];return _0x4220c2;};'use strict';var util=require(_0xd99f('0x0'));var error={'E_AGI_UNDEFINED':_0xd99f('0x1'),'E_AGI_ARGUMENT_PORT':_0xd99f('0x2'),'E_AGI_SERVER_ERROR':_0xd99f('0x3'),'E_AGI_SERVER_CLOSE':_0xd99f('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xd99f('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0xd99f('0x6'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xd99f('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xd99f('0x8'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xd99f('0x9'),'E_AGI_IVR_ENTRY':_0xd99f('0xa')};function AGIError(_0x4b9c17){var _0x4b9c17=_0x4b9c17||null,_0x20892e=_0x20892e||[],_0x53f6cc=0x1,_0x511a6b='';if(!error[_0x4b9c17]){_0x4b9c17='E_AGI_UNDEFINED';}_0x20892e[_0xd99f('0xb')](error[_0x4b9c17]);while(arguments[_0x53f6cc]){_0x20892e['push'](arguments[_0x53f6cc]);_0x53f6cc++;}_0x511a6b=util[_0xd99f('0xc')][_0xd99f('0xd')](util,_0x20892e);this[_0xd99f('0xe')]=_0x511a6b;this[_0xd99f('0xf')]=_0x4b9c17;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index de27652..91418f4 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 _0x0dcc=['default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','exports','lodash','../../../config/logger','agi','menu','getdigits','getsecretdigits','edges','numberOfEdges','vertices','prototype','addEdge','push','size','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','condition','split','agicommand','vswitch','target','invalid'];(function(_0x20cda,_0x5a52bc){var _0x476eac=function(_0x5e4bcf){while(--_0x5e4bcf){_0x20cda['push'](_0x20cda['shift']());}};_0x476eac(++_0x5a52bc);}(_0x0dcc,0xb8));var _0xc0dc=function(_0xe3fd2c,_0x5c2b41){_0xe3fd2c=_0xe3fd2c-0x0;var _0x2f1689=_0x0dcc[_0xe3fd2c];return _0x2f1689;};'use strict';var _=require(_0xc0dc('0x0'));var logger=require(_0xc0dc('0x1'))(_0xc0dc('0x2'));var verticesWithRetry=[_0xc0dc('0x3'),_0xc0dc('0x4'),_0xc0dc('0x5')];var Graph=function(){this['vertices']={};this[_0xc0dc('0x6')]={};this[_0xc0dc('0x7')]=0x0;};Graph['prototype']['addVertex']=function(_0x3c5b68){this[_0xc0dc('0x8')][_0x3c5b68['id']]=_0x3c5b68;this[_0xc0dc('0x6')][_0x3c5b68['id']]=[];};Graph[_0xc0dc('0x9')][_0xc0dc('0xa')]=function(_0x23e550,_0x219db3,_0x3ffe3a){this[_0xc0dc('0x6')][_0x23e550][_0xc0dc('0xb')]({'target':_0x219db3,'condition':_0x3ffe3a});this[_0xc0dc('0x7')]+=0x1;};Graph['prototype'][_0xc0dc('0xc')]=function(){return _['size'](this[_0xc0dc('0x8')]);};Graph[_0xc0dc('0x9')][_0xc0dc('0xd')]=function(){return this[_0xc0dc('0x7')];};Graph[_0xc0dc('0x9')][_0xc0dc('0xe')]=function(_0x5d71f2){return this[_0xc0dc('0x8')][_0x5d71f2];};Graph[_0xc0dc('0x9')][_0xc0dc('0xf')]=function(_0x59a012,_0x39de05){if(!this[_0xc0dc('0x8')][_0x59a012]){return logger[_0xc0dc('0x10')](_0xc0dc('0x11'));}var _0x58eb1a=_0x39de05(this[_0xc0dc('0x8')][_0x59a012]);if(!_0x58eb1a){return logger[_0xc0dc('0x10')](_0xc0dc('0x12'));}if(this['edges'][_0x59a012][_0xc0dc('0x13')]===0x0){return logger[_0xc0dc('0x10')]('no\x20edge/s\x20available');}for(var _0x2c71d8=0x0,_0x1d0a11=[],_0x31980f=![];_0x2c71d8\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','mxCell','isArray','length','source','target','addEdge','value','getSquareProject','then','createSquareReport','catch','agi_','substring','inspect','debug','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','sync','production','start','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','response','toString','agicommand\x20not\x20found','finally','clear','vertex','isUndefined','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening'];(function(_0x5480e5,_0x52e354){var _0x20b7cc=function(_0x21627d){while(--_0x21627d){_0x5480e5['push'](_0x5480e5['shift']());}};_0x20b7cc(++_0x52e354);}(_0xf3df,0x179));var _0xff3d=function(_0x40ff4e,_0x50a4a3){_0x40ff4e=_0x40ff4e-0x0;var _0x2ea887=_0xf3df[_0x40ff4e];return _0x2ea887;};'use strict';var parser=require(_0xff3d('0x0'));var _=require(_0xff3d('0x1'));var syncho=require(_0xff3d('0x2'));var util=require(_0xff3d('0x3'));var moment=require('moment');var config=require(_0xff3d('0x4'));var logger=require('../../config/logger')(_0xff3d('0x5'));var utilLicense=require(_0xff3d('0x6'));var rpc=require(_0xff3d('0x7'));var mailRpc=require(_0xff3d('0x8'));var Graph=require('./graph');var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xff3d('0x5')]=_[_0xff3d('0x9')](config['agi'],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x38e31a){process[_0xff3d('0xa')](function(){syncho(function(){try{setChannelVariables(_0x38e31a);agiHandler(_0x38e31a);}catch(_0x3c1ff7){logger[_0xff3d('0xb')](_0x3c1ff7[_0xff3d('0xc')]);}});});}function listeningHandler(){console[_0xff3d('0xd')](_0xff3d('0xe'),config[_0xff3d('0x5')][_0xff3d('0xf')]);logger[_0xff3d('0x10')](util[_0xff3d('0x11')](_0xff3d('0x12'),config[_0xff3d('0x5')]['ip'],config[_0xff3d('0x5')][_0xff3d('0xf')]));}function errorHandler(_0x5a07f7){if(_0x5a07f7&&_0x5a07f7[_0xff3d('0x13')]&&_0x5a07f7['message']){logger['error'](util[_0xff3d('0x11')](_0xff3d('0x14'),_0x5a07f7[_0xff3d('0x13')],_0x5a07f7[_0xff3d('0x15')]));}else{logger[_0xff3d('0xb')](util[_0xff3d('0x11')](_0xff3d('0x16'),_0x5a07f7[_0xff3d('0xc')]));}}function closeHandler(){logger[_0xff3d('0x10')](util[_0xff3d('0x11')](_0xff3d('0x17'),this[_0xff3d('0x18')],this[_0xff3d('0x19')],this[_0xff3d('0x1a')],this[_0xff3d('0x1b')],this['uniqueid']));try{createSquareReport(this);}catch(_0x1567de){logger['error'](_0x1567de['stack']);}}function timeoutHandler(){logger[_0xff3d('0x10')](util[_0xff3d('0x11')](_0xff3d('0x1c'),this[_0xff3d('0x18')],this[_0xff3d('0x19')],this[_0xff3d('0x1a')],this[_0xff3d('0x1b')],this[_0xff3d('0x1d')]));}function hangupHandler(){logger[_0xff3d('0x10')](util[_0xff3d('0x11')](_0xff3d('0x1e'),this['arg_1'],this[_0xff3d('0x19')],this[_0xff3d('0x1a')],this[_0xff3d('0x1b')],this[_0xff3d('0x1d')]));this['evtHangup']=!![];}function getRoot(_0x3e6efb){return parser[_0xff3d('0x1f')](_0x3e6efb,{'object':!![]})[_0xff3d('0x20')][_0xff3d('0x21')];}function addVertex(_0x418cff,_0xd1692e,_0x4c6a11){_0xd1692e[_0xff3d('0x22')]=_0x4c6a11;if(_0xd1692e[_0xff3d('0x23')](_0xff3d('0x24'))){_0xd1692e[_0xff3d('0x25')]=parseInt(_0xd1692e['retry'],0xa);}_0x418cff[_0xff3d('0x26')](_['omit'](_0xd1692e,_0xff3d('0x27')));}function initGraph(_0x2759cb,_0x41175e){var _0x196861=new Graph();for(var _0x4b34b3 in _0x2759cb){if(_0x2759cb[_0xff3d('0x23')](_0x4b34b3)){if(_[_0xff3d('0x28')](_0x2759cb[_0x4b34b3])){for(var _0x306039=0x0;_0x306039<_0x2759cb[_0x4b34b3][_0xff3d('0x29')];_0x306039+=0x1){addVertex(_0x196861,_0x2759cb[_0x4b34b3][_0x306039],_0x4b34b3);}}else{addVertex(_0x196861,_0x2759cb[_0x4b34b3],_0x4b34b3);}}}for(var _0x3ac4c6=0x0;_0x3ac4c6<_0x41175e[_0xff3d('0x29')];_0x3ac4c6+=0x1){if(_0x41175e[_0x3ac4c6][_0xff3d('0x2a')]&&_0x41175e[_0x3ac4c6][_0xff3d('0x2b')]){_0x196861[_0xff3d('0x2c')](_0x41175e[_0x3ac4c6][_0xff3d('0x2a')],_0x41175e[_0x3ac4c6]['target'],_0x41175e[_0x3ac4c6][_0xff3d('0x2d')]);}}return _0x196861;}function getSquareProject(_0x15741a,_0x4ac4b4){rpc[_0xff3d('0x2e')](_0x15741a)[_0xff3d('0x2f')](function(_0x30f60c){_0x4ac4b4(null,_0x30f60c);})['catch'](function(_0x5bf9de){_0x4ac4b4(null,_0x5bf9de);});}function createSquareReport(_0xc5b97f,_0x4a933a){rpc[_0xff3d('0x30')](_0xc5b97f)[_0xff3d('0x2f')](function(_0x7b6ca){if(_0x4a933a){_0x4a933a(null,_0x7b6ca);}})[_0xff3d('0x31')](function(_0x50d120){if(_0x4a933a){_0x4a933a(null,_0x50d120);}});}function setChannelVariables(_0x1ce10a){for(var _0x4f30b8 in _0x1ce10a){if(_0x1ce10a[_0xff3d('0x23')](_0x4f30b8)){if(_0x4f30b8['indexOf'](_0xff3d('0x32'))===0x0){_0x1ce10a[_0x4f30b8[_0xff3d('0x33')](0x4)]=_0x1ce10a[_0x4f30b8];delete _0x1ce10a[_0x4f30b8];}}}}function getLogFromObject(_0xe30db){return util[_0xff3d('0x34')](_0xe30db,{'showHidden':![],'depth':null});}function agiHandler(_0x39a2d3){var _0x12903d,_0x11cc1f,_0x2fa095,_0x10c455,_0x525526;logger[_0xff3d('0x35')](_0xff3d('0x36'),JSON['stringify'](_0x39a2d3,null,0x2));logger[_0xff3d('0x10')](util[_0xff3d('0x11')](_0xff3d('0x37'),_0x39a2d3[_0xff3d('0x18')],_0x39a2d3[_0xff3d('0x19')],_0x39a2d3['callerid'],_0x39a2d3[_0xff3d('0x1b')],_0x39a2d3['uniqueid']));_0x39a2d3['on'](_0xff3d('0xb'),errorHandler);_0x39a2d3['on'](_0xff3d('0x38'),closeHandler);_0x39a2d3['on'](_0xff3d('0x39'),timeoutHandler);_0x39a2d3[_0xff3d('0x3a')]=![];_0x39a2d3['on']('hangup',hangupHandler);var _0x218e9a=getSquareProject[_0xff3d('0x3b')](null,_0x39a2d3[_0xff3d('0x18')]);if(_0x218e9a){if(_0x218e9a[_0xff3d('0x3c')]){_0x12903d=getRoot(_0x218e9a['production']);if(_0x12903d&&_0x12903d[_0xff3d('0x3d')]){logger['debug'](_0xff3d('0x21'),JSON[_0xff3d('0x3e')](_0x12903d,null,0x2));_0x39a2d3[_0xff3d('0x3f')]=moment()[_0xff3d('0x11')](_0xff3d('0x40'));_0x11cc1f=initGraph(_[_0xff3d('0x41')](_0x12903d,_0xff3d('0x27')),_0x12903d[_0xff3d('0x27')]);_0x2fa095=new Vertices(_0x39a2d3,rpc,mailRpc);logger[_0xff3d('0x10')](util[_0xff3d('0x11')](_0xff3d('0x42'),_0x39a2d3[_0xff3d('0x18')],_0x39a2d3[_0xff3d('0x19')],_0x39a2d3[_0xff3d('0x1a')],_0x39a2d3[_0xff3d('0x1b')],_0x39a2d3[_0xff3d('0x1d')]));_0x11cc1f[_0xff3d('0x43')](_0x12903d[_0xff3d('0x3d')]['id'],function(_0x1d139f){try{_0x1d139f=_0x2fa095['clear'](_0x1d139f);logger['debug']('vertex',JSON['stringify'](_0x1d139f,null,0x2));if(_0x1d139f[_0xff3d('0x22')]===_0xff3d('0x44')){logger[_0xff3d('0x10')](_0xff3d('0x45'));_0x39a2d3[_0xff3d('0x46')]=_0x1d139f[_0xff3d('0x46')]||_0x39a2d3['context'];_0x39a2d3[_0xff3d('0x47')]=_0x1d139f[_0xff3d('0x47')];_0x39a2d3[_0xff3d('0x48')]=_0x1d139f['priority']?_0x1d139f[_0xff3d('0x48')]-0x1:0x1;return null;}else if(_0x1d139f&&_0x2fa095[_0x1d139f['agicommand']]){_0x525526=_0x2fa095[_0x1d139f[_0xff3d('0x22')]](_0x1d139f);logger[_0xff3d('0x10')]('response',JSON[_0xff3d('0x3e')](_0x525526,null,0x2));if(_0x525526&&_0x525526[_0xff3d('0x49')]===AGI_CODE_SUCCESS&&_0x525526[_0xff3d('0x4a')]!==AGI_RESULT_ERROR&&!_0x39a2d3[_0xff3d('0x3a')]){logger['debug'](_0xff3d('0x4b'),getLogFromObject(_0x525526));return _['isUndefined'](_0x525526[_0xff3d('0x4a')])?null:_0x525526[_0xff3d('0x4a')][_0xff3d('0x4c')]();}else{logger['error']('response',getLogFromObject(_0x525526));return null;}}else{logger[_0xff3d('0xb')](_0xff3d('0x4d'));return null;}}catch(_0x4605b9){logger[_0xff3d('0xb')](_0x4605b9['stack']);return null;}});if(_0x12903d[_0xff3d('0x4e')]){logger['info'](util[_0xff3d('0x11')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x39a2d3[_0xff3d('0x18')],_0x39a2d3[_0xff3d('0x19')],_0x39a2d3[_0xff3d('0x1a')],_0x39a2d3[_0xff3d('0x1b')],_0x39a2d3[_0xff3d('0x1d')]));_0x11cc1f['traverseBFS'](_0x12903d[_0xff3d('0x4e')]['id'],function(_0x129775){try{_0x129775=_0x2fa095[_0xff3d('0x4f')](_0x129775);logger[_0xff3d('0x35')](_0xff3d('0x50'),JSON['stringify'](_0x129775,null,0x2));if(_0x129775&&_0x2fa095[_0x129775[_0xff3d('0x22')]]){_0x525526=_0x2fa095[_0x129775[_0xff3d('0x22')]](_0x129775);if(_0x525526){logger[_0xff3d('0x35')](_0xff3d('0x4b'),getLogFromObject(_0x525526));return _[_0xff3d('0x51')](_0x525526['result'])?null:_0x525526[_0xff3d('0x4a')]['toString']();}else{logger[_0xff3d('0xb')]('response',getLogFromObject(_0x525526));return null;}}else{logger[_0xff3d('0xb')](_0xff3d('0x4d'));return null;}}catch(_0x474489){logger[_0xff3d('0xb')](_0x474489[_0xff3d('0xc')]);return null;}});}logger['info'](util[_0xff3d('0x11')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x39a2d3[_0xff3d('0x18')],_0x39a2d3[_0xff3d('0x19')],_0x39a2d3[_0xff3d('0x1a')],_0x39a2d3['dnid'],_0x39a2d3[_0xff3d('0x1d')]));logger[_0xff3d('0x10')](util[_0xff3d('0x11')](_0xff3d('0x52'),_0x39a2d3['context'],_0x39a2d3[_0xff3d('0x47')],parseInt(_0x39a2d3['priority'],0xa)+0x1));_0x39a2d3[_0xff3d('0x53')](_0x39a2d3[_0xff3d('0x46')],_0x39a2d3[_0xff3d('0x47')],parseInt(_0x39a2d3['priority'],0xa)+0x1);_0x39a2d3[_0xff3d('0x38')]();}}else{logger[_0xff3d('0xb')](util[_0xff3d('0x11')](_0xff3d('0x54'),_0x39a2d3['arg_1']));_0x39a2d3[_0xff3d('0x53')](_0x39a2d3['context'],_0x39a2d3[_0xff3d('0x47')],parseInt(_0x39a2d3['priority'],0xa)+0x1);_0x39a2d3[_0xff3d('0x38')]();}}else{logger['error'](util[_0xff3d('0x11')]('Project\x20%s\x20not\x20found',_0x39a2d3[_0xff3d('0x18')]));_0x39a2d3['continueAt'](_0x39a2d3[_0xff3d('0x46')],_0x39a2d3[_0xff3d('0x47')],parseInt(_0x39a2d3[_0xff3d('0x48')],0xa)+0x1);_0x39a2d3[_0xff3d('0x38')]();}}function main(){var _0x1edd41;return utilLicense[_0xff3d('0x55')]()[_0xff3d('0x2f')](function(_0x3faf94){if(_0x3faf94){if(_0x3faf94['voice']){if(_0x3faf94['callysquare']&&_0x3faf94[_0xff3d('0x56')]>0x0){logger['info'](util[_0xff3d('0x11')](_0xff3d('0x57'),_0x3faf94[_0xff3d('0x56')]));_0x1edd41=_0x3faf94[_0xff3d('0x56')];}else{logger[_0xff3d('0x10')](_0xff3d('0x58'));}}else{logger[_0xff3d('0x10')](_0xff3d('0x59'));_0x1edd41=-0x1;}}})['catch'](function(_0x3168ac){logger[_0xff3d('0xb')](_0xff3d('0x5a'),_0x3168ac[_0xff3d('0xc')]);})[_0xff3d('0x4e')](function(){var _0x591524=require(_0xff3d('0x5b'))(config['agi'][_0xff3d('0xf')],config[_0xff3d('0x5')]['ip'],_0x1edd41);_0x591524['on']('error',errorHandler);_0x591524['on'](_0xff3d('0x5c'),listeningHandler);_0x591524['on'](_0xff3d('0x5d'),connectionHandler);_0x591524['on'](_0xff3d('0x38'),closeHandler);});}main(); \ No newline at end of file +var _0x76bc=['../../config/environment','agi','../../config/license/util','./mailRpc','./vertices','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','mxGraphModel','root','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','source','addEdge','target','value','getSquareProject','then','createSquareReport','catch','inspect','variables','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','start','debug','stringify','traverseBFS','clear','agicommand','gotoc','context','extension','priority','code','result','response','isUndefined','toString','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','vertex','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','connection','xml2json','syncho','util','moment'];(function(_0x5b1a1a,_0x3e7ecf){var _0x56385f=function(_0x20ae56){while(--_0x20ae56){_0x5b1a1a['push'](_0x5b1a1a['shift']());}};_0x56385f(++_0x3e7ecf);}(_0x76bc,0x1b4));var _0xc76b=function(_0x46a3e8,_0x2e1b35){_0x46a3e8=_0x46a3e8-0x0;var _0xf1442e=_0x76bc[_0x46a3e8];return _0xf1442e;};'use strict';var parser=require(_0xc76b('0x0'));var _=require('lodash');var syncho=require(_0xc76b('0x1'));var util=require(_0xc76b('0x2'));var moment=require(_0xc76b('0x3'));var config=require(_0xc76b('0x4'));var logger=require('../../config/logger')(_0xc76b('0x5'));var utilLicense=require(_0xc76b('0x6'));var rpc=require('./rpc');var mailRpc=require(_0xc76b('0x7'));var Graph=require('./graph');var Vertices=require(_0xc76b('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xc76b('0x5')]=_['defaults'](config[_0xc76b('0x5')],{'ip':_0xc76b('0x9'),'port':0x11dd});function connectionHandler(_0x2a4d93){process[_0xc76b('0xa')](function(){syncho(function(){try{setChannelVariables(_0x2a4d93);agiHandler(_0x2a4d93);}catch(_0x5c3ace){logger[_0xc76b('0xb')](_0x5c3ace[_0xc76b('0xc')]);}});});}function listeningHandler(){console[_0xc76b('0xd')](_0xc76b('0xe'),config[_0xc76b('0x5')][_0xc76b('0xf')]);logger[_0xc76b('0x10')](util[_0xc76b('0x11')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xc76b('0x5')]['ip'],config[_0xc76b('0x5')]['port']));}function errorHandler(_0x166e3c){if(_0x166e3c&&_0x166e3c[_0xc76b('0x12')]&&_0x166e3c[_0xc76b('0x13')]){logger[_0xc76b('0xb')](util[_0xc76b('0x11')](_0xc76b('0x14'),_0x166e3c[_0xc76b('0x12')],_0x166e3c[_0xc76b('0x13')]));}else{logger[_0xc76b('0xb')](util[_0xc76b('0x11')](_0xc76b('0x15'),_0x166e3c['stack']));}}function closeHandler(){logger[_0xc76b('0x10')](util['format'](_0xc76b('0x16'),this[_0xc76b('0x17')],this[_0xc76b('0x18')],this[_0xc76b('0x19')],this[_0xc76b('0x1a')],this['uniqueid']));try{createSquareReport(this);}catch(_0x558444){logger[_0xc76b('0xb')](_0x558444[_0xc76b('0xc')]);}}function timeoutHandler(){logger[_0xc76b('0x10')](util['format'](_0xc76b('0x1b'),this[_0xc76b('0x17')],this[_0xc76b('0x18')],this[_0xc76b('0x19')],this[_0xc76b('0x1a')],this[_0xc76b('0x1c')]));}function hangupHandler(){logger[_0xc76b('0x10')](util[_0xc76b('0x11')](_0xc76b('0x1d'),this[_0xc76b('0x17')],this['calleridname'],this[_0xc76b('0x19')],this['dnid'],this[_0xc76b('0x1c')]));this[_0xc76b('0x1e')]=!![];}function getRoot(_0x1545aa){return parser['toJson'](_0x1545aa,{'object':!![]})[_0xc76b('0x1f')][_0xc76b('0x20')];}function addVertex(_0x12c73f,_0x48db71,_0x9b0989){_0x48db71['agicommand']=_0x9b0989;if(_0x48db71[_0xc76b('0x21')](_0xc76b('0x22'))){_0x48db71['maxRetry']=parseInt(_0x48db71[_0xc76b('0x22')],0xa);}_0x12c73f[_0xc76b('0x23')](_[_0xc76b('0x24')](_0x48db71,_0xc76b('0x25')));}function initGraph(_0x57c28c,_0x4c2429){var _0x5d26af=new Graph();for(var _0x36766e in _0x57c28c){if(_0x57c28c['hasOwnProperty'](_0x36766e)){if(_[_0xc76b('0x26')](_0x57c28c[_0x36766e])){for(var _0x26471e=0x0;_0x26471e<_0x57c28c[_0x36766e]['length'];_0x26471e+=0x1){addVertex(_0x5d26af,_0x57c28c[_0x36766e][_0x26471e],_0x36766e);}}else{addVertex(_0x5d26af,_0x57c28c[_0x36766e],_0x36766e);}}}for(var _0x1bef75=0x0;_0x1bef75<_0x4c2429[_0xc76b('0x27')];_0x1bef75+=0x1){if(_0x4c2429[_0x1bef75][_0xc76b('0x28')]&&_0x4c2429[_0x1bef75]['target']){_0x5d26af[_0xc76b('0x29')](_0x4c2429[_0x1bef75][_0xc76b('0x28')],_0x4c2429[_0x1bef75][_0xc76b('0x2a')],_0x4c2429[_0x1bef75][_0xc76b('0x2b')]);}}return _0x5d26af;}function getSquareProject(_0x198b21,_0x53c7ec){rpc[_0xc76b('0x2c')](_0x198b21)[_0xc76b('0x2d')](function(_0x27e09f){_0x53c7ec(null,_0x27e09f);})['catch'](function(_0x383d7){_0x53c7ec(null,_0x383d7);});}function createSquareReport(_0x4815bb,_0x35fbd0){rpc[_0xc76b('0x2e')](_0x4815bb)['then'](function(_0x573983){if(_0x35fbd0){_0x35fbd0(null,_0x573983);}})[_0xc76b('0x2f')](function(_0x162b96){if(_0x35fbd0){_0x35fbd0(null,_0x162b96);}});}function setChannelVariables(_0x2d11fe){for(var _0xeafba5 in _0x2d11fe){if(_0x2d11fe['hasOwnProperty'](_0xeafba5)){if(_0xeafba5['indexOf']('agi_')===0x0){_0x2d11fe[_0xeafba5['substring'](0x4)]=_0x2d11fe[_0xeafba5];delete _0x2d11fe[_0xeafba5];}}}}function getLogFromObject(_0x3d569c){return util[_0xc76b('0x30')](_0x3d569c,{'showHidden':![],'depth':null});}function agiHandler(_0x59745e){var _0x1a5d37,_0x313af5,_0x3c0b17,_0x170db3,_0x234bb7;logger['debug'](_0xc76b('0x31'),JSON['stringify'](_0x59745e,null,0x2));logger['info'](util[_0xc76b('0x11')](_0xc76b('0x32'),_0x59745e[_0xc76b('0x17')],_0x59745e[_0xc76b('0x18')],_0x59745e[_0xc76b('0x19')],_0x59745e[_0xc76b('0x1a')],_0x59745e[_0xc76b('0x1c')]));_0x59745e['on'](_0xc76b('0xb'),errorHandler);_0x59745e['on'](_0xc76b('0x33'),closeHandler);_0x59745e['on'](_0xc76b('0x34'),timeoutHandler);_0x59745e[_0xc76b('0x1e')]=![];_0x59745e['on'](_0xc76b('0x35'),hangupHandler);var _0x39b028=getSquareProject[_0xc76b('0x36')](null,_0x59745e['arg_1']);if(_0x39b028){if(_0x39b028[_0xc76b('0x37')]){_0x1a5d37=getRoot(_0x39b028[_0xc76b('0x37')]);if(_0x1a5d37&&_0x1a5d37[_0xc76b('0x38')]){logger[_0xc76b('0x39')](_0xc76b('0x20'),JSON[_0xc76b('0x3a')](_0x1a5d37,null,0x2));_0x59745e['joinAt']=moment()[_0xc76b('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x313af5=initGraph(_[_0xc76b('0x24')](_0x1a5d37,_0xc76b('0x25')),_0x1a5d37[_0xc76b('0x25')]);_0x3c0b17=new Vertices(_0x59745e,rpc,mailRpc);logger[_0xc76b('0x10')](util[_0xc76b('0x11')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x59745e['arg_1'],_0x59745e[_0xc76b('0x18')],_0x59745e[_0xc76b('0x19')],_0x59745e[_0xc76b('0x1a')],_0x59745e[_0xc76b('0x1c')]));_0x313af5[_0xc76b('0x3b')](_0x1a5d37[_0xc76b('0x38')]['id'],function(_0x5b0286){try{_0x5b0286=_0x3c0b17[_0xc76b('0x3c')](_0x5b0286);logger[_0xc76b('0x39')]('vertex',JSON[_0xc76b('0x3a')](_0x5b0286,null,0x2));if(_0x5b0286[_0xc76b('0x3d')]===_0xc76b('0x3e')){logger[_0xc76b('0x10')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x59745e[_0xc76b('0x3f')]=_0x5b0286[_0xc76b('0x3f')]||_0x59745e[_0xc76b('0x3f')];_0x59745e[_0xc76b('0x40')]=_0x5b0286[_0xc76b('0x40')];_0x59745e['priority']=_0x5b0286[_0xc76b('0x41')]?_0x5b0286[_0xc76b('0x41')]-0x1:0x1;return null;}else if(_0x5b0286&&_0x3c0b17[_0x5b0286[_0xc76b('0x3d')]]){_0x234bb7=_0x3c0b17[_0x5b0286[_0xc76b('0x3d')]](_0x5b0286);logger[_0xc76b('0x10')]('response',JSON[_0xc76b('0x3a')](_0x234bb7,null,0x2));if(_0x234bb7&&_0x234bb7[_0xc76b('0x42')]===AGI_CODE_SUCCESS&&_0x234bb7[_0xc76b('0x43')]!==AGI_RESULT_ERROR&&!_0x59745e[_0xc76b('0x1e')]){logger['debug'](_0xc76b('0x44'),getLogFromObject(_0x234bb7));return _[_0xc76b('0x45')](_0x234bb7[_0xc76b('0x43')])?null:_0x234bb7[_0xc76b('0x43')][_0xc76b('0x46')]();}else{logger[_0xc76b('0xb')](_0xc76b('0x44'),getLogFromObject(_0x234bb7));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x3f02a8){logger['error'](_0x3f02a8['stack']);return null;}});if(_0x1a5d37[_0xc76b('0x47')]){logger[_0xc76b('0x10')](util[_0xc76b('0x11')](_0xc76b('0x48'),_0x59745e[_0xc76b('0x17')],_0x59745e[_0xc76b('0x18')],_0x59745e[_0xc76b('0x19')],_0x59745e[_0xc76b('0x1a')],_0x59745e[_0xc76b('0x1c')]));_0x313af5[_0xc76b('0x3b')](_0x1a5d37[_0xc76b('0x47')]['id'],function(_0x51bf6f){try{_0x51bf6f=_0x3c0b17[_0xc76b('0x3c')](_0x51bf6f);logger['debug'](_0xc76b('0x49'),JSON[_0xc76b('0x3a')](_0x51bf6f,null,0x2));if(_0x51bf6f&&_0x3c0b17[_0x51bf6f[_0xc76b('0x3d')]]){_0x234bb7=_0x3c0b17[_0x51bf6f[_0xc76b('0x3d')]](_0x51bf6f);if(_0x234bb7){logger[_0xc76b('0x39')](_0xc76b('0x44'),getLogFromObject(_0x234bb7));return _['isUndefined'](_0x234bb7[_0xc76b('0x43')])?null:_0x234bb7['result'][_0xc76b('0x46')]();}else{logger[_0xc76b('0xb')]('response',getLogFromObject(_0x234bb7));return null;}}else{logger[_0xc76b('0xb')](_0xc76b('0x4a'));return null;}}catch(_0x430354){logger[_0xc76b('0xb')](_0x430354[_0xc76b('0xc')]);return null;}});}logger[_0xc76b('0x10')](util[_0xc76b('0x11')](_0xc76b('0x4b'),_0x59745e[_0xc76b('0x17')],_0x59745e['calleridname'],_0x59745e[_0xc76b('0x19')],_0x59745e[_0xc76b('0x1a')],_0x59745e[_0xc76b('0x1c')]));logger[_0xc76b('0x10')](util[_0xc76b('0x11')](_0xc76b('0x4c'),_0x59745e[_0xc76b('0x3f')],_0x59745e[_0xc76b('0x40')],parseInt(_0x59745e[_0xc76b('0x41')],0xa)+0x1));_0x59745e[_0xc76b('0x4d')](_0x59745e['context'],_0x59745e[_0xc76b('0x40')],parseInt(_0x59745e[_0xc76b('0x41')],0xa)+0x1);_0x59745e['close']();}}else{logger[_0xc76b('0xb')](util[_0xc76b('0x11')](_0xc76b('0x4e'),_0x59745e['arg_1']));_0x59745e[_0xc76b('0x4d')](_0x59745e[_0xc76b('0x3f')],_0x59745e[_0xc76b('0x40')],parseInt(_0x59745e['priority'],0xa)+0x1);_0x59745e['close']();}}else{logger[_0xc76b('0xb')](util[_0xc76b('0x11')](_0xc76b('0x4f'),_0x59745e['arg_1']));_0x59745e[_0xc76b('0x4d')](_0x59745e[_0xc76b('0x3f')],_0x59745e[_0xc76b('0x40')],parseInt(_0x59745e['priority'],0xa)+0x1);_0x59745e['close']();}}function main(){var _0x2583b7;return utilLicense[_0xc76b('0x50')]()[_0xc76b('0x2d')](function(_0x4fe752){if(_0x4fe752){if(_0x4fe752[_0xc76b('0x51')]){if(_0x4fe752[_0xc76b('0x52')]&&_0x4fe752['callysquare']>0x0){logger['info'](util[_0xc76b('0x11')]('[LICENSE]\x20CHANNELS:\x20%s',_0x4fe752['callysquare']));_0x2583b7=_0x4fe752['callysquare'];}else{logger[_0xc76b('0x10')](_0xc76b('0x53'));}}else{logger['info'](_0xc76b('0x54'));_0x2583b7=-0x1;}}})[_0xc76b('0x2f')](function(_0x352e65){logger['error'](_0xc76b('0x55'),_0x352e65[_0xc76b('0xc')]);})['finally'](function(){var _0x39f26f=require(_0xc76b('0x56'))(config['agi'][_0xc76b('0xf')],config[_0xc76b('0x5')]['ip'],_0x2583b7);_0x39f26f['on']('error',errorHandler);_0x39f26f['on']('listening',listeningHandler);_0x39f26f['on'](_0xc76b('0x57'),connectionHandler);_0x39f26f['on'](_0xc76b('0x33'),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 c0b45fe..1cadd34 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 _0x8380=['request','error','message','result','sendMailMessage','SendMail','bluebird','jayson/promise','client'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x8380,0x192));var _0x0838=function(_0x4d31a3,_0x5e920c){_0x4d31a3=_0x4d31a3-0x0;var _0x52ca8b=_0x8380[_0x4d31a3];return _0x52ca8b;};'use strict';var BPromise=require(_0x0838('0x0'));var jayson=require(_0x0838('0x1'));var client=jayson[_0x0838('0x2')]['http']({'port':0x232b});function request(_0x3e1da9,_0x55c9a4){return new BPromise(function(_0x164272,_0x395647){return client[_0x0838('0x3')](_0x3e1da9,_0x55c9a4)['then'](function(_0x555a9b){if(_0x555a9b[_0x0838('0x4')]){return _0x395647(_0x555a9b[_0x0838('0x4')][_0x0838('0x5')]);}else{return _0x164272(_0x555a9b[_0x0838('0x6')]);}})['catch'](function(_0x59bfa7){return _0x395647(_0x59bfa7);});});}exports[_0x0838('0x7')]=function(_0xc6c636,_0x3b233c){return request(_0x0838('0x8'),{'account':_0xc6c636,'message':_0x3b233c});}; \ No newline at end of file +var _0x1c8a=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','http','request','then','error','message','result'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x1c8a,0x1f2));var _0xa1c8=function(_0x479f15,_0x544345){_0x479f15=_0x479f15-0x0;var _0x3455f1=_0x1c8a[_0x479f15];return _0x3455f1;};'use strict';var BPromise=require(_0xa1c8('0x0'));var jayson=require(_0xa1c8('0x1'));var client=jayson['client'][_0xa1c8('0x2')]({'port':0x232b});function request(_0x5d8fe3,_0x348f97){return new BPromise(function(_0x3e9a7f,_0x5570e5){return client[_0xa1c8('0x3')](_0x5d8fe3,_0x348f97)[_0xa1c8('0x4')](function(_0x50e7b5){if(_0x50e7b5[_0xa1c8('0x5')]){return _0x5570e5(_0x50e7b5[_0xa1c8('0x5')][_0xa1c8('0x6')]);}else{return _0x3e9a7f(_0x50e7b5[_0xa1c8('0x7')]);}})[_0xa1c8('0x8')](function(_0x26afcc){return _0x5570e5(_0x26afcc);});});}exports[_0xa1c8('0x9')]=function(_0x38c420,_0x15b5d5){return request(_0xa1c8('0xa'),{'account':_0x38c420,'message':_0x15b5d5});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index da7082a..cd3475b 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 _0x9011=['_inBody','inherits','prototype','toString','indexOf','substring','length','split','slice','trim','emit','headers','line','exports','stream','Transform','call','_localBuffer'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9011,0x1f4));var _0x1901=function(_0x193a65,_0x343333){_0x193a65=_0x193a65-0x0;var _0x3d0523=_0x9011[_0x193a65];return _0x3d0523;};'use strict';var util=require('util');var Transform=require(_0x1901('0x0'))[_0x1901('0x1')];function AGIReply(_0x7db334){Transform[_0x1901('0x2')](this,_0x7db334);this[_0x1901('0x3')]='';this[_0x1901('0x4')]=![];}util[_0x1901('0x5')](AGIReply,Transform);AGIReply[_0x1901('0x6')]['_transform']=function(_0x14bb3a,_0x41bf05,_0x1f62b0){var _0x2113e0='\x0a',_0x55260b=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x30246e=-0x1,_0x1baab6=-0x1,_0xa94186='',_0x3f2260=0x0,_0x5bab51='',_0x394fb9='';this[_0x1901('0x3')]+=_0x14bb3a[_0x1901('0x7')]();_0x5bab51=this[_0x1901('0x3')];if(!this[_0x1901('0x4')]){_0x3f2260=0x0;while(_0x55260b[_0x3f2260]){while((_0x1baab6=_0x5bab51[_0x1901('0x8')](_0x55260b[_0x3f2260]))!=-0x1){_0xa94186=_0x55260b[_0x3f2260];_0x394fb9=_0x5bab51[_0x1901('0x9')](0x0,_0x1baab6);_0x5bab51=_0x5bab51[_0x1901('0x9')](_0x1baab6+_0xa94186[_0x1901('0xa')]);var _0x1f5102=_0x394fb9[_0x1901('0xb')](_0x2113e0),_0x3a70d4=0x0,_0x34cb96={},_0x3a6248='',_0x102c5e='',_0x436175=-0x1;while(_0x1f5102[_0x3a70d4]){_0x436175=_0x1f5102[_0x3a70d4]['indexOf'](':');if(_0x436175!=-0x1){_0x3a6248=_0x1f5102[_0x3a70d4]['slice'](0x0,_0x436175)['trim']();_0x102c5e=_0x1f5102[_0x3a70d4][_0x1901('0xc')](_0x436175+0x1)[_0x1901('0xd')]();if(_0x3a6248[_0x1901('0xa')]>0x0){_0x34cb96[_0x3a6248]=_0x102c5e;}}else{}_0x3a70d4++;}this[_0x1901('0xe')](_0x1901('0xf'),_0x34cb96);this[_0x1901('0x4')]=!![];}_0x3f2260++;}this['_localBuffer']=_0x5bab51;}else{while((_0x30246e=_0x5bab51[_0x1901('0x8')](_0x2113e0))!=-0x1){_0x394fb9=_0x5bab51['substring'](0x0,_0x30246e);this[_0x1901('0xe')](_0x1901('0x10'),_0x394fb9);_0x5bab51=_0x5bab51[_0x1901('0x9')](_0x30246e+_0x2113e0['length']);}this[_0x1901('0x3')]=_0x5bab51;}_0x1f62b0();};module[_0x1901('0x11')]=AGIReply; \ No newline at end of file +var _0x08b3=['_transform','\x0d\x0a\x0d\x0a','toString','substring','indexOf','slice','trim','length','emit','line','exports','util','Transform','call','_localBuffer','_inBody','inherits'];(function(_0x492221,_0x9e2521){var _0x398bf9=function(_0x303c5b){while(--_0x303c5b){_0x492221['push'](_0x492221['shift']());}};_0x398bf9(++_0x9e2521);}(_0x08b3,0xe8));var _0x308b=function(_0xe7bdae,_0x373c81){_0xe7bdae=_0xe7bdae-0x0;var _0x1c44b4=_0x08b3[_0xe7bdae];return _0x1c44b4;};'use strict';var util=require(_0x308b('0x0'));var Transform=require('stream')[_0x308b('0x1')];function AGIReply(_0x35bfd5){Transform[_0x308b('0x2')](this,_0x35bfd5);this[_0x308b('0x3')]='';this[_0x308b('0x4')]=![];}util[_0x308b('0x5')](AGIReply,Transform);AGIReply['prototype'][_0x308b('0x6')]=function(_0x20ed84,_0x2b5504,_0x31ad9c){var _0x5c3661='\x0a',_0x2e1e63=['\x0a\x0a',_0x308b('0x7')],_0x44512d=-0x1,_0x45c5b1=-0x1,_0xeee37e='',_0x494cca=0x0,_0x43564a='',_0x5875ac='';this[_0x308b('0x3')]+=_0x20ed84[_0x308b('0x8')]();_0x43564a=this['_localBuffer'];if(!this['_inBody']){_0x494cca=0x0;while(_0x2e1e63[_0x494cca]){while((_0x45c5b1=_0x43564a['indexOf'](_0x2e1e63[_0x494cca]))!=-0x1){_0xeee37e=_0x2e1e63[_0x494cca];_0x5875ac=_0x43564a[_0x308b('0x9')](0x0,_0x45c5b1);_0x43564a=_0x43564a[_0x308b('0x9')](_0x45c5b1+_0xeee37e['length']);var _0x574643=_0x5875ac['split'](_0x5c3661),_0x34017a=0x0,_0x4721b6={},_0x587355='',_0x237ac0='',_0x432fb5=-0x1;while(_0x574643[_0x34017a]){_0x432fb5=_0x574643[_0x34017a][_0x308b('0xa')](':');if(_0x432fb5!=-0x1){_0x587355=_0x574643[_0x34017a][_0x308b('0xb')](0x0,_0x432fb5)[_0x308b('0xc')]();_0x237ac0=_0x574643[_0x34017a][_0x308b('0xb')](_0x432fb5+0x1)[_0x308b('0xc')]();if(_0x587355[_0x308b('0xd')]>0x0){_0x4721b6[_0x587355]=_0x237ac0;}}else{}_0x34017a++;}this[_0x308b('0xe')]('headers',_0x4721b6);this[_0x308b('0x4')]=!![];}_0x494cca++;}this[_0x308b('0x3')]=_0x43564a;}else{while((_0x44512d=_0x43564a[_0x308b('0xa')](_0x5c3661))!=-0x1){_0x5875ac=_0x43564a[_0x308b('0x9')](0x0,_0x44512d);this['emit'](_0x308b('0xf'),_0x5875ac);_0x43564a=_0x43564a[_0x308b('0x9')](_0x44512d+_0x5c3661['length']);}this[_0x308b('0x3')]=_0x43564a;}_0x31ad9c();};module[_0x308b('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 536498b..380a5c8 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 _0x4e98=['agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','moment','lodash','util','jayson/promise','client','http','request','error','message','result','getSquareProject','ShowSquareProject','production','getMailAccountById','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','then','CreateCmContact','getPauseById','LoginUser'];(function(_0x560623,_0x5c748a){var _0x2a9089=function(_0x565d41){while(--_0x565d41){_0x560623['push'](_0x560623['shift']());}};_0x2a9089(++_0x5c748a);}(_0x4e98,0xed));var _0x84e9=function(_0x556812,_0x4d1223){_0x556812=_0x556812-0x0;var _0x33fea6=_0x4e98[_0x556812];return _0x33fea6;};'use strict';var BPromise=require('bluebird');var moment=require(_0x84e9('0x0'));var _=require(_0x84e9('0x1'));var util=require(_0x84e9('0x2'));var jayson=require(_0x84e9('0x3'));var client=jayson[_0x84e9('0x4')][_0x84e9('0x5')]({'port':0x2329});function request(_0x4d627f,_0x24efaf){return new BPromise(function(_0x5561cd,_0x2a606){return client[_0x84e9('0x6')](_0x4d627f,_0x24efaf)['then'](function(_0x325537){if(_0x325537[_0x84e9('0x7')]){return _0x2a606(_0x325537[_0x84e9('0x7')][_0x84e9('0x8')]);}else{return _0x5561cd(_0x325537[_0x84e9('0x9')]);}})['catch'](function(_0x340205){return _0x2a606(_0x340205);});});}exports[_0x84e9('0xa')]=function(_0x439622){return request(_0x84e9('0xb'),{'options':{'raw':![],'where':{'name':_0x439622},'attributes':[_0x84e9('0xc')]}});};exports[_0x84e9('0xd')]=function(_0x29afc4){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x29afc4},'include':[{'model':_0x84e9('0xe'),'as':_0x84e9('0xf')}],'attributes':['id',_0x84e9('0x10'),_0x84e9('0x11')]}});};exports[_0x84e9('0x12')]=function(_0x5bb5e2){return request(_0x84e9('0xb'),{'options':{'where':{'id':_0x5bb5e2},'attributes':[_0x84e9('0x10')]}});};exports[_0x84e9('0x13')]=function(_0x5dd696){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x5dd696},'attributes':[_0x84e9('0x10')]}});};exports[_0x84e9('0x14')]=function(_0x1d8057){return request(_0x84e9('0x15'),{'options':{'where':{'id':_0x1d8057},'attributes':[_0x84e9('0x10')]}});};exports['getSquareOdbcById']=function(_0x2f084f){return request(_0x84e9('0x16'),{'options':{'where':{'id':_0x2f084f},'attributes':[_0x84e9('0x17')]}});};exports[_0x84e9('0x18')]=function(_0x22c08b){return request(_0x84e9('0x19'),{'options':{'where':{'id':_0x22c08b},'attributes':[_0x84e9('0x10')]}});};exports[_0x84e9('0x1a')]=function(_0x19e4b0){return request(_0x84e9('0x1b'),{'options':{'where':{'id':_0x19e4b0},'attributes':[_0x84e9('0x10')]}});};exports['getSoundById']=function(_0x1f0bdf){return request('ShowSound',{'options':{'where':{'id':_0x1f0bdf},'attributes':[_0x84e9('0x1c')]}});};exports[_0x84e9('0x1d')]=function(_0x772ce4){return request(_0x84e9('0x1e'),{'options':{'raw':![],'where':{'id':_0x772ce4},'include':[{'model':_0x84e9('0x1f'),'as':_0x84e9('0x20')}]}});};exports[_0x84e9('0x21')]=function(_0x291d62){return request('ShowSmsAccount',{'options':{'where':{'id':_0x291d62},'attributes':['id',_0x84e9('0x10')]}});};exports[_0x84e9('0x22')]=function(_0x47bdc7){return request(_0x84e9('0x23'),{'body':_0x47bdc7});};exports['createSquareDetailsReport']=function(_0x48a491){return request(_0x84e9('0x24'),{'body':_0x48a491});};exports[_0x84e9('0x25')]=function(_0x297ac4){return request(_0x84e9('0x26'),{'body':_[_0x84e9('0x27')](_0x297ac4,{'project_name':_0x297ac4[_0x84e9('0x28')],'prev_project_name':_0x297ac4[_0x84e9('0x29')]||'','is_subproject':_0x297ac4[_0x84e9('0x29')]?!![]:![],'leaveAt':moment()['format'](_0x84e9('0x2a'))})});};exports['createSquareRecording']=function(_0x544a5e){return request(_0x84e9('0x2b'),{'body':_0x544a5e});};exports[_0x84e9('0x2c')]=function(_0x30d47e){return request(_0x84e9('0x2d'),{'body':_0x30d47e});};exports[_0x84e9('0x2e')]=function(_0x2797c4){return request(_0x84e9('0x2f'),{'options':{'raw':![],'where':{'phone':_0x2797c4[_0x84e9('0x30')],'ListId':_0x2797c4['ListId']}}})[_0x84e9('0x31')](function(_0x5ebe1d){if(_0x5ebe1d){return _0x5ebe1d;}return request(_0x84e9('0x32'),{'body':_0x2797c4});});};exports[_0x84e9('0x33')]=function(_0x3e6e08){return request('ShowPause',{'options':{'where':{'id':_0x3e6e08},'attributes':['name']}});};exports['agentLogin']=function(_0x19a85d,_0x5f544a){return request(_0x84e9('0x34'),{'body':{'interface':_0x5f544a},'options':{'where':_0x19a85d}});};exports[_0x84e9('0x35')]=function(_0x2cc452,_0x391317,_0x1d0452){return request(_0x84e9('0x36'),{'body':{'type':_0x391317,'uniqueid':_0x1d0452},'options':{'where':_0x2cc452}});};exports[_0x84e9('0x37')]=function(_0x3d75bd){return request(_0x84e9('0x38'),{'body':{},'options':{'where':_0x3d75bd}});};exports[_0x84e9('0x39')]=function(_0x5a8536){return request('LogoutUser',{'body':{},'options':{'where':_0x5a8536}});}; \ No newline at end of file +var _0xb37a=['save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','createSquareRecording','CreateSquareRecording','createSquareMessage','ShowCmHopper','phone','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','agentUnpause','agentLogout','LogoutUser','moment','lodash','util','http','request','then','error','message','catch','getSquareProject','ShowSquareProject','getMailAccountById','MailServerOut','Smtp','name','email','getVoiceQueueById','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb37a,0x129));var _0xab37=function(_0xe1c87f,_0x35000d){_0xe1c87f=_0xe1c87f-0x0;var _0x2960ae=_0xb37a[_0xe1c87f];return _0x2960ae;};'use strict';var BPromise=require('bluebird');var moment=require(_0xab37('0x0'));var _=require(_0xab37('0x1'));var util=require(_0xab37('0x2'));var jayson=require('jayson/promise');var client=jayson['client'][_0xab37('0x3')]({'port':0x2329});function request(_0x4db1e3,_0x49b9fa){return new BPromise(function(_0x29c634,_0x516d3f){return client[_0xab37('0x4')](_0x4db1e3,_0x49b9fa)[_0xab37('0x5')](function(_0x5295ab){if(_0x5295ab['error']){return _0x516d3f(_0x5295ab[_0xab37('0x6')][_0xab37('0x7')]);}else{return _0x29c634(_0x5295ab['result']);}})[_0xab37('0x8')](function(_0x2fe43f){return _0x516d3f(_0x2fe43f);});});}exports[_0xab37('0x9')]=function(_0x2c107c){return request(_0xab37('0xa'),{'options':{'raw':![],'where':{'name':_0x2c107c},'attributes':['production']}});};exports[_0xab37('0xb')]=function(_0x2a35d3){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x2a35d3},'include':[{'model':_0xab37('0xc'),'as':_0xab37('0xd')}],'attributes':['id',_0xab37('0xe'),_0xab37('0xf')]}});};exports['getSquareProjectById']=function(_0xf72787){return request(_0xab37('0xa'),{'options':{'where':{'id':_0xf72787},'attributes':[_0xab37('0xe')]}});};exports[_0xab37('0x10')]=function(_0x17d161){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x17d161},'attributes':[_0xab37('0xe')]}});};exports[_0xab37('0x11')]=function(_0x899804){return request('ShowVariable',{'options':{'where':{'id':_0x899804},'attributes':[_0xab37('0xe')]}});};exports[_0xab37('0x12')]=function(_0x2c816c){return request(_0xab37('0x13'),{'options':{'where':{'id':_0x2c816c},'attributes':[_0xab37('0x14')]}});};exports[_0xab37('0x15')]=function(_0x59b58c){return request(_0xab37('0x16'),{'options':{'where':{'id':_0x59b58c},'attributes':[_0xab37('0xe')]}});};exports[_0xab37('0x17')]=function(_0xae4a9f){return request(_0xab37('0x18'),{'options':{'where':{'id':_0xae4a9f},'attributes':[_0xab37('0xe')]}});};exports[_0xab37('0x19')]=function(_0xf22e4a){return request(_0xab37('0x1a'),{'options':{'where':{'id':_0xf22e4a},'attributes':[_0xab37('0x1b')]}});};exports[_0xab37('0x1c')]=function(_0x1fd47f){return request(_0xab37('0x1d'),{'options':{'raw':![],'where':{'id':_0x1fd47f},'include':[{'model':_0xab37('0x1e'),'as':_0xab37('0x1f')}]}});};exports[_0xab37('0x20')]=function(_0x1217c9){return request('ShowSmsAccount',{'options':{'where':{'id':_0x1217c9},'attributes':['id',_0xab37('0xe')]}});};exports[_0xab37('0x21')]=function(_0x212304){return request(_0xab37('0x22'),{'body':_0x212304});};exports[_0xab37('0x23')]=function(_0x1ba799){return request(_0xab37('0x24'),{'body':_0x1ba799});};exports['createSquareReport']=function(_0x129680){return request(_0xab37('0x25'),{'body':_[_0xab37('0x26')](_0x129680,{'project_name':_0x129680[_0xab37('0x27')],'prev_project_name':_0x129680[_0xab37('0x28')]||'','is_subproject':_0x129680[_0xab37('0x28')]?!![]:![],'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xab37('0x29')]=function(_0x2e7e5f){return request(_0xab37('0x2a'),{'body':_0x2e7e5f});};exports[_0xab37('0x2b')]=function(_0x5a9372){return request('CreateSquareMessage',{'body':_0x5a9372});};exports['createCmContact']=function(_0x26ec58){return request(_0xab37('0x2c'),{'options':{'raw':![],'where':{'phone':_0x26ec58[_0xab37('0x2d')],'ListId':_0x26ec58[_0xab37('0x2e')]}}})[_0xab37('0x5')](function(_0x30b136){if(_0x30b136){return _0x30b136;}return request(_0xab37('0x2f'),{'body':_0x26ec58});});};exports['getPauseById']=function(_0x1edf25){return request(_0xab37('0x30'),{'options':{'where':{'id':_0x1edf25},'attributes':[_0xab37('0xe')]}});};exports[_0xab37('0x31')]=function(_0x5bc24a,_0x5b1321){return request(_0xab37('0x32'),{'body':{'interface':_0x5b1321},'options':{'where':_0x5bc24a}});};exports['agentPause']=function(_0x29f4f4,_0x3bd72f,_0x203d28){return request('PauseUser',{'body':{'type':_0x3bd72f,'uniqueid':_0x203d28},'options':{'where':_0x29f4f4}});};exports[_0xab37('0x33')]=function(_0x336dc9){return request('UnpauseUser',{'body':{},'options':{'where':_0x336dc9}});};exports[_0xab37('0x34')]=function(_0x1ce3d5){return request(_0xab37('0x35'),{'body':{},'options':{'where':_0x1ce3d5}});}; \ 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 d44a1bf..6ec2983 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 _0x1b94=['./polly','./lex','exports'];(function(_0x3778d8,_0x5ce417){var _0x45a1b3=function(_0x28488a){while(--_0x28488a){_0x3778d8['push'](_0x3778d8['shift']());}};_0x45a1b3(++_0x5ce417);}(_0x1b94,0x1f2));var _0x41b9=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x1b94[_0xda464c];return _0x19e222;};var polly=require(_0x41b9('0x0'));var lex=require(_0x41b9('0x1'));module[_0x41b9('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xfdcd=['exports','./lex'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xfdcd,0xe9));var _0xdfdc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfdcd[_0x3dd15e];return _0x231fd0;};var polly=require('./polly');var lex=require(_0xdfdc('0x0'));module[_0xdfdc('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 3d30804..3121db4 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 _0xee5b=['./lib/api'];(function(_0x303310,_0x3d6211){var _0x1e4370=function(_0x1d648){while(--_0x1d648){_0x303310['push'](_0x303310['shift']());}};_0x1e4370(++_0x3d6211);}(_0xee5b,0x1f4));var _0xbee5=function(_0x5fb1d9,_0x45a7de){_0x5fb1d9=_0x5fb1d9-0x0;var _0x48ffa1=_0xee5b[_0x5fb1d9];return _0x48ffa1;};'use strict';var lex=require(_0xbee5('0x0'));module['exports']=function(_0x7b2344,_0x203bba,_0x4f850a,_0x1893e4,_0x2b93c2,_0x2eb857){return lex(_0x7b2344,_0x203bba,_0x4f850a,_0x1893e4,_0x2b93c2,_0x2eb857);}; \ No newline at end of file +var _0x153f=['exports','./lib/api'];(function(_0x441563,_0x1d4a28){var _0x2369ec=function(_0x1f97ba){while(--_0x1f97ba){_0x441563['push'](_0x441563['shift']());}};_0x2369ec(++_0x1d4a28);}(_0x153f,0x15b));var _0xf153=function(_0x13473b,_0x542e99){_0x13473b=_0x13473b-0x0;var _0x3b83c8=_0x153f[_0x13473b];return _0x3b83c8;};'use strict';var lex=require(_0xf153('0x0'));module[_0xf153('0x1')]=function(_0xde7eae,_0x44cea3,_0x2afb9a,_0x1ccc1c,_0x3b85fc,_0x59757c){return lex(_0xde7eae,_0x44cea3,_0x2afb9a,_0x1ccc1c,_0x3b85fc,_0x59757c);}; \ 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 df54a26..bf0d184 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(_0x55bfdb,_0x305b4f){var _0x344cc7=function(_0x6f9e6d){while(--_0x6f9e6d){_0x55bfdb['push'](_0x55bfdb['shift']());}};_0x344cc7(++_0x305b4f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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(_0x48c530,_0x19969f){var _0x4471fc=function(_0x1f77fe){while(--_0x1f77fe){_0x48c530['push'](_0x48c530['shift']());}};_0x4471fc(++_0x19969f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 2cd3acb..ef95d7e 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 _0xf5f5=['./lib/api','exports'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xf5f5,0x13e));var _0x5f5f=function(_0x229014,_0x5b21cd){_0x229014=_0x229014-0x0;var _0x1f57f5=_0xf5f5[_0x229014];return _0x1f57f5;};'use strict';var polly=require(_0x5f5f('0x0'));module[_0x5f5f('0x1')]=function(_0x3c8aee,_0xa216a3,_0x1d4c32,_0x4a7f2e,_0x74a422,_0x4ae547,_0xb71006){return polly(_0x3c8aee,_0xa216a3,_0x1d4c32,_0x4a7f2e,_0x74a422,_0x4ae547,_0xb71006);}; \ No newline at end of file +var _0x76f4=['./lib/api'];(function(_0xf3f1ed,_0x57e63e){var _0x3f5837=function(_0x29216f){while(--_0x29216f){_0xf3f1ed['push'](_0xf3f1ed['shift']());}};_0x3f5837(++_0x57e63e);}(_0x76f4,0xd2));var _0x476f=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x76f4[_0x33032e];return _0x13316b;};'use strict';var polly=require(_0x476f('0x0'));module['exports']=function(_0x16aaf8,_0x35c4f4,_0x52f815,_0xa86126,_0x18551d,_0x3b2655,_0x389722){return polly(_0x16aaf8,_0x35c4f4,_0x52f815,_0xa86126,_0x18551d,_0x3b2655,_0x389722);}; \ 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 b7e2437..ec667f3 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 _0xea0d=['exports','Polly','text','path','randomstring','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x3ac42c,_0x128452){var _0x53170b=function(_0x29249a){while(--_0x29249a){_0x3ac42c['push'](_0x3ac42c['shift']());}};_0x53170b(++_0x128452);}(_0xea0d,0x139));var _0xdea0=function(_0x345de7,_0x1de531){_0x345de7=_0x345de7-0x0;var _0x26ffc7=_0xea0d[_0x345de7];return _0x26ffc7;};'use strict';var fs=require('fs');var path=require(_0xdea0('0x0'));var BPromise=require('bluebird');var rs=require(_0xdea0('0x1'));var AWS=require(_0xdea0('0x2'));function pollyResult(_0x57ee58,_0x1cb2d1,_0x2f5b17){return new BPromise(function(_0x46db2e,_0xfca1eb){_0x57ee58[_0xdea0('0x3')](_0x1cb2d1,function(_0x5d0ed3,_0x586218){if(_0x5d0ed3){_0xfca1eb(_0x5d0ed3);}else if(_0x586218){if(_0x586218[_0xdea0('0x4')]instanceof Buffer){fs['writeFile'](_0x2f5b17,_0x586218['AudioStream'],function(_0x8cabfc){if(_0x8cabfc){_0xfca1eb(_0x8cabfc);}else{_0x46db2e();}});}else{_0xfca1eb(new Error(_0xdea0('0x5')));}}else{_0xfca1eb(new Error(_0xdea0('0x6')));}});});}module[_0xdea0('0x7')]=function(_0x291faf,_0x431c8,_0x363cf3,_0x3e528c,_0x1dfbb4,_0x3297ee,_0x3934ae){var _0x2df42b=new AWS[(_0xdea0('0x8'))]({'accessKeyId':_0x291faf,'secretAccessKey':_0x431c8,'region':_0x363cf3});var _0x5706b1={'Text':_0x1dfbb4,'TextType':_0x3297ee||_0xdea0('0x9'),'OutputFormat':'mp3','VoiceId':_0x3e528c};return pollyResult(_0x2df42b,_0x5706b1,_0x3934ae);}; \ No newline at end of file +var _0xad80=['exports','Polly','text','mp3','bluebird','randomstring','aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xad80,0x1c6));var _0x0ad8=function(_0x414fdc,_0x5e35a2){_0x414fdc=_0x414fdc-0x0;var _0x264c7a=_0xad80[_0x414fdc];return _0x264c7a;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x0ad8('0x0'));var rs=require(_0x0ad8('0x1'));var AWS=require(_0x0ad8('0x2'));function pollyResult(_0x3f8245,_0x7a6fc4,_0x70f39a){return new BPromise(function(_0xf989ac,_0x5be639){_0x3f8245['synthesizeSpeech'](_0x7a6fc4,function(_0x24b05c,_0x3c0cc1){if(_0x24b05c){_0x5be639(_0x24b05c);}else if(_0x3c0cc1){if(_0x3c0cc1[_0x0ad8('0x3')]instanceof Buffer){fs[_0x0ad8('0x4')](_0x70f39a,_0x3c0cc1['AudioStream'],function(_0x4e92f5){if(_0x4e92f5){_0x5be639(_0x4e92f5);}else{_0xf989ac();}});}else{_0x5be639(new Error(_0x0ad8('0x5')));}}else{_0x5be639(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x0ad8('0x6')]=function(_0x40aada,_0x55fd86,_0xadcc71,_0x1de24a,_0x3d383f,_0x380540,_0x128e4a){var _0x49d683=new AWS[(_0x0ad8('0x7'))]({'accessKeyId':_0x40aada,'secretAccessKey':_0x55fd86,'region':_0xadcc71});var _0xec5e07={'Text':_0x3d383f,'TextType':_0x380540||_0x0ad8('0x8'),'OutputFormat':_0x0ad8('0x9'),'VoiceId':_0x1de24a};return pollyResult(_0x49d683,_0xec5e07,_0x128e4a);}; \ 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 1972318..c54d95e 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 _0x1274=['exports'];(function(_0x3473ea,_0x25dfaf){var _0x5832c3=function(_0x13fab7){while(--_0x13fab7){_0x3473ea['push'](_0x3473ea['shift']());}};_0x5832c3(++_0x25dfaf);}(_0x1274,0x11c));var _0x4127=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1274[_0x3dd15e];return _0x231fd0;};'use strict';var asr=require('./lib/api');module[_0x4127('0x0')]=function(_0x546350,_0x3f97ea,_0x336282,_0x3c3758){return asr(_0x546350,_0x3f97ea,_0x336282);}; \ No newline at end of file +var _0xeaeb=['exports','./lib/api'];(function(_0x2bcf71,_0x192386){var _0x1d1e37=function(_0x180094){while(--_0x180094){_0x2bcf71['push'](_0x2bcf71['shift']());}};_0x1d1e37(++_0x192386);}(_0xeaeb,0x127));var _0xbeae=function(_0x4695e2,_0x3d5f15){_0x4695e2=_0x4695e2-0x0;var _0x160563=_0xeaeb[_0x4695e2];return _0x160563;};'use strict';var asr=require(_0xbeae('0x0'));module[_0xbeae('0x1')]=function(_0x11f585,_0x305335,_0x546e77,_0x56fe82){return asr(_0x11f585,_0x305335,_0x546e77);}; \ 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 bfb2056..d6f8e84 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 _0x37f8=['bluebird','https://speech.googleapis.com','exports','filepath\x20should\x20be\x20a\x20string','string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x37f8,0xd2));var _0x837f=function(_0x34d753,_0x1043af){_0x34d753=_0x34d753-0x0;var _0x379f29=_0x37f8[_0x34d753];return _0x379f29;};'use strict';var url=require('url');var BPromise=require(_0x837f('0x0'));var fs=require('fs');var host=_0x837f('0x1');module[_0x837f('0x2')]=function(_0x2b4e2c,_0x4b8b19,_0x16bb5c){return new BPromise(function(_0x5184ad,_0x5f2d01){var _0x5a04e7;if(typeof _0x2b4e2c!=='string'||_0x2b4e2c['length']===0x0){return _0x5f2d01(_0x837f('0x3'));}if(typeof _0x4b8b19!==_0x837f('0x4')||_0x4b8b19[_0x837f('0x5')]===0x0){return _0x5f2d01(_0x837f('0x6'));}if(typeof _0x16bb5c!==_0x837f('0x7')&&(typeof _0x16bb5c!==_0x837f('0x4')||_0x16bb5c[_0x837f('0x5')]===0x0)){return _0x5f2d01(_0x837f('0x8'));}try{_0x5a04e7=fs[_0x837f('0x9')](_0x2b4e2c)[_0x837f('0xa')](_0x837f('0xb'));}catch(_0x1aea1e){return _0x5f2d01(_0x1aea1e);}return _0x5184ad({'method':_0x837f('0xc'),'uri':host+_0x837f('0xd')+_0x4b8b19,'body':{'config':{'encoding':_0x837f('0xe'),'sampleRateHertz':'8000','languageCode':_0x16bb5c},'audio':{'content':_0x5a04e7}},'json':!![]});});}; \ No newline at end of file +var _0xfa2f=['length','filepath\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','/v1/speech:recognize?key=','https://speech.googleapis.com','string'];(function(_0x42d96b,_0x1f37f1){var _0x4e3192=function(_0x118e6c){while(--_0x118e6c){_0x42d96b['push'](_0x42d96b['shift']());}};_0x4e3192(++_0x1f37f1);}(_0xfa2f,0xe8));var _0xffa2=function(_0x577212,_0x430486){_0x577212=_0x577212-0x0;var _0x575b2e=_0xfa2f[_0x577212];return _0x575b2e;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host=_0xffa2('0x0');module['exports']=function(_0x2411c2,_0x34de1d,_0x4d6507){return new BPromise(function(_0x54d423,_0x3fcced){var _0x12b74e;if(typeof _0x2411c2!==_0xffa2('0x1')||_0x2411c2[_0xffa2('0x2')]===0x0){return _0x3fcced(_0xffa2('0x3'));}if(typeof _0x34de1d!==_0xffa2('0x1')||_0x34de1d[_0xffa2('0x2')]===0x0){return _0x3fcced('key\x20should\x20be\x20a\x20string');}if(typeof _0x4d6507!=='undefined'&&(typeof _0x4d6507!==_0xffa2('0x1')||_0x4d6507[_0xffa2('0x2')]===0x0)){return _0x3fcced(_0xffa2('0x4'));}try{_0x12b74e=fs[_0xffa2('0x5')](_0x2411c2)[_0xffa2('0x6')](_0xffa2('0x7'));}catch(_0x1fa2eb){return _0x3fcced(_0x1fa2eb);}return _0x54d423({'method':'POST','uri':host+_0xffa2('0x8')+_0x34de1d,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':'8000','languageCode':_0x4d6507},'audio':{'content':_0x12b74e}},'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 e6678b4..d8403c9 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 _0x0688=['./asr','exports'];(function(_0xc955cf,_0x352222){var _0x1c6e65=function(_0x233fcb){while(--_0x233fcb){_0xc955cf['push'](_0xc955cf['shift']());}};_0x1c6e65(++_0x352222);}(_0x0688,0xb6));var _0x8068=function(_0x324e19,_0xe03997){_0x324e19=_0x324e19-0x0;var _0x1186c7=_0x0688[_0x324e19];return _0x1186c7;};var asr=require(_0x8068('0x0'));module[_0x8068('0x1')]={'asr':asr}; \ No newline at end of file +var _0x2293=['exports'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x2293,0x1e0));var _0x3229=function(_0x5b306d,_0x498446){_0x5b306d=_0x5b306d-0x0;var _0x55bfc0=_0x2293[_0x5b306d];return _0x55bfc0;};var asr=require('./asr');module[_0x3229('0x0')]={'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 d79c5bc..5030df2 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 _0xead5=['displayName','languageCode','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','http','https','path','querystring','request-promise','randomstring','google-tts-api','url','parse','./aws','./google','./sestek','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','protocol','https:','host','get','\x20failed,\x20status\x20code\x20=\x20','statusCode','request\x20to\x20','statusMessage','info','finish\x20download\x20file','close','error','unlink','download\x20error','pipe','data','end','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','generate','.wav','writeFileSync','base64','then','chmodSync','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','voice','audioConfig','MP3','text:synthesize','tmp','from','writeFile','777','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','application/x-www-form-urlencoded','stringify','null','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','.mp3','goggleTTS\x20path','asr','uri','results','map','alternatives','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','actionIncomplete','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent'];(function(_0x2f4485,_0x43569d){var _0x378acd=function(_0x19819c){while(--_0x19819c){_0x2f4485['push'](_0x2f4485['shift']());}};_0x378acd(++_0x43569d);}(_0xead5,0x12e));var _0x5ead=function(_0xc87d08,_0x59c9be){_0xc87d08=_0xc87d08-0x0;var _0x30a714=_0xead5[_0xc87d08];return _0x30a714;};'use strict';var apiai=require(_0x5ead('0x0'));var BPromise=require(_0x5ead('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x5ead('0x2'));var https=require(_0x5ead('0x3'));var md5=require('md5');var path=require(_0x5ead('0x4'));var querystring=require(_0x5ead('0x5'));var rp=require(_0x5ead('0x6'));var rs=require(_0x5ead('0x7'));var sox=require('sox');var tts=require(_0x5ead('0x8'));var urlParse=require(_0x5ead('0x9'))[_0x5ead('0xa')];var util=require('util');var aws=require(_0x5ead('0xb'));var google=require(_0x5ead('0xc'));var sestek=require(_0x5ead('0xd'));var tilde=require(_0x5ead('0xe'));var logger=require(_0x5ead('0xf'))('agi');var ISPEECH_API=_0x5ead('0x10');function downloadFile(_0x506ffc,_0x26d931){return new BPromise(function(_0x4f06c3,_0x3b0b0e){var _0x2d72dd=urlParse(_0x506ffc);var _0x5241a5=_0x2d72dd[_0x5ead('0x11')]===_0x5ead('0x12')?https:http;var _0x39242f={'host':_0x2d72dd[_0x5ead('0x13')],'path':_0x2d72dd[_0x5ead('0x4')],'headers':{'user-agent':'WHAT_EVER'}};_0x5241a5[_0x5ead('0x14')](_0x39242f,function(_0x47aa28){if(_0x47aa28['statusCode']!==0xc8){logger['error']('request\x20to\x20'+_0x506ffc+_0x5ead('0x15')+_0x47aa28[_0x5ead('0x16')]+'\x20('+_0x47aa28['statusMessage']+')');_0x3b0b0e(new Error(_0x5ead('0x17')+_0x506ffc+_0x5ead('0x15')+_0x47aa28[_0x5ead('0x16')]+'\x20('+_0x47aa28[_0x5ead('0x18')]+')'));return;}var _0x1082bf=fs['createWriteStream'](_0x26d931);_0x1082bf['on']('finish',function(){logger[_0x5ead('0x19')](_0x5ead('0x1a'));_0x1082bf[_0x5ead('0x1b')](_0x4f06c3);});_0x1082bf['on'](_0x5ead('0x1c'),function(_0x276399){fs[_0x5ead('0x1d')](_0x26d931);logger[_0x5ead('0x1c')](_0x5ead('0x1e'),_0x276399);_0x3b0b0e(_0x276399);});_0x47aa28[_0x5ead('0x1f')](_0x1082bf);})['on'](_0x5ead('0x1c'),function(_0x3e9c5e){logger[_0x5ead('0x1c')](_0x3e9c5e);_0x3b0b0e(_0x3e9c5e);})['end']();});}function uploadFile(_0x431c4b){return new BPromise(function(_0x1936fa,_0x4f380f){var _0x441eee=urlParse(_0x431c4b);var _0x151f73=_0x441eee[_0x5ead('0x11')]===_0x5ead('0x12')?https:http;var _0x282075={'host':_0x441eee['host'],'path':_0x441eee['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x151f73[_0x5ead('0x14')](_0x282075,function(_0x37e5a7){if(_0x37e5a7[_0x5ead('0x16')]!==0xc8){_0x4f380f(new Error('request\x20to\x20'+_0x431c4b+'\x20failed,\x20status\x20code\x20=\x20'+_0x37e5a7[_0x5ead('0x16')]+'\x20('+_0x37e5a7[_0x5ead('0x18')]+')'));return;}var _0x1a60a9='';_0x37e5a7['on'](_0x5ead('0x20'),function(_0x4a3df7){_0x1a60a9+=_0x4a3df7;});_0x37e5a7['on'](_0x5ead('0x21'),function(){_0x1936fa(_0x1a60a9);});})['on'](_0x5ead('0x1c'),function(_0x4d2276){_0x4f380f(_0x4d2276);})[_0x5ead('0x21')]();});}function convertFile(_0x40ece2,_0x189146){return new BPromise(function(_0x3f41cc,_0x517cce){var _0x500152=sox[_0x5ead('0x22')](_0x40ece2,_0x189146,{'sampleRate':0x1f40,'format':_0x5ead('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x500152['on'](_0x5ead('0x1c'),function(_0x6bfde3){logger['error'](_0x5ead('0x24'),_0x6bfde3);_0x517cce(_0x6bfde3);});_0x500152['on']('end',function(){logger['info'](_0x5ead('0x25'));_0x3f41cc();});_0x500152[_0x5ead('0x26')]();});}function base64Decode(_0x19ebff,_0x484d55){var _0x49d622=path[_0x5ead('0x27')](__dirname,'tmp',rs[_0x5ead('0x28')](0x4)+_0x5ead('0x29'));fs[_0x5ead('0x2a')](_0x49d622,_0x19ebff,_0x5ead('0x2b'));return convertFile(_0x49d622,_0x484d55)[_0x5ead('0x2c')](function(){try{fs[_0x5ead('0x1d')](_0x49d622);fs[_0x5ead('0x2d')](_0x484d55,'777');}catch(_0x385f14){logger[_0x5ead('0x1c')](_0x385f14);}return _0x484d55['split']('.')[0x0];});}function base64Encode(_0x266caf){var _0x375068=fs[_0x5ead('0x2e')](_0x266caf);return new Buffer(_0x375068)['toString']('base64');}exports[_0x5ead('0x2f')]=function(_0x13ad7d,_0x29b785,_0x3021b1,_0x1b08b5,_0x2969ec,_0x50bcdf){var _0x297154,_0x575f7f;var _0x3c82f3=_0x5ead('0x30');var _0x346f80='?key='+_0x13ad7d;var _0x1d5102={};if(_0x29b785===_0x5ead('0x31')){_0x1d5102[_0x5ead('0x32')]={'ssml':_0x3021b1};}else{_0x1d5102[_0x5ead('0x32')]={'text':_0x3021b1};};_0x1d5102[_0x5ead('0x33')]={'languageCode':_0x1b08b5,'ssmlGender':_0x2969ec};_0x1d5102[_0x5ead('0x34')]={'audioEncoding':_0x5ead('0x35'),'sampleRateHertz':0x1f40};var _0x2b1161={'url':_0x3c82f3+_0x5ead('0x36')+_0x346f80,'method':'POST','json':!![],'body':_0x1d5102};return rp(_0x2b1161)[_0x5ead('0x2c')](function(_0x32c77d){return new BPromise(function(_0x5e6a88,_0xa8b3ba){_0x297154=path[_0x5ead('0x27')](__dirname,_0x5ead('0x37'),rs[_0x5ead('0x28')](0x4)+'.mp3');var _0x15df0f=Buffer[_0x5ead('0x38')](_0x32c77d['audioContent'],_0x5ead('0x2b'));return fs[_0x5ead('0x39')](_0x297154,_0x15df0f,function(_0x54279a){_0xa8b3ba(_0x54279a);},function(_0x3633e5){fs[_0x5ead('0x2d')](_0x297154,_0x5ead('0x3a'));_0x5e6a88(_0x3633e5);});});})[_0x5ead('0x2c')](function(_0x5c5a3c){_0x575f7f=path['resolve'](__dirname,_0x5ead('0x37'),rs[_0x5ead('0x28')](0x4)+_0x5ead('0x29'));return convertFile(_0x297154,_0x575f7f);})[_0x5ead('0x2c')](function(){try{fs[_0x5ead('0x1d')](_0x297154);fs[_0x5ead('0x2d')](_0x575f7f,'777');}catch(_0x97c65f){logger[_0x5ead('0x1c')](_0x97c65f);}logger[_0x5ead('0x19')](_0x5ead('0x3b'),_0x575f7f[_0x5ead('0x3c')]('.')[0x0]);return _0x575f7f['split']('.')[0x0];});};exports[_0x5ead('0x3d')]=function(_0x41d6d5,_0x358626){var _0x3f547f=_0x5ead('0x3e');var _0x4a0587,_0x5873fe;var _0x17d35e;var _0x4f5d9a={'encoding':_0x5ead('0x3f'),'method':_0x5ead('0x40'),'timeout':0x2710,'url':_0x3f547f,'headers':{'Content-Type':_0x5ead('0x41')},'body':'f.req='+encodeURIComponent(JSON[_0x5ead('0x42')]([[['jQ1olc',JSON['stringify']([_0x41d6d5,_0x358626||'en',![],_0x5ead('0x43')]),null,'generic']]]))};return rp(_0x4f5d9a)[_0x5ead('0x2c')](function(_0x4d0e8e){try{_0x17d35e=eval(_0x4d0e8e[_0x5ead('0x44')](0x5))[0x0][0x2];}catch(_0x2d184d){throw new Error(_0x5ead('0x45')+_0x4d0e8e[_0x5ead('0x20')]);}if(!_0x17d35e){if(_0x41d6d5[_0x5ead('0x46')]>0xc8){throw new Error(_0x5ead('0x47'));}else{throw new Error(_0x5ead('0x48')+_0x358626+_0x5ead('0x49'));}}try{_0x17d35e=eval(_0x17d35e)[0x0];}catch(_0x1808f7){throw new Error(_0x5ead('0x45')+res[_0x5ead('0x20')]);}const _0x314646=_0x17d35e;_0x4a0587=path[_0x5ead('0x27')](__dirname,'tmp',rs[_0x5ead('0x28')](0x4)+_0x5ead('0x4a'));fs['writeFileSync'](_0x4a0587,_0x17d35e,{'encoding':_0x5ead('0x2b')});_0x5873fe=path[_0x5ead('0x27')](__dirname,_0x5ead('0x37'),rs['generate'](0x4)+_0x5ead('0x29'));return convertFile(_0x4a0587,_0x5873fe);})[_0x5ead('0x2c')](function(){try{fs['unlink'](_0x4a0587);fs[_0x5ead('0x2d')](_0x5873fe,_0x5ead('0x3a'));}catch(_0x400175){logger[_0x5ead('0x1c')](_0x400175);}logger[_0x5ead('0x19')](_0x5ead('0x4b'),_0x5873fe['split']('.')[0x0]);return _0x5873fe['split']('.')[0x0];});};exports['googleASR']=function(_0x2f34df,_0x128bae,_0x338fa3){return google[_0x5ead('0x4c')](_0x2f34df,_0x128bae,_0x338fa3)[_0x5ead('0x2c')](function(_0x5344ef){logger['info'](_0x5344ef[_0x5ead('0x4d')]);return rp(_0x5344ef);})['then'](function(_0x942eb){var _0x568951='';var _0x21d444=0x0;try{fs[_0x5ead('0x1d')](_0x2f34df);}catch(_0x4e5535){logger['error'](_0x4e5535);}if(_0x942eb&&_0x942eb['results']){_0x568951=_0x942eb[_0x5ead('0x4e')][_0x5ead('0x4f')](function(_0x134d06){return _0x134d06&&_0x134d06[_0x5ead('0x50')][0x0]&&_0x134d06[_0x5ead('0x50')][0x0]['transcript']?_0x134d06['alternatives'][0x0]['transcript']:'';})[_0x5ead('0x51')]('\x0a');_0x21d444=_0x942eb[_0x5ead('0x4e')][_0x5ead('0x4f')](function(_0xe539cf){return _0xe539cf&&_0xe539cf[_0x5ead('0x50')][0x0]&&_0xe539cf[_0x5ead('0x50')][0x0][_0x5ead('0x52')]?_0xe539cf['alternatives'][0x0][_0x5ead('0x52')]:0x0;})[_0x5ead('0x51')]('\x0a');}logger[_0x5ead('0x19')](_0x5ead('0x53'),_0x568951);logger[_0x5ead('0x19')](_0x5ead('0x54'),_0x21d444);return{'transcript':_0x568951,'confidence':_0x21d444};})[_0x5ead('0x55')](function(_0x30df7a){logger[_0x5ead('0x1c')](_0x5ead('0x56'),_0x30df7a[_0x5ead('0x16')],_0x30df7a[_0x5ead('0x57')],_0x30df7a[_0x5ead('0x58')]);});};exports[_0x5ead('0x59')]=function(_0x51e320,_0x4f0ca7,_0x328d0c,_0x5e4c20){var _0xda9cb2=apiai(_0x4f0ca7,{'language':_0x5e4c20||'en'});return _0xda9cb2[_0x5ead('0x5a')](_0x328d0c,{'sessionId':md5(_0x51e320)})[_0x5ead('0x2c')](function(_0x569908){logger[_0x5ead('0x19')](JSON['stringify'](_0x569908));return{'source':_0x569908[_0x5ead('0x5b')][_0x5ead('0x5c')],'resolvedQuery':_0x569908['result'][_0x5ead('0x5d')],'action':_0x569908[_0x5ead('0x5b')]['action'],'actionIncomplete':_0x569908['result'][_0x5ead('0x5e')],'speech':_0x569908[_0x5ead('0x5b')]['fulfillment'][_0x5ead('0x5f')],'score':_0x569908[_0x5ead('0x5b')][_0x5ead('0x60')],'statusCode':_0x569908[_0x5ead('0x61')][_0x5ead('0x62')],'endConversation':_0x569908[_0x5ead('0x5b')][_0x5ead('0x63')][_0x5ead('0x64')]||![],'isFallbackIntent':_0x569908[_0x5ead('0x5b')][_0x5ead('0x63')][_0x5ead('0x65')]};});};exports[_0x5ead('0x66')]=function(_0xff6177,_0x257595,_0x432f42,_0x2fd248,_0x1d65ee,_0x3003cb){var _0x491121=_0x2fd248[_0x5ead('0x67')](/\\n/g,'\x0a');var _0x422fd5={'credentials':{'private_key':_0x491121,'client_email':_0x432f42}};var _0x1cadb7=new dialogflow[(_0x5ead('0x68'))](_0x422fd5);var _0x10a3bc=_0x1cadb7[_0x5ead('0x69')](_0x257595,md5(_0xff6177));var _0x324972={'session':_0x10a3bc,'queryInput':{'text':{'text':_0x1d65ee,'languageCode':_0x3003cb}}};return _0x1cadb7['detectIntent'](_0x324972)[_0x5ead('0x2c')](function(_0x1d5e0d){if(_0x1d5e0d&&_0x1d5e0d[_0x5ead('0x46')]){logger[_0x5ead('0x19')](_0x5ead('0x6a'),JSON[_0x5ead('0x42')](_0x1d5e0d));var _0x41abc9=_0x1d5e0d[0x0];if(_0x41abc9){var _0x487856={'action':_0x41abc9[_0x5ead('0x6b')]['action'],'allRequiredParamsPresent':_0x41abc9[_0x5ead('0x6b')][_0x5ead('0x6c')],'endConversation':_0x41abc9['queryResult'][_0x5ead('0x6d')]&&_0x41abc9[_0x5ead('0x6b')][_0x5ead('0x6d')][_0x5ead('0x6e')]?_0x41abc9['queryResult'][_0x5ead('0x6d')][_0x5ead('0x6e')][_0x5ead('0x6f')][_0x5ead('0x70')]:![],'fulfillmentText':_0x41abc9[_0x5ead('0x6b')][_0x5ead('0x71')],'intentName':_0x41abc9[_0x5ead('0x6b')][_0x5ead('0x72')]['name'],'intentDisplayName':_0x41abc9[_0x5ead('0x6b')][_0x5ead('0x72')][_0x5ead('0x73')],'isFallbackIntent':_0x41abc9['queryResult']['intent']['isFallback'],'languageCode':_0x41abc9['queryResult'][_0x5ead('0x74')],'queryText':_0x41abc9[_0x5ead('0x6b')][_0x5ead('0x75')],'responseId':_0x41abc9['responseId'],'score':_0x41abc9[_0x5ead('0x6b')][_0x5ead('0x76')],'speech':_0x41abc9[_0x5ead('0x6b')][_0x5ead('0x71')],'providerResponse':JSON[_0x5ead('0x42')](_0x1d5e0d)};return _0x487856;}}});};exports[_0x5ead('0x77')]=function(_0x4de9a3,_0x568760,_0x47533a,_0x238f74){return tilde['asr'](_0x4de9a3,_0x568760,_0x47533a,_0x238f74)[_0x5ead('0x2c')](function(_0x152612){try{fs['unlink'](_0x4de9a3);}catch(_0x4bc3e1){logger['error'](_0x4bc3e1);}logger[_0x5ead('0x19')](_0x5ead('0x78'),_0x152612['transcript']);logger[_0x5ead('0x19')](_0x5ead('0x79'),_0x152612[_0x5ead('0x52')]);return _0x152612;});};exports['awsPolly']=function(_0x46221a,_0x457f37,_0x1305ec,_0x8521d9,_0x621911,_0x4df0fb){var _0x5c97d1=path[_0x5ead('0x27')](__dirname,_0x5ead('0x37'),rs[_0x5ead('0x28')](0x4)+'.mp3');var _0x218c10;return aws[_0x5ead('0x7a')](_0x46221a,_0x457f37,_0x1305ec,_0x8521d9,_0x621911,_0x4df0fb,_0x5c97d1)[_0x5ead('0x2c')](function(){_0x218c10=path[_0x5ead('0x27')](__dirname,_0x5ead('0x37'),rs['generate'](0x4)+'.wav');return convertFile(_0x5c97d1,_0x218c10);})['then'](function(){try{fs[_0x5ead('0x1d')](_0x5c97d1);fs['chmodSync'](_0x218c10,'777');}catch(_0x31f16f){logger[_0x5ead('0x1c')](_0x31f16f);}return _0x218c10[_0x5ead('0x3c')]('.')[0x0];});};exports[_0x5ead('0x7b')]=function(_0x5bfd51,_0x282959,_0x51d384,_0xcef585,_0x566b96,_0x19738b){return aws['lex'](_0x5bfd51,_0x282959,_0x51d384,_0xcef585,_0x566b96,_0x19738b)[_0x5ead('0x2c')](function(_0x147587){logger[_0x5ead('0x19')](JSON[_0x5ead('0x42')](_0x147587));return _0x147587;});};exports['ispeechTTS']=function(_0x2f0f27,_0x5a0cee,_0x20463f,_0x39f2e8){var _0x3c174f=util[_0x5ead('0x7c')](_0x5ead('0x7d'),ISPEECH_API,_0x2f0f27,encodeURIComponent(_0x5a0cee),_0x20463f,_0x39f2e8);var _0xb9ccd4=path[_0x5ead('0x27')](__dirname,_0x5ead('0x37'),rs[_0x5ead('0x28')](0x4)+_0x5ead('0x4a'));var _0xd2677c;return downloadFile(_0x3c174f,_0xb9ccd4)[_0x5ead('0x2c')](function(){_0xd2677c=path[_0x5ead('0x27')](__dirname,_0x5ead('0x37'),rs[_0x5ead('0x28')](0x4)+_0x5ead('0x29'));return convertFile(_0xb9ccd4,_0xd2677c);})[_0x5ead('0x2c')](function(){try{fs[_0x5ead('0x1d')](_0xb9ccd4);fs[_0x5ead('0x2d')](_0xd2677c,_0x5ead('0x3a'));}catch(_0x44f5d2){logger[_0x5ead('0x1c')](_0x44f5d2);}return _0xd2677c['split']('.')[0x0];});};exports[_0x5ead('0x7e')]=function(_0xed2957,_0x5ce707,_0x356f1c,_0xb604f3){var _0xcbf10f=util[_0x5ead('0x7c')](_0x5ead('0x7f'),ISPEECH_API,_0x5ce707,_0x356f1c,base64Encode(_0xed2957),_0xb604f3?util['format'](_0x5ead('0x80'),encodeURIComponent(_0xb604f3)):'freeform=3');return uploadFile(_0xcbf10f)[_0x5ead('0x2c')](function(_0x3acb66){return querystring[_0x5ead('0xa')](_0x3acb66);});};exports[_0x5ead('0x81')]=function(_0x424793,_0x44ba95){return sestek[_0x5ead('0x82')](_0x424793,_0x44ba95)[_0x5ead('0x2c')](function(_0x6b356){logger[_0x5ead('0x19')](JSON[_0x5ead('0x42')](_0x6b356));var _0x5e703e={'speech':_0x6b356[_0x5ead('0x83')],'action':_0x6b356[_0x5ead('0x84')]?_0x6b356['channelData'][_0x5ead('0x85')]:undefined,'actiondata':_0x6b356[_0x5ead('0x84')]?_0x6b356['channelData'][_0x5ead('0x86')]:undefined};if(_0x6b356[_0x5ead('0x84')]&&_0x6b356['channelData'][_0x5ead('0x87')]){return base64Decode(_0x6b356[_0x5ead('0x84')][_0x5ead('0x87')][_0x5ead('0x88')],path[_0x5ead('0x27')](__dirname,'tmp',rs[_0x5ead('0x28')](0x4)+_0x5ead('0x29')))[_0x5ead('0x2c')](function(_0x2dca03){_0x5e703e[_0x5ead('0x89')]=_0x2dca03;return _0x5e703e;});}return _0x5e703e;});};exports[_0x5ead('0x8a')]=function(){return __dirname;}; \ No newline at end of file +var _0x8d6d=['transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','textRequest','result','resolvedQuery','action','fulfillment','speech','score','status','code','endConversation','metadata','replace','SessionsClient','sessionPath','detectIntent','stringify','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','format','freeform=3','parse','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','dialogflow','http','https','path','request-promise','randomstring','sox','util','./aws','./google','./tilde','agi','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','error','statusCode','statusMessage','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','protocol','transcode','wav','end','finish\x20to\x20convert','start','tmp','generate','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','voice','text:synthesize','POST','resolve','.mp3','from','writeFile','.wav','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','jQ1olc','generic','slice','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','googleASR','uri','results','map','alternatives'];(function(_0x13e4d3,_0x4e5024){var _0xe5fff=function(_0x4e80db){while(--_0x4e80db){_0x13e4d3['push'](_0x13e4d3['shift']());}};_0xe5fff(++_0x4e5024);}(_0x8d6d,0x145));var _0xd8d6=function(_0x5a8229,_0x321cb9){_0x5a8229=_0x5a8229-0x0;var _0x2d8fef=_0x8d6d[_0x5a8229];return _0x2d8fef;};'use strict';var apiai=require(_0xd8d6('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0xd8d6('0x1'));var fs=require('fs');var http=require(_0xd8d6('0x2'));var https=require(_0xd8d6('0x3'));var md5=require('md5');var path=require(_0xd8d6('0x4'));var querystring=require('querystring');var rp=require(_0xd8d6('0x5'));var rs=require(_0xd8d6('0x6'));var sox=require(_0xd8d6('0x7'));var tts=require('google-tts-api');var urlParse=require('url')['parse'];var util=require(_0xd8d6('0x8'));var aws=require(_0xd8d6('0x9'));var google=require(_0xd8d6('0xa'));var sestek=require('./sestek');var tilde=require(_0xd8d6('0xb'));var logger=require('../../../config/logger')(_0xd8d6('0xc'));var ISPEECH_API=_0xd8d6('0xd');function downloadFile(_0x1c90d3,_0x44732c){return new BPromise(function(_0x154c47,_0x57e65c){var _0x1af8e0=urlParse(_0x1c90d3);var _0x4fca92=_0x1af8e0['protocol']===_0xd8d6('0xe')?https:http;var _0x296a4d={'host':_0x1af8e0[_0xd8d6('0xf')],'path':_0x1af8e0[_0xd8d6('0x4')],'headers':{'user-agent':_0xd8d6('0x10')}};_0x4fca92[_0xd8d6('0x11')](_0x296a4d,function(_0x3c5c23){if(_0x3c5c23['statusCode']!==0xc8){logger[_0xd8d6('0x12')]('request\x20to\x20'+_0x1c90d3+'\x20failed,\x20status\x20code\x20=\x20'+_0x3c5c23[_0xd8d6('0x13')]+'\x20('+_0x3c5c23[_0xd8d6('0x14')]+')');_0x57e65c(new Error(_0xd8d6('0x15')+_0x1c90d3+_0xd8d6('0x16')+_0x3c5c23[_0xd8d6('0x13')]+'\x20('+_0x3c5c23[_0xd8d6('0x14')]+')'));return;}var _0x323db0=fs[_0xd8d6('0x17')](_0x44732c);_0x323db0['on'](_0xd8d6('0x18'),function(){logger[_0xd8d6('0x19')](_0xd8d6('0x1a'));_0x323db0[_0xd8d6('0x1b')](_0x154c47);});_0x323db0['on'](_0xd8d6('0x12'),function(_0x1a084f){fs[_0xd8d6('0x1c')](_0x44732c);logger[_0xd8d6('0x12')](_0xd8d6('0x1d'),_0x1a084f);_0x57e65c(_0x1a084f);});_0x3c5c23[_0xd8d6('0x1e')](_0x323db0);})['on'](_0xd8d6('0x12'),function(_0x4bad80){logger['error'](_0x4bad80);_0x57e65c(_0x4bad80);})['end']();});}function uploadFile(_0x2875eb){return new BPromise(function(_0x557585,_0x58cd36){var _0x2364b9=urlParse(_0x2875eb);var _0x222b4a=_0x2364b9[_0xd8d6('0x1f')]===_0xd8d6('0xe')?https:http;var _0x4c2373={'host':_0x2364b9[_0xd8d6('0xf')],'path':_0x2364b9[_0xd8d6('0x4')],'headers':{'user-agent':_0xd8d6('0x10')}};_0x222b4a['get'](_0x4c2373,function(_0x58824e){if(_0x58824e[_0xd8d6('0x13')]!==0xc8){_0x58cd36(new Error(_0xd8d6('0x15')+_0x2875eb+_0xd8d6('0x16')+_0x58824e[_0xd8d6('0x13')]+'\x20('+_0x58824e[_0xd8d6('0x14')]+')'));return;}var _0x1045ac='';_0x58824e['on']('data',function(_0x17fbf1){_0x1045ac+=_0x17fbf1;});_0x58824e['on']('end',function(){_0x557585(_0x1045ac);});})['on'](_0xd8d6('0x12'),function(_0x308235){_0x58cd36(_0x308235);})['end']();});}function convertFile(_0x42fcff,_0x331960){return new BPromise(function(_0x61490f,_0x22d722){var _0x5ccdd6=sox[_0xd8d6('0x20')](_0x42fcff,_0x331960,{'sampleRate':0x1f40,'format':_0xd8d6('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5ccdd6['on'](_0xd8d6('0x12'),function(_0x328a21){logger[_0xd8d6('0x12')]('error\x20convert',_0x328a21);_0x22d722(_0x328a21);});_0x5ccdd6['on'](_0xd8d6('0x22'),function(){logger['info'](_0xd8d6('0x23'));_0x61490f();});_0x5ccdd6[_0xd8d6('0x24')]();});}function base64Decode(_0x5734b6,_0x2fbd96){var _0x44d017=path['resolve'](__dirname,_0xd8d6('0x25'),rs[_0xd8d6('0x26')](0x4)+'.wav');fs[_0xd8d6('0x27')](_0x44d017,_0x5734b6,_0xd8d6('0x28'));return convertFile(_0x44d017,_0x2fbd96)[_0xd8d6('0x29')](function(){try{fs[_0xd8d6('0x1c')](_0x44d017);fs[_0xd8d6('0x2a')](_0x2fbd96,_0xd8d6('0x2b'));}catch(_0x2f641c){logger['error'](_0x2f641c);}return _0x2fbd96[_0xd8d6('0x2c')]('.')[0x0];});}function base64Encode(_0x36b769){var _0x22e8d9=fs[_0xd8d6('0x2d')](_0x36b769);return new Buffer(_0x22e8d9)[_0xd8d6('0x2e')](_0xd8d6('0x28'));}exports[_0xd8d6('0x2f')]=function(_0x49a4d8,_0x39bc76,_0x131f6e,_0x56bdd7,_0x28536c,_0x3370e9){var _0x35bc44,_0xf09251;var _0x431cfa=_0xd8d6('0x30');var _0xffc317='?key='+_0x49a4d8;var _0x516fd1={};if(_0x39bc76===_0xd8d6('0x31')){_0x516fd1['input']={'ssml':_0x131f6e};}else{_0x516fd1[_0xd8d6('0x32')]={'text':_0x131f6e};};_0x516fd1[_0xd8d6('0x33')]={'languageCode':_0x56bdd7,'ssmlGender':_0x28536c};_0x516fd1['audioConfig']={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x46c9b6={'url':_0x431cfa+_0xd8d6('0x34')+_0xffc317,'method':_0xd8d6('0x35'),'json':!![],'body':_0x516fd1};return rp(_0x46c9b6)[_0xd8d6('0x29')](function(_0x368171){return new BPromise(function(_0x54ee7a,_0x198af4){_0x35bc44=path[_0xd8d6('0x36')](__dirname,_0xd8d6('0x25'),rs['generate'](0x4)+_0xd8d6('0x37'));var _0x43e636=Buffer[_0xd8d6('0x38')](_0x368171['audioContent'],_0xd8d6('0x28'));return fs[_0xd8d6('0x39')](_0x35bc44,_0x43e636,function(_0x52ea8d){_0x198af4(_0x52ea8d);},function(_0x5cc012){fs[_0xd8d6('0x2a')](_0x35bc44,'777');_0x54ee7a(_0x5cc012);});});})[_0xd8d6('0x29')](function(_0x20f63e){_0xf09251=path['resolve'](__dirname,_0xd8d6('0x25'),rs[_0xd8d6('0x26')](0x4)+_0xd8d6('0x3a'));return convertFile(_0x35bc44,_0xf09251);})['then'](function(){try{fs[_0xd8d6('0x1c')](_0x35bc44);fs[_0xd8d6('0x2a')](_0xf09251,_0xd8d6('0x2b'));}catch(_0x1868ce){logger['error'](_0x1868ce);}logger[_0xd8d6('0x19')](_0xd8d6('0x3b'),_0xf09251['split']('.')[0x0]);return _0xf09251[_0xd8d6('0x2c')]('.')[0x0];});};exports['googleTTS']=function(_0x515736,_0x348485){var _0x43ce87=_0xd8d6('0x3c');var _0x25604e,_0x3d7666;var _0x50be2e;var _0x219a12={'encoding':_0xd8d6('0x3d'),'method':'POST','timeout':0x2710,'url':_0x43ce87,'headers':{'Content-Type':_0xd8d6('0x3e')},'body':'f.req='+encodeURIComponent(JSON['stringify']([[[_0xd8d6('0x3f'),JSON['stringify']([_0x515736,_0x348485||'en',![],'null']),null,_0xd8d6('0x40')]]]))};return rp(_0x219a12)[_0xd8d6('0x29')](function(_0x19f9b0){try{_0x50be2e=eval(_0x19f9b0[_0xd8d6('0x41')](0x5))[0x0][0x2];}catch(_0x5aa769){throw new Error(_0xd8d6('0x42')+_0x19f9b0[_0xd8d6('0x43')]);}if(!_0x50be2e){if(_0x515736[_0xd8d6('0x44')]>0xc8){throw new Error(_0xd8d6('0x45'));}else{throw new Error(_0xd8d6('0x46')+_0x348485+_0xd8d6('0x47'));}}try{_0x50be2e=eval(_0x50be2e)[0x0];}catch(_0x278af4){throw new Error(_0xd8d6('0x42')+res['data']);}const _0x5bd1b4=_0x50be2e;_0x25604e=path['resolve'](__dirname,_0xd8d6('0x25'),rs[_0xd8d6('0x26')](0x4)+'.mp3');fs['writeFileSync'](_0x25604e,_0x50be2e,{'encoding':'base64'});_0x3d7666=path[_0xd8d6('0x36')](__dirname,_0xd8d6('0x25'),rs[_0xd8d6('0x26')](0x4)+'.wav');return convertFile(_0x25604e,_0x3d7666);})[_0xd8d6('0x29')](function(){try{fs[_0xd8d6('0x1c')](_0x25604e);fs[_0xd8d6('0x2a')](_0x3d7666,'777');}catch(_0x105345){logger[_0xd8d6('0x12')](_0x105345);}logger['info']('goggleTTS\x20path',_0x3d7666[_0xd8d6('0x2c')]('.')[0x0]);return _0x3d7666[_0xd8d6('0x2c')]('.')[0x0];});};exports[_0xd8d6('0x48')]=function(_0x318566,_0x4dd8ab,_0x452626){return google['asr'](_0x318566,_0x4dd8ab,_0x452626)[_0xd8d6('0x29')](function(_0x2c55f7){logger[_0xd8d6('0x19')](_0x2c55f7[_0xd8d6('0x49')]);return rp(_0x2c55f7);})[_0xd8d6('0x29')](function(_0x164723){var _0x438a42='';var _0x2f2bbd=0x0;try{fs[_0xd8d6('0x1c')](_0x318566);}catch(_0x34cc34){logger[_0xd8d6('0x12')](_0x34cc34);}if(_0x164723&&_0x164723[_0xd8d6('0x4a')]){_0x438a42=_0x164723[_0xd8d6('0x4a')][_0xd8d6('0x4b')](function(_0x5e5918){return _0x5e5918&&_0x5e5918[_0xd8d6('0x4c')][0x0]&&_0x5e5918[_0xd8d6('0x4c')][0x0][_0xd8d6('0x4d')]?_0x5e5918[_0xd8d6('0x4c')][0x0][_0xd8d6('0x4d')]:'';})[_0xd8d6('0x4e')]('\x0a');_0x2f2bbd=_0x164723['results'][_0xd8d6('0x4b')](function(_0x243662){return _0x243662&&_0x243662['alternatives'][0x0]&&_0x243662[_0xd8d6('0x4c')][0x0][_0xd8d6('0x4f')]?_0x243662[_0xd8d6('0x4c')][0x0][_0xd8d6('0x4f')]:0x0;})[_0xd8d6('0x4e')]('\x0a');}logger[_0xd8d6('0x19')](_0xd8d6('0x50'),_0x438a42);logger[_0xd8d6('0x19')](_0xd8d6('0x51'),_0x2f2bbd);return{'transcript':_0x438a42,'confidence':_0x2f2bbd};})[_0xd8d6('0x52')](function(_0x308b2c){logger[_0xd8d6('0x12')](_0xd8d6('0x53'),_0x308b2c[_0xd8d6('0x13')],_0x308b2c[_0xd8d6('0x54')],_0x308b2c['message']);});};exports['googleDialogflow']=function(_0x310e08,_0x130112,_0x5aeb62,_0x2d3a09){var _0x1477ba=apiai(_0x130112,{'language':_0x2d3a09||'en'});return _0x1477ba[_0xd8d6('0x55')](_0x5aeb62,{'sessionId':md5(_0x310e08)})['then'](function(_0x166807){logger[_0xd8d6('0x19')](JSON['stringify'](_0x166807));return{'source':_0x166807[_0xd8d6('0x56')]['source'],'resolvedQuery':_0x166807[_0xd8d6('0x56')][_0xd8d6('0x57')],'action':_0x166807[_0xd8d6('0x56')][_0xd8d6('0x58')],'actionIncomplete':_0x166807['result']['actionIncomplete'],'speech':_0x166807['result'][_0xd8d6('0x59')][_0xd8d6('0x5a')],'score':_0x166807['result'][_0xd8d6('0x5b')],'statusCode':_0x166807[_0xd8d6('0x5c')][_0xd8d6('0x5d')],'endConversation':_0x166807['result']['metadata'][_0xd8d6('0x5e')]||![],'isFallbackIntent':_0x166807[_0xd8d6('0x56')][_0xd8d6('0x5f')]['isFallbackIntent']};});};exports['googleDialogflowV2']=function(_0x586bcf,_0x4da216,_0x4e2f1f,_0x26a560,_0x403a4a,_0x4ae90a){var _0x4028af=_0x26a560[_0xd8d6('0x60')](/\\n/g,'\x0a');var _0x2cd2b5={'credentials':{'private_key':_0x4028af,'client_email':_0x4e2f1f}};var _0x9e9866=new dialogflow[(_0xd8d6('0x61'))](_0x2cd2b5);var _0x567c57=_0x9e9866[_0xd8d6('0x62')](_0x4da216,md5(_0x586bcf));var _0x2984b4={'session':_0x567c57,'queryInput':{'text':{'text':_0x403a4a,'languageCode':_0x4ae90a}}};return _0x9e9866[_0xd8d6('0x63')](_0x2984b4)[_0xd8d6('0x29')](function(_0x18f356){if(_0x18f356&&_0x18f356[_0xd8d6('0x44')]){logger[_0xd8d6('0x19')]('Dialogflow\x20V2\x20response:',JSON[_0xd8d6('0x64')](_0x18f356));var _0x2d3db4=_0x18f356[0x0];if(_0x2d3db4){var _0x3bbd76={'action':_0x2d3db4[_0xd8d6('0x65')][_0xd8d6('0x58')],'allRequiredParamsPresent':_0x2d3db4[_0xd8d6('0x65')][_0xd8d6('0x66')],'endConversation':_0x2d3db4[_0xd8d6('0x65')][_0xd8d6('0x67')]&&_0x2d3db4['queryResult']['diagnosticInfo']['fields']?_0x2d3db4[_0xd8d6('0x65')][_0xd8d6('0x67')][_0xd8d6('0x68')]['end_conversation'][_0xd8d6('0x69')]:![],'fulfillmentText':_0x2d3db4[_0xd8d6('0x65')][_0xd8d6('0x6a')],'intentName':_0x2d3db4['queryResult'][_0xd8d6('0x6b')][_0xd8d6('0x54')],'intentDisplayName':_0x2d3db4[_0xd8d6('0x65')][_0xd8d6('0x6b')]['displayName'],'isFallbackIntent':_0x2d3db4['queryResult'][_0xd8d6('0x6b')]['isFallback'],'languageCode':_0x2d3db4[_0xd8d6('0x65')][_0xd8d6('0x6c')],'queryText':_0x2d3db4[_0xd8d6('0x65')][_0xd8d6('0x6d')],'responseId':_0x2d3db4[_0xd8d6('0x6e')],'score':_0x2d3db4[_0xd8d6('0x65')][_0xd8d6('0x6f')],'speech':_0x2d3db4[_0xd8d6('0x65')][_0xd8d6('0x6a')],'providerResponse':JSON[_0xd8d6('0x64')](_0x18f356)};return _0x3bbd76;}}});};exports[_0xd8d6('0x70')]=function(_0x56213d,_0x4033e8,_0x21f777,_0x33e5b7){return tilde[_0xd8d6('0x71')](_0x56213d,_0x4033e8,_0x21f777,_0x33e5b7)[_0xd8d6('0x29')](function(_0xd3f946){try{fs[_0xd8d6('0x1c')](_0x56213d);}catch(_0x5406ef){logger[_0xd8d6('0x12')](_0x5406ef);}logger[_0xd8d6('0x19')](_0xd8d6('0x72'),_0xd3f946[_0xd8d6('0x4d')]);logger['info'](_0xd8d6('0x73'),_0xd3f946[_0xd8d6('0x4f')]);return _0xd3f946;});};exports[_0xd8d6('0x74')]=function(_0x33746f,_0x563763,_0x3e53dd,_0xa3ae6d,_0x54bfb4,_0x2a7784){var _0x393c1e=path['resolve'](__dirname,_0xd8d6('0x25'),rs[_0xd8d6('0x26')](0x4)+'.mp3');var _0x71bd2a;return aws[_0xd8d6('0x75')](_0x33746f,_0x563763,_0x3e53dd,_0xa3ae6d,_0x54bfb4,_0x2a7784,_0x393c1e)[_0xd8d6('0x29')](function(){_0x71bd2a=path[_0xd8d6('0x36')](__dirname,'tmp',rs[_0xd8d6('0x26')](0x4)+'.wav');return convertFile(_0x393c1e,_0x71bd2a);})[_0xd8d6('0x29')](function(){try{fs[_0xd8d6('0x1c')](_0x393c1e);fs['chmodSync'](_0x71bd2a,'777');}catch(_0x28c65c){logger[_0xd8d6('0x12')](_0x28c65c);}return _0x71bd2a['split']('.')[0x0];});};exports['awsLex']=function(_0x485ebb,_0x556bbe,_0x1f9b48,_0x535dbd,_0x39b008,_0x289c93){return aws[_0xd8d6('0x76')](_0x485ebb,_0x556bbe,_0x1f9b48,_0x535dbd,_0x39b008,_0x289c93)[_0xd8d6('0x29')](function(_0x45153d){logger[_0xd8d6('0x19')](JSON[_0xd8d6('0x64')](_0x45153d));return _0x45153d;});};exports[_0xd8d6('0x77')]=function(_0x2265d8,_0x250c43,_0x322cfc,_0x36dd95){var _0x35a345=util['format'](_0xd8d6('0x78'),ISPEECH_API,_0x2265d8,encodeURIComponent(_0x250c43),_0x322cfc,_0x36dd95);var _0x11b0ac=path[_0xd8d6('0x36')](__dirname,_0xd8d6('0x25'),rs[_0xd8d6('0x26')](0x4)+_0xd8d6('0x37'));var _0x31d6f9;return downloadFile(_0x35a345,_0x11b0ac)['then'](function(){_0x31d6f9=path[_0xd8d6('0x36')](__dirname,_0xd8d6('0x25'),rs['generate'](0x4)+_0xd8d6('0x3a'));return convertFile(_0x11b0ac,_0x31d6f9);})['then'](function(){try{fs['unlink'](_0x11b0ac);fs[_0xd8d6('0x2a')](_0x31d6f9,_0xd8d6('0x2b'));}catch(_0xa20c6e){logger[_0xd8d6('0x12')](_0xa20c6e);}return _0x31d6f9[_0xd8d6('0x2c')]('.')[0x0];});};exports[_0xd8d6('0x79')]=function(_0x1062ff,_0x86d2f6,_0x13095d,_0x1c38fa){var _0xa1997d=util['format'](_0xd8d6('0x7a'),ISPEECH_API,_0x86d2f6,_0x13095d,base64Encode(_0x1062ff),_0x1c38fa?util[_0xd8d6('0x7b')]('model=%s',encodeURIComponent(_0x1c38fa)):_0xd8d6('0x7c'));return uploadFile(_0xa1997d)['then'](function(_0x4a2d96){return querystring[_0xd8d6('0x7d')](_0x4a2d96);});};exports['sestekNDA']=function(_0x379454,_0x17c7f5){return sestek[_0xd8d6('0x7e')](_0x379454,_0x17c7f5)['then'](function(_0x4b3a1b){logger[_0xd8d6('0x19')](JSON[_0xd8d6('0x64')](_0x4b3a1b));var _0x19d06f={'speech':_0x4b3a1b['text'],'action':_0x4b3a1b[_0xd8d6('0x7f')]?_0x4b3a1b['channelData'][_0xd8d6('0x80')]:undefined,'actiondata':_0x4b3a1b[_0xd8d6('0x7f')]?_0x4b3a1b[_0xd8d6('0x7f')][_0xd8d6('0x81')]:undefined};if(_0x4b3a1b[_0xd8d6('0x7f')]&&_0x4b3a1b[_0xd8d6('0x7f')][_0xd8d6('0x82')]){return base64Decode(_0x4b3a1b[_0xd8d6('0x7f')][_0xd8d6('0x82')][_0xd8d6('0x83')],path['resolve'](__dirname,_0xd8d6('0x25'),rs[_0xd8d6('0x26')](0x4)+_0xd8d6('0x3a')))[_0xd8d6('0x29')](function(_0x24d4a8){_0x19d06f[_0xd8d6('0x84')]=_0x24d4a8;return _0x19d06f;});}return _0x19d06f;});};exports[_0xd8d6('0x85')]=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 3ff50ab..8f34e03 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 _0xddb1=['exports','./nda'];(function(_0x3d8374,_0x30064f){var _0xf8f5b=function(_0x37841d){while(--_0x37841d){_0x3d8374['push'](_0x3d8374['shift']());}};_0xf8f5b(++_0x30064f);}(_0xddb1,0x139));var _0x1ddb=function(_0x5a321c,_0x3e6468){_0x5a321c=_0x5a321c-0x0;var _0x3bd670=_0xddb1[_0x5a321c];return _0x3bd670;};var nda=require(_0x1ddb('0x0'));module[_0x1ddb('0x1')]={'nda':nda}; \ No newline at end of file +var nda=require('./nda');module['exports']={'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 7b86b54..b68a059 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 _0x83e1=['password','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','calleridname','dnid','extension','text','Bearer\x20','access_token','project','ndagenerate_audio','body','AudioOutputSettings','audio/wav','custom_action','channelData','CustomAction','custom_action_data','CustomActionData','stringify','request-promise','url','agi','POST','resolve','username'];(function(_0x2d35ca,_0x5744c4){var _0x27ae73=function(_0x3be731){while(--_0x3be731){_0x2d35ca['push'](_0x2d35ca['shift']());}};_0x27ae73(++_0x5744c4);}(_0x83e1,0x1ad));var _0x183e=function(_0x17e8ae,_0x12551d){_0x17e8ae=_0x17e8ae-0x0;var _0x55bcf4=_0x83e1[_0x17e8ae];return _0x55bcf4;};'use strict';var rp=require(_0x183e('0x0'));var url=require(_0x183e('0x1'));var logger=require('../../../../../config/logger')(_0x183e('0x2'));module['exports']=function(_0x2deafb,_0x59d53f){var _0x5db955={'method':_0x183e('0x3'),'uri':url[_0x183e('0x4')](_0x59d53f['ndauth_url'],'/token'),'form':{'grant_type':'password','username':_0x59d53f[_0x183e('0x5')],'password':_0x59d53f[_0x183e('0x6')]},'json':!![]};return rp(_0x5db955)[_0x183e('0x7')](function(_0x4ee4bc){var _0x8e55be={'method':_0x183e('0x3'),'uri':url[_0x183e('0x4')](_0x59d53f['ndassistant_url'],_0x183e('0x8')),'body':{'type':_0x59d53f[_0x183e('0x9')]||_0x183e('0xa'),'channelId':'Nda','conversation':{'id':_0x2deafb[_0x183e('0xb')]},'from':{'id':_0x2deafb['callerid'],'name':_0x2deafb[_0x183e('0xc')]},'recipient':{'id':_0x2deafb[_0x183e('0xd')],'name':_0x2deafb[_0x183e('0xe')]},'text':_0x59d53f[_0x183e('0xf')],'channelData':{}},'headers':{'Authorization':_0x183e('0x10')+_0x4ee4bc[_0x183e('0x11')]},'json':!![]};if(_0x59d53f[_0x183e('0x12')]){_0x8e55be['body']['channelData']['ProjectName']=_0x59d53f[_0x183e('0x12')];}if(_0x59d53f[_0x183e('0x13')]=='1'){_0x8e55be[_0x183e('0x14')]['channelData'][_0x183e('0x15')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x183e('0x16')};}if(_0x59d53f[_0x183e('0x17')]){_0x8e55be['body'][_0x183e('0x18')][_0x183e('0x19')]=_0x59d53f[_0x183e('0x17')];if(_0x59d53f[_0x183e('0x1a')]){_0x8e55be[_0x183e('0x14')][_0x183e('0x18')][_0x183e('0x1b')]=_0x59d53f[_0x183e('0x1a')];}}logger['info'](JSON[_0x183e('0x1c')](_0x8e55be));return rp(_0x8e55be);});}; \ No newline at end of file +var _0xc99a=['CustomAction','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','dnid','extension','project','channelData','ProjectName','ndagenerate_audio','body','audio/wav'];(function(_0x208a7c,_0x247728){var _0x48fffb=function(_0x4ece7c){while(--_0x4ece7c){_0x208a7c['push'](_0x208a7c['shift']());}};_0x48fffb(++_0x247728);}(_0xc99a,0x7c));var _0xac99=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc99a[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require(_0xac99('0x0'));var url=require(_0xac99('0x1'));var logger=require(_0xac99('0x2'))(_0xac99('0x3'));module[_0xac99('0x4')]=function(_0xb984d0,_0x4ef612){var _0x363b15={'method':_0xac99('0x5'),'uri':url[_0xac99('0x6')](_0x4ef612[_0xac99('0x7')],_0xac99('0x8')),'form':{'grant_type':_0xac99('0x9'),'username':_0x4ef612[_0xac99('0xa')],'password':_0x4ef612[_0xac99('0x9')]},'json':!![]};return rp(_0x363b15)[_0xac99('0xb')](function(_0x1ae607){var _0x458f0b={'method':_0xac99('0x5'),'uri':url['resolve'](_0x4ef612[_0xac99('0xc')],_0xac99('0xd')),'body':{'type':_0x4ef612['ndaactivity_type']||_0xac99('0xe'),'channelId':_0xac99('0xf'),'conversation':{'id':_0xb984d0[_0xac99('0x10')]},'from':{'id':_0xb984d0[_0xac99('0x11')],'name':_0xb984d0['calleridname']},'recipient':{'id':_0xb984d0[_0xac99('0x12')],'name':_0xb984d0[_0xac99('0x13')]},'text':_0x4ef612['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x1ae607['access_token']},'json':!![]};if(_0x4ef612[_0xac99('0x14')]){_0x458f0b['body'][_0xac99('0x15')][_0xac99('0x16')]=_0x4ef612[_0xac99('0x14')];}if(_0x4ef612[_0xac99('0x17')]=='1'){_0x458f0b[_0xac99('0x18')][_0xac99('0x15')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xac99('0x19')};}if(_0x4ef612['custom_action']){_0x458f0b['body'][_0xac99('0x15')][_0xac99('0x1a')]=_0x4ef612['custom_action'];if(_0x4ef612[_0xac99('0x1b')]){_0x458f0b[_0xac99('0x18')][_0xac99('0x15')]['CustomActionData']=_0x4ef612['custom_action_data'];}}logger[_0xac99('0x1c')](JSON[_0xac99('0x1d')](_0x458f0b));return rp(_0x458f0b);});}; \ 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 db76d75..18214a2 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 _0xe233=['./lib/api','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe233,0xbe));var _0x3e23=function(_0x14e99a,_0x13fb58){_0x14e99a=_0x14e99a-0x0;var _0x11e26c=_0xe233[_0x14e99a];return _0x11e26c;};'use strict';var asr=require(_0x3e23('0x0'));module[_0x3e23('0x1')]=function(_0x1da5ca,_0x541771,_0x54234d,_0x5421ba){return asr(_0x1da5ca,_0x541771,_0x54234d,_0x5421ba);}; \ No newline at end of file +var _0xc62f=['./lib/api','exports'];(function(_0x595dd0,_0x1473e4){var _0x9e3cde=function(_0x4e0471){while(--_0x4e0471){_0x595dd0['push'](_0x595dd0['shift']());}};_0x9e3cde(++_0x1473e4);}(_0xc62f,0xd2));var _0xfc62=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xc62f[_0x4154a6];return _0x3b2786;};'use strict';var asr=require(_0xfc62('0x0'));module[_0xfc62('0x1')]=function(_0x2ccb35,_0x40ded4,_0xff735d,_0x6b211d){return asr(_0x2ccb35,_0x40ded4,_0xff735d,_0x6b211d);}; \ 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 56f4344..970e662 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 _0x2f87=['isObject','open','message','bluebird','lodash','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','stringify','data','close','send','Tilde\x20ASR\x20send\x20error','terminate','parse','result','final','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','error'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2f87,0x1e4));var _0x72f8=function(_0x5547e2,_0x471619){_0x5547e2=_0x5547e2-0x0;var _0x412063=_0x2f87[_0x5547e2];return _0x412063;};'use strict';var BPromise=require(_0x72f8('0x0'));var _=require(_0x72f8('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require(_0x72f8('0x2'))(_0x72f8('0x3'));module[_0x72f8('0x4')]=function(_0x2d5d25,_0x3031fd,_0xf9f6a3,_0x45ff3a){return new BPromise(function(_0x26364a,_0x4c92ac){logger[_0x72f8('0x5')](_0x72f8('0x6'),_0x45ff3a||_0x72f8('0x7'));var _0xe5b7c4=new WebSocket(_0x45ff3a||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x1e1db7='';var _0x526a4a='0';var _0x2662be='1';var _0x39d68b=_0x72f8('0x8');function _0x5c592f(_0x58e18c){var _0x47c3f3=crypto[_0x72f8('0x9')](_0x72f8('0xa'));_0x47c3f3[_0x72f8('0xb')](_0x58e18c);return _0x47c3f3[_0x72f8('0xc')](_0x72f8('0xd'));}function _0x1b5f2b(){try{logger[_0x72f8('0x5')](_0x72f8('0xe'));var _0x3ec8f4=moment()['unix']();var _0x167f6b=_0x5c592f(_0x3ec8f4+_0x3031fd+_0xf9f6a3);_0xe5b7c4['send'](JSON[_0x72f8('0xf')]({'appID':_0x3031fd,'timestamp':_0x3ec8f4,'appKey':_0x167f6b}));var _0x49705d=fs['createReadStream'](_0x2d5d25);_0x49705d['on'](_0x72f8('0x10'),function(_0x4c98a2){_0xe5b7c4['send'](_0x4c98a2);});_0x49705d['on'](_0x72f8('0x11'),function(){_0xe5b7c4[_0x72f8('0x12')]('EOS');});}catch(_0x4703fc){logger['error'](_0x72f8('0x13'),JSON[_0x72f8('0xf')](_0x4703fc));_0xe5b7c4[_0x72f8('0x14')]();}}function _0xece01b(_0xed9f8d){try{if(_0xed9f8d){var _0x53c0ed=JSON[_0x72f8('0x15')](_0xed9f8d);switch(_0x53c0ed['status']){case 0x0:if(_0x53c0ed[_0x72f8('0x16')]){if(_0x53c0ed[_0x72f8('0x16')][_0x72f8('0x17')]){logger['info']('Tilde\x20ASR\x20hypoteses',JSON[_0x72f8('0xf')](_0x53c0ed[_0x72f8('0x16')][_0x72f8('0x18')]));_0x1e1db7=_0x53c0ed['result'][_0x72f8('0x18')][0x0]['transcript'];_0x526a4a=_0x53c0ed[_0x72f8('0x16')][_0x72f8('0x18')][0x0][_0x72f8('0x19')];_0x2662be='0';_0x39d68b=_0x72f8('0x1a');_0xe5b7c4['terminate']();}}break;case 0x1:logger[_0x72f8('0x5')](_0x72f8('0x8'));_0x2662be='1';_0x39d68b='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x72f8('0x5')](_0x72f8('0x1b'));_0x2662be='2';_0x39d68b='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x72f8('0x5')](_0x72f8('0x1c'));_0x2662be='9';_0x39d68b='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x72f8('0x5')]('Authentication\x20failed.');_0x2662be='10';_0x39d68b='Authentication\x20failed.';break;case 0xb:logger['info'](_0x72f8('0x1d'));_0x2662be='11';_0x39d68b=_0x72f8('0x1d');}}}catch(_0xdca502){logger['error'](_0x72f8('0x1e'),JSON[_0x72f8('0xf')](_0xdca502));_0xe5b7c4[_0x72f8('0x14')]();}}function _0xff1297(){logger['info'](_0x72f8('0x1f'));_0x26364a({'transcript':_0x1e1db7,'confidence':_0x526a4a,'status':_0x2662be,'status_message':_0x39d68b});}function _0x1db813(_0x3baa0e){logger['error']('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x72f8('0x20')](_0x3baa0e)){logger[_0x72f8('0x21')](_[_0x72f8('0x22')](_0x3baa0e)?JSON['stringify'](_0x3baa0e):_0x3baa0e);}}_0xe5b7c4['on'](_0x72f8('0x23'),_0x1b5f2b);_0xe5b7c4['on'](_0x72f8('0x24'),_0xece01b);_0xe5b7c4['on'](_0x72f8('0x11'),_0xff1297);_0xe5b7c4['on'](_0x72f8('0x21'),_0x1db813);});}; \ No newline at end of file +var _0xce8b=['exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','createReadStream','data','close','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.','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','message','bluebird','lodash','../../../../../../config/logger','agi'];(function(_0x5906a5,_0x48af0a){var _0x1b9a31=function(_0x4b72ac){while(--_0x4b72ac){_0x5906a5['push'](_0x5906a5['shift']());}};_0x1b9a31(++_0x48af0a);}(_0xce8b,0xf8));var _0xbce8=function(_0x241424,_0x25eb5d){_0x241424=_0x241424-0x0;var _0x3da798=_0xce8b[_0x241424];return _0x3da798;};'use strict';var BPromise=require(_0xbce8('0x0'));var _=require(_0xbce8('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require(_0xbce8('0x2'))(_0xbce8('0x3'));module[_0xbce8('0x4')]=function(_0x30a4e3,_0x3a1c0a,_0x1a6685,_0x3f70b6){return new BPromise(function(_0x1a7c8e,_0x310d04){logger[_0xbce8('0x5')](_0xbce8('0x6'),_0x3f70b6||_0xbce8('0x7'));var _0x21da9f=new WebSocket(_0x3f70b6||_0xbce8('0x7'),{'perMessageDeflate':![]});var _0x239062='';var _0x193645='0';var _0x4dbfa0='1';var _0x10059d=_0xbce8('0x8');function _0x5d4914(_0x51ce6c){var _0x17a3c1=crypto[_0xbce8('0x9')](_0xbce8('0xa'));_0x17a3c1['update'](_0x51ce6c);return _0x17a3c1[_0xbce8('0xb')](_0xbce8('0xc'));}function _0x37a500(){try{logger['info'](_0xbce8('0xd'));var _0x3f18af=moment()[_0xbce8('0xe')]();var _0x48ad00=_0x5d4914(_0x3f18af+_0x3a1c0a+_0x1a6685);_0x21da9f[_0xbce8('0xf')](JSON['stringify']({'appID':_0x3a1c0a,'timestamp':_0x3f18af,'appKey':_0x48ad00}));var _0x4877ab=fs[_0xbce8('0x10')](_0x30a4e3);_0x4877ab['on'](_0xbce8('0x11'),function(_0x100809){_0x21da9f[_0xbce8('0xf')](_0x100809);});_0x4877ab['on'](_0xbce8('0x12'),function(){_0x21da9f['send'](_0xbce8('0x13'));});}catch(_0x58316b){logger[_0xbce8('0x14')](_0xbce8('0x15'),JSON[_0xbce8('0x16')](_0x58316b));_0x21da9f[_0xbce8('0x17')]();}}function _0x2c5666(_0x1dbd38){try{if(_0x1dbd38){var _0xad406e=JSON[_0xbce8('0x18')](_0x1dbd38);switch(_0xad406e[_0xbce8('0x19')]){case 0x0:if(_0xad406e[_0xbce8('0x1a')]){if(_0xad406e[_0xbce8('0x1a')][_0xbce8('0x1b')]){logger[_0xbce8('0x5')](_0xbce8('0x1c'),JSON[_0xbce8('0x16')](_0xad406e[_0xbce8('0x1a')]['hypotheses']));_0x239062=_0xad406e[_0xbce8('0x1a')][_0xbce8('0x1d')][0x0][_0xbce8('0x1e')];_0x193645=_0xad406e[_0xbce8('0x1a')][_0xbce8('0x1d')][0x0][_0xbce8('0x1f')];_0x4dbfa0='0';_0x10059d=_0xbce8('0x20');_0x21da9f[_0xbce8('0x17')]();}}break;case 0x1:logger[_0xbce8('0x5')](_0xbce8('0x8'));_0x4dbfa0='1';_0x10059d=_0xbce8('0x8');break;case 0x2:logger['info'](_0xbce8('0x21'));_0x4dbfa0='2';_0x10059d=_0xbce8('0x21');break;case 0x9:logger[_0xbce8('0x5')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x4dbfa0='9';_0x10059d=_0xbce8('0x22');break;case 0xa:logger[_0xbce8('0x5')]('Authentication\x20failed.');_0x4dbfa0='10';_0x10059d=_0xbce8('0x23');break;case 0xb:logger[_0xbce8('0x5')](_0xbce8('0x24'));_0x4dbfa0='11';_0x10059d=_0xbce8('0x24');}}}catch(_0x429e15){logger[_0xbce8('0x14')](_0xbce8('0x25'),JSON['stringify'](_0x429e15));_0x21da9f['terminate']();}}function _0x51c8dd(){logger[_0xbce8('0x5')](_0xbce8('0x26'));_0x1a7c8e({'transcript':_0x239062,'confidence':_0x193645,'status':_0x4dbfa0,'status_message':_0x10059d});}function _0x21be4f(_0x3525d4){logger[_0xbce8('0x14')](_0xbce8('0x27'));if(!_[_0xbce8('0x28')](_0x3525d4)){logger['error'](_['isObject'](_0x3525d4)?JSON[_0xbce8('0x16')](_0x3525d4):_0x3525d4);}}_0x21da9f['on']('open',_0x37a500);_0x21da9f['on'](_0xbce8('0x29'),_0x2c5666);_0x21da9f['on'](_0xbce8('0x12'),_0x51c8dd);_0x21da9f['on'](_0xbce8('0x14'),_0x21be4f);});}; \ 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 867c6e2..1f6a7ff 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 _0xbb92=['./asr','exports'];(function(_0x585612,_0x14831a){var _0x59a521=function(_0x21cef5){while(--_0x21cef5){_0x585612['push'](_0x585612['shift']());}};_0x59a521(++_0x14831a);}(_0xbb92,0x1d4));var _0x2bb9=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbb92[_0x19e35c];return _0x3e1fe8;};var asr=require(_0x2bb9('0x0'));module[_0x2bb9('0x1')]={'asr':asr}; \ No newline at end of file +var _0x23ff=['./asr'];(function(_0x149ed6,_0x5006cd){var _0x4fbd1d=function(_0x13ad89){while(--_0x13ad89){_0x149ed6['push'](_0x149ed6['shift']());}};_0x4fbd1d(++_0x5006cd);}(_0x23ff,0x1b6));var _0xf23f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x23ff[_0x321bb2];return _0x9c12ed;};var asr=require(_0xf23f('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index f288838..b7e8239 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 _0x76c9=['listening','connection','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','code','close','nextTick','net','events','EventEmitter','./error','./channel','127.0.0.1','emit','error','E_AGI_ARGUMENT_PORT','createServer'];(function(_0x19b1f8,_0x11587c){var _0x3dd1a2=function(_0x17da37){while(--_0x17da37){_0x19b1f8['push'](_0x19b1f8['shift']());}};_0x3dd1a2(++_0x11587c);}(_0x76c9,0x1be));var _0x976c=function(_0x3b7218,_0x188b2f){_0x3b7218=_0x3b7218-0x0;var _0x2042b1=_0x76c9[_0x3b7218];return _0x2042b1;};'use strict';var util=require('util');var net=require(_0x976c('0x0'));var EventEmitter=require(_0x976c('0x1'))[_0x976c('0x2')];var AGIError=require(_0x976c('0x3'));var AGIChannel=require(_0x976c('0x4'));var AGIServer=function(_0xb71ff4,_0x1b16b2,_0x36bf38){var _0x377d62=this,_0xb71ff4=_0xb71ff4||0x11dd,_0x1b16b2=_0x1b16b2||_0x976c('0x5'),_0x11788c=null,_0x249dae=0x0;EventEmitter['call'](_0x377d62);function _0x2f3fd3(){if(!_0xb71ff4){_0x377d62[_0x976c('0x6')](_0x976c('0x7'),new AGIError(_0x976c('0x8')));return![];}_0x11788c=net[_0x976c('0x9')]();_0x11788c['listen'](_0xb71ff4,_0x1b16b2);_0x11788c['on'](_0x976c('0xa'),function(){_0x377d62['emit'](_0x976c('0xa'));});_0x11788c['on'](_0x976c('0xb'),function(_0x1501a9){_0x11788c['getConnections'](function(_0x45b52b,_0x3bb3ff){if(_0x45b52b){_0x377d62[_0x976c('0x6')](_0x976c('0x7'),new AGIError(_0x976c('0xc'),_0x45b52b));}else if(_0x36bf38&&_0x36bf38<0x0){_0x377d62[_0x976c('0x6')]('error',new AGIError(_0x976c('0xd')));_0x1501a9[_0x976c('0xe')]();}else if(_0x36bf38&&_0x36bf38>0x0&&_0x36bf38<_0x3bb3ff){_0x249dae+=0x1;_0x377d62[_0x976c('0x6')]('error',new AGIError(_0x976c('0xf'),_0x249dae));_0x1501a9[_0x976c('0xe')]();}else{var _0x8da2ad=new AGIChannel(_0x1501a9);_0x8da2ad['on']('ready',function(){_0x377d62['emit'](_0x976c('0xb'),_0x8da2ad);});}});});_0x11788c['on'](_0x976c('0x7'),function(_0x44ab86){_0x377d62['emit'](_0x976c('0x7'),new AGIError(_0x976c('0xc'),_0x44ab86[_0x976c('0x10')]));});_0x11788c['on']('close',function(){_0x377d62[_0x976c('0x6')](_0x976c('0x11'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x976c('0x12')](function(){_0x2f3fd3();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x882f3d,_0x1fa9b3,_0x504160){return new AGIServer(_0x882f3d,_0x1fa9b3,_0x504160);}; \ No newline at end of file +var _0x189d=['emit','E_AGI_SERVER_VOICE_DISABLED','destroy','ready','code','close','inherits','exports','util','net','events','EventEmitter','./error','./channel','127.0.0.1','call','error','createServer','connection','E_AGI_SERVER_ERROR'];(function(_0x18797a,_0x448886){var _0x3e750e=function(_0x5c4600){while(--_0x5c4600){_0x18797a['push'](_0x18797a['shift']());}};_0x3e750e(++_0x448886);}(_0x189d,0xf8));var _0xd189=function(_0x4caade,_0x549ce1){_0x4caade=_0x4caade-0x0;var _0x2041ff=_0x189d[_0x4caade];return _0x2041ff;};'use strict';var util=require(_0xd189('0x0'));var net=require(_0xd189('0x1'));var EventEmitter=require(_0xd189('0x2'))[_0xd189('0x3')];var AGIError=require(_0xd189('0x4'));var AGIChannel=require(_0xd189('0x5'));var AGIServer=function(_0x5747ee,_0x3c1a77,_0x1ba73e){var _0x5332dc=this,_0x5747ee=_0x5747ee||0x11dd,_0x3c1a77=_0x3c1a77||_0xd189('0x6'),_0x5571f9=null,_0x29fd0b=0x0;EventEmitter[_0xd189('0x7')](_0x5332dc);function _0x44f2e8(){if(!_0x5747ee){_0x5332dc['emit'](_0xd189('0x8'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x5571f9=net[_0xd189('0x9')]();_0x5571f9['listen'](_0x5747ee,_0x3c1a77);_0x5571f9['on']('listening',function(){_0x5332dc['emit']('listening');});_0x5571f9['on'](_0xd189('0xa'),function(_0x25e21e){_0x5571f9['getConnections'](function(_0x43981a,_0x38911d){if(_0x43981a){_0x5332dc['emit'](_0xd189('0x8'),new AGIError(_0xd189('0xb'),_0x43981a));}else if(_0x1ba73e&&_0x1ba73e<0x0){_0x5332dc[_0xd189('0xc')](_0xd189('0x8'),new AGIError(_0xd189('0xd')));_0x25e21e[_0xd189('0xe')]();}else if(_0x1ba73e&&_0x1ba73e>0x0&&_0x1ba73e<_0x38911d){_0x29fd0b+=0x1;_0x5332dc[_0xd189('0xc')](_0xd189('0x8'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x29fd0b));_0x25e21e[_0xd189('0xe')]();}else{var _0x303eed=new AGIChannel(_0x25e21e);_0x303eed['on'](_0xd189('0xf'),function(){_0x5332dc[_0xd189('0xc')](_0xd189('0xa'),_0x303eed);});}});});_0x5571f9['on'](_0xd189('0x8'),function(_0x566840){_0x5332dc[_0xd189('0xc')](_0xd189('0x8'),new AGIError(_0xd189('0xb'),_0x566840[_0xd189('0x10')]));});_0x5571f9['on'](_0xd189('0x11'),function(){_0x5332dc[_0xd189('0xc')](_0xd189('0x11'),new AGIError('E_AGI_SERVER_CLOSE'));});}process['nextTick'](function(){_0x44f2e8();});};util[_0xd189('0x12')](AGIServer,EventEmitter);module[_0xd189('0x13')]=function(_0x29da5c,_0x67fc61,_0x42911c){return new AGIServer(_0x29da5c,_0x67fc61,_0x42911c);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index e545a85..d5a3b12 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 _0xc591=['Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','out','Dialogflow\x20Result\x20%s','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','no\x20anguage\x20configured','speech','providerResponse','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','opts','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','getData','response','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','message','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','wav','TildeASR\x20Result\x20%s','gotoc','continueAt','extension','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','FIND\x20AGENT\x20%s\x20BY\x20%s','failure','math','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','agentPause','playback','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','toLowerCase','gosub','position','QUEUE','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','digits','escape_digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','subject','service','host','port','secure','authentication','auth','user','pass','template_id','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','shellCommand','command','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','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','no\x20variable\x20selected','join','exports','path','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','getVariable','name','catch','prototype','getVoiceQueue','getVoiceQueueById','then','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunkById','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','interval','map','Intervals','getSoundPath','format','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','callback_priority','getPause','agent','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','MALE','audioEncoding','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','toUpperCase','body','parse','headers','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','en-US','speed','ispeechASR','key','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','tildeASR','appid','appsecret','clone','hasOwnProperty','isString','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','isArray','replaceAllVariables','saveRestApiResult','%s.%s','setVariable','split','length','replaceAll','extra','toString','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','sestektts','lumenvoxasr','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','odbc_id','no\x20database\x20selected','query','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot'];(function(_0x71ae3c,_0x49c7a8){var _0x267933=function(_0x256e9a){while(--_0x256e9a){_0x71ae3c['push'](_0x71ae3c['shift']());}};_0x267933(++_0x49c7a8);}(_0xc591,0xe0));var _0x1c59=function(_0xf7aa86,_0x171456){_0xf7aa86=_0xf7aa86-0x0;var _0x5eb1ed=_0xc591[_0xf7aa86];return _0x5eb1ed;};'use strict';var fs=require('fs');var path=require(_0x1c59('0x0'));var util=require(_0x1c59('0x1'));var _=require(_0x1c59('0x2'));var sh=require(_0x1c59('0x3'));var odbc=require(_0x1c59('0x4'))();var rs=require(_0x1c59('0x5'));var moment=require(_0x1c59('0x6'));var Mustache=require(_0x1c59('0x7'));var rp=require(_0x1c59('0x8'));var logger=require('../../config/logger')(_0x1c59('0x9'));var config=require(_0x1c59('0xa'));var scripts=require(_0x1c59('0xb'));var FILES_PATH=_0x1c59('0xc');var recursiveMapAttributes=[_0x1c59('0xd'),_0x1c59('0xe')];var verticesWithRetry=[_0x1c59('0xf'),_0x1c59('0x10'),_0x1c59('0x11')];var AGIVertices=function(_0x5d891f,_0x3cfe0c,_0x4de8bd){this[_0x1c59('0x12')]=_0x5d891f;this[_0x1c59('0x13')]=_0x3cfe0c;this[_0x1c59('0x14')]=_0x4de8bd;};AGIVertices['prototype'][_0x1c59('0x15')]=function(_0x43339f,_0xb3ac53){this[_0x1c59('0x13')]['getVariableById'](_0x43339f)['then'](function(_0x3873ef){_0xb3ac53(null,_0x3873ef?_0x3873ef[_0x1c59('0x16')]:![]);})[_0x1c59('0x17')](function(_0x47bfc7){_0xb3ac53(_0x47bfc7);});};AGIVertices[_0x1c59('0x18')][_0x1c59('0x19')]=function(_0x2b52cb,_0x146e2e){this[_0x1c59('0x13')][_0x1c59('0x1a')](_0x2b52cb)[_0x1c59('0x1b')](function(_0x5b1e24){_0x146e2e(null,_0x5b1e24?_0x5b1e24[_0x1c59('0x16')]:![]);})[_0x1c59('0x17')](function(_0x24bf81){_0x146e2e(_0x24bf81);});};AGIVertices['prototype'][_0x1c59('0x1c')]=function(_0x59071d,_0x2a7bcc){this[_0x1c59('0x13')][_0x1c59('0x1d')](_0x59071d)[_0x1c59('0x1b')](function(_0x1f0aa6){_0x2a7bcc(null,_0x1f0aa6?_0x1f0aa6['name']:![]);})[_0x1c59('0x17')](function(_0x152c54){_0x2a7bcc(_0x152c54);});};AGIVertices['prototype'][_0x1c59('0x1e')]=function(_0x4f3958,_0x53251f){this['rpc'][_0x1c59('0x1f')](_0x4f3958)['then'](function(_0x523ddf){_0x53251f(null,_0x523ddf?_0x523ddf[_0x1c59('0x20')]:![]);})[_0x1c59('0x17')](function(_0xfdd2c1){_0x53251f(_0xfdd2c1);});};AGIVertices[_0x1c59('0x18')][_0x1c59('0x21')]=function(_0x892676,_0x8364dc){this[_0x1c59('0x13')][_0x1c59('0x22')](_0x892676)[_0x1c59('0x1b')](function(_0x2654b5){_0x8364dc(null,_0x2654b5?_0x2654b5[_0x1c59('0x16')]:![]);})[_0x1c59('0x17')](function(_0x54cf97){_0x8364dc(_0x54cf97);});};AGIVertices[_0x1c59('0x18')]['getTrunk']=function(_0x45e26f,_0x443e82){this['rpc'][_0x1c59('0x23')](_0x45e26f)[_0x1c59('0x1b')](function(_0xa2f23f){_0x443e82(null,_0xa2f23f?_0xa2f23f['name']:![]);})[_0x1c59('0x17')](function(_0xcacad8){_0x443e82(_0xcacad8);});};AGIVertices[_0x1c59('0x18')]['getSound']=function(_0xa2419f,_0x2cd70d){var _0x3d16b1=this;this['rpc']['getSoundById'](_0xa2419f)[_0x1c59('0x1b')](function(_0x4258e0){_0x2cd70d(null,_0x4258e0?_0x3d16b1['getSoundPath'](_0x4258e0[_0x1c59('0x24')]):![]);})[_0x1c59('0x17')](function(_0x9e6350){_0x2cd70d(_0x9e6350);});};AGIVertices['prototype'][_0x1c59('0x25')]=function(_0x31c567,_0x5d82a8){this[_0x1c59('0x13')][_0x1c59('0x26')](_0x31c567)['then'](function(_0xd53a47){_0x5d82a8(null,_0xd53a47?_0xd53a47:![]);})['catch'](function(_0xafd49c){_0x5d82a8(_0xafd49c);});};AGIVertices[_0x1c59('0x18')]['sendMailMessage']=function(_0x5ca909,_0x1f4535,_0x4671c9){this[_0x1c59('0x14')][_0x1c59('0x27')](_0x5ca909,_0x1f4535)['then'](function(){_0x4671c9(null);})['catch'](function(_0xa92751){_0x4671c9(_0xa92751);});};AGIVertices[_0x1c59('0x18')][_0x1c59('0x28')]=function(_0x520912,_0x30b19c){this[_0x1c59('0x13')][_0x1c59('0x29')](_0x520912)[_0x1c59('0x1b')](function(_0x2350cd){if(_0x2350cd){if(_0x2350cd['IntervalId']){_0x30b19c(null,[_0x2350cd[_0x1c59('0x2a')]]);}else{_0x30b19c(null,_[_0x1c59('0x2b')](_0x2350cd[_0x1c59('0x2c')],_0x1c59('0x2a')));}}else{_0x30b19c(null,![]);}})[_0x1c59('0x17')](function(_0x4d0fe7){_0x30b19c(_0x4d0fe7);});};AGIVertices[_0x1c59('0x18')][_0x1c59('0x2d')]=function(_0x305d67){return util[_0x1c59('0x2e')]('%s/sounds/converted/%s',FILES_PATH,_0x305d67);};AGIVertices[_0x1c59('0x18')][_0x1c59('0x2f')]=function(_0x5cae0d,_0x39c828,_0x441583){odbc['open'](_0x5cae0d,function(_0x39d069){if(_0x39d069){logger[_0x1c59('0x30')](_0x1c59('0x31'),_0x39d069);_0x441583(_0x39d069);}else{logger[_0x1c59('0x32')](_0x1c59('0x33'));odbc['query'](_0x39c828,function(_0x529efb,_0x3d5268){if(_0x529efb){logger[_0x1c59('0x32')]('Error\x20executing\x20query\x20%s',_0x39c828);_0x441583(_0x529efb);}else{logger['info']('Query\x20executed\x20correctly\x20%s',_0x39c828);odbc[_0x1c59('0x34')](function(_0x166696){if(_0x166696){logger[_0x1c59('0x30')](_0x1c59('0x35'),_0x166696);}_0x441583(null,_0x3d5268);});}});}});};AGIVertices[_0x1c59('0x18')][_0x1c59('0x36')]=function(_0x177a5e,_0x52ec93){this[_0x1c59('0x13')][_0x1c59('0x37')](_0x177a5e)['then'](function(_0x441093){_0x52ec93(null,_0x441093?_0x441093:![]);})[_0x1c59('0x17')](function(_0x3ab60b){_0x52ec93(_0x3ab60b);});};AGIVertices[_0x1c59('0x18')]['createSmsMessage']=function(_0x228bd5,_0x4a724d){this[_0x1c59('0x13')][_0x1c59('0x38')](_0x228bd5)[_0x1c59('0x1b')](function(_0x4bf55f){_0x4a724d(null,_0x4bf55f);})[_0x1c59('0x17')](function(_0x19ffa1){_0x4a724d(_0x19ffa1);});};AGIVertices[_0x1c59('0x18')][_0x1c59('0x39')]=function(_0x7615a9,_0x782c60,_0xeda6ef){this[_0x1c59('0x13')][_0x1c59('0x39')]({'uniqueid':this[_0x1c59('0x12')][_0x1c59('0x3a')],'node':_0x7615a9[_0x1c59('0x3b')],'application':_0x7615a9[_0x1c59('0x3c')],'data':_0x782c60||null,'project_name':this['channel'][_0x1c59('0x3d')],'callerid':this[_0x1c59('0x12')][_0x1c59('0x3e')]})[_0x1c59('0x1b')](function(_0x413241){if(_0xeda6ef){_0xeda6ef(null,_0x413241);}})[_0x1c59('0x17')](function(_0x5e1fae){if(_0xeda6ef){_0xeda6ef(_0x5e1fae);}});};AGIVertices[_0x1c59('0x18')][_0x1c59('0x3f')]=function(_0x3539fb,_0x229924,_0x5e025f,_0x348395){this[_0x1c59('0x13')][_0x1c59('0x3f')]({'uniqueid':this[_0x1c59('0x12')][_0x1c59('0x3a')],'callerid':this[_0x1c59('0x12')][_0x1c59('0x3e')],'calleridname':this[_0x1c59('0x12')][_0x1c59('0x40')],'context':this[_0x1c59('0x12')][_0x1c59('0x41')],'extension':this[_0x1c59('0x12')]['extension'],'priority':this[_0x1c59('0x12')]['priority'],'accountcode':this[_0x1c59('0x12')][_0x1c59('0x42')],'dnid':this[_0x1c59('0x12')][_0x1c59('0x43')],'projectName':this[_0x1c59('0x12')]['arg_1'],'saveName':_0x229924,'filename':_0x3539fb[_0x1c59('0x44')]||_0x229924,'savePath':_0x5e025f})[_0x1c59('0x1b')](function(_0x5c21d0){_0x348395(null,_0x5c21d0);})[_0x1c59('0x17')](function(_0x397d1d){_0x348395(_0x397d1d);});};AGIVertices[_0x1c59('0x18')][_0x1c59('0x45')]=function(_0xf3b306,_0x613156,_0x156658,_0x5760f5,_0x272b05){this[_0x1c59('0x13')]['createSquareMessage']({'uniqueid':this['channel'][_0x1c59('0x3a')],'body':_0xf3b306,'direction':_0x613156,'providerName':_0x156658,'providerResponse':_0x5760f5})[_0x1c59('0x1b')](function(_0x1a46d8){if(_0x272b05){_0x272b05(null,_0x1a46d8);}})[_0x1c59('0x17')](function(_0x57d3b5){if(_0x272b05){_0x272b05(_0x57d3b5);}});};AGIVertices['prototype'][_0x1c59('0x46')]=function(_0x5ca461,_0x14dce3){this[_0x1c59('0x13')][_0x1c59('0x46')]({'firstName':_[_0x1c59('0x47')](_0x5ca461[_0x1c59('0x16')])||_[_0x1c59('0x48')](_0x5ca461[_0x1c59('0x16')])?_0x1c59('0x49')+Math['random']():_0x5ca461['name'],'lastName':_[_0x1c59('0x47')](_0x5ca461[_0x1c59('0x4a')])||_[_0x1c59('0x48')](_0x5ca461[_0x1c59('0x4a')])?null:_0x5ca461[_0x1c59('0x4a')],'phone':_0x5ca461[_0x1c59('0x4b')],'ListId':_0x5ca461[_0x1c59('0x4c')],'scheduledat':_0x5ca461[_0x1c59('0x4d')],'callbackUniqueid':this[_0x1c59('0x12')][_0x1c59('0x3a')],'tags':_0x1c59('0x4e'),'description':_0x1c59('0x4f')+_0x5ca461[_0x1c59('0x4d')]['toString'](),'priority':_0x5ca461[_0x1c59('0x50')]})[_0x1c59('0x1b')](function(_0x170e03){_0x14dce3(null,_0x170e03);})[_0x1c59('0x17')](function(_0x4b61db){_0x14dce3(_0x4b61db);});};AGIVertices[_0x1c59('0x18')][_0x1c59('0x51')]=function(_0x244a82,_0x51372b){this[_0x1c59('0x13')]['getPauseById'](_0x244a82)[_0x1c59('0x1b')](function(_0x54be9b){_0x51372b(null,_0x54be9b?_0x54be9b[_0x1c59('0x16')]:![]);})['catch'](function(_0x4ebf3b){_0x51372b(_0x4ebf3b);});};AGIVertices['prototype']['agentPause']=function(_0x61b161,_0x33878a,_0x3caaa9){var _0xfe09f7={'role':_0x1c59('0x52')};_0xfe09f7[_0x61b161]=this[_0x1c59('0x12')][_0x1c59('0x3e')];this[_0x1c59('0x13')]['agentPause'](_0xfe09f7,_0x33878a,this[_0x1c59('0x12')][_0x1c59('0x3a')])[_0x1c59('0x1b')](function(_0x4ea2c8){_0x3caaa9(null,_[_0x1c59('0x48')](_0x4ea2c8)?![]:!![]);})[_0x1c59('0x17')](function(_0xdb3864){logger[_0x1c59('0x30')](_0xdb3864);_0x3caaa9(null,![]);});};AGIVertices['prototype'][_0x1c59('0x53')]=function(_0x296b68,_0x20e7a2){var _0x51ac05={'role':_0x1c59('0x52')};_0x51ac05[_0x296b68]=this[_0x1c59('0x12')]['callerid'];this[_0x1c59('0x13')][_0x1c59('0x53')](_0x51ac05)['then'](function(_0xd28525){_0x20e7a2(null,_[_0x1c59('0x48')](_0xd28525)?![]:!![]);})[_0x1c59('0x17')](function(_0x6b1bf1){logger[_0x1c59('0x30')](_0x6b1bf1);_0x20e7a2(null,![]);});};AGIVertices['prototype'][_0x1c59('0x54')]=function(_0x5945d6,_0x3545fd){var _0x2b0fb4={'role':_0x1c59('0x52')};_0x2b0fb4[_0x5945d6]=this['channel'][_0x1c59('0x3e')];this['rpc'][_0x1c59('0x54')](_0x2b0fb4)['then'](function(_0x558868){_0x3545fd(null,_[_0x1c59('0x48')](_0x558868)?![]:!![]);})[_0x1c59('0x17')](function(_0x29fe52){logger[_0x1c59('0x30')](_0x29fe52);_0x3545fd(null,![]);});};AGIVertices[_0x1c59('0x18')][_0x1c59('0x55')]=function(_0x259120,_0x4f9299){var _0x4ff844={'role':_0x1c59('0x52')};_0x4ff844[_0x259120]=this[_0x1c59('0x12')][_0x1c59('0x3e')];var _0x1523d6=_0x259120!='internal'?util[_0x1c59('0x2e')](_0x1c59('0x56'),_0x1c59('0x57'),this[_0x1c59('0x12')][_0x1c59('0x3e')]):undefined;this[_0x1c59('0x13')][_0x1c59('0x55')](_0x4ff844,_0x1523d6)[_0x1c59('0x1b')](function(_0x2ae227){_0x4f9299(null,_[_0x1c59('0x48')](_0x2ae227)?![]:!![]);})['catch'](function(_0x374505){logger[_0x1c59('0x30')](_0x374505);_0x4f9299(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x319f8d,_0x2905f5){sh[_0x1c59('0x58')](_[_0x1c59('0x59')](_0x319f8d),function(_0x1fb768,_0x261ed2){var _0x1014dc=_0x261ed2[_0x1c59('0x5a')](/(\r\n|\n|\r)/gm,'');_0x2905f5(null,_0x1014dc);});};AGIVertices['prototype']['googleCloudTTS']=function(_0x5be40d,_0x25fffd){scripts[_0x1c59('0x5b')](_0x5be40d[_0x1c59('0x5c')],_0x5be40d[_0x1c59('0x5d')]||'text',_0x5be40d[_0x1c59('0x5e')],_0x5be40d['languageCode']||'en-US',_0x5be40d['ssmlGender']||_0x1c59('0x5f'),_0x5be40d[_0x1c59('0x60')]||'MP3')[_0x1c59('0x1b')](function(_0x3b7fd3){_0x25fffd(null,_0x3b7fd3);})['catch'](function(_0x418cbf){_0x25fffd(_0x418cbf);});};AGIVertices[_0x1c59('0x18')][_0x1c59('0x61')]=function(_0x1066da,_0x67d387){scripts[_0x1c59('0x61')](_0x1066da['text'],_0x1066da[_0x1c59('0x62')]||'en',0x1)[_0x1c59('0x1b')](function(_0x4c63c4){_0x67d387(null,_0x4c63c4);})[_0x1c59('0x17')](function(_0x306591){_0x67d387(_0x306591);});};AGIVertices[_0x1c59('0x18')][_0x1c59('0x63')]=function(_0x4c8b67,_0xfe258b){var _0x2af0d6={'uri':_0x4c8b67[_0x1c59('0x64')],'method':_0x4c8b67[_0x1c59('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x4c8b67[_0x1c59('0x66')])===_0x1c59('0x67')&&parseInt(_0x4c8b67[_0x1c59('0x66')])>=0x1?parseInt(_0x4c8b67[_0x1c59('0x66')])*0x3e8:0x5*0x3e8};if(_[_0x1c59('0x68')]([_0x1c59('0x69'),'PUT'],_0x2af0d6[_0x1c59('0x65')][_0x1c59('0x6a')]())){try{_0x2af0d6[_0x1c59('0x6b')]=_0x4c8b67['rawBody']?JSON[_0x1c59('0x6c')](_0x4c8b67[_0x1c59('0xe')]):{};}catch(_0x1795ab){logger['error']('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x1795ab);}}try{_0x2af0d6[_0x1c59('0x6d')]=_0x4c8b67[_0x1c59('0xd')]?JSON[_0x1c59('0x6c')](_0x4c8b67[_0x1c59('0xd')]):{};}catch(_0x102dcf){logger['error']('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x102dcf);}if(_0x4c8b67[_0x1c59('0x6e')]){try{var _0x42c665=require(_0x4c8b67[_0x1c59('0x6e')])[_0x1c59('0x6f')](this,_0x2af0d6);_0x2af0d6[_0x1c59('0x70')]=Mustache[_0x1c59('0x71')](_0x4c8b67[_0x1c59('0x64')],_0x42c665,{},['$$','$$']);if(_0x2af0d6[_0x1c59('0x6d')]){_0x2af0d6[_0x1c59('0x6d')]=JSON[_0x1c59('0x6c')](Mustache[_0x1c59('0x71')](JSON[_0x1c59('0x72')](_0x2af0d6[_0x1c59('0x6d')]),_0x42c665,{},['$$','$$']));}if(_0x2af0d6[_0x1c59('0x6b')]){_0x2af0d6[_0x1c59('0x6b')]=JSON[_0x1c59('0x6c')](Mustache['render'](JSON['stringify'](_0x2af0d6['body']),_0x42c665,{},['$$','$$']));}}catch(_0x1ceca4){logger[_0x1c59('0x30')](_0x1c59('0x73'),_0x1ceca4);}}rp(_0x2af0d6)[_0x1c59('0x1b')](function(_0x513bc3){var _0x586f7b={'statusCode':_0x513bc3['statusCode']||0xc8,'statusMessage':_0x513bc3['statusMessage']||'OK','headers':_0x513bc3[_0x1c59('0x6d')]||{},'body':_0x513bc3[_0x1c59('0x6b')]||{}};_0xfe258b(null,_0x586f7b);})[_0x1c59('0x17')](function(_0x52a167){var _0x67f722={'statusCode':_0x52a167[_0x1c59('0x74')]||0x1f4,'statusMessage':_0x52a167['message']||_0x1c59('0x75'),'headers':_0x52a167[_0x1c59('0x76')][_0x1c59('0x6d')]||{},'body':_0x52a167[_0x1c59('0x76')][_0x1c59('0x6b')]||{}};_0xfe258b(null,_0x67f722);});};AGIVertices[_0x1c59('0x18')]['googleDialogflow']=function(_0x1de591,_0x21728b){scripts[_0x1c59('0x77')](this[_0x1c59('0x12')][_0x1c59('0x3a')],_0x1de591['key'],_0x1de591['text'],_0x1de591[_0x1c59('0x78')]||'en')[_0x1c59('0x1b')](function(_0x211a3c){_0x21728b(null,_0x211a3c);})[_0x1c59('0x17')](function(_0x481c4f){_0x21728b(_0x481c4f);});};AGIVertices[_0x1c59('0x18')][_0x1c59('0x79')]=function(_0x9ec1a5,_0x1453b0){scripts[_0x1c59('0x79')](this[_0x1c59('0x12')][_0x1c59('0x3a')],_0x9ec1a5[_0x1c59('0x7a')],_0x9ec1a5[_0x1c59('0x7b')],_0x9ec1a5['private_key'],_0x9ec1a5['text'],_0x9ec1a5[_0x1c59('0x7c')]||'en')[_0x1c59('0x1b')](function(_0x223832){_0x1453b0(null,_0x223832);})[_0x1c59('0x17')](function(_0x8a0de){_0x1453b0(_0x8a0de);});};AGIVertices['prototype'][_0x1c59('0x7d')]=function(_0x1d8c98,_0x467d0d){scripts['sestekNDA'](this[_0x1c59('0x12')],_0x1d8c98)[_0x1c59('0x1b')](function(_0x1e13d8){_0x467d0d(null,_0x1e13d8);})['catch'](function(_0x80d083){_0x467d0d(_0x80d083);});};AGIVertices[_0x1c59('0x18')]['ispeechTTS']=function(_0x3052d7,_0x30f87a){scripts[_0x1c59('0x7e')](_0x3052d7['key'],_0x3052d7[_0x1c59('0x5e')],_0x3052d7['ispeech_tts_language']||_0x1c59('0x7f'),_0x3052d7[_0x1c59('0x80')])[_0x1c59('0x1b')](function(_0x2c979c){_0x30f87a(null,_0x2c979c);})[_0x1c59('0x17')](function(_0x17c190){_0x30f87a(_0x17c190);});};AGIVertices[_0x1c59('0x18')][_0x1c59('0x81')]=function(_0x57878d,_0x18ff56,_0x5d8723){scripts['ispeechASR'](_0x18ff56,_0x57878d[_0x1c59('0x82')],_0x57878d[_0x1c59('0x83')]||'en-US',this[_0x1c59('0x84')](_0x57878d['model'])?_0x57878d[_0x1c59('0x85')]:undefined)[_0x1c59('0x1b')](function(_0x52bf17){_0x5d8723(null,_0x52bf17);})[_0x1c59('0x17')](function(_0xc1542e){_0x5d8723(_0xc1542e);});};AGIVertices[_0x1c59('0x18')][_0x1c59('0x86')]=function(_0x48f704,_0x58cfb4){scripts[_0x1c59('0x86')](_0x48f704[_0x1c59('0x87')],_0x48f704[_0x1c59('0x88')],_0x48f704[_0x1c59('0x89')],_0x48f704['aws_polly_voice']||_0x1c59('0x8a'),_0x48f704['text'],_0x48f704[_0x1c59('0x8b')]||'text')['then'](function(_0x631e31){_0x58cfb4(null,_0x631e31);})[_0x1c59('0x17')](function(_0x1e0b0f){_0x58cfb4(_0x1e0b0f);});};AGIVertices[_0x1c59('0x18')][_0x1c59('0x8c')]=function(_0x2350c3,_0x39a65e){scripts[_0x1c59('0x8c')](this[_0x1c59('0x12')][_0x1c59('0x3a')],_0x2350c3[_0x1c59('0x87')],_0x2350c3['aws_secret_access_key'],_0x2350c3[_0x1c59('0x8d')],_0x2350c3[_0x1c59('0x5e')],_0x2350c3['aws_bot_name'])[_0x1c59('0x1b')](function(_0x54e442){_0x39a65e(null,_0x54e442);})[_0x1c59('0x17')](function(_0x5e3d51){_0x39a65e(_0x5e3d51);});};AGIVertices[_0x1c59('0x18')][_0x1c59('0x8e')]=function(_0x5c32e6,_0x5c9813,_0x5708d1){scripts[_0x1c59('0x8e')](_0x5c9813,_0x5c32e6[_0x1c59('0x82')],_0x5c32e6['google_asr_language']||_0x1c59('0x7f'))['then'](function(_0x31b2e4){_0x5708d1(null,_0x31b2e4);})[_0x1c59('0x17')](function(_0x10bc42){_0x5708d1(_0x10bc42);});};AGIVertices['prototype'][_0x1c59('0x8f')]=function(_0x31890c,_0x370106,_0x4e18d2){scripts[_0x1c59('0x8f')](_0x370106,_0x31890c[_0x1c59('0x90')],_0x31890c[_0x1c59('0x91')],_0x31890c[_0x1c59('0x70')])[_0x1c59('0x1b')](function(_0x17d909){_0x4e18d2(null,_0x17d909);})[_0x1c59('0x17')](function(_0x24dd5e){_0x4e18d2(_0x24dd5e);});};AGIVertices[_0x1c59('0x18')]['clear']=function(_0xca8c78){var _0x2383c6=_['includes'](verticesWithRetry,_0xca8c78['agicommand'])?_0xca8c78:_[_0x1c59('0x92')](_0xca8c78);for(var _0x1c4a91 in _0x2383c6){if(_0x2383c6[_0x1c59('0x93')](_0x1c4a91)){if(_0x2383c6[_0x1c4a91]&&_[_0x1c59('0x94')](_0x2383c6[_0x1c4a91])){if(_[_0x1c59('0x68')](recursiveMapAttributes,_0x1c4a91)){_0x2383c6[_0x1c4a91]=this[_0x1c59('0x95')](_0x2383c6[_0x1c4a91]);}else{_0x2383c6[_0x1c4a91]=this['replaceAllVariables'](_0x2383c6[_0x1c4a91]);}}}}return _0x2383c6;};AGIVertices['prototype'][_0x1c59('0x96')]=function(_0x3dd121){for(var _0xd1c6a8 in _0x3dd121){if(_0x3dd121[_0x1c59('0x93')](_0xd1c6a8)){if(_[_0x1c59('0x97')](_0x3dd121[_0xd1c6a8])){this['recursiveNodeIndex'](_0x3dd121[_0xd1c6a8]);}else if(_[_0x1c59('0x98')](_0x3dd121[_0xd1c6a8])){for(var _0x7747bb=0x0;_0x7747bb<_0x3dd121[_0xd1c6a8]['length'];_0x7747bb++){this[_0x1c59('0x96')](_0x3dd121[_0xd1c6a8][_0x7747bb]);}}else if(_[_0x1c59('0x94')](_0x3dd121[_0xd1c6a8])){_0x3dd121[_0xd1c6a8]=this[_0x1c59('0x99')](_0x3dd121[_0xd1c6a8]);}}}};AGIVertices['prototype'][_0x1c59('0x9a')]=function(_0x527d13,_0x5d6f26){for(var _0x38eaf0 in _0x527d13){if(_0x527d13['hasOwnProperty'](_0x38eaf0)){if(_[_0x1c59('0x97')](_0x527d13[_0x38eaf0])){if(!_[_0x1c59('0x47')](_0x527d13[_0x38eaf0])){this['saveRestApiResult'](_0x527d13[_0x38eaf0],util[_0x1c59('0x2e')]('%s.%s',_0x5d6f26,_0x38eaf0));}}else if(_[_0x1c59('0x98')](_0x527d13[_0x38eaf0])){for(var _0x16c463=0x0;_0x16c463<_0x527d13[_0x38eaf0]['length'];_0x16c463++){this['saveRestApiResult'](_0x527d13[_0x38eaf0][_0x16c463],util['format'](_0x1c59('0x9b'),_0x5d6f26,_0x38eaf0+'['+_0x16c463+']'));}}else{if(!_[_0x1c59('0x48')](_0x527d13[_0x38eaf0])){this[_0x1c59('0x12')][_0x1c59('0x9c')](util[_0x1c59('0x2e')](_0x1c59('0x9b'),_0x5d6f26,_0x38eaf0),_0x527d13[_0x38eaf0]);}}}}};AGIVertices[_0x1c59('0x18')]['replaceObjectAllVariables']=function(_0x48ad59){try{var _0x3b03c5=JSON[_0x1c59('0x6c')](_0x48ad59);this[_0x1c59('0x96')](_0x3b03c5);return JSON[_0x1c59('0x72')](_0x3b03c5);}catch(_0x52a522){return this[_0x1c59('0x99')](_0x48ad59);}};AGIVertices['prototype'][_0x1c59('0x99')]=function(_0x19a1be){var _0x5e86e3=_0x19a1be[_0x1c59('0x9d')]('{');for(var _0xbef868=0x1;_0xbef868<_0x5e86e3[_0x1c59('0x9e')];_0xbef868+=0x1){var _0x140fd1=_0x5e86e3[_0xbef868]['split']('}');if(_0x140fd1[_0x1c59('0x9e')]>0x1){_0x19a1be=_0x19a1be[_0x1c59('0x9f')]('{'+_0x140fd1[0x0]+'}',this[_0x1c59('0x12')][_0x1c59('0x15')](_0x140fd1[0x0])[_0x1c59('0xa0')]||_0x140fd1[0x0]);}}if(_0x5e86e3[_0x1c59('0x9e')]===0x1){return _0x19a1be[_0x1c59('0xa1')]();}return this[_0x1c59('0x99')](_0x19a1be);};AGIVertices['prototype'][_0x1c59('0xa2')]=function(_0x1173f6,_0x242fbe){var _0x51c227=this[_0x1c59('0x12')][_0x1c59('0x15')](_0x1173f6);if(_0x51c227[_0x1c59('0xa3')]===-0x1){return _0x51c227;}logger[_0x1c59('0x32')](util[_0x1c59('0x2e')](_0x1c59('0xa4'),_0x242fbe,_0x51c227[_0x1c59('0xa0')]));return this['channel']['setVariable'](_0x242fbe,_0x51c227['extra']);};AGIVertices[_0x1c59('0x18')]['isConfigured']=function(_0x596825){return _0x596825&&_0x596825!=='0'&&_0x596825!=='-1'&&_0x596825!=='';};AGIVertices[_0x1c59('0x18')][_0x1c59('0xa5')]=function(_0x59b19f){this['createSquareDetailsReport'][_0x1c59('0x6f')](this,_0x59b19f,'-');_0x59b19f[_0x1c59('0xa6')]=_0x59b19f[_0x1c59('0xa5')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x1c59('0x18')]['mrcpsynth']=function(_0x454ed2){logger[_0x1c59('0x32')](util['format'](_0x1c59('0xa7'),_0x454ed2[_0x1c59('0x3b')]));if(!this['isConfigured'](_0x454ed2[_0x1c59('0x5e')])){return this[_0x1c59('0x12')][_0x1c59('0xa8')](_0x1c59('0xa9'));}var _0x48243d='\x22'+_0x454ed2[_0x1c59('0x5e')]+'\x22';if(this['isConfigured'](_0x454ed2[_0x1c59('0x76')])){_0x48243d+=','+_0x454ed2[_0x1c59('0x76')];}var _0x4d5b03=this['channel'][_0x1c59('0x58')]('MRCPSynth',_0x48243d);if(_0x4d5b03[_0x1c59('0xa3')]===-0x1){return _0x4d5b03;}return this['channel'][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0xaa'),_0x48243d));};AGIVertices[_0x1c59('0x18')][_0x1c59('0xab')]=function(_0x5484a3){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')](_0x1c59('0xac'),_0x5484a3[_0x1c59('0x3b')]));if(!this[_0x1c59('0x84')](_0x5484a3[_0x1c59('0xad')])){return this[_0x1c59('0x12')]['noop'](_0x1c59('0xae'));}var _0x238e37=_0x5484a3[_0x1c59('0xad')];if(this[_0x1c59('0x84')](_0x5484a3[_0x1c59('0x76')])){_0x238e37+=','+_0x5484a3['options'];}var _0x5247c4=this[_0x1c59('0x12')][_0x1c59('0x58')](_0x1c59('0xaf'),_0x238e37);if(_0x5247c4[_0x1c59('0xa3')]===-0x1){return _0x5247c4;}var _0x2e06bf=this[_0x1c59('0xa2')](_0x1c59('0xb0'),_0x1c59('0xb1'));if(_0x2e06bf[_0x1c59('0xa3')]===-0x1){return _0x2e06bf;}var _0x1fdb87=this[_0x1c59('0xa2')](_0x1c59('0xb2'),_0x1c59('0xb3'));if(_0x1fdb87[_0x1c59('0xa3')]===-0x1){return _0x1fdb87;}var _0x19c674=this[_0x1c59('0xa2')](_0x1c59('0xb4'),'MRCP_RECOG_INSTANCE');if(_0x19c674[_0x1c59('0xa3')]===-0x1){return _0x19c674;}return this['channel'][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0xb5'),_0x238e37));};AGIVertices[_0x1c59('0x18')]['agi']=function(_0xbb8a93){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0xbb8a93[_0x1c59('0x3b')]));return this[_0x1c59('0x12')][_0x1c59('0x9')]([_0xbb8a93['command'],_0xbb8a93[_0x1c59('0xb6')]]);};AGIVertices['prototype'][_0x1c59('0xb7')]=function(_0x15a550){logger['info'](util[_0x1c59('0x2e')](_0x1c59('0xb8'),_0x15a550['label']));if(this[_0x1c59('0x84')](_0x15a550[_0x1c59('0x66')])){logger[_0x1c59('0x32')](util['format']('Wait\x20%s\x20seconds\x20before\x20answer',_0x15a550[_0x1c59('0x66')]));var _0xcf2761=this[_0x1c59('0x12')][_0x1c59('0xb9')](_0x15a550['timeout']);if(_0xcf2761['result']===-0x1){return _0xcf2761;}}return this['channel'][_0x1c59('0xb7')]();};AGIVertices[_0x1c59('0x18')][_0x1c59('0x4e')]=function(_0x3a3078){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x3a3078[_0x1c59('0x3b')]));if(!this['isConfigured'](_0x3a3078['list_id'])){return this[_0x1c59('0x12')][_0x1c59('0x30')](_0x3a3078,'no\x20list\x20selected');}_0x3a3078[_0x1c59('0x4d')]=moment();if(this[_0x1c59('0x84')](_0x3a3078[_0x1c59('0xba')])){_0x3a3078[_0x1c59('0x4d')]=moment()[_0x1c59('0xbb')](_0x3a3078['delay'],_0x1c59('0xbc'));}if(!this[_0x1c59('0x84')](_0x3a3078[_0x1c59('0x50')])){_0x3a3078[_0x1c59('0x50')]=0x2;}this['createCmContact']['sync'](this,_0x3a3078);return this[_0x1c59('0x12')]['noop'](util[_0x1c59('0x2e')](_0x1c59('0xbd'),_0x3a3078['phone'],_0x3a3078['list_id'],_0x3a3078['scheduledAt']));};AGIVertices[_0x1c59('0x18')]['custom_app']=function(_0x46b950){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')](_0x1c59('0xbe'),_0x46b950['label']));var _0x5300fb=this[_0x1c59('0x12')][_0x1c59('0x58')](_0x46b950[_0x1c59('0xbf')],_0x46b950[_0x1c59('0x76')]);if(_0x5300fb[_0x1c59('0xa3')]===-0x1){return _0x5300fb;}return this[_0x1c59('0x12')][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0xc0'),_0x46b950[_0x1c59('0xbf')],_0x46b950[_0x1c59('0x76')]));};AGIVertices[_0x1c59('0x18')][_0x1c59('0xc1')]=function(_0xf75b00){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')](_0x1c59('0xc2'),_0xf75b00[_0x1c59('0x3b')]));if(!this['isConfigured'](_0xf75b00['text'])){return this['channel'][_0x1c59('0xa8')]('no\x20text\x20configured');}var _0x3a4581='\x22'+_0xf75b00[_0x1c59('0x5e')]+'\x22';if(this[_0x1c59('0x84')](_0xf75b00[_0x1c59('0x76')])){_0x3a4581+=','+_0xf75b00[_0x1c59('0x76')];}var _0x1d0df0=this[_0x1c59('0x12')][_0x1c59('0x58')](_0x1c59('0xc3'),_0x3a4581);if(_0x1d0df0[_0x1c59('0xa3')]===-0x1){return _0x1d0df0;}return this[_0x1c59('0x12')][_0x1c59('0xa8')](util['format'](_0x1c59('0xaa'),_0x3a4581));};AGIVertices[_0x1c59('0x18')][_0x1c59('0xc4')]=function(_0x3bee31){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x3bee31[_0x1c59('0x3b')]));if(!this['isConfigured'](_0x3bee31[_0x1c59('0x5e')])){return this[_0x1c59('0x12')][_0x1c59('0xa8')](_0x1c59('0xa9'));}var _0x21d902='\x22'+_0x3bee31[_0x1c59('0x5e')]+'\x22';if(this['isConfigured'](_0x3bee31[_0x1c59('0x76')])){_0x21d902+=','+_0x3bee31[_0x1c59('0x76')];}var _0x31a111=this['channel']['exec'](_0x1c59('0xc3'),_0x21d902);if(_0x31a111[_0x1c59('0xa3')]===-0x1){return _0x31a111;}return this[_0x1c59('0x12')]['noop'](util['format'](_0x1c59('0xaa'),_0x21d902));};AGIVertices[_0x1c59('0x18')][_0x1c59('0xc5')]=function(_0x537266){logger['info'](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x537266[_0x1c59('0x3b')]));if(!this[_0x1c59('0x84')](_0x537266[_0x1c59('0xad')])){return this['channel'][_0x1c59('0xa8')](_0x1c59('0xae'));}var _0x5029bc=_0x537266[_0x1c59('0xad')];if(this[_0x1c59('0x84')](_0x537266[_0x1c59('0x76')])){_0x5029bc+=','+_0x537266[_0x1c59('0x76')];}var _0x21c75e=this[_0x1c59('0x12')][_0x1c59('0x58')](_0x1c59('0xaf'),_0x5029bc);if(_0x21c75e[_0x1c59('0xa3')]===-0x1){return _0x21c75e;}var _0x6fbd3=this[_0x1c59('0xa2')]('RECOG_CONFIDENCE()',_0x1c59('0xc6'));if(_0x6fbd3[_0x1c59('0xa3')]===-0x1){return _0x6fbd3;}var _0x238e77=this[_0x1c59('0xa2')]('RECOG_INPUT()',_0x1c59('0xc7'));if(_0x238e77['result']===-0x1){return _0x238e77;}var _0x1540ff=this[_0x1c59('0xa2')]('RECOG_INSTANCE()',_0x1c59('0xc8'));if(_0x1540ff[_0x1c59('0xa3')]===-0x1){return _0x1540ff;}return this[_0x1c59('0x12')][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0xb5'),_0x5029bc));};AGIVertices[_0x1c59('0x18')]['sestekasr']=function(_0x50e2b4){logger['info'](util['format'](_0x1c59('0xc9'),_0x50e2b4[_0x1c59('0x3b')]));if(!this[_0x1c59('0x84')](_0x50e2b4[_0x1c59('0xad')])){return this[_0x1c59('0x12')][_0x1c59('0xa8')](_0x1c59('0xae'));}var _0x266ce0=_0x50e2b4[_0x1c59('0xad')];if(this[_0x1c59('0x84')](_0x50e2b4[_0x1c59('0x76')])){_0x266ce0+=','+_0x50e2b4[_0x1c59('0x76')];}var _0x1df5ba=this['channel'][_0x1c59('0x58')](_0x1c59('0xaf'),_0x266ce0);if(_0x1df5ba[_0x1c59('0xa3')]===-0x1){return _0x1df5ba;}var _0x2db422=this[_0x1c59('0xa2')](_0x1c59('0xb0'),_0x1c59('0xca'));if(_0x2db422[_0x1c59('0xa3')]===-0x1){return _0x2db422;}var _0x28a34a=this['getAndSetVariable']('RECOG_INPUT()',_0x1c59('0xcb'));if(_0x28a34a[_0x1c59('0xa3')]===-0x1){return _0x28a34a;}var _0x1027e9=this[_0x1c59('0xa2')](_0x1c59('0xb4'),'SESTEK_ASR_INSTANCE');if(_0x1027e9['result']===-0x1){return _0x1027e9;}return this[_0x1c59('0x12')][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0xb5'),_0x266ce0));};AGIVertices['prototype'][_0x1c59('0xcc')]=function(_0x162d74){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x162d74[_0x1c59('0x3b')]));if(!this[_0x1c59('0x84')](_0x162d74[_0x1c59('0xcd')])){return this[_0x1c59('0x12')][_0x1c59('0x30')](_0x162d74,_0x1c59('0xce'));}var _0x5b78f9=this[_0x1c59('0x1e')][_0x1c59('0x6f')](this,_0x162d74[_0x1c59('0xcd')]);if(!_0x5b78f9){return this[_0x1c59('0x12')][_0x1c59('0x30')](_0x162d74,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0x162d74[_0x1c59('0xcf')])){return this[_0x1c59('0x12')][_0x1c59('0x30')](_0x162d74,_0x1c59('0xd0'));}var _0x64651=_0x162d74[_0x1c59('0xcf')][_0x1c59('0x5a')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0xd1'),_0x64651));var _0x313a62=this[_0x1c59('0x2f')][_0x1c59('0x6f')](this,_0x5b78f9,_0x64651);this['createSquareDetailsReport'][_0x1c59('0x6f')](this,_0x162d74,_0x64651);if(!this[_0x1c59('0x84')](_0x162d74[_0x1c59('0xd2')])){return this[_0x1c59('0x12')][_0x1c59('0xa8')](_0x1c59('0xd3'));}var _0x14b77b=this['getVariable'][_0x1c59('0x6f')](this,_0x162d74[_0x1c59('0xd2')]);if(!_0x14b77b){return this[_0x1c59('0x12')]['error'](_0x162d74,_0x1c59('0xd4'));}var _0x130860=this;_0x313a62[_0x1c59('0xd5')](function(_0x1f8304,_0x1ebcff){Object[_0x1c59('0xd6')](_0x1f8304)[_0x1c59('0xd5')](function(_0x3cadc3){_0x130860[_0x1c59('0x12')][_0x1c59('0x9c')](util[_0x1c59('0x2e')](_0x1c59('0xd7'),_0x14b77b,_0x1ebcff,_0x3cadc3),_0x1f8304[_0x3cadc3]);});});this[_0x1c59('0x12')][_0x1c59('0x9c')](util[_0x1c59('0x2e')](_0x1c59('0xd8'),_0x14b77b),_0x313a62[_0x1c59('0x9e')]);return this['channel'][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0xd9'),_0x14b77b));};AGIVertices[_0x1c59('0x18')]['dial']=function(_0x469ba3){logger[_0x1c59('0xda')](util[_0x1c59('0x2e')](_0x1c59('0xdb'),_0x469ba3['label']));if(!this['isConfigured'](_0x469ba3[_0x1c59('0xdc')])){return this[_0x1c59('0x12')]['error'](_0x469ba3,_0x1c59('0xdd'));}var _0x259540=this[_0x1c59('0x21')][_0x1c59('0x6f')](this,_0x469ba3[_0x1c59('0xdc')]);if(!_0x259540){return this[_0x1c59('0x12')][_0x1c59('0x30')](_0x469ba3,_0x1c59('0xde'));}var _0x1046bd=this['channel'][_0x1c59('0x58')](_0x1c59('0xdf'),[util[_0x1c59('0x2e')](_0x1c59('0xe0'),_0x259540),_0x469ba3[_0x1c59('0x66')],_0x469ba3['opts'],_0x469ba3[_0x1c59('0x64')]]);if(_0x1046bd[_0x1c59('0xa3')]===-0x1){return _0x1046bd;}return this[_0x1c59('0x12')][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0xe1'),_0x1c59('0xdf')));};AGIVertices[_0x1c59('0x18')][_0x1c59('0xe2')]=function(_0x4fcf5f){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')](_0x1c59('0xe3'),_0x4fcf5f['label']));if(!this[_0x1c59('0x84')](_0x4fcf5f[_0x1c59('0x82')])){return this[_0x1c59('0x12')]['noop'](_0x1c59('0xe4'));}if(!this[_0x1c59('0x84')](_0x4fcf5f['text'])){return this[_0x1c59('0x12')][_0x1c59('0xa8')]('no\x20text\x20configured');}this[_0x1c59('0x12')][_0x1c59('0xe5')]=!![];this['createSquareDetailsReport'](_0x4fcf5f);this[_0x1c59('0x45')](_0x4fcf5f[_0x1c59('0x5e')],'in','','');this[_0x1c59('0x12')]['noop'](util['format'](_0x1c59('0xe6'),_0x4fcf5f[_0x1c59('0x5e')]));var _0x2b87ac=this[_0x1c59('0x77')]['sync'](this,_0x4fcf5f);if(_0x2b87ac){for(var _0x15ba95 in _0x2b87ac){if(_0x2b87ac['hasOwnProperty'](_0x15ba95)){this[_0x1c59('0x12')][_0x1c59('0x9c')](util['format'](_0x1c59('0xe7'),_0x15ba95['toUpperCase']()),_0x2b87ac[_0x15ba95]);}}this[_0x1c59('0x45')](_0x2b87ac['speech'],_0x1c59('0xe8'),_0x1c59('0xe2'),'');return this[_0x1c59('0x12')][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0xe9'),_0x2b87ac['speech']));}return this['channel'][_0x1c59('0x30')](_0x4fcf5f,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x1c59('0x18')]['dialogflowV2']=function(_0x2e3dca){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')](_0x1c59('0xea'),_0x2e3dca[_0x1c59('0x3b')]));if(!this['isConfigured'](_0x2e3dca['dialogflowV2_project_id'])){return this[_0x1c59('0x12')][_0x1c59('0xa8')](_0x1c59('0xeb'));}if(!this['isConfigured'](_0x2e3dca[_0x1c59('0x7b')])){return this[_0x1c59('0x12')][_0x1c59('0xa8')](_0x1c59('0xec'));}if(!this[_0x1c59('0x84')](_0x2e3dca[_0x1c59('0xed')])){return this[_0x1c59('0x12')][_0x1c59('0xa8')](_0x1c59('0xee'));}if(!this[_0x1c59('0x84')](_0x2e3dca[_0x1c59('0x7c')])){return this[_0x1c59('0x12')][_0x1c59('0xa8')](_0x1c59('0xef'));}if(!this[_0x1c59('0x84')](_0x2e3dca[_0x1c59('0x5e')])){return this['channel']['noop'](_0x1c59('0xa9'));}this[_0x1c59('0x12')][_0x1c59('0xe5')]=!![];this[_0x1c59('0x39')](_0x2e3dca);this[_0x1c59('0x45')](_0x2e3dca['text'],'in','','');this[_0x1c59('0x12')]['noop'](util[_0x1c59('0x2e')]('Trying\x20DialogflowV2:\x20%s',_0x2e3dca[_0x1c59('0x5e')]));var _0x1751d1=this[_0x1c59('0x79')][_0x1c59('0x6f')](this,_0x2e3dca);if(_0x1751d1){for(var _0x422f43 in _0x1751d1){if(_0x1751d1['hasOwnProperty'](_0x422f43)){if(_0x422f43!=='providerResponse'){this['channel']['setVariable'](util[_0x1c59('0x2e')](_0x1c59('0xe7'),_0x422f43[_0x1c59('0x6a')]()),_0x1751d1[_0x422f43]);}}}this['createSquareMessage'](_0x1751d1[_0x1c59('0xf0')],'out','dialogflowV2',_0x1751d1[_0x1c59('0xf1')]);return this[_0x1c59('0x12')][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0xf2'),_0x1751d1[_0x1c59('0xf0')]));}return this['channel'][_0x1c59('0x30')](_0x2e3dca,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x1c59('0x18')][_0x1c59('0xf3')]=function(_0x5a18f2){logger[_0x1c59('0x32')](util['format'](_0x1c59('0xf4'),_0x5a18f2['label']));if(!this[_0x1c59('0x84')](_0x5a18f2['ndauth_url'])){return this[_0x1c59('0x12')]['noop'](_0x1c59('0xf5'));}if(!this[_0x1c59('0x84')](_0x5a18f2['username'])){return this[_0x1c59('0x12')][_0x1c59('0xa8')](_0x1c59('0xf6'));}if(!this['isConfigured'](_0x5a18f2['password'])){return this[_0x1c59('0x12')][_0x1c59('0xa8')](_0x1c59('0xf7'));}if(!this[_0x1c59('0x84')](_0x5a18f2[_0x1c59('0xf8')])){return this[_0x1c59('0x12')][_0x1c59('0xa8')](_0x1c59('0xa9'));}this['channel'][_0x1c59('0xe5')]=!![];this[_0x1c59('0x39')](_0x5a18f2);this[_0x1c59('0x45')](_0x5a18f2[_0x1c59('0x5e')],'in','','');this[_0x1c59('0x12')][_0x1c59('0xa8')](util['format'](_0x1c59('0xf9'),_0x5a18f2['text']));var _0x344f51=this[_0x1c59('0x7d')][_0x1c59('0x6f')](this,_0x5a18f2);if(_0x344f51){for(var _0x1087de in _0x344f51){if(_0x344f51[_0x1c59('0x93')](_0x1087de)){this['channel'][_0x1c59('0x9c')](util[_0x1c59('0x2e')](_0x1c59('0xfa'),_0x1087de[_0x1c59('0x6a')]()),_0x344f51[_0x1087de]);}}this[_0x1c59('0x45')](_0x344f51[_0x1c59('0xf0')],_0x1c59('0xe8'),_0x1c59('0xf3'),'');if(_0x344f51[_0x1c59('0xfb')]){this[_0x1c59('0x12')][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0xfc'),_0x344f51['audiofile']));var _0x586b58=this[_0x1c59('0x12')][_0x1c59('0xfd')](_0x344f51['audiofile']);try{fs[_0x1c59('0xfe')](_0x344f51['audiofile']+_0x1c59('0xff'));}catch(_0x427102){logger['error'](_0x427102);}return _0x586b58;}else{return this[_0x1c59('0x12')][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0x100'),_0x344f51[_0x1c59('0xf0')]));}}return this[_0x1c59('0x12')][_0x1c59('0x30')](_0x5a18f2,_0x1c59('0x101'));};AGIVertices['prototype'][_0x1c59('0x102')]=function(_0x368727){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')](_0x1c59('0x103'),_0x368727[_0x1c59('0x3b')]));return this[_0x1c59('0x12')][_0x1c59('0xa8')]('end');};AGIVertices[_0x1c59('0x18')][_0x1c59('0x104')]=function(_0x2e0206){logger[_0x1c59('0x32')](util['format'](_0x1c59('0x105'),_0x2e0206['label']));var _0x2da16d='';if(_0x2e0206[_0x1c59('0x106')]){if(!this[_0x1c59('0x84')](_0x2e0206[_0x1c59('0x106')])){return this[_0x1c59('0x12')][_0x1c59('0x30')](_0x2e0206,_0x1c59('0x107'));}else{var _0x315ed1=parseInt(_0x2e0206[_0x1c59('0x106')],0xa);if(isNaN(_0x315ed1)){_0x2da16d=_0x2e0206[_0x1c59('0x106')];}else{_0x2da16d=this['getTrunk'][_0x1c59('0x6f')](this,_0x2e0206['trunk_id']);if(!_0x2da16d){return this[_0x1c59('0x12')][_0x1c59('0x30')](_0x2e0206,_0x1c59('0x108'));}}}}else if(_0x2e0206[_0x1c59('0x109')]){_0x2da16d=_0x2e0206[_0x1c59('0x109')];}else{return this[_0x1c59('0x12')][_0x1c59('0x30')](_0x2e0206,_0x1c59('0x107'));}var _0x400f99=this['channel'][_0x1c59('0x58')](_0x1c59('0xdf'),[util[_0x1c59('0x2e')]('SIP/%s/%s',_0x2da16d,_0x2e0206[_0x1c59('0x4b')]),_0x2e0206[_0x1c59('0x66')],_0x2e0206[_0x1c59('0x10a')],_0x2e0206[_0x1c59('0x64')]]);if(_0x400f99[_0x1c59('0xa3')]===-0x1){return _0x400f99;}return this[_0x1c59('0x12')]['noop'](util['format']('Executed\x20command\x20%s',_0x1c59('0xdf')));};AGIVertices[_0x1c59('0x18')][_0x1c59('0x10b')]=function(_0x33d7ea){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')](_0x1c59('0x10c'),_0x33d7ea[_0x1c59('0x3b')]));return this[_0x1c59('0x12')]['noop']('finally');};AGIVertices[_0x1c59('0x18')][_0x1c59('0x10')]=function(_0x1577a4){logger[_0x1c59('0x32')](util['format'](_0x1c59('0x10d'),_0x1577a4[_0x1c59('0x3b')]));if(_0x1577a4[_0x1c59('0xa6')]===0x0){return this[_0x1c59('0xa5')](_0x1577a4);}_0x1577a4[_0x1c59('0xa6')]-=0x1;if(!this['isConfigured'](_0x1577a4[_0x1c59('0x10e')])){return this['channel'][_0x1c59('0x30')](_0x1577a4,_0x1c59('0x10f'));}var _0x39dbef=this[_0x1c59('0x110')]['sync'](this,_0x1577a4[_0x1c59('0x10e')]);if(!_0x39dbef){return this[_0x1c59('0x12')]['error'](_0x1577a4,_0x1c59('0x111'));}if(!this[_0x1c59('0x84')](_0x1577a4[_0x1c59('0xd2')])){return this[_0x1c59('0x12')][_0x1c59('0x30')](_0x1c59('0xd3'));}var _0x39cc6f=this[_0x1c59('0x12')][_0x1c59('0x112')](_0x39dbef,_0x1577a4[_0x1c59('0x113')],_0x1577a4['maxdigit']);var _0x2bf529=_0x39cc6f[_0x1c59('0xa3')]?_0x39cc6f['result'][_0x1c59('0xa1')]():'';logger['info']('test',JSON[_0x1c59('0x72')](_0x39cc6f));if(_0x39cc6f['result']===-0x1){this['createSquareDetailsReport'][_0x1c59('0x6f')](this,_0x1577a4,_0x2bf529);return _0x39cc6f;}else if(_0x39cc6f[_0x1c59('0xa0')]===_0x1c59('0x66')){_0x39cc6f[_0x1c59('0xa3')]=_0x2bf529[_0x1c59('0x9e')]>=parseInt(_0x1577a4[_0x1c59('0x114')])?'x':'i';}else{_0x39cc6f[_0x1c59('0xa3')]=_0x2bf529[_0x1c59('0x9e')]>=parseInt(_0x1577a4[_0x1c59('0x114')])&&_0x2bf529[_0x1c59('0x9e')]<=parseInt(_0x1577a4['maxdigit'])?'x':'i';}var _0xe31449=this['getVariable'][_0x1c59('0x6f')](this,_0x1577a4[_0x1c59('0xd2')]);if(!_0xe31449){return this[_0x1c59('0x12')][_0x1c59('0x30')](_0x1577a4,_0x1c59('0xd4'));}this['channel'][_0x1c59('0x9c')](_0xe31449,_0x2bf529);if(this[_0x1c59('0x84')](_0x1577a4[_0x1c59('0x115')])){var _0x25b06f=parseInt(_0x1577a4[_0x1c59('0x115')],0xa);var _0x57eaf0=rs[_0x1c59('0x116')]({'charset':'*','length':_0x25b06f});var _0x20bcb7=_0x2bf529['length'];if(_0x20bcb7>0x0){if(_0x20bcb7>_0x25b06f){this['createSquareDetailsReport'][_0x1c59('0x6f')](this,_0x1577a4,_0x1577a4[_0x1c59('0x117')]==='first'?_0x57eaf0+_0x2bf529[_0x1c59('0x118')](_0x25b06f):_0x2bf529[_0x1c59('0x118')](0x0,_0x20bcb7-_0x25b06f)+_0x57eaf0);}else{this[_0x1c59('0x39')][_0x1c59('0x6f')](this,_0x1577a4,rs[_0x1c59('0x116')]({'charset':'*','length':_0x20bcb7}));}}else{this[_0x1c59('0x39')][_0x1c59('0x6f')](this,_0x1577a4,'');}}else{this[_0x1c59('0x39')][_0x1c59('0x6f')](this,_0x1577a4,_0x2bf529);}return _0x39cc6f;};AGIVertices[_0x1c59('0x18')]['getsecretdigits']=function(_0x1c9e40){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')](_0x1c59('0x119'),_0x1c9e40[_0x1c59('0x3b')]));return this[_0x1c59('0x10')](_0x1c9e40);};AGIVertices['prototype'][_0x1c59('0x11a')]=function(_0x4eb9d6){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x4eb9d6[_0x1c59('0x3b')]));this[_0x1c59('0x39')]['sync'](this,_0x4eb9d6,_0x4eb9d6[_0x1c59('0x11b')]);return this['channel']['noop'](util[_0x1c59('0x2e')](_0x1c59('0x11c'),_0x4eb9d6[_0x1c59('0x11b')]));};AGIVertices[_0x1c59('0x18')]['awspolly']=function(_0x56a98f){logger[_0x1c59('0x32')](util['format'](_0x1c59('0x11d'),_0x56a98f[_0x1c59('0x3b')]));if(!this[_0x1c59('0x84')](_0x56a98f[_0x1c59('0x87')])||!this['isConfigured'](_0x56a98f[_0x1c59('0x88')])){return this[_0x1c59('0x12')]['noop'](_0x1c59('0x11e'));}if(!this[_0x1c59('0x84')](_0x56a98f[_0x1c59('0x5e')])){return this[_0x1c59('0x12')][_0x1c59('0xa8')](_0x1c59('0xa9'));}this['channel'][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0x11f'),_0x56a98f[_0x1c59('0x5e')]));var _0x2c0dc7=this['awsPolly'][_0x1c59('0x6f')](this,_0x56a98f);if(_0x2c0dc7){this[_0x1c59('0x12')]['noop'](util['format'](_0x1c59('0x120'),_0x2c0dc7));var _0x4b6f9a=this[_0x1c59('0x12')][_0x1c59('0xfd')](_0x2c0dc7);try{fs[_0x1c59('0xfe')](_0x2c0dc7+_0x1c59('0xff'));}catch(_0x11e6d7){logger[_0x1c59('0x30')](_0x11e6d7);}return _0x4b6f9a;}return this[_0x1c59('0x12')][_0x1c59('0x30')](_0x56a98f,_0x1c59('0x121'));};AGIVertices[_0x1c59('0x18')]['awslex']=function(_0x2f730){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')](_0x1c59('0x122'),_0x2f730[_0x1c59('0x3b')]));if(!this['isConfigured'](_0x2f730[_0x1c59('0x87')])||!this[_0x1c59('0x84')](_0x2f730['aws_secret_access_key'])){return this[_0x1c59('0x12')][_0x1c59('0xa8')](_0x1c59('0x11e'));}if(!this['isConfigured'](_0x2f730[_0x1c59('0x123')])){return this[_0x1c59('0x12')][_0x1c59('0xa8')](_0x1c59('0x124'));}if(!this[_0x1c59('0x84')](_0x2f730['text'])){return this[_0x1c59('0x12')][_0x1c59('0xa8')](_0x1c59('0xa9'));}this['channel']['bot']=!![];this[_0x1c59('0x39')](_0x2f730);this[_0x1c59('0x45')](_0x2f730['text'],'in','','');this[_0x1c59('0x12')][_0x1c59('0xa8')](util[_0x1c59('0x2e')]('Trying\x20Amazon\x20Lex:\x20%s',_0x2f730[_0x1c59('0x5e')]));var _0x17881f=this[_0x1c59('0x8c')][_0x1c59('0x6f')](this,_0x2f730);if(_0x17881f){for(var _0x9bfb52 in _0x17881f){if(_0x17881f['hasOwnProperty'](_0x9bfb52)&&_[_0x1c59('0x94')](_0x17881f[_0x9bfb52])){this[_0x1c59('0x12')][_0x1c59('0x9c')](util[_0x1c59('0x2e')]('AWS_LEX_%s',_0x9bfb52[_0x1c59('0x6a')]()),_0x17881f[_0x9bfb52]);}}if(_[_0x1c59('0x48')](_0x17881f['message'])){return this[_0x1c59('0x12')][_0x1c59('0xa8')](_0x1c59('0x125'));}else{this[_0x1c59('0x45')](_0x17881f['message'],_0x1c59('0xe8'),_0x1c59('0x126'),'');return this[_0x1c59('0x12')][_0x1c59('0xa8')](util[_0x1c59('0x2e')]('Amazon\x20Lex\x20Result\x20%s',_0x17881f[_0x1c59('0x127')]));}}return this['channel'][_0x1c59('0x30')](_0x2f730,_0x1c59('0x128'));};AGIVertices[_0x1c59('0x18')][_0x1c59('0x129')]=function(_0x33a962){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')](_0x1c59('0x12a'),_0x33a962['label'],_0x33a962[_0x1c59('0x66')]));if(!this['isConfigured'](_0x33a962[_0x1c59('0x82')])){return this[_0x1c59('0x12')][_0x1c59('0xa8')](_0x1c59('0xe4'));}var _0x39b98b='wav';var _0x5daf71=util[_0x1c59('0x2e')](_0x1c59('0x12b'),FILES_PATH,rs[_0x1c59('0x116')](0x4));var _0x43d1a8=util[_0x1c59('0x2e')](_0x1c59('0x9b'),_0x5daf71,_0x39b98b);var _0x2f23cf=!![];if(_0x33a962[_0x1c59('0x12c')]===_0x1c59('0x12d')){_0x2f23cf=![];}var _0x29b392=this[_0x1c59('0x12')][_0x1c59('0x12e')](_0x5daf71,_0x39b98b,_0x33a962[_0x1c59('0x12f')],_0x33a962[_0x1c59('0x66')],undefined,_0x2f23cf);if(_0x29b392[_0x1c59('0xa3')]!==-0x1){this['channel'][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0x130'),_0x43d1a8));var _0x5c3794=this[_0x1c59('0x8e')][_0x1c59('0x6f')](this,_0x33a962,_0x43d1a8);if(_0x5c3794){for(var _0x27a18f in _0x5c3794){if(_0x5c3794[_0x1c59('0x93')](_0x27a18f)){this[_0x1c59('0x12')][_0x1c59('0x9c')](util[_0x1c59('0x2e')](_0x1c59('0x131'),_0x27a18f[_0x1c59('0x6a')]()),_0x5c3794[_0x27a18f]);}}return this['channel'][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0x132'),JSON[_0x1c59('0x72')](_0x5c3794)));}}return _0x29b392;};AGIVertices[_0x1c59('0x18')]['tildeasr']=function(_0x30d4bb){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')](_0x1c59('0x133'),_0x30d4bb[_0x1c59('0x3b')]));if(!this[_0x1c59('0x84')](_0x30d4bb['appid'])){return this['channel'][_0x1c59('0xa8')]('no\x20appid\x20configured');}if(!this[_0x1c59('0x84')](_0x30d4bb[_0x1c59('0x91')])){return this['channel'][_0x1c59('0xa8')](_0x1c59('0x134'));}var _0x805ce6=_0x1c59('0x135');var _0x5296da=util[_0x1c59('0x2e')](_0x1c59('0x12b'),FILES_PATH,rs[_0x1c59('0x116')](0x4));var _0x5314ae=util[_0x1c59('0x2e')]('%s.%s',_0x5296da,_0x805ce6);var _0x440623=!![];if(_0x30d4bb[_0x1c59('0x12c')]==='NOBEEP'){_0x440623=![];}var _0x236623=this[_0x1c59('0x12')][_0x1c59('0x12e')](_0x5296da,_0x805ce6,_0x30d4bb['intKey'],_0x30d4bb[_0x1c59('0x66')],undefined,_0x440623);if(_0x236623[_0x1c59('0xa3')]!==-0x1){this[_0x1c59('0x12')]['noop'](util[_0x1c59('0x2e')]('tilde\x20%s\x20file\x20created',_0x5314ae));var _0x8378f3=this[_0x1c59('0x8f')][_0x1c59('0x6f')](this,_0x30d4bb,_0x5314ae);if(_0x8378f3){for(var _0x7f8361 in _0x8378f3){if(_0x8378f3[_0x1c59('0x93')](_0x7f8361)){this[_0x1c59('0x12')][_0x1c59('0x9c')](util['format']('TILDE_ASR_%s',_0x7f8361['toUpperCase']()),_0x8378f3[_0x7f8361]);}}return this['channel'][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0x136'),JSON['stringify'](_0x8378f3)));}}return _0x236623;};AGIVertices[_0x1c59('0x18')][_0x1c59('0x137')]=function(_0x57853b){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x57853b['label']));return this[_0x1c59('0x12')][_0x1c59('0x138')](_0x57853b[_0x1c59('0x41')],_0x57853b[_0x1c59('0x139')],_0x57853b['priority']);};AGIVertices['prototype']['gotoif']=function(_0x3e8c1e){logger[_0x1c59('0x32')](util['format'](_0x1c59('0x13a'),_0x3e8c1e[_0x1c59('0x3b')]));if(!this['isConfigured'](_0x3e8c1e[_0x1c59('0x13b')])){return this[_0x1c59('0x12')][_0x1c59('0x30')](_0x3e8c1e,'no\x20condition\x20configured');}try{var _0x2fcd95=eval(_0x3e8c1e[_0x1c59('0x13b')])?_0x1c59('0x13c'):_0x1c59('0x13d');this[_0x1c59('0x12')][_0x1c59('0xa8')](util['format'](_0x1c59('0x13e'),_0x3e8c1e['condition'],_0x2fcd95));return{'code':0xc8,'result':_0x2fcd95};}catch(_0x2e0cd1){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x1c59('0x18')][_0x1c59('0x13f')]=function(_0x16f94e){logger[_0x1c59('0x32')](util['format'](_0x1c59('0x140'),_0x16f94e['label']));if(!this['isConfigured'](_0x16f94e[_0x1c59('0x141')])){return this['channel'][_0x1c59('0x30')](_0x16f94e,_0x1c59('0x142'));}var _0x25be1c=this[_0x1c59('0x28')][_0x1c59('0x6f')](this,_0x16f94e[_0x1c59('0x141')]);if(!_0x25be1c){return this[_0x1c59('0x12')][_0x1c59('0x30')](_0x16f94e,_0x1c59('0x143'));}for(var _0x541298=0x0;_0x541298<_0x25be1c[_0x1c59('0x9e')];_0x541298+=0x1){var _0x469a26=this[_0x1c59('0x12')]['getVariable'](util[_0x1c59('0x2e')](_0x1c59('0x144'),_0x25be1c[_0x541298]));if(_0x469a26['result']===-0x1){return _0x469a26;}logger[_0x1c59('0x32')](util['format'](_0x1c59('0x145'),_0x25be1c[_0x541298],_0x469a26[_0x1c59('0xa0')]));if(_0x469a26[_0x1c59('0xa0')]==='true'){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')](_0x1c59('0x145'),_0x25be1c[_0x541298],_0x1c59('0x13c')));this[_0x1c59('0x12')][_0x1c59('0xa8')](util[_0x1c59('0x2e')]('IFTIME\x20%s\x20%s',_0x25be1c[_0x541298],_0x1c59('0x13c')));return{'code':0xc8,'result':_0x1c59('0x13c')};}else{logger[_0x1c59('0x32')](util[_0x1c59('0x2e')](_0x1c59('0x145'),_0x25be1c[_0x541298],_0x1c59('0x13d')));this['channel']['noop'](util[_0x1c59('0x2e')](_0x1c59('0x145'),_0x25be1c[_0x541298],_0x1c59('0x13d')));}}return{'code':0xc8,'result':_0x1c59('0x13d')};};AGIVertices[_0x1c59('0x18')][_0x1c59('0x146')]=function(_0x535bab){logger[_0x1c59('0x32')](util['format'](_0x1c59('0x147'),_0x535bab['label']));return this['channel'][_0x1c59('0x146')]();};AGIVertices['prototype']['ispeechasr']=function(_0x1c20fc){logger[_0x1c59('0x32')](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x1c20fc[_0x1c59('0x3b')]));if(!this['isConfigured'](_0x1c20fc[_0x1c59('0x82')])){return this[_0x1c59('0x12')][_0x1c59('0xa8')]('no\x20key\x20configured');}var _0x359b2d=_0x1c59('0x135');var _0x2ea709=util['format'](_0x1c59('0x12b'),FILES_PATH,rs[_0x1c59('0x116')](0x4));var _0x32cc99=util[_0x1c59('0x2e')](_0x1c59('0x9b'),_0x2ea709,_0x359b2d);var _0x44dbd6=!![];if(_0x1c20fc['beep']==='NOBEEP'){_0x44dbd6=![];}var _0x3804ed=this[_0x1c59('0x12')][_0x1c59('0x12e')](_0x2ea709,_0x359b2d,_0x1c20fc[_0x1c59('0x12f')],_0x1c20fc[_0x1c59('0x66')],undefined,_0x44dbd6);if(_0x3804ed[_0x1c59('0xa3')]!==-0x1){this['channel'][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0x148'),_0x32cc99));var _0x1d56bb=this[_0x1c59('0x81')][_0x1c59('0x6f')](this,_0x1c20fc,_0x32cc99);if(_0x1d56bb){for(var _0x540e46 in _0x1d56bb){if(_0x1d56bb[_0x1c59('0x93')](_0x540e46)){this['channel'][_0x1c59('0x9c')](util['format'](_0x1c59('0x149'),_0x540e46[_0x1c59('0x6a')]()),_0x1d56bb[_0x540e46]);}}return this['channel'][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0x14a'),JSON['stringify'](_0x1d56bb)));}}return _0x3804ed;};AGIVertices[_0x1c59('0x18')][_0x1c59('0x14b')]=function(_0x40000b){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x40000b['label']));if(!this['isConfigured'](_0x40000b[_0x1c59('0x82')])){return this['channel'][_0x1c59('0xa8')](_0x1c59('0xe4'));}if(!this[_0x1c59('0x84')](_0x40000b[_0x1c59('0x5e')])){return this[_0x1c59('0x12')][_0x1c59('0xa8')](_0x1c59('0xa9'));}this['channel'][_0x1c59('0xa8')](util['format'](_0x1c59('0x14c'),_0x40000b['text']));var _0x55896e=this['ispeechTTS'][_0x1c59('0x6f')](this,_0x40000b);if(_0x55896e){this[_0x1c59('0x12')][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0x148'),_0x55896e));var _0x531d16=this[_0x1c59('0x12')][_0x1c59('0xfd')](_0x55896e,_0x40000b[_0x1c59('0x12f')]);try{fs[_0x1c59('0xfe')](_0x55896e+'.wav');}catch(_0x9d881f){logger[_0x1c59('0x30')](_0x9d881f);}return _0x531d16;}return this[_0x1c59('0x12')][_0x1c59('0x30')](_0x40000b,_0x1c59('0x14d'));};AGIVertices[_0x1c59('0x18')][_0x1c59('0x14e')]=function(_0xdaf8f8){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')](_0x1c59('0x14f'),_0xdaf8f8['label']));if(!this['isConfigured'](_0xdaf8f8[_0x1c59('0x150')])){return this[_0x1c59('0x12')][_0x1c59('0x30')](_0xdaf8f8,_0x1c59('0x151'));}logger[_0x1c59('0x32')](util[_0x1c59('0x2e')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x1c59('0x12')][_0x1c59('0x3e')],_0xdaf8f8[_0x1c59('0x150')]));var _0x5bade5=this[_0x1c59('0x55')][_0x1c59('0x6f')](this,_0xdaf8f8['findBy']);if(_0x5bade5){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')](_0x1c59('0x152'),this[_0x1c59('0x12')][_0x1c59('0x3e')],_0xdaf8f8['findBy']));this[_0x1c59('0x12')][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0x152'),this[_0x1c59('0x12')]['callerid'],_0xdaf8f8[_0x1c59('0x150')]));return{'code':0xc8,'result':_0x1c59('0x153')};}else{logger[_0x1c59('0x32')](util[_0x1c59('0x2e')](_0x1c59('0x154'),this[_0x1c59('0x12')]['callerid'],_0xdaf8f8['findBy']));this[_0x1c59('0x12')]['noop'](util[_0x1c59('0x2e')](_0x1c59('0x154'),this[_0x1c59('0x12')][_0x1c59('0x3e')],_0xdaf8f8[_0x1c59('0x150')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x1c59('0x18')]['logout']=function(_0x2340ab){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x2340ab[_0x1c59('0x3b')]));if(!this[_0x1c59('0x84')](_0x2340ab['findBy'])){return this[_0x1c59('0x12')]['error'](_0x2340ab,_0x1c59('0x151'));}logger[_0x1c59('0x32')](util[_0x1c59('0x2e')](_0x1c59('0x155'),this['channel']['callerid'],_0x2340ab[_0x1c59('0x150')]));var _0x12114c=this[_0x1c59('0x54')][_0x1c59('0x6f')](this,_0x2340ab[_0x1c59('0x150')]);if(_0x12114c){logger[_0x1c59('0x32')](util['format'](_0x1c59('0x152'),this['channel'][_0x1c59('0x3e')],_0x2340ab['findBy']));this['channel'][_0x1c59('0xa8')](util['format'](_0x1c59('0x152'),this[_0x1c59('0x12')][_0x1c59('0x3e')],_0x2340ab[_0x1c59('0x150')]));return{'code':0xc8,'result':_0x1c59('0x153')};}else{logger[_0x1c59('0x32')](util[_0x1c59('0x2e')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x1c59('0x12')]['callerid'],_0x2340ab[_0x1c59('0x150')]));this[_0x1c59('0x12')][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0x154'),this[_0x1c59('0x12')][_0x1c59('0x3e')],_0x2340ab[_0x1c59('0x150')]));return{'code':0xc8,'result':_0x1c59('0x156')};}};AGIVertices[_0x1c59('0x18')][_0x1c59('0x157')]=function(_0x329514){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x329514[_0x1c59('0x3b')]));if(!this[_0x1c59('0x84')](_0x329514[_0x1c59('0x158')])){return this[_0x1c59('0x12')][_0x1c59('0x30')](_0x329514,_0x1c59('0x159'));}this[_0x1c59('0x12')][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0x15a'),_0x329514[_0x1c59('0x158')]));var _0x1d1142=eval(_0x329514['operation']);if(!this[_0x1c59('0x84')](_0x329514[_0x1c59('0xd2')])){return this[_0x1c59('0x12')][_0x1c59('0xa8')](_0x1c59('0xd3'));}var _0x3ab1ae=this['getVariable'][_0x1c59('0x6f')](this,_0x329514[_0x1c59('0xd2')]);if(!_0x3ab1ae){return this[_0x1c59('0x12')][_0x1c59('0x30')](_0x329514,_0x1c59('0xd4'));}if(_[_0x1c59('0x98')](_0x1d1142)){var _0x5b43be=this;_0x1d1142[_0x1c59('0xd5')](function(_0x5c590f,_0x2a7765){_0x5b43be[_0x1c59('0x12')][_0x1c59('0x9c')](util['format'](_0x1c59('0x15b'),_0x3ab1ae,_0x2a7765),_0x5c590f);});return this['channel'][_0x1c59('0xa8')](util['format'](_0x1c59('0x15c'),_0x3ab1ae));}else{return this[_0x1c59('0x12')][_0x1c59('0x9c')](_0x3ab1ae,_0x1d1142);}};AGIVertices[_0x1c59('0x18')][_0x1c59('0xf')]=function(_0x2f6cef){logger[_0x1c59('0x32')](util['format'](_0x1c59('0x15d'),_0x2f6cef[_0x1c59('0x3b')]));if(_0x2f6cef[_0x1c59('0xa6')]===0x0){return this[_0x1c59('0xa5')](_0x2f6cef);}_0x2f6cef[_0x1c59('0xa6')]-=0x1;if(!this['isConfigured'](_0x2f6cef['file_id'])){return this[_0x1c59('0x12')][_0x1c59('0x30')](_0x2f6cef,_0x1c59('0x10f'));}var _0x5640da=this[_0x1c59('0x110')][_0x1c59('0x6f')](this,_0x2f6cef[_0x1c59('0x10e')]);if(!_0x5640da){return this[_0x1c59('0x12')][_0x1c59('0x30')](_0x2f6cef,_0x1c59('0x111'));}var _0x586f55=this[_0x1c59('0x12')][_0x1c59('0x112')](_0x5640da,_0x2f6cef[_0x1c59('0x113')],_0x2f6cef['digit']);var _0x418115=_0x586f55[_0x1c59('0xa3')];if(_0x586f55[_0x1c59('0xa3')]===-0x1){this[_0x1c59('0x39')][_0x1c59('0x6f')](this,_0x2f6cef,'-1');return _0x586f55;}else if(_0x586f55[_0x1c59('0xa0')]==='timeout'){_0x586f55[_0x1c59('0xa3')]=_0x586f55['result'][_0x1c59('0x9e')]>0x0?_0x586f55[_0x1c59('0xa3')]:'t';}else if(_[_0x1c59('0x47')](_0x586f55[_0x1c59('0xa3')])){_0x586f55[_0x1c59('0xa3')]='#';_0x418115='#';}if(!this[_0x1c59('0x84')](_0x2f6cef['variable_id'])){this[_0x1c59('0x12')][_0x1c59('0xa8')](_0x1c59('0xd3'));}else{var _0x1a63a3=this['getVariable'][_0x1c59('0x6f')](this,_0x2f6cef['variable_id']);if(!_0x1a63a3){return this['channel'][_0x1c59('0x30')](_0x2f6cef,_0x1c59('0xd4'));}this[_0x1c59('0x12')][_0x1c59('0x9c')](_0x1a63a3,_0x418115);}this[_0x1c59('0x39')]['sync'](this,_0x2f6cef,_0x418115);return _0x586f55;};AGIVertices[_0x1c59('0x18')][_0x1c59('0xa8')]=function(_0x1e5486){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')](_0x1c59('0x15e'),_0x1e5486[_0x1c59('0x3b')]));return this[_0x1c59('0x12')][_0x1c59('0xa8')](_0x1e5486[_0x1c59('0x15f')]||_0x1e5486['label']);};AGIVertices[_0x1c59('0x18')][_0x1c59('0x160')]=function(_0xeb1ce5){logger[_0x1c59('0x32')](util['format'](_0x1c59('0x161'),_0xeb1ce5[_0x1c59('0x3b')]));if(!this[_0x1c59('0x84')](_0xeb1ce5[_0x1c59('0x150')])){return this[_0x1c59('0x12')][_0x1c59('0x30')](_0xeb1ce5,_0x1c59('0x151'));}logger['info'](util[_0x1c59('0x2e')](_0x1c59('0x155'),this[_0x1c59('0x12')][_0x1c59('0x3e')],_0xeb1ce5[_0x1c59('0x150')]));var _0x5e90d4=this[_0x1c59('0x51')][_0x1c59('0x6f')](this,_0xeb1ce5[_0x1c59('0x162')]);var _0x36901d=this[_0x1c59('0x163')][_0x1c59('0x6f')](this,_0xeb1ce5[_0x1c59('0x150')],_0x5e90d4);if(_0x36901d){logger['info'](util[_0x1c59('0x2e')](_0x1c59('0x152'),this[_0x1c59('0x12')]['callerid'],_0xeb1ce5[_0x1c59('0x150')]));this[_0x1c59('0x12')][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0x152'),this[_0x1c59('0x12')][_0x1c59('0x3e')],_0xeb1ce5['findBy']));return{'code':0xc8,'result':_0x1c59('0x153')};}else{logger[_0x1c59('0x32')](util[_0x1c59('0x2e')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x1c59('0x12')][_0x1c59('0x3e')],_0xeb1ce5[_0x1c59('0x150')]));this[_0x1c59('0x12')]['noop'](util[_0x1c59('0x2e')](_0x1c59('0x152'),this['channel'][_0x1c59('0x3e')],_0xeb1ce5['findBy']));return{'code':0xc8,'result':_0x1c59('0x156')};}};AGIVertices[_0x1c59('0x18')][_0x1c59('0x164')]=function(_0x3c4d26){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x3c4d26[_0x1c59('0x3b')]));if(!this[_0x1c59('0x84')](_0x3c4d26[_0x1c59('0x10e')])){return this[_0x1c59('0x12')][_0x1c59('0x30')](_0x3c4d26,_0x1c59('0x10f'));}var _0x3547d1=this['getSound'][_0x1c59('0x6f')](this,_0x3c4d26[_0x1c59('0x10e')]);if(!_0x3547d1){return this['channel'][_0x1c59('0x30')](_0x3c4d26,_0x1c59('0x111'));}var _0x1ed60f=this[_0x1c59('0x12')][_0x1c59('0x58')](_0x1c59('0x165'),[_0x3547d1,_0x3c4d26['opts']]);if(_0x1ed60f[_0x1c59('0xa3')]===-0x1){return _0x1ed60f;}return this[_0x1c59('0x12')][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0xc0'),_0x1c59('0x165'),_0x3547d1));};AGIVertices[_0x1c59('0x18')][_0x1c59('0x166')]=function(_0x50d87a){logger[_0x1c59('0x32')](util['format'](_0x1c59('0x167'),_0x50d87a[_0x1c59('0x3b')]));if(!this['isConfigured'](_0x50d87a[_0x1c59('0x168')])){return this[_0x1c59('0x12')]['error'](_0x50d87a,_0x1c59('0x169'));}var _0xe0d4a8='';var _0x157b41=parseInt(_0x50d87a[_0x1c59('0x168')],0xa);if(isNaN(_0x157b41)){_0xe0d4a8=_0x50d87a[_0x1c59('0x168')];}else{_0xe0d4a8=this['getVoiceQueue'][_0x1c59('0x6f')](this,_0x50d87a[_0x1c59('0x168')]);if(!_0xe0d4a8){return this['channel'][_0x1c59('0x30')](_0x50d87a,'no\x20queue\x20found');}}var _0x586519='';if(this[_0x1c59('0x84')](_0x50d87a['file_id'])){var _0x41d3da=this[_0x1c59('0x110')][_0x1c59('0x6f')](this,_0x50d87a[_0x1c59('0x10e')]);if(_0x41d3da){_0x586519=_0x41d3da;}}this[_0x1c59('0x39')][_0x1c59('0x6f')](this,_0x50d87a,_0xe0d4a8);if(_0x50d87a[_0x1c59('0x10a')][_0x1c59('0x16a')]('x')<0x0){_0x50d87a[_0x1c59('0x10a')]+='x';}if(_0x50d87a[_0x1c59('0x10a')][_0x1c59('0x16a')]('X')<0x0){_0x50d87a[_0x1c59('0x10a')]+='X';}this['channel']['setVariable'](_0x1c59('0x16b'),_0xe0d4a8?_0xe0d4a8[_0x1c59('0x16c')]():'');var _0x34df84=this['channel']['exec']('QUEUE',[_0xe0d4a8,_0x50d87a['opts'],_0x50d87a[_0x1c59('0x64')],_0x586519,_0x50d87a[_0x1c59('0x66')],_0x50d87a[_0x1c59('0x9')],_0x50d87a['macro'],_0x50d87a[_0x1c59('0x16d')],'',_0x50d87a[_0x1c59('0x16e')]]);if(_0x34df84[_0x1c59('0xa3')]===-0x1){return _0x34df84;}return this[_0x1c59('0x12')][_0x1c59('0xa8')](util['format'](_0x1c59('0xc0'),_0x1c59('0x16f'),_0xe0d4a8));};AGIVertices['prototype']['record']=function(_0x1f9ece){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x1f9ece[_0x1c59('0x3b')]));var _0xe53424=_0x1f9ece[_0x1c59('0x170')]||_0x1c59('0x135');var _0x1bcec1=util[_0x1c59('0x2e')](_0x1c59('0x171'),this[_0x1c59('0x12')]['uniqueid'],rs['generate'](0x5));var _0x1ac025=util[_0x1c59('0x2e')](_0x1c59('0x172'),FILES_PATH,_0x1bcec1,_0xe53424);var _0x5305c8=util[_0x1c59('0x2e')](_0x1c59('0x12b'),FILES_PATH,_0x1bcec1);this[_0x1c59('0x3f')]['sync'](this,_0x1f9ece,_0x1bcec1,_0x1ac025);this[_0x1c59('0x12')][_0x1c59('0x9c')](_0x1c59('0x173'),_0x1bcec1);logger[_0x1c59('0x32')](_0x1c59('0x174'),_0x5305c8,_0xe53424,_0x1f9ece['escape_digits'],_0x1f9ece[_0x1c59('0x66')]);return this[_0x1c59('0x12')][_0x1c59('0x12e')](_0x5305c8,_0xe53424,_0x1f9ece['escape_digits'],_0x1f9ece[_0x1c59('0x66')],undefined,!![]);};AGIVertices[_0x1c59('0x18')][_0x1c59('0x175')]=function(_0x22d083){logger['info'](util['format'](_0x1c59('0x176'),_0x22d083[_0x1c59('0x3b')]));if(!this[_0x1c59('0x84')](_0x22d083[_0x1c59('0x64')])){return this['channel'][_0x1c59('0xa8')](_0x1c59('0x177'));}var _0x575fc1=this[_0x1c59('0x63')][_0x1c59('0x6f')](this,_0x22d083);logger[_0x1c59('0x32')](util[_0x1c59('0x2e')]('Response:',util[_0x1c59('0x178')](_0x575fc1,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x22d083[_0x1c59('0xd2')])){return this[_0x1c59('0x12')][_0x1c59('0xa8')](_0x1c59('0x179'));}var _0x4fd3f0=this[_0x1c59('0x15')][_0x1c59('0x6f')](this,_0x22d083[_0x1c59('0xd2')]);if(!_0x4fd3f0){return this[_0x1c59('0x12')][_0x1c59('0x30')](_0x22d083,_0x1c59('0xd4'));}this[_0x1c59('0x12')]['setVariable'](util[_0x1c59('0x2e')](_0x1c59('0x17a'),_0x4fd3f0),_0x575fc1[_0x1c59('0x74')]?_0x575fc1[_0x1c59('0x74')]:_0x1c59('0x17b'));this[_0x1c59('0x12')]['setVariable'](util[_0x1c59('0x2e')](_0x1c59('0x17c'),_0x4fd3f0),_0x575fc1[_0x1c59('0x17d')]?_0x575fc1['statusMessage']:'OK');if(_0x575fc1[_0x1c59('0x6b')]){try{this[_0x1c59('0x9a')](_0x575fc1['body'],_0x4fd3f0);}catch(_0x1d003e){logger['error'](util['format'](_0x1c59('0x17e'),_0x4fd3f0));}}return this[_0x1c59('0x12')][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0xd9'),_0x4fd3f0));};AGIVertices[_0x1c59('0x18')][_0x1c59('0x17f')]=function(_0x7d5975){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x7d5975[_0x1c59('0x3b')]));return this[_0x1c59('0x12')][_0x1c59('0x180')](_0x7d5975[_0x1c59('0x181')]['replace'](/\s+/g,''),_0x7d5975[_0x1c59('0x182')]);};AGIVertices[_0x1c59('0x18')][_0x1c59('0x183')]=function(_0x5d3143){logger['info'](util['format'](_0x1c59('0x184'),_0x5d3143[_0x1c59('0x3b')]));return this[_0x1c59('0x12')][_0x1c59('0x185')](_0x5d3143['number'][_0x1c59('0x5a')](/\s+/g,''),_0x5d3143['escape_digits']);};AGIVertices[_0x1c59('0x18')][_0x1c59('0x186')]=function(_0x4668ba){logger[_0x1c59('0x32')](util['format'](_0x1c59('0x187'),_0x4668ba['label']));return this['channel']['sayPhonetic'](_0x4668ba[_0x1c59('0x5e')],_0x4668ba[_0x1c59('0x182')]);};AGIVertices[_0x1c59('0x18')][_0x1c59('0x188')]=function(_0x21e7db){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x21e7db[_0x1c59('0x3b')]));if(!this[_0x1c59('0x84')](_0x21e7db[_0x1c59('0x189')])){return this[_0x1c59('0x12')]['noop'](_0x1c59('0x18a'));}var _0xe45660=this[_0x1c59('0x25')]['sync'](this,_0x21e7db[_0x1c59('0x189')]);if(!_0xe45660||!_0xe45660[_0x1c59('0x18b')]){return this[_0x1c59('0x12')][_0x1c59('0x30')](_0x21e7db,_0x1c59('0x18c'));}var _0x3b0cf4={'from':util['format'](_0x1c59('0x18d'),_0xe45660['name'],_0xe45660[_0x1c59('0x18e')]||_0xe45660[_0x1c59('0x18b')]['user']),'to':_0x21e7db['to']||'','cc':_0x21e7db['cc']||'','bcc':_0x21e7db[_0x1c59('0x18f')]||'','subject':_0x21e7db[_0x1c59('0x190')],'html':_0x21e7db[_0x1c59('0x5e')],'text':_0x21e7db[_0x1c59('0x5e')]};var _0xa38c18={'tls':{'rejectUnauthorized':![]}};if(_0xe45660[_0x1c59('0x18b')][_0x1c59('0x191')]){_0xa38c18[_0x1c59('0x191')]=_0xe45660['Smtp']['service'];}else{_0xa38c18[_0x1c59('0x192')]=_0xe45660[_0x1c59('0x18b')][_0x1c59('0x192')];_0xa38c18[_0x1c59('0x193')]=_0xe45660[_0x1c59('0x18b')][_0x1c59('0x193')];_0xa38c18['secure']=_0xe45660['Smtp'][_0x1c59('0x194')];}if(_0xe45660['Smtp'][_0x1c59('0x195')]){_0xa38c18[_0x1c59('0x196')]={'user':_0xe45660[_0x1c59('0x18b')][_0x1c59('0x197')],'pass':_0xe45660[_0x1c59('0x18b')][_0x1c59('0x198')]};}if(this[_0x1c59('0x84')](_0x21e7db[_0x1c59('0x199')])){}logger['debug'](_0x1c59('0x19a'),JSON[_0x1c59('0x72')](_0x3b0cf4));this['createSquareDetailsReport'][_0x1c59('0x6f')](this,_0x21e7db,_0x21e7db['account_id']);this[_0x1c59('0x12')][_0x1c59('0xa8')](util[_0x1c59('0x2e')]('Trying\x20SendMail\x20with\x20account\x20%s',_0xe45660[_0x1c59('0x16')]));this[_0x1c59('0x27')]['sync'](this,_0xa38c18,_0x3b0cf4);return this['channel'][_0x1c59('0xa8')](_0x1c59('0x19b'));};AGIVertices[_0x1c59('0x18')][_0x1c59('0x19c')]=function(_0x19ec92){logger[_0x1c59('0x32')](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x19ec92['label']));return this[_0x1c59('0x12')]['noop'](_0x1c59('0x19d'));};AGIVertices[_0x1c59('0x18')][_0x1c59('0x19e')]=function(_0x36d5dc){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x36d5dc[_0x1c59('0x3b')]));if(!this[_0x1c59('0x84')](_0x36d5dc[_0x1c59('0x19f')])){return this[_0x1c59('0x12')][_0x1c59('0xa8')]('no\x20sms\x20account\x20configured');}var _0x27213f=this[_0x1c59('0x36')]['sync'](this,_0x36d5dc[_0x1c59('0x19f')]);if(!_0x27213f){return this[_0x1c59('0x12')]['error'](_0x36d5dc,_0x1c59('0x1a0'));}var _0x345dc4={'body':_0x36d5dc[_0x1c59('0x1a1')],'phone':_0x36d5dc['to']||'','SmsAccountId':_0x27213f['id']};logger['debug'](_0x1c59('0x1a2'),JSON[_0x1c59('0x72')](_0x345dc4));this[_0x1c59('0x39')][_0x1c59('0x6f')](this,_0x36d5dc,_0x36d5dc[_0x1c59('0x19f')]);this[_0x1c59('0x12')][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0x1a3'),_0x27213f[_0x1c59('0x16')]));this[_0x1c59('0x38')][_0x1c59('0x6f')](this,_0x345dc4);return this[_0x1c59('0x12')][_0x1c59('0xa8')](_0x1c59('0x1a4'));};AGIVertices['prototype']['set']=function(_0x1df389){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x1df389[_0x1c59('0x3b')]));if(!this[_0x1c59('0x84')](_0x1df389[_0x1c59('0xd2')])){return this[_0x1c59('0x12')]['error'](_0x1df389,'no\x20variable\x20selected');}var _0xd20a10=this[_0x1c59('0x15')][_0x1c59('0x6f')](this,_0x1df389[_0x1c59('0xd2')]);if(!_0xd20a10){return this[_0x1c59('0x12')][_0x1c59('0x30')](_0x1df389,'no\x20variable\x20found');}return this[_0x1c59('0x12')]['setVariable'](_0xd20a10,_0x1df389['variable_value']);};AGIVertices[_0x1c59('0x18')][_0x1c59('0x1a5')]=function(_0x44f38d){logger['info'](util[_0x1c59('0x2e')](_0x1c59('0x1a6'),_0x44f38d[_0x1c59('0x3b')]));this['channel'][_0x1c59('0xa8')](_0x1c59('0x1a7'));if(_0x44f38d[_0x1c59('0xb7')]===_0x1c59('0x1a8')){this[_0x1c59('0x12')][_0x1c59('0xa8')](_0x1c59('0x1a9'));return this['channel']['answer']();}return this[_0x1c59('0x12')]['noop']('Skipped\x20Answer');};AGIVertices['prototype'][_0x1c59('0x1aa')]=function(_0x8b0a2a){logger[_0x1c59('0x32')](util['format'](_0x1c59('0x1ab'),_0x8b0a2a[_0x1c59('0x3b')]));if(!this[_0x1c59('0x84')](_0x8b0a2a[_0x1c59('0x1ac')])){return this[_0x1c59('0x12')][_0x1c59('0x30')](_0x8b0a2a,_0x1c59('0x1ad'));}var _0x35d8be=this[_0x1c59('0x1c')][_0x1c59('0x6f')](this,_0x8b0a2a[_0x1c59('0x1ac')]);if(!this['isConfigured'](_0x35d8be)){return this['channel'][_0x1c59('0x30')](_0x8b0a2a,util[_0x1c59('0x2e')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x8b0a2a[_0x1c59('0x1ac')]));}if(_0x35d8be===this[_0x1c59('0x12')][_0x1c59('0x3d')]){return this['channel'][_0x1c59('0x30')](_0x8b0a2a,_0x1c59('0x1ae'));}this['createSquareDetailsReport']['sync'](this,_0x8b0a2a,_0x35d8be);var _0xaa2358=this[_0x1c59('0x12')][_0x1c59('0x58')](_0x1c59('0x1af'),util[_0x1c59('0x2e')](_0x1c59('0x1b0'),config[_0x1c59('0x9')][_0x1c59('0x192')]||_0x1c59('0x1b1'),_0x35d8be,this['channel'][_0x1c59('0x3d')]));if(_0xaa2358[_0x1c59('0xa3')]===-0x1){return _0xaa2358;}return this[_0x1c59('0x12')][_0x1c59('0xa8')](util[_0x1c59('0x2e')]('Executed\x20command\x20%s\x20%s',_0x1c59('0x1af'),_0x35d8be));};AGIVertices[_0x1c59('0x18')][_0x1c59('0x1b2')]=function(_0x156f8f){logger['info'](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x156f8f[_0x1c59('0x3b')]));var _0x533589=this[_0x1c59('0x1b3')][_0x1c59('0x6f')](this,_0x156f8f[_0x1c59('0x1b4')]);this[_0x1c59('0x39')][_0x1c59('0x6f')](this,_0x156f8f,_0x156f8f[_0x1c59('0x1b4')]);if(this[_0x1c59('0x84')](_0x156f8f['variable_id'])){var _0x16491d=this[_0x1c59('0x15')]['sync'](this,_0x156f8f[_0x1c59('0xd2')]);if(_0x16491d){this[_0x1c59('0x12')][_0x1c59('0x9c')](_0x16491d,_0x533589);return this[_0x1c59('0x12')][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0x1b5'),_0x156f8f[_0x1c59('0x1b4')],_0x16491d));}}return this[_0x1c59('0x12')][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0x1b6'),_0x156f8f[_0x1c59('0x1b4')]));};AGIVertices[_0x1c59('0x18')][_0x1c59('0x1b7')]=function(_0x47f0ee){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')](_0x1c59('0x1b8'),_0x47f0ee['label']));_0x47f0ee[_0x1c59('0x5e')]=_0x47f0ee[_0x1c59('0x5e')][_0x1c59('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x1c59('0x84')](_0x47f0ee['apiKey'])){return this[_0x1c59('0x12')][_0x1c59('0xa8')]('no\x20apiKey\x20configured');}if(!this['isConfigured'](_0x47f0ee[_0x1c59('0x5e')])){return this['channel'][_0x1c59('0xa8')](_0x1c59('0xa9'));}this['channel'][_0x1c59('0xa8')](util[_0x1c59('0x2e')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x47f0ee[_0x1c59('0x5e')]));var _0x6972ee=this[_0x1c59('0x5b')][_0x1c59('0x6f')](this,_0x47f0ee);if(_0x6972ee){this[_0x1c59('0x12')]['noop'](util[_0x1c59('0x2e')](_0x1c59('0x1b9'),_0x6972ee));var _0x2eff87=this['channel'][_0x1c59('0xfd')](_0x6972ee);try{fs[_0x1c59('0xfe')](_0x6972ee+_0x1c59('0xff'));}catch(_0x7c45de){logger['error'](_0x7c45de);}return _0x2eff87;}return this[_0x1c59('0x12')]['error'](_0x47f0ee,_0x1c59('0x1ba'));};AGIVertices['prototype'][_0x1c59('0x1bb')]=function(_0x9d03d4){logger['info'](util[_0x1c59('0x2e')](_0x1c59('0x1bc'),_0x9d03d4[_0x1c59('0x3b')]));_0x9d03d4[_0x1c59('0x5e')]=_0x9d03d4['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x1c59('0x84')](_0x9d03d4[_0x1c59('0x5e')])){return this['channel']['noop']('no\x20text\x20configured');}this[_0x1c59('0x12')]['noop'](util[_0x1c59('0x2e')](_0x1c59('0x1bd'),_0x9d03d4[_0x1c59('0x5e')]));var _0x56ff03=this[_0x1c59('0x61')]['sync'](this,_0x9d03d4);if(_0x56ff03){this[_0x1c59('0x12')][_0x1c59('0xa8')](util[_0x1c59('0x2e')]('Google\x20TTS\x20%s\x20file\x20created',_0x56ff03));var _0x19a73b=this[_0x1c59('0x12')][_0x1c59('0xfd')](_0x56ff03);try{fs['unlink'](_0x56ff03+_0x1c59('0xff'));}catch(_0x563f74){logger[_0x1c59('0x30')](_0x563f74);}return _0x19a73b;}return this[_0x1c59('0x12')][_0x1c59('0x30')](_0x9d03d4,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x1c59('0x18')]['unpause']=function(_0x5574fd){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')](_0x1c59('0x1be'),_0x5574fd[_0x1c59('0x3b')]));if(!this[_0x1c59('0x84')](_0x5574fd['findBy'])){return this[_0x1c59('0x12')][_0x1c59('0x30')](_0x5574fd,_0x1c59('0x151'));}logger[_0x1c59('0x32')](util[_0x1c59('0x2e')](_0x1c59('0x155'),this[_0x1c59('0x12')]['callerid'],_0x5574fd[_0x1c59('0x150')]));var _0x380842=this[_0x1c59('0x53')][_0x1c59('0x6f')](this,_0x5574fd[_0x1c59('0x150')]);if(_0x380842){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x1c59('0x12')]['callerid'],_0x5574fd[_0x1c59('0x150')]));this[_0x1c59('0x12')][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0x152'),this[_0x1c59('0x12')][_0x1c59('0x3e')],_0x5574fd[_0x1c59('0x150')]));return{'code':0xc8,'result':'success'};}else{logger[_0x1c59('0x32')](util[_0x1c59('0x2e')](_0x1c59('0x154'),this[_0x1c59('0x12')]['callerid'],_0x5574fd['findBy']));this[_0x1c59('0x12')][_0x1c59('0xa8')](util[_0x1c59('0x2e')](_0x1c59('0x154'),this[_0x1c59('0x12')][_0x1c59('0x3e')],_0x5574fd[_0x1c59('0x150')]));return{'code':0xc8,'result':_0x1c59('0x156')};}};AGIVertices[_0x1c59('0x18')]['voicemail']=function(_0x235b26){logger[_0x1c59('0x32')](util[_0x1c59('0x2e')](_0x1c59('0x1bf'),_0x235b26[_0x1c59('0x3b')]));var _0x45dd23=this[_0x1c59('0x12')][_0x1c59('0x58')](_0x1c59('0x1c0'),[_0x235b26['mailbox'],_0x235b26[_0x1c59('0x76')]]);if(_0x45dd23[_0x1c59('0xa3')]===-0x1){return _0x45dd23;}return this[_0x1c59('0x12')]['noop'](util[_0x1c59('0x2e')](_0x1c59('0xc0'),_0x1c59('0x1c0'),_0x235b26[_0x1c59('0x1c1')]));};AGIVertices[_0x1c59('0x18')][_0x1c59('0x1c2')]=function(_0x45e84f){logger[_0x1c59('0x32')](util['format']('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x45e84f[_0x1c59('0x3b')]));if(!this[_0x1c59('0x84')](_0x45e84f[_0x1c59('0xd2')])){return this[_0x1c59('0x12')][_0x1c59('0x30')](_0x45e84f,_0x1c59('0x1c3'));}var _0x3d673f=this[_0x1c59('0x15')][_0x1c59('0x6f')](this,_0x45e84f[_0x1c59('0xd2')]);if(!_0x3d673f){return this[_0x1c59('0x12')]['error'](_0x45e84f,_0x1c59('0xd4'));}var _0x50a1b1=this[_0x1c59('0x12')]['getVariable'](_0x3d673f);return{'code':0xc8,'result':_0x50a1b1[_0x1c59('0xa0')]?_0x50a1b1[_0x1c59('0xa0')]:'-'};};String['prototype'][_0x1c59('0x9f')]=function(_0x3a7a18,_0x117058){return this[_0x1c59('0x9d')](_0x3a7a18)[_0x1c59('0x1c4')](_0x117058);};module[_0x1c59('0x1c5')]=AGIVertices; \ No newline at end of file +var _0x1c2f=['menu','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunk','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','interval','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','callerid','createSquareRecording','calleridname','context','priority','accountcode','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPauseById','agentPause','isNil','agentUnpause','agent','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','audioEncoding','googleTTS','google_tts_language','restAPI','url','method','timeout','number','POST','PUT','toUpperCase','body','parse','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','stringify','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','includes','clone','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','isArray','length','%s.%s','saveRestApiResult','setVariable','split','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','noop','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20odbc\x20database\x20found','replace','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','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','no\x20key\x20configured','bot','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20client_email\x20configured','no\x20anguage\x20configured','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','phone','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','response','maxdigit','mindigit','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','getdigits','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','%s/recordings/%s','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','intKey','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','math','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','no\x20file\x20audio\x20selected','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','statusMessage','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','account_id','no\x20mail\x20account\x20configured','\x22%s\x22\x20<%s>','email','user','bcc','subject','Smtp','service','host','port','secure','authentication','auth','pass','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','getSmsAccount','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','answer','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','arg_1','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','replaceAll','join','exports','path','util','lodash','shelljs','odbc','randomstring','mustache','request-promise','../../config/logger','agi','./scripts','rawHeaders','rawBody'];(function(_0x54c9dd,_0x233a86){var _0x855156=function(_0x2dd60b){while(--_0x2dd60b){_0x54c9dd['push'](_0x54c9dd['shift']());}};_0x855156(++_0x233a86);}(_0x1c2f,0x1c3));var _0xf1c2=function(_0x5e7926,_0x388fa5){_0x5e7926=_0x5e7926-0x0;var _0x4466c4=_0x1c2f[_0x5e7926];return _0x4466c4;};'use strict';var fs=require('fs');var path=require(_0xf1c2('0x0'));var util=require(_0xf1c2('0x1'));var _=require(_0xf1c2('0x2'));var sh=require(_0xf1c2('0x3'));var odbc=require(_0xf1c2('0x4'))();var rs=require(_0xf1c2('0x5'));var moment=require('moment');var Mustache=require(_0xf1c2('0x6'));var rp=require(_0xf1c2('0x7'));var logger=require(_0xf1c2('0x8'))(_0xf1c2('0x9'));var config=require('../../config/environment');var scripts=require(_0xf1c2('0xa'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xf1c2('0xb'),_0xf1c2('0xc')];var verticesWithRetry=[_0xf1c2('0xd'),'getdigits',_0xf1c2('0xe')];var AGIVertices=function(_0x1154f7,_0x537e89,_0x306ca1){this[_0xf1c2('0xf')]=_0x1154f7;this[_0xf1c2('0x10')]=_0x537e89;this[_0xf1c2('0x11')]=_0x306ca1;};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x13')]=function(_0x1209a1,_0x2c8864){this[_0xf1c2('0x10')]['getVariableById'](_0x1209a1)[_0xf1c2('0x14')](function(_0xe4e3f){_0x2c8864(null,_0xe4e3f?_0xe4e3f[_0xf1c2('0x15')]:![]);})[_0xf1c2('0x16')](function(_0x96c1e9){_0x2c8864(_0x96c1e9);});};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x17')]=function(_0x3b1de4,_0x30a01d){this[_0xf1c2('0x10')][_0xf1c2('0x18')](_0x3b1de4)[_0xf1c2('0x14')](function(_0x4fe5ea){_0x30a01d(null,_0x4fe5ea?_0x4fe5ea['name']:![]);})[_0xf1c2('0x16')](function(_0x3d50b6){_0x30a01d(_0x3d50b6);});};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x19')]=function(_0x225394,_0x3d89b1){this[_0xf1c2('0x10')]['getSquareProjectById'](_0x225394)['then'](function(_0x53b450){_0x3d89b1(null,_0x53b450?_0x53b450[_0xf1c2('0x15')]:![]);})[_0xf1c2('0x16')](function(_0x5f468a){_0x3d89b1(_0x5f468a);});};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x1a')]=function(_0x78a751,_0x54f2e8){this[_0xf1c2('0x10')][_0xf1c2('0x1b')](_0x78a751)[_0xf1c2('0x14')](function(_0x47c4b){_0x54f2e8(null,_0x47c4b?_0x47c4b['dsn']:![]);})[_0xf1c2('0x16')](function(_0x35b755){_0x54f2e8(_0x35b755);});};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x1c')]=function(_0x4e5917,_0x11b8da){this[_0xf1c2('0x10')][_0xf1c2('0x1d')](_0x4e5917)[_0xf1c2('0x14')](function(_0xd19c96){_0x11b8da(null,_0xd19c96?_0xd19c96[_0xf1c2('0x15')]:![]);})[_0xf1c2('0x16')](function(_0x571078){_0x11b8da(_0x571078);});};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x1e')]=function(_0x5bb917,_0x10f292){this[_0xf1c2('0x10')]['getTrunkById'](_0x5bb917)['then'](function(_0x4ce293){_0x10f292(null,_0x4ce293?_0x4ce293[_0xf1c2('0x15')]:![]);})[_0xf1c2('0x16')](function(_0x1708f4){_0x10f292(_0x1708f4);});};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x1f')]=function(_0x173210,_0x32d910){var _0x35671f=this;this[_0xf1c2('0x10')][_0xf1c2('0x20')](_0x173210)[_0xf1c2('0x14')](function(_0x20612d){_0x32d910(null,_0x20612d?_0x35671f[_0xf1c2('0x21')](_0x20612d[_0xf1c2('0x22')]):![]);})[_0xf1c2('0x16')](function(_0x1ed76f){_0x32d910(_0x1ed76f);});};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x23')]=function(_0x449126,_0x2347e7){this[_0xf1c2('0x10')][_0xf1c2('0x24')](_0x449126)['then'](function(_0x4a4fe6){_0x2347e7(null,_0x4a4fe6?_0x4a4fe6:![]);})[_0xf1c2('0x16')](function(_0x1c0aa8){_0x2347e7(_0x1c0aa8);});};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x25')]=function(_0x806911,_0x58f72f,_0x34bddf){this['mailRpc'][_0xf1c2('0x25')](_0x806911,_0x58f72f)[_0xf1c2('0x14')](function(){_0x34bddf(null);})[_0xf1c2('0x16')](function(_0x35f09f){_0x34bddf(_0x35f09f);});};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x26')]=function(_0x4b2654,_0x3781d4){this[_0xf1c2('0x10')]['getIntervalById'](_0x4b2654)[_0xf1c2('0x14')](function(_0x165de0){if(_0x165de0){if(_0x165de0['IntervalId']){_0x3781d4(null,[_0x165de0[_0xf1c2('0x27')]]);}else{_0x3781d4(null,_['map'](_0x165de0[_0xf1c2('0x28')],'interval'));}}else{_0x3781d4(null,![]);}})[_0xf1c2('0x16')](function(_0x4618df){_0x3781d4(_0x4618df);});};AGIVertices['prototype'][_0xf1c2('0x21')]=function(_0x362fa0){return util[_0xf1c2('0x29')](_0xf1c2('0x2a'),FILES_PATH,_0x362fa0);};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x2b')]=function(_0x48c328,_0x55d0f0,_0x57bf58){odbc['open'](_0x48c328,function(_0x4f8a78){if(_0x4f8a78){logger[_0xf1c2('0x2c')](_0xf1c2('0x2d'),_0x4f8a78);_0x57bf58(_0x4f8a78);}else{logger[_0xf1c2('0x2e')](_0xf1c2('0x2f'));odbc[_0xf1c2('0x30')](_0x55d0f0,function(_0x455bcf,_0x56a1f6){if(_0x455bcf){logger['info']('Error\x20executing\x20query\x20%s',_0x55d0f0);_0x57bf58(_0x455bcf);}else{logger[_0xf1c2('0x2e')](_0xf1c2('0x31'),_0x55d0f0);odbc[_0xf1c2('0x32')](function(_0x131d40){if(_0x131d40){logger[_0xf1c2('0x2c')](_0xf1c2('0x33'),_0x131d40);}_0x57bf58(null,_0x56a1f6);});}});}});};AGIVertices[_0xf1c2('0x12')]['getSmsAccount']=function(_0x24084a,_0x33e402){this[_0xf1c2('0x10')][_0xf1c2('0x34')](_0x24084a)['then'](function(_0x15381d){_0x33e402(null,_0x15381d?_0x15381d:![]);})[_0xf1c2('0x16')](function(_0x4c6d8c){_0x33e402(_0x4c6d8c);});};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x35')]=function(_0x2c9cef,_0x4c6d80){this[_0xf1c2('0x10')]['createSmsMessage'](_0x2c9cef)[_0xf1c2('0x14')](function(_0x51fef2){_0x4c6d80(null,_0x51fef2);})[_0xf1c2('0x16')](function(_0x3554a6){_0x4c6d80(_0x3554a6);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x6f5dca,_0x5d29b9,_0xac6c69){this[_0xf1c2('0x10')][_0xf1c2('0x36')]({'uniqueid':this['channel'][_0xf1c2('0x37')],'node':_0x6f5dca[_0xf1c2('0x38')],'application':_0x6f5dca[_0xf1c2('0x39')],'data':_0x5d29b9||null,'project_name':this[_0xf1c2('0xf')]['arg_1'],'callerid':this['channel'][_0xf1c2('0x3a')]})[_0xf1c2('0x14')](function(_0x4aa06c){if(_0xac6c69){_0xac6c69(null,_0x4aa06c);}})[_0xf1c2('0x16')](function(_0x5ea354){if(_0xac6c69){_0xac6c69(_0x5ea354);}});};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x3b')]=function(_0x1b2965,_0x1f3efa,_0x3d8667,_0x47a066){this[_0xf1c2('0x10')][_0xf1c2('0x3b')]({'uniqueid':this['channel'][_0xf1c2('0x37')],'callerid':this['channel'][_0xf1c2('0x3a')],'calleridname':this[_0xf1c2('0xf')][_0xf1c2('0x3c')],'context':this[_0xf1c2('0xf')][_0xf1c2('0x3d')],'extension':this[_0xf1c2('0xf')]['extension'],'priority':this['channel'][_0xf1c2('0x3e')],'accountcode':this[_0xf1c2('0xf')][_0xf1c2('0x3f')],'dnid':this[_0xf1c2('0xf')]['dnid'],'projectName':this[_0xf1c2('0xf')]['arg_1'],'saveName':_0x1f3efa,'filename':_0x1b2965['file']||_0x1f3efa,'savePath':_0x3d8667})[_0xf1c2('0x14')](function(_0x51e767){_0x47a066(null,_0x51e767);})[_0xf1c2('0x16')](function(_0x54c6fc){_0x47a066(_0x54c6fc);});};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x40')]=function(_0x2a7a43,_0x193495,_0x3ab220,_0x3759aa,_0x11355d){this[_0xf1c2('0x10')][_0xf1c2('0x40')]({'uniqueid':this[_0xf1c2('0xf')][_0xf1c2('0x37')],'body':_0x2a7a43,'direction':_0x193495,'providerName':_0x3ab220,'providerResponse':_0x3759aa})[_0xf1c2('0x14')](function(_0x4c8c74){if(_0x11355d){_0x11355d(null,_0x4c8c74);}})[_0xf1c2('0x16')](function(_0x52866d){if(_0x11355d){_0x11355d(_0x52866d);}});};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x41')]=function(_0x7e572e,_0x2dfb75){this[_0xf1c2('0x10')][_0xf1c2('0x41')]({'firstName':_[_0xf1c2('0x42')](_0x7e572e[_0xf1c2('0x15')])||_['isNil'](_0x7e572e['name'])?_0xf1c2('0x43')+Math[_0xf1c2('0x44')]():_0x7e572e[_0xf1c2('0x15')],'lastName':_[_0xf1c2('0x42')](_0x7e572e['lastName'])||_['isNil'](_0x7e572e[_0xf1c2('0x45')])?null:_0x7e572e[_0xf1c2('0x45')],'phone':_0x7e572e['phone'],'ListId':_0x7e572e[_0xf1c2('0x46')],'scheduledat':_0x7e572e[_0xf1c2('0x47')],'callbackUniqueid':this['channel']['uniqueid'],'tags':'callback','description':_0xf1c2('0x48')+_0x7e572e[_0xf1c2('0x47')][_0xf1c2('0x49')](),'priority':_0x7e572e[_0xf1c2('0x4a')]})[_0xf1c2('0x14')](function(_0x2524bb){_0x2dfb75(null,_0x2524bb);})[_0xf1c2('0x16')](function(_0x596e5a){_0x2dfb75(_0x596e5a);});};AGIVertices[_0xf1c2('0x12')]['getPause']=function(_0x101cb1,_0x5471ea){this[_0xf1c2('0x10')][_0xf1c2('0x4b')](_0x101cb1)[_0xf1c2('0x14')](function(_0x184d3c){_0x5471ea(null,_0x184d3c?_0x184d3c[_0xf1c2('0x15')]:![]);})[_0xf1c2('0x16')](function(_0x3f83ea){_0x5471ea(_0x3f83ea);});};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x4c')]=function(_0x37dc19,_0x183ad5,_0x14028d){var _0x5207c7={'role':'agent'};_0x5207c7[_0x37dc19]=this['channel'][_0xf1c2('0x3a')];this['rpc']['agentPause'](_0x5207c7,_0x183ad5,this[_0xf1c2('0xf')][_0xf1c2('0x37')])['then'](function(_0x4ccb52){_0x14028d(null,_[_0xf1c2('0x4d')](_0x4ccb52)?![]:!![]);})[_0xf1c2('0x16')](function(_0x3a1eb9){logger[_0xf1c2('0x2c')](_0x3a1eb9);_0x14028d(null,![]);});};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x4e')]=function(_0x355775,_0x5931bd){var _0x743723={'role':_0xf1c2('0x4f')};_0x743723[_0x355775]=this[_0xf1c2('0xf')]['callerid'];this[_0xf1c2('0x10')][_0xf1c2('0x4e')](_0x743723)[_0xf1c2('0x14')](function(_0x3efa5d){_0x5931bd(null,_['isNil'](_0x3efa5d)?![]:!![]);})[_0xf1c2('0x16')](function(_0x1752e3){logger[_0xf1c2('0x2c')](_0x1752e3);_0x5931bd(null,![]);});};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x50')]=function(_0x1d1821,_0x58e619){var _0x246782={'role':_0xf1c2('0x4f')};_0x246782[_0x1d1821]=this[_0xf1c2('0xf')][_0xf1c2('0x3a')];this[_0xf1c2('0x10')][_0xf1c2('0x50')](_0x246782)[_0xf1c2('0x14')](function(_0x2cdde9){_0x58e619(null,_[_0xf1c2('0x4d')](_0x2cdde9)?![]:!![]);})[_0xf1c2('0x16')](function(_0x2b736e){logger[_0xf1c2('0x2c')](_0x2b736e);_0x58e619(null,![]);});};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x51')]=function(_0x32af84,_0x1d0de0){var _0x5d2d79={'role':_0xf1c2('0x4f')};_0x5d2d79[_0x32af84]=this['channel']['callerid'];var _0xd93484=_0x32af84!=_0xf1c2('0x52')?util[_0xf1c2('0x29')](_0xf1c2('0x53'),_0xf1c2('0x54'),this[_0xf1c2('0xf')]['callerid']):undefined;this[_0xf1c2('0x10')][_0xf1c2('0x51')](_0x5d2d79,_0xd93484)[_0xf1c2('0x14')](function(_0x4a5507){_0x1d0de0(null,_['isNil'](_0x4a5507)?![]:!![]);})[_0xf1c2('0x16')](function(_0x54b609){logger['error'](_0x54b609);_0x1d0de0(null,![]);});};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x55')]=function(_0x29cab4,_0x56798a){sh[_0xf1c2('0x56')](_['trim'](_0x29cab4),function(_0x4625b1,_0x160597){var _0x4f2827=_0x160597['replace'](/(\r\n|\n|\r)/gm,'');_0x56798a(null,_0x4f2827);});};AGIVertices['prototype']['googleCloudTTS']=function(_0x35ccf2,_0x1a8312){scripts[_0xf1c2('0x57')](_0x35ccf2[_0xf1c2('0x58')],_0x35ccf2['google_cloud_tts_text_type']||'text',_0x35ccf2[_0xf1c2('0x59')],_0x35ccf2[_0xf1c2('0x5a')]||_0xf1c2('0x5b'),_0x35ccf2[_0xf1c2('0x5c')]||'MALE',_0x35ccf2[_0xf1c2('0x5d')]||'MP3')['then'](function(_0x11c1af){_0x1a8312(null,_0x11c1af);})[_0xf1c2('0x16')](function(_0x2be8e8){_0x1a8312(_0x2be8e8);});};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x5e')]=function(_0x1cb3b1,_0x534d86){scripts[_0xf1c2('0x5e')](_0x1cb3b1[_0xf1c2('0x59')],_0x1cb3b1[_0xf1c2('0x5f')]||'en',0x1)[_0xf1c2('0x14')](function(_0x5b914e){_0x534d86(null,_0x5b914e);})[_0xf1c2('0x16')](function(_0x1e3d5d){_0x534d86(_0x1e3d5d);});};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x60')]=function(_0x583a11,_0x26e6a6){var _0x1a685c={'uri':_0x583a11[_0xf1c2('0x61')],'method':_0x583a11[_0xf1c2('0x62')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x583a11[_0xf1c2('0x63')])===_0xf1c2('0x64')&&parseInt(_0x583a11[_0xf1c2('0x63')])>=0x1?parseInt(_0x583a11['timeout'])*0x3e8:0x5*0x3e8};if(_['includes']([_0xf1c2('0x65'),_0xf1c2('0x66')],_0x1a685c['method'][_0xf1c2('0x67')]())){try{_0x1a685c[_0xf1c2('0x68')]=_0x583a11['rawBody']?JSON[_0xf1c2('0x69')](_0x583a11['rawBody']):{};}catch(_0x27794a){logger[_0xf1c2('0x2c')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x27794a);}}try{_0x1a685c[_0xf1c2('0x6a')]=_0x583a11['rawHeaders']?JSON[_0xf1c2('0x69')](_0x583a11[_0xf1c2('0xb')]):{};}catch(_0x1871bc){logger[_0xf1c2('0x2c')](_0xf1c2('0x6b'),_0x1871bc);}if(_0x583a11[_0xf1c2('0x6c')]){try{var _0x3d3ff2=require(_0x583a11[_0xf1c2('0x6c')])[_0xf1c2('0x6d')](this,_0x1a685c);_0x1a685c['uri']=Mustache['render'](_0x583a11[_0xf1c2('0x61')],_0x3d3ff2,{},['$$','$$']);if(_0x1a685c[_0xf1c2('0x6a')]){_0x1a685c['headers']=JSON[_0xf1c2('0x69')](Mustache[_0xf1c2('0x6e')](JSON['stringify'](_0x1a685c['headers']),_0x3d3ff2,{},['$$','$$']));}if(_0x1a685c[_0xf1c2('0x68')]){_0x1a685c[_0xf1c2('0x68')]=JSON[_0xf1c2('0x69')](Mustache[_0xf1c2('0x6e')](JSON[_0xf1c2('0x6f')](_0x1a685c['body']),_0x3d3ff2,{},['$$','$$']));}}catch(_0x48eec0){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x48eec0);}}rp(_0x1a685c)[_0xf1c2('0x14')](function(_0x46f7b6){var _0x172f7d={'statusCode':_0x46f7b6[_0xf1c2('0x70')]||0xc8,'statusMessage':_0x46f7b6['statusMessage']||'OK','headers':_0x46f7b6['headers']||{},'body':_0x46f7b6[_0xf1c2('0x68')]||{}};_0x26e6a6(null,_0x172f7d);})['catch'](function(_0x3134d9){var _0x5b9bc4={'statusCode':_0x3134d9[_0xf1c2('0x70')]||0x1f4,'statusMessage':_0x3134d9[_0xf1c2('0x71')]||_0xf1c2('0x72'),'headers':_0x3134d9['options'][_0xf1c2('0x6a')]||{},'body':_0x3134d9[_0xf1c2('0x73')][_0xf1c2('0x68')]||{}};_0x26e6a6(null,_0x5b9bc4);});};AGIVertices['prototype'][_0xf1c2('0x74')]=function(_0x37fd13,_0x959215){scripts[_0xf1c2('0x74')](this['channel'][_0xf1c2('0x37')],_0x37fd13[_0xf1c2('0x75')],_0x37fd13[_0xf1c2('0x59')],_0x37fd13[_0xf1c2('0x76')]||'en')['then'](function(_0x318180){_0x959215(null,_0x318180);})[_0xf1c2('0x16')](function(_0x19c7ad){_0x959215(_0x19c7ad);});};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x77')]=function(_0x3b4c41,_0x5dba23){scripts['googleDialogflowV2'](this[_0xf1c2('0xf')]['uniqueid'],_0x3b4c41[_0xf1c2('0x78')],_0x3b4c41[_0xf1c2('0x79')],_0x3b4c41[_0xf1c2('0x7a')],_0x3b4c41[_0xf1c2('0x59')],_0x3b4c41[_0xf1c2('0x7b')]||'en')[_0xf1c2('0x14')](function(_0x17b9da){_0x5dba23(null,_0x17b9da);})[_0xf1c2('0x16')](function(_0x19382d){_0x5dba23(_0x19382d);});};AGIVertices['prototype'][_0xf1c2('0x7c')]=function(_0x528445,_0x42ed13){scripts[_0xf1c2('0x7c')](this[_0xf1c2('0xf')],_0x528445)[_0xf1c2('0x14')](function(_0x455310){_0x42ed13(null,_0x455310);})[_0xf1c2('0x16')](function(_0x103bd8){_0x42ed13(_0x103bd8);});};AGIVertices['prototype'][_0xf1c2('0x7d')]=function(_0x38c20c,_0x8de6e7){scripts[_0xf1c2('0x7d')](_0x38c20c[_0xf1c2('0x75')],_0x38c20c[_0xf1c2('0x59')],_0x38c20c[_0xf1c2('0x7e')]||_0xf1c2('0x5b'),_0x38c20c[_0xf1c2('0x7f')])[_0xf1c2('0x14')](function(_0x545443){_0x8de6e7(null,_0x545443);})[_0xf1c2('0x16')](function(_0x4bed33){_0x8de6e7(_0x4bed33);});};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x80')]=function(_0x5bc839,_0x586f24,_0x121db5){scripts[_0xf1c2('0x80')](_0x586f24,_0x5bc839['key'],_0x5bc839[_0xf1c2('0x81')]||_0xf1c2('0x5b'),this[_0xf1c2('0x82')](_0x5bc839[_0xf1c2('0x83')])?_0x5bc839[_0xf1c2('0x83')]:undefined)[_0xf1c2('0x14')](function(_0x8c8648){_0x121db5(null,_0x8c8648);})[_0xf1c2('0x16')](function(_0x217b51){_0x121db5(_0x217b51);});};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x84')]=function(_0x36e2d9,_0x40dfc8){scripts[_0xf1c2('0x84')](_0x36e2d9[_0xf1c2('0x85')],_0x36e2d9[_0xf1c2('0x86')],_0x36e2d9[_0xf1c2('0x87')],_0x36e2d9['aws_polly_voice']||'Amy',_0x36e2d9[_0xf1c2('0x59')],_0x36e2d9[_0xf1c2('0x88')]||'text')[_0xf1c2('0x14')](function(_0x57934d){_0x40dfc8(null,_0x57934d);})[_0xf1c2('0x16')](function(_0x309013){_0x40dfc8(_0x309013);});};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x89')]=function(_0x544fb5,_0x23df10){scripts[_0xf1c2('0x89')](this['channel']['uniqueid'],_0x544fb5[_0xf1c2('0x85')],_0x544fb5[_0xf1c2('0x86')],_0x544fb5[_0xf1c2('0x8a')],_0x544fb5[_0xf1c2('0x59')],_0x544fb5[_0xf1c2('0x8b')])[_0xf1c2('0x14')](function(_0x1ac792){_0x23df10(null,_0x1ac792);})[_0xf1c2('0x16')](function(_0x47775a){_0x23df10(_0x47775a);});};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x8c')]=function(_0x44e1fe,_0xe104a5,_0x3280b8){scripts['googleASR'](_0xe104a5,_0x44e1fe[_0xf1c2('0x75')],_0x44e1fe[_0xf1c2('0x8d')]||_0xf1c2('0x5b'))['then'](function(_0x2e94e7){_0x3280b8(null,_0x2e94e7);})[_0xf1c2('0x16')](function(_0x40579c){_0x3280b8(_0x40579c);});};AGIVertices['prototype'][_0xf1c2('0x8e')]=function(_0x54526a,_0x534104,_0x5f3cfb){scripts['tildeASR'](_0x534104,_0x54526a[_0xf1c2('0x8f')],_0x54526a[_0xf1c2('0x90')],_0x54526a[_0xf1c2('0x91')])[_0xf1c2('0x14')](function(_0x3fe7c6){_0x5f3cfb(null,_0x3fe7c6);})[_0xf1c2('0x16')](function(_0x7ded0c){_0x5f3cfb(_0x7ded0c);});};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x92')]=function(_0x2f04b2){var _0x2a5e3f=_[_0xf1c2('0x93')](verticesWithRetry,_0x2f04b2[_0xf1c2('0x39')])?_0x2f04b2:_[_0xf1c2('0x94')](_0x2f04b2);for(var _0x347040 in _0x2a5e3f){if(_0x2a5e3f['hasOwnProperty'](_0x347040)){if(_0x2a5e3f[_0x347040]&&_[_0xf1c2('0x95')](_0x2a5e3f[_0x347040])){if(_[_0xf1c2('0x93')](recursiveMapAttributes,_0x347040)){_0x2a5e3f[_0x347040]=this[_0xf1c2('0x96')](_0x2a5e3f[_0x347040]);}else{_0x2a5e3f[_0x347040]=this[_0xf1c2('0x97')](_0x2a5e3f[_0x347040]);}}}}return _0x2a5e3f;};AGIVertices['prototype'][_0xf1c2('0x98')]=function(_0x1330e0){for(var _0x3e1c55 in _0x1330e0){if(_0x1330e0[_0xf1c2('0x99')](_0x3e1c55)){if(_[_0xf1c2('0x9a')](_0x1330e0[_0x3e1c55])){this[_0xf1c2('0x98')](_0x1330e0[_0x3e1c55]);}else if(_[_0xf1c2('0x9b')](_0x1330e0[_0x3e1c55])){for(var _0x4f07c2=0x0;_0x4f07c2<_0x1330e0[_0x3e1c55][_0xf1c2('0x9c')];_0x4f07c2++){this[_0xf1c2('0x98')](_0x1330e0[_0x3e1c55][_0x4f07c2]);}}else if(_[_0xf1c2('0x95')](_0x1330e0[_0x3e1c55])){_0x1330e0[_0x3e1c55]=this[_0xf1c2('0x97')](_0x1330e0[_0x3e1c55]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x5ab821,_0x1510a5){for(var _0x475de9 in _0x5ab821){if(_0x5ab821['hasOwnProperty'](_0x475de9)){if(_['isPlainObject'](_0x5ab821[_0x475de9])){if(!_[_0xf1c2('0x42')](_0x5ab821[_0x475de9])){this['saveRestApiResult'](_0x5ab821[_0x475de9],util[_0xf1c2('0x29')](_0xf1c2('0x9d'),_0x1510a5,_0x475de9));}}else if(_['isArray'](_0x5ab821[_0x475de9])){for(var _0x16abdf=0x0;_0x16abdf<_0x5ab821[_0x475de9][_0xf1c2('0x9c')];_0x16abdf++){this[_0xf1c2('0x9e')](_0x5ab821[_0x475de9][_0x16abdf],util[_0xf1c2('0x29')]('%s.%s',_0x1510a5,_0x475de9+'['+_0x16abdf+']'));}}else{if(!_[_0xf1c2('0x4d')](_0x5ab821[_0x475de9])){this[_0xf1c2('0xf')][_0xf1c2('0x9f')](util[_0xf1c2('0x29')](_0xf1c2('0x9d'),_0x1510a5,_0x475de9),_0x5ab821[_0x475de9]);}}}}};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x96')]=function(_0x424cae){try{var _0x3ccc97=JSON[_0xf1c2('0x69')](_0x424cae);this[_0xf1c2('0x98')](_0x3ccc97);return JSON['stringify'](_0x3ccc97);}catch(_0x51bb1c){return this[_0xf1c2('0x97')](_0x424cae);}};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x97')]=function(_0x3bd9e5){var _0x2ec32c=_0x3bd9e5[_0xf1c2('0xa0')]('{');for(var _0x44c7c8=0x1;_0x44c7c8<_0x2ec32c['length'];_0x44c7c8+=0x1){var _0x1512db=_0x2ec32c[_0x44c7c8][_0xf1c2('0xa0')]('}');if(_0x1512db[_0xf1c2('0x9c')]>0x1){_0x3bd9e5=_0x3bd9e5['replaceAll']('{'+_0x1512db[0x0]+'}',this['channel'][_0xf1c2('0x13')](_0x1512db[0x0])['extra']||_0x1512db[0x0]);}}if(_0x2ec32c[_0xf1c2('0x9c')]===0x1){return _0x3bd9e5[_0xf1c2('0x49')]();}return this[_0xf1c2('0x97')](_0x3bd9e5);};AGIVertices['prototype'][_0xf1c2('0xa1')]=function(_0x199966,_0x11c200){var _0x4458ba=this[_0xf1c2('0xf')]['getVariable'](_0x199966);if(_0x4458ba[_0xf1c2('0xa2')]===-0x1){return _0x4458ba;}logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0xa3'),_0x11c200,_0x4458ba[_0xf1c2('0xa4')]));return this[_0xf1c2('0xf')][_0xf1c2('0x9f')](_0x11c200,_0x4458ba['extra']);};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x82')]=function(_0x38b100){return _0x38b100&&_0x38b100!=='0'&&_0x38b100!=='-1'&&_0x38b100!=='';};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0xa5')]=function(_0x1ce354){this[_0xf1c2('0x36')][_0xf1c2('0x6d')](this,_0x1ce354,'-');_0x1ce354[_0xf1c2('0xa6')]=_0x1ce354[_0xf1c2('0xa5')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0xa7')]=function(_0x4b3708){logger['info'](util[_0xf1c2('0x29')](_0xf1c2('0xa8'),_0x4b3708[_0xf1c2('0x38')]));if(!this[_0xf1c2('0x82')](_0x4b3708[_0xf1c2('0x59')])){return this[_0xf1c2('0xf')]['noop'](_0xf1c2('0xa9'));}var _0x4bd472='\x22'+_0x4b3708[_0xf1c2('0x59')]+'\x22';if(this[_0xf1c2('0x82')](_0x4b3708[_0xf1c2('0x73')])){_0x4bd472+=','+_0x4b3708[_0xf1c2('0x73')];}var _0x582857=this['channel']['exec']('MRCPSynth',_0x4bd472);if(_0x582857[_0xf1c2('0xa2')]===-0x1){return _0x582857;}return this[_0xf1c2('0xf')]['noop'](util[_0xf1c2('0x29')](_0xf1c2('0xaa'),_0x4bd472));};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0xab')]=function(_0x509a3d){logger[_0xf1c2('0x2e')](util['format'](_0xf1c2('0xac'),_0x509a3d[_0xf1c2('0x38')]));if(!this['isConfigured'](_0x509a3d[_0xf1c2('0xad')])){return this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0xf1c2('0xaf'));}var _0x45db1c=_0x509a3d[_0xf1c2('0xad')];if(this['isConfigured'](_0x509a3d[_0xf1c2('0x73')])){_0x45db1c+=','+_0x509a3d[_0xf1c2('0x73')];}var _0x203d94=this[_0xf1c2('0xf')][_0xf1c2('0x56')](_0xf1c2('0xb0'),_0x45db1c);if(_0x203d94[_0xf1c2('0xa2')]===-0x1){return _0x203d94;}var _0x432f46=this[_0xf1c2('0xa1')](_0xf1c2('0xb1'),_0xf1c2('0xb2'));if(_0x432f46[_0xf1c2('0xa2')]===-0x1){return _0x432f46;}var _0x58fe4d=this[_0xf1c2('0xa1')](_0xf1c2('0xb3'),_0xf1c2('0xb4'));if(_0x58fe4d[_0xf1c2('0xa2')]===-0x1){return _0x58fe4d;}var _0x169c0d=this[_0xf1c2('0xa1')](_0xf1c2('0xb5'),'MRCP_RECOG_INSTANCE');if(_0x169c0d[_0xf1c2('0xa2')]===-0x1){return _0x169c0d;}return this[_0xf1c2('0xf')][_0xf1c2('0xae')](util[_0xf1c2('0x29')](_0xf1c2('0xb6'),_0x45db1c));};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x9')]=function(_0x308d9c){logger['info'](util[_0xf1c2('0x29')](_0xf1c2('0xb7'),_0x308d9c[_0xf1c2('0x38')]));return this[_0xf1c2('0xf')][_0xf1c2('0x9')]([_0x308d9c['command'],_0x308d9c['args']]);};AGIVertices[_0xf1c2('0x12')]['answer']=function(_0x3a2560){logger['info'](util[_0xf1c2('0x29')](_0xf1c2('0xb8'),_0x3a2560['label']));if(this[_0xf1c2('0x82')](_0x3a2560[_0xf1c2('0x63')])){logger[_0xf1c2('0x2e')](util['format'](_0xf1c2('0xb9'),_0x3a2560['timeout']));var _0x626ae4=this[_0xf1c2('0xf')][_0xf1c2('0xba')](_0x3a2560[_0xf1c2('0x63')]);if(_0x626ae4['result']===-0x1){return _0x626ae4;}}return this[_0xf1c2('0xf')]['answer']();};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0xbb')]=function(_0x31e1a1){logger[_0xf1c2('0x2e')](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x31e1a1['label']));if(!this['isConfigured'](_0x31e1a1[_0xf1c2('0x46')])){return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0x31e1a1,_0xf1c2('0xbc'));}_0x31e1a1['scheduledAt']=moment();if(this[_0xf1c2('0x82')](_0x31e1a1[_0xf1c2('0xbd')])){_0x31e1a1[_0xf1c2('0x47')]=moment()[_0xf1c2('0xbe')](_0x31e1a1[_0xf1c2('0xbd')],_0xf1c2('0xbf'));}if(!this[_0xf1c2('0x82')](_0x31e1a1[_0xf1c2('0x4a')])){_0x31e1a1[_0xf1c2('0x4a')]=0x2;}this[_0xf1c2('0x41')][_0xf1c2('0x6d')](this,_0x31e1a1);return this[_0xf1c2('0xf')][_0xf1c2('0xae')](util['format'](_0xf1c2('0xc0'),_0x31e1a1['phone'],_0x31e1a1[_0xf1c2('0x46')],_0x31e1a1[_0xf1c2('0x47')]));};AGIVertices[_0xf1c2('0x12')]['custom_app']=function(_0xc8eda0){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0xc1'),_0xc8eda0[_0xf1c2('0x38')]));var _0x3444ff=this[_0xf1c2('0xf')][_0xf1c2('0x56')](_0xc8eda0['application'],_0xc8eda0[_0xf1c2('0x73')]);if(_0x3444ff[_0xf1c2('0xa2')]===-0x1){return _0x3444ff;}return this[_0xf1c2('0xf')]['noop'](util[_0xf1c2('0x29')](_0xf1c2('0xc2'),_0xc8eda0['application'],_0xc8eda0[_0xf1c2('0x73')]));};AGIVertices['prototype'][_0xf1c2('0xc3')]=function(_0x30f723){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0xc4'),_0x30f723['label']));if(!this[_0xf1c2('0x82')](_0x30f723[_0xf1c2('0x59')])){return this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0xf1c2('0xa9'));}var _0x3869c6='\x22'+_0x30f723['text']+'\x22';if(this[_0xf1c2('0x82')](_0x30f723[_0xf1c2('0x73')])){_0x3869c6+=','+_0x30f723['options'];}var _0x177dbb=this['channel'][_0xf1c2('0x56')](_0xf1c2('0xc5'),_0x3869c6);if(_0x177dbb[_0xf1c2('0xa2')]===-0x1){return _0x177dbb;}return this['channel'][_0xf1c2('0xae')](util[_0xf1c2('0x29')](_0xf1c2('0xaa'),_0x3869c6));};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0xc6')]=function(_0x367ae1){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0xc7'),_0x367ae1['label']));if(!this[_0xf1c2('0x82')](_0x367ae1[_0xf1c2('0x59')])){return this[_0xf1c2('0xf')]['noop'](_0xf1c2('0xa9'));}var _0xe30d7='\x22'+_0x367ae1['text']+'\x22';if(this[_0xf1c2('0x82')](_0x367ae1[_0xf1c2('0x73')])){_0xe30d7+=','+_0x367ae1[_0xf1c2('0x73')];}var _0xe922b1=this[_0xf1c2('0xf')][_0xf1c2('0x56')](_0xf1c2('0xc5'),_0xe30d7);if(_0xe922b1[_0xf1c2('0xa2')]===-0x1){return _0xe922b1;}return this[_0xf1c2('0xf')][_0xf1c2('0xae')](util[_0xf1c2('0x29')](_0xf1c2('0xaa'),_0xe30d7));};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0xc8')]=function(_0x15a623){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0xc9'),_0x15a623[_0xf1c2('0x38')]));if(!this[_0xf1c2('0x82')](_0x15a623['grammar'])){return this['channel'][_0xf1c2('0xae')](_0xf1c2('0xaf'));}var _0x26ca16=_0x15a623[_0xf1c2('0xad')];if(this[_0xf1c2('0x82')](_0x15a623[_0xf1c2('0x73')])){_0x26ca16+=','+_0x15a623['options'];}var _0x5395fd=this['channel'][_0xf1c2('0x56')](_0xf1c2('0xb0'),_0x26ca16);if(_0x5395fd[_0xf1c2('0xa2')]===-0x1){return _0x5395fd;}var _0x3951c9=this[_0xf1c2('0xa1')]('RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE');if(_0x3951c9['result']===-0x1){return _0x3951c9;}var _0x3f9b07=this[_0xf1c2('0xa1')](_0xf1c2('0xb3'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x3f9b07[_0xf1c2('0xa2')]===-0x1){return _0x3f9b07;}var _0x204585=this[_0xf1c2('0xa1')](_0xf1c2('0xb5'),_0xf1c2('0xca'));if(_0x204585[_0xf1c2('0xa2')]===-0x1){return _0x204585;}return this[_0xf1c2('0xf')]['noop'](util[_0xf1c2('0x29')]('Executed\x20command\x20MRCPRecog\x20%s',_0x26ca16));};AGIVertices['prototype'][_0xf1c2('0xcb')]=function(_0x576406){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0xcc'),_0x576406[_0xf1c2('0x38')]));if(!this['isConfigured'](_0x576406[_0xf1c2('0xad')])){return this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0xf1c2('0xaf'));}var _0x2d7713=_0x576406[_0xf1c2('0xad')];if(this[_0xf1c2('0x82')](_0x576406[_0xf1c2('0x73')])){_0x2d7713+=','+_0x576406['options'];}var _0x8766d1=this[_0xf1c2('0xf')][_0xf1c2('0x56')]('MRCPRecog',_0x2d7713);if(_0x8766d1[_0xf1c2('0xa2')]===-0x1){return _0x8766d1;}var _0x2a6807=this['getAndSetVariable'](_0xf1c2('0xb1'),_0xf1c2('0xcd'));if(_0x2a6807['result']===-0x1){return _0x2a6807;}var _0x5820e8=this[_0xf1c2('0xa1')](_0xf1c2('0xb3'),_0xf1c2('0xce'));if(_0x5820e8[_0xf1c2('0xa2')]===-0x1){return _0x5820e8;}var _0x47cc3b=this['getAndSetVariable']('RECOG_INSTANCE()',_0xf1c2('0xcf'));if(_0x47cc3b[_0xf1c2('0xa2')]===-0x1){return _0x47cc3b;}return this[_0xf1c2('0xf')][_0xf1c2('0xae')](util['format'](_0xf1c2('0xb6'),_0x2d7713));};AGIVertices['prototype'][_0xf1c2('0xd0')]=function(_0x4c01ae){logger['info'](util[_0xf1c2('0x29')](_0xf1c2('0xd1'),_0x4c01ae['label']));if(!this['isConfigured'](_0x4c01ae['odbc_id'])){return this[_0xf1c2('0xf')]['error'](_0x4c01ae,_0xf1c2('0xd2'));}var _0x1e8be4=this['getSquareOdbc']['sync'](this,_0x4c01ae[_0xf1c2('0xd3')]);if(!_0x1e8be4){return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0x4c01ae,_0xf1c2('0xd4'));}if(!this[_0xf1c2('0x82')](_0x4c01ae[_0xf1c2('0x30')])){return this['channel'][_0xf1c2('0x2c')](_0x4c01ae,'no\x20query\x20configured');}var _0x16a37e=_0x4c01ae['query'][_0xf1c2('0xd5')](/(\r\n|\n|\r)/gm,'\x20');this[_0xf1c2('0xf')][_0xf1c2('0xae')](util[_0xf1c2('0x29')](_0xf1c2('0xd6'),_0x16a37e));var _0x143f34=this[_0xf1c2('0x2b')][_0xf1c2('0x6d')](this,_0x1e8be4,_0x16a37e);this[_0xf1c2('0x36')]['sync'](this,_0x4c01ae,_0x16a37e);if(!this[_0xf1c2('0x82')](_0x4c01ae[_0xf1c2('0xd7')])){return this['channel'][_0xf1c2('0xae')](_0xf1c2('0xd8'));}var _0x27377e=this[_0xf1c2('0x13')][_0xf1c2('0x6d')](this,_0x4c01ae[_0xf1c2('0xd7')]);if(!_0x27377e){return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0x4c01ae,_0xf1c2('0xd9'));}var _0x75f530=this;_0x143f34[_0xf1c2('0xda')](function(_0x120032,_0x319674){Object['keys'](_0x120032)[_0xf1c2('0xda')](function(_0x446407){_0x75f530['channel'][_0xf1c2('0x9f')](util[_0xf1c2('0x29')](_0xf1c2('0xdb'),_0x27377e,_0x319674,_0x446407),_0x120032[_0x446407]);});});this['channel']['setVariable'](util['format'](_0xf1c2('0xdc'),_0x27377e),_0x143f34['length']);return this[_0xf1c2('0xf')][_0xf1c2('0xae')](util[_0xf1c2('0x29')]('variable\x20%s\x20set',_0x27377e));};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0xdd')]=function(_0x121196){logger[_0xf1c2('0xde')](util[_0xf1c2('0x29')](_0xf1c2('0xdf'),_0x121196[_0xf1c2('0x38')]));if(!this[_0xf1c2('0x82')](_0x121196[_0xf1c2('0xe0')])){return this['channel']['error'](_0x121196,_0xf1c2('0xe1'));}var _0x216f4f=this[_0xf1c2('0x1c')][_0xf1c2('0x6d')](this,_0x121196[_0xf1c2('0xe0')]);if(!_0x216f4f){return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0x121196,_0xf1c2('0xe2'));}var _0x4f5ebd=this['channel'][_0xf1c2('0x56')](_0xf1c2('0xe3'),[util['format']('SIP/%s',_0x216f4f),_0x121196['timeout'],_0x121196[_0xf1c2('0xe4')],_0x121196[_0xf1c2('0x61')]]);if(_0x4f5ebd[_0xf1c2('0xa2')]===-0x1){return _0x4f5ebd;}return this['channel'][_0xf1c2('0xae')](util[_0xf1c2('0x29')](_0xf1c2('0xe5'),_0xf1c2('0xe3')));};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0xe6')]=function(_0x3f12c3){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0xe7'),_0x3f12c3[_0xf1c2('0x38')]));if(!this[_0xf1c2('0x82')](_0x3f12c3['key'])){return this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0xf1c2('0xe8'));}if(!this[_0xf1c2('0x82')](_0x3f12c3['text'])){return this['channel'][_0xf1c2('0xae')](_0xf1c2('0xa9'));}this[_0xf1c2('0xf')][_0xf1c2('0xe9')]=!![];this[_0xf1c2('0x36')](_0x3f12c3);this['createSquareMessage'](_0x3f12c3[_0xf1c2('0x59')],'in','','');this[_0xf1c2('0xf')]['noop'](util[_0xf1c2('0x29')]('Trying\x20Dialogflow:\x20%s',_0x3f12c3[_0xf1c2('0x59')]));var _0x24057e=this[_0xf1c2('0x74')][_0xf1c2('0x6d')](this,_0x3f12c3);if(_0x24057e){for(var _0x4834fc in _0x24057e){if(_0x24057e[_0xf1c2('0x99')](_0x4834fc)){this['channel'][_0xf1c2('0x9f')](util[_0xf1c2('0x29')](_0xf1c2('0xea'),_0x4834fc[_0xf1c2('0x67')]()),_0x24057e[_0x4834fc]);}}this[_0xf1c2('0x40')](_0x24057e[_0xf1c2('0xeb')],_0xf1c2('0xec'),_0xf1c2('0xe6'),'');return this[_0xf1c2('0xf')]['noop'](util[_0xf1c2('0x29')](_0xf1c2('0xed'),_0x24057e['speech']));}return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0x3f12c3,_0xf1c2('0xee'));};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0xef')]=function(_0xb26e3f){logger[_0xf1c2('0x2e')](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0xb26e3f[_0xf1c2('0x38')]));if(!this[_0xf1c2('0x82')](_0xb26e3f['dialogflowV2_project_id'])){return this[_0xf1c2('0xf')]['noop']('no\x20project_id\x20configured');}if(!this[_0xf1c2('0x82')](_0xb26e3f[_0xf1c2('0x79')])){return this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0xf1c2('0xf0'));}if(!this[_0xf1c2('0x82')](_0xb26e3f[_0xf1c2('0x7a')])){return this[_0xf1c2('0xf')][_0xf1c2('0xae')]('no\x20private_key\x20configured');}if(!this['isConfigured'](_0xb26e3f['dialogflowV2_language'])){return this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0xf1c2('0xf1'));}if(!this[_0xf1c2('0x82')](_0xb26e3f[_0xf1c2('0x59')])){return this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0xf1c2('0xa9'));}this['channel'][_0xf1c2('0xe9')]=!![];this[_0xf1c2('0x36')](_0xb26e3f);this[_0xf1c2('0x40')](_0xb26e3f[_0xf1c2('0x59')],'in','','');this[_0xf1c2('0xf')]['noop'](util['format']('Trying\x20DialogflowV2:\x20%s',_0xb26e3f['text']));var _0x3d1c4e=this['googleDialogflowV2'][_0xf1c2('0x6d')](this,_0xb26e3f);if(_0x3d1c4e){for(var _0x328f5f in _0x3d1c4e){if(_0x3d1c4e[_0xf1c2('0x99')](_0x328f5f)){if(_0x328f5f!==_0xf1c2('0xf2')){this[_0xf1c2('0xf')][_0xf1c2('0x9f')](util['format'](_0xf1c2('0xea'),_0x328f5f['toUpperCase']()),_0x3d1c4e[_0x328f5f]);}}}this[_0xf1c2('0x40')](_0x3d1c4e[_0xf1c2('0xeb')],_0xf1c2('0xec'),'dialogflowV2',_0x3d1c4e[_0xf1c2('0xf2')]);return this[_0xf1c2('0xf')][_0xf1c2('0xae')](util['format'](_0xf1c2('0xf3'),_0x3d1c4e['speech']));}return this['channel'][_0xf1c2('0x2c')](_0xb26e3f,_0xf1c2('0xf4'));};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0xf5')]=function(_0x122c9a){logger['info'](util['format'](_0xf1c2('0xf6'),_0x122c9a[_0xf1c2('0x38')]));if(!this[_0xf1c2('0x82')](_0x122c9a[_0xf1c2('0xf7')])){return this[_0xf1c2('0xf')]['noop'](_0xf1c2('0xf8'));}if(!this[_0xf1c2('0x82')](_0x122c9a[_0xf1c2('0xf9')])){return this[_0xf1c2('0xf')][_0xf1c2('0xae')]('no\x20username\x20configured');}if(!this[_0xf1c2('0x82')](_0x122c9a['password'])){return this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0xf1c2('0xfa'));}if(!this[_0xf1c2('0x82')](_0x122c9a[_0xf1c2('0xfb')])){return this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0xf1c2('0xa9'));}this[_0xf1c2('0xf')]['bot']=!![];this[_0xf1c2('0x36')](_0x122c9a);this[_0xf1c2('0x40')](_0x122c9a[_0xf1c2('0x59')],'in','','');this[_0xf1c2('0xf')]['noop'](util[_0xf1c2('0x29')]('Trying\x20SestekNDA:\x20%s',_0x122c9a[_0xf1c2('0x59')]));var _0x41df8b=this[_0xf1c2('0x7c')][_0xf1c2('0x6d')](this,_0x122c9a);if(_0x41df8b){for(var _0x5a7a20 in _0x41df8b){if(_0x41df8b[_0xf1c2('0x99')](_0x5a7a20)){this[_0xf1c2('0xf')]['setVariable'](util[_0xf1c2('0x29')](_0xf1c2('0xfc'),_0x5a7a20[_0xf1c2('0x67')]()),_0x41df8b[_0x5a7a20]);}}this[_0xf1c2('0x40')](_0x41df8b[_0xf1c2('0xeb')],_0xf1c2('0xec'),_0xf1c2('0xf5'),'');if(_0x41df8b[_0xf1c2('0xfd')]){this[_0xf1c2('0xf')]['noop'](util['format'](_0xf1c2('0xfe'),_0x41df8b[_0xf1c2('0xfd')]));var _0x3b7b62=this[_0xf1c2('0xf')][_0xf1c2('0xff')](_0x41df8b[_0xf1c2('0xfd')]);try{fs[_0xf1c2('0x100')](_0x41df8b[_0xf1c2('0xfd')]+'.wav');}catch(_0x129907){logger[_0xf1c2('0x2c')](_0x129907);}return _0x3b7b62;}else{return this[_0xf1c2('0xf')][_0xf1c2('0xae')](util[_0xf1c2('0x29')](_0xf1c2('0x101'),_0x41df8b[_0xf1c2('0xeb')]));}}return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0x122c9a,_0xf1c2('0x102'));};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x103')]=function(_0x39a858){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')]('Enter\x20in\x20END\x20(%s)\x20block',_0x39a858[_0xf1c2('0x38')]));return this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0xf1c2('0x103'));};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x104')]=function(_0x455739){logger[_0xf1c2('0x2e')](util['format'](_0xf1c2('0x105'),_0x455739[_0xf1c2('0x38')]));var _0x2226c3='';if(_0x455739[_0xf1c2('0x106')]){if(!this['isConfigured'](_0x455739['trunk_id'])){return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0x455739,_0xf1c2('0x107'));}else{var _0x381486=parseInt(_0x455739[_0xf1c2('0x106')],0xa);if(isNaN(_0x381486)){_0x2226c3=_0x455739['trunk_id'];}else{_0x2226c3=this[_0xf1c2('0x1e')]['sync'](this,_0x455739['trunk_id']);if(!_0x2226c3){return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0x455739,'no\x20trunk\x20found');}}}}else if(_0x455739[_0xf1c2('0x108')]){_0x2226c3=_0x455739[_0xf1c2('0x108')];}else{return this[_0xf1c2('0xf')]['error'](_0x455739,_0xf1c2('0x107'));}var _0xdf6efd=this['channel'][_0xf1c2('0x56')](_0xf1c2('0xe3'),[util[_0xf1c2('0x29')]('SIP/%s/%s',_0x2226c3,_0x455739[_0xf1c2('0x109')]),_0x455739['timeout'],_0x455739[_0xf1c2('0xe4')],_0x455739[_0xf1c2('0x61')]]);if(_0xdf6efd[_0xf1c2('0xa2')]===-0x1){return _0xdf6efd;}return this[_0xf1c2('0xf')]['noop'](util['format'](_0xf1c2('0xe5'),_0xf1c2('0xe3')));};AGIVertices['prototype'][_0xf1c2('0x10a')]=function(_0x5c63b3){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0x10b'),_0x5c63b3[_0xf1c2('0x38')]));return this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0xf1c2('0x10a'));};AGIVertices[_0xf1c2('0x12')]['getdigits']=function(_0x250f93){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0x10c'),_0x250f93[_0xf1c2('0x38')]));if(_0x250f93[_0xf1c2('0xa6')]===0x0){return this[_0xf1c2('0xa5')](_0x250f93);}_0x250f93[_0xf1c2('0xa6')]-=0x1;if(!this[_0xf1c2('0x82')](_0x250f93['file_id'])){return this[_0xf1c2('0xf')]['error'](_0x250f93,'no\x20file\x20audio\x20selected');}var _0x5df493=this[_0xf1c2('0x1f')][_0xf1c2('0x6d')](this,_0x250f93[_0xf1c2('0x10d')]);if(!_0x5df493){return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0x250f93,_0xf1c2('0x10e'));}if(!this[_0xf1c2('0x82')](_0x250f93[_0xf1c2('0xd7')])){return this[_0xf1c2('0xf')]['error'](_0xf1c2('0xd8'));}var _0x502d27=this[_0xf1c2('0xf')]['getData'](_0x5df493,_0x250f93[_0xf1c2('0x10f')],_0x250f93[_0xf1c2('0x110')]);var _0x17cb05=_0x502d27['result']?_0x502d27['result'][_0xf1c2('0x49')]():'';logger[_0xf1c2('0x2e')]('test',JSON[_0xf1c2('0x6f')](_0x502d27));if(_0x502d27[_0xf1c2('0xa2')]===-0x1){this[_0xf1c2('0x36')][_0xf1c2('0x6d')](this,_0x250f93,_0x17cb05);return _0x502d27;}else if(_0x502d27[_0xf1c2('0xa4')]===_0xf1c2('0x63')){_0x502d27[_0xf1c2('0xa2')]=_0x17cb05[_0xf1c2('0x9c')]>=parseInt(_0x250f93[_0xf1c2('0x111')])?'x':'i';}else{_0x502d27[_0xf1c2('0xa2')]=_0x17cb05[_0xf1c2('0x9c')]>=parseInt(_0x250f93['mindigit'])&&_0x17cb05[_0xf1c2('0x9c')]<=parseInt(_0x250f93[_0xf1c2('0x110')])?'x':'i';}var _0x50347e=this[_0xf1c2('0x13')][_0xf1c2('0x6d')](this,_0x250f93[_0xf1c2('0xd7')]);if(!_0x50347e){return this['channel'][_0xf1c2('0x2c')](_0x250f93,_0xf1c2('0xd9'));}this[_0xf1c2('0xf')]['setVariable'](_0x50347e,_0x17cb05);if(this['isConfigured'](_0x250f93['hiddendigitsnum'])){var _0x55f9cb=parseInt(_0x250f93['hiddendigitsnum'],0xa);var _0x4e4297=rs[_0xf1c2('0x112')]({'charset':'*','length':_0x55f9cb});var _0x53dc0b=_0x17cb05[_0xf1c2('0x9c')];if(_0x53dc0b>0x0){if(_0x53dc0b>_0x55f9cb){this['createSquareDetailsReport'][_0xf1c2('0x6d')](this,_0x250f93,_0x250f93[_0xf1c2('0x113')]===_0xf1c2('0x114')?_0x4e4297+_0x17cb05[_0xf1c2('0x115')](_0x55f9cb):_0x17cb05[_0xf1c2('0x115')](0x0,_0x53dc0b-_0x55f9cb)+_0x4e4297);}else{this[_0xf1c2('0x36')][_0xf1c2('0x6d')](this,_0x250f93,rs['generate']({'charset':'*','length':_0x53dc0b}));}}else{this[_0xf1c2('0x36')][_0xf1c2('0x6d')](this,_0x250f93,'');}}else{this[_0xf1c2('0x36')]['sync'](this,_0x250f93,_0x17cb05);}return _0x502d27;};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0xe')]=function(_0x2b7002){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0x116'),_0x2b7002[_0xf1c2('0x38')]));return this[_0xf1c2('0x117')](_0x2b7002);};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x118')]=function(_0x3ed02d){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0x119'),_0x3ed02d[_0xf1c2('0x38')]));this['createSquareDetailsReport'][_0xf1c2('0x6d')](this,_0x3ed02d,_0x3ed02d[_0xf1c2('0x11a')]);return this[_0xf1c2('0xf')][_0xf1c2('0xae')](util[_0xf1c2('0x29')](_0xf1c2('0x11b'),_0x3ed02d[_0xf1c2('0x11a')]));};AGIVertices[_0xf1c2('0x12')]['awspolly']=function(_0x48d714){logger[_0xf1c2('0x2e')](util['format']('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x48d714['label']));if(!this[_0xf1c2('0x82')](_0x48d714[_0xf1c2('0x85')])||!this['isConfigured'](_0x48d714[_0xf1c2('0x86')])){return this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0xf1c2('0x11c'));}if(!this[_0xf1c2('0x82')](_0x48d714[_0xf1c2('0x59')])){return this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0xf1c2('0xa9'));}this['channel'][_0xf1c2('0xae')](util[_0xf1c2('0x29')]('Trying\x20aws\x20Polly\x20%s',_0x48d714[_0xf1c2('0x59')]));var _0x1123ec=this[_0xf1c2('0x84')][_0xf1c2('0x6d')](this,_0x48d714);if(_0x1123ec){this[_0xf1c2('0xf')][_0xf1c2('0xae')](util[_0xf1c2('0x29')](_0xf1c2('0x11d'),_0x1123ec));var _0x7bb884=this[_0xf1c2('0xf')][_0xf1c2('0xff')](_0x1123ec);try{fs['unlink'](_0x1123ec+_0xf1c2('0x11e'));}catch(_0x4d71c0){logger['error'](_0x4d71c0);}return _0x7bb884;}return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0x48d714,_0xf1c2('0x11f'));};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x120')]=function(_0x5caa7e){logger[_0xf1c2('0x2e')](util['format'](_0xf1c2('0x121'),_0x5caa7e[_0xf1c2('0x38')]));if(!this[_0xf1c2('0x82')](_0x5caa7e['aws_access_key_id'])||!this['isConfigured'](_0x5caa7e[_0xf1c2('0x86')])){return this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0xf1c2('0x11c'));}if(!this[_0xf1c2('0x82')](_0x5caa7e[_0xf1c2('0x8b')])){return this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0xf1c2('0x122'));}if(!this['isConfigured'](_0x5caa7e[_0xf1c2('0x59')])){return this[_0xf1c2('0xf')]['noop'](_0xf1c2('0xa9'));}this['channel']['bot']=!![];this[_0xf1c2('0x36')](_0x5caa7e);this[_0xf1c2('0x40')](_0x5caa7e[_0xf1c2('0x59')],'in','','');this[_0xf1c2('0xf')][_0xf1c2('0xae')](util[_0xf1c2('0x29')](_0xf1c2('0x123'),_0x5caa7e['text']));var _0x30f20a=this[_0xf1c2('0x89')]['sync'](this,_0x5caa7e);if(_0x30f20a){for(var _0xa3ecb0 in _0x30f20a){if(_0x30f20a['hasOwnProperty'](_0xa3ecb0)&&_[_0xf1c2('0x95')](_0x30f20a[_0xa3ecb0])){this[_0xf1c2('0xf')]['setVariable'](util['format']('AWS_LEX_%s',_0xa3ecb0[_0xf1c2('0x67')]()),_0x30f20a[_0xa3ecb0]);}}if(_['isNil'](_0x30f20a[_0xf1c2('0x71')])){return this['channel'][_0xf1c2('0xae')](_0xf1c2('0x124'));}else{this[_0xf1c2('0x40')](_0x30f20a[_0xf1c2('0x71')],_0xf1c2('0xec'),_0xf1c2('0x125'),'');return this[_0xf1c2('0xf')][_0xf1c2('0xae')](util[_0xf1c2('0x29')](_0xf1c2('0x126'),_0x30f20a['message']));}}return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0x5caa7e,_0xf1c2('0x127'));};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x128')]=function(_0x4854b0){logger['info'](util[_0xf1c2('0x29')](_0xf1c2('0x129'),_0x4854b0[_0xf1c2('0x38')],_0x4854b0['timeout']));if(!this[_0xf1c2('0x82')](_0x4854b0['key'])){return this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0xf1c2('0xe8'));}var _0x1cdaf5=_0xf1c2('0x12a');var _0x59c0ef=util[_0xf1c2('0x29')]('%s/recordings/%s',FILES_PATH,rs[_0xf1c2('0x112')](0x4));var _0xa05fc3=util['format']('%s.%s',_0x59c0ef,_0x1cdaf5);var _0x382432=!![];if(_0x4854b0[_0xf1c2('0x12b')]===_0xf1c2('0x12c')){_0x382432=![];}var _0x376197=this[_0xf1c2('0xf')][_0xf1c2('0x12d')](_0x59c0ef,_0x1cdaf5,_0x4854b0['intKey'],_0x4854b0['timeout'],undefined,_0x382432);if(_0x376197[_0xf1c2('0xa2')]!==-0x1){this[_0xf1c2('0xf')][_0xf1c2('0xae')](util[_0xf1c2('0x29')](_0xf1c2('0x12e'),_0xa05fc3));var _0x1d4315=this[_0xf1c2('0x8c')][_0xf1c2('0x6d')](this,_0x4854b0,_0xa05fc3);if(_0x1d4315){for(var _0x26ac98 in _0x1d4315){if(_0x1d4315[_0xf1c2('0x99')](_0x26ac98)){this[_0xf1c2('0xf')]['setVariable'](util[_0xf1c2('0x29')](_0xf1c2('0x12f'),_0x26ac98['toUpperCase']()),_0x1d4315[_0x26ac98]);}}return this[_0xf1c2('0xf')][_0xf1c2('0xae')](util['format']('GoogleASR\x20Result\x20%s',JSON[_0xf1c2('0x6f')](_0x1d4315)));}}return _0x376197;};AGIVertices['prototype']['tildeasr']=function(_0x1643b0){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0x130'),_0x1643b0[_0xf1c2('0x38')]));if(!this['isConfigured'](_0x1643b0[_0xf1c2('0x8f')])){return this[_0xf1c2('0xf')]['noop']('no\x20appid\x20configured');}if(!this[_0xf1c2('0x82')](_0x1643b0[_0xf1c2('0x90')])){return this['channel'][_0xf1c2('0xae')](_0xf1c2('0x131'));}var _0x3e35d6=_0xf1c2('0x12a');var _0x7086c6=util['format'](_0xf1c2('0x132'),FILES_PATH,rs['generate'](0x4));var _0x5affde=util[_0xf1c2('0x29')](_0xf1c2('0x9d'),_0x7086c6,_0x3e35d6);var _0x56f695=!![];if(_0x1643b0[_0xf1c2('0x12b')]==='NOBEEP'){_0x56f695=![];}var _0xc70a04=this[_0xf1c2('0xf')][_0xf1c2('0x12d')](_0x7086c6,_0x3e35d6,_0x1643b0['intKey'],_0x1643b0[_0xf1c2('0x63')],undefined,_0x56f695);if(_0xc70a04[_0xf1c2('0xa2')]!==-0x1){this[_0xf1c2('0xf')][_0xf1c2('0xae')](util[_0xf1c2('0x29')](_0xf1c2('0x133'),_0x5affde));var _0x4e9876=this[_0xf1c2('0x8e')][_0xf1c2('0x6d')](this,_0x1643b0,_0x5affde);if(_0x4e9876){for(var _0x200cf2 in _0x4e9876){if(_0x4e9876[_0xf1c2('0x99')](_0x200cf2)){this['channel'][_0xf1c2('0x9f')](util['format'](_0xf1c2('0x134'),_0x200cf2[_0xf1c2('0x67')]()),_0x4e9876[_0x200cf2]);}}return this[_0xf1c2('0xf')]['noop'](util[_0xf1c2('0x29')](_0xf1c2('0x135'),JSON[_0xf1c2('0x6f')](_0x4e9876)));}}return _0xc70a04;};AGIVertices['prototype'][_0xf1c2('0x136')]=function(_0xdd3f8d){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0x137'),_0xdd3f8d[_0xf1c2('0x38')]));return this['channel'][_0xf1c2('0x138')](_0xdd3f8d[_0xf1c2('0x3d')],_0xdd3f8d[_0xf1c2('0x139')],_0xdd3f8d[_0xf1c2('0x3e')]);};AGIVertices['prototype'][_0xf1c2('0x13a')]=function(_0x3a0eb5){logger['info'](util[_0xf1c2('0x29')](_0xf1c2('0x13b'),_0x3a0eb5[_0xf1c2('0x38')]));if(!this['isConfigured'](_0x3a0eb5[_0xf1c2('0x13c')])){return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0x3a0eb5,_0xf1c2('0x13d'));}try{var _0x4788d5=eval(_0x3a0eb5[_0xf1c2('0x13c')])?'true':_0xf1c2('0x13e');this['channel'][_0xf1c2('0xae')](util[_0xf1c2('0x29')](_0xf1c2('0x13f'),_0x3a0eb5['condition'],_0x4788d5));return{'code':0xc8,'result':_0x4788d5};}catch(_0x410085){return{'code':0xc8,'result':_0xf1c2('0x13e')};}};AGIVertices['prototype'][_0xf1c2('0x140')]=function(_0x3066bb){logger[_0xf1c2('0x2e')](util['format'](_0xf1c2('0x141'),_0x3066bb[_0xf1c2('0x38')]));if(!this[_0xf1c2('0x82')](_0x3066bb[_0xf1c2('0x142')])){return this['channel'][_0xf1c2('0x2c')](_0x3066bb,_0xf1c2('0x143'));}var _0x26868e=this[_0xf1c2('0x26')][_0xf1c2('0x6d')](this,_0x3066bb['interval_id']);if(!_0x26868e){return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0x3066bb,_0xf1c2('0x144'));}for(var _0x3c187d=0x0;_0x3c187d<_0x26868e['length'];_0x3c187d+=0x1){var _0x5d873b=this[_0xf1c2('0xf')]['getVariable'](util[_0xf1c2('0x29')](_0xf1c2('0x145'),_0x26868e[_0x3c187d]));if(_0x5d873b[_0xf1c2('0xa2')]===-0x1){return _0x5d873b;}logger['info'](util['format'](_0xf1c2('0x146'),_0x26868e[_0x3c187d],_0x5d873b['extra']));if(_0x5d873b[_0xf1c2('0xa4')]===_0xf1c2('0x147')){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0x146'),_0x26868e[_0x3c187d],'true'));this[_0xf1c2('0xf')][_0xf1c2('0xae')](util[_0xf1c2('0x29')](_0xf1c2('0x146'),_0x26868e[_0x3c187d],_0xf1c2('0x147')));return{'code':0xc8,'result':_0xf1c2('0x147')};}else{logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0x146'),_0x26868e[_0x3c187d],_0xf1c2('0x13e')));this[_0xf1c2('0xf')][_0xf1c2('0xae')](util[_0xf1c2('0x29')]('IFTIME\x20%s\x20%s',_0x26868e[_0x3c187d],'false'));}}return{'code':0xc8,'result':_0xf1c2('0x13e')};};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x148')]=function(_0x462bfb){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0x149'),_0x462bfb[_0xf1c2('0x38')]));return this['channel']['hangup']();};AGIVertices[_0xf1c2('0x12')]['ispeechasr']=function(_0x12223f){logger['info'](util[_0xf1c2('0x29')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x12223f['label']));if(!this[_0xf1c2('0x82')](_0x12223f['key'])){return this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0xf1c2('0xe8'));}var _0x25246b=_0xf1c2('0x12a');var _0x25f5de=util[_0xf1c2('0x29')](_0xf1c2('0x132'),FILES_PATH,rs[_0xf1c2('0x112')](0x4));var _0x4e0c06=util['format']('%s.%s',_0x25f5de,_0x25246b);var _0x405146=!![];if(_0x12223f['beep']===_0xf1c2('0x12c')){_0x405146=![];}var _0x4eb9b5=this[_0xf1c2('0xf')]['recordFile'](_0x25f5de,_0x25246b,_0x12223f[_0xf1c2('0x14a')],_0x12223f['timeout'],undefined,_0x405146);if(_0x4eb9b5['result']!==-0x1){this[_0xf1c2('0xf')][_0xf1c2('0xae')](util['format'](_0xf1c2('0x14b'),_0x4e0c06));var _0x362785=this[_0xf1c2('0x80')][_0xf1c2('0x6d')](this,_0x12223f,_0x4e0c06);if(_0x362785){for(var _0xf4c808 in _0x362785){if(_0x362785[_0xf1c2('0x99')](_0xf4c808)){this[_0xf1c2('0xf')][_0xf1c2('0x9f')](util[_0xf1c2('0x29')](_0xf1c2('0x14c'),_0xf4c808[_0xf1c2('0x67')]()),_0x362785[_0xf4c808]);}}return this['channel'][_0xf1c2('0xae')](util['format']('IspeechASR\x20Result\x20%s',JSON[_0xf1c2('0x6f')](_0x362785)));}}return _0x4eb9b5;};AGIVertices[_0xf1c2('0x12')]['ispeechtts']=function(_0x5c5eae){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0x14d'),_0x5c5eae[_0xf1c2('0x38')]));if(!this[_0xf1c2('0x82')](_0x5c5eae[_0xf1c2('0x75')])){return this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0xf1c2('0xe8'));}if(!this[_0xf1c2('0x82')](_0x5c5eae['text'])){return this[_0xf1c2('0xf')][_0xf1c2('0xae')]('no\x20text\x20configured');}this[_0xf1c2('0xf')]['noop'](util[_0xf1c2('0x29')](_0xf1c2('0x14e'),_0x5c5eae[_0xf1c2('0x59')]));var _0x527f88=this[_0xf1c2('0x7d')][_0xf1c2('0x6d')](this,_0x5c5eae);if(_0x527f88){this[_0xf1c2('0xf')][_0xf1c2('0xae')](util['format'](_0xf1c2('0x14b'),_0x527f88));var _0x13bf25=this[_0xf1c2('0xf')][_0xf1c2('0xff')](_0x527f88,_0x5c5eae[_0xf1c2('0x14a')]);try{fs[_0xf1c2('0x100')](_0x527f88+_0xf1c2('0x11e'));}catch(_0xd9b917){logger[_0xf1c2('0x2c')](_0xd9b917);}return _0x13bf25;}return this['channel'][_0xf1c2('0x2c')](_0x5c5eae,_0xf1c2('0x14f'));};AGIVertices['prototype'][_0xf1c2('0x150')]=function(_0x2d1910){logger['info'](util[_0xf1c2('0x29')](_0xf1c2('0x151'),_0x2d1910[_0xf1c2('0x38')]));if(!this[_0xf1c2('0x82')](_0x2d1910[_0xf1c2('0x152')])){return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0x2d1910,'no\x20find\x20by\x20configured');}logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xf1c2('0xf')][_0xf1c2('0x3a')],_0x2d1910['findBy']));var _0x3b4225=this[_0xf1c2('0x51')]['sync'](this,_0x2d1910[_0xf1c2('0x152')]);if(_0x3b4225){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0x153'),this[_0xf1c2('0xf')][_0xf1c2('0x3a')],_0x2d1910['findBy']));this[_0xf1c2('0xf')][_0xf1c2('0xae')](util[_0xf1c2('0x29')](_0xf1c2('0x153'),this[_0xf1c2('0xf')][_0xf1c2('0x3a')],_0x2d1910['findBy']));return{'code':0xc8,'result':_0xf1c2('0x154')};}else{logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0x155'),this[_0xf1c2('0xf')][_0xf1c2('0x3a')],_0x2d1910['findBy']));this[_0xf1c2('0xf')][_0xf1c2('0xae')](util[_0xf1c2('0x29')](_0xf1c2('0x155'),this[_0xf1c2('0xf')]['callerid'],_0x2d1910[_0xf1c2('0x152')]));return{'code':0xc8,'result':_0xf1c2('0x156')};}};AGIVertices['prototype'][_0xf1c2('0x157')]=function(_0x50b530){logger[_0xf1c2('0x2e')](util['format'](_0xf1c2('0x158'),_0x50b530['label']));if(!this['isConfigured'](_0x50b530[_0xf1c2('0x152')])){return this['channel']['error'](_0x50b530,_0xf1c2('0x159'));}logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0x15a'),this[_0xf1c2('0xf')][_0xf1c2('0x3a')],_0x50b530[_0xf1c2('0x152')]));var _0x1d5344=this[_0xf1c2('0x50')]['sync'](this,_0x50b530[_0xf1c2('0x152')]);if(_0x1d5344){logger['info'](util['format'](_0xf1c2('0x153'),this[_0xf1c2('0xf')][_0xf1c2('0x3a')],_0x50b530[_0xf1c2('0x152')]));this['channel'][_0xf1c2('0xae')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xf1c2('0x3a')],_0x50b530[_0xf1c2('0x152')]));return{'code':0xc8,'result':_0xf1c2('0x154')};}else{logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0x155'),this[_0xf1c2('0xf')][_0xf1c2('0x3a')],_0x50b530[_0xf1c2('0x152')]));this['channel'][_0xf1c2('0xae')](util[_0xf1c2('0x29')](_0xf1c2('0x155'),this[_0xf1c2('0xf')][_0xf1c2('0x3a')],_0x50b530[_0xf1c2('0x152')]));return{'code':0xc8,'result':_0xf1c2('0x156')};}};AGIVertices['prototype'][_0xf1c2('0x15b')]=function(_0x27ce99){logger[_0xf1c2('0x2e')](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x27ce99[_0xf1c2('0x38')]));if(!this[_0xf1c2('0x82')](_0x27ce99['operation'])){return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0x27ce99,_0xf1c2('0x15c'));}this['channel'][_0xf1c2('0xae')](util[_0xf1c2('0x29')](_0xf1c2('0x15d'),_0x27ce99[_0xf1c2('0x15e')]));var _0x5dad5f=eval(_0x27ce99[_0xf1c2('0x15e')]);if(!this[_0xf1c2('0x82')](_0x27ce99[_0xf1c2('0xd7')])){return this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0xf1c2('0xd8'));}var _0x5bdb89=this['getVariable']['sync'](this,_0x27ce99[_0xf1c2('0xd7')]);if(!_0x5bdb89){return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0x27ce99,_0xf1c2('0xd9'));}if(_[_0xf1c2('0x9b')](_0x5dad5f)){var _0x1b08fb=this;_0x5dad5f[_0xf1c2('0xda')](function(_0x12afac,_0x652ecc){_0x1b08fb[_0xf1c2('0xf')][_0xf1c2('0x9f')](util[_0xf1c2('0x29')](_0xf1c2('0x15f'),_0x5bdb89,_0x652ecc),_0x12afac);});return this[_0xf1c2('0xf')]['noop'](util['format'](_0xf1c2('0x160'),_0x5bdb89));}else{return this['channel'][_0xf1c2('0x9f')](_0x5bdb89,_0x5dad5f);}};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0xd')]=function(_0x52e903){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x52e903[_0xf1c2('0x38')]));if(_0x52e903['retry']===0x0){return this[_0xf1c2('0xa5')](_0x52e903);}_0x52e903[_0xf1c2('0xa6')]-=0x1;if(!this['isConfigured'](_0x52e903[_0xf1c2('0x10d')])){return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0x52e903,_0xf1c2('0x161'));}var _0x36ea46=this[_0xf1c2('0x1f')][_0xf1c2('0x6d')](this,_0x52e903[_0xf1c2('0x10d')]);if(!_0x36ea46){return this['channel'][_0xf1c2('0x2c')](_0x52e903,_0xf1c2('0x10e'));}var _0x53028b=this[_0xf1c2('0xf')][_0xf1c2('0x162')](_0x36ea46,_0x52e903[_0xf1c2('0x10f')],_0x52e903[_0xf1c2('0x163')]);var _0x2fa577=_0x53028b['result'];if(_0x53028b[_0xf1c2('0xa2')]===-0x1){this[_0xf1c2('0x36')]['sync'](this,_0x52e903,'-1');return _0x53028b;}else if(_0x53028b['extra']==='timeout'){_0x53028b['result']=_0x53028b[_0xf1c2('0xa2')][_0xf1c2('0x9c')]>0x0?_0x53028b[_0xf1c2('0xa2')]:'t';}else if(_[_0xf1c2('0x42')](_0x53028b[_0xf1c2('0xa2')])){_0x53028b[_0xf1c2('0xa2')]='#';_0x2fa577='#';}if(!this[_0xf1c2('0x82')](_0x52e903[_0xf1c2('0xd7')])){this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0xf1c2('0xd8'));}else{var _0x1faadc=this[_0xf1c2('0x13')]['sync'](this,_0x52e903[_0xf1c2('0xd7')]);if(!_0x1faadc){return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0x52e903,_0xf1c2('0xd9'));}this[_0xf1c2('0xf')]['setVariable'](_0x1faadc,_0x2fa577);}this['createSquareDetailsReport']['sync'](this,_0x52e903,_0x2fa577);return _0x53028b;};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0xae')]=function(_0x1ced5a){logger['info'](util[_0xf1c2('0x29')](_0xf1c2('0x164'),_0x1ced5a[_0xf1c2('0x38')]));return this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0x1ced5a[_0xf1c2('0x165')]||_0x1ced5a[_0xf1c2('0x38')]);};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x166')]=function(_0x4ecbd1){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0x167'),_0x4ecbd1['label']));if(!this[_0xf1c2('0x82')](_0x4ecbd1[_0xf1c2('0x152')])){return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0x4ecbd1,_0xf1c2('0x159'));}logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0x15a'),this['channel']['callerid'],_0x4ecbd1[_0xf1c2('0x152')]));var _0x308567=this[_0xf1c2('0x168')][_0xf1c2('0x6d')](this,_0x4ecbd1[_0xf1c2('0x169')]);var _0x373f2e=this[_0xf1c2('0x4c')][_0xf1c2('0x6d')](this,_0x4ecbd1[_0xf1c2('0x152')],_0x308567);if(_0x373f2e){logger['info'](util[_0xf1c2('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xf1c2('0xf')][_0xf1c2('0x3a')],_0x4ecbd1['findBy']));this['channel'][_0xf1c2('0xae')](util[_0xf1c2('0x29')](_0xf1c2('0x153'),this[_0xf1c2('0xf')]['callerid'],_0x4ecbd1['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xf1c2('0xf')][_0xf1c2('0x3a')],_0x4ecbd1[_0xf1c2('0x152')]));this[_0xf1c2('0xf')]['noop'](util[_0xf1c2('0x29')](_0xf1c2('0x153'),this[_0xf1c2('0xf')][_0xf1c2('0x3a')],_0x4ecbd1['findBy']));return{'code':0xc8,'result':_0xf1c2('0x156')};}};AGIVertices[_0xf1c2('0x12')]['playback']=function(_0x3486f5){logger['info'](util[_0xf1c2('0x29')](_0xf1c2('0x16a'),_0x3486f5[_0xf1c2('0x38')]));if(!this[_0xf1c2('0x82')](_0x3486f5[_0xf1c2('0x10d')])){return this['channel']['error'](_0x3486f5,_0xf1c2('0x161'));}var _0x38ac16=this['getSound'][_0xf1c2('0x6d')](this,_0x3486f5[_0xf1c2('0x10d')]);if(!_0x38ac16){return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0x3486f5,_0xf1c2('0x10e'));}var _0x2a370d=this['channel']['exec']('PLAYBACK',[_0x38ac16,_0x3486f5[_0xf1c2('0xe4')]]);if(_0x2a370d[_0xf1c2('0xa2')]===-0x1){return _0x2a370d;}return this[_0xf1c2('0xf')][_0xf1c2('0xae')](util[_0xf1c2('0x29')](_0xf1c2('0xc2'),_0xf1c2('0x16b'),_0x38ac16));};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x16c')]=function(_0x526e10){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0x16d'),_0x526e10[_0xf1c2('0x38')]));if(!this[_0xf1c2('0x82')](_0x526e10[_0xf1c2('0x16e')])){return this[_0xf1c2('0xf')]['error'](_0x526e10,_0xf1c2('0x16f'));}var _0x31006a='';var _0x46903f=parseInt(_0x526e10['queue_id'],0xa);if(isNaN(_0x46903f)){_0x31006a=_0x526e10[_0xf1c2('0x16e')];}else{_0x31006a=this[_0xf1c2('0x17')]['sync'](this,_0x526e10[_0xf1c2('0x16e')]);if(!_0x31006a){return this[_0xf1c2('0xf')]['error'](_0x526e10,_0xf1c2('0x170'));}}var _0x2649e2='';if(this[_0xf1c2('0x82')](_0x526e10[_0xf1c2('0x10d')])){var _0x1f6c1e=this[_0xf1c2('0x1f')]['sync'](this,_0x526e10['file_id']);if(_0x1f6c1e){_0x2649e2=_0x1f6c1e;}}this['createSquareDetailsReport'][_0xf1c2('0x6d')](this,_0x526e10,_0x31006a);if(_0x526e10['opts'][_0xf1c2('0x171')]('x')<0x0){_0x526e10[_0xf1c2('0xe4')]+='x';}if(_0x526e10['opts']['indexOf']('X')<0x0){_0x526e10[_0xf1c2('0xe4')]+='X';}this['channel'][_0xf1c2('0x9f')](_0xf1c2('0x172'),_0x31006a?_0x31006a['toLowerCase']():'');var _0x5b5eef=this[_0xf1c2('0xf')][_0xf1c2('0x56')](_0xf1c2('0x173'),[_0x31006a,_0x526e10[_0xf1c2('0xe4')],_0x526e10[_0xf1c2('0x61')],_0x2649e2,_0x526e10['timeout'],_0x526e10['agi'],_0x526e10['macro'],_0x526e10[_0xf1c2('0x174')],'',_0x526e10[_0xf1c2('0x175')]]);if(_0x5b5eef[_0xf1c2('0xa2')]===-0x1){return _0x5b5eef;}return this['channel'][_0xf1c2('0xae')](util[_0xf1c2('0x29')](_0xf1c2('0xc2'),_0xf1c2('0x173'),_0x31006a));};AGIVertices[_0xf1c2('0x12')]['record']=function(_0x35f003){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0x176'),_0x35f003[_0xf1c2('0x38')]));var _0xd634d1=_0x35f003[_0xf1c2('0x177')]||_0xf1c2('0x12a');var _0x3254c5=util['format'](_0xf1c2('0x178'),this[_0xf1c2('0xf')][_0xf1c2('0x37')],rs[_0xf1c2('0x112')](0x5));var _0x3bc8cb=util['format']('%s/recordings/%s.%s',FILES_PATH,_0x3254c5,_0xd634d1);var _0xda1c8b=util[_0xf1c2('0x29')](_0xf1c2('0x132'),FILES_PATH,_0x3254c5);this[_0xf1c2('0x3b')][_0xf1c2('0x6d')](this,_0x35f003,_0x3254c5,_0x3bc8cb);this['channel'][_0xf1c2('0x9f')](_0xf1c2('0x179'),_0x3254c5);logger[_0xf1c2('0x2e')](_0xf1c2('0x17a'),_0xda1c8b,_0xd634d1,_0x35f003[_0xf1c2('0x17b')],_0x35f003[_0xf1c2('0x63')]);return this[_0xf1c2('0xf')][_0xf1c2('0x12d')](_0xda1c8b,_0xd634d1,_0x35f003[_0xf1c2('0x17b')],_0x35f003[_0xf1c2('0x63')],undefined,!![]);};AGIVertices[_0xf1c2('0x12')]['restapi']=function(_0x5bcba9){logger['info'](util[_0xf1c2('0x29')](_0xf1c2('0x17c'),_0x5bcba9[_0xf1c2('0x38')]));if(!this[_0xf1c2('0x82')](_0x5bcba9[_0xf1c2('0x61')])){return this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0xf1c2('0x17d'));}var _0x1d238c=this[_0xf1c2('0x60')][_0xf1c2('0x6d')](this,_0x5bcba9);logger['info'](util[_0xf1c2('0x29')]('Response:',util[_0xf1c2('0x17e')](_0x1d238c,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x5bcba9[_0xf1c2('0xd7')])){return this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0xf1c2('0x17f'));}var _0x42eca9=this[_0xf1c2('0x13')]['sync'](this,_0x5bcba9['variable_id']);if(!_0x42eca9){return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0x5bcba9,_0xf1c2('0xd9'));}this[_0xf1c2('0xf')][_0xf1c2('0x9f')](util[_0xf1c2('0x29')](_0xf1c2('0x180'),_0x42eca9),_0x1d238c['statusCode']?_0x1d238c[_0xf1c2('0x70')]:'200');this[_0xf1c2('0xf')][_0xf1c2('0x9f')](util['format'](_0xf1c2('0x181'),_0x42eca9),_0x1d238c['statusMessage']?_0x1d238c[_0xf1c2('0x182')]:'OK');if(_0x1d238c[_0xf1c2('0x68')]){try{this[_0xf1c2('0x9e')](_0x1d238c['body'],_0x42eca9);}catch(_0x7489){logger[_0xf1c2('0x2c')](util[_0xf1c2('0x29')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x42eca9));}}return this[_0xf1c2('0xf')]['noop'](util[_0xf1c2('0x29')]('variable\x20%s\x20set',_0x42eca9));};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x183')]=function(_0x5e5633){logger['info'](util[_0xf1c2('0x29')](_0xf1c2('0x184'),_0x5e5633[_0xf1c2('0x38')]));return this[_0xf1c2('0xf')]['sayDigits'](_0x5e5633[_0xf1c2('0x185')][_0xf1c2('0xd5')](/\s+/g,''),_0x5e5633['escape_digits']);};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x186')]=function(_0x5d6f2b){logger['info'](util[_0xf1c2('0x29')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x5d6f2b['label']));return this[_0xf1c2('0xf')]['sayNumber'](_0x5d6f2b[_0xf1c2('0x64')][_0xf1c2('0xd5')](/\s+/g,''),_0x5d6f2b[_0xf1c2('0x17b')]);};AGIVertices[_0xf1c2('0x12')]['sayphonetic']=function(_0x49f9e6){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0x187'),_0x49f9e6[_0xf1c2('0x38')]));return this[_0xf1c2('0xf')][_0xf1c2('0x188')](_0x49f9e6[_0xf1c2('0x59')],_0x49f9e6[_0xf1c2('0x17b')]);};AGIVertices[_0xf1c2('0x12')]['sendMail']=function(_0x15687d){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x15687d[_0xf1c2('0x38')]));if(!this[_0xf1c2('0x82')](_0x15687d[_0xf1c2('0x189')])){return this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0xf1c2('0x18a'));}var _0x3abe6a=this[_0xf1c2('0x23')]['sync'](this,_0x15687d[_0xf1c2('0x189')]);if(!_0x3abe6a||!_0x3abe6a['Smtp']){return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0x15687d,'no\x20mail\x20account\x20found');}var _0x307693={'from':util['format'](_0xf1c2('0x18b'),_0x3abe6a['name'],_0x3abe6a[_0xf1c2('0x18c')]||_0x3abe6a['Smtp'][_0xf1c2('0x18d')]),'to':_0x15687d['to']||'','cc':_0x15687d['cc']||'','bcc':_0x15687d[_0xf1c2('0x18e')]||'','subject':_0x15687d[_0xf1c2('0x18f')],'html':_0x15687d[_0xf1c2('0x59')],'text':_0x15687d[_0xf1c2('0x59')]};var _0x576446={'tls':{'rejectUnauthorized':![]}};if(_0x3abe6a[_0xf1c2('0x190')][_0xf1c2('0x191')]){_0x576446[_0xf1c2('0x191')]=_0x3abe6a['Smtp'][_0xf1c2('0x191')];}else{_0x576446[_0xf1c2('0x192')]=_0x3abe6a[_0xf1c2('0x190')]['host'];_0x576446[_0xf1c2('0x193')]=_0x3abe6a[_0xf1c2('0x190')]['port'];_0x576446[_0xf1c2('0x194')]=_0x3abe6a[_0xf1c2('0x190')][_0xf1c2('0x194')];}if(_0x3abe6a[_0xf1c2('0x190')][_0xf1c2('0x195')]){_0x576446[_0xf1c2('0x196')]={'user':_0x3abe6a[_0xf1c2('0x190')][_0xf1c2('0x18d')],'pass':_0x3abe6a[_0xf1c2('0x190')][_0xf1c2('0x197')]};}if(this[_0xf1c2('0x82')](_0x15687d['template_id'])){}logger['debug'](_0xf1c2('0x198'),JSON[_0xf1c2('0x6f')](_0x307693));this[_0xf1c2('0x36')][_0xf1c2('0x6d')](this,_0x15687d,_0x15687d[_0xf1c2('0x189')]);this[_0xf1c2('0xf')]['noop'](util['format'](_0xf1c2('0x199'),_0x3abe6a[_0xf1c2('0x15')]));this['sendMailMessage'][_0xf1c2('0x6d')](this,_0x576446,_0x307693);return this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0xf1c2('0x19a'));};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x19b')]=function(_0x5592bf){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0x19c'),_0x5592bf[_0xf1c2('0x38')]));return this['channel'][_0xf1c2('0xae')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype'][_0xf1c2('0x19d')]=function(_0x59be6d){logger['info'](util['format'](_0xf1c2('0x19e'),_0x59be6d[_0xf1c2('0x38')]));if(!this[_0xf1c2('0x82')](_0x59be6d[_0xf1c2('0x19f')])){return this[_0xf1c2('0xf')][_0xf1c2('0xae')]('no\x20sms\x20account\x20configured');}var _0x367cde=this[_0xf1c2('0x1a0')][_0xf1c2('0x6d')](this,_0x59be6d['sms_account_id']);if(!_0x367cde){return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0x59be6d,_0xf1c2('0x1a1'));}var _0x2a90f6={'body':_0x59be6d[_0xf1c2('0x1a2')],'phone':_0x59be6d['to']||'','SmsAccountId':_0x367cde['id']};logger[_0xf1c2('0xde')](_0xf1c2('0x1a3'),JSON[_0xf1c2('0x6f')](_0x2a90f6));this[_0xf1c2('0x36')][_0xf1c2('0x6d')](this,_0x59be6d,_0x59be6d[_0xf1c2('0x19f')]);this[_0xf1c2('0xf')][_0xf1c2('0xae')](util['format'](_0xf1c2('0x1a4'),_0x367cde[_0xf1c2('0x15')]));this[_0xf1c2('0x35')][_0xf1c2('0x6d')](this,_0x2a90f6);return this['channel'][_0xf1c2('0xae')](_0xf1c2('0x1a5'));};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x1a6')]=function(_0x177c23){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0x1a7'),_0x177c23['label']));if(!this[_0xf1c2('0x82')](_0x177c23[_0xf1c2('0xd7')])){return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0x177c23,'no\x20variable\x20selected');}var _0x250a38=this['getVariable'][_0xf1c2('0x6d')](this,_0x177c23[_0xf1c2('0xd7')]);if(!_0x250a38){return this[_0xf1c2('0xf')]['error'](_0x177c23,_0xf1c2('0xd9'));}return this['channel'][_0xf1c2('0x9f')](_0x250a38,_0x177c23[_0xf1c2('0x1a8')]);};AGIVertices['prototype'][_0xf1c2('0x1a9')]=function(_0x24c3df){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0x1aa'),_0x24c3df[_0xf1c2('0x38')]));this[_0xf1c2('0xf')]['noop'](_0xf1c2('0x1ab'));if(_0x24c3df[_0xf1c2('0x1ac')]===_0xf1c2('0x1ad')){this['channel'][_0xf1c2('0xae')](_0xf1c2('0x1ae'));return this[_0xf1c2('0xf')]['answer']();}return this[_0xf1c2('0xf')][_0xf1c2('0xae')]('Skipped\x20Answer');};AGIVertices['prototype'][_0xf1c2('0x1af')]=function(_0xc643f1){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0x1b0'),_0xc643f1[_0xf1c2('0x38')]));if(!this[_0xf1c2('0x82')](_0xc643f1[_0xf1c2('0x1b1')])){return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0xc643f1,_0xf1c2('0x1b2'));}var _0x71c75a=this[_0xf1c2('0x19')][_0xf1c2('0x6d')](this,_0xc643f1[_0xf1c2('0x1b1')]);if(!this[_0xf1c2('0x82')](_0x71c75a)){return this['channel'][_0xf1c2('0x2c')](_0xc643f1,util[_0xf1c2('0x29')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0xc643f1[_0xf1c2('0x1b1')]));}if(_0x71c75a===this[_0xf1c2('0xf')][_0xf1c2('0x1b3')]){return this['channel']['error'](_0xc643f1,_0xf1c2('0x1b4'));}this[_0xf1c2('0x36')]['sync'](this,_0xc643f1,_0x71c75a);var _0x60d04b=this[_0xf1c2('0xf')][_0xf1c2('0x56')](_0xf1c2('0x1b5'),util[_0xf1c2('0x29')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0xf1c2('0x9')][_0xf1c2('0x192')]||_0xf1c2('0x1b6'),_0x71c75a,this[_0xf1c2('0xf')]['arg_1']));if(_0x60d04b[_0xf1c2('0xa2')]===-0x1){return _0x60d04b;}return this[_0xf1c2('0xf')][_0xf1c2('0xae')](util[_0xf1c2('0x29')](_0xf1c2('0xc2'),_0xf1c2('0x1b5'),_0x71c75a));};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x1b7')]=function(_0x3846ff){logger[_0xf1c2('0x2e')](util['format'](_0xf1c2('0x1b8'),_0x3846ff[_0xf1c2('0x38')]));var _0x118bb2=this[_0xf1c2('0x55')][_0xf1c2('0x6d')](this,_0x3846ff['command']);this[_0xf1c2('0x36')][_0xf1c2('0x6d')](this,_0x3846ff,_0x3846ff[_0xf1c2('0x1b9')]);if(this['isConfigured'](_0x3846ff[_0xf1c2('0xd7')])){var _0x474aca=this['getVariable'][_0xf1c2('0x6d')](this,_0x3846ff[_0xf1c2('0xd7')]);if(_0x474aca){this['channel']['setVariable'](_0x474aca,_0x118bb2);return this[_0xf1c2('0xf')][_0xf1c2('0xae')](util[_0xf1c2('0x29')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x3846ff[_0xf1c2('0x1b9')],_0x474aca));}}return this['channel'][_0xf1c2('0xae')](util['format'](_0xf1c2('0x1ba'),_0x3846ff[_0xf1c2('0x1b9')]));};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x1bb')]=function(_0x4b116f){logger['info'](util[_0xf1c2('0x29')](_0xf1c2('0x1bc'),_0x4b116f[_0xf1c2('0x38')]));_0x4b116f['text']=_0x4b116f[_0xf1c2('0x59')][_0xf1c2('0xd5')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xf1c2('0x82')](_0x4b116f[_0xf1c2('0x58')])){return this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0xf1c2('0x1bd'));}if(!this[_0xf1c2('0x82')](_0x4b116f[_0xf1c2('0x59')])){return this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0xf1c2('0xa9'));}this[_0xf1c2('0xf')][_0xf1c2('0xae')](util[_0xf1c2('0x29')](_0xf1c2('0x1be'),_0x4b116f[_0xf1c2('0x59')]));var _0x3918fb=this[_0xf1c2('0x57')][_0xf1c2('0x6d')](this,_0x4b116f);if(_0x3918fb){this[_0xf1c2('0xf')][_0xf1c2('0xae')](util[_0xf1c2('0x29')](_0xf1c2('0x1bf'),_0x3918fb));var _0x52a306=this[_0xf1c2('0xf')]['streamFile'](_0x3918fb);try{fs[_0xf1c2('0x100')](_0x3918fb+'.wav');}catch(_0x91e4a7){logger[_0xf1c2('0x2c')](_0x91e4a7);}return _0x52a306;}return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0x4b116f,_0xf1c2('0x1c0'));};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x1c1')]=function(_0x4f9976){logger['info'](util['format'](_0xf1c2('0x1c2'),_0x4f9976[_0xf1c2('0x38')]));_0x4f9976[_0xf1c2('0x59')]=_0x4f9976['text'][_0xf1c2('0xd5')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xf1c2('0x82')](_0x4f9976[_0xf1c2('0x59')])){return this[_0xf1c2('0xf')][_0xf1c2('0xae')](_0xf1c2('0xa9'));}this[_0xf1c2('0xf')][_0xf1c2('0xae')](util[_0xf1c2('0x29')](_0xf1c2('0x1c3'),_0x4f9976[_0xf1c2('0x59')]));var _0x3910a1=this['googleTTS'][_0xf1c2('0x6d')](this,_0x4f9976);if(_0x3910a1){this[_0xf1c2('0xf')]['noop'](util['format'](_0xf1c2('0x1c4'),_0x3910a1));var _0x2fc531=this[_0xf1c2('0xf')][_0xf1c2('0xff')](_0x3910a1);try{fs[_0xf1c2('0x100')](_0x3910a1+_0xf1c2('0x11e'));}catch(_0x4de1c7){logger[_0xf1c2('0x2c')](_0x4de1c7);}return _0x2fc531;}return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0x4f9976,_0xf1c2('0x1c5'));};AGIVertices['prototype'][_0xf1c2('0x1c6')]=function(_0x1c4839){logger['info'](util[_0xf1c2('0x29')](_0xf1c2('0x1c7'),_0x1c4839[_0xf1c2('0x38')]));if(!this[_0xf1c2('0x82')](_0x1c4839[_0xf1c2('0x152')])){return this['channel'][_0xf1c2('0x2c')](_0x1c4839,'no\x20find\x20by\x20configured');}logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0x15a'),this[_0xf1c2('0xf')]['callerid'],_0x1c4839['findBy']));var _0xddeea2=this[_0xf1c2('0x4e')][_0xf1c2('0x6d')](this,_0x1c4839['findBy']);if(_0xddeea2){logger['info'](util[_0xf1c2('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xf1c2('0xf')]['callerid'],_0x1c4839[_0xf1c2('0x152')]));this[_0xf1c2('0xf')][_0xf1c2('0xae')](util[_0xf1c2('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xf1c2('0xf')][_0xf1c2('0x3a')],_0x1c4839['findBy']));return{'code':0xc8,'result':_0xf1c2('0x154')};}else{logger['info'](util[_0xf1c2('0x29')](_0xf1c2('0x155'),this[_0xf1c2('0xf')][_0xf1c2('0x3a')],_0x1c4839[_0xf1c2('0x152')]));this[_0xf1c2('0xf')][_0xf1c2('0xae')](util[_0xf1c2('0x29')](_0xf1c2('0x155'),this[_0xf1c2('0xf')][_0xf1c2('0x3a')],_0x1c4839['findBy']));return{'code':0xc8,'result':_0xf1c2('0x156')};}};AGIVertices[_0xf1c2('0x12')]['voicemail']=function(_0x27d3d6){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x27d3d6[_0xf1c2('0x38')]));var _0x1656cf=this[_0xf1c2('0xf')][_0xf1c2('0x56')](_0xf1c2('0x1c8'),[_0x27d3d6[_0xf1c2('0x1c9')],_0x27d3d6[_0xf1c2('0x73')]]);if(_0x1656cf['result']===-0x1){return _0x1656cf;}return this[_0xf1c2('0xf')][_0xf1c2('0xae')](util[_0xf1c2('0x29')](_0xf1c2('0xc2'),_0xf1c2('0x1c8'),_0x27d3d6[_0xf1c2('0x1c9')]));};AGIVertices[_0xf1c2('0x12')][_0xf1c2('0x1ca')]=function(_0x333081){logger[_0xf1c2('0x2e')](util[_0xf1c2('0x29')](_0xf1c2('0x1cb'),_0x333081[_0xf1c2('0x38')]));if(!this['isConfigured'](_0x333081['variable_id'])){return this['channel'][_0xf1c2('0x2c')](_0x333081,_0xf1c2('0x1cc'));}var _0x334d43=this[_0xf1c2('0x13')][_0xf1c2('0x6d')](this,_0x333081['variable_id']);if(!_0x334d43){return this[_0xf1c2('0xf')][_0xf1c2('0x2c')](_0x333081,'no\x20variable\x20found');}var _0x263aef=this[_0xf1c2('0xf')][_0xf1c2('0x13')](_0x334d43);return{'code':0xc8,'result':_0x263aef[_0xf1c2('0xa4')]?_0x263aef[_0xf1c2('0xa4')]:'-'};};String[_0xf1c2('0x12')][_0xf1c2('0x1cd')]=function(_0x16b1a6,_0x4ce633){return this[_0xf1c2('0xa0')](_0x16b1a6)[_0xf1c2('0x1ce')](_0x4ce633);};module[_0xf1c2('0x1cf')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 5647827..38f90a5 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 _0xa7e7=['isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','moment','../ami','../rpc/user','voiceQueues','agents','timers','channels','bind','hanguprequest','syncHangupRequest','syncHangup','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','getAgent','then','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','update','info','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','acw','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s'];(function(_0x10960d,_0x15b7e7){var _0x17b627=function(_0x27e815){while(--_0x27e815){_0x10960d['push'](_0x10960d['shift']());}};_0x17b627(++_0x15b7e7);}(_0xa7e7,0x10b));var _0x7a7e=function(_0xae264e,_0x2bd2ff){_0xae264e=_0xae264e-0x0;var _0x3b315a=_0xa7e7[_0xae264e];return _0x3b315a;};'use strict';var util=require(_0x7a7e('0x0'));var _=require('lodash');var moment=require(_0x7a7e('0x1'));var ami=require(_0x7a7e('0x2'));var logger=require('../../../config/logger')('acw');var RpcUser=require(_0x7a7e('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x2ec5a5){this[_0x7a7e('0x4')]=_0x2ec5a5[_0x7a7e('0x4')];this[_0x7a7e('0x5')]=_0x2ec5a5[_0x7a7e('0x5')];this[_0x7a7e('0x6')]=_0x2ec5a5[_0x7a7e('0x6')];this[_0x7a7e('0x7')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0x7a7e('0x8')](this));ami['on'](_0x7a7e('0x9'),this[_0x7a7e('0xa')][_0x7a7e('0x8')](this));ami['on']('hangup',this[_0x7a7e('0xb')]['bind'](this));ami['on']('agentringnoanswer',this[_0x7a7e('0xc')][_0x7a7e('0x8')](this));ami['on'](_0x7a7e('0xd'),this['syncAttendedTransfer'][_0x7a7e('0x8')](this));ami['on'](_0x7a7e('0xe'),this[_0x7a7e('0xf')][_0x7a7e('0x8')](this));ami['on'](_0x7a7e('0x10'),this[_0x7a7e('0x11')]['bind'](this));}function getDiff(_0xb69681){var _0x233b3d=moment()[_0x7a7e('0x12')](0x0);var _0x45be34=moment(_0xb69681)['milliseconds'](0x0);return _0x233b3d['diff'](_0x45be34,_0x7a7e('0x13'));}Acw[_0x7a7e('0x14')][_0x7a7e('0x15')]=function(_0x157419){try{var _0x4bf924=this;var _0x2cdd00=this[_0x7a7e('0x7')][_0x157419][_0x7a7e('0x16')];var _0x17e002=this[_0x7a7e('0x7')][_0x157419]['queue'];var _0x3cd6cb=this['voiceQueues'][_0x17e002];var _0x36db3a=![];var _0xa6446b=_0x7a7e('0x17');if(_0x3cd6cb[_0x7a7e('0x18')]){if(_0x3cd6cb[_0x7a7e('0x19')][_0x7a7e('0x1a')]){_0x36db3a=!![];_0xa6446b=_0x3cd6cb[_0x7a7e('0x19')][_0x7a7e('0x1a')];}}ami[_0x7a7e('0x1b')]({'action':_0x7a7e('0x1c'),'interface':_0x2cdd00,'paused':!![],'reason':_0xa6446b})['then'](function(_0x202f73){if(_0x4bf924[_0x7a7e('0x5')][_0x2cdd00]){return RpcUser[_0x7a7e('0x1d')](_0x4bf924[_0x7a7e('0x5')][_0x2cdd00]['id'])[_0x7a7e('0x1e')](function(_0x5caba4){if(_0x5caba4&&!_0x5caba4['voicePause']){logger['info']('[%s][START][AGENT:%s][QUEUE:%s]',_0x157419,_0x2cdd00,_0x17e002);var _0x1e5db7=_0x4bf924[_0x7a7e('0x7')][_0x157419][_0x7a7e('0x1f')]&&_0x4bf924[_0x7a7e('0x7')][_0x157419]['destlinkedid']?_0x4bf924['channels'][_0x157419][_0x7a7e('0x20')]:_0x157419;return RpcUser['savePause'](_0x4bf924[_0x7a7e('0x5')][_0x2cdd00],_0xa6446b,_0x1e5db7)[_0x7a7e('0x1e')](function(_0x45f27e){if(!_0x36db3a){_0x4bf924[_0x7a7e('0x6')][_0x2cdd00]={};logger['info'](_0x7a7e('0x21'),_0x157419,_0x4bf924[_0x7a7e('0x4')][_0x17e002]['acwTimeout'],_0x2cdd00,_0x17e002);_0x4bf924[_0x7a7e('0x6')][_0x2cdd00][_0x7a7e('0x22')]=setTimeout(_0x4bf924[_0x7a7e('0x23')][_0x7a7e('0x8')](_0x4bf924,_0x2cdd00),_0x4bf924[_0x7a7e('0x4')][_0x17e002][_0x7a7e('0x24')]*0x3e8);_0x4bf924[_0x7a7e('0x6')][_0x2cdd00][_0x7a7e('0x25')]=moment()[_0x7a7e('0x26')](_0x7a7e('0x27'));_0x4bf924['timers'][_0x2cdd00][_0x7a7e('0x28')]=_0x157419;_0x4bf924[_0x7a7e('0x6')][_0x2cdd00][_0x7a7e('0x29')]=_0x17e002;_0x4bf924[_0x7a7e('0x6')][_0x2cdd00][_0x7a7e('0x2a')]=function(){var _0x37b064=getDiff(_0x4bf924[_0x7a7e('0x6')][_0x2cdd00][_0x7a7e('0x25')]);clearTimeout(_0x4bf924['timers'][_0x2cdd00]['timer']);_0x4bf924[_0x7a7e('0x6')][_0x2cdd00][_0x7a7e('0x22')]=![];RpcVoiceAgentReport[_0x7a7e('0x2b')]({'acwtime':_0x37b064},_0x4bf924[_0x7a7e('0x6')][_0x2cdd00][_0x7a7e('0x28')],_0x2cdd00)[_0x7a7e('0x1e')](function(_0x4b6ab7){logger[_0x7a7e('0x2c')]('[%s][UPDATE][ACWTIME:%s]',_0x157419,_0x37b064,_0x4b6ab7);})['catch'](function(_0x16e1e6){logger[_0x7a7e('0x2d')](_0x7a7e('0x2e'),_0x157419,_0x16e1e6);});delete _0x4bf924[_0x7a7e('0x6')][_0x2cdd00];};}});}else{logger[_0x7a7e('0x2c')](_0x7a7e('0x2f'),_0x157419,_0x2cdd00,_0x17e002);}});}})[_0x7a7e('0x30')](function(_0x152a7e){logger[_0x7a7e('0x2d')](_0x7a7e('0x21'),_0x157419,_0x4bf924[_0x7a7e('0x4')][_0x17e002][_0x7a7e('0x24')],_0x2cdd00,_0x17e002);})['finally'](function(){delete _0x4bf924[_0x7a7e('0x7')][_0x157419];});}catch(_0x37739e){logger[_0x7a7e('0x2d')](_0x7a7e('0x31'),_0x37739e[_0x7a7e('0x32')]);}};Acw[_0x7a7e('0x14')][_0x7a7e('0x23')]=function(_0x4c24ab){try{var _0x3df908=this;if(_0x3df908[_0x7a7e('0x6')][_0x4c24ab]){_0x3df908[_0x7a7e('0x6')][_0x4c24ab][_0x7a7e('0x22')]=![];var _0x384c2a=_0x3df908['timers'][_0x4c24ab][_0x7a7e('0x28')];var _0x313303=_0x3df908[_0x7a7e('0x6')][_0x4c24ab][_0x7a7e('0x29')];var _0x44eeec=_0x3df908[_0x7a7e('0x4')][_0x313303][_0x7a7e('0x24')];logger[_0x7a7e('0x2c')](_0x7a7e('0x33'),_0x384c2a,_0x4c24ab);RpcUser[_0x7a7e('0x34')](this['agents'][_0x4c24ab]);RpcVoiceAgentReport['update']({'acwtime':_0x44eeec,'agentacw':!![]},_0x384c2a,_0x4c24ab)[_0x7a7e('0x1e')](function(_0xacec2b){logger[_0x7a7e('0x2c')]('[%s][UPDATE][ACWTIME:%s]',_0x384c2a,_0x44eeec,_0xacec2b);})['catch'](function(_0x165e93){logger['error'](_0x7a7e('0x2e'),_0x384c2a,_0x165e93);});}else{logger[_0x7a7e('0x2d')](_0x7a7e('0x35'),_0x4c24ab);if(_0x3df908[_0x7a7e('0x6')]){logger[_0x7a7e('0x2c')](_0x7a7e('0x36'),JSON[_0x7a7e('0x37')](_0x3df908['timers']));}}}catch(_0x69de56){logger[_0x7a7e('0x2d')](_0x7a7e('0x38'),_0x69de56[_0x7a7e('0x32')]);}};Acw['prototype'][_0x7a7e('0x39')]=function(_0x56ef55){try{if(this[_0x7a7e('0x4')][_0x56ef55[_0x7a7e('0x29')]]&&(this[_0x7a7e('0x4')][_0x56ef55[_0x7a7e('0x29')]][_0x7a7e('0x3a')]||this[_0x7a7e('0x4')][_0x56ef55['queue']][_0x7a7e('0x18')])){if(this[_0x7a7e('0x5')][_0x56ef55[_0x7a7e('0x16')]]){this[_0x7a7e('0x7')][_0x56ef55[_0x7a7e('0x28')]]={'queue':_0x56ef55[_0x7a7e('0x29')],'interface':_0x56ef55[_0x7a7e('0x16')],'destlinkedid':_0x56ef55[_0x7a7e('0x20')]};}}}catch(_0x563366){logger['error'](_0x7a7e('0x3b'),_0x563366[_0x7a7e('0x32')]);}};Acw['prototype'][_0x7a7e('0x11')]=function(_0x1c3a89){try{if(this[_0x7a7e('0x4')][_0x1c3a89['queue']]&&(this['voiceQueues'][_0x1c3a89[_0x7a7e('0x29')]][_0x7a7e('0x3a')]||this['voiceQueues'][_0x1c3a89['queue']]['mandatoryDisposition'])){if(this['agents'][_0x1c3a89[_0x7a7e('0x16')]]){this[_0x7a7e('0x7')][_0x1c3a89['uniqueid']]={'queue':_0x1c3a89[_0x7a7e('0x29')],'interface':_0x1c3a89[_0x7a7e('0x16')]};}}}catch(_0x39b5da){logger[_0x7a7e('0x2d')](_0x7a7e('0x3c'),_0x39b5da[_0x7a7e('0x32')]);}};Acw[_0x7a7e('0x14')][_0x7a7e('0xa')]=function(_0x262450){try{if(this[_0x7a7e('0x7')][_0x262450[_0x7a7e('0x28')]]&&_[_0x7a7e('0x3d')](this[_0x7a7e('0x7')][_0x262450['uniqueid']][_0x7a7e('0x1f')])){logger[_0x7a7e('0x2c')](_0x7a7e('0x3e'),_0x262450[_0x7a7e('0x28')]);this[_0x7a7e('0x15')](_0x262450[_0x7a7e('0x28')]);}else if(this[_0x7a7e('0x7')][_0x262450[_0x7a7e('0x3f')]]&&_[_0x7a7e('0x3d')](this['channels'][_0x262450[_0x7a7e('0x3f')]][_0x7a7e('0x1f')])){logger[_0x7a7e('0x2c')](_0x7a7e('0x40'),_0x262450['linkedid']);this[_0x7a7e('0x15')](_0x262450[_0x7a7e('0x3f')]);}}catch(_0x1dc4a0){logger[_0x7a7e('0x2d')](_0x7a7e('0x41'),_0x1dc4a0[_0x7a7e('0x32')]);}};Acw['prototype'][_0x7a7e('0xb')]=function(_0x5bd385){try{if(this['channels'][_0x5bd385['uniqueid']]&&this[_0x7a7e('0x7')][_0x5bd385['uniqueid']]['attended']){logger[_0x7a7e('0x2c')](_0x7a7e('0x42'),_0x5bd385[_0x7a7e('0x28')]);this['startAcw'](_0x5bd385[_0x7a7e('0x28')]);}else if(this[_0x7a7e('0x7')][_0x5bd385[_0x7a7e('0x3f')]]&&this['channels'][_0x5bd385[_0x7a7e('0x3f')]][_0x7a7e('0x1f')]){logger[_0x7a7e('0x2c')](_0x7a7e('0x43'),_0x5bd385['linkedid']);this['startAcw'](_0x5bd385[_0x7a7e('0x3f')]);}}catch(_0x27b5ea){logger[_0x7a7e('0x2d')]('[ACW][syncHangup]\x20%s',_0x27b5ea[_0x7a7e('0x32')]);}};Acw[_0x7a7e('0x14')][_0x7a7e('0x44')]=function(_0x1c7574){try{if(!_[_0x7a7e('0x45')](this[_0x7a7e('0x7')][_0x1c7574[_0x7a7e('0x46')]])){this[_0x7a7e('0x15')](_0x1c7574[_0x7a7e('0x46')]);if(this[_0x7a7e('0x7')][_0x1c7574['secondtransfereruniqueid']]){this['channels'][_0x1c7574[_0x7a7e('0x47')]][_0x7a7e('0x1f')]=!![];this[_0x7a7e('0x7')][_0x1c7574[_0x7a7e('0x48')]]=this[_0x7a7e('0x7')][_0x1c7574[_0x7a7e('0x47')]];delete this[_0x7a7e('0x7')][_0x1c7574[_0x7a7e('0x47')]];}}else if(!_[_0x7a7e('0x45')](this[_0x7a7e('0x7')][_0x1c7574[_0x7a7e('0x48')]])){this[_0x7a7e('0x15')](_0x1c7574['transfertargetuniqueid']);if(this[_0x7a7e('0x7')][_0x1c7574[_0x7a7e('0x49')]]){this[_0x7a7e('0x7')][_0x1c7574[_0x7a7e('0x49')]][_0x7a7e('0x1f')]=!![];this[_0x7a7e('0x7')][_0x1c7574['transfereeuniqueid']]=this[_0x7a7e('0x7')][_0x1c7574[_0x7a7e('0x49')]];delete this[_0x7a7e('0x7')][_0x1c7574[_0x7a7e('0x49')]];}}}catch(_0x1babd4){logger[_0x7a7e('0x2d')](_0x7a7e('0x4a'),_0x1babd4['message']);}};Acw[_0x7a7e('0x14')]['syncBlindTransfer']=function(_0x3e1c70){try{if(this['channels'][_0x3e1c70[_0x7a7e('0x4b')]]){logger[_0x7a7e('0x2c')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x7a7e('0x37')](_0x3e1c70[_0x7a7e('0x4b')]));this[_0x7a7e('0x15')](_0x3e1c70[_0x7a7e('0x4b')]);}else if(this[_0x7a7e('0x7')][_0x3e1c70[_0x7a7e('0x4c')]]){logger['info'](_0x7a7e('0x4d'),JSON['stringify'](_0x3e1c70['transfererlinkedid']));this[_0x7a7e('0x15')](_0x3e1c70['transfererlinkedid']);}}catch(_0x1e66d6){logger[_0x7a7e('0x2d')](_0x7a7e('0x4e'),_0x1e66d6[_0x7a7e('0x32')]);}};Acw['prototype'][_0x7a7e('0xc')]=function(_0x2abd9a){try{if(this[_0x7a7e('0x4')][_0x2abd9a[_0x7a7e('0x29')]]&&this[_0x7a7e('0x4')][_0x2abd9a['queue']]['autopause']==='all'){if(this[_0x7a7e('0x5')][_0x2abd9a[_0x7a7e('0x16')]]){logger[_0x7a7e('0x2c')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x2abd9a[_0x7a7e('0x28')],_0x2abd9a['interface'],_0x2abd9a[_0x7a7e('0x29')]);return RpcUser['savePause'](this[_0x7a7e('0x5')][_0x2abd9a[_0x7a7e('0x16')]],_0x7a7e('0x4f'),_0x2abd9a[_0x7a7e('0x28')]);}}}catch(_0x16c846){logger[_0x7a7e('0x2d')](_0x7a7e('0x50'),_0x16c846[_0x7a7e('0x32')]);}};module[_0x7a7e('0x51')]=Acw; \ No newline at end of file +var _0xfc31=['catch','[ACW][START]\x20%s','message','uniqueid','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][syncAgentConnect]\x20%s','acw','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereeuniqueid','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','syncAgentRingNoAnswer','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','exports','util','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','hangup','syncHangup','agentringnoanswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','prototype','interface','ACW','mandatoryDisposition','name','mandatoryDispositionPause','Action','QueuePause','then','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','queue','updateAcw','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]'];(function(_0x26caa9,_0xd18686){var _0x5b3276=function(_0x353b00){while(--_0x353b00){_0x26caa9['push'](_0x26caa9['shift']());}};_0x5b3276(++_0xd18686);}(_0xfc31,0xcd));var _0x1fc3=function(_0x3dc673,_0x2ec66c){_0x3dc673=_0x3dc673-0x0;var _0x4e31bd=_0xfc31[_0x3dc673];return _0x4e31bd;};'use strict';var util=require(_0x1fc3('0x0'));var _=require('lodash');var moment=require('moment');var ami=require(_0x1fc3('0x1'));var logger=require(_0x1fc3('0x2'))('acw');var RpcUser=require(_0x1fc3('0x3'));var RpcVoiceAgentReport=require(_0x1fc3('0x4'));function Acw(_0x5410cf){this['voiceQueues']=_0x5410cf[_0x1fc3('0x5')];this[_0x1fc3('0x6')]=_0x5410cf['agents'];this['timers']=_0x5410cf[_0x1fc3('0x7')];this[_0x1fc3('0x8')]={};ami['on'](_0x1fc3('0x9'),this[_0x1fc3('0xa')][_0x1fc3('0xb')](this));ami['on'](_0x1fc3('0xc'),this['syncHangupRequest'][_0x1fc3('0xb')](this));ami['on'](_0x1fc3('0xd'),this[_0x1fc3('0xe')][_0x1fc3('0xb')](this));ami['on'](_0x1fc3('0xf'),this['syncAgentRingNoAnswer'][_0x1fc3('0xb')](this));ami['on'](_0x1fc3('0x10'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x1fc3('0x11'),this[_0x1fc3('0x12')][_0x1fc3('0xb')](this));ami['on'](_0x1fc3('0x13'),this[_0x1fc3('0x14')][_0x1fc3('0xb')](this));}function getDiff(_0x3ccaa6){var _0x3c2758=moment()[_0x1fc3('0x15')](0x0);var _0x1e671d=moment(_0x3ccaa6)[_0x1fc3('0x15')](0x0);return _0x3c2758['diff'](_0x1e671d,'seconds');}Acw[_0x1fc3('0x16')]['startAcw']=function(_0x3c86f6){try{var _0x45793f=this;var _0x49a320=this[_0x1fc3('0x8')][_0x3c86f6][_0x1fc3('0x17')];var _0x32d358=this[_0x1fc3('0x8')][_0x3c86f6]['queue'];var _0x576720=this[_0x1fc3('0x5')][_0x32d358];var _0x415e30=![];var _0x21538e=_0x1fc3('0x18');if(_0x576720[_0x1fc3('0x19')]){if(_0x576720['mandatoryDispositionPause'][_0x1fc3('0x1a')]){_0x415e30=!![];_0x21538e=_0x576720[_0x1fc3('0x1b')][_0x1fc3('0x1a')];}}ami[_0x1fc3('0x1c')]({'action':_0x1fc3('0x1d'),'interface':_0x49a320,'paused':!![],'reason':_0x21538e})['then'](function(_0x26fe24){if(_0x45793f[_0x1fc3('0x6')][_0x49a320]){return RpcUser['getAgent'](_0x45793f[_0x1fc3('0x6')][_0x49a320]['id'])[_0x1fc3('0x1e')](function(_0x52740d){if(_0x52740d&&!_0x52740d['voicePause']){logger[_0x1fc3('0x1f')](_0x1fc3('0x20'),_0x3c86f6,_0x49a320,_0x32d358);var _0x44cd22=_0x45793f['channels'][_0x3c86f6][_0x1fc3('0x21')]&&_0x45793f['channels'][_0x3c86f6][_0x1fc3('0x22')]?_0x45793f[_0x1fc3('0x8')][_0x3c86f6][_0x1fc3('0x22')]:_0x3c86f6;return RpcUser['savePause'](_0x45793f[_0x1fc3('0x6')][_0x49a320],_0x21538e,_0x44cd22)[_0x1fc3('0x1e')](function(_0x4a8fbf){if(!_0x415e30){_0x45793f['timers'][_0x49a320]={};logger[_0x1fc3('0x1f')](_0x1fc3('0x23'),_0x3c86f6,_0x45793f['voiceQueues'][_0x32d358][_0x1fc3('0x24')],_0x49a320,_0x32d358);_0x45793f['timers'][_0x49a320][_0x1fc3('0x25')]=setTimeout(_0x45793f[_0x1fc3('0x26')][_0x1fc3('0xb')](_0x45793f,_0x49a320),_0x45793f[_0x1fc3('0x5')][_0x32d358]['acwTimeout']*0x3e8);_0x45793f[_0x1fc3('0x7')][_0x49a320][_0x1fc3('0x27')]=moment()[_0x1fc3('0x28')]('YYYY-MM-DD\x20HH:mm:ss');_0x45793f[_0x1fc3('0x7')][_0x49a320]['uniqueid']=_0x3c86f6;_0x45793f[_0x1fc3('0x7')][_0x49a320][_0x1fc3('0x29')]=_0x32d358;_0x45793f[_0x1fc3('0x7')][_0x49a320][_0x1fc3('0x2a')]=function(){var _0x1b5460=getDiff(_0x45793f[_0x1fc3('0x7')][_0x49a320][_0x1fc3('0x27')]);clearTimeout(_0x45793f[_0x1fc3('0x7')][_0x49a320][_0x1fc3('0x25')]);_0x45793f[_0x1fc3('0x7')][_0x49a320][_0x1fc3('0x25')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x1b5460},_0x45793f[_0x1fc3('0x7')][_0x49a320]['uniqueid'],_0x49a320)[_0x1fc3('0x1e')](function(_0x1af622){logger[_0x1fc3('0x1f')](_0x1fc3('0x2b'),_0x3c86f6,_0x1b5460,_0x1af622);})['catch'](function(_0x216c3c){logger[_0x1fc3('0x2c')](_0x1fc3('0x2d'),_0x3c86f6,_0x216c3c);});delete _0x45793f['timers'][_0x49a320];};}});}else{logger[_0x1fc3('0x1f')](_0x1fc3('0x2e'),_0x3c86f6,_0x49a320,_0x32d358);}});}})[_0x1fc3('0x2f')](function(_0x9d7623){logger['error'](_0x1fc3('0x23'),_0x3c86f6,_0x45793f[_0x1fc3('0x5')][_0x32d358][_0x1fc3('0x24')],_0x49a320,_0x32d358);})['finally'](function(){delete _0x45793f['channels'][_0x3c86f6];});}catch(_0x5e60a5){logger[_0x1fc3('0x2c')](_0x1fc3('0x30'),_0x5e60a5[_0x1fc3('0x31')]);}};Acw['prototype']['stopAcw']=function(_0x46593e){try{var _0x15a192=this;if(_0x15a192[_0x1fc3('0x7')][_0x46593e]){_0x15a192[_0x1fc3('0x7')][_0x46593e]['timer']=![];var _0x3c9cc4=_0x15a192['timers'][_0x46593e][_0x1fc3('0x32')];var _0x2aff29=_0x15a192[_0x1fc3('0x7')][_0x46593e][_0x1fc3('0x29')];var _0x4b0de0=_0x15a192[_0x1fc3('0x5')][_0x2aff29]['acwTimeout'];logger[_0x1fc3('0x1f')](_0x1fc3('0x33'),_0x3c9cc4,_0x46593e);RpcUser[_0x1fc3('0x34')](this[_0x1fc3('0x6')][_0x46593e]);RpcVoiceAgentReport[_0x1fc3('0x35')]({'acwtime':_0x4b0de0,'agentacw':!![]},_0x3c9cc4,_0x46593e)['then'](function(_0x2ede6f){logger[_0x1fc3('0x1f')](_0x1fc3('0x2b'),_0x3c9cc4,_0x4b0de0,_0x2ede6f);})[_0x1fc3('0x2f')](function(_0x35c636){logger['error'](_0x1fc3('0x2d'),_0x3c9cc4,_0x35c636);});}else{logger[_0x1fc3('0x2c')](_0x1fc3('0x36'),_0x46593e);if(_0x15a192['timers']){logger['info'](_0x1fc3('0x37'),JSON[_0x1fc3('0x38')](_0x15a192[_0x1fc3('0x7')]));}}}catch(_0x273a65){logger[_0x1fc3('0x2c')]('[ACW][STOP]\x20%s',_0x273a65[_0x1fc3('0x31')]);}};Acw[_0x1fc3('0x16')][_0x1fc3('0xa')]=function(_0x1cc7ff){try{if(this[_0x1fc3('0x5')][_0x1cc7ff[_0x1fc3('0x29')]]&&(this['voiceQueues'][_0x1cc7ff[_0x1fc3('0x29')]]['acw']||this[_0x1fc3('0x5')][_0x1cc7ff[_0x1fc3('0x29')]]['mandatoryDisposition'])){if(this[_0x1fc3('0x6')][_0x1cc7ff[_0x1fc3('0x17')]]){this[_0x1fc3('0x8')][_0x1cc7ff[_0x1fc3('0x32')]]={'queue':_0x1cc7ff[_0x1fc3('0x29')],'interface':_0x1cc7ff[_0x1fc3('0x17')],'destlinkedid':_0x1cc7ff[_0x1fc3('0x22')]};}}}catch(_0x55db52){logger[_0x1fc3('0x2c')](_0x1fc3('0x39'),_0x55db52[_0x1fc3('0x31')]);}};Acw[_0x1fc3('0x16')][_0x1fc3('0x14')]=function(_0x4d2a7e){try{if(this['voiceQueues'][_0x4d2a7e[_0x1fc3('0x29')]]&&(this[_0x1fc3('0x5')][_0x4d2a7e['queue']][_0x1fc3('0x3a')]||this[_0x1fc3('0x5')][_0x4d2a7e['queue']]['mandatoryDisposition'])){if(this[_0x1fc3('0x6')][_0x4d2a7e['interface']]){this[_0x1fc3('0x8')][_0x4d2a7e[_0x1fc3('0x32')]]={'queue':_0x4d2a7e[_0x1fc3('0x29')],'interface':_0x4d2a7e[_0x1fc3('0x17')]};}}}catch(_0x50e60b){logger[_0x1fc3('0x2c')](_0x1fc3('0x3b'),_0x50e60b[_0x1fc3('0x31')]);}};Acw['prototype'][_0x1fc3('0x3c')]=function(_0x49a171){try{if(this[_0x1fc3('0x8')][_0x49a171[_0x1fc3('0x32')]]&&_[_0x1fc3('0x3d')](this[_0x1fc3('0x8')][_0x49a171['uniqueid']][_0x1fc3('0x21')])){logger['info'](_0x1fc3('0x3e'),_0x49a171[_0x1fc3('0x32')]);this[_0x1fc3('0x3f')](_0x49a171[_0x1fc3('0x32')]);}else if(this[_0x1fc3('0x8')][_0x49a171[_0x1fc3('0x40')]]&&_['isUndefined'](this['channels'][_0x49a171['linkedid']]['attended'])){logger[_0x1fc3('0x1f')](_0x1fc3('0x41'),_0x49a171[_0x1fc3('0x40')]);this[_0x1fc3('0x3f')](_0x49a171[_0x1fc3('0x40')]);}}catch(_0x4ccbfd){logger[_0x1fc3('0x2c')](_0x1fc3('0x42'),_0x4ccbfd['message']);}};Acw['prototype'][_0x1fc3('0xe')]=function(_0x5c5f04){try{if(this['channels'][_0x5c5f04[_0x1fc3('0x32')]]&&this[_0x1fc3('0x8')][_0x5c5f04['uniqueid']][_0x1fc3('0x21')]){logger['info'](_0x1fc3('0x43'),_0x5c5f04['uniqueid']);this[_0x1fc3('0x3f')](_0x5c5f04[_0x1fc3('0x32')]);}else if(this[_0x1fc3('0x8')][_0x5c5f04[_0x1fc3('0x40')]]&&this[_0x1fc3('0x8')][_0x5c5f04[_0x1fc3('0x40')]][_0x1fc3('0x21')]){logger[_0x1fc3('0x1f')](_0x1fc3('0x44'),_0x5c5f04['linkedid']);this['startAcw'](_0x5c5f04[_0x1fc3('0x40')]);}}catch(_0x4a0167){logger['error'](_0x1fc3('0x45'),_0x4a0167[_0x1fc3('0x31')]);}};Acw[_0x1fc3('0x16')][_0x1fc3('0x46')]=function(_0x5ae68c){try{if(!_['isNil'](this[_0x1fc3('0x8')][_0x5ae68c['transfereeuniqueid']])){this[_0x1fc3('0x3f')](_0x5ae68c['transfereeuniqueid']);if(this[_0x1fc3('0x8')][_0x5ae68c[_0x1fc3('0x47')]]){this['channels'][_0x5ae68c[_0x1fc3('0x47')]]['attended']=!![];this['channels'][_0x5ae68c[_0x1fc3('0x48')]]=this[_0x1fc3('0x8')][_0x5ae68c[_0x1fc3('0x47')]];delete this['channels'][_0x5ae68c[_0x1fc3('0x47')]];}}else if(!_['isNil'](this[_0x1fc3('0x8')][_0x5ae68c[_0x1fc3('0x48')]])){this[_0x1fc3('0x3f')](_0x5ae68c[_0x1fc3('0x48')]);if(this[_0x1fc3('0x8')][_0x5ae68c[_0x1fc3('0x49')]]){this[_0x1fc3('0x8')][_0x5ae68c['origtransfereruniqueid']][_0x1fc3('0x21')]=!![];this[_0x1fc3('0x8')][_0x5ae68c[_0x1fc3('0x4a')]]=this['channels'][_0x5ae68c[_0x1fc3('0x49')]];delete this[_0x1fc3('0x8')][_0x5ae68c['origtransfereruniqueid']];}}}catch(_0x2f7c76){logger[_0x1fc3('0x2c')]('[ACW][syncAttendedTransfer]\x20%s',_0x2f7c76[_0x1fc3('0x31')]);}};Acw[_0x1fc3('0x16')][_0x1fc3('0x12')]=function(_0x505118){try{if(this[_0x1fc3('0x8')][_0x505118[_0x1fc3('0x4b')]]){logger['info']('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x1fc3('0x38')](_0x505118[_0x1fc3('0x4b')]));this[_0x1fc3('0x3f')](_0x505118[_0x1fc3('0x4b')]);}else if(this[_0x1fc3('0x8')][_0x505118['transfererlinkedid']]){logger[_0x1fc3('0x1f')](_0x1fc3('0x4c'),JSON[_0x1fc3('0x38')](_0x505118[_0x1fc3('0x4d')]));this[_0x1fc3('0x3f')](_0x505118['transfererlinkedid']);}}catch(_0x217886){logger[_0x1fc3('0x2c')]('[ACW][syncBlindTransfer]\x20%s',_0x217886[_0x1fc3('0x31')]);}};Acw['prototype'][_0x1fc3('0x4e')]=function(_0x363814){try{if(this[_0x1fc3('0x5')][_0x363814[_0x1fc3('0x29')]]&&this['voiceQueues'][_0x363814[_0x1fc3('0x29')]][_0x1fc3('0x4f')]===_0x1fc3('0x50')){if(this[_0x1fc3('0x6')][_0x363814[_0x1fc3('0x17')]]){logger[_0x1fc3('0x1f')](_0x1fc3('0x51'),_0x363814['uniqueid'],_0x363814[_0x1fc3('0x17')],_0x363814['queue']);return RpcUser[_0x1fc3('0x52')](this['agents'][_0x363814[_0x1fc3('0x17')]],'Auto-Pause',_0x363814[_0x1fc3('0x32')]);}}}catch(_0x714b38){logger[_0x1fc3('0x2c')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x714b38[_0x1fc3('0x31')]);}};module[_0x1fc3('0x53')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 4e5db0e..e1415af 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 _0x2032=['exports','bluebird','moment','util','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','action','format','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','inspect'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2032,0xd9));var _0x2203=function(_0x393baa,_0x560f96){_0x393baa=_0x393baa-0x0;var _0x1c7ee7=_0x2032[_0x393baa];return _0x1c7ee7;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var util=require(_0x2203('0x2'));var _=require('lodash');var logger=require(_0x2203('0x3'))(_0x2203('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x2203('0x5')][_0x2203('0x6')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')][_0x2203('0x8')],!![]);ami[_0x2203('0x9')]();ami[_0x2203('0xa')]=BPromise[_0x2203('0xb')](ami[_0x2203('0xc')]);function error(_0x5ecf9e){logger['error'](util[_0x2203('0xd')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x5ecf9e,![],null)));}function close(){logger[_0x2203('0xe')](util['format'](_0x2203('0xf'),config[_0x2203('0x5')]['username'],config['asterisk']['ip'],config['asterisk']['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x2203('0xa')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x10')});};};ami[_0x2203('0x11')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x12')});};};ami[_0x2203('0x13')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x14')});};};ami[_0x2203('0x15')]=function(){return function(){return ami[_0x2203('0xa')]({'action':'coreshowchannels'});};};function connect(_0x280eda){logger[_0x2203('0x16')](util['format'](_0x2203('0x17'),config[_0x2203('0x5')]['username'],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')]));ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')](_0x2203('0x19'),close);}ami['on'](_0x2203('0x1a'),connect);ami['on']('shutdown',function(_0x13d3f7){logger['info'](util['format'](_0x2203('0x1b'),config['asterisk'][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x13d3f7,![],null)));});ami['on']('fullybooted',function(_0x226374){logger[_0x2203('0x16')](util[_0x2203('0xd')](_0x2203('0x1c'),config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')]['port']));return BPromise[_0x2203('0x1d')]()[_0x2203('0x1e')](ami[_0x2203('0x1f')]())['then'](ami[_0x2203('0x20')]())[_0x2203('0x1e')](ami['actionSipPeerStatus']())[_0x2203('0x1e')](ami[_0x2203('0x13')]())[_0x2203('0x1e')](ami[_0x2203('0x15')]())[_0x2203('0x21')](function(_0x1df508){logger[_0x2203('0xe')]('[ami.js][fullybooted]',util[_0x2203('0x22')](_0x1df508,{'showHidden':![],'depth':null}));});});ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')]('close',close);module[_0x2203('0x23')]=ami; \ No newline at end of file +var _0xbaf0=['once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipShowRegistry','catch','[ami.js][fullybooted]','exports','bluebird','moment','util','lodash','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x216f98,_0x470c7f){var _0xea6b36=function(_0x38f18c){while(--_0x38f18c){_0x216f98['push'](_0x216f98['shift']());}};_0xea6b36(++_0x470c7f);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var _=require(_0x0baf('0x3'));var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0x0baf('0x6')][_0x0baf('0x7')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')][_0x0baf('0x9')],!![]);ami[_0x0baf('0xa')]();ami[_0x0baf('0xb')]=BPromise['promisify'](ami[_0x0baf('0xc')]);function error(_0x5f20aa){logger[_0x0baf('0xd')](util[_0x0baf('0xe')](_0x0baf('0xf'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')],util[_0x0baf('0x10')](_0x5f20aa,![],null)));}function close(){logger[_0x0baf('0xd')](util[_0x0baf('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x0baf('0xb')]({'action':'sipshowregistry'});};};ami[_0x0baf('0x11')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x12')});};};ami[_0x0baf('0x13')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x14')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x0baf('0x15')});};};ami[_0x0baf('0x16')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x17')});};};function connect(_0x2cf7da){logger[_0x0baf('0x18')](util['format'](_0x0baf('0x19'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));ami['once']('error',error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);}ami['on'](_0x0baf('0x1c'),connect);ami['on'](_0x0baf('0x1d'),function(_0x1fa92b){logger[_0x0baf('0x18')](util[_0x0baf('0xe')](_0x0baf('0x1e'),config[_0x0baf('0x6')][_0x0baf('0x8')],config['asterisk']['ip'],config[_0x0baf('0x6')]['port'],util[_0x0baf('0x10')](_0x1fa92b,![],null)));});ami['on']('fullybooted',function(_0x4de74c){logger[_0x0baf('0x18')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));return BPromise['resolve']()[_0x0baf('0x1f')](ami[_0x0baf('0x20')]())[_0x0baf('0x1f')](ami[_0x0baf('0x11')]())[_0x0baf('0x1f')](ami[_0x0baf('0x13')]())[_0x0baf('0x1f')](ami['actionQueueSummary']())[_0x0baf('0x1f')](ami[_0x0baf('0x16')]())[_0x0baf('0x21')](function(_0x265915){logger['error'](_0x0baf('0x22'),util[_0x0baf('0x10')](_0x265915,{'showHidden':![],'depth':null}));});});ami['once'](_0x0baf('0xd'),error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);module[_0x0baf('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index a7ea068..57b53f5 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 _0xd8b0=['message','result','catch','exports','jayson/promise','bluebird','http','Request','then','debug','memberReport','error','rpc'];(function(_0x4e5f81,_0x427236){var _0x1d9b5d=function(_0x660920){while(--_0x660920){_0x4e5f81['push'](_0x4e5f81['shift']());}};_0x1d9b5d(++_0x427236);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var jayson=require(_0x0d8b('0x0'));var BPromise=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('ami');var client=jayson['client'][_0x0d8b('0x2')]({'port':0x2329});client[_0x0d8b('0x3')]=function(_0x43bca1,_0x364286){return new BPromise(function(_0x8196ed,_0x577834){return client['request'](_0x43bca1,_0x364286)[_0x0d8b('0x4')](function(_0x227c63){logger[_0x0d8b('0x5')]('rpc',_0x0d8b('0x6'),_0x43bca1,_0x364286,_0x227c63);if(_0x227c63[_0x0d8b('0x7')]){logger['error'](_0x0d8b('0x8'),_0x0d8b('0x6'),_0x43bca1,_0x227c63[_0x0d8b('0x7')][_0x0d8b('0x9')],_0x364286);return _0x577834(_0x227c63[_0x0d8b('0x7')][_0x0d8b('0x9')]);}else{return _0x8196ed(_0x227c63[_0x0d8b('0xa')]);}})[_0x0d8b('0xb')](function(_0x48fa16){logger[_0x0d8b('0x7')]('rpc',_0x0d8b('0x6'),_0x43bca1,_0x48fa16,_0x364286);return _0x577834(_0x48fa16);});});};module[_0x0d8b('0xc')]=client; \ No newline at end of file +var _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x462fe4,_0x394d3e){_0x462fe4=_0x462fe4-0x0;var _0x82b23a=_0xcb91[_0x462fe4];return _0x82b23a;};'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 994acdb..3cea4ed 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 _0x8969=['moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','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','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','getQueue','queue','exports','util'];(function(_0x5a8633,_0x2c81a0){var _0x1421c4=function(_0x282e21){while(--_0x282e21){_0x5a8633['push'](_0x5a8633['shift']());}};_0x1421c4(++_0x2c81a0);}(_0x8969,0xea));var _0x9896=function(_0x5089a8,_0x50577a){_0x5089a8=_0x5089a8-0x0;var _0x4dcc19=_0x8969[_0x5089a8];return _0x4dcc19;};'use strict';var util=require(_0x9896('0x0'));var _=require('lodash');var moment=require(_0x9896('0x1'));function checkNameSurname(_0x5909fb,_0x58cb3b,_0x4b97ee){var _0x3fe602='';if(!_[_0x9896('0x2')](_0x58cb3b)&&_0x9896('0x3')===typeof _0x58cb3b){_0x3fe602+=_0x58cb3b;}if(!_['isNil'](_0x4b97ee)&&'string'===typeof _0x4b97ee){_0x3fe602+='\x20'+_0x4b97ee;}if(_0x3fe602!==''){return _0x3fe602;}return _0x5909fb;}function Action(_0xb51224,_0xd7375,_0x5c72d6){this[_0x9896('0x4')]=_0xb51224;this[_0x9896('0x5')]=_0x5c72d6||undefined;this[_0x9896('0x6')]=checkNameSurname(_0xd7375[_0x9896('0x7')][_0x9896('0x8')],_0xd7375['Contact'][_0x9896('0x9')],_0xd7375[_0x9896('0x7')][_0x9896('0xa')]);this[_0x9896('0xb')]=_0xd7375[_0x9896('0x7')][_0x9896('0x8')];this['queue']=_0xb51224[_0x9896('0x6')];this[_0x9896('0xc')]=_0xd7375['active']||![];this[_0x9896('0xd')]=_0xb51224['type'];this[_0x9896('0xe')]=_0xb51224[_0x9896('0xe')]||0x3;this['scheduledat']=_0xd7375[_0x9896('0xf')];this[_0x9896('0x10')]=_0xd7375['countbusyretry'];this[_0x9896('0x11')]=_0xd7375[_0x9896('0x11')];this[_0x9896('0x12')]=_0xd7375[_0x9896('0x12')];this[_0x9896('0x13')]=_0xd7375['countnosuchnumberretry'];this[_0x9896('0x14')]=_0xd7375[_0x9896('0x14')];this[_0x9896('0x15')]=_0xd7375[_0x9896('0x15')];this[_0x9896('0x16')]=_0xd7375['countmachineretry'];this[_0x9896('0x17')]=_0xd7375['countagentrejectretry'];this['ContactId']=_0xd7375[_0x9896('0x18')];this[_0x9896('0x19')]=_0xd7375[_0x9896('0x19')];this['UserId']=_0xd7375[_0x9896('0x1a')];this[_0x9896('0x1b')]=_0xd7375[_0x9896('0x1b')];this[_0x9896('0x1c')]=_0xd7375[_0x9896('0x1c')];this[_0x9896('0x1d')]=_0xd7375['id'];this[_0x9896('0x1e')]=_0xd7375[_0x9896('0x7')][_0x9896('0x9')]||'';this[_0x9896('0x1f')]=moment()[_0x9896('0x20')](_0x9896('0x21'));this[_0x9896('0x22')]=_0xd7375[_0x9896('0x22')];this[_0x9896('0x23')]=_0xd7375[_0x9896('0x23')];this[_0x9896('0x24')]=_0xd7375[_0x9896('0x24')];this[_0x9896('0x25')]=_0xd7375[_0x9896('0x25')];this[_0x9896('0x26')]='';this[_0x9896('0x27')]='';}Action[_0x9896('0x28')][_0x9896('0x29')]=function(){return util[_0x9896('0x20')](_0x9896('0x2a'),this['name'],this['voiceQueue'][_0x9896('0x2b')]>0x0?this[_0x9896('0xb')]['substring'](this['voiceQueue'][_0x9896('0x2b')]):this[_0x9896('0xb')]);};Action[_0x9896('0x28')][_0x9896('0x2c')]=function(){return this[_0x9896('0x2d')];};module[_0x9896('0x2e')]=Action; \ No newline at end of file +var _0x006c=['lodash','moment','string','isNil','voiceQueue','name','Contact','phone','firstName','lastName','number','queue','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','callbackat','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','getQueue','exports','util'];(function(_0x3c3b51,_0xe90b55){var _0x303246=function(_0xaa8aa2){while(--_0xaa8aa2){_0x3c3b51['push'](_0x3c3b51['shift']());}};_0x303246(++_0xe90b55);}(_0x006c,0x1e3));var _0xc006=function(_0x23b416,_0x8fefea){_0x23b416=_0x23b416-0x0;var _0x4013ca=_0x006c[_0x23b416];return _0x4013ca;};'use strict';var util=require(_0xc006('0x0'));var _=require(_0xc006('0x1'));var moment=require(_0xc006('0x2'));function checkNameSurname(_0x27def7,_0x27038,_0x5e1c94){var _0x1d089b='';if(!_['isNil'](_0x27038)&&_0xc006('0x3')===typeof _0x27038){_0x1d089b+=_0x27038;}if(!_[_0xc006('0x4')](_0x5e1c94)&&_0xc006('0x3')===typeof _0x5e1c94){_0x1d089b+='\x20'+_0x5e1c94;}if(_0x1d089b!==''){return _0x1d089b;}return _0x27def7;}function Action(_0x1050fd,_0x3689f2,_0x48e3f4){this[_0xc006('0x5')]=_0x1050fd;this['uniqueid']=_0x48e3f4||undefined;this[_0xc006('0x6')]=checkNameSurname(_0x3689f2[_0xc006('0x7')][_0xc006('0x8')],_0x3689f2[_0xc006('0x7')][_0xc006('0x9')],_0x3689f2[_0xc006('0x7')][_0xc006('0xa')]);this[_0xc006('0xb')]=_0x3689f2[_0xc006('0x7')]['phone'];this[_0xc006('0xc')]=_0x1050fd[_0xc006('0x6')];this['active']=_0x3689f2[_0xc006('0xd')]||![];this['type']=_0x1050fd[_0xc006('0xe')];this[_0xc006('0xf')]=_0x1050fd[_0xc006('0xf')]||0x3;this[_0xc006('0x10')]=_0x3689f2[_0xc006('0x10')];this['countbusyretry']=_0x3689f2[_0xc006('0x11')];this[_0xc006('0x12')]=_0x3689f2[_0xc006('0x12')];this['countnoanswerretry']=_0x3689f2[_0xc006('0x13')];this[_0xc006('0x14')]=_0x3689f2['countnosuchnumberretry'];this[_0xc006('0x15')]=_0x3689f2[_0xc006('0x15')];this['countabandonedretry']=_0x3689f2[_0xc006('0x16')];this[_0xc006('0x17')]=_0x3689f2[_0xc006('0x17')];this[_0xc006('0x18')]=_0x3689f2[_0xc006('0x18')];this[_0xc006('0x19')]=_0x3689f2[_0xc006('0x19')];this[_0xc006('0x1a')]=_0x3689f2[_0xc006('0x1a')];this[_0xc006('0x1b')]=_0x3689f2[_0xc006('0x1b')];this[_0xc006('0x1c')]=_0x3689f2[_0xc006('0x1c')];this[_0xc006('0x1d')]=_0x3689f2[_0xc006('0x1d')];this[_0xc006('0x1e')]=_0x3689f2['id'];this[_0xc006('0x1f')]=_0x3689f2['Contact']['firstName']||'';this[_0xc006('0x20')]=moment()[_0xc006('0x21')](_0xc006('0x22'));this[_0xc006('0x23')]=_0x3689f2['callback'];this['callbackuniqueid']=_0x3689f2['callbackuniqueid'];this[_0xc006('0x24')]=_0x3689f2[_0xc006('0x24')];this[_0xc006('0x25')]=_0x3689f2['recallme'];this[_0xc006('0x26')]='';this['originatecalleridname']='';}Action[_0xc006('0x27')][_0xc006('0x28')]=function(){return util[_0xc006('0x21')](_0xc006('0x29'),this[_0xc006('0x6')],this[_0xc006('0x5')]['dialCutDigit']>0x0?this[_0xc006('0xb')]['substring'](this['voiceQueue']['dialCutDigit']):this[_0xc006('0xb')]);};Action['prototype'][_0xc006('0x2a')]=function(){return this['queue'];};module[_0xc006('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index b079c3f..55c7029 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 _0x07b1=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','type','outbound','queue','countcongestionretry','countnoanswerretry','countbusyretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','number','starttime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','responsetime','holdtime','talktime','membername','reason','callback','callbackuniqueid'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x07b1,0x1ed));var _0x107b=function(_0x2e8052,_0x42f72c){_0x2e8052=_0x2e8052-0x0;var _0x22c6bf=_0x07b1[_0x2e8052];return _0x22c6bf;};'use strict';var util=require(_0x107b('0x0'));var _=require(_0x107b('0x1'));var moment=require(_0x107b('0x2'));function getSeconds(_0x2d4152,_0x5f0d46){var _0x59cdd7=moment(_0x2d4152)[_0x107b('0x3')](0x0);var _0x101eb7=moment(_0x5f0d46)[_0x107b('0x3')](0x0);return _0x59cdd7[_0x107b('0x4')](_0x101eb7,_0x107b('0x5'));}function AgentComplete(_0x455ee0,_0x2e952d){this[_0x107b('0x6')]=0x4;this[_0x107b('0x7')]=_0x107b('0x8');this['scheduledat']=_0x455ee0['scheduledat'];this[_0x107b('0x9')]=_0x455ee0[_0x107b('0x9')];this['campaigntype']=_0x455ee0[_0x107b('0x9')]===_0x107b('0xa')?_0x107b('0xb'):_0x455ee0['type'];this['countbusyretry']=_0x455ee0['countbusyretry'];this['countcongestionretry']=_0x455ee0[_0x107b('0xc')];this[_0x107b('0xd')]=_0x455ee0[_0x107b('0xd')];this['countglobal']=_0x455ee0[_0x107b('0xe')]+_0x455ee0['countcongestionretry']+_0x455ee0[_0x107b('0xd')]+_0x455ee0[_0x107b('0xf')]+_0x455ee0['countdropretry']+_0x455ee0[_0x107b('0x10')]+_0x455ee0[_0x107b('0x11')]+_0x455ee0[_0x107b('0x12')];this['countnosuchnumberretry']=_0x455ee0[_0x107b('0xf')];this[_0x107b('0x13')]=_0x455ee0[_0x107b('0x13')];this[_0x107b('0x10')]=_0x455ee0[_0x107b('0x10')];this[_0x107b('0x11')]=_0x455ee0[_0x107b('0x11')];this['countagentrejectretry']=_0x455ee0['countagentrejectretry'];this[_0x107b('0x14')]=_0x2e952d[_0x107b('0x14')];this[_0x107b('0x15')]=_0x455ee0['name'];this['calleridnum']=_0x455ee0[_0x107b('0x16')];this[_0x107b('0x17')]=_0x455ee0['starttime'];this['responsetime']=_0x455ee0['responsetime'];this[_0x107b('0x18')]=_0x455ee0[_0x107b('0x18')];this[_0x107b('0x19')]=moment()[_0x107b('0x1a')](_0x107b('0x1b'));this['ringtime']=getSeconds(_0x455ee0[_0x107b('0x1c')],_0x455ee0['starttime']);this[_0x107b('0x1d')]=getSeconds(_0x455ee0['answertime'],_0x455ee0[_0x107b('0x1c')]);this[_0x107b('0x1e')]=getSeconds(this['endtime'],_0x455ee0[_0x107b('0x18')]);this[_0x107b('0xb')]=_0x2e952d[_0x107b('0xb')];this[_0x107b('0x1f')]=_0x2e952d['membername'];this[_0x107b('0x20')]=_0x2e952d[_0x107b('0x20')];this[_0x107b('0x21')]=_0x455ee0[_0x107b('0x21')];this[_0x107b('0x22')]=_0x455ee0[_0x107b('0x22')];this[_0x107b('0x23')]=_0x455ee0['callbackat'];this[_0x107b('0x24')]=_0x455ee0[_0x107b('0x24')];this[_0x107b('0x25')]=_0x455ee0['ContactId'];this[_0x107b('0x26')]=_0x455ee0[_0x107b('0x26')];this[_0x107b('0x27')]=_0x455ee0[_0x107b('0x27')];this[_0x107b('0x28')]=_0x455ee0['VoiceQueueId'];this[_0x107b('0x29')]=_0x455ee0[_0x107b('0x29')];this[_0x107b('0x2a')]=_0x455ee0['originatecalleridnum']||'';this[_0x107b('0x2b')]=_0x455ee0[_0x107b('0x2b')]||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0x81fe=['name','calleridnum','number','starttime','responsetime','answertime','endtime','format','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','lodash','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname'];(function(_0x3cc5f8,_0x4dab3f){var _0x461cb1=function(_0x4daa6a){while(--_0x4daa6a){_0x3cc5f8['push'](_0x3cc5f8['shift']());}};_0x461cb1(++_0x4dab3f);}(_0x81fe,0x12b));var _0xe81f=function(_0x7a2692,_0x1b3e2b){_0x7a2692=_0x7a2692-0x0;var _0x589d9a=_0x81fe[_0x7a2692];return _0x589d9a;};'use strict';var util=require('util');var _=require(_0xe81f('0x0'));var moment=require(_0xe81f('0x1'));function getSeconds(_0x2a00df,_0xf96579){var _0x52430f=moment(_0x2a00df)[_0xe81f('0x2')](0x0);var _0x103c28=moment(_0xf96579)[_0xe81f('0x2')](0x0);return _0x52430f['diff'](_0x103c28,_0xe81f('0x3'));}function AgentComplete(_0x5bbb29,_0x329a72){this[_0xe81f('0x4')]=0x4;this[_0xe81f('0x5')]=_0xe81f('0x6');this['scheduledat']=_0x5bbb29[_0xe81f('0x7')];this['type']=_0x5bbb29[_0xe81f('0x8')];this[_0xe81f('0x9')]=_0x5bbb29['type']===_0xe81f('0xa')?_0xe81f('0xb'):_0x5bbb29[_0xe81f('0x8')];this['countbusyretry']=_0x5bbb29[_0xe81f('0xc')];this[_0xe81f('0xd')]=_0x5bbb29['countcongestionretry'];this[_0xe81f('0xe')]=_0x5bbb29[_0xe81f('0xe')];this[_0xe81f('0xf')]=_0x5bbb29[_0xe81f('0xc')]+_0x5bbb29[_0xe81f('0xd')]+_0x5bbb29[_0xe81f('0xe')]+_0x5bbb29[_0xe81f('0x10')]+_0x5bbb29[_0xe81f('0x11')]+_0x5bbb29[_0xe81f('0x12')]+_0x5bbb29[_0xe81f('0x13')]+_0x5bbb29[_0xe81f('0x14')];this[_0xe81f('0x10')]=_0x5bbb29[_0xe81f('0x10')];this[_0xe81f('0x11')]=_0x5bbb29[_0xe81f('0x11')];this[_0xe81f('0x12')]=_0x5bbb29[_0xe81f('0x12')];this[_0xe81f('0x13')]=_0x5bbb29[_0xe81f('0x13')];this[_0xe81f('0x14')]=_0x5bbb29['countagentrejectretry'];this['uniqueid']=_0x329a72[_0xe81f('0x15')];this[_0xe81f('0x16')]=_0x5bbb29[_0xe81f('0x17')];this[_0xe81f('0x18')]=_0x5bbb29[_0xe81f('0x19')];this['starttime']=_0x5bbb29[_0xe81f('0x1a')];this[_0xe81f('0x1b')]=_0x5bbb29['responsetime'];this['answertime']=_0x5bbb29[_0xe81f('0x1c')];this[_0xe81f('0x1d')]=moment()[_0xe81f('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xe81f('0x1f')]=getSeconds(_0x5bbb29['responsetime'],_0x5bbb29['starttime']);this[_0xe81f('0x20')]=getSeconds(_0x5bbb29[_0xe81f('0x1c')],_0x5bbb29[_0xe81f('0x1b')]);this[_0xe81f('0x21')]=getSeconds(this['endtime'],_0x5bbb29[_0xe81f('0x1c')]);this[_0xe81f('0xb')]=_0x329a72[_0xe81f('0xb')];this['membername']=_0x329a72[_0xe81f('0x22')];this[_0xe81f('0x23')]=_0x329a72[_0xe81f('0x23')];this[_0xe81f('0x24')]=_0x5bbb29[_0xe81f('0x24')];this[_0xe81f('0x25')]=_0x5bbb29[_0xe81f('0x25')];this[_0xe81f('0x26')]=_0x5bbb29[_0xe81f('0x26')];this[_0xe81f('0x27')]=_0x5bbb29[_0xe81f('0x27')];this[_0xe81f('0x28')]=_0x5bbb29[_0xe81f('0x28')];this[_0xe81f('0x29')]=_0x5bbb29[_0xe81f('0x29')];this['UserId']=_0x5bbb29[_0xe81f('0x2a')];this[_0xe81f('0x2b')]=_0x5bbb29['VoiceQueueId'];this[_0xe81f('0x2c')]=_0x5bbb29[_0xe81f('0x2c')];this['originatecalleridnum']=_0x5bbb29['originatecalleridnum']||'';this['originatecalleridname']=_0x5bbb29[_0xe81f('0x2d')]||'';}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 7cc3836..0d5350b 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 _0xb4c7=['countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x2deefc,_0x5dd96e){var _0x451b28=function(_0x52e88e){while(--_0x52e88e){_0x2deefc['push'](_0x2deefc['shift']());}};_0x451b28(++_0x5dd96e);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x48ed88,_0x3d3d39){_0x48ed88=_0x48ed88-0x0;var _0x4a5b87=_0xb4c7[_0x48ed88];return _0x4a5b87;};'use strict';var util=require(_0x7b4c('0x0'));var _=require(_0x7b4c('0x1'));var moment=require(_0x7b4c('0x2'));function getSeconds(_0xa0d9f1,_0x286a79){var _0x4bef48=moment(_0xa0d9f1)[_0x7b4c('0x3')](0x0);var _0x149d55=moment(_0x286a79)[_0x7b4c('0x3')](0x0);return _0x4bef48[_0x7b4c('0x4')](_0x149d55,_0x7b4c('0x5'));}function Final(_0x5adec9){this[_0x7b4c('0x6')]=_0x5adec9[_0x7b4c('0x6')];this[_0x7b4c('0x7')]=_0x5adec9['scheduledat'];this[_0x7b4c('0x8')]=_0x5adec9[_0x7b4c('0x8')];this['campaigntype']=_0x5adec9[_0x7b4c('0x8')]===_0x7b4c('0x9')?_0x7b4c('0xa'):_0x5adec9[_0x7b4c('0x8')];this[_0x7b4c('0xb')]=_0x5adec9[_0x7b4c('0xb')];this[_0x7b4c('0xc')]=_0x5adec9[_0x7b4c('0xc')];this[_0x7b4c('0xd')]=_0x5adec9[_0x7b4c('0xd')];this['countglobal']=_0x5adec9['countbusyretry']+_0x5adec9[_0x7b4c('0xc')]+_0x5adec9[_0x7b4c('0xd')]+_0x5adec9[_0x7b4c('0xe')]+_0x5adec9[_0x7b4c('0xf')]+_0x5adec9[_0x7b4c('0x10')]+_0x5adec9[_0x7b4c('0x11')]+_0x5adec9[_0x7b4c('0x12')];this[_0x7b4c('0xe')]=_0x5adec9[_0x7b4c('0xe')];this[_0x7b4c('0xf')]=_0x5adec9['countdropretry'];this[_0x7b4c('0x10')]=_0x5adec9[_0x7b4c('0x10')];this[_0x7b4c('0x11')]=_0x5adec9[_0x7b4c('0x11')];this[_0x7b4c('0x12')]=_0x5adec9[_0x7b4c('0x12')];this[_0x7b4c('0xa')]=_0x5adec9[_0x7b4c('0xa')];this['calleridname']=_0x5adec9[_0x7b4c('0x13')];this[_0x7b4c('0x14')]=_0x5adec9[_0x7b4c('0x14')];this[_0x7b4c('0x15')]=_0x5adec9['starttime'];this[_0x7b4c('0x16')]=_0x5adec9[_0x7b4c('0x16')];this[_0x7b4c('0x17')]=_0x5adec9[_0x7b4c('0x16')];this[_0x7b4c('0x18')]=_0x5adec9[_0x7b4c('0x18')]||0x0;this[_0x7b4c('0x19')]=_0x5adec9[_0x7b4c('0x19')]||0x0;this[_0x7b4c('0x1a')]=_0x5adec9['talktime']||0x0;this[_0x7b4c('0x1b')]=_0x5adec9[_0x7b4c('0x1b')];this[_0x7b4c('0x1c')]=_0x5adec9[_0x7b4c('0x1c')];this[_0x7b4c('0x1d')]=_0x5adec9[_0x7b4c('0x1d')];this[_0x7b4c('0x1e')]=_0x5adec9[_0x7b4c('0x1e')];this[_0x7b4c('0x1f')]=_0x5adec9[_0x7b4c('0x1f')];this['ListId']=_0x5adec9[_0x7b4c('0x20')];this[_0x7b4c('0x21')]=_0x5adec9[_0x7b4c('0x21')];this[_0x7b4c('0x22')]=_0x5adec9[_0x7b4c('0x22')];this[_0x7b4c('0x23')]=_0x5adec9[_0x7b4c('0x23')];this[_0x7b4c('0x24')]=_0x5adec9[_0x7b4c('0x24')]||'';this[_0x7b4c('0x25')]=_0x5adec9[_0x7b4c('0x25')]||'';}module[_0x7b4c('0x26')]=Final; \ No newline at end of file +var _0x6aa7=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x228a08,_0x534024){var _0x49edae=function(_0x159aa4){while(--_0x159aa4){_0x228a08['push'](_0x228a08['shift']());}};_0x49edae(++_0x534024);}(_0x6aa7,0x178));var _0x76aa=function(_0x4e9994,_0x14ed5c){_0x4e9994=_0x4e9994-0x0;var _0x5a1cd9=_0x6aa7[_0x4e9994];return _0x5a1cd9;};'use strict';var util=require(_0x76aa('0x0'));var _=require('lodash');var moment=require(_0x76aa('0x1'));function getSeconds(_0xe07754,_0x25c818){var _0x2db4fe=moment(_0xe07754)['milliseconds'](0x0);var _0x13f62b=moment(_0x25c818)[_0x76aa('0x2')](0x0);return _0x2db4fe[_0x76aa('0x3')](_0x13f62b,'seconds');}function Final(_0x588e62){this[_0x76aa('0x4')]=_0x588e62['uniqueid'];this[_0x76aa('0x5')]=_0x588e62[_0x76aa('0x5')];this[_0x76aa('0x6')]=_0x588e62['type'];this[_0x76aa('0x7')]=_0x588e62[_0x76aa('0x6')]===_0x76aa('0x8')?'queue':_0x588e62[_0x76aa('0x6')];this[_0x76aa('0x9')]=_0x588e62[_0x76aa('0x9')];this[_0x76aa('0xa')]=_0x588e62[_0x76aa('0xa')];this[_0x76aa('0xb')]=_0x588e62[_0x76aa('0xb')];this[_0x76aa('0xc')]=_0x588e62[_0x76aa('0x9')]+_0x588e62[_0x76aa('0xa')]+_0x588e62['countnoanswerretry']+_0x588e62[_0x76aa('0xd')]+_0x588e62['countdropretry']+_0x588e62[_0x76aa('0xe')]+_0x588e62[_0x76aa('0xf')]+_0x588e62[_0x76aa('0x10')];this[_0x76aa('0xd')]=_0x588e62[_0x76aa('0xd')];this['countdropretry']=_0x588e62['countdropretry'];this[_0x76aa('0xe')]=_0x588e62['countabandonedretry'];this[_0x76aa('0xf')]=_0x588e62[_0x76aa('0xf')];this['countagentrejectretry']=_0x588e62[_0x76aa('0x10')];this['queue']=_0x588e62[_0x76aa('0x11')];this['calleridname']=_0x588e62[_0x76aa('0x12')];this[_0x76aa('0x13')]=_0x588e62[_0x76aa('0x13')];this[_0x76aa('0x14')]=_0x588e62[_0x76aa('0x14')];this[_0x76aa('0x15')]=_0x588e62['responsetime'];this['endtime']=_0x588e62[_0x76aa('0x15')];this[_0x76aa('0x16')]=_0x588e62[_0x76aa('0x16')]||0x0;this[_0x76aa('0x17')]=_0x588e62[_0x76aa('0x17')]||0x0;this[_0x76aa('0x18')]=_0x588e62[_0x76aa('0x18')]||0x0;this[_0x76aa('0x19')]=_0x588e62[_0x76aa('0x19')];this['callbackuniqueid']=_0x588e62[_0x76aa('0x1a')];this[_0x76aa('0x1b')]=_0x588e62[_0x76aa('0x1b')];this['recallme']=_0x588e62[_0x76aa('0x1c')];this[_0x76aa('0x1d')]=_0x588e62[_0x76aa('0x1d')];this[_0x76aa('0x1e')]=_0x588e62[_0x76aa('0x1e')];this[_0x76aa('0x1f')]=_0x588e62[_0x76aa('0x1f')];this[_0x76aa('0x20')]=_0x588e62[_0x76aa('0x20')];this[_0x76aa('0x21')]=_0x588e62[_0x76aa('0x21')];this[_0x76aa('0x22')]=_0x588e62[_0x76aa('0x22')]||'';this['originatecalleridname']=_0x588e62[_0x76aa('0x23')]||'';}module[_0x76aa('0x24')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 6bac00a..5159835 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 _0x2ff8=['recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','milliseconds','diff','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countdropretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','endtime','membername','IVR','reason','callback','callbackuniqueid','callbackat'];(function(_0x1a9a10,_0x3c264){var _0x3dc0bf=function(_0x1ace8c){while(--_0x1ace8c){_0x1a9a10['push'](_0x1a9a10['shift']());}};_0x3dc0bf(++_0x3c264);}(_0x2ff8,0x87));var _0x82ff=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x2ff8[_0x424a9a];return _0xa7831c;};'use strict';var util=require(_0x82ff('0x0'));var _=require(_0x82ff('0x1'));var moment=require('moment');function getSeconds(_0x464ba7,_0x4aefae){var _0x54ea49=moment(_0x464ba7)[_0x82ff('0x2')](0x0);var _0x43707e=moment(_0x4aefae)['milliseconds'](0x0);return _0x54ea49[_0x82ff('0x3')](_0x43707e,'seconds');}function Hangup(_0x190cae,_0x4baf8a){this[_0x82ff('0x4')]=0x4;this[_0x82ff('0x5')]=_0x82ff('0x6');this[_0x82ff('0x7')]=_0x190cae[_0x82ff('0x7')];this[_0x82ff('0x8')]=_0x190cae[_0x82ff('0x8')];this[_0x82ff('0x9')]=_0x190cae[_0x82ff('0x8')]==='outbound'?_0x82ff('0xa'):_0x190cae[_0x82ff('0x8')];this[_0x82ff('0xb')]=_0x190cae[_0x82ff('0xb')];this[_0x82ff('0xc')]=_0x190cae['countcongestionretry'];this[_0x82ff('0xd')]=_0x190cae[_0x82ff('0xd')];this['countglobal']=_0x190cae[_0x82ff('0xb')]+_0x190cae['countcongestionretry']+_0x190cae[_0x82ff('0xd')]+_0x190cae['countnosuchnumberretry']+_0x190cae['countdropretry']+_0x190cae[_0x82ff('0xe')]+_0x190cae['countmachineretry']+_0x190cae[_0x82ff('0xf')];this[_0x82ff('0x10')]=_0x190cae[_0x82ff('0x10')];this[_0x82ff('0x11')]=_0x190cae[_0x82ff('0x11')];this[_0x82ff('0xe')]=_0x190cae[_0x82ff('0xe')];this[_0x82ff('0x12')]=_0x190cae[_0x82ff('0x12')];this['countagentrejectretry']=_0x190cae[_0x82ff('0xf')];this[_0x82ff('0x13')]=_0x4baf8a[_0x82ff('0x13')];this[_0x82ff('0x14')]=_0x190cae[_0x82ff('0x15')];this[_0x82ff('0x16')]=_0x190cae[_0x82ff('0x17')];this['starttime']=_0x190cae[_0x82ff('0x18')];this[_0x82ff('0x19')]=_0x190cae[_0x82ff('0x19')];this['endtime']=moment()[_0x82ff('0x1a')](_0x82ff('0x1b'));this[_0x82ff('0x1c')]=getSeconds(_0x190cae[_0x82ff('0x19')],_0x190cae['starttime']);this[_0x82ff('0x1d')]=0x0;this['talktime']=getSeconds(this[_0x82ff('0x1e')],_0x190cae[_0x82ff('0x19')]);this['queue']=_0x190cae[_0x82ff('0xa')];this[_0x82ff('0x1f')]=_0x82ff('0x20');this[_0x82ff('0x21')]=_0x4baf8a['cause-txt'];this['callback']=_0x190cae[_0x82ff('0x22')];this[_0x82ff('0x23')]=_0x190cae[_0x82ff('0x23')];this[_0x82ff('0x24')]=_0x190cae[_0x82ff('0x24')];this[_0x82ff('0x25')]=_0x190cae[_0x82ff('0x25')];this[_0x82ff('0x26')]=_0x190cae[_0x82ff('0x26')];this['ListId']=_0x190cae['ListId'];this[_0x82ff('0x27')]=_0x190cae[_0x82ff('0x27')];this[_0x82ff('0x28')]=_0x190cae['VoiceQueueId'];this[_0x82ff('0x29')]=_0x190cae[_0x82ff('0x29')];}module[_0x82ff('0x2a')]=Hangup; \ No newline at end of file +var _0x76da=['countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','YYYY-MM-DD\x20HH:mm:ss','queue','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry'];(function(_0x2f1114,_0x4561f1){var _0x2fe856=function(_0x8397f8){while(--_0x8397f8){_0x2f1114['push'](_0x2f1114['shift']());}};_0x2fe856(++_0x4561f1);}(_0x76da,0x11c));var _0xa76d=function(_0x2d7045,_0x3d1fa4){_0x2d7045=_0x2d7045-0x0;var _0x175b8e=_0x76da[_0x2d7045];return _0x175b8e;};'use strict';var util=require(_0xa76d('0x0'));var _=require(_0xa76d('0x1'));var moment=require(_0xa76d('0x2'));function getSeconds(_0x21b293,_0x1a9fbc){var _0x47d8e6=moment(_0x21b293)[_0xa76d('0x3')](0x0);var _0x1e2516=moment(_0x1a9fbc)[_0xa76d('0x3')](0x0);return _0x47d8e6[_0xa76d('0x4')](_0x1e2516,_0xa76d('0x5'));}function Hangup(_0x40df7b,_0x19bd78){this[_0xa76d('0x6')]=0x4;this['statedesc']=_0xa76d('0x7');this[_0xa76d('0x8')]=_0x40df7b[_0xa76d('0x8')];this[_0xa76d('0x9')]=_0x40df7b[_0xa76d('0x9')];this[_0xa76d('0xa')]=_0x40df7b[_0xa76d('0x9')]===_0xa76d('0xb')?'queue':_0x40df7b['type'];this[_0xa76d('0xc')]=_0x40df7b[_0xa76d('0xc')];this[_0xa76d('0xd')]=_0x40df7b[_0xa76d('0xd')];this[_0xa76d('0xe')]=_0x40df7b[_0xa76d('0xe')];this[_0xa76d('0xf')]=_0x40df7b[_0xa76d('0xc')]+_0x40df7b[_0xa76d('0xd')]+_0x40df7b[_0xa76d('0xe')]+_0x40df7b[_0xa76d('0x10')]+_0x40df7b[_0xa76d('0x11')]+_0x40df7b['countabandonedretry']+_0x40df7b[_0xa76d('0x12')]+_0x40df7b[_0xa76d('0x13')];this['countnosuchnumberretry']=_0x40df7b['countnosuchnumberretry'];this[_0xa76d('0x11')]=_0x40df7b[_0xa76d('0x11')];this[_0xa76d('0x14')]=_0x40df7b['countabandonedretry'];this[_0xa76d('0x12')]=_0x40df7b[_0xa76d('0x12')];this[_0xa76d('0x13')]=_0x40df7b[_0xa76d('0x13')];this[_0xa76d('0x15')]=_0x19bd78[_0xa76d('0x15')];this[_0xa76d('0x16')]=_0x40df7b['name'];this[_0xa76d('0x17')]=_0x40df7b[_0xa76d('0x18')];this['starttime']=_0x40df7b[_0xa76d('0x19')];this[_0xa76d('0x1a')]=_0x40df7b[_0xa76d('0x1a')];this['endtime']=moment()['format'](_0xa76d('0x1b'));this['ringtime']=getSeconds(_0x40df7b[_0xa76d('0x1a')],_0x40df7b[_0xa76d('0x19')]);this['holdtime']=0x0;this['talktime']=getSeconds(this['endtime'],_0x40df7b['responsetime']);this['queue']=_0x40df7b[_0xa76d('0x1c')];this[_0xa76d('0x1d')]=_0xa76d('0x1e');this[_0xa76d('0x1f')]=_0x19bd78[_0xa76d('0x20')];this['callback']=_0x40df7b[_0xa76d('0x21')];this[_0xa76d('0x22')]=_0x40df7b[_0xa76d('0x22')];this[_0xa76d('0x23')]=_0x40df7b['callbackat'];this[_0xa76d('0x24')]=_0x40df7b[_0xa76d('0x24')];this['ContactId']=_0x40df7b[_0xa76d('0x25')];this[_0xa76d('0x26')]=_0x40df7b[_0xa76d('0x26')];this[_0xa76d('0x27')]=_0x40df7b[_0xa76d('0x27')];this['VoiceQueueId']=_0x40df7b[_0xa76d('0x28')];this[_0xa76d('0x29')]=_0x40df7b[_0xa76d('0x29')];}module[_0xa76d('0x2a')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index a5ec3fd..30c783e 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 _0xa45b=['uniqueid','scheduledat','type','outbound','queue','countcongestionretry','countnoanswerretry','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','number','starttime','responsetime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds'];(function(_0x590851,_0x496bee){var _0x3b0115=function(_0x5140cc){while(--_0x5140cc){_0x590851['push'](_0x590851['shift']());}};_0x3b0115(++_0x496bee);}(_0xa45b,0x1aa));var _0xba45=function(_0x158dae,_0x5c951b){_0x158dae=_0x158dae-0x0;var _0x584b7a=_0xa45b[_0x158dae];return _0x584b7a;};'use strict';var util=require(_0xba45('0x0'));var _=require(_0xba45('0x1'));var moment=require(_0xba45('0x2'));function getSeconds(_0x21468a,_0x68ccce){var _0x1d30bd=moment(_0x21468a)[_0xba45('0x3')](0x0);var _0x250ed0=moment(_0x68ccce)[_0xba45('0x3')](0x0);return _0x1d30bd[_0xba45('0x4')](_0x250ed0,_0xba45('0x5'));}function History(_0xd5429a){this[_0xba45('0x6')]=_0xd5429a[_0xba45('0x6')];this[_0xba45('0x7')]=_0xd5429a[_0xba45('0x7')]||undefined;this[_0xba45('0x8')]=_0xd5429a[_0xba45('0x8')];this['campaigntype']=_0xd5429a[_0xba45('0x8')]===_0xba45('0x9')?_0xba45('0xa'):_0xd5429a[_0xba45('0x8')];this['countbusyretry']=_0xd5429a['countbusyretry'];this['countcongestionretry']=_0xd5429a[_0xba45('0xb')];this[_0xba45('0xc')]=_0xd5429a[_0xba45('0xc')];this['countglobal']=_0xd5429a[_0xba45('0xd')]+_0xd5429a[_0xba45('0xb')]+_0xd5429a[_0xba45('0xc')]+_0xd5429a[_0xba45('0xe')]+_0xd5429a[_0xba45('0xf')]+_0xd5429a[_0xba45('0x10')]+_0xd5429a[_0xba45('0x11')]+_0xd5429a[_0xba45('0x12')];this[_0xba45('0xe')]=_0xd5429a[_0xba45('0xe')];this['countdropretry']=_0xd5429a[_0xba45('0xf')];this[_0xba45('0x10')]=_0xd5429a['countabandonedretry'];this[_0xba45('0x11')]=_0xd5429a[_0xba45('0x11')];this[_0xba45('0x12')]=_0xd5429a['countagentrejectretry'];this['queue']=_0xd5429a[_0xba45('0xa')];this[_0xba45('0x13')]=_0xd5429a[_0xba45('0x14')];this['calleridnum']=_0xd5429a[_0xba45('0x15')];this['starttime']=_0xd5429a[_0xba45('0x16')];this['responsetime']=_0xd5429a[_0xba45('0x17')];this['endtime']=_0xd5429a[_0xba45('0x17')];this['ringtime']=getSeconds(_0xd5429a[_0xba45('0x17')],_0xd5429a[_0xba45('0x16')]);this['holdtime']=0x0;this[_0xba45('0x18')]=0x0;this[_0xba45('0x19')]=_0xd5429a[_0xba45('0x19')];this['callbackuniqueid']=_0xd5429a[_0xba45('0x1a')];this[_0xba45('0x1b')]=_0xd5429a[_0xba45('0x1b')];this['recallme']=_0xd5429a[_0xba45('0x1c')];this[_0xba45('0x1d')]=_0xd5429a[_0xba45('0x1d')];this[_0xba45('0x1e')]=_0xd5429a['ListId'];this[_0xba45('0x1f')]=_0xd5429a['UserId'];this[_0xba45('0x20')]=_0xd5429a[_0xba45('0x20')];this[_0xba45('0x21')]=_0xd5429a[_0xba45('0x21')];this[_0xba45('0x22')]=_0xd5429a[_0xba45('0x22')]||'';this[_0xba45('0x23')]=_0xd5429a[_0xba45('0x23')]||'';}module['exports']=History; \ No newline at end of file +var _0x10f2=['moment','seconds','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash'];(function(_0x2825ae,_0x47550e){var _0x4601fe=function(_0x5c2346){while(--_0x5c2346){_0x2825ae['push'](_0x2825ae['shift']());}};_0x4601fe(++_0x47550e);}(_0x10f2,0xc1));var _0x210f=function(_0x33599f,_0x3e581b){_0x33599f=_0x33599f-0x0;var _0x26bef9=_0x10f2[_0x33599f];return _0x26bef9;};'use strict';var util=require(_0x210f('0x0'));var _=require(_0x210f('0x1'));var moment=require(_0x210f('0x2'));function getSeconds(_0x24d098,_0x3cda36){var _0x2ee352=moment(_0x24d098)['milliseconds'](0x0);var _0x4f7031=moment(_0x3cda36)['milliseconds'](0x0);return _0x2ee352['diff'](_0x4f7031,_0x210f('0x3'));}function History(_0x4997b1){this['uniqueid']=_0x4997b1['uniqueid'];this[_0x210f('0x4')]=_0x4997b1[_0x210f('0x4')]||undefined;this['type']=_0x4997b1['type'];this['campaigntype']=_0x4997b1[_0x210f('0x5')]===_0x210f('0x6')?'queue':_0x4997b1[_0x210f('0x5')];this[_0x210f('0x7')]=_0x4997b1[_0x210f('0x7')];this[_0x210f('0x8')]=_0x4997b1[_0x210f('0x8')];this[_0x210f('0x9')]=_0x4997b1[_0x210f('0x9')];this[_0x210f('0xa')]=_0x4997b1[_0x210f('0x7')]+_0x4997b1[_0x210f('0x8')]+_0x4997b1[_0x210f('0x9')]+_0x4997b1[_0x210f('0xb')]+_0x4997b1[_0x210f('0xc')]+_0x4997b1[_0x210f('0xd')]+_0x4997b1[_0x210f('0xe')]+_0x4997b1[_0x210f('0xf')];this[_0x210f('0xb')]=_0x4997b1[_0x210f('0xb')];this[_0x210f('0xc')]=_0x4997b1[_0x210f('0xc')];this[_0x210f('0xd')]=_0x4997b1['countabandonedretry'];this[_0x210f('0xe')]=_0x4997b1[_0x210f('0xe')];this['countagentrejectretry']=_0x4997b1[_0x210f('0xf')];this[_0x210f('0x10')]=_0x4997b1[_0x210f('0x10')];this[_0x210f('0x11')]=_0x4997b1[_0x210f('0x12')];this[_0x210f('0x13')]=_0x4997b1[_0x210f('0x14')];this['starttime']=_0x4997b1[_0x210f('0x15')];this[_0x210f('0x16')]=_0x4997b1['responsetime'];this[_0x210f('0x17')]=_0x4997b1['responsetime'];this[_0x210f('0x18')]=getSeconds(_0x4997b1['responsetime'],_0x4997b1[_0x210f('0x15')]);this[_0x210f('0x19')]=0x0;this[_0x210f('0x1a')]=0x0;this[_0x210f('0x1b')]=_0x4997b1[_0x210f('0x1b')];this[_0x210f('0x1c')]=_0x4997b1[_0x210f('0x1c')];this[_0x210f('0x1d')]=_0x4997b1[_0x210f('0x1d')];this[_0x210f('0x1e')]=_0x4997b1[_0x210f('0x1e')];this[_0x210f('0x1f')]=_0x4997b1[_0x210f('0x1f')];this[_0x210f('0x20')]=_0x4997b1[_0x210f('0x20')];this[_0x210f('0x21')]=_0x4997b1[_0x210f('0x21')];this[_0x210f('0x22')]=_0x4997b1[_0x210f('0x22')];this['CampaignId']=_0x4997b1[_0x210f('0x23')];this[_0x210f('0x24')]=_0x4997b1[_0x210f('0x24')]||'';this[_0x210f('0x25')]=_0x4997b1[_0x210f('0x25')]||'';}module[_0x210f('0x26')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index cdd0c84..99347f8 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 _0x8b4d=['reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','round','predictiveIntervalMinThreshold','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','averageHandleTime','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','dialRecallInQueue','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','handleIvr','limitCalls','dialOrderByScheduledAt','RUNNING','emptyContact','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[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','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','[abandonmentRate]','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\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','[busyFactor]','m\x20=\x20','Ts\x20=\x20','lodash','bluebird','uuid','moment','md5','ioredis','../preview/util/util','../../../config/logger','dialer','predictive','predictiveCalls','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./final','./agentComplete','./queueCallerAbandon','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','hangup','newexten','syncNewExten','varset','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','seconds','emit','type','available','loggedIn','pTalking','sumDuration','sumHoldTime','unmanaged','abandoned','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','format','voice:queue:%s','voice_queue:save','ivr','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','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','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','diff','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','outbound','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','originated','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','waiting','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','state','statedesc','endtime','starttime','prototype','clearZombieChannels','[uniqueid]','[actions]','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','saveInDb','pick','ContactId','ListId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','reachable','SIP/%s','unmonitored','uniqueid','variable','amdstatus','exten','value','HANGUP','outboundAnswerCallsDay','membername','AMD','custom:amd','buildObj','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','MACHINE','countmachineretry','countglobal','amd','[syncAgentComplete][createHistory][0]','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','VoiceQueueId','HangupInAMD','[syncHangupInAMDIvr][createHistory]','Machine','countbusyretry','createStateFinal','[rescheduleContact][Machine]','syncHangup','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr][createHistory]','[syncHangupIvr]','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','droptime','Drop','dropreason','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','[syncAgentComplete][createHistory][11]','actions','actionid','locked','paused','stateinterface','queueBooked','queueStatusComplete','strategy','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','loopCampaigns','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','push','command','iftime\x20%s,%s','interval','indexOf','true','content','some','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','progressive','power','handlePower','booked','Queue','launchHandleIvr','dialActive','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','pow','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','Contact','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','dialAgiAfterHangupAgent','dialQueueTimeout','getCaller','ACTIVE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','createdAt','updatedAt','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridnum','SIP/%s/%s%s','dialPrefix','trim','substring','dialCutDigit','OriginateError','[originate][error]','originate\x20action\x20Error','responsetime','response','[callProgressDetecting]\x20','checkRetriveMax','countagentrejectretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[rescheduleContact][AgentReject]','[callProgressDetecting]','outboundNoSuchCallsDay','NoSuchNumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','noanswer'];(function(_0x41a0e7,_0x235086){var _0x2fca41=function(_0x34f323){while(--_0x34f323){_0x41a0e7['push'](_0x41a0e7['shift']());}};_0x2fca41(++_0x235086);}(_0x8b4d,0x6d));var _0xd8b4=function(_0x421263,_0x18187d){_0x421263=_0x421263-0x0;var _0x34e4b5=_0x8b4d[_0x421263];return _0x34e4b5;};'use strict';var util=require('util');var _=require(_0xd8b4('0x0'));var BPromise=require(_0xd8b4('0x1'));var uuid=require(_0xd8b4('0x2'));var moment=require(_0xd8b4('0x3'));var rr=require('rr');var md5=require(_0xd8b4('0x4'));var Redis=require(_0xd8b4('0x5'));var ut=require(_0xd8b4('0x6'));var config=require('../../../config/environment/');var logger=require(_0xd8b4('0x7'))(_0xd8b4('0x8'));var loggerBooked=require(_0xd8b4('0x7'))('booked');var loggerPredictive=require(_0xd8b4('0x7'))(_0xd8b4('0x9'));var loggerPredictiveCalls=require(_0xd8b4('0x7'))(_0xd8b4('0xa'));var loggerSyncQueueSummary=require(_0xd8b4('0x7'))('syncQueueSummary');var ami=require('../ami');config[_0xd8b4('0xb')]=_['defaults'](config[_0xd8b4('0xb')],{'host':_0xd8b4('0xc'),'port':0x18eb});var io=require(_0xd8b4('0xd'))(new Redis(config['redis']));var cmHopper=require(_0xd8b4('0xe'));var cmHopperHistory=require(_0xd8b4('0xf'));var cmHopperBlack=require(_0xd8b4('0x10'));var voiceQueueRt=require(_0xd8b4('0x11'));var Action=require('./action');var History=require('./history');var Final=require(_0xd8b4('0x12'));var AgentComplete=require(_0xd8b4('0x13'));var QueueCallerAbandon=require(_0xd8b4('0x14'));var Hangup=require('./hangup');var ipAgi=process['env'][_0xd8b4('0x15')]||_0xd8b4('0x16');var strategy={'rrmemory':_0xd8b4('0x17'),'roundrobin':_0xd8b4('0x18')};var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x4ebb42){this[_0xd8b4('0x19')]=this[_0xd8b4('0x19')]?this[_0xd8b4('0x19')][_0xd8b4('0x1a')](_0x4ebb42):_0x4ebb42();};function Dialer(_0x8f39f8,_0x251a4b){this[_0xd8b4('0x1b')]=new Sequence();this['preview']=_0x251a4b;this['voiceQueues']=_0x8f39f8[_0xd8b4('0x1c')];this[_0xd8b4('0x1d')]=_0x8f39f8['campaigns'];this['agents']=_0x8f39f8[_0xd8b4('0x1e')];this[_0xd8b4('0x1f')]=_0x8f39f8[_0xd8b4('0x1f')];this[_0xd8b4('0x20')]=config[_0xd8b4('0x20')]||0x2;this[_0xd8b4('0x21')]={};this['actions']={};this[_0xd8b4('0x22')]={};this[_0xd8b4('0x23')]={};this[_0xd8b4('0x24')]={};this[_0xd8b4('0x25')]={};this[_0xd8b4('0x26')]={};this[_0xd8b4('0x27')]={};this['queueBooked']={};this['queueBookedRR']={};ami['on'](_0xd8b4('0x28'),this[_0xd8b4('0x29')]['bind'](this));ami['on'](_0xd8b4('0x2a'),this[_0xd8b4('0x2b')][_0xd8b4('0x2c')](this));ami['on'](_0xd8b4('0x2d'),this[_0xd8b4('0x2e')][_0xd8b4('0x2c')](this));ami['on'](_0xd8b4('0x2f'),this[_0xd8b4('0x30')][_0xd8b4('0x2c')](this));ami['on'](_0xd8b4('0x31'),this[_0xd8b4('0x32')]['bind'](this));ami['on'](_0xd8b4('0x33'),this['syncHangup'][_0xd8b4('0x2c')](this));ami['on'](_0xd8b4('0x34'),this[_0xd8b4('0x35')][_0xd8b4('0x2c')](this));ami['on'](_0xd8b4('0x36'),this[_0xd8b4('0x37')]['bind'](this));ami['on'](_0xd8b4('0x38'),this['syncQueueMember'][_0xd8b4('0x2c')](this));ami['on'](_0xd8b4('0x39'),this[_0xd8b4('0x3a')]['bind'](this));this['loopCampaigns']();this[_0xd8b4('0x3b')]();}function isNotNull(_0x238d55){return _0x238d55!==null&&!_[_0xd8b4('0x3c')](_0x238d55);}function checkIsLoggedIn(_0x408113,_0x2ef2c3){return function(){if(_0x2ef2c3<=0x0){_0x408113[_0xd8b4('0x3d')]=_0xd8b4('0x3e');throw _0x408113[_0xd8b4('0x3f')]+_0xd8b4('0x40');}};}function isActive(_0xd18358){return _0xd18358;}function checkIsActive(_0x4e702c,_0x5299e7){return function(){if(!isActive(_0x5299e7)){_0x4e702c[_0xd8b4('0x3d')]=_0xd8b4('0x41');throw _0x4e702c['name']+_0xd8b4('0x42');}};}function checkInterval(_0x4f5815){return function(){if(!isNotNull(_0x4f5815[_0xd8b4('0x43')])){_0x4f5815[_0xd8b4('0x3d')]=_0xd8b4('0x44');throw _0x4f5815[_0xd8b4('0x3f')]+_0xd8b4('0x45');}if(!isNotNull(_0x4f5815[_0xd8b4('0x43')][_0xd8b4('0x46')])){_0x4f5815['message']='INTERVAL_IS_NULL';throw _0x4f5815['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xd8b4('0x47')](_0x4f5815[_0xd8b4('0x43')][_0xd8b4('0x46')]))){_0x4f5815[_0xd8b4('0x3d')]=_0xd8b4('0x44');throw _0x4f5815[_0xd8b4('0x3f')]+_0xd8b4('0x45');}};}function msgResponse(_0x5094fa,_0x22ba0d,_0x21e8a3){return{'action':_0x5094fa,'response':_0x22ba0d,'message':_0x21e8a3,'stack':_0x21e8a3};}function myreject(_0xc6cd0f){return function(_0x293343){return _0xc6cd0f(msgResponse(_0xd8b4('0x48'),_0xd8b4('0x49'),JSON[_0xd8b4('0x4a')](_0x293343)));};}function getSeconds(_0x36b931,_0x5eb32c){var _0x44a6b7=moment(_0x36b931)[_0xd8b4('0x4b')](0x0);var _0x2815e7=moment(_0x5eb32c)[_0xd8b4('0x4b')](0x0);return _0x44a6b7['diff'](_0x2815e7,_0xd8b4('0x4c'));}function emit(_0x339160,_0x463c40,_0x4ff7f0){io['to'](_0x339160)[_0xd8b4('0x4d')](_0x463c40,_0x4ff7f0);}function emitVoiceQueueSummary(_0x3a0930){if(_0x3a0930[_0xd8b4('0x4e')]==='outbound'){var _0x5b0540={'id':_0x3a0930['id'],'name':_0x3a0930[_0xd8b4('0x3f')],'strategy':_0x3a0930['strategy'],'answered':_0x3a0930['answered'],'available':_0x3a0930[_0xd8b4('0x4f')],'loggedIn':_0x3a0930[_0xd8b4('0x50')],'pTalking':_0x3a0930[_0xd8b4('0x51')],'sumBillable':_0x3a0930['sumBillable'],'sumDuration':_0x3a0930[_0xd8b4('0x52')],'sumHoldTime':_0x3a0930[_0xd8b4('0x53')]||0x0,'talking':_0x3a0930['talking'],'total':_0x3a0930['total'],'type':_0x3a0930[_0xd8b4('0x4e')],'unmanaged':_0x3a0930[_0xd8b4('0x54')],'abandoned':_0x3a0930[_0xd8b4('0x55')],'waiting':_0x3a0930['waiting'],'loggedInDb':_0x3a0930[_0xd8b4('0x56')],'dialActive':_0x3a0930['dialActive'],'dialMethod':_0x3a0930[_0xd8b4('0x57')],'dialOriginateCallerIdName':_0x3a0930[_0xd8b4('0x58')],'dialOriginateCallerIdNumber':_0x3a0930[_0xd8b4('0x59')],'dialOriginateTimeout':_0x3a0930[_0xd8b4('0x5a')],'dialPrefix':_0x3a0930['dialPrefix'],'outboundAnswerAgiCallsDay':_0x3a0930[_0xd8b4('0x5b')],'outboundAnswerCallsDay':_0x3a0930['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x3a0930[_0xd8b4('0x5c')],'outboundBusyCallsDay':_0x3a0930['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x3a0930[_0xd8b4('0x5d')],'outboundDropCallsDayACS':_0x3a0930[_0xd8b4('0x5e')],'outboundDropCallsDayCallersExit':_0x3a0930['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x3a0930[_0xd8b4('0x5f')],'outboundNoAnswerCallsDay':_0x3a0930[_0xd8b4('0x60')],'outboundNoSuchCallsDay':_0x3a0930['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x3a0930[_0xd8b4('0x61')],'outboundReCallsDay':_0x3a0930[_0xd8b4('0x62')],'outboundRejectCallsDay':_0x3a0930[_0xd8b4('0x63')],'outboundUnknownCallsDay':_0x3a0930[_0xd8b4('0x64')],'predictiveIntervalAnsweredCalls':_0x3a0930['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x3a0930[_0xd8b4('0x65')],'predictiveIntervalAvgTalktime':_0x3a0930['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x3a0930[_0xd8b4('0x66')],'predictiveIntervalDroppedCallsTimeout':_0x3a0930[_0xd8b4('0x67')],'predictiveIntervalErlangCalls':_0x3a0930[_0xd8b4('0x68')],'predictiveIntervalErlangCallsDroppedCalls':_0x3a0930[_0xd8b4('0x69')],'predictiveIntervalHitRate':_0x3a0930[_0xd8b4('0x6a')],'predictiveIntervalMultiplicativeFactor':_0x3a0930['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x3a0930[_0xd8b4('0x6b')],'predictiveIntervalAvailable':_0x3a0930[_0xd8b4('0x6c')],'predictiveIntervalTotalCalls':_0x3a0930[_0xd8b4('0x6d')],'message':_0x3a0930[_0xd8b4('0x3d')],'originated':_0x3a0930['originated'],'erlangCalls':_0x3a0930['erlangCalls'],'erlangCallToSecond':_0x3a0930[_0xd8b4('0x6e')],'erlangAbandonmentRate':_0x3a0930[_0xd8b4('0x6f')],'erlangBusyFactor':_0x3a0930[_0xd8b4('0x70')],'startPredictive':_0x3a0930['startPredictive'],'startProgressive':_0x3a0930[_0xd8b4('0x26')]};if(_0x3a0930[_0xd8b4('0x71')]){_0x5b0540[_0xd8b4('0x71')]={'id':_0x3a0930[_0xd8b4('0x71')]['id'],'name':_0x3a0930[_0xd8b4('0x71')][_0xd8b4('0x3f')],'active':_0x3a0930[_0xd8b4('0x71')][_0xd8b4('0x72')],'callerid':_0x3a0930[_0xd8b4('0x71')]['callerid']};}if(_0x3a0930[_0xd8b4('0x43')]){_0x5b0540[_0xd8b4('0x43')]={'id':_0x3a0930[_0xd8b4('0x43')]['id'],'name':_0x3a0930[_0xd8b4('0x43')][_0xd8b4('0x3f')]};}var _0x5e74a0=md5(JSON['stringify'](_0x5b0540));if(_0x3a0930[_0xd8b4('0x4')]!==_0x5e74a0){_0x3a0930[_0xd8b4('0x4')]=_0x5e74a0;emit(util[_0xd8b4('0x73')](_0xd8b4('0x74'),_0x5b0540['name']),_0xd8b4('0x75'),_0x5b0540);}}}function emitCampaignSummary(_0x2624ba){if(_0x2624ba[_0xd8b4('0x4e')]===_0xd8b4('0x76')){emit(util[_0xd8b4('0x73')]('campaign:ivr:%s',_0x2624ba[_0xd8b4('0x3f')]),_0xd8b4('0x77'),_0x2624ba);}}function checkGetDataPredictive(_0x1d0262){if(isNotNull(_0x1d0262)&&!_[_0xd8b4('0x47')](_0x1d0262)){loggerPredictive[_0xd8b4('0x78')](_0xd8b4('0x79'));loggerPredictive[_0xd8b4('0x78')](_0xd8b4('0x7a'),_0x1d0262['predictiveIntervalTotalCalls']);loggerPredictive[_0xd8b4('0x78')](_0xd8b4('0x7b'),_0x1d0262[_0xd8b4('0x7c')]);loggerPredictive[_0xd8b4('0x78')](_0xd8b4('0x7d'),_0x1d0262[_0xd8b4('0x67')]);loggerPredictive['info'](_0xd8b4('0x7e'),_0x1d0262[_0xd8b4('0x66')]);loggerPredictive[_0xd8b4('0x78')](_0xd8b4('0x7f'),_0x1d0262[_0xd8b4('0x65')]);loggerPredictive[_0xd8b4('0x78')](_0xd8b4('0x80'),_0x1d0262[_0xd8b4('0x81')]);loggerPredictive[_0xd8b4('0x78')](_0xd8b4('0x82'));if(_0x1d0262[_0xd8b4('0x6d')]>0x0){if(!_['isUndefined'](_0x1d0262[_0xd8b4('0x81')])&&_0x1d0262[_0xd8b4('0x81')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_['isUndefined'](_0x1d0262[_0xd8b4('0x65')])&&_0x1d0262['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0xd8b4('0x78')](_0xd8b4('0x83'));}else{loggerPredictive['info'](_0xd8b4('0x84'));}}else{loggerPredictive[_0xd8b4('0x78')](_0xd8b4('0x85'));}return![];}function mergeDataErlangB(_0x4b3a49){return function(_0x582cc5){loggerPredictive['info'](_0xd8b4('0x86'));loggerPredictive['info']('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x582cc5[_0xd8b4('0x87')]);loggerPredictive[_0xd8b4('0x78')](_0xd8b4('0x88'),_0x582cc5[_0xd8b4('0x6e')]);loggerPredictive[_0xd8b4('0x78')](_0xd8b4('0x89'),_0x582cc5[_0xd8b4('0x6f')]);loggerPredictive[_0xd8b4('0x78')](_0xd8b4('0x8a'),_0x582cc5[_0xd8b4('0x70')]);loggerPredictive['info'](_0xd8b4('0x89'),_0x582cc5[_0xd8b4('0x6f')]);loggerPredictive[_0xd8b4('0x78')]('---------------------------');_[_0xd8b4('0x8b')](_0x4b3a49,_0x582cc5);};}function getDiff(_0x2a57ec){var _0x1d45a5=moment()[_0xd8b4('0x4b')](0x0);var _0x471352=moment(_0x2a57ec)[_0xd8b4('0x4b')](0x0);return _0x1d45a5[_0xd8b4('0x8c')](_0x471352,_0xd8b4('0x4c'));}function ifInterval(_0x393543,_0x2535b4){if(_[_0xd8b4('0x3c')](_0x2535b4)){return![];}return getDiff(_0x2535b4)<_0x393543*0x3c;}function freeVariablesPredictive(_0xcf2c94){if(isNotNull(_0xcf2c94)){if(!_[_0xd8b4('0x3c')](_0xcf2c94[_0xd8b4('0x26')])){_0xcf2c94['startProgressive']=undefined;loggerPredictive['info'](_0xcf2c94[_0xd8b4('0x3f')],_0xd8b4('0x8d'));}if(!_[_0xd8b4('0x3c')](_0xcf2c94['startPredictive'])){_0xcf2c94[_0xd8b4('0x25')]=undefined;loggerPredictive['info'](_0xcf2c94[_0xd8b4('0x3f')],_0xd8b4('0x8e'));}if(!_['isUndefined'](_0xcf2c94[_0xd8b4('0x8f')])){clearInterval(_0xcf2c94[_0xd8b4('0x8f')]);_0xcf2c94[_0xd8b4('0x8f')]=undefined;loggerPredictive[_0xd8b4('0x78')](_0xcf2c94['name'],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x356f95,_0x5b6386){if(_0x5b6386===0x0){return 0x0;}var _0x20b560=0x1;for(var _0x1f5452=0x1;_0x1f5452<=_0x5b6386;_0x1f5452+=0x1){_0x20b560=0x1+_0x20b560*_0x1f5452/_0x356f95;}return 0x1/_0x20b560;}function isVoiceQueueOutbound(_0x279132){return _0x279132===_0xd8b4('0x90');}function isNotPreview(_0x506131){return _0x506131!==_0xd8b4('0x91');}function isCampaignIvr(_0x203c95){return _0x203c95==='ivr';}function getCallerId(_0x884501,_0x16df34,_0xe8896){if(!_[_0xd8b4('0x3c')](_0xe8896)&&typeof _0xe8896==='string'&&!_[_0xd8b4('0x47')](_0xe8896)){if(!_[_0xd8b4('0x3c')](_0x16df34)&&typeof _0x16df34===_0xd8b4('0x92')&&!_[_0xd8b4('0x47')](_0x16df34)){return util[_0xd8b4('0x73')](_0xd8b4('0x93'),_0x16df34,_0xe8896);}return util[_0xd8b4('0x73')]('\x22%s\x22\x20<%s>',_0xe8896,_0xe8896);}if(!_['isUndefined'](_0x884501)&&typeof _0x884501===_0xd8b4('0x92')&&!_[_0xd8b4('0x47')](_0x884501)){return _0x884501;}return _0xd8b4('0x94');}function loggerCatchQueueSummary(_0x29b9f1,_0x17dd25){return function(_0x219e31){freeVariablesPredictive(_0x17dd25);emitVoiceQueueSummary(_0x17dd25);emitCampaignSummary(_0x17dd25);loggerSyncQueueSummary[_0xd8b4('0x95')](_0x29b9f1,util[_0xd8b4('0x96')](_0x219e31,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0xd52b0,_0x3d9528){return function(_0x19e607){loggerPredictive[_0xd8b4('0x95')](_0x3d9528[_0xd8b4('0x3f')],_0xd52b0);loggerPredictive[_0xd8b4('0x95')](_0x19e607[_0xd8b4('0x97')]);freeVariablesPredictive(_0x3d9528);};}function loggerCatch(_0x16b357){return function(_0x45236f){logger['error'](_0x16b357,util[_0xd8b4('0x96')](_0x45236f,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x56e939){return _0x56e939&&!_[_0xd8b4('0x3c')](_0x56e939)&&_0x56e939['length']>0x0;}function decremetOriginate(_0x19da1f){if(!_['isUndefined'](_0x19da1f)&&_0x19da1f!==null){if(typeof _0x19da1f[_0xd8b4('0x98')]!==_0xd8b4('0x99')){if(_0x19da1f[_0xd8b4('0x98')]>0x0){_0x19da1f[_0xd8b4('0x98')]-=0x1;}else{logger[_0xd8b4('0x95')](_0xd8b4('0x9a'));}}}else{logger[_0xd8b4('0x95')](_0xd8b4('0x9b'));}}function checkContactLowerLimitOriginate(_0x5da6e1,_0x5739f7,_0x4df5c8){if(_0x5739f7>_0x4df5c8){for(var _0x351a16=0x0;_0x351a16<_0x5739f7-_0x4df5c8;_0x351a16+=0x1){decremetOriginate(_0x5da6e1);}}}function loggerGetContactDialer(_0x5253de,_0x1bf601,_0xbd15c6){return function(_0x53de59){checkContactLowerLimitOriginate(_0x1bf601,_0xbd15c6,0x0);logger[_0xd8b4('0x95')](_0x5253de,util['inspect'](_0x53de59,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x568119){return function(_0x15a0b4){if(isNotNull(_0x15a0b4)&&isNotNull(_0x15a0b4[0x0])){if(_0x15a0b4[0x0][_0xd8b4('0x9c')]>0x0){_0x568119['message']=_0xd8b4('0x9d');logger['info'](_0xd8b4('0x9e')+_0x568119[_0xd8b4('0x3f')],_0x15a0b4[0x0]['contactsRescheduled'],_0xd8b4('0x9f'));}else{_0x568119[_0xd8b4('0x3d')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xd8b4('0x78')](_0xd8b4('0xa0')+_0x568119[_0xd8b4('0x3f')]);}}};}function notSendMessagesQueue(_0x84fe92){if(_0x84fe92[_0xd8b4('0xa1')]){freeVariablesPredictive(_0x84fe92);if(_0x84fe92[_0xd8b4('0x98')]===0x0&&_0x84fe92[_0xd8b4('0xa2')]===0x0&&_0x84fe92[_0xd8b4('0xa3')]===0x0&&(_0x84fe92[_0xd8b4('0x51')]||0x0)===0x0){_0x84fe92[_0xd8b4('0xa1')]=![];_0x84fe92[_0xd8b4('0x4f')]=0x0;_0x84fe92[_0xd8b4('0x3d')]=_0xd8b4('0x41');loggerSyncQueueSummary[_0xd8b4('0x95')](_0xd8b4('0xa4'),_0x84fe92[_0xd8b4('0x3f')],_0xd8b4('0xa5'));}else{_0x84fe92[_0xd8b4('0x3d')]=_0xd8b4('0xa6');loggerSyncQueueSummary[_0xd8b4('0x95')](_0xd8b4('0xa4'),_0x84fe92[_0xd8b4('0x3f')],'is\x20disactive');}emitVoiceQueueSummary(_0x84fe92);}}function notSendMessagesCampaign(_0x89a809){if(_0x89a809['sendMessageOneNotActive']){if(_0x89a809['originated']===0x0){_0x89a809[_0xd8b4('0xa1')]=![];_0x89a809[_0xd8b4('0x3d')]=_0xd8b4('0x41');loggerSyncQueueSummary[_0xd8b4('0x95')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x89a809[_0xd8b4('0x3f')],'is\x20not\x20active');}else{_0x89a809['message']=_0xd8b4('0xa6');loggerSyncQueueSummary[_0xd8b4('0x95')](_0xd8b4('0xa7'),_0x89a809[_0xd8b4('0x3f')],_0xd8b4('0xa8'));}emitCampaignSummary(_0x89a809);}}function createObjHistory(_0x527df9,_0x32b21a,_0x239ea4,_0x3add0a,_0x3ad4ca){_0x527df9[_0xd8b4('0x3d')]=_0x239ea4;var _0x1bc3fd=new Action(_0x527df9,_0x32b21a);var _0x275ad9=new History(_0x1bc3fd);_0x275ad9[_0xd8b4('0xa9')]=_0x3add0a;_0x275ad9[_0xd8b4('0xaa')]=_0x3ad4ca;_0x275ad9[_0xd8b4('0xab')]=_0x1bc3fd[_0xd8b4('0xac')];return _0x275ad9;}Dialer[_0xd8b4('0xad')][_0xd8b4('0x3b')]=function(){var _0x44d9e5=this;setInterval(function(){_0x44d9e5[_0xd8b4('0xae')](_0x44d9e5[_0xd8b4('0x23')],_0xd8b4('0xaf'));_0x44d9e5[_0xd8b4('0xae')](_0x44d9e5['actions'],_0xd8b4('0xb0'));},0x32c8);};Dialer[_0xd8b4('0xad')][_0xd8b4('0xae')]=function(_0x4994e4,_0x185ad0){var _0x31a42f=this;for(var _0x1f714e in _0x4994e4){if(typeof _0x4994e4[_0x1f714e]!=='undefined'){this['sequence']['enqueue'](function(){if(!_[_0xd8b4('0xb1')](_0x4994e4[_0x1f714e])){return ami[_0xd8b4('0xb2')]({'action':_0xd8b4('0xb3'),'channel':_0x4994e4[_0x1f714e][_0xd8b4('0xb4')]})[_0xd8b4('0xb5')](function(_0x35ca9a){if(_0x35ca9a[_0xd8b4('0x3d')]===_0xd8b4('0xb6')){setTimeout(function(){if(_0x4994e4[_0x1f714e]&&_0x4994e4[_0x1f714e]['type']!==_0xd8b4('0x76')){_0x31a42f[_0xd8b4('0xb7')](_0x31a42f[_0xd8b4('0x1c')][_0x4994e4[_0x1f714e][_0xd8b4('0xb8')]]);logger['error'](_0xd8b4('0xb9'),_0x185ad0,_0x1f714e,_0x4994e4[_0x1f714e]['queue']);delete _0x4994e4[_0x1f714e];}if(_0x4994e4[_0x1f714e]&&_0x4994e4[_0x1f714e][_0xd8b4('0x4e')]===_0xd8b4('0x76')){_0x31a42f[_0xd8b4('0xb7')](_0x31a42f[_0xd8b4('0x1d')][_0x4994e4[_0x1f714e][_0xd8b4('0xb8')]]);logger[_0xd8b4('0x95')](_0xd8b4('0xba'),_0x185ad0,_0x1f714e,_0x4994e4[_0x1f714e][_0xd8b4('0xb8')]);delete _0x4994e4[_0x1f714e];}},0x2328);}});}});}}};Dialer[_0xd8b4('0xad')][_0xd8b4('0xbb')]=function(_0x251535){return BPromise[_0xd8b4('0xbc')]()[_0xd8b4('0xbd')](cmHopper[_0xd8b4('0xbb')](_0x251535))['catch'](loggerCatch(_0xd8b4('0xbe')));};Dialer['prototype'][_0xd8b4('0xbf')]=function(_0x5ca672){return BPromise[_0xd8b4('0xbc')]()['then'](cmHopperBlack[_0xd8b4('0xbf')](_0x5ca672))['catch'](loggerCatch(_0xd8b4('0xc0')));};Dialer[_0xd8b4('0xad')]['checkIsBlackListIvr']=function(_0x1930c6){return BPromise[_0xd8b4('0xbc')]()[_0xd8b4('0xbd')](cmHopperBlack[_0xd8b4('0xc1')](_0x1930c6))[_0xd8b4('0xb5')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0xd8b4('0xad')]['averageHandleTime']=function(_0x3677e3){return BPromise[_0xd8b4('0xbc')]()[_0xd8b4('0xbd')](cmHopperHistory[_0xd8b4('0xc2')](_0x3677e3))[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0xc3')));};Dialer[_0xd8b4('0xad')][_0xd8b4('0xc4')]=function(_0x1f9d47){return BPromise[_0xd8b4('0xbc')]()[_0xd8b4('0xbd')](cmHopper[_0xd8b4('0xc4')](_0x1f9d47))['catch'](loggerCatch(_0xd8b4('0xc5')));};Dialer['prototype'][_0xd8b4('0xc6')]=function(_0x15dc9a,_0x27e8f1,_0x3e26ac){return BPromise[_0xd8b4('0xbc')]()[_0xd8b4('0xbd')](cmHopper['unlockContact'](_0x15dc9a,_0x27e8f1,_0x3e26ac))[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0xc7')));};Dialer[_0xd8b4('0xad')][_0xd8b4('0xc8')]=function(_0x463b53,_0x2de5e9,_0x4fe8e9,_0x20408c,_0x33f687){return BPromise[_0xd8b4('0xbc')]()['then'](cmHopper[_0xd8b4('0xc8')](_0x463b53,_0x2de5e9,_0x4fe8e9,_0x20408c))[_0xd8b4('0xb5')](function(_0x45151f){_0x33f687[_0xd8b4('0xc9')]-=_0x4fe8e9;_0x33f687[_0xd8b4('0xc9')]=_0x33f687[_0xd8b4('0xc9')]>0x0?_0x33f687[_0xd8b4('0xc9')]:0x0;loggerCatch(_0xd8b4('0xca'))(_0x45151f);});};Dialer['prototype']['getContactDialerIvr']=function(_0x32114a,_0x1a4eb3,_0x49f79d,_0x57f007){return BPromise[_0xd8b4('0xbc')]()[_0xd8b4('0xbd')](cmHopper[_0xd8b4('0xcb')](_0x32114a,_0x1a4eb3,_0x49f79d))['catch'](function(_0x3c0186){_0x57f007[_0xd8b4('0xc9')]-=_0x1a4eb3;_0x57f007['temp']=_0x57f007[_0xd8b4('0xc9')]>0x0?_0x57f007[_0xd8b4('0xc9')]:0x0;loggerCatch(_0xd8b4('0xcc'))(_0x3c0186);});};Dialer[_0xd8b4('0xad')][_0xd8b4('0xcd')]=function(_0x3f75d0){return BPromise[_0xd8b4('0xbc')]()[_0xd8b4('0xbd')](voiceQueueRt['getVoiceQueueRtPauses'](_0x3f75d0))[_0xd8b4('0xb5')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0xd8b4('0xad')][_0xd8b4('0xce')]=function(_0x4b58c7){return BPromise[_0xd8b4('0xbc')]()[_0xd8b4('0xbd')](cmHopper[_0xd8b4('0xce')](_0x4b58c7))[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0xcf')));};Dialer[_0xd8b4('0xad')]['createHistory']=function(_0x48e5bc){return BPromise[_0xd8b4('0xbc')]()[_0xd8b4('0xbd')](cmHopperHistory[_0xd8b4('0xd0')](_0x48e5bc))[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0xd1')));};Dialer['prototype'][_0xd8b4('0xb7')]=function(_0x128cb7){if(!_['isUndefined'](_0x128cb7)&&_0x128cb7!==null){if(typeof _0x128cb7[_0xd8b4('0x98')]!==_0xd8b4('0x99')){if(_0x128cb7['originated']>0x0){_0x128cb7[_0xd8b4('0x98')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger['error'](_0xd8b4('0xd2'));}};Dialer[_0xd8b4('0xad')][_0xd8b4('0xd3')]=function(_0xd34716,_0x57865f){var _0x532544=this;return function(_0x4342d9){_0x532544[_0xd8b4('0xb7')](_0x57865f);logger[_0xd8b4('0x95')](_0xd34716,util[_0xd8b4('0x96')](_0x4342d9,{'showHidden':![],'depth':null}));};};Dialer[_0xd8b4('0xad')]['emptyContact']=function(_0x1ac68f,_0x3b02f0,_0x116d10){var _0x2c6854={'state':0x19,'statedesc':_0xd8b4('0xd4')};this[_0xd8b4('0xb7')](_0x3b02f0);this[_0xd8b4('0xd5')](_[_0xd8b4('0x8b')](_0x2c6854,_[_0xd8b4('0xd6')](_0x116d10,[_0xd8b4('0xd7'),_0xd8b4('0xd8'),'UserId','VoiceQueueId',_0xd8b4('0xd9')])),_0xd8b4('0xda'),_0xd8b4('0xdb'));logger[_0xd8b4('0x95')](_0x1ac68f);};Dialer['prototype'][_0xd8b4('0xdc')]=function(_0x31bc3d){return _0x31bc3d===_0xd8b4('0xdd');};Dialer[_0xd8b4('0xad')]['isTrunkReachable']=function(_0x42f533){return!_[_0xd8b4('0x3c')](_0x42f533)&&_0x42f533&&!_[_0xd8b4('0x3c')](_0x42f533[_0xd8b4('0x3f')])&&!_[_0xd8b4('0x3c')](_0x42f533['active'])&&_0x42f533[_0xd8b4('0x72')]&&(this[_0xd8b4('0x1f')][util[_0xd8b4('0x73')]('SIP/%s',_0x42f533[_0xd8b4('0x3f')])]['status']===_0xd8b4('0xde')||this['trunks'][util[_0xd8b4('0x73')](_0xd8b4('0xdf'),_0x42f533[_0xd8b4('0x3f')])][_0xd8b4('0xb3')]===_0xd8b4('0xe0'));};Dialer[_0xd8b4('0xad')][_0xd8b4('0xd5')]=function(_0x352aa3,_0x17fd26,_0x4cd16f){this[_0xd8b4('0xd0')](_0x352aa3)[_0xd8b4('0xb5')](loggerCatch(_0x17fd26));this['moveContactManagedDialer'](_0x352aa3)[_0xd8b4('0xb5')](loggerCatch(_0x4cd16f));};Dialer[_0xd8b4('0xad')][_0xd8b4('0x37')]=function(_0x4d657c){var _0x2522cb=this[_0xd8b4('0x23')][_0x4d657c[_0xd8b4('0xe1')]];var _0x1b7c19;if(!_[_0xd8b4('0xb1')](_0x4d657c)&&!_['isNil'](_0x4d657c[_0xd8b4('0xe2')])&&!_[_0xd8b4('0xb1')](_0x4d657c[_0xd8b4('0xe2')][_0xd8b4('0xe3')])&&_0x4d657c[_0xd8b4('0xe4')]==='xcally-motion-dialer'&&_0x2522cb){if(_0x2522cb[_0xd8b4('0x4e')]!==_0xd8b4('0x76')&&this[_0xd8b4('0x1c')][_0x2522cb[_0xd8b4('0xb8')]]['dialAMDActive']&&_0x4d657c[_0xd8b4('0xe5')]===_0xd8b4('0xe6')){delete this[_0xd8b4('0x23')][_0x4d657c['uniqueid']];this['updateOriginated'](this['voiceQueues'][_0x2522cb[_0xd8b4('0xb8')]]);this[_0xd8b4('0x1c')][_0x2522cb[_0xd8b4('0xb8')]][_0xd8b4('0xe7')]+=0x1;this[_0xd8b4('0x1c')][_0x2522cb[_0xd8b4('0xb8')]][_0xd8b4('0x5b')]+=0x1;_0x1b7c19=new Hangup(_0x2522cb,_0x4d657c);_0x1b7c19[_0xd8b4('0xa9')]=0x12;_0x1b7c19[_0xd8b4('0xaa')]='HangupInAMD';_0x1b7c19[_0xd8b4('0xe8')]=_0xd8b4('0xe9');ami['emit'](_0xd8b4('0xea'),ut[_0xd8b4('0xeb')](_0x1b7c19,'amd'));this[_0xd8b4('0xd5')](_0x1b7c19,_0xd8b4('0xec'),_0xd8b4('0xed'));}if(_0x2522cb[_0xd8b4('0x4e')]!==_0xd8b4('0x76')&&this[_0xd8b4('0x1c')][_0x2522cb['queue']][_0xd8b4('0xee')]&&_0x4d657c[_0xd8b4('0xe5')]===_0xd8b4('0xef')){var _0x1632a4=this;return new BPromise(function(_0x17b00f,_0x2fc836){delete _0x1632a4[_0xd8b4('0x23')][_0x4d657c['uniqueid']];_0x1632a4[_0xd8b4('0xb7')](_0x1632a4[_0xd8b4('0x1c')][_0x2522cb[_0xd8b4('0xb8')]]);_0x1632a4[_0xd8b4('0x1c')][_0x2522cb['queue']]['outboundAnswerCallsDay']+=0x1;_0x1632a4['voiceQueues'][_0x2522cb[_0xd8b4('0xb8')]][_0xd8b4('0x5b')]+=0x1;var _0x31aac8=_0x1632a4[_0xd8b4('0x1c')][_0x2522cb['queue']];var _0x348f32=new Hangup(_0x2522cb,_0x4d657c);_0x348f32['state']=0x13;_0x348f32[_0xd8b4('0xaa')]='Machine';_0x348f32[_0xd8b4('0xe8')]=_0xd8b4('0xe9');_0x348f32[_0xd8b4('0xf0')]+=0x1;_0x348f32[_0xd8b4('0xf1')]+=0x1;_0x348f32[_0xd8b4('0xf2')]=!![];ami[_0xd8b4('0x4d')](_0xd8b4('0xea'),ut[_0xd8b4('0xeb')](_0x348f32,_0xd8b4('0xf2')));_0x1632a4['createHistory'](_0x348f32)[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0xf3')));if(_0x348f32['countbusyretry']+_0x348f32[_0xd8b4('0xf4')]+_0x348f32[_0xd8b4('0xf5')]+_0x348f32[_0xd8b4('0xf6')]+_0x348f32[_0xd8b4('0xf7')]+_0x348f32[_0xd8b4('0xf8')]+_0x348f32[_0xd8b4('0xf0')]+_0x348f32['countagentrejectretry']>=_0x31aac8[_0xd8b4('0xf9')]){_0x1632a4[_0xd8b4('0xfa')](_0x348f32,_0x17b00f,_0x2fc836,_0xd8b4('0xfb'));}else{if(_0x348f32[_0xd8b4('0xf0')]>=_0x31aac8[_0xd8b4('0xfc')]){_0x1632a4['createStateFinal'](_0x348f32,_0x17b00f,_0x2fc836,_0xd8b4('0xfd'));}else{_0x1632a4[_0xd8b4('0xc4')]({'active':![],'countmachineretry':_0x348f32[_0xd8b4('0xf0')],'scheduledat':moment()[_0xd8b4('0xfe')](_0x31aac8[_0xd8b4('0xff')],_0xd8b4('0x100'))[_0xd8b4('0x73')](_0xd8b4('0x101')),'ContactId':_0x348f32[_0xd8b4('0xd7')],'ListId':_0x348f32[_0xd8b4('0xd8')],'VoiceQueueId':_0x348f32[_0xd8b4('0x102')]||undefined,'CampaignId':_0x348f32[_0xd8b4('0xd9')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x17b00f({'reschedule':0x1});}}});}if(_0x2522cb[_0xd8b4('0x4e')]===_0xd8b4('0x76')&&this[_0xd8b4('0x1d')][_0x2522cb[_0xd8b4('0xb8')]]['dialAMDActive']&&_0x4d657c[_0xd8b4('0xe5')]===_0xd8b4('0xe6')){delete this[_0xd8b4('0x23')][_0x4d657c['uniqueid']];this[_0xd8b4('0xb7')](this['campaigns'][_0x2522cb[_0xd8b4('0xb8')]]);_0x1b7c19=new Hangup(_0x2522cb,_0x4d657c);_0x1b7c19[_0xd8b4('0xa9')]=0x12;_0x1b7c19['statedesc']=_0xd8b4('0x103');_0x1b7c19[_0xd8b4('0xe8')]=_0xd8b4('0xe9');ami[_0xd8b4('0x4d')]('custom:amd',ut['buildObj'](_0x1b7c19,'amd'));this[_0xd8b4('0xd5')](_0x1b7c19,_0xd8b4('0x104'),'[syncHangupInAMDIvr]');}if(_0x2522cb['type']===_0xd8b4('0x76')&&this[_0xd8b4('0x1d')][_0x2522cb[_0xd8b4('0xb8')]][_0xd8b4('0xee')]&&_0x4d657c[_0xd8b4('0xe5')]===_0xd8b4('0xef')){var _0x1632a4=this;return new BPromise(function(_0x1263e0,_0x5f54d7){delete _0x1632a4[_0xd8b4('0x23')][_0x4d657c[_0xd8b4('0xe1')]];_0x1632a4[_0xd8b4('0xb7')](_0x1632a4[_0xd8b4('0x1d')][_0x2522cb['queue']]);_0x1632a4[_0xd8b4('0x1d')][_0x2522cb[_0xd8b4('0xb8')]][_0xd8b4('0xe7')]+=0x1;_0x1632a4[_0xd8b4('0x1d')][_0x2522cb['queue']][_0xd8b4('0x5b')]+=0x1;var _0x453aed=_0x1632a4['campaigns'][_0x2522cb['queue']];var _0x564bc3=new Hangup(_0x2522cb,_0x4d657c);_0x564bc3[_0xd8b4('0xa9')]=0x13;_0x564bc3[_0xd8b4('0xaa')]=_0xd8b4('0x105');_0x564bc3[_0xd8b4('0xe8')]=_0xd8b4('0xe9');_0x564bc3['countmachineretry']+=0x1;_0x564bc3['countglobal']+=0x1;_0x564bc3[_0xd8b4('0xf2')]=!![];ami[_0xd8b4('0x4d')](_0xd8b4('0xea'),ut[_0xd8b4('0xeb')](_0x564bc3,_0xd8b4('0xf2')));_0x1632a4[_0xd8b4('0xd0')](_0x564bc3)[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0xf3')));if(_0x564bc3[_0xd8b4('0x106')]+_0x564bc3[_0xd8b4('0xf4')]+_0x564bc3[_0xd8b4('0xf5')]+_0x564bc3['countnosuchnumberretry']+_0x564bc3[_0xd8b4('0xf7')]+_0x564bc3[_0xd8b4('0xf8')]+_0x564bc3[_0xd8b4('0xf0')]+_0x564bc3['countagentrejectretry']>=_0x453aed[_0xd8b4('0xf9')]){_0x1632a4[_0xd8b4('0xfa')](_0x564bc3,_0x1263e0,_0x5f54d7,_0xd8b4('0xfb'));}else{if(_0x564bc3[_0xd8b4('0xf0')]>=_0x453aed[_0xd8b4('0xfc')]){_0x1632a4[_0xd8b4('0x107')](_0x564bc3,_0x1263e0,_0x5f54d7,_0xd8b4('0xfd'));}else{_0x1632a4[_0xd8b4('0xc4')]({'active':![],'countmachineretry':_0x564bc3[_0xd8b4('0xf0')],'scheduledat':moment()[_0xd8b4('0xfe')](_0x453aed[_0xd8b4('0xff')],_0xd8b4('0x100'))[_0xd8b4('0x73')](_0xd8b4('0x101')),'ContactId':_0x564bc3['ContactId'],'ListId':_0x564bc3[_0xd8b4('0xd8')],'VoiceQueueId':_0x564bc3[_0xd8b4('0x102')]||undefined,'CampaignId':_0x564bc3[_0xd8b4('0xd9')]||undefined})[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0x108')));_0x1263e0({'reschedule':0x1});}}});}}};Dialer[_0xd8b4('0xad')][_0xd8b4('0x109')]=function(_0x26f54f){var _0x422167=this[_0xd8b4('0x23')][_0x26f54f[_0xd8b4('0xe1')]];var _0x57df9e=this;var _0x3d004c;if(_0x422167&&_0x422167[_0xd8b4('0x4e')]===_0xd8b4('0x76')){delete this[_0xd8b4('0x23')][_0x26f54f[_0xd8b4('0xe1')]];this['updateOriginated'](this[_0xd8b4('0x1d')][_0x422167[_0xd8b4('0xb8')]]);this[_0xd8b4('0x1d')][_0x422167[_0xd8b4('0xb8')]]['ivrAnswerCallsDay']+=0x1;_0x3d004c=new Hangup(_0x422167,_0x26f54f);this[_0xd8b4('0xd0')](_0x3d004c)[_0xd8b4('0xb5')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x3d004c)[_0xd8b4('0xb5')](loggerCatch('[syncHangupIvr]'));}if(_0x422167&&_0x422167[_0xd8b4('0x4e')]!==_0xd8b4('0x76')&&isNotNull(this[_0xd8b4('0x1c')][_0x422167[_0xd8b4('0xb8')]][_0xd8b4('0x10a')])){delete this['uniqueId'][_0x26f54f[_0xd8b4('0xe1')]];this[_0xd8b4('0xb7')](this['voiceQueues'][_0x422167[_0xd8b4('0xb8')]]);this['voiceQueues'][_0x422167['queue']]['outboundAnswerCallsDay']+=0x1;this[_0xd8b4('0x1c')][_0x422167[_0xd8b4('0xb8')]][_0xd8b4('0x5b')]+=0x1;_0x3d004c=new Hangup(_0x422167,_0x26f54f);_0x3d004c[_0xd8b4('0xa9')]=0x10;_0x3d004c['statedesc']=_0xd8b4('0x10b');_0x3d004c[_0xd8b4('0xe8')]=_0xd8b4('0x10c');this[_0xd8b4('0xd0')](_0x3d004c)[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0x10d')));this[_0xd8b4('0xce')](_0x3d004c)[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0x10e')));}if(_0x422167&&_0x422167[_0xd8b4('0x4e')]!==_0xd8b4('0x76')&&!isNotNull(this[_0xd8b4('0x1c')][_0x422167[_0xd8b4('0xb8')]][_0xd8b4('0x10a')])){delete this[_0xd8b4('0x23')][_0x26f54f['uniqueid']];this[_0xd8b4('0xb7')](this[_0xd8b4('0x1c')][_0x422167[_0xd8b4('0xb8')]]);this[_0xd8b4('0x1c')][_0x422167['queue']]['outboundUnknownCallsDay']+=0x1;_0x3d004c=new Hangup(_0x422167,_0x26f54f);_0x3d004c[_0xd8b4('0xa9')]=0xc;_0x3d004c[_0xd8b4('0xaa')]=_0x26f54f[_0xd8b4('0x10f')];_0x3d004c[_0xd8b4('0xe8')]=_0xd8b4('0x110');this[_0xd8b4('0xd0')](_0x3d004c)[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0x10d')));this[_0xd8b4('0xce')](_0x3d004c)[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0x10e')));}};Dialer['prototype']['syncAgentComplete']=function(_0x2e2e2c){var _0xbad7eb=this[_0xd8b4('0x23')][_0x2e2e2c[_0xd8b4('0xe1')]];var _0x24bdfd=this;if(this[_0xd8b4('0x1c')][_0x2e2e2c[_0xd8b4('0xb8')]]){if(_0xbad7eb&&_0xbad7eb['type']!==_0xd8b4('0x76')){delete this[_0xd8b4('0x23')][_0x2e2e2c[_0xd8b4('0xe1')]];this[_0xd8b4('0x1c')][_0x2e2e2c['queue']]['outboundAnswerCallsDay']+=0x1;var _0x528276=new AgentComplete(_0xbad7eb,_0x2e2e2c);if(_0x2e2e2c[_0xd8b4('0x111')]===_0xd8b4('0x112')){_0x528276[_0xd8b4('0x113')]=this[_0xd8b4('0x1c')][_0x2e2e2c['queue']][_0xd8b4('0x114')]&&this[_0xd8b4('0x1c')][_0x2e2e2c[_0xd8b4('0xb8')]]['dialAgiAfterHangupAgent']?moment()[_0xd8b4('0x73')](_0xd8b4('0x101')):undefined;}this[_0xd8b4('0xd0')](_0x528276)['catch'](loggerCatch(_0xd8b4('0x115')));this[_0xd8b4('0xce')](_0x528276)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xd8b4('0xad')]['syncAgentConnect']=function(_0x22da77){if(this[_0xd8b4('0x1c')][_0x22da77[_0xd8b4('0xb8')]]){if(this[_0xd8b4('0x23')][_0x22da77[_0xd8b4('0xe1')]]&&this['uniqueId'][_0x22da77['uniqueid']][_0xd8b4('0x4e')]!==_0xd8b4('0x76')){this[_0xd8b4('0xb7')](this[_0xd8b4('0x1c')][_0x22da77[_0xd8b4('0xb8')]]);this[_0xd8b4('0x23')][_0x22da77[_0xd8b4('0xe1')]][_0xd8b4('0x116')]=moment()[_0xd8b4('0x73')](_0xd8b4('0x101'));}}};Dialer[_0xd8b4('0xad')][_0xd8b4('0x117')]=function(_0x3044ef){this['createHistory'](_0x3044ef)[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0x115')));this[_0xd8b4('0xce')](_0x3044ef)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0xd8b4('0xad')][_0xd8b4('0x2b')]=function(_0x2cb4e9){var _0xd88826=this['uniqueId'][_0x2cb4e9['uniqueid']];var _0x261941=this;if(this[_0xd8b4('0x1c')][_0x2cb4e9[_0xd8b4('0xb8')]]){if(_0xd88826&&_0xd88826[_0xd8b4('0x4e')]!==_0xd8b4('0x76')){delete this[_0xd8b4('0x23')][_0x2cb4e9[_0xd8b4('0xe1')]];this[_0xd8b4('0xb7')](this[_0xd8b4('0x1c')][_0x2cb4e9['queue']]);_0xd88826[_0xd8b4('0x118')]=moment()[_0xd8b4('0x73')](_0xd8b4('0x101'));var _0x5ad9f0=new QueueCallerAbandon(_0xd88826,_0x2cb4e9);if(getSeconds(_0xd88826[_0xd8b4('0x118')],_0xd88826['responsetime'])>=_0xd88826['dialQueueTimeout']){this['voiceQueues'][_0x2cb4e9[_0xd8b4('0xb8')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x2cb4e9['queue']]['outboundDropCallsDayTimeout']+=0x1;this[_0xd8b4('0x1c')][_0x2cb4e9['queue']][_0xd8b4('0x69')]+=0x1;_0x5ad9f0[_0xd8b4('0xa9')]=0xa;_0x5ad9f0[_0xd8b4('0xaa')]=_0xd8b4('0x119');_0x5ad9f0[_0xd8b4('0x11a')]=_0xd8b4('0x11b');_0x5ad9f0[_0xd8b4('0x113')]=this[_0xd8b4('0x1c')][_0x2cb4e9[_0xd8b4('0xb8')]][_0xd8b4('0x114')]?moment()['format'](_0xd8b4('0x101')):undefined;_0x5ad9f0[_0xd8b4('0xf7')]+=0x1;_0x5ad9f0[_0xd8b4('0xf1')]+=0x1;if(_0x5ad9f0[_0xd8b4('0xf7')]>=this[_0xd8b4('0x1c')][_0x2cb4e9[_0xd8b4('0xb8')]][_0xd8b4('0x11c')]){this['queueCallerAbandonCreateState'](_0x5ad9f0);}else{this[_0xd8b4('0xc4')]({'active':![],'countdropretry':_0x5ad9f0[_0xd8b4('0xf7')],'scheduledat':moment()['add'](this[_0xd8b4('0x1c')][_0x2cb4e9[_0xd8b4('0xb8')]][_0xd8b4('0x11d')],_0xd8b4('0x100'))[_0xd8b4('0x73')](_0xd8b4('0x101')),'ContactId':_0xd88826[_0xd8b4('0xd7')],'ListId':_0xd88826[_0xd8b4('0xd8')],'VoiceQueueId':_0xd88826['VoiceQueueId']||undefined,'CampaignId':_0xd88826['CampaignId']||undefined})[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0x11e')));var _0x1604f3=new History(_0x5ad9f0);_0x1604f3[_0xd8b4('0xa9')]=0xa;_0x1604f3['statedesc']=_0xd8b4('0x119');_0x1604f3[_0xd8b4('0xac')]=moment()['format'](_0xd8b4('0x101'));_0x1604f3[_0xd8b4('0xab')]=_0x1604f3['starttime'];_0x1604f3[_0xd8b4('0x11f')]=_0x5ad9f0[_0xd8b4('0x11f')];_0x1604f3[_0xd8b4('0x120')]=_0x5ad9f0['calleridnum'];this[_0xd8b4('0xd0')](_0x1604f3)[_0xd8b4('0xb5')](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0xd8b4('0x1c')][_0x2cb4e9[_0xd8b4('0xb8')]][_0xd8b4('0x66')]+=0x1;this['voiceQueues'][_0x2cb4e9['queue']][_0xd8b4('0x121')]+=0x1;_0x5ad9f0['state']=0xb;_0x5ad9f0['statedesc']=_0xd8b4('0x122');_0x5ad9f0[_0xd8b4('0x11a')]=_0xd8b4('0x123');_0x5ad9f0[_0xd8b4('0xf8')]+=0x1;_0x5ad9f0[_0xd8b4('0xf1')]+=0x1;if(_0x5ad9f0[_0xd8b4('0xf8')]>=this['voiceQueues'][_0x2cb4e9[_0xd8b4('0xb8')]][_0xd8b4('0x124')]){this[_0xd8b4('0x117')](_0x5ad9f0);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x5ad9f0[_0xd8b4('0xf8')],'scheduledat':moment()[_0xd8b4('0xfe')](this[_0xd8b4('0x1c')][_0x2cb4e9[_0xd8b4('0xb8')]]['dialAbandonedRetryFrequency'],_0xd8b4('0x100'))[_0xd8b4('0x73')](_0xd8b4('0x101')),'ContactId':_0xd88826[_0xd8b4('0xd7')],'ListId':_0xd88826[_0xd8b4('0xd8')],'VoiceQueueId':_0xd88826[_0xd8b4('0x102')]||undefined,'CampaignId':_0xd88826[_0xd8b4('0xd9')]||undefined})[_0xd8b4('0xb5')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x1604f3=new History(_0x5ad9f0);_0x1604f3[_0xd8b4('0xa9')]=0xb;_0x1604f3[_0xd8b4('0xaa')]=_0xd8b4('0x122');_0x1604f3['starttime']=moment()[_0xd8b4('0x73')](_0xd8b4('0x101'));_0x1604f3[_0xd8b4('0xab')]=_0x1604f3[_0xd8b4('0xac')];_0x1604f3[_0xd8b4('0x11f')]=_0x5ad9f0[_0xd8b4('0x11f')];_0x1604f3[_0xd8b4('0x120')]=_0x5ad9f0[_0xd8b4('0x120')];this[_0xd8b4('0xd0')](_0x1604f3)['catch'](loggerCatch(_0xd8b4('0x125')));}}}}};Dialer['prototype']['syncNewExten']=function(_0x319f68){if(this[_0xd8b4('0x126')][_0x319f68['uniqueid']]){this[_0xd8b4('0x126')][_0x319f68['uniqueid']][_0xd8b4('0xb4')]=_0x319f68[_0xd8b4('0xb4')];}if(this[_0xd8b4('0x23')][_0x319f68[_0xd8b4('0xe1')]]){this['uniqueId'][_0x319f68[_0xd8b4('0xe1')]]['channel']=_0x319f68['channel'];}};Dialer[_0xd8b4('0xad')]['syncQueueMember']=function(_0x4801df){if(strategy[this['voiceQueues'][this[_0xd8b4('0x126')][_0x4801df[_0xd8b4('0x127')]][_0xd8b4('0xb8')]]['strategy']]===_0xd8b4('0x18')){if(this[_0xd8b4('0x126')][_0x4801df['actionid']]&&_[_0xd8b4('0xb1')](this[_0xd8b4('0x126')][_0x4801df[_0xd8b4('0x127')]][_0xd8b4('0x128')])&&_0x4801df[_0xd8b4('0xb3')]==='1'&&_0x4801df[_0xd8b4('0x129')]==='0'){if(this[_0xd8b4('0x1e')][_0x4801df[_0xd8b4('0x12a')]]){if(!this[_0xd8b4('0x1e')][_0x4801df[_0xd8b4('0x12a')]][_0xd8b4('0x128')]){this[_0xd8b4('0x1e')][_0x4801df[_0xd8b4('0x12a')]][_0xd8b4('0x128')]=!![];this[_0xd8b4('0x126')][_0x4801df[_0xd8b4('0x127')]][_0xd8b4('0x128')]=!![];this[_0xd8b4('0x126')][_0x4801df[_0xd8b4('0x127')]][_0xd8b4('0x12a')]=_0x4801df['stateinterface'];}}}}else if((strategy[this[_0xd8b4('0x1c')][this[_0xd8b4('0x126')][_0x4801df[_0xd8b4('0x127')]][_0xd8b4('0xb8')]]['strategy']]||_0xd8b4('0x17'))===_0xd8b4('0x17')){if(this[_0xd8b4('0x126')][_0x4801df[_0xd8b4('0x127')]]){if(this[_0xd8b4('0x1e')][_0x4801df[_0xd8b4('0x12a')]]){this['actions'][_0x4801df['actionid']][_0xd8b4('0x12a')]=_0x4801df[_0xd8b4('0x12a')];if(_['isNil'](this[_0xd8b4('0x12b')][this[_0xd8b4('0x126')][_0x4801df[_0xd8b4('0x127')]][_0xd8b4('0xb8')]])){this['queueBooked'][this[_0xd8b4('0x126')][_0x4801df[_0xd8b4('0x127')]][_0xd8b4('0xb8')]]=[];}this[_0xd8b4('0x12b')][this[_0xd8b4('0x126')][_0x4801df['actionid']]['queue']]['push'](_[_0xd8b4('0x8b')](_[_0xd8b4('0xd6')](this[_0xd8b4('0x126')][_0x4801df['actionid']],['idHopper',_0xd8b4('0x12a')]),{'status':_0x4801df[_0xd8b4('0xb3')],'paused':_0x4801df[_0xd8b4('0x129')]}));}}}};function unlockQueueStatus(_0x31eba0,_0x3b809c){setTimeout(function(){if(_[_0xd8b4('0x3c')](_0x31eba0[_0xd8b4('0x12c')])){loggerBooked[_0xd8b4('0x95')]('[unlockQueueStatus][undefined]',_0x3b809c);}_0x31eba0[_0xd8b4('0x12c')]=!![];loggerBooked[_0xd8b4('0x78')]('[booked][unlockQueueStatus]',_0x3b809c,JSON[_0xd8b4('0x4a')](_[_0xd8b4('0xd6')](_0x31eba0,[_0xd8b4('0x3f'),_0xd8b4('0x12c')])));},0x1f3);}Dialer[_0xd8b4('0xad')][_0xd8b4('0x3a')]=function(_0x3dbbc3){var _0x1c89a4=this;var _0x4616fa=_0x1c89a4[_0xd8b4('0x1c')][_0x1c89a4[_0xd8b4('0x126')][_0x3dbbc3[_0xd8b4('0x127')]]['queue']];if(strategy[this[_0xd8b4('0x1c')][this[_0xd8b4('0x126')][_0x3dbbc3['actionid']][_0xd8b4('0xb8')]][_0xd8b4('0x12d')]]===_0xd8b4('0x18')){if(this[_0xd8b4('0x126')][_0x3dbbc3[_0xd8b4('0x127')]]&&this[_0xd8b4('0x126')][_0x3dbbc3[_0xd8b4('0x127')]][_0xd8b4('0x12a')]){this['preview'][_0xd8b4('0x12e')](this[_0xd8b4('0x126')][_0x3dbbc3[_0xd8b4('0x127')]][_0xd8b4('0x12f')],this[_0xd8b4('0x126')][_0x3dbbc3[_0xd8b4('0x127')]][_0xd8b4('0x12a')])[_0xd8b4('0xb5')](function(_0x5153f9){logger[_0xd8b4('0x95')](_0xd8b4('0x130'),util['inspect'](_0x5153f9,{'showHidden':![],'depth':null}));})['finally'](function(){_0x1c89a4[_0xd8b4('0xb7')](_0x1c89a4['voiceQueues'][_0x1c89a4['actions'][_0x3dbbc3[_0xd8b4('0x127')]]['queue']]);_0x1c89a4[_0xd8b4('0x1e')][_0x1c89a4[_0xd8b4('0x126')][_0x3dbbc3[_0xd8b4('0x127')]][_0xd8b4('0x12a')]][_0xd8b4('0x128')]=![];delete _0x1c89a4[_0xd8b4('0x126')][_0x3dbbc3[_0xd8b4('0x127')]];unlockQueueStatus(_0x4616fa);});}else{this[_0xd8b4('0xb7')](this[_0xd8b4('0x1c')][this[_0xd8b4('0x126')][_0x3dbbc3[_0xd8b4('0x127')]][_0xd8b4('0xb8')]]);this[_0xd8b4('0xc4')]({'active':![],'ContactId':this['actions'][_0x3dbbc3[_0xd8b4('0x127')]][_0xd8b4('0xd7')],'ListId':this[_0xd8b4('0x126')][_0x3dbbc3[_0xd8b4('0x127')]][_0xd8b4('0xd8')],'VoiceQueueId':this[_0xd8b4('0x126')][_0x3dbbc3[_0xd8b4('0x127')]][_0xd8b4('0x102')]||undefined,'CampaignId':this[_0xd8b4('0x126')][_0x3dbbc3['actionid']]['CampaignId']||undefined})[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0x131')));delete this[_0xd8b4('0x126')][_0x3dbbc3[_0xd8b4('0x127')]];unlockQueueStatus(_0x4616fa);}}else if((strategy[this[_0xd8b4('0x1c')][this[_0xd8b4('0x126')][_0x3dbbc3[_0xd8b4('0x127')]]['queue']][_0xd8b4('0x12d')]]||_0xd8b4('0x17'))===_0xd8b4('0x17')){var _0x26ec57;if(this[_0xd8b4('0x126')][_0x3dbbc3[_0xd8b4('0x127')]]&&!_[_0xd8b4('0x47')](this[_0xd8b4('0x12b')][this['actions'][_0x3dbbc3[_0xd8b4('0x127')]][_0xd8b4('0xb8')]])){if(this[_0xd8b4('0x132')][_0x1c89a4[_0xd8b4('0x126')][_0x3dbbc3['actionid']]['queue']]){this[_0xd8b4('0x132')][_0x1c89a4[_0xd8b4('0x126')][_0x3dbbc3[_0xd8b4('0x127')]][_0xd8b4('0xb8')]]=this[_0xd8b4('0x132')][this['actions'][_0x3dbbc3[_0xd8b4('0x127')]][_0xd8b4('0xb8')]]?this[_0xd8b4('0x132')][this[_0xd8b4('0x126')][_0x3dbbc3[_0xd8b4('0x127')]][_0xd8b4('0xb8')]]:this['queueBooked'][this[_0xd8b4('0x126')][_0x3dbbc3[_0xd8b4('0x127')]][_0xd8b4('0xb8')]]?this[_0xd8b4('0x12b')][this[_0xd8b4('0x126')][_0x3dbbc3['actionid']]['queue']][_0xd8b4('0x133')]||0x0:0x0;}this[_0xd8b4('0x12b')][this[_0xd8b4('0x126')][_0x3dbbc3[_0xd8b4('0x127')]][_0xd8b4('0xb8')]][_0xd8b4('0x133')]=this[_0xd8b4('0x132')][this['actions'][_0x3dbbc3[_0xd8b4('0x127')]][_0xd8b4('0xb8')]];for(var _0x4064e0=0x0;_0x4064e0=0x0;})[_0xd8b4('0xb5')](myreject(_0x1f4b1c)));}}else{_0x2ea1cd[_0xd8b4('0x14e')](ami['Action']({'action':_0xd8b4('0x14f'),'command':util[_0xd8b4('0x73')](_0xd8b4('0x150'),_0x438b5a,!_[_0xd8b4('0x3c')](config[_0xd8b4('0x14b')][_0x9ac597])?_0x9ac597:'')})[_0xd8b4('0xbd')](function(_0x17f606){return _0x17f606[_0xd8b4('0x154')][_0xd8b4('0x152')](_0xd8b4('0x153'))>=0x0;})[_0xd8b4('0xb5')](myreject(_0x1f4b1c)));}BPromise['all'](_0x2ea1cd)['then'](function(_0x2c035d){var _0x13d467=_[_0xd8b4('0x155')](_0x2c035d);if(_0x13d467){return _0x2fd0dc(_0x13d467);}else{_0x550f28[_0xd8b4('0x3d')]=_0x674559?'GLOBAL_INTERVAL_IS_OVERTIME':'INTERVAL_IS_OVERTIME';return _0x1f4b1c(msgResponse(_0xd8b4('0x156'),'Failure','Global:\x20'+_0x674559+'\x20'+_0x17bbcc+_0xd8b4('0x157')+util['inspect'](_0x438b5a,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x9ac597));}})[_0xd8b4('0xb5')](function(_0x2bdebe){return _0x1f4b1c(msgResponse(_0xd8b4('0x146'),_0xd8b4('0x148'),JSON['stringify'](_0x2bdebe)));});});};Dialer[_0xd8b4('0xad')][_0xd8b4('0x158')]=function(_0x288246){var _0xafbfcb=this;return function(){switch(_0x288246[_0xd8b4('0x57')]){case _0xd8b4('0x159'):freeVariablesPredictive(_0x288246);_0xafbfcb['handlePower'](_0x288246,0x1);break;case _0xd8b4('0x15a'):freeVariablesPredictive(_0x288246);_0xafbfcb[_0xd8b4('0x15b')](_0x288246,_0x288246['dialPowerLevel']);break;case'predictive':_0xafbfcb['predictive'](_0x288246);break;case _0xd8b4('0x15c'):freeVariablesPredictive(_0x288246);_0xafbfcb['handlePower'](_0x288246,0x1);break;default:freeVariablesPredictive(_0x288246);logger['error'](_0xd8b4('0x15d'),_0x288246['name'],'method\x20not\x20recognized');}};};Dialer['prototype'][_0xd8b4('0x15e')]=function(_0x5d0c4f){var _0x53c06c=this;return function(){_0x53c06c['handleIvr'](_0x5d0c4f);};};Dialer[_0xd8b4('0xad')][_0xd8b4('0x32')]=function(_0x5b3e0f){var _0x2ec1ab=this;if(isNotPreview(_0x5b3e0f[_0xd8b4('0x57')])){if(isVoiceQueueOutbound(_0x5b3e0f[_0xd8b4('0x4e')])&&isActive(_0x5b3e0f[_0xd8b4('0x15f')])){_0x5b3e0f[_0xd8b4('0xa1')]=!![];BPromise[_0xd8b4('0xbc')]()[_0xd8b4('0xbd')](checkIsLoggedIn(_0x5b3e0f,_0x5b3e0f[_0xd8b4('0x50')]))[_0xd8b4('0xbd')](checkIsActive(_0x5b3e0f,_0x5b3e0f[_0xd8b4('0x15f')]))[_0xd8b4('0xbd')](checkInterval(_0x5b3e0f))['then'](_0x2ec1ab[_0xd8b4('0x141')](_0x5b3e0f))[_0xd8b4('0xbd')](_0x2ec1ab[_0xd8b4('0x145')](_0x5b3e0f[_0xd8b4('0x160')],_0x5b3e0f['dialTimezone'],_0x5b3e0f[_0xd8b4('0x3f')],_0x5b3e0f))['then'](_0x2ec1ab[_0xd8b4('0x147')](_0x5b3e0f[_0xd8b4('0x43')],_0x5b3e0f[_0xd8b4('0x161')],_0x5b3e0f[_0xd8b4('0x3f')],_0x5b3e0f))[_0xd8b4('0xbd')](_0x2ec1ab[_0xd8b4('0x158')](_0x5b3e0f))[_0xd8b4('0xb5')](loggerCatchQueueSummary(_0xd8b4('0x162'),_0x5b3e0f));}else{notSendMessagesQueue(_0x5b3e0f);}}else{freeVariablesPredictive(_0x5b3e0f);}};Dialer['prototype'][_0xd8b4('0x140')]=function(){var _0x27bc11=this;var _0x52a44c;for(var _0x536bfe in this[_0xd8b4('0x1d')]){if(typeof this[_0xd8b4('0x1d')][_0x536bfe]!==_0xd8b4('0x99')){_0x52a44c=this[_0xd8b4('0x1d')][_0x536bfe];if(isCampaignIvr(_0x52a44c['type'])&&isActive(_0x52a44c[_0xd8b4('0x72')])){_0x52a44c['sendMessageOneNotActive']=!![];BPromise[_0xd8b4('0xbc')]()['then'](checkIsActive(_0x52a44c,_0x52a44c[_0xd8b4('0x72')]))[_0xd8b4('0xbd')](checkInterval(_0x52a44c))[_0xd8b4('0xbd')](_0x27bc11[_0xd8b4('0x141')](_0x52a44c))[_0xd8b4('0xbd')](_0x27bc11['checkIfTime'](_0x52a44c[_0xd8b4('0x160')],_0x52a44c[_0xd8b4('0x161')],_0x52a44c['name'],_0x52a44c))[_0xd8b4('0xbd')](_0x27bc11[_0xd8b4('0x147')](_0x52a44c[_0xd8b4('0x43')],_0x52a44c['dialTimezone'],_0x52a44c[_0xd8b4('0x3f')],_0x52a44c))[_0xd8b4('0xbd')](_0x27bc11[_0xd8b4('0x15e')](_0x52a44c))[_0xd8b4('0xb5')](loggerCatchQueueSummary(_0xd8b4('0x163'),_0x52a44c));}else{notSendMessagesCampaign(_0x52a44c);}}}};function getCallerIdRandom(_0x5b8238,_0x4ebe31){var _0x410c82;var _0x20d388;var _0x34a546;if(_0x4ebe31<=0x0){_0x4ebe31=0x1;}_0x410c82=new RegExp('\x5cw{0,'+_0x4ebe31+'}$');_0x20d388=Math['pow'](0xa,_0x4ebe31-0x1);_0x34a546=Math[_0xd8b4('0x164')](0xa,_0x4ebe31)-0x1;return util[_0xd8b4('0x73')]('%s',_['replace'](_0x5b8238,_0x410c82,_[_0xd8b4('0x165')](_0x20d388,_0x34a546)));}function extractCalleridName(_0x1fa956){var _0x2e5881=_0x1fa956['match'](/"(.*?)"/);return _0x2e5881?_0x2e5881[0x1]:_0x1fa956;}function extractCalleridNumber(_0x114141){var _0x3cc432=_0x114141[_0xd8b4('0x166')](/<(.*?)>/);return _0x3cc432?_0x3cc432[0x1]:_0x114141;}Dialer[_0xd8b4('0xad')][_0xd8b4('0x167')]=function(_0x38b9d2,_0x31974a){var _0x1000a4=this;var _0xa4cf98=uuid['v4']();this[_0xd8b4('0x126')][_0xa4cf98]=new Action(_0x38b9d2,_0x31974a,_0xa4cf98);return new BPromise(function(_0x4595d4,_0x19baa4){if(_[_0xd8b4('0x3c')](_0x38b9d2)&&typeof _0x38b9d2!==_0xd8b4('0x168')){return _0x19baa4(msgResponse(_0xd8b4('0x169'),'Failure',_0xd8b4('0x16a')));}if(_[_0xd8b4('0x3c')](_0x31974a['Contact'][_0xd8b4('0x16b')])||_0x31974a[_0xd8b4('0x16c')][_0xd8b4('0x16b')]===null){return _0x19baa4(msgResponse(_0xd8b4('0x169'),_0xd8b4('0x148'),_0xd8b4('0x16d')));}var _0x26a4d9={'XMD-CALLERID':_0x1000a4[_0xd8b4('0x126')][_0xa4cf98]['getCaller'](),'XMD-AGI':_0x38b9d2[_0xd8b4('0x10a')]?util[_0xd8b4('0x73')](_0xd8b4('0x16e'),ipAgi,_0x38b9d2[_0xd8b4('0x10a')]):_0xd8b4('0x16f'),'XMD-AGIAFTER':_0x38b9d2['dialQueueProject2']?util['format'](_0xd8b4('0x16e'),ipAgi,_0x38b9d2['dialQueueProject2']):_0xd8b4('0x16f'),'XMD-QUEUE':_0x38b9d2['type']===_0xd8b4('0x90')?util[_0xd8b4('0x73')]('\x22%s,%s%s,,,%s\x22',_0x38b9d2[_0xd8b4('0x3f')],_0x38b9d2[_0xd8b4('0x170')]||'',_0x38b9d2[_0xd8b4('0x171')]?'c':'',_0x38b9d2[_0xd8b4('0x172')]||0x3):_0xd8b4('0x16f'),'XMD-CONTACTID':_0x31974a[_0xd8b4('0xd7')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x1000a4[_0xd8b4('0x126')][_0xa4cf98][_0xd8b4('0x173')](),'XMD-AMD':_0x38b9d2['dialAMDActive']?_0xd8b4('0x174'):'NONE','XMD-DESTINATION':'xcally-motion-dialer'};if(_0x38b9d2[_0xd8b4('0xee')]){_0x26a4d9['XMD-AMDINITIALSILENCE']=_0x38b9d2[_0xd8b4('0x175')]||0x9c4;_0x26a4d9[_0xd8b4('0x176')]=_0x38b9d2['dialAMDGreeting']||0x5dc;_0x26a4d9[_0xd8b4('0x177')]=_0x38b9d2[_0xd8b4('0x178')]||0x320;_0x26a4d9[_0xd8b4('0x179')]=_0x38b9d2['dialAMDTotalAnalysisTime']||0x1388;_0x26a4d9[_0xd8b4('0x17a')]=_0x38b9d2[_0xd8b4('0x17b')]||0x64;_0x26a4d9['XMD-AMDBETWEENWORDSSILENCE']=_0x38b9d2['dialAMDBetweenWordsSilence']||0x32;_0x26a4d9[_0xd8b4('0x17c')]=_0x38b9d2[_0xd8b4('0x17d')]||0x3;_0x26a4d9[_0xd8b4('0x17e')]=_0x38b9d2[_0xd8b4('0x17f')]||0x100;_0x26a4d9[_0xd8b4('0x180')]=_0x38b9d2[_0xd8b4('0x181')]||0x1388;}if(_0x38b9d2[_0xd8b4('0x4e')]==='outbound'){_0x26a4d9[_0xd8b4('0x182')]=_0x31974a['VoiceQueueId'];}else{_0x26a4d9['XMD-CAMPAIGNID']=_0x31974a[_0xd8b4('0xd9')];}for(var _0x129fc1 in _0x31974a[_0xd8b4('0x16c')]){if(typeof _0x31974a['Contact'][_0x129fc1]!==_0xd8b4('0x99')){if(isNotNull(_0x31974a['Contact'][_0x129fc1])&&_0x129fc1!=='id'&&_0x129fc1!=='tags'&&_0x129fc1!==_0xd8b4('0x183')&&_0x129fc1!==_0xd8b4('0x184')){_0x26a4d9[util['format']('%s%s',_0xd8b4('0x185'),_[_0xd8b4('0x186')](_0x129fc1))]=_0x31974a[_0xd8b4('0x16c')][_0x129fc1];}}}var _0x30fd73=_0x1000a4['isTrunkReachable'](_0x38b9d2[_0xd8b4('0x71')])?getCallerId(_0x38b9d2[_0xd8b4('0x71')][_0xd8b4('0x187')],_0x38b9d2['dialOriginateCallerIdName'],_0x38b9d2['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x38b9d2['dialOriginateCallerIdNumber'],_0x38b9d2[_0xd8b4('0x188')]):_0x38b9d2[_0xd8b4('0x59')]):getCallerId(_[_0xd8b4('0xb1')](_0x38b9d2['TrunkBackup'])?_0x38b9d2[_0xd8b4('0x71')][_0xd8b4('0x187')]:_0x38b9d2[_0xd8b4('0x143')][_0xd8b4('0x187')],_0x38b9d2[_0xd8b4('0x58')],_0x38b9d2[_0xd8b4('0x188')]>0x0?getCallerIdRandom(_0x38b9d2[_0xd8b4('0x59')],_0x38b9d2[_0xd8b4('0x188')]):_0x38b9d2[_0xd8b4('0x59')]);if(_0x30fd73){_0x26a4d9[_0xd8b4('0x189')]=_0x1000a4[_0xd8b4('0x126')][_0xa4cf98]['originatecalleridname']=extractCalleridName(_0x30fd73);_0x26a4d9['XMD-ORIGINATECALLERIDNUM']=_0x1000a4[_0xd8b4('0x126')][_0xa4cf98][_0xd8b4('0x18a')]=extractCalleridNumber(_0x30fd73);}return ami[_0xd8b4('0xb2')]({'actionid':_0xa4cf98,'action':_0xd8b4('0x169'),'channel':_0x1000a4[_0xd8b4('0x142')](_0x38b9d2[_0xd8b4('0x71')])?util[_0xd8b4('0x73')](_0xd8b4('0x18b'),_0x38b9d2[_0xd8b4('0x71')][_0xd8b4('0x3f')],isNotNull(_0x38b9d2[_0xd8b4('0x18c')])?_0x38b9d2[_0xd8b4('0x18c')][_0xd8b4('0x18d')]()||'':'',_0x38b9d2['dialCutDigit']>0x0?_0x31974a[_0xd8b4('0x16c')]['phone'][_0xd8b4('0x18e')](_0x38b9d2[_0xd8b4('0x18f')]):_0x31974a[_0xd8b4('0x16c')][_0xd8b4('0x16b')]):util[_0xd8b4('0x73')](_0xd8b4('0x18b'),_['isNil'](_0x38b9d2[_0xd8b4('0x143')])?_0x38b9d2[_0xd8b4('0x71')][_0xd8b4('0x3f')]:_0x38b9d2[_0xd8b4('0x143')][_0xd8b4('0x3f')],isNotNull(_0x38b9d2[_0xd8b4('0x18c')])?_0x38b9d2[_0xd8b4('0x18c')][_0xd8b4('0x18d')]()||'':'',_0x38b9d2['dialCutDigit']>0x0?_0x31974a[_0xd8b4('0x16c')][_0xd8b4('0x16b')]['substring'](_0x38b9d2[_0xd8b4('0x18f')]):_0x31974a[_0xd8b4('0x16c')][_0xd8b4('0x16b')]),'callerid':_0x30fd73,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x26a4d9,'timeout':(_0x38b9d2[_0xd8b4('0x5a')]||0x1e)*0x3e8,'async':!![],'channelid':_0xa4cf98})[_0xd8b4('0xbd')](function(_0x5bb52e){return _0x4595d4(_0x5bb52e);})[_0xd8b4('0xb5')](function(_0x718339){_0x38b9d2['outboundOriginateFailureCallsDay']+=0x1;var _0x34e308=new History(_0x1000a4[_0xd8b4('0x126')][_0xa4cf98]);logger['error'](util[_0xd8b4('0x73')]('[originateError]:\x20%s',JSON['stringify'](_0x718339)));_0x34e308[_0xd8b4('0xa9')]=0xe;_0x34e308[_0xd8b4('0xaa')]=_0xd8b4('0x190');_0x34e308[_0xd8b4('0xac')]=moment()[_0xd8b4('0x73')](_0xd8b4('0x101'));_0x34e308['endtime']=_0x34e308['starttime'];_0x1000a4[_0xd8b4('0xd0')](_0x34e308)['catch'](loggerCatch('[originate][error]'));_0x1000a4[_0xd8b4('0xce')](_0x34e308)[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0x191')))[_0xd8b4('0x1a')](function(){delete _0x1000a4[_0xd8b4('0x126')][_0xa4cf98];return _0x19baa4(msgResponse(_0xd8b4('0x169'),_0xd8b4('0x49'),_0xd8b4('0x192')));});});});};Dialer['prototype'][_0xd8b4('0x2e')]=function(_0x49e0fa){var _0x1f3845=this[_0xd8b4('0x126')][_0x49e0fa[_0xd8b4('0x127')]];if(_0x1f3845){delete this[_0xd8b4('0x126')][_0x49e0fa[_0xd8b4('0x127')]];_0x1f3845[_0xd8b4('0x193')]=moment()['format'](_0xd8b4('0x101'));var _0x47a00=_0x1f3845[_0xd8b4('0x4e')]===_0xd8b4('0x76')?this['campaigns'][_0x1f3845[_0xd8b4('0xb8')]]:this[_0xd8b4('0x1c')][_0x1f3845['getQueue']()];if(!this['isSuccess'](_0x49e0fa[_0xd8b4('0x194')])){this[_0xd8b4('0xb7')](_0x47a00);return this['callProgressDetecting'](_0x1f3845,_0x47a00,_0x49e0fa)[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0x195')));}this[_0xd8b4('0x23')][_0x49e0fa[_0xd8b4('0xe1')]]=_0x1f3845;}};Dialer[_0xd8b4('0xad')][_0xd8b4('0x196')]=function(_0x46ea84,_0x90614b,_0x2fb873){var _0x53ec06=new History(_0x90614b);if(_0x53ec06[_0xd8b4('0x106')]+_0x53ec06[_0xd8b4('0xf4')]+_0x53ec06['countnoanswerretry']+_0x53ec06[_0xd8b4('0xf6')]+_0x53ec06['countdropretry']+_0x53ec06[_0xd8b4('0xf8')]+_0x53ec06[_0xd8b4('0xf0')]+_0x53ec06[_0xd8b4('0x197')]>=_0x2fb873[_0xd8b4('0xf9')]-0x1){return!![];}switch(_0x46ea84){case 0x3:if(_0x53ec06[_0xd8b4('0xf5')]>=_0x2fb873[_0xd8b4('0x198')]-0x1){return!![];}this[_0xd8b4('0xc4')]({'active':![],'countnoanswerretry':_0x53ec06[_0xd8b4('0xf5')]+=0x1,'scheduledat':moment()['add'](_0x2fb873[_0xd8b4('0x199')],_0xd8b4('0x100'))['format'](_0xd8b4('0x101')),'ContactId':_0x53ec06[_0xd8b4('0xd7')],'ListId':_0x53ec06[_0xd8b4('0xd8')],'VoiceQueueId':_0x53ec06[_0xd8b4('0x102')]||undefined,'CampaignId':_0x53ec06['CampaignId']||undefined})[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0x19a')));break;case 0x5:if(_0x53ec06[_0xd8b4('0x106')]>=_0x2fb873['dialBusyMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x53ec06[_0xd8b4('0x106')]+=0x1,'scheduledat':moment()[_0xd8b4('0xfe')](_0x2fb873[_0xd8b4('0x19b')],'minutes')[_0xd8b4('0x73')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x53ec06['ContactId'],'ListId':_0x53ec06[_0xd8b4('0xd8')],'VoiceQueueId':_0x53ec06[_0xd8b4('0x102')]||undefined,'CampaignId':_0x53ec06[_0xd8b4('0xd9')]||undefined})['catch'](loggerCatch(_0xd8b4('0x19c')));break;case 0x8:if(_0x53ec06[_0xd8b4('0xf4')]>=_0x2fb873[_0xd8b4('0x19d')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x53ec06[_0xd8b4('0xf4')]+=0x1,'scheduledat':moment()[_0xd8b4('0xfe')](_0x2fb873[_0xd8b4('0x19e')],_0xd8b4('0x100'))[_0xd8b4('0x73')](_0xd8b4('0x101')),'ContactId':_0x53ec06[_0xd8b4('0xd7')],'ListId':_0x53ec06['ListId'],'VoiceQueueId':_0x53ec06[_0xd8b4('0x102')]||undefined,'CampaignId':_0x53ec06[_0xd8b4('0xd9')]||undefined})[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0x19f')));break;case 0x0:if(_0x53ec06['countnosuchnumberretry']>=_0x2fb873[_0xd8b4('0x1a0')]-0x1){return!![];}else{this[_0xd8b4('0xc4')]({'active':![],'countnosuchnumberretry':_0x53ec06['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xd8b4('0xfe')](_0x2fb873['dialNoSuchNumberRetryFrequency'],_0xd8b4('0x100'))[_0xd8b4('0x73')](_0xd8b4('0x101')),'ContactId':_0x53ec06[_0xd8b4('0xd7')],'ListId':_0x53ec06['ListId'],'VoiceQueueId':_0x53ec06[_0xd8b4('0x102')]||undefined,'CampaignId':_0x53ec06[_0xd8b4('0xd9')]||undefined})[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0x1a1')));}break;case 0xa:if(_0x53ec06[_0xd8b4('0xf7')]>=_0x2fb873[_0xd8b4('0x11c')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x53ec06[_0xd8b4('0xf7')]+=0x1,'scheduledat':moment()[_0xd8b4('0xfe')](_0x2fb873[_0xd8b4('0x11d')],_0xd8b4('0x100'))[_0xd8b4('0x73')](_0xd8b4('0x101')),'ContactId':_0x53ec06[_0xd8b4('0xd7')],'ListId':_0x53ec06[_0xd8b4('0xd8')],'VoiceQueueId':_0x53ec06[_0xd8b4('0x102')]||undefined,'CampaignId':_0x53ec06[_0xd8b4('0xd9')]||undefined})['catch'](loggerCatch(_0xd8b4('0x11e')));break;case 0xb:if(_0x53ec06['countabandonedretry']>=_0x2fb873[_0xd8b4('0x124')]-0x1){return!![];}this[_0xd8b4('0xc4')]({'active':![],'countabandonedretry':_0x53ec06[_0xd8b4('0xf8')]+=0x1,'scheduledat':moment()['add'](_0x2fb873[_0xd8b4('0x1a2')],_0xd8b4('0x100'))[_0xd8b4('0x73')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x53ec06['ContactId'],'ListId':_0x53ec06['ListId'],'VoiceQueueId':_0x53ec06[_0xd8b4('0x102')]||undefined,'CampaignId':_0x53ec06[_0xd8b4('0xd9')]||undefined})[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0x1a3')));break;case 0x13:if(_0x53ec06[_0xd8b4('0xf0')]>=_0x2fb873[_0xd8b4('0xfc')]-0x1){return!![];}this[_0xd8b4('0xc4')]({'active':![],'countmachineretry':_0x53ec06[_0xd8b4('0xf0')]+=0x1,'scheduledat':moment()[_0xd8b4('0xfe')](_0x2fb873[_0xd8b4('0xff')],_0xd8b4('0x100'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x53ec06['ContactId'],'ListId':_0x53ec06[_0xd8b4('0xd8')],'VoiceQueueId':_0x53ec06[_0xd8b4('0x102')]||undefined,'CampaignId':_0x53ec06['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x53ec06[_0xd8b4('0x197')]>=_0x2fb873['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0xd8b4('0xc4')]({'active':![],'countagentrejectretry':_0x53ec06[_0xd8b4('0x197')]+=0x1,'scheduledat':moment()[_0xd8b4('0xfe')](_0x2fb873['dialAgentRejectRetryFrequency'],_0xd8b4('0x100'))['format'](_0xd8b4('0x101')),'ContactId':_0x53ec06[_0xd8b4('0xd7')],'ListId':_0x53ec06[_0xd8b4('0xd8')],'VoiceQueueId':_0x53ec06[_0xd8b4('0x102')]||undefined,'CampaignId':_0x53ec06[_0xd8b4('0xd9')]||undefined})[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0x1a4')));break;default:return!![];}};Dialer['prototype']['callProgressDetecting']=function(_0x3a2b3c,_0x5e7ade,_0x16f1aa){var _0x5a9366=this;var _0x1b9d95=new History(_0x3a2b3c);return new BPromise(function(_0x228c0b,_0x213d49){if(_[_0xd8b4('0x3c')](_0x5e7ade)&&typeof _0x5e7ade!==_0xd8b4('0x168')){return _0x213d49(msgResponse(_0xd8b4('0x1a5'),_0xd8b4('0x148'),'entity\x20is\x20undefine'));}if(_[_0xd8b4('0x3c')](_0x16f1aa)&&typeof _0x16f1aa!==_0xd8b4('0x168')){return _0x213d49(msgResponse(_0xd8b4('0x1a5'),_0xd8b4('0x148'),'evt\x20is\x20undefine'));}switch(_0x16f1aa[_0xd8b4('0x111')]){case'0':_0x5e7ade[_0xd8b4('0x1a6')]+=0x1;_0x1b9d95[_0xd8b4('0xa9')]=0x0;_0x1b9d95[_0xd8b4('0xaa')]=_0xd8b4('0x1a7');_0x1b9d95[_0xd8b4('0xf6')]+=0x1;_0x1b9d95['countglobal']+=0x1;ami[_0xd8b4('0x4d')]('custom:agentnosuchnumber',ut['buildObj'](_0x3a2b3c,_0xd8b4('0x1a8')));_0x5a9366[_0xd8b4('0xd0')](_0x1b9d95)['catch'](loggerCatch(_0xd8b4('0xf3')));if(_0x5a9366[_0xd8b4('0x196')](0x0,_0x3a2b3c,_0x5e7ade)){if(_0x1b9d95['countnosuchnumberretry']>=_0x5e7ade[_0xd8b4('0x1a0')]){_0x5a9366[_0xd8b4('0x107')](_0x1b9d95,_0x228c0b,_0x213d49,_0xd8b4('0x1a9'));}else{_0x5a9366[_0xd8b4('0xfa')](_0x1b9d95,_0x228c0b,_0x213d49,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x5e7ade[_0xd8b4('0x60')]+=0x1;_0x1b9d95['state']=0x3;_0x1b9d95['statedesc']='NoAnswer';_0x1b9d95[_0xd8b4('0xf5')]+=0x1;_0x1b9d95[_0xd8b4('0xf1')]+=0x1;ami['emit'](_0xd8b4('0x1aa'),ut[_0xd8b4('0xeb')](_0x3a2b3c,_0xd8b4('0x1ab')));_0x5a9366[_0xd8b4('0xd0')](_0x1b9d95)['catch'](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x5a9366[_0xd8b4('0x196')](0x3,_0x3a2b3c,_0x5e7ade)){if(_0x1b9d95[_0xd8b4('0xf5')]>=_0x5e7ade[_0xd8b4('0x198')]){_0x5a9366['createStateFinal'](_0x1b9d95,_0x228c0b,_0x213d49,'reason\x203\x20ringing\x20no\x20answer');}else{_0x5a9366[_0xd8b4('0xfa')](_0x1b9d95,_0x228c0b,_0x213d49,_0xd8b4('0x1ac'));}}break;case'5':_0x5e7ade['outboundBusyCallsDay']+=0x1;_0x1b9d95[_0xd8b4('0xa9')]=0x5;_0x1b9d95['statedesc']=_0xd8b4('0x1ad');_0x1b9d95[_0xd8b4('0x106')]+=0x1;_0x1b9d95['countglobal']+=0x1;ami[_0xd8b4('0x4d')](_0xd8b4('0x1ae'),ut['buildObj'](_0x3a2b3c,'busy'));_0x5a9366['createHistory'](_0x1b9d95)[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0x1af')));if(_0x5a9366['checkRetriveMax'](0x5,_0x3a2b3c,_0x5e7ade)){if(_0x1b9d95['countbusyretry']>=_0x5e7ade[_0xd8b4('0x1b0')]){_0x5a9366[_0xd8b4('0x107')](_0x1b9d95,_0x228c0b,_0x213d49,_0xd8b4('0x1b1'));}else{_0x5a9366[_0xd8b4('0xfa')](_0x1b9d95,_0x228c0b,_0x213d49,_0xd8b4('0x1b1'));}}break;case'8':_0x5e7ade['outboundCongestionCallsDay']+=0x1;_0x1b9d95[_0xd8b4('0xa9')]=0x8;_0x1b9d95[_0xd8b4('0xaa')]=_0xd8b4('0x1b2');_0x1b9d95[_0xd8b4('0xf4')]+=0x1;_0x1b9d95[_0xd8b4('0xf1')]+=0x1;ami[_0xd8b4('0x4d')](_0xd8b4('0x1b3'),ut[_0xd8b4('0xeb')](_0x3a2b3c,_0xd8b4('0x1b4')));_0x5a9366[_0xd8b4('0xd0')](_0x1b9d95)[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0x1b5')));if(_0x5a9366[_0xd8b4('0x196')](0x8,_0x3a2b3c,_0x5e7ade)){if(_0x1b9d95['countcongestionretry']>=_0x5e7ade[_0xd8b4('0x19d')]){_0x5a9366[_0xd8b4('0x107')](_0x1b9d95,_0x228c0b,_0x213d49,_0xd8b4('0x1b6'));}else{_0x5a9366[_0xd8b4('0xfa')](_0x1b9d95,_0x228c0b,_0x213d49,'reason\x208\x20congestion');}}break;case'11':_0x5e7ade[_0xd8b4('0x1b7')]+=0x1;_0x1b9d95[_0xd8b4('0xa9')]=0xb;_0x1b9d95['statedesc']=_0xd8b4('0x122');_0x1b9d95[_0xd8b4('0xf8')]+=0x1;_0x1b9d95[_0xd8b4('0xf1')]+=0x1;_0x5a9366[_0xd8b4('0xd0')](_0x1b9d95)['catch'](loggerCatch(_0xd8b4('0x125')));if(_0x5a9366[_0xd8b4('0x196')](0xb,_0x3a2b3c,_0x5e7ade)){if(_0x1b9d95[_0xd8b4('0xf8')]>=_0x5e7ade['dialAbandonedMaxRetry']){_0x5a9366['createStateFinal'](_0x1b9d95,_0x228c0b,_0x213d49,_0xd8b4('0x1b8'));}else{_0x5a9366[_0xd8b4('0xfa')](_0x1b9d95,_0x228c0b,_0x213d49,'reason\x2011\x20abandoned');}}break;case'20':_0x5e7ade[_0xd8b4('0x63')]+=0x1;_0x1b9d95[_0xd8b4('0xa9')]=0x14;_0x1b9d95['statedesc']='AgentReject';_0x1b9d95[_0xd8b4('0x197')]+=0x1;_0x1b9d95[_0xd8b4('0xf1')]+=0x1;ami[_0xd8b4('0x4d')]('custom:agentreject',ut[_0xd8b4('0xeb')](_0x3a2b3c,_0xd8b4('0x1b9')));_0x5a9366['createHistory'](_0x1b9d95)[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0x1ba')));if(_0x5a9366[_0xd8b4('0x196')](0x14,_0x3a2b3c,_0x5e7ade)){if(_0x1b9d95[_0xd8b4('0x197')]>=_0x5e7ade[_0xd8b4('0x1bb')]){_0x5a9366[_0xd8b4('0x107')](_0x1b9d95,_0x228c0b,_0x213d49,_0xd8b4('0x1bc'));}else{_0x5a9366[_0xd8b4('0xfa')](_0x1b9d95,_0x228c0b,_0x213d49,'reason\x2020\x20agentreject');}}break;default:_0x5e7ade[_0xd8b4('0x64')]+=0x1;_0x1b9d95['state']=0xc;_0x1b9d95[_0xd8b4('0xaa')]=_0x16f1aa[_0xd8b4('0x111')];_0x5a9366[_0xd8b4('0xd0')](_0x1b9d95)[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0x1bd')));if(_0x5a9366[_0xd8b4('0x196')](_0x16f1aa[_0xd8b4('0x111')],_0x3a2b3c,_0x5e7ade)){if(_0x1b9d95[_0xd8b4('0x106')]+_0x1b9d95['countcongestionretry']+_0x1b9d95['countnoanswerretry']+_0x1b9d95['countnosuchnumberretry']+_0x1b9d95[_0xd8b4('0xf7')]+_0x1b9d95[_0xd8b4('0xf8')]+_0x1b9d95[_0xd8b4('0xf0')]+_0x1b9d95[_0xd8b4('0x197')]>=_0x5e7ade['dialGlobalMaxRetry']){_0x5a9366[_0xd8b4('0xfa')](_0x1b9d95,_0x228c0b,_0x213d49,_0x16f1aa[_0xd8b4('0x111')]);}else{_0x5a9366[_0xd8b4('0x107')](_0x1b9d95,_0x228c0b,_0x213d49,_0x16f1aa[_0xd8b4('0x111')]);}}}});};Dialer[_0xd8b4('0xad')][_0xd8b4('0xfa')]=function(_0x328f20,_0x57a728,_0x2a1c92,_0x3dcb22){var _0x1113c0=new Final(_0x328f20);_0x1113c0[_0xd8b4('0xa9')]=0xf;_0x1113c0[_0xd8b4('0xaa')]=_0xd8b4('0x1be');this[_0xd8b4('0x107')](_0x1113c0,_0x57a728,_0x2a1c92,_0x3dcb22);};Dialer[_0xd8b4('0xad')][_0xd8b4('0x107')]=function(_0x5b164f,_0x4fed6b,_0x224e7a,_0x2a6367){this['moveContactManagedDialer'](_0x5b164f)[_0xd8b4('0xbd')](function(){return _0x4fed6b(msgResponse(_0xd8b4('0x1a5'),_0xd8b4('0xdd'),_0x2a6367));})[_0xd8b4('0xb5')](function(){return _0x224e7a(msgResponse('[moveContactManagedDialer][0]',_0xd8b4('0x148'),_0xd8b4('0x1bf')));});};Dialer[_0xd8b4('0xad')][_0xd8b4('0x9')]=function(_0xf62363){var _0x8b9c83=_0xf62363['dialPredictiveOptimizationPercentage']/0x64;var _0x1f0890=_0xf62363[_0xd8b4('0x5f')]/(_0xf62363[_0xd8b4('0x5f')]+_0xf62363[_0xd8b4('0xe7')]);var _0x499253=Math['round'](_0xf62363['predictiveIntervalAvailable']*(_0xf62363['predictiveIntervalMaxThreshold']/0x64));var _0x431958=Math[_0xd8b4('0x1c0')](_0xf62363['predictiveIntervalAvailable']*(_0xf62363[_0xd8b4('0x1c1')]/0x64));var _0x264863=_0xf62363[_0xd8b4('0x4f')]+_0xf62363['talking'];var _0x1a31bc=Math[_0xd8b4('0x1c2')](_0xf62363['erlangCalls']*_0xf62363['erlangAbandonmentRate']*_0xf62363[_0xd8b4('0x6a')]*_0xf62363[_0xd8b4('0x1c3')]);if(_[_0xd8b4('0x3c')](_0xf62363[_0xd8b4('0x26')])){if(!_[_0xd8b4('0x3c')](_0xf62363[_0xd8b4('0x25')])){_0xf62363[_0xd8b4('0x25')]=undefined;loggerPredictive['error'](_0xd8b4('0x1c4'),_0xd8b4('0x1c5'));}if(!_[_0xd8b4('0x3c')](_0xf62363[_0xd8b4('0x8f')])){loggerPredictive[_0xd8b4('0x95')]('[startMethodPredictive][StartProgressive]',_0xd8b4('0x1c6'));clearInterval(_0xf62363[_0xd8b4('0x8f')]);_0xf62363[_0xd8b4('0x8f')]=undefined;}_0xf62363[_0xd8b4('0x26')]=moment()[_0xd8b4('0x73')](_0xd8b4('0x101'));loggerPredictive[_0xd8b4('0x78')](_0xf62363[_0xd8b4('0x3f')],_0xd8b4('0x1c7'),_0xf62363[_0xd8b4('0x26')]);this[_0xd8b4('0x15b')](_0xf62363,0x1);}else if(ifInterval(_0xf62363['dialPredictiveInterval'],_0xf62363[_0xd8b4('0x26')])){this[_0xd8b4('0x15b')](_0xf62363,0x1);loggerPredictiveCalls['info'](_0xd8b4('0x1c8'),_0xf62363['startProgressive'],_0xf62363[_0xd8b4('0x3f')]);_0xf62363['erlangCalls']=0x0;_0xf62363['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x8b9c83<_0x1f0890&&_0xf62363[_0xd8b4('0x1c9')]===_0xd8b4('0x1ca')){freeVariablesPredictive(_0xf62363);loggerPredictive[_0xd8b4('0x78')](_0xd8b4('0x1cb'),_0xd8b4('0x1cc'),_0x1f0890,_0xd8b4('0x26'),_0xf62363[_0xd8b4('0x3f')]);}else if(_0x1a31bc<_0xf62363['predictiveIntervalErlangCallsDroppedCalls']&&_0xf62363['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0xf62363);loggerPredictive[_0xd8b4('0x78')](_0xd8b4('0x1cd'),_0xd8b4('0x1ce'),_0x1a31bc,_0xd8b4('0x1cf'),_0xf62363[_0xd8b4('0x69')],'startProgressive',_0xf62363['name']);}else if(!ifInterval(_0xf62363[_0xd8b4('0x1d0')],_0xf62363['startProgressive'])&&_[_0xd8b4('0x3c')](_0xf62363[_0xd8b4('0x25')])&&!_[_0xd8b4('0x3c')](_0xf62363[_0xd8b4('0x26')])){_0xf62363[_0xd8b4('0x25')]=moment()[_0xd8b4('0x73')](_0xd8b4('0x101'));loggerPredictive[_0xd8b4('0x78')](_0xf62363[_0xd8b4('0x3f')],_0xd8b4('0x1d1'),_0xf62363[_0xd8b4('0x25')]);this[_0xd8b4('0x1d2')](_0xf62363[_0xd8b4('0x1d0')])[_0xd8b4('0xbd')](this[_0xd8b4('0x1d3')](_0xf62363))[_0xd8b4('0xbd')](mergeDataErlangB(_0xf62363))[_0xd8b4('0xbd')](this['startMethodPredictive'](_0xf62363))[_0xd8b4('0xb5')](loggerCatchPredictive(_0xd8b4('0x1d4'),_0xf62363));}else if(!ifInterval(_0xf62363[_0xd8b4('0x1d0')],_0xf62363[_0xd8b4('0x25')])){_0xf62363[_0xd8b4('0x69')]=0x0;_0xf62363[_0xd8b4('0x25')]=moment()[_0xd8b4('0x73')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xd8b4('0x78')](_0xf62363[_0xd8b4('0x3f')],_0xd8b4('0x1d5'),_0xf62363[_0xd8b4('0x25')]);clearInterval(_0xf62363[_0xd8b4('0x8f')]);_0xf62363[_0xd8b4('0x8f')]=undefined;this[_0xd8b4('0x1d2')](_0xf62363[_0xd8b4('0x1d0')])[_0xd8b4('0xbd')](this[_0xd8b4('0x1d3')](_0xf62363))[_0xd8b4('0xbd')](mergeDataErlangB(_0xf62363))['then'](this[_0xd8b4('0x1d6')](_0xf62363))[_0xd8b4('0xb5')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0xf62363));}else if(_0xf62363[_0xd8b4('0x6c')]&&_0x264863<_0xf62363[_0xd8b4('0x6c')]-_0x431958){freeVariablesPredictive(_0xf62363);loggerPredictive[_0xd8b4('0x78')](_0xf62363[_0xd8b4('0x3f')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x264863,_0xd8b4('0x1d7'),_0xf62363[_0xd8b4('0x6c')],'-',_0x431958,'=',_0xf62363[_0xd8b4('0x6c')]-_0x431958,')');}else if(_0xf62363[_0xd8b4('0x6c')]&&_0x264863>_0xf62363[_0xd8b4('0x6c')]+_0x499253){freeVariablesPredictive(_0xf62363);loggerPredictive[_0xd8b4('0x78')](_0xf62363[_0xd8b4('0x3f')],_0xd8b4('0x1d8'),_0x264863,_0xd8b4('0x1d9'),_0xf62363[_0xd8b4('0x6c')],'+',_0x499253,'=',_0xf62363[_0xd8b4('0x6c')]+_0x499253,')');}};Dialer['prototype'][_0xd8b4('0x1d3')]=function(_0x1978f1){var _0x5cc5bb=this;return function(_0x3d0d3d){return new BPromise(function(_0x12ef13,_0x506118){_['merge'](_0x1978f1,_0x3d0d3d[0x0]);if(checkGetDataPredictive(_0x3d0d3d[0x0])){var _0x4f2ea9=_0x1978f1[_0xd8b4('0x6c')]=_0x1978f1['talking']+_0x1978f1[_0xd8b4('0x4f')];var _0x544f00=_0x1978f1[_0xd8b4('0x1d0')]*0x3c;var _0x1616d2=_0x3d0d3d[0x0][_0xd8b4('0x81')]+_0x3d0d3d[0x0]['predictiveIntervalAvgHoldtime'];var _0x7a8a88=(_0x3d0d3d[0x0][_0xd8b4('0x7c')]+_0x3d0d3d[0x0][_0xd8b4('0x67')]+_0x3d0d3d[0x0][_0xd8b4('0x66')])/_0x3d0d3d[0x0][_0xd8b4('0x6d')];_0x1978f1['predictiveIntervalHitRate']=_0x7a8a88>0x0?_0x7a8a88:0x1;switch(_0x1978f1[_0xd8b4('0x1c9')]){case _0xd8b4('0x1ca'):var _0x5a1f42=_0x1978f1[_0xd8b4('0x1da')]/0x64;return _0x5cc5bb[_0xd8b4('0x1db')](_0x4f2ea9,_0x544f00,_0x1616d2,_0x7a8a88,_0x5a1f42)['then'](function(_0xe39a9b){return _0x12ef13(_0xe39a9b);});case _0xd8b4('0x1dc'):var _0x4979a7=_0x1978f1[_0xd8b4('0x1da')]/0x64;return _0x5cc5bb[_0xd8b4('0x1dd')](_0x4f2ea9,_0x544f00,_0x1616d2,_0x7a8a88,_0x4979a7)[_0xd8b4('0xbd')](function(_0x24f790){return _0x12ef13(_0x24f790);});default:return _0x506118(msgResponse('[getDataPredictive]',_0xd8b4('0x148'),_0xd8b4('0x1de')));}}else{return _0x506118(msgResponse(_0xd8b4('0x1df'),_0xd8b4('0x148'),_0xd8b4('0x1e0')));}});};};Dialer[_0xd8b4('0xad')][_0xd8b4('0x1e1')]=function(_0x22c1f1){var _0x3bfe35=this;return function(_0x12ea4a){return new BPromise(function(_0x2ba281,_0x192fad){_[_0xd8b4('0x8b')](_0x22c1f1,_0x12ea4a[0x0]);if(checkGetDataPredictive(_0x12ea4a[0x0])){loggerPredictive[_0xd8b4('0x78')](JSON[_0xd8b4('0x4a')](_0x12ea4a[0x0]));if(_0x22c1f1[_0xd8b4('0x1c9')]===_0xd8b4('0x1ca')){return _0x3bfe35['getVoiceQueueRtPauses'](_0x22c1f1['id'])[_0xd8b4('0xbd')](function(_0x10daa9){var _0x3ac1c=_0x22c1f1['loggedIn']-_0x10daa9[0x0][_0xd8b4('0x1e2')];var _0xb5ea12=_0x22c1f1[_0xd8b4('0x1d0')]*0x3c;var _0x4b952e=_0x12ea4a[0x0]['predictiveIntervalAvgTalktime']+_0x12ea4a[0x0][_0xd8b4('0x65')];var _0x4b3357=(_0x12ea4a[0x0][_0xd8b4('0x7c')]+_0x12ea4a[0x0][_0xd8b4('0x67')]+_0x12ea4a[0x0][_0xd8b4('0x66')])/_0x12ea4a[0x0][_0xd8b4('0x6d')];var _0x58b627=_0x22c1f1['dialPredictiveOptimizationPercentage']/0x64;_0x22c1f1[_0xd8b4('0x6b')]=_0x10daa9[0x0]['outboundQueuePauses']||0x0;_0x22c1f1[_0xd8b4('0x6a')]=_0x4b3357>0x0?_0x4b3357:0x1;return _0x3bfe35[_0xd8b4('0x1db')](_0x3ac1c,_0xb5ea12,_0x4b952e,_0x4b3357,_0x58b627);})[_0xd8b4('0xbd')](function(_0x14fbac){return _0x2ba281(_0x14fbac);})[_0xd8b4('0xb5')](function(_0x5d4346){return _0x192fad(msgResponse(_0xd8b4('0x1e3'),_0xd8b4('0x148'),JSON['stringify'](_0x5d4346)));});}if(_0x22c1f1['dialPredictiveOptimization']===_0xd8b4('0x1dc')){return _0x3bfe35[_0xd8b4('0xcd')](_0x22c1f1['id'])[_0xd8b4('0xbd')](function(_0xf6f716){var _0x2b5dd2=_0x22c1f1['loggedIn']-_0xf6f716[0x0]['outboundQueuePauses'];var _0x1d81e8=_0x22c1f1[_0xd8b4('0x1d0')]*0x3c;var _0x520b3c=_0x12ea4a[0x0][_0xd8b4('0x81')]+_0x12ea4a[0x0][_0xd8b4('0x65')];var _0x39f8b1=(_0x12ea4a[0x0][_0xd8b4('0x7c')]+_0x12ea4a[0x0][_0xd8b4('0x67')]+_0x12ea4a[0x0][_0xd8b4('0x66')])/_0x12ea4a[0x0][_0xd8b4('0x6d')];var _0x267006=_0x22c1f1[_0xd8b4('0x1da')]/0x64;_0x22c1f1['predictiveIntervalPauses']=_0xf6f716[0x0][_0xd8b4('0x1e2')]||0x0;_0x22c1f1[_0xd8b4('0x6a')]=_0x39f8b1>0x0?_0x39f8b1:0x1;return _0x3bfe35['busyFactor'](_0x2b5dd2,_0x1d81e8,_0x520b3c,_0x39f8b1,_0x267006);})['then'](function(_0x405268){return _0x2ba281(_0x405268);})[_0xd8b4('0xb5')](function(_0x191465){return _0x192fad(msgResponse(_0xd8b4('0x1e3'),_0xd8b4('0x148'),JSON['stringify'](_0x191465)));});}}else{return _0x192fad(msgResponse(_0xd8b4('0x1df'),_0xd8b4('0x148'),_0xd8b4('0x1e0')));}});};};Dialer['prototype'][_0xd8b4('0x1d6')]=function(_0x3056cb){var _0x228730=this;return function(){var _0x4a6e0c=0x0;var _0x2436ae=Math['floor'](_0x3056cb[_0xd8b4('0x6e')]*0x3e8);if(_0x2436ae>0x0){_0x2436ae=_0x2436ae<0x64?0x64:_0x2436ae;loggerPredictive['info'](_0x3056cb[_0xd8b4('0x3f')],_0xd8b4('0x1e4'),_0x2436ae,_0xd8b4('0x4b'));_0x3056cb[_0xd8b4('0x8f')]=setInterval(function(){_0x228730['handlePredictive'](_0x3056cb);loggerPredictiveCalls[_0xd8b4('0x78')](_0xd8b4('0x1e5'),_0x4a6e0c+=0x1);},_0x2436ae);}else{loggerPredictive[_0xd8b4('0x78')](_0x3056cb['name'],_0xd8b4('0x1e6'));}};};Dialer['prototype'][_0xd8b4('0x1e7')]=function(_0x91abc1,_0x3915db){var _0x49a8fe=this;return function(_0x510213){if(_['isEmpty'](_0x510213)){if(_['isNil'](_0x3915db[_0xd8b4('0x1e8')])||!_0x3915db[_0xd8b4('0x1e9')]){if(_0x91abc1[_0xd8b4('0x57')]===_0xd8b4('0x15c')){_0x91abc1[_0xd8b4('0x12c')]=_[_0xd8b4('0x3c')](_0x91abc1[_0xd8b4('0x12c')])?!![]:_0x91abc1['queueStatusComplete'];var _0x3cf41f=uuid['v4']();_0x49a8fe['actions'][_0x3cf41f]=new Action(_0x91abc1,_0x3915db,_0x3cf41f);loggerBooked[_0xd8b4('0x78')](_0xd8b4('0x1ea'),_0x3cf41f,_0xd8b4('0x1eb'),JSON[_0xd8b4('0x4a')](_0x91abc1[_0xd8b4('0x12c')]),_0xd8b4('0x1ec'),_0x91abc1[_0xd8b4('0x3f')]);if(_0x91abc1[_0xd8b4('0x12c')]){_0x91abc1[_0xd8b4('0x12c')]=![];_0x49a8fe[_0xd8b4('0x12b')][_0x49a8fe[_0xd8b4('0x126')][_0x3cf41f]['queue']]=[];ami['Action']({'actionid':_0x3cf41f,'action':_0xd8b4('0x1ed'),'queue':_0x91abc1[_0xd8b4('0x3f')]})[_0xd8b4('0xb5')](function(){_0x49a8fe[_0xd8b4('0xb7')](_0x91abc1);_0x49a8fe['rescheduleContact']({'active':![],'ContactId':_0x49a8fe['actions'][_0x3cf41f]['ContactId'],'ListId':_0x49a8fe[_0xd8b4('0x126')][_0x3cf41f][_0xd8b4('0xd8')],'VoiceQueueId':_0x49a8fe['actions'][_0x3cf41f][_0xd8b4('0x102')]||undefined,'CampaignId':_0x49a8fe[_0xd8b4('0x126')][_0x3cf41f][_0xd8b4('0xd9')]||undefined})['catch'](loggerCatch(_0xd8b4('0x1ee')));delete _0x49a8fe[_0xd8b4('0x126')][_0x3cf41f];});}else{loggerBooked[_0xd8b4('0x78')](_0xd8b4('0x1ef'),JSON[_0xd8b4('0x4a')](_0x91abc1[_0xd8b4('0x12c')]),'Queue:\x20',_0x91abc1['name']);_0x49a8fe[_0xd8b4('0xb7')](_0x91abc1);_0x49a8fe['rescheduleContact']({'active':![],'ContactId':_0x49a8fe[_0xd8b4('0x126')][_0x3cf41f][_0xd8b4('0xd7')],'ListId':_0x49a8fe[_0xd8b4('0x126')][_0x3cf41f][_0xd8b4('0xd8')],'VoiceQueueId':_0x49a8fe[_0xd8b4('0x126')][_0x3cf41f][_0xd8b4('0x102')]||undefined,'CampaignId':_0x49a8fe[_0xd8b4('0x126')][_0x3cf41f][_0xd8b4('0xd9')]||undefined})[_0xd8b4('0xb5')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x49a8fe[_0xd8b4('0x126')][_0x3cf41f];}}else{return _0x49a8fe['actionOriginate'](_0x91abc1,_0x3915db);}}else{if(getDiff(_0x3915db[_0xd8b4('0x1f0')])<_0x91abc1[_0xd8b4('0x1f1')]*0x3c){if(_0x3915db[_0xd8b4('0x1f2')]&&!_0x3915db[_0xd8b4('0x1f2')]['voicePause']){_0x49a8fe['preview'][_0xd8b4('0x12e')](_0x3915db['id'])[_0xd8b4('0x1a')](function(){_0x49a8fe[_0xd8b4('0xb7')](_0x91abc1);});}else{_0x49a8fe[_0xd8b4('0xc6')]({'active':![]},_0x3915db['id'],0x1)[_0xd8b4('0x1a')](function(){_0x49a8fe[_0xd8b4('0xb7')](_0x91abc1);});}}else{_0x91abc1['outboundReCallsDay']+=0x1;_0x49a8fe[_0xd8b4('0xb7')](_0x91abc1);if(_0x91abc1[_0xd8b4('0x1f3')]){_0x49a8fe[_0xd8b4('0xc4')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3915db[_0xd8b4('0xd7')],'ListId':_0x3915db[_0xd8b4('0xd8')],'VoiceQueueId':_0x3915db[_0xd8b4('0x102')]||undefined,'CampaignId':_0x3915db['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x49a8fe[_0xd8b4('0xd0')](createObjHistory(_0x91abc1,_0x3915db,'RECALLINQUEUE',0x17,_0xd8b4('0x1f4')))[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0x1f5')));}else{_0x49a8fe['saveInDb'](createObjHistory(_0x91abc1,_0x3915db,'RECALLFAILEDTIMEOUT',0x16,_0xd8b4('0x1f6')),_0xd8b4('0x1f7'),'[Originate][HistoryRecallClose]');}}}}else{_0x91abc1[_0xd8b4('0x5c')]+=0x1;_0x49a8fe[_0xd8b4('0xd5')](createObjHistory(_0x91abc1,_0x3915db,_0xd8b4('0x1f8'),0xd,_0xd8b4('0x1f9')),_0xd8b4('0x1fa'),_0xd8b4('0x1fb'));throw'inBlackList';}};};Dialer[_0xd8b4('0xad')][_0xd8b4('0x1fc')]=function(_0x338950){var _0x1f117e=this;var _0x1edaf2=_0x338950[_0xd8b4('0x1fd')]-_0x338950['originated']-_0x338950['temp'];emitCampaignSummary(_0x338950);if(_0x1edaf2>0x0){if(_0x1edaf2>this['maxNumberOriginate']){_0x1edaf2=this[_0xd8b4('0x20')];}_0x338950[_0xd8b4('0xc9')]+=_0x1edaf2;this[_0xd8b4('0xcb')](_0x338950['id'],_0x1edaf2,_0x338950[_0xd8b4('0x1fe')],_0x338950)[_0xd8b4('0xbd')](function(_0x3ce2b5){_0x338950[_0xd8b4('0xc9')]-=_0x1edaf2;_0x338950[_0xd8b4('0xc9')]=_0x338950[_0xd8b4('0xc9')]>0x0?_0x338950['temp']:0x0;if(!checkContactEmpty(_0x3ce2b5)){_0x338950[_0xd8b4('0x3d')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xd8b4('0x78')]('[getContactCampaign2][Empty]'+_0x338950[_0xd8b4('0x3f')]);}else{_0x338950[_0xd8b4('0x98')]+=_0x3ce2b5['length'];_0x338950[_0xd8b4('0x3d')]=_0xd8b4('0x1ff');for(var _0x453113=0x0;_0x453113<_0x3ce2b5[_0xd8b4('0x134')];_0x453113+=0x1){_0x338950['ivrTotalCallsDays']+=0x1;if(_[_0xd8b4('0xb1')](_0x3ce2b5[_0x453113])||_[_0xd8b4('0xb1')](_0x3ce2b5[_0x453113][_0xd8b4('0x16c')])||_[_0xd8b4('0xb1')](_0x3ce2b5[_0x453113][_0xd8b4('0x16c')]['phone'])){_0x1f117e[_0xd8b4('0x200')](_0xd8b4('0x201'),_0x338950,_0x3ce2b5[_0x453113]);}else{_0x1f117e[_0xd8b4('0xc1')](_[_0xd8b4('0xd6')](_0x3ce2b5[_0x453113],[_0xd8b4('0xd9'),_0xd8b4('0x202')]))[_0xd8b4('0xbd')](_0x1f117e[_0xd8b4('0x1e7')](_0x338950,_0x3ce2b5[_0x453113]))[_0xd8b4('0xb5')](_0x1f117e[_0xd8b4('0xd3')](_0xd8b4('0x203'),_0x338950));}}}})['catch'](loggerGetContactDialer(_0xd8b4('0x204'),_0x338950,_0x1edaf2));}};Dialer[_0xd8b4('0xad')][_0xd8b4('0x15b')]=function(_0x385e89,_0x49ccac){var _0x2988ce=this;var _0x43f092=[];var _0x41fbaa=_0x49ccac>=0x1?_0x49ccac:0x1;if(_0x385e89[_0xd8b4('0x57')]===_0xd8b4('0x15c')){_0x41fbaa=0x1;}var _0xa4357b=Math['floor'](_0x385e89[_0xd8b4('0x4f')]*_0x41fbaa)-_0x385e89[_0xd8b4('0x98')]-_0x385e89[_0xd8b4('0xc9')];emitVoiceQueueSummary(_0x385e89);if(_0x385e89[_0xd8b4('0x205')]>0x0){var _0x13b726=_0x385e89[_0xd8b4('0x205')]-_0x385e89[_0xd8b4('0x98')]-_0x385e89[_0xd8b4('0xa2')]-_0x385e89['temp']-_0x385e89[_0xd8b4('0x51')];if(_0xa4357b>_0x13b726){_0xa4357b=_0x13b726;}}if(_0xa4357b>0x0){if(_0x385e89[_0xd8b4('0x57')]===_0xd8b4('0x15c')){_0xa4357b=0x1;}if(_0xa4357b>this[_0xd8b4('0x20')]){_0xa4357b=this[_0xd8b4('0x20')];}_0x385e89[_0xd8b4('0xc9')]+=_0xa4357b;for(var _0xbfa7b5 in this['agents']){if(typeof this['agents'][_0xbfa7b5]!==_0xd8b4('0x99')){if(this['agents'][_0xbfa7b5][_0xd8b4('0xa9')]===_0xd8b4('0x206')&&this[_0xd8b4('0x1e')][_0xbfa7b5][_0xd8b4('0xb3')]===_0xd8b4('0xde')){_0x43f092[_0xd8b4('0x14e')](this[_0xd8b4('0x1e')][_0xbfa7b5]['id']);}}}this[_0xd8b4('0xc8')](_0x385e89['id'],_0x43f092,_0xa4357b,_0x385e89[_0xd8b4('0x1fe')],_0x385e89)['then'](function(_0x46eee8){_0x385e89[_0xd8b4('0xc9')]-=_0xa4357b;_0x385e89[_0xd8b4('0xc9')]=_0x385e89[_0xd8b4('0xc9')]>0x0?_0x385e89[_0xd8b4('0xc9')]:0x0;if(!checkContactEmpty(_0x46eee8)){_0x2988ce[_0xd8b4('0xbb')](_0x385e89)[_0xd8b4('0xbd')](sendMessageReschedule(_0x385e89))[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0xbe')));}else{_0x385e89['originated']+=_0x46eee8[_0xd8b4('0x134')];_0x385e89['message']=_0x385e89[_0xd8b4('0x57')]===_0xd8b4('0x15c')?_0xd8b4('0x174'):_0xd8b4('0x1ff');for(var _0x2b7302=0x0;_0x2b7302<_0x46eee8['length'];_0x2b7302+=0x1){if(_[_0xd8b4('0xb1')](_0x46eee8[_0x2b7302])||_['isNil'](_0x46eee8[_0x2b7302][_0xd8b4('0x16c')])||_[_0xd8b4('0xb1')](_0x46eee8[_0x2b7302][_0xd8b4('0x16c')][_0xd8b4('0x16b')])){_0x2988ce[_0xd8b4('0x200')](_0xd8b4('0x201'),_0x385e89,_0x46eee8[_0x2b7302]);}else{_0x2988ce[_0xd8b4('0xbf')](_[_0xd8b4('0xd6')](_0x46eee8[_0x2b7302],[_0xd8b4('0x102'),_0xd8b4('0x202')]))[_0xd8b4('0xbd')](_0x2988ce[_0xd8b4('0x1e7')](_0x385e89,_0x46eee8[_0x2b7302]))[_0xd8b4('0xb5')](_0x2988ce[_0xd8b4('0xd3')]('[actionOriginate]\x20',_0x385e89));}}}})['catch'](loggerGetContactDialer(_0xd8b4('0x207'),_0x385e89,_0xa4357b));}};Dialer[_0xd8b4('0xad')][_0xd8b4('0x8f')]=function(_0x4aad18){if(_0x4aad18[_0xd8b4('0x205')]>0x0){var _0x543b41=_0x4aad18[_0xd8b4('0x205')]-_0x4aad18[_0xd8b4('0x98')]-_0x4aad18[_0xd8b4('0xa2')];if(_0x543b41>0x0){this[_0xd8b4('0x208')](_0x4aad18);}else{loggerPredictiveCalls[_0xd8b4('0x78')](_0xd8b4('0x209'));}}else{this[_0xd8b4('0x208')](_0x4aad18);}};Dialer[_0xd8b4('0xad')][_0xd8b4('0x208')]=function(_0x3cf3ce){var _0x280e64=this;var _0x236334=[];_0x3cf3ce[_0xd8b4('0x98')]+=0x1;for(var _0x4b50f9 in this[_0xd8b4('0x1e')]){if(typeof this[_0xd8b4('0x1e')][_0x4b50f9]!==_0xd8b4('0x99')){if(this['agents'][_0x4b50f9][_0xd8b4('0xa9')]===_0xd8b4('0x206')&&this['agents'][_0x4b50f9][_0xd8b4('0xb3')]==='reachable'){_0x236334[_0xd8b4('0x14e')](this[_0xd8b4('0x1e')][_0x4b50f9]['id']);}}}this[_0xd8b4('0xc8')](_0x3cf3ce['id'],_0x236334,0x1,_0x3cf3ce['dialOrderByScheduledAt'],_0x3cf3ce)[_0xd8b4('0xbd')](function(_0x4fe446){if(!checkContactEmpty(_0x4fe446)){checkContactLowerLimitOriginate(_0x3cf3ce,0x1,0x0);_0x280e64[_0xd8b4('0xbb')](_0x3cf3ce)['then'](sendMessageReschedule(_0x3cf3ce))[_0xd8b4('0xb5')](loggerCatch(_0xd8b4('0xbe')));}else{_0x3cf3ce[_0xd8b4('0x3d')]=_0xd8b4('0x1ff');if(_[_0xd8b4('0xb1')](_0x4fe446[0x0])||_['isNil'](_0x4fe446[0x0]['Contact'])||_[_0xd8b4('0xb1')](_0x4fe446[0x0][_0xd8b4('0x16c')][_0xd8b4('0x16b')])){_0x280e64[_0xd8b4('0x200')](_0xd8b4('0x201'),_0x3cf3ce,_0x4fe446[0x0]);}else{_0x280e64[_0xd8b4('0xbf')](_[_0xd8b4('0xd6')](_0x4fe446[0x0],[_0xd8b4('0x102'),_0xd8b4('0x202')]))[_0xd8b4('0xbd')](_0x280e64[_0xd8b4('0x1e7')](_0x3cf3ce,_0x4fe446[0x0]))[_0xd8b4('0xb5')](_0x280e64[_0xd8b4('0xd3')](_0xd8b4('0x20a'),_0x3cf3ce));}}})[_0xd8b4('0xb5')](loggerGetContactDialer(_0xd8b4('0x20b'),_0x3cf3ce,0x1));emitVoiceQueueSummary(_0x3cf3ce);};Dialer[_0xd8b4('0xad')][_0xd8b4('0x1db')]=function(_0x1ac116,_0x1a7633,_0x36258a,_0x498b12,_0x588c72,_0x327fcf){loggerPredictive[_0xd8b4('0x78')](_0xd8b4('0x20c'));loggerPredictive[_0xd8b4('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',_0x1ac116);loggerPredictive[_0xd8b4('0x78')](_0xd8b4('0x20d'),_0x1a7633);loggerPredictive[_0xd8b4('0x78')](_0xd8b4('0x20e'),_0x36258a);loggerPredictive[_0xd8b4('0x78')](_0xd8b4('0x20f'),_0x498b12);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x588c72);loggerPredictive['info'](_0xd8b4('0x82'));return new BPromise(function(_0x10b1d7,_0x3671d7){if(_0x1ac116<=0x0||isNaN(_0x1ac116)){return _0x3671d7(msgResponse('[abandonmentRate]',_0xd8b4('0x49'),'m\x20=\x20'+_0x1ac116));}if(_0x36258a<=0x0||isNaN(_0x36258a)){return _0x3671d7(msgResponse(_0xd8b4('0x210'),'Error','Ts\x20=\x20'+_0x36258a));}if(_0x498b12<=0x0||isNaN(_0x498b12)){return _0x3671d7(msgResponse(_0xd8b4('0x210'),'Error',_0xd8b4('0x211')+_0x498b12));}if(_0x1a7633<=0x0||isNaN(_0x1a7633)){return _0x3671d7(msgResponse(_0xd8b4('0x210'),_0xd8b4('0x49'),_0xd8b4('0x212')+_0x1a7633));}if(_0x588c72<=0x0||isNaN(_0x588c72)){return _0x3671d7(msgResponse(_0xd8b4('0x210'),'Error',_0xd8b4('0x213')+_0x588c72));}_0x327fcf=_0x327fcf||0x0;var _0x4478fa=0x1/_0x36258a;var _0x3393c3=0x0;var _0x5fd055=0x0;var _0x4ba603=0x0;var _0x2a9617=0x0;for(var _0x2da846=0x0;_0x4ba603<_0x588c72;_0x2da846+=0x1){_0x5fd055=_0x2da846/_0x1a7633;_0x3393c3=(_0x498b12*_0x5fd055+_0x327fcf)/_0x4478fa;_0x4ba603=erlangb(_0x3393c3,_0x1ac116);_0x2a9617=_0x3393c3/_0x1ac116*(0x1-erlangb(_0x3393c3,_0x1ac116));}return _0x10b1d7({'erlangCalls':_0x2da846,'erlangCallToSecond':_0x1a7633/_0x2da846,'erlangAbandonmentRate':_0x4ba603,'erlangBusyFactor':_0x2a9617});});};Dialer[_0xd8b4('0xad')][_0xd8b4('0x1dd')]=function(_0x6d02f3,_0x8c61c3,_0x4b19d3,_0x2a2d76,_0x174fac,_0x46b636){loggerPredictive[_0xd8b4('0x78')](_0xd8b4('0x214'));loggerPredictive[_0xd8b4('0x78')](_0xd8b4('0x215'),_0x6d02f3);loggerPredictive[_0xd8b4('0x78')](_0xd8b4('0x20d'),_0x8c61c3);loggerPredictive[_0xd8b4('0x78')](_0xd8b4('0x20e'),_0x4b19d3);loggerPredictive['info'](_0xd8b4('0x20f'),_0x2a2d76);loggerPredictive[_0xd8b4('0x78')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x174fac);loggerPredictive[_0xd8b4('0x78')](_0xd8b4('0x82'));return new BPromise(function(_0x29a8f3,_0xebf04a){if(_0x6d02f3<=0x0||isNaN(_0x6d02f3)){return _0xebf04a(msgResponse(_0xd8b4('0x216'),_0xd8b4('0x49'),_0xd8b4('0x217')+_0x6d02f3));}if(_0x4b19d3<=0x0||isNaN(_0x4b19d3)){return _0xebf04a(msgResponse('[busyFactor]','Error',_0xd8b4('0x218')+_0x4b19d3));}if(_0x2a2d76<=0x0||isNaN(_0x2a2d76)){return _0xebf04a(msgResponse(_0xd8b4('0x216'),'Error',_0xd8b4('0x211')+_0x2a2d76));}if(_0x8c61c3<=0x0||isNaN(_0x8c61c3)){return _0xebf04a(msgResponse(_0xd8b4('0x216'),'Error',_0xd8b4('0x212')+_0x8c61c3));}if(_0x174fac<=0x0||isNaN(_0x174fac)){return _0xebf04a(msgResponse('[busyFactor]',_0xd8b4('0x49'),'Umin\x20=\x20'+_0x174fac));}_0x46b636=_0x46b636||0x0;var _0x14d6f2=0x1/_0x4b19d3;var _0x5f4aa4=0x0;var _0x2d982f=0x0;var _0xbe3225=0x0;var _0x6bc769=0x0;for(var _0x3976d2=0x0;_0x6bc769<_0x174fac;_0x3976d2+=0x1){_0x2d982f=_0x3976d2/_0x8c61c3;_0x5f4aa4=(_0x2a2d76*_0x2d982f+_0x46b636)/_0x14d6f2;_0xbe3225=erlangb(_0x5f4aa4,_0x6d02f3);_0x6bc769=_0x5f4aa4/_0x6d02f3*(0x1-erlangb(_0x5f4aa4,_0x6d02f3));}return _0x29a8f3({'erlangCalls':_0x3976d2,'erlangCallToSecond':_0x8c61c3/_0x3976d2,'erlangAbandonmentRate':_0xbe3225,'erlangBusyFactor':_0x6bc769});});};module['exports']=Dialer; \ No newline at end of file +var _0x79ce=['abandoned','waiting','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','voice_queue:save','format','campaign:ivr:%s','campaign:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','state','statedesc','endtime','starttime','clearZombieChannels','uniqueId','[uniqueid]','[actions]','isNil','Action','status','channel','catch','No\x20such\x20channel','ivr','queue','countReScheduled','resolve','then','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','createHistory','[createHistory]\x20','updateOriginated','[updateOriginated]\x20object\x20originated\x20is\x20negative','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','HANGUP','HangupInAMD','membername','AMD','emit','custom:amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','MACHINE','countmachineretry','countglobal','amd','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','Machine','countnoanswerretry','createStateFinal','ivrAnswerCallsDay','moveContactManagedDialer','[syncHangupIvr]','dialQueueProject','AGI','[syncHangupIvr][createHistory]','Unknow','reason','agent','agiafterat','dialQueueProject2','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','TIMEOUT','countdropretry','queueCallerAbandonCreateState','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','dropreason','CALLEREXIT','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','actionid','strategy','roundrobin','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','[Catch][Preview][syncQueueStatusComplete]','finally','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','command','iftime\x20%s,%s','interval','timezones','indexOf','true','content','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','power','handlePower','dialPowerLevel','booked','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialActive','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','random','match','actionOriginate','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','updatedAt','%s%s','XMD-','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialAbandonedMaxRetry','dialAgentRejectRetryFrequency','callProgressDetecting','object','[callProgressDetecting]','evt\x20is\x20undefine','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','custom:agentcongestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','agentreject','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','busyFactor','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','[getDataPredictive]','one\x20call\x20every:','[handlePredictive]','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','Contact.phone','loggerHandler','dialLimitQueue','not_inuse','reachable','[countReScheduled]\x20','ACTIVE','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','[abandonmentRate]','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','p\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','moment','md5','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','predictive','predictiveCalls','syncQueueSummary','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','127.0.0.1','rrmemory','prototype','enqueue','tail','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','queuecallerabandon','syncQueueCallerAbandon','originateresponse','bind','agentcomplete','syncAgentComplete','custom:queuesummary','syncHangup','newexten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','message','name','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','Intervals','\x20INTERVAL_IS_NULL','[ifTime][Action]','Error','milliseconds','diff','seconds','type','outbound','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','unmanaged'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x79ce,0x1c7));var _0xe79c=function(_0x2e6fef,_0x2b99d9){_0x2e6fef=_0x2e6fef-0x0;var _0x56854d=_0x79ce[_0x2e6fef];return _0x56854d;};'use strict';var util=require(_0xe79c('0x0'));var _=require(_0xe79c('0x1'));var BPromise=require(_0xe79c('0x2'));var uuid=require(_0xe79c('0x3'));var moment=require(_0xe79c('0x4'));var rr=require('rr');var md5=require(_0xe79c('0x5'));var Redis=require('ioredis');var ut=require(_0xe79c('0x6'));var config=require(_0xe79c('0x7'));var logger=require(_0xe79c('0x8'))(_0xe79c('0x9'));var loggerBooked=require(_0xe79c('0x8'))('booked');var loggerPredictive=require(_0xe79c('0x8'))(_0xe79c('0xa'));var loggerPredictiveCalls=require(_0xe79c('0x8'))(_0xe79c('0xb'));var loggerSyncQueueSummary=require(_0xe79c('0x8'))(_0xe79c('0xc'));var ami=require('../ami');config[_0xe79c('0xd')]=_[_0xe79c('0xe')](config[_0xe79c('0xd')],{'host':_0xe79c('0xf'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe79c('0xd')]));var cmHopper=require(_0xe79c('0x10'));var cmHopperHistory=require(_0xe79c('0x11'));var cmHopperBlack=require(_0xe79c('0x12'));var voiceQueueRt=require(_0xe79c('0x13'));var Action=require(_0xe79c('0x14'));var History=require(_0xe79c('0x15'));var Final=require(_0xe79c('0x16'));var AgentComplete=require(_0xe79c('0x17'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require('./hangup');var ipAgi=process['env']['XCALLY_IP_AGI']||_0xe79c('0x18');var strategy={'rrmemory':_0xe79c('0x19'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0xe79c('0x1a')][_0xe79c('0x1b')]=function(_0x11becc){this[_0xe79c('0x1c')]=this[_0xe79c('0x1c')]?this['tail']['finally'](_0x11becc):_0x11becc();};function Dialer(_0x160431,_0xa38583){this[_0xe79c('0x1d')]=new Sequence();this['preview']=_0xa38583;this[_0xe79c('0x1e')]=_0x160431[_0xe79c('0x1e')];this[_0xe79c('0x1f')]=_0x160431[_0xe79c('0x1f')];this[_0xe79c('0x20')]=_0x160431[_0xe79c('0x20')];this[_0xe79c('0x21')]=_0x160431[_0xe79c('0x21')];this['maxNumberOriginate']=config[_0xe79c('0x22')]||0x2;this[_0xe79c('0x23')]={};this[_0xe79c('0x24')]={};this['contactsId']={};this['uniqueId']={};this[_0xe79c('0x25')]={};this['startPredictive']={};this[_0xe79c('0x26')]={};this[_0xe79c('0x27')]={};this[_0xe79c('0x28')]={};this[_0xe79c('0x29')]={};ami['on'](_0xe79c('0x2a'),this['syncAgentConnect']['bind'](this));ami['on'](_0xe79c('0x2b'),this[_0xe79c('0x2c')]['bind'](this));ami['on'](_0xe79c('0x2d'),this['syncOriginateResponse'][_0xe79c('0x2e')](this));ami['on'](_0xe79c('0x2f'),this[_0xe79c('0x30')][_0xe79c('0x2e')](this));ami['on'](_0xe79c('0x31'),this[_0xe79c('0xc')]['bind'](this));ami['on']('hangup',this[_0xe79c('0x32')][_0xe79c('0x2e')](this));ami['on'](_0xe79c('0x33'),this['syncNewExten'][_0xe79c('0x2e')](this));ami['on'](_0xe79c('0x34'),this[_0xe79c('0x35')][_0xe79c('0x2e')](this));ami['on']('queuemember',this[_0xe79c('0x36')][_0xe79c('0x2e')](this));ami['on'](_0xe79c('0x37'),this[_0xe79c('0x38')][_0xe79c('0x2e')](this));this[_0xe79c('0x39')]();this[_0xe79c('0x3a')]();}function isNotNull(_0x34b75d){return _0x34b75d!==null&&!_[_0xe79c('0x3b')](_0x34b75d);}function checkIsLoggedIn(_0x3de4ba,_0x302bd1){return function(){if(_0x302bd1<=0x0){_0x3de4ba['message']=_0xe79c('0x3c');throw _0x3de4ba['name']+_0xe79c('0x3d');}};}function isActive(_0x358ee6){return _0x358ee6;}function checkIsActive(_0x210685,_0xb8a79c){return function(){if(!isActive(_0xb8a79c)){_0x210685[_0xe79c('0x3e')]='NOT_ACTIVE';throw _0x210685[_0xe79c('0x3f')]+_0xe79c('0x40');}};}function checkInterval(_0x16aca8){return function(){if(!isNotNull(_0x16aca8[_0xe79c('0x41')])){_0x16aca8['message']=_0xe79c('0x42');throw _0x16aca8[_0xe79c('0x3f')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x16aca8[_0xe79c('0x41')][_0xe79c('0x43')])){_0x16aca8[_0xe79c('0x3e')]='INTERVAL_IS_NULL';throw _0x16aca8[_0xe79c('0x3f')]+_0xe79c('0x44');}if(!isNotNull(_['isEmpty'](_0x16aca8[_0xe79c('0x41')][_0xe79c('0x43')]))){_0x16aca8[_0xe79c('0x3e')]='INTERVAL_IS_NULL';throw _0x16aca8[_0xe79c('0x3f')]+_0xe79c('0x44');}};}function msgResponse(_0x1e9ef6,_0x2e474e,_0x348884){return{'action':_0x1e9ef6,'response':_0x2e474e,'message':_0x348884,'stack':_0x348884};}function myreject(_0x1ea45b){return function(_0xeb3efc){return _0x1ea45b(msgResponse(_0xe79c('0x45'),_0xe79c('0x46'),JSON['stringify'](_0xeb3efc)));};}function getSeconds(_0x20ecf5,_0xd43c6d){var _0x344815=moment(_0x20ecf5)[_0xe79c('0x47')](0x0);var _0x29e10b=moment(_0xd43c6d)[_0xe79c('0x47')](0x0);return _0x344815[_0xe79c('0x48')](_0x29e10b,_0xe79c('0x49'));}function emit(_0x8c68ce,_0x3eb984,_0x160226){io['to'](_0x8c68ce)['emit'](_0x3eb984,_0x160226);}function emitVoiceQueueSummary(_0x25f6c6){if(_0x25f6c6[_0xe79c('0x4a')]===_0xe79c('0x4b')){var _0x741e8b={'id':_0x25f6c6['id'],'name':_0x25f6c6['name'],'strategy':_0x25f6c6['strategy'],'answered':_0x25f6c6[_0xe79c('0x4c')],'available':_0x25f6c6[_0xe79c('0x4d')],'loggedIn':_0x25f6c6[_0xe79c('0x4e')],'pTalking':_0x25f6c6[_0xe79c('0x4f')],'sumBillable':_0x25f6c6[_0xe79c('0x50')],'sumDuration':_0x25f6c6['sumDuration'],'sumHoldTime':_0x25f6c6[_0xe79c('0x51')]||0x0,'talking':_0x25f6c6['talking'],'total':_0x25f6c6['total'],'type':_0x25f6c6[_0xe79c('0x4a')],'unmanaged':_0x25f6c6[_0xe79c('0x52')],'abandoned':_0x25f6c6[_0xe79c('0x53')],'waiting':_0x25f6c6[_0xe79c('0x54')],'loggedInDb':_0x25f6c6['loggedInDb'],'dialActive':_0x25f6c6['dialActive'],'dialMethod':_0x25f6c6[_0xe79c('0x55')],'dialOriginateCallerIdName':_0x25f6c6['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x25f6c6[_0xe79c('0x56')],'dialOriginateTimeout':_0x25f6c6[_0xe79c('0x57')],'dialPrefix':_0x25f6c6[_0xe79c('0x58')],'outboundAnswerAgiCallsDay':_0x25f6c6[_0xe79c('0x59')],'outboundAnswerCallsDay':_0x25f6c6[_0xe79c('0x5a')],'outboundBlacklistCallsDay':_0x25f6c6[_0xe79c('0x5b')],'outboundBusyCallsDay':_0x25f6c6[_0xe79c('0x5c')],'outboundCongestionCallsDay':_0x25f6c6[_0xe79c('0x5d')],'outboundDropCallsDayACS':_0x25f6c6['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x25f6c6[_0xe79c('0x5e')],'outboundDropCallsDayTimeout':_0x25f6c6['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x25f6c6[_0xe79c('0x5f')],'outboundNoSuchCallsDay':_0x25f6c6[_0xe79c('0x60')],'outboundOriginateFailureCallsDay':_0x25f6c6[_0xe79c('0x61')],'outboundReCallsDay':_0x25f6c6[_0xe79c('0x62')],'outboundRejectCallsDay':_0x25f6c6['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x25f6c6[_0xe79c('0x63')],'predictiveIntervalAnsweredCalls':_0x25f6c6[_0xe79c('0x64')],'predictiveIntervalAvgHoldtime':_0x25f6c6[_0xe79c('0x65')],'predictiveIntervalAvgTalktime':_0x25f6c6[_0xe79c('0x66')],'predictiveIntervalDroppedCallsCallersExit':_0x25f6c6['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x25f6c6[_0xe79c('0x67')],'predictiveIntervalErlangCalls':_0x25f6c6['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x25f6c6['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x25f6c6[_0xe79c('0x68')],'predictiveIntervalMultiplicativeFactor':_0x25f6c6['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x25f6c6[_0xe79c('0x69')],'predictiveIntervalAvailable':_0x25f6c6[_0xe79c('0x6a')],'predictiveIntervalTotalCalls':_0x25f6c6[_0xe79c('0x6b')],'message':_0x25f6c6['message'],'originated':_0x25f6c6[_0xe79c('0x6c')],'erlangCalls':_0x25f6c6['erlangCalls'],'erlangCallToSecond':_0x25f6c6[_0xe79c('0x6d')],'erlangAbandonmentRate':_0x25f6c6[_0xe79c('0x6e')],'erlangBusyFactor':_0x25f6c6[_0xe79c('0x6f')],'startPredictive':_0x25f6c6[_0xe79c('0x70')],'startProgressive':_0x25f6c6[_0xe79c('0x26')]};if(_0x25f6c6[_0xe79c('0x71')]){_0x741e8b[_0xe79c('0x71')]={'id':_0x25f6c6[_0xe79c('0x71')]['id'],'name':_0x25f6c6[_0xe79c('0x71')][_0xe79c('0x3f')],'active':_0x25f6c6['Trunk'][_0xe79c('0x72')],'callerid':_0x25f6c6[_0xe79c('0x71')][_0xe79c('0x73')]};}if(_0x25f6c6['Interval']){_0x741e8b[_0xe79c('0x41')]={'id':_0x25f6c6[_0xe79c('0x41')]['id'],'name':_0x25f6c6['Interval'][_0xe79c('0x3f')]};}var _0x47f0ec=md5(JSON['stringify'](_0x741e8b));if(_0x25f6c6[_0xe79c('0x5')]!==_0x47f0ec){_0x25f6c6['md5']=_0x47f0ec;emit(util['format']('voice:queue:%s',_0x741e8b['name']),_0xe79c('0x74'),_0x741e8b);}}}function emitCampaignSummary(_0x521615){if(_0x521615[_0xe79c('0x4a')]==='ivr'){emit(util[_0xe79c('0x75')](_0xe79c('0x76'),_0x521615[_0xe79c('0x3f')]),_0xe79c('0x77'),_0x521615);}}function checkGetDataPredictive(_0x51a8d8){if(isNotNull(_0x51a8d8)&&!_[_0xe79c('0x78')](_0x51a8d8)){loggerPredictive[_0xe79c('0x79')](_0xe79c('0x7a'));loggerPredictive[_0xe79c('0x79')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x51a8d8[_0xe79c('0x6b')]);loggerPredictive[_0xe79c('0x79')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x51a8d8['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xe79c('0x79')](_0xe79c('0x7b'),_0x51a8d8[_0xe79c('0x67')]);loggerPredictive[_0xe79c('0x79')](_0xe79c('0x7c'),_0x51a8d8[_0xe79c('0x7d')]);loggerPredictive[_0xe79c('0x79')](_0xe79c('0x7e'),_0x51a8d8['predictiveIntervalAvgHoldtime']);loggerPredictive[_0xe79c('0x79')](_0xe79c('0x7f'),_0x51a8d8['predictiveIntervalAvgTalktime']);loggerPredictive['info']('---------------------------');if(_0x51a8d8[_0xe79c('0x6b')]>0x0){if(!_['isUndefined'](_0x51a8d8[_0xe79c('0x66')])&&_0x51a8d8[_0xe79c('0x66')]>0x0){return!![];}loggerPredictive['info'](_0xe79c('0x80'));if(!_[_0xe79c('0x3b')](_0x51a8d8[_0xe79c('0x65')])&&_0x51a8d8['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0xe79c('0x79')](_0xe79c('0x81'));}else{loggerPredictive[_0xe79c('0x79')](_0xe79c('0x82'));}}else{loggerPredictive['info'](_0xe79c('0x83'));}return![];}function mergeDataErlangB(_0x5b37a3){return function(_0x362b08){loggerPredictive[_0xe79c('0x79')](_0xe79c('0x84'));loggerPredictive[_0xe79c('0x79')](_0xe79c('0x85'),_0x362b08[_0xe79c('0x86')]);loggerPredictive[_0xe79c('0x79')](_0xe79c('0x87'),_0x362b08[_0xe79c('0x6d')]);loggerPredictive[_0xe79c('0x79')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x362b08[_0xe79c('0x6e')]);loggerPredictive['info']('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x362b08[_0xe79c('0x6f')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x362b08['erlangAbandonmentRate']);loggerPredictive[_0xe79c('0x79')](_0xe79c('0x88'));_[_0xe79c('0x89')](_0x5b37a3,_0x362b08);};}function getDiff(_0x439a71){var _0x51c0e9=moment()[_0xe79c('0x47')](0x0);var _0x18d21f=moment(_0x439a71)[_0xe79c('0x47')](0x0);return _0x51c0e9[_0xe79c('0x48')](_0x18d21f,_0xe79c('0x49'));}function ifInterval(_0x1e25a6,_0x144e56){if(_[_0xe79c('0x3b')](_0x144e56)){return![];}return getDiff(_0x144e56)<_0x1e25a6*0x3c;}function freeVariablesPredictive(_0x448d87){if(isNotNull(_0x448d87)){if(!_['isUndefined'](_0x448d87['startProgressive'])){_0x448d87[_0xe79c('0x26')]=undefined;loggerPredictive[_0xe79c('0x79')](_0x448d87[_0xe79c('0x3f')],_0xe79c('0x8a'));}if(!_[_0xe79c('0x3b')](_0x448d87['startPredictive'])){_0x448d87[_0xe79c('0x70')]=undefined;loggerPredictive['info'](_0x448d87[_0xe79c('0x3f')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0xe79c('0x3b')](_0x448d87[_0xe79c('0x8b')])){clearInterval(_0x448d87['handlePredictive']);_0x448d87[_0xe79c('0x8b')]=undefined;loggerPredictive[_0xe79c('0x79')](_0x448d87[_0xe79c('0x3f')],_0xe79c('0x8c'));}}}function erlangb(_0x154d07,_0x1a21f2){if(_0x1a21f2===0x0){return 0x0;}var _0x3870ed=0x1;for(var _0x29b961=0x1;_0x29b961<=_0x1a21f2;_0x29b961+=0x1){_0x3870ed=0x1+_0x3870ed*_0x29b961/_0x154d07;}return 0x1/_0x3870ed;}function isVoiceQueueOutbound(_0x3d76b1){return _0x3d76b1===_0xe79c('0x4b');}function isNotPreview(_0x549bf4){return _0x549bf4!==_0xe79c('0x8d');}function isCampaignIvr(_0x374fca){return _0x374fca==='ivr';}function getCallerId(_0x5613df,_0x4ed0cc,_0x3ab59b){if(!_[_0xe79c('0x3b')](_0x3ab59b)&&typeof _0x3ab59b==='string'&&!_[_0xe79c('0x78')](_0x3ab59b)){if(!_[_0xe79c('0x3b')](_0x4ed0cc)&&typeof _0x4ed0cc===_0xe79c('0x8e')&&!_[_0xe79c('0x78')](_0x4ed0cc)){return util['format'](_0xe79c('0x8f'),_0x4ed0cc,_0x3ab59b);}return util[_0xe79c('0x75')](_0xe79c('0x8f'),_0x3ab59b,_0x3ab59b);}if(!_['isUndefined'](_0x5613df)&&typeof _0x5613df===_0xe79c('0x8e')&&!_[_0xe79c('0x78')](_0x5613df)){return _0x5613df;}return _0xe79c('0x90');}function loggerCatchQueueSummary(_0x40061d,_0x5c6726){return function(_0x4e955c){freeVariablesPredictive(_0x5c6726);emitVoiceQueueSummary(_0x5c6726);emitCampaignSummary(_0x5c6726);loggerSyncQueueSummary[_0xe79c('0x91')](_0x40061d,util[_0xe79c('0x92')](_0x4e955c,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x582786,_0x48fc95){return function(_0x4a88e9){loggerPredictive[_0xe79c('0x91')](_0x48fc95[_0xe79c('0x3f')],_0x582786);loggerPredictive[_0xe79c('0x91')](_0x4a88e9[_0xe79c('0x93')]);freeVariablesPredictive(_0x48fc95);};}function loggerCatch(_0x997fcf){return function(_0x59e302){logger[_0xe79c('0x91')](_0x997fcf,util[_0xe79c('0x92')](_0x59e302,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0xd16cef){return _0xd16cef&&!_[_0xe79c('0x3b')](_0xd16cef)&&_0xd16cef[_0xe79c('0x94')]>0x0;}function decremetOriginate(_0x44bb35){if(!_[_0xe79c('0x3b')](_0x44bb35)&&_0x44bb35!==null){if(typeof _0x44bb35['originated']!==_0xe79c('0x95')){if(_0x44bb35[_0xe79c('0x6c')]>0x0){_0x44bb35['originated']-=0x1;}else{logger[_0xe79c('0x91')](_0xe79c('0x96'));}}}else{logger['error'](_0xe79c('0x97'));}}function checkContactLowerLimitOriginate(_0x46248a,_0x95debc,_0x56dc51){if(_0x95debc>_0x56dc51){for(var _0x3d5d98=0x0;_0x3d5d98<_0x95debc-_0x56dc51;_0x3d5d98+=0x1){decremetOriginate(_0x46248a);}}}function loggerGetContactDialer(_0x193a5c,_0x188a76,_0x3d9f5d){return function(_0x93a37a){checkContactLowerLimitOriginate(_0x188a76,_0x3d9f5d,0x0);logger[_0xe79c('0x91')](_0x193a5c,util[_0xe79c('0x92')](_0x93a37a,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x44ca60){return function(_0x901a00){if(isNotNull(_0x901a00)&&isNotNull(_0x901a00[0x0])){if(_0x901a00[0x0]['contactsRescheduled']>0x0){_0x44ca60[_0xe79c('0x3e')]=_0xe79c('0x98');logger[_0xe79c('0x79')](_0xe79c('0x99')+_0x44ca60[_0xe79c('0x3f')],_0x901a00[0x0]['contactsRescheduled'],_0xe79c('0x9a'));}else{_0x44ca60[_0xe79c('0x3e')]='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0xe79c('0x9b')+_0x44ca60[_0xe79c('0x3f')]);}}};}function notSendMessagesQueue(_0xe9e276){if(_0xe9e276[_0xe79c('0x9c')]){freeVariablesPredictive(_0xe9e276);if(_0xe9e276[_0xe79c('0x6c')]===0x0&&_0xe9e276[_0xe79c('0x9d')]===0x0&&_0xe9e276['waiting']===0x0&&(_0xe9e276[_0xe79c('0x4f')]||0x0)===0x0){_0xe9e276[_0xe79c('0x9c')]=![];_0xe9e276[_0xe79c('0x4d')]=0x0;_0xe9e276[_0xe79c('0x3e')]=_0xe79c('0x9e');loggerSyncQueueSummary['error'](_0xe79c('0x9f'),_0xe9e276[_0xe79c('0x3f')],_0xe79c('0xa0'));}else{_0xe9e276[_0xe79c('0x3e')]=_0xe79c('0xa1');loggerSyncQueueSummary[_0xe79c('0x91')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0xe9e276[_0xe79c('0x3f')],'is\x20disactive');}emitVoiceQueueSummary(_0xe9e276);}}function notSendMessagesCampaign(_0x2e80b8){if(_0x2e80b8[_0xe79c('0x9c')]){if(_0x2e80b8[_0xe79c('0x6c')]===0x0){_0x2e80b8['sendMessageOneNotActive']=![];_0x2e80b8[_0xe79c('0x3e')]=_0xe79c('0x9e');loggerSyncQueueSummary[_0xe79c('0x91')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x2e80b8[_0xe79c('0x3f')],_0xe79c('0xa0'));}else{_0x2e80b8[_0xe79c('0x3e')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xe79c('0x91')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x2e80b8['name'],_0xe79c('0xa2'));}emitCampaignSummary(_0x2e80b8);}}function createObjHistory(_0x322a23,_0x35f1c9,_0x29685a,_0x133584,_0x410cb1){_0x322a23[_0xe79c('0x3e')]=_0x29685a;var _0x3dc0ff=new Action(_0x322a23,_0x35f1c9);var _0x1445e7=new History(_0x3dc0ff);_0x1445e7[_0xe79c('0xa3')]=_0x133584;_0x1445e7[_0xe79c('0xa4')]=_0x410cb1;_0x1445e7[_0xe79c('0xa5')]=_0x3dc0ff[_0xe79c('0xa6')];return _0x1445e7;}Dialer[_0xe79c('0x1a')][_0xe79c('0x3a')]=function(){var _0x7169b7=this;setInterval(function(){_0x7169b7[_0xe79c('0xa7')](_0x7169b7[_0xe79c('0xa8')],_0xe79c('0xa9'));_0x7169b7['clearZombieChannels'](_0x7169b7[_0xe79c('0x24')],_0xe79c('0xaa'));},0x32c8);};Dialer[_0xe79c('0x1a')]['clearZombieChannels']=function(_0x3929a0,_0x24d16f){var _0x3a91b3=this;for(var _0x225ad2 in _0x3929a0){if(typeof _0x3929a0[_0x225ad2]!==_0xe79c('0x95')){this[_0xe79c('0x1d')][_0xe79c('0x1b')](function(){if(!_[_0xe79c('0xab')](_0x3929a0[_0x225ad2])){return ami[_0xe79c('0xac')]({'action':_0xe79c('0xad'),'channel':_0x3929a0[_0x225ad2][_0xe79c('0xae')]})[_0xe79c('0xaf')](function(_0x822a88){if(_0x822a88['message']===_0xe79c('0xb0')){setTimeout(function(){if(_0x3929a0[_0x225ad2]&&_0x3929a0[_0x225ad2][_0xe79c('0x4a')]!==_0xe79c('0xb1')){_0x3a91b3['updateOriginated'](_0x3a91b3[_0xe79c('0x1e')][_0x3929a0[_0x225ad2]['queue']]);logger[_0xe79c('0x91')]('[Dialer][checkChannel]',_0x24d16f,_0x225ad2,_0x3929a0[_0x225ad2]['queue']);delete _0x3929a0[_0x225ad2];}if(_0x3929a0[_0x225ad2]&&_0x3929a0[_0x225ad2][_0xe79c('0x4a')]===_0xe79c('0xb1')){_0x3a91b3['updateOriginated'](_0x3a91b3[_0xe79c('0x1f')][_0x3929a0[_0x225ad2][_0xe79c('0xb2')]]);logger[_0xe79c('0x91')]('[Dialer][checkChannel][ivr]',_0x24d16f,_0x225ad2,_0x3929a0[_0x225ad2]['queue']);delete _0x3929a0[_0x225ad2];}},0x2328);}});}});}}};Dialer[_0xe79c('0x1a')][_0xe79c('0xb3')]=function(_0x409d90){return BPromise[_0xe79c('0xb4')]()['then'](cmHopper[_0xe79c('0xb3')](_0x409d90))[_0xe79c('0xaf')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0xe79c('0x1a')]['checkIsBlackList']=function(_0x3d920f){return BPromise[_0xe79c('0xb4')]()[_0xe79c('0xb5')](cmHopperBlack[_0xe79c('0xb6')](_0x3d920f))[_0xe79c('0xaf')](loggerCatch(_0xe79c('0xb7')));};Dialer[_0xe79c('0x1a')][_0xe79c('0xb8')]=function(_0x491bdf){return BPromise[_0xe79c('0xb4')]()[_0xe79c('0xb5')](cmHopperBlack[_0xe79c('0xb8')](_0x491bdf))[_0xe79c('0xaf')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer['prototype'][_0xe79c('0xb9')]=function(_0x365a16){return BPromise[_0xe79c('0xb4')]()['then'](cmHopperHistory[_0xe79c('0xba')](_0x365a16))[_0xe79c('0xaf')](loggerCatch(_0xe79c('0xbb')));};Dialer[_0xe79c('0x1a')][_0xe79c('0xbc')]=function(_0x57384b){return BPromise[_0xe79c('0xb4')]()[_0xe79c('0xb5')](cmHopper[_0xe79c('0xbc')](_0x57384b))['catch'](loggerCatch(_0xe79c('0xbd')));};Dialer[_0xe79c('0x1a')][_0xe79c('0xbe')]=function(_0x189fcd,_0x51609e,_0x4dbb5a){return BPromise[_0xe79c('0xb4')]()[_0xe79c('0xb5')](cmHopper[_0xe79c('0xbe')](_0x189fcd,_0x51609e,_0x4dbb5a))[_0xe79c('0xaf')](loggerCatch(_0xe79c('0xbf')));};Dialer[_0xe79c('0x1a')]['getContactDialer']=function(_0x1175c2,_0x2f73c5,_0x1fc4bf,_0x30d3c2,_0x16c4a7){return BPromise['resolve']()['then'](cmHopper[_0xe79c('0xc0')](_0x1175c2,_0x2f73c5,_0x1fc4bf,_0x30d3c2))['catch'](function(_0x56d31b){_0x16c4a7[_0xe79c('0xc1')]-=_0x1fc4bf;_0x16c4a7[_0xe79c('0xc1')]=_0x16c4a7[_0xe79c('0xc1')]>0x0?_0x16c4a7[_0xe79c('0xc1')]:0x0;loggerCatch(_0xe79c('0xc2'))(_0x56d31b);});};Dialer[_0xe79c('0x1a')][_0xe79c('0xc3')]=function(_0x5a0fc2,_0x52182a,_0x2491fc,_0x19368f){return BPromise[_0xe79c('0xb4')]()[_0xe79c('0xb5')](cmHopper['getContactDialerIvr'](_0x5a0fc2,_0x52182a,_0x2491fc))['catch'](function(_0x4f17b9){_0x19368f[_0xe79c('0xc1')]-=_0x52182a;_0x19368f[_0xe79c('0xc1')]=_0x19368f[_0xe79c('0xc1')]>0x0?_0x19368f[_0xe79c('0xc1')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x4f17b9);});};Dialer[_0xe79c('0x1a')][_0xe79c('0xc4')]=function(_0x2a58a2){return BPromise[_0xe79c('0xb4')]()['then'](voiceQueueRt[_0xe79c('0xc4')](_0x2a58a2))[_0xe79c('0xaf')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0xe79c('0x1a')]['moveContactManagedDialer']=function(_0x34bbf1){return BPromise[_0xe79c('0xb4')]()[_0xe79c('0xb5')](cmHopper['moveContactManagedDialer'](_0x34bbf1))[_0xe79c('0xaf')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0xe79c('0x1a')][_0xe79c('0xc5')]=function(_0x42a84e){return BPromise['resolve']()[_0xe79c('0xb5')](cmHopperHistory[_0xe79c('0xc5')](_0x42a84e))[_0xe79c('0xaf')](loggerCatch(_0xe79c('0xc6')));};Dialer[_0xe79c('0x1a')][_0xe79c('0xc7')]=function(_0x49b208){if(!_['isUndefined'](_0x49b208)&&_0x49b208!==null){if(typeof _0x49b208[_0xe79c('0x6c')]!==_0xe79c('0x95')){if(_0x49b208[_0xe79c('0x6c')]>0x0){_0x49b208['originated']-=0x1;}else{logger[_0xe79c('0x91')](_0xe79c('0xc8'));}}}else{logger[_0xe79c('0x91')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype']['loggerHandler']=function(_0x14d623,_0x319fec){var _0x494015=this;return function(_0x4b5aeb){_0x494015[_0xe79c('0xc7')](_0x319fec);logger[_0xe79c('0x91')](_0x14d623,util[_0xe79c('0x92')](_0x4b5aeb,{'showHidden':![],'depth':null}));};};Dialer[_0xe79c('0x1a')]['emptyContact']=function(_0x330bf9,_0xb548f,_0xd5c7a9){var _0x226b0a={'state':0x19,'statedesc':_0xe79c('0xc9')};this[_0xe79c('0xc7')](_0xb548f);this[_0xe79c('0xca')](_['merge'](_0x226b0a,_[_0xe79c('0xcb')](_0xd5c7a9,[_0xe79c('0xcc'),_0xe79c('0xcd'),_0xe79c('0xce'),_0xe79c('0xcf'),_0xe79c('0xd0')])),_0xe79c('0xd1'),_0xe79c('0xd2'));logger['error'](_0x330bf9);};Dialer[_0xe79c('0x1a')][_0xe79c('0xd3')]=function(_0x544b9f){return _0x544b9f===_0xe79c('0xd4');};Dialer[_0xe79c('0x1a')][_0xe79c('0xd5')]=function(_0x1acc3c){return!_[_0xe79c('0x3b')](_0x1acc3c)&&_0x1acc3c&&!_[_0xe79c('0x3b')](_0x1acc3c[_0xe79c('0x3f')])&&!_[_0xe79c('0x3b')](_0x1acc3c[_0xe79c('0x72')])&&_0x1acc3c['active']&&(this['trunks'][util[_0xe79c('0x75')](_0xe79c('0xd6'),_0x1acc3c[_0xe79c('0x3f')])]['status']==='reachable'||this[_0xe79c('0x21')][util[_0xe79c('0x75')](_0xe79c('0xd6'),_0x1acc3c[_0xe79c('0x3f')])][_0xe79c('0xad')]==='unmonitored');};Dialer['prototype']['saveInDb']=function(_0x302a33,_0x1f48fc,_0x38362f){this[_0xe79c('0xc5')](_0x302a33)[_0xe79c('0xaf')](loggerCatch(_0x1f48fc));this['moveContactManagedDialer'](_0x302a33)[_0xe79c('0xaf')](loggerCatch(_0x38362f));};Dialer['prototype']['syncVarSet']=function(_0xe3921){var _0x4bead2=this[_0xe79c('0xa8')][_0xe3921[_0xe79c('0xd7')]];var _0x263c41;if(!_[_0xe79c('0xab')](_0xe3921)&&!_[_0xe79c('0xab')](_0xe3921[_0xe79c('0xd8')])&&!_['isNil'](_0xe3921['variable'][_0xe79c('0xd9')])&&_0xe3921[_0xe79c('0xda')]===_0xe79c('0xdb')&&_0x4bead2){if(_0x4bead2[_0xe79c('0x4a')]!==_0xe79c('0xb1')&&this[_0xe79c('0x1e')][_0x4bead2[_0xe79c('0xb2')]][_0xe79c('0xdc')]&&_0xe3921['value']===_0xe79c('0xdd')){delete this[_0xe79c('0xa8')][_0xe3921[_0xe79c('0xd7')]];this[_0xe79c('0xc7')](this[_0xe79c('0x1e')][_0x4bead2[_0xe79c('0xb2')]]);this[_0xe79c('0x1e')][_0x4bead2['queue']][_0xe79c('0x5a')]+=0x1;this[_0xe79c('0x1e')][_0x4bead2['queue']][_0xe79c('0x59')]+=0x1;_0x263c41=new Hangup(_0x4bead2,_0xe3921);_0x263c41[_0xe79c('0xa3')]=0x12;_0x263c41[_0xe79c('0xa4')]=_0xe79c('0xde');_0x263c41[_0xe79c('0xdf')]=_0xe79c('0xe0');ami[_0xe79c('0xe1')](_0xe79c('0xe2'),ut['buildObj'](_0x263c41,'amd'));this[_0xe79c('0xca')](_0x263c41,_0xe79c('0xe3'),_0xe79c('0xe4'));}if(_0x4bead2[_0xe79c('0x4a')]!==_0xe79c('0xb1')&&this[_0xe79c('0x1e')][_0x4bead2[_0xe79c('0xb2')]]['dialAMDActive']&&_0xe3921[_0xe79c('0xe5')]===_0xe79c('0xe6')){var _0x2f432a=this;return new BPromise(function(_0xbf3c38,_0x3c76d6){delete _0x2f432a['uniqueId'][_0xe3921[_0xe79c('0xd7')]];_0x2f432a['updateOriginated'](_0x2f432a[_0xe79c('0x1e')][_0x4bead2['queue']]);_0x2f432a[_0xe79c('0x1e')][_0x4bead2['queue']][_0xe79c('0x5a')]+=0x1;_0x2f432a[_0xe79c('0x1e')][_0x4bead2['queue']][_0xe79c('0x59')]+=0x1;var _0x465d15=_0x2f432a[_0xe79c('0x1e')][_0x4bead2[_0xe79c('0xb2')]];var _0x211d21=new Hangup(_0x4bead2,_0xe3921);_0x211d21[_0xe79c('0xa3')]=0x13;_0x211d21[_0xe79c('0xa4')]='Machine';_0x211d21[_0xe79c('0xdf')]=_0xe79c('0xe0');_0x211d21[_0xe79c('0xe7')]+=0x1;_0x211d21[_0xe79c('0xe8')]+=0x1;_0x211d21[_0xe79c('0xe9')]=!![];ami[_0xe79c('0xe1')](_0xe79c('0xe2'),ut[_0xe79c('0xea')](_0x211d21,'amd'));_0x2f432a[_0xe79c('0xc5')](_0x211d21)['catch'](loggerCatch(_0xe79c('0xeb')));if(_0x211d21[_0xe79c('0xec')]+_0x211d21[_0xe79c('0xed')]+_0x211d21['countnoanswerretry']+_0x211d21[_0xe79c('0xee')]+_0x211d21['countdropretry']+_0x211d21[_0xe79c('0xef')]+_0x211d21[_0xe79c('0xe7')]+_0x211d21[_0xe79c('0xf0')]>=_0x465d15[_0xe79c('0xf1')]){_0x2f432a[_0xe79c('0xf2')](_0x211d21,_0xbf3c38,_0x3c76d6,_0xe79c('0xf3'));}else{if(_0x211d21['countmachineretry']>=_0x465d15[_0xe79c('0xf4')]){_0x2f432a['createStateFinal'](_0x211d21,_0xbf3c38,_0x3c76d6,_0xe79c('0xf5'));}else{_0x2f432a['rescheduleContact']({'active':![],'countmachineretry':_0x211d21[_0xe79c('0xe7')],'scheduledat':moment()[_0xe79c('0xf6')](_0x465d15[_0xe79c('0xf7')],_0xe79c('0xf8'))['format'](_0xe79c('0xf9')),'ContactId':_0x211d21[_0xe79c('0xcc')],'ListId':_0x211d21[_0xe79c('0xcd')],'VoiceQueueId':_0x211d21[_0xe79c('0xcf')]||undefined,'CampaignId':_0x211d21[_0xe79c('0xd0')]||undefined})['catch'](loggerCatch(_0xe79c('0xfa')));_0xbf3c38({'reschedule':0x1});}}});}if(_0x4bead2['type']===_0xe79c('0xb1')&&this['campaigns'][_0x4bead2[_0xe79c('0xb2')]]['dialAMDActive']&&_0xe3921['value']===_0xe79c('0xdd')){delete this[_0xe79c('0xa8')][_0xe3921['uniqueid']];this[_0xe79c('0xc7')](this[_0xe79c('0x1f')][_0x4bead2['queue']]);_0x263c41=new Hangup(_0x4bead2,_0xe3921);_0x263c41['state']=0x12;_0x263c41[_0xe79c('0xa4')]=_0xe79c('0xde');_0x263c41['membername']=_0xe79c('0xe0');ami[_0xe79c('0xe1')](_0xe79c('0xe2'),ut[_0xe79c('0xea')](_0x263c41,_0xe79c('0xe9')));this[_0xe79c('0xca')](_0x263c41,_0xe79c('0xfb'),_0xe79c('0xfc'));}if(_0x4bead2[_0xe79c('0x4a')]===_0xe79c('0xb1')&&this[_0xe79c('0x1f')][_0x4bead2[_0xe79c('0xb2')]][_0xe79c('0xdc')]&&_0xe3921[_0xe79c('0xe5')]==='MACHINE'){var _0x2f432a=this;return new BPromise(function(_0x4100da,_0x459d9b){delete _0x2f432a[_0xe79c('0xa8')][_0xe3921[_0xe79c('0xd7')]];_0x2f432a['updateOriginated'](_0x2f432a[_0xe79c('0x1f')][_0x4bead2[_0xe79c('0xb2')]]);_0x2f432a['campaigns'][_0x4bead2[_0xe79c('0xb2')]][_0xe79c('0x5a')]+=0x1;_0x2f432a[_0xe79c('0x1f')][_0x4bead2[_0xe79c('0xb2')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x468451=_0x2f432a[_0xe79c('0x1f')][_0x4bead2[_0xe79c('0xb2')]];var _0x4b1e96=new Hangup(_0x4bead2,_0xe3921);_0x4b1e96[_0xe79c('0xa3')]=0x13;_0x4b1e96[_0xe79c('0xa4')]=_0xe79c('0xfd');_0x4b1e96[_0xe79c('0xdf')]='AMD';_0x4b1e96['countmachineretry']+=0x1;_0x4b1e96[_0xe79c('0xe8')]+=0x1;_0x4b1e96[_0xe79c('0xe9')]=!![];ami[_0xe79c('0xe1')](_0xe79c('0xe2'),ut[_0xe79c('0xea')](_0x4b1e96,_0xe79c('0xe9')));_0x2f432a['createHistory'](_0x4b1e96)['catch'](loggerCatch(_0xe79c('0xeb')));if(_0x4b1e96[_0xe79c('0xec')]+_0x4b1e96[_0xe79c('0xed')]+_0x4b1e96[_0xe79c('0xfe')]+_0x4b1e96['countnosuchnumberretry']+_0x4b1e96['countdropretry']+_0x4b1e96[_0xe79c('0xef')]+_0x4b1e96[_0xe79c('0xe7')]+_0x4b1e96[_0xe79c('0xf0')]>=_0x468451[_0xe79c('0xf1')]){_0x2f432a[_0xe79c('0xf2')](_0x4b1e96,_0x4100da,_0x459d9b,_0xe79c('0xf3'));}else{if(_0x4b1e96['countmachineretry']>=_0x468451[_0xe79c('0xf4')]){_0x2f432a[_0xe79c('0xff')](_0x4b1e96,_0x4100da,_0x459d9b,_0xe79c('0xf5'));}else{_0x2f432a['rescheduleContact']({'active':![],'countmachineretry':_0x4b1e96[_0xe79c('0xe7')],'scheduledat':moment()[_0xe79c('0xf6')](_0x468451[_0xe79c('0xf7')],_0xe79c('0xf8'))['format'](_0xe79c('0xf9')),'ContactId':_0x4b1e96[_0xe79c('0xcc')],'ListId':_0x4b1e96['ListId'],'VoiceQueueId':_0x4b1e96[_0xe79c('0xcf')]||undefined,'CampaignId':_0x4b1e96[_0xe79c('0xd0')]||undefined})[_0xe79c('0xaf')](loggerCatch(_0xe79c('0xfa')));_0x4100da({'reschedule':0x1});}}});}}};Dialer[_0xe79c('0x1a')]['syncHangup']=function(_0x24873d){var _0x45a11a=this[_0xe79c('0xa8')][_0x24873d['uniqueid']];var _0x2470ee=this;var _0x418602;if(_0x45a11a&&_0x45a11a['type']==='ivr'){delete this[_0xe79c('0xa8')][_0x24873d[_0xe79c('0xd7')]];this[_0xe79c('0xc7')](this[_0xe79c('0x1f')][_0x45a11a[_0xe79c('0xb2')]]);this[_0xe79c('0x1f')][_0x45a11a['queue']][_0xe79c('0x100')]+=0x1;_0x418602=new Hangup(_0x45a11a,_0x24873d);this[_0xe79c('0xc5')](_0x418602)[_0xe79c('0xaf')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xe79c('0x101')](_0x418602)['catch'](loggerCatch(_0xe79c('0x102')));}if(_0x45a11a&&_0x45a11a[_0xe79c('0x4a')]!==_0xe79c('0xb1')&&isNotNull(this['voiceQueues'][_0x45a11a['queue']][_0xe79c('0x103')])){delete this[_0xe79c('0xa8')][_0x24873d[_0xe79c('0xd7')]];this['updateOriginated'](this['voiceQueues'][_0x45a11a[_0xe79c('0xb2')]]);this[_0xe79c('0x1e')][_0x45a11a[_0xe79c('0xb2')]][_0xe79c('0x5a')]+=0x1;this['voiceQueues'][_0x45a11a['queue']][_0xe79c('0x59')]+=0x1;_0x418602=new Hangup(_0x45a11a,_0x24873d);_0x418602[_0xe79c('0xa3')]=0x10;_0x418602[_0xe79c('0xa4')]='AnswerAGI';_0x418602['membername']=_0xe79c('0x104');this[_0xe79c('0xc5')](_0x418602)[_0xe79c('0xaf')](loggerCatch(_0xe79c('0x105')));this[_0xe79c('0x101')](_0x418602)[_0xe79c('0xaf')](loggerCatch(_0xe79c('0x102')));}if(_0x45a11a&&_0x45a11a['type']!=='ivr'&&!isNotNull(this[_0xe79c('0x1e')][_0x45a11a[_0xe79c('0xb2')]]['dialQueueProject'])){delete this['uniqueId'][_0x24873d['uniqueid']];this['updateOriginated'](this[_0xe79c('0x1e')][_0x45a11a['queue']]);this[_0xe79c('0x1e')][_0x45a11a[_0xe79c('0xb2')]]['outboundUnknownCallsDay']+=0x1;_0x418602=new Hangup(_0x45a11a,_0x24873d);_0x418602['state']=0xc;_0x418602['statedesc']=_0x24873d['cause-txt'];_0x418602[_0xe79c('0xdf')]=_0xe79c('0x106');this[_0xe79c('0xc5')](_0x418602)['catch'](loggerCatch(_0xe79c('0x105')));this[_0xe79c('0x101')](_0x418602)['catch'](loggerCatch(_0xe79c('0x102')));}};Dialer[_0xe79c('0x1a')][_0xe79c('0x30')]=function(_0x4d73a8){var _0x2df6fd=this['uniqueId'][_0x4d73a8[_0xe79c('0xd7')]];var _0x1e816c=this;if(this[_0xe79c('0x1e')][_0x4d73a8[_0xe79c('0xb2')]]){if(_0x2df6fd&&_0x2df6fd[_0xe79c('0x4a')]!==_0xe79c('0xb1')){delete this['uniqueId'][_0x4d73a8[_0xe79c('0xd7')]];this[_0xe79c('0x1e')][_0x4d73a8[_0xe79c('0xb2')]][_0xe79c('0x5a')]+=0x1;var _0xb2e2d4=new AgentComplete(_0x2df6fd,_0x4d73a8);if(_0x4d73a8[_0xe79c('0x107')]===_0xe79c('0x108')){_0xb2e2d4[_0xe79c('0x109')]=this[_0xe79c('0x1e')][_0x4d73a8[_0xe79c('0xb2')]][_0xe79c('0x10a')]&&this[_0xe79c('0x1e')][_0x4d73a8[_0xe79c('0xb2')]]['dialAgiAfterHangupAgent']?moment()[_0xe79c('0x75')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this['createHistory'](_0xb2e2d4)['catch'](loggerCatch(_0xe79c('0x10b')));this[_0xe79c('0x101')](_0xb2e2d4)[_0xe79c('0xaf')](loggerCatch(_0xe79c('0x10c')));}}};Dialer[_0xe79c('0x1a')][_0xe79c('0x10d')]=function(_0x26f0ed){if(this['voiceQueues'][_0x26f0ed[_0xe79c('0xb2')]]){if(this[_0xe79c('0xa8')][_0x26f0ed['uniqueid']]&&this[_0xe79c('0xa8')][_0x26f0ed[_0xe79c('0xd7')]][_0xe79c('0x4a')]!==_0xe79c('0xb1')){this['updateOriginated'](this['voiceQueues'][_0x26f0ed['queue']]);this[_0xe79c('0xa8')][_0x26f0ed['uniqueid']][_0xe79c('0x10e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x28d5f1){this[_0xe79c('0xc5')](_0x28d5f1)['catch'](loggerCatch(_0xe79c('0x10b')));this['moveContactManagedDialer'](_0x28d5f1)[_0xe79c('0xaf')](loggerCatch(_0xe79c('0x10f')));};Dialer['prototype'][_0xe79c('0x2c')]=function(_0x106eae){var _0x35fe1e=this['uniqueId'][_0x106eae[_0xe79c('0xd7')]];var _0x333759=this;if(this[_0xe79c('0x1e')][_0x106eae[_0xe79c('0xb2')]]){if(_0x35fe1e&&_0x35fe1e[_0xe79c('0x4a')]!=='ivr'){delete this[_0xe79c('0xa8')][_0x106eae[_0xe79c('0xd7')]];this[_0xe79c('0xc7')](this[_0xe79c('0x1e')][_0x106eae[_0xe79c('0xb2')]]);_0x35fe1e[_0xe79c('0x110')]=moment()[_0xe79c('0x75')](_0xe79c('0xf9'));var _0x2429c5=new QueueCallerAbandon(_0x35fe1e,_0x106eae);if(getSeconds(_0x35fe1e[_0xe79c('0x110')],_0x35fe1e[_0xe79c('0x111')])>=_0x35fe1e[_0xe79c('0x112')]){this['voiceQueues'][_0x106eae[_0xe79c('0xb2')]][_0xe79c('0x67')]+=0x1;this[_0xe79c('0x1e')][_0x106eae[_0xe79c('0xb2')]][_0xe79c('0x113')]+=0x1;this[_0xe79c('0x1e')][_0x106eae[_0xe79c('0xb2')]][_0xe79c('0x114')]+=0x1;_0x2429c5[_0xe79c('0xa3')]=0xa;_0x2429c5[_0xe79c('0xa4')]=_0xe79c('0x115');_0x2429c5['dropreason']=_0xe79c('0x116');_0x2429c5[_0xe79c('0x109')]=this['voiceQueues'][_0x106eae[_0xe79c('0xb2')]][_0xe79c('0x10a')]?moment()[_0xe79c('0x75')](_0xe79c('0xf9')):undefined;_0x2429c5['countdropretry']+=0x1;_0x2429c5[_0xe79c('0xe8')]+=0x1;if(_0x2429c5[_0xe79c('0x117')]>=this[_0xe79c('0x1e')][_0x106eae[_0xe79c('0xb2')]]['dialDropMaxRetry']){this[_0xe79c('0x118')](_0x2429c5);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x2429c5[_0xe79c('0x117')],'scheduledat':moment()['add'](this[_0xe79c('0x1e')][_0x106eae[_0xe79c('0xb2')]][_0xe79c('0x119')],_0xe79c('0xf8'))[_0xe79c('0x75')](_0xe79c('0xf9')),'ContactId':_0x35fe1e[_0xe79c('0xcc')],'ListId':_0x35fe1e['ListId'],'VoiceQueueId':_0x35fe1e[_0xe79c('0xcf')]||undefined,'CampaignId':_0x35fe1e['CampaignId']||undefined})[_0xe79c('0xaf')](loggerCatch(_0xe79c('0x11a')));var _0x186c31=new History(_0x2429c5);_0x186c31[_0xe79c('0xa3')]=0xa;_0x186c31['statedesc']='Drop';_0x186c31[_0xe79c('0xa6')]=moment()['format'](_0xe79c('0xf9'));_0x186c31[_0xe79c('0xa5')]=_0x186c31['starttime'];_0x186c31[_0xe79c('0x11b')]=_0x2429c5[_0xe79c('0x11b')];_0x186c31[_0xe79c('0x11c')]=_0x2429c5[_0xe79c('0x11c')];this[_0xe79c('0xc5')](_0x186c31)[_0xe79c('0xaf')](loggerCatch(_0xe79c('0x11d')));}}else{this[_0xe79c('0x1e')][_0x106eae['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xe79c('0x1e')][_0x106eae[_0xe79c('0xb2')]]['outboundDropCallsDayCallersExit']+=0x1;_0x2429c5[_0xe79c('0xa3')]=0xb;_0x2429c5[_0xe79c('0xa4')]='Abandoned';_0x2429c5[_0xe79c('0x11e')]=_0xe79c('0x11f');_0x2429c5[_0xe79c('0xef')]+=0x1;_0x2429c5['countglobal']+=0x1;if(_0x2429c5[_0xe79c('0xef')]>=this[_0xe79c('0x1e')][_0x106eae[_0xe79c('0xb2')]]['dialAbandonedMaxRetry']){this[_0xe79c('0x118')](_0x2429c5);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x2429c5[_0xe79c('0xef')],'scheduledat':moment()[_0xe79c('0xf6')](this[_0xe79c('0x1e')][_0x106eae['queue']][_0xe79c('0x120')],_0xe79c('0xf8'))[_0xe79c('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x35fe1e[_0xe79c('0xcc')],'ListId':_0x35fe1e['ListId'],'VoiceQueueId':_0x35fe1e[_0xe79c('0xcf')]||undefined,'CampaignId':_0x35fe1e[_0xe79c('0xd0')]||undefined})['catch'](loggerCatch(_0xe79c('0x121')));var _0x186c31=new History(_0x2429c5);_0x186c31[_0xe79c('0xa3')]=0xb;_0x186c31[_0xe79c('0xa4')]=_0xe79c('0x122');_0x186c31[_0xe79c('0xa6')]=moment()[_0xe79c('0x75')](_0xe79c('0xf9'));_0x186c31['endtime']=_0x186c31[_0xe79c('0xa6')];_0x186c31[_0xe79c('0x11b')]=_0x2429c5[_0xe79c('0x11b')];_0x186c31[_0xe79c('0x11c')]=_0x2429c5[_0xe79c('0x11c')];this[_0xe79c('0xc5')](_0x186c31)[_0xe79c('0xaf')](loggerCatch(_0xe79c('0x123')));}}}}};Dialer[_0xe79c('0x1a')]['syncNewExten']=function(_0x6a17fc){if(this['actions'][_0x6a17fc[_0xe79c('0xd7')]]){this[_0xe79c('0x24')][_0x6a17fc[_0xe79c('0xd7')]]['channel']=_0x6a17fc[_0xe79c('0xae')];}if(this[_0xe79c('0xa8')][_0x6a17fc[_0xe79c('0xd7')]]){this[_0xe79c('0xa8')][_0x6a17fc[_0xe79c('0xd7')]][_0xe79c('0xae')]=_0x6a17fc[_0xe79c('0xae')];}};Dialer['prototype'][_0xe79c('0x36')]=function(_0x1724c0){if(strategy[this['voiceQueues'][this[_0xe79c('0x24')][_0x1724c0[_0xe79c('0x124')]][_0xe79c('0xb2')]][_0xe79c('0x125')]]===_0xe79c('0x126')){if(this['actions'][_0x1724c0['actionid']]&&_[_0xe79c('0xab')](this[_0xe79c('0x24')][_0x1724c0[_0xe79c('0x124')]][_0xe79c('0x127')])&&_0x1724c0[_0xe79c('0xad')]==='1'&&_0x1724c0[_0xe79c('0x128')]==='0'){if(this[_0xe79c('0x20')][_0x1724c0[_0xe79c('0x129')]]){if(!this[_0xe79c('0x20')][_0x1724c0[_0xe79c('0x129')]][_0xe79c('0x127')]){this[_0xe79c('0x20')][_0x1724c0[_0xe79c('0x129')]][_0xe79c('0x127')]=!![];this[_0xe79c('0x24')][_0x1724c0[_0xe79c('0x124')]][_0xe79c('0x127')]=!![];this['actions'][_0x1724c0['actionid']][_0xe79c('0x129')]=_0x1724c0[_0xe79c('0x129')];}}}}else if((strategy[this['voiceQueues'][this['actions'][_0x1724c0[_0xe79c('0x124')]]['queue']][_0xe79c('0x125')]]||'rrmemory')===_0xe79c('0x19')){if(this['actions'][_0x1724c0[_0xe79c('0x124')]]){if(this['agents'][_0x1724c0[_0xe79c('0x129')]]){this[_0xe79c('0x24')][_0x1724c0[_0xe79c('0x124')]]['stateinterface']=_0x1724c0[_0xe79c('0x129')];if(_[_0xe79c('0xab')](this['queueBooked'][this['actions'][_0x1724c0['actionid']]['queue']])){this['queueBooked'][this['actions'][_0x1724c0[_0xe79c('0x124')]][_0xe79c('0xb2')]]=[];}this['queueBooked'][this[_0xe79c('0x24')][_0x1724c0['actionid']][_0xe79c('0xb2')]][_0xe79c('0x12a')](_[_0xe79c('0x89')](_[_0xe79c('0xcb')](this[_0xe79c('0x24')][_0x1724c0[_0xe79c('0x124')]],[_0xe79c('0x12b'),_0xe79c('0x129')]),{'status':_0x1724c0[_0xe79c('0xad')],'paused':_0x1724c0['paused']}));}}}};function unlockQueueStatus(_0x15bb68,_0x3e8b72){setTimeout(function(){if(_[_0xe79c('0x3b')](_0x15bb68[_0xe79c('0x12c')])){loggerBooked['error'](_0xe79c('0x12d'),_0x3e8b72);}_0x15bb68['queueStatusComplete']=!![];loggerBooked['info'](_0xe79c('0x12e'),_0x3e8b72,JSON[_0xe79c('0x12f')](_[_0xe79c('0xcb')](_0x15bb68,[_0xe79c('0x3f'),_0xe79c('0x12c')])));},0x1f3);}Dialer[_0xe79c('0x1a')][_0xe79c('0x38')]=function(_0x4051f1){var _0x29cbfa=this;var _0x4806b2=_0x29cbfa[_0xe79c('0x1e')][_0x29cbfa[_0xe79c('0x24')][_0x4051f1[_0xe79c('0x124')]][_0xe79c('0xb2')]];if(strategy[this[_0xe79c('0x1e')][this[_0xe79c('0x24')][_0x4051f1[_0xe79c('0x124')]]['queue']][_0xe79c('0x125')]]===_0xe79c('0x126')){if(this[_0xe79c('0x24')][_0x4051f1['actionid']]&&this[_0xe79c('0x24')][_0x4051f1[_0xe79c('0x124')]]['stateinterface']){this[_0xe79c('0x8d')]['run'](this[_0xe79c('0x24')][_0x4051f1[_0xe79c('0x124')]][_0xe79c('0x12b')],this[_0xe79c('0x24')][_0x4051f1[_0xe79c('0x124')]][_0xe79c('0x129')])[_0xe79c('0xaf')](function(_0x487796){logger[_0xe79c('0x91')](_0xe79c('0x130'),util['inspect'](_0x487796,{'showHidden':![],'depth':null}));})[_0xe79c('0x131')](function(){_0x29cbfa['updateOriginated'](_0x29cbfa[_0xe79c('0x1e')][_0x29cbfa[_0xe79c('0x24')][_0x4051f1[_0xe79c('0x124')]][_0xe79c('0xb2')]]);_0x29cbfa[_0xe79c('0x20')][_0x29cbfa[_0xe79c('0x24')][_0x4051f1[_0xe79c('0x124')]]['stateinterface']][_0xe79c('0x127')]=![];delete _0x29cbfa[_0xe79c('0x24')][_0x4051f1[_0xe79c('0x124')]];unlockQueueStatus(_0x4806b2);});}else{this['updateOriginated'](this['voiceQueues'][this['actions'][_0x4051f1['actionid']]['queue']]);this[_0xe79c('0xbc')]({'active':![],'ContactId':this[_0xe79c('0x24')][_0x4051f1[_0xe79c('0x124')]]['ContactId'],'ListId':this[_0xe79c('0x24')][_0x4051f1['actionid']][_0xe79c('0xcd')],'VoiceQueueId':this['actions'][_0x4051f1[_0xe79c('0x124')]][_0xe79c('0xcf')]||undefined,'CampaignId':this['actions'][_0x4051f1[_0xe79c('0x124')]][_0xe79c('0xd0')]||undefined})[_0xe79c('0xaf')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x4051f1[_0xe79c('0x124')]];unlockQueueStatus(_0x4806b2);}}else if((strategy[this[_0xe79c('0x1e')][this[_0xe79c('0x24')][_0x4051f1[_0xe79c('0x124')]]['queue']]['strategy']]||_0xe79c('0x19'))==='rrmemory'){var _0x7bb3af;if(this['actions'][_0x4051f1[_0xe79c('0x124')]]&&!_[_0xe79c('0x78')](this[_0xe79c('0x28')][this[_0xe79c('0x24')][_0x4051f1[_0xe79c('0x124')]]['queue']])){if(this[_0xe79c('0x29')][_0x29cbfa[_0xe79c('0x24')][_0x4051f1['actionid']][_0xe79c('0xb2')]]){this[_0xe79c('0x29')][_0x29cbfa[_0xe79c('0x24')][_0x4051f1['actionid']]['queue']]=this[_0xe79c('0x29')][this[_0xe79c('0x24')][_0x4051f1[_0xe79c('0x124')]]['queue']]?this[_0xe79c('0x29')][this['actions'][_0x4051f1[_0xe79c('0x124')]][_0xe79c('0xb2')]]:this[_0xe79c('0x28')][this[_0xe79c('0x24')][_0x4051f1['actionid']][_0xe79c('0xb2')]]?this[_0xe79c('0x28')][this[_0xe79c('0x24')][_0x4051f1[_0xe79c('0x124')]][_0xe79c('0xb2')]][_0xe79c('0x132')]||0x0:0x0;}this[_0xe79c('0x28')][this['actions'][_0x4051f1[_0xe79c('0x124')]][_0xe79c('0xb2')]][_0xe79c('0x132')]=this['queueBookedRR'][this[_0xe79c('0x24')][_0x4051f1[_0xe79c('0x124')]][_0xe79c('0xb2')]];for(var _0xbe9605=0x0;_0xbe9605=0x0;})[_0xe79c('0xaf')](myreject(_0x5ee5af)));}}else{_0x2371f4[_0xe79c('0x12a')](ami['Action']({'action':_0xe79c('0x149'),'command':util[_0xe79c('0x75')]('iftime\x20%s,%s',_0x166b3c,!_[_0xe79c('0x3b')](config[_0xe79c('0x14c')][_0x36e9cf])?_0x36e9cf:'')})['then'](function(_0x334662){return _0x334662[_0xe79c('0x14f')]['indexOf'](_0xe79c('0x14e'))>=0x0;})[_0xe79c('0xaf')](myreject(_0x5ee5af)));}BPromise['all'](_0x2371f4)[_0xe79c('0xb5')](function(_0x15b30d){var _0x1abd4b=_[_0xe79c('0x150')](_0x15b30d);if(_0x1abd4b){return _0x25df09(_0x1abd4b);}else{_0x18e93a['message']=_0x1673b2?'GLOBAL_INTERVAL_IS_OVERTIME':_0xe79c('0x151');return _0x5ee5af(msgResponse(_0xe79c('0x152'),'Failure',_0xe79c('0x153')+_0x1673b2+'\x20'+_0x25ae11+_0xe79c('0x154')+util[_0xe79c('0x92')](_0x166b3c,{'showHidden':![],'depth':null})+_0xe79c('0x155')+_0x36e9cf));}})[_0xe79c('0xaf')](function(_0x6ec6){return _0x5ee5af(msgResponse(_0xe79c('0x143'),'Failure',JSON[_0xe79c('0x12f')](_0x6ec6)));});});};Dialer[_0xe79c('0x1a')][_0xe79c('0x156')]=function(_0x9cc908){var _0x1a26a5=this;return function(){switch(_0x9cc908['dialMethod']){case _0xe79c('0x157'):freeVariablesPredictive(_0x9cc908);_0x1a26a5['handlePower'](_0x9cc908,0x1);break;case _0xe79c('0x158'):freeVariablesPredictive(_0x9cc908);_0x1a26a5[_0xe79c('0x159')](_0x9cc908,_0x9cc908[_0xe79c('0x15a')]);break;case'predictive':_0x1a26a5[_0xe79c('0xa')](_0x9cc908);break;case _0xe79c('0x15b'):freeVariablesPredictive(_0x9cc908);_0x1a26a5[_0xe79c('0x159')](_0x9cc908,0x1);break;default:freeVariablesPredictive(_0x9cc908);logger[_0xe79c('0x91')](_0xe79c('0x15c'),_0x9cc908[_0xe79c('0x3f')],_0xe79c('0x15d'));}};};Dialer[_0xe79c('0x1a')][_0xe79c('0x15e')]=function(_0xe05205){var _0x18bbfe=this;return function(){_0x18bbfe[_0xe79c('0x15f')](_0xe05205);};};Dialer[_0xe79c('0x1a')][_0xe79c('0xc')]=function(_0x51e7f2){var _0x166060=this;if(isNotPreview(_0x51e7f2[_0xe79c('0x55')])){if(isVoiceQueueOutbound(_0x51e7f2[_0xe79c('0x4a')])&&isActive(_0x51e7f2[_0xe79c('0x160')])){_0x51e7f2['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0xe79c('0xb5')](checkIsLoggedIn(_0x51e7f2,_0x51e7f2[_0xe79c('0x4e')]))[_0xe79c('0xb5')](checkIsActive(_0x51e7f2,_0x51e7f2[_0xe79c('0x160')]))[_0xe79c('0xb5')](checkInterval(_0x51e7f2))['then'](_0x166060[_0xe79c('0x13e')](_0x51e7f2))['then'](_0x166060[_0xe79c('0x141')](_0x51e7f2['dialGlobalInterval'],_0x51e7f2[_0xe79c('0x161')],_0x51e7f2['name'],_0x51e7f2))[_0xe79c('0xb5')](_0x166060['checkIfTimeIntervals'](_0x51e7f2['Interval'],_0x51e7f2[_0xe79c('0x161')],_0x51e7f2[_0xe79c('0x3f')],_0x51e7f2))[_0xe79c('0xb5')](_0x166060[_0xe79c('0x156')](_0x51e7f2))[_0xe79c('0xaf')](loggerCatchQueueSummary(_0xe79c('0x162'),_0x51e7f2));}else{notSendMessagesQueue(_0x51e7f2);}}else{freeVariablesPredictive(_0x51e7f2);}};Dialer['prototype'][_0xe79c('0x13d')]=function(){var _0x1f012e=this;var _0x139ff7;for(var _0x3f92de in this[_0xe79c('0x1f')]){if(typeof this[_0xe79c('0x1f')][_0x3f92de]!==_0xe79c('0x95')){_0x139ff7=this['campaigns'][_0x3f92de];if(isCampaignIvr(_0x139ff7[_0xe79c('0x4a')])&&isActive(_0x139ff7[_0xe79c('0x72')])){_0x139ff7[_0xe79c('0x9c')]=!![];BPromise[_0xe79c('0xb4')]()[_0xe79c('0xb5')](checkIsActive(_0x139ff7,_0x139ff7[_0xe79c('0x72')]))['then'](checkInterval(_0x139ff7))['then'](_0x1f012e[_0xe79c('0x13e')](_0x139ff7))[_0xe79c('0xb5')](_0x1f012e['checkIfTime'](_0x139ff7['dialGlobalInterval'],_0x139ff7['dialTimezone'],_0x139ff7[_0xe79c('0x3f')],_0x139ff7))[_0xe79c('0xb5')](_0x1f012e[_0xe79c('0x142')](_0x139ff7[_0xe79c('0x41')],_0x139ff7['dialTimezone'],_0x139ff7[_0xe79c('0x3f')],_0x139ff7))[_0xe79c('0xb5')](_0x1f012e[_0xe79c('0x15e')](_0x139ff7))['catch'](loggerCatchQueueSummary(_0xe79c('0x163'),_0x139ff7));}else{notSendMessagesCampaign(_0x139ff7);}}}};function getCallerIdRandom(_0x150cb4,_0x11dd3c){var _0x7bdaa7;var _0xfe3a39;var _0x254005;if(_0x11dd3c<=0x0){_0x11dd3c=0x1;}_0x7bdaa7=new RegExp(_0xe79c('0x164')+_0x11dd3c+'}$');_0xfe3a39=Math['pow'](0xa,_0x11dd3c-0x1);_0x254005=Math[_0xe79c('0x165')](0xa,_0x11dd3c)-0x1;return util['format']('%s',_['replace'](_0x150cb4,_0x7bdaa7,_[_0xe79c('0x166')](_0xfe3a39,_0x254005)));}function extractCalleridName(_0x481e62){var _0x24f69a=_0x481e62[_0xe79c('0x167')](/"(.*?)"/);return _0x24f69a?_0x24f69a[0x1]:_0x481e62;}function extractCalleridNumber(_0x15a4cc){var _0x518a1b=_0x15a4cc[_0xe79c('0x167')](/<(.*?)>/);return _0x518a1b?_0x518a1b[0x1]:_0x15a4cc;}Dialer[_0xe79c('0x1a')][_0xe79c('0x168')]=function(_0x245545,_0x33cf67){var _0x5c7680=this;var _0x14044f=uuid['v4']();this[_0xe79c('0x24')][_0x14044f]=new Action(_0x245545,_0x33cf67,_0x14044f);return new BPromise(function(_0x4f36d9,_0x2cdb2f){if(_['isUndefined'](_0x245545)&&typeof _0x245545!=='object'){return _0x2cdb2f(msgResponse(_0xe79c('0x169'),_0xe79c('0x144'),_0xe79c('0x16a')));}if(_['isUndefined'](_0x33cf67[_0xe79c('0x16b')][_0xe79c('0x16c')])||_0x33cf67['Contact'][_0xe79c('0x16c')]===null){return _0x2cdb2f(msgResponse(_0xe79c('0x169'),_0xe79c('0x144'),_0xe79c('0x16d')));}var _0x189819={'XMD-CALLERID':_0x5c7680[_0xe79c('0x24')][_0x14044f]['getCaller'](),'XMD-AGI':_0x245545['dialQueueProject']?util['format'](_0xe79c('0x16e'),ipAgi,_0x245545['dialQueueProject']):_0xe79c('0x16f'),'XMD-AGIAFTER':_0x245545[_0xe79c('0x10a')]?util[_0xe79c('0x75')](_0xe79c('0x16e'),ipAgi,_0x245545[_0xe79c('0x10a')]):_0xe79c('0x16f'),'XMD-QUEUE':_0x245545[_0xe79c('0x4a')]===_0xe79c('0x4b')?util['format'](_0xe79c('0x170'),_0x245545[_0xe79c('0x3f')],_0x245545[_0xe79c('0x171')]||'',_0x245545['dialAgiAfterHangupAgent']?'c':'',_0x245545['dialQueueTimeout']||0x3):_0xe79c('0x16f'),'XMD-CONTACTID':_0x33cf67[_0xe79c('0xcc')],'XMD-CDRTYPE':_0xe79c('0x9'),'CALLERID(all)':_0x5c7680[_0xe79c('0x24')][_0x14044f][_0xe79c('0x172')](),'XMD-AMD':_0x245545[_0xe79c('0xdc')]?'ACTIVE':_0xe79c('0x16f'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x245545['dialAMDActive']){_0x189819['XMD-AMDINITIALSILENCE']=_0x245545[_0xe79c('0x173')]||0x9c4;_0x189819[_0xe79c('0x174')]=_0x245545[_0xe79c('0x175')]||0x5dc;_0x189819[_0xe79c('0x176')]=_0x245545[_0xe79c('0x177')]||0x320;_0x189819[_0xe79c('0x178')]=_0x245545['dialAMDTotalAnalysisTime']||0x1388;_0x189819['XMD-AMDMINWORDLENGTH']=_0x245545[_0xe79c('0x179')]||0x64;_0x189819[_0xe79c('0x17a')]=_0x245545['dialAMDBetweenWordsSilence']||0x32;_0x189819[_0xe79c('0x17b')]=_0x245545[_0xe79c('0x17c')]||0x3;_0x189819[_0xe79c('0x17d')]=_0x245545[_0xe79c('0x17e')]||0x100;_0x189819[_0xe79c('0x17f')]=_0x245545[_0xe79c('0x180')]||0x1388;}if(_0x245545['type']===_0xe79c('0x4b')){_0x189819[_0xe79c('0x181')]=_0x33cf67[_0xe79c('0xcf')];}else{_0x189819[_0xe79c('0x182')]=_0x33cf67[_0xe79c('0xd0')];}for(var _0x5daa1d in _0x33cf67[_0xe79c('0x16b')]){if(typeof _0x33cf67[_0xe79c('0x16b')][_0x5daa1d]!==_0xe79c('0x95')){if(isNotNull(_0x33cf67[_0xe79c('0x16b')][_0x5daa1d])&&_0x5daa1d!=='id'&&_0x5daa1d!==_0xe79c('0x183')&&_0x5daa1d!=='createdAt'&&_0x5daa1d!==_0xe79c('0x184')){_0x189819[util['format'](_0xe79c('0x185'),_0xe79c('0x186'),_[_0xe79c('0x187')](_0x5daa1d))]=_0x33cf67[_0xe79c('0x16b')][_0x5daa1d];}}}var _0x5b17c6=_0x5c7680['isTrunkReachable'](_0x245545['Trunk'])?getCallerId(_0x245545['Trunk']['callerid'],_0x245545[_0xe79c('0x188')],_0x245545['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x245545['dialOriginateCallerIdNumber'],_0x245545[_0xe79c('0x189')]):_0x245545['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0x245545[_0xe79c('0x13f')])?_0x245545[_0xe79c('0x71')]['callerid']:_0x245545['TrunkBackup'][_0xe79c('0x73')],_0x245545['dialOriginateCallerIdName'],_0x245545[_0xe79c('0x189')]>0x0?getCallerIdRandom(_0x245545['dialOriginateCallerIdNumber'],_0x245545[_0xe79c('0x189')]):_0x245545[_0xe79c('0x56')]);if(_0x5b17c6){_0x189819[_0xe79c('0x18a')]=_0x5c7680[_0xe79c('0x24')][_0x14044f][_0xe79c('0x18b')]=extractCalleridName(_0x5b17c6);_0x189819[_0xe79c('0x18c')]=_0x5c7680['actions'][_0x14044f]['originatecalleridnum']=extractCalleridNumber(_0x5b17c6);}return ami[_0xe79c('0xac')]({'actionid':_0x14044f,'action':_0xe79c('0x169'),'channel':_0x5c7680['isTrunkReachable'](_0x245545[_0xe79c('0x71')])?util[_0xe79c('0x75')](_0xe79c('0x18d'),_0x245545[_0xe79c('0x71')]['name'],isNotNull(_0x245545[_0xe79c('0x58')])?_0x245545[_0xe79c('0x58')][_0xe79c('0x18e')]()||'':'',_0x245545[_0xe79c('0x18f')]>0x0?_0x33cf67[_0xe79c('0x16b')]['phone'][_0xe79c('0x190')](_0x245545[_0xe79c('0x18f')]):_0x33cf67['Contact'][_0xe79c('0x16c')]):util[_0xe79c('0x75')](_0xe79c('0x18d'),_[_0xe79c('0xab')](_0x245545[_0xe79c('0x13f')])?_0x245545[_0xe79c('0x71')][_0xe79c('0x3f')]:_0x245545[_0xe79c('0x13f')]['name'],isNotNull(_0x245545[_0xe79c('0x58')])?_0x245545[_0xe79c('0x58')]['trim']()||'':'',_0x245545[_0xe79c('0x18f')]>0x0?_0x33cf67[_0xe79c('0x16b')][_0xe79c('0x16c')][_0xe79c('0x190')](_0x245545[_0xe79c('0x18f')]):_0x33cf67[_0xe79c('0x16b')]['phone']),'callerid':_0x5b17c6,'Exten':_0xe79c('0xdb'),'Context':_0xe79c('0x191'),'Priority':'1','variable':_0x189819,'timeout':(_0x245545[_0xe79c('0x57')]||0x1e)*0x3e8,'async':!![],'channelid':_0x14044f})[_0xe79c('0xb5')](function(_0x2e1661){return _0x4f36d9(_0x2e1661);})['catch'](function(_0x246417){_0x245545['outboundOriginateFailureCallsDay']+=0x1;var _0x424f26=new History(_0x5c7680[_0xe79c('0x24')][_0x14044f]);logger[_0xe79c('0x91')](util[_0xe79c('0x75')](_0xe79c('0x192'),JSON[_0xe79c('0x12f')](_0x246417)));_0x424f26[_0xe79c('0xa3')]=0xe;_0x424f26[_0xe79c('0xa4')]=_0xe79c('0x193');_0x424f26['starttime']=moment()[_0xe79c('0x75')]('YYYY-MM-DD\x20HH:mm:ss');_0x424f26[_0xe79c('0xa5')]=_0x424f26[_0xe79c('0xa6')];_0x5c7680[_0xe79c('0xc5')](_0x424f26)[_0xe79c('0xaf')](loggerCatch(_0xe79c('0x194')));_0x5c7680[_0xe79c('0x101')](_0x424f26)['catch'](loggerCatch(_0xe79c('0x194')))['finally'](function(){delete _0x5c7680['actions'][_0x14044f];return _0x2cdb2f(msgResponse('originate',_0xe79c('0x46'),_0xe79c('0x195')));});});});};Dialer[_0xe79c('0x1a')]['syncOriginateResponse']=function(_0x464758){var _0x36d771=this[_0xe79c('0x24')][_0x464758[_0xe79c('0x124')]];if(_0x36d771){delete this['actions'][_0x464758[_0xe79c('0x124')]];_0x36d771[_0xe79c('0x111')]=moment()[_0xe79c('0x75')](_0xe79c('0xf9'));var _0x35b627=_0x36d771[_0xe79c('0x4a')]===_0xe79c('0xb1')?this[_0xe79c('0x1f')][_0x36d771[_0xe79c('0xb2')]]:this[_0xe79c('0x1e')][_0x36d771[_0xe79c('0x196')]()];if(!this[_0xe79c('0xd3')](_0x464758['response'])){this[_0xe79c('0xc7')](_0x35b627);return this['callProgressDetecting'](_0x36d771,_0x35b627,_0x464758)[_0xe79c('0xaf')](loggerCatch('[callProgressDetecting]\x20'));}this[_0xe79c('0xa8')][_0x464758['uniqueid']]=_0x36d771;}};Dialer[_0xe79c('0x1a')][_0xe79c('0x197')]=function(_0x537361,_0x55a82e,_0x2135b1){var _0x534a4c=new History(_0x55a82e);if(_0x534a4c[_0xe79c('0xec')]+_0x534a4c[_0xe79c('0xed')]+_0x534a4c[_0xe79c('0xfe')]+_0x534a4c[_0xe79c('0xee')]+_0x534a4c[_0xe79c('0x117')]+_0x534a4c[_0xe79c('0xef')]+_0x534a4c[_0xe79c('0xe7')]+_0x534a4c[_0xe79c('0xf0')]>=_0x2135b1[_0xe79c('0xf1')]-0x1){return!![];}switch(_0x537361){case 0x3:if(_0x534a4c['countnoanswerretry']>=_0x2135b1[_0xe79c('0x198')]-0x1){return!![];}this[_0xe79c('0xbc')]({'active':![],'countnoanswerretry':_0x534a4c[_0xe79c('0xfe')]+=0x1,'scheduledat':moment()['add'](_0x2135b1[_0xe79c('0x199')],_0xe79c('0xf8'))[_0xe79c('0x75')](_0xe79c('0xf9')),'ContactId':_0x534a4c['ContactId'],'ListId':_0x534a4c['ListId'],'VoiceQueueId':_0x534a4c['VoiceQueueId']||undefined,'CampaignId':_0x534a4c[_0xe79c('0xd0')]||undefined})[_0xe79c('0xaf')](loggerCatch(_0xe79c('0x19a')));break;case 0x5:if(_0x534a4c['countbusyretry']>=_0x2135b1[_0xe79c('0x19b')]-0x1){return!![];}this[_0xe79c('0xbc')]({'active':![],'countbusyretry':_0x534a4c[_0xe79c('0xec')]+=0x1,'scheduledat':moment()[_0xe79c('0xf6')](_0x2135b1['dialBusyRetryFrequency'],_0xe79c('0xf8'))[_0xe79c('0x75')](_0xe79c('0xf9')),'ContactId':_0x534a4c[_0xe79c('0xcc')],'ListId':_0x534a4c[_0xe79c('0xcd')],'VoiceQueueId':_0x534a4c['VoiceQueueId']||undefined,'CampaignId':_0x534a4c['CampaignId']||undefined})['catch'](loggerCatch(_0xe79c('0x19c')));break;case 0x8:if(_0x534a4c[_0xe79c('0xed')]>=_0x2135b1[_0xe79c('0x19d')]-0x1){return!![];}this[_0xe79c('0xbc')]({'active':![],'countcongestionretry':_0x534a4c[_0xe79c('0xed')]+=0x1,'scheduledat':moment()[_0xe79c('0xf6')](_0x2135b1[_0xe79c('0x19e')],_0xe79c('0xf8'))[_0xe79c('0x75')](_0xe79c('0xf9')),'ContactId':_0x534a4c['ContactId'],'ListId':_0x534a4c[_0xe79c('0xcd')],'VoiceQueueId':_0x534a4c['VoiceQueueId']||undefined,'CampaignId':_0x534a4c[_0xe79c('0xd0')]||undefined})[_0xe79c('0xaf')](loggerCatch(_0xe79c('0x19f')));break;case 0x0:if(_0x534a4c[_0xe79c('0xee')]>=_0x2135b1[_0xe79c('0x1a0')]-0x1){return!![];}else{this[_0xe79c('0xbc')]({'active':![],'countnosuchnumberretry':_0x534a4c[_0xe79c('0xee')]+=0x1,'scheduledat':moment()['add'](_0x2135b1['dialNoSuchNumberRetryFrequency'],'minutes')['format'](_0xe79c('0xf9')),'ContactId':_0x534a4c['ContactId'],'ListId':_0x534a4c['ListId'],'VoiceQueueId':_0x534a4c[_0xe79c('0xcf')]||undefined,'CampaignId':_0x534a4c['CampaignId']||undefined})[_0xe79c('0xaf')](loggerCatch(_0xe79c('0x1a1')));}break;case 0xa:if(_0x534a4c[_0xe79c('0x117')]>=_0x2135b1[_0xe79c('0x1a2')]-0x1){return!![];}this[_0xe79c('0xbc')]({'active':![],'countdropretry':_0x534a4c[_0xe79c('0x117')]+=0x1,'scheduledat':moment()[_0xe79c('0xf6')](_0x2135b1[_0xe79c('0x119')],_0xe79c('0xf8'))[_0xe79c('0x75')](_0xe79c('0xf9')),'ContactId':_0x534a4c[_0xe79c('0xcc')],'ListId':_0x534a4c[_0xe79c('0xcd')],'VoiceQueueId':_0x534a4c[_0xe79c('0xcf')]||undefined,'CampaignId':_0x534a4c[_0xe79c('0xd0')]||undefined})[_0xe79c('0xaf')](loggerCatch(_0xe79c('0x11a')));break;case 0xb:if(_0x534a4c['countabandonedretry']>=_0x2135b1[_0xe79c('0x1a3')]-0x1){return!![];}this[_0xe79c('0xbc')]({'active':![],'countabandonedretry':_0x534a4c[_0xe79c('0xef')]+=0x1,'scheduledat':moment()[_0xe79c('0xf6')](_0x2135b1[_0xe79c('0x120')],'minutes')[_0xe79c('0x75')](_0xe79c('0xf9')),'ContactId':_0x534a4c[_0xe79c('0xcc')],'ListId':_0x534a4c['ListId'],'VoiceQueueId':_0x534a4c[_0xe79c('0xcf')]||undefined,'CampaignId':_0x534a4c[_0xe79c('0xd0')]||undefined})[_0xe79c('0xaf')](loggerCatch(_0xe79c('0x121')));break;case 0x13:if(_0x534a4c['countmachineretry']>=_0x2135b1['dialMachineMaxRetry']-0x1){return!![];}this[_0xe79c('0xbc')]({'active':![],'countmachineretry':_0x534a4c[_0xe79c('0xe7')]+=0x1,'scheduledat':moment()[_0xe79c('0xf6')](_0x2135b1['dialMachineRetryFrequency'],_0xe79c('0xf8'))[_0xe79c('0x75')](_0xe79c('0xf9')),'ContactId':_0x534a4c[_0xe79c('0xcc')],'ListId':_0x534a4c[_0xe79c('0xcd')],'VoiceQueueId':_0x534a4c[_0xe79c('0xcf')]||undefined,'CampaignId':_0x534a4c[_0xe79c('0xd0')]||undefined})[_0xe79c('0xaf')](loggerCatch(_0xe79c('0xfa')));break;case 0x14:if(_0x534a4c[_0xe79c('0xf0')]>=_0x2135b1['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0xe79c('0xbc')]({'active':![],'countagentrejectretry':_0x534a4c[_0xe79c('0xf0')]+=0x1,'scheduledat':moment()[_0xe79c('0xf6')](_0x2135b1[_0xe79c('0x1a4')],_0xe79c('0xf8'))[_0xe79c('0x75')](_0xe79c('0xf9')),'ContactId':_0x534a4c[_0xe79c('0xcc')],'ListId':_0x534a4c[_0xe79c('0xcd')],'VoiceQueueId':_0x534a4c[_0xe79c('0xcf')]||undefined,'CampaignId':_0x534a4c['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0xe79c('0x1a')][_0xe79c('0x1a5')]=function(_0x192ed8,_0x58a4db,_0x47836e){var _0x4e3d9b=this;var _0x1ce036=new History(_0x192ed8);return new BPromise(function(_0x1a1909,_0x45b5a){if(_[_0xe79c('0x3b')](_0x58a4db)&&typeof _0x58a4db!==_0xe79c('0x1a6')){return _0x45b5a(msgResponse('[callProgressDetecting]',_0xe79c('0x144'),'entity\x20is\x20undefine'));}if(_['isUndefined'](_0x47836e)&&typeof _0x47836e!==_0xe79c('0x1a6')){return _0x45b5a(msgResponse(_0xe79c('0x1a7'),'Failure',_0xe79c('0x1a8')));}switch(_0x47836e[_0xe79c('0x107')]){case'0':_0x58a4db[_0xe79c('0x60')]+=0x1;_0x1ce036[_0xe79c('0xa3')]=0x0;_0x1ce036[_0xe79c('0xa4')]='NoSuchNumber';_0x1ce036['countnosuchnumberretry']+=0x1;_0x1ce036[_0xe79c('0xe8')]+=0x1;ami[_0xe79c('0xe1')](_0xe79c('0x1a9'),ut[_0xe79c('0xea')](_0x192ed8,_0xe79c('0x1aa')));_0x4e3d9b['createHistory'](_0x1ce036)['catch'](loggerCatch(_0xe79c('0xeb')));if(_0x4e3d9b['checkRetriveMax'](0x0,_0x192ed8,_0x58a4db)){if(_0x1ce036[_0xe79c('0xee')]>=_0x58a4db[_0xe79c('0x1a0')]){_0x4e3d9b[_0xe79c('0xff')](_0x1ce036,_0x1a1909,_0x45b5a,_0xe79c('0x1ab'));}else{_0x4e3d9b[_0xe79c('0xf2')](_0x1ce036,_0x1a1909,_0x45b5a,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x58a4db['outboundNoAnswerCallsDay']+=0x1;_0x1ce036[_0xe79c('0xa3')]=0x3;_0x1ce036[_0xe79c('0xa4')]=_0xe79c('0x1ac');_0x1ce036['countnoanswerretry']+=0x1;_0x1ce036['countglobal']+=0x1;ami[_0xe79c('0xe1')](_0xe79c('0x1ad'),ut[_0xe79c('0xea')](_0x192ed8,'noanswer'));_0x4e3d9b[_0xe79c('0xc5')](_0x1ce036)['catch'](loggerCatch(_0xe79c('0x1ae')));if(_0x4e3d9b[_0xe79c('0x197')](0x3,_0x192ed8,_0x58a4db)){if(_0x1ce036['countnoanswerretry']>=_0x58a4db[_0xe79c('0x198')]){_0x4e3d9b[_0xe79c('0xff')](_0x1ce036,_0x1a1909,_0x45b5a,_0xe79c('0x1af'));}else{_0x4e3d9b[_0xe79c('0xf2')](_0x1ce036,_0x1a1909,_0x45b5a,_0xe79c('0x1af'));}}break;case'5':_0x58a4db[_0xe79c('0x5c')]+=0x1;_0x1ce036[_0xe79c('0xa3')]=0x5;_0x1ce036[_0xe79c('0xa4')]=_0xe79c('0x1b0');_0x1ce036[_0xe79c('0xec')]+=0x1;_0x1ce036[_0xe79c('0xe8')]+=0x1;ami['emit'](_0xe79c('0x1b1'),ut[_0xe79c('0xea')](_0x192ed8,_0xe79c('0x1b2')));_0x4e3d9b[_0xe79c('0xc5')](_0x1ce036)['catch'](loggerCatch(_0xe79c('0x1b3')));if(_0x4e3d9b['checkRetriveMax'](0x5,_0x192ed8,_0x58a4db)){if(_0x1ce036[_0xe79c('0xec')]>=_0x58a4db[_0xe79c('0x19b')]){_0x4e3d9b[_0xe79c('0xff')](_0x1ce036,_0x1a1909,_0x45b5a,_0xe79c('0x1b4'));}else{_0x4e3d9b[_0xe79c('0xf2')](_0x1ce036,_0x1a1909,_0x45b5a,'reason\x205\x20busy');}}break;case'8':_0x58a4db[_0xe79c('0x5d')]+=0x1;_0x1ce036[_0xe79c('0xa3')]=0x8;_0x1ce036[_0xe79c('0xa4')]='Congestion';_0x1ce036['countcongestionretry']+=0x1;_0x1ce036[_0xe79c('0xe8')]+=0x1;ami[_0xe79c('0xe1')](_0xe79c('0x1b5'),ut['buildObj'](_0x192ed8,_0xe79c('0x1b6')));_0x4e3d9b['createHistory'](_0x1ce036)['catch'](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x4e3d9b['checkRetriveMax'](0x8,_0x192ed8,_0x58a4db)){if(_0x1ce036[_0xe79c('0xed')]>=_0x58a4db[_0xe79c('0x19d')]){_0x4e3d9b['createStateFinal'](_0x1ce036,_0x1a1909,_0x45b5a,_0xe79c('0x1b7'));}else{_0x4e3d9b[_0xe79c('0xf2')](_0x1ce036,_0x1a1909,_0x45b5a,_0xe79c('0x1b7'));}}break;case'11':_0x58a4db[_0xe79c('0x1b8')]+=0x1;_0x1ce036[_0xe79c('0xa3')]=0xb;_0x1ce036['statedesc']=_0xe79c('0x122');_0x1ce036[_0xe79c('0xef')]+=0x1;_0x1ce036[_0xe79c('0xe8')]+=0x1;_0x4e3d9b[_0xe79c('0xc5')](_0x1ce036)[_0xe79c('0xaf')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x4e3d9b[_0xe79c('0x197')](0xb,_0x192ed8,_0x58a4db)){if(_0x1ce036[_0xe79c('0xef')]>=_0x58a4db[_0xe79c('0x1a3')]){_0x4e3d9b[_0xe79c('0xff')](_0x1ce036,_0x1a1909,_0x45b5a,_0xe79c('0x1b9'));}else{_0x4e3d9b['stateGlobal'](_0x1ce036,_0x1a1909,_0x45b5a,'reason\x2011\x20abandoned');}}break;case'20':_0x58a4db['outboundRejectCallsDay']+=0x1;_0x1ce036[_0xe79c('0xa3')]=0x14;_0x1ce036[_0xe79c('0xa4')]=_0xe79c('0x1ba');_0x1ce036['countagentrejectretry']+=0x1;_0x1ce036[_0xe79c('0xe8')]+=0x1;ami[_0xe79c('0xe1')]('custom:agentreject',ut['buildObj'](_0x192ed8,_0xe79c('0x1bb')));_0x4e3d9b['createHistory'](_0x1ce036)[_0xe79c('0xaf')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x4e3d9b[_0xe79c('0x197')](0x14,_0x192ed8,_0x58a4db)){if(_0x1ce036['countagentrejectretry']>=_0x58a4db[_0xe79c('0x1bc')]){_0x4e3d9b[_0xe79c('0xff')](_0x1ce036,_0x1a1909,_0x45b5a,_0xe79c('0x1bd'));}else{_0x4e3d9b[_0xe79c('0xf2')](_0x1ce036,_0x1a1909,_0x45b5a,_0xe79c('0x1bd'));}}break;default:_0x58a4db['outboundUnknownCallsDay']+=0x1;_0x1ce036['state']=0xc;_0x1ce036['statedesc']=_0x47836e[_0xe79c('0x107')];_0x4e3d9b[_0xe79c('0xc5')](_0x1ce036)[_0xe79c('0xaf')](loggerCatch(_0xe79c('0x1be')));if(_0x4e3d9b[_0xe79c('0x197')](_0x47836e[_0xe79c('0x107')],_0x192ed8,_0x58a4db)){if(_0x1ce036[_0xe79c('0xec')]+_0x1ce036[_0xe79c('0xed')]+_0x1ce036[_0xe79c('0xfe')]+_0x1ce036['countnosuchnumberretry']+_0x1ce036[_0xe79c('0x117')]+_0x1ce036[_0xe79c('0xef')]+_0x1ce036[_0xe79c('0xe7')]+_0x1ce036['countagentrejectretry']>=_0x58a4db['dialGlobalMaxRetry']){_0x4e3d9b[_0xe79c('0xf2')](_0x1ce036,_0x1a1909,_0x45b5a,_0x47836e[_0xe79c('0x107')]);}else{_0x4e3d9b[_0xe79c('0xff')](_0x1ce036,_0x1a1909,_0x45b5a,_0x47836e[_0xe79c('0x107')]);}}}});};Dialer[_0xe79c('0x1a')][_0xe79c('0xf2')]=function(_0x2d72e9,_0xc27f2a,_0x1fdd20,_0xa38b81){var _0xc53eae=new Final(_0x2d72e9);_0xc53eae['state']=0xf;_0xc53eae[_0xe79c('0xa4')]=_0xe79c('0x1bf');this[_0xe79c('0xff')](_0xc53eae,_0xc27f2a,_0x1fdd20,_0xa38b81);};Dialer[_0xe79c('0x1a')]['createStateFinal']=function(_0x428e9a,_0x41dbc0,_0x1631cc,_0x559992){this[_0xe79c('0x101')](_0x428e9a)['then'](function(){return _0x41dbc0(msgResponse(_0xe79c('0x1a7'),_0xe79c('0xd4'),_0x559992));})[_0xe79c('0xaf')](function(){return _0x1631cc(msgResponse(_0xe79c('0x1c0'),_0xe79c('0x144'),_0xe79c('0x1c1')));});};Dialer[_0xe79c('0x1a')]['predictive']=function(_0x5a0392){var _0x2313f0=_0x5a0392[_0xe79c('0x1c2')]/0x64;var _0x3bd274=_0x5a0392[_0xe79c('0x113')]/(_0x5a0392[_0xe79c('0x113')]+_0x5a0392[_0xe79c('0x5a')]);var _0x25ba7d=Math[_0xe79c('0x1c3')](_0x5a0392[_0xe79c('0x6a')]*(_0x5a0392[_0xe79c('0x1c4')]/0x64));var _0x3c9394=Math[_0xe79c('0x1c3')](_0x5a0392[_0xe79c('0x6a')]*(_0x5a0392['predictiveIntervalMinThreshold']/0x64));var _0x483bee=_0x5a0392['available']+_0x5a0392[_0xe79c('0x9d')];var _0x3627a4=Math[_0xe79c('0x1c5')](_0x5a0392[_0xe79c('0x86')]*_0x5a0392['erlangAbandonmentRate']*_0x5a0392[_0xe79c('0x68')]*_0x5a0392[_0xe79c('0x1c6')]);if(_[_0xe79c('0x3b')](_0x5a0392['startProgressive'])){if(!_[_0xe79c('0x3b')](_0x5a0392[_0xe79c('0x70')])){_0x5a0392[_0xe79c('0x70')]=undefined;loggerPredictive['error'](_0xe79c('0x1c7'),_0xe79c('0x1c8'));}if(!_['isUndefined'](_0x5a0392[_0xe79c('0x8b')])){loggerPredictive[_0xe79c('0x91')](_0xe79c('0x1c7'),_0xe79c('0x1c9'));clearInterval(_0x5a0392[_0xe79c('0x8b')]);_0x5a0392[_0xe79c('0x8b')]=undefined;}_0x5a0392[_0xe79c('0x26')]=moment()[_0xe79c('0x75')](_0xe79c('0xf9'));loggerPredictive['info'](_0x5a0392['name'],_0xe79c('0x1ca'),_0x5a0392[_0xe79c('0x26')]);this[_0xe79c('0x159')](_0x5a0392,0x1);}else if(ifInterval(_0x5a0392['dialPredictiveInterval'],_0x5a0392[_0xe79c('0x26')])){this[_0xe79c('0x159')](_0x5a0392,0x1);loggerPredictiveCalls[_0xe79c('0x79')](_0xe79c('0x1cb'),_0x5a0392['startProgressive'],_0x5a0392[_0xe79c('0x3f')]);_0x5a0392[_0xe79c('0x86')]=0x0;_0x5a0392[_0xe79c('0x114')]=0x0;}else if(_0x2313f0<_0x3bd274&&_0x5a0392[_0xe79c('0x1cc')]===_0xe79c('0x1cd')){freeVariablesPredictive(_0x5a0392);loggerPredictive[_0xe79c('0x79')](_0xe79c('0x1ce'),'Dropped\x20calls\x20day',_0x3bd274,_0xe79c('0x26'),_0x5a0392[_0xe79c('0x3f')]);}else if(_0x3627a4<_0x5a0392[_0xe79c('0x114')]&&_0x5a0392[_0xe79c('0x1cc')]===_0xe79c('0x1cd')){freeVariablesPredictive(_0x5a0392);loggerPredictive['info'](_0xe79c('0x1cf'),'Max\x20Drop\x20',_0x3627a4,_0xe79c('0x1d0'),_0x5a0392[_0xe79c('0x114')],'startProgressive',_0x5a0392[_0xe79c('0x3f')]);}else if(!ifInterval(_0x5a0392[_0xe79c('0x1d1')],_0x5a0392[_0xe79c('0x26')])&&_[_0xe79c('0x3b')](_0x5a0392['startPredictive'])&&!_[_0xe79c('0x3b')](_0x5a0392['startProgressive'])){_0x5a0392[_0xe79c('0x70')]=moment()[_0xe79c('0x75')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x5a0392[_0xe79c('0x3f')],_0xe79c('0x1d2'),_0x5a0392['startPredictive']);this[_0xe79c('0xb9')](_0x5a0392[_0xe79c('0x1d1')])['then'](this[_0xe79c('0x1d3')](_0x5a0392))['then'](mergeDataErlangB(_0x5a0392))[_0xe79c('0xb5')](this[_0xe79c('0x1d4')](_0x5a0392))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x5a0392));}else if(!ifInterval(_0x5a0392[_0xe79c('0x1d1')],_0x5a0392[_0xe79c('0x70')])){_0x5a0392[_0xe79c('0x114')]=0x0;_0x5a0392[_0xe79c('0x70')]=moment()['format'](_0xe79c('0xf9'));loggerPredictive['info'](_0x5a0392[_0xe79c('0x3f')],'recalculate\x20predictive\x20at',_0x5a0392[_0xe79c('0x70')]);clearInterval(_0x5a0392[_0xe79c('0x8b')]);_0x5a0392['handlePredictive']=undefined;this[_0xe79c('0xb9')](_0x5a0392['dialPredictiveInterval'])['then'](this[_0xe79c('0x1d3')](_0x5a0392))['then'](mergeDataErlangB(_0x5a0392))[_0xe79c('0xb5')](this[_0xe79c('0x1d4')](_0x5a0392))[_0xe79c('0xaf')](loggerCatchPredictive(_0xe79c('0x1d5'),_0x5a0392));}else if(_0x5a0392[_0xe79c('0x6a')]&&_0x483bee<_0x5a0392[_0xe79c('0x6a')]-_0x3c9394){freeVariablesPredictive(_0x5a0392);loggerPredictive[_0xe79c('0x79')](_0x5a0392[_0xe79c('0x3f')],_0xe79c('0x1d6'),_0x483bee,_0xe79c('0x1d7'),_0x5a0392['predictiveIntervalAvailable'],'-',_0x3c9394,'=',_0x5a0392[_0xe79c('0x6a')]-_0x3c9394,')');}else if(_0x5a0392[_0xe79c('0x6a')]&&_0x483bee>_0x5a0392['predictiveIntervalAvailable']+_0x25ba7d){freeVariablesPredictive(_0x5a0392);loggerPredictive[_0xe79c('0x79')](_0x5a0392[_0xe79c('0x3f')],_0xe79c('0x1d6'),_0x483bee,_0xe79c('0x1d8'),_0x5a0392[_0xe79c('0x6a')],'+',_0x25ba7d,'=',_0x5a0392[_0xe79c('0x6a')]+_0x25ba7d,')');}};Dialer[_0xe79c('0x1a')][_0xe79c('0x1d3')]=function(_0x45e23e){var _0x329dcb=this;return function(_0x2cc90b){return new BPromise(function(_0x543bbb,_0x5f0b94){_[_0xe79c('0x89')](_0x45e23e,_0x2cc90b[0x0]);if(checkGetDataPredictive(_0x2cc90b[0x0])){var _0x3ccb71=_0x45e23e['predictiveIntervalAvailable']=_0x45e23e['talking']+_0x45e23e[_0xe79c('0x4d')];var _0x4ec2b1=_0x45e23e[_0xe79c('0x1d1')]*0x3c;var _0x53fdf3=_0x2cc90b[0x0]['predictiveIntervalAvgTalktime']+_0x2cc90b[0x0][_0xe79c('0x65')];var _0xc8ae62=(_0x2cc90b[0x0][_0xe79c('0x64')]+_0x2cc90b[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2cc90b[0x0][_0xe79c('0x7d')])/_0x2cc90b[0x0][_0xe79c('0x6b')];_0x45e23e[_0xe79c('0x68')]=_0xc8ae62>0x0?_0xc8ae62:0x1;switch(_0x45e23e['dialPredictiveOptimization']){case _0xe79c('0x1cd'):var _0x3e9255=_0x45e23e['dialPredictiveOptimizationPercentage']/0x64;return _0x329dcb[_0xe79c('0x1d9')](_0x3ccb71,_0x4ec2b1,_0x53fdf3,_0xc8ae62,_0x3e9255)[_0xe79c('0xb5')](function(_0x3956a8){return _0x543bbb(_0x3956a8);});case'agentBusyFactor':var _0x57259d=_0x45e23e[_0xe79c('0x1c2')]/0x64;return _0x329dcb[_0xe79c('0x1da')](_0x3ccb71,_0x4ec2b1,_0x53fdf3,_0xc8ae62,_0x57259d)[_0xe79c('0xb5')](function(_0x1b3a0d){return _0x543bbb(_0x1b3a0d);});default:return _0x5f0b94(msgResponse('[getDataPredictive]',_0xe79c('0x144'),_0xe79c('0x1db')));}}else{return _0x5f0b94(msgResponse('[getDataPredictive]','Failure',_0xe79c('0x1dc')));}});};};Dialer['prototype'][_0xe79c('0x1dd')]=function(_0xb5e70d){var _0x8b0800=this;return function(_0x59b1cc){return new BPromise(function(_0x3fa9b2,_0x1439c1){_[_0xe79c('0x89')](_0xb5e70d,_0x59b1cc[0x0]);if(checkGetDataPredictive(_0x59b1cc[0x0])){loggerPredictive[_0xe79c('0x79')](JSON[_0xe79c('0x12f')](_0x59b1cc[0x0]));if(_0xb5e70d[_0xe79c('0x1cc')]==='dropRate'){return _0x8b0800[_0xe79c('0xc4')](_0xb5e70d['id'])[_0xe79c('0xb5')](function(_0x35bf0f){var _0x1be259=_0xb5e70d[_0xe79c('0x4e')]-_0x35bf0f[0x0]['outboundQueuePauses'];var _0x301d7b=_0xb5e70d['dialPredictiveInterval']*0x3c;var _0x2f78f7=_0x59b1cc[0x0][_0xe79c('0x66')]+_0x59b1cc[0x0]['predictiveIntervalAvgHoldtime'];var _0x3710dc=(_0x59b1cc[0x0][_0xe79c('0x64')]+_0x59b1cc[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x59b1cc[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x59b1cc[0x0][_0xe79c('0x6b')];var _0x6d2729=_0xb5e70d[_0xe79c('0x1c2')]/0x64;_0xb5e70d[_0xe79c('0x69')]=_0x35bf0f[0x0]['outboundQueuePauses']||0x0;_0xb5e70d[_0xe79c('0x68')]=_0x3710dc>0x0?_0x3710dc:0x1;return _0x8b0800[_0xe79c('0x1d9')](_0x1be259,_0x301d7b,_0x2f78f7,_0x3710dc,_0x6d2729);})['then'](function(_0xfc31f3){return _0x3fa9b2(_0xfc31f3);})['catch'](function(_0x44c5a4){return _0x1439c1(msgResponse('[CatchErlangB]',_0xe79c('0x144'),JSON['stringify'](_0x44c5a4)));});}if(_0xb5e70d[_0xe79c('0x1cc')]==='agentBusyFactor'){return _0x8b0800['getVoiceQueueRtPauses'](_0xb5e70d['id'])['then'](function(_0x56736f){var _0x4828ee=_0xb5e70d['loggedIn']-_0x56736f[0x0][_0xe79c('0x1de')];var _0x21220c=_0xb5e70d[_0xe79c('0x1d1')]*0x3c;var _0x586f9d=_0x59b1cc[0x0][_0xe79c('0x66')]+_0x59b1cc[0x0][_0xe79c('0x65')];var _0x240a4c=(_0x59b1cc[0x0][_0xe79c('0x64')]+_0x59b1cc[0x0][_0xe79c('0x67')]+_0x59b1cc[0x0][_0xe79c('0x7d')])/_0x59b1cc[0x0][_0xe79c('0x6b')];var _0x5920c9=_0xb5e70d[_0xe79c('0x1c2')]/0x64;_0xb5e70d[_0xe79c('0x69')]=_0x56736f[0x0]['outboundQueuePauses']||0x0;_0xb5e70d[_0xe79c('0x68')]=_0x240a4c>0x0?_0x240a4c:0x1;return _0x8b0800[_0xe79c('0x1da')](_0x4828ee,_0x21220c,_0x586f9d,_0x240a4c,_0x5920c9);})[_0xe79c('0xb5')](function(_0x2cca9c){return _0x3fa9b2(_0x2cca9c);})['catch'](function(_0x22f8da){return _0x1439c1(msgResponse(_0xe79c('0x1df'),_0xe79c('0x144'),JSON[_0xe79c('0x12f')](_0x22f8da)));});}}else{return _0x1439c1(msgResponse(_0xe79c('0x1e0'),'Failure','check\x20failure'));}});};};Dialer[_0xe79c('0x1a')][_0xe79c('0x1d4')]=function(_0x54adca){var _0x3a25b6=this;return function(){var _0x5a4c0d=0x0;var _0x35e341=Math[_0xe79c('0x1c5')](_0x54adca[_0xe79c('0x6d')]*0x3e8);if(_0x35e341>0x0){_0x35e341=_0x35e341<0x64?0x64:_0x35e341;loggerPredictive['info'](_0x54adca[_0xe79c('0x3f')],_0xe79c('0x1e1'),_0x35e341,_0xe79c('0x47'));_0x54adca[_0xe79c('0x8b')]=setInterval(function(){_0x3a25b6[_0xe79c('0x8b')](_0x54adca);loggerPredictiveCalls[_0xe79c('0x79')](_0xe79c('0x1e2'),_0x5a4c0d+=0x1);},_0x35e341);}else{loggerPredictive['info'](_0x54adca['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xe79c('0x1a')][_0xe79c('0x1e3')]=function(_0x414849,_0x696b78){var _0x68187f=this;return function(_0x39abdd){if(_[_0xe79c('0x78')](_0x39abdd)){if(_[_0xe79c('0xab')](_0x696b78['UserId'])||!_0x696b78[_0xe79c('0x1e4')]){if(_0x414849[_0xe79c('0x55')]===_0xe79c('0x15b')){_0x414849[_0xe79c('0x12c')]=_[_0xe79c('0x3b')](_0x414849[_0xe79c('0x12c')])?!![]:_0x414849[_0xe79c('0x12c')];var _0x1bfbd3=uuid['v4']();_0x68187f[_0xe79c('0x24')][_0x1bfbd3]=new Action(_0x414849,_0x696b78,_0x1bfbd3);loggerBooked[_0xe79c('0x79')]('[booked][checkContactBlack]',_0x1bfbd3,_0xe79c('0x1e5'),JSON[_0xe79c('0x12f')](_0x414849[_0xe79c('0x12c')]),_0xe79c('0x1e6'),_0x414849['name']);if(_0x414849[_0xe79c('0x12c')]){_0x414849[_0xe79c('0x12c')]=![];_0x68187f[_0xe79c('0x28')][_0x68187f[_0xe79c('0x24')][_0x1bfbd3][_0xe79c('0xb2')]]=[];ami[_0xe79c('0xac')]({'actionid':_0x1bfbd3,'action':_0xe79c('0x1e7'),'queue':_0x414849['name']})['catch'](function(){_0x68187f[_0xe79c('0xc7')](_0x414849);_0x68187f[_0xe79c('0xbc')]({'active':![],'ContactId':_0x68187f[_0xe79c('0x24')][_0x1bfbd3]['ContactId'],'ListId':_0x68187f['actions'][_0x1bfbd3][_0xe79c('0xcd')],'VoiceQueueId':_0x68187f[_0xe79c('0x24')][_0x1bfbd3]['VoiceQueueId']||undefined,'CampaignId':_0x68187f[_0xe79c('0x24')][_0x1bfbd3][_0xe79c('0xd0')]||undefined})[_0xe79c('0xaf')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x68187f[_0xe79c('0x24')][_0x1bfbd3];});}else{loggerBooked[_0xe79c('0x79')](_0xe79c('0x1e8'),JSON[_0xe79c('0x12f')](_0x414849['queueStatusComplete']),_0xe79c('0x1e6'),_0x414849[_0xe79c('0x3f')]);_0x68187f[_0xe79c('0xc7')](_0x414849);_0x68187f[_0xe79c('0xbc')]({'active':![],'ContactId':_0x68187f[_0xe79c('0x24')][_0x1bfbd3]['ContactId'],'ListId':_0x68187f[_0xe79c('0x24')][_0x1bfbd3][_0xe79c('0xcd')],'VoiceQueueId':_0x68187f[_0xe79c('0x24')][_0x1bfbd3][_0xe79c('0xcf')]||undefined,'CampaignId':_0x68187f[_0xe79c('0x24')][_0x1bfbd3][_0xe79c('0xd0')]||undefined})[_0xe79c('0xaf')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x68187f['actions'][_0x1bfbd3];}}else{return _0x68187f[_0xe79c('0x168')](_0x414849,_0x696b78);}}else{if(getDiff(_0x696b78[_0xe79c('0x1e9')])<_0x414849[_0xe79c('0x1ea')]*0x3c){if(_0x696b78[_0xe79c('0x1eb')]&&!_0x696b78[_0xe79c('0x1eb')][_0xe79c('0x1ec')]){_0x68187f[_0xe79c('0x8d')][_0xe79c('0x1ed')](_0x696b78['id'])[_0xe79c('0x131')](function(){_0x68187f['updateOriginated'](_0x414849);});}else{_0x68187f[_0xe79c('0xbe')]({'active':![]},_0x696b78['id'],0x1)[_0xe79c('0x131')](function(){_0x68187f[_0xe79c('0xc7')](_0x414849);});}}else{_0x414849[_0xe79c('0x62')]+=0x1;_0x68187f[_0xe79c('0xc7')](_0x414849);if(_0x414849[_0xe79c('0x1ee')]){_0x68187f[_0xe79c('0xbc')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x696b78[_0xe79c('0xcc')],'ListId':_0x696b78[_0xe79c('0xcd')],'VoiceQueueId':_0x696b78[_0xe79c('0xcf')]||undefined,'CampaignId':_0x696b78['CampaignId']||undefined})[_0xe79c('0xaf')](loggerCatch(_0xe79c('0x1ef')));_0x68187f[_0xe79c('0xc5')](createObjHistory(_0x414849,_0x696b78,'RECALLINQUEUE',0x17,_0xe79c('0x1f0')))[_0xe79c('0xaf')](loggerCatch(_0xe79c('0x1f1')));}else{_0x68187f[_0xe79c('0xca')](createObjHistory(_0x414849,_0x696b78,_0xe79c('0x1f2'),0x16,_0xe79c('0x1f3')),'[Originate][HistoryRecallClose][historyCatch]',_0xe79c('0x1f4'));}}}}else{_0x414849[_0xe79c('0x5b')]+=0x1;_0x68187f[_0xe79c('0xca')](createObjHistory(_0x414849,_0x696b78,_0xe79c('0x1f5'),0xd,_0xe79c('0x1f6')),_0xe79c('0x1f7'),_0xe79c('0x1f8'));throw _0xe79c('0x1f9');}};};Dialer[_0xe79c('0x1a')][_0xe79c('0x15f')]=function(_0x1e6fdf){var _0x2b45f2=this;var _0x4be438=_0x1e6fdf[_0xe79c('0x1fa')]-_0x1e6fdf['originated']-_0x1e6fdf['temp'];emitCampaignSummary(_0x1e6fdf);if(_0x4be438>0x0){if(_0x4be438>this[_0xe79c('0x22')]){_0x4be438=this[_0xe79c('0x22')];}_0x1e6fdf['temp']+=_0x4be438;this[_0xe79c('0xc3')](_0x1e6fdf['id'],_0x4be438,_0x1e6fdf[_0xe79c('0x1fb')],_0x1e6fdf)[_0xe79c('0xb5')](function(_0xac2278){_0x1e6fdf['temp']-=_0x4be438;_0x1e6fdf[_0xe79c('0xc1')]=_0x1e6fdf[_0xe79c('0xc1')]>0x0?_0x1e6fdf[_0xe79c('0xc1')]:0x0;if(!checkContactEmpty(_0xac2278)){_0x1e6fdf['message']=_0xe79c('0x1fc');logger['info'](_0xe79c('0x1fd')+_0x1e6fdf[_0xe79c('0x3f')]);}else{_0x1e6fdf[_0xe79c('0x6c')]+=_0xac2278[_0xe79c('0x94')];_0x1e6fdf[_0xe79c('0x3e')]=_0xe79c('0x1fe');for(var _0x50f3ae=0x0;_0x50f3ae<_0xac2278[_0xe79c('0x94')];_0x50f3ae+=0x1){_0x1e6fdf[_0xe79c('0x1ff')]+=0x1;if(_['isNil'](_0xac2278[_0x50f3ae])||_['isNil'](_0xac2278[_0x50f3ae][_0xe79c('0x16b')])||_[_0xe79c('0xab')](_0xac2278[_0x50f3ae][_0xe79c('0x16b')][_0xe79c('0x16c')])){_0x2b45f2[_0xe79c('0x200')]('[actionOriginate]\x20',_0x1e6fdf,_0xac2278[_0x50f3ae]);}else{_0x2b45f2[_0xe79c('0xb8')](_[_0xe79c('0xcb')](_0xac2278[_0x50f3ae],[_0xe79c('0xd0'),_0xe79c('0x201')]))[_0xe79c('0xb5')](_0x2b45f2['checkContactBlack'](_0x1e6fdf,_0xac2278[_0x50f3ae]))['catch'](_0x2b45f2[_0xe79c('0x202')]('[actionOriginateIvr]\x20',_0x1e6fdf));}}}})[_0xe79c('0xaf')](loggerGetContactDialer('[getContactCampaign2]',_0x1e6fdf,_0x4be438));}};Dialer[_0xe79c('0x1a')][_0xe79c('0x159')]=function(_0x414b41,_0x342fcc){var _0x4703ea=this;var _0x43c6b1=[];var _0x228680=_0x342fcc>=0x1?_0x342fcc:0x1;if(_0x414b41['dialMethod']==='booked'){_0x228680=0x1;}var _0x5ad97e=Math[_0xe79c('0x1c5')](_0x414b41[_0xe79c('0x4d')]*_0x228680)-_0x414b41[_0xe79c('0x6c')]-_0x414b41[_0xe79c('0xc1')];emitVoiceQueueSummary(_0x414b41);if(_0x414b41['dialLimitQueue']>0x0){var _0x1462cb=_0x414b41[_0xe79c('0x203')]-_0x414b41[_0xe79c('0x6c')]-_0x414b41['talking']-_0x414b41[_0xe79c('0xc1')]-_0x414b41[_0xe79c('0x4f')];if(_0x5ad97e>_0x1462cb){_0x5ad97e=_0x1462cb;}}if(_0x5ad97e>0x0){if(_0x414b41[_0xe79c('0x55')]===_0xe79c('0x15b')){_0x5ad97e=0x1;}if(_0x5ad97e>this[_0xe79c('0x22')]){_0x5ad97e=this['maxNumberOriginate'];}_0x414b41[_0xe79c('0xc1')]+=_0x5ad97e;for(var _0x134e27 in this['agents']){if(typeof this[_0xe79c('0x20')][_0x134e27]!==_0xe79c('0x95')){if(this['agents'][_0x134e27][_0xe79c('0xa3')]===_0xe79c('0x204')&&this[_0xe79c('0x20')][_0x134e27][_0xe79c('0xad')]===_0xe79c('0x205')){_0x43c6b1[_0xe79c('0x12a')](this['agents'][_0x134e27]['id']);}}}this[_0xe79c('0xc0')](_0x414b41['id'],_0x43c6b1,_0x5ad97e,_0x414b41[_0xe79c('0x1fb')],_0x414b41)['then'](function(_0x2e5242){_0x414b41['temp']-=_0x5ad97e;_0x414b41['temp']=_0x414b41[_0xe79c('0xc1')]>0x0?_0x414b41[_0xe79c('0xc1')]:0x0;if(!checkContactEmpty(_0x2e5242)){_0x4703ea[_0xe79c('0xb3')](_0x414b41)[_0xe79c('0xb5')](sendMessageReschedule(_0x414b41))[_0xe79c('0xaf')](loggerCatch(_0xe79c('0x206')));}else{_0x414b41[_0xe79c('0x6c')]+=_0x2e5242[_0xe79c('0x94')];_0x414b41[_0xe79c('0x3e')]=_0x414b41['dialMethod']===_0xe79c('0x15b')?_0xe79c('0x207'):_0xe79c('0x1fe');for(var _0x1e1020=0x0;_0x1e1020<_0x2e5242[_0xe79c('0x94')];_0x1e1020+=0x1){if(_['isNil'](_0x2e5242[_0x1e1020])||_[_0xe79c('0xab')](_0x2e5242[_0x1e1020]['Contact'])||_[_0xe79c('0xab')](_0x2e5242[_0x1e1020][_0xe79c('0x16b')][_0xe79c('0x16c')])){_0x4703ea[_0xe79c('0x200')]('[actionOriginate]\x20',_0x414b41,_0x2e5242[_0x1e1020]);}else{_0x4703ea[_0xe79c('0xb6')](_[_0xe79c('0xcb')](_0x2e5242[_0x1e1020],['VoiceQueueId','Contact.phone']))[_0xe79c('0xb5')](_0x4703ea[_0xe79c('0x1e3')](_0x414b41,_0x2e5242[_0x1e1020]))[_0xe79c('0xaf')](_0x4703ea['loggerHandler'](_0xe79c('0x208'),_0x414b41));}}}})[_0xe79c('0xaf')](loggerGetContactDialer(_0xe79c('0x209'),_0x414b41,_0x5ad97e));}};Dialer[_0xe79c('0x1a')][_0xe79c('0x8b')]=function(_0x4a2c15){if(_0x4a2c15[_0xe79c('0x203')]>0x0){var _0x206bd3=_0x4a2c15['dialLimitQueue']-_0x4a2c15[_0xe79c('0x6c')]-_0x4a2c15[_0xe79c('0x9d')];if(_0x206bd3>0x0){this[_0xe79c('0x20a')](_0x4a2c15);}else{loggerPredictiveCalls[_0xe79c('0x79')](_0xe79c('0x20b'));}}else{this['tryOriginatePredictive'](_0x4a2c15);}};Dialer[_0xe79c('0x1a')][_0xe79c('0x20a')]=function(_0x1d1e88){var _0x496463=this;var _0x5815e7=[];_0x1d1e88[_0xe79c('0x6c')]+=0x1;for(var _0x5e956b in this['agents']){if(typeof this[_0xe79c('0x20')][_0x5e956b]!==_0xe79c('0x95')){if(this[_0xe79c('0x20')][_0x5e956b][_0xe79c('0xa3')]===_0xe79c('0x204')&&this['agents'][_0x5e956b][_0xe79c('0xad')]===_0xe79c('0x205')){_0x5815e7['push'](this['agents'][_0x5e956b]['id']);}}}this['getContactDialer'](_0x1d1e88['id'],_0x5815e7,0x1,_0x1d1e88['dialOrderByScheduledAt'],_0x1d1e88)[_0xe79c('0xb5')](function(_0x4252c6){if(!checkContactEmpty(_0x4252c6)){checkContactLowerLimitOriginate(_0x1d1e88,0x1,0x0);_0x496463['countReScheduled'](_0x1d1e88)[_0xe79c('0xb5')](sendMessageReschedule(_0x1d1e88))[_0xe79c('0xaf')](loggerCatch('[countReScheduled]\x20'));}else{_0x1d1e88[_0xe79c('0x3e')]='RUNNING';if(_['isNil'](_0x4252c6[0x0])||_[_0xe79c('0xab')](_0x4252c6[0x0][_0xe79c('0x16b')])||_['isNil'](_0x4252c6[0x0][_0xe79c('0x16b')]['phone'])){_0x496463[_0xe79c('0x200')]('[actionOriginate]\x20',_0x1d1e88,_0x4252c6[0x0]);}else{_0x496463[_0xe79c('0xb6')](_['pick'](_0x4252c6[0x0],[_0xe79c('0xcf'),'Contact.phone']))[_0xe79c('0xb5')](_0x496463[_0xe79c('0x1e3')](_0x1d1e88,_0x4252c6[0x0]))['catch'](_0x496463[_0xe79c('0x202')]('[actionOriginatePredictive]\x20',_0x1d1e88));}}})[_0xe79c('0xaf')](loggerGetContactDialer('[getContactDialerPredictive]',_0x1d1e88,0x1));emitVoiceQueueSummary(_0x1d1e88);};Dialer[_0xe79c('0x1a')][_0xe79c('0x1d9')]=function(_0x5dd872,_0x5cf3c1,_0x3e0796,_0x1e8cfa,_0xfa5efc,_0xe65962){loggerPredictive['info']('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xe79c('0x79')](_0xe79c('0x20c'),_0x5dd872);loggerPredictive[_0xe79c('0x79')](_0xe79c('0x20d'),_0x5cf3c1);loggerPredictive[_0xe79c('0x79')]('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',_0x3e0796);loggerPredictive[_0xe79c('0x79')](_0xe79c('0x20e'),_0x1e8cfa);loggerPredictive[_0xe79c('0x79')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xfa5efc);loggerPredictive[_0xe79c('0x79')](_0xe79c('0x88'));return new BPromise(function(_0x26f106,_0x5ab870){if(_0x5dd872<=0x0||isNaN(_0x5dd872)){return _0x5ab870(msgResponse(_0xe79c('0x20f'),'Error','m\x20=\x20'+_0x5dd872));}if(_0x3e0796<=0x0||isNaN(_0x3e0796)){return _0x5ab870(msgResponse(_0xe79c('0x20f'),_0xe79c('0x46'),'Ts\x20=\x20'+_0x3e0796));}if(_0x1e8cfa<=0x0||isNaN(_0x1e8cfa)){return _0x5ab870(msgResponse(_0xe79c('0x20f'),_0xe79c('0x46'),'p\x20=\x20'+_0x1e8cfa));}if(_0x5cf3c1<=0x0||isNaN(_0x5cf3c1)){return _0x5ab870(msgResponse('[abandonmentRate]',_0xe79c('0x46'),_0xe79c('0x210')+_0x5cf3c1));}if(_0xfa5efc<=0x0||isNaN(_0xfa5efc)){return _0x5ab870(msgResponse(_0xe79c('0x20f'),'Error',_0xe79c('0x211')+_0xfa5efc));}_0xe65962=_0xe65962||0x0;var _0x3d351c=0x1/_0x3e0796;var _0x239fd8=0x0;var _0x267fbf=0x0;var _0x2d7548=0x0;var _0x49b4be=0x0;for(var _0x1a44bd=0x0;_0x2d7548<_0xfa5efc;_0x1a44bd+=0x1){_0x267fbf=_0x1a44bd/_0x5cf3c1;_0x239fd8=(_0x1e8cfa*_0x267fbf+_0xe65962)/_0x3d351c;_0x2d7548=erlangb(_0x239fd8,_0x5dd872);_0x49b4be=_0x239fd8/_0x5dd872*(0x1-erlangb(_0x239fd8,_0x5dd872));}return _0x26f106({'erlangCalls':_0x1a44bd,'erlangCallToSecond':_0x5cf3c1/_0x1a44bd,'erlangAbandonmentRate':_0x2d7548,'erlangBusyFactor':_0x49b4be});});};Dialer[_0xe79c('0x1a')][_0xe79c('0x1da')]=function(_0x5cc68d,_0x49a861,_0x3f0d43,_0x459350,_0x5ee60b,_0x5162bb){loggerPredictive[_0xe79c('0x79')](_0xe79c('0x212'));loggerPredictive[_0xe79c('0x79')](_0xe79c('0x20c'),_0x5cc68d);loggerPredictive[_0xe79c('0x79')](_0xe79c('0x20d'),_0x49a861);loggerPredictive[_0xe79c('0x79')](_0xe79c('0x213'),_0x3f0d43);loggerPredictive[_0xe79c('0x79')]('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',_0x459350);loggerPredictive[_0xe79c('0x79')](_0xe79c('0x214'),_0x5ee60b);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x3347c8,_0x19e6b9){if(_0x5cc68d<=0x0||isNaN(_0x5cc68d)){return _0x19e6b9(msgResponse(_0xe79c('0x215'),_0xe79c('0x46'),'m\x20=\x20'+_0x5cc68d));}if(_0x3f0d43<=0x0||isNaN(_0x3f0d43)){return _0x19e6b9(msgResponse(_0xe79c('0x215'),_0xe79c('0x46'),_0xe79c('0x216')+_0x3f0d43));}if(_0x459350<=0x0||isNaN(_0x459350)){return _0x19e6b9(msgResponse(_0xe79c('0x215'),'Error',_0xe79c('0x217')+_0x459350));}if(_0x49a861<=0x0||isNaN(_0x49a861)){return _0x19e6b9(msgResponse(_0xe79c('0x215'),_0xe79c('0x46'),_0xe79c('0x210')+_0x49a861));}if(_0x5ee60b<=0x0||isNaN(_0x5ee60b)){return _0x19e6b9(msgResponse(_0xe79c('0x215'),_0xe79c('0x46'),_0xe79c('0x218')+_0x5ee60b));}_0x5162bb=_0x5162bb||0x0;var _0xbc0ca=0x1/_0x3f0d43;var _0x55614e=0x0;var _0x30a429=0x0;var _0x43c2ae=0x0;var _0x3a7e34=0x0;for(var _0x316daa=0x0;_0x3a7e34<_0x5ee60b;_0x316daa+=0x1){_0x30a429=_0x316daa/_0x49a861;_0x55614e=(_0x459350*_0x30a429+_0x5162bb)/_0xbc0ca;_0x43c2ae=erlangb(_0x55614e,_0x5cc68d);_0x3a7e34=_0x55614e/_0x5cc68d*(0x1-erlangb(_0x55614e,_0x5cc68d));}return _0x3347c8({'erlangCalls':_0x316daa,'erlangCallToSecond':_0x49a861/_0x316daa,'erlangAbandonmentRate':_0x43c2ae,'erlangBusyFactor':_0x3a7e34});});};module[_0xe79c('0x219')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 6e4cc24..fa43a93 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 _0x44c2=['VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','outbound','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','droptime','endtime','holdtime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x1e08fa,_0x2177b8){var _0x48a80f=function(_0x38c6d3){while(--_0x38c6d3){_0x1e08fa['push'](_0x1e08fa['shift']());}};_0x48a80f(++_0x2177b8);}(_0x44c2,0x100));var _0x244c=function(_0x4fd109,_0x33c503){_0x4fd109=_0x4fd109-0x0;var _0x30f0a6=_0x44c2[_0x4fd109];return _0x30f0a6;};'use strict';var util=require(_0x244c('0x0'));var _=require(_0x244c('0x1'));var moment=require(_0x244c('0x2'));function getSeconds(_0x204240,_0x4c2079){var _0x1c69f3=moment(_0x204240)[_0x244c('0x3')](0x0);var _0x2c5d4d=moment(_0x4c2079)[_0x244c('0x3')](0x0);return _0x1c69f3[_0x244c('0x4')](_0x2c5d4d,_0x244c('0x5'));}function QueueCallerAbandon(_0x4f11b1,_0x5b6f9a){this[_0x244c('0x6')]=_0x4f11b1['scheduledat'];this[_0x244c('0x7')]=_0x4f11b1['type'];this['campaigntype']=_0x4f11b1[_0x244c('0x7')]===_0x244c('0x8')?'queue':_0x4f11b1[_0x244c('0x7')];this['countbusyretry']=_0x4f11b1['countbusyretry'];this[_0x244c('0x9')]=_0x4f11b1['countcongestionretry'];this[_0x244c('0xa')]=_0x4f11b1['countnoanswerretry'];this[_0x244c('0xb')]=_0x4f11b1['countbusyretry']+_0x4f11b1['countcongestionretry']+_0x4f11b1[_0x244c('0xa')]+_0x4f11b1[_0x244c('0xc')]+_0x4f11b1[_0x244c('0xd')]+_0x4f11b1['countabandonedretry']+_0x4f11b1[_0x244c('0xe')]+_0x4f11b1[_0x244c('0xf')];this[_0x244c('0xc')]=_0x4f11b1[_0x244c('0xc')];this[_0x244c('0xd')]=_0x4f11b1[_0x244c('0xd')];this[_0x244c('0x10')]=_0x4f11b1['countabandonedretry'];this[_0x244c('0xe')]=_0x4f11b1['countmachineretry'];this['countagentrejectretry']=_0x4f11b1[_0x244c('0xf')];this[_0x244c('0x11')]=_0x5b6f9a[_0x244c('0x11')];this[_0x244c('0x12')]=_0x4f11b1['name'];this[_0x244c('0x13')]=_0x4f11b1[_0x244c('0x14')];this[_0x244c('0x15')]=_0x4f11b1[_0x244c('0x15')];this[_0x244c('0x16')]=_0x4f11b1['responsetime'];this[_0x244c('0x17')]=_0x4f11b1[_0x244c('0x17')];this[_0x244c('0x18')]=this['droptime'];this['ringtime']=getSeconds(_0x4f11b1['responsetime'],_0x4f11b1[_0x244c('0x15')]);this[_0x244c('0x19')]=getSeconds(this[_0x244c('0x17')],_0x4f11b1[_0x244c('0x16')]);this[_0x244c('0x1a')]=0x0;this[_0x244c('0x1b')]=_0x5b6f9a['queue'];this[_0x244c('0x1c')]=_0x5b6f9a[_0x244c('0x1d')];this[_0x244c('0x1e')]=_0x5b6f9a['reason'];this[_0x244c('0x1f')]=_0x4f11b1['callback'];this['callbackuniqueid']=_0x4f11b1[_0x244c('0x20')];this[_0x244c('0x21')]=_0x4f11b1['callbackat'];this[_0x244c('0x22')]=_0x4f11b1[_0x244c('0x22')];this[_0x244c('0x23')]=_0x4f11b1[_0x244c('0x23')];this['ListId']=_0x4f11b1[_0x244c('0x24')];this[_0x244c('0x25')]=_0x4f11b1[_0x244c('0x25')];this[_0x244c('0x26')]=_0x4f11b1[_0x244c('0x26')];this['CampaignId']=_0x4f11b1['CampaignId'];this[_0x244c('0x27')]=_0x4f11b1[_0x244c('0x27')]||'';this[_0x244c('0x28')]=_0x4f11b1[_0x244c('0x28')]||'';}module[_0x244c('0x29')]=QueueCallerAbandon; \ No newline at end of file +var _0x6422=['countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','queue','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','diff','seconds','scheduledat','type','outbound','countbusyretry','countcongestionretry'];(function(_0x572412,_0x46b1d6){var _0x2c936f=function(_0x5af858){while(--_0x5af858){_0x572412['push'](_0x572412['shift']());}};_0x2c936f(++_0x46b1d6);}(_0x6422,0x168));var _0x2642=function(_0x2c7303,_0x40b57b){_0x2c7303=_0x2c7303-0x0;var _0x414a3b=_0x6422[_0x2c7303];return _0x414a3b;};'use strict';var util=require('util');var _=require(_0x2642('0x0'));var moment=require('moment');function getSeconds(_0x1eaa20,_0x13ca3c){var _0x5bcc20=moment(_0x1eaa20)['milliseconds'](0x0);var _0x43121f=moment(_0x13ca3c)[_0x2642('0x1')](0x0);return _0x5bcc20[_0x2642('0x2')](_0x43121f,_0x2642('0x3'));}function QueueCallerAbandon(_0x1f1420,_0x50d7f2){this[_0x2642('0x4')]=_0x1f1420[_0x2642('0x4')];this[_0x2642('0x5')]=_0x1f1420[_0x2642('0x5')];this['campaigntype']=_0x1f1420[_0x2642('0x5')]===_0x2642('0x6')?'queue':_0x1f1420[_0x2642('0x5')];this[_0x2642('0x7')]=_0x1f1420[_0x2642('0x7')];this[_0x2642('0x8')]=_0x1f1420[_0x2642('0x8')];this['countnoanswerretry']=_0x1f1420[_0x2642('0x9')];this['countglobal']=_0x1f1420['countbusyretry']+_0x1f1420[_0x2642('0x8')]+_0x1f1420['countnoanswerretry']+_0x1f1420['countnosuchnumberretry']+_0x1f1420[_0x2642('0xa')]+_0x1f1420[_0x2642('0xb')]+_0x1f1420[_0x2642('0xc')]+_0x1f1420[_0x2642('0xd')];this['countnosuchnumberretry']=_0x1f1420[_0x2642('0xe')];this['countdropretry']=_0x1f1420[_0x2642('0xa')];this[_0x2642('0xb')]=_0x1f1420['countabandonedretry'];this[_0x2642('0xc')]=_0x1f1420[_0x2642('0xc')];this[_0x2642('0xd')]=_0x1f1420[_0x2642('0xd')];this[_0x2642('0xf')]=_0x50d7f2[_0x2642('0xf')];this['calleridname']=_0x1f1420[_0x2642('0x10')];this[_0x2642('0x11')]=_0x1f1420[_0x2642('0x12')];this[_0x2642('0x13')]=_0x1f1420[_0x2642('0x13')];this[_0x2642('0x14')]=_0x1f1420[_0x2642('0x14')];this[_0x2642('0x15')]=_0x1f1420[_0x2642('0x15')];this[_0x2642('0x16')]=this['droptime'];this[_0x2642('0x17')]=getSeconds(_0x1f1420['responsetime'],_0x1f1420[_0x2642('0x13')]);this[_0x2642('0x18')]=getSeconds(this['droptime'],_0x1f1420[_0x2642('0x14')]);this[_0x2642('0x19')]=0x0;this[_0x2642('0x1a')]=_0x50d7f2[_0x2642('0x1a')];this['membername']=_0x50d7f2[_0x2642('0x1b')];this[_0x2642('0x1c')]=_0x50d7f2[_0x2642('0x1c')];this[_0x2642('0x1d')]=_0x1f1420[_0x2642('0x1d')];this[_0x2642('0x1e')]=_0x1f1420['callbackuniqueid'];this[_0x2642('0x1f')]=_0x1f1420[_0x2642('0x1f')];this[_0x2642('0x20')]=_0x1f1420[_0x2642('0x20')];this[_0x2642('0x21')]=_0x1f1420[_0x2642('0x21')];this[_0x2642('0x22')]=_0x1f1420[_0x2642('0x22')];this[_0x2642('0x23')]=_0x1f1420['UserId'];this[_0x2642('0x24')]=_0x1f1420[_0x2642('0x24')];this[_0x2642('0x25')]=_0x1f1420[_0x2642('0x25')];this[_0x2642('0x26')]=_0x1f1420[_0x2642('0x26')]||'';this[_0x2642('0x27')]=_0x1f1420[_0x2642('0x27')]||'';}module[_0x2642('0x28')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 2e78045..d618e5f 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(_0x424200,_0x30607e){var _0xc25c73=function(_0x340df9){while(--_0x340df9){_0x424200['push'](_0x424200['shift']());}};_0xc25c73(++_0x30607e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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(_0x624ccb,_0x48cae1){var _0x4f73b7=function(_0x37f87a){while(--_0x37f87a){_0x624ccb['push'](_0x624ccb['shift']());}};_0x4f73b7(++_0x48cae1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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 26f5f20..7991285 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 _0x6324=['hasOwnProperty','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','catch','error','stringify','\x20receiveFax\x20','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','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','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isNil','active','trunks','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','lodash','bluebird','uuid','path','./util/gs','fax','./rpcDb','./channel','./util/util','./action','../rpc/attachment','../rpc/faxMessage','faxAccounts','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','prototype','context','from-voip-provider'];(function(_0x43ee27,_0x13376e){var _0xb32b6d=function(_0x6356a4){while(--_0x6356a4){_0x43ee27['push'](_0x43ee27['shift']());}};_0xb32b6d(++_0x13376e);}(_0x6324,0x142));var _0x4632=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0x6324[_0x387777];return _0x3f84c0;};'use strict';var util=require(_0x4632('0x0'));var _=require(_0x4632('0x1'));var BPromise=require(_0x4632('0x2'));var uuid=require(_0x4632('0x3'));var moment=require('moment');var path=require(_0x4632('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x4632('0x5'));var logger=require('../../../config/logger')(_0x4632('0x6'));var ami=require('../ami');var rpcDb=require(_0x4632('0x7'));var Channel=require(_0x4632('0x8'));var ut=require(_0x4632('0x9'));var Action=require(_0x4632('0xa'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x4632('0xb'));var faxMessage=require(_0x4632('0xc'));function Fax(_0x390a46){this['channels']={};this[_0x4632('0xd')]=_0x390a46[_0x4632('0xd')];this['trunks']=_0x390a46['trunks'];this[_0x4632('0xe')]={};ami['on'](_0x4632('0xf'),this[_0x4632('0x10')][_0x4632('0x11')](this));ami['on'](_0x4632('0x12'),this[_0x4632('0x13')][_0x4632('0x11')](this));ami['on'](_0x4632('0x14'),this['syncNewState'][_0x4632('0x11')](this));ami['on']('newexten',this[_0x4632('0x15')][_0x4632('0x11')](this));ami['on'](_0x4632('0x16'),this[_0x4632('0x17')]['bind'](this));ami['on'](_0x4632('0x18'),this[_0x4632('0x19')][_0x4632('0x11')](this));ami['on'](_0x4632('0x1a'),this[_0x4632('0x1b')]['bind'](this));ami['on']('originateresponse',this[_0x4632('0x1c')][_0x4632('0x11')](this));}Fax[_0x4632('0x1d')][_0x4632('0x10')]=function(_0x48fbb1){if(_0x48fbb1[_0x4632('0x1e')]===_0x4632('0x1f')){for(var _0x1a94c0 in this['faxAccounts']){if(this[_0x4632('0xd')][_0x4632('0x20')](_0x1a94c0)){if(_0x48fbb1['exten']===this['faxAccounts'][_0x1a94c0][_0x4632('0x21')]){this[_0x4632('0x22')][_0x48fbb1[_0x4632('0x23')]]={};this[_0x4632('0x22')][_0x48fbb1[_0x4632('0x23')]][_0x4632('0x24')]=_0x48fbb1[_0x4632('0x24')];this[_0x4632('0x22')][_0x48fbb1[_0x4632('0x23')]]['id']=this[_0x4632('0xd')][_0x1a94c0]['id'];this[_0x4632('0x22')][_0x48fbb1[_0x4632('0x23')]][_0x4632('0x25')]=this[_0x4632('0xd')][_0x1a94c0][_0x4632('0x25')];logger[_0x4632('0x26')](_0x48fbb1[_0x4632('0x23')],_0x4632('0x27'));}}}}if(this[_0x4632('0xe')][_0x48fbb1[_0x4632('0x23')]]){this[_0x4632('0x22')][_0x48fbb1[_0x4632('0x23')]]={};this[_0x4632('0x22')][_0x48fbb1[_0x4632('0x23')]][_0x4632('0x24')]=_0x48fbb1[_0x4632('0x24')];logger[_0x4632('0x26')](_0x48fbb1[_0x4632('0x23')],_0x4632('0x27'));}};Fax[_0x4632('0x1d')][_0x4632('0x13')]=function(_0x2a0b11){if(this[_0x4632('0x22')][_0x2a0b11['uniqueid']]){for(var _0x57798a in _0x2a0b11[_0x4632('0x28')]){if(_0x2a0b11[_0x4632('0x28')][_0x4632('0x20')](_0x57798a)){this[_0x4632('0x22')][_0x2a0b11[_0x4632('0x23')]][_0x57798a]=_0x2a0b11[_0x4632('0x29')];}}}};Fax[_0x4632('0x1d')]['syncNewState']=function(_0x42d505){if(this[_0x4632('0x22')][_0x42d505['uniqueid']]){this[_0x4632('0x22')][_0x42d505['uniqueid']][_0x4632('0x2a')]=_0x42d505['channelstate'];this['channels'][_0x42d505[_0x4632('0x23')]][_0x4632('0x2b')]=_0x42d505[_0x4632('0x2b')];}};Fax['prototype']['syncNewExten']=function(_0x395f4e){if(this[_0x4632('0x22')][_0x395f4e['uniqueid']]){for(var _0x4aab76 in _0x395f4e[_0x4632('0x28')]){if(_0x395f4e[_0x4632('0x28')]['hasOwnProperty'](_0x4aab76)){this[_0x4632('0x22')][_0x395f4e[_0x4632('0x23')]][_0x4aab76]=_0x395f4e[_0x4632('0x29')];}}}};Fax[_0x4632('0x1d')][_0x4632('0x17')]=function(_0x47b2b5){if(this[_0x4632('0x22')][_0x47b2b5[_0x4632('0x23')]]){this['channels'][_0x47b2b5['uniqueid']][_0x4632('0x2c')]=_0x47b2b5['operation'];this['channels'][_0x47b2b5[_0x4632('0x23')]]['status']=_0x47b2b5[_0x4632('0x2d')];this[_0x4632('0x22')][_0x47b2b5[_0x4632('0x23')]]['localstationid']=_0x47b2b5[_0x4632('0x21')];this[_0x4632('0x22')][_0x47b2b5[_0x4632('0x23')]][_0x4632('0x2e')]=_0x47b2b5[_0x4632('0x2e')];logger['info'](_0x47b2b5['uniqueid'],_0x4632('0x2f'));}};Fax[_0x4632('0x1d')][_0x4632('0x19')]=function(_0x4f40af){var _0x5a3fb4=this;if(this['channels'][_0x4f40af[_0x4632('0x23')]]){var _0x393ef2=this['channels'][_0x4f40af[_0x4632('0x23')]]['id'];this[_0x4632('0x22')][_0x4f40af[_0x4632('0x23')]][_0x4632('0x30')]=_0x4f40af[_0x4632('0x30')];this[_0x4632('0x22')][_0x4f40af[_0x4632('0x23')]][_0x4632('0x31')]=_0x4f40af[_0x4632('0x31')];this[_0x4632('0x22')][_0x4f40af[_0x4632('0x23')]][_0x4632('0x21')]=_0x4f40af['localstationid'];this[_0x4632('0x22')][_0x4f40af[_0x4632('0x23')]]['resolution']=_0x4f40af[_0x4632('0x32')];this[_0x4632('0x22')][_0x4f40af['uniqueid']][_0x4632('0x33')]=_0x4f40af['transferrate'];this[_0x4632('0x22')][_0x4f40af[_0x4632('0x23')]][_0x4632('0x2e')]=_0x4f40af[_0x4632('0x2e')];this['channels'][_0x4f40af[_0x4632('0x23')]][_0x4632('0x34')]=_0x4f40af[_0x4632('0x34')];if(this[_0x4632('0x22')][_0x4f40af['uniqueid']]['pagestransferred']>0x0){tiff2pdf(_0x4f40af[_0x4632('0x2e')],_0x4632('0x35'),function(_0x351cb1){logger['info'](_0x4f40af[_0x4632('0x23')],_0x4632('0x36'),_0x351cb1[_0x4632('0x37')]);attachment[_0x4632('0x38')]({'name':path[_0x4632('0x39')](_0x4f40af[_0x4632('0x2e')])[_0x4632('0x25')],'basename':path['parse'](_0x4f40af[_0x4632('0x2e')])[_0x4632('0x25')]+_0x4632('0x3a'),'type':_0x4632('0x3b')})[_0x4632('0x3c')](function(_0x4d1d50){faxAccount['notify'](_0x393ef2,{'from':_0x4f40af[_0x4632('0x34')],'mapKey':_0x4632('0x6'),'body':path[_0x4632('0x39')](_0x4f40af[_0x4632('0x2e')])['name']+_0x4632('0x3a'),'AttachmentId':_0x4d1d50['id']})[_0x4632('0x3d')](function(_0x1ef8e1){logger[_0x4632('0x3e')](_0x4f40af[_0x4632('0x23')],'\x20notify\x20',JSON[_0x4632('0x3f')](_0x1ef8e1));});})[_0x4632('0x3d')](function(_0x378665){logger[_0x4632('0x3e')](_0x4f40af[_0x4632('0x23')],_0x4632('0x40'),JSON[_0x4632('0x3f')](_0x378665));});});}logger[_0x4632('0x26')](_0x4f40af[_0x4632('0x23')],_0x4632('0x40'));}};Fax[_0x4632('0x1d')]['syncOriginateResponse']=function(_0xc3ffd0){if(this[_0x4632('0xe')][_0xc3ffd0[_0x4632('0x23')]]){_['merge'](this[_0x4632('0x22')][_0xc3ffd0[_0x4632('0x23')]],_[_0x4632('0x41')](_0xc3ffd0,[_0x4632('0x42'),_0x4632('0x43')]));}};function updateStatus(_0x70a4fd){if(_0x70a4fd[_0x4632('0x44')]){faxMessage[_0x4632('0x45')](_0x70a4fd[_0x4632('0x44')],{'failMessage':_0x4632('0x46')})['then'](function(_0x35afe5){ut[_0x4632('0x47')]('[Fax][Message][Error][Updated]',_0x35afe5);})[_0x4632('0x3d')](function(_0x3a21c6){ut[_0x4632('0x47')](_0x4632('0x48'),_0x3a21c6);});}else{ut[_0x4632('0x47')](_0x4632('0x49'));}}Fax[_0x4632('0x1d')][_0x4632('0x4a')]=function(_0x31b42d,_0x1b66e0,_0x3e66d8){var _0x2a50f7=this;var _0x3471b4={};if(_0x1b66e0){_0x3471b4={'read':_0x1b66e0};}else{_0x3471b4={'failMessage':_0x3e66d8};}if(this[_0x4632('0xe')][_0x31b42d][_0x4632('0x44')]){faxMessage[_0x4632('0x45')](this[_0x4632('0xe')][_0x31b42d][_0x4632('0x44')],_0x3471b4)[_0x4632('0x3c')](function(_0x36c824){ut['logger'](_0x4632('0x4b'),_0x36c824);})[_0x4632('0x3d')](function(_0x3ea966){ut[_0x4632('0x47')](_0x4632('0x4c'),_0x3ea966);})[_0x4632('0x4d')](function(){delete _0x2a50f7['channels'][_0x31b42d];delete _0x2a50f7[_0x4632('0xe')][_0x31b42d];});}else{ut[_0x4632('0x47')](_0x4632('0x4e'));delete this['channels'][_0x31b42d];delete this[_0x4632('0xe')][_0x31b42d];}};Fax[_0x4632('0x1d')]['syncHangup']=function(_0x17bc91){var _0x1aa4f0=this;if(this[_0x4632('0x22')][_0x17bc91['uniqueid']]){if(this[_0x4632('0xe')][_0x17bc91[_0x4632('0x23')]]){this[_0x4632('0x22')][_0x17bc91[_0x4632('0x23')]]['id']=this[_0x4632('0xe')][_0x17bc91[_0x4632('0x23')]]['id'];this[_0x4632('0x22')][_0x17bc91[_0x4632('0x23')]][_0x4632('0x25')]=this[_0x4632('0xe')][_0x17bc91['uniqueid']][_0x4632('0x25')];}logger[_0x4632('0x26')](_0x17bc91['uniqueid'],this[_0x4632('0xe')][_0x17bc91['uniqueid']]?'\x20hangup\x20sendFile\x20':_0x4632('0x4f'),JSON[_0x4632('0x3f')](this[_0x4632('0x22')][_0x17bc91[_0x4632('0x23')]]));if(this[_0x4632('0xe')][_0x17bc91[_0x4632('0x23')]]){if(this[_0x4632('0x22')][_0x17bc91[_0x4632('0x23')]][_0x4632('0x50')]>0x0&&this[_0x4632('0x22')][_0x17bc91[_0x4632('0x23')]][_0x4632('0x16')]===_0x4632('0x51')){this[_0x4632('0x4a')](_0x17bc91['uniqueid'],!![]);}else{this['updateStatus'](_0x17bc91[_0x4632('0x23')],![],this[_0x4632('0x22')][_0x17bc91[_0x4632('0x23')]][_0x4632('0x52')]?_0x4632('0x53')+this[_0x4632('0x22')][_0x17bc91['uniqueid']][_0x4632('0x52')]:_0x4632('0x54'));}}}};Fax[_0x4632('0x1d')][_0x4632('0x55')]=function(_0x5d1994){var _0x529be1=this;return new BPromise(function(_0x28428f,_0x4c547c){_0x529be1[_0x4632('0x56')](_0x5d1994,_0x529be1[_0x4632('0xd')][_0x5d1994[_0x4632('0x57')]])[_0x4632('0x3c')](function(_0xc5515f){ut['logger'](_0x4632('0x58'),_0xc5515f);_0x28428f(ut[_0x4632('0x37')]('Fax\x20received'));})['catch'](function(_0x2a2cdb){ut[_0x4632('0x47')](_0x4632('0x59'),_0x2a2cdb);updateStatus(_0x5d1994);_0x4c547c(ut[_0x4632('0x37')]('Fax\x20failed'));});});};Fax['prototype']['checkAfterSend']=function(_0x10f7ab){var _0x5b37cc=this;return new BPromise(function(_0x3af9ec,_0x3595fa){var _0x390844=_0x5b37cc[_0x4632('0x5a')](_0x5b37cc[_0x4632('0xd')][_0x10f7ab[_0x4632('0x57')]][_0x4632('0x5b')],_0x10f7ab);if(_0x390844[_0x4632('0x5c')]){_0x3af9ec(ut[_0x4632('0x37')](_0x4632('0x5d')));}else{_0x3595fa(ut[_0x4632('0x37')](_0x390844[_0x4632('0x37')]));}});};function originate(_0x1c5c49,_0x3d5e65,_0x461700){return new BPromise(function(_0x1b2905,_0x550c4d){if(_0x461700){var _0x2b6d66=util[_0x4632('0x5e')](_0x4632('0x5f'),path[_0x4632('0x39')](_0x1c5c49[_0x4632('0x4')])[_0x4632('0x25')],_0x1c5c49[_0x4632('0x4')]);gs[_0x4632('0x60')](_0x2b6d66)[_0x4632('0x3c')](function(){_0x1c5c49[_0x4632('0x4')]=util[_0x4632('0x5e')](_0x4632('0x61'),path[_0x4632('0x39')](_0x1c5c49['path'])[_0x4632('0x62')],path[_0x4632('0x39')](_0x1c5c49[_0x4632('0x4')])[_0x4632('0x25')]);_0x3d5e65[_0x4632('0x63')]=_0x1c5c49[_0x4632('0x4')];ut['logger'](_0x4632('0x64'),'');ami[_0x4632('0x65')](ut['variablesAction'](_0x1c5c49,_0x3d5e65))[_0x4632('0x3c')](function(_0x458688){_0x1b2905(_0x458688);})[_0x4632('0x3d')](function(_0x182b19){_0x550c4d(_0x182b19);});})[_0x4632('0x3d')](function(_0x5a09b9){_0x550c4d(_0x5a09b9);});}else{ami[_0x4632('0x65')](ut[_0x4632('0x66')](_0x1c5c49,_0x3d5e65))[_0x4632('0x3c')](function(_0x505e2a){_0x1b2905(_0x505e2a);})[_0x4632('0x3d')](function(_0x400a95){_0x550c4d(_0x400a95);});}});}Fax[_0x4632('0x1d')][_0x4632('0x56')]=function(_0x365341,_0x3a3f3a){var _0x35ca5d=this;return new BPromise(function(_0x295b86,_0x48fb81){var _0x36de42=uuid['v4']();var _0x9603f5=ut[_0x4632('0x67')](_0x365341,_0x3a3f3a);_0x35ca5d['actions'][_0x36de42]=new Action(_0x36de42,_0x3a3f3a,_0x365341);var _0xfc48bd=_0x35ca5d[_0x4632('0xe')][_0x36de42];if(path['parse'](_0x365341['path'])[_0x4632('0x68')]===_0x4632('0x3a')){originate(_0xfc48bd,_0x9603f5,!![])['then'](function(_0x63d3e1){_0x295b86(_0x63d3e1);})[_0x4632('0x3d')](function(_0x2f1f22){_0x48fb81(_0x2f1f22);});}else{originate(_0xfc48bd,_0x9603f5,![])[_0x4632('0x3c')](function(_0x40b7c5){_0x295b86(_0x40b7c5);})[_0x4632('0x3d')](function(_0x43edfd){_0x48fb81(_0x43edfd);});}});};Fax[_0x4632('0x1d')]['isTrunkReachable']=function(_0x1604da){return!_[_0x4632('0x69')](_0x1604da)&&!_[_0x4632('0x69')](_0x1604da[_0x4632('0x25')])&&!_['isNil'](_0x1604da[_0x4632('0x6a')])&&_0x1604da[_0x4632('0x6a')]&&!_[_0x4632('0x69')](this[_0x4632('0x6b')][util[_0x4632('0x5e')]('SIP/%s',_0x1604da[_0x4632('0x25')])])&&!_[_0x4632('0x69')](this[_0x4632('0x6b')][util[_0x4632('0x5e')](_0x4632('0x6c'),_0x1604da[_0x4632('0x25')])][_0x4632('0x2d')])&&(this[_0x4632('0x6b')][util['format'](_0x4632('0x6c'),_0x1604da[_0x4632('0x25')])][_0x4632('0x2d')]===_0x4632('0x6d')||this[_0x4632('0x6b')][util[_0x4632('0x5e')]('SIP/%s',_0x1604da[_0x4632('0x25')])][_0x4632('0x2d')]===_0x4632('0x6e'));};Fax[_0x4632('0x1d')][_0x4632('0x5a')]=function(_0x3ad5f0,_0x310c9c){if(!this['isTrunkReachable'](_0x3ad5f0)){ut[_0x4632('0x47')](_0x4632('0x6f'),_[_0x4632('0x69')](_0x3ad5f0)?'':_0x3ad5f0[_0x4632('0x25')]+_0x4632('0x70'));return{'isValid':![],'message':_0x4632('0x71')};}if(_[_0x4632('0x69')](_0x310c9c['fax'])){ut[_0x4632('0x47')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x4632('0x3f')](_0x310c9c));return{'isValid':![],'message':_0x4632('0x72')};}if(_[_0x4632('0x69')](_0x310c9c[_0x4632('0x4')])){ut[_0x4632('0x47')](_0x4632('0x73'),JSON[_0x4632('0x3f')](_0x310c9c));return{'isValid':![],'message':_0x4632('0x74')};}return{'isValid':!![],'message':_0x4632('0x75')};};module['exports']=Fax; \ No newline at end of file +var _0xf4f4=['./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','receivefax','syncReceiveFax','syncHangup','prototype','context','from-voip-provider','hasOwnProperty','exten','channels','uniqueid','channel','name','info','syncVarSet','variable','channelstate','channelstatedesc','value','syncFaxStatus','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','then','notify','error','stringify','catch','\x20receiveFax\x20','syncOriginateResponse','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','updateStatus','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','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','dir','Convert\x20pdf\x20to\x20tif','variablesAction','Action','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','uuid','moment','path','tiff2pdf','./util/gs','fax','./rpcDb','./channel','./util/util'];(function(_0x3997d3,_0x37ca9d){var _0x93382a=function(_0x3206a2){while(--_0x3206a2){_0x3997d3['push'](_0x3997d3['shift']());}};_0x93382a(++_0x37ca9d);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x296402,_0x44efc3){_0x296402=_0x296402-0x0;var _0x4f30b7=_0xf4f4[_0x296402];return _0x4f30b7;};'use strict';var util=require(_0x4f4f('0x0'));var _=require(_0x4f4f('0x1'));var BPromise=require('bluebird');var uuid=require(_0x4f4f('0x2'));var moment=require(_0x4f4f('0x3'));var path=require(_0x4f4f('0x4'));var tiff2pdf=require(_0x4f4f('0x5'));var gs=require(_0x4f4f('0x6'));var logger=require('../../../config/logger')(_0x4f4f('0x7'));var ami=require('../ami');var rpcDb=require(_0x4f4f('0x8'));var Channel=require(_0x4f4f('0x9'));var ut=require(_0x4f4f('0xa'));var Action=require(_0x4f4f('0xb'));var faxAccount=require(_0x4f4f('0xc'));var attachment=require(_0x4f4f('0xd'));var faxMessage=require(_0x4f4f('0xe'));function Fax(_0x3768d7){this['channels']={};this[_0x4f4f('0xf')]=_0x3768d7[_0x4f4f('0xf')];this[_0x4f4f('0x10')]=_0x3768d7[_0x4f4f('0x10')];this[_0x4f4f('0x11')]={};ami['on'](_0x4f4f('0x12'),this[_0x4f4f('0x13')][_0x4f4f('0x14')](this));ami['on']('varset',this['syncVarSet'][_0x4f4f('0x14')](this));ami['on'](_0x4f4f('0x15'),this[_0x4f4f('0x16')][_0x4f4f('0x14')](this));ami['on'](_0x4f4f('0x17'),this[_0x4f4f('0x18')]['bind'](this));ami['on'](_0x4f4f('0x19'),this['syncFaxStatus'][_0x4f4f('0x14')](this));ami['on'](_0x4f4f('0x1a'),this[_0x4f4f('0x1b')][_0x4f4f('0x14')](this));ami['on']('hangup',this[_0x4f4f('0x1c')]['bind'](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x4f4f('0x14')](this));}Fax[_0x4f4f('0x1d')][_0x4f4f('0x13')]=function(_0x1af189){if(_0x1af189[_0x4f4f('0x1e')]===_0x4f4f('0x1f')){for(var _0x1245c4 in this[_0x4f4f('0xf')]){if(this[_0x4f4f('0xf')][_0x4f4f('0x20')](_0x1245c4)){if(_0x1af189[_0x4f4f('0x21')]===this[_0x4f4f('0xf')][_0x1245c4]['localstationid']){this[_0x4f4f('0x22')][_0x1af189[_0x4f4f('0x23')]]={};this[_0x4f4f('0x22')][_0x1af189[_0x4f4f('0x23')]][_0x4f4f('0x24')]=_0x1af189[_0x4f4f('0x24')];this[_0x4f4f('0x22')][_0x1af189[_0x4f4f('0x23')]]['id']=this[_0x4f4f('0xf')][_0x1245c4]['id'];this[_0x4f4f('0x22')][_0x1af189[_0x4f4f('0x23')]][_0x4f4f('0x25')]=this[_0x4f4f('0xf')][_0x1245c4][_0x4f4f('0x25')];logger['info'](_0x1af189['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this[_0x4f4f('0x11')][_0x1af189[_0x4f4f('0x23')]]){this['channels'][_0x1af189[_0x4f4f('0x23')]]={};this[_0x4f4f('0x22')][_0x1af189[_0x4f4f('0x23')]][_0x4f4f('0x24')]=_0x1af189[_0x4f4f('0x24')];logger[_0x4f4f('0x26')](_0x1af189[_0x4f4f('0x23')],'\x20syncNewchannel\x20');}};Fax[_0x4f4f('0x1d')][_0x4f4f('0x27')]=function(_0x18e718){if(this[_0x4f4f('0x22')][_0x18e718[_0x4f4f('0x23')]]){for(var _0x4ad33d in _0x18e718[_0x4f4f('0x28')]){if(_0x18e718[_0x4f4f('0x28')][_0x4f4f('0x20')](_0x4ad33d)){this['channels'][_0x18e718['uniqueid']][_0x4ad33d]=_0x18e718['value'];}}}};Fax[_0x4f4f('0x1d')]['syncNewState']=function(_0x354266){if(this[_0x4f4f('0x22')][_0x354266[_0x4f4f('0x23')]]){this['channels'][_0x354266[_0x4f4f('0x23')]][_0x4f4f('0x29')]=_0x354266['channelstate'];this[_0x4f4f('0x22')][_0x354266[_0x4f4f('0x23')]][_0x4f4f('0x2a')]=_0x354266['channelstatedesc'];}};Fax[_0x4f4f('0x1d')][_0x4f4f('0x18')]=function(_0x59bdb0){if(this['channels'][_0x59bdb0[_0x4f4f('0x23')]]){for(var _0x305bf7 in _0x59bdb0[_0x4f4f('0x28')]){if(_0x59bdb0[_0x4f4f('0x28')][_0x4f4f('0x20')](_0x305bf7)){this[_0x4f4f('0x22')][_0x59bdb0[_0x4f4f('0x23')]][_0x305bf7]=_0x59bdb0[_0x4f4f('0x2b')];}}}};Fax[_0x4f4f('0x1d')][_0x4f4f('0x2c')]=function(_0x54c095){if(this['channels'][_0x54c095[_0x4f4f('0x23')]]){this['channels'][_0x54c095[_0x4f4f('0x23')]][_0x4f4f('0x2d')]=_0x54c095[_0x4f4f('0x2d')];this[_0x4f4f('0x22')][_0x54c095[_0x4f4f('0x23')]][_0x4f4f('0x2e')]=_0x54c095[_0x4f4f('0x2e')];this[_0x4f4f('0x22')][_0x54c095[_0x4f4f('0x23')]][_0x4f4f('0x2f')]=_0x54c095[_0x4f4f('0x2f')];this[_0x4f4f('0x22')][_0x54c095['uniqueid']][_0x4f4f('0x30')]=_0x54c095[_0x4f4f('0x30')];logger[_0x4f4f('0x26')](_0x54c095[_0x4f4f('0x23')],_0x4f4f('0x31'));}};Fax[_0x4f4f('0x1d')][_0x4f4f('0x1b')]=function(_0x32b077){var _0x1d1f4c=this;if(this['channels'][_0x32b077[_0x4f4f('0x23')]]){var _0x17dceb=this[_0x4f4f('0x22')][_0x32b077['uniqueid']]['id'];this['channels'][_0x32b077[_0x4f4f('0x23')]][_0x4f4f('0x32')]=_0x32b077[_0x4f4f('0x32')];this[_0x4f4f('0x22')][_0x32b077[_0x4f4f('0x23')]][_0x4f4f('0x33')]=_0x32b077[_0x4f4f('0x33')];this[_0x4f4f('0x22')][_0x32b077[_0x4f4f('0x23')]][_0x4f4f('0x2f')]=_0x32b077[_0x4f4f('0x2f')];this[_0x4f4f('0x22')][_0x32b077['uniqueid']][_0x4f4f('0x34')]=_0x32b077[_0x4f4f('0x34')];this[_0x4f4f('0x22')][_0x32b077[_0x4f4f('0x23')]][_0x4f4f('0x35')]=_0x32b077['transferrate'];this['channels'][_0x32b077[_0x4f4f('0x23')]][_0x4f4f('0x30')]=_0x32b077[_0x4f4f('0x30')];this[_0x4f4f('0x22')][_0x32b077['uniqueid']][_0x4f4f('0x36')]=_0x32b077['calleridnum'];if(this[_0x4f4f('0x22')][_0x32b077['uniqueid']]['pagestransferred']>0x0){tiff2pdf(_0x32b077[_0x4f4f('0x30')],'/var/opt/motion2/server/files/attachments/',function(_0x27303d){logger[_0x4f4f('0x26')](_0x32b077['uniqueid'],_0x4f4f('0x37'),_0x27303d[_0x4f4f('0x38')]);attachment['create']({'name':path[_0x4f4f('0x39')](_0x32b077[_0x4f4f('0x30')])[_0x4f4f('0x25')],'basename':path[_0x4f4f('0x39')](_0x32b077[_0x4f4f('0x30')])[_0x4f4f('0x25')]+_0x4f4f('0x3a'),'type':_0x4f4f('0x3b')})[_0x4f4f('0x3c')](function(_0x1c029a){faxAccount[_0x4f4f('0x3d')](_0x17dceb,{'from':_0x32b077[_0x4f4f('0x36')],'mapKey':_0x4f4f('0x7'),'body':path[_0x4f4f('0x39')](_0x32b077[_0x4f4f('0x30')])['name']+_0x4f4f('0x3a'),'AttachmentId':_0x1c029a['id']})['catch'](function(_0x5a0063){logger[_0x4f4f('0x3e')](_0x32b077[_0x4f4f('0x23')],'\x20notify\x20',JSON[_0x4f4f('0x3f')](_0x5a0063));});})[_0x4f4f('0x40')](function(_0xea9617){logger[_0x4f4f('0x3e')](_0x32b077[_0x4f4f('0x23')],'\x20receiveFax\x20',JSON[_0x4f4f('0x3f')](_0xea9617));});});}logger[_0x4f4f('0x26')](_0x32b077[_0x4f4f('0x23')],_0x4f4f('0x41'));}};Fax[_0x4f4f('0x1d')][_0x4f4f('0x42')]=function(_0x29314b){if(this[_0x4f4f('0x11')][_0x29314b[_0x4f4f('0x23')]]){_['merge'](this[_0x4f4f('0x22')][_0x29314b[_0x4f4f('0x23')]],_['pick'](_0x29314b,['response','reason']));}};function updateStatus(_0x146126){if(_0x146126[_0x4f4f('0x43')]){faxMessage[_0x4f4f('0x44')](_0x146126['AttachmentId'],{'failMessage':_0x4f4f('0x45')})['then'](function(_0xf13a0){ut[_0x4f4f('0x46')](_0x4f4f('0x47'),_0xf13a0);})[_0x4f4f('0x40')](function(_0xe03548){ut[_0x4f4f('0x46')](_0x4f4f('0x48'),_0xe03548);});}else{ut[_0x4f4f('0x46')](_0x4f4f('0x49'));}}Fax['prototype']['updateStatus']=function(_0x36cfcf,_0x8edee4,_0x4c04eb){var _0x557ba3=this;var _0x31058a={};if(_0x8edee4){_0x31058a={'read':_0x8edee4};}else{_0x31058a={'failMessage':_0x4c04eb};}if(this[_0x4f4f('0x11')][_0x36cfcf][_0x4f4f('0x43')]){faxMessage['update'](this['actions'][_0x36cfcf][_0x4f4f('0x43')],_0x31058a)[_0x4f4f('0x3c')](function(_0x179998){ut[_0x4f4f('0x46')](_0x4f4f('0x4a'),_0x179998);})[_0x4f4f('0x40')](function(_0xe66fc){ut[_0x4f4f('0x46')](_0x4f4f('0x4b'),_0xe66fc);})[_0x4f4f('0x4c')](function(){delete _0x557ba3[_0x4f4f('0x22')][_0x36cfcf];delete _0x557ba3['actions'][_0x36cfcf];});}else{ut['logger'](_0x4f4f('0x4d'));delete this[_0x4f4f('0x22')][_0x36cfcf];delete this[_0x4f4f('0x11')][_0x36cfcf];}};Fax[_0x4f4f('0x1d')]['syncHangup']=function(_0x1bef77){var _0x57a11f=this;if(this[_0x4f4f('0x22')][_0x1bef77[_0x4f4f('0x23')]]){if(this[_0x4f4f('0x11')][_0x1bef77['uniqueid']]){this[_0x4f4f('0x22')][_0x1bef77[_0x4f4f('0x23')]]['id']=this[_0x4f4f('0x11')][_0x1bef77['uniqueid']]['id'];this[_0x4f4f('0x22')][_0x1bef77[_0x4f4f('0x23')]][_0x4f4f('0x25')]=this['actions'][_0x1bef77[_0x4f4f('0x23')]][_0x4f4f('0x25')];}logger[_0x4f4f('0x26')](_0x1bef77['uniqueid'],this[_0x4f4f('0x11')][_0x1bef77['uniqueid']]?_0x4f4f('0x4e'):_0x4f4f('0x4f'),JSON[_0x4f4f('0x3f')](this[_0x4f4f('0x22')][_0x1bef77[_0x4f4f('0x23')]]));if(this[_0x4f4f('0x11')][_0x1bef77[_0x4f4f('0x23')]]){if(this[_0x4f4f('0x22')][_0x1bef77[_0x4f4f('0x23')]][_0x4f4f('0x50')]>0x0&&this[_0x4f4f('0x22')][_0x1bef77['uniqueid']][_0x4f4f('0x19')]===_0x4f4f('0x51')){this[_0x4f4f('0x52')](_0x1bef77['uniqueid'],!![]);}else{this[_0x4f4f('0x52')](_0x1bef77[_0x4f4f('0x23')],![],this[_0x4f4f('0x22')][_0x1bef77[_0x4f4f('0x23')]]['faxstatusstring']?_0x4f4f('0x53')+this[_0x4f4f('0x22')][_0x1bef77[_0x4f4f('0x23')]][_0x4f4f('0x54')]:_0x4f4f('0x55'));}}}};Fax['prototype'][_0x4f4f('0x56')]=function(_0x484ae2){var _0x19f927=this;return new BPromise(function(_0x320fd3,_0x2da4ea){_0x19f927[_0x4f4f('0x57')](_0x484ae2,_0x19f927[_0x4f4f('0xf')][_0x484ae2[_0x4f4f('0x58')]])['then'](function(_0x50590c){ut[_0x4f4f('0x46')]('[Fax][execOriginate][success]',_0x50590c);_0x320fd3(ut[_0x4f4f('0x38')](_0x4f4f('0x59')));})[_0x4f4f('0x40')](function(_0x1156f9){ut[_0x4f4f('0x46')](_0x4f4f('0x5a'),_0x1156f9);updateStatus(_0x484ae2);_0x2da4ea(ut[_0x4f4f('0x38')](_0x4f4f('0x5b')));});});};Fax[_0x4f4f('0x1d')][_0x4f4f('0x5c')]=function(_0x1f1599){var _0x4fb751=this;return new BPromise(function(_0x5bb03d,_0x533ab2){var _0x3849ee=_0x4fb751[_0x4f4f('0x5d')](_0x4fb751['faxAccounts'][_0x1f1599[_0x4f4f('0x58')]][_0x4f4f('0x5e')],_0x1f1599);if(_0x3849ee[_0x4f4f('0x5f')]){_0x5bb03d(ut[_0x4f4f('0x38')](_0x4f4f('0x60')));}else{_0x533ab2(ut[_0x4f4f('0x38')](_0x3849ee['message']));}});};function originate(_0x3961e8,_0x12597f,_0x434bcd){return new BPromise(function(_0x24ed71,_0x33f4fd){if(_0x434bcd){var _0x36299e=util[_0x4f4f('0x61')](_0x4f4f('0x62'),path['parse'](_0x3961e8[_0x4f4f('0x4')])[_0x4f4f('0x25')],_0x3961e8[_0x4f4f('0x4')]);gs[_0x4f4f('0x63')](_0x36299e)['then'](function(){_0x3961e8[_0x4f4f('0x4')]=util['format'](_0x4f4f('0x64'),path['parse'](_0x3961e8['path'])[_0x4f4f('0x65')],path[_0x4f4f('0x39')](_0x3961e8[_0x4f4f('0x4')])[_0x4f4f('0x25')]);_0x12597f['XMF-PATH']=_0x3961e8[_0x4f4f('0x4')];ut['logger'](_0x4f4f('0x66'),'');ami['Action'](ut[_0x4f4f('0x67')](_0x3961e8,_0x12597f))[_0x4f4f('0x3c')](function(_0x27eb97){_0x24ed71(_0x27eb97);})['catch'](function(_0x41c31c){_0x33f4fd(_0x41c31c);});})['catch'](function(_0x34b4ca){_0x33f4fd(_0x34b4ca);});}else{ami[_0x4f4f('0x68')](ut[_0x4f4f('0x67')](_0x3961e8,_0x12597f))[_0x4f4f('0x3c')](function(_0x2594ce){_0x24ed71(_0x2594ce);})[_0x4f4f('0x40')](function(_0x2525a0){_0x33f4fd(_0x2525a0);});}});}Fax[_0x4f4f('0x1d')][_0x4f4f('0x57')]=function(_0x4b06ff,_0x6e7ab6){var _0x2fa3ae=this;return new BPromise(function(_0x3cf675,_0x14e4f3){var _0x42c638=uuid['v4']();var _0x383d09=ut['addVariables'](_0x4b06ff,_0x6e7ab6);_0x2fa3ae[_0x4f4f('0x11')][_0x42c638]=new Action(_0x42c638,_0x6e7ab6,_0x4b06ff);var _0x18332b=_0x2fa3ae[_0x4f4f('0x11')][_0x42c638];if(path[_0x4f4f('0x39')](_0x4b06ff['path'])[_0x4f4f('0x69')]===_0x4f4f('0x3a')){originate(_0x18332b,_0x383d09,!![])[_0x4f4f('0x3c')](function(_0x563465){_0x3cf675(_0x563465);})[_0x4f4f('0x40')](function(_0x40bab8){_0x14e4f3(_0x40bab8);});}else{originate(_0x18332b,_0x383d09,![])['then'](function(_0x43694b){_0x3cf675(_0x43694b);})[_0x4f4f('0x40')](function(_0x41a715){_0x14e4f3(_0x41a715);});}});};Fax[_0x4f4f('0x1d')][_0x4f4f('0x6a')]=function(_0x25cd1c){return!_['isNil'](_0x25cd1c)&&!_[_0x4f4f('0x6b')](_0x25cd1c[_0x4f4f('0x25')])&&!_[_0x4f4f('0x6b')](_0x25cd1c[_0x4f4f('0x6c')])&&_0x25cd1c[_0x4f4f('0x6c')]&&!_[_0x4f4f('0x6b')](this['trunks'][util[_0x4f4f('0x61')](_0x4f4f('0x6d'),_0x25cd1c[_0x4f4f('0x25')])])&&!_['isNil'](this[_0x4f4f('0x10')][util[_0x4f4f('0x61')](_0x4f4f('0x6d'),_0x25cd1c[_0x4f4f('0x25')])][_0x4f4f('0x2e')])&&(this['trunks'][util[_0x4f4f('0x61')]('SIP/%s',_0x25cd1c['name'])][_0x4f4f('0x2e')]===_0x4f4f('0x6e')||this[_0x4f4f('0x10')][util[_0x4f4f('0x61')](_0x4f4f('0x6d'),_0x25cd1c[_0x4f4f('0x25')])][_0x4f4f('0x2e')]===_0x4f4f('0x6f'));};Fax[_0x4f4f('0x1d')]['checkTrunk']=function(_0x1104b4,_0x4b95f1){if(!this[_0x4f4f('0x6a')](_0x1104b4)){ut[_0x4f4f('0x46')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x4f4f('0x6b')](_0x1104b4)?'':_0x1104b4[_0x4f4f('0x25')]+_0x4f4f('0x70'));return{'isValid':![],'message':_0x4f4f('0x71')};}if(_[_0x4f4f('0x6b')](_0x4b95f1[_0x4f4f('0x7')])){ut[_0x4f4f('0x46')](_0x4f4f('0x72'),JSON['stringify'](_0x4b95f1));return{'isValid':![],'message':_0x4f4f('0x73')};}if(_[_0x4f4f('0x6b')](_0x4b95f1[_0x4f4f('0x4')])){ut['logger'](_0x4f4f('0x74'),JSON['stringify'](_0x4b95f1));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x4f4f('0x75')};};module[_0x4f4f('0x76')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 2b275e1..beec58a 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 _0x6662=['util','../../../config/logger','preview','lodash','error','inspect','notify','resolve','then','[Notify]\x20'];(function(_0x181082,_0x1418bf){var _0x3621f4=function(_0x50ed2c){while(--_0x50ed2c){_0x181082['push'](_0x181082['shift']());}};_0x3621f4(++_0x1418bf);}(_0x6662,0x1b8));var _0x2666=function(_0x5f2a50,_0x4700e0){_0x5f2a50=_0x5f2a50-0x0;var _0x7577ca=_0x6662[_0x5f2a50];return _0x7577ca;};'use strict';var util=require(_0x2666('0x0'));var BPromise=require('bluebird');var logger=require(_0x2666('0x1'))(_0x2666('0x2'));var _=require(_0x2666('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x17c818){return function(_0x1f24f6){logger[_0x2666('0x4')](_0x17c818,util[_0x2666('0x5')](_0x1f24f6,{'showHidden':![],'depth':null}));};}exports[_0x2666('0x6')]=function(_0x32333f,_0x38b281){return BPromise[_0x2666('0x7')]()[_0x2666('0x8')](faxAccount[_0x2666('0x6')](_0x32333f,_0x38b281))['catch'](loggerCatch(_0x2666('0x9')));}; \ No newline at end of file +var _0x8aa9=['notify','resolve','catch','util','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect'];(function(_0x3c92b5,_0x218476){var _0x246d9b=function(_0x169367){while(--_0x169367){_0x3c92b5['push'](_0x3c92b5['shift']());}};_0x246d9b(++_0x218476);}(_0x8aa9,0x8f));var _0x98aa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8aa9[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0x98aa('0x0'));var BPromise=require('bluebird');var logger=require(_0x98aa('0x1'))(_0x98aa('0x2'));var _=require(_0x98aa('0x3'));var faxAccount=require(_0x98aa('0x4'));function loggerCatch(_0x3b279a){return function(_0x413b5a){logger[_0x98aa('0x5')](_0x3b279a,util[_0x98aa('0x6')](_0x413b5a,{'showHidden':![],'depth':null}));};}exports[_0x98aa('0x7')]=function(_0x402a43,_0x3c1fc7){return BPromise[_0x98aa('0x8')]()['then'](faxAccount[_0x98aa('0x7')](_0x402a43,_0x3c1fc7))[_0x98aa('0x9')](loggerCatch('[Notify]\x20'));}; \ 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 47291af..f60045a 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 _0xa78e=['inspect','util','../../../../config/logger','fax','child_process','execute','info','Exec\x20gs'];(function(_0x407f68,_0x23d2df){var _0x514d70=function(_0x20e787){while(--_0x20e787){_0x407f68['push'](_0x407f68['shift']());}};_0x514d70(++_0x23d2df);}(_0xa78e,0x99));var _0xea78=function(_0x280a56,_0x199718){_0x280a56=_0x280a56-0x0;var _0x1f7bd8=_0xa78e[_0x280a56];return _0x1f7bd8;};'use strict';var util=require(_0xea78('0x0'));var logger=require(_0xea78('0x1'))(_0xea78('0x2'));var BPromise=require('bluebird');var exec=require(_0xea78('0x3'))['exec'];exports[_0xea78('0x4')]=function(_0x1c2dca){return new BPromise(function(_0x93e043,_0x121a8d){exec(_0x1c2dca,function(_0x586dfa,_0x177ec0,_0x290638){logger[_0xea78('0x5')]('Exec\x20gs',_0x177ec0);if(_0x586dfa){logger['info'](_0xea78('0x6'),'\x20Error\x20:',util[_0xea78('0x7')](_0x586dfa,{'showHidden':![],'depth':null}),_0x177ec0,_0x290638);_0x121a8d(_0x586dfa);}_0x93e043(_0x177ec0);});});}; \ No newline at end of file +var _0x863e=['bluebird','child_process','exec','execute','info','Exec\x20gs','inspect','util','../../../../config/logger'];(function(_0x3be1f2,_0x2d3242){var _0x7e9525=function(_0x6897cb){while(--_0x6897cb){_0x3be1f2['push'](_0x3be1f2['shift']());}};_0x7e9525(++_0x2d3242);}(_0x863e,0x1db));var _0xe863=function(_0x510f94,_0x1f1c50){_0x510f94=_0x510f94-0x0;var _0x22977b=_0x863e[_0x510f94];return _0x22977b;};'use strict';var util=require(_0xe863('0x0'));var logger=require(_0xe863('0x1'))('fax');var BPromise=require(_0xe863('0x2'));var exec=require(_0xe863('0x3'))[_0xe863('0x4')];exports[_0xe863('0x5')]=function(_0x259222){return new BPromise(function(_0x29972c,_0x4bd9c3){exec(_0x259222,function(_0x25b0ed,_0x3a0914,_0x4e25cd){logger['info']('Exec\x20gs',_0x3a0914);if(_0x25b0ed){logger[_0xe863('0x6')](_0xe863('0x7'),'\x20Error\x20:',util[_0xe863('0x8')](_0x25b0ed,{'showHidden':![],'depth':null}),_0x3a0914,_0x4e25cd);_0x4bd9c3(_0x25b0ed);}_0x29972c(_0x3a0914);});});}; \ 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 ae9d33b..7ec0ea6 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 _0xab01=['fax','logger','inspect','addVariables','headerinfo','minrate','maxrate','format','modem','gateway','t38timeout','localstationid','path','uniqueid','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','lodash','moment','../../../../config/logger'];(function(_0x59b7e0,_0x2dc993){var _0x378433=function(_0x3b4646){while(--_0x3b4646){_0x59b7e0['push'](_0x59b7e0['shift']());}};_0x378433(++_0x2dc993);}(_0xab01,0x1cb));var _0x1ab0=function(_0x5bce14,_0x46fd0b){_0x5bce14=_0x5bce14-0x0;var _0x276eff=_0xab01[_0x5bce14];return _0x276eff;};'use strict';var util=require('util');var _=require(_0x1ab0('0x0'));var moment=require(_0x1ab0('0x1'));var logger=require(_0x1ab0('0x2'))(_0x1ab0('0x3'));exports['message']=function(_0x56fabd){return{'message':_0x56fabd};};exports[_0x1ab0('0x4')]=function(_0x33517e,_0x4ed192){logger['info'](_0x33517e,util[_0x1ab0('0x5')](_0x4ed192,{'showHidden':![],'depth':null}));};exports[_0x1ab0('0x6')]=function(_0x69ef52,_0x194226){var _0x5ce186={'XMF-ECM':_0x194226['ecm'],'XMF-HEADERINFO':_0x194226[_0x1ab0('0x7')],'XMF-MINRATE':_0x194226[_0x1ab0('0x8')],'XMF-MAXRATE':_0x194226[_0x1ab0('0x9')],'XMF-MODEM':util[_0x1ab0('0xa')]('\x22%s\x22',_0x194226[_0x1ab0('0xb')]),'XMF-GATEWAY':_0x194226[_0x1ab0('0xc')],'XMF-FAXDETECT':_0x194226['faxdetect'],'XMF-T38TIMEOUT':_0x194226[_0x1ab0('0xd')],'XMF-LOCALSTATIONID':_0x194226[_0x1ab0('0xe')],'XMF-PATH':_0x69ef52[_0x1ab0('0xf')]};return _0x5ce186;};exports['variablesAction']=function(_0x22dd7f,_0x3475d0){return{'actionid':_0x22dd7f[_0x1ab0('0x10')],'action':'originate','channel':_0x22dd7f[_0x1ab0('0x11')],'Exten':_0x1ab0('0x12'),'Context':_0x1ab0('0x13'),'Priority':'1','callerid':util['format'](_0x1ab0('0x14'),_0x22dd7f[_0x1ab0('0x7')]?_0x22dd7f['headerinfo']:'',_0x22dd7f['localstationid']),'variable':_0x3475d0,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x22dd7f[_0x1ab0('0x10')]};}; \ No newline at end of file +var _0x38f4=['util','lodash','../../../../config/logger','fax','message','info','ecm','minrate','maxrate','modem','gateway','faxdetect','t38timeout','localstationid','path','uniqueid','originate','channel','xcally-motion-fax','from-sip','format','\x22%s\x22\x20<%s>','headerinfo'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x38f4,0x1cc));var _0x438f=function(_0x35e507,_0x171e16){_0x35e507=_0x35e507-0x0;var _0x51b71b=_0x38f4[_0x35e507];return _0x51b71b;};'use strict';var util=require(_0x438f('0x0'));var _=require(_0x438f('0x1'));var moment=require('moment');var logger=require(_0x438f('0x2'))(_0x438f('0x3'));exports[_0x438f('0x4')]=function(_0xcf96a1){return{'message':_0xcf96a1};};exports['logger']=function(_0x185547,_0x321029){logger[_0x438f('0x5')](_0x185547,util['inspect'](_0x321029,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x2e2193,_0x1ee664){var _0x410aaa={'XMF-ECM':_0x1ee664[_0x438f('0x6')],'XMF-HEADERINFO':_0x1ee664['headerinfo'],'XMF-MINRATE':_0x1ee664[_0x438f('0x7')],'XMF-MAXRATE':_0x1ee664[_0x438f('0x8')],'XMF-MODEM':util['format']('\x22%s\x22',_0x1ee664[_0x438f('0x9')]),'XMF-GATEWAY':_0x1ee664[_0x438f('0xa')],'XMF-FAXDETECT':_0x1ee664[_0x438f('0xb')],'XMF-T38TIMEOUT':_0x1ee664[_0x438f('0xc')],'XMF-LOCALSTATIONID':_0x1ee664[_0x438f('0xd')],'XMF-PATH':_0x2e2193[_0x438f('0xe')]};return _0x410aaa;};exports['variablesAction']=function(_0x58688b,_0x4350f0){return{'actionid':_0x58688b[_0x438f('0xf')],'action':_0x438f('0x10'),'channel':_0x58688b[_0x438f('0x11')],'Exten':_0x438f('0x12'),'Context':_0x438f('0x13'),'Priority':'1','callerid':util[_0x438f('0x14')](_0x438f('0x15'),_0x58688b[_0x438f('0x16')]?_0x58688b[_0x438f('0x16')]:'',_0x58688b[_0x438f('0xd')]),'variable':_0x4350f0,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x58688b[_0x438f('0xf')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index befd8ac..d184446 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 _0xac38=['initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','error','[index.js][initParams]','inspect','listen','sync','bluebird','util','moment','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','hour','get','resolve','then','getAgents','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','getZendeskAccounts'];(function(_0x5cc35e,_0x3d28af){var _0x3798f7=function(_0x164a40){while(--_0x164a40){_0x5cc35e['push'](_0x5cc35e['shift']());}};_0x3798f7(++_0x3d28af);}(_0xac38,0xb3));var _0x8ac3=function(_0xae1a83,_0x1980d4){_0xae1a83=_0xae1a83-0x0;var _0xdb9da8=_0xac38[_0xae1a83];return _0xdb9da8;};'use strict';var BPromise=require(_0x8ac3('0x0'));var util=require(_0x8ac3('0x1'));var moment=require(_0x8ac3('0x2'));var server=require('./server');var Realtime=require('./realtime');var Report=require(_0x8ac3('0x3'));var Acw=require(_0x8ac3('0x4'));var Trigger=require(_0x8ac3('0x5'));var Dialer=require(_0x8ac3('0x6'));var Preview=require(_0x8ac3('0x7'));var Fax=require(_0x8ac3('0x8'));var user=require(_0x8ac3('0x9'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x8ac3('0xa'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x8ac3('0xb'));var trigger=require(_0x8ac3('0xc'));var template=require(_0x8ac3('0xd'));var cmHopperHistory=require(_0x8ac3('0xe'));var campaign=require(_0x8ac3('0xf'));var voiceExtension=require(_0x8ac3('0x10'));var faxAccount=require(_0x8ac3('0x11'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x8ac3('0x12'));var sugarcrm=require(_0x8ac3('0x13'));var freshdesk=require(_0x8ac3('0x14'));var desk=require(_0x8ac3('0x15'));var zoho=require(_0x8ac3('0x16'));var vtiger=require(_0x8ac3('0x17'));var freshsales=require(_0x8ac3('0x18'));var servicenow=require(_0x8ac3('0x19'));var dynamics365=require(_0x8ac3('0x1a'));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(_0x8ac3('0x1b'))(_0x8ac3('0x1c'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x8ac3('0x1d'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x8ac3('0x1e')](_0x8ac3('0x1d'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x8ac3('0x1f')]()[_0x8ac3('0x20')](user[_0x8ac3('0x21')]())[_0x8ac3('0x20')](realtime['initAgents']())[_0x8ac3('0x20')](user['getTelephones']())[_0x8ac3('0x20')](realtime[_0x8ac3('0x22')]())[_0x8ac3('0x20')](trunk[_0x8ac3('0x23')]())[_0x8ac3('0x20')](realtime[_0x8ac3('0x24')]())['then'](voiceQueue[_0x8ac3('0x25')]())[_0x8ac3('0x20')](realtime[_0x8ac3('0x26')]())[_0x8ac3('0x20')](trigger[_0x8ac3('0x27')]())['then'](realtime[_0x8ac3('0x28')]())[_0x8ac3('0x20')](template[_0x8ac3('0x29')]())['then'](realtime['initTemplates']())[_0x8ac3('0x20')](zendesk[_0x8ac3('0x2a')]())[_0x8ac3('0x20')](realtime[_0x8ac3('0x2b')]())[_0x8ac3('0x20')](salesforce[_0x8ac3('0x2c')]())[_0x8ac3('0x20')](realtime[_0x8ac3('0x2d')]())[_0x8ac3('0x20')](sugarcrm[_0x8ac3('0x2e')]())[_0x8ac3('0x20')](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0x8ac3('0x2f')]())[_0x8ac3('0x20')](realtime[_0x8ac3('0x30')]())[_0x8ac3('0x20')](desk[_0x8ac3('0x31')]())[_0x8ac3('0x20')](realtime['initDeskAccounts']())[_0x8ac3('0x20')](zoho[_0x8ac3('0x32')]())['then'](realtime[_0x8ac3('0x33')]())[_0x8ac3('0x20')](vtiger[_0x8ac3('0x34')]())[_0x8ac3('0x20')](realtime[_0x8ac3('0x35')]())[_0x8ac3('0x20')](freshsales[_0x8ac3('0x36')]())[_0x8ac3('0x20')](realtime['initFreshsalesAccounts']())['then'](servicenow[_0x8ac3('0x37')]())[_0x8ac3('0x20')](realtime[_0x8ac3('0x38')]())[_0x8ac3('0x20')](dynamics365[_0x8ac3('0x39')]())['then'](realtime[_0x8ac3('0x3a')]())['then'](campaign[_0x8ac3('0x3b')]())[_0x8ac3('0x20')](realtime[_0x8ac3('0x3c')]())[_0x8ac3('0x20')](voiceExtension['getVoiceExtensions']())[_0x8ac3('0x20')](realtime[_0x8ac3('0x3d')]())[_0x8ac3('0x20')](faxAccount[_0x8ac3('0x3e')]())[_0x8ac3('0x20')](realtime['initFaxAccounts']())[_0x8ac3('0x20')](function(){return realtime;});}function initParams(){return BPromise[_0x8ac3('0x1f')]()[_0x8ac3('0x20')](voiceQueueReport[_0x8ac3('0x3f')]())[_0x8ac3('0x20')](realtime[_0x8ac3('0x40')]())[_0x8ac3('0x20')](cmHopperHistory[_0x8ac3('0x41')]())['then'](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory[_0x8ac3('0x42')]())[_0x8ac3('0x20')](realtime['initCampaignHopperHistory']())[_0x8ac3('0x20')](voiceCallReport[_0x8ac3('0x43')]())[_0x8ac3('0x20')](realtime[_0x8ac3('0x44')]())['catch'](function(_0x5f3f56){logger[_0x8ac3('0x45')](_0x8ac3('0x46'),util[_0x8ac3('0x47')](_0x5f3f56,{'showHidden':![],'depth':null}));});}function main(){return server[_0x8ac3('0x48')](realtime,preview,fax)[_0x8ac3('0x20')](function(_0x111193){return initRealtime();})[_0x8ac3('0x20')](function(){return initParams();})[_0x8ac3('0x20')](function(){report[_0x8ac3('0x49')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x4147b6){logger[_0x8ac3('0x45')]('[index.js][main]',util[_0x8ac3('0x47')](_0x4147b6,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x6485=['listen','[index.js][main]','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','getVoiceQueues','getTriggers','initTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','[index.js][initParams]','inspect'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x6485,0x16f));var _0x5648=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6485[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x5648('0x0'));var util=require(_0x5648('0x1'));var moment=require(_0x5648('0x2'));var server=require(_0x5648('0x3'));var Realtime=require(_0x5648('0x4'));var Report=require(_0x5648('0x5'));var Acw=require(_0x5648('0x6'));var Trigger=require(_0x5648('0x7'));var Dialer=require(_0x5648('0x8'));var Preview=require(_0x5648('0x9'));var Fax=require('./fax');var user=require(_0x5648('0xa'));var voiceQueue=require(_0x5648('0xb'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x5648('0xc'));var trunk=require(_0x5648('0xd'));var trigger=require(_0x5648('0xe'));var template=require(_0x5648('0xf'));var cmHopperHistory=require(_0x5648('0x10'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x5648('0x11'));var faxAccount=require(_0x5648('0x12'));var zendesk=require(_0x5648('0x13'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x5648('0x14'));var desk=require(_0x5648('0x15'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x5648('0x16'));var freshsales=require(_0x5648('0x17'));var servicenow=require(_0x5648('0x18'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x5648('0x19'))(_0x5648('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x5648('0x1b')](_0x5648('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x5648('0x1b')](_0x5648('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x5648('0x1d')]()[_0x5648('0x1e')](user[_0x5648('0x1f')]())['then'](realtime[_0x5648('0x20')]())['then'](user[_0x5648('0x21')]())['then'](realtime['initTelephones']())[_0x5648('0x1e')](trunk['getTrunks']())['then'](realtime['initTrunks']())[_0x5648('0x1e')](voiceQueue[_0x5648('0x22')]())['then'](realtime['initVoiceQueues']())[_0x5648('0x1e')](trigger[_0x5648('0x23')]())[_0x5648('0x1e')](realtime[_0x5648('0x24')]())[_0x5648('0x1e')](template[_0x5648('0x25')]())[_0x5648('0x1e')](realtime['initTemplates']())[_0x5648('0x1e')](zendesk[_0x5648('0x26')]())['then'](realtime[_0x5648('0x27')]())[_0x5648('0x1e')](salesforce[_0x5648('0x28')]())[_0x5648('0x1e')](realtime[_0x5648('0x29')]())[_0x5648('0x1e')](sugarcrm[_0x5648('0x2a')]())[_0x5648('0x1e')](realtime[_0x5648('0x2b')]())[_0x5648('0x1e')](freshdesk[_0x5648('0x2c')]())['then'](realtime[_0x5648('0x2d')]())[_0x5648('0x1e')](desk[_0x5648('0x2e')]())[_0x5648('0x1e')](realtime['initDeskAccounts']())['then'](zoho[_0x5648('0x2f')]())[_0x5648('0x1e')](realtime[_0x5648('0x30')]())[_0x5648('0x1e')](vtiger[_0x5648('0x31')]())[_0x5648('0x1e')](realtime[_0x5648('0x32')]())[_0x5648('0x1e')](freshsales[_0x5648('0x33')]())['then'](realtime[_0x5648('0x34')]())['then'](servicenow[_0x5648('0x35')]())[_0x5648('0x1e')](realtime['initServicenowAccounts']())[_0x5648('0x1e')](dynamics365[_0x5648('0x36')]())[_0x5648('0x1e')](realtime[_0x5648('0x37')]())[_0x5648('0x1e')](campaign[_0x5648('0x38')]())[_0x5648('0x1e')](realtime[_0x5648('0x39')]())[_0x5648('0x1e')](voiceExtension['getVoiceExtensions']())[_0x5648('0x1e')](realtime[_0x5648('0x3a')]())[_0x5648('0x1e')](faxAccount[_0x5648('0x3b')]())['then'](realtime[_0x5648('0x3c')]())[_0x5648('0x1e')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x5648('0x1e')](voiceQueueReport[_0x5648('0x3d')]())[_0x5648('0x1e')](realtime[_0x5648('0x3e')]())[_0x5648('0x1e')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x5648('0x1e')](realtime[_0x5648('0x3f')]())[_0x5648('0x1e')](cmHopperHistory[_0x5648('0x40')]())[_0x5648('0x1e')](realtime[_0x5648('0x41')]())[_0x5648('0x1e')](voiceCallReport[_0x5648('0x42')]())['then'](realtime[_0x5648('0x43')]())[_0x5648('0x44')](function(_0x272b6a){logger['error'](_0x5648('0x45'),util[_0x5648('0x46')](_0x272b6a,{'showHidden':![],'depth':null}));});}function main(){return server[_0x5648('0x47')](realtime,preview,fax)[_0x5648('0x1e')](function(_0x56ad8e){return initRealtime();})[_0x5648('0x1e')](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x5648('0x44')](function(_0x4760a5){logger['error'](_0x5648('0x48'),util[_0x5648('0x46')](_0x4760a5,{'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 2f6b57c..69c04ba 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 _0x9c44=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','stateTime','address','voiceStatusQueue','stringify','format','user:%s','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','status','unknown'];(function(_0x188cb8,_0x3b12b3){var _0x25eb9b=function(_0x11770b){while(--_0x11770b){_0x188cb8['push'](_0x188cb8['shift']());}};_0x25eb9b(++_0x3b12b3);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var Redis=require(_0x49c4('0x2'));var config=require(_0x49c4('0x3'));config[_0x49c4('0x4')]=_[_0x49c4('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0x6'))(new Redis(config['redis']));function Agent(_0xc1278f){this['id']=_0xc1278f['id']||0x0;this[_0x49c4('0x7')]=_0xc1278f[_0x49c4('0x7')]||'';this[_0x49c4('0x8')]=_0xc1278f[_0x49c4('0x8')]||'';this['accountcode']=_0xc1278f[_0x49c4('0x9')]||'';this[_0x49c4('0xa')]=_0xc1278f[_0x49c4('0xa')]||'';this[_0x49c4('0xb')]='unknown';this['stateTime']=0x0;this[_0x49c4('0xc')]=_0x49c4('0xd');this['address']='';this[_0x49c4('0xe')]='';this[_0x49c4('0xf')]='';this['interface']='';this['online']=_0xc1278f[_0x49c4('0x10')]||![];this[_0x49c4('0x11')]='unknown';this[_0x49c4('0x12')]=0x0;this[_0x49c4('0x13')]='';this['voiceStatusQueue']='';this[_0x49c4('0x14')]=![];this[_0x49c4('0x15')]=![];this[_0x49c4('0x1')]='';}Agent[_0x49c4('0x16')][_0x49c4('0x17')]=function(_0x18211c){var _0x75ea8;if(_0x18211c&&_0x18211c[_0x49c4('0xb')]){_0x75ea8=_0x18211c['state'][_0x49c4('0x18')]();switch(_0x75ea8){case _0x49c4('0x19'):_0x75ea8=_0x49c4('0x1a');break;case _0x49c4('0x1b'):_0x75ea8=_0x49c4('0x1c');break;}}if(_0x75ea8&&this['voiceStatus']!==_0x75ea8||_0x18211c[_0x49c4('0x1d')]){this[_0x49c4('0x12')]=_['toNumber'](moment()['format']('x'));}if(_0x75ea8){this[_0x49c4('0x11')]=_0x75ea8;}var _0x2f82d5={'id':this['id'],'name':this[_0x49c4('0x7')],'email':this['email'],'accountcode':this[_0x49c4('0x9')],'fullname':this['fullname'],'state':this[_0x49c4('0xb')],'stateTime':this[_0x49c4('0x1e')],'status':this[_0x49c4('0xc')],'address':this[_0x49c4('0x1f')],'online':this[_0x49c4('0x10')],'voiceStatus':this[_0x49c4('0x11')],'voiceStatusTime':this[_0x49c4('0x12')],'voiceStatusCallerIdNumber':this[_0x49c4('0x13')],'voiceStatusQueue':this[_0x49c4('0x20')],'interface':this['interface'],'onhold':this['onhold']};var _0x57f502=md5(JSON[_0x49c4('0x21')](_0x2f82d5));if(this['md5']!==_0x57f502){this['md5']=_0x57f502;io['to'](util[_0x49c4('0x22')](_0x49c4('0x23'),_0x2f82d5[_0x49c4('0x7')]))[_0x49c4('0x24')]('user:save',_0x2f82d5);io['emit'](_0x49c4('0x25'),_0x2f82d5);}};module[_0x49c4('0x26')]=Agent; \ No newline at end of file +var _0x0713=['idle','inuse','talking','voiceStatusTime','toNumber','format','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','state','toLowerCase','not_inuse'];(function(_0x1df11c,_0x272062){var _0x1774c0=function(_0x438459){while(--_0x438459){_0x1df11c['push'](_0x1df11c['shift']());}};_0x1774c0(++_0x272062);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 4b08eb8..b063b0b 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 _0x6968=['dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6968,0x13c));var _0x8696=function(_0x430f44,_0x4ae21b){_0x430f44=_0x430f44-0x0;var _0x1f6b0f=_0x6968[_0x430f44];return _0x1f6b0f;};'use strict';function Campaign(_0xa69c40){this['id']=_0xa69c40['id']||0x0;this[_0x8696('0x0')]=_0xa69c40[_0x8696('0x0')]||'';this[_0x8696('0x1')]=_0xa69c40[_0x8696('0x1')]||'campaign';this[_0x8696('0x2')]=0x0;this[_0x8696('0x3')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x8696('0x4')]=0x0;this['message']='';this[_0x8696('0x5')]=!![];this[_0x8696('0x6')]=_0xa69c40[_0x8696('0x6')];this[_0x8696('0x7')]=_0xa69c40[_0x8696('0x7')];this[_0x8696('0x8')]=_0xa69c40[_0x8696('0x8')]||null;this[_0x8696('0x9')]=_0xa69c40[_0x8696('0x9')]?_0xa69c40[_0x8696('0x9')]:null;this[_0x8696('0xa')]=_0xa69c40['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0xa69c40[_0x8696('0xb')];this[_0x8696('0xc')]=_0xa69c40[_0x8696('0xc')]||0x1e;this[_0x8696('0xd')]=_0xa69c40[_0x8696('0xd')];this[_0x8696('0xe')]=_0xa69c40[_0x8696('0xe')];this[_0x8696('0xf')]=_0xa69c40['dialBusyMaxRetry'];this[_0x8696('0x10')]=_0xa69c40['dialBusyRetryFrequency'];this[_0x8696('0x11')]=_0xa69c40[_0x8696('0x11')];this[_0x8696('0x12')]=_0xa69c40['dialNoAnswerRetryFrequency'];this[_0x8696('0x13')]=_0xa69c40['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0xa69c40[_0x8696('0x14')]||0x3;this[_0x8696('0x15')]=_0xa69c40[_0x8696('0x15')]||0x96;this[_0x8696('0x16')]=_0xa69c40[_0x8696('0x16')]||0x3;this[_0x8696('0x17')]=_0xa69c40[_0x8696('0x17')]||0x96;this['dialAbandonedMaxRetry']=_0xa69c40[_0x8696('0x18')]||0x3;this[_0x8696('0x19')]=_0xa69c40[_0x8696('0x19')]||0x96;this[_0x8696('0x1a')]=_0xa69c40[_0x8696('0x1a')]||0x3;this['dialMachineRetryFrequency']=_0xa69c40[_0x8696('0x1b')]||0x96;this[_0x8696('0x1c')]=_0xa69c40[_0x8696('0x1c')]||0x3;this['dialAgentRejectRetryFrequency']=_0xa69c40['dialAgentRejectRetryFrequency']||0x96;this['dialOrderByScheduledAt']=_0xa69c40[_0x8696('0x1d')]||_0x8696('0x1e');this[_0x8696('0x1f')]=_0xa69c40[_0x8696('0x1f')]||undefined;this[_0x8696('0x20')]=_0xa69c40['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0xa69c40[_0x8696('0x21')]||undefined;this[_0x8696('0x22')]=_0xa69c40['TrunkBackup']?_0xa69c40[_0x8696('0x22')]:undefined;this['Trunk']=_0xa69c40[_0x8696('0x23')]?_0xa69c40['Trunk']:undefined;this[_0x8696('0x24')]=_0xa69c40[_0x8696('0x24')]?_0xa69c40[_0x8696('0x24')]:undefined;this['SquareProject']=_0xa69c40[_0x8696('0x25')]?_0xa69c40[_0x8696('0x25')]:undefined;this[_0x8696('0x26')]=_0xa69c40['SquareProject']?_0xa69c40['SquareProject']['name']:undefined;this['dialAMDActive']=_0xa69c40['dialAMDActive']||![];this['dialAMDInitialSilence']=_0xa69c40[_0x8696('0x27')];this[_0x8696('0x28')]=_0xa69c40['dialAMDGreeting'];this[_0x8696('0x29')]=_0xa69c40[_0x8696('0x29')];this['dialAMDTotalAnalysisTime']=_0xa69c40[_0x8696('0x2a')];this[_0x8696('0x2b')]=_0xa69c40[_0x8696('0x2b')];this[_0x8696('0x2c')]=_0xa69c40[_0x8696('0x2c')];this[_0x8696('0x2d')]=_0xa69c40[_0x8696('0x2d')];this[_0x8696('0x2e')]=_0xa69c40[_0x8696('0x2e')];this['dialAMDMaximumWordLength']=_0xa69c40[_0x8696('0x2f')];}module[_0x8696('0x30')]=Campaign; \ No newline at end of file +var _0x2c9c=['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','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','exports','name','type','campaign','originated','temp','message'];(function(_0x56eb70,_0x2bd75c){var _0x47f1fe=function(_0x1fbb17){while(--_0x1fbb17){_0x56eb70['push'](_0x56eb70['shift']());}};_0x47f1fe(++_0x2bd75c);}(_0x2c9c,0x182));var _0xc2c9=function(_0x46728b,_0x376bc6){_0x46728b=_0x46728b-0x0;var _0x5aa8e2=_0x2c9c[_0x46728b];return _0x5aa8e2;};'use strict';function Campaign(_0x1dccb8){this['id']=_0x1dccb8['id']||0x0;this['name']=_0x1dccb8[_0xc2c9('0x0')]||'';this[_0xc2c9('0x1')]=_0x1dccb8[_0xc2c9('0x1')]||_0xc2c9('0x2');this[_0xc2c9('0x3')]=0x0;this[_0xc2c9('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this['ivrTotalCallsDays']=0x0;this[_0xc2c9('0x5')]='';this['sendMessageOneNotActive']=!![];this[_0xc2c9('0x6')]=_0x1dccb8[_0xc2c9('0x6')];this[_0xc2c9('0x7')]=_0x1dccb8[_0xc2c9('0x7')];this[_0xc2c9('0x8')]=_0x1dccb8[_0xc2c9('0x8')]||null;this[_0xc2c9('0x9')]=_0x1dccb8[_0xc2c9('0x9')]?_0x1dccb8[_0xc2c9('0x9')]:null;this[_0xc2c9('0xa')]=_0x1dccb8[_0xc2c9('0xa')];this[_0xc2c9('0xb')]=_0x1dccb8[_0xc2c9('0xb')];this['dialOriginateTimeout']=_0x1dccb8[_0xc2c9('0xc')]||0x1e;this[_0xc2c9('0xd')]=_0x1dccb8['dialCongestionMaxRetry'];this[_0xc2c9('0xe')]=_0x1dccb8['dialCongestionRetryFrequency'];this[_0xc2c9('0xf')]=_0x1dccb8[_0xc2c9('0xf')];this[_0xc2c9('0x10')]=_0x1dccb8[_0xc2c9('0x10')];this[_0xc2c9('0x11')]=_0x1dccb8[_0xc2c9('0x11')];this[_0xc2c9('0x12')]=_0x1dccb8[_0xc2c9('0x12')];this[_0xc2c9('0x13')]=_0x1dccb8[_0xc2c9('0x13')];this[_0xc2c9('0x14')]=_0x1dccb8[_0xc2c9('0x14')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x1dccb8[_0xc2c9('0x15')]||0x96;this[_0xc2c9('0x16')]=_0x1dccb8[_0xc2c9('0x16')]||0x3;this[_0xc2c9('0x17')]=_0x1dccb8[_0xc2c9('0x17')]||0x96;this[_0xc2c9('0x18')]=_0x1dccb8[_0xc2c9('0x18')]||0x3;this[_0xc2c9('0x19')]=_0x1dccb8[_0xc2c9('0x19')]||0x96;this[_0xc2c9('0x1a')]=_0x1dccb8['dialMachineMaxRetry']||0x3;this[_0xc2c9('0x1b')]=_0x1dccb8[_0xc2c9('0x1b')]||0x96;this[_0xc2c9('0x1c')]=_0x1dccb8[_0xc2c9('0x1c')]||0x3;this[_0xc2c9('0x1d')]=_0x1dccb8[_0xc2c9('0x1d')]||0x96;this[_0xc2c9('0x1e')]=_0x1dccb8[_0xc2c9('0x1e')]||_0xc2c9('0x1f');this[_0xc2c9('0x20')]=_0x1dccb8[_0xc2c9('0x20')]||undefined;this[_0xc2c9('0x21')]=_0x1dccb8[_0xc2c9('0x21')]||undefined;this[_0xc2c9('0x22')]=_0x1dccb8[_0xc2c9('0x22')]||undefined;this['TrunkBackup']=_0x1dccb8['TrunkBackup']?_0x1dccb8[_0xc2c9('0x23')]:undefined;this[_0xc2c9('0x24')]=_0x1dccb8[_0xc2c9('0x24')]?_0x1dccb8[_0xc2c9('0x24')]:undefined;this[_0xc2c9('0x25')]=_0x1dccb8['Interval']?_0x1dccb8[_0xc2c9('0x25')]:undefined;this['SquareProject']=_0x1dccb8[_0xc2c9('0x26')]?_0x1dccb8[_0xc2c9('0x26')]:undefined;this[_0xc2c9('0x27')]=_0x1dccb8[_0xc2c9('0x26')]?_0x1dccb8[_0xc2c9('0x26')][_0xc2c9('0x0')]:undefined;this[_0xc2c9('0x28')]=_0x1dccb8['dialAMDActive']||![];this[_0xc2c9('0x29')]=_0x1dccb8['dialAMDInitialSilence'];this[_0xc2c9('0x2a')]=_0x1dccb8[_0xc2c9('0x2a')];this['dialAMDAfterGreetingSilence']=_0x1dccb8[_0xc2c9('0x2b')];this[_0xc2c9('0x2c')]=_0x1dccb8[_0xc2c9('0x2c')];this['dialAMDMinWordLength']=_0x1dccb8['dialAMDMinWordLength'];this[_0xc2c9('0x2d')]=_0x1dccb8['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x1dccb8[_0xc2c9('0x2e')];this[_0xc2c9('0x2f')]=_0x1dccb8['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x1dccb8['dialAMDMaximumWordLength'];}module[_0xc2c9('0x30')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 758964b..a8fe188 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 _0xf4a9=['disposition','monitor','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','calleridnum','calleridname','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag'];(function(_0x477aca,_0x36db2a){var _0x110b43=function(_0x2e533d){while(--_0x2e533d){_0x477aca['push'](_0x477aca['shift']());}};_0x110b43(++_0x36db2a);}(_0xf4a9,0x164));var _0x9f4a=function(_0x434339,_0x2abf5e){_0x434339=_0x434339-0x0;var _0x507ca6=_0xf4a9[_0x434339];return _0x507ca6;};'use strict';function Channel(){this[_0x9f4a('0x0')]=null;this[_0x9f4a('0x1')]='';this['destinationchannel']='';this[_0x9f4a('0x2')]=0x0;this[_0x9f4a('0x3')]='';this['connectedlinenum']=undefined;this[_0x9f4a('0x4')]=undefined;this[_0x9f4a('0x5')]=0x0;this[_0x9f4a('0x6')]='';this[_0x9f4a('0x7')]=0x0;this[_0x9f4a('0x8')]=0x0;this[_0x9f4a('0x9')]=0x0;this[_0x9f4a('0xa')]=![];this[_0x9f4a('0xb')]=null;this[_0x9f4a('0xc')]=null;this[_0x9f4a('0xd')]=![];this['abandoned']=![];this[_0x9f4a('0xe')]='';this[_0x9f4a('0xf')]='';this[_0x9f4a('0x10')]=0x0;this[_0x9f4a('0x11')]=0x0;this[_0x9f4a('0x12')]=0x0;this[_0x9f4a('0x13')]=null;this[_0x9f4a('0x14')]=null;this[_0x9f4a('0x15')]=null;this[_0x9f4a('0x16')]=![];this['monitorFilename']=null;this['queue']=null;this[_0x9f4a('0x17')]=[];this[_0x9f4a('0x18')]=undefined;this[_0x9f4a('0x19')]=undefined;this[_0x9f4a('0x1a')]=undefined;this[_0x9f4a('0x1b')]=0x0;}module[_0x9f4a('0x1c')]=Channel; \ No newline at end of file +var _0x223e=['answered','answertime','unmanaged','abandoned','lastdata','duration','billableseconds','holdtime','type','disposition','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0x223e,0x1b1));var _0xe223=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x223e[_0x13ea00];return _0x1f7347;};'use strict';function Channel(){this[_0xe223('0x0')]=null;this[_0xe223('0x1')]='';this[_0xe223('0x2')]='';this['calleridnum']=0x0;this[_0xe223('0x3')]='';this[_0xe223('0x4')]=undefined;this[_0xe223('0x5')]=undefined;this[_0xe223('0x6')]=0x0;this[_0xe223('0x7')]='';this[_0xe223('0x8')]=0x0;this['linkedid']=0x0;this['exten']=0x0;this[_0xe223('0x9')]=![];this[_0xe223('0xa')]=null;this['endtime']=null;this[_0xe223('0xb')]=![];this[_0xe223('0xc')]=![];this['lastapplication']='';this[_0xe223('0xd')]='';this[_0xe223('0xe')]=0x0;this[_0xe223('0xf')]=0x0;this[_0xe223('0x10')]=0x0;this[_0xe223('0x11')]=null;this['tag']=null;this[_0xe223('0x12')]=null;this['monitor']=![];this[_0xe223('0x13')]=null;this[_0xe223('0x14')]=null;this[_0xe223('0x15')]=[];this[_0xe223('0x16')]=undefined;this[_0xe223('0x17')]=undefined;this['transferType']=undefined;this[_0xe223('0x18')]=0x0;}module[_0xe223('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 7922cf8..bf449f7 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 _0x9140=['username','remoteUri','authType','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name'];(function(_0x169cab,_0x1a2d4e){var _0x40b0d0=function(_0x4375ca){while(--_0x4375ca){_0x169cab['push'](_0x169cab['shift']());}};_0x40b0d0(++_0x1a2d4e);}(_0x9140,0x1bb));var _0x0914=function(_0xc51e56,_0x17c2d0){_0xc51e56=_0xc51e56-0x0;var _0x13ead4=_0x9140[_0xc51e56];return _0x13ead4;};'use strict';function DeskAccount(_0xe13f34){this['id']=_0xe13f34['id']||0x0;this[_0x0914('0x0')]=_0xe13f34[_0x0914('0x0')]||'';this['username']=_0xe13f34[_0x0914('0x1')]||'';this[_0x0914('0x2')]=_0xe13f34[_0x0914('0x2')]||'';this[_0x0914('0x3')]=_0xe13f34['authType']||'';this['password']=_0xe13f34['password']||'';this[_0x0914('0x4')]=_0xe13f34['consumerKey']||'';this['consumerSecret']=_0xe13f34[_0x0914('0x5')]||'';this['token']=_0xe13f34[_0x0914('0x6')]||'';this[_0x0914('0x7')]=_0xe13f34[_0x0914('0x7')]||'';this['type']=_0xe13f34[_0x0914('0x8')]||'';this[_0x0914('0x9')]=_0xe13f34[_0x0914('0x9')]||'';this[_0x0914('0xa')]=_0xe13f34['Configurations']||{};}module[_0x0914('0xb')]=DeskAccount; \ No newline at end of file +var _0x5921=['remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username'];(function(_0x385f48,_0x5e8389){var _0x25da4e=function(_0x3ca07f){while(--_0x3ca07f){_0x385f48['push'](_0x385f48['shift']());}};_0x25da4e(++_0x5e8389);}(_0x5921,0x1c5));var _0x1592=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x5921[_0xb0f7c3];return _0x28ea68;};'use strict';function DeskAccount(_0x46a25d){this['id']=_0x46a25d['id']||0x0;this[_0x1592('0x0')]=_0x46a25d[_0x1592('0x0')]||'';this[_0x1592('0x1')]=_0x46a25d['username']||'';this[_0x1592('0x2')]=_0x46a25d['remoteUri']||'';this['authType']=_0x46a25d[_0x1592('0x3')]||'';this['password']=_0x46a25d[_0x1592('0x4')]||'';this['consumerKey']=_0x46a25d[_0x1592('0x5')]||'';this[_0x1592('0x6')]=_0x46a25d['consumerSecret']||'';this[_0x1592('0x7')]=_0x46a25d[_0x1592('0x7')]||'';this[_0x1592('0x8')]=_0x46a25d['tokenSecret']||'';this[_0x1592('0x9')]=_0x46a25d[_0x1592('0x9')]||'';this[_0x1592('0xa')]=_0x46a25d[_0x1592('0xa')]||'';this[_0x1592('0xb')]=_0x46a25d['Configurations']||{};}module[_0x1592('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 58c121d..2f93c4d 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 _0x96cc=['clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri','tenantId','clientId'];(function(_0x4f310a,_0x4074fe){var _0x137ebc=function(_0x49de82){while(--_0x49de82){_0x4f310a['push'](_0x4f310a['shift']());}};_0x137ebc(++_0x4074fe);}(_0x96cc,0x16c));var _0xc96c=function(_0x54d72f,_0x40ec59){_0x54d72f=_0x54d72f-0x0;var _0x179e0d=_0x96cc[_0x54d72f];return _0x179e0d;};'use strict';function Dynamics365Account(_0x540e05){this['id']=_0x540e05['id']||0x0;this['name']=_0x540e05[_0xc96c('0x0')]||'';this['username']=_0x540e05[_0xc96c('0x1')]||'';this[_0xc96c('0x2')]=_0x540e05[_0xc96c('0x2')]||'';this[_0xc96c('0x3')]=_0x540e05[_0xc96c('0x3')]||'';this[_0xc96c('0x4')]=_0x540e05[_0xc96c('0x4')]||'';this[_0xc96c('0x5')]=_0x540e05[_0xc96c('0x5')]||'';this['clientSecret']=_0x540e05[_0xc96c('0x6')]||{};this[_0xc96c('0x7')]=_0x540e05[_0xc96c('0x7')]||'';this[_0xc96c('0x8')]=_0x540e05[_0xc96c('0x8')]||{};}module[_0xc96c('0x9')]=Dynamics365Account; \ No newline at end of file +var _0x9354=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports'];(function(_0x1e3dd2,_0x1c5f2c){var _0x3cf968=function(_0x310066){while(--_0x310066){_0x1e3dd2['push'](_0x1e3dd2['shift']());}};_0x3cf968(++_0x1c5f2c);}(_0x9354,0x96));var _0x4935=function(_0x234318,_0xf22f31){_0x234318=_0x234318-0x0;var _0x1ab719=_0x9354[_0x234318];return _0x1ab719;};'use strict';function Dynamics365Account(_0x487ab6){this['id']=_0x487ab6['id']||0x0;this[_0x4935('0x0')]=_0x487ab6[_0x4935('0x0')]||'';this['username']=_0x487ab6[_0x4935('0x1')]||'';this[_0x4935('0x2')]=_0x487ab6[_0x4935('0x2')]||'';this[_0x4935('0x3')]=_0x487ab6['remoteUri']||'';this[_0x4935('0x4')]=_0x487ab6[_0x4935('0x4')]||'';this[_0x4935('0x5')]=_0x487ab6[_0x4935('0x5')]||'';this[_0x4935('0x6')]=_0x487ab6[_0x4935('0x6')]||{};this[_0x4935('0x7')]=_0x487ab6[_0x4935('0x7')]||'';this[_0x4935('0x8')]=_0x487ab6['Configurations']||{};}module[_0x4935('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 bf00358..a21f592 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 _0x0a48=['tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','t38timeout'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x0a48,0x95));var _0x80a4=function(_0x5b2f71,_0x5c7880){_0x5b2f71=_0x5b2f71-0x0;var _0x1e18f2=_0x0a48[_0x5b2f71];return _0x1e18f2;};'use strict';function FaxAccount(_0x3af003){this['id']=_0x3af003['id']||0x0;this[_0x80a4('0x0')]=_0x3af003['name']||'';this[_0x80a4('0x1')]=_0x3af003[_0x80a4('0x1')];this[_0x80a4('0x2')]=_0x3af003[_0x80a4('0x2')];this[_0x80a4('0x3')]=_0x3af003['headerinfo'];this['localstationid']=_0x3af003[_0x80a4('0x4')];this[_0x80a4('0x5')]=_0x3af003[_0x80a4('0x5')]||0x960;this[_0x80a4('0x6')]=_0x3af003['maxrate']||0x3840;this[_0x80a4('0x7')]=_0x3af003['modem']||_0x80a4('0x8');this[_0x80a4('0x9')]=_0x3af003[_0x80a4('0x9')]||'no';this['faxdetect']=_0x3af003['faxdetect']||'no';this[_0x80a4('0xa')]=_0x3af003[_0x80a4('0xa')]||0x1388;this[_0x80a4('0xb')]=_0x3af003[_0x80a4('0xb')]||'SIP';this[_0x80a4('0xc')]=_0x3af003['Trunk']?_0x3af003[_0x80a4('0xc')]:undefined;this['ListId']=_0x3af003[_0x80a4('0xd')];this[_0x80a4('0xe')]=_0x3af003['key'];}module[_0x80a4('0xf')]=FaxAccount; \ No newline at end of file +var _0x36de=['gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','ecm','headerinfo','localstationid','minrate','maxrate','v17,v27,v29'];(function(_0x55257d,_0x3998ec){var _0x4d296d=function(_0x522f05){while(--_0x522f05){_0x55257d['push'](_0x55257d['shift']());}};_0x4d296d(++_0x3998ec);}(_0x36de,0x1d9));var _0xe36d=function(_0x5a6984,_0x540e11){_0x5a6984=_0x5a6984-0x0;var _0x3165d2=_0x36de[_0x5a6984];return _0x3165d2;};'use strict';function FaxAccount(_0x601a95){this['id']=_0x601a95['id']||0x0;this[_0xe36d('0x0')]=_0x601a95['name']||'';this['description']=_0x601a95['description'];this[_0xe36d('0x1')]=_0x601a95[_0xe36d('0x1')];this[_0xe36d('0x2')]=_0x601a95[_0xe36d('0x2')];this[_0xe36d('0x3')]=_0x601a95[_0xe36d('0x3')];this[_0xe36d('0x4')]=_0x601a95['minrate']||0x960;this[_0xe36d('0x5')]=_0x601a95[_0xe36d('0x5')]||0x3840;this['modem']=_0x601a95['modem']||_0xe36d('0x6');this[_0xe36d('0x7')]=_0x601a95['gateway']||'no';this[_0xe36d('0x8')]=_0x601a95[_0xe36d('0x8')]||'no';this[_0xe36d('0x9')]=_0x601a95['t38timeout']||0x1388;this[_0xe36d('0xa')]=_0x601a95[_0xe36d('0xa')]||'SIP';this[_0xe36d('0xb')]=_0x601a95['Trunk']?_0x601a95[_0xe36d('0xb')]:undefined;this[_0xe36d('0xc')]=_0x601a95[_0xe36d('0xc')];this[_0xe36d('0xd')]=_0x601a95[_0xe36d('0xd')];}module[_0xe36d('0xe')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index d1f4f2f..7a81fd4 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 _0x5031=['exports','name','username','apiKey','token','remoteUri','Configurations'];(function(_0x330f26,_0x4fbd0a){var _0x17b972=function(_0x39830d){while(--_0x39830d){_0x330f26['push'](_0x330f26['shift']());}};_0x17b972(++_0x4fbd0a);}(_0x5031,0x86));var _0x1503=function(_0x4d89c5,_0x88b142){_0x4d89c5=_0x4d89c5-0x0;var _0x11938b=_0x5031[_0x4d89c5];return _0x11938b;};'use strict';function FreshdeskAccount(_0x2beb57){this['id']=_0x2beb57['id']||0x0;this[_0x1503('0x0')]=_0x2beb57[_0x1503('0x0')]||'';this['username']=_0x2beb57[_0x1503('0x1')]||'';this[_0x1503('0x2')]=_0x2beb57[_0x1503('0x3')]||'';this[_0x1503('0x4')]=_0x2beb57['remoteUri']||'';this['serverUrl']=_0x2beb57['serverUrl']||'';this[_0x1503('0x5')]=_0x2beb57[_0x1503('0x5')]||{};}module[_0x1503('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0xeacc=['apiKey','token','remoteUri','serverUrl','Configurations','name','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeacc,0x19b));var _0xceac=function(_0x557b82,_0x2c1e4c){_0x557b82=_0x557b82-0x0;var _0x14e9da=_0xeacc[_0x557b82];return _0x14e9da;};'use strict';function FreshdeskAccount(_0x14def3){this['id']=_0x14def3['id']||0x0;this[_0xceac('0x0')]=_0x14def3[_0xceac('0x0')]||'';this[_0xceac('0x1')]=_0x14def3['username']||'';this[_0xceac('0x2')]=_0x14def3[_0xceac('0x3')]||'';this[_0xceac('0x4')]=_0x14def3['remoteUri']||'';this[_0xceac('0x5')]=_0x14def3[_0xceac('0x5')]||'';this[_0xceac('0x6')]=_0x14def3['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 4cc3248..04dd054 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 _0xed08=['apiKey','token','remoteUri','serverUrl','Configurations','name','username'];(function(_0x244e55,_0x4af71f){var _0xc4d20b=function(_0x243c07){while(--_0x243c07){_0x244e55['push'](_0x244e55['shift']());}};_0xc4d20b(++_0x4af71f);}(_0xed08,0x67));var _0x8ed0=function(_0xc8ef4,_0x5c1100){_0xc8ef4=_0xc8ef4-0x0;var _0x5b3103=_0xed08[_0xc8ef4];return _0x5b3103;};'use strict';function FreshsalesAccount(_0x12c51f){this['id']=_0x12c51f['id']||0x0;this[_0x8ed0('0x0')]=_0x12c51f[_0x8ed0('0x0')]||'';this[_0x8ed0('0x1')]=_0x12c51f[_0x8ed0('0x1')]||'';this[_0x8ed0('0x2')]=_0x12c51f[_0x8ed0('0x3')]||'';this[_0x8ed0('0x4')]=_0x12c51f[_0x8ed0('0x4')]||'';this[_0x8ed0('0x5')]=_0x12c51f[_0x8ed0('0x5')]||'';this[_0x8ed0('0x6')]=_0x12c51f[_0x8ed0('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0xfd8f=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x5c8b1c,_0x41f14b){var _0xf8651=function(_0x589e84){while(--_0x589e84){_0x5c8b1c['push'](_0x5c8b1c['shift']());}};_0xf8651(++_0x41f14b);}(_0xfd8f,0xae));var _0xffd8=function(_0xc9cedc,_0x47282d){_0xc9cedc=_0xc9cedc-0x0;var _0x57f68b=_0xfd8f[_0xc9cedc];return _0x57f68b;};'use strict';function FreshsalesAccount(_0x3ed493){this['id']=_0x3ed493['id']||0x0;this[_0xffd8('0x0')]=_0x3ed493['name']||'';this[_0xffd8('0x1')]=_0x3ed493[_0xffd8('0x1')]||'';this[_0xffd8('0x2')]=_0x3ed493[_0xffd8('0x3')]||'';this['remoteUri']=_0x3ed493[_0xffd8('0x4')]||'';this[_0xffd8('0x5')]=_0x3ed493['serverUrl']||'';this[_0xffd8('0x6')]=_0x3ed493[_0xffd8('0x6')]||{};}module[_0xffd8('0x7')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 01937a3..b4cff2c 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 _0xc2fd=['queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','voice','mohtime','type','inbound','uniqueid','calleridnum','calleridname','queue','position','count'];(function(_0x2fb812,_0x5a6382){var _0x432fe9=function(_0x2fe66b){while(--_0x2fe66b){_0x2fb812['push'](_0x2fb812['shift']());}};_0x432fe9(++_0x5a6382);}(_0xc2fd,0x16f));var _0xdc2f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc2fd[_0x40a045];return _0x1a687c;};'use strict';function QueueReport(){this[_0xdc2f('0x0')]=_0xdc2f('0x1');this[_0xdc2f('0x2')]='';this[_0xdc2f('0x3')]='';this[_0xdc2f('0x4')]='';this[_0xdc2f('0x5')]='';this['queuecallerjoinAt']=null;this['queuecallerleaveAt']=null;this[_0xdc2f('0x6')]=0x1;this[_0xdc2f('0x7')]=0x1;this[_0xdc2f('0x8')]=![];this[_0xdc2f('0x9')]=null;this[_0xdc2f('0xa')]=![];this[_0xdc2f('0xb')]=null;this[_0xdc2f('0xc')]=![];this['queuecallerexitAt']=null;this[_0xdc2f('0xd')]=0x1;this['channel']='';this[_0xdc2f('0xe')]='';this[_0xdc2f('0xf')]='';this[_0xdc2f('0x10')]='';this[_0xdc2f('0x11')]='';this[_0xdc2f('0x12')]='';this[_0xdc2f('0x13')]='';this[_0xdc2f('0x14')]=0x0;this[_0xdc2f('0x15')]=![];this[_0xdc2f('0x16')]='';this['motionChannel']=_0xdc2f('0x17');this[_0xdc2f('0x18')]=0x0;this['variables']={};}module['exports']=QueueReport; \ No newline at end of file +var _0x21d2=['assigned','lastAssignedTo','voice','mohtime','exports','type','calleridnum','calleridname','queue','queuecallerleaveAt','queuecallerabandonAt','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','context','priority'];(function(_0x19072d,_0x565645){var _0x259a55=function(_0x57a606){while(--_0x57a606){_0x19072d['push'](_0x19072d['shift']());}};_0x259a55(++_0x565645);}(_0x21d2,0x77));var _0x221d=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x21d2[_0x50007c];return _0x5c1ec7;};'use strict';function QueueReport(){this[_0x221d('0x0')]='inbound';this['uniqueid']='';this[_0x221d('0x1')]='';this[_0x221d('0x2')]='';this[_0x221d('0x3')]='';this['queuecallerjoinAt']=null;this[_0x221d('0x4')]=null;this['position']=0x1;this['count']=0x1;this['queuecallerabandon']=![];this[_0x221d('0x5')]=null;this['queuecallercomplete']=![];this[_0x221d('0x6')]=null;this['queuecallerexit']=![];this[_0x221d('0x7')]=null;this[_0x221d('0x8')]=0x1;this[_0x221d('0x9')]='';this[_0x221d('0xa')]='';this[_0x221d('0xb')]='';this['accountcode']='';this[_0x221d('0xc')]='';this['exten']='';this[_0x221d('0xd')]='';this['holdtime']=0x0;this[_0x221d('0xe')]=![];this[_0x221d('0xf')]='';this['motionChannel']=_0x221d('0x10');this[_0x221d('0x11')]=0x0;this['variables']={};}module[_0x221d('0x12')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 6beb9dc..4076c53 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 _0xbcc2=['serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab'];(function(_0x164472,_0x403626){var _0x9105b1=function(_0x296420){while(--_0x296420){_0x164472['push'](_0x164472['shift']());}};_0x9105b1(++_0x403626);}(_0xbcc2,0x93));var _0x2bcc=function(_0x174538,_0x5360da){_0x174538=_0x174538-0x0;var _0x55a2f1=_0xbcc2[_0x174538];return _0x55a2f1;};'use strict';function SalesforceAccount(_0x1c3f7b){this['id']=_0x1c3f7b['id']||0x0;this['name']=_0x1c3f7b[_0x2bcc('0x0')]||'';this['username']=_0x1c3f7b[_0x2bcc('0x1')]||'';this[_0x2bcc('0x2')]=_0x1c3f7b['remoteUri']||'';this['password']=_0x1c3f7b[_0x2bcc('0x3')]||'';this[_0x2bcc('0x4')]=_0x1c3f7b[_0x2bcc('0x4')]||'';this[_0x2bcc('0x5')]=_0x1c3f7b['clientSecret']||'';this[_0x2bcc('0x6')]=_0x1c3f7b[_0x2bcc('0x6')]||'';this[_0x2bcc('0x7')]=_0x1c3f7b[_0x2bcc('0x7')]||_0x2bcc('0x8');this['serverUrl']=_0x1c3f7b[_0x2bcc('0x9')]||'';this[_0x2bcc('0xa')]=_0x1c3f7b[_0x2bcc('0xa')]||{};}module[_0x2bcc('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x5c42=['Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl'];(function(_0x449a23,_0x29f0c1){var _0x31f3fb=function(_0x39a541){while(--_0x39a541){_0x449a23['push'](_0x449a23['shift']());}};_0x31f3fb(++_0x29f0c1);}(_0x5c42,0x10a));var _0x25c4=function(_0x3447e0,_0x9ee96){_0x3447e0=_0x3447e0-0x0;var _0x300551=_0x5c42[_0x3447e0];return _0x300551;};'use strict';function SalesforceAccount(_0x3aaf44){this['id']=_0x3aaf44['id']||0x0;this[_0x25c4('0x0')]=_0x3aaf44[_0x25c4('0x0')]||'';this[_0x25c4('0x1')]=_0x3aaf44[_0x25c4('0x1')]||'';this[_0x25c4('0x2')]=_0x3aaf44[_0x25c4('0x2')]||'';this[_0x25c4('0x3')]=_0x3aaf44['password']||'';this[_0x25c4('0x4')]=_0x3aaf44[_0x25c4('0x4')]||'';this[_0x25c4('0x5')]=_0x3aaf44[_0x25c4('0x5')]||'';this[_0x25c4('0x6')]=_0x3aaf44[_0x25c4('0x6')]||'';this[_0x25c4('0x7')]=_0x3aaf44[_0x25c4('0x7')]||_0x25c4('0x8');this[_0x25c4('0x9')]=_0x3aaf44[_0x25c4('0x9')]||'';this[_0x25c4('0xa')]=_0x3aaf44['Configurations']||{};}module[_0x25c4('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 b69d32c..0d48105 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 _0x139b=['serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x139b,0x10b));var _0xb139=function(_0x1f984b,_0x535305){_0x1f984b=_0x1f984b-0x0;var _0x571750=_0x139b[_0x1f984b];return _0x571750;};'use strict';function ServicenowAccount(_0x4556f7){this['id']=_0x4556f7['id']||0x0;this[_0xb139('0x0')]=_0x4556f7['name']||'';this[_0xb139('0x1')]=_0x4556f7[_0xb139('0x1')]||'';this['password']=_0x4556f7['password']||'';this[_0xb139('0x2')]=_0x4556f7[_0xb139('0x2')]||'';this[_0xb139('0x3')]=_0x4556f7[_0xb139('0x3')]||'';this['Configurations']=_0x4556f7[_0xb139('0x4')]||{};}module[_0xb139('0x5')]=ServicenowAccount; \ No newline at end of file +var _0x3ea7=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x89a220,_0x2fd418){var _0x9995b8=function(_0x1c467b){while(--_0x1c467b){_0x89a220['push'](_0x89a220['shift']());}};_0x9995b8(++_0x2fd418);}(_0x3ea7,0x139));var _0x73ea=function(_0x562faa,_0x23adc7){_0x562faa=_0x562faa-0x0;var _0xc70f59=_0x3ea7[_0x562faa];return _0xc70f59;};'use strict';function ServicenowAccount(_0x5bbd81){this['id']=_0x5bbd81['id']||0x0;this[_0x73ea('0x0')]=_0x5bbd81[_0x73ea('0x0')]||'';this[_0x73ea('0x1')]=_0x5bbd81['username']||'';this[_0x73ea('0x2')]=_0x5bbd81[_0x73ea('0x2')]||'';this['remoteUri']=_0x5bbd81[_0x73ea('0x3')]||'';this[_0x73ea('0x4')]=_0x5bbd81[_0x73ea('0x4')]||'';this[_0x73ea('0x5')]=_0x5bbd81[_0x73ea('0x5')]||{};}module[_0x73ea('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index d8530ec..ebcf990 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 _0xe7fe=['name','username','password','remoteUri','exports'];(function(_0x1ff990,_0x3e9904){var _0x5c4fb9=function(_0x3d1e88){while(--_0x3d1e88){_0x1ff990['push'](_0x1ff990['shift']());}};_0x5c4fb9(++_0x3e9904);}(_0xe7fe,0x19f));var _0xee7f=function(_0x25c72c,_0x14f0ab){_0x25c72c=_0x25c72c-0x0;var _0x57e28b=_0xe7fe[_0x25c72c];return _0x57e28b;};'use strict';function SugarcrmAccount(_0x5007bf){this['id']=_0x5007bf['id']||0x0;this[_0xee7f('0x0')]=_0x5007bf[_0xee7f('0x0')]||'';this[_0xee7f('0x1')]=_0x5007bf['username']||'';this[_0xee7f('0x2')]=_0x5007bf[_0xee7f('0x2')]||'';this[_0xee7f('0x3')]=_0x5007bf[_0xee7f('0x3')]||'';this['serverUrl']=_0x5007bf['serverUrl']||'';this['Configurations']=_0x5007bf['Configurations']||{};}module[_0xee7f('0x4')]=SugarcrmAccount; \ No newline at end of file +var _0x1a4c=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x23592b,_0x70ad58){var _0x41d8ae=function(_0x3f8e97){while(--_0x3f8e97){_0x23592b['push'](_0x23592b['shift']());}};_0x41d8ae(++_0x70ad58);}(_0x1a4c,0x82));var _0xc1a4=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x1a4c[_0x59ee6f];return _0x4c0979;};'use strict';function SugarcrmAccount(_0x5e9115){this['id']=_0x5e9115['id']||0x0;this[_0xc1a4('0x0')]=_0x5e9115[_0xc1a4('0x0')]||'';this[_0xc1a4('0x1')]=_0x5e9115[_0xc1a4('0x1')]||'';this[_0xc1a4('0x2')]=_0x5e9115['password']||'';this['remoteUri']=_0x5e9115[_0xc1a4('0x3')]||'';this[_0xc1a4('0x4')]=_0x5e9115[_0xc1a4('0x4')]||'';this[_0xc1a4('0x5')]=_0x5e9115[_0xc1a4('0x5')]||{};}module[_0xc1a4('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 2a4378e..a7911f1 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 _0x594d=['unknown','address','accountcode','state','stateTime','status'];(function(_0x12df6b,_0x40c55e){var _0x32c79f=function(_0x1626b7){while(--_0x1626b7){_0x12df6b['push'](_0x12df6b['shift']());}};_0x32c79f(++_0x40c55e);}(_0x594d,0x92));var _0xd594=function(_0x348852,_0x3c57a5){_0x348852=_0x348852-0x0;var _0x3863c5=_0x594d[_0x348852];return _0x3863c5;};'use strict';function Telephone(_0x567e3c){this['id']=_0x567e3c['id']||0x0;this['name']=_0x567e3c['name']||'';this[_0xd594('0x0')]=_0x567e3c[_0xd594('0x0')]||'';this[_0xd594('0x1')]='unknown';this[_0xd594('0x2')]=0x0;this[_0xd594('0x3')]=_0xd594('0x4');this[_0xd594('0x5')]='';}module['exports']=Telephone; \ No newline at end of file +var _0xe260=['name','accountcode','state','unknown','stateTime','status','address','exports'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0xe260,0xb0));var _0x0e26=function(_0x4d4336,_0x537742){_0x4d4336=_0x4d4336-0x0;var _0x2ff101=_0xe260[_0x4d4336];return _0x2ff101;};'use strict';function Telephone(_0x3fb835){this['id']=_0x3fb835['id']||0x0;this[_0x0e26('0x0')]=_0x3fb835[_0x0e26('0x0')]||'';this[_0x0e26('0x1')]=_0x3fb835['accountcode']||'';this[_0x0e26('0x2')]=_0x0e26('0x3');this[_0x0e26('0x4')]=0x0;this[_0x0e26('0x5')]=_0x0e26('0x3');this[_0x0e26('0x6')]='';}module[_0x0e26('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 4c4d72d..2f5a5b5 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 _0xb10b=['name','html'];(function(_0x1adec5,_0x492ec2){var _0x805f77=function(_0x1ebc51){while(--_0x1ebc51){_0x1adec5['push'](_0x1adec5['shift']());}};_0x805f77(++_0x492ec2);}(_0xb10b,0x12a));var _0xbb10=function(_0x13fcaf,_0x416c69){_0x13fcaf=_0x13fcaf-0x0;var _0x4fa631=_0xb10b[_0x13fcaf];return _0x4fa631;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x46fe2b,_0x1a4d93){var _0x2665f6=function(_0x5dd04b){while(--_0x5dd04b){_0x46fe2b['push'](_0x46fe2b['shift']());}};_0x2665f6(++_0x1a4d93);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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 20ea520..1adee89 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 _0x757a=['name','status','AllConditions','AnyConditions','Actions','exports'];(function(_0x29cb49,_0x485c89){var _0x2a8d40=function(_0x154167){while(--_0x154167){_0x29cb49['push'](_0x29cb49['shift']());}};_0x2a8d40(++_0x485c89);}(_0x757a,0xde));var _0xa757=function(_0x2897d5,_0x556c7e){_0x2897d5=_0x2897d5-0x0;var _0x1c4707=_0x757a[_0x2897d5];return _0x1c4707;};'use strict';function Trigger(_0x1acf7d){this['id']=_0x1acf7d['id']||0x0;this[_0xa757('0x0')]=_0x1acf7d[_0xa757('0x0')]||'';this['channel']=_0x1acf7d['channel']||'voice';this[_0xa757('0x1')]=_0x1acf7d[_0xa757('0x1')]||![];this[_0xa757('0x2')]=_0x1acf7d[_0xa757('0x2')]||[];this[_0xa757('0x3')]=_0x1acf7d[_0xa757('0x3')]||[];this['Actions']=_0x1acf7d[_0xa757('0x4')]||[];}module[_0xa757('0x5')]=Trigger; \ No newline at end of file +var _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x14e27a,_0x3b4136){var _0x288688=function(_0x3d7ab1){while(--_0x3d7ab1){_0x14e27a['push'](_0x14e27a['shift']());}};_0x288688(++_0x3b4136);}(_0x4fc2,0x111));var _0x24fc=function(_0x1743a9,_0x4fb330){_0x1743a9=_0x1743a9-0x0;var _0x1a4feb=_0x4fc2[_0x1743a9];return _0x1a4feb;};'use strict';function Trigger(_0x5ea3ab){this['id']=_0x5ea3ab['id']||0x0;this[_0x24fc('0x0')]=_0x5ea3ab[_0x24fc('0x0')]||'';this[_0x24fc('0x1')]=_0x5ea3ab['channel']||_0x24fc('0x2');this[_0x24fc('0x3')]=_0x5ea3ab[_0x24fc('0x3')]||![];this['AllConditions']=_0x5ea3ab[_0x24fc('0x4')]||[];this[_0x24fc('0x5')]=_0x5ea3ab['AnyConditions']||[];this[_0x24fc('0x6')]=_0x5ea3ab[_0x24fc('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 8b483ca..2e2f7da 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 _0xc124=['stateTime','registry','indexOf','host','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','state','unknown'];(function(_0x16bfc5,_0x4f9dc3){var _0x43b820=function(_0x363ced){while(--_0x363ced){_0x16bfc5['push'](_0x16bfc5['shift']());}};_0x43b820(++_0x4f9dc3);}(_0xc124,0xa2));var _0x4c12=function(_0x2e0f5c,_0x3771d1){_0x2e0f5c=_0x2e0f5c-0x0;var _0x1b6047=_0xc124[_0x2e0f5c];return _0x1b6047;};'use strict';function Trunk(_0x156778){this['id']=_0x156778['id']||0x0;this[_0x4c12('0x0')]=_0x156778[_0x4c12('0x0')]||![];this['name']=_0x156778['name']||'';this[_0x4c12('0x1')]=_0x4c12('0x2');this[_0x4c12('0x3')]=0x0;this['status']=_0x4c12('0x2');this[_0x4c12('0x4')]=_0x156778[_0x4c12('0x4')]&&_0x156778[_0x4c12('0x4')][_0x4c12('0x5')](':')?_0x156778['registry']['split'](':')[0x0]:'';this[_0x4c12('0x6')]='';this['port']='';this[_0x4c12('0x7')]='';this[_0x4c12('0x8')]='';this[_0x4c12('0x9')]='';this[_0x4c12('0xa')]=_0x4c12('0x2');this[_0x4c12('0xb')]='';this[_0x4c12('0xc')]='';this[_0x4c12('0xd')]=_0x156778[_0x4c12('0xd')]||'';}module[_0x4c12('0xe')]=Trunk; \ No newline at end of file +var _0xd27d=['registry','indexOf','split','host','domainport','refresh','registrationtime','defaultuser','exports','active','name','state','unknown'];(function(_0x562410,_0x789451){var _0x5be422=function(_0x1cb27e){while(--_0x1cb27e){_0x562410['push'](_0x562410['shift']());}};_0x5be422(++_0x789451);}(_0xd27d,0xe6));var _0xdd27=function(_0x15a6a1,_0x4d795b){_0x15a6a1=_0x15a6a1-0x0;var _0x574bee=_0xd27d[_0x15a6a1];return _0x574bee;};'use strict';function Trunk(_0x15908d){this['id']=_0x15908d['id']||0x0;this[_0xdd27('0x0')]=_0x15908d[_0xdd27('0x0')]||![];this[_0xdd27('0x1')]=_0x15908d[_0xdd27('0x1')]||'';this[_0xdd27('0x2')]=_0xdd27('0x3');this['stateTime']=0x0;this['status']='unknown';this[_0xdd27('0x4')]=_0x15908d[_0xdd27('0x4')]&&_0x15908d['registry'][_0xdd27('0x5')](':')?_0x15908d[_0xdd27('0x4')][_0xdd27('0x6')](':')[0x0]:'';this[_0xdd27('0x7')]='';this['port']='';this['domain']='';this[_0xdd27('0x8')]='';this[_0xdd27('0x9')]='';this['stateRegistry']=_0xdd27('0x3');this[_0xdd27('0xa')]='';this['address']='';this['defaultuser']=_0x15908d[_0xdd27('0xb')]||'';}module[_0xdd27('0xc')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 167161c..f5e3f51 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 _0xdbf5=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x12ca5f,_0x223d98){var _0xfc3ae9=function(_0x1928fb){while(--_0x1928fb){_0x12ca5f['push'](_0x12ca5f['shift']());}};_0xfc3ae9(++_0x223d98);}(_0xdbf5,0x1ed));var _0x5dbf=function(_0x4b503c,_0x2fbeef){_0x4b503c=_0x4b503c-0x0;var _0x3f00f1=_0xdbf5[_0x4b503c];return _0x3f00f1;};'use strict';function voiceExtension(_0x44c5ad){this['id']=_0x44c5ad['id']||0x0;this[_0x5dbf('0x0')]=_0x44c5ad[_0x5dbf('0x0')]||'';this[_0x5dbf('0x1')]=_0x44c5ad[_0x5dbf('0x1')]||_0x5dbf('0x2');this[_0x5dbf('0x3')]=_0x44c5ad[_0x5dbf('0x3')]||![];}module[_0x5dbf('0x4')]=voiceExtension; \ No newline at end of file +var _0x1505=['exten','recordingFormat','none','mandatoryDisposition'];(function(_0x1e0d88,_0x3df610){var _0x47ba9a=function(_0x274f6a){while(--_0x274f6a){_0x1e0d88['push'](_0x1e0d88['shift']());}};_0x47ba9a(++_0x3df610);}(_0x1505,0x1f4));var _0x5150=function(_0x4c47d2,_0x4efb3f){_0x4c47d2=_0x4c47d2-0x0;var _0x461579=_0x1505[_0x4c47d2];return _0x461579;};'use strict';function voiceExtension(_0xabb367){this['id']=_0xabb367['id']||0x0;this['exten']=_0xabb367[_0x5150('0x0')]||'';this['recordingFormat']=_0xabb367[_0x5150('0x1')]||_0x5150('0x2');this[_0x5150('0x3')]=_0xabb367[_0x5150('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 1a2123a..3c3db4c 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 _0x25b4=['dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','inuse','busy','invalid','ringing','ringinuse','onhold','wav','wav49','name','monitor_format','type','inbound','answered','sumDuration','unmanaged','abandoned','available','acw','acwTimeout','autopause','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence'];(function(_0x59cbeb,_0x1de4e7){var _0x40d965=function(_0x415919){while(--_0x415919){_0x59cbeb['push'](_0x59cbeb['shift']());}};_0x40d965(++_0x1de4e7);}(_0x25b4,0x109));var _0x425b=function(_0x1b8f5a,_0x57c154){_0x1b8f5a=_0x1b8f5a-0x0;var _0x594189=_0x25b4[_0x1b8f5a];return _0x594189;};'use strict';var statusDesc=['unknown',_0x425b('0x0'),_0x425b('0x1'),_0x425b('0x2'),_0x425b('0x3'),'unavailable',_0x425b('0x4'),_0x425b('0x5'),_0x425b('0x6')];var monitorFormat={'wav':_0x425b('0x7'),'wav49':_0x425b('0x8'),'gsm':'gsm'};var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};function VoiceQueue(_0x5b2992){this['id']=_0x5b2992['id']||0x0;this[_0x425b('0x9')]=_0x5b2992['name']||'';this[_0x425b('0xa')]=_0x5b2992[_0x425b('0xa')]||'';this[_0x425b('0xb')]=_0x5b2992[_0x425b('0xb')]||_0x425b('0xc');this['waiting']=0x0;this['talking']=0x0;this['total']=0x0;this[_0x425b('0xd')]=0x0;this[_0x425b('0xe')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this[_0x425b('0xf')]=0x0;this[_0x425b('0x10')]=0x0;this['loggedIn']=0x0;this[_0x425b('0x11')]=0x0;this[_0x425b('0x12')]=_0x5b2992[_0x425b('0x12')]||![];this[_0x425b('0x13')]=_0x5b2992[_0x425b('0x13')]||0xa;this[_0x425b('0x14')]=_0x5b2992[_0x425b('0x14')]||'no';this['sendMessageOneNotActive']=!![];this[_0x425b('0x15')]='';this[_0x425b('0x16')]=0x0;this[_0x425b('0x17')]=0x0;this[_0x425b('0x18')]=_0x5b2992[_0x425b('0x18')]||null;this[_0x425b('0x19')]=_0x5b2992[_0x425b('0x19')]?_0x5b2992[_0x425b('0x19')]:null;this['dialActive']=_0x5b2992[_0x425b('0x1a')];this[_0x425b('0x1b')]=_0x5b2992[_0x425b('0x1b')]||_0x425b('0x1c');this['dialLimitChannel']=_0x5b2992[_0x425b('0x1d')]||0x0;this[_0x425b('0x1e')]=_0x5b2992[_0x425b('0x1e')]||0x0;this['dialPowerLevel']=_0x5b2992['dialPowerLevel']||0x1;this[_0x425b('0x1f')]=_0x5b2992[_0x425b('0x1f')]||_0x425b('0x20');this[_0x425b('0x21')]=_0x5b2992[_0x425b('0x21')]||0.03;this[_0x425b('0x22')]=_0x5b2992['dialPredictiveInterval']||0x258;this[_0x425b('0x23')]=_0x5b2992[_0x425b('0x23')]||_0x425b('0x24');this[_0x425b('0x25')]=_0x5b2992[_0x425b('0x25')]||_0x425b('0x24');this[_0x425b('0x26')]=_0x5b2992[_0x425b('0x26')]||0x1e;this['dialQueueOptions']=_0x5b2992[_0x425b('0x27')]||_0x425b('0x28');this[_0x425b('0x29')]=_0x5b2992[_0x425b('0x29')]||0x3;this['dialQueueProject']=_0x5b2992['dialQueueProject']||undefined;this[_0x425b('0x2a')]=_0x5b2992['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x5b2992[_0x425b('0x2b')]||0x96;this[_0x425b('0x2c')]=_0x5b2992[_0x425b('0x2c')]||0x3;this[_0x425b('0x2d')]=_0x5b2992[_0x425b('0x2d')]||0x96;this[_0x425b('0x2e')]=_0x5b2992[_0x425b('0x2e')]||0x3;this['dialNoAnswerRetryFrequency']=_0x5b2992['dialNoAnswerRetryFrequency']||0x96;this[_0x425b('0x2f')]=_0x5b2992[_0x425b('0x2f')]||0x3;this[_0x425b('0x30')]=_0x5b2992[_0x425b('0x30')]||0x96;this[_0x425b('0x31')]=_0x5b2992['dialDropMaxRetry']||0x3;this[_0x425b('0x32')]=_0x5b2992[_0x425b('0x32')]||0x96;this[_0x425b('0x33')]=_0x5b2992[_0x425b('0x33')]||0x3;this[_0x425b('0x34')]=_0x5b2992[_0x425b('0x34')]||0x96;this[_0x425b('0x35')]=_0x5b2992[_0x425b('0x35')]||0x3;this[_0x425b('0x36')]=_0x5b2992['dialMachineRetryFrequency']||0x96;this[_0x425b('0x37')]=_0x5b2992[_0x425b('0x37')]||0x3;this['dialAgentRejectRetryFrequency']=_0x5b2992[_0x425b('0x38')]||0x96;this[_0x425b('0x39')]=_0x5b2992[_0x425b('0x39')]||0x4;this[_0x425b('0x3a')]=_0x5b2992[_0x425b('0x3a')]?_0x5b2992[_0x425b('0x3a')]:undefined;this['TrunkBackup']=_0x5b2992[_0x425b('0x3b')]?_0x5b2992[_0x425b('0x3b')]:undefined;this[_0x425b('0x3c')]=_0x5b2992[_0x425b('0x3c')]||undefined;this[_0x425b('0x3d')]=_0x5b2992['Interval']?_0x5b2992[_0x425b('0x3d')]:undefined;this[_0x425b('0x3e')]=_0x5b2992[_0x425b('0x3e')]||_0x425b('0x3f');this['dialRandomLastDigitCallerIdNumber']=_0x5b2992['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x425b('0x40')]=_0x5b2992['dialCutDigit']||undefined;this[_0x425b('0x41')]=strategy[_0x5b2992[_0x425b('0x41')]]||_0x425b('0x42');this[_0x425b('0x43')]=!![];this[_0x425b('0x44')]=_0x5b2992[_0x425b('0x44')]||![];this[_0x425b('0x45')]=_0x5b2992[_0x425b('0x45')];this[_0x425b('0x46')]=_0x5b2992[_0x425b('0x46')];this[_0x425b('0x47')]=_0x5b2992['dialAMDAfterGreetingSilence'];this[_0x425b('0x48')]=_0x5b2992[_0x425b('0x48')];this['dialAMDMinWordLength']=_0x5b2992['dialAMDMinWordLength'];this[_0x425b('0x49')]=_0x5b2992['dialAMDBetweenWordsSilence'];this[_0x425b('0x4a')]=_0x5b2992[_0x425b('0x4a')];this[_0x425b('0x4b')]=_0x5b2992['dialAMDSilenceThreshold'];this[_0x425b('0x4c')]=_0x5b2992[_0x425b('0x4c')];this['outboundRejectCallsDay']=0x0;this[_0x425b('0x4d')]=0x0;this[_0x425b('0x4e')]=_0x5b2992[_0x425b('0x4e')];this[_0x425b('0x4f')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x425b('0x50')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x425b('0x51')]=0x0;this[_0x425b('0x52')]=0x0;this[_0x425b('0x53')]=0x0;this[_0x425b('0x54')]=0x0;this[_0x425b('0x55')]=0x0;this[_0x425b('0x56')]=0x0;this[_0x425b('0x57')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x425b('0x58')]=0x0;this[_0x425b('0x59')]=0x0;this['startProgressive']=undefined;this[_0x425b('0x5a')]=undefined;this[_0x425b('0x5b')]=undefined;this[_0x425b('0x5c')]=1.05;this[_0x425b('0x5d')]=0x0;this[_0x425b('0x5e')]=0x0;this[_0x425b('0x5f')]=0x0;this[_0x425b('0x60')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x425b('0x61')]=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x425b('0x62')]=_0x5b2992['dialPredictiveIntervalMaxThreshold']||0x14;this['predictiveIntervalMinThreshold']=_0x5b2992[_0x425b('0x63')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x425b('0x64')]=0x0;this[_0x425b('0x65')]=0x1;this[_0x425b('0x66')]=0x0;this['erlangCallToSecond']=0x0;this[_0x425b('0x67')]=0x0;this[_0x425b('0x68')]=0x0;this['dialRecallMeTimeout']=_0x5b2992['dialRecallMeTimeout']||0x1e;this[_0x425b('0x69')]=_0x5b2992[_0x425b('0x69')]||![];this[_0x425b('0x6a')]=!!_0x5b2992[_0x425b('0x6a')]||![];this[_0x425b('0x6b')]=_0x5b2992[_0x425b('0x6b')]||undefined;this[_0x425b('0x6c')]=_0x5b2992[_0x425b('0x6c')]||![];this[_0x425b('0x6d')]=_0x5b2992[_0x425b('0x6d')]||![];this[_0x425b('0xa')]=monitorFormat[_0x5b2992[_0x425b('0xa')]]?monitorFormat[_0x5b2992['monitor_format']]:undefined;this[_0x425b('0x6e')]=_0x5b2992[_0x425b('0x6e')]||![];this[_0x425b('0x6f')]=_0x5b2992['mandatoryDispositionPause']?_0x5b2992[_0x425b('0x6f')]:undefined;}module[_0x425b('0x70')]=VoiceQueue; \ No newline at end of file +var _0xfc8c=['message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','inuse','busy','invalid','unavailable','ringinuse','wav','wav49','gsm','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumHoldTime','sumBillable','unmanaged','abandoned','acw','acwTimeout','autopause','sendMessageOneNotActive'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xfc8c,0x15d));var _0xcfc8=function(_0x2692fd,_0x42a642){_0x2692fd=_0x2692fd-0x0;var _0x3d01e2=_0xfc8c[_0x2692fd];return _0x3d01e2;};'use strict';var statusDesc=[_0xcfc8('0x0'),'not_inuse',_0xcfc8('0x1'),_0xcfc8('0x2'),_0xcfc8('0x3'),_0xcfc8('0x4'),'ringing',_0xcfc8('0x5'),'onhold'];var monitorFormat={'wav':_0xcfc8('0x6'),'wav49':_0xcfc8('0x7'),'gsm':_0xcfc8('0x8')};var strategy={'rrmemory':'rrmemory','roundrobin':_0xcfc8('0x9')};function VoiceQueue(_0x59de46){this['id']=_0x59de46['id']||0x0;this['name']=_0x59de46[_0xcfc8('0xa')]||'';this[_0xcfc8('0xb')]=_0x59de46[_0xcfc8('0xb')]||'';this[_0xcfc8('0xc')]=_0x59de46[_0xcfc8('0xc')]||_0xcfc8('0xd');this[_0xcfc8('0xe')]=0x0;this[_0xcfc8('0xf')]=0x0;this[_0xcfc8('0x10')]=0x0;this[_0xcfc8('0x11')]=0x0;this['sumDuration']=0x0;this[_0xcfc8('0x12')]=0x0;this[_0xcfc8('0x13')]=0x0;this[_0xcfc8('0x14')]=0x0;this[_0xcfc8('0x15')]=0x0;this['loggedIn']=0x0;this['available']=0x0;this[_0xcfc8('0x16')]=_0x59de46[_0xcfc8('0x16')]||![];this[_0xcfc8('0x17')]=_0x59de46['acwTimeout']||0xa;this[_0xcfc8('0x18')]=_0x59de46[_0xcfc8('0x18')]||'no';this[_0xcfc8('0x19')]=!![];this[_0xcfc8('0x1a')]='';this[_0xcfc8('0x1b')]=0x0;this['temp']=0x0;this[_0xcfc8('0x1c')]=_0x59de46[_0xcfc8('0x1c')]||null;this['dialGlobalInterval']=_0x59de46[_0xcfc8('0x1d')]?_0x59de46['dialGlobalInterval']:null;this[_0xcfc8('0x1e')]=_0x59de46[_0xcfc8('0x1e')];this[_0xcfc8('0x1f')]=_0x59de46[_0xcfc8('0x1f')]||'progressive';this[_0xcfc8('0x20')]=_0x59de46[_0xcfc8('0x20')]||0x0;this['dialLimitQueue']=_0x59de46[_0xcfc8('0x21')]||0x0;this[_0xcfc8('0x22')]=_0x59de46[_0xcfc8('0x22')]||0x1;this[_0xcfc8('0x23')]=_0x59de46[_0xcfc8('0x23')]||'dropRate';this['dialPredictiveOptimizationPercentage']=_0x59de46[_0xcfc8('0x24')]||0.03;this['dialPredictiveInterval']=_0x59de46[_0xcfc8('0x25')]||0x258;this[_0xcfc8('0x26')]=_0x59de46[_0xcfc8('0x26')]||_0xcfc8('0x27');this['dialOriginateCallerIdNumber']=_0x59de46[_0xcfc8('0x28')]||_0xcfc8('0x27');this[_0xcfc8('0x29')]=_0x59de46[_0xcfc8('0x29')]||0x1e;this[_0xcfc8('0x2a')]=_0x59de46[_0xcfc8('0x2a')]||_0xcfc8('0x2b');this['dialQueueTimeout']=_0x59de46[_0xcfc8('0x2c')]||0x3;this[_0xcfc8('0x2d')]=_0x59de46['dialQueueProject']||undefined;this[_0xcfc8('0x2e')]=_0x59de46[_0xcfc8('0x2e')]||0x3;this[_0xcfc8('0x2f')]=_0x59de46[_0xcfc8('0x2f')]||0x96;this[_0xcfc8('0x30')]=_0x59de46[_0xcfc8('0x30')]||0x3;this[_0xcfc8('0x31')]=_0x59de46['dialBusyRetryFrequency']||0x96;this[_0xcfc8('0x32')]=_0x59de46[_0xcfc8('0x32')]||0x3;this[_0xcfc8('0x33')]=_0x59de46[_0xcfc8('0x33')]||0x96;this[_0xcfc8('0x34')]=_0x59de46[_0xcfc8('0x34')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x59de46[_0xcfc8('0x35')]||0x96;this['dialDropMaxRetry']=_0x59de46[_0xcfc8('0x36')]||0x3;this[_0xcfc8('0x37')]=_0x59de46[_0xcfc8('0x37')]||0x96;this[_0xcfc8('0x38')]=_0x59de46[_0xcfc8('0x38')]||0x3;this[_0xcfc8('0x39')]=_0x59de46[_0xcfc8('0x39')]||0x96;this[_0xcfc8('0x3a')]=_0x59de46[_0xcfc8('0x3a')]||0x3;this[_0xcfc8('0x3b')]=_0x59de46['dialMachineRetryFrequency']||0x96;this[_0xcfc8('0x3c')]=_0x59de46[_0xcfc8('0x3c')]||0x3;this['dialAgentRejectRetryFrequency']=_0x59de46[_0xcfc8('0x3d')]||0x96;this[_0xcfc8('0x3e')]=_0x59de46[_0xcfc8('0x3e')]||0x4;this[_0xcfc8('0x3f')]=_0x59de46['Trunk']?_0x59de46['Trunk']:undefined;this[_0xcfc8('0x40')]=_0x59de46[_0xcfc8('0x40')]?_0x59de46[_0xcfc8('0x40')]:undefined;this[_0xcfc8('0x41')]=_0x59de46[_0xcfc8('0x41')]||undefined;this['Interval']=_0x59de46['Interval']?_0x59de46[_0xcfc8('0x42')]:undefined;this[_0xcfc8('0x43')]=_0x59de46['dialOrderByScheduledAt']||_0xcfc8('0x44');this['dialRandomLastDigitCallerIdNumber']=_0x59de46[_0xcfc8('0x45')]||undefined;this[_0xcfc8('0x46')]=_0x59de46['dialCutDigit']||undefined;this['strategy']=strategy[_0x59de46[_0xcfc8('0x47')]]||'rrmemory';this[_0xcfc8('0x48')]=!![];this[_0xcfc8('0x49')]=_0x59de46[_0xcfc8('0x49')]||![];this[_0xcfc8('0x4a')]=_0x59de46[_0xcfc8('0x4a')];this[_0xcfc8('0x4b')]=_0x59de46[_0xcfc8('0x4b')];this['dialAMDAfterGreetingSilence']=_0x59de46[_0xcfc8('0x4c')];this['dialAMDTotalAnalysisTime']=_0x59de46[_0xcfc8('0x4d')];this[_0xcfc8('0x4e')]=_0x59de46[_0xcfc8('0x4e')];this[_0xcfc8('0x4f')]=_0x59de46[_0xcfc8('0x4f')];this['dialAMDMaximumNumberOfWords']=_0x59de46[_0xcfc8('0x50')];this[_0xcfc8('0x51')]=_0x59de46[_0xcfc8('0x51')];this[_0xcfc8('0x52')]=_0x59de46[_0xcfc8('0x52')];this[_0xcfc8('0x53')]=0x0;this['pTalking']=0x0;this['timeout']=_0x59de46[_0xcfc8('0x54')];this[_0xcfc8('0x55')]=0x0;this[_0xcfc8('0x56')]=0x0;this[_0xcfc8('0x57')]=0x0;this[_0xcfc8('0x58')]=0x0;this[_0xcfc8('0x59')]=0x0;this[_0xcfc8('0x5a')]=0x0;this[_0xcfc8('0x5b')]=0x0;this[_0xcfc8('0x5c')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0xcfc8('0x5d')]=0x0;this[_0xcfc8('0x5e')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xcfc8('0x5f')]=0x0;this[_0xcfc8('0x60')]=0x0;this[_0xcfc8('0x61')]=undefined;this[_0xcfc8('0x62')]=undefined;this[_0xcfc8('0x63')]=undefined;this[_0xcfc8('0x64')]=1.05;this[_0xcfc8('0x65')]=0x0;this[_0xcfc8('0x66')]=0x0;this[_0xcfc8('0x67')]=0x0;this[_0xcfc8('0x68')]=0x0;this[_0xcfc8('0x69')]=0x0;this[_0xcfc8('0x6a')]=0x0;this[_0xcfc8('0x6b')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0xcfc8('0x6c')]=_0x59de46[_0xcfc8('0x6d')]||0x14;this[_0xcfc8('0x6e')]=_0x59de46[_0xcfc8('0x6d')]||0xa;this[_0xcfc8('0x6f')]=0x0;this[_0xcfc8('0x70')]=0x0;this[_0xcfc8('0x71')]=0x1;this[_0xcfc8('0x72')]=0x0;this['erlangCallToSecond']=0x0;this['erlangAbandonmentRate']=0x0;this[_0xcfc8('0x73')]=0x0;this['dialRecallMeTimeout']=_0x59de46[_0xcfc8('0x74')]||0x1e;this[_0xcfc8('0x75')]=_0x59de46[_0xcfc8('0x75')]||![];this[_0xcfc8('0x76')]=!!_0x59de46[_0xcfc8('0x76')]||![];this['dialQueueProject2']=_0x59de46[_0xcfc8('0x77')]||undefined;this[_0xcfc8('0x78')]=_0x59de46[_0xcfc8('0x78')]||![];this[_0xcfc8('0x79')]=_0x59de46['dialAgiAfterHangupAgent']||![];this[_0xcfc8('0xb')]=monitorFormat[_0x59de46[_0xcfc8('0xb')]]?monitorFormat[_0x59de46[_0xcfc8('0xb')]]:undefined;this[_0xcfc8('0x7a')]=_0x59de46['mandatoryDisposition']||![];this[_0xcfc8('0x7b')]=_0x59de46['mandatoryDispositionPause']?_0x59de46[_0xcfc8('0x7b')]:undefined;}module[_0xcfc8('0x7c')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index cbd5cb3..140d30f 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 _0xc10f=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x36bae0,_0x5fc100){var _0xb5868d=function(_0x30179e){while(--_0x30179e){_0x36bae0['push'](_0x36bae0['shift']());}};_0xb5868d(++_0x5fc100);}(_0xc10f,0x188));var _0xfc10=function(_0x1962c3,_0x7461d6){_0x1962c3=_0x1962c3-0x0;var _0x40447e=_0xc10f[_0x1962c3];return _0x40447e;};'use strict';function VtigerAccount(_0x3066a0){this['id']=_0x3066a0['id']||0x0;this['name']=_0x3066a0[_0xfc10('0x0')]||'';this[_0xfc10('0x1')]=_0x3066a0[_0xfc10('0x1')]||'';this[_0xfc10('0x2')]=_0x3066a0[_0xfc10('0x2')]||'';this[_0xfc10('0x3')]=_0x3066a0[_0xfc10('0x3')]||'';this[_0xfc10('0x4')]=_0x3066a0[_0xfc10('0x4')]||'';this['Configurations']=_0x3066a0[_0xfc10('0x5')]||{};}module[_0xfc10('0x6')]=VtigerAccount; \ No newline at end of file +var _0x53cc=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x367361,_0x311488){var _0x195d2d=function(_0x2b20a4){while(--_0x2b20a4){_0x367361['push'](_0x367361['shift']());}};_0x195d2d(++_0x311488);}(_0x53cc,0x178));var _0xc53c=function(_0x2b49bc,_0x47b636){_0x2b49bc=_0x2b49bc-0x0;var _0x43cc65=_0x53cc[_0x2b49bc];return _0x43cc65;};'use strict';function VtigerAccount(_0x4708cd){this['id']=_0x4708cd['id']||0x0;this[_0xc53c('0x0')]=_0x4708cd[_0xc53c('0x0')]||'';this[_0xc53c('0x1')]=_0x4708cd[_0xc53c('0x1')]||'';this[_0xc53c('0x2')]=_0x4708cd[_0xc53c('0x2')]||'';this[_0xc53c('0x3')]=_0x4708cd[_0xc53c('0x3')]||'';this[_0xc53c('0x4')]=_0x4708cd[_0xc53c('0x4')]||'';this[_0xc53c('0x5')]=_0x4708cd['Configurations']||{};}module[_0xc53c('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index bfbc1fe..33201a8 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 _0x6988=['type','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType'];(function(_0x3faa9a,_0x288f86){var _0x450f89=function(_0x2653d3){while(--_0x2653d3){_0x3faa9a['push'](_0x3faa9a['shift']());}};_0x450f89(++_0x288f86);}(_0x6988,0x9a));var _0x8698=function(_0x4b903a,_0x3051ea){_0x4b903a=_0x4b903a-0x0;var _0x1f2484=_0x6988[_0x4b903a];return _0x1f2484;};'use strict';function ZendeskAccount(_0x443777){this['id']=_0x443777['id']||0x0;this['name']=_0x443777[_0x8698('0x0')]||'';this['username']=_0x443777[_0x8698('0x1')]||'';this[_0x8698('0x2')]=_0x443777[_0x8698('0x2')]||'';this[_0x8698('0x3')]=_0x443777['token']||'';this['remoteUri']=_0x443777[_0x8698('0x4')]||'';this[_0x8698('0x5')]=_0x443777[_0x8698('0x5')]||'';this[_0x8698('0x6')]=_0x443777[_0x8698('0x6')]||'integrationTab';this[_0x8698('0x7')]=_0x443777['serverUrl']||'';this[_0x8698('0x8')]=_0x443777['Configurations']||{};}module[_0x8698('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x7581=['name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations'];(function(_0x14dcd7,_0x1844e){var _0x2314ec=function(_0x41cacc){while(--_0x41cacc){_0x14dcd7['push'](_0x14dcd7['shift']());}};_0x2314ec(++_0x1844e);}(_0x7581,0xaa));var _0x1758=function(_0x8dc75f,_0x5110ee){_0x8dc75f=_0x8dc75f-0x0;var _0x1d253f=_0x7581[_0x8dc75f];return _0x1d253f;};'use strict';function ZendeskAccount(_0x3ea8bd){this['id']=_0x3ea8bd['id']||0x0;this[_0x1758('0x0')]=_0x3ea8bd[_0x1758('0x0')]||'';this[_0x1758('0x1')]=_0x3ea8bd['username']||'';this[_0x1758('0x2')]=_0x3ea8bd['password']||'';this[_0x1758('0x3')]=_0x3ea8bd[_0x1758('0x3')]||'';this[_0x1758('0x4')]=_0x3ea8bd[_0x1758('0x4')]||'';this[_0x1758('0x5')]=_0x3ea8bd['authType']||'';this[_0x1758('0x6')]=_0x3ea8bd[_0x1758('0x6')]||_0x1758('0x7');this['serverUrl']=_0x3ea8bd[_0x1758('0x8')]||'';this['Configurations']=_0x3ea8bd[_0x1758('0x9')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 75f60c6..fe3b7e9 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 _0x60c7=['description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x3ef61c,_0x15db77){var _0x535195=function(_0x42f855){while(--_0x42f855){_0x3ef61c['push'](_0x3ef61c['shift']());}};_0x535195(++_0x15db77);}(_0x60c7,0xa0));var _0x760c=function(_0xe909d8,_0x41bdad){_0xe909d8=_0xe909d8-0x0;var _0xced3f3=_0x60c7[_0xe909d8];return _0xced3f3;};'use strict';function ZohoAccount(_0x233268){this['id']=_0x233268['id']||0x0;this['name']=_0x233268['name']||'';this[_0x760c('0x0')]=_0x233268['description']||'';this['host']=_0x233268[_0x760c('0x1')]||'';this[_0x760c('0x2')]=_0x233268['zone']||'';this['clientId']=_0x233268[_0x760c('0x3')]||'';this[_0x760c('0x4')]=_0x233268[_0x760c('0x4')]||'';this[_0x760c('0x5')]=_0x233268[_0x760c('0x5')]||'';this['code']=_0x233268[_0x760c('0x6')]||'';this[_0x760c('0x7')]=_0x233268[_0x760c('0x7')]||'';this[_0x760c('0x8')]=_0x233268['Configurations']||{};}module[_0x760c('0x9')]=ZohoAccount; \ No newline at end of file +var _0x9e21=['exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0x3cb8c7,_0x435f86){var _0x4cf948=function(_0xa0f984){while(--_0xa0f984){_0x3cb8c7['push'](_0x3cb8c7['shift']());}};_0x4cf948(++_0x435f86);}(_0x9e21,0x161));var _0x19e2=function(_0x5b7fc7,_0x60f01e){_0x5b7fc7=_0x5b7fc7-0x0;var _0x3d0bd2=_0x9e21[_0x5b7fc7];return _0x3d0bd2;};'use strict';function ZohoAccount(_0x261d7d){this['id']=_0x261d7d['id']||0x0;this[_0x19e2('0x0')]=_0x261d7d['name']||'';this[_0x19e2('0x1')]=_0x261d7d[_0x19e2('0x1')]||'';this[_0x19e2('0x2')]=_0x261d7d['host']||'';this[_0x19e2('0x3')]=_0x261d7d[_0x19e2('0x3')]||'';this[_0x19e2('0x4')]=_0x261d7d[_0x19e2('0x4')]||'';this[_0x19e2('0x5')]=_0x261d7d['clientSecret']||'';this[_0x19e2('0x6')]=_0x261d7d[_0x19e2('0x6')]||'';this[_0x19e2('0x7')]=_0x261d7d[_0x19e2('0x7')]||'';this[_0x19e2('0x8')]=_0x261d7d[_0x19e2('0x8')]||'';this[_0x19e2('0x9')]=_0x261d7d[_0x19e2('0x9')]||{};}module[_0x19e2('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 6b2450c..8023a6f 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 _0xb7e6=['originatecalleridname','prototype','\x22%s\x22\x20<%s>','lodash','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','calleridname','Contact','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum'];(function(_0x4143be,_0x2a16be){var _0x2f00ba=function(_0x53cba7){while(--_0x53cba7){_0x4143be['push'](_0x4143be['shift']());}};_0x2f00ba(++_0x2a16be);}(_0xb7e6,0x11b));var _0x6b7e=function(_0x489dbd,_0x5734bf){_0x489dbd=_0x489dbd-0x0;var _0x30abcc=_0xb7e6[_0x489dbd];return _0x30abcc;};'use strict';var util=require('util');var _=require(_0x6b7e('0x0'));var moment=require('moment');function checkNameSurname(_0x4d5252,_0x5c11d6,_0x6ebbd9){var _0x5e6454='';if(!_[_0x6b7e('0x1')](_0x5c11d6)&&_0x6b7e('0x2')===typeof _0x5c11d6){_0x5e6454+=_0x5c11d6;}if(!_['isNil'](_0x6ebbd9)&&'string'===typeof _0x6ebbd9){_0x5e6454+='\x20'+_0x6ebbd9;}if(_0x5e6454!==''){return _0x5e6454;}return _0x4d5252;}function Action(_0x388eff,_0x420764,_0x13a0b3,_0x434819,_0x30f815){this[_0x6b7e('0x3')]=_0x13a0b3||undefined;this[_0x6b7e('0x4')]=_0x388eff['id'];this[_0x6b7e('0x5')]=_0x420764[_0x6b7e('0x6')];this['type']=_0x420764[_0x6b7e('0x7')];this[_0x6b7e('0x8')]='queue';this[_0x6b7e('0x9')]=![];this[_0x6b7e('0xa')]=_['isNil'](_0x388eff[_0x6b7e('0xb')])?undefined:_0x388eff[_0x6b7e('0xb')][_0x6b7e('0x6')];this[_0x6b7e('0xc')]=this[_0x6b7e('0xa')]?util[_0x6b7e('0xd')]('SIP/%s',this[_0x6b7e('0xa')]):_0x434819||undefined;this[_0x6b7e('0xe')]=checkNameSurname(_0x388eff[_0x6b7e('0xf')]['phone'],_0x388eff[_0x6b7e('0xf')][_0x6b7e('0x10')],_0x388eff[_0x6b7e('0xf')][_0x6b7e('0x11')]);this[_0x6b7e('0x12')]=_0x388eff['active']||![];this[_0x6b7e('0x13')]=_0x388eff[_0x6b7e('0xf')]['phone'];this[_0x6b7e('0x14')]=_0x388eff[_0x6b7e('0x14')];this[_0x6b7e('0x15')]=_0x388eff['countbusyretry']||0x0;this['countcongestionretry']=_0x388eff[_0x6b7e('0x16')]||0x0;this['countnoanswerretry']=_0x388eff['countnoanswerretry']||0x0;this[_0x6b7e('0x17')]=(_0x388eff[_0x6b7e('0x15')]||0x0)+(_0x388eff['countcongestionretry']||0x0)+(_0x388eff[_0x6b7e('0x18')]||0x0)+(_0x388eff[_0x6b7e('0x19')]||0x0)+(_0x388eff[_0x6b7e('0x1a')]||0x0)+(_0x388eff['countabandonedretry']||0x0)+(_0x388eff[_0x6b7e('0x1b')]||0x0)+(_0x388eff[_0x6b7e('0x1c')]||0x0);this[_0x6b7e('0x19')]=_0x388eff[_0x6b7e('0x19')]||0x0;this['countdropretry']=_0x388eff[_0x6b7e('0x1a')]||0x0;this['countabandonedretry']=_0x388eff['countabandonedretry']||0x0;this[_0x6b7e('0x1b')]=_0x388eff[_0x6b7e('0x1b')]||0x0;this['countagentrejectretry']=_0x388eff['countagentrejectretry']||0x0;this[_0x6b7e('0x1d')]=_0x388eff[_0x6b7e('0x1d')];this[_0x6b7e('0x1e')]=_0x388eff['callbackuniqueid'];this[_0x6b7e('0x1f')]=_0x388eff[_0x6b7e('0x1f')];this['recallme']=_0x388eff['recallme'];this[_0x6b7e('0x20')]=_0x388eff[_0x6b7e('0x20')];this[_0x6b7e('0x21')]=_0x388eff['ListId'];this[_0x6b7e('0x22')]=_[_0x6b7e('0x1')](_0x388eff[_0x6b7e('0xb')])?_0x388eff[_0x6b7e('0x22')]:_0x388eff[_0x6b7e('0xb')]['id'];this['VoiceQueueId']=_0x388eff[_0x6b7e('0x23')];this[_0x6b7e('0x24')]='';this[_0x6b7e('0x25')]='';}Action[_0x6b7e('0x26')]['getCaller']=function(){return util[_0x6b7e('0xd')](_0x6b7e('0x27'),this[_0x6b7e('0xe')],this['number']);};module['exports']=Action; \ No newline at end of file +var _0x9a16=['Agent','format','Contact','phone','firstName','lastName','active','scheduledat','countbusyretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','calleridname','number','exports','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','membername'];(function(_0x3438ea,_0xcfa91e){var _0x3ba5de=function(_0xd1ee67){while(--_0xd1ee67){_0x3438ea['push'](_0x3438ea['shift']());}};_0x3ba5de(++_0xcfa91e);}(_0x9a16,0xbe));var _0x69a1=function(_0x2e2e76,_0x49fd25){_0x2e2e76=_0x2e2e76-0x0;var _0x32071a=_0x9a16[_0x2e2e76];return _0x32071a;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x69a1('0x0'));function checkNameSurname(_0x57c406,_0x5882e2,_0x43b874){var _0x2684dd='';if(!_[_0x69a1('0x1')](_0x5882e2)&&_0x69a1('0x2')===typeof _0x5882e2){_0x2684dd+=_0x5882e2;}if(!_[_0x69a1('0x1')](_0x43b874)&&'string'===typeof _0x43b874){_0x2684dd+='\x20'+_0x43b874;}if(_0x2684dd!==''){return _0x2684dd;}return _0x57c406;}function Action(_0x2f1228,_0x24298d,_0x368912,_0x1ce313,_0x42f71f){this[_0x69a1('0x3')]=_0x368912||undefined;this[_0x69a1('0x4')]=_0x2f1228['id'];this[_0x69a1('0x5')]=_0x24298d[_0x69a1('0x6')];this[_0x69a1('0x7')]=_0x24298d[_0x69a1('0x7')];this[_0x69a1('0x8')]='queue';this['dialAnswer']=![];this[_0x69a1('0x9')]=_[_0x69a1('0x1')](_0x2f1228['Agent'])?undefined:_0x2f1228[_0x69a1('0xa')][_0x69a1('0x6')];this['channelAgent']=this[_0x69a1('0x9')]?util[_0x69a1('0xb')]('SIP/%s',this['membername']):_0x1ce313||undefined;this['calleridname']=checkNameSurname(_0x2f1228[_0x69a1('0xc')][_0x69a1('0xd')],_0x2f1228['Contact'][_0x69a1('0xe')],_0x2f1228[_0x69a1('0xc')][_0x69a1('0xf')]);this[_0x69a1('0x10')]=_0x2f1228['active']||![];this['calleridnum']=_0x2f1228[_0x69a1('0xc')][_0x69a1('0xd')];this[_0x69a1('0x11')]=_0x2f1228['scheduledat'];this['countbusyretry']=_0x2f1228[_0x69a1('0x12')]||0x0;this['countcongestionretry']=_0x2f1228['countcongestionretry']||0x0;this['countnoanswerretry']=_0x2f1228[_0x69a1('0x13')]||0x0;this['countglobal']=(_0x2f1228[_0x69a1('0x12')]||0x0)+(_0x2f1228['countcongestionretry']||0x0)+(_0x2f1228[_0x69a1('0x13')]||0x0)+(_0x2f1228[_0x69a1('0x14')]||0x0)+(_0x2f1228['countdropretry']||0x0)+(_0x2f1228[_0x69a1('0x15')]||0x0)+(_0x2f1228[_0x69a1('0x16')]||0x0)+(_0x2f1228[_0x69a1('0x17')]||0x0);this[_0x69a1('0x14')]=_0x2f1228[_0x69a1('0x14')]||0x0;this[_0x69a1('0x18')]=_0x2f1228[_0x69a1('0x18')]||0x0;this[_0x69a1('0x15')]=_0x2f1228[_0x69a1('0x15')]||0x0;this[_0x69a1('0x16')]=_0x2f1228[_0x69a1('0x16')]||0x0;this[_0x69a1('0x17')]=_0x2f1228[_0x69a1('0x17')]||0x0;this[_0x69a1('0x19')]=_0x2f1228['callback'];this[_0x69a1('0x1a')]=_0x2f1228[_0x69a1('0x1a')];this[_0x69a1('0x1b')]=_0x2f1228['callbackat'];this['recallme']=_0x2f1228[_0x69a1('0x1c')];this[_0x69a1('0x1d')]=_0x2f1228[_0x69a1('0x1d')];this[_0x69a1('0x1e')]=_0x2f1228['ListId'];this[_0x69a1('0x1f')]=_[_0x69a1('0x1')](_0x2f1228[_0x69a1('0xa')])?_0x2f1228['UserId']:_0x2f1228['Agent']['id'];this['VoiceQueueId']=_0x2f1228[_0x69a1('0x20')];this[_0x69a1('0x21')]='';this[_0x69a1('0x22')]='';}Action[_0x69a1('0x23')]['getCaller']=function(){return util[_0x69a1('0xb')](_0x69a1('0x24'),this[_0x69a1('0x25')],this[_0x69a1('0x26')]);};module[_0x69a1('0x27')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 03e4f12..14a1e6a 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 _0xadb8=['dialBusyMaxRetry','scheduledAt','activeContact','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','custom:agentcongestion','congestion','dialCongestionMaxRetry','dialBusyRetryFrequency','AgentReject','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','reason','logAgent','NoSuchNumber','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','createAgentHistory','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','[Preview][execCall][success]','\x20IdHopper:\x20','idContact','custom:agentcalled','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','active','SIP/%s','status','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','Contact.phone','Call\x20unsuccessful','[Preview][getContactPreview]','Empty\x20Contact','ACTIVE','[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','execCall','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','[originateFailure][logOriginateFailure]','syncOriginateResponse','actionid','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','dialQueueProject','channelstate','isUndefined','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destuniqueid','variables','keys','variable','addVariable','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','bluebird','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','../ami','./rpcDb','./action','./util/util','redis','defaults','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','originateresponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','syncNewExten','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','type','outbound','name','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','stringify','format','voice_queue:save','info','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','dialMethod','clockClearZombieChannels','clearZombieChannels','dialPreviewAutoRecallMe','clearZombieChannel','enqueue','isNil','[clearZombieChannels][talking]','Queue','originated:\x20','queue','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','hasOwnProperty','recallMe','agentReadyId','agents','then','length','getDiff','scheduledat','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','setMessage','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','custom:agentnosuchnumber','buildObj','nosuchnumber','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','rescheduleContact','dialNoSuchNumberRetryFrequency','unlockAgent','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','emit','custom:agentconnect','connect','acw','buildAcw','custom:agentcomplete','complete','total','[16]','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','sumBillable','BUSY','outboundBusyCallsDay','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]'];(function(_0x5eb54a,_0x257c99){var _0x282eb4=function(_0x20937e){while(--_0x20937e){_0x5eb54a['push'](_0x5eb54a['shift']());}};_0x282eb4(++_0x257c99);}(_0xadb8,0x1d0));var _0x8adb=function(_0x54a28a,_0x1ba1fe){_0x54a28a=_0x54a28a-0x0;var _0x3da1f1=_0xadb8[_0x54a28a];return _0x3da1f1;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x8adb('0x0'));var uuid=require('uuid');var moment=require(_0x8adb('0x1'));var md5=require(_0x8adb('0x2'));var Redis=require(_0x8adb('0x3'));var config=require(_0x8adb('0x4'));var logger=require(_0x8adb('0x5'))(_0x8adb('0x6'));var loggerAction=require(_0x8adb('0x5'))('actionPreview');var ami=require(_0x8adb('0x7'));var rpcDb=require(_0x8adb('0x8'));var Action=require(_0x8adb('0x9'));var ut=require(_0x8adb('0xa'));config[_0x8adb('0xb')]=_[_0x8adb('0xc')](config[_0x8adb('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x8adb('0xd')]['enqueue']=function(_0x4d986d){this['tail']=this[_0x8adb('0xe')]?this[_0x8adb('0xe')][_0x8adb('0xf')](_0x4d986d):_0x4d986d();};function Preview(_0x45d8ff){this[_0x8adb('0x10')]=new Sequence();this[_0x8adb('0x11')]=_0x45d8ff[_0x8adb('0x12')];this[_0x8adb('0x13')]=_0x45d8ff[_0x8adb('0x13')];this[_0x8adb('0x14')]={};this['agents']=_0x45d8ff['agents'];this['clockClearZombieChannels']=0x0;ami['on'](_0x8adb('0x15'),this['syncOriginateResponse'][_0x8adb('0x16')](this));ami['on'](_0x8adb('0x17'),this[_0x8adb('0x18')]['bind'](this));ami['on'](_0x8adb('0x19'),this[_0x8adb('0x1a')][_0x8adb('0x16')](this));ami['on'](_0x8adb('0x1b'),this[_0x8adb('0x1c')][_0x8adb('0x16')](this));ami['on']('newexten',this[_0x8adb('0x1d')][_0x8adb('0x16')](this));ami['on']('varset',this['syncVarSet'][_0x8adb('0x16')](this));ami['on'](_0x8adb('0x1e'),this[_0x8adb('0x1f')][_0x8adb('0x16')](this));ami['on'](_0x8adb('0x20'),this[_0x8adb('0x21')][_0x8adb('0x16')](this));this[_0x8adb('0x22')](this[_0x8adb('0x11')]);}function emit(_0x2a322d,_0x36c62a,_0x190171){io['to'](_0x2a322d)['emit'](_0x36c62a,_0x190171);}function emitCampaignPreview(_0x548317){if(_0x548317[_0x8adb('0x23')]===_0x8adb('0x24')){var _0x4f33e7={'id':_0x548317['id'],'name':_0x548317[_0x8adb('0x25')],'strategy':_0x548317[_0x8adb('0x26')],'answered':_0x548317[_0x8adb('0x27')],'available':_0x548317[_0x8adb('0x28')],'loggedIn':_0x548317[_0x8adb('0x29')],'pTalking':_0x548317[_0x8adb('0x2a')],'sumBillable':_0x548317['sumBillable'],'sumDuration':_0x548317[_0x8adb('0x2b')],'sumHoldTime':_0x548317[_0x8adb('0x2c')]||0x0,'talking':_0x548317[_0x8adb('0x2d')],'total':_0x548317['total'],'type':_0x548317[_0x8adb('0x23')],'unmanaged':_0x548317[_0x8adb('0x2e')],'abandoned':_0x548317[_0x8adb('0x2f')],'waiting':_0x548317[_0x8adb('0x30')],'loggedInDb':_0x548317[_0x8adb('0x31')],'dialActive':_0x548317[_0x8adb('0x32')],'dialMethod':_0x548317['dialMethod'],'dialOriginateCallerIdName':_0x548317[_0x8adb('0x33')],'dialOriginateCallerIdNumber':_0x548317[_0x8adb('0x34')],'dialOriginateTimeout':_0x548317[_0x8adb('0x35')],'dialPrefix':_0x548317[_0x8adb('0x36')],'outboundAnswerAgiCallsDay':_0x548317[_0x8adb('0x37')],'outboundAnswerCallsDay':_0x548317[_0x8adb('0x38')],'outboundBlacklistCallsDay':_0x548317[_0x8adb('0x39')],'outboundBusyCallsDay':_0x548317['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x548317[_0x8adb('0x3a')],'outboundDropCallsDayACS':_0x548317[_0x8adb('0x3b')],'outboundDropCallsDayCallersExit':_0x548317[_0x8adb('0x3c')],'outboundDropCallsDayTimeout':_0x548317[_0x8adb('0x3d')],'outboundNoAnswerCallsDay':_0x548317['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x548317[_0x8adb('0x3e')],'outboundOriginateFailureCallsDay':_0x548317['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x548317[_0x8adb('0x3f')],'outboundRejectCallsDay':_0x548317[_0x8adb('0x40')],'outboundUnknownCallsDay':_0x548317[_0x8adb('0x41')],'outboundAbandonedCallsDay':_0x548317[_0x8adb('0x42')],'predictiveIntervalAnsweredCalls':_0x548317['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x548317[_0x8adb('0x43')],'predictiveIntervalAvgTalktime':_0x548317['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x548317[_0x8adb('0x44')],'predictiveIntervalDroppedCallsTimeout':_0x548317['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x548317[_0x8adb('0x45')],'predictiveIntervalErlangCallsDroppedCalls':_0x548317[_0x8adb('0x46')],'predictiveIntervalHitRate':_0x548317[_0x8adb('0x47')],'predictiveIntervalMultiplicativeFactor':_0x548317[_0x8adb('0x48')],'predictiveIntervalPauses':_0x548317[_0x8adb('0x49')],'predictiveIntervalAvailable':_0x548317[_0x8adb('0x4a')],'predictiveIntervalTotalCalls':_0x548317['predictiveIntervalTotalCalls'],'message':_0x548317['message'],'originated':_0x548317[_0x8adb('0x4b')],'erlangCalls':_0x548317[_0x8adb('0x4c')],'erlangCallToSecond':_0x548317[_0x8adb('0x4d')],'erlangAbandonmentRate':_0x548317[_0x8adb('0x4e')],'erlangBusyFactor':_0x548317[_0x8adb('0x4f')],'startPredictive':_0x548317[_0x8adb('0x50')],'startProgressive':_0x548317[_0x8adb('0x51')]};if(_0x548317[_0x8adb('0x52')]){_0x4f33e7[_0x8adb('0x52')]={'id':_0x548317[_0x8adb('0x52')]['id'],'name':_0x548317[_0x8adb('0x52')][_0x8adb('0x25')],'active':_0x548317[_0x8adb('0x52')]['active'],'callerid':_0x548317[_0x8adb('0x52')][_0x8adb('0x53')]};}if(_0x548317['Interval']){_0x4f33e7[_0x8adb('0x54')]={'id':_0x548317['Interval']['id'],'name':_0x548317[_0x8adb('0x54')][_0x8adb('0x25')]};}var _0x6c8b25=md5(JSON[_0x8adb('0x55')](_0x4f33e7));if(_0x548317[_0x8adb('0x2')]!==_0x6c8b25){_0x548317['md5']=_0x6c8b25;emit(util[_0x8adb('0x56')]('voice:queue:%s',_0x4f33e7[_0x8adb('0x25')]),_0x8adb('0x57'),_0x4f33e7);}}}function emitVoiceQueueChannelRemove(_0x4a1693){logger[_0x8adb('0x58')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x8adb('0x55')](_0x4a1693));emit(util['format'](_0x8adb('0x59'),_0x4a1693[_0x8adb('0x25')]),_0x8adb('0x5a'),_0x4a1693);io['emit']('voice_queue_presence:remove',_0x4a1693);}function notSendMessagesQueue(_0x182c4b){if(_0x182c4b[_0x8adb('0x5b')]){if(_0x182c4b['originated']===0x0&&_0x182c4b[_0x8adb('0x2a')]===0x0){_0x182c4b[_0x8adb('0x5b')]=![];_0x182c4b[_0x8adb('0x28')]=0x0;_0x182c4b[_0x8adb('0x5c')]=0x0;_0x182c4b[_0x8adb('0x5d')]=_0x8adb('0x5e');ut[_0x8adb('0x5f')](_0x8adb('0x60'),_0x182c4b['name']+'\x20is\x20not\x20active');}else{_0x182c4b[_0x8adb('0x5d')]=_0x8adb('0x61');ut[_0x8adb('0x5f')](_0x8adb('0x60'),_0x182c4b['name']+_0x8adb('0x62'));}emitCampaignPreview(_0x182c4b);}}Preview['prototype'][_0x8adb('0x22')]=function(){var _0x32b764=this;setInterval(function(){_0x32b764[_0x8adb('0x63')]();},0x7cf);};Preview[_0x8adb('0xd')]['syncCampaigns']=function(){var _0x4ef5a3=this[_0x8adb('0x11')];this['clockClearZombieChannels']+=0x1;for(var _0x7a826d in _0x4ef5a3){if(_0x4ef5a3['hasOwnProperty'](_0x7a826d)&&(_0x4ef5a3[_0x7a826d]['dialMethod']===_0x8adb('0x6')||_0x4ef5a3[_0x7a826d][_0x8adb('0x64')]==='booked')&&_0x4ef5a3[_0x7a826d][_0x8adb('0x23')]===_0x8adb('0x24')){if(this[_0x8adb('0x65')]>0x7){this[_0x8adb('0x65')]=0x0;this[_0x8adb('0x66')]();}}if(_0x4ef5a3['hasOwnProperty'](_0x7a826d)&&_0x4ef5a3[_0x7a826d][_0x8adb('0x64')]==='preview'&&_0x4ef5a3[_0x7a826d][_0x8adb('0x23')]===_0x8adb('0x24')){if(_0x4ef5a3[_0x7a826d]['dialActive']){this['setMessage'](_0x4ef5a3[_0x7a826d]);if(_0x4ef5a3[_0x7a826d][_0x8adb('0x67')])this['recallMe'](_0x4ef5a3[_0x7a826d]);}else{notSendMessagesQueue(_0x4ef5a3[_0x7a826d]);}}}};Preview[_0x8adb('0xd')][_0x8adb('0x68')]=function(_0x470d19){var _0x222f06=this;this['sequence'][_0x8adb('0x69')](function(){if(!_[_0x8adb('0x6a')](_0x222f06['actions'][_0x470d19])){loggerAction['info'](_0x8adb('0x6b'),_0x470d19,_0x8adb('0x6c'),_0x222f06[_0x8adb('0x14')][_0x470d19]['queue'],_0x8adb('0x6d'),JSON[_0x8adb('0x55')](_0x222f06[_0x8adb('0x11')][_0x222f06[_0x8adb('0x14')][_0x470d19][_0x8adb('0x6e')]][_0x8adb('0x4b')]),_0x8adb('0x6f'),JSON[_0x8adb('0x55')](_0x222f06[_0x8adb('0x11')][_0x222f06[_0x8adb('0x14')][_0x470d19][_0x8adb('0x6e')]][_0x8adb('0x2a')]),JSON['stringify'](_0x222f06[_0x8adb('0x14')][_0x470d19][_0x8adb('0x70')]),JSON[_0x8adb('0x55')](_[_0x8adb('0x71')](_0x222f06[_0x8adb('0x14')][_0x470d19],[_0x8adb('0x72'),_0x8adb('0x73'),_0x8adb('0x74'),_0x8adb('0x75')])));return ami[_0x8adb('0x76')]({'action':'status','channel':_0x222f06[_0x8adb('0x14')][_0x470d19][_0x8adb('0x77')]})[_0x8adb('0x78')](function(_0x354778){if(_0x354778[_0x8adb('0x5d')]===_0x8adb('0x79')){setTimeout(function(){if(_0x222f06[_0x8adb('0x14')][_0x470d19]){ut[_0x8adb('0x7a')](_0x222f06['campaignsPreview'][_0x222f06[_0x8adb('0x14')][_0x470d19][_0x8adb('0x6e')]],_0x8adb('0x7b'));if(_0x222f06[_0x8adb('0x14')][_0x470d19]['dialAnswer']===!![]){ut[_0x8adb('0x7c')](_0x222f06[_0x8adb('0x11')][_0x222f06[_0x8adb('0x14')][_0x470d19][_0x8adb('0x6e')]],'[clearZombieChannel]');ut[_0x8adb('0x7d')](_0x8adb('0x7e')+_0x470d19,_0x222f06[_0x8adb('0x14')][_0x470d19][_0x8adb('0x6e')]);}ut[_0x8adb('0x7d')](_0x8adb('0x7f')+_0x470d19,_0x222f06[_0x8adb('0x14')][_0x470d19][_0x8adb('0x6e')]);delete _0x222f06[_0x8adb('0x14')][_0x470d19];}},0x2328);}});}});};Preview[_0x8adb('0xd')][_0x8adb('0x66')]=function(){var _0x3adac4=this;loggerAction['info'](_0x8adb('0x80'),_['size'](this['actions']));for(var _0x9b2ef5 in this[_0x8adb('0x14')]){if(_0x3adac4['actions'][_0x8adb('0x81')](_0x9b2ef5)){_0x3adac4[_0x8adb('0x68')](_0x9b2ef5);}}};Preview[_0x8adb('0xd')][_0x8adb('0x82')]=function(_0x545a47){var _0x1689b8=this;rpcDb['getContactRecallMe'](_0x545a47['id'],ut[_0x8adb('0x83')](this[_0x8adb('0x84')]))[_0x8adb('0x85')](function(_0x47a2a4){if(!_[_0x8adb('0x6a')](_0x47a2a4)){for(var _0x50dc53=0x0;_0x50dc53<_0x47a2a4[_0x8adb('0x86')];_0x50dc53+=0x1){if(ut[_0x8adb('0x87')](_0x47a2a4[_0x50dc53][_0x8adb('0x88')])<_0x545a47['dialRecallMeTimeout']*0x3c){if(_0x47a2a4[_0x50dc53][_0x8adb('0x89')]&&!_0x47a2a4[_0x50dc53][_0x8adb('0x89')][_0x8adb('0x8a')]){_0x1689b8[_0x8adb('0x8b')](_0x47a2a4[_0x50dc53]['id'])['then'](ut[_0x8adb('0x8c')](_0x8adb('0x8d')))['catch'](ut[_0x8adb('0x8c')](_0x8adb('0x8d')));}else{rpcDb[_0x8adb('0x8e')](_0x47a2a4[_0x50dc53]['id']);}}else{var _0x583622=new Action(_0x47a2a4[_0x50dc53],_0x545a47);_0x583622[_0x8adb('0x8f')]=moment()[_0x8adb('0x56')](_0x8adb('0x90'));_0x545a47[_0x8adb('0x3f')]+=0x1;ut['logCustomer'](_0x583622,0x17,_0x8adb('0x91'));if(_0x545a47['dialRecallInQueue']){rpcDb['rescheduleContactInQueue'](ut['createBody'](_0x47a2a4[_0x50dc53]));rpcDb[_0x8adb('0x92')](_0x583622,_0x8adb('0x93'));}else{ut[_0x8adb('0x94')](_0x583622,0x16,'RecallFailedTimeout');rpcDb[_0x8adb('0x92')](_0x583622,'[HistoryRecallClose]');rpcDb[_0x8adb('0x95')](_0x583622,_0x8adb('0x96'));}}}}})[_0x8adb('0x78')](ut[_0x8adb('0x8c')](_0x8adb('0x97')));};Preview[_0x8adb('0xd')][_0x8adb('0x98')]=function(_0xa04f70){_0xa04f70[_0x8adb('0x5b')]=!![];if(ut['IsNotLoggedIn'](_0xa04f70[_0x8adb('0x29')])){_0xa04f70[_0x8adb('0x5d')]=_0x8adb('0x99');}else if(!ut[_0x8adb('0x9a')](_0xa04f70['dialActive'])){_0xa04f70[_0x8adb('0x5d')]='NOT_ACTIVE';}else if(!this[_0x8adb('0x9b')](_0xa04f70[_0x8adb('0x52')])){if(!this[_0x8adb('0x9b')](_0xa04f70[_0x8adb('0x9c')])){_0xa04f70['message']=_0x8adb('0x9d');}else{_0xa04f70[_0x8adb('0x5d')]='ACTIVE';}}else{_0xa04f70['message']='ACTIVE';}emitCampaignPreview(_0xa04f70);};Preview[_0x8adb('0xd')][_0x8adb('0x9e')]=function(_0x369a45,_0x551dd9,_0x57d00b){var _0x21efac=this;var _0x2db881=this[_0x8adb('0x14')][_0x551dd9];var _0x5abfb7=this[_0x8adb('0x11')][_0x2db881[_0x8adb('0x6e')]];var _0x466f9c;if(_0x5abfb7){switch(_0x57d00b){case'1':_0x5abfb7[_0x8adb('0x3e')]+=0x1;_0x2db881[_0x8adb('0x9f')]+=0x1;_0x2db881[_0x8adb('0xa0')]=ut['totalGlobal'](_0x2db881);ut[_0x8adb('0x94')](_0x2db881,0x0,'NoSuchNumber');ami['emit'](_0x8adb('0xa1'),ut[_0x8adb('0xa2')](_0x2db881,_0x8adb('0xa3')));rpcDb['createCustomerHistory'](_0x2db881,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0x8adb('0xa4')](_0x2db881)>=_0x5abfb7[_0x8adb('0xa5')]){_0x466f9c=ut[_0x8adb('0xa6')](_0x2db881,0xf,_0x8adb('0xa7'));rpcDb[_0x8adb('0x95')](_0x466f9c,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x2db881[_0x8adb('0x9f')]>=_0x5abfb7['dialNoSuchNumberMaxRetry']){rpcDb['createCustomerFinal'](_0x2db881,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x8adb('0xa8')](ut['scheduledAt'](_0x2db881,_0x8adb('0x9f'),_0x5abfb7[_0x8adb('0xa9')]),_0x2db881[_0x8adb('0xaa')],_0x2db881['activeContact']);}}delete this[_0x8adb('0x14')][_0x369a45[_0x8adb('0xab')]];break;case _0x8adb('0xac'):var _0x525f00=moment()['format'](_0x8adb('0x90'));_0x2db881[_0x8adb('0xad')]=_0x525f00;_0x2db881[_0x8adb('0xae')]=_0x525f00;_0x2db881[_0x8adb('0x70')]=!![];_0x5abfb7[_0x8adb('0x2a')]+=0x1;logger['info'](_0x8adb('0xaf'),_0x2db881[_0x8adb('0xb0')],_0x8adb('0xb1'),_0x5abfb7[_0x8adb('0x25')],'pTalking:\x20',_0x5abfb7[_0x8adb('0x2a')]);ami[_0x8adb('0xb2')](_0x8adb('0xb3'),ut[_0x8adb('0xa2')](_0x2db881,_0x8adb('0xb4'),this[_0x8adb('0x11')][_0x2db881['queue']]));if(_0x5abfb7[_0x8adb('0xb5')]){ami[_0x8adb('0xb2')]('custom:agentConnectPreview',ut[_0x8adb('0xb6')](_0x2db881));}break;case'16':ami[_0x8adb('0xb2')](_0x8adb('0xb7'),ut[_0x8adb('0xa2')](_0x2db881,_0x8adb('0xb8'),this['campaignsPreview'][_0x2db881[_0x8adb('0x6e')]]));emitVoiceQueueChannelRemove(ut[_0x8adb('0xa2')](_0x2db881,_0x8adb('0xb8')));_0x5abfb7[_0x8adb('0x38')]+=0x1;_0x5abfb7[_0x8adb('0xb9')]+=0x1;_0x5abfb7['answered']+=0x1;ut[_0x8adb('0x7c')](_0x5abfb7,_0x8adb('0xba'));_0x2db881[_0x8adb('0xa0')]=ut['totalGlobal'](_0x2db881);ut[_0x8adb('0x94')](_0x2db881,0x4,_0x8adb('0xbb'));rpcDb[_0x8adb('0x92')](_0x2db881,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x8adb('0x95')](_0x2db881,_0x8adb('0xbc'));rpcDb[_0x8adb('0xbd')](_0x2db881);_0x5abfb7[_0x8adb('0x2b')]+=_0x2db881[_0x8adb('0xbe')];_0x5abfb7[_0x8adb('0xbf')]+=_0x2db881[_0x8adb('0xbe')];logger['info']('[syncHangup][talking][decrement]',_0x2db881[_0x8adb('0xb0')],_0x8adb('0xb1'),_0x5abfb7[_0x8adb('0x25')],_0x8adb('0x6f'),_0x5abfb7['pTalking']);delete this[_0x8adb('0x14')][_0x369a45[_0x8adb('0xab')]];break;case _0x8adb('0xc0'):_0x5abfb7[_0x8adb('0xc1')]+=0x1;_0x2db881[_0x8adb('0xc2')]+=0x1;_0x2db881[_0x8adb('0xa0')]=ut[_0x8adb('0xa4')](_0x2db881);ut[_0x8adb('0x94')](_0x2db881,0x5,_0x8adb('0xc3'));ami[_0x8adb('0xb2')](_0x8adb('0xc4'),ut['buildObj'](_0x2db881,_0x8adb('0xc5')));rpcDb[_0x8adb('0x92')](_0x2db881,_0x8adb('0xc6'));if(ut[_0x8adb('0xa4')](_0x2db881)>=_0x5abfb7[_0x8adb('0xa5')]){_0x466f9c=ut[_0x8adb('0xa6')](_0x2db881,0xf,'Global');rpcDb['createCustomerFinal'](_0x466f9c,_0x8adb('0xc7'));}else{if(_0x2db881[_0x8adb('0xc2')]>=_0x5abfb7[_0x8adb('0xc8')]){rpcDb[_0x8adb('0x95')](_0x2db881,_0x8adb('0xc6'));}else{rpcDb[_0x8adb('0xa8')](ut[_0x8adb('0xc9')](_0x2db881,_0x8adb('0xc2'),_0x5abfb7['dialBusyRetryFrequency']),_0x2db881['unlockAgent'],_0x2db881[_0x8adb('0xca')]);}}break;case'NOANSWER':_0x5abfb7['outboundNoAnswerCallsDay']+=0x1;_0x2db881['countnoanswerretry']+=0x1;_0x2db881[_0x8adb('0xa0')]=ut['totalGlobal'](_0x2db881);ut[_0x8adb('0x94')](_0x2db881,0x3,_0x8adb('0xcb'));ami['emit']('custom:agentnoanswer',ut['buildObj'](_0x2db881,'noanswer'));rpcDb[_0x8adb('0x92')](_0x2db881,_0x8adb('0xcc'));if(ut[_0x8adb('0xa4')](_0x2db881)>=_0x5abfb7[_0x8adb('0xa5')]){_0x466f9c=ut[_0x8adb('0xa6')](_0x2db881,0xf,_0x8adb('0xa7'));rpcDb['createCustomerFinal'](_0x466f9c,_0x8adb('0xcd'));}else{if(_0x2db881[_0x8adb('0xce')]>=_0x5abfb7[_0x8adb('0xcf')]){rpcDb[_0x8adb('0x95')](_0x2db881,_0x8adb('0xcc'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x2db881,_0x8adb('0xce'),_0x5abfb7[_0x8adb('0xd0')]),_0x2db881['unlockAgent'],_0x2db881['activeContact']);}}break;case _0x8adb('0xd1'):_0x5abfb7[_0x8adb('0x3a')]+=0x1;_0x2db881[_0x8adb('0xd2')]+=0x1;_0x2db881[_0x8adb('0xa0')]=ut[_0x8adb('0xa4')](_0x2db881);ut[_0x8adb('0x94')](_0x2db881,0x8,'Congestion');ami[_0x8adb('0xb2')](_0x8adb('0xd3'),ut['buildObj'](_0x2db881,_0x8adb('0xd4')));rpcDb[_0x8adb('0x92')](_0x2db881,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0x8adb('0xa4')](_0x2db881)>=_0x5abfb7[_0x8adb('0xa5')]){_0x466f9c=ut[_0x8adb('0xa6')](_0x2db881,0xf,_0x8adb('0xa7'));rpcDb[_0x8adb('0x95')](_0x466f9c,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x2db881[_0x8adb('0xd2')]>=_0x5abfb7[_0x8adb('0xd5')]){rpcDb['createCustomerFinal'](_0x2db881,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x8adb('0xa8')](ut['scheduledAt'](_0x2db881,_0x8adb('0xd2'),_0x5abfb7[_0x8adb('0xd6')]),_0x2db881[_0x8adb('0xaa')],_0x2db881[_0x8adb('0xca')]);}}break;case'CANCEL':_0x5abfb7['outboundRejectCallsDay']+=0x1;_0x2db881['countagentrejectretry']+=0x1;_0x2db881[_0x8adb('0xa0')]=ut[_0x8adb('0xa4')](_0x2db881);ut['logCustomer'](_0x2db881,0x14,_0x8adb('0xd7'));ami[_0x8adb('0xb2')](_0x8adb('0xd8'),ut[_0x8adb('0xa2')](_0x2db881,'agentreject'));rpcDb['createCustomerHistory'](_0x2db881,_0x8adb('0xd9'));if(ut[_0x8adb('0xa4')](_0x2db881)>=_0x5abfb7[_0x8adb('0xa5')]){_0x466f9c=ut[_0x8adb('0xa6')](_0x2db881,0x14,_0x8adb('0xd7'));rpcDb[_0x8adb('0x95')](_0x466f9c,_0x8adb('0xda'));}else{if(_0x2db881[_0x8adb('0xdb')]>=_0x5abfb7[_0x8adb('0xdc')]){rpcDb[_0x8adb('0x95')](_0x2db881,_0x8adb('0xda'));}else{rpcDb[_0x8adb('0xa8')](ut['scheduledAt'](_0x2db881,'countagentrejectretry',_0x5abfb7[_0x8adb('0xdd')]),_0x2db881[_0x8adb('0xaa')],_0x2db881[_0x8adb('0xca')]);}}break;case _0x8adb('0xde'):_0x5abfb7['outboundAbandonedCallsDay']+=0x1;_0x2db881[_0x8adb('0xdf')]+=0x1;_0x2db881[_0x8adb('0xa0')]=ut['totalGlobal'](_0x2db881);ut[_0x8adb('0x94')](_0x2db881,0xb,_0x8adb('0xe0'));rpcDb[_0x8adb('0x92')](_0x2db881,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0x8adb('0xa4')](_0x2db881)>=_0x5abfb7[_0x8adb('0xa5')]){_0x466f9c=ut[_0x8adb('0xa6')](_0x2db881,0xf,_0x8adb('0xa7'));rpcDb[_0x8adb('0x95')](_0x466f9c,_0x8adb('0xe1'));}else{if(_0x2db881[_0x8adb('0xe2')]>=_0x5abfb7[_0x8adb('0xe3')]){rpcDb[_0x8adb('0x95')](_0x2db881,_0x8adb('0xe1'));}else{rpcDb['rescheduleContact'](ut[_0x8adb('0xc9')](_0x2db881,_0x8adb('0xdf'),_0x5abfb7['dialAbandonedRetryFrequency']),_0x2db881[_0x8adb('0xaa')],_0x2db881[_0x8adb('0xca')]);}}break;case'18':_0x5abfb7[_0x8adb('0x41')]+=0x1;_0x2db881['countmachineretry']+=0x1;_0x2db881[_0x8adb('0xa0')]=ut[_0x8adb('0xa4')](_0x2db881);ut['logCustomer'](_0x2db881,0x12,_0x369a45[_0x8adb('0xe4')]||_0x369a45[_0x8adb('0xe5')]);ami[_0x8adb('0xb2')](_0x8adb('0xe6'),ut[_0x8adb('0xa2')](_0x2db881,_0x8adb('0xe7')));rpcDb[_0x8adb('0x92')](_0x2db881,_0x8adb('0xe8'));if(ut['totalGlobal'](_0x2db881)>=_0x5abfb7[_0x8adb('0xa5')]){_0x466f9c=ut[_0x8adb('0xa6')](_0x2db881,0xf,_0x8adb('0xa7'));rpcDb[_0x8adb('0x95')](_0x466f9c,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb['createCustomerFinal'](_0x2db881,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0x8adb('0x14')][_0x369a45[_0x8adb('0xab')]];break;case'19':_0x5abfb7['outboundUnknownCallsDay']+=0x1;_0x2db881[_0x8adb('0xa0')]=ut['totalGlobal'](_0x2db881);ut[_0x8adb('0x94')](_0x2db881,0x13,_0x369a45[_0x8adb('0xe4')]||_0x369a45[_0x8adb('0xe5')]);ami[_0x8adb('0xb2')](_0x8adb('0xe6'),ut[_0x8adb('0xa2')](_0x2db881,_0x8adb('0xe7')));rpcDb[_0x8adb('0x92')](_0x2db881,'[callProgressDetectingCustomer][machine]');if(ut[_0x8adb('0xa4')](_0x2db881)>=_0x5abfb7['dialGlobalMaxRetry']){_0x466f9c=ut['cloneAction'](_0x2db881,0xf,_0x8adb('0xa7'));rpcDb[_0x8adb('0x95')](_0x466f9c,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0x8adb('0x95')](_0x2db881,_0x8adb('0xe9'));}delete this[_0x8adb('0x14')][_0x369a45[_0x8adb('0xab')]];break;default:if(_0x2db881['dialAnswer']){ut[_0x8adb('0x7c')](_0x5abfb7,_0x8adb('0xea'));ut['loggerError'](_0x8adb('0xeb')+_0x5abfb7[_0x8adb('0x25')],_0x369a45);}_0x5abfb7[_0x8adb('0x41')]+=0x1;_0x2db881[_0x8adb('0xa0')]=ut[_0x8adb('0xa4')](_0x2db881);ut['logCustomer'](_0x2db881,0xc,_0x369a45[_0x8adb('0xe4')]||_0x369a45[_0x8adb('0xe5')]);rpcDb[_0x8adb('0x92')](_0x2db881,_0x8adb('0xec'));if(ut[_0x8adb('0xa4')](_0x2db881)>=_0x5abfb7['dialGlobalMaxRetry']){_0x466f9c=ut[_0x8adb('0xa6')](_0x2db881,0xf,_0x8adb('0xa7'));rpcDb[_0x8adb('0x95')](_0x466f9c,_0x8adb('0xed'));}else{rpcDb[_0x8adb('0x95')](_0x2db881,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this['actions'][_0x369a45[_0x8adb('0xab')]];}if(!(_0x2db881[_0x8adb('0x70')]&&_0x57d00b==='16')){ut[_0x8adb('0x7a')](_0x5abfb7,_0x8adb('0xee'));logger[_0x8adb('0x58')](_0x8adb('0xef'),_0x2db881[_0x8adb('0xb0')],_0x8adb('0xb1'),_0x5abfb7[_0x8adb('0x25')],'originated:\x20',_0x5abfb7[_0x8adb('0x4b')]);}if(_0x57d00b!==_0x8adb('0xac')){delete this[_0x8adb('0x14')][_0x369a45['linkedid']];delete this[_0x8adb('0x14')][_0x369a45[_0x8adb('0xf0')]];}}};Preview[_0x8adb('0xd')][_0x8adb('0xf1')]=function(_0x24dc71,_0x3325b8,_0x4d6499){if(_['isUndefined'](_0x3325b8)&&_0x8adb('0xf2')!==typeof _0x3325b8){return;}if(_['isUndefined'](_0x4d6499)&&_0x8adb('0xf2')!==typeof _0x4d6499){return;}switch(_0x4d6499[_0x8adb('0xf3')]){case'0':ut[_0x8adb('0xf4')](_0x24dc71,0x0,_0x8adb('0xf5'));rpcDb['createAgentHistory'](_0x24dc71,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x8adb('0xf4')](_0x24dc71,0x3,'NoAnswer');rpcDb['createAgentHistory'](_0x24dc71,_0x8adb('0xf6'));break;case'5':ut[_0x8adb('0xf4')](_0x24dc71,0x5,_0x8adb('0xc3'));rpcDb['createAgentHistory'](_0x24dc71,_0x8adb('0xf7'));break;case'8':ut[_0x8adb('0xf4')](_0x24dc71,0x8,_0x8adb('0xf8'));rpcDb[_0x8adb('0xf9')](_0x24dc71,_0x8adb('0xfa'));break;case'22':ut[_0x8adb('0xf4')](_0x24dc71,0x16,_0x8adb('0xfb'));rpcDb[_0x8adb('0xf9')](_0x24dc71,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x8adb('0xf4')](_0x24dc71,0xc,_0x4d6499[_0x8adb('0xf3')]);rpcDb[_0x8adb('0xf9')](_0x24dc71,_0x8adb('0xfa'));}ut['updateOriginated'](_0x3325b8,_0x8adb('0xfc'));logger[_0x8adb('0x58')]('[originated][decrement][callProgressDetectingAgent]',_0x24dc71[_0x8adb('0xb0')],_0x8adb('0xb1'),_0x3325b8['name'],_0x8adb('0x6d'),_0x3325b8[_0x8adb('0x4b')]);delete this[_0x8adb('0x14')][_0x24dc71[_0x8adb('0xb0')]];};Preview[_0x8adb('0xd')][_0x8adb('0xfd')]=function(_0xdac51c,_0x35dd98,_0x1e5252,_0x376927,_0x1cccbc){var _0x41e56f=this;return new BPromise(function(_0x42fc08,_0x42e171){if(_[_0x8adb('0x6a')](_0x35dd98)||_['isNil'](_0x35dd98[_0x8adb('0xfe')])||_['isNil'](_0x35dd98[_0x8adb('0xfe')][_0x8adb('0xff')])||_[_0x8adb('0x6a')](_0x35dd98['VoiceQueueId'])){_0x42e171(ut[_0x8adb('0x5d')](_0x8adb('0x100'),_0x376927,_0x1cccbc));return;}var _0x3704a0=uuid['v4']();var _0x5bb96b=_0x41e56f[_0x8adb('0x11')][_0x35dd98[_0x8adb('0x6c')]['name']];var _0x5ef2b8=_0x1e5252?_0x41e56f[_0x8adb('0x84')][_0x1e5252]['id']:undefined;_0x41e56f[_0x8adb('0x14')][_0x3704a0]=new Action(_0x35dd98,_0x5bb96b,_0x3704a0,_0x1e5252,_0x5ef2b8);var _0x1972b7=_0x41e56f[_0x8adb('0x14')][_0x3704a0];_0x1972b7[_0x8adb('0xaa')]=_0x376927;_0x1972b7[_0x8adb('0xca')]=_0x1cccbc;_0x1972b7[_0x8adb('0x101')]=_0x1e5252;if(_[_0x8adb('0x102')](_0xdac51c)){_0x41e56f['execCall'](_0x1972b7,_0x5bb96b,_0x35dd98,_0x1e5252)[_0x8adb('0x85')](function(_0x43528e){logger['info'](_0x8adb('0x103'),'Queue:\x20'+_0x1972b7[_0x8adb('0x6e')]+_0x8adb('0x104')+_0x1972b7[_0x8adb('0x105')],JSON['stringify'](_0x43528e));ami[_0x8adb('0xb2')](_0x8adb('0x106'),ut['buildObj'](_0x1972b7,'called',_0x41e56f[_0x8adb('0x11')][_0x1972b7[_0x8adb('0x6e')]]));_0x42fc08(ut[_0x8adb('0x5d')]('Calling'));})[_0x8adb('0x78')](function(_0x4ca870){ut[_0x8adb('0x5f')](_0x8adb('0x107'),_0x4ca870);_0x42e171(ut[_0x8adb('0x5d')](_0x8adb('0x108'),_0x376927,_0x1cccbc));});}else{_0x5bb96b[_0x8adb('0x39')]+=0x1;ut[_0x8adb('0x109')](_0x1972b7);rpcDb[_0x8adb('0x10a')](_0x1972b7,'[Blacklist][error]');delete _0x41e56f[_0x8adb('0x14')][_0x3704a0];_0x42e171(ut[_0x8adb('0x5d')]('Contact\x20in\x20black\x20List',_0x376927,_0x1cccbc));}});};Preview[_0x8adb('0xd')][_0x8adb('0x9b')]=function(_0x363b77){return!_['isNil'](_0x363b77)&&!_[_0x8adb('0x6a')](_0x363b77[_0x8adb('0x25')])&&!_['isNil'](_0x363b77[_0x8adb('0x10b')])&&_0x363b77[_0x8adb('0x10b')]&&!_[_0x8adb('0x6a')](this[_0x8adb('0x13')][util['format'](_0x8adb('0x10c'),_0x363b77[_0x8adb('0x25')])])&&!_['isNil'](this[_0x8adb('0x13')][util[_0x8adb('0x56')](_0x8adb('0x10c'),_0x363b77[_0x8adb('0x25')])][_0x8adb('0x10d')])&&(this[_0x8adb('0x13')][util[_0x8adb('0x56')](_0x8adb('0x10c'),_0x363b77[_0x8adb('0x25')])]['status']==='reachable'||this['trunks'][util[_0x8adb('0x56')](_0x8adb('0x10c'),_0x363b77[_0x8adb('0x25')])][_0x8adb('0x10d')]===_0x8adb('0x10e'));};Preview['prototype'][_0x8adb('0x8b')]=function(_0x3c35fb,_0x163c9b){var _0x440906=this;return new BPromise(function(_0x2febd9,_0x568ad7){_0x440906[_0x8adb('0x10f')](_0x3c35fb,_0x163c9b)['then'](function(_0x301d1b){_0x2febd9(_[_0x8adb('0x71')](_0x301d1b,['message']));})['catch'](function(_0x254352){if(_0x254352[_0x8adb('0x110')]){rpcDb[_0x8adb('0x111')](_0x3c35fb);}if(_0x254352[_0x8adb('0x10b')]){rpcDb[_0x8adb('0x8e')](_0x3c35fb);}_0x568ad7(_['pick'](_0x254352,[_0x8adb('0x5d')]));});});};Preview['prototype'][_0x8adb('0x10f')]=function(_0x54bbac,_0x3c4581){var _0x4b8e44=this;return new BPromise(function(_0x26bfc5,_0x44204e){var _0x29978c,_0x164946;rpcDb[_0x8adb('0x112')](_0x54bbac)[_0x8adb('0x85')](function(_0x1f279d){if(!_[_0x8adb('0x6a')](_0x1f279d[0x0])){_0x164946=_0x1f279d[0x0][_0x8adb('0x113')]?![]:!![];_0x29978c=_0x1f279d[0x0][_0x8adb('0x113')]?!![]:![];_0x29978c=_0x3c4581?!![]:_0x29978c;}var _0x28977c=_0x4b8e44[_0x8adb('0x114')](_0x1f279d);if(_0x28977c['isValid']){rpcDb['checkIsBlackList'](_['pick'](_0x1f279d[0x0],[_0x8adb('0x74'),_0x8adb('0x115')]))['then'](function(_0x159720){_0x4b8e44[_0x8adb('0xfd')](_0x159720,_0x1f279d[0x0],_0x3c4581,_0x164946,_0x29978c)[_0x8adb('0x85')](function(_0x46686e){_0x26bfc5(_0x46686e);})['catch'](function(_0x29862c){_0x44204e(_0x29862c);});})[_0x8adb('0x78')](function(_0x204438){ut['logger']('[Preview][checkIsBlackList]',_0x204438);_0x44204e(ut[_0x8adb('0x5d')](_0x8adb('0x116'),_0x164946,_0x29978c));});}else{_0x44204e(ut['message'](_0x28977c[_0x8adb('0x5d')],_0x164946,_0x29978c));}})['catch'](function(_0x4d10fd){ut[_0x8adb('0x5f')](_0x8adb('0x117'),_0x4d10fd);_0x44204e(ut[_0x8adb('0x5d')](_0x8adb('0x116'),![],!![]));});});};Preview[_0x8adb('0xd')][_0x8adb('0x114')]=function(_0x3c92f0){if(_[_0x8adb('0x6a')](_0x3c92f0)||_['isEmpty'](_0x3c92f0)||!_[_0x8adb('0x6a')](_0x3c92f0[0x0][_0x8adb('0x89')])&&_['isNil'](_0x3c92f0[0x0][_0x8adb('0x89')][_0x8adb('0x25')])){ut[_0x8adb('0x5f')]('[Preview][validateContact][Empty\x20Contact]',_0x3c92f0);return{'isValid':![],'message':_0x8adb('0x118')};}var _0x426925=this[_0x8adb('0x11')][_0x3c92f0[0x0][_0x8adb('0x6c')][_0x8adb('0x25')]];_0x426925['message']=_0x8adb('0x119');if(_[_0x8adb('0x6a')](_0x426925)){ut[_0x8adb('0x5f')](_0x8adb('0x11a'),_0x426925);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x8adb('0x9b')](_0x426925[_0x8adb('0x52')])){ut[_0x8adb('0x5f')](_0x8adb('0x11b'),_0x8adb('0x11c')+_0x426925[_0x8adb('0x25')]+_0x8adb('0x11d'));if(!this[_0x8adb('0x9b')](_0x426925[_0x8adb('0x9c')])){ut[_0x8adb('0x5f')](_0x8adb('0x11b'),_0x426925[_0x8adb('0x25')]+_0x8adb('0x11e'));return{'isValid':![],'message':_0x8adb('0x11f')};}}if(!ut[_0x8adb('0x9a')](_0x426925[_0x8adb('0x32')])){ut[_0x8adb('0x5f')](_0x8adb('0x120'),_0x426925['name']+_0x8adb('0x121'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x426925[_0x8adb('0x25')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x8adb('0x122')};};Preview[_0x8adb('0xd')][_0x8adb('0x123')]=function(_0xd23894,_0x440865,_0xd8bd09,_0x3dfd05){var _0x3e79a9=this;return new BPromise(function(_0x14d7c6,_0x4c8eee){var _0x2bf25b=_0xd23894[_0x8adb('0xb0')];var _0x16f5fc=_0x3e79a9[_0x8adb('0x9b')](_0x440865[_0x8adb('0x52')])?util[_0x8adb('0x56')](_0x8adb('0x124'),_0x440865[_0x8adb('0x52')][_0x8adb('0x25')],_[_0x8adb('0x6a')](_0x440865[_0x8adb('0x36')])?'':_0x440865[_0x8adb('0x36')][_0x8adb('0x125')]()||'',_0x440865[_0x8adb('0x126')]>0x0?_0xd8bd09[_0x8adb('0xfe')][_0x8adb('0xff')][_0x8adb('0x127')](_0x440865[_0x8adb('0x126')]):_0xd8bd09[_0x8adb('0xfe')][_0x8adb('0xff')]):util['format'](_0x8adb('0x124'),_[_0x8adb('0x6a')](_0x440865['TrunkBackup'])?_0x440865['Trunk']['name']:_0x440865[_0x8adb('0x9c')]['name'],_['isNil'](_0x440865[_0x8adb('0x36')])?'':_0x440865['dialPrefix'][_0x8adb('0x125')]()||'',_0x440865[_0x8adb('0x126')]>0x0?_0xd8bd09[_0x8adb('0xfe')][_0x8adb('0xff')][_0x8adb('0x127')](_0x440865[_0x8adb('0x126')]):_0xd8bd09[_0x8adb('0xfe')][_0x8adb('0xff')]);var _0x527331=_0x3e79a9['isTrunkReachable'](_0x440865[_0x8adb('0x52')])?ut[_0x8adb('0x128')](_0x440865[_0x8adb('0x52')]['callerid'],_0x440865[_0x8adb('0x33')],_0x440865[_0x8adb('0x129')]>0x0?ut[_0x8adb('0x12a')](_0x440865[_0x8adb('0x34')],_0x440865[_0x8adb('0x129')]):_0x440865[_0x8adb('0x34')]):ut[_0x8adb('0x128')](_[_0x8adb('0x6a')](_0x440865[_0x8adb('0x9c')])?_0x440865[_0x8adb('0x52')][_0x8adb('0x53')]:_0x440865[_0x8adb('0x9c')]['callerid'],_0x440865[_0x8adb('0x33')],_0x440865[_0x8adb('0x129')]>0x0?ut[_0x8adb('0x12a')](_0x440865[_0x8adb('0x34')],_0x440865[_0x8adb('0x129')]):_0x440865[_0x8adb('0x34')]);if(_0x527331){_0xd23894[_0x8adb('0x12b')]=ut[_0x8adb('0x12c')](_0x527331);_0xd23894[_0x8adb('0x12d')]=ut[_0x8adb('0x12e')](_0x527331);}var _0x237958=ut[_0x8adb('0x12f')](_0x440865,_0xd8bd09,_0x16f5fc,_0x527331,_0x2bf25b,_0xd23894);_[_0x8adb('0x130')](_0xd23894,ut[_0x8adb('0x131')](_0x237958));_0xd23894[_0x8adb('0x8f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ami['Action'](ut[_0x8adb('0x132')](_0xd23894,_0x440865,_0x237958,_0xd23894[_0x8adb('0xca')],_0x3dfd05))['then'](function(_0x48c92c){_0x440865[_0x8adb('0x4b')]+=0x1;logger[_0x8adb('0x58')]('[originated][increment]',_0x2bf25b,_0x8adb('0xb1'),_0x440865[_0x8adb('0x25')],_0x8adb('0x6d'),_0x440865[_0x8adb('0x4b')]);_0x14d7c6(_0x48c92c);})['catch'](function(_0x13f358){ut[_0x8adb('0xf4')](_0xd23894,0xe,'OriginateError');rpcDb['createAgentHistory'](_0xd23894,_0x8adb('0x133'));_0x4c8eee(_0x13f358);});});};Preview['prototype'][_0x8adb('0x1d')]=function(_0x3824d3){if(this[_0x8adb('0x14')][_0x3824d3['linkedid']]){this[_0x8adb('0x14')][_0x3824d3['linkedid']][_0x8adb('0x77')]=_0x3824d3[_0x8adb('0x77')];}};Preview['prototype'][_0x8adb('0x134')]=function(_0x4ef3b9){var _0x432947=this;var _0x530235=this[_0x8adb('0x14')][_0x4ef3b9[_0x8adb('0x135')]];if(_0x530235){if(_0x530235[_0x8adb('0x101')]&&this['agents'][_0x530235[_0x8adb('0x101')]]){ut['logLookAgent'](_0x530235,this[_0x8adb('0x84')][_0x530235[_0x8adb('0x101')]][_0x8adb('0x25')],this[_0x8adb('0x84')][_0x530235[_0x8adb('0x101')]]['id']);}var _0x1643d7=_['clone'](_0x530235);_0x1643d7[_0x8adb('0xad')]=moment()[_0x8adb('0x56')](_0x8adb('0x90'));var _0x35caa8=_0x432947[_0x8adb('0x11')][_0x530235['queue']];if(ut[_0x8adb('0x136')](_0x4ef3b9[_0x8adb('0x137')])){if(_0x530235['unlockAgent']){rpcDb[_0x8adb('0x111')](_0x530235['idContact']);}if(_0x530235[_0x8adb('0xca')]){rpcDb[_0x8adb('0x8e')](_0x530235['idContact']);}ami[_0x8adb('0xb2')](_0x8adb('0x138'),ut[_0x8adb('0xa2')](_0x530235,_0x8adb('0x139'),this['campaignsPreview'][_0x530235[_0x8adb('0x6e')]]));this[_0x8adb('0xf1')](_0x1643d7,_0x35caa8,_0x4ef3b9);}else{_0x530235[_0x8adb('0x8f')]=moment()[_0x8adb('0x56')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x8adb('0xf4')](_0x1643d7,0x4,'Answer');rpcDb['createAgentHistory'](_0x1643d7,_0x8adb('0x13a'));}}};Preview[_0x8adb('0xd')][_0x8adb('0x18')]=function(_0x30949b){var _0x43571a=this;var _0x2323a3=this['actions'][_0x30949b[_0x8adb('0xab')]];var _0x20f662;if(_0x2323a3){_0x20f662=this[_0x8adb('0x11')][_0x2323a3['queue']];logger['info'](_0x8adb('0x13b'),_0x30949b[_0x8adb('0xab')],_0x8adb('0xb1'),_0x20f662['name'],_0x8adb('0x6f'),_0x20f662[_0x8adb('0x2a')]);}if(this[_0x8adb('0x14')][_0x30949b[_0x8adb('0xab')]]&&_0x30949b['linkedid']!==_0x30949b['uniqueid']){if(_0x30949b['cause']==='16'&&this[_0x8adb('0x14')][_0x30949b[_0x8adb('0xab')]][_0x8adb('0x70')]){this['callProgressDetectingCustomer'](_0x30949b,_0x30949b[_0x8adb('0xab')],_0x30949b[_0x8adb('0x13c')]);}else if(this[_0x8adb('0x14')][_0x30949b[_0x8adb('0xab')]][_0x8adb('0x70')]){logger['info']('[syncHangup][talking][cause]',_0x30949b[_0x8adb('0xab')],_0x30949b['cause'],'\x20Queue',_0x20f662['name'],_0x8adb('0x6f'),_0x20f662[_0x8adb('0x2a')]);this[_0x8adb('0x9e')](_0x30949b,_0x30949b[_0x8adb('0xab')],_0x30949b[_0x8adb('0x13c')]);}}else if(_0x2323a3&&_[_0x8adb('0x6a')](_0x2323a3['statedesc'])&&_0x20f662[_0x8adb('0x13d')]&&_0x30949b[_0x8adb('0xab')]===_0x30949b[_0x8adb('0xb0')]&&_['isNil'](_0x30949b[_0x8adb('0xf3')])&&_0x30949b[_0x8adb('0x13c')]==='16'&&_0x30949b[_0x8adb('0x13e')]==='6'&&_[_0x8adb('0x13f')](_0x2323a3['transfer'])){if(_0x2323a3[_0x8adb('0xaa')]){rpcDb[_0x8adb('0x111')](_0x2323a3[_0x8adb('0x105')]);}if(_0x2323a3[_0x8adb('0xca')]){rpcDb[_0x8adb('0x8e')](_0x2323a3[_0x8adb('0x105')]);}_0x30949b[_0x8adb('0xf3')]='22';this[_0x8adb('0xf1')](_0x2323a3,_0x20f662,_0x30949b);}else if(_0x2323a3&&_0x2323a3[_0x8adb('0x140')]){if(_0x30949b[_0x8adb('0x13c')]==='16'&&this['actions'][_0x30949b[_0x8adb('0xab')]][_0x8adb('0x70')]){logger[_0x8adb('0x58')](_0x8adb('0x141'),_0x30949b[_0x8adb('0xab')],_0x30949b['cause'],_0x8adb('0xb1'),_0x20f662[_0x8adb('0x25')],_0x8adb('0x6f'),_0x20f662[_0x8adb('0x2a')]);this[_0x8adb('0x9e')](_0x30949b,_0x30949b[_0x8adb('0xab')],_0x30949b['cause']);}else if(this['actions'][_0x30949b[_0x8adb('0xab')]][_0x8adb('0x70')]){logger[_0x8adb('0x58')](_0x8adb('0x142'),_0x30949b[_0x8adb('0xab')],_0x30949b[_0x8adb('0x13c')],'\x20Queue',_0x20f662[_0x8adb('0x25')],_0x8adb('0x6f'),_0x20f662[_0x8adb('0x2a')]);this['callProgressDetectingCustomer'](_0x30949b,_0x30949b['linkedid'],_0x30949b[_0x8adb('0x13c')]);}}};Preview[_0x8adb('0xd')][_0x8adb('0x1c')]=function(_0x1bbe19){if(this[_0x8adb('0x14')][_0x1bbe19['destlinkedid']]&&_0x1bbe19['destlinkedid']!==_0x1bbe19[_0x8adb('0x143')]){this['callProgressDetectingCustomer'](_0x1bbe19,_0x1bbe19[_0x8adb('0xf0')],_0x1bbe19['dialstatus']);}};Preview[_0x8adb('0xd')][_0x8adb('0x1a')]=function(_0x2bec64){if(this['actions'][_0x2bec64[_0x8adb('0xab')]]&&_0x2bec64[_0x8adb('0xab')]!==_0x2bec64[_0x8adb('0xb0')]&&!this['actions'][_0x2bec64[_0x8adb('0xab')]][_0x8adb('0x70')]){if(_0x2bec64[_0x8adb('0x13c')]==='1'){this[_0x8adb('0x9e')](_0x2bec64,_0x2bec64[_0x8adb('0xab')],_0x2bec64[_0x8adb('0x13c')]);}}};Preview['prototype']['addVariable']=function(_0x3e4179,_0x31a941,_0x29866d){if(this[_0x8adb('0x14')][_0x3e4179]){if(_[_0x8adb('0x6a')](this['actions'][_0x3e4179][_0x8adb('0x144')])){this[_0x8adb('0x14')][_0x3e4179][_0x8adb('0x144')]={};}this[_0x8adb('0x14')][_0x3e4179]['variables'][_0x31a941]=_0x29866d;}};Preview['prototype']['syncVarSet']=function(_0x570cc9){try{if(!_['isNil'](_0x570cc9)){if(ut['filterKey'](_[_0x8adb('0x145')](_0x570cc9[_0x8adb('0x146')])[0x0])){this[_0x8adb('0x147')](_0x570cc9[_0x8adb('0xb0')],_[_0x8adb('0x145')](_0x570cc9[_0x8adb('0x146')])[0x0],_0x570cc9['value']);}}}catch(_0x250a81){logger['error'](_0x8adb('0x148'),util['inspect'](_0x250a81,{'showHidden':![],'depth':null}));}};Preview[_0x8adb('0xd')][_0x8adb('0x1f')]=function(_0x53d639){if(_0x53d639){if(this['actions'][_0x53d639[_0x8adb('0x149')]]){this[_0x8adb('0x14')][_0x53d639[_0x8adb('0x149')]][_0x8adb('0x140')]=!![];}}};Preview[_0x8adb('0xd')][_0x8adb('0x21')]=function(_0x5e63a3){if(_0x5e63a3){if(this[_0x8adb('0x14')][_0x5e63a3[_0x8adb('0x14a')]]){this[_0x8adb('0x14')][_0x5e63a3[_0x8adb('0x14a')]][_0x8adb('0x140')]=!![];}}};module[_0x8adb('0x14b')]=Preview; \ No newline at end of file +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(_0x1f0679,_0x53d43c){var _0x3dc3a4=function(_0x49ba8f){while(--_0x49ba8f){_0x1f0679['push'](_0x1f0679['shift']());}};_0x3dc3a4(++_0x53d43c);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x58cd2d,_0x224d52){_0x58cd2d=_0x58cd2d-0x0;var _0x511b8e=_0x4d9e[_0x58cd2d];return _0x511b8e;};'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 diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 8d6f452..62c3fb6 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 _0xfcbb=['[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','queue','queuecallerjoinAt','answertime','queuecallercompleteAt','endtime','connectedlinename','membername','from-sip','xcally-motion-preview','holdtime','lastAssignedTo','create','getContactRecallMe','[GetContactRecallMe]\x20','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/agentReportPreview','error','inspect','resolve','then','catch','[createHistory]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createHistory','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0xfcbb,0x10b));var _0xbfcb=function(_0x533eb0,_0x3f2cc5){_0x533eb0=_0x533eb0-0x0;var _0x126ce1=_0xfcbb[_0x533eb0];return _0x126ce1;};'use strict';var util=require(_0xbfcb('0x0'));var BPromise=require('bluebird');var logger=require(_0xbfcb('0x1'))(_0xbfcb('0x2'));var _=require(_0xbfcb('0x3'));var cmHopper=require(_0xbfcb('0x4'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xbfcb('0x5'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0xbfcb('0x6'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0xea0e1f){return function(_0x251b71){logger[_0xbfcb('0x7')](_0xea0e1f,util[_0xbfcb('0x8')](_0x251b71,{'showHidden':![],'depth':null}));};}function create(_0x15c4bc){return BPromise[_0xbfcb('0x9')]()[_0xbfcb('0xa')](cmHopperHistory['createHistory'](_0x15c4bc))[_0xbfcb('0xb')](loggerCatch(_0xbfcb('0xc')));}function createAgent(_0x4ddf8b){return BPromise[_0xbfcb('0x9')]()[_0xbfcb('0xa')](agentReportPreview['createHistory'](_0x4ddf8b))['catch'](loggerCatch(_0xbfcb('0xc')));}function moveContact(_0x4fe6e8){return BPromise[_0xbfcb('0x9')]()[_0xbfcb('0xa')](cmHopper['moveContactManagedDialer'](_0x4fe6e8,!![]))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xbfcb('0xd')]=function(_0x2bc96b){return BPromise[_0xbfcb('0x9')]()['then'](cmHopperBlack['checkIsBlackList'](_0x2bc96b))['catch'](loggerCatch(_0xbfcb('0xe')));};exports[_0xbfcb('0xf')]=function(_0x1b9f0d){return BPromise[_0xbfcb('0x9')]()['then'](cmHopper[_0xbfcb('0xf')](_0x1b9f0d))['catch'](loggerCatch(_0xbfcb('0x10')));};exports[_0xbfcb('0x11')]=function(_0x4d78b8,_0x3cd61e){create(_0x4d78b8)[_0xbfcb('0xb')](loggerCatch(_0x3cd61e));moveContact(_0x4d78b8)[_0xbfcb('0xb')](loggerCatch(_0x3cd61e));};exports[_0xbfcb('0x12')]=function(_0x2fbba5,_0x139e1d){createAgent(_0x2fbba5)[_0xbfcb('0xb')](loggerCatch(_0x139e1d));};exports[_0xbfcb('0x13')]=function(_0x421b6b,_0x42a545){create(_0x421b6b)['catch'](loggerCatch(_0x42a545));};exports[_0xbfcb('0x14')]=function(_0x3fdbb9,_0x5b7f37){moveContact(_0x3fdbb9)['catch'](loggerCatch(_0x5b7f37));};exports[_0xbfcb('0x15')]=function(_0xc3b22a,_0x439082,_0x4b02c6){if(_0x439082){_0xc3b22a[_0xbfcb('0x16')]=null;}if(_0x4b02c6){_0xc3b22a[_0xbfcb('0x17')]=![];}return BPromise['resolve']()[_0xbfcb('0xa')](cmHopper[_0xbfcb('0x15')](_0xc3b22a))['catch'](loggerCatch(_0xbfcb('0x18')));};exports[_0xbfcb('0x19')]=function(_0x12770){return BPromise[_0xbfcb('0x9')]()[_0xbfcb('0xa')](cmHopper[_0xbfcb('0x19')](_0x12770))['catch'](loggerCatch('[countReScheduled]\x20'));};exports['unlockContact']=function(_0x55619d){return BPromise[_0xbfcb('0x9')]()[_0xbfcb('0xa')](cmHopper[_0xbfcb('0x1a')]({'UserId':null},_0x55619d,0x1))['catch'](loggerCatch(_0xbfcb('0x1b')));};exports[_0xbfcb('0x1c')]=function(_0x8f9da8){return BPromise[_0xbfcb('0x9')]()[_0xbfcb('0xa')](cmHopper[_0xbfcb('0x1a')]({'active':![]},_0x8f9da8,0x1))[_0xbfcb('0xb')](loggerCatch(_0xbfcb('0x1d')));};exports[_0xbfcb('0x1e')]=function(_0x13acdd){var _0x2a92f6={};_0x2a92f6[_0xbfcb('0x1f')]=_0x13acdd[_0xbfcb('0x1f')];_0x2a92f6[_0xbfcb('0x20')]=_0x13acdd['uniqueid'];_0x2a92f6[_0xbfcb('0x21')]=_0x13acdd[_0xbfcb('0x21')];_0x2a92f6['calleridname']=_0x13acdd['calleridname'];_0x2a92f6['queue']=_0x13acdd[_0xbfcb('0x22')];_0x2a92f6[_0xbfcb('0x23')]=_0x13acdd[_0xbfcb('0x24')];_0x2a92f6['queuecallerleaveAt']=_0x13acdd[_0xbfcb('0x24')];_0x2a92f6['queuecallercomplete']=0x1;_0x2a92f6[_0xbfcb('0x25')]=_0x13acdd[_0xbfcb('0x26')];_0x2a92f6[_0xbfcb('0x27')]=_0x13acdd[_0xbfcb('0x28')];_0x2a92f6['context']=_0xbfcb('0x29');_0x2a92f6['exten']=_0xbfcb('0x2a');_0x2a92f6[_0xbfcb('0x2b')]=0x0;_0x2a92f6['assigned']=0x1;_0x2a92f6[_0xbfcb('0x2c')]=_0x13acdd['membername'];_0x2a92f6['queuecallerexitreason']='COMPLETED';return BPromise[_0xbfcb('0x9')]()['then'](voiceQueueReport[_0xbfcb('0x2d')](_0x2a92f6))[_0xbfcb('0xb')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0xbfcb('0x2e')]=function(_0x10e942,_0x3721b6){return BPromise[_0xbfcb('0x9')]()[_0xbfcb('0xa')](cmHopper[_0xbfcb('0x2e')](_0x10e942,_0x3721b6))[_0xbfcb('0xb')](loggerCatch(_0xbfcb('0x2f')));};exports['rescheduleContactInQueue']=function(_0x3b2d78){return BPromise[_0xbfcb('0x9')]()[_0xbfcb('0xa')](cmHopper[_0xbfcb('0x15')](_0x3b2d78,!![],!![]))[_0xbfcb('0xb')](loggerCatch(_0xbfcb('0x30')));}; \ No newline at end of file +var _0xdf93=['disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','COMPLETED','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','[createHistory]\x20','catch','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20'];(function(_0x16f227,_0x3ae25c){var _0x32845c=function(_0x30eb0c){while(--_0x30eb0c){_0x16f227['push'](_0x16f227['shift']());}};_0x32845c(++_0x3ae25c);}(_0xdf93,0x15e));var _0x3df9=function(_0x59e067,_0x377449){_0x59e067=_0x59e067-0x0;var _0x3a2d0d=_0xdf93[_0x59e067];return _0x3a2d0d;};'use strict';var util=require(_0x3df9('0x0'));var BPromise=require(_0x3df9('0x1'));var logger=require(_0x3df9('0x2'))(_0x3df9('0x3'));var _=require(_0x3df9('0x4'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x3df9('0x5'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x3df9('0x6'));var voiceQueueRt=require(_0x3df9('0x7'));var agentReportPreview=require(_0x3df9('0x8'));var voiceQueueReport=require(_0x3df9('0x9'));function loggerCatch(_0x242312){return function(_0x5a6515){logger[_0x3df9('0xa')](_0x242312,util[_0x3df9('0xb')](_0x5a6515,{'showHidden':![],'depth':null}));};}function create(_0x1518ef){return BPromise[_0x3df9('0xc')]()[_0x3df9('0xd')](cmHopperHistory[_0x3df9('0xe')](_0x1518ef))['catch'](loggerCatch(_0x3df9('0xf')));}function createAgent(_0x13effe){return BPromise['resolve']()[_0x3df9('0xd')](agentReportPreview[_0x3df9('0xe')](_0x13effe))[_0x3df9('0x10')](loggerCatch(_0x3df9('0xf')));}function moveContact(_0x34f246){return BPromise[_0x3df9('0xc')]()[_0x3df9('0xd')](cmHopper['moveContactManagedDialer'](_0x34f246,!![]))[_0x3df9('0x10')](loggerCatch('[moveContactManagedDialer]\x20'));}exports['checkIsBlackList']=function(_0x6d8a0){return BPromise[_0x3df9('0xc')]()[_0x3df9('0xd')](cmHopperBlack['checkIsBlackList'](_0x6d8a0))[_0x3df9('0x10')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x3df9('0x11')]=function(_0x20c229){return BPromise[_0x3df9('0xc')]()['then'](cmHopper[_0x3df9('0x11')](_0x20c229))[_0x3df9('0x10')](loggerCatch(_0x3df9('0x12')));};exports[_0x3df9('0xe')]=function(_0x27b4b8,_0xb98086){create(_0x27b4b8)[_0x3df9('0x10')](loggerCatch(_0xb98086));moveContact(_0x27b4b8)[_0x3df9('0x10')](loggerCatch(_0xb98086));};exports[_0x3df9('0x13')]=function(_0x4ead92,_0x152d36){createAgent(_0x4ead92)[_0x3df9('0x10')](loggerCatch(_0x152d36));};exports['createCustomerHistory']=function(_0x353ff3,_0x1fbe58){create(_0x353ff3)[_0x3df9('0x10')](loggerCatch(_0x1fbe58));};exports[_0x3df9('0x14')]=function(_0x4932a3,_0x2ea414){moveContact(_0x4932a3)[_0x3df9('0x10')](loggerCatch(_0x2ea414));};exports[_0x3df9('0x15')]=function(_0x5c25b0,_0x2b60a6,_0x59c86f){if(_0x2b60a6){_0x5c25b0['UserId']=null;}if(_0x59c86f){_0x5c25b0[_0x3df9('0x16')]=![];}return BPromise[_0x3df9('0xc')]()[_0x3df9('0xd')](cmHopper[_0x3df9('0x15')](_0x5c25b0))[_0x3df9('0x10')](loggerCatch(_0x3df9('0x17')));};exports[_0x3df9('0x18')]=function(_0x364d00){return BPromise[_0x3df9('0xc')]()[_0x3df9('0xd')](cmHopper[_0x3df9('0x18')](_0x364d00))[_0x3df9('0x10')](loggerCatch(_0x3df9('0x19')));};exports[_0x3df9('0x1a')]=function(_0x147234){return BPromise[_0x3df9('0xc')]()['then'](cmHopper[_0x3df9('0x1a')]({'UserId':null},_0x147234,0x1))[_0x3df9('0x10')](loggerCatch(_0x3df9('0x1b')));};exports[_0x3df9('0x1c')]=function(_0x9418a3){return BPromise[_0x3df9('0xc')]()[_0x3df9('0xd')](cmHopper[_0x3df9('0x1a')]({'active':![]},_0x9418a3,0x1))['catch'](loggerCatch(_0x3df9('0x1d')));};exports[_0x3df9('0x1e')]=function(_0x1363da){var _0x4facc1={};_0x4facc1['type']=_0x1363da[_0x3df9('0x1f')];_0x4facc1[_0x3df9('0x20')]=_0x1363da[_0x3df9('0x20')];_0x4facc1[_0x3df9('0x21')]=_0x1363da[_0x3df9('0x21')];_0x4facc1[_0x3df9('0x22')]=_0x1363da[_0x3df9('0x22')];_0x4facc1['queue']=_0x1363da[_0x3df9('0x23')];_0x4facc1[_0x3df9('0x24')]=_0x1363da['answertime'];_0x4facc1[_0x3df9('0x25')]=_0x1363da[_0x3df9('0x26')];_0x4facc1[_0x3df9('0x27')]=0x1;_0x4facc1[_0x3df9('0x28')]=_0x1363da['endtime'];_0x4facc1[_0x3df9('0x29')]=_0x1363da[_0x3df9('0x2a')];_0x4facc1[_0x3df9('0x2b')]='from-sip';_0x4facc1[_0x3df9('0x2c')]=_0x3df9('0x2d');_0x4facc1[_0x3df9('0x2e')]=0x0;_0x4facc1[_0x3df9('0x2f')]=0x1;_0x4facc1[_0x3df9('0x30')]=_0x1363da['membername'];_0x4facc1['queuecallerexitreason']=_0x3df9('0x31');return BPromise[_0x3df9('0xc')]()['then'](voiceQueueReport['create'](_0x4facc1))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x3df9('0x32')]=function(_0x1e017a,_0x388511){return BPromise[_0x3df9('0xc')]()[_0x3df9('0xd')](cmHopper[_0x3df9('0x32')](_0x1e017a,_0x388511))[_0x3df9('0x10')](loggerCatch(_0x3df9('0x33')));};exports[_0x3df9('0x34')]=function(_0x1f61ff){return BPromise[_0x3df9('0xc')]()['then'](cmHopper[_0x3df9('0x15')](_0x1f61ff,!![],!![]))['catch'](loggerCatch(_0x3df9('0x35')));}; \ 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 1fb2289..3d008e7 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 _0x3410=['xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','random','extractCalleridName','match','util','lodash','preview','env','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','info','loggerError','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','monitor_format','_XCALLY_MIXMONITOR_FORMAT','Contact','createdAt','updatedAt','XMD-','toUpper','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','endtime','logAgent','responsetime','membername','UserId','state','ringtime','talktime','answertime','Failure','BOOKED','uniqueid','originate','channelAgent','xcally-motion-preview','from-sip','timeout','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','queue','interface','motionChannel','voice','mandatoryDisposition','buildAcw','agentReadyId','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','callbackuniqueid','callbackat','sipcallid','xmd-voicequeueid','xmd-queue','xmd-dialurl'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x3410,0x1b6));var _0x0341=function(_0x9b58c3,_0x5883b5){_0x9b58c3=_0x9b58c3-0x0;var _0x31252f=_0x3410[_0x9b58c3];return _0x31252f;};'use strict';var util=require(_0x0341('0x0'));var _=require(_0x0341('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')(_0x0341('0x2'));var ipAgi=process[_0x0341('0x3')]['XCALLY_IP_AGI']||_0x0341('0x4');function getSeconds(_0x32cc74,_0x5ebdcc){var _0x53a0ea=moment(_0x32cc74)[_0x0341('0x5')](0x0);var _0x1692e8=moment(_0x5ebdcc)['milliseconds'](0x0);return _0x53a0ea[_0x0341('0x6')](_0x1692e8,_0x0341('0x7'));}exports[_0x0341('0x8')]=function(_0x1d0617){return function(_0x366f88){logger[_0x0341('0x9')](_0x1d0617,util[_0x0341('0xa')](_0x366f88,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0xb2c50e,_0x2350df){logger[_0x0341('0xb')](_0xb2c50e,util[_0x0341('0xa')](_0x2350df,{'showHidden':![],'depth':null}));};exports[_0x0341('0xc')]=function(_0x3824ec,_0x356d66){logger[_0x0341('0x9')](_0x3824ec,util[_0x0341('0xa')](_0x356d66,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x5e333e){return function(_0x2753ad){logger[_0x0341('0xb')](_0x5e333e,util[_0x0341('0xa')](_0x2753ad,{'showHidden':![],'depth':null}));};};exports[_0x0341('0xd')]=function(_0x3d2291,_0x1296ba,_0x56afe9){return{'message':_0x3d2291,'unlock':_0x1296ba,'active':_0x56afe9};};exports[_0x0341('0xe')]=function(_0x2006e2,_0x2dde13,_0x5a4316){if(!_[_0x0341('0xf')](_0x5a4316)&&_0x0341('0x10')===typeof _0x5a4316&&!_['isEmpty'](_0x5a4316)){if(!_[_0x0341('0xf')](_0x2dde13)&&_0x0341('0x10')===typeof _0x2dde13&&!_[_0x0341('0x11')](_0x2dde13)){return util[_0x0341('0x12')](_0x0341('0x13'),_0x2dde13,_0x5a4316);}return util['format'](_0x0341('0x13'),_0x5a4316,_0x5a4316);}if(!_['isUndefined'](_0x2006e2)&&_0x0341('0x10')===typeof _0x2006e2&&!_[_0x0341('0x11')](_0x2006e2)){return _0x2006e2;}return _0x0341('0x14');};exports[_0x0341('0x15')]=function(_0x36237b){if(_[_0x0341('0x16')](_0x36237b)){return![];}return _0x36237b;};exports[_0x0341('0x17')]=function(_0x1cef1e,_0x2c7f03,_0x27c2b0,_0x4d1c4f,_0xf8f9e7,_0xedb25a){var _0x353149={'XMD-QUEUE':_0x2c7f03[_0x0341('0x18')]?_0x2c7f03[_0x0341('0x18')][_0x0341('0x19')]:'','XMD-CALLERID':_0x4d1c4f,'XMD-CALLERID-PREVIEW':_0xedb25a?util['format'](_0x0341('0x13'),_0xedb25a[_0x0341('0x1a')],_0xedb25a[_0x0341('0x1b')]):_0x4d1c4f,'XMD-DIALID':_0xf8f9e7,'XMD-CONTACTID':_0x2c7f03[_0x0341('0x1c')],'XMD-CDRTYPE':_0x0341('0x1d'),'CALLERID(all)':_0x4d1c4f,'XMD-VOICEQUEUEID':_0x2c7f03[_0x0341('0x1e')],'XMD-DIALCHANNEL':_0x27c2b0,'XMD-DIALTIMEOUT':_0x1cef1e['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x1cef1e[_0x0341('0x1f')]?'g':'',_['isEmpty'](_0x1cef1e['monitor_format'])?'':_0x0341('0x20')),'XMD-DIALURL':_0x1cef1e[_0x0341('0x21')]||'','XMD-AGI':_0x1cef1e[_0x0341('0x22')]?util[_0x0341('0x12')](_0x0341('0x23'),ipAgi,_0x1cef1e[_0x0341('0x22')]):_0x0341('0x24'),'XMD-AGIAFTER':_0x1cef1e[_0x0341('0x1f')]?util['format'](_0x0341('0x23'),ipAgi,_0x1cef1e[_0x0341('0x1f')]):_0x0341('0x24'),'XMD-ORIGINATECALLERIDNUM':_0xedb25a?_0xedb25a[_0x0341('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0xedb25a?_0xedb25a['originatecalleridname']:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x0341('0x11')](_0x1cef1e[_0x0341('0x26')])){_0x353149[util[_0x0341('0x12')]('%s',_0x0341('0x27'))]=_0x1cef1e['monitor_format'];_0x353149[util[_0x0341('0x12')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0xf8f9e7;}if(_0x2c7f03&&_0x2c7f03['Contact']){for(var _0xc6decf in _0x2c7f03[_0x0341('0x28')]){if(_0x2c7f03[_0x0341('0x28')]['hasOwnProperty'](_0xc6decf)){if(!_[_0x0341('0x16')](_0x2c7f03['Contact'][_0xc6decf])&&_0xc6decf!=='id'&&_0xc6decf!=='tags'&&_0xc6decf!==_0x0341('0x29')&&_0xc6decf!==_0x0341('0x2a')){_0x353149[util[_0x0341('0x12')]('%s%s',_0x0341('0x2b'),_[_0x0341('0x2c')](_0xc6decf))]=_0x2c7f03[_0x0341('0x28')][_0xc6decf];}}}}return _0x353149;};exports[_0x0341('0x2d')]=function(_0x5b88c3){var _0x52df17={};for(var _0xabf19f in _0x5b88c3){if(_0x5b88c3[_0x0341('0x2e')](_0xabf19f)){_0x52df17[util[_0x0341('0x12')]('%s',_[_0x0341('0x2f')](_0xabf19f))]=_0x5b88c3[_0xabf19f];}}return{'variables':_0x52df17};};exports[_0x0341('0x30')]=function(_0x37e253,_0x3706de){if(!_[_0x0341('0x16')](_0x37e253)){if(_0x37e253[_0x0341('0x2e')](_0x0341('0x31'))){if(_0x37e253[_0x0341('0x31')]>0x0){_0x37e253[_0x0341('0x31')]-=0x1;}else{logger[_0x0341('0x9')](_0x0341('0x32'),_0x3706de);}}}else{logger[_0x0341('0x9')](_0x0341('0x33'),_0x3706de);}};exports[_0x0341('0x34')]=function(_0x3deee8){var _0x2a3874=moment()[_0x0341('0x12')](_0x0341('0x35'));_0x3deee8['state']=0xd;_0x3deee8[_0x0341('0x36')]=_0x0341('0x37');_0x3deee8[_0x0341('0x38')]=_0x2a3874;_0x3deee8['responsetime']=_0x2a3874;_0x3deee8[_0x0341('0x39')]=_0x2a3874;};exports[_0x0341('0x3a')]=function(_0x1ac482,_0x343d9b,_0x32529f){var _0x40c3f9=moment()[_0x0341('0x12')](_0x0341('0x35'));_0x1ac482['state']=_0x343d9b;_0x1ac482[_0x0341('0x36')]=_0x32529f;_0x1ac482[_0x0341('0x3b')]=_0x40c3f9;_0x1ac482['ringtime']=getSeconds(_0x1ac482[_0x0341('0x3b')],_0x1ac482['starttime']);};exports['logLookAgent']=function(_0x5696f4,_0x4ca213,_0x4c5250){_0x5696f4[_0x0341('0x3c')]=_0x4ca213;_0x5696f4[_0x0341('0x3d')]=_0x4c5250;};exports['logCustomer']=function(_0x2d238b,_0x4c9c01,_0x356f93){var _0x2ad8dd=moment()[_0x0341('0x12')](_0x0341('0x35'));_0x2d238b[_0x0341('0x3e')]=_0x4c9c01;_0x2d238b[_0x0341('0x36')]=_0x356f93;_0x2d238b[_0x0341('0x3b')]=_0x2d238b[_0x0341('0x3b')]?_0x2d238b[_0x0341('0x3b')]:_0x2ad8dd;_0x2d238b[_0x0341('0x39')]=_0x2d238b['endtime']?_0x2d238b['endtime']:_0x2ad8dd;_0x2d238b[_0x0341('0x3f')]=getSeconds(_0x2d238b['responsetime']||0x0,_0x2d238b['starttime']||0x0);_0x2d238b[_0x0341('0x40')]=_0x2d238b[_0x0341('0x41')]?getSeconds(_0x2d238b['endtime'],_0x2d238b[_0x0341('0x41')]):0x0;};exports['isFailure']=function(_0x1772b0){return _0x1772b0===_0x0341('0x42');};exports['variablesAction']=function(_0xc7c056,_0x9620e4,_0x39604f,_0x30d6b0,_0x12ae40){var _0x4ced40=_0x30d6b0?'RECALL':_0xc7c056[_0x0341('0x1a')];_0x4ced40=_0x12ae40?_0x0341('0x43'):_0x4ced40;return{'actionid':_0xc7c056[_0x0341('0x44')],'action':_0x0341('0x45'),'channel':_0xc7c056[_0x0341('0x46')],'callerid':util[_0x0341('0x12')]('\x22%s\x22\x20<%s>',_0x4ced40,_0xc7c056[_0x0341('0x1b')]),'Exten':_0x0341('0x47'),'Context':_0x0341('0x48'),'Priority':'1','variable':_0x39604f,'timeout':(_0x9620e4[_0x0341('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0xc7c056[_0x0341('0x44')]};};exports['totalGlobal']=function(_0x18cdf3){return _0x18cdf3[_0x0341('0x4a')]+_0x18cdf3[_0x0341('0x4b')]+_0x18cdf3[_0x0341('0x4c')]+_0x18cdf3[_0x0341('0x4d')]+_0x18cdf3[_0x0341('0x4e')];};exports[_0x0341('0x4f')]=function(_0x4d2dbb){var _0xc980e9=_[_0x0341('0x50')](_0x4d2dbb);_0xc980e9[_0x0341('0x3e')]=0xf;_0xc980e9['statedesc']=_0x0341('0x51');return _0xc980e9;};exports[_0x0341('0x52')]=function(_0x445758,_0x5ba0e5,_0x377c30){var _0x5d4c84={};_0x5d4c84[_0x5ba0e5]=_0x445758[_0x5ba0e5];_0x5d4c84[_0x0341('0x53')]=![];_0x5d4c84[_0x0341('0x54')]=moment()[_0x0341('0x55')](_0x377c30,_0x0341('0x56'))[_0x0341('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x5d4c84[_0x0341('0x1c')]=_0x445758[_0x0341('0x1c')];_0x5d4c84[_0x0341('0x57')]=_0x445758[_0x0341('0x57')];_0x5d4c84['VoiceQueueId']=_0x445758[_0x0341('0x1e')]||undefined;return _0x5d4c84;};exports['decrementTalkink']=function(_0x24ba76,_0x1bbb7c){if(!_[_0x0341('0x16')](_0x24ba76)){if(_0x24ba76[_0x0341('0x58')]>0x0){_0x24ba76['pTalking']-=0x1;}else{logger[_0x0341('0x9')](_0x1bbb7c,_0x0341('0x59'));}}else{logger[_0x0341('0x9')](_0x1bbb7c,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x0341('0x5a')]=function(_0x3cc083){if(_0x3cc083<=0x0){return!![];}return![];};exports['buildObj']=function(_0x30078d,_0x22de65,_0x2ef21c){_0x30078d['lastevent']=_0x22de65;_0x30078d['name']=_0x30078d[_0x0341('0x5b')];_0x30078d[_0x0341('0x5c')]=_0x30078d[_0x0341('0x46')];_0x30078d[_0x0341('0x5d')]=_0x0341('0x5e');if(_0x2ef21c){_0x30078d[_0x0341('0x5f')]=_0x2ef21c['mandatoryDisposition'];}return _0x30078d;};exports[_0x0341('0x60')]=function(_0x508948){var _0x1ba61f={};_0x1ba61f['queue']=_0x508948[_0x0341('0x5b')];_0x1ba61f[_0x0341('0x5c')]=_0x508948[_0x0341('0x46')];_0x1ba61f[_0x0341('0x44')]=_0x508948[_0x0341('0x44')];return _0x1ba61f;};exports[_0x0341('0x61')]=function(_0x1a1d37){var _0x320fb4=[];for(var _0x248473 in _0x1a1d37){if(_0x1a1d37[_0x0341('0x2e')](_0x248473)){if(!_[_0x0341('0x16')](_0x1a1d37[_0x248473])&&_0x1a1d37[_0x248473][_0x0341('0x3e')]==='not_inuse'&&_0x1a1d37[_0x248473]['status']===_0x0341('0x62')){_0x320fb4[_0x0341('0x63')](_0x1a1d37[_0x248473]['id']);}}}return _0x320fb4;};exports[_0x0341('0x64')]=function(_0x1425ea){var _0x4e4b1b=moment()[_0x0341('0x5')](0x0);var _0x152fd4=moment(_0x1425ea)[_0x0341('0x5')](0x0);return _0x4e4b1b[_0x0341('0x6')](_0x152fd4,_0x0341('0x7'));};exports[_0x0341('0x65')]=function(_0x5a75b8){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5a75b8[_0x0341('0x1c')],'ListId':_0x5a75b8[_0x0341('0x57')],'VoiceQueueId':_0x5a75b8[_0x0341('0x1e')]||undefined,'CampaignId':_0x5a75b8[_0x0341('0x66')]||undefined};};exports[_0x0341('0x67')]=function(_0x2f5c71){if(_0x2f5c71===_0x0341('0x44')||_0x2f5c71===_0x0341('0x68')||_0x2f5c71===_0x0341('0x5b')||_0x2f5c71===_0x0341('0x69')||_0x2f5c71===_0x0341('0x6a')||_0x2f5c71===_0x0341('0x6b')||_0x2f5c71===_0x0341('0x3c')||_0x2f5c71===_0x0341('0x46')||_0x2f5c71===_0x0341('0x1a')||_0x2f5c71===_0x0341('0x53')||_0x2f5c71===_0x0341('0x1b')||_0x2f5c71===_0x0341('0x54')||_0x2f5c71==='countbusyretry'||_0x2f5c71==='countcongestionretry'||_0x2f5c71===_0x0341('0x4c')||_0x2f5c71==='countglobal'||_0x2f5c71==='callback'||_0x2f5c71===_0x0341('0x6c')||_0x2f5c71===_0x0341('0x6d')||_0x2f5c71==='recallme'||_0x2f5c71===_0x0341('0x1c')||_0x2f5c71==='ListId'||_0x2f5c71===_0x0341('0x3d')||_0x2f5c71===_0x0341('0x1e')||_0x2f5c71===_0x0341('0x6e')||_0x2f5c71===_0x0341('0x6f')||_0x2f5c71===_0x0341('0x70')||_0x2f5c71==='xmd-phone'||_0x2f5c71==='xmd-listid'||_0x2f5c71===_0x0341('0x71')||_0x2f5c71==='xmd-dialtimeout'||_0x2f5c71===_0x0341('0x72')||_0x2f5c71===_0x0341('0x73')||_0x2f5c71===_0x0341('0x74')||_0x2f5c71===_0x0341('0x75')||_0x2f5c71===_0x0341('0x76')||_0x2f5c71===_0x0341('0x77')||_0x2f5c71===_0x0341('0x78')||_0x2f5c71===_0x0341('0x79')||_0x2f5c71===_0x0341('0x7a')||_0x2f5c71==='rtpaudioqosbridged'||_0x2f5c71===_0x0341('0x7b')||_0x2f5c71===_0x0341('0x7c')||_0x2f5c71===_0x0341('0x7d')||_0x2f5c71===_0x0341('0x7e')||_0x2f5c71===_0x0341('0x7f')||_0x2f5c71===_0x0341('0x80')||_0x2f5c71==='rtpaudioqos'||_0x2f5c71===_0x0341('0x81')||_0x2f5c71===_0x0341('0x7b')||_0x2f5c71===_0x0341('0x7c')||_0x2f5c71===_0x0341('0x7d')||_0x2f5c71===_0x0341('0x7e')||_0x2f5c71===_0x0341('0x7f')||_0x2f5c71===_0x0341('0x80')||_0x2f5c71===_0x0341('0x82')||_0x2f5c71===_0x0341('0x83')||_0x2f5c71===_0x0341('0x3e')||_0x2f5c71===_0x0341('0x36')){return![];}return!![];};exports[_0x0341('0x84')]=function(_0x1c36e0,_0xa07278){var _0x401050,_0x90053e,_0x432f63;if(_0xa07278<=0x0){_0xa07278=0x1;}_0x401050=new RegExp('\x5cw{0,'+_0xa07278+'}$');_0x90053e=Math[_0x0341('0x85')](0xa,_0xa07278-0x1);_0x432f63=Math[_0x0341('0x85')](0xa,_0xa07278)-0x1;return util['format']('%s',_[_0x0341('0x86')](_0x1c36e0,_0x401050,_[_0x0341('0x87')](_0x90053e,_0x432f63)));};exports[_0x0341('0x88')]=function(_0x3f0884){var _0x43435f=_0x3f0884[_0x0341('0x89')](/"(.*?)"/);return _0x43435f?_0x43435f[0x1]:_0x3f0884;};exports['extractCalleridNumber']=function(_0x22cf8a){var _0x4a952f=_0x22cf8a['match'](/<(.*?)>/);return _0x4a952f?_0x4a952f[0x1]:_0x22cf8a;}; \ No newline at end of file +var _0xb844=['[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','name','queue','interface','voice','mandatoryDisposition','not_inuse','status','reachable','getDiff','CampaignId','filterKey','type','scheduledat','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','127.0.0.1','milliseconds','diff','seconds','loggerCatch','inspect','logger','loggerError','logger2','info','isUndefined','isEmpty','string','format','\x22%s\x22\x20<%s>','addVariables','Queue','calleridname','ContactId','VoiceQueueId','\x22rtTxX%s%s\x22','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','dialQueueProject2','\x22agi://%s/square,%s\x22','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','isNil','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','responsetime','endtime','logAgent','ringtime','logLookAgent','membername','UserId','logCustomer','YYYY-MM-DD\x20HH:mm:ss','talktime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','calleridnum','timeout','countbusyretry','countcongestionretry','countagentrejectretry','countnosuchnumberretry','Global','scheduledAt','active','add','minutes','ListId','pTalking','error','[decrementTalkink]\x20object\x20talking\x20is\x20negative'];(function(_0x3b9293,_0x5e80ff){var _0x5a2587=function(_0x42b061){while(--_0x42b061){_0x3b9293['push'](_0x3b9293['shift']());}};_0x5a2587(++_0x5e80ff);}(_0xb844,0xbc));var _0x4b84=function(_0x8279b2,_0x28eec5){_0x8279b2=_0x8279b2-0x0;var _0x5418ac=_0xb844[_0x8279b2];return _0x5418ac;};'use strict';var util=require(_0x4b84('0x0'));var _=require(_0x4b84('0x1'));var moment=require(_0x4b84('0x2'));var logger=require(_0x4b84('0x3'))(_0x4b84('0x4'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0x4b84('0x5');function getSeconds(_0x4ac319,_0x4dbcfb){var _0x3e807e=moment(_0x4ac319)[_0x4b84('0x6')](0x0);var _0x49b3ec=moment(_0x4dbcfb)[_0x4b84('0x6')](0x0);return _0x3e807e[_0x4b84('0x7')](_0x49b3ec,_0x4b84('0x8'));}exports[_0x4b84('0x9')]=function(_0x14b8e2){return function(_0x209019){logger['error'](_0x14b8e2,util[_0x4b84('0xa')](_0x209019,{'showHidden':![],'depth':null}));};};exports[_0x4b84('0xb')]=function(_0x233792,_0x55cd10){logger['info'](_0x233792,util['inspect'](_0x55cd10,{'showHidden':![],'depth':null}));};exports[_0x4b84('0xc')]=function(_0x4b66b6,_0xf9905){logger['error'](_0x4b66b6,util[_0x4b84('0xa')](_0xf9905,{'showHidden':![],'depth':null}));};exports[_0x4b84('0xd')]=function(_0x176662){return function(_0x5d7713){logger[_0x4b84('0xe')](_0x176662,util[_0x4b84('0xa')](_0x5d7713,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x4ad794,_0x3108b5,_0x1f80bd){return{'message':_0x4ad794,'unlock':_0x3108b5,'active':_0x1f80bd};};exports['getCallerId']=function(_0x1e14a8,_0x7d75b3,_0x31ed96){if(!_[_0x4b84('0xf')](_0x31ed96)&&'string'===typeof _0x31ed96&&!_[_0x4b84('0x10')](_0x31ed96)){if(!_['isUndefined'](_0x7d75b3)&&_0x4b84('0x11')===typeof _0x7d75b3&&!_[_0x4b84('0x10')](_0x7d75b3)){return util[_0x4b84('0x12')](_0x4b84('0x13'),_0x7d75b3,_0x31ed96);}return util[_0x4b84('0x12')]('\x22%s\x22\x20<%s>',_0x31ed96,_0x31ed96);}if(!_[_0x4b84('0xf')](_0x1e14a8)&&_0x4b84('0x11')===typeof _0x1e14a8&&!_['isEmpty'](_0x1e14a8)){return _0x1e14a8;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x389f7a){if(_['isNil'](_0x389f7a)){return![];}return _0x389f7a;};exports[_0x4b84('0x14')]=function(_0x56e296,_0x47ca41,_0x1402ba,_0x5499a0,_0x10c979,_0x3245d9){var _0x18cec7={'XMD-QUEUE':_0x47ca41[_0x4b84('0x15')]?_0x47ca41[_0x4b84('0x15')]['name']:'','XMD-CALLERID':_0x5499a0,'XMD-CALLERID-PREVIEW':_0x3245d9?util[_0x4b84('0x12')](_0x4b84('0x13'),_0x3245d9[_0x4b84('0x16')],_0x3245d9['calleridnum']):_0x5499a0,'XMD-DIALID':_0x10c979,'XMD-CONTACTID':_0x47ca41[_0x4b84('0x17')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x5499a0,'XMD-VOICEQUEUEID':_0x47ca41[_0x4b84('0x18')],'XMD-DIALCHANNEL':_0x1402ba,'XMD-DIALTIMEOUT':_0x56e296['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util['format'](_0x4b84('0x19'),_0x56e296['dialQueueProject2']?'g':'',_['isEmpty'](_0x56e296['monitor_format'])?'':_0x4b84('0x1a')),'XMD-DIALURL':_0x56e296[_0x4b84('0x1b')]||'','XMD-AGI':_0x56e296[_0x4b84('0x1c')]?util[_0x4b84('0x12')]('\x22agi://%s/square,%s\x22',ipAgi,_0x56e296[_0x4b84('0x1c')]):'NONE','XMD-AGIAFTER':_0x56e296[_0x4b84('0x1d')]?util[_0x4b84('0x12')](_0x4b84('0x1e'),ipAgi,_0x56e296[_0x4b84('0x1d')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x3245d9?_0x3245d9['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x3245d9?_0x3245d9[_0x4b84('0x1f')]:'','XMD-DESTINATION':_0x4b84('0x20'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0x4b84('0x10')](_0x56e296[_0x4b84('0x21')])){_0x18cec7[util[_0x4b84('0x12')]('%s',_0x4b84('0x22'))]=_0x56e296[_0x4b84('0x21')];_0x18cec7[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x10c979;}if(_0x47ca41&&_0x47ca41[_0x4b84('0x23')]){for(var _0x40b9b9 in _0x47ca41[_0x4b84('0x23')]){if(_0x47ca41[_0x4b84('0x23')][_0x4b84('0x24')](_0x40b9b9)){if(!_[_0x4b84('0x25')](_0x47ca41['Contact'][_0x40b9b9])&&_0x40b9b9!=='id'&&_0x40b9b9!==_0x4b84('0x26')&&_0x40b9b9!==_0x4b84('0x27')&&_0x40b9b9!==_0x4b84('0x28')){_0x18cec7[util[_0x4b84('0x12')](_0x4b84('0x29'),_0x4b84('0x2a'),_[_0x4b84('0x2b')](_0x40b9b9))]=_0x47ca41['Contact'][_0x40b9b9];}}}}return _0x18cec7;};exports[_0x4b84('0x2c')]=function(_0x3e18ec){var _0x17b527={};for(var _0x549233 in _0x3e18ec){if(_0x3e18ec[_0x4b84('0x24')](_0x549233)){_0x17b527[util[_0x4b84('0x12')]('%s',_['toLower'](_0x549233))]=_0x3e18ec[_0x549233];}}return{'variables':_0x17b527};};exports[_0x4b84('0x2d')]=function(_0x2a99f6,_0x2ac533){if(!_[_0x4b84('0x25')](_0x2a99f6)){if(_0x2a99f6[_0x4b84('0x24')](_0x4b84('0x2e'))){if(_0x2a99f6[_0x4b84('0x2e')]>0x0){_0x2a99f6[_0x4b84('0x2e')]-=0x1;}else{logger['error'](_0x4b84('0x2f'),_0x2ac533);}}}else{logger['error'](_0x4b84('0x30'),_0x2ac533);}};exports[_0x4b84('0x31')]=function(_0x47c13e){var _0x2df883=moment()[_0x4b84('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x47c13e[_0x4b84('0x32')]=0xd;_0x47c13e[_0x4b84('0x33')]=_0x4b84('0x34');_0x47c13e['starttime']=_0x2df883;_0x47c13e[_0x4b84('0x35')]=_0x2df883;_0x47c13e[_0x4b84('0x36')]=_0x2df883;};exports[_0x4b84('0x37')]=function(_0x2328e9,_0x12e548,_0x2922a1){var _0x5c35fc=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2328e9[_0x4b84('0x32')]=_0x12e548;_0x2328e9[_0x4b84('0x33')]=_0x2922a1;_0x2328e9[_0x4b84('0x35')]=_0x5c35fc;_0x2328e9[_0x4b84('0x38')]=getSeconds(_0x2328e9[_0x4b84('0x35')],_0x2328e9['starttime']);};exports[_0x4b84('0x39')]=function(_0x3c20ea,_0x4767e5,_0xab72a1){_0x3c20ea[_0x4b84('0x3a')]=_0x4767e5;_0x3c20ea[_0x4b84('0x3b')]=_0xab72a1;};exports[_0x4b84('0x3c')]=function(_0x28562e,_0x407c06,_0x53d298){var _0x4117c9=moment()[_0x4b84('0x12')](_0x4b84('0x3d'));_0x28562e[_0x4b84('0x32')]=_0x407c06;_0x28562e[_0x4b84('0x33')]=_0x53d298;_0x28562e[_0x4b84('0x35')]=_0x28562e[_0x4b84('0x35')]?_0x28562e[_0x4b84('0x35')]:_0x4117c9;_0x28562e[_0x4b84('0x36')]=_0x28562e[_0x4b84('0x36')]?_0x28562e['endtime']:_0x4117c9;_0x28562e['ringtime']=getSeconds(_0x28562e[_0x4b84('0x35')]||0x0,_0x28562e['starttime']||0x0);_0x28562e[_0x4b84('0x3e')]=_0x28562e['answertime']?getSeconds(_0x28562e[_0x4b84('0x36')],_0x28562e['answertime']):0x0;};exports[_0x4b84('0x3f')]=function(_0x21f62f){return _0x21f62f===_0x4b84('0x40');};exports[_0x4b84('0x41')]=function(_0x35dd90,_0x4032a5,_0xb46138,_0x47b0d0,_0x670754){var _0xe5c6c0=_0x47b0d0?_0x4b84('0x42'):_0x35dd90[_0x4b84('0x16')];_0xe5c6c0=_0x670754?_0x4b84('0x43'):_0xe5c6c0;return{'actionid':_0x35dd90[_0x4b84('0x44')],'action':_0x4b84('0x45'),'channel':_0x35dd90[_0x4b84('0x46')],'callerid':util['format'](_0x4b84('0x13'),_0xe5c6c0,_0x35dd90[_0x4b84('0x47')]),'Exten':_0x4b84('0x20'),'Context':'from-sip','Priority':'1','variable':_0xb46138,'timeout':(_0x4032a5[_0x4b84('0x48')]||0x1e)*0x3e8,'async':!![],'channelid':_0x35dd90['uniqueid']};};exports['totalGlobal']=function(_0x2b357b){return _0x2b357b[_0x4b84('0x49')]+_0x2b357b[_0x4b84('0x4a')]+_0x2b357b['countnoanswerretry']+_0x2b357b[_0x4b84('0x4b')]+_0x2b357b[_0x4b84('0x4c')];};exports['cloneAction']=function(_0x124e9b){var _0x73e998=_['clone'](_0x124e9b);_0x73e998['state']=0xf;_0x73e998[_0x4b84('0x33')]=_0x4b84('0x4d');return _0x73e998;};exports[_0x4b84('0x4e')]=function(_0x2b4201,_0x12f418,_0x2f91f0){var _0x53cbd2={};_0x53cbd2[_0x12f418]=_0x2b4201[_0x12f418];_0x53cbd2[_0x4b84('0x4f')]=![];_0x53cbd2['scheduledat']=moment()[_0x4b84('0x50')](_0x2f91f0,_0x4b84('0x51'))[_0x4b84('0x12')](_0x4b84('0x3d'));_0x53cbd2[_0x4b84('0x17')]=_0x2b4201['ContactId'];_0x53cbd2[_0x4b84('0x52')]=_0x2b4201['ListId'];_0x53cbd2[_0x4b84('0x18')]=_0x2b4201[_0x4b84('0x18')]||undefined;return _0x53cbd2;};exports['decrementTalkink']=function(_0x41d004,_0x1c1688){if(!_['isNil'](_0x41d004)){if(_0x41d004[_0x4b84('0x53')]>0x0){_0x41d004[_0x4b84('0x53')]-=0x1;}else{logger[_0x4b84('0x54')](_0x1c1688,_0x4b84('0x55'));}}else{logger['error'](_0x1c1688,_0x4b84('0x56'));}};exports[_0x4b84('0x57')]=function(_0x27cfbd){if(_0x27cfbd<=0x0){return!![];}return![];};exports[_0x4b84('0x58')]=function(_0x44015f,_0x2fd175,_0x30ebae){_0x44015f[_0x4b84('0x59')]=_0x2fd175;_0x44015f[_0x4b84('0x5a')]=_0x44015f[_0x4b84('0x5b')];_0x44015f[_0x4b84('0x5c')]=_0x44015f[_0x4b84('0x46')];_0x44015f['motionChannel']=_0x4b84('0x5d');if(_0x30ebae){_0x44015f[_0x4b84('0x5e')]=_0x30ebae[_0x4b84('0x5e')];}return _0x44015f;};exports['buildAcw']=function(_0x551fae){var _0x1aca6c={};_0x1aca6c[_0x4b84('0x5b')]=_0x551fae[_0x4b84('0x5b')];_0x1aca6c[_0x4b84('0x5c')]=_0x551fae['channelAgent'];_0x1aca6c[_0x4b84('0x44')]=_0x551fae[_0x4b84('0x44')];return _0x1aca6c;};exports['agentReadyId']=function(_0x16f20c){var _0x378a40=[];for(var _0x47658a in _0x16f20c){if(_0x16f20c[_0x4b84('0x24')](_0x47658a)){if(!_[_0x4b84('0x25')](_0x16f20c[_0x47658a])&&_0x16f20c[_0x47658a][_0x4b84('0x32')]===_0x4b84('0x5f')&&_0x16f20c[_0x47658a][_0x4b84('0x60')]===_0x4b84('0x61')){_0x378a40['push'](_0x16f20c[_0x47658a]['id']);}}}return _0x378a40;};exports[_0x4b84('0x62')]=function(_0x5738dc){var _0x350d76=moment()[_0x4b84('0x6')](0x0);var _0x142824=moment(_0x5738dc)[_0x4b84('0x6')](0x0);return _0x350d76[_0x4b84('0x7')](_0x142824,'seconds');};exports['createBody']=function(_0x4ad71e){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4ad71e[_0x4b84('0x17')],'ListId':_0x4ad71e[_0x4b84('0x52')],'VoiceQueueId':_0x4ad71e[_0x4b84('0x18')]||undefined,'CampaignId':_0x4ad71e[_0x4b84('0x63')]||undefined};};exports[_0x4b84('0x64')]=function(_0x22a50a){if(_0x22a50a===_0x4b84('0x44')||_0x22a50a==='idContact'||_0x22a50a==='queue'||_0x22a50a===_0x4b84('0x65')||_0x22a50a==='campaigntype'||_0x22a50a==='dialAnswer'||_0x22a50a===_0x4b84('0x3a')||_0x22a50a===_0x4b84('0x46')||_0x22a50a===_0x4b84('0x16')||_0x22a50a===_0x4b84('0x4f')||_0x22a50a===_0x4b84('0x47')||_0x22a50a===_0x4b84('0x66')||_0x22a50a==='countbusyretry'||_0x22a50a===_0x4b84('0x4a')||_0x22a50a===_0x4b84('0x67')||_0x22a50a===_0x4b84('0x68')||_0x22a50a===_0x4b84('0x69')||_0x22a50a===_0x4b84('0x6a')||_0x22a50a===_0x4b84('0x6b')||_0x22a50a===_0x4b84('0x6c')||_0x22a50a===_0x4b84('0x17')||_0x22a50a===_0x4b84('0x52')||_0x22a50a===_0x4b84('0x3b')||_0x22a50a===_0x4b84('0x18')||_0x22a50a==='sipcallid'||_0x22a50a===_0x4b84('0x6d')||_0x22a50a===_0x4b84('0x6e')||_0x22a50a===_0x4b84('0x6f')||_0x22a50a==='xmd-listid'||_0x22a50a===_0x4b84('0x70')||_0x22a50a==='xmd-dialtimeout'||_0x22a50a==='xmd-dialoptions'||_0x22a50a===_0x4b84('0x71')||_0x22a50a===_0x4b84('0x72')||_0x22a50a==='xmd-contactid'||_0x22a50a===_0x4b84('0x73')||_0x22a50a===_0x4b84('0x74')||_0x22a50a===_0x4b84('0x75')||_0x22a50a===_0x4b84('0x76')||_0x22a50a===_0x4b84('0x77')||_0x22a50a==='rtpaudioqosbridged'||_0x22a50a===_0x4b84('0x78')||_0x22a50a===_0x4b84('0x79')||_0x22a50a===_0x4b84('0x7a')||_0x22a50a==='rtpaudioqoslossbridged'||_0x22a50a===_0x4b84('0x7b')||_0x22a50a===_0x4b84('0x7c')||_0x22a50a==='rtpaudioqos'||_0x22a50a===_0x4b84('0x7d')||_0x22a50a===_0x4b84('0x78')||_0x22a50a===_0x4b84('0x79')||_0x22a50a==='rtpaudioqosloss'||_0x22a50a===_0x4b84('0x7e')||_0x22a50a===_0x4b84('0x7b')||_0x22a50a===_0x4b84('0x7c')||_0x22a50a===_0x4b84('0x7f')||_0x22a50a===_0x4b84('0x80')||_0x22a50a===_0x4b84('0x32')||_0x22a50a===_0x4b84('0x33')){return![];}return!![];};exports[_0x4b84('0x81')]=function(_0x308584,_0x4907c9){var _0x9ecbd3,_0x30ec81,_0x3bff04;if(_0x4907c9<=0x0){_0x4907c9=0x1;}_0x9ecbd3=new RegExp(_0x4b84('0x82')+_0x4907c9+'}$');_0x30ec81=Math[_0x4b84('0x83')](0xa,_0x4907c9-0x1);_0x3bff04=Math[_0x4b84('0x83')](0xa,_0x4907c9)-0x1;return util['format']('%s',_[_0x4b84('0x84')](_0x308584,_0x9ecbd3,_[_0x4b84('0x85')](_0x30ec81,_0x3bff04)));};exports[_0x4b84('0x86')]=function(_0x24d59a){var _0x1ace59=_0x24d59a[_0x4b84('0x87')](/"(.*?)"/);return _0x1ace59?_0x1ace59[0x1]:_0x24d59a;};exports[_0x4b84('0x88')]=function(_0x219d50){var _0x427c58=_0x219d50[_0x4b84('0x87')](/<(.*?)>/);return _0x427c58?_0x427c58[0x1]:_0x219d50;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 009baf2..e6c1451 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 _0x9ee6=['queuepause','voicechannel','voicequeuechannelhangup','queueadd','string','number','boolean','queueremove'];(function(_0x28f0d5,_0x1232db){var _0x46c8b3=function(_0x30591b){while(--_0x30591b){_0x28f0d5['push'](_0x28f0d5['shift']());}};_0x46c8b3(++_0x1232db);}(_0x9ee6,0x14b));var _0x69ee=function(_0x37b3e5,_0x33b516){_0x37b3e5=_0x37b3e5-0x0;var _0x207f20=_0x9ee6[_0x37b3e5];return _0x207f20;};'use strict';exports[_0x69ee('0x0')]={'queue':{'type':_0x69ee('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x69ee('0x1'),'required':!![]},'penalty':{'type':_0x69ee('0x2'),'required':![]},'paused':{'type':_0x69ee('0x3'),'required':![]}};exports[_0x69ee('0x4')]={'queue':{'type':_0x69ee('0x1'),'required':!![]},'interface':{'type':_0x69ee('0x1'),'required':!![]}};exports[_0x69ee('0x5')]={'interface':{'type':_0x69ee('0x1'),'required':!![]},'paused':{'type':_0x69ee('0x3')},'reason':{'type':_0x69ee('0x1'),'required':![]}};exports['reload']={'module':{'type':_0x69ee('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x69ee('0x1'),'required':!![]}};exports[_0x69ee('0x6')]={'uniqueid':{'type':_0x69ee('0x1'),'required':!![]},'filename':{'type':_0x69ee('0x1')},'format':{'type':_0x69ee('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x69ee('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x69ee('0x1'),'required':!![]},'exten':{'type':_0x69ee('0x1'),'required':!![]},'context':{'type':_0x69ee('0x1')}}; \ No newline at end of file +var _0xc937=['reload','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','queueremove','boolean'];(function(_0x323fff,_0x38f93e){var _0x326de5=function(_0x5520f9){while(--_0x5520f9){_0x323fff['push'](_0x323fff['shift']());}};_0x326de5(++_0x38f93e);}(_0xc937,0xe5));var _0x7c93=function(_0xcc329d,_0x2067d6){_0xcc329d=_0xcc329d-0x0;var _0x28374c=_0xc937[_0xcc329d];return _0x28374c;};'use strict';exports[_0x7c93('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x7c93('0x1'),'required':!![]},'membername':{'type':_0x7c93('0x1'),'required':!![]},'penalty':{'type':_0x7c93('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x7c93('0x3')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x7c93('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x7c93('0x1'),'required':!![]},'paused':{'type':_0x7c93('0x4')},'reason':{'type':_0x7c93('0x1'),'required':![]}};exports[_0x7c93('0x5')]={'module':{'type':_0x7c93('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x7c93('0x1'),'required':!![]}};exports[_0x7c93('0x6')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x7c93('0x1')},'format':{'type':_0x7c93('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x7c93('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x7c93('0x8')]={'uniqueid':{'type':_0x7c93('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 9fc6857..50ea1d2 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 _0xd979=['format','SIP/%s','name','isNil','interface','answered','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','abandoned','sumHoldTime','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','isUndefined','mergeFromDatabase','length','initTrunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','vtigerAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queuecallerexit','unmanaged','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','disposition','ANSWERED','duration','billableseconds','initCampaigns','dialQueueProject','SquareProject','initCampaignHopperHistory','initFaxAccounts','faxAccounts','bluebird','util','lodash','moment','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','queueChannels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','hasOwnProperty','mapKeys'];(function(_0x3e174a,_0x26fd18){var _0x18c178=function(_0x1eab0d){while(--_0x1eab0d){_0x3e174a['push'](_0x3e174a['shift']());}};_0x18c178(++_0x26fd18);}(_0xd979,0x11c));var _0x9d97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd979[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x9d97('0x0'));var util=require(_0x9d97('0x1'));var _=require(_0x9d97('0x2'));var moment=require(_0x9d97('0x3'));var Agent=require('../model/agent');var Telephone=require('../model/telephone');var Trunk=require(_0x9d97('0x4'));var VoiceQueue=require(_0x9d97('0x5'));var Trigger=require(_0x9d97('0x6'));var Template=require('../model/template');var Campaign=require(_0x9d97('0x7'));var VoiceExtension=require(_0x9d97('0x8'));var ZendeskAccount=require(_0x9d97('0x9'));var SalesforceAccount=require(_0x9d97('0xa'));var FreshdeskAccount=require(_0x9d97('0xb'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x9d97('0xc'));var DeskAccount=require(_0x9d97('0xd'));var VtigerAccount=require(_0x9d97('0xe'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x9d97('0xf'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x9d97('0x10'));var Realtime=function(){this[_0x9d97('0x11')]={};this[_0x9d97('0x12')]={};this[_0x9d97('0x13')]={};this[_0x9d97('0x14')]={};this[_0x9d97('0x15')]={};this[_0x9d97('0x16')]={};this[_0x9d97('0x17')]={};this[_0x9d97('0x18')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x9d97('0x19')]={};this['channels']={};this[_0x9d97('0x1a')]={};this[_0x9d97('0x1b')]={};this['timers']={};this[_0x9d97('0x1c')]={};this[_0x9d97('0x1d')]={};this[_0x9d97('0x1e')]={};this[_0x9d97('0x1f')]={};this[_0x9d97('0x20')]={};this[_0x9d97('0x21')]={};this[_0x9d97('0x22')]={};this['vtigerAccounts']={};this[_0x9d97('0x23')]={};this[_0x9d97('0x24')]={};this[_0x9d97('0x25')]={};this['faxAccounts']={};};function freeIsNotKey(_0x24ac36,_0x518415,_0xa944de){var _0x185a3b=_['mapKeys'](_0x24ac36,function(_0x5e4ec0,_0x5e9fdc){return _0x5e4ec0[_0xa944de];});for(var _0x49ee7d in _0x518415){if(_0x518415[_0x9d97('0x26')](_0x49ee7d)){if(!_0x185a3b[_0x49ee7d]){delete _0x518415[_0x49ee7d];}}}}function freeIsNotKeySip(_0x122ad8,_0x549917){var _0x1e3776=_[_0x9d97('0x27')](_0x122ad8,function(_0x25cf50,_0x1db3e6){return util[_0x9d97('0x28')](_0x9d97('0x29'),_0x25cf50[_0x9d97('0x2a')]);});for(var _0x21b78a in _0x549917){if(_0x549917[_0x9d97('0x26')](_0x21b78a)){if(!_0x1e3776[_0x21b78a]){delete _0x549917[_0x21b78a];}}}}function freeIsNotKeyAgent(_0x4a6ea,_0x23dc25){var _0x2f02d4=_['mapKeys'](_0x4a6ea,function(_0x2152f,_0x4fd3f4){var _0x31166d=_[_0x9d97('0x2b')](_0x2152f['interface'])?util[_0x9d97('0x28')](_0x9d97('0x29'),_0x2152f['name']):_0x2152f[_0x9d97('0x2c')];return _0x31166d;});for(var _0x3fa1a3 in _0x23dc25){if(_0x23dc25[_0x9d97('0x26')](_0x3fa1a3)){if(!_0x2f02d4[_0x3fa1a3]){delete _0x23dc25[_0x3fa1a3];}}}}function clearVoiceCallReports(_0xcf7648){_0xcf7648['total']=0x0;_0xcf7648[_0x9d97('0x2d')]=0x0;_0xcf7648['sumHoldTime']=0x0;_0xcf7648[_0x9d97('0x2e')]=0x0;_0xcf7648[_0x9d97('0x2f')]=0x0;}function clearCampaigns(_0x380302){if(!_[_0x9d97('0x30')](_0x380302)){for(var _0x1a610f in _0x380302){if(_0x380302['hasOwnProperty'](_0x1a610f)){_0x380302[_0x1a610f][_0x9d97('0x31')]=0x0;_0x380302[_0x1a610f][_0x9d97('0x32')]=0x0;}}}}function clearVoiceQueues(_0x45c116){if(!_[_0x9d97('0x30')](_0x45c116)){for(var _0x460564 in _0x45c116){if(_0x45c116['hasOwnProperty'](_0x460564)){_0x45c116[_0x460564][_0x9d97('0x33')]=0x0;_0x45c116[_0x460564][_0x9d97('0x2d')]=0x0;_0x45c116[_0x460564]['unmanaged']=0x0;_0x45c116[_0x460564][_0x9d97('0x34')]=0x0;_0x45c116[_0x460564][_0x9d97('0x35')]=0x0;_0x45c116[_0x460564][_0x9d97('0x2e')]=0x0;_0x45c116[_0x460564][_0x9d97('0x2f')]=0x0;_0x45c116[_0x460564][_0x9d97('0x36')]=0x0;_0x45c116[_0x460564][_0x9d97('0x37')]=0x0;_0x45c116[_0x460564]['outboundBusyCallsDay']=0x0;_0x45c116[_0x460564][_0x9d97('0x38')]=0x0;_0x45c116[_0x460564]['outboundNoSuchCallsDay']=0x0;_0x45c116[_0x460564]['outboundUnknownCallsDay']=0x0;_0x45c116[_0x460564][_0x9d97('0x39')]=0x0;_0x45c116[_0x460564][_0x9d97('0x3a')]=0x0;_0x45c116[_0x460564][_0x9d97('0x3b')]=0x0;_0x45c116[_0x460564][_0x9d97('0x3c')]=0x0;_0x45c116[_0x460564][_0x9d97('0x3d')]=0x0;_0x45c116[_0x460564][_0x9d97('0x3e')]=0x0;_0x45c116[_0x460564]['outboundAnswerAgiCallsDay']=0x0;_0x45c116[_0x460564][_0x9d97('0x3f')]=0x0;_0x45c116[_0x460564][_0x9d97('0x40')]=!![];}}}}Realtime[_0x9d97('0x41')]['mergeFromDatabase']=function(_0x515c0f,_0x5b2b26){for(var _0x5f312e in _0x5b2b26){if(_0x515c0f[_0x9d97('0x26')](_0x5f312e)){_0x515c0f[_0x5f312e]=_0x5b2b26[_0x5f312e];}}};Realtime[_0x9d97('0x41')][_0x9d97('0x42')]=function(){var _0x2a3878=this;return function(_0x52ccea){if(_0x52ccea){freeIsNotKeyAgent(_0x52ccea,_0x2a3878['agents']);for(var _0x39d3ca=0x0,_0x1b1327={},_0x233321={};_0x39d3ca<_0x52ccea['length'];_0x39d3ca+=0x1){_0x1b1327=_0x52ccea[_0x39d3ca];var _0x5474fb=_[_0x9d97('0x2b')](_0x1b1327[_0x9d97('0x2c')])?util[_0x9d97('0x28')](_0x9d97('0x29'),_0x1b1327[_0x9d97('0x2a')]):_0x1b1327['interface'];if(_[_0x9d97('0x43')](_0x2a3878['agents'][_0x5474fb])){_0x2a3878[_0x9d97('0x11')][_0x5474fb]=new Agent(_0x1b1327);}else{_0x2a3878[_0x9d97('0x44')](_0x2a3878['agents'][_0x5474fb],_0x1b1327);}}}return _0x2a3878[_0x9d97('0x11')];};};Realtime[_0x9d97('0x41')]['initTelephones']=function(){var _0x81324c=this;return function(_0x399be2){if(_0x399be2){freeIsNotKeySip(_0x399be2,_0x81324c[_0x9d97('0x12')]);for(var _0x1e8a79=0x0,_0x2665f2={},_0x32f056={};_0x1e8a79<_0x399be2[_0x9d97('0x45')];_0x1e8a79+=0x1){_0x2665f2=_0x399be2[_0x1e8a79];if(_[_0x9d97('0x43')](_0x81324c[_0x9d97('0x12')][util['format'](_0x9d97('0x29'),_0x2665f2['name'])])){_0x81324c[_0x9d97('0x12')][util['format'](_0x9d97('0x29'),_0x2665f2['name'])]=new Telephone(_0x2665f2);}else{_0x81324c[_0x9d97('0x44')](_0x81324c[_0x9d97('0x12')][util['format'](_0x9d97('0x29'),_0x2665f2[_0x9d97('0x2a')])],_0x2665f2);}}}return _0x81324c[_0x9d97('0x12')];};};Realtime[_0x9d97('0x41')][_0x9d97('0x46')]=function(){var _0x50f1b5=this;return function(_0x6dce46){if(_0x6dce46){freeIsNotKeySip(_0x6dce46,_0x50f1b5['trunks']);for(var _0x267160=0x0,_0x3f65be={},_0x1bae06={};_0x267160<_0x6dce46['length'];_0x267160+=0x1){_0x3f65be=_0x6dce46[_0x267160];if(_['isUndefined'](_0x50f1b5[_0x9d97('0x13')][util[_0x9d97('0x28')]('SIP/%s',_0x3f65be[_0x9d97('0x2a')])])){_0x50f1b5[_0x9d97('0x13')][util[_0x9d97('0x28')]('SIP/%s',_0x3f65be[_0x9d97('0x2a')])]=new Trunk(_0x3f65be);}else{_0x50f1b5[_0x9d97('0x44')](_0x50f1b5[_0x9d97('0x13')][util[_0x9d97('0x28')](_0x9d97('0x29'),_0x3f65be[_0x9d97('0x2a')])],_0x3f65be);}}}return _0x50f1b5['trunks'];};};Realtime[_0x9d97('0x41')][_0x9d97('0x47')]=function(){var _0x5de381=this;return function(_0x29212d){if(_0x29212d){freeIsNotKey(_0x29212d,_0x5de381[_0x9d97('0x14')],'name');for(var _0x86d783=0x0,_0x594cfc={},_0x26b6df={};_0x86d783<_0x29212d[_0x9d97('0x45')];_0x86d783+=0x1){_0x594cfc=_0x29212d[_0x86d783];if(_['isUndefined'](_0x5de381[_0x9d97('0x14')][_0x594cfc[_0x9d97('0x2a')]])){_0x5de381[_0x9d97('0x14')][_0x594cfc[_0x9d97('0x2a')]]=new VoiceQueue(_0x594cfc);}else{_0x5de381[_0x9d97('0x44')](_0x5de381[_0x9d97('0x14')][_0x594cfc[_0x9d97('0x2a')]],_0x594cfc);}}}return _0x5de381[_0x9d97('0x14')];};};Realtime[_0x9d97('0x41')][_0x9d97('0x48')]=function(){var _0x3afb02=this;return function(_0x31d853){if(_0x31d853){freeIsNotKey(_0x31d853,_0x3afb02[_0x9d97('0x15')],'id');for(var _0x15e369=0x0,_0x34b25b={},_0x31036f={};_0x15e369<_0x31d853[_0x9d97('0x45')];_0x15e369+=0x1){_0x34b25b=_0x31d853[_0x15e369];if(_['isUndefined'](_0x3afb02[_0x9d97('0x15')][_0x34b25b['id']])){_0x3afb02[_0x9d97('0x15')][_0x34b25b['id']]=new Trigger(_0x34b25b);}else{_0x3afb02[_0x9d97('0x44')](_0x3afb02[_0x9d97('0x15')][_0x34b25b['id']],_0x34b25b);}}}return _0x3afb02[_0x9d97('0x15')];};};Realtime[_0x9d97('0x41')][_0x9d97('0x49')]=function(){var _0x5c6bae=this;return function(_0xce6691){if(_0xce6691){freeIsNotKey(_0xce6691,_0x5c6bae['templates'],'id');for(var _0x494f6a=0x0,_0x5be909={},_0xdb9cee={};_0x494f6a<_0xce6691[_0x9d97('0x45')];_0x494f6a+=0x1){_0x5be909=_0xce6691[_0x494f6a];if(_['isUndefined'](_0x5c6bae[_0x9d97('0x17')][_0x5be909['id']])){_0x5c6bae['templates'][_0x5be909['id']]=new Template(_0x5be909);}else{_0x5c6bae[_0x9d97('0x44')](_0x5c6bae[_0x9d97('0x17')][_0x5be909['id']],_0x5be909);}}}return _0x5c6bae[_0x9d97('0x17')];};};Realtime['prototype'][_0x9d97('0x4a')]=function(){var _0x182c2e=this;return function(_0x4f346f){if(_0x4f346f){freeIsNotKey(_0x4f346f,_0x182c2e['zendeskAccounts'],'id');for(var _0x480903=0x0,_0xc6dfee={},_0x30b8e7={};_0x480903<_0x4f346f[_0x9d97('0x45')];_0x480903+=0x1){_0xc6dfee=_0x4f346f[_0x480903];if(_[_0x9d97('0x43')](_0x182c2e[_0x9d97('0x1d')][_0xc6dfee['id']])){_0x182c2e[_0x9d97('0x1d')][_0xc6dfee['id']]=new ZendeskAccount(_0xc6dfee);}else{_0x182c2e[_0x9d97('0x44')](_0x182c2e['zendeskAccounts'][_0xc6dfee['id']],_0xc6dfee);}}}return _0x182c2e[_0x9d97('0x1d')];};};Realtime['prototype'][_0x9d97('0x4b')]=function(){var _0x2ff190=this;return function(_0x382411){if(_0x382411){freeIsNotKey(_0x382411,_0x2ff190[_0x9d97('0x1e')],'id');for(var _0x7bc4b8=0x0,_0x4d2d0c={},_0xdd4be4={};_0x7bc4b8<_0x382411[_0x9d97('0x45')];_0x7bc4b8+=0x1){_0x4d2d0c=_0x382411[_0x7bc4b8];if(_[_0x9d97('0x43')](_0x2ff190[_0x9d97('0x1e')][_0x4d2d0c['id']])){_0x2ff190['salesforceAccounts'][_0x4d2d0c['id']]=new SalesforceAccount(_0x4d2d0c);}else{_0x2ff190['mergeFromDatabase'](_0x2ff190[_0x9d97('0x1e')][_0x4d2d0c['id']],_0x4d2d0c);}}}return _0x2ff190[_0x9d97('0x1e')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x3907ba=this;return function(_0x6cc5f2){if(_0x6cc5f2){freeIsNotKey(_0x6cc5f2,_0x3907ba['freshdeskAccounts'],'id');for(var _0x565127=0x0,_0x36015f={},_0x493357={};_0x565127<_0x6cc5f2['length'];_0x565127+=0x1){_0x36015f=_0x6cc5f2[_0x565127];if(_['isUndefined'](_0x3907ba[_0x9d97('0x20')][_0x36015f['id']])){_0x3907ba[_0x9d97('0x20')][_0x36015f['id']]=new FreshdeskAccount(_0x36015f);}else{_0x3907ba['mergeFromDatabase'](_0x3907ba['freshdeskAccounts'][_0x36015f['id']],_0x36015f);}}}return _0x3907ba[_0x9d97('0x20')];};};Realtime[_0x9d97('0x41')][_0x9d97('0x4c')]=function(){var _0x19c911=this;return function(_0x35d5a5){if(_0x35d5a5){freeIsNotKey(_0x35d5a5,_0x19c911[_0x9d97('0x21')],'id');for(var _0x233154=0x0,_0xee3a94={},_0x1ece52={};_0x233154<_0x35d5a5[_0x9d97('0x45')];_0x233154+=0x1){_0xee3a94=_0x35d5a5[_0x233154];if(_[_0x9d97('0x43')](_0x19c911[_0x9d97('0x21')][_0xee3a94['id']])){_0x19c911[_0x9d97('0x21')][_0xee3a94['id']]=new ZohoAccount(_0xee3a94);}else{_0x19c911[_0x9d97('0x44')](_0x19c911[_0x9d97('0x21')][_0xee3a94['id']],_0xee3a94);}}}return _0x19c911[_0x9d97('0x21')];};};Realtime[_0x9d97('0x41')][_0x9d97('0x4d')]=function(){var _0x323558=this;return function(_0x354889){if(_0x354889){freeIsNotKey(_0x354889,_0x323558[_0x9d97('0x22')],'id');for(var _0x19edee=0x0,_0x49d3ce={},_0x476557={};_0x19edee<_0x354889['length'];_0x19edee+=0x1){_0x49d3ce=_0x354889[_0x19edee];if(_['isUndefined'](_0x323558[_0x9d97('0x22')][_0x49d3ce['id']])){_0x323558[_0x9d97('0x22')][_0x49d3ce['id']]=new DeskAccount(_0x49d3ce);}else{_0x323558['mergeFromDatabase'](_0x323558[_0x9d97('0x22')][_0x49d3ce['id']],_0x49d3ce);}}}return _0x323558['deskAccounts'];};};Realtime[_0x9d97('0x41')][_0x9d97('0x4e')]=function(){var _0x34ac78=this;return function(_0x3eeb30){if(_0x3eeb30){freeIsNotKey(_0x3eeb30,_0x34ac78[_0x9d97('0x1f')],'id');for(var _0x332e94=0x0,_0x53b56e={},_0x3809f7={};_0x332e94<_0x3eeb30['length'];_0x332e94+=0x1){_0x53b56e=_0x3eeb30[_0x332e94];if(_['isUndefined'](_0x34ac78[_0x9d97('0x1f')][_0x53b56e['id']])){_0x34ac78[_0x9d97('0x1f')][_0x53b56e['id']]=new SugarcrmAccount(_0x53b56e);}else{_0x34ac78[_0x9d97('0x44')](_0x34ac78[_0x9d97('0x1f')][_0x53b56e['id']],_0x53b56e);}}}return _0x34ac78[_0x9d97('0x1f')];};};Realtime[_0x9d97('0x41')]['initVtigerAccounts']=function(){var _0x48a1d8=this;return function(_0x2a0a73){if(_0x2a0a73){freeIsNotKey(_0x2a0a73,_0x48a1d8[_0x9d97('0x4f')],'id');for(var _0x50d1b2=0x0,_0x1ac3cd={},_0x6f0c58={};_0x50d1b2<_0x2a0a73[_0x9d97('0x45')];_0x50d1b2+=0x1){_0x1ac3cd=_0x2a0a73[_0x50d1b2];if(_[_0x9d97('0x43')](_0x48a1d8[_0x9d97('0x4f')][_0x1ac3cd['id']])){_0x48a1d8[_0x9d97('0x4f')][_0x1ac3cd['id']]=new VtigerAccount(_0x1ac3cd);}else{_0x48a1d8[_0x9d97('0x44')](_0x48a1d8[_0x9d97('0x4f')][_0x1ac3cd['id']],_0x1ac3cd);}}}return _0x48a1d8[_0x9d97('0x4f')];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x23b39d=this;return function(_0x4598de){if(_0x4598de){freeIsNotKey(_0x4598de,_0x23b39d[_0x9d97('0x23')],'id');for(var _0x2c6055=0x0,_0x2453e2={},_0x1cd0b2={};_0x2c6055<_0x4598de[_0x9d97('0x45')];_0x2c6055+=0x1){_0x2453e2=_0x4598de[_0x2c6055];if(_[_0x9d97('0x43')](_0x23b39d['servicenowAccounts'][_0x2453e2['id']])){_0x23b39d[_0x9d97('0x23')][_0x2453e2['id']]=new ServicenowAccount(_0x2453e2);}else{_0x23b39d[_0x9d97('0x44')](_0x23b39d[_0x9d97('0x23')][_0x2453e2['id']],_0x2453e2);}}}return _0x23b39d['servicenowAccounts'];};};Realtime['prototype'][_0x9d97('0x50')]=function(){var _0x55fd6c=this;return function(_0x5caf02){if(_0x5caf02){freeIsNotKey(_0x5caf02,_0x55fd6c[_0x9d97('0x24')],'id');for(var _0x56fba6=0x0,_0x23da96={},_0x276e19={};_0x56fba6<_0x5caf02[_0x9d97('0x45')];_0x56fba6+=0x1){_0x23da96=_0x5caf02[_0x56fba6];if(_[_0x9d97('0x43')](_0x55fd6c[_0x9d97('0x24')][_0x23da96['id']])){_0x55fd6c[_0x9d97('0x24')][_0x23da96['id']]=new Dynamics365Account(_0x23da96);}else{_0x55fd6c[_0x9d97('0x44')](_0x55fd6c['dynamics365Accounts'][_0x23da96['id']],_0x23da96);}}}return _0x55fd6c[_0x9d97('0x24')];};};Realtime[_0x9d97('0x41')][_0x9d97('0x51')]=function(){var _0x5f47c1=this;return function(_0x5de162){if(_0x5de162){freeIsNotKey(_0x5de162,_0x5f47c1[_0x9d97('0x25')],'id');for(var _0x5fe208=0x0,_0xc2bb2c={},_0x461ebe={};_0x5fe208<_0x5de162[_0x9d97('0x45')];_0x5fe208+=0x1){_0xc2bb2c=_0x5de162[_0x5fe208];if(_['isUndefined'](_0x5f47c1[_0x9d97('0x25')][_0xc2bb2c['id']])){_0x5f47c1[_0x9d97('0x25')][_0xc2bb2c['id']]=new FreshsalesAccount(_0xc2bb2c);}else{_0x5f47c1[_0x9d97('0x44')](_0x5f47c1[_0x9d97('0x25')][_0xc2bb2c['id']],_0xc2bb2c);}}}return _0x5f47c1[_0x9d97('0x25')];};};Realtime[_0x9d97('0x41')][_0x9d97('0x52')]=function(){var _0x38e406=this;return function(_0x51220b){for(var _0x18ff64=0x0;_0x18ff64<_0x51220b[_0x9d97('0x45')];_0x18ff64+=0x1){_[_0x9d97('0x53')](_0x38e406['voiceQueues'][_0x51220b[_0x18ff64][_0x9d97('0x2a')]],_0x51220b[_0x18ff64]);}return _0x38e406[_0x9d97('0x14')];};};Realtime[_0x9d97('0x41')][_0x9d97('0x54')]=function(){var _0x307b57=this;return function(_0x13cd6e){clearVoiceQueues(_0x307b57[_0x9d97('0x14')]);if(_0x13cd6e){_0x13cd6e=_[_0x9d97('0x55')](_0x13cd6e,'uniqueid');for(var _0x42a097 in _0x13cd6e){if(_0x13cd6e[_0x9d97('0x26')](_0x42a097)){var _0x168f12={};for(var _0xebfb42=0x0;_0xebfb42<_0x13cd6e[_0x42a097][_0x9d97('0x45')];_0xebfb42+=0x1){var _0x3df760=_0x13cd6e[_0x42a097][_0xebfb42]['queue'];if(_0x307b57[_0x9d97('0x14')][_0x3df760]){if(_0x13cd6e[_0x42a097][_0xebfb42][_0x9d97('0x56')]){_0x307b57[_0x9d97('0x14')][_0x3df760][_0x9d97('0x57')]+=0x1;}if(_0x13cd6e[_0x42a097][_0xebfb42][_0x9d97('0x58')]){_0x307b57[_0x9d97('0x14')][_0x3df760][_0x9d97('0x34')]+=0x1;}_0x307b57[_0x9d97('0x14')][_0x3df760][_0x9d97('0x35')]+=moment(_0x13cd6e[_0x42a097][_0xebfb42][_0x9d97('0x59')])[_0x9d97('0x5a')](moment(_0x13cd6e[_0x42a097][_0xebfb42][_0x9d97('0x5b')]),_0x9d97('0x5c'))||0x0;if(_0xebfb42===_0x13cd6e[_0x42a097]['length']-0x1){_0x307b57[_0x9d97('0x14')][_0x3df760][_0x9d97('0x2e')]+=moment(_0x13cd6e[_0x42a097][_0xebfb42][_0x9d97('0x5d')]||_0x13cd6e[_0x42a097][_0xebfb42][_0x9d97('0x5e')]||_0x13cd6e[_0x42a097][_0xebfb42][_0x9d97('0x5f')])['diff'](moment(_0x13cd6e[_0x42a097][_0xebfb42]['queuecallerjoinAt']),_0x9d97('0x5c'))||0x0;_0x307b57[_0x9d97('0x14')][_0x3df760][_0x9d97('0x33')]+=0x1;if(_0x13cd6e[_0x42a097][_0xebfb42][_0x9d97('0x60')]){_0x307b57[_0x9d97('0x14')][_0x3df760][_0x9d97('0x2d')]+=0x1;_0x307b57['voiceQueues'][_0x3df760][_0x9d97('0x2f')]+=moment(_0x13cd6e[_0x42a097][_0xebfb42][_0x9d97('0x5d')])[_0x9d97('0x5a')](moment(_0x13cd6e[_0x42a097][_0xebfb42][_0x9d97('0x59')]),_0x9d97('0x5c'))||0x0;}}else{_0x307b57[_0x9d97('0x14')][_0x3df760][_0x9d97('0x2e')]+=_0x307b57[_0x9d97('0x14')][_0x3df760][_0x9d97('0x35')]||0x0;}}}}}}return _0x307b57[_0x9d97('0x14')];};};Realtime[_0x9d97('0x41')][_0x9d97('0x61')]=function(){var _0x56af00=this;return function(_0x2ba106){clearVoiceCallReports(_0x56af00[_0x9d97('0x18')]);if(_0x2ba106){for(var _0x1e48bf=0x0;_0x1e48bf<_0x2ba106[_0x9d97('0x45')];_0x1e48bf+=0x1){_0x56af00[_0x9d97('0x18')][_0x9d97('0x33')]+=0x1;_0x56af00[_0x9d97('0x18')][_0x9d97('0x2e')]+=_0x2ba106[_0x1e48bf]['duration'];if(_0x2ba106[_0x1e48bf][_0x9d97('0x62')]===_0x9d97('0x63')){_0x56af00[_0x9d97('0x18')][_0x9d97('0x2d')]+=0x1;_0x56af00['outbound'][_0x9d97('0x35')]+=_0x2ba106[_0x1e48bf][_0x9d97('0x64')]-_0x2ba106[_0x1e48bf][_0x9d97('0x65')]||0x0;_0x56af00[_0x9d97('0x18')]['sumBillable']+=_0x2ba106[_0x1e48bf][_0x9d97('0x65')];}}}return _0x56af00[_0x9d97('0x18')];};};Realtime[_0x9d97('0x41')][_0x9d97('0x66')]=function(){var _0x51eb03=this;return function(_0x32a599){if(_0x32a599){freeIsNotKey(_0x32a599,_0x51eb03[_0x9d97('0x16')],_0x9d97('0x2a'));for(var _0x483304=0x0,_0x3ba05d={};_0x483304<_0x32a599['length'];_0x483304+=0x1){_0x3ba05d=_0x32a599[_0x483304];if(_[_0x9d97('0x43')](_0x51eb03[_0x9d97('0x16')][_0x3ba05d[_0x9d97('0x2a')]])){_0x51eb03[_0x9d97('0x16')][_0x3ba05d['name']]=new Campaign(_0x3ba05d);}else{_0x51eb03[_0x9d97('0x44')](_0x51eb03[_0x9d97('0x16')][_0x3ba05d[_0x9d97('0x2a')]],_0x3ba05d);_0x51eb03['campaigns'][_0x3ba05d[_0x9d97('0x2a')]][_0x9d97('0x67')]=_0x3ba05d[_0x9d97('0x68')]?_0x3ba05d[_0x9d97('0x68')]['name']:undefined;}}}return _0x51eb03['campaigns'];};};Realtime[_0x9d97('0x41')]['initVoiceExtensions']=function(){var _0xd0496f=this;return function(_0x49f813){if(_0x49f813){freeIsNotKey(_0x49f813,_0xd0496f['voiceExtensions'],'id');for(var _0x458678=0x0,_0x8d0578={};_0x458678<_0x49f813[_0x9d97('0x45')];_0x458678+=0x1){_0x8d0578=_0x49f813[_0x458678];if(_[_0x9d97('0x43')](_0xd0496f[_0x9d97('0x19')][_0x8d0578['id']])){_0xd0496f[_0x9d97('0x19')][_0x8d0578['id']]=new VoiceExtension(_0x8d0578);}else{_0xd0496f[_0x9d97('0x44')](_0xd0496f[_0x9d97('0x19')][_0x8d0578['id']],_0x8d0578);}}}return _0xd0496f[_0x9d97('0x19')];};};Realtime[_0x9d97('0x41')][_0x9d97('0x69')]=function(){var _0x15caa8=this;return function(_0x2ea51e){clearCampaigns(_0x15caa8[_0x9d97('0x16')]);for(var _0x98931a=0x0;_0x98931a<_0x2ea51e[_0x9d97('0x45')];_0x98931a+=0x1){_['merge'](_0x15caa8[_0x9d97('0x16')][_0x2ea51e[_0x98931a][_0x9d97('0x2a')]],_0x2ea51e[_0x98931a]);}return _0x15caa8[_0x9d97('0x16')];};};Realtime['prototype'][_0x9d97('0x6a')]=function(){var _0x2d908c=this;return function(_0x3e3f23){if(_0x3e3f23){freeIsNotKey(_0x3e3f23,_0x2d908c[_0x9d97('0x6b')],'id');for(var _0x5d67fb=0x0,_0x386916={},_0x3d9ee0={};_0x5d67fb<_0x3e3f23[_0x9d97('0x45')];_0x5d67fb+=0x1){_0x386916=_0x3e3f23[_0x5d67fb];if(_['isUndefined'](_0x2d908c['faxAccounts'][_0x386916['id']])){_0x2d908c[_0x9d97('0x6b')][_0x386916['id']]=new FaxAccount(_0x386916);}else{_0x2d908c[_0x9d97('0x44')](_0x2d908c[_0x9d97('0x6b')][_0x386916['id']],_0x386916);}}}return _0x2d908c[_0x9d97('0x6b')];};};module['exports']=Realtime; \ No newline at end of file +var _0xfa40=['servicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initVoiceQueueHopperHistory','merge','groupBy','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallerjoinAt','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','exports','bluebird','util','lodash','moment','../model/agent','../model/voiceQueue','../model/trigger','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/freshsalesAccount','agents','telephones','triggers','campaigns','templates','outbound','channels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','deskAccounts','vtigerAccounts','freshsalesAccounts','faxAccounts','mapKeys','format','hasOwnProperty','isNil','interface','name','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundReCallsDay','outboundAnswerCallsDay','mergeFromDatabase','prototype','length','SIP/%s','isUndefined','initTelephones','initTrunks','trunks','initVoiceQueues','voiceQueues','initTriggers','initTemplates','initZendeskAccounts','initZohoAccounts','zohoAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0xfa40,0x1aa));var _0x0fa4=function(_0xabfec4,_0x35076e){_0xabfec4=_0xabfec4-0x0;var _0x7bafa2=_0xfa40[_0xabfec4];return _0x7bafa2;};'use strict';var BPromise=require(_0x0fa4('0x0'));var util=require(_0x0fa4('0x1'));var _=require(_0x0fa4('0x2'));var moment=require(_0x0fa4('0x3'));var Agent=require(_0x0fa4('0x4'));var Telephone=require('../model/telephone');var Trunk=require('../model/trunk');var VoiceQueue=require(_0x0fa4('0x5'));var Trigger=require(_0x0fa4('0x6'));var Template=require('../model/template');var Campaign=require(_0x0fa4('0x7'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x0fa4('0x8'));var SalesforceAccount=require(_0x0fa4('0x9'));var FreshdeskAccount=require(_0x0fa4('0xa'));var SugarcrmAccount=require(_0x0fa4('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x0fa4('0xc'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x0fa4('0xd'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x0fa4('0xe')]={};this[_0x0fa4('0xf')]={};this['trunks']={};this['voiceQueues']={};this[_0x0fa4('0x10')]={};this[_0x0fa4('0x11')]={};this[_0x0fa4('0x12')]={};this[_0x0fa4('0x13')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x0fa4('0x14')]={};this['queueChannels']={};this[_0x0fa4('0x15')]={};this[_0x0fa4('0x16')]={};this[_0x0fa4('0x17')]={};this[_0x0fa4('0x18')]={};this[_0x0fa4('0x19')]={};this['sugarcrmAccounts']={};this[_0x0fa4('0x1a')]={};this['zohoAccounts']={};this[_0x0fa4('0x1b')]={};this[_0x0fa4('0x1c')]={};this['servicenowAccounts']={};this['dynamics365Accounts']={};this[_0x0fa4('0x1d')]={};this[_0x0fa4('0x1e')]={};};function freeIsNotKey(_0x549df6,_0x359af7,_0x1c6707){var _0x1b1a6c=_[_0x0fa4('0x1f')](_0x549df6,function(_0x3d6177,_0x4d84db){return _0x3d6177[_0x1c6707];});for(var _0x12f7c9 in _0x359af7){if(_0x359af7['hasOwnProperty'](_0x12f7c9)){if(!_0x1b1a6c[_0x12f7c9]){delete _0x359af7[_0x12f7c9];}}}}function freeIsNotKeySip(_0x3cc13f,_0x318a46){var _0x20c61e=_[_0x0fa4('0x1f')](_0x3cc13f,function(_0x48fc2e,_0x3b041d){return util[_0x0fa4('0x20')]('SIP/%s',_0x48fc2e['name']);});for(var _0x55f61f in _0x318a46){if(_0x318a46[_0x0fa4('0x21')](_0x55f61f)){if(!_0x20c61e[_0x55f61f]){delete _0x318a46[_0x55f61f];}}}}function freeIsNotKeyAgent(_0x55b791,_0x245a59){var _0x4a60da=_[_0x0fa4('0x1f')](_0x55b791,function(_0x21726d,_0x5a33b4){var _0x45ff2c=_[_0x0fa4('0x22')](_0x21726d[_0x0fa4('0x23')])?util[_0x0fa4('0x20')]('SIP/%s',_0x21726d[_0x0fa4('0x24')]):_0x21726d[_0x0fa4('0x23')];return _0x45ff2c;});for(var _0x48968d in _0x245a59){if(_0x245a59[_0x0fa4('0x21')](_0x48968d)){if(!_0x4a60da[_0x48968d]){delete _0x245a59[_0x48968d];}}}}function clearVoiceCallReports(_0x405824){_0x405824[_0x0fa4('0x25')]=0x0;_0x405824[_0x0fa4('0x26')]=0x0;_0x405824[_0x0fa4('0x27')]=0x0;_0x405824[_0x0fa4('0x28')]=0x0;_0x405824[_0x0fa4('0x29')]=0x0;}function clearCampaigns(_0x5c1de3){if(!_['isEmpty'](_0x5c1de3)){for(var _0xd2b665 in _0x5c1de3){if(_0x5c1de3[_0x0fa4('0x21')](_0xd2b665)){_0x5c1de3[_0xd2b665][_0x0fa4('0x2a')]=0x0;_0x5c1de3[_0xd2b665][_0x0fa4('0x2b')]=0x0;}}}}function clearVoiceQueues(_0x2f275f){if(!_[_0x0fa4('0x2c')](_0x2f275f)){for(var _0x53fcd3 in _0x2f275f){if(_0x2f275f['hasOwnProperty'](_0x53fcd3)){_0x2f275f[_0x53fcd3][_0x0fa4('0x25')]=0x0;_0x2f275f[_0x53fcd3][_0x0fa4('0x26')]=0x0;_0x2f275f[_0x53fcd3][_0x0fa4('0x2d')]=0x0;_0x2f275f[_0x53fcd3][_0x0fa4('0x2e')]=0x0;_0x2f275f[_0x53fcd3][_0x0fa4('0x27')]=0x0;_0x2f275f[_0x53fcd3][_0x0fa4('0x28')]=0x0;_0x2f275f[_0x53fcd3][_0x0fa4('0x29')]=0x0;_0x2f275f[_0x53fcd3][_0x0fa4('0x2f')]=0x0;_0x2f275f[_0x53fcd3][_0x0fa4('0x30')]=0x0;_0x2f275f[_0x53fcd3][_0x0fa4('0x31')]=0x0;_0x2f275f[_0x53fcd3]['outboundCongestionCallsDay']=0x0;_0x2f275f[_0x53fcd3][_0x0fa4('0x32')]=0x0;_0x2f275f[_0x53fcd3]['outboundUnknownCallsDay']=0x0;_0x2f275f[_0x53fcd3][_0x0fa4('0x33')]=0x0;_0x2f275f[_0x53fcd3][_0x0fa4('0x34')]=0x0;_0x2f275f[_0x53fcd3]['outboundBlacklistCallsDay']=0x0;_0x2f275f[_0x53fcd3]['outboundOriginateFailureCallsDay']=0x0;_0x2f275f[_0x53fcd3]['outboundRejectCallsDay']=0x0;_0x2f275f[_0x53fcd3][_0x0fa4('0x35')]=0x0;_0x2f275f[_0x53fcd3][_0x0fa4('0x2f')]=0x0;_0x2f275f[_0x53fcd3][_0x0fa4('0x36')]=0x0;_0x2f275f[_0x53fcd3]['queueStatusComplete']=!![];}}}}Realtime['prototype'][_0x0fa4('0x37')]=function(_0xd3caef,_0x3a9525){for(var _0x2f70ba in _0x3a9525){if(_0xd3caef[_0x0fa4('0x21')](_0x2f70ba)){_0xd3caef[_0x2f70ba]=_0x3a9525[_0x2f70ba];}}};Realtime[_0x0fa4('0x38')]['initAgents']=function(){var _0x30b0e9=this;return function(_0x5aa9c2){if(_0x5aa9c2){freeIsNotKeyAgent(_0x5aa9c2,_0x30b0e9['agents']);for(var _0x5413c6=0x0,_0x99bd3f={},_0x30f639={};_0x5413c6<_0x5aa9c2[_0x0fa4('0x39')];_0x5413c6+=0x1){_0x99bd3f=_0x5aa9c2[_0x5413c6];var _0x7d86bb=_['isNil'](_0x99bd3f[_0x0fa4('0x23')])?util[_0x0fa4('0x20')](_0x0fa4('0x3a'),_0x99bd3f[_0x0fa4('0x24')]):_0x99bd3f[_0x0fa4('0x23')];if(_[_0x0fa4('0x3b')](_0x30b0e9[_0x0fa4('0xe')][_0x7d86bb])){_0x30b0e9['agents'][_0x7d86bb]=new Agent(_0x99bd3f);}else{_0x30b0e9[_0x0fa4('0x37')](_0x30b0e9[_0x0fa4('0xe')][_0x7d86bb],_0x99bd3f);}}}return _0x30b0e9[_0x0fa4('0xe')];};};Realtime[_0x0fa4('0x38')][_0x0fa4('0x3c')]=function(){var _0x35c9bb=this;return function(_0x2302b1){if(_0x2302b1){freeIsNotKeySip(_0x2302b1,_0x35c9bb[_0x0fa4('0xf')]);for(var _0x5494ee=0x0,_0x378e89={},_0x1a90b8={};_0x5494ee<_0x2302b1[_0x0fa4('0x39')];_0x5494ee+=0x1){_0x378e89=_0x2302b1[_0x5494ee];if(_[_0x0fa4('0x3b')](_0x35c9bb[_0x0fa4('0xf')][util[_0x0fa4('0x20')](_0x0fa4('0x3a'),_0x378e89[_0x0fa4('0x24')])])){_0x35c9bb[_0x0fa4('0xf')][util[_0x0fa4('0x20')](_0x0fa4('0x3a'),_0x378e89[_0x0fa4('0x24')])]=new Telephone(_0x378e89);}else{_0x35c9bb['mergeFromDatabase'](_0x35c9bb[_0x0fa4('0xf')][util[_0x0fa4('0x20')](_0x0fa4('0x3a'),_0x378e89[_0x0fa4('0x24')])],_0x378e89);}}}return _0x35c9bb[_0x0fa4('0xf')];};};Realtime[_0x0fa4('0x38')][_0x0fa4('0x3d')]=function(){var _0x1f9fae=this;return function(_0x41f1b6){if(_0x41f1b6){freeIsNotKeySip(_0x41f1b6,_0x1f9fae[_0x0fa4('0x3e')]);for(var _0x468584=0x0,_0x4a9965={},_0x2d95d0={};_0x468584<_0x41f1b6['length'];_0x468584+=0x1){_0x4a9965=_0x41f1b6[_0x468584];if(_[_0x0fa4('0x3b')](_0x1f9fae[_0x0fa4('0x3e')][util[_0x0fa4('0x20')](_0x0fa4('0x3a'),_0x4a9965[_0x0fa4('0x24')])])){_0x1f9fae[_0x0fa4('0x3e')][util[_0x0fa4('0x20')](_0x0fa4('0x3a'),_0x4a9965[_0x0fa4('0x24')])]=new Trunk(_0x4a9965);}else{_0x1f9fae[_0x0fa4('0x37')](_0x1f9fae[_0x0fa4('0x3e')][util['format']('SIP/%s',_0x4a9965[_0x0fa4('0x24')])],_0x4a9965);}}}return _0x1f9fae[_0x0fa4('0x3e')];};};Realtime[_0x0fa4('0x38')][_0x0fa4('0x3f')]=function(){var _0x1df352=this;return function(_0x408c0c){if(_0x408c0c){freeIsNotKey(_0x408c0c,_0x1df352['voiceQueues'],'name');for(var _0x324710=0x0,_0x30ee45={},_0x478065={};_0x324710<_0x408c0c['length'];_0x324710+=0x1){_0x30ee45=_0x408c0c[_0x324710];if(_[_0x0fa4('0x3b')](_0x1df352[_0x0fa4('0x40')][_0x30ee45[_0x0fa4('0x24')]])){_0x1df352[_0x0fa4('0x40')][_0x30ee45['name']]=new VoiceQueue(_0x30ee45);}else{_0x1df352[_0x0fa4('0x37')](_0x1df352['voiceQueues'][_0x30ee45['name']],_0x30ee45);}}}return _0x1df352[_0x0fa4('0x40')];};};Realtime[_0x0fa4('0x38')][_0x0fa4('0x41')]=function(){var _0x2f19f2=this;return function(_0x249c7e){if(_0x249c7e){freeIsNotKey(_0x249c7e,_0x2f19f2[_0x0fa4('0x10')],'id');for(var _0x505ee5=0x0,_0x25f4f5={},_0x4cf297={};_0x505ee5<_0x249c7e[_0x0fa4('0x39')];_0x505ee5+=0x1){_0x25f4f5=_0x249c7e[_0x505ee5];if(_[_0x0fa4('0x3b')](_0x2f19f2[_0x0fa4('0x10')][_0x25f4f5['id']])){_0x2f19f2['triggers'][_0x25f4f5['id']]=new Trigger(_0x25f4f5);}else{_0x2f19f2['mergeFromDatabase'](_0x2f19f2[_0x0fa4('0x10')][_0x25f4f5['id']],_0x25f4f5);}}}return _0x2f19f2['triggers'];};};Realtime[_0x0fa4('0x38')][_0x0fa4('0x42')]=function(){var _0x43e820=this;return function(_0x4b1577){if(_0x4b1577){freeIsNotKey(_0x4b1577,_0x43e820[_0x0fa4('0x12')],'id');for(var _0x57bb79=0x0,_0x199f49={},_0xe5505c={};_0x57bb79<_0x4b1577[_0x0fa4('0x39')];_0x57bb79+=0x1){_0x199f49=_0x4b1577[_0x57bb79];if(_[_0x0fa4('0x3b')](_0x43e820[_0x0fa4('0x12')][_0x199f49['id']])){_0x43e820['templates'][_0x199f49['id']]=new Template(_0x199f49);}else{_0x43e820['mergeFromDatabase'](_0x43e820[_0x0fa4('0x12')][_0x199f49['id']],_0x199f49);}}}return _0x43e820['templates'];};};Realtime[_0x0fa4('0x38')][_0x0fa4('0x43')]=function(){var _0x5a1cf4=this;return function(_0x2b0527){if(_0x2b0527){freeIsNotKey(_0x2b0527,_0x5a1cf4[_0x0fa4('0x18')],'id');for(var _0x5d17fe=0x0,_0x4527c5={},_0x3352fe={};_0x5d17fe<_0x2b0527[_0x0fa4('0x39')];_0x5d17fe+=0x1){_0x4527c5=_0x2b0527[_0x5d17fe];if(_['isUndefined'](_0x5a1cf4[_0x0fa4('0x18')][_0x4527c5['id']])){_0x5a1cf4[_0x0fa4('0x18')][_0x4527c5['id']]=new ZendeskAccount(_0x4527c5);}else{_0x5a1cf4[_0x0fa4('0x37')](_0x5a1cf4['zendeskAccounts'][_0x4527c5['id']],_0x4527c5);}}}return _0x5a1cf4['zendeskAccounts'];};};Realtime[_0x0fa4('0x38')]['initSalesforceAccounts']=function(){var _0x160fb5=this;return function(_0xa335fe){if(_0xa335fe){freeIsNotKey(_0xa335fe,_0x160fb5[_0x0fa4('0x19')],'id');for(var _0x43b098=0x0,_0x3a7a69={},_0x472224={};_0x43b098<_0xa335fe[_0x0fa4('0x39')];_0x43b098+=0x1){_0x3a7a69=_0xa335fe[_0x43b098];if(_['isUndefined'](_0x160fb5['salesforceAccounts'][_0x3a7a69['id']])){_0x160fb5[_0x0fa4('0x19')][_0x3a7a69['id']]=new SalesforceAccount(_0x3a7a69);}else{_0x160fb5[_0x0fa4('0x37')](_0x160fb5['salesforceAccounts'][_0x3a7a69['id']],_0x3a7a69);}}}return _0x160fb5['salesforceAccounts'];};};Realtime[_0x0fa4('0x38')]['initFreshdeskAccounts']=function(){var _0x1bca6e=this;return function(_0x856ba1){if(_0x856ba1){freeIsNotKey(_0x856ba1,_0x1bca6e[_0x0fa4('0x1a')],'id');for(var _0x1fd010=0x0,_0x284550={},_0x5eed3d={};_0x1fd010<_0x856ba1[_0x0fa4('0x39')];_0x1fd010+=0x1){_0x284550=_0x856ba1[_0x1fd010];if(_[_0x0fa4('0x3b')](_0x1bca6e[_0x0fa4('0x1a')][_0x284550['id']])){_0x1bca6e[_0x0fa4('0x1a')][_0x284550['id']]=new FreshdeskAccount(_0x284550);}else{_0x1bca6e[_0x0fa4('0x37')](_0x1bca6e['freshdeskAccounts'][_0x284550['id']],_0x284550);}}}return _0x1bca6e['freshdeskAccounts'];};};Realtime[_0x0fa4('0x38')][_0x0fa4('0x44')]=function(){var _0x1a37bf=this;return function(_0x1f24d8){if(_0x1f24d8){freeIsNotKey(_0x1f24d8,_0x1a37bf['zohoAccounts'],'id');for(var _0x8314e=0x0,_0x38e52f={},_0x15798a={};_0x8314e<_0x1f24d8[_0x0fa4('0x39')];_0x8314e+=0x1){_0x38e52f=_0x1f24d8[_0x8314e];if(_[_0x0fa4('0x3b')](_0x1a37bf[_0x0fa4('0x45')][_0x38e52f['id']])){_0x1a37bf[_0x0fa4('0x45')][_0x38e52f['id']]=new ZohoAccount(_0x38e52f);}else{_0x1a37bf['mergeFromDatabase'](_0x1a37bf['zohoAccounts'][_0x38e52f['id']],_0x38e52f);}}}return _0x1a37bf[_0x0fa4('0x45')];};};Realtime[_0x0fa4('0x38')]['initDeskAccounts']=function(){var _0x407b21=this;return function(_0x249c50){if(_0x249c50){freeIsNotKey(_0x249c50,_0x407b21[_0x0fa4('0x1b')],'id');for(var _0x5d590e=0x0,_0x4a00bd={},_0x4cb388={};_0x5d590e<_0x249c50[_0x0fa4('0x39')];_0x5d590e+=0x1){_0x4a00bd=_0x249c50[_0x5d590e];if(_[_0x0fa4('0x3b')](_0x407b21[_0x0fa4('0x1b')][_0x4a00bd['id']])){_0x407b21['deskAccounts'][_0x4a00bd['id']]=new DeskAccount(_0x4a00bd);}else{_0x407b21[_0x0fa4('0x37')](_0x407b21[_0x0fa4('0x1b')][_0x4a00bd['id']],_0x4a00bd);}}}return _0x407b21['deskAccounts'];};};Realtime[_0x0fa4('0x38')][_0x0fa4('0x46')]=function(){var _0x2fba74=this;return function(_0x4d50e5){if(_0x4d50e5){freeIsNotKey(_0x4d50e5,_0x2fba74[_0x0fa4('0x47')],'id');for(var _0x4564ef=0x0,_0x1af14f={},_0x1e65bf={};_0x4564ef<_0x4d50e5['length'];_0x4564ef+=0x1){_0x1af14f=_0x4d50e5[_0x4564ef];if(_[_0x0fa4('0x3b')](_0x2fba74['sugarcrmAccounts'][_0x1af14f['id']])){_0x2fba74[_0x0fa4('0x47')][_0x1af14f['id']]=new SugarcrmAccount(_0x1af14f);}else{_0x2fba74[_0x0fa4('0x37')](_0x2fba74[_0x0fa4('0x47')][_0x1af14f['id']],_0x1af14f);}}}return _0x2fba74[_0x0fa4('0x47')];};};Realtime[_0x0fa4('0x38')][_0x0fa4('0x48')]=function(){var _0x23a2d1=this;return function(_0x2dad72){if(_0x2dad72){freeIsNotKey(_0x2dad72,_0x23a2d1[_0x0fa4('0x1c')],'id');for(var _0xdee78d=0x0,_0x155ba1={},_0x491c2f={};_0xdee78d<_0x2dad72[_0x0fa4('0x39')];_0xdee78d+=0x1){_0x155ba1=_0x2dad72[_0xdee78d];if(_[_0x0fa4('0x3b')](_0x23a2d1['vtigerAccounts'][_0x155ba1['id']])){_0x23a2d1[_0x0fa4('0x1c')][_0x155ba1['id']]=new VtigerAccount(_0x155ba1);}else{_0x23a2d1['mergeFromDatabase'](_0x23a2d1[_0x0fa4('0x1c')][_0x155ba1['id']],_0x155ba1);}}}return _0x23a2d1[_0x0fa4('0x1c')];};};Realtime['prototype'][_0x0fa4('0x49')]=function(){var _0x12d86a=this;return function(_0x289f0e){if(_0x289f0e){freeIsNotKey(_0x289f0e,_0x12d86a['servicenowAccounts'],'id');for(var _0x4c7e45=0x0,_0x4b7f65={},_0x25bf21={};_0x4c7e45<_0x289f0e[_0x0fa4('0x39')];_0x4c7e45+=0x1){_0x4b7f65=_0x289f0e[_0x4c7e45];if(_[_0x0fa4('0x3b')](_0x12d86a[_0x0fa4('0x4a')][_0x4b7f65['id']])){_0x12d86a['servicenowAccounts'][_0x4b7f65['id']]=new ServicenowAccount(_0x4b7f65);}else{_0x12d86a[_0x0fa4('0x37')](_0x12d86a[_0x0fa4('0x4a')][_0x4b7f65['id']],_0x4b7f65);}}}return _0x12d86a[_0x0fa4('0x4a')];};};Realtime[_0x0fa4('0x38')][_0x0fa4('0x4b')]=function(){var _0xebbf23=this;return function(_0x145198){if(_0x145198){freeIsNotKey(_0x145198,_0xebbf23['dynamics365Accounts'],'id');for(var _0x571393=0x0,_0x576dd6={},_0x3e7804={};_0x571393<_0x145198[_0x0fa4('0x39')];_0x571393+=0x1){_0x576dd6=_0x145198[_0x571393];if(_[_0x0fa4('0x3b')](_0xebbf23[_0x0fa4('0x4c')][_0x576dd6['id']])){_0xebbf23[_0x0fa4('0x4c')][_0x576dd6['id']]=new Dynamics365Account(_0x576dd6);}else{_0xebbf23[_0x0fa4('0x37')](_0xebbf23['dynamics365Accounts'][_0x576dd6['id']],_0x576dd6);}}}return _0xebbf23[_0x0fa4('0x4c')];};};Realtime[_0x0fa4('0x38')]['initFreshsalesAccounts']=function(){var _0x84d29a=this;return function(_0x37d0dc){if(_0x37d0dc){freeIsNotKey(_0x37d0dc,_0x84d29a[_0x0fa4('0x1d')],'id');for(var _0x21b15c=0x0,_0x2c5316={},_0x23d169={};_0x21b15c<_0x37d0dc[_0x0fa4('0x39')];_0x21b15c+=0x1){_0x2c5316=_0x37d0dc[_0x21b15c];if(_[_0x0fa4('0x3b')](_0x84d29a[_0x0fa4('0x1d')][_0x2c5316['id']])){_0x84d29a[_0x0fa4('0x1d')][_0x2c5316['id']]=new FreshsalesAccount(_0x2c5316);}else{_0x84d29a[_0x0fa4('0x37')](_0x84d29a['freshsalesAccounts'][_0x2c5316['id']],_0x2c5316);}}}return _0x84d29a[_0x0fa4('0x1d')];};};Realtime[_0x0fa4('0x38')][_0x0fa4('0x4d')]=function(){var _0x2ded4c=this;return function(_0x554dfe){for(var _0x1fcafa=0x0;_0x1fcafa<_0x554dfe['length'];_0x1fcafa+=0x1){_[_0x0fa4('0x4e')](_0x2ded4c['voiceQueues'][_0x554dfe[_0x1fcafa][_0x0fa4('0x24')]],_0x554dfe[_0x1fcafa]);}return _0x2ded4c[_0x0fa4('0x40')];};};Realtime[_0x0fa4('0x38')]['initVoiceQueueReports']=function(){var _0x259094=this;return function(_0x306c3c){clearVoiceQueues(_0x259094[_0x0fa4('0x40')]);if(_0x306c3c){_0x306c3c=_[_0x0fa4('0x4f')](_0x306c3c,'uniqueid');for(var _0x13c9c9 in _0x306c3c){if(_0x306c3c[_0x0fa4('0x21')](_0x13c9c9)){var _0x31de53={};for(var _0xfa5d2=0x0;_0xfa5d2<_0x306c3c[_0x13c9c9][_0x0fa4('0x39')];_0xfa5d2+=0x1){var _0x53a95a=_0x306c3c[_0x13c9c9][_0xfa5d2][_0x0fa4('0x50')];if(_0x259094[_0x0fa4('0x40')][_0x53a95a]){if(_0x306c3c[_0x13c9c9][_0xfa5d2][_0x0fa4('0x51')]){_0x259094['voiceQueues'][_0x53a95a][_0x0fa4('0x2d')]+=0x1;}if(_0x306c3c[_0x13c9c9][_0xfa5d2][_0x0fa4('0x52')]){_0x259094[_0x0fa4('0x40')][_0x53a95a][_0x0fa4('0x2e')]+=0x1;}_0x259094[_0x0fa4('0x40')][_0x53a95a][_0x0fa4('0x27')]+=moment(_0x306c3c[_0x13c9c9][_0xfa5d2][_0x0fa4('0x53')])[_0x0fa4('0x54')](moment(_0x306c3c[_0x13c9c9][_0xfa5d2]['queuecallerjoinAt']),_0x0fa4('0x55'))||0x0;if(_0xfa5d2===_0x306c3c[_0x13c9c9][_0x0fa4('0x39')]-0x1){_0x259094['voiceQueues'][_0x53a95a][_0x0fa4('0x28')]+=moment(_0x306c3c[_0x13c9c9][_0xfa5d2][_0x0fa4('0x56')]||_0x306c3c[_0x13c9c9][_0xfa5d2]['queuecallerabandonAt']||_0x306c3c[_0x13c9c9][_0xfa5d2][_0x0fa4('0x57')])['diff'](moment(_0x306c3c[_0x13c9c9][_0xfa5d2][_0x0fa4('0x58')]),_0x0fa4('0x55'))||0x0;_0x259094[_0x0fa4('0x40')][_0x53a95a]['total']+=0x1;if(_0x306c3c[_0x13c9c9][_0xfa5d2]['queuecallercomplete']){_0x259094[_0x0fa4('0x40')][_0x53a95a]['answered']+=0x1;_0x259094[_0x0fa4('0x40')][_0x53a95a][_0x0fa4('0x29')]+=moment(_0x306c3c[_0x13c9c9][_0xfa5d2][_0x0fa4('0x56')])[_0x0fa4('0x54')](moment(_0x306c3c[_0x13c9c9][_0xfa5d2]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x259094[_0x0fa4('0x40')][_0x53a95a][_0x0fa4('0x28')]+=_0x259094['voiceQueues'][_0x53a95a]['sumHoldTime']||0x0;}}}}}}return _0x259094[_0x0fa4('0x40')];};};Realtime['prototype'][_0x0fa4('0x59')]=function(){var _0x220207=this;return function(_0x4b62bd){clearVoiceCallReports(_0x220207[_0x0fa4('0x13')]);if(_0x4b62bd){for(var _0x318a34=0x0;_0x318a34<_0x4b62bd[_0x0fa4('0x39')];_0x318a34+=0x1){_0x220207[_0x0fa4('0x13')][_0x0fa4('0x25')]+=0x1;_0x220207['outbound'][_0x0fa4('0x28')]+=_0x4b62bd[_0x318a34][_0x0fa4('0x5a')];if(_0x4b62bd[_0x318a34][_0x0fa4('0x5b')]===_0x0fa4('0x5c')){_0x220207['outbound'][_0x0fa4('0x26')]+=0x1;_0x220207[_0x0fa4('0x13')][_0x0fa4('0x27')]+=_0x4b62bd[_0x318a34][_0x0fa4('0x5a')]-_0x4b62bd[_0x318a34][_0x0fa4('0x5d')]||0x0;_0x220207[_0x0fa4('0x13')]['sumBillable']+=_0x4b62bd[_0x318a34][_0x0fa4('0x5d')];}}}return _0x220207['outbound'];};};Realtime[_0x0fa4('0x38')][_0x0fa4('0x5e')]=function(){var _0x2ab538=this;return function(_0x306be7){if(_0x306be7){freeIsNotKey(_0x306be7,_0x2ab538[_0x0fa4('0x11')],'name');for(var _0x8e579d=0x0,_0x3e4f5b={};_0x8e579d<_0x306be7['length'];_0x8e579d+=0x1){_0x3e4f5b=_0x306be7[_0x8e579d];if(_['isUndefined'](_0x2ab538[_0x0fa4('0x11')][_0x3e4f5b[_0x0fa4('0x24')]])){_0x2ab538['campaigns'][_0x3e4f5b['name']]=new Campaign(_0x3e4f5b);}else{_0x2ab538['mergeFromDatabase'](_0x2ab538[_0x0fa4('0x11')][_0x3e4f5b[_0x0fa4('0x24')]],_0x3e4f5b);_0x2ab538[_0x0fa4('0x11')][_0x3e4f5b[_0x0fa4('0x24')]]['dialQueueProject']=_0x3e4f5b[_0x0fa4('0x5f')]?_0x3e4f5b['SquareProject']['name']:undefined;}}}return _0x2ab538[_0x0fa4('0x11')];};};Realtime[_0x0fa4('0x38')][_0x0fa4('0x60')]=function(){var _0x31191c=this;return function(_0x274c07){if(_0x274c07){freeIsNotKey(_0x274c07,_0x31191c[_0x0fa4('0x61')],'id');for(var _0x45dfc2=0x0,_0x29551b={};_0x45dfc2<_0x274c07['length'];_0x45dfc2+=0x1){_0x29551b=_0x274c07[_0x45dfc2];if(_[_0x0fa4('0x3b')](_0x31191c[_0x0fa4('0x61')][_0x29551b['id']])){_0x31191c[_0x0fa4('0x61')][_0x29551b['id']]=new VoiceExtension(_0x29551b);}else{_0x31191c[_0x0fa4('0x37')](_0x31191c[_0x0fa4('0x61')][_0x29551b['id']],_0x29551b);}}}return _0x31191c['voiceExtensions'];};};Realtime[_0x0fa4('0x38')][_0x0fa4('0x62')]=function(){var _0x1f0e5=this;return function(_0xb747c7){clearCampaigns(_0x1f0e5['campaigns']);for(var _0x50e34f=0x0;_0x50e34f<_0xb747c7[_0x0fa4('0x39')];_0x50e34f+=0x1){_[_0x0fa4('0x4e')](_0x1f0e5[_0x0fa4('0x11')][_0xb747c7[_0x50e34f][_0x0fa4('0x24')]],_0xb747c7[_0x50e34f]);}return _0x1f0e5[_0x0fa4('0x11')];};};Realtime['prototype']['initFaxAccounts']=function(){var _0x347a75=this;return function(_0x1bb44c){if(_0x1bb44c){freeIsNotKey(_0x1bb44c,_0x347a75[_0x0fa4('0x1e')],'id');for(var _0x1f241c=0x0,_0x488a32={},_0xb6233e={};_0x1f241c<_0x1bb44c[_0x0fa4('0x39')];_0x1f241c+=0x1){_0x488a32=_0x1bb44c[_0x1f241c];if(_[_0x0fa4('0x3b')](_0x347a75[_0x0fa4('0x1e')][_0x488a32['id']])){_0x347a75[_0x0fa4('0x1e')][_0x488a32['id']]=new FaxAccount(_0x488a32);}else{_0x347a75[_0x0fa4('0x37')](_0x347a75['faxAccounts'][_0x488a32['id']],_0x488a32);}}}return _0x347a75[_0x0fa4('0x1e')];};};module[_0x0fa4('0x63')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 1950c84..0ea8a74 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 _0x05e2=['./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','find','accountcode','name','interface','format','SIP/%s','length','findAgent','assigned','lastAssignedTo','isNil','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','getCallType','channel','calleridnum','outbound','destination','exten','dialer','lastapplication','lastdata','queue','context','from-voip-provider','callerid','from-sip','originatecalleridnum','destinationchannel','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','type','UserId','monitor','monitors','monitorFilename','filename','createdAt','xcally-motion-preview','connectedlinename','membername','xcally-motion-dialer','voiceAgentReport','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','attendedTransfer','lodash','util','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport'];(function(_0x554564,_0x4eb8ed){var _0x43207c=function(_0x432a39){while(--_0x432a39){_0x554564['push'](_0x554564['shift']());}};_0x43207c(++_0x4eb8ed);}(_0x05e2,0xb7));var _0x205e=function(_0x48ec91,_0x212edc){_0x48ec91=_0x48ec91-0x0;var _0x22766c=_0x05e2[_0x48ec91];return _0x22766c;};'use strict';var _=require(_0x205e('0x0'));var moment=require('moment');var util=require(_0x205e('0x1'));var config=require('../../../config/environment');var ami=require(_0x205e('0x2'));var RpcVoiceAgentReport=require(_0x205e('0x3'));var RpcVoiceCallReport=require(_0x205e('0x4'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x205e('0x5'));var RpcVoiceQueueReport=require(_0x205e('0x6'));var RpcVoiceRecording=require(_0x205e('0x7'));var RpcVoiceTransferReport=require(_0x205e('0x8'));var VoiceQueueReport=require(_0x205e('0x9'));var VoiceCallReport=require(_0x205e('0xa'));var VoiceAgentReport=require(_0x205e('0xb'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x205e('0xc'));function Report(_0x11f392){this['realtime']=_0x11f392;this[_0x205e('0xd')]=_0x11f392[_0x205e('0xd')];this[_0x205e('0xe')]=_0x11f392[_0x205e('0xe')];}Report[_0x205e('0xf')][_0x205e('0x10')]=function(_0x3dd7da){var _0x1b6182=new VoiceQueueReport(this['realtime']);var _0x4b9d74=new VoiceAgentReport(this['realtime']);var _0x30b32c=new VoiceDialReport(this[_0x205e('0x11')]);var _0x2dc754=new VoiceCallReport(this['realtime']);var _0x3e4e76=new UserReport(this[_0x205e('0x11')]);if(config[_0x205e('0x12')]&&config['xdr']['disabled']){ami['on']('custom:voiceQueueReport',this[_0x205e('0x13')][_0x205e('0x14')](this));ami['on'](_0x205e('0x15'),this[_0x205e('0x16')][_0x205e('0x14')](this));ami['on'](_0x205e('0x17'),this['voiceAgentReport'][_0x205e('0x14')](this));ami['on'](_0x205e('0x18'),this[_0x205e('0x19')][_0x205e('0x14')](this));ami['on']('blindtransfer',this[_0x205e('0x1a')][_0x205e('0x14')](this));ami['on'](_0x205e('0x1b'),this['attendedTransfer']['bind'](this));}};Report[_0x205e('0xf')]['findAgent']=function(_0x1b85f8){var _0x16292e;_0x16292e=_[_0x205e('0x1c')](this[_0x205e('0xd')],function(_0x309fc2){return _0x309fc2[_0x205e('0x1d')]==_0x1b85f8||_0x309fc2[_0x205e('0x1e')]==_0x1b85f8;});if(_['isNil'](_0x16292e)){var _0x1b6170=_['find'](this['telephones'],function(_0x5b1133){return _0x5b1133[_0x205e('0x1d')]==_0x1b85f8||_0x5b1133[_0x205e('0x1e')]==_0x1b85f8;});if(_0x1b6170){_0x16292e=_[_0x205e('0x1c')](this[_0x205e('0xd')],function(_0x1e9ccf){return _0x1e9ccf[_0x205e('0x1f')]==util[_0x205e('0x20')](_0x205e('0x21'),_0x1b6170[_0x205e('0x1e')]);});}}return _0x16292e;};Report['prototype']['voiceQueueReport']=function(_0x57180e){for(var _0x23f919=0x0;_0x23f919<_0x57180e[_0x205e('0x22')];_0x23f919+=0x1){var _0x2c217d=this[_0x205e('0x23')](_0x57180e[_0x23f919]['connectedlinenum']);if(_0x2c217d){_0x57180e[_0x23f919][_0x205e('0x1d')]=_0x2c217d[_0x205e('0x1d')];_0x57180e[_0x23f919][_0x205e('0x24')]=!![];_0x57180e[_0x23f919][_0x205e('0x25')]=_0x2c217d['name'];_0x57180e[_0x23f919][_0x205e('0x1f')]=_[_0x205e('0x26')](_0x2c217d[_0x205e('0x1f')])?util[_0x205e('0x20')](_0x205e('0x21'),_0x2c217d[_0x205e('0x1e')]):_0x2c217d[_0x205e('0x1f')];if(_0x57180e[_0x23f919][_0x205e('0x27')]){_0x57180e[_0x23f919][_0x205e('0x28')]=moment()[_0x205e('0x20')](_0x205e('0x29'));}if(_0x57180e[_0x23f919][_0x205e('0x2a')]){_0x57180e[_0x23f919][_0x205e('0x2b')]=moment()[_0x205e('0x20')](_0x205e('0x29'));}RpcMemberReport['voiceQueueReport'](_0x57180e[_0x23f919]);}RpcVoiceQueueReport[_0x205e('0x2c')](_0x57180e[_0x23f919]);}};function extractCalleridNumber(_0x4b1303){var _0x159882=_0x4b1303[_0x205e('0x2d')](/<(.*?)>/);return _0x159882?_0x159882[0x1]:_0x4b1303;}Report[_0x205e('0xf')][_0x205e('0x2e')]=function(_0x28e50a){for(var _0x4c315a=0x0;_0x4c315a','calleridname','transfers','linkedid','uniqueid','UserId','membername','create','monitor','monitors','monitorFilename','createdAt','exten','connectedlinename','xcally-motion-dialer','voiceAgentReport','forEach','startsWith','substring','indexOf','mobile','phone','lastIndexOf','blindTransfer','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr'];(function(_0x2a3aea,_0x19856d){var _0x57e861=function(_0x407a5f){while(--_0x407a5f){_0x2a3aea['push'](_0x2a3aea['shift']());}};_0x57e861(++_0x19856d);}(_0x8ef3,0xa0));var _0x38ef=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x8ef3[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var moment=require(_0x38ef('0x0'));var util=require(_0x38ef('0x1'));var config=require(_0x38ef('0x2'));var ami=require(_0x38ef('0x3'));var RpcVoiceAgentReport=require(_0x38ef('0x4'));var RpcVoiceCallReport=require(_0x38ef('0x5'));var RpcVoiceDialReport=require(_0x38ef('0x6'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x38ef('0x7'));var VoiceQueueReport=require(_0x38ef('0x8'));var VoiceCallReport=require(_0x38ef('0x9'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x38ef('0xa'));var UserReport=require(_0x38ef('0xb'));function Report(_0x2449e2){this[_0x38ef('0xc')]=_0x2449e2;this[_0x38ef('0xd')]=_0x2449e2[_0x38ef('0xd')];this[_0x38ef('0xe')]=_0x2449e2['telephones'];}Report[_0x38ef('0xf')][_0x38ef('0x10')]=function(_0x4e208d){var _0x2a8516=new VoiceQueueReport(this[_0x38ef('0xc')]);var _0xefc6c4=new VoiceAgentReport(this[_0x38ef('0xc')]);var _0x11126e=new VoiceDialReport(this[_0x38ef('0xc')]);var _0x1e60e5=new VoiceCallReport(this[_0x38ef('0xc')]);var _0x3a5c58=new UserReport(this[_0x38ef('0xc')]);if(config['xdr']&&config[_0x38ef('0x11')][_0x38ef('0x12')]){ami['on'](_0x38ef('0x13'),this['voiceQueueReport']['bind'](this));ami['on'](_0x38ef('0x14'),this['voiceCallReport'][_0x38ef('0x15')](this));ami['on'](_0x38ef('0x16'),this['voiceAgentReport'][_0x38ef('0x15')](this));ami['on']('custom:voiceDialReport',this[_0x38ef('0x17')][_0x38ef('0x15')](this));ami['on'](_0x38ef('0x18'),this['blindTransfer'][_0x38ef('0x15')](this));ami['on'](_0x38ef('0x19'),this[_0x38ef('0x1a')][_0x38ef('0x15')](this));}};Report[_0x38ef('0xf')][_0x38ef('0x1b')]=function(_0x44c996){var _0x3ad47f;_0x3ad47f=_['find'](this['agents'],function(_0x536b82){return _0x536b82['accountcode']==_0x44c996||_0x536b82['name']==_0x44c996;});if(_[_0x38ef('0x1c')](_0x3ad47f)){var _0x20c466=_['find'](this['telephones'],function(_0x8aba63){return _0x8aba63['accountcode']==_0x44c996||_0x8aba63['name']==_0x44c996;});if(_0x20c466){_0x3ad47f=_[_0x38ef('0x1d')](this['agents'],function(_0x47be0f){return _0x47be0f[_0x38ef('0x1e')]==util[_0x38ef('0x1f')](_0x38ef('0x20'),_0x20c466['name']);});}}return _0x3ad47f;};Report[_0x38ef('0xf')][_0x38ef('0x21')]=function(_0x497d5a){for(var _0x2ea381=0x0;_0x2ea381<_0x497d5a[_0x38ef('0x22')];_0x2ea381+=0x1){var _0x1029f1=this[_0x38ef('0x1b')](_0x497d5a[_0x2ea381][_0x38ef('0x23')]);if(_0x1029f1){_0x497d5a[_0x2ea381][_0x38ef('0x24')]=_0x1029f1[_0x38ef('0x24')];_0x497d5a[_0x2ea381]['assigned']=!![];_0x497d5a[_0x2ea381][_0x38ef('0x25')]=_0x1029f1[_0x38ef('0x26')];_0x497d5a[_0x2ea381][_0x38ef('0x1e')]=_[_0x38ef('0x1c')](_0x1029f1['interface'])?util[_0x38ef('0x1f')](_0x38ef('0x20'),_0x1029f1[_0x38ef('0x26')]):_0x1029f1[_0x38ef('0x1e')];if(_0x497d5a[_0x2ea381][_0x38ef('0x27')]){_0x497d5a[_0x2ea381][_0x38ef('0x28')]=moment()[_0x38ef('0x1f')](_0x38ef('0x29'));}if(_0x497d5a[_0x2ea381][_0x38ef('0x2a')]){_0x497d5a[_0x2ea381][_0x38ef('0x2b')]=moment()[_0x38ef('0x1f')](_0x38ef('0x29'));}RpcMemberReport['voiceQueueReport'](_0x497d5a[_0x2ea381]);}RpcVoiceQueueReport['create'](_0x497d5a[_0x2ea381]);}};function extractCalleridNumber(_0x30d485){var _0x53934e=_0x30d485['match'](/<(.*?)>/);return _0x53934e?_0x53934e[0x1]:_0x30d485;}Report[_0x38ef('0xf')][_0x38ef('0x2c')]=function(_0x41540c){for(var _0x4f5c69=0x0;_0x4f5c690x0?_0x12dd93:0x0;this[_0x4157('0x11')][_0x5a288f[_0x4157('0x66')]][_0x4157('0x31')]=this[_0x4157('0x11')][_0x5a288f[_0x4157('0x66')]][_0x4157('0x31')]>_[_0x4157('0x6b')](_0x5a288f[_0x4157('0x6d')])?_['toNumber'](_0x5a288f[_0x4157('0x6d')]):this[_0x4157('0x11')][_0x5a288f[_0x4157('0x66')]][_0x4157('0x31')];this['emitVoiceQueueSummary'](this[_0x4157('0x11')][_0x5a288f[_0x4157('0x66')]],_0x4157('0x15'));}logger['debug']('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x4157('0x3b')](this[_0x4157('0x11')][_0x5a288f[_0x4157('0x66')]],{'showHidden':![],'depth':null}));ami['emit']('custom:queuesummary',this['voiceQueues'][_0x5a288f['queue']]);}}}catch(_0x106bff){logger['error'](_0x4157('0x65'),util[_0x4157('0x3b')](_0x106bff,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4157('0x8')]['syncQueueSummaryComplete']=function(_0x1da069){logger[_0x4157('0x42')](_0x4157('0x6e'),util[_0x4157('0x3b')](_0x1da069,{'showHidden':![],'depth':null}));this[_0x4157('0x12')]=!![];};VoiceQueueReport[_0x4157('0x8')][_0x4157('0x1a')]=function(_0x4da627){try{if(this['isNotNull'](_0x4da627)){logger[_0x4157('0x42')]('[%s][voiceQueueReport][queuecallerjoin]',_0x4da627[_0x4157('0x45')],util[_0x4157('0x3b')](_0x4da627,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x4157('0xd')][_0x4da627[_0x4157('0x45')]]))this[_0x4157('0xd')][_0x4da627['uniqueid']]=[];if(_['isUndefined'](this[_0x4157('0xf')][_0x4da627[_0x4157('0x45')]]))this[_0x4157('0xf')][_0x4da627[_0x4157('0x45')]]={};var _0x655ec6=new QueueReport();_0x655ec6[_0x4157('0x47')]=_0x4da627[_0x4157('0x66')];_0x655ec6[_0x4157('0x4f')]=this[_0x4157('0x11')][_0x655ec6[_0x4157('0x47')]]&&this[_0x4157('0x11')][_0x655ec6['name']][_0x4157('0x4f')]?this['voiceQueues'][_0x655ec6['name']][_0x4157('0x4f')]||_0x4157('0x50'):_0x4157('0x50');_0x655ec6[_0x4157('0x66')]=_0x4da627['queue'];_0x655ec6['queuecallerjoinAt']=moment()[_0x4157('0x46')](_0x4157('0x6f'));_0x655ec6[_0x4157('0x70')]=_0x4da627[_0x4157('0x70')];_0x655ec6['count']=_0x4da627['count'];_0x655ec6[_0x4157('0x45')]=_0x4da627[_0x4157('0x45')];_0x655ec6[_0x4157('0x71')]=this[_0x4157('0xf')][_0x4da627[_0x4157('0x45')]][_0x4157('0x71')];logger[_0x4157('0x72')](_0x4157('0x73'),_0x655ec6[_0x4157('0x47')],_0x655ec6['type']);_[_0x4157('0x74')](_0x655ec6,_[_0x4157('0x75')](_0x4da627,_[_0x4157('0x76')](_0x655ec6)));this['queueReports'][_0x4da627[_0x4157('0x45')]]['push'](_0x655ec6);this['channels'][_0x4da627[_0x4157('0x45')]]=_0x655ec6;this[_0x4157('0x41')](_0x655ec6,'queuecallerjoin');}}catch(_0x1273fb){logger[_0x4157('0x3a')](_0x4157('0x77'),_0x4da627[_0x4157('0x45')],util[_0x4157('0x3b')](_0x1273fb,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x4157('0x1b')]=function(_0x3e457a){try{if(this['isNotNull'](_0x3e457a)){logger['debug'](_0x4157('0x78'),_0x3e457a['uniqueid'],util[_0x4157('0x3b')](_0x3e457a,{'showHidden':![],'depth':null}));if(this[_0x4157('0xd')][_0x3e457a['uniqueid']]){var _0x1879f4=_[_0x4157('0x79')](this[_0x4157('0xd')][_0x3e457a[_0x4157('0x45')]]);_0x1879f4[_0x4157('0x7a')]=![];_0x1879f4[_0x4157('0x7b')]=null;_0x1879f4[_0x4157('0x7c')]=_0x3e457a[_0x4157('0x7c')];_0x1879f4[_0x4157('0x7d')]=_0x3e457a[_0x4157('0x7d')];_0x1879f4['queuecallerabandon']=!![];_0x1879f4[_0x4157('0x7e')]=moment()[_0x4157('0x46')](_0x4157('0x6f'));_0x1879f4[_0x4157('0x7f')]=_0x4157('0x80');_0x1879f4[_0x4157('0x81')]=null;logger[_0x4157('0x72')](_0x4157('0x82'),_0x1879f4[_0x4157('0x47')],_0x1879f4[_0x4157('0x4f')]);this[_0x4157('0xf')][_0x3e457a[_0x4157('0x45')]]=_0x1879f4;this[_0x4157('0x3e')](_0x1879f4,'queuecallerabandon');}}}catch(_0xa3bac5){logger['error'](_0x4157('0x78'),_0x3e457a[_0x4157('0x45')],util[_0x4157('0x3b')](_0xa3bac5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4157('0x8')][_0x4157('0x1d')]=function(_0xe191f7){try{if(this[_0x4157('0x5f')](_0xe191f7)){logger[_0x4157('0x42')](_0x4157('0x83'),_0xe191f7[_0x4157('0x45')],util[_0x4157('0x3b')](_0xe191f7,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xe191f7['uniqueid']]){var _0x2f66aa=_[_0x4157('0x79')](this[_0x4157('0xd')][_0xe191f7[_0x4157('0x45')]]);_0x2f66aa['queuecallerleaveAt']=moment()[_0x4157('0x46')](_0x4157('0x6f'));_0x2f66aa['connectedlinenum']=_0xe191f7[_0x4157('0x84')];_0x2f66aa['connectedlinename']=_0xe191f7[_0x4157('0x85')];logger[_0x4157('0x72')](_0x4157('0x86'),_0x2f66aa[_0x4157('0x47')],_0x2f66aa[_0x4157('0x4f')],_0xe191f7[_0x4157('0x84')],_0xe191f7[_0x4157('0x85')]);this[_0x4157('0xf')][_0xe191f7[_0x4157('0x45')]]=_0x2f66aa;this[_0x4157('0x41')](_0x2f66aa,_0x4157('0x1c'));}}}catch(_0x54017b){logger[_0x4157('0x3a')]('[%s][voiceQueueReport][queuecallerleave]',_0xe191f7[_0x4157('0x45')],util['inspect'](_0x54017b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4157('0x8')][_0x4157('0x20')]=function(_0x57366f){try{if(this[_0x4157('0x5f')](_0x57366f)){logger['debug'](_0x4157('0x87'),_0x57366f[_0x4157('0x45')],util[_0x4157('0x3b')](_0x57366f,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x57366f[_0x4157('0x45')]]){var _0x3f8b3a=_[_0x4157('0x79')](this[_0x4157('0xd')][_0x57366f[_0x4157('0x45')]]);_0x3f8b3a[_0x4157('0x7a')]=!![];_0x3f8b3a[_0x4157('0x7f')]='COMPLETEDBYAGENT';logger[_0x4157('0x72')](_0x4157('0x88'),_0x3f8b3a[_0x4157('0x47')],_0x3f8b3a[_0x4157('0x4f')]);}}}catch(_0x2a8f2f){logger[_0x4157('0x3a')](_0x4157('0x87'),_0x57366f['uniqueid'],util[_0x4157('0x3b')](_0x2a8f2f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4157('0x8')][_0x4157('0x89')]=function(_0x3de12e){try{if(this[_0x4157('0x5f')](_0x3de12e)){logger['debug'](_0x4157('0x8a'),_0x3de12e['uniqueid'],util[_0x4157('0x3b')](_0x3de12e,{'showHidden':![],'depth':null}));if(this[_0x4157('0xd')][_0x3de12e['uniqueid']]){var _0x2bff0f=_[_0x4157('0x79')](this[_0x4157('0xd')][_0x3de12e[_0x4157('0x45')]]);_0x2bff0f[_0x4157('0x8b')]=![];_0x2bff0f[_0x4157('0x7e')]=null;_0x2bff0f['assigned']=!![];_0x2bff0f[_0x4157('0x81')]=_0x3de12e[_0x4157('0x8c')];_0x2bff0f[_0x4157('0x7c')]=_0x3de12e['holdtime'];_0x2bff0f[_0x4157('0x7a')]=!![];_0x2bff0f[_0x4157('0x8d')]=![];_0x2bff0f[_0x4157('0x8e')]=null;if(!_0x2bff0f[_0x4157('0x8f')]){if(_0x3de12e['reason']=='transfer'){_0x2bff0f[_0x4157('0x7f')]=_0x4157('0x90');logger[_0x4157('0x72')](_0x4157('0x91'),_0x2bff0f[_0x4157('0x47')],_0x2bff0f[_0x4157('0x4f')]);}else{if(_['startsWith'](_0x3de12e[_0x4157('0x92')]['toLowerCase'](),'local/')){if(this[_0x4157('0xd')][_0x3de12e[_0x4157('0x93')]]){var _0x439b16=_[_0x4157('0x79')](this['queueReports'][_0x3de12e[_0x4157('0x93')]]);_0x439b16['queuecallercomplete']=![];_0x439b16[_0x4157('0x8d')]=!![];_0x439b16[_0x4157('0x8e')]=moment(_0x2bff0f[_0x4157('0x94')])[_0x4157('0x95')](_0x3de12e[_0x4157('0x7c')],_0x4157('0x96'))[_0x4157('0x46')](_0x4157('0x6f'));_0x439b16[_0x4157('0x7f')]='FORWARDTRANSFER';_0x439b16[_0x4157('0x8f')]=!![];_0x439b16[_0x4157('0x97')]='FORWARD';_0x439b16[_0x4157('0x98')]=_0x3de12e[_0x4157('0x99')];_0x439b16[_0x4157('0x9a')]=_0x3de12e[_0x4157('0x45')];logger[_0x4157('0x72')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x439b16[_0x4157('0x47')],_0x439b16['type']);var _0x5b3945=this[_0x4157('0xd')][_0x3de12e[_0x4157('0x93')]];this[_0x4157('0xd')][_0x3de12e['linkedid']]=this[_0x4157('0xd')][_0x3de12e[_0x4157('0x45')]];this[_0x4157('0xd')][_0x3de12e['uniqueid']]=_0x5b3945;}}else{_0x2bff0f['queuecallerexitreason']=_0x4157('0x9b')+_0x3de12e['reason']['toUpperCase']();logger[_0x4157('0x72')](_0x4157('0x9c'),_0x2bff0f[_0x4157('0x47')],_0x2bff0f[_0x4157('0x4f')],_0x2bff0f[_0x4157('0x7f')]);}}}this[_0x4157('0xf')][_0x3de12e[_0x4157('0x45')]]=_0x2bff0f;this[_0x4157('0x3e')](_0x2bff0f,'agentcomplete');}}}catch(_0x54b9d2){logger[_0x4157('0x3a')](_0x4157('0x8a'),_0x3de12e[_0x4157('0x45')],util[_0x4157('0x3b')](_0x54b9d2,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x4157('0x22')]=function(_0x40119d){try{if(this['isNotNull'](_0x40119d)){logger['debug']('[%s][voiceQueueReport][varset]',_0x40119d[_0x4157('0x45')],util['inspect'](_0x40119d,{'showHidden':![],'depth':null}));this[_0x4157('0x9d')](_0x40119d['uniqueid'],_[_0x4157('0x76')](_0x40119d[_0x4157('0x9e')])[0x0],_0x40119d[_0x4157('0x9f')]);if(this['queueReports'][_0x40119d[_0x4157('0x45')]]){var _0x2b100c=_[_0x4157('0x79')](this[_0x4157('0xd')][_0x40119d['uniqueid']]);if(_0x2b100c){if(this[_0x4157('0x5f')](_0x40119d[_0x4157('0x9e')])&&this[_0x4157('0x5f')](_0x40119d[_0x4157('0x9e')][_0x4157('0xa0')])){switch(_0x40119d[_0x4157('0x9f')]){case'CONTINUE':_0x2b100c[_0x4157('0x8d')]=![];_0x2b100c[_0x4157('0x8e')]=null;break;case _0x4157('0xa1'):_0x2b100c[_0x4157('0xa2')]=_0x4157('0xa3');_0x2b100c[_0x4157('0x8d')]=!![];_0x2b100c[_0x4157('0x8e')]=moment()[_0x4157('0x46')](_0x4157('0x6f'));_0x2b100c[_0x4157('0xa4')]=moment()[_0x4157('0x46')](_0x4157('0x6f'));logger[_0x4157('0x42')](_0x4157('0xa5'),_0x40119d[_0x4157('0x45')],util[_0x4157('0x3b')](_0x2b100c,{'showHidden':![],'depth':null}));ami['emit'](_0x4157('0xa6'),_0x2b100c);break;default:_0x2b100c[_0x4157('0x8d')]=!![];_0x2b100c[_0x4157('0x8e')]=moment()[_0x4157('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x2b100c[_0x4157('0xa4')]=moment()[_0x4157('0x46')](_0x4157('0x6f'));}_0x2b100c[_0x4157('0x8b')]=![];_0x2b100c[_0x4157('0x7e')]=null;_0x2b100c[_0x4157('0x7f')]=_0x40119d[_0x4157('0x9f')];this[_0x4157('0xf')][_0x40119d[_0x4157('0x45')]]=_0x2b100c;this['emitVoiceQueueChannelRemove'](_0x2b100c,_0x4157('0x21'));}else if(this[_0x4157('0x5f')](_0x40119d[_0x4157('0x9e')])&&this['isNotNull'](_0x40119d[_0x4157('0x9e')][_0x4157('0xa7')])){if(!_0x2b100c['queuecallerabandon']){_0x2b100c[_0x4157('0x8d')]=!![];_0x2b100c[_0x4157('0x8e')]=moment()['format'](_0x4157('0x6f'));_0x2b100c['queuecallerexitreason']=_0x4157('0xa8');_0x2b100c[_0x4157('0xa4')]=moment()[_0x4157('0x46')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x4157('0xf')][_0x40119d[_0x4157('0x45')]]=_0x2b100c;}}logger[_0x4157('0x72')](_0x4157('0xa9'),_0x40119d[_0x4157('0x45')],_0x2b100c[_0x4157('0x47')],_0x2b100c[_0x4157('0x4f')],_['keys'](_0x40119d['variable'])[0x0],_0x40119d[_0x4157('0x9f')]);_0x2b100c[_0x4157('0x14')]=this[_0x4157('0x14')][_0x40119d[_0x4157('0x45')]];}}}}catch(_0x5f0fb3){logger[_0x4157('0x3a')](_0x4157('0xaa'),_0x40119d[_0x4157('0x45')],util[_0x4157('0x3b')](_0x5f0fb3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4157('0x8')][_0x4157('0x9d')]=function(_0x125e06,_0xba6e39,_0x2fb1cb){var _0x293d66=['rtpaudioqos',_0x4157('0xab'),_0x4157('0xac'),_0x4157('0xad'),_0x4157('0xae'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0x4157('0xaf'),_0x4157('0xb0'),_0x4157('0xb1'),'bridgepeer','bridgepvtcallid',_0x4157('0xb2'),'memberdynamic',_0x4157('0xb3'),_0x4157('0xb4'),_0x4157('0x8c'),'memberpenalty',_0x4157('0xb5')];if(!_[_0x4157('0xb6')](_0xba6e39)&&!_['includes'](_0x293d66,_0xba6e39)){if(_[_0x4157('0x60')](this['variables'][_0x125e06])){this['variables'][_0x125e06]={};}this[_0x4157('0x14')][_0x125e06][_0xba6e39]=_0x2fb1cb;}};VoiceQueueReport[_0x4157('0x8')][_0x4157('0x23')]=function(_0x51de1e){try{if(this[_0x4157('0x5f')](_0x51de1e)){logger[_0x4157('0x42')]('[%s][voiceQueueReport][hangup]',_0x51de1e[_0x4157('0x45')],util[_0x4157('0x3b')](_0x51de1e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x51de1e[_0x4157('0x45')]]){for(var _0x2e0a6a=0x0,_0x12b799={};_0x2e0a6a0x0?_0x5291cb:0x0;this[_0xb971('0x13')][_0x3dc5e0[_0xb971('0x5d')]][_0xb971('0x2c')]=this['voiceQueues'][_0x3dc5e0[_0xb971('0x5d')]][_0xb971('0x2c')]>_[_0xb971('0x60')](_0x3dc5e0['loggedin'])?_['toNumber'](_0x3dc5e0[_0xb971('0x61')]):this[_0xb971('0x13')][_0x3dc5e0['queue']][_0xb971('0x2c')];this[_0xb971('0x62')](this[_0xb971('0x13')][_0x3dc5e0[_0xb971('0x5d')]],_0xb971('0x16'));}logger[_0xb971('0x41')](_0xb971('0x63'),util[_0xb971('0x39')](this[_0xb971('0x13')][_0x3dc5e0[_0xb971('0x5d')]],{'showHidden':![],'depth':null}));ami[_0xb971('0x3f')](_0xb971('0x64'),this[_0xb971('0x13')][_0x3dc5e0['queue']]);}}}catch(_0x9ae10b){logger[_0xb971('0x3a')](_0xb971('0x5b'),util[_0xb971('0x39')](_0x9ae10b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb971('0xa')][_0xb971('0x65')]=function(_0x15d18f){logger[_0xb971('0x41')](_0xb971('0x66'),util[_0xb971('0x39')](_0x15d18f,{'showHidden':![],'depth':null}));this[_0xb971('0x14')]=!![];};VoiceQueueReport[_0xb971('0xa')][_0xb971('0x1a')]=function(_0x3740aa){try{if(this[_0xb971('0x59')](_0x3740aa)){logger[_0xb971('0x41')](_0xb971('0x67'),_0x3740aa[_0xb971('0x43')],util[_0xb971('0x39')](_0x3740aa,{'showHidden':![],'depth':null}));if(_[_0xb971('0x68')](this[_0xb971('0xf')][_0x3740aa[_0xb971('0x43')]]))this[_0xb971('0xf')][_0x3740aa[_0xb971('0x43')]]=[];if(_[_0xb971('0x68')](this['channels'][_0x3740aa[_0xb971('0x43')]]))this[_0xb971('0x11')][_0x3740aa['uniqueid']]={};var _0x34a649=new QueueReport();_0x34a649[_0xb971('0x46')]=_0x3740aa['queue'];_0x34a649[_0xb971('0x4c')]=this[_0xb971('0x13')][_0x34a649[_0xb971('0x46')]]&&this['voiceQueues'][_0x34a649['name']]['type']?this[_0xb971('0x13')][_0x34a649[_0xb971('0x46')]][_0xb971('0x4c')]||_0xb971('0x4d'):'inbound';_0x34a649[_0xb971('0x5d')]=_0x3740aa['queue'];_0x34a649[_0xb971('0x69')]=moment()[_0xb971('0x44')](_0xb971('0x6a'));_0x34a649[_0xb971('0x6b')]=_0x3740aa[_0xb971('0x6b')];_0x34a649[_0xb971('0x6c')]=_0x3740aa[_0xb971('0x6c')];_0x34a649['uniqueid']=_0x3740aa[_0xb971('0x43')];_0x34a649[_0xb971('0x6d')]=this[_0xb971('0x11')][_0x3740aa[_0xb971('0x43')]][_0xb971('0x6d')];logger[_0xb971('0x6e')](_0xb971('0x6f'),_0x34a649['name'],_0x34a649[_0xb971('0x4c')]);_[_0xb971('0x70')](_0x34a649,_[_0xb971('0x71')](_0x3740aa,_[_0xb971('0x72')](_0x34a649)));this[_0xb971('0xf')][_0x3740aa[_0xb971('0x43')]][_0xb971('0x73')](_0x34a649);this[_0xb971('0x11')][_0x3740aa[_0xb971('0x43')]]=_0x34a649;this['emitVoiceQueueChannelSave'](_0x34a649,_0xb971('0x74'));}}catch(_0x17e0dc){logger[_0xb971('0x3a')]('[%s][voiceQueueReport][queuecallerjoin]',_0x3740aa[_0xb971('0x43')],util[_0xb971('0x39')](_0x17e0dc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb971('0xa')][_0xb971('0x75')]=function(_0x56897){try{if(this[_0xb971('0x59')](_0x56897)){logger[_0xb971('0x41')](_0xb971('0x76'),_0x56897[_0xb971('0x43')],util[_0xb971('0x39')](_0x56897,{'showHidden':![],'depth':null}));if(this[_0xb971('0xf')][_0x56897[_0xb971('0x43')]]){var _0x477eb9=_[_0xb971('0x77')](this[_0xb971('0xf')][_0x56897[_0xb971('0x43')]]);_0x477eb9[_0xb971('0x78')]=![];_0x477eb9[_0xb971('0x79')]=null;_0x477eb9[_0xb971('0x7a')]=_0x56897[_0xb971('0x7a')];_0x477eb9[_0xb971('0x7b')]=_0x56897[_0xb971('0x7b')];_0x477eb9['queuecallerabandon']=!![];_0x477eb9[_0xb971('0x7c')]=moment()[_0xb971('0x44')]('YYYY-MM-DD\x20HH:mm:ss');_0x477eb9['queuecallerexitreason']=_0xb971('0x7d');_0x477eb9[_0xb971('0x7e')]=null;logger[_0xb971('0x6e')](_0xb971('0x7f'),_0x477eb9[_0xb971('0x46')],_0x477eb9[_0xb971('0x4c')]);this['channels'][_0x56897[_0xb971('0x43')]]=_0x477eb9;this[_0xb971('0x3d')](_0x477eb9,_0xb971('0x80'));}}}catch(_0x52969a){logger['error'](_0xb971('0x76'),_0x56897[_0xb971('0x43')],util['inspect'](_0x52969a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xb971('0x1c')]=function(_0x49db40){try{if(this[_0xb971('0x59')](_0x49db40)){logger['debug'](_0xb971('0x81'),_0x49db40[_0xb971('0x43')],util['inspect'](_0x49db40,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x49db40[_0xb971('0x43')]]){var _0x1a1922=_[_0xb971('0x77')](this[_0xb971('0xf')][_0x49db40[_0xb971('0x43')]]);_0x1a1922[_0xb971('0x82')]=moment()[_0xb971('0x44')](_0xb971('0x6a'));_0x1a1922[_0xb971('0x83')]=_0x49db40[_0xb971('0x83')];_0x1a1922[_0xb971('0x84')]=_0x49db40['connectedlinename'];logger['info'](_0xb971('0x85'),_0x1a1922['name'],_0x1a1922['type'],_0x49db40['connectedlinenum'],_0x49db40[_0xb971('0x84')]);this['channels'][_0x49db40[_0xb971('0x43')]]=_0x1a1922;this[_0xb971('0x40')](_0x1a1922,_0xb971('0x1b'));}}}catch(_0x1b11fe){logger[_0xb971('0x3a')]('[%s][voiceQueueReport][queuecallerleave]',_0x49db40[_0xb971('0x43')],util[_0xb971('0x39')](_0x1b11fe,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb971('0xa')][_0xb971('0x86')]=function(_0x3df5a1){try{if(this[_0xb971('0x59')](_0x3df5a1)){logger[_0xb971('0x41')](_0xb971('0x87'),_0x3df5a1[_0xb971('0x43')],util[_0xb971('0x39')](_0x3df5a1,{'showHidden':![],'depth':null}));if(this[_0xb971('0xf')][_0x3df5a1[_0xb971('0x43')]]){var _0x1774c6=_[_0xb971('0x77')](this[_0xb971('0xf')][_0x3df5a1['uniqueid']]);_0x1774c6['queuecallercomplete']=!![];_0x1774c6[_0xb971('0x88')]=_0xb971('0x89');logger[_0xb971('0x6e')](_0xb971('0x8a'),_0x1774c6[_0xb971('0x46')],_0x1774c6[_0xb971('0x4c')]);}}}catch(_0x5199d9){logger[_0xb971('0x3a')](_0xb971('0x87'),_0x3df5a1['uniqueid'],util[_0xb971('0x39')](_0x5199d9,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xb971('0x8b')]=function(_0x218e43){try{if(this['isNotNull'](_0x218e43)){logger[_0xb971('0x41')]('[%s][voiceQueueReport][agentcomplete]',_0x218e43[_0xb971('0x43')],util['inspect'](_0x218e43,{'showHidden':![],'depth':null}));if(this[_0xb971('0xf')][_0x218e43[_0xb971('0x43')]]){var _0x27b98f=_['last'](this[_0xb971('0xf')][_0x218e43['uniqueid']]);_0x27b98f[_0xb971('0x80')]=![];_0x27b98f[_0xb971('0x7c')]=null;_0x27b98f['assigned']=!![];_0x27b98f[_0xb971('0x7e')]=_0x218e43['membername'];_0x27b98f[_0xb971('0x7a')]=_0x218e43[_0xb971('0x7a')];_0x27b98f[_0xb971('0x78')]=!![];_0x27b98f['queuecallerexit']=![];_0x27b98f['queuecallerexitAt']=null;if(!_0x27b98f[_0xb971('0x8c')]){if(_0x218e43[_0xb971('0x8d')]==_0xb971('0x8c')){_0x27b98f[_0xb971('0x88')]='COMPLETED';logger[_0xb971('0x6e')](_0xb971('0x8e'),_0x27b98f[_0xb971('0x46')],_0x27b98f[_0xb971('0x4c')]);}else{if(_[_0xb971('0x8f')](_0x218e43[_0xb971('0x35')]['toLowerCase'](),_0xb971('0x90'))){if(this[_0xb971('0xf')][_0x218e43[_0xb971('0x91')]]){var _0x212419=_[_0xb971('0x77')](this[_0xb971('0xf')][_0x218e43[_0xb971('0x91')]]);_0x212419[_0xb971('0x78')]=![];_0x212419['queuecallerexit']=!![];_0x212419[_0xb971('0x92')]=moment(_0x27b98f['queuecallerjoinAt'])['add'](_0x218e43[_0xb971('0x7a')],_0xb971('0x93'))[_0xb971('0x44')](_0xb971('0x6a'));_0x212419[_0xb971('0x88')]=_0xb971('0x94');_0x212419[_0xb971('0x8c')]=!![];_0x212419[_0xb971('0x95')]=_0xb971('0x96');_0x212419[_0xb971('0x97')]=_0x218e43[_0xb971('0x98')];_0x212419[_0xb971('0x99')]=_0x218e43[_0xb971('0x43')];logger[_0xb971('0x6e')](_0xb971('0x9a'),_0x212419[_0xb971('0x46')],_0x212419['type']);var _0xae3210=this[_0xb971('0xf')][_0x218e43[_0xb971('0x91')]];this[_0xb971('0xf')][_0x218e43[_0xb971('0x91')]]=this[_0xb971('0xf')][_0x218e43[_0xb971('0x43')]];this['queueReports'][_0x218e43[_0xb971('0x43')]]=_0xae3210;}}else{_0x27b98f[_0xb971('0x88')]=_0xb971('0x9b')+_0x218e43[_0xb971('0x8d')][_0xb971('0x9c')]();logger[_0xb971('0x6e')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x27b98f[_0xb971('0x46')],_0x27b98f['type'],_0x27b98f[_0xb971('0x88')]);}}}this['channels'][_0x218e43[_0xb971('0x43')]]=_0x27b98f;this[_0xb971('0x3d')](_0x27b98f,_0xb971('0x9d'));}}}catch(_0x1a36a6){logger[_0xb971('0x3a')](_0xb971('0x9e'),_0x218e43[_0xb971('0x43')],util[_0xb971('0x39')](_0x1a36a6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb971('0xa')][_0xb971('0x9f')]=function(_0x30331e){try{if(this[_0xb971('0x59')](_0x30331e)){logger[_0xb971('0x41')]('[%s][voiceQueueReport][varset]',_0x30331e['uniqueid'],util[_0xb971('0x39')](_0x30331e,{'showHidden':![],'depth':null}));this[_0xb971('0xa0')](_0x30331e[_0xb971('0x43')],_[_0xb971('0x72')](_0x30331e[_0xb971('0xa1')])[0x0],_0x30331e[_0xb971('0xa2')]);if(this['queueReports'][_0x30331e['uniqueid']]){var _0x27ca41=_[_0xb971('0x77')](this[_0xb971('0xf')][_0x30331e[_0xb971('0x43')]]);if(_0x27ca41){if(this['isNotNull'](_0x30331e[_0xb971('0xa1')])&&this[_0xb971('0x59')](_0x30331e[_0xb971('0xa1')][_0xb971('0xa3')])){switch(_0x30331e[_0xb971('0xa2')]){case _0xb971('0xa4'):_0x27ca41['queuecallerexit']=![];_0x27ca41[_0xb971('0x92')]=null;break;case _0xb971('0xa5'):_0x27ca41[_0xb971('0xa6')]=_0xb971('0xa7');_0x27ca41[_0xb971('0xa8')]=!![];_0x27ca41[_0xb971('0x92')]=moment()[_0xb971('0x44')](_0xb971('0x6a'));_0x27ca41[_0xb971('0x82')]=moment()[_0xb971('0x44')](_0xb971('0x6a'));logger[_0xb971('0x41')](_0xb971('0xa9'),_0x30331e[_0xb971('0x43')],util['inspect'](_0x27ca41,{'showHidden':![],'depth':null}));ami['emit'](_0xb971('0xaa'),_0x27ca41);break;default:_0x27ca41[_0xb971('0xa8')]=!![];_0x27ca41[_0xb971('0x92')]=moment()[_0xb971('0x44')](_0xb971('0x6a'));_0x27ca41[_0xb971('0x82')]=moment()['format'](_0xb971('0x6a'));}_0x27ca41[_0xb971('0x80')]=![];_0x27ca41['queuecallerabandonAt']=null;_0x27ca41['queuecallerexitreason']=_0x30331e['value'];this[_0xb971('0x11')][_0x30331e[_0xb971('0x43')]]=_0x27ca41;this[_0xb971('0x3d')](_0x27ca41,_0xb971('0x1e'));}else if(this['isNotNull'](_0x30331e[_0xb971('0xa1')])&&this[_0xb971('0x59')](_0x30331e['variable'][_0xb971('0xab')])){if(!_0x27ca41[_0xb971('0x80')]){_0x27ca41['queuecallerexit']=!![];_0x27ca41[_0xb971('0x92')]=moment()[_0xb971('0x44')]('YYYY-MM-DD\x20HH:mm:ss');_0x27ca41[_0xb971('0x88')]='EXITWITHKEY';_0x27ca41[_0xb971('0x82')]=moment()[_0xb971('0x44')](_0xb971('0x6a'));this[_0xb971('0x11')][_0x30331e['uniqueid']]=_0x27ca41;}}logger[_0xb971('0x6e')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x30331e[_0xb971('0x43')],_0x27ca41['name'],_0x27ca41[_0xb971('0x4c')],_[_0xb971('0x72')](_0x30331e[_0xb971('0xa1')])[0x0],_0x30331e[_0xb971('0xa2')]);_0x27ca41[_0xb971('0x15')]=this[_0xb971('0x15')][_0x30331e['uniqueid']];}}}}catch(_0x4182fb){logger[_0xb971('0x3a')](_0xb971('0xac'),_0x30331e[_0xb971('0x43')],util[_0xb971('0x39')](_0x4182fb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb971('0xa')][_0xb971('0xa0')]=function(_0xc4cbcf,_0x175242,_0x523931){var _0x452cb6=['rtpaudioqos',_0xb971('0xad'),_0xb971('0xae'),_0xb971('0xaf'),'rtpaudioqosloss',_0xb971('0xb0'),'rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid',_0xb971('0xb1'),_0xb971('0xb2'),_0xb971('0xb3'),_0xb971('0xb4'),'memberdynamic','memberinterface',_0xb971('0xb5'),_0xb971('0xb6'),'memberpenalty',_0xb971('0xb7')];if(!_[_0xb971('0x33')](_0x175242)&&!_[_0xb971('0xb8')](_0x452cb6,_0x175242)){if(_[_0xb971('0x68')](this['variables'][_0xc4cbcf])){this['variables'][_0xc4cbcf]={};}this[_0xb971('0x15')][_0xc4cbcf][_0x175242]=_0x523931;}};VoiceQueueReport['prototype'][_0xb971('0xb9')]=function(_0x2c6ddf){try{if(this[_0xb971('0x59')](_0x2c6ddf)){logger[_0xb971('0x41')]('[%s][voiceQueueReport][hangup]',_0x2c6ddf['uniqueid'],util[_0xb971('0x39')](_0x2c6ddf,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2c6ddf[_0xb971('0x43')]]){for(var _0x4d873e=0x0,_0x38ca02={};_0x4d873e=0x0?moment(_0x378726[_0x3380('0x13')])['diff'](_0x378726[_0x3380('0x14')],_0x3380('0x15')):null,'data1':'outbound','data2':_0x378726[_0x3380('0x10')],'data3':_0x378726['exten'],'data4':_0x378726[_0x3380('0x16')]||null,'role':_0x3380('0xf'),'internal':_0x378726['accountcode']?_[_0x3380('0x11')](_0x378726[_0x3380('0x10')]):undefined,'uniqueid':_0x378726[_0x3380('0x12')]},'log':_0x3380('0x6')});}; \ No newline at end of file +var _0x2647=['Request','membername','starttime','endtime','outbound','dialstring','uniqueid','moment','lodash','util','voiceQueueReport','queuecallerexitAt','CreateMemberReport','voice','lastAssignedTo','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','queue','agent','accountcode','toNumber','voiceDialReport'];(function(_0x6ff2bd,_0x54f28d){var _0x5a6071=function(_0x214af6){while(--_0x214af6){_0x6ff2bd['push'](_0x6ff2bd['shift']());}};_0x5a6071(++_0x54f28d);}(_0x2647,0x7f));var _0x7264=function(_0x4c89cd,_0x2c57e2){_0x4c89cd=_0x4c89cd-0x0;var _0x1090d2=_0x2647[_0x4c89cd];return _0x1090d2;};'use strict';var moment=require(_0x7264('0x0'));var _=require(_0x7264('0x1'));var util=require(_0x7264('0x2'));var client=require('../client');exports[_0x7264('0x3')]=function(_0x2921a5){var _0x2ddce6=_0x2921a5['queuecallercompleteAt']||_0x2921a5[_0x7264('0x4')];return client['Request'](_0x7264('0x5'),{'body':{'channel':_0x7264('0x6'),'membername':_0x2921a5[_0x7264('0x7')],'interface':_['isNil'](_0x2921a5[_0x7264('0x8')])?util[_0x7264('0x9')](_0x7264('0xa'),_0x2921a5['lastAssignedTo']):_0x2921a5[_0x7264('0x8')],'type':_0x7264('0xb'),'enterAt':_0x2921a5[_0x7264('0xc')],'exitAt':_0x2ddce6,'duration':moment(_0x2ddce6)[_0x7264('0xd')](_0x2921a5[_0x7264('0xc')],_0x7264('0xe')),'data1':_0x7264('0xf'),'data2':_0x2921a5[_0x7264('0x10')],'data3':_0x2921a5[_0x7264('0x11')],'data4':null,'data5':_0x2921a5[_0x7264('0x12')],'role':_0x7264('0x13'),'internal':_0x2921a5[_0x7264('0x14')]?_[_0x7264('0x15')](_0x2921a5['accountcode']):undefined,'uniqueid':_0x2921a5['uniqueid']},'log':_0x7264('0x5')});};exports[_0x7264('0x16')]=function(_0x343908){return client[_0x7264('0x17')]('CreateMemberReport',{'body':{'channel':_0x7264('0x6'),'membername':_0x343908[_0x7264('0x18')],'interface':_0x343908[_0x7264('0x8')],'type':'TALKING','enterAt':_0x343908[_0x7264('0x19')],'exitAt':_0x343908[_0x7264('0x1a')],'duration':moment(_0x343908[_0x7264('0x1a')])['diff'](_0x343908[_0x7264('0x19')],_0x7264('0xe'))>=0x0?moment(_0x343908[_0x7264('0x1a')])[_0x7264('0xd')](_0x343908[_0x7264('0x19')],_0x7264('0xe')):null,'data1':_0x7264('0x1b'),'data2':_0x343908['accountcode'],'data3':_0x343908[_0x7264('0x11')],'data4':_0x343908[_0x7264('0x1c')]||null,'role':'agent','internal':_0x343908[_0x7264('0x14')]?_[_0x7264('0x15')](_0x343908[_0x7264('0x14')]):undefined,'uniqueid':_0x343908[_0x7264('0x1d')]},'log':_0x7264('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 237c656..58d3adc 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 _0x69af=['Request','ShowSetting','stopRecordingOnTransfer','GetSettings','getSettings'];(function(_0x577519,_0x346daf){var _0x5b12f7=function(_0x4aecb6){while(--_0x4aecb6){_0x577519['push'](_0x577519['shift']());}};_0x5b12f7(++_0x346daf);}(_0x69af,0x17b));var _0xf69a=function(_0x2a231e,_0x5e8773){_0x2a231e=_0x2a231e-0x0;var _0x3552f5=_0x69af[_0x2a231e];return _0x3552f5;};'use strict';var client=require('../client');exports[_0xf69a('0x0')]=function(){return client[_0xf69a('0x1')](_0xf69a('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xf69a('0x3')]},'log':_0xf69a('0x4')});}; \ No newline at end of file +var _0xde5d=['Request','ShowSetting','../client'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0xde5d,0xd7));var _0xdde5=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xde5d[_0x1facfa];return _0x9ec701;};'use strict';var client=require(_0xdde5('0x0'));exports['getSettings']=function(){return client[_0xdde5('0x1')](_0xdde5('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 43f1c05..a27187f 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 _0xbab7=['GetTemplate','html','../client','getTemplates','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbab7,0x19c));var _0x7bab=function(_0x1196f4,_0x3feffc){_0x1196f4=_0x1196f4-0x0;var _0x1ea2c0=_0xbab7[_0x1196f4];return _0x1ea2c0;};'use strict';var client=require(_0x7bab('0x0'));exports[_0x7bab('0x1')]=function(_0x20fd39){return function(_0x1eda98){return client[_0x7bab('0x2')](_0x7bab('0x3'),{'options':{'raw':!![],'attributes':['id','name',_0x7bab('0x4')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0xcf76=['Request','GetTemplate','name','html','../client'];(function(_0x37510a,_0xbd8503){var _0x5618e5=function(_0x5e1ffd){while(--_0x5e1ffd){_0x37510a['push'](_0x37510a['shift']());}};_0x5618e5(++_0xbd8503);}(_0xcf76,0x10d));var _0x6cf7=function(_0x51c755,_0x13e040){_0x51c755=_0x51c755-0x0;var _0x236cb3=_0xcf76[_0x51c755];return _0x236cb3;};'use strict';var client=require(_0x6cf7('0x0'));exports['getTemplates']=function(_0x467d93){return function(_0x3c0e24){return client[_0x6cf7('0x1')](_0x6cf7('0x2'),{'options':{'raw':!![],'attributes':['id',_0x6cf7('0x3'),_0x6cf7('0x4')]},'log':_0x6cf7('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 9f76eaa..a30030b 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 _0x1c04=['value','Condition','AnyConditions','Actions','action','data2','data3','data5','data6','data7','../client','getTriggers','Request','GetTrigger','name','status','AllConditions','field','operator'];(function(_0x38f017,_0x45a435){var _0x513edb=function(_0x1be08e){while(--_0x1be08e){_0x38f017['push'](_0x38f017['shift']());}};_0x513edb(++_0x45a435);}(_0x1c04,0x8f));var _0x41c0=function(_0x336376,_0xe4b28d){_0x336376=_0x336376-0x0;var _0x1d2a8e=_0x1c04[_0x336376];return _0x1d2a8e;};'use strict';var client=require(_0x41c0('0x0'));exports[_0x41c0('0x1')]=function(_0x24ee12){return function(_0xf6a9e){return client[_0x41c0('0x2')](_0x41c0('0x3'),{'options':{'raw':![],'attributes':['id',_0x41c0('0x4'),'channel',_0x41c0('0x5')],'include':[{'model':'Condition','as':_0x41c0('0x6'),'attributes':['id',_0x41c0('0x7'),_0x41c0('0x8'),_0x41c0('0x9')]},{'model':_0x41c0('0xa'),'as':_0x41c0('0xb'),'attributes':['id',_0x41c0('0x7'),_0x41c0('0x8'),_0x41c0('0x9')]},{'model':'Action','as':_0x41c0('0xc'),'attributes':['id',_0x41c0('0xd'),'data1',_0x41c0('0xe'),_0x41c0('0xf'),'data4',_0x41c0('0x10'),_0x41c0('0x11'),_0x41c0('0x12')]}]},'log':_0x41c0('0x3')});};}; \ No newline at end of file +var _0xb75a=['data6','data7','../client','getTriggers','GetTrigger','name','channel','status','Condition','AllConditions','field','operator','AnyConditions','value','Action','Actions','action','data2','data3','data4','data5'];(function(_0x3c2b2e,_0x3e6e53){var _0x27a338=function(_0x40d29d){while(--_0x40d29d){_0x3c2b2e['push'](_0x3c2b2e['shift']());}};_0x27a338(++_0x3e6e53);}(_0xb75a,0x113));var _0xab75=function(_0x258c5e,_0x407908){_0x258c5e=_0x258c5e-0x0;var _0x4ce92e=_0xb75a[_0x258c5e];return _0x4ce92e;};'use strict';var client=require(_0xab75('0x0'));exports[_0xab75('0x1')]=function(_0x2860f0){return function(_0x28660a){return client['Request'](_0xab75('0x2'),{'options':{'raw':![],'attributes':['id',_0xab75('0x3'),_0xab75('0x4'),_0xab75('0x5')],'include':[{'model':_0xab75('0x6'),'as':_0xab75('0x7'),'attributes':['id',_0xab75('0x8'),_0xab75('0x9'),'value']},{'model':'Condition','as':_0xab75('0xa'),'attributes':['id',_0xab75('0x8'),_0xab75('0x9'),_0xab75('0xb')]},{'model':_0xab75('0xc'),'as':_0xab75('0xd'),'attributes':['id',_0xab75('0xe'),'data1',_0xab75('0xf'),_0xab75('0x10'),_0xab75('0x11'),_0xab75('0x12'),_0xab75('0x13'),_0xab75('0x14')]}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index aa97bb6..a9515d3 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 _0x07c0=['Request','GetTrunk','name','defaultuser','../client','getTrunks'];(function(_0xef8fd0,_0x1929cf){var _0x1f8ca9=function(_0x3302d7){while(--_0x3302d7){_0xef8fd0['push'](_0xef8fd0['shift']());}};_0x1f8ca9(++_0x1929cf);}(_0x07c0,0x18a));var _0x007c=function(_0x540133,_0x41783f){_0x540133=_0x540133-0x0;var _0x26b6e9=_0x07c0[_0x540133];return _0x26b6e9;};'use strict';var client=require(_0x007c('0x0'));exports[_0x007c('0x1')]=function(_0x5ae851){return function(_0x4e496b){return client[_0x007c('0x2')](_0x007c('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x007c('0x4'),'registry',_0x007c('0x5')]},'log':_0x007c('0x3')});};}; \ No newline at end of file +var _0xc9df=['getTrunks'];(function(_0x1c5385,_0x3aba1a){var _0x478ddb=function(_0x7ca4a6){while(--_0x7ca4a6){_0x1c5385['push'](_0x1c5385['shift']());}};_0x478ddb(++_0x3aba1a);}(_0xc9df,0x121));var _0xfc9d=function(_0x47ab8e,_0x22247f){_0x47ab8e=_0x47ab8e-0x0;var _0x579bb1=_0xc9df[_0x47ab8e];return _0x579bb1;};'use strict';var client=require('../client');exports[_0xfc9d('0x0')]=function(_0x36e850){return function(_0x133ae9){return client['Request']('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name','registry','defaultuser']},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index fa152c7..066faaa 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0xe591bb,_0x12ae4a){var _0x39cb8a=function(_0x17f7e3){while(--_0x17f7e3){_0xe591bb['push'](_0xe591bb['shift']());}};_0x39cb8a(++_0x12ae4a);}(_0x70e0,0x17b));var _0x070e=function(_0x478276,_0x1ec2ce){_0x478276=_0x478276-0x0;var _0x4a460d=_0x70e0[_0x478276];return _0x4a460d;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});}; \ No newline at end of file +var _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe706,0xa3));var _0x6e70=function(_0x1ad992,_0x5ddc63){_0x1ad992=_0x1ad992-0x0;var _0x535234=_0xe706[_0x1ad992];return _0x535234;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 61e020c..1b5e473 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 _0x9298=['create','Request','CreateVoiceAgentReport','UpdateVoiceAgentReport','../client'];(function(_0x383c3a,_0x2ee071){var _0x385825=function(_0x3be6fd){while(--_0x3be6fd){_0x383c3a['push'](_0x383c3a['shift']());}};_0x385825(++_0x2ee071);}(_0x9298,0xea));var _0x8929=function(_0x2585c0,_0x3c0dbd){_0x2585c0=_0x2585c0-0x0;var _0x1fcd60=_0x9298[_0x2585c0];return _0x1fcd60;};'use strict';var client=require(_0x8929('0x0'));exports[_0x8929('0x1')]=function(_0x1df9b3){return client[_0x8929('0x2')]('CreateVoiceAgentReport',{'body':_0x1df9b3,'log':_0x8929('0x3')});};exports['update']=function(_0x573539,_0x37ef24,_0x54492f){return client[_0x8929('0x2')]('UpdateVoiceAgentReport',{'body':_0x573539,'options':{'where':{'uniqueid':_0x37ef24,'interface':_0x54492f,'agentcomplete':!![]}},'log':_0x8929('0x4')});}; \ No newline at end of file +var _0x9d06=['create','CreateVoiceAgentReport','update','Request','UpdateVoiceAgentReport'];(function(_0x5aadf2,_0x4d41ea){var _0x583983=function(_0x1ea070){while(--_0x1ea070){_0x5aadf2['push'](_0x5aadf2['shift']());}};_0x583983(++_0x4d41ea);}(_0x9d06,0xd7));var _0x69d0=function(_0x559c57,_0x587b3f){_0x559c57=_0x559c57-0x0;var _0x5b2700=_0x9d06[_0x559c57];return _0x5b2700;};'use strict';var client=require('../client');exports[_0x69d0('0x0')]=function(_0x544c47){return client['Request'](_0x69d0('0x1'),{'body':_0x544c47,'log':_0x69d0('0x1')});};exports[_0x69d0('0x2')]=function(_0x393f74,_0x51eb9a,_0x541eaf){return client[_0x69d0('0x3')]('UpdateVoiceAgentReport',{'body':_0x393f74,'options':{'where':{'uniqueid':_0x51eb9a,'interface':_0x541eaf,'agentcomplete':!![]}},'log':_0x69d0('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 63e3e06..89b574d 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 _0xb30d=['YYYY-MM-DD\x20HH:mm:ss','disposition','duration','billableseconds','GetVoiceCallReports','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','getVoiceCallReports','day','format','endOf'];(function(_0x3f91ee,_0xe0f10e){var _0x50e8a6=function(_0x21a99c){while(--_0x21a99c){_0x3f91ee['push'](_0x3f91ee['shift']());}};_0x50e8a6(++_0xe0f10e);}(_0xb30d,0x8c));var _0xdb30=function(_0x58c851,_0x1f3d96){_0x58c851=_0x58c851-0x0;var _0x534d8a=_0xb30d[_0x58c851];return _0x534d8a;};'use strict';var moment=require('moment');var util=require('util');var _=require('lodash');var client=require(_0xdb30('0x0'));exports[_0xdb30('0x1')]=function(_0x17da35){return client[_0xdb30('0x2')](_0xdb30('0x3'),{'body':_[_0xdb30('0x4')](_0x17da35,{'source':_0x17da35[_0xdb30('0x5')],'destinationcontext':_0x17da35['context'],'callerid':_0x17da35['callerid'],'amaflags':'DOCUMENTATION'}),'log':_0xdb30('0x3')});};exports[_0xdb30('0x6')]=function(){return function(){return client[_0xdb30('0x2')]('GetVoiceCallReport',{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf'](_0xdb30('0x7'))[_0xdb30('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xdb30('0x9')](_0xdb30('0x7'))[_0xdb30('0x8')](_0xdb30('0xa'))]}},'attributes':['type',_0xdb30('0xb'),_0xdb30('0xc'),_0xdb30('0xd')]},'log':_0xdb30('0xe')});};}; \ No newline at end of file +var _0x0bc1=['context','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','duration','GetVoiceCallReports','moment','util','lodash','create','Request','CreateVoiceCallReport','calleridnum'];(function(_0x5eddb1,_0x231ace){var _0x5f2330=function(_0x213348){while(--_0x213348){_0x5eddb1['push'](_0x5eddb1['shift']());}};_0x5f2330(++_0x231ace);}(_0x0bc1,0x70));var _0x10bc=function(_0x49dd0e,_0x3c5941){_0x49dd0e=_0x49dd0e-0x0;var _0x5db66f=_0x0bc1[_0x49dd0e];return _0x5db66f;};'use strict';var moment=require(_0x10bc('0x0'));var util=require(_0x10bc('0x1'));var _=require(_0x10bc('0x2'));var client=require('../client');exports[_0x10bc('0x3')]=function(_0x3465a8){return client[_0x10bc('0x4')](_0x10bc('0x5'),{'body':_['merge'](_0x3465a8,{'source':_0x3465a8[_0x10bc('0x6')],'destinationcontext':_0x3465a8[_0x10bc('0x7')],'callerid':_0x3465a8['callerid'],'amaflags':'DOCUMENTATION'}),'log':_0x10bc('0x5')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x10bc('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x10bc('0x8')],'createdAt':{'$between':[moment()[_0x10bc('0x9')](_0x10bc('0xa'))[_0x10bc('0xb')](_0x10bc('0xc')),moment()[_0x10bc('0xd')](_0x10bc('0xa'))[_0x10bc('0xb')](_0x10bc('0xc'))]}},'attributes':[_0x10bc('0xe'),'disposition',_0x10bc('0xf'),'billableseconds']},'log':_0x10bc('0x10')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 6c6dc84..5342eae 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 _0x6a73=['create','Request','CreateVoiceDialReport'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6a73,0x1e9));var _0x36a7=function(_0x1ab180,_0x382b2c){_0x1ab180=_0x1ab180-0x0;var _0xfb2c2d=_0x6a73[_0x1ab180];return _0xfb2c2d;};'use strict';var client=require('../client');exports[_0x36a7('0x0')]=function(_0x400330){return client[_0x36a7('0x1')](_0x36a7('0x2'),{'body':_0x400330,'log':_0x36a7('0x2')});}; \ No newline at end of file +var _0x138e=['Request','CreateVoiceDialReport','create'];(function(_0x2d2ca8,_0x20b444){var _0x809334=function(_0x351ab4){while(--_0x351ab4){_0x2d2ca8['push'](_0x2d2ca8['shift']());}};_0x809334(++_0x20b444);}(_0x138e,0x8c));var _0xe138=function(_0x367fad,_0x3b5b8f){_0x367fad=_0x367fad-0x0;var _0x30fffe=_0x138e[_0x367fad];return _0x30fffe;};'use strict';var client=require('../client');exports[_0xe138('0x0')]=function(_0x276500){return client[_0xe138('0x1')]('CreateVoiceDialReport',{'body':_0x276500,'log':_0xe138('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 5f31a5a..17dab2f 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 _0x644a=['Request','GetVoiceExtension','exten','../client','getVoiceExtensions'];(function(_0x332de3,_0x38077f){var _0x5ce62d=function(_0x4cabdc){while(--_0x4cabdc){_0x332de3['push'](_0x332de3['shift']());}};_0x5ce62d(++_0x38077f);}(_0x644a,0xfd));var _0xa644=function(_0x2d344f,_0x25fa84){_0x2d344f=_0x2d344f-0x0;var _0x2e796b=_0x644a[_0x2d344f];return _0x2e796b;};'use strict';var client=require(_0xa644('0x0'));exports[_0xa644('0x1')]=function(){return function(){return client[_0xa644('0x2')](_0xa644('0x3'),{'options':{'raw':!![],'attributes':['id',_0xa644('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xa644('0x1')});};}; \ No newline at end of file +var _0x4157=['Request','GetVoiceExtension','exten','../client','getVoiceExtensions'];(function(_0x2390bd,_0x212fbd){var _0x3a969d=function(_0x3dd049){while(--_0x3dd049){_0x2390bd['push'](_0x2390bd['shift']());}};_0x3a969d(++_0x212fbd);}(_0x4157,0xf3));var _0x7415=function(_0x4de541,_0x57f5b8){_0x4de541=_0x4de541-0x0;var _0x37ed73=_0x4157[_0x4de541];return _0x37ed73;};'use strict';var client=require(_0x7415('0x0'));exports[_0x7415('0x1')]=function(){return function(){return client[_0x7415('0x2')](_0x7415('0x3'),{'options':{'raw':!![],'attributes':['id',_0x7415('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x7415('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index cd79a0f..82be93d 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 _0x187d=['monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','callerid','active','mandatoryDispositionPause','Trunk','Interval','interval','getVoiceQueues','../client','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','type','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialAgiAfterHangupAgent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x187d,0x93));var _0xd187=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x187d[_0x2b5eae];return _0x5f3ac9;};'use strict';var client=require(_0xd187('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0xd187('0x1')](_0xd187('0x2'),{'options':{'raw':![],'attributes':['id',_0xd187('0x3'),_0xd187('0x4'),_0xd187('0x5'),_0xd187('0x6'),'monitor_format',_0xd187('0x7'),_0xd187('0x8'),'dialMethod',_0xd187('0x9'),_0xd187('0xa'),_0xd187('0xb'),_0xd187('0xc'),_0xd187('0xd'),_0xd187('0xe'),_0xd187('0xf'),_0xd187('0x10'),'dialOriginateTimeout',_0xd187('0x11'),_0xd187('0x12'),_0xd187('0x13'),_0xd187('0x14'),_0xd187('0x15'),_0xd187('0x16'),'dialBusyRetryFrequency',_0xd187('0x17'),_0xd187('0x18'),_0xd187('0x19'),'dialTimezone',_0xd187('0x1a'),_0xd187('0x1b'),_0xd187('0x1c'),'dialAMDActive',_0xd187('0x1d'),_0xd187('0x1e'),_0xd187('0x1f'),_0xd187('0x20'),'dialAMDMinWordLength',_0xd187('0x21'),_0xd187('0x22'),_0xd187('0x23'),_0xd187('0x24'),'timeout',_0xd187('0x25'),'dialRecallInQueue','dialOrderByScheduledAt',_0xd187('0x26'),'dialAgiAfterHangupClient','dialQueueProject2',_0xd187('0x27'),_0xd187('0x28'),_0xd187('0x29'),_0xd187('0x2a'),_0xd187('0x2b'),_0xd187('0x2c'),_0xd187('0x2d'),_0xd187('0x2e'),_0xd187('0x2f'),_0xd187('0x30'),_0xd187('0x31'),_0xd187('0x32'),_0xd187('0x33'),'dialAgentRejectRetryFrequency',_0xd187('0x34'),_0xd187('0x35'),_0xd187('0x36'),'dialPreviewAutoRecallMe'],'include':[{'model':'Trunk','as':'Trunk','attributes':['id',_0xd187('0x3'),_0xd187('0x37'),_0xd187('0x38')]},{'model':'Pause','as':_0xd187('0x39'),'attributes':['id','name']},{'model':_0xd187('0x3a'),'as':'TrunkBackup','attributes':['id',_0xd187('0x3'),'callerid','active']},{'model':_0xd187('0x3b'),'as':'Interval','attributes':['id',_0xd187('0x3')],'include':[{'model':_0xd187('0x3b'),'as':'Intervals','attributes':['id','name',_0xd187('0x3c')]}]}]},'log':_0xd187('0x3d')});};}; \ No newline at end of file +var _0xfe91=['dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','Trunk','name','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','getVoiceQueues','../client','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfe91,0xd4));var _0x1fe9=function(_0x4f0c2b,_0x2c9d14){_0x4f0c2b=_0x4f0c2b-0x0;var _0x526436=_0xfe91[_0x4f0c2b];return _0x526436;};'use strict';var client=require(_0x1fe9('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request'](_0x1fe9('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x1fe9('0x2'),_0x1fe9('0x3'),_0x1fe9('0x4'),_0x1fe9('0x5'),_0x1fe9('0x6'),_0x1fe9('0x7'),_0x1fe9('0x8'),'dialLimitChannel',_0x1fe9('0x9'),_0x1fe9('0xa'),_0x1fe9('0xb'),'dialPredictiveOptimizationPercentage','dialPredictiveInterval',_0x1fe9('0xc'),_0x1fe9('0xd'),'dialOriginateTimeout',_0x1fe9('0xe'),_0x1fe9('0xf'),_0x1fe9('0x10'),_0x1fe9('0x11'),_0x1fe9('0x12'),_0x1fe9('0x13'),_0x1fe9('0x14'),_0x1fe9('0x15'),'dialNoAnswerRetryFrequency',_0x1fe9('0x16'),_0x1fe9('0x17'),'dialGlobalInterval',_0x1fe9('0x18'),_0x1fe9('0x19'),_0x1fe9('0x1a'),_0x1fe9('0x1b'),_0x1fe9('0x1c'),'dialAMDAfterGreetingSilence',_0x1fe9('0x1d'),_0x1fe9('0x1e'),_0x1fe9('0x1f'),_0x1fe9('0x20'),'dialAMDSilenceThreshold',_0x1fe9('0x21'),_0x1fe9('0x22'),_0x1fe9('0x23'),'dialRecallInQueue',_0x1fe9('0x24'),_0x1fe9('0x25'),_0x1fe9('0x26'),'dialQueueProject2',_0x1fe9('0x5'),_0x1fe9('0x27'),_0x1fe9('0x28'),'dialCutDigit',_0x1fe9('0x29'),'dialNoSuchNumberRetryFrequency',_0x1fe9('0x2a'),_0x1fe9('0x2b'),'dialAbandonedMaxRetry',_0x1fe9('0x2c'),_0x1fe9('0x2d'),_0x1fe9('0x2e'),_0x1fe9('0x2f'),_0x1fe9('0x30'),_0x1fe9('0x31'),'dialPredictiveIntervalMaxThreshold',_0x1fe9('0x32'),'dialPreviewAutoRecallMe'],'include':[{'model':'Trunk','as':_0x1fe9('0x33'),'attributes':['id',_0x1fe9('0x34'),_0x1fe9('0x35'),_0x1fe9('0x36')]},{'model':_0x1fe9('0x37'),'as':_0x1fe9('0x38'),'attributes':['id','name']},{'model':_0x1fe9('0x33'),'as':_0x1fe9('0x39'),'attributes':['id','name',_0x1fe9('0x35'),_0x1fe9('0x36')]},{'model':'Interval','as':_0x1fe9('0x3a'),'attributes':['id',_0x1fe9('0x34')],'include':[{'model':'Interval','as':_0x1fe9('0x3b'),'attributes':['id',_0x1fe9('0x34'),'interval']}]}]},'log':_0x1fe9('0x3c')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 5277a1e..b4ca59f 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(_0x1c3f38,_0x4a1267){var _0x440712=function(_0x557b26){while(--_0x557b26){_0x1c3f38['push'](_0x1c3f38['shift']());}};_0x440712(++_0x4a1267);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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(_0x489e77,_0x218cfe){var _0x1c6295=function(_0x2e8877){while(--_0x2e8877){_0x489e77['push'](_0x489e77['shift']());}};_0x1c6295(++_0x218cfe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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 14e723e..258b88e 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 _0x9020=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x389bf0,_0x54fb90){var _0x56cb9b=function(_0x3d9555){while(--_0x3d9555){_0x389bf0['push'](_0x389bf0['shift']());}};_0x56cb9b(++_0x54fb90);}(_0x9020,0x157));var _0x0902=function(_0x213276,_0x1b22b7){_0x213276=_0x213276-0x0;var _0x3598a9=_0x9020[_0x213276];return _0x3598a9;};'use strict';var client=require(_0x0902('0x0'));exports[_0x0902('0x1')]=function(_0x40093e){return function(){return client[_0x0902('0x2')](_0x0902('0x3'),{'options':{'where':{'VoiceQueueId':_0x40093e,'paused':!![]},'raw':!![]},'log':_0x0902('0x1')});};}; \ No newline at end of file +var _0x933b=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x933b,0x1c4));var _0xb933=function(_0x121018,_0x3267f1){_0x121018=_0x121018-0x0;var _0xcf451c=_0x933b[_0x121018];return _0xcf451c;};'use strict';var client=require(_0xb933('0x0'));exports[_0xb933('0x1')]=function(_0x47a57e){return function(){return client[_0xb933('0x2')](_0xb933('0x3'),{'options':{'where':{'VoiceQueueId':_0x47a57e,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 90acca1..2ece613 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x34d7cc,_0x1ee262){var _0x7de522=function(_0x259551){while(--_0x259551){_0x34d7cc['push'](_0x34d7cc['shift']());}};_0x7de522(++_0x1ee262);}(_0x7a54,0x106));var _0x47a5=function(_0x398968,_0x27c3ec){_0x398968=_0x398968-0x0;var _0xc66f8e=_0x7a54[_0x398968];return _0xc66f8e;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x532f92,_0x3dff5c){var _0x9004e5=function(_0x21e674){while(--_0x21e674){_0x532f92['push'](_0x532f92['shift']());}};_0x9004e5(++_0x3dff5c);}(_0x7a54,0x106));var _0x47a5=function(_0x428b76,_0xea63b3){_0x428b76=_0x428b76-0x0;var _0x439e20=_0x7a54[_0x428b76];return _0x439e20;};'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 817e127..3d9b6cb 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 _0xb201=['transfererchannel','transferercalleridname','transfereraccountcode','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereeexten','transfereelinkedid','context','extension','blind','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetexten','isexternal','origtransferercontext','origtransfererexten','attended','transfers','blindTransfer','Request','CreateVoiceTransferReport'];(function(_0x486151,_0x34d13b){var _0x853b27=function(_0x4b5f8a){while(--_0x4b5f8a){_0x486151['push'](_0x486151['shift']());}};_0x853b27(++_0x34d13b);}(_0xb201,0x193));var _0x1b20=function(_0x56ccc3,_0xee76e4){_0x56ccc3=_0x56ccc3-0x0;var _0x462bdf=_0xb201[_0x56ccc3];return _0x462bdf;};'use strict';var client=require('../client');exports[_0x1b20('0x0')]={};exports[_0x1b20('0x1')]=function(_0x302cec){return client[_0x1b20('0x2')](_0x1b20('0x3'),{'body':{'result':_0x302cec['result'],'transfererchannel':_0x302cec[_0x1b20('0x4')],'transferercalleridnum':_0x302cec['transferercalleridnum'],'transferercalleridname':_0x302cec[_0x1b20('0x5')],'transfererconnectedlinenum':_0x302cec['transfererconnectedlinenum'],'transfererconnectedlinename':_0x302cec['transfererconnectedlinename'],'transfereraccountcode':_0x302cec[_0x1b20('0x6')],'transferercontext':_0x302cec['transferercontext'],'transfererexten':_0x302cec[_0x1b20('0x7')],'transfererlinkedid':_0x302cec['transfererlinkedid'],'transfereechannel':_0x302cec[_0x1b20('0x8')],'transfereecalleridnum':_0x302cec[_0x1b20('0x9')],'transfereecalleridname':_0x302cec[_0x1b20('0xa')],'transfereeconnectedlinenum':_0x302cec[_0x1b20('0xb')],'transfereeconnectedlinename':_0x302cec[_0x1b20('0xc')],'transfereeaccountcode':_0x302cec['transfereeaccountcode'],'transfereecontext':_0x302cec[_0x1b20('0xd')],'transfereeexten':_0x302cec[_0x1b20('0xe')],'transfereelinkedid':_0x302cec[_0x1b20('0xf')],'isexternal':_0x302cec['isexternal'],'context':_0x302cec[_0x1b20('0x10')],'extension':_0x302cec[_0x1b20('0x11')],'type':_0x1b20('0x12')},'log':_0x1b20('0x3')});};exports['attendedTransfer']=function(_0x47387f){return client[_0x1b20('0x2')](_0x1b20('0x3'),{'body':{'result':_0x47387f[_0x1b20('0x13')],'transfererchannel':_0x47387f[_0x1b20('0x14')],'transferercalleridnum':_0x47387f[_0x1b20('0x15')],'transferercalleridname':_0x47387f[_0x1b20('0x16')],'transfererconnectedlinenum':_0x47387f[_0x1b20('0x17')],'transfererconnectedlinename':_0x47387f[_0x1b20('0x18')],'transfereraccountcode':_0x47387f[_0x1b20('0x19')],'transferercontext':_0x47387f['secondtransferercontext'],'transfererexten':_0x47387f['secondtransfererexten'],'transfererlinkedid':_0x47387f[_0x1b20('0x1a')],'transfereechannel':_0x47387f[_0x1b20('0x1b')],'transfereecalleridnum':_0x47387f[_0x1b20('0x1c')],'transfereecalleridname':_0x47387f[_0x1b20('0x1d')],'transfereeconnectedlinenum':_0x47387f[_0x1b20('0x1e')],'transfereeconnectedlinename':_0x47387f['transfertargetconnectedlinename'],'transfereeaccountcode':_0x47387f[_0x1b20('0x1f')],'transfereecontext':_0x47387f['transfertargetcontext'],'transfereeexten':_0x47387f[_0x1b20('0x20')],'transfereelinkedid':_0x47387f['transfertargetlinkedid'],'isexternal':_0x47387f[_0x1b20('0x21')],'context':_0x47387f[_0x1b20('0x22')],'extension':_0x47387f[_0x1b20('0x23')],'type':_0x1b20('0x24')},'log':_0x1b20('0x3')});}; \ No newline at end of file +var _0x93eb=['transfereraccountcode','transfererexten','transfereecalleridnum','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename'];(function(_0x1f9f5f,_0x509fb7){var _0x51d649=function(_0x4a5285){while(--_0x4a5285){_0x1f9f5f['push'](_0x1f9f5f['shift']());}};_0x51d649(++_0x509fb7);}(_0x93eb,0x12e));var _0xb93e=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x93eb[_0x27af45];return _0x18df21;};'use strict';var client=require(_0xb93e('0x0'));exports[_0xb93e('0x1')]={};exports[_0xb93e('0x2')]=function(_0x79287e){return client[_0xb93e('0x3')](_0xb93e('0x4'),{'body':{'result':_0x79287e[_0xb93e('0x5')],'transfererchannel':_0x79287e['transfererchannel'],'transferercalleridnum':_0x79287e[_0xb93e('0x6')],'transferercalleridname':_0x79287e[_0xb93e('0x7')],'transfererconnectedlinenum':_0x79287e[_0xb93e('0x8')],'transfererconnectedlinename':_0x79287e[_0xb93e('0x9')],'transfereraccountcode':_0x79287e[_0xb93e('0xa')],'transferercontext':_0x79287e['transferercontext'],'transfererexten':_0x79287e[_0xb93e('0xb')],'transfererlinkedid':_0x79287e['transfererlinkedid'],'transfereechannel':_0x79287e['transfereechannel'],'transfereecalleridnum':_0x79287e[_0xb93e('0xc')],'transfereecalleridname':_0x79287e['transfereecalleridname'],'transfereeconnectedlinenum':_0x79287e[_0xb93e('0xd')],'transfereeconnectedlinename':_0x79287e['transfereeconnectedlinename'],'transfereeaccountcode':_0x79287e[_0xb93e('0xe')],'transfereecontext':_0x79287e[_0xb93e('0xf')],'transfereeexten':_0x79287e[_0xb93e('0x10')],'transfereelinkedid':_0x79287e[_0xb93e('0x11')],'isexternal':_0x79287e['isexternal'],'context':_0x79287e['context'],'extension':_0x79287e[_0xb93e('0x12')],'type':_0xb93e('0x13')},'log':_0xb93e('0x4')});};exports[_0xb93e('0x14')]=function(_0x456c1d){return client['Request'](_0xb93e('0x4'),{'body':{'result':_0x456c1d[_0xb93e('0x5')],'transfererchannel':_0x456c1d[_0xb93e('0x15')],'transferercalleridnum':_0x456c1d[_0xb93e('0x16')],'transferercalleridname':_0x456c1d[_0xb93e('0x17')],'transfererconnectedlinenum':_0x456c1d[_0xb93e('0x18')],'transfererconnectedlinename':_0x456c1d[_0xb93e('0x19')],'transfereraccountcode':_0x456c1d[_0xb93e('0x1a')],'transferercontext':_0x456c1d[_0xb93e('0x1b')],'transfererexten':_0x456c1d[_0xb93e('0x1c')],'transfererlinkedid':_0x456c1d[_0xb93e('0x1d')],'transfereechannel':_0x456c1d['transfertargetchannel'],'transfereecalleridnum':_0x456c1d[_0xb93e('0x1e')],'transfereecalleridname':_0x456c1d['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x456c1d[_0xb93e('0x1f')],'transfereeconnectedlinename':_0x456c1d[_0xb93e('0x20')],'transfereeaccountcode':_0x456c1d[_0xb93e('0x21')],'transfereecontext':_0x456c1d[_0xb93e('0x22')],'transfereeexten':_0x456c1d['transfertargetexten'],'transfereelinkedid':_0x456c1d[_0xb93e('0x23')],'isexternal':_0x456c1d['isexternal'],'context':_0x456c1d[_0xb93e('0x24')],'extension':_0x456c1d[_0xb93e('0x25')],'type':_0xb93e('0x26')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index ebb6b91..4ac704e 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 _0xe2bc=['jayson/promise','bluebird','moment','../../../config/environment','../properties','../ami','format','%s/%s','SIP','name','timers','timer','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','pick','keys','module','Action','then','message','catch','error','username','ami\x20disconnected','join','command','Command','content','voiceQueues','hasOwnProperty','answered','available','loggedIn','sumDuration','sumHoldTime','talking','unmanaged','abandoned','waiting','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','undefined','values','channels','voicechannel','validate','map','uniqueid','channel','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','mixmonitorid','rec','MixMonitor\x20Success','resolve','StopMixMonitor','destinationchannel','status','stop','%s.%s','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','Channel\x20doesn\x27t\x20exist','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash'];(function(_0x17201d,_0x1f4178){var _0x30b37e=function(_0x2cb060){while(--_0x2cb060){_0x17201d['push'](_0x17201d['shift']());}};_0x30b37e(++_0x1f4178);}(_0xe2bc,0x1a6));var _0xce2b=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xe2bc[_0x29d915];return _0x160f86;};'use strict';var _=require(_0xce2b('0x0'));var util=require('util');var jayson=require(_0xce2b('0x1'));var schema=require('validate');var BPromise=require(_0xce2b('0x2'));var moment=require(_0xce2b('0x3'));var config=require(_0xce2b('0x4'));var properties=require(_0xce2b('0x5'));var ami=require(_0xce2b('0x6'));exports['listen']=function(_0x29382b,_0x10b729,_0x3c15d3){return new BPromise(function(_0x343373,_0x22a898){var _0x54d279={'QueuePause':function(_0x972d2){return new Promise(function(_0x3ec031,_0x53c0de){var _0x97112a=util[_0xce2b('0x7')](_0xce2b('0x8'),_0xce2b('0x9'),_0x972d2[_0xce2b('0xa')]);if(_0x29382b[_0xce2b('0xb')]&&_0x29382b[_0xce2b('0xb')][_0x97112a]&&_0x29382b[_0xce2b('0xb')][_0x97112a][_0xce2b('0xc')]){_0x29382b[_0xce2b('0xb')][_0x97112a]['updateAcw']();}if(_0x29382b[_0xce2b('0xd')][_0x97112a]){_0x29382b['agents'][_0x97112a][_0xce2b('0xe')]({'statePause':_0x972d2[_0xce2b('0xf')]?!![]:![]});}_0x3ec031({'code':0xc8,'message':_0xce2b('0x10')});});},'Reload':function(_0xfb4ef5){var _0x33b6fe=this;return new Promise(function(_0x422c23,_0xd82158){if(ami[_0xce2b('0x11')]()==![]){return _0xd82158(_0x33b6fe['error'](0x1f4,[config[_0xce2b('0x12')]['ip'],config[_0xce2b('0x12')]['username'],'ami\x20disconnected']['join']('\x20')));}_0xfb4ef5=_[_0xce2b('0x13')](_0xfb4ef5,_[_0xce2b('0x14')](properties[_0xce2b('0x15')]));_0xfb4ef5['action']='Reload';return ami[_0xce2b('0x16')](_0xfb4ef5)[_0xce2b('0x17')](function(_0x8bf420){_0x422c23({'code':0xc8,'message':_0x8bf420[_0xce2b('0x18')]});})[_0xce2b('0x19')](function(_0x32fd68){_0xd82158(_0x33b6fe[_0xce2b('0x1a')](0x1f5,_0x32fd68[_0xce2b('0x18')]));});});},'Command':function(_0x3716f9){var _0x29b9e4=this;return new Promise(function(_0x4e92fd,_0x192002){if(ami[_0xce2b('0x11')]()==![]){return _0x192002(_0x29b9e4[_0xce2b('0x1a')](0x1f4,[config[_0xce2b('0x12')]['ip'],config[_0xce2b('0x12')][_0xce2b('0x1b')],_0xce2b('0x1c')][_0xce2b('0x1d')]('\x20')));}_0x3716f9=_[_0xce2b('0x13')](_0x3716f9,_0xce2b('0x1e'));_0x3716f9['action']=_0xce2b('0x1f');return ami[_0xce2b('0x16')](_0x3716f9)[_0xce2b('0x17')](function(_0x421f80){_0x4e92fd({'code':0xc8,'message':_0x421f80[_0xce2b('0x20')]});})[_0xce2b('0x19')](function(_0x1ceda5){_0x192002(_0x29b9e4[_0xce2b('0x1a')](0x1f5,_0x1ceda5[_0xce2b('0x18')]));});});},'VoiceQueues':function(_0x19d178){return new Promise(function(_0x14ca70,_0x56047c){var _0x49a52c=[];for(var _0x527b03 in _0x29382b[_0xce2b('0x21')]){if(_0x29382b['voiceQueues'][_0xce2b('0x22')](_0x527b03)){var _0x294af8=_0x29382b['voiceQueues'][_0x527b03];var _0x60eca0={'id':_0x294af8['id'],'name':_0x294af8[_0xce2b('0xa')],'strategy':_0x294af8['strategy'],'answered':_0x294af8[_0xce2b('0x23')],'available':_0x294af8[_0xce2b('0x24')],'loggedIn':_0x294af8[_0xce2b('0x25')],'pTalking':_0x294af8['pTalking'],'sumBillable':_0x294af8['sumBillable'],'sumDuration':_0x294af8[_0xce2b('0x26')],'sumHoldTime':_0x294af8[_0xce2b('0x27')]||0x0,'talking':_0x294af8[_0xce2b('0x28')],'total':_0x294af8['total'],'type':_0x294af8['type'],'unmanaged':_0x294af8[_0xce2b('0x29')],'abandoned':_0x294af8[_0xce2b('0x2a')],'waiting':_0x294af8[_0xce2b('0x2b')],'loggedInDb':_0x294af8['loggedInDb']};if(_0x294af8[_0xce2b('0x2c')]===_0xce2b('0x2d')){_0x60eca0[_0xce2b('0x2e')]=_0x294af8[_0xce2b('0x2e')];_0x60eca0[_0xce2b('0x2f')]=_0x294af8[_0xce2b('0x2f')];_0x60eca0[_0xce2b('0x30')]=_0x294af8['dialOriginateCallerIdName'];_0x60eca0[_0xce2b('0x31')]=_0x294af8['dialOriginateCallerIdNumber'];_0x60eca0[_0xce2b('0x32')]=_0x294af8[_0xce2b('0x32')];_0x60eca0[_0xce2b('0x33')]=_0x294af8[_0xce2b('0x33')];_0x60eca0[_0xce2b('0x34')]=_0x294af8['temp'];_0x60eca0[_0xce2b('0x35')]=_0x294af8[_0xce2b('0x35')];_0x60eca0[_0xce2b('0x36')]=_0x294af8[_0xce2b('0x36')];_0x60eca0[_0xce2b('0x37')]=_0x294af8[_0xce2b('0x37')];_0x60eca0[_0xce2b('0x38')]=_0x294af8[_0xce2b('0x38')];_0x60eca0[_0xce2b('0x39')]=_0x294af8[_0xce2b('0x39')];_0x60eca0[_0xce2b('0x3a')]=_0x294af8[_0xce2b('0x3a')];_0x60eca0[_0xce2b('0x3b')]=_0x294af8[_0xce2b('0x3b')];_0x60eca0[_0xce2b('0x3c')]=_0x294af8[_0xce2b('0x3c')];_0x60eca0['outboundNoAnswerCallsDay']=_0x294af8[_0xce2b('0x3d')];_0x60eca0['outboundNoSuchCallsDay']=_0x294af8[_0xce2b('0x3e')];_0x60eca0[_0xce2b('0x3f')]=_0x294af8[_0xce2b('0x3f')];_0x60eca0[_0xce2b('0x40')]=_0x294af8[_0xce2b('0x40')];_0x60eca0[_0xce2b('0x41')]=_0x294af8['outboundRejectCallsDay'];_0x60eca0[_0xce2b('0x42')]=_0x294af8[_0xce2b('0x42')];_0x60eca0[_0xce2b('0x43')]=_0x294af8[_0xce2b('0x43')];_0x60eca0[_0xce2b('0x44')]=_0x294af8[_0xce2b('0x44')];_0x60eca0['predictiveIntervalAvgTalktime']=_0x294af8[_0xce2b('0x45')];_0x60eca0[_0xce2b('0x46')]=_0x294af8[_0xce2b('0x46')];_0x60eca0[_0xce2b('0x47')]=_0x294af8[_0xce2b('0x47')];_0x60eca0[_0xce2b('0x48')]=_0x294af8['predictiveIntervalErlangCalls'];_0x60eca0['predictiveIntervalErlangCallsDroppedCalls']=_0x294af8[_0xce2b('0x49')];_0x60eca0[_0xce2b('0x4a')]=_0x294af8[_0xce2b('0x4a')];_0x60eca0[_0xce2b('0x4b')]=_0x294af8[_0xce2b('0x4b')];_0x60eca0[_0xce2b('0x4c')]=_0x294af8[_0xce2b('0x4c')];_0x60eca0[_0xce2b('0x4d')]=_0x294af8[_0xce2b('0x4d')];_0x60eca0[_0xce2b('0x4e')]=_0x294af8[_0xce2b('0x4e')];_0x60eca0[_0xce2b('0x18')]=_0x294af8[_0xce2b('0x18')];_0x60eca0[_0xce2b('0x4f')]=_0x294af8[_0xce2b('0x4f')];_0x60eca0['erlangCalls']=_0x294af8[_0xce2b('0x50')];_0x60eca0[_0xce2b('0x51')]=_0x294af8['erlangCallToSecond'];_0x60eca0[_0xce2b('0x52')]=_0x294af8['erlangAbandonmentRate'];_0x60eca0[_0xce2b('0x53')]=_0x294af8[_0xce2b('0x53')];_0x60eca0[_0xce2b('0x54')]=_0x294af8['startPredictive'];_0x60eca0[_0xce2b('0x55')]=_0x294af8[_0xce2b('0x55')];}if(_0x294af8['Trunk']){_0x60eca0['Trunk']={'id':_0x294af8[_0xce2b('0x56')]['id'],'name':_0x294af8[_0xce2b('0x56')][_0xce2b('0xa')],'active':_0x294af8[_0xce2b('0x56')][_0xce2b('0x57')],'callerid':_0x294af8['Trunk'][_0xce2b('0x58')]};}if(_0x294af8[_0xce2b('0x59')]){_0x60eca0[_0xce2b('0x59')]={'id':_0x294af8[_0xce2b('0x59')]['id'],'name':_0x294af8[_0xce2b('0x59')]['name']};}_0x49a52c[_0xce2b('0x5a')](_0x60eca0);}}_0x14ca70({'count':_0x49a52c[_0xce2b('0x5b')],'rows':_0x49a52c});});},'UpdateVoiceQueue':function(_0xc7a9b4){return new Promise(function(_0x3f0383,_0x334da3){var _0x30d668=_[_0xce2b('0x5c')](_0x29382b['voiceQueues'],{'id':parseInt(_0xc7a9b4['id'])});var _0x52909f=_['omit'](_0xc7a9b4,['id']);if(_0x30d668){for(var _0x346fd5 in _0x52909f){if(typeof _0x52909f[_0x346fd5]!==_0xce2b('0x5d')&&typeof _0x30d668[_0x346fd5]!==_0xce2b('0x5d')){_0x30d668[_0x346fd5]=_0x52909f[_0x346fd5];}}_0x3f0383(_0x30d668);}else{_0x334da3();}});},'VoiceChannels':function(_0x590437){return new Promise(function(_0x4ea31b,_0x4efd57){var _0x2b5334=_[_0xce2b('0x5e')](_0x29382b[_0xce2b('0x5f')]);_0x4ea31b({'count':_0x2b5334['length'],'rows':_0x2b5334});});},'VoiceChannelMixMonitor':function(_0x419308){var _0x83d2a3=this;return new Promise(function(_0x1b2bfb,_0x4f282d){if(ami[_0xce2b('0x11')]()==![]){return _0x4f282d(_0x83d2a3['error'](0x1f4,[config[_0xce2b('0x12')]['ip'],config[_0xce2b('0x12')][_0xce2b('0x1b')],'ami\x20disconnected'][_0xce2b('0x1d')]('\x20')));}var _0x34213c=schema(properties[_0xce2b('0x60')])[_0xce2b('0x61')](_0x419308);if(_0x34213c['length']>0x0){return _0x4f282d(_0x83d2a3[_0xce2b('0x1a')](0x1f4,_[_0xce2b('0x62')](_0x34213c,_0xce2b('0x18'))[_0xce2b('0x1d')](',\x20')));}var _0x14ecae=_['find'](_0x29382b[_0xce2b('0x5f')],{'uniqueid':_0x419308[_0xce2b('0x63')]});if(_0x14ecae&&_0x14ecae[_0xce2b('0x64')]){var _0x4bd2b0=util[_0xce2b('0x7')]('%s.%s',_0x419308[_0xce2b('0x65')]||_0x419308['uniqueid'],_0x419308[_0xce2b('0x7')]||_0xce2b('0x66'));return ami['Action']({'action':'MixMonitor','channel':_0x14ecae[_0xce2b('0x64')],'file':_0x4bd2b0,'options':_0xce2b('0x67')})[_0xce2b('0x17')](function(_0x492d01){var _0x736b95=_[_0xce2b('0x5c')](_0x14ecae['monitors'],{'filename':_0xce2b('0x68')+_0x4bd2b0[_0xce2b('0x69')]()});if(_[_0xce2b('0x6a')](_0x736b95)){_0x14ecae[_0xce2b('0x6b')][_0xce2b('0x5a')]({'filename':_0xce2b('0x68')+_0x4bd2b0['toLowerCase'](),'createdAt':moment()[_0xce2b('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x492d01[_0xce2b('0x6c')],'status':_0xce2b('0x6d')});}else{_0x736b95[_0xce2b('0x6c')]=_0x492d01[_0xce2b('0x6c')];_0x736b95['status']=_0xce2b('0x6d');}_0x1b2bfb({'code':0xc8,'message':[_0x419308[_0xce2b('0x63')],_0xce2b('0x6e'),_0x492d01[_0xce2b('0x6c')]]['join']('\x20'),'mixmonitorid':_0x492d01[_0xce2b('0x6c')]});})[_0xce2b('0x19')](function(_0x338fbb){_0x4f282d(_0x83d2a3[_0xce2b('0x1a')](0x1f5,[_0x419308[_0xce2b('0x63')],_0x338fbb[_0xce2b('0x18')][_0xce2b('0x69')]()]['join']('\x20')));});}else{return _0x4f282d(_0x83d2a3[_0xce2b('0x1a')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x1b0ffa){var _0x20ccaf=this;return new Promise(function(_0x2ae9ae,_0x1546ff){if(ami[_0xce2b('0x11')]()==![]){return _0x1546ff(_0x20ccaf[_0xce2b('0x1a')](0x1f4,[config[_0xce2b('0x12')]['ip'],config[_0xce2b('0x12')]['username'],_0xce2b('0x1c')][_0xce2b('0x1d')]('\x20')));}var _0x230e22=schema(properties[_0xce2b('0x60')])[_0xce2b('0x61')](_0x1b0ffa);if(_0x230e22['length']>0x0){return _0x1546ff(_0x20ccaf[_0xce2b('0x1a')](0x1f4,_[_0xce2b('0x62')](_0x230e22,'message')[_0xce2b('0x1d')](',\x20')));}var _0x287072=_[_0xce2b('0x5c')](_0x29382b[_0xce2b('0x5f')],{'uniqueid':_0x1b0ffa[_0xce2b('0x63')]});if(_0x287072){return BPromise[_0xce2b('0x6f')]()[_0xce2b('0x17')](function(){if(_0x287072[_0xce2b('0x64')]){return ami[_0xce2b('0x16')]({'action':_0xce2b('0x70'),'channel':_0x287072[_0xce2b('0x64')],'mixmonitorid':_0x1b0ffa[_0xce2b('0x6c')]})[_0xce2b('0x19')](function(_0x2f604a){});}})['then'](function(){if(_0x287072[_0xce2b('0x71')]){return ami[_0xce2b('0x16')]({'action':_0xce2b('0x70'),'channel':_0x287072['destinationchannel'],'mixmonitorid':_0x1b0ffa[_0xce2b('0x6c')]})[_0xce2b('0x19')](function(_0x5e3cfe){});}})[_0xce2b('0x17')](function(_0xe9e1a3){var _0x56435f=_[_0xce2b('0x5c')](_0x287072[_0xce2b('0x6b')],{'mixmonitorid':_0x1b0ffa[_0xce2b('0x6c')]});if(_0x56435f){_0x56435f[_0xce2b('0x72')]=_0xce2b('0x73');}})[_0xce2b('0x17')](function(){var _0x36e527=util['format'](_0xce2b('0x74'),_0x1b0ffa[_0xce2b('0x65')]||_0x1b0ffa['uniqueid'],_0x1b0ffa[_0xce2b('0x7')]||_0xce2b('0x66'));var _0x448521=_[_0xce2b('0x5c')](_0x287072['monitors'],{'filename':_0xce2b('0x68')+_0x36e527[_0xce2b('0x69')]()});if(_0x448521){_0x448521['status']='stop';}})['then'](function(){_0x2ae9ae({'code':0xc8,'message':[_0x1b0ffa['uniqueid'],_0xce2b('0x75')][_0xce2b('0x1d')]('\x20')});})['catch'](function(_0x5c4652){_0x1546ff(_0x20ccaf[_0xce2b('0x1a')](0x1f5,[_0x1b0ffa[_0xce2b('0x63')],_0x5c4652[_0xce2b('0x18')]['toLowerCase']()][_0xce2b('0x1d')]('\x20')));});}else{return _0x1546ff(_0x20ccaf[_0xce2b('0x1a')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x3b2716){return new Promise(function(_0xeca50f,_0x2f47ed){var _0x2a3bdc=_['values'](_0x29382b[_0xce2b('0x76')]);_0xeca50f({'count':_0x2a3bdc[_0xce2b('0x5b')],'rows':_0x2a3bdc});});},'VoiceQueuesChannel':function(_0x542580){var _0x14e188=this;return new Promise(function(_0x54de07,_0x53fc7b){var _0x5c9b77=schema(properties[_0xce2b('0x77')])[_0xce2b('0x61')](_0x542580);if(_0x5c9b77[_0xce2b('0x5b')]>0x0){return _0x53fc7b(_0x14e188['error'](0x1f4,_['map'](_0x5c9b77,_0xce2b('0x18'))[_0xce2b('0x1d')](',\x20')));}var _0x43161b=_[_0xce2b('0x5c')](_0x29382b[_0xce2b('0x76')],{'uniqueid':_0x542580[_0xce2b('0x63')]});if(_0x43161b){_0x54de07(_0x43161b);}else{return _0x53fc7b(_0x14e188['error'](0x1f5,_0xce2b('0x78')));}});},'VoiceQueuesChannelHangup':function(_0xa02716){var _0x324251=this;return new Promise(function(_0x3656aa,_0x5079c3){if(ami['isConnected']()==![]){return _0x5079c3(_0x324251[_0xce2b('0x1a')](0x1f4,[config['asterisk']['ip'],config[_0xce2b('0x12')][_0xce2b('0x1b')],_0xce2b('0x1c')]['join']('\x20')));}var _0x56eb43=schema(properties[_0xce2b('0x79')])[_0xce2b('0x61')](_0xa02716);if(_0x56eb43[_0xce2b('0x5b')]>0x0){return _0x5079c3(_0x324251[_0xce2b('0x1a')](0x1f4,_[_0xce2b('0x62')](_0x56eb43,'message')[_0xce2b('0x1d')](',\x20')));}var _0x212800=_[_0xce2b('0x5c')](_0x29382b[_0xce2b('0x76')],{'uniqueid':_0xa02716[_0xce2b('0x63')]});if(_0x212800&&_0x212800[_0xce2b('0x64')]){return ami['Action']({'action':_0xce2b('0x7a'),'channel':_0x212800['channel']})['then'](function(_0x13bd8a){_0x3656aa({'code':0xc8,'message':[_0xa02716[_0xce2b('0x63')],_0x13bd8a[_0xce2b('0x18')]['toLowerCase']()][_0xce2b('0x1d')]('\x20')});})['catch'](function(_0x23a1e5){_0x5079c3(_0x324251['error'](0x1f5,[_0xa02716['uniqueid'],_0x23a1e5['message'][_0xce2b('0x69')]()][_0xce2b('0x1d')]('\x20')));});}else{return _0x5079c3(_0x324251['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x513dc3){var _0x4d8901=this;return new Promise(function(_0x35b9e3,_0x12313d){if(ami[_0xce2b('0x11')]()==![]){return _0x12313d(_0x4d8901['error'](0x1f4,[config[_0xce2b('0x12')]['ip'],config['asterisk'][_0xce2b('0x1b')],_0xce2b('0x1c')][_0xce2b('0x1d')]('\x20')));}var _0x4d902f=schema(properties[_0xce2b('0x7b')])[_0xce2b('0x61')](_0x513dc3);if(_0x4d902f[_0xce2b('0x5b')]>0x0){return _0x12313d(_0x4d8901[_0xce2b('0x1a')](0x1f4,_[_0xce2b('0x62')](_0x4d902f,_0xce2b('0x18'))[_0xce2b('0x1d')](',\x20')));}var _0x3ad82b=_[_0xce2b('0x5c')](_0x29382b[_0xce2b('0x76')],{'uniqueid':_0x513dc3[_0xce2b('0x63')]});if(_0x3ad82b&&_0x3ad82b[_0xce2b('0x64')]){return ami[_0xce2b('0x16')]({'action':_0xce2b('0x7c'),'channel':_0x3ad82b['channel'],'exten':_0x513dc3['exten'],'context':_0x513dc3[_0xce2b('0x7d')]||_0x3ad82b[_0xce2b('0x7d')],'priority':0x1})['then'](function(_0x209194){_0x35b9e3({'code':0xc8,'message':[_0x513dc3['uniqueid'],_0x209194[_0xce2b('0x18')][_0xce2b('0x69')]()]['join']('\x20')});})[_0xce2b('0x19')](function(_0x5b75e4){_0x12313d(_0x4d8901[_0xce2b('0x1a')](0x1f5,[_0x513dc3[_0xce2b('0x63')],_0x5b75e4[_0xce2b('0x18')]['toLowerCase']()][_0xce2b('0x1d')]('\x20')));});}else{return _0x12313d(_0x4d8901[_0xce2b('0x1a')](0x1f5,_0xce2b('0x78')));}});},'Agents':function(_0x515ca0){return new Promise(function(_0xbc41b8,_0x291590){var _0xfe1a81=_[_0xce2b('0x5e')](_0x29382b[_0xce2b('0xd')]);_0xbc41b8({'count':_0xfe1a81[_0xce2b('0x5b')],'rows':_0xfe1a81});});},'Telephones':function(_0x40c0fc){return new Promise(function(_0x19fff7,_0x557c84){var _0x1f34bd=_[_0xce2b('0x5e')](_0x29382b[_0xce2b('0x7e')]);_0x19fff7({'count':_0x1f34bd[_0xce2b('0x5b')],'rows':_0x1f34bd});});},'Trunks':function(_0x472a35){return new Promise(function(_0x2df567,_0x538176){var _0xc36ed8=_[_0xce2b('0x5e')](_0x29382b[_0xce2b('0x7f')]);_0x2df567({'count':_0xc36ed8['length'],'rows':_0xc36ed8});});},'OutboundChannels':function(_0x7dfc17){return new Promise(function(_0x3ee2ec,_0x5383bf){var _0x42bfd0=_['values'](_0x29382b[_0xce2b('0x80')]);_0x3ee2ec({'count':_0x42bfd0[_0xce2b('0x5b')],'rows':_0x42bfd0});});},'Outbound':function(_0x37f89e){return new Promise(function(_0x3fc6d3,_0x1a71eb){_0x3fc6d3(_0x29382b[_0xce2b('0x2d')]);});},'Campaigns':function(_0x26ffed){return new Promise(function(_0x356d55,_0x19f27a){var _0x1678df=_['values'](_0x29382b[_0xce2b('0x81')]);_0x356d55({'count':_0x1678df[_0xce2b('0x5b')],'rows':_0x1678df});});},'VoiceQueuesPreview':function(_0x1371b5){var _0x8c9465=this;return new Promise(function(_0x48225a,_0x6a2546){_0x10b729[_0xce2b('0x82')](_0x1371b5['id'])[_0xce2b('0x17')](function(_0x534234){_0x48225a({'code':0xc8,'message':_0x534234[_0xce2b('0x18')]});})[_0xce2b('0x19')](function(_0x5903bf){_0x6a2546(_0x8c9465[_0xce2b('0x1a')](0x1f4,_0x5903bf[_0xce2b('0x18')]));});});},'EventManager':function(_0x3ed2c6){var _0x4f889a=this;return new Promise(function(_0x2c6c6f,_0x5e3f6f){if(!_0x3ed2c6[_0xce2b('0x83')]){return _0x5e3f6f(_0x4f889a[_0xce2b('0x1a')](0x1f4,_0xce2b('0x84')));}ami[_0xce2b('0x85')](_0xce2b('0x86')+_0x3ed2c6[_0xce2b('0x83')],_0x3ed2c6[_0xce2b('0x18')]);_0x2c6c6f({'code':0xc8,'message':_0x3ed2c6});});},'FaxAccounts':function(_0x15c9b0){return new Promise(function(_0x2d27f6,_0x13fdec){var _0x5cf50b=_['values'](_0x29382b['faxAccounts']);_0x2d27f6({'count':_0x5cf50b['length'],'rows':_0x5cf50b});});},'SendFax':function(_0x2148c8){var _0x15d7a1=this;return new Promise(function(_0x12d895,_0x5ab72b){_0x3c15d3[_0xce2b('0x87')](_0x2148c8)[_0xce2b('0x17')](function(_0x2a8ac0){_0x12d895({'code':0xc8,'message':_0x2a8ac0[_0xce2b('0x18')]});})[_0xce2b('0x19')](function(_0x330d7a){_0x5ab72b(_0x15d7a1[_0xce2b('0x1a')](0x1f4,_0x330d7a[_0xce2b('0x18')]));});});},'CheckAfterSend':function(_0x2ca3ff){var _0x5d82fb=this;return new Promise(function(_0x41721a,_0x188fcc){_0x3c15d3[_0xce2b('0x88')](_0x2ca3ff)[_0xce2b('0x17')](function(_0x1e2e94){_0x41721a({'code':0xc8,'message':_0x1e2e94[_0xce2b('0x18')]});})[_0xce2b('0x19')](function(_0x41a0f6){_0x188fcc(_0x5d82fb[_0xce2b('0x1a')](0x1f4,_0x41a0f6[_0xce2b('0x18')]));});});}};var _0x2db301=jayson[_0xce2b('0x89')](_0x54d279)[_0xce2b('0x8a')]();_0x2db301['on'](_0xce2b('0x1a'),function(_0x11b765){return _0x22a898(_0x11b765);});_0x2db301['listen'](0x232a,_0xce2b('0x8b'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x343373(_0xce2b('0x8c')+0x232a);});});}; \ No newline at end of file +var _0x7046=['channel','format','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','toLowerCase','Channel\x20doesn\x27t\x20exist','map','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','voicequeuechannel','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','trunks','outboundChannels','outbound','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../../../config/environment','../properties','listen','%s/%s','SIP','name','timers','timer','agents','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','keys','module','action','Reload','Action','message','catch','Command','then','voiceQueues','hasOwnProperty','strategy','answered','available','pTalking','sumBillable','talking','type','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','callerid','Interval','push','length','omit','undefined','values','channels','voicechannel','find','uniqueid'];(function(_0x3d3379,_0x4c9bc1){var _0x358633=function(_0x54510c){while(--_0x54510c){_0x3d3379['push'](_0x3d3379['shift']());}};_0x358633(++_0x4c9bc1);}(_0x7046,0x144));var _0x6704=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x7046[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var jayson=require(_0x6704('0x2'));var schema=require(_0x6704('0x3'));var BPromise=require('bluebird');var moment=require(_0x6704('0x4'));var config=require(_0x6704('0x5'));var properties=require(_0x6704('0x6'));var ami=require('../ami');exports[_0x6704('0x7')]=function(_0x35bcc6,_0x3f4169,_0x626a14){return new BPromise(function(_0x2917be,_0x4badf8){var _0x5ced8={'QueuePause':function(_0x49b8b6){return new Promise(function(_0x56b1ff,_0x390ace){var _0x510221=util['format'](_0x6704('0x8'),_0x6704('0x9'),_0x49b8b6[_0x6704('0xa')]);if(_0x35bcc6[_0x6704('0xb')]&&_0x35bcc6[_0x6704('0xb')][_0x510221]&&_0x35bcc6[_0x6704('0xb')][_0x510221][_0x6704('0xc')]){_0x35bcc6[_0x6704('0xb')][_0x510221]['updateAcw']();}if(_0x35bcc6[_0x6704('0xd')][_0x510221]){_0x35bcc6[_0x6704('0xd')][_0x510221]['updateStatusRealtime']({'statePause':_0x49b8b6[_0x6704('0xe')]?!![]:![]});}_0x56b1ff({'code':0xc8,'message':_0x6704('0xf')});});},'Reload':function(_0x327e03){var _0x13b8f4=this;return new Promise(function(_0x34a538,_0x1ec91e){if(ami[_0x6704('0x10')]()==![]){return _0x1ec91e(_0x13b8f4[_0x6704('0x11')](0x1f4,[config[_0x6704('0x12')]['ip'],config['asterisk'][_0x6704('0x13')],_0x6704('0x14')][_0x6704('0x15')]('\x20')));}_0x327e03=_['pick'](_0x327e03,_[_0x6704('0x16')](properties[_0x6704('0x17')]));_0x327e03[_0x6704('0x18')]=_0x6704('0x19');return ami[_0x6704('0x1a')](_0x327e03)['then'](function(_0x1e5f6e){_0x34a538({'code':0xc8,'message':_0x1e5f6e[_0x6704('0x1b')]});})[_0x6704('0x1c')](function(_0xe49450){_0x1ec91e(_0x13b8f4[_0x6704('0x11')](0x1f5,_0xe49450['message']));});});},'Command':function(_0x43deeb){var _0x2f6eae=this;return new Promise(function(_0x13e0c7,_0x156106){if(ami[_0x6704('0x10')]()==![]){return _0x156106(_0x2f6eae[_0x6704('0x11')](0x1f4,[config[_0x6704('0x12')]['ip'],config['asterisk'][_0x6704('0x13')],_0x6704('0x14')][_0x6704('0x15')]('\x20')));}_0x43deeb=_['pick'](_0x43deeb,'command');_0x43deeb[_0x6704('0x18')]=_0x6704('0x1d');return ami[_0x6704('0x1a')](_0x43deeb)[_0x6704('0x1e')](function(_0x41f89e){_0x13e0c7({'code':0xc8,'message':_0x41f89e['content']});})[_0x6704('0x1c')](function(_0xabb97a){_0x156106(_0x2f6eae[_0x6704('0x11')](0x1f5,_0xabb97a[_0x6704('0x1b')]));});});},'VoiceQueues':function(_0x16b6b9){return new Promise(function(_0x2476d6,_0x2acafd){var _0x5d50ff=[];for(var _0x896227 in _0x35bcc6[_0x6704('0x1f')]){if(_0x35bcc6[_0x6704('0x1f')][_0x6704('0x20')](_0x896227)){var _0x118d93=_0x35bcc6['voiceQueues'][_0x896227];var _0x5ac014={'id':_0x118d93['id'],'name':_0x118d93[_0x6704('0xa')],'strategy':_0x118d93[_0x6704('0x21')],'answered':_0x118d93[_0x6704('0x22')],'available':_0x118d93[_0x6704('0x23')],'loggedIn':_0x118d93['loggedIn'],'pTalking':_0x118d93[_0x6704('0x24')],'sumBillable':_0x118d93[_0x6704('0x25')],'sumDuration':_0x118d93['sumDuration'],'sumHoldTime':_0x118d93['sumHoldTime']||0x0,'talking':_0x118d93[_0x6704('0x26')],'total':_0x118d93['total'],'type':_0x118d93[_0x6704('0x27')],'unmanaged':_0x118d93['unmanaged'],'abandoned':_0x118d93['abandoned'],'waiting':_0x118d93[_0x6704('0x28')],'loggedInDb':_0x118d93[_0x6704('0x29')]};if(_0x118d93[_0x6704('0x27')]==='outbound'){_0x5ac014[_0x6704('0x2a')]=_0x118d93[_0x6704('0x2a')];_0x5ac014[_0x6704('0x2b')]=_0x118d93[_0x6704('0x2b')];_0x5ac014[_0x6704('0x2c')]=_0x118d93[_0x6704('0x2c')];_0x5ac014[_0x6704('0x2d')]=_0x118d93[_0x6704('0x2d')];_0x5ac014[_0x6704('0x2e')]=_0x118d93[_0x6704('0x2e')];_0x5ac014[_0x6704('0x2f')]=_0x118d93[_0x6704('0x2f')];_0x5ac014[_0x6704('0x30')]=_0x118d93[_0x6704('0x30')];_0x5ac014[_0x6704('0x31')]=_0x118d93[_0x6704('0x31')];_0x5ac014[_0x6704('0x32')]=_0x118d93[_0x6704('0x32')];_0x5ac014[_0x6704('0x33')]=_0x118d93[_0x6704('0x33')];_0x5ac014[_0x6704('0x34')]=_0x118d93[_0x6704('0x34')];_0x5ac014[_0x6704('0x35')]=_0x118d93[_0x6704('0x35')];_0x5ac014[_0x6704('0x36')]=_0x118d93['outboundDropCallsDayACS'];_0x5ac014['outboundDropCallsDayCallersExit']=_0x118d93['outboundDropCallsDayCallersExit'];_0x5ac014[_0x6704('0x37')]=_0x118d93[_0x6704('0x37')];_0x5ac014[_0x6704('0x38')]=_0x118d93['outboundNoAnswerCallsDay'];_0x5ac014[_0x6704('0x39')]=_0x118d93['outboundNoSuchCallsDay'];_0x5ac014[_0x6704('0x3a')]=_0x118d93[_0x6704('0x3a')];_0x5ac014[_0x6704('0x3b')]=_0x118d93[_0x6704('0x3b')];_0x5ac014[_0x6704('0x3c')]=_0x118d93[_0x6704('0x3c')];_0x5ac014[_0x6704('0x3d')]=_0x118d93[_0x6704('0x3d')];_0x5ac014['predictiveIntervalAnsweredCalls']=_0x118d93['predictiveIntervalAnsweredCalls'];_0x5ac014[_0x6704('0x3e')]=_0x118d93[_0x6704('0x3e')];_0x5ac014['predictiveIntervalAvgTalktime']=_0x118d93['predictiveIntervalAvgTalktime'];_0x5ac014[_0x6704('0x3f')]=_0x118d93['predictiveIntervalDroppedCallsCallersExit'];_0x5ac014[_0x6704('0x40')]=_0x118d93[_0x6704('0x40')];_0x5ac014[_0x6704('0x41')]=_0x118d93[_0x6704('0x41')];_0x5ac014['predictiveIntervalErlangCallsDroppedCalls']=_0x118d93[_0x6704('0x42')];_0x5ac014[_0x6704('0x43')]=_0x118d93['predictiveIntervalHitRate'];_0x5ac014[_0x6704('0x44')]=_0x118d93['predictiveIntervalMultiplicativeFactor'];_0x5ac014[_0x6704('0x45')]=_0x118d93[_0x6704('0x45')];_0x5ac014[_0x6704('0x46')]=_0x118d93['predictiveIntervalAvailable'];_0x5ac014[_0x6704('0x47')]=_0x118d93[_0x6704('0x47')];_0x5ac014[_0x6704('0x1b')]=_0x118d93['message'];_0x5ac014[_0x6704('0x48')]=_0x118d93[_0x6704('0x48')];_0x5ac014[_0x6704('0x49')]=_0x118d93[_0x6704('0x49')];_0x5ac014['erlangCallToSecond']=_0x118d93[_0x6704('0x4a')];_0x5ac014['erlangAbandonmentRate']=_0x118d93[_0x6704('0x4b')];_0x5ac014[_0x6704('0x4c')]=_0x118d93[_0x6704('0x4c')];_0x5ac014[_0x6704('0x4d')]=_0x118d93['startPredictive'];_0x5ac014['startProgressive']=_0x118d93['startProgressive'];}if(_0x118d93[_0x6704('0x4e')]){_0x5ac014['Trunk']={'id':_0x118d93[_0x6704('0x4e')]['id'],'name':_0x118d93['Trunk'][_0x6704('0xa')],'active':_0x118d93[_0x6704('0x4e')]['active'],'callerid':_0x118d93[_0x6704('0x4e')][_0x6704('0x4f')]};}if(_0x118d93[_0x6704('0x50')]){_0x5ac014[_0x6704('0x50')]={'id':_0x118d93[_0x6704('0x50')]['id'],'name':_0x118d93['Interval'][_0x6704('0xa')]};}_0x5d50ff[_0x6704('0x51')](_0x5ac014);}}_0x2476d6({'count':_0x5d50ff[_0x6704('0x52')],'rows':_0x5d50ff});});},'UpdateVoiceQueue':function(_0x2de33b){return new Promise(function(_0x269a30,_0x4e7168){var _0x13da45=_['find'](_0x35bcc6[_0x6704('0x1f')],{'id':parseInt(_0x2de33b['id'])});var _0x2a76f5=_[_0x6704('0x53')](_0x2de33b,['id']);if(_0x13da45){for(var _0x207595 in _0x2a76f5){if(typeof _0x2a76f5[_0x207595]!==_0x6704('0x54')&&typeof _0x13da45[_0x207595]!=='undefined'){_0x13da45[_0x207595]=_0x2a76f5[_0x207595];}}_0x269a30(_0x13da45);}else{_0x4e7168();}});},'VoiceChannels':function(_0x1f254f){return new Promise(function(_0x39e597,_0x55af95){var _0x1b9d36=_[_0x6704('0x55')](_0x35bcc6[_0x6704('0x56')]);_0x39e597({'count':_0x1b9d36[_0x6704('0x52')],'rows':_0x1b9d36});});},'VoiceChannelMixMonitor':function(_0x14c63d){var _0xcd08ab=this;return new Promise(function(_0x48524b,_0x237f59){if(ami['isConnected']()==![]){return _0x237f59(_0xcd08ab[_0x6704('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x6704('0x12')]['username'],'ami\x20disconnected'][_0x6704('0x15')]('\x20')));}var _0x117ac8=schema(properties[_0x6704('0x57')])[_0x6704('0x3')](_0x14c63d);if(_0x117ac8[_0x6704('0x52')]>0x0){return _0x237f59(_0xcd08ab[_0x6704('0x11')](0x1f4,_['map'](_0x117ac8,'message')[_0x6704('0x15')](',\x20')));}var _0x3c01a0=_[_0x6704('0x58')](_0x35bcc6[_0x6704('0x56')],{'uniqueid':_0x14c63d[_0x6704('0x59')]});if(_0x3c01a0&&_0x3c01a0[_0x6704('0x5a')]){var _0x261796=util[_0x6704('0x5b')](_0x6704('0x5c'),_0x14c63d[_0x6704('0x5d')]||_0x14c63d[_0x6704('0x59')],_0x14c63d[_0x6704('0x5b')]||_0x6704('0x5e'));return ami[_0x6704('0x1a')]({'action':_0x6704('0x5f'),'channel':_0x3c01a0[_0x6704('0x5a')],'file':_0x261796,'options':_0x6704('0x60')})['then'](function(_0x526175){var _0x316f81=_[_0x6704('0x58')](_0x3c01a0[_0x6704('0x61')],{'filename':_0x6704('0x62')+_0x261796['toLowerCase']()});if(_[_0x6704('0x63')](_0x316f81)){_0x3c01a0[_0x6704('0x61')][_0x6704('0x51')]({'filename':_0x6704('0x62')+_0x261796['toLowerCase'](),'createdAt':moment()[_0x6704('0x5b')](_0x6704('0x64')),'mixmonitorid':_0x526175[_0x6704('0x65')],'status':_0x6704('0x66')});}else{_0x316f81['mixmonitorid']=_0x526175['mixmonitorid'];_0x316f81[_0x6704('0x67')]=_0x6704('0x66');}_0x48524b({'code':0xc8,'message':[_0x14c63d[_0x6704('0x59')],_0x6704('0x68'),_0x526175[_0x6704('0x65')]][_0x6704('0x15')]('\x20'),'mixmonitorid':_0x526175['mixmonitorid']});})[_0x6704('0x1c')](function(_0x5361dd){_0x237f59(_0xcd08ab[_0x6704('0x11')](0x1f5,[_0x14c63d['uniqueid'],_0x5361dd['message'][_0x6704('0x69')]()][_0x6704('0x15')]('\x20')));});}else{return _0x237f59(_0xcd08ab[_0x6704('0x11')](0x1f5,_0x6704('0x6a')));}});},'VoiceChannelStopMixMonitor':function(_0x1514c5){var _0x340287=this;return new Promise(function(_0x4857e5,_0x54216a){if(ami[_0x6704('0x10')]()==![]){return _0x54216a(_0x340287[_0x6704('0x11')](0x1f4,[config[_0x6704('0x12')]['ip'],config[_0x6704('0x12')][_0x6704('0x13')],_0x6704('0x14')]['join']('\x20')));}var _0xb1dc8f=schema(properties[_0x6704('0x57')])[_0x6704('0x3')](_0x1514c5);if(_0xb1dc8f[_0x6704('0x52')]>0x0){return _0x54216a(_0x340287[_0x6704('0x11')](0x1f4,_[_0x6704('0x6b')](_0xb1dc8f,_0x6704('0x1b'))['join'](',\x20')));}var _0x547b89=_[_0x6704('0x58')](_0x35bcc6[_0x6704('0x56')],{'uniqueid':_0x1514c5[_0x6704('0x59')]});if(_0x547b89){return BPromise['resolve']()['then'](function(){if(_0x547b89[_0x6704('0x5a')]){return ami[_0x6704('0x1a')]({'action':_0x6704('0x6c'),'channel':_0x547b89[_0x6704('0x5a')],'mixmonitorid':_0x1514c5['mixmonitorid']})[_0x6704('0x1c')](function(_0x26c219){});}})['then'](function(){if(_0x547b89['destinationchannel']){return ami[_0x6704('0x1a')]({'action':_0x6704('0x6c'),'channel':_0x547b89[_0x6704('0x6d')],'mixmonitorid':_0x1514c5[_0x6704('0x65')]})[_0x6704('0x1c')](function(_0x1abdff){});}})[_0x6704('0x1e')](function(_0x533107){var _0x4876ad=_[_0x6704('0x58')](_0x547b89[_0x6704('0x61')],{'mixmonitorid':_0x1514c5[_0x6704('0x65')]});if(_0x4876ad){_0x4876ad[_0x6704('0x67')]=_0x6704('0x6e');}})[_0x6704('0x1e')](function(){var _0x10264d=util[_0x6704('0x5b')](_0x6704('0x5c'),_0x1514c5[_0x6704('0x5d')]||_0x1514c5[_0x6704('0x59')],_0x1514c5[_0x6704('0x5b')]||_0x6704('0x5e'));var _0x1cec1a=_[_0x6704('0x58')](_0x547b89[_0x6704('0x61')],{'filename':_0x6704('0x62')+_0x10264d[_0x6704('0x69')]()});if(_0x1cec1a){_0x1cec1a['status']=_0x6704('0x6e');}})[_0x6704('0x1e')](function(){_0x4857e5({'code':0xc8,'message':[_0x1514c5[_0x6704('0x59')],_0x6704('0x6f')]['join']('\x20')});})['catch'](function(_0x3f6a69){_0x54216a(_0x340287['error'](0x1f5,[_0x1514c5['uniqueid'],_0x3f6a69[_0x6704('0x1b')]['toLowerCase']()][_0x6704('0x15')]('\x20')));});}else{return _0x54216a(_0x340287['error'](0x1f5,_0x6704('0x6a')));}});},'VoiceQueuesChannels':function(_0x57c55d){return new Promise(function(_0x9d941b,_0x16acc3){var _0x2f0b65=_['values'](_0x35bcc6['queueChannels']);_0x9d941b({'count':_0x2f0b65[_0x6704('0x52')],'rows':_0x2f0b65});});},'VoiceQueuesChannel':function(_0x4edd74){var _0x42db9b=this;return new Promise(function(_0x545af4,_0x2befd9){var _0x2886d2=schema(properties[_0x6704('0x70')])[_0x6704('0x3')](_0x4edd74);if(_0x2886d2[_0x6704('0x52')]>0x0){return _0x2befd9(_0x42db9b[_0x6704('0x11')](0x1f4,_[_0x6704('0x6b')](_0x2886d2,_0x6704('0x1b'))['join'](',\x20')));}var _0x4873c9=_[_0x6704('0x58')](_0x35bcc6[_0x6704('0x71')],{'uniqueid':_0x4edd74[_0x6704('0x59')]});if(_0x4873c9){_0x545af4(_0x4873c9);}else{return _0x2befd9(_0x42db9b[_0x6704('0x11')](0x1f5,_0x6704('0x6a')));}});},'VoiceQueuesChannelHangup':function(_0x4d5437){var _0x362722=this;return new Promise(function(_0x3d8e65,_0xb5265d){if(ami[_0x6704('0x10')]()==![]){return _0xb5265d(_0x362722[_0x6704('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x6704('0x12')][_0x6704('0x13')],_0x6704('0x14')]['join']('\x20')));}var _0x4f946a=schema(properties[_0x6704('0x72')])[_0x6704('0x3')](_0x4d5437);if(_0x4f946a[_0x6704('0x52')]>0x0){return _0xb5265d(_0x362722[_0x6704('0x11')](0x1f4,_['map'](_0x4f946a,'message')['join'](',\x20')));}var _0x24d820=_[_0x6704('0x58')](_0x35bcc6['queueChannels'],{'uniqueid':_0x4d5437['uniqueid']});if(_0x24d820&&_0x24d820[_0x6704('0x5a')]){return ami[_0x6704('0x1a')]({'action':_0x6704('0x73'),'channel':_0x24d820[_0x6704('0x5a')]})[_0x6704('0x1e')](function(_0x569b70){_0x3d8e65({'code':0xc8,'message':[_0x4d5437[_0x6704('0x59')],_0x569b70[_0x6704('0x1b')][_0x6704('0x69')]()][_0x6704('0x15')]('\x20')});})[_0x6704('0x1c')](function(_0x37914d){_0xb5265d(_0x362722[_0x6704('0x11')](0x1f5,[_0x4d5437[_0x6704('0x59')],_0x37914d[_0x6704('0x1b')]['toLowerCase']()][_0x6704('0x15')]('\x20')));});}else{return _0xb5265d(_0x362722[_0x6704('0x11')](0x1f5,_0x6704('0x6a')));}});},'VoiceQueuesChannelRedirect':function(_0x230511){var _0x2254c5=this;return new Promise(function(_0x588204,_0x370e44){if(ami['isConnected']()==![]){return _0x370e44(_0x2254c5[_0x6704('0x11')](0x1f4,[config[_0x6704('0x12')]['ip'],config[_0x6704('0x12')][_0x6704('0x13')],_0x6704('0x14')][_0x6704('0x15')]('\x20')));}var _0xfb4f40=schema(properties[_0x6704('0x74')])['validate'](_0x230511);if(_0xfb4f40['length']>0x0){return _0x370e44(_0x2254c5[_0x6704('0x11')](0x1f4,_[_0x6704('0x6b')](_0xfb4f40,_0x6704('0x1b'))[_0x6704('0x15')](',\x20')));}var _0x1a06bb=_[_0x6704('0x58')](_0x35bcc6['queueChannels'],{'uniqueid':_0x230511[_0x6704('0x59')]});if(_0x1a06bb&&_0x1a06bb['channel']){return ami[_0x6704('0x1a')]({'action':_0x6704('0x75'),'channel':_0x1a06bb[_0x6704('0x5a')],'exten':_0x230511[_0x6704('0x76')],'context':_0x230511[_0x6704('0x77')]||_0x1a06bb[_0x6704('0x77')],'priority':0x1})[_0x6704('0x1e')](function(_0x27c59f){_0x588204({'code':0xc8,'message':[_0x230511[_0x6704('0x59')],_0x27c59f['message'][_0x6704('0x69')]()][_0x6704('0x15')]('\x20')});})[_0x6704('0x1c')](function(_0x4f03f0){_0x370e44(_0x2254c5[_0x6704('0x11')](0x1f5,[_0x230511[_0x6704('0x59')],_0x4f03f0[_0x6704('0x1b')][_0x6704('0x69')]()]['join']('\x20')));});}else{return _0x370e44(_0x2254c5['error'](0x1f5,_0x6704('0x6a')));}});},'Agents':function(_0x4e0598){return new Promise(function(_0x4248fc,_0x1c290b){var _0x240a3a=_['values'](_0x35bcc6[_0x6704('0xd')]);_0x4248fc({'count':_0x240a3a['length'],'rows':_0x240a3a});});},'Telephones':function(_0x1609a4){return new Promise(function(_0xd64c71,_0x3efa1c){var _0x586f77=_['values'](_0x35bcc6['telephones']);_0xd64c71({'count':_0x586f77[_0x6704('0x52')],'rows':_0x586f77});});},'Trunks':function(_0x33659d){return new Promise(function(_0x370e81,_0x59739b){var _0x303690=_['values'](_0x35bcc6[_0x6704('0x78')]);_0x370e81({'count':_0x303690['length'],'rows':_0x303690});});},'OutboundChannels':function(_0x51079d){return new Promise(function(_0x5ae97e,_0x108b19){var _0xa300ff=_['values'](_0x35bcc6[_0x6704('0x79')]);_0x5ae97e({'count':_0xa300ff[_0x6704('0x52')],'rows':_0xa300ff});});},'Outbound':function(_0x1fe620){return new Promise(function(_0x59bfe8,_0x57043e){_0x59bfe8(_0x35bcc6[_0x6704('0x7a')]);});},'Campaigns':function(_0x1760c3){return new Promise(function(_0x33270b,_0x3ec2fa){var _0xe4e13f=_[_0x6704('0x55')](_0x35bcc6[_0x6704('0x7b')]);_0x33270b({'count':_0xe4e13f[_0x6704('0x52')],'rows':_0xe4e13f});});},'VoiceQueuesPreview':function(_0x32e1c3){var _0x2f3c78=this;return new Promise(function(_0x224700,_0x466153){_0x3f4169[_0x6704('0x7c')](_0x32e1c3['id'])['then'](function(_0x5a6104){_0x224700({'code':0xc8,'message':_0x5a6104[_0x6704('0x1b')]});})['catch'](function(_0x53f303){_0x466153(_0x2f3c78[_0x6704('0x11')](0x1f4,_0x53f303[_0x6704('0x1b')]));});});},'EventManager':function(_0x1648c2){var _0x4bbd35=this;return new Promise(function(_0x1820e6,_0x164150){if(!_0x1648c2[_0x6704('0x7d')]){return _0x164150(_0x4bbd35[_0x6704('0x11')](0x1f4,_0x6704('0x7e')));}ami[_0x6704('0x7f')](_0x6704('0x80')+_0x1648c2[_0x6704('0x7d')],_0x1648c2[_0x6704('0x1b')]);_0x1820e6({'code':0xc8,'message':_0x1648c2});});},'FaxAccounts':function(_0x2f01af){return new Promise(function(_0x1cc6c0,_0x125b24){var _0x27727e=_[_0x6704('0x55')](_0x35bcc6[_0x6704('0x81')]);_0x1cc6c0({'count':_0x27727e[_0x6704('0x52')],'rows':_0x27727e});});},'SendFax':function(_0xc00196){var _0x1578d3=this;return new Promise(function(_0x583faa,_0x1c5af4){_0x626a14[_0x6704('0x82')](_0xc00196)['then'](function(_0x9514d8){_0x583faa({'code':0xc8,'message':_0x9514d8['message']});})[_0x6704('0x1c')](function(_0x4c072d){_0x1c5af4(_0x1578d3['error'](0x1f4,_0x4c072d['message']));});});},'CheckAfterSend':function(_0x4645c8){var _0x2284ca=this;return new Promise(function(_0x548f7c,_0x20c3a6){_0x626a14[_0x6704('0x83')](_0x4645c8)[_0x6704('0x1e')](function(_0x4eabce){_0x548f7c({'code':0xc8,'message':_0x4eabce['message']});})[_0x6704('0x1c')](function(_0x2742b8){_0x20c3a6(_0x2284ca[_0x6704('0x11')](0x1f4,_0x2742b8[_0x6704('0x1b')]));});});}};var _0x107f58=jayson[_0x6704('0x84')](_0x5ced8)[_0x6704('0x85')]();_0x107f58['on'](_0x6704('0x11'),function(_0x819efb){return _0x4badf8(_0x819efb);});_0x107f58[_0x6704('0x7')](0x232a,_0x6704('0x86'),function(){console[_0x6704('0x87')](_0x6704('0x88'),0x232a);return _0x2917be(_0x6704('0x89')+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 2f079bb..37b35c9 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(_0x5f1799,_0x3602b3){var _0x44f6b0=function(_0x1eeb94){while(--_0x1eeb94){_0x5f1799['push'](_0x5f1799['shift']());}};_0x44f6b0(++_0x3602b3);}(_0xb903,0x185));var _0x3b90=function(_0x1de985,_0x24a34d){_0x1de985=_0x1de985-0x0;var _0x11b21f=_0xb903[_0x1de985];return _0x11b21f;};'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 _0x207c=['defaults','redis','info','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','format','name','action','merge','length','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact'];(function(_0x1e6955,_0x2f6273){var _0x21271e=function(_0xd75f7d){while(--_0xd75f7d){_0x1e6955['push'](_0x1e6955['shift']());}};_0x21271e(++_0x2f6273);}(_0x207c,0x1e8));var _0xc207=function(_0x527c39,_0x3ea2a6){_0x527c39=_0x527c39-0x0;var _0x3f4dd6=_0x207c[_0x527c39];return _0x3f4dd6;};'use strict';var _=require('lodash');var BPromise=require(_0xc207('0x0'));var Redis=require(_0xc207('0x1'));var util=require(_0xc207('0x2'));var config=require(_0xc207('0x3'));var logger=require(_0xc207('0x4'))(_0xc207('0x5'));var cmContactRpc=require(_0xc207('0x6'));config['redis']=_[_0xc207('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc207('0x8')]));function emit(_0x314561,_0x3395e4,_0x59ff6f,_0x25cb97,_0xad159b){logger[_0xc207('0x9')]('[CM][%s][%s]',_0x314561,_0x3395e4['id'],_0x59ff6f,_0x25cb97,JSON[_0xc207('0xa')](_0xad159b));io['to'](_0x59ff6f)[_0xc207('0xb')](_0x25cb97,_0xad159b);}exports[_0xc207('0xc')]=function(_0x13ec41,_0x201162,_0x347549,_0x487d95){var _0x574425,_0x5b556f;var _0x19b297={};var _0x491062=Number(_0x347549[_0xc207('0xd')]);var _0x2782ce=_0x347549['data2']?Boolean(Number(_0x347549[_0xc207('0xe')])):![];var _0xb86b06;var _0x3062f5=![];if(!_[_0xc207('0xf')](_0x347549[_0xc207('0x10')])){if(_0x347549['data5']=='1')_0x3062f5=!![];}if(!_0x3062f5){if(_0x487d95[_0xc207('0x11')]){_0x19b297['id']=_0x487d95[_0xc207('0x11')];}}if(!_0x19b297['id']){_0x19b297[_0xc207('0x12')]=_0x491062;_0xb86b06=_0x347549[_0xc207('0x13')]&&_0x347549['data3']!=='0'?_0x347549['data3']['split'](','):[_0xc207('0x14')];_0x19b297[_0xc207('0x15')]=_[_0xc207('0x16')](_0xb86b06,function(_0x65f539){var _0x4b8f44={};_0x4b8f44[_0x65f539]=_0x487d95[_0xc207('0x17')]?_0x487d95[_0xc207('0x18')]:_0x487d95[_0xc207('0x19')];return _0x4b8f44;});}var _0x5f288e=['id',_0xc207('0x1a'),'lastName',_0xc207('0x14'),_0xc207('0x1b'),_0xc207('0x1c'),_0xc207('0x12'),_0xc207('0x1d'),_0xc207('0x1e'),_0xc207('0x1f')];var _0x464dea=_[_0xc207('0x20')](_0x5f288e,_0xb86b06);BPromise[_0xc207('0x21')]()[_0xc207('0x22')](cmContactRpc[_0xc207('0x23')]({'attributes':_0x464dea,'where':_0x19b297}))[_0xc207('0x22')](function(_0x4b52a7){_0x5b556f=_0x4b52a7;if(!_[_0xc207('0x24')](_0x5b556f)){if(_0x5b556f['length']===0x1){_0x574425=_0x5b556f[0x0];logger[_0xc207('0x9')](_0xc207('0x25'),_0x487d95[_0xc207('0x26')],_0x201162['id'],_0x574425['id']);}else{logger[_0xc207('0x9')](_0xc207('0x27'),_0x487d95[_0xc207('0x26')],_0x201162['id'],_[_0xc207('0x16')](_0x5b556f,'id')[_0xc207('0x28')](','));}return;}else{logger[_0xc207('0x9')](_0xc207('0x29'),_0x487d95[_0xc207('0x26')],_0x201162['id']);var _0x27df03={'ListId':_0x491062};var _0x3f738e=_0x347549[_0xc207('0x2a')]&&_0x347549[_0xc207('0x2a')]!=='0'?_0x347549['data4']:_0xc207('0x14');if(_0x2782ce){logger['info']('[CM][%s][%s]\x20Autocreate\x20enabled',_0x487d95[_0xc207('0x26')],_0x201162['id']);_0x27df03[_0x3f738e]=_[_0xc207('0xf')](_0x487d95[_0xc207('0x17')])?_0x487d95[_0xc207('0x19')]:_0x487d95[_0xc207('0x18')];if(_['isNil'](_0x487d95[_0xc207('0x17')])){_0x27df03[_0xc207('0x1a')]=_0x487d95[_0xc207('0x2b')]&&_0x487d95[_0xc207('0x2b')]!==_0xc207('0x2c')?_0x487d95[_0xc207('0x2b')]:_0xc207('0x2d');}else{_0x27df03[_0xc207('0x1a')]=_0x487d95[_0xc207('0x2e')]&&_0x487d95[_0xc207('0x2e')]!==_0xc207('0x2c')?_0x487d95[_0xc207('0x2e')]:_0xc207('0x2d');}return BPromise['resolve']()[_0xc207('0x22')](cmContactRpc[_0xc207('0x2f')](_0x27df03))[_0xc207('0x22')](function(_0x448df1){_0x574425=_0x448df1;_0x5b556f[_0xc207('0x30')](_0x448df1);if(_0x574425){logger[_0xc207('0x9')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x487d95[_0xc207('0x26')],_0x201162['id'],_0x574425['id']);}return;});}else{logger[_0xc207('0x9')](_0xc207('0x31'),_0x487d95[_0xc207('0x26')],_0x201162['id']);_0x27df03[_0x3f738e]=_['isNil'](_0x487d95[_0xc207('0x17')])?_0x487d95[_0xc207('0x19')]:_0x487d95[_0xc207('0x18')];if(_[_0xc207('0xf')](_0x487d95[_0xc207('0x17')])){_0x27df03[_0xc207('0x1a')]=_0x487d95[_0xc207('0x2b')]&&_0x487d95[_0xc207('0x2b')]!==_0xc207('0x2c')?_0x487d95['calleridname']:'Unknown';}else{_0x27df03[_0xc207('0x1a')]=_0x487d95[_0xc207('0x2e')]&&_0x487d95[_0xc207('0x2e')]!==_0xc207('0x2c')?_0x487d95['destcalleridname']:_0xc207('0x2d');}_0x574425=_0x27df03;_0x5b556f[_0xc207('0x30')](_0x27df03);return;}}})[_0xc207('0x22')](function(){if(_0x13ec41){emit(_0x487d95[_0xc207('0x26')],_0x201162,util[_0xc207('0x32')]('user:%s',_0x13ec41[_0xc207('0x33')]),util[_0xc207('0x32')]('trigger:%s',_0x347549[_0xc207('0x34')]['toLowerCase']()),{'evt':_[_0xc207('0x35')](_0x487d95,{'autoCreate':_0x2782ce}),'contact':_0x574425===undefined?{}:_0x574425,'contacts':_0x5b556f[_0xc207('0x36')]===0x0?undefined:_0x5b556f});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index dadbf6a..63b1fb2 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 _0xb486=['event','value','queue','membername','lastevent','mailSubstatus','null','undefined','substatus','exports','util','lodash','mustache','./urlforward','./integration','./cmContact','../../../config/environment','../ami','redis','socket.io-emitter','url','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','accounts','syncCustomEvent','bind','custom:agentconnect','custom:agentnosuchnumber','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','stringify','clone','motionChannel','voice','checkTriggers','interface','status','merge','variables','Actions','length','action','toLowerCase','contactmanager','data1','popup','TemplateId','data2','html','template\x20not\x20found','uri','buildUri','isNil','data3','data4','uriLocation','windowWidth','800','windowHeight','data6','render','format','user:%s','name','trigger:%s:%s','jscripty','trigger:%s','exec','routeId','urlforward','script','parse','query','search','replace','checkTrigger','channel','AllConditions','every','checkConditions','AnyConditions','field','account','operator','ChatWebsiteId','upperFirst','AccountId','interaction'];(function(_0x22cb10,_0x20db4f){var _0x38a6f8=function(_0xdb4b16){while(--_0xdb4b16){_0x22cb10['push'](_0x22cb10['shift']());}};_0x38a6f8(++_0x20db4f);}(_0xb486,0x1d2));var _0x6b48=function(_0x1e772a,_0x38d6bb){_0x1e772a=_0x1e772a-0x0;var _0x1f9a9c=_0xb486[_0x1e772a];return _0x1f9a9c;};'use strict';var util=require(_0x6b48('0x0'));var _=require(_0x6b48('0x1'));var url=require('url');var Mustache=require(_0x6b48('0x2'));var Redis=require('ioredis');var urlforward=require(_0x6b48('0x3'));var integration=require(_0x6b48('0x4'));var cmContact=require(_0x6b48('0x5'));var script=require('./script');var config=require(_0x6b48('0x6'));var logger=require('../../../config/logger')('trigger');var ami=require(_0x6b48('0x7'));config[_0x6b48('0x8')]=_['defaults'](config[_0x6b48('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x6b48('0x9'))(new Redis(config[_0x6b48('0x8')]));var operators={'equals':function(_0x3f0f3e,_0x46f470){return _0x3f0f3e==_0x46f470;},'not_equals':function(_0x40fa19,_0x117d19){return _0x40fa19!=_0x117d19;}};var barAndWebActions=['popup',_0x6b48('0xa'),_0x6b48('0xb')];function Trigger(_0x3747f2){this[_0x6b48('0xc')]=_0x3747f2['triggers'];this[_0x6b48('0xd')]=_0x3747f2[_0x6b48('0xd')];this[_0x6b48('0xe')]=_0x3747f2['voiceQueues'];this[_0x6b48('0xf')]=_0x3747f2[_0x6b48('0xf')];this[_0x6b48('0x10')]=_0x3747f2[_0x6b48('0x10')];this[_0x6b48('0x11')]=_0x3747f2[_0x6b48('0x11')];this['freshdeskAccounts']=_0x3747f2[_0x6b48('0x12')];this[_0x6b48('0x13')]=_0x3747f2[_0x6b48('0x13')];this['sugarcrmAccounts']=_0x3747f2[_0x6b48('0x14')];this[_0x6b48('0x15')]=_0x3747f2[_0x6b48('0x15')];this[_0x6b48('0x16')]=_0x3747f2[_0x6b48('0x16')];this[_0x6b48('0x17')]=_0x3747f2[_0x6b48('0x17')];this['servicenowAccounts']=_0x3747f2[_0x6b48('0x18')];this['dynamics365Accounts']=_0x3747f2['dynamics365Accounts'];this['freshsalesAccounts']=_0x3747f2[_0x6b48('0x19')];this[_0x6b48('0x1a')]={'zendesk':this[_0x6b48('0x11')],'salesforce':this[_0x6b48('0x13')],'freshdesk':this[_0x6b48('0x12')],'sugarcrm':this[_0x6b48('0x14')],'zoho':this[_0x6b48('0x15')],'desk':this[_0x6b48('0x16')],'vtiger':this[_0x6b48('0x17')],'dynamics365':this['dynamics365Accounts'],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x6b48('0x18')]};ami['on']('custom:agentcalled',this[_0x6b48('0x1b')][_0x6b48('0x1c')](this));ami['on'](_0x6b48('0x1d'),this[_0x6b48('0x1b')][_0x6b48('0x1c')](this));ami['on']('custom:agentringnoanswer',this[_0x6b48('0x1b')][_0x6b48('0x1c')](this));ami['on']('custom:agentcomplete',this['syncCustomEvent'][_0x6b48('0x1c')](this));ami['on'](_0x6b48('0x1e'),this[_0x6b48('0x1b')][_0x6b48('0x1c')](this));ami['on']('custom:agentnoanswer',this[_0x6b48('0x1b')][_0x6b48('0x1c')](this));ami['on']('custom:agentbusy',this['syncCustomEvent'][_0x6b48('0x1c')](this));ami['on'](_0x6b48('0x1f'),this[_0x6b48('0x1b')]['bind'](this));ami['on'](_0x6b48('0x20'),this[_0x6b48('0x1b')][_0x6b48('0x1c')](this));ami['on'](_0x6b48('0x21'),this[_0x6b48('0x1b')]['bind'](this));ami['on'](_0x6b48('0x22'),this[_0x6b48('0x1b')][_0x6b48('0x1c')](this));ami['on']('custom:timeout',this[_0x6b48('0x1b')][_0x6b48('0x1c')](this));ami['on'](_0x6b48('0x23'),this[_0x6b48('0x24')][_0x6b48('0x1c')](this));ami['on'](_0x6b48('0x25'),this['syncAgentDial'][_0x6b48('0x1c')](this));ami['on']('custom:dialend',this[_0x6b48('0x24')][_0x6b48('0x1c')](this));ami['on'](_0x6b48('0x26'),this[_0x6b48('0x1b')][_0x6b48('0x1c')](this));ami['on'](_0x6b48('0x27'),this[_0x6b48('0x1b')]['bind'](this));ami['on'](_0x6b48('0x28'),this[_0x6b48('0x1b')]['bind'](this));ami['on']('custom:incomingmessage',this[_0x6b48('0x1b')]['bind'](this));ami['on'](_0x6b48('0x29'),this['syncCustomEvent'][_0x6b48('0x1c')](this));ami['on'](_0x6b48('0x2a'),this[_0x6b48('0x1b')]['bind'](this));ami['on'](_0x6b48('0x2b'),this['syncCustomEvent']['bind'](this));}Trigger[_0x6b48('0x2c')][_0x6b48('0x2d')]=function(_0xb7beec,_0x331f5e,_0x11e14e){logger['info'](_0xb7beec,_0x331f5e,JSON[_0x6b48('0x2e')](_0x11e14e));io['to'](_0xb7beec)[_0x6b48('0x2d')](_0x331f5e,_0x11e14e);};Trigger['prototype'][_0x6b48('0x1b')]=function(_0x108a4a){var _0x411edb=_[_0x6b48('0x2f')](_0x108a4a);if(typeof _0x411edb[_0x6b48('0x30')]==='undefined'){_0x411edb[_0x6b48('0x30')]=_0x6b48('0x31');}this[_0x6b48('0x32')](_0x411edb);};Trigger[_0x6b48('0x2c')][_0x6b48('0x24')]=function(_0x1aa65a){if(this[_0x6b48('0xd')][_0x1aa65a[_0x6b48('0x33')]]){this['syncCustomEvent'](_0x1aa65a);}};Trigger[_0x6b48('0x2c')][_0x6b48('0x32')]=function(_0x52e1db){var _0x1148d3;for(var _0x3494c7 in this['triggers']){if(this[_0x6b48('0xc')]['hasOwnProperty'](_0x3494c7)){if(this[_0x6b48('0xc')][_0x3494c7][_0x6b48('0x34')]){_0x1148d3=this['checkTrigger'](this[_0x6b48('0xc')][_0x3494c7],_0x52e1db);if(_0x1148d3){_[_0x6b48('0x35')](_0x52e1db,_0x52e1db[_0x6b48('0x36')]);for(var _0x3dd61f=0x0,_0x26e485,_0x555de4,_0x414e42;_0x3dd61f0x0){_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 _0x9957=['Motion','CTI','concat','Tags','/api/v2/users/%d','Descriptions','%s/customers/%d/cases','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','Desk\x20account\x20type\x20not\x20recognized','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','integrationTab','newTab','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','desk','defaults','redis','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','[HTTP]','stringify','GET','password','authType','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','variable','variableName','customVariable','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x2e74cd,_0x310ed0){var _0x8e1e84=function(_0x53f562){while(--_0x53f562){_0x2e74cd['push'](_0x2e74cd['shift']());}};_0x8e1e84(++_0x310ed0);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var rp=require(_0x7995('0x1'));var md5=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var Redis=require('ioredis');var intUtil=require(_0x7995('0x4'));var config=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));config['redis']=_[_0x7995('0x8')](config[_0x7995('0x9')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x9')]));function emit(_0x326741,_0x4996ca,_0x465276){io['to'](_0x326741)[_0x7995('0xc')](_0x4996ca,_0x465276);}var headers={'Content-Type':'application/json','Accept':_0x7995('0xd')};function getUser(_0x3116fb,_0x18c8a3){if(intUtil[_0x7995('0xe')](_0x18c8a3)===!![]){logger[_0x7995('0xf')](_0x7995('0x10'),_0x18c8a3);return request({'uri':util[_0x7995('0x11')]('%s/users',_0x3116fb[_0x7995('0x12')])})[_0x7995('0x13')](function(_0x581f22){if(_0x581f22[_0x7995('0x14')]){return _[_0x7995('0x15')](_0x581f22[_0x7995('0x16')][_0x7995('0x17')],{'email':_0x18c8a3});}})[_0x7995('0x13')](function(_0x23999f){if(_0x23999f){logger[_0x7995('0xf')]('Agent\x20found!');return _0x23999f;}else{logger['info'](_0x7995('0x18'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb[_0x7995('0x12')])});}});}else{logger[_0x7995('0xf')](_0x7995('0x1a'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb['remoteUri'])});}}function request(_0x2eeacc){logger['debug'](_0x7995('0x1b'),JSON[_0x7995('0x1c')](_0x2eeacc));return rp(_[_0x7995('0x8')](_0x2eeacc,{'method':_0x7995('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x1e1415){var _0x37a7d4;if(_0x1e1415['authType']==='basic'){_0x37a7d4=util[_0x7995('0x11')]('%s:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x1e')]);}else if(_0x1e1415[_0x7995('0x1f')]==='token'){_0x37a7d4=util[_0x7995('0x11')]('%s/token:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x20')]);}return util[_0x7995('0x11')](_0x7995('0x21'),new Buffer(_0x37a7d4)[_0x7995('0x22')](_0x7995('0x23')));}function getEndUser(_0x1c278a,_0x5d40ae,_0x32a09a){logger[_0x7995('0xf')](_0x7995('0x24'),_0x32a09a);return request({'uri':util[_0x7995('0x11')](_0x7995('0x25'),_0x1c278a[_0x7995('0x12')]),'qs':{'phone':_0x32a09a}})[_0x7995('0x13')](function(_0x472195){if(_0x472195['total_entries']){logger[_0x7995('0xf')](_0x7995('0x26'));return _0x472195[_0x7995('0x16')][_0x7995('0x17')][0x0];}else{logger[_0x7995('0xf')](_0x7995('0x27'));return request({'uri':util['format'](_0x7995('0x28'),_0x1c278a['remoteUri']),'method':_0x7995('0x29'),'body':{'first_name':_0x5d40ae,'title':_0x5d40ae,'phone_numbers':[{'type':_0x7995('0x2a'),'value':_0x32a09a}]}});}});}function getTags(_0xf16cc2,_0x132a42){var _0x11c1eb=[];if(_0xf16cc2&&_0xf16cc2['length']>0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index fd30949..70ca92e 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 _0x30be=['format','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','tenantId','uniqueid','monitor_format','[QUEUE]','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','lodash','bluebird','request-promise','./util','md5','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','password','clientSecret','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','outbound','destcalleridnum','/systemusers(','headers','substring','lastIndexOf','enduserId','toLowerCase','calleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','picklist','type','nameField','customField','indexOf','incident','getString','Subjects','Descriptions','/contacts(','ticketType','phonecall','callDirection','queue','phonecalls','assign','ticketId'];(function(_0x22d045,_0x13fd64){var _0x2460b1=function(_0x3e0ddf){while(--_0x3e0ddf){_0x22d045['push'](_0x22d045['shift']());}};_0x2460b1(++_0x13fd64);}(_0x30be,0xe1));var _0xe30b=function(_0x2c32fb,_0x45b9a8){_0x2c32fb=_0x2c32fb-0x0;var _0x1f2836=_0x30be[_0x2c32fb];return _0x1f2836;};'use strict';var _=require(_0xe30b('0x0'));var BPromise=require(_0xe30b('0x1'));var rp=require(_0xe30b('0x2'));var util=require('util');var intUtil=require(_0xe30b('0x3'));var md5=require(_0xe30b('0x4'));var Redis=require('ioredis');var logger=require(_0xe30b('0x5'))(_0xe30b('0x6'));var config=require(_0xe30b('0x7'));config[_0xe30b('0x8')]=_[_0xe30b('0x9')](config[_0xe30b('0x8')],{'host':_0xe30b('0xa'),'port':0x18eb});var io=require(_0xe30b('0xb'))(new Redis(config[_0xe30b('0x8')]));function getAuthToken(_0x24d70e,_0x7445d4,_0x5e95e2){var _0x3211a5={'method':_0xe30b('0xc'),'uri':_0x7445d4,'form':{'client_id':_0x24d70e[_0xe30b('0xd')],'resource':_0x24d70e[_0xe30b('0xe')],'username':_0x24d70e['username'],'password':_0x24d70e[_0xe30b('0xf')],'grant_type':_0xe30b('0xf'),'client_secret':_0x24d70e[_0xe30b('0x10')]},'json':!![]};return rp(_0x3211a5)['then'](function(_0x5605a6){return _0x5605a6[_0xe30b('0x11')];})[_0xe30b('0x12')](function(_0xba91b5){logger[_0xe30b('0x13')]('['+[_0x5e95e2[_0xe30b('0x14')]()]+_0xe30b('0x15'));return _0xba91b5[_0xe30b('0x16')];});}function getUser(_0x228fd6,_0x5f4573,_0x1ed719,_0x4ec8cd,_0x41e597,_0x43d850){return new BPromise(function(_0x57882d,_0x5c0799){return getAuthToken(_0x5f4573,_0x4ec8cd,_0x43d850)[_0xe30b('0x17')](function(_0x5bce5a){var _0x128df9={'method':_0xe30b('0x18'),'uri':_0x41e597+_0xe30b('0x19'),'headers':{'Authorization':_0xe30b('0x1a')+_0x5bce5a,'OData-Version':_0xe30b('0x1b')},'json':!![]};return rp(_0x128df9);})[_0xe30b('0x17')](function(_0x1dcc81){var _0x260502=_0x1dcc81[_0xe30b('0x1c')];var _0x21fd11=![];var _0x361a25=null;if(!_['isNil'](_0x1ed719)){if(intUtil[_0xe30b('0x1d')](_0x1ed719[_0xe30b('0x1e')])){_0x228fd6[_0xe30b('0x1f')]=_0x1ed719[_0xe30b('0x1e')];for(_0x361a25=0x0;_0x361a25<_0x260502[_0xe30b('0x20')];_0x361a25++){if(_0x260502[_0x361a25][_0xe30b('0x21')]===_0x1ed719[_0xe30b('0x1e')]&&!_0x260502[_0x361a25][_0xe30b('0x22')]){_0x21fd11=!![];logger[_0xe30b('0x23')]('['+[_0x43d850[_0xe30b('0x14')]()]+_0xe30b('0x24')+_0x260502[_0x361a25][_0xe30b('0x25')]+'!');_0x228fd6[_0xe30b('0x26')]=_0x260502[_0x361a25]['systemuserid'];}}}}if(!_0x21fd11){logger[_0xe30b('0x23')]('['+[_0x43d850['toUpperCase']()]+_0xe30b('0x27'));_0x228fd6[_0xe30b('0x1f')]=_0x5f4573[_0xe30b('0x28')];for(_0x361a25=0x0;_0x361a25<_0x260502[_0xe30b('0x20')];_0x361a25++){if(_0x260502[_0x361a25]['internalemailaddress']===_0x5f4573[_0xe30b('0x28')]){_0x228fd6[_0xe30b('0x26')]=_0x260502[_0x361a25][_0xe30b('0x25')];}}}_0x57882d(_0x228fd6);})[_0xe30b('0x12')](function(_0x3d6ea2){_0x5c0799(_0x3d6ea2[_0xe30b('0x16')]);});});}function createEndUser(_0x46eb36,_0x13dcaa,_0x24a830,_0x2315ac,_0x37600c,_0x35bd9d){return new BPromise(function(_0x4d097c,_0x30ed6c){return getAuthToken(_0x13dcaa,_0x24a830,_0x35bd9d)[_0xe30b('0x17')](function(_0x3e85ea){var _0xe09ddf=_0x35bd9d['toLowerCase']()===_0xe30b('0x29')?_0x37600c[_0xe30b('0x2a')]:_0x37600c['calleridnum'];var _0x2b2cea={'method':_0xe30b('0xc'),'uri':_0x2315ac+'contacts','body':{'telephone1':_0xe09ddf,'fullname':_0xe09ddf,'firstname':_0xe09ddf,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xe30b('0x2b')+_0x46eb36[_0xe30b('0x26')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x3e85ea,'OData-Version':_0xe30b('0x1b')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x2b2cea);})[_0xe30b('0x17')](function(_0x3eba54){var _0x2506a3=_0x3eba54[_0xe30b('0x2c')]['odata-entityid'];var _0x34b367=_0x2506a3[_0xe30b('0x2d')](_0x2506a3[_0xe30b('0x2e')]('(')+0x1,_0x2506a3[_0xe30b('0x2e')](')'));_0x46eb36[_0xe30b('0x2f')]=_0x34b367;_0x4d097c(_0x46eb36);})['catch'](function(_0x511019){_0x30ed6c(_0x511019['message']);});});}function getEndUser(_0x139bae,_0x386c9f,_0x518f47,_0x21f449,_0x40a72a,_0x9f3c76,_0x2bb94f){var _0xa15e35=_0x9f3c76[_0xe30b('0x30')]()===_0xe30b('0x29')?_0x40a72a['destcalleridnum']:_0x40a72a[_0xe30b('0x31')];return getAuthToken(_0x386c9f,_0x518f47,_0x9f3c76)[_0xe30b('0x17')](function(_0x20321c){var _0x3fd313={'method':_0xe30b('0x18'),'uri':_0x21f449+_0xe30b('0x32')+_0xa15e35[_0xe30b('0x33')]('+','%2b')+'\x27','headers':{'Authorization':_0xe30b('0x1a')+_0x20321c,'If-None-Match':null,'OData-Version':_0xe30b('0x1b')},'json':!![]};return rp(_0x3fd313);})[_0xe30b('0x17')](function(_0x22b534){var _0x369712=![];if(!_0x22b534)return _0x369712;var _0x49d858=_0x22b534[_0xe30b('0x1c')];for(var _0x30361a=0x0;_0x30361a<_0x49d858[_0xe30b('0x20')];_0x30361a++){if(_0x49d858[_0x30361a]['telephone1']===_0xa15e35){_0x369712=!![];_0x139bae[_0xe30b('0x2f')]=_0x49d858[_0x30361a][_0xe30b('0x34')];}}return _0x369712;})[_0xe30b('0x17')](function(_0x1a01bb){if(_0x1a01bb)return _0x139bae;if(_0x2bb94f===_0xe30b('0x35')){logger[_0xe30b('0x23')]('['+[_0x9f3c76['toUpperCase']()]+_0xe30b('0x36'));return _0x139bae;}return createEndUser(_0x139bae,_0x386c9f,_0x518f47,_0x21f449,_0x40a72a,_0x9f3c76)['then'](function(_0x35826c){logger[_0xe30b('0x23')]('['+[_0x9f3c76[_0xe30b('0x14')]()]+_0xe30b('0x37'),_0x35826c['enduserId']);return _0x35826c;});});}function getCustomFields(_0x5d2855,_0x2de112,_0x247b93){var _0x2e7c0f={};if(_0x5d2855[_0xe30b('0x20')]>0x0){_[_0xe30b('0x38')](_0x5d2855,function(_0x511195){if(_[_0xe30b('0x39')](['string',_0xe30b('0x3a')],_0x511195[_0xe30b('0x3b')])&&_0x511195[_0xe30b('0x3c')]&&!_0x511195[_0xe30b('0x3d')]){var _0x522cb2=_0x511195['idField'][_0xe30b('0x30')]();var _0x5d6e97=_0x522cb2[_0xe30b('0x2d')](0x0,_0x522cb2[_0xe30b('0x3e')]('_'));var _0x167866=_0x522cb2[_0xe30b('0x2d')](_0x522cb2[_0xe30b('0x3e')]('_')+0x1);if(_0x5d6e97===_0x247b93){_0x2e7c0f[_0x167866]=_0x511195['content'];}}});}return _0x2e7c0f;}function getTicket(_0x317caa,_0x24fbaf,_0x19cc90,_0x190a15,_0x4c599a,_0x29ad3b,_0x14177c){return new BPromise(function(_0x11f6ff,_0x540be8){var _0x25dc30;return getAuthToken(_0x24fbaf,_0x19cc90,_0x14177c)[_0xe30b('0x17')](function(_0x35933e){if(_0x29ad3b['ticketType']===_0xe30b('0x3f')){_0x25dc30={'method':_0xe30b('0xc'),'uri':_0x190a15+'incidents','body':Object['assign']({},{'title':intUtil[_0xe30b('0x40')](_0x29ad3b[_0xe30b('0x41')],_0x4c599a,'\x20'),'description':intUtil[_0xe30b('0x40')](_0x29ad3b[_0xe30b('0x42')],_0x4c599a,'\x0a'),'customerid_contact@odata.bind':_0x317caa[_0xe30b('0x2f')]?_0xe30b('0x43')+_0x317caa['enduserId']+')':undefined,'ownerid@odata.bind':_0xe30b('0x2b')+_0x317caa[_0xe30b('0x26')]+')','caseorigincode':'1'},getCustomFields(_0x29ad3b['Fields'],_0x4c599a,_0x29ad3b[_0xe30b('0x44')])),'headers':{'Authorization':_0xe30b('0x1a')+_0x35933e,'OData-Version':_0xe30b('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x29ad3b[_0xe30b('0x44')]===_0xe30b('0x45')){var _0x502a21=_0x317caa['enduserId']?[{'partyid_systemuser@odata.bind':_0xe30b('0x2b')+_0x317caa[_0xe30b('0x26')]+')','participationtypemask':_0x317caa[_0xe30b('0x46')]===_0xe30b('0x47')?0x2:0x1},{'partyid_contact@odata.bind':_0xe30b('0x43')+_0x317caa[_0xe30b('0x2f')]+')','participationtypemask':_0x317caa['callDirection']===_0xe30b('0x47')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xe30b('0x2b')+_0x317caa[_0xe30b('0x26')]+')','participationtypemask':_0x317caa[_0xe30b('0x46')]===_0xe30b('0x47')?0x2:0x1}];_0x25dc30={'method':_0xe30b('0xc'),'uri':_0x190a15+_0xe30b('0x48'),'body':Object[_0xe30b('0x49')]({},{'subject':intUtil[_0xe30b('0x40')](_0x29ad3b[_0xe30b('0x41')],_0x4c599a,'\x20'),'phonenumber':String(_0x4c599a[_0xe30b('0x31')]),'description':intUtil['getString'](_0x29ad3b['Descriptions'],_0x4c599a,'\x0a'),'regardingobjectid_contact@odata.bind':_0x317caa[_0xe30b('0x2f')]?'/contacts('+_0x317caa[_0xe30b('0x2f')]+')':undefined,'ownerid@odata.bind':_0xe30b('0x2b')+_0x317caa[_0xe30b('0x26')]+')','directioncode':_0x317caa[_0xe30b('0x46')]==='queue'?![]:!![],'phonecall_activity_parties':_0x502a21},getCustomFields(_0x29ad3b['Fields'],_0x4c599a,_0x29ad3b[_0xe30b('0x44')])),'headers':{'Authorization':_0xe30b('0x1a')+_0x35933e,'OData-Version':_0xe30b('0x1b')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x25dc30);})[_0xe30b('0x17')](function(_0x41449c){var _0x248504=_0x41449c[_0xe30b('0x2c')]['odata-entityid'];var _0x11e343=_0x248504[_0xe30b('0x2d')](_0x248504['lastIndexOf']('(')+0x1,_0x248504['lastIndexOf'](')'));_0x317caa[_0xe30b('0x4a')]=_0x11e343;_0x11f6ff(_0x317caa);})[_0xe30b('0x12')](function(_0x4448b0){_0x540be8(_0x4448b0[_0xe30b('0x16')]);});});}function emit(_0x2a8c03,_0x463d58,_0x13fefc,_0x49628f){var _0x188138={'uri':util[_0xe30b('0x4b')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x2a8c03,_0x13fefc,_0x49628f)};io['to'](util[_0xe30b('0x4b')](_0xe30b('0x4c'),_0x463d58))[_0xe30b('0x4d')](_0xe30b('0x4e'),_0x188138);}exports['cs']=function(_0xf3d2d8,_0xd74369,_0x55432c,_0x4254f5,_0x40466f,_0x39d1dc,_0x16d90b,_0xd94713){var _0x1f79b2={};_0x39d1dc[_0xe30b('0xe')]=intUtil[_0xe30b('0x4f')](_0x39d1dc[_0xe30b('0xe')]);_0x39d1dc['serverUrl']=intUtil[_0xe30b('0x4f')](_0x39d1dc[_0xe30b('0x50')]);_0x1f79b2[_0xe30b('0x46')]=_0xd94713==='queue'||_0xd94713===_0xe30b('0x51')?_0xe30b('0x47'):_0xe30b('0x29');var _0x3788c1=util[_0xe30b('0x4b')](_0xe30b('0x52'),_0x39d1dc[_0xe30b('0xe')]);var _0x2b9d25=util['format']('https://login.microsoftonline.com/%s/oauth2/token',_0x39d1dc[_0xe30b('0x53')]);var _0x2222b5=util[_0xe30b('0x4b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x39d1dc[_0xe30b('0x50')],_0xd74369[_0xe30b('0x54')],md5(_0xd74369['uniqueid']));if(_0x40466f&&_0x40466f[_0xe30b('0x55')]){logger[_0xe30b('0x23')](_0xe30b('0x56'),'Recording\x20is\x20enabled!');_0xd74369['recordingURL']=_0x2222b5;}else if(_0x16d90b&&_0x16d90b['recordingFormat']&&_0x16d90b[_0xe30b('0x57')]!==_0xe30b('0x58')){logger['info'](_0xe30b('0x59'),_0xe30b('0x5a'));_0xd74369[_0xe30b('0x5b')]=_0x2222b5;}else{_0xd74369['recordingURL']='';}return getUser(_0x1f79b2,_0x39d1dc,_0x4254f5,_0x2b9d25,_0x3788c1,_0xd94713)['then'](function(_0x314101){logger[_0xe30b('0x23')]('['+_0xd94713[_0xe30b('0x14')]()+_0xe30b('0x5c'),_0x314101[_0xe30b('0x26')]);logger['info']('['+_0xd94713[_0xe30b('0x14')]()+_0xe30b('0x5d'),_0x314101['userEmail']);return getEndUser(_0x314101,_0x39d1dc,_0x2b9d25,_0x3788c1,_0xd74369,_0xd94713,_0x55432c[_0xe30b('0x5e')]);})['then'](function(_0x3b0522){logger[_0xe30b('0x23')]('['+_0xd94713[_0xe30b('0x14')]()+_0xe30b('0x5f'),_0x3b0522[_0xe30b('0x2f')]);logger[_0xe30b('0x23')]('['+_0xd94713[_0xe30b('0x14')]()+_0xe30b('0x60'),_0xd74369[_0xe30b('0x31')]);return getTicket(_0x3b0522,_0x39d1dc,_0x2b9d25,_0x3788c1,_0xd74369,_0x55432c,_0xd94713);})[_0xe30b('0x17')](function(_0x296a7f){logger[_0xe30b('0x23')](util[_0xe30b('0x4b')]('['+_0xd94713[_0xe30b('0x14')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x55432c['ticketType'],_0x296a7f['ticketId']));logger[_0xe30b('0x23')](util[_0xe30b('0x4b')]('['+_0xd94713[_0xe30b('0x14')]()+_0xe30b('0x61'),_0xd94713));if(_0xd94713!==_0xe30b('0x51')){logger[_0xe30b('0x23')]('['+_0xd94713[_0xe30b('0x14')]()+']',_0xe30b('0x62'));emit(_0x39d1dc[_0xe30b('0xe')],_0x4254f5[_0xe30b('0x63')],_0x55432c[_0xe30b('0x44')],_0x296a7f[_0xe30b('0x4a')]);}})[_0xe30b('0x12')](function(_0x5944b2){logger[_0xe30b('0x13')]('['+_0xd94713[_0xe30b('0x14')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util['inspect'](_0x5944b2,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x8bae=['password','then','error','toUpperCase',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','validateEmail','userEmail','email','length','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','catch','toLowerCase','destcalleridnum','calleridnum','contacts','/systemusers(','Bearer\x20','odata-entityid','substring','lastIndexOf','outbound','GET','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','%2b','value','telephone1','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','enduserId','forEach','string','picklist','type','customField','indexOf','incident','assign','Subjects','Fields','phonecall','queue','/contacts(','callDirection','phonecalls','getString','Descriptions','ticketType','headers','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','emit','remoteUri','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!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','request-promise','util','md5','ioredis','../../../../config/logger','dynamics365','redis','defaults','localhost','socket.io-emitter','POST','clientId'];(function(_0x26edbd,_0x5ba29d){var _0x4178ad=function(_0x584b00){while(--_0x584b00){_0x26edbd['push'](_0x26edbd['shift']());}};_0x4178ad(++_0x5ba29d);}(_0x8bae,0x183));var _0xe8ba=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x8bae[_0x1b2ff7];return _0x31656a;};'use strict';var _=require(_0xe8ba('0x0'));var BPromise=require('bluebird');var rp=require(_0xe8ba('0x1'));var util=require(_0xe8ba('0x2'));var intUtil=require('./util');var md5=require(_0xe8ba('0x3'));var Redis=require(_0xe8ba('0x4'));var logger=require(_0xe8ba('0x5'))(_0xe8ba('0x6'));var config=require('../../../../config/environment');config[_0xe8ba('0x7')]=_[_0xe8ba('0x8')](config[_0xe8ba('0x7')],{'host':_0xe8ba('0x9'),'port':0x18eb});var io=require(_0xe8ba('0xa'))(new Redis(config[_0xe8ba('0x7')]));function getAuthToken(_0x152bf8,_0x132c97,_0x20396f){var _0x181278={'method':_0xe8ba('0xb'),'uri':_0x132c97,'form':{'client_id':_0x152bf8[_0xe8ba('0xc')],'resource':_0x152bf8['remoteUri'],'username':_0x152bf8['username'],'password':_0x152bf8[_0xe8ba('0xd')],'grant_type':_0xe8ba('0xd'),'client_secret':_0x152bf8['clientSecret']},'json':!![]};return rp(_0x181278)[_0xe8ba('0xe')](function(_0x42cc6d){return _0x42cc6d['access_token'];})['catch'](function(_0x44ad39){logger[_0xe8ba('0xf')]('['+[_0x20396f[_0xe8ba('0x10')]()]+_0xe8ba('0x11'));return _0x44ad39[_0xe8ba('0x12')];});}function getUser(_0x240182,_0x176df2,_0x52e780,_0x396c16,_0x204615,_0x3958af){return new BPromise(function(_0x176fd1,_0x26d13d){return getAuthToken(_0x176df2,_0x396c16,_0x3958af)['then'](function(_0x583e83){var _0x30681c={'method':'GET','uri':_0x204615+_0xe8ba('0x13'),'headers':{'Authorization':'Bearer\x20'+_0x583e83,'OData-Version':_0xe8ba('0x14')},'json':!![]};return rp(_0x30681c);})['then'](function(_0x49d66f){var _0x398942=_0x49d66f['value'];var _0x39c9ee=![];var _0x155306=null;if(!_['isNil'](_0x52e780)){if(intUtil[_0xe8ba('0x15')](_0x52e780['email'])){_0x240182[_0xe8ba('0x16')]=_0x52e780[_0xe8ba('0x17')];for(_0x155306=0x0;_0x155306<_0x398942[_0xe8ba('0x18')];_0x155306++){if(_0x398942[_0x155306][_0xe8ba('0x19')]===_0x52e780['email']&&!_0x398942[_0x155306]['isdisabled']){_0x39c9ee=!![];logger[_0xe8ba('0x1a')]('['+[_0x3958af[_0xe8ba('0x10')]()]+_0xe8ba('0x1b')+_0x398942[_0x155306][_0xe8ba('0x1c')]+'!');_0x240182[_0xe8ba('0x1d')]=_0x398942[_0x155306]['systemuserid'];}}}}if(!_0x39c9ee){logger[_0xe8ba('0x1a')]('['+[_0x3958af['toUpperCase']()]+_0xe8ba('0x1e'));_0x240182['userEmail']=_0x176df2[_0xe8ba('0x1f')];for(_0x155306=0x0;_0x155306<_0x398942[_0xe8ba('0x18')];_0x155306++){if(_0x398942[_0x155306]['internalemailaddress']===_0x176df2[_0xe8ba('0x1f')]){_0x240182[_0xe8ba('0x1d')]=_0x398942[_0x155306][_0xe8ba('0x1c')];}}}_0x176fd1(_0x240182);})[_0xe8ba('0x20')](function(_0x5099a2){_0x26d13d(_0x5099a2[_0xe8ba('0x12')]);});});}function createEndUser(_0x159974,_0x584c09,_0x23f099,_0x1c01e6,_0x2d33e0,_0x5cdf71){return new BPromise(function(_0x48aeef,_0x1123c3){return getAuthToken(_0x584c09,_0x23f099,_0x5cdf71)[_0xe8ba('0xe')](function(_0x287c17){var _0x243f4a=_0x5cdf71[_0xe8ba('0x21')]()==='outbound'?_0x2d33e0[_0xe8ba('0x22')]:_0x2d33e0[_0xe8ba('0x23')];var _0x443a35={'method':_0xe8ba('0xb'),'uri':_0x1c01e6+_0xe8ba('0x24'),'body':{'telephone1':_0x243f4a,'fullname':_0x243f4a,'firstname':_0x243f4a,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xe8ba('0x25')+_0x159974[_0xe8ba('0x1d')]+')'},'headers':{'Authorization':_0xe8ba('0x26')+_0x287c17,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x443a35);})[_0xe8ba('0xe')](function(_0x46583c){var _0x3859b4=_0x46583c['headers'][_0xe8ba('0x27')];var _0x1ff5a1=_0x3859b4[_0xe8ba('0x28')](_0x3859b4[_0xe8ba('0x29')]('(')+0x1,_0x3859b4[_0xe8ba('0x29')](')'));_0x159974['enduserId']=_0x1ff5a1;_0x48aeef(_0x159974);})[_0xe8ba('0x20')](function(_0x2f9414){_0x1123c3(_0x2f9414['message']);});});}function getEndUser(_0x45226d,_0x395811,_0x4fc704,_0x1aefe3,_0x3b226b,_0x52388e,_0x54b896){var _0x3f3b50=_0x52388e[_0xe8ba('0x21')]()===_0xe8ba('0x2a')?_0x3b226b[_0xe8ba('0x22')]:_0x3b226b['calleridnum'];return getAuthToken(_0x395811,_0x4fc704,_0x52388e)['then'](function(_0x42bab2){var _0x1a07d7={'method':_0xe8ba('0x2b'),'uri':_0x1aefe3+_0xe8ba('0x2c')+_0x3f3b50['replace']('+',_0xe8ba('0x2d'))+'\x27','headers':{'Authorization':_0xe8ba('0x26')+_0x42bab2,'If-None-Match':null,'OData-Version':_0xe8ba('0x14')},'json':!![]};return rp(_0x1a07d7);})[_0xe8ba('0xe')](function(_0x5b28f5){var _0x1401c7=![];if(!_0x5b28f5)return _0x1401c7;var _0x537b2a=_0x5b28f5[_0xe8ba('0x2e')];for(var _0x552feb=0x0;_0x552feb<_0x537b2a[_0xe8ba('0x18')];_0x552feb++){if(_0x537b2a[_0x552feb][_0xe8ba('0x2f')]===_0x3f3b50){_0x1401c7=!![];_0x45226d['enduserId']=_0x537b2a[_0x552feb][_0xe8ba('0x30')];}}return _0x1401c7;})[_0xe8ba('0xe')](function(_0x3b3889){if(_0x3b3889)return _0x45226d;if(_0x54b896===_0xe8ba('0x31')){logger[_0xe8ba('0x1a')]('['+[_0x52388e['toUpperCase']()]+_0xe8ba('0x32'));return _0x45226d;}return createEndUser(_0x45226d,_0x395811,_0x4fc704,_0x1aefe3,_0x3b226b,_0x52388e)['then'](function(_0x1bda5e){logger[_0xe8ba('0x1a')]('['+[_0x52388e[_0xe8ba('0x10')]()]+_0xe8ba('0x33'),_0x1bda5e[_0xe8ba('0x34')]);return _0x1bda5e;});});}function getCustomFields(_0x24af5a,_0x3cf51b,_0x5182f1){var _0x3aa3a7={};if(_0x24af5a[_0xe8ba('0x18')]>0x0){_[_0xe8ba('0x35')](_0x24af5a,function(_0xef5ed1){if(_['includes']([_0xe8ba('0x36'),_0xe8ba('0x37')],_0xef5ed1[_0xe8ba('0x38')])&&_0xef5ed1['nameField']&&!_0xef5ed1[_0xe8ba('0x39')]){var _0x43af2b=_0xef5ed1['idField'][_0xe8ba('0x21')]();var _0x319e5b=_0x43af2b[_0xe8ba('0x28')](0x0,_0x43af2b['indexOf']('_'));var _0x37d5f2=_0x43af2b['substring'](_0x43af2b[_0xe8ba('0x3a')]('_')+0x1);if(_0x319e5b===_0x5182f1){_0x3aa3a7[_0x37d5f2]=_0xef5ed1['content'];}}});}return _0x3aa3a7;}function getTicket(_0x4410a0,_0x15bbb8,_0x3a5033,_0x229197,_0x3ca6ab,_0x33d704,_0x1ef37a){return new BPromise(function(_0x30ad0f,_0x20bbc6){var _0x15d7e4;return getAuthToken(_0x15bbb8,_0x3a5033,_0x1ef37a)['then'](function(_0x4d644c){if(_0x33d704['ticketType']===_0xe8ba('0x3b')){_0x15d7e4={'method':_0xe8ba('0xb'),'uri':_0x229197+'incidents','body':Object[_0xe8ba('0x3c')]({},{'title':intUtil['getString'](_0x33d704[_0xe8ba('0x3d')],_0x3ca6ab,'\x20'),'description':intUtil['getString'](_0x33d704['Descriptions'],_0x3ca6ab,'\x0a'),'customerid_contact@odata.bind':_0x4410a0[_0xe8ba('0x34')]?'/contacts('+_0x4410a0[_0xe8ba('0x34')]+')':undefined,'ownerid@odata.bind':_0xe8ba('0x25')+_0x4410a0['userId']+')','caseorigincode':'1'},getCustomFields(_0x33d704[_0xe8ba('0x3e')],_0x3ca6ab,_0x33d704['ticketType'])),'headers':{'Authorization':_0xe8ba('0x26')+_0x4d644c,'OData-Version':_0xe8ba('0x14')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x33d704['ticketType']===_0xe8ba('0x3f')){var _0x1f4dd6=_0x4410a0[_0xe8ba('0x34')]?[{'partyid_systemuser@odata.bind':_0xe8ba('0x25')+_0x4410a0[_0xe8ba('0x1d')]+')','participationtypemask':_0x4410a0['callDirection']===_0xe8ba('0x40')?0x2:0x1},{'partyid_contact@odata.bind':_0xe8ba('0x41')+_0x4410a0[_0xe8ba('0x34')]+')','participationtypemask':_0x4410a0[_0xe8ba('0x42')]===_0xe8ba('0x40')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xe8ba('0x25')+_0x4410a0[_0xe8ba('0x1d')]+')','participationtypemask':_0x4410a0[_0xe8ba('0x42')]===_0xe8ba('0x40')?0x2:0x1}];_0x15d7e4={'method':_0xe8ba('0xb'),'uri':_0x229197+_0xe8ba('0x43'),'body':Object['assign']({},{'subject':intUtil[_0xe8ba('0x44')](_0x33d704['Subjects'],_0x3ca6ab,'\x20'),'phonenumber':String(_0x3ca6ab[_0xe8ba('0x23')]),'description':intUtil[_0xe8ba('0x44')](_0x33d704[_0xe8ba('0x45')],_0x3ca6ab,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4410a0[_0xe8ba('0x34')]?_0xe8ba('0x41')+_0x4410a0['enduserId']+')':undefined,'ownerid@odata.bind':_0xe8ba('0x25')+_0x4410a0[_0xe8ba('0x1d')]+')','directioncode':_0x4410a0[_0xe8ba('0x42')]==='queue'?![]:!![],'phonecall_activity_parties':_0x1f4dd6},getCustomFields(_0x33d704[_0xe8ba('0x3e')],_0x3ca6ab,_0x33d704[_0xe8ba('0x46')])),'headers':{'Authorization':_0xe8ba('0x26')+_0x4d644c,'OData-Version':_0xe8ba('0x14')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x15d7e4);})[_0xe8ba('0xe')](function(_0x205620){var _0x35dd5f=_0x205620[_0xe8ba('0x47')][_0xe8ba('0x27')];var _0x295894=_0x35dd5f[_0xe8ba('0x28')](_0x35dd5f[_0xe8ba('0x29')]('(')+0x1,_0x35dd5f[_0xe8ba('0x29')](')'));_0x4410a0[_0xe8ba('0x48')]=_0x295894;_0x30ad0f(_0x4410a0);})[_0xe8ba('0x20')](function(_0x381eff){_0x20bbc6(_0x381eff[_0xe8ba('0x12')]);});});}function emit(_0x303eac,_0x1eb23c,_0x8d0442,_0x199fc5){var _0x1787f1={'uri':util['format'](_0xe8ba('0x49'),_0x303eac,_0x8d0442,_0x199fc5)};io['to'](util[_0xe8ba('0x4a')](_0xe8ba('0x4b'),_0x1eb23c))[_0xe8ba('0x4c')]('trigger:browser:url',_0x1787f1);}exports['cs']=function(_0x3f61ff,_0x28faec,_0xd8cc66,_0x1d824b,_0x3e2e27,_0x13fdaa,_0x7cb595,_0x2a3bd2){var _0x4c8a7a={};_0x13fdaa['remoteUri']=intUtil['stripTrailingSlash'](_0x13fdaa[_0xe8ba('0x4d')]);_0x13fdaa[_0xe8ba('0x4e')]=intUtil['stripTrailingSlash'](_0x13fdaa[_0xe8ba('0x4e')]);_0x4c8a7a[_0xe8ba('0x42')]=_0x2a3bd2===_0xe8ba('0x40')||_0x2a3bd2===_0xe8ba('0x4f')?_0xe8ba('0x40'):_0xe8ba('0x2a');var _0x39a2bb=util[_0xe8ba('0x4a')](_0xe8ba('0x50'),_0x13fdaa[_0xe8ba('0x4d')]);var _0x7e0c8d=util[_0xe8ba('0x4a')](_0xe8ba('0x51'),_0x13fdaa['tenantId']);var _0x35052d=util['format'](_0xe8ba('0x52'),_0x13fdaa['serverUrl'],_0x28faec[_0xe8ba('0x53')],md5(_0x28faec[_0xe8ba('0x53')]));if(_0x3e2e27&&_0x3e2e27[_0xe8ba('0x54')]){logger[_0xe8ba('0x1a')](_0xe8ba('0x55'),_0xe8ba('0x56'));_0x28faec[_0xe8ba('0x57')]=_0x35052d;}else if(_0x7cb595&&_0x7cb595[_0xe8ba('0x58')]&&_0x7cb595[_0xe8ba('0x58')]!==_0xe8ba('0x59')){logger[_0xe8ba('0x1a')](_0xe8ba('0x5a'),_0xe8ba('0x56'));_0x28faec[_0xe8ba('0x57')]=_0x35052d;}else{_0x28faec[_0xe8ba('0x57')]='';}return getUser(_0x4c8a7a,_0x13fdaa,_0x1d824b,_0x7e0c8d,_0x39a2bb,_0x2a3bd2)[_0xe8ba('0xe')](function(_0x133274){logger[_0xe8ba('0x1a')]('['+_0x2a3bd2[_0xe8ba('0x10')]()+_0xe8ba('0x5b'),_0x133274[_0xe8ba('0x1d')]);logger[_0xe8ba('0x1a')]('['+_0x2a3bd2[_0xe8ba('0x10')]()+_0xe8ba('0x5c'),_0x133274[_0xe8ba('0x16')]);return getEndUser(_0x133274,_0x13fdaa,_0x7e0c8d,_0x39a2bb,_0x28faec,_0x2a3bd2,_0xd8cc66[_0xe8ba('0x5d')]);})[_0xe8ba('0xe')](function(_0x1cbb56){logger['info']('['+_0x2a3bd2[_0xe8ba('0x10')]()+_0xe8ba('0x5e'),_0x1cbb56[_0xe8ba('0x34')]);logger[_0xe8ba('0x1a')]('['+_0x2a3bd2[_0xe8ba('0x10')]()+_0xe8ba('0x5f'),_0x28faec[_0xe8ba('0x23')]);return getTicket(_0x1cbb56,_0x13fdaa,_0x7e0c8d,_0x39a2bb,_0x28faec,_0xd8cc66,_0x2a3bd2);})['then'](function(_0x3ea589){logger[_0xe8ba('0x1a')](util[_0xe8ba('0x4a')]('['+_0x2a3bd2[_0xe8ba('0x10')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0xd8cc66[_0xe8ba('0x46')],_0x3ea589[_0xe8ba('0x48')]));logger[_0xe8ba('0x1a')](util[_0xe8ba('0x4a')]('['+_0x2a3bd2['toUpperCase']()+']\x20Call\x20direction:\x20%s',_0x2a3bd2));if(_0x2a3bd2!==_0xe8ba('0x4f')){logger[_0xe8ba('0x1a')]('['+_0x2a3bd2[_0xe8ba('0x10')]()+']',_0xe8ba('0x60'));emit(_0x13fdaa[_0xe8ba('0x4d')],_0x1d824b[_0xe8ba('0x61')],_0xd8cc66[_0xe8ba('0x46')],_0x3ea589['ticketId']);}})['catch'](function(_0x1cd015){logger['error']('['+_0x2a3bd2[_0xe8ba('0x10')]()+_0xe8ba('0x62'),util[_0xe8ba('0x63')](_0x1cd015,{'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 52efaa7..550e569 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 _0x8103=['format','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','Descriptions','
','Tags','name','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','%s/api/v2/agents','length','Agent\x20found!','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','toString','base64','debug','[HTTP]','map','picklist','type','nameField','customField','content','string','idField','variableName','push','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','catch','error','stringify','outbound','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','monitor_format','lastevent','toUpperCase','request-promise','util','ioredis','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge'];(function(_0x36ae2f,_0x34195b){var _0x21bd8a=function(_0x324070){while(--_0x324070){_0x36ae2f['push'](_0x36ae2f['shift']());}};_0x21bd8a(++_0x34195b);}(_0x8103,0x103));var _0x3810=function(_0x2153c0,_0x380b6a){_0x2153c0=_0x2153c0-0x0;var _0x3e5311=_0x8103[_0x2153c0];return _0x3e5311;};'use strict';var _=require('lodash');var rp=require(_0x3810('0x0'));var md5=require('md5');var util=require(_0x3810('0x1'));var Redis=require(_0x3810('0x2'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x3810('0x3'))(_0x3810('0x4'));config[_0x3810('0x5')]=_[_0x3810('0x6')](config[_0x3810('0x5')],{'host':_0x3810('0x7'),'port':0x18eb});var io=require(_0x3810('0x8'))(new Redis(config[_0x3810('0x5')]));var headers={'Content-Type':_0x3810('0x9'),'Accept':_0x3810('0x9')};function emit(_0x1e9699,_0x5e4a8e,_0x1bca35){io['to'](_0x1e9699)[_0x3810('0xa')](_0x5e4a8e,_0x1bca35);}function getTicket(_0x37ac80,_0x4ddc72,_0x209fd0,_0x1bee4b,_0x4b5326){logger[_0x3810('0xb')](_0x3810('0xc'));var _0x43a578=_[_0x3810('0xd')]({'responder_id':_0x4ddc72['id'],'requester_id':_0x209fd0['id'],'name':util[_0x3810('0xe')](_0x3810('0xf'),_0x4b5326[_0x3810('0x10')]),'phone':_0x4b5326[_0x3810('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x1bee4b[_0x3810('0x12')],_0x4b5326,'\x20'),'description':intUtil['getString'](_0x1bee4b[_0x3810('0x13')],_0x4b5326,_0x3810('0x14')),'tags':getTags(_0x1bee4b[_0x3810('0x15')],_0x3810('0x16'))},getCustomFields(_0x1bee4b['Fields'],_0x4b5326));_0x43a578[_0x3810('0x17')]=_[_0x3810('0x18')](_[_0x3810('0x19')](_0x43a578[_0x3810('0x17')],'id'),_0x3810('0x1a'));return request({'uri':util['format'](_0x3810('0x1b'),_0x37ac80[_0x3810('0x1c')]),'method':_0x3810('0x1d'),'body':_0x43a578})[_0x3810('0x1e')](function(_0x4b08a9){logger[_0x3810('0xb')](_0x3810('0x1f'));return _0x4b08a9;});}function getUser(_0x2faaca,_0x1c02e6){if(intUtil['validateEmail'](_0x1c02e6)){return request({'uri':util['format'](_0x3810('0x20'),_0x2faaca[_0x3810('0x1c')]),'qs':{'email':_0x1c02e6}})['then'](function(_0x53e18a){if(_0x53e18a[_0x3810('0x21')]){logger[_0x3810('0xb')](_0x3810('0x22'));return _['find'](_0x53e18a,function(_0x2e5ed0){return _0x2e5ed0[_0x3810('0x23')][_0x3810('0x24')]===_0x1c02e6;});}else{logger[_0x3810('0xb')](_0x3810('0x25'));return request({'uri':util[_0x3810('0xe')](_0x3810('0x26'),_0x2faaca[_0x3810('0x1c')])})['then'](function(_0x392b79){logger[_0x3810('0xb')]('Admin\x20account\x20selected.');return _0x392b79;});}});}else{logger['info'](_0x3810('0x27'));return request({'uri':util['format'](_0x3810('0x26'),_0x2faaca[_0x3810('0x1c')])})['then'](function(_0x5a705f){logger[_0x3810('0xb')](_0x3810('0x28'));return _0x5a705f;});}}function getEndUser(_0x337124,_0x635470,_0x3da09e){logger['info'](_0x3810('0x29'),_0x3da09e);return request({'uri':util[_0x3810('0xe')](_0x3810('0x2a'),_0x337124[_0x3810('0x1c')]),'qs':{'phone':_0x3da09e}})['then'](function(_0x49b440){if(_0x49b440[_0x3810('0x21')]){logger['info'](_0x3810('0x2b'));return _[_0x3810('0x2c')](_0x49b440,{'phone':_0x3da09e});}else{logger[_0x3810('0xb')](_0x3810('0x2d'));return request({'uri':util[_0x3810('0xe')]('%s/api/v2/contacts',_0x337124[_0x3810('0x1c')]),'method':_0x3810('0x1d'),'body':{'name':_0x635470,'phone':_0x3da09e}})[_0x3810('0x1e')](function(_0x4ff74f){logger[_0x3810('0xb')](_0x3810('0x2e'));return _0x4ff74f;});}});}function getAuth(_0x362fd4){return util[_0x3810('0xe')](_0x3810('0x2f'),new Buffer(_0x362fd4['apiKey']+':X')[_0x3810('0x30')](_0x3810('0x31')));}function request(_0xc4d884){logger[_0x3810('0x32')](_0x3810('0x33'),JSON['stringify'](_0xc4d884));return rp(_[_0x3810('0x6')](_0xc4d884,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x440096,_0x28389e){var _0x4c1b5b=[];if(_0x440096&&_0x440096['length']>0x0){_0x4c1b5b=_[_0x3810('0x34')](_0x440096,_0x28389e);}return _0x4c1b5b;}function getCustomFields(_0x4a50ae,_0x5c5eee){var _0x4c3589=[];var _0x4617f8={'custom_fields':[]};if(_0x4a50ae[_0x3810('0x21')]>0x0){_['forEach'](_0x4a50ae,function(_0x176af1){if(_['includes'](['string',_0x3810('0x35')],_0x176af1[_0x3810('0x36')])&&_0x176af1[_0x3810('0x37')]&&!_0x176af1[_0x3810('0x38')]){_0x4617f8[_0x176af1[_0x3810('0x37')]['toLowerCase']()]=_0x176af1[_0x3810('0x39')][_0x3810('0x30')]();}else if(_['includes']([_0x3810('0x3a'),_0x3810('0x35')],_0x176af1['type'])&&_0x176af1[_0x3810('0x3b')]&&_0x176af1['customField']){_0x4617f8[_0x3810('0x17')]['push']({'id':_0x176af1[_0x3810('0x3b')],'value':_0x176af1['content'][_0x3810('0x30')]()});}else if(_0x176af1[_0x3810('0x36')]==='variable'&&_0x176af1[_0x3810('0x3c')]&&_0x176af1[_0x3810('0x3b')]&&_0x176af1[_0x3810('0x38')]){_0x5c5eee[_0x176af1[_0x3810('0x3c')]]&&_0x4617f8['custom_fields'][_0x3810('0x3d')]({'id':_0x176af1[_0x3810('0x3b')],'value':_0x5c5eee[_0x176af1['variableName']][_0x3810('0x30')]()});}else if(_0x176af1['type']==='customVariable'&&_0x176af1['Variable']&&_0x176af1[_0x3810('0x3e')][_0x3810('0x16')]&&_0x176af1[_0x3810('0x3b')]&&_0x176af1[_0x3810('0x38')]){_0x5c5eee[_0x176af1[_0x3810('0x3e')]['name'][_0x3810('0x3f')]()]&&_0x4617f8['custom_fields']['push']({'id':_0x176af1[_0x3810('0x3b')],'value':_0x5c5eee[_0x176af1[_0x3810('0x3e')]['name'][_0x3810('0x3f')]()][_0x3810('0x30')]()});}});}return _0x4617f8;}exports[_0x3810('0x40')]=function(_0x532615,_0x5676f4,_0x2cd15b,_0xf30a65,_0x386a38,_0x14f1ce){var _0x209d77,_0x642a4a;_0x14f1ce[_0x3810('0x1c')]=intUtil[_0x3810('0x41')](_0x14f1ce[_0x3810('0x1c')]);_0x14f1ce[_0x3810('0x42')]=intUtil['stripTrailingSlash'](_0x14f1ce[_0x3810('0x42')]);if(_0x386a38&&_0x386a38['monitor_format']){logger[_0x3810('0xb')](_0x3810('0x43'),_0x3810('0x44'));_0x5676f4[_0x3810('0x45')]=util[_0x3810('0xe')](_0x3810('0x46'),_0x14f1ce[_0x3810('0x42')],_0x5676f4[_0x3810('0x47')],md5(_0x5676f4[_0x3810('0x47')]));}else{_0x5676f4[_0x3810('0x45')]='';}headers[_0x3810('0x48')]=getAuth(_0x14f1ce);return getUser(_0x14f1ce,_0xf30a65[_0x3810('0x24')])[_0x3810('0x1e')](function(_0x5a97e4){_0x209d77=_0x5a97e4;logger[_0x3810('0xb')]('The\x20User\x20ID\x20is:',_0x209d77['id']);return getEndUser(_0x14f1ce,_0x5676f4['calleridname'],_0x5676f4[_0x3810('0x11')]);})['then'](function(_0x38c053){_0x642a4a=_0x38c053;logger[_0x3810('0xb')](_0x3810('0x49'),_0x642a4a['id']);return getTicket(_0x14f1ce,_0x209d77,_0x642a4a,_0x2cd15b,_0x5676f4);})['then'](function(_0x4b1d8b){if(_0x4b1d8b&&_0x4b1d8b['id']){logger[_0x3810('0xb')](_0x3810('0x1f'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x4b1d8b['id']);logger[_0x3810('0xb')]('[QUEUE]',_0x3810('0x4a'));emit(util['format']('user:%s',_0xf30a65[_0x3810('0x16')]),'trigger:browser:url',{'uri':util[_0x3810('0xe')](_0x3810('0x4b'),_0x14f1ce['remoteUri'],_0x4b1d8b['id'])});}})[_0x3810('0x4c')](function(_0x3534fa){logger[_0x3810('0x4d')](_0x3810('0x43'),JSON[_0x3810('0x4e')](_0x3534fa));});};exports[_0x3810('0x4f')]=function(_0x4c7ca2,_0x3e5ccf,_0xdf5c6f,_0x5f0232,_0x3d351e,_0x1aeb05,_0xb27a40){var _0x1f05a1,_0x386c28;_0x1aeb05[_0x3810('0x1c')]=intUtil[_0x3810('0x41')](_0x1aeb05['remoteUri']);_0x1aeb05['serverUrl']=intUtil['stripTrailingSlash'](_0x1aeb05['serverUrl']);if(_0xb27a40&&_0xb27a40['recordingFormat']&&_0xb27a40['recordingFormat']!==_0x3810('0x50')){logger[_0x3810('0xb')](_0x3810('0x51'),'Recording\x20is\x20enabled!');_0x3e5ccf[_0x3810('0x45')]=util[_0x3810('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1aeb05[_0x3810('0x42')],_0x3e5ccf[_0x3810('0x47')],md5(_0x3e5ccf[_0x3810('0x47')]));}headers['Authorization']=getAuth(_0x1aeb05);return getUser(_0x1aeb05,_0x5f0232[_0x3810('0x24')])[_0x3810('0x1e')](function(_0x158b88){_0x1f05a1=_0x158b88;logger[_0x3810('0xb')](_0x3810('0x52'),_0x1f05a1['id']);return getEndUser(_0x1aeb05,_0x3e5ccf[_0x3810('0x53')],_0x3e5ccf[_0x3810('0x54')]);})[_0x3810('0x1e')](function(_0x20c443){_0x386c28=_0x20c443;logger[_0x3810('0xb')](_0x3810('0x49'),_0x386c28['id']);return getTicket(_0x1aeb05,_0x1f05a1,_0x386c28,_0xdf5c6f,_0x3e5ccf);})['then'](function(_0x399bea){if(_0x399bea&&_0x399bea['id']){logger[_0x3810('0xb')](_0x3810('0x1f'));logger[_0x3810('0xb')](_0x3810('0x55'),_0x399bea['id']);logger['info'](_0x3810('0x51'),_0x3810('0x4a'));emit(util[_0x3810('0xe')](_0x3810('0x56'),_0x5f0232[_0x3810('0x16')]),'trigger:browser:url',{'uri':util['format']('%s/helpdesk/tickets/%d',_0x1aeb05[_0x3810('0x1c')],_0x399bea['id'])});}})[_0x3810('0x4c')](function(_0x727262){logger[_0x3810('0x4d')](_0x3810('0x51'),JSON['stringify'](_0x727262));});};exports[_0x3810('0x57')]=function(_0x335cc2,_0x5f548e,_0x25113e,_0x401d8f,_0x1537db,_0x596082){var _0x3d3724,_0x349a3e;_0x596082[_0x3810('0x1c')]=intUtil[_0x3810('0x41')](_0x596082[_0x3810('0x1c')]);_0x596082[_0x3810('0x42')]=intUtil[_0x3810('0x41')](_0x596082[_0x3810('0x42')]);if(_0x1537db&&_0x1537db[_0x3810('0x58')]){logger[_0x3810('0xb')]('['+_0x5f548e[_0x3810('0x59')][_0x3810('0x5a')]()+']','Recording\x20is\x20enabled!');_0x5f548e[_0x3810('0x45')]=util[_0x3810('0xe')](_0x3810('0x46'),_0x596082[_0x3810('0x42')],_0x5f548e[_0x3810('0x47')],md5(_0x5f548e[_0x3810('0x47')]));}else{_0x5f548e['recordingURL']='';}headers[_0x3810('0x48')]=getAuth(_0x596082);return getUser(_0x596082,'')[_0x3810('0x1e')](function(_0x515cf2){_0x3d3724=_0x515cf2;logger[_0x3810('0xb')](_0x3810('0x52'),_0x3d3724['id']);return getEndUser(_0x596082,_0x5f548e[_0x3810('0x10')],_0x5f548e[_0x3810('0x11')]);})[_0x3810('0x1e')](function(_0x3d8cbb){_0x349a3e=_0x3d8cbb;logger[_0x3810('0xb')](_0x3810('0x49'),_0x349a3e['id']);return getTicket(_0x596082,_0x3d3724,_0x349a3e,_0x25113e,_0x5f548e);})[_0x3810('0x1e')](function(_0x19284c){if(_0x19284c){logger[_0x3810('0xb')](_0x3810('0x1f'));logger[_0x3810('0xb')]('The\x20Ticket\x20ID\x20is:',_0x19284c['id']);}})[_0x3810('0x4c')](function(_0x27c67c){logger['error']('['+_0x5f548e['lastevent'][_0x3810('0x5a')]()+']',JSON['stringify'](_0x27c67c));});}; \ No newline at end of file +var _0x6f1d=['base64','debug','[HTTP]','GET','map','string','nameField','customField','toLowerCase','toString','includes','picklist','idField','content','type','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','Ticket\x20created!','stringify','unmanaged','lastevent','request-promise','util','./util','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridnum','Subjects','getString','Descriptions','
','Tags','Fields','mapValues','keyBy','custom_fields','%s/api/v2/tickets','remoteUri','then','validateEmail','length','info','Agent\x20found!','find','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','POST','Enduser\x20created.'];(function(_0x30602c,_0x535f19){var _0x175213=function(_0x2ab3f1){while(--_0x2ab3f1){_0x30602c['push'](_0x30602c['shift']());}};_0x175213(++_0x535f19);}(_0x6f1d,0x89));var _0xd6f1=function(_0x153644,_0x3a3a11){_0x153644=_0x153644-0x0;var _0x139aa4=_0x6f1d[_0x153644];return _0x139aa4;};'use strict';var _=require('lodash');var rp=require(_0xd6f1('0x0'));var md5=require('md5');var util=require(_0xd6f1('0x1'));var Redis=require('ioredis');var intUtil=require(_0xd6f1('0x2'));var config=require(_0xd6f1('0x3'));var logger=require(_0xd6f1('0x4'))('freshdesk');config[_0xd6f1('0x5')]=_[_0xd6f1('0x6')](config[_0xd6f1('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xd6f1('0x7'))(new Redis(config[_0xd6f1('0x5')]));var headers={'Content-Type':_0xd6f1('0x8'),'Accept':'application/json'};function emit(_0x32aedb,_0x4a873d,_0x39d54e){io['to'](_0x32aedb)[_0xd6f1('0x9')](_0x4a873d,_0x39d54e);}function getTicket(_0x46c8ce,_0x5d73a3,_0x1b75c3,_0x2a3423,_0x70940e){logger['info'](_0xd6f1('0xa'));var _0x3e6647=_[_0xd6f1('0xb')]({'responder_id':_0x5d73a3['id'],'requester_id':_0x1b75c3['id'],'name':util[_0xd6f1('0xc')](_0xd6f1('0xd'),_0x70940e['calleridname']),'phone':_0x70940e[_0xd6f1('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x2a3423[_0xd6f1('0xf')],_0x70940e,'\x20'),'description':intUtil[_0xd6f1('0x10')](_0x2a3423[_0xd6f1('0x11')],_0x70940e,_0xd6f1('0x12')),'tags':getTags(_0x2a3423[_0xd6f1('0x13')],'name')},getCustomFields(_0x2a3423[_0xd6f1('0x14')],_0x70940e));_0x3e6647['custom_fields']=_[_0xd6f1('0x15')](_[_0xd6f1('0x16')](_0x3e6647[_0xd6f1('0x17')],'id'),'value');return request({'uri':util['format'](_0xd6f1('0x18'),_0x46c8ce[_0xd6f1('0x19')]),'method':'POST','body':_0x3e6647})[_0xd6f1('0x1a')](function(_0x2aa927){logger['info']('Ticket\x20created!');return _0x2aa927;});}function getUser(_0x2d9be5,_0x537556){if(intUtil[_0xd6f1('0x1b')](_0x537556)){return request({'uri':util[_0xd6f1('0xc')]('%s/api/v2/agents',_0x2d9be5['remoteUri']),'qs':{'email':_0x537556}})[_0xd6f1('0x1a')](function(_0x3cfb88){if(_0x3cfb88[_0xd6f1('0x1c')]){logger[_0xd6f1('0x1d')](_0xd6f1('0x1e'));return _[_0xd6f1('0x1f')](_0x3cfb88,function(_0x3af173){return _0x3af173['contact']['email']===_0x537556;});}else{logger[_0xd6f1('0x1d')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xd6f1('0x20'),_0x2d9be5['remoteUri'])})[_0xd6f1('0x1a')](function(_0x5e2727){logger[_0xd6f1('0x1d')](_0xd6f1('0x21'));return _0x5e2727;});}});}else{logger[_0xd6f1('0x1d')](_0xd6f1('0x22'));return request({'uri':util['format'](_0xd6f1('0x20'),_0x2d9be5[_0xd6f1('0x19')])})[_0xd6f1('0x1a')](function(_0x13ecb1){logger[_0xd6f1('0x1d')]('Admin\x20account\x20selected.');return _0x13ecb1;});}}function getEndUser(_0x244133,_0x30cc44,_0x109205){logger[_0xd6f1('0x1d')](_0xd6f1('0x23'),_0x109205);return request({'uri':util[_0xd6f1('0xc')](_0xd6f1('0x24'),_0x244133[_0xd6f1('0x19')]),'qs':{'phone':_0x109205}})[_0xd6f1('0x1a')](function(_0x5499e5){if(_0x5499e5[_0xd6f1('0x1c')]){logger[_0xd6f1('0x1d')]('Enduser\x20found!');return _[_0xd6f1('0x1f')](_0x5499e5,{'phone':_0x109205});}else{logger[_0xd6f1('0x1d')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xd6f1('0xc')](_0xd6f1('0x24'),_0x244133['remoteUri']),'method':_0xd6f1('0x25'),'body':{'name':_0x30cc44,'phone':_0x109205}})[_0xd6f1('0x1a')](function(_0x4caac8){logger[_0xd6f1('0x1d')](_0xd6f1('0x26'));return _0x4caac8;});}});}function getAuth(_0xfda51e){return util[_0xd6f1('0xc')]('Basic\x20%s',new Buffer(_0xfda51e['apiKey']+':X')['toString'](_0xd6f1('0x27')));}function request(_0x468b24){logger[_0xd6f1('0x28')](_0xd6f1('0x29'),JSON['stringify'](_0x468b24));return rp(_[_0xd6f1('0x6')](_0x468b24,{'method':_0xd6f1('0x2a'),'headers':headers,'json':!![]}));}function getTags(_0x15775,_0x5374fa){var _0x4a787f=[];if(_0x15775&&_0x15775[_0xd6f1('0x1c')]>0x0){_0x4a787f=_[_0xd6f1('0x2b')](_0x15775,_0x5374fa);}return _0x4a787f;}function getCustomFields(_0x6dc53a,_0x1689e5){var _0x3927df=[];var _0x5df8c6={'custom_fields':[]};if(_0x6dc53a['length']>0x0){_['forEach'](_0x6dc53a,function(_0x5321c7){if(_['includes']([_0xd6f1('0x2c'),'picklist'],_0x5321c7['type'])&&_0x5321c7[_0xd6f1('0x2d')]&&!_0x5321c7[_0xd6f1('0x2e')]){_0x5df8c6[_0x5321c7[_0xd6f1('0x2d')][_0xd6f1('0x2f')]()]=_0x5321c7['content'][_0xd6f1('0x30')]();}else if(_[_0xd6f1('0x31')]([_0xd6f1('0x2c'),_0xd6f1('0x32')],_0x5321c7['type'])&&_0x5321c7[_0xd6f1('0x33')]&&_0x5321c7[_0xd6f1('0x2e')]){_0x5df8c6[_0xd6f1('0x17')]['push']({'id':_0x5321c7[_0xd6f1('0x33')],'value':_0x5321c7[_0xd6f1('0x34')][_0xd6f1('0x30')]()});}else if(_0x5321c7[_0xd6f1('0x35')]==='variable'&&_0x5321c7['variableName']&&_0x5321c7[_0xd6f1('0x33')]&&_0x5321c7[_0xd6f1('0x2e')]){_0x1689e5[_0x5321c7[_0xd6f1('0x36')]]&&_0x5df8c6[_0xd6f1('0x17')]['push']({'id':_0x5321c7['idField'],'value':_0x1689e5[_0x5321c7[_0xd6f1('0x36')]]['toString']()});}else if(_0x5321c7['type']===_0xd6f1('0x37')&&_0x5321c7['Variable']&&_0x5321c7[_0xd6f1('0x38')][_0xd6f1('0x39')]&&_0x5321c7[_0xd6f1('0x33')]&&_0x5321c7[_0xd6f1('0x2e')]){_0x1689e5[_0x5321c7[_0xd6f1('0x38')][_0xd6f1('0x39')]['toLowerCase']()]&&_0x5df8c6['custom_fields']['push']({'id':_0x5321c7[_0xd6f1('0x33')],'value':_0x1689e5[_0x5321c7[_0xd6f1('0x38')][_0xd6f1('0x39')][_0xd6f1('0x2f')]()][_0xd6f1('0x30')]()});}});}return _0x5df8c6;}exports[_0xd6f1('0x3a')]=function(_0x3d4531,_0x14f9e1,_0x2da4d2,_0x5cd417,_0x1c05eb,_0x31f1b1){var _0x48ad9c,_0x562e1f;_0x31f1b1['remoteUri']=intUtil[_0xd6f1('0x3b')](_0x31f1b1[_0xd6f1('0x19')]);_0x31f1b1[_0xd6f1('0x3c')]=intUtil[_0xd6f1('0x3b')](_0x31f1b1[_0xd6f1('0x3c')]);if(_0x1c05eb&&_0x1c05eb[_0xd6f1('0x3d')]){logger['info'](_0xd6f1('0x3e'),'Recording\x20is\x20enabled!');_0x14f9e1['recordingURL']=util[_0xd6f1('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x31f1b1[_0xd6f1('0x3c')],_0x14f9e1[_0xd6f1('0x3f')],md5(_0x14f9e1[_0xd6f1('0x3f')]));}else{_0x14f9e1[_0xd6f1('0x40')]='';}headers[_0xd6f1('0x41')]=getAuth(_0x31f1b1);return getUser(_0x31f1b1,_0x5cd417[_0xd6f1('0x42')])[_0xd6f1('0x1a')](function(_0x2cf41f){_0x48ad9c=_0x2cf41f;logger[_0xd6f1('0x1d')](_0xd6f1('0x43'),_0x48ad9c['id']);return getEndUser(_0x31f1b1,_0x14f9e1[_0xd6f1('0x44')],_0x14f9e1[_0xd6f1('0xe')]);})[_0xd6f1('0x1a')](function(_0x14f953){_0x562e1f=_0x14f953;logger[_0xd6f1('0x1d')](_0xd6f1('0x45'),_0x562e1f['id']);return getTicket(_0x31f1b1,_0x48ad9c,_0x562e1f,_0x2da4d2,_0x14f9e1);})[_0xd6f1('0x1a')](function(_0x31fe49){if(_0x31fe49&&_0x31fe49['id']){logger[_0xd6f1('0x1d')]('Ticket\x20created!');logger['info'](_0xd6f1('0x46'),_0x31fe49['id']);logger[_0xd6f1('0x1d')](_0xd6f1('0x3e'),_0xd6f1('0x47'));emit(util[_0xd6f1('0xc')](_0xd6f1('0x48'),_0x5cd417[_0xd6f1('0x39')]),_0xd6f1('0x49'),{'uri':util[_0xd6f1('0xc')](_0xd6f1('0x4a'),_0x31f1b1[_0xd6f1('0x19')],_0x31fe49['id'])});}})[_0xd6f1('0x4b')](function(_0x393da3){logger[_0xd6f1('0x4c')](_0xd6f1('0x3e'),JSON['stringify'](_0x393da3));});};exports[_0xd6f1('0x4d')]=function(_0x424751,_0x319d41,_0x56779c,_0x48cb72,_0x978de6,_0x1efcaa,_0x198aaf){var _0x2895bf,_0x5c1903;_0x1efcaa[_0xd6f1('0x19')]=intUtil[_0xd6f1('0x3b')](_0x1efcaa[_0xd6f1('0x19')]);_0x1efcaa['serverUrl']=intUtil[_0xd6f1('0x3b')](_0x1efcaa['serverUrl']);if(_0x198aaf&&_0x198aaf[_0xd6f1('0x4e')]&&_0x198aaf[_0xd6f1('0x4e')]!==_0xd6f1('0x4f')){logger[_0xd6f1('0x1d')](_0xd6f1('0x50'),_0xd6f1('0x51'));_0x319d41['recordingURL']=util['format'](_0xd6f1('0x52'),_0x1efcaa[_0xd6f1('0x3c')],_0x319d41[_0xd6f1('0x3f')],md5(_0x319d41[_0xd6f1('0x3f')]));}headers[_0xd6f1('0x41')]=getAuth(_0x1efcaa);return getUser(_0x1efcaa,_0x48cb72[_0xd6f1('0x42')])['then'](function(_0x2f4059){_0x2895bf=_0x2f4059;logger[_0xd6f1('0x1d')](_0xd6f1('0x43'),_0x2895bf['id']);return getEndUser(_0x1efcaa,_0x319d41['destcalleridname'],_0x319d41[_0xd6f1('0x53')]);})[_0xd6f1('0x1a')](function(_0x255ad8){_0x5c1903=_0x255ad8;logger['info'](_0xd6f1('0x45'),_0x5c1903['id']);return getTicket(_0x1efcaa,_0x2895bf,_0x5c1903,_0x56779c,_0x319d41);})[_0xd6f1('0x1a')](function(_0x8fad25){if(_0x8fad25&&_0x8fad25['id']){logger[_0xd6f1('0x1d')](_0xd6f1('0x54'));logger['info'](_0xd6f1('0x46'),_0x8fad25['id']);logger['info'](_0xd6f1('0x50'),_0xd6f1('0x47'));emit(util['format']('user:%s',_0x48cb72[_0xd6f1('0x39')]),_0xd6f1('0x49'),{'uri':util[_0xd6f1('0xc')](_0xd6f1('0x4a'),_0x1efcaa['remoteUri'],_0x8fad25['id'])});}})['catch'](function(_0x39f553){logger[_0xd6f1('0x4c')](_0xd6f1('0x50'),JSON[_0xd6f1('0x55')](_0x39f553));});};exports[_0xd6f1('0x56')]=function(_0x5ca5fe,_0x3dc894,_0x45e9d6,_0x5d0807,_0x29d158,_0x4ab816){var _0x585940,_0x292641;_0x4ab816[_0xd6f1('0x19')]=intUtil[_0xd6f1('0x3b')](_0x4ab816[_0xd6f1('0x19')]);_0x4ab816[_0xd6f1('0x3c')]=intUtil[_0xd6f1('0x3b')](_0x4ab816[_0xd6f1('0x3c')]);if(_0x29d158&&_0x29d158['monitor_format']){logger['info']('['+_0x3dc894[_0xd6f1('0x57')]['toUpperCase']()+']',_0xd6f1('0x51'));_0x3dc894[_0xd6f1('0x40')]=util[_0xd6f1('0xc')](_0xd6f1('0x52'),_0x4ab816[_0xd6f1('0x3c')],_0x3dc894['uniqueid'],md5(_0x3dc894[_0xd6f1('0x3f')]));}else{_0x3dc894[_0xd6f1('0x40')]='';}headers[_0xd6f1('0x41')]=getAuth(_0x4ab816);return getUser(_0x4ab816,'')[_0xd6f1('0x1a')](function(_0x300279){_0x585940=_0x300279;logger[_0xd6f1('0x1d')](_0xd6f1('0x43'),_0x585940['id']);return getEndUser(_0x4ab816,_0x3dc894['calleridname'],_0x3dc894[_0xd6f1('0xe')]);})[_0xd6f1('0x1a')](function(_0xe7e2a6){_0x292641=_0xe7e2a6;logger[_0xd6f1('0x1d')](_0xd6f1('0x45'),_0x292641['id']);return getTicket(_0x4ab816,_0x585940,_0x292641,_0x45e9d6,_0x3dc894);})[_0xd6f1('0x1a')](function(_0x2e3606){if(_0x2e3606){logger['info'](_0xd6f1('0x54'));logger[_0xd6f1('0x1d')](_0xd6f1('0x46'),_0x2e3606['id']);}})['catch'](function(_0x3d397c){logger[_0xd6f1('0x4c')]('['+_0x3dc894[_0xd6f1('0x57')]['toUpperCase']()+']',JSON[_0xd6f1('0x55')](_0x3d397c));});}; \ 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 f39e9cb..f343aa5 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 _0x1678=['/api/tasks','getString','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','ticketId','Task\x20created:','/contacts/','user:%s','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','toLowerCase','destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','lodash','request-promise','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','users','length','email','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','info','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','adminEmail','/api/lookup?q=','&f=','&entities=contact','then','contacts','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','POST'];(function(_0xcfeff4,_0x3f2e19){var _0xb2fadc=function(_0x4cd013){while(--_0x4cd013){_0xcfeff4['push'](_0xcfeff4['shift']());}};_0xb2fadc(++_0x3f2e19);}(_0x1678,0x71));var _0x8167=function(_0x5ad034,_0x4bbc75){_0x5ad034=_0x5ad034-0x0;var _0x11bf21=_0x1678[_0x5ad034];return _0x11bf21;};'use strict';var _=require(_0x8167('0x0'));var rp=require(_0x8167('0x1'));var md5=require('md5');var util=require('util');var moment=require(_0x8167('0x2'));var Promise=require(_0x8167('0x3'));var Redis=require(_0x8167('0x4'));var intUtil=require(_0x8167('0x5'));var config=require(_0x8167('0x6'));var logger=require(_0x8167('0x7'))(_0x8167('0x8'));config[_0x8167('0x9')]=_[_0x8167('0xa')](config[_0x8167('0x9')],{'host':_0x8167('0xb'),'port':0x18eb});var io=require(_0x8167('0xc'))(new Redis(config[_0x8167('0x9')]));function getAdminId(_0x24e214,_0x12dd5f,_0x4c2c29,_0x25799a){return new Promise(function(_0x8f466d,_0x366de9){var _0x114592=![];var _0x270b21={'method':_0x8167('0xd'),'uri':_0x25799a+_0x8167('0xe'),'json':!![]};_0x270b21[_0x8167('0xf')]=_0x4c2c29;logger['info']('Getting\x20admin\x20information');return rp(_0x270b21)['then'](function(_0x2c6651){if(_0x2c6651){var _0x50e0a2=_0x2c6651[_0x8167('0x10')];var _0x3c9221=null;for(_0x3c9221=0x0;_0x3c9221<_0x50e0a2[_0x8167('0x11')];_0x3c9221++){if(_0x50e0a2[_0x3c9221][_0x8167('0x12')]===_0x24e214['adminEmail']){_0x24e214['adminId']=_0x50e0a2[_0x3c9221]['id'];_0x114592=!![];}}if(_0x114592){logger['info']('Admin\x20found:',_0x24e214[_0x8167('0x13')]);_0x8f466d(_0x24e214);}else{_0x366de9({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x366de9({'statusCode':0x194,'message':_0x8167('0x14')});}})[_0x8167('0x15')](function(_0x448a17){logger[_0x8167('0x16')]('['+[_0x12dd5f[_0x8167('0x17')]()]+']',_0x448a17[_0x8167('0x18')]);_0x366de9(_0x448a17);});});}function getUser(_0x280b72,_0x22073d,_0x55f325){return function(_0x2b5c58){return new Promise(function(_0x25786d,_0xfad9cf){var _0x251d57={'method':_0x8167('0xd'),'uri':_0x55f325+_0x8167('0xe'),'json':!![]};_0x251d57[_0x8167('0xf')]=_0x22073d;logger[_0x8167('0x19')](_0x8167('0x1a'));return rp(_0x251d57)['then'](function(_0x8cc02a){if(_0x8cc02a){var _0xf180d3=_0x8cc02a[_0x8167('0x10')];var _0x315390=![];var _0x5e56ec=null;if(_0x2b5c58['agentEmail']!==null){logger[_0x8167('0x19')](_0x8167('0x1b'),_0x2b5c58[_0x8167('0x1c')]);_0x2b5c58[_0x8167('0x1d')]=_0x2b5c58[_0x8167('0x1c')];for(_0x5e56ec=0x0;_0x5e56ec<_0xf180d3['length'];_0x5e56ec++){if(_0xf180d3[_0x5e56ec]['email']===_0x2b5c58[_0x8167('0x1c')]){_0x315390=!![];_0x2b5c58[_0x8167('0x1e')]=_0xf180d3[_0x5e56ec]['id'];logger[_0x8167('0x19')](_0x8167('0x1f'),_0x2b5c58[_0x8167('0x1e')]);}}}if(!_0x315390){logger['info'](_0x8167('0x20'));_0x2b5c58[_0x8167('0x1d')]=_0x2b5c58[_0x8167('0x21')];_0x2b5c58['userId']=_0x2b5c58[_0x8167('0x13')];_0x315390=!![];}if(_0x315390){_0x25786d(_0x2b5c58);}else{_0xfad9cf({'statusCode':0x194,'message':_0x8167('0x14')});}}else{_0xfad9cf({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x1308d5){logger[_0x8167('0x16')]('['+[_0x280b72[_0x8167('0x17')]()]+']',_0x1308d5[_0x8167('0x18')]);_0xfad9cf(_0x1308d5);});});};}function searchContact(_0x2d34e1,_0x33f651,_0x2750d5,_0x2e6138){return new Promise(function(_0x29bc99,_0x17baee){var _0x4ab3d1={'method':'GET','headers':_0x33f651,'uri':_0x2d34e1+_0x8167('0x22')+_0x2e6138+_0x8167('0x23')+_0x2750d5+_0x8167('0x24'),'json':!![]};rp(_0x4ab3d1)[_0x8167('0x25')](function(_0x4decee){var _0x45cfb7=_['find'](_0x4decee[_0x8167('0x26')]['contacts'],[_0x2750d5,_0x2e6138]);_0x29bc99(_0x45cfb7);})[_0x8167('0x15')](function(_0x1a57de){_0x17baee(_0x1a57de);});});}function getEndUser(_0xe14d65,_0x3f3a88,_0x2d9739){return function(_0x1d5ade){return new Promise(function(_0x5641ca,_0x2d3636){logger[_0x8167('0x19')](util[_0x8167('0x27')]('Searching\x20contact\x20with\x20phone\x20%s',_0x1d5ade[_0x8167('0x28')]));searchContact(_0x2d9739,_0x3f3a88,_0x8167('0x29'),_0x1d5ade['contactNumber'])[_0x8167('0x25')](function(_0x9d877c){if(_0x9d877c){_0x1d5ade[_0x8167('0x2a')]=_0x9d877c['id'];logger['info'](_0x8167('0x2b'),_0x1d5ade[_0x8167('0x2a')]);return _0x5641ca(_0x1d5ade);}searchContact(_0x2d9739,_0x3f3a88,_0x8167('0x2c'),_0x1d5ade[_0x8167('0x28')])[_0x8167('0x25')](function(_0x18143b){if(_0x18143b){_0x1d5ade[_0x8167('0x2a')]=_0x18143b['id'];logger[_0x8167('0x19')](_0x8167('0x2d'),_0x1d5ade[_0x8167('0x2a')]);return _0x5641ca(_0x1d5ade);}createEndUser(_0x1d5ade,_0xe14d65,_0x3f3a88,_0x2d9739)[_0x8167('0x25')](function(_0x263ff5){logger[_0x8167('0x19')]('Contact\x20created:',_0x263ff5['endUserId']);return _0x5641ca(_0x263ff5);});});})[_0x8167('0x15')](function(_0x4bf6ee){_0x2d3636(_0x4bf6ee);});});};}function createEndUser(_0x585e8b,_0x57f009,_0xef0fd1,_0x28fde2){return new Promise(function(_0x2f346,_0x51b385){var _0x3368bc=moment();var _0x4796e9={'method':'POST','uri':_0x28fde2+'/api/contacts','body':{'contact':{'last_name':_0x585e8b['contactNumber'],'work_number':_0x585e8b[_0x8167('0x28')],'mobile_number':_0x585e8b['contactNumber'],'owner_id':_0x585e8b['userId'],'created_at':_0x3368bc[_0x8167('0x27')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x4796e9[_0x8167('0xf')]=_0xef0fd1;logger[_0x8167('0x19')](_0x8167('0x2e'));return rp(_0x4796e9)[_0x8167('0x25')](function(_0x2fcc81){_0x585e8b[_0x8167('0x2a')]=_0x2fcc81[_0x8167('0x2f')]['id'];_0x2f346(_0x585e8b);})[_0x8167('0x15')](function(_0x9fbccd){logger[_0x8167('0x16')]('['+[_0x57f009[_0x8167('0x17')]()]+']',_0x9fbccd['message']);_0x51b385(_0x9fbccd['message']);});});}function getTicket(_0x1fb48e,_0xc79577,_0x11b26b,_0x7d829d,_0x25239a){return function(_0x3d0826){logger['info']('Creating\x20new\x20task');return new Promise(function(_0x1272c6,_0x18048e){var _0x16de4a=moment();var _0x4bcbe0={'method':_0x8167('0x30'),'uri':_0x11b26b+_0x8167('0x31'),'body':{'title':intUtil[_0x8167('0x32')](_0x7d829d['Subjects'],_0x25239a,'\x20'),'description':intUtil[_0x8167('0x32')](_0x7d829d[_0x8167('0x33')],_0x25239a,'\x0a'),'owner_id':_0x3d0826[_0x8167('0x1e')],'creater_id':_0x3d0826[_0x8167('0x13')],'targetable_id':_0x3d0826['endUserId'],'targetable_type':_0x8167('0x34'),'created_at':_0x16de4a['format'](_0x8167('0x35')),'due_date':_0x16de4a['add'](0x1e,'m')['format'](_0x8167('0x35'))},'json':!![]};_0x4bcbe0['headers']=_0xc79577;return rp(_0x4bcbe0)['then'](function(_0x97f0d4){_0x3d0826[_0x8167('0x36')]=_0x97f0d4['task']['id'];logger[_0x8167('0x19')](_0x8167('0x37'),_0x3d0826[_0x8167('0x36')]);_0x1272c6(_0x3d0826);})[_0x8167('0x15')](function(_0x42b058){logger[_0x8167('0x16')]('['+[_0x1fb48e[_0x8167('0x17')]()]+']',_0x42b058[_0x8167('0x18')]);_0x18048e(_0x42b058[_0x8167('0x18')]);});});};}function emit(_0x2df359,_0x5c210a,_0x4d8b96){var _0x5a8ede={'uri':_0x2df359+_0x8167('0x38')+_0x4d8b96};io['to'](util[_0x8167('0x27')](_0x8167('0x39'),_0x5c210a))['emit']('trigger:browser:url',_0x5a8ede);}exports['cs']=function(_0x4e0336,_0x121b2b,_0x7ff478,_0x322f3d,_0x4b4d59,_0x44e802,_0x43d16b,_0x5f34a7){var _0x595a4d={};var _0xff247c={'Authorization':_0x8167('0x3a')+_0x44e802[_0x8167('0x3b')]};_0x44e802[_0x8167('0x3c')]=intUtil['stripTrailingSlash'](_0x44e802[_0x8167('0x3c')]);_0x44e802[_0x8167('0x3d')]=intUtil[_0x8167('0x3e')](_0x44e802['serverUrl']);var _0x59160e=_0x44e802[_0x8167('0x3c')];_0x595a4d[_0x8167('0x21')]=_0x44e802['username'];_0x595a4d['contactNumber']=_0x5f34a7[_0x8167('0x3f')]()==='outbound'?_0x121b2b[_0x8167('0x40')]:_0x121b2b[_0x8167('0x41')];_0x595a4d[_0x8167('0x42')]=_0x5f34a7===_0x8167('0x43')||_0x5f34a7===_0x8167('0x44')?_0x8167('0x43'):_0x8167('0x45');if(_0x322f3d){_0x595a4d['agentEmail']=_0x322f3d[_0x8167('0x12')];}var _0x14e13e=util[_0x8167('0x27')](_0x8167('0x46'),_0x44e802[_0x8167('0x3d')],_0x121b2b[_0x8167('0x47')],md5(_0x121b2b[_0x8167('0x47')]));if(_0x4b4d59&&_0x4b4d59[_0x8167('0x48')]){logger[_0x8167('0x19')](_0x8167('0x49'),_0x8167('0x4a'));_0x121b2b['recordingURL']=_0x14e13e;}else if(_0x43d16b&&_0x43d16b[_0x8167('0x4b')]&&_0x43d16b[_0x8167('0x4b')]!==_0x8167('0x4c')){logger['info'](_0x8167('0x4d'),_0x8167('0x4a'));_0x121b2b['recordingURL']=_0x14e13e;}else{_0x121b2b['recordingURL']='';}return getAdminId(_0x595a4d,_0x5f34a7,_0xff247c,_0x59160e)['then'](getUser(_0x5f34a7,_0xff247c,_0x59160e))[_0x8167('0x25')](getEndUser(_0x5f34a7,_0xff247c,_0x59160e))[_0x8167('0x25')](getTicket(_0x5f34a7,_0xff247c,_0x59160e,_0x7ff478,_0x121b2b))[_0x8167('0x25')](function(_0x3c4434){logger['info'](util[_0x8167('0x27')]('The\x20ticket\x20ID\x20is:\x20%s',_0x3c4434['ticketId']));if(_0x5f34a7!==_0x8167('0x44')){logger[_0x8167('0x19')]('['+[_0x5f34a7[_0x8167('0x17')]()]+']',_0x8167('0x4e'));emit(_0x59160e,_0x322f3d[_0x8167('0x4f')],_0x3c4434['endUserId']);}})[_0x8167('0x15')](function(_0x3d03d5){logger[_0x8167('0x16')]('['+[_0x5f34a7[_0x8167('0x17')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x8167('0x50')](_0x3d03d5,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xcc55=['/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','outbound','destcalleridnum','calleridnum','unmanaged','queue','email','%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','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','ioredis','./util','../../../../config/environment','freshsales','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','adminEmail','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','userId','User\x20found:','Admin\x20selected','catch','error','&f=','&entities=contact','find','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','Contact\x20found\x20mobile_number:','endUserId','work_number','contactNumber','Contact\x20found\x20work_number:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','getString','Descriptions','Contact','ticketId','task','Task\x20created:'];(function(_0x3869f6,_0x2ea2d5){var _0x536687=function(_0x335054){while(--_0x335054){_0x3869f6['push'](_0x3869f6['shift']());}};_0x536687(++_0x2ea2d5);}(_0xcc55,0x6f));var _0x5cc5=function(_0x2cd5ef,_0x496ef8){_0x2cd5ef=_0x2cd5ef-0x0;var _0x3737e0=_0xcc55[_0x2cd5ef];return _0x3737e0;};'use strict';var _=require(_0x5cc5('0x0'));var rp=require(_0x5cc5('0x1'));var md5=require(_0x5cc5('0x2'));var util=require(_0x5cc5('0x3'));var moment=require(_0x5cc5('0x4'));var Promise=require('bluebird');var Redis=require(_0x5cc5('0x5'));var intUtil=require(_0x5cc5('0x6'));var config=require(_0x5cc5('0x7'));var logger=require('../../../../config/logger')(_0x5cc5('0x8'));config[_0x5cc5('0x9')]=_['defaults'](config['redis'],{'host':_0x5cc5('0xa'),'port':0x18eb});var io=require(_0x5cc5('0xb'))(new Redis(config[_0x5cc5('0x9')]));function getAdminId(_0x5068a5,_0x3905df,_0x51f991,_0x1100e7){return new Promise(function(_0x20528d,_0x275bee){var _0x4391fc=![];var _0x379a8e={'method':_0x5cc5('0xc'),'uri':_0x1100e7+_0x5cc5('0xd'),'json':!![]};_0x379a8e[_0x5cc5('0xe')]=_0x51f991;logger[_0x5cc5('0xf')](_0x5cc5('0x10'));return rp(_0x379a8e)[_0x5cc5('0x11')](function(_0x19322b){if(_0x19322b){var _0x4366b8=_0x19322b[_0x5cc5('0x12')];var _0x4fc577=null;for(_0x4fc577=0x0;_0x4fc577<_0x4366b8['length'];_0x4fc577++){if(_0x4366b8[_0x4fc577]['email']===_0x5068a5[_0x5cc5('0x13')]){_0x5068a5['adminId']=_0x4366b8[_0x4fc577]['id'];_0x4391fc=!![];}}if(_0x4391fc){logger[_0x5cc5('0xf')](_0x5cc5('0x14'),_0x5068a5[_0x5cc5('0x15')]);_0x20528d(_0x5068a5);}else{_0x275bee({'statusCode':0x194,'message':_0x5cc5('0x16')});}}else{_0x275bee({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x16083b){logger['error']('['+[_0x3905df[_0x5cc5('0x17')]()]+']',_0x16083b[_0x5cc5('0x18')]);_0x275bee(_0x16083b);});});}function getUser(_0x26f9ea,_0x35356d,_0x5e7e1f){return function(_0x2e3fa7){return new Promise(function(_0x431742,_0x36c965){var _0x50c906={'method':_0x5cc5('0xc'),'uri':_0x5e7e1f+'/api/selector/owners','json':!![]};_0x50c906['headers']=_0x35356d;logger[_0x5cc5('0xf')](_0x5cc5('0x19'));return rp(_0x50c906)['then'](function(_0x2bd976){if(_0x2bd976){var _0x1f6ab1=_0x2bd976[_0x5cc5('0x12')];var _0x5f3e98=![];var _0x103c90=null;if(_0x2e3fa7[_0x5cc5('0x1a')]!==null){logger[_0x5cc5('0xf')](_0x5cc5('0x1b'),_0x2e3fa7[_0x5cc5('0x1a')]);_0x2e3fa7[_0x5cc5('0x1c')]=_0x2e3fa7[_0x5cc5('0x1a')];for(_0x103c90=0x0;_0x103c90<_0x1f6ab1[_0x5cc5('0x1d')];_0x103c90++){if(_0x1f6ab1[_0x103c90]['email']===_0x2e3fa7[_0x5cc5('0x1a')]){_0x5f3e98=!![];_0x2e3fa7[_0x5cc5('0x1e')]=_0x1f6ab1[_0x103c90]['id'];logger['info'](_0x5cc5('0x1f'),_0x2e3fa7[_0x5cc5('0x1e')]);}}}if(!_0x5f3e98){logger[_0x5cc5('0xf')](_0x5cc5('0x20'));_0x2e3fa7[_0x5cc5('0x1c')]=_0x2e3fa7['adminEmail'];_0x2e3fa7[_0x5cc5('0x1e')]=_0x2e3fa7['adminId'];_0x5f3e98=!![];}if(_0x5f3e98){_0x431742(_0x2e3fa7);}else{_0x36c965({'statusCode':0x194,'message':_0x5cc5('0x16')});}}else{_0x36c965({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x5cc5('0x21')](function(_0x1b4329){logger[_0x5cc5('0x22')]('['+[_0x26f9ea[_0x5cc5('0x17')]()]+']',_0x1b4329[_0x5cc5('0x18')]);_0x36c965(_0x1b4329);});});};}function searchContact(_0x2ea9e5,_0x3664ab,_0x37f9f8,_0x9790ab){return new Promise(function(_0x1679fe,_0x3c4d5e){var _0x485e8f={'method':'GET','headers':_0x3664ab,'uri':_0x2ea9e5+'/api/lookup?q='+_0x9790ab+_0x5cc5('0x23')+_0x37f9f8+_0x5cc5('0x24'),'json':!![]};rp(_0x485e8f)[_0x5cc5('0x11')](function(_0xe6e718){var _0x2a8e72=_[_0x5cc5('0x25')](_0xe6e718['contacts']['contacts'],[_0x37f9f8,_0x9790ab]);_0x1679fe(_0x2a8e72);})[_0x5cc5('0x21')](function(_0x55e0e5){_0x3c4d5e(_0x55e0e5);});});}function getEndUser(_0x209626,_0x5d679c,_0x1868c1){return function(_0x47abfb){return new Promise(function(_0x214256,_0x15367a){logger[_0x5cc5('0xf')](util[_0x5cc5('0x26')](_0x5cc5('0x27'),_0x47abfb['contactNumber']));searchContact(_0x1868c1,_0x5d679c,_0x5cc5('0x28'),_0x47abfb['contactNumber'])[_0x5cc5('0x11')](function(_0x1efea2){if(_0x1efea2){_0x47abfb['endUserId']=_0x1efea2['id'];logger['info'](_0x5cc5('0x29'),_0x47abfb[_0x5cc5('0x2a')]);return _0x214256(_0x47abfb);}searchContact(_0x1868c1,_0x5d679c,_0x5cc5('0x2b'),_0x47abfb[_0x5cc5('0x2c')])[_0x5cc5('0x11')](function(_0x663a13){if(_0x663a13){_0x47abfb[_0x5cc5('0x2a')]=_0x663a13['id'];logger[_0x5cc5('0xf')](_0x5cc5('0x2d'),_0x47abfb[_0x5cc5('0x2a')]);return _0x214256(_0x47abfb);}createEndUser(_0x47abfb,_0x209626,_0x5d679c,_0x1868c1)[_0x5cc5('0x11')](function(_0x5b9d20){logger[_0x5cc5('0xf')]('Contact\x20created:',_0x5b9d20['endUserId']);return _0x214256(_0x5b9d20);});});})['catch'](function(_0x41c001){_0x15367a(_0x41c001);});});};}function createEndUser(_0x2761e7,_0x437a75,_0x528428,_0x28e1c9){return new Promise(function(_0x3a0688,_0x168ad5){var _0x23c3f6=moment();var _0x19fb73={'method':_0x5cc5('0x2e'),'uri':_0x28e1c9+_0x5cc5('0x2f'),'body':{'contact':{'last_name':_0x2761e7[_0x5cc5('0x2c')],'work_number':_0x2761e7['contactNumber'],'mobile_number':_0x2761e7[_0x5cc5('0x2c')],'owner_id':_0x2761e7[_0x5cc5('0x1e')],'created_at':_0x23c3f6[_0x5cc5('0x26')](_0x5cc5('0x30'))}},'json':!![]};_0x19fb73[_0x5cc5('0xe')]=_0x528428;logger['info'](_0x5cc5('0x31'));return rp(_0x19fb73)['then'](function(_0x2d05f2){_0x2761e7[_0x5cc5('0x2a')]=_0x2d05f2[_0x5cc5('0x32')]['id'];_0x3a0688(_0x2761e7);})[_0x5cc5('0x21')](function(_0x2802aa){logger[_0x5cc5('0x22')]('['+[_0x437a75[_0x5cc5('0x17')]()]+']',_0x2802aa['message']);_0x168ad5(_0x2802aa[_0x5cc5('0x18')]);});});}function getTicket(_0x128ee3,_0x43f68d,_0xac03ea,_0x216737,_0x296973){return function(_0x4c2d32){logger[_0x5cc5('0xf')]('Creating\x20new\x20task');return new Promise(function(_0x43c86c,_0x5bbeb5){var _0x25a95c=moment();var _0x30b6cd={'method':_0x5cc5('0x2e'),'uri':_0xac03ea+'/api/tasks','body':{'title':intUtil[_0x5cc5('0x33')](_0x216737['Subjects'],_0x296973,'\x20'),'description':intUtil[_0x5cc5('0x33')](_0x216737[_0x5cc5('0x34')],_0x296973,'\x0a'),'owner_id':_0x4c2d32[_0x5cc5('0x1e')],'creater_id':_0x4c2d32[_0x5cc5('0x15')],'targetable_id':_0x4c2d32[_0x5cc5('0x2a')],'targetable_type':_0x5cc5('0x35'),'created_at':_0x25a95c['format'](_0x5cc5('0x30')),'due_date':_0x25a95c['add'](0x1e,'m')[_0x5cc5('0x26')](_0x5cc5('0x30'))},'json':!![]};_0x30b6cd[_0x5cc5('0xe')]=_0x43f68d;return rp(_0x30b6cd)[_0x5cc5('0x11')](function(_0x46edb4){_0x4c2d32[_0x5cc5('0x36')]=_0x46edb4[_0x5cc5('0x37')]['id'];logger[_0x5cc5('0xf')](_0x5cc5('0x38'),_0x4c2d32[_0x5cc5('0x36')]);_0x43c86c(_0x4c2d32);})['catch'](function(_0x4c7636){logger[_0x5cc5('0x22')]('['+[_0x128ee3['toUpperCase']()]+']',_0x4c7636[_0x5cc5('0x18')]);_0x5bbeb5(_0x4c7636[_0x5cc5('0x18')]);});});};}function emit(_0x12314d,_0x13a7fc,_0x1cee2b){var _0x54801a={'uri':_0x12314d+_0x5cc5('0x39')+_0x1cee2b};io['to'](util[_0x5cc5('0x26')]('user:%s',_0x13a7fc))[_0x5cc5('0x3a')](_0x5cc5('0x3b'),_0x54801a);}exports['cs']=function(_0x10e129,_0x2e78b8,_0x375eb3,_0x4e06ca,_0xa9fadd,_0x58467b,_0x183635,_0xc766a1){var _0x29508b={};var _0x20ac4f={'Authorization':_0x5cc5('0x3c')+_0x58467b[_0x5cc5('0x3d')]};_0x58467b[_0x5cc5('0x3e')]=intUtil[_0x5cc5('0x3f')](_0x58467b[_0x5cc5('0x3e')]);_0x58467b[_0x5cc5('0x40')]=intUtil[_0x5cc5('0x3f')](_0x58467b[_0x5cc5('0x40')]);var _0x4cfd21=_0x58467b[_0x5cc5('0x3e')];_0x29508b[_0x5cc5('0x13')]=_0x58467b[_0x5cc5('0x41')];_0x29508b[_0x5cc5('0x2c')]=_0xc766a1['toLowerCase']()===_0x5cc5('0x42')?_0x2e78b8[_0x5cc5('0x43')]:_0x2e78b8[_0x5cc5('0x44')];_0x29508b['callDirection']=_0xc766a1==='queue'||_0xc766a1===_0x5cc5('0x45')?_0x5cc5('0x46'):_0x5cc5('0x42');if(_0x4e06ca){_0x29508b[_0x5cc5('0x1a')]=_0x4e06ca[_0x5cc5('0x47')];}var _0x4585a3=util[_0x5cc5('0x26')](_0x5cc5('0x48'),_0x58467b[_0x5cc5('0x40')],_0x2e78b8['uniqueid'],md5(_0x2e78b8[_0x5cc5('0x49')]));if(_0xa9fadd&&_0xa9fadd[_0x5cc5('0x4a')]){logger[_0x5cc5('0xf')](_0x5cc5('0x4b'),_0x5cc5('0x4c'));_0x2e78b8['recordingURL']=_0x4585a3;}else if(_0x183635&&_0x183635[_0x5cc5('0x4d')]&&_0x183635[_0x5cc5('0x4d')]!==_0x5cc5('0x4e')){logger['info'](_0x5cc5('0x4f'),_0x5cc5('0x4c'));_0x2e78b8['recordingURL']=_0x4585a3;}else{_0x2e78b8['recordingURL']='';}return getAdminId(_0x29508b,_0xc766a1,_0x20ac4f,_0x4cfd21)[_0x5cc5('0x11')](getUser(_0xc766a1,_0x20ac4f,_0x4cfd21))[_0x5cc5('0x11')](getEndUser(_0xc766a1,_0x20ac4f,_0x4cfd21))[_0x5cc5('0x11')](getTicket(_0xc766a1,_0x20ac4f,_0x4cfd21,_0x375eb3,_0x2e78b8))['then'](function(_0x4f9ba0){logger[_0x5cc5('0xf')](util[_0x5cc5('0x26')](_0x5cc5('0x50'),_0x4f9ba0[_0x5cc5('0x36')]));if(_0xc766a1!=='unmanaged'){logger[_0x5cc5('0xf')]('['+[_0xc766a1[_0x5cc5('0x17')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x4cfd21,_0x4e06ca[_0x5cc5('0x51')],_0x4f9ba0[_0x5cc5('0x2a')]);}})[_0x5cc5('0x21')](function(_0x3f20ee){logger[_0x5cc5('0x22')]('['+[_0xc766a1['toUpperCase']()]+_0x5cc5('0x52'),util[_0x5cc5('0x53')](_0x3f20ee,{'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 f25ec41..16ef4e3 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 _0x2929=['salesforce','sugarcrm','zoho','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','zendesk','freshdesk','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged'];(function(_0x2514c2,_0x37bd73){var _0x25b248=function(_0x1dac2a){while(--_0x1dac2a){_0x2514c2['push'](_0x2514c2['shift']());}};_0x25b248(++_0x37bd73);}(_0x2929,0xd8));var _0x9292=function(_0x344fa8,_0x3d8b65){_0x344fa8=_0x344fa8-0x0;var _0x4349e6=_0x2929[_0x344fa8];return _0x4349e6;};'use strict';var _=require(_0x9292('0x0'));var util=require(_0x9292('0x1'));var zendesk=require(_0x9292('0x2'));var salesforce=require(_0x9292('0x3'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x9292('0x4'));var zoho=require(_0x9292('0x5'));var desk=require(_0x9292('0x6'));var vtiger=require(_0x9292('0x7'));var servicenow=require(_0x9292('0x8'));var dynamics365=require(_0x9292('0x9'));var freshsales=require('./freshsales');var integrations=[_0x9292('0xa'),'salesforce','sugarcrm',_0x9292('0xb'),'zoho',_0x9292('0xc'),_0x9292('0xd'),_0x9292('0xe'),_0x9292('0xf'),_0x9292('0x10')];exports[_0x9292('0x11')]=function(_0x5c1258,_0x190f13,_0x24aa2b,_0x4391af,_0x2784a4,_0x4bf0de){if(_0x24aa2b){if(_[_0x9292('0x12')](integrations,_0x5c1258[_0x9292('0x13')][_0x9292('0x14')]())){try{var _0x1386f0=null;var _0x50050d='';var _0x3d63ab=_0x24aa2b[_0x5c1258[_0x9292('0x13')][_0x9292('0x14')]()];if(_0x3d63ab){var _0x54b85a=_0x3d63ab[_0x5c1258[_0x9292('0x15')]];if(_0x54b85a){var _0x5cf9cf=_[_0x9292('0x16')](_0x54b85a[_0x9292('0x17')],{'id':parseInt(_0x5c1258['data3'],0xa)});if(_0x5cf9cf){if(_0x4391af){if(_0x2784a4&&_0x190f13['queue']){_0x50050d=_0x9292('0x18');}else if(_0x190f13[_0x9292('0x19')]){_0x50050d=_0x9292('0x1a');}else{console[_0x9292('0x1b')](_0x9292('0x1c'),_0x190f13);}}else{_0x50050d=_0x9292('0x1d');}switch(_0x5c1258[_0x9292('0x13')][_0x9292('0x14')]()){case'zendesk':zendesk[_0x50050d](_0x5c1258,_0x190f13,_0x5cf9cf,_0x4391af,_0x2784a4,_0x54b85a,_0x4bf0de);break;case _0x9292('0x1e'):salesforce[_0x50050d](_0x5c1258,_0x190f13,_0x5cf9cf,_0x4391af,_0x2784a4,_0x54b85a,_0x4bf0de);break;case _0x9292('0x1f'):sugarcrm[_0x50050d](_0x5c1258,_0x190f13,_0x5cf9cf,_0x4391af,_0x2784a4,_0x54b85a,_0x4bf0de);break;case'freshdesk':freshdesk[_0x50050d](_0x5c1258,_0x190f13,_0x5cf9cf,_0x4391af,_0x2784a4,_0x54b85a,_0x4bf0de);break;case _0x9292('0x20'):zoho[_0x50050d](_0x5c1258,_0x190f13,_0x5cf9cf,_0x4391af,_0x2784a4,_0x54b85a,_0x4bf0de);break;case _0x9292('0xc'):desk[_0x50050d](_0x5c1258,_0x190f13,_0x5cf9cf,_0x4391af,_0x2784a4,_0x54b85a,_0x4bf0de);break;case _0x9292('0xd'):vtiger[_0x50050d](_0x5c1258,_0x190f13,_0x5cf9cf,_0x4391af,_0x2784a4,_0x54b85a,_0x4bf0de);break;case _0x9292('0xf'):freshsales['cs'](_0x5c1258,_0x190f13,_0x5cf9cf,_0x4391af,_0x2784a4,_0x54b85a,_0x4bf0de,_0x50050d);break;case _0x9292('0x10'):servicenow['cs'](_0x5c1258,_0x190f13,_0x5cf9cf,_0x4391af,_0x2784a4,_0x54b85a,_0x4bf0de,_0x50050d);break;case _0x9292('0xe'):dynamics365['cs'](_0x5c1258,_0x190f13,_0x5cf9cf,_0x4391af,_0x2784a4,_0x54b85a,_0x4bf0de,_0x50050d);break;default:console[_0x9292('0x1b')](_0x9292('0x21'));}}else{_0x1386f0=require(_0x9292('0x22'))(_0x5c1258[_0x9292('0x13')][_0x9292('0x14')]());_0x1386f0[_0x9292('0x23')](_0x9292('0x24'),util[_0x9292('0x25')](_0x9292('0x26'),_0x5c1258[_0x9292('0x13')][_0x9292('0x14')](),_0x5c1258[_0x9292('0x27')]));}}else{_0x1386f0=require(_0x9292('0x22'))(_0x5c1258[_0x9292('0x13')][_0x9292('0x14')]());_0x1386f0[_0x9292('0x23')](_0x9292('0x24'),util[_0x9292('0x25')](_0x9292('0x28'),_0x5c1258['data1'][_0x9292('0x14')](),_0x5c1258[_0x9292('0x15')]));}}else{}}catch(_0x58f1b2){console[_0x9292('0x23')](_0x58f1b2);}}}}; \ No newline at end of file +var _0xcb01=['freshdesk','desk','servicenow','dynamics365','../../../../config/logger','error','[EXEC]','data3','format','lodash','util','./salesforce','./sugarcrm','./zoho','./desk','./vtiger','./servicenow','./freshsales','zoho','freshsales','includes','data1','toLowerCase','data2','find','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','zendesk','salesforce','sugarcrm'];(function(_0xd1b1b8,_0x242fb1){var _0x11d1cd=function(_0x4cb21c){while(--_0x4cb21c){_0xd1b1b8['push'](_0xd1b1b8['shift']());}};_0x11d1cd(++_0x242fb1);}(_0xcb01,0x72));var _0x1cb0=function(_0x29d205,_0x4ddfb0){_0x29d205=_0x29d205-0x0;var _0x7794c1=_0xcb01[_0x29d205];return _0x7794c1;};'use strict';var _=require(_0x1cb0('0x0'));var util=require(_0x1cb0('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x1cb0('0x2'));var sugarcrm=require(_0x1cb0('0x3'));var freshdesk=require('./freshdesk');var zoho=require(_0x1cb0('0x4'));var desk=require(_0x1cb0('0x5'));var vtiger=require(_0x1cb0('0x6'));var servicenow=require(_0x1cb0('0x7'));var dynamics365=require('./dynamics365');var freshsales=require(_0x1cb0('0x8'));var integrations=['zendesk','salesforce','sugarcrm','freshdesk',_0x1cb0('0x9'),'desk','vtiger','dynamics365',_0x1cb0('0xa'),'servicenow'];exports['exec']=function(_0x4f8b16,_0x3bec39,_0x4ea2c9,_0x2e806f,_0x2b30af,_0x3bf5b0){if(_0x4ea2c9){if(_[_0x1cb0('0xb')](integrations,_0x4f8b16[_0x1cb0('0xc')][_0x1cb0('0xd')]())){try{var _0x11b48e=null;var _0x422add='';var _0x2cd8bd=_0x4ea2c9[_0x4f8b16[_0x1cb0('0xc')]['toLowerCase']()];if(_0x2cd8bd){var _0x33a1c7=_0x2cd8bd[_0x4f8b16[_0x1cb0('0xe')]];if(_0x33a1c7){var _0x4be526=_[_0x1cb0('0xf')](_0x33a1c7[_0x1cb0('0x10')],{'id':parseInt(_0x4f8b16['data3'],0xa)});if(_0x4be526){if(_0x2e806f){if(_0x2b30af&&_0x3bec39[_0x1cb0('0x11')]){_0x422add=_0x1cb0('0x11');}else if(_0x3bec39[_0x1cb0('0x12')]){_0x422add=_0x1cb0('0x13');}else{console[_0x1cb0('0x14')](_0x1cb0('0x15'),_0x3bec39);}}else{_0x422add=_0x1cb0('0x16');}switch(_0x4f8b16[_0x1cb0('0xc')][_0x1cb0('0xd')]()){case _0x1cb0('0x17'):zendesk[_0x422add](_0x4f8b16,_0x3bec39,_0x4be526,_0x2e806f,_0x2b30af,_0x33a1c7,_0x3bf5b0);break;case _0x1cb0('0x18'):salesforce[_0x422add](_0x4f8b16,_0x3bec39,_0x4be526,_0x2e806f,_0x2b30af,_0x33a1c7,_0x3bf5b0);break;case _0x1cb0('0x19'):sugarcrm[_0x422add](_0x4f8b16,_0x3bec39,_0x4be526,_0x2e806f,_0x2b30af,_0x33a1c7,_0x3bf5b0);break;case _0x1cb0('0x1a'):freshdesk[_0x422add](_0x4f8b16,_0x3bec39,_0x4be526,_0x2e806f,_0x2b30af,_0x33a1c7,_0x3bf5b0);break;case _0x1cb0('0x9'):zoho[_0x422add](_0x4f8b16,_0x3bec39,_0x4be526,_0x2e806f,_0x2b30af,_0x33a1c7,_0x3bf5b0);break;case _0x1cb0('0x1b'):desk[_0x422add](_0x4f8b16,_0x3bec39,_0x4be526,_0x2e806f,_0x2b30af,_0x33a1c7,_0x3bf5b0);break;case'vtiger':vtiger[_0x422add](_0x4f8b16,_0x3bec39,_0x4be526,_0x2e806f,_0x2b30af,_0x33a1c7,_0x3bf5b0);break;case _0x1cb0('0xa'):freshsales['cs'](_0x4f8b16,_0x3bec39,_0x4be526,_0x2e806f,_0x2b30af,_0x33a1c7,_0x3bf5b0,_0x422add);break;case _0x1cb0('0x1c'):servicenow['cs'](_0x4f8b16,_0x3bec39,_0x4be526,_0x2e806f,_0x2b30af,_0x33a1c7,_0x3bf5b0,_0x422add);break;case _0x1cb0('0x1d'):dynamics365['cs'](_0x4f8b16,_0x3bec39,_0x4be526,_0x2e806f,_0x2b30af,_0x33a1c7,_0x3bf5b0,_0x422add);break;default:console[_0x1cb0('0x14')]('unknown\x20integration');}}else{_0x11b48e=require(_0x1cb0('0x1e'))(_0x4f8b16['data1'][_0x1cb0('0xd')]());_0x11b48e[_0x1cb0('0x1f')](_0x1cb0('0x20'),util['format']('%s\x20configuration\x20#%s\x20not\x20found',_0x4f8b16[_0x1cb0('0xc')][_0x1cb0('0xd')](),_0x4f8b16[_0x1cb0('0x21')]));}}else{_0x11b48e=require(_0x1cb0('0x1e'))(_0x4f8b16[_0x1cb0('0xc')]['toLowerCase']());_0x11b48e[_0x1cb0('0x1f')](_0x1cb0('0x20'),util[_0x1cb0('0x22')]('%s\x20account\x20#%s\x20not\x20found',_0x4f8b16[_0x1cb0('0xc')][_0x1cb0('0xd')](),_0x4f8b16[_0x1cb0('0xe')]));}}else{}}catch(_0x341f60){console['error'](_0x341f60);}}}}; \ 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 770bca8..7c66909 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 _0x8233=['clientSecret','login','username','Connection\x20established.','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','Fields','[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','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','stripTrailingSlash','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','lastevent','isNil','calleridname','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','jsforce','ioredis','./util','../../../../config/logger','redis','localhost','emit','assign','getString','Subjects','ActivityDate','utc','IsRecurrence','contact','lead','WhoId','endUserType','account','WhatId','ticketType','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','validateEmail','sobject','User','find','execute','then','length','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','resolve','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','additionalSearchContact','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','upperFirst','forEach','includes','picklist','content','toString','variableName','idField','customVariable','Variable','name','password','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId'];(function(_0x33007f,_0x4b38d2){var _0x10d38c=function(_0x497992){while(--_0x497992){_0x33007f['push'](_0x33007f['shift']());}};_0x10d38c(++_0x4b38d2);}(_0x8233,0x194));var _0x3823=function(_0x486af0,_0x3b4a45){_0x486af0=_0x486af0-0x0;var _0x16f739=_0x8233[_0x486af0];return _0x16f739;};'use strict';var _=require('lodash');var rp=require(_0x3823('0x0'));var moment=require(_0x3823('0x1'));var BPromise=require(_0x3823('0x2'));var md5=require(_0x3823('0x3'));var jsforce=require(_0x3823('0x4'));var util=require('util');var Redis=require(_0x3823('0x5'));var intUtil=require(_0x3823('0x6'));var config=require('../../../../config/environment');var logger=require(_0x3823('0x7'))('salesforce');config[_0x3823('0x8')]=_['defaults'](config['redis'],{'host':_0x3823('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3823('0x8')]));function emit(_0x436e48,_0x4bdf10,_0x420700){io['to'](_0x436e48)[_0x3823('0xa')](_0x4bdf10,_0x420700);}function getTicket(_0x3256f2,_0x39b457,_0x3f2ca4,_0x1852eb,_0x46dbd5,_0x2b1ea8,_0x1fb05a,_0x23e144){var _0x1b93f0=Object[_0x3823('0xb')]({},{'OwnerId':_0x39b457['id'],'Subject':intUtil[_0x3823('0xc')](_0x1852eb[_0x3823('0xd')],_0x46dbd5,'\x20'),'Description':intUtil['getString'](_0x1852eb['Descriptions'],_0x46dbd5,'\x0a')},getCustomFields(_0x2b1ea8,_0x46dbd5));if(_0x3f2ca4){if(_0x1852eb['ticketType']==='Task'){_0x1b93f0[_0x3823('0xe')]=moment[_0x3823('0xf')]();_0x1b93f0['IsReminderSet']=![];_0x1b93f0[_0x3823('0x10')]=![];if(_0x3f2ca4['endUserType']===_0x3823('0x11')||_0x3f2ca4['endUserType']===_0x3823('0x12')){_0x1b93f0[_0x3823('0x13')]=_0x3f2ca4['id'];}else if(_0x3f2ca4[_0x3823('0x14')]===_0x3823('0x15')){_0x1b93f0[_0x3823('0x16')]=_0x3f2ca4['id'];}}else if(_0x1852eb[_0x3823('0x17')]===_0x3823('0x18')){if(_0x3f2ca4['endUserType']===_0x3823('0x11')){_0x1b93f0[_0x3823('0x19')]=_0x3f2ca4['id'];}else if(_0x3f2ca4[_0x3823('0x14')]===_0x3823('0x15')){_0x1b93f0[_0x3823('0x1a')]=_0x3f2ca4['id'];}else if(_0x3f2ca4[_0x3823('0x14')]==='lead'&&_0x1852eb['leadId']){_0x1b93f0[_0x1852eb[_0x3823('0x1b')]]=_0x3f2ca4['id'];}else{logger[_0x3823('0x1c')](_0x3823('0x1d'));}}}return _0x1fb05a['sobject'](_0x1852eb['ticketType'])[_0x3823('0x1e')](_0x1b93f0);}function getUser(_0x450150,_0x2de545,_0x1c98c){if(!_['isNil'](_0x2de545)&&intUtil[_0x3823('0x1f')](_0x2de545)){var _0x4a071a={'Email':_0x2de545};var _0x78fdc4={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1c98c[_0x3823('0x20')](_0x3823('0x21'))[_0x3823('0x22')](_0x4a071a,_0x78fdc4)[_0x3823('0x23')]()[_0x3823('0x24')](function(_0x3e0b96){if(_0x3e0b96[_0x3823('0x25')]){var _0x277b2f=_[_0x3823('0x22')](_0x3e0b96,function(_0x1ef720){return _0x1ef720['Email']===_0x2de545;});if(_0x277b2f){logger[_0x3823('0x1c')](_0x3823('0x26'),_0x2de545);return BPromise['resolve']({'id':_0x277b2f['Id'],'name':_0x277b2f[_0x3823('0x27')]});}}else{logger[_0x3823('0x1c')](_0x3823('0x28'),_0x2de545);return _0x1c98c[_0x3823('0x29')]()[_0x3823('0x24')](function(_0x4b38f9){return BPromise['resolve']({'id':_0x4b38f9[_0x3823('0x2a')],'name':_0x4b38f9[_0x3823('0x2b')]});});}});}else{logger[_0x3823('0x1c')](_0x3823('0x28'),_0x2de545);return _0x1c98c[_0x3823('0x29')]()[_0x3823('0x24')](function(_0x16e270){return BPromise[_0x3823('0x2c')]({'id':_0x16e270['user_id'],'name':_0x16e270['display_name']});});}}function getEndUser(_0x163bf6,_0x9e5b9b,_0x484f46,_0x3eef88,_0x555c54){var _0x1e9d04={'$or':{'Phone':_0x3eef88}};var _0x509527={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x3823('0x24')](function(){logger[_0x3823('0x1c')](_0x3823('0x2d'),_0x3eef88,_0x9e5b9b[_0x3823('0x2e')]);switch(_0x9e5b9b[_0x3823('0x2e')]){case'contact_lead':var _0x44bb07=_[_0x3823('0x2f')](_0x1e9d04);if(_0x9e5b9b['additionalSearchContact']){var _0x58b23c={};_0x58b23c[_0x9e5b9b['additionalSearchContact']]=_0x3eef88;_[_0x3823('0x30')](_0x44bb07[_0x3823('0x31')],_0x58b23c);}return _0x555c54[_0x3823('0x20')](_0x3823('0x32'))['find'](_0x44bb07,_0x509527)[_0x3823('0x23')]()[_0x3823('0x24')](function(_0x2aaef2){if(_0x2aaef2&&_0x2aaef2['length']){return _0x2aaef2;}else{var _0x35c1ed=_['cloneDeep'](_0x1e9d04);if(_0x9e5b9b['additionalSearchLead']){var _0x396d69={};_0x396d69[_0x9e5b9b[_0x3823('0x33')]]=_0x3eef88;_[_0x3823('0x30')](_0x35c1ed['$or'],_0x396d69);}return _0x555c54[_0x3823('0x20')](_0x3823('0x34'))[_0x3823('0x22')](_0x35c1ed,_0x509527);}});case _0x3823('0x35'):var _0x4b1312=_[_0x3823('0x2f')](_0x1e9d04);if(_0x9e5b9b[_0x3823('0x36')]){var _0x58b23c={};_0x58b23c[_0x9e5b9b[_0x3823('0x36')]]=_0x3eef88;_[_0x3823('0x30')](_0x4b1312[_0x3823('0x31')],_0x58b23c);}return _0x555c54[_0x3823('0x20')](_0x3823('0x37'))['find'](_0x4b1312,_0x509527)[_0x3823('0x23')]()[_0x3823('0x24')](function(_0x5f1505){if(_0x5f1505&&_0x5f1505[_0x3823('0x25')]){return _0x5f1505;}else{var _0x4018b8=_[_0x3823('0x2f')](_0x1e9d04);if(_0x9e5b9b[_0x3823('0x38')]){var _0x5c5f1f={};_0x5c5f1f[_0x9e5b9b[_0x3823('0x38')]]=_0x3eef88;_[_0x3823('0x30')](_0x4018b8[_0x3823('0x31')],_0x5c5f1f);}return _0x555c54[_0x3823('0x20')](_0x3823('0x32'))[_0x3823('0x22')](_0x4018b8,_0x509527)[_0x3823('0x24')](function(_0x29ffd8){if(_0x29ffd8&&_0x29ffd8['length']){return _0x29ffd8;}else{var _0x5e0186=_[_0x3823('0x2f')](_0x1e9d04);if(_0x9e5b9b[_0x3823('0x33')]){var _0x17d75d={};_0x17d75d[_0x9e5b9b['additionalSearchLead']]=_0x3eef88;_[_0x3823('0x30')](_0x5e0186[_0x3823('0x31')],_0x17d75d);}return _0x555c54[_0x3823('0x20')](_0x3823('0x34'))[_0x3823('0x22')](_0x5e0186,_0x509527);}});}});case _0x3823('0x11'):var _0x44bb07=_[_0x3823('0x2f')](_0x1e9d04);if(_0x9e5b9b[_0x3823('0x38')]){var _0x58b23c={};_0x58b23c[_0x9e5b9b['additionalSearchContact']]=_0x3eef88;_[_0x3823('0x30')](_0x44bb07[_0x3823('0x31')],_0x58b23c);}return _0x555c54[_0x3823('0x20')](_0x3823('0x32'))[_0x3823('0x22')](_0x44bb07,_0x509527)['execute']();case _0x3823('0x12'):var _0x31578c=_[_0x3823('0x2f')](_0x1e9d04);if(_0x9e5b9b[_0x3823('0x33')]){var _0x58b23c={};_0x58b23c[_0x9e5b9b[_0x3823('0x33')]]=_0x3eef88;_['merge'](_0x31578c[_0x3823('0x31')],_0x58b23c);}return _0x555c54[_0x3823('0x20')](_0x3823('0x34'))['find'](_0x31578c,_0x509527);case _0x3823('0x15'):var _0x4b1312=_[_0x3823('0x2f')](_0x1e9d04);if(_0x9e5b9b[_0x3823('0x36')]){var _0x58b23c={};_0x58b23c[_0x9e5b9b['additionalSearchAccount']]=_0x3eef88;_['merge'](_0x4b1312[_0x3823('0x31')],_0x58b23c);}return _0x555c54[_0x3823('0x20')](_0x3823('0x37'))['find'](_0x4b1312,_0x509527);default:return null;}})[_0x3823('0x24')](function(_0x2740b5){if(_0x2740b5&&_0x2740b5[_0x3823('0x25')]){var _0x2b50ad=_[_0x3823('0x39')](_0x2740b5);if(_0x2b50ad){return BPromise[_0x3823('0x2c')]({'id':_0x2b50ad['Id'],'name':_0x2b50ad[_0x3823('0x27')],'phone':_0x2b50ad[_0x3823('0x3a')],'endUserType':_0x2b50ad[_0x3823('0x3b')][_0x3823('0x3c')][_0x3823('0x3d')]()});}}})['then'](function(_0x4a6f60){if(_0x4a6f60){logger[_0x3823('0x1c')](_0x3823('0x3e'),_0x4a6f60[_0x3823('0x14')],_0x3eef88);return BPromise['resolve'](_0x4a6f60);}else{logger[_0x3823('0x1c')](_0x3823('0x3f'),_0x3eef88);var _0x5f425e={'Phone':_0x3eef88};if(_0x9e5b9b[_0x3823('0x40')]){if(_0x9e5b9b['moduleCreate']===_0x3823('0x11')){logger[_0x3823('0x1c')](_0x3823('0x41'),_0x3eef88,_0x9e5b9b[_0x3823('0x40')]);_0x5f425e[_0x3823('0x42')]=_0x484f46!==_0x3823('0x43')?_0x484f46:util[_0x3823('0x44')](_0x3823('0x45'),_0x3eef88);}else if(_0x9e5b9b['moduleCreate']===_0x3823('0x12')){logger[_0x3823('0x1c')](_0x3823('0x41'),_0x3eef88,_0x9e5b9b[_0x3823('0x40')]);_0x5f425e[_0x3823('0x42')]=_0x484f46!==''?_0x484f46:util[_0x3823('0x44')](_0x3823('0x45'),_0x3eef88);_0x5f425e[_0x3823('0x46')]='No\x20Company';}else if(_0x9e5b9b[_0x3823('0x40')]===_0x3823('0x15')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x3eef88,_0x9e5b9b[_0x3823('0x40')]);_0x5f425e[_0x3823('0x27')]=_0x484f46!==_0x3823('0x43')?_0x484f46:util[_0x3823('0x44')](_0x3823('0x45'),_0x3eef88);}else{return null;}}return _0x555c54[_0x3823('0x20')](_[_0x3823('0x47')](_0x9e5b9b['moduleCreate']))[_0x3823('0x1e')](_0x5f425e)[_0x3823('0x24')](function(_0x1a3b97){return BPromise[_0x3823('0x2c')]({'id':_0x1a3b97['id'],'endUserType':_0x9e5b9b[_0x3823('0x40')]});});}});}function getCustomFields(_0x9e8cf0,_0x28d63a){var _0x5a8958={};if(_0x9e8cf0[_0x3823('0x25')]>0x0){_[_0x3823('0x48')](_0x9e8cf0,function(_0x1265e3){if(_[_0x3823('0x49')](['string',_0x3823('0x4a')],_0x1265e3[_0x3823('0x3c')])&&_0x1265e3['idField']){_0x5a8958[_0x1265e3['idField']]=_0x1265e3[_0x3823('0x4b')][_0x3823('0x4c')]();}else if(_0x1265e3[_0x3823('0x3c')]==='variable'&&_0x1265e3[_0x3823('0x4d')]&&_0x1265e3['idField']){_0x28d63a[_0x1265e3['variableName']]&&(_0x5a8958[_0x1265e3[_0x3823('0x4e')]]=_0x28d63a[_0x1265e3['variableName']]['toString']());}else if(_0x1265e3[_0x3823('0x3c')]===_0x3823('0x4f')&&_0x1265e3['Variable']&&_0x1265e3[_0x3823('0x50')][_0x3823('0x51')]&&_0x1265e3['idField']){_0x28d63a[_0x1265e3[_0x3823('0x50')][_0x3823('0x51')][_0x3823('0x3d')]()]&&(_0x5a8958[_0x1265e3[_0x3823('0x4e')]]=_0x28d63a[_0x1265e3[_0x3823('0x50')][_0x3823('0x51')][_0x3823('0x3d')]()][_0x3823('0x4c')]());}});}return _0x5a8958;}function getConnection(_0x1ee13f){var _0x26bb65=_0x1ee13f[_0x3823('0x52')]['concat'](_0x1ee13f[_0x3823('0x53')]);var _0x5bb9da=new jsforce[(_0x3823('0x54'))]({'oauth2':{'loginUrl':_0x1ee13f[_0x3823('0x55')]||_0x3823('0x56'),'clientId':_0x1ee13f[_0x3823('0x57')],'clientSecret':_0x1ee13f[_0x3823('0x58')]}});return _0x5bb9da[_0x3823('0x59')](_0x1ee13f[_0x3823('0x5a')],_0x26bb65)[_0x3823('0x24')](function(){logger[_0x3823('0x1c')](_0x3823('0x5b'));return _0x5bb9da;});}exports['queue']=function(_0x594da4,_0x1a3a7c,_0x4f0bbd,_0x325ce8,_0x27a667,_0x9a4139){var _0x2e9cd2,_0x556636,_0x14defa,_0x16c5db;_0x9a4139[_0x3823('0x5c')]=intUtil['stripTrailingSlash'](_0x9a4139[_0x3823('0x5c')]);_0x9a4139['remoteUri']=intUtil['stripTrailingSlash'](_0x9a4139[_0x3823('0x55')]);if(_0x27a667&&_0x27a667['monitor_format']){logger[_0x3823('0x1c')](_0x3823('0x5d'),_0x3823('0x5e'));_0x1a3a7c[_0x3823('0x5f')]=util[_0x3823('0x44')](_0x3823('0x60'),_0x9a4139['serverUrl'],_0x1a3a7c[_0x3823('0x61')],md5(_0x1a3a7c['uniqueid']));}else{_0x1a3a7c['recordingURL']='';}return getConnection(_0x9a4139)[_0x3823('0x24')](function(_0x272b38){_0x16c5db=_0x272b38;return getUser(_0x9a4139,_0x325ce8['email'],_0x16c5db);})[_0x3823('0x24')](function(_0x1e812d){_0x2e9cd2=_0x1e812d;return getEndUser(_0x9a4139,_0x4f0bbd,_0x1a3a7c['calleridname'],_0x1a3a7c[_0x3823('0x62')],_0x16c5db);})[_0x3823('0x24')](function(_0x6bf54d){_0x556636=_0x6bf54d;return getTicket(_0x9a4139,_0x2e9cd2,_0x556636,_0x4f0bbd,_0x1a3a7c,_0x4f0bbd[_0x3823('0x63')],_0x16c5db,'queue');})[_0x3823('0x24')](function(_0x1993f3){_0x14defa=_0x1993f3;logger[_0x3823('0x1c')](_0x3823('0x64'),_0x14defa['id']);logger['info'](_0x3823('0x65'),_0x14defa['id'],_0x325ce8[_0x3823('0x51')],_0x9a4139[_0x3823('0x3c')]);switch(_0x9a4139[_0x3823('0x3c')]){case _0x3823('0x66'):emit(util['format'](_0x3823('0x67'),_0x325ce8[_0x3823('0x51')]),_0x3823('0x68'),{'recordId':_0x14defa['id']});break;case _0x3823('0x69'):emit(util[_0x3823('0x44')]('user:%s',_0x325ce8['name']),_0x3823('0x6a'),{'uri':util['format']('%s/%s/e',_0x16c5db[_0x3823('0x6b')],_0x14defa['id'])});break;default:logger['error'](_0x3823('0x6c'));}})[_0x3823('0x6d')](function(_0x44cd0d){logger[_0x3823('0x6e')]('[QUEUE]',_0x44cd0d);});};exports['outbound']=function(_0x2845de,_0x2b0f79,_0x2f3546,_0xd54830,_0x5a4063,_0x5e3132,_0x44f9e8){var _0x1eeea1,_0x4d18dc,_0x1d8c9a,_0x3e6f29;_0x5e3132[_0x3823('0x5c')]=intUtil[_0x3823('0x6f')](_0x5e3132[_0x3823('0x5c')]);_0x5e3132[_0x3823('0x55')]=intUtil[_0x3823('0x6f')](_0x5e3132[_0x3823('0x55')]);if(_0x44f9e8&&_0x44f9e8['recordingFormat']&&_0x44f9e8['recordingFormat']!==_0x3823('0x70')){logger[_0x3823('0x1c')](_0x3823('0x71'),_0x3823('0x5e'));_0x2b0f79[_0x3823('0x5f')]=util[_0x3823('0x44')](_0x3823('0x60'),_0x5e3132['serverUrl'],_0x2b0f79[_0x3823('0x61')],md5(_0x2b0f79[_0x3823('0x61')]));}return getConnection(_0x5e3132)[_0x3823('0x24')](function(_0x5e5f7b){_0x3e6f29=_0x5e5f7b;return getUser(_0x5e3132,_0xd54830[_0x3823('0x72')],_0x3e6f29);})[_0x3823('0x24')](function(_0x41543f){_0x1eeea1=_0x41543f;return getEndUser(_0x5e3132,_0x2f3546,_0x2b0f79[_0x3823('0x73')],_0x2b0f79[_0x3823('0x74')],_0x3e6f29);})[_0x3823('0x24')](function(_0x382289){_0x4d18dc=_0x382289;return getTicket(_0x5e3132,_0x1eeea1,_0x4d18dc,_0x2f3546,_0x2b0f79,_0x2f3546[_0x3823('0x63')],_0x3e6f29,'outbound');})[_0x3823('0x24')](function(_0x4081ac){_0x1d8c9a=_0x4081ac;logger[_0x3823('0x1c')](_0x3823('0x75'),_0x1d8c9a['id']);logger[_0x3823('0x1c')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x1d8c9a['id'],_0xd54830[_0x3823('0x51')],_0x5e3132['type']);switch(_0x5e3132[_0x3823('0x3c')]){case _0x3823('0x66'):emit(util[_0x3823('0x44')](_0x3823('0x67'),_0xd54830[_0x3823('0x51')]),_0x3823('0x68'),{'recordId':_0x1d8c9a['id']});break;case _0x3823('0x69'):emit(util[_0x3823('0x44')](_0x3823('0x67'),_0xd54830[_0x3823('0x51')]),_0x3823('0x6a'),{'uri':util[_0x3823('0x44')]('%s/%s/e',_0x3e6f29[_0x3823('0x6b')],_0x1d8c9a['id'])});break;default:logger[_0x3823('0x6e')](_0x3823('0x71'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x3823('0x6d')](function(_0x1e1e2f){logger[_0x3823('0x6e')](_0x3823('0x71'),_0x1e1e2f);});};exports['unmanaged']=function(_0x369cf2,_0x29dc1d,_0x2cff59,_0x3a223f,_0x5766bd,_0x147312){var _0x1318fd,_0x52504d,_0xa6ef01,_0x42602a;_0x147312[_0x3823('0x5c')]=intUtil['stripTrailingSlash'](_0x147312[_0x3823('0x5c')]);_0x147312[_0x3823('0x55')]=intUtil[_0x3823('0x6f')](_0x147312[_0x3823('0x55')]);if(_0x5766bd&&_0x5766bd['monitor_format']){logger[_0x3823('0x1c')]('['+_0x29dc1d[_0x3823('0x76')]['toUpperCase']()+']',_0x3823('0x5e'));_0x29dc1d[_0x3823('0x5f')]=util[_0x3823('0x44')](_0x3823('0x60'),_0x147312['serverUrl'],_0x29dc1d[_0x3823('0x61')],md5(_0x29dc1d[_0x3823('0x61')]));}else{_0x29dc1d[_0x3823('0x5f')]='';}return getConnection(_0x147312)[_0x3823('0x24')](function(_0x56b2cb){_0x42602a=_0x56b2cb;if(!_[_0x3823('0x77')](_0x3a223f)){return getUser(_0x147312,_0x3a223f[_0x3823('0x51')],_0x42602a);}else{return getUser(_0x147312,null,_0x42602a);}})[_0x3823('0x24')](function(_0x281a28){_0x1318fd=_0x281a28;return getEndUser(_0x147312,_0x2cff59,_0x29dc1d[_0x3823('0x78')],_0x29dc1d['calleridnum'],_0x42602a);})[_0x3823('0x24')](function(_0x472eab){_0x52504d=_0x472eab;return getTicket(_0x147312,_0x1318fd,_0x52504d,_0x2cff59,_0x29dc1d,_0x2cff59['Fields'],_0x42602a);})[_0x3823('0x24')](function(_0x139a67){_0xa6ef01=_0x139a67;logger[_0x3823('0x1c')]('['+_0x29dc1d[_0x3823('0x76')][_0x3823('0x79')]()+']\x20Ticket\x20%s\x20created.',_0xa6ef01['id']);logger[_0x3823('0x1c')]('['+_0x29dc1d[_0x3823('0x76')][_0x3823('0x79')]()+_0x3823('0x7a'),_0x147312[_0x3823('0x3c')]);})['catch'](function(_0x47949b){logger[_0x3823('0x6e')]('['+_0x29dc1d[_0x3823('0x76')]['toUpperCase']()+']',_0x47949b);});}; \ No newline at end of file +var _0x8ca9=['first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','Name','upperFirst','create','forEach','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','catch','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','md5','util','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','emit','getString','Descriptions','ticketType','ActivityDate','utc','IsReminderSet','IsRecurrence','contact','endUserType','WhoId','WhatId','Case','ContactId','AccountId','lead','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','isNil','validateEmail','User','find','execute','length','info','Agent\x20%s\x20found.','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','then','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','$or','cloneDeep','additionalSearchLead','merge','sobject','additionalSearchAccount','Contact','Lead','account'];(function(_0x398fac,_0x471fa4){var _0x4c501b=function(_0x16cdcd){while(--_0x16cdcd){_0x398fac['push'](_0x398fac['shift']());}};_0x4c501b(++_0x471fa4);}(_0x8ca9,0x1cf));var _0x98ca=function(_0x4e26e6,_0x1a076f){_0x4e26e6=_0x4e26e6-0x0;var _0x4179f9=_0x8ca9[_0x4e26e6];return _0x4179f9;};'use strict';var _=require(_0x98ca('0x0'));var rp=require(_0x98ca('0x1'));var moment=require(_0x98ca('0x2'));var BPromise=require('bluebird');var md5=require(_0x98ca('0x3'));var jsforce=require('jsforce');var util=require(_0x98ca('0x4'));var Redis=require('ioredis');var intUtil=require(_0x98ca('0x5'));var config=require(_0x98ca('0x6'));var logger=require(_0x98ca('0x7'))(_0x98ca('0x8'));config[_0x98ca('0x9')]=_[_0x98ca('0xa')](config['redis'],{'host':_0x98ca('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x98ca('0x9')]));function emit(_0x294d65,_0x4130d2,_0x34d3ce){io['to'](_0x294d65)[_0x98ca('0xc')](_0x4130d2,_0x34d3ce);}function getTicket(_0x31e393,_0x3bb5e0,_0x5e5e30,_0x4489bf,_0x3b32ae,_0x189bba,_0x788006,_0x314c0f){var _0x3462e2=Object['assign']({},{'OwnerId':_0x3bb5e0['id'],'Subject':intUtil[_0x98ca('0xd')](_0x4489bf['Subjects'],_0x3b32ae,'\x20'),'Description':intUtil[_0x98ca('0xd')](_0x4489bf[_0x98ca('0xe')],_0x3b32ae,'\x0a')},getCustomFields(_0x189bba,_0x3b32ae));if(_0x5e5e30){if(_0x4489bf[_0x98ca('0xf')]==='Task'){_0x3462e2[_0x98ca('0x10')]=moment[_0x98ca('0x11')]();_0x3462e2[_0x98ca('0x12')]=![];_0x3462e2[_0x98ca('0x13')]=![];if(_0x5e5e30['endUserType']===_0x98ca('0x14')||_0x5e5e30[_0x98ca('0x15')]==='lead'){_0x3462e2[_0x98ca('0x16')]=_0x5e5e30['id'];}else if(_0x5e5e30['endUserType']==='account'){_0x3462e2[_0x98ca('0x17')]=_0x5e5e30['id'];}}else if(_0x4489bf['ticketType']===_0x98ca('0x18')){if(_0x5e5e30['endUserType']===_0x98ca('0x14')){_0x3462e2[_0x98ca('0x19')]=_0x5e5e30['id'];}else if(_0x5e5e30[_0x98ca('0x15')]==='account'){_0x3462e2[_0x98ca('0x1a')]=_0x5e5e30['id'];}else if(_0x5e5e30[_0x98ca('0x15')]===_0x98ca('0x1b')&&_0x4489bf['leadId']){_0x3462e2[_0x4489bf[_0x98ca('0x1c')]]=_0x5e5e30['id'];}else{logger['info'](_0x98ca('0x1d'));}}}return _0x788006['sobject'](_0x4489bf[_0x98ca('0xf')])['create'](_0x3462e2);}function getUser(_0x91c493,_0x4929a4,_0x14dab9){if(!_[_0x98ca('0x1e')](_0x4929a4)&&intUtil[_0x98ca('0x1f')](_0x4929a4)){var _0x1c7cc5={'Email':_0x4929a4};var _0x51178e={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x14dab9['sobject'](_0x98ca('0x20'))[_0x98ca('0x21')](_0x1c7cc5,_0x51178e)[_0x98ca('0x22')]()['then'](function(_0x5bcd56){if(_0x5bcd56[_0x98ca('0x23')]){var _0x129b35=_['find'](_0x5bcd56,function(_0x5a7b48){return _0x5a7b48['Email']===_0x4929a4;});if(_0x129b35){logger[_0x98ca('0x24')](_0x98ca('0x25'),_0x4929a4);return BPromise['resolve']({'id':_0x129b35['Id'],'name':_0x129b35['Name']});}}else{logger[_0x98ca('0x24')](_0x98ca('0x26'),_0x4929a4);return _0x14dab9[_0x98ca('0x27')]()['then'](function(_0x58a12c){return BPromise[_0x98ca('0x28')]({'id':_0x58a12c[_0x98ca('0x29')],'name':_0x58a12c[_0x98ca('0x2a')]});});}});}else{logger['info'](_0x98ca('0x26'),_0x4929a4);return _0x14dab9['identity']()['then'](function(_0x6afd56){return BPromise[_0x98ca('0x28')]({'id':_0x6afd56[_0x98ca('0x29')],'name':_0x6afd56[_0x98ca('0x2a')]});});}}function getEndUser(_0xc5243e,_0x1a6ece,_0x530dca,_0x348c70,_0x49b1bc){var _0x56dd09={'$or':{'Phone':_0x348c70}};var _0x56ffcc={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x98ca('0x28')]()[_0x98ca('0x2b')](function(){logger[_0x98ca('0x24')](_0x98ca('0x2c'),_0x348c70,_0x1a6ece[_0x98ca('0x2d')]);switch(_0x1a6ece[_0x98ca('0x2d')]){case _0x98ca('0x2e'):var _0x2173a1=_['cloneDeep'](_0x56dd09);if(_0x1a6ece[_0x98ca('0x2f')]){var _0xb718f={};_0xb718f[_0x1a6ece[_0x98ca('0x2f')]]=_0x348c70;_['merge'](_0x2173a1[_0x98ca('0x30')],_0xb718f);}return _0x49b1bc['sobject']('Contact')[_0x98ca('0x21')](_0x2173a1,_0x56ffcc)[_0x98ca('0x22')]()['then'](function(_0x21e8ed){if(_0x21e8ed&&_0x21e8ed[_0x98ca('0x23')]){return _0x21e8ed;}else{var _0xd9b756=_[_0x98ca('0x31')](_0x56dd09);if(_0x1a6ece[_0x98ca('0x32')]){var _0x3c6328={};_0x3c6328[_0x1a6ece[_0x98ca('0x32')]]=_0x348c70;_[_0x98ca('0x33')](_0xd9b756[_0x98ca('0x30')],_0x3c6328);}return _0x49b1bc[_0x98ca('0x34')]('Lead')['find'](_0xd9b756,_0x56ffcc);}});case'account_contact_lead':var _0x5c7609=_[_0x98ca('0x31')](_0x56dd09);if(_0x1a6ece[_0x98ca('0x35')]){var _0xb718f={};_0xb718f[_0x1a6ece[_0x98ca('0x35')]]=_0x348c70;_[_0x98ca('0x33')](_0x5c7609[_0x98ca('0x30')],_0xb718f);}return _0x49b1bc[_0x98ca('0x34')]('Account')[_0x98ca('0x21')](_0x5c7609,_0x56ffcc)[_0x98ca('0x22')]()[_0x98ca('0x2b')](function(_0x16402b){if(_0x16402b&&_0x16402b[_0x98ca('0x23')]){return _0x16402b;}else{var _0x49f7f3=_[_0x98ca('0x31')](_0x56dd09);if(_0x1a6ece[_0x98ca('0x2f')]){var _0x233f56={};_0x233f56[_0x1a6ece[_0x98ca('0x2f')]]=_0x348c70;_[_0x98ca('0x33')](_0x49f7f3[_0x98ca('0x30')],_0x233f56);}return _0x49b1bc[_0x98ca('0x34')](_0x98ca('0x36'))['find'](_0x49f7f3,_0x56ffcc)[_0x98ca('0x2b')](function(_0x420284){if(_0x420284&&_0x420284[_0x98ca('0x23')]){return _0x420284;}else{var _0x9a9bff=_['cloneDeep'](_0x56dd09);if(_0x1a6ece[_0x98ca('0x32')]){var _0x27e701={};_0x27e701[_0x1a6ece[_0x98ca('0x32')]]=_0x348c70;_[_0x98ca('0x33')](_0x9a9bff[_0x98ca('0x30')],_0x27e701);}return _0x49b1bc[_0x98ca('0x34')](_0x98ca('0x37'))[_0x98ca('0x21')](_0x9a9bff,_0x56ffcc);}});}});case'contact':var _0x2173a1=_[_0x98ca('0x31')](_0x56dd09);if(_0x1a6ece[_0x98ca('0x2f')]){var _0xb718f={};_0xb718f[_0x1a6ece['additionalSearchContact']]=_0x348c70;_['merge'](_0x2173a1[_0x98ca('0x30')],_0xb718f);}return _0x49b1bc[_0x98ca('0x34')](_0x98ca('0x36'))[_0x98ca('0x21')](_0x2173a1,_0x56ffcc)[_0x98ca('0x22')]();case _0x98ca('0x1b'):var _0x4f0e30=_[_0x98ca('0x31')](_0x56dd09);if(_0x1a6ece[_0x98ca('0x32')]){var _0xb718f={};_0xb718f[_0x1a6ece[_0x98ca('0x32')]]=_0x348c70;_[_0x98ca('0x33')](_0x4f0e30['$or'],_0xb718f);}return _0x49b1bc['sobject'](_0x98ca('0x37'))['find'](_0x4f0e30,_0x56ffcc);case _0x98ca('0x38'):var _0x5c7609=_[_0x98ca('0x31')](_0x56dd09);if(_0x1a6ece[_0x98ca('0x35')]){var _0xb718f={};_0xb718f[_0x1a6ece[_0x98ca('0x35')]]=_0x348c70;_[_0x98ca('0x33')](_0x5c7609[_0x98ca('0x30')],_0xb718f);}return _0x49b1bc[_0x98ca('0x34')]('Account')[_0x98ca('0x21')](_0x5c7609,_0x56ffcc);default:return null;}})[_0x98ca('0x2b')](function(_0x1d85fa){if(_0x1d85fa&&_0x1d85fa[_0x98ca('0x23')]){var _0x3022e7=_[_0x98ca('0x39')](_0x1d85fa);if(_0x3022e7){return BPromise[_0x98ca('0x28')]({'id':_0x3022e7['Id'],'name':_0x3022e7['Name'],'phone':_0x3022e7[_0x98ca('0x3a')],'endUserType':_0x3022e7[_0x98ca('0x3b')][_0x98ca('0x3c')][_0x98ca('0x3d')]()});}}})[_0x98ca('0x2b')](function(_0x4322e0){if(_0x4322e0){logger[_0x98ca('0x24')](_0x98ca('0x3e'),_0x4322e0[_0x98ca('0x15')],_0x348c70);return BPromise[_0x98ca('0x28')](_0x4322e0);}else{logger[_0x98ca('0x24')](_0x98ca('0x3f'),_0x348c70);var _0x4fc7f4={'Phone':_0x348c70};if(_0x1a6ece[_0x98ca('0x40')]){if(_0x1a6ece[_0x98ca('0x40')]==='contact'){logger[_0x98ca('0x24')](_0x98ca('0x41'),_0x348c70,_0x1a6ece[_0x98ca('0x40')]);_0x4fc7f4[_0x98ca('0x42')]=_0x530dca!==_0x98ca('0x43')?_0x530dca:util[_0x98ca('0x44')](_0x98ca('0x45'),_0x348c70);}else if(_0x1a6ece[_0x98ca('0x40')]==='lead'){logger[_0x98ca('0x24')](_0x98ca('0x41'),_0x348c70,_0x1a6ece[_0x98ca('0x40')]);_0x4fc7f4[_0x98ca('0x42')]=_0x530dca!==_0x98ca('0x43')?_0x530dca:util[_0x98ca('0x44')](_0x98ca('0x45'),_0x348c70);_0x4fc7f4[_0x98ca('0x46')]=_0x98ca('0x47');}else if(_0x1a6ece[_0x98ca('0x40')]===_0x98ca('0x38')){logger['info'](_0x98ca('0x41'),_0x348c70,_0x1a6ece['moduleCreate']);_0x4fc7f4[_0x98ca('0x48')]=_0x530dca!==_0x98ca('0x43')?_0x530dca:util['format'](_0x98ca('0x45'),_0x348c70);}else{return null;}}return _0x49b1bc[_0x98ca('0x34')](_[_0x98ca('0x49')](_0x1a6ece[_0x98ca('0x40')]))[_0x98ca('0x4a')](_0x4fc7f4)[_0x98ca('0x2b')](function(_0x442cc9){return BPromise[_0x98ca('0x28')]({'id':_0x442cc9['id'],'endUserType':_0x1a6ece['moduleCreate']});});}});}function getCustomFields(_0x23cd27,_0x2276ae){var _0x1b2e02={};if(_0x23cd27[_0x98ca('0x23')]>0x0){_[_0x98ca('0x4b')](_0x23cd27,function(_0x1eba49){if(_['includes']([_0x98ca('0x4c'),_0x98ca('0x4d')],_0x1eba49[_0x98ca('0x3c')])&&_0x1eba49[_0x98ca('0x4e')]){_0x1b2e02[_0x1eba49[_0x98ca('0x4e')]]=_0x1eba49[_0x98ca('0x4f')][_0x98ca('0x50')]();}else if(_0x1eba49[_0x98ca('0x3c')]===_0x98ca('0x51')&&_0x1eba49['variableName']&&_0x1eba49[_0x98ca('0x4e')]){_0x2276ae[_0x1eba49[_0x98ca('0x52')]]&&(_0x1b2e02[_0x1eba49[_0x98ca('0x4e')]]=_0x2276ae[_0x1eba49[_0x98ca('0x52')]][_0x98ca('0x50')]());}else if(_0x1eba49[_0x98ca('0x3c')]===_0x98ca('0x53')&&_0x1eba49[_0x98ca('0x54')]&&_0x1eba49['Variable'][_0x98ca('0x55')]&&_0x1eba49[_0x98ca('0x4e')]){_0x2276ae[_0x1eba49[_0x98ca('0x54')]['name'][_0x98ca('0x3d')]()]&&(_0x1b2e02[_0x1eba49[_0x98ca('0x4e')]]=_0x2276ae[_0x1eba49[_0x98ca('0x54')][_0x98ca('0x55')]['toLowerCase']()]['toString']());}});}return _0x1b2e02;}function getConnection(_0x6db1f1){var _0x19baa0=_0x6db1f1['password'][_0x98ca('0x56')](_0x6db1f1[_0x98ca('0x57')]);var _0x359118=new jsforce[(_0x98ca('0x58'))]({'oauth2':{'loginUrl':_0x6db1f1[_0x98ca('0x59')]||_0x98ca('0x5a'),'clientId':_0x6db1f1[_0x98ca('0x5b')],'clientSecret':_0x6db1f1[_0x98ca('0x5c')]}});return _0x359118['login'](_0x6db1f1[_0x98ca('0x5d')],_0x19baa0)[_0x98ca('0x2b')](function(){logger[_0x98ca('0x24')](_0x98ca('0x5e'));return _0x359118;});}exports['queue']=function(_0xeb817f,_0x564c98,_0x256fde,_0x5dbd6a,_0xabb31a,_0x37a96c){var _0x78d74,_0xd421ca,_0x16cbac,_0x22bb19;_0x37a96c[_0x98ca('0x5f')]=intUtil['stripTrailingSlash'](_0x37a96c[_0x98ca('0x5f')]);_0x37a96c[_0x98ca('0x59')]=intUtil[_0x98ca('0x60')](_0x37a96c['remoteUri']);if(_0xabb31a&&_0xabb31a[_0x98ca('0x61')]){logger[_0x98ca('0x24')](_0x98ca('0x62'),_0x98ca('0x63'));_0x564c98['recordingURL']=util[_0x98ca('0x44')](_0x98ca('0x64'),_0x37a96c[_0x98ca('0x5f')],_0x564c98[_0x98ca('0x65')],md5(_0x564c98[_0x98ca('0x65')]));}else{_0x564c98[_0x98ca('0x66')]='';}return getConnection(_0x37a96c)[_0x98ca('0x2b')](function(_0x29ffa6){_0x22bb19=_0x29ffa6;return getUser(_0x37a96c,_0x5dbd6a['email'],_0x22bb19);})[_0x98ca('0x2b')](function(_0x1eef44){_0x78d74=_0x1eef44;return getEndUser(_0x37a96c,_0x256fde,_0x564c98[_0x98ca('0x67')],_0x564c98[_0x98ca('0x68')],_0x22bb19);})['then'](function(_0x369a6a){_0xd421ca=_0x369a6a;return getTicket(_0x37a96c,_0x78d74,_0xd421ca,_0x256fde,_0x564c98,_0x256fde[_0x98ca('0x69')],_0x22bb19,'queue');})['then'](function(_0x4df82a){_0x16cbac=_0x4df82a;logger['info'](_0x98ca('0x6a'),_0x16cbac['id']);logger[_0x98ca('0x24')](_0x98ca('0x6b'),_0x16cbac['id'],_0x5dbd6a[_0x98ca('0x55')],_0x37a96c[_0x98ca('0x3c')]);switch(_0x37a96c[_0x98ca('0x3c')]){case _0x98ca('0x6c'):emit(util[_0x98ca('0x44')]('user:%s',_0x5dbd6a[_0x98ca('0x55')]),_0x98ca('0x6d'),{'recordId':_0x16cbac['id']});break;case _0x98ca('0x6e'):emit(util['format'](_0x98ca('0x6f'),_0x5dbd6a['name']),_0x98ca('0x70'),{'uri':util[_0x98ca('0x44')]('%s/%s/e',_0x22bb19[_0x98ca('0x71')],_0x16cbac['id'])});break;default:logger[_0x98ca('0x72')](_0x98ca('0x73'));}})['catch'](function(_0x26104a){logger['error'](_0x98ca('0x62'),_0x26104a);});};exports[_0x98ca('0x74')]=function(_0x2e7fcb,_0x210340,_0x3f73e8,_0x5e596b,_0x50dd99,_0x2a2127,_0xf0a4d8){var _0x3d0424,_0x5a53dd,_0x123b65,_0x4e9201;_0x2a2127[_0x98ca('0x5f')]=intUtil[_0x98ca('0x60')](_0x2a2127[_0x98ca('0x5f')]);_0x2a2127[_0x98ca('0x59')]=intUtil[_0x98ca('0x60')](_0x2a2127[_0x98ca('0x59')]);if(_0xf0a4d8&&_0xf0a4d8[_0x98ca('0x75')]&&_0xf0a4d8[_0x98ca('0x75')]!==_0x98ca('0x76')){logger[_0x98ca('0x24')](_0x98ca('0x77'),_0x98ca('0x63'));_0x210340[_0x98ca('0x66')]=util['format'](_0x98ca('0x64'),_0x2a2127[_0x98ca('0x5f')],_0x210340[_0x98ca('0x65')],md5(_0x210340[_0x98ca('0x65')]));}return getConnection(_0x2a2127)['then'](function(_0x5593b4){_0x4e9201=_0x5593b4;return getUser(_0x2a2127,_0x5e596b['email'],_0x4e9201);})['then'](function(_0x233a92){_0x3d0424=_0x233a92;return getEndUser(_0x2a2127,_0x3f73e8,_0x210340['destcalleridname'],_0x210340[_0x98ca('0x78')],_0x4e9201);})[_0x98ca('0x2b')](function(_0x4bd9af){_0x5a53dd=_0x4bd9af;return getTicket(_0x2a2127,_0x3d0424,_0x5a53dd,_0x3f73e8,_0x210340,_0x3f73e8[_0x98ca('0x69')],_0x4e9201,'outbound');})[_0x98ca('0x2b')](function(_0x68da8a){_0x123b65=_0x68da8a;logger[_0x98ca('0x24')](_0x98ca('0x79'),_0x123b65['id']);logger[_0x98ca('0x24')](_0x98ca('0x7a'),_0x123b65['id'],_0x5e596b[_0x98ca('0x55')],_0x2a2127[_0x98ca('0x3c')]);switch(_0x2a2127[_0x98ca('0x3c')]){case'integrationTab':emit(util[_0x98ca('0x44')]('user:%s',_0x5e596b[_0x98ca('0x55')]),'trigger:salesforce:display',{'recordId':_0x123b65['id']});break;case _0x98ca('0x6e'):emit(util[_0x98ca('0x44')](_0x98ca('0x6f'),_0x5e596b['name']),_0x98ca('0x70'),{'uri':util['format'](_0x98ca('0x7b'),_0x4e9201[_0x98ca('0x71')],_0x123b65['id'])});break;default:logger[_0x98ca('0x72')](_0x98ca('0x77'),_0x98ca('0x7c'));}})[_0x98ca('0x7d')](function(_0x3eddae){logger['error'](_0x98ca('0x77'),_0x3eddae);});};exports['unmanaged']=function(_0x409a63,_0x32be06,_0x57172e,_0x267764,_0x2ca24a,_0xf7715e){var _0x466f88,_0x1b9ee6,_0x13a8d4,_0x2f5c95;_0xf7715e['serverUrl']=intUtil[_0x98ca('0x60')](_0xf7715e[_0x98ca('0x5f')]);_0xf7715e[_0x98ca('0x59')]=intUtil['stripTrailingSlash'](_0xf7715e['remoteUri']);if(_0x2ca24a&&_0x2ca24a[_0x98ca('0x61')]){logger[_0x98ca('0x24')]('['+_0x32be06[_0x98ca('0x7e')][_0x98ca('0x7f')]()+']',_0x98ca('0x63'));_0x32be06[_0x98ca('0x66')]=util[_0x98ca('0x44')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xf7715e[_0x98ca('0x5f')],_0x32be06['uniqueid'],md5(_0x32be06[_0x98ca('0x65')]));}else{_0x32be06[_0x98ca('0x66')]='';}return getConnection(_0xf7715e)[_0x98ca('0x2b')](function(_0x520a58){_0x2f5c95=_0x520a58;if(!_[_0x98ca('0x1e')](_0x267764)){return getUser(_0xf7715e,_0x267764['name'],_0x2f5c95);}else{return getUser(_0xf7715e,null,_0x2f5c95);}})['then'](function(_0x2242d8){_0x466f88=_0x2242d8;return getEndUser(_0xf7715e,_0x57172e,_0x32be06[_0x98ca('0x67')],_0x32be06['calleridnum'],_0x2f5c95);})['then'](function(_0x36c185){_0x1b9ee6=_0x36c185;return getTicket(_0xf7715e,_0x466f88,_0x1b9ee6,_0x57172e,_0x32be06,_0x57172e[_0x98ca('0x69')],_0x2f5c95);})[_0x98ca('0x2b')](function(_0x4224dc){_0x13a8d4=_0x4224dc;logger[_0x98ca('0x24')]('['+_0x32be06[_0x98ca('0x7e')][_0x98ca('0x7f')]()+_0x98ca('0x80'),_0x13a8d4['id']);logger[_0x98ca('0x24')]('['+_0x32be06[_0x98ca('0x7e')][_0x98ca('0x7f')]()+_0x98ca('0x81'),_0xf7715e[_0x98ca('0x3c')]);})['catch'](function(_0x140c75){logger['error']('['+_0x32be06[_0x98ca('0x7e')][_0x98ca('0x7f')]()+']',_0x140c75);});}; \ 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 fd3f66a..7930f38 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 _0x75f6=['sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','true','userId','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','includes','string','type','customField','nameField','toLowerCase','content','toString','picklist','idField','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident','Incident\x20-\x20','ticketNumber','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','serverUrl','stripTrailingSlash','%s/api/now/table/','isNil','email','adminEmail','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','util','md5','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','],\x20getAdminUser\x20crm','catch','error','toUpperCase','message','info','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x75f6,0x19b));var _0x675f=function(_0x2e301d,_0x1b1f2c){_0x2e301d=_0x2e301d-0x0;var _0x2967ab=_0x75f6[_0x2e301d];return _0x2967ab;};'use strict';var _=require(_0x675f('0x0'));var Promise=require('bluebird');var rp=require('request-promise');var util=require(_0x675f('0x1'));var md5=require(_0x675f('0x2'));var Redis=require('ioredis');var intUtil=require(_0x675f('0x3'));var config=require(_0x675f('0x4'));var logger=require(_0x675f('0x5'))(_0x675f('0x6'));config[_0x675f('0x7')]=_['defaults'](config['redis'],{'host':_0x675f('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x675f('0x7')]));function getAdminUser(_0x523af9,_0x138317,_0x4fd006,_0x2e3390,_0x14fbd2,_0x5e87b2){return new Promise(function(_0x29a411,_0x30f780){var _0x47f7a8={'method':'GET','uri':_0x2e3390+_0x675f('0x9')+'&'+_0x14fbd2+'&'+_0x5e87b2,'auth':_0x138317,'json':!![]};return rp(_0x47f7a8)[_0x675f('0xa')](function(_0x3cd9f4){if(_0x3cd9f4[_0x675f('0xb')][_0x675f('0xc')]>0x0){_0x4fd006[_0x675f('0xd')]=_0x3cd9f4['result'][0x0][_0x675f('0xe')];}logger['info']('['+[_0x523af9['toUpperCase']()]+_0x675f('0xf'),_0x4fd006);_0x29a411(_0x4fd006);})[_0x675f('0x10')](function(_0x5bfeb5){logger[_0x675f('0x11')]('['+[_0x523af9[_0x675f('0x12')]()]+']',_0x5bfeb5[_0x675f('0x13')]);_0x30f780(_0x5bfeb5[_0x675f('0x13')]);});});}function getUser(_0x5523e5,_0x537e62,_0x47c663,_0x41dd06,_0x2e4312){return function(_0x2cdbc3){logger[_0x675f('0x14')]('['+[_0x5523e5[_0x675f('0x12')]()]+_0x675f('0x15'),_0x2cdbc3);return new Promise(function(_0x18b25b,_0x151bee){if(intUtil[_0x675f('0x16')](_0x2cdbc3[_0x675f('0x17')])){var _0x56701f={'method':_0x675f('0x18'),'uri':_0x47c663+_0x675f('0x19')+_0x2cdbc3[_0x675f('0x17')]+'&'+_0x41dd06+'&'+_0x2e4312,'auth':_0x537e62,'json':!![]};logger[_0x675f('0x14')]('['+[_0x5523e5['toUpperCase']()]+_0x675f('0x1a'),_0x56701f);return rp(_0x56701f)[_0x675f('0xa')](function(_0x4686ca){logger[_0x675f('0x14')]('['+[_0x5523e5['toUpperCase']()]+_0x675f('0x1b'),_0x4686ca);if(_0x4686ca[_0x675f('0xb')][_0x675f('0xc')]>0x0&&String(_0x4686ca[_0x675f('0xb')][0x0]['active'])===_0x675f('0x1c')){_0x2cdbc3[_0x675f('0x1d')]=_0x4686ca[_0x675f('0xb')][0x0][_0x675f('0xe')];}else{_0x2cdbc3[_0x675f('0x1d')]=_0x2cdbc3['adminId'];_0x2cdbc3['userEmail']=_0x2cdbc3['adminEmail'];}logger['info']('['+[_0x5523e5[_0x675f('0x12')]()]+_0x675f('0x1e'),_0x2cdbc3);_0x18b25b(_0x2cdbc3);})['catch'](function(_0x2ab423){logger[_0x675f('0x11')]('['+[_0x5523e5[_0x675f('0x12')]()]+']',_0x2ab423['message']);_0x151bee(_0x2ab423[_0x675f('0x13')]);});}else{logger[_0x675f('0x14')]('['+[_0x5523e5['toUpperCase']()]+_0x675f('0x1f'));_0x2cdbc3[_0x675f('0x1d')]=_0x2cdbc3[_0x675f('0xd')];_0x2cdbc3[_0x675f('0x17')]=_0x2cdbc3['adminEmail'];_0x18b25b(_0x2cdbc3);}});};}function createEndUser(_0x38cf7a,_0x28c9a9,_0xe9f750,_0x581506,_0xcd4db){logger['info']('['+[_0x38cf7a[_0x675f('0x12')]()]+_0x675f('0x20'),_0xe9f750);return new Promise(function(_0x11e975,_0x398d84){var _0x7469d={'method':_0x675f('0x21'),'uri':_0x581506+'sys_user?'+_0xcd4db,'body':{'user_name':_0xe9f750[_0x675f('0x22')],'roles':'user','first_name':_0xe9f750['endUserNumber'],'active':_0x675f('0x1c'),'date_format':_0x675f('0x23'),'phone':_0xe9f750[_0x675f('0x22')]},'auth':_0x28c9a9,'json':!![]};return rp(_0x7469d)[_0x675f('0xa')](function(_0xa90d70){logger[_0x675f('0x14')]('['+[_0x38cf7a[_0x675f('0x12')]()]+_0x675f('0x24'),_0xa90d70['result']);_0xe9f750[_0x675f('0x25')]=_0xa90d70[_0x675f('0xb')]['sys_id'];_0x11e975(_0xe9f750);})['catch'](function(_0x16d288){logger[_0x675f('0x11')]('['+[_0x38cf7a[_0x675f('0x12')]()]+']',_0x16d288[_0x675f('0x13')]);_0x398d84(_0x16d288['message']);});});}function getEndUser(_0x612361,_0x1f3cf7,_0x18e326,_0x585c9c,_0x5bcdaa){return function(_0x1772c5){logger[_0x675f('0x14')]('['+[_0x612361[_0x675f('0x12')]()]+_0x675f('0x26'),_0x1772c5);return new Promise(function(_0x438412,_0x32cc79){var _0x29e660={'method':'GET','uri':_0x18e326+_0x675f('0x27')+_0x1772c5[_0x675f('0x22')]+'&'+_0x585c9c+'&'+_0x5bcdaa,'auth':_0x1f3cf7,'json':!![]};return rp(_0x29e660)[_0x675f('0xa')](function(_0x945aa4){if(_0x945aa4[_0x675f('0xb')][_0x675f('0xc')]>0x0){_0x1772c5[_0x675f('0x25')]=_0x945aa4[_0x675f('0xb')][0x0][_0x675f('0xe')];logger['info']('['+[_0x612361[_0x675f('0x12')]()]+_0x675f('0x28'),_0x1772c5);_0x438412(_0x1772c5);}else{return createEndUser(_0x612361,_0x1f3cf7,_0x1772c5,_0x18e326,_0x585c9c)[_0x675f('0xa')](function(_0x23a341){logger[_0x675f('0x14')]('['+[_0x612361['toUpperCase']()]+_0x675f('0x29'),_0x23a341);_0x438412(_0x23a341);});}})[_0x675f('0x10')](function(_0x3b89f5){logger[_0x675f('0x11')]('['+[_0x612361[_0x675f('0x12')]()]+']',_0x3b89f5[_0x675f('0x13')]);_0x32cc79(_0x3b89f5[_0x675f('0x13')]);});});};}function getCustomFields(_0x14d47b,_0x417dff){var _0x3fc0e8={};if(_0x14d47b[_0x675f('0xc')]>0x0){_['forEach'](_0x14d47b,function(_0x116d27){if(_[_0x675f('0x2a')]([_0x675f('0x2b'),'picklist'],_0x116d27[_0x675f('0x2c')])&&_0x116d27['nameField']&&!_0x116d27[_0x675f('0x2d')]){_0x3fc0e8[_0x116d27[_0x675f('0x2e')][_0x675f('0x2f')]()]=_0x116d27[_0x675f('0x30')][_0x675f('0x31')]();}else if(_[_0x675f('0x2a')]([_0x675f('0x2b'),_0x675f('0x32')],_0x116d27[_0x675f('0x2c')])&&_0x116d27[_0x675f('0x33')]&&_0x116d27['customField']){_0x3fc0e8[_0x116d27[_0x675f('0x33')]['toLowerCase']()]=_0x116d27['content'][_0x675f('0x31')]();}else if(_0x116d27[_0x675f('0x2c')]==='variable'&&_0x116d27[_0x675f('0x34')]&&_0x116d27[_0x675f('0x33')]&&_0x116d27[_0x675f('0x2d')]){_0x3fc0e8[_0x116d27[_0x675f('0x33')][_0x675f('0x2f')]()]=_0x417dff[_0x116d27[_0x675f('0x34')]][_0x675f('0x31')]();}else if(_0x116d27[_0x675f('0x2c')]==='customVariable'&&_0x116d27[_0x675f('0x35')]&&_0x116d27['Variable'][_0x675f('0x36')]&&_0x116d27[_0x675f('0x33')]&&_0x116d27[_0x675f('0x2d')]){_0x3fc0e8[_0x116d27['idField'][_0x675f('0x2f')]()]=_0x417dff[_0x116d27[_0x675f('0x35')][_0x675f('0x36')]['toLowerCase']()]['toString']();}});}return _0x3fc0e8;}function getTicket(_0x4ff04b,_0x14d812,_0x292c00,_0x17f806,_0x218972,_0x1b73a3){return function(_0x5c7893){logger[_0x675f('0x14')]('['+[_0x4ff04b['toUpperCase']()]+_0x675f('0x37'),_0x5c7893);return new Promise(function(_0x261fdd,_0x4914ab){var _0x42ca55=_0x4ff04b['toLowerCase']()===_0x675f('0x38')?_0x5c7893[_0x675f('0x1d')]:_0x5c7893[_0x675f('0x25')];var _0x49836d={'method':_0x675f('0x21'),'uri':_0x292c00+_0x675f('0x39')+'?'+_0x1b73a3,'body':Object[_0x675f('0x3a')]({},{'active':_0x675f('0x1c'),'caller_id':_0x42ca55,'assigned_to':_0x5c7893[_0x675f('0x1d')],'short_description':intUtil[_0x675f('0x3b')](_0x17f806[_0x675f('0x3c')],_0x218972,'\x20'),'description':intUtil['getString'](_0x17f806['Descriptions'],_0x218972,'\x0a')},getCustomFields(_0x17f806[_0x675f('0x3d')],_0x218972)),'auth':_0x14d812,'json':!![]};return rp(_0x49836d)[_0x675f('0xa')](function(_0x124451){logger[_0x675f('0x14')]('['+[_0x4ff04b[_0x675f('0x12')]()]+_0x675f('0x3e'),_0x124451[_0x675f('0xb')]);_0x5c7893[_0x675f('0x3f')]=_0x124451[_0x675f('0xb')][_0x675f('0xe')];_0x5c7893['ticketNumber']=_0x124451[_0x675f('0xb')][_0x675f('0x40')];logger[_0x675f('0x14')]('['+[_0x4ff04b['toUpperCase']()]+_0x675f('0x41'),_0x5c7893);_0x261fdd(_0x5c7893);})['catch'](function(_0x194a42){logger[_0x675f('0x11')]('['+[_0x4ff04b[_0x675f('0x12')]()]+']',_0x194a42[_0x675f('0x13')]);_0x4914ab(_0x194a42[_0x675f('0x13')]);});});};}function createRemoteTag(_0x4c44bd,_0x1afe11,_0x598217,_0x28ea90){return new Promise(function(_0x35f954,_0x16902e){var _0x206c34={'method':'POST','uri':_0x598217+_0x675f('0x42')+'?'+_0x28ea90,'body':{'short_description':_0x4c44bd,'global':!![],'active':!![],'name':_0x4c44bd},'auth':_0x1afe11,'json':!![]};return rp(_0x206c34)[_0x675f('0xa')](function(_0x3511cc){var _0x1bccd6=_0x3511cc[_0x675f('0xb')]['sys_id'];_0x35f954(_0x1bccd6);});});}function getRemoteTag(_0x58bd9a,_0x40718b,_0x490bad,_0x447fa5,_0x1aaa55){return new Promise(function(_0x1e4546,_0x1fc50c){var _0x39f163={'method':_0x675f('0x18'),'uri':_0x490bad+'label'+_0x675f('0x43')+_0x58bd9a+'&'+_0x447fa5,'auth':_0x40718b,'json':!![]};return rp(_0x39f163)[_0x675f('0xa')](function(_0x398a5f){if(_0x398a5f[_0x675f('0xb')][_0x675f('0xc')]>0x0){var _0x1009fd=_0x398a5f[_0x675f('0xb')][0x0]['sys_id'];_0x1e4546(_0x1009fd);}else{return createRemoteTag(_0x58bd9a,_0x40718b,_0x490bad,_0x447fa5)['then'](function(_0x38af59){_0x1e4546(_0x38af59);});}});});}function assignTagToIncident(_0x9a141c,_0x4ab612,_0x48523a,_0x4eb96a,_0x487b70){return new Promise(function(_0x326851,_0x4003dc){var _0xd06c85={'method':_0x675f('0x21'),'uri':_0x48523a+'label_entry'+'?'+_0x487b70,'body':{'label':_0x9a141c,'table':_0x675f('0x39'),'id_type':_0x675f('0x44'),'table_key':_0x4eb96a[_0x675f('0x3f')],'title':_0x675f('0x45')+_0x4eb96a[_0x675f('0x46')],'id_display':_0x4eb96a[_0x675f('0x46')]},'auth':_0x4ab612,'json':!![]};return rp(_0xd06c85)[_0x675f('0xa')](function(_0x1204f4){_0x326851();})[_0x675f('0x10')](function(){_0x326851();});});}function manageTags(_0x207a94,_0x1e00cc,_0x2fd437,_0x21f84c,_0x4d826e,_0xa53519,_0x35d52f){return new Promise(function(_0x5a6d57,_0x5ef644){var _0x3ed88f=[];_0x1e00cc[_0x675f('0x47')](function(_0x3ac95d){_0x3ed88f[_0x675f('0x48')](getRemoteTag(_0x3ac95d,_0x2fd437,_0x21f84c,_0xa53519,_0x35d52f));});return Promise[_0x675f('0x49')](_0x3ed88f)['then'](function(_0x464d73){if(_0x464d73[_0x675f('0xc')]){logger['info']('['+[_0x207a94[_0x675f('0x12')]()]+_0x675f('0x4a'),_0x464d73);var _0x23de7f=[];_0x464d73[_0x675f('0x47')](function(_0x38917f){_0x23de7f[_0x675f('0x48')](assignTagToIncident(_0x38917f,_0x2fd437,_0x21f84c,_0x4d826e,_0xa53519));});return Promise[_0x675f('0x49')](_0x23de7f)[_0x675f('0xa')](function(){_0x5a6d57();})['catch'](function(){_0x5a6d57();});}else{_0x5a6d57();}});});}function getTags(_0x2811a4,_0x5b9d51,_0x4dabe5,_0x3994c1,_0x472823,_0x37a4a1){return function(_0x581fd5){return new Promise(function(_0x5fbf1b,_0x136d15){var _0x2bdb72=[];var _0x3f0b4b=_0x3994c1[_0x675f('0x4b')];if(_0x3f0b4b&&_0x3f0b4b['length']>0x0){_0x2bdb72=_[_0x675f('0x4c')](_0x3f0b4b,_0x675f('0x36'));}if(_0x2bdb72['length']>0x0){return manageTags(_0x2811a4,_0x2bdb72,_0x5b9d51,_0x4dabe5,_0x581fd5,_0x472823,_0x37a4a1)[_0x675f('0xa')](function(){_0x5fbf1b(_0x581fd5);});}else{_0x5fbf1b(_0x581fd5);}});};}function emit(_0x3b0f71,_0x17c0fe,_0x574939){var _0x58bcae=_0x675f('0x4d')+_0x675f('0x4e')+_0x675f('0x4f')+'%255EORDERBYDESCnumber';var _0x441e63={'uri':_0x3b0f71+_0x675f('0x50')+_0x574939+_0x58bcae};io['to'](util[_0x675f('0x51')]('user:%s',_0x17c0fe))[_0x675f('0x52')](_0x675f('0x53'),_0x441e63);}exports['cs']=function(_0x489c61,_0x154106,_0x71d63b,_0x17da1d,_0x13def1,_0x3118d3,_0x1ad874,_0x4cc55d){var _0x5647f5={};var _0x23bf85={'user':_0x3118d3[_0x675f('0x54')],'pass':_0x3118d3[_0x675f('0x55')]};var _0x4cecc7=_0x675f('0x56');var _0x3b9f62=_0x675f('0x57');_0x3118d3[_0x675f('0x58')]=intUtil['stripTrailingSlash'](_0x3118d3[_0x675f('0x58')]);_0x3118d3[_0x675f('0x59')]=intUtil[_0x675f('0x5a')](_0x3118d3[_0x675f('0x59')]);var _0x5e3ef6=util['format'](_0x675f('0x5b'),_0x3118d3[_0x675f('0x58')]);_0x5647f5[_0x675f('0x17')]=!_[_0x675f('0x5c')](_0x17da1d)?_0x17da1d[_0x675f('0x5d')]:null;_0x5647f5[_0x675f('0x5e')]=_0x3118d3['email'];_0x5647f5[_0x675f('0x22')]=_0x4cc55d['toLowerCase']()===_0x675f('0x38')?_0x154106['destcalleridnum']:_0x154106[_0x675f('0x5f')];_0x5647f5[_0x675f('0x60')]=_0x4cc55d==='queue'||_0x4cc55d===_0x675f('0x61')?_0x675f('0x62'):_0x675f('0x38');var _0x514cee=util[_0x675f('0x51')](_0x675f('0x63'),_0x3118d3[_0x675f('0x59')],_0x154106[_0x675f('0x64')],md5(_0x154106['uniqueid']));if(_0x13def1&&_0x13def1['monitor_format']){logger[_0x675f('0x14')](_0x675f('0x65'),_0x675f('0x66'));_0x154106['recordingURL']=_0x514cee;}else if(_0x1ad874&&_0x1ad874[_0x675f('0x67')]&&_0x1ad874[_0x675f('0x67')]!=='none'){logger[_0x675f('0x14')](_0x675f('0x68'),_0x675f('0x66'));_0x154106[_0x675f('0x69')]=_0x514cee;}else{_0x154106[_0x675f('0x69')]='';}return getAdminUser(_0x4cc55d,_0x23bf85,_0x5647f5,_0x5e3ef6,_0x3b9f62,_0x4cecc7)['then'](getUser(_0x4cc55d,_0x23bf85,_0x5e3ef6,_0x3b9f62,_0x4cecc7))['then'](getEndUser(_0x4cc55d,_0x23bf85,_0x5e3ef6,_0x3b9f62,_0x4cecc7))[_0x675f('0xa')](getTicket(_0x4cc55d,_0x23bf85,_0x5e3ef6,_0x71d63b,_0x154106,_0x3b9f62))[_0x675f('0xa')](function(_0x29901a){logger[_0x675f('0x14')](util[_0x675f('0x51')](_0x675f('0x6a'),_0x29901a[_0x675f('0x3f')]));logger['info'](util[_0x675f('0x51')]('call\x20direction:\x20%s',_0x4cc55d));if(_0x4cc55d!=='unmanaged'){logger[_0x675f('0x14')]('['+[_0x4cc55d[_0x675f('0x12')]()]+']',_0x675f('0x6b'));emit(_0x3118d3['remoteUri'],_0x17da1d[_0x675f('0x36')],_0x29901a[_0x675f('0x3f')]);}})[_0x675f('0x10')](function(_0x49ef66){logger[_0x675f('0x11')]('['+[_0x4cc55d[_0x675f('0x12')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x675f('0x6c')](_0x49ef66,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe29e=['endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','forEach','includes','string','picklist','type','nameField','content','idField','customField','variableName','toLowerCase','customVariable','Variable','toString',']\x20getTicket\x20input\x20crm','outbound','assign','true','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','label','label_entry','Incident\x20-\x20','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','username','password','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','defaults','redis','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','active','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST'];(function(_0x232a66,_0x23b5f6){var _0x59c437=function(_0x547fda){while(--_0x547fda){_0x232a66['push'](_0x232a66['shift']());}};_0x59c437(++_0x23b5f6);}(_0xe29e,0x188));var _0xee29=function(_0xd264a4,_0x264031){_0xd264a4=_0xd264a4-0x0;var _0x515d04=_0xe29e[_0xd264a4];return _0x515d04;};'use strict';var _=require('lodash');var Promise=require(_0xee29('0x0'));var rp=require(_0xee29('0x1'));var util=require(_0xee29('0x2'));var md5=require(_0xee29('0x3'));var Redis=require(_0xee29('0x4'));var intUtil=require(_0xee29('0x5'));var config=require(_0xee29('0x6'));var logger=require(_0xee29('0x7'))(_0xee29('0x8'));config['redis']=_[_0xee29('0x9')](config[_0xee29('0xa')],{'host':_0xee29('0xb'),'port':0x18eb});var io=require(_0xee29('0xc'))(new Redis(config[_0xee29('0xa')]));function getAdminUser(_0x2a55d5,_0x24f81f,_0x4622a5,_0x113ba4,_0x291bc5,_0x2d8d74){return new Promise(function(_0x5edc84,_0x1a6406){var _0x30d8d1={'method':'GET','uri':_0x113ba4+_0xee29('0xd')+'&'+_0x291bc5+'&'+_0x2d8d74,'auth':_0x24f81f,'json':!![]};return rp(_0x30d8d1)['then'](function(_0x3323b0){if(_0x3323b0[_0xee29('0xe')][_0xee29('0xf')]>0x0){_0x4622a5[_0xee29('0x10')]=_0x3323b0['result'][0x0][_0xee29('0x11')];}logger[_0xee29('0x12')]('['+[_0x2a55d5[_0xee29('0x13')]()]+_0xee29('0x14'),_0x4622a5);_0x5edc84(_0x4622a5);})[_0xee29('0x15')](function(_0x139298){logger[_0xee29('0x16')]('['+[_0x2a55d5['toUpperCase']()]+']',_0x139298[_0xee29('0x17')]);_0x1a6406(_0x139298[_0xee29('0x17')]);});});}function getUser(_0x3b5436,_0x29414,_0x34750e,_0x2add6f,_0x4a2da0){return function(_0x4d6aab){logger[_0xee29('0x12')]('['+[_0x3b5436[_0xee29('0x13')]()]+'],\x20getUser\x20input\x20crm',_0x4d6aab);return new Promise(function(_0x45b201,_0x536554){if(intUtil['validateEmail'](_0x4d6aab[_0xee29('0x18')])){var _0xf134c8={'method':_0xee29('0x19'),'uri':_0x34750e+_0xee29('0x1a')+_0x4d6aab[_0xee29('0x18')]+'&'+_0x2add6f+'&'+_0x4a2da0,'auth':_0x29414,'json':!![]};logger[_0xee29('0x12')]('['+[_0x3b5436[_0xee29('0x13')]()]+_0xee29('0x1b'),_0xf134c8);return rp(_0xf134c8)[_0xee29('0x1c')](function(_0x460321){logger[_0xee29('0x12')]('['+[_0x3b5436[_0xee29('0x13')]()]+'],\x20getUser\x20entity',_0x460321);if(_0x460321[_0xee29('0xe')]['length']>0x0&&String(_0x460321[_0xee29('0xe')][0x0][_0xee29('0x1d')])==='true'){_0x4d6aab[_0xee29('0x1e')]=_0x460321[_0xee29('0xe')][0x0][_0xee29('0x11')];}else{_0x4d6aab[_0xee29('0x1e')]=_0x4d6aab[_0xee29('0x10')];_0x4d6aab[_0xee29('0x18')]=_0x4d6aab[_0xee29('0x1f')];}logger[_0xee29('0x12')]('['+[_0x3b5436[_0xee29('0x13')]()]+_0xee29('0x20'),_0x4d6aab);_0x45b201(_0x4d6aab);})[_0xee29('0x15')](function(_0x383855){logger[_0xee29('0x16')]('['+[_0x3b5436['toUpperCase']()]+']',_0x383855['message']);_0x536554(_0x383855['message']);});}else{logger[_0xee29('0x12')]('['+[_0x3b5436[_0xee29('0x13')]()]+_0xee29('0x21'));_0x4d6aab[_0xee29('0x1e')]=_0x4d6aab[_0xee29('0x10')];_0x4d6aab['userEmail']=_0x4d6aab[_0xee29('0x1f')];_0x45b201(_0x4d6aab);}});};}function createEndUser(_0x26cc1d,_0x4c6672,_0x2924ed,_0x4fc49b,_0x4402dc){logger[_0xee29('0x12')]('['+[_0x26cc1d[_0xee29('0x13')]()]+_0xee29('0x22'),_0x2924ed);return new Promise(function(_0x8bd5b6,_0x3fa662){var _0x10e65f={'method':_0xee29('0x23'),'uri':_0x4fc49b+'sys_user?'+_0x4402dc,'body':{'user_name':_0x2924ed[_0xee29('0x24')],'roles':_0xee29('0x25'),'first_name':_0x2924ed[_0xee29('0x24')],'active':'true','date_format':_0xee29('0x26'),'phone':_0x2924ed['endUserNumber']},'auth':_0x4c6672,'json':!![]};return rp(_0x10e65f)[_0xee29('0x1c')](function(_0x2ffed1){logger[_0xee29('0x12')]('['+[_0x26cc1d[_0xee29('0x13')]()]+_0xee29('0x27'),_0x2ffed1['result']);_0x2924ed[_0xee29('0x28')]=_0x2ffed1['result'][_0xee29('0x11')];_0x8bd5b6(_0x2924ed);})[_0xee29('0x15')](function(_0x19e4df){logger['error']('['+[_0x26cc1d[_0xee29('0x13')]()]+']',_0x19e4df[_0xee29('0x17')]);_0x3fa662(_0x19e4df[_0xee29('0x17')]);});});}function getEndUser(_0x57362e,_0x5037cc,_0x4dfa0f,_0x5c0f6c,_0x2b5a28){return function(_0x6ac50e){logger[_0xee29('0x12')]('['+[_0x57362e[_0xee29('0x13')]()]+'],\x20getEndUser\x20input\x20crm',_0x6ac50e);return new Promise(function(_0xd2f74c,_0x52d715){var _0xdc4e28={'method':_0xee29('0x19'),'uri':_0x4dfa0f+_0xee29('0x29')+_0x6ac50e[_0xee29('0x24')]+'&'+_0x5c0f6c+'&'+_0x2b5a28,'auth':_0x5037cc,'json':!![]};return rp(_0xdc4e28)[_0xee29('0x1c')](function(_0x315f9d){if(_0x315f9d['result'][_0xee29('0xf')]>0x0){_0x6ac50e[_0xee29('0x28')]=_0x315f9d['result'][0x0][_0xee29('0x11')];logger[_0xee29('0x12')]('['+[_0x57362e[_0xee29('0x13')]()]+_0xee29('0x2a'),_0x6ac50e);_0xd2f74c(_0x6ac50e);}else{return createEndUser(_0x57362e,_0x5037cc,_0x6ac50e,_0x4dfa0f,_0x5c0f6c)[_0xee29('0x1c')](function(_0x163a5d){logger[_0xee29('0x12')]('['+[_0x57362e[_0xee29('0x13')]()]+'],\x20createEndUser\x20crm',_0x163a5d);_0xd2f74c(_0x163a5d);});}})[_0xee29('0x15')](function(_0x3d4842){logger[_0xee29('0x16')]('['+[_0x57362e[_0xee29('0x13')]()]+']',_0x3d4842[_0xee29('0x17')]);_0x52d715(_0x3d4842[_0xee29('0x17')]);});});};}function getCustomFields(_0x5567c8,_0x3a4013){var _0x5dc802={};if(_0x5567c8[_0xee29('0xf')]>0x0){_[_0xee29('0x2b')](_0x5567c8,function(_0xb9161a){if(_[_0xee29('0x2c')]([_0xee29('0x2d'),_0xee29('0x2e')],_0xb9161a[_0xee29('0x2f')])&&_0xb9161a[_0xee29('0x30')]&&!_0xb9161a['customField']){_0x5dc802[_0xb9161a['nameField']['toLowerCase']()]=_0xb9161a[_0xee29('0x31')]['toString']();}else if(_['includes']([_0xee29('0x2d'),_0xee29('0x2e')],_0xb9161a[_0xee29('0x2f')])&&_0xb9161a[_0xee29('0x32')]&&_0xb9161a[_0xee29('0x33')]){_0x5dc802[_0xb9161a['idField']['toLowerCase']()]=_0xb9161a[_0xee29('0x31')]['toString']();}else if(_0xb9161a[_0xee29('0x2f')]==='variable'&&_0xb9161a[_0xee29('0x34')]&&_0xb9161a[_0xee29('0x32')]&&_0xb9161a['customField']){_0x5dc802[_0xb9161a[_0xee29('0x32')][_0xee29('0x35')]()]=_0x3a4013[_0xb9161a['variableName']]['toString']();}else if(_0xb9161a[_0xee29('0x2f')]===_0xee29('0x36')&&_0xb9161a[_0xee29('0x37')]&&_0xb9161a[_0xee29('0x37')]['name']&&_0xb9161a[_0xee29('0x32')]&&_0xb9161a['customField']){_0x5dc802[_0xb9161a[_0xee29('0x32')][_0xee29('0x35')]()]=_0x3a4013[_0xb9161a[_0xee29('0x37')]['name'][_0xee29('0x35')]()][_0xee29('0x38')]();}});}return _0x5dc802;}function getTicket(_0x324e16,_0x407695,_0x4e3fcf,_0x4f1205,_0x5098ce,_0x16ac21){return function(_0x2aba35){logger[_0xee29('0x12')]('['+[_0x324e16[_0xee29('0x13')]()]+_0xee29('0x39'),_0x2aba35);return new Promise(function(_0x585538,_0x47fb41){var _0x2f4402=_0x324e16[_0xee29('0x35')]()===_0xee29('0x3a')?_0x2aba35['userId']:_0x2aba35[_0xee29('0x28')];var _0x46c82={'method':_0xee29('0x23'),'uri':_0x4e3fcf+'incident'+'?'+_0x16ac21,'body':Object[_0xee29('0x3b')]({},{'active':_0xee29('0x3c'),'caller_id':_0x2f4402,'assigned_to':_0x2aba35[_0xee29('0x1e')],'short_description':intUtil[_0xee29('0x3d')](_0x4f1205[_0xee29('0x3e')],_0x5098ce,'\x20'),'description':intUtil['getString'](_0x4f1205['Descriptions'],_0x5098ce,'\x0a')},getCustomFields(_0x4f1205[_0xee29('0x3f')],_0x5098ce)),'auth':_0x407695,'json':!![]};return rp(_0x46c82)['then'](function(_0x5d8d12){logger[_0xee29('0x12')]('['+[_0x324e16[_0xee29('0x13')]()]+_0xee29('0x40'),_0x5d8d12[_0xee29('0xe')]);_0x2aba35[_0xee29('0x41')]=_0x5d8d12[_0xee29('0xe')][_0xee29('0x11')];_0x2aba35[_0xee29('0x42')]=_0x5d8d12[_0xee29('0xe')]['number'];logger[_0xee29('0x12')]('['+[_0x324e16[_0xee29('0x13')]()]+']\x20getTicket\x20crm',_0x2aba35);_0x585538(_0x2aba35);})[_0xee29('0x15')](function(_0x390869){logger['error']('['+[_0x324e16['toUpperCase']()]+']',_0x390869[_0xee29('0x17')]);_0x47fb41(_0x390869[_0xee29('0x17')]);});});};}function createRemoteTag(_0x1026af,_0x6da76e,_0x1b14eb,_0x48ac24){return new Promise(function(_0xf662a1,_0x128738){var _0x3bc110={'method':'POST','uri':_0x1b14eb+'label'+'?'+_0x48ac24,'body':{'short_description':_0x1026af,'global':!![],'active':!![],'name':_0x1026af},'auth':_0x6da76e,'json':!![]};return rp(_0x3bc110)[_0xee29('0x1c')](function(_0x3c030f){var _0x394040=_0x3c030f[_0xee29('0xe')][_0xee29('0x11')];_0xf662a1(_0x394040);});});}function getRemoteTag(_0x3c4d9d,_0x5663f0,_0x13f49b,_0x2f04ff,_0x9cf895){return new Promise(function(_0x393dec,_0xb378e7){var _0x54fde7={'method':'GET','uri':_0x13f49b+_0xee29('0x43')+'?sysparm_query=name%3D'+_0x3c4d9d+'&'+_0x2f04ff,'auth':_0x5663f0,'json':!![]};return rp(_0x54fde7)[_0xee29('0x1c')](function(_0x5a2598){if(_0x5a2598[_0xee29('0xe')]['length']>0x0){var _0x3d088b=_0x5a2598[_0xee29('0xe')][0x0]['sys_id'];_0x393dec(_0x3d088b);}else{return createRemoteTag(_0x3c4d9d,_0x5663f0,_0x13f49b,_0x2f04ff)[_0xee29('0x1c')](function(_0x3476f8){_0x393dec(_0x3476f8);});}});});}function assignTagToIncident(_0xa4101b,_0x31d3b6,_0x285f7b,_0x526c55,_0x4f6827){return new Promise(function(_0x13b88c,_0x32b33c){var _0x3059d0={'method':_0xee29('0x23'),'uri':_0x285f7b+_0xee29('0x44')+'?'+_0x4f6827,'body':{'label':_0xa4101b,'table':'incident','id_type':'Incident','table_key':_0x526c55[_0xee29('0x41')],'title':_0xee29('0x45')+_0x526c55[_0xee29('0x42')],'id_display':_0x526c55['ticketNumber']},'auth':_0x31d3b6,'json':!![]};return rp(_0x3059d0)[_0xee29('0x1c')](function(_0x118396){_0x13b88c();})[_0xee29('0x15')](function(){_0x13b88c();});});}function manageTags(_0x36c3a5,_0x3f5592,_0x48eb2f,_0x106793,_0x463a76,_0x256ab3,_0x11c99d){return new Promise(function(_0x51728d,_0x1d8509){var _0x4fa906=[];_0x3f5592[_0xee29('0x2b')](function(_0xf37db0){_0x4fa906[_0xee29('0x46')](getRemoteTag(_0xf37db0,_0x48eb2f,_0x106793,_0x256ab3,_0x11c99d));});return Promise[_0xee29('0x47')](_0x4fa906)['then'](function(_0x1acd36){if(_0x1acd36[_0xee29('0xf')]){logger[_0xee29('0x12')]('['+[_0x36c3a5['toUpperCase']()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x1acd36);var _0x1fc0b3=[];_0x1acd36[_0xee29('0x2b')](function(_0x843a84){_0x1fc0b3[_0xee29('0x46')](assignTagToIncident(_0x843a84,_0x48eb2f,_0x106793,_0x463a76,_0x256ab3));});return Promise[_0xee29('0x47')](_0x1fc0b3)[_0xee29('0x1c')](function(){_0x51728d();})[_0xee29('0x15')](function(){_0x51728d();});}else{_0x51728d();}});});}function getTags(_0x2f498e,_0x33c11c,_0x22e36e,_0x33f7fa,_0x1fc016,_0x369c5f){return function(_0x4d67ff){return new Promise(function(_0x286311,_0x292820){var _0x527968=[];var _0xacf9c3=_0x33f7fa[_0xee29('0x48')];if(_0xacf9c3&&_0xacf9c3[_0xee29('0xf')]>0x0){_0x527968=_[_0xee29('0x49')](_0xacf9c3,'name');}if(_0x527968[_0xee29('0xf')]>0x0){return manageTags(_0x2f498e,_0x527968,_0x33c11c,_0x22e36e,_0x4d67ff,_0x1fc016,_0x369c5f)[_0xee29('0x1c')](function(){_0x286311(_0x4d67ff);});}else{_0x286311(_0x4d67ff);}});};}function emit(_0x4d198f,_0xe8e78,_0x1e0685){var _0x12bf90=_0xee29('0x4a')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0xee29('0x4b')+'%255EORDERBYDESCnumber';var _0x31477b={'uri':_0x4d198f+_0xee29('0x4c')+_0x1e0685+_0x12bf90};io['to'](util['format'](_0xee29('0x4d'),_0xe8e78))[_0xee29('0x4e')]('trigger:browser:url',_0x31477b);}exports['cs']=function(_0x59cf88,_0x296d19,_0x274c71,_0x3cdbd2,_0x2ee828,_0x54cb9,_0x38ad29,_0x541278){var _0x1e906f={};var _0x3fa10c={'user':_0x54cb9[_0xee29('0x4f')],'pass':_0x54cb9[_0xee29('0x50')]};var _0x411906='sysparm_limit=1';var _0x520289=_0xee29('0x51');_0x54cb9[_0xee29('0x52')]=intUtil[_0xee29('0x53')](_0x54cb9[_0xee29('0x52')]);_0x54cb9[_0xee29('0x54')]=intUtil[_0xee29('0x53')](_0x54cb9['serverUrl']);var _0x10e416=util[_0xee29('0x55')](_0xee29('0x56'),_0x54cb9[_0xee29('0x52')]);_0x1e906f[_0xee29('0x18')]=!_[_0xee29('0x57')](_0x3cdbd2)?_0x3cdbd2[_0xee29('0x58')]:null;_0x1e906f[_0xee29('0x1f')]=_0x54cb9[_0xee29('0x58')];_0x1e906f[_0xee29('0x24')]=_0x541278[_0xee29('0x35')]()===_0xee29('0x3a')?_0x296d19[_0xee29('0x59')]:_0x296d19[_0xee29('0x5a')];_0x1e906f[_0xee29('0x5b')]=_0x541278==='queue'||_0x541278==='unmanaged'?_0xee29('0x5c'):_0xee29('0x3a');var _0x2ec140=util[_0xee29('0x55')](_0xee29('0x5d'),_0x54cb9['serverUrl'],_0x296d19[_0xee29('0x5e')],md5(_0x296d19[_0xee29('0x5e')]));if(_0x2ee828&&_0x2ee828[_0xee29('0x5f')]){logger[_0xee29('0x12')](_0xee29('0x60'),_0xee29('0x61'));_0x296d19[_0xee29('0x62')]=_0x2ec140;}else if(_0x38ad29&&_0x38ad29[_0xee29('0x63')]&&_0x38ad29[_0xee29('0x63')]!=='none'){logger[_0xee29('0x12')](_0xee29('0x64'),_0xee29('0x61'));_0x296d19['recordingURL']=_0x2ec140;}else{_0x296d19[_0xee29('0x62')]='';}return getAdminUser(_0x541278,_0x3fa10c,_0x1e906f,_0x10e416,_0x520289,_0x411906)[_0xee29('0x1c')](getUser(_0x541278,_0x3fa10c,_0x10e416,_0x520289,_0x411906))[_0xee29('0x1c')](getEndUser(_0x541278,_0x3fa10c,_0x10e416,_0x520289,_0x411906))[_0xee29('0x1c')](getTicket(_0x541278,_0x3fa10c,_0x10e416,_0x274c71,_0x296d19,_0x520289))[_0xee29('0x1c')](function(_0x3d616f){logger[_0xee29('0x12')](util[_0xee29('0x55')](_0xee29('0x65'),_0x3d616f[_0xee29('0x41')]));logger[_0xee29('0x12')](util[_0xee29('0x55')](_0xee29('0x66'),_0x541278));if(_0x541278!==_0xee29('0x67')){logger[_0xee29('0x12')]('['+[_0x541278[_0xee29('0x13')]()]+']',_0xee29('0x68'));emit(_0x54cb9['remoteUri'],_0x3cdbd2['name'],_0x3d616f[_0xee29('0x41')]);}})[_0xee29('0x15')](function(_0x31a328){logger[_0xee29('0x16')]('['+[_0x541278[_0xee29('0x13')]()]+_0xee29('0x69'),util[_0xee29('0x6a')](_0x31a328,{'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 2c5e372..0f71149 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 _0x767a=['name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','Contacts','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','merge','type','string','nameField','toString','custom_fields','content','variableName','customField','Variable','toLowerCase','POST','login','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Fields','Outbound','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','error','unmanaged','lastevent','users','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','emit','info','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','parent_id','parent_type','parent_name','length','forEach','push','idField','set_entry','JSON','stringify','Basic\x20%s','apiKey','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','name','user_name','then','entry_list','find'];(function(_0x368178,_0x2d5678){var _0x10a228=function(_0x130364){while(--_0x130364){_0x368178['push'](_0x368178['shift']());}};_0x10a228(++_0x2d5678);}(_0x767a,0x144));var _0xa767=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x767a[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require(_0xa767('0x0'));var rp=require(_0xa767('0x1'));var BPromise=require(_0xa767('0x2'));var md5=require(_0xa767('0x3'));var util=require(_0xa767('0x4'));var Redis=require(_0xa767('0x5'));var intUtil=require(_0xa767('0x6'));var config=require(_0xa767('0x7'));var logger=require(_0xa767('0x8'))(_0xa767('0x9'));config[_0xa767('0xa')]=_[_0xa767('0xb')](config[_0xa767('0xa')],{'host':_0xa767('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa767('0xa')]));var def={'method':'POST','json':!![]};function emit(_0x14c287,_0xd48873,_0x23fea9){io['to'](_0x14c287)[_0xa767('0xd')](_0xd48873,_0x23fea9);}function getTicket(_0x159e3b,_0x470ab8,_0x3ed217,_0xfe0768,_0x4b850e,_0x2ab8b9,_0x1b96d9,_0x3ef4f7){logger[_0xa767('0xe')](_0xa767('0xf'));var _0x261fd8=new Date();var _0x4eb772=[{'name':'name','value':intUtil[_0xa767('0x10')](_0xfe0768[_0xa767('0x11')],_0x4b850e,'\x20')},{'name':_0xa767('0x12'),'value':_0x470ab8['id']},{'name':_0xa767('0x13'),'value':_0x470ab8['id']},{'name':_0xa767('0x14'),'value':intUtil[_0xa767('0x10')](_0xfe0768[_0xa767('0x15')],_0x4b850e,'\x0a')},{'name':_0xa767('0x16'),'value':_0x261fd8[_0xa767('0x17')]()[_0xa767('0x18')](0x0,0x13)[_0xa767('0x19')]('T','\x20')},{'name':_0xa767('0x1a'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0xa767('0x1b'),'value':_0x3ed217['id']},{'name':_0xa767('0x1c'),'value':'Contacts'},{'name':_0xa767('0x1d'),'value':_0x3ed217['name']},{'name':'direction','value':_0x3ef4f7}];if(_0x2ab8b9[_0xa767('0x1e')]){_[_0xa767('0x1f')](_0x2ab8b9,function(_0x6004f8){if(_0x4b850e[_0x6004f8['variableName']]){_0x4eb772[_0xa767('0x20')]({'name':_0x6004f8[_0xa767('0x21')],'value':_0x4b850e[_0x6004f8['variableName']]});}});}return request({'form':{'method':_0xa767('0x22'),'input_type':_0xa767('0x23'),'response_type':_0xa767('0x23'),'rest_data':JSON[_0xa767('0x24')]({'session':_0x1b96d9['id'],'module_name':'Calls','name_value_list':_0x4eb772})}});}function getAuth(_0x13d09b){return util['format'](_0xa767('0x25'),new Buffer(_0x13d09b[_0xa767('0x26')]+':X')['toString'](_0xa767('0x27')));}function getServerInfo(_0x4772a0){return request({'form':{'method':_0xa767('0x28'),'input_type':_0xa767('0x23'),'response_type':_0xa767('0x23'),'rest_data':JSON[_0xa767('0x24')]({'session':_0x4772a0['id']})}});}function getUser(_0x47b373,_0x6bbf0c,_0x4131ea){if(!_[_0xa767('0x29')](_0x6bbf0c)){logger[_0xa767('0xe')](_0xa767('0x2a'),_0x6bbf0c);return request({'form':{'method':'get_entry_list','input_type':_0xa767('0x23'),'response_type':_0xa767('0x23'),'rest_data':JSON[_0xa767('0x24')]({'session':_0x4131ea['id'],'module_name':_0xa767('0x2b'),'query':util[_0xa767('0x2c')](_0xa767('0x2d'),_0x6bbf0c),'order_by':'','offset':'0','select_fields':['id',_0xa767('0x2e'),_0xa767('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa767('0x30')](function(_0x490e16){if(_0x490e16[_0xa767('0x31')][_0xa767('0x1e')]){var _0x33d68d=_[_0xa767('0x32')](_0x490e16['entry_list'],function(_0x3f01c4){return _0x3f01c4[_0xa767('0x33')][_0xa767('0x2f')][_0xa767('0x34')]===_0x6bbf0c;});if(_0x33d68d){logger[_0xa767('0xe')](_0xa767('0x35'));return BPromise[_0xa767('0x36')]({'id':_0x33d68d[_0xa767('0x33')]['id'][_0xa767('0x34')],'name':_0x33d68d[_0xa767('0x33')][_0xa767('0x2e')][_0xa767('0x34')]});}}logger['info'](_0xa767('0x37'));return BPromise[_0xa767('0x36')]({'id':_0x4131ea[_0xa767('0x33')][_0xa767('0x38')][_0xa767('0x34')],'name':_0x4131ea[_0xa767('0x33')]['user_name']['value']});});}else{logger[_0xa767('0xe')](_0xa767('0x39'));return BPromise[_0xa767('0x36')]({'id':_0x4131ea[_0xa767('0x33')][_0xa767('0x38')][_0xa767('0x34')],'name':_0x4131ea[_0xa767('0x33')][_0xa767('0x2f')][_0xa767('0x34')]});}}function getEndUser(_0xb07563,_0x1c6625,_0x4f7a02,_0x395da8){logger[_0xa767('0xe')](_0xa767('0x3a'),_0x4f7a02);return request({'form':{'method':_0xa767('0x3b'),'input_type':_0xa767('0x23'),'response_type':_0xa767('0x23'),'rest_data':JSON[_0xa767('0x24')]({'session':_0x395da8['id'],'module_name':_0xa767('0x3c'),'query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x4f7a02),'order_by':'','offset':'0','select_fields':['id','name',_0xa767('0x3d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa767('0x30')](function(_0x459563){if(_0x459563[_0xa767('0x31')]['length']){var _0x37adbd=_[_0xa767('0x32')](_0x459563[_0xa767('0x31')],function(_0x4dc511){return _0x4dc511[_0xa767('0x33')]['phone_home'][_0xa767('0x34')]===_0x4f7a02;});if(_0x37adbd){logger[_0xa767('0xe')]('Enduser\x20found!');return BPromise[_0xa767('0x36')]({'id':_0x37adbd[_0xa767('0x33')]['id'][_0xa767('0x34')],'name':_0x37adbd['name_value_list']['name'][_0xa767('0x34')],'phone':_0x37adbd['name_value_list'][_0xa767('0x3d')][_0xa767('0x34')]});}}else{logger['info'](_0xa767('0x3e'));return request({'form':{'method':'set_entry','input_type':_0xa767('0x23'),'response_type':_0xa767('0x23'),'rest_data':JSON[_0xa767('0x24')]({'session':_0x395da8['id'],'module_name':'Contacts','name_value_list':[{'name':'first_name','value':_0x1c6625!==_0xa767('0x3f')?_0x1c6625:util['format'](_0xa767('0x40'),_0x4f7a02)},{'name':_0xa767('0x3d'),'value':_0x4f7a02}]})}})[_0xa767('0x30')](function(_0x574866){logger[_0xa767('0xe')](_0xa767('0x41'));return BPromise[_0xa767('0x36')]({'id':_0x574866['id'],'name':_0x574866[_0xa767('0x31')][_0xa767('0x42')][_0xa767('0x34')],'phone':_0x574866['entry_list']['phone_home'][_0xa767('0x34')]});});}});}function request(_0x237656){logger[_0xa767('0x43')]('[HTTP]',JSON[_0xa767('0x24')](_0x237656));return rp(_[_0xa767('0x44')](def,_0x237656));}function getTags(_0xf720f3,_0xad39a8){var _0x4d8bc0=[];if(_0xf720f3&&_0xf720f3[_0xa767('0x1e')]>0x0){_0x4d8bc0=_['map'](_0xf720f3,_0xad39a8);}return _0x4d8bc0;}function getCustomFields(_0x172aa2,_0x44ec1a){var _0x24dabb=[];var _0x2c9142={'custom_fields':[]};if(_0x172aa2[_0xa767('0x1e')]>0x0){_[_0xa767('0x1f')](_0x172aa2,function(_0x464026){if(_0x464026[_0xa767('0x45')]===_0xa767('0x46')&&_0x464026[_0xa767('0x47')]&&!_0x464026['customField']){_0x2c9142[_0x464026[_0xa767('0x47')]['toLowerCase']()]=_0x464026['content'][_0xa767('0x48')]();}else if(_0x464026[_0xa767('0x45')]===_0xa767('0x46')&&_0x464026[_0xa767('0x21')]&&_0x464026['customField']){_0x2c9142[_0xa767('0x49')][_0xa767('0x20')]({'id':_0x464026[_0xa767('0x21')],'value':_0x464026[_0xa767('0x4a')][_0xa767('0x48')]()});}else if(_0x464026['type']==='variable'&&_0x464026[_0xa767('0x4b')]&&_0x464026[_0xa767('0x21')]&&_0x464026[_0xa767('0x4c')]){_0x44ec1a[_0x464026[_0xa767('0x4b')]]&&_0x2c9142[_0xa767('0x49')]['push']({'id':_0x464026[_0xa767('0x21')],'value':_0x44ec1a[_0x464026[_0xa767('0x4b')]][_0xa767('0x48')]()});}else if(_0x464026['type']==='customVariable'&&_0x464026[_0xa767('0x4d')]&&_0x464026[_0xa767('0x4d')][_0xa767('0x2e')]&&_0x464026[_0xa767('0x21')]&&_0x464026[_0xa767('0x4c')]){_0x44ec1a[_0x464026[_0xa767('0x4d')][_0xa767('0x2e')]['toLowerCase']()]&&_0x2c9142[_0xa767('0x49')]['push']({'id':_0x464026['idField'],'value':_0x44ec1a[_0x464026[_0xa767('0x4d')][_0xa767('0x2e')][_0xa767('0x4e')]()]['toString']()});}});}return _0x2c9142;}function getConnection(_0x294c9c){return request({'method':_0xa767('0x4f'),'form':{'method':_0xa767('0x50'),'input_type':_0xa767('0x23'),'response_type':'JSON','rest_data':JSON[_0xa767('0x24')]({'user_auth':{'user_name':_0x294c9c['username'],'password':_0x294c9c[_0xa767('0x51')],'encryption':_0xa767('0x52')},'application':_0xa767('0x53')})}})['then'](function(_0x52f574){var _0x18bad4=_0x52f574;if(_0x18bad4['id']){def['sessionID']=_0x18bad4['id'];return BPromise[_0xa767('0x36')](_0x18bad4);}else{throw new Error(util[_0xa767('0x2c')](_0xa767('0x54'),_0x294c9c['id']));}});}function setRelationship(_0x3f9a17,_0x2de581,_0x567f82,_0x72731e){return request({'form':{'method':_0xa767('0x55'),'input_type':_0xa767('0x23'),'response_type':_0xa767('0x23'),'rest_data':JSON[_0xa767('0x24')]({'session':_0x3f9a17['id'],'module_name':'Calls','module_id':_0x567f82['id'],'link_field_name':_0x72731e,'related_ids':[_0x2de581['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xa767('0x56')]=function(_0x2cae0e,_0x223b2a,_0x300fc8,_0x83dcff,_0x5debf2,_0x4f3176){var _0x4461a6,_0x55e571,_0xf1db68,_0x494175;_0x4f3176[_0xa767('0x57')]=intUtil[_0xa767('0x58')](_0x4f3176[_0xa767('0x57')]);_0x4f3176[_0xa767('0x59')]=intUtil[_0xa767('0x58')](_0x4f3176[_0xa767('0x59')]);def[_0xa767('0x5a')]=util['format'](_0xa767('0x5b'),_0x4f3176[_0xa767('0x57')]);if(_0x5debf2&&_0x5debf2[_0xa767('0x5c')]){logger[_0xa767('0xe')](_0xa767('0x5d'),_0xa767('0x5e'));_0x223b2a[_0xa767('0x5f')]=util[_0xa767('0x2c')](_0xa767('0x60'),_0x4f3176[_0xa767('0x59')],_0x223b2a['uniqueid'],md5(_0x223b2a[_0xa767('0x61')]));}else{_0x223b2a[_0xa767('0x5f')]='';}return getConnection(_0x4f3176)[_0xa767('0x30')](function(_0x3c1f86){_0x494175=_0x3c1f86;return getUser(_0x4f3176,_0x83dcff[_0xa767('0x2e')],_0x494175);})[_0xa767('0x30')](function(_0x46043b){_0x4461a6=_0x46043b;logger[_0xa767('0xe')](_0xa767('0x62'),_0x4461a6['id']);return getEndUser(_0x4f3176,_0x223b2a[_0xa767('0x63')],_0x223b2a[_0xa767('0x64')],_0x494175);})[_0xa767('0x30')](function(_0x393374){_0x55e571=_0x393374;logger['info'](_0xa767('0x65'),_0x55e571['id']);return getTicket(_0x4f3176,_0x4461a6,_0x55e571,_0x300fc8,_0x223b2a,_0x300fc8['Fields'],_0x494175,_0xa767('0x66'));})['then'](function(_0x2fca01){_0xf1db68=_0x2fca01;logger[_0xa767('0xe')](_0xa767('0x67'));logger['info'](_0xa767('0x68'),_0xf1db68['id']);return setRelationship(_0x494175,_0x4461a6,_0xf1db68,'users');})['then'](function(){return setRelationship(_0x494175,_0x55e571,_0xf1db68,_0xa767('0x69'));})[_0xa767('0x30')](function(){return getServerInfo(_0x494175);})[_0xa767('0x30')](function(_0x544772){var _0x2a8e46=parseInt(_0x544772[_0xa767('0x6a')]['charAt'](0x0));var _0x3e42de=util[_0xa767('0x2c')](_0xa767('0x6b'),_0x4f3176[_0xa767('0x57')],_0xf1db68['id']);if(_0x2a8e46>0x6){_0x3e42de=util[_0xa767('0x2c')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x4f3176[_0xa767('0x57')],_0xf1db68['id']);}logger[_0xa767('0xe')](_0xa767('0x5d'),_0xa767('0x6c'));emit(util[_0xa767('0x2c')](_0xa767('0x6d'),_0x83dcff[_0xa767('0x2e')]),'trigger:browser:url',{'uri':_0x3e42de});})[_0xa767('0x6e')](function(_0x4d901f){logger['error'](_0xa767('0x5d'),JSON['stringify'](_0x4d901f));});};exports[_0xa767('0x6f')]=function(_0x2a23e3,_0x5b3c88,_0x15374b,_0x185414,_0x3b39c1,_0x2f4a79,_0x22559d){var _0x369170,_0x24395f,_0x27c805,_0x45b62b;_0x2f4a79[_0xa767('0x57')]=intUtil[_0xa767('0x58')](_0x2f4a79[_0xa767('0x57')]);_0x2f4a79[_0xa767('0x59')]=intUtil['stripTrailingSlash'](_0x2f4a79['serverUrl']);def['uri']=util[_0xa767('0x2c')](_0xa767('0x5b'),_0x2f4a79['remoteUri']);if(_0x22559d&&_0x22559d[_0xa767('0x70')]&&_0x22559d[_0xa767('0x70')]!==_0xa767('0x71')){logger[_0xa767('0xe')](_0xa767('0x72'),_0xa767('0x5e'));_0x5b3c88[_0xa767('0x5f')]=util['format'](_0xa767('0x60'),_0x2f4a79[_0xa767('0x59')],_0x5b3c88[_0xa767('0x61')],md5(_0x5b3c88[_0xa767('0x61')]));}return getConnection(_0x2f4a79)[_0xa767('0x30')](function(_0x4caeb7){_0x45b62b=_0x4caeb7;return getUser(_0x2f4a79,_0x185414['name'],_0x45b62b);})['then'](function(_0x6f1526){_0x369170=_0x6f1526;logger[_0xa767('0xe')](_0xa767('0x62'),_0x369170['id']);return getEndUser(_0x2f4a79,_0x5b3c88[_0xa767('0x73')],_0x5b3c88[_0xa767('0x74')],_0x45b62b);})[_0xa767('0x30')](function(_0x47c6b0){_0x24395f=_0x47c6b0;logger[_0xa767('0xe')](_0xa767('0x65'),_0x24395f['id']);return getTicket(_0x2f4a79,_0x369170,_0x24395f,_0x15374b,_0x5b3c88,_0x15374b[_0xa767('0x75')],_0x45b62b,_0xa767('0x76'));})['then'](function(_0x324273){_0x27c805=_0x324273;logger[_0xa767('0xe')](_0xa767('0x67'));logger[_0xa767('0xe')]('The\x20Ticket\x20ID\x20is:',_0x27c805['id']);return setRelationship(_0x45b62b,_0x369170,_0x27c805,'users');})[_0xa767('0x30')](function(){return setRelationship(_0x45b62b,_0x24395f,_0x27c805,_0xa767('0x69'));})[_0xa767('0x30')](function(){return getServerInfo(_0x45b62b);})[_0xa767('0x30')](function(_0x7ccd40){var _0x545e45=parseInt(_0x7ccd40[_0xa767('0x6a')][_0xa767('0x77')](0x0));var _0x35b4b9=util[_0xa767('0x2c')](_0xa767('0x6b'),_0x2f4a79[_0xa767('0x57')],_0x27c805['id']);if(_0x545e45>0x6){_0x35b4b9=util[_0xa767('0x2c')](_0xa767('0x78'),_0x2f4a79[_0xa767('0x57')],_0x27c805['id']);}logger[_0xa767('0xe')](_0xa767('0x72'),_0xa767('0x6c'));emit(util[_0xa767('0x2c')](_0xa767('0x6d'),_0x185414[_0xa767('0x2e')]),'trigger:browser:url',{'uri':_0x35b4b9});})[_0xa767('0x6e')](function(_0x1223e0){logger[_0xa767('0x79')]('[OUTBOUND]',JSON[_0xa767('0x24')](_0x1223e0));});};exports[_0xa767('0x7a')]=function(_0x3f7b8c,_0x2975f4,_0x32abc6,_0x13aee5,_0x30c76d,_0x478d36){var _0x34f590,_0x28c2f2,_0x512c30,_0x1eb88f;_0x478d36[_0xa767('0x57')]=intUtil['stripTrailingSlash'](_0x478d36['remoteUri']);_0x478d36[_0xa767('0x59')]=intUtil['stripTrailingSlash'](_0x478d36[_0xa767('0x59')]);def[_0xa767('0x5a')]=util[_0xa767('0x2c')](_0xa767('0x5b'),_0x478d36['remoteUri']);if(_0x30c76d&&_0x30c76d['monitor_format']){logger[_0xa767('0xe')]('['+_0x2975f4[_0xa767('0x7b')]['toUpperCase']()+']',_0xa767('0x5e'));_0x2975f4['recordingURL']=util['format'](_0xa767('0x60'),_0x478d36[_0xa767('0x59')],_0x2975f4[_0xa767('0x61')],md5(_0x2975f4[_0xa767('0x61')]));}else{_0x2975f4[_0xa767('0x5f')]='';}return getConnection(_0x478d36)['then'](function(_0x4cbceb){_0x1eb88f=_0x4cbceb;if(!_[_0xa767('0x29')](_0x13aee5)){return getUser(_0x478d36,_0x13aee5[_0xa767('0x2e')],_0x1eb88f);}else{return getUser(_0x478d36,null,_0x1eb88f);}})[_0xa767('0x30')](function(_0x1a7b9c){_0x34f590=_0x1a7b9c;logger[_0xa767('0xe')](_0xa767('0x62'),_0x34f590['id']);return getEndUser(_0x478d36,_0x2975f4[_0xa767('0x63')],_0x2975f4['calleridnum'],_0x1eb88f);})[_0xa767('0x30')](function(_0x56b9b4){_0x28c2f2=_0x56b9b4;logger[_0xa767('0xe')](_0xa767('0x65'),_0x28c2f2['id']);return getTicket(_0x478d36,_0x34f590,_0x28c2f2,_0x32abc6,_0x2975f4,_0x32abc6[_0xa767('0x75')],_0x1eb88f,_0xa767('0x66'));})['then'](function(_0x6dd866){_0x512c30=_0x6dd866;logger['info'](_0xa767('0x67'));logger[_0xa767('0xe')](_0xa767('0x68'),_0x512c30['id']);return setRelationship(_0x1eb88f,_0x34f590,_0x512c30,_0xa767('0x7c'));})[_0xa767('0x30')](function(){return setRelationship(_0x1eb88f,_0x28c2f2,_0x512c30,_0xa767('0x69'));})[_0xa767('0x30')](function(){return getServerInfo(_0x1eb88f);})[_0xa767('0x6e')](function(_0x13597b){logger[_0xa767('0x79')]('['+_0x2975f4[_0xa767('0x7b')]['toUpperCase']()+']',JSON['stringify'](_0x13597b));});}; \ No newline at end of file +var _0x5386=['trigger:browser:url','error','unmanaged','monitor_format','lastevent','toUpperCase','Ticket\x20created!','lodash','bluebird','md5','ioredis','./util','../../../../config/logger','sugarcrm','defaults','redis','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','Descriptions','toISOString','slice','replace','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','set_entry','JSON','stringify','Calls','format','Basic\x20%s','toString','get_server_info','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','find','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','merge','type','string','nameField','customField','toLowerCase','content','idField','custom_fields','variable','Variable','push','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','The\x20Ticket\x20ID\x20is:','users','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','outbound','uri','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','user:%s'];(function(_0x5a5a84,_0xdda55a){var _0x3f3945=function(_0x32507d){while(--_0x32507d){_0x5a5a84['push'](_0x5a5a84['shift']());}};_0x3f3945(++_0xdda55a);}(_0x5386,0x1e3));var _0x6538=function(_0x58da8a,_0x1c0584){_0x58da8a=_0x58da8a-0x0;var _0x5ba3a3=_0x5386[_0x58da8a];return _0x5ba3a3;};'use strict';var _=require(_0x6538('0x0'));var rp=require('request-promise');var BPromise=require(_0x6538('0x1'));var md5=require(_0x6538('0x2'));var util=require('util');var Redis=require(_0x6538('0x3'));var intUtil=require(_0x6538('0x4'));var config=require('../../../../config/environment');var logger=require(_0x6538('0x5'))(_0x6538('0x6'));config['redis']=_[_0x6538('0x7')](config[_0x6538('0x8')],{'host':_0x6538('0x9'),'port':0x18eb});var io=require(_0x6538('0xa'))(new Redis(config['redis']));var def={'method':_0x6538('0xb'),'json':!![]};function emit(_0x2d161e,_0x59beaa,_0x4e5f8d){io['to'](_0x2d161e)['emit'](_0x59beaa,_0x4e5f8d);}function getTicket(_0x564457,_0x1beac4,_0x4360ff,_0x35140e,_0x3e2da4,_0x1df036,_0x43f1fd,_0x4b4101){logger[_0x6538('0xc')](_0x6538('0xd'));var _0xa2454b=new Date();var _0x55d2d4=[{'name':_0x6538('0xe'),'value':intUtil[_0x6538('0xf')](_0x35140e[_0x6538('0x10')],_0x3e2da4,'\x20')},{'name':_0x6538('0x11'),'value':_0x1beac4['id']},{'name':_0x6538('0x12'),'value':_0x1beac4['id']},{'name':'description','value':intUtil[_0x6538('0xf')](_0x35140e[_0x6538('0x13')],_0x3e2da4,'\x0a')},{'name':'date_start','value':_0xa2454b[_0x6538('0x14')]()[_0x6538('0x15')](0x0,0x13)[_0x6538('0x16')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x6538('0x17'),'value':_0x4360ff['id']},{'name':_0x6538('0x18'),'value':_0x6538('0x19')},{'name':_0x6538('0x1a'),'value':_0x4360ff['name']},{'name':_0x6538('0x1b'),'value':_0x4b4101}];if(_0x1df036[_0x6538('0x1c')]){_[_0x6538('0x1d')](_0x1df036,function(_0x9af603){if(_0x3e2da4[_0x9af603[_0x6538('0x1e')]]){_0x55d2d4['push']({'name':_0x9af603['idField'],'value':_0x3e2da4[_0x9af603[_0x6538('0x1e')]]});}});}return request({'form':{'method':_0x6538('0x1f'),'input_type':_0x6538('0x20'),'response_type':_0x6538('0x20'),'rest_data':JSON[_0x6538('0x21')]({'session':_0x43f1fd['id'],'module_name':_0x6538('0x22'),'name_value_list':_0x55d2d4})}});}function getAuth(_0x31f061){return util[_0x6538('0x23')](_0x6538('0x24'),new Buffer(_0x31f061['apiKey']+':X')[_0x6538('0x25')]('base64'));}function getServerInfo(_0x5781cf){return request({'form':{'method':_0x6538('0x26'),'input_type':_0x6538('0x20'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x5781cf['id']})}});}function getUser(_0x119922,_0x1fb303,_0x5cddb3){if(!_['isNil'](_0x1fb303)){logger[_0x6538('0xc')]('Getting\x20agent\x20with\x20name',_0x1fb303);return request({'form':{'method':_0x6538('0x27'),'input_type':'JSON','response_type':_0x6538('0x20'),'rest_data':JSON[_0x6538('0x21')]({'session':_0x5cddb3['id'],'module_name':_0x6538('0x28'),'query':util[_0x6538('0x23')](_0x6538('0x29'),_0x1fb303),'order_by':'','offset':'0','select_fields':['id',_0x6538('0xe'),_0x6538('0x2a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x17f31f){if(_0x17f31f[_0x6538('0x2b')][_0x6538('0x1c')]){var _0x115ae0=_[_0x6538('0x2c')](_0x17f31f[_0x6538('0x2b')],function(_0x3567b2){return _0x3567b2['name_value_list'][_0x6538('0x2a')][_0x6538('0x2d')]===_0x1fb303;});if(_0x115ae0){logger[_0x6538('0xc')](_0x6538('0x2e'));return BPromise[_0x6538('0x2f')]({'id':_0x115ae0[_0x6538('0x30')]['id'][_0x6538('0x2d')],'name':_0x115ae0[_0x6538('0x30')][_0x6538('0xe')][_0x6538('0x2d')]});}}logger[_0x6538('0xc')](_0x6538('0x31'));return BPromise['resolve']({'id':_0x5cddb3['name_value_list']['user_id'][_0x6538('0x2d')],'name':_0x5cddb3[_0x6538('0x30')][_0x6538('0x2a')][_0x6538('0x2d')]});});}else{logger[_0x6538('0xc')](_0x6538('0x32'));return BPromise[_0x6538('0x2f')]({'id':_0x5cddb3['name_value_list'][_0x6538('0x33')][_0x6538('0x2d')],'name':_0x5cddb3[_0x6538('0x30')]['user_name']['value']});}}function getEndUser(_0x434118,_0x391ce3,_0xdc2c1f,_0x7d9f16){logger[_0x6538('0xc')](_0x6538('0x34'),_0xdc2c1f);return request({'form':{'method':'get_entry_list','input_type':_0x6538('0x20'),'response_type':_0x6538('0x20'),'rest_data':JSON['stringify']({'session':_0x7d9f16['id'],'module_name':_0x6538('0x19'),'query':util[_0x6538('0x23')](_0x6538('0x35'),_0xdc2c1f),'order_by':'','offset':'0','select_fields':['id','name',_0x6538('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x6538('0x37')](function(_0xf80e71){if(_0xf80e71[_0x6538('0x2b')]['length']){var _0x6cb982=_[_0x6538('0x2c')](_0xf80e71['entry_list'],function(_0x8e212a){return _0x8e212a['name_value_list'][_0x6538('0x36')][_0x6538('0x2d')]===_0xdc2c1f;});if(_0x6cb982){logger[_0x6538('0xc')](_0x6538('0x38'));return BPromise[_0x6538('0x2f')]({'id':_0x6cb982[_0x6538('0x30')]['id'][_0x6538('0x2d')],'name':_0x6cb982[_0x6538('0x30')][_0x6538('0xe')]['value'],'phone':_0x6cb982['name_value_list']['phone_home'][_0x6538('0x2d')]});}}else{logger[_0x6538('0xc')](_0x6538('0x39'));return request({'form':{'method':_0x6538('0x1f'),'input_type':_0x6538('0x20'),'response_type':_0x6538('0x20'),'rest_data':JSON[_0x6538('0x21')]({'session':_0x7d9f16['id'],'module_name':_0x6538('0x19'),'name_value_list':[{'name':_0x6538('0x3a'),'value':_0x391ce3!==_0x6538('0x3b')?_0x391ce3:util[_0x6538('0x23')](_0x6538('0x3c'),_0xdc2c1f)},{'name':_0x6538('0x36'),'value':_0xdc2c1f}]})}})[_0x6538('0x37')](function(_0x3919b0){logger[_0x6538('0xc')](_0x6538('0x3d'));return BPromise[_0x6538('0x2f')]({'id':_0x3919b0['id'],'name':_0x3919b0['entry_list'][_0x6538('0x3a')][_0x6538('0x2d')],'phone':_0x3919b0['entry_list'][_0x6538('0x36')][_0x6538('0x2d')]});});}});}function request(_0x1bea7e){logger['debug']('[HTTP]',JSON[_0x6538('0x21')](_0x1bea7e));return rp(_[_0x6538('0x3e')](def,_0x1bea7e));}function getTags(_0x2a8119,_0x54e3b7){var _0x56cd61=[];if(_0x2a8119&&_0x2a8119['length']>0x0){_0x56cd61=_['map'](_0x2a8119,_0x54e3b7);}return _0x56cd61;}function getCustomFields(_0x3126f8,_0x15dbf7){var _0x45ec5a=[];var _0x17a628={'custom_fields':[]};if(_0x3126f8[_0x6538('0x1c')]>0x0){_[_0x6538('0x1d')](_0x3126f8,function(_0x3936dd){if(_0x3936dd[_0x6538('0x3f')]===_0x6538('0x40')&&_0x3936dd[_0x6538('0x41')]&&!_0x3936dd[_0x6538('0x42')]){_0x17a628[_0x3936dd[_0x6538('0x41')][_0x6538('0x43')]()]=_0x3936dd[_0x6538('0x44')]['toString']();}else if(_0x3936dd[_0x6538('0x3f')]==='string'&&_0x3936dd[_0x6538('0x45')]&&_0x3936dd[_0x6538('0x42')]){_0x17a628[_0x6538('0x46')]['push']({'id':_0x3936dd[_0x6538('0x45')],'value':_0x3936dd[_0x6538('0x44')][_0x6538('0x25')]()});}else if(_0x3936dd['type']===_0x6538('0x47')&&_0x3936dd[_0x6538('0x1e')]&&_0x3936dd[_0x6538('0x45')]&&_0x3936dd[_0x6538('0x42')]){_0x15dbf7[_0x3936dd[_0x6538('0x1e')]]&&_0x17a628[_0x6538('0x46')]['push']({'id':_0x3936dd[_0x6538('0x45')],'value':_0x15dbf7[_0x3936dd[_0x6538('0x1e')]][_0x6538('0x25')]()});}else if(_0x3936dd[_0x6538('0x3f')]==='customVariable'&&_0x3936dd[_0x6538('0x48')]&&_0x3936dd[_0x6538('0x48')][_0x6538('0xe')]&&_0x3936dd[_0x6538('0x45')]&&_0x3936dd['customField']){_0x15dbf7[_0x3936dd[_0x6538('0x48')][_0x6538('0xe')][_0x6538('0x43')]()]&&_0x17a628['custom_fields'][_0x6538('0x49')]({'id':_0x3936dd[_0x6538('0x45')],'value':_0x15dbf7[_0x3936dd[_0x6538('0x48')][_0x6538('0xe')][_0x6538('0x43')]()]['toString']()});}});}return _0x17a628;}function getConnection(_0xd8020b){return request({'method':_0x6538('0xb'),'form':{'method':_0x6538('0x4a'),'input_type':_0x6538('0x20'),'response_type':_0x6538('0x20'),'rest_data':JSON[_0x6538('0x21')]({'user_auth':{'user_name':_0xd8020b[_0x6538('0x4b')],'password':_0xd8020b[_0x6538('0x4c')],'encryption':_0x6538('0x4d')},'application':_0x6538('0x4e')})}})[_0x6538('0x37')](function(_0x333d85){var _0x1d92a6=_0x333d85;if(_0x1d92a6['id']){def[_0x6538('0x4f')]=_0x1d92a6['id'];return BPromise[_0x6538('0x2f')](_0x1d92a6);}else{throw new Error(util[_0x6538('0x23')](_0x6538('0x50'),_0xd8020b['id']));}});}function setRelationship(_0x3a9df6,_0x39e2f8,_0x4f1bba,_0x3255b2){return request({'form':{'method':_0x6538('0x51'),'input_type':_0x6538('0x20'),'response_type':_0x6538('0x20'),'rest_data':JSON['stringify']({'session':_0x3a9df6['id'],'module_name':_0x6538('0x22'),'module_id':_0x4f1bba['id'],'link_field_name':_0x3255b2,'related_ids':[_0x39e2f8['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x363420,_0xd3ab37,_0x10500d,_0x2c91ed,_0x237ab5,_0x86a3ee){var _0x2bc358,_0x1a651f,_0x31857e,_0x22e48a;_0x86a3ee[_0x6538('0x52')]=intUtil[_0x6538('0x53')](_0x86a3ee[_0x6538('0x52')]);_0x86a3ee['serverUrl']=intUtil['stripTrailingSlash'](_0x86a3ee[_0x6538('0x54')]);def['uri']=util['format'](_0x6538('0x55'),_0x86a3ee[_0x6538('0x52')]);if(_0x237ab5&&_0x237ab5['monitor_format']){logger[_0x6538('0xc')](_0x6538('0x56'),_0x6538('0x57'));_0xd3ab37['recordingURL']=util[_0x6538('0x23')](_0x6538('0x58'),_0x86a3ee[_0x6538('0x54')],_0xd3ab37[_0x6538('0x59')],md5(_0xd3ab37[_0x6538('0x59')]));}else{_0xd3ab37[_0x6538('0x5a')]='';}return getConnection(_0x86a3ee)['then'](function(_0x462c67){_0x22e48a=_0x462c67;return getUser(_0x86a3ee,_0x2c91ed[_0x6538('0xe')],_0x22e48a);})[_0x6538('0x37')](function(_0xb7dfa1){_0x2bc358=_0xb7dfa1;logger[_0x6538('0xc')](_0x6538('0x5b'),_0x2bc358['id']);return getEndUser(_0x86a3ee,_0xd3ab37[_0x6538('0x5c')],_0xd3ab37[_0x6538('0x5d')],_0x22e48a);})[_0x6538('0x37')](function(_0x4cb96e){_0x1a651f=_0x4cb96e;logger[_0x6538('0xc')](_0x6538('0x5e'),_0x1a651f['id']);return getTicket(_0x86a3ee,_0x2bc358,_0x1a651f,_0x10500d,_0xd3ab37,_0x10500d[_0x6538('0x5f')],_0x22e48a,_0x6538('0x60'));})[_0x6538('0x37')](function(_0x97b4d6){_0x31857e=_0x97b4d6;logger[_0x6538('0xc')]('Ticket\x20created!');logger['info'](_0x6538('0x61'),_0x31857e['id']);return setRelationship(_0x22e48a,_0x2bc358,_0x31857e,_0x6538('0x62'));})[_0x6538('0x37')](function(){return setRelationship(_0x22e48a,_0x1a651f,_0x31857e,'contacts');})[_0x6538('0x37')](function(){return getServerInfo(_0x22e48a);})[_0x6538('0x37')](function(_0x11651b){var _0x276570=parseInt(_0x11651b['version'][_0x6538('0x63')](0x0));var _0x45f10d=util[_0x6538('0x23')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x86a3ee['remoteUri'],_0x31857e['id']);if(_0x276570>0x6){_0x45f10d=util['format'](_0x6538('0x64'),_0x86a3ee[_0x6538('0x52')],_0x31857e['id']);}logger[_0x6538('0xc')]('[QUEUE]',_0x6538('0x65'));emit(util[_0x6538('0x23')]('user:%s',_0x2c91ed[_0x6538('0xe')]),'trigger:browser:url',{'uri':_0x45f10d});})[_0x6538('0x66')](function(_0x3c2b95){logger['error'](_0x6538('0x56'),JSON['stringify'](_0x3c2b95));});};exports[_0x6538('0x67')]=function(_0x3fdc63,_0x3a2254,_0x297d4a,_0x222dc5,_0x323d71,_0xc43d8e,_0x31f981){var _0x2a642b,_0x30f0b3,_0xd486f9,_0x4760e0;_0xc43d8e[_0x6538('0x52')]=intUtil[_0x6538('0x53')](_0xc43d8e[_0x6538('0x52')]);_0xc43d8e[_0x6538('0x54')]=intUtil[_0x6538('0x53')](_0xc43d8e['serverUrl']);def[_0x6538('0x68')]=util['format']('%s/service/v4_1/rest.php',_0xc43d8e[_0x6538('0x52')]);if(_0x31f981&&_0x31f981[_0x6538('0x69')]&&_0x31f981[_0x6538('0x69')]!==_0x6538('0x6a')){logger[_0x6538('0xc')](_0x6538('0x6b'),'Recording\x20is\x20enabled!');_0x3a2254[_0x6538('0x5a')]=util[_0x6538('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xc43d8e[_0x6538('0x54')],_0x3a2254[_0x6538('0x59')],md5(_0x3a2254[_0x6538('0x59')]));}return getConnection(_0xc43d8e)['then'](function(_0x1d0e12){_0x4760e0=_0x1d0e12;return getUser(_0xc43d8e,_0x222dc5[_0x6538('0xe')],_0x4760e0);})[_0x6538('0x37')](function(_0x359a60){_0x2a642b=_0x359a60;logger[_0x6538('0xc')](_0x6538('0x5b'),_0x2a642b['id']);return getEndUser(_0xc43d8e,_0x3a2254[_0x6538('0x6c')],_0x3a2254[_0x6538('0x6d')],_0x4760e0);})[_0x6538('0x37')](function(_0x3a9785){_0x30f0b3=_0x3a9785;logger[_0x6538('0xc')]('The\x20Enduser\x20ID\x20is:',_0x30f0b3['id']);return getTicket(_0xc43d8e,_0x2a642b,_0x30f0b3,_0x297d4a,_0x3a2254,_0x297d4a[_0x6538('0x5f')],_0x4760e0,'Outbound');})[_0x6538('0x37')](function(_0x54f803){_0xd486f9=_0x54f803;logger[_0x6538('0xc')]('Ticket\x20created!');logger['info'](_0x6538('0x61'),_0xd486f9['id']);return setRelationship(_0x4760e0,_0x2a642b,_0xd486f9,_0x6538('0x62'));})[_0x6538('0x37')](function(){return setRelationship(_0x4760e0,_0x30f0b3,_0xd486f9,'contacts');})[_0x6538('0x37')](function(){return getServerInfo(_0x4760e0);})[_0x6538('0x37')](function(_0x789cc7){var _0x2bd91c=parseInt(_0x789cc7['version'][_0x6538('0x63')](0x0));var _0x5c51c1=util[_0x6538('0x23')](_0x6538('0x6e'),_0xc43d8e[_0x6538('0x52')],_0xd486f9['id']);if(_0x2bd91c>0x6){_0x5c51c1=util['format'](_0x6538('0x64'),_0xc43d8e[_0x6538('0x52')],_0xd486f9['id']);}logger[_0x6538('0xc')](_0x6538('0x6b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x6538('0x23')](_0x6538('0x6f'),_0x222dc5[_0x6538('0xe')]),_0x6538('0x70'),{'uri':_0x5c51c1});})['catch'](function(_0xe22e2b){logger[_0x6538('0x71')]('[OUTBOUND]',JSON[_0x6538('0x21')](_0xe22e2b));});};exports[_0x6538('0x72')]=function(_0x20dbe4,_0x21acf8,_0x56a16b,_0x1d798e,_0x274fb7,_0x5eb547){var _0x7b8fd1,_0x26b5b6,_0xedb392,_0x5a0218;_0x5eb547[_0x6538('0x52')]=intUtil['stripTrailingSlash'](_0x5eb547[_0x6538('0x52')]);_0x5eb547['serverUrl']=intUtil[_0x6538('0x53')](_0x5eb547['serverUrl']);def['uri']=util[_0x6538('0x23')]('%s/service/v4_1/rest.php',_0x5eb547[_0x6538('0x52')]);if(_0x274fb7&&_0x274fb7[_0x6538('0x73')]){logger['info']('['+_0x21acf8[_0x6538('0x74')][_0x6538('0x75')]()+']',_0x6538('0x57'));_0x21acf8[_0x6538('0x5a')]=util[_0x6538('0x23')](_0x6538('0x58'),_0x5eb547[_0x6538('0x54')],_0x21acf8[_0x6538('0x59')],md5(_0x21acf8[_0x6538('0x59')]));}else{_0x21acf8[_0x6538('0x5a')]='';}return getConnection(_0x5eb547)[_0x6538('0x37')](function(_0x4901c4){_0x5a0218=_0x4901c4;if(!_['isNil'](_0x1d798e)){return getUser(_0x5eb547,_0x1d798e[_0x6538('0xe')],_0x5a0218);}else{return getUser(_0x5eb547,null,_0x5a0218);}})[_0x6538('0x37')](function(_0x5822c0){_0x7b8fd1=_0x5822c0;logger[_0x6538('0xc')]('The\x20User\x20ID\x20is:',_0x7b8fd1['id']);return getEndUser(_0x5eb547,_0x21acf8['calleridname'],_0x21acf8[_0x6538('0x5d')],_0x5a0218);})[_0x6538('0x37')](function(_0x2f8754){_0x26b5b6=_0x2f8754;logger['info'](_0x6538('0x5e'),_0x26b5b6['id']);return getTicket(_0x5eb547,_0x7b8fd1,_0x26b5b6,_0x56a16b,_0x21acf8,_0x56a16b[_0x6538('0x5f')],_0x5a0218,_0x6538('0x60'));})[_0x6538('0x37')](function(_0x5440aa){_0xedb392=_0x5440aa;logger['info'](_0x6538('0x76'));logger['info']('The\x20Ticket\x20ID\x20is:',_0xedb392['id']);return setRelationship(_0x5a0218,_0x7b8fd1,_0xedb392,_0x6538('0x62'));})[_0x6538('0x37')](function(){return setRelationship(_0x5a0218,_0x26b5b6,_0xedb392,'contacts');})[_0x6538('0x37')](function(){return getServerInfo(_0x5a0218);})['catch'](function(_0x2594de){logger[_0x6538('0x71')]('['+_0x21acf8[_0x6538('0x74')][_0x6538('0x75')]()+']',JSON[_0x6538('0x21')](_0x2594de));});}; \ 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 f4ad8d5..b839b99 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 _0xb5eb=['validateEmail','isNil','util','length','sortBy','type','string','variableName','push','toString','customVariable','Variable','name','toLowerCase','keyType','key','format','keyContent','variable','%s:\x20%s','join','stripTrailingSlash','substring','lastIndexOf'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb5eb,0x19a));var _0xbb5e=function(_0x492dc3,_0x3e541a){_0x492dc3=_0x492dc3-0x0;var _0x3ea029=_0xb5eb[_0x492dc3];return _0x3ea029;};'use strict';var _=require('lodash');var util=require(_0xbb5e('0x0'));exports['getString']=function(_0x1c1874,_0x1c663d,_0x7899b1){var _0xc03c5f=[];if(_0x1c1874[_0xbb5e('0x1')]>0x0){var _0x2bec08=_[_0xbb5e('0x2')](_0x1c1874,['id']);for(var _0x533e2a=0x0;_0x533e2a<_0x2bec08[_0xbb5e('0x1')];_0x533e2a++){var _0x28aa37=_0x2bec08[_0x533e2a];if(_0x28aa37[_0xbb5e('0x3')]===_0xbb5e('0x4')){_0xc03c5f['push'](_0x28aa37['content']);}else if(_0x28aa37[_0xbb5e('0x3')]==='variable'&&_0x28aa37[_0xbb5e('0x5')]){_0x1c663d[_0x28aa37[_0xbb5e('0x5')]]&&_0xc03c5f[_0xbb5e('0x6')](_0x1c663d[_0x28aa37[_0xbb5e('0x5')]][_0xbb5e('0x7')]());}else if(_0x28aa37[_0xbb5e('0x3')]===_0xbb5e('0x8')&&_0x28aa37[_0xbb5e('0x9')]&&_0x28aa37['Variable'][_0xbb5e('0xa')]){_0x1c663d[_0x28aa37['Variable'][_0xbb5e('0xa')][_0xbb5e('0xb')]()]&&_0xc03c5f['push'](_0x1c663d[_0x28aa37['Variable']['name']['toLowerCase']()][_0xbb5e('0x7')]());}else if(_0x28aa37[_0xbb5e('0x3')]==='keyValue'){if(_0x28aa37[_0xbb5e('0xc')]==='string'&&_0x28aa37[_0xbb5e('0xd')]){_0xc03c5f[_0xbb5e('0x6')](util[_0xbb5e('0xe')]('%s:\x20%s',_0x28aa37['key'],_0x28aa37[_0xbb5e('0xf')]));}else if(_0x28aa37['keyType']===_0xbb5e('0x10')&&_0x28aa37[_0xbb5e('0x5')]&&_0x28aa37[_0xbb5e('0xd')]){_0x1c663d[_0x28aa37[_0xbb5e('0x5')]]&&_0xc03c5f[_0xbb5e('0x6')](util['format'](_0xbb5e('0x11'),_0x28aa37[_0xbb5e('0xd')],_0x1c663d[_0x28aa37[_0xbb5e('0x5')]]));}else if(_0x28aa37[_0xbb5e('0xc')]===_0xbb5e('0x8')&&_0x28aa37[_0xbb5e('0x9')]&&_0x28aa37[_0xbb5e('0x9')][_0xbb5e('0xa')]&&_0x28aa37['key']){_0x1c663d[_0x28aa37[_0xbb5e('0x9')][_0xbb5e('0xa')]['toLowerCase']()]&&_0xc03c5f[_0xbb5e('0x6')](util[_0xbb5e('0xe')](_0xbb5e('0x11'),_0x28aa37[_0xbb5e('0xd')],_0x1c663d[_0x28aa37[_0xbb5e('0x9')]['name'][_0xbb5e('0xb')]()]));}}}}return _0xc03c5f[_0xbb5e('0x12')](_0x7899b1);};exports[_0xbb5e('0x13')]=function(_0x2f2243){var _0x5b7690=_0x2f2243['slice'](-0x1);if(_0x5b7690==='/'){_0x2f2243=_0x2f2243[_0xbb5e('0x14')](0x0,_0x2f2243[_0xbb5e('0x15')](_0x5b7690));}return _0x2f2243;};exports[_0xbb5e('0x16')]=function(_0x314901){if(!_[_0xbb5e('0x17')](_0x314901)&&_0x314901!==''){var _0x114aa8=/^(([^<>()\[\]\\.,;:\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 _0x114aa8['test'](String(_0x314901)[_0xbb5e('0xb')]());}else{return![];}}; \ No newline at end of file +var _0x8fa6=['push','toString','Variable','name','keyValue','keyType','key','%s:\x20%s','format','customVariable','toLowerCase','slice','substring','isNil','test','lodash','util','getString','length','sortBy','type','string','content','variable','variableName'];(function(_0x11c221,_0x65c6a5){var _0x26deef=function(_0x2fa41a){while(--_0x2fa41a){_0x11c221['push'](_0x11c221['shift']());}};_0x26deef(++_0x65c6a5);}(_0x8fa6,0xa5));var _0x68fa=function(_0x1868f2,_0x10bdf0){_0x1868f2=_0x1868f2-0x0;var _0x4086cb=_0x8fa6[_0x1868f2];return _0x4086cb;};'use strict';var _=require(_0x68fa('0x0'));var util=require(_0x68fa('0x1'));exports[_0x68fa('0x2')]=function(_0x58f20b,_0x5e4559,_0x2ca0a1){var _0x34d54f=[];if(_0x58f20b[_0x68fa('0x3')]>0x0){var _0x152da8=_[_0x68fa('0x4')](_0x58f20b,['id']);for(var _0x1e26b3=0x0;_0x1e26b3<_0x152da8[_0x68fa('0x3')];_0x1e26b3++){var _0x35a173=_0x152da8[_0x1e26b3];if(_0x35a173[_0x68fa('0x5')]===_0x68fa('0x6')){_0x34d54f['push'](_0x35a173[_0x68fa('0x7')]);}else if(_0x35a173[_0x68fa('0x5')]===_0x68fa('0x8')&&_0x35a173['variableName']){_0x5e4559[_0x35a173[_0x68fa('0x9')]]&&_0x34d54f[_0x68fa('0xa')](_0x5e4559[_0x35a173['variableName']][_0x68fa('0xb')]());}else if(_0x35a173[_0x68fa('0x5')]==='customVariable'&&_0x35a173[_0x68fa('0xc')]&&_0x35a173[_0x68fa('0xc')]['name']){_0x5e4559[_0x35a173[_0x68fa('0xc')][_0x68fa('0xd')]['toLowerCase']()]&&_0x34d54f['push'](_0x5e4559[_0x35a173[_0x68fa('0xc')][_0x68fa('0xd')]['toLowerCase']()][_0x68fa('0xb')]());}else if(_0x35a173[_0x68fa('0x5')]===_0x68fa('0xe')){if(_0x35a173[_0x68fa('0xf')]===_0x68fa('0x6')&&_0x35a173[_0x68fa('0x10')]){_0x34d54f[_0x68fa('0xa')](util['format'](_0x68fa('0x11'),_0x35a173['key'],_0x35a173['keyContent']));}else if(_0x35a173[_0x68fa('0xf')]==='variable'&&_0x35a173[_0x68fa('0x9')]&&_0x35a173[_0x68fa('0x10')]){_0x5e4559[_0x35a173[_0x68fa('0x9')]]&&_0x34d54f[_0x68fa('0xa')](util[_0x68fa('0x12')](_0x68fa('0x11'),_0x35a173[_0x68fa('0x10')],_0x5e4559[_0x35a173['variableName']]));}else if(_0x35a173[_0x68fa('0xf')]===_0x68fa('0x13')&&_0x35a173[_0x68fa('0xc')]&&_0x35a173[_0x68fa('0xc')][_0x68fa('0xd')]&&_0x35a173['key']){_0x5e4559[_0x35a173[_0x68fa('0xc')][_0x68fa('0xd')][_0x68fa('0x14')]()]&&_0x34d54f[_0x68fa('0xa')](util['format'](_0x68fa('0x11'),_0x35a173[_0x68fa('0x10')],_0x5e4559[_0x35a173['Variable'][_0x68fa('0xd')][_0x68fa('0x14')]()]));}}}}return _0x34d54f['join'](_0x2ca0a1);};exports['stripTrailingSlash']=function(_0xf890d4){var _0x540887=_0xf890d4[_0x68fa('0x15')](-0x1);if(_0x540887==='/'){_0xf890d4=_0xf890d4[_0x68fa('0x16')](0x0,_0xf890d4['lastIndexOf'](_0x540887));}return _0xf890d4;};exports['validateEmail']=function(_0x150b74){if(!_[_0x68fa('0x17')](_0x150b74)&&_0x150b74!==''){var _0x32f120=/^(([^<>()\[\]\\.,;:\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 _0x32f120[_0x68fa('0x18')](String(_0x150b74)[_0x68fa('0x14')]());}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 f6e2211..b80f000 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x3eb8d0,_0x3cd124){var _0x5d5495=function(_0x19a927){while(--_0x19a927){_0x3eb8d0['push'](_0x3eb8d0['shift']());}};_0x5d5495(++_0x3cd124);}(_0xe706,0xa3));var _0x6e70=function(_0x46ad9e,_0x203184){_0x46ad9e=_0x46ad9e-0x0;var _0x5727cb=_0xe706[_0x46ad9e];return _0x5727cb;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file +var _0xd8b0=['info','Creating\x20new\x20ticket...','merge','Normal','Subjects','POST','format','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','then','Agent\x20found!','resolve','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','admin','catch','userId','getUser','Searching\x20end\x20user\x20with\x20phone','GET','query','Enduser\x20found!','firstname','Enduser\x20created.','lastname','phone','accessKey','getchallenge','login','token','getConnection','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','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]','uniqueid','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','lastevent','toUpperCase','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','length','forEach','includes','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase'];(function(_0x35e92e,_0x21581b){var _0x1205a8=function(_0x4325d8){while(--_0x4325d8){_0x35e92e['push'](_0x35e92e['shift']());}};_0x1205a8(++_0x21581b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var rp=require(_0x0d8b('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require('util');var Redis=require(_0x0d8b('0x2'));var intUtil=require(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var io=require(_0x0d8b('0x9'))(new Redis(config['redis']));function emit(_0x413284,_0x284169,_0x58e4e2){io['to'](_0x413284)[_0x0d8b('0xa')](_0x284169,_0x58e4e2);}function getCustomFields(_0x348e65,_0x3b027f){var _0x1f4800={};if(_0x348e65[_0x0d8b('0xb')]>0x0){_[_0x0d8b('0xc')](_0x348e65,function(_0x2c5e9e){if(_[_0x0d8b('0xd')](['string',_0x0d8b('0xe')],_0x2c5e9e['type'])&&_0x2c5e9e[_0x0d8b('0xf')]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x2c5e9e[_0x0d8b('0x10')][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x13')&&_0x2c5e9e[_0x0d8b('0x14')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x15')&&_0x2c5e9e['Variable']&&_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]['toLowerCase']()]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')][_0x0d8b('0x18')]()][_0x0d8b('0x11')]();}});}return _0x1f4800;}function createTicket(_0x18dd2d,_0x264b39,_0xa3612a,_0x4a15bf,_0x27512e,_0x23d58f,_0x196c0a){logger[_0x0d8b('0x19')](_0x0d8b('0x1a'));var _0x5b709c=_[_0x0d8b('0x1b')]({'parent_id':'','assigned_user_id':_0x264b39['id'],'ticketpriorities':_0x0d8b('0x1c'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x4a15bf[_0x0d8b('0x1d')],_0x27512e,'\x20'),'description':intUtil['getString'](_0x4a15bf['Descriptions'],_0x27512e,'\x0a'),'contact_id':_0xa3612a['id']},getCustomFields(_0x23d58f,_0x27512e));var _0x5527d8={'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x18dd2d[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'username':_0x18dd2d[_0x0d8b('0x23')],'sessionName':_0x196c0a[_0x0d8b('0x24')],'elementType':_0x0d8b('0x25'),'element':JSON[_0x0d8b('0x26')](_0x5b709c)},'json':!![]};return request(_0x5527d8)['then'](function(_0xe8bbee){if(_0xe8bbee[_0x0d8b('0x27')]){return BPromise['resolve']({'id':_0xe8bbee[_0x0d8b('0x28')]['id']});}else{throw new Error(util['format'](_0x0d8b('0x29'),JSON[_0x0d8b('0x26')](_0xe8bbee[_0x0d8b('0x2a')])));}})['catch'](function(_0x59a905){var _0x28f639=_0x59a905[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),'createTicket',_0x28f639,JSON[_0x0d8b('0x26')](_0x59a905));});}function getUser(_0x4b59e5,_0x97050a,_0x48f24f){if(intUtil[_0x0d8b('0x2d')](_0x97050a)){logger['info'](_0x0d8b('0x2e'),_0x97050a);return request({'method':'GET','uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x4b59e5[_0x0d8b('0x21')]),'qs':{'operation':'query','username':_0x4b59e5['username'],'sessionName':_0x48f24f['sessionName'],'query':util[_0x0d8b('0x1f')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x97050a)},'json':!![]})[_0x0d8b('0x2f')](function(_0x54f6f3){if(_0x54f6f3['success']&&_0x54f6f3[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x30'));return BPromise[_0x0d8b('0x31')]({'id':_0x54f6f3[_0x0d8b('0x28')][0x0]['id'],'email':_0x54f6f3[_0x0d8b('0x28')][0x0][_0x0d8b('0x32')],'name':_0x54f6f3['result'][0x0][_0x0d8b('0x33')]+'\x20'+_0x54f6f3[_0x0d8b('0x28')]['last_name']});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f['userId'],'email':_0x4b59e5[_0x0d8b('0x23')],'name':_0x0d8b('0x35')});}})[_0x0d8b('0x36')](function(_0x31ceba){var _0x933e01=_0x31ceba['statusCode']||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),'getUser',_0x933e01,JSON[_0x0d8b('0x26')](_0x31ceba));});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f[_0x0d8b('0x37')],'email':_0x4b59e5['username'],'name':'admin'})[_0x0d8b('0x36')](function(_0x5c2c04){var _0x531c55=_0x5c2c04[_0x0d8b('0x2b')]||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),_0x0d8b('0x38'),_0x531c55,JSON[_0x0d8b('0x26')](_0x5c2c04));});}}function getEndUser(_0x24c789,_0x579324,_0x6e5bab,_0x6a02ad){logger[_0x0d8b('0x19')](_0x0d8b('0x39'),_0x6e5bab);return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x24c789['remoteUri']),'qs':{'operation':_0x0d8b('0x3b'),'username':_0x24c789[_0x0d8b('0x23')],'sessionName':_0x6a02ad[_0x0d8b('0x24')],'query':util[_0x0d8b('0x1f')]('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;',_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab)},'json':!![]})[_0x0d8b('0x2f')](function(_0x4b4bde){if(_0x4b4bde[_0x0d8b('0x27')]&&_0x4b4bde[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x3c'));return BPromise[_0x0d8b('0x31')]({'id':_0x4b4bde[_0x0d8b('0x28')][0x0]['id'],'name':_0x4b4bde[_0x0d8b('0x28')][0x0][_0x0d8b('0x3d')]+'\x20'+_0x4b4bde[_0x0d8b('0x28')][0x0]['lastname'],'phone':_0x6e5bab});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':'POST','uri':util['format'](_0x0d8b('0x20'),_0x24c789[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'sessionName':_0x6a02ad['sessionName'],'elementType':'Contacts','element':JSON[_0x0d8b('0x26')]({'lastname':_0x579324,'phone':_0x6e5bab,'assigned_user_id':'\x20'})},'json':!![]})[_0x0d8b('0x2f')](function(_0x344278){logger['info'](_0x0d8b('0x3e'));return BPromise[_0x0d8b('0x31')]({'id':_0x344278['result']['id'],'name':_0x344278['result'][_0x0d8b('0x3f')],'phone':_0x344278['result'][_0x0d8b('0x40')]});})['catch'](function(_0x53f643){var _0x30ccee=_0x53f643[_0x0d8b('0x2b')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getEndUser',_0x30ccee,JSON['stringify'](_0x53f643));});}});}function getConnection(_0x374d40){var _0x1e0498=_0x374d40[_0x0d8b('0x23')];var _0x490eda=_0x374d40[_0x0d8b('0x41')];return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'qs':{'operation':_0x0d8b('0x42'),'username':_0x1e0498},'json':!![]})[_0x0d8b('0x2f')](function(_0x1d5067){if(_0x1d5067[_0x0d8b('0x27')]){return request({'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x43'),'username':_0x1e0498,'accessKey':md5(_0x1d5067[_0x0d8b('0x28')][_0x0d8b('0x44')]+_0x490eda)},'json':!![]});}})[_0x0d8b('0x2f')](function(_0x1e162c){if(_0x1e162c[_0x0d8b('0x27')]){return BPromise['resolve'](_0x1e162c[_0x0d8b('0x28')]);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x374d40['id']));}})[_0x0d8b('0x36')](function(_0x113fb7){var _0x3f943a=_0x113fb7[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),_0x0d8b('0x45'),_0x3f943a,JSON[_0x0d8b('0x26')](_0x113fb7));});}function request(_0x241587){logger[_0x0d8b('0x19')]('[HTTP]',JSON['stringify'](_0x241587));return rp(_0x241587);}exports['queue']=function(_0x573f4f,_0x368ede,_0xf22c3c,_0x5e3bb4,_0x4950a8,_0x44c5c1){var _0x3d3cb6,_0x5c5bd7,_0x5ef6c3,_0x900906;_0x44c5c1[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x44c5c1[_0x0d8b('0x21')]);if(_0x4950a8&&_0x4950a8[_0x0d8b('0x47')]){logger['info'](_0x0d8b('0x48'),_0x0d8b('0x49'));_0x368ede['recordingURL']=util['format'](_0x0d8b('0x4a'),_0x44c5c1[_0x0d8b('0x4b')],_0x368ede['uniqueid'],md5(_0x368ede['uniqueid']));}else{_0x368ede[_0x0d8b('0x4c')]='';}return getConnection(_0x44c5c1)[_0x0d8b('0x2f')](function(_0x377027){_0x900906=_0x377027;return getUser(_0x44c5c1,_0x5e3bb4[_0x0d8b('0x4d')],_0x900906);})['then'](function(_0x356b3d){_0x3d3cb6=_0x356b3d;logger['info']('The\x20User\x20ID\x20is:',_0x3d3cb6['id']);return getEndUser(_0x44c5c1,_0x368ede[_0x0d8b('0x4e')],_0x368ede[_0x0d8b('0x4f')],_0x900906);})['then'](function(_0x4a8f33){_0x5c5bd7=_0x4a8f33;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x5c5bd7['id']);return createTicket(_0x44c5c1,_0x3d3cb6,_0x5c5bd7,_0xf22c3c,_0x368ede,_0xf22c3c[_0x0d8b('0x51')],_0x900906);})[_0x0d8b('0x2f')](function(_0x3afc3a){_0x5ef6c3=_0x3afc3a;logger[_0x0d8b('0x19')](_0x0d8b('0x52'));logger[_0x0d8b('0x19')]('The\x20Ticket\x20ID\x20is:',_0x5ef6c3['id']);var _0x24a859=util[_0x0d8b('0x1f')](_0x0d8b('0x53'),_0x44c5c1[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5ef6c3['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x48'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')]('user:%s',_0x5e3bb4[_0x0d8b('0x17')]),_0x0d8b('0x56'),{'uri':_0x24a859});})[_0x0d8b('0x36')](function(_0x23de9e){logger[_0x0d8b('0x2a')]('[QUEUE]',JSON[_0x0d8b('0x26')](_0x23de9e));});};exports[_0x0d8b('0x57')]=function(_0x181d49,_0x17a87f,_0x1d6cd4,_0x59ada2,_0x4d0e7c,_0x3b1166,_0x291b83){var _0x3e4a41,_0xbbb520,_0x5a70bd,_0x199122;_0x3b1166[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x3b1166['remoteUri']);_0x3b1166[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x3b1166[_0x0d8b('0x4b')]);if(_0x291b83&&_0x291b83[_0x0d8b('0x58')]&&_0x291b83[_0x0d8b('0x58')]!==_0x0d8b('0x59')){logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),'Recording\x20is\x20enabled!');_0x17a87f[_0x0d8b('0x4c')]=util['format'](_0x0d8b('0x4a'),_0x3b1166[_0x0d8b('0x4b')],_0x17a87f[_0x0d8b('0x5b')],md5(_0x17a87f[_0x0d8b('0x5b')]));}return getConnection(_0x3b1166)['then'](function(_0x19e097){_0x199122=_0x19e097;return getUser(_0x3b1166,_0x59ada2[_0x0d8b('0x4d')],_0x199122);})[_0x0d8b('0x2f')](function(_0x2332fc){_0x3e4a41=_0x2332fc;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0x3e4a41['id']);return getEndUser(_0x3b1166,_0x17a87f[_0x0d8b('0x5d')],_0x17a87f[_0x0d8b('0x5e')],_0x199122);})[_0x0d8b('0x2f')](function(_0x34affb){_0xbbb520=_0x34affb;logger['info']('The\x20Enduser\x20ID\x20is:',_0xbbb520['id']);return createTicket(_0x3b1166,_0x3e4a41,_0xbbb520,_0x1d6cd4,_0x17a87f,_0x1d6cd4[_0x0d8b('0x51')],_0x199122);})[_0x0d8b('0x2f')](function(_0x53e399){_0x5a70bd=_0x53e399;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger['info'](_0x0d8b('0x5f'),_0x5a70bd['id']);var _0x1c4e96=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x3b1166[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5a70bd['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')](_0x0d8b('0x60'),_0x59ada2['name']),_0x0d8b('0x56'),{'uri':_0x1c4e96});})['catch'](function(_0x1a203e){logger[_0x0d8b('0x2a')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x26')](_0x1a203e));});};exports['unmanaged']=function(_0x3fe47d,_0x4a1c4a,_0x3a356b,_0x2c6c5f,_0x1c5fe2,_0x2ebea3){var _0xc5c35f,_0x2b44e5,_0x3e927c,_0x91aa89;_0x2ebea3[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x2ebea3['remoteUri']);_0x2ebea3[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x2ebea3[_0x0d8b('0x4b')]);if(_0x1c5fe2&&_0x1c5fe2[_0x0d8b('0x47')]){logger['info']('['+_0x4a1c4a[_0x0d8b('0x61')]['toUpperCase']()+']',_0x0d8b('0x49'));_0x4a1c4a[_0x0d8b('0x4c')]=util[_0x0d8b('0x1f')](_0x0d8b('0x4a'),_0x2ebea3[_0x0d8b('0x4b')],_0x4a1c4a[_0x0d8b('0x5b')],md5(_0x4a1c4a[_0x0d8b('0x5b')]));}else{_0x4a1c4a[_0x0d8b('0x4c')]='';}return getConnection(_0x2ebea3)['then'](function(_0x10eca6){_0x91aa89=_0x10eca6;return getUser(_0x2ebea3,'',_0x91aa89);})[_0x0d8b('0x2f')](function(_0x5b2916){_0xc5c35f=_0x5b2916;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0xc5c35f['id']);return getEndUser(_0x2ebea3,_0x4a1c4a[_0x0d8b('0x4e')],_0x4a1c4a[_0x0d8b('0x4f')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0x9e44b4){_0x2b44e5=_0x9e44b4;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x2b44e5['id']);return createTicket(_0x2ebea3,_0xc5c35f,_0x2b44e5,_0x3a356b,_0x4a1c4a,_0x3a356b[_0x0d8b('0x51')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0xe35028){_0x3e927c=_0xe35028;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger[_0x0d8b('0x19')](_0x0d8b('0x5f'),_0x3e927c['id']);})[_0x0d8b('0x36')](function(_0x58525c){logger['error']('['+_0x4a1c4a[_0x0d8b('0x61')][_0x0d8b('0x62')]()+']',JSON[_0x0d8b('0x26')](_0x58525c));});}; \ 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 441ae60..b9a1cde 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 _0xb975=['%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','username','password','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','map','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','serverUrl','stripTrailingSlash','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','calleridname','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','inspect','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','user:%s','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','monitor_format','lastevent','toUpperCase','calleridnum','catch','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','Subjects','getString','Descriptions','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','count','Agent\x20found!','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!'];(function(_0x250c78,_0x25b838){var _0x44f07a=function(_0x599b41){while(--_0x599b41){_0x250c78['push'](_0x250c78['shift']());}};_0x44f07a(++_0x25b838);}(_0xb975,0x12f));var _0x5b97=function(_0x22dac7,_0x45d32a){_0x22dac7=_0x22dac7-0x0;var _0x3e6cfa=_0xb975[_0x22dac7];return _0x3e6cfa;};'use strict';var _=require('lodash');var rp=require(_0x5b97('0x0'));var md5=require(_0x5b97('0x1'));var util=require('util');var Redis=require(_0x5b97('0x2'));var intUtil=require(_0x5b97('0x3'));var config=require(_0x5b97('0x4'));var logger=require(_0x5b97('0x5'))(_0x5b97('0x6'));config[_0x5b97('0x7')]=_[_0x5b97('0x8')](config[_0x5b97('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x5b97('0x9'))(new Redis(config[_0x5b97('0x7')]));function emit(_0x54b73c,_0xd9d413,_0x1e6e30){io['to'](_0x54b73c)[_0x5b97('0xa')](_0xd9d413,_0x1e6e30);}var headers={'Content-Type':'application/json','Accept':_0x5b97('0xb')};function getTicket(_0x4253fe,_0x1537e7,_0x37105a,_0x5c3247,_0x51efbb){logger[_0x5b97('0xc')](_0x5b97('0xd'));return request({'uri':util[_0x5b97('0xe')](_0x5b97('0xf'),_0x4253fe[_0x5b97('0x10')]),'method':_0x5b97('0x11'),'body':{'ticket':_[_0x5b97('0x12')]({'requester_id':_0x37105a['id'],'submitter_id':_0x1537e7?_0x1537e7['id']:undefined,'assignee_id':_0x1537e7?_0x1537e7['id']:undefined,'tags':getTags(_0x5c3247[_0x5b97('0x13')],_0x5b97('0x14')),'subject':intUtil['getString'](_0x5c3247[_0x5b97('0x15')],_0x51efbb,'\x20'),'description':intUtil[_0x5b97('0x16')](_0x5c3247[_0x5b97('0x17')],_0x51efbb,'\x0a'),'comment':{'public':![],'body':intUtil[_0x5b97('0x16')](_0x5c3247[_0x5b97('0x17')],_0x51efbb,'\x0a')}},getCustomFields(_0x5c3247['Fields'],_0x51efbb))}})[_0x5b97('0x18')](function(_0x123c99){logger[_0x5b97('0xc')](_0x5b97('0x19'));return _0x123c99[_0x5b97('0x1a')];});}function getUser(_0x31d65e,_0x1d6dd8){if(intUtil[_0x5b97('0x1b')](_0x1d6dd8)){logger[_0x5b97('0xc')](_0x5b97('0x1c'),_0x1d6dd8);return request({'uri':util[_0x5b97('0xe')]('%s/search.json',_0x31d65e[_0x5b97('0x10')]),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x1d6dd8)}})[_0x5b97('0x18')](function(_0x6345db){if(_0x6345db[_0x5b97('0x1d')]){logger['info'](_0x5b97('0x1e'));return _['find'](_0x6345db[_0x5b97('0x1f')],{'email':_0x1d6dd8,'role':'agent'});}else{logger[_0x5b97('0xc')](_0x5b97('0x20'));return request({'uri':util[_0x5b97('0xe')](_0x5b97('0x21'),_0x31d65e[_0x5b97('0x10')])})[_0x5b97('0x18')](function(_0x5c48de){logger[_0x5b97('0xc')](_0x5b97('0x22'));return _0x5c48de[_0x5b97('0x23')];});}});}else{logger[_0x5b97('0xc')](_0x5b97('0x20'));return request({'uri':util[_0x5b97('0xe')](_0x5b97('0x21'),_0x31d65e[_0x5b97('0x10')])})['then'](function(_0x44d3d2){logger[_0x5b97('0xc')](_0x5b97('0x22'));return _0x44d3d2[_0x5b97('0x23')];});}}function getEndUser(_0x1699f5,_0xdb5417,_0xa3feac){logger['info'](_0x5b97('0x24'),_0xa3feac);return request({'uri':util[_0x5b97('0xe')](_0x5b97('0x25'),_0x1699f5[_0x5b97('0x10')]),'qs':{'query':util[_0x5b97('0xe')](_0x5b97('0x26'),_0xa3feac)}})[_0x5b97('0x18')](function(_0x177962){var _0x487d75;if(_0x177962[_0x5b97('0x1f')][_0x5b97('0x27')]){_0x177962['results']=_['filter'](_0x177962[_0x5b97('0x1f')],{'suspended':![],'role':_0x5b97('0x28')});if(_0x177962[_0x5b97('0x1f')][_0x5b97('0x27')]){_0x487d75=_['first'](_0x177962[_0x5b97('0x1f')]);}}if(_0x487d75){logger[_0x5b97('0xc')](_0x5b97('0x29'));return _0x487d75;}else{logger[_0x5b97('0xc')](_0x5b97('0x2a'));return request({'uri':util[_0x5b97('0xe')](_0x5b97('0x2b'),_0x1699f5[_0x5b97('0x10')]),'method':_0x5b97('0x11'),'body':{'user':{'role':_0x5b97('0x28'),'name':util[_0x5b97('0xe')](_0x5b97('0x2c'),_0xdb5417||_0xa3feac),'phone':_0xa3feac}}})[_0x5b97('0x18')](function(_0x5ec968){logger['info'](_0x5b97('0x2d'));return _0x5ec968[_0x5b97('0x23')];});}});}function getAuth(_0x33ddbe){var _0x57e61d;if(_0x33ddbe[_0x5b97('0x2e')]==='password'){_0x57e61d=util[_0x5b97('0xe')]('%s:%s',_0x33ddbe[_0x5b97('0x2f')],_0x33ddbe[_0x5b97('0x30')]);}else if(_0x33ddbe[_0x5b97('0x2e')]===_0x5b97('0x31')){_0x57e61d=util['format'](_0x5b97('0x32'),_0x33ddbe[_0x5b97('0x2f')],_0x33ddbe[_0x5b97('0x31')]);}return util[_0x5b97('0xe')](_0x5b97('0x33'),new Buffer(_0x57e61d)[_0x5b97('0x34')](_0x5b97('0x35')));}function request(_0x3e9955){logger[_0x5b97('0x36')](_0x5b97('0x37'),JSON['stringify'](_0x3e9955));return rp(_[_0x5b97('0x8')](_0x3e9955,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x115bc4,_0x5c69e6){var _0x77e8e5=[];if(_0x115bc4&&_0x115bc4['length']>0x0){_0x77e8e5=_[_0x5b97('0x38')](_0x115bc4,_0x5c69e6);}return _0x77e8e5;}function getCustomFields(_0x325cb1,_0x2ecc4c){var _0x35205b=[];var _0x5eb634={'custom_fields':[]};if(_0x325cb1[_0x5b97('0x27')]>0x0){_['forEach'](_0x325cb1,function(_0xc77933){if(_[_0x5b97('0x39')]([_0x5b97('0x3a'),_0x5b97('0x3b')],_0xc77933[_0x5b97('0x3c')])&&_0xc77933[_0x5b97('0x3d')]&&!_0xc77933[_0x5b97('0x3e')]){_0x5eb634[_0xc77933[_0x5b97('0x3d')][_0x5b97('0x3f')]()]=_0xc77933[_0x5b97('0x40')]['toString']();}else if(_['includes']([_0x5b97('0x3a'),_0x5b97('0x3b')],_0xc77933['type'])&&_0xc77933[_0x5b97('0x41')]&&_0xc77933[_0x5b97('0x3e')]){_0x5eb634[_0x5b97('0x42')][_0x5b97('0x43')]({'id':_0xc77933[_0x5b97('0x41')],'value':_0xc77933[_0x5b97('0x40')][_0x5b97('0x34')]()});}else if(_0xc77933[_0x5b97('0x3c')]===_0x5b97('0x44')&&_0xc77933['variableName']&&_0xc77933[_0x5b97('0x41')]&&_0xc77933[_0x5b97('0x3e')]){_0x2ecc4c[_0xc77933[_0x5b97('0x45')]]&&_0x5eb634[_0x5b97('0x42')][_0x5b97('0x43')]({'id':_0xc77933[_0x5b97('0x41')],'value':_0x2ecc4c[_0xc77933[_0x5b97('0x45')]][_0x5b97('0x34')]()});}else if(_0xc77933[_0x5b97('0x3c')]===_0x5b97('0x46')&&_0xc77933['Variable']&&_0xc77933[_0x5b97('0x47')][_0x5b97('0x14')]&&_0xc77933[_0x5b97('0x41')]&&_0xc77933[_0x5b97('0x3e')]){_0x2ecc4c[_0xc77933[_0x5b97('0x47')]['name'][_0x5b97('0x3f')]()]&&_0x5eb634[_0x5b97('0x42')]['push']({'id':_0xc77933[_0x5b97('0x41')],'value':_0x2ecc4c[_0xc77933['Variable'][_0x5b97('0x14')]['toLowerCase']()][_0x5b97('0x34')]()});}});}return _0x5eb634;}exports[_0x5b97('0x48')]=function(_0x40ccb9,_0xab620,_0x1b912a,_0x548632,_0x22dd28,_0x4d56e3){var _0x313cc6,_0x701cac;_0x4d56e3[_0x5b97('0x10')]=intUtil['stripTrailingSlash'](_0x4d56e3[_0x5b97('0x10')]);_0x4d56e3[_0x5b97('0x49')]=intUtil[_0x5b97('0x4a')](_0x4d56e3[_0x5b97('0x49')]);if(_0x22dd28&&_0x22dd28['monitor_format']){logger[_0x5b97('0xc')]('[QUEUE]',_0x5b97('0x4b'));_0xab620[_0x5b97('0x4c')]=util[_0x5b97('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4d56e3[_0x5b97('0x49')],_0xab620[_0x5b97('0x4d')],md5(_0xab620[_0x5b97('0x4d')]));}else{_0xab620['recordingURL']='';}headers[_0x5b97('0x4e')]=getAuth(_0x4d56e3);return getUser(_0x4d56e3,_0x548632[_0x5b97('0x4f')])[_0x5b97('0x18')](function(_0x17f9c8){_0x313cc6=_0x17f9c8;logger['info']('The\x20User\x20ID\x20is:',_0x313cc6['id']);return getEndUser(_0x4d56e3,_0xab620[_0x5b97('0x50')],_0xab620['calleridnum']);})[_0x5b97('0x18')](function(_0x5b46d1){_0x701cac=_0x5b46d1;logger[_0x5b97('0xc')]('The\x20Enduser\x20ID\x20is:',_0x701cac['id']);return getTicket(_0x4d56e3,_0x313cc6,_0x701cac,_0x1b912a,_0xab620);})[_0x5b97('0x18')](function(_0x7f956){if(_0x7f956){logger['info'](_0x5b97('0x51'),_0x7f956['id']);switch(_0x4d56e3[_0x5b97('0x3c')]){case _0x5b97('0x52'):logger[_0x5b97('0xc')](_0x5b97('0x53'),_0x5b97('0x54'));return request({'uri':util[_0x5b97('0xe')](_0x5b97('0x55'),_0x4d56e3[_0x5b97('0x10')],_0x313cc6['id'],_0x7f956['id']),'method':_0x5b97('0x11')});case _0x5b97('0x56'):logger['info']('[QUEUE]',_0x5b97('0x57'));emit(util[_0x5b97('0xe')]('user:%s',_0x548632[_0x5b97('0x14')]),_0x5b97('0x58'),{'uri':util[_0x5b97('0xe')](_0x5b97('0x59'),_0x4d56e3[_0x5b97('0x10')][_0x5b97('0x5a')](_0x5b97('0x5b'),''),_0x7f956['id'])});break;default:logger['error'](_0x5b97('0x53'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x2dd15a){logger[_0x5b97('0x5c')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x5b97('0x5d')](_0x2dd15a,{'showHidden':!![],'depth':null}));});};exports[_0x5b97('0x5e')]=function(_0x13570e,_0x342c07,_0x523294,_0x3b44a9,_0x216a23,_0x26572b,_0x555e5e){var _0x90380c,_0x47df63;_0x26572b['remoteUri']=intUtil[_0x5b97('0x4a')](_0x26572b['remoteUri']);_0x26572b[_0x5b97('0x49')]=intUtil[_0x5b97('0x4a')](_0x26572b[_0x5b97('0x49')]);if(_0x555e5e&&_0x555e5e['recordingFormat']&&_0x555e5e[_0x5b97('0x5f')]!==_0x5b97('0x60')){logger['info'](_0x5b97('0x61'),'Recording\x20is\x20enabled!');_0x342c07[_0x5b97('0x4c')]=util['format'](_0x5b97('0x62'),_0x26572b['serverUrl'],_0x342c07[_0x5b97('0x4d')],md5(_0x342c07[_0x5b97('0x4d')]));}headers['Authorization']=getAuth(_0x26572b);return getUser(_0x26572b,_0x3b44a9['email'])['then'](function(_0xe425f5){_0x90380c=_0xe425f5;logger[_0x5b97('0xc')](_0x5b97('0x63'),_0x90380c['id']);return getEndUser(_0x26572b,_0x342c07[_0x5b97('0x64')],_0x342c07[_0x5b97('0x65')]);})['then'](function(_0x50a248){_0x47df63=_0x50a248;logger[_0x5b97('0xc')](_0x5b97('0x66'),_0x47df63['id']);return getTicket(_0x26572b,_0x90380c,_0x47df63,_0x523294,_0x342c07);})[_0x5b97('0x18')](function(_0x1a8738){if(_0x1a8738){logger[_0x5b97('0xc')](_0x5b97('0x51'),_0x1a8738['id']);switch(_0x26572b[_0x5b97('0x3c')]){case _0x5b97('0x52'):logger[_0x5b97('0xc')](_0x5b97('0x61'),_0x5b97('0x54'));return request({'uri':util[_0x5b97('0xe')](_0x5b97('0x55'),_0x26572b[_0x5b97('0x10')],_0x90380c['id'],_0x1a8738['id']),'method':_0x5b97('0x11')});case _0x5b97('0x56'):logger['info']('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x5b97('0x67'),_0x3b44a9[_0x5b97('0x14')]),_0x5b97('0x58'),{'uri':util[_0x5b97('0xe')]('%s/agent/tickets/%s',_0x26572b[_0x5b97('0x10')][_0x5b97('0x5a')](_0x5b97('0x5b'),''),_0x1a8738['id'])});break;default:logger[_0x5b97('0x5c')]('[OUTBOUND]',_0x5b97('0x68'));}}})['catch'](function(_0x27bd45){logger[_0x5b97('0x5c')](_0x5b97('0x69'),util[_0x5b97('0x5d')](_0x27bd45,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x14b747,_0xe52e14,_0x4b320e,_0x4f23b3,_0x5b687a,_0x54ea25){var _0x476328,_0x29bfe7;_0x54ea25[_0x5b97('0x10')]=intUtil[_0x5b97('0x4a')](_0x54ea25[_0x5b97('0x10')]);_0x54ea25['serverUrl']=intUtil[_0x5b97('0x4a')](_0x54ea25[_0x5b97('0x49')]);if(_0x5b687a&&_0x5b687a[_0x5b97('0x6a')]){logger[_0x5b97('0xc')]('['+_0xe52e14[_0x5b97('0x6b')][_0x5b97('0x6c')]()+']',_0x5b97('0x4b'));_0xe52e14[_0x5b97('0x4c')]=util[_0x5b97('0xe')](_0x5b97('0x62'),_0x54ea25[_0x5b97('0x49')],_0xe52e14[_0x5b97('0x4d')],md5(_0xe52e14[_0x5b97('0x4d')]));}else{_0xe52e14['recordingURL']='';}headers[_0x5b97('0x4e')]=getAuth(_0x54ea25);return getUser(_0x54ea25)['then'](function(_0x1ba040){_0x476328=_0x1ba040;logger['info'](_0x5b97('0x63'),_0x476328['id']);return getEndUser(_0x54ea25,_0xe52e14['calleridname'],_0xe52e14[_0x5b97('0x6d')]);})[_0x5b97('0x18')](function(_0x3cef9c){_0x29bfe7=_0x3cef9c;logger[_0x5b97('0xc')](_0x5b97('0x66'),_0x29bfe7['id']);return getTicket(_0x54ea25,_0x476328,_0x29bfe7,_0x4b320e,_0xe52e14);})['then'](function(_0x11ce16){if(_0x11ce16){logger[_0x5b97('0xc')](_0x5b97('0x51'),_0x11ce16['id']);}})[_0x5b97('0x6e')](function(_0x3d4795){logger[_0x5b97('0x5c')]('['+_0xe52e14[_0x5b97('0x6b')][_0x5b97('0x6c')]()+']'+_0x5b97('0x6f'),util[_0x5b97('0x5d')](_0x3d4795,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x27d9=['[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','[OUTBOUND]','Authorization','destcalleridname','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','monitor_format','lastevent','lodash','request-promise','util','ioredis','./util','../../../../config/environment','redis','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','then','find','results','agent','Admin\x20account\x20selected.','%s/users/me.json','user','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','authType','password','%s:%s','token','%s/token:%s','username','Basic\x20%s','base64','[HTTP]','stringify','GET','map','forEach','includes','picklist','type','nameField','customField','toLowerCase','toString','string','content','variable','variableName','custom_fields','push','idField','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\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'];(function(_0x2d6359,_0x1b68c2){var _0x28e6e2=function(_0x2c5eeb){while(--_0x2c5eeb){_0x2d6359['push'](_0x2d6359['shift']());}};_0x28e6e2(++_0x1b68c2);}(_0x27d9,0x1ba));var _0x927d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x27d9[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x927d('0x0'));var rp=require(_0x927d('0x1'));var md5=require('md5');var util=require(_0x927d('0x2'));var Redis=require(_0x927d('0x3'));var intUtil=require(_0x927d('0x4'));var config=require(_0x927d('0x5'));var logger=require('../../../../config/logger')('zendesk');config[_0x927d('0x6')]=_['defaults'](config[_0x927d('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x927d('0x7'))(new Redis(config[_0x927d('0x6')]));function emit(_0x4f4b1f,_0x4f6918,_0x3a0959){io['to'](_0x4f4b1f)[_0x927d('0x8')](_0x4f6918,_0x3a0959);}var headers={'Content-Type':_0x927d('0x9'),'Accept':'application/json'};function getTicket(_0x3d20ca,_0x292783,_0x176ce0,_0x582935,_0x538818){logger[_0x927d('0xa')](_0x927d('0xb'));return request({'uri':util[_0x927d('0xc')]('%s/tickets.json',_0x3d20ca[_0x927d('0xd')]),'method':_0x927d('0xe'),'body':{'ticket':_[_0x927d('0xf')]({'requester_id':_0x176ce0['id'],'submitter_id':_0x292783?_0x292783['id']:undefined,'assignee_id':_0x292783?_0x292783['id']:undefined,'tags':getTags(_0x582935[_0x927d('0x10')],_0x927d('0x11')),'subject':intUtil[_0x927d('0x12')](_0x582935[_0x927d('0x13')],_0x538818,'\x20'),'description':intUtil[_0x927d('0x12')](_0x582935[_0x927d('0x14')],_0x538818,'\x0a'),'comment':{'public':![],'body':intUtil[_0x927d('0x12')](_0x582935[_0x927d('0x14')],_0x538818,'\x0a')}},getCustomFields(_0x582935[_0x927d('0x15')],_0x538818))}})['then'](function(_0x4b2517){logger['info'](_0x927d('0x16'));return _0x4b2517[_0x927d('0x17')];});}function getUser(_0x3d3c47,_0x13673e){if(intUtil[_0x927d('0x18')](_0x13673e)){logger[_0x927d('0xa')](_0x927d('0x19'),_0x13673e);return request({'uri':util[_0x927d('0xc')]('%s/search.json',_0x3d3c47[_0x927d('0xd')]),'qs':{'query':util[_0x927d('0xc')](_0x927d('0x1a'),_0x13673e)}})[_0x927d('0x1b')](function(_0xc50467){if(_0xc50467['count']){logger[_0x927d('0xa')]('Agent\x20found!');return _[_0x927d('0x1c')](_0xc50467[_0x927d('0x1d')],{'email':_0x13673e,'role':_0x927d('0x1e')});}else{logger[_0x927d('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x927d('0xc')]('%s/users/me.json',_0x3d3c47[_0x927d('0xd')])})[_0x927d('0x1b')](function(_0x74c4c5){logger['info'](_0x927d('0x1f'));return _0x74c4c5['user'];});}});}else{logger[_0x927d('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x927d('0xc')](_0x927d('0x20'),_0x3d3c47[_0x927d('0xd')])})[_0x927d('0x1b')](function(_0x3a9d44){logger[_0x927d('0xa')]('Admin\x20account\x20selected.');return _0x3a9d44[_0x927d('0x21')];});}}function getEndUser(_0x13c209,_0x3b8e45,_0x3854b8){logger[_0x927d('0xa')](_0x927d('0x22'),_0x3854b8);return request({'uri':util[_0x927d('0xc')](_0x927d('0x23'),_0x13c209['remoteUri']),'qs':{'query':util[_0x927d('0xc')](_0x927d('0x24'),_0x3854b8)}})[_0x927d('0x1b')](function(_0x502e40){var _0x57e0b5;if(_0x502e40[_0x927d('0x1d')][_0x927d('0x25')]){_0x502e40[_0x927d('0x1d')]=_['filter'](_0x502e40[_0x927d('0x1d')],{'suspended':![],'role':'end-user'});if(_0x502e40['results'][_0x927d('0x25')]){_0x57e0b5=_[_0x927d('0x26')](_0x502e40[_0x927d('0x1d')]);}}if(_0x57e0b5){logger[_0x927d('0xa')](_0x927d('0x27'));return _0x57e0b5;}else{logger[_0x927d('0xa')](_0x927d('0x28'));return request({'uri':util[_0x927d('0xc')](_0x927d('0x29'),_0x13c209[_0x927d('0xd')]),'method':'POST','body':{'user':{'role':_0x927d('0x2a'),'name':util[_0x927d('0xc')]('Caller\x20-\x20%s',_0x3b8e45||_0x3854b8),'phone':_0x3854b8}}})[_0x927d('0x1b')](function(_0x2cd343){logger[_0x927d('0xa')]('Enduser\x20created.');return _0x2cd343[_0x927d('0x21')];});}});}function getAuth(_0x5e3ae6){var _0x33ba0e;if(_0x5e3ae6[_0x927d('0x2b')]===_0x927d('0x2c')){_0x33ba0e=util[_0x927d('0xc')](_0x927d('0x2d'),_0x5e3ae6['username'],_0x5e3ae6[_0x927d('0x2c')]);}else if(_0x5e3ae6[_0x927d('0x2b')]===_0x927d('0x2e')){_0x33ba0e=util[_0x927d('0xc')](_0x927d('0x2f'),_0x5e3ae6[_0x927d('0x30')],_0x5e3ae6[_0x927d('0x2e')]);}return util['format'](_0x927d('0x31'),new Buffer(_0x33ba0e)['toString'](_0x927d('0x32')));}function request(_0x2191a4){logger['debug'](_0x927d('0x33'),JSON[_0x927d('0x34')](_0x2191a4));return rp(_['defaults'](_0x2191a4,{'method':_0x927d('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x5d4510,_0x56d11d){var _0x30d0b6=[];if(_0x5d4510&&_0x5d4510[_0x927d('0x25')]>0x0){_0x30d0b6=_[_0x927d('0x36')](_0x5d4510,_0x56d11d);}return _0x30d0b6;}function getCustomFields(_0x13dc61,_0x6f63ef){var _0x58e731=[];var _0x318b32={'custom_fields':[]};if(_0x13dc61['length']>0x0){_[_0x927d('0x37')](_0x13dc61,function(_0x56c47d){if(_[_0x927d('0x38')](['string',_0x927d('0x39')],_0x56c47d[_0x927d('0x3a')])&&_0x56c47d[_0x927d('0x3b')]&&!_0x56c47d[_0x927d('0x3c')]){_0x318b32[_0x56c47d[_0x927d('0x3b')][_0x927d('0x3d')]()]=_0x56c47d['content'][_0x927d('0x3e')]();}else if(_[_0x927d('0x38')]([_0x927d('0x3f'),_0x927d('0x39')],_0x56c47d[_0x927d('0x3a')])&&_0x56c47d['idField']&&_0x56c47d['customField']){_0x318b32['custom_fields']['push']({'id':_0x56c47d['idField'],'value':_0x56c47d[_0x927d('0x40')][_0x927d('0x3e')]()});}else if(_0x56c47d['type']===_0x927d('0x41')&&_0x56c47d[_0x927d('0x42')]&&_0x56c47d['idField']&&_0x56c47d['customField']){_0x6f63ef[_0x56c47d[_0x927d('0x42')]]&&_0x318b32[_0x927d('0x43')][_0x927d('0x44')]({'id':_0x56c47d[_0x927d('0x45')],'value':_0x6f63ef[_0x56c47d['variableName']][_0x927d('0x3e')]()});}else if(_0x56c47d[_0x927d('0x3a')]===_0x927d('0x46')&&_0x56c47d['Variable']&&_0x56c47d[_0x927d('0x47')][_0x927d('0x11')]&&_0x56c47d[_0x927d('0x45')]&&_0x56c47d[_0x927d('0x3c')]){_0x6f63ef[_0x56c47d[_0x927d('0x47')][_0x927d('0x11')]['toLowerCase']()]&&_0x318b32[_0x927d('0x43')][_0x927d('0x44')]({'id':_0x56c47d[_0x927d('0x45')],'value':_0x6f63ef[_0x56c47d[_0x927d('0x47')][_0x927d('0x11')]['toLowerCase']()]['toString']()});}});}return _0x318b32;}exports[_0x927d('0x48')]=function(_0x54dea9,_0x412788,_0x523c96,_0xd10119,_0x241e6d,_0x37711b){var _0x3c6a54,_0x3b64c2;_0x37711b['remoteUri']=intUtil[_0x927d('0x49')](_0x37711b['remoteUri']);_0x37711b[_0x927d('0x4a')]=intUtil[_0x927d('0x49')](_0x37711b[_0x927d('0x4a')]);if(_0x241e6d&&_0x241e6d['monitor_format']){logger[_0x927d('0xa')](_0x927d('0x4b'),_0x927d('0x4c'));_0x412788[_0x927d('0x4d')]=util[_0x927d('0xc')](_0x927d('0x4e'),_0x37711b[_0x927d('0x4a')],_0x412788[_0x927d('0x4f')],md5(_0x412788[_0x927d('0x4f')]));}else{_0x412788[_0x927d('0x4d')]='';}headers['Authorization']=getAuth(_0x37711b);return getUser(_0x37711b,_0xd10119[_0x927d('0x50')])[_0x927d('0x1b')](function(_0x2c3d4b){_0x3c6a54=_0x2c3d4b;logger[_0x927d('0xa')](_0x927d('0x51'),_0x3c6a54['id']);return getEndUser(_0x37711b,_0x412788[_0x927d('0x52')],_0x412788[_0x927d('0x53')]);})['then'](function(_0x1cc100){_0x3b64c2=_0x1cc100;logger[_0x927d('0xa')](_0x927d('0x54'),_0x3b64c2['id']);return getTicket(_0x37711b,_0x3c6a54,_0x3b64c2,_0x523c96,_0x412788);})['then'](function(_0x501225){if(_0x501225){logger[_0x927d('0xa')]('The\x20Ticket\x20ID\x20is:',_0x501225['id']);switch(_0x37711b[_0x927d('0x3a')]){case _0x927d('0x55'):logger[_0x927d('0xa')](_0x927d('0x4b'),_0x927d('0x56'));return request({'uri':util[_0x927d('0xc')](_0x927d('0x57'),_0x37711b[_0x927d('0xd')],_0x3c6a54['id'],_0x501225['id']),'method':'POST'});case _0x927d('0x58'):logger[_0x927d('0xa')](_0x927d('0x4b'),_0x927d('0x59'));emit(util[_0x927d('0xc')](_0x927d('0x5a'),_0xd10119[_0x927d('0x11')]),_0x927d('0x5b'),{'uri':util['format'](_0x927d('0x5c'),_0x37711b['remoteUri'][_0x927d('0x5d')](_0x927d('0x5e'),''),_0x501225['id'])});break;default:logger[_0x927d('0x5f')]('[QUEUE]',_0x927d('0x60'));}}})[_0x927d('0x61')](function(_0x40a80a){logger['error'](_0x927d('0x62'),util['inspect'](_0x40a80a,{'showHidden':!![],'depth':null}));});};exports[_0x927d('0x63')]=function(_0x5d48df,_0x486aec,_0x5de75b,_0x268891,_0xfd0b5d,_0x573425,_0x2fe325){var _0x49c9c2,_0x43cc2f;_0x573425[_0x927d('0xd')]=intUtil[_0x927d('0x49')](_0x573425['remoteUri']);_0x573425[_0x927d('0x4a')]=intUtil['stripTrailingSlash'](_0x573425['serverUrl']);if(_0x2fe325&&_0x2fe325['recordingFormat']&&_0x2fe325['recordingFormat']!=='none'){logger[_0x927d('0xa')](_0x927d('0x64'),_0x927d('0x4c'));_0x486aec[_0x927d('0x4d')]=util['format'](_0x927d('0x4e'),_0x573425[_0x927d('0x4a')],_0x486aec[_0x927d('0x4f')],md5(_0x486aec[_0x927d('0x4f')]));}headers[_0x927d('0x65')]=getAuth(_0x573425);return getUser(_0x573425,_0x268891[_0x927d('0x50')])[_0x927d('0x1b')](function(_0xa9693b){_0x49c9c2=_0xa9693b;logger[_0x927d('0xa')](_0x927d('0x51'),_0x49c9c2['id']);return getEndUser(_0x573425,_0x486aec[_0x927d('0x66')],_0x486aec['destcalleridnum']);})[_0x927d('0x1b')](function(_0x5a10ce){_0x43cc2f=_0x5a10ce;logger[_0x927d('0xa')]('The\x20Enduser\x20ID\x20is:',_0x43cc2f['id']);return getTicket(_0x573425,_0x49c9c2,_0x43cc2f,_0x5de75b,_0x486aec);})[_0x927d('0x1b')](function(_0x46b690){if(_0x46b690){logger[_0x927d('0xa')]('The\x20Ticket\x20ID\x20is:',_0x46b690['id']);switch(_0x573425[_0x927d('0x3a')]){case'integrationTab':logger['info'](_0x927d('0x64'),_0x927d('0x56'));return request({'uri':util['format'](_0x927d('0x57'),_0x573425[_0x927d('0xd')],_0x49c9c2['id'],_0x46b690['id']),'method':_0x927d('0xe')});case'newTab':logger[_0x927d('0xa')](_0x927d('0x64'),_0x927d('0x59'));emit(util['format'](_0x927d('0x5a'),_0x268891[_0x927d('0x11')]),_0x927d('0x5b'),{'uri':util[_0x927d('0xc')](_0x927d('0x5c'),_0x573425['remoteUri'][_0x927d('0x5d')](_0x927d('0x5e'),''),_0x46b690['id'])});break;default:logger['error'](_0x927d('0x64'),_0x927d('0x60'));}}})[_0x927d('0x61')](function(_0x1ce45f){logger[_0x927d('0x5f')](_0x927d('0x67'),util[_0x927d('0x68')](_0x1ce45f,{'showHidden':!![],'depth':null}));});};exports[_0x927d('0x69')]=function(_0x286eda,_0x7a28d2,_0x36b06c,_0x114238,_0x2e9f7f,_0x1f7e94){var _0x3c56f6,_0x421eb1;_0x1f7e94[_0x927d('0xd')]=intUtil[_0x927d('0x49')](_0x1f7e94['remoteUri']);_0x1f7e94[_0x927d('0x4a')]=intUtil['stripTrailingSlash'](_0x1f7e94[_0x927d('0x4a')]);if(_0x2e9f7f&&_0x2e9f7f[_0x927d('0x6a')]){logger[_0x927d('0xa')]('['+_0x7a28d2[_0x927d('0x6b')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x7a28d2['recordingURL']=util['format'](_0x927d('0x4e'),_0x1f7e94['serverUrl'],_0x7a28d2[_0x927d('0x4f')],md5(_0x7a28d2[_0x927d('0x4f')]));}else{_0x7a28d2[_0x927d('0x4d')]='';}headers[_0x927d('0x65')]=getAuth(_0x1f7e94);return getUser(_0x1f7e94)['then'](function(_0x32022a){_0x3c56f6=_0x32022a;logger['info'](_0x927d('0x51'),_0x3c56f6['id']);return getEndUser(_0x1f7e94,_0x7a28d2[_0x927d('0x52')],_0x7a28d2[_0x927d('0x53')]);})['then'](function(_0x11937c){_0x421eb1=_0x11937c;logger['info']('The\x20Enduser\x20ID\x20is:',_0x421eb1['id']);return getTicket(_0x1f7e94,_0x3c56f6,_0x421eb1,_0x36b06c,_0x7a28d2);})['then'](function(_0xc097c1){if(_0xc097c1){logger[_0x927d('0xa')]('The\x20Ticket\x20ID\x20is:',_0xc097c1['id']);}})[_0x927d('0x61')](function(_0x19a9d2){logger[_0x927d('0x5f')]('['+_0x7a28d2[_0x927d('0x6b')]['toUpperCase']()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x927d('0x68')](_0x19a9d2,{'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 5aa831e..2741231 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 _0x2cc1=['type','idField','toString','variable','variableName','Variable','name','toLowerCase','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','first_name','last_name','code','SUCCESS','Error:\x20','CREATE\x20ERROR','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','lead','Creating\x20new\x20call...','Owner','role','administrator','Subject','getString','Subjects','Description','Descriptions','Contacts','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','mm:ss','lastevent','called','Call_Result','Answered','Rejected','abandoned','timeout','Timeout','Call_Start_Time','outbound','Call_Type','Inbound','Fields','/crm/v2/Calls','Call\x20created!','err','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','uniqueid','recordingURL','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','Recording\x20is\x20enabled!','/api/voice/recordings/','/downloads?type=uniqueid&token=','destcalleridname','Outbound','[OUTBOUND]','unmanaged','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','zoho','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','includes','string','picklist'];(function(_0x3fb6bb,_0x29a7fa){var _0x348792=function(_0x361610){while(--_0x361610){_0x3fb6bb['push'](_0x3fb6bb['shift']());}};_0x348792(++_0x29a7fa);}(_0x2cc1,0x1bd));var _0x12cc=function(_0x13a8cc,_0x45b4fc){_0x13a8cc=_0x13a8cc-0x0;var _0x31b53c=_0x2cc1[_0x13a8cc];return _0x31b53c;};'use strict';var _=require(_0x12cc('0x0'));var rp=require(_0x12cc('0x1'));var md5=require(_0x12cc('0x2'));var util=require(_0x12cc('0x3'));var intUtil=require(_0x12cc('0x4'));var moment=require(_0x12cc('0x5'));var Redis=require(_0x12cc('0x6'));var BPromise=require(_0x12cc('0x7'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x12cc('0x8'));config[_0x12cc('0x9')]=_['defaults'](config['redis'],{'host':_0x12cc('0xa'),'port':0x18eb});var io=require(_0x12cc('0xb'))(new Redis(config[_0x12cc('0x9')]));function emit(_0x286d82,_0x1f9d00,_0x1597c0){io['to'](_0x286d82)[_0x12cc('0xc')](_0x1f9d00,_0x1597c0);}function request(_0x325d01){logger[_0x12cc('0xd')](_0x12cc('0xe'),JSON[_0x12cc('0xf')](_0x325d01));return rp(_0x325d01);}function getCustomFields(_0x27adee,_0x451a14){var _0x4fcf41={};if(_0x27adee[_0x12cc('0x10')]>0x0){_['forEach'](_0x27adee,function(_0x1e854a){if(_[_0x12cc('0x11')]([_0x12cc('0x12'),_0x12cc('0x13')],_0x1e854a[_0x12cc('0x14')])&&_0x1e854a[_0x12cc('0x15')]){_0x4fcf41[_0x1e854a['idField']]=_0x1e854a['content'][_0x12cc('0x16')]();}else if(_0x1e854a['type']===_0x12cc('0x17')&&_0x1e854a['variableName']&&_0x1e854a[_0x12cc('0x15')]&&_0x451a14[_0x1e854a[_0x12cc('0x18')]]){_0x4fcf41[_0x1e854a[_0x12cc('0x15')]]=_0x451a14[_0x1e854a[_0x12cc('0x18')]][_0x12cc('0x16')]();}else if(_0x1e854a[_0x12cc('0x14')]==='customVariable'&&_0x1e854a[_0x12cc('0x19')]&&_0x1e854a[_0x12cc('0x19')]['name']&&_0x1e854a[_0x12cc('0x15')]&&_0x451a14[_0x1e854a[_0x12cc('0x19')][_0x12cc('0x1a')][_0x12cc('0x1b')]()]){_0x4fcf41[_0x1e854a[_0x12cc('0x15')]]=_0x451a14[_0x1e854a[_0x12cc('0x19')][_0x12cc('0x1a')][_0x12cc('0x1b')]()][_0x12cc('0x16')]();}});}return _0x4fcf41;}function getName(_0x50e077){if(_0x50e077['indexOf']('\x20')>0x0){var _0x4898ee=_0x50e077[_0x12cc('0x1c')](/ (.+)/);if(_0x4898ee[0x1]){return _0x4898ee;}}return[_0x50e077,_0x50e077];}var accountsTokens={};function getAccessToken(_0x100fc5){return new Promise(function(_0x2973d4,_0x4180f1){if(!_[_0x12cc('0x1d')](accountsTokens[_0x100fc5['id']])&&!_[_0x12cc('0x1d')](accountsTokens[_0x100fc5['id']][_0x12cc('0x1e')])){if(moment()[_0x12cc('0x1f')](accountsTokens[_0x100fc5['id']][_0x12cc('0x20')])){_0x2973d4(accountsTokens[_0x100fc5['id']]['access_token']);}}var _0x3358a2;switch(_0x100fc5['zone']){case'US':_0x3358a2=_0x12cc('0x21');break;case'AU':_0x3358a2=_0x12cc('0x22');break;case'EU':_0x3358a2=_0x12cc('0x23');break;case'IN':_0x3358a2=_0x12cc('0x24');break;case'CN':_0x3358a2=_0x12cc('0x25');break;default:_0x3358a2='https://accounts.zoho.eu';break;}var _0x589150={'method':_0x12cc('0x26'),'uri':_0x3358a2+'/oauth/v2/token','qs':{'refresh_token':_0x100fc5[_0x12cc('0x27')],'client_id':_0x100fc5[_0x12cc('0x28')],'client_secret':_0x100fc5[_0x12cc('0x29')],'grant_type':_0x12cc('0x2a')},'json':!![]};return rp(_0x589150)[_0x12cc('0x2b')](function(_0x281da6){accountsTokens[_0x100fc5['id']]={'access_token':_0x281da6[_0x12cc('0x1e')],'expires_in':moment()[_0x12cc('0x2c')](_0x281da6[_0x12cc('0x20')],_0x12cc('0x2d'))};_0x2973d4(_0x281da6[_0x12cc('0x1e')]);})[_0x12cc('0x2e')](function(_0x420222){logger[_0x12cc('0x2f')](_0x12cc('0x30'),_0x420222[_0x12cc('0x31')]);_0x4180f1(_0x420222);});});}function getUser(_0x5cb159,_0x38413b,_0xfbb4f2,_0x781b72){logger[_0x12cc('0x32')](_0x12cc('0x33'));return request({'method':_0x12cc('0x34'),'uri':util[_0x12cc('0x35')]('https://www.zohoapis.%s/crm/v2/users',_0x38413b),'qs':{'type':_0x12cc('0x36')},'headers':{'Authorization':_0x12cc('0x37')+_0x5cb159},'json':!![]})[_0x12cc('0x2b')](function(_0xfdb7a3){if(_0xfdb7a3[_0x12cc('0x38')]){var _0x5b21e0=-0x1;if(_[_0x12cc('0x39')](_0xfdb7a3[_0x12cc('0x38')])){if(!_[_0x12cc('0x1d')](_0x781b72)){_0x5b21e0=_[_0x12cc('0x3a')](_0xfdb7a3[_0x12cc('0x38')],function(_0x32778c){return _0x32778c[_0x12cc('0x3b')]===_0x781b72;});}if(_0x5b21e0>=0x0){logger[_0x12cc('0x32')](_0x12cc('0x3c'));}else{logger[_0x12cc('0x32')](_0x12cc('0x3d'));_0x5b21e0=_[_0x12cc('0x3a')](_0xfdb7a3[_0x12cc('0x38')],function(_0xeff133){return _0xeff133[_0x12cc('0x3e')]['name']===_0x12cc('0x3f');});}return _0xfdb7a3[_0x12cc('0x38')][_0x5b21e0];}else{if(_0xfdb7a3[_0x12cc('0x40')][_0x12cc('0x3e')][_0x12cc('0x1a')]===_0x12cc('0x3f')){logger['info'](_0x12cc('0x3d'));user=_0xfdb7a3[_0x12cc('0x40')];return user;}else{logger[_0x12cc('0x2f')]('The\x20failing\x20result\x20is',JSON[_0x12cc('0xf')](_0xfdb7a3));throw new Error(_0x12cc('0x41')+JSON[_0x12cc('0xf')](_0xfdb7a3));}}}else{logger[_0x12cc('0x2f')](_0x12cc('0x42'),JSON['stringify'](_0xfdb7a3));throw new Error(_0x12cc('0x41')+JSON[_0x12cc('0xf')](_0xfdb7a3));}})[_0x12cc('0x2e')](function(_0x1c17f8){console[_0x12cc('0x2f')](_0x1c17f8);});}function getZohoUser(_0x45edf4,_0x3162d6){return new BPromise(function(_0x3edbc6,_0x402aae){request(_0x45edf4)[_0x12cc('0x2b')](function(_0x2ece53){var _0x4f675f=null;if(_0x2ece53){_0x4f675f=_0x2ece53[_0x12cc('0x43')][0x0];_0x4f675f[_0x12cc('0x44')]=_0x3162d6;}_0x3edbc6(_0x4f675f);})[_0x12cc('0x2e')](function(_0x9f74e8){_0x402aae(_0x9f74e8);});});}function createEndUser(_0x468bc6,_0x591571,_0x1f73c4,_0x5adae7,_0x46914a,_0x19f99b){var _0x1f73c4=getName(_0x1f73c4);return request({'method':_0x12cc('0x26'),'uri':_0x12cc('0x45')+_0x591571+_0x12cc('0x46')+_[_0x12cc('0x47')](_0x19f99b[_0x12cc('0x48')])+'s','body':{'data':[{'Last_Name':_0x1f73c4[0x1],'First_Name':_0x1f73c4[0x0],'Phone':_0x5adae7,'Owner':{'name':!_['isNil'](_0x46914a['role']['name'])?_0x46914a['role'][_0x12cc('0x1a')]:!_[_0x12cc('0x1d')](_0x46914a[_0x12cc('0x49')])?_0x46914a[_0x12cc('0x49')]+'\x20'+_0x46914a[_0x12cc('0x4a')]:_0x46914a[_0x12cc('0x4a')],'id':_0x46914a['id']}}]},'headers':{'Authorization':_0x12cc('0x37')+_0x468bc6},'json':!![]})[_0x12cc('0x2b')](function(_0xf38a14){if(_0xf38a14&&_0xf38a14['data'][0x0][_0x12cc('0x4b')]===_0x12cc('0x4c')){var _0x325a51=_0xf38a14[_0x12cc('0x43')][0x0]['details'];_0x325a51['enduserType']=_[_0x12cc('0x47')](_0x19f99b[_0x12cc('0x48')])+'s';return _0x325a51;}logger[_0x12cc('0x2f')](_0x12cc('0x42'),JSON[_0x12cc('0xf')](data));throw new Error(_0x12cc('0x4d')+JSON[_0x12cc('0xf')](data));})[_0x12cc('0x2e')](function(_0x3e55db){console['log'](_0x12cc('0x4e'),_0x3e55db);});}function getEndUser(_0x3d860e,_0x570625,_0x324916,_0x5d3a55,_0x370749,_0x2d8181,_0x58c359){var _0x3799c4={'method':'GET','uri':'','headers':{'Authorization':_0x12cc('0x37')+_0x3d860e},'json':!![]};switch(_0x58c359['moduleSearch']){case _0x12cc('0x4f'):_0x3799c4['uri']=_0x12cc('0x45')+_0x570625+_0x12cc('0x50')+_0x370749+'))';return getZohoUser(_0x3799c4,'Contacts')[_0x12cc('0x2b')](function(_0x8e888d){if(_0x8e888d)return _0x8e888d;_0x3799c4[_0x12cc('0x51')]=_0x12cc('0x45')+_0x570625+_0x12cc('0x52')+_0x370749+'))';return getZohoUser(_0x3799c4,_0x12cc('0x53'))[_0x12cc('0x2b')](function(_0x426ec5){if(_0x426ec5)return _0x426ec5;if(_0x58c359[_0x12cc('0x48')]!=_0x12cc('0x54')){return createEndUser(_0x3d860e,_0x570625,_0x5d3a55,_0x370749,_0x2d8181,_0x58c359);}else{return{};}});});break;case'contact':_0x3799c4[_0x12cc('0x51')]='https://www.zohoapis.'+_0x570625+_0x12cc('0x50')+_0x370749+'))';return getZohoUser(_0x3799c4,'Contacts')[_0x12cc('0x2b')](function(_0x1df8d8){if(_0x1df8d8)return _0x1df8d8;if(_0x58c359[_0x12cc('0x48')]!=_0x12cc('0x54')){return createEndUser(_0x3d860e,_0x570625,_0x5d3a55,_0x370749,_0x2d8181,_0x58c359);}else{return{};}});break;case _0x12cc('0x55'):_0x3799c4[_0x12cc('0x51')]=_0x12cc('0x45')+_0x570625+_0x12cc('0x52')+_0x370749+'))';return getZohoUser(_0x3799c4,_0x12cc('0x53'))[_0x12cc('0x2b')](function(_0x3614fc){if(_0x3614fc)return _0x3614fc;if(_0x58c359[_0x12cc('0x48')]!=_0x12cc('0x54')){return createEndUser(_0x3d860e,_0x570625,_0x5d3a55,_0x370749,_0x2d8181,_0x58c359);}else{return{};}});break;}}function getCall(_0x302b94,_0x4b1098,_0x4a1404,_0x31273b,_0x41eb51,_0x489e8b,_0x3bd84a,_0x31290e){logger[_0x12cc('0x32')](_0x12cc('0x56'));var _0x432187={};_0x432187[_0x12cc('0x57')]={'name':!_[_0x12cc('0x1d')](_0x31273b[_0x12cc('0x58')][_0x12cc('0x1a')])&&!_[_0x12cc('0x1d')](_0x31273b[_0x12cc('0x3e')][_0x12cc('0x1a')])&&_0x31273b[_0x12cc('0x3e')][_0x12cc('0x1a')]===_0x12cc('0x59')?_0x31273b[_0x12cc('0x58')][_0x12cc('0x1a')]:!_[_0x12cc('0x1d')](_0x31273b['first_name'])?_0x31273b[_0x12cc('0x49')]+'\x20'+_0x31273b[_0x12cc('0x4a')]:_0x31273b[_0x12cc('0x4a')],'id':_0x31273b['id']};_0x432187[_0x12cc('0x5a')]=intUtil[_0x12cc('0x5b')](_0x489e8b[_0x12cc('0x5c')],_0x3bd84a,'\x20');_0x432187[_0x12cc('0x5d')]=intUtil[_0x12cc('0x5b')](_0x489e8b[_0x12cc('0x5e')],_0x3bd84a,'\x0a');if(_0x41eb51[_0x12cc('0x44')]===_0x12cc('0x5f')){_0x432187['Who_Id']={'name':!_['isNil'](_0x41eb51['Full_Name'])?_0x41eb51[_0x12cc('0x60')]:!_[_0x12cc('0x1d')](_0x41eb51[_0x12cc('0x61')])?_0x41eb51['First_Name']+'\x20'+_0x41eb51[_0x12cc('0x62')]:_0x41eb51[_0x12cc('0x62')],'id':_0x41eb51['id']};}if(_0x41eb51['enduserType']==='Leads'){_0x432187[_0x12cc('0x63')]={'name':!_[_0x12cc('0x1d')](_0x41eb51[_0x12cc('0x60')])?_0x41eb51[_0x12cc('0x60')]:!_['isNil'](_0x41eb51['First_Name'])?_0x41eb51['First_Name']+'\x20'+_0x41eb51['Last_Name']:_0x41eb51[_0x12cc('0x62')],'id':_0x41eb51['id']};_0x432187[_0x12cc('0x64')]=_[_0x12cc('0x47')](_0x41eb51[_0x12cc('0x44')]);}if(_0x3bd84a[_0x12cc('0x65')]){_0x432187[_0x12cc('0x66')]=moment[_0x12cc('0x67')](parseInt(_0x3bd84a[_0x12cc('0x65')])*0x3e8)[_0x12cc('0x35')]('mm:ss');}else if(_0x3bd84a[_0x12cc('0x68')]&&_0x3bd84a[_0x12cc('0x69')]){_0x432187['Call_Duration']=moment[_0x12cc('0x67')](moment(_0x3bd84a[_0x12cc('0x69')],_0x12cc('0x6a'))[_0x12cc('0x6b')](moment(_0x3bd84a['starttime'],'YYYY-MM-DDTHH:mm:ss')))[_0x12cc('0x35')](_0x12cc('0x6c'));}switch(_0x3bd84a[_0x12cc('0x6d')]){case _0x12cc('0x6e'):_0x432187['Call_Result']='Called';break;case'complete':case'connect':_0x432187[_0x12cc('0x6f')]=_0x12cc('0x70');break;case'rejected':_0x432187[_0x12cc('0x6f')]=_0x12cc('0x71');break;case _0x12cc('0x72'):_0x432187[_0x12cc('0x6f')]='Abandoned';break;case _0x12cc('0x73'):_0x432187['Call_Result']=_0x12cc('0x74');default:}_0x432187[_0x12cc('0x75')]=(_0x31290e===_0x12cc('0x76')?moment(_0x3bd84a['starttime'])['format'](_0x12cc('0x6a')):moment(_0x3bd84a['agentcalledAt'])[_0x12cc('0x35')](_0x12cc('0x6a')))||moment()['format'](_0x12cc('0x6a'));_0x432187[_0x12cc('0x77')]=_0x31290e||_0x12cc('0x78');_0x432187=_['merge'](_0x432187,getCustomFields(_0x489e8b[_0x12cc('0x79')],_0x3bd84a));return request({'method':_0x12cc('0x26'),'uri':'https://www.zohoapis.'+_0x4b1098+_0x12cc('0x7a'),'headers':{'Authorization':_0x12cc('0x37')+_0x302b94},'body':{'data':[_0x432187]},'json':!![]})[_0x12cc('0x2b')](function(_0x100163){if(_0x100163&&_0x100163[_0x12cc('0x43')][0x0][_0x12cc('0x4b')]===_0x12cc('0x4c')){logger[_0x12cc('0x32')](_0x12cc('0x7b'));return{'id':_0x100163[_0x12cc('0x43')][0x0]['details']['id']};}})[_0x12cc('0x2e')](function(_0xfa73e1){logger[_0x12cc('0x32')](_0x12cc('0x7c'),_0xfa73e1[_0x12cc('0x31')]);console[_0x12cc('0x7d')](_0x12cc('0x7c'),_0xfa73e1);});}exports[_0x12cc('0x7e')]=function(_0x54a876,_0x390ef9,_0x2c4402,_0x4a806d,_0x21d846,_0x279a7e){var _0x415689,_0x55740b,_0x1492ae;_0x279a7e[_0x12cc('0x7f')]=intUtil[_0x12cc('0x80')](_0x279a7e[_0x12cc('0x7f')]);_0x279a7e[_0x12cc('0x81')]=intUtil['stripTrailingSlash'](_0x279a7e[_0x12cc('0x81')]);if(_0x21d846&&_0x21d846[_0x12cc('0x82')]){logger[_0x12cc('0x32')](_0x12cc('0x83'),'Recording\x20is\x20enabled!');_0x390ef9['recordingURL']=_0x279a7e[_0x12cc('0x81')]+'/api/voice/recordings/'+_0x390ef9[_0x12cc('0x84')]+'/downloads?type=uniqueid&token='+md5(_0x390ef9['uniqueid']);}else{_0x390ef9[_0x12cc('0x85')]='';}var _0x5329aa=_0x279a7e[_0x12cc('0x7f')]===_0x12cc('0x86')?'eu':_0x12cc('0x87');return getAccessToken(_0x279a7e)[_0x12cc('0x2b')](function(_0x111cdd){_0x1492ae=_0x111cdd;return getUser(_0x1492ae,_0x5329aa,_0x279a7e,_0x4a806d[_0x12cc('0x3b')]);})[_0x12cc('0x2b')](function(_0x377169){_0x415689=_0x377169;logger[_0x12cc('0x32')](_0x12cc('0x88'),_0x415689['id']);return getEndUser(_0x1492ae,_0x5329aa,_0x279a7e,_0x390ef9[_0x12cc('0x89')],_0x390ef9[_0x12cc('0x8a')],_0x415689,_0x2c4402);})[_0x12cc('0x2b')](function(_0x59cc83){_0x55740b=_0x59cc83;return getCall(_0x1492ae,_0x5329aa,_0x279a7e,_0x415689,_0x55740b,_0x2c4402,_0x390ef9,_0x12cc('0x78'));})['then'](function(_0x3ab869){if(_0x3ab869){logger[_0x12cc('0x32')](_0x12cc('0x8b'),_0x3ab869['id']);logger[_0x12cc('0x32')]('[QUEUE]',_0x12cc('0x8c'));emit(util[_0x12cc('0x35')](_0x12cc('0x8d'),_0x4a806d['name']),_0x12cc('0x8e'),{'uri':_0x12cc('0x8f')+_0x279a7e['host']+_0x12cc('0x90')+_0x3ab869['id']});}})[_0x12cc('0x2e')](function(_0x5424b2){logger[_0x12cc('0x2f')](_0x12cc('0x83'),JSON[_0x12cc('0xf')](_0x5424b2));});};exports[_0x12cc('0x76')]=function(_0xc724c4,_0x44ab5b,_0x19e192,_0x34ba39,_0x2c3664,_0x510300,_0x91ddd4){var _0x33fda1,_0x137ebd,_0x562c8e;_0x510300['host']=intUtil[_0x12cc('0x80')](_0x510300[_0x12cc('0x7f')]);_0x510300[_0x12cc('0x81')]=intUtil['stripTrailingSlash'](_0x510300[_0x12cc('0x81')]);if(_0x91ddd4&&_0x91ddd4[_0x12cc('0x91')]&&_0x91ddd4[_0x12cc('0x91')]!==_0x12cc('0x92')){logger[_0x12cc('0x32')]('[OUTBOUND]',_0x12cc('0x93'));_0x44ab5b[_0x12cc('0x85')]=_0x510300['serverUrl']+_0x12cc('0x94')+_0x44ab5b[_0x12cc('0x84')]+_0x12cc('0x95')+md5(_0x44ab5b[_0x12cc('0x84')]);}var _0x28bdc4=_0x510300[_0x12cc('0x7f')]==='zoho.eu'?'eu':_0x12cc('0x87');return getAccessToken(_0x510300)[_0x12cc('0x2b')](function(_0x251ee8){_0x562c8e=_0x251ee8;return getUser(_0x562c8e,_0x28bdc4,_0x510300,_0x34ba39[_0x12cc('0x3b')]);})[_0x12cc('0x2b')](function(_0x3382f2){_0x33fda1=_0x3382f2;logger[_0x12cc('0x32')]('The\x20User\x20ID\x20is:',_0x33fda1['id']);return getEndUser(_0x562c8e,_0x28bdc4,_0x510300,_0x44ab5b[_0x12cc('0x96')],_0x44ab5b['destcalleridnum'],_0x33fda1,_0x19e192);})[_0x12cc('0x2b')](function(_0x348f4d){_0x137ebd=_0x348f4d;return getCall(_0x562c8e,_0x28bdc4,_0x510300,_0x33fda1,_0x137ebd,_0x19e192,_0x44ab5b,_0x12cc('0x97'));})[_0x12cc('0x2b')](function(_0x2b5063){if(_0x2b5063){logger['info'](_0x12cc('0x8b'),_0x2b5063['id']);logger[_0x12cc('0x32')](_0x12cc('0x98'),_0x12cc('0x8c'));emit(util[_0x12cc('0x35')]('user:%s',_0x34ba39[_0x12cc('0x1a')]),_0x12cc('0x8e'),{'uri':_0x12cc('0x8f')+_0x510300[_0x12cc('0x7f')]+_0x12cc('0x90')+_0x2b5063['id']});}})[_0x12cc('0x2e')](function(_0x7d716){logger[_0x12cc('0x2f')](_0x12cc('0x98'),JSON[_0x12cc('0xf')](_0x7d716));});};exports[_0x12cc('0x99')]=function(_0x2153f3,_0x4ac83f,_0x2faa98,_0x3c92b6,_0x5ac74d,_0x51ee55){var _0x37d2e6,_0x31471b,_0x424063;_0x51ee55[_0x12cc('0x7f')]=intUtil[_0x12cc('0x80')](_0x51ee55['host']);_0x51ee55[_0x12cc('0x81')]=intUtil[_0x12cc('0x80')](_0x51ee55[_0x12cc('0x81')]);if(_0x5ac74d&&_0x5ac74d[_0x12cc('0x82')]){logger[_0x12cc('0x32')]('['+_0x4ac83f[_0x12cc('0x6d')][_0x12cc('0x9a')]()+']',_0x12cc('0x93'));_0x4ac83f[_0x12cc('0x85')]=_0x51ee55[_0x12cc('0x81')]+_0x12cc('0x94')+_0x4ac83f[_0x12cc('0x84')]+_0x12cc('0x95')+md5(_0x4ac83f['uniqueid']);}else{_0x4ac83f['recordingURL']='';}var _0x1f6461=_0x51ee55[_0x12cc('0x7f')]===_0x12cc('0x86')?'eu':_0x12cc('0x87');return getAccessToken(_0x51ee55)[_0x12cc('0x2b')](function(_0x26b5be){_0x424063=_0x26b5be;return getUser(_0x424063,_0x1f6461,_0x51ee55);})[_0x12cc('0x2b')](function(_0x52d60c){_0x37d2e6=_0x52d60c;logger[_0x12cc('0x32')](_0x12cc('0x88'),_0x37d2e6['id']);return getEndUser(_0x424063,_0x1f6461,_0x51ee55,_0x4ac83f['calleridname'],_0x4ac83f['calleridnum'],_0x37d2e6,_0x2faa98);})[_0x12cc('0x2b')](function(_0x5f1b53){_0x31471b=_0x5f1b53;return getCall(_0x424063,_0x1f6461,_0x51ee55,_0x37d2e6,_0x31471b,_0x2faa98,_0x4ac83f,_0x12cc('0x78'));})[_0x12cc('0x2b')](function(_0x4881e3){if(_0x4881e3){logger[_0x12cc('0x32')](_0x12cc('0x8b'),_0x4881e3['id']);}})[_0x12cc('0x2e')](function(_0x54c2c7){logger[_0x12cc('0x2f')]('['+_0x4ac83f['lastevent'][_0x12cc('0x9a')]()+']',JSON[_0x12cc('0xf')](_0x54c2c7));});}; \ No newline at end of file +var _0x501f=['Inbound','merge','/crm/v2/Calls','code','details','stack','err','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','com','The\x20User\x20ID\x20is:','[QUEUE]','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','zoho.eu','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','toUpperCase','The\x20Call\x20ID\x20is:','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','includes','idField','content','toString','type','variableName','customVariable','Variable','name','toLowerCase','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','then','add','seconds','catch','error','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','data','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','SUCCESS','Error:\x20','CREATE\x20ERROR','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Owner','administrator','Subject','getString','Description','Descriptions','enduserType','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','connect','Answered','Rejected','abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt'];(function(_0x410645,_0x157086){var _0xa2d2a6=function(_0x6d994f){while(--_0x6d994f){_0x410645['push'](_0x410645['shift']());}};_0xa2d2a6(++_0x157086);}(_0x501f,0x1db));var _0xf501=function(_0x2db71d,_0x57cf58){_0x2db71d=_0x2db71d-0x0;var _0x21088e=_0x501f[_0x2db71d];return _0x21088e;};'use strict';var _=require('lodash');var rp=require(_0xf501('0x0'));var md5=require(_0xf501('0x1'));var util=require(_0xf501('0x2'));var intUtil=require('./util');var moment=require('moment');var Redis=require(_0xf501('0x3'));var BPromise=require('bluebird');var config=require(_0xf501('0x4'));var logger=require(_0xf501('0x5'))(_0xf501('0x6'));config[_0xf501('0x7')]=_['defaults'](config[_0xf501('0x7')],{'host':_0xf501('0x8'),'port':0x18eb});var io=require(_0xf501('0x9'))(new Redis(config[_0xf501('0x7')]));function emit(_0x353ece,_0x11668d,_0xed9244){io['to'](_0x353ece)[_0xf501('0xa')](_0x11668d,_0xed9244);}function request(_0xd0d40a){logger[_0xf501('0xb')](_0xf501('0xc'),JSON[_0xf501('0xd')](_0xd0d40a));return rp(_0xd0d40a);}function getCustomFields(_0x52dbbb,_0x592360){var _0x75fd72={};if(_0x52dbbb[_0xf501('0xe')]>0x0){_[_0xf501('0xf')](_0x52dbbb,function(_0x3b3e54){if(_[_0xf501('0x10')](['string','picklist'],_0x3b3e54['type'])&&_0x3b3e54[_0xf501('0x11')]){_0x75fd72[_0x3b3e54[_0xf501('0x11')]]=_0x3b3e54[_0xf501('0x12')][_0xf501('0x13')]();}else if(_0x3b3e54[_0xf501('0x14')]==='variable'&&_0x3b3e54[_0xf501('0x15')]&&_0x3b3e54[_0xf501('0x11')]&&_0x592360[_0x3b3e54[_0xf501('0x15')]]){_0x75fd72[_0x3b3e54[_0xf501('0x11')]]=_0x592360[_0x3b3e54[_0xf501('0x15')]]['toString']();}else if(_0x3b3e54['type']===_0xf501('0x16')&&_0x3b3e54[_0xf501('0x17')]&&_0x3b3e54[_0xf501('0x17')]['name']&&_0x3b3e54['idField']&&_0x592360[_0x3b3e54[_0xf501('0x17')][_0xf501('0x18')][_0xf501('0x19')]()]){_0x75fd72[_0x3b3e54[_0xf501('0x11')]]=_0x592360[_0x3b3e54[_0xf501('0x17')]['name']['toLowerCase']()][_0xf501('0x13')]();}});}return _0x75fd72;}function getName(_0x21e685){if(_0x21e685['indexOf']('\x20')>0x0){var _0xa6230=_0x21e685[_0xf501('0x1a')](/ (.+)/);if(_0xa6230[0x1]){return _0xa6230;}}return[_0x21e685,_0x21e685];}var accountsTokens={};function getAccessToken(_0x402cff){return new Promise(function(_0x1a42ef,_0x21566d){if(!_[_0xf501('0x1b')](accountsTokens[_0x402cff['id']])&&!_[_0xf501('0x1b')](accountsTokens[_0x402cff['id']][_0xf501('0x1c')])){if(moment()[_0xf501('0x1d')](accountsTokens[_0x402cff['id']][_0xf501('0x1e')])){_0x1a42ef(accountsTokens[_0x402cff['id']][_0xf501('0x1c')]);}}var _0x5388d7;switch(_0x402cff[_0xf501('0x1f')]){case'US':_0x5388d7=_0xf501('0x20');break;case'AU':_0x5388d7=_0xf501('0x21');break;case'EU':_0x5388d7=_0xf501('0x22');break;case'IN':_0x5388d7=_0xf501('0x23');break;case'CN':_0x5388d7=_0xf501('0x24');break;default:_0x5388d7=_0xf501('0x22');break;}var _0x15427b={'method':_0xf501('0x25'),'uri':_0x5388d7+'/oauth/v2/token','qs':{'refresh_token':_0x402cff[_0xf501('0x26')],'client_id':_0x402cff[_0xf501('0x27')],'client_secret':_0x402cff[_0xf501('0x28')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x15427b)[_0xf501('0x29')](function(_0x527b63){accountsTokens[_0x402cff['id']]={'access_token':_0x527b63[_0xf501('0x1c')],'expires_in':moment()[_0xf501('0x2a')](_0x527b63[_0xf501('0x1e')],_0xf501('0x2b'))};_0x1a42ef(_0x527b63['access_token']);})[_0xf501('0x2c')](function(_0x28b623){logger[_0xf501('0x2d')]('Failing\x20creating\x20the\x20access_token',_0x28b623['stack']);_0x21566d(_0x28b623);});});}function getUser(_0x42bc04,_0x3d2916,_0x4a2b86,_0x4ff6b9){logger[_0xf501('0x2e')](_0xf501('0x2f'));return request({'method':_0xf501('0x30'),'uri':util[_0xf501('0x31')](_0xf501('0x32'),_0x3d2916),'qs':{'type':_0xf501('0x33')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x42bc04},'json':!![]})[_0xf501('0x29')](function(_0x231b46){if(_0x231b46[_0xf501('0x34')]){var _0x3f8e12=-0x1;if(_[_0xf501('0x35')](_0x231b46['users'])){if(!_[_0xf501('0x1b')](_0x4ff6b9)){_0x3f8e12=_[_0xf501('0x36')](_0x231b46[_0xf501('0x34')],function(_0x5802f){return _0x5802f[_0xf501('0x37')]===_0x4ff6b9;});}if(_0x3f8e12>=0x0){logger[_0xf501('0x2e')](_0xf501('0x38'));}else{logger[_0xf501('0x2e')](_0xf501('0x39'));_0x3f8e12=_[_0xf501('0x36')](_0x231b46[_0xf501('0x34')],function(_0x2846ef){return _0x2846ef[_0xf501('0x3a')][_0xf501('0x18')]==='Administrator';});}return _0x231b46[_0xf501('0x34')][_0x3f8e12];}else{if(_0x231b46['user']['profile'][_0xf501('0x18')]===_0xf501('0x3b')){logger[_0xf501('0x2e')]('Using\x20the\x20admin\x20account!');user=_0x231b46[_0xf501('0x3c')];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0xf501('0xd')](_0x231b46));throw new Error(_0xf501('0x3d')+JSON[_0xf501('0xd')](_0x231b46));}}}else{logger[_0xf501('0x2d')](_0xf501('0x3e'),JSON[_0xf501('0xd')](_0x231b46));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xf501('0xd')](_0x231b46));}})[_0xf501('0x2c')](function(_0x5edf48){console['error'](_0x5edf48);});}function getZohoUser(_0x402363,_0x15a7d1){return new BPromise(function(_0x20c730,_0x50855d){request(_0x402363)[_0xf501('0x29')](function(_0x4ebf27){var _0x5e8c5d=null;if(_0x4ebf27){_0x5e8c5d=_0x4ebf27[_0xf501('0x3f')][0x0];_0x5e8c5d['enduserType']=_0x15a7d1;}_0x20c730(_0x5e8c5d);})['catch'](function(_0xf502f1){_0x50855d(_0xf502f1);});});}function createEndUser(_0x860523,_0x41a00a,_0x3995c4,_0x41ae20,_0x59fad5,_0x479bb2){var _0x3995c4=getName(_0x3995c4);return request({'method':'POST','uri':_0xf501('0x40')+_0x41a00a+_0xf501('0x41')+_[_0xf501('0x42')](_0x479bb2[_0xf501('0x43')])+'s','body':{'data':[{'Last_Name':_0x3995c4[0x1],'First_Name':_0x3995c4[0x0],'Phone':_0x41ae20,'Owner':{'name':!_[_0xf501('0x1b')](_0x59fad5[_0xf501('0x44')][_0xf501('0x18')])?_0x59fad5[_0xf501('0x44')]['name']:!_['isNil'](_0x59fad5['first_name'])?_0x59fad5[_0xf501('0x45')]+'\x20'+_0x59fad5[_0xf501('0x46')]:_0x59fad5[_0xf501('0x46')],'id':_0x59fad5['id']}}]},'headers':{'Authorization':_0xf501('0x47')+_0x860523},'json':!![]})[_0xf501('0x29')](function(_0x1e015f){if(_0x1e015f&&_0x1e015f['data'][0x0]['code']===_0xf501('0x48')){var _0x35a8f9=_0x1e015f[_0xf501('0x3f')][0x0]['details'];_0x35a8f9['enduserType']=_['startCase'](_0x479bb2[_0xf501('0x43')])+'s';return _0x35a8f9;}logger['error'](_0xf501('0x3e'),JSON[_0xf501('0xd')](data));throw new Error(_0xf501('0x49')+JSON[_0xf501('0xd')](data));})['catch'](function(_0x38c8ca){console['log'](_0xf501('0x4a'),_0x38c8ca);});}function getEndUser(_0x2b3c55,_0x51fa7e,_0xf26a4b,_0x4681e2,_0x5d05a2,_0x56bdb3,_0x246334){var _0x38d9c6={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2b3c55},'json':!![]};switch(_0x246334['moduleSearch']){case'contact_lead':_0x38d9c6[_0xf501('0x4b')]=_0xf501('0x40')+_0x51fa7e+_0xf501('0x4c')+_0x5d05a2+'))';return getZohoUser(_0x38d9c6,_0xf501('0x4d'))[_0xf501('0x29')](function(_0x9b9204){if(_0x9b9204)return _0x9b9204;_0x38d9c6[_0xf501('0x4b')]=_0xf501('0x40')+_0x51fa7e+_0xf501('0x4e')+_0x5d05a2+'))';return getZohoUser(_0x38d9c6,_0xf501('0x4f'))[_0xf501('0x29')](function(_0x560883){if(_0x560883)return _0x560883;if(_0x246334[_0xf501('0x43')]!=_0xf501('0x50')){return createEndUser(_0x2b3c55,_0x51fa7e,_0x4681e2,_0x5d05a2,_0x56bdb3,_0x246334);}else{return{};}});});break;case _0xf501('0x51'):_0x38d9c6[_0xf501('0x4b')]=_0xf501('0x40')+_0x51fa7e+_0xf501('0x4c')+_0x5d05a2+'))';return getZohoUser(_0x38d9c6,'Contacts')[_0xf501('0x29')](function(_0xfd9a76){if(_0xfd9a76)return _0xfd9a76;if(_0x246334[_0xf501('0x43')]!='nothing'){return createEndUser(_0x2b3c55,_0x51fa7e,_0x4681e2,_0x5d05a2,_0x56bdb3,_0x246334);}else{return{};}});break;case _0xf501('0x52'):_0x38d9c6[_0xf501('0x4b')]=_0xf501('0x40')+_0x51fa7e+_0xf501('0x4e')+_0x5d05a2+'))';return getZohoUser(_0x38d9c6,_0xf501('0x4f'))[_0xf501('0x29')](function(_0xe07917){if(_0xe07917)return _0xe07917;if(_0x246334[_0xf501('0x43')]!='nothing'){return createEndUser(_0x2b3c55,_0x51fa7e,_0x4681e2,_0x5d05a2,_0x56bdb3,_0x246334);}else{return{};}});break;}}function getCall(_0x36f4a7,_0x419c87,_0x3facb0,_0x30508b,_0x495223,_0x184c62,_0x128708,_0x4dd8a3){logger['info']('Creating\x20new\x20call...');var _0x4ef42f={};_0x4ef42f[_0xf501('0x53')]={'name':!_['isNil'](_0x30508b[_0xf501('0x44')][_0xf501('0x18')])&&!_['isNil'](_0x30508b[_0xf501('0x3a')][_0xf501('0x18')])&&_0x30508b[_0xf501('0x3a')][_0xf501('0x18')]===_0xf501('0x54')?_0x30508b[_0xf501('0x44')][_0xf501('0x18')]:!_[_0xf501('0x1b')](_0x30508b[_0xf501('0x45')])?_0x30508b[_0xf501('0x45')]+'\x20'+_0x30508b[_0xf501('0x46')]:_0x30508b[_0xf501('0x46')],'id':_0x30508b['id']};_0x4ef42f[_0xf501('0x55')]=intUtil[_0xf501('0x56')](_0x184c62['Subjects'],_0x128708,'\x20');_0x4ef42f[_0xf501('0x57')]=intUtil['getString'](_0x184c62[_0xf501('0x58')],_0x128708,'\x0a');if(_0x495223[_0xf501('0x59')]===_0xf501('0x4d')){_0x4ef42f[_0xf501('0x5a')]={'name':!_[_0xf501('0x1b')](_0x495223[_0xf501('0x5b')])?_0x495223['Full_Name']:!_[_0xf501('0x1b')](_0x495223[_0xf501('0x5c')])?_0x495223[_0xf501('0x5c')]+'\x20'+_0x495223[_0xf501('0x5d')]:_0x495223['Last_Name'],'id':_0x495223['id']};}if(_0x495223[_0xf501('0x59')]===_0xf501('0x4f')){_0x4ef42f[_0xf501('0x5e')]={'name':!_['isNil'](_0x495223[_0xf501('0x5b')])?_0x495223[_0xf501('0x5b')]:!_[_0xf501('0x1b')](_0x495223[_0xf501('0x5c')])?_0x495223['First_Name']+'\x20'+_0x495223['Last_Name']:_0x495223['Last_Name'],'id':_0x495223['id']};_0x4ef42f[_0xf501('0x5f')]=_[_0xf501('0x42')](_0x495223[_0xf501('0x59')]);}if(_0x128708[_0xf501('0x60')]){_0x4ef42f[_0xf501('0x61')]=moment['utc'](parseInt(_0x128708['talktime'])*0x3e8)[_0xf501('0x31')](_0xf501('0x62'));}else if(_0x128708[_0xf501('0x63')]&&_0x128708['endtime']){_0x4ef42f[_0xf501('0x61')]=moment['utc'](moment(_0x128708[_0xf501('0x64')],_0xf501('0x65'))[_0xf501('0x66')](moment(_0x128708[_0xf501('0x67')],'YYYY-MM-DDTHH:mm:ss')))[_0xf501('0x31')](_0xf501('0x62'));}switch(_0x128708[_0xf501('0x68')]){case _0xf501('0x69'):_0x4ef42f[_0xf501('0x6a')]=_0xf501('0x6b');break;case'complete':case _0xf501('0x6c'):_0x4ef42f[_0xf501('0x6a')]=_0xf501('0x6d');break;case'rejected':_0x4ef42f[_0xf501('0x6a')]=_0xf501('0x6e');break;case _0xf501('0x6f'):_0x4ef42f[_0xf501('0x6a')]='Abandoned';break;case _0xf501('0x70'):_0x4ef42f[_0xf501('0x6a')]=_0xf501('0x71');default:}_0x4ef42f[_0xf501('0x72')]=(_0x4dd8a3===_0xf501('0x73')?moment(_0x128708[_0xf501('0x67')])['format'](_0xf501('0x65')):moment(_0x128708[_0xf501('0x74')])[_0xf501('0x31')](_0xf501('0x65')))||moment()[_0xf501('0x31')](_0xf501('0x65'));_0x4ef42f['Call_Type']=_0x4dd8a3||_0xf501('0x75');_0x4ef42f=_[_0xf501('0x76')](_0x4ef42f,getCustomFields(_0x184c62['Fields'],_0x128708));return request({'method':_0xf501('0x25'),'uri':'https://www.zohoapis.'+_0x419c87+_0xf501('0x77'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x36f4a7},'body':{'data':[_0x4ef42f]},'json':!![]})[_0xf501('0x29')](function(_0x56c402){if(_0x56c402&&_0x56c402['data'][0x0][_0xf501('0x78')]===_0xf501('0x48')){logger[_0xf501('0x2e')]('Call\x20created!');return{'id':_0x56c402[_0xf501('0x3f')][0x0][_0xf501('0x79')]['id']};}})[_0xf501('0x2c')](function(_0x1c48a8){logger['info']('err',_0x1c48a8[_0xf501('0x7a')]);console['log'](_0xf501('0x7b'),_0x1c48a8);});}exports['queue']=function(_0x5f4289,_0xda41f5,_0x1d7b80,_0x65f7e9,_0x17095e,_0x106c8b){var _0x58bcfb,_0x3f36d5,_0x4c29b1;_0x106c8b[_0xf501('0x7c')]=intUtil['stripTrailingSlash'](_0x106c8b['host']);_0x106c8b['serverUrl']=intUtil[_0xf501('0x7d')](_0x106c8b[_0xf501('0x7e')]);if(_0x17095e&&_0x17095e[_0xf501('0x7f')]){logger['info']('[QUEUE]',_0xf501('0x80'));_0xda41f5[_0xf501('0x81')]=_0x106c8b['serverUrl']+_0xf501('0x82')+_0xda41f5['uniqueid']+_0xf501('0x83')+md5(_0xda41f5[_0xf501('0x84')]);}else{_0xda41f5[_0xf501('0x81')]='';}var _0x4d615c=_0x106c8b[_0xf501('0x7c')]==='zoho.eu'?'eu':_0xf501('0x85');return getAccessToken(_0x106c8b)['then'](function(_0x191dfe){_0x4c29b1=_0x191dfe;return getUser(_0x4c29b1,_0x4d615c,_0x106c8b,_0x65f7e9[_0xf501('0x37')]);})[_0xf501('0x29')](function(_0x46bcb1){_0x58bcfb=_0x46bcb1;logger['info'](_0xf501('0x86'),_0x58bcfb['id']);return getEndUser(_0x4c29b1,_0x4d615c,_0x106c8b,_0xda41f5['calleridname'],_0xda41f5['calleridnum'],_0x58bcfb,_0x1d7b80);})[_0xf501('0x29')](function(_0x385d34){_0x3f36d5=_0x385d34;return getCall(_0x4c29b1,_0x4d615c,_0x106c8b,_0x58bcfb,_0x3f36d5,_0x1d7b80,_0xda41f5,_0xf501('0x75'));})['then'](function(_0x2598ab){if(_0x2598ab){logger['info']('The\x20Call\x20ID\x20is:',_0x2598ab['id']);logger[_0xf501('0x2e')](_0xf501('0x87'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x65f7e9['name']),_0xf501('0x88'),{'uri':_0xf501('0x89')+_0x106c8b[_0xf501('0x7c')]+_0xf501('0x8a')+_0x2598ab['id']});}})[_0xf501('0x2c')](function(_0x25cbf0){logger[_0xf501('0x2d')]('[QUEUE]',JSON[_0xf501('0xd')](_0x25cbf0));});};exports['outbound']=function(_0x3ccb5f,_0x10298f,_0x4aa214,_0x227473,_0x888ee5,_0x40e53d,_0x162c9b){var _0x32ae24,_0x2255c1,_0x3d286b;_0x40e53d[_0xf501('0x7c')]=intUtil[_0xf501('0x7d')](_0x40e53d['host']);_0x40e53d['serverUrl']=intUtil[_0xf501('0x7d')](_0x40e53d[_0xf501('0x7e')]);if(_0x162c9b&&_0x162c9b['recordingFormat']&&_0x162c9b[_0xf501('0x8b')]!==_0xf501('0x8c')){logger[_0xf501('0x2e')](_0xf501('0x8d'),_0xf501('0x80'));_0x10298f[_0xf501('0x81')]=_0x40e53d[_0xf501('0x7e')]+_0xf501('0x82')+_0x10298f[_0xf501('0x84')]+'/downloads?type=uniqueid&token='+md5(_0x10298f[_0xf501('0x84')]);}var _0x493db2=_0x40e53d[_0xf501('0x7c')]===_0xf501('0x8e')?'eu':_0xf501('0x85');return getAccessToken(_0x40e53d)[_0xf501('0x29')](function(_0x5f16c3){_0x3d286b=_0x5f16c3;return getUser(_0x3d286b,_0x493db2,_0x40e53d,_0x227473[_0xf501('0x37')]);})['then'](function(_0x40651c){_0x32ae24=_0x40651c;logger[_0xf501('0x2e')](_0xf501('0x86'),_0x32ae24['id']);return getEndUser(_0x3d286b,_0x493db2,_0x40e53d,_0x10298f['destcalleridname'],_0x10298f['destcalleridnum'],_0x32ae24,_0x4aa214);})[_0xf501('0x29')](function(_0x394a5f){_0x2255c1=_0x394a5f;return getCall(_0x3d286b,_0x493db2,_0x40e53d,_0x32ae24,_0x2255c1,_0x4aa214,_0x10298f,_0xf501('0x8f'));})[_0xf501('0x29')](function(_0x163f26){if(_0x163f26){logger[_0xf501('0x2e')]('The\x20Call\x20ID\x20is:',_0x163f26['id']);logger[_0xf501('0x2e')](_0xf501('0x8d'),_0xf501('0x90'));emit(util['format'](_0xf501('0x91'),_0x227473[_0xf501('0x18')]),_0xf501('0x88'),{'uri':_0xf501('0x89')+_0x40e53d[_0xf501('0x7c')]+'/crm/EntityInfo.do?module=Calls&id='+_0x163f26['id']});}})[_0xf501('0x2c')](function(_0xb8346a){logger[_0xf501('0x2d')](_0xf501('0x8d'),JSON[_0xf501('0xd')](_0xb8346a));});};exports['unmanaged']=function(_0x19e37d,_0x4018ae,_0x27c391,_0x3b5d80,_0x44fa08,_0x21772d){var _0x10b8b7,_0x563fd2,_0x1f0695;_0x21772d[_0xf501('0x7c')]=intUtil[_0xf501('0x7d')](_0x21772d['host']);_0x21772d[_0xf501('0x7e')]=intUtil['stripTrailingSlash'](_0x21772d[_0xf501('0x7e')]);if(_0x44fa08&&_0x44fa08['monitor_format']){logger['info']('['+_0x4018ae[_0xf501('0x68')][_0xf501('0x92')]()+']',_0xf501('0x80'));_0x4018ae[_0xf501('0x81')]=_0x21772d[_0xf501('0x7e')]+'/api/voice/recordings/'+_0x4018ae[_0xf501('0x84')]+'/downloads?type=uniqueid&token='+md5(_0x4018ae[_0xf501('0x84')]);}else{_0x4018ae[_0xf501('0x81')]='';}var _0x50e46a=_0x21772d[_0xf501('0x7c')]===_0xf501('0x8e')?'eu':_0xf501('0x85');return getAccessToken(_0x21772d)[_0xf501('0x29')](function(_0x4c4e1d){_0x1f0695=_0x4c4e1d;return getUser(_0x1f0695,_0x50e46a,_0x21772d);})[_0xf501('0x29')](function(_0x5c91f9){_0x10b8b7=_0x5c91f9;logger[_0xf501('0x2e')]('The\x20User\x20ID\x20is:',_0x10b8b7['id']);return getEndUser(_0x1f0695,_0x50e46a,_0x21772d,_0x4018ae['calleridname'],_0x4018ae['calleridnum'],_0x10b8b7,_0x27c391);})[_0xf501('0x29')](function(_0x304801){_0x563fd2=_0x304801;return getCall(_0x1f0695,_0x50e46a,_0x21772d,_0x10b8b7,_0x563fd2,_0x27c391,_0x4018ae,_0xf501('0x75'));})['then'](function(_0x242c1f){if(_0x242c1f){logger[_0xf501('0x2e')](_0xf501('0x93'),_0x242c1f['id']);}})[_0xf501('0x2c')](function(_0x47d7c6){logger['error']('['+_0x4018ae['lastevent']['toUpperCase']()+']',JSON[_0xf501('0xd')](_0x47d7c6));});}; \ 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 03c143c..88fca0a 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 _0x02ad=['data2','Script','data3','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','mustache','../../../../config/logger','trigger','exec'];(function(_0x3b5933,_0xb54fc5){var _0x5ce4dc=function(_0x491461){while(--_0x491461){_0x3b5933['push'](_0x3b5933['shift']());}};_0x5ce4dc(++_0xb54fc5);}(_0x02ad,0x10f));var _0xd02a=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x02ad[_0x53ccf2];return _0x5a2964;};'use strict';var util=require(_0xd02a('0x0'));var sh=require('shelljs');var Mustache=require(_0xd02a('0x1'));var logger=require(_0xd02a('0x2'))(_0xd02a('0x3'));exports[_0xd02a('0x4')]=function(_0x434b46,_0x205666){var _0x1c7631=_0x434b46['data2']?_0x434b46[_0xd02a('0x5')]:_0xd02a('0x6');var _0x57e0d8=_0x434b46['data3']?Mustache['render'](_0x434b46[_0xd02a('0x7')],_0x205666):_0x205666;sh[_0xd02a('0x4')](_0x57e0d8,function(_0x11f758,_0x3ff01b,_0x41f321){if(_0x11f758!==0x0){logger['error'](util[_0xd02a('0x8')](_0xd02a('0x9'),_0x1c7631,_0x57e0d8,_0x11f758,_0x41f321));}else{logger[_0xd02a('0xa')](util['format'](_0xd02a('0xb'),_0x1c7631,_0x57e0d8,_0x3ff01b));}});}; \ No newline at end of file +var _0x5392=['error','format','info','mustache','trigger','exec','data2','Script','data3','render'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x5392,0x189));var _0x2539=function(_0xd956d9,_0x554545){_0xd956d9=_0xd956d9-0x0;var _0x2a563d=_0x5392[_0xd956d9];return _0x2a563d;};'use strict';var util=require('util');var sh=require('shelljs');var Mustache=require(_0x2539('0x0'));var logger=require('../../../../config/logger')(_0x2539('0x1'));exports[_0x2539('0x2')]=function(_0x52447b,_0x4d6d49){var _0x39c4e5=_0x52447b[_0x2539('0x3')]?_0x52447b[_0x2539('0x3')]:_0x2539('0x4');var _0x207e48=_0x52447b[_0x2539('0x5')]?Mustache[_0x2539('0x6')](_0x52447b[_0x2539('0x5')],_0x4d6d49):_0x4d6d49;sh[_0x2539('0x2')](_0x207e48,function(_0x49ad1e,_0x3a906e,_0x4bcabe){if(_0x49ad1e!==0x0){logger[_0x2539('0x7')](util[_0x2539('0x8')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x39c4e5,_0x207e48,_0x49ad1e,_0x4bcabe));}else{logger[_0x2539('0x9')](util[_0x2539('0x8')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x39c4e5,_0x207e48,_0x3a906e));}});}; \ 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 4931236..19572b9 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 _0x20cc=['parse','GET','DELETE','POST','PUT','data7','body','error','stack','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','message','request-promise','util','lodash','../../../../config/logger','trigger','exec','data1','render','data2','data5','number','headers','data6'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0x20cc,0x15e));var _0xc20c=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x20cc[_0x4c7fb5];return _0x2e10ac;};'use strict';var rp=require(_0xc20c('0x0'));var util=require(_0xc20c('0x1'));var _=require(_0xc20c('0x2'));var Mustache=require('mustache');var logger=require(_0xc20c('0x3'))(_0xc20c('0x4'));exports[_0xc20c('0x5')]=function(_0x40aa9a,_0x4ca209){var _0x4d1aaf,_0x28763c;var _0x3d6662={'method':_0x40aa9a[_0xc20c('0x6')]['toUpperCase'](),'uri':Mustache[_0xc20c('0x7')](_0x40aa9a[_0xc20c('0x8')],_0x4ca209),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x40aa9a[_0xc20c('0x9')])===_0xc20c('0xa')&&parseInt(_0x40aa9a['data5'])>=0x1&&parseInt(_0x40aa9a['data5'])<=0xa?parseInt(_0x40aa9a[_0xc20c('0x9')])*0x3e8:0x5*0x3e8};try{_0x3d6662[_0xc20c('0xb')]=_0x40aa9a[_0xc20c('0xc')]?JSON[_0xc20c('0xd')](Mustache[_0xc20c('0x7')](_0x40aa9a[_0xc20c('0xc')],_0x4ca209)):{};}catch(_0x30d383){logger['error'](_0x30d383['stack']);}switch(_0x40aa9a['data1']['toUpperCase']()){case _0xc20c('0xe'):case _0xc20c('0xf'):_0x4d1aaf=null;_0x3d6662['qs']=_0x4ca209;break;case _0xc20c('0x10'):case _0xc20c('0x11'):if(_0x40aa9a[_0xc20c('0x12')]){try{_0x4d1aaf=JSON[_0xc20c('0xd')](Mustache[_0xc20c('0x7')](_0x40aa9a[_0xc20c('0x12')],_0x4ca209));_0x3d6662[_0xc20c('0x13')]=_0x4d1aaf;}catch(_0x59650e){logger[_0xc20c('0x14')](_0x59650e[_0xc20c('0x15')]);logger[_0xc20c('0x14')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x4d1aaf=_0x4ca209;_0x3d6662['body']=_0x4d1aaf;}break;}logger[_0xc20c('0x16')](util[_0xc20c('0x17')](_0xc20c('0x18'),_0x40aa9a[_0xc20c('0x6')],_0x40aa9a['data2'],JSON[_0xc20c('0x19')](_0x3d6662)));rp(_0x3d6662)[_0xc20c('0x1a')](function(_0x145a89){_0x4d1aaf=!_[_0xc20c('0x1b')](_0x4d1aaf)?_0xc20c('0x1c')+_0x4d1aaf:'';_0x28763c=typeof _0x145a89[_0xc20c('0x13')]===_0xc20c('0x1d')?JSON[_0xc20c('0x19')](_0x145a89[_0xc20c('0x13')]):_0x145a89[_0xc20c('0x13')];logger[_0xc20c('0x16')](util[_0xc20c('0x17')](_0xc20c('0x1e'),_0x40aa9a[_0xc20c('0x6')],_0x40aa9a[_0xc20c('0x8')],_0x145a89['statusCode'],_0x28763c));})[_0xc20c('0x1f')](function(_0x517e39){logger[_0xc20c('0x14')](util[_0xc20c('0x17')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x40aa9a[_0xc20c('0x6')],_0x40aa9a[_0xc20c('0x8')],_0x517e39['statusCode'],_0x517e39['name'],_0x517e39[_0xc20c('0x20')]));});}; \ No newline at end of file +var _0x3eb0=['POST','data7','body','format','data2','then','isNil',',\x20request\x20body:\x20','stringify','info','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','lodash','mustache','../../../../config/logger','trigger','exec','data1','render','data5','number','headers','data6','parse','error','toUpperCase','DELETE'];(function(_0x1de4b8,_0x529b41){var _0x557699=function(_0xb10c18){while(--_0xb10c18){_0x1de4b8['push'](_0x1de4b8['shift']());}};_0x557699(++_0x529b41);}(_0x3eb0,0x135));var _0x03eb=function(_0x2a2144,_0x4e6181){_0x2a2144=_0x2a2144-0x0;var _0x3c9825=_0x3eb0[_0x2a2144];return _0x3c9825;};'use strict';var rp=require('request-promise');var util=require('util');var _=require(_0x03eb('0x0'));var Mustache=require(_0x03eb('0x1'));var logger=require(_0x03eb('0x2'))(_0x03eb('0x3'));exports[_0x03eb('0x4')]=function(_0x93644,_0x565346){var _0x13da96,_0x3e31fd;var _0x46937a={'method':_0x93644[_0x03eb('0x5')]['toUpperCase'](),'uri':Mustache[_0x03eb('0x6')](_0x93644['data2'],_0x565346),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x93644[_0x03eb('0x7')])===_0x03eb('0x8')&&parseInt(_0x93644['data5'])>=0x1&&parseInt(_0x93644['data5'])<=0xa?parseInt(_0x93644[_0x03eb('0x7')])*0x3e8:0x5*0x3e8};try{_0x46937a[_0x03eb('0x9')]=_0x93644[_0x03eb('0xa')]?JSON[_0x03eb('0xb')](Mustache[_0x03eb('0x6')](_0x93644[_0x03eb('0xa')],_0x565346)):{};}catch(_0x2dfbd4){logger[_0x03eb('0xc')](_0x2dfbd4['stack']);}switch(_0x93644[_0x03eb('0x5')][_0x03eb('0xd')]()){case'GET':case _0x03eb('0xe'):_0x13da96=null;_0x46937a['qs']=_0x565346;break;case _0x03eb('0xf'):case'PUT':if(_0x93644[_0x03eb('0x10')]){try{_0x13da96=JSON[_0x03eb('0xb')](Mustache[_0x03eb('0x6')](_0x93644[_0x03eb('0x10')],_0x565346));_0x46937a['body']=_0x13da96;}catch(_0x2f472e){logger[_0x03eb('0xc')](_0x2f472e['stack']);logger[_0x03eb('0xc')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x13da96=_0x565346;_0x46937a[_0x03eb('0x11')]=_0x13da96;}break;}logger['info'](util[_0x03eb('0x12')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x93644[_0x03eb('0x5')],_0x93644[_0x03eb('0x13')],JSON['stringify'](_0x46937a)));rp(_0x46937a)[_0x03eb('0x14')](function(_0x1a2c44){_0x13da96=!_[_0x03eb('0x15')](_0x13da96)?_0x03eb('0x16')+_0x13da96:'';_0x3e31fd=typeof _0x1a2c44['body']==='object'?JSON[_0x03eb('0x17')](_0x1a2c44[_0x03eb('0x11')]):_0x1a2c44[_0x03eb('0x11')];logger[_0x03eb('0x18')](util[_0x03eb('0x12')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x93644['data1'],_0x93644[_0x03eb('0x13')],_0x1a2c44['statusCode'],_0x3e31fd));})['catch'](function(_0x8aac9c){logger[_0x03eb('0xc')](util[_0x03eb('0x12')](_0x03eb('0x19'),_0x93644[_0x03eb('0x5')],_0x93644[_0x03eb('0x13')],_0x8aac9c[_0x03eb('0x1a')],_0x8aac9c['name'],_0x8aac9c['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index b6c09be..a79f4eb 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 _0xd966=['catch','exports','bluebird','routing','client','http','Request','then','rpc','error','message','result'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xd966,0x13a));var _0x6d96=function(_0x8d68ce,_0x135a7f){_0x8d68ce=_0x8d68ce-0x0;var _0x2e1f64=_0xd966[_0x8d68ce];return _0x2e1f64;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x6d96('0x0'));var logger=require('../../config/logger')(_0x6d96('0x1'));var client=jayson[_0x6d96('0x2')][_0x6d96('0x3')]({'port':0x2329});client[_0x6d96('0x4')]=function(_0x1c0f6e,_0x3dac96){return new BPromise(function(_0x47a017,_0x48d4a9){return client['request'](_0x1c0f6e,_0x3dac96)[_0x6d96('0x5')](function(_0x201357){logger['debug'](_0x6d96('0x6'),_0x6d96('0x1'),_0x1c0f6e,_0x3dac96,_0x201357);if(_0x201357['error']){logger[_0x6d96('0x7')](_0x6d96('0x6'),_0x6d96('0x1'),_0x1c0f6e,_0x201357[_0x6d96('0x7')]['message'],_0x3dac96);return _0x48d4a9(_0x201357[_0x6d96('0x7')][_0x6d96('0x8')]);}else{return _0x47a017(_0x201357[_0x6d96('0x9')]);}})[_0x6d96('0xa')](function(_0x3ed90f){logger['error'](_0x6d96('0x6'),_0x6d96('0x1'),_0x1c0f6e,_0x3ed90f,_0x3dac96);return _0x48d4a9(_0x3ed90f);});});};module[_0x6d96('0xb')]=client; \ No newline at end of file +var _0xa7f1=['bluebird','../../config/logger','routing','client','http','Request','request','debug','rpc','error','message','catch','exports','jayson/promise'];(function(_0x2077c2,_0x275ab5){var _0x312f9f=function(_0x331435){while(--_0x331435){_0x2077c2['push'](_0x2077c2['shift']());}};_0x312f9f(++_0x275ab5);}(_0xa7f1,0x195));var _0x1a7f=function(_0x4caf0d,_0x580ea2){_0x4caf0d=_0x4caf0d-0x0;var _0x473297=_0xa7f1[_0x4caf0d];return _0x473297;};'use strict';var jayson=require(_0x1a7f('0x0'));var BPromise=require(_0x1a7f('0x1'));var logger=require(_0x1a7f('0x2'))(_0x1a7f('0x3'));var client=jayson[_0x1a7f('0x4')][_0x1a7f('0x5')]({'port':0x2329});client[_0x1a7f('0x6')]=function(_0x1b1885,_0x178d06){return new BPromise(function(_0x2e4101,_0x569700){return client[_0x1a7f('0x7')](_0x1b1885,_0x178d06)['then'](function(_0xe766a8){logger[_0x1a7f('0x8')](_0x1a7f('0x9'),_0x1a7f('0x3'),_0x1b1885,_0x178d06,_0xe766a8);if(_0xe766a8[_0x1a7f('0xa')]){logger['error'](_0x1a7f('0x9'),_0x1a7f('0x3'),_0x1b1885,_0xe766a8[_0x1a7f('0xa')][_0x1a7f('0xb')],_0x178d06);return _0x569700(_0xe766a8[_0x1a7f('0xa')][_0x1a7f('0xb')]);}else{return _0x2e4101(_0xe766a8['result']);}})[_0x1a7f('0xc')](function(_0x1d547e){logger[_0x1a7f('0xa')](_0x1a7f('0x9'),_0x1a7f('0x3'),_0x1b1885,_0x1d547e,_0x178d06);return _0x569700(_0x1d547e);});});};module[_0x1a7f('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index d194b9b..7725139 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 _0x1103=['then','getMailAccounts','refresh','mailAccounts','listen','catch','log','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting'];(function(_0x3071e3,_0x27b271){var _0x2e2cb0=function(_0x1f6d88){while(--_0x1f6d88){_0x3071e3['push'](_0x3071e3['shift']());}};_0x2e2cb0(++_0x27b271);}(_0x1103,0x97));var _0x3110=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1103[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require('bluebird');var server=require(_0x3110('0x0'));var Realtime=require(_0x3110('0x1'));var EmailChannel=require(_0x3110('0x2'));var mailAccount=require(_0x3110('0x3'));var setting=require(_0x3110('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()[_0x3110('0x5')](mailAccount[_0x3110('0x6')]())['then'](realtime['initMailAccounts']())[_0x3110('0x5')](function(){email[_0x3110('0x7')](realtime[_0x3110('0x8')]);return realtime;});}function main(){return server[_0x3110('0x9')](realtime,email)[_0x3110('0x5')](function(){return initRealtime();})[_0x3110('0x5')](function(){return setting['getSettings']();})['then'](function(_0x4553ac){return setInterval(initRealtime,_0x4553ac['loginMailFrequency']*0x3e8);})[_0x3110('0xa')](function(_0x3ae517){console[_0x3110('0xb')](_0x3ae517);});}main(); \ No newline at end of file +var _0xfc31=['getSettings','loginMailFrequency','catch','log','bluebird','./server','./realtime','./rpc/mailAccount','resolve','getMailAccounts','initMailAccounts','then','refresh','mailAccounts','listen'];(function(_0x1b2b28,_0x28ef0e){var _0x5d5a1e=function(_0x24962f){while(--_0x24962f){_0x1b2b28['push'](_0x1b2b28['shift']());}};_0x5d5a1e(++_0x28ef0e);}(_0xfc31,0x121));var _0x1fc3=function(_0x4612f1,_0x554b44){_0x4612f1=_0x4612f1-0x0;var _0x54f328=_0xfc31[_0x4612f1];return _0x54f328;};'use strict';var BPromise=require(_0x1fc3('0x0'));var server=require(_0x1fc3('0x1'));var Realtime=require(_0x1fc3('0x2'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x1fc3('0x3'));var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x1fc3('0x4')]()['then'](mailAccount[_0x1fc3('0x5')]())['then'](realtime[_0x1fc3('0x6')]())[_0x1fc3('0x7')](function(){email[_0x1fc3('0x8')](realtime[_0x1fc3('0x9')]);return realtime;});}function main(){return server[_0x1fc3('0xa')](realtime,email)[_0x1fc3('0x7')](function(){return initRealtime();})[_0x1fc3('0x7')](function(){return setting[_0x1fc3('0xb')]();})[_0x1fc3('0x7')](function(_0x39704f){return setInterval(initRealtime,_0x39704f[_0x1fc3('0xc')]*0x3e8);})[_0x1fc3('0xd')](function(_0xadb8dc){console[_0x1fc3('0xe')](_0xadb8dc);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 8b9f21a..04364d7 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 _0x99c7=['end','error','handleImapError','disabled','connected','messages','total','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','then','Mail\x20accepted\x20from\x20routing','handleImapEnd','lastSync','sendMail','smtp','send','verifySmtp','Smtp','verify','verified','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger','email','defaults','redis','localhost','socket.io-emitter','./imap','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts','prototype','name','active','status','Imap','messageStatus','isNil','stringify','emit','refresh','hasOwnProperty','box','handleImapBox','bind'];(function(_0x2e7eed,_0x268696){var _0x640483=function(_0x49becc){while(--_0x49becc){_0x2e7eed['push'](_0x2e7eed['shift']());}};_0x640483(++_0x268696);}(_0x99c7,0x189));var _0x799c=function(_0x1880c4,_0x5dba92){_0x1880c4=_0x1880c4-0x0;var _0xd64c57=_0x99c7[_0x1880c4];return _0xd64c57;};'use strict';var _=require(_0x799c('0x0'));var moment=require(_0x799c('0x1'));var BPromise=require('bluebird');var md5=require(_0x799c('0x2'));var Redis=require(_0x799c('0x3'));var config=require(_0x799c('0x4'));var logger=require(_0x799c('0x5'))(_0x799c('0x6'));config['redis']=_[_0x799c('0x7')](config[_0x799c('0x8')],{'host':_0x799c('0x9'),'port':0x18eb});var io=require(_0x799c('0xa'))(new Redis(config[_0x799c('0x8')]));var EmailImap=require(_0x799c('0xb'));var EmailSmtp=require(_0x799c('0xc'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x4225aa){logger[_0x799c('0xd')](_0x799c('0xe'));this[_0x799c('0xf')]=_0x4225aa[_0x799c('0xf')];this[_0x799c('0x10')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x799c('0x11')]['emit']=function(_0x3d2fa1){var _0x46e7e9=this[_0x799c('0xf')][_0x3d2fa1];var _0xdf3f94={'id':_0x46e7e9['id'],'name':_0x46e7e9[_0x799c('0x12')],'key':_0x46e7e9['key'],'active':_0x46e7e9[_0x799c('0x13')],'Imap':{'status':_0x46e7e9['Imap'][_0x799c('0x14')],'messageStatus':_0x46e7e9[_0x799c('0x15')][_0x799c('0x16')],'total':_0x46e7e9[_0x799c('0x15')]['total']}};if(_[_0x799c('0x17')](md5Accounts[_0x3d2fa1])){md5Accounts[_0x3d2fa1]={};}var _0x484c12=md5(JSON[_0x799c('0x18')](_0xdf3f94));if(md5Accounts[_0x3d2fa1][_0x799c('0x2')]!==_0x484c12){md5Accounts[_0x3d2fa1][_0x799c('0x2')]=_0x484c12;io[_0x799c('0x19')]('mailAccount:update',_0xdf3f94);}};EmailChannel[_0x799c('0x11')][_0x799c('0x1a')]=function(_0x35ae16){for(var _0x904910 in _0x35ae16){if(_0x35ae16['hasOwnProperty'](_0x904910)){if(_0x35ae16[_0x904910][_0x799c('0x15')]&&_0x35ae16[_0x904910][_0x799c('0x13')]){var _0x23062f=_0x35ae16[_0x904910]['Imap'];if(!this[_0x799c('0x10')][_0x799c('0x1b')](_0x23062f['id'])){this[_0x799c('0x10')][_0x23062f['id']]=new EmailImap(_0x23062f,_0x35ae16[_0x904910][_0x799c('0x6')]);this[_0x799c('0x10')][_0x23062f['id']]['on'](_0x799c('0x1c'),this[_0x799c('0x1d')]['bind'](this,_0x904910));this[_0x799c('0x10')][_0x23062f['id']]['on']('email',this['handleImapEmail'][_0x799c('0x1e')](this,_0x904910));this['imapAccounts'][_0x23062f['id']]['on'](_0x799c('0x1f'),this['handleImapEnd']['bind'](this,_0x904910));this['imapAccounts'][_0x23062f['id']]['on'](_0x799c('0x20'),this[_0x799c('0x21')][_0x799c('0x1e')](this,_0x904910));}}else{if(_[_0x799c('0x17')](this[_0x799c('0xf')][_0x904910]['Imap'])){this[_0x799c('0xf')][_0x904910][_0x799c('0x15')]={};}this[_0x799c('0xf')][_0x904910][_0x799c('0x15')][_0x799c('0x14')]=_0x799c('0x22');this[_0x799c('0xf')][_0x904910]['Imap'][_0x799c('0x16')]='';this[_0x799c('0x19')](_0x904910);}}}};EmailChannel[_0x799c('0x11')][_0x799c('0x1d')]=function(_0x2bcf1d,_0x4aa36d){if(this[_0x799c('0xf')][_0x2bcf1d]){this[_0x799c('0xf')][_0x2bcf1d]['Imap']['status']=_0x799c('0x23');this[_0x799c('0xf')][_0x2bcf1d]['Imap']['messageStatus']=_0x4aa36d[_0x799c('0x12')];if(_0x4aa36d[_0x799c('0x24')]){this[_0x799c('0xf')][_0x2bcf1d][_0x799c('0x15')][_0x799c('0x25')]=_0x4aa36d[_0x799c('0x24')]['total'];}return this[_0x799c('0x19')](_0x2bcf1d);}};EmailChannel['prototype'][_0x799c('0x26')]=function(_0x13e71d,_0x241c74){logger[_0x799c('0xd')](_0x799c('0x27'),_0x241c74[_0x799c('0x28')],_0x241c74[_0x799c('0x29')],_0x241c74['from'],_0x13e71d);if(this[_0x799c('0xf')][_0x13e71d]){return mailAccount['notify'](_0x13e71d,_0x241c74)[_0x799c('0x2a')](function(_0x18edad){if(_0x18edad){logger[_0x799c('0xd')](_0x799c('0x2b'));}})['catch'](function(_0x9e156a){logger[_0x799c('0x20')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON['stringify'](_0x9e156a));});}};EmailChannel[_0x799c('0x11')][_0x799c('0x2c')]=function(_0x550048){if(this['mailAccounts'][_0x550048]&&this[_0x799c('0xf')][_0x550048][_0x799c('0x15')]){if(this['imapAccounts'][this[_0x799c('0xf')][_0x550048]['Imap']['id']]){delete this[_0x799c('0x10')][this[_0x799c('0xf')][_0x550048][_0x799c('0x15')]['id']];}this[_0x799c('0xf')][_0x550048][_0x799c('0x15')][_0x799c('0x2d')]=moment();this[_0x799c('0x19')](_0x550048);}};EmailChannel[_0x799c('0x11')][_0x799c('0x21')]=function(_0x4f35f7,_0x407ecf){if(this['mailAccounts'][_0x4f35f7]){this[_0x799c('0xf')][_0x4f35f7][_0x799c('0x15')][_0x799c('0x14')]=_0x799c('0x20');this['mailAccounts'][_0x4f35f7][_0x799c('0x15')]['messageStatus']=_0x407ecf;return this[_0x799c('0x19')](_0x4f35f7);}};EmailChannel['prototype'][_0x799c('0x2e')]=function(_0xbc5d99,_0x7529f3){return this[_0x799c('0x2f')][_0x799c('0x30')](_0xbc5d99,_0x7529f3);};EmailChannel[_0x799c('0x11')][_0x799c('0x31')]=function(_0x52a974){var _0x1abc89=this;if(this[_0x799c('0xf')][_0x52a974['id']]){if(_['isNil'](this[_0x799c('0xf')][_0x52a974['id']][_0x799c('0x32')])){this[_0x799c('0xf')][_0x52a974['id']][_0x799c('0x32')]={};}this['mailAccounts'][_0x52a974['id']][_0x799c('0x32')][_0x799c('0x2d')]=moment();return new BPromise(function(_0x502958,_0x334cb0){return _0x1abc89[_0x799c('0x2f')][_0x799c('0x33')](_0x52a974)[_0x799c('0x2a')](function(_0x4a78d2){_0x1abc89[_0x799c('0xf')][_0x52a974['id']]['Smtp']['status']=_0x799c('0x34');_0x1abc89[_0x799c('0xf')][_0x52a974['id']][_0x799c('0x32')][_0x799c('0x16')]='';_0x1abc89['emit'](_0x52a974['id']);_0x502958(_0x4a78d2);})['catch'](function(_0x462c5e){_0x1abc89[_0x799c('0xf')][_0x52a974['id']][_0x799c('0x32')]['status']=_0x799c('0x20');_0x1abc89['mailAccounts'][_0x52a974['id']][_0x799c('0x32')][_0x799c('0x16')]=_0x462c5e;_0x1abc89[_0x799c('0x19')](_0x52a974['id']);_0x334cb0(_0x462c5e);});});}return this['smtp']['verify'](_0x52a974);};module['exports']=EmailChannel; \ No newline at end of file +var _0xdbc4=['send','verifySmtp','Smtp','verify','verified','catch','exports','lodash','moment','bluebird','md5','ioredis','../../../config/logger','email','redis','localhost','socket.io-emitter','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','emit','name','active','Imap','total','isNil','stringify','mailAccount:update','prototype','refresh','hasOwnProperty','handleImapBox','bind','handleImapEmail','end','handleImapError','disabled','messageStatus','status','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','then','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','error','sendMail','smtp'];(function(_0x44b113,_0x51f561){var _0x545aab=function(_0x21f3f7){while(--_0x21f3f7){_0x44b113['push'](_0x44b113['shift']());}};_0x545aab(++_0x51f561);}(_0xdbc4,0x115));var _0x4dbc=function(_0x36c80e,_0x456c72){_0x36c80e=_0x36c80e-0x0;var _0x35d6c8=_0xdbc4[_0x36c80e];return _0x35d6c8;};'use strict';var _=require(_0x4dbc('0x0'));var moment=require(_0x4dbc('0x1'));var BPromise=require(_0x4dbc('0x2'));var md5=require(_0x4dbc('0x3'));var Redis=require(_0x4dbc('0x4'));var config=require('../../../config/environment');var logger=require(_0x4dbc('0x5'))(_0x4dbc('0x6'));config[_0x4dbc('0x7')]=_['defaults'](config[_0x4dbc('0x7')],{'host':_0x4dbc('0x8'),'port':0x18eb});var io=require(_0x4dbc('0x9'))(new Redis(config[_0x4dbc('0x7')]));var EmailImap=require('./imap');var EmailSmtp=require('./smtp');var mailAccount=require(_0x4dbc('0xa'));var md5Accounts={};function EmailChannel(_0xdd5a3c){logger[_0x4dbc('0xb')](_0x4dbc('0xc'));this[_0x4dbc('0xd')]=_0xdd5a3c['mailAccounts'];this[_0x4dbc('0xe')]={};this['smtp']=new EmailSmtp();}EmailChannel['prototype'][_0x4dbc('0xf')]=function(_0x5971a6){var _0x43ad31=this[_0x4dbc('0xd')][_0x5971a6];var _0x39017a={'id':_0x43ad31['id'],'name':_0x43ad31[_0x4dbc('0x10')],'key':_0x43ad31['key'],'active':_0x43ad31[_0x4dbc('0x11')],'Imap':{'status':_0x43ad31[_0x4dbc('0x12')]['status'],'messageStatus':_0x43ad31['Imap']['messageStatus'],'total':_0x43ad31['Imap'][_0x4dbc('0x13')]}};if(_[_0x4dbc('0x14')](md5Accounts[_0x5971a6])){md5Accounts[_0x5971a6]={};}var _0x59069e=md5(JSON[_0x4dbc('0x15')](_0x39017a));if(md5Accounts[_0x5971a6]['md5']!==_0x59069e){md5Accounts[_0x5971a6][_0x4dbc('0x3')]=_0x59069e;io[_0x4dbc('0xf')](_0x4dbc('0x16'),_0x39017a);}};EmailChannel[_0x4dbc('0x17')][_0x4dbc('0x18')]=function(_0x145661){for(var _0x4e207f in _0x145661){if(_0x145661['hasOwnProperty'](_0x4e207f)){if(_0x145661[_0x4e207f][_0x4dbc('0x12')]&&_0x145661[_0x4e207f][_0x4dbc('0x11')]){var _0xea37df=_0x145661[_0x4e207f]['Imap'];if(!this[_0x4dbc('0xe')][_0x4dbc('0x19')](_0xea37df['id'])){this[_0x4dbc('0xe')][_0xea37df['id']]=new EmailImap(_0xea37df,_0x145661[_0x4e207f][_0x4dbc('0x6')]);this[_0x4dbc('0xe')][_0xea37df['id']]['on']('box',this[_0x4dbc('0x1a')][_0x4dbc('0x1b')](this,_0x4e207f));this[_0x4dbc('0xe')][_0xea37df['id']]['on'](_0x4dbc('0x6'),this[_0x4dbc('0x1c')][_0x4dbc('0x1b')](this,_0x4e207f));this['imapAccounts'][_0xea37df['id']]['on'](_0x4dbc('0x1d'),this['handleImapEnd'][_0x4dbc('0x1b')](this,_0x4e207f));this[_0x4dbc('0xe')][_0xea37df['id']]['on']('error',this[_0x4dbc('0x1e')][_0x4dbc('0x1b')](this,_0x4e207f));}}else{if(_['isNil'](this[_0x4dbc('0xd')][_0x4e207f][_0x4dbc('0x12')])){this[_0x4dbc('0xd')][_0x4e207f][_0x4dbc('0x12')]={};}this['mailAccounts'][_0x4e207f]['Imap']['status']=_0x4dbc('0x1f');this[_0x4dbc('0xd')][_0x4e207f][_0x4dbc('0x12')][_0x4dbc('0x20')]='';this['emit'](_0x4e207f);}}}};EmailChannel[_0x4dbc('0x17')][_0x4dbc('0x1a')]=function(_0x3541d3,_0x3c0c1b){if(this[_0x4dbc('0xd')][_0x3541d3]){this[_0x4dbc('0xd')][_0x3541d3][_0x4dbc('0x12')][_0x4dbc('0x21')]=_0x4dbc('0x22');this[_0x4dbc('0xd')][_0x3541d3][_0x4dbc('0x12')][_0x4dbc('0x20')]=_0x3c0c1b[_0x4dbc('0x10')];if(_0x3c0c1b[_0x4dbc('0x23')]){this['mailAccounts'][_0x3541d3]['Imap'][_0x4dbc('0x13')]=_0x3c0c1b[_0x4dbc('0x23')][_0x4dbc('0x13')];}return this['emit'](_0x3541d3);}};EmailChannel[_0x4dbc('0x17')][_0x4dbc('0x1c')]=function(_0x1fd0a0,_0x553a19){logger['info'](_0x4dbc('0x24'),_0x553a19[_0x4dbc('0x25')],_0x553a19[_0x4dbc('0x26')],_0x553a19['from'],_0x1fd0a0);if(this[_0x4dbc('0xd')][_0x1fd0a0]){return mailAccount['notify'](_0x1fd0a0,_0x553a19)[_0x4dbc('0x27')](function(_0x2e4be9){if(_0x2e4be9){logger[_0x4dbc('0xb')](_0x4dbc('0x28'));}})['catch'](function(_0x3d01a3){logger['error'](_0x4dbc('0x29'),JSON['stringify'](_0x3d01a3));});}};EmailChannel['prototype'][_0x4dbc('0x2a')]=function(_0x2e96fc){if(this['mailAccounts'][_0x2e96fc]&&this['mailAccounts'][_0x2e96fc]['Imap']){if(this[_0x4dbc('0xe')][this[_0x4dbc('0xd')][_0x2e96fc]['Imap']['id']]){delete this['imapAccounts'][this['mailAccounts'][_0x2e96fc][_0x4dbc('0x12')]['id']];}this['mailAccounts'][_0x2e96fc][_0x4dbc('0x12')][_0x4dbc('0x2b')]=moment();this[_0x4dbc('0xf')](_0x2e96fc);}};EmailChannel[_0x4dbc('0x17')][_0x4dbc('0x1e')]=function(_0xbc1277,_0x4de144){if(this['mailAccounts'][_0xbc1277]){this['mailAccounts'][_0xbc1277]['Imap'][_0x4dbc('0x21')]=_0x4dbc('0x2c');this[_0x4dbc('0xd')][_0xbc1277]['Imap'][_0x4dbc('0x20')]=_0x4de144;return this['emit'](_0xbc1277);}};EmailChannel[_0x4dbc('0x17')][_0x4dbc('0x2d')]=function(_0x3df299,_0x1bd5bb){return this[_0x4dbc('0x2e')][_0x4dbc('0x2f')](_0x3df299,_0x1bd5bb);};EmailChannel[_0x4dbc('0x17')][_0x4dbc('0x30')]=function(_0x5aaa73){var _0x4a3c88=this;if(this[_0x4dbc('0xd')][_0x5aaa73['id']]){if(_[_0x4dbc('0x14')](this[_0x4dbc('0xd')][_0x5aaa73['id']][_0x4dbc('0x31')])){this[_0x4dbc('0xd')][_0x5aaa73['id']][_0x4dbc('0x31')]={};}this[_0x4dbc('0xd')][_0x5aaa73['id']]['Smtp'][_0x4dbc('0x2b')]=moment();return new BPromise(function(_0x3dedf9,_0x2cc5e6){return _0x4a3c88[_0x4dbc('0x2e')][_0x4dbc('0x32')](_0x5aaa73)['then'](function(_0x2a7ae3){_0x4a3c88[_0x4dbc('0xd')][_0x5aaa73['id']][_0x4dbc('0x31')][_0x4dbc('0x21')]=_0x4dbc('0x33');_0x4a3c88['mailAccounts'][_0x5aaa73['id']][_0x4dbc('0x31')][_0x4dbc('0x20')]='';_0x4a3c88['emit'](_0x5aaa73['id']);_0x3dedf9(_0x2a7ae3);})[_0x4dbc('0x34')](function(_0x126ec7){_0x4a3c88[_0x4dbc('0xd')][_0x5aaa73['id']][_0x4dbc('0x31')][_0x4dbc('0x21')]=_0x4dbc('0x2c');_0x4a3c88[_0x4dbc('0xd')][_0x5aaa73['id']]['Smtp']['messageStatus']=_0x126ec7;_0x4a3c88[_0x4dbc('0xf')](_0x5aaa73['id']);_0x2cc5e6(_0x126ec7);});});}return this[_0x4dbc('0x2e')][_0x4dbc('0x32')](_0x5aaa73);};module[_0x4dbc('0x35')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 77ed84d..eaa9c1f 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 _0x8d84=['attributes','handleMessageAttributes','handleSimpleParser','parser','handleFetchError','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','mailparser','simpleParser','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','once','ready','handleReady','bind','end','handleEnd','error','handleError','inherits','prototype','getAccount','connTimeout','authTimeout','isNil','service','authentication','user','host','port','tls','required','password','getHost','anonymous@xcally.com','openBox','handleOpenBox','emit','handleCloseBox','readUnseen','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchEnd','closeBox','handleMessageBody'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8d84,0xfe));var _0x48d8=function(_0x555a6c,_0x316c00){_0x555a6c=_0x555a6c-0x0;var _0x440cc0=_0x8d84[_0x555a6c];return _0x440cc0;};'use strict';var fs=require('fs');var path=require(_0x48d8('0x0'));var util=require(_0x48d8('0x1'));var Imap=require(_0x48d8('0x2'));var _=require('lodash');var rs=require('randomstring');var simpleParser=require(_0x48d8('0x3'))[_0x48d8('0x4')];var Iconv=require('iconv')[_0x48d8('0x5')];var EventEmitter=require(_0x48d8('0x6'))[_0x48d8('0x7')];var utils=require(_0x48d8('0x8'));var logger=require(_0x48d8('0x9'))(_0x48d8('0xa'));function EmailImap(_0x185938,_0x159889){this[_0x48d8('0xb')]=_0x48d8('0xc');this[_0x48d8('0xd')]=this['getAccount'](_0x185938,_0x159889);this[_0x48d8('0x2')]=new Imap(this[_0x48d8('0xd')]);this['imap'][_0x48d8('0xe')](_0x48d8('0xf'),this[_0x48d8('0x10')][_0x48d8('0x11')](this));this['imap']['once'](_0x48d8('0x12'),this[_0x48d8('0x13')]['bind'](this));this[_0x48d8('0x2')]['on'](_0x48d8('0x14'),this[_0x48d8('0x15')][_0x48d8('0x11')](this));this[_0x48d8('0x2')]['connect']();}util[_0x48d8('0x16')](EmailImap,EventEmitter);EmailImap[_0x48d8('0x17')][_0x48d8('0x18')]=function(_0x535952,_0x54e030){var _0x1561c1={'connTimeout':_0x535952[_0x48d8('0x19')]?_0x535952[_0x48d8('0x19')]*0x3e8:0x2710,'authTimeout':_0x535952['authTimeout']?_0x535952[_0x48d8('0x1a')]*0x3e8:0x1388};if(_[_0x48d8('0x1b')](_0x535952[_0x48d8('0x1c')])){if(_0x535952[_0x48d8('0x1d')]){_0x1561c1[_0x48d8('0x1e')]=_0x535952[_0x48d8('0x1e')];_0x1561c1['password']=_0x535952['password'];}_0x1561c1[_0x48d8('0x1f')]=_0x535952[_0x48d8('0x1f')];_0x1561c1[_0x48d8('0x20')]=_0x535952['port']||0x3e1;if(_0x535952[_0x48d8('0x21')]){_0x1561c1['tls']=!![];}else{_0x1561c1['tls']=![];_0x1561c1['autotls']=_0x48d8('0x22');}}else{_0x1561c1[_0x48d8('0x1e')]=_0x535952['user'];_0x1561c1[_0x48d8('0x23')]=_0x535952[_0x48d8('0x23')];_0x1561c1[_0x48d8('0x1f')]=utils[_0x48d8('0x24')](_0x535952[_0x48d8('0x1c')]);_0x1561c1[_0x48d8('0x20')]=0x3e1;_0x1561c1[_0x48d8('0x21')]=!![];}_0x1561c1[_0x48d8('0xa')]=_0x54e030||_0x535952[_0x48d8('0x1e')]||_0x48d8('0x25');return _0x1561c1;};EmailImap[_0x48d8('0x17')][_0x48d8('0x10')]=function(){this['imap'][_0x48d8('0x26')](this['mailbox'],![],this[_0x48d8('0x27')]['bind'](this));};EmailImap[_0x48d8('0x17')]['handleOpenBox']=function(_0x4675b3,_0x5c7a2d){if(_0x4675b3){this[_0x48d8('0x15')](_0x4675b3,!![]);}else{this[_0x48d8('0x28')]('box',_0x5c7a2d);this['readUnseen']();}};EmailImap[_0x48d8('0x17')][_0x48d8('0x29')]=function(_0x5829eb){if(_0x5829eb){this[_0x48d8('0x15')](_0x5829eb,!![]);}else{this[_0x48d8('0x2')]['end']();}};EmailImap['prototype'][_0x48d8('0x2a')]=function(){this[_0x48d8('0x2')]['search'](['UNSEEN'],this['handleReadUnseen']['bind'](this));};EmailImap[_0x48d8('0x17')][_0x48d8('0x2b')]=function(_0x12686c,_0x44f231){if(_0x12686c){this['handleError'](_0x12686c,!![]);}else{if(_0x44f231[_0x48d8('0x2c')]){try{var _0x4b846c=this[_0x48d8('0x2')][_0x48d8('0x2d')](_0x44f231,{'bodies':'','markSeen':!![]});_0x4b846c['on'](_0x48d8('0x2e'),this[_0x48d8('0x2f')]['bind'](this));_0x4b846c[_0x48d8('0xe')](_0x48d8('0x14'),this['handleFetchError'][_0x48d8('0x11')](this));_0x4b846c[_0x48d8('0xe')](_0x48d8('0x12'),this[_0x48d8('0x30')][_0x48d8('0x11')](this));}catch(_0x7fa916){logger[_0x48d8('0x14')](_0x7fa916);}}else{this[_0x48d8('0x2')][_0x48d8('0x31')](!![],this['handleCloseBox'][_0x48d8('0x11')](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x1a8451,_0x203962){_0x1a8451['on']('body',this[_0x48d8('0x32')][_0x48d8('0x11')](this));_0x1a8451[_0x48d8('0xe')](_0x48d8('0x33'),this[_0x48d8('0x34')]['bind'](this));_0x1a8451[_0x48d8('0xe')](_0x48d8('0x12'),this['handleMessageEnd'][_0x48d8('0x11')](this));};EmailImap[_0x48d8('0x17')][_0x48d8('0x32')]=function(_0x25198b,_0xada5ff){simpleParser(_0x25198b,{'Iconv':Iconv},this[_0x48d8('0x35')][_0x48d8('0x11')](this));};EmailImap['prototype'][_0x48d8('0x34')]=function(_0x5881dd){};EmailImap[_0x48d8('0x17')]['handleMessageEnd']=function(){};EmailImap[_0x48d8('0x17')][_0x48d8('0x35')]=function(_0x338744,_0x3ddd6d){if(_0x338744){logger['error'](_0x338744);}else{var _0x3b36db=this;utils[_0x48d8('0x36')](this[_0x48d8('0xd')],_0x3ddd6d,function(_0x1ba083){_0x3b36db['emit'](_0x48d8('0xa'),_0x1ba083);});}};EmailImap[_0x48d8('0x17')]['handleFetchEnd']=function(){this[_0x48d8('0x2')][_0x48d8('0x31')](!![],this[_0x48d8('0x29')][_0x48d8('0x11')](this));};EmailImap['prototype'][_0x48d8('0x37')]=function(_0x25191e){this[_0x48d8('0x15')](_0x25191e);this[_0x48d8('0x2')][_0x48d8('0x31')](!![],this[_0x48d8('0x29')][_0x48d8('0x11')](this));};EmailImap[_0x48d8('0x17')][_0x48d8('0x13')]=function(){this[_0x48d8('0x28')](_0x48d8('0x12'));};EmailImap['prototype'][_0x48d8('0x15')]=function(_0x637937,_0x30b936){logger['error'](_0x48d8('0x15'),this[_0x48d8('0xd')]['email'],JSON[_0x48d8('0x38')](_0x637937));var _0x455e24='';if(_0x637937){if(_0x637937[_0x48d8('0x39')]){_0x455e24=_0x637937[_0x48d8('0x39')];}else{for(var _0x260516 in _0x637937){if(_0x637937[_0x48d8('0x3a')](_0x260516)){_0x455e24+=_[_0x48d8('0x3b')](_0x260516)+':\x20'+_0x637937[_0x260516]+'\x0a';}}}}if(_0x30b936){this[_0x48d8('0x2')][_0x48d8('0x12')]();}else{this[_0x48d8('0x28')](_0x48d8('0x14'),_0x455e24);this[_0x48d8('0x28')](_0x48d8('0x12'));}};module[_0x48d8('0x3c')]=EmailImap; \ No newline at end of file +var _0x3d0a=['simpleParser','iconv','../../../config/logger','email','INBOX','ready','handleEnd','bind','handleError','inherits','prototype','getAccount','connTimeout','authTimeout','isNil','authentication','user','password','host','port','tls','required','getHost','anonymous@xcally.com','openBox','mailbox','handleOpenBox','handleCloseBox','end','readUnseen','search','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','once','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','handleMessageAttributes','error','parser','account','emit','stringify','textCode','exports','path','imap','lodash','randomstring','mailparser'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x3d0a,0xa9));var _0xa3d0=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x3d0a[_0x31cb5f];return _0x586042;};'use strict';var fs=require('fs');var path=require(_0xa3d0('0x0'));var util=require('util');var Imap=require(_0xa3d0('0x1'));var _=require(_0xa3d0('0x2'));var rs=require(_0xa3d0('0x3'));var simpleParser=require(_0xa3d0('0x4'))[_0xa3d0('0x5')];var Iconv=require(_0xa3d0('0x6'))['Iconv'];var EventEmitter=require('events')['EventEmitter'];var utils=require('./utils');var logger=require(_0xa3d0('0x7'))(_0xa3d0('0x8'));function EmailImap(_0x42e7cd,_0x5d20be){this['mailbox']=_0xa3d0('0x9');this['account']=this['getAccount'](_0x42e7cd,_0x5d20be);this[_0xa3d0('0x1')]=new Imap(this['account']);this[_0xa3d0('0x1')]['once'](_0xa3d0('0xa'),this['handleReady']['bind'](this));this['imap']['once']('end',this[_0xa3d0('0xb')][_0xa3d0('0xc')](this));this['imap']['on']('error',this[_0xa3d0('0xd')]['bind'](this));this['imap']['connect']();}util[_0xa3d0('0xe')](EmailImap,EventEmitter);EmailImap[_0xa3d0('0xf')][_0xa3d0('0x10')]=function(_0x248438,_0x25182f){var _0xe26a5f={'connTimeout':_0x248438[_0xa3d0('0x11')]?_0x248438['connTimeout']*0x3e8:0x2710,'authTimeout':_0x248438[_0xa3d0('0x12')]?_0x248438[_0xa3d0('0x12')]*0x3e8:0x1388};if(_[_0xa3d0('0x13')](_0x248438['service'])){if(_0x248438[_0xa3d0('0x14')]){_0xe26a5f[_0xa3d0('0x15')]=_0x248438[_0xa3d0('0x15')];_0xe26a5f[_0xa3d0('0x16')]=_0x248438[_0xa3d0('0x16')];}_0xe26a5f[_0xa3d0('0x17')]=_0x248438[_0xa3d0('0x17')];_0xe26a5f[_0xa3d0('0x18')]=_0x248438[_0xa3d0('0x18')]||0x3e1;if(_0x248438[_0xa3d0('0x19')]){_0xe26a5f[_0xa3d0('0x19')]=!![];}else{_0xe26a5f[_0xa3d0('0x19')]=![];_0xe26a5f['autotls']=_0xa3d0('0x1a');}}else{_0xe26a5f[_0xa3d0('0x15')]=_0x248438[_0xa3d0('0x15')];_0xe26a5f[_0xa3d0('0x16')]=_0x248438['password'];_0xe26a5f[_0xa3d0('0x17')]=utils[_0xa3d0('0x1b')](_0x248438['service']);_0xe26a5f[_0xa3d0('0x18')]=0x3e1;_0xe26a5f[_0xa3d0('0x19')]=!![];}_0xe26a5f[_0xa3d0('0x8')]=_0x25182f||_0x248438[_0xa3d0('0x15')]||_0xa3d0('0x1c');return _0xe26a5f;};EmailImap[_0xa3d0('0xf')]['handleReady']=function(){this[_0xa3d0('0x1')][_0xa3d0('0x1d')](this[_0xa3d0('0x1e')],![],this[_0xa3d0('0x1f')][_0xa3d0('0xc')](this));};EmailImap[_0xa3d0('0xf')]['handleOpenBox']=function(_0x2a1175,_0x38136f){if(_0x2a1175){this[_0xa3d0('0xd')](_0x2a1175,!![]);}else{this['emit']('box',_0x38136f);this['readUnseen']();}};EmailImap['prototype'][_0xa3d0('0x20')]=function(_0x1de6b2){if(_0x1de6b2){this['handleError'](_0x1de6b2,!![]);}else{this[_0xa3d0('0x1')][_0xa3d0('0x21')]();}};EmailImap[_0xa3d0('0xf')][_0xa3d0('0x22')]=function(){this['imap'][_0xa3d0('0x23')]([_0xa3d0('0x24')],this[_0xa3d0('0x25')]['bind'](this));};EmailImap[_0xa3d0('0xf')][_0xa3d0('0x25')]=function(_0x20fda2,_0x56953b){if(_0x20fda2){this[_0xa3d0('0xd')](_0x20fda2,!![]);}else{if(_0x56953b['length']){try{var _0x23159d=this['imap'][_0xa3d0('0x26')](_0x56953b,{'bodies':'','markSeen':!![]});_0x23159d['on'](_0xa3d0('0x27'),this[_0xa3d0('0x28')][_0xa3d0('0xc')](this));_0x23159d[_0xa3d0('0x29')]('error',this[_0xa3d0('0x2a')]['bind'](this));_0x23159d[_0xa3d0('0x29')](_0xa3d0('0x21'),this[_0xa3d0('0x2b')]['bind'](this));}catch(_0xdad406){logger['error'](_0xdad406);}}else{this[_0xa3d0('0x1')][_0xa3d0('0x2c')](!![],this['handleCloseBox'][_0xa3d0('0xc')](this));}}};EmailImap[_0xa3d0('0xf')]['handleFetchMessage']=function(_0x2cffde,_0x363987){_0x2cffde['on'](_0xa3d0('0x2d'),this[_0xa3d0('0x2e')][_0xa3d0('0xc')](this));_0x2cffde[_0xa3d0('0x29')](_0xa3d0('0x2f'),this['handleMessageAttributes']['bind'](this));_0x2cffde[_0xa3d0('0x29')](_0xa3d0('0x21'),this[_0xa3d0('0x30')][_0xa3d0('0xc')](this));};EmailImap[_0xa3d0('0xf')][_0xa3d0('0x2e')]=function(_0x5cf5c6,_0x270ad4){simpleParser(_0x5cf5c6,{'Iconv':Iconv},this[_0xa3d0('0x31')][_0xa3d0('0xc')](this));};EmailImap['prototype'][_0xa3d0('0x32')]=function(_0x32b524){};EmailImap[_0xa3d0('0xf')]['handleMessageEnd']=function(){};EmailImap[_0xa3d0('0xf')]['handleSimpleParser']=function(_0x2d5069,_0x5a36a1){if(_0x2d5069){logger[_0xa3d0('0x33')](_0x2d5069);}else{var _0x22c5da=this;utils[_0xa3d0('0x34')](this[_0xa3d0('0x35')],_0x5a36a1,function(_0x2287a2){_0x22c5da['emit'](_0xa3d0('0x8'),_0x2287a2);});}};EmailImap[_0xa3d0('0xf')][_0xa3d0('0x2b')]=function(){this['imap'][_0xa3d0('0x2c')](!![],this[_0xa3d0('0x20')]['bind'](this));};EmailImap[_0xa3d0('0xf')][_0xa3d0('0x2a')]=function(_0x3c9400){this[_0xa3d0('0xd')](_0x3c9400);this[_0xa3d0('0x1')][_0xa3d0('0x2c')](!![],this[_0xa3d0('0x20')][_0xa3d0('0xc')](this));};EmailImap[_0xa3d0('0xf')][_0xa3d0('0xb')]=function(){this[_0xa3d0('0x36')](_0xa3d0('0x21'));};EmailImap[_0xa3d0('0xf')][_0xa3d0('0xd')]=function(_0x1df34d,_0x1df7e6){logger['error'](_0xa3d0('0xd'),this[_0xa3d0('0x35')][_0xa3d0('0x8')],JSON[_0xa3d0('0x37')](_0x1df34d));var _0x331a15='';if(_0x1df34d){if(_0x1df34d['textCode']){_0x331a15=_0x1df34d[_0xa3d0('0x38')];}else{for(var _0x1cbf84 in _0x1df34d){if(_0x1df34d['hasOwnProperty'](_0x1cbf84)){_0x331a15+=_['upperFirst'](_0x1cbf84)+':\x20'+_0x1df34d[_0x1cbf84]+'\x0a';}}}}if(_0x1df7e6){this['imap'][_0xa3d0('0x21')]();}else{this[_0xa3d0('0x36')]('error',_0x331a15);this['emit']('end');}};module[_0xa3d0('0x39')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index f81690b..49c5c73 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 _0x388e=['sendMail','toString','verify','nodemailer','bluebird','prototype','send','createTransport','use'];(function(_0x1bce27,_0x468041){var _0x18747d=function(_0x1e2f93){while(--_0x1e2f93){_0x1bce27['push'](_0x1bce27['shift']());}};_0x18747d(++_0x468041);}(_0x388e,0xc0));var _0xe388=function(_0x4cdeac,_0x34873c){_0x4cdeac=_0x4cdeac-0x0;var _0xde2dac=_0x388e[_0x4cdeac];return _0xde2dac;};'use strict';var nodemailer=require(_0xe388('0x0'));var BPromise=require(_0xe388('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0xe388('0x2')][_0xe388('0x3')]=function(_0x1950db,_0x315560){return new BPromise(function(_0x4eec14,_0x31f114){var _0x14bffe=nodemailer[_0xe388('0x4')](_0x1950db);_0x14bffe[_0xe388('0x5')]('compile',inlineBase64());_0x14bffe[_0xe388('0x6')](_0x315560,function(_0x25e49b,_0x41e57a){if(_0x25e49b){_0x31f114(_0x25e49b[_0xe388('0x7')]());}else{_0x4eec14(_0x41e57a);}});});};EmailSmtp['prototype'][_0xe388('0x8')]=function(_0x4ec22f){return new BPromise(function(_0x4e9779,_0x365e29){var _0x221656=nodemailer[_0xe388('0x4')](_0x4ec22f);_0x221656[_0xe388('0x8')](function(_0x2369af,_0x522772){if(_0x2369af){_0x365e29(_0x2369af[_0xe388('0x7')]());}else{if(_0x522772){_0x4e9779(_0x522772);}else{_0x365e29('Not\x20verifired');}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0xafa8=['createTransport','use','compile','sendMail','toString','verify','Not\x20verifired','exports','nodemailer','bluebird','prototype','send'];(function(_0x2c6e36,_0x1e28b6){var _0xbc5d8a=function(_0x20242d){while(--_0x20242d){_0x2c6e36['push'](_0x2c6e36['shift']());}};_0xbc5d8a(++_0x1e28b6);}(_0xafa8,0xbc));var _0x8afa=function(_0x513047,_0x2199c5){_0x513047=_0x513047-0x0;var _0x15b779=_0xafa8[_0x513047];return _0x15b779;};'use strict';var nodemailer=require(_0x8afa('0x0'));var BPromise=require(_0x8afa('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x8afa('0x2')][_0x8afa('0x3')]=function(_0x1b428a,_0x25923a){return new BPromise(function(_0x458247,_0x84854){var _0x5a0d7=nodemailer[_0x8afa('0x4')](_0x1b428a);_0x5a0d7[_0x8afa('0x5')](_0x8afa('0x6'),inlineBase64());_0x5a0d7[_0x8afa('0x7')](_0x25923a,function(_0x99b964,_0x51950b){if(_0x99b964){_0x84854(_0x99b964[_0x8afa('0x8')]());}else{_0x458247(_0x51950b);}});});};EmailSmtp['prototype'][_0x8afa('0x9')]=function(_0x16cc57){return new BPromise(function(_0xf1c64d,_0x337372){var _0x444482=nodemailer[_0x8afa('0x4')](_0x16cc57);_0x444482[_0x8afa('0x9')](function(_0x707109,_0x5ae499){if(_0x707109){_0x337372(_0x707109['toString']());}else{if(_0x5ae499){_0xf1c64d(_0x5ae499);}else{_0x337372(_0x8afa('0xa'));}}});});};module[_0x8afa('0xb')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 1f04eea..549527c 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 _0xdab3=['info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','BodyHTML','

Empty\x20message

','Attachments','Title','getHost','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','lodash','moment','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','name','substring','indexOf','slice','join','Anonymous','split','length','pop','isEmpty','@xcally.com','html','replace','includes','0x1?_0x454e3a[_0x3dab('0x10')](0x0,-0x1)[_0x3dab('0x11')]('\x20'):_0x128aac[_0x3dab('0xd')];}return _0x3dab('0x12');}function getLastName(_0x28fdaa){var _0x13c035=_[_0x3dab('0x8')](_0x28fdaa[_0x3dab('0x9')]);if(_0x13c035&&_0x13c035['name']){var _0x2b5aa8=_0x13c035[_0x3dab('0xd')][_0x3dab('0x13')](/\s+/);return _0x2b5aa8[_0x3dab('0x14')]>0x1?_0x2b5aa8[_0x3dab('0x15')]():'';}return'';}function getMails(_0x55cb0a,_0x4bd3f1){var _0xbeeee2='';for(var _0x2e9933=0x0;_0x2e9933<_0x4bd3f1[_0x3dab('0x9')][_0x3dab('0x14')];_0x2e9933+=0x1){if(_0x4bd3f1[_0x3dab('0x9')][_0x2e9933]['address']!==_0x55cb0a){if(!_[_0x3dab('0x16')](_0xbeeee2)){_0xbeeee2+=',';}_0xbeeee2+=_0x4bd3f1[_0x3dab('0x9')][_0x2e9933]['name']||_0x4bd3f1[_0x3dab('0x9')][_0x2e9933][_0x3dab('0xa')]||'';_0xbeeee2+='\x20<';_0xbeeee2+=_0x4bd3f1[_0x3dab('0x9')][_0x2e9933][_0x3dab('0xa')]?_0x4bd3f1['value'][_0x2e9933][_0x3dab('0xa')]:_0x3dab('0xb')+random[_0x3dab('0xc')](0x6)+_0x3dab('0x17');_0xbeeee2+='>';}}return _0xbeeee2;}function parseEmail(_0x2e4b09,_0x220247,_0x88dd2c){if(_0x220247[_0x3dab('0x18')]){var _0x471dd5=/)<[^<]*)*<\/script>/gi;while(_0x471dd5['test'](_0x220247[_0x3dab('0x18')])){_0x220247['html']=_0x220247[_0x3dab('0x18')][_0x3dab('0x19')](_0x471dd5,'');}if(_0x220247[_0x3dab('0x18')][_0x3dab('0x1a')](_0x3dab('0x1b'))){var _0x1cf209=[];_0x220247['attachments']['forEach'](_0x1b127e=>{_0x1cf209[_0x3dab('0x1c')](_0x1b127e['filename']);});var _0x21880a=/]+>/g;var _0x2f78d7=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x240c59=_0x220247[_0x3dab('0x18')]['replace'](_0x2f78d7,_0x3dab('0x1d'));var _0x4999c4=_0x240c59[_0x3dab('0x19')](_0x21880a,_0x3dab('0x1e'));for(let _0x233800=0x0;_0x233800<_0x1cf209[_0x3dab('0x14')];_0x233800++){var _0x4f81dc=_0x4999c4['replace'](_0x3dab('0x1e'),'\x20[Attachment:\x20'+_0x1cf209[_0x233800]+'\x20]');_0x4999c4=_0x4f81dc;}_0x220247['html']=_0x4999c4;}_0x88dd2c['body']=_0x220247[_0x3dab('0x18')];}else{_0x88dd2c[_0x3dab('0x1f')]=_0x220247[_0x3dab('0x20')];}if(_0x88dd2c[_0x3dab('0x1f')]){_0x88dd2c[_0x3dab('0x1f')]=_0x88dd2c[_0x3dab('0x1f')][_0x3dab('0x19')](/0x0){var _0x7bc808=[_0x3dab('0x30'),_0x3dab('0x31'),_0x3dab('0x32')];for(var _0x5ca73e=0x0;_0x5ca73e<_0x220247[_0x3dab('0x2f')]['length'];_0x5ca73e++){var _0x54af41=_[_0x3dab('0xf')](_0x7bc808,_0x220247['headerLines'][_0x5ca73e][_0x3dab('0x33')]);if(_0x54af41>=0x0){_0x88dd2c[_0x3dab('0x34')]=!![];}}}return _0x88dd2c;}exports[_0x3dab('0x35')]=function(_0x5d00cf,_0xf0bc93,_0x1974db){var _0x407998={'from':getAddress(_0xf0bc93[_0x3dab('0x36')]),'firstName':getFirstName(_0xf0bc93[_0x3dab('0x36')]),'lastName':getLastName(_0xf0bc93[_0x3dab('0x36')]),'mapKey':_0x3dab('0x6'),'message':{'from':getMails(_0x5d00cf['email'],_0xf0bc93[_0x3dab('0x36')]),'to':_0x5d00cf['email'],'cc':'','subject':_0xf0bc93[_0x3dab('0x37')]||'','messageId':_0xf0bc93[_0x3dab('0x38')],'inReplyTo':_0xf0bc93[_0x3dab('0x39')],'sentAt':moment(_0xf0bc93['date'])[_0x3dab('0x29')](_0x3dab('0x3a')),'attach':![],'attachments':[]}};if(!_0xf0bc93['html']&&!_0xf0bc93['textAsHtml']){var _0x220523=_[_0x3dab('0x3b')](_0xf0bc93[_0x3dab('0x25')],{'contentType':_0x3dab('0x3c')});if(_0x220523[_0x3dab('0x14')]){logger[_0x3dab('0x3d')](util[_0x3dab('0x29')](_0x3dab('0x3e'),_0xf0bc93[_0x3dab('0x38')]));tnef['parseBuffer'](_['first'](_0x220523)['content'],function(_0x14960d,_0x439f9e){if(_0x439f9e){_0xf0bc93['html']=_0x439f9e[_0x3dab('0x3f')]||_0x3dab('0x40');if(_0x439f9e[_0x3dab('0x41')]){for(var _0x465819=0x0;_0x465819<_0x439f9e[_0x3dab('0x41')][_0x3dab('0x14')];_0x465819++){var _0x4c2b07=_0x439f9e[_0x3dab('0x41')][_0x465819];_0x407998['message'][_0x3dab('0x25')][_0x3dab('0x1c')]({'filename':_0x4c2b07[_0x3dab('0x42')],'content':Buffer[_0x3dab('0x36')](_0x4c2b07['Data'])});}}}_0x1974db(parseEmail(_0x5d00cf,_0xf0bc93,_0x407998));});}else{_0xf0bc93[_0x3dab('0x18')]=_0x3dab('0x40');_0x1974db(parseEmail(_0x5d00cf,_0xf0bc93,_0x407998));}}else{_0x1974db(parseEmail(_0x5d00cf,_0xf0bc93,_0x407998));}};exports[_0x3dab('0x43')]=function(_0x1de677){switch(_0x1de677){case'gmail':return _0x3dab('0x44');case _0x3dab('0x45'):return _0x3dab('0x46');case _0x3dab('0x47'):return _0x3dab('0x48');case'outlook365':return _0x3dab('0x49');}return'127.0.0.1';}; \ No newline at end of file +var _0x5a13=['substring','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','test','html','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Title','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','127.0.0.1','moment','randomstring','path','util','node-tnef','../../../config/logger','../../../config/environment','address','anonymous','generate','@xcally.com','head','value','name'];(function(_0x1fd3a2,_0x490633){var _0x17b582=function(_0x43df60){while(--_0x43df60){_0x1fd3a2['push'](_0x1fd3a2['shift']());}};_0x17b582(++_0x490633);}(_0x5a13,0x92));var _0x35a1=function(_0x424d6d,_0x2dbea2){_0x424d6d=_0x424d6d-0x0;var _0x534fd4=_0x5a13[_0x424d6d];return _0x534fd4;};'use strict';var _=require('lodash');var moment=require(_0x35a1('0x0'));var random=require(_0x35a1('0x1'));var fs=require('fs');var path=require(_0x35a1('0x2'));var util=require(_0x35a1('0x3'));var tnef=require(_0x35a1('0x4'));var logger=require(_0x35a1('0x5'))('email');var config=require(_0x35a1('0x6'));function getAddress(_0x570b25){var _0x3950e0=_['head'](_0x570b25['value']);return _0x3950e0&&_0x3950e0['address']?_0x3950e0[_0x35a1('0x7')]:_0x35a1('0x8')+random[_0x35a1('0x9')](0x6)+_0x35a1('0xa');}function getFirstName(_0x78d296){var _0x5aa29f=_[_0x35a1('0xb')](_0x78d296[_0x35a1('0xc')]);if(_0x5aa29f&&_0x5aa29f[_0x35a1('0xd')]){if(_0x5aa29f[_0x35a1('0xd')]==_0x5aa29f[_0x35a1('0x7')]){return _0x5aa29f[_0x35a1('0xd')][_0x35a1('0xe')](0x0,_0x5aa29f[_0x35a1('0xd')][_0x35a1('0xf')]('@'));}var _0x5ee208=_0x5aa29f[_0x35a1('0xd')][_0x35a1('0x10')](/\s+/);return _0x5ee208[_0x35a1('0x11')]>0x1?_0x5ee208[_0x35a1('0x12')](0x0,-0x1)[_0x35a1('0x13')]('\x20'):_0x5aa29f['name'];}return _0x35a1('0x14');}function getLastName(_0x4e98ec){var _0xce17a1=_[_0x35a1('0xb')](_0x4e98ec['value']);if(_0xce17a1&&_0xce17a1[_0x35a1('0xd')]){var _0x1d9e24=_0xce17a1[_0x35a1('0xd')][_0x35a1('0x10')](/\s+/);return _0x1d9e24['length']>0x1?_0x1d9e24[_0x35a1('0x15')]():'';}return'';}function getMails(_0x156a6a,_0x423d80){var _0x41eed1='';for(var _0x5d5166=0x0;_0x5d5166<_0x423d80[_0x35a1('0xc')][_0x35a1('0x11')];_0x5d5166+=0x1){if(_0x423d80['value'][_0x5d5166][_0x35a1('0x7')]!==_0x156a6a){if(!_[_0x35a1('0x16')](_0x41eed1)){_0x41eed1+=',';}_0x41eed1+=_0x423d80['value'][_0x5d5166][_0x35a1('0xd')]||_0x423d80[_0x35a1('0xc')][_0x5d5166][_0x35a1('0x7')]||'';_0x41eed1+='\x20<';_0x41eed1+=_0x423d80[_0x35a1('0xc')][_0x5d5166][_0x35a1('0x7')]?_0x423d80['value'][_0x5d5166][_0x35a1('0x7')]:_0x35a1('0x8')+random['generate'](0x6)+'@xcally.com';_0x41eed1+='>';}}return _0x41eed1;}function parseEmail(_0x54e83d,_0x5f557b,_0x3f392c){if(_0x5f557b['html']){var _0x3e24a3=/)<[^<]*)*<\/script>/gi;while(_0x3e24a3[_0x35a1('0x17')](_0x5f557b[_0x35a1('0x18')])){_0x5f557b['html']=_0x5f557b[_0x35a1('0x18')][_0x35a1('0x19')](_0x3e24a3,'');}if(_0x5f557b[_0x35a1('0x18')][_0x35a1('0x1a')](_0x35a1('0x1b'))){var _0x2fdda0=[];_0x5f557b[_0x35a1('0x1c')][_0x35a1('0x1d')](_0x4c8945=>{_0x2fdda0[_0x35a1('0x1e')](_0x4c8945[_0x35a1('0x1f')]);});var _0x4e9a35=/]+>/g;var _0x209e81=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x138727=_0x5f557b['html'][_0x35a1('0x19')](_0x209e81,_0x35a1('0x20'));var _0x346d2e=_0x138727[_0x35a1('0x19')](_0x4e9a35,_0x35a1('0x21'));for(let _0x18a910=0x0;_0x18a910<_0x2fdda0[_0x35a1('0x11')];_0x18a910++){var _0x303665=_0x346d2e[_0x35a1('0x19')]('_IMG',_0x35a1('0x22')+_0x2fdda0[_0x18a910]+_0x35a1('0x23'));_0x346d2e=_0x303665;}_0x5f557b['html']=_0x346d2e;}_0x3f392c['body']=_0x5f557b[_0x35a1('0x18')];}else{_0x3f392c[_0x35a1('0x24')]=_0x5f557b[_0x35a1('0x25')];}if(_0x3f392c[_0x35a1('0x24')]){_0x3f392c[_0x35a1('0x24')]=_0x3f392c[_0x35a1('0x24')][_0x35a1('0x19')](/0x0){var _0x2e230c=[_0x35a1('0x34'),_0x35a1('0x35'),_0x35a1('0x36')];for(var _0x4d3e87=0x0;_0x4d3e87<_0x5f557b[_0x35a1('0x33')][_0x35a1('0x11')];_0x4d3e87++){var _0x51c19b=_[_0x35a1('0xf')](_0x2e230c,_0x5f557b[_0x35a1('0x33')][_0x4d3e87][_0x35a1('0x37')]);if(_0x51c19b>=0x0){_0x3f392c['isAutoreply']=!![];}}}return _0x3f392c;}exports['parser']=function(_0xb0ca7d,_0x56f134,_0x48086c){var _0x2d4dd9={'from':getAddress(_0x56f134[_0x35a1('0x38')]),'firstName':getFirstName(_0x56f134[_0x35a1('0x38')]),'lastName':getLastName(_0x56f134[_0x35a1('0x38')]),'mapKey':_0x35a1('0x27'),'message':{'from':getMails(_0xb0ca7d['email'],_0x56f134[_0x35a1('0x38')]),'to':_0xb0ca7d[_0x35a1('0x27')],'cc':'','subject':_0x56f134[_0x35a1('0x39')]||'','messageId':_0x56f134[_0x35a1('0x3a')],'inReplyTo':_0x56f134[_0x35a1('0x3b')],'sentAt':moment(_0x56f134[_0x35a1('0x3c')])[_0x35a1('0x3d')](_0x35a1('0x3e')),'attach':![],'attachments':[]}};if(!_0x56f134[_0x35a1('0x18')]&&!_0x56f134['textAsHtml']){var _0x213cd=_[_0x35a1('0x3f')](_0x56f134[_0x35a1('0x1c')],{'contentType':'application/ms-tnef'});if(_0x213cd[_0x35a1('0x11')]){logger['info'](util[_0x35a1('0x3d')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x56f134[_0x35a1('0x3a')]));tnef[_0x35a1('0x40')](_[_0x35a1('0x41')](_0x213cd)[_0x35a1('0x31')],function(_0x1b51f3,_0x14756a){if(_0x14756a){_0x56f134[_0x35a1('0x18')]=_0x14756a[_0x35a1('0x42')]||_0x35a1('0x43');if(_0x14756a[_0x35a1('0x44')]){for(var _0x1e31d6=0x0;_0x1e31d6<_0x14756a[_0x35a1('0x44')]['length'];_0x1e31d6++){var _0x3a82ba=_0x14756a[_0x35a1('0x44')][_0x1e31d6];_0x2d4dd9[_0x35a1('0x28')][_0x35a1('0x1c')][_0x35a1('0x1e')]({'filename':_0x3a82ba[_0x35a1('0x45')],'content':Buffer['from'](_0x3a82ba[_0x35a1('0x46')])});}}}_0x48086c(parseEmail(_0xb0ca7d,_0x56f134,_0x2d4dd9));});}else{_0x56f134[_0x35a1('0x18')]=_0x35a1('0x43');_0x48086c(parseEmail(_0xb0ca7d,_0x56f134,_0x2d4dd9));}}else{_0x48086c(parseEmail(_0xb0ca7d,_0x56f134,_0x2d4dd9));}};exports[_0x35a1('0x47')]=function(_0x2e120f){switch(_0x2e120f){case _0x35a1('0x48'):return _0x35a1('0x49');case _0x35a1('0x4a'):return _0x35a1('0x4b');case _0x35a1('0x4c'):return'imap-mail.outlook.com';case _0x35a1('0x4d'):return _0x35a1('0x4e');}return _0x35a1('0x4f');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index b955535..3a4e681 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 _0x7f59=['Imap','Smtp','exports','lodash','name','key','active'];(function(_0x578bf7,_0x11139a){var _0x576f36=function(_0x173311){while(--_0x173311){_0x578bf7['push'](_0x578bf7['shift']());}};_0x576f36(++_0x11139a);}(_0x7f59,0xc0));var _0x97f5=function(_0x5bde6f,_0x561ce1){_0x5bde6f=_0x5bde6f-0x0;var _0x1d6f12=_0x7f59[_0x5bde6f];return _0x1d6f12;};'use strict';var _=require(_0x97f5('0x0'));function MailAccount(_0x4d074d){this['id']=_0x4d074d['id']||0x0;this['name']=_0x4d074d[_0x97f5('0x1')]||'Service';this[_0x97f5('0x2')]=_0x4d074d['key']||'SERV';this['active']=_0x4d074d[_0x97f5('0x3')]||![];this[_0x97f5('0x4')]=_0x4d074d['Imap']||[];this[_0x97f5('0x5')]=_0x4d074d[_0x97f5('0x5')]||[];}module[_0x97f5('0x6')]=MailAccount; \ No newline at end of file +var _0x4b43=['name','Service','key','active','Imap','Smtp','exports','lodash'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x4b43,0x19f));var _0x34b4=function(_0x4f8b06,_0x572756){_0x4f8b06=_0x4f8b06-0x0;var _0x4a2e6d=_0x4b43[_0x4f8b06];return _0x4a2e6d;};'use strict';var _=require(_0x34b4('0x0'));function MailAccount(_0x4c951b){this['id']=_0x4c951b['id']||0x0;this[_0x34b4('0x1')]=_0x4c951b[_0x34b4('0x1')]||_0x34b4('0x2');this[_0x34b4('0x3')]=_0x4c951b[_0x34b4('0x3')]||'SERV';this[_0x34b4('0x4')]=_0x4c951b[_0x34b4('0x4')]||![];this[_0x34b4('0x5')]=_0x4c951b['Imap']||[];this['Smtp']=_0x4c951b[_0x34b4('0x6')]||[];}module[_0x34b4('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 dff0417..4b0e373 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 _0x3e78=['lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','isUndefined','exports'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x3e78,0x1b8));var _0x83e7=function(_0x2cc8bb,_0x5f2607){_0x2cc8bb=_0x2cc8bb-0x0;var _0x140e40=_0x3e78[_0x2cc8bb];return _0x140e40;};'use strict';var _=require(_0x83e7('0x0'));var MailAccount=require(_0x83e7('0x1'));var Realtime=function(){this[_0x83e7('0x2')]={};};function freeIsNotKey(_0x4cd79f,_0x35c8ea,_0x36c282){var _0x3a9771=_[_0x83e7('0x3')](_0x4cd79f,function(_0x1a591e,_0x3239f6){return _0x1a591e[_0x36c282];});for(var _0x1ef299 in _0x35c8ea){if(_0x35c8ea[_0x83e7('0x4')](_0x1ef299)){if(!_0x3a9771[_0x1ef299]){delete _0x35c8ea[_0x1ef299];}}}}Realtime[_0x83e7('0x5')]['mergeFromDatabase']=function(_0x453997,_0x3b2893){for(var _0x25e00e in _0x3b2893){if(_0x453997[_0x83e7('0x4')](_0x25e00e)){_0x453997[_0x25e00e]=_0x3b2893[_0x25e00e];}}};Realtime[_0x83e7('0x5')]['initMailAccounts']=function(){var _0x1d6217=this;return function(_0x4e9246){if(_0x4e9246){freeIsNotKey(_0x4e9246,_0x1d6217[_0x83e7('0x2')],'id');for(var _0x3088d2=0x0,_0x554150={},_0x99886={};_0x3088d2<_0x4e9246['length'];_0x3088d2+=0x1){_0x554150=_0x4e9246[_0x3088d2];if(_[_0x83e7('0x6')](_0x1d6217['mailAccounts'][_0x554150['id']])){_0x1d6217[_0x83e7('0x2')][_0x554150['id']]=new MailAccount(_0x554150);}else{_['merge'](_0x1d6217['mailAccounts'][_0x554150['id']],_0x554150);}}}return _0x1d6217[_0x83e7('0x2')];};};module[_0x83e7('0x7')]=Realtime; \ No newline at end of file +var _0x554e=['prototype','length','isUndefined','merge','exports','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty'];(function(_0x1fdf56,_0x34f85d){var _0x34b422=function(_0x444a19){while(--_0x444a19){_0x1fdf56['push'](_0x1fdf56['shift']());}};_0x34b422(++_0x34f85d);}(_0x554e,0x8c));var _0xe554=function(_0xa2049b,_0x7eeb1e){_0xa2049b=_0xa2049b-0x0;var _0x2fd615=_0x554e[_0xa2049b];return _0x2fd615;};'use strict';var _=require('lodash');var MailAccount=require(_0xe554('0x0'));var Realtime=function(){this[_0xe554('0x1')]={};};function freeIsNotKey(_0x18bc62,_0x1549ea,_0x1db62a){var _0x5e7160=_[_0xe554('0x2')](_0x18bc62,function(_0x4c47d1,_0xa1f8b0){return _0x4c47d1[_0x1db62a];});for(var _0x632107 in _0x1549ea){if(_0x1549ea[_0xe554('0x3')](_0x632107)){if(!_0x5e7160[_0x632107]){delete _0x1549ea[_0x632107];}}}}Realtime[_0xe554('0x4')]['mergeFromDatabase']=function(_0x3b20b2,_0x1a6e53){for(var _0x2c2d71 in _0x1a6e53){if(_0x3b20b2[_0xe554('0x3')](_0x2c2d71)){_0x3b20b2[_0x2c2d71]=_0x1a6e53[_0x2c2d71];}}};Realtime[_0xe554('0x4')]['initMailAccounts']=function(){var _0x33aa27=this;return function(_0x10fe11){if(_0x10fe11){freeIsNotKey(_0x10fe11,_0x33aa27[_0xe554('0x1')],'id');for(var _0x1655e1=0x0,_0x473fbf={},_0xbccb7d={};_0x1655e1<_0x10fe11[_0xe554('0x5')];_0x1655e1+=0x1){_0x473fbf=_0x10fe11[_0x1655e1];if(_[_0xe554('0x6')](_0x33aa27[_0xe554('0x1')][_0x473fbf['id']])){_0x33aa27[_0xe554('0x1')][_0x473fbf['id']]=new MailAccount(_0x473fbf);}else{_[_0xe554('0x7')](_0x33aa27[_0xe554('0x1')][_0x473fbf['id']],_0x473fbf);}}}return _0x33aa27[_0xe554('0x1')];};};module[_0xe554('0x8')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 9875066..a47bbfb 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 _0x29b3=['../client','getMailAccounts','Request','name','service','email','active','key','ListId','TemplateId','MailServerIn','Imap','MailServerOut','Smtp','notify','NotifyMailAccount'];(function(_0x4f7662,_0x22025b){var _0x229605=function(_0x473547){while(--_0x473547){_0x4f7662['push'](_0x4f7662['shift']());}};_0x229605(++_0x22025b);}(_0x29b3,0x160));var _0x329b=function(_0x1ea9c6,_0x2d57f6){_0x1ea9c6=_0x1ea9c6-0x0;var _0xd72b38=_0x29b3[_0x1ea9c6];return _0xd72b38;};'use strict';var client=require(_0x329b('0x0'));exports[_0x329b('0x1')]=function(){return function(){return client[_0x329b('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0x329b('0x3'),_0x329b('0x4'),_0x329b('0x5'),_0x329b('0x6'),_0x329b('0x7'),_0x329b('0x8'),_0x329b('0x9')],'raw':![],'include':[{'model':_0x329b('0xa'),'as':_0x329b('0xb')},{'model':_0x329b('0xc'),'as':_0x329b('0xd')}]},'log':'getMailAccount'});};};exports[_0x329b('0xe')]=function(_0x3f822c,_0xc733b4){return client['Request'](_0x329b('0xf'),{'account':{'id':_0x3f822c},'body':_0xc733b4,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0x1a62=['name','service','key','TemplateId','MailServerIn','Imap','MailServerOut','Smtp','notify','NotifyMailAccount','../client','getMailAccounts','Request'];(function(_0xa06e0b,_0x6c2305){var _0x14142f=function(_0x2ac612){while(--_0x2ac612){_0xa06e0b['push'](_0xa06e0b['shift']());}};_0x14142f(++_0x6c2305);}(_0x1a62,0x176));var _0x21a6=function(_0x448163,_0x54930d){_0x448163=_0x448163-0x0;var _0x2dcb26=_0x1a62[_0x448163];return _0x2dcb26;};'use strict';var client=require(_0x21a6('0x0'));exports[_0x21a6('0x1')]=function(){return function(){return client[_0x21a6('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0x21a6('0x3'),_0x21a6('0x4'),'email','active',_0x21a6('0x5'),'ListId',_0x21a6('0x6')],'raw':![],'include':[{'model':_0x21a6('0x7'),'as':_0x21a6('0x8')},{'model':_0x21a6('0x9'),'as':_0x21a6('0xa')}]},'log':'getMailAccount'});};};exports[_0x21a6('0xb')]=function(_0x42e87d,_0x20a445){return client[_0x21a6('0x2')](_0x21a6('0xc'),{'account':{'id':_0x42e87d},'body':_0x20a445,'log':_0x21a6('0xc')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 2d80236..1b64acb 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 _0x99ce=['ShowSetting','GetSettings','../client','getSettings','Request'];(function(_0x35cdc6,_0x4608f9){var _0x8f454b=function(_0x55de2f){while(--_0x55de2f){_0x35cdc6['push'](_0x35cdc6['shift']());}};_0x8f454b(++_0x4608f9);}(_0x99ce,0xd4));var _0xe99c=function(_0x49bf4d,_0x1fbf58){_0x49bf4d=_0x49bf4d-0x0;var _0x354be8=_0x99ce[_0x49bf4d];return _0x354be8;};'use strict';var client=require(_0xe99c('0x0'));exports[_0xe99c('0x1')]=function(){return client[_0xe99c('0x2')](_0xe99c('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xe99c('0x4')});}; \ No newline at end of file +var _0x3d78=['loginMailFrequency','GetSettings','../client','getSettings','Request'];(function(_0x3bcf9e,_0x148a5d){var _0x1bb37c=function(_0xcaf5da){while(--_0xcaf5da){_0x3bcf9e['push'](_0x3bcf9e['shift']());}};_0x1bb37c(++_0x148a5d);}(_0x3d78,0x1a6));var _0x83d7=function(_0x1effa0,_0x4d3432){_0x1effa0=_0x1effa0-0x0;var _0x409518=_0x3d78[_0x1effa0];return _0x409518;};'use strict';var client=require(_0x83d7('0x0'));exports[_0x83d7('0x1')]=function(){return client[_0x83d7('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x83d7('0x3')]},'log':_0x83d7('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 5155345..f44fbc2 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 c59a3eb..4dd2bad 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 _0xee97=['listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','websocket','polling','redis','defaults','localhost','adapter','../../config/triggers','default','../../config/socketio','../../routes','once'];(function(_0x354367,_0x286ded){var _0x5d642c=function(_0x346c89){while(--_0x346c89){_0x354367['push'](_0x354367['shift']());}};_0x5d642c(++_0x286ded);}(_0xee97,0x100));var _0x7ee9=function(_0x316b67,_0x28e271){_0x316b67=_0x316b67-0x0;var _0x4bac3a=_0xee97[_0x316b67];return _0x4bac3a;};'use strict';var _=require(_0x7ee9('0x0'));var http=require('http');var express=require(_0x7ee9('0x1'));var sticky=require(_0x7ee9('0x2'));var Redis=require(_0x7ee9('0x3'));var config=require(_0x7ee9('0x4'));var app=express();var server=http[_0x7ee9('0x5')](app);server[_0x7ee9('0x6')]=0xdbba0;if(sticky[_0x7ee9('0x7')](server,config[_0x7ee9('0x8')])){var socketio=require('socket.io')(server,{'transports':[_0x7ee9('0x9'),_0x7ee9('0xa')]});config[_0x7ee9('0xb')]=_[_0x7ee9('0xc')](config[_0x7ee9('0xb')],{'host':_0x7ee9('0xd'),'port':0x18eb});socketio[_0x7ee9('0xe')](require('socket.io-redis')({'pubClient':new Redis(config[_0x7ee9('0xb')]),'subClient':new Redis(config[_0x7ee9('0xb')])}));require(_0x7ee9('0xf'))[_0x7ee9('0x10')]();require(_0x7ee9('0x11'))['default'](socketio);require('../../config/express')[_0x7ee9('0x10')](app);require(_0x7ee9('0x12'))[_0x7ee9('0x10')](app);}else{server[_0x7ee9('0x13')](_0x7ee9('0x14'),function(){console[_0x7ee9('0x15')](_0x7ee9('0x16'),config[_0x7ee9('0x8')]);});}exports=module['exports']=app; \ No newline at end of file +var _0x2b1f=['../../routes','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','polling','redis','localhost','socket.io-redis','../../config/triggers','default','../../config/express'];(function(_0x401554,_0x34b410){var _0x5b70e9=function(_0x4240c1){while(--_0x4240c1){_0x401554['push'](_0x401554['shift']());}};_0x5b70e9(++_0x34b410);}(_0x2b1f,0xb5));var _0xf2b1=function(_0x1e48d3,_0x5d8c43){_0x1e48d3=_0x1e48d3-0x0;var _0x2852b1=_0x2b1f[_0x1e48d3];return _0x2852b1;};'use strict';var _=require(_0xf2b1('0x0'));var http=require(_0xf2b1('0x1'));var express=require('express');var sticky=require(_0xf2b1('0x2'));var Redis=require(_0xf2b1('0x3'));var config=require(_0xf2b1('0x4'));var app=express();var server=http[_0xf2b1('0x5')](app);server[_0xf2b1('0x6')]=0xdbba0;if(sticky[_0xf2b1('0x7')](server,config[_0xf2b1('0x8')])){var socketio=require(_0xf2b1('0x9'))(server,{'transports':['websocket',_0xf2b1('0xa')]});config[_0xf2b1('0xb')]=_['defaults'](config['redis'],{'host':_0xf2b1('0xc'),'port':0x18eb});socketio['adapter'](require(_0xf2b1('0xd'))({'pubClient':new Redis(config[_0xf2b1('0xb')]),'subClient':new Redis(config[_0xf2b1('0xb')])}));require(_0xf2b1('0xe'))['default']();require('../../config/socketio')[_0xf2b1('0xf')](socketio);require(_0xf2b1('0x10'))[_0xf2b1('0xf')](app);require(_0xf2b1('0x11'))[_0xf2b1('0xf')](app);}else{server['once'](_0xf2b1('0x12'),function(){console[_0xf2b1('0x13')](_0xf2b1('0x14'),config[_0xf2b1('0x8')]);});}exports=module[_0xf2b1('0x15')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index d51b36d..445432b 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 _0x12f0=['message','error','catch','jayson/promise','bluebird','../../config/logger','client','request','debug','rpc','routing'];(function(_0x231544,_0x592bab){var _0x3a96df=function(_0x542502){while(--_0x542502){_0x231544['push'](_0x231544['shift']());}};_0x3a96df(++_0x592bab);}(_0x12f0,0x121));var _0x012f=function(_0x2dc2f9,_0x3f3394){_0x2dc2f9=_0x2dc2f9-0x0;var _0x7f9396=_0x12f0[_0x2dc2f9];return _0x7f9396;};'use strict';var jayson=require(_0x012f('0x0'));var BPromise=require(_0x012f('0x1'));var logger=require(_0x012f('0x2'))('routing');var client=jayson[_0x012f('0x3')]['http']({'port':0x2329});client['Request']=function(_0x3128fd,_0x5e56f0){return new BPromise(function(_0x51e000,_0x4e12aa){return client[_0x012f('0x4')](_0x3128fd,_0x5e56f0)['then'](function(_0x1beec9){logger[_0x012f('0x5')](_0x012f('0x6'),_0x012f('0x7'),_0x3128fd,_0x5e56f0,_0x1beec9);if(_0x1beec9['error']){logger['error'](_0x012f('0x6'),_0x012f('0x7'),_0x3128fd,_0x1beec9['error'][_0x012f('0x8')],_0x5e56f0);return _0x4e12aa(_0x1beec9[_0x012f('0x9')][_0x012f('0x8')]);}else{return _0x51e000(_0x1beec9['result']);}})[_0x012f('0xa')](function(_0x383f2d){logger['error'](_0x012f('0x6'),_0x012f('0x7'),_0x3128fd,_0x383f2d,_0x5e56f0);return _0x4e12aa(_0x383f2d);});});};module['exports']=client; \ No newline at end of file +var _0x61bf=['message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','http','Request','then','debug','rpc','error'];(function(_0x58da8a,_0x1fb6ff){var _0x5294b9=function(_0x684dd6){while(--_0x684dd6){_0x58da8a['push'](_0x58da8a['shift']());}};_0x5294b9(++_0x1fb6ff);}(_0x61bf,0x1a8));var _0xf61b=function(_0x37e6d4,_0x1c9306){_0x37e6d4=_0x37e6d4-0x0;var _0x446eff=_0x61bf[_0x37e6d4];return _0x446eff;};'use strict';var jayson=require(_0xf61b('0x0'));var BPromise=require(_0xf61b('0x1'));var logger=require(_0xf61b('0x2'))(_0xf61b('0x3'));var client=jayson['client'][_0xf61b('0x4')]({'port':0x2329});client[_0xf61b('0x5')]=function(_0x49585a,_0x556516){return new BPromise(function(_0x5ab00b,_0x1c9d2f){return client['request'](_0x49585a,_0x556516)[_0xf61b('0x6')](function(_0x3bf401){logger[_0xf61b('0x7')](_0xf61b('0x8'),_0xf61b('0x3'),_0x49585a,_0x556516,_0x3bf401);if(_0x3bf401[_0xf61b('0x9')]){logger[_0xf61b('0x9')](_0xf61b('0x8'),_0xf61b('0x3'),_0x49585a,_0x3bf401[_0xf61b('0x9')][_0xf61b('0xa')],_0x556516);return _0x1c9d2f(_0x3bf401['error']['message']);}else{return _0x5ab00b(_0x3bf401[_0xf61b('0xb')]);}})[_0xf61b('0xc')](function(_0x3f5f75){logger[_0xf61b('0x9')]('rpc','routing',_0x49585a,_0x3f5f75,_0x556516);return _0x1c9d2f(_0x3f5f75);});});};module[_0xf61b('0xd')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index f8d5159..0b2818e 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 _0x62ed=['./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/faxQueue','resolve','then','getAgents','getIntervals','initIntervals','getOpenchannelQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./rpc/user'];(function(_0x6abfc6,_0x2bff7a){var _0x2454e5=function(_0x18f6b8){while(--_0x18f6b8){_0x6abfc6['push'](_0x6abfc6['shift']());}};_0x2454e5(++_0x2bff7a);}(_0x62ed,0xad));var _0xd62e=function(_0x21409d,_0xedcf83){_0x21409d=_0x21409d-0x0;var _0x5516fe=_0x62ed[_0x21409d];return _0x5516fe;};'use strict';var BPromise=require(_0xd62e('0x0'));var server=require(_0xd62e('0x1'));var Realtime=require('./realtime');var user=require(_0xd62e('0x2'));var interval=require(_0xd62e('0x3'));var openchannelQueue=require(_0xd62e('0x4'));var chatQueue=require(_0xd62e('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0xd62e('0x6'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0xd62e('0x7')]()[_0xd62e('0x8')](user[_0xd62e('0x9')]())[_0xd62e('0x8')](realtime['initAgents']())[_0xd62e('0x8')](interval[_0xd62e('0xa')]())[_0xd62e('0x8')](realtime[_0xd62e('0xb')]())[_0xd62e('0x8')](openchannelQueue[_0xd62e('0xc')]())[_0xd62e('0x8')](realtime['initOpenchannelQueues']())[_0xd62e('0x8')](chatQueue['getChatQueues']())[_0xd62e('0x8')](realtime['initChatQueues']())[_0xd62e('0x8')](smsQueue['getSmsQueues']())[_0xd62e('0x8')](realtime[_0xd62e('0xd')]())['then'](mailQueue[_0xd62e('0xe')]())['then'](realtime[_0xd62e('0xf')]())[_0xd62e('0x8')](faxQueue[_0xd62e('0x10')]())[_0xd62e('0x8')](realtime[_0xd62e('0x11')]())[_0xd62e('0x8')](whatsappQueue['getWhatsappQueues']())[_0xd62e('0x8')](realtime[_0xd62e('0x12')]())[_0xd62e('0x8')](function(){return realtime;});}function main(){return server[_0xd62e('0x13')](realtime)[_0xd62e('0x8')](function(_0x388025){return initRealtime();})['then'](function(_0x2a0382){return setInterval(initRealtime,0x1388);})[_0xd62e('0x14')](function(_0x12b9c5){console[_0xd62e('0x15')](_0x12b9c5);});}main(); \ No newline at end of file +var _0xfc5c=['getAgents','initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','getFaxQueues','initWhatsappQueues','listen','catch','log','./server','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0xfc5c,0x121));var _0xcfc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfc5c[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var server=require(_0xcfc5('0x0'));var Realtime=require('./realtime');var user=require(_0xcfc5('0x1'));var interval=require(_0xcfc5('0x2'));var openchannelQueue=require(_0xcfc5('0x3'));var chatQueue=require(_0xcfc5('0x4'));var smsQueue=require(_0xcfc5('0x5'));var mailQueue=require(_0xcfc5('0x6'));var faxQueue=require(_0xcfc5('0x7'));var whatsappQueue=require(_0xcfc5('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xcfc5('0x9')]()[_0xcfc5('0xa')](user[_0xcfc5('0xb')]())[_0xcfc5('0xa')](realtime[_0xcfc5('0xc')]())[_0xcfc5('0xa')](interval[_0xcfc5('0xd')]())[_0xcfc5('0xa')](realtime['initIntervals']())[_0xcfc5('0xa')](openchannelQueue[_0xcfc5('0xe')]())[_0xcfc5('0xa')](realtime[_0xcfc5('0xf')]())[_0xcfc5('0xa')](chatQueue[_0xcfc5('0x10')]())[_0xcfc5('0xa')](realtime[_0xcfc5('0x11')]())[_0xcfc5('0xa')](smsQueue[_0xcfc5('0x12')]())[_0xcfc5('0xa')](realtime['initSmsQueues']())[_0xcfc5('0xa')](mailQueue[_0xcfc5('0x13')]())[_0xcfc5('0xa')](realtime['initMailQueues']())[_0xcfc5('0xa')](faxQueue[_0xcfc5('0x14')]())[_0xcfc5('0xa')](realtime['initFaxQueues']())['then'](whatsappQueue['getWhatsappQueues']())[_0xcfc5('0xa')](realtime[_0xcfc5('0x15')]())['then'](function(){return realtime;});}function main(){return server[_0xcfc5('0x16')](realtime)[_0xcfc5('0xa')](function(_0x3aea3a){return initRealtime();})[_0xcfc5('0xa')](function(_0x19f034){return setInterval(initRealtime,0x1388);})[_0xcfc5('0x17')](function(_0x548ced){console[_0xcfc5('0x18')](_0x548ced);});}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 0fe9b2b..f3f9b52 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 _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x29fd85,_0x54cc9c){var _0x450aee=function(_0x1c604a){while(--_0x1c604a){_0x29fd85['push'](_0x29fd85['shift']());}};_0x450aee(++_0x54cc9c);}(_0x7a54,0x106));var _0x47a5=function(_0x2f9e99,_0x475c13){_0x2f9e99=_0x2f9e99-0x0;var _0x188257=_0x7a54[_0x2f9e99];return _0x188257;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=RuleEngine; \ No newline at end of file +var _0x2ef3=['next','isEqual','restart','condition','matches','filter','turn','prioritize','findRules','length','priority','toJSON','map','toString','fromJSON','parse','object','exports','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','rules','activeRules','prototype','isArray','concat','push','sync','orderBy','result','clone','consequence','name','index_','nextTick','ruleRef','call'];(function(_0x1e0503,_0x8a699c){var _0x13b6d3=function(_0x56992d){while(--_0x56992d){_0x1e0503['push'](_0x1e0503['shift']());}};_0x13b6d3(++_0x8a699c);}(_0x2ef3,0xba));var _0x32ef=function(_0x2addaa,_0x2cd9c9){_0x2addaa=_0x2addaa-0x0;var _0xf614cd=_0x2ef3[_0x2addaa];return _0xf614cd;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var EventEmitter=require(_0x32ef('0x2'))[_0x32ef('0x3')];function RuleEngine(_0x3944df,_0x38047b){this['init']();if(!_[_0x32ef('0x4')](_0x3944df)){this[_0x32ef('0x5')](_0x3944df);}if(_0x38047b){this['ignoreFactChanges']=_0x38047b[_0x32ef('0x6')];}return this;}util[_0x32ef('0x7')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x2c0089){this[_0x32ef('0x8')]=[];this[_0x32ef('0x9')]=[];};RuleEngine[_0x32ef('0xa')][_0x32ef('0x5')]=function(_0x298066){if(Array[_0x32ef('0xb')](_0x298066)){this[_0x32ef('0x8')]=this[_0x32ef('0x8')][_0x32ef('0xc')](_0x298066);}else if(_0x298066!==null&&_['isObject'](_0x298066)){this['rules'][_0x32ef('0xd')](_0x298066);}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0xe')]=function(){this['activeRules']=this[_0x32ef('0x8')]['filter'](function(_0x1a5106){if(_['isNil'](_0x1a5106['on'])){_0x1a5106['on']=!![];}if(_0x1a5106['on']===!![]){return _0x1a5106;}});this[_0x32ef('0x9')]=_[_0x32ef('0xf')](this['activeRules'],['p'],['asc']);};RuleEngine[_0x32ef('0xa')]['execute']=function(_0x326fce,_0x40a6e6){var _0x93d492=![];_0x326fce[_0x32ef('0x10')]=!![];var _0x57aff1=_['clone'](_0x326fce);var _0x531e30=_[_0x32ef('0x11')](_0x326fce);var _0x3950e6=this[_0x32ef('0x9')];var _0x53a5ca=[];var _0x5d559b=this[_0x32ef('0x6')];(function FnRuleLoop(_0x1a9476){var _0x286bfb={'rules':function(){return _0x3950e6;},'rule':function(){return _0x3950e6[_0x1a9476];},'when':function(_0x57863c){if(_0x57863c){var _0xbe37f6=_0x3950e6[_0x1a9476][_0x32ef('0x12')];_0xbe37f6['ruleRef']=_0x3950e6[_0x1a9476]['id']||_0x3950e6[_0x1a9476][_0x32ef('0x13')]||_0x32ef('0x14')+_0x1a9476;process[_0x32ef('0x15')](function(){_0x53a5ca[_0x32ef('0xd')](_0xbe37f6[_0x32ef('0x16')]);_0xbe37f6[_0x32ef('0x17')](_0x57aff1,_0x286bfb);});}else{process['nextTick'](function(){_0x286bfb[_0x32ef('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x93d492=!![];return FnRuleLoop(0x0);},'next':function(_0x5cc3ef){if(!_0x5d559b&&!_[_0x32ef('0x19')](_0x531e30,_0x57aff1)){_0x531e30=_[_0x32ef('0x11')](_0x57aff1);process['nextTick'](function(){_0x286bfb[_0x32ef('0x1a')]();});}else{process[_0x32ef('0x15')](function(){if(_[_0x32ef('0x4')](_0x5cc3ef)){return FnRuleLoop(_0x1a9476+0x1);}else{return FnRuleLoop(_0x5cc3ef);}});}}};if(_0x1a9476<_0x3950e6['length']&&_0x93d492===![]){var _0x57f5e5=_0x3950e6[_0x1a9476][_0x32ef('0x1b')];_0x57f5e5[_0x32ef('0x17')](_0x57aff1,_0x286bfb);}else{process[_0x32ef('0x15')](function(){_0x57aff1['matchPath']=_0x53a5ca;return _0x40a6e6?_0x40a6e6(_0x57aff1):_['noop']();});}}(0x0));};RuleEngine[_0x32ef('0xa')]['findRules']=function(_0x51a412){if(_[_0x32ef('0x4')](_0x51a412)){return this[_0x32ef('0x8')];}else{var _0x371540=_[_0x32ef('0x1c')](_0x51a412);return _[_0x32ef('0x1d')](this[_0x32ef('0x8')],_0x371540);}};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1e')]=function(_0x338f19,_0x2f52d7){var _0x1335e2=_0x338f19==='on'||_0x338f19==='ON'?!![]:![];var _0xba4b3f=this['findRules'](_0x2f52d7);for(var _0xd65fde=0x0,_0x2f5d06=_0xba4b3f['length'];_0xd65fde<_0x2f5d06;_0xd65fde+=0x1){_0xba4b3f[_0xd65fde]['on']=_0x1335e2;}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1f')]=function(_0x26e207,_0x50a95b){_0x26e207=parseInt(_0x26e207,0xa);var _0x10e38c=this[_0x32ef('0x20')](_0x50a95b);for(var _0x31dbc3=0x0,_0x2ac686=_0x10e38c[_0x32ef('0x21')];_0x31dbc3<_0x2ac686;_0x31dbc3+=0x1){_0x10e38c[_0x31dbc3][_0x32ef('0x22')]=_0x26e207;}this[_0x32ef('0xe')]();};RuleEngine['prototype'][_0x32ef('0x23')]=function(){var _0x537214=this[_0x32ef('0x8')];if(_0x537214 instanceof Array){_0x537214=_0x537214[_0x32ef('0x24')](function(_0x5a9565){_0x5a9565[_0x32ef('0x1b')]=_0x5a9565[_0x32ef('0x1b')][_0x32ef('0x25')]();_0x5a9565[_0x32ef('0x12')]=_0x5a9565[_0x32ef('0x12')]['toString']();return _0x5a9565;});}else if(!_['isNil'](_0x537214)){_0x537214[_0x32ef('0x1b')]=_0x537214['condition'][_0x32ef('0x25')]();_0x537214[_0x32ef('0x12')]=_0x537214[_0x32ef('0x12')][_0x32ef('0x25')]();}return _0x537214;};RuleEngine[_0x32ef('0xa')][_0x32ef('0x26')]=function(_0x566b56){this['init']();if(_['isString'](_0x566b56)){_0x566b56=JSON[_0x32ef('0x27')](_0x566b56);}if(_0x566b56 instanceof Array){_0x566b56=_0x566b56[_0x32ef('0x24')](function(_0x136b02){_0x136b02['condition']=eval('('+_0x136b02['condition']+')');_0x136b02[_0x32ef('0x12')]=eval('('+_0x136b02[_0x32ef('0x12')]+')');return _0x136b02;});}else if(_0x566b56!==null&&typeof _0x566b56==_0x32ef('0x28')){_0x566b56['condition']=eval('('+_0x566b56['condition']+')');_0x566b56[_0x32ef('0x12')]=eval('('+_0x566b56[_0x32ef('0x12')]+')');}this[_0x32ef('0x5')](_0x566b56);};module[_0x32ef('0x29')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index e2eecb6..f77f71c 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 _0x281d=['message','result','catch','bluebird','jayson/promise','client','http','request','error'];(function(_0x58c960,_0xaaf96e){var _0x12b877=function(_0x26ace2){while(--_0x26ace2){_0x58c960['push'](_0x58c960['shift']());}};_0x12b877(++_0xaaf96e);}(_0x281d,0x174));var _0xd281=function(_0x5f5276,_0xe3819e){_0x5f5276=_0x5f5276-0x0;var _0x21aab4=_0x281d[_0x5f5276];return _0x21aab4;};'use strict';var BPromise=require(_0xd281('0x0'));var jayson=require(_0xd281('0x1'));var client=jayson[_0xd281('0x2')][_0xd281('0x3')]({'port':0x232b});function request(_0x3c40d1,_0x2a20fc){return new BPromise(function(_0x92e7b3,_0x22ce1a){return client[_0xd281('0x4')](_0x3c40d1,_0x2a20fc)['then'](function(_0x3ec101){if(_0x3ec101[_0xd281('0x5')]){return _0x22ce1a(_0x3ec101[_0xd281('0x5')][_0xd281('0x6')]);}else{return _0x92e7b3(_0x3ec101[_0xd281('0x7')]);}})[_0xd281('0x8')](function(_0x432d11){return _0x22ce1a(_0x432d11);});});}exports['sendMailMessage']=function(_0x2cd4d7,_0x6284e1){return request('SendMail',{'account':_0x2cd4d7,'message':_0x6284e1});}; \ No newline at end of file +var _0x1cfc=['request','error','message','SendMail','bluebird','jayson/promise','client'];(function(_0x5c7355,_0x2e60c5){var _0xf0aaba=function(_0x15b9d5){while(--_0x15b9d5){_0x5c7355['push'](_0x5c7355['shift']());}};_0xf0aaba(++_0x2e60c5);}(_0x1cfc,0x13f));var _0xc1cf=function(_0x57ef16,_0x31a00f){_0x57ef16=_0x57ef16-0x0;var _0x408b22=_0x1cfc[_0x57ef16];return _0x408b22;};'use strict';var BPromise=require(_0xc1cf('0x0'));var jayson=require(_0xc1cf('0x1'));var client=jayson[_0xc1cf('0x2')]['http']({'port':0x232b});function request(_0x2fa1d7,_0x4d13e5){return new BPromise(function(_0x280ae7,_0x38aaae){return client[_0xc1cf('0x3')](_0x2fa1d7,_0x4d13e5)['then'](function(_0x232624){if(_0x232624['error']){return _0x38aaae(_0x232624[_0xc1cf('0x4')][_0xc1cf('0x5')]);}else{return _0x280ae7(_0x232624['result']);}})['catch'](function(_0x5e552c){return _0x38aaae(_0x5e552c);});});}exports['sendMailMessage']=function(_0x8ac7b,_0x358987){return request(_0xc1cf('0x6'),{'account':_0x8ac7b,'message':_0x358987});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 5dc6399..1099572 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 _0xebb6=['stringify','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatCapacity','mailStatus','unknown','mailCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busyQueue','updateRealtime','prototype','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','working','idle','chat','fax','sms','whatsapp','length','StatusTime','toNumber','format','chatStatusTime','chatCurrentCapacity','mailStatusTime','mailCurrentCapacity','faxCurrentCapacity','smsStatusTime','openchannelStatusTime','busy'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xebb6,0x7f));var _0x6ebb=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xebb6[_0x139a3c];return _0x2b375b;};'use strict';var _=require(_0x6ebb('0x0'));var moment=require(_0x6ebb('0x1'));var md5=require(_0x6ebb('0x2'));var Redis=require(_0x6ebb('0x3'));var config=require(_0x6ebb('0x4'));config[_0x6ebb('0x5')]=_['defaults'](config[_0x6ebb('0x5')],{'host':_0x6ebb('0x6'),'port':0x18eb});var io=require(_0x6ebb('0x7'))(new Redis(config[_0x6ebb('0x5')]));function Agent(_0x453567){this['id']=_0x453567['id']||0x0;this['name']=_0x453567[_0x6ebb('0x8')]||'';this[_0x6ebb('0x9')]=_0x453567[_0x6ebb('0x9')]||!![];this[_0x6ebb('0xa')]=_0x453567[_0x6ebb('0xa')]||![];this['chatPause']=_0x453567[_0x6ebb('0xb')]||![];this['mailPause']=_0x453567[_0x6ebb('0xc')]||![];this[_0x6ebb('0xd')]=_0x453567[_0x6ebb('0xd')]||![];this[_0x6ebb('0xe')]=_0x453567[_0x6ebb('0xe')]||![];this[_0x6ebb('0xf')]=_0x453567[_0x6ebb('0xf')]||![];this[_0x6ebb('0x10')]='unknown';this['chatStatusTime']=0x0;this[_0x6ebb('0x11')]=_0x453567[_0x6ebb('0x11')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x6ebb('0x12')]=_0x6ebb('0x13');this['mailStatusTime']=0x0;this[_0x6ebb('0x14')]=_0x453567[_0x6ebb('0x14')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x6ebb('0x15')]=_0x6ebb('0x13');this[_0x6ebb('0x16')]=0x0;this[_0x6ebb('0x17')]=_0x453567[_0x6ebb('0x17')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x6ebb('0x18')]=_0x6ebb('0x13');this['smsStatusTime']=0x0;this[_0x6ebb('0x19')]=_0x453567[_0x6ebb('0x19')]||0x0;this[_0x6ebb('0x1a')]=0x0;this[_0x6ebb('0x1b')]='unknown';this[_0x6ebb('0x1c')]=0x0;this[_0x6ebb('0x1d')]=_0x453567[_0x6ebb('0x1d')]||0x0;this[_0x6ebb('0x1e')]=0x0;this[_0x6ebb('0x1f')]=_0x6ebb('0x13');this['openchannelStatusTime']=0x0;this[_0x6ebb('0x20')]=_0x453567[_0x6ebb('0x20')]||0x0;this[_0x6ebb('0x21')]=0x0;this['busy']=![];this[_0x6ebb('0x22')]=undefined;this[_0x6ebb('0x2')]='';this[_0x6ebb('0x23')]();}Agent[_0x6ebb('0x24')][_0x6ebb('0x25')]=function(_0x447972){if(this[_0x447972+'CurrentCapacity']>0x0){if(this[_0x447972+_0x6ebb('0x26')]>0x0&&this[_0x447972+_0x6ebb('0x27')]>=this[_0x447972+_0x6ebb('0x26')]){return _0x6ebb('0x28');}else{return _0x6ebb('0x29');}}else{return _0x6ebb('0x2a');}};Agent['prototype'][_0x6ebb('0x23')]=function(){var _0x37b628=['mail',_0x6ebb('0x2b'),'openchannel',_0x6ebb('0x2c'),_0x6ebb('0x2d'),_0x6ebb('0x2e')];for(var _0x5b4c0a=0x0;_0x5b4c0a<_0x37b628[_0x6ebb('0x2f')];_0x5b4c0a+=0x1){var _0x3fa8ac=this['getChannelStatus'](_0x37b628[_0x5b4c0a]);if(this[_0x37b628[_0x5b4c0a]+'Status']!==_0x3fa8ac){this[_0x37b628[_0x5b4c0a]+_0x6ebb('0x30')]=_[_0x6ebb('0x31')](moment()[_0x6ebb('0x32')]('x'));}this[_0x37b628[_0x5b4c0a]+'Status']=_0x3fa8ac;}var _0x449b23={'id':this['id'],'name':this[_0x6ebb('0x8')],'online':this[_0x6ebb('0x9')],'voicePause':this['voicePause'],'chatPause':this[_0x6ebb('0xb')],'mailPause':this[_0x6ebb('0xc')],'smsPause':this['smsPause'],'faxPause':this[_0x6ebb('0xd')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x6ebb('0x10')],'chatStatusTime':this[_0x6ebb('0x33')],'chatCapacity':this[_0x6ebb('0x11')],'chatCurrentCapacity':this[_0x6ebb('0x34')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x6ebb('0x35')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x6ebb('0x36')],'faxStatus':this[_0x6ebb('0x15')],'faxStatusTime':this[_0x6ebb('0x16')],'faxCapacity':this[_0x6ebb('0x17')],'faxCurrentCapacity':this[_0x6ebb('0x37')],'smsStatus':this[_0x6ebb('0x18')],'smsStatusTime':this[_0x6ebb('0x38')],'smsCapacity':this[_0x6ebb('0x19')],'smsCurrentCapacity':this[_0x6ebb('0x1a')],'whatsappStatus':this[_0x6ebb('0x1b')],'whatsappStatusTime':this[_0x6ebb('0x1c')],'whatsappCapacity':this[_0x6ebb('0x1d')],'whatsappCurrentCapacity':this[_0x6ebb('0x1e')],'openchannelStatus':this[_0x6ebb('0x1f')],'openchannelStatusTime':this[_0x6ebb('0x39')],'openchannelCapacity':this[_0x6ebb('0x20')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x6ebb('0x3a')],'busyQueue':this[_0x6ebb('0x22')]};var _0x105e74=md5(JSON[_0x6ebb('0x3b')](_0x449b23));if(this[_0x6ebb('0x2')]!==_0x105e74){this[_0x6ebb('0x2')]=_0x105e74;io['emit'](_0x6ebb('0x3c'),_0x449b23);}};module[_0x6ebb('0x3d')]=Agent; \ No newline at end of file +var _0xf7e5=['idle','mail','chat','fax','sms','whatsapp','length','getChannelStatus','Status','StatusTime','toNumber','online','mailCurrentCapacity','emit','exports','moment','md5','redis','defaults','localhost','socket.io-emitter','name','voicePause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','CurrentCapacity','Capacity','maxcapacity','working'];(function(_0x24f8f5,_0x277480){var _0x184e9f=function(_0x3ff241){while(--_0x3ff241){_0x24f8f5['push'](_0x24f8f5['shift']());}};_0x184e9f(++_0x277480);}(_0xf7e5,0x7d));var _0x5f7e=function(_0x392bbd,_0x5619ac){_0x392bbd=_0x392bbd-0x0;var _0x208d0c=_0xf7e5[_0x392bbd];return _0x208d0c;};'use strict';var _=require('lodash');var moment=require(_0x5f7e('0x0'));var md5=require(_0x5f7e('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x5f7e('0x2')]=_[_0x5f7e('0x3')](config[_0x5f7e('0x2')],{'host':_0x5f7e('0x4'),'port':0x18eb});var io=require(_0x5f7e('0x5'))(new Redis(config[_0x5f7e('0x2')]));function Agent(_0x1ee364){this['id']=_0x1ee364['id']||0x0;this[_0x5f7e('0x6')]=_0x1ee364[_0x5f7e('0x6')]||'';this['online']=_0x1ee364['online']||!![];this[_0x5f7e('0x7')]=_0x1ee364[_0x5f7e('0x7')]||![];this['chatPause']=_0x1ee364['chatPause']||![];this[_0x5f7e('0x8')]=_0x1ee364[_0x5f7e('0x8')]||![];this[_0x5f7e('0x9')]=_0x1ee364['faxPause']||![];this[_0x5f7e('0xa')]=_0x1ee364[_0x5f7e('0xa')]||![];this[_0x5f7e('0xb')]=_0x1ee364[_0x5f7e('0xb')]||![];this[_0x5f7e('0xc')]=_0x5f7e('0xd');this[_0x5f7e('0xe')]=0x0;this['chatCapacity']=_0x1ee364[_0x5f7e('0xf')]||0x0;this[_0x5f7e('0x10')]=0x0;this[_0x5f7e('0x11')]=_0x5f7e('0xd');this[_0x5f7e('0x12')]=0x0;this['mailCapacity']=_0x1ee364[_0x5f7e('0x13')]||0x0;this['mailCurrentCapacity']=0x0;this['faxStatus']='unknown';this[_0x5f7e('0x14')]=0x0;this[_0x5f7e('0x15')]=_0x1ee364[_0x5f7e('0x15')]||0x0;this[_0x5f7e('0x16')]=0x0;this['smsStatus']='unknown';this[_0x5f7e('0x17')]=0x0;this[_0x5f7e('0x18')]=_0x1ee364[_0x5f7e('0x18')]||0x0;this[_0x5f7e('0x19')]=0x0;this[_0x5f7e('0x1a')]=_0x5f7e('0xd');this['whatsappStatusTime']=0x0;this[_0x5f7e('0x1b')]=_0x1ee364[_0x5f7e('0x1b')]||0x0;this[_0x5f7e('0x1c')]=0x0;this[_0x5f7e('0x1d')]='unknown';this[_0x5f7e('0x1e')]=0x0;this[_0x5f7e('0x1f')]=_0x1ee364[_0x5f7e('0x1f')]||0x0;this[_0x5f7e('0x20')]=0x0;this[_0x5f7e('0x21')]=![];this[_0x5f7e('0x22')]=undefined;this[_0x5f7e('0x1')]='';this[_0x5f7e('0x23')]();}Agent['prototype']['getChannelStatus']=function(_0x35a626){if(this[_0x35a626+_0x5f7e('0x24')]>0x0){if(this[_0x35a626+_0x5f7e('0x25')]>0x0&&this[_0x35a626+_0x5f7e('0x24')]>=this[_0x35a626+_0x5f7e('0x25')]){return _0x5f7e('0x26');}else{return _0x5f7e('0x27');}}else{return _0x5f7e('0x28');}};Agent['prototype']['updateRealtime']=function(){var _0x251e81=[_0x5f7e('0x29'),_0x5f7e('0x2a'),'openchannel',_0x5f7e('0x2b'),_0x5f7e('0x2c'),_0x5f7e('0x2d')];for(var _0x1eaf85=0x0;_0x1eaf85<_0x251e81[_0x5f7e('0x2e')];_0x1eaf85+=0x1){var _0x577971=this[_0x5f7e('0x2f')](_0x251e81[_0x1eaf85]);if(this[_0x251e81[_0x1eaf85]+_0x5f7e('0x30')]!==_0x577971){this[_0x251e81[_0x1eaf85]+_0x5f7e('0x31')]=_[_0x5f7e('0x32')](moment()['format']('x'));}this[_0x251e81[_0x1eaf85]+'Status']=_0x577971;}var _0x290190={'id':this['id'],'name':this['name'],'online':this[_0x5f7e('0x33')],'voicePause':this['voicePause'],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this[_0x5f7e('0xa')],'faxPause':this['faxPause'],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x5f7e('0xc')],'chatStatusTime':this[_0x5f7e('0xe')],'chatCapacity':this[_0x5f7e('0xf')],'chatCurrentCapacity':this[_0x5f7e('0x10')],'mailStatus':this[_0x5f7e('0x11')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x5f7e('0x13')],'mailCurrentCapacity':this[_0x5f7e('0x34')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x5f7e('0x14')],'faxCapacity':this[_0x5f7e('0x15')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x5f7e('0x17')],'smsCapacity':this[_0x5f7e('0x18')],'smsCurrentCapacity':this[_0x5f7e('0x19')],'whatsappStatus':this[_0x5f7e('0x1a')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x5f7e('0x1b')],'whatsappCurrentCapacity':this[_0x5f7e('0x1c')],'openchannelStatus':this[_0x5f7e('0x1d')],'openchannelStatusTime':this[_0x5f7e('0x1e')],'openchannelCapacity':this[_0x5f7e('0x1f')],'openchannelCurrentCapacity':this[_0x5f7e('0x20')],'busy':this['busy'],'busyQueue':this['busyQueue']};var _0x2e9ec3=md5(JSON['stringify'](_0x290190));if(this[_0x5f7e('0x1')]!==_0x2e9ec3){this[_0x5f7e('0x1')]=_0x2e9ec3;io[_0x5f7e('0x35')]('user:save',_0x290190);}};module[_0x5f7e('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 69585f6..a529306 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 _0x0965=['format','chat:queue:%s','emit','chat_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','paused','length','online','loggedIn','chatPause','available','stringify'];(function(_0x481c1e,_0x264df8){var _0xde447f=function(_0x4bd8fd){while(--_0x4bd8fd){_0x481c1e['push'](_0x481c1e['shift']());}};_0xde447f(++_0x264df8);}(_0x0965,0x7d));var _0x5096=function(_0x2d8aac,_0x4f40f9){_0x2d8aac=_0x2d8aac-0x0;var _0xcdcec=_0x0965[_0x2d8aac];return _0xcdcec;};'use strict';var _=require('lodash');var md5=require(_0x5096('0x0'));var util=require(_0x5096('0x1'));var Redis=require(_0x5096('0x2'));var config=require(_0x5096('0x3'));config[_0x5096('0x4')]=_[_0x5096('0x5')](config[_0x5096('0x4')],{'host':_0x5096('0x6'),'port':0x18eb});var io=require(_0x5096('0x7'))(new Redis(config[_0x5096('0x4')]));function ChatQueue(_0x9fadb2){this['id']=_0x9fadb2['id']||0x0;this[_0x5096('0x8')]=_0x9fadb2[_0x5096('0x8')]||'';this['timeout']=_0x9fadb2[_0x5096('0x9')]||0xa;this[_0x5096('0xa')]=_0x9fadb2['strategy']||'beepall';this[_0x5096('0xb')]=_0x9fadb2['Agents'];this[_0x5096('0xc')]={};this[_0x5096('0xd')]=0x0;this[_0x5096('0x0')]='';this[_0x5096('0xe')]();this[_0x5096('0xf')]();}ChatQueue[_0x5096('0x10')][_0x5096('0xe')]=function(){var _0x1e7bfa=this[_0x5096('0xc')][_0x5096('0x11')];this['mapAgentsId']=_['map'](this[_0x5096('0xb')],'id');this[_0x5096('0xc')][_0x5096('0x11')]=_0x1e7bfa;};ChatQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x5096('0x12')]=0x0;for(var _0x5d771e=0x0;_0x5d771e=0x0?this['available']:0x0;var _0x1e08aa={'id':this['id'],'available':this[_0x5096('0x17')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x5096('0x12')],'waiting':this['waiting']};var _0x404cba=md5(JSON[_0x5096('0x18')](_0x1e08aa));if(this[_0x5096('0x0')]!==_0x404cba){this[_0x5096('0x0')]=_0x404cba;io['to'](util[_0x5096('0x19')](_0x5096('0x1a'),_0x1e08aa[_0x5096('0x8')]))[_0x5096('0x1b')](_0x5096('0x1c'),_0x1e08aa);}};module[_0x5096('0x1d')]=ChatQueue; \ No newline at end of file +var _0x097a=['map','prototype','loggedIn','length','online','chatPause','paused','available','stringify','format','chat:queue:%s','emit','exports','lodash','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','beepall','Agents','waiting','md5','updateRealtime','updateRouting','mapAgentsId','_rr'];(function(_0x5652b9,_0x3b79ed){var _0x44be0d=function(_0x2a1d2e){while(--_0x2a1d2e){_0x5652b9['push'](_0x5652b9['shift']());}};_0x44be0d(++_0x3b79ed);}(_0x097a,0x67));var _0xa097=function(_0x5075c8,_0x424d2f){_0x5075c8=_0x5075c8-0x0;var _0x3f1689=_0x097a[_0x5075c8];return _0x3f1689;};'use strict';var _=require(_0xa097('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xa097('0x1'));var config=require(_0xa097('0x2'));config['redis']=_[_0xa097('0x3')](config[_0xa097('0x4')],{'host':_0xa097('0x5'),'port':0x18eb});var io=require(_0xa097('0x6'))(new Redis(config['redis']));function ChatQueue(_0x1b140b){this['id']=_0x1b140b['id']||0x0;this[_0xa097('0x7')]=_0x1b140b['name']||'';this['timeout']=_0x1b140b[_0xa097('0x8')]||0xa;this['strategy']=_0x1b140b['strategy']||_0xa097('0x9');this[_0xa097('0xa')]=_0x1b140b['Agents'];this['mapAgentsId']={};this[_0xa097('0xb')]=0x0;this[_0xa097('0xc')]='';this['updateRouting']();this[_0xa097('0xd')]();}ChatQueue['prototype'][_0xa097('0xe')]=function(){var _0x2307f5=this[_0xa097('0xf')][_0xa097('0x10')];this[_0xa097('0xf')]=_[_0xa097('0x11')](this[_0xa097('0xa')],'id');this['mapAgentsId'][_0xa097('0x10')]=_0x2307f5;};ChatQueue[_0xa097('0x12')][_0xa097('0xd')]=function(){this[_0xa097('0x13')]=0x0;this['paused']=0x0;for(var _0x576cae=0x0;_0x576cae=0x0?this[_0xa097('0x18')]:0x0;var _0x2b3a1c={'id':this['id'],'available':this[_0xa097('0x18')],'loggedIn':this[_0xa097('0x13')],'name':this[_0xa097('0x7')],'paused':this[_0xa097('0x17')],'waiting':this[_0xa097('0xb')]};var _0x1e769d=md5(JSON[_0xa097('0x19')](_0x2b3a1c));if(this['md5']!==_0x1e769d){this[_0xa097('0xc')]=_0x1e769d;io['to'](util[_0xa097('0x1a')](_0xa097('0x1b'),_0x2b3a1c['name']))[_0xa097('0x1c')]('chat_queue:save',_0x2b3a1c);}};module[_0xa097('0x1d')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 1c72eeb..726ef19 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 _0xa812=['length','online','faxPause','available','loggedIn','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','paused'];(function(_0x414b02,_0x3d0f58){var _0x256075=function(_0x1ead54){while(--_0x1ead54){_0x414b02['push'](_0x414b02['shift']());}};_0x256075(++_0x3d0f58);}(_0xa812,0x19e));var _0x2a81=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xa812[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var md5=require(_0x2a81('0x0'));var util=require(_0x2a81('0x1'));var Redis=require(_0x2a81('0x2'));var config=require(_0x2a81('0x3'));config[_0x2a81('0x4')]=_[_0x2a81('0x5')](config['redis'],{'host':_0x2a81('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2a81('0x4')]));function FaxQueue(_0x543dd3){this['id']=_0x543dd3['id']||0x0;this['name']=_0x543dd3[_0x2a81('0x7')]||'';this[_0x2a81('0x8')]=_0x543dd3[_0x2a81('0x8')]||0xa;this[_0x2a81('0x9')]=_0x543dd3[_0x2a81('0x9')]||_0x2a81('0xa');this[_0x2a81('0xb')]=_0x543dd3['Agents'];this[_0x2a81('0xc')]={};this[_0x2a81('0xd')]=0x0;this['md5']='';this[_0x2a81('0xe')]();this[_0x2a81('0xf')]();}FaxQueue[_0x2a81('0x10')][_0x2a81('0xe')]=function(){var _0x387ffa=this[_0x2a81('0xc')][_0x2a81('0x11')];this[_0x2a81('0xc')]=_[_0x2a81('0x12')](this[_0x2a81('0xb')],'id');this['mapAgentsId'][_0x2a81('0x11')]=_0x387ffa;};FaxQueue['prototype'][_0x2a81('0xf')]=function(){this['loggedIn']=0x0;this[_0x2a81('0x13')]=0x0;for(var _0x495868=0x0;_0x495868=0x0?this[_0x2a81('0x17')]:0x0;var _0x4b038a={'id':this['id'],'available':this[_0x2a81('0x17')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x2a81('0x13')],'waiting':this['waiting']};var _0x1d7e3d=md5(JSON[_0x2a81('0x19')](_0x4b038a));if(this[_0x2a81('0x0')]!==_0x1d7e3d){this[_0x2a81('0x0')]=_0x1d7e3d;io['to'](util[_0x2a81('0x1a')](_0x2a81('0x1b'),_0x4b038a[_0x2a81('0x7')]))[_0x2a81('0x1c')](_0x2a81('0x1d'),_0x4b038a);}};module[_0x2a81('0x1e')]=FaxQueue; \ No newline at end of file +var _0xe435=['name','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','length','online','faxPause','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','socket.io-emitter'];(function(_0x3c34a1,_0x3bdde7){var _0x20e4fb=function(_0x33376c){while(--_0x33376c){_0x3c34a1['push'](_0x3c34a1['shift']());}};_0x20e4fb(++_0x3bdde7);}(_0xe435,0x14d));var _0x5e43=function(_0x179f85,_0x4ec340){_0x179f85=_0x179f85-0x0;var _0x558187=_0xe435[_0x179f85];return _0x558187;};'use strict';var _=require(_0x5e43('0x0'));var md5=require(_0x5e43('0x1'));var util=require(_0x5e43('0x2'));var Redis=require(_0x5e43('0x3'));var config=require(_0x5e43('0x4'));config['redis']=_[_0x5e43('0x5')](config[_0x5e43('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x5e43('0x7'))(new Redis(config['redis']));function FaxQueue(_0x4bca0c){this['id']=_0x4bca0c['id']||0x0;this[_0x5e43('0x8')]=_0x4bca0c['name']||'';this[_0x5e43('0x9')]=_0x4bca0c[_0x5e43('0x9')]||0xa;this['strategy']=_0x4bca0c['strategy']||_0x5e43('0xa');this[_0x5e43('0xb')]=_0x4bca0c['Agents'];this[_0x5e43('0xc')]={};this[_0x5e43('0xd')]=0x0;this['md5']='';this[_0x5e43('0xe')]();this[_0x5e43('0xf')]();}FaxQueue[_0x5e43('0x10')][_0x5e43('0xe')]=function(){var _0x5e3860=this[_0x5e43('0xc')]['_rr'];this[_0x5e43('0xc')]=_[_0x5e43('0x11')](this['Agents'],'id');this[_0x5e43('0xc')][_0x5e43('0x12')]=_0x5e3860;};FaxQueue[_0x5e43('0x10')]['updateRealtime']=function(){this[_0x5e43('0x13')]=0x0;this[_0x5e43('0x14')]=0x0;for(var _0x4036c8=0x0;_0x4036c8=0x0?this[_0x5e43('0x18')]:0x0;var _0x3e3628={'id':this['id'],'available':this[_0x5e43('0x18')],'loggedIn':this[_0x5e43('0x13')],'name':this[_0x5e43('0x8')],'paused':this[_0x5e43('0x14')],'waiting':this[_0x5e43('0xd')]};var _0x56647b=md5(JSON[_0x5e43('0x19')](_0x3e3628));if(this[_0x5e43('0x1')]!==_0x56647b){this[_0x5e43('0x1')]=_0x56647b;io['to'](util[_0x5e43('0x1a')](_0x5e43('0x1b'),_0x3e3628[_0x5e43('0x8')]))[_0x5e43('0x1c')](_0x5e43('0x1d'),_0x3e3628);}};module[_0x5e43('0x1e')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index a7436aa..d98f5de 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 _0x687b=['name','Intervals','exports'];(function(_0x4b91c4,_0x23f35f){var _0x25cb80=function(_0x48e283){while(--_0x48e283){_0x4b91c4['push'](_0x4b91c4['shift']());}};_0x25cb80(++_0x23f35f);}(_0x687b,0x93));var _0xb687=function(_0x20945a,_0x1c99ad){_0x20945a=_0x20945a-0x0;var _0x260522=_0x687b[_0x20945a];return _0x260522;};'use strict';function Interval(_0x31cb35){this['id']=_0x31cb35['id']||0x0;this[_0xb687('0x0')]=_0x31cb35[_0xb687('0x0')]||'';this[_0xb687('0x1')]=_0x31cb35[_0xb687('0x1')]||{};}module[_0xb687('0x2')]=Interval; \ No newline at end of file +var _0xb0af=['Intervals'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xb0af,0xef));var _0xfb0a=function(_0x4be295,_0x34e141){_0x4be295=_0x4be295-0x0;var _0x4ed20f=_0xb0af[_0x4be295];return _0x4ed20f;};'use strict';function Interval(_0xd06a9a){this['id']=_0xd06a9a['id']||0x0;this['name']=_0xd06a9a['name']||'';this['Intervals']=_0xd06a9a[_0xfb0a('0x0')]||{};}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 48f5f8b..97b52b4 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 _0xc98b=['updateRealtime','prototype','updateRouting','_rr','paused','length','online','loggedIn','available','stringify','mail:queue:%s','emit','mail_queue:save','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x13cdef,_0x13be15){var _0x569fb7=function(_0x3bf0e1){while(--_0x3bf0e1){_0x13cdef['push'](_0x13cdef['shift']());}};_0x569fb7(++_0x13be15);}(_0xc98b,0x169));var _0xbc98=function(_0x4466bd,_0x402e2f){_0x4466bd=_0x4466bd-0x0;var _0x2a2fcb=_0xc98b[_0x4466bd];return _0x2a2fcb;};'use strict';var _=require(_0xbc98('0x0'));var md5=require(_0xbc98('0x1'));var util=require(_0xbc98('0x2'));var Redis=require(_0xbc98('0x3'));var config=require(_0xbc98('0x4'));config['redis']=_[_0xbc98('0x5')](config[_0xbc98('0x6')],{'host':_0xbc98('0x7'),'port':0x18eb});var io=require(_0xbc98('0x8'))(new Redis(config['redis']));function MailQueue(_0xa58965){this['id']=_0xa58965['id']||0x0;this[_0xbc98('0x9')]=_0xa58965[_0xbc98('0x9')]||'';this[_0xbc98('0xa')]=_0xa58965[_0xbc98('0xa')]||0xa;this[_0xbc98('0xb')]=_0xa58965['strategy']||_0xbc98('0xc');this[_0xbc98('0xd')]=_0xa58965[_0xbc98('0xd')];this[_0xbc98('0xe')]={};this[_0xbc98('0xf')]=0x0;this[_0xbc98('0x1')]='';this['updateRouting']();this[_0xbc98('0x10')]();}MailQueue[_0xbc98('0x11')][_0xbc98('0x12')]=function(){var _0x497b5e=this[_0xbc98('0xe')][_0xbc98('0x13')];this[_0xbc98('0xe')]=_['map'](this[_0xbc98('0xd')],'id');this['mapAgentsId'][_0xbc98('0x13')]=_0x497b5e;};MailQueue[_0xbc98('0x11')][_0xbc98('0x10')]=function(){this['loggedIn']=0x0;this[_0xbc98('0x14')]=0x0;for(var _0x5b0abd=0x0;_0x5b0abd=0x0?this[_0xbc98('0x18')]:0x0;var _0x35ad6d={'id':this['id'],'available':this[_0xbc98('0x18')],'loggedIn':this[_0xbc98('0x17')],'name':this[_0xbc98('0x9')],'paused':this[_0xbc98('0x14')],'waiting':this[_0xbc98('0xf')]};var _0x4437d5=md5(JSON[_0xbc98('0x19')](_0x35ad6d));if(this['md5']!==_0x4437d5){this[_0xbc98('0x1')]=_0x4437d5;io['to'](util['format'](_0xbc98('0x1a'),_0x35ad6d[_0xbc98('0x9')]))[_0xbc98('0x1b')](_0xbc98('0x1c'),_0x35ad6d);}};module['exports']=MailQueue; \ No newline at end of file +var _0xa0a5=['loggedIn','stringify','format','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','length','mailPause','paused','available'];(function(_0x262eab,_0x2700f5){var _0x289df4=function(_0x393096){while(--_0x393096){_0x262eab['push'](_0x262eab['shift']());}};_0x289df4(++_0x2700f5);}(_0xa0a5,0xee));var _0x5a0a=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xa0a5[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0x5a0a('0x0'));var md5=require(_0x5a0a('0x1'));var util=require(_0x5a0a('0x2'));var Redis=require(_0x5a0a('0x3'));var config=require(_0x5a0a('0x4'));config[_0x5a0a('0x5')]=_['defaults'](config[_0x5a0a('0x5')],{'host':_0x5a0a('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5a0a('0x5')]));function MailQueue(_0x11590e){this['id']=_0x11590e['id']||0x0;this[_0x5a0a('0x7')]=_0x11590e[_0x5a0a('0x7')]||'';this[_0x5a0a('0x8')]=_0x11590e[_0x5a0a('0x8')]||0xa;this[_0x5a0a('0x9')]=_0x11590e[_0x5a0a('0x9')]||_0x5a0a('0xa');this[_0x5a0a('0xb')]=_0x11590e['Agents'];this[_0x5a0a('0xc')]={};this[_0x5a0a('0xd')]=0x0;this[_0x5a0a('0x1')]='';this[_0x5a0a('0xe')]();this['updateRealtime']();}MailQueue[_0x5a0a('0xf')][_0x5a0a('0xe')]=function(){var _0x2116bd=this[_0x5a0a('0xc')][_0x5a0a('0x10')];this[_0x5a0a('0xc')]=_[_0x5a0a('0x11')](this[_0x5a0a('0xb')],'id');this[_0x5a0a('0xc')][_0x5a0a('0x10')]=_0x2116bd;};MailQueue[_0x5a0a('0xf')][_0x5a0a('0x12')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x10716b=0x0;_0x10716b=0x0?this[_0x5a0a('0x16')]:0x0;var _0x5c5719={'id':this['id'],'available':this[_0x5a0a('0x16')],'loggedIn':this[_0x5a0a('0x17')],'name':this[_0x5a0a('0x7')],'paused':this[_0x5a0a('0x15')],'waiting':this[_0x5a0a('0xd')]};var _0x424292=md5(JSON[_0x5a0a('0x18')](_0x5c5719));if(this['md5']!==_0x424292){this[_0x5a0a('0x1')]=_0x424292;io['to'](util[_0x5a0a('0x19')]('mail:queue:%s',_0x5c5719[_0x5a0a('0x7')]))[_0x5a0a('0x1a')](_0x5a0a('0x1b'),_0x5c5719);}};module[_0x5a0a('0x1c')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index c07523d..e42ae04 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x25e50c,_0x72818a){var _0x7079ec=function(_0x5d130c){while(--_0x5d130c){_0x25e50c['push'](_0x25e50c['shift']());}};_0x7079ec(++_0x72818a);}(_0x814b,0x1a2));var _0xb814=function(_0x288325,_0x26e4ff){_0x288325=_0x288325-0x0;var _0x3b9fd7=_0x814b[_0x288325];return _0x3b9fd7;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x46908b,_0x4aecc9){var _0x107506=function(_0x42aed8){while(--_0x42aed8){_0x46908b['push'](_0x46908b['shift']());}};_0x107506(++_0x4aecc9);}(_0x814b,0x1a2));var _0xb814=function(_0x429948,_0x1a6851){_0x429948=_0x429948-0x0;var _0x35d5d1=_0x814b[_0x429948];return _0x35d5d1;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 7e4e237..bcf206b 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 _0xcea2=['map','_rr','loggedIn','paused','smsPause','available','format','emit','sms_queue:save','exports','lodash','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xcea2,0x15a));var _0x2cea=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xcea2[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0x2cea('0x0'));var md5=require('md5');var util=require(_0x2cea('0x1'));var Redis=require('ioredis');var config=require(_0x2cea('0x2'));config[_0x2cea('0x3')]=_[_0x2cea('0x4')](config['redis'],{'host':_0x2cea('0x5'),'port':0x18eb});var io=require(_0x2cea('0x6'))(new Redis(config[_0x2cea('0x3')]));function SmsQueue(_0x496c21){this['id']=_0x496c21['id']||0x0;this[_0x2cea('0x7')]=_0x496c21['name']||'';this[_0x2cea('0x8')]=_0x496c21[_0x2cea('0x8')]||0xa;this[_0x2cea('0x9')]=_0x496c21[_0x2cea('0x9')]||_0x2cea('0xa');this[_0x2cea('0xb')]=_0x496c21['Agents'];this[_0x2cea('0xc')]={};this[_0x2cea('0xd')]=0x0;this[_0x2cea('0xe')]='';this[_0x2cea('0xf')]();this[_0x2cea('0x10')]();}SmsQueue[_0x2cea('0x11')][_0x2cea('0xf')]=function(){var _0x1c9142=this['mapAgentsId']['_rr'];this[_0x2cea('0xc')]=_[_0x2cea('0x12')](this['Agents'],'id');this['mapAgentsId'][_0x2cea('0x13')]=_0x1c9142;};SmsQueue['prototype'][_0x2cea('0x10')]=function(){this[_0x2cea('0x14')]=0x0;this[_0x2cea('0x15')]=0x0;for(var _0x5cf805=0x0;_0x5cf805=0x0?this[_0x2cea('0x17')]:0x0;var _0x464f7d={'id':this['id'],'available':this[_0x2cea('0x17')],'loggedIn':this[_0x2cea('0x14')],'name':this[_0x2cea('0x7')],'paused':this[_0x2cea('0x15')],'waiting':this['waiting']};var _0x27375b=md5(JSON['stringify'](_0x464f7d));if(this[_0x2cea('0xe')]!==_0x27375b){this[_0x2cea('0xe')]=_0x27375b;io['to'](util[_0x2cea('0x18')]('sms:queue:%s',_0x464f7d[_0x2cea('0x7')]))[_0x2cea('0x19')](_0x2cea('0x1a'),_0x464f7d);}};module[_0x2cea('0x1b')]=SmsQueue; \ No newline at end of file +var _0x57d4=['sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRealtime','prototype','updateRouting','_rr','map','paused','length','online','loggedIn','available','stringify','format'];(function(_0x2002b3,_0x11e91c){var _0x2756f0=function(_0x4bf0b3){while(--_0x4bf0b3){_0x2002b3['push'](_0x2002b3['shift']());}};_0x2756f0(++_0x11e91c);}(_0x57d4,0x78));var _0x457d=function(_0x4b2e78,_0x3d9fe7){_0x4b2e78=_0x4b2e78-0x0;var _0x25ce40=_0x57d4[_0x4b2e78];return _0x25ce40;};'use strict';var _=require(_0x457d('0x0'));var md5=require(_0x457d('0x1'));var util=require('util');var Redis=require(_0x457d('0x2'));var config=require(_0x457d('0x3'));config[_0x457d('0x4')]=_[_0x457d('0x5')](config[_0x457d('0x4')],{'host':_0x457d('0x6'),'port':0x18eb});var io=require(_0x457d('0x7'))(new Redis(config[_0x457d('0x4')]));function SmsQueue(_0x4745ed){this['id']=_0x4745ed['id']||0x0;this[_0x457d('0x8')]=_0x4745ed[_0x457d('0x8')]||'';this['timeout']=_0x4745ed[_0x457d('0x9')]||0xa;this[_0x457d('0xa')]=_0x4745ed['strategy']||'beepall';this[_0x457d('0xb')]=_0x4745ed[_0x457d('0xb')];this[_0x457d('0xc')]={};this['waiting']=0x0;this['md5']='';this['updateRouting']();this[_0x457d('0xd')]();}SmsQueue[_0x457d('0xe')][_0x457d('0xf')]=function(){var _0x128e09=this[_0x457d('0xc')][_0x457d('0x10')];this[_0x457d('0xc')]=_[_0x457d('0x11')](this[_0x457d('0xb')],'id');this['mapAgentsId'][_0x457d('0x10')]=_0x128e09;};SmsQueue[_0x457d('0xe')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x457d('0x12')]=0x0;for(var _0x19ac04=0x0;_0x19ac04=0x0?this['available']:0x0;var _0x151416={'id':this['id'],'available':this[_0x457d('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x457d('0x8')],'paused':this['paused'],'waiting':this['waiting']};var _0xbdded1=md5(JSON[_0x457d('0x17')](_0x151416));if(this[_0x457d('0x1')]!==_0xbdded1){this[_0x457d('0x1')]=_0xbdded1;io['to'](util[_0x457d('0x18')](_0x457d('0x19'),_0x151416[_0x457d('0x8')]))[_0x457d('0x1a')](_0x457d('0x1b'),_0x151416);}};module[_0x457d('0x1c')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 6db950b..a06e474 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 _0x2fc0=['updateRealtime','prototype','updateRouting','_rr','map','Agents','loggedIn','paused','length','whatsappPause','available','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','beepall','mapAgentsId','waiting','md5'];(function(_0x152d71,_0x5aabd6){var _0x57e208=function(_0x5f1bbe){while(--_0x5f1bbe){_0x152d71['push'](_0x152d71['shift']());}};_0x57e208(++_0x5aabd6);}(_0x2fc0,0xcc));var _0x02fc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2fc0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x02fc('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x02fc('0x1'));var config=require(_0x02fc('0x2'));config['redis']=_['defaults'](config[_0x02fc('0x3')],{'host':_0x02fc('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x02fc('0x3')]));function WhatsappQueue(_0x1b4a7a){this['id']=_0x1b4a7a['id']||0x0;this[_0x02fc('0x5')]=_0x1b4a7a[_0x02fc('0x5')]||'';this[_0x02fc('0x6')]=_0x1b4a7a[_0x02fc('0x6')]||0xa;this[_0x02fc('0x7')]=_0x1b4a7a[_0x02fc('0x7')]||_0x02fc('0x8');this['Agents']=_0x1b4a7a['Agents'];this[_0x02fc('0x9')]={};this[_0x02fc('0xa')]=0x0;this[_0x02fc('0xb')]='';this['updateRouting']();this[_0x02fc('0xc')]();}WhatsappQueue[_0x02fc('0xd')][_0x02fc('0xe')]=function(){var _0x440644=this['mapAgentsId'][_0x02fc('0xf')];this[_0x02fc('0x9')]=_[_0x02fc('0x10')](this[_0x02fc('0x11')],'id');this[_0x02fc('0x9')][_0x02fc('0xf')]=_0x440644;};WhatsappQueue[_0x02fc('0xd')][_0x02fc('0xc')]=function(){this[_0x02fc('0x12')]=0x0;this[_0x02fc('0x13')]=0x0;for(var _0xe7f582=0x0;_0xe7f582=0x0?this[_0x02fc('0x16')]:0x0;var _0xb9a0aa={'id':this['id'],'available':this[_0x02fc('0x16')],'loggedIn':this[_0x02fc('0x12')],'name':this[_0x02fc('0x5')],'paused':this['paused'],'waiting':this['waiting']};var _0x28e0e7=md5(JSON['stringify'](_0xb9a0aa));if(this['md5']!==_0x28e0e7){this[_0x02fc('0xb')]=_0x28e0e7;io['to'](util['format'](_0x02fc('0x17'),_0xb9a0aa[_0x02fc('0x5')]))[_0x02fc('0x18')](_0x02fc('0x19'),_0xb9a0aa);}};module[_0x02fc('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0x06ed=['prototype','_rr','map','paused','length','online','loggedIn','whatsappPause','available','waiting','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId','md5','updateRouting','updateRealtime'];(function(_0x3fe85c,_0x42a133){var _0x4975db=function(_0x47e6a3){while(--_0x47e6a3){_0x3fe85c['push'](_0x3fe85c['shift']());}};_0x4975db(++_0x42a133);}(_0x06ed,0x108));var _0xd06e=function(_0x5bdabb,_0x57a9a5){_0x5bdabb=_0x5bdabb-0x0;var _0x5cdd1=_0x06ed[_0x5bdabb];return _0x5cdd1;};'use strict';var _=require(_0xd06e('0x0'));var md5=require('md5');var util=require(_0xd06e('0x1'));var Redis=require(_0xd06e('0x2'));var config=require('../../../config/environment');config[_0xd06e('0x3')]=_[_0xd06e('0x4')](config[_0xd06e('0x3')],{'host':_0xd06e('0x5'),'port':0x18eb});var io=require(_0xd06e('0x6'))(new Redis(config[_0xd06e('0x3')]));function WhatsappQueue(_0x49c8db){this['id']=_0x49c8db['id']||0x0;this[_0xd06e('0x7')]=_0x49c8db[_0xd06e('0x7')]||'';this['timeout']=_0x49c8db['timeout']||0xa;this['strategy']=_0x49c8db[_0xd06e('0x8')]||_0xd06e('0x9');this[_0xd06e('0xa')]=_0x49c8db['Agents'];this[_0xd06e('0xb')]={};this['waiting']=0x0;this[_0xd06e('0xc')]='';this[_0xd06e('0xd')]();this[_0xd06e('0xe')]();}WhatsappQueue[_0xd06e('0xf')]['updateRouting']=function(){var _0x58ff11=this['mapAgentsId'][_0xd06e('0x10')];this[_0xd06e('0xb')]=_[_0xd06e('0x11')](this[_0xd06e('0xa')],'id');this[_0xd06e('0xb')][_0xd06e('0x10')]=_0x58ff11;};WhatsappQueue[_0xd06e('0xf')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0xd06e('0x12')]=0x0;for(var _0x49ec59=0x0;_0x49ec59=0x0?this[_0xd06e('0x17')]:0x0;var _0x5da128={'id':this['id'],'available':this[_0xd06e('0x17')],'loggedIn':this[_0xd06e('0x15')],'name':this[_0xd06e('0x7')],'paused':this[_0xd06e('0x12')],'waiting':this[_0xd06e('0x18')]};var _0x331632=md5(JSON[_0xd06e('0x19')](_0x5da128));if(this[_0xd06e('0xc')]!==_0x331632){this['md5']=_0x331632;io['to'](util[_0xd06e('0x1a')](_0xd06e('0x1b'),_0x5da128[_0xd06e('0x7')]))[_0xd06e('0x1c')](_0xd06e('0x1d'),_0x5da128);}};module[_0xd06e('0x1e')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index ff15050..b978420 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 f347a55..56bd54c 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 _0xd400=['addTagsToChatInteraction','../client','update','updateChatInteraction','Request','AddTagsToChatInteraction'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xd400,0xb5));var _0x0d40=function(_0x467dfe,_0x230927){_0x467dfe=_0x467dfe-0x0;var _0x4d4161=_0xd400[_0x467dfe];return _0x4d4161;};'use strict';var client=require(_0x0d40('0x0'));exports[_0x0d40('0x1')]=function(_0xb0b02b,_0x57f852){return client['Request']('UpdateChatInteraction',{'body':_0x57f852,'options':{'where':{'id':_0xb0b02b}},'log':_0x0d40('0x2')});};exports['addTags']=function(_0x1eb718,_0x115ec9){return client[_0x0d40('0x3')](_0x0d40('0x4'),{'body':_0x115ec9,'options':{'where':{'id':_0x1eb718}},'log':_0x0d40('0x5')});}; \ No newline at end of file +var _0x6889=['UpdateChatInteraction','updateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x294df2,_0x5c96e6){var _0x2ef934=function(_0x4e4dc1){while(--_0x4e4dc1){_0x294df2['push'](_0x294df2['shift']());}};_0x2ef934(++_0x5c96e6);}(_0x6889,0xac));var _0x9688=function(_0x442f5b,_0x39d79d){_0x442f5b=_0x442f5b-0x0;var _0x19fd96=_0x6889[_0x442f5b];return _0x19fd96;};'use strict';var client=require(_0x9688('0x0'));exports[_0x9688('0x1')]=function(_0x25781a,_0x401cde){return client[_0x9688('0x2')](_0x9688('0x3'),{'body':_0x401cde,'options':{'where':{'id':_0x25781a}},'log':_0x9688('0x4')});};exports['addTags']=function(_0x14f996,_0x5ccdf6){return client[_0x9688('0x2')](_0x9688('0x5'),{'body':_0x5ccdf6,'options':{'where':{'id':_0x14f996}},'log':_0x9688('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 65c6a5a..5c1d8bb 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 _0xad76=['createChatMessage','../client','create','Request','CreateChatMessage'];(function(_0x42e252,_0x37fd3e){var _0x103c8c=function(_0x38d1cf){while(--_0x38d1cf){_0x42e252['push'](_0x42e252['shift']());}};_0x103c8c(++_0x37fd3e);}(_0xad76,0x178));var _0x6ad7=function(_0x933190,_0x2296d4){_0x933190=_0x933190-0x0;var _0x2cf33b=_0xad76[_0x933190];return _0x2cf33b;};'use strict';var client=require(_0x6ad7('0x0'));exports[_0x6ad7('0x1')]=function(_0x507712){return client[_0x6ad7('0x2')](_0x6ad7('0x3'),{'body':_0x507712,'log':_0x6ad7('0x4')});}; \ No newline at end of file +var _0x9e9b=['createChatMessage','create','Request'];(function(_0x2e6e35,_0x4486d5){var _0x227b27=function(_0x4f3465){while(--_0x4f3465){_0x2e6e35['push'](_0x2e6e35['shift']());}};_0x227b27(++_0x4486d5);}(_0x9e9b,0x16f));var _0xb9e9=function(_0x1e05c1,_0x3cffa3){_0x1e05c1=_0x1e05c1-0x0;var _0x15f1ca=_0x9e9b[_0x1e05c1];return _0x15f1ca;};'use strict';var client=require('../client');exports[_0xb9e9('0x0')]=function(_0x154de8){return client[_0xb9e9('0x1')]('CreateChatMessage',{'body':_0x154de8,'log':_0xb9e9('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 5f2ec7d..0bbf17e 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 _0x56a6=['chatPause','../client','getChatQueues','Request','GetChatQueue','strategy','User','Agents','online'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x56a6,0x17b));var _0x656a=function(_0x25c98f,_0x2d490f){_0x25c98f=_0x25c98f-0x0;var _0x2b3d75=_0x56a6[_0x25c98f];return _0x2b3d75;};'use strict';var client=require(_0x656a('0x0'));exports[_0x656a('0x1')]=function(){return function(){return client[_0x656a('0x2')](_0x656a('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x656a('0x4')],'include':[{'model':_0x656a('0x5'),'as':_0x656a('0x6'),'attributes':['id','name',_0x656a('0x7'),_0x656a('0x8')]}]},'log':_0x656a('0x1')});};}; \ No newline at end of file +var _0x89c3=['strategy','User','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout'];(function(_0x208af9,_0x428504){var _0x34e94b=function(_0x48aa03){while(--_0x48aa03){_0x208af9['push'](_0x208af9['shift']());}};_0x34e94b(++_0x428504);}(_0x89c3,0xff));var _0x389c=function(_0x34fc73,_0x522117){_0x34fc73=_0x34fc73-0x0;var _0x1934a4=_0x89c3[_0x34fc73];return _0x1934a4;};'use strict';var client=require(_0x389c('0x0'));exports[_0x389c('0x1')]=function(){return function(){return client[_0x389c('0x2')](_0x389c('0x3'),{'options':{'raw':![],'attributes':['id',_0x389c('0x4'),_0x389c('0x5'),_0x389c('0x6')],'include':[{'model':_0x389c('0x7'),'as':'Agents','attributes':['id',_0x389c('0x4'),'online',_0x389c('0x8')]}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index bdc0d69..459a092 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 _0xbf1a=['Request','CreateChatQueueReport','update','UpdateChatQueueReport','../client','create'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0xbf1a,0x7c));var _0xabf1=function(_0x1792b0,_0xf02b96){_0x1792b0=_0x1792b0-0x0;var _0x307952=_0xbf1a[_0x1792b0];return _0x307952;};'use strict';var client=require(_0xabf1('0x0'));exports[_0xabf1('0x1')]=function(_0x7cbc88){return client[_0xabf1('0x2')](_0xabf1('0x3'),{'body':_0x7cbc88,'log':'CreateChatQueueReport'});};exports[_0xabf1('0x4')]=function(_0x4e92c6,_0x1b5f1a){return client[_0xabf1('0x2')](_0xabf1('0x5'),{'body':_0x1b5f1a,'options':{'where':{'uniqueid':_0x4e92c6},'order':[['id','DESC']],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x562d=['update','Request','UpdateChatQueueReport','../client','create','CreateChatQueueReport'];(function(_0x51acc1,_0x2a432a){var _0x132847=function(_0x5c2a41){while(--_0x5c2a41){_0x51acc1['push'](_0x51acc1['shift']());}};_0x132847(++_0x2a432a);}(_0x562d,0xe1));var _0xd562=function(_0x23fff9,_0xb2c5f3){_0x23fff9=_0x23fff9-0x0;var _0x1940d0=_0x562d[_0x23fff9];return _0x1940d0;};'use strict';var client=require(_0xd562('0x0'));exports[_0xd562('0x1')]=function(_0x41a5c7){return client['Request']('CreateChatQueueReport',{'body':_0x41a5c7,'log':_0xd562('0x2')});};exports[_0xd562('0x3')]=function(_0x73c3fa,_0x4c6430){return client[_0xd562('0x4')]('UpdateChatQueueReport',{'body':_0x4c6430,'options':{'where':{'uniqueid':_0x73c3fa},'order':[['id','DESC']],'limit':0x1},'log':_0xd562('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 249b342..f03093b 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(_0x7feb90,_0x28e700){var _0x3c5b33=function(_0x113cfa){while(--_0x113cfa){_0x7feb90['push'](_0x7feb90['shift']());}};_0x3c5b33(++_0x28e700);}(_0x7a54,0x106));var _0x47a5=function(_0x24d1ee,_0x573a0c){_0x24d1ee=_0x24d1ee-0x0;var _0x531242=_0x7a54[_0x24d1ee];return _0x531242;};'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 _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x135b3d,_0x2b645a){var _0x1fbad2=function(_0x30bb14){while(--_0x30bb14){_0x135b3d['push'](_0x135b3d['shift']());}};_0x1fbad2(++_0x2b645a);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 26051c0..c697b1c 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 _0x3386=['Request','CreateFaxMessage','createFaxMessage','create'];(function(_0x160c26,_0x294eea){var _0x2245a7=function(_0x3c9536){while(--_0x3c9536){_0x160c26['push'](_0x160c26['shift']());}};_0x2245a7(++_0x294eea);}(_0x3386,0x73));var _0x6338=function(_0x4afe41,_0x22bd75){_0x4afe41=_0x4afe41-0x0;var _0x552f0f=_0x3386[_0x4afe41];return _0x552f0f;};'use strict';var client=require('../client');exports[_0x6338('0x0')]=function(_0x2684c7){return client[_0x6338('0x1')](_0x6338('0x2'),{'body':_0x2684c7,'log':_0x6338('0x3')});}; \ No newline at end of file +var _0x8c1d=['CreateFaxMessage','create','Request'];(function(_0x2acc59,_0x261688){var _0x3f7b90=function(_0x3c750d){while(--_0x3c750d){_0x2acc59['push'](_0x2acc59['shift']());}};_0x3f7b90(++_0x261688);}(_0x8c1d,0x181));var _0xd8c1=function(_0x1a4036,_0x52807e){_0x1a4036=_0x1a4036-0x0;var _0xfdd387=_0x8c1d[_0x1a4036];return _0xfdd387;};'use strict';var client=require('../client');exports[_0xd8c1('0x0')]=function(_0x13a636){return client[_0xd8c1('0x1')](_0xd8c1('0x2'),{'body':_0x13a636,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 5605e0c..877cf44 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 _0x263d=['name','strategy','Agents','online','../client','getFaxQueues','Request','GetFaxQueue'];(function(_0x3ced31,_0x260d48){var _0x1e3908=function(_0x27c433){while(--_0x27c433){_0x3ced31['push'](_0x3ced31['shift']());}};_0x1e3908(++_0x260d48);}(_0x263d,0x6c));var _0xd263=function(_0x1f3aec,_0x24c18e){_0x1f3aec=_0x1f3aec-0x0;var _0x409f0d=_0x263d[_0x1f3aec];return _0x409f0d;};'use strict';var client=require(_0xd263('0x0'));exports[_0xd263('0x1')]=function(){return function(){return client[_0xd263('0x2')](_0xd263('0x3'),{'options':{'raw':![],'attributes':['id',_0xd263('0x4'),'timeout',_0xd263('0x5')],'include':[{'model':'User','as':_0xd263('0x6'),'attributes':['id',_0xd263('0x4'),_0xd263('0x7'),'faxPause']}]},'log':_0xd263('0x1')});};}; \ No newline at end of file +var _0x7f3e=['online','getFaxQueues','GetFaxQueue','name','timeout','strategy','User','Agents'];(function(_0x3b0265,_0x54c4b6){var _0x4d6215=function(_0x431a45){while(--_0x431a45){_0x3b0265['push'](_0x3b0265['shift']());}};_0x4d6215(++_0x54c4b6);}(_0x7f3e,0x1e1));var _0xe7f3=function(_0x94310a,_0x41e604){_0x94310a=_0x94310a-0x0;var _0x4b3cc2=_0x7f3e[_0x94310a];return _0x4b3cc2;};'use strict';var client=require('../client');exports[_0xe7f3('0x0')]=function(){return function(){return client['Request'](_0xe7f3('0x1'),{'options':{'raw':![],'attributes':['id',_0xe7f3('0x2'),_0xe7f3('0x3'),_0xe7f3('0x4')],'include':[{'model':_0xe7f3('0x5'),'as':_0xe7f3('0x6'),'attributes':['id','name',_0xe7f3('0x7'),'faxPause']}]},'log':_0xe7f3('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index a720fa7..1a67d8b 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 _0xb362=['Request','UpdateFaxQueueReport','DESC','../client','create'];(function(_0x3fe530,_0x1310c5){var _0x292a03=function(_0x1a6e97){while(--_0x1a6e97){_0x3fe530['push'](_0x3fe530['shift']());}};_0x292a03(++_0x1310c5);}(_0xb362,0x17a));var _0x2b36=function(_0x1bae1e,_0x12cf12){_0x1bae1e=_0x1bae1e-0x0;var _0x3fabe4=_0xb362[_0x1bae1e];return _0x3fabe4;};'use strict';var client=require(_0x2b36('0x0'));exports[_0x2b36('0x1')]=function(_0x405a2e){return client['Request']('CreateFaxQueueReport',{'body':_0x405a2e,'log':'CreateFaxQueueReport'});};exports['update']=function(_0x410e56,_0x25940e){return client[_0x2b36('0x2')](_0x2b36('0x3'),{'body':_0x25940e,'options':{'where':{'uniqueid':_0x410e56},'order':[['id',_0x2b36('0x4')]],'limit':0x1},'log':_0x2b36('0x3')});}; \ No newline at end of file +var _0x2d9e=['DESC','../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x593992,_0x328da3){var _0x1b200e=function(_0x3aa8a4){while(--_0x3aa8a4){_0x593992['push'](_0x593992['shift']());}};_0x1b200e(++_0x328da3);}(_0x2d9e,0x166));var _0xe2d9=function(_0x2c61da,_0x2aada0){_0x2c61da=_0x2c61da-0x0;var _0x3dbd6d=_0x2d9e[_0x2c61da];return _0x3dbd6d;};'use strict';var client=require(_0xe2d9('0x0'));exports[_0xe2d9('0x1')]=function(_0x425362){return client[_0xe2d9('0x2')]('CreateFaxQueueReport',{'body':_0x425362,'log':_0xe2d9('0x3')});};exports[_0xe2d9('0x4')]=function(_0x525c8f,_0x551f36){return client[_0xe2d9('0x2')](_0xe2d9('0x5'),{'body':_0x551f36,'options':{'where':{'uniqueid':_0x525c8f},'order':[['id',_0xe2d9('0x6')]],'limit':0x1},'log':_0xe2d9('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 45737eb..ebb14d8 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 _0x365e=['Intervals','../client','getIntervals','Request','name','Interval'];(function(_0x1bca73,_0x5d2e2d){var _0xe6151a=function(_0x20808b){while(--_0x20808b){_0x1bca73['push'](_0x1bca73['shift']());}};_0xe6151a(++_0x5d2e2d);}(_0x365e,0x145));var _0xe365=function(_0x5ba020,_0x9e2569){_0x5ba020=_0x5ba020-0x0;var _0x3aa061=_0x365e[_0x5ba020];return _0x3aa061;};'use strict';var client=require(_0xe365('0x0'));exports[_0xe365('0x1')]=function(){return function(){return client[_0xe365('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xe365('0x3')],'include':[{'model':_0xe365('0x4'),'as':_0xe365('0x5'),'attributes':['id',_0xe365('0x3'),'interval']}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0x6b39=['GetInterval','Intervals','name','interval','../client','getIntervals','Request'];(function(_0x3c3982,_0x163010){var _0x66448f=function(_0x35f37f){while(--_0x35f37f){_0x3c3982['push'](_0x3c3982['shift']());}};_0x66448f(++_0x163010);}(_0x6b39,0x1c4));var _0x96b3=function(_0x19324e,_0x35cc43){_0x19324e=_0x19324e-0x0;var _0xcfde4c=_0x6b39[_0x19324e];return _0xcfde4c;};'use strict';var client=require(_0x96b3('0x0'));exports[_0x96b3('0x1')]=function(){return function(){return client[_0x96b3('0x2')](_0x96b3('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':'Interval','as':_0x96b3('0x4'),'attributes':['id',_0x96b3('0x5'),_0x96b3('0x6')]}]},'log':_0x96b3('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index bb5a04d..35241af 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 _0x6d11=['AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','updateMailInteraction','addTags'];(function(_0x96e800,_0x3a9e4f){var _0x1ea9a0=function(_0x3a071c){while(--_0x3a071c){_0x96e800['push'](_0x96e800['shift']());}};_0x1ea9a0(++_0x3a9e4f);}(_0x6d11,0xbf));var _0x16d1=function(_0x212d96,_0x320b7){_0x212d96=_0x212d96-0x0;var _0x4f356c=_0x6d11[_0x212d96];return _0x4f356c;};'use strict';var client=require(_0x16d1('0x0'));exports[_0x16d1('0x1')]=function(_0x78317b,_0x49dea5){return client[_0x16d1('0x2')]('UpdateMailInteraction',{'body':_0x49dea5,'options':{'where':{'id':_0x78317b}},'log':_0x16d1('0x3')});};exports[_0x16d1('0x4')]=function(_0x4bce83,_0x48754e){return client[_0x16d1('0x2')](_0x16d1('0x5'),{'body':_0x48754e,'options':{'where':{'id':_0x4bce83}},'log':_0x16d1('0x6')});}; \ No newline at end of file +var _0x7880=['AddTagsToMailInteraction','addTagsToChatInteraction','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x27ddf5,_0x5a3e18){var _0x26e74a=function(_0x5f24ac){while(--_0x5f24ac){_0x27ddf5['push'](_0x27ddf5['shift']());}};_0x26e74a(++_0x5a3e18);}(_0x7880,0x1f4));var _0x0788=function(_0x3782f1,_0xdb9da7){_0x3782f1=_0x3782f1-0x0;var _0x59aa2c=_0x7880[_0x3782f1];return _0x59aa2c;};'use strict';var client=require('../client');exports[_0x0788('0x0')]=function(_0x219c25,_0x841a33){return client[_0x0788('0x1')](_0x0788('0x2'),{'body':_0x841a33,'options':{'where':{'id':_0x219c25}},'log':_0x0788('0x3')});};exports['addTags']=function(_0x3925a6,_0x1e0814){return client[_0x0788('0x1')](_0x0788('0x4'),{'body':_0x1e0814,'options':{'where':{'id':_0x3925a6}},'log':_0x0788('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 1ba5ce0..565ee42 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 _0x8c4e=['CreateMailMessage','createMailMessage','../client','create'];(function(_0x502dc2,_0x46ef5b){var _0x59b089=function(_0x2c0335){while(--_0x2c0335){_0x502dc2['push'](_0x502dc2['shift']());}};_0x59b089(++_0x46ef5b);}(_0x8c4e,0x1d2));var _0xe8c4=function(_0x51b02f,_0x26956c){_0x51b02f=_0x51b02f-0x0;var _0x37f372=_0x8c4e[_0x51b02f];return _0x37f372;};'use strict';var client=require(_0xe8c4('0x0'));exports[_0xe8c4('0x1')]=function(_0xbe96a2){return client['Request'](_0xe8c4('0x2'),{'body':_0xbe96a2,'log':_0xe8c4('0x3')});}; \ No newline at end of file +var _0xf56a=['create','Request','CreateMailMessage','createMailMessage'];(function(_0x36b84a,_0x26c481){var _0x5d0e66=function(_0x38bb26){while(--_0x38bb26){_0x36b84a['push'](_0x36b84a['shift']());}};_0x5d0e66(++_0x26c481);}(_0xf56a,0xe4));var _0xaf56=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0xf56a[_0x42f009];return _0x22a1e0;};'use strict';var client=require('../client');exports[_0xaf56('0x0')]=function(_0x1a07fa){return client[_0xaf56('0x1')](_0xaf56('0x2'),{'body':_0x1a07fa,'log':_0xaf56('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index b1ab44d..c5543a8 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 _0xbbb4=['mailPause','getMailQueues','../client','Request','GetMailQueue','name','strategy','User','Agents'];(function(_0x153a8e,_0x4107e5){var _0x51e194=function(_0x5d0d32){while(--_0x5d0d32){_0x153a8e['push'](_0x153a8e['shift']());}};_0x51e194(++_0x4107e5);}(_0xbbb4,0x1e8));var _0x4bbb=function(_0x4d2040,_0x2a1931){_0x4d2040=_0x4d2040-0x0;var _0x591501=_0xbbb4[_0x4d2040];return _0x591501;};'use strict';var client=require(_0x4bbb('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x4bbb('0x1')](_0x4bbb('0x2'),{'options':{'raw':![],'attributes':['id',_0x4bbb('0x3'),'timeout',_0x4bbb('0x4')],'include':[{'model':_0x4bbb('0x5'),'as':_0x4bbb('0x6'),'attributes':['id',_0x4bbb('0x3'),'online',_0x4bbb('0x7')]}]},'log':_0x4bbb('0x8')});};}; \ No newline at end of file +var _0x7763=['timeout','strategy','User','Agents','name','online','mailPause','getMailQueues','../client','Request'];(function(_0x14806a,_0x14d122){var _0x12e125=function(_0x7e370e){while(--_0x7e370e){_0x14806a['push'](_0x14806a['shift']());}};_0x12e125(++_0x14d122);}(_0x7763,0x134));var _0x3776=function(_0xadafdf,_0x506951){_0xadafdf=_0xadafdf-0x0;var _0x5d46f6=_0x7763[_0xadafdf];return _0x5d46f6;};'use strict';var client=require(_0x3776('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x3776('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id','name',_0x3776('0x2'),_0x3776('0x3')],'include':[{'model':_0x3776('0x4'),'as':_0x3776('0x5'),'attributes':['id',_0x3776('0x6'),_0x3776('0x7'),_0x3776('0x8')]}]},'log':_0x3776('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 7b76784..1290219 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 _0xd868=['UpdateMailQueueReport','DESC','create','Request','CreateMailQueueReport'];(function(_0x2aebc6,_0x27b68a){var _0x213b20=function(_0x53b331){while(--_0x53b331){_0x2aebc6['push'](_0x2aebc6['shift']());}};_0x213b20(++_0x27b68a);}(_0xd868,0xb1));var _0x8d86=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0xd868[_0x58dc25];return _0x21b0a7;};'use strict';var client=require('../client');exports[_0x8d86('0x0')]=function(_0x44fb27){return client[_0x8d86('0x1')](_0x8d86('0x2'),{'body':_0x44fb27,'log':'CreateMailQueueReport'});};exports['update']=function(_0x1b9019,_0x463661){return client[_0x8d86('0x1')](_0x8d86('0x3'),{'body':_0x463661,'options':{'where':{'uniqueid':_0x1b9019},'order':[['id',_0x8d86('0x4')]],'limit':0x1},'log':_0x8d86('0x3')});}; \ No newline at end of file +var _0x57c8=['update','UpdateMailQueueReport','../client','Request','CreateMailQueueReport'];(function(_0x348e46,_0x5187dc){var _0x58b74f=function(_0x5e2f00){while(--_0x5e2f00){_0x348e46['push'](_0x348e46['shift']());}};_0x58b74f(++_0x5187dc);}(_0x57c8,0x12e));var _0x857c=function(_0x4080cd,_0x52e276){_0x4080cd=_0x4080cd-0x0;var _0x6d93eb=_0x57c8[_0x4080cd];return _0x6d93eb;};'use strict';var client=require(_0x857c('0x0'));exports['create']=function(_0x516f91){return client[_0x857c('0x1')]('CreateMailQueueReport',{'body':_0x516f91,'log':_0x857c('0x2')});};exports[_0x857c('0x3')]=function(_0x37d2bc,_0x55155d){return client[_0x857c('0x1')](_0x857c('0x4'),{'body':_0x55155d,'options':{'where':{'uniqueid':_0x37d2bc},'order':[['id','DESC']],'limit':0x1},'log':_0x857c('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 8d7b1d7..dc73b17 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 _0xcb37=['Request','addTags','AddTagsToOpenchannelInteraction','../client','update'];(function(_0xeb4773,_0x311318){var _0x19d00d=function(_0x4752b3){while(--_0x4752b3){_0xeb4773['push'](_0xeb4773['shift']());}};_0x19d00d(++_0x311318);}(_0xcb37,0xa3));var _0x7cb3=function(_0x5d888b,_0x5c5f90){_0x5d888b=_0x5d888b-0x0;var _0xc3cfcc=_0xcb37[_0x5d888b];return _0xc3cfcc;};'use strict';var client=require(_0x7cb3('0x0'));exports[_0x7cb3('0x1')]=function(_0x4a9651,_0x4d6c02){return client[_0x7cb3('0x2')]('UpdateOpenchannelInteraction',{'body':_0x4d6c02,'options':{'where':{'id':_0x4a9651}},'log':'updateOpenchannelInteraction'});};exports[_0x7cb3('0x3')]=function(_0x2a9089,_0x3454b8){return client['Request'](_0x7cb3('0x4'),{'body':_0x3454b8,'options':{'where':{'id':_0x2a9089}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xba18=['addTags','AddTagsToOpenchannelInteraction','update','Request','UpdateOpenchannelInteraction'];(function(_0x3042c5,_0x36cb88){var _0x7cd140=function(_0x4cdcd8){while(--_0x4cdcd8){_0x3042c5['push'](_0x3042c5['shift']());}};_0x7cd140(++_0x36cb88);}(_0xba18,0x16a));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x8ba1('0x0')]=function(_0x12a710,_0x3900d1){return client[_0x8ba1('0x1')](_0x8ba1('0x2'),{'body':_0x3900d1,'options':{'where':{'id':_0x12a710}},'log':'updateOpenchannelInteraction'});};exports[_0x8ba1('0x3')]=function(_0x577ce2,_0x276012){return client[_0x8ba1('0x1')](_0x8ba1('0x4'),{'body':_0x276012,'options':{'where':{'id':_0x577ce2}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 2026721..c9b6e1f 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 _0x4f3b=['create','CreateOpenchannelMessage','../client'];(function(_0x36f47c,_0x38ef4d){var _0x296c55=function(_0x403eec){while(--_0x403eec){_0x36f47c['push'](_0x36f47c['shift']());}};_0x296c55(++_0x38ef4d);}(_0x4f3b,0x9b));var _0xb4f3=function(_0x5d9ceb,_0x1a49f5){_0x5d9ceb=_0x5d9ceb-0x0;var _0x33ce82=_0x4f3b[_0x5d9ceb];return _0x33ce82;};'use strict';var client=require(_0xb4f3('0x0'));exports[_0xb4f3('0x1')]=function(_0x4149ff){return client['Request'](_0xb4f3('0x2'),{'body':_0x4149ff,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0x4a1c=['Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x28ee60,_0x4cc551){var _0x4bbf28=function(_0x149338){while(--_0x149338){_0x28ee60['push'](_0x28ee60['shift']());}};_0x4bbf28(++_0x4cc551);}(_0x4a1c,0x186));var _0xc4a1=function(_0x566168,_0x4c39af){_0x566168=_0x566168-0x0;var _0x4e1f7a=_0x4a1c[_0x566168];return _0x4e1f7a;};'use strict';var client=require('../client');exports['create']=function(_0x183bcb){return client[_0xc4a1('0x0')](_0xc4a1('0x1'),{'body':_0x183bcb,'log':_0xc4a1('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 44c07ac..bc18f2d 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 _0x64cd=['Agents','online','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','User'];(function(_0x19a90e,_0xe14b0b){var _0xa49b11=function(_0x560f76){while(--_0x560f76){_0x19a90e['push'](_0x19a90e['shift']());}};_0xa49b11(++_0xe14b0b);}(_0x64cd,0x142));var _0xd64c=function(_0xeead8a,_0x3d2400){_0xeead8a=_0xeead8a-0x0;var _0x24742c=_0x64cd[_0xeead8a];return _0x24742c;};'use strict';var client=require(_0xd64c('0x0'));exports[_0xd64c('0x1')]=function(){return function(){return client[_0xd64c('0x2')](_0xd64c('0x3'),{'options':{'raw':![],'attributes':['id',_0xd64c('0x4'),_0xd64c('0x5'),_0xd64c('0x6')],'include':[{'model':_0xd64c('0x7'),'as':_0xd64c('0x8'),'attributes':['id',_0xd64c('0x4'),_0xd64c('0x9'),'openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x211a=['strategy','User','Agents','online','../client','getOpenchannelQueues','Request','name'];(function(_0x25fb0a,_0x330831){var _0xbaa0af=function(_0x34851d){while(--_0x34851d){_0x25fb0a['push'](_0x25fb0a['shift']());}};_0xbaa0af(++_0x330831);}(_0x211a,0x64));var _0xa211=function(_0x4c0556,_0x268317){_0x4c0556=_0x4c0556-0x0;var _0x4e69f1=_0x211a[_0x4c0556];return _0x4e69f1;};'use strict';var client=require(_0xa211('0x0'));exports[_0xa211('0x1')]=function(){return function(){return client[_0xa211('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xa211('0x3'),'timeout',_0xa211('0x4')],'include':[{'model':_0xa211('0x5'),'as':_0xa211('0x6'),'attributes':['id',_0xa211('0x3'),_0xa211('0x7'),'openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index c9d3b0a..694eeab 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 _0x3452=['UpdateOpenchannelQueueReport','DESC','../client','create','Request','CreateOpenchannelQueueReport','update'];(function(_0x326b39,_0x28db22){var _0x12c667=function(_0x371f73){while(--_0x371f73){_0x326b39['push'](_0x326b39['shift']());}};_0x12c667(++_0x28db22);}(_0x3452,0x183));var _0x2345=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x3452[_0x465028];return _0xb783d4;};'use strict';var client=require(_0x2345('0x0'));exports[_0x2345('0x1')]=function(_0x450f2c){return client[_0x2345('0x2')](_0x2345('0x3'),{'body':_0x450f2c,'log':_0x2345('0x3')});};exports[_0x2345('0x4')]=function(_0x23b337,_0x475206){return client['Request'](_0x2345('0x5'),{'body':_0x475206,'options':{'where':{'uniqueid':_0x23b337},'order':[['id',_0x2345('0x6')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0xa8bd=['Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','create'];(function(_0x44d84e,_0x1d4e52){var _0x5bff86=function(_0x334b38){while(--_0x334b38){_0x44d84e['push'](_0x44d84e['shift']());}};_0x5bff86(++_0x1d4e52);}(_0xa8bd,0x113));var _0xda8b=function(_0x2e2b71,_0x4df13e){_0x2e2b71=_0x2e2b71-0x0;var _0x234c54=_0xa8bd[_0x2e2b71];return _0x234c54;};'use strict';var client=require('../client');exports[_0xda8b('0x0')]=function(_0x11ff07){return client[_0xda8b('0x1')](_0xda8b('0x2'),{'body':_0x11ff07,'log':_0xda8b('0x2')});};exports[_0xda8b('0x3')]=function(_0x3fdd5d,_0x572932){return client[_0xda8b('0x1')](_0xda8b('0x4'),{'body':_0x572932,'options':{'where':{'uniqueid':_0x3fdd5d},'order':[['id',_0xda8b('0x5')]],'limit':0x1},'log':_0xda8b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 7d186c8..ed101bc 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 _0x3148=['Request','UpdateSmsInteraction','updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update'];(function(_0x2fae5d,_0x554e83){var _0x442e76=function(_0x5974e0){while(--_0x5974e0){_0x2fae5d['push'](_0x2fae5d['shift']());}};_0x442e76(++_0x554e83);}(_0x3148,0x1d3));var _0x8314=function(_0x839e2b,_0x424db3){_0x839e2b=_0x839e2b-0x0;var _0xd45560=_0x3148[_0x839e2b];return _0xd45560;};'use strict';var client=require(_0x8314('0x0'));exports[_0x8314('0x1')]=function(_0x53afdc,_0x932127){return client[_0x8314('0x2')](_0x8314('0x3'),{'body':_0x932127,'options':{'where':{'id':_0x53afdc}},'log':_0x8314('0x4')});};exports['addTags']=function(_0x35ee55,_0x41e9fd){return client[_0x8314('0x2')](_0x8314('0x5'),{'body':_0x41e9fd,'options':{'where':{'id':_0x35ee55}},'log':_0x8314('0x6')});}; \ No newline at end of file +var _0x4849=['Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update'];(function(_0x22dd74,_0x5c2dbc){var _0x5f4b96=function(_0x3e5651){while(--_0x3e5651){_0x22dd74['push'](_0x22dd74['shift']());}};_0x5f4b96(++_0x5c2dbc);}(_0x4849,0x86));var _0x9484=function(_0x221e4e,_0xbc46df){_0x221e4e=_0x221e4e-0x0;var _0x1e4362=_0x4849[_0x221e4e];return _0x1e4362;};'use strict';var client=require(_0x9484('0x0'));exports[_0x9484('0x1')]=function(_0x4fcfaf,_0x11cf8a){return client[_0x9484('0x2')](_0x9484('0x3'),{'body':_0x11cf8a,'options':{'where':{'id':_0x4fcfaf}},'log':_0x9484('0x4')});};exports[_0x9484('0x5')]=function(_0x3f3057,_0x6ea4d8){return client['Request'](_0x9484('0x6'),{'body':_0x6ea4d8,'options':{'where':{'id':_0x3f3057}},'log':_0x9484('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index d684536..cdb185d 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 _0x70a8=['Request','CreateSmsMessage','createSmsMessage','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70a8,0x137));var _0x870a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x70a8[_0x2dafbe];return _0x58a45a;};'use strict';var client=require('../client');exports[_0x870a('0x0')]=function(_0x431ebf){return client[_0x870a('0x1')](_0x870a('0x2'),{'body':_0x431ebf,'log':_0x870a('0x3')});}; \ No newline at end of file +var _0xa763=['CreateSmsMessage','createSmsMessage','../client','Request'];(function(_0x59947d,_0x27ad58){var _0x4b59e0=function(_0x3f996a){while(--_0x3f996a){_0x59947d['push'](_0x59947d['shift']());}};_0x4b59e0(++_0x27ad58);}(_0xa763,0x18a));var _0x3a76=function(_0x2ca9d4,_0x51d5c6){_0x2ca9d4=_0x2ca9d4-0x0;var _0x258956=_0xa763[_0x2ca9d4];return _0x258956;};'use strict';var client=require(_0x3a76('0x0'));exports['create']=function(_0x2f1d59){return client[_0x3a76('0x1')](_0x3a76('0x2'),{'body':_0x2f1d59,'log':_0x3a76('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 872ae6e..e2325ec 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x121cb9,_0x1267a8){var _0x1eb7dc=function(_0x35bd72){while(--_0x35bd72){_0x121cb9['push'](_0x121cb9['shift']());}};_0x1eb7dc(++_0x1267a8);}(_0xe706,0xa3));var _0x6e70=function(_0x582ccd,_0xa9ab43){_0x582ccd=_0x582ccd-0x0;var _0x11545d=_0xe706[_0x582ccd];return _0x11545d;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x302ed0,_0x5210af){var _0x4a9855=function(_0x27006c){while(--_0x27006c){_0x302ed0['push'](_0x302ed0['shift']());}};_0x4a9855(++_0x5210af);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index deeb2ea..e54e3f6 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x3482a9,_0x363b99){var _0x32cc5f=function(_0x12d3d1){while(--_0x12d3d1){_0x3482a9['push'](_0x3482a9['shift']());}};_0x32cc5f(++_0x363b99);}(_0x3e74,0x175));var _0x43e7=function(_0x4b9a4a,_0x4aff9e){_0x4b9a4a=_0x4b9a4a-0x0;var _0x25e67f=_0x3e74[_0x4b9a4a];return _0x25e67f;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});}; \ No newline at end of file +var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x56b8ba,_0x4305ae){var _0x3c16a1=function(_0x37b7bf){while(--_0x37b7bf){_0x56b8ba['push'](_0x56b8ba['shift']());}};_0x3c16a1(++_0x4305ae);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 91bfdbe..039e7fb 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(_0x3381bf,_0x5b40e7){var _0x1b3027=function(_0x497e60){while(--_0x497e60){_0x3381bf['push'](_0x3381bf['shift']());}};_0x1b3027(++_0x5b40e7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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(_0x4dbbfb,_0x307d79){var _0x39b4b5=function(_0xa227ba){while(--_0xa227ba){_0x4dbbfb['push'](_0x4dbbfb['shift']());}};_0x39b4b5(++_0x307d79);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 77f7b47..49cd125 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 _0x677a=['UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','Request'];(function(_0x566ce5,_0xacd6b5){var _0x28c951=function(_0x5c3e2a){while(--_0x5c3e2a){_0x566ce5['push'](_0x566ce5['shift']());}};_0x28c951(++_0xacd6b5);}(_0x677a,0xd6));var _0xa677=function(_0x3cda66,_0x4f0706){_0x3cda66=_0x3cda66-0x0;var _0x8a873=_0x677a[_0x3cda66];return _0x8a873;};'use strict';var client=require(_0xa677('0x0'));exports['update']=function(_0x3896be,_0x1a14cf){return client[_0xa677('0x1')](_0xa677('0x2'),{'body':_0x1a14cf,'options':{'where':{'id':_0x3896be}},'log':_0xa677('0x3')});};exports['addTags']=function(_0x1ca988,_0x2e46f8){return client[_0xa677('0x1')](_0xa677('0x4'),{'body':_0x2e46f8,'options':{'where':{'id':_0x1ca988}},'log':_0xa677('0x5')});}; \ No newline at end of file +var _0xea31=['AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags'];(function(_0x2f7e42,_0x4aa0cf){var _0x1ac0d3=function(_0x473a5c){while(--_0x473a5c){_0x2f7e42['push'](_0x2f7e42['shift']());}};_0x1ac0d3(++_0x4aa0cf);}(_0xea31,0x6b));var _0x1ea3=function(_0x3d2e9a,_0x141fbd){_0x3d2e9a=_0x3d2e9a-0x0;var _0x176b19=_0xea31[_0x3d2e9a];return _0x176b19;};'use strict';var client=require(_0x1ea3('0x0'));exports['update']=function(_0x1782b8,_0x2ed015){return client[_0x1ea3('0x1')](_0x1ea3('0x2'),{'body':_0x2ed015,'options':{'where':{'id':_0x1782b8}},'log':_0x1ea3('0x3')});};exports[_0x1ea3('0x4')]=function(_0x1142f1,_0x555620){return client[_0x1ea3('0x1')](_0x1ea3('0x5'),{'body':_0x555620,'options':{'where':{'id':_0x1142f1}},'log':_0x1ea3('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index a67f0f9..10ccd93 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 _0x7850=['createWhatsappMessage','../client','create','CreateWhatsappMessage'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7850,0x1cd));var _0x0785=function(_0x3db403,_0x54006d){_0x3db403=_0x3db403-0x0;var _0xe8a912=_0x7850[_0x3db403];return _0xe8a912;};'use strict';var client=require(_0x0785('0x0'));exports[_0x0785('0x1')]=function(_0x5b647f){return client['Request'](_0x0785('0x2'),{'body':_0x5b647f,'log':_0x0785('0x3')});}; \ No newline at end of file +var _0x03e6=['CreateWhatsappMessage','createWhatsappMessage','../client','create','Request'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x03e6,0x1b5));var _0x603e=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x03e6[_0x167cc1];return _0x10bc4b;};'use strict';var client=require(_0x603e('0x0'));exports[_0x603e('0x1')]=function(_0x2a640a){return client[_0x603e('0x2')](_0x603e('0x3'),{'body':_0x2a640a,'log':_0x603e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 4934426..d94b323 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 _0xbd43=['GetWhatsappQueue','timeout','Agents','online','whatsappPause','getWhatsappQueues','Request'];(function(_0x4c0d27,_0x5e4432){var _0x4225ba=function(_0x15a277){while(--_0x15a277){_0x4c0d27['push'](_0x4c0d27['shift']());}};_0x4225ba(++_0x5e4432);}(_0xbd43,0x155));var _0x3bd4=function(_0xdbd0a4,_0x13f14d){_0xdbd0a4=_0xdbd0a4-0x0;var _0x3f39cf=_0xbd43[_0xdbd0a4];return _0x3f39cf;};'use strict';var client=require('../client');exports[_0x3bd4('0x0')]=function(){return function(){return client[_0x3bd4('0x1')](_0x3bd4('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x3bd4('0x3'),'strategy'],'include':[{'model':'User','as':_0x3bd4('0x4'),'attributes':['id','name',_0x3bd4('0x5'),_0x3bd4('0x6')]}]},'log':_0x3bd4('0x0')});};}; \ No newline at end of file +var _0x7779=['../client','getWhatsappQueues','Request','GetWhatsappQueue','name','strategy','User','Agents','online'];(function(_0x5c32ee,_0x18f668){var _0x2016bf=function(_0x11d53f){while(--_0x11d53f){_0x5c32ee['push'](_0x5c32ee['shift']());}};_0x2016bf(++_0x18f668);}(_0x7779,0x19e));var _0x9777=function(_0x5bf609,_0x5c1e35){_0x5bf609=_0x5bf609-0x0;var _0x3c3a74=_0x7779[_0x5bf609];return _0x3c3a74;};'use strict';var client=require(_0x9777('0x0'));exports[_0x9777('0x1')]=function(){return function(){return client[_0x9777('0x2')](_0x9777('0x3'),{'options':{'raw':![],'attributes':['id',_0x9777('0x4'),'timeout',_0x9777('0x5')],'include':[{'model':_0x9777('0x6'),'as':_0x9777('0x7'),'attributes':['id',_0x9777('0x4'),_0x9777('0x8'),'whatsappPause']}]},'log':_0x9777('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index e0e4a55..54911ae 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 _0x2e93=['DESC','../client','create','CreateWhatsappQueueReport','update'];(function(_0x2952a0,_0x1adc0c){var _0x275f2c=function(_0x253ace){while(--_0x253ace){_0x2952a0['push'](_0x2952a0['shift']());}};_0x275f2c(++_0x1adc0c);}(_0x2e93,0x10a));var _0x32e9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2e93[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x32e9('0x0'));exports[_0x32e9('0x1')]=function(_0x2f8226){return client['Request'](_0x32e9('0x2'),{'body':_0x2f8226,'log':_0x32e9('0x2')});};exports[_0x32e9('0x3')]=function(_0x4882c5,_0x2ef243){return client['Request']('UpdateWhatsappQueueReport',{'body':_0x2ef243,'options':{'where':{'uniqueid':_0x4882c5},'order':[['id',_0x32e9('0x4')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0x0737=['update','UpdateWhatsappQueueReport','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x113a6c,_0x10df30){var _0x1ac632=function(_0xbd4fb9){while(--_0xbd4fb9){_0x113a6c['push'](_0x113a6c['shift']());}};_0x1ac632(++_0x10df30);}(_0x0737,0xb0));var _0x7073=function(_0x20c7c2,_0x17929f){_0x20c7c2=_0x20c7c2-0x0;var _0x29fdfa=_0x0737[_0x20c7c2];return _0x29fdfa;};'use strict';var client=require(_0x7073('0x0'));exports[_0x7073('0x1')]=function(_0x453b0e){return client[_0x7073('0x2')]('CreateWhatsappQueueReport',{'body':_0x453b0e,'log':_0x7073('0x3')});};exports[_0x7073('0x4')]=function(_0x255767,_0x1ee858){return client['Request'](_0x7073('0x5'),{'body':_0x1ee858,'options':{'where':{'uniqueid':_0x255767},'order':[['id','DESC']],'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 ad9997b..1d608fc 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 _0x537e=['message','join','stop','find','agents','createQueue','atimeout','channel','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','util','seq-queue','./strategy','string','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','error','[%s][AGENT]\x20%s','map'];(function(_0x543c51,_0xff0084){var _0x360555=function(_0x2a0801){while(--_0x2a0801){_0x543c51['push'](_0x543c51['shift']());}};_0x360555(++_0xff0084);}(_0x537e,0x1f1));var _0xe537=function(_0xa02cfe,_0x34919c){_0xa02cfe=_0xa02cfe-0x0;var _0x1355bd=_0x537e[_0xa02cfe];return _0x1355bd;};'use strict';var schema=require(_0xe537('0x0'));var _=require('lodash');var util=require(_0xe537('0x1'));var seqqueue=require(_0xe537('0x2'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0xe537('0x3'));var queue=schema({'name':{'type':_0xe537('0x4'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x3e8a6b,_0x5a76cc,_0x34f20b){return logger[_0xe537('0x5')](util['format'](_0xe537('0x6'),_0x3e8a6b,_0x5a76cc[_0xe537('0x7')],_0x34f20b));}function handleFindAgent(_0x4d4660){return function(_0x80210){return _0x80210[_0xe537('0x7')][_0xe537('0x8')]()===_0x4d4660[_0xe537('0x8')]();};}exports[_0xe537('0x9')]=function(_0x599b83,_0xb0f1c7,_0x553005,_0x4bc043){return function(_0x5ba89c){try{var _0x423f43={'name':_0xb0f1c7[0x0],'timeout':_0xb0f1c7[0x1]};var _0x29f973=queue[_0xe537('0x0')](_0x423f43,{'typecast':!![]});if(_0x29f973['length']){logger[_0xe537('0xa')](_0xe537('0xb'),_0x599b83,_[_0xe537('0xc')](_0x29f973,_0xe537('0xd'))[_0xe537('0xe')](',\x20'));_0x5ba89c[_0xe537('0xf')]();}else{var _0x12e862=_[_0xe537('0x10')](_0x553005[_0xe537('0x11')],handleFindAgent(_0x423f43[_0xe537('0x7')]));if(_0x12e862){var _0x236842=(_0x423f43['timeout']||0xa)*0x3e8;var _0x26421b,_0x226d03;var _0x5f0b8d=seqqueue[_0xe537('0x12')](_0x236842);_0x5f0b8d['id']=_0x599b83;_0x5f0b8d[_0xe537('0x13')]=_0x236842;_0x5f0b8d[_0xe537('0x14')]=_0x4bc043['channel'];writeLog(_0x599b83,_0x12e862,util['format']('START:%s',_0x236842));_0x553005[_0xe537('0x15')][_0x599b83]['on'](_0xe537('0x16'),function(){logger[_0xe537('0x5')](_0xe537('0x17'),_0x599b83);clearTimeout(_0x226d03);_0x226d03=undefined;_0x5f0b8d[_0xe537('0x18')]();if(_0x553005[_0xe537('0x15')][_0x599b83]){delete _0x553005[_0xe537('0x15')][_0x599b83];}_0x5ba89c['stop']();});_0x553005[_0xe537('0x15')][_0x599b83]['on'](_0xe537('0x19'),function(){if(_0x553005[_0xe537('0x15')][_0x599b83]){delete _0x553005[_0xe537('0x15')][_0x599b83];}});_0x226d03=setTimeout(function(){logger['info'](_0xe537('0x1a'),_0x599b83);clearTimeout(_0x226d03);_0x5f0b8d['close']();_0x5ba89c['next']();},_0x236842);strategy['agent'](_0x5f0b8d,_0x12e862,_0x553005,_0x4bc043);}else{logger[_0xe537('0xa')](_0xe537('0x1b'),_0x599b83,_0x423f43[_0xe537('0x7')]);_0x5ba89c[_0xe537('0xf')]();}}}catch(_0x3be1c5){console['log'](_0x3be1c5);logger[_0xe537('0xa')](_0xe537('0x1c'),_0x599b83,_0x3be1c5[_0xe537('0x1d')]);_0x5ba89c[_0xe537('0xf')]();}};}; \ No newline at end of file +var _0xce69=['message','join','find','agents','timeout','createQueue','atimeout','channel','START:%s','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','stop','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','format','name','toLowerCase','consequence','validate','error','[%s][AGENT]\x20%s','map'];(function(_0x5982f5,_0x30ccc5){var _0x316b15=function(_0x316e8b){while(--_0x316e8b){_0x5982f5['push'](_0x5982f5['shift']());}};_0x316b15(++_0x30ccc5);}(_0xce69,0xc1));var _0x9ce6=function(_0x3a78a0,_0x44985f){_0x3a78a0=_0x3a78a0-0x0;var _0x48e917=_0xce69[_0x3a78a0];return _0x48e917;};'use strict';var schema=require('validate');var _=require(_0x9ce6('0x0'));var util=require(_0x9ce6('0x1'));var seqqueue=require(_0x9ce6('0x2'));var logger=require(_0x9ce6('0x3'))('routing');var strategy=require(_0x9ce6('0x4'));var queue=schema({'name':{'type':_0x9ce6('0x5'),'required':!![],'message':_0x9ce6('0x6')},'timeout':{'type':'number','message':_0x9ce6('0x7')}});function writeLog(_0x4925d7,_0x30516a,_0x149cb5){return logger[_0x9ce6('0x8')](util[_0x9ce6('0x9')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x4925d7,_0x30516a[_0x9ce6('0xa')],_0x149cb5));}function handleFindAgent(_0x1afcce){return function(_0x5cdfcb){return _0x5cdfcb[_0x9ce6('0xa')]['toLowerCase']()===_0x1afcce[_0x9ce6('0xb')]();};}exports[_0x9ce6('0xc')]=function(_0x272add,_0x25cbec,_0x21c2a4,_0x36f89b){return function(_0x265117){try{var _0x3abe2e={'name':_0x25cbec[0x0],'timeout':_0x25cbec[0x1]};var _0x4cd66a=queue[_0x9ce6('0xd')](_0x3abe2e,{'typecast':!![]});if(_0x4cd66a['length']){logger[_0x9ce6('0xe')](_0x9ce6('0xf'),_0x272add,_[_0x9ce6('0x10')](_0x4cd66a,_0x9ce6('0x11'))[_0x9ce6('0x12')](',\x20'));_0x265117['stop']();}else{var _0x76fb0c=_[_0x9ce6('0x13')](_0x21c2a4[_0x9ce6('0x14')],handleFindAgent(_0x3abe2e[_0x9ce6('0xa')]));if(_0x76fb0c){var _0xc8bcdf=(_0x3abe2e[_0x9ce6('0x15')]||0xa)*0x3e8;var _0x18325c,_0x287ff8;var _0x5d7943=seqqueue[_0x9ce6('0x16')](_0xc8bcdf);_0x5d7943['id']=_0x272add;_0x5d7943[_0x9ce6('0x17')]=_0xc8bcdf;_0x5d7943[_0x9ce6('0x18')]=_0x36f89b[_0x9ce6('0x18')];writeLog(_0x272add,_0x76fb0c,util[_0x9ce6('0x9')](_0x9ce6('0x19'),_0xc8bcdf));_0x21c2a4['rules'][_0x272add]['on']('end',function(){logger[_0x9ce6('0x8')](_0x9ce6('0x1a'),_0x272add);clearTimeout(_0x287ff8);_0x287ff8=undefined;_0x5d7943[_0x9ce6('0x1b')]();if(_0x21c2a4[_0x9ce6('0x1c')][_0x272add]){delete _0x21c2a4[_0x9ce6('0x1c')][_0x272add];}_0x265117[_0x9ce6('0x1d')]();});_0x21c2a4[_0x9ce6('0x1c')][_0x272add]['on']('complete',function(){if(_0x21c2a4['rules'][_0x272add]){delete _0x21c2a4[_0x9ce6('0x1c')][_0x272add];}});_0x287ff8=setTimeout(function(){logger[_0x9ce6('0x8')]('[%s][AGENT]\x20ROUTING\x20END',_0x272add);clearTimeout(_0x287ff8);_0x5d7943[_0x9ce6('0x1b')]();_0x265117[_0x9ce6('0x1e')]();},_0xc8bcdf);strategy[_0x9ce6('0x1f')](_0x5d7943,_0x76fb0c,_0x21c2a4,_0x36f89b);}else{logger[_0x9ce6('0xe')](_0x9ce6('0x20'),_0x272add,_0x3abe2e[_0x9ce6('0xa')]);_0x265117[_0x9ce6('0x1d')]();}}}catch(_0x36615c){console['log'](_0x36615c);logger[_0x9ce6('0xe')](_0x9ce6('0x21'),_0x272add,_0x36615c[_0x9ce6('0x22')]);_0x265117[_0x9ce6('0x1d')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index ceb4569..3a43acd 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 _0x2857=['out','channel','whatsapp','phone','chat','account','upperFirst','AccountId','InteractionId','isEmpty','body','getMustacheRender','Message','create','catch','[%s][AMAZONLEX]\x20%s','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','$LATEST','message','toString','postText','next','amazonlex','providerName','providerResponse','dialogState','Failed','error','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format'];(function(_0x2328f4,_0x2d31a6){var _0x29783d=function(_0x521238){while(--_0x521238){_0x2328f4['push'](_0x2328f4['shift']());}};_0x29783d(++_0x2d31a6);}(_0x2857,0x169));var _0x7285=function(_0x4b4e03,_0xa6b616){_0x4b4e03=_0x4b4e03-0x0;var _0xd9f749=_0x2857[_0x4b4e03];return _0xd9f749;};'use strict';var _=require('lodash');var moment=require('moment');var AWS=require(_0x7285('0x0'));var utils=require('./utils');var logger=require(_0x7285('0x1'))(_0x7285('0x2'));var rpc={'chatMessage':require(_0x7285('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x7285('0x4')),'smsMessage':require(_0x7285('0x5')),'faxMessage':require(_0x7285('0x6')),'whatsappMessage':require(_0x7285('0x7'))};exports[_0x7285('0x8')]=function(_0x111000,_0xbc4125){return function(_0x268d55){try{if(!_['isNil'](this[_0x7285('0x9')][_0x7285('0xa')])){logger[_0x7285('0xb')]('[%s][AMAZONLEX]\x20%s',_0x111000,_0x7285('0xc'));return _0x268d55['next']();}var _0x3f4c59={'ContactId':this[_0x7285('0xd')]['id'],'sentAt':moment()[_0x7285('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x7285('0xf')};if(this[_0x7285('0x10')]==='sms'||this[_0x7285('0x10')]===_0x7285('0x11')){_0x3f4c59[_0x7285('0x12')]=this[_0x7285('0x9')][_0x7285('0x12')];}var _0x19c0e1=this['channel'];if(_0x19c0e1===_0x7285('0x13')){_0x3f4c59['ChatWebsiteId']=this[_0x7285('0x14')]['id'];}else{_0x3f4c59[_[_0x7285('0x15')](_0x19c0e1)+_0x7285('0x16')]=this[_0x7285('0x14')]['id'];}_0x3f4c59[_[_0x7285('0x15')](_0x19c0e1)+_0x7285('0x17')]=this['interaction']['id'];if(this[_0x7285('0x9')]['created']){var _0x2bb564=_0xbc4125[0x4];if(!_[_0x7285('0x18')](_0x2bb564)){_0x3f4c59[_0x7285('0x19')]=utils[_0x7285('0x1a')](_0x2bb564,this);return rpc[_0x19c0e1+_0x7285('0x1b')][_0x7285('0x1c')](_0x3f4c59)['then'](function(_0x55dbe4){logger[_0x7285('0xb')]('[%s][AMAZONLEX]\x20%s',_0x111000,_0x3f4c59[_0x7285('0x19')]);})[_0x7285('0x1d')](function(_0x3dfc7f){logger['error'](_0x7285('0x1e'),_0x111000,JSON[_0x7285('0x1f')](_0x3dfc7f));})['finally'](function(){logger['info'](_0x7285('0x20'),_0x111000);_0x268d55['stop']();});}else{logger[_0x7285('0xb')](_0x7285('0x21'),_0x111000);_0x268d55[_0x7285('0x22')]();}}else{var _0x3a20dd=this;var _0x29c1e7=new AWS[(_0x7285('0x23'))]({'accessKeyId':_0xbc4125[0x0],'secretAccessKey':_0xbc4125[0x1],'region':_0xbc4125[0x2]});var _0x7887e1={'botAlias':_0x7285('0x24'),'botName':_0xbc4125[0x3],'inputText':this[_0x7285('0x25')]['body'],'userId':this[_0x7285('0x10')]+':'+this[_0x7285('0x9')]['id'][_0x7285('0x26')]()};_0x29c1e7[_0x7285('0x27')](_0x7887e1,function(_0x4e54bf,_0xc80955){if(_0x4e54bf){logger['error'](_0x7285('0x1e'),_0x111000,_0x4e54bf[_0x7285('0x25')]);_0x268d55[_0x7285('0x28')]();}else if(_0xc80955&&_0xc80955[_0x7285('0x25')]){_0x3a20dd['body'][_0x7285('0x29')]=_0xc80955;_0x3f4c59[_0x7285('0x19')]=_0xc80955[_0x7285('0x25')];_0x3f4c59[_0x7285('0x2a')]=_0x7285('0x29');_0x3f4c59[_0x7285('0x2b')]=JSON[_0x7285('0x1f')](_0xc80955);return rpc[_0x19c0e1+_0x7285('0x1b')][_0x7285('0x1c')](_0x3f4c59)['then'](function(_0x4bc3a9){logger['info']('[%s][AMAZONLEX]\x20%s',_0x111000,_0x3f4c59['body']);if(_0xc80955[_0x7285('0x2c')]==_0x7285('0x2d')){_0x268d55[_0x7285('0x28')]();}else{_0x268d55['stop']();}})[_0x7285('0x1d')](function(_0x323d14){logger['error']('[%s][AMAZONLEX]\x20%s',_0x111000,JSON[_0x7285('0x1f')](_0x323d14));_0x268d55['next']();});}else{_0x268d55[_0x7285('0x28')]();}});}}catch(_0x41159b){logger[_0x7285('0x2e')]('[%s][AMAZONLEX]\x20%s',_0x111000,JSON[_0x7285('0x1f')](_0x41159b));_0x268d55[_0x7285('0x22')]();}};}; \ No newline at end of file +var _0x23b5=['consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','[%s][AMAZONLEX]\x20%s','catch','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerName','providerResponse','Failed','aws-sdk','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage'];(function(_0xd0de78,_0x1a852d){var _0x5244ed=function(_0x1696b3){while(--_0x1696b3){_0xd0de78['push'](_0xd0de78['shift']());}};_0x5244ed(++_0x1a852d);}(_0x23b5,0x150));var _0x523b=function(_0x43b584,_0x20a6bd){_0x43b584=_0x43b584-0x0;var _0x48f27b=_0x23b5[_0x43b584];return _0x48f27b;};'use strict';var _=require('lodash');var moment=require('moment');var AWS=require(_0x523b('0x0'));var utils=require('./utils');var logger=require(_0x523b('0x1'))('routing');var rpc={'chatMessage':require(_0x523b('0x2')),'openchannelMessage':require(_0x523b('0x3')),'mailMessage':require(_0x523b('0x4')),'smsMessage':require(_0x523b('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x523b('0x6'))};exports[_0x523b('0x7')]=function(_0x282a58,_0x3bd78c){return function(_0x48ef42){try{if(!_[_0x523b('0x8')](this[_0x523b('0x9')][_0x523b('0xa')])){logger[_0x523b('0xb')]('[%s][AMAZONLEX]\x20%s',_0x282a58,_0x523b('0xc'));return _0x48ef42[_0x523b('0xd')]();}var _0x3b8363={'ContactId':this[_0x523b('0xe')]['id'],'sentAt':moment()[_0x523b('0xf')](_0x523b('0x10')),'direction':_0x523b('0x11')};if(this[_0x523b('0x12')]===_0x523b('0x13')||this[_0x523b('0x12')]==='whatsapp'){_0x3b8363[_0x523b('0x14')]=this[_0x523b('0x9')][_0x523b('0x14')];}var _0x4c929b=this['channel'];if(_0x4c929b===_0x523b('0x15')){_0x3b8363[_0x523b('0x16')]=this['account']['id'];}else{_0x3b8363[_['upperFirst'](_0x4c929b)+_0x523b('0x17')]=this[_0x523b('0x18')]['id'];}_0x3b8363[_[_0x523b('0x19')](_0x4c929b)+_0x523b('0x1a')]=this[_0x523b('0x9')]['id'];if(this[_0x523b('0x9')][_0x523b('0x1b')]){var _0x5d2887=_0x3bd78c[0x4];if(!_[_0x523b('0x1c')](_0x5d2887)){_0x3b8363[_0x523b('0x1d')]=utils[_0x523b('0x1e')](_0x5d2887,this);return rpc[_0x4c929b+_0x523b('0x1f')][_0x523b('0x20')](_0x3b8363)[_0x523b('0x21')](function(_0x2c0578){logger[_0x523b('0xb')](_0x523b('0x22'),_0x282a58,_0x3b8363[_0x523b('0x1d')]);})[_0x523b('0x23')](function(_0x3b003f){logger[_0x523b('0x24')](_0x523b('0x22'),_0x282a58,JSON[_0x523b('0x25')](_0x3b003f));})['finally'](function(){logger[_0x523b('0xb')](_0x523b('0x26'),_0x282a58);_0x48ef42[_0x523b('0x27')]();});}else{logger[_0x523b('0xb')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x282a58);_0x48ef42['stop']();}}else{var _0x45bab9=this;var _0x490271=new AWS[(_0x523b('0x28'))]({'accessKeyId':_0x3bd78c[0x0],'secretAccessKey':_0x3bd78c[0x1],'region':_0x3bd78c[0x2]});var _0x140135={'botAlias':_0x523b('0x29'),'botName':_0x3bd78c[0x3],'inputText':this[_0x523b('0x2a')][_0x523b('0x1d')],'userId':this[_0x523b('0x12')]+':'+this[_0x523b('0x9')]['id'][_0x523b('0x2b')]()};_0x490271[_0x523b('0x2c')](_0x140135,function(_0x434605,_0x17f62a){if(_0x434605){logger['error'](_0x523b('0x22'),_0x282a58,_0x434605['message']);_0x48ef42[_0x523b('0xd')]();}else if(_0x17f62a&&_0x17f62a[_0x523b('0x2a')]){_0x45bab9[_0x523b('0x1d')][_0x523b('0x2d')]=_0x17f62a;_0x3b8363[_0x523b('0x1d')]=_0x17f62a[_0x523b('0x2a')];_0x3b8363[_0x523b('0x2e')]=_0x523b('0x2d');_0x3b8363[_0x523b('0x2f')]=JSON[_0x523b('0x25')](_0x17f62a);return rpc[_0x4c929b+_0x523b('0x1f')]['create'](_0x3b8363)[_0x523b('0x21')](function(_0x1963b0){logger[_0x523b('0xb')](_0x523b('0x22'),_0x282a58,_0x3b8363['body']);if(_0x17f62a['dialogState']==_0x523b('0x30')){_0x48ef42['next']();}else{_0x48ef42[_0x523b('0x27')]();}})[_0x523b('0x23')](function(_0x162432){logger[_0x523b('0x24')](_0x523b('0x22'),_0x282a58,JSON[_0x523b('0x25')](_0x162432));_0x48ef42[_0x523b('0xd')]();});}else{_0x48ef42[_0x523b('0xd')]();}});}}catch(_0x2d3855){logger[_0x523b('0x24')]('[%s][AMAZONLEX]\x20%s',_0x282a58,JSON[_0x523b('0x25')](_0x2d3855));_0x48ef42[_0x523b('0x27')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 89941fb..c9ea151 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 _0x7b57=['update','Message','catch','Interaction','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','chat','ChatWebsiteId','account','AccountId','InteractionId','Smtp','service','host','port','secure','authentication','auth','user','pass','inReplyTo','messageId','','replace','','headers','auto-replied','auto_reply','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','finally'];(function(_0x1e688a,_0x270ddf){var _0x4ffe6d=function(_0x52bdcc){while(--_0x52bdcc){_0x1e688a['push'](_0x1e688a['shift']());}};_0x4ffe6d(++_0x270ddf);}(_0x7b57,0x191));var _0x77b5=function(_0x264ff4,_0x3da6b2){_0x264ff4=_0x264ff4-0x0;var _0x5d332f=_0x7b57[_0x264ff4];return _0x5d332f;};'use strict';var _=require(_0x77b5('0x0'));var moment=require(_0x77b5('0x1'));var utils=require(_0x77b5('0x2'));var logger=require(_0x77b5('0x3'))(_0x77b5('0x4'));var rpc={'chatMessage':require(_0x77b5('0x5')),'openchannelMessage':require(_0x77b5('0x6')),'mailMessage':require(_0x77b5('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x77b5('0x8')),'whatsappMessage':require(_0x77b5('0x9')),'chatInteraction':require(_0x77b5('0xa')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x77b5('0xb')),'smsInteraction':require(_0x77b5('0xc')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x77b5('0xd'))};var mailRpc=require(_0x77b5('0xe'));exports[_0x77b5('0xf')]=function(_0x466798,_0x49d855,_0x10e8fd,_0x4a8088){return function(_0xdb0723){try{var _0x3ab69b=this[_0x77b5('0x10')];if(_0x3ab69b===_0x77b5('0x11')&&_0x4a8088[_0x77b5('0x12')][_0x77b5('0x13')]){logger[_0x77b5('0x14')](_0x77b5('0x15'),_0x466798,_0x77b5('0x16'));return _0xdb0723[_0x77b5('0x17')]();}if(_0x49d855[0x0]==='1'&&(_[_0x77b5('0x18')](this[_0x77b5('0x19')][_0x77b5('0x1a')])||!this[_0x77b5('0x19')]['created'])){logger[_0x77b5('0x14')](_0x77b5('0x15'),_0x466798,_0x77b5('0x1b'));return _0xdb0723[_0x77b5('0x17')]();}if(_0x49d855[0x0]==='2'&&this[_0x77b5('0x19')][_0x77b5('0x1c')]){logger[_0x77b5('0x14')](_0x77b5('0x1d'),_0x466798,'One\x20Time\x20already\x20sent');return _0xdb0723[_0x77b5('0x17')]();}var _0x34c0be={'ContactId':this[_0x77b5('0x1e')]['id'],'sentAt':moment()[_0x77b5('0x1f')](_0x77b5('0x20')),'direction':_0x77b5('0x21')};if(this['channel']===_0x77b5('0x11')){_0x34c0be[_0x77b5('0x12')]=utils[_0x77b5('0x22')](_0x49d855[0x2],this);}else{_0x34c0be[_0x77b5('0x12')]=utils[_0x77b5('0x22')](_0x49d855[0x1],this);}if(this['message']){_0x34c0be['to']=this[_0x77b5('0x23')][_0x77b5('0x24')]||'';if(this[_0x77b5('0x10')]==='mail'&&_0x49d855[0x1]==='1'){_0x34c0be['cc']=this[_0x77b5('0x23')]['cc']||'';}_0x34c0be[_0x77b5('0x24')]=this[_0x77b5('0x23')]['to']||'';_0x34c0be[_0x77b5('0x25')]=this[_0x77b5('0x23')][_0x77b5('0x25')]||'';_0x34c0be[_0x77b5('0x26')]=!![];if(this[_0x77b5('0x23')]['subject']){_0x34c0be[_0x77b5('0x27')]='';_0x34c0be[_0x77b5('0x27')]+=_[_0x77b5('0x28')](this[_0x77b5('0x23')][_0x77b5('0x27')],_0x77b5('0x29'))?'':'Re:\x20';_0x34c0be[_0x77b5('0x27')]+=this['message'][_0x77b5('0x27')];}}if(this[_0x77b5('0x10')]===_0x77b5('0x2a')){_0x34c0be[_0x77b5('0x2b')]=this[_0x77b5('0x2c')]['id'];}else{_0x34c0be[_['upperFirst'](this[_0x77b5('0x10')])+_0x77b5('0x2d')]=this[_0x77b5('0x2c')]['id'];}_0x34c0be[_['upperFirst'](this[_0x77b5('0x10')])+_0x77b5('0x2e')]=this[_0x77b5('0x19')]['id'];var _0x5389e3=this[_0x77b5('0x19')];if(rpc[this[_0x77b5('0x10')]+'Message']){if(this[_0x77b5('0x10')]===_0x77b5('0x11')){var _0x42ef43={'tls':{'rejectUnauthorized':![]}};if(this[_0x77b5('0x2c')][_0x77b5('0x2f')][_0x77b5('0x30')]){_0x42ef43[_0x77b5('0x30')]=this[_0x77b5('0x2c')]['Smtp'][_0x77b5('0x30')];}else{_0x42ef43[_0x77b5('0x31')]=this['account'][_0x77b5('0x2f')][_0x77b5('0x31')];_0x42ef43[_0x77b5('0x32')]=this['account'][_0x77b5('0x2f')]['port'];_0x42ef43[_0x77b5('0x33')]=this[_0x77b5('0x2c')]['Smtp'][_0x77b5('0x33')];}if(this[_0x77b5('0x2c')]['Smtp'][_0x77b5('0x34')]){_0x42ef43[_0x77b5('0x35')]={'user':this[_0x77b5('0x2c')]['Smtp'][_0x77b5('0x36')],'pass':this[_0x77b5('0x2c')][_0x77b5('0x2f')][_0x77b5('0x37')]};}_0x34c0be[_0x77b5('0x38')]=this[_0x77b5('0x23')][_0x77b5('0x39')];_0x34c0be['html']=_0x77b5('0x3a')+_[_0x77b5('0x3b')](_0x34c0be[_0x77b5('0x12')],_0x77b5('0x3c'),_0x77b5('0x3d'))+_0x77b5('0x3e');_0x34c0be[_0x77b5('0x3f')]={'Auto-Submitted':_0x77b5('0x40'),'X-Auto-Response-Suppress':'All','Precedence':_0x77b5('0x41')};return mailRpc['sendMailMessage'](_0x42ef43,_0x34c0be)[_0x77b5('0x42')](function(_0x5a0b22){logger[_0x77b5('0x14')](_0x77b5('0x43'),_0x466798);_0x34c0be[_0x77b5('0x39')]=_0x5a0b22[_0x77b5('0x23')]['messageId'];return rpc[_0x3ab69b+'Message'][_0x77b5('0x44')](_0x34c0be);})[_0x77b5('0x42')](function(_0x2c5e97){logger['info'](_0x77b5('0x15'),_0x466798,JSON[_0x77b5('0x45')](_0x2c5e97));})['catch'](function(_0x2ad373){logger[_0x77b5('0x46')](_0x77b5('0x47'),_0x466798,JSON['stringify'](_0x2ad373));})[_0x77b5('0x48')](function(){Promise['resolve']()[_0x77b5('0x42')](function(){if(_0x49d855[0x0]!=='2'||_0x5389e3['autoreplyExecuted'])return;return rpc[_0x3ab69b+'Interaction'][_0x77b5('0x49')](_0x5389e3['id'],{'autoreplyExecuted':!![]})[_0x77b5('0x42')](function(_0x444164){logger[_0x77b5('0x14')](_0x77b5('0x1d'),_0x466798,JSON[_0x77b5('0x45')](_0x444164));})['catch'](function(_0x4086ef){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x466798,JSON[_0x77b5('0x45')](_0x4086ef));});})[_0x77b5('0x42')](function(){_0xdb0723['next']();});});}else{return rpc[this['channel']+_0x77b5('0x4a')][_0x77b5('0x44')](_0x34c0be)[_0x77b5('0x42')](function(_0x34b6a7){logger['info'](_0x77b5('0x15'),_0x466798,_0x34c0be[_0x77b5('0x12')]);})[_0x77b5('0x4b')](function(_0x3b7e09){logger['error'](_0x77b5('0x15'),_0x466798,JSON[_0x77b5('0x45')](_0x3b7e09));})[_0x77b5('0x48')](function(){Promise['resolve']()[_0x77b5('0x42')](function(){if(_0x49d855[0x0]!=='2'||_0x5389e3[_0x77b5('0x1c')])return;return rpc[_0x3ab69b+_0x77b5('0x4c')]['update'](_0x5389e3['id'],{'autoreplyExecuted':!![]})[_0x77b5('0x42')](function(_0x407b23){logger[_0x77b5('0x14')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x466798,JSON['stringify'](_0x407b23));})[_0x77b5('0x4b')](function(_0xfce103){logger[_0x77b5('0x46')](_0x77b5('0x4d'),_0x466798,JSON['stringify'](_0xfce103));});})[_0x77b5('0x42')](function(){_0xdb0723[_0x77b5('0x17')]();});});}}}catch(_0x5e61c6){logger['error'](_0x77b5('0x15'),_0x466798,JSON[_0x77b5('0x45')](_0x5e61c6));_0xdb0723[_0x77b5('0x4e')]();}};}; \ No newline at end of file +var _0xce9e=['secure','authentication','user','pass','inReplyTo','messageId','html','','replace','';_0x5e1a11[_0xece9('0x3d')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0xece9('0x3e'),'Precedence':_0xece9('0x3f')};return mailRpc[_0xece9('0x40')](_0x516cc3,_0x5e1a11)[_0xece9('0x41')](function(_0x428de4){logger[_0xece9('0x19')](_0xece9('0x42'),_0x4c2334);_0x5e1a11[_0xece9('0x37')]=_0x428de4[_0xece9('0x1f')][_0xece9('0x37')];return rpc[_0xefa0c3+_0xece9('0x2d')]['create'](_0x5e1a11);})['then'](function(_0x1fc943){logger['info']('[%s][AUTOREPLY]\x20%s',_0x4c2334,JSON[_0xece9('0x43')](_0x1fc943));})[_0xece9('0x44')](function(_0x18694f){logger['error'](_0xece9('0x45'),_0x4c2334,JSON[_0xece9('0x43')](_0x18694f));})[_0xece9('0x46')](function(){Promise[_0xece9('0x47')]()[_0xece9('0x41')](function(){if(_0x5a35b2[0x0]!=='2'||_0x3c609c[_0xece9('0x48')])return;return rpc[_0xefa0c3+_0xece9('0x49')][_0xece9('0x4a')](_0x3c609c['id'],{'autoreplyExecuted':!![]})['then'](function(_0x25fa5c){logger['info'](_0xece9('0x1a'),_0x4c2334,JSON[_0xece9('0x43')](_0x25fa5c));})['catch'](function(_0x1b0465){logger[_0xece9('0x4b')](_0xece9('0x4c'),_0x4c2334,JSON[_0xece9('0x43')](_0x1b0465));});})['then'](function(){_0x1c89dd['next']();});});}else{return rpc[this[_0xece9('0xf')]+_0xece9('0x2d')][_0xece9('0x4d')](_0x5e1a11)[_0xece9('0x41')](function(_0xd74ab0){logger[_0xece9('0x19')]('[%s][AUTOREPLY]\x20%s',_0x4c2334,_0x5e1a11[_0xece9('0x11')]);})[_0xece9('0x44')](function(_0xf9a119){logger[_0xece9('0x4b')](_0xece9('0x13'),_0x4c2334,JSON[_0xece9('0x43')](_0xf9a119));})['finally'](function(){Promise[_0xece9('0x47')]()['then'](function(){if(_0x5a35b2[0x0]!=='2'||_0x3c609c[_0xece9('0x48')])return;return rpc[_0xefa0c3+_0xece9('0x49')][_0xece9('0x4a')](_0x3c609c['id'],{'autoreplyExecuted':!![]})[_0xece9('0x41')](function(_0x19675f){logger[_0xece9('0x19')](_0xece9('0x1a'),_0x4c2334,JSON[_0xece9('0x43')](_0x19675f));})[_0xece9('0x44')](function(_0xee693d){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4c2334,JSON[_0xece9('0x43')](_0xee693d));});})[_0xece9('0x41')](function(){_0x1c89dd[_0xece9('0x15')]();});});}}}catch(_0x32e670){logger['error']('[%s][AUTOREPLY]\x20%s',_0x4c2334,JSON[_0xece9('0x43')](_0x32e670));_0x1c89dd[_0xece9('0x4e')]();}};}; \ 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 4dc5ae7..72da7a2 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 _0xd378=['../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','stringify','finally','stop','[%s][CLOSE]\x20%s','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction'];(function(_0x5cf8bb,_0x462e9c){var _0x28cc44=function(_0x38e597){while(--_0x38e597){_0x5cf8bb['push'](_0x5cf8bb['shift']());}};_0x28cc44(++_0x462e9c);}(_0xd378,0x181));var _0x8d37=function(_0x57c0b9,_0x5a835e){_0x57c0b9=_0x57c0b9-0x0;var _0xcbf842=_0xd378[_0x57c0b9];return _0xcbf842;};'use strict';var moment=require(_0x8d37('0x0'));var logger=require(_0x8d37('0x1'))(_0x8d37('0x2'));var rpc={'chatInteraction':require(_0x8d37('0x3')),'openchannelInteraction':require(_0x8d37('0x4')),'smsInteraction':require(_0x8d37('0x5')),'mailInteraction':require(_0x8d37('0x6')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x8d37('0x7'))};exports[_0x8d37('0x8')]=function(_0x1d6451,_0x4b33da,_0x2a5dc5,_0x5bfb97){return function(_0x516156){try{logger['info'](_0x8d37('0x9'),_0x1d6451,_0x4b33da[0x0]);var _0x1f0503={'closed':0x1,'closedAt':moment()[_0x8d37('0xa')](_0x8d37('0xb')),'closeReason':_0x8d37('0xc'),'disposition':_0x4b33da[0x0]};if(rpc[_0x5bfb97[_0x8d37('0xd')]+_0x8d37('0xe')]){rpc[_0x5bfb97[_0x8d37('0xd')]+_0x8d37('0xe')][_0x8d37('0xf')](_0x5bfb97[_0x8d37('0x10')]['id'],_0x1f0503)[_0x8d37('0x11')](function(_0x4d2b27){logger[_0x8d37('0x12')](_0x8d37('0x13'),_0x1d6451,_0x5bfb97['interaction']['id']);})[_0x8d37('0x14')](function(_0x1b57fa){logger[_0x8d37('0x15')]('[%s][CLOSE]\x20%s',_0x1d6451,JSON[_0x8d37('0x16')](_0x1b57fa));})[_0x8d37('0x17')](function(){_0x516156[_0x8d37('0x18')]();});}}catch(_0x590083){logger[_0x8d37('0x15')](_0x8d37('0x19'),_0x1d6451,JSON[_0x8d37('0x16')](_0x590083));_0x516156[_0x8d37('0x18')]();}};}; \ No newline at end of file +var _0x3f26=['routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f26,0x1e1));var _0x63f2=function(_0x4a58a3,_0x4e5250){_0x4a58a3=_0x4a58a3-0x0;var _0x2a7c8a=_0x3f26[_0x4a58a3];return _0x2a7c8a;};'use strict';var moment=require(_0x63f2('0x0'));var logger=require(_0x63f2('0x1'))(_0x63f2('0x2'));var rpc={'chatInteraction':require(_0x63f2('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x63f2('0x4')),'mailInteraction':require(_0x63f2('0x5')),'faxInteraction':require(_0x63f2('0x6')),'whatsappInteraction':require(_0x63f2('0x7'))};exports['consequence']=function(_0xa6ccc6,_0x55f6f3,_0xc87455,_0x4c0621){return function(_0x560020){try{logger[_0x63f2('0x8')](_0x63f2('0x9'),_0xa6ccc6,_0x55f6f3[0x0]);var _0x93f352={'closed':0x1,'closedAt':moment()['format'](_0x63f2('0xa')),'closeReason':_0x63f2('0xb'),'disposition':_0x55f6f3[0x0]};if(rpc[_0x4c0621[_0x63f2('0xc')]+_0x63f2('0xd')]){rpc[_0x4c0621[_0x63f2('0xc')]+'Interaction']['update'](_0x4c0621[_0x63f2('0xe')]['id'],_0x93f352)[_0x63f2('0xf')](function(_0x2555b5){logger['info'](_0x63f2('0x10'),_0xa6ccc6,_0x4c0621[_0x63f2('0xe')]['id']);})[_0x63f2('0x11')](function(_0x3427d4){logger[_0x63f2('0x12')](_0x63f2('0x13'),_0xa6ccc6,JSON[_0x63f2('0x14')](_0x3427d4));})[_0x63f2('0x15')](function(){_0x560020['stop']();});}}catch(_0x63985b){logger['error'](_0x63f2('0x13'),_0xa6ccc6,JSON[_0x63f2('0x14')](_0x63985b));_0x560020[_0x63f2('0x16')]();}};}; \ 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 ab97589..85857b1 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 _0x87d8=['AccountId','created','isEmpty','body','getMustacheRender','create','then','info','catch','error','[%s][DIALOGFLOW]\x20%s','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','result','fulfillment','speech','providerName','providerResponse','Message','metadata','stop','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','next','contact','format','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account'];(function(_0x103168,_0x5ca262){var _0x573a42=function(_0x3b4227){while(--_0x3b4227){_0x103168['push'](_0x103168['shift']());}};_0x573a42(++_0x5ca262);}(_0x87d8,0x1a9));var _0x887d=function(_0x1c443f,_0x51319d){_0x1c443f=_0x1c443f-0x0;var _0x4a4a71=_0x87d8[_0x1c443f];return _0x4a4a71;};'use strict';var _=require('lodash');var moment=require(_0x887d('0x0'));var apiai=require(_0x887d('0x1'));var md5=require(_0x887d('0x2'));var utils=require(_0x887d('0x3'));var logger=require(_0x887d('0x4'))(_0x887d('0x5'));var rpc={'chatMessage':require(_0x887d('0x6')),'openchannelMessage':require(_0x887d('0x7')),'mailMessage':require(_0x887d('0x8')),'smsMessage':require(_0x887d('0x9')),'faxMessage':require(_0x887d('0xa')),'whatsappMessage':require(_0x887d('0xb'))};exports[_0x887d('0xc')]=function(_0x16820a,_0x242f79){return function(_0x479f76){try{if(!_[_0x887d('0xd')](this[_0x887d('0xe')]['UserId'])){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x16820a,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x479f76[_0x887d('0xf')]();}var _0x31488d={'ContactId':this[_0x887d('0x10')]['id'],'sentAt':moment()[_0x887d('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0x887d('0x12')]===_0x887d('0x13')||this[_0x887d('0x12')]===_0x887d('0x14')){_0x31488d[_0x887d('0x15')]=this[_0x887d('0xe')][_0x887d('0x15')];}var _0x1e331b=this['channel'];if(_0x1e331b===_0x887d('0x16')){_0x31488d[_0x887d('0x17')]=this[_0x887d('0x18')]['id'];}else{_0x31488d[_['upperFirst'](_0x1e331b)+_0x887d('0x19')]=this[_0x887d('0x18')]['id'];}_0x31488d[_['upperFirst'](_0x1e331b)+'InteractionId']=this['interaction']['id'];if(this[_0x887d('0xe')][_0x887d('0x1a')]){var _0x5d4fce=_0x242f79[0x2];if(!_[_0x887d('0x1b')](_0x5d4fce)){_0x31488d[_0x887d('0x1c')]=utils[_0x887d('0x1d')](_0x5d4fce,this);return rpc[_0x1e331b+'Message'][_0x887d('0x1e')](_0x31488d)[_0x887d('0x1f')](function(_0x5e97ec){logger[_0x887d('0x20')]('[%s][DIALOGFLOW]\x20%s',_0x16820a,_0x31488d[_0x887d('0x1c')]);})[_0x887d('0x21')](function(_0x1ab5fc){logger[_0x887d('0x22')](_0x887d('0x23'),_0x16820a,JSON[_0x887d('0x24')](_0x1ab5fc));})[_0x887d('0x25')](function(){logger[_0x887d('0x20')](_0x887d('0x26'),_0x16820a);_0x479f76['stop']();});}else{logger['info'](_0x887d('0x27'),_0x16820a);_0x479f76['stop']();}}else{var _0x2aca37=this;var _0x311aed=apiai(_0x242f79[0x0],{'language':_0x242f79[0x1]||'en'});return _0x311aed[_0x887d('0x28')](this[_0x887d('0x29')][_0x887d('0x1c')],{'sessionId':md5(this[_0x887d('0xe')]['id'])})['then'](function(_0x332bed){_0x2aca37[_0x887d('0x1c')]['dialogflow']=_0x332bed;_0x31488d['body']=_0x332bed[_0x887d('0x2a')][_0x887d('0x2b')][_0x887d('0x2c')];_0x31488d[_0x887d('0x2d')]='dialogflow';_0x31488d[_0x887d('0x2e')]=JSON[_0x887d('0x24')](_0x332bed);return rpc[_0x1e331b+_0x887d('0x2f')]['create'](_0x31488d)[_0x887d('0x1f')](function(_0x1b96eb){logger[_0x887d('0x20')]('[%s][DIALOGFLOW]\x20%s',_0x16820a,_0x31488d['body']);if(_0x332bed[_0x887d('0x2a')][_0x887d('0x30')]['endConversation']){_0x479f76['next']();}else{_0x479f76[_0x887d('0x31')]();}})['catch'](function(_0x26a239){logger[_0x887d('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x16820a,JSON[_0x887d('0x24')](_0x26a239));_0x479f76[_0x887d('0xf')]();});})['catch'](function(_0x5edbe5){logger['error'](_0x887d('0x23'),_0x16820a,_0x5edbe5[_0x887d('0x29')]);_0x479f76[_0x887d('0xf')]();});}}catch(_0x1d2a53){logger[_0x887d('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x16820a,JSON[_0x887d('0x24')](_0x1d2a53));_0x479f76[_0x887d('0x31')]();}};}; \ No newline at end of file +var _0x8411=['next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','isEmpty','body','getMustacheRender','Message','create','then','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','textRequest','message','dialogflow','fulfillment','providerName','providerResponse','metadata','endConversation','apiai-promise','md5','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.'];(function(_0x1c1ca5,_0x27d104){var _0x5a0703=function(_0x34b85f){while(--_0x34b85f){_0x1c1ca5['push'](_0x1c1ca5['shift']());}};_0x5a0703(++_0x27d104);}(_0x8411,0x118));var _0x1841=function(_0x3b0488,_0x3a5adc){_0x3b0488=_0x3b0488-0x0;var _0x28d186=_0x8411[_0x3b0488];return _0x28d186;};'use strict';var _=require('lodash');var moment=require('moment');var apiai=require(_0x1841('0x0'));var md5=require(_0x1841('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x1841('0x2'));var rpc={'chatMessage':require(_0x1841('0x3')),'openchannelMessage':require(_0x1841('0x4')),'mailMessage':require(_0x1841('0x5')),'smsMessage':require(_0x1841('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x1841('0x7'))};exports['consequence']=function(_0x4224eb,_0x22a053){return function(_0x2c77df){try{if(!_[_0x1841('0x8')](this[_0x1841('0x9')][_0x1841('0xa')])){logger[_0x1841('0xb')](_0x1841('0xc'),_0x4224eb,_0x1841('0xd'));return _0x2c77df[_0x1841('0xe')]();}var _0x108644={'ContactId':this[_0x1841('0xf')]['id'],'sentAt':moment()[_0x1841('0x10')](_0x1841('0x11')),'direction':_0x1841('0x12')};if(this[_0x1841('0x13')]===_0x1841('0x14')||this[_0x1841('0x13')]===_0x1841('0x15')){_0x108644['phone']=this[_0x1841('0x9')][_0x1841('0x16')];}var _0x6ff1b9=this['channel'];if(_0x6ff1b9==='chat'){_0x108644[_0x1841('0x17')]=this[_0x1841('0x18')]['id'];}else{_0x108644[_['upperFirst'](_0x6ff1b9)+_0x1841('0x19')]=this[_0x1841('0x18')]['id'];}_0x108644[_[_0x1841('0x1a')](_0x6ff1b9)+_0x1841('0x1b')]=this[_0x1841('0x9')]['id'];if(this[_0x1841('0x9')]['created']){var _0x291df7=_0x22a053[0x2];if(!_[_0x1841('0x1c')](_0x291df7)){_0x108644[_0x1841('0x1d')]=utils[_0x1841('0x1e')](_0x291df7,this);return rpc[_0x6ff1b9+_0x1841('0x1f')][_0x1841('0x20')](_0x108644)[_0x1841('0x21')](function(_0xeeb608){logger[_0x1841('0xb')](_0x1841('0xc'),_0x4224eb,_0x108644[_0x1841('0x1d')]);})[_0x1841('0x22')](function(_0x25a777){logger[_0x1841('0x23')]('[%s][DIALOGFLOW]\x20%s',_0x4224eb,JSON[_0x1841('0x24')](_0x25a777));})[_0x1841('0x25')](function(){logger[_0x1841('0xb')](_0x1841('0x26'),_0x4224eb);_0x2c77df['stop']();});}else{logger[_0x1841('0xb')](_0x1841('0x27'),_0x4224eb);_0x2c77df[_0x1841('0x28')]();}}else{var _0x1ed975=this;var _0x12e1d4=apiai(_0x22a053[0x0],{'language':_0x22a053[0x1]||'en'});return _0x12e1d4[_0x1841('0x29')](this[_0x1841('0x2a')][_0x1841('0x1d')],{'sessionId':md5(this[_0x1841('0x9')]['id'])})[_0x1841('0x21')](function(_0x168d29){_0x1ed975[_0x1841('0x1d')][_0x1841('0x2b')]=_0x168d29;_0x108644['body']=_0x168d29['result'][_0x1841('0x2c')]['speech'];_0x108644[_0x1841('0x2d')]=_0x1841('0x2b');_0x108644[_0x1841('0x2e')]=JSON[_0x1841('0x24')](_0x168d29);return rpc[_0x6ff1b9+_0x1841('0x1f')][_0x1841('0x20')](_0x108644)[_0x1841('0x21')](function(_0x378269){logger[_0x1841('0xb')](_0x1841('0xc'),_0x4224eb,_0x108644['body']);if(_0x168d29['result'][_0x1841('0x2f')][_0x1841('0x30')]){_0x2c77df['next']();}else{_0x2c77df[_0x1841('0x28')]();}})[_0x1841('0x22')](function(_0x336e60){logger[_0x1841('0x23')](_0x1841('0xc'),_0x4224eb,JSON[_0x1841('0x24')](_0x336e60));_0x2c77df['next']();});})[_0x1841('0x22')](function(_0x3c952c){logger[_0x1841('0x23')](_0x1841('0xc'),_0x4224eb,_0x3c952c[_0x1841('0x2a')]);_0x2c77df[_0x1841('0xe')]();});}}catch(_0x5d3242){logger[_0x1841('0x23')](_0x1841('0xc'),_0x4224eb,JSON['stringify'](_0x5d3242));_0x2c77df[_0x1841('0x28')]();}};}; \ 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 5a3f947..1116d0b 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 _0x32f8=['fulfillmentText','push','all','error','lodash','dialogflow','md5','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','then','info','catch','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','phone','chat','account','upperFirst','AccountId','created','isEmpty','getMustacheRender','create','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','sessionPath','message','detectIntent','dialogflowV2','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','queryResult','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','providerName','providerResponse','length'];(function(_0x229b8b,_0xf4131a){var _0x134f1f=function(_0x52e9fa){while(--_0x52e9fa){_0x229b8b['push'](_0x229b8b['shift']());}};_0x134f1f(++_0xf4131a);}(_0x32f8,0x120));var _0x832f=function(_0x39f0e9,_0x4a3bbe){_0x39f0e9=_0x39f0e9-0x0;var _0x52d93b=_0x32f8[_0x39f0e9];return _0x52d93b;};'use strict';var _=require(_0x832f('0x0'));var dialogflow=require(_0x832f('0x1'));var md5=require(_0x832f('0x2'));var moment=require('moment');var Promise=require('bluebird');var logger=require('../../../../config/logger')(_0x832f('0x3'));var utils=require('./utils');var rpc={'chatMessage':require(_0x832f('0x4')),'openchannelMessage':require(_0x832f('0x5')),'mailMessage':require(_0x832f('0x6')),'smsMessage':require(_0x832f('0x7')),'faxMessage':require(_0x832f('0x8')),'whatsappMessage':require(_0x832f('0x9'))};function createMessage(_0xc1570d,_0x5bb780,_0xf15756,_0x3ffff7){return new Promise(function(_0x2ad4f3,_0x2f71b2){var _0x377547=_[_0x832f('0xa')](_0xf15756);_0x377547[_0x832f('0xb')]=_0x3ffff7;return rpc[_0x5bb780+_0x832f('0xc')]['create'](_0x377547)[_0x832f('0xd')](function(){logger[_0x832f('0xe')]('[%s][DIALOGFLOWV2]\x20%s',_0xc1570d,_0x377547['body']);_0x2ad4f3();})[_0x832f('0xf')](function(_0x2532f5){logger['error'](_0x832f('0x10'),_0xc1570d,JSON[_0x832f('0x11')](_0x2532f5));_0x2f71b2(_0x2532f5);});});}exports[_0x832f('0x12')]=function(_0xcd98b2,_0x1625e2){return function(_0x562888){try{if(!_[_0x832f('0x13')](this[_0x832f('0x14')][_0x832f('0x15')])){logger[_0x832f('0xe')](_0x832f('0x10'),_0xcd98b2,_0x832f('0x16'));return _0x562888[_0x832f('0x17')]();}var _0x18ad8c={'ContactId':this[_0x832f('0x18')]['id'],'sentAt':moment()[_0x832f('0x19')](_0x832f('0x1a')),'direction':_0x832f('0x1b')};if(this['channel']==='sms'||this[_0x832f('0x1c')]==='whatsapp'){_0x18ad8c[_0x832f('0x1d')]=this[_0x832f('0x14')][_0x832f('0x1d')];}var _0x499308=this[_0x832f('0x1c')];if(_0x499308===_0x832f('0x1e')){_0x18ad8c['ChatWebsiteId']=this[_0x832f('0x1f')]['id'];}else{_0x18ad8c[_[_0x832f('0x20')](_0x499308)+_0x832f('0x21')]=this[_0x832f('0x1f')]['id'];}_0x18ad8c[_['upperFirst'](_0x499308)+'InteractionId']=this[_0x832f('0x14')]['id'];if(this['interaction'][_0x832f('0x22')]){var _0x4b387b=_0x1625e2[0x4];if(!_[_0x832f('0x23')](_0x4b387b)){_0x18ad8c['body']=utils[_0x832f('0x24')](_0x4b387b,this);return rpc[_0x499308+_0x832f('0xc')][_0x832f('0x25')](_0x18ad8c)[_0x832f('0xd')](function(_0x520874){logger[_0x832f('0xe')](_0x832f('0x10'),_0xcd98b2,_0x18ad8c[_0x832f('0xb')]);})[_0x832f('0xf')](function(_0x7a7a74){logger['error'](_0x832f('0x10'),_0xcd98b2,JSON[_0x832f('0x11')](_0x7a7a74));})['finally'](function(){logger[_0x832f('0xe')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0xcd98b2);_0x562888[_0x832f('0x26')]();});}else{logger[_0x832f('0xe')](_0x832f('0x27'),_0xcd98b2);_0x562888[_0x832f('0x26')]();}}else{var _0x456e3f=this;var _0x58c208=_0x1625e2[0x2]['replace'](/\\n/g,'\x0a');var _0x2459f7={'credentials':{'private_key':_0x58c208,'client_email':_0x1625e2[0x1]}};var _0x2e2d24=new dialogflow[(_0x832f('0x28'))](_0x2459f7);var _0x464ac2=_0x2e2d24[_0x832f('0x29')](_0x1625e2[0x0],md5(_0x456e3f[_0x832f('0x14')]['id']));var _0x585f37={'session':_0x464ac2,'queryInput':{'text':{'text':_0x456e3f[_0x832f('0x2a')]['body'],'languageCode':_0x1625e2[0x3]||'en'}}};return _0x2e2d24[_0x832f('0x2b')](_0x585f37)['then'](function(_0x566ff3){if(_0x566ff3&&_0x566ff3['length']){_0x456e3f[_0x832f('0xb')][_0x832f('0x2c')]=_0x566ff3;var _0x5a3005=_0x566ff3[0x0];var _0x4f6a9e=_0x5a3005['queryResult']['diagnosticInfo']&&_0x5a3005['queryResult'][_0x832f('0x2d')][_0x832f('0x2e')]?_0x5a3005['queryResult']['diagnosticInfo'][_0x832f('0x2e')][_0x832f('0x2f')][_0x832f('0x30')]:![];_0x456e3f[_0x832f('0xb')][_0x832f('0x31')]=_0x5a3005[_0x832f('0x32')][_0x832f('0x33')];_0x456e3f['body'][_0x832f('0x34')]=_0x5a3005[_0x832f('0x32')][_0x832f('0x35')];_0x456e3f[_0x832f('0xb')][_0x832f('0x36')]=_0x5a3005['queryResult'][_0x832f('0x2d')]&&_0x5a3005[_0x832f('0x32')]['diagnosticInfo'][_0x832f('0x2e')]?_0x5a3005[_0x832f('0x32')]['diagnosticInfo']['fields'][_0x832f('0x2f')][_0x832f('0x30')]:![];_0x456e3f[_0x832f('0xb')][_0x832f('0x37')]=_0x5a3005[_0x832f('0x32')][_0x832f('0x38')][_0x832f('0x39')];_0x456e3f['body'][_0x832f('0x3a')]=_0x5a3005['queryResult'][_0x832f('0x38')]['displayName'];_0x456e3f[_0x832f('0xb')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x5a3005[_0x832f('0x32')]['intent'][_0x832f('0x3b')];_0x456e3f[_0x832f('0xb')][_0x832f('0x3c')]=_0x5a3005['queryResult'][_0x832f('0x3d')];_0x456e3f[_0x832f('0xb')][_0x832f('0x3e')]=_0x5a3005[_0x832f('0x32')][_0x832f('0x3f')];_0x456e3f[_0x832f('0xb')]['DIALOGFLOWV2_SCORE']=_0x5a3005[_0x832f('0x32')]['intentDetectionConfidence'];_0x18ad8c[_0x832f('0x40')]=_0x832f('0x2c');_0x18ad8c[_0x832f('0x41')]=JSON[_0x832f('0x11')](_0x566ff3);var _0x490fd7=[];for(var _0x860f13=0x0;_0x860f13<_0x566ff3[_0x832f('0x42')];_0x860f13++){var _0x5d7ae4=_0x566ff3[_0x860f13];if(_0x5d7ae4&&_0x5d7ae4['queryResult']&&_0x5d7ae4[_0x832f('0x32')][_0x832f('0x43')]){_0x490fd7[_0x832f('0x44')](createMessage(_0xcd98b2,_0x499308,_0x18ad8c,_0x5d7ae4['queryResult'][_0x832f('0x43')]));}}return Promise[_0x832f('0x45')](_0x490fd7)[_0x832f('0xd')](function(){if(_0x4f6a9e){_0x562888['next']();}else{_0x562888[_0x832f('0x26')]();}})[_0x832f('0xf')](function(_0x3d765f){logger[_0x832f('0x46')](_0x832f('0x10'),_0xcd98b2,JSON[_0x832f('0x11')](_0x3d765f));_0x562888[_0x832f('0x17')]();});}})['catch'](function(_0x23a834){logger['error'](_0x832f('0x10'),_0xcd98b2,_0x23a834[_0x832f('0x2a')]);_0x562888[_0x832f('0x17')]();});}}catch(_0x5368a7){logger['error'](_0x832f('0x10'),_0xcd98b2,JSON[_0x832f('0x11')](_0x5368a7));_0x562888[_0x832f('0x26')]();}};}; \ No newline at end of file +var _0x0140=['InteractionId','created','isEmpty','getMustacheRender','Message','finally','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','intent','name','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','all','catch','lodash','dialogflow','md5','moment','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','body','create','then','info','error','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','ChatWebsiteId','account','upperFirst'];(function(_0x2a8c21,_0x163576){var _0x5f3061=function(_0x4dc8eb){while(--_0x4dc8eb){_0x2a8c21['push'](_0x2a8c21['shift']());}};_0x5f3061(++_0x163576);}(_0x0140,0x148));var _0x0014=function(_0x47cfa0,_0x176b87){_0x47cfa0=_0x47cfa0-0x0;var _0x386b1d=_0x0140[_0x47cfa0];return _0x386b1d;};'use strict';var _=require(_0x0014('0x0'));var dialogflow=require(_0x0014('0x1'));var md5=require(_0x0014('0x2'));var moment=require(_0x0014('0x3'));var Promise=require('bluebird');var logger=require(_0x0014('0x4'))('routing');var utils=require('./utils');var rpc={'chatMessage':require(_0x0014('0x5')),'openchannelMessage':require(_0x0014('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x0014('0x7')),'faxMessage':require(_0x0014('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x1a2542,_0x5a19b2,_0x541189,_0x4d9cd3){return new Promise(function(_0x42accd,_0x4a8ebf){var _0x2ffbdc=_['clone'](_0x541189);_0x2ffbdc[_0x0014('0x9')]=_0x4d9cd3;return rpc[_0x5a19b2+'Message'][_0x0014('0xa')](_0x2ffbdc)[_0x0014('0xb')](function(){logger[_0x0014('0xc')]('[%s][DIALOGFLOWV2]\x20%s',_0x1a2542,_0x2ffbdc[_0x0014('0x9')]);_0x42accd();})['catch'](function(_0x2e8a8b){logger[_0x0014('0xd')](_0x0014('0xe'),_0x1a2542,JSON[_0x0014('0xf')](_0x2e8a8b));_0x4a8ebf(_0x2e8a8b);});});}exports[_0x0014('0x10')]=function(_0x10bae2,_0x51ecd5){return function(_0x26ee5f){try{if(!_[_0x0014('0x11')](this[_0x0014('0x12')][_0x0014('0x13')])){logger[_0x0014('0xc')](_0x0014('0xe'),_0x10bae2,_0x0014('0x14'));return _0x26ee5f[_0x0014('0x15')]();}var _0x56a300={'ContactId':this[_0x0014('0x16')]['id'],'sentAt':moment()[_0x0014('0x17')](_0x0014('0x18')),'direction':_0x0014('0x19')};if(this[_0x0014('0x1a')]==='sms'||this[_0x0014('0x1a')]===_0x0014('0x1b')){_0x56a300[_0x0014('0x1c')]=this['interaction']['phone'];}var _0xee2c19=this[_0x0014('0x1a')];if(_0xee2c19==='chat'){_0x56a300[_0x0014('0x1d')]=this[_0x0014('0x1e')]['id'];}else{_0x56a300[_[_0x0014('0x1f')](_0xee2c19)+'AccountId']=this[_0x0014('0x1e')]['id'];}_0x56a300[_[_0x0014('0x1f')](_0xee2c19)+_0x0014('0x20')]=this['interaction']['id'];if(this[_0x0014('0x12')][_0x0014('0x21')]){var _0x4084e6=_0x51ecd5[0x4];if(!_[_0x0014('0x22')](_0x4084e6)){_0x56a300[_0x0014('0x9')]=utils[_0x0014('0x23')](_0x4084e6,this);return rpc[_0xee2c19+_0x0014('0x24')][_0x0014('0xa')](_0x56a300)[_0x0014('0xb')](function(_0x144a70){logger['info'](_0x0014('0xe'),_0x10bae2,_0x56a300['body']);})['catch'](function(_0x45ed7e){logger[_0x0014('0xd')]('[%s][DIALOGFLOWV2]\x20%s',_0x10bae2,JSON[_0x0014('0xf')](_0x45ed7e));})[_0x0014('0x25')](function(){logger['info']('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x10bae2);_0x26ee5f[_0x0014('0x26')]();});}else{logger[_0x0014('0xc')](_0x0014('0x27'),_0x10bae2);_0x26ee5f[_0x0014('0x26')]();}}else{var _0x439b13=this;var _0x4e4460=_0x51ecd5[0x2][_0x0014('0x28')](/\\n/g,'\x0a');var _0x338c99={'credentials':{'private_key':_0x4e4460,'client_email':_0x51ecd5[0x1]}};var _0x44f6ae=new dialogflow['SessionsClient'](_0x338c99);var _0x70ddac=_0x44f6ae['sessionPath'](_0x51ecd5[0x0],md5(_0x439b13[_0x0014('0x12')]['id']));var _0x57713a={'session':_0x70ddac,'queryInput':{'text':{'text':_0x439b13[_0x0014('0x29')]['body'],'languageCode':_0x51ecd5[0x3]||'en'}}};return _0x44f6ae[_0x0014('0x2a')](_0x57713a)[_0x0014('0xb')](function(_0x4545c0){if(_0x4545c0&&_0x4545c0[_0x0014('0x2b')]){_0x439b13[_0x0014('0x9')][_0x0014('0x2c')]=_0x4545c0;var _0x423ebb=_0x4545c0[0x0];var _0x3878d1=_0x423ebb[_0x0014('0x2d')][_0x0014('0x2e')]&&_0x423ebb[_0x0014('0x2d')][_0x0014('0x2e')]['fields']?_0x423ebb[_0x0014('0x2d')][_0x0014('0x2e')][_0x0014('0x2f')][_0x0014('0x30')][_0x0014('0x31')]:![];_0x439b13[_0x0014('0x9')][_0x0014('0x32')]=_0x423ebb[_0x0014('0x2d')][_0x0014('0x33')];_0x439b13[_0x0014('0x9')][_0x0014('0x34')]=_0x423ebb[_0x0014('0x2d')][_0x0014('0x35')];_0x439b13[_0x0014('0x9')][_0x0014('0x36')]=_0x423ebb[_0x0014('0x2d')][_0x0014('0x2e')]&&_0x423ebb[_0x0014('0x2d')][_0x0014('0x2e')]['fields']?_0x423ebb[_0x0014('0x2d')][_0x0014('0x2e')]['fields']['end_conversation']['boolValue']:![];_0x439b13[_0x0014('0x9')]['DIALOGFLOWV2_INTENTNAME']=_0x423ebb[_0x0014('0x2d')][_0x0014('0x37')][_0x0014('0x38')];_0x439b13['body']['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x423ebb[_0x0014('0x2d')][_0x0014('0x37')][_0x0014('0x39')];_0x439b13['body'][_0x0014('0x3a')]=_0x423ebb[_0x0014('0x2d')]['intent'][_0x0014('0x3b')];_0x439b13[_0x0014('0x9')][_0x0014('0x3c')]=_0x423ebb['queryResult'][_0x0014('0x3d')];_0x439b13[_0x0014('0x9')][_0x0014('0x3e')]=_0x423ebb['queryResult'][_0x0014('0x3f')];_0x439b13['body'][_0x0014('0x40')]=_0x423ebb[_0x0014('0x2d')][_0x0014('0x41')];_0x56a300[_0x0014('0x42')]='dialogflowV2';_0x56a300[_0x0014('0x43')]=JSON['stringify'](_0x4545c0);var _0x3284f8=[];for(var _0x15fdb7=0x0;_0x15fdb7<_0x4545c0[_0x0014('0x2b')];_0x15fdb7++){var _0x55d3e0=_0x4545c0[_0x15fdb7];if(_0x55d3e0&&_0x55d3e0['queryResult']&&_0x55d3e0[_0x0014('0x2d')][_0x0014('0x44')]){_0x3284f8[_0x0014('0x45')](createMessage(_0x10bae2,_0xee2c19,_0x56a300,_0x55d3e0[_0x0014('0x2d')][_0x0014('0x44')]));}}return Promise[_0x0014('0x46')](_0x3284f8)[_0x0014('0xb')](function(){if(_0x3878d1){_0x26ee5f[_0x0014('0x15')]();}else{_0x26ee5f['stop']();}})['catch'](function(_0x323587){logger[_0x0014('0xd')](_0x0014('0xe'),_0x10bae2,JSON[_0x0014('0xf')](_0x323587));_0x26ee5f[_0x0014('0x15')]();});}})[_0x0014('0x47')](function(_0xf609bf){logger[_0x0014('0xd')](_0x0014('0xe'),_0x10bae2,_0xf609bf['message']);_0x26ee5f[_0x0014('0x15')]();});}}catch(_0x1d9582){logger['error'](_0x0014('0xe'),_0x10bae2,JSON['stringify'](_0x1d9582));_0x26ee5f['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 38986e8..9a6b3eb 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 _0x3b1d=['info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','next','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stop','stringify','validate','lodash','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s','map','message','join','condition','priorityTrue','priorityFalse'];(function(_0x4c9465,_0x112fac){var _0x329d86=function(_0x16e613){while(--_0x16e613){_0x4c9465['push'](_0x4c9465['shift']());}};_0x329d86(++_0x112fac);}(_0x3b1d,0x1bd));var _0xd3b1=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x3b1d[_0x51020b];return _0x371e47;};'use strict';var schema=require(_0xd3b1('0x0'));var _=require(_0xd3b1('0x1'));var htmlToText=require('html-to-text');var utils=require(_0xd3b1('0x2'));var logger=require(_0xd3b1('0x3'))('routing');var gotoif=schema({'condition':{'type':_0xd3b1('0x4'),'required':!![],'message':_0xd3b1('0x5')},'priorityTrue':{'type':_0xd3b1('0x6'),'message':_0xd3b1('0x7')},'priorityFalse':{'type':_0xd3b1('0x6'),'message':_0xd3b1('0x8')}});exports['consequence']=function(_0xf1a9ec,_0x2377ee){return function(_0x39b15d){try{var _0x2147e1={'condition':htmlToText[_0xd3b1('0x9')](utils[_0xd3b1('0xa')](_0x2377ee[0x0],this),{'wordwrap':![]})[_0xd3b1('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2377ee[0x1],'priorityFalse':_0x2377ee[0x2]};var _0x26cd6c=gotoif[_0xd3b1('0x0')](_0x2147e1,{'typecast':!![]});if(_0x26cd6c[_0xd3b1('0xc')]){logger['error'](_0xd3b1('0xd'),_0xf1a9ec,_[_0xd3b1('0xe')](_0x26cd6c,_0xd3b1('0xf'))[_0xd3b1('0x10')](',\x20'));_0x39b15d['stop']();}else{try{var _0x28d1ff=eval('('+_0x2147e1[_0xd3b1('0x11')]+')');var _0x5ad077=_0x28d1ff?_0x2147e1[_0xd3b1('0x12')]:_0x2147e1[_0xd3b1('0x13')];logger[_0xd3b1('0x14')](_0xd3b1('0x15'),_0xf1a9ec,_0x2147e1[_0xd3b1('0x11')],_0x28d1ff,_0x5ad077||'next');if(_0x5ad077){var _0x315a6f=_[_0xd3b1('0x16')](_0x39b15d[_0xd3b1('0x17')](),{'p':_0x5ad077});if(_0x315a6f>=0x0){logger[_0xd3b1('0x14')](_0xd3b1('0x18'),_0xf1a9ec,_0x5ad077||'next',_0x315a6f);_0x39b15d['next'](_0x315a6f);}else{logger[_0xd3b1('0x14')](_0xd3b1('0x19'),_0xf1a9ec,_0x5ad077||_0xd3b1('0x1a'));_0x39b15d['stop']();}}else{_0x39b15d[_0xd3b1('0x1a')]();}}catch(_0x2c48aa){logger[_0xd3b1('0x1b')](_0xd3b1('0x1c'),_0xf1a9ec,_0x2c48aa['message']);_0x39b15d[_0xd3b1('0x1d')]();}}}catch(_0x870ab){logger[_0xd3b1('0x1b')]('[%s][GOTOIF]\x20%s',_0xf1a9ec,JSON[_0xd3b1('0x1e')](_0x870ab));_0x39b15d[_0xd3b1('0x1d')]();}};}; \ No newline at end of file +var _0x5b69=['map','join','stop','condition','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','stringify','validate','lodash','html-to-text','./utils','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','error','[%s][GOTOIF]\x20%s'];(function(_0x535271,_0x3b8738){var _0x414e51=function(_0x2fbd40){while(--_0x2fbd40){_0x535271['push'](_0x535271['shift']());}};_0x414e51(++_0x3b8738);}(_0x5b69,0xd1));var _0x95b6=function(_0x2d2498,_0x26426d){_0x2d2498=_0x2d2498-0x0;var _0x447a5b=_0x5b69[_0x2d2498];return _0x447a5b;};'use strict';var schema=require(_0x95b6('0x0'));var _=require(_0x95b6('0x1'));var htmlToText=require(_0x95b6('0x2'));var utils=require(_0x95b6('0x3'));var logger=require('../../../../config/logger')('routing');var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x95b6('0x4')},'priorityTrue':{'type':'number','message':_0x95b6('0x5')},'priorityFalse':{'type':'number','message':_0x95b6('0x6')}});exports[_0x95b6('0x7')]=function(_0x499fa8,_0x54591d){return function(_0xf930e2){try{var _0x375a3e={'condition':htmlToText['fromString'](utils[_0x95b6('0x8')](_0x54591d[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x54591d[0x1],'priorityFalse':_0x54591d[0x2]};var _0x269ec0=gotoif[_0x95b6('0x0')](_0x375a3e,{'typecast':!![]});if(_0x269ec0['length']){logger[_0x95b6('0x9')](_0x95b6('0xa'),_0x499fa8,_[_0x95b6('0xb')](_0x269ec0,'message')[_0x95b6('0xc')](',\x20'));_0xf930e2[_0x95b6('0xd')]();}else{try{var _0x646565=eval('('+_0x375a3e[_0x95b6('0xe')]+')');var _0x573988=_0x646565?_0x375a3e[_0x95b6('0xf')]:_0x375a3e[_0x95b6('0x10')];logger['info'](_0x95b6('0x11'),_0x499fa8,_0x375a3e[_0x95b6('0xe')],_0x646565,_0x573988||_0x95b6('0x12'));if(_0x573988){var _0x18af8d=_['findIndex'](_0xf930e2['rules'](),{'p':_0x573988});if(_0x18af8d>=0x0){logger[_0x95b6('0x13')](_0x95b6('0x14'),_0x499fa8,_0x573988||_0x95b6('0x12'),_0x18af8d);_0xf930e2[_0x95b6('0x12')](_0x18af8d);}else{logger[_0x95b6('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x499fa8,_0x573988||_0x95b6('0x12'));_0xf930e2['stop']();}}else{_0xf930e2['next']();}}catch(_0x139399){logger['error']('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x499fa8,_0x139399['message']);_0xf930e2['stop']();}}}catch(_0x383f68){logger[_0x95b6('0x9')](_0x95b6('0xa'),_0x499fa8,JSON[_0x95b6('0x15')](_0x383f68));_0xf930e2['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 0fbed9e..77de541 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 _0x0528=['stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','validate','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','join'];(function(_0x277357,_0x12a766){var _0x27f97f=function(_0xeb024d){while(--_0xeb024d){_0x277357['push'](_0x277357['shift']());}};_0x27f97f(++_0x12a766);}(_0x0528,0x14b));var _0x8052=function(_0x2ef0a1,_0x54b424){_0x2ef0a1=_0x2ef0a1-0x0;var _0x44a1e1=_0x0528[_0x2ef0a1];return _0x44a1e1;};'use strict';var schema=require(_0x8052('0x0'));var _=require('lodash');var logger=require(_0x8052('0x1'))(_0x8052('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x8052('0x3')}});exports[_0x8052('0x4')]=function(_0x57f977,_0x285fe1){return function(_0x2d4316){try{var _0x118b4c={'priority':_0x285fe1[0x0]};var _0x48822f=gotop['validate'](_0x118b4c,{'typecast':!![]});if(_0x48822f[_0x8052('0x5')]){logger[_0x8052('0x6')](_0x8052('0x7'),_0x57f977,_[_0x8052('0x8')](_0x48822f,_0x8052('0x9'))[_0x8052('0xa')](',\x20'));_0x2d4316[_0x8052('0xb')]();}else{logger[_0x8052('0xc')](_0x8052('0xd'),_0x57f977,_0x118b4c['priority']);if(_0x118b4c[_0x8052('0xe')]){var _0x1963ec=_[_0x8052('0xf')](_0x2d4316[_0x8052('0x10')](),{'p':_0x118b4c[_0x8052('0xe')]});if(_0x1963ec>=0x0){logger[_0x8052('0xc')](_0x8052('0x11'),_0x57f977,_0x118b4c[_0x8052('0xe')]||_0x8052('0x12'),_0x1963ec);_0x2d4316[_0x8052('0x12')](_0x1963ec);}else{logger[_0x8052('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x57f977,_0x118b4c['priority']||_0x8052('0x12'));_0x2d4316[_0x8052('0xb')]();}}else{_0x2d4316[_0x8052('0x12')]();}}}catch(_0x589767){logger[_0x8052('0x6')](_0x8052('0x7'),_0x57f977,JSON['stringify'](_0x589767));_0x2d4316['stop']();}};}; \ No newline at end of file +var _0x75d9=['rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex'];(function(_0x32d518,_0x4d0b2d){var _0x2960e2=function(_0x145b6e){while(--_0x145b6e){_0x32d518['push'](_0x32d518['shift']());}};_0x2960e2(++_0x4d0b2d);}(_0x75d9,0xfd));var _0x975d=function(_0x393d69,_0x3a8c83){_0x393d69=_0x393d69-0x0;var _0x3cee37=_0x75d9[_0x393d69];return _0x3cee37;};'use strict';var schema=require(_0x975d('0x0'));var _=require(_0x975d('0x1'));var logger=require(_0x975d('0x2'))(_0x975d('0x3'));var gotop=schema({'priority':{'type':_0x975d('0x4'),'required':!![],'message':_0x975d('0x5')}});exports[_0x975d('0x6')]=function(_0x4a5676,_0x2c3b93){return function(_0x23d9a9){try{var _0x853885={'priority':_0x2c3b93[0x0]};var _0xcbc63b=gotop['validate'](_0x853885,{'typecast':!![]});if(_0xcbc63b['length']){logger[_0x975d('0x7')](_0x975d('0x8'),_0x4a5676,_['map'](_0xcbc63b,'message')['join'](',\x20'));_0x23d9a9[_0x975d('0x9')]();}else{logger['info'](_0x975d('0xa'),_0x4a5676,_0x853885[_0x975d('0xb')]);if(_0x853885[_0x975d('0xb')]){var _0x44ae99=_[_0x975d('0xc')](_0x23d9a9[_0x975d('0xd')](),{'p':_0x853885[_0x975d('0xb')]});if(_0x44ae99>=0x0){logger[_0x975d('0xe')](_0x975d('0xf'),_0x4a5676,_0x853885[_0x975d('0xb')]||'next',_0x44ae99);_0x23d9a9[_0x975d('0x10')](_0x44ae99);}else{logger[_0x975d('0xe')](_0x975d('0x11'),_0x4a5676,_0x853885['priority']||_0x975d('0x10'));_0x23d9a9['stop']();}}else{_0x23d9a9['next']();}}}catch(_0xd74ab3){logger[_0x975d('0x7')](_0x975d('0x8'),_0x4a5676,JSON[_0x975d('0x12')](_0xd74ab3));_0x23d9a9['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index a96d590..979d9d4 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 _0x8da1=['account','AccountId','upperFirst','InteractionId','interaction','Message','then','info','[%s][MESSAGE]\x20%s','next','catch','stringify','stop','error','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','contact','channel'];(function(_0x4a743a,_0x1e50d9){var _0x4afe83=function(_0x54719a){while(--_0x54719a){_0x4a743a['push'](_0x4a743a['shift']());}};_0x4afe83(++_0x1e50d9);}(_0x8da1,0x1a6));var _0x18da=function(_0x2ad3fd,_0x24c202){_0x2ad3fd=_0x2ad3fd-0x0;var _0x30fe82=_0x8da1[_0x2ad3fd];return _0x30fe82;};'use strict';var _=require('lodash');var utils=require('./utils');var logger=require(_0x18da('0x0'))(_0x18da('0x1'));var rpc={'chatMessage':require(_0x18da('0x2')),'openchannelMessage':require(_0x18da('0x3')),'mailMessage':require(_0x18da('0x4')),'smsMessage':require(_0x18da('0x5')),'faxMessage':require(_0x18da('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x18da('0x7')]=function(_0x3a092f,_0x55bc03){return function(_0x19cb82){try{var _0x5e55d0={'body':utils['getMustacheRender'](_0x55bc03[0x0],this),'ContactId':this[_0x18da('0x8')]['id']};if(this[_0x18da('0x9')]==='chat'){_0x5e55d0['ChatWebsiteId']=this[_0x18da('0xa')]['id'];}else{_0x5e55d0[_['upperFirst'](this[_0x18da('0x9')])+_0x18da('0xb')]=this['account']['id'];}_0x5e55d0[_[_0x18da('0xc')](this[_0x18da('0x9')])+_0x18da('0xd')]=this[_0x18da('0xe')]['id'];if(rpc[this['channel']+_0x18da('0xf')]){return rpc[this[_0x18da('0x9')]+'Message']['create'](_0x5e55d0)[_0x18da('0x10')](function(_0x2c1032){logger[_0x18da('0x11')](_0x18da('0x12'),_0x3a092f,_0x5e55d0['body']);_0x19cb82[_0x18da('0x13')]();})[_0x18da('0x14')](function(_0x4a5fe7){logger['error']('[%s][MESSAGE]\x20%s',_0x3a092f,JSON[_0x18da('0x15')](_0x4a5fe7));_0x19cb82[_0x18da('0x16')]();});}}catch(_0x4120c2){logger[_0x18da('0x17')](_0x18da('0x12'),_0x3a092f,JSON['stringify'](_0x4120c2));_0x19cb82['stop']();}};}; \ No newline at end of file +var _0x930e=['upperFirst','InteractionId','interaction','info','[%s][MESSAGE]\x20%s','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','channel','chat','account'];(function(_0x31991b,_0xaf75d2){var _0x307304=function(_0x2f36c5){while(--_0x2f36c5){_0x31991b['push'](_0x31991b['shift']());}};_0x307304(++_0xaf75d2);}(_0x930e,0x66));var _0xe930=function(_0x51a57a,_0x4b50ea){_0x51a57a=_0x51a57a-0x0;var _0x30324e=_0x930e[_0x51a57a];return _0x30324e;};'use strict';var _=require(_0xe930('0x0'));var utils=require(_0xe930('0x1'));var logger=require(_0xe930('0x2'))('routing');var rpc={'chatMessage':require(_0xe930('0x3')),'openchannelMessage':require(_0xe930('0x4')),'mailMessage':require(_0xe930('0x5')),'smsMessage':require(_0xe930('0x6')),'faxMessage':require(_0xe930('0x7')),'whatsappMessage':require(_0xe930('0x8'))};exports['consequence']=function(_0x39bdcc,_0x3ddc5d){return function(_0x2ea589){try{var _0x453cf7={'body':utils[_0xe930('0x9')](_0x3ddc5d[0x0],this),'ContactId':this['contact']['id']};if(this[_0xe930('0xa')]===_0xe930('0xb')){_0x453cf7['ChatWebsiteId']=this[_0xe930('0xc')]['id'];}else{_0x453cf7[_[_0xe930('0xd')](this[_0xe930('0xa')])+'AccountId']=this[_0xe930('0xc')]['id'];}_0x453cf7[_['upperFirst'](this['channel'])+_0xe930('0xe')]=this[_0xe930('0xf')]['id'];if(rpc[this['channel']+'Message']){return rpc[this[_0xe930('0xa')]+'Message']['create'](_0x453cf7)['then'](function(_0xf126a6){logger[_0xe930('0x10')](_0xe930('0x11'),_0x39bdcc,_0x453cf7['body']);_0x2ea589[_0xe930('0x12')]();})[_0xe930('0x13')](function(_0x4eadb8){logger[_0xe930('0x14')](_0xe930('0x11'),_0x39bdcc,JSON['stringify'](_0x4eadb8));_0x2ea589['stop']();});}}catch(_0x4271cf){logger[_0xe930('0x14')](_0xe930('0x11'),_0x39bdcc,JSON[_0xe930('0x15')](_0x4271cf));_0x2ea589[_0xe930('0x16')]();}};}; \ 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 9500ec2..31aa847 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 _0x953d=['next','error','stringify','stop','./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s'];(function(_0x2e5f98,_0x2ad773){var _0x38fc1c=function(_0xc0cd1b){while(--_0xc0cd1b){_0x2e5f98['push'](_0x2e5f98['shift']());}};_0x38fc1c(++_0x2ad773);}(_0x953d,0x1a8));var _0xd953=function(_0x34ebf3,_0x5935c5){_0x34ebf3=_0x34ebf3-0x0;var _0x3a634d=_0x953d[_0x34ebf3];return _0x3a634d;};'use strict';var utils=require(_0xd953('0x0'));var logger=require(_0xd953('0x1'))(_0xd953('0x2'));exports[_0xd953('0x3')]=function(_0x47e3b9,_0x24e1c3){return function(_0x2456fa){try{logger[_0xd953('0x4')](_0xd953('0x5'),_0x47e3b9,utils['getMustacheRender'](_0x24e1c3[0x0],this));_0x2456fa[_0xd953('0x6')]();}catch(_0x49969e){logger[_0xd953('0x7')](_0xd953('0x5'),_0x47e3b9,JSON[_0xd953('0x8')](_0x49969e));_0x2456fa[_0xd953('0x9')]();}};}; \ No newline at end of file +var _0x5c50=['getMustacheRender','next','error','stringify','stop','./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s'];(function(_0x552eb7,_0x3b5466){var _0x1e78c0=function(_0x466137){while(--_0x466137){_0x552eb7['push'](_0x552eb7['shift']());}};_0x1e78c0(++_0x3b5466);}(_0x5c50,0x1f4));var _0x05c5=function(_0x170772,_0x1f1ee7){_0x170772=_0x170772-0x0;var _0x3ef69c=_0x5c50[_0x170772];return _0x3ef69c;};'use strict';var utils=require(_0x05c5('0x0'));var logger=require(_0x05c5('0x1'))(_0x05c5('0x2'));exports[_0x05c5('0x3')]=function(_0x30b191,_0x59b27a){return function(_0x14b6da){try{logger[_0x05c5('0x4')](_0x05c5('0x5'),_0x30b191,utils[_0x05c5('0x6')](_0x59b27a[0x0],this));_0x14b6da[_0x05c5('0x7')]();}catch(_0x16d563){logger[_0x05c5('0x8')](_0x05c5('0x5'),_0x30b191,JSON[_0x05c5('0x9')](_0x16d563));_0x14b6da[_0x05c5('0xa')]();}};}; \ 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 74757d1..40951b4 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 _0xd5ad=['QueueReport','create','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','body','catch','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','timeout','createQueue','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','queue_id','account','queue','from','joinAt','emit','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','waiting','YYYY-MM-DD\x20HH:mm:ss','contact','list','QueueId','upperFirst','channel','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xd5ad,0xbc));var _0xdd5a=function(_0x526514,_0x53c71a){_0x526514=_0x526514-0x0;var _0x4d7258=_0xd5ad[_0x526514];return _0x4d7258;};'use strict';var schema=require(_0xdd5a('0x0'));var _=require(_0xdd5a('0x1'));var util=require(_0xdd5a('0x2'));var seqqueue=require(_0xdd5a('0x3'));var moment=require(_0xdd5a('0x4'));var Redis=require(_0xdd5a('0x5'));var config=require(_0xdd5a('0x6'));var logger=require(_0xdd5a('0x7'))(_0xdd5a('0x8'));var strategy=require(_0xdd5a('0x9'));config[_0xdd5a('0xa')]=_[_0xdd5a('0xb')](config['redis'],{'host':_0xdd5a('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdd5a('0xa')]));var attributes=['id',_0xdd5a('0xd'),_0xdd5a('0xe'),_0xdd5a('0xf'),_0xdd5a('0x10'),_0xdd5a('0x11')];function emit(_0x302ed1,_0x51108d,_0x6c07f5){io['to'](_0x302ed1)[_0xdd5a('0x12')](_0x51108d,_0x6c07f5);}function emitChannelQueueInteraction(_0x36de19,_0x3a6e6a,_0x4e9ca7,_0x5c3f7b,_0x5a9d88,_0x202da8,_0x31b420,_0x54083d){var _0x4959a5=_[_0xdd5a('0x13')](_0x4e9ca7);_0x4959a5[_0xdd5a('0xd')]=_0x54083d;_0x4959a5[_0xdd5a('0xf')]=_0x3a6e6a;_0x4959a5['account']=_0x5c3f7b;_0x4959a5['id']=_0x5a9d88;if(_0x202da8){_0x31b420[util[_0xdd5a('0x14')](_0xdd5a('0x15'),_0x36de19)][_0x5a9d88]=_[_0xdd5a('0x16')](_0x4959a5,attributes);}else{delete _0x31b420[util['format'](_0xdd5a('0x15'),_0x36de19)][_0x5a9d88];}emit(util['format'](_0xdd5a('0x17'),_0x36de19,_0x3a6e6a),util[_0xdd5a('0x14')](_0xdd5a('0x18'),_0x36de19,_0x202da8?_0xdd5a('0x19'):_0xdd5a('0x1a')),_[_0xdd5a('0x16')](_0x4959a5,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xdd5a('0x1b')),'chatQueueReport':require(_0xdd5a('0x1c')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0xdd5a('0x1d')),'whatsappQueueReport':require(_0xdd5a('0x1e'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0xdd5a('0x1f')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x1142af,_0x1fc6e0,_0x4f7664,_0x3437b9){if(_0x1142af&&_0x1fc6e0&&_0x4f7664){_0x1fc6e0[_0xdd5a('0x20')]+=0x1;var _0x33758b={'uniqueid':_0x1142af,'from':_0x4f7664['body']?_0x4f7664['body']['from']:'','joinAt':moment()[_0xdd5a('0x14')](_0xdd5a('0x21')),'ContactId':_0x4f7664[_0xdd5a('0x22')]?_0x4f7664[_0xdd5a('0x22')]['id']:null,'ListId':_0x4f7664['list']?_0x4f7664[_0xdd5a('0x23')]['id']:null};_0x33758b[_['upperFirst'](_0x4f7664['channel'])+_0xdd5a('0x24')]=_0x1fc6e0['id']||null;_0x33758b[_[_0xdd5a('0x25')](_0x4f7664[_0xdd5a('0x26')])+'InteractionId']=_0x4f7664['interaction']?_0x4f7664['interaction']['id']:null;_0x33758b[_[_0xdd5a('0x25')](_0x4f7664[_0xdd5a('0x26')])+'MessageId']=_0x4f7664['message']?_0x4f7664[_0xdd5a('0x27')]['id']:null;_0x33758b[_[_0xdd5a('0x25')](_0x4f7664[_0xdd5a('0x26')])+(_0x4f7664[_0xdd5a('0x26')]!==_0xdd5a('0x28')?_0xdd5a('0x29'):_0xdd5a('0x2a'))]=_0x4f7664[_0xdd5a('0xe')]?_0x4f7664[_0xdd5a('0xe')]['id']:null;logger[_0xdd5a('0x2b')](util[_0xdd5a('0x14')](_0xdd5a('0x2c'),_0x1142af,_0x1fc6e0[_0xdd5a('0x2d')]));emitChannelQueueInteraction(_0x4f7664[_0xdd5a('0x26')],_0x1fc6e0[_0xdd5a('0x2d')],_0x33758b,_0x4f7664[_0xdd5a('0xe')][_0xdd5a('0x2d')],_0x4f7664[_0xdd5a('0x27')]['id'],!![],_0x3437b9,_0x1fc6e0['id']);if(rpc[_0x4f7664[_0xdd5a('0x26')]+_0xdd5a('0x2e')]){return rpc[_0x4f7664[_0xdd5a('0x26')]+_0xdd5a('0x2e')][_0xdd5a('0x2f')](_0x33758b)['catch'](function(_0x94dd66){logger[_0xdd5a('0x30')](_0xdd5a('0x31'));});}}}function stopRouting(_0x3001fc,_0x2f196e,_0x2b3d04,_0x3f9aa9){if(_0x3001fc&&_0x2f196e){_0x2f196e[_0xdd5a('0x20')]-=0x1;var _0x13282b={'leaveAt':moment()[_0xdd5a('0x14')](_0xdd5a('0x21')),'acceptAt':moment()['format'](_0xdd5a('0x21')),'reason':_0xdd5a('0x32')};logger[_0xdd5a('0x2b')](util[_0xdd5a('0x14')](_0xdd5a('0x33'),_0x3001fc,_0x2f196e[_0xdd5a('0x2d')]));emitChannelQueueInteraction(_0x2b3d04[_0xdd5a('0x26')],_0x2f196e['name'],_0x2b3d04[_0xdd5a('0x34')],_0x2b3d04[_0xdd5a('0xe')]['name'],_0x2b3d04[_0xdd5a('0x27')]['id'],![],_0x3f9aa9,_0x2f196e['id']);if(rpc[_0x2b3d04[_0xdd5a('0x26')]+_0xdd5a('0x2e')]){return rpc[_0x2b3d04['channel']+_0xdd5a('0x2e')]['update'](_0x3001fc,_0x13282b)[_0xdd5a('0x35')](function(_0x5943fc){logger[_0xdd5a('0x30')](_0xdd5a('0x36'));});}}}function endRouting(_0x4aada1,_0x68c31,_0xccb7b3,_0x541f51){if(_0x4aada1&&_0x68c31){_0x68c31[_0xdd5a('0x20')]-=0x1;var _0x2e160c={'leaveAt':moment()[_0xdd5a('0x14')](_0xdd5a('0x21')),'exitAt':moment()[_0xdd5a('0x14')](_0xdd5a('0x21')),'reason':'timeout'};logger['info'](util['format'](_0xdd5a('0x37'),_0x4aada1,_0x68c31[_0xdd5a('0x2d')]));emitChannelQueueInteraction(_0xccb7b3[_0xdd5a('0x26')],_0x68c31['name'],_0xccb7b3[_0xdd5a('0x34')],_0xccb7b3[_0xdd5a('0xe')][_0xdd5a('0x2d')],_0xccb7b3[_0xdd5a('0x27')]['id'],![],_0x541f51);if(rpc[_0xccb7b3[_0xdd5a('0x26')]+'QueueReport']){return rpc[_0xccb7b3[_0xdd5a('0x26')]+_0xdd5a('0x2e')]['update'](_0x4aada1,_0x2e160c)[_0xdd5a('0x35')](function(_0x288a71){logger[_0xdd5a('0x30')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x4ce518){return function(_0x51b78a){return _0x51b78a[_0xdd5a('0x2d')][_0xdd5a('0x38')]()===_0x4ce518[_0xdd5a('0x38')]();};}exports[_0xdd5a('0x39')]=function(_0x3b5ed6,_0x2d53d1,_0x1bd4d2,_0xf740c8){return function(_0x2a71ac){try{var _0x157a99={'name':_0x2d53d1[0x0],'timeout':_0x2d53d1[0x1]};var _0x135ab6=queue['validate'](_0x157a99,{'typecast':!![]});if(_0x135ab6[_0xdd5a('0x3a')]){logger[_0xdd5a('0x30')](_0xdd5a('0x3b'),_0x3b5ed6,_[_0xdd5a('0x3c')](_0x135ab6,_0xdd5a('0x27'))[_0xdd5a('0x3d')](',\x20'));_0x2a71ac[_0xdd5a('0x3e')]();}else{var _0xfdc0f3=_['find'](_0x1bd4d2[_0xf740c8['channel']+'Queues'],handleFindQueue(_0x157a99[_0xdd5a('0x2d')]));if(_0xfdc0f3){startRouting(_0x3b5ed6,_0xfdc0f3,_0xf740c8,_0x1bd4d2);var _0x21b053=(_0xfdc0f3[_0xdd5a('0x3f')]||0xa)*0x3e8;var _0x4ffd18=(_0x157a99[_0xdd5a('0x3f')]||0x14)*0x3e8;var _0x327582,_0x47fc7d;if(_0x21b053>_0x4ffd18){_0x4ffd18=_0x21b053;}var _0x580c86=seqqueue[_0xdd5a('0x40')](_0x21b053);_0x580c86['id']=_0x3b5ed6;_0x580c86['atimeout']=_0x21b053;_0x580c86[_0xdd5a('0x41')]=_0x4ffd18;_0x580c86[_0xdd5a('0x26')]=_0xf740c8[_0xdd5a('0x26')];_0x1bd4d2['rules'][_0x3b5ed6]['on'](_0xdd5a('0x42'),function(){logger['info'](_0xdd5a('0x43'),_0x3b5ed6);stopRouting(_0x3b5ed6,_0xfdc0f3,_0xf740c8,_0x1bd4d2);clearTimeout(_0x327582);_0x327582=undefined;_0x580c86[_0xdd5a('0x44')](!![]);if(_0x1bd4d2[_0xdd5a('0x45')][_0x3b5ed6]){delete _0x1bd4d2['rules'][_0x3b5ed6];}_0x2a71ac['stop']();});_0x1bd4d2['rules'][_0x3b5ed6]['on'](_0xdd5a('0x46'),function(){if(_0x1bd4d2['rules'][_0x3b5ed6]){delete _0x1bd4d2[_0xdd5a('0x45')][_0x3b5ed6];}});_0x327582=setTimeout(function(){logger[_0xdd5a('0x2b')](_0xdd5a('0x47'),_0x3b5ed6);endRouting(_0x3b5ed6,_0xfdc0f3,_0xf740c8,_0x1bd4d2);clearTimeout(_0x327582);_0x580c86[_0xdd5a('0x44')](!![]);_0x2a71ac['next']();},_0x4ffd18);switch(_0xfdc0f3[_0xdd5a('0x48')]){case _0xdd5a('0x49'):strategy[_0xdd5a('0x49')](_0x580c86,_0xfdc0f3,_0x1bd4d2,_0xf740c8);break;default:strategy[_0xdd5a('0x4a')](_0x580c86,_0xfdc0f3,_0x1bd4d2,_0xf740c8);}}else{logger[_0xdd5a('0x30')](_0xdd5a('0x4b'),_0x3b5ed6,_0x157a99['name']);_0x2a71ac[_0xdd5a('0x3e')]();}}}catch(_0x5729d2){console[_0xdd5a('0x4c')](_0x5729d2);logger['error'](_0xdd5a('0x3b'),_0x3b5ed6,_0x5729d2[_0xdd5a('0x4d')]);_0x2a71ac[_0xdd5a('0x3e')]();}};}; \ No newline at end of file +var _0xd882=['catch','error','accepted','[%s][STOP:QUEUE][NAME:%s]','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence','length','map','join','stop','Queues','createQueue','atimeout','qtimeout','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','moment','../../../../config/logger','routing','./strategy','redis','localhost','queue_id','account','queue','joinAt','clone','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create'];(function(_0x54a2e4,_0x1ff92c){var _0x4742d0=function(_0x147a6f){while(--_0x147a6f){_0x54a2e4['push'](_0x54a2e4['shift']());}};_0x4742d0(++_0x1ff92c);}(_0xd882,0xf8));var _0x2d88=function(_0x1eced4,_0xc5070f){_0x1eced4=_0x1eced4-0x0;var _0x1a91e5=_0xd882[_0x1eced4];return _0x1a91e5;};'use strict';var schema=require(_0x2d88('0x0'));var _=require(_0x2d88('0x1'));var util=require(_0x2d88('0x2'));var seqqueue=require('seq-queue');var moment=require(_0x2d88('0x3'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0x2d88('0x4'))(_0x2d88('0x5'));var strategy=require(_0x2d88('0x6'));config['redis']=_['defaults'](config[_0x2d88('0x7')],{'host':_0x2d88('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2d88('0x7')]));var attributes=['id',_0x2d88('0x9'),_0x2d88('0xa'),_0x2d88('0xb'),'from',_0x2d88('0xc')];function emit(_0x5ac237,_0x374a78,_0x4c1f6c){io['to'](_0x5ac237)['emit'](_0x374a78,_0x4c1f6c);}function emitChannelQueueInteraction(_0x2e92cb,_0xc341,_0x3e3857,_0x80d92,_0x1a7cfb,_0x298485,_0x30ac04,_0x515985){var _0x345af7=_[_0x2d88('0xd')](_0x3e3857);_0x345af7[_0x2d88('0x9')]=_0x515985;_0x345af7[_0x2d88('0xb')]=_0xc341;_0x345af7[_0x2d88('0xa')]=_0x80d92;_0x345af7['id']=_0x1a7cfb;if(_0x298485){_0x30ac04[util[_0x2d88('0xe')]('%sQueuesWaitingInteractions',_0x2e92cb)][_0x1a7cfb]=_[_0x2d88('0xf')](_0x345af7,attributes);}else{delete _0x30ac04[util[_0x2d88('0xe')](_0x2d88('0x10'),_0x2e92cb)][_0x1a7cfb];}emit(util[_0x2d88('0xe')](_0x2d88('0x11'),_0x2e92cb,_0xc341),util['format'](_0x2d88('0x12'),_0x2e92cb,_0x298485?'save':_0x2d88('0x13')),_['pick'](_0x345af7,attributes));}var rpc={'openchannelQueueReport':require(_0x2d88('0x14')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x2d88('0x15')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x2d88('0x16'))};var queue=schema({'name':{'type':_0x2d88('0x17'),'required':!![],'message':_0x2d88('0x18')},'timeout':{'type':'number','message':_0x2d88('0x19')}});function startRouting(_0x50f775,_0x485a8f,_0x1b926e,_0x3c8156){if(_0x50f775&&_0x485a8f&&_0x1b926e){_0x485a8f[_0x2d88('0x1a')]+=0x1;var _0x3fcce0={'uniqueid':_0x50f775,'from':_0x1b926e[_0x2d88('0x1b')]?_0x1b926e['body']['from']:'','joinAt':moment()[_0x2d88('0xe')](_0x2d88('0x1c')),'ContactId':_0x1b926e['contact']?_0x1b926e[_0x2d88('0x1d')]['id']:null,'ListId':_0x1b926e[_0x2d88('0x1e')]?_0x1b926e[_0x2d88('0x1e')]['id']:null};_0x3fcce0[_[_0x2d88('0x1f')](_0x1b926e[_0x2d88('0x20')])+_0x2d88('0x21')]=_0x485a8f['id']||null;_0x3fcce0[_['upperFirst'](_0x1b926e[_0x2d88('0x20')])+_0x2d88('0x22')]=_0x1b926e['interaction']?_0x1b926e[_0x2d88('0x23')]['id']:null;_0x3fcce0[_[_0x2d88('0x1f')](_0x1b926e[_0x2d88('0x20')])+_0x2d88('0x24')]=_0x1b926e[_0x2d88('0x25')]?_0x1b926e[_0x2d88('0x25')]['id']:null;_0x3fcce0[_[_0x2d88('0x1f')](_0x1b926e[_0x2d88('0x20')])+(_0x1b926e[_0x2d88('0x20')]!=='chat'?_0x2d88('0x26'):'WebsiteId')]=_0x1b926e[_0x2d88('0xa')]?_0x1b926e[_0x2d88('0xa')]['id']:null;logger[_0x2d88('0x27')](util['format'](_0x2d88('0x28'),_0x50f775,_0x485a8f['name']));emitChannelQueueInteraction(_0x1b926e[_0x2d88('0x20')],_0x485a8f[_0x2d88('0x29')],_0x3fcce0,_0x1b926e[_0x2d88('0xa')][_0x2d88('0x29')],_0x1b926e[_0x2d88('0x25')]['id'],!![],_0x3c8156,_0x485a8f['id']);if(rpc[_0x1b926e[_0x2d88('0x20')]+'QueueReport']){return rpc[_0x1b926e[_0x2d88('0x20')]+_0x2d88('0x2a')][_0x2d88('0x2b')](_0x3fcce0)[_0x2d88('0x2c')](function(_0x2d9192){logger[_0x2d88('0x2d')]('create\x20queue\x20report');});}}}function stopRouting(_0x3014d6,_0x3bfab6,_0x70592e,_0x234de7){if(_0x3014d6&&_0x3bfab6){_0x3bfab6['waiting']-=0x1;var _0x32e005={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x2d88('0xe')](_0x2d88('0x1c')),'reason':_0x2d88('0x2e')};logger[_0x2d88('0x27')](util[_0x2d88('0xe')](_0x2d88('0x2f'),_0x3014d6,_0x3bfab6[_0x2d88('0x29')]));emitChannelQueueInteraction(_0x70592e[_0x2d88('0x20')],_0x3bfab6[_0x2d88('0x29')],_0x70592e['body'],_0x70592e['account'][_0x2d88('0x29')],_0x70592e[_0x2d88('0x25')]['id'],![],_0x234de7,_0x3bfab6['id']);if(rpc[_0x70592e['channel']+'QueueReport']){return rpc[_0x70592e[_0x2d88('0x20')]+_0x2d88('0x2a')]['update'](_0x3014d6,_0x32e005)['catch'](function(_0x50ff52){logger['error'](_0x2d88('0x30'));});}}}function endRouting(_0x4d4a21,_0x12e63f,_0x1cc312,_0x332eb2){if(_0x4d4a21&&_0x12e63f){_0x12e63f[_0x2d88('0x1a')]-=0x1;var _0x430acb={'leaveAt':moment()[_0x2d88('0xe')](_0x2d88('0x1c')),'exitAt':moment()['format'](_0x2d88('0x1c')),'reason':_0x2d88('0x31')};logger[_0x2d88('0x27')](util[_0x2d88('0xe')](_0x2d88('0x32'),_0x4d4a21,_0x12e63f['name']));emitChannelQueueInteraction(_0x1cc312[_0x2d88('0x20')],_0x12e63f[_0x2d88('0x29')],_0x1cc312[_0x2d88('0x1b')],_0x1cc312[_0x2d88('0xa')][_0x2d88('0x29')],_0x1cc312['message']['id'],![],_0x332eb2);if(rpc[_0x1cc312['channel']+_0x2d88('0x2a')]){return rpc[_0x1cc312[_0x2d88('0x20')]+_0x2d88('0x2a')][_0x2d88('0x33')](_0x4d4a21,_0x430acb)[_0x2d88('0x2c')](function(_0x47ae33){logger[_0x2d88('0x2d')](_0x2d88('0x30'));});}}}function handleFindQueue(_0x5b4d03){return function(_0x3a2171){return _0x3a2171[_0x2d88('0x29')]['toLowerCase']()===_0x5b4d03[_0x2d88('0x34')]();};}exports[_0x2d88('0x35')]=function(_0x2d2958,_0x447d18,_0x5911e1,_0x1174dc){return function(_0x28fd75){try{var _0x2398bb={'name':_0x447d18[0x0],'timeout':_0x447d18[0x1]};var _0x3f8d5b=queue['validate'](_0x2398bb,{'typecast':!![]});if(_0x3f8d5b[_0x2d88('0x36')]){logger[_0x2d88('0x2d')]('[%s][QUEUE]\x20%s',_0x2d2958,_[_0x2d88('0x37')](_0x3f8d5b,_0x2d88('0x25'))[_0x2d88('0x38')](',\x20'));_0x28fd75[_0x2d88('0x39')]();}else{var _0x566d00=_['find'](_0x5911e1[_0x1174dc[_0x2d88('0x20')]+_0x2d88('0x3a')],handleFindQueue(_0x2398bb[_0x2d88('0x29')]));if(_0x566d00){startRouting(_0x2d2958,_0x566d00,_0x1174dc,_0x5911e1);var _0x438bee=(_0x566d00[_0x2d88('0x31')]||0xa)*0x3e8;var _0x3e0831=(_0x2398bb[_0x2d88('0x31')]||0x14)*0x3e8;var _0x41ed1e,_0x655883;if(_0x438bee>_0x3e0831){_0x3e0831=_0x438bee;}var _0x48cce5=seqqueue[_0x2d88('0x3b')](_0x438bee);_0x48cce5['id']=_0x2d2958;_0x48cce5[_0x2d88('0x3c')]=_0x438bee;_0x48cce5[_0x2d88('0x3d')]=_0x3e0831;_0x48cce5[_0x2d88('0x20')]=_0x1174dc['channel'];_0x5911e1[_0x2d88('0x3e')][_0x2d2958]['on']('end',function(){logger[_0x2d88('0x27')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x2d2958);stopRouting(_0x2d2958,_0x566d00,_0x1174dc,_0x5911e1);clearTimeout(_0x41ed1e);_0x41ed1e=undefined;_0x48cce5['close'](!![]);if(_0x5911e1[_0x2d88('0x3e')][_0x2d2958]){delete _0x5911e1[_0x2d88('0x3e')][_0x2d2958];}_0x28fd75['stop']();});_0x5911e1['rules'][_0x2d2958]['on'](_0x2d88('0x3f'),function(){if(_0x5911e1[_0x2d88('0x3e')][_0x2d2958]){delete _0x5911e1[_0x2d88('0x3e')][_0x2d2958];}});_0x41ed1e=setTimeout(function(){logger[_0x2d88('0x27')](_0x2d88('0x40'),_0x2d2958);endRouting(_0x2d2958,_0x566d00,_0x1174dc,_0x5911e1);clearTimeout(_0x41ed1e);_0x48cce5[_0x2d88('0x41')](!![]);_0x28fd75[_0x2d88('0x42')]();},_0x3e0831);switch(_0x566d00[_0x2d88('0x43')]){case _0x2d88('0x44'):strategy[_0x2d88('0x44')](_0x48cce5,_0x566d00,_0x5911e1,_0x1174dc);break;default:strategy['beepall'](_0x48cce5,_0x566d00,_0x5911e1,_0x1174dc);}}else{logger['error'](_0x2d88('0x45'),_0x2d2958,_0x2398bb[_0x2d88('0x29')]);_0x28fd75[_0x2d88('0x39')]();}}}catch(_0x280ff6){console[_0x2d88('0x46')](_0x280ff6);logger[_0x2d88('0x2d')](_0x2d88('0x47'),_0x2d2958,_0x280ff6[_0x2d88('0x48')]);_0x28fd75['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index 4c1e8b4..7e35353 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 _0x3148=['busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','notificationId','exports','uuid','../../../../../config/logger','routing','squeue','agent','realtime','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','push','info','[%s][AGENT]\x20try\x20with\x20%s','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','agents','channel'];(function(_0x2aa503,_0x1a35a5){var _0x12ffc3=function(_0x211c80){while(--_0x211c80){_0x2aa503['push'](_0x2aa503['shift']());}};_0x12ffc3(++_0x1a35a5);}(_0x3148,0x172));var _0x8314=function(_0x1ee0a1,_0x51058e){_0x1ee0a1=_0x1ee0a1-0x0;var _0x1d2d5b=_0x3148[_0x1ee0a1];return _0x1d2d5b;};'use strict';var _=require('lodash');var uuid=require(_0x8314('0x0'));var util=require('./util');var logger=require(_0x8314('0x1'))(_0x8314('0x2'));var Agent=function(_0x37f2d6,_0x39da46,_0x279cf5,_0x3d81ee){this['notificationId']=uuid['v4']();this[_0x8314('0x3')]=_0x37f2d6;this[_0x8314('0x4')]=_0x39da46;this[_0x8314('0x5')]=_0x279cf5;this[_0x8314('0x2')]=_0x3d81ee;this[_0x8314('0x3')]['push'](this[_0x8314('0x6')][_0x8314('0x7')](this),this[_0x8314('0x8')]['bind'](this));this[_0x8314('0x3')]['on'](_0x8314('0x9'),this['handleTimeout'][_0x8314('0x7')](this));this[_0x8314('0x3')]['on'](_0x8314('0xa'),this[_0x8314('0xb')][_0x8314('0x7')](this));};Agent[_0x8314('0xc')][_0x8314('0xd')]=function(){this['squeue'][_0x8314('0xd')](this['handleRun'][_0x8314('0x7')](this),this[_0x8314('0x8')][_0x8314('0x7')](this));};Agent[_0x8314('0xc')][_0x8314('0xb')]=function(){this[_0x8314('0x8')](!![]);};Agent[_0x8314('0xc')]['handleRun']=function(_0x5745ad){logger[_0x8314('0xe')](_0x8314('0xf'),this[_0x8314('0x3')]['id'],this[_0x8314('0x4')]['id']);if(_['isNil'](this[_0x8314('0x5')]['agents'][this[_0x8314('0x4')]['id']])){logger['info'](_0x8314('0x10'),this[_0x8314('0x3')]['id'],this['agent']['id']);setTimeout(this[_0x8314('0xd')][_0x8314('0x7')](this),0x3e8);}else{if(this['routing'][_0x8314('0x11')]||util['isAgentAvailable'](this['squeue']['id'],this[_0x8314('0x5')][_0x8314('0x12')][this['agent']['id']],this[_0x8314('0x3')][_0x8314('0x13')],![])){this[_0x8314('0x5')]['agents'][this[_0x8314('0x4')]['id']][_0x8314('0x14')]=!![];this[_0x8314('0x5')][_0x8314('0x12')][this['agent']['id']][_0x8314('0x15')]=undefined;util[_0x8314('0x16')](this['notificationId'],this[_0x8314('0x3')]['id'],this[_0x8314('0x5')][_0x8314('0x12')][this['agent']['id']],null,this[_0x8314('0x2')]);util[_0x8314('0x17')](this[_0x8314('0x3')]['id'],this['realtime'][_0x8314('0x12')][this[_0x8314('0x4')]['id']],_0x8314('0x18')+(this[_0x8314('0x2')][_0x8314('0x11')]?_0x8314('0x19'):''));}else{logger[_0x8314('0xe')](_0x8314('0x1a'),this['squeue']['id'],this[_0x8314('0x4')]['id']);setTimeout(this[_0x8314('0xd')][_0x8314('0x7')](this),0x3e8);}}};Agent[_0x8314('0xc')]['handleTimeout']=function(_0x1febdb){if(_['isNil'](this[_0x8314('0x5')][_0x8314('0x12')][this['agent']['id']])){return logger[_0x8314('0xe')](_0x8314('0x10'),this['squeue']['id'],this['agent']['id']);}else{logger[_0x8314('0xe')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x8314('0x3')]['id'],this[_0x8314('0x4')]['id']);util[_0x8314('0x1b')](this[_0x8314('0x1c')],this[_0x8314('0x3')]['id'],this[_0x8314('0x5')][_0x8314('0x12')][this[_0x8314('0x4')]['id']],null,this[_0x8314('0x2')]);this[_0x8314('0x5')][_0x8314('0x12')][this[_0x8314('0x4')]['id']][_0x8314('0x14')]=![];this[_0x8314('0x5')][_0x8314('0x12')][this['agent']['id']]['busyQueue']=undefined;util['writeLog'](this[_0x8314('0x3')]['id'],this[_0x8314('0x5')][_0x8314('0x12')][this['agent']['id']],_0x1febdb?'STOP':'TIMEOUT');}if(!_0x1febdb){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x3e2748,_0x456c70,_0x299983,_0x56c7ea){return new Agent(_0x3e2748,_0x456c70,_0x299983,_0x56c7ea);}module[_0x8314('0x1d')]=agent; \ No newline at end of file +var _0x875e=['./util','../../../../../config/logger','notificationId','squeue','realtime','push','handleRun','bind','timeout','drained','handleDrained','handleTimeout','prototype','info','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','routing','channel','busy','busyQueue','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','writeLog','TIMEOUT','lodash','uuid'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x875e,0x12a));var _0xe875=function(_0x934754,_0x15bd40){_0x934754=_0x934754-0x0;var _0x5cf1fc=_0x875e[_0x934754];return _0x5cf1fc;};'use strict';var _=require(_0xe875('0x0'));var uuid=require(_0xe875('0x1'));var util=require(_0xe875('0x2'));var logger=require(_0xe875('0x3'))('routing');var Agent=function(_0x38767d,_0x5eda1d,_0x18dc20,_0x1377c1){this[_0xe875('0x4')]=uuid['v4']();this[_0xe875('0x5')]=_0x38767d;this['agent']=_0x5eda1d;this[_0xe875('0x6')]=_0x18dc20;this['routing']=_0x1377c1;this['squeue'][_0xe875('0x7')](this[_0xe875('0x8')]['bind'](this),this['handleTimeout'][_0xe875('0x9')](this));this['squeue']['on'](_0xe875('0xa'),this['handleTimeout']['bind'](this));this[_0xe875('0x5')]['on'](_0xe875('0xb'),this[_0xe875('0xc')][_0xe875('0x9')](this));};Agent['prototype']['push']=function(){this[_0xe875('0x5')]['push'](this['handleRun']['bind'](this),this[_0xe875('0xd')][_0xe875('0x9')](this));};Agent[_0xe875('0xe')][_0xe875('0xc')]=function(){this['handleTimeout'](!![]);};Agent['prototype'][_0xe875('0x8')]=function(_0x558995){logger[_0xe875('0xf')](_0xe875('0x10'),this['squeue']['id'],this[_0xe875('0x11')]['id']);if(_[_0xe875('0x12')](this['realtime'][_0xe875('0x13')][this[_0xe875('0x11')]['id']])){logger[_0xe875('0xf')](_0xe875('0x14'),this[_0xe875('0x5')]['id'],this['agent']['id']);setTimeout(this[_0xe875('0x7')][_0xe875('0x9')](this),0x3e8);}else{if(this[_0xe875('0x15')]['forcedOwnership']||util['isAgentAvailable'](this[_0xe875('0x5')]['id'],this[_0xe875('0x6')]['agents'][this[_0xe875('0x11')]['id']],this[_0xe875('0x5')][_0xe875('0x16')],![])){this['realtime'][_0xe875('0x13')][this[_0xe875('0x11')]['id']][_0xe875('0x17')]=!![];this['realtime'][_0xe875('0x13')][this[_0xe875('0x11')]['id']][_0xe875('0x18')]=undefined;util['showNotification'](this[_0xe875('0x4')],this['squeue']['id'],this[_0xe875('0x6')]['agents'][this[_0xe875('0x11')]['id']],null,this['routing']);util['writeLog'](this['squeue']['id'],this[_0xe875('0x6')][_0xe875('0x13')][this[_0xe875('0x11')]['id']],_0xe875('0x19')+(this[_0xe875('0x15')]['forcedOwnership']?':FORCED':''));}else{logger[_0xe875('0xf')](_0xe875('0x1a'),this[_0xe875('0x5')]['id'],this[_0xe875('0x11')]['id']);setTimeout(this[_0xe875('0x7')][_0xe875('0x9')](this),0x3e8);}}};Agent[_0xe875('0xe')][_0xe875('0xd')]=function(_0x450026){if(_[_0xe875('0x12')](this[_0xe875('0x6')][_0xe875('0x13')][this[_0xe875('0x11')]['id']])){return logger[_0xe875('0xf')](_0xe875('0x14'),this[_0xe875('0x5')]['id'],this[_0xe875('0x11')]['id']);}else{logger[_0xe875('0xf')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0xe875('0x5')]['id'],this[_0xe875('0x11')]['id']);util[_0xe875('0x1b')](this['notificationId'],this[_0xe875('0x5')]['id'],this[_0xe875('0x6')][_0xe875('0x13')][this[_0xe875('0x11')]['id']],null,this[_0xe875('0x15')]);this['realtime'][_0xe875('0x13')][this[_0xe875('0x11')]['id']][_0xe875('0x17')]=![];this[_0xe875('0x6')]['agents'][this[_0xe875('0x11')]['id']][_0xe875('0x18')]=undefined;util[_0xe875('0x1c')](this['squeue']['id'],this['realtime'][_0xe875('0x13')][this['agent']['id']],_0x450026?'STOP':_0xe875('0x1d'));}if(!_0x450026){setTimeout(this[_0xe875('0x7')]['bind'](this),0x3e8);}};function agent(_0x2d47e2,_0x3efb93,_0x2e8080,_0x36808e){return new Agent(_0x2d47e2,_0x3efb93,_0x2e8080,_0x36808e);}module['exports']=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 3c4a264..0139406 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 _0x236d=['squeue','bind','handleTimeout','timeout','drained','prototype','push','handleRun','handleDrained','isNil','Agents','length','agents','info','isAgentAvailable','channel','writeLog','busyQueue','name','notificationId','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','busy','exports','lodash','uuid','../../../../../config/logger','queue','realtime','routing'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x236d,0x7e));var _0xd236=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x236d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd236('0x0'));var uuid=require(_0xd236('0x1'));var util=require('./util');var logger=require(_0xd236('0x2'))('routing');var Beepall=function(_0x117bd0,_0x2ffe96,_0x22533a,_0x17ebae){this['notificationId']=uuid['v4']();this['squeue']=_0x117bd0;this[_0xd236('0x3')]=_0x2ffe96;this[_0xd236('0x4')]=_0x22533a;this[_0xd236('0x5')]=_0x17ebae;this[_0xd236('0x6')]['push'](this['handleRun'][_0xd236('0x7')](this),this[_0xd236('0x8')]['bind'](this));this[_0xd236('0x6')]['on'](_0xd236('0x9'),this['handleTimeout'][_0xd236('0x7')](this));this[_0xd236('0x6')]['on'](_0xd236('0xa'),this['handleDrained'][_0xd236('0x7')](this));};Beepall[_0xd236('0xb')][_0xd236('0xc')]=function(){this['squeue'][_0xd236('0xc')](this[_0xd236('0xd')][_0xd236('0x7')](this),this[_0xd236('0x8')][_0xd236('0x7')](this));};Beepall[_0xd236('0xb')][_0xd236('0xe')]=function(_0x974c47){this[_0xd236('0x8')](!![]);};Beepall[_0xd236('0xb')][_0xd236('0xd')]=function(_0x3f3c7a){var _0x458ac3=!![];if(!_[_0xd236('0xf')](this[_0xd236('0x3')])&&!_[_0xd236('0xf')](this[_0xd236('0x3')][_0xd236('0x10')])&&this[_0xd236('0x3')][_0xd236('0x10')]['length']>0x0){for(var _0x4f06c6=0x0,_0x216a25;_0x4f06c60x0){for(var _0x30a8dc=0x0,_0x596996;_0x30a8dc0x0&&_0x502c2e[_0x18680f+'CurrentCapacity']>=_0x502c2e[_0x18680f+'Capacity']){writeLog(_0x379cbd,_0x502c2e,_0x18680f[_0x5645('0x27')]()+_0x5645('0x28'));return![];}}return!![];};exports[_0x5645('0x29')]=function(_0x308991,_0x3a5c61,_0x351cbb,_0x3b9d8e,_0xc585f3){return sendNotification(!![],_0x308991,_0x3a5c61,_0x351cbb,_0x3b9d8e,_0xc585f3);};exports[_0x5645('0x2a')]=function(_0x30a5d0,_0x1c0aa2,_0x2154a7,_0x406782,_0xa2a4a1){return sendNotification(![],_0x30a5d0,_0x1c0aa2,_0x2154a7,_0x406782,_0xa2a4a1);};exports['writeLog']=writeLog; \ No newline at end of file +var _0x68b3=['hideNotification','writeLog','lodash','util','../utils','mustache','ioredis','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','emit','format','user:%s','user:save','split','name','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','I\x20can\x27t\x20render\x20your\x20template','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification'];(function(_0xc9c2f1,_0x9fcb0d){var _0x3a7de4=function(_0x411997){while(--_0x411997){_0xc9c2f1['push'](_0xc9c2f1['shift']());}};_0x3a7de4(++_0x9fcb0d);}(_0x68b3,0x1d8));var _0x368b=function(_0x41bcdd,_0x5e1364){_0x41bcdd=_0x41bcdd-0x0;var _0x381ac4=_0x68b3[_0x41bcdd];return _0x381ac4;};'use strict';var _=require(_0x368b('0x0'));var util=require(_0x368b('0x1'));var utils=require(_0x368b('0x2'));var Mustache=require(_0x368b('0x3'));var Redis=require(_0x368b('0x4'));var config=require('../../../../../config/environment');var logger=require(_0x368b('0x5'))(_0x368b('0x6'));config[_0x368b('0x7')]=_[_0x368b('0x8')](config['redis'],{'host':_0x368b('0x9'),'port':0x18eb});var io=require(_0x368b('0xa'))(new Redis(config[_0x368b('0x7')]));function emit(_0x23584a,_0x4406c8,_0x127c1e){io['to'](_0x23584a)[_0x368b('0xb')](_0x4406c8,_0x127c1e);}function sendNotification(_0x142d05,_0x23622f,_0x1f64d8,_0x2a7b9f,_0x5a46f9,_0x160e12){io['to'](util[_0x368b('0xc')](_0x368b('0xd'),_0x2a7b9f['name']))[_0x368b('0xb')](_0x368b('0xe'),_0x2a7b9f);var _0x253e4b=_0x160e12||{};var _0x5924a6=_0x1f64d8[_0x368b('0xf')]('.');var _0x847dcb={'uniqueid':_0x23622f,'channel':_0x5924a6[0x0],'id':_0x5924a6[0x1],'title':_0x5924a6[0x0]+'\x20interaction','interactionId':_0x5924a6[0x2],'queue':_0x5a46f9?_0x5a46f9[_0x368b('0x10')]:null,'sound':_0x253e4b[_0x368b('0x11')][_0x368b('0x12')],'shake':_0x253e4b[_0x368b('0x11')][_0x368b('0x13')]};try{if(!_0x253e4b['body']){_0x253e4b[_0x368b('0x14')]={};}if(_0x5a46f9){_0x253e4b[_0x368b('0x14')]['queue']=_0x5a46f9;}else if(_0x253e4b[_0x368b('0x14')][_0x368b('0x15')]){delete _0x253e4b[_0x368b('0x14')]['queue'];}_0x847dcb[_0x368b('0x16')]=utils[_0x368b('0x17')](_0x253e4b[_0x368b('0x11')]['notificationTemplate'],_0x253e4b);}catch(_0x102407){_0x847dcb[_0x368b('0x16')]=_0x368b('0x18');logger['error'](util['format'](_0x368b('0x19'),_0x23622f,_0x102407[_0x368b('0x1a')]));}io['to'](util[_0x368b('0xc')](_0x368b('0xd'),_0x2a7b9f[_0x368b('0x10')]))['emit'](util[_0x368b('0xc')](_0x368b('0x1b'),_0x142d05?_0x368b('0x1c'):_0x368b('0x1d')),_0x847dcb);}function writeLog(_0x23da8f,_0x26b206,_0x397185){return logger[_0x368b('0x1e')](util['format'](_0x368b('0x1f'),_0x23da8f,_0x26b206[_0x368b('0x10')],_0x397185));}exports[_0x368b('0x20')]=function(_0xc0f7af,_0x286853,_0x4c2fca,_0x286641){if(_0x286853[_0x368b('0x21')]){writeLog(_0xc0f7af,_0x286853,_0x368b('0x22'));return![];}if(!_0x286853[_0x368b('0x23')]){writeLog(_0xc0f7af,_0x286853,_0x368b('0x24'));return![];}if(_0x286853[_0x4c2fca+_0x368b('0x25')]){writeLog(_0xc0f7af,_0x286853,_0x368b('0x26'));return![];}if(_0x286641&&_0x286853[_0x368b('0x27')](_0x4c2fca+_0x368b('0x28'))&&_0x286853[_0x368b('0x27')](_0x4c2fca+_0x368b('0x29'))){if(_0x286853[_0x4c2fca+_0x368b('0x28')]>0x0&&_0x286853[_0x4c2fca+_0x368b('0x29')]>=_0x286853[_0x4c2fca+_0x368b('0x28')]){writeLog(_0xc0f7af,_0x286853,_0x4c2fca[_0x368b('0x2a')]()+_0x368b('0x2b'));return![];}}return!![];};exports[_0x368b('0x2c')]=function(_0x9f192e,_0x39ef94,_0x1e0e46,_0x2b036e,_0xc12627){return sendNotification(!![],_0x9f192e,_0x39ef94,_0x1e0e46,_0x2b036e,_0xc12627);};exports[_0x368b('0x2d')]=function(_0x3c80b5,_0x5db0b4,_0x4af77a,_0x381324,_0x2f1d52){return sendNotification(![],_0x3c80b5,_0x5db0b4,_0x4af77a,_0x381324,_0x2f1d52);};exports[_0x368b('0x2e')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index c176a1a..21bfdcd 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 _0x5f4b=['consequence','length','error','[%s][SYSTEM]\x20%s','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string'];(function(_0x8e6633,_0x38b7b0){var _0x5f1913=function(_0x4c59fc){while(--_0x4c59fc){_0x8e6633['push'](_0x8e6633['shift']());}};_0x5f1913(++_0x38b7b0);}(_0x5f4b,0x1b3));var _0xb5f4=function(_0x4bf228,_0x89040b){_0x4bf228=_0x4bf228-0x0;var _0x4a1e8d=_0x5f4b[_0x4bf228];return _0x4a1e8d;};'use strict';var schema=require(_0xb5f4('0x0'));var sh=require(_0xb5f4('0x1'));var _=require(_0xb5f4('0x2'));var utils=require(_0xb5f4('0x3'));var logger=require(_0xb5f4('0x4'))(_0xb5f4('0x5'));var system=schema({'command':{'type':_0xb5f4('0x6'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xb5f4('0x7')]=function(_0x182725,_0x1da6b3){return function(_0x3bc6ce){try{var _0x4021ea={'command':_0x1da6b3[0x0]};var _0xf8e3ab=system[_0xb5f4('0x0')](_0x4021ea,{'typecast':!![]});if(_0xf8e3ab[_0xb5f4('0x8')]){logger[_0xb5f4('0x9')](_0xb5f4('0xa'),_0x182725,_[_0xb5f4('0xb')](_0xf8e3ab,'message')[_0xb5f4('0xc')](',\x20'));logger[_0xb5f4('0xd')](_0xb5f4('0xe'),_0x182725);_0x3bc6ce[_0xb5f4('0xf')]();}else{var _0x20f671=this;var _0x3a8693=utils[_0xb5f4('0x10')](_0x1da6b3[0x0],this);logger[_0xb5f4('0xd')](_0xb5f4('0x11'),_0x182725,_0x3a8693);sh['exec'](_[_0xb5f4('0x12')](_0x3a8693),function(_0x3e2951,_0xc86cef){logger['info'](_0xb5f4('0x13'),_0x182725,_0x3e2951);if(_0x3e2951==0x0){var _0x411b4b=_0xc86cef[_0xb5f4('0x14')](/(\r\n|\n|\r)/gm,'');if(_[_0xb5f4('0x15')](_0x1da6b3[0x1])||_['isEmpty'](_0x1da6b3[0x1])){logger[_0xb5f4('0xd')](_0xb5f4('0x16'),_0x182725);_0x20f671[_0xb5f4('0x17')][_0x1da6b3[0x1]]=_0x411b4b;}else{logger[_0xb5f4('0xd')](_0xb5f4('0x18'),_0x182725,_0x1da6b3[0x1],_0x411b4b);_0x20f671[_0xb5f4('0x17')][_0x1da6b3[0x1]]=_0x411b4b;}}_0x3bc6ce[_0xb5f4('0xf')]();});}}catch(_0x32f30e){logger[_0xb5f4('0x9')](_0xb5f4('0xa'),_0x182725,_[_0xb5f4('0x19')](_0x32f30e)?JSON['stringify'](_0x32f30e):_0x32f30e);logger[_0xb5f4('0xd')](_0xb5f4('0xe'),_0x182725);_0x3bc6ce[_0xb5f4('0xf')]();}};}; \ No newline at end of file +var _0xff1b=['isObject','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','map','join','info','next','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xff1b,0x1cd));var _0xbff1=function(_0x5067db,_0xf8d2f2){_0x5067db=_0x5067db-0x0;var _0x2771e4=_0xff1b[_0x5067db];return _0x2771e4;};'use strict';var schema=require(_0xbff1('0x0'));var sh=require(_0xbff1('0x1'));var _=require(_0xbff1('0x2'));var utils=require(_0xbff1('0x3'));var logger=require(_0xbff1('0x4'))(_0xbff1('0x5'));var system=schema({'command':{'type':_0xbff1('0x6'),'required':!![],'message':_0xbff1('0x7')}});exports['consequence']=function(_0x154644,_0x229ca1){return function(_0x53ed99){try{var _0x54a98e={'command':_0x229ca1[0x0]};var _0x4d7768=system['validate'](_0x54a98e,{'typecast':!![]});if(_0x4d7768[_0xbff1('0x8')]){logger[_0xbff1('0x9')]('[%s][SYSTEM]\x20%s',_0x154644,_[_0xbff1('0xa')](_0x4d7768,'message')[_0xbff1('0xb')](',\x20'));logger[_0xbff1('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x154644);_0x53ed99[_0xbff1('0xd')]();}else{var _0xc49f6b=this;var _0x3e42a4=utils['getMustacheRender'](_0x229ca1[0x0],this);logger[_0xbff1('0xc')](_0xbff1('0xe'),_0x154644,_0x3e42a4);sh[_0xbff1('0xf')](_[_0xbff1('0x10')](_0x3e42a4),function(_0x238a4a,_0x773770){logger[_0xbff1('0xc')](_0xbff1('0x11'),_0x154644,_0x238a4a);if(_0x238a4a==0x0){var _0x109c71=_0x773770[_0xbff1('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0xbff1('0x13')](_0x229ca1[0x1])||_[_0xbff1('0x14')](_0x229ca1[0x1])){logger['info'](_0xbff1('0x15'),_0x154644);_0xc49f6b[_0xbff1('0x16')][_0x229ca1[0x1]]=_0x109c71;}else{logger[_0xbff1('0xc')](_0xbff1('0x17'),_0x154644,_0x229ca1[0x1],_0x109c71);_0xc49f6b[_0xbff1('0x16')][_0x229ca1[0x1]]=_0x109c71;}}_0x53ed99[_0xbff1('0xd')]();});}}catch(_0x5e2574){logger[_0xbff1('0x9')](_0xbff1('0x18'),_0x154644,_[_0xbff1('0x19')](_0x5e2574)?JSON['stringify'](_0x5e2574):_0x5e2574);logger['info'](_0xbff1('0x1a'),_0x154644);_0x53ed99[_0xbff1('0xd')]();}};}; \ 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 9eab697..ffed47b 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 _0xe78d=['next','Interaction','channel','addTags','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','finally','isObject','stringify','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xe78d,0x119));var _0xde78=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0xe78d[_0xbf8ebe];return _0x1e25e8;};'use strict';var schema=require(_0xde78('0x0'));var _=require(_0xde78('0x1'));var rpc={'chatInteraction':require(_0xde78('0x2')),'openchannelInteraction':require(_0xde78('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xde78('0x4')),'faxInteraction':require(_0xde78('0x5')),'whatsappInteraction':require(_0xde78('0x6'))};var logger=require(_0xde78('0x7'))('routing');var tag=schema({'tag':{'type':_0xde78('0x8'),'required':!![],'message':_0xde78('0x9')}});exports[_0xde78('0xa')]=function(_0x1b484,_0x19784b,_0x42c940,_0x2b8a0c){return function(_0x273677){try{var _0x62332f={'tag':_0x19784b[0x0]};var _0x1ce828=tag[_0xde78('0x0')](_0x62332f,{'typecast':!![]});if(_0x1ce828[_0xde78('0xb')]){logger[_0xde78('0xc')](_0xde78('0xd'),_0x1b484,_[_0xde78('0xe')](_0x1ce828,_0xde78('0xf'))[_0xde78('0x10')](',\x20'));logger[_0xde78('0x11')](_0xde78('0x12'),_0x1b484);_0x273677[_0xde78('0x13')]();}else{var _0x4e49e0={'ids':[_0x19784b[0x0]]};if(rpc[_0x2b8a0c['channel']+_0xde78('0x14')]){rpc[_0x2b8a0c[_0xde78('0x15')]+'Interaction'][_0xde78('0x16')](_0x2b8a0c['interaction']['id'],_0x4e49e0)[_0xde78('0x17')](function(_0x5ed6eb){logger[_0xde78('0x11')](_0xde78('0x18'),_0x1b484,_0x19784b[0x1],_0x2b8a0c[_0xde78('0x15')],_0x2b8a0c[_0xde78('0x19')]['id']);})[_0xde78('0x1a')](function(_0x517135){logger['error']('[%s][TAG]\x20%s',_0x1b484,JSON['stringify'](_0x517135));logger[_0xde78('0x11')](_0xde78('0x12'),_0x1b484);})[_0xde78('0x1b')](function(){_0x273677[_0xde78('0x13')]();});}}}catch(_0x2b76be){logger['error'](_0xde78('0xd'),_0x1b484,_[_0xde78('0x1c')](_0x2b76be)?JSON[_0xde78('0x1d')](_0x2b76be):_0x2b76be);logger[_0xde78('0x11')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x1b484);_0x273677['next']();}};}; \ No newline at end of file +var _0x40cf=['join','info','next','channel','Interaction','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','error','[%s][TAG]\x20%s','map'];(function(_0x525f2f,_0x293973){var _0x60c8d1=function(_0x367c65){while(--_0x367c65){_0x525f2f['push'](_0x525f2f['shift']());}};_0x60c8d1(++_0x293973);}(_0x40cf,0xc4));var _0xf40c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x40cf[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0xf40c('0x0'));var _=require(_0xf40c('0x1'));var rpc={'chatInteraction':require(_0xf40c('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xf40c('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xf40c('0x4'))};var logger=require('../../../../config/logger')(_0xf40c('0x5'));var tag=schema({'tag':{'type':_0xf40c('0x6'),'required':!![],'message':_0xf40c('0x7')}});exports['consequence']=function(_0x4a71d4,_0x2cfabb,_0x5f4f5c,_0x81fed5){return function(_0x2d062a){try{var _0x15c3c4={'tag':_0x2cfabb[0x0]};var _0x189eca=tag[_0xf40c('0x0')](_0x15c3c4,{'typecast':!![]});if(_0x189eca['length']){logger[_0xf40c('0x8')](_0xf40c('0x9'),_0x4a71d4,_[_0xf40c('0xa')](_0x189eca,'message')[_0xf40c('0xb')](',\x20'));logger[_0xf40c('0xc')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x4a71d4);_0x2d062a[_0xf40c('0xd')]();}else{var _0x300896={'ids':[_0x2cfabb[0x0]]};if(rpc[_0x81fed5[_0xf40c('0xe')]+_0xf40c('0xf')]){rpc[_0x81fed5['channel']+_0xf40c('0xf')][_0xf40c('0x10')](_0x81fed5[_0xf40c('0x11')]['id'],_0x300896)['then'](function(_0x121730){logger['info'](_0xf40c('0x12'),_0x4a71d4,_0x2cfabb[0x1],_0x81fed5[_0xf40c('0xe')],_0x81fed5[_0xf40c('0x11')]['id']);})['catch'](function(_0x44d8bc){logger[_0xf40c('0x8')](_0xf40c('0x9'),_0x4a71d4,JSON[_0xf40c('0x13')](_0x44d8bc));logger[_0xf40c('0xc')](_0xf40c('0x14'),_0x4a71d4);})[_0xf40c('0x15')](function(){_0x2d062a['next']();});}}}catch(_0x586550){logger[_0xf40c('0x8')]('[%s][TAG]\x20%s',_0x4a71d4,_[_0xf40c('0x16')](_0x586550)?JSON[_0xf40c('0x13')](_0x586550):_0x586550);logger[_0xf40c('0xc')](_0xf40c('0x14'),_0x4a71d4);_0x2d062a[_0xf40c('0xd')]();}};}; \ 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 a9c3ece..e85892d 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 _0x6c0b=['[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','error','[%s][TVOX]\x20%s','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','consequence','\x20-\x20','replace','includes','push','?params=','urlOnRing','title','jsonrpc','2.0','method','login','params','stringify','utf8','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId='];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x6c0b,0x10e));var _0xb6c0=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0x6c0b[_0xbb9dbf];return _0x30223c;};'use strict';var rp=require(_0xb6c0('0x0'));var logger=require(_0xb6c0('0x1'))(_0xb6c0('0x2'));var _=require(_0xb6c0('0x3'));var arr=[];exports[_0xb6c0('0x4')]=function(_0x535c83,_0x4d3262){return function(_0x1e7adf){var _0x2627d9=_0x4d3262[0xa];var _0x5de5b2=_0x4d3262[0xb];var _0x2ca61b=_0x4d3262[0xc];var _0x283cb0=_0x4d3262[0xd];var _0x24bada=_0x4d3262[0xe];var _0x50106a=_0x4d3262[0xf]['replace'](/\n/g,_0xb6c0('0x5'));var _0x4881aa=_0x4d3262[0x10][_0xb6c0('0x6')](/\n/g,'\x20');if(!arr[_0xb6c0('0x7')](_0x5de5b2)){arr[_0xb6c0('0x8')](_0x5de5b2);var _0x27789d=_0x4d3262[0x3];var _0x2de77c=_0x4d3262[0x4];var _0x332004=_0x4d3262[0x1];var _0x27d88b=_0x4d3262[0x0];var _0x57d405={};_0x57d405['urlOnAnswer']=_0x4d3262[0x8]+_0xb6c0('0x9')+_0x2ca61b+'|'+_0x2627d9+'|'+_0x283cb0+'|'+_0x5de5b2+'|'+_0x24bada;_0x57d405[_0xb6c0('0xa')]=_0x4d3262[0x7]+_0xb6c0('0x9')+_0x2ca61b+'|'+_0x2627d9+'|'+_0x283cb0+'|'+_0x5de5b2+'|'+_0x24bada+'|'+_0x50106a+'|'+_0x4881aa;_0x57d405[_0xb6c0('0xb')]=_0x4d3262[0x9];var _0x583a6f={};_0x583a6f[_0xb6c0('0xc')]=_0xb6c0('0xd');_0x583a6f[_0xb6c0('0xe')]=_0xb6c0('0xf');var _0x5be8a8=[];_0x5be8a8['push'](_0x4d3262[0x2]);_0x5be8a8[_0xb6c0('0x8')](_0x4d3262[0x5]);_0x5be8a8[_0xb6c0('0x8')](_0x4d3262[0x6]);_0x583a6f[_0xb6c0('0x10')]=_0x5be8a8;_0x583a6f['id']=0x1;var _0x1fe362=JSON[_0xb6c0('0x11')](_0x583a6f);var _0x5aa9a9={'encoding':_0xb6c0('0x12'),'method':'POST','timeout':0x2710,'url':_0x27789d,'headers':{'Content-Type':_0xb6c0('0x13')},'body':_0x1fe362};return rp(_0x5aa9a9)[_0xb6c0('0x14')](function(_0x2d2f54){const _0x46ad03=JSON[_0xb6c0('0x15')](_0x2d2f54);if(!_0x46ad03[_0xb6c0('0x16')][_0xb6c0('0x17')]){throw new Error(_0xb6c0('0x18'));}var _0x2ebf4c=_0x5de5b2;var _0x169ace=_0xb6c0('0x19')+_0x332004+_0xb6c0('0x1a')+_0x27d88b+'&sessionId='+_0x2ebf4c+'&data='+JSON[_0xb6c0('0x11')](_0x57d405);var _0x3542df=_0x2de77c+'?'+_0x169ace;return rp(_0x3542df);})['then'](function(_0x4cb424){logger['info'](_0xb6c0('0x1b'),_0x535c83,_0x4cb424);_0x1e7adf['stop']();})['catch'](function(_0x31bbd6){logger[_0xb6c0('0x1c')](_0xb6c0('0x1d'),_0x535c83,_['isObject'](_0x31bbd6)?JSON['stringify'](_0x31bbd6):_0x31bbd6);_0x1e7adf['stop']();});}else{logger[_0xb6c0('0x1e')](_0xb6c0('0x1f'),_0x535c83);_0x1e7adf[_0xb6c0('0x20')]();}};}; \ No newline at end of file +var _0x2738=['title','jsonrpc','2.0','method','login','params','utf8','POST','application/json-rpc','then','result','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','stringify','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','routing','consequence','\x20-\x20','replace','includes','push','urlOnAnswer','?params=','urlOnRing'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2738,0x1e0));var _0x8273=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x2738[_0xaa1b3e];return _0x454d7d;};'use strict';var rp=require(_0x8273('0x0'));var logger=require('../../../../config/logger')(_0x8273('0x1'));var _=require('lodash');var arr=[];exports[_0x8273('0x2')]=function(_0x4f777f,_0x49800f){return function(_0x59c1a2){var _0x201875=_0x49800f[0xa];var _0x353fe2=_0x49800f[0xb];var _0x324b00=_0x49800f[0xc];var _0x2e84d5=_0x49800f[0xd];var _0x5b948e=_0x49800f[0xe];var _0x3e4d9f=_0x49800f[0xf]['replace'](/\n/g,_0x8273('0x3'));var _0x2c64e9=_0x49800f[0x10][_0x8273('0x4')](/\n/g,'\x20');if(!arr[_0x8273('0x5')](_0x353fe2)){arr[_0x8273('0x6')](_0x353fe2);var _0x3b1b86=_0x49800f[0x3];var _0x2a4e88=_0x49800f[0x4];var _0x84b5de=_0x49800f[0x1];var _0x32fb02=_0x49800f[0x0];var _0x1424bc={};_0x1424bc[_0x8273('0x7')]=_0x49800f[0x8]+_0x8273('0x8')+_0x324b00+'|'+_0x201875+'|'+_0x2e84d5+'|'+_0x353fe2+'|'+_0x5b948e;_0x1424bc[_0x8273('0x9')]=_0x49800f[0x7]+_0x8273('0x8')+_0x324b00+'|'+_0x201875+'|'+_0x2e84d5+'|'+_0x353fe2+'|'+_0x5b948e+'|'+_0x3e4d9f+'|'+_0x2c64e9;_0x1424bc[_0x8273('0xa')]=_0x49800f[0x9];var _0x48c3c2={};_0x48c3c2[_0x8273('0xb')]=_0x8273('0xc');_0x48c3c2[_0x8273('0xd')]=_0x8273('0xe');var _0x59f4d0=[];_0x59f4d0[_0x8273('0x6')](_0x49800f[0x2]);_0x59f4d0['push'](_0x49800f[0x5]);_0x59f4d0[_0x8273('0x6')](_0x49800f[0x6]);_0x48c3c2[_0x8273('0xf')]=_0x59f4d0;_0x48c3c2['id']=0x1;var _0x3b9f65=JSON['stringify'](_0x48c3c2);var _0x102f38={'encoding':_0x8273('0x10'),'method':_0x8273('0x11'),'timeout':0x2710,'url':_0x3b1b86,'headers':{'Content-Type':_0x8273('0x12')},'body':_0x3b9f65};return rp(_0x102f38)[_0x8273('0x13')](function(_0xfc2fd3){const _0x29789b=JSON['parse'](_0xfc2fd3);if(!_0x29789b[_0x8273('0x14')]['logged']){throw new Error(_0x8273('0x15'));}var _0xe6f729=_0x353fe2;var _0x39cbb0=_0x8273('0x16')+_0x84b5de+_0x8273('0x17')+_0x32fb02+_0x8273('0x18')+_0xe6f729+_0x8273('0x19')+JSON[_0x8273('0x1a')](_0x1424bc);var _0x17d7a6=_0x2a4e88+'?'+_0x39cbb0;return rp(_0x17d7a6);})[_0x8273('0x13')](function(_0x3758b0){logger[_0x8273('0x1b')](_0x8273('0x1c'),_0x4f777f,_0x3758b0);_0x59c1a2[_0x8273('0x1d')]();})[_0x8273('0x1e')](function(_0x1fc0d1){logger[_0x8273('0x1f')](_0x8273('0x20'),_0x4f777f,_[_0x8273('0x21')](_0x1fc0d1)?JSON[_0x8273('0x1a')](_0x1fc0d1):_0x1fc0d1);_0x59c1a2[_0x8273('0x1d')]();});}else{logger['info'](_0x8273('0x22'),_0x4f777f);_0x59c1a2['next']();}};}; \ 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 3aa9e2f..285c9fd 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 _0x9c44=['merge','body','account','list','exports','render'];(function(_0x5d9c0d,_0x353a8b){var _0x5a3ee0=function(_0x463f44){while(--_0x463f44){_0x5d9c0d['push'](_0x5d9c0d['shift']());}};_0x5a3ee0(++_0x353a8b);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x4b04ff,_0x2a5eb0){var _0x382830=function(_0x2893dd){while(--_0x2893dd){_0x4b04ff['push'](_0x4b04ff['shift']());}};_0x382830(++_0x2a5eb0);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 1f86faf..a5ef0cc 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 _0xf109=['loggedIn','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','http','listen','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','rules','message','interaction','isArray','applications','length','existsSync','join','.js','app','toLowerCase','autoreply','appdata','split','channel','push','dialogflow','dialogflowv2','amazonlex','slice','TagId','tvox','account','notificationTemplate','body','%s:%s:%s','./interval','condition','intervals','./applications/','Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','stringify','matchPath','complete','stack','routing\x20is\x20empty','agent','agents','busy','emit','end','QueueReport','update','UserId','catch','message\x20is\x20empty','busyQueue','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','name','paused','mailQueues','waiting','openchannelQueues'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf109,0xce));var _0x9f10=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xf109[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var path=require(_0x9f10('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require('bluebird');var uuid=require('uuid');var utils=require(_0x9f10('0x3'));var config=require(_0x9f10('0x4'));var logger=require(_0x9f10('0x5'))(_0x9f10('0x6'));var rpc={'openchannelQueueReport':require(_0x9f10('0x7')),'mailQueueReport':require(_0x9f10('0x8')),'chatQueueReport':require(_0x9f10('0x9')),'smsQueueReport':require(_0x9f10('0xa')),'faxQueueReport':require(_0x9f10('0xb')),'whatsappQueueReport':require(_0x9f10('0xc'))};var RuleEngine=require(_0x9f10('0xd'));function getId(_0x5c8719,_0x42a8cd,_0x3019eb){return util[_0x9f10('0xe')](_0x9f10('0xf'),_0x5c8719,_0x42a8cd||0x0,_0x3019eb||0x0);}function getIntervals(_0x325f22,_0x5d5f53){var _0x318776=[];if(!_[_0x9f10('0x10')](_0x5d5f53[_0x9f10('0x11')])&&!_['isNil'](_0x325f22[_0x5d5f53['IntervalId']])&&!_[_0x9f10('0x10')](_0x325f22[_0x5d5f53[_0x9f10('0x11')]][_0x9f10('0x12')])){_0x318776=_['map'](_0x325f22[_0x5d5f53[_0x9f10('0x11')]][_0x9f10('0x12')],_0x9f10('0x13'));}else if(!_['isNil'](_0x5d5f53[_0x9f10('0x13')])){_0x318776=[_0x5d5f53[_0x9f10('0x13')]];}return _0x318776;}exports['listen']=function(_0x40a48a){_0x40a48a[_0x9f10('0x14')]={};return new BPromise(function(_0x507e1a,_0x59bcad){var _0x2b6c4c={'Start':function(_0x177918){var _0x549217=this;return new Promise(function(_0x11154b,_0x5ae255){if(_0x177918){try{var _0x14d3fe=[];var _0x1f68d8=getId(_0x177918['channel'],_0x177918[_0x9f10('0x15')]?_0x177918[_0x9f10('0x15')]['id']:0x0,_0x177918['interaction']?_0x177918[_0x9f10('0x16')]['id']:0x0);if(_0x177918['applications']&&_[_0x9f10('0x17')](_0x177918['applications'])&&_0x177918[_0x9f10('0x18')]['length']){for(var _0x54c262=0x0;_0x54c262<_0x177918[_0x9f10('0x18')][_0x9f10('0x19')];_0x54c262+=0x1){var _0x25f870=_0x177918[_0x9f10('0x18')][_0x54c262];if(fs[_0x9f10('0x1a')](path[_0x9f10('0x1b')](__dirname,_0x9f10('0x18'),_0x25f870['app']+_0x9f10('0x1c')))){var _0x58e6ba=[];switch(_0x25f870[_0x9f10('0x1d')][_0x9f10('0x1e')]()){case _0x9f10('0x1f'):var _0x4adbda=_0x25f870[_0x9f10('0x20')][_0x9f10('0x21')](',');if(_0x177918[_0x9f10('0x22')]==='mail'){_0x58e6ba[_0x9f10('0x23')](_0x4adbda[0x0]);_0x58e6ba[_0x9f10('0x23')](_0x4adbda[0x1]);_0x58e6ba[_0x9f10('0x23')](_0x4adbda['slice'](0x2,_0x4adbda[_0x9f10('0x19')])[_0x9f10('0x1b')](','));}else{_0x58e6ba[_0x9f10('0x23')](_0x4adbda[0x0]);_0x58e6ba[_0x9f10('0x23')](_0x4adbda['slice'](0x1,_0x4adbda['length'])['join'](','));}break;case _0x9f10('0x24'):var _0x4a0407=_0x25f870[_0x9f10('0x20')][_0x9f10('0x21')](',');_0x58e6ba[_0x9f10('0x23')](_0x4a0407[0x0]);_0x58e6ba[_0x9f10('0x23')](_0x4a0407[0x1]);_0x58e6ba[_0x9f10('0x23')](_0x4a0407['slice'](0x2,_0x4a0407[_0x9f10('0x19')])[_0x9f10('0x1b')](','));break;case _0x9f10('0x25'):var _0xfbb37f=_0x25f870[_0x9f10('0x20')][_0x9f10('0x21')](',');_0x58e6ba['push'](_0xfbb37f[0x0]);_0x58e6ba[_0x9f10('0x23')](_0xfbb37f[0x1]);_0x58e6ba[_0x9f10('0x23')](_0xfbb37f[0x2]);_0x58e6ba[_0x9f10('0x23')](_0xfbb37f[0x3]);_0x58e6ba[_0x9f10('0x23')](_0xfbb37f['slice'](0x4,_0xfbb37f[_0x9f10('0x19')])[_0x9f10('0x1b')](','));break;case _0x9f10('0x26'):var _0x5dd404=_0x25f870[_0x9f10('0x20')]['split'](',');_0x58e6ba[_0x9f10('0x23')](_0x5dd404[0x0]);_0x58e6ba[_0x9f10('0x23')](_0x5dd404[0x1]);_0x58e6ba[_0x9f10('0x23')](_0x5dd404[0x2]);_0x58e6ba['push'](_0x5dd404[0x3]);_0x58e6ba[_0x9f10('0x23')](_0x5dd404[_0x9f10('0x27')](0x4,_0x5dd404[_0x9f10('0x19')])[_0x9f10('0x1b')](','));break;case _0x9f10('0x15'):_0x58e6ba['push'](_0x25f870[_0x9f10('0x20')]);break;case'tag':_0x58e6ba[_0x9f10('0x23')](_0x25f870[_0x9f10('0x28')]);_0x58e6ba[_0x9f10('0x23')](_0x25f870[_0x9f10('0x20')]);break;case _0x9f10('0x29'):var _0x12c486=utils['getMustacheRender'](_0x177918[_0x9f10('0x2a')][_0x9f10('0x2b')],_0x177918);var _0x1b8018=_0x25f870['appdata'][_0x9f10('0x21')](',');_0x58e6ba[_0x9f10('0x23')](_0x1b8018[0x0]);_0x58e6ba['push'](_0x1b8018[0x1]);_0x58e6ba[_0x9f10('0x23')](_0x1b8018[0x2]);_0x58e6ba['push'](_0x1b8018[0x3]);_0x58e6ba[_0x9f10('0x23')](_0x1b8018[0x4]);_0x58e6ba[_0x9f10('0x23')](_0x1b8018[0x5]);_0x58e6ba[_0x9f10('0x23')](_0x1b8018[0x6]);_0x58e6ba[_0x9f10('0x23')](_0x1b8018[0x7]);_0x58e6ba[_0x9f10('0x23')](_0x1b8018[0x8]);_0x58e6ba[_0x9f10('0x23')](_0x1b8018[0x9]);_0x58e6ba[_0x9f10('0x23')](_0x1b8018[0xa]);_0x58e6ba[_0x9f10('0x23')](_0x177918['interaction']['id']);_0x58e6ba[_0x9f10('0x23')](_0x177918[_0x9f10('0x15')]['id']);_0x58e6ba[_0x9f10('0x23')](_0x25f870['ChatWebsiteId']);_0x58e6ba[_0x9f10('0x23')](_0x177918[_0x9f10('0x16')]['ContactId']);_0x58e6ba[_0x9f10('0x23')](_0x177918[_0x9f10('0x2c')][_0x9f10('0x2c')]);_0x58e6ba['push'](_0x12c486);break;default:_0x58e6ba=_['isNil'](_0x25f870[_0x9f10('0x20')])?[]:_0x25f870[_0x9f10('0x20')][_0x9f10('0x21')](',');}var _0x433e70={'id':util[_0x9f10('0xe')](_0x9f10('0x2d'),_0x1f68d8,_0x25f870['id'],_0x25f870[_0x9f10('0x1d')]),'condition':require(_0x9f10('0x2e'))[_0x9f10('0x2f')](_0x1f68d8,getIntervals(_0x40a48a[_0x9f10('0x30')],_0x25f870),_0x40a48a),'consequence':require(_0x9f10('0x31')+_0x25f870[_0x9f10('0x1d')])['consequence'](_0x1f68d8,_0x58e6ba,_0x40a48a,_0x177918),'p':_0x25f870['priority']||0x0};logger['info'](_0x9f10('0x32'),_0x433e70['id'],'on\x20interval',getIntervals(_0x40a48a[_0x9f10('0x30')],_0x25f870)[_0x9f10('0x1b')](_0x9f10('0x33')));_0x14d3fe['push'](_0x433e70);}else{logger[_0x9f10('0x34')](_0x9f10('0x35'),path[_0x9f10('0x1b')](__dirname,_0x9f10('0x18'),_0x25f870[_0x9f10('0x1d')]+'.js'));}}_0x40a48a['rules'][_0x1f68d8]=new RuleEngine(_0x14d3fe);_0x40a48a['rules'][_0x1f68d8][_0x9f10('0x36')](_0x177918,function(_0x5d08fb){logger[_0x9f10('0x37')]('Applications\x20executed',JSON[_0x9f10('0x38')](_0x5d08fb[_0x9f10('0x39')]));if(_0x40a48a[_0x9f10('0x14')][_0x1f68d8]){_0x40a48a[_0x9f10('0x14')][_0x1f68d8]['emit'](_0x9f10('0x3a'));}});return _0x11154b({'code':0xc8,'message':_0x177918});}else{logger[_0x9f10('0x37')]('No\x20applications\x20to\x20execute');return _0x11154b({'code':0xc8,'message':_0x177918});}}catch(_0x3a5705){logger[_0x9f10('0x34')](_0x3a5705[_0x9f10('0x3b')]);return _0x5ae255(_0x549217[_0x9f10('0x34')](0x1f4,_0x3a5705));}}return _0x5ae255(_0x9f10('0x3c'));});},'AcceptMessage':function(_0x3b3002){var _0x4bedbe=this;return new Promise(function(_0x281da4,_0x30187e){if(_0x3b3002[_0x9f10('0x3d')]&&_0x3b3002['agent']['id']){if(_0x40a48a[_0x9f10('0x3e')][_0x3b3002[_0x9f10('0x3d')]['id']]){_0x40a48a['agents'][_0x3b3002[_0x9f10('0x3d')]['id']][_0x9f10('0x3f')]=![];_0x40a48a[_0x9f10('0x3e')][_0x3b3002[_0x9f10('0x3d')]['id']]['busyQueue']=undefined;}}if(_0x3b3002[_0x9f10('0x15')]&&_0x3b3002[_0x9f10('0x15')]['id']){try{var _0x3dd294=getId(_0x3b3002[_0x9f10('0x22')],_0x3b3002[_0x9f10('0x15')]?_0x3b3002[_0x9f10('0x15')]['id']:0x0,_0x3b3002['interaction']?_0x3b3002[_0x9f10('0x16')]['id']:0x0);if(_0x40a48a[_0x9f10('0x14')][_0x3dd294]){_0x40a48a[_0x9f10('0x14')][_0x3dd294][_0x9f10('0x40')](_0x9f10('0x41'));if(rpc[_0x3b3002[_0x9f10('0x22')]+'QueueReport']){rpc[_0x3b3002[_0x9f10('0x22')]+_0x9f10('0x42')][_0x9f10('0x43')](_0x3dd294,{'UserId':_0x3b3002[_0x9f10('0x15')][_0x9f10('0x44')]})[_0x9f10('0x45')](function(_0x2b6fe7){logger[_0x9f10('0x34')]('error\x20update\x20queue\x20report');});}}return _0x281da4({'code':0xc8,'message':_0x3b3002});}catch(_0xd1da11){logger['error'](_0xd1da11[_0x9f10('0x3b')]);return _0x30187e(_0x4bedbe['error'](0x1f4,_0xd1da11));}}logger[_0x9f10('0x34')](_0x9f10('0x46'));return _0x30187e(_0x4bedbe[_0x9f10('0x34')](0x1f4,_0x9f10('0x46')));});},'RejectMessage':function(_0x10d6dc){var _0x497260=this;return new Promise(function(_0x12cf34,_0x63abfb){if(_0x10d6dc[_0x9f10('0x3d')]&&_0x10d6dc[_0x9f10('0x3d')]['id']){try{if(_0x40a48a['agents'][_0x10d6dc['agent']['id']]){_0x40a48a[_0x9f10('0x3e')][_0x10d6dc[_0x9f10('0x3d')]['id']]['busy']=![];_0x40a48a['agents'][_0x10d6dc[_0x9f10('0x3d')]['id']][_0x9f10('0x47')]=undefined;}return _0x12cf34({'code':0xc8,'message':_0x10d6dc});}catch(_0x23369b){logger['error'](_0x23369b[_0x9f10('0x3b')]);return _0x63abfb(_0x497260[_0x9f10('0x34')](0x1f4,_0x23369b));}}logger[_0x9f10('0x34')]('message\x20is\x20empty');return _0x63abfb(_0x497260[_0x9f10('0x34')](0x1f4,_0x9f10('0x46')));});},'AbandonInteraction':function(_0xe18852){var _0x48a76e=this;return new Promise(function(_0x229671,_0x401623){if(_0xe18852['channel']&&_0xe18852[_0x9f10('0x16')]&&_0xe18852[_0x9f10('0x16')]['id']){try{var _0xcd8ae7=getId(_0xe18852[_0x9f10('0x22')],_0xe18852[_0x9f10('0x15')]?_0xe18852['message']['id']:0x0,_0xe18852[_0x9f10('0x16')]?_0xe18852['interaction']['id']:0x0);if(_0x40a48a['rules'][_0xcd8ae7]){_0x40a48a[_0x9f10('0x14')][_0xcd8ae7][_0x9f10('0x40')](_0x9f10('0x41'));}return _0x229671({'code':0xc8,'message':_0xe18852});}catch(_0x277a86){logger[_0x9f10('0x34')](_0x277a86[_0x9f10('0x3b')]);return _0x401623(_0x48a76e[_0x9f10('0x34')](0x1f4,_0x277a86));}}logger['error']('message\x20is\x20empty');return _0x401623(_0x48a76e[_0x9f10('0x34')](0x1f4,_0x9f10('0x46')));});},'AgentCapacity':function(_0x1d6f4a){var _0x40f845=this;return new Promise(function(_0x2625ca,_0x2094c9){if(_0x40a48a[_0x9f10('0x3e')]['hasOwnProperty'](_0x1d6f4a['id'])){for(var _0x29bc1d in _0x1d6f4a[_0x9f10('0x48')]){if(_0x1d6f4a['capacity'][_0x9f10('0x49')](_0x29bc1d)){if(_0x40a48a[_0x9f10('0x3e')][_0x1d6f4a['id']]['hasOwnProperty'](_0x29bc1d+_0x9f10('0x4a'))){_0x40a48a[_0x9f10('0x3e')][_0x1d6f4a['id']][_0x29bc1d+'CurrentCapacity']=parseInt(_0x1d6f4a[_0x9f10('0x48')][_0x29bc1d],0xa);}}}_0x40a48a['agents'][_0x1d6f4a['id']][_0x9f10('0x4b')]();return _0x2625ca({'code':0xc8,'message':_0x40a48a[_0x9f10('0x3e')][_0x1d6f4a['id']]});}else{return _0x2094c9(_0x40f845[_0x9f10('0x34')](0x1f4,_0x9f10('0x4c')));}});},'Agents':function(_0x1a1de9){return new Promise(function(_0x4bf4d6,_0x4c5fbf){var _0x364a6e=_[_0x9f10('0x4d')](_0x40a48a['agents']);_0x4bf4d6({'count':_0x364a6e['length'],'rows':_0x364a6e});});},'ChatQueues':function(_0x5b60ef){return new Promise(function(_0x41d949,_0x216d6c){var _0x20045f=[];for(var _0xd627a2 in _0x40a48a[_0x9f10('0x4e')]){if(_0x40a48a[_0x9f10('0x4e')]['hasOwnProperty'](_0xd627a2)){var _0x3635f9=_0x40a48a[_0x9f10('0x4e')][_0xd627a2];var _0x498ad6={'id':_0x3635f9['id'],'available':_0x3635f9[_0x9f10('0x4f')],'loggedIn':_0x3635f9['loggedIn'],'name':_0x3635f9[_0x9f10('0x50')],'paused':_0x3635f9[_0x9f10('0x51')],'waiting':_0x3635f9['waiting']};_0x20045f[_0x9f10('0x23')](_0x498ad6);}}_0x41d949({'count':_0x20045f['length'],'rows':_0x20045f});});},'MailQueues':function(_0x24a518){return new Promise(function(_0x25b3e2,_0x163165){var _0x58e266=[];for(var _0x35bfbd in _0x40a48a['mailQueues']){if(_0x40a48a[_0x9f10('0x52')][_0x9f10('0x49')](_0x35bfbd)){var _0x3be022=_0x40a48a['mailQueues'][_0x35bfbd];var _0x105f25={'id':_0x3be022['id'],'available':_0x3be022['available'],'loggedIn':_0x3be022['loggedIn'],'name':_0x3be022[_0x9f10('0x50')],'paused':_0x3be022[_0x9f10('0x51')],'waiting':_0x3be022[_0x9f10('0x53')]};_0x58e266['push'](_0x105f25);}}_0x25b3e2({'count':_0x58e266[_0x9f10('0x19')],'rows':_0x58e266});});},'OpenchannelQueues':function(_0x5a64ae){return new Promise(function(_0x48ce93,_0x329a74){var _0x551a5d=[];for(var _0x4e7b27 in _0x40a48a[_0x9f10('0x54')]){if(_0x40a48a['openchannelQueues'][_0x9f10('0x49')](_0x4e7b27)){var _0x9f6f4b=_0x40a48a[_0x9f10('0x54')][_0x4e7b27];var _0x5bc191={'id':_0x9f6f4b['id'],'available':_0x9f6f4b[_0x9f10('0x4f')],'loggedIn':_0x9f6f4b[_0x9f10('0x55')],'name':_0x9f6f4b['name'],'paused':_0x9f6f4b[_0x9f10('0x51')],'waiting':_0x9f6f4b['waiting']};_0x551a5d['push'](_0x5bc191);}}_0x48ce93({'count':_0x551a5d[_0x9f10('0x19')],'rows':_0x551a5d});});},'SmsQueues':function(_0x3a5032){return new Promise(function(_0x31580a,_0x2911c2){var _0x1081a7=[];for(var _0x9688a7 in _0x40a48a[_0x9f10('0x56')]){if(_0x40a48a['smsQueues'][_0x9f10('0x49')](_0x9688a7)){var _0x2d87cb=_0x40a48a[_0x9f10('0x56')][_0x9688a7];var _0x3e6b7d={'id':_0x2d87cb['id'],'available':_0x2d87cb[_0x9f10('0x4f')],'loggedIn':_0x2d87cb[_0x9f10('0x55')],'name':_0x2d87cb[_0x9f10('0x50')],'paused':_0x2d87cb[_0x9f10('0x51')],'waiting':_0x2d87cb[_0x9f10('0x53')]};_0x1081a7['push'](_0x3e6b7d);}}_0x31580a({'count':_0x1081a7[_0x9f10('0x19')],'rows':_0x1081a7});});},'FaxQueues':function(_0x43e668){return new Promise(function(_0x45a730,_0x1c3b52){var _0x5a3bbc=[];for(var _0x29f63e in _0x40a48a[_0x9f10('0x57')]){if(_0x40a48a[_0x9f10('0x57')][_0x9f10('0x49')](_0x29f63e)){var _0x4d68d3=_0x40a48a['faxQueues'][_0x29f63e];var _0x7f13fa={'id':_0x4d68d3['id'],'available':_0x4d68d3[_0x9f10('0x4f')],'loggedIn':_0x4d68d3[_0x9f10('0x55')],'name':_0x4d68d3[_0x9f10('0x50')],'paused':_0x4d68d3[_0x9f10('0x51')],'waiting':_0x4d68d3[_0x9f10('0x53')]};_0x5a3bbc[_0x9f10('0x23')](_0x7f13fa);}}_0x45a730({'count':_0x5a3bbc[_0x9f10('0x19')],'rows':_0x5a3bbc});});},'WhatsappQueues':function(_0x129f91){return new Promise(function(_0x13ee91,_0x108e98){var _0x17c405=[];for(var _0x28d042 in _0x40a48a[_0x9f10('0x58')]){if(_0x40a48a[_0x9f10('0x58')]['hasOwnProperty'](_0x28d042)){var _0x305eee=_0x40a48a[_0x9f10('0x58')][_0x28d042];var _0x486417={'id':_0x305eee['id'],'available':_0x305eee[_0x9f10('0x4f')],'loggedIn':_0x305eee[_0x9f10('0x55')],'name':_0x305eee[_0x9f10('0x50')],'paused':_0x305eee[_0x9f10('0x51')],'waiting':_0x305eee['waiting']};_0x17c405[_0x9f10('0x23')](_0x486417);}}_0x13ee91({'count':_0x17c405['length'],'rows':_0x17c405});});},'ChatQueuesWaitingInteractions':function(_0x143c8b){return new Promise(function(_0x38667a,_0x35f461){var _0x59b527=_[_0x9f10('0x4d')](_0x40a48a[_0x9f10('0x59')]);_0x38667a({'count':_0x59b527[_0x9f10('0x19')],'rows':_0x59b527});});},'MailQueuesWaitingInteractions':function(_0x4b700a){return new Promise(function(_0x29e1d3,_0x215f94){var _0x28890c=_['values'](_0x40a48a['mailQueuesWaitingInteractions']);_0x29e1d3({'count':_0x28890c['length'],'rows':_0x28890c});});},'OpenchannelQueuesWaitingInteractions':function(_0x5b78cd){return new Promise(function(_0x5412c5,_0x5c100d){var _0x4be88a=_[_0x9f10('0x4d')](_0x40a48a[_0x9f10('0x5a')]);_0x5412c5({'count':_0x4be88a['length'],'rows':_0x4be88a});});},'SmsQueuesWaitingInteractions':function(_0xa0988b){return new Promise(function(_0x476aac,_0x454506){var _0x3b3dd8=_[_0x9f10('0x4d')](_0x40a48a[_0x9f10('0x5b')]);_0x476aac({'count':_0x3b3dd8[_0x9f10('0x19')],'rows':_0x3b3dd8});});},'FaxQueuesWaitingInteractions':function(_0x27a67c){return new Promise(function(_0x2c3854,_0x1fc092){var _0x57a14b=_[_0x9f10('0x4d')](_0x40a48a[_0x9f10('0x5c')]);_0x2c3854({'count':_0x57a14b['length'],'rows':_0x57a14b});});},'WhatsappQueuesWaitingInteractions':function(_0x42a8bf){return new Promise(function(_0x5b2f86,_0x58718e){var _0xa440a9=_[_0x9f10('0x4d')](_0x40a48a['whatsappQueuesWaitingInteractions']);_0x5b2f86({'count':_0xa440a9[_0x9f10('0x19')],'rows':_0xa440a9});});}};var _0xa7dfd3=jayson['server'](_0x2b6c4c)[_0x9f10('0x5d')]();_0xa7dfd3['on'](_0x9f10('0x34'),function(_0x4aa451){logger['error'](JSON[_0x9f10('0x38')](_0x4aa451));return _0x59bcad(_0x4aa451);});_0xa7dfd3[_0x9f10('0x5e')](0x232c,'127.0.0.1',function(){console['log'](_0x9f10('0x5f'),0x232c);return _0x507e1a(_0x9f10('0x60')+0x232c);});});}; \ No newline at end of file +var _0xfe57=['../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','rules','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','split','channel','mail','push','slice','appdata','dialogflowv2','amazonlex','TagId','getMustacheRender','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','complete','stack','agent','agents','busy','busyQueue','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','emit','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','chatQueues','name','waiting','mailQueues','available','loggedIn','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','listen','127.0.0.1','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/chatQueueReport'];(function(_0x1b8d87,_0x4168fb){var _0x182b74=function(_0x12b570){while(--_0x12b570){_0x1b8d87['push'](_0x1b8d87['shift']());}};_0x182b74(++_0x4168fb);}(_0xfe57,0x195));var _0x7fe5=function(_0x3f4dd9,_0xe0b819){_0x3f4dd9=_0x3f4dd9-0x0;var _0x31c54a=_0xfe57[_0x3f4dd9];return _0x31c54a;};'use strict';var _=require(_0x7fe5('0x0'));var util=require(_0x7fe5('0x1'));var path=require('path');var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x7fe5('0x2'));var uuid=require(_0x7fe5('0x3'));var utils=require(_0x7fe5('0x4'));var config=require(_0x7fe5('0x5'));var logger=require(_0x7fe5('0x6'))(_0x7fe5('0x7'));var rpc={'openchannelQueueReport':require(_0x7fe5('0x8')),'mailQueueReport':require(_0x7fe5('0x9')),'chatQueueReport':require(_0x7fe5('0xa')),'smsQueueReport':require(_0x7fe5('0xb')),'faxQueueReport':require(_0x7fe5('0xc')),'whatsappQueueReport':require(_0x7fe5('0xd'))};var RuleEngine=require(_0x7fe5('0xe'));function getId(_0x4ab081,_0x13b391,_0x5ef757){return util[_0x7fe5('0xf')](_0x7fe5('0x10'),_0x4ab081,_0x13b391||0x0,_0x5ef757||0x0);}function getIntervals(_0x5c75bb,_0x534b10){var _0x41f76e=[];if(!_[_0x7fe5('0x11')](_0x534b10['IntervalId'])&&!_[_0x7fe5('0x11')](_0x5c75bb[_0x534b10['IntervalId']])&&!_['isNil'](_0x5c75bb[_0x534b10[_0x7fe5('0x12')]][_0x7fe5('0x13')])){_0x41f76e=_[_0x7fe5('0x14')](_0x5c75bb[_0x534b10[_0x7fe5('0x12')]]['Intervals'],_0x7fe5('0x15'));}else if(!_[_0x7fe5('0x11')](_0x534b10['interval'])){_0x41f76e=[_0x534b10[_0x7fe5('0x15')]];}return _0x41f76e;}exports['listen']=function(_0x1f84b5){_0x1f84b5[_0x7fe5('0x16')]={};return new BPromise(function(_0x4e8ea0,_0x1ce051){var _0x56e76f={'Start':function(_0x39f175){var _0x221ab2=this;return new Promise(function(_0xbdf0a4,_0x4989a){if(_0x39f175){try{var _0x3f699b=[];var _0x104bc8=getId(_0x39f175['channel'],_0x39f175[_0x7fe5('0x17')]?_0x39f175[_0x7fe5('0x17')]['id']:0x0,_0x39f175[_0x7fe5('0x18')]?_0x39f175[_0x7fe5('0x18')]['id']:0x0);if(_0x39f175[_0x7fe5('0x19')]&&_[_0x7fe5('0x1a')](_0x39f175[_0x7fe5('0x19')])&&_0x39f175[_0x7fe5('0x19')][_0x7fe5('0x1b')]){for(var _0x3b98cd=0x0;_0x3b98cd<_0x39f175['applications']['length'];_0x3b98cd+=0x1){var _0x1bf57a=_0x39f175[_0x7fe5('0x19')][_0x3b98cd];if(fs[_0x7fe5('0x1c')](path[_0x7fe5('0x1d')](__dirname,_0x7fe5('0x19'),_0x1bf57a[_0x7fe5('0x1e')]+_0x7fe5('0x1f')))){var _0xdd9df7=[];switch(_0x1bf57a[_0x7fe5('0x1e')][_0x7fe5('0x20')]()){case _0x7fe5('0x21'):var _0x204f09=_0x1bf57a['appdata'][_0x7fe5('0x22')](',');if(_0x39f175[_0x7fe5('0x23')]===_0x7fe5('0x24')){_0xdd9df7['push'](_0x204f09[0x0]);_0xdd9df7[_0x7fe5('0x25')](_0x204f09[0x1]);_0xdd9df7['push'](_0x204f09[_0x7fe5('0x26')](0x2,_0x204f09['length'])[_0x7fe5('0x1d')](','));}else{_0xdd9df7[_0x7fe5('0x25')](_0x204f09[0x0]);_0xdd9df7[_0x7fe5('0x25')](_0x204f09[_0x7fe5('0x26')](0x1,_0x204f09[_0x7fe5('0x1b')])[_0x7fe5('0x1d')](','));}break;case'dialogflow':var _0x5f2d25=_0x1bf57a[_0x7fe5('0x27')][_0x7fe5('0x22')](',');_0xdd9df7[_0x7fe5('0x25')](_0x5f2d25[0x0]);_0xdd9df7[_0x7fe5('0x25')](_0x5f2d25[0x1]);_0xdd9df7['push'](_0x5f2d25[_0x7fe5('0x26')](0x2,_0x5f2d25['length'])[_0x7fe5('0x1d')](','));break;case _0x7fe5('0x28'):var _0x204bc8=_0x1bf57a[_0x7fe5('0x27')][_0x7fe5('0x22')](',');_0xdd9df7[_0x7fe5('0x25')](_0x204bc8[0x0]);_0xdd9df7['push'](_0x204bc8[0x1]);_0xdd9df7[_0x7fe5('0x25')](_0x204bc8[0x2]);_0xdd9df7[_0x7fe5('0x25')](_0x204bc8[0x3]);_0xdd9df7['push'](_0x204bc8[_0x7fe5('0x26')](0x4,_0x204bc8[_0x7fe5('0x1b')])[_0x7fe5('0x1d')](','));break;case _0x7fe5('0x29'):var _0x465e46=_0x1bf57a['appdata']['split'](',');_0xdd9df7[_0x7fe5('0x25')](_0x465e46[0x0]);_0xdd9df7[_0x7fe5('0x25')](_0x465e46[0x1]);_0xdd9df7[_0x7fe5('0x25')](_0x465e46[0x2]);_0xdd9df7[_0x7fe5('0x25')](_0x465e46[0x3]);_0xdd9df7['push'](_0x465e46[_0x7fe5('0x26')](0x4,_0x465e46[_0x7fe5('0x1b')])[_0x7fe5('0x1d')](','));break;case _0x7fe5('0x17'):_0xdd9df7[_0x7fe5('0x25')](_0x1bf57a[_0x7fe5('0x27')]);break;case'tag':_0xdd9df7[_0x7fe5('0x25')](_0x1bf57a[_0x7fe5('0x2a')]);_0xdd9df7[_0x7fe5('0x25')](_0x1bf57a[_0x7fe5('0x27')]);break;case'tvox':var _0x5617c2=utils[_0x7fe5('0x2b')](_0x39f175['account'][_0x7fe5('0x2c')],_0x39f175);var _0x513680=_0x1bf57a[_0x7fe5('0x27')]['split'](',');_0xdd9df7['push'](_0x513680[0x0]);_0xdd9df7['push'](_0x513680[0x1]);_0xdd9df7['push'](_0x513680[0x2]);_0xdd9df7[_0x7fe5('0x25')](_0x513680[0x3]);_0xdd9df7[_0x7fe5('0x25')](_0x513680[0x4]);_0xdd9df7['push'](_0x513680[0x5]);_0xdd9df7[_0x7fe5('0x25')](_0x513680[0x6]);_0xdd9df7[_0x7fe5('0x25')](_0x513680[0x7]);_0xdd9df7['push'](_0x513680[0x8]);_0xdd9df7[_0x7fe5('0x25')](_0x513680[0x9]);_0xdd9df7['push'](_0x513680[0xa]);_0xdd9df7['push'](_0x39f175[_0x7fe5('0x18')]['id']);_0xdd9df7[_0x7fe5('0x25')](_0x39f175[_0x7fe5('0x17')]['id']);_0xdd9df7[_0x7fe5('0x25')](_0x1bf57a[_0x7fe5('0x2d')]);_0xdd9df7['push'](_0x39f175[_0x7fe5('0x18')][_0x7fe5('0x2e')]);_0xdd9df7['push'](_0x39f175[_0x7fe5('0x2f')][_0x7fe5('0x2f')]);_0xdd9df7[_0x7fe5('0x25')](_0x5617c2);break;default:_0xdd9df7=_[_0x7fe5('0x11')](_0x1bf57a[_0x7fe5('0x27')])?[]:_0x1bf57a[_0x7fe5('0x27')][_0x7fe5('0x22')](',');}var _0x50cfa5={'id':util['format'](_0x7fe5('0x30'),_0x104bc8,_0x1bf57a['id'],_0x1bf57a['app']),'condition':require(_0x7fe5('0x31'))[_0x7fe5('0x32')](_0x104bc8,getIntervals(_0x1f84b5['intervals'],_0x1bf57a),_0x1f84b5),'consequence':require(_0x7fe5('0x33')+_0x1bf57a[_0x7fe5('0x1e')])[_0x7fe5('0x34')](_0x104bc8,_0xdd9df7,_0x1f84b5,_0x39f175),'p':_0x1bf57a[_0x7fe5('0x35')]||0x0};logger[_0x7fe5('0x36')](_0x7fe5('0x37'),_0x50cfa5['id'],_0x7fe5('0x38'),getIntervals(_0x1f84b5['intervals'],_0x1bf57a)['join'](_0x7fe5('0x39')));_0x3f699b['push'](_0x50cfa5);}else{logger[_0x7fe5('0x3a')](_0x7fe5('0x3b'),path[_0x7fe5('0x1d')](__dirname,_0x7fe5('0x19'),_0x1bf57a['app']+_0x7fe5('0x1f')));}}_0x1f84b5['rules'][_0x104bc8]=new RuleEngine(_0x3f699b);_0x1f84b5['rules'][_0x104bc8][_0x7fe5('0x3c')](_0x39f175,function(_0x585f27){logger['info'](_0x7fe5('0x3d'),JSON[_0x7fe5('0x3e')](_0x585f27[_0x7fe5('0x3f')]));if(_0x1f84b5[_0x7fe5('0x16')][_0x104bc8]){_0x1f84b5[_0x7fe5('0x16')][_0x104bc8]['emit'](_0x7fe5('0x40'));}});return _0xbdf0a4({'code':0xc8,'message':_0x39f175});}else{logger[_0x7fe5('0x36')]('No\x20applications\x20to\x20execute');return _0xbdf0a4({'code':0xc8,'message':_0x39f175});}}catch(_0x216395){logger[_0x7fe5('0x3a')](_0x216395[_0x7fe5('0x41')]);return _0x4989a(_0x221ab2[_0x7fe5('0x3a')](0x1f4,_0x216395));}}return _0x4989a('routing\x20is\x20empty');});},'AcceptMessage':function(_0x2dfb59){var _0x13225e=this;return new Promise(function(_0x7355ac,_0x489ec7){if(_0x2dfb59[_0x7fe5('0x42')]&&_0x2dfb59[_0x7fe5('0x42')]['id']){if(_0x1f84b5[_0x7fe5('0x43')][_0x2dfb59['agent']['id']]){_0x1f84b5[_0x7fe5('0x43')][_0x2dfb59[_0x7fe5('0x42')]['id']][_0x7fe5('0x44')]=![];_0x1f84b5['agents'][_0x2dfb59[_0x7fe5('0x42')]['id']][_0x7fe5('0x45')]=undefined;}}if(_0x2dfb59[_0x7fe5('0x17')]&&_0x2dfb59[_0x7fe5('0x17')]['id']){try{var _0x1f8144=getId(_0x2dfb59[_0x7fe5('0x23')],_0x2dfb59[_0x7fe5('0x17')]?_0x2dfb59[_0x7fe5('0x17')]['id']:0x0,_0x2dfb59[_0x7fe5('0x18')]?_0x2dfb59[_0x7fe5('0x18')]['id']:0x0);if(_0x1f84b5[_0x7fe5('0x16')][_0x1f8144]){_0x1f84b5['rules'][_0x1f8144]['emit']('end');if(rpc[_0x2dfb59['channel']+_0x7fe5('0x46')]){rpc[_0x2dfb59['channel']+_0x7fe5('0x46')][_0x7fe5('0x47')](_0x1f8144,{'UserId':_0x2dfb59[_0x7fe5('0x17')][_0x7fe5('0x48')]})[_0x7fe5('0x49')](function(_0x5b24a4){logger[_0x7fe5('0x3a')](_0x7fe5('0x4a'));});}}return _0x7355ac({'code':0xc8,'message':_0x2dfb59});}catch(_0x1bd234){logger[_0x7fe5('0x3a')](_0x1bd234[_0x7fe5('0x41')]);return _0x489ec7(_0x13225e[_0x7fe5('0x3a')](0x1f4,_0x1bd234));}}logger[_0x7fe5('0x3a')](_0x7fe5('0x4b'));return _0x489ec7(_0x13225e[_0x7fe5('0x3a')](0x1f4,_0x7fe5('0x4b')));});},'RejectMessage':function(_0x5ddfb3){var _0x1c16d4=this;return new Promise(function(_0x401d05,_0x2aa38d){if(_0x5ddfb3[_0x7fe5('0x42')]&&_0x5ddfb3[_0x7fe5('0x42')]['id']){try{if(_0x1f84b5[_0x7fe5('0x43')][_0x5ddfb3['agent']['id']]){_0x1f84b5[_0x7fe5('0x43')][_0x5ddfb3[_0x7fe5('0x42')]['id']][_0x7fe5('0x44')]=![];_0x1f84b5[_0x7fe5('0x43')][_0x5ddfb3[_0x7fe5('0x42')]['id']][_0x7fe5('0x45')]=undefined;}return _0x401d05({'code':0xc8,'message':_0x5ddfb3});}catch(_0xb44f47){logger['error'](_0xb44f47[_0x7fe5('0x41')]);return _0x2aa38d(_0x1c16d4[_0x7fe5('0x3a')](0x1f4,_0xb44f47));}}logger[_0x7fe5('0x3a')](_0x7fe5('0x4b'));return _0x2aa38d(_0x1c16d4[_0x7fe5('0x3a')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x2ddf6b){var _0x34a430=this;return new Promise(function(_0x168e59,_0x33ce77){if(_0x2ddf6b['channel']&&_0x2ddf6b[_0x7fe5('0x18')]&&_0x2ddf6b[_0x7fe5('0x18')]['id']){try{var _0x13b865=getId(_0x2ddf6b[_0x7fe5('0x23')],_0x2ddf6b[_0x7fe5('0x17')]?_0x2ddf6b[_0x7fe5('0x17')]['id']:0x0,_0x2ddf6b[_0x7fe5('0x18')]?_0x2ddf6b[_0x7fe5('0x18')]['id']:0x0);if(_0x1f84b5[_0x7fe5('0x16')][_0x13b865]){_0x1f84b5[_0x7fe5('0x16')][_0x13b865][_0x7fe5('0x4c')]('end');}return _0x168e59({'code':0xc8,'message':_0x2ddf6b});}catch(_0x44015c){logger[_0x7fe5('0x3a')](_0x44015c[_0x7fe5('0x41')]);return _0x33ce77(_0x34a430['error'](0x1f4,_0x44015c));}}logger['error'](_0x7fe5('0x4b'));return _0x33ce77(_0x34a430['error'](0x1f4,_0x7fe5('0x4b')));});},'AgentCapacity':function(_0x46e8f5){var _0x491702=this;return new Promise(function(_0x16deb8,_0x47c811){if(_0x1f84b5[_0x7fe5('0x43')][_0x7fe5('0x4d')](_0x46e8f5['id'])){for(var _0x28cb7a in _0x46e8f5[_0x7fe5('0x4e')]){if(_0x46e8f5[_0x7fe5('0x4e')][_0x7fe5('0x4d')](_0x28cb7a)){if(_0x1f84b5['agents'][_0x46e8f5['id']]['hasOwnProperty'](_0x28cb7a+_0x7fe5('0x4f'))){_0x1f84b5[_0x7fe5('0x43')][_0x46e8f5['id']][_0x28cb7a+_0x7fe5('0x4f')]=parseInt(_0x46e8f5[_0x7fe5('0x4e')][_0x28cb7a],0xa);}}}_0x1f84b5[_0x7fe5('0x43')][_0x46e8f5['id']]['updateRealtime']();return _0x16deb8({'code':0xc8,'message':_0x1f84b5[_0x7fe5('0x43')][_0x46e8f5['id']]});}else{return _0x47c811(_0x491702[_0x7fe5('0x3a')](0x1f4,_0x7fe5('0x50')));}});},'Agents':function(_0x1a5b49){return new Promise(function(_0x37f445,_0x5b1e62){var _0x963932=_[_0x7fe5('0x51')](_0x1f84b5[_0x7fe5('0x43')]);_0x37f445({'count':_0x963932[_0x7fe5('0x1b')],'rows':_0x963932});});},'ChatQueues':function(_0xd67174){return new Promise(function(_0x409403,_0x191927){var _0x512252=[];for(var _0x343057 in _0x1f84b5[_0x7fe5('0x52')]){if(_0x1f84b5[_0x7fe5('0x52')][_0x7fe5('0x4d')](_0x343057)){var _0x87af50=_0x1f84b5[_0x7fe5('0x52')][_0x343057];var _0x9d0a0c={'id':_0x87af50['id'],'available':_0x87af50['available'],'loggedIn':_0x87af50['loggedIn'],'name':_0x87af50[_0x7fe5('0x53')],'paused':_0x87af50['paused'],'waiting':_0x87af50[_0x7fe5('0x54')]};_0x512252['push'](_0x9d0a0c);}}_0x409403({'count':_0x512252[_0x7fe5('0x1b')],'rows':_0x512252});});},'MailQueues':function(_0x42a144){return new Promise(function(_0xce6647,_0x31eb57){var _0x471942=[];for(var _0x32faf8 in _0x1f84b5[_0x7fe5('0x55')]){if(_0x1f84b5[_0x7fe5('0x55')]['hasOwnProperty'](_0x32faf8)){var _0x2c3268=_0x1f84b5['mailQueues'][_0x32faf8];var _0x32c41f={'id':_0x2c3268['id'],'available':_0x2c3268[_0x7fe5('0x56')],'loggedIn':_0x2c3268[_0x7fe5('0x57')],'name':_0x2c3268['name'],'paused':_0x2c3268[_0x7fe5('0x58')],'waiting':_0x2c3268[_0x7fe5('0x54')]};_0x471942[_0x7fe5('0x25')](_0x32c41f);}}_0xce6647({'count':_0x471942[_0x7fe5('0x1b')],'rows':_0x471942});});},'OpenchannelQueues':function(_0x31404b){return new Promise(function(_0x24d798,_0x5b8b03){var _0x2bf9ed=[];for(var _0x46d509 in _0x1f84b5['openchannelQueues']){if(_0x1f84b5[_0x7fe5('0x59')][_0x7fe5('0x4d')](_0x46d509)){var _0x56a92b=_0x1f84b5[_0x7fe5('0x59')][_0x46d509];var _0x522b93={'id':_0x56a92b['id'],'available':_0x56a92b[_0x7fe5('0x56')],'loggedIn':_0x56a92b[_0x7fe5('0x57')],'name':_0x56a92b[_0x7fe5('0x53')],'paused':_0x56a92b[_0x7fe5('0x58')],'waiting':_0x56a92b[_0x7fe5('0x54')]};_0x2bf9ed['push'](_0x522b93);}}_0x24d798({'count':_0x2bf9ed[_0x7fe5('0x1b')],'rows':_0x2bf9ed});});},'SmsQueues':function(_0x4b9266){return new Promise(function(_0x1723eb,_0x3e1c8f){var _0x2b7fc2=[];for(var _0x549415 in _0x1f84b5['smsQueues']){if(_0x1f84b5[_0x7fe5('0x5a')]['hasOwnProperty'](_0x549415)){var _0x23aa4d=_0x1f84b5[_0x7fe5('0x5a')][_0x549415];var _0x5f050c={'id':_0x23aa4d['id'],'available':_0x23aa4d[_0x7fe5('0x56')],'loggedIn':_0x23aa4d[_0x7fe5('0x57')],'name':_0x23aa4d['name'],'paused':_0x23aa4d[_0x7fe5('0x58')],'waiting':_0x23aa4d[_0x7fe5('0x54')]};_0x2b7fc2[_0x7fe5('0x25')](_0x5f050c);}}_0x1723eb({'count':_0x2b7fc2['length'],'rows':_0x2b7fc2});});},'FaxQueues':function(_0x3f26a7){return new Promise(function(_0x2c0d0a,_0x522452){var _0xc5ad82=[];for(var _0x3d2779 in _0x1f84b5['faxQueues']){if(_0x1f84b5[_0x7fe5('0x5b')]['hasOwnProperty'](_0x3d2779)){var _0x586bce=_0x1f84b5[_0x7fe5('0x5b')][_0x3d2779];var _0x2d06a3={'id':_0x586bce['id'],'available':_0x586bce['available'],'loggedIn':_0x586bce['loggedIn'],'name':_0x586bce[_0x7fe5('0x53')],'paused':_0x586bce['paused'],'waiting':_0x586bce[_0x7fe5('0x54')]};_0xc5ad82['push'](_0x2d06a3);}}_0x2c0d0a({'count':_0xc5ad82[_0x7fe5('0x1b')],'rows':_0xc5ad82});});},'WhatsappQueues':function(_0x2ad4bd){return new Promise(function(_0xba6830,_0xb576f3){var _0xfea96=[];for(var _0x4d54cd in _0x1f84b5[_0x7fe5('0x5c')]){if(_0x1f84b5[_0x7fe5('0x5c')][_0x7fe5('0x4d')](_0x4d54cd)){var _0x87ff54=_0x1f84b5[_0x7fe5('0x5c')][_0x4d54cd];var _0x2f9ee9={'id':_0x87ff54['id'],'available':_0x87ff54[_0x7fe5('0x56')],'loggedIn':_0x87ff54[_0x7fe5('0x57')],'name':_0x87ff54[_0x7fe5('0x53')],'paused':_0x87ff54[_0x7fe5('0x58')],'waiting':_0x87ff54['waiting']};_0xfea96[_0x7fe5('0x25')](_0x2f9ee9);}}_0xba6830({'count':_0xfea96[_0x7fe5('0x1b')],'rows':_0xfea96});});},'ChatQueuesWaitingInteractions':function(_0x1e7f68){return new Promise(function(_0x21d716,_0x2fc9d8){var _0x4c481c=_[_0x7fe5('0x51')](_0x1f84b5[_0x7fe5('0x5d')]);_0x21d716({'count':_0x4c481c[_0x7fe5('0x1b')],'rows':_0x4c481c});});},'MailQueuesWaitingInteractions':function(_0x123f3f){return new Promise(function(_0x1a3cae,_0x46c576){var _0x346a87=_[_0x7fe5('0x51')](_0x1f84b5[_0x7fe5('0x5e')]);_0x1a3cae({'count':_0x346a87[_0x7fe5('0x1b')],'rows':_0x346a87});});},'OpenchannelQueuesWaitingInteractions':function(_0x354179){return new Promise(function(_0x51d8ca,_0x424fb5){var _0x5412eb=_[_0x7fe5('0x51')](_0x1f84b5[_0x7fe5('0x5f')]);_0x51d8ca({'count':_0x5412eb[_0x7fe5('0x1b')],'rows':_0x5412eb});});},'SmsQueuesWaitingInteractions':function(_0x53ee9f){return new Promise(function(_0x25a2dd,_0x3fca5e){var _0x226ada=_['values'](_0x1f84b5['smsQueuesWaitingInteractions']);_0x25a2dd({'count':_0x226ada['length'],'rows':_0x226ada});});},'FaxQueuesWaitingInteractions':function(_0x45c599){return new Promise(function(_0x3235a9,_0x2b53a6){var _0x23f30b=_['values'](_0x1f84b5[_0x7fe5('0x60')]);_0x3235a9({'count':_0x23f30b[_0x7fe5('0x1b')],'rows':_0x23f30b});});},'WhatsappQueuesWaitingInteractions':function(_0x48e9c1){return new Promise(function(_0x5c30ec,_0x39acee){var _0x461f13=_[_0x7fe5('0x51')](_0x1f84b5[_0x7fe5('0x61')]);_0x5c30ec({'count':_0x461f13[_0x7fe5('0x1b')],'rows':_0x461f13});});}};var _0x58f404=jayson[_0x7fe5('0x62')](_0x56e76f)['http']();_0x58f404['on'](_0x7fe5('0x3a'),function(_0xf26047){logger[_0x7fe5('0x3a')](JSON[_0x7fe5('0x3e')](_0xf26047));return _0x1ce051(_0xf26047);});_0x58f404[_0x7fe5('0x63')](0x232c,_0x7fe5('0x64'),function(){console[_0x7fe5('0x65')](_0x7fe5('0x66'),0x232c);return _0x4e8ea0(_0x7fe5('0x67')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index b128ef7..10b95f0 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 _0x93dd=['Command','format','iftime\x20%s','message','error','[%s][INTERVAL]\x20%s','all','[%s][INTERVAL]\x20%s\x20%s','when','log','join','\x20|\x20','stack','stop','util','bluebird','lodash','../../../config/logger','routing','client','http','then','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length'];(function(_0x950630,_0x2cfcf5){var _0x1fdfbf=function(_0x4ecb6a){while(--_0x4ecb6a){_0x950630['push'](_0x950630['shift']());}};_0x1fdfbf(++_0x2cfcf5);}(_0x93dd,0x14d));var _0xd93d=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x93dd[_0x8c43de];return _0xa6591b;};'use strict';var util=require(_0xd93d('0x0'));var BPromise=require(_0xd93d('0x1'));var jayson=require('jayson/promise');var _=require(_0xd93d('0x2'));var logger=require(_0xd93d('0x3'))(_0xd93d('0x4'));var client=jayson[_0xd93d('0x5')][_0xd93d('0x6')]({'port':0x232a});function request(_0x3da93c,_0x1edd61){return new BPromise(function(_0x6eb067,_0x46ba25){return client['request'](_0x3da93c,_0x1edd61)[_0xd93d('0x7')](function(_0x2ab141){if(_0x2ab141['error']){return _0x46ba25(_0x2ab141['error']['message']);}else{return _0x6eb067(_0x2ab141[_0xd93d('0x8')]);}})[_0xd93d('0x9')](function(_0x4d37a9){return _0x46ba25(_0x4d37a9);});});}exports[_0xd93d('0xa')]=function(_0x13d0f4,_0x117b53,_0x4aa87d){return function(_0x4eb60d){if(_0x4aa87d[_0xd93d('0xb')]&&!_0x4aa87d[_0xd93d('0xb')][_0x13d0f4]){logger[_0xd93d('0xc')](_0xd93d('0xd'),_0x13d0f4);return _0x4eb60d['stop']();}var _0x2d2119=[];for(var _0x3fb6ee=0x0;_0x3fb6ee<_0x117b53[_0xd93d('0xe')];_0x3fb6ee+=0x1){_0x2d2119['push'](request(_0xd93d('0xf'),{'command':util[_0xd93d('0x10')](_0xd93d('0x11'),_0x117b53[_0x3fb6ee])})['then'](function(_0x3c428d){return _0x3c428d&&_0x3c428d[_0xd93d('0x12')]&&_0x3c428d[_0xd93d('0x12')]['indexOf']('true')>=0x0?!![]:![];})[_0xd93d('0x9')](function(_0x3d4dea){logger[_0xd93d('0x13')](_0xd93d('0x14'),_0x13d0f4,_0x117b53[_0x3fb6ee]);}));}BPromise[_0xd93d('0x15')](_0x2d2119)[_0xd93d('0x7')](function(_0x3d7349){var _0x1bbd5c=_['some'](_0x3d7349);logger[_0xd93d('0xc')](_0xd93d('0x16'),_0x13d0f4,_0x117b53['join']('\x20|\x20'),_0x1bbd5c);_0x4eb60d[_0xd93d('0x17')](_0x1bbd5c);})[_0xd93d('0x9')](function(_0x4650a1){console[_0xd93d('0x18')](_0x4650a1);logger[_0xd93d('0x13')]('[%s][INTERVAL]\x20%s\x20%s',_0x13d0f4,_0x117b53[_0xd93d('0x19')](_0xd93d('0x1a')),_0x4650a1[_0xd93d('0x1b')]);_0x4eb60d[_0xd93d('0x1c')]();});};}; \ No newline at end of file +var _0x90bb=['true','[%s][INTERVAL]\x20%s','all','some','join','\x20|\x20','when','log','[%s][INTERVAL]\x20%s\x20%s','stack','util','bluebird','lodash','../../../config/logger','routing','http','request','error','message','result','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','format','iftime\x20%s','then','indexOf'];(function(_0x65d13d,_0x49e929){var _0x309bb3=function(_0x2d7f73){while(--_0x2d7f73){_0x65d13d['push'](_0x65d13d['shift']());}};_0x309bb3(++_0x49e929);}(_0x90bb,0x17e));var _0xb90b=function(_0x2cc386,_0x105121){_0x2cc386=_0x2cc386-0x0;var _0x731ae4=_0x90bb[_0x2cc386];return _0x731ae4;};'use strict';var util=require(_0xb90b('0x0'));var BPromise=require(_0xb90b('0x1'));var jayson=require('jayson/promise');var _=require(_0xb90b('0x2'));var logger=require(_0xb90b('0x3'))(_0xb90b('0x4'));var client=jayson['client'][_0xb90b('0x5')]({'port':0x232a});function request(_0x5cb06a,_0x4a7bc3){return new BPromise(function(_0x287190,_0x5cf063){return client[_0xb90b('0x6')](_0x5cb06a,_0x4a7bc3)['then'](function(_0x335217){if(_0x335217['error']){return _0x5cf063(_0x335217[_0xb90b('0x7')][_0xb90b('0x8')]);}else{return _0x287190(_0x335217[_0xb90b('0x9')]);}})[_0xb90b('0xa')](function(_0x2497f3){return _0x5cf063(_0x2497f3);});});}exports[_0xb90b('0xb')]=function(_0x142982,_0x501be0,_0x4be472){return function(_0x55016c){if(_0x4be472[_0xb90b('0xc')]&&!_0x4be472['rules'][_0x142982]){logger['info'](_0xb90b('0xd'),_0x142982);return _0x55016c[_0xb90b('0xe')]();}var _0x1ed418=[];for(var _0x233632=0x0;_0x233632<_0x501be0[_0xb90b('0xf')];_0x233632+=0x1){_0x1ed418['push'](request(_0xb90b('0x10'),{'command':util[_0xb90b('0x11')](_0xb90b('0x12'),_0x501be0[_0x233632])})[_0xb90b('0x13')](function(_0x131027){return _0x131027&&_0x131027[_0xb90b('0x8')]&&_0x131027['message'][_0xb90b('0x14')](_0xb90b('0x15'))>=0x0?!![]:![];})['catch'](function(_0x425834){logger[_0xb90b('0x7')](_0xb90b('0x16'),_0x142982,_0x501be0[_0x233632]);}));}BPromise[_0xb90b('0x17')](_0x1ed418)[_0xb90b('0x13')](function(_0x444239){var _0x5b0680=_[_0xb90b('0x18')](_0x444239);logger['info']('[%s][INTERVAL]\x20%s\x20%s',_0x142982,_0x501be0[_0xb90b('0x19')](_0xb90b('0x1a')),_0x5b0680);_0x55016c[_0xb90b('0x1b')](_0x5b0680);})[_0xb90b('0xa')](function(_0x4b61b1){console[_0xb90b('0x1c')](_0x4b61b1);logger[_0xb90b('0x7')](_0xb90b('0x1d'),_0x142982,_0x501be0[_0xb90b('0x19')](_0xb90b('0x1a')),_0x4b61b1[_0xb90b('0x1e')]);_0x55016c[_0xb90b('0xe')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 877f88a..046168c 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 _0x6f7a=['indexOf','splice','agent','complete','diffTime','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','then','type','acw','acwtime','acwTimeout','CreateVoiceAgentReport','request','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','called','connectedlinename','error','agentringnoanswer','agentringnoanswerAt','reason','timeout','holdtime','talktime','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','now','abandoned','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','ringtime','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','isNil','[%s][agents][agentcomplete]','agentcomplete','agentcompleteAt','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','transferexten','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s'];(function(_0x515afd,_0x1a1e91){var _0x536d53=function(_0x1d3a89){while(--_0x1d3a89){_0x515afd['push'](_0x515afd['shift']());}};_0x536d53(++_0x1a1e91);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0xa61d5b,_0x28999d){_0xa61d5b=_0xa61d5b-0x0;var _0x400a7c=_0x6f7a[_0xa61d5b];return _0x400a7c;};'use strict';var _=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var utils=require(_0xa6f7('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x982062,_0x4dd99d){utils[_0xa6f7('0x3')](util[_0xa6f7('0x4')](_0xa6f7('0x5'),_0x982062[_0xa6f7('0x6')],_0x982062[_0xa6f7('0x7')],_0x982062[_0xa6f7('0x8')],_0x982062[_0xa6f7('0x9')],_0x982062[_0xa6f7('0xa')],_0x982062[_0xa6f7('0xb')],_0x982062[_0xa6f7('0xc')],_0x982062[_0xa6f7('0xd')]));if(_0x982062['queue']){utils['getVoiceQueueByName'](_0x982062[_0xa6f7('0x8')])[_0xa6f7('0xe')](function(_0x397020){if(_0x397020){_0x982062[_0xa6f7('0xf')]=_0x397020[_0xa6f7('0xf')];_0x982062['agentacw']=_0x982062['agentcomplete']?_0x397020[_0xa6f7('0x10')]:![];_0x982062[_0xa6f7('0x11')]=_0x982062['agentacw']?_0x397020[_0xa6f7('0x12')]:0x0;}utils['request'](_0xa6f7('0x13'),_0x982062);});}else{utils[_0xa6f7('0x14')](_0xa6f7('0x13'),_0x982062);}if(_0x4dd99d){delete transfers[_0x982062[_0xa6f7('0x6')]];}else{delete agents[_0x982062['destuniqueid']];}}exports[_0xa6f7('0x15')]=function(_0x532352){try{utils[_0xa6f7('0x16')](util[_0xa6f7('0x4')](_0xa6f7('0x17'),_0x532352['uniqueid']),_0x532352);agents[_0x532352[_0xa6f7('0x18')]]=_0x532352;agents[_0x532352['destuniqueid']][_0xa6f7('0x19')]=utils['now']();agents[_0x532352[_0xa6f7('0x18')]][_0xa6f7('0xd')]=_0xa6f7('0x1a');agents[_0x532352['destuniqueid']][_0xa6f7('0xc')]=null;agents[_0x532352[_0xa6f7('0x18')]][_0xa6f7('0x1b')]=null;utils[_0xa6f7('0x3')](util['format']('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x532352[_0xa6f7('0x6')],agents[_0x532352['destuniqueid']][_0xa6f7('0x9')],_0x532352[_0xa6f7('0x18')]));}catch(_0x5d16d0){utils[_0xa6f7('0x1c')](util[_0xa6f7('0x4')](_0xa6f7('0x17'),_0x532352[_0xa6f7('0x6')]),_0x5d16d0);}};exports[_0xa6f7('0x1d')]=function(_0x1aa8dc){try{if(!_['isNil'](agents[_0x1aa8dc[_0xa6f7('0x18')]])){utils[_0xa6f7('0x16')](util['format']('[%s][agents][agentringnoanswer]',_0x1aa8dc['uniqueid']),_0x1aa8dc);utils[_0xa6f7('0x3')](util[_0xa6f7('0x4')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x1aa8dc['uniqueid'],agents[_0x1aa8dc['destuniqueid']][_0xa6f7('0x9')],_0x1aa8dc[_0xa6f7('0x18')]));agents[_0x1aa8dc[_0xa6f7('0x18')]]['agentringnoanswer']=!![];agents[_0x1aa8dc['destuniqueid']][_0xa6f7('0x1e')]=utils['now']();agents[_0x1aa8dc['destuniqueid']][_0xa6f7('0xd')]='timeout';agents[_0x1aa8dc[_0xa6f7('0x18')]][_0xa6f7('0x1f')]=_0xa6f7('0x20');agents[_0x1aa8dc[_0xa6f7('0x18')]][_0xa6f7('0x21')]=_0x1aa8dc['ringtime']?parseInt(_0x1aa8dc['ringtime'])/0x3e8:0x0;agents[_0x1aa8dc[_0xa6f7('0x18')]][_0xa6f7('0x22')]=0x0;unanswered['push'](_0x1aa8dc[_0xa6f7('0x18')]);}}catch(_0x27babb){utils[_0xa6f7('0x1c')](util[_0xa6f7('0x4')](_0xa6f7('0x23'),_0x1aa8dc[_0xa6f7('0x6')]),_0x27babb);}};exports[_0xa6f7('0x24')]=function(_0x54f72c){try{_[_0xa6f7('0x25')](agents,function(_0x3dee2e,_0x40b0f8){if(_0x3dee2e[_0xa6f7('0x6')]==_0x54f72c['uniqueid']&&!_[_0xa6f7('0x26')](unanswered,_0x3dee2e[_0xa6f7('0x18')])){utils['debug'](util[_0xa6f7('0x4')](_0xa6f7('0x27'),_0x54f72c['uniqueid']),_0x54f72c);utils['info'](util[_0xa6f7('0x4')](_0xa6f7('0x28'),_0x54f72c[_0xa6f7('0x6')],_0x3dee2e[_0xa6f7('0x9')],_0x3dee2e[_0xa6f7('0x18')]));_0x3dee2e['agentringnoanswer']=!![];_0x3dee2e['agentringnoanswerAt']=utils[_0xa6f7('0x29')]();_0x3dee2e['lastevent']=_0xa6f7('0x2a');_0x3dee2e[_0xa6f7('0x1f')]=_0xa6f7('0x2a');_0x3dee2e[_0xa6f7('0x21')]=_0x54f72c[_0xa6f7('0x21')];_0x3dee2e[_0xa6f7('0x22')]=0x0;writeDB(_0x3dee2e);}});}catch(_0x4d2d38){utils[_0xa6f7('0x1c')](util[_0xa6f7('0x4')](_0xa6f7('0x27'),_0x54f72c['uniqueid']),_0x4d2d38);}};exports[_0xa6f7('0x2b')]=function(_0x5ab03d){try{if(agents[_0x5ab03d[_0xa6f7('0x18')]]){utils[_0xa6f7('0x16')](util[_0xa6f7('0x4')]('[%s][agents][agentconnect]',_0x5ab03d[_0xa6f7('0x6')]),_0x5ab03d);utils[_0xa6f7('0x3')](util[_0xa6f7('0x4')](_0xa6f7('0x2c'),_0x5ab03d[_0xa6f7('0x6')],agents[_0x5ab03d[_0xa6f7('0x18')]]['membername'],_0x5ab03d[_0xa6f7('0x18')]));agents[_0x5ab03d[_0xa6f7('0x18')]][_0xa6f7('0x2d')]=utils[_0xa6f7('0x29')]();agents[_0x5ab03d[_0xa6f7('0x18')]][_0xa6f7('0xc')]=_0x5ab03d[_0xa6f7('0xc')];agents[_0x5ab03d[_0xa6f7('0x18')]]['connectedlinename']=_0x5ab03d[_0xa6f7('0x1b')];agents[_0x5ab03d[_0xa6f7('0x18')]][_0xa6f7('0x21')]=_0x5ab03d['ringtime'];agents[_0x5ab03d[_0xa6f7('0x18')]][_0xa6f7('0xd')]='connect';_[_0xa6f7('0x25')](agents,function(_0x13c7c4,_0x3ecb88){if(_0x13c7c4[_0xa6f7('0x18')]!=_0x5ab03d[_0xa6f7('0x18')]&&_0x13c7c4['uniqueid']==_0x5ab03d[_0xa6f7('0x6')]){_0x13c7c4[_0xa6f7('0x22')]=0x0;_0x13c7c4[_0xa6f7('0x21')]=_0x5ab03d[_0xa6f7('0x2e')];_0x13c7c4[_0xa6f7('0x1d')]=!![];_0x13c7c4[_0xa6f7('0x1e')]=utils[_0xa6f7('0x29')]();_0x13c7c4[_0xa6f7('0xd')]='answered_elsewhere';_0x13c7c4['reason']=_0xa6f7('0x2f');_0x13c7c4[_0xa6f7('0x30')]=_0x5ab03d[_0xa6f7('0x18')];_0x13c7c4[_0xa6f7('0x31')]=_0x5ab03d[_0xa6f7('0x9')];writeDB(_0x13c7c4);}});}}catch(_0x387714){utils[_0xa6f7('0x1c')](util[_0xa6f7('0x4')](_0xa6f7('0x32'),_0x5ab03d[_0xa6f7('0x6')]),_0x387714);}};exports['agentcomplete']=function(_0x41917c){try{if(!_[_0xa6f7('0x33')](agents[_0x41917c['destuniqueid']])){utils[_0xa6f7('0x16')](util[_0xa6f7('0x4')](_0xa6f7('0x34'),_0x41917c[_0xa6f7('0x6')]),_0x41917c);utils['info'](util[_0xa6f7('0x4')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x41917c['uniqueid'],agents[_0x41917c[_0xa6f7('0x18')]][_0xa6f7('0x9')],_0x41917c[_0xa6f7('0x18')]));agents[_0x41917c[_0xa6f7('0x18')]][_0xa6f7('0x35')]=!![];agents[_0x41917c[_0xa6f7('0x18')]][_0xa6f7('0x36')]=utils['now']();agents[_0x41917c[_0xa6f7('0x18')]][_0xa6f7('0x22')]=utils['diffTime'](agents[_0x41917c[_0xa6f7('0x18')]][_0xa6f7('0x36')],agents[_0x41917c[_0xa6f7('0x18')]]['agentconnectAt']);agents[_0x41917c[_0xa6f7('0x18')]]['reason']=_0x41917c[_0xa6f7('0x1f')];agents[_0x41917c[_0xa6f7('0x18')]][_0xa6f7('0xd')]='complete';writeDB(agents[_0x41917c['destuniqueid']]);}}catch(_0x2b06b5){utils['error'](util[_0xa6f7('0x4')]('[%s][agents][agentcomplete]',_0x41917c['uniqueid']),_0x2b06b5);}};exports[_0xa6f7('0x37')]=function(_0x2e3a04){try{if(!_[_0xa6f7('0x33')](agents[_0x2e3a04[_0xa6f7('0x38')]])){utils[_0xa6f7('0x16')](util[_0xa6f7('0x4')]('[%s][agents][blindtransfer]',_0x2e3a04[_0xa6f7('0x6')]),_0x2e3a04);utils[_0xa6f7('0x3')](util['format'](_0xa6f7('0x39'),_0x2e3a04['uniqueid'],agents[_0x2e3a04[_0xa6f7('0x38')]]['membername'],agents[_0x2e3a04['transfereruniqueid']][_0xa6f7('0x6')]));agents[_0x2e3a04[_0xa6f7('0x38')]][_0xa6f7('0x3a')]=!![];agents[_0x2e3a04[_0xa6f7('0x38')]][_0xa6f7('0x3b')]='blind';agents[_0x2e3a04[_0xa6f7('0x38')]][_0xa6f7('0x3c')]=_0x2e3a04['extension'];agents[_0x2e3a04[_0xa6f7('0x38')]]['transferuniqueid']=agents[_0x2e3a04[_0xa6f7('0x38')]][_0xa6f7('0x6')];}}catch(_0x134dd7){utils['error'](util[_0xa6f7('0x4')]('[%s][agents][blindtransfer]',_0x2e3a04[_0xa6f7('0x6')]),_0x134dd7);}};exports[_0xa6f7('0x3d')]=function(_0x236372){try{utils[_0xa6f7('0x16')](util[_0xa6f7('0x4')]('[%s][agents][attendedtransfer]',_0x236372['origtransfereruniqueid']),_0x236372);if(_0x236372[_0xa6f7('0x3e')]==_0x236372[_0xa6f7('0x3f')]){if(!_[_0xa6f7('0x33')](agents[_0x236372[_0xa6f7('0x40')]])){utils['info'](util[_0xa6f7('0x4')](_0xa6f7('0x41'),_0x236372[_0xa6f7('0x3e')],agents[_0x236372[_0xa6f7('0x40')]][_0xa6f7('0x9')]));agents[_0x236372[_0xa6f7('0x40')]]['transfer']=!![];agents[_0x236372[_0xa6f7('0x40')]][_0xa6f7('0x3b')]=_0xa6f7('0x42');agents[_0x236372['secondtransfereruniqueid']][_0xa6f7('0x3c')]=_0x236372[_0xa6f7('0x43')];agents[_0x236372[_0xa6f7('0x40')]][_0xa6f7('0x44')]=_0x236372['origtransfereruniqueid'];}if(_0x236372['transfereeuniqueid']&&agents[_0x236372[_0xa6f7('0x45')]]){agents[_0x236372[_0xa6f7('0x45')]][_0xa6f7('0x46')]=0x1;transfers[_0x236372[_0xa6f7('0x45')]]=_[_0xa6f7('0x47')](agents[_0x236372[_0xa6f7('0x45')]]);transfers[_0x236372[_0xa6f7('0x45')]]['calleridnum']=agents[_0x236372[_0xa6f7('0x40')]][_0xa6f7('0xb')];transfers[_0x236372[_0xa6f7('0x45')]][_0xa6f7('0x48')]=agents[_0x236372[_0xa6f7('0x40')]][_0xa6f7('0x48')];transfers[_0x236372[_0xa6f7('0x45')]][_0xa6f7('0x19')]=utils[_0xa6f7('0x29')]();transfers[_0x236372[_0xa6f7('0x45')]][_0xa6f7('0x2d')]=utils['now']();transfers[_0x236372[_0xa6f7('0x45')]]['holdtime']=0x0;transfers[_0x236372[_0xa6f7('0x45')]]['agententerreason']=0x2;}}else if(_0x236372[_0xa6f7('0x40')]==_0x236372[_0xa6f7('0x49')]){if(!_['isNil'](agents[_0x236372[_0xa6f7('0x3e')]])){utils[_0xa6f7('0x3')](util[_0xa6f7('0x4')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x236372[_0xa6f7('0x3e')],agents[_0x236372['origtransfereruniqueid']][_0xa6f7('0x9')]));agents[_0x236372[_0xa6f7('0x3e')]]['transfer']=!![];agents[_0x236372[_0xa6f7('0x3e')]]['transfertype']=_0xa6f7('0x42');agents[_0x236372['origtransfereruniqueid']][_0xa6f7('0x3c')]=_0x236372[_0xa6f7('0x4a')];agents[_0x236372[_0xa6f7('0x3e')]][_0xa6f7('0x44')]=_0x236372[_0xa6f7('0x40')];}if(_0x236372[_0xa6f7('0x4b')]&&agents[_0x236372[_0xa6f7('0x4b')]]){agents[_0x236372[_0xa6f7('0x4b')]][_0xa6f7('0x46')]=0x1;transfers[_0x236372[_0xa6f7('0x4b')]]=_[_0xa6f7('0x47')](agents[_0x236372[_0xa6f7('0x4b')]]);transfers[_0x236372['transfertargetuniqueid']][_0xa6f7('0xb')]=agents[_0x236372[_0xa6f7('0x3e')]][_0xa6f7('0xb')];transfers[_0x236372[_0xa6f7('0x4b')]][_0xa6f7('0x48')]=agents[_0x236372[_0xa6f7('0x3e')]][_0xa6f7('0x48')];transfers[_0x236372[_0xa6f7('0x4b')]]['agentcalledAt']=utils[_0xa6f7('0x29')]();transfers[_0x236372[_0xa6f7('0x4b')]][_0xa6f7('0x2d')]=utils['now']();transfers[_0x236372[_0xa6f7('0x4b')]][_0xa6f7('0x21')]=0x0;transfers[_0x236372[_0xa6f7('0x4b')]][_0xa6f7('0x46')]=0x2;}}}catch(_0x1a1055){utils[_0xa6f7('0x1c')](util[_0xa6f7('0x4')](_0xa6f7('0x4c'),_0x236372['origtransfereruniqueid']),_0x1a1055);}};exports['hangup']=function(_0x265194){try{utils[_0xa6f7('0x16')](util['format'](_0xa6f7('0x4d'),_0x265194[_0xa6f7('0x6')]),_0x265194);if(agents[_0x265194[_0xa6f7('0x6')]]&&agents[_0x265194['uniqueid']][_0xa6f7('0x1f')]==='timeout'){if(_0x265194['cause']==='21'){agents[_0x265194['uniqueid']]['reason']='rejected';agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0xd')]=_0xa6f7('0x4e');}utils['info'](util[_0xa6f7('0x4')](_0xa6f7('0x4f'),_0x265194[_0xa6f7('0x6')],agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x9')],agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x1f')],agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0xd')]));writeDB(agents[_0x265194[_0xa6f7('0x6')]]);var _0x55ad6b=unanswered[_0xa6f7('0x50')](_0x265194[_0xa6f7('0x6')]);if(_0x55ad6b>-0x1){unanswered[_0xa6f7('0x51')](_0x55ad6b,0x1);}}if(transfers[_0x265194[_0xa6f7('0x6')]]){transfers[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x35')]=!![];transfers[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x36')]=utils[_0xa6f7('0x29')]();transfers[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x22')]=utils['diffTime'](transfers[_0x265194['uniqueid']][_0xa6f7('0x36')],transfers[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x2d')]);transfers[_0x265194['uniqueid']][_0xa6f7('0x1f')]=_0xa6f7('0x52');transfers[_0x265194['uniqueid']][_0xa6f7('0xd')]=_0xa6f7('0x53');utils['info'](util['format'](_0xa6f7('0x4f'),_0x265194['uniqueid'],transfers[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x9')],transfers[_0x265194['uniqueid']]['reason'],transfers[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0xd')]));writeDB(transfers[_0x265194[_0xa6f7('0x6')]],!![]);}if(agents[_0x265194['uniqueid']]&&agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x2d')]){agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x35')]=!![];agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x36')]=utils[_0xa6f7('0x29')]();agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x22')]=utils[_0xa6f7('0x54')](agents[_0x265194[_0xa6f7('0x6')]]['agentcompleteAt'],agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x2d')]);agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x1f')]=agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x3a')]?'transfer':_0xa6f7('0x52');agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0xd')]=_0xa6f7('0x53');utils[_0xa6f7('0x3')](util[_0xa6f7('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x265194['uniqueid'],agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x9')],agents[_0x265194[_0xa6f7('0x6')]][_0xa6f7('0x1f')],agents[_0x265194[_0xa6f7('0x6')]]['lastevent']));writeDB(agents[_0x265194[_0xa6f7('0x6')]]);}}catch(_0x4c7383){utils[_0xa6f7('0x1c')](util[_0xa6f7('0x4')]('[%s][agents][hangup]',_0x265194['uniqueid']),_0x4c7383);}}; \ No newline at end of file +var _0xf45e=['secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transferuniqueid','transfereeuniqueid','clone','calleridname','agentcalledAt','ATTENDED','transfertargetuniqueid','agententerreason','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','./utils','info','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','getVoiceQueueByName','then','type','agentcomplete','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','debug','[%s][agents][agentringnoanswer]','agentringnoanswerAt','timeout','ringtime','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','holdtime','talktime','agentconnect','[%s][agents][agentconnect]','agentconnectAt','now','connectedlinename','answered_elsewhere','reason','answeredelsewheremembername','isNil','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','[%s][agents][blindtransfer]','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xf45e,0x115));var _0xef45=function(_0x3db8b8,_0x25e248){_0x3db8b8=_0x3db8b8-0x0;var _0x4fe121=_0xf45e[_0x3db8b8];return _0x4fe121;};'use strict';var _=require(_0xef45('0x0'));var util=require('util');var utils=require(_0xef45('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5762da,_0x17b897){utils[_0xef45('0x2')](util[_0xef45('0x3')](_0xef45('0x4'),_0x5762da[_0xef45('0x5')],_0x5762da[_0xef45('0x6')],_0x5762da[_0xef45('0x7')],_0x5762da[_0xef45('0x8')],_0x5762da[_0xef45('0x9')],_0x5762da[_0xef45('0xa')],_0x5762da[_0xef45('0xb')],_0x5762da[_0xef45('0xc')]));if(_0x5762da[_0xef45('0x7')]){utils[_0xef45('0xd')](_0x5762da[_0xef45('0x7')])[_0xef45('0xe')](function(_0x134c86){if(_0x134c86){_0x5762da[_0xef45('0xf')]=_0x134c86[_0xef45('0xf')];_0x5762da['agentacw']=_0x5762da[_0xef45('0x10')]?_0x134c86[_0xef45('0x11')]:![];_0x5762da[_0xef45('0x12')]=_0x5762da[_0xef45('0x13')]?_0x134c86[_0xef45('0x14')]:0x0;}utils[_0xef45('0x15')]('CreateVoiceAgentReport',_0x5762da);});}else{utils[_0xef45('0x15')](_0xef45('0x16'),_0x5762da);}if(_0x17b897){delete transfers[_0x5762da[_0xef45('0x5')]];}else{delete agents[_0x5762da[_0xef45('0x17')]];}}exports[_0xef45('0x18')]=function(_0x4a6e5c){try{utils['debug'](util[_0xef45('0x3')]('[%s][agents][agentcalled]',_0x4a6e5c[_0xef45('0x5')]),_0x4a6e5c);agents[_0x4a6e5c[_0xef45('0x17')]]=_0x4a6e5c;agents[_0x4a6e5c[_0xef45('0x17')]]['agentcalledAt']=utils['now']();agents[_0x4a6e5c[_0xef45('0x17')]]['lastevent']=_0xef45('0x19');agents[_0x4a6e5c[_0xef45('0x17')]][_0xef45('0xb')]=null;agents[_0x4a6e5c[_0xef45('0x17')]]['connectedlinename']=null;utils['info'](util[_0xef45('0x3')](_0xef45('0x1a'),_0x4a6e5c[_0xef45('0x5')],agents[_0x4a6e5c[_0xef45('0x17')]]['membername'],_0x4a6e5c['destuniqueid']));}catch(_0x2c57fc){utils[_0xef45('0x1b')](util[_0xef45('0x3')](_0xef45('0x1c'),_0x4a6e5c[_0xef45('0x5')]),_0x2c57fc);}};exports[_0xef45('0x1d')]=function(_0x375cbd){try{if(!_['isNil'](agents[_0x375cbd[_0xef45('0x17')]])){utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x1f'),_0x375cbd[_0xef45('0x5')]),_0x375cbd);utils['info'](util[_0xef45('0x3')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x375cbd['uniqueid'],agents[_0x375cbd[_0xef45('0x17')]][_0xef45('0x8')],_0x375cbd[_0xef45('0x17')]));agents[_0x375cbd[_0xef45('0x17')]][_0xef45('0x1d')]=!![];agents[_0x375cbd[_0xef45('0x17')]][_0xef45('0x20')]=utils['now']();agents[_0x375cbd[_0xef45('0x17')]]['lastevent']=_0xef45('0x21');agents[_0x375cbd[_0xef45('0x17')]]['reason']=_0xef45('0x21');agents[_0x375cbd[_0xef45('0x17')]]['holdtime']=_0x375cbd[_0xef45('0x22')]?parseInt(_0x375cbd['ringtime'])/0x3e8:0x0;agents[_0x375cbd['destuniqueid']]['talktime']=0x0;unanswered['push'](_0x375cbd[_0xef45('0x17')]);}}catch(_0x2f72ef){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][agentringnoanswer]',_0x375cbd[_0xef45('0x5')]),_0x2f72ef);}};exports['queuecallerabandon']=function(_0x2525da){try{_['forIn'](agents,function(_0x3e6922,_0x5bfd2d){if(_0x3e6922['uniqueid']==_0x2525da[_0xef45('0x5')]&&!_[_0xef45('0x23')](unanswered,_0x3e6922[_0xef45('0x17')])){utils[_0xef45('0x1e')](util[_0xef45('0x3')]('[%s][agents][queuecallerabandon]',_0x2525da['uniqueid']),_0x2525da);utils['info'](util[_0xef45('0x3')](_0xef45('0x24'),_0x2525da[_0xef45('0x5')],_0x3e6922[_0xef45('0x8')],_0x3e6922[_0xef45('0x17')]));_0x3e6922[_0xef45('0x1d')]=!![];_0x3e6922[_0xef45('0x20')]=utils['now']();_0x3e6922['lastevent']=_0xef45('0x25');_0x3e6922['reason']=_0xef45('0x25');_0x3e6922['holdtime']=_0x2525da[_0xef45('0x26')];_0x3e6922[_0xef45('0x27')]=0x0;writeDB(_0x3e6922);}});}catch(_0x2a7c53){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][queuecallerabandon]',_0x2525da[_0xef45('0x5')]),_0x2a7c53);}};exports[_0xef45('0x28')]=function(_0x9df07e){try{if(agents[_0x9df07e['destuniqueid']]){utils['debug'](util[_0xef45('0x3')](_0xef45('0x29'),_0x9df07e['uniqueid']),_0x9df07e);utils[_0xef45('0x2')](util['format']('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x9df07e[_0xef45('0x5')],agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x8')],_0x9df07e['destuniqueid']));agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x2a')]=utils[_0xef45('0x2b')]();agents[_0x9df07e[_0xef45('0x17')]]['connectedlinenum']=_0x9df07e['connectedlinenum'];agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x2c')]=_0x9df07e[_0xef45('0x2c')];agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0x26')]=_0x9df07e[_0xef45('0x22')];agents[_0x9df07e[_0xef45('0x17')]][_0xef45('0xc')]='connect';_['forIn'](agents,function(_0x13f8b2,_0x35d014){if(_0x13f8b2[_0xef45('0x17')]!=_0x9df07e[_0xef45('0x17')]&&_0x13f8b2[_0xef45('0x5')]==_0x9df07e[_0xef45('0x5')]){_0x13f8b2[_0xef45('0x27')]=0x0;_0x13f8b2[_0xef45('0x26')]=_0x9df07e[_0xef45('0x22')];_0x13f8b2[_0xef45('0x1d')]=!![];_0x13f8b2[_0xef45('0x20')]=utils[_0xef45('0x2b')]();_0x13f8b2[_0xef45('0xc')]=_0xef45('0x2d');_0x13f8b2[_0xef45('0x2e')]=_0xef45('0x2d');_0x13f8b2['answeredelsewheredestinationuniqueid']=_0x9df07e[_0xef45('0x17')];_0x13f8b2[_0xef45('0x2f')]=_0x9df07e[_0xef45('0x8')];writeDB(_0x13f8b2);}});}}catch(_0x82c123){utils['error'](util[_0xef45('0x3')]('[%s][agents][agentconnect]',_0x9df07e[_0xef45('0x5')]),_0x82c123);}};exports['agentcomplete']=function(_0x5faf67){try{if(!_[_0xef45('0x30')](agents[_0x5faf67[_0xef45('0x17')]])){utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x31'),_0x5faf67[_0xef45('0x5')]),_0x5faf67);utils['info'](util[_0xef45('0x3')](_0xef45('0x32'),_0x5faf67[_0xef45('0x5')],agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x8')],_0x5faf67[_0xef45('0x17')]));agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x10')]=!![];agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x33')]=utils[_0xef45('0x2b')]();agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x27')]=utils[_0xef45('0x34')](agents[_0x5faf67[_0xef45('0x17')]]['agentcompleteAt'],agents[_0x5faf67[_0xef45('0x17')]][_0xef45('0x2a')]);agents[_0x5faf67[_0xef45('0x17')]]['reason']=_0x5faf67['reason'];agents[_0x5faf67['destuniqueid']][_0xef45('0xc')]=_0xef45('0x35');writeDB(agents[_0x5faf67[_0xef45('0x17')]]);}}catch(_0x34e9d5){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][agentcomplete]',_0x5faf67[_0xef45('0x5')]),_0x34e9d5);}};exports[_0xef45('0x36')]=function(_0x2b2419){try{if(!_['isNil'](agents[_0x2b2419['transfereruniqueid']])){utils[_0xef45('0x1e')](util[_0xef45('0x3')]('[%s][agents][blindtransfer]',_0x2b2419[_0xef45('0x5')]),_0x2b2419);utils[_0xef45('0x2')](util[_0xef45('0x3')](_0xef45('0x37'),_0x2b2419[_0xef45('0x5')],agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x8')],agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x5')]));agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x39')]=!![];agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x3a')]=_0xef45('0x3b');agents[_0x2b2419['transfereruniqueid']][_0xef45('0x3c')]=_0x2b2419[_0xef45('0x3d')];agents[_0x2b2419[_0xef45('0x38')]]['transferuniqueid']=agents[_0x2b2419[_0xef45('0x38')]][_0xef45('0x5')];}}catch(_0x464bda){utils[_0xef45('0x1b')](util['format'](_0xef45('0x3e'),_0x2b2419[_0xef45('0x5')]),_0x464bda);}};exports[_0xef45('0x3f')]=function(_0x310105){try{utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x40'),_0x310105[_0xef45('0x41')]),_0x310105);if(_0x310105[_0xef45('0x41')]==_0x310105[_0xef45('0x42')]){if(!_[_0xef45('0x30')](agents[_0x310105[_0xef45('0x43')]])){utils['info'](util[_0xef45('0x3')](_0xef45('0x44'),_0x310105[_0xef45('0x41')],agents[_0x310105[_0xef45('0x43')]][_0xef45('0x8')]));agents[_0x310105[_0xef45('0x43')]]['transfer']=!![];agents[_0x310105['secondtransfereruniqueid']][_0xef45('0x3a')]='ATTENDED';agents[_0x310105[_0xef45('0x43')]][_0xef45('0x3c')]=_0x310105[_0xef45('0x45')];agents[_0x310105['secondtransfereruniqueid']][_0xef45('0x46')]=_0x310105[_0xef45('0x41')];}if(_0x310105['transfereeuniqueid']&&agents[_0x310105[_0xef45('0x47')]]){agents[_0x310105['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x310105[_0xef45('0x47')]]=_[_0xef45('0x48')](agents[_0x310105[_0xef45('0x47')]]);transfers[_0x310105[_0xef45('0x47')]][_0xef45('0xa')]=agents[_0x310105['secondtransfereruniqueid']][_0xef45('0xa')];transfers[_0x310105[_0xef45('0x47')]]['calleridname']=agents[_0x310105[_0xef45('0x43')]][_0xef45('0x49')];transfers[_0x310105[_0xef45('0x47')]][_0xef45('0x4a')]=utils[_0xef45('0x2b')]();transfers[_0x310105[_0xef45('0x47')]][_0xef45('0x2a')]=utils[_0xef45('0x2b')]();transfers[_0x310105['transfereeuniqueid']][_0xef45('0x26')]=0x0;transfers[_0x310105['transfereeuniqueid']]['agententerreason']=0x2;}}else if(_0x310105[_0xef45('0x43')]==_0x310105['secondtransfererlinkedid']){if(!_[_0xef45('0x30')](agents[_0x310105[_0xef45('0x41')]])){utils['info'](util[_0xef45('0x3')](_0xef45('0x44'),_0x310105[_0xef45('0x41')],agents[_0x310105[_0xef45('0x41')]][_0xef45('0x8')]));agents[_0x310105[_0xef45('0x41')]]['transfer']=!![];agents[_0x310105[_0xef45('0x41')]][_0xef45('0x3a')]=_0xef45('0x4b');agents[_0x310105[_0xef45('0x41')]][_0xef45('0x3c')]=_0x310105['secondtransfererexten'];agents[_0x310105[_0xef45('0x41')]]['transferuniqueid']=_0x310105[_0xef45('0x43')];}if(_0x310105[_0xef45('0x4c')]&&agents[_0x310105['transfertargetuniqueid']]){agents[_0x310105[_0xef45('0x4c')]][_0xef45('0x4d')]=0x1;transfers[_0x310105[_0xef45('0x4c')]]=_['clone'](agents[_0x310105['transfertargetuniqueid']]);transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0xa')]=agents[_0x310105[_0xef45('0x41')]]['calleridnum'];transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0x49')]=agents[_0x310105['origtransfereruniqueid']][_0xef45('0x49')];transfers[_0x310105['transfertargetuniqueid']][_0xef45('0x4a')]=utils[_0xef45('0x2b')]();transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0x2a')]=utils[_0xef45('0x2b')]();transfers[_0x310105[_0xef45('0x4c')]][_0xef45('0x26')]=0x0;transfers[_0x310105[_0xef45('0x4c')]]['agententerreason']=0x2;}}}catch(_0x3e6b06){utils[_0xef45('0x1b')](util[_0xef45('0x3')](_0xef45('0x40'),_0x310105[_0xef45('0x41')]),_0x3e6b06);}};exports[_0xef45('0x4e')]=function(_0xef7b79){try{utils[_0xef45('0x1e')](util[_0xef45('0x3')](_0xef45('0x4f'),_0xef7b79[_0xef45('0x5')]),_0xef7b79);if(agents[_0xef7b79['uniqueid']]&&agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')]===_0xef45('0x21')){if(_0xef7b79[_0xef45('0x50')]==='21'){agents[_0xef7b79[_0xef45('0x5')]]['reason']=_0xef45('0x51');agents[_0xef7b79[_0xef45('0x5')]]['lastevent']='rejected';}utils[_0xef45('0x2')](util[_0xef45('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0xef7b79['uniqueid'],agents[_0xef7b79['uniqueid']][_0xef45('0x8')],agents[_0xef7b79[_0xef45('0x5')]]['reason'],agents[_0xef7b79['uniqueid']][_0xef45('0xc')]));writeDB(agents[_0xef7b79['uniqueid']]);var _0x36586a=unanswered[_0xef45('0x52')](_0xef7b79[_0xef45('0x5')]);if(_0x36586a>-0x1){unanswered[_0xef45('0x53')](_0x36586a,0x1);}}if(transfers[_0xef7b79[_0xef45('0x5')]]){transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x10')]=!![];transfers[_0xef7b79['uniqueid']][_0xef45('0x33')]=utils[_0xef45('0x2b')]();transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x27')]=utils[_0xef45('0x34')](transfers[_0xef7b79[_0xef45('0x5')]]['agentcompleteAt'],transfers[_0xef7b79['uniqueid']][_0xef45('0x2a')]);transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')]=_0xef45('0x54');transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0xc')]=_0xef45('0x35');utils[_0xef45('0x2')](util['format'](_0xef45('0x55'),_0xef7b79[_0xef45('0x5')],transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x8')],transfers[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')],transfers[_0xef7b79[_0xef45('0x5')]]['lastevent']));writeDB(transfers[_0xef7b79[_0xef45('0x5')]],!![]);}if(agents[_0xef7b79['uniqueid']]&&agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2a')]){agents[_0xef7b79['uniqueid']][_0xef45('0x10')]=!![];agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x33')]=utils['now']();agents[_0xef7b79[_0xef45('0x5')]]['talktime']=utils[_0xef45('0x34')](agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x33')],agents[_0xef7b79[_0xef45('0x5')]]['agentconnectAt']);agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')]=agents[_0xef7b79[_0xef45('0x5')]]['transfer']?_0xef45('0x39'):_0xef45('0x54');agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0xc')]=_0xef45('0x35');utils['info'](util[_0xef45('0x3')](_0xef45('0x55'),_0xef7b79[_0xef45('0x5')],agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x8')],agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0x2e')],agents[_0xef7b79[_0xef45('0x5')]][_0xef45('0xc')]));writeDB(agents[_0xef7b79['uniqueid']]);}}catch(_0xd3a51e){utils[_0xef45('0x1b')](util[_0xef45('0x3')]('[%s][agents][hangup]',_0xef7b79[_0xef45('0x5')]),_0xd3a51e);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 4ef2262..7140141 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 _0xc137=['Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','includes','noop','execif','set','gotoif','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','uniqueid','blinds','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','recording','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','channelstate','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','[%s][calls][newstate]','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','starttime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstop]','mohtime','diffTime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','destination','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','lastapplication'];(function(_0x5038e3,_0x29855b){var _0x593c8d=function(_0x41c341){while(--_0x41c341){_0x5038e3['push'](_0x5038e3['shift']());}};_0x593c8d(++_0x29855b);}(_0xc137,0xff));var _0x7c13=function(_0x588ec9,_0x2a60fc){_0x588ec9=_0x588ec9-0x0;var _0x3976b0=_0xc137[_0x588ec9];return _0x3976b0;};'use strict';var _=require(_0x7c13('0x0'));var util=require(_0x7c13('0x1'));var utils=require(_0x7c13('0x2'));var transfers=require(_0x7c13('0x3'));var dispositions=[_0x7c13('0x4'),_0x7c13('0x5'),'FAILED','NO\x20ANSWER','NO\x20ANSWER',_0x7c13('0x4'),_0x7c13('0x6'),_0x7c13('0x7'),_0x7c13('0x5'),_0x7c13('0x5'),_0x7c13('0x5')];var channels={};function writeDB(_0x47bbeb){var _0x545ca9;if(transfers['blinds'][_0x47bbeb[_0x7c13('0x8')]]){_0x545ca9=_0x47bbeb[_0x7c13('0x8')];_0x47bbeb['uniqueid']=transfers[_0x7c13('0x9')][_0x47bbeb[_0x7c13('0x8')]]['transfereeuniqueid'];}utils[_0x7c13('0xa')](util[_0x7c13('0xb')](_0x7c13('0xc'),_0x47bbeb[_0x7c13('0x8')],_0x47bbeb[_0x7c13('0xd')],_0x47bbeb[_0x7c13('0xe')],_0x47bbeb[_0x7c13('0xf')],_0x47bbeb[_0x7c13('0x10')],_0x47bbeb[_0x7c13('0x11')],_0x47bbeb[_0x7c13('0x12')],_0x47bbeb[_0x7c13('0x13')]));if(_0x47bbeb[_0x7c13('0x14')]){utils[_0x7c13('0x15')](_0x47bbeb['accountcode'])[_0x7c13('0x16')](function(_0x52565c){if(_0x52565c){_0x47bbeb[_0x7c13('0x17')]=_0x52565c['id'];}utils[_0x7c13('0x18')](_0x7c13('0x19'),_0x47bbeb);});}else{utils[_0x7c13('0x18')](_0x7c13('0x19'),_0x47bbeb);}if(channels[_0x47bbeb[_0x7c13('0x8')]]){delete channels[_0x47bbeb[_0x7c13('0x8')]];}else if(_0x545ca9&&channels[_0x545ca9]){if(!transfers['blinds'][_0x545ca9][_0x7c13('0x1a')])delete transfers[_0x7c13('0x9')][_0x545ca9];delete channels[_0x545ca9];}}exports['newchannel']=function(_0x3bd623){try{utils[_0x7c13('0x1b')](util['format'](_0x7c13('0x1c'),_0x3bd623[_0x7c13('0x8')]),_0x3bd623);if(_0x3bd623[_0x7c13('0x8')]==_0x3bd623[_0x7c13('0x1d')]&&_0x3bd623[_0x7c13('0xd')]!=_0x7c13('0x1e')){utils[_0x7c13('0xa')](util[_0x7c13('0xb')](_0x7c13('0x1f'),_0x3bd623['uniqueid'],_0x3bd623[_0x7c13('0x20')],_0x3bd623[_0x7c13('0x21')]));channels[_0x3bd623['uniqueid']]={'uniqueid':_0x3bd623['uniqueid'],'accountcode':_0x3bd623[_0x7c13('0x14')],'source':_0x3bd623[_0x7c13('0x11')],'destination':_0x3bd623[_0x7c13('0x21')],'destinationcontext':_0x3bd623['context'],'channel':_0x3bd623[_0x7c13('0xd')],'starttime':utils[_0x7c13('0x22')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x7c13('0x4'),'amaflags':_0x7c13('0x23')};}}catch(_0x3a4753){utils[_0x7c13('0x24')](util[_0x7c13('0xb')](_0x7c13('0x1c'),_0x3bd623[_0x7c13('0x8')]),_0x3a4753);}};exports[_0x7c13('0x25')]=function(_0x1b591b){try{utils[_0x7c13('0x1b')](util[_0x7c13('0xb')]('[%s][calls][newstate]',_0x1b591b[_0x7c13('0x8')]),_0x1b591b);if(!_[_0x7c13('0x26')](channels[_0x1b591b['uniqueid']])&&_0x1b591b['channelstate']==0x6){utils[_0x7c13('0xa')](util['format'](_0x7c13('0x27'),_0x1b591b[_0x7c13('0x8')],_0x1b591b[_0x7c13('0x20')],_0x1b591b['channel']));if(_[_0x7c13('0x26')](channels[_0x1b591b[_0x7c13('0x8')]]['systemanswertime'])){channels[_0x1b591b[_0x7c13('0x8')]][_0x7c13('0x28')]=utils[_0x7c13('0x22')]();}}else if(!_[_0x7c13('0x26')](channels[_0x1b591b[_0x7c13('0x1d')]])&&_0x1b591b[_0x7c13('0x29')]==0x6&&_0x1b591b[_0x7c13('0x20')]!=_0x7c13('0x2a')){utils[_0x7c13('0xa')](util[_0x7c13('0xb')](_0x7c13('0x2b'),_0x1b591b[_0x7c13('0x8')],_0x1b591b['linkedid'],_0x1b591b[_0x7c13('0x20')],_0x1b591b[_0x7c13('0xd')]));channels[_0x1b591b[_0x7c13('0x1d')]][_0x7c13('0x14')]=_0x1b591b[_0x7c13('0x14')];channels[_0x1b591b['linkedid']][_0x7c13('0x2c')]=_0x1b591b[_0x7c13('0xd')];if(_[_0x7c13('0x26')](channels[_0x1b591b[_0x7c13('0x1d')]][_0x7c13('0x2d')])){channels[_0x1b591b[_0x7c13('0x1d')]][_0x7c13('0x2d')]=utils[_0x7c13('0x22')]();}channels[_0x1b591b[_0x7c13('0x1d')]][_0x7c13('0x2e')]=dispositions[_[_0x7c13('0x2f')](_0x1b591b[_0x7c13('0x29')])]||_0x7c13('0x6');}}catch(_0xdd771b){utils[_0x7c13('0x24')](util[_0x7c13('0xb')](_0x7c13('0x30'),_0x1b591b[_0x7c13('0x8')]),_0xdd771b);}};exports[_0x7c13('0x31')]=function(_0x4c1576){try{if(!_[_0x7c13('0x26')](channels[_0x4c1576[_0x7c13('0x8')]])){utils['debug'](util[_0x7c13('0xb')](_0x7c13('0x32'),_0x4c1576[_0x7c13('0x8')]),_0x4c1576);if(_['isNil'](channels[_0x4c1576['uniqueid']][_0x7c13('0x33')])){channels[_0x4c1576[_0x7c13('0x8')]]['callerid']=_0x4c1576['calleridname']+'\x20<'+_0x4c1576[_0x7c13('0x11')]+'>';}utils[_0x7c13('0xa')](util['format'](_0x7c13('0x34'),_0x4c1576[_0x7c13('0x8')],channels[_0x4c1576[_0x7c13('0x8')]][_0x7c13('0x33')],_0x4c1576[_0x7c13('0x35')]));channels[_0x4c1576[_0x7c13('0x8')]][_0x7c13('0x36')]=utils[_0x7c13('0x22')]();channels[_0x4c1576[_0x7c13('0x8')]][_0x7c13('0x37')]=utils['diffTime'](channels[_0x4c1576[_0x7c13('0x8')]][_0x7c13('0x36')],channels[_0x4c1576['uniqueid']][_0x7c13('0x38')]);channels[_0x4c1576[_0x7c13('0x8')]][_0x7c13('0x39')]=channels[_0x4c1576[_0x7c13('0x8')]][_0x7c13('0x2d')]?utils['diffTime'](channels[_0x4c1576[_0x7c13('0x8')]][_0x7c13('0x36')],channels[_0x4c1576[_0x7c13('0x8')]][_0x7c13('0x2d')]):0x0;writeDB(channels[_0x4c1576[_0x7c13('0x8')]]);}}catch(_0xe17e1b){utils['error'](util[_0x7c13('0xb')](_0x7c13('0x32'),_0x4c1576[_0x7c13('0x8')]),_0xe17e1b);}};exports[_0x7c13('0x3a')]=function(_0x2091bf){try{if(!_[_0x7c13('0x26')](channels[_0x2091bf[_0x7c13('0x3b')]])){utils['debug'](util[_0x7c13('0xb')](_0x7c13('0x3c'),_0x2091bf[_0x7c13('0x3d')]),_0x2091bf);if(channels[_0x2091bf[_0x7c13('0x3b')]]['channel']==_0x2091bf[_0x7c13('0x3e')]){utils[_0x7c13('0xa')](util[_0x7c13('0xb')](_0x7c13('0x3f'),_0x2091bf[_0x7c13('0x3d')],_0x2091bf[_0x7c13('0x3b')],_0x2091bf[_0x7c13('0x40')]));channels[_0x2091bf[_0x7c13('0x3b')]][_0x7c13('0x2c')]=_0x2091bf[_0x7c13('0x40')];channels[_0x2091bf[_0x7c13('0x3b')]][_0x7c13('0x41')]=_0x7c13('0x42');}else if(channels[_0x2091bf['localtwolinkedid']][_0x7c13('0xd')]=_0x2091bf[_0x7c13('0x43')]){utils[_0x7c13('0xa')](util[_0x7c13('0xb')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x2091bf[_0x7c13('0x3d')],_0x2091bf[_0x7c13('0x3b')],_0x2091bf[_0x7c13('0x44')]));channels[_0x2091bf[_0x7c13('0x3b')]]['destinationchannel']=_0x2091bf[_0x7c13('0x44')];channels[_0x2091bf[_0x7c13('0x3b')]]['userfield']=_0x7c13('0x42');}}}catch(_0x4576ab){utils['error'](util['format'](_0x7c13('0x3c'),_0x2091bf[_0x7c13('0x3d')]),_0x4576ab);}};exports[_0x7c13('0x45')]=function(_0x508cb0){try{if(!_[_0x7c13('0x26')](channels[_0x508cb0[_0x7c13('0x8')]])){utils[_0x7c13('0x1b')](util[_0x7c13('0xb')](_0x7c13('0x46'),_0x508cb0[_0x7c13('0x8')]),_0x508cb0);channels[_0x508cb0[_0x7c13('0x8')]][_0x7c13('0x47')]=utils[_0x7c13('0x22')]();utils['info'](util[_0x7c13('0xb')](_0x7c13('0x48'),_0x508cb0['uniqueid'],channels[_0x508cb0[_0x7c13('0x8')]][_0x7c13('0x47')]));}}catch(_0x1df6ff){utils[_0x7c13('0x24')](util[_0x7c13('0xb')]('[%s][calls][musiconholdstart]',_0x508cb0[_0x7c13('0x8')]),_0x1df6ff);}};exports['musiconholdstop']=function(_0x10abc9){try{if(!_[_0x7c13('0x26')](channels[_0x10abc9[_0x7c13('0x8')]])){utils[_0x7c13('0x1b')](util[_0x7c13('0xb')](_0x7c13('0x49'),_0x10abc9[_0x7c13('0x8')]),_0x10abc9);if(!_[_0x7c13('0x26')](channels[_0x10abc9[_0x7c13('0x8')]][_0x7c13('0x47')])){channels[_0x10abc9[_0x7c13('0x8')]][_0x7c13('0x4a')]+=utils[_0x7c13('0x4b')](utils[_0x7c13('0x22')](),channels[_0x10abc9[_0x7c13('0x8')]]['musiconholdstartAt']);utils[_0x7c13('0xa')](util[_0x7c13('0xb')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x10abc9[_0x7c13('0x8')],channels[_0x10abc9[_0x7c13('0x8')]][_0x7c13('0x4a')]));delete channels[_0x10abc9['uniqueid']][_0x7c13('0x47')];}}}catch(_0x3df0c0){utils['error'](util[_0x7c13('0xb')](_0x7c13('0x49'),_0x10abc9['uniqueid']),_0x3df0c0);}};exports[_0x7c13('0x4c')]=function(_0x4562ba){try{if(!_[_0x7c13('0x26')](channels[_0x4562ba[_0x7c13('0x8')]])){utils[_0x7c13('0x1b')](util[_0x7c13('0xb')](_0x7c13('0x4d'),_0x4562ba[_0x7c13('0x8')]),_0x4562ba);if(!_['isNil'](_0x4562ba[_0x7c13('0x4e')][_0x7c13('0x4f')])){utils['info'](util[_0x7c13('0xb')](_0x7c13('0x50'),_0x4562ba[_0x7c13('0x8')],_0x4562ba[_0x7c13('0x51')]));channels[_0x4562ba[_0x7c13('0x8')]][_0x7c13('0x52')]=_0x4562ba[_0x7c13('0x51')];}if(!_[_0x7c13('0x26')](_0x4562ba[_0x7c13('0x4e')]['xmd-phone'])){utils['info'](util['format']('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x4562ba['uniqueid'],_0x4562ba[_0x7c13('0x51')]));channels[_0x4562ba[_0x7c13('0x8')]][_0x7c13('0x53')]=_0x4562ba[_0x7c13('0x51')];channels[_0x4562ba[_0x7c13('0x8')]][_0x7c13('0x33')]='\x22'+_0x4562ba[_0x7c13('0x51')]+_0x7c13('0x54')+_0x4562ba['value']+'>';}if(!_[_0x7c13('0x26')](_0x4562ba[_0x7c13('0x4e')]['xmd-callerid-preview'])||!_[_0x7c13('0x26')](_0x4562ba[_0x7c13('0x4e')][_0x7c13('0x55')])){utils[_0x7c13('0xa')](util[_0x7c13('0xb')](_0x7c13('0x56'),_0x4562ba['uniqueid'],!_[_0x7c13('0x26')](_0x4562ba[_0x7c13('0x4e')]['xmd-callerid-preview'])?'xmd-callerid-preview':_0x7c13('0x55'),_0x4562ba[_0x7c13('0x51')]));channels[_0x4562ba[_0x7c13('0x8')]][_0x7c13('0x33')]=_0x4562ba[_0x7c13('0x51')];}if(!_['isNil'](_0x4562ba[_0x7c13('0x4e')]['xmd-queue'])||!_[_0x7c13('0x26')](_0x4562ba[_0x7c13('0x4e')][_0x7c13('0x57')])){utils['info'](util[_0x7c13('0xb')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x4562ba[_0x7c13('0x8')],!_['isNil'](_0x4562ba[_0x7c13('0x4e')][_0x7c13('0x58')])?_0x7c13('0x58'):_0x7c13('0x57'),_0x4562ba['value']));channels[_0x4562ba[_0x7c13('0x8')]][_0x7c13('0x59')]=_0x7c13('0x5a');channels[_0x4562ba[_0x7c13('0x8')]][_0x7c13('0x5b')]=_0x4562ba[_0x7c13('0x51')];channels[_0x4562ba[_0x7c13('0x8')]][_0x7c13('0xe')]=!![];}if(!_[_0x7c13('0x26')](_0x4562ba[_0x7c13('0x4e')]['xmd-contactid'])){utils[_0x7c13('0xa')](util[_0x7c13('0xb')](_0x7c13('0x5c'),_0x4562ba[_0x7c13('0x8')],_0x4562ba['value']));channels[_0x4562ba['uniqueid']]['ContactId']=_0x4562ba[_0x7c13('0x51')];}if(!_[_0x7c13('0x26')](_0x4562ba[_0x7c13('0x4e')]['xmd-cdrtype'])){utils[_0x7c13('0xa')](util[_0x7c13('0xb')](_0x7c13('0x5d'),_0x4562ba[_0x7c13('0x8')],_0x4562ba['value']));channels[_0x4562ba[_0x7c13('0x8')]][_0x7c13('0x5e')]=_0x4562ba[_0x7c13('0x51')];}if(!_['isNil'](_0x4562ba['variable'][_0x7c13('0x5f')])){utils['info'](util[_0x7c13('0xb')](_0x7c13('0x60'),_0x4562ba['uniqueid'],_0x4562ba[_0x7c13('0x51')]));channels[_0x4562ba[_0x7c13('0x8')]]['routeid']=_0x4562ba['value'];}if(!_[_0x7c13('0x26')](_0x4562ba[_0x7c13('0x4e')][_0x7c13('0x61')])){utils['info'](util[_0x7c13('0xb')](_0x7c13('0x62'),_0x4562ba[_0x7c13('0x8')],_0x4562ba[_0x7c13('0x51')]));channels[_0x4562ba[_0x7c13('0x8')]]['sipcallid']=_0x4562ba[_0x7c13('0x51')];}}}catch(_0x31195c){utils['error'](util[_0x7c13('0xb')](_0x7c13('0x4d'),_0x4562ba['uniqueid']),_0x31195c);}};exports[_0x7c13('0x63')]=function(_0x4e51f1){try{if(!_[_0x7c13('0x26')](channels[_0x4e51f1[_0x7c13('0x8')]])){utils['debug'](util[_0x7c13('0xb')](_0x7c13('0x64'),_0x4e51f1[_0x7c13('0x8')]),_0x4e51f1);utils[_0x7c13('0xa')](util['format'](_0x7c13('0x65'),_0x4e51f1[_0x7c13('0x8')],_0x4e51f1['application'],_0x4e51f1[_0x7c13('0x66')]));if(_0x4e51f1[_0x7c13('0x67')][_0x7c13('0x68')]()=='set'&&_[_0x7c13('0x69')](_0x4e51f1[_0x7c13('0x66')][_0x7c13('0x68')](),_0x7c13('0x6a'))){var _0x5e76af=_0x4e51f1[_0x7c13('0x66')][_0x7c13('0x6b')]('=');var _0x3a6724=_0x5e76af[0x0][_0x7c13('0x6c')](_0x5e76af[0x0][_0x7c13('0x6d')]('(')+0x1,_0x5e76af[0x0]['lastIndexOf'](')'));var _0x4c8339=_0x5e76af[0x1];channels[_0x4e51f1[_0x7c13('0x8')]][_0x3a6724]=_0x4c8339;}if(!_[_0x7c13('0x6e')]([_0x7c13('0x31'),_0x7c13('0x6f'),_0x7c13('0x70'),_0x7c13('0x71'),_0x7c13('0x72')],_0x4e51f1[_0x7c13('0x67')][_0x7c13('0x68')]())){channels[_0x4e51f1[_0x7c13('0x8')]][_0x7c13('0x59')]=_0x4e51f1[_0x7c13('0x67')];channels[_0x4e51f1['uniqueid']][_0x7c13('0x5b')]=_0x4e51f1[_0x7c13('0x66')];}}}catch(_0x412bff){utils[_0x7c13('0x24')](util[_0x7c13('0xb')](_0x7c13('0x64'),_0x4e51f1['uniqueid']),_0x412bff);}}; \ No newline at end of file +var _0x8af6=['cdr','lastIndexOf','includes','hangup','noop','execif','gotoif','[%s][calls][newexten]','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','BUSY','blinds','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','connectedlinenum','getUserByInternal','accountcode','then','UserId','CreateVoiceCallReport','request','recording','newchannel','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','calleridnum','exten','context','now','newstate','debug','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','ANSWERED','error','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','destination','\x22\x20<','xmd-callerid-preview','[%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','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','application','appdata','toLowerCase','set','startsWith'];(function(_0x2b64cc,_0x1c790a){var _0x15d81b=function(_0x3a71f7){while(--_0x3a71f7){_0x2b64cc['push'](_0x2b64cc['shift']());}};_0x15d81b(++_0x1c790a);}(_0x8af6,0x76));var _0x68af=function(_0x3ce97b,_0x5af1a4){_0x3ce97b=_0x3ce97b-0x0;var _0xf1588a=_0x8af6[_0x3ce97b];return _0xf1588a;};'use strict';var _=require(_0x68af('0x0'));var util=require(_0x68af('0x1'));var utils=require(_0x68af('0x2'));var transfers=require(_0x68af('0x3'));var dispositions=[_0x68af('0x4'),_0x68af('0x5'),_0x68af('0x5'),_0x68af('0x4'),_0x68af('0x4'),_0x68af('0x4'),'ANSWERED',_0x68af('0x6'),'FAILED',_0x68af('0x5'),_0x68af('0x5')];var channels={};function writeDB(_0x89146f){var _0x1e77b0;if(transfers[_0x68af('0x7')][_0x89146f[_0x68af('0x8')]]){_0x1e77b0=_0x89146f[_0x68af('0x8')];_0x89146f['uniqueid']=transfers['blinds'][_0x89146f[_0x68af('0x8')]][_0x68af('0x9')];}utils['info'](util[_0x68af('0xa')](_0x68af('0xb'),_0x89146f[_0x68af('0x8')],_0x89146f[_0x68af('0xc')],_0x89146f[_0x68af('0xd')],_0x89146f[_0x68af('0xe')],_0x89146f['interface'],_0x89146f['calleridnum'],_0x89146f[_0x68af('0xf')],_0x89146f['lastevent']));if(_0x89146f['accountcode']){utils[_0x68af('0x10')](_0x89146f[_0x68af('0x11')])[_0x68af('0x12')](function(_0x5d8a97){if(_0x5d8a97){_0x89146f[_0x68af('0x13')]=_0x5d8a97['id'];}utils['request'](_0x68af('0x14'),_0x89146f);});}else{utils[_0x68af('0x15')](_0x68af('0x14'),_0x89146f);}if(channels[_0x89146f[_0x68af('0x8')]]){delete channels[_0x89146f[_0x68af('0x8')]];}else if(_0x1e77b0&&channels[_0x1e77b0]){if(!transfers['blinds'][_0x1e77b0][_0x68af('0x16')])delete transfers[_0x68af('0x7')][_0x1e77b0];delete channels[_0x1e77b0];}}exports[_0x68af('0x17')]=function(_0x2cfe71){try{utils['debug'](util['format'](_0x68af('0x18'),_0x2cfe71[_0x68af('0x8')]),_0x2cfe71);if(_0x2cfe71['uniqueid']==_0x2cfe71[_0x68af('0x19')]&&_0x2cfe71[_0x68af('0xc')]!=_0x68af('0x1a')){utils[_0x68af('0x1b')](util['format'](_0x68af('0x1c'),_0x2cfe71[_0x68af('0x8')],_0x2cfe71['context'],_0x2cfe71['exten']));channels[_0x2cfe71[_0x68af('0x8')]]={'uniqueid':_0x2cfe71[_0x68af('0x8')],'accountcode':_0x2cfe71[_0x68af('0x11')],'source':_0x2cfe71[_0x68af('0x1d')],'destination':_0x2cfe71[_0x68af('0x1e')],'destinationcontext':_0x2cfe71[_0x68af('0x1f')],'channel':_0x2cfe71['channel'],'starttime':utils[_0x68af('0x20')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x68af('0x4'),'amaflags':'DOCUMENTATION'};}}catch(_0x3ebd57){utils['error'](util[_0x68af('0xa')](_0x68af('0x18'),_0x2cfe71[_0x68af('0x8')]),_0x3ebd57);}};exports[_0x68af('0x21')]=function(_0x2deb06){try{utils[_0x68af('0x22')](util['format'](_0x68af('0x23'),_0x2deb06[_0x68af('0x8')]),_0x2deb06);if(!_[_0x68af('0x24')](channels[_0x2deb06[_0x68af('0x8')]])&&_0x2deb06[_0x68af('0x25')]==0x6){utils[_0x68af('0x1b')](util[_0x68af('0xa')](_0x68af('0x26'),_0x2deb06[_0x68af('0x8')],_0x2deb06['context'],_0x2deb06[_0x68af('0xc')]));if(_[_0x68af('0x24')](channels[_0x2deb06[_0x68af('0x8')]][_0x68af('0x27')])){channels[_0x2deb06['uniqueid']]['systemanswertime']=utils[_0x68af('0x20')]();}}else if(!_[_0x68af('0x24')](channels[_0x2deb06[_0x68af('0x19')]])&&_0x2deb06['channelstate']==0x6&&_0x2deb06['context']!=_0x68af('0x28')){utils[_0x68af('0x1b')](util['format'](_0x68af('0x29'),_0x2deb06[_0x68af('0x8')],_0x2deb06[_0x68af('0x19')],_0x2deb06[_0x68af('0x1f')],_0x2deb06[_0x68af('0xc')]));channels[_0x2deb06[_0x68af('0x19')]][_0x68af('0x11')]=_0x2deb06['accountcode'];channels[_0x2deb06[_0x68af('0x19')]][_0x68af('0x2a')]=_0x2deb06[_0x68af('0xc')];if(_['isNil'](channels[_0x2deb06[_0x68af('0x19')]][_0x68af('0x2b')])){channels[_0x2deb06['linkedid']][_0x68af('0x2b')]=utils[_0x68af('0x20')]();}channels[_0x2deb06['linkedid']][_0x68af('0x2c')]=dispositions[_['toNumber'](_0x2deb06['channelstate'])]||_0x68af('0x2d');}}catch(_0x54afc3){utils[_0x68af('0x2e')](util[_0x68af('0xa')](_0x68af('0x23'),_0x2deb06[_0x68af('0x8')]),_0x54afc3);}};exports['hangup']=function(_0x565a9e){try{if(!_['isNil'](channels[_0x565a9e[_0x68af('0x8')]])){utils[_0x68af('0x22')](util['format'](_0x68af('0x2f'),_0x565a9e[_0x68af('0x8')]),_0x565a9e);if(_[_0x68af('0x24')](channels[_0x565a9e['uniqueid']][_0x68af('0x30')])){channels[_0x565a9e[_0x68af('0x8')]][_0x68af('0x30')]=_0x565a9e[_0x68af('0x31')]+'\x20<'+_0x565a9e[_0x68af('0x1d')]+'>';}utils['info'](util[_0x68af('0xa')](_0x68af('0x32'),_0x565a9e[_0x68af('0x8')],channels[_0x565a9e[_0x68af('0x8')]][_0x68af('0x30')],_0x565a9e[_0x68af('0x33')]));channels[_0x565a9e[_0x68af('0x8')]][_0x68af('0x34')]=utils[_0x68af('0x20')]();channels[_0x565a9e[_0x68af('0x8')]]['duration']=utils[_0x68af('0x35')](channels[_0x565a9e[_0x68af('0x8')]]['endtime'],channels[_0x565a9e[_0x68af('0x8')]][_0x68af('0x36')]);channels[_0x565a9e[_0x68af('0x8')]][_0x68af('0x37')]=channels[_0x565a9e[_0x68af('0x8')]]['answertime']?utils['diffTime'](channels[_0x565a9e['uniqueid']][_0x68af('0x34')],channels[_0x565a9e[_0x68af('0x8')]]['answertime']):0x0;writeDB(channels[_0x565a9e[_0x68af('0x8')]]);}}catch(_0x7e1a4d){utils[_0x68af('0x2e')](util[_0x68af('0xa')]('[%s][calls][hangup]',_0x565a9e[_0x68af('0x8')]),_0x7e1a4d);}};exports[_0x68af('0x38')]=function(_0x19e5ed){try{if(!_[_0x68af('0x24')](channels[_0x19e5ed[_0x68af('0x39')]])){utils[_0x68af('0x22')](util[_0x68af('0xa')](_0x68af('0x3a'),_0x19e5ed[_0x68af('0x3b')]),_0x19e5ed);if(channels[_0x19e5ed[_0x68af('0x39')]]['channel']==_0x19e5ed['transfereechannel']){utils[_0x68af('0x1b')](util[_0x68af('0xa')](_0x68af('0x3c'),_0x19e5ed[_0x68af('0x3b')],_0x19e5ed[_0x68af('0x39')],_0x19e5ed['secondtransfererchannel']));channels[_0x19e5ed[_0x68af('0x39')]][_0x68af('0x2a')]=_0x19e5ed[_0x68af('0x3d')];channels[_0x19e5ed['localtwolinkedid']][_0x68af('0x3e')]=_0x68af('0x3f');}else if(channels[_0x19e5ed[_0x68af('0x39')]][_0x68af('0xc')]=_0x19e5ed[_0x68af('0x40')]){utils[_0x68af('0x1b')](util[_0x68af('0xa')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x19e5ed[_0x68af('0x3b')],_0x19e5ed[_0x68af('0x39')],_0x19e5ed[_0x68af('0x41')]));channels[_0x19e5ed[_0x68af('0x39')]]['destinationchannel']=_0x19e5ed[_0x68af('0x41')];channels[_0x19e5ed[_0x68af('0x39')]]['userfield']=_0x68af('0x3f');}}}catch(_0x56725a){utils[_0x68af('0x2e')](util['format'](_0x68af('0x3a'),_0x19e5ed[_0x68af('0x3b')]),_0x56725a);}};exports[_0x68af('0x42')]=function(_0x7740db){try{if(!_[_0x68af('0x24')](channels[_0x7740db[_0x68af('0x8')]])){utils[_0x68af('0x22')](util[_0x68af('0xa')](_0x68af('0x43'),_0x7740db[_0x68af('0x8')]),_0x7740db);channels[_0x7740db[_0x68af('0x8')]][_0x68af('0x44')]=utils['now']();utils[_0x68af('0x1b')](util[_0x68af('0xa')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x7740db[_0x68af('0x8')],channels[_0x7740db[_0x68af('0x8')]][_0x68af('0x44')]));}}catch(_0x48e6ce){utils[_0x68af('0x2e')](util[_0x68af('0xa')](_0x68af('0x43'),_0x7740db[_0x68af('0x8')]),_0x48e6ce);}};exports[_0x68af('0x45')]=function(_0x50cb8b){try{if(!_[_0x68af('0x24')](channels[_0x50cb8b[_0x68af('0x8')]])){utils[_0x68af('0x22')](util[_0x68af('0xa')](_0x68af('0x46'),_0x50cb8b[_0x68af('0x8')]),_0x50cb8b);if(!_[_0x68af('0x24')](channels[_0x50cb8b[_0x68af('0x8')]][_0x68af('0x44')])){channels[_0x50cb8b[_0x68af('0x8')]]['mohtime']+=utils[_0x68af('0x35')](utils[_0x68af('0x20')](),channels[_0x50cb8b[_0x68af('0x8')]][_0x68af('0x44')]);utils[_0x68af('0x1b')](util[_0x68af('0xa')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x50cb8b['uniqueid'],channels[_0x50cb8b[_0x68af('0x8')]]['mohtime']));delete channels[_0x50cb8b['uniqueid']][_0x68af('0x44')];}}}catch(_0xdb98a2){utils[_0x68af('0x2e')](util[_0x68af('0xa')](_0x68af('0x46'),_0x50cb8b[_0x68af('0x8')]),_0xdb98a2);}};exports[_0x68af('0x47')]=function(_0x53e6ea){try{if(!_[_0x68af('0x24')](channels[_0x53e6ea[_0x68af('0x8')]])){utils[_0x68af('0x22')](util[_0x68af('0xa')](_0x68af('0x48'),_0x53e6ea[_0x68af('0x8')]),_0x53e6ea);if(!_[_0x68af('0x24')](_0x53e6ea[_0x68af('0x49')][_0x68af('0x4a')])){utils['info'](util[_0x68af('0xa')](_0x68af('0x4b'),_0x53e6ea[_0x68af('0x8')],_0x53e6ea[_0x68af('0x4c')]));channels[_0x53e6ea[_0x68af('0x8')]][_0x68af('0x4d')]=_0x53e6ea['value'];}if(!_[_0x68af('0x24')](_0x53e6ea['variable'][_0x68af('0x4e')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x53e6ea[_0x68af('0x8')],_0x53e6ea['value']));channels[_0x53e6ea[_0x68af('0x8')]][_0x68af('0x4f')]=_0x53e6ea[_0x68af('0x4c')];channels[_0x53e6ea[_0x68af('0x8')]][_0x68af('0x30')]='\x22'+_0x53e6ea[_0x68af('0x4c')]+_0x68af('0x50')+_0x53e6ea['value']+'>';}if(!_[_0x68af('0x24')](_0x53e6ea['variable'][_0x68af('0x51')])||!_[_0x68af('0x24')](_0x53e6ea[_0x68af('0x49')]['xmd-callerid'])){utils[_0x68af('0x1b')](util[_0x68af('0xa')](_0x68af('0x52'),_0x53e6ea[_0x68af('0x8')],!_['isNil'](_0x53e6ea[_0x68af('0x49')]['xmd-callerid-preview'])?_0x68af('0x51'):'xmd-callerid',_0x53e6ea[_0x68af('0x4c')]));channels[_0x53e6ea[_0x68af('0x8')]][_0x68af('0x30')]=_0x53e6ea['value'];}if(!_[_0x68af('0x24')](_0x53e6ea[_0x68af('0x49')][_0x68af('0x53')])||!_[_0x68af('0x24')](_0x53e6ea['variable'][_0x68af('0x54')])){utils['info'](util[_0x68af('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x53e6ea['uniqueid'],!_[_0x68af('0x24')](_0x53e6ea['variable'][_0x68af('0x53')])?'xmd-queue':_0x68af('0x54'),_0x53e6ea[_0x68af('0x4c')]));channels[_0x53e6ea['uniqueid']][_0x68af('0x55')]=_0x68af('0x56');channels[_0x53e6ea['uniqueid']][_0x68af('0x57')]=_0x53e6ea[_0x68af('0x4c')];channels[_0x53e6ea[_0x68af('0x8')]][_0x68af('0xd')]=!![];}if(!_[_0x68af('0x24')](_0x53e6ea['variable'][_0x68af('0x58')])){utils[_0x68af('0x1b')](util[_0x68af('0xa')](_0x68af('0x59'),_0x53e6ea[_0x68af('0x8')],_0x53e6ea[_0x68af('0x4c')]));channels[_0x53e6ea[_0x68af('0x8')]][_0x68af('0x5a')]=_0x53e6ea[_0x68af('0x4c')];}if(!_['isNil'](_0x53e6ea[_0x68af('0x49')]['xmd-cdrtype'])){utils[_0x68af('0x1b')](util[_0x68af('0xa')](_0x68af('0x5b'),_0x53e6ea['uniqueid'],_0x53e6ea[_0x68af('0x4c')]));channels[_0x53e6ea[_0x68af('0x8')]]['type']=_0x53e6ea[_0x68af('0x4c')];}if(!_[_0x68af('0x24')](_0x53e6ea[_0x68af('0x49')][_0x68af('0x5c')])){utils['info'](util[_0x68af('0xa')](_0x68af('0x5d'),_0x53e6ea[_0x68af('0x8')],_0x53e6ea[_0x68af('0x4c')]));channels[_0x53e6ea['uniqueid']]['routeid']=_0x53e6ea[_0x68af('0x4c')];}if(!_[_0x68af('0x24')](_0x53e6ea['variable'][_0x68af('0x5e')])){utils[_0x68af('0x1b')](util[_0x68af('0xa')](_0x68af('0x5f'),_0x53e6ea[_0x68af('0x8')],_0x53e6ea['value']));channels[_0x53e6ea[_0x68af('0x8')]][_0x68af('0x5e')]=_0x53e6ea[_0x68af('0x4c')];}}}catch(_0x5c257d){utils[_0x68af('0x2e')](util[_0x68af('0xa')]('[%s][calls][varset]',_0x53e6ea['uniqueid']),_0x5c257d);}};exports[_0x68af('0x60')]=function(_0x3e837d){try{if(!_[_0x68af('0x24')](channels[_0x3e837d[_0x68af('0x8')]])){utils['debug'](util[_0x68af('0xa')]('[%s][calls][newexten]',_0x3e837d['uniqueid']),_0x3e837d);utils['info'](util[_0x68af('0xa')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x3e837d['uniqueid'],_0x3e837d[_0x68af('0x61')],_0x3e837d[_0x68af('0x62')]));if(_0x3e837d[_0x68af('0x61')][_0x68af('0x63')]()==_0x68af('0x64')&&_[_0x68af('0x65')](_0x3e837d[_0x68af('0x62')]['toLowerCase'](),_0x68af('0x66'))){var _0x2643a1=_0x3e837d[_0x68af('0x62')]['split']('=');var _0x2c6e9c=_0x2643a1[0x0]['substring'](_0x2643a1[0x0][_0x68af('0x67')]('(')+0x1,_0x2643a1[0x0][_0x68af('0x67')](')'));var _0x10521b=_0x2643a1[0x1];channels[_0x3e837d[_0x68af('0x8')]][_0x2c6e9c]=_0x10521b;}if(!_[_0x68af('0x68')]([_0x68af('0x69'),_0x68af('0x6a'),_0x68af('0x6b'),_0x68af('0x64'),_0x68af('0x6c')],_0x3e837d[_0x68af('0x61')][_0x68af('0x63')]())){channels[_0x3e837d[_0x68af('0x8')]]['lastapplication']=_0x3e837d[_0x68af('0x61')];channels[_0x3e837d[_0x68af('0x8')]]['lastdata']=_0x3e837d[_0x68af('0x62')];}}}catch(_0x20b73b){utils[_0x68af('0x2e')](util[_0x68af('0xa')](_0x68af('0x6d'),_0x3e837d[_0x68af('0x8')]),_0x20b73b);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 5784eb1..9690093 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 _0xbbc6=['shutdown','[core]\x20shutdown','error','[core]\x20error','close','managerevent','./utils','connect','info','[core]\x20connected'];(function(_0x121ddc,_0x31a2a4){var _0x342c21=function(_0x3e29db){while(--_0x3e29db){_0x121ddc['push'](_0x121ddc['shift']());}};_0x342c21(++_0x31a2a4);}(_0xbbc6,0xb0));var _0x6bbc=function(_0x240c7a,_0x28cb1d){_0x240c7a=_0x240c7a-0x0;var _0x509de6=_0xbbc6[_0x240c7a];return _0x509de6;};'use strict';var utils=require(_0x6bbc('0x0'));exports[_0x6bbc('0x1')]=function(){utils[_0x6bbc('0x2')](_0x6bbc('0x3'));};exports[_0x6bbc('0x4')]=function(){utils[_0x6bbc('0x2')](_0x6bbc('0x5'));};exports['fullybooted']=function(){utils[_0x6bbc('0x2')]('[core]\x20fullybooted');};exports['error']=function(_0x2526eb){utils[_0x6bbc('0x6')](_0x6bbc('0x7'),_0x2526eb);};exports[_0x6bbc('0x8')]=function(){utils[_0x6bbc('0x2')]('[core]\x20close');};exports[_0x6bbc('0x9')]=function(_0x500fe3){}; \ No newline at end of file +var _0xc7d9=['[core]\x20close','managerevent','./utils','connect','info','shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close'];(function(_0x2c7ab3,_0x516580){var _0x4775aa=function(_0x5b6aef){while(--_0x5b6aef){_0x2c7ab3['push'](_0x2c7ab3['shift']());}};_0x4775aa(++_0x516580);}(_0xc7d9,0xde));var _0x9c7d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7d9[_0x3dd15e];return _0x231fd0;};'use strict';var utils=require(_0x9c7d('0x0'));exports[_0x9c7d('0x1')]=function(){utils[_0x9c7d('0x2')]('[core]\x20connected');};exports[_0x9c7d('0x3')]=function(){utils[_0x9c7d('0x2')]('[core]\x20shutdown');};exports[_0x9c7d('0x4')]=function(){utils[_0x9c7d('0x2')](_0x9c7d('0x5'));};exports[_0x9c7d('0x6')]=function(_0x471bde){utils[_0x9c7d('0x6')](_0x9c7d('0x7'),_0x471bde);};exports[_0x9c7d('0x8')]=function(){utils[_0x9c7d('0x2')](_0x9c7d('0x9'));};exports[_0x9c7d('0xa')]=function(_0x490a8b){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 1e1877d..68da76a 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 _0xf0b6=['variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','isNil','[%s][dials][dialbegin]','assign','starttime','dialend','[%s][dials][dialend]','ANSWER','lastevent','connect','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','calleridname','complete','duration','diffTime','answertime','endtime','lodash','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','cdr(routeid)','error','varset','[%s][dials][varset]'];(function(_0x37d3f3,_0xca010f){var _0x185c9c=function(_0x5e2bf2){while(--_0x5e2bf2){_0x37d3f3['push'](_0x37d3f3['shift']());}};_0x185c9c(++_0xca010f);}(_0xf0b6,0xa8));var _0x6f0b=function(_0xa30e8f,_0x489379){_0xa30e8f=_0xa30e8f-0x0;var _0x52ad75=_0xf0b6[_0xa30e8f];return _0x52ad75;};'use strict';var _=require(_0x6f0b('0x0'));var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0x870c0d){utils[_0x6f0b('0x1')](util['format'](_0x6f0b('0x2'),_0x870c0d[_0x6f0b('0x3')],_0x870c0d[_0x6f0b('0x4')],_0x870c0d[_0x6f0b('0x5')],_0x870c0d['calleridnum'],_0x870c0d[_0x6f0b('0x6')],_0x870c0d[_0x6f0b('0x7')]));utils[_0x6f0b('0x8')](_0x6f0b('0x9'),_0x870c0d);delete dials[_0x870c0d['uniqueid']];}exports[_0x6f0b('0xa')]=function(_0x131c75){try{utils[_0x6f0b('0xb')](util[_0x6f0b('0xc')](_0x6f0b('0xd'),_0x131c75['uniqueid']),_0x131c75);utils['info'](util[_0x6f0b('0xc')](_0x6f0b('0xe'),_0x131c75[_0x6f0b('0x3')],_0x131c75['application'],_0x131c75[_0x6f0b('0xf')]));if(_0x131c75[_0x6f0b('0x10')][_0x6f0b('0x11')]()==_0x6f0b('0x12')&&_[_0x6f0b('0x13')](_0x131c75[_0x6f0b('0xf')]['toLowerCase'](),_0x6f0b('0x14'))){var _0x44f653=_0x131c75[_0x6f0b('0xf')]['split']('=');dials[_0x131c75[_0x6f0b('0x3')]]={'routeId':_0x44f653[0x1]};}}catch(_0x49ecc5){utils[_0x6f0b('0x15')](util['format'](_0x6f0b('0xd'),_0x131c75['uniqueid']),_0x49ecc5);}};exports[_0x6f0b('0x16')]=function(_0x6d3f78){try{utils[_0x6f0b('0xb')](util[_0x6f0b('0xc')](_0x6f0b('0x17'),_0x6d3f78[_0x6f0b('0x3')]),_0x6d3f78);if(!_['isNil'](_0x6d3f78[_0x6f0b('0x18')][_0x6f0b('0x19')])){utils[_0x6f0b('0x1')](util['format'](_0x6f0b('0x1a'),_0x6d3f78[_0x6f0b('0x3')],_0x6d3f78['value']));dials[_0x6d3f78['uniqueid']]={'routeId':_0x6d3f78[_0x6f0b('0x1b')]};}}catch(_0x1bfc0a){utils[_0x6f0b('0x15')](util[_0x6f0b('0xc')](_0x6f0b('0x17'),_0x6d3f78[_0x6f0b('0x3')]),_0x1bfc0a);}};exports[_0x6f0b('0x1c')]=function(_0x3b8ad2){try{if(!_[_0x6f0b('0x1d')](dials[_0x3b8ad2[_0x6f0b('0x3')]])){utils['debug'](util[_0x6f0b('0xc')](_0x6f0b('0x1e'),_0x3b8ad2[_0x6f0b('0x3')]),_0x3b8ad2);dials[_0x3b8ad2[_0x6f0b('0x3')]]=_[_0x6f0b('0x1f')](dials[_0x3b8ad2[_0x6f0b('0x3')]],_0x3b8ad2);dials[_0x3b8ad2[_0x6f0b('0x3')]][_0x6f0b('0x20')]=utils['now']();dials[_0x3b8ad2[_0x6f0b('0x3')]]['lastevent']='called';utils['info'](util[_0x6f0b('0xc')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x3b8ad2[_0x6f0b('0x3')],dials[_0x3b8ad2[_0x6f0b('0x3')]][_0x6f0b('0x20')]));}}catch(_0x59c9c3){utils[_0x6f0b('0x15')](util['format'](_0x6f0b('0x1e'),_0x3b8ad2[_0x6f0b('0x3')]),_0x59c9c3);}};exports[_0x6f0b('0x21')]=function(_0x2df090){try{if(!_[_0x6f0b('0x1d')](dials[_0x2df090[_0x6f0b('0x3')]])){utils[_0x6f0b('0xb')](util['format'](_0x6f0b('0x22'),_0x2df090[_0x6f0b('0x3')]),_0x2df090);dials[_0x2df090[_0x6f0b('0x3')]][_0x6f0b('0x7')]=_0x2df090[_0x6f0b('0x7')];if(_0x2df090[_0x6f0b('0x7')]==_0x6f0b('0x23')){dials[_0x2df090[_0x6f0b('0x3')]]=_[_0x6f0b('0x1f')](dials[_0x2df090['uniqueid']],_0x2df090);dials[_0x2df090['uniqueid']]['answertime']=utils['now']();dials[_0x2df090['uniqueid']][_0x6f0b('0x24')]=_0x6f0b('0x25');utils[_0x6f0b('0x1')](util['format']('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x2df090['uniqueid'],_0x2df090[_0x6f0b('0x7')],dials[_0x2df090[_0x6f0b('0x3')]]['answertime']));}else{utils[_0x6f0b('0x1')](util[_0x6f0b('0xc')]('[%s][dials][dialend]\x20dialstatus:%s',_0x2df090[_0x6f0b('0x3')],_0x2df090['dialstatus']));}}}catch(_0xe19af){utils[_0x6f0b('0x15')](util['format'](_0x6f0b('0x22'),_0x2df090[_0x6f0b('0x3')]),_0xe19af);}};exports[_0x6f0b('0x26')]=function(_0x118764){try{if(!_[_0x6f0b('0x1d')](dials[_0x118764[_0x6f0b('0x3')]])){utils[_0x6f0b('0xb')](util['format'](_0x6f0b('0x27'),_0x118764[_0x6f0b('0x3')]),_0x118764);utils['info'](util['format'](_0x6f0b('0x28'),_0x118764['uniqueid'],_0x118764[_0x6f0b('0x29')],_0x118764[_0x6f0b('0x2a')],_0x118764['cause-txt']));dials[_0x118764['uniqueid']]=_[_0x6f0b('0x1f')](dials[_0x118764[_0x6f0b('0x3')]],{'endtime':utils['now'](),'lastevent':_0x6f0b('0x2b')});dials[_0x118764['uniqueid']][_0x6f0b('0x2c')]=utils['diffTime'](dials[_0x118764[_0x6f0b('0x3')]]['endtime'],dials[_0x118764[_0x6f0b('0x3')]][_0x6f0b('0x20')]);dials[_0x118764['uniqueid']]['holdtime']=utils[_0x6f0b('0x2d')](dials[_0x118764[_0x6f0b('0x3')]][_0x6f0b('0x2e')]||dials[_0x118764['uniqueid']][_0x6f0b('0x2f')],dials[_0x118764['uniqueid']][_0x6f0b('0x20')]);dials[_0x118764[_0x6f0b('0x3')]]['billableseconds']=dials[_0x118764[_0x6f0b('0x3')]][_0x6f0b('0x2e')]?utils[_0x6f0b('0x2d')](dials[_0x118764[_0x6f0b('0x3')]][_0x6f0b('0x2f')],dials[_0x118764[_0x6f0b('0x3')]]['answertime']):0x0;writeDB(dials[_0x118764[_0x6f0b('0x3')]]);}}catch(_0x333271){utils[_0x6f0b('0x15')](util['format'](_0x6f0b('0x27'),_0x118764[_0x6f0b('0x3')]),_0x333271);}}; \ No newline at end of file +var _0x1a79=['dialstring','dialstatus','CreateVoiceDialReport','uniqueid','newexten','debug','[%s][dials][newexten]','format','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','cdr(routeid)','split','error','varset','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','dialbegin','[%s][dials][dialbegin]','starttime','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','assign','answertime','now','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','hangup','[%s][dials][hangup]','calleridnum','calleridname','cause-txt','duration','diffTime','holdtime','endtime','billableseconds','lodash','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel'];(function(_0x172084,_0x2c136e){var _0xe588de=function(_0x3ce12d){while(--_0x3ce12d){_0x172084['push'](_0x172084['shift']());}};_0xe588de(++_0x2c136e);}(_0x1a79,0x1bd));var _0x91a7=function(_0x315ddb,_0x18a5cf){_0x315ddb=_0x315ddb-0x0;var _0xacbbf4=_0x1a79[_0x315ddb];return _0xacbbf4;};'use strict';var _=require(_0x91a7('0x0'));var util=require('util');var utils=require(_0x91a7('0x1'));var dials={};function writeDB(_0x24eb9a){utils[_0x91a7('0x2')](util['format'](_0x91a7('0x3'),_0x24eb9a['uniqueid'],_0x24eb9a[_0x91a7('0x4')],_0x24eb9a[_0x91a7('0x5')],_0x24eb9a['calleridnum'],_0x24eb9a['connectedlinenum'],_0x24eb9a[_0x91a7('0x6')]));utils['request'](_0x91a7('0x7'),_0x24eb9a);delete dials[_0x24eb9a[_0x91a7('0x8')]];}exports[_0x91a7('0x9')]=function(_0x47e5ce){try{utils[_0x91a7('0xa')](util['format'](_0x91a7('0xb'),_0x47e5ce[_0x91a7('0x8')]),_0x47e5ce);utils['info'](util[_0x91a7('0xc')](_0x91a7('0xd'),_0x47e5ce[_0x91a7('0x8')],_0x47e5ce[_0x91a7('0xe')],_0x47e5ce[_0x91a7('0xf')]));if(_0x47e5ce['application']['toLowerCase']()==_0x91a7('0x10')&&_['startsWith'](_0x47e5ce[_0x91a7('0xf')]['toLowerCase'](),_0x91a7('0x11'))){var _0x54de44=_0x47e5ce['appdata'][_0x91a7('0x12')]('=');dials[_0x47e5ce[_0x91a7('0x8')]]={'routeId':_0x54de44[0x1]};}}catch(_0x46a9f7){utils[_0x91a7('0x13')](util[_0x91a7('0xc')](_0x91a7('0xb'),_0x47e5ce[_0x91a7('0x8')]),_0x46a9f7);}};exports[_0x91a7('0x14')]=function(_0x23ebcf){try{utils['debug'](util[_0x91a7('0xc')]('[%s][dials][varset]',_0x23ebcf[_0x91a7('0x8')]),_0x23ebcf);if(!_[_0x91a7('0x15')](_0x23ebcf['variable'][_0x91a7('0x16')])){utils[_0x91a7('0x2')](util[_0x91a7('0xc')](_0x91a7('0x17'),_0x23ebcf[_0x91a7('0x8')],_0x23ebcf[_0x91a7('0x18')]));dials[_0x23ebcf[_0x91a7('0x8')]]={'routeId':_0x23ebcf['value']};}}catch(_0x282ef6){utils[_0x91a7('0x13')](util[_0x91a7('0xc')](_0x91a7('0x19'),_0x23ebcf[_0x91a7('0x8')]),_0x282ef6);}};exports[_0x91a7('0x1a')]=function(_0x10f94b){try{if(!_['isNil'](dials[_0x10f94b[_0x91a7('0x8')]])){utils[_0x91a7('0xa')](util[_0x91a7('0xc')](_0x91a7('0x1b'),_0x10f94b[_0x91a7('0x8')]),_0x10f94b);dials[_0x10f94b[_0x91a7('0x8')]]=_['assign'](dials[_0x10f94b[_0x91a7('0x8')]],_0x10f94b);dials[_0x10f94b['uniqueid']][_0x91a7('0x1c')]=utils['now']();dials[_0x10f94b['uniqueid']][_0x91a7('0x1d')]=_0x91a7('0x1e');utils['info'](util['format'](_0x91a7('0x1f'),_0x10f94b[_0x91a7('0x8')],dials[_0x10f94b[_0x91a7('0x8')]]['starttime']));}}catch(_0x563a72){utils['error'](util[_0x91a7('0xc')]('[%s][dials][dialbegin]',_0x10f94b[_0x91a7('0x8')]),_0x563a72);}};exports[_0x91a7('0x20')]=function(_0x5e9762){try{if(!_[_0x91a7('0x15')](dials[_0x5e9762['uniqueid']])){utils[_0x91a7('0xa')](util['format'](_0x91a7('0x21'),_0x5e9762[_0x91a7('0x8')]),_0x5e9762);dials[_0x5e9762['uniqueid']][_0x91a7('0x6')]=_0x5e9762['dialstatus'];if(_0x5e9762[_0x91a7('0x6')]==_0x91a7('0x22')){dials[_0x5e9762[_0x91a7('0x8')]]=_[_0x91a7('0x23')](dials[_0x5e9762[_0x91a7('0x8')]],_0x5e9762);dials[_0x5e9762[_0x91a7('0x8')]][_0x91a7('0x24')]=utils[_0x91a7('0x25')]();dials[_0x5e9762[_0x91a7('0x8')]]['lastevent']=_0x91a7('0x26');utils[_0x91a7('0x2')](util[_0x91a7('0xc')](_0x91a7('0x27'),_0x5e9762[_0x91a7('0x8')],_0x5e9762[_0x91a7('0x6')],dials[_0x5e9762[_0x91a7('0x8')]][_0x91a7('0x24')]));}else{utils['info'](util[_0x91a7('0xc')]('[%s][dials][dialend]\x20dialstatus:%s',_0x5e9762[_0x91a7('0x8')],_0x5e9762[_0x91a7('0x6')]));}}}catch(_0x36a9b0){utils['error'](util[_0x91a7('0xc')]('[%s][dials][dialend]',_0x5e9762['uniqueid']),_0x36a9b0);}};exports[_0x91a7('0x28')]=function(_0x154a59){try{if(!_[_0x91a7('0x15')](dials[_0x154a59[_0x91a7('0x8')]])){utils['debug'](util[_0x91a7('0xc')](_0x91a7('0x29'),_0x154a59[_0x91a7('0x8')]),_0x154a59);utils['info'](util[_0x91a7('0xc')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x154a59[_0x91a7('0x8')],_0x154a59[_0x91a7('0x2a')],_0x154a59[_0x91a7('0x2b')],_0x154a59[_0x91a7('0x2c')]));dials[_0x154a59['uniqueid']]=_[_0x91a7('0x23')](dials[_0x154a59[_0x91a7('0x8')]],{'endtime':utils['now'](),'lastevent':'complete'});dials[_0x154a59[_0x91a7('0x8')]][_0x91a7('0x2d')]=utils[_0x91a7('0x2e')](dials[_0x154a59[_0x91a7('0x8')]]['endtime'],dials[_0x154a59[_0x91a7('0x8')]][_0x91a7('0x1c')]);dials[_0x154a59[_0x91a7('0x8')]][_0x91a7('0x2f')]=utils[_0x91a7('0x2e')](dials[_0x154a59[_0x91a7('0x8')]]['answertime']||dials[_0x154a59[_0x91a7('0x8')]][_0x91a7('0x30')],dials[_0x154a59[_0x91a7('0x8')]][_0x91a7('0x1c')]);dials[_0x154a59[_0x91a7('0x8')]][_0x91a7('0x31')]=dials[_0x154a59[_0x91a7('0x8')]][_0x91a7('0x24')]?utils[_0x91a7('0x2e')](dials[_0x154a59[_0x91a7('0x8')]][_0x91a7('0x30')],dials[_0x154a59[_0x91a7('0x8')]][_0x91a7('0x24')]):0x0;writeDB(dials[_0x154a59['uniqueid']]);}}catch(_0x106032){utils['error'](util[_0x91a7('0xc')](_0x91a7('0x29'),_0x154a59['uniqueid']),_0x106032);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 327bcb4..d106356 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 _0x5bc8=['format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','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]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','asterisk','port','username','password','xdr','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x5bc8,0x70));var _0x85bc=function(_0x263f4c,_0x438626){_0x263f4c=_0x263f4c-0x0;var _0x3a78d3=_0x5bc8[_0x263f4c];return _0x3a78d3;};var AsteriskManager=require(_0x85bc('0x0'));var config=require('../../config/environment');var utils=require(_0x85bc('0x1'));var util=require(_0x85bc('0x2'));var ami=new AsteriskManager(config[_0x85bc('0x3')][_0x85bc('0x4')],config[_0x85bc('0x3')]['ip'],config[_0x85bc('0x3')][_0x85bc('0x5')],config[_0x85bc('0x3')][_0x85bc('0x6')],!![]);ami['keepConnected']();if(config[_0x85bc('0x7')]&&config[_0x85bc('0x7')]['disabled']){utils[_0x85bc('0x8')](_0x85bc('0x9'));}else{var agents=require(_0x85bc('0xa'));var calls=require(_0x85bc('0xb'));var queues=require('./queues.controller');var recordings=require(_0x85bc('0xc'));var members=require(_0x85bc('0xd'));var dials=require(_0x85bc('0xe'));var transfers=require('./transfers.controller');var core=require(_0x85bc('0xf'));ami['on'](_0x85bc('0x10'),core[_0x85bc('0x10')]);ami['on'](_0x85bc('0x11'),core['shutdown']);ami['on'](_0x85bc('0x12'),core[_0x85bc('0x12')]);ami['on']('error',core[_0x85bc('0x13')]);ami['on'](_0x85bc('0x14'),core[_0x85bc('0x14')]);ami['on'](_0x85bc('0x15'),core[_0x85bc('0x15')]);ami['on'](_0x85bc('0x16'),function(_0x46100e){try{utils[_0x85bc('0x17')](util[_0x85bc('0x18')](_0x85bc('0x19'),_0x46100e[_0x85bc('0x1a')]),_0x46100e);members['devicestatechange'](_0x46100e);}catch(_0x5ed7d3){utils[_0x85bc('0x13')](util[_0x85bc('0x18')](_0x85bc('0x19'),_0x46100e[_0x85bc('0x1a')]),_0x5ed7d3);}});ami['on'](_0x85bc('0x1b'),function(_0x56c76b){try{utils[_0x85bc('0x17')](util[_0x85bc('0x18')](_0x85bc('0x1c'),_0x56c76b[_0x85bc('0x1d')]),_0x56c76b);agents[_0x85bc('0x1b')](_0x56c76b);}catch(_0x50a74c){utils[_0x85bc('0x13')](util[_0x85bc('0x18')](_0x85bc('0x1c'),_0x56c76b[_0x85bc('0x1d')]),_0x50a74c);}});ami['on'](_0x85bc('0x1e'),function(_0x41b6e2){try{utils['debug'](util[_0x85bc('0x18')](_0x85bc('0x1f'),_0x41b6e2['uniqueid']),_0x41b6e2);agents[_0x85bc('0x1e')](_0x41b6e2);}catch(_0xaa0843){utils[_0x85bc('0x13')](util[_0x85bc('0x18')](_0x85bc('0x1f'),_0x41b6e2[_0x85bc('0x1d')]),_0xaa0843);}});ami['on'](_0x85bc('0x20'),function(_0x5b3d65){try{utils[_0x85bc('0x17')](util['format'](_0x85bc('0x21'),_0x5b3d65[_0x85bc('0x1d')]),_0x5b3d65);agents[_0x85bc('0x20')](_0x5b3d65);queues[_0x85bc('0x20')](_0x5b3d65);}catch(_0x1f45b7){utils[_0x85bc('0x13')](util['format'](_0x85bc('0x21'),_0x5b3d65[_0x85bc('0x1d')]),_0x1f45b7);}});ami['on']('agentcomplete',function(_0x15ae75){try{utils[_0x85bc('0x17')](util[_0x85bc('0x18')](_0x85bc('0x22'),_0x15ae75[_0x85bc('0x1d')]),_0x15ae75);agents['agentcomplete'](_0x15ae75);queues[_0x85bc('0x23')](_0x15ae75);members['agentcomplete'](_0x15ae75);}catch(_0x3f2c97){utils[_0x85bc('0x13')](util[_0x85bc('0x18')](_0x85bc('0x22'),_0x15ae75['uniqueid']),_0x3f2c97);}});ami['on'](_0x85bc('0x24'),function(_0x1a640d){try{utils[_0x85bc('0x17')](util[_0x85bc('0x18')](_0x85bc('0x25'),_0x1a640d[_0x85bc('0x1d')]),_0x1a640d);agents['queuecallerabandon'](_0x1a640d);queues['queuecallerabandon'](_0x1a640d);}catch(_0x271900){utils[_0x85bc('0x13')](util['format']('[%s][index][queuecallerabandon]',_0x1a640d[_0x85bc('0x1d')]),_0x271900);}});ami['on']('queuecallerjoin',function(_0x36c900){try{utils['debug'](util[_0x85bc('0x18')](_0x85bc('0x26'),_0x36c900[_0x85bc('0x1d')]),_0x36c900);queues[_0x85bc('0x27')](_0x36c900);recordings['queuecallerjoin'](_0x36c900);}catch(_0x37e110){utils[_0x85bc('0x13')](util[_0x85bc('0x18')](_0x85bc('0x26'),_0x36c900[_0x85bc('0x1d')]),_0x37e110);}});ami['on'](_0x85bc('0x28'),function(_0x10c8ee){try{utils[_0x85bc('0x17')](util[_0x85bc('0x18')](_0x85bc('0x29'),_0x10c8ee[_0x85bc('0x1d')]),_0x10c8ee);queues[_0x85bc('0x28')](_0x10c8ee);}catch(_0x365574){utils['error'](util[_0x85bc('0x18')]('[%s][index][queuecallerleave]',_0x10c8ee[_0x85bc('0x1d')]),_0x365574);}});ami['on'](_0x85bc('0x2a'),function(_0x1c73d1){try{utils['debug'](util[_0x85bc('0x18')]('[%s][index][musiconholdstart]',_0x1c73d1[_0x85bc('0x1d')]),_0x1c73d1);queues[_0x85bc('0x2a')](_0x1c73d1);calls[_0x85bc('0x2a')](_0x1c73d1);}catch(_0x5db074){utils[_0x85bc('0x13')](util[_0x85bc('0x18')](_0x85bc('0x2b'),_0x1c73d1['uniqueid']),_0x5db074);}});ami['on'](_0x85bc('0x2c'),function(_0x211657){try{utils[_0x85bc('0x17')](util['format'](_0x85bc('0x2d'),_0x211657[_0x85bc('0x1d')]),_0x211657);queues[_0x85bc('0x2c')](_0x211657);calls[_0x85bc('0x2c')](_0x211657);}catch(_0x35daf6){utils[_0x85bc('0x13')](util[_0x85bc('0x18')](_0x85bc('0x2d'),_0x211657['uniqueid']),_0x35daf6);}});ami['on']('newstate',function(_0xc9a64){try{utils[_0x85bc('0x17')](util['format'](_0x85bc('0x2e'),_0xc9a64[_0x85bc('0x1d')]),_0xc9a64);calls[_0x85bc('0x2f')](_0xc9a64);recordings[_0x85bc('0x2f')](_0xc9a64);}catch(_0xa27541){utils[_0x85bc('0x13')](util[_0x85bc('0x18')](_0x85bc('0x2e'),_0xc9a64['uniqueid']),_0xa27541);}});ami['on'](_0x85bc('0x30'),function(_0x6bb520){try{utils[_0x85bc('0x17')](util[_0x85bc('0x18')](_0x85bc('0x31'),_0x6bb520[_0x85bc('0x1d')]),_0x6bb520);calls[_0x85bc('0x30')](_0x6bb520);recordings['hangup'](_0x6bb520);dials['hangup'](_0x6bb520);agents['hangup'](_0x6bb520);queues['hangup'](_0x6bb520);}catch(_0x2e5acc){utils['error'](util[_0x85bc('0x18')](_0x85bc('0x31'),_0x6bb520[_0x85bc('0x1d')]),_0x2e5acc);}});ami['on'](_0x85bc('0x32'),function(_0x3b453a){try{utils[_0x85bc('0x17')](util[_0x85bc('0x18')]('[%s][index][cdr]',_0x3b453a['uniqueid']),_0x3b453a);members['cdr'](_0x3b453a);}catch(_0x3c0e95){utils[_0x85bc('0x13')](util['format'](_0x85bc('0x33'),_0x3b453a[_0x85bc('0x1d')]),_0x3c0e95);}});ami['on'](_0x85bc('0x34'),function(_0x58b010){try{utils[_0x85bc('0x17')](util[_0x85bc('0x18')](_0x85bc('0x35'),_0x58b010['uniqueid']),_0x58b010);queues[_0x85bc('0x34')](_0x58b010);agents[_0x85bc('0x34')](_0x58b010);transfers[_0x85bc('0x34')](_0x58b010);recordings[_0x85bc('0x34')](_0x58b010);}catch(_0x4f5638){utils[_0x85bc('0x13')](util[_0x85bc('0x18')](_0x85bc('0x35'),_0x58b010['uniqueid']),_0x4f5638);}});ami['on'](_0x85bc('0x36'),function(_0x286555){try{utils[_0x85bc('0x17')](util[_0x85bc('0x18')](_0x85bc('0x37'),_0x286555[_0x85bc('0x38')]),_0x286555);queues[_0x85bc('0x36')](_0x286555);transfers[_0x85bc('0x36')](_0x286555);agents[_0x85bc('0x36')](_0x286555);calls['attendedtransfer'](_0x286555);}catch(_0x599d9c){utils[_0x85bc('0x13')](util['format'](_0x85bc('0x37'),_0x286555[_0x85bc('0x38')]),_0x599d9c);}});ami['on'](_0x85bc('0x39'),function(_0x192803){try{utils[_0x85bc('0x17')](util[_0x85bc('0x18')](_0x85bc('0x3a'),_0x192803[_0x85bc('0x1d')]),_0x192803);queues[_0x85bc('0x39')](_0x192803);recordings[_0x85bc('0x39')](_0x192803);calls[_0x85bc('0x39')](_0x192803);dials[_0x85bc('0x39')](_0x192803);}catch(_0xc3e2){utils['error'](util[_0x85bc('0x18')](_0x85bc('0x3a'),_0x192803[_0x85bc('0x1d')]),_0xc3e2);}});ami['on'](_0x85bc('0x3b'),function(_0x36b226){try{utils[_0x85bc('0x17')](util[_0x85bc('0x18')](_0x85bc('0x3c'),_0x36b226[_0x85bc('0x1d')]),_0x36b226);calls['newexten'](_0x36b226);recordings[_0x85bc('0x3b')](_0x36b226);dials[_0x85bc('0x3b')](_0x36b226);}catch(_0xbd5f02){utils['error'](util[_0x85bc('0x18')](_0x85bc('0x3c'),_0x36b226['uniqueid']),_0xbd5f02);}});ami['on'](_0x85bc('0x3d'),function(_0x48da60){try{utils[_0x85bc('0x17')](util['format'](_0x85bc('0x3e'),_0x48da60[_0x85bc('0x1d')]),_0x48da60);calls[_0x85bc('0x3d')](_0x48da60);recordings[_0x85bc('0x3d')](_0x48da60);}catch(_0x230971){utils['error'](util[_0x85bc('0x18')](_0x85bc('0x3e'),_0x48da60[_0x85bc('0x1d')]),_0x230971);}});ami['on'](_0x85bc('0x3f'),function(_0x37a289){try{utils[_0x85bc('0x17')](util[_0x85bc('0x18')](_0x85bc('0x40'),_0x37a289['uniqueid']),_0x37a289);dials['dialbegin'](_0x37a289);}catch(_0x3f9a91){utils[_0x85bc('0x13')](util[_0x85bc('0x18')](_0x85bc('0x41'),_0x37a289[_0x85bc('0x1d')]),_0x3f9a91);}});ami['on'](_0x85bc('0x42'),function(_0x1dea20){try{utils[_0x85bc('0x17')](util[_0x85bc('0x18')](_0x85bc('0x43'),_0x1dea20[_0x85bc('0x1d')]),_0x1dea20);dials[_0x85bc('0x42')](_0x1dea20);}catch(_0x388ef0){utils['error'](util[_0x85bc('0x18')]('[%s][index][dialend]',_0x1dea20[_0x85bc('0x1d')]),_0x388ef0);}});} \ No newline at end of file +var _0x997f=['./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','port','asterisk','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./calls.controller'];(function(_0x66d6c0,_0x11b01b){var _0x28b1e0=function(_0x31ce88){while(--_0x31ce88){_0x66d6c0['push'](_0x66d6c0['shift']());}};_0x28b1e0(++_0x11b01b);}(_0x997f,0x73));var _0xf997=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x997f[_0x576170];return _0x397c70;};var AsteriskManager=require(_0xf997('0x0'));var config=require(_0xf997('0x1'));var utils=require('./utils');var util=require(_0xf997('0x2'));var ami=new AsteriskManager(config['asterisk'][_0xf997('0x3')],config[_0xf997('0x4')]['ip'],config[_0xf997('0x4')][_0xf997('0x5')],config['asterisk'][_0xf997('0x6')],!![]);ami[_0xf997('0x7')]();if(config[_0xf997('0x8')]&&config[_0xf997('0x8')][_0xf997('0x9')]){utils[_0xf997('0xa')](_0xf997('0xb'));}else{var agents=require('./agents.controller');var calls=require(_0xf997('0xc'));var queues=require(_0xf997('0xd'));var recordings=require(_0xf997('0xe'));var members=require('./members.controller');var dials=require(_0xf997('0xf'));var transfers=require(_0xf997('0x10'));var core=require(_0xf997('0x11'));ami['on']('connect',core['connect']);ami['on'](_0xf997('0x12'),core['shutdown']);ami['on'](_0xf997('0x13'),core[_0xf997('0x13')]);ami['on']('error',core[_0xf997('0x14')]);ami['on']('close',core[_0xf997('0x15')]);ami['on'](_0xf997('0x16'),core[_0xf997('0x16')]);ami['on'](_0xf997('0x17'),function(_0x58cef1){try{utils[_0xf997('0x18')](util[_0xf997('0x19')](_0xf997('0x1a'),_0x58cef1[_0xf997('0x1b')]),_0x58cef1);members[_0xf997('0x17')](_0x58cef1);}catch(_0x126b68){utils[_0xf997('0x14')](util[_0xf997('0x19')](_0xf997('0x1a'),_0x58cef1[_0xf997('0x1b')]),_0x126b68);}});ami['on'](_0xf997('0x1c'),function(_0xa60e88){try{utils[_0xf997('0x18')](util[_0xf997('0x19')]('[%s][index][agentcalled]',_0xa60e88[_0xf997('0x1d')]),_0xa60e88);agents[_0xf997('0x1c')](_0xa60e88);}catch(_0x12969c){utils[_0xf997('0x14')](util[_0xf997('0x19')]('[%s][index][agentcalled]',_0xa60e88[_0xf997('0x1d')]),_0x12969c);}});ami['on']('agentringnoanswer',function(_0x380687){try{utils[_0xf997('0x18')](util[_0xf997('0x19')]('[%s][index][agentringnoanswer]',_0x380687['uniqueid']),_0x380687);agents[_0xf997('0x1e')](_0x380687);}catch(_0x25aadf){utils[_0xf997('0x14')](util[_0xf997('0x19')](_0xf997('0x1f'),_0x380687[_0xf997('0x1d')]),_0x25aadf);}});ami['on'](_0xf997('0x20'),function(_0x57aef4){try{utils[_0xf997('0x18')](util[_0xf997('0x19')]('[%s][index][agentconnect]',_0x57aef4[_0xf997('0x1d')]),_0x57aef4);agents[_0xf997('0x20')](_0x57aef4);queues[_0xf997('0x20')](_0x57aef4);}catch(_0x4e5e7d){utils[_0xf997('0x14')](util[_0xf997('0x19')](_0xf997('0x21'),_0x57aef4[_0xf997('0x1d')]),_0x4e5e7d);}});ami['on']('agentcomplete',function(_0x4013c0){try{utils['debug'](util['format'](_0xf997('0x22'),_0x4013c0[_0xf997('0x1d')]),_0x4013c0);agents['agentcomplete'](_0x4013c0);queues['agentcomplete'](_0x4013c0);members[_0xf997('0x23')](_0x4013c0);}catch(_0x251f60){utils[_0xf997('0x14')](util[_0xf997('0x19')]('[%s][index][agentcomplete]',_0x4013c0['uniqueid']),_0x251f60);}});ami['on']('queuecallerabandon',function(_0x58aad0){try{utils[_0xf997('0x18')](util[_0xf997('0x19')](_0xf997('0x24'),_0x58aad0[_0xf997('0x1d')]),_0x58aad0);agents[_0xf997('0x25')](_0x58aad0);queues[_0xf997('0x25')](_0x58aad0);}catch(_0x417e16){utils[_0xf997('0x14')](util[_0xf997('0x19')](_0xf997('0x24'),_0x58aad0['uniqueid']),_0x417e16);}});ami['on'](_0xf997('0x26'),function(_0x354621){try{utils[_0xf997('0x18')](util[_0xf997('0x19')]('[%s][index][queuecallerjoin]',_0x354621[_0xf997('0x1d')]),_0x354621);queues['queuecallerjoin'](_0x354621);recordings[_0xf997('0x26')](_0x354621);}catch(_0x10c3c1){utils['error'](util['format']('[%s][index][queuecallerjoin]',_0x354621[_0xf997('0x1d')]),_0x10c3c1);}});ami['on'](_0xf997('0x27'),function(_0x44dfb9){try{utils[_0xf997('0x18')](util[_0xf997('0x19')](_0xf997('0x28'),_0x44dfb9[_0xf997('0x1d')]),_0x44dfb9);queues[_0xf997('0x27')](_0x44dfb9);}catch(_0x568e7b){utils[_0xf997('0x14')](util['format'](_0xf997('0x28'),_0x44dfb9[_0xf997('0x1d')]),_0x568e7b);}});ami['on']('musiconholdstart',function(_0x108823){try{utils['debug'](util[_0xf997('0x19')]('[%s][index][musiconholdstart]',_0x108823['uniqueid']),_0x108823);queues[_0xf997('0x29')](_0x108823);calls[_0xf997('0x29')](_0x108823);}catch(_0x509701){utils['error'](util['format']('[%s][index][musiconholdstart]',_0x108823[_0xf997('0x1d')]),_0x509701);}});ami['on'](_0xf997('0x2a'),function(_0x338c8b){try{utils[_0xf997('0x18')](util[_0xf997('0x19')](_0xf997('0x2b'),_0x338c8b[_0xf997('0x1d')]),_0x338c8b);queues[_0xf997('0x2a')](_0x338c8b);calls[_0xf997('0x2a')](_0x338c8b);}catch(_0x596482){utils[_0xf997('0x14')](util[_0xf997('0x19')](_0xf997('0x2b'),_0x338c8b[_0xf997('0x1d')]),_0x596482);}});ami['on'](_0xf997('0x2c'),function(_0x37bf59){try{utils['debug'](util[_0xf997('0x19')](_0xf997('0x2d'),_0x37bf59[_0xf997('0x1d')]),_0x37bf59);calls[_0xf997('0x2c')](_0x37bf59);recordings[_0xf997('0x2c')](_0x37bf59);}catch(_0x24b83e){utils[_0xf997('0x14')](util[_0xf997('0x19')](_0xf997('0x2d'),_0x37bf59['uniqueid']),_0x24b83e);}});ami['on'](_0xf997('0x2e'),function(_0x587c0a){try{utils[_0xf997('0x18')](util['format'](_0xf997('0x2f'),_0x587c0a[_0xf997('0x1d')]),_0x587c0a);calls[_0xf997('0x2e')](_0x587c0a);recordings[_0xf997('0x2e')](_0x587c0a);dials[_0xf997('0x2e')](_0x587c0a);agents[_0xf997('0x2e')](_0x587c0a);queues[_0xf997('0x2e')](_0x587c0a);}catch(_0x27efd5){utils[_0xf997('0x14')](util[_0xf997('0x19')]('[%s][index][hangup]',_0x587c0a['uniqueid']),_0x27efd5);}});ami['on'](_0xf997('0x30'),function(_0x289d9b){try{utils[_0xf997('0x18')](util[_0xf997('0x19')](_0xf997('0x31'),_0x289d9b[_0xf997('0x1d')]),_0x289d9b);members[_0xf997('0x30')](_0x289d9b);}catch(_0xb61b89){utils[_0xf997('0x14')](util['format']('[%s][index][cdr]',_0x289d9b[_0xf997('0x1d')]),_0xb61b89);}});ami['on'](_0xf997('0x32'),function(_0x52b967){try{utils[_0xf997('0x18')](util[_0xf997('0x19')](_0xf997('0x33'),_0x52b967[_0xf997('0x1d')]),_0x52b967);queues[_0xf997('0x32')](_0x52b967);agents[_0xf997('0x32')](_0x52b967);transfers['blindtransfer'](_0x52b967);recordings[_0xf997('0x32')](_0x52b967);}catch(_0x593bce){utils['error'](util['format'](_0xf997('0x33'),_0x52b967[_0xf997('0x1d')]),_0x593bce);}});ami['on'](_0xf997('0x34'),function(_0x1a1449){try{utils['debug'](util[_0xf997('0x19')](_0xf997('0x35'),_0x1a1449['origtransfereruniqueid']),_0x1a1449);queues['attendedtransfer'](_0x1a1449);transfers['attendedtransfer'](_0x1a1449);agents[_0xf997('0x34')](_0x1a1449);calls[_0xf997('0x34')](_0x1a1449);}catch(_0x4ac1e5){utils[_0xf997('0x14')](util['format'](_0xf997('0x35'),_0x1a1449[_0xf997('0x36')]),_0x4ac1e5);}});ami['on']('varset',function(_0x156fa6){try{utils[_0xf997('0x18')](util[_0xf997('0x19')](_0xf997('0x37'),_0x156fa6[_0xf997('0x1d')]),_0x156fa6);queues[_0xf997('0x38')](_0x156fa6);recordings['varset'](_0x156fa6);calls['varset'](_0x156fa6);dials[_0xf997('0x38')](_0x156fa6);}catch(_0x1392b8){utils[_0xf997('0x14')](util[_0xf997('0x19')](_0xf997('0x37'),_0x156fa6['uniqueid']),_0x1392b8);}});ami['on'](_0xf997('0x39'),function(_0x16c044){try{utils[_0xf997('0x18')](util[_0xf997('0x19')](_0xf997('0x3a'),_0x16c044[_0xf997('0x1d')]),_0x16c044);calls[_0xf997('0x39')](_0x16c044);recordings['newexten'](_0x16c044);dials[_0xf997('0x39')](_0x16c044);}catch(_0x22c680){utils[_0xf997('0x14')](util[_0xf997('0x19')](_0xf997('0x3a'),_0x16c044[_0xf997('0x1d')]),_0x22c680);}});ami['on'](_0xf997('0x3b'),function(_0x135478){try{utils[_0xf997('0x18')](util[_0xf997('0x19')](_0xf997('0x3c'),_0x135478['uniqueid']),_0x135478);calls[_0xf997('0x3b')](_0x135478);recordings[_0xf997('0x3b')](_0x135478);}catch(_0x273f64){utils[_0xf997('0x14')](util['format'](_0xf997('0x3c'),_0x135478[_0xf997('0x1d')]),_0x273f64);}});ami['on']('dialbegin',function(_0x12fe20){try{utils['debug'](util['format']('[%s][index][dialbegin]',_0x12fe20[_0xf997('0x1d')]),_0x12fe20);dials[_0xf997('0x3d')](_0x12fe20);}catch(_0x1ab190){utils['error'](util[_0xf997('0x19')]('[%s]dialbegin',_0x12fe20['uniqueid']),_0x1ab190);}});ami['on'](_0xf997('0x3e'),function(_0x7a5763){try{utils['debug'](util['format']('[%s][index][dialend]',_0x7a5763[_0xf997('0x1d')]),_0x7a5763);dials['dialend'](_0x7a5763);}catch(_0x4ef83e){utils[_0xf997('0x14')](util[_0xf997('0x19')](_0xf997('0x3f'),_0x7a5763['uniqueid']),_0x4ef83e);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 623a494..6f05867 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 _0xafe6=['[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','source','[%s][members][cdr]','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','channel','membername','type','interface','getUserByInterface','name','internal','request','CreateMemberReport','getUserByName','split','then','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','device','uniqueid','state','BUSY','TALKING','now','agent','isNil','exitAt','duration','agentcomplete','[%s][members][agentcomplete]','queue','assign','cdr','data1','data2','destination'];(function(_0x4e74f8,_0x20671a){var _0x4b5aec=function(_0x216b8b){while(--_0x216b8b){_0x4e74f8['push'](_0x4e74f8['shift']());}};_0x4b5aec(++_0x20671a);}(_0xafe6,0x66));var _0x6afe=function(_0x18f5e6,_0x5e8ff8){_0x18f5e6=_0x18f5e6-0x0;var _0x566d26=_0xafe6[_0x18f5e6];return _0x566d26;};'use strict';var _=require(_0x6afe('0x0'));var util=require(_0x6afe('0x1'));var utils=require(_0x6afe('0x2'));var members={};var exclude=[_0x6afe('0x3'),_0x6afe('0x4')];function writeDB(_0x5e5f77){utils[_0x6afe('0x5')](util[_0x6afe('0x6')](_0x6afe('0x7'),_0x5e5f77['uniqueid'],_0x5e5f77['interface'],_0x5e5f77[_0x6afe('0x8')],_0x5e5f77['data2'],_0x5e5f77[_0x6afe('0x9')],_0x5e5f77[_0x6afe('0xa')]));if(_0x5e5f77[_0x6afe('0xb')]){utils[_0x6afe('0xc')](_0x5e5f77[_0x6afe('0xb')])['then'](function(_0x197e41){if(_0x197e41){_0x5e5f77['membername']=_0x197e41[_0x6afe('0xd')];_0x5e5f77['internal']=_0x197e41[_0x6afe('0xe')];utils[_0x6afe('0xf')](_0x6afe('0x10'),_0x5e5f77);}else{utils[_0x6afe('0x11')](_0x5e5f77[_0x6afe('0xb')][_0x6afe('0x12')]('/')[0x1])[_0x6afe('0x13')](function(_0x220d08){if(_0x220d08){_0x5e5f77[_0x6afe('0x9')]=_0x220d08['name'];_0x5e5f77[_0x6afe('0xe')]=_0x220d08['internal'];utils[_0x6afe('0xf')](_0x6afe('0x10'),_0x5e5f77);}});}})[_0x6afe('0x14')](function(_0x2bb416){utils[_0x6afe('0x15')](util[_0x6afe('0x6')](_0x6afe('0x16'),_0x5e5f77['uniqueid']),_0x2bb416);});}delete members[_0x5e5f77['interface']];}function startsWith(_0x16788f,_0x37915d){return _[_0x6afe('0x17')](_0x16788f,function(_0x3c4eca){return _[_0x6afe('0x18')](_0x37915d,_0x3c4eca);});}exports[_0x6afe('0x19')]=function(_0x2c7234){try{utils[_0x6afe('0x1a')](util[_0x6afe('0x6')]('[%s][members][devicestatechange]',members[_0x2c7234[_0x6afe('0x1b')]]?members[_0x2c7234[_0x6afe('0x1b')]]['uniqueid']:_0x2c7234[_0x6afe('0x1b')]),_0x2c7234);utils[_0x6afe('0x5')](util[_0x6afe('0x6')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x2c7234[_0x6afe('0x1b')]]?members[_0x2c7234['device']][_0x6afe('0x1c')]:_0x2c7234[_0x6afe('0x1b')],_0x2c7234['state'],_0x2c7234[_0x6afe('0x1b')]));switch(_0x2c7234[_0x6afe('0x1d')]){case'INUSE':case _0x6afe('0x1e'):if(!startsWith(exclude,_0x2c7234[_0x6afe('0x1b')])){members[_0x2c7234['device']]={'channel':'voice','interface':_0x2c7234[_0x6afe('0x1b')],'type':_0x6afe('0x1f'),'enterAt':utils[_0x6afe('0x20')](),'role':_0x6afe('0x21')};}break;case'NOT_INUSE':if(!_[_0x6afe('0x22')](members[_0x2c7234[_0x6afe('0x1b')]])){members[_0x2c7234[_0x6afe('0x1b')]][_0x6afe('0x23')]=utils[_0x6afe('0x20')]();members[_0x2c7234[_0x6afe('0x1b')]][_0x6afe('0x24')]=utils['diffTime'](members[_0x2c7234[_0x6afe('0x1b')]][_0x6afe('0x23')],members[_0x2c7234[_0x6afe('0x1b')]]['enterAt']);if(members[_0x2c7234[_0x6afe('0x1b')]][_0x6afe('0x1c')]){writeDB(members[_0x2c7234[_0x6afe('0x1b')]]);}}break;default:break;}}catch(_0x5ddeb9){utils[_0x6afe('0x15')](util[_0x6afe('0x6')]('[%s][members][devicestatechange]',members[_0x2c7234[_0x6afe('0x1b')]]?members[_0x2c7234[_0x6afe('0x1b')]][_0x6afe('0x1c')]:_0x2c7234[_0x6afe('0x1b')]),_0x5ddeb9);}};exports[_0x6afe('0x25')]=function(_0x56e6b6){try{if(!_[_0x6afe('0x22')](members[_0x56e6b6['interface']])){utils['debug'](util[_0x6afe('0x6')](_0x6afe('0x26'),_0x56e6b6[_0x6afe('0x1c')]),_0x56e6b6);utils[_0x6afe('0x5')](util[_0x6afe('0x6')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x56e6b6['uniqueid'],_0x56e6b6[_0x6afe('0xb')],_0x56e6b6[_0x6afe('0x27')]));members[_0x56e6b6[_0x6afe('0xb')]]=_[_0x6afe('0x28')](members[_0x56e6b6['interface']],{'data4':_0x56e6b6['queue'],'uniqueid':_0x56e6b6[_0x6afe('0x1c')]});}}catch(_0x161bcf){utils[_0x6afe('0x15')](util['format'](_0x6afe('0x26'),_0x56e6b6['uniqueid']),_0x161bcf);}};exports[_0x6afe('0x29')]=function(_0x23dd23){try{utils[_0x6afe('0x1a')](util[_0x6afe('0x6')]('[%s][members][cdr]',_0x23dd23[_0x6afe('0x1c')]),_0x23dd23);if(_0x23dd23[_0x6afe('0x8')]){var _0x264fbe=_0x23dd23[_0x6afe('0x8')][_0x6afe('0x12')]('-')[0x0];if(!_[_0x6afe('0x22')](members[_0x264fbe])){members[_0x264fbe]=_[_0x6afe('0x28')](members[_0x264fbe],{'data1':members[_0x264fbe][_0x6afe('0x2a')]||_0x23dd23[_0x6afe('0xa')],'data2':members[_0x264fbe][_0x6afe('0x2b')]||_0x23dd23['source'],'data3':members[_0x264fbe]['data3']||_0x23dd23[_0x6afe('0x2c')],'uniqueid':members[_0x264fbe][_0x6afe('0x1c')]||_0x23dd23[_0x6afe('0x1c')]});utils[_0x6afe('0x5')](util[_0x6afe('0x6')](_0x6afe('0x2d'),_0x23dd23[_0x6afe('0x1c')],members[_0x264fbe][_0x6afe('0x2a')],members[_0x264fbe][_0x6afe('0x2b')],members[_0x264fbe][_0x6afe('0x2e')]));if(members[_0x264fbe][_0x6afe('0x23')]){writeDB(members[_0x264fbe]);}}}if(_0x23dd23['destinationchannel']){var _0x3cfe59=_0x23dd23['destinationchannel']['split']('-')[0x0];if(!_[_0x6afe('0x22')](members[_0x3cfe59])){members[_0x3cfe59]=_[_0x6afe('0x28')](members[_0x3cfe59],{'data1':members[_0x3cfe59][_0x6afe('0x2a')]||_0x23dd23[_0x6afe('0xa')],'data2':members[_0x3cfe59][_0x6afe('0x2b')]||_0x23dd23[_0x6afe('0x2f')],'data3':members[_0x3cfe59][_0x6afe('0x2e')]||_0x23dd23[_0x6afe('0x2c')],'uniqueid':members[_0x3cfe59][_0x6afe('0x1c')]||_0x23dd23[_0x6afe('0x1c')]});utils[_0x6afe('0x5')](util[_0x6afe('0x6')](_0x6afe('0x2d'),_0x23dd23['uniqueid'],members[_0x3cfe59][_0x6afe('0x2a')],members[_0x3cfe59][_0x6afe('0x2b')],members[_0x3cfe59][_0x6afe('0x2e')]));if(members[_0x3cfe59][_0x6afe('0x23')]){writeDB(members[_0x3cfe59]);}}}}catch(_0x12cb10){utils['error'](util[_0x6afe('0x6')](_0x6afe('0x30'),_0x23dd23[_0x6afe('0x1c')]),_0x12cb10);}}; \ No newline at end of file +var _0x79d8=['data1','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','destinationchannel','[%s][members][cdr]','lodash','util','./utils','Local/_attended@transfer','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','data2','membername','type','then','name','internal','getUserByName','split','CreateMemberReport','error','format','[%s][members][writeDB]','some','debug','[%s][members][devicestatechange]','device','state','INUSE','BUSY','voice','TALKING','now','agent','isNil','exitAt','duration','diffTime','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','channel'];(function(_0x1df7b8,_0x2fe5e5){var _0x29d911=function(_0x340121){while(--_0x340121){_0x1df7b8['push'](_0x1df7b8['shift']());}};_0x29d911(++_0x2fe5e5);}(_0x79d8,0x67));var _0x879d=function(_0x2b801c,_0x7c8f8b){_0x2b801c=_0x2b801c-0x0;var _0x2888a2=_0x79d8[_0x2b801c];return _0x2888a2;};'use strict';var _=require(_0x879d('0x0'));var util=require(_0x879d('0x1'));var utils=require(_0x879d('0x2'));var members={};var exclude=[_0x879d('0x3'),'Queue:'];function writeDB(_0x20dbdc){utils[_0x879d('0x4')](util['format'](_0x879d('0x5'),_0x20dbdc[_0x879d('0x6')],_0x20dbdc[_0x879d('0x7')],_0x20dbdc['channel'],_0x20dbdc[_0x879d('0x8')],_0x20dbdc[_0x879d('0x9')],_0x20dbdc[_0x879d('0xa')]));if(_0x20dbdc[_0x879d('0x7')]){utils['getUserByInterface'](_0x20dbdc[_0x879d('0x7')])[_0x879d('0xb')](function(_0x8de508){if(_0x8de508){_0x20dbdc[_0x879d('0x9')]=_0x8de508[_0x879d('0xc')];_0x20dbdc['internal']=_0x8de508[_0x879d('0xd')];utils['request']('CreateMemberReport',_0x20dbdc);}else{utils[_0x879d('0xe')](_0x20dbdc[_0x879d('0x7')][_0x879d('0xf')]('/')[0x1])['then'](function(_0x3b3342){if(_0x3b3342){_0x20dbdc[_0x879d('0x9')]=_0x3b3342['name'];_0x20dbdc[_0x879d('0xd')]=_0x3b3342[_0x879d('0xd')];utils['request'](_0x879d('0x10'),_0x20dbdc);}});}})['catch'](function(_0x1fd482){utils[_0x879d('0x11')](util[_0x879d('0x12')](_0x879d('0x13'),_0x20dbdc[_0x879d('0x6')]),_0x1fd482);});}delete members[_0x20dbdc[_0x879d('0x7')]];}function startsWith(_0x53dcdc,_0x575001){return _[_0x879d('0x14')](_0x53dcdc,function(_0x175dfe){return _['startsWith'](_0x575001,_0x175dfe);});}exports['devicestatechange']=function(_0x7478cd){try{utils[_0x879d('0x15')](util[_0x879d('0x12')](_0x879d('0x16'),members[_0x7478cd[_0x879d('0x17')]]?members[_0x7478cd[_0x879d('0x17')]][_0x879d('0x6')]:_0x7478cd['device']),_0x7478cd);utils['info'](util[_0x879d('0x12')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x7478cd[_0x879d('0x17')]]?members[_0x7478cd['device']][_0x879d('0x6')]:_0x7478cd[_0x879d('0x17')],_0x7478cd[_0x879d('0x18')],_0x7478cd[_0x879d('0x17')]));switch(_0x7478cd[_0x879d('0x18')]){case _0x879d('0x19'):case _0x879d('0x1a'):if(!startsWith(exclude,_0x7478cd['device'])){members[_0x7478cd[_0x879d('0x17')]]={'channel':_0x879d('0x1b'),'interface':_0x7478cd[_0x879d('0x17')],'type':_0x879d('0x1c'),'enterAt':utils[_0x879d('0x1d')](),'role':_0x879d('0x1e')};}break;case'NOT_INUSE':if(!_[_0x879d('0x1f')](members[_0x7478cd['device']])){members[_0x7478cd[_0x879d('0x17')]][_0x879d('0x20')]=utils[_0x879d('0x1d')]();members[_0x7478cd['device']][_0x879d('0x21')]=utils[_0x879d('0x22')](members[_0x7478cd[_0x879d('0x17')]][_0x879d('0x20')],members[_0x7478cd[_0x879d('0x17')]]['enterAt']);if(members[_0x7478cd['device']][_0x879d('0x6')]){writeDB(members[_0x7478cd[_0x879d('0x17')]]);}}break;default:break;}}catch(_0x5480c7){utils['error'](util[_0x879d('0x12')](_0x879d('0x16'),members[_0x7478cd[_0x879d('0x17')]]?members[_0x7478cd[_0x879d('0x17')]][_0x879d('0x6')]:_0x7478cd['device']),_0x5480c7);}};exports['agentcomplete']=function(_0xc2b5dd){try{if(!_[_0x879d('0x1f')](members[_0xc2b5dd[_0x879d('0x7')]])){utils[_0x879d('0x15')](util['format'](_0x879d('0x23'),_0xc2b5dd[_0x879d('0x6')]),_0xc2b5dd);utils[_0x879d('0x4')](util['format'](_0x879d('0x24'),_0xc2b5dd[_0x879d('0x6')],_0xc2b5dd[_0x879d('0x7')],_0xc2b5dd['queue']));members[_0xc2b5dd[_0x879d('0x7')]]=_[_0x879d('0x25')](members[_0xc2b5dd[_0x879d('0x7')]],{'data4':_0xc2b5dd[_0x879d('0x26')],'uniqueid':_0xc2b5dd[_0x879d('0x6')]});}}catch(_0x29ec88){utils[_0x879d('0x11')](util[_0x879d('0x12')](_0x879d('0x23'),_0xc2b5dd[_0x879d('0x6')]),_0x29ec88);}};exports[_0x879d('0x27')]=function(_0x3eee95){try{utils[_0x879d('0x15')](util[_0x879d('0x12')]('[%s][members][cdr]',_0x3eee95[_0x879d('0x6')]),_0x3eee95);if(_0x3eee95[_0x879d('0x28')]){var _0x3c1595=_0x3eee95['channel'][_0x879d('0xf')]('-')[0x0];if(!_[_0x879d('0x1f')](members[_0x3c1595])){members[_0x3c1595]=_['assign'](members[_0x3c1595],{'data1':members[_0x3c1595][_0x879d('0x29')]||_0x3eee95[_0x879d('0xa')],'data2':members[_0x3c1595][_0x879d('0x8')]||_0x3eee95[_0x879d('0x2a')],'data3':members[_0x3c1595]['data3']||_0x3eee95[_0x879d('0x2b')],'uniqueid':members[_0x3c1595][_0x879d('0x6')]||_0x3eee95[_0x879d('0x6')]});utils['info'](util[_0x879d('0x12')](_0x879d('0x2c'),_0x3eee95[_0x879d('0x6')],members[_0x3c1595][_0x879d('0x29')],members[_0x3c1595][_0x879d('0x8')],members[_0x3c1595][_0x879d('0x2d')]));if(members[_0x3c1595][_0x879d('0x20')]){writeDB(members[_0x3c1595]);}}}if(_0x3eee95[_0x879d('0x2e')]){var _0xcad65a=_0x3eee95[_0x879d('0x2e')]['split']('-')[0x0];if(!_['isNil'](members[_0xcad65a])){members[_0xcad65a]=_[_0x879d('0x25')](members[_0xcad65a],{'data1':members[_0xcad65a][_0x879d('0x29')]||_0x3eee95['type'],'data2':members[_0xcad65a][_0x879d('0x8')]||_0x3eee95['source'],'data3':members[_0xcad65a]['data3']||_0x3eee95[_0x879d('0x2b')],'uniqueid':members[_0xcad65a]['uniqueid']||_0x3eee95[_0x879d('0x6')]});utils[_0x879d('0x4')](util[_0x879d('0x12')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x3eee95[_0x879d('0x6')],members[_0xcad65a][_0x879d('0x29')],members[_0xcad65a][_0x879d('0x8')],members[_0xcad65a][_0x879d('0x2d')]));if(members[_0xcad65a]['exitAt']){writeDB(members[_0xcad65a]);}}}}catch(_0x2c04c2){utils['error'](util[_0x879d('0x12')](_0x879d('0x2f'),_0x3eee95[_0x879d('0x6')]),_0x2c04c2);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 7499f11..eb03cfe 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 _0xa424=['ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','connectedlinenum','holdtime','diffTime','count','connectedlinename','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','transfer','TRANSFER','COMPLETEDBY','reason','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfereruniqueid','origtransfererexten','transfertype','ATTENDED','transfereelinkedid','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','queuecallerjoinAt','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','./utils','info','format','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','[%s][queues][queuecallerjoin]','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','isNil','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','EXITWITHKEY','[%s][queues][queuecallerabandon]'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xa424,0xa1));var _0x4a42=function(_0x2dbc9f,_0x5a89fa){_0x2dbc9f=_0x2dbc9f-0x0;var _0x704149=_0xa424[_0x2dbc9f];return _0x704149;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x4a42('0x0'));var queues={};function writeDB(_0x3a7751){utils[_0x4a42('0x1')](util[_0x4a42('0x2')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x3a7751[_0x4a42('0x3')],_0x3a7751[_0x4a42('0x4')],_0x3a7751[_0x4a42('0x5')],_0x3a7751[_0x4a42('0x6')],_0x3a7751[_0x4a42('0x7')],_0x3a7751[_0x4a42('0x8')],_0x3a7751[_0x4a42('0x9')]));if(_0x3a7751[_0x4a42('0x5')]){utils[_0x4a42('0xa')](_0x3a7751['queue'])[_0x4a42('0xb')](function(_0x23d48e){if(_0x23d48e){_0x3a7751['type']=_0x23d48e[_0x4a42('0xc')];}utils[_0x4a42('0xd')](_0x4a42('0xe'),_0x3a7751);});}else{utils['request'](_0x4a42('0xe'),_0x3a7751);}if(_0x3a7751[_0x4a42('0xf')]){delete queues[_0x3a7751[_0x4a42('0xf')]];}else{delete queues[_0x3a7751['uniqueid']];}}exports[_0x4a42('0x10')]=function(_0x5a5ed5){try{utils[_0x4a42('0x11')](util[_0x4a42('0x2')]('[%s][queues][queuecallerjoin]',_0x5a5ed5[_0x4a42('0x3')]),_0x5a5ed5);utils[_0x4a42('0x1')](util[_0x4a42('0x2')](_0x4a42('0x12'),_0x5a5ed5[_0x4a42('0x3')],_0x5a5ed5[_0x4a42('0x5')],_0x5a5ed5['position']));queues[_0x5a5ed5[_0x4a42('0x3')]]=_[_0x4a42('0x13')](_0x5a5ed5,{'originalposition':_0x5a5ed5[_0x4a42('0x14')],'queuecallerjoinAt':utils[_0x4a42('0x15')](),'mohtime':0x0});}catch(_0x5c65bf){utils[_0x4a42('0x16')](util['format'](_0x4a42('0x17'),_0x5a5ed5['uniqueid']),_0x5c65bf);}};exports[_0x4a42('0x18')]=function(_0x2ce09c){try{if(!_['isNil'](queues[_0x2ce09c[_0x4a42('0x3')]])){utils[_0x4a42('0x11')](util[_0x4a42('0x2')](_0x4a42('0x19'),_0x2ce09c[_0x4a42('0x3')]),_0x2ce09c);if(queues[_0x2ce09c['uniqueid']][_0x4a42('0x1a')]){if(!queues[_0x2ce09c['uniqueid']][_0x4a42('0x1b')]&&!queues[_0x2ce09c[_0x4a42('0x3')]][_0x4a42('0x1c')]){queues[_0x2ce09c[_0x4a42('0x3')]][_0x4a42('0x1d')]=!![];queues[_0x2ce09c[_0x4a42('0x3')]]['queuecallercompleteAt']=utils[_0x4a42('0x15')]();queues[_0x2ce09c[_0x4a42('0x3')]][_0x4a42('0x9')]=_0x4a42('0x1e');}utils[_0x4a42('0x1')](util['format'](_0x4a42('0x1f'),_0x2ce09c[_0x4a42('0x3')],queues[_0x2ce09c['uniqueid']][_0x4a42('0x20')],queues[_0x2ce09c[_0x4a42('0x3')]][_0x4a42('0x9')]));writeDB(queues[_0x2ce09c[_0x4a42('0x3')]]);}else if(queues[_0x2ce09c['uniqueid']]['transfereduniqueid']){utils['info'](util[_0x4a42('0x2')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x2ce09c['uniqueid'],queues[_0x2ce09c['uniqueid']][_0x4a42('0x20')],queues[_0x2ce09c[_0x4a42('0x3')]][_0x4a42('0xf')]));queues[queues[_0x2ce09c['uniqueid']]['transfereduniqueid']]=queues[_0x2ce09c['uniqueid']];queues[queues[_0x2ce09c[_0x4a42('0x3')]]['transfereduniqueid']][_0x4a42('0x21')]=0x2;delete queues[_0x2ce09c[_0x4a42('0x3')]];}}}catch(_0x2d1f9d){utils[_0x4a42('0x16')](util[_0x4a42('0x2')](_0x4a42('0x19'),_0x2ce09c[_0x4a42('0x3')]),_0x2d1f9d);}};exports[_0x4a42('0x22')]=function(_0x1b8429){try{utils[_0x4a42('0x11')](util['format'](_0x4a42('0x23'),_0x1b8429[_0x4a42('0x3')]),_0x1b8429);if(!_[_0x4a42('0x24')](_0x1b8429[_0x4a42('0x25')][_0x4a42('0x26')])&&_0x1b8429[_0x4a42('0x27')][_0x4a42('0x28')]()!==_0x4a42('0x29')){if(!_[_0x4a42('0x24')](queues[_0x1b8429[_0x4a42('0x3')]])){queues[_0x1b8429[_0x4a42('0x3')]][_0x4a42('0x1b')]=![];queues[_0x1b8429[_0x4a42('0x3')]][_0x4a42('0x2a')]=null;queues[_0x1b8429[_0x4a42('0x3')]][_0x4a42('0x1c')]=!![];queues[_0x1b8429[_0x4a42('0x3')]][_0x4a42('0x2b')]=utils[_0x4a42('0x15')]();queues[_0x1b8429[_0x4a42('0x3')]][_0x4a42('0x9')]=_0x1b8429[_0x4a42('0x27')][_0x4a42('0x28')]();utils[_0x4a42('0x1')](util[_0x4a42('0x2')](_0x4a42('0x2c'),_0x1b8429['uniqueid'],queues[_0x1b8429[_0x4a42('0x3')]][_0x4a42('0x20')],_0x1b8429[_0x4a42('0x27')],queues[_0x1b8429[_0x4a42('0x3')]][_0x4a42('0x9')]));writeDB(queues[_0x1b8429[_0x4a42('0x3')]]);}}else if(!_[_0x4a42('0x24')](_0x1b8429[_0x4a42('0x25')]['queueposition'])){if(!_[_0x4a42('0x24')](queues[_0x1b8429[_0x4a42('0x3')]])&&!queues[_0x1b8429[_0x4a42('0x3')]][_0x4a42('0x1b')]){queues[_0x1b8429[_0x4a42('0x3')]][_0x4a42('0x1b')]=![];queues[_0x1b8429[_0x4a42('0x3')]]['queuecallerabandonAt']=null;queues[_0x1b8429['uniqueid']]['queuecallerexit']=!![];queues[_0x1b8429[_0x4a42('0x3')]][_0x4a42('0x2b')]=utils['now']();queues[_0x1b8429['uniqueid']][_0x4a42('0x9')]=_0x4a42('0x2d');utils[_0x4a42('0x1')](util[_0x4a42('0x2')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x1b8429[_0x4a42('0x3')],queues[_0x1b8429[_0x4a42('0x3')]][_0x4a42('0x20')],_0x1b8429[_0x4a42('0x27')],queues[_0x1b8429['uniqueid']][_0x4a42('0x9')]));}}}catch(_0x353f00){utils[_0x4a42('0x16')](util['format'](_0x4a42('0x23'),_0x1b8429[_0x4a42('0x3')]),_0x353f00);}};exports[_0x4a42('0x1b')]=function(_0x25712d){try{if(!_['isNil'](queues[_0x25712d[_0x4a42('0x3')]])){utils[_0x4a42('0x11')](util[_0x4a42('0x2')](_0x4a42('0x2e'),_0x25712d[_0x4a42('0x3')]),_0x25712d);queues[_0x25712d[_0x4a42('0x3')]][_0x4a42('0x1c')]=![];queues[_0x25712d[_0x4a42('0x3')]][_0x4a42('0x2b')]=null;queues[_0x25712d[_0x4a42('0x3')]][_0x4a42('0x1b')]=!![];queues[_0x25712d[_0x4a42('0x3')]][_0x4a42('0x2a')]=utils[_0x4a42('0x15')]();queues[_0x25712d[_0x4a42('0x3')]][_0x4a42('0x9')]=_0x4a42('0x2f');utils[_0x4a42('0x1')](util['format'](_0x4a42('0x30'),_0x25712d[_0x4a42('0x3')],queues[_0x25712d[_0x4a42('0x3')]][_0x4a42('0x20')],queues[_0x25712d[_0x4a42('0x3')]]['queuecallerexitreason']));}}catch(_0x468074){utils[_0x4a42('0x16')](util[_0x4a42('0x2')](_0x4a42('0x2e'),_0x25712d[_0x4a42('0x3')]),_0x468074);}};exports[_0x4a42('0x31')]=function(_0x4b3002){try{if(!_['isNil'](queues[_0x4b3002[_0x4a42('0x3')]])){utils[_0x4a42('0x11')](util[_0x4a42('0x2')]('[%s][queues][queuecallerleave]',_0x4b3002[_0x4a42('0x3')]),_0x4b3002);utils['info'](util[_0x4a42('0x2')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x4b3002[_0x4a42('0x3')],queues[_0x4b3002['uniqueid']][_0x4a42('0x20')],_0x4b3002[_0x4a42('0x32')],_0x4b3002['connectedlinename']));queues[_0x4b3002[_0x4a42('0x3')]][_0x4a42('0x31')]=!![];queues[_0x4b3002['uniqueid']][_0x4a42('0x1a')]=utils[_0x4a42('0x15')]();queues[_0x4b3002[_0x4a42('0x3')]][_0x4a42('0x33')]=utils[_0x4a42('0x34')](queues[_0x4b3002[_0x4a42('0x3')]][_0x4a42('0x1a')],queues[_0x4b3002[_0x4a42('0x3')]]['queuecallerjoinAt']);queues[_0x4b3002[_0x4a42('0x3')]]['position']=_0x4b3002['position'];queues[_0x4b3002['uniqueid']][_0x4a42('0x35')]=_0x4b3002[_0x4a42('0x35')];queues[_0x4b3002[_0x4a42('0x3')]][_0x4a42('0x32')]=_0x4b3002[_0x4a42('0x32')];queues[_0x4b3002[_0x4a42('0x3')]][_0x4a42('0x36')]=_0x4b3002[_0x4a42('0x36')];}}catch(_0x130a69){utils[_0x4a42('0x16')](util[_0x4a42('0x2')](_0x4a42('0x37'),_0x4b3002['uniqueid']),_0x130a69);}};exports[_0x4a42('0x38')]=function(_0x428f0b){try{if(!_[_0x4a42('0x24')](queues[_0x428f0b[_0x4a42('0x3')]])){utils[_0x4a42('0x11')](util[_0x4a42('0x2')]('[%s][queues][agentconnect]',_0x428f0b[_0x4a42('0x3')]),_0x428f0b);utils[_0x4a42('0x1')](util[_0x4a42('0x2')](_0x4a42('0x39'),_0x428f0b['uniqueid'],queues[_0x428f0b[_0x4a42('0x3')]]['name'],_0x428f0b[_0x4a42('0x3a')],_0x428f0b[_0x4a42('0x3b')]));queues[_0x428f0b[_0x4a42('0x3')]][_0x4a42('0x1b')]=![];queues[_0x428f0b[_0x4a42('0x3')]][_0x4a42('0x1b')]=![];queues[_0x428f0b[_0x4a42('0x3')]]['queuecallerabandonAt']=null;queues[_0x428f0b[_0x4a42('0x3')]][_0x4a42('0x1c')]=![];queues[_0x428f0b[_0x4a42('0x3')]][_0x4a42('0x9')]=null;queues[_0x428f0b[_0x4a42('0x3')]][_0x4a42('0x2b')]=null;queues[_0x428f0b['uniqueid']][_0x4a42('0x3c')]=!![];queues[_0x428f0b[_0x4a42('0x3')]][_0x4a42('0x8')]=_0x428f0b[_0x4a42('0x3b')];queues[_0x428f0b['uniqueid']][_0x4a42('0x6')]=_0x428f0b['membername'];}}catch(_0x30ba1f){utils[_0x4a42('0x16')](util['format'](_0x4a42('0x3d'),_0x428f0b[_0x4a42('0x3')]),_0x30ba1f);}};exports[_0x4a42('0x3e')]=function(_0x5ca96b){try{if(!_[_0x4a42('0x24')](queues[_0x5ca96b['uniqueid']])){if(queues[_0x5ca96b[_0x4a42('0x3')]]['queuecallerleaveAt']){utils[_0x4a42('0x11')](util[_0x4a42('0x2')](_0x4a42('0x3f'),_0x5ca96b[_0x4a42('0x3')]),_0x5ca96b);queues[_0x5ca96b[_0x4a42('0x3')]][_0x4a42('0x1b')]=![];queues[_0x5ca96b['uniqueid']][_0x4a42('0x1b')]=![];queues[_0x5ca96b['uniqueid']][_0x4a42('0x2a')]=null;queues[_0x5ca96b[_0x4a42('0x3')]][_0x4a42('0x1c')]=![];queues[_0x5ca96b[_0x4a42('0x3')]][_0x4a42('0x2b')]=null;queues[_0x5ca96b[_0x4a42('0x3')]][_0x4a42('0x3c')]=!![];queues[_0x5ca96b[_0x4a42('0x3')]][_0x4a42('0x6')]=_0x5ca96b[_0x4a42('0x3a')];queues[_0x5ca96b[_0x4a42('0x3')]]['queuecallercomplete']=!![];queues[_0x5ca96b[_0x4a42('0x3')]]['queuecallercompleteAt']=utils[_0x4a42('0x15')]();if(_0x5ca96b['reason']=='transfer'){if(!queues[_0x5ca96b['uniqueid']][_0x4a42('0x40')]){queues[_0x5ca96b[_0x4a42('0x3')]][_0x4a42('0x9')]=_0x4a42('0x41');}}else{queues[_0x5ca96b[_0x4a42('0x3')]]['queuecallerexitreason']=_0x4a42('0x42')+_0x5ca96b[_0x4a42('0x43')]['toUpperCase']();}utils[_0x4a42('0x1')](util[_0x4a42('0x2')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x5ca96b[_0x4a42('0x3')],queues[_0x5ca96b[_0x4a42('0x3')]][_0x4a42('0x20')],_0x5ca96b[_0x4a42('0x3a')],queues[_0x5ca96b['uniqueid']][_0x4a42('0x9')]));writeDB(queues[_0x5ca96b[_0x4a42('0x3')]]);}}}catch(_0x53da1f){utils[_0x4a42('0x16')](util[_0x4a42('0x2')](_0x4a42('0x3f'),_0x5ca96b[_0x4a42('0x3')]),_0x53da1f);}};exports[_0x4a42('0x44')]=function(_0x49a630){try{if(!_[_0x4a42('0x24')](queues[_0x49a630['transfereeuniqueid']])){utils['debug'](util[_0x4a42('0x2')](_0x4a42('0x45'),_0x49a630[_0x4a42('0x3')]),_0x49a630);queues[_0x49a630[_0x4a42('0x46')]]['transfer']=!![];queues[_0x49a630[_0x4a42('0x46')]]['transfertype']=_0x4a42('0x47');queues[_0x49a630[_0x4a42('0x46')]][_0x4a42('0x48')]=_0x49a630[_0x4a42('0x49')];queues[_0x49a630[_0x4a42('0x46')]][_0x4a42('0x4a')]=_0x49a630[_0x4a42('0x46')];queues[_0x49a630[_0x4a42('0x46')]][_0x4a42('0x9')]=_0x4a42('0x4b');utils['info'](util[_0x4a42('0x2')](_0x4a42('0x4c'),_0x49a630[_0x4a42('0x3')],queues[_0x49a630[_0x4a42('0x46')]][_0x4a42('0x20')],_0x49a630[_0x4a42('0x46')],_0x49a630[_0x4a42('0x49')]));}}catch(_0x9ef923){utils['error'](util[_0x4a42('0x2')]('[%s][queues][blindtransfer]',_0x49a630[_0x4a42('0x3')]),_0x9ef923);}};exports[_0x4a42('0x4d')]=function(_0x31a5aa){try{utils[_0x4a42('0x11')](util['format'](_0x4a42('0x4e'),_0x31a5aa['origtransfereruniqueid']),_0x31a5aa);if(_0x31a5aa['origtransfereruniqueid']==_0x31a5aa[_0x4a42('0x4f')]){if(!_['isNil'](queues[_0x31a5aa[_0x4a42('0x50')]])){utils[_0x4a42('0x1')](util[_0x4a42('0x2')](_0x4a42('0x51'),_0x31a5aa[_0x4a42('0x52')],queues[_0x31a5aa['secondtransfererlinkedid']][_0x4a42('0x20')],_0x31a5aa[_0x4a42('0x53')]));queues[_0x31a5aa['secondtransfererlinkedid']][_0x4a42('0x40')]=!![];queues[_0x31a5aa[_0x4a42('0x50')]][_0x4a42('0x54')]=_0x4a42('0x55');queues[_0x31a5aa[_0x4a42('0x50')]][_0x4a42('0x48')]=_0x31a5aa['origtransfererexten'];queues[_0x31a5aa[_0x4a42('0x50')]][_0x4a42('0x4a')]=_0x31a5aa[_0x4a42('0x52')];queues[_0x31a5aa[_0x4a42('0x50')]][_0x4a42('0x9')]='ATTENDEDTRANSFER';}if(!_[_0x4a42('0x24')](queues[_0x31a5aa[_0x4a42('0x4f')]])){if(_0x31a5aa[_0x4a42('0x56')]&&queues[_0x31a5aa[_0x4a42('0x56')]]){queues[_0x31a5aa['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x31a5aa[_0x4a42('0x46')]]=_['clone'](queues[_0x31a5aa[_0x4a42('0x56')]]);queues[_0x31a5aa[_0x4a42('0x46')]]['transfereduniqueid']=_0x31a5aa[_0x4a42('0x57')];queues[_0x31a5aa[_0x4a42('0x46')]][_0x4a42('0x21')]=0x2;queues[_0x31a5aa['transfereeuniqueid']][_0x4a42('0x7')]=queues[_0x31a5aa[_0x4a42('0x50')]][_0x4a42('0x7')];queues[_0x31a5aa[_0x4a42('0x46')]][_0x4a42('0x58')]=queues[_0x31a5aa[_0x4a42('0x50')]]['calleridname'];queues[_0x31a5aa[_0x4a42('0x46')]]['queuecallerjoinAt']=utils[_0x4a42('0x15')]();queues[_0x31a5aa[_0x4a42('0x46')]][_0x4a42('0x1a')]=utils[_0x4a42('0x15')]();queues[_0x31a5aa[_0x4a42('0x46')]]['holdtime']=0x0;queues[_0x31a5aa[_0x4a42('0x46')]][_0x4a42('0x59')]=0x0;utils[_0x4a42('0x1')](util[_0x4a42('0x2')](_0x4a42('0x5a'),_0x31a5aa[_0x4a42('0x52')],queues[_0x31a5aa['transfereeuniqueid']][_0x4a42('0x20')],queues[_0x31a5aa['transfereeuniqueid']]['calleridnum'],queues[_0x31a5aa[_0x4a42('0x46')]][_0x4a42('0x58')]));}else{utils[_0x4a42('0x1')](util[_0x4a42('0x2')](_0x4a42('0x5b'),_0x31a5aa[_0x4a42('0x52')],queues[_0x31a5aa[_0x4a42('0x4f')]][_0x4a42('0x20')],_0x31a5aa['secondtransfererlinkedid']));queues[_0x31a5aa[_0x4a42('0x4f')]][_0x4a42('0xf')]=_0x31a5aa['secondtransfererlinkedid'];}}}else if(_0x31a5aa[_0x4a42('0x5c')]==_0x31a5aa['secondtransfererlinkedid']){if(!_['isNil'](queues[_0x31a5aa[_0x4a42('0x4f')]])){utils[_0x4a42('0x1')](util[_0x4a42('0x2')](_0x4a42('0x5d'),_0x31a5aa[_0x4a42('0x52')],queues[_0x31a5aa[_0x4a42('0x4f')]]['name'],_0x31a5aa[_0x4a42('0x5c')],_0x31a5aa[_0x4a42('0x5e')]));queues[_0x31a5aa[_0x4a42('0x4f')]][_0x4a42('0x40')]=!![];queues[_0x31a5aa[_0x4a42('0x4f')]][_0x4a42('0x54')]=_0x4a42('0x55');queues[_0x31a5aa['origtransfererlinkedid']][_0x4a42('0x48')]=_0x31a5aa['secondtransfererexten'];queues[_0x31a5aa[_0x4a42('0x4f')]][_0x4a42('0x4a')]=_0x31a5aa[_0x4a42('0x5c')];queues[_0x31a5aa[_0x4a42('0x4f')]][_0x4a42('0x9')]=_0x4a42('0x5f');}if(!_['isNil'](queues[_0x31a5aa[_0x4a42('0x50')]])){if(_0x31a5aa['transfertargetlinkedid']&&queues[_0x31a5aa[_0x4a42('0x60')]]){queues[_0x31a5aa['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x31a5aa[_0x4a42('0x57')]]=_['clone'](queues[_0x31a5aa[_0x4a42('0x60')]]);queues[_0x31a5aa[_0x4a42('0x57')]][_0x4a42('0xf')]=_0x31a5aa[_0x4a42('0x57')];queues[_0x31a5aa[_0x4a42('0x57')]][_0x4a42('0x21')]=0x2;queues[_0x31a5aa['transfertargetuniqueid']]['calleridnum']=queues[_0x31a5aa[_0x4a42('0x4f')]][_0x4a42('0x7')];queues[_0x31a5aa['transfertargetuniqueid']][_0x4a42('0x58')]=queues[_0x31a5aa[_0x4a42('0x4f')]][_0x4a42('0x58')];queues[_0x31a5aa[_0x4a42('0x57')]][_0x4a42('0x61')]=utils[_0x4a42('0x15')]();queues[_0x31a5aa[_0x4a42('0x57')]][_0x4a42('0x1a')]=utils[_0x4a42('0x15')]();queues[_0x31a5aa[_0x4a42('0x57')]][_0x4a42('0x33')]=0x0;queues[_0x31a5aa[_0x4a42('0x57')]][_0x4a42('0x59')]=0x0;utils['info'](util[_0x4a42('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x31a5aa[_0x4a42('0x52')],queues[_0x31a5aa[_0x4a42('0x57')]][_0x4a42('0x20')],queues[_0x31a5aa['transfertargetuniqueid']][_0x4a42('0xf')],queues[_0x31a5aa[_0x4a42('0x57')]][_0x4a42('0x7')],queues[_0x31a5aa[_0x4a42('0x57')]][_0x4a42('0x58')]));}else{utils['info'](util[_0x4a42('0x2')](_0x4a42('0x5b'),_0x31a5aa[_0x4a42('0x52')],queues[_0x31a5aa[_0x4a42('0x50')]][_0x4a42('0x20')],_0x31a5aa[_0x4a42('0x4f')]));queues[_0x31a5aa[_0x4a42('0x50')]][_0x4a42('0xf')]=_0x31a5aa[_0x4a42('0x4f')];}}}}catch(_0x2e3fa6){utils[_0x4a42('0x16')](util[_0x4a42('0x2')](_0x4a42('0x4e'),_0x31a5aa[_0x4a42('0x52')]),_0x2e3fa6);}};exports['musiconholdstart']=function(_0x102802){try{if(!_[_0x4a42('0x24')](queues[_0x102802[_0x4a42('0x3')]])){utils[_0x4a42('0x11')](util[_0x4a42('0x2')]('[%s][queues][musiconholdstart]',_0x102802[_0x4a42('0x3')]),_0x102802);queues[_0x102802[_0x4a42('0x3')]][_0x4a42('0x62')]=utils['now']();utils[_0x4a42('0x1')](util[_0x4a42('0x2')](_0x4a42('0x63'),_0x102802[_0x4a42('0x3')],queues[_0x102802['uniqueid']][_0x4a42('0x20')],queues[_0x102802['uniqueid']]['musiconholdstartAt']));}}catch(_0x113622){utils[_0x4a42('0x16')](util[_0x4a42('0x2')](_0x4a42('0x64'),_0x102802[_0x4a42('0x3')]),_0x113622);}};exports[_0x4a42('0x65')]=function(_0x3801bb){try{if(!_[_0x4a42('0x24')](queues[_0x3801bb[_0x4a42('0x3')]])){if(!_[_0x4a42('0x24')](queues[_0x3801bb['uniqueid']][_0x4a42('0x62')])){utils[_0x4a42('0x11')](util[_0x4a42('0x2')](_0x4a42('0x66'),_0x3801bb[_0x4a42('0x3')]),_0x3801bb);queues[_0x3801bb['uniqueid']]['mohtime']+=utils[_0x4a42('0x34')](utils[_0x4a42('0x15')](),queues[_0x3801bb['uniqueid']][_0x4a42('0x62')]);utils[_0x4a42('0x1')](util[_0x4a42('0x2')](_0x4a42('0x67'),_0x3801bb[_0x4a42('0x3')],queues[_0x3801bb['uniqueid']]['name'],queues[_0x3801bb[_0x4a42('0x3')]][_0x4a42('0x59')]));delete queues[_0x3801bb[_0x4a42('0x3')]][_0x4a42('0x62')];}}}catch(_0x1b0690){utils[_0x4a42('0x16')](util[_0x4a42('0x2')]('[%s][queues][musiconholdstop]',_0x3801bb['uniqueid']),_0x1b0690);}}; \ No newline at end of file +var _0x91e7=['[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]','lodash','util','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','now','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','CONTINUE','queuecallerexitAt','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','[%s][queues][queuecallerabandon]','queuecallerabandonAt','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','queuecallerleave','holdtime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]'];(function(_0x36722f,_0x102b9b){var _0x488582=function(_0x2aad33){while(--_0x2aad33){_0x36722f['push'](_0x36722f['shift']());}};_0x488582(++_0x102b9b);}(_0x91e7,0xff));var _0x791e=function(_0x50a004,_0x193d84){_0x50a004=_0x50a004-0x0;var _0x5e9992=_0x91e7[_0x50a004];return _0x5e9992;};'use strict';var _=require(_0x791e('0x0'));var util=require(_0x791e('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x35d88b){utils[_0x791e('0x2')](util[_0x791e('0x3')](_0x791e('0x4'),_0x35d88b[_0x791e('0x5')],_0x35d88b[_0x791e('0x6')],_0x35d88b[_0x791e('0x7')],_0x35d88b[_0x791e('0x8')],_0x35d88b[_0x791e('0x9')],_0x35d88b[_0x791e('0xa')],_0x35d88b[_0x791e('0xb')]));if(_0x35d88b['queue']){utils[_0x791e('0xc')](_0x35d88b[_0x791e('0x7')])[_0x791e('0xd')](function(_0x57e594){if(_0x57e594){_0x35d88b[_0x791e('0xe')]=_0x57e594['type'];}utils[_0x791e('0xf')](_0x791e('0x10'),_0x35d88b);});}else{utils[_0x791e('0xf')](_0x791e('0x10'),_0x35d88b);}if(_0x35d88b[_0x791e('0x11')]){delete queues[_0x35d88b[_0x791e('0x11')]];}else{delete queues[_0x35d88b[_0x791e('0x5')]];}}exports['queuecallerjoin']=function(_0x21f7a8){try{utils[_0x791e('0x12')](util['format'](_0x791e('0x13'),_0x21f7a8[_0x791e('0x5')]),_0x21f7a8);utils['info'](util[_0x791e('0x3')](_0x791e('0x14'),_0x21f7a8[_0x791e('0x5')],_0x21f7a8[_0x791e('0x7')],_0x21f7a8['position']));queues[_0x21f7a8[_0x791e('0x5')]]=_['assign'](_0x21f7a8,{'originalposition':_0x21f7a8[_0x791e('0x15')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x5ed8f9){utils[_0x791e('0x16')](util[_0x791e('0x3')](_0x791e('0x13'),_0x21f7a8[_0x791e('0x5')]),_0x5ed8f9);}};exports[_0x791e('0x17')]=function(_0x1162bd){try{if(!_[_0x791e('0x18')](queues[_0x1162bd[_0x791e('0x5')]])){utils[_0x791e('0x12')](util[_0x791e('0x3')](_0x791e('0x19'),_0x1162bd[_0x791e('0x5')]),_0x1162bd);if(queues[_0x1162bd['uniqueid']][_0x791e('0x1a')]){if(!queues[_0x1162bd[_0x791e('0x5')]][_0x791e('0x1b')]&&!queues[_0x1162bd[_0x791e('0x5')]][_0x791e('0x1c')]){queues[_0x1162bd[_0x791e('0x5')]][_0x791e('0x1d')]=!![];queues[_0x1162bd[_0x791e('0x5')]][_0x791e('0x1e')]=utils[_0x791e('0x1f')]();queues[_0x1162bd[_0x791e('0x5')]][_0x791e('0xb')]=_0x791e('0x20');}utils['info'](util[_0x791e('0x3')](_0x791e('0x21'),_0x1162bd[_0x791e('0x5')],queues[_0x1162bd['uniqueid']][_0x791e('0x22')],queues[_0x1162bd['uniqueid']][_0x791e('0xb')]));writeDB(queues[_0x1162bd['uniqueid']]);}else if(queues[_0x1162bd[_0x791e('0x5')]][_0x791e('0x11')]){utils['info'](util[_0x791e('0x3')](_0x791e('0x23'),_0x1162bd['uniqueid'],queues[_0x1162bd[_0x791e('0x5')]]['name'],queues[_0x1162bd[_0x791e('0x5')]][_0x791e('0x11')]));queues[queues[_0x1162bd[_0x791e('0x5')]][_0x791e('0x11')]]=queues[_0x1162bd[_0x791e('0x5')]];queues[queues[_0x1162bd[_0x791e('0x5')]][_0x791e('0x11')]][_0x791e('0x24')]=0x2;delete queues[_0x1162bd[_0x791e('0x5')]];}}}catch(_0x3a8a39){utils[_0x791e('0x16')](util[_0x791e('0x3')]('[%s][queues][hangup]',_0x1162bd[_0x791e('0x5')]),_0x3a8a39);}};exports[_0x791e('0x25')]=function(_0x401614){try{utils['debug'](util['format'](_0x791e('0x26'),_0x401614[_0x791e('0x5')]),_0x401614);if(!_['isNil'](_0x401614[_0x791e('0x27')][_0x791e('0x28')])&&_0x401614[_0x791e('0x29')]['toUpperCase']()!==_0x791e('0x2a')){if(!_['isNil'](queues[_0x401614['uniqueid']])){queues[_0x401614['uniqueid']][_0x791e('0x1b')]=![];queues[_0x401614[_0x791e('0x5')]]['queuecallerabandonAt']=null;queues[_0x401614[_0x791e('0x5')]][_0x791e('0x1c')]=!![];queues[_0x401614[_0x791e('0x5')]][_0x791e('0x2b')]=utils['now']();queues[_0x401614['uniqueid']][_0x791e('0xb')]=_0x401614[_0x791e('0x29')][_0x791e('0x2c')]();utils['info'](util[_0x791e('0x3')](_0x791e('0x2d'),_0x401614[_0x791e('0x5')],queues[_0x401614[_0x791e('0x5')]]['name'],_0x401614['value'],queues[_0x401614[_0x791e('0x5')]][_0x791e('0xb')]));writeDB(queues[_0x401614[_0x791e('0x5')]]);}}else if(!_[_0x791e('0x18')](_0x401614['variable'][_0x791e('0x2e')])){if(!_[_0x791e('0x18')](queues[_0x401614['uniqueid']])&&!queues[_0x401614[_0x791e('0x5')]][_0x791e('0x1b')]){queues[_0x401614[_0x791e('0x5')]][_0x791e('0x1b')]=![];queues[_0x401614[_0x791e('0x5')]]['queuecallerabandonAt']=null;queues[_0x401614['uniqueid']][_0x791e('0x1c')]=!![];queues[_0x401614['uniqueid']][_0x791e('0x2b')]=utils[_0x791e('0x1f')]();queues[_0x401614[_0x791e('0x5')]][_0x791e('0xb')]='EXITWITHKEY';utils[_0x791e('0x2')](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x401614[_0x791e('0x5')],queues[_0x401614['uniqueid']]['name'],_0x401614['value'],queues[_0x401614[_0x791e('0x5')]][_0x791e('0xb')]));}}}catch(_0x24f273){utils[_0x791e('0x16')](util[_0x791e('0x3')](_0x791e('0x26'),_0x401614[_0x791e('0x5')]),_0x24f273);}};exports[_0x791e('0x1b')]=function(_0x136a4f){try{if(!_[_0x791e('0x18')](queues[_0x136a4f[_0x791e('0x5')]])){utils[_0x791e('0x12')](util[_0x791e('0x3')](_0x791e('0x2f'),_0x136a4f['uniqueid']),_0x136a4f);queues[_0x136a4f[_0x791e('0x5')]][_0x791e('0x1c')]=![];queues[_0x136a4f['uniqueid']]['queuecallerexitAt']=null;queues[_0x136a4f[_0x791e('0x5')]][_0x791e('0x1b')]=!![];queues[_0x136a4f[_0x791e('0x5')]][_0x791e('0x30')]=utils[_0x791e('0x1f')]();queues[_0x136a4f[_0x791e('0x5')]]['queuecallerexitreason']=_0x791e('0x31');utils[_0x791e('0x2')](util[_0x791e('0x3')](_0x791e('0x32'),_0x136a4f[_0x791e('0x5')],queues[_0x136a4f[_0x791e('0x5')]][_0x791e('0x22')],queues[_0x136a4f[_0x791e('0x5')]][_0x791e('0xb')]));}}catch(_0x1b4dfd){utils[_0x791e('0x16')](util[_0x791e('0x3')](_0x791e('0x2f'),_0x136a4f[_0x791e('0x5')]),_0x1b4dfd);}};exports['queuecallerleave']=function(_0xff3d7c){try{if(!_[_0x791e('0x18')](queues[_0xff3d7c['uniqueid']])){utils['debug'](util[_0x791e('0x3')](_0x791e('0x33'),_0xff3d7c[_0x791e('0x5')]),_0xff3d7c);utils[_0x791e('0x2')](util[_0x791e('0x3')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0xff3d7c[_0x791e('0x5')],queues[_0xff3d7c[_0x791e('0x5')]][_0x791e('0x22')],_0xff3d7c[_0x791e('0x34')],_0xff3d7c[_0x791e('0x35')]));queues[_0xff3d7c[_0x791e('0x5')]][_0x791e('0x36')]=!![];queues[_0xff3d7c[_0x791e('0x5')]]['queuecallerleaveAt']=utils['now']();queues[_0xff3d7c['uniqueid']][_0x791e('0x37')]=utils['diffTime'](queues[_0xff3d7c[_0x791e('0x5')]][_0x791e('0x1a')],queues[_0xff3d7c[_0x791e('0x5')]][_0x791e('0x38')]);queues[_0xff3d7c['uniqueid']][_0x791e('0x15')]=_0xff3d7c[_0x791e('0x15')];queues[_0xff3d7c[_0x791e('0x5')]][_0x791e('0x39')]=_0xff3d7c['count'];queues[_0xff3d7c['uniqueid']][_0x791e('0x34')]=_0xff3d7c[_0x791e('0x34')];queues[_0xff3d7c[_0x791e('0x5')]][_0x791e('0x35')]=_0xff3d7c[_0x791e('0x35')];}}catch(_0x4b68f6){utils[_0x791e('0x16')](util['format'](_0x791e('0x33'),_0xff3d7c[_0x791e('0x5')]),_0x4b68f6);}};exports[_0x791e('0x3a')]=function(_0x9ece5d){try{if(!_[_0x791e('0x18')](queues[_0x9ece5d[_0x791e('0x5')]])){utils[_0x791e('0x12')](util[_0x791e('0x3')](_0x791e('0x3b'),_0x9ece5d['uniqueid']),_0x9ece5d);utils['info'](util[_0x791e('0x3')](_0x791e('0x3c'),_0x9ece5d[_0x791e('0x5')],queues[_0x9ece5d['uniqueid']]['name'],_0x9ece5d[_0x791e('0x3d')],_0x9ece5d[_0x791e('0x3e')]));queues[_0x9ece5d['uniqueid']][_0x791e('0x1b')]=![];queues[_0x9ece5d['uniqueid']]['queuecallerabandon']=![];queues[_0x9ece5d['uniqueid']][_0x791e('0x30')]=null;queues[_0x9ece5d['uniqueid']][_0x791e('0x1c')]=![];queues[_0x9ece5d[_0x791e('0x5')]]['queuecallerexitreason']=null;queues[_0x9ece5d['uniqueid']][_0x791e('0x2b')]=null;queues[_0x9ece5d[_0x791e('0x5')]][_0x791e('0x3f')]=!![];queues[_0x9ece5d[_0x791e('0x5')]][_0x791e('0xa')]=_0x9ece5d['destaccountcode'];queues[_0x9ece5d['uniqueid']][_0x791e('0x8')]=_0x9ece5d['membername'];}}catch(_0x579d87){utils['error'](util['format']('[%s][queues][agentconnect]',_0x9ece5d[_0x791e('0x5')]),_0x579d87);}};exports[_0x791e('0x40')]=function(_0x2452c5){try{if(!_[_0x791e('0x18')](queues[_0x2452c5[_0x791e('0x5')]])){if(queues[_0x2452c5[_0x791e('0x5')]]['queuecallerleaveAt']){utils[_0x791e('0x12')](util[_0x791e('0x3')]('[%s][queues][agentcomplete]',_0x2452c5[_0x791e('0x5')]),_0x2452c5);queues[_0x2452c5['uniqueid']][_0x791e('0x1b')]=![];queues[_0x2452c5['uniqueid']]['queuecallerabandon']=![];queues[_0x2452c5[_0x791e('0x5')]][_0x791e('0x30')]=null;queues[_0x2452c5[_0x791e('0x5')]][_0x791e('0x1c')]=![];queues[_0x2452c5[_0x791e('0x5')]][_0x791e('0x2b')]=null;queues[_0x2452c5[_0x791e('0x5')]][_0x791e('0x3f')]=!![];queues[_0x2452c5[_0x791e('0x5')]][_0x791e('0x8')]=_0x2452c5[_0x791e('0x3d')];queues[_0x2452c5[_0x791e('0x5')]][_0x791e('0x1d')]=!![];queues[_0x2452c5[_0x791e('0x5')]][_0x791e('0x1e')]=utils[_0x791e('0x1f')]();if(_0x2452c5[_0x791e('0x41')]==_0x791e('0x42')){if(!queues[_0x2452c5[_0x791e('0x5')]][_0x791e('0x42')]){queues[_0x2452c5[_0x791e('0x5')]][_0x791e('0xb')]=_0x791e('0x43');}}else{queues[_0x2452c5[_0x791e('0x5')]][_0x791e('0xb')]=_0x791e('0x44')+_0x2452c5[_0x791e('0x41')][_0x791e('0x2c')]();}utils['info'](util[_0x791e('0x3')](_0x791e('0x45'),_0x2452c5[_0x791e('0x5')],queues[_0x2452c5['uniqueid']]['name'],_0x2452c5[_0x791e('0x3d')],queues[_0x2452c5[_0x791e('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x2452c5[_0x791e('0x5')]]);}}}catch(_0x1d9e47){utils[_0x791e('0x16')](util['format'](_0x791e('0x46'),_0x2452c5[_0x791e('0x5')]),_0x1d9e47);}};exports['blindtransfer']=function(_0x30c5ae){try{if(!_[_0x791e('0x18')](queues[_0x30c5ae[_0x791e('0x47')]])){utils['debug'](util[_0x791e('0x3')]('[%s][queues][blindtransfer]',_0x30c5ae[_0x791e('0x5')]),_0x30c5ae);queues[_0x30c5ae[_0x791e('0x47')]][_0x791e('0x42')]=!![];queues[_0x30c5ae[_0x791e('0x47')]][_0x791e('0x48')]=_0x791e('0x49');queues[_0x30c5ae[_0x791e('0x47')]][_0x791e('0x4a')]=_0x30c5ae[_0x791e('0x4b')];queues[_0x30c5ae[_0x791e('0x47')]][_0x791e('0x4c')]=_0x30c5ae['transfereeuniqueid'];queues[_0x30c5ae[_0x791e('0x47')]][_0x791e('0xb')]=_0x791e('0x4d');utils['info'](util['format'](_0x791e('0x4e'),_0x30c5ae['uniqueid'],queues[_0x30c5ae[_0x791e('0x47')]][_0x791e('0x22')],_0x30c5ae[_0x791e('0x47')],_0x30c5ae[_0x791e('0x4b')]));}}catch(_0xad1cd1){utils['error'](util['format'](_0x791e('0x4f'),_0x30c5ae[_0x791e('0x5')]),_0xad1cd1);}};exports[_0x791e('0x50')]=function(_0x3e3d0f){try{utils['debug'](util[_0x791e('0x3')](_0x791e('0x51'),_0x3e3d0f['origtransfereruniqueid']),_0x3e3d0f);if(_0x3e3d0f[_0x791e('0x52')]==_0x3e3d0f[_0x791e('0x53')]){if(!_[_0x791e('0x18')](queues[_0x3e3d0f[_0x791e('0x54')]])){utils[_0x791e('0x2')](util[_0x791e('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x3e3d0f[_0x791e('0x52')],queues[_0x3e3d0f['secondtransfererlinkedid']]['name'],_0x3e3d0f[_0x791e('0x55')]));queues[_0x3e3d0f[_0x791e('0x54')]][_0x791e('0x42')]=!![];queues[_0x3e3d0f[_0x791e('0x54')]][_0x791e('0x48')]=_0x791e('0x56');queues[_0x3e3d0f['secondtransfererlinkedid']][_0x791e('0x4a')]=_0x3e3d0f[_0x791e('0x55')];queues[_0x3e3d0f[_0x791e('0x54')]][_0x791e('0x4c')]=_0x3e3d0f[_0x791e('0x52')];queues[_0x3e3d0f[_0x791e('0x54')]][_0x791e('0xb')]=_0x791e('0x57');}if(!_[_0x791e('0x18')](queues[_0x3e3d0f[_0x791e('0x53')]])){if(_0x3e3d0f['transfereelinkedid']&&queues[_0x3e3d0f[_0x791e('0x58')]]){queues[_0x3e3d0f[_0x791e('0x58')]][_0x791e('0x24')]=0x1;queues[_0x3e3d0f[_0x791e('0x47')]]=_[_0x791e('0x59')](queues[_0x3e3d0f[_0x791e('0x58')]]);queues[_0x3e3d0f['transfereeuniqueid']][_0x791e('0x11')]=_0x3e3d0f[_0x791e('0x5a')];queues[_0x3e3d0f['transfereeuniqueid']]['queuecallerenterreason']=0x2;queues[_0x3e3d0f['transfereeuniqueid']][_0x791e('0x9')]=queues[_0x3e3d0f[_0x791e('0x54')]][_0x791e('0x9')];queues[_0x3e3d0f['transfereeuniqueid']][_0x791e('0x5b')]=queues[_0x3e3d0f[_0x791e('0x54')]][_0x791e('0x5b')];queues[_0x3e3d0f[_0x791e('0x47')]][_0x791e('0x38')]=utils[_0x791e('0x1f')]();queues[_0x3e3d0f[_0x791e('0x47')]]['queuecallerleaveAt']=utils[_0x791e('0x1f')]();queues[_0x3e3d0f[_0x791e('0x47')]][_0x791e('0x37')]=0x0;queues[_0x3e3d0f[_0x791e('0x47')]]['mohtime']=0x0;utils[_0x791e('0x2')](util[_0x791e('0x3')](_0x791e('0x5c'),_0x3e3d0f[_0x791e('0x52')],queues[_0x3e3d0f[_0x791e('0x47')]][_0x791e('0x22')],queues[_0x3e3d0f[_0x791e('0x47')]][_0x791e('0x9')],queues[_0x3e3d0f[_0x791e('0x47')]]['calleridname']));}else{utils[_0x791e('0x2')](util[_0x791e('0x3')](_0x791e('0x5d'),_0x3e3d0f['origtransfereruniqueid'],queues[_0x3e3d0f[_0x791e('0x53')]]['name'],_0x3e3d0f[_0x791e('0x54')]));queues[_0x3e3d0f[_0x791e('0x53')]]['transfereduniqueid']=_0x3e3d0f['secondtransfererlinkedid'];}}}else if(_0x3e3d0f[_0x791e('0x5e')]==_0x3e3d0f[_0x791e('0x54')]){if(!_[_0x791e('0x18')](queues[_0x3e3d0f[_0x791e('0x53')]])){utils[_0x791e('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x3e3d0f[_0x791e('0x52')],queues[_0x3e3d0f['origtransfererlinkedid']][_0x791e('0x22')],_0x3e3d0f[_0x791e('0x5e')],_0x3e3d0f[_0x791e('0x5f')]));queues[_0x3e3d0f[_0x791e('0x53')]][_0x791e('0x42')]=!![];queues[_0x3e3d0f[_0x791e('0x53')]][_0x791e('0x48')]=_0x791e('0x56');queues[_0x3e3d0f[_0x791e('0x53')]][_0x791e('0x4a')]=_0x3e3d0f[_0x791e('0x5f')];queues[_0x3e3d0f[_0x791e('0x53')]]['transferuniqueid']=_0x3e3d0f[_0x791e('0x5e')];queues[_0x3e3d0f[_0x791e('0x53')]]['queuecallerexitreason']=_0x791e('0x57');}if(!_['isNil'](queues[_0x3e3d0f[_0x791e('0x54')]])){if(_0x3e3d0f[_0x791e('0x60')]&&queues[_0x3e3d0f['transfertargetlinkedid']]){queues[_0x3e3d0f['transfertargetlinkedid']][_0x791e('0x24')]=0x1;queues[_0x3e3d0f[_0x791e('0x5a')]]=_[_0x791e('0x59')](queues[_0x3e3d0f[_0x791e('0x60')]]);queues[_0x3e3d0f[_0x791e('0x5a')]][_0x791e('0x11')]=_0x3e3d0f[_0x791e('0x5a')];queues[_0x3e3d0f[_0x791e('0x5a')]][_0x791e('0x24')]=0x2;queues[_0x3e3d0f[_0x791e('0x5a')]][_0x791e('0x9')]=queues[_0x3e3d0f['origtransfererlinkedid']][_0x791e('0x9')];queues[_0x3e3d0f[_0x791e('0x5a')]][_0x791e('0x5b')]=queues[_0x3e3d0f[_0x791e('0x53')]][_0x791e('0x5b')];queues[_0x3e3d0f[_0x791e('0x5a')]][_0x791e('0x38')]=utils['now']();queues[_0x3e3d0f[_0x791e('0x5a')]]['queuecallerleaveAt']=utils[_0x791e('0x1f')]();queues[_0x3e3d0f[_0x791e('0x5a')]][_0x791e('0x37')]=0x0;queues[_0x3e3d0f[_0x791e('0x5a')]][_0x791e('0x61')]=0x0;utils[_0x791e('0x2')](util[_0x791e('0x3')](_0x791e('0x62'),_0x3e3d0f[_0x791e('0x52')],queues[_0x3e3d0f[_0x791e('0x5a')]][_0x791e('0x22')],queues[_0x3e3d0f[_0x791e('0x5a')]][_0x791e('0x11')],queues[_0x3e3d0f[_0x791e('0x5a')]][_0x791e('0x9')],queues[_0x3e3d0f['transfertargetuniqueid']][_0x791e('0x5b')]));}else{utils[_0x791e('0x2')](util[_0x791e('0x3')](_0x791e('0x5d'),_0x3e3d0f['origtransfereruniqueid'],queues[_0x3e3d0f[_0x791e('0x54')]]['name'],_0x3e3d0f[_0x791e('0x53')]));queues[_0x3e3d0f[_0x791e('0x54')]][_0x791e('0x11')]=_0x3e3d0f[_0x791e('0x53')];}}}}catch(_0x43e42d){utils[_0x791e('0x16')](util[_0x791e('0x3')](_0x791e('0x51'),_0x3e3d0f[_0x791e('0x52')]),_0x43e42d);}};exports[_0x791e('0x63')]=function(_0x124098){try{if(!_[_0x791e('0x18')](queues[_0x124098[_0x791e('0x5')]])){utils[_0x791e('0x12')](util[_0x791e('0x3')]('[%s][queues][musiconholdstart]',_0x124098[_0x791e('0x5')]),_0x124098);queues[_0x124098[_0x791e('0x5')]][_0x791e('0x64')]=utils[_0x791e('0x1f')]();utils[_0x791e('0x2')](util[_0x791e('0x3')](_0x791e('0x65'),_0x124098[_0x791e('0x5')],queues[_0x124098[_0x791e('0x5')]][_0x791e('0x22')],queues[_0x124098[_0x791e('0x5')]][_0x791e('0x64')]));}}catch(_0x275939){utils['error'](util[_0x791e('0x3')](_0x791e('0x66'),_0x124098[_0x791e('0x5')]),_0x275939);}};exports[_0x791e('0x67')]=function(_0x3a8bde){try{if(!_['isNil'](queues[_0x3a8bde[_0x791e('0x5')]])){if(!_[_0x791e('0x18')](queues[_0x3a8bde[_0x791e('0x5')]][_0x791e('0x64')])){utils[_0x791e('0x12')](util[_0x791e('0x3')](_0x791e('0x68'),_0x3a8bde['uniqueid']),_0x3a8bde);queues[_0x3a8bde[_0x791e('0x5')]][_0x791e('0x61')]+=utils['diffTime'](utils['now'](),queues[_0x3a8bde[_0x791e('0x5')]][_0x791e('0x64')]);utils[_0x791e('0x2')](util[_0x791e('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x3a8bde['uniqueid'],queues[_0x3a8bde[_0x791e('0x5')]][_0x791e('0x22')],queues[_0x3a8bde['uniqueid']][_0x791e('0x61')]));delete queues[_0x3a8bde[_0x791e('0x5')]][_0x791e('0x64')];}}}catch(_0x4de41e){utils[_0x791e('0x16')](util[_0x791e('0x3')](_0x791e('0x68'),_0x3a8bde[_0x791e('0x5')]),_0x4de41e);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 6717bbe..ff12df4 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 _0x0263=['accountcode','getUserByInternal','then','membername','name','UserId','request','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','channel','newstate','[%s][recordings][newstate]','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt','connectedlinename','type','connectedlinenum','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereruniqueid','recording','util','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid'];(function(_0x377121,_0x455372){var _0x125ad7=function(_0x5adf23){while(--_0x5adf23){_0x377121['push'](_0x377121['shift']());}};_0x125ad7(++_0x455372);}(_0x0263,0xcc));var _0x3026=function(_0x549108,_0x316000){_0x549108=_0x549108-0x0;var _0x24b3a8=_0x0263[_0x549108];return _0x24b3a8;};'use strict';var _=require('lodash');var util=require(_0x3026('0x0'));var utils=require(_0x3026('0x1'));var transfers=require(_0x3026('0x2'));var recordings={};function writeDB(_0x389809){var _0x34a1ac;utils[_0x3026('0x3')](util[_0x3026('0x4')](_0x3026('0x5'),_0x389809[_0x3026('0x6')]));if(transfers[_0x3026('0x7')][_0x389809[_0x3026('0x6')]]){_0x34a1ac=_0x389809[_0x3026('0x6')];_0x389809[_0x3026('0x6')]=transfers[_0x3026('0x7')][_0x389809[_0x3026('0x6')]][_0x3026('0x8')];}if(_0x389809[_0x3026('0x9')]){utils[_0x3026('0xa')](_0x389809['accountcode'])[_0x3026('0xb')](function(_0x193cdc){if(_0x193cdc){_0x389809[_0x3026('0xc')]=_0x193cdc[_0x3026('0xd')];_0x389809[_0x3026('0xe')]=_0x193cdc['id'];}utils[_0x3026('0xf')]('CreateVoiceRecording',_0x389809);});}else{utils['request']('CreateVoiceRecording',_0x389809);}if(_0x34a1ac)delete transfers[_0x3026('0x7')][_0x34a1ac];}exports[_0x3026('0x10')]=function(_0x3ceff8){try{utils[_0x3026('0x11')](util[_0x3026('0x4')](_0x3026('0x12'),_0x3ceff8['uniqueid']),_0x3ceff8);if(_0x3ceff8[_0x3026('0x6')]==_0x3ceff8[_0x3026('0x13')]){utils['info'](util['format'](_0x3026('0x14'),_0x3ceff8[_0x3026('0x6')],_0x3ceff8[_0x3026('0x15')],_0x3ceff8['exten']));recordings[_0x3ceff8[_0x3026('0x6')]]={'uniqueid':_0x3ceff8[_0x3026('0x6')],'accountcode':_0x3ceff8['accountcode'],'exten':_0x3ceff8['exten'],'context':_0x3ceff8[_0x3026('0x15')],'channel':_0x3ceff8[_0x3026('0x16')],'monitors':[]};}}catch(_0x55f887){utils['error'](util[_0x3026('0x4')](_0x3026('0x12'),_0x3ceff8[_0x3026('0x6')]),_0x55f887);}};exports[_0x3026('0x17')]=function(_0x3b87dd){try{utils[_0x3026('0x11')](util[_0x3026('0x4')](_0x3026('0x18'),_0x3b87dd['uniqueid']),_0x3b87dd);if(!_['isNil'](recordings[_0x3b87dd['uniqueid']])&&_0x3b87dd[_0x3026('0x19')]==0x6){utils[_0x3026('0x3')](util[_0x3026('0x4')](_0x3026('0x1a'),_0x3b87dd[_0x3026('0x6')],_0x3b87dd['context'],_0x3b87dd[_0x3026('0x16')]));}else if(!_[_0x3026('0x1b')](recordings[_0x3b87dd['linkedid']])&&_0x3b87dd[_0x3026('0x19')]==0x6&&_0x3b87dd['context']!=_0x3026('0x1c')){utils[_0x3026('0x3')](util[_0x3026('0x4')](_0x3026('0x1d'),_0x3b87dd[_0x3026('0x6')],_0x3b87dd[_0x3026('0x13')],_0x3b87dd[_0x3026('0x15')],_0x3b87dd['channel']));recordings[_0x3b87dd[_0x3026('0x13')]]['accountcode']=_0x3b87dd[_0x3026('0x9')];}}catch(_0x329c4d){utils[_0x3026('0x1e')](util[_0x3026('0x4')](_0x3026('0x18'),_0x3b87dd[_0x3026('0x6')]),_0x329c4d);}};exports['varset']=function(_0x58eb68){try{if(!_['isNil'](_0x58eb68[_0x3026('0x1f')])&&!_[_0x3026('0x1b')](_0x58eb68['variable'][_0x3026('0x20')])){utils[_0x3026('0x11')](util[_0x3026('0x4')](_0x3026('0x21'),_0x58eb68['uniqueid']),_0x58eb68);utils[_0x3026('0x3')](util['format'](_0x3026('0x22'),_0x58eb68[_0x3026('0x6')],_0x58eb68['variable'],_0x58eb68['value']));if(_['endsWith'](_0x58eb68[_0x3026('0x23')],_0x3026('0x24'))){_0x58eb68[_0x3026('0x23')]=_0x58eb68[_0x3026('0x23')]['replace'](_0x3026('0x24'),_0x3026('0x25'));}if(recordings[_0x58eb68[_0x3026('0x13')]]){var _0x126273=_[_0x3026('0x26')](recordings[_0x58eb68['linkedid']]['monitors'],{'value':_0x58eb68[_0x3026('0x23')]});if(_[_0x3026('0x1b')](_0x126273)){recordings[_0x58eb68[_0x3026('0x13')]][_0x3026('0x27')][_0x3026('0x28')]({'value':_0x58eb68['value']});}}}}catch(_0x33c7b4){utils[_0x3026('0x1e')](util[_0x3026('0x4')](_0x3026('0x21'),_0x58eb68['uniqueid']),_0x33c7b4);}};exports[_0x3026('0x29')]=function(_0x2ea59b){try{if(!_['isNil'](recordings[_0x2ea59b[_0x3026('0x6')]])){utils['debug'](util[_0x3026('0x4')](_0x3026('0x2a'),_0x2ea59b['uniqueid']),_0x2ea59b);utils[_0x3026('0x3')](util[_0x3026('0x4')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x2ea59b[_0x3026('0x6')],_0x2ea59b[_0x3026('0x2b')],_0x2ea59b[_0x3026('0x2c')],_0x2ea59b[_0x3026('0x2d')]));recordings[_0x2ea59b[_0x3026('0x6')]][_0x3026('0x2b')]=_0x2ea59b[_0x3026('0x2b')];recordings[_0x2ea59b['uniqueid']][_0x3026('0x2c')]=_0x2ea59b['calleridname'];recordings[_0x2ea59b['uniqueid']]['connectedlinenum']=_0x2ea59b['connectedlinenum'];recordings[_0x2ea59b[_0x3026('0x6')]][_0x3026('0x2e')]=_0x2ea59b[_0x3026('0x2e')];if(recordings[_0x2ea59b[_0x3026('0x6')]][_0x3026('0x2f')]=='outbound'&&recordings[_0x2ea59b[_0x3026('0x6')]][_0x3026('0x9')]){recordings[_0x2ea59b[_0x3026('0x6')]][_0x3026('0x30')]=recordings[_0x2ea59b[_0x3026('0x6')]][_0x3026('0x9')];recordings[_0x2ea59b['uniqueid']][_0x3026('0x2e')]='';}recordings[_0x2ea59b[_0x3026('0x6')]][_0x3026('0x27')]['forEach'](function(_0x2768e5){var _0x1a59c5=_[_0x3026('0x31')](recordings[_0x2ea59b['uniqueid']]);_0x1a59c5[_0x3026('0x23')]=_0x2768e5[_0x3026('0x23')];writeDB(_0x1a59c5);});delete recordings[_0x2ea59b['uniqueid']];}}catch(_0x29cb43){utils[_0x3026('0x1e')](util[_0x3026('0x4')](_0x3026('0x2a'),_0x2ea59b[_0x3026('0x6')]),_0x29cb43);}};exports[_0x3026('0x32')]=function(_0x42f481){try{if(!_['isNil'](recordings[_0x42f481['uniqueid']])){utils['debug'](util['format'](_0x3026('0x33'),_0x42f481[_0x3026('0x6')]),_0x42f481);utils[_0x3026('0x3')](util[_0x3026('0x4')](_0x3026('0x34'),_0x42f481['uniqueid'],_0x42f481[_0x3026('0x35')],_0x42f481[_0x3026('0x36')]));if(_0x42f481[_0x3026('0x35')][_0x3026('0x37')]()==_0x3026('0x38')&&_[_0x3026('0x39')](_0x42f481[_0x3026('0x36')]['toLowerCase'](),_0x3026('0x3a'))){var _0x1fe138=_0x42f481[_0x3026('0x36')][_0x3026('0x3b')]('=');var _0x30dc21=_0x1fe138[0x0]['substring'](_0x1fe138[0x0][_0x3026('0x3c')]('(')+0x1,_0x1fe138[0x0]['lastIndexOf'](')'));var _0x41cd9f=_0x1fe138[0x1];recordings[_0x42f481['uniqueid']][_0x30dc21]=_0x41cd9f;}}}catch(_0x32eb73){utils[_0x3026('0x1e')](util[_0x3026('0x4')](_0x3026('0x33'),_0x42f481[_0x3026('0x6')]),_0x32eb73);}};exports[_0x3026('0x3d')]=function(_0x264849){try{if(!_[_0x3026('0x1b')](recordings[_0x264849[_0x3026('0x6')]])){utils['debug'](util[_0x3026('0x4')](_0x3026('0x3e'),_0x264849['uniqueid']),_0x264849);utils['info'](util[_0x3026('0x4')](_0x3026('0x3f'),_0x264849[_0x3026('0x6')],_0x264849[_0x3026('0x40')]));recordings[_0x264849[_0x3026('0x6')]]['queue']=_0x264849[_0x3026('0x40')];}}catch(_0x33b0d4){utils['error'](util['format'](_0x3026('0x3e'),_0x264849[_0x3026('0x6')]),_0x33b0d4);}};exports['blindtransfer']=function(_0x37f009){try{utils[_0x3026('0x11')](util['format'](_0x3026('0x41'),_0x37f009[_0x3026('0x6')]),_0x37f009);utils['info'](util['format'](_0x3026('0x42'),_0x37f009['uniqueid'],_0x37f009['transferercalleridnum'],_0x37f009[_0x3026('0x43')],_0x37f009[_0x3026('0x44')],_0x37f009['transfereecalleridname']));if(recordings[_0x37f009[_0x3026('0x45')]]&&transfers['blinds'][_0x37f009[_0x3026('0x45')]]){transfers[_0x3026('0x7')][_0x37f009[_0x3026('0x45')]][_0x3026('0x46')]=!![];}}catch(_0x4ee405){utils[_0x3026('0x1e')](util[_0x3026('0x4')]('[%s][recordings][blindtransfer]',_0x37f009[_0x3026('0x6')]),_0x4ee405);}}; \ No newline at end of file +var _0xa2e4=['connectedlinenum','connectedlinename','type','outbound','clone','newexten','[%s][recordings][newexten]','appdata','application','toLowerCase','set','startsWith','cdr','split','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','blindtransfer','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','blinds','newchannel','debug','format','[%s][recordings][newchannel]','linkedid','context','exten','channel','error','[%s][recordings][newstate]','channelstate','isNil','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','[%s][recordings][varset]\x20variable:%s\x20value:%s','variable','value','endsWith','replace','.wav49','.WAV','monitors','push','hangup','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xa2e4,0x1c4));var _0x4a2e=function(_0x1f69bc,_0xaffd71){_0x1f69bc=_0x1f69bc-0x0;var _0x1ac3c5=_0xa2e4[_0x1f69bc];return _0x1ac3c5;};'use strict';var _=require(_0x4a2e('0x0'));var util=require(_0x4a2e('0x1'));var utils=require(_0x4a2e('0x2'));var transfers=require(_0x4a2e('0x3'));var recordings={};function writeDB(_0x53b961){var _0x2c12c0;utils[_0x4a2e('0x4')](util['format'](_0x4a2e('0x5'),_0x53b961[_0x4a2e('0x6')]));if(transfers['blinds'][_0x53b961[_0x4a2e('0x6')]]){_0x2c12c0=_0x53b961[_0x4a2e('0x6')];_0x53b961[_0x4a2e('0x6')]=transfers['blinds'][_0x53b961[_0x4a2e('0x6')]]['transfereeuniqueid'];}if(_0x53b961[_0x4a2e('0x7')]){utils[_0x4a2e('0x8')](_0x53b961['accountcode'])[_0x4a2e('0x9')](function(_0x55a14e){if(_0x55a14e){_0x53b961[_0x4a2e('0xa')]=_0x55a14e[_0x4a2e('0xb')];_0x53b961[_0x4a2e('0xc')]=_0x55a14e['id'];}utils[_0x4a2e('0xd')](_0x4a2e('0xe'),_0x53b961);});}else{utils[_0x4a2e('0xd')]('CreateVoiceRecording',_0x53b961);}if(_0x2c12c0)delete transfers[_0x4a2e('0xf')][_0x2c12c0];}exports[_0x4a2e('0x10')]=function(_0x289a35){try{utils[_0x4a2e('0x11')](util[_0x4a2e('0x12')](_0x4a2e('0x13'),_0x289a35[_0x4a2e('0x6')]),_0x289a35);if(_0x289a35[_0x4a2e('0x6')]==_0x289a35[_0x4a2e('0x14')]){utils[_0x4a2e('0x4')](util[_0x4a2e('0x12')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x289a35[_0x4a2e('0x6')],_0x289a35[_0x4a2e('0x15')],_0x289a35[_0x4a2e('0x16')]));recordings[_0x289a35[_0x4a2e('0x6')]]={'uniqueid':_0x289a35[_0x4a2e('0x6')],'accountcode':_0x289a35[_0x4a2e('0x7')],'exten':_0x289a35['exten'],'context':_0x289a35[_0x4a2e('0x15')],'channel':_0x289a35[_0x4a2e('0x17')],'monitors':[]};}}catch(_0x5d4542){utils[_0x4a2e('0x18')](util['format'](_0x4a2e('0x13'),_0x289a35[_0x4a2e('0x6')]),_0x5d4542);}};exports['newstate']=function(_0x4cc9e8){try{utils[_0x4a2e('0x11')](util[_0x4a2e('0x12')](_0x4a2e('0x19'),_0x4cc9e8['uniqueid']),_0x4cc9e8);if(!_['isNil'](recordings[_0x4cc9e8[_0x4a2e('0x6')]])&&_0x4cc9e8[_0x4a2e('0x1a')]==0x6){utils[_0x4a2e('0x4')](util['format']('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x4cc9e8[_0x4a2e('0x6')],_0x4cc9e8[_0x4a2e('0x15')],_0x4cc9e8[_0x4a2e('0x17')]));}else if(!_[_0x4a2e('0x1b')](recordings[_0x4cc9e8[_0x4a2e('0x14')]])&&_0x4cc9e8['channelstate']==0x6&&_0x4cc9e8[_0x4a2e('0x15')]!=_0x4a2e('0x1c')){utils['info'](util[_0x4a2e('0x12')](_0x4a2e('0x1d'),_0x4cc9e8[_0x4a2e('0x6')],_0x4cc9e8[_0x4a2e('0x14')],_0x4cc9e8['context'],_0x4cc9e8[_0x4a2e('0x17')]));recordings[_0x4cc9e8[_0x4a2e('0x14')]][_0x4a2e('0x7')]=_0x4cc9e8[_0x4a2e('0x7')];}}catch(_0x23b678){utils[_0x4a2e('0x18')](util[_0x4a2e('0x12')](_0x4a2e('0x19'),_0x4cc9e8[_0x4a2e('0x6')]),_0x23b678);}};exports[_0x4a2e('0x1e')]=function(_0x376ab1){try{if(!_[_0x4a2e('0x1b')](_0x376ab1['variable'])&&!_['isNil'](_0x376ab1['variable']['mixmonitor_filename'])){utils['debug'](util[_0x4a2e('0x12')]('[%s][recordings][varset]',_0x376ab1[_0x4a2e('0x6')]),_0x376ab1);utils[_0x4a2e('0x4')](util['format'](_0x4a2e('0x1f'),_0x376ab1[_0x4a2e('0x6')],_0x376ab1[_0x4a2e('0x20')],_0x376ab1[_0x4a2e('0x21')]));if(_[_0x4a2e('0x22')](_0x376ab1[_0x4a2e('0x21')],'.wav49')){_0x376ab1[_0x4a2e('0x21')]=_0x376ab1[_0x4a2e('0x21')][_0x4a2e('0x23')](_0x4a2e('0x24'),_0x4a2e('0x25'));}if(recordings[_0x376ab1['linkedid']]){var _0x32b3be=_['find'](recordings[_0x376ab1[_0x4a2e('0x14')]]['monitors'],{'value':_0x376ab1['value']});if(_[_0x4a2e('0x1b')](_0x32b3be)){recordings[_0x376ab1[_0x4a2e('0x14')]][_0x4a2e('0x26')][_0x4a2e('0x27')]({'value':_0x376ab1[_0x4a2e('0x21')]});}}}}catch(_0x3d51ee){utils[_0x4a2e('0x18')](util[_0x4a2e('0x12')]('[%s][recordings][varset]',_0x376ab1[_0x4a2e('0x6')]),_0x3d51ee);}};exports[_0x4a2e('0x28')]=function(_0x15f480){try{if(!_[_0x4a2e('0x1b')](recordings[_0x15f480[_0x4a2e('0x6')]])){utils[_0x4a2e('0x11')](util[_0x4a2e('0x12')](_0x4a2e('0x29'),_0x15f480[_0x4a2e('0x6')]),_0x15f480);utils['info'](util[_0x4a2e('0x12')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x15f480[_0x4a2e('0x6')],_0x15f480[_0x4a2e('0x2a')],_0x15f480[_0x4a2e('0x2b')],_0x15f480[_0x4a2e('0x2c')]));recordings[_0x15f480[_0x4a2e('0x6')]][_0x4a2e('0x2a')]=_0x15f480[_0x4a2e('0x2a')];recordings[_0x15f480[_0x4a2e('0x6')]][_0x4a2e('0x2b')]=_0x15f480[_0x4a2e('0x2b')];recordings[_0x15f480[_0x4a2e('0x6')]][_0x4a2e('0x2d')]=_0x15f480[_0x4a2e('0x2d')];recordings[_0x15f480[_0x4a2e('0x6')]][_0x4a2e('0x2e')]=_0x15f480[_0x4a2e('0x2e')];if(recordings[_0x15f480[_0x4a2e('0x6')]][_0x4a2e('0x2f')]==_0x4a2e('0x30')&&recordings[_0x15f480['uniqueid']][_0x4a2e('0x7')]){recordings[_0x15f480[_0x4a2e('0x6')]][_0x4a2e('0x2d')]=recordings[_0x15f480['uniqueid']][_0x4a2e('0x7')];recordings[_0x15f480[_0x4a2e('0x6')]][_0x4a2e('0x2e')]='';}recordings[_0x15f480[_0x4a2e('0x6')]]['monitors']['forEach'](function(_0x38c6f3){var _0x2898ad=_[_0x4a2e('0x31')](recordings[_0x15f480[_0x4a2e('0x6')]]);_0x2898ad['value']=_0x38c6f3['value'];writeDB(_0x2898ad);});delete recordings[_0x15f480[_0x4a2e('0x6')]];}}catch(_0x2e42cb){utils['error'](util[_0x4a2e('0x12')]('[%s][recordings][hangup]',_0x15f480[_0x4a2e('0x6')]),_0x2e42cb);}};exports[_0x4a2e('0x32')]=function(_0x46ca4c){try{if(!_[_0x4a2e('0x1b')](recordings[_0x46ca4c[_0x4a2e('0x6')]])){utils['debug'](util['format'](_0x4a2e('0x33'),_0x46ca4c[_0x4a2e('0x6')]),_0x46ca4c);utils[_0x4a2e('0x4')](util['format']('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x46ca4c[_0x4a2e('0x6')],_0x46ca4c['application'],_0x46ca4c[_0x4a2e('0x34')]));if(_0x46ca4c[_0x4a2e('0x35')][_0x4a2e('0x36')]()==_0x4a2e('0x37')&&_[_0x4a2e('0x38')](_0x46ca4c[_0x4a2e('0x34')][_0x4a2e('0x36')](),_0x4a2e('0x39'))){var _0x224056=_0x46ca4c[_0x4a2e('0x34')][_0x4a2e('0x3a')]('=');var _0x2d0cef=_0x224056[0x0]['substring'](_0x224056[0x0][_0x4a2e('0x3b')]('(')+0x1,_0x224056[0x0][_0x4a2e('0x3b')](')'));var _0x3b82f2=_0x224056[0x1];recordings[_0x46ca4c[_0x4a2e('0x6')]][_0x2d0cef]=_0x3b82f2;}}}catch(_0x552507){utils[_0x4a2e('0x18')](util[_0x4a2e('0x12')](_0x4a2e('0x33'),_0x46ca4c[_0x4a2e('0x6')]),_0x552507);}};exports[_0x4a2e('0x3c')]=function(_0xfd640b){try{if(!_[_0x4a2e('0x1b')](recordings[_0xfd640b[_0x4a2e('0x6')]])){utils[_0x4a2e('0x11')](util[_0x4a2e('0x12')]('[%s][recordings][queuecallerjoin]',_0xfd640b[_0x4a2e('0x6')]),_0xfd640b);utils['info'](util[_0x4a2e('0x12')](_0x4a2e('0x3d'),_0xfd640b['uniqueid'],_0xfd640b[_0x4a2e('0x3e')]));recordings[_0xfd640b[_0x4a2e('0x6')]][_0x4a2e('0x3e')]=_0xfd640b[_0x4a2e('0x3e')];}}catch(_0x1ef017){utils[_0x4a2e('0x18')](util[_0x4a2e('0x12')](_0x4a2e('0x3f'),_0xfd640b[_0x4a2e('0x6')]),_0x1ef017);}};exports[_0x4a2e('0x40')]=function(_0x43914f){try{utils[_0x4a2e('0x11')](util[_0x4a2e('0x12')]('[%s][recordings][blindtransfer]',_0x43914f[_0x4a2e('0x6')]),_0x43914f);utils[_0x4a2e('0x4')](util[_0x4a2e('0x12')](_0x4a2e('0x41'),_0x43914f[_0x4a2e('0x6')],_0x43914f['transferercalleridnum'],_0x43914f[_0x4a2e('0x42')],_0x43914f[_0x4a2e('0x43')],_0x43914f[_0x4a2e('0x44')]));if(recordings[_0x43914f[_0x4a2e('0x45')]]&&transfers[_0x4a2e('0xf')][_0x43914f[_0x4a2e('0x45')]]){transfers[_0x4a2e('0xf')][_0x43914f[_0x4a2e('0x45')]][_0x4a2e('0x46')]=!![];}}catch(_0x334dfb){utils[_0x4a2e('0x18')](util[_0x4a2e('0x12')]('[%s][recordings][blindtransfer]',_0x43914f['uniqueid']),_0x334dfb);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index b6f8a66..e5a9bb8 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 _0xa2f6=['assign','origtransfererchannel','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','lodash','util','[%s][transfers][writeDB]\x20type:%s','type','attended','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','format','[%s][transfers][blindtransfer]','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname'];(function(_0x29a08d,_0x551eca){var _0x10fc1a=function(_0x4a2117){while(--_0x4a2117){_0x29a08d['push'](_0x29a08d['shift']());}};_0x10fc1a(++_0x551eca);}(_0xa2f6,0x143));var _0x6a2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa2f6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6a2f('0x0'));var util=require(_0x6a2f('0x1'));var utils=require('./utils');function writeDB(_0x49979c){utils['info'](util['format'](_0x6a2f('0x2'),_0x49979c[_0x6a2f('0x3')]===_0x6a2f('0x4')?_0x49979c['origtransfereruniqueid']:_0x49979c[_0x6a2f('0x5')],_0x49979c[_0x6a2f('0x3')]));utils[_0x6a2f('0x6')](_0x6a2f('0x7'),_0x49979c);}exports[_0x6a2f('0x8')]={};exports[_0x6a2f('0x9')]=function(_0x4d520a){try{utils['debug'](util[_0x6a2f('0xa')](_0x6a2f('0xb'),_0x4d520a[_0x6a2f('0x5')]),_0x4d520a);utils[_0x6a2f('0xc')](util['format'](_0x6a2f('0xd'),_0x4d520a[_0x6a2f('0x5')],_0x4d520a[_0x6a2f('0xe')],_0x4d520a[_0x6a2f('0xf')],_0x4d520a[_0x6a2f('0x10')],_0x4d520a[_0x6a2f('0x11')]));_0x4d520a[_0x6a2f('0x3')]=_0x6a2f('0x12');exports[_0x6a2f('0x8')][_0x4d520a[_0x6a2f('0x13')]]=_0x4d520a;writeDB(_0x4d520a);}catch(_0x22d0c3){utils[_0x6a2f('0x14')](util[_0x6a2f('0xa')]('[%s][transfers][blindtransfer]',_0x4d520a[_0x6a2f('0x5')]),_0x22d0c3);}};exports[_0x6a2f('0x15')]=function(_0x3eea49){try{utils['debug'](util[_0x6a2f('0xa')](_0x6a2f('0x16'),_0x3eea49[_0x6a2f('0x17')]),_0x3eea49);utils['info'](util[_0x6a2f('0xa')](_0x6a2f('0x18'),_0x3eea49[_0x6a2f('0x17')],_0x3eea49[_0x6a2f('0x19')],_0x3eea49[_0x6a2f('0x1a')],_0x3eea49[_0x6a2f('0x1b')],_0x3eea49[_0x6a2f('0x1c')]));_0x3eea49=_[_0x6a2f('0x1d')](_0x3eea49,{'transfererchannel':_0x3eea49[_0x6a2f('0x1e')],'transferercalleridnum':_0x3eea49[_0x6a2f('0x19')],'transferercalleridname':_0x3eea49[_0x6a2f('0x1a')],'transfererconnectedlinenum':_0x3eea49[_0x6a2f('0x1f')],'transfererconnectedlinename':_0x3eea49['secondtransfererconnectedlinename'],'transfereraccountcode':_0x3eea49[_0x6a2f('0x20')],'transferercontext':_0x3eea49[_0x6a2f('0x21')],'transfererexten':_0x3eea49['secondtransfererexten'],'transfererlinkedid':_0x3eea49[_0x6a2f('0x22')],'context':_0x3eea49[_0x6a2f('0x23')],'extension':_0x3eea49[_0x6a2f('0x24')],'type':_0x6a2f('0x4')});if(_[_0x6a2f('0x25')](_0x3eea49[_0x6a2f('0x26')])){_0x3eea49=_[_0x6a2f('0x1d')](_0x3eea49,{'transfereechannel':_0x3eea49[_0x6a2f('0x27')],'transfereecalleridnum':_0x3eea49[_0x6a2f('0x1b')],'transfereecalleridname':_0x3eea49[_0x6a2f('0x1c')],'transfereeconnectedlinenum':_0x3eea49[_0x6a2f('0x28')],'transfereeconnectedlinename':_0x3eea49['transfertargetconnectedlinename'],'transfereeaccountcode':_0x3eea49[_0x6a2f('0x29')],'transfereecontext':_0x3eea49[_0x6a2f('0x2a')],'transfereeexten':_0x3eea49['transfertargetexten'],'transfereelinkedid':_0x3eea49[_0x6a2f('0x2b')]});}writeDB(_0x3eea49);}catch(_0x2f6acc){utils[_0x6a2f('0x14')](util[_0x6a2f('0xa')](_0x6a2f('0x16'),_0x3eea49[_0x6a2f('0x17')]),_0x2f6acc);}}; \ No newline at end of file +var _0x1a6f=['[%s][transfers][writeDB]\x20type:%s','attended','origtransfereruniqueid','uniqueid','type','request','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','blind','blinds','transfereruniqueid','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','error','lodash','util','./utils','info','format'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x1a6f,0x7f));var _0xf1a6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x1a6f[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0xf1a6('0x0'));var util=require(_0xf1a6('0x1'));var utils=require(_0xf1a6('0x2'));function writeDB(_0x4d921f){utils[_0xf1a6('0x3')](util[_0xf1a6('0x4')](_0xf1a6('0x5'),_0x4d921f['type']===_0xf1a6('0x6')?_0x4d921f[_0xf1a6('0x7')]:_0x4d921f[_0xf1a6('0x8')],_0x4d921f[_0xf1a6('0x9')]));utils[_0xf1a6('0xa')](_0xf1a6('0xb'),_0x4d921f);}exports['blinds']={};exports[_0xf1a6('0xc')]=function(_0xd7d431){try{utils[_0xf1a6('0xd')](util[_0xf1a6('0x4')]('[%s][transfers][blindtransfer]',_0xd7d431['uniqueid']),_0xd7d431);utils['info'](util[_0xf1a6('0x4')](_0xf1a6('0xe'),_0xd7d431[_0xf1a6('0x8')],_0xd7d431[_0xf1a6('0xf')],_0xd7d431[_0xf1a6('0x10')],_0xd7d431['transfereecalleridnum'],_0xd7d431[_0xf1a6('0x11')]));_0xd7d431['type']=_0xf1a6('0x12');exports[_0xf1a6('0x13')][_0xd7d431[_0xf1a6('0x14')]]=_0xd7d431;writeDB(_0xd7d431);}catch(_0x457292){utils['error'](util[_0xf1a6('0x4')](_0xf1a6('0x15'),_0xd7d431[_0xf1a6('0x8')]),_0x457292);}};exports[_0xf1a6('0x16')]=function(_0x4b4eff){try{utils[_0xf1a6('0xd')](util[_0xf1a6('0x4')](_0xf1a6('0x17'),_0x4b4eff[_0xf1a6('0x7')]),_0x4b4eff);utils[_0xf1a6('0x3')](util[_0xf1a6('0x4')](_0xf1a6('0x18'),_0x4b4eff[_0xf1a6('0x7')],_0x4b4eff[_0xf1a6('0x19')],_0x4b4eff[_0xf1a6('0x1a')],_0x4b4eff[_0xf1a6('0x1b')],_0x4b4eff['transfertargetcalleridname']));_0x4b4eff=_['assign'](_0x4b4eff,{'transfererchannel':_0x4b4eff[_0xf1a6('0x1c')],'transferercalleridnum':_0x4b4eff['origtransferercalleridnum'],'transferercalleridname':_0x4b4eff[_0xf1a6('0x1a')],'transfererconnectedlinenum':_0x4b4eff[_0xf1a6('0x1d')],'transfererconnectedlinename':_0x4b4eff[_0xf1a6('0x1e')],'transfereraccountcode':_0x4b4eff[_0xf1a6('0x1f')],'transferercontext':_0x4b4eff['secondtransferercontext'],'transfererexten':_0x4b4eff[_0xf1a6('0x20')],'transfererlinkedid':_0x4b4eff[_0xf1a6('0x21')],'context':_0x4b4eff[_0xf1a6('0x22')],'extension':_0x4b4eff[_0xf1a6('0x23')],'type':_0xf1a6('0x6')});if(_[_0xf1a6('0x24')](_0x4b4eff[_0xf1a6('0x25')])){_0x4b4eff=_['assign'](_0x4b4eff,{'transfereechannel':_0x4b4eff[_0xf1a6('0x26')],'transfereecalleridnum':_0x4b4eff[_0xf1a6('0x1b')],'transfereecalleridname':_0x4b4eff[_0xf1a6('0x27')],'transfereeconnectedlinenum':_0x4b4eff['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x4b4eff['transfertargetconnectedlinename'],'transfereeaccountcode':_0x4b4eff[_0xf1a6('0x28')],'transfereecontext':_0x4b4eff[_0xf1a6('0x29')],'transfereeexten':_0x4b4eff['transfertargetexten'],'transfereelinkedid':_0x4b4eff[_0xf1a6('0x2a')]});}writeDB(_0x4b4eff);}catch(_0x37e08d){utils[_0xf1a6('0x2b')](util[_0xf1a6('0x4')](_0xf1a6('0x17'),_0x4b4eff[_0xf1a6('0x7')]),_0x37e08d);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 2947f40..e629ded 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 _0x9497=['found','notfound','catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','sumTime','now','isAfter','isBefore','jayson/promise','moment','util','client','http','xdr','info','inspect','debug','error','request','[utils][request]\x20name:%s','GetUser','name','then','[utils][getUser]\x20where:%s','stringify','length','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s'];(function(_0x6ae023,_0x15eaf3){var _0x3419d4=function(_0x2890f7){while(--_0x2890f7){_0x6ae023['push'](_0x6ae023['shift']());}};_0x3419d4(++_0x15eaf3);}(_0x9497,0x111));var _0x7949=function(_0x50666d,_0x35418d){_0x50666d=_0x50666d-0x0;var _0x19cbf2=_0x9497[_0x50666d];return _0x19cbf2;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x7949('0x0'));var moment=require(_0x7949('0x1'));var util=require(_0x7949('0x2'));var client=jayson[_0x7949('0x3')][_0x7949('0x4')]({'port':0x2329});var logger=require('../../config/logger')(_0x7949('0x5'));exports[_0x7949('0x6')]=function(_0x2cabdc,_0x2d0ab2){logger['info'](_0x2cabdc,_0x2d0ab2?util[_0x7949('0x7')](_0x2d0ab2,{'showHidden':![],'depth':null}):'');};exports[_0x7949('0x8')]=function(_0x40ea39,_0x2aa4c8){logger['debug'](_0x40ea39,_0x2aa4c8?util['inspect'](_0x2aa4c8,{'showHidden':![],'depth':null}):'');};exports[_0x7949('0x9')]=function(_0x41338e,_0x580fd5){logger[_0x7949('0x9')](_0x41338e,_0x580fd5?util[_0x7949('0x7')](_0x580fd5,{'showHidden':![],'depth':null}):'');};exports[_0x7949('0xa')]=function(_0x33c366,_0x273b43){return client[_0x7949('0xa')](_0x33c366,{'body':_0x273b43})['then'](function(_0x3d84c6){logger['debug']('[utils][request]\x20name:%s',_0x33c366,_0x3d84c6?util[_0x7949('0x7')](_0x3d84c6,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x14ca1a){logger[_0x7949('0x9')](_0x7949('0xb'),_0x33c366,_0x14ca1a?util[_0x7949('0x7')](_0x14ca1a,{'showHidden':![],'depth':null}):'');});};function getUser(_0x5ae295){return client[_0x7949('0xa')](_0x7949('0xc'),{'options':{'raw':!![],'attributes':['id','internal',_0x7949('0xd'),'interface'],'where':_0x5ae295,'limit':0x1}})[_0x7949('0xe')](function(_0x5e0bf9){logger[_0x7949('0x8')](_0x7949('0xf'),JSON[_0x7949('0x10')](_0x5ae295),_0x5e0bf9?util['inspect'](_0x5e0bf9,{'showHidden':![],'depth':null}):'');return _0x5e0bf9['result'][_0x7949('0x11')]?_0x5e0bf9[_0x7949('0x12')][0x0]:null;});}exports[_0x7949('0x13')]=function(_0x4a505a){return new BPromise(function(_0x22194,_0x3decad){if(_0x4a505a){return getUser({'internal':_0x4a505a})['then'](function(_0x17f7df){logger['info'](_0x7949('0x14'),_0x4a505a,_0x17f7df?_0x7949('0x15'):_0x7949('0x16'));return _0x22194(_0x17f7df);})[_0x7949('0x17')](function(_0x4ca553){logger[_0x7949('0x9')](_0x7949('0x18'),_0x4ca553?util[_0x7949('0x7')](_0x4ca553,{'showHidden':![],'depth':null}):'');return _0x22194(null);});}return _0x22194(null);});};exports[_0x7949('0x19')]=function(_0x489c47){return new BPromise(function(_0x440b6f,_0x334a59){if(_0x489c47){return getUser({'interface':_0x489c47})[_0x7949('0xe')](function(_0x3dce01){logger[_0x7949('0x6')](_0x7949('0x1a'),_0x489c47,_0x3dce01?_0x7949('0x15'):_0x7949('0x16'));return _0x440b6f(_0x3dce01);})[_0x7949('0x17')](function(_0x345792){logger[_0x7949('0x9')](_0x7949('0x1b'),_0x345792?util['inspect'](_0x345792,{'showHidden':![],'depth':null}):'');return _0x440b6f(null);});}return _0x440b6f(null);});};exports['getUserByName']=function(_0x4d3a6d){return new BPromise(function(_0x23bf65,_0x341000){if(_0x4d3a6d){return getUser({'name':_0x4d3a6d})[_0x7949('0xe')](function(_0x2ebb04){logger[_0x7949('0x6')](_0x7949('0x1c'),_0x4d3a6d,_0x2ebb04?_0x7949('0x15'):_0x7949('0x16'));return _0x23bf65(_0x2ebb04);})[_0x7949('0x17')](function(_0x1dbe5b){logger['error']('[utils][getUserByName]',_0x1dbe5b?util[_0x7949('0x7')](_0x1dbe5b,{'showHidden':![],'depth':null}):'');return _0x23bf65(null);});}return _0x23bf65(null);});};exports[_0x7949('0x1d')]=function(_0x112b62){return new BPromise(function(_0x2c369d,_0x4ed569){if(_0x112b62){return client[_0x7949('0xa')](_0x7949('0x1e'),{'options':{'raw':!![],'attributes':['id',_0x7949('0xd'),_0x7949('0x1f'),_0x7949('0x20'),_0x7949('0x21')],'where':{'name':_0x112b62},'limit':0x1}})[_0x7949('0xe')](function(_0xb7ca05){logger[_0x7949('0x8')](_0x7949('0x22'),_0x112b62,_0xb7ca05?util[_0x7949('0x7')](_0xb7ca05,{'showHidden':![],'depth':null}):'');logger['info'](_0x7949('0x23'),_0x112b62,_0xb7ca05?_0x7949('0x15'):_0x7949('0x16'));return _0x2c369d(_0xb7ca05[_0x7949('0x12')][_0x7949('0x11')]?_0xb7ca05[_0x7949('0x12')][0x0]:null);})[_0x7949('0x17')](function(_0x2669bf){logger[_0x7949('0x9')](_0x7949('0x24'),_0x2669bf?util[_0x7949('0x7')](_0x2669bf,{'showHidden':![],'depth':null}):'');return _0x2c369d(null);});}return _0x2c369d(null);});};exports[_0x7949('0x25')]=function(_0x3dd3e9,_0x3912fa){return moment(_0x3dd3e9)[_0x7949('0x26')](_0x3912fa,_0x7949('0x27'))[_0x7949('0x28')](_0x7949('0x29'));};exports[_0x7949('0x2a')]=function(_0x36c329,_0x1cd4fa){return moment(_0x36c329)[_0x7949('0x2b')](_0x1cd4fa,_0x7949('0x27'))['format'](_0x7949('0x29'));};exports[_0x7949('0x2c')]=function(_0x2142b8,_0x5a1a7a){return moment(_0x2142b8)['diff'](moment(_0x5a1a7a),_0x7949('0x27'));};exports[_0x7949('0x2d')]=function(_0x3eb95a,_0x366cac){return parseInt(_0x3eb95a,0xa)+parseInt(_0x366cac,0xa);};exports[_0x7949('0x2e')]=function(){return moment()[_0x7949('0x28')](_0x7949('0x29'));};exports[_0x7949('0x2f')]=function(_0x34f988,_0x1aecdc){if(_0x1aecdc){return moment(_0x34f988)['isAfter'](_0x1aecdc);}return!![];};exports['isBefore']=function(_0x5834db,_0x4423fe){if(_0x4423fe){return moment(_0x5834db)[_0x7949('0x30')](_0x4423fe);}else if(_0x5834db){return!![];}return![];}; \ No newline at end of file +var _0x0f36=['diffTime','sumTime','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','[utils][getUserByName]','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract'];(function(_0x3709ea,_0x40f3e1){var _0x293d02=function(_0x4136be){while(--_0x4136be){_0x3709ea['push'](_0x3709ea['shift']());}};_0x293d02(++_0x40f3e1);}(_0x0f36,0x8b));var _0x60f3=function(_0x16aa70,_0x5b1f73){_0x16aa70=_0x16aa70-0x0;var _0x11875f=_0x0f36[_0x16aa70];return _0x11875f;};'use strict';var BPromise=require(_0x60f3('0x0'));var jayson=require(_0x60f3('0x1'));var moment=require(_0x60f3('0x2'));var util=require(_0x60f3('0x3'));var client=jayson[_0x60f3('0x4')][_0x60f3('0x5')]({'port':0x2329});var logger=require(_0x60f3('0x6'))(_0x60f3('0x7'));exports[_0x60f3('0x8')]=function(_0xb6e678,_0x3de903){logger[_0x60f3('0x8')](_0xb6e678,_0x3de903?util[_0x60f3('0x9')](_0x3de903,{'showHidden':![],'depth':null}):'');};exports[_0x60f3('0xa')]=function(_0xd8fc9d,_0x4b34ee){logger[_0x60f3('0xa')](_0xd8fc9d,_0x4b34ee?util[_0x60f3('0x9')](_0x4b34ee,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x21117b,_0x145b3){logger[_0x60f3('0xb')](_0x21117b,_0x145b3?util[_0x60f3('0x9')](_0x145b3,{'showHidden':![],'depth':null}):'');};exports[_0x60f3('0xc')]=function(_0xeea1be,_0x516f09){return client[_0x60f3('0xc')](_0xeea1be,{'body':_0x516f09})[_0x60f3('0xd')](function(_0x12ed45){logger[_0x60f3('0xa')](_0x60f3('0xe'),_0xeea1be,_0x12ed45?util['inspect'](_0x12ed45,{'showHidden':![],'depth':null}):'');})[_0x60f3('0xf')](function(_0x1d174c){logger[_0x60f3('0xb')](_0x60f3('0xe'),_0xeea1be,_0x1d174c?util[_0x60f3('0x9')](_0x1d174c,{'showHidden':![],'depth':null}):'');});};function getUser(_0x57b139){return client['request'](_0x60f3('0x10'),{'options':{'raw':!![],'attributes':['id',_0x60f3('0x11'),_0x60f3('0x12'),'interface'],'where':_0x57b139,'limit':0x1}})[_0x60f3('0xd')](function(_0x5786cb){logger[_0x60f3('0xa')](_0x60f3('0x13'),JSON[_0x60f3('0x14')](_0x57b139),_0x5786cb?util[_0x60f3('0x9')](_0x5786cb,{'showHidden':![],'depth':null}):'');return _0x5786cb[_0x60f3('0x15')][_0x60f3('0x16')]?_0x5786cb[_0x60f3('0x15')][0x0]:null;});}exports[_0x60f3('0x17')]=function(_0x1c2d71){return new BPromise(function(_0x459679,_0x1b29e1){if(_0x1c2d71){return getUser({'internal':_0x1c2d71})[_0x60f3('0xd')](function(_0x303445){logger[_0x60f3('0x8')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x1c2d71,_0x303445?_0x60f3('0x18'):_0x60f3('0x19'));return _0x459679(_0x303445);})[_0x60f3('0xf')](function(_0x11cb86){logger[_0x60f3('0xb')](_0x60f3('0x1a'),_0x11cb86?util['inspect'](_0x11cb86,{'showHidden':![],'depth':null}):'');return _0x459679(null);});}return _0x459679(null);});};exports[_0x60f3('0x1b')]=function(_0x244b0c){return new BPromise(function(_0x9df82c,_0x38e90e){if(_0x244b0c){return getUser({'interface':_0x244b0c})[_0x60f3('0xd')](function(_0x58c8f2){logger[_0x60f3('0x8')](_0x60f3('0x1c'),_0x244b0c,_0x58c8f2?'found':'notfound');return _0x9df82c(_0x58c8f2);})[_0x60f3('0xf')](function(_0x50d618){logger[_0x60f3('0xb')](_0x60f3('0x1d'),_0x50d618?util[_0x60f3('0x9')](_0x50d618,{'showHidden':![],'depth':null}):'');return _0x9df82c(null);});}return _0x9df82c(null);});};exports['getUserByName']=function(_0x553a4d){return new BPromise(function(_0x27449a,_0x26ff03){if(_0x553a4d){return getUser({'name':_0x553a4d})['then'](function(_0x1f1d4b){logger[_0x60f3('0x8')]('[utils][getUserByName]\x20name:%s\x20%s',_0x553a4d,_0x1f1d4b?_0x60f3('0x18'):_0x60f3('0x19'));return _0x27449a(_0x1f1d4b);})['catch'](function(_0x3daf66){logger[_0x60f3('0xb')](_0x60f3('0x1e'),_0x3daf66?util[_0x60f3('0x9')](_0x3daf66,{'showHidden':![],'depth':null}):'');return _0x27449a(null);});}return _0x27449a(null);});};exports['getVoiceQueueByName']=function(_0x67f874){return new BPromise(function(_0x1ab36d,_0x20e512){if(_0x67f874){return client[_0x60f3('0xc')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id','name','type',_0x60f3('0x1f'),_0x60f3('0x20')],'where':{'name':_0x67f874},'limit':0x1}})[_0x60f3('0xd')](function(_0x53123a){logger[_0x60f3('0xa')](_0x60f3('0x21'),_0x67f874,_0x53123a?util[_0x60f3('0x9')](_0x53123a,{'showHidden':![],'depth':null}):'');logger['info'](_0x60f3('0x22'),_0x67f874,_0x53123a?_0x60f3('0x18'):_0x60f3('0x19'));return _0x1ab36d(_0x53123a[_0x60f3('0x15')][_0x60f3('0x16')]?_0x53123a[_0x60f3('0x15')][0x0]:null);})[_0x60f3('0xf')](function(_0x41fc67){logger[_0x60f3('0xb')]('[utils][getVoiceQueueByName]',_0x41fc67?util[_0x60f3('0x9')](_0x41fc67,{'showHidden':![],'depth':null}):'');return _0x1ab36d(null);});}return _0x1ab36d(null);});};exports[_0x60f3('0x23')]=function(_0x203786,_0x45a203){return moment(_0x203786)[_0x60f3('0x24')](_0x45a203,_0x60f3('0x25'))[_0x60f3('0x26')](_0x60f3('0x27'));};exports['subtractTime']=function(_0x32cb45,_0x3884db){return moment(_0x32cb45)[_0x60f3('0x28')](_0x3884db,_0x60f3('0x25'))[_0x60f3('0x26')](_0x60f3('0x27'));};exports[_0x60f3('0x29')]=function(_0x5c8146,_0x848f2b){return moment(_0x5c8146)['diff'](moment(_0x848f2b),_0x60f3('0x25'));};exports[_0x60f3('0x2a')]=function(_0x3d1b03,_0x3bfc32){return parseInt(_0x3d1b03,0xa)+parseInt(_0x3bfc32,0xa);};exports['now']=function(){return moment()[_0x60f3('0x26')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x60f3('0x2b')]=function(_0x5c7f71,_0x32bab3){if(_0x32bab3){return moment(_0x5c7f71)[_0x60f3('0x2b')](_0x32bab3);}return!![];};exports[_0x60f3('0x2c')]=function(_0x35e9d8,_0x3fe7a3){if(_0x3fe7a3){return moment(_0x35e9d8)['isBefore'](_0x3fe7a3);}else if(_0x35e9d8){return!![];}return![];}; \ No newline at end of file